diff --git a/.clang-format b/.clang-format index a724b7fddf..87f9bf8e9e 100644 --- a/.clang-format +++ b/.clang-format @@ -1,4 +1,18 @@ --- BasedOnStyle: Chromium ColumnLimit: 100 -SortIncludes: false +SortIncludes: true +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^<[a-zA-Z_\-\.]+>' + Priority: 1 + - Regex: '^"[a-zA-Z_\-\.]+"' + Priority: 2 + - Regex: '^(<|")common.*' + Priority: 3 + - Regex: '^"third-party.*' + Priority: 4 + SortPriority: 5 + - Regex: '.*' + Priority: 5 + SortPriority: 4 diff --git a/.gitattributes b/.gitattributes index 478d1c2e54..84df2b71cd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,6 +3,8 @@ third-party/**/* linguist-generated test/decompiler/reference/** linguist-vendored # suppress from PR diffs - is just reviewing the same thing twice (if properly added to g_src) test/decompiler/reference/** linguist-generated +goal_src/import/** linguist-vendored +goal_src/import/** linguist-generated *.gc linguist-language=lisp *.gd linguist-language=lisp *.gs linguist-language=Scheme diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000000..6520fffef6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,81 @@ +name: "\U0001F41B Bug Report" +description: Create a bug report. +labels: ["bug"] +body: + - type: checkboxes + attributes: + label: Acknowledgements + description: Take a couple minutes to help our maintainers work faster. + options: + - label: I have [searched](https://github.com/open-goal/jak-project/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Aupdated-desc) for duplicate or closed bug reports + required: true + - label: I understand that I am supposed to provide my own legitimately obtained copy of the game + required: true + + - type: textarea + attributes: + label: Describe the Bug + description: A clear and concise description of what the bug is. You may post screenshots or videos of the bug here. + validations: + required: true + + - type: textarea + attributes: + label: How To Reproduce + description: Steps to reproduce the behavior. You can also post a video of it here. + validations: + required: true + + - type: dropdown + attributes: + label: Does this problem occur on original hardware or PCSX2? + description: Some things that may seem like bugs are actually exactly how the original game behaved. + options: + - Yes, it's unique to OpenGOAL + - Didn't check + - Not needed, bug is obvious + validations: + required: true + + - type: textarea + attributes: + label: Expected Behavior + description: A clear and concise description of the expected behavior. + placeholder: When I do X, Y should happen. + validations: + required: true + + - type: input + attributes: + label: Operating System + description: Windows version, Linux distribution, etc. + validations: + required: true + + - type: input + attributes: + label: OpenGOAL Version + description: Either the release version (vX.X.X) or the commit sha if you've built from source + validations: + required: true + + - type: dropdown + attributes: + label: Game Version + options: + - NTSC 1.0 (black label) + - NTSC Greatest Hits version (red label) + - PAL + - JP + validations: + required: true + + - type: dropdown + attributes: + label: Are you using a high refresh-rate monitor (>60Hz) + options: + - "No" + - "Yes" + validations: + required: true + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..0086358db1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: true diff --git a/.github/ISSUE_TEMPLATE/enhancement-request.yml b/.github/ISSUE_TEMPLATE/enhancement-request.yml new file mode 100644 index 0000000000..c959d9eec3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/enhancement-request.yml @@ -0,0 +1,24 @@ +name: "\U0001F680 Enhancement Request" +description: Suggest an improvement for an existing feature. +labels: ["enhancement"] +body: + - type: textarea + attributes: + label: What feature is your idea related to? + description: A clear and concise description of what the problem is. + validations: + required: true + + - type: textarea + attributes: + label: Describe the solution you'd like. + description: A clear and concise description of what you want to happen. + validations: + required: true + + - type: textarea + attributes: + label: Additional context + description: Any other context or screenshots about the enhancement request here. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 0000000000..78652ff606 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,24 @@ +name: "\U0001F3AE Game Feature Request" +description: Suggest an idea for the game +labels: ["game"] +body: + - type: textarea + attributes: + label: Is your feature request related to a problem? + description: A clear and concise description of what the problem is. + validations: + required: true + + - type: textarea + attributes: + label: Describe the solution you'd like. + description: A clear and concise description of what you want to happen. + validations: + required: true + + - type: textarea + attributes: + label: Additional context + description: Add any other context or screenshots about the feature request here. + validations: + required: false diff --git a/.github/scripts/releases/error-code-metadata.json b/.github/scripts/releases/error-code-metadata.json new file mode 100644 index 0000000000..0c0c35ca2a --- /dev/null +++ b/.github/scripts/releases/error-code-metadata.json @@ -0,0 +1,29 @@ +{ + "4000": { + "msg": "Validation Failed: Cannot locate ELF" + }, + "4001": { + "msg": "Validation Failed: Game serial missing from valid game database" + }, + "4002": { + "msg": "Validation Failed: ELF missing from valid game database" + }, + "4010": { + "msg": "Validation Failed: Bad or unexpected ISO contents" + }, + "4011": { + "msg": "Validation Failed: Extracted an unexpected amount of files from ISO" + }, + "4020": { + "msg": "Validation Failed: ISO Extraction failed, output directory did not contain expected files" + }, + "4030": { + "msg": "Decompilation Failed: An error occurred" + } + "4040": { + "msg": "Extraction Failed: Provided game data file was not an ISO file" + } + "4041": { + "msg": "Extraction Failed: Provided game data file was corrupt or has unexpected size" + } +} diff --git a/.github/scripts/releases/extract_build_linux.sh b/.github/scripts/releases/extract_build_linux.sh new file mode 100755 index 0000000000..8bd4be176d --- /dev/null +++ b/.github/scripts/releases/extract_build_linux.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +set -e + +DEST=${1} +SOURCE=${2} + +mkdir -p $DEST + +cp $SOURCE/build/game/gk $DEST +cp $SOURCE/build/goalc/goalc $DEST +cp $SOURCE/build/decompiler/extractor $DEST + +strip $DEST/gk +strip $DEST/goalc +strip $DEST/extractor + +mkdir -p $DEST/data +mkdir -p $DEST/data/launcher/ +mkdir -p $DEST/data/decompiler/ +mkdir -p $DEST/data/assets +mkdir -p $DEST/data/game +mkdir -p $DEST/data/log +mkdir -p $DEST/data/game/graphics/opengl_renderer/ + +cp -r $SOURCE/.github/scripts/releases/error-code-metadata.json $DEST/data/launcher/error-code-metadata.json +cp -r $SOURCE/decompiler/config $DEST/data/decompiler/ +cp -r $SOURCE/goal_src $DEST/data +cp -r $SOURCE/game/assets $DEST/data/game/ +cp -r $SOURCE/game/graphics/opengl_renderer/shaders $DEST/data/game/graphics/opengl_renderer +cp -r $SOURCE/custom_levels $DEST/data diff --git a/.github/scripts/releases/extract_build_windows.sh b/.github/scripts/releases/extract_build_windows.sh new file mode 100755 index 0000000000..7829505725 --- /dev/null +++ b/.github/scripts/releases/extract_build_windows.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -e + +DEST=${1} +SOURCE=${2} + +mkdir -p $DEST + +cp $SOURCE/build/bin/gk.exe $DEST +cp $SOURCE/build/bin/goalc.exe $DEST +cp $SOURCE/build/bin/extractor.exe $DEST + +mkdir -p $DEST/data +mkdir -p $DEST/data/launcher/ +mkdir -p $DEST/data/decompiler/ +mkdir -p $DEST/data/assets +mkdir -p $DEST/data/game +mkdir -p $DEST/data/log +mkdir -p $DEST/data/game/graphics/opengl_renderer/ + +cp -r $SOURCE/.github/scripts/releases/error-code-metadata.json $DEST/data/launcher/error-code-metadata.json +cp -r $SOURCE/decompiler/config $DEST/data/decompiler/ +cp -r $SOURCE/goal_src $DEST/data +cp -r $SOURCE/game/assets $DEST/data/game/ +cp -r $SOURCE/game/graphics/opengl_renderer/shaders $DEST/data/game/graphics/opengl_renderer +cp -r $SOURCE/custom_levels $DEST/data \ No newline at end of file diff --git a/.github/scripts/releases/upload-release-artifacts/index.js b/.github/scripts/releases/upload-release-artifacts/index.js index 57cf2f38ea..c8bd86ad4d 100644 --- a/.github/scripts/releases/upload-release-artifacts/index.js +++ b/.github/scripts/releases/upload-release-artifacts/index.js @@ -111,12 +111,8 @@ const { data: releaseAssetsPost } = await octokit.rest.repos.listReleaseAssets({ // Expected Assets, if we have all of them, we will publish it let expectedAssets = { - "windows-decompiler": false, - "windows-gk": false, - "windows-goalc": false, - "linux-decompiler": false, - "linux-gk": false, - "linux-goalc": false, + "windows": false, + "linux" : false, } for (var i = 0; i < releaseAssetsPost.length; i++) { diff --git a/.github/workflows/inform-pages-repo.yaml b/.github/workflows/inform-pages-repo.yaml index 94a5717764..12c19931ca 100644 --- a/.github/workflows/inform-pages-repo.yaml +++ b/.github/workflows/inform-pages-repo.yaml @@ -20,7 +20,7 @@ jobs: steps: - name: Send Dispatch if: github.repository == 'open-goal/jak-project' - uses: peter-evans/repository-dispatch@v1 + uses: peter-evans/repository-dispatch@v2 with: token: ${{ secrets.BOT_PAT }} repository: 'open-goal/open-goal.github.io' diff --git a/.github/workflows/linter-workflow.yaml b/.github/workflows/linter-workflow.yaml index 5f02880af4..77e7bd74f0 100644 --- a/.github/workflows/linter-workflow.yaml +++ b/.github/workflows/linter-workflow.yaml @@ -21,7 +21,9 @@ jobs: uses: actions/checkout@v2 - name: Get Package Dependencies - run: sudo apt install clang-format clang-tidy + run: | + sudo apt install clang-format clang-tidy + clang-format -version - name: Check Clang-Formatting run: | diff --git a/.github/workflows/linux-workflow.yaml b/.github/workflows/linux-workflow.yaml index b77a98d1b6..07f943b212 100644 --- a/.github/workflows/linux-workflow.yaml +++ b/.github/workflows/linux-workflow.yaml @@ -41,7 +41,7 @@ jobs: run: git submodule update --init --recursive -j 2 - name: Get Common Package Dependencies - run: sudo apt install build-essential cmake clang gcc g++ lcov make nasm libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev + run: sudo apt install build-essential cmake clang gcc g++ lcov make nasm libxrandr-dev libxinerama-dev libxcursor-dev libpulse-dev libxi-dev zip - name: Get Clang if: matrix.compiler == 'clang' @@ -53,7 +53,7 @@ jobs: cache_key: ${{ matrix.os }}-${{ matrix.compiler }} - name: CMake Generation - Clang - if: matrix.compiler == 'clang' + if: matrix.compiler == 'clang' && !startsWith(github.ref, 'refs/tags/') run: | export CC=clang export CXX=clang++ @@ -62,7 +62,19 @@ jobs: -DBUILD_FOR_RELEASE=ON \ -DCMAKE_C_COMPILER_LAUNCHER="${{ github.workspace }}"/buildcache/bin/buildcache \ -DCMAKE_CXX_COMPILER_LAUNCHER="${{ github.workspace }}"/buildcache/bin/buildcache \ - -DCODE_COVERAGE=ON -DASAN_BUILD=ON + -DASAN_BUILD=ON + + - name: CMake Generation - Clang - No ASAN + if: matrix.compiler == 'clang' && startsWith(github.ref, 'refs/tags/') + run: | + export CC=clang + export CXX=clang++ + cmake -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_FOR_RELEASE=ON \ + -DCMAKE_C_COMPILER_LAUNCHER="${{ github.workspace }}"/buildcache/bin/buildcache \ + -DCMAKE_CXX_COMPILER_LAUNCHER="${{ github.workspace }}"/buildcache/bin/buildcache \ + -DASAN_BUILD=OFF - name: CMake Generation - GCC if: matrix.compiler == 'gcc' @@ -88,7 +100,7 @@ jobs: run: ./test_code_coverage.sh - name: Submit Coverage Report to Codacy - if: ${{ matrix.compiler }} == 'gcc' + if: matrix.compiler == 'gcc' uses: codacy/codacy-coverage-reporter-action@v1 continue-on-error: true with: @@ -100,22 +112,17 @@ jobs: - name: Prepare Build Artifacts if: github.repository == 'open-goal/jak-project' && startsWith(github.ref, 'refs/tags/') && matrix.compiler == 'clang' run: | - mkdir -p ./ci-artifacts/ - cp ./build/decompiler/decompiler ./ci-artifacts/linux-decompiler.bin - cp ./build/game/gk ./ci-artifacts/linux-gk.bin - cp ./build/goalc/goalc ./ci-artifacts/linux-goalc.bin - chmod +x ./ci-artifacts/*.bin - strip --strip-debug ./ci-artifacts/linux-decompiler.bin - strip --strip-debug ./ci-artifacts/linux-gk.bin - strip --strip-debug ./ci-artifacts/linux-goalc.bin - ls -l ./ci-artifacts/ + mkdir -p ./ci-artifacts/out + ./.github/scripts/releases/extract_build_linux.sh ./ci-artifacts/out ./ + cd ci-artifacts/out + tar czf ../linux.tar.gz . - name: Upload Assets and Potential Publish Release if: github.repository == 'open-goal/jak-project' && startsWith(github.ref, 'refs/tags/') && matrix.compiler == 'clang' env: GITHUB_TOKEN: ${{ secrets.BOT_PAT }} ASSET_DIR: ${{ github.WORKSPACE }}/ci-artifacts - ASSET_EXTENSION: bin + ASSET_EXTENSION: gz TAG_TO_SEARCH_FOR: ${{ github.REF }} run: | cd ./.github/scripts/releases/upload-release-artifacts diff --git a/.github/workflows/update-controller-db.yaml b/.github/workflows/update-controller-db.yaml new file mode 100644 index 0000000000..8d4e627611 --- /dev/null +++ b/.github/workflows/update-controller-db.yaml @@ -0,0 +1,26 @@ +name: Update Controller Database + +on: + schedule: + - cron: "0 16 * * 1" # every monday @ 12pm EST - https://crontab.guru/#0_16_*_*_1 + +jobs: + update-controller-db: + if: github.repository == 'open-goal/jak-project' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.BOT_PAT }} + + - name: Get Latest DB + run: | + wget -O ./game/assets/sdl_controller_db.txt https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt + + - name: commit version bump + uses: EndBug/add-and-commit@v9 + with: + default_author: github_actor + author_name: "OpenGOALBot" + author_email: "OpenGOALBot@users.noreply.github.com" + message: "Updating Controller Database" diff --git a/.github/workflows/windows-workflow.yaml b/.github/workflows/windows-workflow.yaml index 8f8f24f040..5974536ef2 100644 --- a/.github/workflows/windows-workflow.yaml +++ b/.github/workflows/windows-workflow.yaml @@ -81,19 +81,18 @@ jobs: # ---- Release / Tagging related steps ---- - name: Prepare Build Artifacts if: github.repository == 'open-goal/jak-project' && startsWith(github.ref, 'refs/tags/') && matrix.compiler == 'clang' + shell: bash run: | - mkdir -p ./ci-artifacts/ - cp ./build/bin/decompiler.exe ./ci-artifacts/windows-decompiler.exe - cp ./build/bin/gk.exe ./ci-artifacts/windows-gk.exe - cp ./build/bin/goalc.exe ./ci-artifacts/windows-goalc.exe - ls ./ci-artifacts/ + mkdir -p ./ci-artifacts/out + ./.github/scripts/releases/extract_build_windows.sh ./ci-artifacts/out ./ + 7z a -tzip ./ci-artifacts/windows.zip ./ci-artifacts/out/* - name: Upload Assets and Potential Publish Release if: github.repository == 'open-goal/jak-project' && startsWith(github.ref, 'refs/tags/') && matrix.compiler == 'clang' env: GITHUB_TOKEN: ${{ secrets.BOT_PAT }} ASSET_DIR: ${{ github.WORKSPACE }}/ci-artifacts - ASSET_EXTENSION: exe + ASSET_EXTENSION: zip TAG_TO_SEARCH_FOR: ${{ github.REF }} run: | cd ./.github/scripts/releases/upload-release-artifacts diff --git a/.gitignore b/.gitignore index 536db679d9..bd3a231d0a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ cmake-build-debug/* .idea/* build/* decompiler_out/* +decompiler_out2/* logs/* # wsl apparently builds to here? @@ -39,4 +40,8 @@ imgui.ini node_modules/ # texture replacements -texture_replacements/* \ No newline at end of file +texture_replacements/* + +# generated cmake files +svnrev.h +ci-artifacts/ diff --git a/.vs/launch.vs.json b/.vs/launch.vs.json index 3b6301e167..1f9e767917 100644 --- a/.vs/launch.vs.json +++ b/.vs/launch.vs.json @@ -75,7 +75,7 @@ "project" : "CMakeLists.txt", "projectTarget" : "goalc.exe (bin\\goalc.exe)", "name" : "Run - REPL - Auto Listen", - "args" : [ "-auto-lt" ] + "args" : [ "--auto-lt" ] }, { "type" : "default", @@ -84,6 +84,13 @@ "name" : "Run - Decompiler - Jak 1", "args" : [ "${workspaceRoot}/decompiler/config/jak1_ntsc_black_label.jsonc", "${workspaceRoot}/iso_data", "${workspaceRoot}/decompiler_out"] }, + { + "type" : "default", + "project" : "CMakeLists.txt", + "projectTarget" : "decompiler.exe (bin\\decompiler.exe)", + "name" : "Run - Decompiler - Jak 1 - Data Only", + "args" : [ "${workspaceRoot}/decompiler/config/jak1_ntsc_black_label.jsonc", "${workspaceRoot}/iso_data", "${workspaceRoot}/decompiler_out", "decompile_code=false"] + }, { "type" : "default", "project" : "CMakeLists.txt", @@ -125,6 +132,13 @@ "projectTarget" : "dgo_unpacker.exe (bin\\dgo_unpacker.exe)", "name" : "Run - DGO Unpacker (test)", "args" : [ "C:\\GameData\\Jak1\\Backup\\DGO-PAL\\GAME", "C:\\GameData\\Jak1\\Backup\\DISC-PAL\\CGO\\GAME.CGO"] + }, + { + "type" : "default", + "project" : "CMakeLists.txt", + "projectTarget" : "extractor.exe (bin\\extractor.exe)", + "name" : "Run - Extractor - Extract", + "args" : [ "\"C:\\Game\\PS2SMB\\DVD\\SCPS_150.21.Jak & Daxter - TPL (NTSC-J).iso\""] } ] } diff --git a/CMakeLists.txt b/CMakeLists.txt index 69e689aea1..116d7a0ba0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,20 +21,24 @@ endif() if(MSVC AND (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) message(STATUS "Clang on MSVC detected! Adding compile flags") set(CMAKE_CXX_FLAGS - "-Xclang -fcxx-exceptions \ + "${CMAKE_CXX_FLAGS} \ + -Xclang -fcxx-exceptions \ -Xclang -fexceptions \ -Xclang -std=c++17 \ -Xclang -D_CRT_SECURE_NO_WARNINGS \ - -mavx \ - -Wno-c++11-narrowing -Wno-c++98-compat -W3") - - # additional c++ flags for release mode for our projects - if(CMAKE_BUILD_TYPE MATCHES "Release") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2 /Ob2") - endif() + /arch:AVX \ + -Wno-c++11-narrowing -Wno-c++98-compat -Wno-c++20-compat -W3") # linker flags - set(CMAKE_EXE_LINKER_FLAGS "/STACK:16000000,16384") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:16000000,16384") + + # additional c++ and linker flags for release mode for our projects + if(CMAKE_BUILD_TYPE MATCHES "Release") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2 /Ob2") + elseif(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2 /Ob2") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG") + endif() elseif(UNIX) message(STATUS "GCC detected! Adding compile flags") @@ -69,10 +73,18 @@ elseif(MSVC) # set(CMAKE_CXX_FLAGS_DEBUG "/ZI") endif() # c++ flags for all build types - set(CMAKE_CXX_FLAGS "/EHsc /utf-8 /arch:AVX") - + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /utf-8 /arch:AVX") + # linker flags - set(CMAKE_EXE_LINKER_FLAGS "/STACK:16000000,16384") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:16000000,16384") + + # additional c++ and linker flags for specific build types + if(CMAKE_BUILD_TYPE MATCHES "Release") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2 /Ob2") + elseif(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2 /Ob2") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG") + endif() endif() if(WIN32) @@ -80,6 +92,9 @@ if(WIN32) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + + set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION 7.1.7600.0.30514) # win7.1, supports xp + message("Windows SDK version: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}") endif() if(ASAN_BUILD) @@ -112,6 +127,8 @@ add_subdirectory(common) # build decompiler add_subdirectory(decompiler) +add_subdirectory(third-party/cubeb) + # build glfw library add_subdirectory(third-party/glfw) add_subdirectory(third-party/zstd) @@ -145,6 +162,11 @@ add_subdirectory(third-party/lzokay EXCLUDE_FROM_ALL) # build format library add_subdirectory(third-party/fmt EXCLUDE_FROM_ALL) +add_subdirectory(third-party/stb_image EXCLUDE_FROM_ALL) +add_subdirectory(third-party/tiny_gltf EXCLUDE_FROM_ALL) +add_subdirectory(third-party/xdelta3 EXCLUDE_FROM_ALL) + + # discord rich presence include_directories(third-party/discord-rpc/include) add_subdirectory(third-party/discord-rpc EXCLUDE_FROM_ALL) diff --git a/CMakePresets.json b/CMakePresets.json index c82ad4fd9e..9dadfa309a 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -54,6 +54,45 @@ }, "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } } }, + { + "name": "RelWithDebInfo-clang", + "displayName": "Windows RelWithDebInfo (clang-cl)", + "description": "Target Windows with the Visual Studio development environment.", + "generator": "Ninja", + "binaryDir": "${sourceDir}/out/build/Release", + "architecture": { + "value": "x64", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}", + "INSTALL_GTEST": "True", + "CMAKE_C_COMPILER": "clang-cl", + "CMAKE_CXX_COMPILER": "clang-cl" + }, + "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } } + }, + { + "name": "Release-clang-static", + "displayName": "Windows Release - Static (clang-cl)", + "description": "Target Windows with the Visual Studio development environment.", + "generator": "Ninja", + "binaryDir": "${sourceDir}/out/build/Release", + "architecture": { + "value": "x64", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}", + "INSTALL_GTEST": "True", + "CMAKE_C_COMPILER": "clang-cl", + "CMAKE_CXX_COMPILER": "clang-cl", + "BUILD_FOR_RELEASE": "true" + }, + "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } } + }, { "name": "Debug-msvc", "displayName": "Windows Debug (msvc)", diff --git a/FAQ.md b/FAQ.md index 063c858055..29fc2271dc 100644 --- a/FAQ.md +++ b/FAQ.md @@ -1,73 +1,72 @@ -### How is this project possible? +### How finished is the project? +We estimate it is about 80% done. Most of the renderers and sound are finished, but there are still a few bugs. +The project is still in development. If you want to give it a try, feel free, but we don't provide detailed support yet. + +### Is there a way to try it without compiling it myself? +Yes, there are release versions available here: https://github.com/open-goal/jak-project/releases +Download the latest one and extract all the files. Drag an ISO of the game to the "extractor" program to extract the assets. After that finishes, you can run the "gk" program to start playing. + +### How is this project possible? Naughty Dog created a custom programming language called [GOAL](https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp), along with a compiler for it. GOAL makes up 98% of all the code in Jak & Daxter, and the GOAL compiler does not have the same amount of optimizations as C or C++ compilers have, which means that the compiler often times left specific instructions that denote some specific kind of control flow, which lets us piece back the original structure of the code accurately for about 99% of the functions in the game. Nearly every type in GOAL also has an autogenerated debug `inspect` method, which prints all of a type's fields by default. These `inspect` methods can tell us what fields were in the type, at what offset, and what their type was. -### How finished is the project? -We estimate it is about 75% done. Most of the renderers are finished and there is no sound. - ### When will the project be finished? -Hopefully just a few more months! - -### Why is there no sound? -We have not started work on sound at the moment. +Hopefully just a few more months! ### Will you also decompile Jak II? -Likely yes! +Yes! But we haven't started yet. ### Will you also decompile Jak X? -We don't know yet. +We don't know yet. -### How can I run the game? -The project readme contains instructions on installing and running the game. You need to bring your own copy of the game, we provide none of its assets. +### How can I compile the project for myself? +The project readme contains instructions on installing and running the game. You need to bring your own copy of the game, we provide none of its assets. ### I am having trouble running the game! -Keep in mind the project is currently in development and is not adapted for end users at the moment. If you are having trouble, there are some extra troubleshooting steps at the bottom of this page. If the common issues do not include your specific issue, feel free to join the discord server and ask for help in the help channel. +Keep in mind the project is currently in development and is not adapted for end users at the moment. If you are having trouble, there are some extra troubleshooting steps at the bottom of this page. If the common issues do not include your specific issue, feel free to join the discord server and ask for help in the help channel. ### Does the game have differences? I don't remember these options! -We have added a plethora of options to the game settings (and removed some that didn't make sense) so that you can have a more up to date experience, or a more PS2-like experience if you decide. It is up to you! There are also a bunch of extra goodies and added secrets to find out. We are aiming to keep the core gameplay (controls, physics, behaviors, etc.) identical however, so if you find any issues or differences with this then do not hesitate to tell us about it. +We have added a plethora of options to the game settings (and removed some that didn't make sense) so that you can have a more up to date experience, or a more PS2-like experience if you decide. It is up to you! There are also a bunch of extra goodies and added secrets to find out. We are aiming to keep the core gameplay (controls, physics, behaviors, etc.) identical however, so if you find any issues or differences with this then do not hesitate to tell us about it. ### Where can I find a list of differences? -[This page](https://github.com/open-goal/jak-project/issues/386) contains a list of ideas and suggestions we have for the game, but it does not cover all the deliberate changes we have made. We will probably compile a list at some point! In the meantime, feel free to ask us about this. +[This page](https://github.com/open-goal/jak-project/issues/386) contains a list of ideas and suggestions we have for the game, but it does not cover all the deliberate changes we have made. We will probably compile a list at some point! In the meantime, feel free to ask us about this. ### Will there be bug fixes to the game? -The original game had a few issues of varying severity - from progress softlocks to crashing - that we are aiming to patch. The complexity of these issues is varying (if they were simple to reproduce and fix, Naughty Dog likely would have done it), but so far we have fixed 2 issues that could crash the game. +The original game had a few issues of varying severity - from progress softlocks to crashing - that we are aiming to patch. The complexity of these issues is varying (if they were simple to reproduce and fix, Naughty Dog likely would have done it), but so far we have fixed 2 issues that could crash the game. ### Will there be mod support? -In the future yes! We intend to make it as easy as it can be to make your own code or import graphics for the game. +In the future yes! We intend to make it as easy as we can to make your own code or import graphics for the game. ### What is this menu? Why am I not dying sometimes? -This might be the result of the game beeing booted in debugging mode. The project is still in development and we rely on the game's built-in debug features (along with some we made ourselves) for testing and development. The final product will have this debug mode disabled. In the meantime, have fun with all the options! Keep in mind some don't work very well. +This might be the result of the game being booted in debugging mode. The project is still in development and we rely on the game's built-in debug features (along with some we made ourselves) for testing and development. The final product will have this debug mode disabled. In the meantime, have fun with all the options! Keep in mind some don't work very well. ### What are the minimum requirements? These are not totally set in stone as the project is not complete. These are the minimum architecture requirements for the project: - x86-64 CPU with AVX support. Most, if not all, 64-bit CPUs should work. OpenGOAL has a very small CPU footprint, so most modern CPUs will run the game fine. - Graphics card that supports OpenGL 4.3. The rendering code is still very much in progress. NVIDIA graphics cards should have no issue running the game, but AMD cards might struggle unless you have a more powerful one. -- You might experience slower loads with a hard drive compared to an SSD. +- You might experience slower loads with a hard drive compared to an SSD. ### Will there be a Vulkan version of the game? -Probably yes, in the future! +Probably yes, in the future! ### I'd like to contribute, but don't know where to start! -Great to hear! Any help is good help. If you haven't already, please read the project readme. It has information on what is done, what isn't done, what is being worked on, the project layout and how it all works. Then just join our development discord server and we can help you further. +Great to hear! Any help is good help. If you haven't already, please read the project readme. It has information on what is done, what isn't done, what is being worked on, the project layout and how it all works. Then just join our development Discord server and we can help you further. ### Will you also decompile other games that aren't Jak? -No. +No. ### Is this project legal? -Yes. +Yes. -## Troubleshooting - -### None of the tools are working! -Because of its in-development state, we provide no pre-built binaries at the moment. The project readme has instructions on how to compile the tools. +## Troubleshooting ### I am getting "illegal operation"/"illegal instruction" errors when running the game or tools. This shouldn't happen, so please contact us in the support channel of the discord server and we can help, and tell us if your CPU supports AVX, AVX2 or AVX512. ### The game is really slow. -Your GPU is probably too weak and our renderers too slow. However, we plan on making significant changes to the renderers over time to improve performance. The merc renderer right now is very slow, if you would like to turn off then head to the debug menu by pressing R3, then go to `Render...` and turn `merc` off. +Your GPU is probably too weak and our renderers too slow. We plan on making significant changes to the renderers over time to improve performance. The merc renderer right now is very slow, if you would like to turn it off then head to the debug menu by pressing R3, then go to `Render...` and turn `merc` off. ### The game crashed!! -Crap! Contact us in the help channel on the discord server and tell us about it! Post the log files as well. These are located in the `log` folder of the project. +Curses! Contact us in the help channel on the discord server and tell us about it! Post the log files as well. These are located in the `log` folder of the project. Make sure you tell us exactly how the crash happened. -### The game crashed when entering the final boss area! -This one specifically is known. We are investigating this at the moment, so don't worry. +### I am having some other issue or found a bug with the game/tools. +First, scroll through our [issues](https://github.com/open-goal/jak-project/issues) page to make sure that your issue hasn't been reported already. If it hasn't, feel free to open up a new issue, or report it to us directly. Make sure you provide reproduction steps! We can't always guess why things go wrong. diff --git a/README.md b/README.md index 7aa2913ffb..259f103ae0 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ - [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) @@ -47,24 +46,24 @@ This project is to port Jak 1 (NTSC, "black label" version) to PC. Over 98% of t - create tools to repack game assets into a format that our port uses. Our objectives are: -- make the port a "native application" on x86-64, with high performance. It shouldn't emulated, interpreted, or transpiled. +- make the port a "native application" on x86-64, with high performance. It shouldn't be emulated, interpreted, or transpiled. - Our GOAL compiler's performance should be around the same as unoptimized C. - try to match things from the original game and development as possible. For example, the original GOAL compiler supported live modification of code while the game is running, so we do the same, even though it's not required for just porting the game. - support modifications. It should be possible to make edits to the code without everything else breaking. We support both Linux and Windows on x86-64. -We have a Discord server where we discuss development. https://discord.gg/VZbXMHXzWv +### **[Please read the FAQ by clicking here if you have any questions.](FAQ.md)** -**[If you have any questions, please read the FAQ here beforehand.](FAQ.md)** +We have a Discord server where we discuss development: https://discord.gg/VZbXMHXzWv ## 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. +So far, we've decompiled around 400,000 lines of GOAL code, out of an estimated 500,000 total lines from the original game. 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! Here are some screenshots of the renderer: -![](./docs/img/screenshot_hut_new_small.png) -![](./docs/img/screenshot_junglenew_custommood_small.png) +![](./docs/img/promosmall1.png) +![](./docs/img/promosmall2.png) YouTube playlist: https://www.youtube.com/playlist?list=PLWx9T30aAT50cLnCTY1SAbt2TtWQzKfXX @@ -75,10 +74,9 @@ We don't save any assets from the game - you must bring your own copy of the gam ## What's Next -- Continue decompilation of GOAL code. We've made huge progress recently in decompiling gameplay code. We're finishing that up and also working on the some of the rendering code. Here's our decompilation progress over the past year: ![](./docs/img/code_progress.png) -- Bug testing! The game can be beaten 100%, but it's possible a few things do not work correctly. -- 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. +- Bug testing! The game can be beaten 100% from start to finish, but it's possible a few things do not work correctly. +- Improve the decompiler and clean up decompilation of GOAL code. We are always finding new features and macros in the GOAL language. +- Investigate and rewrite the more complicated renderers. ## Getting Started - Linux @@ -87,7 +85,7 @@ We don't save any assets from the game - you must bring your own copy of the gam 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 python +sudo apt install gcc make cmake build-essential g++ nasm clang-format libxrandr-dev libxinerama-dev libxcursor-dev libpulse-dev libxi-dev python sudo sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin ``` @@ -120,10 +118,12 @@ cmake -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_EXE_LINKER_FLAGS="-fuse Install packages and init repository: ```sh -sudo pacman -S gcc make cmake base-devel g++ nasm python -yay -S taskfile-git +sudo pacman -S cmake libpulse base-devel nasm python +yay -S go-task ``` +For Arch only, replace `task` with `go-task` in the rest of the instructions. + Compile: ```sh @@ -136,24 +136,26 @@ Run tests: ./test.sh ``` -### With Nix +### Fedora -If your Nix supports flakes: +Install packages and init repository: ```sh -nix develop # development environment -nix build # package -nix develop '.#jak-asan-dev' # development environment with Clang -nix build '.#jak-asan' # package with Clang ASan build +sudo dnf install cmake lld clang nasm libX11-devel libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel pulseaudio-libs-devel +sudo sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin ``` -Otherwise, with traditional Nix: +Compile with `clang`: ```sh -nix-shell # development environment -nix-build # package -nix-shell -A packages.x86_64-linux.jak-asan-dev # development environment with Clang -nix-build -A packages.x86_64-linux.jak-asan # package with Clang ASan build +cmake -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -B build +cmake --build build -j$(nproc) +``` + +Run tests: + +```sh +./test.sh ``` ## Getting Started - Windows @@ -221,16 +223,16 @@ 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 > +g > ``` Run the following to build the game: @@ -301,7 +303,7 @@ gc> 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 that are not loaded automatically by the engine have instructions for how to run them. +Check out the `pc_debug`, `examples` and `pc` folders under `goal_src` for some examples of GOAL code we wrote. The debug files that are not loaded automatically by the engine have instructions for how to run them. ## Project Layout @@ -315,14 +317,15 @@ The second component to the project is the decompiler. You must have a copy of t Then run `decomp.sh` (Linux) or `decomp-jak1.bat` (Windows) to run the decompiler. The decompiler will extract assets to the `assets` folder. These assets will be used by the compiler when building the port, and you may want to turn asset extraction off after running it once. The decompiler will output code and other data intended to be inspected by humans in the `decompiler_out` folder. Stuff in this folder will not be used by the compiler. -The third is the game source code, written in OpenGOAL. This is located in `goal_src`. All GOAL and GOOS code should be in this folder. Right now most of this is placeholders or incomplete, but you can take a look at `kernel/gcommon.gc` or `goal-lib.gc` to see some in-progress source code. +The third is the game source code, written in OpenGOAL. This is located in `goal_src`. All GOAL and GOOS code should be in this folder. The final component is the "runtime", located in `game`. This is the part of the game that's written in C++. In the port, that includes: - The "C Kernel", which contains the GOAL linker and some low-level GOAL language features. GOAL has a completely custom dynamically linked object file format so in order to load the first GOAL code, you need a linker written in C++. Some low-level functions for memory allocation, communicating with the I/O Processor, symbol table, strings, and the type system are also implemented in C, as these are required for the linker. It also listens for incoming messages from the compiler and passes them to the running game. This also initializes the game, by initializing the PS2 hardware, allocating the GOAL heaps, loading the GOAL kernel off of the DVD, and executing the kernel dispatcher function. This is in the `game/kernel` folder. This should be as close as possible to the game, and all differences should be noted with a comment. - Implementation of Sony's standard library. GOAL code can call C library functions, and Naughty Dog used some Sony library functions to access files, memory cards, controllers, and communicate with the separate I/O Processor. The library functions are in `game/sce`. Implementations of library features specific to the PC port are located in `game/system`. -- The I/O Processor driver, Overlord. The PS2 had a separate CPU called the I/O Processor (IOP) that was directly connected to the DVD drive hardware and the sound hardware. Naughty Dog created a custom driver for the IOP that handled streaming data off of the DVD. It is much more complicated than I first expected. It's located in `game/overlord`. Like the C kernel, we try to keep this as close as possible to the actual game. -- Sound Code. Naughty Dog used a third party library for sound. We have not started on this yet. -- PC specific graphics stuff. We have a functional OpenGL renderer and context that can create a game window and display graphics on it. The specific renderers used by the game however are mostly unimplemented. We have a debug, sprite and tfrag renderers, which is enough to render most of the game world, on-screen text and sprites like the progress menu. This is located in `game/graphics`. Many liberties will be taken to make this work, but the end result should closely match the actual game. +- The I/O Processor driver, OVERLORD. The PS2 had a separate CPU called the I/O Processor (IOP) that was directly connected to the DVD drive hardware and the sound hardware. Naughty Dog created a custom driver for the IOP that handled streaming data off of the DVD. It is much more complicated than I first expected. It's located in `game/overlord`. Like the C kernel, we try to keep this as close as possible to the actual game. +- Sound code. Naughty Dog used a third party library for sound called `989SND`. Code for the library and an interface for it is located in `game/sound`. +- PC specific graphics code. We have a functional OpenGL renderer and context that can create a game window and display graphics on it. The specific renderers used by the game however are mostly implemented. Aside from post-processing effects, everything in the game is rendered. This is located in `game/graphics`. While many liberties will be taken to make this work, the end result should very closely match the actual game. +- Extra assets used by the port in some fashion, located in `game/assets`. These include extra text files, icons, etc. ## Directory Layout @@ -368,6 +371,7 @@ The final component is the "runtime", located in `game`. This is the part of the - `examples`: Example GOAL code we have written. - `test`: Test code we have written. - `pc_debug`: GOAL code for PC-specific debugging. Also written by us. + - `pc`: GOAL code for PC-specific features. Also written by us. - `user`: User sandboxes. Written by you! And anyone else that wishes to share their user code. - `goalc`: The OpenGOAL compiler. - `compiler`: The implementation of the OpenGOAL language. @@ -377,7 +381,7 @@ The final component is the "runtime", located in `game`. This is the part of the - `listener`: The OpenGOAL listener, which connects the compiler to a running GOAL program for the interactive REPL. - `make`: The OpenGOAL build system, builds both code and data files. - `regalloc`: Register allocator. -- `iso_data`: +- `iso_data`: Location of the user-provided DVD contents of the game that the decompiler extracts game assets and code from. - `out`: Outputs from the build process. Only the `iso` subfolder should contain assets used by the game. - `iso`: Final outputs that are used by the game. - `obj`: Object files generated by the compiler. @@ -386,7 +390,8 @@ The final component is the "runtime", located in `game`. This is the part of the - `test`: Unit tests (run on GitHub Actions). - `third-party`: Third party libraries. - CMake Code Coverage. For code coverage statistics on GitHub builds. - - `fmt`. String formatting library. + - `discord-rpc`: Discord Rich Presence library. + - `fmt`: String formatting library. - `googletest`: Test framework. - `inja`: templating library used for generating test code for compiler tests. - `lzokay`: decompression code for Jak 2 and later DGOs. diff --git a/Taskfile.yml b/Taskfile.yml index 22e82f5a9b..7ed41a9f12 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -6,43 +6,48 @@ includes: tasks: # GENERAL extract-jak1: + desc: "Extracts Jak 1 - NTSC - Black Label assets" preconditions: - sh: test -f {{.DECOMP_BIN_RELEASE_DIR}}/decompiler{{.EXE_FILE_EXTENSION}} - msg: "Couldn't locate decompiler executable -- Have you compiled in release mode?" + msg: "Couldn't locate decompiler executable in '{{.DECOMP_BIN_RELEASE_DIR}}/decompiler'" cmds: - '{{.DECOMP_BIN_RELEASE_DIR}}/decompiler "./decompiler/config/jak1_ntsc_black_label.jsonc" "./iso_data" "./decompiler_out" "decompile_code=false"' boot-game: + desc: "Boots the game" preconditions: - - sh: test -f {{.DECOMP_BIN_RELEASE_DIR}}/gk{{.EXE_FILE_EXTENSION}} - msg: "Couldn't locate runtime executable -- Have you compiled in release mode?" + - sh: test -f {{.GK_BIN_RELEASE_DIR}}/gk{{.EXE_FILE_EXTENSION}} + msg: "Couldn't locate runtime executable in '{{.GK_BIN_RELEASE_DIR}}/gk'" cmds: - "{{.GK_BIN_RELEASE_DIR}}/gk -boot -fakeiso -debug -v" run-game: + desc: "Start the game's runtime" preconditions: - - sh: test -f {{.DECOMP_BIN_RELEASE_DIR}}/gk{{.EXE_FILE_EXTENSION}} - msg: "Couldn't locate runtime executable -- Have you compiled in release mode?" + - sh: test -f {{.GK_BIN_RELEASE_DIR}}/gk{{.EXE_FILE_EXTENSION}} + msg: "Couldn't locate runtime executable in '{{.GK_BIN_RELEASE_DIR}}/gk'" cmds: - "{{.GK_BIN_RELEASE_DIR}}/gk -fakeiso -debug -v" run-game-quiet: preconditions: - - sh: test -f {{.DECOMP_BIN_RELEASE_DIR}}/gk{{.EXE_FILE_EXTENSION}} - msg: "Couldn't locate runtime executable -- Have you compiled in release mode?" + - sh: test -f {{.GK_BIN_RELEASE_DIR}}/gk{{.EXE_FILE_EXTENSION}} + msg: "Couldn't locate runtime executable in '{{.GK_BIN_RELEASE_DIR}}/gk'" cmds: - "{{.GK_BIN_RELEASE_DIR}}/gk -fakeiso" repl: + desc: "Start the REPL" env: OPENGOAL_DECOMP_DIR: "jak1/" preconditions: - - sh: test -f {{.DECOMP_BIN_RELEASE_DIR}}/goalc{{.EXE_FILE_EXTENSION}} - msg: "Couldn't locate compiler executable -- Have you compiled in release mode?" + - sh: test -f {{.GOALC_BIN_RELEASE_DIR}}/goalc{{.EXE_FILE_EXTENSION}} + msg: "Couldn't locate compiler executable in '{{.GOALC_BIN_RELEASE_DIR}}/goalc'" cmds: - "{{.GOALC_BIN_RELEASE_DIR}}/goalc" # DEVELOPMENT format: + desc: "Format code" 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 + - cmd: npx prettier --write ./decompiler/config/jak1_ntsc_black_label/*.jsonc ignore_error: true run-game-headless: cmds: @@ -51,7 +56,7 @@ tasks: env: OPENGOAL_DECOMP_DIR: "jak1/" cmds: - - "{{.GOALC_BIN_RELEASE_DIR}}/goalc -auto-lt" + - "{{.GOALC_BIN_RELEASE_DIR}}/goalc --auto-lt" # DECOMPILING decomp: cmds: @@ -125,7 +130,3 @@ 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/CMakeLists.txt b/common/CMakeLists.txt index eb9bb73ceb..6c9656c9fd 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -1,12 +1,16 @@ add_library(common audio/audio_formats.cpp cross_os_debug/xdbg.cpp - cross_sockets/xsocket.cpp + cross_sockets/XSocket.cpp + cross_sockets/XSocketServer.cpp + cross_sockets/XSocketClient.cpp + custom_data/pack_helpers.cpp custom_data/TFrag3Data.cpp + deserialization/subtitles/subtitles.cpp dma/dma.cpp dma/dma_copy.cpp dma/gs.cpp - + global_profiler/GlobalProfiler.cpp goos/Interpreter.cpp goos/Object.cpp goos/ParseHelpers.cpp @@ -16,8 +20,11 @@ add_library(common goos/Reader.cpp goos/TextDB.cpp goos/ReplUtils.cpp - math/geometry.cpp log/log.cpp + math/geometry.cpp + nrepl/ReplClient.cpp + nrepl/ReplServer.cpp + serialization/subtitles/subtitles.cpp type_system/defenum.cpp type_system/deftype.cpp type_system/state.cpp @@ -28,21 +35,20 @@ add_library(common util/Assert.cpp util/BitUtils.cpp util/compress.cpp + util/crc32.cpp util/dgo_util.cpp util/DgoReader.cpp util/DgoWriter.cpp util/diff.cpp util/FileUtil.cpp util/json_util.cpp + util/read_iso_file.cpp + util/SimpleThreadGroup.cpp util/Timer.cpp util/os.cpp util/print_float.cpp util/FontUtils.cpp - util/FrameLimiter.cpp - util/image_loading.cpp - goos/Printer.cpp - goos/PrettyPrinter2.cpp - ) + util/FrameLimiter.cpp) target_link_libraries(common fmt lzokay replxx libzstd_static) diff --git a/common/audio/audio_formats.cpp b/common/audio/audio_formats.cpp index db2a104104..b6f3216eb1 100644 --- a/common/audio/audio_formats.cpp +++ b/common/audio/audio_formats.cpp @@ -1,5 +1,7 @@ #include "audio_formats.h" + #include "common/util/BinaryWriter.h" + #include "third-party/fmt/core.h" /*! @@ -289,8 +291,7 @@ void test_encode_adpcm(const std::vector& samples, for (int i = 0; i < 5; i++) { fmt::print(" [{}] {} {}\n", i, filter_errors[i], filter_shifts[i]); } - fmt::print("prev: {} {}\n", prev_block_samples[0], prev_block_samples[1]); - ASSERT(false); + ASSERT_MSG(false, fmt::format("prev: {} {}", prev_block_samples[0], prev_block_samples[1])); } prev_block_samples[0] = samples.at(block_idx * 28 + 27); diff --git a/common/audio/audio_formats.h b/common/audio/audio_formats.h index ea72c50f5e..0b5d2b2487 100644 --- a/common/audio/audio_formats.h +++ b/common/audio/audio_formats.h @@ -3,8 +3,8 @@ #include #include -#include "common/util/BinaryReader.h" #include "common/common_types.h" +#include "common/util/BinaryReader.h" // The header data for a simple wave file struct WaveFileHeader { diff --git a/common/cross_os_debug/xdbg.cpp b/common/cross_os_debug/xdbg.cpp index c3179cad15..3768baab34 100644 --- a/common/cross_os_debug/xdbg.cpp +++ b/common/cross_os_debug/xdbg.cpp @@ -4,27 +4,32 @@ * Nothing in here should hold state, that should all be managed in Debugger. */ -#include -#include "common/goal_constants.h" -#include "common/util/Timer.h" -#include "third-party/fmt/core.h" #include "xdbg.h" +#include + +#include "common/goal_constants.h" +#include "common/util/Timer.h" + +#include "third-party/fmt/core.h" + #ifdef __linux +#include #include + +#include +#include #include #include -#include -#include #include #include #include -#include #elif _WIN32 #define NOMINMAX +#define WIN32_LEAN_AND_MEAN #include -#include #include +#include #endif namespace xdbg { @@ -38,9 +43,7 @@ ThreadID::ThreadID(pid_t _id) : id(_id) {} /*! * In Linux, the string representation of a ThreadID is just the number printed in base 10 */ -ThreadID::ThreadID(const std::string& str) { - id = std::stoi(str); -} +ThreadID::ThreadID(const std::string& str) : id(std::stoi(str)) {} std::string ThreadID::to_string() const { return std::to_string(id); @@ -523,7 +526,7 @@ bool check_stopped(const ThreadID& tid, SignalInfo* out) { out->kind = SignalInfo::DISAPPEARED; break; default: - printf("[Debugger] unhandled debug event %d\n", debugEvent.dwDebugEventCode); + printf("[Debugger] unhandled debug event %lu\n", debugEvent.dwDebugEventCode); out->kind = SignalInfo::UNKNOWN; break; } diff --git a/common/cross_os_debug/xdbg.h b/common/cross_os_debug/xdbg.h index 479c4b0133..d928c37c94 100644 --- a/common/cross_os_debug/xdbg.h +++ b/common/cross_os_debug/xdbg.h @@ -6,14 +6,16 @@ #pragma once -#include #include +#include + #include "common/common_types.h" #ifdef __linux #include #elif _WIN32 #define NOMINMAX +#define WIN32_LEAN_AND_MEAN #include #endif diff --git a/common/cross_sockets/xsocket.cpp b/common/cross_sockets/XSocket.cpp similarity index 51% rename from common/cross_sockets/xsocket.cpp rename to common/cross_sockets/XSocket.cpp index 14979020da..5ff7bd1e66 100644 --- a/common/cross_sockets/xsocket.cpp +++ b/common/cross_sockets/XSocket.cpp @@ -3,9 +3,10 @@ * Cross platform socket library used for the listener. */ +// clang-format off #ifdef __linux -#include #include +#include #include #elif _WIN32 #define WIN32_LEAN_AND_MEAN @@ -16,6 +17,9 @@ #include #include +#include "third-party/fmt/core.h" +// clang-format on + int open_socket(int af, int type, int protocol) { #ifdef __linux return socket(af, type, protocol); @@ -32,6 +36,71 @@ int open_socket(int af, int type, int protocol) { #endif } +int connect_socket(int socket, sockaddr* addr, int nameLen) { + int result = connect(socket, addr, nameLen); + if (result == -1) { + return -1; + } + return result; +} + +#ifdef __linux +int accept_socket(int socket, sockaddr* addr, socklen_t* addrLen) { + return accept(socket, addr, addrLen); +} +int select_and_accept_socket(int socket, sockaddr* addr, socklen_t* addrLen, int microSeconds) { + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = microSeconds; + // Use select so it can timeout, accept on the returned socket if it is correct + fd_set read_sockets; + FD_ZERO(&read_sockets); + FD_SET(socket, &read_sockets); + auto activity = select(socket + 1, &read_sockets, NULL, NULL, &timeout); + if (activity > 0) { + return accept(socket, addr, addrLen); + } + return -1; +} +#endif + +#ifdef _WIN32 +int accept_socket(int socket, sockaddr* addr, int* addrLen) { + WSADATA wsaData = {0}; + int iResult = 0; + // Initialize Winsock + iResult = WSAStartup(MAKEWORD(2, 2), &wsaData); + if (iResult != 0) { + printf("WSAStartup failed: %d\n", iResult); + return 1; + } + return accept(socket, addr, addrLen); +} + +int select_and_accept_socket(int socket, sockaddr* addr, int* addrLen, int microSeconds) { + WSADATA wsaData = {0}; + int iResult = 0; + // Initialize Winsock + iResult = WSAStartup(MAKEWORD(2, 2), &wsaData); + if (iResult != 0) { + printf("WSAStartup failed: %d\n", iResult); + return 1; + } + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = microSeconds; + // Use select so it can timeout, accept on the returned socket if it is correct + fd_set read_sockets; + FD_ZERO(&read_sockets); + FD_SET(socket, &read_sockets); + auto activity = select(socket + 1, &read_sockets, NULL, NULL, &timeout); + if (activity > 0) { + return accept(socket, addr, addrLen); + } + return -1; +} +#endif + void close_socket(int sock) { if (sock < 0) { return; @@ -77,11 +146,16 @@ int set_socket_timeout(int socket, long microSeconds) { } int write_to_socket(int socket, const char* buf, int len) { + int bytes_wrote = 0; #ifdef __linux - return write(socket, buf, len); + bytes_wrote = send(socket, buf, len, MSG_NOSIGNAL); #elif _WIN32 - return send(socket, buf, len, 0); + bytes_wrote = send(socket, buf, len, 0); #endif + if (bytes_wrote < 0) { + fmt::print(stderr, "[XSocket:{}] Error writing to socket\n", socket); + } + return bytes_wrote; } int read_from_socket(int socket, char* buf, int len) { @@ -99,4 +173,4 @@ bool socket_timed_out() { auto err = WSAGetLastError(); return err == WSAETIMEDOUT; #endif -} \ No newline at end of file +} diff --git a/common/cross_sockets/xsocket.h b/common/cross_sockets/XSocket.h similarity index 52% rename from common/cross_sockets/xsocket.h rename to common/cross_sockets/XSocket.h index b6d99b980e..ce9143cc94 100644 --- a/common/cross_sockets/xsocket.h +++ b/common/cross_sockets/XSocket.h @@ -1,17 +1,24 @@ #pragma once /*! - * @file xsocket.h + * @file XSocket.h * Cross platform socket library used for the listener. */ +// clang-format off #ifdef __linux -#include +#include +#include #include +#include #include #elif _WIN32 +#define NOMINMAX +#define WIN32_LEAN_AND_MEAN +#include #include #endif +// clang-format on #ifdef __linux const int TCP_SOCKET_LEVEL = SOL_TCP; @@ -20,9 +27,17 @@ const int TCP_SOCKET_LEVEL = IPPROTO_TCP; #endif int open_socket(int af, int type, int protocol); +int connect_socket(int socket, sockaddr* addr, int nameLen); +#ifdef __linux +int accept_socket(int socket, sockaddr* addr, socklen_t* addrLen); +int select_and_accept_socket(int socket, sockaddr* addr, socklen_t* addrLen, int microSeconds); +#elif _WIN32 +int accept_socket(int socket, sockaddr* addr, int* addrLen); +int select_and_accept_socket(int socket, sockaddr* addr, int* addrLen, int microSeconds); +#endif void close_socket(int sock); int set_socket_option(int socket, int level, int optname, const void* optval, int optlen); int set_socket_timeout(int socket, long microSeconds); int write_to_socket(int socket, const char* buf, int len); int read_from_socket(int socket, char* buf, int len); -bool socket_timed_out(); \ No newline at end of file +bool socket_timed_out(); diff --git a/common/cross_sockets/XSocketClient.cpp b/common/cross_sockets/XSocketClient.cpp new file mode 100644 index 0000000000..025b445a7e --- /dev/null +++ b/common/cross_sockets/XSocketClient.cpp @@ -0,0 +1,56 @@ +#include "XSocketClient.h" + +#include + +#include "common/cross_sockets/XSocket.h" + +// clang-format off +#ifdef _WIN32 +#define NOMINMAX +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#endif +#include "common/nrepl/ReplServer.h" + +#include "third-party/fmt/core.h" +// clang-format on + +XSocketClient::XSocketClient(int _tcp_port) { + tcp_port = _tcp_port; +} + +XSocketClient::~XSocketClient() { + disconnect(); + client_socket = -1; +} + +void XSocketClient::disconnect() { + close_socket(client_socket); + client_socket = -1; +} + +bool XSocketClient::connect() { + // Open Socket + client_socket = open_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (client_socket < 0) { + // TODO - log + disconnect(); + return false; + } + + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = inet_addr("127.0.0.1"); + addr.sin_port = htons(tcp_port); + + // Connect to server + int result = connect_socket(client_socket, (sockaddr*)&addr, sizeof(addr)); + if (result == -1) { + // TODO - log and close + disconnect(); + return false; + } + + return true; +} diff --git a/common/cross_sockets/XSocketClient.h b/common/cross_sockets/XSocketClient.h new file mode 100644 index 0000000000..6ca49d2ed4 --- /dev/null +++ b/common/cross_sockets/XSocketClient.h @@ -0,0 +1,28 @@ +#pragma once + +#include +#include +#include + +#include "common/common_types.h" +#include "common/cross_sockets/XSocket.h" + +/// @brief A cross platform generic socket client implementation +class XSocketClient { + public: + XSocketClient(int _tcp_port); + ~XSocketClient(); + + XSocketClient(const XSocketClient&) = delete; + XSocketClient& operator=(const XSocketClient&) = delete; + + bool connect(); + void disconnect(); + + bool is_connected() { return client_socket != -1; } + + protected: + int tcp_port; + struct sockaddr_in addr = {}; + int client_socket = -1; +}; diff --git a/common/cross_sockets/XSocketServer.cpp b/common/cross_sockets/XSocketServer.cpp new file mode 100644 index 0000000000..40a1ba246c --- /dev/null +++ b/common/cross_sockets/XSocketServer.cpp @@ -0,0 +1,90 @@ +// clang-format off +#include "XSocketServer.h" + +#include "common/cross_sockets/XSocket.h" + +#include "third-party/fmt/core.h" + +#ifdef _WIN32 +#define NOMINMAX +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#endif +// clang-format on + +XSocketServer::XSocketServer(std::function shutdown_callback, + int _tcp_port, + int _buffer_size) + : want_exit_callback(std::move(shutdown_callback)) { + tcp_port = _tcp_port; + buffer.resize(_buffer_size); +} + +XSocketServer::~XSocketServer() { + if (listening_socket >= 0) { + close_server_socket(); + } +} + +void XSocketServer::shutdown_server() { + // Close the listening and accepted socket socket + close_server_socket(); +} + +bool XSocketServer::init_server() { + listening_socket = open_socket(AF_INET, SOCK_STREAM, 0); + if (listening_socket < 0) { + listening_socket = -1; + return false; + } + +#ifdef __linux + int server_socket_opt = SO_REUSEADDR | SO_REUSEPORT; +#elif _WIN32 + int server_socket_opt = SO_EXCLUSIVEADDRUSE; +#endif + + int opt = 1; + if (set_socket_option(listening_socket, SOL_SOCKET, server_socket_opt, &opt, sizeof(opt)) < 0) { + close_server_socket(); + return false; + }; + + if (set_socket_option(listening_socket, TCP_SOCKET_LEVEL, TCP_NODELAY, &opt, sizeof(opt)) < 0) { + close_server_socket(); + return false; + } + + if (set_socket_timeout(listening_socket, 100000) < 0) { + close_server_socket(); + return false; + } + + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = INADDR_ANY; + addr.sin_port = htons(tcp_port); + + if (bind(listening_socket, (sockaddr*)&addr, sizeof(addr)) < 0) { + fmt::print("[XSocketServer:{}] failed to bind\n", tcp_port); + close_server_socket(); + return false; + } + + if (listen(listening_socket, 0) < 0) { + fmt::print("[XSocketServer:{}] failed to listen\n", tcp_port); + close_server_socket(); + return false; + } + + server_initialized = true; + fmt::print("[XSocketServer:{}] initialized\n", tcp_port); + post_init(); + return true; +} + +void XSocketServer::close_server_socket() { + close_socket(listening_socket); + listening_socket = -1; +} diff --git a/common/cross_sockets/XSocketServer.h b/common/cross_sockets/XSocketServer.h new file mode 100644 index 0000000000..5d9e0899ba --- /dev/null +++ b/common/cross_sockets/XSocketServer.h @@ -0,0 +1,38 @@ +#pragma once + +#include +#include +#include + +#include "common/common_types.h" +#include "common/cross_sockets/XSocket.h" + +/// @brief A cross platform generic socket server implementation +class XSocketServer { + public: + static constexpr int DEF_BUFFER_SIZE = 32 * 1024 * 1024; + XSocketServer(std::function shutdown_callback, + int _tcp_port, + int _buffer_size = DEF_BUFFER_SIZE); + virtual ~XSocketServer(); + + XSocketServer(const XSocketServer&) = delete; + XSocketServer& operator=(const XSocketServer&) = delete; + + bool init_server(); + void shutdown_server(); + void close_server_socket(); + + // Abstract methods -- use-case dependent + virtual void post_init() = 0; + + protected: + int tcp_port; + struct sockaddr_in addr = {}; + int listening_socket = -1; + std::vector buffer; + + bool server_initialized = false; + + std::function want_exit_callback; +}; diff --git a/common/custom_data/TFrag3Data.cpp b/common/custom_data/TFrag3Data.cpp index 730f6196b9..85acad65b6 100644 --- a/common/custom_data/TFrag3Data.cpp +++ b/common/custom_data/TFrag3Data.cpp @@ -1,4 +1,8 @@ #include "Tfrag3Data.h" + +#include +#include + #include "common/util/Assert.h" namespace tfrag3 { @@ -21,25 +25,17 @@ void StripDraw::serialize(Serializer& ser) { ser.from_ptr(&mode); ser.from_ptr(&tree_tex_id); ser.from_pod_vector(&runs); + ser.from_pod_vector(&plain_indices); ser.from_pod_vector(&vis_groups); ser.from_ptr(&num_triangles); } -void StripDraw::unpack() { - ASSERT(unpacked.vertex_index_stream.empty()); - for (auto& r : runs) { - for (int i = 0; i < r.length; i++) { - unpacked.vertex_index_stream.push_back(r.vertex0 + i); - } - unpacked.vertex_index_stream.push_back(UINT32_MAX); - } -} - void ShrubDraw::serialize(Serializer& ser) { ser.from_ptr(&mode); ser.from_ptr(&tree_tex_id); - ser.from_pod_vector(&vertex_index_stream); ser.from_ptr(&num_triangles); + ser.from_ptr(&first_index_index); + ser.from_ptr(&num_indices); } void InstancedStripDraw::serialize(Serializer& ser) { @@ -73,6 +69,7 @@ void TfragTree::serialize(Serializer& ser) { ser.from_pod_vector(&packed_vertices.cluster_origins); ser.from_pod_vector(&colors); bvh.serialize(ser); + ser.from_ptr(&use_strips); } void TieTree::unpack() { @@ -87,7 +84,7 @@ void TieTree::unpack() { vtx.x = proto_vtx.x; vtx.y = proto_vtx.y; vtx.z = proto_vtx.z; - vtx.q = 1.f; + vtx.q_unused = 1.f; vtx.s = proto_vtx.s; vtx.t = proto_vtx.t; i++; @@ -102,13 +99,24 @@ void TieTree::unpack() { vtx.x = temp.x(); vtx.y = temp.y(); vtx.z = temp.z(); - vtx.q = 1.f; + vtx.q_unused = 1.f; vtx.s = proto_vtx.s; vtx.t = proto_vtx.t; i++; } } } + + for (auto& draw : static_draws) { + draw.unpacked.idx_of_first_idx_in_full_buffer = unpacked.indices.size(); + ASSERT(draw.plain_indices.empty()); + for (auto& run : draw.runs) { + for (u32 ri = 0; ri < run.length; ri++) { + unpacked.indices.push_back(run.vertex0 + ri); + } + unpacked.indices.push_back(UINT32_MAX); + } + } } void ShrubTree::unpack() { @@ -151,9 +159,23 @@ void TfragTree::unpack() { o.z = cz + in.zoff * rescale; o.s = in.s / (1024.f); o.t = in.t / (1024.f); - o.q = 1.f; + o.q_unused = 1.f; o.color_index = in.color_index; } + + for (auto& draw : draws) { + draw.unpacked.idx_of_first_idx_in_full_buffer = unpacked.indices.size(); + for (auto& run : draw.runs) { + for (u32 ri = 0; ri < run.length; ri++) { + unpacked.indices.push_back(run.vertex0 + ri); + } + if (use_strips) { + unpacked.indices.push_back(UINT32_MAX); + } + } + unpacked.indices.insert(unpacked.indices.end(), draw.plain_indices.begin(), + draw.plain_indices.end()); + } } void TieTree::serialize(Serializer& ser) { @@ -191,6 +213,7 @@ void TieTree::serialize(Serializer& ser) { void ShrubTree::serialize(Serializer& ser) { ser.from_pod_vector(&time_of_day_colors); + ser.from_pod_vector(&indices); packed_vertices.serialize(ser); if (ser.is_saving()) { ser.save(static_draws.size()); @@ -221,12 +244,64 @@ void Texture::serialize(Serializer& ser) { ser.from_ptr(&load_to_pool); } +void CollisionMesh::serialize(Serializer& ser) { + ser.from_pod_vector(&vertices); +} + +void MercDraw::serialize(Serializer& ser) { + ser.from_ptr(&mode); + ser.from_ptr(&tree_tex_id); + ser.from_ptr(&first_index); + ser.from_ptr(&index_count); + ser.from_ptr(&num_triangles); +} + +void MercEffect::serialize(Serializer& ser) { + if (ser.is_saving()) { + ser.save(draws.size()); + } else { + draws.resize(ser.load()); + } + for (auto& draw : draws) { + draw.serialize(ser); + } +} + +void MercModel::serialize(Serializer& ser) { + ser.from_str(&name); + if (ser.is_saving()) { + ser.save(effects.size()); + } else { + effects.resize(ser.load()); + } + for (auto& effect : effects) { + effect.serialize(ser); + } + ser.from_ptr(&scale_xyz); + ser.from_ptr(&max_draws); + ser.from_ptr(&max_bones); +} + +void MercModelGroup::serialize(Serializer& ser) { + if (ser.is_saving()) { + ser.save(models.size()); + } else { + models.resize(ser.load()); + } + for (auto& model : models) { + model.serialize(ser); + } + + ser.from_pod_vector(&indices); + ser.from_pod_vector(&vertices); +} + void Level::serialize(Serializer& ser) { ser.from_ptr(&version); if (ser.is_loading() && version != TFRAG3_VERSION) { - fmt::print("version mismatch when loading tfrag3 data. Got {}, expected {}\n", version, - TFRAG3_VERSION); - ASSERT(false); + ASSERT_MSG(false, fmt::format("version mismatch when loading tfrag3 data. Got {}, expected {}, " + "did you forget to re-decompile?", + version, TFRAG3_VERSION)); } ser.from_str(&level_name); @@ -271,11 +346,14 @@ void Level::serialize(Serializer& ser) { tree.serialize(ser); } + collision.serialize(ser); + merc_data.serialize(ser); + ser.from_ptr(&version2); if (ser.is_loading() && version2 != TFRAG3_VERSION) { - fmt::print("version mismatch when loading tfrag3 data (at end). Got {}, expected {}\n", - version2, TFRAG3_VERSION); - ASSERT(false); + ASSERT_MSG(false, fmt::format( + "version mismatch when loading tfrag3 data (at end). Got {}, expected {}", + version2, TFRAG3_VERSION)); } } @@ -293,6 +371,7 @@ std::array Level::get_memory_usage() c for (const auto& tfrag_tree : tfrag_tree_geoms) { for (const auto& draw : tfrag_tree.draws) { result[TFRAG_INDEX] += draw.runs.size() * sizeof(StripDraw::VertexRun); + result[TFRAG_INDEX] += draw.plain_indices.size() * sizeof(u32); result[TFRAG_VIS] += draw.vis_groups.size() * sizeof(StripDraw::VisGroup); } result[TFRAG_VERTS] += @@ -338,13 +417,67 @@ std::array Level::get_memory_usage() c shrub_tree.packed_vertices.vertices.size() * sizeof(PackedShrubVertices::Vertex); result[SHRUB_VERT] += shrub_tree.packed_vertices.instance_groups.size() * sizeof(PackedShrubVertices::InstanceGroup); - - for (const auto& draw : shrub_tree.static_draws) { - result[SHRUB_IND] += sizeof(u32) * draw.vertex_index_stream.size(); - } + result[SHRUB_IND] += sizeof(u32) * shrub_tree.indices.size(); } + // merc + result[MERC_INDEX] += merc_data.indices.size() * sizeof(u32); + result[MERC_VERT] += merc_data.vertices.size() * sizeof(MercVertex); + + // collision + result[COLLISION] += sizeof(CollisionMesh::Vertex) * collision.vertices.size(); + return result; } +void print_memory_usage(const tfrag3::Level& lev, int uncompressed_data_size) { + int total_accounted = 0; + auto memory_use_by_category = lev.get_memory_usage(); + + std::vector> known_categories = { + {"texture", memory_use_by_category[tfrag3::MemoryUsageCategory::TEXTURE]}, + {"tie-deinst-vis", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_DEINST_VIS]}, + {"tie-deinst-idx", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_DEINST_INDEX]}, + {"tie-inst-vis", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_INST_VIS]}, + {"tie-inst-idx", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_INST_INDEX]}, + {"tie-bvh", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_BVH]}, + {"tie-verts", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_VERTS]}, + {"tie-colors", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_TIME_OF_DAY]}, + {"tie-wind-inst-info", + memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_WIND_INSTANCE_INFO]}, + {"tie-cidx", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_CIDX]}, + {"tie-mats", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_MATRICES]}, + {"tie-grps", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_GRPS]}, + {"tfrag-vis", memory_use_by_category[tfrag3::MemoryUsageCategory::TFRAG_VIS]}, + {"tfrag-idx", memory_use_by_category[tfrag3::MemoryUsageCategory::TFRAG_INDEX]}, + {"tfrag-vert", memory_use_by_category[tfrag3::MemoryUsageCategory::TFRAG_VERTS]}, + {"tfrag-colors", memory_use_by_category[tfrag3::MemoryUsageCategory::TFRAG_TIME_OF_DAY]}, + {"tfrag-cluster", memory_use_by_category[tfrag3::MemoryUsageCategory::TFRAG_CLUSTER]}, + {"tfrag-bvh", memory_use_by_category[tfrag3::MemoryUsageCategory::TFRAG_BVH]}, + {"shrub-colors", memory_use_by_category[tfrag3::MemoryUsageCategory::SHRUB_TIME_OF_DAY]}, + {"shrub-vert", memory_use_by_category[tfrag3::MemoryUsageCategory::SHRUB_VERT]}, + {"shrub-ind", memory_use_by_category[tfrag3::MemoryUsageCategory::SHRUB_IND]}, + {"collision", memory_use_by_category[tfrag3::MemoryUsageCategory::COLLISION]}, + {"merc-vert", memory_use_by_category[tfrag3::MemoryUsageCategory::MERC_VERT]}, + {"merc-idx", memory_use_by_category[tfrag3::MemoryUsageCategory::MERC_INDEX]}}; + for (auto& known : known_categories) { + total_accounted += known.second; + } + + known_categories.push_back({"unknown", uncompressed_data_size - total_accounted}); + + std::sort(known_categories.begin(), known_categories.end(), + [](const auto& a, const auto& b) { return a.second > b.second; }); + + for (const auto& x : known_categories) { + fmt::print("{:30s} : {:6d} kB {:3.1f}%\n", x.first, x.second / 1024, + 100.f * (float)x.second / uncompressed_data_size); + } +} + +std::size_t PreloadedVertex::hash::operator()(const PreloadedVertex& v) const { + return std::hash()(v.x) ^ std::hash()(v.y) ^ std::hash()(v.z) ^ + std::hash()(v.s) ^ std::hash()(v.t) ^ std::hash()(v.color_index); +} + } // namespace tfrag3 diff --git a/common/custom_data/Tfrag3Data.h b/common/custom_data/Tfrag3Data.h index 566c8e83da..a573f8fb73 100644 --- a/common/custom_data/Tfrag3Data.h +++ b/common/custom_data/Tfrag3Data.h @@ -5,9 +5,9 @@ #include "common/common_types.h" #include "common/dma/gs.h" -#include "common/util/Serializer.h" #include "common/math/Vector.h" #include "common/util/Assert.h" +#include "common/util/Serializer.h" namespace tfrag3 { @@ -44,20 +44,35 @@ enum MemoryUsageCategory { SHRUB_TIME_OF_DAY, SHRUB_VERT, SHRUB_IND, + + MERC_VERT, + MERC_INDEX, + + COLLISION, + NUM_CATEGORIES }; -constexpr int TFRAG3_VERSION = 13; +constexpr int TFRAG3_VERSION = 20; // These vertices should be uploaded to the GPU at load time and don't change struct PreloadedVertex { // the vertex position float x, y, z; // texture coordinates - float s, t, q; + float s, t, q_unused; // color table index u16 color_index; u16 pad[3]; + + struct hash { + std::size_t operator()(const PreloadedVertex& x) const; + }; + + bool operator==(const PreloadedVertex& other) const { + return x == other.x && y == other.y && z == other.z && s == other.s && t == other.t && + color_index == other.color_index; + } }; static_assert(sizeof(PreloadedVertex) == 32, "PreloadedVertex size"); @@ -84,7 +99,7 @@ struct PackedTfragVertices { struct Vertex { u16 xoff, yoff, zoff; u16 cluster_idx; - u16 s, t; + s16 s, t; u16 color_index; }; @@ -135,24 +150,23 @@ struct StripDraw { u32 tree_tex_id = 0; // the texture that should be bound for the draw struct { - // the list of vertices in the draw. This includes the restart code of UINT32_MAX that OpenGL - // will use to start a new strip. - std::vector vertex_index_stream; + u32 idx_of_first_idx_in_full_buffer = 0; } unpacked; - void unpack(); - + // indices can be specified as lists of runs and plain indices. + // the runs are still drawn with indexed opengl calls, it just uses less space in the file. struct VertexRun { u32 vertex0; u16 length; }; - std::vector runs; + std::vector plain_indices; // to do culling, the above vertex stream is grouped. // by following the visgroups and checking the visibility, you can leave out invisible vertices. struct VisGroup { - u32 num = 0; // number of vertex indices in this group + u32 num_inds = 0; // number of vertex indices in this group + u32 num_tris = 0; // number of triangles u32 vis_idx_in_pc_bvh = 0; // the visibility group they belong to (in BVH) }; std::vector vis_groups; @@ -166,9 +180,8 @@ struct ShrubDraw { DrawMode mode; // the OpenGL draw settings. u32 tree_tex_id = 0; // the texture that should be bound for the draw - // the list of vertices in the draw. This includes the restart code of UINT32_MAX that OpenGL - // will use to start a new strip. - std::vector vertex_index_stream; + u32 first_index_index; + u32 num_indices; // for debug counting. u32 num_triangles = 0; @@ -258,9 +271,11 @@ struct TfragTree { PackedTfragVertices packed_vertices; std::vector colors; // vertex colors (pre-interpolation) BVH bvh; // the bvh for frustum culling + bool use_strips = true; struct { std::vector vertices; // mesh vertices + std::vector indices; } unpacked; void unpack(); void serialize(Serializer& ser); @@ -286,6 +301,7 @@ struct TieTree { struct { std::vector vertices; // mesh vertices + std::vector indices; } unpacked; void serialize(Serializer& ser); @@ -298,6 +314,7 @@ struct ShrubTree { PackedShrubVertices packed_vertices; std::vector static_draws; // the actual topology and settings + std::vector indices; struct { std::vector vertices; // mesh vertices @@ -307,6 +324,73 @@ struct ShrubTree { void unpack(); }; +struct CollisionMesh { + struct Vertex { + float x, y, z; + u32 flags; + s16 nx, ny, nz; + u16 pad; + u32 pat; + u32 pad2; + }; + static_assert(sizeof(Vertex) == 32); + std::vector vertices; + void serialize(Serializer& ser); +}; + +// MERC + +struct MercVertex { + float pos[3]; + float pad0; + + float normal[3]; + float pad1; + + float weights[3]; + float pad2; + + float st[2]; + + u8 rgba[4]; + u8 mats[3]; + u8 pad3; +}; +static_assert(sizeof(MercVertex) == 64); + +struct MercDraw { + DrawMode mode; + u32 tree_tex_id = 0; // the texture that should be bound for the draw + + u32 first_index; + u32 index_count; + u32 num_triangles; + void serialize(Serializer& ser); +}; + +struct MercEffect { + std::vector draws; + void serialize(Serializer& ser); +}; + +struct MercModel { + std::string name; + std::vector effects; + float scale_xyz; + u32 max_draws; + u32 max_bones; + void serialize(Serializer& ser); +}; + +struct MercModelGroup { + std::vector vertices; + std::vector indices; + std::vector models; + void serialize(Serializer& ser); +}; + +// + constexpr int TFRAG_GEOS = 3; constexpr int TIE_GEOS = 4; @@ -317,10 +401,14 @@ struct Level { std::array, TFRAG_GEOS> tfrag_trees; std::array, TIE_GEOS> tie_trees; std::vector shrub_trees; + CollisionMesh collision; + MercModelGroup merc_data; u16 version2 = TFRAG3_VERSION; void serialize(Serializer& ser); std::array get_memory_usage() const; }; +void print_memory_usage(const tfrag3::Level& lev, int uncompressed_data_size); + } // namespace tfrag3 diff --git a/common/custom_data/pack_helpers.cpp b/common/custom_data/pack_helpers.cpp new file mode 100644 index 0000000000..0025c596b5 --- /dev/null +++ b/common/custom_data/pack_helpers.cpp @@ -0,0 +1,72 @@ +#include "pack_helpers.h" + +#include + +constexpr float kClusterSize = 4096 * 40; // 100 in-game meters +constexpr float kMasterOffset = 12000 * 4096; + +std::pair position_to_cluster_and_offset(float in) { + in += kMasterOffset; + if (in < 0) { + fmt::print("negative: {}\n", in); + } + ASSERT(in >= 0); + int cluster_cell = (in / kClusterSize); + float leftover = in - (cluster_cell * kClusterSize); + u16 offset = (leftover / kClusterSize) * float(UINT16_MAX); + + float recovered = ((float)cluster_cell + ((float)offset / UINT16_MAX)) * kClusterSize; + float diff = std::fabs(recovered - in); + ASSERT(diff < 7); + ASSERT(cluster_cell >= 0); + ASSERT(cluster_cell < UINT16_MAX); + return {cluster_cell, offset}; +} + +void pack_tfrag_vertices(tfrag3::PackedTfragVertices* result, + const std::vector& vertices) { + u32 next_cluster_idx = 0; + std::map clusters; + + for (auto& vtx : vertices) { + auto x = position_to_cluster_and_offset(vtx.x); + auto y = position_to_cluster_and_offset(vtx.y); + auto z = position_to_cluster_and_offset(vtx.z); + u64 cluster_id = 0; + cluster_id |= x.first; + cluster_id |= (y.first << 16); + cluster_id |= (z.first << 32); + + auto cluster_it = clusters.find(cluster_id); + u32 my_cluster_idx = 0; + if (cluster_it == clusters.end()) { + // first in cluster + clusters[cluster_id] = next_cluster_idx; + my_cluster_idx = next_cluster_idx; + next_cluster_idx++; + } else { + my_cluster_idx = cluster_it->second; + } + + tfrag3::PackedTfragVertices::Vertex out_vtx; + out_vtx.xoff = x.second; + out_vtx.yoff = y.second; + out_vtx.zoff = z.second; + out_vtx.cluster_idx = my_cluster_idx; + // TODO check these + out_vtx.s = vtx.s * 1024; + out_vtx.t = vtx.t * 1024; + out_vtx.color_index = vtx.color_index; + result->vertices.push_back(out_vtx); + } + + result->cluster_origins.resize(next_cluster_idx); + for (auto& cluster : clusters) { + auto& res = result->cluster_origins[cluster.second]; + res.x() = (u16)cluster.first; + res.y() = (u16)(cluster.first >> 16); + res.z() = (u16)(cluster.first >> 32); + } + + ASSERT(next_cluster_idx < UINT16_MAX); +} \ No newline at end of file diff --git a/common/custom_data/pack_helpers.h b/common/custom_data/pack_helpers.h new file mode 100644 index 0000000000..c477a22c40 --- /dev/null +++ b/common/custom_data/pack_helpers.h @@ -0,0 +1,6 @@ +#pragma once + +#include "common/custom_data/Tfrag3Data.h" + +void pack_tfrag_vertices(tfrag3::PackedTfragVertices* result, + const std::vector& vertices); \ No newline at end of file diff --git a/common/deserialization/subtitles/subtitles.cpp b/common/deserialization/subtitles/subtitles.cpp new file mode 100644 index 0000000000..cf704eb67e --- /dev/null +++ b/common/deserialization/subtitles/subtitles.cpp @@ -0,0 +1,88 @@ +#include "subtitles.h" + +#include +#include + +#include "common/util/FileUtil.h" + +#include "third-party/fmt/core.h" +#include "third-party/fmt/ranges.h" +#include "third-party/json.hpp" + +bool write_subtitle_db_to_files(const GameSubtitleDB& db) { + // Write the subtitles out + std::vector completed_banks = {}; + for (const auto& [id, bank] : db.m_banks) { + // If we've done the bank before, skip it + auto it = find(completed_banks.begin(), completed_banks.end(), bank->m_lang_id); + if (it != completed_banks.end()) { + continue; + } + // Check to see if this bank is shared by any other, if so do it at the same time + // and skip it + // This is basically just to deal with US/UK english in a not so hacky way + std::vector banks = {}; + for (const auto& [_id, _bank] : db.m_banks) { + if (_bank->file_path == bank->file_path) { + banks.push_back(_bank->m_lang_id); + completed_banks.push_back(_bank->m_lang_id); + } + } + + std::string file_contents = ""; + file_contents += fmt::format("(language-id {})\n", fmt::join(banks, " ")); + + for (const auto& group_name : db.m_subtitle_groups->m_group_order) { + file_contents += + fmt::format("\n;; -----------------\n;; {}\n;; -----------------\n", group_name); + for (const auto& [scene_name, scene_info] : bank->m_scenes) { + if (scene_info.m_sorting_group != group_name) { + continue; + } + file_contents += fmt::format("\n(\"{}\"", scene_name); + if (scene_info.m_kind == SubtitleSceneKind::Hint) { + file_contents += " :hint #x0"; + } else if (scene_info.m_kind == SubtitleSceneKind::HintNamed) { + file_contents += fmt::format(" :hint #x{0:x}", scene_info.m_id); + } + file_contents += "\n"; + if (scene_info.m_lines.empty()) { + file_contents += fmt::format(" ()\n"); + } else { + for (const auto& line : scene_info.m_lines) { + // Clear screen entries + if (line.line_utf8.empty()) { + file_contents += fmt::format(" ({})\n", line.frame); + } else { + file_contents += fmt::format(" ({}", line.frame); + if (line.offscreen && scene_info.m_kind == SubtitleSceneKind::Movie) { + file_contents += " :offscreen"; + } + file_contents += fmt::format(" \"{}\"", line.speaker_utf8); + // escape quotes + std::string temp = line.line_utf8; + temp = std::regex_replace(temp, std::regex("\""), "\\\""); + file_contents += fmt::format(" \"{}\")\n", temp); + } + } + } + file_contents += " )\n"; + } + } + + // Commit it to the file + std::string full_path = + (file_util::get_jak_project_dir() / std::filesystem::path(bank->file_path)).string(); + file_util::write_text_file(full_path, file_contents); + } + + // Write the subtitle group info out + nlohmann::json json(db.m_subtitle_groups->m_groups); + json[db.m_subtitle_groups->group_order_key] = nlohmann::json(db.m_subtitle_groups->m_group_order); + std::string file_path = (file_util::get_jak_project_dir() / "game" / "assets" / "jak1" / + "subtitle" / "subtitle-groups.json") + .string(); + file_util::write_text_file(file_path, json.dump(2)); + + return true; +} diff --git a/common/deserialization/subtitles/subtitles.h b/common/deserialization/subtitles/subtitles.h new file mode 100644 index 0000000000..80361bce9e --- /dev/null +++ b/common/deserialization/subtitles/subtitles.h @@ -0,0 +1,5 @@ +#pragma once + +#include "common/serialization/subtitles/subtitles.h" + +bool write_subtitle_db_to_files(const GameSubtitleDB& db); diff --git a/common/dma/dma.cpp b/common/dma/dma.cpp index 4e8ed3f62c..77b0240580 100644 --- a/common/dma/dma.cpp +++ b/common/dma/dma.cpp @@ -1,8 +1,9 @@ #include "dma.h" -#include "third-party/fmt/core.h" #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + std::string DmaTag::print() { std::string result; const char* mode_names[8] = {"refe", "cnt", "next", "ref", "refs", "call", "ret", "end"}; @@ -79,6 +80,9 @@ std::string VifCode::print() { case Kind::DIRECTHL: result = "DIRECTHL"; break; + case Kind::PC_PORT: + result = "PC_PORT"; + break; case Kind::UNPACK_V4_8: { VifCodeUnpack up(*this); result = fmt::format("UNPACK-V4-8: {} addr: {} us: {} tops: {}", num, up.addr_qw, @@ -115,10 +119,8 @@ std::string VifCode::print() { } default: - fmt::print("Unhandled vif code {}\n", (int)kind); - result = "???"; - ASSERT(false); + ASSERT_MSG(false, fmt::format("Unhandled vif code {}", (int)kind)); break; } // TODO: the rest of the VIF code. diff --git a/common/dma/dma.h b/common/dma/dma.h index 984b890e11..6b50e66000 100644 --- a/common/dma/dma.h +++ b/common/dma/dma.h @@ -5,11 +5,14 @@ * PS2 DMA and VIF types. */ -#include #include +#include + #include "common/common_types.h" #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + struct DmaStats { double sync_time_ms = 0; int num_tags = 0; @@ -68,6 +71,11 @@ inline void emulate_dma(const void* source_base, void* dest_base, u32 tadr, u32 dest_offset += (1 + tag.qwc) * 16; tadr += 16 + tag.qwc * 16; break; + case DmaTag::Kind::NEXT: + memcpy(dst + dest_offset, src + tadr, (1 + tag.qwc) * 16); + dest_offset += (1 + tag.qwc) * 16; + tadr = tag.addr; + break; case DmaTag::Kind::REF: { // tte memcpy(dst + dest_offset, src + tadr, 16); @@ -91,8 +99,7 @@ inline void emulate_dma(const void* source_base, void* dest_base, u32 tadr, u32 // does this transfer anything in TTE??? return; default: - printf("bad tag: %d\n", (int)tag.kind); - ASSERT(false); + ASSERT_MSG(false, fmt::format("bad tag: {}", (int)tag.kind)); } } } diff --git a/common/dma/dma_chain_read.h b/common/dma/dma_chain_read.h index 34e4585458..5e6f5f582f 100644 --- a/common/dma/dma_chain_read.h +++ b/common/dma/dma_chain_read.h @@ -1,6 +1,7 @@ #pragma once #include + #include "common/dma/dma.h" #include "common/util/Assert.h" diff --git a/common/dma/dma_copy.cpp b/common/dma/dma_copy.cpp index 898d98c5fa..b02f10df55 100644 --- a/common/dma/dma_copy.cpp +++ b/common/dma/dma_copy.cpp @@ -1,10 +1,12 @@ -#include "common/goal_constants.h" -#include "common/dma/dma_chain_read.h" #include "dma_copy.h" -#include "third-party/fmt/core.h" + +#include "common/dma/dma_chain_read.h" +#include "common/goal_constants.h" #include "common/util/Timer.h" +#include "third-party/fmt/core.h" + /*! * Convert a DMA chain to an array of bytes that can be directly fed to VIF. */ diff --git a/common/dma/gs.cpp b/common/dma/gs.cpp index 55beacfc99..932f00e9ee 100644 --- a/common/dma/gs.cpp +++ b/common/dma/gs.cpp @@ -1,8 +1,9 @@ #include "gs.h" -#include "third-party/fmt/core.h" #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + std::string reg_descriptor_name(GifTag::RegisterDescriptor reg) { switch (reg) { case GifTag::RegisterDescriptor::PRIM: diff --git a/common/dma/gs.h b/common/dma/gs.h index f2342413ef..cd7fb0ebd8 100644 --- a/common/dma/gs.h +++ b/common/dma/gs.h @@ -30,7 +30,7 @@ struct GifTag { }; u32 nloop() const { - return data[0] & 0x7f; // 15 bits + return data[0] & 0x7fff; // 15 bits } bool eop() const { return data[0] & (1ull << 15); } diff --git a/common/global_profiler/GlobalProfiler.cpp b/common/global_profiler/GlobalProfiler.cpp new file mode 100644 index 0000000000..54b563da26 --- /dev/null +++ b/common/global_profiler/GlobalProfiler.cpp @@ -0,0 +1,186 @@ +// clang-format off +#include "GlobalProfiler.h" + +#include +#include +#include + +#include "common/util/Assert.h" +#include "common/util/FileUtil.h" + +#include "third-party/fmt/core.h" +#include "third-party/json.hpp" + +#ifdef __linux__ +u32 get_current_tid() { + return (u32)pthread_self(); +} +#else +#define NOMINMAX +#define WIN32_LEAN_AND_MEAN +#include +#include "Processthreadsapi.h" +u32 get_current_tid() { + return (u32)GetCurrentThreadId(); +} +#endif +// clang-format on + +u64 get_current_ts() { + return std::chrono::steady_clock::now().time_since_epoch().count(); +} + +GlobalProfiler::GlobalProfiler() { + m_t0 = get_current_ts(); + set_max_events(65536); +} + +void GlobalProfiler::set_max_events(size_t event_count) { + ASSERT(!m_enabled); + m_nodes.resize(event_count); +} + +void GlobalProfiler::event(const char* name, ProfNode::Kind kind) { + if (!m_enabled) { + return; + } + size_t my_idx = (m_next_idx++ % m_nodes.size()); + auto& node = m_nodes[my_idx]; + node.ts = get_current_ts() - m_t0; + node.tid = get_current_tid(); + node.kind = kind; + strncpy(node.name, name, sizeof(node.name)); + node.name[sizeof(node.name) - 1] = '\0'; +} + +void GlobalProfiler::instant_event(const char* name) { + event(name, ProfNode::INSTANT); +} + +void GlobalProfiler::begin_event(const char* name) { + event(name, ProfNode::BEGIN); +} + +void GlobalProfiler::end_event() { + if (!m_enabled) { + return; + } + size_t my_idx = (m_next_idx++ % m_nodes.size()); + auto& node = m_nodes[my_idx]; + node.ts = get_current_ts() - m_t0; + node.tid = get_current_tid(); + node.kind = ProfNode::END; + node.name[0] = '\0'; +} + +void GlobalProfiler::clear() { + m_next_idx = 0; +} + +void GlobalProfiler::set_enable(bool en) { + m_enabled = en; +} + +void GlobalProfiler::dump_to_json(const std::string& path) { + ASSERT(!m_enabled); + + nlohmann::json json; + auto& trace_events = json["traceEvents"]; + json["displayTimeUnit"] = "ms"; + + u64 lowest_ts = UINT64_MAX; + struct ThreadInfo { + size_t lowest_at_target = UINT64_MAX; + size_t highest_at_target = 0; + size_t debug = 0; + u32 short_id = 0; + }; + std::unordered_map info_per_thread; + + // first, find all the threads + std::string kRootName = "ROOT"; + for (size_t offset = m_nodes.size(); offset-- > 0;) { + size_t idx = (m_next_idx + offset) % m_nodes.size(); + const auto& event = m_nodes[idx]; + + if (event.kind != ProfNode::UNUSED) { + lowest_ts = std::min(event.ts, lowest_ts); + } + if (event.kind == ProfNode::INSTANT && kRootName == event.name) { + auto& info = info_per_thread[event.tid]; + info.lowest_at_target = std::min(info.lowest_at_target, offset); + info.highest_at_target = std::max(info.highest_at_target, offset); + } + } + + u32 i = 0; + for (auto& info : info_per_thread) { + info.second.short_id = i++; + } + + for (size_t event_idx = 0; event_idx < m_nodes.size(); event_idx++) { + auto& event = m_nodes[(event_idx + m_next_idx) % m_nodes.size()]; + if (event.kind == ProfNode::UNUSED) { + continue; + } + auto& info = info_per_thread.at(event.tid); + if (event_idx < info.lowest_at_target || event_idx > info.highest_at_target) { + continue; + } + + auto& json_event = trace_events.emplace_back(); + // name + if (event.kind != ProfNode::END) { + json_event["name"] = event.name; + } + + // cat + // json_event["cat"] = "a"; // ?? + // ph BEi + switch (event.kind) { + case ProfNode::END: + json_event["ph"] = "E"; + break; + case ProfNode::BEGIN: + json_event["ph"] = "B"; + break; + case ProfNode::INSTANT: + json_event["ph"] = "i"; + break; + default: + ASSERT(false); + } + // pid + json_event["pid"] = 1; + // tid + json_event["tid"] = info.short_id; + // ts + json_event["ts"] = (event.ts - lowest_ts) / 1000.f; + if (event.ts < info.debug) { + fmt::print("out of order: {} {} {} ms\n", event.ts / 1000.f, info.debug / 1000.f, + (info.debug - event.ts) / 1000000.f); + fmt::print(" idx: {}, range {} {}\n", event_idx, info.lowest_at_target, + info.highest_at_target); + fmt::print(" now: {}\n", m_next_idx); + } + info.debug = event.ts; + } + + for (auto& t : info_per_thread) { + fmt::print("thread: {}: {} -> {}\n", t.first, t.second.lowest_at_target, + t.second.highest_at_target); + } + + file_util::write_text_file(path, json.dump()); +} + +GlobalProfiler gprof; +GlobalProfiler& prof() { + return gprof; +} + +ScopedEvent scoped_prof(const char* name) { + auto& p = prof(); + p.begin_event(name); + return {&p}; +} diff --git a/common/global_profiler/GlobalProfiler.h b/common/global_profiler/GlobalProfiler.h new file mode 100644 index 0000000000..b155a646c0 --- /dev/null +++ b/common/global_profiler/GlobalProfiler.h @@ -0,0 +1,47 @@ +#pragma once + +#include +#include +#include + +#include "common/common_types.h" + +struct ProfNode { + u64 ts; + char name[32]; + enum Kind : u8 { BEGIN, END, INSTANT, UNUSED } kind = UNUSED; + u32 tid; +}; + +class GlobalProfiler { + public: + GlobalProfiler(); + void set_max_events(size_t event_count); + void instant_event(const char* name); + void begin_event(const char* name); + void event(const char* name, ProfNode::Kind kind); + void end_event(); + void clear(); + void set_enable(bool en); + void dump_to_json(const std::string& path); + + private: + std::atomic_bool m_enabled = false; + u64 m_t0 = 0; + std::atomic_size_t m_next_idx = 0; + std::vector m_nodes; +}; + +struct ScopedEvent { + ScopedEvent(const ScopedEvent&) = delete; + ScopedEvent& operator=(const ScopedEvent&) = delete; + GlobalProfiler* prof = nullptr; + ~ScopedEvent() { + if (prof) { + prof->end_event(); + } + } +}; + +GlobalProfiler& prof(); +ScopedEvent scoped_prof(const char* name); diff --git a/common/global_profiler/readme.md b/common/global_profiler/readme.md new file mode 100644 index 0000000000..5c9d1afcf9 --- /dev/null +++ b/common/global_profiler/readme.md @@ -0,0 +1,32 @@ +# Event Profiler +The event profiler is a tool to analyze timing of multiple frames. Unlike sampling-based profilers, this profile captures an exact timeline of what happens of what happens when. + +## Capturing a profile +In the OpenGOAL window, click "Profiler" and check "Record" to start recording. The buffer has a fixed maximum size and it will automatically overwrite old data once it is full. + +When something interesting happens, click the "dump to file" button to save the buffer (currently a few seconds) to `prof.json` in `jak-project`. + +The idea is that you can leave this running as you play, and then when the game stutters or does something interesting, you can click the dump button and get the result. + +## Viewing a profile +Open Google Chrome and go to `chrome://tracing`. Then click load and open the json file. Or, just drag and drop the file into chrome. + +Press `1` for a box drawing tool. This lets you select a region of the flame chart and get a list of events inside the box. + +Press `2` for panning. + +Press `3` for zooming. + +## Adding an event +The GOAL kernel automatically adds events for each process. If you want to add another event, you can use `(with-profiler "name-of-event" )`. Do not call `suspend` or do a `return` inside of this. If you need more control over stopping/starting, there are functions in `gcommon.gc` to explicitly start/stop events. But you must match them up correctly yourself! + +In C++, the graphics profiler automatically adds a profiler nodes as events. To add an event, you can use + +```auto p = scoped_prof("name-of-event");``` + +The event is active from this call until the destruction of `p`. + +## Multiple threads +The event profiler currently works on both the graphics and EE threads. Adding the events can safely be done from any thread, but enable/disable/dump should be done from a single thread at a time. + +Each thread should periodically insert a `ROOT` instant event when there are no active range events. This is required to make the retroactive dump feature work properly as the event buffer does not capture the tree structure fully, and it must be able to find a point in time when no events are active. \ No newline at end of file diff --git a/common/goal_constants.h b/common/goal_constants.h index a25888ca2d..2f7a8ccdee 100644 --- a/common/goal_constants.h +++ b/common/goal_constants.h @@ -1,6 +1,7 @@ #pragma once -#include "common_types.h" +#include "common/common_types.h" +#include "common/versions.h" constexpr s32 BINTEGER_OFFSET = 0; constexpr s32 PAIR_OFFSET = 2; @@ -13,10 +14,12 @@ constexpr int ARRAY_DATA_OFFSET = 12; // not including type tag * Here you can change the size of the symbol table! * Make sure to also edit the constant in gcommon.gc */ -constexpr s32 GOAL_MAX_SYMBOLS = 8192; // this MUST be a multiple of 2!! -constexpr s32 SYM_INFO_OFFSET = 8167 * 8 - 4; -// constexpr s32 GOAL_MAX_SYMBOLS = 16384; -// constexpr s32 SYM_INFO_OFFSET = GOAL_MAX_SYMBOLS * 8 - 4; +// constexpr s32 GOAL_MAX_SYMBOLS = 8192; // this MUST be a multiple of 2!! +// constexpr s32 SYM_INFO_OFFSET = 8167 * 8 - 4; + +namespace jak1 { +constexpr s32 GOAL_MAX_SYMBOLS = 16384; +constexpr s32 SYM_INFO_OFFSET = GOAL_MAX_SYMBOLS * 8 - 4; constexpr s32 SYM_TABLE_MEM_SIZE = GOAL_MAX_SYMBOLS * 8 * 2; @@ -34,7 +37,26 @@ constexpr int bits_for_sym() { } return b + 1; } -static_assert(bits_for_sym() != 1, "symbol table invalid length"); +static_assert(bits_for_sym() != -1, "symbol table invalid length"); +} // namespace jak1 + +namespace jak2 { +// for now, we don't have the ability to extend the size of the symbol table +constexpr s32 GOAL_MAX_SYMBOLS = 0x4000; +constexpr s32 SYM_TABLE_MEM_SIZE = 0x30000; +// from the "off-by-one" symbol pointer +constexpr int SYM_TO_STRING_OFFSET = 0xff37; +constexpr int SYM_TO_HASH_OFFSET = 0x1fe6f; +} // namespace jak2 + +constexpr s32 max_symbols(GameVersion version) { + switch (version) { + case GameVersion::Jak1: + return jak1::GOAL_MAX_SYMBOLS; + case GameVersion::Jak2: + return jak2::GOAL_MAX_SYMBOLS; + } +} enum class RegClass { GPR_64, FLOAT, INT_128, VECTOR_FLOAT, INVALID }; diff --git a/common/goos/Interpreter.cpp b/common/goos/Interpreter.cpp index 407b952207..092c1b1b4f 100644 --- a/common/goos/Interpreter.cpp +++ b/common/goos/Interpreter.cpp @@ -3,17 +3,19 @@ * The GOOS Interpreter and implementation of special and "built-in forms" */ -#include #include "Interpreter.h" + +#include + #include "ParseHelpers.h" + #include "common/util/FileUtil.h" + #include "third-party/fmt/core.h" namespace goos { Interpreter::Interpreter(const std::string& username) { // Interpreter startup: - goal_to_goos.reset(); - // create the GOOS global environment global_environment = EnvironmentObject::make_new("global"); @@ -73,7 +75,6 @@ Interpreter::Interpreter(const std::string& username) { {">=", &Interpreter::eval_geq}, {"null?", &Interpreter::eval_null}, {"type?", &Interpreter::eval_type}, - {"current-method-type", &Interpreter::eval_current_method_type}, {"fmt", &Interpreter::eval_format}, {"error", &Interpreter::eval_error}, {"string-ref", &Interpreter::eval_string_ref}, @@ -82,7 +83,10 @@ Interpreter::Interpreter(const std::string& username) { {"ash", &Interpreter::eval_ash}, {"symbol->string", &Interpreter::eval_symbol_to_string}, {"string->symbol", &Interpreter::eval_string_to_symbol}, - {"get-environment-variable", &Interpreter::eval_get_env}}; + {"get-environment-variable", &Interpreter::eval_get_env}, + {"make-string-hash-table", &Interpreter::eval_make_string_hash_table}, + {"hash-table-set!", &Interpreter::eval_hash_table_set}, + {"hash-table-try-ref", &Interpreter::eval_hash_table_try_ref}}; string_to_type = {{"empty-list", ObjectType::EMPTY_LIST}, {"integer", ObjectType::INTEGER}, @@ -1348,7 +1352,7 @@ Object Interpreter::eval_numequals(const Object& form, } break; default: - throw_eval_error(form, "+ must have a numeric argument"); + throw_eval_error(form, "= must have a numeric argument"); return Object::make_empty_list(); } @@ -1550,14 +1554,6 @@ Object Interpreter::eval_type(const Object& form, } } -Object Interpreter::eval_current_method_type(const Object& form, - Arguments& args, - const std::shared_ptr& env) { - (void)env; - vararg_check(form, args, {}, {}); - return SymbolObject::make_new(reader.symbolTable, goal_to_goos.enclosing_method_type); -} - Object Interpreter::eval_format(const Object& form, Arguments& args, const std::shared_ptr& env) { @@ -1697,4 +1693,45 @@ Object Interpreter::eval_get_env(const Object& form, } return StringObject::make_new(env_p); } + +/*! + * Create a new empty hash table object. + */ +Object Interpreter::eval_make_string_hash_table(const Object& form, + Arguments& args, + const std::shared_ptr& /*env*/) { + vararg_check(form, args, {}, {}); + return StringHashTableObject::make_new(); +} + +/*! + * Set a value in a hash table. Overwrites a previous value or inserts a new one. + * Returns empty list always. + */ +Object Interpreter::eval_hash_table_set(const Object& form, + Arguments& args, + const std::shared_ptr& /*env*/) { + vararg_check(form, args, {ObjectType::STRING_HASH_TABLE, ObjectType::STRING, {}}, {}); + args.unnamed.at(0).as_string_hash_table()->data[args.unnamed.at(1).as_string()->data] = + args.unnamed.at(2); + return Object::make_empty_list(); +} + +/*! + * Try to look up a value by key in a hash table. The result is a pair of (success . value). + */ +Object Interpreter::eval_hash_table_try_ref(const Object& form, + Arguments& args, + const std::shared_ptr& /*env*/) { + vararg_check(form, args, {ObjectType::STRING_HASH_TABLE, ObjectType::STRING}, {}); + const auto* table = args.unnamed.at(0).as_string_hash_table(); + const auto& it = table->data.find(args.unnamed.at(1).as_string()->data); + if (it == table->data.end()) { + // not in table + return PairObject::make_new(SymbolObject::make_new(reader.symbolTable, "#f"), + Object::make_empty_list()); + } else { + return PairObject::make_new(SymbolObject::make_new(reader.symbolTable, "#t"), it->second); + } +} } // namespace goos diff --git a/common/goos/Interpreter.h b/common/goos/Interpreter.h index 7fffb1af61..cb78fc30d5 100644 --- a/common/goos/Interpreter.h +++ b/common/goos/Interpreter.h @@ -7,6 +7,7 @@ #include #include + #include "Object.h" #include "Reader.h" @@ -49,13 +50,6 @@ class Interpreter { Object global_environment; Object goal_env; - // data passed from GOAL to GOOS available to any evaluation. - struct GoalToGoosData { - std::string enclosing_method_type; - - void reset() { enclosing_method_type = "#f"; } - } goal_to_goos; - private: friend class Goal; void load_goos_library(); @@ -188,9 +182,6 @@ class Interpreter { Object eval_type(const Object& form, Arguments& args, const std::shared_ptr& env); - Object eval_current_method_type(const Object& form, - Arguments& args, - const std::shared_ptr& env); Object eval_format(const Object& form, Arguments& args, const std::shared_ptr& env); @@ -251,6 +242,16 @@ class Interpreter { const Object& rest, const std::shared_ptr& env); + Object eval_make_string_hash_table(const Object& form, + Arguments& args, + const std::shared_ptr& env); + Object eval_hash_table_try_ref(const Object& form, + Arguments& args, + const std::shared_ptr& env); + Object eval_hash_table_set(const Object& form, + Arguments& args, + const std::shared_ptr& env); + bool want_exit = false; bool disable_printing = false; diff --git a/common/goos/Object.cpp b/common/goos/Object.cpp index 986281c511..cfe01f09dd 100644 --- a/common/goos/Object.cpp +++ b/common/goos/Object.cpp @@ -38,12 +38,15 @@ * */ -#include #include "Object.h" + +#include + #include "common/util/FileUtil.h" -#include "third-party/fmt/core.h" #include "common/util/print_float.h" +#include "third-party/fmt/core.h" + namespace goos { /*! @@ -73,6 +76,8 @@ std::string object_type_to_string(ObjectType type) { return "[macro]"; case ObjectType::ENVIRONMENT: return "[environment]"; + case ObjectType::STRING_HASH_TABLE: + return "[string-hash-table]"; default: throw std::runtime_error("unknown object type in object_type_to_string"); } @@ -243,6 +248,8 @@ bool Object::operator==(const Object& other) const { } return true; } + case ObjectType::STRING_HASH_TABLE: + return as_string_hash_table()->data == other.as_string_hash_table()->data; default: throw std::runtime_error("equality not implemented for " + print()); diff --git a/common/goos/Object.h b/common/goos/Object.h index e0c94c3338..09cea46918 100644 --- a/common/goos/Object.h +++ b/common/goos/Object.h @@ -38,16 +38,20 @@ * MACRO - a heap allocated object representing a GOOS macro * ENVIRONMENT - a heap allocated object representing a GOOS environment * + * STRING_HASH_TABLE - a heap allocated object representing a key-value table. Currently the keys + * can only be strings, like make-str-hash-table in MIT Scheme. + * */ -#include +#include #include +#include +#include #include #include #include #include -#include -#include + #include "common/common_types.h" #include "common/util/Assert.h" @@ -76,6 +80,7 @@ enum class ObjectType : u8 { LAMBDA, MACRO, ENVIRONMENT, + STRING_HASH_TABLE, INVALID }; @@ -162,6 +167,7 @@ class StringObject; class LambdaObject; class MacroObject; class ArrayObject; +class StringHashTableObject; // Wrapper Object class for all objects class Object { @@ -246,6 +252,7 @@ class Object { LambdaObject* as_lambda() const; MacroObject* as_macro() const; ArrayObject* as_array() const; + StringHashTableObject* as_string_hash_table() const; IntType& as_int() { if (type != ObjectType::INTEGER) { @@ -288,7 +295,9 @@ class Object { bool is_empty_list() const { return type == ObjectType::EMPTY_LIST; } bool is_list() const { return type == ObjectType::EMPTY_LIST || type == ObjectType::PAIR; } bool is_int() const { return type == ObjectType::INTEGER; } + bool is_int(int val) const { return type == ObjectType::INTEGER && val == as_int(); } bool is_float() const { return type == ObjectType::FLOAT; } + bool is_float(float val) const { return type == ObjectType::FLOAT && val == as_float(); } bool is_char() const { return type == ObjectType::CHAR; } bool is_symbol() const { return type == ObjectType::SYMBOL; } bool is_symbol(const std::string& name) const; @@ -297,6 +306,7 @@ class Object { bool is_array() const { return type == ObjectType::ARRAY; } bool is_env() const { return type == ObjectType::ENVIRONMENT; } bool is_macro() const { return type == ObjectType::MACRO; } + bool is_string_hash_table() const { return type == ObjectType::STRING_HASH_TABLE; } bool operator==(const Object& other) const; bool operator!=(const Object& other) const { return !((*this) == other); } @@ -592,6 +602,39 @@ class ArrayObject : public HeapObject { Object& operator[](size_t idx) { return data.at(idx); } }; +class StringHashTableObject : public HeapObject { + public: + std::unordered_map data; + StringHashTableObject() = default; + static Object make_new() { + Object obj; + obj.type = ObjectType::STRING_HASH_TABLE; + obj.heap_obj = std::make_shared(); + return obj; + } + + std::string print() const override { + std::string result = "{"; + for (const auto& kv : data) { + result += '('; + result += kv.first; + result += ' '; + result += kv.second.print(); + result += ')'; + result += ' '; + } + if (!data.empty()) { + result.pop_back(); + } + result += '}'; + return result; + } + + std::string inspect() const override { + return "[string-hash-table] kind: string, data: " + print() + "\n"; + } +}; + Object build_list(const std::vector& objects); Object build_list(std::vector&& objects); @@ -653,4 +696,12 @@ inline ArrayObject* Object::as_array() const { } return static_cast(heap_obj.get()); } + +inline StringHashTableObject* Object::as_string_hash_table() const { + if (type != ObjectType::STRING_HASH_TABLE) { + throw std::runtime_error("as_string_hash_table called on a " + object_type_to_string(type) + + " " + print()); + } + return static_cast(heap_obj.get()); +} } // namespace goos diff --git a/common/goos/ParseHelpers.cpp b/common/goos/ParseHelpers.cpp index 9c2f794527..0963bd4ebd 100644 --- a/common/goos/ParseHelpers.cpp +++ b/common/goos/ParseHelpers.cpp @@ -1,5 +1,7 @@ #include "ParseHelpers.h" +#include "third-party/fmt/core.h" + namespace goos { bool get_va(const goos::Object& rest, std::string* err_string, goos::Arguments* result) { @@ -44,16 +46,16 @@ bool va_check( std::string* err_string) { ASSERT(args.rest.empty()); if (unnamed.size() != args.unnamed.size()) { - *err_string = "Got " + std::to_string(args.unnamed.size()) + " arguments, but expected " + - std::to_string(unnamed.size()); + *err_string = fmt::format("Got {} arguments, but expected {}", + std::to_string(args.unnamed.size()), std::to_string(unnamed.size())); return false; } for (size_t i = 0; i < unnamed.size(); i++) { if (unnamed[i].has_value() && unnamed[i] != args.unnamed[i].type) { - *err_string = "Argument " + std::to_string(i) + " has type " + - object_type_to_string(args.unnamed[i].type) + " but " + - object_type_to_string(unnamed[i].value()) + " was expected"; + *err_string = fmt::format("Argument {} has type {} but {} was expected\nArgument is: {}", i, + object_type_to_string(args.unnamed[i].type), + object_type_to_string(unnamed[i].value()), args.unnamed[i].print()); return false; } } diff --git a/common/goos/ParseHelpers.h b/common/goos/ParseHelpers.h index 47df3575d2..6655584345 100644 --- a/common/goos/ParseHelpers.h +++ b/common/goos/ParseHelpers.h @@ -2,8 +2,9 @@ #include #include -#include #include +#include + #include "Object.h" namespace goos { @@ -18,7 +19,7 @@ template void for_each_in_list(const goos::Object& list, T f) { const goos::Object* iter = &list; while (iter->is_pair()) { - auto lap = iter->as_pair(); + const auto& lap = iter->as_pair(); f(lap->car); iter = &lap->cdr; } diff --git a/common/goos/PrettyPrinter.cpp b/common/goos/PrettyPrinter.cpp index 947e1b5255..ee3c994c1c 100644 --- a/common/goos/PrettyPrinter.cpp +++ b/common/goos/PrettyPrinter.cpp @@ -4,17 +4,20 @@ * It is not very good, but significantly better than putting everything on one line */ +#include "PrettyPrinter.h" + +#include #include #include -#include -#include "PrettyPrinter.h" + #include "Reader.h" -#include "third-party/fmt/core.h" -#include "common/log/log.h" #include "common/goos/PrettyPrinter2.h" +#include "common/log/log.h" #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + namespace pretty_print { /*! diff --git a/common/goos/PrettyPrinter.h b/common/goos/PrettyPrinter.h index 71eeeb84bf..a5924555b7 100644 --- a/common/goos/PrettyPrinter.h +++ b/common/goos/PrettyPrinter.h @@ -8,10 +8,11 @@ #include #include + #include "common/goos/Object.h" -#include "common/goos/Reader.h" -#include "common/goos/Printer.h" #include "common/goos/PrettyPrinter2.h" +#include "common/goos/Printer.h" +#include "common/goos/Reader.h" namespace pretty_print { // main pretty print function diff --git a/common/goos/PrettyPrinter2.cpp b/common/goos/PrettyPrinter2.cpp index e0f64641f7..bdabb9ea6f 100644 --- a/common/goos/PrettyPrinter2.cpp +++ b/common/goos/PrettyPrinter2.cpp @@ -1,8 +1,10 @@ #include "PrettyPrinter2.h" + #include "common/common_types.h" -#include "third-party/fmt/core.h" #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + namespace pretty_print { namespace v2 { @@ -17,15 +19,10 @@ namespace v2 { struct Node { Node() = default; - Node(const std::string& str) { - kind = Kind::ATOM; - atom_str = str; - } + Node(const std::string& str) : kind(Kind::ATOM), atom_str(str) {} - Node(std::vector&& list, bool is_list) { - kind = is_list ? Kind::LIST : Kind::IMPROPER_LIST; - child_nodes = std::move(list); - } + Node(std::vector&& list, bool is_list) + : kind(is_list ? Kind::LIST : Kind::IMPROPER_LIST), child_nodes(std::move(list)) {} enum class Kind : u8 { ATOM, LIST, IMPROPER_LIST, INVALID } kind = Kind::INVALID; std::vector child_nodes; @@ -203,8 +200,9 @@ void break_list(Node* node) { node->top_line_count = 1; const std::unordered_set sameline_splitters = { - "if", "<", ">", "<=", ">=", "set!", "=", "!=", "+", "-", "*", - "/", "the", "->", "and", "or", "logand", "logior", "logxor", "+!", "*!", "logtest?"}; + "if", "<", ">", "<=", ">=", "set!", "=", "!=", "+", + "-", "*", "/", "the", "->", "and", "or", "logand", "logior", + "logxor", "+!", "*!", "logtest?", "not", "zero?", "nonzero?"}; if (node->child_nodes.at(0).kind == Node::Kind::LIST) { // ((foo @@ -215,11 +213,23 @@ void break_list(Node* node) { if (name == "defun" || name == "defun-debug" || name == "defbehavior" || name == "defstate") { // things with three things in the top line: (defun node->top_line_count = 3; + } else if (name == "defskelgroup") { + // things with 5 things in the top line: (defskelgroup jgeo janim + node->top_line_count = 5; + node->sub_elt_indent += name.size(); + } else if (name == "process-new") { + // things with 3 things in the top line + node->top_line_count = 3; + node->sub_elt_indent += name.size(); + } else if (name == "ja" || name == "ja-no-eval") { + node->top_line_count = 3; + node->sub_elt_indent += name.size(); } else if (name == "defmethod") { // things with 4 things in the top line: (defmethod node->top_line_count = 4; } else if (name == "until" || name == "while" || name == "dotimes" || name == "countdown" || - name == "when" || name == "behavior" || name == "lambda" || name == "defpart") { + name == "when" || name == "behavior" || name == "lambda" || name == "defpart" || + name == "define") { node->top_line_count = 2; } else if (name == "let" || name == "let*" || name == "rlet") { // special case for things like let. @@ -264,9 +274,9 @@ void break_list(Node* node) { void insert_required_breaks(const std::vector& bfs_order) { const std::unordered_set always_break = { - "when", "defun-debug", "countdown", "case", "defun", "defmethod", "let", - "until", "while", "if", "dotimes", "cond", "else", "defbehavior", - "with-pp", "rlet", "defstate", "behavior", "defpart"}; + "when", "defun-debug", "countdown", "case", "defun", "defmethod", "let", + "until", "while", "if", "dotimes", "cond", "else", "defbehavior", + "with-pp", "rlet", "defstate", "behavior", "defpart", "loop"}; for (auto node : bfs_order) { if (!node->break_list && node->kind == Node::Kind::LIST && node->child_nodes.at(0).kind == Node::Kind::ATOM) { @@ -363,6 +373,7 @@ void append_node_to_string(const Node* node, str.pop_back(); } str.push_back('\n'); + bool after_key = false; for (; node_idx < node->child_nodes.size(); node_idx++) { if (node->kind == Node::Kind::IMPROPER_LIST && &node->child_nodes.at(node_idx) == &node->child_nodes.back()) { @@ -371,9 +382,17 @@ void append_node_to_string(const Node* node, } str.append(".\n"); } - append_node_to_string(&node->child_nodes.at(node_idx), str, listing_indent, - listing_indent); - str.push_back('\n'); + append_node_to_string(&node->child_nodes.at(node_idx), str, + after_key ? 0 : listing_indent, listing_indent); + if (node->child_nodes.at(node_idx).kind == Node::Kind::ATOM && + node->child_nodes.at(node_idx).atom_str.at(0) == ':' && + node->child_nodes.at(node_idx).atom_str.find(' ') == std::string::npos) { + str.push_back(' '); + after_key = true; + } else { + str.push_back('\n'); + after_key = false; + } } for (int i = 0; i < listing_indent; i++) { str.push_back(' '); diff --git a/common/goos/PrettyPrinter2.h b/common/goos/PrettyPrinter2.h index bcc0516c47..2b42fdd1bc 100644 --- a/common/goos/PrettyPrinter2.h +++ b/common/goos/PrettyPrinter2.h @@ -2,9 +2,10 @@ #include #include + #include "common/goos/Object.h" -#include "common/goos/Reader.h" #include "common/goos/Printer.h" +#include "common/goos/Reader.h" namespace pretty_print { // main pretty print function diff --git a/common/goos/Printer.cpp b/common/goos/Printer.cpp index 51466d6c10..a34bb55a9a 100644 --- a/common/goos/Printer.cpp +++ b/common/goos/Printer.cpp @@ -1,4 +1,5 @@ #include "Printer.h" + #include "third-party/fmt/core.h" namespace pretty_print { diff --git a/common/goos/Printer.h b/common/goos/Printer.h index 20d285027f..1052b9426e 100644 --- a/common/goos/Printer.h +++ b/common/goos/Printer.h @@ -2,6 +2,7 @@ #include #include + #include "common/goos/Object.h" #include "common/goos/Reader.h" diff --git a/common/goos/Reader.cpp b/common/goos/Reader.cpp index 2ff07bc453..a601443ac6 100644 --- a/common/goos/Reader.cpp +++ b/common/goos/Reader.cpp @@ -10,11 +10,15 @@ */ #include "Reader.h" + +#include + +#include "ReplUtils.h" + #include "common/util/FileUtil.h" #include "common/util/FontUtils.h" + #include "third-party/fmt/core.h" -#include -#include "ReplUtils.h" namespace goos { @@ -835,13 +839,6 @@ void Reader::throw_reader_error(TextStream& here, const std::string& err, int se db.get_info_for(here.text, here.seek + seek_offset)); } -/*! - * Get the source directory of the current project. - */ -std::string Reader::get_source_dir() { - return file_util::get_project_path(); -} - /*! * Convert any string into one that can be read. * Unprintable characters become escape sequences, including tab and newline. diff --git a/common/goos/Reader.h b/common/goos/Reader.h index efe29b676d..9dd725ab97 100644 --- a/common/goos/Reader.h +++ b/common/goos/Reader.h @@ -12,15 +12,14 @@ */ #include -#include -#include #include - -#include "common/goos/Object.h" -#include "common/goos/TextDB.h" +#include +#include #include "ReplUtils.h" +#include "common/goos/Object.h" +#include "common/goos/TextDB.h" #include "common/util/Assert.h" namespace goos { @@ -78,7 +77,6 @@ class Reader { std::optional read_from_stdin(const std::string& prompt, ReplWrapper& repl); Object read_from_file(const std::vector& file_path, bool check_encoding = false); bool check_string_is_valid(const std::string& str) const; - std::string get_source_dir(); SymbolTable symbolTable; TextDb db; diff --git a/common/goos/ReplUtils.cpp b/common/goos/ReplUtils.cpp index 8ff2aa2803..77a02d7d25 100644 --- a/common/goos/ReplUtils.cpp +++ b/common/goos/ReplUtils.cpp @@ -1,10 +1,11 @@ #include "ReplUtils.h" #include "common/util/FileUtil.h" -#include "third-party/replxx/include/replxx.hxx" #include "common/versions.h" + #include "third-party/fmt/color.h" #include "third-party/fmt/core.h" +#include "third-party/replxx/include/replxx.hxx" // TODO - expand a list of hints (ie. a hint for defun to show at a glance how to write a function, // or perhaps, show the docstring for the current function being used?) @@ -16,6 +17,7 @@ void ReplWrapper::clear_screen() { } void ReplWrapper::print_welcome_message() { + // TODO - dont print on std-out // Welcome message / brief intro for documentation std::string ascii; ascii += " _____ _____ _____ _____ __ \n"; @@ -35,6 +37,10 @@ void ReplWrapper::print_welcome_message() { fmt::print(" to connect to the local target.\n\n"); } +void ReplWrapper::print_to_repl(const std::string_view& str) { + repl.print(str.data()); +} + void ReplWrapper::set_history_max_size(size_t len) { repl.set_max_history_size(len); } diff --git a/common/goos/ReplUtils.h b/common/goos/ReplUtils.h index 283431f6a9..fdd45d9eaa 100644 --- a/common/goos/ReplUtils.h +++ b/common/goos/ReplUtils.h @@ -18,6 +18,7 @@ class ReplWrapper { // Functionality / Commands void clear_screen(); + void print_to_repl(const std::string_view& str); void print_welcome_message(); void set_history_max_size(size_t len); const char* readline(const std::string& prompt); diff --git a/common/goos/TextDB.cpp b/common/goos/TextDB.cpp index 38dda75ffc..03ca3a2e0c 100644 --- a/common/goos/TextDB.cpp +++ b/common/goos/TextDB.cpp @@ -11,11 +11,12 @@ * (+ 1 (+ a b)) ; compute the sum */ -#include "common/util/FileUtil.h" -#include "third-party/fmt/core.h" - #include "TextDB.h" +#include "common/util/FileUtil.h" + +#include "third-party/fmt/core.h" + namespace goos { /*! diff --git a/common/goos/TextDB.h b/common/goos/TextDB.h index b6b62a1140..735b80ac61 100644 --- a/common/goos/TextDB.h +++ b/common/goos/TextDB.h @@ -13,12 +13,12 @@ * (+ 1 (+ a b)) ; compute the sum */ -#include -#include -#include -#include #include #include +#include +#include +#include +#include #include "common/goos/Object.h" diff --git a/common/log/log.cpp b/common/log/log.cpp index 3d6b95b0f2..a0eebfd493 100644 --- a/common/log/log.cpp +++ b/common/log/log.cpp @@ -1,12 +1,17 @@ +#include "log.h" + #include #include #include + #include "third-party/fmt/color.h" -#include "log.h" #ifdef _WIN32 // see lg::initialize +#define NOMINMAX +#define WIN32_LEAN_AND_MEAN #include #endif #include "common/util/Assert.h" +#include "common/util/FileUtil.h" namespace lg { struct Logger { @@ -77,6 +82,7 @@ void log_message(level log_level, LogTime& now, const char* message) { void set_file(const std::string& filename) { ASSERT(!gLogger.fp); + file_util::create_dir_if_needed_for_file(filename); gLogger.fp = fopen(filename.c_str(), "w"); ASSERT(gLogger.fp); } diff --git a/common/log/log.h b/common/log/log.h index 5de1cca8e4..225ddcbd59 100644 --- a/common/log/log.h +++ b/common/log/log.h @@ -6,6 +6,7 @@ #include #endif #include + #include "third-party/fmt/core.h" namespace lg { diff --git a/common/math/Vector.h b/common/math/Vector.h index 6774f64bbf..9351b123ea 100644 --- a/common/math/Vector.h +++ b/common/math/Vector.h @@ -89,6 +89,14 @@ class Vector { return result; } + Vector operator+(const T& other) const { + Vector result; + for (int i = 0; i < Size; i++) { + result[i] = m_data[i] + other; + } + return result; + } + Vector& operator+=(const Vector& other) { for (int i = 0; i < Size; i++) { m_data[i] += other[i]; @@ -96,6 +104,20 @@ class Vector { return *this; } + Vector& operator-=(const Vector& other) { + for (int i = 0; i < Size; i++) { + m_data[i] -= other[i]; + } + return *this; + } + + Vector& operator-=(const T& other) { + for (int i = 0; i < Size; i++) { + m_data[i] -= other; + } + return *this; + } + Vector elementwise_multiply(const Vector& other) const { Vector result; for (int i = 0; i < Size; i++) { @@ -173,6 +195,18 @@ class Vector { void normalize(const T& norm = T(1)) { *this = normalized(norm); } + void max_in_place(const Vector& other) { + for (int i = 0; i < Size; i++) { + m_data[i] = std::max(m_data[i], other[i]); + } + } + + void min_in_place(const Vector& other) { + for (int i = 0; i < Size; i++) { + m_data[i] = std::min(m_data[i], other[i]); + } + } + std::string to_string_aligned() const { std::string result = "["; for (auto x : m_data) { @@ -222,6 +256,8 @@ class Vector { } } + void set_zero() { fill(0); } + private: T m_data[Size]; }; @@ -239,8 +275,24 @@ struct Matrix { return result; } - // const T& operator()(int r, int c) const { return m_data[c + r * Cols]; } - // T& operator()(int r, int c) { return m_data[r + c * Rows]; } + static Matrix identity() { + Matrix result; + for (int c = 0; c < Cols; c++) { + for (int r = 0; r < Rows; r++) { + result(r, c) = r == c ? T(1) : T(0); + } + } + return result; + } + + void set_zero() { + for (auto& x : m_data) { + x = 0; + } + } + + T& operator()(int r, int c) { return m_data[r + c * Rows]; } + const T& operator()(int r, int c) const { return m_data[r + c * Rows]; } Vector col(int c) const { Vector result; @@ -267,6 +319,31 @@ struct Matrix { return result; } + template + Matrix operator*(const Matrix& y) const { + Matrix result; + result.set_zero(); + for (int rx = 0; rx < Rows; rx++) { + for (int cx = 0; cx < Cols; cx++) { + for (int yi = 0; yi < OtherCols; yi++) { + result(rx, yi) += operator()(rx, cx) * y(cx, yi); + } + } + } + return result; + } + + Vector operator*(const Vector& y) const { + Vector result; + result.set_zero(); + for (int rx = 0; rx < Rows; rx++) { + for (int cx = 0; cx < Cols; cx++) { + result[rx] += operator()(rx, cx) * y[cx]; + } + } + return result; + } + private: T m_data[Rows * Cols]; }; diff --git a/common/math/geometry.cpp b/common/math/geometry.cpp index e69de29bb2..59aad2c4c0 100644 --- a/common/math/geometry.cpp +++ b/common/math/geometry.cpp @@ -0,0 +1,40 @@ +#include "geometry.h" + +namespace math { + +Vector4f bsphere_of_triangle(const Vector3f* v) { + Vector4f bsphere; + auto& p1 = v[0]; + auto& p2 = v[1]; + auto& p3 = v[2]; + float A = (p1 - p2).length(); + float B = (p2 - p3).length(); + float C = (p3 - p1).length(); + + const Vector3f *a = &p3, *b = &p1, *c = &p2; + if (B < C) + std::swap(B, C), std::swap(b, c); + if (A < B) + std::swap(A, B), std::swap(a, b); + + float r; + math::Vector3f origin; + if ((B * B) + (C * C) <= (A * A)) { + r = A / 2.f; + origin = (*b + *c) / 2.f; + } else { + float cos_a = (B * B + C * C - A * A) / (B * C * 2); + r = A / (sqrt(1 - cos_a * cos_a) * 2.f); + Vector3f alpha = *a - *c, beta = *b - *c; + origin = (beta * alpha.dot(alpha) - alpha * beta.dot(beta)).cross(alpha.cross(beta)) / + (alpha.cross(beta).dot(alpha.cross(beta)) * 2.f) + + *c; + } + bsphere.x() = origin.x(); + bsphere.y() = origin.y(); + bsphere.z() = origin.z(); + bsphere.w() = r; + return bsphere; +} + +} // namespace math \ No newline at end of file diff --git a/common/math/geometry.h b/common/math/geometry.h index 4c71592bf7..a61988f444 100644 --- a/common/math/geometry.h +++ b/common/math/geometry.h @@ -44,4 +44,10 @@ RaySphereResult ray_sphere_intersect(const Vector3& ray_origin, result.u[1] = minus_b - sqrt_val; return result; } + +math::Vector4f bsphere_of_triangle(const Vector3f* vertices); + +inline bool point_in_bsphere(const Vector4f& sphere, const Vector3f& pt) { + return (sphere.xyz() - pt).squared_length() <= (sphere.w() * sphere.w()); +} } // namespace math \ No newline at end of file diff --git a/common/nrepl/ReplClient.cpp b/common/nrepl/ReplClient.cpp new file mode 100644 index 0000000000..eb19cd28b7 --- /dev/null +++ b/common/nrepl/ReplClient.cpp @@ -0,0 +1,36 @@ +// clang-format off +#include "ReplClient.h" + +#include "common/cross_sockets/XSocket.h" +#include "common/versions.h" + +#include "third-party/fmt/core.h" + +#ifdef _WIN32 +#define NOMINMAX +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#endif +// clang-format on + +void ReplClient::eval(std::string form) { + if (!is_connected()) { + return; + } + // TODO - split this up into two writes + u32 dataLength = form.length(); + ReplServerHeader header = {dataLength, ReplServerMessageType::EVAL}; + + auto const ptr = reinterpret_cast(&header); + std::vector buffer(ptr, ptr + sizeof header); + + buffer.insert(buffer.end(), form.begin(), form.end()); + + int result = write_to_socket(client_socket, buffer.data(), buffer.size()); + if (result == -1) { + // TODO - log + disconnect(); + } +} diff --git a/common/nrepl/ReplClient.h b/common/nrepl/ReplClient.h new file mode 100644 index 0000000000..28eafa14a6 --- /dev/null +++ b/common/nrepl/ReplClient.h @@ -0,0 +1,16 @@ +#pragma once + +#include "ReplServer.h" + +#include "common/cross_sockets/XSocketClient.h" + +class ReplClient : public XSocketClient { + public: + using XSocketClient::XSocketClient; + virtual ~ReplClient() = default; + + ReplClient& operator=(const ReplClient&) { return *this; } + + // TODO - just void for now :( + void eval(std::string form); +}; diff --git a/common/nrepl/ReplServer.cpp b/common/nrepl/ReplServer.cpp new file mode 100644 index 0000000000..1d709802ba --- /dev/null +++ b/common/nrepl/ReplServer.cpp @@ -0,0 +1,151 @@ +// clang-format off +#include "ReplServer.h" + +#include "common/cross_sockets/XSocket.h" +#include + +#include "third-party/fmt/core.h" + +#ifdef _WIN32 +#define NOMINMAX +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#endif +// clang-format on + +// TODO - basically REPL to listen and inject commands into a running REPL +// - we will need a C++ side client as well which will let us communicate with the repl via for +// example, ImgUI +// +// TODO - The server also needs to eventually return the result of the evaluation + +ReplServer::~ReplServer() { + // Close all our client sockets! + for (const int& sock : client_sockets) { + close_socket(sock); + } +} + +void ReplServer::post_init() { + // Add the listening socket to our set of sockets + fmt::print("[nREPL:{}:{}] awaiting connections\n", tcp_port, listening_socket); +} + +void ReplServer::ping_response(int socket) { + std::string ping = fmt::format("Connected to OpenGOAL v{}.{} nREPL!", + versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR); + auto resp = write_to_socket(socket, ping.c_str(), ping.size()); + if (resp == -1) { + fmt::print("[nREPL:{}] Client Disconnected: {}\n", tcp_port, inet_ntoa(addr.sin_addr), + ntohs(addr.sin_port), socket); + close_socket(socket); + client_sockets.erase(socket); + } +} + +std::optional ReplServer::get_msg() { + // Clear the sockets we are listening on + FD_ZERO(&read_sockets); + + // Add the server's main listening socket (where we accept clients from) + FD_SET(listening_socket, &read_sockets); + + int max_sd = listening_socket; + for (const int& sock : client_sockets) { + if (sock > max_sd) { + max_sd = sock; + } + if (sock > 0) { + FD_SET(sock, &read_sockets); + } + } + + // Wait for activity on _something_, with a timeout so we don't get stuck here on exit. + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 100000; + auto activity = select(max_sd + 1, &read_sockets, NULL, NULL, &timeout); + + if (activity < 0) { // TODO - || error! + return std::nullopt; + } + + // If something happened on the master socket - it's a new connection + if (FD_ISSET(listening_socket, &read_sockets)) { + socklen_t addr_len = sizeof(addr); + auto new_socket = accept_socket(listening_socket, (sockaddr*)&addr, &addr_len); + if (new_socket < 0) { + // TODO - handle error + } else { + fmt::print("[nREPL:{}]: New socket connection: {}:{}:{}\n", tcp_port, + inet_ntoa(addr.sin_addr), ntohs(addr.sin_port), new_socket); + + // Say hello + ping_response(new_socket); + // Track the new socket + if ((int)client_sockets.size() < max_clients) { + client_sockets.insert(new_socket); + } else { + // TODO - Respond with NO + } + } + } + + // otherwise (and no matter what) check all the clients to see if they have sent us anything + // else its some IO operation on some other socket + // + // RACE - the first client wins + + // TODO - there are ways to do this with iterators but, couldn't figure it out! + std::vector sockets_to_scan(client_sockets.begin(), client_sockets.end()); + for (const int& sock : sockets_to_scan) { + if (FD_ISSET(sock, &read_sockets)) { + // Attempt to read a header + // TODO - should this be in a loop? + auto req_bytes = read_from_socket(sock, header_buffer.data(), header_buffer.size()); + if (req_bytes == 0) { + // Socket disconnected + // TODO - add a queue of messages in the ReplWrapper so we can print _BEFORE_ the prompt is + // output + fmt::print("[nREPL:{}] Client Disconnected: {}\n", tcp_port, inet_ntoa(addr.sin_addr), + ntohs(addr.sin_port), sock); + + // Cleanup the socket and remove it from our set + close_socket(sock); + client_sockets.erase(sock); + } else { + // Otherwise, process the message + auto* header = (ReplServerHeader*)(header_buffer.data()); + // get the body of the message + int expected_size = header->length; + int got = 0; + while (got < expected_size) { + if (got + expected_size > (int)buffer.size()) { + fmt::print(stderr, + "[nREPL:{}]: Bad message, aborting the read. Got :{}, Expected: {}, Buffer " + "Size: {}", + tcp_port, got, expected_size, buffer.size()); + return std::nullopt; + } + auto x = read_from_socket(sock, buffer.data() + got, expected_size - got); + if (want_exit_callback()) { + return std::nullopt; + } + got += x > 0 ? x : 0; + } + + switch (header->type) { + case ReplServerMessageType::PING: + ping_response(sock); + return std::nullopt; + case ReplServerMessageType::EVAL: + std::string msg(buffer.data(), header->length); + return std::make_optional(msg); + } + } + } + } + return std::nullopt; +} diff --git a/common/nrepl/ReplServer.h b/common/nrepl/ReplServer.h new file mode 100644 index 0000000000..4cd5e09ba0 --- /dev/null +++ b/common/nrepl/ReplServer.h @@ -0,0 +1,31 @@ +#pragma once + +#include +#include + +#include "common/cross_sockets/XSocketServer.h" + +enum ReplServerMessageType { PING = 0, EVAL = 10, SHUTDOWN = 20 }; + +struct ReplServerHeader { + u32 length; + u32 type; +}; + +class ReplServer : public XSocketServer { + public: + using XSocketServer::XSocketServer; + virtual ~ReplServer(); + + void post_init() override; + + std::optional get_msg(); + + private: + int max_clients = 50; + std::vector header_buffer = std::vector((int)sizeof(ReplServerHeader)); + fd_set read_sockets; + std::set client_sockets = {}; + + void ping_response(int socket); +}; diff --git a/common/serialization/subtitles/subtitles.cpp b/common/serialization/subtitles/subtitles.cpp new file mode 100644 index 0000000000..865ffbacef --- /dev/null +++ b/common/serialization/subtitles/subtitles.cpp @@ -0,0 +1,425 @@ +#include "subtitles.h" + +#include "common/goos/ParseHelpers.h" +#include "common/goos/Reader.h" +#include "common/util/FileUtil.h" +#include "common/util/json_util.h" + +#include "third-party/fmt/core.h" + +static const std::unordered_map s_text_ver_enum_map = { + {"jak1-v1", GameTextVersion::JAK1_V1}, + {"jak1-v2", GameTextVersion::JAK1_V2}}; + +// TODO - why not just return the inputs instead of passing in an empty one? +void open_text_project(const std::string& kind, + const std::string& filename, + std::unordered_map>& inputs) { + goos::Reader reader; + auto& proj = reader.read_from_file({filename}).as_pair()->cdr.as_pair()->car; + if (!proj.is_pair() || !proj.as_pair()->car.is_symbol() || + proj.as_pair()->car.as_symbol()->name != kind) { + throw std::runtime_error(fmt::format("invalid {} project", kind)); + } + + goos::for_each_in_list(proj.as_pair()->cdr, [&](const goos::Object& o) { + if (!o.is_pair()) { + throw std::runtime_error(fmt::format("invalid entry in {} project", kind)); + } + + auto& ver = o.as_pair()->car.as_symbol()->name; + auto& in = o.as_pair()->cdr.as_pair()->car.as_string()->data; + + if (s_text_ver_enum_map.count(ver) == 0) { + throw std::runtime_error(fmt::format("unknown text version {}", ver)); + } + + inputs[s_text_ver_enum_map.at(ver)].push_back(in); + }); +} + +int64_t get_int(const goos::Object& obj) { + if (obj.is_int()) { + return obj.integer_obj.value; + } + throw std::runtime_error(obj.print() + " was supposed to be an integer, but isn't"); +} + +const goos::Object& car(const goos::Object& x) { + if (!x.is_pair()) { + throw std::runtime_error("invalid pair"); + } + + return x.as_pair()->car; +} + +const goos::Object& cdr(const goos::Object& x) { + if (!x.is_pair()) { + throw std::runtime_error("invalid pair"); + } + + return x.as_pair()->cdr; +} + +std::string get_string(const goos::Object& x) { + if (x.is_string()) { + return x.as_string()->data; + } + throw std::runtime_error(x.print() + " was supposed to be a string, but isn't"); +} + +/*! + * Parse a game text file. + * Information is added to the game text database. + * + * The file should begin with (language-id x y z...) with the given language IDs. + * Each entry should be (id "line for 1st language" "line for 2nd language" ...) + * This adds the text line to each of the specified languages. + */ +void parse_text(const goos::Object& data, GameTextVersion text_ver, GameTextDB& db) { + auto font = get_font_bank(text_ver); + std::vector> banks; + std::string possible_group_name; + + for_each_in_list(data.as_pair()->cdr, [&](const goos::Object& obj) { + if (obj.is_pair()) { + auto& head = car(obj); + if (head.is_symbol("language-id")) { + if (banks.size() != 0) { + throw std::runtime_error("Languages have been set multiple times."); + } + + if (cdr(obj).is_empty_list()) { + throw std::runtime_error("At least one language must be set."); + } + + if (possible_group_name.empty()) { + throw std::runtime_error("Text group must be set before languages."); + } + + for_each_in_list(cdr(obj), [&](const goos::Object& obj) { + auto lang = get_int(obj); + if (!db.bank_exists(possible_group_name, lang)) { + // database has no lang in this group yet + banks.push_back(db.add_bank(possible_group_name, std::make_shared(lang))); + } else { + banks.push_back(db.bank_by_id(possible_group_name, lang)); + } + }); + } else if (head.is_symbol("group-name")) { + if (!possible_group_name.empty()) { + throw std::runtime_error("group-name has been set multiple times."); + } + + possible_group_name = get_string(car(cdr(obj))); + + if (possible_group_name.empty()) { + throw std::runtime_error("invalid group-name."); + } + + if (!cdr(cdr(obj)).is_empty_list()) { + throw std::runtime_error("group-name has too many arguments"); + } + } else if (head.is_symbol("credits")) { + // parse a "credits" object. it's a list of lines where the ID automatically increments, and + // empty lines are skipped + if (banks.size() == 0) { + throw std::runtime_error("At least one language must be set before defining entries."); + } + + if (cdr(obj).is_empty_list() || cdr(cdr(obj)).is_empty_list() || + !car(cdr(obj)).is_symbol(":begin") || !car(cdr(cdr(obj))).is_int()) { + throw std::runtime_error("Invalid credits begin param"); + } + + const auto& it = cdr(cdr(obj)); + int begin_id = car(it).as_int(); + int id = begin_id - 1; + for_each_in_list(cdr(it), [&](const goos::Object& entry) { + ++id; + if (entry.is_string()) { + if (entry.as_string()->data.empty()) { + // empty string! just advance + return; + } + + auto line = font->convert_utf8_to_game(entry.as_string()->data); + // add to all langs + for (auto& bank : banks) { + bank->set_line(id, line); + } + } else if (entry.is_pair()) { + int b_i = 0; + for_each_in_list(entry, [&](const goos::Object& entry) { + if (entry.is_string()) { + if (b_i >= int(banks.size())) { + throw std::runtime_error(fmt::format("Too many strings in text id #x{:x}", id)); + } + + auto line = font->convert_utf8_to_game(entry.as_string()->data); + banks[b_i++]->set_line(id, line); + } else { + throw std::runtime_error(fmt::format("Non-string value in text id #x{:x}", id)); + } + }); + if (b_i != int(banks.size())) { + throw std::runtime_error( + fmt::format("Not enough strings specified in text id #x{:x}", id)); + } + } else { + throw std::runtime_error(fmt::format("Non-string value in text id #x{:x}", id)); + } + }); + } + + else if (head.is_int()) { + if (banks.size() == 0) { + throw std::runtime_error("At least one language must be set before defining entries."); + } + int i = 0; + int id = head.as_int(); + for_each_in_list(cdr(obj), [&](const goos::Object& entry) { + if (entry.is_string()) { + if (i >= int(banks.size())) { + throw std::runtime_error(fmt::format("Too many strings in text id #x{:x}", id)); + } + + auto line = font->convert_utf8_to_game(entry.as_string()->data); + banks[i++]->set_line(id, line); + } else { + throw std::runtime_error(fmt::format("Non-string value in text id #x{:x}", id)); + } + }); + if (i != int(banks.size())) { + throw std::runtime_error( + fmt::format("Not enough strings specified in text id #x{:x}", id)); + } + } else { + throw std::runtime_error("Invalid game text file entry: " + head.print()); + } + } else { + throw std::runtime_error("Invalid game text file"); + } + }); + if (banks.size() == 0) { + throw std::runtime_error("At least one language must be set."); + } +} + +/*! + * Parse a game subtitle file. + * Information is added to the game subtitles database. + * + * The file should begin with (language-id x y z...) for the given language IDs. + * Each scene should be (scene-name ... ) + * This adds the subtitle to each of the specified languages. + */ +void parse_subtitle(const goos::Object& data, + GameTextVersion text_ver, + GameSubtitleDB& db, + const std::string& file_path) { + auto font = get_font_bank(text_ver); + std::map> banks; + + for_each_in_list(data.as_pair()->cdr, [&](const goos::Object& obj) { + if (obj.is_pair()) { + auto& head = car(obj); + if (head.is_symbol() && head.as_symbol()->name == "language-id") { + if (banks.size() != 0) { + throw std::runtime_error("Languages have been set multiple times."); + } + + if (cdr(obj).is_empty_list()) { + throw std::runtime_error("At least one language must be set."); + } + + for_each_in_list(cdr(obj), [&](const goos::Object& obj) { + auto lang = get_int(obj); + if (!db.bank_exists(lang)) { + // database has no lang yet + banks[lang] = db.add_bank(std::make_shared(lang)); + banks[lang]->file_path = file_path; + } else { + banks[lang] = db.bank_by_id(lang); + banks[lang]->file_path = file_path; + } + }); + } + + else if (head.is_string() || head.is_int()) { + if (banks.size() == 0) { + throw std::runtime_error("At least one language must be set before defining scenes."); + } + auto kind = SubtitleSceneKind::Movie; + int id = 0; + auto entries = cdr(obj); + if (head.is_int()) { + kind = SubtitleSceneKind::Hint; + } else if (car(entries).is_symbol()) { + const auto& parm = car(entries).as_symbol()->name; + if (parm == ":hint") { + entries = cdr(entries); + id = car(entries).as_int(); + kind = SubtitleSceneKind::HintNamed; + } else { + throw std::runtime_error("Unknown parameter for subtitle scene"); + } + entries = cdr(entries); + } + + GameSubtitleSceneInfo scene(kind); + if (kind == SubtitleSceneKind::Movie || kind == SubtitleSceneKind::HintNamed) { + scene.set_name(head.as_string()->data); + } else if (kind == SubtitleSceneKind::Hint) { + id = head.as_int(); + } + scene.set_id(id); + scene.m_sorting_group = db.m_subtitle_groups->find_group(scene.name()); + scene.m_sorting_group_idx = db.m_subtitle_groups->find_group_index(scene.m_sorting_group); + + for_each_in_list(entries, [&](const goos::Object& entry) { + if (entry.is_pair()) { + // expected formats: + // (time ) + // all arguments have default values. the arguments are: + // "speaker" "line" - two strings. one for the speaker's name and one for the actual + // line. speaker can be empty. default is just empty string. + // :offscreen - speaker is offscreen. default is not offscreen. + + if (!car(entry).is_int()) { + throw std::runtime_error("Each entry must start with a timestamp (number)"); + } + + auto time = car(entry).as_int(); + goos::StringObject *speaker = nullptr, *line = nullptr; + bool offscreen = false; + if (scene.kind() == SubtitleSceneKind::Hint || + scene.kind() == SubtitleSceneKind::HintNamed) { + offscreen = true; + } + for_each_in_list(cdr(entry), [&](const goos::Object& arg) { + if (arg.is_string()) { + if (!speaker) { + speaker = arg.as_string(); + } else if (!line) { + line = arg.as_string(); + } else { + throw std::runtime_error("Invalid string in subtitle entry"); + } + } else if (speaker && !line) { + throw std::runtime_error( + "Invalid object in subtitle entry, expecting actual line string after speaker"); + } else if (arg.is_symbol()) { + if (scene.kind() == SubtitleSceneKind::Movie && + arg.as_symbol()->name == ":offscreen") { + offscreen = true; + } else { + throw std::runtime_error( + fmt::format("Unknown parameter {} in subtitle", arg.as_symbol()->name)); + } + } + }); + auto line_utf8 = line ? line->data : ""; + auto line_str = font->convert_utf8_to_game(line_utf8); + auto speaker_utf8 = speaker ? speaker->data : ""; + auto speaker_str = font->convert_utf8_to_game(speaker_utf8); + scene.add_line(time, line_str, line_utf8, speaker_str, speaker_utf8, offscreen); + } else { + throw std::runtime_error("Each entry must be a list"); + } + }); + for (auto& [lang, bank] : banks) { + if (!bank->scene_exists(scene.name())) { + bank->add_scene(scene); + } else { + auto& old_scene = bank->scene_by_name(scene.name()); + old_scene.from_other_scene(scene); + } + } + } else { + throw std::runtime_error("Invalid game subtitles file entry: " + head.print()); + } + } else { + throw std::runtime_error("Invalid game subtitles file"); + } + }); + if (banks.size() == 0) { + throw std::runtime_error("At least one language must be set."); + } +} + +void GameSubtitleGroups::hydrate_from_asset_file() { + std::string file_path = (file_util::get_jak_project_dir() / "game" / "assets" / "jak1" / + "subtitle" / "subtitle-groups.json") + .string(); + auto config_str = file_util::read_text_file(file_path); + auto group_data = parse_commented_json(config_str, file_path); + + for (const auto& [key, val] : group_data.items()) { + try { + if (key == group_order_key) { + m_group_order = val.get>(); + } else { + m_groups[key] = val.get>(); + } + } catch (std::exception& ex) { + fmt::print("Bad subtitle group entry - {} - {}", key, ex.what()); + } + } +} + +std::string GameSubtitleGroups::find_group(const std::string& scene_name) { + for (auto const& [group, scenes] : m_groups) { + for (auto const& name : scenes) { + if (name == scene_name) { + return group; + } + } + } + // Add to the uncategorized group if it wasn't found + m_groups[uncategorized_group].push_back(scene_name); + return uncategorized_group; +} + +int GameSubtitleGroups::find_group_index(const std::string& group_name) { + auto it = find(m_group_order.begin(), m_group_order.end(), group_name); + if (it != m_group_order.end()) { + return it - m_group_order.begin(); + } else { + return m_group_order.size() - 1; + } +} + +void GameSubtitleGroups::remove_scene(const std::string& group_name, + const std::string& scene_name) { + // TODO - validate group_name + m_groups[group_name].erase( + std::remove(m_groups[group_name].begin(), m_groups[group_name].end(), scene_name), + m_groups[group_name].end()); +} +void GameSubtitleGroups::add_scene(const std::string& group_name, const std::string& scene_name) { + // TODO - validate group_name + // TODO - don't add duplicates + m_groups[group_name].push_back(scene_name); +} + +GameSubtitleDB load_subtitle_project() { + // Load the subtitle files + GameSubtitleDB db; + db.m_subtitle_groups = std::make_unique(); + db.m_subtitle_groups->hydrate_from_asset_file(); + goos::Reader reader; + std::unordered_map> inputs; + std::string subtitle_project = + (file_util::get_jak_project_dir() / "game" / "assets" / "game_subtitle.gp").string(); + open_text_project("subtitle", subtitle_project, inputs); + for (auto& [ver, in] : inputs) { + for (auto& filename : in) { + auto code = reader.read_from_file({filename}); + parse_subtitle(code, ver, db, filename); + } + } + return db; +} + +// TODO - write a deserializer, the compiler still can do the compiling! diff --git a/common/serialization/subtitles/subtitles.h b/common/serialization/subtitles/subtitles.h new file mode 100644 index 0000000000..8628a0d6c9 --- /dev/null +++ b/common/serialization/subtitles/subtitles.h @@ -0,0 +1,207 @@ +#pragma once + +#include +#include +#include +#include +#include + +#include "common/goos/Object.h" +#include "common/util/Assert.h" +#include "common/util/FontUtils.h" + +/*! + * The text bank contains all lines (accessed with an ID) for a language. + */ +class GameTextBank { + public: + GameTextBank(int lang_id) : m_lang_id(lang_id) {} + + int lang() const { return m_lang_id; } + const std::map& lines() const { return m_lines; } + + bool line_exists(int id) const { return m_lines.find(id) != m_lines.end(); } + std::string line(int id) { return m_lines.at(id); } + void set_line(int id, std::string line) { m_lines[id] = line; } + + private: + int m_lang_id; + std::map m_lines; +}; + +/*! + * The text database contains a text bank for each language for each text group. + * Each text bank contains a list of text lines. Very simple. + */ +class GameTextDB { + public: + const std::unordered_map>>& groups() + const { + return m_banks; + } + const std::map>& banks(std::string group) const { + return m_banks.at(group); + } + + bool bank_exists(std::string group, int id) const { + if (m_banks.find(group) == m_banks.end()) + return false; + return m_banks.at(group).find(id) != m_banks.at(group).end(); + } + + std::shared_ptr add_bank(std::string group, std::shared_ptr bank) { + ASSERT(!bank_exists(group, bank->lang())); + m_banks[group][bank->lang()] = bank; + return bank; + } + std::shared_ptr bank_by_id(std::string group, int id) { + if (!bank_exists(group, id)) { + return nullptr; + } + return m_banks.at(group).at(id); + } + + private: + std::unordered_map>> m_banks; +}; + +/*! + * The subtitle scene info (accessed through the scene name) contains all lines and their timestamps + * and other settings. + */ +enum class SubtitleSceneKind { Invalid = -1, Movie = 0, Hint = 1, HintNamed = 2 }; +class GameSubtitleSceneInfo { + public: + struct SubtitleLine { + SubtitleLine(int frame, + std::string line, + std::string line_utf8, + std::string speaker, + std::string speaker_utf8, + bool offscreen) + : frame(frame), + line(line), + line_utf8(line_utf8), + speaker(speaker), + speaker_utf8(speaker_utf8), + offscreen(offscreen) {} + + int frame; + std::string line; + std::string line_utf8; + std::string speaker; + std::string speaker_utf8; + bool offscreen; + + bool operator<(const SubtitleLine& other) const { return (frame < other.frame); } + }; + + GameSubtitleSceneInfo() {} + GameSubtitleSceneInfo(SubtitleSceneKind kind) : m_kind(kind) {} + + const std::string& name() const { return m_name; } + const std::vector& lines() const { return m_lines; } + int id() const { return m_id; } + SubtitleSceneKind kind() const { return m_kind; } + + void clear_lines() { m_lines.clear(); } + void set_name(const std::string& new_name) { m_name = new_name; } + void set_id(int new_id) { m_id = new_id; } + void from_other_scene(GameSubtitleSceneInfo& scene) { + m_name = scene.name(); + m_lines = scene.lines(); + m_kind = scene.kind(); + m_id = scene.id(); + } + + void add_line(int frame, + std::string line, + std::string line_utf8, + std::string speaker, + std::string speaker_utf8, + bool offscreen) { + m_lines.emplace_back(SubtitleLine(frame, line, line_utf8, speaker, speaker_utf8, offscreen)); + std::sort(m_lines.begin(), m_lines.end()); + } + + std::string m_name; + int m_id; + std::vector m_lines; + SubtitleSceneKind m_kind; + std::string m_sorting_group; + int m_sorting_group_idx; +}; + +/*! + * The subtitle bank contains subtitles for all scenes in a language. + */ +class GameSubtitleBank { + public: + GameSubtitleBank(int lang_id) : m_lang_id(lang_id) {} + + int lang() const { return m_lang_id; } + const std::map& scenes() const { return m_scenes; } + + bool scene_exists(const std::string& name) const { return m_scenes.find(name) != m_scenes.end(); } + GameSubtitleSceneInfo& scene_by_name(const std::string& name) { return m_scenes.at(name); } + void add_scene(GameSubtitleSceneInfo& scene) { + ASSERT(!scene_exists(scene.name())); + m_scenes[scene.name()] = scene; + } + + int m_lang_id; + std::string file_path; + + std::map m_scenes; +}; + +class GameSubtitleGroups { + public: + std::vector m_group_order; + std::map> m_groups; + + void hydrate_from_asset_file(); + std::string find_group(const std::string& scene_name); + int find_group_index(const std::string& group_name); + void remove_scene(const std::string& group_name, const std::string& scene_name); + void add_scene(const std::string& group_name, const std::string& scene_name); + + std::string group_order_key = "_groups"; + std::string uncategorized_group = "uncategorized"; +}; + +/*! + * The subtitles database contains a subtitles bank for each language. + * Each subtitles bank contains a series of subtitle scene infos. + */ +class GameSubtitleDB { + public: + const std::map>& banks() const { return m_banks; } + + bool bank_exists(int id) const { return m_banks.find(id) != m_banks.end(); } + + std::shared_ptr add_bank(std::shared_ptr bank) { + ASSERT(!bank_exists(bank->lang())); + m_banks[bank->lang()] = bank; + return bank; + } + std::shared_ptr bank_by_id(int id) { + if (!bank_exists(id)) { + return nullptr; + } + return m_banks.at(id); + } + + std::map> m_banks; + std::unique_ptr m_subtitle_groups; +}; + +// TODO add docstrings + +void parse_text(const goos::Object& data, GameTextVersion text_ver, GameTextDB& db); +void parse_subtitle(const goos::Object& data, + GameTextVersion text_ver, + GameSubtitleDB& db, + const std::string& file_path); + +GameSubtitleDB load_subtitle_project(); diff --git a/common/symbols.h b/common/symbols.h index 2e9f5fda82..0eae391907 100644 --- a/common/symbols.h +++ b/common/symbols.h @@ -1,10 +1,13 @@ #pragma once +#include "common/versions.h" + /*! * @file symbols.h * The location of fixed symbols in the GOAL symbol table. */ +namespace jak1_symbols { constexpr int FIX_SYM_EMPTY_CAR = -0xc; constexpr int FIX_SYM_EMPTY_PAIR = -0xa; constexpr int FIX_SYM_EMPTY_CDR = -0x8; @@ -76,3 +79,96 @@ constexpr int FIX_SYM_SOUND = 0x1b8; // ?? constexpr int FIX_SYM_DGO = 0x1c0; // ?? constexpr int FIX_SYM_TOP_LEVEL = 0x1c8; // ?? constexpr int FIX_FIXED_SYM_END_OFFSET = 0x1d0; +} // namespace jak1_symbols + +namespace jak2_symbols { +constexpr int FIX_SYM_EMPTY_CAR = -0x8; +constexpr int FIX_SYM_EMPTY_PAIR = -0x6; +constexpr int FIX_SYM_EMPTY_CDR = -0x4; +constexpr int FIX_SYM_FALSE = 0x0; // GOAL boolean #f (note that this is equal to the $s7 register) +constexpr int FIX_SYM_TRUE = 0x4; // GOAL boolean #t +constexpr int FIX_SYM_FUNCTION_TYPE = 0x8; +constexpr int FIX_SYM_BASIC = 0xc; +constexpr int FIX_SYM_STRING_TYPE = 0x10; +constexpr int FIX_SYM_SYMBOL_TYPE = 0x14; +constexpr int FIX_SYM_TYPE_TYPE = 0x18; +constexpr int FIX_SYM_OBJECT_TYPE = 0x1c; +constexpr int FIX_SYM_LINK_BLOCK = 0x20; +constexpr int FIX_SYM_INTEGER = 0x24; +constexpr int FIX_SYM_SINTEGER = 0x28; +constexpr int FIX_SYM_UINTEGER = 0x2c; +constexpr int FIX_SYM_BINTEGER = 0x30; +constexpr int FIX_SYM_INT8 = 0x34; +constexpr int FIX_SYM_INT16 = 0x38; +constexpr int FIX_SYM_INT32 = 0x3c; +constexpr int FIX_SYM_INT64 = 0x40; +constexpr int FIX_SYM_INT128 = 0x44; +constexpr int FIX_SYM_UINT8 = 0x48; +constexpr int FIX_SYM_UINT16 = 0x4c; +constexpr int FIX_SYM_UINT32 = 0x50; +constexpr int FIX_SYM_UINT64 = 0x54; +constexpr int FIX_SYM_UINT128 = 0x58; +constexpr int FIX_SYM_FLOAT = 0x5c; +constexpr int FIX_SYM_PROCESS_TREE = 0x60; +constexpr int FIX_SYM_PROCESS_TYPE = 0x64; +constexpr int FIX_SYM_THREAD = 0x68; +constexpr int FIX_SYM_STRUCTURE = 0x6c; +constexpr int FIX_SYM_PAIR_TYPE = 0x70; +constexpr int FIX_SYM_POINTER = 0x74; +constexpr int FIX_SYM_NUMBER = 0x78; +constexpr int FIX_SYM_ARRAY = 0x7c; +constexpr int FIX_SYM_VU_FUNCTION = 0x80; +constexpr int FIX_SYM_CONNECTABLE = 0x84; +constexpr int FIX_SYM_STACK_FRAME = 0x88; +constexpr int FIX_SYM_FILE_STREAM = 0x8c; + +constexpr int FIX_SYM_HEAP = 0x90; +constexpr int FIX_SYM_NOTHING_FUNC = 0x94; +constexpr int FIX_SYM_DELETE_BASIC = 0x98; +constexpr int FIX_SYM_STATIC = 0x9c; +constexpr int FIX_SYM_GLOBAL_HEAP = 0xa0; +constexpr int FIX_SYM_DEBUG = 0xa4; +constexpr int FIX_SYM_LOADING_LEVEL = 0xa8; +constexpr int FIX_SYM_LOADING_PACKAGE = 0xac; +constexpr int FIX_SYM_PROCESS_LEVEL_HEAP = 0xb0; +constexpr int FIX_SYM_STACK = 0xb4; +constexpr int FIX_SYM_SCRATCH = 0xb8; +constexpr int FIX_SYM_SCRATCH_TOP = 0xbc; + +constexpr int FIX_SYM_ZERO_FUNC = 0xc0; +constexpr int FIX_SYM_ASIZE_OF_BASIC_FUNC = 0xc4; +constexpr int FIX_SYM_COPY_BASIC_FUNC = 0xc8; // bugged name +constexpr int FIX_SYM_LEVEL = 0xcc; +constexpr int FIX_SYM_ART_GROUP = 0xd0; +constexpr int FIX_SYM_TEXTURE_PAGE_DIR = 0xd4; +constexpr int FIX_SYM_TEXTURE_PAGE = 0xd8; +constexpr int FIX_SYM_SOUND = 0xdc; +constexpr int FIX_SYM_DGO = 0xe0; +constexpr int FIX_SYM_TOP_LEVEL = 0xe4; +constexpr int FIX_SYM_QUOTE = 0xe8; +constexpr int FIX_FIXED_SYM_END_OFFSET = 0xec; + +} // namespace jak2_symbols + +constexpr int false_symbol_offset() { + return jak1_symbols::FIX_SYM_FALSE; +} + +constexpr int true_symbol_offset(GameVersion version) { + switch (version) { + case GameVersion::Jak1: + return jak1_symbols::FIX_SYM_TRUE; + case GameVersion::Jak2: + return jak2_symbols::FIX_SYM_TRUE; + } +} + +constexpr int empty_pair_offset_from_s7(GameVersion version) { + switch (version) { + case GameVersion::Jak1: + return jak1_symbols::FIX_SYM_EMPTY_PAIR; + case GameVersion::Jak2: + // minus 1 for the symbol table pointer's offset. + return jak2_symbols::FIX_SYM_EMPTY_PAIR - 1; + } +} \ No newline at end of file diff --git a/common/texture/texture_conversion.h b/common/texture/texture_conversion.h index 6127781db6..a5394f296f 100644 --- a/common/texture/texture_conversion.h +++ b/common/texture/texture_conversion.h @@ -1,5 +1,8 @@ #pragma once +#include "common/common_types.h" +#include "common/util/Assert.h" + /*! * Convert from a pixel location in a texture (x, y, texture buffer width) to VRAM address (byte). * Uses the PSMCT32 format. @@ -218,4 +221,4 @@ inline u32 rgba16_to_rgba32(u32 in) { // texture format enums enum class PSM { PSMCT16 = 0x02, PSMT8 = 0x13, PSMT4 = 0x14 }; // clut format enums -enum class CPSM { PSMCT32 = 0x0, PSMCT16 = 0x02 }; \ No newline at end of file +enum class CPSM { PSMCT32 = 0x0, PSMCT16 = 0x02 }; diff --git a/common/type_system/Type.cpp b/common/type_system/Type.cpp index d7e0366040..e816b86343 100644 --- a/common/type_system/Type.cpp +++ b/common/type_system/Type.cpp @@ -3,11 +3,14 @@ * Representation of a GOAL type in the type system. */ -#include -#include "third-party/fmt/core.h" #include "Type.h" + +#include + #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + namespace { std::string reg_kind_to_string(RegClass kind) { switch (kind) { @@ -936,12 +939,16 @@ std::string BasicType::diff_impl(const Type& other_) const { // Bitfield ///////////////// -BitField::BitField(TypeSpec type, std::string name, int offset, int size) - : m_type(std::move(type)), m_name(std::move(name)), m_offset(offset), m_size(size) {} +BitField::BitField(TypeSpec type, std::string name, int offset, int size, bool skip_in_decomp) + : m_type(std::move(type)), + m_name(std::move(name)), + m_offset(offset), + m_size(size), + m_skip_in_static_decomp(skip_in_decomp) {} bool BitField::operator==(const BitField& other) const { return m_type == other.m_type && m_name == other.m_name && m_offset == other.m_offset && - other.m_size == m_size; + m_size == other.m_size; } std::string BitField::diff(const BitField& other) const { @@ -963,6 +970,11 @@ std::string BitField::diff(const BitField& other) const { result += fmt::format("size: {} vs. {}\n", m_size, other.m_size); } + if (m_skip_in_static_decomp != other.m_skip_in_static_decomp) { + result += fmt::format("skip_in_static_decomp: {} vs. {}\n", m_skip_in_static_decomp, + other.m_skip_in_static_decomp); + } + return result; } diff --git a/common/type_system/Type.h b/common/type_system/Type.h index cb101a5bb5..7ced6b8620 100644 --- a/common/type_system/Type.h +++ b/common/type_system/Type.h @@ -5,11 +5,13 @@ * Representation of a GOAL type in the type system. */ -#include #include +#include #include -#include "common/goal_constants.h" + #include "TypeSpec.h" + +#include "common/goal_constants.h" #include "common/util/Assert.h" class TypeSystem; @@ -282,6 +284,7 @@ class StructureType : public ReferenceType { bool is_always_stack_singleton() const { return m_always_stack_singleton; } void set_allow_misalign(bool misalign) { m_allow_misalign = misalign; } void set_gen_inspect(bool gen_inspect) { m_generate_inspect = gen_inspect; } + int size() const { return m_size_in_mem; } protected: friend class TypeSystem; @@ -325,11 +328,12 @@ class BasicType : public StructureType { class BitField { public: BitField() = default; - BitField(TypeSpec type, std::string name, int offset, int size); + BitField(TypeSpec type, std::string name, int offset, int size, bool skip_in_decomp); const std::string name() const { return m_name; } int offset() const { return m_offset; } int size() const { return m_size; } const TypeSpec& type() const { return m_type; } + bool skip_in_decomp() const { return m_skip_in_static_decomp; } bool operator==(const BitField& other) const; bool operator!=(const BitField& other) const { return !((*this) == other); } std::string diff(const BitField& other) const; @@ -340,6 +344,7 @@ class BitField { std::string m_name; int m_offset = -1; // in bits int m_size = -1; // in bits. + bool m_skip_in_static_decomp = false; }; class BitFieldType : public ValueType { diff --git a/common/type_system/TypeFieldLookup.cpp b/common/type_system/TypeFieldLookup.cpp index 4733c7266e..cc013e71ec 100644 --- a/common/type_system/TypeFieldLookup.cpp +++ b/common/type_system/TypeFieldLookup.cpp @@ -4,9 +4,11 @@ */ #include -#include "third-party/fmt/core.h" + #include "TypeSystem.h" +#include "third-party/fmt/core.h" + namespace { // debug prints for the reverse lookup bool debug_reverse_lookup = false; diff --git a/common/type_system/TypeSpec.cpp b/common/type_system/TypeSpec.cpp index 2765bd0225..6932c86f86 100644 --- a/common/type_system/TypeSpec.cpp +++ b/common/type_system/TypeSpec.cpp @@ -3,8 +3,10 @@ * A GOAL TypeSpec is a reference to a type or compound type. */ -#include #include "TypeSpec.h" + +#include + #include "third-party/fmt/core.h" bool TypeTag::operator==(const TypeTag& other) const { diff --git a/common/type_system/TypeSpec.h b/common/type_system/TypeSpec.h index defbc1be1d..8978f134ca 100644 --- a/common/type_system/TypeSpec.h +++ b/common/type_system/TypeSpec.h @@ -5,11 +5,12 @@ * A GOAL TypeSpec is a reference to a type or compound type. */ -#include -#include #include -#include "common/util/SmallVector.h" +#include +#include + #include "common/util/Assert.h" +#include "common/util/SmallVector.h" /*! * A :name value modifier to apply to a type. diff --git a/common/type_system/TypeSystem.cpp b/common/type_system/TypeSystem.cpp index 17dfc90c7e..4b1ecd60bb 100644 --- a/common/type_system/TypeSystem.cpp +++ b/common/type_system/TypeSystem.cpp @@ -5,12 +5,15 @@ * access types, and reverse type lookups. */ -#include "third-party/fmt/core.h" -#include "third-party/fmt/color.h" -#include #include "TypeSystem.h" -#include "common/util/math_util.h" + +#include + #include "common/util/Assert.h" +#include "common/util/math_util.h" + +#include "third-party/fmt/color.h" +#include "third-party/fmt/core.h" namespace { template @@ -211,6 +214,34 @@ void TypeSystem::forward_declare_type_method_count(const std::string& name, int m_forward_declared_method_counts[name] = num_methods; } +/*! + * forward declare, but allow the method count to be too large by up to 3 because jak2 stores + * method counts in v2/v4's like n*4 + 3. + */ +void TypeSystem::forward_declare_type_method_count_multiple_of_4(const std::string& name, + int num_methods) { + auto existing_fwd = m_forward_declared_method_counts.find(name); + if (existing_fwd != m_forward_declared_method_counts.end() && + existing_fwd->second + 3 < num_methods) { + throw_typesystem_error( + "Type {} was originally forward declared with {} methods and is now being forward declared " + "with {} methods", + name, existing_fwd->second, num_methods); + } + + auto existing_type = m_types.find(name); + if (existing_type != m_types.end()) { + int existing_count = get_next_method_id(existing_type->second.get()); + if (existing_count + 3 < num_methods) { + throw_typesystem_error( + "Type {} was defined with {} methods and is now being forward declared with {} methods", + name, existing_count, num_methods); + } + } + + m_forward_declared_method_counts[name] = num_methods; +} + int TypeSystem::get_type_method_count(const std::string& name) const { auto result = try_get_type_method_count(name); if (result) { @@ -1588,7 +1619,8 @@ void TypeSystem::add_field_to_bitfield(BitFieldType* type, const std::string& field_name, const TypeSpec& field_type, int offset, - int field_size) { + int field_size, + bool skip_in_decomp) { // in bits auto load_size = lookup_type(field_type)->get_load_size() * 8; if (field_size == -1) { @@ -1616,7 +1648,7 @@ void TypeSystem::add_field_to_bitfield(BitFieldType* type, type->get_name(), field_name, offset, offset + field_size); } - BitField field(field_type, field_name, offset, field_size); + BitField field(field_type, field_name, offset, field_size, skip_in_decomp); type->m_fields.push_back(field); } diff --git a/common/type_system/TypeSystem.h b/common/type_system/TypeSystem.h index b47f90b726..c7a52165c7 100644 --- a/common/type_system/TypeSystem.h +++ b/common/type_system/TypeSystem.h @@ -7,16 +7,16 @@ * access types, and reverse type lookups. */ +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include "TypeSpec.h" #include "Type.h" +#include "TypeSpec.h" struct TypeFlags { union { @@ -128,6 +128,8 @@ class TypeSystem { void forward_declare_type_as_type(const std::string& name); void forward_declare_type_as(const std::string& new_type, const std::string& parent_type); void forward_declare_type_method_count(const std::string& name, int num_methods); + void forward_declare_type_method_count_multiple_of_4(const std::string& name, int num_methods); + int get_type_method_count(const std::string& name) const; std::optional try_get_type_method_count(const std::string& name) const; std::string get_runtime_type(const TypeSpec& ts); @@ -222,7 +224,8 @@ class TypeSystem { const std::string& field_name, const TypeSpec& field_type, int offset, - int field_size); + int field_size, + bool skip_in_decomp); bool should_use_virtual_methods(const Type* type, int method_id) const; bool should_use_virtual_methods(const TypeSpec& type, int method_id) const; diff --git a/common/type_system/defenum.cpp b/common/type_system/defenum.cpp index 268ada104d..b6faf17c02 100644 --- a/common/type_system/defenum.cpp +++ b/common/type_system/defenum.cpp @@ -4,12 +4,15 @@ * This is used both in the compiler and in the decompiler for the type definition file. */ -#include "common/goos/ParseHelpers.h" #include "defenum.h" + #include "deftype.h" -#include "third-party/fmt/core.h" + +#include "common/goos/ParseHelpers.h" #include "common/util/BitUtils.h" +#include "third-party/fmt/core.h" + namespace { const goos::Object& car(const goos::Object* x) { if (!x->is_pair()) { @@ -60,7 +63,7 @@ EnumType* parse_defenum(const goos::Object& defenum, TypeSystem* ts) { while (current.is_symbol() && symbol_string(current).at(0) == ':') { auto option_name = symbol_string(current); iter = cdr(iter); - auto option_value = car(iter); + auto& option_value = car(iter); iter = cdr(iter); if (option_name == ":type") { @@ -82,7 +85,7 @@ EnumType* parse_defenum(const goos::Object& defenum, TypeSystem* ts) { } for (auto& e : other_info->entries()) { if (entries.find(e.first) != entries.end()) { - throw std::runtime_error(fmt::format("Entry {} appears multiple times.", e.first)); + throw std::runtime_error(fmt::format("Entry {} appears multiple times", e.first)); } entries[e.first] = e.second; } diff --git a/common/type_system/defenum.h b/common/type_system/defenum.h index 3650ee6d92..5ca25c6dec 100644 --- a/common/type_system/defenum.h +++ b/common/type_system/defenum.h @@ -7,6 +7,7 @@ */ #include "TypeSystem.h" + #include "common/goos/Object.h" EnumType* parse_defenum(const goos::Object& defenum, TypeSystem* ts); diff --git a/common/type_system/deftype.cpp b/common/type_system/deftype.cpp index b3dc903103..3880214822 100644 --- a/common/type_system/deftype.cpp +++ b/common/type_system/deftype.cpp @@ -4,8 +4,10 @@ * This is used both in the compiler and in the decompiler for the type definition file. */ -#include "common/goos/ParseHelpers.h" #include "deftype.h" + +#include "common/goos/ParseHelpers.h" + #include "third-party/fmt/core.h" /*! @@ -163,6 +165,7 @@ void add_bitfield(BitFieldType* bitfield_type, TypeSystem* ts, const goos::Objec int offset_override = -1; int size_override = -1; + bool skip_in_decomp = false; if (!rest->is_empty_list()) { while (!rest->is_empty_list()) { @@ -175,6 +178,8 @@ void add_bitfield(BitFieldType* bitfield_type, TypeSystem* ts, const goos::Objec } else if (opt_name == ":size") { size_override = get_int(car(rest)); rest = cdr(rest); + } else if (opt_name == ":do-not-decompile") { + skip_in_decomp = true; } else { throw std::runtime_error("Invalid option in field specification: " + opt_name); } @@ -186,7 +191,8 @@ void add_bitfield(BitFieldType* bitfield_type, TypeSystem* ts, const goos::Objec } // it's fine if the size is -1, that means it'll just use the type's size. - ts->add_field_to_bitfield(bitfield_type, name, type, offset_override, size_override); + ts->add_field_to_bitfield(bitfield_type, name, type, offset_override, size_override, + skip_in_decomp); } void declare_method(Type* type, TypeSystem* type_system, const goos::Object& def) { @@ -312,6 +318,7 @@ StructureDefResult parse_structure_def( int method_count_assert = -1; uint64_t flag_assert = 0; bool flag_assert_set = false; + bool set_heapbase = false; while (!rest->is_empty_list()) { if (car(rest).is_pair()) { auto opt_list = &car(rest); @@ -362,6 +369,7 @@ StructureDefResult parse_structure_def( } rest = cdr(rest); flags.heap_base = hb; + set_heapbase = true; } else if (opt_name == ":allow-misaligned") { result.allow_misaligned = true; } else if (opt_name == ":final") { @@ -374,6 +382,25 @@ StructureDefResult parse_structure_def( } } + if (ts->fully_defined_type_exists(TypeSpec("process")) && + ts->tc(TypeSpec("process"), TypeSpec(type->get_parent()))) { + // check heap-base if this is a child of process. + auto process_type = ts->get_type_of_type("process"); + auto auto_hb = (flags.size - process_type->size() + 0xf) & ~0xf; + if (!set_heapbase) { + // wasnt set manually so set automatically. + flags.heap_base = auto_hb; + } else if (flags.heap_base < auto_hb) { + // was set manually so verify if that's correct. + throw std::runtime_error( + fmt::format("Process heap underflow in type {}: heap-base is {} vs. auto-detected {}", + type->get_name(), flags.heap_base, auto_hb)); + //} else if (flags.heap_base != auto_hb) { + // fmt::print("Type {} has manual heap-base ({} vs {}). This is fine. \n", type->get_name(), + // flags.heap_base, auto_hb); + } + } + if (size_assert != -1 && flags.size != u16(size_assert)) { throw std::runtime_error("Type " + type->get_name() + " came out to size " + std::to_string(int(flags.size)) + " but size-assert was set to " + @@ -394,15 +421,6 @@ StructureDefResult parse_structure_def( flags.flag, flag_assert)); } - if (result.flags.heap_base) { - int heap_start_1 = 112 + result.flags.heap_base; - int heap_start_2 = (result.flags.size + 15) & (~15); - if (heap_start_1 != heap_start_2) { - throw std::runtime_error(fmt::format("Heap base bad on {}: {} vs {}\n", type->get_name(), - heap_start_1, heap_start_2)); - } - } - result.flags = flags; return result; } diff --git a/common/type_system/deftype.h b/common/type_system/deftype.h index dc0559aab0..d6aa240afa 100644 --- a/common/type_system/deftype.h +++ b/common/type_system/deftype.h @@ -7,6 +7,7 @@ */ #include "TypeSystem.h" + #include "common/goos/Object.h" struct DeftypeResult { diff --git a/common/type_system/state.cpp b/common/type_system/state.cpp index 64d32ad7c9..aa2cc38b73 100644 --- a/common/type_system/state.cpp +++ b/common/type_system/state.cpp @@ -1,4 +1,5 @@ #include "state.h" + #include "common/type_system/TypeSystem.h" /*! diff --git a/common/type_system/state.h b/common/type_system/state.h index b1ecb9801e..cf992455a1 100644 --- a/common/type_system/state.h +++ b/common/type_system/state.h @@ -1,6 +1,7 @@ #pragma once #include + #include "common/type_system/TypeSpec.h" /*! diff --git a/common/util/Assert.cpp b/common/util/Assert.cpp index 3d923e9be1..9844d97839 100644 --- a/common/util/Assert.cpp +++ b/common/util/Assert.cpp @@ -1,9 +1,38 @@ -#include -#include - #include "Assert.h" -void private_assert_failed(const char* expr, const char* file, int line, const char* function) { - fprintf(stderr, "%s:%d: Assertion failed: %s\nFunction: %s\n", file, line, expr, function); +#ifndef NO_ASSERT + +#include +#include +#include + +void private_assert_failed(const char* expr, + const char* file, + int line, + const char* function, + const char* msg) { + if (!msg || msg[0] == '\0') { + fprintf(stderr, "Assertion failed: '%s'\n\tSource: %s:%d\n\tFunction: %s\n", expr, file, line, + function); + } else { + fprintf(stderr, "Assertion failed: '%s'\n\tMessage: %s\n\tSource: %s:%d\n\tFunction: %s\n", + expr, msg, file, line, function); + } + fflush(stdout); // ensure any stdout logs are flushed before we terminate + fflush(stderr); abort(); } + +void private_assert_failed(const char* expr, + const char* file, + int line, + const char* function, + const std::string_view& msg) { + if (msg.empty()) { + private_assert_failed(expr, file, line, function); + } else { + private_assert_failed(expr, file, line, function, msg.data()); + } +} + +#endif diff --git a/common/util/Assert.h b/common/util/Assert.h index 40f6750dda..09d1b4ddcc 100644 --- a/common/util/Assert.h +++ b/common/util/Assert.h @@ -5,10 +5,21 @@ #pragma once +#ifndef NO_ASSERT + +#include + [[noreturn]] void private_assert_failed(const char* expr, const char* file, int line, - const char* function); + const char* function, + const char* msg = ""); + +[[noreturn]] void private_assert_failed(const char* expr, + const char* file, + int line, + const char* function, + const std::string_view& msg); #ifdef _WIN32 #define __PRETTY_FUNCTION__ __FUNCSIG__ @@ -16,3 +27,13 @@ #define ASSERT(EX) \ (void)((EX) || (private_assert_failed(#EX, __FILE__, __LINE__, __PRETTY_FUNCTION__), 0)) + +#define ASSERT_MSG(EXPR, STR) \ + (void)((EXPR) || (private_assert_failed(#EXPR, __FILE__, __LINE__, __PRETTY_FUNCTION__, STR), 0)) + +#else + +#define ASSERT(EX) ((void)0) +#define ASSERT_MSG(EXPR, STR) ((void)0) + +#endif diff --git a/common/util/BinaryReader.h b/common/util/BinaryReader.h index 066ba37df5..5eee37d8fb 100644 --- a/common/util/BinaryReader.h +++ b/common/util/BinaryReader.h @@ -8,6 +8,7 @@ #include #include #include + #include "common/common_types.h" #include "common/util/Assert.h" diff --git a/common/util/BinaryWriter.h b/common/util/BinaryWriter.h index 5232f62cc9..a4a7b22c61 100644 --- a/common/util/BinaryWriter.h +++ b/common/util/BinaryWriter.h @@ -5,10 +5,11 @@ * Write raw data like a stream. */ -#include -#include #include #include +#include +#include + #include "common/util/Assert.h" struct BinaryWriterRef { diff --git a/common/util/BitUtils.h b/common/util/BitUtils.h index e57a94ee23..f6fec27902 100644 --- a/common/util/BitUtils.h +++ b/common/util/BitUtils.h @@ -1,9 +1,10 @@ #pragma once #include -#include "common/util/Range.h" + #include "common/common_types.h" #include "common/util/Assert.h" +#include "common/util/Range.h" constexpr int BITS_PER_BYTE = 8; template diff --git a/common/util/CopyOnWrite.h b/common/util/CopyOnWrite.h index 3916e47a5a..2a8ba2c28f 100644 --- a/common/util/CopyOnWrite.h +++ b/common/util/CopyOnWrite.h @@ -1,4 +1,5 @@ #include + #include "common/util/Assert.h" /* diff --git a/common/util/DgoReader.cpp b/common/util/DgoReader.cpp index 0d360b0f9d..2203ba4600 100644 --- a/common/util/DgoReader.cpp +++ b/common/util/DgoReader.cpp @@ -1,13 +1,17 @@ -#include -#include -#include #include "DgoReader.h" + +#include +#include +#include + #include "BinaryReader.h" -#include "common/link_types.h" -#include "third-party/json.hpp" #include "BitUtils.h" #include "dgo_util.h" +#include "common/link_types.h" + +#include "third-party/json.hpp" + DgoReader::DgoReader(std::string file_name, const std::vector& data) : m_file_name(std::move(file_name)) { BinaryReader reader(data); diff --git a/common/util/DgoReader.h b/common/util/DgoReader.h index ff7693fdba..456db7cb62 100644 --- a/common/util/DgoReader.h +++ b/common/util/DgoReader.h @@ -1,7 +1,8 @@ #pragma once -#include #include +#include + #include "common/common_types.h" struct DgoDataEntry { diff --git a/common/util/DgoWriter.cpp b/common/util/DgoWriter.cpp index d75680fbdb..3cd1842413 100644 --- a/common/util/DgoWriter.cpp +++ b/common/util/DgoWriter.cpp @@ -3,9 +3,10 @@ * Create a DGO from existing files. */ +#include "DgoWriter.h" + #include "BinaryWriter.h" #include "FileUtil.h" -#include "DgoWriter.h" void build_dgo(const DgoDescription& description) { BinaryWriter writer; diff --git a/common/util/DgoWriter.h b/common/util/DgoWriter.h index f5c47031e2..d192abe1c6 100644 --- a/common/util/DgoWriter.h +++ b/common/util/DgoWriter.h @@ -5,6 +5,7 @@ * Create a DGO from existing files. */ +#include #include struct DgoDescription { diff --git a/common/util/FileUtil.cpp b/common/util/FileUtil.cpp index 2889e5a566..d553575408 100644 --- a/common/util/FileUtil.cpp +++ b/common/util/FileUtil.cpp @@ -4,32 +4,37 @@ */ #include "FileUtil.h" -#include -#include + #include /* defines FILENAME_MAX */ -#include -#include #include -#include "common/util/BinaryReader.h" +#include +#include +#include +#include + #include "BinaryWriter.h" + #include "common/common_types.h" +#include "common/util/BinaryReader.h" // This disables the use of PCLMULQDQ which is probably ok, but let's just be safe and disable it // because nobody will care if png compression is 10% slower. #define FPNG_NO_SSE 1 -#include "third-party/fpng/fpng.cpp" - -#include "third-party/fpng/fpng.h" #include "third-party/fmt/core.h" +#include "third-party/fpng/fpng.cpp" +#include "third-party/fpng/fpng.h" #include "third-party/lzokay/lzokay.hpp" #ifdef _WIN32 +#define NOMINMAX +#define WIN32_LEAN_AND_MEAN #include #else -#include #include +#include #endif #include "common/util/Assert.h" +#include namespace file_util { std::filesystem::path get_user_home_dir() { @@ -56,14 +61,23 @@ std::filesystem::path get_user_memcard_dir() { return get_user_game_dir() / "jak1" / "saves"; } -std::string get_project_path() { +struct { + bool initialized = false; + std::filesystem::path path_to_data; +} gFilePathInfo; + +/*! + * Get the path to the current executable. + */ +std::string get_current_executable_path() { #ifdef _WIN32 char buffer[FILENAME_MAX]; GetModuleFileNameA(NULL, buffer, FILENAME_MAX); - std::string::size_type pos = - std::string(buffer).rfind("jak-project"); // Strip file path down to \jak-project\ directory - return std::string(buffer).substr( - 0, pos + 11); // + 12 to include "\jak-project" in the returned filepath + std::string file_path(buffer); + if (file_path.rfind("\\\\?\\", 0) == 0) { + return file_path.substr(4); + } + return file_path; #else // do Linux stuff char buffer[FILENAME_MAX + 1]; @@ -71,13 +85,73 @@ std::string get_project_path() { FILENAME_MAX); // /proc/self acts like a "virtual folder" containing // information about the current process buffer[len] = '\0'; - std::string::size_type pos = - std::string(buffer).rfind("jak-project"); // Strip file path down to /jak-project/ directory - return std::string(buffer).substr( - 0, pos + 11); // + 12 to include "/jak-project" in the returned filepath + return std::string(buffer); #endif } +/*! + * See if the current executable is somewhere in jak-project/. If so, return the path to jak-project + */ +std::optional try_get_jak_project_path() { + std::string my_path = get_current_executable_path(); + + std::string::size_type pos = + std::string(my_path).rfind("jak-project"); // Strip file path down to /jak-project/ directory + if (pos == std::string::npos) { + return {}; + } + + return std::string(my_path).substr( + 0, pos + 11); // + 12 to include "/jak-project" in the returned filepath +} + +std::optional try_get_data_dir() { + std::filesystem::path my_path = get_current_executable_path(); + auto data_dir = my_path.parent_path() / "data"; + if (std::filesystem::exists(data_dir) && std::filesystem::is_directory(data_dir)) { + return data_dir; + } else { + return {}; + } +} + +bool setup_project_path(std::optional project_path_override) { + if (gFilePathInfo.initialized) { + return true; + } + + if (project_path_override) { + gFilePathInfo.path_to_data = *project_path_override; + gFilePathInfo.initialized = true; + fmt::print("Using explicitly set project path: {}\n", project_path_override->string()); + return true; + } + + auto data_path = try_get_data_dir(); + if (data_path) { + gFilePathInfo.path_to_data = *data_path; + gFilePathInfo.initialized = true; + fmt::print("Using data path: {}\n", data_path->string()); + return true; + } + + auto development_repo_path = try_get_jak_project_path(); + if (development_repo_path) { + gFilePathInfo.path_to_data = *development_repo_path; + gFilePathInfo.initialized = true; + fmt::print("Using development repo path: {}\n", *development_repo_path); + return true; + } + + fmt::print("Failed to initialize project path.\n"); + return false; +} + +std::filesystem::path get_jak_project_dir() { + ASSERT(gFilePathInfo.initialized); + return gFilePathInfo.path_to_data; +} + std::string get_file_path(const std::vector& input) { // TODO - clean this behaviour up, it causes unexpected behaviour when working with files // the project path should be explicitly provided by whatever if needed @@ -87,21 +161,12 @@ std::string get_file_path(const std::vector& input) { return input.at(0); } - std::string currentPath = file_util::get_project_path(); - char dirSeparator; - -#ifdef _WIN32 - dirSeparator = '\\'; -#else - dirSeparator = '/'; -#endif - - std::string filePath = currentPath; - for (int i = 0; i < int(input.size()); i++) { - filePath = filePath + dirSeparator + input[i]; + auto current_path = file_util::get_jak_project_dir(); + for (auto& str : input) { + current_path /= str; } - return filePath; + return current_path.string(); } bool create_dir_if_needed(const std::string& path) { @@ -143,7 +208,7 @@ void write_rgba_png(const std::string& name, void* data, int w, int h) { void write_text_file(const std::string& file_name, const std::string& text) { FILE* fp = fopen(file_name.c_str(), "w"); if (!fp) { - printf("Failed to fopen %s\n", file_name.c_str()); + lg::error("Failed to fopen {}\n", file_name); throw std::runtime_error("Failed to open file"); } fprintf(fp, "%s\n", text.c_str()); @@ -221,32 +286,6 @@ std::string base_name(const std::string& filename) { return filename.substr(pos); } -static bool sInitCrc = false; -static uint32_t crc_table[0x100]; - -void init_crc() { - for (uint32_t i = 0; i < 0x100; i++) { - uint32_t n = i << 24u; - for (uint32_t j = 0; j < 8; j++) - n = n & 0x80000000 ? (n << 1u) ^ 0x04c11db7u : (n << 1u); - crc_table[i] = n; - } - sInitCrc = true; -} - -uint32_t crc32(const uint8_t* data, size_t size) { - ASSERT(sInitCrc); - uint32_t crc = 0; - for (size_t i = size; i != 0; i--, data++) { - crc = crc_table[crc >> 24u] ^ ((crc << 8u) | *data); - } - return ~crc; -} - -uint32_t crc32(const std::vector& data) { - return crc32(data.data(), data.size()); -} - void ISONameFromAnimationName(char* dst, const char* src) { // The Animation Name is a bunch of words separated by dashes @@ -376,8 +415,7 @@ void MakeISOName(char* dst, const char* src) { void assert_file_exists(const char* path, const char* error_message) { if (!std::filesystem::exists(path)) { - fprintf(stderr, "File %s was not found: %s\n", path, error_message); - ASSERT(false); + ASSERT_MSG(false, fmt::format("File {} was not found: {}", path, error_message)); } } diff --git a/common/util/FileUtil.h b/common/util/FileUtil.h index 35b2806ebd..2f5eada17b 100644 --- a/common/util/FileUtil.h +++ b/common/util/FileUtil.h @@ -5,9 +5,11 @@ * Utility functions for reading and writing files. */ +#include +#include #include #include -#include + #include "common/common_types.h" namespace fs = std::filesystem; @@ -17,12 +19,12 @@ std::filesystem::path get_user_home_dir(); std::filesystem::path get_user_game_dir(); std::filesystem::path get_user_settings_dir(); std::filesystem::path get_user_memcard_dir(); -std::string get_project_path(); -std::string get_file_path(const std::vector& input); +std::filesystem::path get_jak_project_dir(); bool create_dir_if_needed(const std::string& path); bool create_dir_if_needed_for_file(const std::string& path); - +bool setup_project_path(std::optional project_path_override); +std::string get_file_path(const std::vector& 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_text_file(const std::string& file_name, const std::string& text); @@ -32,9 +34,6 @@ 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); -uint32_t crc32(const std::vector& data); void MakeISOName(char* dst, const char* src); void ISONameFromAnimationName(char* dst, const char* src); void assert_file_exists(const char* path, const char* error_message); diff --git a/common/util/FontUtils.cpp b/common/util/FontUtils.cpp index dc046fe059..b48f4e14e3 100644 --- a/common/util/FontUtils.cpp +++ b/common/util/FontUtils.cpp @@ -7,8 +7,10 @@ * Always verify the encoding if string detection suddenly goes awry. */ -#include #include "FontUtils.h" + +#include + #include "third-party/fmt/core.h" GameTextFontBank::GameTextFontBank(GameTextVersion version, @@ -387,8 +389,8 @@ static std::vector g_encode_info_jak1 = { }; static std::vector g_replace_info_jak1 = { - // \" -> " (confusing) - {"\\\"", "\""}, + // \" -> " (yeah it looks confusing) + {"\"", "\\\""}, // other {"A~Y~-21H~-5Vº~Z", "Å"}, @@ -502,6 +504,240 @@ GameTextFontBank g_font_bank_jak1(GameTextVersion::JAK1_V1, &g_replace_info_jak1, &passthrus); +/*! + * ================================ + * GAME TEXT FONT BANK - JAK 1 (v2) + * ================================ + * This font is used in: + * - Jak & Daxter: The Precursor Legacy (PAL) + * + * It is the same as v1, but _ has been fixed and no longer overlaps 掘 + */ + +static std::vector g_encode_info_jak1_v2 = { + // random + {"_", {0x03}}, // large space + {"ˇ", {0x10}}, // caron + {"`", {0x11}}, // grave accent + {"'", {0x12}}, // apostrophe + {"^", {0x13}}, // circumflex + {"", {0x14}}, // tilde + {"¨", {0x15}}, // umlaut + {"º", {0x16}}, // numero/overring + {"¡", {0x17}}, // inverted exclamation mark + {"¿", {0x18}}, // inverted question mark + + {"海", {0x1a}}, // umi + {"Æ", {0x1b}}, // aesc + {"界", {0x1c}}, // kai + {"Ç", {0x1d}}, // c-cedilla + {"学", {0x1e}}, // gaku + {"ß", {0x1f}}, // eszett + + {"\"", {0x22}}, // double-quotes + + {"ワ", {0x24}}, // wa + + {"ヲ", {0x26}}, // wo + {"ン", {0x27}}, // -n + + {"岩", {0x5c}}, // iwa + {"旧", {0x5d}}, // kyuu + {"空", {0x5e}}, // sora + {"掘", {0x5f}}, // horu + + {"ヮ", {0x60}}, // -wa + {"撃", {0x61}}, // utsu + {"賢", {0x62}}, // kashikoi + {"湖", {0x63}}, // mizuumi + {"口", {0x64}}, // kuchi + {"行", {0x65}}, // iku + {"合", {0x66}}, // ai + {"士", {0x67}}, // shi + {"寺", {0x68}}, // tera + {"山", {0x69}}, // yama + {"者", {0x6a}}, // mono + {"所", {0x6b}}, // tokoro + {"書", {0x6c}}, // kaku + {"小", {0x6d}}, // shou + {"沼", {0x6e}}, // numa + {"上", {0x6f}}, // ue + {"城", {0x70}}, // shiro + {"場", {0x71}}, // ba + {"出", {0x72}}, // shutsu + {"闇", {0x73}}, // yami + {"遺", {0x74}}, // nokosu + {"黄", {0x75}}, // ki + {"屋", {0x76}}, // ya + {"下", {0x77}}, // shita + {"家", {0x78}}, // ie + {"火", {0x79}}, // hi + {"花", {0x7a}}, // hana + {"レ", {0x7b}}, // re + {"Œ", {0x7c}}, // oe + {"ロ", {0x7d}}, // ro + + {"青", {0x7f}}, // ao + + {"・", {0x90}}, // nakaguro + {"゛", {0x91}}, // dakuten + {"゜", {0x92}}, // handakuten + {"ー", {0x93}}, // chouompu + {"『", {0x94}}, // nijuukagikakko left + {"』", {0x95}}, // nijuukagikakko right + // hiragana + {"ぁ", {0x96}}, // -a + {"あ", {0x97}}, // a + {"ぃ", {0x98}}, // -i + {"い", {0x99}}, // i + {"ぅ", {0x9a}}, // -u + {"う", {0x9b}}, // u + {"ぇ", {0x9c}}, // -e + {"え", {0x9d}}, // e + {"ぉ", {0x9e}}, // -o + {"お", {0x9f}}, // o + {"か", {0xa0}}, // ka + {"き", {0xa1}}, // ki + {"く", {0xa2}}, // ku + {"け", {0xa3}}, // ke + {"こ", {0xa4}}, // ko + {"さ", {0xa5}}, // sa + {"し", {0xa6}}, // shi + {"す", {0xa7}}, // su + {"せ", {0xa8}}, // se + {"そ", {0xa9}}, // so + {"た", {0xaa}}, // ta + {"ち", {0xab}}, // chi + {"っ", {0xac}}, // sokuon + {"つ", {0xad}}, // tsu + {"て", {0xae}}, // te + {"と", {0xaf}}, // to + {"な", {0xb0}}, // na + {"に", {0xb1}}, // ni + {"ぬ", {0xb2}}, // nu + {"ね", {0xb3}}, // ne + {"の", {0xb4}}, // no + {"は", {0xb5}}, // ha + {"ひ", {0xb6}}, // hi + {"ふ", {0xb7}}, // hu + {"へ", {0xb8}}, // he + {"ほ", {0xb9}}, // ho + {"ま", {0xba}}, // ma + {"み", {0xbb}}, // mi + {"む", {0xbc}}, // mu + {"め", {0xbd}}, // me + {"も", {0xbe}}, // mo + {"ゃ", {0xbf}}, // youon ya + {"や", {0xc0}}, // ya + {"ゅ", {0xc1}}, // youon yu + {"ゆ", {0xc2}}, // yu + {"ょ", {0xc3}}, // youon yo + {"よ", {0xc4}}, // yo + {"ら", {0xc5}}, // ra + {"り", {0xc6}}, // ri + {"る", {0xc7}}, // ru + {"れ", {0xc8}}, // re + {"ろ", {0xc9}}, // ro + {"ゎ", {0xca}}, // -wa + {"わ", {0xcb}}, // wa + {"を", {0xcc}}, // wo + {"ん", {0xcd}}, // -n + // katakana + {"ァ", {0xce}}, // -a + {"ア", {0xcf}}, // a + {"ィ", {0xd0}}, // -i + {"イ", {0xd1}}, // i + {"ゥ", {0xd2}}, // -u + {"ウ", {0xd3}}, // u + {"ェ", {0xd4}}, // -e + {"エ", {0xd5}}, // e + {"ォ", {0xd6}}, // -o + {"オ", {0xd7}}, // o + {"カ", {0xd8}}, // ka + {"キ", {0xd9}}, // ki + {"ク", {0xda}}, // ku + {"ケ", {0xdb}}, // ke + {"コ", {0xdc}}, // ko + {"サ", {0xdd}}, // sa + {"シ", {0xde}}, // shi + {"ス", {0xdf}}, // su + {"セ", {0xe0}}, // se + {"ソ", {0xe1}}, // so + {"タ", {0xe2}}, // ta + {"チ", {0xe3}}, // chi + {"ッ", {0xe4}}, // sokuon + {"ツ", {0xe5}}, // tsu + {"テ", {0xe6}}, // te + {"ト", {0xe7}}, // to + {"ナ", {0xe8}}, // na + {"ニ", {0xe9}}, // ni + {"ヌ", {0xea}}, // nu + {"ネ", {0xeb}}, // ne + {"ノ", {0xec}}, // no + {"ハ", {0xed}}, // ha + {"ヒ", {0xee}}, // hi + {"フ", {0xef}}, // hu + {"ヘ", {0xf0}}, // he + {"ホ", {0xf1}}, // ho + {"マ", {0xf2}}, // ma + {"ミ", {0xf3}}, // mi + {"ム", {0xf4}}, // mu + {"メ", {0xf5}}, // me + {"モ", {0xf6}}, // mo + {"ャ", {0xf7}}, // youon ya + {"ヤ", {0xf8}}, // ya + {"ュ", {0xf9}}, // youon yu + {"ユ", {0xfa}}, // yu + {"ョ", {0xfb}}, // youon yo + {"ヨ", {0xfc}}, // yo + {"ラ", {0xfd}}, // ra + {"リ", {0xfe}}, // ri + {"ル", {0xff}}, // ru + // kanji 2 + {"宝", {1, 0x01}}, // takara + + {"石", {1, 0x10}}, // ishi + {"赤", {1, 0x11}}, // aka + {"跡", {1, 0x12}}, // ato + {"川", {1, 0x13}}, // kawa + {"戦", {1, 0x14}}, // ikusa + {"村", {1, 0x15}}, // mura + {"隊", {1, 0x16}}, // tai + {"台", {1, 0x17}}, // utena + {"長", {1, 0x18}}, // osa + {"鳥", {1, 0x19}}, // tori + {"艇", {1, 0x1a}}, // tei + {"洞", {1, 0x1b}}, // hora + {"道", {1, 0x1c}}, // michi + {"発", {1, 0x1d}}, // hatsu + {"飛", {1, 0x1e}}, // tobu + {"噴", {1, 0x1f}}, // fuku + + {"池", {1, 0xa0}}, // ike + {"中", {1, 0xa1}}, // naka + {"塔", {1, 0xa2}}, // tou + {"島", {1, 0xa3}}, // shima + {"部", {1, 0xa4}}, // bu + {"砲", {1, 0xa5}}, // hou + {"産", {1, 0xa6}}, // san + {"眷", {1, 0xa7}}, // kaerimiru + {"力", {1, 0xa8}}, // chikara + {"緑", {1, 0xa9}}, // midori + {"岸", {1, 0xaa}}, // kishi + {"像", {1, 0xab}}, // zou + {"谷", {1, 0xac}}, // tani + {"心", {1, 0xad}}, // kokoro + {"森", {1, 0xae}}, // mori + {"水", {1, 0xaf}}, // mizu + {"船", {1, 0xb0}}, // fune + {"™", {1, 0xb1}}, // trademark +}; + +GameTextFontBank g_font_bank_jak1_v2(GameTextVersion::JAK1_V2, + &g_encode_info_jak1_v2, + &g_replace_info_jak1, + &passthrus); + /*! * ======================== * GAME TEXT FONT BANK LIST @@ -510,7 +746,8 @@ GameTextFontBank g_font_bank_jak1(GameTextVersion::JAK1_V1, */ std::map g_font_banks = { - {GameTextVersion::JAK1_V1, &g_font_bank_jak1}}; + {GameTextVersion::JAK1_V1, &g_font_bank_jak1}, + {GameTextVersion::JAK1_V2, &g_font_bank_jak1_v2}}; const GameTextFontBank* get_font_bank(GameTextVersion version) { return g_font_banks.at(version); diff --git a/common/util/FontUtils.h b/common/util/FontUtils.h index 5792bca4bc..4bfa31d2b8 100644 --- a/common/util/FontUtils.h +++ b/common/util/FontUtils.h @@ -9,12 +9,12 @@ * Always verify the encoding if string detection suddenly goes awry. */ -#include "common/common_types.h" - -#include -#include -#include #include +#include +#include +#include + +#include "common/common_types.h" // version of the game text file's text encoding. Not real, but we need to differentiate them // somehow, since the encoding changes. diff --git a/common/util/FrameLimiter.cpp b/common/util/FrameLimiter.cpp index 136ca6aae1..8c8f1e6067 100644 --- a/common/util/FrameLimiter.cpp +++ b/common/util/FrameLimiter.cpp @@ -1,4 +1,5 @@ #include "FrameLimiter.h" + #include double FrameLimiter::round_to_nearest_60fps(double current) { @@ -41,6 +42,7 @@ void FrameLimiter::run(double target_fps, #else +#define NOMINMAX #include FrameLimiter::FrameLimiter() { @@ -74,4 +76,4 @@ void FrameLimiter::run(double target_fps, m_timer.start(); } -#endif \ No newline at end of file +#endif diff --git a/common/util/Serializer.h b/common/util/Serializer.h index f49076dfc6..b8c1fff2d9 100644 --- a/common/util/Serializer.h +++ b/common/util/Serializer.h @@ -3,6 +3,8 @@ #include #include #include + +#include "common/common_types.h" #include "common/util/Assert.h" /*! @@ -35,7 +37,7 @@ class Serializer { * later be accessed with get_save_result. */ Serializer() : m_writing(true) { - const size_t initial_size = 32; + constexpr size_t initial_size = 32; m_data = (u8*)malloc(initial_size); m_size = initial_size; } @@ -201,7 +203,8 @@ class Serializer { if (m_writing) { // if we would overflow, just resize the buffer. if (m_offset + size > m_size) { - m_data = (u8*)realloc(m_data, (m_offset + size) * 2); + m_size = (m_offset + size) * 2; + m_data = (u8*)realloc(m_data, m_size); } memcpy(m_data + m_offset, data, size); } else { diff --git a/common/util/SimpleThreadGroup.cpp b/common/util/SimpleThreadGroup.cpp new file mode 100644 index 0000000000..aea1917a4d --- /dev/null +++ b/common/util/SimpleThreadGroup.cpp @@ -0,0 +1,42 @@ +#include "SimpleThreadGroup.h" + +#include "common/util/Assert.h" + +void SimpleThreadGroup::run(const std::function& func, int num_runs) { + int num_workers = std::min(num_runs, (int)std::thread::hardware_concurrency()); + run(func, num_runs, num_workers); +} + +void SimpleThreadGroup::run(const std::function& func, int num_runs, int num_workers) { + ASSERT(m_joined); + + // copy the function, in case the user gives us a temporary function. + m_func = func; + + int start_idx = 0; + for (int thread_idx = 0; thread_idx < num_workers; thread_idx++) { + int end_idx = ((thread_idx + 1) * num_runs) / num_workers; + if (thread_idx == (num_workers - 1)) { + end_idx = num_runs; + } + + m_threads.emplace_back([&, start_idx, end_idx]() { + for (int i = start_idx; i < end_idx; i++) { + m_func(i); + } + }); + + start_idx = end_idx; + } + + m_joined = false; +} + +void SimpleThreadGroup::join() { + ASSERT(!m_joined); + for (auto& t : m_threads) { + t.join(); + } + m_threads.clear(); + m_joined = true; +} \ No newline at end of file diff --git a/common/util/SimpleThreadGroup.h b/common/util/SimpleThreadGroup.h new file mode 100644 index 0000000000..a28acfc85e --- /dev/null +++ b/common/util/SimpleThreadGroup.h @@ -0,0 +1,29 @@ +#include +#include +#include + +/*! + * Very simple group of threads. + * Does: + * for (int i = 0; i < num_runs; i++) { + * func(i); + * } + * but in parallel. + * + * Two things to watch out for: + * - you must call join before this object is destroyed. The pattern of "join in the destructor" + * can cause confusing issues where resources used by threads are destroyed before the threads + * are joined, if you aren't careful about the order you declare variables. + * - the function is copied (once) + */ +class SimpleThreadGroup { + public: + void run(const std::function& func, int num_runs, int num_workers); + void run(const std::function& func, int num_runs); + void join(); + + private: + bool m_joined = true; + std::vector m_threads; + std::function m_func; +}; \ No newline at end of file diff --git a/common/util/SmallVector.h b/common/util/SmallVector.h index 9dfe4c4828..e328ea3dec 100644 --- a/common/util/SmallVector.h +++ b/common/util/SmallVector.h @@ -5,6 +5,7 @@ #include #include #include + #include "common/util/Assert.h" namespace cu { diff --git a/common/util/Timer.cpp b/common/util/Timer.cpp index 1195f29906..6050c990a0 100644 --- a/common/util/Timer.cpp +++ b/common/util/Timer.cpp @@ -1,6 +1,8 @@ #include "Timer.h" #ifdef _WIN32 +#define NOMINMAX +#define WIN32_LEAN_AND_MEAN #include #define MS_PER_SEC 1000ULL // MS = milliseconds #define US_PER_MS 1000ULL // US = microseconds diff --git a/common/util/Timer.h b/common/util/Timer.h index 762ed923a3..9be8503419 100644 --- a/common/util/Timer.h +++ b/common/util/Timer.h @@ -2,6 +2,7 @@ #include #include + #include "common/util/Assert.h" /*! diff --git a/common/util/Trie.h b/common/util/Trie.h index 34f03c5725..0767f164f9 100644 --- a/common/util/Trie.h +++ b/common/util/Trie.h @@ -1,7 +1,8 @@ #pragma once -#include #include +#include + #include "common/util/Assert.h" /*! diff --git a/common/util/compress.cpp b/common/util/compress.cpp index a31a19f47f..39f8fd6f81 100644 --- a/common/util/compress.cpp +++ b/common/util/compress.cpp @@ -1,10 +1,13 @@ -#include -#include - #include "compress.h" -#include "third-party/zstd/lib/zstd.h" + +#include +#include + #include "common/util/Assert.h" +#include "third-party/fmt/core.h" +#include "third-party/zstd/lib/zstd.h" + namespace compression { /*! @@ -17,8 +20,7 @@ std::vector compress_zstd(const void* data, size_t size) { auto compressed_size = ZSTD_compress(result.data() + sizeof(size_t), max_compressed, data, size, 1); if (ZSTD_isError(compressed_size)) { - printf("ZSTD error: %s\n", ZSTD_getErrorName(compressed_size)); - ASSERT(false); + ASSERT_MSG(false, fmt::format("ZSTD error: {}", ZSTD_getErrorName(compressed_size))); } result.resize(sizeof(size_t) + compressed_size); return result; @@ -38,8 +40,7 @@ std::vector decompress_zstd(const void* data, size_t size) { auto decomp_size = ZSTD_decompress(result.data(), decompressed_size, (const u8*)data + sizeof(size_t), compressed_size); if (ZSTD_isError(decomp_size)) { - printf("ZSTD error: %s\n", ZSTD_getErrorName(compressed_size)); - ASSERT(false); + ASSERT_MSG(false, fmt::format("ZSTD error: {}", ZSTD_getErrorName(compressed_size))); } ASSERT(decomp_size == decompressed_size); diff --git a/common/util/compress.h b/common/util/compress.h index aff7e59023..295ccfa4f9 100644 --- a/common/util/compress.h +++ b/common/util/compress.h @@ -1,6 +1,8 @@ #pragma once +#include #include + #include "common/common_types.h" namespace compression { // compress and decompress data with zstd diff --git a/common/util/crc32.cpp b/common/util/crc32.cpp new file mode 100644 index 0000000000..dc75238cc6 --- /dev/null +++ b/common/util/crc32.cpp @@ -0,0 +1,21 @@ +#include "crc32.h" + +#include +#include + +u32 crc32(const u8* data, size_t size) { + u32 result = 0xffffffff; + while (size >= 4) { + u32 x; + memcpy(&x, data, 4); + data += 4; + size -= 4; + result = _mm_crc32_u32(result, x); + } + while (size) { + result = _mm_crc32_u8(result, *data); + data++; + size--; + } + return ~result; +} \ No newline at end of file diff --git a/common/util/crc32.h b/common/util/crc32.h new file mode 100644 index 0000000000..2cd5fad94d --- /dev/null +++ b/common/util/crc32.h @@ -0,0 +1,5 @@ +#include + +#include "common/common_types.h" + +u32 crc32(const u8* data, size_t size); \ No newline at end of file diff --git a/common/util/dgo_util.cpp b/common/util/dgo_util.cpp index 4a7635239e..b328d27402 100644 --- a/common/util/dgo_util.cpp +++ b/common/util/dgo_util.cpp @@ -1,8 +1,11 @@ -#include #include "dgo_util.h" -#include "common/versions.h" -#include "third-party/fmt/core.h" + +#include + #include "common/util/Assert.h" +#include "common/versions.h" + +#include "third-party/fmt/core.h" /*! * Assert false if the char[] has non-null data after the null terminated string. @@ -19,33 +22,35 @@ void assert_string_empty_after(const char* str, int size) { } std::string get_object_file_name(const std::string& original_name, u8* data, int size) { - const std::string art_group_text = - fmt::format("/src/next/data/art-group{}/", - versions::ART_FILE_VERSION); // todo, this may change in other games + const std::string art_group_text_strings[] = { + fmt::format("/src/next/data/art-group{}/", versions::jak1::ART_FILE_VERSION), + fmt::format("/src/jak2/final/art-group{}/", versions::jak2::ART_FILE_VERSION)}; const std::string suffix = "-ag.go"; - int len = int(art_group_text.length()); - for (int start = 0; start < size; start++) { - bool failed = false; - for (int i = 0; i < len; i++) { - if (start + i >= size || data[start + i] != art_group_text[i]) { - failed = true; - break; - } - } - - if (!failed) { - for (int i = 0; i < int(original_name.length()); i++) { - if (start + len + i >= size || data[start + len + i] != original_name[i]) { - ASSERT(false); + for (auto& art_group_text : art_group_text_strings) { + int len = int(art_group_text.length()); + for (int start = 0; start < size; start++) { + bool failed = false; + for (int i = 0; i < len; i++) { + if (start + i >= size || data[start + i] != art_group_text[i]) { + failed = true; + break; } } - ASSERT(int(suffix.length()) + start + len + int(original_name.length()) < size); - ASSERT( - !memcmp(data + start + len + original_name.length(), suffix.data(), suffix.length() + 1)); + if (!failed) { + for (int i = 0; i < int(original_name.length()); i++) { + if (start + len + i >= size || data[start + len + i] != original_name[i]) { + ASSERT(false); + } + } - return original_name + "-ag"; + ASSERT(int(suffix.length()) + start + len + int(original_name.length()) < size); + ASSERT(!memcmp(data + start + len + original_name.length(), suffix.data(), + suffix.length() + 1)); + + return original_name + "-ag"; + } } } diff --git a/common/util/dgo_util.h b/common/util/dgo_util.h index 10baaef466..06d22b6e0b 100644 --- a/common/util/dgo_util.h +++ b/common/util/dgo_util.h @@ -1,7 +1,9 @@ #pragma once #include + #include "common/common_types.h" +#include "common/versions.h" void assert_string_empty_after(const char* str, int size); std::string get_object_file_name(const std::string& original_name, u8* data, int size); \ No newline at end of file diff --git a/common/util/diff.cpp b/common/util/diff.cpp index 62f8733448..7b6890e80c 100644 --- a/common/util/diff.cpp +++ b/common/util/diff.cpp @@ -32,12 +32,12 @@ #include "diff.h" -#include #include -#include #include +#include #include #include +#include namespace { enum EditType { kMatch, kAdd, kRemove, kReplace }; diff --git a/common/util/image_loading.cpp b/common/util/image_loading.cpp deleted file mode 100644 index 62971a6551..0000000000 --- a/common/util/image_loading.cpp +++ /dev/null @@ -1,13 +0,0 @@ - -// hides warnings -#ifdef __linux__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-qual" -#endif - -#define STB_IMAGE_IMPLEMENTATION -#include "third-party/stb_image.h" - -#ifdef __linux__ -#pragma GCC diagnostic pop -#endif \ No newline at end of file diff --git a/common/util/image_loading.h b/common/util/image_loading.h deleted file mode 100644 index 36fe77bfaf..0000000000 --- a/common/util/image_loading.h +++ /dev/null @@ -1 +0,0 @@ -#include "third-party/stb_image.h" diff --git a/common/util/json_util.cpp b/common/util/json_util.cpp index 428a0c4b7c..0dfbcac67a 100644 --- a/common/util/json_util.cpp +++ b/common/util/json_util.cpp @@ -1,5 +1,6 @@ -#include "common/log/log.h" #include "json_util.h" + +#include "common/log/log.h" #include "common/util/Assert.h" /*! diff --git a/common/util/json_util.h b/common/util/json_util.h index 9e3a21f6dd..1e210a097c 100644 --- a/common/util/json_util.h +++ b/common/util/json_util.h @@ -1,7 +1,9 @@ #pragma once #include + #include "common/util/Range.h" + #include "third-party/json.hpp" std::string strip_cpp_style_comments(const std::string& input); diff --git a/common/util/print_float.cpp b/common/util/print_float.cpp index 6d211fcec7..1f4c605c0d 100644 --- a/common/util/print_float.cpp +++ b/common/util/print_float.cpp @@ -1,11 +1,13 @@ +#include "print_float.h" + #include -#include "third-party/fmt/core.h" #include "common/goal_constants.h" -#include "third-party/dragonbox.h" -#include "print_float.h" #include "common/util/Assert.h" +#include "third-party/dragonbox.h" +#include "third-party/fmt/core.h" + /*! * Convert a float to a string. The string is _always_ in this format: * [negative_sign] [at least 1 digit] [decimal point] [at least 1 digit] @@ -27,6 +29,63 @@ std::string meters_to_string(float value, bool append_trailing_decimal) { return float_to_string(value / METER_LENGTH, append_trailing_decimal); } +/*! + * Convert a fixed point value to a float. Fixed point values usually end up with strange numbers + * that were definitely not what was written when we do a naive conversion. This function + * is a bit more clever. + */ +float fixed_point_to_float(s64 value, s64 scale) { + float sign = value < 0 ? -1 : 1; + value = std::abs(value); + double naive = (double)value / scale; + + double flt_scale = 1; + while (flt_scale < scale) { + // 1 -> 0.1 + flt_scale *= 10; + } + + // we have a scale with enough precision for our fixed point. now find a good decimal. + + // start at something resonable. + s64 fixed_start = (s64)(naive * flt_scale); + fixed_start = fixed_start - (fixed_start % 5); + // add e.g. 0.005 in a 1/1000 scale + s64 fixed_add = 0; + while ((s64)((fixed_start + fixed_add) / flt_scale * scale) < value) { + fixed_add += 5; + } + if ((s64)((fixed_start + fixed_add) / flt_scale * scale) == value) { + return (fixed_start + fixed_add) / flt_scale * sign; + } + + // add e.g. 0.001 in a 1/1000 scale + fixed_add = 0; + while ((s64)((fixed_start + fixed_add) / flt_scale * scale) < value) { + fixed_add += 1; + } + if ((s64)((fixed_start + fixed_add) / flt_scale * scale) == value) { + return (fixed_start + fixed_add) / flt_scale * sign; + } + // added too much! + ASSERT_MSG(false, fmt::format("fixed_point_to_float failed hard. v: {} s: {}", value, scale)); + return 0; +} + +/*! + * Convert a fixed point value to a string. Wrapper around fixed_point_to_string + */ +std::string fixed_point_to_string(s64 value, s64 scale, bool append_trailing_decimal) { + return float_to_string(fixed_point_to_float(value, scale), append_trailing_decimal); +} + +/*! + * Wrapper around fixed_point_to_string, for printing seconds. + */ +std::string seconds_to_string(s64 value, bool append_trailing_decimal) { + return fixed_point_to_string(value, TICKS_PER_SECOND, append_trailing_decimal); +} + int float_to_cstr(float value, char* buffer, bool append_trailing_decimal) { ASSERT(std::isfinite(value)); // dragonbox gives us: diff --git a/common/util/print_float.h b/common/util/print_float.h index 3849b7b279..e502d90fb1 100644 --- a/common/util/print_float.h +++ b/common/util/print_float.h @@ -2,6 +2,11 @@ #include +#include "common/common_types.h" + +float fixed_point_to_float(s64 value, s64 scale); +std::string fixed_point_to_string(s64 value, s64 scale, bool append_trailing_decimal = false); std::string float_to_string(float value, bool append_trailing_decimal = true); std::string meters_to_string(float value, bool append_trailing_decimal = false); +std::string seconds_to_string(s64 value, bool append_trailing_decimal = false); int float_to_cstr(float value, char* buffer, bool append_trailing_decimal = true); diff --git a/common/util/read_iso_file.cpp b/common/util/read_iso_file.cpp new file mode 100644 index 0000000000..74b836c37a --- /dev/null +++ b/common/util/read_iso_file.cpp @@ -0,0 +1,136 @@ +#include "read_iso_file.h" + +#include "common/common_types.h" +#include "common/log/log.h" +#include "common/util/Assert.h" +#include "common/util/FileUtil.h" + +IsoFile::IsoFile() { + root.is_dir = true; +} + +std::string IsoFile::print() const { + std::string result; + root.print(&result, ""); + return result; +} + +void IsoFile::Entry::print(std::string* result, const std::string& prefix) const { + if (is_dir) { + std::string child_prefix = prefix + "/" + name; + for (const auto& child : children) { + child.print(result, child_prefix); + } + } else { + result->append(prefix); + result->push_back('/'); + result->append(name); + result->push_back('\n'); + } +} + +namespace { +constexpr int SECTOR_SIZE = 0x800; + +template +T read_file(FILE* fp, u32 sector, u32 offset_in_sector) { + T result; + if (fseek(fp, sector * SECTOR_SIZE + offset_in_sector, SEEK_SET)) { + ASSERT_MSG(false, "Failed to fseek iso"); + } + if (fread(&result, sizeof(T), 1, fp) != 1) { + ASSERT_MSG(false, "Failed to fread iso"); + } + return result; +} + +void add_from_dir(FILE* fp, u32 sector, u32 size, IsoFile::Entry* parent) { + u32 offset = 0; + while (offset < size) { + if (!read_file(fp, sector, offset)) { + offset = (offset & ~(SECTOR_SIZE - 1)) + SECTOR_SIZE; + continue; + } + u8 record_size = read_file(fp, sector, offset); + u8 kind = read_file(fp, sector, offset + 0x21); + if ((kind != 0) && (kind != 1)) { + auto& entry = parent->children.emplace_back(); + u32 extent = read_file(fp, sector, offset + 2); + u32 dir_or_file_size = read_file(fp, sector, offset + 10); + u32 name_len = read_file(fp, sector, offset + 32); + u8 c0 = read_file(fp, sector, offset + name_len + 0x1f); + u8 c1 = read_file(fp, sector, offset + name_len + 0x20); + for (u32 i = 0; i < name_len; i++) { + entry.name.push_back(read_file(fp, sector, offset + 0x21 + i)); + } + entry.is_dir = (c0 != ';' || c1 != '1'); + if (entry.is_dir) { + add_from_dir(fp, extent, dir_or_file_size, &entry); + } else { + entry.name.pop_back(); + entry.name.pop_back(); + entry.offset_in_file = SECTOR_SIZE * extent; + entry.size = dir_or_file_size; + } + } + offset += record_size; + } +} + +void unpack_entry(FILE* fp, + IsoFile& iso, + const IsoFile::Entry& entry, + const std::filesystem::path& dest, + bool print_progress) { + std::filesystem::path path_to_entry = dest / entry.name; + if (entry.is_dir) { + std::filesystem::create_directory(path_to_entry); + for (const auto& child : entry.children) { + unpack_entry(fp, iso, child, path_to_entry, print_progress); + } + } else { + if (print_progress) { + lg::info("Extracting {}...", entry.name); + } + std::vector buffer(entry.size); + if (fseek(fp, entry.offset_in_file, SEEK_SET)) { + ASSERT_MSG(false, "Failed to fseek iso when unpacking"); + } + if (fread(buffer.data(), buffer.size(), 1, fp) != 1) { + ASSERT_MSG(false, "Failed to fread iso when unpacking"); + } + file_util::write_binary_file(path_to_entry.string(), buffer.data(), buffer.size()); + iso.files_extracted++; + if (iso.shouldHash) { + xxh::hash_t<64> hash = xxh::xxhash<64>(buffer); + iso.hashes.push_back(hash); + } + } +} +} // namespace + +IsoFile find_files_in_iso(FILE* fp) { + IsoFile result; + u32 path_table_sector = read_file(fp, 0x10, 0x8c); + u32 path_table_extent = read_file(fp, path_table_sector, 2); + u32 dir_size = read_file(fp, path_table_extent, 10); + add_from_dir(fp, path_table_extent, dir_size, &result.root); + return result; +} + +void unpack_iso_files(FILE* fp, + IsoFile& layout, + const std::filesystem::path& dest, + bool print_progress) { + unpack_entry(fp, layout, layout.root, dest, print_progress); +} + +IsoFile unpack_iso_files(FILE* fp, + const std::filesystem::path& dest, + bool print_progress, + const bool hashFiles) { + auto file = find_files_in_iso(fp); + file.shouldHash = hashFiles; + unpack_iso_files(fp, file, dest, print_progress); + return file; +} diff --git a/common/util/read_iso_file.h b/common/util/read_iso_file.h new file mode 100644 index 0000000000..ef9fae8b7f --- /dev/null +++ b/common/util/read_iso_file.h @@ -0,0 +1,41 @@ +#pragma once + +#include +#include +#include + +#include "third-party/xxhash.hpp" + +struct IsoFile { + struct Entry { + bool is_dir = false; + std::string name; + + // if file + size_t offset_in_file = 0; + size_t size = 0; + + // if dir + std::vector children; + void print(std::string* result, const std::string& prefix) const; + }; + + std::string print() const; + + Entry root; + + int files_extracted = 0; + bool shouldHash = false; + // There is no reason to map to the files, as we don't retain mappings of each file's expected + // hash + std::vector hashes = {}; + + IsoFile(); +}; + +IsoFile find_files_in_iso(FILE* fp); +void unpack_iso_files(FILE* fp, IsoFile& layout, const std::filesystem::path& dest); +IsoFile unpack_iso_files(FILE* fp, + const std::filesystem::path& dest, + bool print_progress, + const bool hashFiles = false); diff --git a/common/versions.h b/common/versions.h index 5e99f048b7..c2878f7afa 100644 --- a/common/versions.h +++ b/common/versions.h @@ -9,17 +9,26 @@ namespace versions { // language version (OpenGOAL) -constexpr s32 GOAL_VERSION_MAJOR = 0; -constexpr s32 GOAL_VERSION_MINOR = 8; - -constexpr int DECOMPILER_VERSION = 4; +constexpr s32 GOAL_VERSION_MAJOR = 1; +constexpr s32 GOAL_VERSION_MINOR = 0; +namespace jak1 { // these versions are from the game constexpr u32 ART_FILE_VERSION = 6; constexpr u32 LEVEL_FILE_VERSION = 30; constexpr u32 DGO_FILE_VERSION = 1; constexpr u32 RES_FILE_VERSION = 1; constexpr u32 TX_PAGE_VERSION = 7; +} // namespace jak1 + +namespace jak2 { +constexpr u32 ART_FILE_VERSION = 7; +constexpr u32 DGO_FILE_VERSION = 1; +constexpr u32 LEVEL_FILE_VERSION = 36; +constexpr u32 TX_PAGE_VERSION = 8; + +} // namespace jak2 + } // namespace versions // GOAL kernel version (OpenGOAL changes this version from the game's version) @@ -28,4 +37,13 @@ constexpr int KERNEL_VERSION_MINOR = 0; // OVERLORD version returned by an RPC constexpr int IRX_VERSION_MAJOR = 2; -constexpr int IRX_VERSION_MINOR = 0; \ No newline at end of file +constexpr int IRX_VERSION_MINOR = 0; + +enum class GameVersion { Jak1 = 1, Jak2 = 2 }; + +template +struct PerGameVersion { + constexpr PerGameVersion(T jak1, T jak2) : data{jak1, jak2} {} + constexpr T operator[](GameVersion v) const { return data[(int)v - 1]; } + T data[2]; +}; \ No newline at end of file diff --git a/custom_levels/README.md b/custom_levels/README.md new file mode 100644 index 0000000000..0a6a9aff04 --- /dev/null +++ b/custom_levels/README.md @@ -0,0 +1,36 @@ +# Custom Levels +Disclaimer: custom levels are still in development and are missing most features. + + +The first three steps are already done for "test zone", so this can be used as a starting point. + +# 1: File Setup +To create a custom level, copy the layout of `custom_levels/test-zone`. See `test-zone.jsonc` for information on how to name things. The `.gd` file also contains the level name. + +# 2: Modify the engine +Modify `goal_src/engine/level/level-info.gc` to add level info for each custom level. There is level info for `test-zone` at the bottom that can be used as an example. + +# 3: Modify the build system +Modify `goal_src/game.gp` and add a custom level target: +```lisp +(build-custom-level "test-zone") +;; the DGO file +(custom-level-cgo "TESTZONE.DGO" "test-zone/testzone.gd") +``` + +# 4: Export the GLTF file from blender. +For now, all meshes are displayed and treated as ground collision. This causes buggy collision because walls shouldn't use "floor" mode. + +Blender will create a `.glb` file, which must have the name specified in the `.jsonc` file and should be located in `custom_level/your_level` + +# 5: Rebuild the game +Any time the `.glb` file is changed, you must rebuild the game. Launch the compiler (`goalc`) and run `(mi)` to rebuild everything. It's recommended to leave the compiler open - it will remember files that haven't changed and skip rebuilding them. + +# 6: Go to the custom level +Start the game in debug mode `gk`. + +In the compiler window, run `(lt)` to connect to the game. You must run this again every time you restart the game. If this doesn't work, there could be a firewall issue and you must allow goalc/gk to use the network. They don't make any outside connections. + +In the compiler window, run a command like `(bg-custom 'test-zone-vis)` to load and start at a custom level. + + diff --git a/custom_levels/test-zone/test-zone.jsonc b/custom_levels/test-zone/test-zone.jsonc new file mode 100644 index 0000000000..73c66edf00 --- /dev/null +++ b/custom_levels/test-zone/test-zone.jsonc @@ -0,0 +1,15 @@ +{ + // The "in-game" name of the level. Should be lower case, with dashes (GOAL symbol name) + // the name of this file, and the folder this file is in must have the same name. + "long_name": "test-zone", + // The file name, should be upper case and 8 characters or less. + "iso_name": "TESTZONE", + // The nickname, should be exactly 3 characters + "nickname": "TSZ", // 3 char name, all uppercase + + // Background mesh file. + // Must have vertex colors. Use the blender cycles renderer, bake, diffuse, uncheck color, + // and bake to vertex colors. For now, only the first vertex color group is used, so make sure you + // only have 1. + "gltf_file": "custom_levels/test-zone/test-zone2.glb" +} \ No newline at end of file diff --git a/custom_levels/test-zone/test-zone2.glb b/custom_levels/test-zone/test-zone2.glb new file mode 100644 index 0000000000..2df7f4d595 Binary files /dev/null and b/custom_levels/test-zone/test-zone2.glb differ diff --git a/custom_levels/test-zone/testzone.gd b/custom_levels/test-zone/testzone.gd new file mode 100644 index 0000000000..0ecd61c2ae --- /dev/null +++ b/custom_levels/test-zone/testzone.gd @@ -0,0 +1,8 @@ +;; DGO definition file for Awful Village level +;; We use the convention of having a longer DGO name for levels without precomputed visibility. + +;; the actual file name still needs to be 8.3 +("TSZ.DGO" + ("static-screen.o" "static-screen") + ("test-zone.go" "test-zone") + ) \ No newline at end of file diff --git a/decompiler/CMakeLists.txt b/decompiler/CMakeLists.txt index 8cd6ddd378..d28c1b9a51 100644 --- a/decompiler/CMakeLists.txt +++ b/decompiler/CMakeLists.txt @@ -1,6 +1,7 @@ add_library( decomp + analysis/analyze_inspect_method.cpp analysis/atomic_op_builder.cpp analysis/cfg_builder.cpp analysis/expression_build.cpp @@ -37,10 +38,6 @@ add_library( Function/BasicBlocks.cpp Function/CfgVtx.cpp Function/Function.cpp - Function/TypeInspector.cpp - - IR/BasicOpBuilder.cpp - IR/IR.cpp IR2/AtomicOp.cpp IR2/AtomicOpForm.cpp @@ -55,11 +52,15 @@ add_library( IR2/LabelDB.cpp IR2/OpenGoalMapping.cpp + level_extractor/BspHeader.cpp + level_extractor/extract_collide_frags.cpp + level_extractor/extract_common.cpp level_extractor/extract_level.cpp + level_extractor/extract_merc.cpp level_extractor/extract_tfrag.cpp level_extractor/extract_tie.cpp - level_extractor/BspHeader.cpp level_extractor/extract_shrub.cpp + level_extractor/MercData.cpp ObjectFile/LinkedObjectFile.cpp ObjectFile/LinkedObjectFileCreation.cpp @@ -83,6 +84,8 @@ target_link_libraries(decomp lzokay common fmt + stb_image + xdelta3 ) add_executable(decompiler @@ -92,4 +95,17 @@ target_link_libraries(decompiler decomp common lzokay - fmt) + fmt + stb_image) + + +add_executable(extractor + extractor/main.cpp) + +target_link_libraries(extractor + decomp + common + lzokay + fmt + compiler + stb_image) diff --git a/decompiler/Disasm/Instruction.cpp b/decompiler/Disasm/Instruction.cpp index a433838634..3cb018d75b 100644 --- a/decompiler/Disasm/Instruction.cpp +++ b/decompiler/Disasm/Instruction.cpp @@ -5,10 +5,13 @@ */ #include "Instruction.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "third-party/fmt/core.h" + #include "common/util/Assert.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" + +#include "third-party/fmt/core.h" + namespace decompiler { /*! * Convert atom to a string for disassembly. diff --git a/decompiler/Disasm/Instruction.h b/decompiler/Disasm/Instruction.h index 6034c5de23..7a6bc85d2b 100644 --- a/decompiler/Disasm/Instruction.h +++ b/decompiler/Disasm/Instruction.h @@ -7,6 +7,7 @@ */ #include + #include "OpcodeInfo.h" #include "Register.h" diff --git a/decompiler/Disasm/InstructionDecode.cpp b/decompiler/Disasm/InstructionDecode.cpp index 3aaa0e1625..ecf3eaccca 100644 --- a/decompiler/Disasm/InstructionDecode.cpp +++ b/decompiler/Disasm/InstructionDecode.cpp @@ -5,9 +5,13 @@ */ #include "InstructionDecode.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" + #include "common/util/Assert.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" + +#include "third-party/fmt/core.h" + namespace decompiler { // utility class to extract fields of an opcode. struct OpcodeFields { @@ -93,6 +97,7 @@ static InstructionKind decode_cop2(OpcodeFields fields) { return IK::CTC2; default: + ASSERT(false); return IK::UNKNOWN; } break; @@ -149,6 +154,10 @@ static InstructionKind decode_cop2(OpcodeFields fields) { ASSERT(fields.data & (1 << 25)); return IK::VFTOI12; + case 0b00101111111: + ASSERT(fields.data & (1 << 25)); + return IK::VFTOI15; + case 0b00100111100: ASSERT(fields.data & (1 << 25)); return IK::VITOF0; @@ -197,10 +206,16 @@ static InstructionKind decode_cop2(OpcodeFields fields) { ASSERT(fields.data & (1 << 25)); return IK::VOPMULA; + case 0b01011111101: + return IK::VMSUBA; + case 0b01100111100: ASSERT(fields.data & (1 << 25)); return IK::VMOVE; + case 0b01100111101: + return IK::VMR32; + case 0b01110111100: ASSERT(fields.data & (1 << 25)); return IK::VDIV; @@ -343,6 +358,7 @@ static InstructionKind decode_cop2(OpcodeFields fields) { ASSERT(fields.dest() == 0b0); return IK::VCALLMS; default: + ASSERT_MSG(false, fmt::format("unknown cop2 lower11 case 0b{:b}\n", fields.lower11())); return IK::UNKNOWN; } } @@ -355,6 +371,7 @@ static InstructionKind decode_W(OpcodeFields fields) { ASSERT(fields.ft() == 0); return IK::CVTSW; default: + ASSERT(false); return IK::UNKNOWN; } } @@ -416,6 +433,7 @@ static InstructionKind decode_S(OpcodeFields fields) { ASSERT(fields.fd() == 0); return IK::CLES; default: + ASSERT(false); return IK::UNKNOWN; } } @@ -432,6 +450,7 @@ static InstructionKind decode_BC1(OpcodeFields fields) { case 0b00011: return IK::BC1TL; default: + ASSERT(false); return IK::UNKNOWN; } } @@ -454,6 +473,7 @@ static InstructionKind decode_cop1(OpcodeFields fields) { case 0b10100: return decode_W(fields); default: + ASSERT(false); return IK::UNKNOWN; } } @@ -467,6 +487,7 @@ static InstructionKind decode_c0(OpcodeFields fields) { ASSERT(fields.sa() == 0 && fields.rd() == 0 && fields.rt() == 0); return IK::EI; default: + ASSERT(false); return IK::UNKNOWN; } } @@ -486,6 +507,7 @@ static InstructionKind decode_mt0(OpcodeFields fields) { if (fields.rd() == 0b11001 && fields.sa() == 0 && (fields.data & 1) == 1) { return IK::MTPC; } else { + ASSERT(false); return IK::UNKNOWN; } } @@ -500,6 +522,7 @@ static InstructionKind decode_mf0(OpcodeFields fields) { if (fields.rd() == 0b11001 && fields.sa() == 0 && (fields.data & 1) == 1) { return IK::MFPC; } else { + ASSERT(false); return IK::UNKNOWN; } } @@ -514,6 +537,7 @@ static InstructionKind decode_cop0(OpcodeFields fields) { case 0b10000: return decode_c0(fields); default: + ASSERT(false); return InstructionKind::UNKNOWN; } } @@ -533,6 +557,7 @@ static InstructionKind decode_mmi3(OpcodeFields fields) { ASSERT(fields.rs() == 0); return IK::PCPYH; default: + ASSERT(false); return IK::UNKNOWN; } } @@ -546,6 +571,8 @@ static InstructionKind decode_mmi2(OpcodeFields fields) { return IK::PMADDH; case 0b10010: return IK::PAND; + case 0b10011: + return IK::PXOR; case 0b11100: return IK::PMULTH; case 0b11110: @@ -553,6 +580,7 @@ static InstructionKind decode_mmi2(OpcodeFields fields) { case 0b11111: return IK::PROT3W; default: + ASSERT_MSG(false, fmt::format("unknown mmi2: 0b{:b}\n", fields.MMI_func())); return IK::UNKNOWN; } } @@ -576,7 +604,10 @@ static InstructionKind decode_mmi1(OpcodeFields fields) { return IK::PEXTUH; case 0b11010: return IK::PEXTUB; + case 0b11011: + return IK::QFSRV; default: + ASSERT_MSG(false, fmt::format("unknown mmi1: 0b{:b}\n", fields.MMI_func())); return IK::UNKNOWN; } } @@ -594,8 +625,14 @@ static InstructionKind decode_mmi0(OpcodeFields fields) { return IK::PMAXW; case 0b00100: return IK::PADDH; + case 0b00101: + return IK::PSUBH; case 0b00111: return IK::PMAXH; + case 0b01000: + return IK::PADDB; + case 0b01010: + return IK::PCGTB; case 0b10010: return IK::PEXTLW; case 0b10011: @@ -609,6 +646,7 @@ static InstructionKind decode_mmi0(OpcodeFields fields) { case 0b11011: return IK::PPACB; default: + ASSERT_MSG(false, fmt::format("unknown mmi0: 0b{:b}\n", fields.MMI_func())); return IK::UNKNOWN; } } @@ -631,6 +669,7 @@ static InstructionKind decode_pmfhl(OpcodeFields fields) { ASSERT(fields.rt() == 0); return IK::PMFHL_LH; default: + ASSERT(false); return IK::UNKNOWN; } } @@ -675,13 +714,14 @@ static InstructionKind decode_mmi(OpcodeFields fields) { case 0b111111: return IK::PSRAW; default: + ASSERT(false); return IK::UNKNOWN; } } -static InstructionKind decode_regimm(OpcodeFields files) { +static InstructionKind decode_regimm(OpcodeFields fields) { typedef InstructionKind IK; - switch (files.rt()) { + switch (fields.rt()) { case 0b00000: return IK::BLTZ; case 0b00001: @@ -692,7 +732,10 @@ static InstructionKind decode_regimm(OpcodeFields files) { return IK::BGEZL; case 0b10001: return IK::BGEZAL; + case 0b11000: + return IK::MTSAB; default: + ASSERT_MSG(false, fmt::format("unknown regimm: 0b{:b}\n", fields.rt())); return IK::UNKNOWN; } } @@ -710,6 +753,7 @@ static InstructionKind decode_sync(OpcodeFields fields) { } else if (stype == 0b10000) { return IK::SYNCP; } else { + ASSERT(false); return IK::UNKNOWN; } } @@ -855,6 +899,7 @@ static InstructionKind decode_special(OpcodeFields fields) { ASSERT(fields.rs() == 0); return IK::DSRA32; default: + ASSERT(false); return IK::UNKNOWN; } } @@ -867,6 +912,7 @@ static InstructionKind decode_cache(OpcodeFields fields) { case 0b10100: return IK::CACHE_DXWBIN; default: + ASSERT(false); return IK::UNKNOWN; } } @@ -988,6 +1034,7 @@ static InstructionKind decode_opcode(uint32_t code) { case 0b111111: return IK::SD; default: + ASSERT(false); return IK::UNKNOWN; break; } diff --git a/decompiler/Disasm/InstructionDecode.h b/decompiler/Disasm/InstructionDecode.h index 45a2991637..5470e539bf 100644 --- a/decompiler/Disasm/InstructionDecode.h +++ b/decompiler/Disasm/InstructionDecode.h @@ -5,10 +5,6 @@ * The Instruction Decoder - converts a LinkedWord into a Instruction. * This is the part of the disassembler that decodes MIPS instructions. */ - -#ifndef NEXT_INSTRUCTIONDECODE_H -#define NEXT_INSTRUCTIONDECODE_H - #include "Instruction.h" namespace decompiler { @@ -17,4 +13,3 @@ class LinkedObjectFile; Instruction decode_instruction(LinkedWord& word, LinkedObjectFile& file, int seg_id, int word_id); } // namespace decompiler -#endif // NEXT_INSTRUCTIONDECODE_H diff --git a/decompiler/Disasm/InstructionMatching.cpp b/decompiler/Disasm/InstructionMatching.cpp index b8df563cf7..25580b66ec 100644 --- a/decompiler/Disasm/InstructionMatching.cpp +++ b/decompiler/Disasm/InstructionMatching.cpp @@ -4,6 +4,7 @@ */ #include "InstructionMatching.h" + #include "common/util/Assert.h" namespace decompiler { diff --git a/decompiler/Disasm/InstructionMatching.h b/decompiler/Disasm/InstructionMatching.h index b9efc44746..51bfd8b823 100644 --- a/decompiler/Disasm/InstructionMatching.h +++ b/decompiler/Disasm/InstructionMatching.h @@ -6,6 +6,7 @@ */ #include "Instruction.h" + #include "decompiler/util/MatchParam.h" namespace decompiler { diff --git a/decompiler/Disasm/InstructionParser.cpp b/decompiler/Disasm/InstructionParser.cpp index 91d5556631..dd7221130e 100644 --- a/decompiler/Disasm/InstructionParser.cpp +++ b/decompiler/Disasm/InstructionParser.cpp @@ -1,10 +1,14 @@ -#include -#include -#include -#include "common/common_types.h" #include "InstructionParser.h" + +#include +#include +#include + +#include "common/common_types.h" #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + namespace decompiler { InstructionParser::InstructionParser() { init_opcode_info(); @@ -383,8 +387,7 @@ Instruction InstructionParser::parse_single_instruction( } else if (thing == "ni") { instr.il = 0; } else { - printf("Bad interlock specification. Got %s\n", thing.c_str()); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Bad interlock specification. Got {}", thing.c_str())); } } break; @@ -399,14 +402,12 @@ Instruction InstructionParser::parse_single_instruction( } else if (thing == "w") { instr.cop2_bc = 3; } else { - printf("Bad broadcast. Got %s\n", thing.c_str()); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Bad broadcast. Got {}", thing.c_str())); } } break; default: - printf("missing DecodeType: %d\n", (int)step.decode); - ASSERT(false); + ASSERT_MSG(false, fmt::format("missing DecodeType: {}", (int)step.decode)); } } diff --git a/decompiler/Disasm/InstructionParser.h b/decompiler/Disasm/InstructionParser.h index 6bbcaa4802..47cda29f03 100644 --- a/decompiler/Disasm/InstructionParser.h +++ b/decompiler/Disasm/InstructionParser.h @@ -7,8 +7,9 @@ #include #include -#include "Instruction.h" + #include "DecompilerLabel.h" +#include "Instruction.h" namespace decompiler { struct ParsedProgram { diff --git a/decompiler/Disasm/OpcodeInfo.cpp b/decompiler/Disasm/OpcodeInfo.cpp index fb3c3c540d..91084eb556 100644 --- a/decompiler/Disasm/OpcodeInfo.cpp +++ b/decompiler/Disasm/OpcodeInfo.cpp @@ -4,6 +4,7 @@ */ #include "OpcodeInfo.h" + #include "common/util/Assert.h" namespace decompiler { @@ -278,12 +279,18 @@ void init_opcode_info() { def(IK::SYNCL, "sync.l"); // Synchronize Shared Memory (Load) def(IK::ERET, "eret"); // Exception Return def(IK::EI, "ei"); // Enable Interrupt + def(IK::MTSAB, "mtsab") + .src_gpr(FT::RS) + .src(FT::ZIMM16, DT::IMM); // Move Byte Count to Shift Amount Register + drd_srs_srt(def(IK::QFSRV, "qfsrv")).gpr128(); // Quadword Funnel Shift Right Variable drd_srs_srt(def(IK::PPACB, "ppacb").gpr128()); // Parallel Pack to Byte drd_srs_srt(def(IK::PPACH, "ppach").gpr128()); // Parallel Pack to Halfword drd_srs_srt(def(IK::PPACW, "ppacw").gpr128()); // Parallel Pack to Word + drd_srs_srt(def(IK::PADDB, "paddb").gpr128()); // Parallel Add Byte drd_srs_srt(def(IK::PADDH, "paddh").gpr128()); // Parallel Add Halfword drd_srs_srt(def(IK::PADDW, "paddw").gpr128()); // Parallel Add Word + drd_srs_srt(def(IK::PSUBH, "psubh").gpr128()); // Parallel Subtract Halfword drd_srs_srt(def(IK::PSUBW, "psubw").gpr128()); // Parallel Subtract Word drd_srs_srt(def(IK::PMINH, "pminh").gpr128()); // Parallel Minimize Halfword drd_srs_srt(def(IK::PMINW, "pminw").gpr128()); // Parallel Minimize Word @@ -293,6 +300,7 @@ void init_opcode_info() { drd_srs_srt(def(IK::PEXTLH, "pextlh").gpr128()); // Parallel Extend Lower from Halfword drd_srs_srt(def(IK::PEXTLW, "pextlw").gpr128()); // Parallel Extend Lower from Word drd_srs_srt(def(IK::PCGTW, "pcgtw").gpr128()); // Parallel Compare for Greater Than Word + drd_srs_srt(def(IK::PCGTB, "pcgtb").gpr128()); // Parallel Compare for Greater Than Byte drd_srs_srt(def(IK::PCEQB, "pceqb").gpr128()); // Parallel Compare for Equal Byte drd_srs_srt(def(IK::PCEQW, "pceqw").gpr128()); // Parallel Compare for Equal Word drd_srs_srt(def(IK::PEXTUB, "pextub").gpr128()); // Parallel Extend Upper from Byte @@ -306,6 +314,7 @@ void init_opcode_info() { drd_srs_srt(def(IK::PAND, "pand").gpr128()); // Parallel And drd_srs_srt(def(IK::POR, "por").gpr128()); // Parallel Or drd_srs_srt(def(IK::PNOR, "pnor").gpr128()); // Parallel Not Or + drd_srs_srt(def(IK::PXOR, "pxor").gpr128()); // Parallel Exclusive Or def(IK::PEXEW, "pexew").gpr128().dst_gpr(FT::RD).src_gpr(FT::RT); // Parallel Exchange Even Word @@ -372,6 +381,7 @@ void init_opcode_info() { cd_dvft_svfs(def(IK::VFTOI0, "vftoi0")); // Conversion to Fixed Point cd_dvft_svfs(def(IK::VFTOI4, "vftoi4")); // Conversion to Fixed Point cd_dvft_svfs(def(IK::VFTOI12, "vftoi12")); // Conversion to Fixed Point + cd_dvft_svfs(def(IK::VFTOI15, "vftoi15")); // Conversion to Fixed Point cd_dvft_svfs(def(IK::VITOF0, "vitof0")); // Conversion to Floating Point Number cd_dvft_svfs(def(IK::VITOF12, "vitof12")); // Conversion to Floating Point Number cd_dvft_svfs(def(IK::VITOF15, "vitof15")); // Conversion to Floating Point Number @@ -407,6 +417,7 @@ void init_opcode_info() { cd_dacc_svfs_svft(def(IK::VMULA, "vmula")); cd_dacc_svfs_svft(def(IK::VADDA, "vadda")); cd_dacc_svfs_svft(def(IK::VMADDA, "vmadda")); + cd_dacc_svfs_svft(def(IK::VMSUBA, "vmsuba")); cd_dacc_svfs_svft(def(IK::VOPMULA, "vopmula")); @@ -431,6 +442,7 @@ void init_opcode_info() { .src(FT::ZERO, DT::VU_Q); def(IK::VRGET, "vrget").src(FT::DEST, DT::DEST).dst_vf(FT::FT); + def(IK::VMR32, "vmr32").src(FT::DEST, DT::DEST).src_vf(FT::FT).dst_vf(FT::FS); // integer def(IK::VMTIR, "vmtir").dst(FT::RT, DT::VI).src_vf(FT::FS).src(FT::BC, DT::BC); diff --git a/decompiler/Disasm/OpcodeInfo.h b/decompiler/Disasm/OpcodeInfo.h index 407ef78dec..1fdb5613d4 100644 --- a/decompiler/Disasm/OpcodeInfo.h +++ b/decompiler/Disasm/OpcodeInfo.h @@ -5,9 +5,6 @@ * Decoding info for each opcode. */ -#ifndef NEXT_OPCODEINFO_H -#define NEXT_OPCODEINFO_H - #include namespace decompiler { @@ -128,6 +125,8 @@ enum class InstructionKind { EI, CACHE_DXWBIN, PREF, + MTSAB, + QFSRV, // MMI unsorted PSLLW, @@ -144,6 +143,7 @@ enum class InstructionKind { PEXTLW, PPACH, PSUBW, + PCGTB, PCGTW, PEXTLH, PEXTLB, @@ -153,6 +153,8 @@ enum class InstructionKind { PADDH, PMAXW, PPACW, + PSUBH, + PADDB, // MMI 1 PCEQW, @@ -171,6 +173,7 @@ enum class InstructionKind { PMADDH, PMULTH, PEXEW, + PXOR, // MMI 3 POR, @@ -212,6 +215,7 @@ enum class InstructionKind { VFTOI0, VFTOI4, VFTOI12, + VFTOI15, VITOF0, VITOF12, VITOF15, @@ -247,6 +251,7 @@ enum class InstructionKind { VMULA, VADDA, VMADDA, + VMSUBA, VOPMULA, VDIV, @@ -268,6 +273,7 @@ enum class InstructionKind { VRNEXT, VNOP, VWAITQ, + VMR32, VCALLMS, // last cop2 macro instruction EE_OP_MAX @@ -361,4 +367,3 @@ extern OpcodeInfo gOpcodeInfo[(uint32_t)InstructionKind::EE_OP_MAX]; void init_opcode_info(); } // namespace decompiler -#endif // NEXT_OPCODEINFO_H diff --git a/decompiler/Disasm/Register.cpp b/decompiler/Disasm/Register.cpp index ba25b290b8..12c3529b56 100644 --- a/decompiler/Disasm/Register.cpp +++ b/decompiler/Disasm/Register.cpp @@ -4,10 +4,13 @@ */ #include "Register.h" + #include -#include "third-party/fmt/core.h" + #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + namespace decompiler { namespace Reg { // register which may hold GOAL local variables @@ -125,14 +128,12 @@ Register::Register(Reg::RegisterKind kind, uint32_t num) { case Reg::COP0: case Reg::VI: if (num > 32) { - fmt::print("RegisterKind: {}, greater than 32: {}\n", kind, num); - ASSERT(false); + ASSERT_MSG(false, fmt::format("RegisterKind: {}, greater than 32: {}", kind, num)); } break; case Reg::SPECIAL: if (num > 4) { - fmt::print("Special RegisterKind: {}, greater than 4: {}\n", kind, num); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Special RegisterKind: {}, greater than 4: {}", kind, num)); } break; default: diff --git a/decompiler/Disasm/Register.h b/decompiler/Disasm/Register.h index 1341cc989b..14c1cbd41f 100644 --- a/decompiler/Disasm/Register.h +++ b/decompiler/Disasm/Register.h @@ -7,6 +7,7 @@ #include #include + #include "common/util/Assert.h" namespace decompiler { @@ -174,6 +175,8 @@ class Register { uint32_t get_special() const; bool allowed_local_gpr() const; + bool is_s6() const { return *this == Register(Reg::GPR, Reg::S6); } + bool operator==(const Register& other) const; bool operator!=(const Register& other) const; bool operator<(const Register& other) const { return id < other.id; } diff --git a/decompiler/Function/BasicBlocks.cpp b/decompiler/Function/BasicBlocks.cpp index 5b50d8927b..113258515c 100644 --- a/decompiler/Function/BasicBlocks.cpp +++ b/decompiler/Function/BasicBlocks.cpp @@ -1,9 +1,12 @@ -#include #include "BasicBlocks.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "decompiler/Disasm/InstructionMatching.h" + +#include + #include "common/util/Assert.h" +#include "decompiler/Disasm/InstructionMatching.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" + namespace decompiler { /*! * Find all basic blocks in a function. diff --git a/decompiler/Function/BasicBlocks.h b/decompiler/Function/BasicBlocks.h index 5f74c65e83..d265238a30 100644 --- a/decompiler/Function/BasicBlocks.h +++ b/decompiler/Function/BasicBlocks.h @@ -1,7 +1,7 @@ #pragma once -#include #include +#include // for RegSet: #include "decompiler/analysis/reg_usage.h" @@ -14,11 +14,6 @@ struct BasicBlock { int start_word; int end_word; - // [start, end) - int start_basic_op = -1; - int end_basic_op = -1; - int basic_op_size() const { return end_basic_op - start_basic_op; } - std::string label_name; std::vector pred; diff --git a/decompiler/Function/CfgVtx.cpp b/decompiler/Function/CfgVtx.cpp index 37f84f69e1..220ffae125 100644 --- a/decompiler/Function/CfgVtx.cpp +++ b/decompiler/Function/CfgVtx.cpp @@ -1,9 +1,13 @@ +#include "CfgVtx.h" + +#include "Function.h" + #include "common/goos/PrettyPrinter.h" +#include "common/symbols.h" +#include "common/util/Assert.h" + #include "decompiler/Disasm/InstructionMatching.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "CfgVtx.h" -#include "Function.h" -#include "common/util/Assert.h" namespace decompiler { ///////////////////////////////////////// @@ -1307,8 +1311,7 @@ bool ControlFlowGraph::clean_up_asm_branches() { // build new sequence replaced = true; if (!b0->succ_branch) { - fmt::print("asm missing branch in block {}\n", b0->to_string()); - ASSERT(false); + ASSERT_MSG(false, fmt::format("asm missing branch in block {}", b0->to_string())); } m_blocks.at(b0->succ_branch->get_first_block_id())->needs_label = true; @@ -2557,13 +2560,14 @@ void ControlFlowGraph::flag_early_exit(const std::vector& blocks) { } } -CfgVtx::DelaySlotKind get_delay_slot(const Instruction& i) { +CfgVtx::DelaySlotKind get_delay_slot(const Instruction& i, GameVersion version) { if (is_nop(i)) { return CfgVtx::DelaySlotKind::NOP; } else if (is_gpr_3(i, InstructionKind::OR, {}, Register(Reg::GPR, Reg::S7), Register(Reg::GPR, Reg::R0))) { return CfgVtx::DelaySlotKind::SET_REG_FALSE; - } else if (is_gpr_2_imm_int(i, InstructionKind::DADDIU, {}, Register(Reg::GPR, Reg::S7), 8)) { + } else if (is_gpr_2_imm_int(i, InstructionKind::DADDIU, {}, Register(Reg::GPR, Reg::S7), + true_symbol_offset(version))) { return CfgVtx::DelaySlotKind::SET_REG_TRUE; } else { return CfgVtx::DelaySlotKind::OTHER; @@ -2574,7 +2578,7 @@ namespace { /*! * Is this instruction possible in the delay slot, without using inline assembly? */ -bool branch_delay_asm(const Instruction& i) { +bool branch_delay_asm(const Instruction& i, GameVersion version) { if (is_nop(i)) { // nop can be used as a delay return false; @@ -2582,7 +2586,8 @@ bool branch_delay_asm(const Instruction& i) { Register(Reg::GPR, Reg::R0))) { // set false is used in ifs, etc return false; - } else if (is_gpr_2_imm_int(i, InstructionKind::DADDIU, {}, Register(Reg::GPR, Reg::S7), 8)) { + } else if (is_gpr_2_imm_int(i, InstructionKind::DADDIU, {}, Register(Reg::GPR, Reg::S7), + true_symbol_offset(version))) { // set true is used in sc return false; } else if (is_gpr_3(i, InstructionKind::OR, {}, {}, Register(Reg::GPR, Reg::R0))) { @@ -2607,13 +2612,13 @@ bool branch_delay_asm(const Instruction& i) { /*! * Build and resolve a Control Flow Graph as much as possible. */ -std::shared_ptr build_cfg( - const LinkedObjectFile& file, - int seg, - Function& func, - const CondWithElseLengthHack& cond_with_else_hack, - const std::unordered_set& blocks_ending_in_asm_br) { - // fmt::print("START {}\n", func.guessed_name.to_string()); +std::shared_ptr build_cfg(const LinkedObjectFile& file, + int seg, + Function& func, + const CondWithElseLengthHack& cond_with_else_hack, + const std::unordered_set& blocks_ending_in_asm_br, + GameVersion version) { + // fmt::print("START {}\n", func.guessed_name.to_string()); auto cfg = std::make_shared(); const auto& blocks = cfg->create_blocks(func.basic_blocks.size()); @@ -2706,7 +2711,7 @@ std::shared_ptr build_cfg( if (is_branch(branch_candidate, false)) { blocks.at(i)->end_branch.has_branch = true; blocks.at(i)->end_branch.branch_likely = false; - blocks.at(i)->end_branch.kind = get_delay_slot(delay_slot_candidate); + blocks.at(i)->end_branch.kind = get_delay_slot(delay_slot_candidate, version); bool branch_always = is_always_branch(branch_candidate); // need to find block target @@ -2777,7 +2782,7 @@ std::shared_ptr build_cfg( if (is_branch(likely_branch_candidate, true)) { // likely branch! auto following = func.instructions.at(likely_branch_idx + 1); - if (branch_delay_asm(following)) { + if (branch_delay_asm(following, version)) { b->end_branch.asm_branch = true; if (debug_asm_branch) { fmt::print("LIKELY ASM BRANCH: {} and {}\n", @@ -2793,7 +2798,7 @@ std::shared_ptr build_cfg( auto& branch_candidate = func.instructions.at(idx); auto& delay_slot_candidate = func.instructions.at(idx + 1); if (is_branch(branch_candidate, false)) { - if (branch_delay_asm(delay_slot_candidate)) { + if (branch_delay_asm(delay_slot_candidate, version)) { b->end_branch.asm_branch = true; if (debug_asm_branch) { fmt::print("NORMAL ASM BRANCH: {} and {}\n", branch_candidate.to_string(file.labels), diff --git a/decompiler/Function/CfgVtx.h b/decompiler/Function/CfgVtx.h index aaf2fd9584..6649255f6f 100644 --- a/decompiler/Function/CfgVtx.h +++ b/decompiler/Function/CfgVtx.h @@ -1,9 +1,13 @@ #pragma once +#include #include #include + #include "common/util/Assert.h" +#include "decompiler/config.h" + namespace goos { class Object; } @@ -389,5 +393,6 @@ std::shared_ptr build_cfg(const LinkedObjectFile& file, int seg, Function& func, const CondWithElseLengthHack& cond_with_else_hack, - const std::unordered_set& blocks_ending_in_asm_br); + const std::unordered_set& blocks_ending_in_asm_br, + GameVersion version); } // namespace decompiler diff --git a/decompiler/Function/Function.cpp b/decompiler/Function/Function.cpp index 30ab73b88c..f2f4f4f5db 100644 --- a/decompiler/Function/Function.cpp +++ b/decompiler/Function/Function.cpp @@ -1,14 +1,15 @@ -#include #include "Function.h" + +#include + #include "common/log/log.h" +#include "common/util/Assert.h" +#include "common/util/BitUtils.h" + #include "decompiler/Disasm/InstructionMatching.h" +#include "decompiler/IR2/Form.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" #include "decompiler/util/DecompilerTypeSystem.h" -#include "TypeInspector.h" -#include "decompiler/IR/IR.h" -#include "decompiler/IR2/Form.h" -#include "common/util/BitUtils.h" -#include "common/util/Assert.h" namespace decompiler { namespace { @@ -33,8 +34,10 @@ Register get_expected_fpr_backup(int n, int total) { } // namespace -Function::Function(int _start_word, int _end_word) : start_word(_start_word), end_word(_end_word) { +Function::Function(int _start_word, int _end_word, GameVersion version) + : start_word(_start_word), end_word(_end_word) { ir2.form_pool.reset(new FormPool()); + ir2.env.version = version; } Function::~Function() {} @@ -673,17 +676,6 @@ void Function::find_type_defs(LinkedObjectFile& file, DecompilerTypeSystem& dts) } } -void Function::add_basic_op(std::shared_ptr op, int start_instr, int end_instr) { - op->is_basic_op = true; - ASSERT(end_instr > start_instr); - - for (int i = start_instr; i < end_instr; i++) { - instruction_to_basic_op[i] = basic_ops.size(); - } - basic_op_to_instruction[basic_ops.size()] = start_instr; - basic_ops.push_back(op); -} - bool Function::instr_starts_basic_op(int idx) { auto op = instruction_to_basic_op.find(idx); if (op != instruction_to_basic_op.end()) { @@ -693,10 +685,6 @@ bool Function::instr_starts_basic_op(int idx) { return false; } -std::shared_ptr Function::get_basic_op_at_instr(int idx) { - return basic_ops.at(instruction_to_basic_op.at(idx)); -} - bool Function::instr_starts_atomic_op(int idx) { auto op = ir2.atomic_ops->instruction_to_atomic_op.find(idx); if (op != ir2.atomic_ops->instruction_to_atomic_op.end()) { @@ -710,20 +698,6 @@ const AtomicOp& Function::get_atomic_op_at_instr(int idx) { return *ir2.atomic_ops->ops.at(ir2.atomic_ops->instruction_to_atomic_op.at(idx)); } -int Function::get_basic_op_count() { - return basic_ops.size(); -} - -int Function::get_failed_basic_op_count() { - int count = 0; - for (auto& x : basic_ops) { - if (dynamic_cast(x.get())) { - count++; - } - } - return count; -} - /*! * Topological sort of basic blocks. * Returns a valid ordering + a list of blocks that you can't reach and therefore diff --git a/decompiler/Function/Function.h b/decompiler/Function/Function.h index e9cc7bb75b..d32f5a95d1 100644 --- a/decompiler/Function/Function.h +++ b/decompiler/Function/Function.h @@ -1,24 +1,25 @@ #pragma once -#include -#include -#include #include +#include +#include #include -#include "decompiler/analysis/atomic_op_builder.h" -#include "decompiler/Disasm/Instruction.h" -#include "decompiler/Disasm/Register.h" +#include + #include "BasicBlocks.h" #include "CfgVtx.h" -#include "common/type_system/TypeSpec.h" -#include "decompiler/config.h" #include "Warnings.h" + +#include "common/type_system/TypeSpec.h" #include "common/type_system/state.h" +#include "decompiler/Disasm/Instruction.h" +#include "decompiler/Disasm/Register.h" +#include "decompiler/analysis/atomic_op_builder.h" +#include "decompiler/config.h" + namespace decompiler { class DecompilerTypeSystem; -class IR_Atomic; -class IR; struct FunctionName { enum class FunctionKind { @@ -98,27 +99,20 @@ struct FunctionName { class Function { public: - Function(int _start_word, int _end_word); + Function(int _start_word, int _end_word, GameVersion version); ~Function(); void analyze_prologue(const LinkedObjectFile& file); void find_global_function_defs(LinkedObjectFile& file, DecompilerTypeSystem& dts); void find_method_defs(LinkedObjectFile& file, DecompilerTypeSystem& dts); void find_type_defs(LinkedObjectFile& file, DecompilerTypeSystem& dts); - void add_basic_op(std::shared_ptr op, int start_instr, int end_instr); - bool has_basic_ops() { return !basic_ops.empty(); } bool instr_starts_basic_op(int idx); - std::shared_ptr get_basic_op_at_instr(int idx); bool instr_starts_atomic_op(int idx); const AtomicOp& get_atomic_op_at_instr(int idx); - int get_basic_op_count(); - int get_failed_basic_op_count(); BlockTopologicalSort bb_topo_sort(); std::string name() const; TypeSpec type; - std::shared_ptr ir = nullptr; - int segment = -1; int start_word = -1; int end_word = -1; // not inclusive, but does include padding. @@ -175,7 +169,6 @@ class Function { } prologue; bool uses_fp_register = false; - std::vector> basic_ops; struct { bool atomic_ops_attempted = false; diff --git a/decompiler/Function/TypeInspector.cpp b/decompiler/Function/TypeInspector.cpp deleted file mode 100644 index 14063623c2..0000000000 --- a/decompiler/Function/TypeInspector.cpp +++ /dev/null @@ -1,848 +0,0 @@ -#include "decompiler/config.h" -#include "decompiler/Disasm/InstructionMatching.h" -#include "TypeInspector.h" -#include "Function.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "third-party/fmt/core.h" -#include "decompiler/util/DecompilerTypeSystem.h" -#include "common/type_system/deftype.h" -#include "decompiler/IR/IR.h" - -namespace decompiler { -namespace { -struct FieldPrint { - char format = '\0'; - std::string field_name; - std::string field_type_name; - bool has_array = false; - int array_size = -1; -}; - -FieldPrint get_field_print(const std::string& str) { - int idx = 0; - auto next = [&]() { return str.at(idx++); }; - - auto peek = [&](int off) { return str.at(idx + off); }; - - FieldPrint field_print; - - // first is ~T - char c0 = next(); - ASSERT(c0 == '~'); - char c1 = next(); - ASSERT(c1 == 'T'); - - // next the name: - char name_char = next(); - while (name_char != ':' && name_char != '[') { - field_print.field_name.push_back(name_char); - name_char = next(); - } - - // possibly array thing - if (name_char == '[') { - int size = 0; - char num_char = next(); - while (num_char >= '0' && num_char <= '9') { - size = size * 10 + (num_char - '0'); - num_char = next(); - } - field_print.has_array = true; - field_print.array_size = size; - - ASSERT(num_char == ']'); - char c = next(); - ASSERT(c == ' '); - c = next(); - ASSERT(c == '@'); - c = next(); - ASSERT(c == ' '); - c = next(); - ASSERT(c == '#'); - c = next(); - ASSERT(c == 'x'); - } else { - // next a space - char space_char = next(); - ASSERT(space_char == ' '); - } - - // next the format - char fmt1 = next(); - if (fmt1 == '~' && peek(0) != '`') { // normal ~_~% - char fmt_code = next(); - field_print.format = fmt_code; - char end1 = next(); - ASSERT(end1 == '~'); - char end2 = next(); - ASSERT(end2 == '%'); - ASSERT(idx == (int)str.size()); - } else if (fmt1 == '#' && peek(0) == '<') { // struct #~% - next(); - char type_name_c = next(); - while (type_name_c != ' ') { - field_print.field_type_name += type_name_c; - type_name_c = next(); - } - - std::string expect_end = "@ #x~X>~%"; - for (char i : expect_end) { - char c = next(); - ASSERT(i == c); - } - field_print.format = 'X'; - - ASSERT(idx == (int)str.size()); - } else if (fmt1 == '#' && peek(0) == 'x') { // #x~X~% - next(); - std::string expect_end = "~X~%"; - for (char i : expect_end) { - char c = next(); - ASSERT(i == c); - } - field_print.format = 'X'; - } else if (fmt1 == '~' && peek(0) == '`') { // ~`my-type-with-overriden-print`P~% - next(); - char type_name_c = next(); - while (type_name_c != '`') { - field_print.field_type_name += type_name_c; - type_name_c = next(); - } - - std::string expect_end = "P~%"; - for (char i : expect_end) { - char c = next(); - ASSERT(i == c); - } - field_print.format = 'P'; - - ASSERT(idx == (int)str.size()); - } else if (str.substr(idx - 1) == "(meters ~m)~%") { - field_print.format = 'm'; - } else if (str.substr(idx - 1) == "(deg ~r)~%") { - field_print.format = 'r'; - } else if (str.substr(idx - 1) == "(seconds ~e)~%") { - field_print.format = 'e'; - } - - else { - throw std::runtime_error("other format nyi in get_field_print " + str.substr(idx)); - } - - return field_print; -} - -bool is_int(IR* ir, s64 value) { - auto as_int = dynamic_cast(ir); - return as_int && as_int->value == value; -} - -bool is_reg(IR* ir, Register reg) { - auto as_reg = dynamic_cast(ir); - return as_reg && as_reg->reg == reg; -} - -bool is_math_reg_constant(IR* ir, IR_IntMath2::Kind kind, Register src0, s64 src1) { - auto as_math = dynamic_cast(ir); - return as_math && as_math->kind == kind && is_reg(as_math->arg0.get(), src0) && - is_int(as_math->arg1.get(), src1); -} - -bool is_load_with_offset(IR* ir, IR_Load::Kind kind, int load_size, Register base, s64 offset) { - auto as_load = dynamic_cast(ir); - return as_load && as_load->kind == kind && as_load->size == load_size && - is_math_reg_constant(as_load->location.get(), IR_IntMath2::ADD, base, offset); -} - -bool is_get_load_with_offset(IR* ir, - Register dst, - IR_Load::Kind kind, - int load_size, - Register base, - s64 offset) { - auto as_set = dynamic_cast(ir); - return as_set && is_reg(as_set->dst.get(), dst) && - is_load_with_offset(as_set->src.get(), kind, load_size, base, offset); -} - -struct LoadInfo { - int offset = 0; - int size = 0; - IR_Load::Kind kind; -}; - -LoadInfo get_load_info_from_set(IR* load) { - auto as_set = dynamic_cast(load); - ASSERT(as_set); - auto as_load = dynamic_cast(as_set->src.get()); - ASSERT(as_load); - LoadInfo info; - info.kind = as_load->kind; - info.size = as_load->size; - if (dynamic_cast(as_load->location.get())) { - info.offset = 0; - return info; - } - - auto as_math = dynamic_cast(as_load->location.get()); - ASSERT(as_math); - ASSERT(as_math->kind == IR_IntMath2::ADD); - auto as_int = dynamic_cast(as_math->arg1.get()); - ASSERT(as_int); - info.offset = as_int->value; - return info; -} - -Register get_base_of_load(IR_Load* load) { - auto as_reg = dynamic_cast(load->location.get()); - if (as_reg) { - return as_reg->reg; - } - - auto as_math = dynamic_cast(load->location.get()); - ASSERT(as_math->kind == IR_IntMath2::ADD); - ASSERT(dynamic_cast(as_math->arg1.get())); - auto math_reg = dynamic_cast(as_math->arg0.get()); - if (math_reg) { - return math_reg->reg; - } else { - ASSERT(false); - } - return {}; -} - -bool is_load_with_base(IR* ir, Register base) { - auto as_load = dynamic_cast(ir); - return as_load && base == get_base_of_load(as_load); -} - -bool is_get_load(IR* ir, Register dst, Register base) { - auto as_set = dynamic_cast(ir); - return as_set && is_reg(as_set->dst.get(), dst) && is_load_with_base(as_set->src.get(), base); -} - -bool is_reg_reg_move(IR* ir, Register dst, Register src) { - auto as_set = dynamic_cast(ir); - return as_set && is_reg(as_set->dst.get(), dst) && is_reg(as_set->src.get(), src); -} - -bool is_sym_value(IR* ir, const std::string& sym_name) { - auto as_sym_value = dynamic_cast(ir); - return as_sym_value && as_sym_value->name == sym_name; -} - -bool is_sym(IR* ir, const std::string& sym_name) { - auto as_sym = dynamic_cast(ir); - return as_sym && as_sym->name == sym_name; -} - -bool is_get_sym_value(IR* ir, Register dst, const std::string& sym_name) { - auto as_set = dynamic_cast(ir); - return as_set && is_reg(as_set->dst.get(), dst) && is_sym_value(as_set->src.get(), sym_name); -} - -bool is_get_sym(IR* ir, Register dst, const std::string& sym_name) { - auto as_set = dynamic_cast(ir); - return as_set && is_reg(as_set->dst.get(), dst) && is_sym(as_set->src.get(), sym_name); -} - -bool is_label(IR* ir) { - return dynamic_cast(ir); -} - -bool is_get_label(IR* ir, Register dst) { - auto as_set = dynamic_cast(ir); - return as_set && is_reg(as_set->dst.get(), dst) && is_label(as_set->src.get()); -} - -int get_label_id_of_set(IR* ir) { - return dynamic_cast(dynamic_cast(ir)->src.get())->label_id; -} - -bool is_set_shift(IR* ir) { - auto as_set = dynamic_cast(ir); - if (as_set) { - auto as_math = dynamic_cast(as_set->src.get()); - if (as_math && (as_math->kind == IR_IntMath2::LEFT_SHIFT || - as_math->kind == IR_IntMath2::RIGHT_SHIFT_LOGIC || - as_math->kind == IR_IntMath2::RIGHT_SHIFT_ARITH)) { - return true; - } - } - - auto as_asm = dynamic_cast(ir); - return as_asm && as_asm->name == "sllv"; -} - -bool get_ptr_offset_constant_nonzero(IR_IntMath2* math, Register base, int* result) { - if (!is_reg(math->arg0.get(), base)) { - return false; - } - - auto as_int = dynamic_cast(math->arg1.get()); - if (!as_int) { - return false; - } - - *result = as_int->value; - return true; -} - -bool get_ptr_offset_zero(IR_IntMath2* math, Register base, int* result) { - if (!is_reg(math->arg0.get(), make_gpr(Reg::R0)) || !is_reg(math->arg1.get(), base)) { - return false; - } - *result = 0; - return true; -} - -bool get_ptr_offset(IR* ir, Register dst, Register base, int* result) { - auto as_set = dynamic_cast(ir); - if (!as_set) { - return false; - } - - if (!is_reg(as_set->dst.get(), dst)) { - return false; - } - - auto as_math = dynamic_cast(as_set->src.get()); - if (!as_math) { - return false; - } - return get_ptr_offset_constant_nonzero(as_math, base, result) || - get_ptr_offset_zero(as_math, base, result); -} - -int get_start_idx(Function& function, - LinkedObjectFile& file, - TypeInspectorResult* result, - const std::string& parent_type) { - if (function.basic_blocks.size() > 1) { - result->warnings += " too many basic blocks"; - return 0; - } - - /* - ;; for a basic - or gp, a0, r0 ;; (set! gp a0) - lw t9, format(s7) ;; (set! t9 format) - daddiu a0, s7, #t ;; (set! a0 '#t) - daddiu a1, fp, L362 ;; (set! a1 L362) "[~8x] ~A~%" - or a2, gp, r0 ;; (set! a2 gp) - lwu a3, -4(gp) ;; (set! a3 (l.wu (+.i gp -4))) - jalr ra, t9 ;; (call!) - sll v0, ra, 0 - ;; for a struct - or gp, a0, r0 ;; (set! gp a0) - lw t9, format(s7) ;; (set! t9 format) - daddiu a0, s7, #t ;; (set! a0 '#t) - daddiu a1, fp, L79 ;; (set! a1 L79) "[~8x] ~A~%" - or a2, gp, r0 ;; (set! a2 gp) - daddiu a3, s7, dead-pool-heap-rec;; (set! a3 'dead-pool-heap-rec) - jalr ra, t9 ;; (call!) - */ - - // check size - if (function.basic_ops.size() < 7) { - result->warnings += " not enough basic ops"; - return 0; - } - - auto& move_op = function.basic_ops.at(0); - if (!is_reg_reg_move(move_op.get(), make_gpr(Reg::GP), make_gpr(Reg::A0))) { - result->warnings += "bad first move"; - return 0; - } - - auto& get_format_op = function.basic_ops.at(1); - - if (is_get_sym_value(get_format_op.get(), make_gpr(Reg::T9), "format")) { - auto& get_true = function.basic_ops.at(2); - if (!is_get_sym(get_true.get(), make_gpr(Reg::A0), "#t")) { - result->warnings += "bad get true"; - return 0; - } - - auto& get_str = function.basic_ops.at(3); - if (!is_get_label(get_str.get(), make_gpr(Reg::A1))) { - result->warnings += "bad get label"; - return 0; - } - - auto str = file.get_goal_string_by_label(file.labels.at(get_label_id_of_set(get_str.get()))); - if (str != "[~8x] ~A~%") { - result->warnings += "bad type dec string: " + str; - return 0; - } - - auto& move2_op = function.basic_ops.at(4); - if (!is_reg_reg_move(move2_op.get(), make_gpr(Reg::A2), make_gpr(Reg::GP))) { - result->warnings += "bad second move"; - return 0; - } - - auto& load_op = function.basic_ops.at(5); - bool is_basic_load = is_get_load_with_offset(load_op.get(), make_gpr(Reg::A3), - IR_Load::UNSIGNED, 4, make_gpr(Reg::GP), -4); - result->is_basic = is_basic_load; - - bool is_struct_load = is_get_sym(load_op.get(), make_gpr(Reg::A3), function.method_of_type); - - if (!is_basic_load && !is_struct_load) { - result->warnings += "bad load"; - return 0; - } - - auto& call = function.basic_ops.at(6); - if (!dynamic_cast(call.get())) { - result->warnings += "bad call"; - return 0; - } - - // okay! - return 7; - } else { - if (is_get_sym_value(get_format_op.get(), make_gpr(Reg::V1), parent_type)) { - // now get the inspect method. - auto& get_method_op = function.basic_ops.at(2); - if (!is_get_load_with_offset(get_method_op.get(), make_gpr(Reg::T9), IR_Load::UNSIGNED, 4, - make_gpr(Reg::V1), 28)) { - result->warnings += "bad get method op " + get_method_op->print(file); - return 0; - } - - auto& move2_op = function.basic_ops.at(3); - if (!is_reg_reg_move(move2_op.get(), make_gpr(Reg::A0), make_gpr(Reg::GP))) { - result->warnings += "bad move2 op " + move2_op->print(file); - return 0; - } - - auto& call_op = function.basic_ops.at(4); - if (!dynamic_cast(call_op.get())) { - result->warnings += "bad call op " + call_op->print(file); - return 0; - } - - result->warnings += "inherited inpspect of " + parent_type; - result->is_basic = true; - return 5; - - } else { - result->warnings += - "unrecognized get op: " + get_format_op->print(file) + " parent was " + parent_type; - return 0; - } - } -} - -int identify_basic_field(int idx, - Function& function, - LinkedObjectFile& file, - TypeInspectorResult* result, - FieldPrint& print_info) { - (void)file; - auto load_info = get_load_info_from_set(function.basic_ops.at(idx++).get()); - ASSERT(load_info.size == 4); - ASSERT(load_info.kind == IR_Load::UNSIGNED || load_info.kind == IR_Load::SIGNED); - - if (load_info.kind == IR_Load::SIGNED) { - result->warnings += "field " + print_info.field_name + " is a basic loaded with a signed load "; - } - - int offset = load_info.offset; - if (result->is_basic) { - offset += BASIC_OFFSET; - } - - Field field(print_info.field_name, TypeSpec("basic"), offset); - result->fields_of_type.push_back(field); - return idx; -} - -int identify_pointer_field(int idx, - Function& function, - LinkedObjectFile& file, - TypeInspectorResult* result, - FieldPrint& print_info) { - (void)file; - auto load_info = get_load_info_from_set(function.basic_ops.at(idx++).get()); - ASSERT(load_info.size == 4); - ASSERT(load_info.kind == IR_Load::UNSIGNED); - - int offset = load_info.offset; - if (result->is_basic) { - offset += BASIC_OFFSET; - } - - Field field(print_info.field_name, TypeSpec("pointer"), offset); - result->fields_of_type.push_back(field); - return idx; -} - -int identify_array_field(int idx, - Function& function, - LinkedObjectFile& file, - TypeInspectorResult* result, - FieldPrint& print_info) { - auto& get_op = function.basic_ops.at(idx++); - int offset = 0; - if (!get_ptr_offset(get_op.get(), make_gpr(Reg::A2), make_gpr(Reg::GP), &offset)) { - printf("bad get ptr offset %s\n", get_op->print(file).c_str()); - ASSERT(false); - } - if (result->is_basic) { - offset += BASIC_OFFSET; - } - - Field field(print_info.field_name, TypeSpec("UNKNOWN"), offset); - if (print_info.array_size) { - field.set_array(print_info.array_size); - } else { - field.set_dynamic(); - } - result->fields_of_type.push_back(field); - return idx; -} - -int identify_float_field(int idx, - Function& function, - LinkedObjectFile& file, - TypeInspectorResult* result, - FieldPrint& print_info) { - auto load_info = get_load_info_from_set(function.basic_ops.at(idx++).get()); - ASSERT(load_info.size == 4); - ASSERT(load_info.kind == IR_Load::FLOAT); - - auto& float_move = function.basic_ops.at(idx++); - if (!is_reg_reg_move(float_move.get(), make_gpr(Reg::A2), make_fpr(0))) { - printf("bad float move: %s\n", float_move->print(file).c_str()); - ASSERT(false); - } - - std::string type; - switch (print_info.format) { - case 'f': - type = "float"; - break; - case 'm': - type = "meters"; - break; - case 'r': - type = "deg"; - break; - case 'X': - type = "float"; - result->warnings += "field " + print_info.field_name + " is a float printed as hex? "; - break; - default: - ASSERT(false); - } - int offset = load_info.offset; - if (result->is_basic) { - offset += BASIC_OFFSET; - } - - Field field(print_info.field_name, TypeSpec(type), offset); - result->fields_of_type.push_back(field); - return idx; -} - -int identify_struct_not_inline_field(int idx, - Function& function, - LinkedObjectFile& file, - TypeInspectorResult* result, - FieldPrint& print_info) { - (void)file; - auto load_info = get_load_info_from_set(function.basic_ops.at(idx++).get()); - - if (!(load_info.size == 4 && load_info.kind == IR_Load::UNSIGNED)) { - result->warnings += "field " + print_info.field_type_name + " is likely a value type"; - } - int offset = load_info.offset; - if (result->is_basic) { - offset += BASIC_OFFSET; - } - - Field field(print_info.field_name, TypeSpec(print_info.field_type_name), offset); - result->fields_of_type.push_back(field); - return idx; -} - -int identify_struct_inline_field(int idx, - Function& function, - LinkedObjectFile& file, - TypeInspectorResult* result, - FieldPrint& print_info) { - auto& get_op = function.basic_ops.at(idx++); - int offset = 0; - if (!get_ptr_offset(get_op.get(), make_gpr(Reg::A2), make_gpr(Reg::GP), &offset)) { - printf("bad get ptr offset %s\n", get_op->print(file).c_str()); - ASSERT(false); - } - if (result->is_basic) { - offset += BASIC_OFFSET; - } - - Field field(print_info.field_name, TypeSpec(print_info.field_type_name), offset); - field.set_inline(); - result->fields_of_type.push_back(field); - return idx; -} - -int identify_int_field(int idx, - Function& function, - LinkedObjectFile& file, - TypeInspectorResult* result, - FieldPrint& print_info) { - (void)file; - auto load_info = get_load_info_from_set(function.basic_ops.at(idx++).get()); - - std::string field_type_name; - if (load_info.kind == IR_Load::UNSIGNED) { - field_type_name += "u"; - } else if (load_info.kind == IR_Load::FLOAT) { - ASSERT(false); // ... - } - field_type_name += "int"; - - switch (load_info.size) { - case 1: - field_type_name += "8"; - break; - case 2: - field_type_name += "16"; - break; - case 4: - field_type_name += "32"; - break; - case 8: - field_type_name += "64"; - break; - case 16: - field_type_name += "128"; - break; - default: - throw std::runtime_error("unknown load op size in identify int field " + - std::to_string((int)load_info.size)); - } - - if (print_info.format == 'e') { - switch (load_info.kind) { - case IR_Load::SIGNED: - field_type_name = "sseconds"; - break; - case IR_Load::UNSIGNED: - field_type_name = "useconds"; - break; - default: - ASSERT(false); - } - ASSERT(load_info.size == 8); - } - - int offset = load_info.offset; - if (result->is_basic) { - offset += BASIC_OFFSET; - } - - Field field(print_info.field_name, TypeSpec(field_type_name), offset); - result->fields_of_type.push_back(field); - - return idx; -} - -int detect(int idx, Function& function, LinkedObjectFile& file, TypeInspectorResult* result) { - auto& get_format_op = function.basic_ops.at(idx++); - if (!is_get_sym_value(get_format_op.get(), make_gpr(Reg::T9), "format")) { - printf("bad get format"); - ASSERT(false); - } - - auto& get_true = function.basic_ops.at(idx++); - if (!is_get_sym(get_true.get(), make_gpr(Reg::A0), "#t")) { - printf("bad get true"); - ASSERT(false); - } - - auto& get_str = function.basic_ops.at(idx++); - if (!is_get_label(get_str.get(), make_gpr(Reg::A1))) { - result->warnings += "bad get label"; - return true; - } - - auto str = file.get_goal_string_by_label(file.labels.at(get_label_id_of_set(get_str.get()))); - auto info = get_field_print(str); - - auto& first_get_op = function.basic_ops.at(idx); - - if (is_get_load(first_get_op.get(), make_gpr(Reg::A2), make_gpr(Reg::GP)) && - (info.format == 'D' || info.format == 'X' || info.format == 'e') && !info.has_array && - info.field_type_name.empty()) { - idx = identify_int_field(idx, function, file, result, info); - // it's a load! - } else if (is_get_load(first_get_op.get(), make_fpr(0), make_gpr(Reg::GP)) && - (info.format == 'f' || info.format == 'm' || info.format == 'r' || - info.format == 'X') && - !info.has_array && info.field_type_name.empty()) { - idx = identify_float_field(idx, function, file, result, info); - } else if (is_get_load(first_get_op.get(), make_gpr(Reg::A2), make_gpr(Reg::GP)) && - info.format == 'A' && !info.has_array && info.field_type_name.empty()) { - idx = identify_basic_field(idx, function, file, result, info); - } else if (is_get_load(first_get_op.get(), make_gpr(Reg::A2), make_gpr(Reg::GP)) && - info.format == 'X' && !info.has_array && info.field_type_name.empty()) { - idx = identify_pointer_field(idx, function, file, result, info); - } else if (info.has_array && (info.format == 'X' || info.format == 'P') && - info.field_type_name.empty()) { - idx = identify_array_field(idx, function, file, result, info); - } else if (!info.has_array && (info.format == 'X' || info.format == 'P') && - !info.field_type_name.empty()) { - // structure. - if (is_get_load(first_get_op.get(), make_gpr(Reg::A2), make_gpr(Reg::GP))) { - // not inline - idx = identify_struct_not_inline_field(idx, function, file, result, info); - } else { - idx = identify_struct_inline_field(idx, function, file, result, info); - } - } - - else if (is_set_shift(first_get_op.get())) { - result->warnings += "likely a bitfield type"; - return -1; - } else { - printf("couldn't do %s, %s\n", str.c_str(), first_get_op->print(file).c_str()); - return -1; - } - - auto& call_op = function.basic_ops.at(idx++); - if (!dynamic_cast(call_op.get())) { - printf("bad call\n"); - ASSERT(false); - } - - return idx; -} -} // namespace - -TypeInspectorResult inspect_inspect_method(Function& inspect, - const std::string& type_name, - DecompilerTypeSystem& dts, - LinkedObjectFile& file, - bool skip_fields) { - TypeInspectorResult result; - TypeFlags flags; - flags.flag = 0; - dts.lookup_flags(type_name, &flags.flag); - result.type_name = type_name; - result.parent_type_name = dts.lookup_parent_from_inspects(type_name); - result.flags = flags.flag; - result.type_size = flags.size; - result.type_method_count = flags.methods; - result.type_heap_base = flags.heap_base; - ASSERT(flags.pad == 0); - - int idx = get_start_idx(inspect, file, &result, result.parent_type_name); - if (idx == 0 || skip_fields) { - // printf("was weird: %s\n", result.warnings.c_str()); - return result; - } - while (idx < int(inspect.basic_ops.size()) - 1 && idx != -1) { - idx = detect(idx, inspect, file, &result); - } - - // todo, continue to identify fields, then identify the return. - - result.success = true; - return result; -} - -std::string TypeInspectorResult::print_as_deftype() { - std::string result; - - result += fmt::format("(deftype {} ({})\n (", type_name, parent_type_name); - - int longest_field_name = 0; - int longest_type_name = 0; - int longest_mods = 0; - - std::string inline_string = ":inline"; - std::string dynamic_string = ":dynamic"; - - for (auto& field : fields_of_type) { - longest_field_name = std::max(longest_field_name, int(field.name().size())); - longest_type_name = std::max(longest_type_name, int(field.type().print().size())); - - int mods = 0; - // mods are array size, :inline, :dynamic - if (field.is_array() && !field.is_dynamic()) { - mods += std::to_string(field.array_size()).size(); - } - - if (field.is_inline()) { - if (mods) { - mods++; // space - } - mods += inline_string.size(); - } - - if (field.is_dynamic()) { - if (mods) { - mods++; // space - } - mods += dynamic_string.size(); - } - longest_mods = std::max(longest_mods, mods); - } - - for (auto& field : fields_of_type) { - result += "("; - result += field.name(); - result.append(1 + (longest_field_name - int(field.name().size())), ' '); - result += field.type().print(); - result.append(1 + (longest_type_name - int(field.type().print().size())), ' '); - - std::string mods; - if (field.is_array() && !field.is_dynamic()) { - mods += std::to_string(field.array_size()); - mods += " "; - } - - if (field.is_inline()) { - mods += inline_string; - mods += " "; - } - - if (field.is_dynamic()) { - mods += dynamic_string; - mods += " "; - } - result.append(mods); - result.append(longest_mods - int(mods.size() - 1), ' '); - - result.append(":offset-assert "); - result.append(std::to_string(field.offset())); - result.append(")\n "); - } - result.append(")\n"); - - result.append(fmt::format(" :method-count-assert {}\n", type_method_count)); - result.append(fmt::format(" :size-assert #x{:x}\n", type_size)); - result.append(fmt::format(" :flag-assert #x{:x}\n ", flags)); - if (!warnings.empty()) { - result.append(";; "); - result.append(warnings); - result.append("\n "); - } - - if (type_method_count > 9) { - result.append("(:methods\n "); - for (int i = 9; i < type_method_count; i++) { - result.append(fmt::format("(dummy-{} () none {})\n ", i, i)); - } - result.append(")\n "); - } - result.append(")\n"); - - return result; -} -} // namespace decompiler \ No newline at end of file diff --git a/decompiler/Function/TypeInspector.h b/decompiler/Function/TypeInspector.h deleted file mode 100644 index cb3bd3c855..0000000000 --- a/decompiler/Function/TypeInspector.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -/*! - * @file TypeInspector.h - * Analyze an auto-generated GOAL inspect method to determine the layout of a type in memory. - */ - -#include -#include "common/common_types.h" - -class Field; - -namespace decompiler { -class Function; -class DecompilerTypeSystem; -class LinkedObjectFile; - -struct TypeInspectorResult { - bool success = false; - int type_size = -1; - int type_method_count = -1; - int type_heap_base = -1; - - std::string warnings; - std::vector fields_of_type; - bool is_basic = false; - - std::string type_name; - std::string parent_type_name; - u64 flags = 0; - - std::string print_as_deftype(); -}; - -TypeInspectorResult inspect_inspect_method(Function& inspect, - const std::string& type_name, - DecompilerTypeSystem& dts, - LinkedObjectFile& file, - bool skip_fields); -} // namespace decompiler \ No newline at end of file diff --git a/decompiler/Function/Warnings.h b/decompiler/Function/Warnings.h index 0180c6368c..adb9c6a3b1 100644 --- a/decompiler/Function/Warnings.h +++ b/decompiler/Function/Warnings.h @@ -1,10 +1,12 @@ #pragma once +#include #include #include -#include -#include "third-party/fmt/core.h" + #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + namespace decompiler { class DecompWarnings { public: diff --git a/decompiler/IR/BasicOpBuilder.cpp b/decompiler/IR/BasicOpBuilder.cpp deleted file mode 100644 index 3fec5e6f1a..0000000000 --- a/decompiler/IR/BasicOpBuilder.cpp +++ /dev/null @@ -1,2549 +0,0 @@ -/*! - * @file BasicOpBuilder.cpp - * Convert a basic block into a sequence of IR operations. - * Build up basic set instructions from GOAL code - * Recognize common GOAL compiler idioms - * Recognize branch delay slot use - * Recognize assembly ops and pass them through as IR_Asm - */ - -#include "BasicOpBuilder.h" -#include "decompiler/Function/Function.h" -#include "decompiler/Function/BasicBlocks.h" -#include "decompiler/Disasm/InstructionMatching.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "decompiler/IR/IR.h" -#include "common/symbols.h" - -namespace decompiler { -namespace { - -/////////////////////////////// -// Helpers -/////////////////////////////// - -/*! - * Create a GOAL "set!" form. - * These will later be compacted into more complicated nested expressions. - */ -std::shared_ptr make_set_atomic(IR_Set_Atomic::Kind kind, - const std::shared_ptr& dst, - const std::shared_ptr& src) { - return std::make_shared(kind, dst, src); -} - -/*! - * Create an IR representing a register at a certain point. Idx is the instruction index. - */ -std::shared_ptr make_reg(Register reg, int idx) { - return std::make_shared(reg, idx); -} - -/*! - * Create an IR representing a symbol. The symbol itself ('thing), not the value. - */ -std::shared_ptr make_sym(const std::string& name) { - return std::make_shared(name); -} - -/*! - * Create an IR representing the value of a symbol. Can be read/written. - */ -std::shared_ptr make_sym_value(const std::string& name) { - return std::make_shared(name); -} - -/*! - * Create an integer constant. - */ -std::shared_ptr make_int(int64_t x) { - return std::make_shared(x); -} - -/*! - * Create an assembly passthrough in the form op dst, src, src. Sets register info. - */ -std::shared_ptr to_asm_reg_reg_reg(const std::string& str, Instruction& instr, int idx) { - auto result = std::make_shared(str); - result->dst = make_reg(instr.get_dst(0).get_reg(), idx); - result->src0 = make_reg(instr.get_src(0).get_reg(), idx); - result->src1 = make_reg(instr.get_src(1).get_reg(), idx); - result->set_reg_info(); - return result; -} - -/*! - * Create an assembly passthrough for op src. Sets register info. - */ -std::shared_ptr to_asm_src_reg(const std::string& str, Instruction& instr, int idx) { - auto result = std::make_shared(str); - result->src0 = make_reg(instr.get_src(0).get_reg(), idx); - result->set_reg_info(); - return result; -} - -/*! - * Create an assembly passthrough for op dst src. Sets register info. - */ -std::shared_ptr to_asm_dst_reg_src_reg(const std::string& str, - Instruction& instr, - int idx) { - auto result = std::make_shared(str); - result->dst = make_reg(instr.get_dst(0).get_reg(), idx); - result->src0 = make_reg(instr.get_src(0).get_reg(), idx); - result->set_reg_info(); - return result; -} - -/*! - * Convert an instruction atom to IR. - */ -std::shared_ptr instr_atom_to_ir(const InstructionAtom& ia, int idx) { - switch (ia.kind) { - case InstructionAtom::REGISTER: - return make_reg(ia.get_reg(), idx); - case InstructionAtom::VU_Q: - return std::make_shared(IR_AsmReg::VU_Q); - case InstructionAtom::VU_ACC: - return std::make_shared(IR_AsmReg::VU_ACC); - case InstructionAtom::IMM: - return make_int(ia.get_imm()); - case InstructionAtom::VF_FIELD: - // not supported by IR1 - return std::make_shared(); - default: - ASSERT(false); - return nullptr; - } -} - -/////////////////////////////// -// Assembly -/////////////////////////////// - -/*! - * Convert an assembly operation to a IR. Sets register info. - */ -std::shared_ptr to_asm_automatic(const std::string& str, Instruction& instr, int idx) { - auto result = std::make_shared(str); - if (instr.n_src >= 4) { - // not supported by IR1 - return std::make_shared(); - } - ASSERT(instr.n_dst < 2); - ASSERT(instr.n_src < 4); - if (instr.n_dst >= 1) { - result->dst = instr_atom_to_ir(instr.get_dst(0), idx); - } - - if (instr.n_src >= 1) { - result->src0 = instr_atom_to_ir(instr.get_src(0), idx); - } - - if (instr.n_src >= 2) { - result->src1 = instr_atom_to_ir(instr.get_src(1), idx); - } - - if (instr.n_src >= 3) { - result->src2 = instr_atom_to_ir(instr.get_src(2), idx); - } - - result->set_reg_info(); - return result; -} - -/*! - * Convert subu instruction to assembly op. GOAL doesn't generate subu's without inline assembly. - */ -std::shared_ptr try_subu(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::SUBU, {}, {}, {})) { - return to_asm_reg_reg_reg("subu", instr, idx); - } - return nullptr; -} - -/*! - * Convert sllv instruction to assembly op. GOAL doesn't generate sllv's without inline assembly. - */ -std::shared_ptr try_sllv(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::SLLV, {}, {}, make_gpr(Reg::R0))) { - return to_asm_reg_reg_reg("sllv", instr, idx); - } - return nullptr; -} - -/////////////////////////////// -// Logical -/////////////////////////////// - -/*! - * OR (logical or of registers) is used three ways: - * 1. set a register to #f - * 2. set a register to the value of another register - * 3. logical OR - */ -std::shared_ptr try_or(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::OR, {}, make_gpr(Reg::S7), make_gpr(Reg::R0))) { - // set value to #f : or dest, s7, r0 - auto dest = instr.get_dst(0).get_reg(); - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(dest, idx), make_sym("#f")); - op->write_regs.push_back(dest); - op->reg_info_set = true; - return op; - } else if (is_gpr_3(instr, InstructionKind::OR, {}, make_gpr(Reg::R0), make_gpr(Reg::R0))) { - auto dest = instr.get_dst(0).get_reg(); - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(dest, idx), - std::make_shared(0)); - op->write_regs.push_back(dest); - op->reg_info_set = true; - return op; - } else if (is_gpr_3(instr, InstructionKind::OR, {}, {}, make_gpr(Reg::R0))) { - // set register from register : or dest, source, r0 - auto dest = instr.get_dst(0).get_reg(); - auto src = instr.get_src(0).get_reg(); - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(dest, idx), make_reg(src, idx)); - op->write_regs.push_back(dest); - op->read_regs.push_back(src); - op->reg_info_set = true; - return op; - } else { - // actually do a logical OR of two registers. - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::OR, make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } - return nullptr; -} - -/*! - * ORI (logical OR of register and 16-bit immediate) is used two ways: - * 1. Set a register to a 16-bit constant - * 2. logical OR with constant - */ -std::shared_ptr try_ori(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::ORI && instr.get_src(0).is_reg(make_gpr(Reg::R0)) && - instr.get_src(1).is_imm()) { - // load a constant. - auto dst = instr.get_dst(0).get_reg(); - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(dst, idx), - make_int(instr.get_src(1).get_imm())); - op->write_regs.push_back(dst); - op->reg_info_set = true; - return op; - } else if (instr.kind == InstructionKind::ORI && instr.get_src(1).is_imm()) { - // do logical OR with a constant. - auto dst = instr.get_dst(0).get_reg(); - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(dst, idx), - std::make_shared(IR_IntMath2::OR, make_reg(instr.get_src(0).get_reg(), idx), - make_int(instr.get_src(1).get_imm()))); - op->write_regs.push_back(dst); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -/*! - * POR - recognize POR as a move between 128-bit registers. - */ -std::shared_ptr try_por(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::POR, {}, {}, make_gpr(Reg::R0))) { - // move a 128-bit integer. - auto dst = instr.get_dst(0).get_reg(); - auto src = instr.get_src(0).get_reg(); - auto op = make_set_atomic(IR_Set_Atomic::REG_I128, make_reg(dst, idx), make_reg(src, idx)); - op->write_regs.push_back(dst); - op->read_regs.push_back(src); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -/////////////////////////////// -// Moves -/////////////////////////////// - -/*! - * MTC1 (move to coprocessor 1) move from GPR to FPR. - */ -std::shared_ptr try_mtc1(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::MTC1) { - auto op = make_set_atomic(IR_Set_Atomic::GPR_TO_FPR, make_reg(instr.get_dst(0).get_reg(), idx), - make_reg(instr.get_src(0).get_reg(), idx)); - op->update_reginfo_regreg(); - return op; - } - return nullptr; -} - -/*! - * MFC1 (move from coprocessor 1) move from FPR to GPR. - */ -std::shared_ptr try_mfc1(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::MFC1) { - auto op = - make_set_atomic(IR_Set_Atomic::FPR_TO_GPR64, make_reg(instr.get_dst(0).get_reg(), idx), - make_reg(instr.get_src(0).get_reg(), idx)); - op->update_reginfo_regreg(); - return op; - } - return nullptr; -} - -/////////////////////////////// -// Loads -/////////////////////////////// - -/*! - * LWC1 : load value into FPR. - * 1. load static float (FP relative) - * 2. load from address - * 3. load at offset from address. - */ -std::shared_ptr try_lwc1(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::LWC1 && instr.get_dst(0).is_reg() && - instr.get_src(0).is_link_or_label() && instr.get_src(1).is_reg(make_gpr(Reg::FP))) { - // fp relative, use an IR_StaticAddress. - auto dst = instr.get_dst(0).get_reg(); - auto op = make_set_atomic( - IR_Set_Atomic::LOAD, make_reg(dst, idx), - std::make_shared( - IR_Load::FLOAT, 4, std::make_shared(instr.get_src(0).get_label()))); - op->write_regs.push_back(dst); - op->reg_info_set = true; - return op; - } else if (instr.kind == InstructionKind::LWC1 && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm() && instr.get_src(0).get_imm() == 0) { - // offset is zero, so eliminate it. - auto dst = instr.get_dst(0).get_reg(); - auto src = instr.get_src(1).get_reg(); - auto op = make_set_atomic(IR_Set_Atomic::LOAD, make_reg(dst, idx), - std::make_shared(IR_Load::FLOAT, 4, make_reg(src, idx))); - op->write_regs.push_back(dst); - op->read_regs.push_back(src); - op->reg_info_set = true; - return op; - } else if (instr.kind == InstructionKind::LWC1 && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm()) { - // nonzero offset, create compound expression to add the offset. - auto dst = instr.get_dst(0).get_reg(); - auto src = instr.get_src(1).get_reg(); - auto op = - make_set_atomic(IR_Set_Atomic::LOAD, make_reg(dst, idx), - std::make_shared( - IR_Load::FLOAT, 4, - std::make_shared( - IR_IntMath2::ADD, make_reg(src, idx), - std::make_shared(instr.get_src(0).get_imm())))); - op->write_regs.push_back(dst); - op->read_regs.push_back(src); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -std::shared_ptr try_lhu(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::LHU && instr.get_dst(0).is_reg() && - instr.get_src(0).is_link_or_label() && instr.get_src(1).is_reg(make_gpr(Reg::FP))) { - // static load - auto op = - make_set_atomic(IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::UNSIGNED, 2, - std::make_shared(instr.get_src(0).get_label()))); - op->update_reginfo_self(1, 0, 0); - return op; - } else if (instr.kind == InstructionKind::LHU && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm() && instr.get_src(0).get_imm() == 0) { - // no offset load - auto op = make_set_atomic( - IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_Load::UNSIGNED, 2, make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 1, 0); - return op; - } else if (instr.kind == InstructionKind::LHU && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm()) { - // load with offset - auto op = - make_set_atomic(IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::UNSIGNED, 2, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(1).get_reg(), idx), - std::make_shared(instr.get_src(0).get_imm())))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_lh(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::LH && instr.get_dst(0).is_reg() && - instr.get_src(0).is_link_or_label() && instr.get_src(1).is_reg(make_gpr(Reg::FP))) { - // static load - auto op = make_set_atomic( - IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::SIGNED, 2, std::make_shared(instr.get_src(0).get_label()))); - op->update_reginfo_self(1, 0, 0); - return op; - } else if (instr.kind == InstructionKind::LH && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm() && instr.get_src(0).get_imm() == 0) { - // no offset load - auto op = make_set_atomic( - IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_Load::SIGNED, 2, make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 1, 0); - return op; - } else if (instr.kind == InstructionKind::LH && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm()) { - // offset load - auto op = - make_set_atomic(IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::SIGNED, 2, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(1).get_reg(), idx), - std::make_shared(instr.get_src(0).get_imm())))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_lb(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::LB && instr.get_dst(0).is_reg() && - instr.get_src(0).is_link_or_label() && instr.get_src(1).is_reg(make_gpr(Reg::FP))) { - // static load - auto op = make_set_atomic( - IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::SIGNED, 1, std::make_shared(instr.get_src(0).get_label()))); - op->update_reginfo_self(1, 0, 0); - return op; - } else if (instr.kind == InstructionKind::LB && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm() && instr.get_src(0).get_imm() == 0) { - // no offset load - auto op = make_set_atomic( - IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_Load::SIGNED, 1, make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 1, 0); - return op; - } else if (instr.kind == InstructionKind::LB && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm()) { - // offset load - auto op = - make_set_atomic(IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::SIGNED, 1, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(1).get_reg(), idx), - std::make_shared(instr.get_src(0).get_imm())))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_lbu(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::LBU && instr.get_dst(0).is_reg() && - instr.get_src(0).is_link_or_label() && instr.get_src(1).is_reg(make_gpr(Reg::FP))) { - // static load - auto op = - make_set_atomic(IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::UNSIGNED, 1, - std::make_shared(instr.get_src(0).get_label()))); - op->update_reginfo_self(1, 0, 0); - return op; - } else if (instr.kind == InstructionKind::LBU && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm() && instr.get_src(0).get_imm() == 0) { - // no offset load - auto op = make_set_atomic( - IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_Load::UNSIGNED, 1, make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 1, 0); - return op; - } else if (instr.kind == InstructionKind::LBU && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm()) { - // offset load - auto op = - make_set_atomic(IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::UNSIGNED, 1, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(1).get_reg(), idx), - std::make_shared(instr.get_src(0).get_imm())))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_ld(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::LD && instr.get_dst(0).is_reg() && - instr.get_src(0).is_link_or_label() && instr.get_src(1).is_reg(make_gpr(Reg::FP))) { - // static load - auto op = - make_set_atomic(IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::UNSIGNED, 8, - std::make_shared(instr.get_src(0).get_label()))); - op->update_reginfo_self(1, 0, 0); - return op; - } else if (instr.kind == InstructionKind::LD && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm() && instr.get_src(0).get_imm() == 0) { - // no offset load - auto op = make_set_atomic( - IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_Load::UNSIGNED, 8, make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 1, 0); - return op; - } else if (instr.kind == InstructionKind::LD && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm()) { - // offset load - auto op = - make_set_atomic(IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::UNSIGNED, 8, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(1).get_reg(), idx), - std::make_shared(instr.get_src(0).get_imm())))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -// TODO SPECIAL -std::shared_ptr try_lw(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::LW && instr.get_dst(0).is_reg(make_gpr(Reg::R0)) && - instr.get_src(0).is_imm() && instr.get_src(0).get_imm() == 2 && - instr.get_src(1).is_reg(make_gpr(Reg::R0))) { - auto op = std::make_shared(); - op->reg_info_set = true; - return op; - } else if (instr.kind == InstructionKind::LW && instr.get_src(1).is_reg(make_gpr(Reg::S7)) && - instr.get_src(0).kind == InstructionAtom::IMM_SYM) { - // symbol load - auto dst = instr.get_dst(0).get_reg(); - auto op = make_set_atomic(IR_Set_Atomic::SYM_LOAD, make_reg(dst, idx), - make_sym_value(instr.get_src(0).get_sym())); - op->write_regs.push_back(dst); - op->reg_info_set = true; - return op; - } else if (instr.kind == InstructionKind::LW && instr.get_dst(0).is_reg() && - instr.get_src(0).is_link_or_label() && instr.get_src(1).is_reg(make_gpr(Reg::FP))) { - // static load - auto op = make_set_atomic( - IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::SIGNED, 4, std::make_shared(instr.get_src(0).get_label()))); - op->update_reginfo_self(1, 0, 0); - return op; - } else if (instr.kind == InstructionKind::LW && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm() && instr.get_src(0).get_imm() == 0) { - // no offset load - auto op = make_set_atomic( - IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_Load::SIGNED, 4, make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 1, 0); - return op; - } else if (instr.kind == InstructionKind::LW && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm()) { - // offset load - auto op = - make_set_atomic(IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::SIGNED, 4, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(1).get_reg(), idx), - std::make_shared(instr.get_src(0).get_imm())))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_lwu(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::LWU && instr.get_dst(0).is_reg() && - instr.get_src(0).is_link_or_label() && instr.get_src(1).is_reg(make_gpr(Reg::FP))) { - // static load - auto op = - make_set_atomic(IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::UNSIGNED, 4, - std::make_shared(instr.get_src(0).get_label()))); - op->update_reginfo_self(1, 0, 0); - return op; - } else if (instr.kind == InstructionKind::LWU && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm() && instr.get_src(0).get_imm() == 0) { - // no offset load - auto op = make_set_atomic( - IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_Load::UNSIGNED, 4, make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 1, 0); - return op; - } else if (instr.kind == InstructionKind::LWU && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm()) { - // offset load - auto op = - make_set_atomic(IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::UNSIGNED, 4, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(1).get_reg(), idx), - std::make_shared(instr.get_src(0).get_imm())))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_lq(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::LQ && instr.get_src(1).is_reg(make_gpr(Reg::S7)) && - instr.get_src(0).kind == InstructionAtom::IMM_SYM) { - ASSERT(false); - } else if (instr.kind == InstructionKind::LQ && instr.get_dst(0).is_reg() && - instr.get_src(0).is_link_or_label() && instr.get_src(1).is_reg(make_gpr(Reg::FP))) { - // static - auto op = - make_set_atomic(IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::UNSIGNED, 16, - std::make_shared(instr.get_src(0).get_label()))); - op->update_reginfo_self(1, 0, 0); - return op; - } else if (instr.kind == InstructionKind::LQ && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm() && instr.get_src(0).get_imm() == 0) { - // no offset - auto op = make_set_atomic(IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_Load::UNSIGNED, 16, - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 1, 0); - return op; - } else if (instr.kind == InstructionKind::LQ && instr.get_dst(0).is_reg() && - instr.get_src(0).is_imm()) { - // offset - auto op = - make_set_atomic(IR_Set_Atomic::LOAD, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared( - IR_Load::UNSIGNED, 16, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(1).get_reg(), idx), - std::make_shared(instr.get_src(0).get_imm())))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_dsll(Instruction& instr, int idx) { - if (is_gpr_2_imm_int(instr, InstructionKind::DSLL, {}, {}, {})) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::LEFT_SHIFT, - make_reg(instr.get_src(0).get_reg(), idx), - make_int(instr.get_src(1).get_imm()))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_dsll32(Instruction& instr, int idx) { - if (is_gpr_2_imm_int(instr, InstructionKind::DSLL32, {}, {}, {})) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::LEFT_SHIFT, - make_reg(instr.get_src(0).get_reg(), idx), - make_int(32 + instr.get_src(1).get_imm()))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_dsra(Instruction& instr, int idx) { - if (is_gpr_2_imm_int(instr, InstructionKind::DSRA, {}, {}, {})) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::RIGHT_SHIFT_ARITH, - make_reg(instr.get_src(0).get_reg(), idx), - make_int(instr.get_src(1).get_imm()))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_dsra32(Instruction& instr, int idx) { - if (is_gpr_2_imm_int(instr, InstructionKind::DSRA32, {}, {}, {})) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::RIGHT_SHIFT_ARITH, - make_reg(instr.get_src(0).get_reg(), idx), - make_int(32 + instr.get_src(1).get_imm()))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_dsrl(Instruction& instr, int idx) { - if (is_gpr_2_imm_int(instr, InstructionKind::DSRL, {}, {}, {})) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::RIGHT_SHIFT_LOGIC, - make_reg(instr.get_src(0).get_reg(), idx), - make_int(instr.get_src(1).get_imm()))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_dsrl32(Instruction& instr, int idx) { - if (is_gpr_2_imm_int(instr, InstructionKind::DSRL32, {}, {}, {})) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::RIGHT_SHIFT_LOGIC, - make_reg(instr.get_src(0).get_reg(), idx), - make_int(32 + instr.get_src(1).get_imm()))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_float_math_2(Instruction& instr, - int idx, - InstructionKind instr_kind, - IR_FloatMath2::Kind ir_kind) { - if (is_gpr_3(instr, instr_kind, {}, {}, {})) { - auto dst = instr.get_dst(0).get_reg(); - auto src0 = instr.get_src(0).get_reg(); - auto src1 = instr.get_src(1).get_reg(); - auto op = make_set_atomic( - IR_Set_Atomic::REG_FLT, make_reg(dst, idx), - std::make_shared(ir_kind, make_reg(src0, idx), make_reg(src1, idx))); - op->write_regs.push_back(dst); - op->read_regs.push_back(src0); - op->read_regs.push_back(src1); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -std::shared_ptr try_daddiu(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::DADDIU && instr.get_src(0).is_reg(make_gpr(Reg::S7)) && - instr.get_src(1).kind == InstructionAtom::IMM_SYM) { - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - make_sym(instr.get_src(1).get_sym())); - op->write_regs.push_back(instr.get_dst(0).get_reg()); - op->reg_info_set = true; - return op; - } else if (instr.kind == InstructionKind::DADDIU && instr.get_src(0).is_reg(make_gpr(Reg::S7)) && - instr.get_src(1).is_imm() && instr.get_src(1).get_imm() == -10) { - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared()); - op->write_regs.push_back(instr.get_dst(0).get_reg()); - op->reg_info_set = true; - return op; - } else if (instr.kind == InstructionKind::DADDIU && instr.get_src(0).is_reg(make_gpr(Reg::S7)) && - instr.get_src(1).is_imm() && instr.get_src(1).get_imm() == -32768) { - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared("__START-OF-TABLE__")); - op->write_regs.push_back(instr.get_dst(0).get_reg()); - op->reg_info_set = true; - return op; - } else if (instr.kind == InstructionKind::DADDIU && instr.get_src(0).is_reg(make_gpr(Reg::S7)) && - instr.get_src(1).is_imm() && instr.get_src(1).get_imm() == FIX_SYM_TRUE) { - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared("#t")); - op->write_regs.push_back(instr.get_dst(0).get_reg()); - op->reg_info_set = true; - return op; - } else if (instr.kind == InstructionKind::DADDIU && instr.get_src(0).is_reg(make_gpr(Reg::FP)) && - instr.get_src(1).kind == InstructionAtom::LABEL) { - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(instr.get_src(1).get_label())); - op->write_regs.push_back(instr.get_dst(0).get_reg()); - op->reg_info_set = true; - return op; - } else if (instr.kind == InstructionKind::DADDIU) { - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::ADD, make_reg(instr.get_src(0).get_reg(), idx), - make_int(instr.get_src(1).get_imm()))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_daddu(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::DADDU, {}, make_gpr(Reg::R0), {})) { - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::ADD, make_reg(instr.get_src(1).get_reg(), idx), - std::make_shared(0))); - op->update_reginfo_self(1, 1, 0); - return op; - } else if (is_gpr_3(instr, InstructionKind::DADDU, {}, {}, {}) && - !instr.get_src(0).is_reg(make_gpr(Reg::S7)) && - !instr.get_src(1).is_reg(make_gpr(Reg::S7))) { - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::ADD, make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } - return to_asm_reg_reg_reg("daddu", instr, idx); -} - -std::shared_ptr try_dsubu(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::DSUBU, {}, make_gpr(Reg::R0), {}) && - !instr.get_src(0).is_reg(make_gpr(Reg::S7)) && !instr.get_src(1).is_reg(make_gpr(Reg::S7))) { - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath1::NEG, make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 1, 0); - return op; - } else if (is_gpr_3(instr, InstructionKind::DSUBU, {}, {}, {}) && - !instr.get_src(0).is_reg(make_gpr(Reg::S7)) && - !instr.get_src(1).is_reg(make_gpr(Reg::S7))) { - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::SUB, make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_mult3(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::MULT3, {}, {}, {}) && - !instr.get_src(0).is_reg(make_gpr(Reg::S7)) && !instr.get_src(1).is_reg(make_gpr(Reg::S7))) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::MUL_SIGNED, - make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_multu3(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::MULTU3, {}, {}, {}) && - !instr.get_src(0).is_reg(make_gpr(Reg::S7)) && !instr.get_src(1).is_reg(make_gpr(Reg::S7))) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::MUL_UNSIGNED, - make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_and(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::AND, {}, {}, {}) && - !instr.get_src(0).is_reg(make_gpr(Reg::S7)) && !instr.get_src(1).is_reg(make_gpr(Reg::S7))) { - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::AND, make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_andi(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::ANDI) { - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::AND, make_reg(instr.get_src(0).get_reg(), idx), - make_int(instr.get_src(1).get_imm()))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_xori(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::XORI) { - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::XOR, make_reg(instr.get_src(0).get_reg(), idx), - make_int(instr.get_src(1).get_imm()))); - op->update_reginfo_self(1, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_nor(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::NOR, {}, {}, {}) && - !instr.get_src(0).is_reg(make_gpr(Reg::S7)) && instr.get_src(1).is_reg(make_gpr(Reg::R0))) { - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath1::NOT, make_reg(instr.get_src(0).get_reg(), idx))); - op->update_reginfo_self(1, 1, 0); - return op; - } else if (is_gpr_3(instr, InstructionKind::NOR, {}, {}, {}) && - !instr.get_src(0).is_reg(make_gpr(Reg::S7)) && - !instr.get_src(1).is_reg(make_gpr(Reg::S7))) { - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::NOR, make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_xor(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::XOR, {}, {}, {}) && - !instr.get_src(0).is_reg(make_gpr(Reg::S7)) && !instr.get_src(1).is_reg(make_gpr(Reg::S7))) { - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::XOR, make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_addiu(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::ADDIU && instr.get_src(0).is_reg(make_gpr(Reg::R0))) { - auto dest = instr.get_dst(0).get_reg(); - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(dest, idx), - make_int(instr.get_src(1).get_imm())); - op->write_regs.push_back(dest); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -std::shared_ptr try_lui(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::LUI && instr.get_src(0).is_imm()) { - auto dest = instr.get_dst(0).get_reg(); - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(dest, idx), - make_int(instr.get_src(0).get_imm() << 16)); - op->write_regs.push_back(dest); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -std::shared_ptr try_sll(Instruction& instr, int idx) { - (void)idx; - if (is_nop(instr)) { - auto op = std::make_shared(); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -std::shared_ptr try_dsrav(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::DSRAV, {}, {}, {}) && - !instr.get_src(0).is_reg(make_gpr(Reg::S7)) && !instr.get_src(1).is_reg(make_gpr(Reg::S7))) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::RIGHT_SHIFT_ARITH, - make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_dsrlv(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::DSRLV, {}, {}, {}) && - !instr.get_src(0).is_reg(make_gpr(Reg::S7)) && !instr.get_src(1).is_reg(make_gpr(Reg::S7))) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::RIGHT_SHIFT_LOGIC, - make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_dsllv(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::DSLLV, {}, {}, {}) && - !instr.get_src(0).is_reg(make_gpr(Reg::S7)) && !instr.get_src(1).is_reg(make_gpr(Reg::S7))) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::LEFT_SHIFT, - make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_sw(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::SW && instr.get_src(1).is_sym() && - instr.get_src(2).is_reg(make_gpr(Reg::S7))) { - auto src = instr.get_src(0).get_reg(); - auto op = std::make_shared( - IR_Set_Atomic::SYM_STORE, make_sym_value(instr.get_src(1).get_sym()), make_reg(src, idx)); - op->read_regs.push_back(src); - op->reg_info_set = true; - return op; - } else if (instr.kind == InstructionKind::SW && instr.get_src(1).is_imm()) { - if (instr.get_src(1).get_imm() == 0) { - auto op = std::make_shared(IR_Store_Atomic::Kind::INTEGER, - make_reg(instr.get_src(2).get_reg(), idx), - make_reg(instr.get_src(0).get_reg(), idx), 4); - op->update_reginfo_self(0, 2, 0); - return op; - } else { - if (instr.get_src(0).is_reg(make_gpr(Reg::S7))) { - // store false - auto op = std::make_shared( - IR_Store_Atomic::Kind::INTEGER, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(2).get_reg(), idx), - std::make_shared(instr.get_src(1).get_imm())), - make_sym("#f"), 4); - op->update_reginfo_self(0, 1, 0); - return op; - } else { - auto op = std::make_shared( - IR_Store_Atomic::Kind::INTEGER, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(2).get_reg(), idx), - std::make_shared(instr.get_src(1).get_imm())), - make_reg(instr.get_src(0).get_reg(), idx), 4); - op->update_reginfo_self(0, 2, 0); - return op; - } - } - } - return nullptr; -} - -std::shared_ptr try_sb(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::SB && instr.get_src(1).is_imm()) { - if (instr.get_src(1).get_imm() == 0) { - if (instr.get_src(0).is_reg(make_gpr(Reg::R0))) { - auto op = std::make_shared(IR_Store_Atomic::Kind::INTEGER, - make_reg(instr.get_src(2).get_reg(), idx), - std::make_shared(0), 1); - op->update_reginfo_self(0, 1, 0); - return op; - } else { - auto op = std::make_shared(IR_Store_Atomic::Kind::INTEGER, - make_reg(instr.get_src(2).get_reg(), idx), - make_reg(instr.get_src(0).get_reg(), idx), 1); - op->update_reginfo_self(0, 2, 0); - return op; - } - - } else { - if (instr.get_src(0).is_reg(make_gpr(Reg::R0))) { - auto op = std::make_shared( - IR_Store_Atomic::Kind::INTEGER, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(2).get_reg(), idx), - std::make_shared(instr.get_src(1).get_imm())), - std::make_shared(0), 1); - op->update_reginfo_self(0, 1, 0); - return op; - } else { - auto op = std::make_shared( - IR_Store_Atomic::Kind::INTEGER, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(2).get_reg(), idx), - std::make_shared(instr.get_src(1).get_imm())), - make_reg(instr.get_src(0).get_reg(), idx), 1); - op->update_reginfo_self(0, 2, 0); - return op; - } - } - } - return nullptr; -} - -std::shared_ptr try_sh(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::SH && instr.get_src(1).is_imm()) { - auto op = std::make_shared( - IR_Store_Atomic::Kind::INTEGER, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(2).get_reg(), idx), - std::make_shared(instr.get_src(1).get_imm())), - make_reg(instr.get_src(0).get_reg(), idx), 2); - op->update_reginfo_self(0, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_sd(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::SD && instr.get_src(1).is_imm()) { - auto op = std::make_shared( - IR_Store_Atomic::Kind::INTEGER, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(2).get_reg(), idx), - std::make_shared(instr.get_src(1).get_imm())), - make_reg(instr.get_src(0).get_reg(), idx), 8); - op->update_reginfo_self(0, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_sq(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::SQ && instr.get_src(1).is_imm()) { - auto op = std::make_shared( - IR_Store_Atomic::Kind::INTEGER, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(2).get_reg(), idx), - std::make_shared(instr.get_src(1).get_imm())), - make_reg(instr.get_src(0).get_reg(), idx), 16); - op->update_reginfo_self(0, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_swc1(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::SWC1 && instr.get_src(1).is_imm()) { - auto op = std::make_shared( - IR_Store_Atomic::Kind::FLOAT, - std::make_shared( - IR_IntMath2::ADD, make_reg(instr.get_src(2).get_reg(), idx), - std::make_shared(instr.get_src(1).get_imm())), - make_reg(instr.get_src(0).get_reg(), idx), 4); - op->update_reginfo_self(0, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_cvtws(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::CVTWS) { - auto dst = instr.get_dst(0).get_reg(); - auto src = instr.get_src(0).get_reg(); - auto op = make_set_atomic( - IR_Set_Atomic::REG_FLT, make_reg(dst, idx), - std::make_shared(IR_FloatMath1::FLOAT_TO_INT, make_reg(src, idx))); - op->write_regs.push_back(dst); - op->read_regs.push_back(src); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -std::shared_ptr try_cvtsw(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::CVTSW) { - auto dst = instr.get_dst(0).get_reg(); - auto src = instr.get_src(0).get_reg(); - auto op = make_set_atomic( - IR_Set_Atomic::REG_FLT, make_reg(dst, idx), - std::make_shared(IR_FloatMath1::INT_TO_FLOAT, make_reg(src, idx))); - op->write_regs.push_back(dst); - op->read_regs.push_back(src); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -std::shared_ptr try_float_math_1(Instruction& instr, - int idx, - InstructionKind ikind, - IR_FloatMath1::Kind irkind) { - if (instr.kind == ikind) { - auto dst = instr.get_dst(0).get_reg(); - auto src = instr.get_src(0).get_reg(); - auto op = make_set_atomic(IR_Set_Atomic::REG_FLT, make_reg(dst, idx), - std::make_shared(irkind, make_reg(src, idx))); - op->write_regs.push_back(dst); - op->read_regs.push_back(src); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -std::shared_ptr try_movs(Instruction& instr, int idx) { - if (instr.kind == InstructionKind::MOVS) { - auto dst = instr.get_dst(0).get_reg(); - auto src = instr.get_src(0).get_reg(); - auto op = make_set_atomic(IR_Set_Atomic::REG_FLT, make_reg(dst, idx), make_reg(src, idx)); - op->write_regs.push_back(dst); - op->read_regs.push_back(src); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -std::shared_ptr try_movn(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::MOVN, {}, make_gpr(Reg::S7), {})) { - auto dst = instr.get_dst(0).get_reg(); - auto src = instr.get_src(1).get_reg(); - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(dst, idx), - std::make_shared(make_reg(src, idx), false)); - op->write_regs.push_back(dst); - op->read_regs.push_back(src); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -std::shared_ptr try_movz(Instruction& instr, int idx) { - if (is_gpr_3(instr, InstructionKind::MOVZ, {}, make_gpr(Reg::S7), {})) { - auto dst = instr.get_dst(0).get_reg(); - auto src = instr.get_src(1).get_reg(); - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(dst, idx), - std::make_shared(make_reg(src, idx), true)); - op->write_regs.push_back(dst); - op->read_regs.push_back(src); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -// TWO Instructions -std::shared_ptr try_div(Instruction& instr, Instruction& next_instr, int idx) { - if (instr.kind == InstructionKind::DIV && instr.get_src(0).is_reg() && - instr.get_src(1).is_reg() && next_instr.kind == InstructionKind::MFLO && - next_instr.get_dst(0).is_reg()) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(next_instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::DIV_SIGNED, - make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } else if (instr.kind == InstructionKind::DIV && instr.get_src(0).is_reg() && - instr.get_src(1).is_reg() && next_instr.kind == InstructionKind::MFHI && - next_instr.get_dst(0).is_reg()) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(next_instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::MOD_SIGNED, - make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_divu(Instruction& instr, Instruction& next_instr, int idx) { - if (instr.kind == InstructionKind::DIVU && instr.get_src(0).is_reg() && - instr.get_src(1).is_reg() && next_instr.kind == InstructionKind::MFLO && - next_instr.get_dst(0).is_reg()) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(next_instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::DIV_UNSIGNED, - make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } else if (instr.kind == InstructionKind::DIVU && instr.get_src(0).is_reg() && - instr.get_src(1).is_reg() && next_instr.kind == InstructionKind::MFHI && - next_instr.get_dst(0).is_reg()) { - auto op = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(next_instr.get_dst(0).get_reg(), idx), - std::make_shared(IR_IntMath2::MOD_UNSIGNED, - make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx))); - op->update_reginfo_self(1, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_jalr(Instruction& instr, Instruction& next_instr, int idx) { - (void)idx; - if (instr.kind == InstructionKind::JALR && instr.get_dst(0).is_reg(make_gpr(Reg::RA)) && - instr.get_src(0).is_reg(make_gpr(Reg::T9)) && - is_gpr_2_imm_int(next_instr, InstructionKind::SLL, make_gpr(Reg::V0), make_gpr(Reg::RA), 0)) { - auto op = std::make_shared(); - - // for now, we assume no arguments, but a return. - // todo - clobber fprs - auto temps = {Reg::V1, Reg::A0, Reg::A1, Reg::A2, Reg::A3, Reg::T0, Reg::T1, Reg::T2, - Reg::T3, Reg::T4, Reg::T5, Reg::T6, Reg::T7, Reg::T8, Reg::T9}; - for (auto& r : temps) { - op->clobber_regs.emplace_back(Reg::GPR, r); - } - - op->read_regs.emplace_back(Reg::GPR, Reg::T9); - op->write_regs.emplace_back(Reg::GPR, Reg::V0); // may "write" a none. - op->reg_info_set = true; - return op; - } - return nullptr; -} - -BranchDelay get_branch_delay(Instruction& i, int idx) { - if (is_nop(i)) { - // no read, write, clobber - return BranchDelay(BranchDelay::NOP); - } else if (is_gpr_3(i, InstructionKind::OR, {}, make_gpr(Reg::S7), make_gpr(Reg::R0))) { - BranchDelay b(BranchDelay::SET_REG_FALSE); - auto dst = i.get_dst(0).get_reg(); - b.destination = make_reg(dst, idx); - b.write_regs.push_back(dst); - return b; - } else if (is_gpr_3(i, InstructionKind::OR, {}, {}, make_gpr(Reg::R0))) { - BranchDelay b(BranchDelay::SET_REG_REG); - auto dst = i.get_dst(0).get_reg(); - auto src = i.get_src(0).get_reg(); - b.destination = make_reg(dst, idx); - b.source = make_reg(src, idx); - b.write_regs.push_back(dst); - b.read_regs.push_back(src); - return b; - } else if (i.kind == InstructionKind::DADDIU && i.get_src(0).is_reg(make_gpr(Reg::S7)) && - i.get_src(1).is_imm() && i.get_src(1).get_imm() == 8) { - BranchDelay b(BranchDelay::SET_REG_TRUE); - auto dst = i.get_dst(0).get_reg(); - b.destination = make_reg(dst, idx); - b.write_regs.push_back(dst); - return b; - } else if (i.kind == InstructionKind::LW && i.get_src(1).is_reg(make_gpr(Reg::S7)) && - i.get_src(0).is_sym()) { - if (i.get_src(0).get_sym() == "binteger") { - BranchDelay b(BranchDelay::SET_BINTEGER); - auto dst = i.get_dst(0).get_reg(); - b.destination = make_reg(dst, idx); - b.write_regs.push_back(dst); - return b; - } else if (i.get_src(0).get_sym() == "pair") { - BranchDelay b(BranchDelay::SET_PAIR); - auto dst = i.get_dst(0).get_reg(); - b.destination = make_reg(dst, idx); - b.write_regs.push_back(dst); - return b; - } else { - ASSERT(false); - } - } else if (i.kind == InstructionKind::DSLLV) { - // this is used for ash? - BranchDelay b(BranchDelay::DSLLV); - auto dst = i.get_dst(0).get_reg(); - auto src0 = i.get_src(0).get_reg(); - auto src2 = i.get_src(1).get_reg(); - b.destination = make_reg(dst, idx); - b.source = make_reg(src0, idx); - b.source2 = make_reg(src2, idx); - b.write_regs.push_back(dst); - b.read_regs.push_back(src0); - b.read_regs.push_back(src2); - return b; - } else if (is_gpr_3(i, InstructionKind::DSUBU, {}, make_gpr(Reg::R0), {})) { - // this is used for abs? - BranchDelay b(BranchDelay::NEGATE); - auto dst = i.get_dst(0).get_reg(); - auto src = i.get_src(1).get_reg(); - b.destination = make_reg(dst, idx); - b.source = make_reg(src, idx); - b.write_regs.push_back(dst); - b.read_regs.push_back(src); - return b; - } - BranchDelay b(BranchDelay::UNKNOWN); - return b; -} - -std::shared_ptr try_bne(Instruction& instr, Instruction& next_instr, int idx) { - if (instr.kind == InstructionKind::BNE && instr.get_src(1).is_reg(make_gpr(Reg::R0))) { - auto op = std::make_shared( - Condition(Condition::NONZERO, make_reg(instr.get_src(0).get_reg(), idx), nullptr, nullptr), - instr.get_src(2).get_label(), get_branch_delay(next_instr, idx), false); - op->update_reginfo_self(0, 1, 0); - return op; - } else if (instr.kind == InstructionKind::BNE && instr.get_src(0).is_reg(make_gpr(Reg::S7))) { - auto op = std::make_shared( - Condition(Condition::TRUTHY, make_reg(instr.get_src(1).get_reg(), idx), nullptr, nullptr), - instr.get_src(2).get_label(), get_branch_delay(next_instr, idx), false); - op->update_reginfo_self(0, 1, 0); - return op; - } else if (instr.kind == InstructionKind::BNE) { - auto op = std::make_shared( - Condition(Condition::NOT_EQUAL, make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx), nullptr), - instr.get_src(2).get_label(), get_branch_delay(next_instr, idx), false); - op->update_reginfo_self(0, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_bnel(Instruction& instr, Instruction& next_instr, int idx) { - if (instr.kind == InstructionKind::BNEL && instr.get_src(0).is_reg(make_gpr(Reg::S7))) { - auto op = std::make_shared( - Condition(Condition::TRUTHY, make_reg(instr.get_src(1).get_reg(), idx), nullptr, nullptr), - instr.get_src(2).get_label(), get_branch_delay(next_instr, idx), true); - op->update_reginfo_self(0, 1, 0); - return op; - } else if (instr.kind == InstructionKind::BNEL && instr.get_src(1).is_reg(make_gpr(Reg::R0))) { - auto op = std::make_shared( - Condition(Condition::NONZERO, make_reg(instr.get_src(0).get_reg(), idx), nullptr, nullptr), - instr.get_src(2).get_label(), get_branch_delay(next_instr, idx), true); - op->update_reginfo_self(0, 1, 0); - return op; - } else if (instr.kind == InstructionKind::BNEL) { - // return std::make_shared(IR_Branch2::NOT_EQUAL, instr.get_src(2).get_label(), - // make_reg(instr.get_src(0).get_reg(), idx), - // make_reg(instr.get_src(1).get_reg(), idx), - // get_branch_delay(next_instr, idx), true); - } - return nullptr; -} - -std::shared_ptr try_beql(Instruction& instr, Instruction& next_instr, int idx) { - if (instr.kind == InstructionKind::BEQL && instr.get_src(0).is_reg(make_gpr(Reg::S7))) { - auto op = std::make_shared( - Condition(Condition::FALSE, make_reg(instr.get_src(1).get_reg(), idx), nullptr, nullptr), - instr.get_src(2).get_label(), get_branch_delay(next_instr, idx), true); - op->update_reginfo_self(0, 1, 0); - return op; - } else if (instr.kind == InstructionKind::BEQL && instr.get_src(1).is_reg(make_gpr(Reg::R0))) { - auto op = std::make_shared( - Condition(Condition::ZERO, make_reg(instr.get_src(0).get_reg(), idx), nullptr, nullptr), - instr.get_src(2).get_label(), get_branch_delay(next_instr, idx), true); - op->update_reginfo_self(0, 1, 0); - return op; - } else if (instr.kind == InstructionKind::BEQL) { - auto op = std::make_shared( - Condition(Condition::EQUAL, make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx), nullptr), - instr.get_src(2).get_label(), get_branch_delay(next_instr, idx), true); - op->update_reginfo_self(0, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_beq(Instruction& instr, Instruction& next_instr, int idx) { - if (instr.kind == InstructionKind::BEQ && instr.get_src(0).is_reg(make_gpr(Reg::R0)) && - instr.get_src(1).is_reg(make_gpr(Reg::R0))) { - auto op = std::make_shared( - Condition(Condition::ALWAYS, nullptr, nullptr, nullptr), instr.get_src(2).get_label(), - get_branch_delay(next_instr, idx), false); - op->update_reginfo_self(0, 0, 0); - return op; - } else if (instr.kind == InstructionKind::BEQ && instr.get_src(0).is_reg(make_gpr(Reg::S7))) { - auto op = std::make_shared( - Condition(Condition::FALSE, make_reg(instr.get_src(1).get_reg(), idx), nullptr, nullptr), - instr.get_src(2).get_label(), get_branch_delay(next_instr, idx), false); - op->update_reginfo_self(0, 1, 0); - return op; - } else if (instr.kind == InstructionKind::BEQ && instr.get_src(1).is_reg(make_gpr(Reg::R0))) { - auto op = std::make_shared( - Condition(Condition::ZERO, make_reg(instr.get_src(0).get_reg(), idx), nullptr, nullptr), - instr.get_src(2).get_label(), get_branch_delay(next_instr, idx), false); - op->update_reginfo_self(0, 1, 0); - return op; - } else if (instr.kind == InstructionKind::BEQ) { - auto op = std::make_shared( - Condition(Condition::EQUAL, make_reg(instr.get_src(0).get_reg(), idx), - make_reg(instr.get_src(1).get_reg(), idx), nullptr), - instr.get_src(2).get_label(), get_branch_delay(next_instr, idx), false); - op->update_reginfo_self(0, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_bgtzl(Instruction& instr, Instruction& next_instr, int idx) { - if (instr.kind == InstructionKind::BGTZL) { - auto op = std::make_shared( - Condition(Condition::GREATER_THAN_ZERO_SIGNED, make_reg(instr.get_src(0).get_reg(), idx), - nullptr, nullptr), - instr.get_src(1).get_label(), get_branch_delay(next_instr, idx), true); - op->update_reginfo_self(0, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_bgezl(Instruction& instr, Instruction& next_instr, int idx) { - if (instr.kind == InstructionKind::BGEZL) { - auto op = std::make_shared( - Condition(Condition::GEQ_ZERO_SIGNED, make_reg(instr.get_src(0).get_reg(), idx), nullptr, - nullptr), - instr.get_src(1).get_label(), get_branch_delay(next_instr, idx), true); - op->update_reginfo_self(0, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_bltzl(Instruction& instr, Instruction& next_instr, int idx) { - if (instr.kind == InstructionKind::BLTZL) { - auto op = std::make_shared( - Condition(Condition::LESS_THAN_ZERO, make_reg(instr.get_src(0).get_reg(), idx), nullptr, - nullptr), - instr.get_src(1).get_label(), get_branch_delay(next_instr, idx), true); - op->update_reginfo_self(0, 1, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_daddiu(Instruction& i0, Instruction& i1, int idx) { - if (i0.kind == InstructionKind::DADDIU && i1.kind == InstructionKind::MOVN && - i0.get_src(0).get_reg() == make_gpr(Reg::S7)) { - auto dst_reg = i0.get_dst(0).get_reg(); - auto src_reg = i1.get_src(1).get_reg(); - ASSERT(i0.get_src(0).get_reg() == make_gpr(Reg::S7)); - ASSERT(i0.get_src(1).get_imm() == 8); - ASSERT(i1.get_dst(0).get_reg() == dst_reg); - ASSERT(i1.get_src(0).get_reg() == make_gpr(Reg::S7)); - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(dst_reg, idx), - std::make_shared( - Condition(Condition::ZERO, make_reg(src_reg, idx), nullptr, nullptr), nullptr)); - op->write_regs.push_back(dst_reg); - op->read_regs.push_back(src_reg); - op->reg_info_set = true; - return op; - } else if (i0.kind == InstructionKind::DADDIU && i1.kind == InstructionKind::MOVZ && - i0.get_src(0).get_reg() == make_gpr(Reg::S7)) { - auto dst_reg = i0.get_dst(0).get_reg(); - auto src_reg = i1.get_src(1).get_reg(); - ASSERT(i0.get_src(0).get_reg() == make_gpr(Reg::S7)); - ASSERT(i0.get_src(1).get_imm() == 8); - ASSERT(i1.get_dst(0).get_reg() == dst_reg); - ASSERT(i1.get_src(0).get_reg() == make_gpr(Reg::S7)); - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(dst_reg, idx), - std::make_shared( - Condition(Condition::NONZERO, make_reg(src_reg, idx), nullptr, nullptr), nullptr)); - op->write_regs.push_back(dst_reg); - op->read_regs.push_back(src_reg); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -std::shared_ptr try_lui(Instruction& i0, Instruction& i1, int idx) { - if (i0.kind == InstructionKind::LUI && i1.kind == InstructionKind::ORI && - i0.get_src(0).is_label() && i1.get_src(1).is_label()) { - ASSERT(i0.get_dst(0).get_reg() == i1.get_src(0).get_reg()); - ASSERT(i0.get_src(0).get_label() == i1.get_src(1).get_label()); - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(i1.get_dst(0).get_reg(), idx), - std::make_shared(i0.get_src(0).get_label())); - if (i0.get_dst(0).get_reg() != i1.get_dst(0).get_reg()) { - op->clobber = make_reg(i0.get_dst(0).get_reg(), idx); - op->clobber_regs.push_back(i0.get_dst(0).get_reg()); - } - op->write_regs.push_back(i1.get_dst(0).get_reg()); - op->reg_info_set = true; - return op; - } else if (i0.kind == InstructionKind::LUI && i1.kind == InstructionKind::ORI && - i0.get_src(0).is_imm() && i1.get_src(1).is_imm() && - i0.get_dst(0).get_reg() == i1.get_src(0).get_reg()) { - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(i1.get_dst(0).get_reg(), idx), - make_int((int64_t(i1.get_src(1).get_imm()) + int64_t(i0.get_src(0).get_imm() << 16)))); - if (i0.get_dst(0).get_reg() != i1.get_dst(0).get_reg()) { - op->clobber = make_reg(i0.get_dst(0).get_reg(), idx); - op->clobber_regs.push_back(i0.get_dst(0).get_reg()); - } - op->write_regs.push_back(i1.get_dst(0).get_reg()); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -// note - this one is a little bit strange in how it's colored. -std::shared_ptr try_slt(Instruction& i0, Instruction& i1, int idx) { - if (is_gpr_3(i0, InstructionKind::SLT, {}, {}, {})) { - auto temp = i0.get_dst(0).get_reg(); - auto left = i0.get_src(0).get_reg(); - auto right = i0.get_src(1).get_reg(); - if (is_gpr_3(i1, InstructionKind::MOVZ, left, right, temp)) { - // success! - auto result = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(left, idx), - std::make_shared(IR_IntMath2::MIN_SIGNED, - make_reg(left, idx), make_reg(right, idx))); - result->clobber = make_reg(temp, idx); - result->clobber_regs.push_back(temp); - result->write_regs.push_back(left); - result->read_regs.push_back(right); - result->read_regs.push_back(left); - result->reg_info_set = true; - return result; - } - - if (is_gpr_3(i1, InstructionKind::MOVN, left, right, temp)) { - // success! - auto result = - make_set_atomic(IR_Set_Atomic::REG_64, make_reg(left, idx), - std::make_shared(IR_IntMath2::MAX_SIGNED, - make_reg(left, idx), make_reg(right, idx))); - result->clobber = make_reg(temp, idx); - result->clobber_regs.push_back(temp); - result->write_regs.push_back(left); - result->read_regs.push_back(right); - result->read_regs.push_back(left); - result->reg_info_set = true; - return result; - } - } - return nullptr; -} - -// THREE OP -std::shared_ptr try_lui(Instruction& i0, Instruction& i1, Instruction& i2, int idx) { - if (i0.kind == InstructionKind::LUI && i1.kind == InstructionKind::ORI && - i0.get_src(0).is_label() && i1.get_src(1).is_label() && - is_gpr_3(i2, InstructionKind::ADDU, {}, make_gpr(Reg::FP), {})) { - ASSERT(i0.get_dst(0).get_reg() == i1.get_src(0).get_reg()); - ASSERT(i0.get_src(0).get_label() == i1.get_src(1).get_label()); - ASSERT(i2.get_dst(0).get_reg() == i2.get_src(1).get_reg()); - ASSERT(i2.get_dst(0).get_reg() == i1.get_dst(0).get_reg()); - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(i1.get_dst(0).get_reg(), idx), - std::make_shared(i0.get_src(0).get_label())); - if (i0.get_dst(0).get_reg() != i1.get_dst(0).get_reg()) { - op->clobber = make_reg(i0.get_dst(0).get_reg(), idx); - op->clobber_regs.push_back(i0.get_dst(0).get_reg()); - } - op->write_regs.push_back(i1.get_dst(0).get_reg()); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -std::shared_ptr try_dsubu(Instruction& i0, Instruction& i1, Instruction& i2, int idx) { - if (i0.kind == InstructionKind::DSUBU && i1.kind == InstructionKind::DADDIU && - i2.kind == InstructionKind::MOVN) { - // check for equality - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - auto src1_reg = i0.get_src(1).get_reg(); - auto dst_reg = i1.get_dst(0).get_reg(); - ASSERT(i1.get_src(0).get_reg() == make_gpr(Reg::S7)); - ASSERT(i1.get_src(1).get_imm() == 8); - ASSERT(i2.get_dst(0).get_reg() == dst_reg); - ASSERT(i2.get_src(0).get_reg() == make_gpr(Reg::S7)); - ASSERT(i2.get_src(1).get_reg() == clobber_reg); - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(dst_reg, idx), - std::make_shared(Condition(Condition::EQUAL, make_reg(src0_reg, idx), - make_reg(src1_reg, idx), make_reg(clobber_reg, idx)), - nullptr)); - op->update_reginfo_self(1, 2, 1); - return op; - } else if (i0.kind == InstructionKind::DSUBU && i1.kind == InstructionKind::DADDIU && - i2.kind == InstructionKind::MOVZ) { - // check for equality - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - auto src1_reg = i0.get_src(1).get_reg(); - auto dst_reg = i1.get_dst(0).get_reg(); - ASSERT(i1.get_src(0).get_reg() == make_gpr(Reg::S7)); - ASSERT(i1.get_src(1).get_imm() == 8); - ASSERT(i2.get_dst(0).get_reg() == dst_reg); - ASSERT(i2.get_src(0).get_reg() == make_gpr(Reg::S7)); - if (i2.get_src(1).get_reg() != clobber_reg) { - return nullptr; // TODO! - } - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(dst_reg, idx), - std::make_shared(Condition(Condition::NOT_EQUAL, make_reg(src0_reg, idx), - make_reg(src1_reg, idx), make_reg(clobber_reg, idx)), - nullptr)); - op->update_reginfo_self(1, 2, 1); - return op; - } - return nullptr; -} - -std::shared_ptr try_slt(Instruction& i0, Instruction& i1, Instruction& i2, int idx) { - if (i0.kind == InstructionKind::SLT && i1.kind == InstructionKind::BNE) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - auto src1_reg = i0.get_src(1).get_reg(); - ASSERT(i1.get_src(0).get_reg() == clobber_reg); - ASSERT(i1.get_src(1).get_reg() == make_gpr(Reg::R0)); - auto op = std::make_shared( - Condition(Condition::LESS_THAN_SIGNED, make_reg(src0_reg, idx), make_reg(src1_reg, idx), - make_reg(clobber_reg, idx)), - i1.get_src(2).get_label(), get_branch_delay(i2, idx), false); - op->update_reginfo_self(0, 2, 1); - return op; - } else if (i0.kind == InstructionKind::SLT && i1.kind == InstructionKind::DADDIU && - i2.kind == InstructionKind::MOVZ) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - auto src1_reg = i0.get_src(1).get_reg(); - auto dst_reg = i1.get_dst(0).get_reg(); - ASSERT(i1.get_src(0).is_reg(make_gpr(Reg::S7))); - ASSERT(i1.get_src(1).get_imm() == 8); - ASSERT(i2.get_dst(0).get_reg() == dst_reg); - ASSERT(i2.get_src(0).get_reg() == make_gpr(Reg::S7)); - if (i2.get_src(1).get_reg() != clobber_reg) { - return nullptr; // TODO! - } - if (src1_reg == make_gpr(Reg::R0)) { - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(dst_reg, idx), - std::make_shared(Condition(Condition::LESS_THAN_ZERO, make_reg(src0_reg, idx), - nullptr, make_reg(clobber_reg, idx)), - nullptr)); - op->update_reginfo_self(1, 1, 1); - return op; - } else { - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(dst_reg, idx), - std::make_shared( - Condition(Condition::LESS_THAN_SIGNED, make_reg(src0_reg, idx), - make_reg(src1_reg, idx), make_reg(clobber_reg, idx)), - nullptr)); - op->update_reginfo_self(1, 2, 1); - return op; - } - - } else if (i0.kind == InstructionKind::SLT && i1.kind == InstructionKind::BEQ) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - auto src1_reg = i0.get_src(1).get_reg(); - ASSERT(i1.get_src(0).get_reg() == clobber_reg); - ASSERT(i1.get_src(1).get_reg() == make_gpr(Reg::R0)); - auto op = std::make_shared( - Condition(Condition::GEQ_SIGNED, make_reg(src0_reg, idx), make_reg(src1_reg, idx), - make_reg(clobber_reg, idx)), - i1.get_src(2).get_label(), get_branch_delay(i2, idx), false); - op->update_reginfo_self(0, 2, 1); - return op; - } else if (i0.kind == InstructionKind::SLT && i1.kind == InstructionKind::DADDIU && - i2.kind == InstructionKind::MOVN) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - auto src1_reg = i0.get_src(1).get_reg(); - auto dst_reg = i1.get_dst(0).get_reg(); - ASSERT(i1.get_src(0).is_reg(make_gpr(Reg::S7))); - ASSERT(i1.get_src(1).get_imm() == 8); - ASSERT(i2.get_dst(0).get_reg() == dst_reg); - ASSERT(i2.get_src(0).get_reg() == make_gpr(Reg::S7)); - if (i2.get_src(1).get_reg() != clobber_reg) { - return nullptr; // TODO! - } - if (src1_reg == make_gpr(Reg::R0)) { - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(dst_reg, idx), - std::make_shared( - Condition(Condition::GEQ_ZERO_SIGNED, make_reg(src0_reg, idx), - nullptr, make_reg(clobber_reg, idx)), - nullptr)); - op->update_reginfo_self(1, 1, 1); - return op; - } else { - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(dst_reg, idx), - std::make_shared( - Condition(Condition::GEQ_SIGNED, make_reg(src0_reg, idx), - make_reg(src1_reg, idx), make_reg(clobber_reg, idx)), - nullptr)); - op->update_reginfo_self(1, 2, 1); - return op; - } - } - return nullptr; -} - -std::shared_ptr try_slti(Instruction& i0, Instruction& i1, Instruction& i2, int idx) { - auto src1 = make_int(i0.get_src(1).get_imm()); - if (i0.kind == InstructionKind::SLTI && i1.kind == InstructionKind::BNE) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - ASSERT(i1.get_src(0).get_reg() == clobber_reg); - ASSERT(i1.get_src(1).get_reg() == make_gpr(Reg::R0)); - auto op = std::make_shared( - Condition(Condition::LESS_THAN_SIGNED, make_reg(src0_reg, idx), src1, - make_reg(clobber_reg, idx)), - i1.get_src(2).get_label(), get_branch_delay(i2, idx), false); - op->update_reginfo_self(0, 1, 1); - return op; - } else if (i0.kind == InstructionKind::SLTI && i1.kind == InstructionKind::DADDIU && - i2.kind == InstructionKind::MOVZ) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - auto dst_reg = i1.get_dst(0).get_reg(); - ASSERT(i1.get_src(0).is_reg(make_gpr(Reg::S7))); - ASSERT(i1.get_src(1).get_imm() == 8); - ASSERT(i2.get_dst(0).get_reg() == dst_reg); - ASSERT(i2.get_src(0).get_reg() == make_gpr(Reg::S7)); - if (i2.get_src(1).get_reg() != clobber_reg) { - return nullptr; // TODO! - } - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(dst_reg, idx), - std::make_shared(Condition(Condition::LESS_THAN_SIGNED, make_reg(src0_reg, idx), - src1, make_reg(clobber_reg, idx)), - nullptr)); - op->update_reginfo_self(1, 1, 1); - return op; - } else if (i0.kind == InstructionKind::SLTI && i1.kind == InstructionKind::BEQ) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - ASSERT(i1.get_src(0).get_reg() == clobber_reg); - ASSERT(i1.get_src(1).get_reg() == make_gpr(Reg::R0)); - auto op = std::make_shared( - Condition(Condition::GEQ_SIGNED, make_reg(src0_reg, idx), src1, make_reg(clobber_reg, idx)), - i1.get_src(2).get_label(), get_branch_delay(i2, idx), false); - op->update_reginfo_self(0, 1, 1); - return op; - } else if (i0.kind == InstructionKind::SLTI && i1.kind == InstructionKind::DADDIU && - i2.kind == InstructionKind::MOVN) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - auto dst_reg = i1.get_dst(0).get_reg(); - ASSERT(i1.get_src(0).is_reg(make_gpr(Reg::S7))); - ASSERT(i1.get_src(1).get_imm() == 8); - ASSERT(i2.get_dst(0).get_reg() == dst_reg); - ASSERT(i2.get_src(0).get_reg() == make_gpr(Reg::S7)); - if (i2.get_src(1).get_reg() != clobber_reg) { - return nullptr; // TODO! - } - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(dst_reg, idx), - std::make_shared(Condition(Condition::GEQ_SIGNED, make_reg(src0_reg, idx), src1, - make_reg(clobber_reg, idx)), - nullptr)); - op->update_reginfo_self(1, 1, 1); - return op; - } - return nullptr; -} - -std::shared_ptr try_sltiu(Instruction& i0, Instruction& i1, Instruction& i2, int idx) { - auto src1 = make_int(i0.get_src(1).get_imm()); - if (i0.kind == InstructionKind::SLTIU && i1.kind == InstructionKind::BNE) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - ASSERT(i1.get_src(0).get_reg() == clobber_reg); - ASSERT(i1.get_src(1).get_reg() == make_gpr(Reg::R0)); - auto op = std::make_shared( - Condition(Condition::LESS_THAN_UNSIGNED, make_reg(src0_reg, idx), src1, - make_reg(clobber_reg, idx)), - i1.get_src(2).get_label(), get_branch_delay(i2, idx), false); - op->update_reginfo_self(0, 1, 1); - return op; - } else if (i0.kind == InstructionKind::SLTIU && i1.kind == InstructionKind::DADDIU && - i2.kind == InstructionKind::MOVZ) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - auto dst_reg = i1.get_dst(0).get_reg(); - ASSERT(i1.get_src(0).is_reg(make_gpr(Reg::S7))); - ASSERT(i1.get_src(1).get_imm() == 8); - ASSERT(i2.get_dst(0).get_reg() == dst_reg); - ASSERT(i2.get_src(0).get_reg() == make_gpr(Reg::S7)); - if (i2.get_src(1).get_reg() != clobber_reg) { - return nullptr; // TODO! - } - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(dst_reg, idx), - std::make_shared( - Condition(Condition::LESS_THAN_UNSIGNED, make_reg(src0_reg, idx), - src1, make_reg(clobber_reg, idx)), - nullptr)); - op->update_reginfo_self(1, 1, 1); - return op; - } else if (i0.kind == InstructionKind::SLTIU && i1.kind == InstructionKind::BEQ) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - ASSERT(i1.get_src(0).get_reg() == clobber_reg); - ASSERT(i1.get_src(1).get_reg() == make_gpr(Reg::R0)); - auto op = std::make_shared( - Condition(Condition::GEQ_UNSIGNED, make_reg(src0_reg, idx), src1, - make_reg(clobber_reg, idx)), - i1.get_src(2).get_label(), get_branch_delay(i2, idx), false); - op->update_reginfo_self(0, 1, 1); - return op; - } else if (i0.kind == InstructionKind::SLTIU && i1.kind == InstructionKind::DADDIU && - i2.kind == InstructionKind::MOVN) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - auto dst_reg = i1.get_dst(0).get_reg(); - ASSERT(i1.get_src(0).is_reg(make_gpr(Reg::S7))); - ASSERT(i1.get_src(1).get_imm() == 8); - ASSERT(i2.get_dst(0).get_reg() == dst_reg); - ASSERT(i2.get_src(0).get_reg() == make_gpr(Reg::S7)); - if (i2.get_src(1).get_reg() != clobber_reg) { - return nullptr; // TODO! - } - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(dst_reg, idx), - std::make_shared(Condition(Condition::GEQ_UNSIGNED, make_reg(src0_reg, idx), - src1, make_reg(clobber_reg, idx)), - nullptr)); - op->update_reginfo_self(1, 1, 1); - return op; - } - return nullptr; -} - -std::shared_ptr try_ceqs(Instruction& i0, Instruction& i1, Instruction& i2, int idx) { - if (i0.kind == InstructionKind::CEQS && i1.kind == InstructionKind::BC1T) { - auto op = std::make_shared( - Condition(Condition::FLOAT_EQUAL, make_reg(i0.get_src(0).get_reg(), idx), - make_reg(i0.get_src(1).get_reg(), idx), nullptr), - i1.get_src(0).get_label(), get_branch_delay(i2, idx), false); - op->update_reginfo_self(0, 2, 0); - return op; - } else if (i0.kind == InstructionKind::CEQS && i1.kind == InstructionKind::BC1F) { - auto op = std::make_shared( - Condition(Condition::FLOAT_NOT_EQUAL, make_reg(i0.get_src(0).get_reg(), idx), - make_reg(i0.get_src(1).get_reg(), idx), nullptr), - i1.get_src(0).get_label(), get_branch_delay(i2, idx), false); - op->update_reginfo_self(0, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_clts(Instruction& i0, Instruction& i1, Instruction& i2, int idx) { - if (i0.kind == InstructionKind::CLTS && i1.kind == InstructionKind::BC1T) { - auto op = std::make_shared( - Condition(Condition::FLOAT_LESS_THAN, make_reg(i0.get_src(0).get_reg(), idx), - make_reg(i0.get_src(1).get_reg(), idx), nullptr), - i1.get_src(0).get_label(), get_branch_delay(i2, idx), false); - op->update_reginfo_self(0, 2, 0); - return op; - } else if (i0.kind == InstructionKind::CLTS && i1.kind == InstructionKind::BC1F) { - auto op = std::make_shared( - Condition(Condition::FLOAT_GEQ, make_reg(i0.get_src(0).get_reg(), idx), - make_reg(i0.get_src(1).get_reg(), idx), nullptr), - i1.get_src(0).get_label(), get_branch_delay(i2, idx), false); - op->update_reginfo_self(0, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_cles(Instruction& i0, Instruction& i1, Instruction& i2, int idx) { - if (i0.kind == InstructionKind::CLES && i1.kind == InstructionKind::BC1T) { - auto op = std::make_shared( - Condition(Condition::FLOAT_LEQ, make_reg(i0.get_src(0).get_reg(), idx), - make_reg(i0.get_src(1).get_reg(), idx), nullptr), - i1.get_src(0).get_label(), get_branch_delay(i2, idx), false); - op->update_reginfo_self(0, 2, 0); - return op; - } else if (i0.kind == InstructionKind::CLES && i1.kind == InstructionKind::BC1F) { - auto op = std::make_shared( - Condition(Condition::FLOAT_GREATER_THAN, make_reg(i0.get_src(0).get_reg(), idx), - make_reg(i0.get_src(1).get_reg(), idx), nullptr), - i1.get_src(0).get_label(), get_branch_delay(i2, idx), false); - op->update_reginfo_self(0, 2, 0); - return op; - } - return nullptr; -} - -std::shared_ptr try_sltu(Instruction& i0, Instruction& i1, Instruction& i2, int idx) { - if (i0.kind == InstructionKind::SLTU && i1.kind == InstructionKind::BNE) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - auto src1_reg = i0.get_src(1).get_reg(); - ASSERT(i1.get_src(0).get_reg() == clobber_reg); - ASSERT(i1.get_src(1).get_reg() == make_gpr(Reg::R0)); - auto op = std::make_shared( - Condition(Condition::LESS_THAN_UNSIGNED, make_reg(src0_reg, idx), make_reg(src1_reg, idx), - make_reg(clobber_reg, idx)), - i1.get_src(2).get_label(), get_branch_delay(i2, idx), false); - op->update_reginfo_self(0, 2, 1); - return op; - } else if (i0.kind == InstructionKind::SLTU && i1.kind == InstructionKind::DADDIU && - i2.kind == InstructionKind::MOVZ) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - auto src1_reg = i0.get_src(1).get_reg(); - auto dst_reg = i1.get_dst(0).get_reg(); - ASSERT(i1.get_src(0).is_reg(make_gpr(Reg::S7))); - ASSERT(i1.get_src(1).get_imm() == 8); - ASSERT(i2.get_dst(0).get_reg() == dst_reg); - ASSERT(i2.get_src(0).get_reg() == make_gpr(Reg::S7)); - if (i2.get_src(1).get_reg() != clobber_reg) { - return nullptr; // TODO! - } - auto op = make_set_atomic(IR_Set_Atomic::REG_64, make_reg(dst_reg, idx), - std::make_shared( - Condition(Condition::LESS_THAN_UNSIGNED, make_reg(src0_reg, idx), - make_reg(src1_reg, idx), make_reg(clobber_reg, idx)), - nullptr)); - op->update_reginfo_self(1, 2, 1); - return op; - } else if (i0.kind == InstructionKind::SLTU && i1.kind == InstructionKind::BEQ) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - auto src1_reg = i0.get_src(1).get_reg(); - ASSERT(i1.get_src(0).get_reg() == clobber_reg); - ASSERT(i1.get_src(1).get_reg() == make_gpr(Reg::R0)); - auto op = std::make_shared( - Condition(Condition::GEQ_UNSIGNED, make_reg(src0_reg, idx), make_reg(src1_reg, idx), - make_reg(clobber_reg, idx)), - i1.get_src(2).get_label(), get_branch_delay(i2, idx), false); - op->update_reginfo_self(0, 2, 1); - return op; - } else if (i0.kind == InstructionKind::SLTU && i1.kind == InstructionKind::DADDIU && - i2.kind == InstructionKind::MOVN) { - auto clobber_reg = i0.get_dst(0).get_reg(); - auto src0_reg = i0.get_src(0).get_reg(); - auto src1_reg = i0.get_src(1).get_reg(); - auto dst_reg = i1.get_dst(0).get_reg(); - ASSERT(i1.get_src(0).is_reg(make_gpr(Reg::S7))); - ASSERT(i1.get_src(1).get_imm() == 8); - ASSERT(i2.get_dst(0).get_reg() == dst_reg); - ASSERT(i2.get_src(0).get_reg() == make_gpr(Reg::S7)); - if (i2.get_src(1).get_reg() != clobber_reg) { - return nullptr; // TODO! - } - auto op = make_set_atomic( - IR_Set_Atomic::REG_64, make_reg(dst_reg, idx), - std::make_shared(Condition(Condition::GEQ_UNSIGNED, make_reg(src0_reg, idx), - make_reg(src1_reg, idx), make_reg(clobber_reg, idx)), - nullptr)); - op->update_reginfo_self(1, 2, 1); - return op; - } - return nullptr; -} - -// five op -std::shared_ptr try_lwu(Instruction& i0, - Instruction& i1, - Instruction& i2, - Instruction& i3, - Instruction& i4, - int idx) { - (void)idx; - auto s6 = make_gpr(Reg::S6); - if (i0.kind == InstructionKind::LWU && i0.get_dst(0).is_reg(s6) && - i0.get_src(0).get_imm() == 44 && i0.get_src(1).is_reg(s6) && - i1.kind == InstructionKind::MTLO1 && i1.get_src(0).is_reg(s6) && - i2.kind == InstructionKind::LWU && i2.get_dst(0).is_reg(s6) && - i2.get_src(0).get_imm() == 12 && i2.get_src(1).is_reg(s6) && - i3.kind == InstructionKind::JALR && i3.get_dst(0).is_reg(make_gpr(Reg::RA)) && - i3.get_src(0).is_reg(s6) && i4.kind == InstructionKind::MFLO1 && i4.get_dst(0).is_reg(s6)) { - auto op = std::make_shared(); - op->reg_info_set = true; - return op; - } - return nullptr; -} - -} // namespace - -void add_basic_ops_to_block(Function* func, const BasicBlock& block, LinkedObjectFile* file) { - (void)file; - for (int instr = block.start_word; instr < block.end_word; instr++) { - auto& i = func->instructions.at(instr); - - int length = 0; - - std::shared_ptr result = nullptr; - if (instr + 4 < block.end_word) { - auto& i1 = func->instructions.at(instr + 1); - auto& i2 = func->instructions.at(instr + 2); - auto& i3 = func->instructions.at(instr + 3); - auto& i4 = func->instructions.at(instr + 4); - switch (i.kind) { - case InstructionKind::LWU: - result = try_lwu(i, i1, i2, i3, i4, instr); - break; - default: - result = nullptr; - } - if (result) { - length = 5; - } - } - - if (!result && instr + 2 < block.end_word) { - auto& next = func->instructions.at(instr + 1); - auto& next_next = func->instructions.at(instr + 2); - switch (i.kind) { - case InstructionKind::DSUBU: - result = try_dsubu(i, next, next_next, instr); - break; - case InstructionKind::SLT: - result = try_slt(i, next, next_next, instr); - break; - case InstructionKind::SLTI: - result = try_slti(i, next, next_next, instr); - break; - case InstructionKind::SLTU: - result = try_sltu(i, next, next_next, instr); - break; - case InstructionKind::SLTIU: - result = try_sltiu(i, next, next_next, instr); - break; - case InstructionKind::CEQS: - result = try_ceqs(i, next, next_next, instr); - break; - case InstructionKind::CLTS: - result = try_clts(i, next, next_next, instr); - break; - case InstructionKind::CLES: - result = try_cles(i, next, next_next, instr); - break; - case InstructionKind::LUI: - result = try_lui(i, next, next_next, instr); - break; - default: - result = nullptr; - } - - if (result) { - length = 3; - } - } - - if (!result && instr + 1 < block.end_word) { - auto& next = func->instructions.at(instr + 1); - // single op failed, try double - switch (i.kind) { - case InstructionKind::DIV: - result = try_div(i, next, instr); - break; - case InstructionKind::DIVU: - result = try_divu(i, next, instr); - break; - case InstructionKind::JALR: - result = try_jalr(i, next, instr); - break; - case InstructionKind::BNE: - result = try_bne(i, next, instr); - break; - case InstructionKind::BNEL: - result = try_bnel(i, next, instr); - break; - case InstructionKind::BEQ: - result = try_beq(i, next, instr); - break; - case InstructionKind::BGTZL: - result = try_bgtzl(i, next, instr); - break; - case InstructionKind::BGEZL: - result = try_bgezl(i, next, instr); - break; - case InstructionKind::BLTZL: - result = try_bltzl(i, next, instr); - break; - case InstructionKind::BEQL: - result = try_beql(i, next, instr); - break; - case InstructionKind::DADDIU: - result = try_daddiu(i, next, instr); - break; - case InstructionKind::LUI: - result = try_lui(i, next, instr); - break; - case InstructionKind::SLT: - result = try_slt(i, next, instr); - break; - default: - result = nullptr; - } - - if (result) { - length = 2; - } - } - - if (!result) { - switch (i.kind) { - case InstructionKind::OR: - result = try_or(i, instr); - break; - case InstructionKind::ORI: - result = try_ori(i, instr); - break; - case InstructionKind::DADDIU: - result = try_daddiu(i, instr); - break; - case InstructionKind::AND: - result = try_and(i, instr); - break; - case InstructionKind::ANDI: - result = try_andi(i, instr); - break; - case InstructionKind::XORI: - result = try_xori(i, instr); - break; - case InstructionKind::NOR: - result = try_nor(i, instr); - break; - case InstructionKind::XOR: - result = try_xor(i, instr); - break; - case InstructionKind::LWC1: - result = try_lwc1(i, instr); - break; - case InstructionKind::MTC1: - result = try_mtc1(i, instr); - break; - case InstructionKind::DIVS: - result = try_float_math_2(i, instr, InstructionKind::DIVS, IR_FloatMath2::DIV); - break; - case InstructionKind::SUBS: - result = try_float_math_2(i, instr, InstructionKind::SUBS, IR_FloatMath2::SUB); - break; - case InstructionKind::ADDS: - result = try_float_math_2(i, instr, InstructionKind::ADDS, IR_FloatMath2::ADD); - break; - case InstructionKind::MULS: - result = try_float_math_2(i, instr, InstructionKind::MULS, IR_FloatMath2::MUL); - break; - case InstructionKind::ABSS: - result = try_float_math_1(i, instr, InstructionKind::ABSS, IR_FloatMath1::ABS); - break; - case InstructionKind::NEGS: - result = try_float_math_1(i, instr, InstructionKind::NEGS, IR_FloatMath1::NEG); - break; - case InstructionKind::SQRTS: - result = try_float_math_1(i, instr, InstructionKind::SQRTS, IR_FloatMath1::SQRT); - break; - case InstructionKind::MINS: - result = try_float_math_2(i, instr, InstructionKind::MINS, IR_FloatMath2::MIN); - break; - case InstructionKind::MAXS: - result = try_float_math_2(i, instr, InstructionKind::MAXS, IR_FloatMath2::MAX); - break; - case InstructionKind::MOVS: - result = try_movs(i, instr); - break; - case InstructionKind::MFC1: - result = try_mfc1(i, instr); - break; - case InstructionKind::DADDU: - result = try_daddu(i, instr); - break; - case InstructionKind::DSUBU: - result = try_dsubu(i, instr); - if (!result) { - // fails if it uses s7 register. - result = to_asm_automatic(i.op_name_to_string(), i, instr); - } - break; - case InstructionKind::MULT3: - result = try_mult3(i, instr); - break; - case InstructionKind::MULTU3: - result = try_multu3(i, instr); - break; - case InstructionKind::POR: - result = try_por(i, instr); - if (!result) { - result = to_asm_automatic(i.op_name_to_string(), i, instr); - } - break; - case InstructionKind::LBU: - result = try_lbu(i, instr); - break; - case InstructionKind::LHU: - result = try_lhu(i, instr); - break; - case InstructionKind::LB: - result = try_lb(i, instr); - break; - case InstructionKind::LH: - result = try_lh(i, instr); - break; - case InstructionKind::LW: - result = try_lw(i, instr); - break; - case InstructionKind::LWU: - result = try_lwu(i, instr); - break; - case InstructionKind::LD: - result = try_ld(i, instr); - break; - case InstructionKind::LQ: - result = try_lq(i, instr); - break; - case InstructionKind::DSRA: - result = try_dsra(i, instr); - break; - case InstructionKind::DSRA32: - result = try_dsra32(i, instr); - break; - case InstructionKind::DSRL: - result = try_dsrl(i, instr); - break; - case InstructionKind::DSRL32: - result = try_dsrl32(i, instr); - break; - case InstructionKind::DSLL: - result = try_dsll(i, instr); - break; - case InstructionKind::DSLL32: - result = try_dsll32(i, instr); - break; - case InstructionKind::ADDIU: - result = try_addiu(i, instr); - if (!result) { - result = to_asm_automatic(i.op_name_to_string(), i, instr); - } - break; - case InstructionKind::LUI: - result = try_lui(i, instr); - break; - case InstructionKind::SLL: - result = try_sll(i, instr); - if (!result) { - result = to_asm_automatic(i.op_name_to_string(), i, instr); - } - break; - case InstructionKind::SB: - result = try_sb(i, instr); - break; - case InstructionKind::SH: - result = try_sh(i, instr); - break; - case InstructionKind::SW: - result = try_sw(i, instr); - break; - case InstructionKind::SD: - result = try_sd(i, instr); - break; - case InstructionKind::SQ: - result = try_sq(i, instr); - break; - case InstructionKind::SWC1: - result = try_swc1(i, instr); - break; - case InstructionKind::CVTWS: - result = try_cvtws(i, instr); - break; - case InstructionKind::CVTSW: - result = try_cvtsw(i, instr); - break; - case InstructionKind::DSRAV: - result = try_dsrav(i, instr); - break; - case InstructionKind::DSRLV: - result = try_dsrlv(i, instr); - break; - case InstructionKind::DSLLV: - result = try_dsllv(i, instr); - break; - case InstructionKind::SUBU: - result = try_subu(i, instr); - break; - case InstructionKind::SLLV: - result = try_sllv(i, instr); - break; - case InstructionKind::MOVN: - result = try_movn(i, instr); - if (!result) { - result = to_asm_automatic(i.op_name_to_string(), i, instr); - } - break; - case InstructionKind::MOVZ: - result = try_movz(i, instr); - if (!result) { - result = to_asm_automatic(i.op_name_to_string(), i, instr); - } - break; - - // Everything below here is an "asm passthrough". - case InstructionKind::JR: - result = to_asm_src_reg("jr", i, instr); - break; - - // reg reg - case InstructionKind::QMFC2: - result = to_asm_dst_reg_src_reg(i.op_name_to_string(), i, instr); - break; - - // VU/COP2 - case InstructionKind::VMOVE: - case InstructionKind::VFTOI0: - case InstructionKind::VFTOI4: - case InstructionKind::VFTOI12: - case InstructionKind::VITOF0: - case InstructionKind::VITOF12: - case InstructionKind::VITOF15: - case InstructionKind::VABS: - case InstructionKind::VADD: - case InstructionKind::VSUB: - case InstructionKind::VMUL: - case InstructionKind::VMINI: - case InstructionKind::VMAX: - case InstructionKind::VOPMSUB: - case InstructionKind::VMADD: - case InstructionKind::VMSUB: - case InstructionKind::VADD_BC: - case InstructionKind::VSUB_BC: - case InstructionKind::VMUL_BC: - case InstructionKind::VMULA_BC: - case InstructionKind::VMADD_BC: - case InstructionKind::VADDA_BC: - case InstructionKind::VMADDA_BC: - case InstructionKind::VMSUBA_BC: - case InstructionKind::VMSUB_BC: - case InstructionKind::VMINI_BC: - case InstructionKind::VMAX_BC: - case InstructionKind::VADDQ: - case InstructionKind::VSUBQ: - case InstructionKind::VMULQ: - case InstructionKind::VMSUBQ: - case InstructionKind::VMULA: - case InstructionKind::VADDA: - case InstructionKind::VMADDA: - case InstructionKind::VOPMULA: - case InstructionKind::VDIV: - case InstructionKind::VCLIP: - case InstructionKind::VMULAQ: - case InstructionKind::VMTIR: - case InstructionKind::VIAND: - case InstructionKind::VLQI: - case InstructionKind::VIADDI: - case InstructionKind::VSQI: - case InstructionKind::VRGET: - case InstructionKind::VSQRT: - case InstructionKind::VRSQRT: - case InstructionKind::VRXOR: - case InstructionKind::VRNEXT: - case InstructionKind::VNOP: - case InstructionKind::VWAITQ: - case InstructionKind::VCALLMS: - - // FPU/COP1 - case InstructionKind::MULAS: - case InstructionKind::MADDAS: - case InstructionKind::MADDS: - case InstructionKind::ADDAS: - - // Moves / Loads / Stores - case InstructionKind::CTC2: - case InstructionKind::CFC2: - case InstructionKind::SQC2: - case InstructionKind::LQC2: - case InstructionKind::LDR: - case InstructionKind::LDL: - case InstructionKind::QMTC2: - case InstructionKind::MFC0: - case InstructionKind::MTC0: - case InstructionKind::SYNCL: - case InstructionKind::SYNCP: - case InstructionKind::SYSCALL: - case InstructionKind::CACHE_DXWBIN: - case InstructionKind::MTPC: - case InstructionKind::MFPC: - - // random math - case InstructionKind::ADDU: - case InstructionKind::SRL: // maybe bitfield ops use this? - case InstructionKind::SRA: - case InstructionKind::SLT: - case InstructionKind::SLTI: - - // MMI - case InstructionKind::PSLLW: - case InstructionKind::PSRAW: - case InstructionKind::PSRAH: - case InstructionKind::PLZCW: - case InstructionKind::PMFHL_UW: - case InstructionKind::PMFHL_LW: - case InstructionKind::PMFHL_LH: - case InstructionKind::PSLLH: - case InstructionKind::PSRLH: - case InstructionKind::PEXTLW: - case InstructionKind::PPACH: - case InstructionKind::PSUBW: - case InstructionKind::PCGTW: - case InstructionKind::PEXTLH: - case InstructionKind::PEXTLB: - case InstructionKind::PMAXH: - case InstructionKind::PPACB: - case InstructionKind::PADDW: - case InstructionKind::PADDH: - case InstructionKind::PMAXW: - case InstructionKind::PPACW: - case InstructionKind::PCEQW: - case InstructionKind::PEXTUW: - case InstructionKind::PMINH: - case InstructionKind::PEXTUH: - case InstructionKind::PEXTUB: - case InstructionKind::PCEQB: - case InstructionKind::PMINW: - case InstructionKind::PABSW: - case InstructionKind::PCPYLD: - case InstructionKind::PROT3W: - case InstructionKind::PAND: - case InstructionKind::PMADDH: - case InstructionKind::PMULTH: - case InstructionKind::PEXEW: - case InstructionKind::PCPYUD: - case InstructionKind::PNOR: - case InstructionKind::PCPYH: - case InstructionKind::PINTEH: - - case InstructionKind::MTDAB: - case InstructionKind::MTDABM: - - // 128 bit integer - // case InstructionKind::LQ: - // case InstructionKind::SQ: - - result = to_asm_automatic(i.op_name_to_string(), i, instr); - break; - default: - result = nullptr; - } - - if (result) { - length = 1; - } - } - - // everything failed - if (!result) { - // temp hack for debug: - lg::error("Instruction -> BasicOp failed on {}", i.to_string(file->labels)); - func->add_basic_op(std::make_shared(), instr, instr + 1); - } else { - if (!func->contains_asm_ops && dynamic_cast(result.get())) { - func->warnings.info("Contains asm ops"); - func->contains_asm_ops = true; - } - - if (!result->reg_info_set) { - printf("Failed reg info %s\n", result->print(*file).c_str()); - } - func->add_basic_op(result, instr, instr + length); - instr += (length - 1); - } - } -} -} // namespace decompiler \ No newline at end of file diff --git a/decompiler/IR/BasicOpBuilder.h b/decompiler/IR/BasicOpBuilder.h deleted file mode 100644 index d20b06c850..0000000000 --- a/decompiler/IR/BasicOpBuilder.h +++ /dev/null @@ -1,15 +0,0 @@ -/*! - * @file BasicOpBuilder.h - * Analyzes a basic block and converts instructions to BasicOps. - * These will be used later to convert the Cfg into the nested IR format. - */ - -#pragma once - -namespace decompiler { -class Function; -struct BasicBlock; -class LinkedObjectFile; - -void add_basic_ops_to_block(Function* func, const BasicBlock& block, LinkedObjectFile* file); -} // namespace decompiler \ No newline at end of file diff --git a/decompiler/IR/IR.cpp b/decompiler/IR/IR.cpp deleted file mode 100644 index ea53180f71..0000000000 --- a/decompiler/IR/IR.cpp +++ /dev/null @@ -1,1006 +0,0 @@ -#include "IR.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "common/goos/PrettyPrinter.h" -#include "third-party/fmt/core.h" - -namespace decompiler { -// hack to print out reverse deref paths on loads to help with debugging load stuff. -bool enable_hack_load_path_print = false; -// hack to print (begin x) as x to make debug output easier to read. -bool inline_single_begins = true; - -std::vector> IR::get_all_ir(LinkedObjectFile& file) const { - (void)file; - std::vector> result; - get_children(&result); - size_t last_checked = 0; - size_t last_last_checked = -1; - - while (last_checked != last_last_checked) { - last_last_checked = last_checked; - auto end_of_check = result.size(); - for (size_t i = last_checked; i < end_of_check; i++) { - auto it = result.at(i).get(); - ASSERT(it); - it->get_children(&result); - } - last_checked = end_of_check; - } - - return result; -} - -std::string IR::print(const LinkedObjectFile& file) const { - return pretty_print::to_string(to_form(file)); -} - -namespace { -template -void add_regs_to_str(const T& regs, std::string& str) { - bool first = true; - for (auto& reg : regs) { - if (first) { - first = false; - } else { - str.push_back(' '); - } - str.append(reg.to_charp()); - } -} -} // namespace - -goos::Object IR_Failed::to_form(const LinkedObjectFile& file) const { - (void)file; - return pretty_print::build_list("INVALID-OPERATION"); -} - -void IR_Failed::get_children(std::vector>* output) const { - (void)output; -} - -goos::Object IR_Register::to_form(const LinkedObjectFile& file) const { - (void)file; - return pretty_print::to_symbol(reg.to_charp()); -} - -void IR_Register::get_children(std::vector>* output) const { - (void)output; -} - -goos::Object IR_Set::to_form(const LinkedObjectFile& file) const { - return pretty_print::build_list(pretty_print::to_symbol("set!"), dst->to_form(file), - src->to_form(file)); -} - -void IR_Set::get_children(std::vector>* output) const { - // note that we are not returning clobber here because it shouldn't contain anything that - // the IR simplification code should touch. - output->push_back(dst); - output->push_back(src); -} - -template <> -void IR_Set_Atomic::update_reginfo_self(int n_dest, int n_src, int n_clobber) { - auto dst_as_reg = dynamic_cast(dst.get()); - if (dst_as_reg) { - write_regs.push_back(dst_as_reg->reg); - } - - auto src_as = dynamic_cast(src.get()); - ASSERT(src_as); - - for (auto& x : {src_as->arg0, src_as->arg1}) { - auto reg = dynamic_cast(x.get()); - if (reg) { - read_regs.push_back(reg->reg); - } - } - - ASSERT(int(write_regs.size()) == n_dest); - ASSERT(int(read_regs.size()) == n_src); - ASSERT(int(clobber_regs.size()) == n_clobber); - reg_info_set = true; -} - -template <> -void IR_Set_Atomic::update_reginfo_self(int n_dest, int n_src, int n_clobber) { - auto dst_as_reg = dynamic_cast(dst.get()); - if (dst_as_reg) { - write_regs.push_back(dst_as_reg->reg); - } - - auto src_as = dynamic_cast(src.get()); - ASSERT(src_as); - - auto reg = dynamic_cast(src_as->arg.get()); - if (reg) { - read_regs.push_back(reg->reg); - } - - ASSERT(int(write_regs.size()) == n_dest); - ASSERT(int(read_regs.size()) == n_src); - ASSERT(int(clobber_regs.size()) == n_clobber); - reg_info_set = true; -} - -template <> -void IR_Set_Atomic::update_reginfo_self(int n_dest, int n_src, int n_clobber) { - auto dst_as_reg = dynamic_cast(dst.get()); - if (dst_as_reg) { - write_regs.push_back(dst_as_reg->reg); - } - - auto src_as = dynamic_cast(src.get()); - ASSERT(src_as); - - // try to get the source as a register - auto reg = dynamic_cast(src_as->location.get()); - if (reg) { - read_regs.push_back(reg->reg); - } - - // or as math with a register - auto math = dynamic_cast(src_as->location.get()); - if (math) { - for (auto& x : {math->arg0, math->arg1}) { - auto math_reg = dynamic_cast(x.get()); - if (math_reg) { - read_regs.push_back(math_reg->reg); - } - } - } - - ASSERT(int(write_regs.size()) == n_dest); - ASSERT(int(read_regs.size()) == n_src); - ASSERT(int(clobber_regs.size()) == n_clobber); - reg_info_set = true; -} - -template <> -void IR_Set_Atomic::update_reginfo_self(int n_dest, int n_src, int n_clobber) { - auto dst_as_reg = dynamic_cast(dst.get()); - if (dst_as_reg) { - write_regs.push_back(dst_as_reg->reg); - } - - auto src_as_cmp = dynamic_cast(src.get()); - ASSERT(src_as_cmp); - for (auto& x : {src_as_cmp->condition.src0, src_as_cmp->condition.src1}) { - auto as_reg = dynamic_cast(x.get()); - if (as_reg) { - read_regs.push_back(as_reg->reg); - } - } - - auto as_reg = dynamic_cast(src_as_cmp->condition.clobber.get()); - if (as_reg) { - clobber_regs.push_back(as_reg->reg); - } - - ASSERT(int(write_regs.size()) == n_dest); - ASSERT(int(read_regs.size()) == n_src); - ASSERT(int(clobber_regs.size()) == n_clobber); - reg_info_set = true; -} - -/*! - * Set the register info, assuming this is a register to register set. - */ -void IR_Set_Atomic::update_reginfo_regreg() { - auto dst_as_reg = dynamic_cast(dst.get()); - if (dst_as_reg) { - write_regs.push_back(dst_as_reg->reg); - } - - auto src_as = dynamic_cast(src.get()); - - if (src_as) { - read_regs.push_back(src_as->reg); - } - - ASSERT(int(write_regs.size()) == 1); - ASSERT(int(read_regs.size()) == 1); - ASSERT(int(clobber_regs.size()) == 0); - reg_info_set = true; -} - -goos::Object IR_Store::to_form(const LinkedObjectFile& file) const { - std::string store_operator; - switch (kind) { - case Kind::FLOAT: - store_operator = "s.f"; - break; - case Kind::INTEGER: - switch (size) { - case 1: - store_operator = "s.b"; - break; - case 2: - store_operator = "s.h"; - break; - case 4: - store_operator = "s.w"; - break; - case 8: - store_operator = "s.d"; - break; - case 16: - store_operator = "s.q"; - break; - default: - ASSERT(false); - } - break; - default: - ASSERT(false); - } - - return pretty_print::build_list(pretty_print::to_symbol(store_operator), dst->to_form(file), - src->to_form(file)); -} - -goos::Object IR_Store_Atomic::to_form(const LinkedObjectFile& file) const { - std::string store_operator; - switch (kind) { - case Kind::FLOAT: - store_operator = "s.f"; - break; - case Kind::INTEGER: - switch (size) { - case 1: - store_operator = "s.b"; - break; - case 2: - store_operator = "s.h"; - break; - case 4: - store_operator = "s.w"; - break; - case 8: - store_operator = "s.d"; - break; - case 16: - store_operator = "s.q"; - break; - default: - ASSERT(false); - } - break; - default: - ASSERT(false); - } - - return pretty_print::build_list(pretty_print::to_symbol(store_operator), dst->to_form(file), - src->to_form(file)); -} - -void IR_Store_Atomic::update_reginfo_self(int n_dest, int n_src, int n_clobber) { - auto src_reg = dynamic_cast(src.get()); - if (src_reg) { - read_regs.push_back(src_reg->reg); - } - - auto dst_reg = dynamic_cast(dst.get()); - if (dst_reg) { - read_regs.push_back(dst_reg->reg); - } - - // or as math with a register - auto math = dynamic_cast(dst.get()); - if (math) { - for (auto& x : {math->arg0, math->arg1}) { - auto math_reg = dynamic_cast(x.get()); - if (math_reg) { - read_regs.push_back(math_reg->reg); - } - } - } - - ASSERT(int(write_regs.size()) == n_dest); - ASSERT(int(read_regs.size()) == n_src); - ASSERT(int(clobber_regs.size()) == n_clobber); - reg_info_set = true; -} - -goos::Object IR_Symbol::to_form(const LinkedObjectFile& file) const { - (void)file; - return pretty_print::to_symbol("'" + name); -} - -void IR_Symbol::get_children(std::vector>* output) const { - (void)output; -} - -goos::Object IR_SymbolValue::to_form(const LinkedObjectFile& file) const { - (void)file; - return pretty_print::to_symbol(name); -} - -void IR_SymbolValue::get_children(std::vector>* output) const { - (void)output; -} - -goos::Object IR_EmptyPair::to_form(const LinkedObjectFile& file) const { - (void)file; - return pretty_print::to_symbol("'()"); -} - -void IR_EmptyPair::get_children(std::vector>* output) const { - (void)output; -} - -goos::Object IR_StaticAddress::to_form(const LinkedObjectFile& file) const { - // return pretty_print::build_list(pretty_print::to_symbol("&"), file.get_label_name(label_id)); - return pretty_print::to_symbol(file.get_label_name(label_id)); -} - -void IR_StaticAddress::get_children(std::vector>* output) const { - (void)output; -} - -goos::Object IR_Load::to_form(const LinkedObjectFile& file) const { - if (load_path_set && enable_hack_load_path_print) { - std::vector list; - if (load_path_addr_of) { - list.push_back(pretty_print::to_symbol("&->")); - } else { - list.push_back(pretty_print::to_symbol("->")); - } - list.push_back(load_path_base->to_form(file)); - for (auto& x : load_path) { - list.push_back(pretty_print::to_symbol(x)); - } - return pretty_print::build_list(list); - } - std::string load_operator; - switch (kind) { - case FLOAT: - load_operator = "l.f"; - break; - case UNSIGNED: - switch (size) { - case 1: - load_operator = "l.bu"; - break; - case 2: - load_operator = "l.hu"; - break; - case 4: - load_operator = "l.wu"; - break; - case 8: - load_operator = "l.d"; - break; - case 16: - load_operator = "l.q"; - break; - default: - ASSERT(false); - } - break; - case SIGNED: - switch (size) { - case 1: - load_operator = "l.bs"; - break; - case 2: - load_operator = "l.hs"; - break; - case 4: - load_operator = "l.ws"; - break; - default: - ASSERT(false); - } - break; - default: - ASSERT(false); - } - return pretty_print::build_list(pretty_print::to_symbol(load_operator), location->to_form(file)); -} - -void IR_Load::get_children(std::vector>* output) const { - output->push_back(location); -} - -goos::Object IR_FloatMath2::to_form(const LinkedObjectFile& file) const { - std::string math_operator; - switch (kind) { - case DIV: - math_operator = "/.f"; - break; - case MUL: - math_operator = "*.f"; - break; - case ADD: - math_operator = "+.f"; - break; - case SUB: - math_operator = "-.f"; - break; - case MIN: - math_operator = "min.f"; - break; - case MAX: - math_operator = "max.f"; - break; - default: - ASSERT(false); - } - - return pretty_print::build_list(pretty_print::to_symbol(math_operator), arg0->to_form(file), - arg1->to_form(file)); -} - -void IR_FloatMath2::get_children(std::vector>* output) const { - output->push_back(arg0); - output->push_back(arg1); -} - -void IR_FloatMath1::get_children(std::vector>* output) const { - output->push_back(arg); -} - -goos::Object IR_IntMath2::to_form(const LinkedObjectFile& file) const { - std::string math_operator; - switch (kind) { - case ADD: - math_operator = "+.i"; - break; - case SUB: - math_operator = "-.i"; - break; - case MUL_SIGNED: - math_operator = "*.si"; - break; - case MUL_UNSIGNED: - math_operator = "*.ui"; - break; - case DIV_SIGNED: - math_operator = "/.si"; - break; - case MOD_SIGNED: - math_operator = "mod.si"; - break; - case DIV_UNSIGNED: - math_operator = "/.ui"; - break; - case MOD_UNSIGNED: - math_operator = "mod.ui"; - break; - case OR: - math_operator = "logior"; - break; - case AND: - math_operator = "logand"; - break; - case NOR: - math_operator = "lognor"; - break; - case XOR: - math_operator = "logxor"; - break; - case LEFT_SHIFT: - math_operator = "shl"; - break; - case RIGHT_SHIFT_ARITH: - math_operator = "sar"; - break; - case RIGHT_SHIFT_LOGIC: - math_operator = "shr"; - break; - case MIN_SIGNED: - math_operator = "min.si"; - break; - case MAX_SIGNED: - math_operator = "max.si"; - break; - default: - ASSERT(false); - } - return pretty_print::build_list(pretty_print::to_symbol(math_operator), arg0->to_form(file), - arg1->to_form(file)); -} - -void IR_IntMath2::get_children(std::vector>* output) const { - output->push_back(arg0); - output->push_back(arg1); -} - -goos::Object IR_IntMath1::to_form(const LinkedObjectFile& file) const { - std::string math_operator; - switch (kind) { - case NOT: - math_operator = "lognot"; - break; - case ABS: - math_operator = "abs.si"; - break; - case NEG: - math_operator = "-.i"; - break; - default: - ASSERT(false); - } - return pretty_print::build_list(pretty_print::to_symbol(math_operator), arg->to_form(file)); -} - -void IR_IntMath1::get_children(std::vector>* output) const { - output->push_back(arg); -} - -goos::Object IR_FloatMath1::to_form(const LinkedObjectFile& file) const { - std::string math_operator; - switch (kind) { - case FLOAT_TO_INT: - math_operator = "int<-float"; - break; - case INT_TO_FLOAT: - math_operator = "float<-int"; - break; - case ABS: - math_operator = "abs.f"; - break; - case NEG: - math_operator = "neg.f"; - break; - case SQRT: - math_operator = "sqrt.f"; - break; - default: - ASSERT(false); - } - return pretty_print::build_list(pretty_print::to_symbol(math_operator), arg->to_form(file)); -} - -goos::Object IR_Call::to_form(const LinkedObjectFile& file) const { - (void)file; - std::vector result; - result.push_back(pretty_print::to_symbol("call!")); - - if (call_type_set) { - result.push_back(pretty_print::to_symbol(":arg-count")); - result.push_back(pretty_print::to_symbol(std::to_string(call_type.arg_count() - 1))); - } - - for (auto& x : args) { - result.push_back(x->to_form(file)); - } - return pretty_print::build_list(result); -} - -void IR_Call::get_children(std::vector>* output) const { - (void)output; -} - -goos::Object IR_IntegerConstant::to_form(const LinkedObjectFile& file) const { - (void)file; - return pretty_print::to_symbol(std::to_string(value)); -} - -void IR_IntegerConstant::get_children(std::vector>* output) const { - (void)output; -} - -goos::Object BranchDelay::to_form(const LinkedObjectFile& file) const { - (void)file; - switch (kind) { - case NOP: - return pretty_print::build_list("nop"); - case SET_REG_FALSE: - return pretty_print::build_list(pretty_print::to_symbol("set!"), destination->to_form(file), - "'#f"); - case SET_REG_TRUE: - return pretty_print::build_list(pretty_print::to_symbol("set!"), destination->to_form(file), - "'#t"); - case SET_REG_REG: - return pretty_print::build_list(pretty_print::to_symbol("set!"), destination->to_form(file), - source->to_form(file)); - case SET_BINTEGER: - return pretty_print::build_list(pretty_print::to_symbol("set!"), destination->to_form(file), - "binteger"); - case SET_PAIR: - return pretty_print::build_list(pretty_print::to_symbol("set!"), destination->to_form(file), - "pair"); - case DSLLV: - return pretty_print::build_list( - pretty_print::to_symbol("set!"), destination->to_form(file), - pretty_print::build_list(pretty_print::to_symbol("shl"), source->to_form(file), - source2->to_form(file))); - case NEGATE: - return pretty_print::build_list(pretty_print::to_symbol("set!"), destination->to_form(file), - pretty_print::build_list("-", source->to_form(file))); - case UNKNOWN: - return pretty_print::build_list("unknown-branch-delay"); - default: - ASSERT(false); - return {}; - } -} - -void BranchDelay::get_children(std::vector>* output) const { - if (destination) { - output->push_back(destination); - } - - if (source) { - output->push_back(source); - } - - if (source2) { - output->push_back(source2); - } -} - -goos::Object IR_Nop::to_form(const LinkedObjectFile& file) const { - (void)file; - return pretty_print::build_list("nop!"); -} - -int Condition::num_args() const { - switch (kind) { - case NOT_EQUAL: - case EQUAL: - case LESS_THAN_SIGNED: - case LESS_THAN_UNSIGNED: - case GREATER_THAN_SIGNED: - case GREATER_THAN_UNSIGNED: - case LEQ_SIGNED: - case GEQ_SIGNED: - case LEQ_UNSIGNED: - case GEQ_UNSIGNED: - case FLOAT_EQUAL: - case FLOAT_NOT_EQUAL: - case FLOAT_LESS_THAN: - case FLOAT_GEQ: - case FLOAT_GREATER_THAN: - case FLOAT_LEQ: - return 2; - case ZERO: - case NONZERO: - case FALSE: - case TRUTHY: - case GREATER_THAN_ZERO_SIGNED: - case GEQ_ZERO_SIGNED: - case LESS_THAN_ZERO: - case LEQ_ZERO_SIGNED: - return 1; - case ALWAYS: - case NEVER: - return 0; - default: - ASSERT(false); - return -1; - } -} - -void Condition::get_children(std::vector>* output) const { - if (src0) { - output->push_back(src0); - } - - if (src1) { - output->push_back(src1); - } -} - -void Condition::invert() { - switch (kind) { - case NOT_EQUAL: - kind = EQUAL; - break; - case EQUAL: - kind = NOT_EQUAL; - break; - case LESS_THAN_SIGNED: - kind = GEQ_SIGNED; - break; - case GREATER_THAN_SIGNED: - kind = LEQ_SIGNED; - break; - case LEQ_SIGNED: - kind = GREATER_THAN_SIGNED; - break; - case GEQ_SIGNED: - kind = LESS_THAN_SIGNED; - break; - case GREATER_THAN_ZERO_SIGNED: - kind = LEQ_ZERO_SIGNED; - break; - case LEQ_ZERO_SIGNED: - kind = GREATER_THAN_ZERO_SIGNED; - break; - case LESS_THAN_ZERO: - kind = GEQ_ZERO_SIGNED; - break; - case GEQ_ZERO_SIGNED: - kind = LESS_THAN_ZERO; - break; - case LESS_THAN_UNSIGNED: - kind = GEQ_UNSIGNED; - break; - case GREATER_THAN_UNSIGNED: - kind = LEQ_UNSIGNED; - break; - case LEQ_UNSIGNED: - kind = GREATER_THAN_UNSIGNED; - break; - case GEQ_UNSIGNED: - kind = LESS_THAN_UNSIGNED; - break; - case ZERO: - kind = NONZERO; - break; - case NONZERO: - kind = ZERO; - break; - case FALSE: - kind = TRUTHY; - break; - case TRUTHY: - kind = FALSE; - break; - case ALWAYS: - kind = NEVER; - break; - case NEVER: - kind = ALWAYS; - break; - case FLOAT_EQUAL: - kind = FLOAT_NOT_EQUAL; - break; - case FLOAT_NOT_EQUAL: - kind = FLOAT_EQUAL; - break; - case FLOAT_LESS_THAN: - kind = FLOAT_GEQ; - break; - case FLOAT_GEQ: - kind = FLOAT_LESS_THAN; - break; - case FLOAT_GREATER_THAN: - kind = FLOAT_LEQ; - break; - case FLOAT_LEQ: - kind = FLOAT_GREATER_THAN; - break; - default: - ASSERT(false); - } -} - -goos::Object Condition::to_form(const LinkedObjectFile& file) const { - int nargs = num_args(); - std::string condtion_operator; - switch (kind) { - case NOT_EQUAL: - condtion_operator = "!="; - break; - case EQUAL: - condtion_operator = "="; - break; - case LESS_THAN_SIGNED: - condtion_operator = "<.si"; - break; - case LESS_THAN_UNSIGNED: - condtion_operator = "<.ui"; - break; - case GREATER_THAN_SIGNED: - condtion_operator = ">.si"; - break; - case GREATER_THAN_UNSIGNED: - condtion_operator = ">.ui"; - break; - case LEQ_SIGNED: - condtion_operator = "<=.si"; - break; - case GEQ_SIGNED: - condtion_operator = ">=.si"; - break; - case LEQ_UNSIGNED: - condtion_operator = "<=.ui"; - break; - case GEQ_UNSIGNED: - condtion_operator = ">=.ui"; - break; - case ZERO: - condtion_operator = "zero?"; - break; - case NONZERO: - condtion_operator = "nonzero?"; - break; - case FALSE: - condtion_operator = "not"; - break; - case TRUTHY: - condtion_operator = ""; - break; - case ALWAYS: - condtion_operator = "'#t"; - break; - case NEVER: - condtion_operator = "'#f"; - break; - case FLOAT_EQUAL: - condtion_operator = "=.f"; - break; - case FLOAT_NOT_EQUAL: - condtion_operator = "!=.f"; - break; - case FLOAT_LESS_THAN: - condtion_operator = "<.f"; - break; - case FLOAT_GEQ: - condtion_operator = ">=.f"; - break; - case FLOAT_GREATER_THAN: - condtion_operator = ">.f"; - break; - case FLOAT_LEQ: - condtion_operator = "<=.f"; - break; - case GREATER_THAN_ZERO_SIGNED: - condtion_operator = ">0.si"; - break; - case GEQ_ZERO_SIGNED: - condtion_operator = ">=0.si"; - break; - case LESS_THAN_ZERO: - condtion_operator = "<0.si"; - break; - case LEQ_ZERO_SIGNED: - condtion_operator = "<=0.si"; - break; - default: - ASSERT(false); - } - - if (nargs == 2) { - return pretty_print::build_list(pretty_print::to_symbol(condtion_operator), src0->to_form(file), - src1->to_form(file)); - } else if (nargs == 1) { - if (condtion_operator.empty()) { - return src0->to_form(file); - } else { - return pretty_print::build_list(pretty_print::to_symbol(condtion_operator), - src0->to_form(file)); - } - } else if (nargs == 0) { - return pretty_print::to_symbol(condtion_operator); - } else { - ASSERT(false); - return {}; - } -} - -goos::Object IR_Branch::to_form(const LinkedObjectFile& file) const { - return pretty_print::build_list( - pretty_print::to_symbol(likely ? "bl!" : "b!"), condition.to_form(file), - pretty_print::to_symbol(file.get_label_name(dest_label_idx)), branch_delay.to_form(file)); -} - -void IR_Branch::get_children(std::vector>* output) const { - condition.get_children(output); - branch_delay.get_children(output); -} - -void IR_Branch_Atomic::update_reginfo_self(int n_dest, int n_src, int n_clobber) { - // first, grab from condition - for (auto& x : {condition.src0, condition.src1}) { - auto as_reg = dynamic_cast(x.get()); - if (as_reg) { - read_regs.push_back(as_reg->reg); - } - } - - auto as_reg = dynamic_cast(condition.clobber.get()); - if (as_reg) { - clobber_regs.push_back(as_reg->reg); - } - ASSERT(int(write_regs.size()) == n_dest); - ASSERT(int(read_regs.size()) == n_src); - ASSERT(int(clobber_regs.size()) == n_clobber); - - // copy from branch delay - read_regs.insert(read_regs.end(), branch_delay.read_regs.begin(), branch_delay.read_regs.end()); - write_regs.insert(write_regs.end(), branch_delay.write_regs.begin(), - branch_delay.write_regs.end()); - clobber_regs.insert(clobber_regs.end(), branch_delay.clobber_regs.begin(), - branch_delay.clobber_regs.end()); - - reg_info_set = true; -} - -goos::Object IR_Compare::to_form(const LinkedObjectFile& file) const { - return condition.to_form(file); -} - -void IR_Compare::get_children(std::vector>* output) const { - condition.get_children(output); -} - -goos::Object IR_Suspend_Atomic::to_form(const LinkedObjectFile& file) const { - (void)file; - return pretty_print::build_list("suspend!"); -} - -void IR_Nop::get_children(std::vector>* output) const { - (void)output; -} - -void IR_Suspend_Atomic::get_children(std::vector>* output) const { - (void)output; -} - -goos::Object IR_Breakpoint_Atomic::to_form(const LinkedObjectFile& file) const { - (void)file; - return pretty_print::build_list("breakpoint!"); -} - -void IR_Breakpoint_Atomic::get_children(std::vector>* output) const { - (void)output; -} - -goos::Object IR_AsmOp::to_form(const LinkedObjectFile& file) const { - std::vector forms; - forms.push_back(pretty_print::to_symbol(name)); - for (auto& x : {dst, src0, src1, src2}) { - if (x) { - forms.push_back(x->to_form(file)); - } - } - return pretty_print::build_list(forms); -} - -void IR_AsmOp::get_children(std::vector>* output) const { - for (auto& x : {dst, src0, src1}) { - if (x) { - output->push_back(x); - } - } -} - -void IR_AsmOp_Atomic::set_reg_info() { - auto dst_as_reg = dynamic_cast(dst.get()); - if (dst_as_reg) { - write_regs.push_back(dst_as_reg->reg); - } - - for (auto& x : {src0, src1, src2}) { - auto src_as_reg = dynamic_cast(x.get()); - if (src_as_reg) { - read_regs.push_back(src_as_reg->reg); - } - } - - reg_info_set = true; -} - -goos::Object IR_CMoveF::to_form(const LinkedObjectFile& file) const { - return pretty_print::build_list( - pretty_print::to_symbol(on_zero ? "cmove-false-on-zero" : "cmove-false-on-nonzero"), - src->to_form(file)); -} - -void IR_CMoveF::get_children(std::vector>* output) const { - output->push_back(src); -} - -goos::Object IR_AsmReg::to_form(const LinkedObjectFile& file) const { - (void)file; - switch (kind) { - case VU_Q: - return pretty_print::to_symbol("Q"); - case VU_ACC: - return pretty_print::to_symbol("ACC"); - default: - ASSERT(false); - return {}; - } -} - -void IR_AsmReg::get_children(std::vector>* output) const { - (void)output; -} - -} // namespace decompiler \ No newline at end of file diff --git a/decompiler/IR/IR.h b/decompiler/IR/IR.h deleted file mode 100644 index a6c30be9d2..0000000000 --- a/decompiler/IR/IR.h +++ /dev/null @@ -1,454 +0,0 @@ -#pragma once - -#ifndef JAK_IR_H -#define JAK_IR_H - -#include -#include -#include -#include -#include "decompiler/Disasm/Register.h" -#include "common/type_system/TypeSpec.h" -#include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/util/TP_Type.h" -#include "common/util/Assert.h" - -namespace goos { -class Object; -} - -namespace decompiler { -class LinkedObjectFile; -class DecompilerTypeSystem; -class ExpressionStack; - -class IR { - public: - virtual goos::Object to_form(const LinkedObjectFile& file) const = 0; - std::vector> get_all_ir(LinkedObjectFile& file) const; - std::string print(const LinkedObjectFile& file) const; - virtual void get_children(std::vector>* output) const = 0; - bool is_basic_op = false; - virtual ~IR() = default; -}; - -class IR_Atomic : public virtual IR { - public: - std::vector read_regs, write_regs, clobber_regs; - std::unordered_set consumed, written_and_unused; - bool reg_info_set = false; - - TypeState end_types; // types at the end of this instruction - std::vector warnings; - void warn(const std::string& str) { warnings.emplace_back(str); } -}; - -class IR_Failed : public virtual IR { - public: - IR_Failed() = default; - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_Failed_Atomic : public IR_Failed, public IR_Atomic { - public: - IR_Failed_Atomic() = default; -}; - -class IR_Register : public virtual IR { - public: - IR_Register(Register _reg, int _instr_idx) : reg(_reg), instr_idx(_instr_idx) {} - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; - Register reg; - int instr_idx = -1; -}; - -class IR_Set : public virtual IR { - public: - enum Kind { - REG_64, - LOAD, - STORE, - SYM_LOAD, - SYM_STORE, - FPR_TO_GPR64, - GPR_TO_FPR, - REG_FLT, - REG_I128, - EXPR - } kind; - IR_Set(Kind _kind, std::shared_ptr _dst, std::shared_ptr _src) - : kind(_kind), dst(std::move(_dst)), src(std::move(_src)) {} - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; - - std::shared_ptr dst, src; - std::shared_ptr clobber = nullptr; -}; - -// todo -class IR_Set_Atomic : public IR_Set, public IR_Atomic { - public: - IR_Set_Atomic(IR_Set::Kind _kind, std::shared_ptr _dst, std::shared_ptr _src) - : IR_Set(_kind, std::move(_dst), std::move(_src)) {} - - template - void update_reginfo_self(int n_dest, int n_src, int n_clobber); - void update_reginfo_regreg(); -}; - -class IR_IntMath2; -template <> -void IR_Set_Atomic::update_reginfo_self(int n_dest, int n_src, int n_clobber); - -class IR_Store : public virtual IR_Set { - public: - enum class Kind { INTEGER, FLOAT } kind; - IR_Store(Kind _kind, std::shared_ptr _dst, std::shared_ptr _src, int _size) - : IR_Set(IR_Set::STORE, std::move(_dst), std::move(_src)), kind(_kind), size(_size) {} - int size; - goos::Object to_form(const LinkedObjectFile& file) const override; -}; - -/*! - * Note, IR_Store_Atomic does not appear as a IR_Set_Atomic. - * This is to avoid the "diamond problem". - */ -class IR_Store_Atomic : public IR_Set_Atomic { - public: - enum class Kind { INTEGER, FLOAT } kind; - IR_Store_Atomic(Kind _kind, std::shared_ptr _dst, std::shared_ptr _src, int _size) - : IR_Set_Atomic(IR_Set::STORE, std::move(_dst), std::move(_src)), kind(_kind), size(_size) {} - int size; - goos::Object to_form(const LinkedObjectFile& file) const override; - void update_reginfo_self(int n_dest, int n_src, int n_clobber); -}; - -class IR_Symbol : public virtual IR { - public: - explicit IR_Symbol(std::string _name) : name(std::move(_name)) {} - std::string name; - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_SymbolValue : public virtual IR { - public: - explicit IR_SymbolValue(std::string _name) : name(std::move(_name)) {} - std::string name; - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_EmptyPair : public virtual IR { - public: - explicit IR_EmptyPair() = default; - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_StaticAddress : public virtual IR { - public: - explicit IR_StaticAddress(int _label_id) : label_id(_label_id) {} - int label_id = -1; - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_Load : public virtual IR { - public: - enum Kind { UNSIGNED, SIGNED, FLOAT } kind; - - IR_Load(Kind _kind, int _size, std::shared_ptr _location) - : kind(_kind), size(_size), location(std::move(_location)) {} - int size; - std::shared_ptr location; - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; - - // this load_path stuff is just for debugging and shouldn't be used as part of the real - // decompilation. - void clear_load_path() { - load_path_set = false; - load_path_addr_of = false; - load_path.clear(); - load_path_base = nullptr; - } - std::shared_ptr load_path_base = nullptr; - bool load_path_set = false; - bool load_path_addr_of = false; - std::vector load_path; -}; - -class IR_FloatMath2 : public virtual IR { - public: - enum Kind { DIV, MUL, ADD, SUB, MIN, MAX } kind; - IR_FloatMath2(Kind _kind, std::shared_ptr _arg0, std::shared_ptr _arg1) - : kind(_kind), arg0(std::move(_arg0)), arg1(std::move(_arg1)) {} - std::shared_ptr arg0, arg1; - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_FloatMath1 : public virtual IR { - public: - enum Kind { FLOAT_TO_INT, INT_TO_FLOAT, ABS, NEG, SQRT } kind; - IR_FloatMath1(Kind _kind, std::shared_ptr _arg) : kind(_kind), arg(std::move(_arg)) {} - std::shared_ptr arg; - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_IntMath2 : public virtual IR { - public: - enum Kind { - ADD, - SUB, - MUL_SIGNED, - DIV_SIGNED, - MOD_SIGNED, - DIV_UNSIGNED, - MOD_UNSIGNED, - OR, - AND, - NOR, - XOR, - LEFT_SHIFT, - RIGHT_SHIFT_ARITH, - RIGHT_SHIFT_LOGIC, - MUL_UNSIGNED, - MIN_SIGNED, - MAX_SIGNED - } kind; - IR_IntMath2(Kind _kind, std::shared_ptr _arg0, std::shared_ptr _arg1) - : kind(_kind), arg0(std::move(_arg0)), arg1(std::move(_arg1)) {} - std::shared_ptr arg0, arg1; - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_IntMath1 : public virtual IR { - public: - enum Kind { NOT, ABS, NEG } kind; - IR_IntMath1(Kind _kind, std::shared_ptr _arg) : kind(_kind), arg(std::move(_arg)) {} - IR_IntMath1(Kind _kind, std::shared_ptr _arg, std::shared_ptr _abs_op) - : kind(_kind), arg(std::move(_arg)), abs_op(std::move(_abs_op)) { - ASSERT(abs_op); - } - std::shared_ptr arg; - std::shared_ptr abs_op = nullptr; - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_Call : public virtual IR { - public: - IR_Call() = default; - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; - std::vector> args; - TypeSpec call_type; - bool call_type_set = false; -}; - -// todo -class IR_Call_Atomic : public virtual IR_Call, public IR_Atomic { - public: - IR_Call_Atomic() = default; -}; - -class IR_IntegerConstant : public virtual IR { - public: - int64_t value; - explicit IR_IntegerConstant(int64_t _value) : value(_value) {} - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -struct BranchDelay { - enum Kind { - NOP, - SET_REG_FALSE, - SET_REG_TRUE, - SET_REG_REG, - SET_BINTEGER, - SET_PAIR, - DSLLV, - NEGATE, - UNKNOWN - } kind; - std::shared_ptr destination = nullptr, source = nullptr, source2 = nullptr; - explicit BranchDelay(Kind _kind) : kind(_kind) {} - goos::Object to_form(const LinkedObjectFile& file) const; - void get_children(std::vector>* output) const; - - std::vector read_regs; - std::vector write_regs; - std::vector clobber_regs; - - void type_prop(TypeState& output, const LinkedObjectFile& file, DecompilerTypeSystem& dts); -}; - -struct Condition { - enum Kind { - NOT_EQUAL, - EQUAL, - LESS_THAN_SIGNED, - GREATER_THAN_SIGNED, - LEQ_SIGNED, - GEQ_SIGNED, - GREATER_THAN_ZERO_SIGNED, - LEQ_ZERO_SIGNED, - LESS_THAN_ZERO, - GEQ_ZERO_SIGNED, - LESS_THAN_UNSIGNED, - GREATER_THAN_UNSIGNED, - LEQ_UNSIGNED, - GEQ_UNSIGNED, - ZERO, - NONZERO, - FALSE, - TRUTHY, - ALWAYS, - NEVER, - FLOAT_EQUAL, - FLOAT_NOT_EQUAL, - FLOAT_LESS_THAN, - FLOAT_GEQ, - FLOAT_LEQ, - FLOAT_GREATER_THAN, - } kind; - - Condition(Kind _kind, - std::shared_ptr _src0, - std::shared_ptr _src1, - std::shared_ptr _clobber) - : kind(_kind), src0(std::move(_src0)), src1(std::move(_src1)), clobber(std::move(_clobber)) { - int nargs = num_args(); - if (nargs == 2) { - ASSERT(src0 && src1); - } else if (nargs == 1) { - ASSERT(src0 && !src1); - } else if (nargs == 0) { - ASSERT(!src0 && !src1); - } - } - - int num_args() const; - goos::Object to_form(const LinkedObjectFile& file) const; - std::shared_ptr src0, src1, clobber; - void get_children(std::vector>* output) const; - void invert(); -}; - -class IR_Branch : public virtual IR { - public: - IR_Branch(Condition _condition, int _dest_label_idx, BranchDelay _branch_delay, bool _likely) - : condition(std::move(_condition)), - dest_label_idx(_dest_label_idx), - branch_delay(std::move(_branch_delay)), - likely(_likely) {} - - Condition condition; - int dest_label_idx; - BranchDelay branch_delay; - bool likely; - - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -// todo -class IR_Branch_Atomic : public virtual IR_Branch, public IR_Atomic { - public: - IR_Branch_Atomic(Condition _condition, - int _dest_label_idx, - BranchDelay _branch_delay, - bool _likely) - : IR_Branch(std::move(_condition), _dest_label_idx, std::move(_branch_delay), _likely) {} - // note - counts only for the condition. - void update_reginfo_self(int n_dst, int n_src, int n_clobber); -}; - -class IR_Compare : public virtual IR { - public: - explicit IR_Compare(Condition _condition, IR_Atomic* _root_op) - : condition(std::move(_condition)), root_op(_root_op) {} - - Condition condition; - - // the basic op that the comparison comes from. If the condition is "ALWAYS", this may be null. - // if this is the source of an IR_Set_Atomic, this may also be null. This should only be used - // from IR_Compare's expression_stack, when the IR_Compare is being used as a branch condition, - // and not as a literal #f/#t that's being assigned. - IR_Atomic* root_op = nullptr; - - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_Nop : public virtual IR { - public: - IR_Nop() = default; - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_Nop_Atomic : public IR_Nop, public IR_Atomic { - public: - IR_Nop_Atomic() = default; -}; - -class IR_Suspend_Atomic : public virtual IR, public IR_Atomic { - public: - IR_Suspend_Atomic() = default; - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_Breakpoint_Atomic : public virtual IR_Atomic { - public: - IR_Breakpoint_Atomic() = default; - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_AsmOp : public virtual IR { - public: - std::shared_ptr dst = nullptr; - std::shared_ptr src0 = nullptr; - std::shared_ptr src1 = nullptr; - std::shared_ptr src2 = nullptr; - std::string name; - IR_AsmOp(std::string _name) : name(std::move(_name)) {} - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_AsmOp_Atomic : public virtual IR_AsmOp, public IR_Atomic { - public: - IR_AsmOp_Atomic(std::string _name) : IR_AsmOp(std::move(_name)) {} - void set_reg_info(); -}; - -class IR_CMoveF : public virtual IR { - public: - std::shared_ptr src = nullptr; - bool on_zero = false; - explicit IR_CMoveF(std::shared_ptr _src, bool _on_zero) - : src(std::move(_src)), on_zero(_on_zero) {} - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -class IR_AsmReg : public virtual IR { - public: - enum Kind { VU_Q, VU_ACC } kind; - explicit IR_AsmReg(Kind _kind) : kind(_kind) {} - goos::Object to_form(const LinkedObjectFile& file) const override; - void get_children(std::vector>* output) const override; -}; - -} // namespace decompiler -#endif // JAK_IR_H diff --git a/decompiler/IR2/AtomicOp.cpp b/decompiler/IR2/AtomicOp.cpp index ea68a0e026..72f19106df 100644 --- a/decompiler/IR2/AtomicOp.cpp +++ b/decompiler/IR2/AtomicOp.cpp @@ -1,14 +1,19 @@ -#include -#include -#include "common/goal_constants.h" -#include "third-party/fmt/core.h" -#include "common/goos/PrettyPrinter.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" #include "AtomicOp.h" -#include "OpenGoalMapping.h" + +#include +#include + #include "Form.h" +#include "OpenGoalMapping.h" + +#include "common/goal_constants.h" +#include "common/goos/PrettyPrinter.h" #include "common/util/Assert.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" + +#include "third-party/fmt/core.h" + namespace decompiler { ///////////////////////////// // VARIABLE @@ -1837,4 +1842,44 @@ RegisterAccess StackSpillLoadOp::get_set_destination() const { throw std::runtime_error("StackSpillLoadOp cannot be treated as a set! operation"); } +bool is_op_2(AtomicOp* op, + MatchParam kind, + MatchParam dst, + MatchParam src0, + Register* dst_out, + Register* src0_out) { + // should be a set reg to int math 2 ir + auto set = dynamic_cast(op); + if (!set) { + return false; + } + + // destination should be a register + auto dest = set->dst(); + if (dst != dest.reg()) { + return false; + } + + auto math = set->src(); + if (kind != math.kind()) { + return false; + } + + auto arg = math.get_arg(0); + + if (!arg.is_var() || src0 != arg.var().reg()) { + return false; + } + + // it's a match! + if (dst_out) { + *dst_out = dest.reg(); + } + + if (src0_out) { + *src0_out = arg.var().reg(); + } + + return true; +} } // namespace decompiler diff --git a/decompiler/IR2/AtomicOp.h b/decompiler/IR2/AtomicOp.h index b2fd838368..7b84193768 100644 --- a/decompiler/IR2/AtomicOp.h +++ b/decompiler/IR2/AtomicOp.h @@ -1,15 +1,19 @@ #pragma once -#include #include +#include #include -#include "common/goos/Object.h" -#include "decompiler/Disasm/Register.h" -#include "decompiler/Disasm/Instruction.h" -#include "decompiler/IR2/IR2_common.h" + #include "Env.h" + +#include "common/goos/Object.h" #include "common/util/Assert.h" +#include "decompiler/Disasm/Instruction.h" +#include "decompiler/Disasm/Register.h" +#include "decompiler/IR2/IR2_common.h" +#include "decompiler/util/MatchParam.h" + namespace decompiler { class FormElement; class ConditionElement; @@ -804,4 +808,11 @@ class StackSpillLoadOp : public AtomicOp { }; bool get_as_reg_offset(const SimpleExpression& expr, IR2_RegOffset* out); + +bool is_op_2(AtomicOp* op, + MatchParam kind, + MatchParam dst, + MatchParam src0, + Register* dst_out = nullptr, + Register* src0_out = nullptr); } // namespace decompiler diff --git a/decompiler/IR2/AtomicOpForm.cpp b/decompiler/IR2/AtomicOpForm.cpp index 9b8ec33f85..d3c3509f0a 100644 --- a/decompiler/IR2/AtomicOpForm.cpp +++ b/decompiler/IR2/AtomicOpForm.cpp @@ -1,10 +1,12 @@ #include "AtomicOp.h" #include "Form.h" + #include "common/type_system/TypeSystem.h" -#include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "decompiler/util/data_decompile.h" + #include "decompiler/IR2/bitfields.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "decompiler/util/DecompilerTypeSystem.h" +#include "decompiler/util/data_decompile.h" namespace decompiler { @@ -65,7 +67,7 @@ FormElement* SetVarOp::get_as_form(FormPool& pool, const Env& env) const { } } else { // access a field - auto arg0_type = env.get_types_before_op(m_my_idx).get(m_src.get_arg(0).var().reg()); + const auto& arg0_type = env.get_types_before_op(m_my_idx).get(m_src.get_arg(0).var().reg()); if (arg0_type.kind == TP_Type::Kind::TYPESPEC) { FieldReverseLookupInput rd_in; rd_in.deref = std::nullopt; @@ -524,8 +526,8 @@ FormElement* make_label_load(int label_idx, if (as_bitfield && load_kind != LoadVarOp::Kind::FLOAT && load_size == 8) { // get the data ASSERT((label.offset % 8) == 0); - auto word0 = env.file->words_by_seg.at(label.target_segment).at(label.offset / 4); - auto word1 = env.file->words_by_seg.at(label.target_segment).at(1 + (label.offset / 4)); + auto& word0 = env.file->words_by_seg.at(label.target_segment).at(label.offset / 4); + auto& word1 = env.file->words_by_seg.at(label.target_segment).at(1 + (label.offset / 4)); ASSERT(word0.kind() == LinkedWord::PLAIN_DATA); ASSERT(word1.kind() == LinkedWord::PLAIN_DATA); u64 value; diff --git a/decompiler/IR2/AtomicOpTypeAnalysis.cpp b/decompiler/IR2/AtomicOpTypeAnalysis.cpp index 6c294b10cc..3cf35adaa7 100644 --- a/decompiler/IR2/AtomicOpTypeAnalysis.cpp +++ b/decompiler/IR2/AtomicOpTypeAnalysis.cpp @@ -1,14 +1,17 @@ -#include "third-party/fmt/core.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "common/log/log.h" #include "AtomicOp.h" -#include "decompiler/util/TP_Type.h" -#include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/IR2/bitfields.h" + +#include "common/log/log.h" #include "common/type_system/state.h" #include "common/util/BitUtils.h" + +#include "decompiler/IR2/bitfields.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "decompiler/util/DecompilerTypeSystem.h" +#include "decompiler/util/TP_Type.h" #include "decompiler/util/goal_constants.h" +#include "third-party/fmt/core.h" + namespace decompiler { namespace { @@ -185,6 +188,11 @@ TP_Type SimpleExpression::get_type(const TypeState& input, // GOAL is smart enough to use binary 0b0 as floating point 0. return TP_Type::make_from_ts("float"); } + // new for jak 2: + if (env.version == GameVersion::Jak2 && in_type.is_integer_constant() && + in_type.get_integer_constant() <= UINT32_MAX) { + return TP_Type::make_from_ts("float"); + } return in_type; } case Kind::FPR_TO_GPR: @@ -395,6 +403,9 @@ TP_Type SimpleExpression::get_type_int2(const TypeState& input, } if (m_kind == Kind::RIGHT_SHIFT_ARITH) { + if (env.version == GameVersion::Jak2 && arg0_type.typespec().base_type() == "float") { + return TP_Type::make_from_ts(TypeSpec("float")); + } return TP_Type::make_from_ts(TypeSpec("int")); } } break; diff --git a/decompiler/IR2/Env.cpp b/decompiler/IR2/Env.cpp index 0884636b59..b520dbc952 100644 --- a/decompiler/IR2/Env.cpp +++ b/decompiler/IR2/Env.cpp @@ -1,13 +1,17 @@ +#include "Env.h" + +#include #include #include -#include -#include "decompiler/util/DecompilerTypeSystem.h" -#include "Env.h" + #include "Form.h" -#include "decompiler/analysis/atomic_op_builder.h" + #include "common/goos/PrettyPrinter.h" #include "common/util/math_util.h" +#include "decompiler/analysis/atomic_op_builder.h" +#include "decompiler/util/DecompilerTypeSystem.h" + namespace decompiler { constexpr const char* reg_names[] = {"a0-0", "a1-0", "a2-0", "a3-0", @@ -566,4 +570,20 @@ void Env::set_stack_structure_hints(const std::vector& hints } } +std::optional Env::get_art_elt_name(int idx) const { + ASSERT(dts); + auto it = dts->art_group_info.find(art_group()); + if (it == dts->art_group_info.end()) { + return {}; + } else { + const auto& art_group = it->second; + auto it2 = art_group.find(idx); + if (it2 == art_group.end()) { + return {}; + } else { + return it2->second; + } + } +} + } // namespace decompiler diff --git a/decompiler/IR2/Env.h b/decompiler/IR2/Env.h index 445db5ec52..c577d44d06 100644 --- a/decompiler/IR2/Env.h +++ b/decompiler/IR2/Env.h @@ -2,14 +2,16 @@ #include #include + #include "common/goos/Object.h" -#include "decompiler/util/TP_Type.h" -#include "decompiler/util/StackSpillMap.h" +#include "common/util/Assert.h" + #include "decompiler/Disasm/Register.h" #include "decompiler/IR2/IR2_common.h" #include "decompiler/analysis/reg_usage.h" #include "decompiler/config.h" -#include "common/util/Assert.h" +#include "decompiler/util/StackSpillMap.h" +#include "decompiler/util/TP_Type.h" namespace decompiler { class LinkedObjectFile; @@ -56,6 +58,7 @@ struct FunctionVariableDefinitions { */ class Env { public: + GameVersion version = GameVersion::Jak1; bool types_succeeded = false; bool has_local_vars() const { return m_has_local_vars; } bool has_type_analysis() const { return m_has_types; } @@ -150,6 +153,10 @@ class Env { const std::unordered_map& stack_casts() const { return m_stack_typecasts; } + void set_art_group(const std::string& art_group) { m_art_group = art_group; } + const std::string& art_group() const { return m_art_group; } + std::optional get_art_elt_name(int idx) const; + void set_remap_for_function(const TypeSpec& ts); void set_remap_for_method(const TypeSpec& ts); void set_remap_for_new_method(const TypeSpec& ts); @@ -233,5 +240,7 @@ class Env { std::optional m_type_analysis_return_type; StackSpillMap m_stack_spill_map; + + std::string m_art_group; }; } // namespace decompiler diff --git a/decompiler/IR2/ExpressionHelpers.cpp b/decompiler/IR2/ExpressionHelpers.cpp index 4db004b0e5..abbee45fca 100644 --- a/decompiler/IR2/ExpressionHelpers.cpp +++ b/decompiler/IR2/ExpressionHelpers.cpp @@ -1,9 +1,11 @@ #include "ExpressionHelpers.h" -#include "decompiler/IR2/Form.h" -#include "decompiler/IR2/Env.h" + #include "common/goal_constants.h" -#include "decompiler/IR2/GenericElementMatcher.h" + +#include "decompiler/IR2/Env.h" +#include "decompiler/IR2/Form.h" #include "decompiler/IR2/FormStack.h" +#include "decompiler/IR2/GenericElementMatcher.h" namespace decompiler { diff --git a/decompiler/IR2/Form.cpp b/decompiler/IR2/Form.cpp index f4559f169c..81f0d6320a 100644 --- a/decompiler/IR2/Form.cpp +++ b/decompiler/IR2/Form.cpp @@ -2,13 +2,15 @@ #include #include -#include "decompiler/ObjectFile/LinkedObjectFile.h" + #include "common/goos/PrettyPrinter.h" #include "common/type_system/TypeSystem.h" +#include "common/util/print_float.h" + +#include "decompiler/ObjectFile/LinkedObjectFile.h" #include "decompiler/util/DecompilerTypeSystem.h" #include "decompiler/util/data_decompile.h" #include "decompiler/util/sparticle_decompile.h" -#include "common/util/print_float.h" namespace decompiler { @@ -626,8 +628,8 @@ goos::Object TranslatedAsmBranch::to_form_internal(const Env& env) const { if (m_branch_delay) { if (m_branch_delay->parent_element != this) { - fmt::print("bad ptr. Parent is {}\n", m_branch_delay->parent_element->to_string(env)); - ASSERT(false); + ASSERT_MSG(false, fmt::format("bad ptr. Parent is {}", + m_branch_delay->parent_element->to_string(env))); } ASSERT(m_branch_delay->parent_element->parent_form); @@ -667,8 +669,8 @@ void TranslatedAsmBranch::collect_vars(RegAccessSet& vars, bool recursive) const m_branch_condition->collect_vars(vars, recursive); if (m_branch_delay) { if (m_branch_delay->parent_element != this) { - fmt::print("bad ptr. Parent is {}\n", (void*)m_branch_delay->parent_element); - ASSERT(false); + ASSERT_MSG(false, + fmt::format("bad ptr. Parent is {}", (void*)m_branch_delay->parent_element)); } for (auto& elt : m_branch_delay->elts()) { @@ -1180,8 +1182,13 @@ void WhileElement::apply(const std::function& f) { goos::Object WhileElement::to_form_internal(const Env& env) const { std::vector list; - list.push_back(pretty_print::to_symbol("while")); - list.push_back(condition->to_form_as_condition(env)); + auto cond = condition->to_form_as_condition(env); + if (cond == pretty_print::to_symbol("#t")) { + list.push_back(pretty_print::to_symbol("loop")); + } else { + list.push_back(pretty_print::to_symbol("while")); + list.push_back(condition->to_form_as_condition(env)); + } body->inline_forms(list, env); return pretty_print::build_list(list); } @@ -1764,6 +1771,8 @@ std::string fixed_operator_to_string(FixedOperatorKind kind) { return "logior!"; case FixedOperatorKind::LOGXOR: return "logxor"; + case FixedOperatorKind::LOGXOR_IN_PLACE: + return "logxor!"; case FixedOperatorKind::LOGNOR: return "lognor"; case FixedOperatorKind::LOGNOT: @@ -2460,7 +2469,6 @@ void DecompiledDataElement::do_decomp(const Env& env, const LinkedObjectFile* fi if (m_label_info) { m_description = decompile_at_label_with_hint(*m_label_info, m_label, env.file->labels, env.file->words_by_seg, *env.dts, file); - } else { m_description = decompile_at_label_guess_type(m_label, env.file->labels, env.file->words_by_seg, env.dts->ts, file); @@ -2485,6 +2493,10 @@ void LetElement::make_let_star() { m_star = true; } +void LetElement::clear_let_star() { + m_star = false; +} + goos::Object LetElement::to_form_internal(const Env& env) const { std::vector outer = {pretty_print::to_symbol(m_star ? "let*" : "let")}; @@ -2985,16 +2997,35 @@ void DefskelgroupElement::get_modified_regs(RegSet& regs) const { goos::Object DefskelgroupElement::to_form_internal(const Env& env) const { std::vector forms; - forms.push_back( - pretty_print::to_symbol(fmt::format("defskelgroup {} {}", m_name, m_static_info.art_name))); - forms.push_back(m_info.jgeo->to_form(env)); - forms.push_back(m_info.janim->to_form(env)); + forms.push_back(pretty_print::to_symbol("defskelgroup")); + forms.push_back(pretty_print::to_symbol(m_name)); + forms.push_back(pretty_print::to_symbol(m_static_info.art_name)); + const auto& art = env.dts->art_group_info.find(m_static_info.art_name + "-ag"); + bool has_art = art != env.dts->art_group_info.end(); + auto jg = m_info.jgeo->to_form(env); + if (jg.is_int() && has_art && art->second.count(jg.as_int())) { + forms.push_back(pretty_print::to_symbol(art->second.at(jg.as_int()))); + } else { + forms.push_back(jg); + } + auto ja = m_info.janim->to_form(env); + if (ja.is_int() && has_art && art->second.count(ja.as_int())) { + forms.push_back(pretty_print::to_symbol(art->second.at(ja.as_int()))); + } else { + forms.push_back(ja); + } std::vector lod_forms; for (const auto& e : m_info.lods) { auto f_dist = pretty_print::to_symbol( fmt::format("(meters {})", meters_to_string(e.lod_dist->to_form(env).as_float()))); - lod_forms.push_back(pretty_print::build_list(e.mgeo->to_form(env), f_dist)); + auto mg = e.mgeo->to_form(env); + if (mg.is_int() && has_art && art->second.count(mg.as_int())) { + lod_forms.push_back( + pretty_print::build_list(pretty_print::to_symbol(art->second.at(mg.as_int())), f_dist)); + } else { + lod_forms.push_back(pretty_print::build_list(mg, f_dist)); + } } forms.push_back(pretty_print::build_list(lod_forms)); @@ -3002,11 +3033,19 @@ goos::Object DefskelgroupElement::to_form_internal(const Env& env) const { ":bounds (static-spherem {} {} {} {})", meters_to_string(m_static_info.bounds.x()), meters_to_string(m_static_info.bounds.y()), meters_to_string(m_static_info.bounds.z()), meters_to_string(m_static_info.bounds.w())))); - forms.push_back(pretty_print::to_symbol( - fmt::format(":longest-edge (meters {})", meters_to_string(m_static_info.longest_edge)))); + + if (m_static_info.longest_edge != 0) { + forms.push_back(pretty_print::to_symbol( + fmt::format(":longest-edge (meters {})", meters_to_string(m_static_info.longest_edge)))); + } if (m_static_info.shadow != 0) { - forms.push_back(pretty_print::to_symbol(fmt::format(":shadow {}", m_static_info.shadow))); + if (has_art && art->second.count(m_static_info.shadow)) { + forms.push_back( + pretty_print::to_symbol(fmt::format(":shadow {}", art->second.at(m_static_info.shadow)))); + } else { + forms.push_back(pretty_print::to_symbol(fmt::format(":shadow {}", m_static_info.shadow))); + } } if (m_static_info.tex_level != 0) { forms.push_back( diff --git a/decompiler/IR2/Form.h b/decompiler/IR2/Form.h index 055ae21eba..e8d52a0f89 100644 --- a/decompiler/IR2/Form.h +++ b/decompiler/IR2/Form.h @@ -1,17 +1,19 @@ #pragma once -#include -#include -#include #include +#include +#include +#include + +#include "common/goos/Object.h" +#include "common/math/Vector.h" +#include "common/type_system/TypeSystem.h" +#include "common/type_system/state.h" + +#include "decompiler/Disasm/DecompilerLabel.h" #include "decompiler/Disasm/Register.h" #include "decompiler/IR2/AtomicOp.h" -#include "common/goos/Object.h" -#include "common/type_system/TypeSystem.h" -#include "decompiler/Disasm/DecompilerLabel.h" -#include "common/type_system/state.h" #include "decompiler/IR2/LabelDB.h" -#include "common/math/Vector.h" #include "decompiler/ObjectFile/LinkedWord.h" namespace decompiler { @@ -420,6 +422,10 @@ class SetFormFormElement : public FormElement { const Form* dst() const { return m_dst; } Form* src() { return m_src; } Form* dst() { return m_dst; } + const std::optional& cast_for_set() const { return m_cast_for_set; } + const std::optional& cast_for_define() const { return m_cast_for_define; } + void set_cast_for_set(const std::optional& ts) { m_cast_for_set = ts; } + void set_cast_for_define(const std::optional& ts) { m_cast_for_define = ts; } private: int m_real_push_count = 0; @@ -795,6 +801,7 @@ class UntilElement : public FormElement { bool allow_in_if() const override { return false; } Form* condition = nullptr; Form* body = nullptr; + std::optional false_destination; // used in jak 2, sometimes. }; /*! @@ -1025,6 +1032,8 @@ class GenericOperator { return m_condition_kind; } + bool is_func() const { return m_kind == Kind::FUNCTION_EXPR; } + const Form* func() const { ASSERT(m_kind == Kind::FUNCTION_EXPR); return m_function; @@ -1094,6 +1103,7 @@ class CastElement : public FormElement { const Form* source() const { return m_source; } void set_type(const TypeSpec& ts) { m_type = ts; } Form* source() { return m_source; } + bool numeric() const { return m_numeric; } private: TypeSpec m_type; @@ -1101,87 +1111,6 @@ class CastElement : public FormElement { bool m_numeric = false; // if true, use the. otherwise the-as }; -class DerefToken { - public: - enum class Kind { - INTEGER_CONSTANT, - INTEGER_EXPRESSION, // some form which evaluates to an integer index. Not offset, index. - FIELD_NAME, - EXPRESSION_PLACEHOLDER, - INVALID - }; - static DerefToken make_int_constant(s64 int_constant); - static DerefToken make_int_expr(Form* expr); - static DerefToken make_field_name(const std::string& name); - static DerefToken make_expr_placeholder(); - - void collect_vars(RegAccessSet& vars, bool recursive) const; - goos::Object to_form(const Env& env) const; - void apply(const std::function& f); - void apply_form(const std::function& f); - void get_modified_regs(RegSet& regs) const; - - bool is_field_name(const std::string& name) const { - return m_kind == Kind::FIELD_NAME && m_name == name; - } - - bool is_int(int x) const { return m_kind == Kind::INTEGER_CONSTANT && m_int_constant == x; } - - bool is_expr() const { return m_kind == Kind::INTEGER_EXPRESSION; } - - Kind kind() const { return m_kind; } - const std::string& field_name() const { - ASSERT(m_kind == Kind::FIELD_NAME); - return m_name; - } - - s64 int_constant() const { return m_int_constant; } - - Form* expr() { - ASSERT(m_kind == Kind::INTEGER_EXPRESSION); - return m_expr; - } - - private: - Kind m_kind = Kind::INVALID; - s64 m_int_constant = -1; - std::string m_name; - Form* m_expr = nullptr; -}; - -DerefToken to_token(const FieldReverseLookupOutput::Token& in); - -class DerefElement : public FormElement { - public: - DerefElement(Form* base, bool is_addr_of, DerefToken token); - DerefElement(Form* base, bool is_addr_of, std::vector tokens); - goos::Object to_form_internal(const Env& env) const override; - void apply(const std::function& f) override; - void apply_form(const std::function& f) override; - void collect_vars(RegAccessSet& vars, bool recursive) const override; - void update_from_stack(const Env& env, - FormPool& pool, - FormStack& stack, - std::vector* result, - bool allow_side_effects) override; - void get_modified_regs(RegSet& regs) const override; - - void inline_nested(); - - bool is_addr_of() const { return m_is_addr_of; } - const Form* base() const { return m_base; } - Form* base() { return m_base; } - const std::vector& tokens() const { return m_tokens; } - std::vector& tokens() { return m_tokens; } - void set_base(Form* new_base); - void set_addr_of(bool is_addr_of) { m_is_addr_of = is_addr_of; } - - private: - Form* m_base = nullptr; - bool m_is_addr_of = false; - std::vector m_tokens; -}; - class DynamicMethodAccess : public FormElement { public: explicit DynamicMethodAccess(RegisterAccess source); @@ -1200,40 +1129,6 @@ class DynamicMethodAccess : public FormElement { RegisterAccess m_source; }; -class ArrayFieldAccess : public FormElement { - public: - ArrayFieldAccess(RegisterAccess source, - const std::vector& deref_tokens, - int expected_stride, - int constant_offset, - bool flipped); - goos::Object to_form_internal(const Env& env) const override; - void apply(const std::function& f) override; - void apply_form(const std::function& f) override; - void collect_vars(RegAccessSet& vars, bool recursive) const override; - void update_from_stack(const Env& env, - FormPool& pool, - FormStack& stack, - std::vector* result, - bool allow_side_effects) override; - void get_modified_regs(RegSet& regs) const override; - - void update_with_val(Form* new_val, - const Env& env, - FormPool& pool, - std::vector* result, - bool allow_side_effects); - - bool flipped() const { return m_flipped; } - - private: - RegisterAccess m_source; - std::vector m_deref_tokens; - int m_expected_stride = -1; - int m_constant_offset = -1; - bool m_flipped = false; -}; - class GetMethodElement : public FormElement { public: GetMethodElement(Form* in, std::string name, bool is_object); @@ -1310,6 +1205,123 @@ class ConstantFloatElement : public FormElement { float m_value; }; +class DerefToken { + public: + enum class Kind { + INTEGER_CONSTANT, + INTEGER_EXPRESSION, // some form which evaluates to an integer index. Not offset, index. + FIELD_NAME, + EXPRESSION_PLACEHOLDER, + INVALID + }; + static DerefToken make_int_constant(s64 int_constant); + static DerefToken make_int_expr(Form* expr); + static DerefToken make_field_name(const std::string& name); + static DerefToken make_expr_placeholder(); + + void collect_vars(RegAccessSet& vars, bool recursive) const; + goos::Object to_form(const Env& env) const; + void apply(const std::function& f); + void apply_form(const std::function& f); + void get_modified_regs(RegSet& regs) const; + + bool is_field_name(const std::string& name) const { + return m_kind == Kind::FIELD_NAME && m_name == name; + } + + bool is_int(int x) const { return m_kind == Kind::INTEGER_CONSTANT && m_int_constant == x; } + + bool is_expr() const { return m_kind == Kind::INTEGER_EXPRESSION; } + + Kind kind() const { return m_kind; } + const std::string& field_name() const { + ASSERT(m_kind == Kind::FIELD_NAME); + return m_name; + } + + s64 int_constant() const { return m_int_constant; } + + Form* expr() { + ASSERT(m_kind == Kind::INTEGER_EXPRESSION); + return m_expr; + } + + private: + Kind m_kind = Kind::INVALID; + s64 m_int_constant = -1; + std::string m_name; + Form* m_expr = nullptr; +}; + +DerefToken to_token(const FieldReverseLookupOutput::Token& in); + +class DerefElement : public FormElement { + public: + DerefElement(Form* base, bool is_addr_of, DerefToken token); + DerefElement(Form* base, bool is_addr_of, std::vector tokens); + goos::Object to_form_internal(const Env& env) const override; + void apply(const std::function& f) override; + void apply_form(const std::function& f) override; + void collect_vars(RegAccessSet& vars, bool recursive) const override; + void update_from_stack(const Env& env, + FormPool& pool, + FormStack& stack, + std::vector* result, + bool allow_side_effects) override; + void get_modified_regs(RegSet& regs) const override; + + void inline_nested(); + + bool is_addr_of() const { return m_is_addr_of; } + const Form* base() const { return m_base; } + Form* base() { return m_base; } + const std::vector& tokens() const { return m_tokens; } + std::vector& tokens() { return m_tokens; } + void set_base(Form* new_base); + void set_addr_of(bool is_addr_of) { m_is_addr_of = is_addr_of; } + + private: + ConstantTokenElement* try_as_art_const(const Env& env, FormPool& pool); + + Form* m_base = nullptr; + bool m_is_addr_of = false; + std::vector m_tokens; +}; + +class ArrayFieldAccess : public FormElement { + public: + ArrayFieldAccess(RegisterAccess source, + const std::vector& deref_tokens, + int expected_stride, + int constant_offset, + bool flipped); + goos::Object to_form_internal(const Env& env) const override; + void apply(const std::function& f) override; + void apply_form(const std::function& f) override; + void collect_vars(RegAccessSet& vars, bool recursive) const override; + void update_from_stack(const Env& env, + FormPool& pool, + FormStack& stack, + std::vector* result, + bool allow_side_effects) override; + void get_modified_regs(RegSet& regs) const override; + + void update_with_val(Form* new_val, + const Env& env, + FormPool& pool, + std::vector* result, + bool allow_side_effects); + + bool flipped() const { return m_flipped; } + + private: + RegisterAccess m_source; + std::vector m_deref_tokens; + int m_expected_stride = -1; + int m_constant_offset = -1; + bool m_flipped = false; +}; + class StorePlainDeref : public FormElement { public: StorePlainDeref(Form* dst, @@ -1375,6 +1387,7 @@ class DecompiledDataElement : public FormElement { void get_modified_regs(RegSet& regs) const override; void do_decomp(const Env& env, const LinkedObjectFile* file); DecompilerLabel label() const { return m_label; } + std::optional label_info() const { return m_label_info; } private: bool m_decompiled = false; @@ -1389,6 +1402,7 @@ class LetElement : public FormElement { void add_def(RegisterAccess dst, Form* value); void make_let_star(); + void clear_let_star(); goos::Object to_form_internal(const Env& env) const override; void apply(const std::function& f) override; void apply_form(const std::function& f) override; @@ -1427,6 +1441,12 @@ class CounterLoopElement : public FormElement { void collect_vars(RegAccessSet& vars, bool recursive) const override; void get_modified_regs(RegSet& regs) const override; bool allow_in_if() const override { return false; } + Kind kind() const { return m_kind; } + Form* counter_value() const { return m_check_value; } + Form* body() const { return m_body; } + RegisterAccess var_init() const { return m_var_init; } + RegisterAccess var_check() const { return m_var_check; } + RegisterAccess var_inc() const { return m_var_inc; } private: RegisterAccess m_var_init, m_var_check, m_var_inc; diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index bd6414be69..153222d6aa 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -1,15 +1,18 @@ #include "Form.h" #include "FormStack.h" #include "GenericElementMatcher.h" + #include "common/goos/PrettyPrinter.h" -#include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "decompiler/util/data_decompile.h" -#include "decompiler/IR2/bitfields.h" -#include "common/util/BitUtils.h" #include "common/type_system/state.h" +#include "common/util/Assert.h" +#include "common/util/BitUtils.h" #include "common/util/print_float.h" + #include "decompiler/IR2/ExpressionHelpers.h" +#include "decompiler/IR2/bitfields.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "decompiler/util/DecompilerTypeSystem.h" +#include "decompiler/util/data_decompile.h" #include "decompiler/util/goal_constants.h" /* @@ -100,11 +103,9 @@ Form* try_cast_simplify(Form* in, if (fc) { double div = (double)*fc / METER_LENGTH; // GOOS will use doubles here if (div * METER_LENGTH == *fc) { - return pool.alloc_single_element_form( - nullptr, - GenericOperator::make_function( - pool.alloc_single_element_form(nullptr, "meters")), - pool.alloc_single_element_form(nullptr, div)); + return pool.form( + GenericOperator::make_function(pool.form("meters")), + pool.form(div)); } else { lg::error("Floating point value {} could not be converted to meters.", *fc); } @@ -114,11 +115,9 @@ Form* try_cast_simplify(Form* in, if (fc) { double div = (double)*fc / DEGREES_LENGTH; // GOOS will use doubles here if (div * DEGREES_LENGTH == *fc) { - return pool.alloc_single_element_form( - nullptr, - GenericOperator::make_function( - pool.alloc_single_element_form(nullptr, "degrees")), - pool.alloc_single_element_form(nullptr, div)); + return pool.form( + GenericOperator::make_function(pool.form("degrees")), + pool.form(div)); } else { lg::error("Floating point value {} could not be converted to degrees.", *fc); } @@ -142,21 +141,11 @@ Form* try_cast_simplify(Form* in, // if they used a 1 as a time-frame, they likely just want to literally remove 1 // instead of (seconds 0.0034) or whatever the result would be. // also 0 is decompiled as just 0. - return pool.alloc_single_element_form( - nullptr, SimpleAtom::make_int_constant(value)); + return pool.form(SimpleAtom::make_int_constant(value)); } - // only rewrite if exact. - s64 seconds_int = value / (s64)TICKS_PER_SECOND; - if (seconds_int * (s64)TICKS_PER_SECOND == value) { - return pool.alloc_single_element_form( - nullptr, fmt::format("(seconds {})", seconds_int)); - } - double seconds = (double)value / TICKS_PER_SECOND; - if (seconds * TICKS_PER_SECOND == value) { - return pool.alloc_single_element_form( - nullptr, fmt::format("(seconds {})", float_to_string(seconds, false))); - } + return pool.form( + fmt::format("(seconds {})", fixed_point_to_string(value, TICKS_PER_SECOND))); } else { // not a constant like (seconds 2), probably an expression or function call. we pretend that a // cast to int happened instead. @@ -217,7 +206,7 @@ Form* try_cast_simplify(Form* in, if (as_atom && as_atom->is_var()) { if (env.get_variable_type(as_atom->var(), true) == new_type) { // we are a variable with the right type. - return pool.alloc_single_element_form(nullptr, *as_atom, true); + return pool.form(*as_atom, true); } } @@ -299,7 +288,7 @@ Form* repop_passthrough_arg(Form* in, * Create a form which represents a variable. */ Form* var_to_form(const RegisterAccess& var, FormPool& pool) { - return pool.alloc_single_element_form(nullptr, SimpleAtom::make_var(var)); + return pool.form(SimpleAtom::make_var(var)); } /*! @@ -429,7 +418,7 @@ Form* cast_form(Form* in, return result; } - return pool.alloc_single_element_form(nullptr, new_type, in); + return pool.form(new_type, in); } /*! @@ -471,7 +460,7 @@ std::vector pop_to_forms(const std::vector& vars, // there is a separate system for casting variables that will do a better job. if (cast && !is_var) { forms[i] = cast_form(forms[i], *cast, pool, env); - // pool.alloc_single_element_form(nullptr, *cast, forms[i]); + // pool.form(*cast, forms[i]); } } @@ -719,10 +708,28 @@ void SimpleExpressionElement::update_from_stack_gpr_to_fpr(const Env& env, result->push_back(x); } } else { - // converting something else to an FPR, put an expression around it. - result->push_back(pool.alloc_element( - GenericOperator::make_fixed(FixedOperatorKind::GPR_TO_FPR), - pool.alloc_sequence_form(nullptr, src_fes))); + if (env.version != GameVersion::Jak1) { + auto frm = pool.alloc_sequence_form(nullptr, src_fes); + if (src_fes.size() == 1) { + auto int_constant = get_goal_integer_constant(frm, env); + + if (int_constant && (*int_constant <= UINT32_MAX)) { + float flt; + + memcpy(&flt, &int_constant.value(), sizeof(float)); + + result->push_back(pool.alloc_element(flt)); + return; + } + } + // converting something else to an FPR, put an expression around it. + result->push_back(pool.alloc_element( + GenericOperator::make_fixed(FixedOperatorKind::GPR_TO_FPR), frm)); + } else { + result->push_back(pool.alloc_element( + GenericOperator::make_fixed(FixedOperatorKind::GPR_TO_FPR), + pool.alloc_sequence_form(nullptr, src_fes))); + } } } @@ -742,8 +749,8 @@ void SimpleExpressionElement::update_from_stack_fpr_to_gpr(const Env& env, m_popped = false; update_from_stack(env, pool, stack, result, allow_side_effects); } else { - throw std::runtime_error( - fmt::format("FPR -> GPR applied to a {} in {}", src_type.print(), to_string(env))); + throw std::runtime_error(fmt::format("FPR -> GPR applied to a {} in {} at {}", src_type.print(), + to_string(env), m_my_idx)); } } @@ -941,7 +948,7 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env, allow_side_effects); } else { args = pop_to_forms({m_expr.get_arg(0).var()}, env, pool, stack, allow_side_effects); - args.push_back(pool.alloc_single_element_form(nullptr, m_expr.get_arg(1))); + args.push_back(pool.form(m_expr.get_arg(1))); } bool arg0_ptr = is_ptr_or_child(env, m_my_idx, m_expr.get_arg(0).var(), true); @@ -1251,11 +1258,11 @@ void SimpleExpressionElement::update_from_stack_mult_si(const Env& env, allow_side_effects); if (!arg0_i) { - args.at(0) = pool.alloc_single_element_form(nullptr, TypeSpec("int"), args.at(0)); + args.at(0) = pool.form(TypeSpec("int"), args.at(0)); } if (!arg1_i) { - args.at(1) = pool.alloc_single_element_form(nullptr, TypeSpec("int"), args.at(1)); + args.at(1) = pool.form(TypeSpec("int"), args.at(1)); } auto new_form = pool.alloc_element( @@ -1299,7 +1306,7 @@ void SimpleExpressionElement::update_from_stack_force_si_2(const Env& env, } else { args = pop_to_forms({m_expr.get_arg(0).var()}, env, pool, stack, allow_side_effects); - args.push_back(pool.alloc_single_element_form(nullptr, m_expr.get_arg(1))); + args.push_back(pool.form(m_expr.get_arg(1))); } switch (kind) { @@ -1350,15 +1357,15 @@ void SimpleExpressionElement::update_from_stack_force_ui_2(const Env& env, allow_side_effects); } else { args = pop_to_forms({m_expr.get_arg(0).var()}, env, pool, stack, allow_side_effects); - args.push_back(pool.alloc_single_element_form(nullptr, m_expr.get_arg(1))); + args.push_back(pool.form(m_expr.get_arg(1))); } if (!arg0_u) { - args.at(0) = pool.alloc_single_element_form(nullptr, TypeSpec("uint"), args.at(0)); + args.at(0) = pool.form(TypeSpec("uint"), args.at(0)); } if (!arg1_u) { - args.at(1) = pool.alloc_single_element_form(nullptr, TypeSpec("uint"), args.at(1)); + args.at(1) = pool.form(TypeSpec("uint"), args.at(1)); } auto new_form = @@ -1386,8 +1393,7 @@ void SimpleExpressionElement::update_from_stack_pcypld(const Env& env, args.push_back(popped_args.at(ras_idx)); ras_idx++; } else { - args.push_back( - pool.alloc_single_element_form(nullptr, m_expr.get_arg(arg_idx))); + args.push_back(pool.form(m_expr.get_arg(arg_idx))); } } @@ -1505,20 +1511,18 @@ void SimpleExpressionElement::update_from_stack_copy_first_int_2(const Env& env, if (bti) { auto new_form = pool.alloc_element( GenericOperator::make_fixed(kind), args.at(0), - cast_form(pool.alloc_single_element_form(nullptr, m_expr.get_arg(1)), - arg0_type, pool, env)); + cast_form(pool.form(m_expr.get_arg(1)), arg0_type, pool, env)); result->push_back(new_form); } else { auto new_form = pool.alloc_element( - GenericOperator::make_fixed(kind), - pool.alloc_single_element_form(nullptr, TypeSpec("int"), args.at(0)), - pool.alloc_single_element_form(nullptr, m_expr.get_arg(1))); + GenericOperator::make_fixed(kind), pool.form(TypeSpec("int"), args.at(0)), + pool.form(m_expr.get_arg(1))); result->push_back(new_form); } } else { - auto new_form = pool.alloc_element( - GenericOperator::make_fixed(kind), args.at(0), - pool.alloc_single_element_form(nullptr, m_expr.get_arg(1))); + auto new_form = + pool.alloc_element(GenericOperator::make_fixed(kind), args.at(0), + pool.form(m_expr.get_arg(1))); result->push_back(new_form); } @@ -1543,8 +1547,7 @@ void SimpleExpressionElement::update_from_stack_copy_first_int_2(const Env& env, args.at(0), args.at(1)); result->push_back(new_form); } else { - auto cast = pool.alloc_single_element_form( - nullptr, TypeSpec(arg0_i ? "int" : "uint"), args.at(1)); + auto cast = pool.form(TypeSpec(arg0_i ? "int" : "uint"), args.at(1)); if (kind == FixedOperatorKind::SUBTRACTION && is_pointer_type(env, m_my_idx, m_expr.get_arg(0).var())) { kind = FixedOperatorKind::SUBTRACTION_PTR; @@ -1720,17 +1723,15 @@ FormElement* SimpleExpressionElement::update_from_stack_logor_or_logand_helper( if (integer && ((s64)*integer) < 0) { // clearing a bitfield. auto elts = decompile_bitfield_enum_from_int(arg1_type, env.dts->ts, ~*integer); - auto oper = - GenericOperator::make_function(pool.alloc_single_element_form( - nullptr, arg1_type.base_type())); + auto oper = GenericOperator::make_function( + pool.form(arg1_type.base_type())); std::vector form_elts; for (auto& x : elts) { - form_elts.push_back(pool.alloc_single_element_form(nullptr, x)); + form_elts.push_back(pool.form(x)); } - auto inverted = - pool.alloc_single_element_form(nullptr, oper, form_elts); - auto normal = pool.alloc_single_element_form( - nullptr, GenericOperator::make_fixed(FixedOperatorKind::LOGNOT), inverted); + auto inverted = pool.form(oper, form_elts); + auto normal = pool.form( + GenericOperator::make_fixed(FixedOperatorKind::LOGNOT), inverted); auto new_form = pool.alloc_element(GenericOperator::make_fixed(kind), normal, args.at(1)); return new_form; @@ -1757,8 +1758,7 @@ FormElement* SimpleExpressionElement::update_from_stack_logor_or_logand_helper( } } // types bad, insert cast. - auto cast = pool.alloc_single_element_form( - nullptr, TypeSpec(arg0_i ? "int" : "uint"), args.at(1)); + auto cast = pool.form(TypeSpec(arg0_i ? "int" : "uint"), args.at(1)); auto new_form = pool.alloc_element(GenericOperator::make_fixed(kind), args.at(0), cast); return new_form; @@ -1797,10 +1797,7 @@ void SimpleExpressionElement::update_from_stack_logor_or_logand(const Env& env, Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::LOGAND), {Matcher::any(a_form), lognot_submatchers})}); - Form hack_form; - hack_form.elts().push_back(element); - - auto mr = match(logclear_matcher, &hack_form); + auto mr = match(logclear_matcher, element); if (mr.matched) { result->push_back(pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::LOGCLEAR), @@ -1818,7 +1815,7 @@ void SimpleExpressionElement::update_from_stack_logor_or_logand(const Env& env, Matcher::integer(32)}), Matcher::op_fixed(FixedOperatorKind::ASM_SLLV_R0, {Matcher::any_reg(1)})}); - auto handle_mr = match(make_handle_matcher, &hack_form); + auto handle_mr = match(make_handle_matcher, element); if (handle_mr.matched) { auto var_a = handle_mr.maps.regs.at(0).value(); auto var_b = handle_mr.maps.regs.at(1).value(); @@ -1889,8 +1886,7 @@ void SimpleExpressionElement::update_from_stack_left_shift(const Env& env, auto new_form = pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::MULTIPLICATION), args.at(0), - pool.alloc_single_element_form( - nullptr, SimpleAtom::make_int_constant(multiplier))); + pool.form(SimpleAtom::make_int_constant(multiplier))); result->push_back(new_form); return; } @@ -1898,15 +1894,15 @@ void SimpleExpressionElement::update_from_stack_left_shift(const Env& env, auto arg0_i = is_int_type(env, m_my_idx, m_expr.get_arg(0).var()); auto arg0_u = is_uint_type(env, m_my_idx, m_expr.get_arg(0).var()); if (!arg0_i && !arg0_u) { - auto new_form = pool.alloc_element( - GenericOperator::make_fixed(FixedOperatorKind::SHL), - pool.alloc_single_element_form(nullptr, TypeSpec("int"), args.at(0)), - pool.alloc_single_element_form(nullptr, m_expr.get_arg(1))); + auto new_form = + pool.alloc_element(GenericOperator::make_fixed(FixedOperatorKind::SHL), + pool.form(TypeSpec("int"), args.at(0)), + pool.form(m_expr.get_arg(1))); result->push_back(new_form); } else { auto new_form = pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::SHL), args.at(0), - pool.alloc_single_element_form(nullptr, m_expr.get_arg(1))); + pool.form(m_expr.get_arg(1))); result->push_back(new_form); } @@ -1970,13 +1966,13 @@ void SimpleExpressionElement::update_from_stack_right_shift_logic(const Env& env if (!arg0_i && !arg0_u) { auto new_form = pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::SHR), - pool.alloc_single_element_form(nullptr, TypeSpec("int"), arg), - pool.alloc_single_element_form(nullptr, m_expr.get_arg(1))); + pool.form(TypeSpec("int"), arg), + pool.form(m_expr.get_arg(1))); result->push_back(new_form); } else { auto new_form = pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::SHR), arg, - pool.alloc_single_element_form(nullptr, m_expr.get_arg(1))); + pool.form(m_expr.get_arg(1))); result->push_back(new_form); } } @@ -2017,8 +2013,7 @@ void SimpleExpressionElement::update_from_stack_right_shift_arith(const Env& env auto new_form = pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::DIVISION), arg, - pool.alloc_single_element_form( - nullptr, SimpleAtom::make_int_constant(multiplier))); + pool.form(SimpleAtom::make_int_constant(multiplier))); result->push_back(new_form); return; } @@ -2037,15 +2032,15 @@ void SimpleExpressionElement::update_from_stack_right_shift_arith(const Env& env } if (!arg0_i && !arg0_u) { - auto new_form = pool.alloc_element( - GenericOperator::make_fixed(FixedOperatorKind::SAR), - pool.alloc_single_element_form(nullptr, TypeSpec("int"), args.at(0)), - pool.alloc_single_element_form(nullptr, m_expr.get_arg(1))); + auto new_form = + pool.alloc_element(GenericOperator::make_fixed(FixedOperatorKind::SAR), + pool.form(TypeSpec("int"), args.at(0)), + pool.form(m_expr.get_arg(1))); result->push_back(new_form); } else { auto new_form = pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::SAR), args.at(0), - pool.alloc_single_element_form(nullptr, m_expr.get_arg(1))); + pool.form(m_expr.get_arg(1))); result->push_back(new_form); } @@ -2102,8 +2097,19 @@ void SimpleExpressionElement::update_from_stack_float_to_int(const Env& env, auto var = m_expr.get_arg(0).var(); auto arg = pop_to_forms({var}, env, pool, stack, allow_side_effects).at(0); auto type = env.get_types_before_op(var.idx()).get(var.reg()).typespec(); + auto fpr_convert_matcher = + Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::GPR_TO_FPR), {Matcher::any(0)}); + auto mr = match(fpr_convert_matcher, arg); if (type == TypeSpec("float")) { result->push_back(pool.alloc_element(TypeSpec("int"), arg, true)); + } else if (env.dts->ts.tc(type, TypeSpec("float")) && mr.matched) { + // this is a parent of float. normally we would fix this with a manual cast, but that is too + // effective since float->int requires the type to be EXACTLY float. + // so we add a cast to float first. + // we also strip the gpr->fpr here + result->push_back(pool.alloc_element( + TypeSpec("int"), pool.form(TypeSpec("float"), mr.maps.forms.at(0), true), + true)); } else { throw std::runtime_error( fmt::format("Used float to int on a {}: {}", type.print(), to_string(env))); @@ -2350,9 +2356,8 @@ void SetVarElement::push_to_stack(const Env& env, FormPool& pool, FormStack& sta m_dst.reg().get_kind() == Reg::FPR && src_as_se->expr().get_arg(0).is_int() && src_as_se->expr().get_arg(0).get_int() == 0) { // not sure this is the best place for this. - stack.push_value_to_reg(m_dst, - pool.alloc_single_element_form(nullptr, 0.0), - true, m_src_type, m_var_info); + stack.push_value_to_reg(m_dst, pool.form(0.0), true, m_src_type, + m_var_info); return; } @@ -2414,29 +2419,75 @@ void SetFormFormElement::push_to_stack(const Env& env, FormPool& pool, FormStack loc->parent_element = this; m_dst = loc; auto zero = SimpleAtom::make_int_constant(0); - auto zero_form = pool.alloc_single_element_form(nullptr, zero); + auto zero_form = pool.form(zero); m_src = zero_form; } } - const std::pair in_place_ops[] = { - {FixedOperatorKind::ADDITION, FixedOperatorKind::ADDITION_IN_PLACE}, - {FixedOperatorKind::ADDITION_PTR, FixedOperatorKind::ADDITION_PTR_IN_PLACE}, - {FixedOperatorKind::LOGAND, FixedOperatorKind::LOGAND_IN_PLACE}, - {FixedOperatorKind::LOGIOR, FixedOperatorKind::LOGIOR_IN_PLACE}, - {FixedOperatorKind::LOGCLEAR, FixedOperatorKind::LOGCLEAR_IN_PLACE}}; + typedef struct { + FixedOperatorKind kind; + FixedOperatorKind inplace_kind; + int inplace_arg; + } InplaceOpInfo; + + const static InplaceOpInfo in_place_ops[] = { + {FixedOperatorKind::ADDITION, FixedOperatorKind::ADDITION_IN_PLACE, 0}, + {FixedOperatorKind::ADDITION_PTR, FixedOperatorKind::ADDITION_PTR_IN_PLACE, 0}, + {FixedOperatorKind::LOGAND, FixedOperatorKind::LOGAND_IN_PLACE, 0}, + {FixedOperatorKind::LOGIOR, FixedOperatorKind::LOGIOR_IN_PLACE, 0}, + {FixedOperatorKind::LOGCLEAR, FixedOperatorKind::LOGCLEAR_IN_PLACE, 0}, + {FixedOperatorKind::LOGXOR, FixedOperatorKind::LOGXOR_IN_PLACE, 0}}; + + typedef struct { + std::string orig_name; + std::string inplace_name; + int inplace_arg; + } InplaceCallInfo; + + const static InplaceCallInfo in_place_calls[] = {{"seek", "seek!", 0}, {"seekl", "seekl!", 0}}; auto src_as_generic = m_src->try_as_element(); if (src_as_generic) { - for (auto& op_pair : in_place_ops) { - if (src_as_generic->op().is_fixed(op_pair.first)) { - auto dst_form = m_dst->to_form(env); - auto add_form_0 = src_as_generic->elts().at(0)->to_form(env); + if (src_as_generic->op().is_func()) { + auto funchelt = dynamic_cast(src_as_generic->op().func()->at(0)); + if (funchelt && funchelt->expr().get_arg(0).is_sym_val()) { + const auto& funcname = funchelt->expr().get_arg(0).get_str(); + for (const auto& call_info : in_place_calls) { + if (funcname == call_info.orig_name) { + auto dst_form = m_dst->to_form(env); + auto src_form_in_func = src_as_generic->elts().at(call_info.inplace_arg)->to_form(env); - if (dst_form == add_form_0) { - src_as_generic->op() = GenericOperator::make_fixed(op_pair.second); - stack.push_form_element(src_as_generic, true); - return; + if (dst_form == src_form_in_func) { + auto new_func_op = GenericOperator::make_function( + pool.form(call_info.inplace_name)); + GenericElement* inplace_call = nullptr; + + if (funcname == "seek" || funcname == "seekl") { + inplace_call = pool.alloc_element( + new_func_op, std::vector{m_dst, src_as_generic->elts().at(1), + src_as_generic->elts().at(2)}); + } + ASSERT_MSG( + inplace_call, + fmt::format("no appropriate inplace call was generated for (set! {}) -> {}", + call_info.orig_name, call_info.inplace_name)); + stack.push_form_element(inplace_call, true); + return; + } + } + } + } + } else { + for (const auto& op_info : in_place_ops) { + if (src_as_generic->op().is_fixed(op_info.kind)) { + auto dst_form = m_dst->to_form(env); + auto add_form_0 = src_as_generic->elts().at(op_info.inplace_arg)->to_form(env); + + if (dst_form == add_form_0) { + src_as_generic->op() = GenericOperator::make_fixed(op_info.inplace_kind); + stack.push_form_element(src_as_generic, true); + return; + } } } } @@ -2446,9 +2497,9 @@ void SetFormFormElement::push_to_stack(const Env& env, FormPool& pool, FormStack } void StoreInSymbolElement::push_to_stack(const Env& env, FormPool& pool, FormStack& stack) { - auto sym = pool.alloc_single_element_form( - nullptr, SimpleAtom::make_sym_val(m_sym_name).as_expr(), m_my_idx); - auto val = pool.alloc_single_element_form(nullptr, m_value, m_my_idx); + auto sym = + pool.form(SimpleAtom::make_sym_val(m_sym_name).as_expr(), m_my_idx); + auto val = pool.form(m_value, m_my_idx); val->update_children_from_stack(env, pool, stack, true); if (m_cast_for_set) { @@ -2474,18 +2525,16 @@ void StoreInPairElement::push_to_stack(const Env& env, FormPool& pool, FormStack if (m_value.is_var()) { auto vars = std::vector({m_value.var(), m_pair}); auto popped = pop_to_forms(vars, env, pool, stack, true); - auto addr = pool.alloc_single_element_form( - nullptr, GenericOperator::make_fixed(op), popped.at(1)); + auto addr = pool.form(GenericOperator::make_fixed(op), popped.at(1)); addr->mark_popped(); auto fr = pool.alloc_element(addr, popped.at(0)); fr->mark_popped(); stack.push_form_element(fr, true); } else { - auto val = pool.alloc_single_element_form(nullptr, m_value, m_my_idx); + auto val = pool.form(m_value, m_my_idx); val->mark_popped(); - auto addr = pool.alloc_single_element_form( - nullptr, GenericOperator::make_fixed(op), - pop_to_forms({m_pair}, env, pool, stack, true).at(0)); + auto addr = pool.form(GenericOperator::make_fixed(op), + pop_to_forms({m_pair}, env, pool, stack, true).at(0)); addr->mark_popped(); auto fr = pool.alloc_element(addr, val); fr->mark_popped(); @@ -2540,10 +2589,7 @@ bool try_to_rewrite_vector_inline_ctor(const Env& env, auto matcher = Matcher::set(Matcher::deref(Matcher::any_reg(0), false, token_matchers), Matcher::cast("uint128", Matcher::integer(0))); - Form hack; - hack.elts().push_back(elt); - auto mr = match(matcher, &hack); - + auto mr = match(matcher, elt); if (mr.matched) { if (var_name != env.get_variable_name(*mr.maps.regs.at(0))) { return false; @@ -2563,10 +2609,8 @@ bool try_to_rewrite_vector_inline_ctor(const Env& env, stack.push_value_to_reg( *matrix_entries->at(0).destination, - pool.alloc_single_element_form( - nullptr, - GenericOperator::make_function(pool.alloc_single_element_form( - nullptr, fmt::format("new-stack-{}0", type_name)))), + pool.form(GenericOperator::make_function( + pool.form(fmt::format("new-stack-{}0", type_name)))), true, TypeSpec(type_name)); return true; } @@ -2601,10 +2645,7 @@ bool try_to_rewrite_matrix_inline_ctor(const Env& env, FormPool& pool, FormStack DerefTokenMatcher::string("quad")}), Matcher::cast("uint128", Matcher::integer(0))); - Form hack; - hack.elts().push_back(elt); - auto mr = match(matcher, &hack); - + auto mr = match(matcher, elt); if (mr.matched) { if (var_name != env.get_variable_name(*mr.maps.regs.at(0))) { return false; @@ -2624,10 +2665,8 @@ bool try_to_rewrite_matrix_inline_ctor(const Env& env, FormPool& pool, FormStack stack.pop(5); stack.push_value_to_reg(*matrix_entries->at(0).destination, - pool.alloc_single_element_form( - nullptr, GenericOperator::make_function( - pool.alloc_single_element_form( - nullptr, "new-stack-matrix0"))), + pool.form(GenericOperator::make_function( + pool.form("new-stack-matrix0"))), true, TypeSpec("matrix")); return true; } @@ -2666,7 +2705,7 @@ void StorePlainDeref::push_to_stack(const Env& env, FormPool& pool, FormStack& s make_optional_cast(m_dst_cast_type, popped.at(0), pool, env)); m_dst->mark_popped(); m_dst->try_as_element()->inline_nested(); - auto val = pool.alloc_single_element_form(nullptr, m_expr, m_my_idx); + auto val = pool.form(m_expr, m_my_idx); val->mark_popped(); auto fr = pool.alloc_element( m_dst, make_optional_cast(m_src_cast_type, val, pool, env)); @@ -2695,7 +2734,7 @@ void StoreArrayAccess::push_to_stack(const Env& env, FormPool& pool, FormStack& auto vars = std::vector({m_base_var}); auto popped = pop_to_forms(vars, env, pool, stack, true); m_dst->mark_popped(); - expr_form = pool.alloc_single_element_form(nullptr, m_expr, m_my_idx); + expr_form = pool.form(m_expr, m_my_idx); array_form = popped.at(0); } @@ -2773,6 +2812,28 @@ Form* get_set_next_state(FormElement* set_elt, const Env& env) { // FunctionCallElement /////////////////// +namespace { + +std::optional get_form_reg_acc(Form* in) { + auto as_simple_atom = dynamic_cast(in->try_as_single_active_element()); + if (as_simple_atom) { + if (as_simple_atom->atom().is_var()) { + return as_simple_atom->atom().var(); + } + } + + auto as_expr = dynamic_cast(in->try_as_single_active_element()); + if (as_expr && as_expr->expr().is_identity()) { + auto atom = as_expr->expr().get_arg(0); + if (atom.is_var()) { + return atom.var(); + } + } + + return {}; +} +} // namespace + void FunctionCallElement::update_from_stack(const Env& env, FormPool& pool, FormStack& stack, @@ -2912,21 +2973,17 @@ void FunctionCallElement::update_from_stack(const Env& env, {Matcher::any(0), Matcher::any_constant_token(1)}); auto virtual_go_mr = match(virtual_go_state_matcher, go_next_state); if (virtual_go_mr.matched && virtual_go_mr.maps.forms.at(0)->to_string(env) == "self") { - arg_forms.insert(arg_forms.begin(), pool.alloc_single_element_form( - nullptr, virtual_go_mr.maps.strings.at(1))); + arg_forms.insert(arg_forms.begin(), + pool.form(virtual_go_mr.maps.strings.at(1))); auto go_form = pool.alloc_element( - GenericOperator::make_function( - pool.alloc_single_element_form(nullptr, "go-virtual")), - arg_forms); + GenericOperator::make_function(pool.form("go-virtual")), arg_forms); result->push_back(go_form); return; } arg_forms.insert(arg_forms.begin(), go_next_state); auto go_form = pool.alloc_element( - GenericOperator::make_function( - pool.alloc_single_element_form(nullptr, "go")), - arg_forms); + GenericOperator::make_function(pool.form("go")), arg_forms); result->push_back(go_form); return; } @@ -2965,9 +3022,56 @@ void FunctionCallElement::update_from_stack(const Env& env, .at(0); // fmt::print("GOT: {}\n", pop->to_string(env)); arg_forms.at(0) = pop; + auto head = mr.maps.forms.at(1); - new_form = pool.alloc_element( - GenericOperator::make_function(mr.maps.forms.at(1)), arg_forms); + auto head_obj = head->to_form(env); + if (head_obj.is_symbol() && tp_type.method_from_type().base_type() == "setting-control" && + arg_forms.at(0)->to_form(env).is_symbol("*setting-control*") && + arg_forms.size() > 1) { + auto arg1_reg = get_form_reg_acc(arg_forms.at(1)); + if (arg1_reg && arg1_reg->reg().is_s6()) { + std::string new_head; + if (head_obj.is_symbol("add-setting")) { + new_head = "add-setting!"; + } else if (head_obj.is_symbol("set-setting")) { + new_head = "set-setting!"; + } else if (head_obj.is_symbol("remove-setting")) { + new_head = "remove-setting!"; + } + if (!new_head.empty()) { + auto oldp = head->parent_element; + head = pool.form(new_head); + head->parent_element = oldp; + arg_forms.erase(arg_forms.begin()); + arg_forms.erase(arg_forms.begin()); + if (arg_forms.size() > 3) { + auto argi = arg_forms.at(3); + auto argi_o = argi->to_form(env); + if (argi_o.is_int()) { + auto argset = arg_forms.at(0)->to_string(env); + if (argset == "'process-mask") { + auto en = env.dts->ts.try_enum_lookup("process-mask"); + if (en) { + arg_forms.at(3) = + cast_to_bitfield_enum(env.dts->ts.try_enum_lookup("process-mask"), pool, + env, argi_o.as_int()); + } + } else if (argset == "'sound-flava") { + auto en = env.dts->ts.try_enum_lookup("music-flava"); + if (en) { + arg_forms.at(3) = cast_to_int_enum( + env.dts->ts.try_enum_lookup("music-flava"), pool, env, argi_o.as_int()); + } + } + } + arg_forms.at(3)->parent_element = argi->parent_element; + } + } + } + } + + new_form = + pool.alloc_element(GenericOperator::make_function(head), arg_forms); result->push_back(new_form); ASSERT(!go_next_state); return; @@ -2976,6 +3080,133 @@ void FunctionCallElement::update_from_stack(const Env& env, } } + // check for sound-play stuff + { + if (arg_forms.size() == 7 && unstacked.at(0)->to_form(env).is_symbol("sound-play-by-name")) { + auto ssn = arg_forms.at(0)->to_string(env); + static const std::string ssn_check = "(static-sound-name \""; + // idk what a good way to do this is :( + if (ssn.substr(0, ssn_check.size()) == ssn_check) { + // get sound name + auto sound_name = ssn.substr(ssn_check.size(), ssn.size() - ssn_check.size() - 2); + + // get sound id + auto so_id_f = arg_forms.at(1); + if (so_id_f->to_string(env) == "(new-sound-id)") { + so_id_f = nullptr; + } + + // get sound volume + bool panic = false; + auto so_vol_o = arg_forms.at(2)->to_form(env); + Form* so_vol_f = nullptr; + if (so_vol_o.is_int()) { + auto vol_as_flt_temp = fixed_point_to_float(so_vol_o.as_int(), 1024) * 100; + // fixed point convert is good but floating point accuracy sucks so we can do even better + // with a hardcoded case + for (int i = 0; i < 100; ++i) { + if (int(i * 1024.0f / 100.0f) == so_vol_o.as_int()) { + vol_as_flt_temp = i; + break; + } + } + // make the number now... + if (int(vol_as_flt_temp * 1024.0f / 100.0f) == so_vol_o.as_int()) { + if (so_vol_o.as_int() != 1024) { + so_vol_f = pool.form(float_to_string(vol_as_flt_temp, false)); + } + } + } else { + auto mr_vol = match( + Matcher::cast("int", Matcher::op_fixed(FixedOperatorKind::MULTIPLICATION, + {Matcher::single(10.24f), Matcher::any(0)})), + arg_forms.at(2)); + if (mr_vol.matched) { + so_vol_f = mr_vol.maps.forms.at(0); + } else { + // AAAHHHH i dont know how to handle this volume thing! + panic = true; + } + } + + // get sound pitch mod + auto so_pitch_o = arg_forms.at(3)->to_form(env); + Form* so_pitch_f = nullptr; + if (so_pitch_o.is_int()) { + if (so_pitch_o.as_int() != 0) { + so_pitch_f = + pool.form(fixed_point_to_string(so_pitch_o.as_int(), 1524)); + } + } else { + auto mr_pitch = match( + Matcher::cast("int", Matcher::op_fixed(FixedOperatorKind::MULTIPLICATION, + {Matcher::single(1524), Matcher::any(0)})), + arg_forms.at(3)); + if (mr_pitch.matched) { + so_pitch_f = mr_pitch.maps.forms.at(0); + } else { + panic = true; + } + } + + // rest + if (!panic) { + auto so_bend = arg_forms.at(4); + if (so_bend->to_form(env).is_int(0)) { + so_bend = nullptr; + } + auto elt_group = arg_forms.at(5)->try_as_element(); + if (elt_group && elt_group->op().is_func() && + elt_group->op().func()->to_form(env).is_symbol("sound-group") && + elt_group->elts().size() == 1) { + Form* so_group_f = nullptr; + if (!elt_group->elts().at(0)->to_form(env).is_symbol("sfx")) { + so_group_f = pool.form( + elt_group->elts().at(0)->to_form(env).as_symbol()->name); + } + auto so_positional_f = arg_forms.at(6); + if (so_positional_f->to_form(env).is_symbol("#t")) { + so_positional_f = nullptr; + } + // now make the macro call! + std::vector macro_args; + macro_args.push_back(pool.form(sound_name)); + if (so_id_f) { + macro_args.push_back(pool.form(":id")); + macro_args.push_back(so_id_f); + } + if (so_vol_f) { + macro_args.push_back(pool.form(":vol")); + macro_args.push_back(so_vol_f); + } + if (so_pitch_f) { + macro_args.push_back(pool.form(":pitch")); + macro_args.push_back(so_pitch_f); + } + if (so_bend) { + macro_args.push_back(pool.form(":bend")); + macro_args.push_back(so_bend); + } + if (so_group_f) { + macro_args.push_back(pool.form(":group")); + macro_args.push_back(so_group_f); + } + if (so_positional_f) { + macro_args.push_back(pool.form(":position")); + macro_args.push_back(so_positional_f); + } + + new_form = pool.alloc_element( + GenericOperator::make_function(pool.form("sound-play")), + macro_args); + result->push_back(new_form); + return; + } + } + } + } + } + new_form = pool.alloc_element(GenericOperator::make_function(unstacked.at(0)), arg_forms); @@ -3010,8 +3241,7 @@ void FunctionCallElement::update_from_stack(const Env& env, auto& var = all_pop_vars.at(i + 1); // 0 is the function itself. auto arg_type = env.get_types_before_op(var.idx()).get(var.reg()).typespec(); if (!env.dts->ts.tc(expected_arg_types.at(i), arg_type)) { - new_args.at(i) = pool.alloc_single_element_form( - nullptr, expected_arg_types.at(i), new_args.at(i)); + new_args.at(i) = pool.form(expected_arg_types.at(i), new_args.at(i)); } } @@ -3052,8 +3282,7 @@ void FunctionCallElement::update_from_stack(const Env& env, type_2 = "boxed-array"; } - auto quoted_type = pool.alloc_single_element_form( - nullptr, SimpleAtom::make_sym_ptr(type_2)); + auto quoted_type = pool.form(SimpleAtom::make_sym_ptr(type_2)); if (alloc == "global" && type_1 == "pair") { // cons! @@ -3145,7 +3374,7 @@ void FunctionCallElement::update_from_stack(const Env& env, ":final in the deftype to disable virtual method calls", tp_type.method_from_type().print(), tp_type.method_id())); } - auto method_op = pool.alloc_single_element_form(nullptr, name); + auto method_op = pool.form(name); auto gop = GenericOperator::make_function(method_op); result->push_back(pool.alloc_element(gop, arg_forms)); @@ -3178,10 +3407,9 @@ void FunctionCallElement::update_from_stack(const Env& env, if (got_stack_new) { std::vector stack_new_args; - stack_new_args.push_back( - pool.alloc_single_element_form(nullptr, "'stack")); - stack_new_args.push_back(pool.alloc_single_element_form( - nullptr, fmt::format("'{}", type_source_form->to_string(env)))); + stack_new_args.push_back(pool.form("'stack")); + stack_new_args.push_back(pool.form( + fmt::format("'{}", type_source_form->to_string(env)))); for (size_t i = 2; i < arg_forms.size(); i++) { stack_new_args.push_back(arg_forms.at(i)); } @@ -3192,8 +3420,7 @@ void FunctionCallElement::update_from_stack(const Env& env, } } - auto method_op = - pool.alloc_single_element_form(nullptr, type_source_form, name, false); + auto method_op = pool.form(type_source_form, name, false); auto gop = GenericOperator::make_function(method_op); result->push_back(pool.alloc_element(gop, arg_forms)); @@ -3216,6 +3443,26 @@ void FunctionCallElement::push_to_stack(const Env& env, FormPool& pool, FormStac /////////////////// // DerefElement /////////////////// +ConstantTokenElement* DerefElement::try_as_art_const(const Env& env, FormPool& pool) { + auto mr = match( + Matcher::deref(Matcher::s6(), false, + {DerefTokenMatcher::string("draw"), DerefTokenMatcher::string("art-group"), + DerefTokenMatcher::string("data"), DerefTokenMatcher::any_integer(0)}), + this); + + if (mr.matched) { + auto elt_name = env.get_art_elt_name(mr.maps.ints.at(0)); + if (elt_name) { + return pool.alloc_element(*elt_name); + } else { + lg::error("function {}: did not find art element {} in {}", env.func->name(), + mr.maps.ints.at(0), env.art_group()); + } + } + + return nullptr; +} + void DerefElement::update_from_stack(const Env& env, FormPool& pool, FormStack& stack, @@ -3236,6 +3483,12 @@ void DerefElement::update_from_stack(const Env& env, // merge nested ->'s inline_nested(); + auto as_art = try_as_art_const(env, pool); + if (as_art) { + result->push_back(as_art); + return; + } + result->push_back(this); } @@ -3303,6 +3556,22 @@ void UntilElement::push_to_stack(const Env& env, FormPool& pool, FormStack& stac } stack.push_form_element(this, true); + if (false_destination) { + env.func->warnings.general_warning("new jak 2 until loop case, check carefully"); + stack.push_value_to_reg(*false_destination, + pool.form(SimpleAtom::make_sym_val("#f")), true, + TypeSpec("symbol")); + RegAccessSet accessed_regs; + body->collect_vars(accessed_regs, true); + condition->collect_vars(accessed_regs, true); + auto check_name = env.get_variable_name(*false_destination); + for (auto& reg : accessed_regs) { + if (env.get_variable_name(reg) == check_name) { + ASSERT_MSG(false, fmt::format("Jak 2 loop uses delay slot variable improperly: {} {}\n", + env.func->name(), check_name)); + } + } + } } void WhileElement::push_to_stack(const Env& env, FormPool& pool, FormStack& stack) { @@ -3373,8 +3642,8 @@ Form* try_rewrite_as_process_to_ppointer(CondNoElseElement* value, } } - return pool.alloc_single_element_form( - nullptr, GenericOperator::make_fixed(FixedOperatorKind::PROCESS_TO_PPOINTER), repopped); + return pool.form( + GenericOperator::make_fixed(FixedOperatorKind::PROCESS_TO_PPOINTER), repopped); } // (if x (-> x 0 self)) -> (ppointer->process x) @@ -3423,8 +3692,59 @@ Form* try_rewrite_as_pppointer_to_process(CondNoElseElement* value, repopped = var_to_form(condition_var, pool); } - return pool.alloc_single_element_form( - nullptr, GenericOperator::make_fixed(FixedOperatorKind::PPOINTER_TO_PROCESS), repopped); + return pool.form( + GenericOperator::make_fixed(FixedOperatorKind::PPOINTER_TO_PROCESS), repopped); +} + +// (if (> (-> self skel active-channels) 0) +// (-> self skel root-channel 0 frame-group) +// ) +// (ja-group :chan 0) +Form* try_rewrite_as_ja_group(CondNoElseElement* value, + FormStack& /*stack*/, + FormPool& pool, + const Env& env) { + if (value->entries.size() != 1) { + return nullptr; + } + + auto condition = value->entries.at(0).condition; + auto body = value->entries[0].body; + + // safe to look for a reg directly here. + auto condition_matcher = Matcher::op_fixed( + FixedOperatorKind::GT, {Matcher::deref(Matcher::s6(), false, + {DerefTokenMatcher::string("skel"), + DerefTokenMatcher::string("active-channels")}), + Matcher::any(0)}); + auto condition_mr = match(condition_matcher, condition); + if (!condition_mr.matched) { + return nullptr; + } + + auto body_matcher = Matcher::deref( + Matcher::s6(), false, + {DerefTokenMatcher::string("skel"), DerefTokenMatcher::string("root-channel"), + DerefTokenMatcher::any_expr_or_int(0), DerefTokenMatcher::string("frame-group")}); + auto body_mr = match(body_matcher, body); + + if (!body_mr.matched) { + return nullptr; + } + + auto chan = body_mr.int_or_form_to_form(pool, 0); + auto obj_chan = chan->to_form(env); + if (condition_mr.maps.forms.at(0)->to_form(env) == obj_chan) { + auto func = GenericOperator::make_function(pool.form("ja-group")); + if (obj_chan.is_int(0)) { + return pool.form(func); + } else { + return pool.form(func, pool.form(":chan"), + condition_mr.maps.forms.at(0)); + } + } + + return nullptr; } } // namespace @@ -3493,11 +3813,17 @@ void CondNoElseElement::push_to_stack(const Env& env, FormPool& pool, FormStack& stack.push_value_to_reg(write_as_value, as_ppointer_to_process, true, env.get_variable_type(final_destination, false)); } else { - // fmt::print("func {} final destination {} type {}\n", env.func->name(), - // final_destination.to_string(env), - // env.get_variable_type(final_destination, false).print()); - stack.push_value_to_reg(write_as_value, pool.alloc_single_form(nullptr, this), true, - env.get_variable_type(final_destination, false)); + auto as_ja_group = try_rewrite_as_ja_group(this, stack, pool, env); + if (as_ja_group) { + stack.push_value_to_reg(write_as_value, as_ja_group, true, + env.get_variable_type(final_destination, false)); + } else { + // fmt::print("func {} final destination {} type {}\n", env.func->name(), + // final_destination.to_string(env), + // env.get_variable_type(final_destination, false).print()); + stack.push_value_to_reg(write_as_value, pool.alloc_single_form(nullptr, this), true, + env.get_variable_type(final_destination, false)); + } } } @@ -3675,8 +4001,7 @@ void CondWithElseElement::push_to_stack(const Env& env, FormPool& pool, FormStac Form* result_value = pool.alloc_single_form(nullptr, this); if (!env.dts->ts.tc(expected_type, result_type)) { - result_value = - pool.alloc_single_element_form(nullptr, expected_type, result_value); + result_value = pool.form(expected_type, result_value); } // fmt::print("{}\n", result_value->to_string(env)); @@ -3861,6 +4186,24 @@ std::vector cast_to_64_bit(const std::vector& forms, } return result; } + +FormElement* try_make_nonzero_logtest(Form* in, FormPool& pool) { + /* + (defmacro logtest? (a b) + "does a have any of the bits in b?" + `(nonzero? (logand ,a ,b)) + ) + */ + auto logand_matcher = Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::LOGAND), + {Matcher::any(0), Matcher::any(1)}); + auto mr_logand = match(logand_matcher, in); + if (mr_logand.matched) { + return pool.alloc_element( + GenericOperator::make_fixed(FixedOperatorKind::LOGTEST), mr_logand.maps.forms.at(0), + mr_logand.maps.forms.at(1)); + } + return nullptr; +} } // namespace FormElement* ConditionElement::make_zero_check_generic(const Env& env, @@ -3895,8 +4238,7 @@ FormElement* ConditionElement::make_zero_check_generic(const Env& env, source_forms.at(0)); if (mr.matched) { s64 value = -mr.maps.ints.at(1); - auto value_form = pool.alloc_single_element_form( - nullptr, SimpleAtom::make_int_constant(value)); + auto value_form = pool.form(SimpleAtom::make_int_constant(value)); return pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::EQ), std::vector{mr.maps.forms.at(0), value_form}); @@ -3910,25 +4252,17 @@ FormElement* ConditionElement::make_zero_check_generic(const Env& env, std::vector{source_forms.at(0), nice_constant}); } - return pool.alloc_element(GenericOperator::make_compare(m_kind), source_forms); -} - -FormElement* try_make_nonzero_logtest(Form* in, FormPool& pool) { /* - (defmacro logtest? (a b) - "does a have any of the bits in b?" - `(nonzero? (logand ,a ,b)) - ) - */ - auto logand_matcher = Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::LOGAND), - {Matcher::any(0), Matcher::any(1)}); - auto mr_logand = match(logand_matcher, in); - if (mr_logand.matched) { - return pool.alloc_element( - GenericOperator::make_fixed(FixedOperatorKind::LOGTEST), mr_logand.maps.forms.at(0), - mr_logand.maps.forms.at(1)); + auto as_logtest = try_make_nonzero_logtest(source_forms.at(0), pool); + if (as_logtest) { + auto logtest_form = pool.alloc_single_form(nullptr, as_logtest); + auto not_form = pool.alloc_element( + GenericOperator::make_compare(IR2_Condition::Kind::FALSE), logtest_form); + return not_form; } - return nullptr; + */ + + return pool.alloc_element(GenericOperator::make_compare(m_kind), source_forms); } FormElement* try_make_logtest_cpad_macro(Form* in, FormPool& pool) { @@ -3969,12 +4303,7 @@ FormElement* try_make_logtest_cpad_macro(Form* in, FormPool& pool) { if (logtest_elt != nullptr) { auto buttons_form = logtest_elt->elts().at(1); std::vector v; - if (mr.maps.forms.find(0) != mr.maps.forms.end()) { - v.push_back(mr.maps.forms.at(0)); - } else { - v.push_back( - pool.form(SimpleAtom::make_int_constant(mr.maps.ints.at(0)))); - } + v.push_back(mr.int_or_form_to_form(pool, 0)); GenericElement* butts = dynamic_cast(buttons_form->at(0)); // the form with the buttons itself if (butts) { @@ -4014,8 +4343,7 @@ FormElement* ConditionElement::make_nonzero_check_generic(const Env& env, source_forms.at(0)); if (mr.matched) { s64 value = -mr.maps.ints.at(1); - auto value_form = pool.alloc_single_element_form( - nullptr, SimpleAtom::make_int_constant(value)); + auto value_form = pool.form(SimpleAtom::make_int_constant(value)); return pool.alloc_element(GenericOperator::make_fixed(FixedOperatorKind::NEQ), std::vector{mr.maps.forms.at(0), value_form}); } @@ -4054,6 +4382,29 @@ FormElement* ConditionElement::make_equal_check_generic(const Env& env, return pool.alloc_element(GenericOperator::make_fixed(FixedOperatorKind::EQ), forms_with_cast); } else { + { + // (= (ja-group) + // (-> self draw art-group data 7) + // ) + // actually (ja-group? (-> self draw art-group data 7) :channel channel) + auto mr = + match(Matcher::op(GenericOpMatcher::func(Matcher::constant_token("ja-group")), {}), + source_forms.at(0)); + // check if both things matched + if (mr.matched) { + // grab args from the ja-group and pass them on + std::vector macro_args; + macro_args.push_back(source_forms.at(1)); + + auto jagroup = source_forms.at(0)->try_as_element(); + for (size_t i = 1; i < jagroup->elts().size(); ++i) { + macro_args.push_back(jagroup->elts().at(i)); + } + return pool.alloc_element( + GenericOperator::make_function(pool.form("ja-group?")), + macro_args); + } + } return pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::EQ), cast_to_64_bit(source_forms, source_types, pool, env)); @@ -4074,8 +4425,8 @@ FormElement* ConditionElement::make_not_equal_check_generic( // null? return pool.alloc_element( GenericOperator::make_compare(IR2_Condition::Kind::FALSE), - pool.alloc_single_element_form( - nullptr, GenericOperator::make_fixed(FixedOperatorKind::NULLP), source_forms.at(0))); + pool.form(GenericOperator::make_fixed(FixedOperatorKind::NULLP), + source_forms.at(0))); } else { auto nice_constant = try_make_constant_for_compare(source_forms.at(1), source_types.at(0), pool, env); @@ -4115,8 +4466,7 @@ FormElement* ConditionElement::make_less_than_zero_signed_check_generic( shift_match.maps.forms.at(0)); } else { auto casted = make_casts_if_needed(source_forms, types, TypeSpec("int"), pool, env); - auto zero = pool.alloc_single_element_form(nullptr, - SimpleAtom::make_int_constant(0)); + auto zero = pool.form(SimpleAtom::make_int_constant(0)); casted.push_back(zero); return pool.alloc_element(GenericOperator::make_fixed(FixedOperatorKind::LT), casted); @@ -4144,13 +4494,11 @@ FormElement* ConditionElement::make_geq_zero_signed_check_generic( if (shift_match.matched) { return pool.alloc_element( GenericOperator::make_compare(IR2_Condition::Kind::FALSE), - pool.alloc_single_element_form( - nullptr, GenericOperator::make_fixed(FixedOperatorKind::PAIRP), - shift_match.maps.forms.at(0))); + pool.form(GenericOperator::make_fixed(FixedOperatorKind::PAIRP), + shift_match.maps.forms.at(0))); } else { auto casted = make_casts_if_needed(source_forms, types, TypeSpec("int"), pool, env); - auto zero = pool.alloc_single_element_form(nullptr, - SimpleAtom::make_int_constant(0)); + auto zero = pool.form(SimpleAtom::make_int_constant(0)); casted.push_back(zero); return pool.alloc_element(GenericOperator::make_fixed(FixedOperatorKind::GEQ), casted); @@ -4176,8 +4524,7 @@ FormElement* ConditionElement::make_geq_zero_unsigned_check_generic( source_forms.at(0)); auto casted = make_casts_if_needed(source_forms, types, TypeSpec("uint"), pool, env); - auto zero = - pool.alloc_single_element_form(nullptr, SimpleAtom::make_int_constant(0)); + auto zero = pool.form(SimpleAtom::make_int_constant(0)); casted.push_back(zero); return pool.alloc_element(GenericOperator::make_fixed(FixedOperatorKind::GEQ), casted); @@ -4231,8 +4578,7 @@ FormElement* ConditionElement::make_generic(const Env& env, case IR2_Condition::Kind::LESS_THAN_ZERO_UNSIGNED: { auto casted = make_casts_if_needed(source_forms, types, TypeSpec("uint"), pool, env); - auto zero = pool.alloc_single_element_form( - nullptr, SimpleAtom::make_int_constant(0)); + auto zero = pool.form(SimpleAtom::make_int_constant(0)); casted.push_back(zero); return pool.alloc_element(GenericOperator::make_fixed(FixedOperatorKind::LT), casted); @@ -4240,8 +4586,7 @@ FormElement* ConditionElement::make_generic(const Env& env, case IR2_Condition::Kind::LEQ_ZERO_SIGNED: { auto casted = make_casts_if_needed(source_forms, types, TypeSpec("int"), pool, env); - auto zero = pool.alloc_single_element_form( - nullptr, SimpleAtom::make_int_constant(0)); + auto zero = pool.form(SimpleAtom::make_int_constant(0)); casted.push_back(zero); return pool.alloc_element(GenericOperator::make_fixed(FixedOperatorKind::LEQ), casted); @@ -4257,8 +4602,7 @@ FormElement* ConditionElement::make_generic(const Env& env, case IR2_Condition::Kind::GREATER_THAN_ZERO_UNSIGNED: { auto casted = make_casts_if_needed(source_forms, types, TypeSpec("uint"), pool, env); - auto zero = pool.alloc_single_element_form( - nullptr, SimpleAtom::make_int_constant(0)); + auto zero = pool.form(SimpleAtom::make_int_constant(0)); casted.push_back(zero); return pool.alloc_element(GenericOperator::make_fixed(FixedOperatorKind::GT), casted); @@ -4266,8 +4610,7 @@ FormElement* ConditionElement::make_generic(const Env& env, case IR2_Condition::Kind::GREATER_THAN_ZERO_SIGNED: { auto casted = make_casts_if_needed(source_forms, types, TypeSpec("int"), pool, env); - auto zero = pool.alloc_single_element_form( - nullptr, SimpleAtom::make_int_constant(0)); + auto zero = pool.form(SimpleAtom::make_int_constant(0)); casted.push_back(zero); return pool.alloc_element(GenericOperator::make_fixed(FixedOperatorKind::GT), casted); @@ -4356,7 +4699,7 @@ void ConditionElement::push_to_stack(const Env& env, FormPool& pool, FormStack& if (m_src[i]->is_var()) { source_forms.push_back(popped_forms.at(popped_counter++)); } else { - source_forms.push_back(pool.alloc_single_element_form(nullptr, *m_src[i])); + source_forms.push_back(pool.form(*m_src[i])); } } ASSERT(popped_counter == int(popped_forms.size())); @@ -4409,7 +4752,7 @@ void ConditionElement::update_from_stack(const Env& env, if (m_src[i]->is_var()) { source_forms.push_back(popped_forms.at(popped_counter++)); } else { - source_forms.push_back(pool.alloc_single_element_form(nullptr, *m_src[i])); + source_forms.push_back(pool.form(*m_src[i])); } } ASSERT(popped_counter == int(popped_forms.size())); @@ -4542,8 +4885,8 @@ void push_asm_sllv_to_stack(const AsmOp* op, // these are lazily converted at the destination. stack.push_value_to_reg( *dst, - pool.alloc_single_element_form( - nullptr, GenericOperator::make_fixed(FixedOperatorKind::ASM_SLLV_R0), src_var), + pool.form(GenericOperator::make_fixed(FixedOperatorKind::ASM_SLLV_R0), + src_var), true, env.get_variable_type(*dst, true)); } } @@ -4701,7 +5044,7 @@ void AtomicOpElement::push_to_stack(const Env& env, FormPool& pool, FormStack& s auto delay = as_branch->branch_delay(); ASSERT(delay); // this might not be enough - we may need to back up to the cfg builder and do something there. - auto del = pool.alloc_single_element_form(nullptr, delay); + auto del = pool.form(delay); auto be = pool.alloc_element(as_branch, del, false); be->push_to_stack(env, pool, stack); return; @@ -4783,27 +5126,22 @@ void BranchElement::push_to_stack(const Env& env, FormPool& pool, FormStack& sta auto src = m_op->branch_delay().var(1); auto dst = m_op->branch_delay().var(0); - auto src_form = - pool.alloc_single_element_form(nullptr, SimpleAtom::make_var(src)); + auto src_form = pool.form(SimpleAtom::make_var(src)); - branch_delay = pool.alloc_single_element_form( - nullptr, dst, src_form, true, env.get_variable_type(src, true)); + branch_delay = + pool.form(dst, src_form, true, env.get_variable_type(src, true)); } break; case IR2_BranchDelay::Kind::SET_REG_FALSE: { auto dst = m_op->branch_delay().var(0); - auto src_form = pool.alloc_single_element_form( - nullptr, SimpleAtom::make_sym_val("#f")); + auto src_form = pool.form(SimpleAtom::make_sym_val("#f")); - branch_delay = pool.alloc_single_element_form(nullptr, dst, src_form, true, - TypeSpec("symbol")); + branch_delay = pool.form(dst, src_form, true, TypeSpec("symbol")); } break; case IR2_BranchDelay::Kind::SET_REG_TRUE: { auto dst = m_op->branch_delay().var(0); - auto src_form = pool.alloc_single_element_form( - nullptr, SimpleAtom::make_sym_val("#t")); + auto src_form = pool.form(SimpleAtom::make_sym_val("#t")); - branch_delay = pool.alloc_single_element_form(nullptr, dst, src_form, true, - TypeSpec("symbol")); + branch_delay = pool.form(dst, src_form, true, TypeSpec("symbol")); } break; default: throw std::runtime_error("Unhandled branch delay in BranchElement::push_to_stack: " + @@ -4843,8 +5181,8 @@ void DynamicMethodAccess::update_from_stack(const Env& env, // (+ (* method-id 4) (the-as int child-type)) auto mult_matcher = - Matcher::fixed_op(FixedOperatorKind::MULTIPLICATION, {reg0_matcher, Matcher::integer(4)}); - auto matcher = Matcher::fixed_op(FixedOperatorKind::ADDITION, {mult_matcher, reg1_matcher}); + Matcher::op_fixed(FixedOperatorKind::MULTIPLICATION, {reg0_matcher, Matcher::integer(4)}); + auto matcher = Matcher::op_fixed(FixedOperatorKind::ADDITION, {mult_matcher, reg1_matcher}); auto match_result = match(matcher, new_val); if (!match_result.matched) { throw std::runtime_error("Could not match DynamicMethodAccess values: " + @@ -4884,8 +5222,8 @@ void ArrayFieldAccess::update_with_val(Form* new_val, // (&+ data-ptr ) auto matcher = Matcher::match_or( - {Matcher::fixed_op(FixedOperatorKind::ADDITION, {base_matcher, offset_matcher}), - Matcher::fixed_op(FixedOperatorKind::ADDITION_PTR, {base_matcher, offset_matcher})}); + {Matcher::op_fixed(FixedOperatorKind::ADDITION, {base_matcher, offset_matcher}), + Matcher::op_fixed(FixedOperatorKind::ADDITION_PTR, {base_matcher, offset_matcher})}); auto match_result = match(matcher, new_val); if (!match_result.matched) { @@ -4919,17 +5257,17 @@ void ArrayFieldAccess::update_with_val(Form* new_val, Matcher::cast("uint", Matcher::any(0)), Matcher::any(0)}); auto reg1_matcher = Matcher::match_or({Matcher::cast("uint", Matcher::any(1)), Matcher::any(1)}); - auto mult_matcher = Matcher::fixed_op(FixedOperatorKind::MULTIPLICATION, + auto mult_matcher = Matcher::op_fixed(FixedOperatorKind::MULTIPLICATION, {reg1_matcher, Matcher::integer(m_expected_stride)}); mult_matcher = Matcher::match_or({Matcher::cast("uint", mult_matcher), mult_matcher}); auto matcher = Matcher::match_or( - {Matcher::fixed_op(FixedOperatorKind::ADDITION, {reg0_matcher, mult_matcher}), - Matcher::fixed_op(FixedOperatorKind::ADDITION_PTR, {reg0_matcher, mult_matcher})}); + {Matcher::op_fixed(FixedOperatorKind::ADDITION, {reg0_matcher, mult_matcher}), + Matcher::op_fixed(FixedOperatorKind::ADDITION_PTR, {reg0_matcher, mult_matcher})}); auto match_result = match(matcher, new_val); if (!match_result.matched) { matcher = Matcher::match_or( - {Matcher::fixed_op(FixedOperatorKind::ADDITION, {mult_matcher, reg0_matcher}), - Matcher::fixed_op(FixedOperatorKind::ADDITION_PTR, {mult_matcher, reg0_matcher})}); + {Matcher::op_fixed(FixedOperatorKind::ADDITION, {mult_matcher, reg0_matcher}), + Matcher::op_fixed(FixedOperatorKind::ADDITION_PTR, {mult_matcher, reg0_matcher})}); match_result = match(matcher, new_val); if (!match_result.matched) { result->push_back(this); @@ -5002,7 +5340,7 @@ void ArrayFieldAccess::update_with_val(Form* new_val, auto reg1_matcher = Matcher::match_or({Matcher::cast("int", Matcher::any(1)), Matcher::cast("uint", Matcher::any(1)), Matcher::any(1)}); - auto matcher = Matcher::fixed_op(FixedOperatorKind::ADDITION, {reg0_matcher, reg1_matcher}); + auto matcher = Matcher::op_fixed(FixedOperatorKind::ADDITION, {reg0_matcher, reg1_matcher}); auto match_result = match(matcher, new_val); if (!match_result.matched) { throw std::runtime_error("Could not match ArrayFieldAccess (stride 1) values: " + @@ -5030,18 +5368,18 @@ void ArrayFieldAccess::update_with_val(Form* new_val, auto reg1_matcher = Matcher::match_or({Matcher::cast("uint", Matcher::any(1)), Matcher::cast("int", Matcher::any(1)), Matcher::any(1)}); - auto mult_matcher = Matcher::fixed_op(FixedOperatorKind::MULTIPLICATION, + auto mult_matcher = Matcher::op_fixed(FixedOperatorKind::MULTIPLICATION, {reg0_matcher, Matcher::integer(m_expected_stride)}); mult_matcher = Matcher::match_or({Matcher::cast("uint", mult_matcher), mult_matcher}); - auto matcher = Matcher::fixed_op(FixedOperatorKind::ADDITION, {mult_matcher, reg1_matcher}); - matcher = Matcher::match_or({matcher, Matcher::fixed_op(FixedOperatorKind::ADDITION_PTR, + auto matcher = Matcher::op_fixed(FixedOperatorKind::ADDITION, {mult_matcher, reg1_matcher}); + matcher = Matcher::match_or({matcher, Matcher::op_fixed(FixedOperatorKind::ADDITION_PTR, {reg1_matcher, mult_matcher})}); auto match_result = match(matcher, new_val); Form* idx = nullptr; Form* base = nullptr; // TODO - figure out why it sometimes happens the other way. if (!match_result.matched) { - matcher = Matcher::fixed_op(FixedOperatorKind::ADDITION, {reg1_matcher, mult_matcher}); + matcher = Matcher::op_fixed(FixedOperatorKind::ADDITION, {reg1_matcher, mult_matcher}); match_result = match(matcher, new_val); if (!match_result.matched) { throw std::runtime_error("Could not match ArrayFieldAccess (stride power of 2) values: " + @@ -5192,8 +5530,7 @@ void ConditionalMoveFalseElement::push_to_stack(const Env& env, FormPool& pool, } if (!val) { - val = pool.alloc_single_element_form( - nullptr, + val = pool.form( GenericOperator::make_compare(on_zero ? IR2_Condition::Kind::NONZERO : IR2_Condition::Kind::ZERO), std::vector{popped.at(1)}); @@ -5211,11 +5548,10 @@ void StackSpillStoreElement::push_to_stack(const Env& env, FormPool& pool, FormS if (m_value.is_var()) { src = pop_to_forms({m_value.var()}, env, pool, stack, true).at(0); } else { - src = pool.alloc_single_element_form(nullptr, m_value); + src = pool.form(m_value); } - auto dst = pool.alloc_single_element_form( - nullptr, env.get_spill_slot_var_name(m_stack_offset)); + auto dst = pool.form(env.get_spill_slot_var_name(m_stack_offset)); if (m_cast_type) { src = cast_form(src, *m_cast_type, pool, env); } @@ -5316,10 +5652,8 @@ bool try_vector_reset_inline(const Env& env, store = repop_passthrough_arg(store, stack, env, &orig, &got_orig); // create the actual form - Form* new_thing = pool.alloc_single_element_form( - nullptr, - GenericOperator::make_function( - pool.alloc_single_element_form(nullptr, "vector-reset!")), + Form* new_thing = pool.form( + GenericOperator::make_function(pool.form("vector-reset!")), std::vector{store}); if (got_orig) { @@ -5391,24 +5725,21 @@ void MethodOfTypeElement::update_from_stack(const Env& env, type_as_deref->tokens().pop_back(); result->push_back(pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::METHOD_OF_OBJECT), - std::vector{type, pool.alloc_single_element_form( - nullptr, m_method_info.name)})); + std::vector{type, pool.form(m_method_info.name)})); return; } else if (type_as_deref->tokens().size() == 1 && type_as_deref->tokens().back().is_field_name("type")) { result->push_back(pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::METHOD_OF_OBJECT), - std::vector{ - type_as_deref->base(), - pool.alloc_single_element_form(nullptr, m_method_info.name)})); + std::vector{type_as_deref->base(), + pool.form(m_method_info.name)})); return; } } result->push_back(pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::METHOD_OF_TYPE), - std::vector{type, pool.alloc_single_element_form( - nullptr, m_method_info.name)})); + std::vector{type, pool.form(m_method_info.name)})); } void SimpleAtomElement::update_from_stack(const Env&, diff --git a/decompiler/IR2/FormStack.cpp b/decompiler/IR2/FormStack.cpp index 154b7b2f5a..0507d98a5b 100644 --- a/decompiler/IR2/FormStack.cpp +++ b/decompiler/IR2/FormStack.cpp @@ -1,7 +1,10 @@ -#include #include "FormStack.h" + +#include + #include "Form.h" #include "GenericElementMatcher.h" + #include "decompiler/Function/Function.h" #include "decompiler/util/DecompilerTypeSystem.h" diff --git a/decompiler/IR2/FormStack.h b/decompiler/IR2/FormStack.h index bb5e74200c..680d560c03 100644 --- a/decompiler/IR2/FormStack.h +++ b/decompiler/IR2/FormStack.h @@ -1,6 +1,7 @@ #pragma once #include + #include "decompiler/Disasm/Register.h" #include "decompiler/IR2/AtomicOp.h" diff --git a/decompiler/IR2/GenericElementMatcher.cpp b/decompiler/IR2/GenericElementMatcher.cpp index 7a68eb0e09..7ee43c656b 100644 --- a/decompiler/IR2/GenericElementMatcher.cpp +++ b/decompiler/IR2/GenericElementMatcher.cpp @@ -15,6 +15,13 @@ Matcher Matcher::any_label(int match_id) { return m; } +Matcher Matcher::reg(Register reg) { + Matcher m; + m.m_kind = Kind::REG; + m.m_reg = reg; + return m; +} + Matcher Matcher::op(const GenericOpMatcher& op, const std::vector& args) { Matcher m; m.m_kind = Kind::GENERIC_OP; @@ -23,6 +30,14 @@ Matcher Matcher::op(const GenericOpMatcher& op, const std::vector& args return m; } +Matcher Matcher::func(const Matcher& matcher, const std::vector& args) { + return Matcher::op(GenericOpMatcher::func(matcher), args); +} + +Matcher Matcher::func(const std::string& name, const std::vector& args) { + return Matcher::op(GenericOpMatcher::func(Matcher::constant_token(name)), args); +} + Matcher Matcher::op_fixed(FixedOperatorKind op, const std::vector& args) { return Matcher::op(GenericOpMatcher::fixed(op), args); } @@ -35,12 +50,12 @@ Matcher Matcher::op_with_rest(const GenericOpMatcher& op, const std::vector& args) { - Matcher m; - m.m_kind = Kind::GENERIC_OP; - m.m_gen_op_matcher = std::make_shared(GenericOpMatcher::fixed(op)); - m.m_sub_matchers = args; - return m; +Matcher Matcher::func_with_rest(const Matcher& matcher, const std::vector& args) { + return Matcher::op_with_rest(GenericOpMatcher::func(matcher), args); +} + +Matcher Matcher::func_with_rest(const std::string& name, const std::vector& args) { + return Matcher::op_with_rest(GenericOpMatcher::func(Matcher::constant_token(name)), args); } Matcher Matcher::match_or(const std::vector& args) { @@ -79,6 +94,13 @@ Matcher Matcher::any_integer(int match_id) { return m; } +Matcher Matcher::single(std::optional value) { + Matcher m; + m.m_kind = Kind::FLOAT; + m.m_float_match = value; + return m; +} + Matcher Matcher::any_quoted_symbol(int match_id) { Matcher m; m.m_kind = Kind::ANY_QUOTED_SYMBOL; @@ -184,7 +206,8 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const { maps_out->forms[m_form_match] = input; } return true; - case Kind::ANY_REG: { + case Kind::ANY_REG: + case Kind::REG: { bool got = false; RegisterAccess result; @@ -206,7 +229,9 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const { } if (got) { - if (m_reg_out_id != -1) { + if (m_kind == Kind::REG) { + return result.reg() == *m_reg; + } else if (m_reg_out_id != -1) { maps_out->regs.resize(std::max(size_t(m_reg_out_id + 1), maps_out->regs.size())); maps_out->regs.at(m_reg_out_id) = result; } @@ -247,27 +272,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const { } } break; - case Kind::GENERIC_OP: { - auto as_generic = dynamic_cast(input->try_as_single_active_element()); - if (as_generic) { - if (!m_gen_op_matcher->do_match(as_generic->op(), maps_out)) { - return false; - } - - if (as_generic->elts().size() != m_sub_matchers.size()) { - return false; - } - - for (size_t i = 0; i < m_sub_matchers.size(); i++) { - if (!m_sub_matchers.at(i).do_match(as_generic->elts().at(i), maps_out)) { - return false; - } - } - return true; - } - return false; - } break; - + case Kind::GENERIC_OP: case Kind::GENERIC_OP_WITH_REST: { auto as_generic = dynamic_cast(input->try_as_single_active_element()); if (as_generic) { @@ -275,7 +280,9 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const { return false; } - if (as_generic->elts().size() < m_sub_matchers.size()) { + if ((m_kind == Kind::GENERIC_OP && as_generic->elts().size() != m_sub_matchers.size()) || + (m_kind == Kind::GENERIC_OP_WITH_REST && + as_generic->elts().size() < m_sub_matchers.size())) { return false; } @@ -341,7 +348,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const { auto as_expr = dynamic_cast(input->try_as_single_active_element()); if (as_expr && as_expr->expr().is_identity()) { - auto atom = as_expr->expr().get_arg(0); + const auto& atom = as_expr->expr().get_arg(0); if (atom.is_int()) { if (!m_int_match.has_value()) { return true; @@ -353,6 +360,19 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const { return false; } break; + case Kind::FLOAT: { + auto as_const_float = + dynamic_cast(input->try_as_single_active_element()); + if (as_const_float) { + if (!m_float_match.has_value()) { + return true; + } + return as_const_float->value() == *m_float_match; + } + + return false; + } break; + case Kind::ANY_INT: { auto as_simple_atom = dynamic_cast(input->try_as_single_active_element()); if (as_simple_atom) { @@ -366,7 +386,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const { auto as_expr = dynamic_cast(input->try_as_single_active_element()); if (as_expr && as_expr->expr().is_identity()) { - auto atom = as_expr->expr().get_arg(0); + const auto& atom = as_expr->expr().get_arg(0); if (atom.is_int()) { if (m_int_out_id != -1) { maps_out->ints[m_int_out_id] = atom.get_int(); @@ -391,7 +411,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const { auto as_expr = dynamic_cast(input->try_as_single_active_element()); if (as_expr && as_expr->expr().is_identity()) { - auto atom = as_expr->expr().get_arg(0); + const auto& atom = as_expr->expr().get_arg(0); if (atom.is_sym_ptr()) { if (m_string_out_id != -1) { maps_out->strings[m_string_out_id] = atom.get_str(); @@ -415,7 +435,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const { auto as_expr = dynamic_cast(input->try_as_single_active_element()); if (as_expr && as_expr->expr().is_identity()) { - auto atom = as_expr->expr().get_arg(0); + const auto& atom = as_expr->expr().get_arg(0); if (atom.is_sym_val()) { if (m_string_out_id != -1) { maps_out->strings[m_string_out_id] = atom.get_str(); @@ -436,7 +456,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const { auto as_expr = dynamic_cast(input->try_as_single_active_element()); if (as_expr && as_expr->expr().is_identity()) { - auto atom = as_expr->expr().get_arg(0); + const auto& atom = as_expr->expr().get_arg(0); if (atom.is_sym_val()) { return atom.get_str() == m_str; } @@ -610,6 +630,14 @@ MatchResult match(const Matcher& spec, Form* input) { return result; } +MatchResult match(const Matcher& spec, FormElement* input) { + Form hack; + hack.elts().push_back(input); + MatchResult result; + result.matched = spec.do_match(&hack, &result.maps); + return result; +} + DerefTokenMatcher DerefTokenMatcher::string(const std::string& str) { DerefTokenMatcher result; result.m_kind = Kind::STRING; diff --git a/decompiler/IR2/GenericElementMatcher.h b/decompiler/IR2/GenericElementMatcher.h index bb71d466cd..3f3df55456 100644 --- a/decompiler/IR2/GenericElementMatcher.h +++ b/decompiler/IR2/GenericElementMatcher.h @@ -20,23 +20,37 @@ struct MatchResult { std::unordered_map label; std::unordered_map ints; } maps; + + Form* int_or_form_to_form(FormPool& pool, int key_idx) { + if (maps.forms.find(key_idx) != maps.forms.end()) { + return maps.forms.at(key_idx); + } else { + return pool.form(SimpleAtom::make_int_constant(maps.ints.at(key_idx))); + } + } }; class Matcher { public: static Matcher any_reg(int match_id = -1); static Matcher any_label(int match_id = -1); + static Matcher reg(Register reg); + static inline Matcher s6() { return Matcher::reg(Register(Reg::GPR, Reg::S6)); } static Matcher op(const GenericOpMatcher& op, const std::vector& args); + static Matcher func(const Matcher& match, const std::vector& args); + static Matcher func(const std::string& name, const std::vector& args); static Matcher op_fixed(FixedOperatorKind op, const std::vector& args); static Matcher op_with_rest(const GenericOpMatcher& op, const std::vector& args); + static Matcher func_with_rest(const Matcher& match, const std::vector& args); + static Matcher func_with_rest(const std::string& name, const std::vector& args); static Matcher set(const Matcher& dst, const Matcher& src); // form-form static Matcher set_var(const Matcher& src, int dst_match_id); // var-form - static Matcher fixed_op(FixedOperatorKind op, const std::vector& args); static Matcher match_or(const std::vector& args); static Matcher cast(const std::string& type, Matcher value); static Matcher any(int match_id = -1); static Matcher integer(std::optional value); static Matcher any_integer(int match_id = -1); + static Matcher single(std::optional value); static Matcher any_reg_cast_to_int_or_uint(int match_id = -1); static Matcher any_quoted_symbol(int match_id = -1); static Matcher any_symbol(int match_id = -1); @@ -63,6 +77,7 @@ class Matcher { ANY, INT, ANY_INT, + FLOAT, ANY_QUOTED_SYMBOL, ANY_SYMBOL, DEREF_OP, @@ -77,6 +92,7 @@ class Matcher { CONSTANT_TOKEN, SC_OR, BEGIN, + REG, // a specific register. like s6. INVALID }; @@ -94,10 +110,13 @@ class Matcher { int m_label_out_id = -1; int m_int_out_id = -1; std::optional m_int_match; + std::optional m_float_match; + std::optional m_reg; std::string m_str; }; MatchResult match(const Matcher& spec, Form* input); +MatchResult match(const Matcher& spec, FormElement* input); class DerefTokenMatcher { public: diff --git a/decompiler/IR2/IR2_common.h b/decompiler/IR2/IR2_common.h index e51b063722..9248de12ed 100644 --- a/decompiler/IR2/IR2_common.h +++ b/decompiler/IR2/IR2_common.h @@ -1,11 +1,14 @@ #pragma once #include + #include "common/common_types.h" #include "common/goos/Object.h" + #include "decompiler/Disasm/Register.h" -#include "decompiler/util/TP_Type.h" -#include "third-party/fmt/core.h" #include "decompiler/Function/Warnings.h" +#include "decompiler/util/TP_Type.h" + +#include "third-party/fmt/core.h" namespace decompiler { enum class AccessMode : u8 { @@ -123,6 +126,7 @@ enum class FixedOperatorKind { LOGIOR, LOGIOR_IN_PLACE, LOGXOR, + LOGXOR_IN_PLACE, LOGNOR, LOGNOT, LOGCLEAR, diff --git a/decompiler/IR2/LabelDB.cpp b/decompiler/IR2/LabelDB.cpp index 9980f0e880..4d9dc8a4b2 100644 --- a/decompiler/IR2/LabelDB.cpp +++ b/decompiler/IR2/LabelDB.cpp @@ -1,7 +1,7 @@ -#include "third-party/fmt/core.h" - #include "LabelDB.h" +#include "third-party/fmt/core.h" + namespace decompiler { std::string LabelInfo::print() const { diff --git a/decompiler/IR2/LabelDB.h b/decompiler/IR2/LabelDB.h index 208f098655..d9247ee939 100644 --- a/decompiler/IR2/LabelDB.h +++ b/decompiler/IR2/LabelDB.h @@ -1,13 +1,15 @@ #pragma once #include -#include -#include #include +#include +#include + #include "common/link_types.h" #include "common/type_system/TypeSpec.h" -#include "decompiler/config.h" + #include "decompiler/Disasm/DecompilerLabel.h" +#include "decompiler/config.h" #include "decompiler/util/DecompilerTypeSystem.h" namespace decompiler { diff --git a/decompiler/IR2/OpenGoalMapping.cpp b/decompiler/IR2/OpenGoalMapping.cpp index 27b01bee45..13f3ba143b 100644 --- a/decompiler/IR2/OpenGoalMapping.cpp +++ b/decompiler/IR2/OpenGoalMapping.cpp @@ -1,7 +1,9 @@ #include "OpenGoalMapping.h" -#include "common/goos/PrettyPrinter.h" + #include +#include "common/goos/PrettyPrinter.h" + namespace decompiler { typedef OpenGOALAsm::InstructionModifiers MOD; diff --git a/decompiler/IR2/OpenGoalMapping.h b/decompiler/IR2/OpenGoalMapping.h index 41ec97d227..cd575af10a 100644 --- a/decompiler/IR2/OpenGoalMapping.h +++ b/decompiler/IR2/OpenGoalMapping.h @@ -1,17 +1,20 @@ #pragma once -#include -#include -#include #include -#include "common/goos/Object.h" -#include "decompiler/Disasm/Register.h" -#include "decompiler/Disasm/Instruction.h" -#include "decompiler/IR2/IR2_common.h" -#include "Env.h" +#include +#include +#include + #include "AtomicOp.h" +#include "Env.h" + +#include "common/goos/Object.h" #include "common/util/Assert.h" +#include "decompiler/Disasm/Instruction.h" +#include "decompiler/Disasm/Register.h" +#include "decompiler/IR2/IR2_common.h" + namespace decompiler { struct OpenGOALAsm { diff --git a/decompiler/IR2/bitfields.cpp b/decompiler/IR2/bitfields.cpp index 4af6d6a0e1..124fc4821e 100644 --- a/decompiler/IR2/bitfields.cpp +++ b/decompiler/IR2/bitfields.cpp @@ -1,12 +1,13 @@ #include "bitfields.h" -#include "decompiler/IR2/Form.h" #include "common/goos/PrettyPrinter.h" -#include "common/util/Range.h" #include "common/util/BitUtils.h" -#include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/IR2/GenericElementMatcher.h" +#include "common/util/Range.h" + #include "decompiler/Function/Function.h" +#include "decompiler/IR2/Form.h" +#include "decompiler/IR2/GenericElementMatcher.h" +#include "decompiler/util/DecompilerTypeSystem.h" namespace decompiler { @@ -547,8 +548,7 @@ FormElement* BitfieldAccessElement::push_step(const BitfieldManip step, BitFieldDef def; def.field_name = field->name(); - def.value = pool.alloc_single_element_form( - nullptr, SimpleAtom::make_int_constant(set_value)); + def.value = pool.form(SimpleAtom::make_int_constant(set_value)); return pool.alloc_element(m_type, m_base, m_got_pcpyud, std::vector{def}); } @@ -580,8 +580,7 @@ FormElement* BitfieldAccessElement::push_step(const BitfieldManip step, BitFieldDef def; def.field_name = field->name(); - def.value = pool.alloc_single_element_form( - nullptr, SimpleAtom::make_int_constant(set_value)); + def.value = pool.form(SimpleAtom::make_int_constant(set_value)); return pool.alloc_element(m_type, m_base, m_got_pcpyud, std::vector{def}); } @@ -711,14 +710,11 @@ BitFieldDef BitFieldDef::from_constant(const BitFieldConstantDef& constant, Form for (auto& x : constant.nested_field->fields) { defs.push_back(BitFieldDef::from_constant(x, pool)); } - bfd.value = pool.alloc_single_element_form( - nullptr, constant.nested_field->field_type, defs); + bfd.value = pool.form(constant.nested_field->field_type, defs); } else if (constant.enum_constant) { - bfd.value = - pool.alloc_single_element_form(nullptr, *constant.enum_constant); + bfd.value = pool.form(*constant.enum_constant); } else { - bfd.value = pool.alloc_single_element_form( - nullptr, SimpleAtom::make_int_constant(constant.value)); + bfd.value = pool.form(SimpleAtom::make_int_constant(constant.value)); } return bfd; @@ -758,8 +754,7 @@ Form* cast_sound_name(FormPool& pool, const Env& env, Form* in) { } } - return pool.alloc_single_element_form( - nullptr, fmt::format("(static-sound-name \"{}\")", name)); + return pool.form(fmt::format("(static-sound-name \"{}\")", name)); } std::optional> get_field_defs_from_expr(const BitFieldType* type_info, @@ -821,8 +816,7 @@ std::optional> get_field_defs_from_expr(const BitFieldT float value_f; u32 value_i = *integer; memcpy(&value_f, &value_i, 4); - maybe_field->value = - pool.alloc_single_element_form(nullptr, value_f); + maybe_field->value = pool.form(value_f); } } @@ -859,7 +853,7 @@ Form* cast_to_bitfield(const BitFieldType* type_info, return as_sound_name; } // just do a normal cast if that failed. - return pool.alloc_single_element_form(nullptr, typespec, in); + return pool.form(typespec, in); } // check if it's just a constant: @@ -869,17 +863,16 @@ Form* cast_to_bitfield(const BitFieldType* type_info, auto fields = try_decompile_bitfield_from_int(typespec, env.dts->ts, in_as_atom->get_int(), false, {}); if (!fields) { - return pool.alloc_single_element_form(nullptr, typespec, in); + return pool.form(typespec, in); } - return pool.alloc_single_element_form(nullptr, typespec, *fields, - pool); + return pool.form(typespec, *fields, pool); } bool bitfield_128 = type_info->get_size_in_memory() == 16; if (bitfield_128) { auto in_no_cast = strip_int_or_uint_cast(in); auto pcpyld_matcher = - Matcher::fixed_op(FixedOperatorKind::PCPYLD, {Matcher::any(0), Matcher::any(1)}); + Matcher::op_fixed(FixedOperatorKind::PCPYLD, {Matcher::any(0), Matcher::any(1)}); auto mr = match(pcpyld_matcher, in_no_cast); if (mr.matched) { auto upper = mr.maps.forms.at(0); @@ -890,22 +883,20 @@ Form* cast_to_bitfield(const BitFieldType* type_info, if (upper_defs && lower_defs) { lower_defs->insert(lower_defs->end(), upper_defs->begin(), upper_defs->end()); - return pool.alloc_single_element_form(nullptr, typespec, - *lower_defs); + return pool.form(typespec, *lower_defs); } } - return pool.alloc_single_element_form(nullptr, typespec, in); + return pool.form(typespec, in); } else { // dynamic bitfield def auto field_defs = get_field_defs_from_expr(type_info, in, typespec, pool, env, {}); if (field_defs) { - return pool.alloc_single_element_form(nullptr, typespec, - *field_defs); + return pool.form(typespec, *field_defs); } } // all failed, just return whatever. - return pool.alloc_single_element_form(nullptr, typespec, in); + return pool.form(typespec, in); } Form* cast_to_bitfield_enum(const EnumType* type_info, @@ -919,7 +910,7 @@ Form* cast_to_bitfield_enum(const EnumType* type_info, return cast_to_bitfield_enum(type_info, pool, env, *integer); } else { // all failed, just return whatever. - return pool.alloc_single_element_form(nullptr, typespec, in); + return pool.form(typespec, in); } } @@ -934,29 +925,39 @@ Form* cast_to_int_enum(const EnumType* type_info, return cast_to_int_enum(type_info, pool, env, *integer); } else { // all failed, just return whatever. - return pool.alloc_single_element_form(nullptr, typespec, in); + return pool.form(typespec, in); } } Form* cast_to_int_enum(const EnumType* type_info, FormPool& pool, const Env& env, s64 in) { ASSERT(!type_info->is_bitfield()); auto entry = decompile_int_enum_from_int(TypeSpec(type_info->get_name()), env.dts->ts, in); - auto oper = GenericOperator::make_function( - pool.alloc_single_element_form(nullptr, type_info->get_name())); - return pool.alloc_single_element_form( - nullptr, oper, pool.alloc_single_element_form(nullptr, entry)); + auto oper = + GenericOperator::make_function(pool.form(type_info->get_name())); + return pool.form(oper, pool.form(entry)); } -Form* cast_to_bitfield_enum(const EnumType* type_info, FormPool& pool, const Env& env, s64 in) { +Form* cast_to_bitfield_enum(const EnumType* type_info, + FormPool& pool, + const Env& env, + s64 in, + bool no_head) { ASSERT(type_info->is_bitfield()); auto elts = decompile_bitfield_enum_from_int(TypeSpec(type_info->get_name()), env.dts->ts, in); + if (no_head) { + ASSERT(elts.size() >= 1); + } auto oper = GenericOperator::make_function( - pool.alloc_single_element_form(nullptr, type_info->get_name())); + pool.form(no_head ? elts.at(0) : type_info->get_name())); + if (no_head) { + elts.erase(elts.begin()); + } + std::vector form_elts; for (auto& x : elts) { - form_elts.push_back(pool.alloc_single_element_form(nullptr, x)); + form_elts.push_back(pool.form(x)); } - return pool.alloc_single_element_form(nullptr, oper, form_elts); + return pool.form(oper, form_elts); } } // namespace decompiler diff --git a/decompiler/IR2/bitfields.h b/decompiler/IR2/bitfields.h index 2c92513fce..ca492b904e 100644 --- a/decompiler/IR2/bitfields.h +++ b/decompiler/IR2/bitfields.h @@ -1,9 +1,10 @@ #pragma once #include "common/common_types.h" +#include "common/util/Assert.h" + #include "decompiler/IR2/Form.h" #include "decompiler/util/data_decompile.h" -#include "common/util/Assert.h" namespace decompiler { struct BitfieldManip { @@ -203,7 +204,11 @@ Form* cast_to_int_enum(const EnumType* type_info, Form* in); Form* cast_to_int_enum(const EnumType* type_info, FormPool& pool, const Env& env, s64 in); -Form* cast_to_bitfield_enum(const EnumType* type_info, FormPool& pool, const Env& env, s64 in); +Form* cast_to_bitfield_enum(const EnumType* type_info, + FormPool& pool, + const Env& env, + s64 in, + bool no_head = false); std::optional get_goal_integer_constant(Form* in, const Env&); diff --git a/decompiler/ObjectFile/LinkedObjectFile.cpp b/decompiler/ObjectFile/LinkedObjectFile.cpp index 486fc366a6..12c6771534 100644 --- a/decompiler/ObjectFile/LinkedObjectFile.cpp +++ b/decompiler/ObjectFile/LinkedObjectFile.cpp @@ -3,18 +3,21 @@ * An object file's data with linking information included. */ +#include "LinkedObjectFile.h" + #include #include #include -#include "decompiler/IR/IR.h" -#include "third-party/fmt/core.h" -#include "LinkedObjectFile.h" + +#include "common/goos/PrettyPrinter.h" +#include "common/log/log.h" +#include "common/util/Assert.h" + #include "decompiler/Disasm/InstructionDecode.h" #include "decompiler/config.h" + +#include "third-party/fmt/core.h" #include "third-party/json.hpp" -#include "common/log/log.h" -#include "common/goos/PrettyPrinter.h" -#include "common/util/Assert.h" namespace decompiler { /*! @@ -397,7 +400,7 @@ void LinkedObjectFile::find_code() { /*! * Find all the functions in each segment. */ -void LinkedObjectFile::find_functions() { +void LinkedObjectFile::find_functions(GameVersion version) { if (segments == 1) { // it's a v2 file, shouldn't have any functions ASSERT(offset_of_data_zone_by_seg.at(0) == 0); @@ -424,7 +427,7 @@ void LinkedObjectFile::find_functions() { // mark this as a function, and try again from the current function start ASSERT(found_function_tag_loc); stats.function_count++; - functions_by_seg.at(seg).emplace_back(function_tag_loc, function_end); + functions_by_seg.at(seg).emplace_back(function_tag_loc, function_end, version); function_end = function_tag_loc; } @@ -445,6 +448,8 @@ void LinkedObjectFile::disassemble_functions() { decode_instruction(words_by_seg.at(seg).at(word), *this, seg, word)); if (function.instructions.back().is_valid()) { stats.decoded_ops++; + } else { + lg::error("Failed to decode op: 0x{:08x}", words_by_seg.at(seg).at(word).data); } } } @@ -507,32 +512,52 @@ void LinkedObjectFile::process_fp_relative_links() { case InstructionKind::DADDU: case InstructionKind::ADDU: { ASSERT(prev_instr); - if (prev_instr->kind != InstructionKind::ORI) { + if (prev_instr->kind == InstructionKind::ORI) { + ASSERT(prev_instr->kind == InstructionKind::ORI); + int offset_reg_src_id = instr.kind == InstructionKind::DADDU ? 0 : 1; + auto offset_reg = instr.get_src(offset_reg_src_id).get_reg(); + ASSERT(offset_reg == prev_instr->get_dst(0).get_reg()); + ASSERT(offset_reg == prev_instr->get_src(0).get_reg()); + auto& atom = prev_instr->get_imm_src(); + int additional_offset = 0; + if (pprev_instr && pprev_instr->kind == InstructionKind::LUI) { + ASSERT(pprev_instr->get_dst(0).get_reg() == offset_reg); + additional_offset = (1 << 16) * pprev_instr->get_imm_src().get_imm(); + pprev_instr->get_imm_src().set_label( + get_label_id_for(seg, current_fp + atom.get_imm() + additional_offset)); + } + atom.set_label( + get_label_id_for(seg, current_fp + atom.get_imm() + additional_offset)); + stats.n_fp_reg_use_resolved++; + } else if (prev_instr->kind == InstructionKind::DADDIU) { + /* + * Jak 2 has a new use of fp to access elements of a static array that looks like + * this: + * (set! v1 (* idx stride)) + * daddiu v1, v1, 8128 + * daddu v1, v1, fp + */ + auto val_plus_off_reg = prev_instr->get_dst(0).get_reg(); + + // it's possible that this isn't always the case, but works for all of jak 2 + ASSERT(val_plus_off_reg == prev_instr->get_src(0).get_reg()); + ASSERT(val_plus_off_reg == instr.get_src(0).get_reg()); + ASSERT(val_plus_off_reg == instr.get_dst(0).get_reg()); + auto& atom = prev_instr->get_imm_src(); + atom.set_label(get_label_id_for(seg, current_fp + atom.get_imm())); + + stats.n_fp_reg_use_resolved++; + } else { lg::error("Failed to process fp relative links for (d)addu preceded by: {}", prev_instr->to_string(labels)); return; } - ASSERT(prev_instr->kind == InstructionKind::ORI); - int offset_reg_src_id = instr.kind == InstructionKind::DADDU ? 0 : 1; - auto offset_reg = instr.get_src(offset_reg_src_id).get_reg(); - ASSERT(offset_reg == prev_instr->get_dst(0).get_reg()); - ASSERT(offset_reg == prev_instr->get_src(0).get_reg()); - auto& atom = prev_instr->get_imm_src(); - int additional_offset = 0; - if (pprev_instr && pprev_instr->kind == InstructionKind::LUI) { - ASSERT(pprev_instr->get_dst(0).get_reg() == offset_reg); - additional_offset = (1 << 16) * pprev_instr->get_imm_src().get_imm(); - pprev_instr->get_imm_src().set_label( - get_label_id_for(seg, current_fp + atom.get_imm() + additional_offset)); - } - atom.set_label( - get_label_id_for(seg, current_fp + atom.get_imm() + additional_offset)); - stats.n_fp_reg_use_resolved++; + } break; default: - printf("unknown fp using op: %s\n", instr.to_string(labels).c_str()); - ASSERT(false); + ASSERT_MSG(false, + fmt::format("unknown fp using op: {}", instr.to_string(labels).c_str())); } } } @@ -584,22 +609,8 @@ std::string LinkedObjectFile::print_function_disassembly(Function& func, auto& word = words_by_seg[seg].at(func.start_word + i); append_word_to_string(result, word); } else { - // print basic op stuff - if (func.has_basic_ops() && func.instr_starts_basic_op(i)) { - if (line.length() < 30) { - line.append(30 - line.length(), ' '); - } - line += ";; " + func.get_basic_op_at_instr(i)->print(*this); - for (int iidx = 0; iidx < instr.n_src; iidx++) { - if (instr.get_src(iidx).is_label()) { - auto lab = labels.at(instr.get_src(iidx).get_label()); - if (is_string(lab.target_segment, lab.offset)) { - line += " " + get_goal_string(lab.target_segment, lab.offset / 4 - 1); - } - } - } - } - result += line + "\n"; + result += line; + result += '\n'; } if (in_delay_slot) { @@ -659,11 +670,6 @@ std::string LinkedObjectFile::print_function_disassembly(Function& func, */ } - if (func.ir) { - result += ";; ir\n"; - result += func.ir->print(*this); - } - result += "\n\n\n"; return result; } @@ -935,16 +941,14 @@ goos::Object LinkedObjectFile::to_form_script_object(int seg, } else { std::string debug; append_word_to_string(debug, word); - printf("don't know how to print %s\n", debug.c_str()); - ASSERT(false); + ASSERT_MSG(false, fmt::format("don't know how to print {}", debug.c_str())); } } break; case 2: // bad, a pair snuck through. default: // pointers should be aligned! - printf("align %d\n", byte_idx & 7); - ASSERT(false); + ASSERT_MSG(false, fmt::format("align {}", byte_idx & 7)); } return result; diff --git a/decompiler/ObjectFile/LinkedObjectFile.h b/decompiler/ObjectFile/LinkedObjectFile.h index f50271cf7d..d33b30f4e3 100644 --- a/decompiler/ObjectFile/LinkedObjectFile.h +++ b/decompiler/ObjectFile/LinkedObjectFile.h @@ -6,14 +6,17 @@ */ #include -#include #include #include #include +#include + #include "LinkedWord.h" + +#include "common/common_types.h" + #include "decompiler/Disasm/DecompilerLabel.h" #include "decompiler/Function/Function.h" -#include "common/common_types.h" #include "decompiler/IR2/LabelDB.h" namespace decompiler { @@ -49,7 +52,7 @@ class LinkedObjectFile { uint32_t set_ordered_label_names(); void find_code(); std::string print_words(); - void find_functions(); + void find_functions(GameVersion version); void disassemble_functions(); void process_fp_relative_links(); std::string print_scripts(); @@ -65,6 +68,9 @@ class LinkedObjectFile { u32 read_data_word(const DecompilerLabel& label); const DecompilerLabel& get_label_by_name(const std::string& name) const; std::string get_goal_string_by_label(const DecompilerLabel& label) const; + std::string get_goal_string_by_label(int label_id) const { + return get_goal_string_by_label(labels.at(label_id)); + } std::string get_goal_string(int seg, int word_idx, bool with_quotes = true) const; bool is_string(int seg, int byte_idx) const; diff --git a/decompiler/ObjectFile/LinkedObjectFileCreation.cpp b/decompiler/ObjectFile/LinkedObjectFileCreation.cpp index 6f96eb7bb8..97c25b726e 100644 --- a/decompiler/ObjectFile/LinkedObjectFileCreation.cpp +++ b/decompiler/ObjectFile/LinkedObjectFileCreation.cpp @@ -4,13 +4,16 @@ * This implements a decoder for the GOAL linking format. */ -#include #include "LinkedObjectFileCreation.h" + +#include + +#include "common/link_types.h" +#include "common/util/Assert.h" +#include "common/util/BitUtils.h" + #include "decompiler/config.h" #include "decompiler/util/DecompilerTypeSystem.h" -#include "common/link_types.h" -#include "common/util/BitUtils.h" -#include "common/util/Assert.h" namespace decompiler { // There are three link versions: @@ -219,7 +222,8 @@ static uint32_t c_symlink3(LinkedObjectFile& f, static void link_v2_or_v4(LinkedObjectFile& f, const std::vector& data, const std::string& name, - DecompilerTypeSystem& dts) { + DecompilerTypeSystem& dts, + GameVersion version) { const auto* header = (const LinkHeaderV4*)&data.at(0); ASSERT(header->version == 4 || header->version == 2); @@ -251,6 +255,13 @@ static void link_v2_or_v4(LinkedObjectFile& f, const uint8_t* code_start = &data.at(code_offset); const uint8_t* code_end = &data.at(code_offset + code_size - 1) + 1; // get the pointer to one past the end. + + if (version == GameVersion::Jak2) { + while (((code_end - code_start) % 4)) { + code_end++; + } + } + ASSERT(((code_end - code_start) % 4) == 0); f.set_segment_count(1); for (auto x = code_start; x < code_end; x += 4) { @@ -562,11 +573,13 @@ static void link_v5(LinkedObjectFile& f, } else if ((reloc & 0x3f) == 0x3f) { ASSERT(false); // todo, does this ever get hit? } else { + /* int n_methods_base = reloc & 0x3f; int n_methods = n_methods_base * 4; if (n_methods_base) { n_methods += 3; } + */ link_ptr += 2; // ghidra misses some aliasing here and would have you think this is +1! const char* sname = (const char*)(&data.at(link_ptr)); link_ptr += strlen(sname) + 1; @@ -603,7 +616,7 @@ static void link_v3(LinkedObjectFile& f, const std::vector& data, const std::string& name, DecompilerTypeSystem& dts, - int game_version) { + GameVersion game_version) { auto header = (const LinkHeaderV3*)(&data.at(0)); ASSERT(name == header->name); ASSERT(header->segments == 3); @@ -650,11 +663,11 @@ static void link_v3(LinkedObjectFile& f, // HACK! // why is this a thing? // HACK! - if (game_version == 1 && name == "level-h" && seg_id == 0) { + if (game_version == GameVersion::Jak1 && name == "level-h" && seg_id == 0) { segment_size++; } - if (game_version == 2) { + if (game_version == GameVersion::Jak2) { bool adjusted = false; while (segment_size % 4) { segment_size++; @@ -754,7 +767,16 @@ static void link_v3(LinkedObjectFile& f, s_name = (const char*)(&data.at(link_ptr)); } else { s_name = (const char*)(&data.at(link_ptr)); - dts.ts.forward_declare_type_method_count(s_name, reloc & 0x7f); + switch (game_version) { + case GameVersion::Jak1: + dts.ts.forward_declare_type_method_count(s_name, (reloc & 0x7f)); + break; + case GameVersion::Jak2: + dts.ts.forward_declare_type_method_count_multiple_of_4(s_name, (reloc & 0x7f) * 4 + 3); + break; + default: + ASSERT(false); + } kind = SymbolLinkKind::TYPE; } @@ -793,7 +815,7 @@ static void link_v3(LinkedObjectFile& f, LinkedObjectFile to_linked_object_file(const std::vector& data, const std::string& name, DecompilerTypeSystem& dts, - int game_version) { + GameVersion game_version) { LinkedObjectFile result; const auto* header = (const LinkHeaderCommon*)&data.at(0); @@ -803,12 +825,11 @@ LinkedObjectFile to_linked_object_file(const std::vector& data, link_v3(result, data, name, dts, game_version); } else if (header->version == 4 || header->version == 2) { ASSERT(header->type_tag == 0xffffffff); - link_v2_or_v4(result, data, name, dts); + link_v2_or_v4(result, data, name, dts, game_version); } else if (header->version == 5) { link_v5(result, data, name, dts); } else { - printf("Unsupported version %d\n", header->version); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Unsupported version {}", header->version)); } return result; diff --git a/decompiler/ObjectFile/LinkedObjectFileCreation.h b/decompiler/ObjectFile/LinkedObjectFileCreation.h index a165c51714..ed4ac5442a 100644 --- a/decompiler/ObjectFile/LinkedObjectFileCreation.h +++ b/decompiler/ObjectFile/LinkedObjectFileCreation.h @@ -13,5 +13,5 @@ class DecompilerTypeSystem; LinkedObjectFile to_linked_object_file(const std::vector& data, const std::string& name, DecompilerTypeSystem& dts, - int game_version); + GameVersion game_version); } // namespace decompiler diff --git a/decompiler/ObjectFile/LinkedWord.h b/decompiler/ObjectFile/LinkedWord.h index dc278d7bfc..7559362ff4 100644 --- a/decompiler/ObjectFile/LinkedWord.h +++ b/decompiler/ObjectFile/LinkedWord.h @@ -6,8 +6,9 @@ */ #include -#include #include +#include + #include "common/common_types.h" #include "common/util/Assert.h" diff --git a/decompiler/ObjectFile/ObjectFileDB.cpp b/decompiler/ObjectFile/ObjectFileDB.cpp index a25cc16040..03dfd53fb6 100644 --- a/decompiler/ObjectFile/ObjectFileDB.cpp +++ b/decompiler/ObjectFile/ObjectFileDB.cpp @@ -6,28 +6,33 @@ */ #include "ObjectFileDB.h" + #include -#include #include #include +#include + +#include "LinkedObjectFileCreation.h" + #include "common/link_types.h" -#include "common/util/dgo_util.h" +#include "common/log/log.h" +#include "common/util/BinaryReader.h" #include "common/util/BitUtils.h" -#include "decompiler/data/tpage.h" -#include "decompiler/data/game_text.h" +#include "common/util/FileUtil.h" +#include "common/util/Timer.h" +#include "common/util/crc32.h" +#include "common/util/dgo_util.h" +#include "common/util/json_util.h" + +#include "decompiler/Function/BasicBlocks.h" +#include "decompiler/config.h" #include "decompiler/data/StrFileReader.h" #include "decompiler/data/dir_tpages.h" #include "decompiler/data/game_count.h" -#include "LinkedObjectFileCreation.h" -#include "decompiler/config.h" -#include "common/util/BinaryReader.h" -#include "common/util/Timer.h" -#include "common/util/FileUtil.h" -#include "decompiler/Function/BasicBlocks.h" -#include "decompiler/IR/BasicOpBuilder.h" -#include "decompiler/Function/TypeInspector.h" -#include "common/log/log.h" -#include "common/util/json_util.h" +#include "decompiler/data/game_text.h" +#include "decompiler/data/tpage.h" + +#include "third-party/xdelta3/xdelta3.h" namespace decompiler { namespace { @@ -80,9 +85,8 @@ std::string ObjectFileData::to_unique_name() const { std::string result = record.name + "-"; auto dgo_names_sorted = dgo_names; std::sort(dgo_names_sorted.begin(), dgo_names_sorted.end()); - for (auto x : dgo_names_sorted) { - x = strip_dgo_extension(x); - result += x + "-"; + for (const auto& x : dgo_names_sorted) { + result += strip_dgo_extension(x) + "-"; } result.pop_back(); return result; @@ -91,10 +95,10 @@ std::string ObjectFileData::to_unique_name() const { } } -ObjectFileData& ObjectFileDB::lookup_record(const ObjectFileRecord& rec) { - ObjectFileData* result = nullptr; +const ObjectFileData& ObjectFileDB::lookup_record(const ObjectFileRecord& rec) const { + const ObjectFileData* result = nullptr; - for (auto& x : obj_files_by_name[rec.name]) { + for (auto& x : obj_files_by_name.at(rec.name)) { if (x.record.version == rec.version) { ASSERT(x.record.hash == rec.hash); ASSERT(!result); @@ -117,7 +121,7 @@ ObjectFileDB::ObjectFileDB(const std::vector& _dgos, Timer timer; lg::info("-Loading types..."); - dts.parse_type_defs({"decompiler", "config", "all-types.gc"}); + dts.parse_type_defs({config.all_types_file}); if (!obj_file_name_map_file.empty()) { lg::info("-Loading obj name map file..."); @@ -134,7 +138,7 @@ ObjectFileDB::ObjectFileDB(const std::vector& _dgos, try { get_objs_from_dgo(dgo, config); } catch (std::runtime_error& e) { - lg::warn("Error when reading DGOs: {}", e.what()); + lg::warn("Error when reading DGOs: {} on {}", e.what(), dgo); } } @@ -142,6 +146,59 @@ ObjectFileDB::ObjectFileDB(const std::vector& _dgos, for (auto& obj : object_files) { auto data = file_util::read_binary_file(obj); auto name = obj_filename_to_name(obj); + if (auto it = config.object_patches.find(name); it != config.object_patches.end()) { + // print the file CRC + fmt::print("CRC for {} is: 0x{:X}\n", name, crc32(data.data(), data.size())); + // write patch file if necessary + if (config.write_patches) { + // this is the "target" file we want to patch to + auto data2 = file_util::read_binary_file( + (file_util::get_jak_project_dir() / it->second.target_file).string()); + // we need to allocate a buffer to store the delta patch + // we make it 2x the source file's size because... it seems like a good size? + // ideally the delta patch should never be that big. + int buf_sz = data.size() * 2; + u8* out_buf = (u8*)malloc(buf_sz); + size_t out_sz = 0; // this is where the actual used size of the delta patch will be stored + int xd3_res = xd3_encode_memory(data2.data(), data2.size(), data.data(), data.size(), + out_buf, &out_sz, buf_sz, 0); + if (xd3_res) { + lg::error("error patching {} with {} (out {}): {}", name, it->second.target_file, + it->second.patch_file, xd3_strerror(xd3_res)); + } else { + std::vector patch_data(out_sz); + memcpy(patch_data.data(), out_buf, patch_data.size()); + file_util::write_binary_file( + (file_util::get_jak_project_dir() / it->second.patch_file).string(), + patch_data.data(), patch_data.size()); + } + free(out_buf); + } + + // apply patch file if necessary + // note that xd3 doesnt really have any safety against bad files so we check crc ourselves + if (config.apply_patches && it->second.crc == crc32(data.data(), data.size())) { + // this is the delta patch file + auto data2 = file_util::read_binary_file( + (file_util::get_jak_project_dir() / it->second.patch_file).string()); + // we need to allocate a buffer to store the patched file + // the delta patch isn't gonna be this big but we allocate 2x the source file's size + the + // delta patch's size + int buf_sz = data.size() * 2 + data2.size(); + u8* out_buf = (u8*)malloc(buf_sz); + size_t out_sz = 0; + int xd3_res = xd3_decode_memory(data2.data(), data2.size(), data.data(), data.size(), + out_buf, &out_sz, buf_sz, 0); + if (xd3_res) { + lg::error("error patching {} with {} (out {}): {}", name, it->second.target_file, + it->second.patch_file, xd3_strerror(xd3_res)); + } else { + data.resize(out_sz); + memcpy(data.data(), out_buf, data.size()); + } + free(out_buf); + } + } add_obj_from_dgo(name, name, data.data(), data.size(), "NO-XGO", config); } @@ -222,7 +279,8 @@ void ObjectFileDB::get_objs_from_dgo(const std::string& filename, const Config& if (i == header.object_count - 1) { if (reader.bytes_left() == obj_header.object_count - 0x30) { if (config.is_pal) { - lg::warn("Skipping {} because it is a broken PAL object", obj_header.name); + lg::warn("Skipping {} in {} because it is a broken PAL object", obj_header.name, + dgo_base_name); reader.ffwd(reader.bytes_left()); continue; } else { @@ -272,7 +330,7 @@ void ObjectFileDB::add_obj_from_dgo(const std::string& obj_name, stats.total_obj_files++; ASSERT(obj_size > 128); uint16_t version = *(const uint16_t*)(obj_data + 8); - auto hash = file_util::crc32(obj_data, obj_size); + auto hash = crc32(obj_data, obj_size); bool duplicated = false; // first, check to see if we already got it... @@ -395,18 +453,23 @@ std::string ObjectFileDB::generate_obj_listing(const std::unordered_set 0) { @@ -526,10 +589,10 @@ void ObjectFileDB::find_code(const Config& config) { for_each_obj([&](ObjectFileData& obj) { // printf("fc %s\n", obj.record.to_unique_name().c_str()); obj.linked_data.find_code(); - obj.linked_data.find_functions(); + obj.linked_data.find_functions(config.game_version); obj.linked_data.disassemble_functions(); - if (config.game_version == 1 || obj.to_unique_name() != "effect-control-v0") { + if (config.game_version == GameVersion::Jak1 || obj.to_unique_name() != "effect-control-v0") { obj.linked_data.process_fp_relative_links(); } else { lg::warn("Skipping process_fp_relative_links in {}", obj.to_unique_name().c_str()); @@ -643,7 +706,7 @@ std::string ObjectFileDB::process_game_text_files(const Config& cfg) { if (text_by_language_by_id.empty()) { return {}; } - return write_game_text(cfg, text_by_language_by_id); + return write_game_text(cfg.text_version, text_by_language_by_id); } std::string ObjectFileDB::process_game_count_file() { @@ -666,146 +729,94 @@ std::string ObjectFileDB::process_game_count_file() { return result; } +namespace { +void get_art_info(ObjectFileDB& db, ObjectFileData& obj) { + if (obj.obj_version == 4) { + const auto& words = obj.linked_data.words_by_seg.at(MAIN_SEGMENT); + if (words.at(0).kind() == LinkedWord::Kind::TYPE_PTR && + words.at(0).symbol_name() == "art-group") { + // fmt::print("art-group {}:\n", obj.to_unique_name()); + auto name = obj.linked_data.get_goal_string_by_label(words.at(2).label_id()); + int length = words.at(3).data; + // fmt::print(" length: {}\n", length); + std::unordered_map art_group_elts; + for (int i = 0; i < length; ++i) { + const auto& word = words.at(8 + i); + if (word.kind() == LinkedWord::Kind::SYM_PTR && word.symbol_name() == "#f") { + continue; + } + const auto& label = obj.linked_data.labels.at(word.label_id()); + auto elt_name = + obj.linked_data.get_goal_string_by_label(words.at(label.offset / 4 + 1).label_id()); + std::string elt_type = words.at(label.offset / 4 - 1).symbol_name(); + std::string unique_name = elt_name; + if (elt_type == "art-joint-geo") { + // the skeleton! + unique_name += "-jg"; + } else if (elt_type == "merc-ctrl" || elt_type == "shadow-geo") { + // (maybe mesh-geo as well but that doesnt exist) + // the skin! + unique_name += "-mg"; + } else if (elt_type == "art-joint-anim") { + // the animations! + unique_name += "-ja"; + } else { + // the something idk! + throw std::runtime_error( + fmt::format("unknown art elt type {} in {}", elt_type, obj.to_unique_name())); + } + art_group_elts[i] = unique_name; + // fmt::print(" {}: {} ({}) -> {}\n", i, elt_name, elt_type, unique_name); + } + db.dts.art_group_info[obj.to_unique_name()] = art_group_elts; + } + } +} +} // namespace + /*! - * This is the main decompiler routine which runs after we've identified functions. + * Get information from art groups. */ -void ObjectFileDB::analyze_functions_ir1(const Config& config) { - lg::info("- Analyzing Functions..."); +void ObjectFileDB::extract_art_info() { + lg::info("Processing art groups..."); Timer timer; - int total_functions = 0; - - // Step 1 - analyze the "top level" or "login" code for each object file. - // this will give us type definitions, method definitions, and function definitions... - lg::info(" - Processing top levels..."); - - timer.start(); - for_each_obj([&](ObjectFileData& data) { - if (data.linked_data.segments == 3) { - // the top level segment should have a single function - ASSERT(data.linked_data.functions_by_seg.at(2).size() == 1); - - auto& func = data.linked_data.functions_by_seg.at(2).front(); - ASSERT(func.guessed_name.empty()); - func.guessed_name.set_as_top_level(data.to_unique_name()); - func.find_global_function_defs(data.linked_data, dts); - func.find_type_defs(data.linked_data, dts); - func.find_method_defs(data.linked_data, dts); + for_each_obj([&](ObjectFileData& obj) { + try { + get_art_info(*this, obj); + } catch (std::runtime_error& e) { + lg::warn("Error when extracting art group info: {}", e.what()); } }); - // check for function uniqueness. - std::unordered_set unique_names; - std::unordered_map> duplicated_functions; + lg::info("Processed art groups: in {:.2f} ms\n", timer.getMs()); +} - int uid = 1; - for_each_obj([&](ObjectFileData& data) { - int func_in_obj = 0; - for (int segment_id = 0; segment_id < int(data.linked_data.segments); segment_id++) { - for (auto& func : data.linked_data.functions_by_seg.at(segment_id)) { - func.guessed_name.unique_id = uid++; - func.guessed_name.id_in_object = func_in_obj++; - func.guessed_name.object_name = data.to_unique_name(); - auto name = func.name(); +/*! + * Write out the art group information. + */ +void ObjectFileDB::dump_art_info(const std::string& output_dir) { + lg::info("Writing art group info..."); + Timer timer; - if (unique_names.find(name) != unique_names.end()) { - duplicated_functions[name].insert(data.to_unique_name()); - } - - unique_names.insert(name); - - if (config.hacks.asm_functions_by_name.find(name) != - config.hacks.asm_functions_by_name.end()) { - func.warnings.info("Flagged as asm by config"); - func.suspected_asm = true; - } - } + if (!dts.art_group_info.empty()) { + file_util::create_dir_if_needed(file_util::combine_path(output_dir, "import")); + } + for (const auto& [ag_name, info] : dts.art_group_info) { + auto ag_fname = ag_name + ".gc"; + auto filename = file_util::get_file_path({output_dir, "import", ag_fname}); + std::string result = ";;-*-Lisp-*-\n"; + result += "(in-package goal)\n\n"; + result += fmt::format(";; {} - art group OpenGOAL import file\n", ag_fname); + result += ";; THIS FILE IS AUTOMATICALLY GENERATED!\n\n"; + for (const auto& [idx, elt_name] : info) { + result += print_art_elt_for_dump(ag_name, elt_name, idx); } - }); + result += "\n"; + file_util::write_text_file(filename, result); + } - for_each_function([&](Function& func, int segment_id, ObjectFileData& data) { - (void)segment_id; - auto name = func.name(); - - if (duplicated_functions.find(name) != duplicated_functions.end()) { - duplicated_functions[name].insert(data.to_unique_name()); - func.warnings.info("Exists in multiple non-identical object files"); - } - }); - - int total_trivial_cfg_functions = 0; - int total_named_functions = 0; - int total_basic_ops = 0; - int total_failed_basic_ops = 0; - - int asm_funcs = 0; - - std::map> unresolved_by_length; - - timer.start(); - int total_basic_blocks = 0; - - // Main Pass over each function... - for_each_function_def_order([&](Function& func, int segment_id, ObjectFileData& data) { - total_functions++; - - // first, find basic blocks. - auto blocks = find_blocks_in_function(data.linked_data, segment_id, func); - total_basic_blocks += blocks.size(); - func.basic_blocks = blocks; - - // analyze the proluge - if (!func.suspected_asm) { - // first, find the prologue/epilogue - func.analyze_prologue(data.linked_data); - } - - if (!func.suspected_asm) { - // run analysis - - // build a control flow graph, just looking at branch instructions. - func.cfg = build_cfg(data.linked_data, segment_id, func, {}, {}); - - // convert individual basic blocks to sequences of IR Basic Ops - for (auto& block : func.basic_blocks) { - if (block.end_word > block.start_word) { - auto label_id = - data.linked_data.get_label_at(segment_id, (func.start_word + block.start_word) * 4); - if (label_id != -1) { - block.label_name = data.linked_data.get_label_name(label_id); - } - - block.start_basic_op = func.basic_ops.size(); - add_basic_ops_to_block(&func, block, &data.linked_data); - block.end_basic_op = func.basic_ops.size(); - } - } - total_basic_ops += func.get_basic_op_count(); - total_failed_basic_ops += func.get_failed_basic_op_count(); - - // if we got an inspect method, inspect it. - if (func.is_inspect_method) { - auto result = inspect_inspect_method( - func, func.method_of_type, dts, data.linked_data, - config.hacks.types_with_bad_inspect_methods.find(func.method_of_type) != - config.hacks.types_with_bad_inspect_methods.end()); - all_type_defs += ";; " + data.to_unique_name() + "\n"; - all_type_defs += result.print_as_deftype() + "\n"; - } - } else { - asm_funcs++; - } - }); - - lg::info("Found {} functions ({} with no control flow)", total_functions, - total_trivial_cfg_functions); - lg::info("Named {}/{} functions ({:.3f}%)", total_named_functions, total_functions, - 100.f * float(total_named_functions) / float(total_functions)); - lg::info("Excluding {} asm functions", asm_funcs); - lg::info("Found {} basic blocks in {:.3f} ms", total_basic_blocks, timer.getMs()); - int successful_basic_ops = total_basic_ops - total_failed_basic_ops; - lg::info(" {}/{} basic ops converted successfully ({:.3f}%)", successful_basic_ops, - total_basic_ops, 100.f * float(successful_basic_ops) / float(total_basic_ops)); + lg::info("Written art group info: in {:.2f} ms\n", timer.getMs()); } void ObjectFileDB::dump_raw_objects(const std::string& output_dir) { @@ -817,4 +828,10 @@ void ObjectFileDB::dump_raw_objects(const std::string& output_dir) { file_util::write_binary_file(dest, data.data.data(), data.data.size()); }); } + +std::string print_art_elt_for_dump(const std::string& group_name, + const std::string& name, + int idx) { + return fmt::format("(def-art-elt {} {} {})\n", group_name, name, idx); +} } // namespace decompiler diff --git a/decompiler/ObjectFile/ObjectFileDB.h b/decompiler/ObjectFile/ObjectFileDB.h index a9851fb6e1..70e5007ca3 100644 --- a/decompiler/ObjectFile/ObjectFileDB.h +++ b/decompiler/ObjectFile/ObjectFileDB.h @@ -10,13 +10,18 @@ #include #include #include + #include "LinkedObjectFile.h" -#include "decompiler/util/DecompilerTypeSystem.h" + #include "common/common_types.h" -#include "decompiler/data/TextureDB.h" -#include "decompiler/analysis/symbol_def_map.h" #include "common/util/Assert.h" +#include "decompiler/analysis/symbol_def_map.h" +#include "decompiler/data/TextureDB.h" +#include "decompiler/util/DecompilerTypeSystem.h" + +#include "third-party/fmt/core.h" + namespace decompiler { /*! * A "record" which can be used to identify an object file. @@ -46,6 +51,97 @@ struct ObjectFileData { std::string output_with_skips; }; +/*! + * Stats structure for let rewriting. + */ +struct LetRewriteStats { + int dotimes = 0; + int countdown = 0; + int abs = 0; + int abs2 = 0; + int unused = 0; + int ja = 0; + int case_no_else = 0; + int case_with_else = 0; + int set_vector = 0; + int set_vector2 = 0; + int send_event = 0; + int font_context_meth = 0; + int proc_new = 0; + int attack_info = 0; + int vector_dot = 0; + int rand_float_gen = 0; + + int total() const { + return dotimes + countdown + abs + abs2 + unused + ja + case_no_else + case_with_else + + set_vector + set_vector2 + send_event + font_context_meth + proc_new + attack_info + + vector_dot + rand_float_gen; + } + + std::string print() const { + std::string out; + out += fmt::format("LET REWRITE STATS: {} total\n", total()); + out += fmt::format(" dotimes: {}\n", dotimes); + out += fmt::format(" countdown: {}\n", countdown); + out += fmt::format(" abs: {}\n", abs); + out += fmt::format(" abs2: {}\n", abs2); + out += fmt::format(" ja: {}\n", ja); + out += fmt::format(" set_vector: {}\n", set_vector); + out += fmt::format(" set_vector2: {}\n", set_vector2); + out += fmt::format(" case_no_else: {}\n", case_no_else); + out += fmt::format(" case_with_else: {}\n", case_with_else); + out += fmt::format(" unused: {}\n", unused); + out += fmt::format(" send_event: {}\n", send_event); + // out += fmt::format(" font_context_meth: {}\n", font_context_meth); + out += fmt::format(" proc_new: {}\n", proc_new); + out += fmt::format(" attack_info: {}\n", attack_info); + out += fmt::format(" vector_dot: {}\n", vector_dot); + out += fmt::format(" rand_float_gen: {}\n", rand_float_gen); + return out; + } + + LetRewriteStats operator+(const LetRewriteStats& other) { + LetRewriteStats result; + result.dotimes = dotimes + other.dotimes; + result.countdown = countdown + other.countdown; + result.abs = abs + other.abs; + result.abs2 = abs2 + other.abs2; + result.ja = ja + other.ja; + result.set_vector = set_vector + other.set_vector; + result.set_vector2 = set_vector2 + other.set_vector2; + result.case_no_else = case_no_else + other.case_no_else; + result.case_with_else = case_with_else + other.case_with_else; + result.unused = unused + other.unused; + result.send_event = send_event + other.send_event; + result.font_context_meth = font_context_meth + other.font_context_meth; + result.proc_new = proc_new + other.proc_new; + result.attack_info = attack_info + other.attack_info; + result.vector_dot = vector_dot + other.vector_dot; + result.rand_float_gen = rand_float_gen + other.rand_float_gen; + return result; + } + + LetRewriteStats& operator+=(const LetRewriteStats& other) { + dotimes += other.dotimes; + countdown += other.countdown; + abs += other.abs; + abs2 += other.abs2; + ja += other.ja; + set_vector += other.set_vector; + set_vector2 += other.set_vector2; + case_no_else += other.case_no_else; + case_with_else += other.case_with_else; + unused += other.unused; + send_event += other.send_event; + font_context_meth += other.font_context_meth; + proc_new += other.proc_new; + attack_info += other.attack_info; + vector_dot += other.vector_dot; + rand_float_gen += other.rand_float_gen; + return *this; + } +}; + class ObjectFileDB { public: ObjectFileDB(const std::vector& _dgos, @@ -59,15 +155,15 @@ class ObjectFileDB { void process_labels(); void find_code(const Config& config); void find_and_write_scripts(const std::string& output_dir); + void extract_art_info(); + void dump_art_info(const std::string& output_dir); void dump_raw_objects(const std::string& output_dir); - void write_object_file_words(const std::string& output_dir, bool dump_data, bool dump_code); void write_disassembly(const std::string& output_dir, bool disassemble_data, bool disassemble_code, bool print_hex); - void analyze_functions_ir1(const Config& config); void analyze_functions_ir2( const std::string& output_dir, const Config& config, @@ -87,23 +183,29 @@ class ObjectFileDB { void ir2_rewrite_inline_asm_instructions(int seg, ObjectFileData& data); void ir2_insert_anonymous_functions(int seg, ObjectFileData& data); void ir2_symbol_definition_map(ObjectFileData& data); - void ir2_write_results(const std::string& output_dir, const Config& config, ObjectFileData& data); + void ir2_write_results(const std::string& output_dir, + const Config& config, + const std::vector& imports, + ObjectFileData& data); void ir2_do_segment_analysis_phase1(int seg, const Config& config, ObjectFileData& data); void ir2_do_segment_analysis_phase2(int seg, const Config& config, ObjectFileData& data); void ir2_setup_labels(const Config& config, ObjectFileData& data); void ir2_run_mips2c(const Config& config, ObjectFileData& data); + void ir2_analyze_all_types(const std::string& output_file, + const std::optional& previous_game_types, + const std::unordered_set& bad_types); std::string ir2_to_file(ObjectFileData& data, const Config& config); std::string ir2_function_to_string(ObjectFileData& data, Function& function, int seg); std::string ir2_final_out(ObjectFileData& data, - const std::unordered_set& skip_functions = {}); + const std::vector& imports, + const std::unordered_set& skip_functions); std::string process_tpages(TextureDB& tex_db); std::string process_game_count_file(); std::string process_game_text_files(const Config& cfg); - ObjectFileData& lookup_record(const ObjectFileRecord& rec); + const ObjectFileData& lookup_record(const ObjectFileRecord& rec) const; DecompilerTypeSystem dts; - std::string all_type_defs; bool lookup_function_type(const FunctionName& name, const std::string& obj_name, @@ -210,10 +312,13 @@ class ObjectFileDB { SymbolMapBuilder map_builder; struct { + LetRewriteStats let; uint32_t total_dgo_bytes = 0; uint32_t total_obj_files = 0; uint32_t unique_obj_files = 0; uint32_t unique_obj_bytes = 0; } stats; }; + +std::string print_art_elt_for_dump(const std::string& group_name, const std::string& name, int idx); } // namespace decompiler diff --git a/decompiler/ObjectFile/ObjectFileDB_IR2.cpp b/decompiler/ObjectFile/ObjectFileDB_IR2.cpp index 6605c74a7a..6b72c9d00e 100644 --- a/decompiler/ObjectFile/ObjectFileDB_IR2.cpp +++ b/decompiler/ObjectFile/ObjectFileDB_IR2.cpp @@ -3,30 +3,32 @@ * This runs the IR2 analysis passes. */ -#include "common/link_types.h" #include "ObjectFileDB.h" + +#include "common/goos/PrettyPrinter.h" +#include "common/link_types.h" #include "common/log/log.h" -#include "common/util/Timer.h" #include "common/util/FileUtil.h" -#include "decompiler/Function/TypeInspector.h" -#include "decompiler/analysis/type_analysis.h" -#include "decompiler/analysis/reg_usage.h" +#include "common/util/Timer.h" + +#include "decompiler/IR2/Form.h" +#include "decompiler/analysis/analyze_inspect_method.h" +#include "decompiler/analysis/cfg_builder.h" +#include "decompiler/analysis/expression_build.h" +#include "decompiler/analysis/final_output.h" +#include "decompiler/analysis/find_defpartgroup.h" +#include "decompiler/analysis/find_defstates.h" +#include "decompiler/analysis/find_skelgroups.h" +#include "decompiler/analysis/inline_asm_rewrite.h" #include "decompiler/analysis/insert_lets.h" #include "decompiler/analysis/label_types.h" -#include "decompiler/analysis/find_defstates.h" -#include "decompiler/analysis/variable_naming.h" -#include "decompiler/analysis/cfg_builder.h" -#include "decompiler/analysis/final_output.h" -#include "decompiler/analysis/expression_build.h" -#include "decompiler/analysis/inline_asm_rewrite.h" +#include "decompiler/analysis/mips2c.h" +#include "decompiler/analysis/reg_usage.h" #include "decompiler/analysis/stack_spill.h" #include "decompiler/analysis/static_refs.h" #include "decompiler/analysis/symbol_def_map.h" -#include "decompiler/analysis/find_skelgroups.h" -#include "decompiler/analysis/find_defpartgroup.h" -#include "common/goos/PrettyPrinter.h" -#include "decompiler/IR2/Form.h" -#include "decompiler/analysis/mips2c.h" +#include "decompiler/analysis/type_analysis.h" +#include "decompiler/analysis/variable_naming.h" namespace decompiler { @@ -40,12 +42,6 @@ void ObjectFileDB::analyze_functions_ir2( const Config& config, const std::unordered_set& skip_functions, const std::unordered_map>& skip_states) { - // First, do basic analysis on the top level: - lg::info("Using IR2 analysis..."); - - lg::info("Processing top-level functions..."); - ir2_top_level_pass(config); - int total_file_count = 0; for (auto& f : obj_files_by_name) { total_file_count += f.second.size(); @@ -59,26 +55,28 @@ void ObjectFileDB::analyze_functions_ir2( ir2_do_segment_analysis_phase1(MAIN_SEGMENT, config, data); ir2_setup_labels(config, data); ir2_do_segment_analysis_phase2(TOP_LEVEL_SEGMENT, config, data); - try { - if (data.linked_data.functions_by_seg.size() == 3) { + if (data.linked_data.functions_by_seg.size() == 3) { + enum { DEFPART, DEFSTATE, DEFSKELGROUP } step = DEFPART; + try { run_defpartgroup(data.linked_data.functions_by_seg.at(TOP_LEVEL_SEGMENT).front()); - } - } catch (const std::exception& e) { - lg::error("Failed to find defpartgroups: {}", e.what()); - } - try { - if (data.linked_data.functions_by_seg.size() == 3) { + step = DEFSTATE; run_defstate(data.linked_data.functions_by_seg.at(TOP_LEVEL_SEGMENT).front(), skip_states); - } - } catch (const std::exception& e) { - lg::error("Failed to find defstates: {}", e.what()); - } - try { - if (data.linked_data.functions_by_seg.size() == 3) { + step = DEFSKELGROUP; run_defskelgroups(data.linked_data.functions_by_seg.at(TOP_LEVEL_SEGMENT).front()); + + } catch (const std::exception& e) { + switch (step) { + case DEFPART: + lg::error("Failed to find defpartgroups: {}", e.what()); + break; + case DEFSTATE: + lg::error("Failed to find defstates: {}", e.what()); + break; + case DEFSKELGROUP: + lg::error("Failed to find defskelgroups: {}", e.what()); + break; + } } - } catch (const std::exception& e) { - lg::error("Failed to find defskelgroups: {}", e.what()); } ir2_do_segment_analysis_phase2(DEBUG_SEGMENT, config, data); ir2_do_segment_analysis_phase2(MAIN_SEGMENT, config, data); @@ -91,20 +89,43 @@ void ObjectFileDB::analyze_functions_ir2( ir2_symbol_definition_map(data); - if (!output_dir.empty()) { - ir2_write_results(output_dir, config, data); - } else { - if (!skip_functions.empty()) { - data.output_with_skips = ir2_final_out(data, skip_functions); - } - data.full_output = ir2_final_out(data); + const auto& imports_it = config.import_deps_by_file.find(data.to_unique_name()); + std::vector imports; + if (imports_it != config.import_deps_by_file.end()) { + imports = imports_it->second; } - for_each_function_def_order_in_obj(data, [&](Function& f, int) { f.ir2 = {}; }); + if (!output_dir.empty()) { + ir2_write_results(output_dir, config, imports, data); + } else { + if (!skip_functions.empty()) { + data.output_with_skips = ir2_final_out(data, imports, skip_functions); + } + data.full_output = ir2_final_out(data, imports, {}); + } + + if (!config.generate_all_types) { + // this frees ir2 memory, but means future passes can't look back on this function. + for_each_function_def_order_in_obj(data, [&](Function& f, int) { f.ir2 = {}; }); + } else { + for_each_function_def_order_in_obj(data, [&](Function& f, int seg) { + if (seg == 0) { + return; // keep top-levels + } + if (f.guessed_name.kind == FunctionName::FunctionKind::METHOD && + f.guessed_name.method_id == GOAL_INSPECT_METHOD) { + return; // keep inspects + } + // otherwise free memory + f.ir2 = {}; + }); + } fmt::print("Done in {:.2f}ms\n", file_timer.getMs()); }); + lg::info("{}", stats.let.print()); + if (config.generate_symbol_definition_map) { lg::info("Generating symbol definition map..."); map_builder.build_map(); @@ -157,12 +178,12 @@ void ObjectFileDB::ir2_run_mips2c(const Config& config, ObjectFileData& data) { for_each_function_def_order_in_obj(data, [&](Function& func, int) { if (config.hacks.mips2c_functions_by_name.count(func.name())) { lg::info("MIPS2C on {}", func.name()); - run_mips2c(&func); + run_mips2c(&func, config.game_version); } auto it = config.hacks.mips2c_jump_table_functions.find(func.name()); if (it != config.hacks.mips2c_jump_table_functions.end()) { - run_mips2c_jump_table(&func, it->second); + run_mips2c_jump_table(&func, it->second, config.game_version); } }); } @@ -275,6 +296,61 @@ void ObjectFileDB::ir2_top_level_pass(const Config& config) { lg::info("{:4d} logins {:.2f}%\n", total_top_levels, 100.f * total_top_levels / total_functions); } +void ObjectFileDB::ir2_analyze_all_types(const std::string& output_file, + const std::optional& previous_game_types, + const std::unordered_set& bad_types) { + struct PerObject { + std::string object_name; + std::vector type_defs; + std::string symbol_defs; + }; + + std::vector per_object; + + DecompilerTypeSystem previous_game_ts; + if (previous_game_types) { + previous_game_ts.parse_type_defs({*previous_game_types}); + } + + std::unordered_set already_seen; + for_each_obj([&](ObjectFileData& data) { + if (data.obj_version != 3) { + return; + } + auto& object_result = per_object.emplace_back(); + object_result.object_name = data.to_unique_name(); + + for_each_function_def_order_in_obj(data, [&](Function& f, int seg) { + if (seg == TOP_LEVEL_SEGMENT) { + object_result.symbol_defs += inspect_top_level_symbol_defines( + already_seen, f, data.linked_data, dts, previous_game_ts); + } else { + if (f.is_inspect_method && bad_types.find(f.guessed_name.type_name) == bad_types.end()) { + object_result.type_defs.push_back(inspect_inspect_method( + f, f.guessed_name.type_name, dts, data.linked_data, previous_game_ts.ts)); + } + } + }); + }); + + std::string result; + result += ";; All Types\n\n"; + + for (auto& obj : per_object) { + result += fmt::format(";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n"); + result += fmt::format(";; {:30s} ;;\n", obj.object_name); + result += fmt::format(";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n"); + for (auto& t : obj.type_defs) { + result += t; + result += "\n"; + } + result += obj.symbol_defs; + result += "\n"; + } + + file_util::write_text_file(output_file, result); +} + /*! * Initial Function Analysis Pass to build the control flow graph. * - Find basic blocks @@ -317,7 +393,7 @@ void ObjectFileDB::ir2_basic_block_pass(int seg, const Config& config, ObjectFil asm_br_blocks = asm_lookup->second; } - func.cfg = build_cfg(data.linked_data, seg, func, hack, asm_br_blocks); + func.cfg = build_cfg(data.linked_data, seg, func, hack, asm_br_blocks, config.game_version); if (!func.cfg->is_fully_resolved()) { lg::warn("Function {} from {} failed to build control flow graph!", func.name(), data.to_unique_name()); @@ -369,8 +445,9 @@ void ObjectFileDB::ir2_atomic_op_pass(int seg, const Config& config, ObjectFileD blocks_ending_in_asm_branch = asm_branch_it->second; } - auto ops = convert_function_to_atomic_ops(func, data.linked_data.labels, func.warnings, - inline_asm, blocks_ending_in_asm_branch); + auto ops = + convert_function_to_atomic_ops(func, data.linked_data.labels, func.warnings, inline_asm, + blocks_ending_in_asm_branch, config.game_version); func.ir2.atomic_ops = std::make_shared(std::move(ops)); func.ir2.atomic_ops_succeeded = true; func.ir2.env.set_end_var(func.ir2.atomic_ops->end_op().return_var()); @@ -404,6 +481,7 @@ Value try_lookup(const std::unordered_map& map, const Key& key) { * - NOTE: this will update register info usage more accurately for functions. */ void ObjectFileDB::ir2_type_analysis_pass(int seg, const Config& config, ObjectFileData& data) { + auto obj_name = data.to_unique_name(); for_each_function_in_seg_in_obj(seg, data, [&](Function& func) { if (!func.suspected_asm) { TypeSpec ts; @@ -415,9 +493,11 @@ void ObjectFileDB::ir2_type_analysis_pass(int seg, const Config& config, ObjectF auto register_casts = try_lookup(config.register_type_casts_by_function_by_atomic_op_idx, func_name); func.ir2.env.set_type_casts(register_casts); + auto stack_casts = try_lookup(config.stack_type_casts_by_function_by_stack_offset, func_name); func.ir2.env.set_stack_casts(stack_casts); + if (config.hacks.pair_functions_by_name.find(func_name) != config.hacks.pair_functions_by_name.end()) { func.ir2.env.set_sloppy_pair_typing(); @@ -427,8 +507,18 @@ void ObjectFileDB::ir2_type_analysis_pass(int seg, const Config& config, ObjectF config.hacks.reject_cond_to_value.end()) { func.ir2.env.aggressively_reject_cond_to_value_rewrite = true; } + func.ir2.env.set_stack_structure_hints( try_lookup(config.stack_structure_hints_by_function, func_name)); + + if (config.art_groups_by_function.find(func_name) != config.art_groups_by_function.end()) { + func.ir2.env.set_art_group(config.art_groups_by_function.at(func_name)); + } else if (config.art_groups_by_file.find(obj_name) != config.art_groups_by_file.end()) { + func.ir2.env.set_art_group(config.art_groups_by_file.at(obj_name)); + } else { + func.ir2.env.set_art_group(obj_name + "-ag"); + } + if (run_type_analysis_ir2(ts, dts, func)) { func.ir2.env.types_succeeded = true; } else { @@ -447,7 +537,7 @@ void ObjectFileDB::ir2_register_usage_pass(int seg, ObjectFileData& data) { if (!func.suspected_asm && func.ir2.atomic_ops_succeeded) { func.ir2.env.set_reg_use(analyze_ir2_register_usage(func)); - auto block_0_start = func.ir2.env.reg_use().block.at(0).input; + auto& block_0_start = func.ir2.env.reg_use().block.at(0).input; std::vector dep_regs; for (auto x : block_0_start) { dep_regs.push_back(x); @@ -529,23 +619,6 @@ void ObjectFileDB::ir2_cfg_build_pass(int seg, ObjectFileData& data) { }); } -// void ObjectFileDB::ir2_store_current_forms(int seg) { -// Timer timer; -// int total = 0; -// -// for_each_function_in_seg(seg, [&](Function& func, ObjectFileData& data) { -// (void)data; -// -// if (func.ir2.top_form) { -// total++; -// func.ir2.debug_form_string = -// pretty_print::to_string(func.ir2.top_form->to_form(func.ir2.env)); -// } -// }); -// -// lg::info("Stored debug forms for {} functions in {:.2f} ms\n", total, timer.getMs()); -//} -// void ObjectFileDB::ir2_build_expressions(int seg, const Config& config, ObjectFileData& data) { for_each_function_in_seg_in_obj(seg, data, [&](Function& func) { (void)data; @@ -573,12 +646,14 @@ void ObjectFileDB::ir2_insert_lets(int seg, ObjectFileData& data) { for_each_function_in_seg_in_obj(seg, data, [&](Function& func) { if (func.ir2.expressions_succeeded) { try { - insert_lets(func, func.ir2.env, *func.ir2.form_pool, func.ir2.top_form); + insert_lets(func, func.ir2.env, *func.ir2.form_pool, func.ir2.top_form, stats.let); } catch (const std::exception& e) { - func.warnings.general_warning( - fmt::format("Error while inserting lets: {}. Make sure that the return type is not " - "none if something is actually returned.", - e.what())); + const auto err = fmt::format( + "Error while inserting lets: {}. Make sure that the return type is not " + "none if something is actually returned.", + e.what()); + lg::warn(err); + func.warnings.general_warning(err); } } }); @@ -611,6 +686,7 @@ void ObjectFileDB::ir2_insert_anonymous_functions(int seg, ObjectFileData& data) void ObjectFileDB::ir2_write_results(const std::string& output_dir, const Config& config, + const std::vector& imports, ObjectFileData& obj) { if (obj.linked_data.has_any_functions()) { // todo @@ -619,7 +695,7 @@ void ObjectFileDB::ir2_write_results(const std::string& output_dir, auto file_name = file_util::combine_path(output_dir, obj.to_unique_name() + "_ir2.asm"); file_util::write_text_file(file_name, file_text); - auto final = ir2_final_out(obj); + auto final = ir2_final_out(obj, imports, {}); auto final_name = file_util::combine_path(output_dir, obj.to_unique_name() + "_disasm.gc"); file_util::write_text_file(final_name, final); } @@ -840,7 +916,12 @@ std::string ObjectFileDB::ir2_function_to_string(ObjectFileData& data, Function& init_types = &func.ir2.env.get_types_at_block_entry(block_id); } - for (int instr_id = block.start_word; instr_id < block.end_word; instr_id++) { + int start_word = block.start_word; + // if we have no prologue, skip the type tag. + if (start_word == 0) { + start_word = 1; + } + for (int instr_id = start_word; instr_id < block.end_word; instr_id++) { print_instr_start(instr_id); bool printed_comment = false; @@ -992,6 +1073,7 @@ bool ObjectFileDB::lookup_function_type(const FunctionName& name, } std::string ObjectFileDB::ir2_final_out(ObjectFileData& data, + const std::vector& imports, const std::unordered_set& skip_functions) { if (data.obj_version == 3) { std::string result; @@ -999,7 +1081,7 @@ std::string ObjectFileDB::ir2_final_out(ObjectFileData& data, result += "(in-package goal)\n\n"; ASSERT(data.linked_data.functions_by_seg.at(TOP_LEVEL_SEGMENT).size() == 1); auto top_level = data.linked_data.functions_by_seg.at(TOP_LEVEL_SEGMENT).at(0); - result += write_from_top_level(top_level, dts, data.linked_data, skip_functions); + result += write_from_top_level(top_level, dts, data.linked_data, imports, skip_functions); result += "\n\n"; return result; } else { diff --git a/decompiler/VuDisasm/VuDisassembler.cpp b/decompiler/VuDisasm/VuDisassembler.cpp index dbbbc06dd6..0d72667e36 100644 --- a/decompiler/VuDisasm/VuDisassembler.cpp +++ b/decompiler/VuDisasm/VuDisassembler.cpp @@ -1,10 +1,12 @@ -#include -#include - #include "VuDisassembler.h" -#include "third-party/fmt/core.h" -#include "common/util/print_float.h" + +#include +#include + #include "common/util/Assert.h" +#include "common/util/print_float.h" + +#include "third-party/fmt/core.h" namespace decompiler { @@ -297,15 +299,13 @@ VuInstrK VuDisassembler::lower_kind(u32 in) { case 0b11110'1111'11: return VuInstrK::WAITP; } - fmt::print("Unknown lower special: 0b{:b}\n", in); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Unknown lower special: 0b{:b}", in)); } else { ASSERT((op & 0b1000000) == 0); ASSERT(op < 64); auto elt = m_lower_op6_table[(int)op]; if (!elt.known) { - fmt::print("Invalid lower op6: 0b{:b} 0b{:b} 0x{:x}\n", op, in, in); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Invalid lower op6: 0b{:b} 0b{:b} 0x{:x}", op, in, in)); } return elt.kind; } @@ -370,13 +370,11 @@ VuInstrK VuDisassembler::upper_kind(u32 in) { break; default: - fmt::print("Invalid op11: 0b{:b}\n", upper_op11(in)); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Invalid op11: 0b{:b}", upper_op11(in))); } } if (!upper_info.known) { - fmt::print("Invalid upper op6: 0b{:b}\n", upper_op6(in)); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Invalid upper op6: 0b{:b}", upper_op6(in))); } return upper_info.kind; } @@ -434,8 +432,7 @@ VuInstruction VuDisassembler::decode(VuInstrK kind, u32 data, int instr_idx) { instr.kind = kind; auto& inst = info(kind); if (!inst.known) { - fmt::print("instr idx {} is unknown\n", (int)kind); - ASSERT(false); + ASSERT_MSG(false, fmt::format("instr idx {} is unknown", (int)kind)); } for (auto& step : inst.decode) { s64 value = -1; diff --git a/decompiler/VuDisasm/VuDisassembler.h b/decompiler/VuDisasm/VuDisassembler.h index 073f0204bf..0ba268c59d 100644 --- a/decompiler/VuDisasm/VuDisassembler.h +++ b/decompiler/VuDisasm/VuDisassembler.h @@ -2,9 +2,10 @@ #include -#include "decompiler/VuDisasm/VuProgram.h" #include "common/util/Assert.h" +#include "decompiler/VuDisasm/VuProgram.h" + namespace decompiler { struct VuDecodeStep { diff --git a/decompiler/VuDisasm/VuInstruction.cpp b/decompiler/VuDisasm/VuInstruction.cpp index 5da13d4ce2..7bfaf0073d 100644 --- a/decompiler/VuDisasm/VuInstruction.cpp +++ b/decompiler/VuDisasm/VuInstruction.cpp @@ -1,7 +1,9 @@ -#include "third-party/fmt/core.h" #include "VuInstruction.h" + #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + namespace decompiler { VuInstructionAtom VuInstructionAtom::make_vf(int idx) { ASSERT(idx >= 0 && idx <= 31); diff --git a/decompiler/VuDisasm/VuInstruction.h b/decompiler/VuDisasm/VuInstruction.h index 7169928260..db470777ea 100644 --- a/decompiler/VuDisasm/VuInstruction.h +++ b/decompiler/VuDisasm/VuInstruction.h @@ -1,7 +1,8 @@ #pragma once -#include #include +#include +#include #include "common/common_types.h" @@ -209,4 +210,4 @@ struct VuInstructionPair { VuInstruction upper, lower; }; -} // namespace decompiler \ No newline at end of file +} // namespace decompiler diff --git a/decompiler/analysis/analyze_inspect_method.cpp b/decompiler/analysis/analyze_inspect_method.cpp new file mode 100644 index 0000000000..4084d0338e --- /dev/null +++ b/decompiler/analysis/analyze_inspect_method.cpp @@ -0,0 +1,988 @@ +#include "analyze_inspect_method.h" +#include "decompiler/Disasm/InstructionMatching.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" + +namespace decompiler { + +struct TypeInspectorResult { + bool success = false; + int type_size = -1; + int type_method_count = -1; + int parent_method_count = 9; + int type_heap_base = -1; + + std::string warnings; + std::vector fields_of_type; + bool is_basic = false; + bool found_flags = false; + + std::string type_name; + std::string parent_type_name; + u64 flags = 0; + + std::string print_as_deftype(StructureType* old_game_type); +}; + +bool is_set_reg_to_int(AtomicOp* op, Register dst, s64 value) { + // should be a set reg to int math 2 ir + auto set = dynamic_cast(op); + if (!set) { + return false; + } + + // destination should be a register + auto dest = set->dst(); + if (dst != dest.reg()) { + return false; + } + + auto math = set->src(); + if (SimpleExpression::Kind::IDENTITY != math.kind()) { + return false; + } + + auto arg = math.get_arg(0); + + if (!arg.is_int() || value != arg.get_int()) { + return false; + } + + return true; +} + +bool is_set_reg_to_symbol_value(AtomicOp* op, Register dst, const std::string& value) { + // should be a set reg to int math 2 ir + auto set = dynamic_cast(op); + if (!set) { + return false; + } + + // destination should be a register + auto dest = set->dst(); + if (dst != dest.reg()) { + return false; + } + + auto math = set->src(); + if (SimpleExpression::Kind::IDENTITY != math.kind()) { + return false; + } + + auto arg = math.get_arg(0); + + if (!arg.is_sym_val(value)) { + return false; + } + + return true; +} + +bool is_set_reg_to_symbol_ptr(AtomicOp* op, Register dst, const std::string& value) { + // should be a set reg to int math 2 ir + auto set = dynamic_cast(op); + if (!set) { + return false; + } + + // destination should be a register + auto dest = set->dst(); + if (dst != dest.reg()) { + return false; + } + + auto math = set->src(); + if (SimpleExpression::Kind::IDENTITY != math.kind()) { + return false; + } + + auto arg = math.get_arg(0); + + if (!arg.is_sym_ptr(value)) { + return false; + } + + return true; +} + +std::optional get_string_loaded_to_reg(AtomicOp* op, + Register reg, + LinkedObjectFile& file) { + // should be a set reg to int math 2 ir + auto set = dynamic_cast(op); + if (!set) { + return {}; + } + + // destination should be a register + auto dest = set->dst(); + if (reg != dest.reg()) { + return {}; + } + + auto math = set->src(); + if (SimpleExpression::Kind::IDENTITY != math.kind()) { + return {}; + } + + auto& src_atom = set->src().get_arg(0); + if (!src_atom.is_label()) { + return {}; + } + + return file.get_goal_string_by_label(src_atom.label()); +} + +struct FieldPrint { + char format = '\0'; + std::string field_name; + std::string field_type_name; + bool has_array = false; + int array_size = -1; +}; + +FieldPrint get_field_print(const std::string& str) { + int idx = 0; + auto next = [&]() { return str.at(idx++); }; + + auto peek = [&](int off) { return str.at(idx + off); }; + + FieldPrint field_print; + + // first is ~T + char c0 = next(); + ASSERT(c0 == '~'); + char c1 = next(); + if (c1 == '1') { + c1 = next(); + } + ASSERT(c1 == 'T'); + + // next the name: + char name_char = next(); + while (name_char != ':' && name_char != '[') { + field_print.field_name.push_back(name_char); + name_char = next(); + } + + // possibly array thing + if (name_char == '[') { + int size = 0; + char num_char = next(); + while (num_char >= '0' && num_char <= '9') { + size = size * 10 + (num_char - '0'); + num_char = next(); + } + field_print.has_array = true; + field_print.array_size = size; + + ASSERT(num_char == ']'); + char c = next(); + ASSERT(c == ' '); + c = next(); + ASSERT(c == '@'); + c = next(); + ASSERT(c == ' '); + c = next(); + ASSERT(c == '#'); + c = next(); + ASSERT(c == 'x'); + } else { + // next a space + char space_char = next(); + ASSERT(space_char == ' '); + } + + // next the format + char fmt1 = next(); + if (fmt1 == '~' && peek(0) != '`') { // normal ~_~% + char fmt_code = next(); + field_print.format = fmt_code; + char end1 = next(); + ASSERT(end1 == '~'); + char end2 = next(); + ASSERT(end2 == '%'); + ASSERT(idx == (int)str.size()); + } else if (fmt1 == '#' && peek(0) == '<') { // struct #~% + next(); + char type_name_c = next(); + while (type_name_c != ' ') { + field_print.field_type_name += type_name_c; + type_name_c = next(); + } + + std::string expect_end = "@ #x~X>~%"; + for (char i : expect_end) { + char c = next(); + ASSERT(i == c); + } + field_print.format = 'X'; + + ASSERT(idx == (int)str.size()); + } else if (fmt1 == '#' && peek(0) == 'x') { // #x~X~% + next(); + std::string expect_end = "~X~%"; + for (char i : expect_end) { + char c = next(); + ASSERT(i == c); + } + field_print.format = 'X'; + } else if (fmt1 == '~' && peek(0) == '`') { // ~`my-type-with-overriden-print`P~% + next(); + char type_name_c = next(); + while (type_name_c != '`') { + field_print.field_type_name += type_name_c; + type_name_c = next(); + } + + std::string expect_end = "P~%"; + for (char i : expect_end) { + char c = next(); + ASSERT(i == c); + } + field_print.format = 'P'; + + ASSERT(idx == (int)str.size()); + } else if (str.substr(idx - 1) == "(meters ~m)~%") { + field_print.format = 'm'; + } else if (str.substr(idx - 1) == "(deg ~r)~%") { + field_print.format = 'r'; + } else if (str.substr(idx - 1) == "(seconds ~e)~%") { + field_print.format = 'e'; + } + + else { + throw std::runtime_error("other format nyi in get_field_print " + str.substr(idx)); + } + + return field_print; +} + +int get_start_idx(Function& function, + LinkedObjectFile& file, + TypeInspectorResult* result, + const std::string& /*parent_type*/, + const std::string& type_name, + Env& env) { + if (function.basic_blocks.size() != 5) { + fmt::print("[iim] inspect {} had {} basic blocks, expected 5\n", function.name(), + function.basic_blocks.size()); + return -1; + } + + if (!function.ir2.atomic_ops) { + fmt::print("[iim] no atomic ops in {}\n", function.name()); + return -1; + } + auto& aos = *function.ir2.atomic_ops; + + int op_idx = 0; + // block 0: + /* + * (set! gp a0) + * (b! (truthy gp) L370 (set! v1 #f)) + */ + + if (aos.block_id_to_end_atomic_op.at(0) != 2) { + fmt::print("[iim] block 0 had the wrong number of ops: {} for {}\n", + aos.block_id_to_end_atomic_op.at(0), function.name()); + return -1; + } + + if (!is_op_2(aos.ops.at(op_idx).get(), SimpleExpression::Kind::IDENTITY, + Register(Reg::GPR, Reg::GP), Register(Reg::GPR, Reg::A0))) { + fmt::print("[iim] block 0 op 0 bad in {}: {}\n", aos.ops.at(op_idx)->to_string(env), + function.name()); + return -1; + } + op_idx++; + + auto br = dynamic_cast(aos.ops.at(op_idx).get()); + if (!br) { + fmt::print("[iim] block 0 op 1 bad in {}: {} (not branch)\n", aos.ops.at(1)->to_string(env), + function.name()); + return -1; + } + + if (br->likely() || br->condition().kind() != IR2_Condition::Kind::TRUTHY || + !br->condition().src(0).is_var() || + br->condition().src(0).var().reg() != Register(Reg::GPR, Reg::GP) || + br->branch_delay().kind() != IR2_BranchDelay::Kind::SET_REG_FALSE || + br->branch_delay().var(0).reg() != Register(Reg::GPR, Reg::V1)) { + fmt::print("[iim] block 0 op 1 bad in {}: {} (bad branch)\n", aos.ops.at(1)->to_string(env), + function.name()); + return -1; + } + op_idx++; + + // block 1: + /* + * (set! gp gp) + * (b! #t L371 (nop!)) + */ + if (aos.block_id_to_end_atomic_op.at(1) != 4) { + fmt::print("[iim] block 1 had the wrong number of ops: {} for {}\n", + aos.block_id_to_end_atomic_op.at(1), function.name()); + return -1; + } + + if (!is_op_2(aos.ops.at(op_idx).get(), SimpleExpression::Kind ::IDENTITY, + Register(Reg::GPR, Reg::GP), Register(Reg::GPR, Reg::GP))) { + fmt::print("[iim] op 2 bad in {}: {}\n", aos.ops.at(op_idx)->to_string(env), function.name()); + return -1; + } + op_idx++; + + auto br2 = dynamic_cast(aos.ops.at(op_idx).get()); + if (!br2) { + fmt::print("[iim] op 3 bad in {}: {} (not branch)\n", aos.ops.at(op_idx)->to_string(env), + function.name()); + return -1; + } + + if (br2->likely() || br2->condition().kind() != IR2_Condition::Kind::ALWAYS || + br2->branch_delay().kind() != IR2_BranchDelay::Kind::NOP) { + fmt::print("[iim] op3 bad in {}: {} (bad branch)\n", aos.ops.at(op_idx)->to_string(env), + function.name()); + return -1; + } + op_idx++; + + // setup + /* + (set! v1 0) + (set! t9 format) + (set! a0 #t) + (set! a1 L386) + (set! a2 gp) + (set! a3 'vector) (also can be (set! a3 (l.wu (+ gp -4)))) + (call!) + */ + + if (!is_set_reg_to_int(aos.ops.at(op_idx).get(), Register(Reg::GPR, Reg::V1), 0)) { + fmt::print("[iim] op4 bad in {}: {} (bad set 0)\n", aos.ops.at(op_idx)->to_string(env), + function.name()); + } + op_idx++; + + if (!is_set_reg_to_symbol_value(aos.ops.at(op_idx).get(), Register(Reg::GPR, Reg::T9), + "format")) { + fmt::print("[iim] op5 bad in {}: {} (bad set format)\n", aos.ops.at(op_idx)->to_string(env), + function.name()); + } + op_idx++; + + if (!is_set_reg_to_symbol_ptr(aos.ops.at(op_idx).get(), Register(Reg::GPR, Reg::A0), "#t")) { + fmt::print("[iim] op6 bad in {}: {} (bad set #t)\n", aos.ops.at(op_idx)->to_string(env), + function.name()); + } + op_idx++; + + auto type_name_str = + get_string_loaded_to_reg(aos.ops.at(op_idx).get(), Register(Reg::GPR, Reg::A1), file); + if (!type_name_str) { + fmt::print("[iim] op7 bad in {}: {} (bad string)\n", aos.ops.at(op_idx)->to_string(env), + function.name()); + } + if (type_name_str != "[~8x] ~A~%") { + fmt::print("[iim] op7 bad in {}: {} (bad string: {})\n", aos.ops.at(op_idx)->to_string(env), + function.name(), *type_name_str); + } + op_idx++; + + if (!is_op_2(aos.ops.at(op_idx).get(), SimpleExpression::Kind ::IDENTITY, + Register(Reg::GPR, Reg::A2), Register(Reg::GPR, Reg::GP))) { + fmt::print("[iim] op 8 bad in {}: {}\n", aos.ops.at(op_idx)->to_string(env), function.name()); + return -1; + } + op_idx++; + + if (is_set_reg_to_symbol_ptr(aos.ops.at(op_idx).get(), Register(Reg::GPR, Reg::A3), type_name)) { + result->is_basic = false; + } else if (aos.ops.at(op_idx)->to_string(env) == "(set! a3 (l.wu (+ gp -4)))") { + result->is_basic = true; + } else { + fmt::print("[iim] op 9 bad in {}: {}\n", aos.ops.at(op_idx)->to_string(env), function.name()); + return -1; + } + op_idx++; + + if (!dynamic_cast(aos.ops.at(op_idx).get())) { + fmt::print("[iim] op 10 bad in {}: {}\n", aos.ops.at(op_idx)->to_string(env), function.name()); + return -1; + } + op_idx++; + + return op_idx; +} + +std::pair get_base_of_load(const SimpleExpression& load_addr) { + if (load_addr.kind() == SimpleExpression::Kind::IDENTITY) { + const auto& src = load_addr.get_arg(0); + if (src.is_var()) { + return {src.var().reg(), 0}; + } + } + + if (load_addr.kind() == SimpleExpression::Kind::ADD) { + const auto& src0 = load_addr.get_arg(0); + const auto& src1 = load_addr.get_arg(1); + if (src1.get_kind() == SimpleAtom::Kind::INTEGER_CONSTANT && + src0.get_kind() == SimpleAtom::Kind::VARIABLE) { + return {src0.var().reg(), src1.get_int()}; + } + } + ASSERT(false); +} + +bool is_load_with_base(const SimpleExpression& expr, Register base) { + return get_base_of_load(expr).first == base; +} + +bool is_get_load(AtomicOp* ir, Register dst, Register base) { + auto as_set = dynamic_cast(ir); + return as_set && as_set->get_set_destination().reg() == dst && + is_load_with_base(as_set->src(), base); +} + +struct LoadInfo { + int offset = 0; + int size = 0; + LoadVarOp::Kind kind; +}; + +LoadInfo get_load_info_from_set(AtomicOp* load) { + auto as_load = dynamic_cast(load); + ASSERT(as_load); + LoadInfo info; + info.kind = as_load->kind(); + info.size = as_load->size(); + auto base = get_base_of_load(as_load->src()); + info.offset = base.second; + return info; +} + +int identify_int_field(int idx, + Function& function, + TypeInspectorResult* result, + FieldPrint& print_info) { + auto load_info = get_load_info_from_set(function.ir2.atomic_ops->ops.at(idx++).get()); + + std::string field_type_name; + if (load_info.kind == LoadVarOp::Kind::UNSIGNED) { + field_type_name += "u"; + } else if (load_info.kind == LoadVarOp::Kind::FLOAT) { + ASSERT(false); // ... + } + field_type_name += "int"; + + switch (load_info.size) { + case 1: + field_type_name += "8"; + break; + case 2: + field_type_name += "16"; + break; + case 4: + field_type_name += "32"; + break; + case 8: + field_type_name += "64"; + break; + case 16: + field_type_name += "128"; + break; + default: + throw std::runtime_error("unknown load op size in identify int field " + + std::to_string((int)load_info.size)); + } + + if (print_info.format == 'e') { + field_type_name = "seconds"; + ASSERT(load_info.size == 8); + } + + int offset = load_info.offset; + if (result->is_basic) { + offset += BASIC_OFFSET; + } + + Field field(print_info.field_name, TypeSpec(field_type_name), offset); + result->fields_of_type.push_back(field); + + return idx; +} +int identify_float_field(int idx, + Function& function, + TypeInspectorResult* result, + FieldPrint& print_info) { + auto load_info = get_load_info_from_set(function.ir2.atomic_ops->ops.at(idx++).get()); + ASSERT(load_info.size == 4); + ASSERT(load_info.kind == LoadVarOp::Kind::FLOAT); + + auto& float_move = function.ir2.atomic_ops->ops.at(idx++); + if (!is_op_2(float_move.get(), SimpleExpression::Kind::FPR_TO_GPR, make_gpr(Reg::A2), + make_fpr(0))) { + printf("bad float move: %s\n", float_move->to_string(function.ir2.env).c_str()); + ASSERT(false); + } + + std::string type; + switch (print_info.format) { + case 'f': + type = "float"; + break; + case 'm': + type = "meters"; + break; + case 'r': + type = "deg"; + break; + case 'X': + type = "float"; + result->warnings += "field " + print_info.field_name + " is a float printed as hex? "; + break; + default: + ASSERT(false); + } + int offset = load_info.offset; + if (result->is_basic) { + offset += BASIC_OFFSET; + } + + Field field(print_info.field_name, TypeSpec(type), offset); + result->fields_of_type.push_back(field); + return idx; +} + +int identify_pointer_field(int idx, + Function& function, + TypeInspectorResult* result, + FieldPrint& print_info) { + auto load_info = get_load_info_from_set(function.ir2.atomic_ops->ops.at(idx++).get()); + ASSERT(load_info.size == 4); + ASSERT(load_info.kind == LoadVarOp::Kind::UNSIGNED); + + int offset = load_info.offset; + if (result->is_basic) { + offset += BASIC_OFFSET; + } + + Field field(print_info.field_name, TypeSpec("pointer"), offset); + result->fields_of_type.push_back(field); + return idx; +} + +bool get_ptr_offset_constant_nonzero(const SimpleExpression& math, Register base, int* result) { + // if (!is_reg(math->arg0.get(), base)) { + if (!math.get_arg(0).is_var() || math.get_arg(0).var().reg() != base) { + return false; + } + + if (!math.get_arg(1).is_int()) { + return false; + } + + *result = math.get_arg(1).get_int(); + return true; +} + +bool get_ptr_offset(AtomicOp* ir, Register dst, Register base, int* result) { + auto as_set = dynamic_cast(ir); + if (!as_set) { + return false; + } + if (as_set->dst().reg() != dst) { + return false; + } + + return get_ptr_offset_constant_nonzero(as_set->src(), base, result); +} + +int identify_array_field(int idx, + Function& function, + TypeInspectorResult* result, + FieldPrint& print_info) { + auto& get_op = function.ir2.atomic_ops->ops.at(idx++); + int offset = 0; + if (!get_ptr_offset(get_op.get(), make_gpr(Reg::A2), make_gpr(Reg::GP), &offset)) { + printf("bad get ptr offset %s\n", get_op->to_string(function.ir2.env).c_str()); + ASSERT(false); + } + if (result->is_basic) { + offset += BASIC_OFFSET; + } + + Field field(print_info.field_name, TypeSpec("UNKNOWN"), offset); + if (print_info.array_size) { + field.set_array(print_info.array_size); + } else { + field.set_dynamic(); + } + result->fields_of_type.push_back(field); + return idx; +} + +int identify_struct_not_inline_field(int idx, + Function& function, + TypeInspectorResult* result, + FieldPrint& print_info) { + auto load_info = get_load_info_from_set(function.ir2.atomic_ops->ops.at(idx++).get()); + + if (!(load_info.size == 4 && load_info.kind == LoadVarOp::Kind::UNSIGNED)) { + result->warnings += "field " + print_info.field_type_name + " is likely a value type"; + } + int offset = load_info.offset; + if (result->is_basic) { + offset += BASIC_OFFSET; + } + + Field field(print_info.field_name, TypeSpec(print_info.field_type_name), offset); + result->fields_of_type.push_back(field); + return idx; +} + +int identify_struct_inline_field(int idx, + Function& function, + TypeInspectorResult* result, + FieldPrint& print_info) { + auto& get_op = function.ir2.atomic_ops->ops.at(idx++); + int offset = 0; + if (!get_ptr_offset(get_op.get(), make_gpr(Reg::A2), make_gpr(Reg::GP), &offset)) { + printf("bad get ptr offset %s\n", get_op->to_string(function.ir2.env).c_str()); + ASSERT(false); + } + if (result->is_basic) { + offset += BASIC_OFFSET; + } + + Field field(print_info.field_name, TypeSpec(print_info.field_type_name), offset); + field.set_inline(); + result->fields_of_type.push_back(field); + return idx; +} + +int identify_basic_field(int idx, + Function& function, + LinkedObjectFile& file, + TypeInspectorResult* result, + FieldPrint& print_info) { + (void)file; + auto load_info = get_load_info_from_set(function.ir2.atomic_ops->ops.at(idx++).get()); + ASSERT(load_info.size == 4); + ASSERT(load_info.kind == LoadVarOp::Kind::UNSIGNED || load_info.kind == LoadVarOp::Kind::SIGNED); + + if (load_info.kind == LoadVarOp::Kind::SIGNED) { + result->warnings += "field " + print_info.field_name + " is a basic loaded with a signed load "; + } + + int offset = load_info.offset; + if (result->is_basic) { + offset += BASIC_OFFSET; + } + + Field field(print_info.field_name, TypeSpec("basic"), offset); + result->fields_of_type.push_back(field); + return idx; +} + +int detect(int idx, Function& function, LinkedObjectFile& file, TypeInspectorResult* result) { + auto& get_format_op = function.ir2.atomic_ops->ops.at(idx++); + if (!is_set_reg_to_symbol_value(get_format_op.get(), make_gpr(Reg::T9), "format")) { + ASSERT_MSG(false, + fmt::format("bad get format: {}\n", get_format_op->to_string(function.ir2.env))); + } + + auto& get_true = function.ir2.atomic_ops->ops.at(idx++); + if (!is_set_reg_to_symbol_ptr(get_true.get(), make_gpr(Reg::A0), "#t")) { + ASSERT_MSG(false, "bad get true"); + } + + auto sstr = get_string_loaded_to_reg(function.ir2.atomic_ops->ops.at(idx++).get(), + make_gpr(Reg::A1), file); + if (!sstr) { + ASSERT_MSG(false, "bad sstr"); + } + + auto info = get_field_print(*sstr); + + auto& first_get_op = function.ir2.atomic_ops->ops.at(idx); + + if (is_get_load(first_get_op.get(), make_gpr(Reg::A2), make_gpr(Reg::GP)) && + (info.format == 'D' || info.format == 'X' || info.format == 'e') && !info.has_array && + info.field_type_name.empty()) { + idx = identify_int_field(idx, function, result, info); + // it's a load! + } else if (is_get_load(first_get_op.get(), make_fpr(0), make_gpr(Reg::GP)) && + (info.format == 'f' || info.format == 'm' || info.format == 'r' || + info.format == 'X') && + !info.has_array && info.field_type_name.empty()) { + idx = identify_float_field(idx, function, result, info); + } else if (is_get_load(first_get_op.get(), make_gpr(Reg::A2), make_gpr(Reg::GP)) && + info.format == 'A' && !info.has_array && info.field_type_name.empty()) { + idx = identify_basic_field(idx, function, file, result, info); + } else if (is_get_load(first_get_op.get(), make_gpr(Reg::A2), make_gpr(Reg::GP)) && + info.format == 'X' && !info.has_array && info.field_type_name.empty()) { + idx = identify_pointer_field(idx, function, result, info); + } else if (info.has_array && (info.format == 'X' || info.format == 'P') && + info.field_type_name.empty()) { + idx = identify_array_field(idx, function, result, info); + } else if (!info.has_array && (info.format == 'X' || info.format == 'P') && + !info.field_type_name.empty()) { + // structure. + if (is_get_load(first_get_op.get(), make_gpr(Reg::A2), make_gpr(Reg::GP))) { + // not inline + idx = identify_struct_not_inline_field(idx, function, result, info); + } else { + idx = identify_struct_inline_field(idx, function, result, info); + } + } + + else { + printf("couldn't do %s, %s\n", sstr->c_str(), + first_get_op->to_string(function.ir2.env).c_str()); + return -1; + } + + if (!dynamic_cast(function.ir2.atomic_ops->ops.at(idx++).get())) { + printf("bad call\n"); + ASSERT(false); + return -1; + } + + return idx; +} + +std::string inspect_inspect_method(Function& inspect_method, + const std::string& type_name, + DecompilerTypeSystem& dts, + LinkedObjectFile& file, + TypeSystem& previous_game_ts) { + fmt::print(" iim: {}\n", inspect_method.name()); + TypeInspectorResult result; + ASSERT(type_name == inspect_method.guessed_name.type_name); + TypeFlags flags; + flags.flag = 0; + result.found_flags = dts.lookup_flags(type_name, &flags.flag); + result.type_name = type_name; + result.parent_type_name = dts.lookup_parent_from_inspects(type_name); + result.flags = flags.flag; + result.type_size = flags.size; + result.type_method_count = flags.methods; + result.type_heap_base = flags.heap_base; + + { + TypeFlags parent_flags; + parent_flags.flag = 0; + if (result.parent_type_name != "UNKNOWN" && + dts.lookup_flags(result.parent_type_name, &parent_flags.flag)) { + result.parent_method_count = parent_flags.methods; + } + } + if (!result.found_flags) { + fmt::print("[iim] no flags found for {}, maybe defined in the kernel\n", type_name); + } + + result.parent_type_name = dts.lookup_parent_from_inspects(type_name); + int idx = get_start_idx(inspect_method, file, &result, result.parent_type_name, type_name, + inspect_method.ir2.env); + StructureType* old_game_type = nullptr; + if (previous_game_ts.fully_defined_type_exists(type_name)) { + old_game_type = dynamic_cast(previous_game_ts.lookup_type(type_name)); + } + if (idx <= 0) { + // can't get any field... + result.warnings += "Failed to read fields. "; + idx = -2; + return result.print_as_deftype(old_game_type); + } + while (idx < int(inspect_method.ir2.atomic_ops->ops.size()) - 2 && idx != -1) { + idx = detect(idx, inspect_method, file, &result); + } + + if (idx == -1) { + result.warnings += "Failed to read some fields. "; + } + + return result.print_as_deftype(old_game_type); +} + +std::string old_method_string(const MethodInfo& info) { + if (info.type.arg_count() > 0) { + if (info.type.base_type() == "function" || info.type.base_type() == "state") { + std::string result = fmt::format(" ;; ({} (", info.name); + bool add = false; + for (int i = 0; i < (int)info.type.arg_count() - 1; i++) { + result += info.type.get_arg(i).print(); + result += ' '; + add = true; + } + if (add) { + result.pop_back(); + } + result += ") "; + result += info.type.get_arg(info.type.arg_count() - 1).print(); + if (info.type.base_type() == "state") { + result += " :state"; + } + result += fmt::format(" {})", info.id); + return result; + } + } + + return fmt::format(" ;; ({} {}) weird method", info.name, info.type.print()); +} + +/* + * old_game_type may be null + */ +std::string TypeInspectorResult::print_as_deftype(StructureType* old_game_type) { + std::string result; + + result += fmt::format("(deftype {} ({})\n (", type_name, parent_type_name); + + int longest_field_name = 0; + int longest_type_name = 0; + int longest_mods = 0; + + std::string inline_string = ":inline"; + std::string dynamic_string = ":dynamic"; + + for (auto& field : fields_of_type) { + longest_field_name = std::max(longest_field_name, int(field.name().size())); + longest_type_name = std::max(longest_type_name, int(field.type().print().size())); + + int mods = 0; + // mods are array size, :inline, :dynamic + if (field.is_array() && !field.is_dynamic()) { + mods += std::to_string(field.array_size()).size(); + } + + if (field.is_inline()) { + if (mods) { + mods++; // space + } + mods += inline_string.size(); + } + + if (field.is_dynamic()) { + if (mods) { + mods++; // space + } + mods += dynamic_string.size(); + } + longest_mods = std::max(longest_mods, mods); + } + + for (auto& field : fields_of_type) { + result += "("; + result += field.name(); + result.append(1 + (longest_field_name - int(field.name().size())), ' '); + result += field.type().print(); + result.append(1 + (longest_type_name - int(field.type().print().size())), ' '); + + std::string mods; + if (field.is_array() && !field.is_dynamic()) { + mods += std::to_string(field.array_size()); + mods += " "; + } + + if (field.is_inline()) { + mods += inline_string; + mods += " "; + } + + if (field.is_dynamic()) { + mods += dynamic_string; + mods += " "; + } + result.append(mods); + result.append(longest_mods - int(mods.size() - 1), ' '); + + result.append(":offset-assert "); + result.append(std::to_string(field.offset())); + result.append(")"); + if (old_game_type) { + Field old_field; + if (old_game_type->lookup_field(field.name(), &old_field)) { + if (old_field.type() != field.type()) { + result += fmt::format(" ;; {}", old_field.type().print()); + if (old_field.is_array() && !old_field.is_dynamic()) { + result += fmt::format(" {}", old_field.array_size()); + } + if (old_field.is_inline()) { + result += " :inline"; + } + if (old_field.is_dynamic()) { + result += " :dynamic"; + } + } + } + } + result.append("\n "); + } + result.append(")\n"); + + result.append(fmt::format(" :method-count-assert {}\n", type_method_count)); + result.append(fmt::format(" :size-assert #x{:x}\n", type_size)); + result.append(fmt::format(" :flag-assert #x{:x}\n ", flags)); + if (!warnings.empty()) { + result.append(";; "); + result.append(warnings); + result.append("\n "); + } + + if (type_method_count > 9) { + result.append("(:methods\n "); + MethodInfo old_new_method; + if (old_game_type && old_game_type->get_my_new_method(&old_new_method)) { + result.append(old_method_string(old_new_method)); + result.append("\n "); + } + for (int i = parent_method_count; i < type_method_count; i++) { + result.append(fmt::format("(dummy-{} () none {})", i, i)); + if (old_game_type) { + MethodInfo info; + if (old_game_type->get_my_method(i, &info)) { + result += old_method_string(info); + } + } + result.append("\n "); + } + result.append(")\n "); + } + result.append(")\n"); + + return result; +} + +std::string inspect_top_level_symbol_defines(std::unordered_set& already_seen, + Function& top_level, + LinkedObjectFile& /*file*/, + DecompilerTypeSystem& dts, + DecompilerTypeSystem& previous_game_ts) { + if (!top_level.ir2.atomic_ops) { + return {}; + } + std::string result; + for (auto& aop : top_level.ir2.atomic_ops->ops) { + auto* as_store = dynamic_cast(aop.get()); + if (as_store && as_store->addr().kind() == SimpleExpression::Kind::IDENTITY && + as_store->addr().get_arg(0).is_sym_val()) { + auto& sym_name = as_store->addr().get_arg(0).get_str(); + if (already_seen.find(sym_name) == already_seen.end()) { + already_seen.insert(sym_name); + if (dts.ts.partially_defined_type_exists(sym_name)) { + continue; + } + result += fmt::format(";; (define-extern {} object)", sym_name); + auto it = previous_game_ts.symbol_types.find(sym_name); + if (it != previous_game_ts.symbol_types.end()) { + result += fmt::format(" ;; {}", it->second.print()); + } + result += '\n'; + } + } + } + return result; +} +} // namespace decompiler diff --git a/decompiler/analysis/analyze_inspect_method.h b/decompiler/analysis/analyze_inspect_method.h new file mode 100644 index 0000000000..ed2dfa222e --- /dev/null +++ b/decompiler/analysis/analyze_inspect_method.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include + +#include "decompiler/Function/Function.h" +#include "decompiler/util/DecompilerTypeSystem.h" + +namespace decompiler { + +std::string inspect_inspect_method(Function& inspect_method, + const std::string& type_name, + DecompilerTypeSystem& dts, + LinkedObjectFile& file, + TypeSystem& previous_game_ts); + +std::string inspect_top_level_symbol_defines(std::unordered_set& already_seen, + Function& top_level, + LinkedObjectFile& file, + DecompilerTypeSystem& dts, + DecompilerTypeSystem& previous_game_ts); + +} // namespace decompiler \ No newline at end of file diff --git a/decompiler/analysis/atomic_op_builder.cpp b/decompiler/analysis/atomic_op_builder.cpp index f5d8001419..fdf2de9c4e 100644 --- a/decompiler/analysis/atomic_op_builder.cpp +++ b/decompiler/analysis/atomic_op_builder.cpp @@ -15,7 +15,8 @@ namespace { std::unique_ptr convert_1(const Instruction& i0, int idx, bool hint_inline_asm, - bool force_asm_branch); + bool force_asm_branch, + GameVersion version); ////////////////////// // Register Helpers @@ -368,10 +369,10 @@ std::unique_ptr make_asm_op(const Instruction& i0, int idx) { } } -std::unique_ptr convert_1_allow_asm(const Instruction& i0, int idx) { +std::unique_ptr convert_1_allow_asm(const Instruction& i0, int idx, GameVersion version) { // only used for delay slots, so fine to assume that this can never be an asm branch itself // as there are no branches in delay slots anywhere. - auto as_normal = convert_1(i0, idx, false, false); + auto as_normal = convert_1(i0, idx, false, false, version); if (as_normal) { return as_normal; } @@ -382,7 +383,7 @@ std::unique_ptr convert_1_allow_asm(const Instruction& i0, int idx) { // Branch Helpers //////////////////////// -IR2_BranchDelay get_branch_delay(const Instruction& i0, int idx) { +IR2_BranchDelay get_branch_delay(const Instruction& i0, int idx, GameVersion version) { if (is_nop(i0)) { return IR2_BranchDelay(IR2_BranchDelay::Kind::NOP); } else if (is_gpr_3(i0, InstructionKind::OR, {}, rs7(), rr0())) { @@ -391,7 +392,7 @@ IR2_BranchDelay get_branch_delay(const Instruction& i0, int idx) { return IR2_BranchDelay(IR2_BranchDelay::Kind::SET_REG_REG, make_dst_var(i0, idx), make_src_var(i0.get_src(0).get_reg(), idx)); } else if (i0.kind == InstructionKind::DADDIU && i0.get_src(0).is_reg(rs7()) && - i0.get_src(1).is_imm(FIX_SYM_TRUE)) { + i0.get_src(1).is_imm(true_symbol_offset(version))) { return IR2_BranchDelay(IR2_BranchDelay::Kind::SET_REG_TRUE, make_dst_var(i0, idx)); } else if (i0.kind == InstructionKind::LW && i0.get_src(1).is_reg(rs7()) && i0.get_src(0).is_sym()) { @@ -419,13 +420,14 @@ std::unique_ptr make_branch(const IR2_Condition& condition, bool likely, int dest_label, int my_idx, - bool force_asm) { + bool force_asm, + GameVersion version) { ASSERT(!likely); - auto branch_delay = get_branch_delay(delay, my_idx); + auto branch_delay = get_branch_delay(delay, my_idx, version); if (!force_asm && branch_delay.is_known()) { return std::make_unique(likely, condition, dest_label, branch_delay, my_idx); } else { - auto delay_op = std::shared_ptr(convert_1_allow_asm(delay, my_idx)); + auto delay_op = std::shared_ptr(convert_1_allow_asm(delay, my_idx, version)); if (!delay_op) { throw std::runtime_error( fmt::format("Failed to convert branch delay slot instruction for branch at {}", my_idx)); @@ -459,9 +461,10 @@ std::unique_ptr make_asm_branch(const IR2_Condition& condition, const Instruction& delay, bool likely, int dest_label, - int my_idx) { + int my_idx, + GameVersion version) { ASSERT(!likely); - auto delay_op = std::shared_ptr(convert_1_allow_asm(delay, my_idx)); + auto delay_op = std::shared_ptr(convert_1_allow_asm(delay, my_idx, version)); if (!delay_op) { throw std::runtime_error( fmt::format("Failed to convert branch delay slot instruction for branch at {}", my_idx)); @@ -561,12 +564,13 @@ std::unique_ptr convert_lw_1(const Instruction& i0, int idx) { } } -std::unique_ptr convert_daddiu_1(const Instruction& i0, int idx) { +std::unique_ptr convert_daddiu_1(const Instruction& i0, int idx, GameVersion version) { if (i0.get_src(0).is_reg(rs7()) && i0.get_src(1).is_sym()) { // get symbol pointer return std::make_unique( make_dst_var(i0, idx), SimpleAtom::make_sym_ptr(i0.get_src(1).get_sym()).as_expr(), idx); - } else if (i0.get_src(0).is_reg(rs7()) && i0.get_src(1).is_imm(FIX_SYM_EMPTY_PAIR)) { + } else if (i0.get_src(0).is_reg(rs7()) && + i0.get_src(1).is_imm(empty_pair_offset_from_s7(version))) { // get empty pair return std::make_unique(make_dst_var(i0, idx), SimpleAtom::make_empty_list().as_expr(), idx); @@ -574,8 +578,7 @@ std::unique_ptr convert_daddiu_1(const Instruction& i0, int idx) { // get pointer to beginning of symbol table (this is a bit of a hack) return std::make_unique( make_dst_var(i0, idx), SimpleAtom::make_sym_val("__START-OF-TABLE__").as_expr(), idx); - } else if (i0.get_src(0).is_reg(rs7()) && i0.get_src(1).is_imm(FIX_SYM_TRUE)) { - // get pointer to beginning of symbol table (this is a bit of a hack) + } else if (i0.get_src(0).is_reg(rs7()) && i0.get_src(1).is_imm(true_symbol_offset(version))) { return std::make_unique(make_dst_var(i0, idx), SimpleAtom::make_sym_ptr("#t").as_expr(), idx); } else if (i0.get_src(0).is_reg(rfp()) && i0.get_src(1).is_label()) { @@ -805,7 +808,8 @@ std::unique_ptr convert_subu_1(const Instruction& i0, int idx) { std::unique_ptr convert_1(const Instruction& i0, int idx, bool hint_inline_asm, - bool force_asm_branch) { + bool force_asm_branch, + GameVersion version) { switch (i0.kind) { case InstructionKind::OR: return convert_or_1(i0, idx); @@ -870,7 +874,7 @@ std::unique_ptr convert_1(const Instruction& i0, case InstructionKind::MAXS: return make_3reg_op(i0, SimpleExpression::Kind::MAX_S, idx); case InstructionKind::DADDIU: - return convert_daddiu_1(i0, idx); + return convert_daddiu_1(i0, idx, version); case InstructionKind::DADDU: return convert_daddu_1(i0, idx); case InstructionKind::DSUBU: @@ -1003,7 +1007,8 @@ std::unique_ptr convert_bne_2(const Instruction& i0, const Instruction& i1, int idx, bool likely, - bool force_asm) { + bool force_asm, + GameVersion version) { auto s0 = i0.get_src(0).get_reg(); auto s1 = i0.get_src(1).get_reg(); auto dest = i0.get_src(2).get_label(); @@ -1021,14 +1026,15 @@ std::unique_ptr convert_bne_2(const Instruction& i0, make_src_atom(s1, idx)); condition.make_flipped(); } - return make_branch(condition, i1, likely, dest, idx, force_asm); + return make_branch(condition, i1, likely, dest, idx, force_asm, version); } std::unique_ptr convert_beq_2(const Instruction& i0, const Instruction& i1, int idx, bool likely, - bool force_asm) { + bool force_asm, + GameVersion version) { auto s0 = i0.get_src(0).get_reg(); auto s1 = i0.get_src(1).get_reg(); auto dest = i0.get_src(2).get_label(); @@ -1053,10 +1059,13 @@ std::unique_ptr convert_beq_2(const Instruction& i0, IR2_Condition(IR2_Condition::Kind::EQUAL, make_src_atom(s0, idx), make_src_atom(s1, idx)); condition.make_flipped(); } - return make_branch(condition, i1, likely, dest, idx, force_asm); + return make_branch(condition, i1, likely, dest, idx, force_asm, version); } -std::unique_ptr convert_daddiu_2(const Instruction& i0, const Instruction& i1, int idx) { +std::unique_ptr convert_daddiu_2(const Instruction& i0, + const Instruction& i1, + int idx, + GameVersion version) { // daddiu dest, s7, 8 // mov{n,z} dest, s7, src if (i1.kind == InstructionKind::MOVN || i1.kind == InstructionKind::MOVZ) { @@ -1066,7 +1075,7 @@ std::unique_ptr convert_daddiu_2(const Instruction& i0, const Instruct return nullptr; } ASSERT(i0.get_src(0).is_reg(rs7())); - ASSERT(i0.get_src(1).is_imm(8)); + ASSERT(i0.get_src(1).is_imm(true_symbol_offset(version))); ASSERT(i1.get_dst(0).is_reg(dest)); ASSERT(i1.get_src(0).is_reg(rs7())); auto kind = @@ -1143,42 +1152,55 @@ std::unique_ptr convert_slt_2(const Instruction& i0, return result; } -std::unique_ptr convert_bltz_2(const Instruction& i0, const Instruction& i1, int idx) { +std::unique_ptr convert_bltz_2(const Instruction& i0, + const Instruction& i1, + int idx, + GameVersion version) { // bltz is never emitted outside of inline asm. auto dest = i0.get_src(1).get_label(); return make_asm_branch(IR2_Condition(IR2_Condition::Kind::LESS_THAN_ZERO_SIGNED, make_src_atom(i0.get_src(0).get_reg(), idx)), - i1, false, dest, idx); + i1, false, dest, idx, version); } -std::unique_ptr convert_bgez_2(const Instruction& i0, const Instruction& i1, int idx) { +std::unique_ptr convert_bgez_2(const Instruction& i0, + const Instruction& i1, + int idx, + GameVersion version) { // bgez is never emitted outside of inline asm. auto dest = i0.get_src(1).get_label(); return make_asm_branch(IR2_Condition(IR2_Condition::Kind::GEQ_ZERO_SIGNED, make_src_atom(i0.get_src(0).get_reg(), idx)), - i1, false, dest, idx); + i1, false, dest, idx, version); } -std::unique_ptr convert_blez_2(const Instruction& i0, const Instruction& i1, int idx) { +std::unique_ptr convert_blez_2(const Instruction& i0, + const Instruction& i1, + int idx, + GameVersion version) { // blez is never emitted outside of inline asm. auto dest = i0.get_src(1).get_label(); return make_asm_branch(IR2_Condition(IR2_Condition::Kind::LEQ_ZERO_SIGNED, make_src_atom(i0.get_src(0).get_reg(), idx)), - i1, false, dest, idx); + i1, false, dest, idx, version); } -std::unique_ptr convert_bgtz_2(const Instruction& i0, const Instruction& i1, int idx) { +std::unique_ptr convert_bgtz_2(const Instruction& i0, + const Instruction& i1, + int idx, + GameVersion version) { // bgtz is never emitted outside of inline asm. auto dest = i0.get_src(1).get_label(); return make_asm_branch(IR2_Condition(IR2_Condition::Kind::GREATER_THAN_ZERO_SIGNED, make_src_atom(i0.get_src(0).get_reg(), idx)), - i1, false, dest, idx); + i1, false, dest, idx, version); } std::unique_ptr convert_2(const Instruction& i0, const Instruction& i1, int idx, - bool force_asm_branch) { + bool force_asm_branch, + GameVersion version) { switch (i0.kind) { case InstructionKind::DIV: return convert_division_2(i0, i1, idx, true); @@ -1187,11 +1209,11 @@ std::unique_ptr convert_2(const Instruction& i0, case InstructionKind::JALR: return convert_jalr_2(i0, i1, idx); case InstructionKind::BNE: - return convert_bne_2(i0, i1, idx, false, force_asm_branch); + return convert_bne_2(i0, i1, idx, false, force_asm_branch, version); case InstructionKind::BEQ: - return convert_beq_2(i0, i1, idx, false, force_asm_branch); + return convert_beq_2(i0, i1, idx, false, force_asm_branch, version); case InstructionKind::DADDIU: - return convert_daddiu_2(i0, i1, idx); + return convert_daddiu_2(i0, i1, idx, version); case InstructionKind::LUI: return convert_lui_2(i0, i1, idx); case InstructionKind::SLT: @@ -1201,13 +1223,13 @@ std::unique_ptr convert_2(const Instruction& i0, case InstructionKind::CLTS: return convert_fp_branch_asm(i0, i1, IR2_Condition::Kind::FLOAT_LESS_THAN, idx); case InstructionKind::BLTZ: - return convert_bltz_2(i0, i1, idx); + return convert_bltz_2(i0, i1, idx, version); case InstructionKind::BGEZ: - return convert_bgez_2(i0, i1, idx); + return convert_bgez_2(i0, i1, idx, version); case InstructionKind::BGTZ: - return convert_bgtz_2(i0, i1, idx); + return convert_bgtz_2(i0, i1, idx, version); case InstructionKind::BLEZ: - return convert_blez_2(i0, i1, idx); + return convert_blez_2(i0, i1, idx, version); default: return nullptr; } @@ -1264,7 +1286,8 @@ std::unique_ptr convert_lui_3(const Instruction& i0, std::unique_ptr convert_dsubu_3(const Instruction& i0, const Instruction& i1, const Instruction& i2, - int idx) { + int idx, + GameVersion version) { if (i1.kind == InstructionKind::DADDIU && (i2.kind == InstructionKind::MOVN || i2.kind == InstructionKind::MOVZ)) { // dsubu temp, a, b @@ -1275,7 +1298,7 @@ std::unique_ptr convert_dsubu_3(const Instruction& i0, auto b = i0.get_src(1).get_reg(); auto dest = i1.get_dst(0).get_reg(); ASSERT(i1.get_src(0).is_reg(rs7())); - ASSERT(i1.get_src(1).is_imm(FIX_SYM_TRUE)); + ASSERT(i1.get_src(1).is_imm(true_symbol_offset(version))); ASSERT(i2.get_dst(0).get_reg() == dest); ASSERT(i2.get_src(0).is_reg(rs7())); ASSERT(i2.get_src(1).get_reg() == temp); @@ -1321,7 +1344,8 @@ std::unique_ptr convert_slt_3(const Instruction& i0, const Instruction& i1, const Instruction& i2, bool is_signed, - int idx) { + int idx, + GameVersion version) { auto s0 = i0.get_src(0).get_reg(); auto s1 = i0.get_src(1).get_reg(); std::unique_ptr result; @@ -1354,7 +1378,7 @@ std::unique_ptr convert_slt_3(const Instruction& i0, if (i1.kind == InstructionKind::BEQ) { condition.invert(); } - result = make_branch(condition, i2, false, dest, idx, false); + result = make_branch(condition, i2, false, dest, idx, false, version); add_clobber_if_unwritten(*result, temp); return result; } else if (i1.kind == InstructionKind::DADDIU && @@ -1366,7 +1390,7 @@ std::unique_ptr convert_slt_3(const Instruction& i0, auto temp = i0.get_dst(0).get_reg(); auto dest = i1.get_dst(0).get_reg(); ASSERT(i1.get_src(0).is_reg(rs7())); - ASSERT(i1.get_src(1).is_imm(FIX_SYM_TRUE)); + ASSERT(i1.get_src(1).is_imm(true_symbol_offset(version))); ASSERT(i2.get_dst(0).get_reg() == dest); ASSERT(i2.get_src(0).is_reg(rs7())); ASSERT(i2.get_src(1).get_reg() == temp); @@ -1400,7 +1424,8 @@ std::unique_ptr convert_slti_3(const Instruction& i0, const Instruction& i1, const Instruction& i2, bool is_signed, - int idx) { + int idx, + GameVersion version) { auto s0 = i0.get_src(0).get_reg(); auto s1 = SimpleAtom::make_int_constant(i0.get_src(1).get_imm()); std::unique_ptr result; @@ -1419,7 +1444,7 @@ std::unique_ptr convert_slti_3(const Instruction& i0, if (i1.kind == InstructionKind::BEQ) { condition.invert(); } - result = make_branch(condition, i2, false, dest, idx, false); + result = make_branch(condition, i2, false, dest, idx, false, version); add_clobber_if_unwritten(*result, temp); return result; } else if (i1.kind == InstructionKind::DADDIU && @@ -1431,7 +1456,7 @@ std::unique_ptr convert_slti_3(const Instruction& i0, auto temp = i0.get_dst(0).get_reg(); auto dest = i1.get_dst(0).get_reg(); ASSERT(i1.get_src(0).is_reg(rs7())); - ASSERT(i1.get_src(1).is_imm(FIX_SYM_TRUE)); + ASSERT(i1.get_src(1).is_imm(true_symbol_offset(version))); ASSERT(i2.get_dst(0).get_reg() == dest); ASSERT(i2.get_src(0).is_reg(rs7())); ASSERT(i2.get_src(1).get_reg() == temp); @@ -1455,14 +1480,15 @@ std::unique_ptr convert_fp_branch(const Instruction& i0, const Instruction& i1, const Instruction& i2, IR2_Condition::Kind kind, - int idx) { + int idx, + GameVersion version) { if (i1.kind == InstructionKind::BC1T || i1.kind == InstructionKind::BC1F) { IR2_Condition condition(kind, make_src_atom(i0.get_src(0).get_reg(), idx), make_src_atom(i0.get_src(1).get_reg(), idx)); if (i1.kind == InstructionKind::BC1F) { condition.invert(); } - return make_branch(condition, i2, false, i1.get_src(0).get_label(), idx, false); + return make_branch(condition, i2, false, i1.get_src(0).get_label(), idx, false, version); } return nullptr; } @@ -1470,26 +1496,27 @@ std::unique_ptr convert_fp_branch(const Instruction& i0, std::unique_ptr convert_3(const Instruction& i0, const Instruction& i1, const Instruction& i2, - int idx) { + int idx, + GameVersion version) { switch (i0.kind) { case InstructionKind::LUI: return convert_lui_3(i0, i1, i2, idx); case InstructionKind::DSUBU: - return convert_dsubu_3(i0, i1, i2, idx); + return convert_dsubu_3(i0, i1, i2, idx, version); case InstructionKind::SLT: - return convert_slt_3(i0, i1, i2, true, idx); + return convert_slt_3(i0, i1, i2, true, idx, version); case InstructionKind::SLTU: - return convert_slt_3(i0, i1, i2, false, idx); + return convert_slt_3(i0, i1, i2, false, idx, version); case InstructionKind::SLTI: - return convert_slti_3(i0, i1, i2, true, idx); + return convert_slti_3(i0, i1, i2, true, idx, version); case InstructionKind::SLTIU: - return convert_slti_3(i0, i1, i2, false, idx); + return convert_slti_3(i0, i1, i2, false, idx, version); case InstructionKind::CEQS: - return convert_fp_branch(i0, i1, i2, IR2_Condition::Kind::FLOAT_EQUAL, idx); + return convert_fp_branch(i0, i1, i2, IR2_Condition::Kind::FLOAT_EQUAL, idx, version); case InstructionKind::CLTS: - return convert_fp_branch(i0, i1, i2, IR2_Condition::Kind::FLOAT_LESS_THAN, idx); + return convert_fp_branch(i0, i1, i2, IR2_Condition::Kind::FLOAT_LESS_THAN, idx, version); case InstructionKind::CLES: - return convert_fp_branch(i0, i1, i2, IR2_Condition::Kind::FLOAT_LEQ, idx); + return convert_fp_branch(i0, i1, i2, IR2_Condition::Kind::FLOAT_LEQ, idx, version); default: return nullptr; } @@ -1503,7 +1530,8 @@ std::unique_ptr convert_dsll32_4(const Instruction& i0, const Instruction& i1, const Instruction& i2, const Instruction& i3, - int idx) { + int idx, + GameVersion version) { if (i1.kind == InstructionKind::SLT && i2.kind == InstructionKind::BEQ) { // dsll32 temp, a0, 30 // slt temp, temp, r0 @@ -1524,7 +1552,7 @@ std::unique_ptr convert_dsll32_4(const Instruction& i0, ASSERT(i2.get_src(1).is_reg(rr0())); IR2_Condition condition(IR2_Condition::Kind::IS_NOT_PAIR, make_src_atom(arg, idx)); - auto result = make_branch(condition, i3, false, i2.get_src(2).get_label(), idx, false); + auto result = make_branch(condition, i3, false, i2.get_src(2).get_label(), idx, false, version); result->add_clobber_reg(temp); return result; } @@ -1536,7 +1564,8 @@ std::unique_ptr convert_fp_branch_with_nop(const Instruction& i0, const Instruction& i2, const Instruction& i3, IR2_Condition::Kind kind, - int idx) { + int idx, + GameVersion version) { if (i1.kind != InstructionKind::VNOP) { return nullptr; } @@ -1546,7 +1575,7 @@ std::unique_ptr convert_fp_branch_with_nop(const Instruction& i0, if (i2.kind == InstructionKind::BC1F) { condition.invert(); } - return make_branch(condition, i3, false, i2.get_src(0).get_label(), idx, false); + return make_branch(condition, i3, false, i2.get_src(0).get_label(), idx, false, version); } return nullptr; } @@ -1555,12 +1584,14 @@ std::unique_ptr convert_4(const Instruction& i0, const Instruction& i1, const Instruction& i2, const Instruction& i3, - int idx) { + int idx, + GameVersion version) { switch (i0.kind) { case InstructionKind::DSLL32: - return convert_dsll32_4(i0, i1, i2, i3, idx); + return convert_dsll32_4(i0, i1, i2, i3, idx, version); case InstructionKind::CEQS: - return convert_fp_branch_with_nop(i0, i1, i2, i3, IR2_Condition::Kind::FLOAT_EQUAL, idx); + return convert_fp_branch_with_nop(i0, i1, i2, i3, IR2_Condition::Kind::FLOAT_EQUAL, idx, + version); default: return nullptr; } @@ -1716,11 +1747,23 @@ std::unique_ptr convert_5(const Instruction& i0, const Instruction& i2, const Instruction& i3, const Instruction& i4, - int idx) { + int idx, + GameVersion version) { auto s6 = make_gpr(Reg::S6); + int process_offset = -1; + switch (version) { + case GameVersion::Jak1: + process_offset = 44; + break; + case GameVersion::Jak2: + process_offset = 48; + break; + default: + ASSERT(false); + } if (i0.kind == InstructionKind::LWU && i0.get_dst(0).is_reg(s6) && - i0.get_src(0).get_imm() == 44 && i0.get_src(1).is_reg(s6) && + i0.get_src(0).get_imm() == process_offset && i0.get_src(1).is_reg(s6) && i1.kind == InstructionKind::MTLO1 && i1.get_src(0).is_reg(s6) && i2.kind == InstructionKind::LWU && i2.get_dst(0).is_reg(s6) && i2.get_src(0).get_imm() == 12 && i2.get_src(1).is_reg(s6) && @@ -2035,6 +2078,7 @@ int convert_block_to_atomic_ops(int begin_idx, const std::vector& labels, FunctionAtomicOps* container, DecompWarnings& warnings, + GameVersion version, bool hint_inline_asm, bool block_ends_in_asm_branch) { container->block_id_to_first_atomic_op.push_back(container->ops.size()); @@ -2080,7 +2124,7 @@ int convert_block_to_atomic_ops(int begin_idx, if (!converted && n_instr >= 5) { // try 5 instructions - op = convert_5(instr[0], instr[1], instr[2], instr[3], instr[4], op_idx); + op = convert_5(instr[0], instr[1], instr[2], instr[3], instr[4], op_idx, version); if (op) { converted = true; length = 5; @@ -2089,7 +2133,7 @@ int convert_block_to_atomic_ops(int begin_idx, if (!converted && n_instr >= 4) { // try 4 instructions - op = convert_4(instr[0], instr[1], instr[2], instr[3], op_idx); + op = convert_4(instr[0], instr[1], instr[2], instr[3], op_idx, version); if (op) { converted = true; length = 4; @@ -2098,7 +2142,7 @@ int convert_block_to_atomic_ops(int begin_idx, if (!converted && n_instr >= 3) { // try 3 instructions - op = convert_3(instr[0], instr[1], instr[2], op_idx); + op = convert_3(instr[0], instr[1], instr[2], op_idx, version); if (op) { converted = true; length = 3; @@ -2107,7 +2151,7 @@ int convert_block_to_atomic_ops(int begin_idx, if (!converted && n_instr >= 2) { // try 2 instructions - op = convert_2(instr[0], instr[1], op_idx, block_ends_in_asm_branch); + op = convert_2(instr[0], instr[1], op_idx, block_ends_in_asm_branch, version); if (op) { converted = true; length = 2; @@ -2117,7 +2161,7 @@ int convert_block_to_atomic_ops(int begin_idx, if (!converted) { // try 1 instruction bool force_asm_branch = n_instr == 1 && block_ends_in_asm_branch; - op = convert_1(*instr, op_idx, hint_inline_asm, force_asm_branch); + op = convert_1(*instr, op_idx, hint_inline_asm, force_asm_branch, version); if (op) { converted = true; length = 1; @@ -2162,7 +2206,8 @@ FunctionAtomicOps convert_function_to_atomic_ops( const std::vector& labels, DecompWarnings& warnings, bool hint_inline_asm, - const std::unordered_set& blocks_ending_in_asm_branches) { + const std::unordered_set& blocks_ending_in_asm_branches, + GameVersion version) { FunctionAtomicOps result; int last_op = 0; @@ -2173,7 +2218,7 @@ FunctionAtomicOps convert_function_to_atomic_ops( auto begin = func.instructions.begin() + block.start_word; auto end = func.instructions.begin() + block.end_word; last_op = convert_block_to_atomic_ops( - block.start_word, begin, end, labels, &result, warnings, hint_inline_asm, + block.start_word, begin, end, labels, &result, warnings, version, hint_inline_asm, blocks_ending_in_asm_branches.find(i) != blocks_ending_in_asm_branches.end()); if (i == int(func.basic_blocks.size()) - 1) { // we're the last block. insert the function end op. diff --git a/decompiler/analysis/atomic_op_builder.h b/decompiler/analysis/atomic_op_builder.h index c70bbe0908..d27af404e8 100644 --- a/decompiler/analysis/atomic_op_builder.h +++ b/decompiler/analysis/atomic_op_builder.h @@ -49,6 +49,7 @@ int convert_block_to_atomic_ops(int begin_idx, const std::vector& labels, FunctionAtomicOps* container, DecompWarnings& warnings, + GameVersion version, bool inline_asm_hint = false, bool block_ends_in_asm_branch = false); @@ -60,5 +61,6 @@ FunctionAtomicOps convert_function_to_atomic_ops( const std::vector& labels, DecompWarnings& warnings, bool hint_inline_asm, - const std::unordered_set& blocks_ending_in_asm_branches); + const std::unordered_set& blocks_ending_in_asm_branches, + GameVersion version); } // namespace decompiler \ No newline at end of file diff --git a/decompiler/analysis/cfg_builder.cpp b/decompiler/analysis/cfg_builder.cpp index 8dda80df55..c4c64b87ec 100644 --- a/decompiler/analysis/cfg_builder.cpp +++ b/decompiler/analysis/cfg_builder.cpp @@ -6,6 +6,7 @@ #include "cfg_builder.h" #include "decompiler/Function/Function.h" #include "decompiler/IR2/Form.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" #include "decompiler/util/MatchParam.h" namespace decompiler { @@ -107,7 +108,14 @@ void clean_up_cond_with_else(FormPool& pool, FormElement* ir, const Env& env) { void clean_up_until_loop(FormPool& pool, UntilElement* ir, const Env& env) { auto condition_branch = get_condition_branch(ir->condition); ASSERT(condition_branch.first); - ASSERT(condition_branch.first->op()->branch_delay().kind() == IR2_BranchDelay::Kind::NOP); + if (condition_branch.first->op()->branch_delay().kind() != IR2_BranchDelay::Kind::NOP) { + ASSERT_MSG( + condition_branch.first->op()->branch_delay().kind() == IR2_BranchDelay::Kind::SET_REG_FALSE, + fmt::format( + "bad delay slot in until loop: {} in {}\n", env.func->name(), + condition_branch.first->op()->branch_delay().to_form(env.file->labels, env).print())); + ir->false_destination = condition_branch.first->op()->branch_delay().var(0); + } auto replacement = condition_branch.first->op()->get_condition_as_form(pool, env); replacement->invert(); *(condition_branch.second) = replacement; @@ -565,7 +573,7 @@ bool try_splitting_nested_sc(FormPool& pool, Function& func, ShortCircuitElement ASSERT(ir->entries.at(i).branch_delay.has_value()); bool is_and = delay_slot_sets_false(branch.first, *ir->entries.at(i).branch_delay); bool is_or = delay_slot_sets_truthy(branch.first, *ir->entries.at(i).branch_delay); - ASSERT(is_and != is_or); + ASSERT_MSG(is_and != is_or, fmt::format("bad nested sc in {}", func.name())); if (first_different == -1) { // haven't seen a change yet. @@ -708,6 +716,7 @@ void clean_up_cond_no_else_final(Function& func, CondNoElseElement* cne) { ASSERT(fr.has_value()); cne->final_destination = *fr; } else { + fmt::print("failed to clean up cond_no_else_final: {}\n", func.name()); ASSERT(false); } } @@ -916,47 +925,6 @@ bool is_op_3(AtomicOp* op, return true; } -bool is_op_2(AtomicOp* op, - MatchParam kind, - MatchParam dst, - MatchParam src0, - Register* dst_out = nullptr, - Register* src0_out = nullptr) { - // should be a set reg to int math 2 ir - auto set = dynamic_cast(op); - if (!set) { - return false; - } - - // destination should be a register - auto dest = set->dst(); - if (dst != dest.reg()) { - return false; - } - - auto math = set->src(); - if (kind != math.kind()) { - return false; - } - - auto arg = math.get_arg(0); - - if (!arg.is_var() || src0 != arg.var().reg()) { - return false; - } - - // it's a match! - if (dst_out) { - *dst_out = dest.reg(); - } - - if (src0_out) { - *src0_out = arg.var().reg(); - } - - return true; -} - bool is_op_2(FormElement* ir, MatchParam kind, MatchParam dst, @@ -1634,6 +1602,10 @@ Form* cfg_to_ir_helper(FormPool& pool, Function& f, const CfgVtx* vtx) { ASSERT(delay_end - delay_start == 1); auto& op = f.ir2.atomic_ops->ops.at(delay_start); auto op_as_expr = dynamic_cast(op.get()); + if (!op_as_expr) { + fmt::print("bad in {}\n", f.name()); + fmt::print("{}\n", op->to_string(f.ir2.env)); + } ASSERT(op_as_expr); e.branch_delay = *op_as_expr; } diff --git a/decompiler/analysis/final_output.cpp b/decompiler/analysis/final_output.cpp index d7a6bda302..df6795c7b9 100644 --- a/decompiler/analysis/final_output.cpp +++ b/decompiler/analysis/final_output.cpp @@ -227,6 +227,7 @@ std::string write_from_top_level_form(Form* top_form, const DecompilerTypeSystem& dts, const LinkedObjectFile& file, const std::unordered_set& skip_functions, + const std::vector& imports, const Env& env) { std::vector forms = top_form->elts(); ASSERT(!forms.empty()); @@ -238,6 +239,15 @@ std::string write_from_top_level_form(Form* top_form, } std::string result; + + // import deps: + for (const auto& import : imports) { + result += fmt::format("(import \"{}\")\n", import); + } + if (!imports.empty()) { + result += "\n"; + } + // local vars: auto var_dec = env.local_var_type_list(top_form, 0); if (var_dec.local_vars) { @@ -443,7 +453,7 @@ std::string write_from_top_level_form(Form* top_form, result += ";; this part is debug only\n"; result += "(when *debug-segment*\n"; - result += write_from_top_level_form(entry.body, dts, file, skip_functions, env); + result += write_from_top_level_form(entry.body, dts, file, skip_functions, imports, env); result += ")\n"; } @@ -480,6 +490,7 @@ std::string write_from_top_level_form(Form* top_form, std::string write_from_top_level(const Function& top_level, const DecompilerTypeSystem& dts, const LinkedObjectFile& file, + const std::vector& imports, const std::unordered_set& skip_functions) { auto top_form = top_level.ir2.top_form; if (!top_form) { @@ -499,6 +510,6 @@ std::string write_from_top_level(const Function& top_level, return ";; ERROR: top level has no register use analysis. Cannot decompile.\n\n"; } - return write_from_top_level_form(top_form, dts, file, skip_functions, env); + return write_from_top_level_form(top_form, dts, file, skip_functions, imports, env); } } // namespace decompiler diff --git a/decompiler/analysis/final_output.h b/decompiler/analysis/final_output.h index a414ed29b5..fab7afb239 100644 --- a/decompiler/analysis/final_output.h +++ b/decompiler/analysis/final_output.h @@ -14,7 +14,8 @@ std::string final_defun_out(const Function& func, std::string write_from_top_level(const Function& top_level, const DecompilerTypeSystem& dts, const LinkedObjectFile& file, - const std::unordered_set& skip_functions = {}); + const std::vector& imports, + const std::unordered_set& skip_functions); goos::Object get_arg_list_for_function(const Function& func, const Env& env); goos::Object final_output_lambda(const Function& function); diff --git a/decompiler/analysis/find_defstates.cpp b/decompiler/analysis/find_defstates.cpp index 0021e1b71e..063fa8104c 100644 --- a/decompiler/analysis/find_defstates.cpp +++ b/decompiler/analysis/find_defstates.cpp @@ -153,10 +153,16 @@ std::vector get_defstate_entries( } } // name = code/event/etc - if (skip_states.count(state_name) > 0) { - if (skip_states.at(state_name).find(name) != skip_states.at(state_name).end()) { + std::string name_to_check_for_skip = state_name; + if (skip_states.count(name_to_check_for_skip) == 0) { + name_to_check_for_skip = + fmt::format("({} {})", state_name, state_type.last_arg().base_type()); + } + if (skip_states.count(name_to_check_for_skip) > 0) { + if (skip_states.at(name_to_check_for_skip).find(name) != + skip_states.at(name_to_check_for_skip).end()) { env.func->warnings.general_warning("SKIP: skipping '{}' handler for state '{}'", name, - state_name); + name_to_check_for_skip); continue; } } diff --git a/decompiler/analysis/insert_lets.cpp b/decompiler/analysis/insert_lets.cpp index 0f6d583966..e3ae2ac3c4 100644 --- a/decompiler/analysis/insert_lets.cpp +++ b/decompiler/analysis/insert_lets.cpp @@ -1,8 +1,12 @@ #include #include #include +#include +#include "common/util/Assert.h" +#include "common/util/print_float.h" #include "decompiler/IR2/GenericElementMatcher.h" +#include "decompiler/IR2/bitfields.h" #include "decompiler/util/DecompilerTypeSystem.h" #include "insert_lets.h" @@ -36,6 +40,8 @@ If the previous let variables appear in the definition of new one, make the let */ namespace { +FormElement* rewrite_let(LetElement* in, const Env& env, FormPool& pool, LetRewriteStats& stats); + std::vector path_up_tree(Form* in, const Env&) { std::vector path; @@ -121,10 +127,9 @@ FormElement* rewrite_as_dotimes(LetElement* in, const Env& env, FormPool& pool) // still have to check body for the increment and have to check that the lt operates on the right // thing. - Matcher while_matcher = - Matcher::while_loop(Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::LT), - {Matcher::any_reg(0), Matcher::any(1)}), - Matcher::any(2)); + Matcher while_matcher = Matcher::while_loop( + Matcher::op_fixed(FixedOperatorKind::LT, {Matcher::any_reg(0), Matcher::any(1)}), + Matcher::any(2)); auto mr = match(while_matcher, in->body()); if (!mr.matched) { @@ -142,14 +147,10 @@ FormElement* rewrite_as_dotimes(LetElement* in, const Env& env, FormPool& pool) auto body = mr.maps.forms.at(2); auto last_in_body = body->elts().back(); - // kind hacky - Form fake_form; - fake_form.elts().push_back(last_in_body); - Matcher increment_matcher = - Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::ADDITION_IN_PLACE), - {Matcher::any_reg(0), Matcher::integer(1)}); + Matcher increment_matcher = Matcher::op_fixed(FixedOperatorKind::ADDITION_IN_PLACE, + {Matcher::any_reg(0), Matcher::integer(1)}); - auto int_mr = match(increment_matcher, &fake_form); + auto int_mr = match(increment_matcher, last_in_body); if (!int_mr.matched) { return nullptr; } @@ -170,13 +171,151 @@ FormElement* rewrite_as_dotimes(LetElement* in, const Env& env, FormPool& pool) mr.maps.forms.at(1), body); } -FormElement* rewrite_as_send_event(LetElement* in, const Env& env, FormPool& pool) { +std::tuple rewrite_shelled_return_form( + const Matcher& matcher, + FormElement* in, + const Env& env, + FormPool& pool, + std::function func, + const TypeSpec* const strip_cast) { + auto mr = match(matcher, in); + + // TODO check forbidden form + if (!mr.matched) { + auto as_set = dynamic_cast(in); + if (as_set) { + auto sub_res = rewrite_shelled_return_form(matcher, as_set->src()->try_as_single_element(), + env, pool, func, strip_cast); + + if (std::get<0>(sub_res).matched) { + if (std::get<2>(sub_res) && strip_cast) { + // strip lowest-level (pointer ) cast. + if (as_set->cast_for_set() && env.dts->ts.tc(*as_set->cast_for_set(), *strip_cast)) { + as_set->set_cast_for_set({}); + } + if (as_set->cast_for_define() && + env.dts->ts.tc(*as_set->cast_for_define(), *strip_cast)) { + as_set->set_cast_for_define({}); + } + } + return {std::get<0>(sub_res), + pool.form(as_set->dst(), std::get<1>(sub_res), + as_set->cast_for_set(), as_set->cast_for_define()), + false}; + } + } + + auto as_cast = dynamic_cast(in); + if (as_cast) { + auto sub_res = rewrite_shelled_return_form( + matcher, as_cast->source()->try_as_single_element(), env, pool, func, strip_cast); + + if (std::get<0>(sub_res).matched) { + if (std::get<2>(sub_res) && strip_cast && env.dts->ts.tc(as_cast->type(), *strip_cast)) { + // strip lowest-level (pointer ) cast instead. + return {std::get<0>(sub_res), std::get<1>(sub_res), false}; + } + return {std::get<0>(sub_res), + pool.form(as_cast->type(), std::get<1>(sub_res), as_cast->numeric()), + false}; + } + } + + auto as_gen = dynamic_cast(in); + if (as_gen) { + int i = 0; + int m = as_gen->elts().size(); + for (; i < m; ++i) { + auto sub_res = rewrite_shelled_return_form( + matcher, as_gen->elts().at(i)->try_as_single_element(), env, pool, func, strip_cast); + + if (std::get<0>(sub_res).matched) { + std::vector shell_args; + for (int ii = 0; ii < m; ++ii) { + if (ii == i) { + shell_args.push_back(std::get<1>(sub_res)); + } else { + shell_args.push_back(as_gen->elts().at(ii)); + } + } + + return {std::get<0>(sub_res), pool.form(as_gen->op(), shell_args), false}; + } + } + } + + auto as_cond_ne = dynamic_cast(in); + if (as_cond_ne) { + auto sub_res = rewrite_shelled_return_form( + matcher, as_cond_ne->entries.at(0).condition->try_as_single_element(), env, pool, func, + strip_cast); + + if (std::get<0>(sub_res).matched) { + as_cond_ne->entries.at(0).condition = std::get<1>(sub_res); + return {std::get<0>(sub_res), pool.form(as_cond_ne->entries), false}; + } + } + + auto as_cond_e = dynamic_cast(in); + if (as_cond_e) { + auto sub_res = rewrite_shelled_return_form( + matcher, as_cond_e->entries.at(0).condition->try_as_single_element(), env, pool, func, + strip_cast); + + if (std::get<0>(sub_res).matched) { + as_cond_e->entries.at(0).condition = std::get<1>(sub_res); + return {std::get<0>(sub_res), + pool.form(as_cond_e->entries, as_cond_e->else_ir), false}; + } + } + + auto as_while = dynamic_cast(in); + if (as_while) { + auto sub_res = rewrite_shelled_return_form( + matcher, as_while->condition->try_as_single_element(), env, pool, func, strip_cast); + + if (std::get<0>(sub_res).matched) { + return {std::get<0>(sub_res), pool.form(std::get<1>(sub_res), as_while->body), + false}; + } + } + + auto as_counter = dynamic_cast(in); + if (as_counter) { + auto sub_res = + rewrite_shelled_return_form(matcher, as_counter->counter_value()->try_as_single_element(), + env, pool, func, strip_cast); + + if (std::get<0>(sub_res).matched) { + return {std::get<0>(sub_res), + pool.form(as_counter->kind(), as_counter->var_init(), + as_counter->var_check(), as_counter->var_inc(), + std::get<1>(sub_res), as_counter->body()), + false}; + } + } + + return {mr, nullptr, false}; + } + + auto new_f = func(in, mr, env, pool); + if (!new_f) { + mr.matched = false; + } + return {mr, new_f, true}; +} + +FormElement* rewrite_as_send_event(LetElement* in, + const Env& env, + FormPool& pool, + LetRewriteStats& stats) { if (in->entries().size() != 1) { return nullptr; } // (let ((block-var (new 'stack-no-clear 'event-message-block)) auto block_var = in->entries().at(0).dest; + const auto& block_var_reg = block_var.reg(); auto block_var_name = env.get_variable_name(block_var); auto block_src = in->entries().at(0).src->try_as_element(); if (!block_src) { @@ -200,44 +339,42 @@ FormElement* rewrite_as_send_event(LetElement* in, const Env& env, FormPool& poo //////////////////////////////////////////////////////// // (set! (-> block-var from) ) - Matcher set_from_matcher = - Matcher::set(Matcher::deref(Matcher::any_reg(0), false, {DerefTokenMatcher::string("from")}), - Matcher::any_reg(1)); - Form set_from_hack_body; - set_from_hack_body.elts().push_back(body->at(0)); - auto from_mr = match(set_from_matcher, &set_from_hack_body); + bool not_proc = false; + Matcher set_from_matcher = Matcher::set( + Matcher::deref(Matcher::reg(block_var_reg), false, {DerefTokenMatcher::string("from")}), + Matcher::any_reg(1)); + auto from_mr = match(set_from_matcher, body->at(0)); if (!from_mr.matched) { - // fmt::print(" fail: from1\n"); - return nullptr; + // initial matcher failed. try more advanced "from" matcher now. + Matcher set_from_form_matcher = Matcher::set( + Matcher::deref(Matcher::any_reg(0), false, {DerefTokenMatcher::string("from")}), + Matcher::any(1)); + from_mr = match(set_from_form_matcher, body->at(0)); + if (!from_mr.matched) { + return nullptr; + } + not_proc = true; } - if (env.get_variable_name(*from_mr.maps.regs.at(0)) != block_var_name) { - // fmt::print(" fail: from2\n"); - return nullptr; - } - - auto from_var = *from_mr.maps.regs.at(1); - if (from_var.reg() != Register(Reg::GPR, Reg::S6)) { - // fmt::print(" fail: from3\n"); - return nullptr; + // if we couldnt match with simple reg matching that means it's a more complex form. + if (!not_proc) { + auto from_var = *from_mr.maps.regs.at(1); + if (from_var.reg() != Register(Reg::GPR, Reg::S6)) { + // it's OK to not be the s6 register, just means we have to manually specify it later. + not_proc = true; + } } //////////////////////////////////////////////////////// // (set! (-> a1-14 num-params) param-count) where param-count is a constant integer Matcher set_num_params_matcher = Matcher::set( - Matcher::deref(Matcher::any_reg(0), false, {DerefTokenMatcher::string("num-params")}), + Matcher::deref(Matcher::reg(block_var_reg), false, {DerefTokenMatcher::string("num-params")}), Matcher::any_integer(1)); - Form set_num_params_hack_body; - set_num_params_hack_body.elts().push_back(body->at(1)); - auto num_params_mr = match(set_num_params_matcher, &set_num_params_hack_body); + auto num_params_mr = match(set_num_params_matcher, body->at(1)); if (!num_params_mr.matched) { // fmt::print(" fail: pc1\n"); return nullptr; } - if (env.get_variable_name(*num_params_mr.maps.regs.at(0)) != block_var_name) { - // fmt::print(" fail: pc2\n"); - return nullptr; - } int param_count = num_params_mr.maps.ints.at(1); ASSERT(param_count >= 0 && param_count < 7); if (body->size() != 4 + param_count) { @@ -248,41 +385,37 @@ FormElement* rewrite_as_send_event(LetElement* in, const Env& env, FormPool& poo //////////////////////////////////////////////////////// // (set! (-> a1-14 message) the-message-name) Matcher set_message_matcher = Matcher::set( - Matcher::deref(Matcher::any_reg(0), false, {DerefTokenMatcher::string("message")}), + Matcher::deref(Matcher::reg(block_var_reg), false, {DerefTokenMatcher::string("message")}), Matcher::any(1)); - Form set_message_hack_body; - set_message_hack_body.elts().push_back(body->at(2)); - auto set_message_mr = match(set_message_matcher, &set_message_hack_body); + auto set_message_mr = match(set_message_matcher, body->at(2)); if (!set_message_mr.matched) { // fmt::print(" fail: msg1\n"); return nullptr; } - if (env.get_variable_name(*set_message_mr.maps.regs.at(0)) != block_var_name) { - // fmt::print(" fail: msg2\n"); - return nullptr; - } Form* message_name = set_message_mr.maps.forms.at(1); //////////////////////////////////////////////////////// // (set! (-> a1-14 param X) the-param-value) std::vector param_values; for (int param_idx = 0; param_idx < param_count; param_idx++) { + auto as_let = dynamic_cast(body->at(3 + param_idx)); + if (as_let) { + auto rewritten = rewrite_let(as_let, env, pool, stats); + if (rewritten) { + body->at(3 + param_idx) = rewritten; + rewritten->parent_form = body; + } + } auto set_form = body->at(3 + param_idx); Matcher set_param_matcher = Matcher::set( - Matcher::deref(Matcher::any_reg(0), false, + Matcher::deref(Matcher::reg(block_var_reg), false, {DerefTokenMatcher::string("param"), DerefTokenMatcher::integer(param_idx)}), Matcher::any(1)); - Form set_param_hack_body; - set_param_hack_body.elts().push_back(set_form); - auto set_param_mr = match(set_param_matcher, &set_param_hack_body); + auto set_param_mr = match(set_param_matcher, set_form); if (!set_param_mr.matched) { // fmt::print(" fail: pv {} 1: {}\n", param_idx, set_form->to_string(env)); return nullptr; } - if (env.get_variable_name(*set_param_mr.maps.regs.at(0)) != block_var_name) { - // fmt::print(" fail: pv {} 2\n", param_idx); - return nullptr; - } auto param_val = set_param_mr.maps.forms.at(1); auto param_val_cast = param_val->try_as_element(); @@ -290,38 +423,73 @@ FormElement* rewrite_as_send_event(LetElement* in, const Env& env, FormPool& poo if (param_val_cast && param_val_cast->type() == TypeSpec("uint")) { param_val = param_val_cast->source(); } + + // fancy casting if necessary + if (param_val->to_form(env).is_int()) { + auto msg_str = message_name->to_string(env); + auto val = param_val->to_form(env).as_int(); + if (val && + ((param_idx == 1 && (msg_str == "'change-state" || msg_str == "'change-state-no-go" || + msg_str == "'art-joint-anim")) || + (param_idx == 0 && (msg_str == "'no-look-around" || msg_str == "'no-load-wait" || + msg_str == "'force-blend")))) { + param_val = pool.form( + GenericOperator::make_function(pool.form("seconds")), + pool.form(seconds_to_string(param_val->to_form(env).as_int()))); + } else if (param_idx == 1) { + auto parm0_str = param_values.at(0)->to_string(env); + if (parm0_str == "'powerup" || parm0_str == "'pickup") { + auto enum_ts = env.dts->ts.try_enum_lookup("pickup-type"); + if (enum_ts) { + param_val = cast_to_int_enum(enum_ts, pool, env, param_val->to_form(env).as_int()); + } + } + } + } + param_values.push_back(param_val); } //////////////////////////////////////////////////////// // (send-event-function ) Matcher call_matcher = Matcher::op(GenericOpMatcher::func(Matcher::symbol("send-event-function")), - {Matcher::any(0), Matcher::any_reg(1)}); - Form call_hack_body; - call_hack_body.elts().push_back(body->at(3 + param_count)); - auto call_mr = match(call_matcher, &call_hack_body); - if (!call_mr.matched) { - // fmt::print(" fail: call1: {}\n", body->at(3 + param_count)->to_string(env)); + {Matcher::any(0), Matcher::reg(block_var_reg)}); + auto mr_with_shell = rewrite_shelled_return_form( + call_matcher, body->at(3 + param_count), env, pool, + [&](FormElement* /*s_in*/, const MatchResult& mr, const Env& /*env*/, FormPool& pool) { + Form* send_destination = mr.maps.forms.at(0); + + // time to build the macro! + std::vector macro_args = {send_destination, message_name}; + if (not_proc) { + // something was going on with from. build :from key. + macro_args.push_back(pool.form(":from")); + // fill in the value for it + if (from_mr.maps.forms.find(1) != from_mr.maps.forms.end()) { + // matched some form. we can just copy it. + macro_args.push_back(from_mr.maps.forms.at(1)); + } else { + // matched reg but it wasnt s6 + macro_args.push_back(alloc_var_form(*from_mr.maps.regs.at(1), pool)); + } + } + for (int i = 0; i < param_count; i++) { + macro_args.push_back(param_values.at(i)); + } + + auto oper = GenericOperator::make_fixed(FixedOperatorKind::SEND_EVENT); + return pool.form(oper, macro_args); + }, + nullptr); + + if (!std::get<0>(mr_with_shell).matched) { + // lg::error("shell match failed, dont know this form: {}", + // body->at(3 + param_count)->to_string(env)); return nullptr; } - if (env.get_variable_name(*call_mr.maps.regs.at(1)) != block_var_name) { - // fmt::print(" fail: call2\n"); - return nullptr; - } - - Form* send_destination = call_mr.maps.forms.at(0); - - // time to build the macro! - std::vector macro_args = {send_destination, message_name}; - for (int i = 0; i < param_count; i++) { - macro_args.push_back(param_values.at(i)); - } - - auto oper = GenericOperator::make_fixed(FixedOperatorKind::SEND_EVENT); - return pool.alloc_element(oper, macro_args); - - return nullptr; + auto elt = std::get<1>(mr_with_shell)->try_as_single_element(); + return elt; } FormElement* rewrite_as_countdown(LetElement* in, const Env& env, FormPool& pool) { @@ -369,14 +537,10 @@ FormElement* rewrite_as_countdown(LetElement* in, const Env& env, FormPool& pool auto body = mr.maps.forms.at(2); auto first_in_body = body->elts().front(); - // kind hacky - Form fake_form; - fake_form.elts().push_back(first_in_body); - Matcher increment_matcher = - Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::ADDITION_IN_PLACE), - {Matcher::any_reg(0), Matcher::integer(-1)}); + Matcher increment_matcher = Matcher::op_fixed(FixedOperatorKind::ADDITION_IN_PLACE, + {Matcher::any_reg(0), Matcher::integer(-1)}); - auto int_mr = match(increment_matcher, &fake_form); + auto int_mr = match(increment_matcher, first_in_body); if (!int_mr.matched) { return nullptr; } @@ -415,8 +579,7 @@ FormElement* fix_up_abs(LetElement* in, const Env& env, FormPool& pool) { Form* src = in->entries().at(0).src; - auto body_matcher = - Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::ABS), {Matcher::any_reg(0)}); + auto body_matcher = Matcher::op_fixed(FixedOperatorKind::ABS, {Matcher::any_reg(0)}); auto mr = match(body_matcher, in->body()); if (!mr.matched) { return nullptr; @@ -469,8 +632,7 @@ FormElement* fix_up_abs_2(LetElement* in, const Env& env, FormPool& pool) { return nullptr; } - auto matcher = - Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::ABS), {Matcher::any_reg(0)}); + auto matcher = Matcher::op_fixed(FixedOperatorKind::ABS, {Matcher::any_reg(0)}); auto mr = match(matcher, first_as_set->src()); if (!mr.matched) { @@ -641,8 +803,8 @@ FormElement* rewrite_as_case_no_else(LetElement* in, const Env& env, FormPool& p for (auto& e : cond->entries) { // first, lets see if its just (= case_var ) - auto single_matcher = Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::EQ), - {Matcher::any_reg(0), Matcher::any(1)}); + auto single_matcher = + Matcher::op_fixed(FixedOperatorKind::EQ, {Matcher::any_reg(0), Matcher::any(1)}); auto single_matcher_result = match(single_matcher, e.condition); @@ -716,8 +878,8 @@ FormElement* rewrite_as_case_with_else(LetElement* in, const Env& env, FormPool& for (auto& e : cond->entries) { // first, lets see if its just (= case_var ) - auto single_matcher = Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::EQ), - {Matcher::any_reg(0), Matcher::any(1)}); + auto single_matcher = + Matcher::op_fixed(FixedOperatorKind::EQ, {Matcher::any_reg(0), Matcher::any(1)}); auto single_matcher_result = match(single_matcher, e.condition); @@ -769,64 +931,827 @@ FormElement* rewrite_as_case_with_else(LetElement* in, const Env& env, FormPool& return nullptr; } +bool var_name_equal(const Env& env, const std::string& a, std::optional b) { + ASSERT(b); + return env.get_variable_name(*b) == a; +} + +Form* match_ja_set(const Env& env, + const std::string& ch_var_name, + const std::string& field_name, + int arr_idx, + Form* in, + int* idx, + bool* bad) { + ASSERT(idx); + ASSERT(bad); + if (*idx >= in->size()) { + // *bad = true; + return nullptr; + } + + auto deref_matcher = + arr_idx == -1 + ? Matcher::deref(Matcher::any_reg(0), false, {DerefTokenMatcher::string(field_name)}) + : Matcher::deref( + Matcher::any_reg(0), false, + {DerefTokenMatcher::string(field_name), DerefTokenMatcher::integer(arr_idx)}); + auto mr = match(Matcher::set(deref_matcher, Matcher::any(1)), in->at(*idx)); + if (!mr.matched) { + // TODO what if didn't match but it was some weird thing?? i guess later size checks fix that. + return nullptr; + } + + if (!var_name_equal(env, ch_var_name, mr.maps.regs.at(0))) { + lg::error("[{}] JA MACRO ERROR channel var not {} in set {} {}", env.func->name(), ch_var_name, + field_name, arr_idx); + *bad = true; + return nullptr; + } + + *idx += 1; + return mr.maps.forms.at(1); +} + +void ja_push_form_to_args(FormPool& pool, + std::vector& args, + Form* form, + const std::string& key_name) { + if (form) { + args.push_back(pool.form(fmt::format(":{}", key_name))); + args.push_back(form); + } +} + +Form* strip_cast(const std::string& type, Form* in) { + auto casted = dynamic_cast(in->try_as_single_element()); + if (casted && casted->type() == TypeSpec(type)) { + in = casted->source(); + } + return in; +} + +FormElement* rewrite_joint_macro(LetElement* in, const Env& env, FormPool& pool) { + // this function checks for the behemoth (ja) macro. + + // TODO this should honestly just use its own custom element instead of GenericElement + // since it would make analyzing after rewriting it MUCH easier, but I am kind of lazy right now + + const static std::unordered_map num_func_remap = { + {"num-func-identity", "identity"}, {"num-func-+!", "+!"}, {"num-func--!", "-!"}, + {"num-func-loop!", "loop!"}, {"num-func-seek!", "seek!"}, {"num-func-chan", "chan"}, + {"num-func-blend-in!", "blend-in!"}, {"num-func-none", "none"}}; + + // should have this anyway, but double check so we don't throw this away. + if (in->entries().size() != 1) { + return nullptr; + } + + // look for setting a var to (-> self skel root-channel ,channel). + // yes, channel is actually not always just 0! + auto ra = in->entries().at(0).dest; + auto var = env.get_variable_name(ra); + auto mr_chan = match( + Matcher::deref(Matcher::s6(), false, + {DerefTokenMatcher::string("skel"), DerefTokenMatcher::string("root-channel"), + DerefTokenMatcher::any_expr_or_int(0)}), + in->entries().at(0).src); + if (!mr_chan.matched) { + return nullptr; + } + auto channel_form = mr_chan.int_or_form_to_form(pool, 0); + + // now we checks for set!'s. the actual contents of the macro are not very complicated to match. + // there is just a LOT to match. and then to write! + bool bad = false; + int idx = 0; + auto set_fi = match_ja_set(env, var, "frame-interp", -1, in->body(), &idx, &bad); + auto set_dist = match_ja_set(env, var, "dist", -1, in->body(), &idx, &bad); + auto set_fg = match_ja_set(env, var, "frame-group", -1, in->body(), &idx, &bad); + auto set_p0 = match_ja_set(env, var, "param", 0, in->body(), &idx, &bad); + auto set_p1 = match_ja_set(env, var, "param", 1, in->body(), &idx, &bad); + auto set_nf = match_ja_set(env, var, "num-func", -1, in->body(), &idx, &bad); + auto set_fn = match_ja_set(env, var, "frame-num", -1, in->body(), &idx, &bad); + + // lastly, match the function call. + enum { NO_FUNC, EVAL, NO_EVAL } func_status = NO_FUNC; + Form* arg_group = nullptr; + std::string arg_num_func; + if (idx < in->body()->size()) { + auto mr_func = + match(Matcher::op(GenericOpMatcher::func(Matcher::any_symbol(3)), + {Matcher::any_reg(0), Matcher::any(1), Matcher::any_symbol(2)}), + in->body()->at(idx)); + if (mr_func.matched) { + // NOTE : it's actually fine for there to be no func. we just forgo setting the num! param. + if (!var_name_equal(env, var, mr_func.maps.regs.at(0))) { + return nullptr; + } + + arg_group = mr_func.maps.forms.at(1); + arg_num_func = mr_func.maps.strings.at(2); + const auto& func_name = mr_func.maps.strings.at(3); + if (func_name == "joint-control-channel-group!") { + func_status = NO_EVAL; + } else if (func_name == "joint-control-channel-group-eval!") { + func_status = EVAL; + } else { + // wtf happened? + lg::error("[{}] JA MACRO ERROR func name: {}", env.func->name(), func_name); + return nullptr; + } + + if (num_func_remap.find(arg_num_func) == num_func_remap.end()) { + lg::error("[{}] JA MACRO ERROR unknown num func: {}", env.func->name(), arg_num_func); + return nullptr; + } + + auto group_lisp = strip_cast("art-joint-anim", arg_group)->to_form(env); + if (group_lisp.is_symbol() && group_lisp.as_symbol()->name == "#f") { + arg_group = nullptr; + } + + idx++; + } + } + + // PSYCHE! there may actually be a second frame-num set. for some reason. sigh... + auto set_fn2 = match_ja_set(env, var, "frame-num", -1, in->body(), &idx, &bad); + + if (bad) { + // an error occurred + return nullptr; + } + + // check that we have nothing more + if (in->body()->size() > idx) { + lg::error("[{}] JA MACRO ERROR elts matched: {}/{}", env.func->name(), idx, in->body()->size()); + return nullptr; + } + + // now check the arguments. + if (set_fn && set_fn2) { + lg::error("[{}] JA MACRO ERROR both frame nums: {}", env.func->name(), + set_fn->to_form(env).print(), set_fn2->to_form(env).print()); + ASSERT(false); + return nullptr; + } + + if (func_status != NO_FUNC && set_fg && arg_group) { + ASSERT(set_fg->to_form(env) == arg_group->to_form(env)); + // lg::info("p0: {} p1: {} nf: {} fn: {}", !!set_p0, !!set_p1, !!set_nf, !!set_fn); + } + + auto form_fg = set_fg ? set_fg : arg_group; + auto matcher_max_num = Matcher::cast( + "float", + Matcher::op_fixed( + FixedOperatorKind::ADDITION, + {form_fg + ? Matcher::deref(Matcher::any(1), false, + {DerefTokenMatcher::string("data"), DerefTokenMatcher::integer(0), + DerefTokenMatcher::string("length")}) + : Matcher::deref( + Matcher::any_reg(0), false, + {DerefTokenMatcher::string("frame-group"), DerefTokenMatcher::string("data"), + DerefTokenMatcher::integer(0), DerefTokenMatcher::string("length")}), + Matcher::integer(-1)})); + + // DONE CHECKING EVERYTHING!!! Now write the goddamn macro. + std::vector args; + + // check the channel arg + auto channel_arg = channel_form->to_form(env); + if (!channel_arg.is_int(0)) { + ja_push_form_to_args(pool, args, channel_form, "chan"); + } + + if (func_status != NO_FUNC) { + // check the group! arg + if (form_fg) { + ja_push_form_to_args(pool, args, strip_cast("art-joint-anim", form_fg), "group!"); + } + + const std::string prelim_num = + num_func_remap.count(arg_num_func) == 0 ? "" : num_func_remap.at(arg_num_func); + Form* num_form = nullptr; + // check the num! arg + if (prelim_num == "identity") { + if (set_fn2) { + auto obj_fn2 = set_fn2->to_form(env); + if (obj_fn2.is_float(0.0)) { + num_form = pool.form("min"); + } else { + auto mr = match(matcher_max_num, set_fn2); + if (mr.matched && + ((form_fg && mr.maps.forms.at(1)->to_form(env) == form_fg->to_form(env)) || + (!form_fg && var_name_equal(env, var, mr.maps.regs.at(0))))) { + num_form = pool.form("max"); + } else { + num_form = pool.form( + GenericOperator::make_function(pool.form(prelim_num)), + set_fn2); + } + } + set_fn2 = nullptr; + } + } else if (prelim_num == "loop!" || prelim_num == "+!" || prelim_num == "-!") { + if (set_p0) { + auto obj_p0 = set_p0->to_form(env); + if (obj_p0.is_float(1.0)) { + num_form = pool.form( + GenericOperator::make_function(pool.form(prelim_num))); + } else { + auto mr = match(matcher_max_num, set_p0); + if (mr.matched && + ((form_fg && mr.maps.forms.at(1)->to_form(env) == form_fg->to_form(env)) || + (!form_fg && var_name_equal(env, var, mr.maps.regs.at(0))))) { + num_form = pool.form( + GenericOperator::make_function(pool.form(prelim_num)), + pool.form("max")); + } else { + num_form = pool.form( + GenericOperator::make_function(pool.form(prelim_num)), + set_p0); + } + } + set_p0 = nullptr; + } + } else if (prelim_num == "chan") { + if (set_p0) { + auto obj_p0 = set_p0->to_form(env); + if (obj_p0.is_float((goos::FloatType)((goos::IntType)obj_p0.as_float()))) { + num_form = pool.form( + GenericOperator::make_function(pool.form("chan")), + pool.form( + SimpleAtom::make_int_constant((goos::IntType)obj_p0.as_float()))); + } else { + lg::error("[{}] JA MACRO ERROR bad chan arg: {}", env.func->name(), obj_p0.print()); + ASSERT_MSG(false, "chan case"); + } + set_p0 = nullptr; + } + } else if (prelim_num == "seek!") { + ASSERT(set_p0 && set_p1); + std::vector seek_args; + + // (the float (1- (-> (the art-joint-anim ,group!) data 0 length))) + // (the float (1- (-> ja-ch frame-group data 0 length))) + auto mr = match(matcher_max_num, set_p0); + if (!mr.matched || (form_fg && mr.maps.forms.at(1)->to_form(env) != form_fg->to_form(env)) || + (!form_fg && !var_name_equal(env, var, mr.maps.regs.at(0)))) { + // did not match default + seek_args.push_back(set_p0); + } + + auto obj_p1 = set_p1->to_form(env); + if (!obj_p1.is_float(1.0)) { + // did not match default + if (seek_args.size() < 1) { + seek_args.push_back(mr.matched ? pool.form("max") : set_p0); + } + seek_args.push_back(set_p1); + } + + // do not print :param0 and :param1 keys + set_p0 = nullptr; + set_p1 = nullptr; + + num_form = pool.form( + GenericOperator::make_function(pool.form("seek!")), seek_args); + } + + if (!num_form) { + num_form = pool.form(prelim_num); + } + + ja_push_form_to_args(pool, args, num_form, "num!"); + } else if (form_fg) { + ja_push_form_to_args(pool, args, strip_cast("art-joint-anim", form_fg), "group!"); + } + + if (set_fn) { + auto mr = match(matcher_max_num, set_fn); + if (mr.matched && ((form_fg && mr.maps.forms.at(1)->to_form(env) == form_fg->to_form(env)) || + (!form_fg && var_name_equal(env, var, mr.maps.regs.at(0))))) { + set_fn = pool.form("max"); + } + } + + // other generic args + ja_push_form_to_args(pool, args, set_fi, "frame-interp"); + ja_push_form_to_args(pool, args, set_dist, "dist"); + // ja_push_form_to_args(pool, args, form_fg, "frame-group"); + ja_push_form_to_args(pool, args, set_p0, "param0"); + ja_push_form_to_args(pool, args, set_p1, "param1"); + ja_push_form_to_args(pool, args, set_nf, "num-func"); + ja_push_form_to_args(pool, args, set_fn, "frame-num"); + + // TODO + if (set_fn2) { + lg::error("[{}] JA MACRO ERROR ignoring frame-num 2: {}", env.func->name(), + set_fn2->to_form(env).print()); + ASSERT(func_status != NO_FUNC && arg_num_func == "num-func-identity"); + return nullptr; + } + if (set_p0 || set_p1) { + lg::error("[{}] JA MACRO ERROR something still using params: {}", env.func->name(), + in->to_form(env).print()); + ASSERT(false); + return nullptr; + } + + return pool.alloc_element( + GenericOperator::make_function( + pool.form(func_status == NO_EVAL ? "ja-no-eval" : "ja")), + args); +} + +FormElement* rewrite_proc_new(LetElement* in, const Env& env, FormPool& pool) { + // this function checks for the process-spawn macros. + // it uses recursive form scanning to wrap the macro inside a potential "shell" + // which means this is probably slow and bad + + auto is_full_let = in->entries().size() == 1 && in->body()->size() == 1; + if (!(is_full_let || (in->entries().size() == 2))) { + return nullptr; + } + + auto test = in->to_form(env).print(); + + // look for setting a var to (get-process *default-dead-pool* logo-slave #x4000) + auto ra = in->entries().at(0).dest; + auto var = env.get_variable_name(ra); + auto mr_get_proc = match( + Matcher::func("get-process", {Matcher::any(0), Matcher::any_symbol(1), Matcher::any(2)}), + in->entries().at(0).src); + if (!mr_get_proc.matched) { + return nullptr; + } + + const auto& proc_type = mr_get_proc.maps.strings.at(1); + auto macro_form = + is_full_let ? in->body()->at(0) : in->entries().at(1).src->try_as_single_element(); + + auto cast_type = TypeSpec("pointer", {TypeSpec(proc_type)}); + auto mr_with_shell = rewrite_shelled_return_form( + Matcher::if_no_else( + Matcher::op(GenericOpMatcher::condition(IR2_Condition::Kind::TRUTHY), + {Matcher::reg(ra.reg())}), + Matcher::begin( + {Matcher::any(0), + Matcher::func_with_rest( + Matcher::match_or({Matcher::constant_token("run-now-in-process"), + Matcher::constant_token("run-next-time-in-process")}), + {Matcher::reg(ra.reg()), Matcher::any(1)}), + Matcher::any(2)})), + macro_form, env, pool, + [&](FormElement* s_in, const MatchResult& /*mr*/, const Env& env, FormPool& pool) { + auto as_when = dynamic_cast(s_in); + const auto& when_body = as_when->entries.front().body->elts(); + + // there's a let with an activate inside it that we want to check first + auto as_let = dynamic_cast(when_body.at(0)); + if (!as_let || as_let->entries().size() != 1 || as_let->body()->size() != 1) { + return (Form*)nullptr; + } + + auto as_func = dynamic_cast(when_body.at(1)); + if (!as_func) { + return (Form*)nullptr; + } + bool is_next_time = + as_func->op().func()->to_form(env).is_symbol("run-next-time-in-process"); + + auto has_unused_let = dynamic_cast(when_body.at(2)); + auto matcher_unused_let = + Matcher::deref(Matcher::reg(ra.reg()), false, {DerefTokenMatcher::string("ppointer")}); + if (has_unused_let) { + auto new_pptr = rewrite_empty_let(has_unused_let, env, pool); + if (!new_pptr || !match(matcher_unused_let, new_pptr).matched) { + return (Form*)nullptr; + } + } else if (!match(matcher_unused_let, when_body.at(2)).matched) { + return (Form*)nullptr; + } + + auto mr_activate_func = match( + Matcher::op_fixed(FixedOperatorKind::METHOD_OF_TYPE, + {Matcher::symbol(proc_type), Matcher::constant_token("activate")}), + as_let->entries().at(0).src); + + if (!mr_activate_func.matched) { + return (Form*)nullptr; + } + + auto activate_func_ra = as_let->entries().at(0).dest; + + auto mr_ac_call = + match(Matcher::func( + Matcher::reg(activate_func_ra.reg()), + {proc_type == "process" ? Matcher::reg(ra.reg()) + : Matcher::cast(proc_type, Matcher::reg(ra.reg())), + Matcher::any(0), Matcher::any(1), Matcher::any(2)}), + as_let->body()->at(0)); + + if (!mr_ac_call.matched) { + return (Form*)nullptr; + } + + // ok done checking that stuff, now make the macro! + // once again, I should just make a new element for it. but... so lazy... + + std::string head = is_next_time ? "process-spawn-function" : "process-spawn"; + std::vector args; + + // type and init func + if (is_next_time) { + args.push_back(pool.form(proc_type)); + args.push_back(as_func->elts().at(1)); + } else { + auto init_func = as_func->elts().at(1)->to_form(env); + if (init_func.is_symbol("manipy-init") && proc_type == "manipy") { + head = "manipy-spawn"; + } else { + args.push_back(pool.form(proc_type)); + if (!init_func.is_symbol(fmt::format("{}-init-by-other", proc_type))) { + ja_push_form_to_args(pool, args, as_func->elts().at(1), "init"); + } + } + } + + // args + // this would be a great place to do some hacky stuff! hmm, maybe i will... + for (size_t i = 2; i < as_func->elts().size(); ++i) { + args.push_back(as_func->elts().at(i)); + } + + if (mr_ac_call.maps.forms.at(1)->to_string(env) != fmt::format("'{}", proc_type)) { + ja_push_form_to_args(pool, args, mr_ac_call.maps.forms.at(1), "name"); + } + if (!mr_get_proc.maps.forms.at(0)->to_form(env).is_symbol("*default-dead-pool*")) { + args.push_back(pool.form(":from")); + args.push_back(mr_get_proc.maps.forms.at(0)); + } + if (!mr_ac_call.maps.forms.at(0)->to_form(env).is_symbol("*default-pool*")) { + args.push_back(pool.form(":to")); + args.push_back(mr_ac_call.maps.forms.at(0)); + } + auto stack_arg = mr_ac_call.maps.forms.at(2)->to_string(env); + if (stack_arg == "(&-> *dram-stack* 14336)") { + // special case! + ja_push_form_to_args(pool, args, pool.form("*kernel-dram-stack*"), + "stack"); + } else if (stack_arg != "(the-as pointer #x70004000)") { + ja_push_form_to_args(pool, args, mr_ac_call.maps.forms.at(2), "stack"); + } + if (!mr_get_proc.maps.forms.at(2)->to_form(env).is_int(0x4000)) { + ja_push_form_to_args(pool, args, mr_get_proc.maps.forms.at(2), "stack-size"); + } + + return pool.form( + GenericOperator::make_function(pool.form(head)), args); + }, + &cast_type); + + if (!std::get<0>(mr_with_shell).matched) { + // lg::error("shell match failed, dont know this form: {}", macro_form->to_string(env)); + return nullptr; + } + + if (!is_full_let) { + // we're actually just editing entries in a let here. + + // delete us. + in->entries().erase(in->entries().begin()); + // set the value of the new first entry to the macro + in->entries().at(0).src = std::get<1>(mr_with_shell); + in->entries().at(0).src->parent_element = in; + + // return us but modified? + return in; + } + + auto elt = std::get<1>(mr_with_shell)->try_as_single_element(); + ASSERT(elt); + return elt; +} + +FormElement* rewrite_attack_info(LetElement* in, const Env& env, FormPool& pool) { + // this function checks for the static-attack-info macro. + + if (in->entries().size() != 1) { + return nullptr; + } + + auto test = in->to_form(env).print(); + + // (let ((block-var (new 'static 'attack-info)) + auto block_src = in->entries().at(0).src->try_as_element(); + if (!block_src) { + return nullptr; + } + + auto e = block_src->label_info(); + if (e && (*e).result_type != TypeSpec("attack-info")) { + return nullptr; + } + + const auto& label = block_src->label(); + const auto& words = env.file->words_by_seg.at(label.target_segment); + u32 mask = words.at((label.offset + 64) / 4).data; + u32 mask_implicit = 0; + + auto block_var = in->entries().at(0).dest; + const auto& block_var_reg = block_var.reg(); + auto block_var_name = env.get_variable_name(block_var); + + const static std::map> possible_args = { + {"vector", {1, true}}, {"mode", {5, false}}, {"shove-back", {6, false}}, + {"shove-up", {7, false}}, {"control", {10, false}}, {"angle", {11, false}}}; + + std::vector> args_in_info; + for (int i = 0; i < in->body()->size() - 1; ++i) { + auto s_elt = dynamic_cast(in->body()->at(i)); + if (!s_elt) { + lg::error("attack info err elt {} not a set!: {}", i, in->body()->at(i)->to_string(env)); + return nullptr; + } + + auto d_elt = s_elt->dst()->try_as_element(); + if (!d_elt) { + lg::error("attack info err elt {} dst not a deref: {}", i, s_elt->dst()->to_string(env)); + return nullptr; + } + if (d_elt->tokens().size() != 1 && d_elt->tokens().size() != 2) { + lg::error("attack info err elt {} invalid token len: {}", i, d_elt->to_string(env)); + return nullptr; + } + if (d_elt->tokens().at(0).kind() != DerefToken::Kind::FIELD_NAME) { + lg::error("attack info err elt {} invalid token kind: {}", i, d_elt->to_string(env)); + return nullptr; + } + const auto& field_name = d_elt->tokens().at(0).field_name(); + auto arg_it = possible_args.find(field_name); + if (arg_it == possible_args.end()) { + lg::error("attack info unknown field {}", field_name); + return nullptr; + } + if (arg_it->second.second && + (d_elt->tokens().size() != 2 || d_elt->tokens().at(1).field_name() != "quad")) { + lg::error("attack info err elt {} invalid vector field: {}", i, d_elt->to_string(env)); + return nullptr; + } else if (!arg_it->second.second && d_elt->tokens().size() != 1) { + lg::error("attack info err elt {} invalid field: {}", i, d_elt->to_string(env)); + break; + } + + if (arg_it->second.second) { + auto d_src = s_elt->src()->try_as_element(); + if (d_src) { + if (d_src->tokens().size() == 1 && d_src->tokens().at(0).is_field_name("quad")) { + args_in_info.push_back({field_name, d_src->base()}); + } else { + d_src->tokens().pop_back(); + args_in_info.push_back({field_name, s_elt->src()}); + } + } + } else { + if ((field_name == "shove-back" || field_name == "shove-up") && + s_elt->src()->to_form(env).is_float()) { + args_in_info.push_back( + {field_name, pool.form(GenericOperator::make_function( + pool.form("meters")), + pool.form(meters_to_string( + s_elt->src()->to_form(env).as_float())))}); + } else { + args_in_info.push_back({field_name, s_elt->src()}); + } + } + mask_implicit |= 1 << arg_it->second.first; + } + + if ((mask & mask_implicit) != mask_implicit) { + lg::error("attack info bad mask: #x{:x} but needed #x{:x}", mask, mask_implicit); + ASSERT(false); + return nullptr; + } + mask ^= mask_implicit; + + // (static-attack-info :mask etc) + auto mr_with_shell = rewrite_shelled_return_form( + Matcher::reg(block_var_reg), in->body()->at(in->body()->size() - 1), env, pool, + [&](FormElement* /*s_in*/, const MatchResult& /*mr*/, const Env& env, FormPool& pool) { + // time to build the macro! + std::vector macro_args; + + if (mask) { + ja_push_form_to_args( + pool, macro_args, + decompiler::cast_to_bitfield_enum(env.dts->ts.try_enum_lookup("attack-mask"), pool, + env, mask, true), + "mask"); + } + + if (args_in_info.size() > 0) { + std::vector info_args; + for (auto& [name, val] : args_in_info) { + info_args.push_back(pool.form( + GenericOperator::make_function(pool.form(name)), val)); + } + auto head = GenericOperator::make_function(info_args.at(0)); + info_args.erase(info_args.begin()); + macro_args.push_back(pool.form(head, info_args)); + } + + return pool.form( + GenericOperator::make_function(pool.form("static-attack-info")), + macro_args); + }, + nullptr); + + if (!std::get<0>(mr_with_shell).matched) { + // lg::error("shell match failed, dont know this form: {}", + // in->body()->at(in->body()->size() - 1)->to_string(env)); + return nullptr; + } + + auto elt = std::get<1>(mr_with_shell)->try_as_single_element(); + ASSERT(elt); + return elt; +} + /*! * Attempt to rewrite a let as another form. If it cannot be rewritten, this will return nullptr. */ -FormElement* rewrite_let(LetElement* in, const Env& env, FormPool& pool) { +FormElement* rewrite_let(LetElement* in, const Env& env, FormPool& pool, LetRewriteStats& stats) { + auto as_unused = rewrite_empty_let(in, env, pool); + if (as_unused) { + stats.unused++; + return as_unused; + } + + auto as_joint_macro = rewrite_joint_macro(in, env, pool); + if (as_joint_macro) { + stats.ja++; + return as_joint_macro; + } + + auto as_set_vector = rewrite_set_vector(in, env, pool); + if (as_set_vector) { + stats.set_vector++; + return as_set_vector; + } + auto as_dotimes = rewrite_as_dotimes(in, env, pool); if (as_dotimes) { + stats.dotimes++; return as_dotimes; } + auto as_send_event = rewrite_as_send_event(in, env, pool, stats); + if (as_send_event) { + stats.send_event++; + return as_send_event; + } + auto as_countdown = rewrite_as_countdown(in, env, pool); if (as_countdown) { + stats.countdown++; return as_countdown; } - auto as_abs = fix_up_abs(in, env, pool); - if (as_abs) { - return as_abs; - } - - auto as_abs_2 = fix_up_abs_2(in, env, pool); - if (as_abs_2) { - return as_abs_2; - } - - auto as_unused = rewrite_empty_let(in, env, pool); - if (as_unused) { - return as_unused; - } - auto as_case_no_else = rewrite_as_case_no_else(in, env, pool); if (as_case_no_else) { + stats.case_no_else++; return as_case_no_else; } auto as_case_with_else = rewrite_as_case_with_else(in, env, pool); if (as_case_with_else) { + stats.case_with_else++; return as_case_with_else; } - auto as_set_vector = rewrite_set_vector(in, env, pool); - if (as_set_vector) { - return as_set_vector; - } - auto as_set_vector2 = rewrite_set_vector_2(in, env, pool); if (as_set_vector2) { + stats.set_vector2++; return as_set_vector2; } - auto as_send_event = rewrite_as_send_event(in, env, pool); - if (as_send_event) { - return as_send_event; + auto as_abs_2 = fix_up_abs_2(in, env, pool); + if (as_abs_2) { + stats.abs2++; + return as_abs_2; + } + + auto as_abs = fix_up_abs(in, env, pool); + if (as_abs) { + stats.abs++; + return as_abs; + } + + auto as_proc_new = rewrite_proc_new(in, env, pool); + if (as_proc_new) { + stats.proc_new++; + return as_proc_new; + } + + auto as_attack_info = rewrite_attack_info(in, env, pool); + if (as_attack_info) { + stats.attack_info++; + return as_attack_info; } // nothing matched. return nullptr; } +FormElement* rewrite_rand_float_gen(LetElement* in, const Env& env, FormPool& pool) { + // this function checks for the (rand-float-gen) macro + + bool ret_in_body = in->entries().size() == 2; + + if (ret_in_body && in->body()->size() != 1) { + return nullptr; + } + + auto test = in->to_string(env); + + auto mr_div = match( + Matcher::op_fixed(FixedOperatorKind::DIVISION, + {Matcher::cast("int", Matcher::func(Matcher::symbol("rand-uint31-gen"), + {Matcher::any(0)})), + Matcher::integer(256)}), + in->entries().at(0).src); + if (!mr_div.matched) { + return nullptr; + } + + const auto& reg1 = in->entries().at(0).dest.reg(); + auto gen = mr_div.maps.forms.at(0); + if (gen->to_form(env).is_symbol("*random-generator*")) { + gen = nullptr; + } + + auto mr_or = + match(Matcher::cast("number", + Matcher::op_fixed(FixedOperatorKind::LOGIOR, + {Matcher::integer(0x3f800000), Matcher::reg(reg1)})), + in->entries().at(1).src); + if (!mr_or.matched) { + return nullptr; + } + + const auto& reg2 = in->entries().at(1).dest.reg(); + + auto matcher_res = + Matcher::op_fixed(FixedOperatorKind::ADDITION, {Matcher::single(-1.f), Matcher::reg(reg2)}); + + if (!ret_in_body) { + // simpler case + + auto mr_res = match(matcher_res, in->entries().at(2).src); + + if (!mr_res.matched) { + return nullptr; + } + + // delete us. + in->entries().erase(in->entries().begin()); + in->entries().erase(in->entries().begin()); + + auto head = GenericOperator::make_function(pool.form("rand-float-gen")); + + // set the value of the new first entry to the macro + in->entries().at(0).src = + gen ? pool.form(head, gen) : pool.form(head); + + // return us but modified? + in->clear_let_star(); + return in; + } else { + auto mr_res = rewrite_shelled_return_form( + matcher_res, in->body()->at(0), env, pool, + [&](FormElement* /*s_in*/, const MatchResult& /*mr*/, const Env& /*env*/, FormPool& pool) { + auto head = + GenericOperator::make_function(pool.form("rand-float-gen")); + return gen ? pool.form(head, gen) : pool.form(head); + }, + nullptr); + + if (!std::get<0>(mr_res).matched) { + // lg::error("shell match failed, dont know this form: {}", + // in->body()->at(0)->to_string(env)); + return nullptr; + } + + auto elt = std::get<1>(mr_res)->try_as_single_element(); + elt->parent_form = in->parent_form; + return elt; + } +} + FormElement* rewrite_multi_let_as_vector_dot(LetElement* in, const Env& env, FormPool& pool) { if (in->body()->size() != 3) { return nullptr; @@ -915,10 +1840,28 @@ FormElement* rewrite_multi_let_as_vector_dot(LetElement* in, const Env& env, For return in; } -FormElement* rewrite_multi_let(LetElement* in, const Env& env, FormPool& pool) { +FormElement* rewrite_multi_let(LetElement* in, + const Env& env, + FormPool& pool, + LetRewriteStats& stats) { + if (in->entries().size() >= 2) { + auto as_rand_float_gen = rewrite_rand_float_gen(in, env, pool); + if (as_rand_float_gen) { + stats.rand_float_gen++; + return as_rand_float_gen; + } + + auto as_proc_new = rewrite_proc_new(in, env, pool); + if (as_proc_new) { + stats.proc_new++; + return as_proc_new; + } + } + if (in->entries().size() >= 6) { auto as_vector_dot = rewrite_multi_let_as_vector_dot(in, env, pool); if (as_vector_dot) { + stats.vector_dot++; return as_vector_dot; } } @@ -960,7 +1903,11 @@ bool register_can_hold_var(const Register& reg) { } } // namespace -LetStats insert_lets(const Function& func, Env& env, FormPool& pool, Form* top_level_form) { +LetStats insert_lets(const Function& func, + Env& env, + FormPool& pool, + Form* top_level_form, + LetRewriteStats& let_rewrite_stats) { (void)func; // if (func.name() != "(method 4 pair)") { // return {}; @@ -1212,7 +2159,7 @@ LetStats insert_lets(const Function& func, Env& env, FormPool& pool, Form* top_l for (auto& elt : f->elts()) { auto as_let = dynamic_cast(elt); if (as_let) { - auto rewritten = rewrite_let(as_let, env, pool); + auto rewritten = rewrite_let(as_let, env, pool, let_rewrite_stats); if (rewritten) { rewritten->parent_form = f; elt = rewritten; @@ -1238,6 +2185,17 @@ LetStats insert_lets(const Function& func, Env& env, FormPool& pool, Form* top_l continue; } + for (auto& e : inner_let->entries()) { + as_let->add_entry(e); + } + + as_let->set_body(inner_let->body()); + + // rewrite: + form->at(idx) = rewrite_multi_let(as_let, env, pool, let_rewrite_stats); + ASSERT(form->at(idx)->parent_form == form); + + // check star for (auto& e : inner_let->entries()) { if (!as_let->is_star()) { RegAccessSet used; @@ -1253,14 +2211,8 @@ LetStats insert_lets(const Function& func, Env& env, FormPool& pool, Form* top_l } } } - as_let->add_entry(e); } - as_let->set_body(inner_let->body()); - - // rewrite: - form->at(idx) = rewrite_multi_let(as_let, env, pool); - ASSERT(form->at(idx)->parent_form == form); changed = true; } }); diff --git a/decompiler/analysis/insert_lets.h b/decompiler/analysis/insert_lets.h index 226186fc75..da8e5b3d2e 100644 --- a/decompiler/analysis/insert_lets.h +++ b/decompiler/analysis/insert_lets.h @@ -3,6 +3,7 @@ #include "decompiler/Function/Function.h" #include "decompiler/IR2/Env.h" #include "decompiler/IR2/Form.h" +#include "decompiler/ObjectFile/ObjectFileDB.h" namespace decompiler { @@ -16,6 +17,10 @@ struct LetStats { } }; -LetStats insert_lets(const Function& func, Env& env, FormPool& pool, Form* top_level_form); +LetStats insert_lets(const Function& func, + Env& env, + FormPool& pool, + Form* top_level_form, + LetRewriteStats& let_stats); -} // namespace decompiler \ No newline at end of file +} // namespace decompiler diff --git a/decompiler/analysis/mips2c.cpp b/decompiler/analysis/mips2c.cpp index 5300630aa4..d2418a1d0a 100644 --- a/decompiler/analysis/mips2c.cpp +++ b/decompiler/analysis/mips2c.cpp @@ -591,12 +591,15 @@ Mips2C_Line handle_generic_op2_u16(const Instruction& i0, const std::string& ins instr_str}; } -Mips2C_Line handle_daddiu(Mips2C_Output& out, const Instruction& i0, const std::string& instr_str) { +Mips2C_Line handle_daddiu(Mips2C_Output& out, + const Instruction& i0, + const std::string& instr_str, + GameVersion version) { if (i0.get_src(1).is_label()) { return {instr_str, instr_str}; } else if (i0.get_src(0).is_reg(rs7()) && i0.get_src(1).is_sym("#t")) { return {fmt::format("c->{}({}, {}, {});", i0.op_name_to_string(), reg_to_name(i0.get_dst(0)), - reg_to_name(i0.get_src(0)), FIX_SYM_TRUE), + reg_to_name(i0.get_src(0)), true_symbol_offset(version)), instr_str}; } else if (i0.get_src(0).is_reg(rs7()) && i0.get_src(1).is_sym()) { out.require_symbol(i0.get_src(1).get_sym()); @@ -931,7 +934,8 @@ Mips2C_Line handle_normal_instr(Mips2C_Output& output, const Instruction& i0, const std::string& instr_str, int& unknown_count, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { switch (i0.kind) { case InstructionKind::CTC2: return handle_ctc2(i0, instr_str); @@ -1058,6 +1062,7 @@ Mips2C_Line handle_normal_instr(Mips2C_Output& output, case InstructionKind::DSLLV: case InstructionKind::PAND: case InstructionKind::PCEQB: + case InstructionKind::PPACW: return handle_generic_op3(i0, instr_str, {}); case InstructionKind::MULS: return handle_generic_op3(i0, instr_str, "muls"); @@ -1072,7 +1077,7 @@ Mips2C_Line handle_normal_instr(Mips2C_Output& output, case InstructionKind::AND: return handle_generic_op3(i0, instr_str, "and_"); // and isn't allowed in C++ case InstructionKind::DADDIU: - return handle_daddiu(output, i0, instr_str); + return handle_daddiu(output, i0, instr_str, version); case InstructionKind::ADDIU: return handle_generic_op2_u16(i0, instr_str); case InstructionKind::QMTC2: @@ -1171,7 +1176,9 @@ struct JumpTableBlock { bool branch_always = false; // that branch is always taken? }; -void run_mips2c_jump_table(Function* f, const std::vector& jump_table_locations) { +void run_mips2c_jump_table(Function* f, + const std::vector& jump_table_locations, + GameVersion version) { fmt::print("mips2c-jump on {}\n", f->name()); u32 magic_code = std::hash()(f->name()); std::unordered_map loc_to_block; @@ -1211,8 +1218,8 @@ void run_mips2c_jump_table(Function* f, const std::vector& jump_table_locat ASSERT(delay_block.end_instr - delay_block.start_instr == 1); // only 1 instr. auto& delay_instr = f->instructions.at(delay_block.start_instr); auto delay_instr_str = delay_instr.to_string(file->labels); - auto delay_instr_line = - handle_normal_instr(output, delay_instr, delay_instr_str, unknown_count, file); + auto delay_instr_line = handle_normal_instr(output, delay_instr, delay_instr_str, + unknown_count, file, version); output.lines.emplace_back(fmt::format(" {}", delay_instr_line.code), delay_instr_line.comment); ASSERT(delay_block.succ_ft == -1); @@ -1229,7 +1236,7 @@ void run_mips2c_jump_table(Function* f, const std::vector& jump_table_locat auto& delay_i = f->instructions.at(i); auto delay_i_str = delay_i.to_string(file->labels); output.lines.push_back( - handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file)); + handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file, version)); ASSERT(i + 1 == block.end_instr); // then the goto output.lines.emplace_back(fmt::format("next_block = {};", block.succ_branch), @@ -1245,7 +1252,7 @@ void run_mips2c_jump_table(Function* f, const std::vector& jump_table_locat auto& delay_i = f->instructions.at(i); auto delay_i_str = delay_i.to_string(file->labels); output.lines.push_back( - handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file)); + handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file, version)); ASSERT(i + 1 == block.end_instr); // then the goto output.lines.emplace_back( @@ -1263,7 +1270,7 @@ void run_mips2c_jump_table(Function* f, const std::vector& jump_table_locat auto& delay_i = f->instructions.at(i); auto delay_i_str = delay_i.to_string(file->labels); output.lines.push_back( - handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file)); + handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file, version)); // then the goto output.lines.emplace_back(fmt::format("goto end_of_function;", block.succ_branch), @@ -1278,7 +1285,7 @@ void run_mips2c_jump_table(Function* f, const std::vector& jump_table_locat auto& delay_i = f->instructions.at(i); auto delay_i_str = delay_i.to_string(file->labels); output.lines.push_back( - handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file)); + handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file, version)); output.lines.emplace_back("c->jalr(call_addr);", instr_str); } else if (instr.kind == InstructionKind::JR) { // special case for jr's to handle the jump tableing. @@ -1289,7 +1296,8 @@ void run_mips2c_jump_table(Function* f, const std::vector& jump_table_locat output.lines.emplace_back("break;"); } else { - output.lines.push_back(handle_normal_instr(output, instr, instr_str, unknown_count, file)); + output.lines.push_back( + handle_normal_instr(output, instr, instr_str, unknown_count, file, version)); } ASSERT(output.lines.size() > old_line_count); @@ -1311,7 +1319,7 @@ void run_mips2c_jump_table(Function* f, const std::vector& jump_table_locat } } -void run_mips2c(Function* f) { +void run_mips2c(Function* f, GameVersion version) { g_unknown = 0; auto* file = f->ir2.env.file; std::unordered_set likely_delay_blocks; @@ -1346,8 +1354,8 @@ void run_mips2c(Function* f) { ASSERT(delay_block.end_instr - delay_block.start_instr == 1); // only 1 instr. auto& delay_instr = f->instructions.at(delay_block.start_instr); auto delay_instr_str = delay_instr.to_string(file->labels); - auto delay_instr_line = - handle_normal_instr(output, delay_instr, delay_instr_str, unknown_count, file); + auto delay_instr_line = handle_normal_instr(output, delay_instr, delay_instr_str, + unknown_count, file, version); output.lines.emplace_back(fmt::format(" {}", delay_instr_line.code), delay_instr_line.comment); ASSERT(delay_block.succ_ft == -1); @@ -1363,7 +1371,7 @@ void run_mips2c(Function* f) { auto& delay_i = f->instructions.at(i); auto delay_i_str = delay_i.to_string(file->labels); output.lines.push_back( - handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file)); + handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file, version)); ASSERT(i + 1 == block.end_instr); // then the goto output.lines.emplace_back(fmt::format("goto block_{};", block.succ_branch), @@ -1381,7 +1389,7 @@ void run_mips2c(Function* f) { auto& delay_i = f->instructions.at(i); auto delay_i_str = delay_i.to_string(file->labels); output.lines.push_back( - handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file)); + handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file, version)); // ASSERT(i + 1 == block.end_instr); // then the goto output.lines.emplace_back(fmt::format("if (bc) {{goto block_{};}}", block.succ_branch), @@ -1397,7 +1405,7 @@ void run_mips2c(Function* f) { auto& delay_i = f->instructions.at(i); auto delay_i_str = delay_i.to_string(file->labels); output.lines.push_back( - handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file)); + handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file, version)); // then the goto output.lines.emplace_back(fmt::format("goto end_of_function;", block.succ_branch), @@ -1412,10 +1420,11 @@ void run_mips2c(Function* f) { auto& delay_i = f->instructions.at(i); auto delay_i_str = delay_i.to_string(file->labels); output.lines.push_back( - handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file)); + handle_normal_instr(output, delay_i, delay_i_str, unknown_count, file, version)); output.lines.emplace_back("c->jalr(call_addr);", instr_str); } else { - output.lines.push_back(handle_normal_instr(output, instr, instr_str, unknown_count, file)); + output.lines.push_back( + handle_normal_instr(output, instr, instr_str, unknown_count, file, version)); } ASSERT(output.lines.size() > old_line_count); diff --git a/decompiler/analysis/mips2c.h b/decompiler/analysis/mips2c.h index a13dfcbd6e..ee69b1b73d 100644 --- a/decompiler/analysis/mips2c.h +++ b/decompiler/analysis/mips2c.h @@ -2,9 +2,13 @@ #include +#include "common/versions.h" + namespace decompiler { class Function; -void run_mips2c(Function* f); -void run_mips2c_jump_table(Function* f, const std::vector& jump_table_locations); +void run_mips2c(Function* f, GameVersion version); +void run_mips2c_jump_table(Function* f, + const std::vector& jump_table_locations, + GameVersion version); } // namespace decompiler diff --git a/decompiler/analysis/type_analysis.cpp b/decompiler/analysis/type_analysis.cpp index f1b7a1be25..89d64c3821 100644 --- a/decompiler/analysis/type_analysis.cpp +++ b/decompiler/analysis/type_analysis.cpp @@ -49,8 +49,7 @@ void modify_input_types_for_casts( state->get(cast.reg) = type_from_cast; } } catch (std::exception& e) { - printf("failed to parse hint: %s\n", e.what()); - ASSERT(false); + ASSERT_MSG(false, fmt::format("failed to parse hint: {}", e.what())); } } } @@ -91,10 +90,9 @@ bool run_type_analysis_ir2(const TypeSpec& my_type, DecompilerTypeSystem& dts, F as_end->mark_function_as_no_return_value(); } - std::vector block_init_types, op_types; std::vector block_needs_update(func.basic_blocks.size(), true); - block_init_types.resize(func.basic_blocks.size()); - op_types.resize(func.ir2.atomic_ops->ops.size()); + std::vector block_init_types(func.basic_blocks.size()); + std::vector op_types(func.ir2.atomic_ops->ops.size()); auto& aop = func.ir2.atomic_ops; // STEP 1 - topological sort the blocks. This gives us an order where we: diff --git a/decompiler/config.cpp b/decompiler/config.cpp index 183b88dd38..05d20e7989 100644 --- a/decompiler/config.cpp +++ b/decompiler/config.cpp @@ -1,10 +1,13 @@ #include "config.h" -#include "third-party/json.hpp" -#include "third-party/fmt/core.h" + #include "common/util/FileUtil.h" #include "common/util/json_util.h" + #include "decompiler/util/config_parsers.h" +#include "third-party/fmt/core.h" +#include "third-party/json.hpp" + namespace decompiler { namespace { @@ -34,12 +37,15 @@ Config read_config_file(const std::string& path_to_config_file, cfg[key] = val; } - config.game_version = cfg.at("game_version").get(); + int version_int = cfg.at("game_version").get(); + ASSERT(version_int == 1 || version_int == 2); + config.game_version = (GameVersion)version_int; 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(); } + config.all_types_file = cfg.at("all_types_file").get(); auto inputs_json = read_json_file_from_config(cfg, "inputs_file"); config.dgo_names = inputs_json.at("dgo_names").get>(); @@ -54,21 +60,26 @@ Config read_config_file(const std::string& path_to_config_file, } config.disassemble_code = cfg.at("disassemble_code").get(); config.decompile_code = cfg.at("decompile_code").get(); - config.regenerate_all_types = cfg.at("regenerate_all_types").get(); config.write_hex_near_instructions = cfg.at("write_hex_near_instructions").get(); config.write_scripts = cfg.at("write_scripts").get(); config.disassemble_data = cfg.at("disassemble_data").get(); config.process_tpages = cfg.at("process_tpages").get(); config.process_game_text = cfg.at("process_game_text").get(); config.process_game_count = cfg.at("process_game_count").get(); + config.process_art_groups = cfg.at("process_art_groups").get(); config.hexdump_code = cfg.at("hexdump_code").get(); config.hexdump_data = cfg.at("hexdump_data").get(); + config.find_functions = cfg.at("find_functions").get(); config.dump_objs = cfg.at("dump_objs").get(); config.print_cfgs = cfg.at("print_cfgs").get(); config.generate_symbol_definition_map = cfg.at("generate_symbol_definition_map").get(); config.is_pal = cfg.at("is_pal").get(); config.rip_levels = cfg.at("levels_convert_to_obj").get(); - + config.extract_collision = cfg.at("extract_collision").get(); + config.generate_all_types = cfg.at("generate_all_types").get(); + if (cfg.contains("old_all_types_file")) { + config.old_all_types_file = cfg.at("old_all_types_file").get(); + } auto allowed = cfg.at("allowed_objects").get>(); for (const auto& x : allowed) { config.allowed_objects.insert(x); @@ -225,17 +236,26 @@ Config read_config_file(const std::string& path_to_config_file, config.levels_to_extract = inputs_json.at("levels_to_extract").get>(); config.levels_extract = cfg.at("levels_extract").get(); - // get new strings - if (!cfg.contains("new_strings_file")) { - return config; - } + auto art_info_json = read_json_file_from_config(cfg, "art_info_file"); + config.art_groups_by_file = + art_info_json.at("files").get>(); + config.art_groups_by_function = + art_info_json.at("functions").get>(); - auto new_strings_json = read_json_file_from_config(cfg, "new_strings_file"); - config.new_strings_same_across_langs = new_strings_json.at("same_across_languages") - .get>(); - config.new_strings_different_across_langs = - new_strings_json.at("different_across_languages") - .get>>(); + auto import_deps = read_json_file_from_config(cfg, "import_deps_file"); + config.import_deps_by_file = + import_deps.get>>(); + + config.write_patches = cfg.at("write_patches").get(); + config.apply_patches = cfg.at("apply_patches").get(); + const auto& object_patches = cfg.at("object_patches"); + for (auto& [obj, pch] : object_patches.items()) { + ObjectPatchInfo new_pch; + new_pch.crc = (u32)std::stoull(pch.at("crc32").get(), nullptr, 16); + new_pch.target_file = pch.at("in").get(); + new_pch.patch_file = pch.at("out").get(); + config.object_patches.insert({obj, new_pch}); + } return config; } diff --git a/decompiler/config.h b/decompiler/config.h index 40c62f6ed1..13f41bf39c 100644 --- a/decompiler/config.h +++ b/decompiler/config.h @@ -1,10 +1,14 @@ #pragma once -#include -#include -#include -#include #include +#include +#include +#include +#include + +#include "common/common_types.h" +#include "common/versions.h" + #include "decompiler/Disasm/Register.h" #include "decompiler/data/game_text.h" @@ -81,8 +85,14 @@ struct DecompileHacks { std::unordered_map>> missing_textures_by_level; }; +struct ObjectPatchInfo { + u32 crc; + std::string target_file; + std::string patch_file; +}; + struct Config { - int game_version = -1; + GameVersion game_version = GameVersion::Jak1; std::vector dgo_names; std::vector object_file_names; std::vector str_file_names; @@ -91,6 +101,7 @@ struct Config { std::vector streamed_audio_file_names; std::string obj_file_name_map_file; + std::string all_types_file; bool disassemble_code = false; bool decompile_code = false; @@ -99,9 +110,11 @@ struct Config { bool process_tpages = false; bool process_game_text = false; bool process_game_count = false; + bool process_art_groups = false; bool rip_levels = false; + bool extract_collision = false; + bool find_functions = false; - bool regenerate_all_types = false; bool write_hex_near_instructions = false; bool hexdump_code = false; bool hexdump_data = false; @@ -110,7 +123,14 @@ struct Config { bool generate_symbol_definition_map = false; + bool generate_all_types = false; + std::optional old_all_types_file; + bool is_pal = false; + + bool write_patches = false; + bool apply_patches = false; + std::string game_name; std::string expected_elf_name; GameTextVersion text_version = GameTextVersion::JAK1_V1; @@ -130,9 +150,7 @@ struct Config { std::unordered_map> label_types; std::unordered_map> stack_structure_hints_by_function; - - std::unordered_map new_strings_same_across_langs; - std::unordered_map> new_strings_different_across_langs; + std::unordered_map object_patches; std::unordered_map bad_format_strings; @@ -140,6 +158,11 @@ struct Config { bool levels_extract; DecompileHacks hacks; + + std::unordered_map art_groups_by_file; + std::unordered_map art_groups_by_function; + + std::unordered_map> import_deps_by_file; }; Config read_config_file(const std::string& path_to_config_file, diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index 0ccf426857..71da4324c8 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -478,88 +478,93 @@ :type int32 :bitfield #f - (bucket-0 0) ;; ? - (bucket-1 1) ;; ? - (bucket-2 2) ;; ? + ;; 0 + ;; 1 + ;; 2 (sky-draw 3) ;; actual sky and cloud framebuffer draws (ocean-mid-and-far 4) ;; actual ocean framebuffer draws for mid/transition/far - (tfrag-tex0 5) ;; tfrag texture upload, level 0 - (tfrag-0 6) ;; tfrag draw, level 0 - (tfrag-near-0 7) ;; tfrag near draw, level 0 - (tie-near-0 8) ;; tie near draw, level 0 - (tie-0 9) ;; tie draw, level 0 - (merc-tfrag-tex0 10) ;; merc, with tfrag textures, level 0 - (gmerc-tfrag-tex 11) ;; generic merc, with tfrag textures, level 0 + (tfrag-tex0 5) ;; tfrag texture upload, level 0 + (tfrag-0 6) ;; tfrag draw, level 0 + (tfrag-near-0 7) ;; tfrag near draw, level 0 + (tie-near-0 8) ;; tie near draw, level 0 + (tie-0 9) ;; tie draw, level 0 + (merc-tfrag-tex0 10) ;; merc, with tfrag textures, level 0 + (generic-tfrag-tex0 11) ;; generic merc, with tfrag textures, level 0 - (tfrag-tex1 12) ;; tfrag texture upload, level 1 - (tfrag-1 13) ;; tfrag draw, level 1 - (tfrag-near-1 14) ;; tfrag near draw, level 1 - (tie-near-1 15) ;; tie near draw, level 1 - (tie-1 16) ;; tie draw, level 1 - (merc-tfrag-tex1 17) ;; merc, with tfrag textures, level 1 - (gmerc-tfrag-tex1 18) ;; generic merc, with tfrag textures, level 1 - (shrub-tex0 19) - (shrub0 20) - - (shrub-tex1 25) - (shrub1 26) + (tfrag-tex1 12) ;; tfrag texture upload, level 1 + (tfrag-1 13) ;; tfrag draw, level 1 + (tfrag-near-1 14) ;; tfrag near draw, level 1 + (tie-near-1 15) ;; tie near draw, level 1 + (tie-1 16) ;; tie draw, level 1 + (merc-tfrag-tex1 17) ;; merc, with tfrag textures, level 1 + (generic-tfrag-tex1 18) ;; generic merc, with tfrag textures, level 1 - (generic-foreground 30) ;; ? - (alpha-tex0 31) - (tfrag-trans-0 32) ;; also sky blend + (shrub-tex0 19) + (shrub0 20) + ;; 21 (likely shrub near) + (shrub-billboard0 22) + (shrub-trans0 23) + (shrub-generic0 24) + + (shrub-tex1 25) + (shrub1 26) + ;; 27 (likely shrub near) + (shrub-billboard1 28) + (shrub-trans1 29) + (shrub-generic1 30) + + (alpha-tex0 31) + (tfrag-trans-0 32) ;; also sky blend (tfrag-trans-near-0 33) - (tfrag-dirt-0 34) - (tfrag-dirt-near-0 35) - (tfrag-ice-0 36) - (tfrag-ice-near-0 37) + (tfrag-dirt-0 34) + (tfrag-dirt-near-0 35) + (tfrag-ice-0 36) + (tfrag-ice-near-0 37) - (alpha-tex1 38) - (tfrag-trans-1 39) ;; also sky blend + (alpha-tex1 38) + (tfrag-trans-1 39) ;; also sky blend (tfrag-trans-near-1 40) - (tfrag-dirt-1 41) - (tfrag-dirt-near-1 42) - (tfrag-ice-1 43) - (tfrag-ice-near-1 44) + (tfrag-dirt-1 41) + (tfrag-dirt-near-1 42) + (tfrag-ice-1 43) + (tfrag-ice-near-1 44) - (bucket-45 45) - (bucket-46 46) + (merc-alpha-tex 45) + (generic-alpha-tex 46) (shadow 47) - (pris-tex0 48) - (bucket-49 49) - (bucket-50 50) - ;; merc0 49 - ;; generic0 50 - (pris-tex1 51) - (bucket-52 52) - (bucket-53 53) - (merc-eyes 54) ;; eye::update-eyes - ;; merc1 52 - ;; generic1 53 + (pris-tex0 48) + (merc-pris0 49) + (generic-pris0 50) + + (pris-tex1 51) + (merc-pris1 52) + (generic-pris1 53) + + (eyes 54) + + (merc-pris-common 55) + (generic-pris-common 56) - (bucket-55 55) - (bucket-56 56) (water-tex0 57) - (bucket-58 58) - (bucket-59 59) - ;; merc0 58 (+ default) - ;; generic0 59 (+ default) + (merc-water0 58) + (generic-water0 59) (water-tex1 60) - (bucket-61 61) - (bucket-62 62) - (bucket-63 63) ; ocean - ;; merc1 61 - ;; generic1 62 + (merc-water1 61) + (generic-water1 62) + + (ocean-near 63) ; ocean (depth-cue 64) - (pre-sprite-textures 65) ;; common + (common-page-tex 65) (sprite 66) - ;; debug spheres? 67 - (debug-draw0 67) - ;; debug text 68 - (debug-draw1 68) + (debug 67) + (debug-no-zbuf 68) + + ;; extra buckets for pc port + (subtitle 69) ) (define-extern sinteger type) @@ -703,24 +708,24 @@ :bitfield #t :type uint32 (display-marks 0) - (bit1 1) ;; TODO - nav-control::9 - (bit2 2) ;; TODO - nav-control::9 - (bit3 3) ;; TODO - nav-enemy::45 | nav-control::9 - (bit4 4) ;; TODO - nav-control::9 - (bit5 5) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 - (bit6 6) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 - (bit7 7) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 - (bit8 8) - (bit9 9) ;; TODO - nav-control::14 | 11 - (bit10 10) ;; TODO - nav-enemy::nav-enemy-patrol-post - (bit11 11) ;; TODO - nav-control::28 - (bit12 12) ;; TODO - rolling-lightning-mole::(enter nav-enemy-chase fleeing-nav-enemy) - (bit13 13) - (bit17 17) ;; TODO - nav-control::11 - (bit18 18) ;; TODO - nav-control::11 - (bit19 19) ;; TODO - nav-control::11 | 17 - (bit20 20) ;; TODO - nav-mesh::28 - (bit21 21) ;; TODO - nav-control::19 + (navcf1 1) ;; TODO - nav-control::9 + (navcf2 2) ;; TODO - nav-control::9 + (navcf3 3) ;; TODO - nav-enemy::45 | nav-control::9 + (navcf4 4) ;; TODO - nav-control::9 + (navcf5 5) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 + (navcf6 6) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 + (navcf7 7) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 + (navcf8 8) + (navcf9 9) ;; TODO - nav-control::14 | 11 + (navcf10 10) ;; TODO - nav-enemy::nav-enemy-patrol-post + (navcf11 11) ;; TODO - nav-control::28 + (navcf12 12) ;; TODO - rolling-lightning-mole::(enter nav-enemy-chase fleeing-nav-enemy) + (navcf13 13) + (navcf17 17) ;; TODO - nav-control::11 + (navcf18 18) ;; TODO - nav-control::11 + (navcf19 19) ;; TODO - nav-control::11 | 17 + (navcf20 20) ;; TODO - nav-mesh::28 + (navcf21 21) ;; TODO - nav-control::19 ) (defenum task-status @@ -992,6 +997,8 @@ (jungle-level-name #x222) (misty-level-name #x223) + (jungleb-level-name #x225) + (beach-seagull-get #x22e) (jungle-lurkerm-unblock #x22f) @@ -1036,13 +1043,16 @@ (misty-daxter-hit-lurkers-not-mines #x27f) (sidekick-speech-hint-crate-darkeco1 #x281) + (sidekick-speech-crate-steel-break1 #x283) (sidekick-speech-hint-crate-iron #x284) (sidekick-speech-hint-crate-steel #x285) + (beach-collectors-unblocked #x288) + (jungleb-eco-vents-opened #x289) (misty-stopped-lurkers-at-silo #x28a) (misty-stopped-balloon-lurkers #x28b) - (jungleb-eco-vents-opened #x289) + (sidekick-speech-crate-steel-break2 #x28e) (sidekick-speech-hint-crate-darkeco2 #x28f) @@ -1061,13 +1071,10 @@ (misty-teetertotter-bonk-dax-tutorial #x2a4) (sidekick-hint-misty-get-red-eco #x2a5) - (red-eco-tutorial #x2a6) - (daxter-blue-eco-plat-tutorial #x2a7) (fish? #x2a9) - (misty-bone-bridge-hint #x2aa) (beach-grottopole-increment #x2af) @@ -1300,6 +1307,144 @@ (inc #xf10) (europe #xf11) + + ;; extra IDs for pc port + (camera-options #x1000) + (normal #x1001) + (inverted #x1002) + (camera-controls-first-horz #x1003) + (camera-controls-first-vert #x1004) + (camera-controls-third-horz #x1005) + (camera-controls-third-vert #x1006) + (restore-defaults #x1007) + (misc-options #x100f) + (accessibility-options #x1010) + (money-starburst #x1011) + (ps2-options #x1020) + (ps2-load-speed #x1021) + (ps2-parts #x1022) + (music-fadeout #x1023) + (music-fadein #x1024) + (discord-rpc #x1030) + (display-mode #x1031) + (windowed #x1032) + (borderless #x1033) + (fullscreen #x1034) + (game-resolution #x1035) + (resolution-fmt #x1036) + (ps2-aspect-ratio #x1037) + (ps2-aspect-ratio-msg #x1038) + (aspect-ratio-ps2 #x1039) + (fit-to-screen #x103a) + (vsync #x103b) + (msaa #x1050) + (x-times-fmt #x1051) + (2-times #x1052) + (4-times #x1053) + (8-times #x1054) + (16-times #x1055) + (frame-rate #x1060) + (60fps #x1061) + (100fps #x1062) + (150fps #x1063) + (lod-bg #x1070) + (lod-fg #x1071) + (lod-highest #x1072) + (lod-high #x1073) + (lod-mid #x1074) + (lod-low #x1075) + (lod-lowest #x1076) + (lod-ps2 #x1077) + (subtitles #x1078) + (hinttitles #x1079) + (subtitles-language #x107a) + (subtitles-speaker #x107b) + (speaker-always #x107c) + (speaker-never #x107d) + (speaker-auto #x107e) + (hint-log #x107f) + (cheats #x1080) + (secrets #x1081) + (select-level #x1082) + (select-flava #x1083) + (finalboss-level-name #x1084) + (credits #x1085) + (locked #x1086) + (ogreboss #x1087) + (fishgame #x1088) + (danger-mus #x1089) + (flava-player-controls #x108a) + (cheat-eco-blue #x1090) + (cheat-eco-red #x1091) + (cheat-eco-green #x1092) + (cheat-eco-yellow #x1093) + (cheat-sidekick-alt #x1094) + (cheat-invinc #x1095) + (cheat-tunes #x1096) + (music-player #x10c0) + (scene-player #x10c1) + (play-credits #x10c2) + (scrapbook #x10c3) + (default #x10d0) + (flava-vi1-unused0 #x10d1) + (flava-sage #x10d2) + (flava-sage-hut #x10d3) + (flava-birdlady #x10d4) + (flava-farmer #x10d5) + (flava-assistant #x10d6) + (flava-mayor #x10d7) + (flava-sculptor #x10d8) + (flava-explorer #x10d9) + (flava-dock #x10da) + (flava-jun-temple-exit #x10db) + (flava-jun-lurkerm #x10dc) + (flava-jun-temple-top #x10dd) + (flava-jub-eggtop #x10de) + (flava-jub-plant-boss #x10df) + (flava-bea-sentinel #x10e0) + (flava-bea-cannon #x10e1) + (flava-bea-grotto #x10e2) + (flava-mis-battle #x10e3) + (flava-mis-boat #x10e4) + (flava-mis-unused0 #x10e5) + (flava-racer #x10e6) + (flava-flutflut #x10e7) + (flava-fic-unused0 #x10e8) + (flava-warrior #x10e9) + (flava-geologist #x10ea) + (flava-gambler #x10eb) + (flava-levitator #x10ec) + (flava-swa-game #x10ed) + (flava-swa-launcher #x10ee) + (flava-swa-battle #x10ef) + (flava-rol-gorge #x10f0) + (flava-ogr-middle #x10f1) + (flava-ogr-end #x10f2) + (flava-vi3-mai #x10f3) + (flava-vi3-sno #x10f4) + (flava-vi3-miners #x10f5) + (flava-mai-rob #x10f6) + (flava-mai-rob-top #x10f7) + (flava-mai-mai #x10f8) + (flava-mai-dar #x10f9) + (flava-sno-battle #x10fa) + (flava-sno-cave #x10fb) + (flava-sno-fort #x10fc) + (flava-sno-balls #x10fd) + (flava-lav-middle #x10fe) + (flava-lav-end #x10ff) + (flava-cit-yellowsage #x1100) + (flava-cit-redsage #x1101) + (flava-cit-bluesage #x1102) + (flava-cit-hub #x1103) + (flava-fin-middle #x1104) + (flava-fin-end #x1105) + (flava-credits-middle #x1106) + (flava-credits-end #x1107) + (scene-0 #x1200) + (scene-255 #x12ff) + (hint-0 #x1300) + (hint-511 #x14ff) ;; GAME-TEXT-ID ENUM ENDS ) @@ -1556,7 +1701,7 @@ (pid int32 :offset-assert 40) (main-thread cpu-thread :offset-assert 44) (top-thread thread :offset-assert 48) - (entity entity :offset-assert 52) ;; likely a res-lump + (entity entity-actor :offset-assert 52) (state state :offset-assert 56) (trans-hook function :offset-assert 60) (post-hook function :offset-assert 64) @@ -1583,7 +1728,7 @@ ;; - Functions -(define-extern entity-deactivate-handler (function process entity none)) +(define-extern entity-deactivate-handler (function process entity-actor none)) (define-extern process-disconnect (function process int)) (define-extern throw (function symbol object int)) (define-extern set-to-run-bootstrap (function none)) @@ -1598,7 +1743,7 @@ (define-extern process-by-name (function object process-tree process)) (define-extern inspect-process-heap (function process symbol)) ;; functions defined in C. TODO - this will end up being a duplicate of kernel-defs.gc? -(define-extern dgo-load (function string kheap int int none)) +(define-extern dgo-load (function string kheap link-flag int none)) (define-extern load-package (function string kheap pair)) (define-extern unload-package (function string pair)) (define-extern malloc (function symbol int pointer)) ;; from kernel-defs.gc @@ -2520,7 +2665,7 @@ (global-y-angle-to-point (_type_ vector) float 23) (relative-y-angle-to-point (_type_ vector) float 24) (roll-relative-to-gravity (_type_) float 25) - (TODO-RENAME-26 (_type_ int vector float) trsqv 26) + (set-and-limit-velocity (_type_ int vector float) trsqv 26) (get-quaternion (_type_) quaternion 27) ) ) @@ -2805,9 +2950,7 @@ (define-extern exp (function float float)) (define-extern sinerp-clamp (function float float float float)) (define-extern coserp-clamp (function float float float float)) -;; ;; unknown type (define-extern coserp180-clamp (function float float float float)) - ;; unknown type (define-extern ease-in-out (function int int float)) ;; - Symbols @@ -2829,10 +2972,23 @@ ;; - Types +(defenum sound-group + :bitfield #t + :type uint8 + (sfx) + (music) + (dialog) + (sog3) + (ambient) + (sog5) + (sog6) + (sog7) + ) + (deftype sound-id (uint32) () (:methods - (dummy-9 () none 9) + (unused-9 () none 9) ) :flag-assert #xa00000004 ) @@ -2849,6 +3005,20 @@ :flag-assert #x900000010 ) +(defenum sound-mask + :bitfield #t + :type uint16 + (volume) + (pitch) + (bend) + (unused) + (time) + (trans) + (fo-min) + (fo-max) + (fo-curve) + ) + (deftype sound-rpc-cmd (structure) ((rsvd1 uint16 :offset-assert 0) (command sound-command :offset-assert 2) @@ -2859,7 +3029,7 @@ ) (deftype sound-play-parms (structure) - ((mask uint16 :offset-assert 0) + ((mask sound-mask :offset-assert 0) (pitch-mod int16 :offset-assert 2) (bend int16 :offset-assert 4) (fo-min int16 :offset-assert 6) @@ -2868,7 +3038,7 @@ (priority int8 :offset-assert 11) (volume int32 :offset-assert 12) (trans vector3w :inline :offset-assert 16) - (group uint8 :offset-assert 28) + (group sound-group :offset-assert 28) ) :pack-me :method-count-assert 9 @@ -2893,7 +3063,7 @@ ) (deftype sound-rpc-group-cmd (sound-rpc-cmd) - ((group uint8 :offset-assert 4) + ((group sound-group :offset-assert 4) ) :method-count-assert 9 :size-assert #x5 @@ -3126,12 +3296,12 @@ ) (deftype sound-spec (basic) - ((mask uint16 :offset-assert 4) + ((mask sound-mask :offset-assert 4) (num float :offset-assert 8) - (group uint8 :offset-assert 12) - (sound-name sound-name :score 20 :offset 16) - (sound-name-char uint8 16 :offset 16) ;; moved to after sound-name - (trans float 4 :offset-assert 32) ;; guess + (group sound-group :offset-assert 12) + (sound-name-char uint8 16 :offset 16) + (sound-name sound-name :score 20 :offset 16) + (trans float 4 :offset-assert 32) ;; guess (volume int32 :offset-assert 48) (pitch-mod int32 :offset-assert 52) (bend int32 :offset-assert 56) @@ -3154,15 +3324,15 @@ (playing-id sound-id :offset-assert 8) (trans vector :inline :offset-assert 16) (name sound-name :offset-assert 32) - (play-time time-frame :offset-assert 48) - (time-base time-frame :offset-assert 56) - (time-random time-frame :offset-assert 64) + (play-time time-frame :offset-assert 48) + (time-base time-frame :offset-assert 56) + (time-random time-frame :offset-assert 64) (volume int32 :offset-assert 72) (pitch int32 :offset-assert 76) (falloff-near int32 :offset-assert 80) (falloff-far int32 :offset-assert 84) (falloff-mode int32 :offset-assert 88) - (params (pointer float) :offset-assert 92) + (params (pointer float) :offset-assert 92) (param-count int32 :offset-assert 96) (entity entity :offset-assert 100) (sound-count int32 :offset-assert 104) @@ -3683,7 +3853,7 @@ (shrub-near 12) (billboard 13) (trans-shrubbery 14) - (trans-frag 15) + (trans-tfrag 15) (sprite 16) (shadow 17) (depth-cue 18) @@ -3841,7 +4011,7 @@ ;; - Symbols -(define-extern *vif-disasm-table* (array vif-disasm-element)) ;; unknown type +(define-extern *vif-disasm-table* (array vif-disasm-element)) (define-extern *dma-disasm* symbol) @@ -4688,8 +4858,8 @@ (define-extern set-display (function display int int int int int display)) (define-extern put-draw-env (function (pointer gif-tag) none)) -(define-extern *pre-draw-hook* (function object none)) ;; unknown type -(define-extern *post-draw-hook* (function dma-buffer none)) ;; unknown type +(define-extern *pre-draw-hook* (function object none)) +(define-extern *post-draw-hook* (function dma-buffer none)) ;; ---------------------- @@ -4823,14 +4993,14 @@ (declare-type art-group basic) ;; custom fields (deftype load-dir (basic) - ((unknown basic :offset-assert 4) + ((lev level :offset-assert 4) (string-array (array string) :offset-assert 8) ;; these are the names (data-array (array basic) :score -50 :offset-assert 12) ;; this is the file data. ) :flag-assert #xb00000010 (:methods - (new (symbol type int basic) _type_ 0) - ;; these methods dont exist + (new (symbol type int level) _type_ 0) + ;; these methods dont exist for this type (load-to-heap-by-name (_type_ string symbol kheap int) art-group 9) (set-loaded-art (_type_ art-group) art-group 10) ) @@ -4842,7 +5012,7 @@ ) :flag-assert #xb00000010 (:methods - (new (symbol type int basic) _type_ 0) + (new (symbol type int level) _type_ 0) ) ) @@ -4980,9 +5150,9 @@ (add-tex-to-dma! (_type_ level int) none 14) ;; very mysterious arg types. (allocate-vram-words! (_type_ int) int 15) (allocate-segment! (_type_ texture-pool-segment int) texture-pool-segment 16) - (dummy-17 () none 17) - (dummy-18 () none 18) - (dummy-19 () none 19) + (unused-17 () none 17) + (unused-18 () none 18) + (unused-19 () none 19) (unload! (_type_ texture-page) int 20) (upload-one-common! (_type_ level) symbol 21) (lookup-boot-common-id (_type_ int) int 22) @@ -5041,7 +5211,7 @@ (relocate (_type_ kheap (pointer uint8)) none :replace 7) (remove-from-heap (_type_ kheap) _type_ 9) (get-leftover-block-count (_type_ int int) int 10) - (dummy-11 () none 11) + (unused-11 () none 11) (relocate-dests! (_type_ int int) none 12) (add-to-dma-buffer (_type_ dma-buffer int) int 13) (upload-now! (_type_ int) none 14) @@ -5250,7 +5420,11 @@ (texture-page texture-page 9 :offset-assert 60) (loaded-texture-page texture-page 16 :offset-assert 96) (loaded-texture-page-count int32 :offset-assert 160) - (foreground-sink-group dma-foreground-sink-group 3 :inline :offset-assert 176) ;; inline basic + (tfrag-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 176) + (pris-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 208) + (water-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 240) + + (foreground-sink-group dma-foreground-sink-group 3 :inline :offset 176) ;; inline basic (foreground-draw-engine engine 3 :offset-assert 272) (entity entity-links-array :offset-assert 284) (ambient entity-ambient-data-array :offset-assert 288) @@ -5295,7 +5469,7 @@ (load-begin (_type_) _type_ 18) (login-begin (_type_) _type_ 19) (vis-load (_type_) uint 20) - (dummy-21 (_type_) none 21) + (unused-21 (_type_) none 21) (birth (_type_) _type_ 22) (level-status-set! (_type_ symbol) _type_ 23) (load-required-packages (_type_) _type_ 24) @@ -5492,8 +5666,8 @@ ;; - Symbols -(define-extern *math-camera* math-camera) ;; unknown type -(define-extern *math-camera-fog-correction* fog-corrector) ;; unknown type +(define-extern *math-camera* math-camera) +(define-extern *math-camera-fog-correction* fog-corrector) ;; ---------------------- @@ -5669,8 +5843,8 @@ ;; - Symbols -(define-extern *font-default-matrix* matrix) ;; unknown type -(define-extern *font-work* font-work) ;; unknown type +(define-extern *font-default-matrix* matrix) +(define-extern *font-work* font-work) ;; ---------------------- @@ -5707,7 +5881,7 @@ (define-extern set-display-env (function display-env int int int int int int display-env)) (define-extern set-draw-env (function draw-env int int int int int int draw-env)) (define-extern get-video-mode (function symbol)) -(define-extern draw-string-xy (function string dma-buffer int int font-color font-flags none)) +(define-extern draw-string-xy (function string dma-buffer int int font-color font-flags float)) (define-extern set-draw-env-offset (function draw-env int int int draw-env)) (define-extern put-display-alpha-env (function display-env none)) (define-extern set-display2 (function display int int int int int display)) @@ -5938,11 +6112,11 @@ :flag-assert #xe00000278 (:methods (new (symbol type int) _type_ 0) - (push-setting! (_type_ process symbol object object object) none 9) - (set-setting! (_type_ process symbol symbol float int) none 10) - (clear-pending-settings-from-process (_type_ process symbol) none 11) - (copy-settings-from-target! (_type_) setting-data 12) - (update-per-frame-settings! (_type_) setting-data 13) + (add-setting (_type_ process symbol object object object) none 9) + (set-setting (_type_ process symbol object object object) none 10) + (remove-setting (_type_ process symbol) none 11) + (apply-settings (_type_) setting-data 12) + (update (_type_) setting-data 13) ) ) @@ -6096,7 +6270,7 @@ (define-extern *texture-pool* texture-pool) (define-extern *font-texture* texture) (define-extern global kheap) -(define-extern *txt-dma-list* dma-buffer) ;; unknown type +(define-extern *txt-dma-list* dma-buffer) (define-extern ct32-24-block-table (array int32)) (define-extern ct16-block-table (array int32)) (define-extern ct16s-block-table (array int32)) @@ -6105,7 +6279,7 @@ (define-extern mz16s-block-table (array int32)) (define-extern mt8-block-table (array int32)) (define-extern mt4-block-table (array int32)) -(define-extern *shader-list* pair) ;; unknown type +(define-extern *shader-list* pair) (define-extern *edit-shader* texture-id) @@ -6305,7 +6479,7 @@ ;; field param1 is a basic loaded with a signed load field param2 is a basic loaded with a signed load (:methods (new (symbol type basic) _type_ 0) - (dummy-9 (_type_ basic) _type_ 9) + (reset-and-assign-geo! (_type_ basic) _type_ 9) ) ) @@ -6762,7 +6936,7 @@ (gifbuf-adr uint32 :offset-assert 68) (inbuf-adr uint32 :offset-assert 72) (fade-val uint32 :offset-assert 76) - (time-of-day-color uint32 :offset-assert 80) + (time-of-day-color rgba :offset-assert 80) (to-vu0-waits uint32 :offset-assert 84) (to-spr-waits uint32 :offset-assert 88) (from-spr-waits uint32 :offset-assert 92) @@ -7995,7 +8169,7 @@ ) (deftype skeleton-group (basic) - ((art-group-name basic :offset-assert 4) + ((art-group-name string :offset-assert 4) (jgeo int32 :offset-assert 8) (janim int32 :offset-assert 12) (bounds vector :inline :offset-assert 16) @@ -8200,19 +8374,19 @@ ) (deftype merc-byte-header (structure) - ((srcdest-off uint8 :offset-assert 0) - (rgba-off uint8 :offset-assert 1) - (lump-off uint8 :offset-assert 2) - (fp-off uint8 :offset-assert 3) - (mat1-cnt uint8 :offset-assert 4) - (mat2-cnt uint8 :offset-assert 5) - (mat3-cnt uint8 :offset-assert 6) - (samecopy-cnt uint8 :offset-assert 7) - (crosscopy-cnt uint8 :offset-assert 8) - (strip-len uint8 :offset-assert 9) - (mm-quadword-fp-off uint8 :offset-assert 10) - (mm-quadword-size uint8 :offset-assert 11) - (perc-off uint8 :offset-assert 12) + ((srcdest-off uint8 :offset-assert 0) ; 0x + (rgba-off uint8 :offset-assert 1) ; 0y + (lump-off uint8 :offset-assert 2) ; 0z + (fp-off uint8 :offset-assert 3) ; 0w + (mat1-cnt uint8 :offset-assert 4) ; 1x + (mat2-cnt uint8 :offset-assert 5) ; 1y + (mat3-cnt uint8 :offset-assert 6) ; 1z + (samecopy-cnt uint8 :offset-assert 7) ; 1w + (crosscopy-cnt uint8 :offset-assert 8) ; 2x + (strip-len uint8 :offset-assert 9) ; 2y + (mm-quadword-fp-off uint8 :offset-assert 10) ; 2z + (mm-quadword-size uint8 :offset-assert 11) ; 2w + (perc-off uint8 :offset-assert 12) ; 3x (mat-slot uint8 10 :offset-assert 13) ) :method-count-assert 9 @@ -8255,7 +8429,7 @@ ((x-add float :offset-assert 0) (y-add float :offset-assert 4) (z-add float :offset-assert 8) - (shader-cnt uint8 :offset-assert 12) + (shader-cnt uint8 :offset-assert 12) ;; only 7 bits used? maybe flag in top bit? (kick-info-offset uint8 :offset-assert 13) (kick-info-step uint8 :offset-assert 14) (hword-cnt uint8 :offset-assert 15) @@ -8276,7 +8450,7 @@ ) (deftype merc-fragment-control (structure) - ((unsigned-four-count uint8 :offset-assert 0) + ((unsigned-four-count uint8 :offset-assert 0) ;; (in 32-bit words, not qw) (lump-four-count uint8 :offset-assert 1) ;; merc-vtx (fp-qwc uint8 :offset-assert 2) ;; merc-fp-header (mat-xfer-count uint8 :offset-assert 3) @@ -8476,11 +8650,11 @@ ) (deftype merc-vu1-low-mem (structure) - ((tri-strip-gif gs-gif-tag :inline :offset-assert 0) ;; was qword - (ad-gif gs-gif-tag :inline :offset-assert 16) ;; was qword - (hvdf-offset vector :inline :offset-assert 32) - (perspective uint128 4 :offset-assert 48) - (fog vector :inline :offset-assert 112) + ((tri-strip-gif gs-gif-tag :inline :offset-assert 0) ;; was qword 0 + (ad-gif gs-gif-tag :inline :offset-assert 16) ;; was qword 1 + (hvdf-offset vector :inline :offset-assert 32) ;; 2 + (perspective uint128 4 :offset-assert 48) ;; 3, 4, 5, 6 + (fog vector :inline :offset-assert 112) ;; 7 ) :method-count-assert 9 :size-assert #x80 @@ -9015,9 +9189,20 @@ ;; - Types +(defenum shadow-flags + :bitfield #t + :type int32 + (shdf00) ;; unused + (disable-fade) + (shdf02) ;; only set, never used. + (shdf03) + (shdf04) ;; unused + (disable-draw) + ) + (deftype shadow-settings (structure) - ((center vector :inline :offset-assert 0) - (flags int32 :score 100 :offset 12) + ((center vector :inline :offset-assert 0 :do-not-decompile) + (flags shadow-flags :score 100 :offset 12) (shadow-dir vector :inline :offset-assert 16) (dist-to-locus float :offset 28) (bot-plane plane :inline :offset-assert 32) @@ -9045,7 +9230,7 @@ (set-offset-bit (shadow-control) int 10) (set-top-plane-offset (shadow-control float) int 11) (set-bottom-plane-offset (shadow-control float) int 12) - (dummy-13 (_type_) none 13) + (unused-13 (_type_) none 13) (update-direction-from-time-of-day (_type_) none 14) (collide-to-find-planes (_type_ vector float float float) none 15) ) @@ -9296,7 +9481,7 @@ ((want level-buffer-state 2 :inline :offset-assert 4) (vis-nick symbol :offset-assert 36) (command-list pair :offset-assert 40) - (object-name symbol 256 :offset-assert 44) + (object-name symbol 256 :offset-assert 44) ;; TODO string (object-status basic 256 :offset-assert 1068) ) :method-count-assert 21 @@ -9319,10 +9504,27 @@ ) ) +(defenum continue-flags + :type uint32 + :bitfield #t + (contf00) + (contf01) + (warp) + (demo) + (intro) + (sage-intro) + (sage-demo-convo) + (title) + (contf08) + (contf09) + (game-start) + (sage-ecorocks) + ) + (deftype continue-point (basic) ((name string :offset-assert 4) (level symbol :offset-assert 8) - (flags uint32 :offset-assert 12) + (flags continue-flags :offset-assert 12) (trans vector :inline :offset-assert 16) (quat quaternion :inline :offset-assert 32) (camera-trans vector :inline :offset-assert 48) @@ -9690,7 +9892,7 @@ :flag-assert #xb000000c0 (:methods (new (symbol type int) _type_ 0) - (dummy-9 (_type_) float 9) + (current-cycle-distance (_type_) float 9) (debug-print-channels (_type_ symbol) int 10) ) ) @@ -10005,6 +10207,38 @@ ;; - Types +(defenum surface-flags + :bitfield #t + :type uint32 + (allow-look-around) ;; allows entering first person with triangle + (dive) ;; set on all diving (dive, dive-bottom) surfaces + (surf02) ;; unused + (no-turn-around) ;; prevent "changed direction" animation from happening + + ;; when jak is on a surface with this flag, the case where jak + ;; is forced to rotate in the direction he's traveling is + ;; never taken. It's used on ice (though it is not needed, the turn toward transv + ;; is disabled by not being in target-walk ever) and also used to prevent + ;; jak from spinning around when he shouldn't (like if he's knocked back) + (no-rotate-toward-transv) + ;; if jak should always be forced to rotate in the direction he's travelling. + ;; used for the slides and also the warp gate jump + (always-rotate-toward-transv) + + ;; never set, but prevents jak from jumping (both normal and roll) + (prevent-jump) + + ;; target is launch jumping (from a blue eco pad) + (prevent-attacks-during-launch-jump) + (surf08) ;; never set, prevents various attacks from being possible + (surf09) ;; another attack prevent + (allow-edge-grab) ;; if set, and jak is falling, turn on the ledge grab search. + (jump) ;; set on all jumps, used to prevent "on-grounds" in places + (attacking) ;; set on all attacks, but not actually used anywhere + (ducking) ;; set on all ducks, but not actually used anywhere + (moving-ground) ;; unused, but would make sense if jak was on something moving + ) + (deftype surface (basic) ((name symbol :offset-assert 4) ;; data went here @@ -10037,7 +10271,7 @@ (mult-hook (function surface surface surface int none) :offset-assert 140) ;; dataw went here (mode symbol :offset-assert 144) - (flags uint32 :offset-assert 148) + (flags surface-flags :offset-assert 148) (data float 30 :offset 8) (hook function 4 :offset 128) (dataw uint32 2 :offset 144) @@ -10111,10 +10345,10 @@ ;; - Types (deftype pat-surface (uint32) - ((skip uint8 :offset 0 :size 3) + ((skip uint8 :offset 0 :size 3 :do-not-decompile) (mode pat-mode :offset 3 :size 3) (material pat-material :offset 6 :size 6) - (camera uint8 :offset 12 :size 2) + (camera uint8 :offset 12 :size 2 :do-not-decompile) (event pat-event :offset 14 :size 6) (noentity uint8 :offset 0 :size 1) (nocamera uint8 :offset 1 :size 1) @@ -10167,21 +10401,20 @@ (vent-valve 2) (wrap-phase 3) ;; phase should wrap from 1 to 0 instead of mirroring. (fop4 4) ;; unused? - (fop5 5) ;; wait-for-cue after death? - (fop6 6) - (fop7 7) + (fop5 5) ;; wait-for-cue after death? nothing sets this. + (instant-collect 6) ;; set on balloon lurker, puffer + (skip-jump-anim 7) ;; skips fuel cell "jump" animation (can-collect 8) (fade 9) (large 10) - (fop11 11) + (require-zoomer 11) ;; iron, but need to be riding zoomer to break it. only used in demo? (powerup 12) ;; strengths (touch 13) (normal-attack 14) (strong-attack 15) (indestructible 16) - - (fop17 17) ;; unused + (fop17 17) ;; engine doesn't check it, set on babak near jungleb exit and in robot room. (eco-blocked 18) (respawn 19) ) @@ -10288,25 +10521,49 @@ ;; - Types +(defenum align-flags + :bitfield #t + :type uint32 + (disabled) ;; keep object velocity + ) + +(defenum align-opts + :bitfield #t + :type uint32 + (adjust-x-vel) + (adjust-y-vel) + (adjust-xz-vel) + (keep-other-velocities) + (adjust-quat) ;; 16 + (alop0) + (alop1) + (alop2) + (alop3) + (alop4) + (alop5) + (no-gravity) + (ignore-y-if-zero) + ) + (deftype align-control (basic) - ((flags uint32 :offset-assert 4) - (process process-drawable :offset-assert 8) - (frame-group art-joint-anim :offset-assert 12) - (frame-num float :offset-assert 16) - (matrix matrix 2 :inline :offset-assert 32) - (transform transform 2 :inline :offset-assert 160) - (delta transformq :inline :offset-assert 256) - (last-speed meters :offset-assert 304) - (align transformq :inline :offset 160) + ((flags align-flags :offset-assert 4) + (process process-drawable :offset-assert 8) + (frame-group art-joint-anim :offset-assert 12) + (frame-num float :offset-assert 16) + (matrix matrix 2 :inline :offset-assert 32) + (transform transform 2 :inline :offset-assert 160) + (delta transformq :inline :offset-assert 256) + (last-speed meters :offset-assert 304) + (align transformq :inline :offset 160) ) :method-count-assert 14 :size-assert #x134 :flag-assert #xe00000134 (:methods (new (symbol type process) _type_ :behavior process-drawable 0) - (TODO-RENAME-9 (_type_) transformq 9) - (TODO-RENAME-10 (_type_ int float float float) trsqv 10) - (TODO-RENAME-11 (_type_ int vector int float float) none 11) ;; 3rd arg is unused + (compute-alignment! (_type_) transformq 9) + (align! (_type_ align-opts float float float) trsqv 10) + (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv 11) ;; 3rd arg is unused (first-transform (_type_) transform 12) (snd-transform (_type_) transform 13) ) @@ -10321,6 +10578,32 @@ ;; - Types +(defenum state-flags + :bitfield #t + :type uint32 + (fade-out-particles) ;; set so particle callbacks can fade out before death + (dangerous) ;; set on jak if he is "dangerous" (currently attacking) + (sf02) ;; never sent, blocks tripping + (being-attacked) ;; set when attacked + (invulnerable) ;; set from the debug menu + (timed-invulnerable) ;; after being attacked + (invuln-powerup) ;; unused invulnerable mode from powerup + (do-not-notice) ;; enemies etc shouldn't notice jak + (grabbed) ;; something else has "grabbed" control of jak + (first-person-mode) ;; triangle, billy game + (use-alt-cam-pos) ;; target-cam-pos should use an alternate position (jumping in warp gate, on to flutflut...) + (prevent-jump) ;; target cannot do any jumps + (prevent-attack) ;; target cannot do attacks + (prevent-duck) ;; can't duck or roll + (remove-prevents) ;; when set, removes the previous 3 prevents on the next frame. + (dying) ;; set during death anim + (sf16) ;; unused + (has-saved-position) ;; is there a saved position? + (looking-at-enemy) ;; neck mod active to look at enemy + (falling-into-pool-of-bad) ;; falling into lava, dark eco, or melt + (flop-hit-ground) ;; set when ground pound hit ground + ) + (declare-type nav-control basic) (declare-type path-control basic) (declare-type vol-control basic) @@ -10343,7 +10626,7 @@ (part sparticle-launch-control :offset-assert 152) (water water-control :offset-assert 156) (sound ambient-sound :offset-assert 160) - (state-flags uint32 :offset-assert 164) + (state-flags state-flags :offset-assert 164) (state-time time-frame :offset-assert 168) ) :heap-base #x40 @@ -10354,7 +10637,7 @@ (:methods (initialize-skeleton (_type_ skeleton-group pair) none 14) (initialize-skeleton-by-name (_type_ string object) _type_ 15) - (apply-alignment (_type_ int transformq vector) collide-shape 16) + (apply-alignment (_type_ align-opts transformq vector) collide-shape 16) (do-joint-math! (_type_) none 17) (cleanup-for-death (_type_) none 18) (evaluate-joint-control (_type_) none 19) @@ -10418,13 +10701,32 @@ ) ) +(defenum attack-mask + :bitfield #t + :type uint32 + (trans) + (vector) + (intersection) + (attacker) + (invinc-time) + (mode) + (shove-back) + (shove-up) + (speed) + (dist) + (control) + (angle) + (rotate-to) + (atki13) + ) + (deftype attack-info (structure) ((trans vector :inline :offset-assert 0) (vector vector :inline :offset-assert 16) (intersection vector :inline :offset-assert 32) (attacker handle :offset-assert 48) - (invinc-time time-frame :offset-assert 56) - (mask uint32 :offset-assert 64) + (invinc-time time-frame :offset-assert 56) + (mask attack-mask :offset-assert 64) (mode symbol :offset-assert 68) (shove-back meters :offset-assert 72) (shove-up meters :offset-assert 76) @@ -10438,7 +10740,6 @@ :method-count-assert 10 :size-assert #x68 :flag-assert #xa00000068 - ;; field handle is likely a value type (:methods (combine! (_type_ attack-info) none 9) ) @@ -10467,7 +10768,6 @@ ;; - Types -;; NOTE - root can also be a collide-shape (declare-type joint-mod basic) (deftype manipy (process-drawable) ((new-trans-hook (function none) :offset-assert 176) ;; TODO - no idea on these types @@ -10482,7 +10782,7 @@ (joint joint-mod 4 :offset-assert 240) (new-post-hook (function none) :offset-assert 256) ;; TODO - no idea on these types (cur-post-hook (function none) :offset-assert 260) ;; TODO - no idea on these types - (clone-copy-trans basic :offset-assert 264) + (clone-copy-trans symbol :offset-assert 264) (shadow-backup basic :offset-assert 268) (draw? symbol :offset-assert 272) ) @@ -10536,13 +10836,12 @@ ) (deftype camera-tracker (process) - ((entity-override entity-actor :score 100 :offset 52) - (grab-target handle :offset 120) + ((grab-target handle :offset 120) (grab-event symbol :offset-assert 128) (release-event symbol :offset-assert 132) - (old-global-mask uint32 :offset-assert 136) - (old-self-mask uint32 :offset-assert 140) - (old-parent-mask uint32 :offset-assert 144) + (old-global-mask process-mask :offset-assert 136) + (old-self-mask process-mask :offset-assert 140) + (old-parent-mask process-mask :offset-assert 144) (look-at-target handle :offset-assert 152) (pov-target handle :offset-assert 160) (work-process handle :offset-assert 168) @@ -10552,7 +10851,7 @@ (userdata basic :offset-assert 196) (message basic :offset-assert 200) (border-value basic :offset-assert 204) - (mask-to-clear uint32 :offset-assert 208) + (mask-to-clear process-mask :offset-assert 208) (script pair :offset-assert 212) (script-line pair :offset-assert 216) (script-func (function none) :offset-assert 220) ;; TODO - unconfirmed, see generic-obs::lambda::33 @@ -10622,16 +10921,16 @@ (deftype othercam (process) ((hand handle :offset-assert 112) - (old-global-mask uint32 :offset-assert 120) - (mask-to-clear uint32 :offset-assert 124) + (old-global-mask process-mask :offset-assert 120) + (mask-to-clear process-mask :offset-assert 124) (cam-joint-index int32 :offset-assert 128) (old-pos vector :inline :offset-assert 144) (old-mat-z vector :inline :offset-assert 160) (had-valid-frame basic :offset-assert 176) (border-value basic :offset-assert 180) - (die? symbol :offset-assert 184) + (die? symbol :offset-assert 184) (survive-anim-end? symbol :offset-assert 188) - (spooling? symbol :offset-assert 192) + (spooling? symbol :offset-assert 192) ) :heap-base #x60 :method-count-assert 14 @@ -10675,7 +10974,7 @@ (notify-handle handle :offset-assert 192) (anim-name string :offset-assert 200) (command-list pair :offset-assert 204) - (mask-to-clear uint32 :offset-assert 208) + (mask-to-clear process-mask :offset-assert 208) (music-volume-movie float :offset-assert 212) (sfx-volume-movie float :offset-assert 216) ) @@ -11286,7 +11585,7 @@ (target-attack 12) ;; all target attacks (mother-spider 13) (cak-14 14) ;; unused - (blue-eco-suck 15) ;; manipy, orb-cache-top, + (blue-eco-suck 15) ;; manipy, orb-cache-top, (unknown-16 16) (unknown-17 17) (unknown-18 18) @@ -11421,7 +11720,7 @@ (add-fg-prim-using-y-probe (_type_ collide-cache) none 14) (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 15) (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 16) - (dummy-17 () none 17) + (unused-17 () none 17) (collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none 18) (collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none 19) (add-to-bounding-box (_type_ collide-kind) symbol 20) @@ -11478,17 +11777,30 @@ ) ) +(defenum nav-flags + :bitfield #t + :type uint8 + (navf0 0) + (navf1 1) + (navf2 2) + (navf3 3) + (navf4 4) + (navf5 5) + (navf6 6) + (navf7 7) + ) + (declare-type collide-edge-hold-list structure) (declare-type collide-work structure) (declare-type touching-shapes-entry structure) (deftype collide-shape (trsqv) - ((process process-drawable :offset-assert 140) + ((process process-drawable :offset-assert 140) (max-iteration-count uint8 :offset-assert 144) - (nav-flags uint8 :offset-assert 145) + (nav-flags nav-flags :offset-assert 145) (pad-byte uint8 2 :offset-assert 146) (pat-ignore-mask pat-surface :offset-assert 148) - (event-self basic :offset-assert 152) - (event-other basic :offset-assert 156) + (event-self symbol :offset-assert 152) + (event-other symbol :offset-assert 156) (root-prim collide-shape-prim :offset-assert 160) ;; i think this can be any subtype of collide-shape-prim as well! (riders collide-sticky-rider-group :offset-assert 164) (backup-collide-as collide-kind :offset-assert 168) @@ -11530,6 +11842,78 @@ ) ) +(defenum cshape-moving-flags + :bitfield #t + :type uint64 + (onsurf) + (onground) + (tsurf) + (twall) + (t-ciel) + (t-act) + (csmf06) + (csmf07) + (csmf08) + (csmf09) + (on-water) + (csmf11) + (csmf12) + (csmf13) + (csmf14) + (csmf15) + (csmf16) + (csmf17) + (csmf18) + (csmf19) + (csmf20) + (csmf21) + (csmf22) + (csmf23) + (csmf24) + (csmf25) + (csmf26) + (csmf27) + (csmf28) + (csmf29) + ) + +(defenum cshape-reaction-flags + :bitfield #t + :type uint32 + (csrf00) + (csrf01) + (csrf02) + (csrf03) + (csrf04) + (csrf05) + (csrf06) + (csrf07) + (csrf08) + (csrf09) + (csrf10) + (csrf11) + (csrf12) + (csrf13) + (csrf14) + (csrf15) + (csrf16) + (csrf17) + (csrf18) + (csrf19) + (csrf20) + (csrf21) + (csrf22) + (csrf23) + (csrf24) + (csrf25) + (csrf26) + (csrf27) + (csrf28) + (csrf29) + (csrf30) + (csrf31) + ) + (deftype collide-shape-moving (collide-shape) ((rider-time time-frame :offset-assert 184) (rider-last-move vector :inline :offset-assert 192) @@ -11537,12 +11921,12 @@ (poly-pat pat-surface :offset-assert 256) (cur-pat pat-surface :offset-assert 260) (ground-pat pat-surface :offset-assert 264) - (status uint64 :offset-assert 272) ;; 1: onsurf 2: onground 4: tsurf 8: twall 16: t-ciel 32: t-act ?? 1024: on-water - (old-status uint64 :offset-assert 280) - (prev-status uint64 :offset-assert 288) - (reaction-flag uint32 :offset-assert 296) - (reaction (function collide-shape-moving collide-shape-intersect vector vector uint) :offset-assert 300) - (no-reaction (function collide-shape-moving collide-shape-intersect vector vector none) :offset-assert 304) + (status cshape-moving-flags :offset-assert 272) + (old-status cshape-moving-flags :offset-assert 280) + (prev-status cshape-moving-flags :offset-assert 288) + (reaction-flag cshape-reaction-flags :offset-assert 296) + (reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags) :offset-assert 300) + (no-reaction (function collide-shape-moving collide-shape-intersect vector vector none) :offset-assert 304) (local-normal vector :inline :offset-assert 320) (surface-normal vector :inline :offset-assert 336) (poly-normal vector :inline :offset-assert 352) @@ -11599,9 +11983,9 @@ (local-normal vector :inline :offset-assert 64) (surface-normal vector :inline :offset-assert 80) (time time-frame :offset-assert 96) - (status uint64 :offset-assert 104) + (status cshape-moving-flags :offset-assert 104) (pat pat-surface :offset-assert 112) - (reaction-flag uint32 :offset-assert 116) + (reaction-flag cshape-reaction-flags :offset-assert 116) ) :method-count-assert 10 :size-assert #x78 @@ -11611,6 +11995,7 @@ ) ) +;; NOTE : type has been PAL patched (deftype control-info (collide-shape-moving) ( (unknown-vector00 vector :inline :offset 448) ;; from - logic-target::build-conversions @@ -11732,6 +12117,7 @@ (unknown-uint30 uint32 :offset 2188) ;; from target::(code target-running-attack) (unknown-float121 float :offset 2188) ;; from target::mod-var-jump (unknown-uint31 uint32 :offset 2192) ;; from target::(trans target-running-attack) + (unknown-int37 int32 :offset 2192) (unknown-float122 float :offset 2196) ;; from target::(trans target-jump) (unknown-float123 float :offset 2200) ;; from target::mod-var-jump (unknown-float124 float :offset 2204) ;; from target::init-var-jump @@ -11767,13 +12153,18 @@ (unknown-vector120 vector :inline :offset 18928) ;; from target::(code target-running-attack) (unknown-float150 float :offset 18944) ;; from target::(code target-wheel-flip) (unknown-vector121 vector :inline :offset 18960) ;; from target collide response - (unknown-int60 uint32 :offset 18976) ;; from logic-target::print-target-stats + (wall-pat pat-surface :offset 18976) ;; pat information for wall-check collision (unknown-soundid00 sound-id :offset 18980) ;; from powerups::target-powerup-process (unknown-float141 float :offset 18984) ;; from powerups::target-powerup-process + ;; PAL patch here + (unknown-soundid01 sound-id :offset 18988) + (unknown-int34 int32 :offset 18992) + (unknown-int35 int32 :offset 18996) + (unknown-int36 int32 :offset 19000) ) - :size-assert #x4a2c + :size-assert #x4a3c ;; #x4a2c :method-count-assert 65 - :flag-assert #x4100004a2c + :flag-assert #x4100004a3c ;; #x4100004a2c ) ;; ---------------------- @@ -11785,7 +12176,7 @@ ;; - Types (deftype touching-prim (structure) - ((cprim collide-shape-prim :offset-assert 0) ;; a big guess, there's a few that meet this name + ((cprim collide-shape-prim :offset-assert 0) ;; a big guess, there's a few that meet this name (has-tri? symbol :offset-assert 4) (tri collide-tri-result :inline :offset-assert 16) ) @@ -12213,39 +12604,41 @@ (declare-type tube-info basic) (declare-type racer-info basic) (declare-type flut-info basic) +;; NOTE : type has been PAL patched. (deftype target (process-drawable) - ((self-override target :score 100 :offset 28) + ((self-override target :score 100 :offset 28) (control control-info :score 100 :offset 112) (fact-info-target fact-info-target :score 100 :offset 144) (skel2 basic :offset-assert 176) (racer racer-info :offset-assert 180) (game game-info :offset-assert 184) (neck joint-mod :offset-assert 188) - (state-hook-time time-frame :offset-assert 192) + (state-hook-time time-frame :offset-assert 192) (state-hook (function none :behavior target) :offset-assert 200) (cam-user-mode symbol :offset-assert 204) - (sidekick (pointer sidekick) :offset-assert 208) - (manipy (pointer manipy) :offset-assert 212) + (sidekick (pointer sidekick) :offset-assert 208) + (manipy (pointer manipy) :offset-assert 212) (attack-info attack-info :inline :offset-assert 224) (attack-info-rec attack-info :inline :offset-assert 336) (anim-seed uint64 :offset-assert 440) (alt-cam-pos vector :inline :offset-assert 448) - (snowball snowball-info :offset-assert 464) - (tube tube-info :offset-assert 468) - (flut flut-info :offset-assert 472) + (snowball snowball-info :offset-assert 464) + (tube tube-info :offset-assert 468) + (flut flut-info :offset-assert 472) (current-level level :offset-assert 476) (saved-pos transformq :inline :offset-assert 480) (saved-owner uint64 :offset-assert 528) (alt-neck-pos vector :inline :offset-assert 544) (fp-hud handle :offset-assert 560) - (no-load-wait time-frame :offset-assert 568) - (no-look-around-wait time-frame :offset-assert 576) - ;;(burn-proc handle :offset-assert 584) ;; PAL only + (no-load-wait time-frame :offset-assert 568) + (no-look-around-wait time-frame :offset-assert 576) + ;; PAL patch here + (burn-proc handle :offset-assert 584) ) :heap-base #x1e0 :method-count-assert 21 - :size-assert #x248 ;;#x250 - :flag-assert #x1501e00248 ;;#x1501e00250 + :size-assert #x250 ;;#x248 + :flag-assert #x1501e00250 ;;#x1501e00248 (:methods (find-edge-grabs! (_type_ collide-cache) object 20) ;; none or #f ) @@ -12347,7 +12740,7 @@ target-tube (target-tube-death symbol) (target-tube-jump float float) - (target-tube-hit handle attack-info) + (target-tube-hit symbol attack-info) target-snowball (target-death symbol) (target-clone-anim handle) @@ -12620,7 +13013,7 @@ (num-spheres uint32 :offset-assert 4) (collide-with collide-kind :offset-assert 8) (proc process-drawable :offset-assert 16) - (ignore-pat uint32 :offset-assert 20) ;; flags / bitfield i bet + (ignore-pat pat-surface :offset-assert 20) ;; flags / bitfield i bet (solid-only basic :offset-assert 24) ;; probably a symbol ) :method-count-assert 9 @@ -12720,17 +13113,17 @@ :flag-assert #x2100008670 (:methods (debug-draw (_type_) none 9) - (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result int) float 10) + (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result pat-surface) float 10) (fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol 11) - (fill-and-probe-using-y-probe (_type_ vector float collide-kind process collide-tri-result uint) float 12) + (fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float 12) (fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none 13) - (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable int) none 14) + (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable pat-surface) none 14) (fill-using-spheres (_type_ collide-using-spheres-params) none 15) - (fill-using-y-probe (_type_ vector float collide-kind process-drawable uint) none 16) + (fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none 16) (initialize (_type_) none 17) - (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result int) float 18) + (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float 18) (probe-using-spheres (_type_ collide-using-spheres-params) symbol 19) - (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result uint) float 20) + (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20) (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none 21) ;; second functiom is method 28 (fill-from-foreground-using-box (_type_) none 22) (fill-from-foreground-using-line-sphere (_type_) none 23) @@ -12776,9 +13169,9 @@ ;; - Symbols -(define-extern *collide-work* collide-work) ;; unknown type -(define-extern *collide-cache* collide-cache) ;; unknown type -(define-extern *collide-list* collide-list) ;; unknown type +(define-extern *collide-work* collide-work) +(define-extern *collide-cache* collide-cache) +(define-extern *collide-list* collide-list) ;; ---------------------- @@ -14211,7 +14604,7 @@ (random-mult int32 :offset 12) (sym symbol :offset 4) ;; moved (func symbol :offset 4) - (tex uint32 :offset 4) + (tex texture-id :offset 4) (pntr pointer :offset 4) ;; sym used to be here (sound sound-spec :offset 4) @@ -15031,19 +15424,19 @@ :flag-assert #x1b00b00118 ;; inherited inspect of process (:methods - (dummy-14 (_type_) symbol 14) - (dummy-15 (_type_) none 15) - (TODO-RENAME-16 (_type_ int int) none 16) - (dummy-17 (_type_) none 17) - (dummy-18 (_type_) none 18) - (TODO-RENAME-19 (_type_) none 19) + (hidden? (_type_) symbol 14) + (draw-hud (_type_) none 15) + (tally-value (_type_ int int) none 16) + (draw-icons (_type_) none 17) + (draw-particles (_type_) none 18) + (hud-update (_type_) none 19) (init-particles! (_type_ int) none 20) - (first-icon-x (_type_) int 21) - (first-icon-y (_type_) int 22) - (dummy-23 (_type_) none 23) - (animate! (_type_ symbol symbol) none 24) ;; not sure what the flags are / what the purpose is yet - (inc-value (_type_) float 25) - (dec-value (_type_) float 26) + (get-icon-pos-x (_type_) int 21) + (get-icon-pos-y (_type_) int 22) + (dummy-23 (_type_) none 23) ;; unused + (set-pos-and-scale (_type_ symbol symbol) none 24) + (get-icon-scale-x (_type_) float 25) + (get-icon-scale-y (_type_) float 26) ) (:states hud-arriving @@ -15072,7 +15465,7 @@ (bike-speed (pointer hud-bike-speed) :offset-assert 24) (bike-heat (pointer hud-bike-heat) :offset-assert 28) (money-all (pointer hud-money-all) :offset-assert 32) - (parts (pointer process) 9 :offset 0) + (parts (pointer hud) 9 :offset 0) ) :method-count-assert 9 :size-assert #x24 @@ -15133,20 +15526,6 @@ :flag-assert #x900000034 ) -(deftype game-option (basic) - ((option-type uint64 :offset-assert 8) - (name game-text-id :offset-assert 16) - (scale basic :offset-assert 20) - (param1 float :offset-assert 24) - (param2 float :offset-assert 28) - (param3 int32 :offset-assert 32) - (value-to-modify pointer :offset-assert 36) ;; pointer to - symbol | ? - ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 - ) - (defenum progress-screen :type int64 (invalid -1) @@ -15185,6 +15564,74 @@ (no-disc 32) (bad-disc 33) (quit 34) + + ;; extra screens for pc port + (camera-options) + (accessibility-options) + (game-ps2-options) + (misc-options) + (resolution) + (aspect-msg) + (aspect-ratio) + (gfx-ps2-options) + (secrets) + (hint-log) + (cheats) + (scrapbook) + (music-player) + (scene-player) + (credits) + (quit-title) + (flava-player) + + ;; the last one! + (max) + ) + +(defenum game-option-type + :type uint64 + (slider 0) + (language 1) + (on-off 2) + (center-screen 3) + (aspect-ratio 4) + (video-mode 5) + (menu 6) + (yes-no 7) + (button 8) + + ;; extra types for pc port + (normal-inverted) + (display-mode) + (msaa) + (frame-rate) + (lod-bg) + (lod-fg) + (resolution) + (aspect-new) + (language-subtitles) + (speaker) + (aspect-native) + (button-music) + (button-flava) + ) + +(defenum game-option-menu + :type int32 + :copy-entries progress-screen) + +(deftype game-option (basic) + ((option-type game-option-type :offset-assert 8) + (name game-text-id :offset-assert 16) + (scale symbol :offset-assert 20) + (param1 float :offset-assert 24) + (param2 float :offset-assert 28) + (param3 game-option-menu :offset-assert 32) + (value-to-modify pointer :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 ) (deftype progress (process) @@ -15206,8 +15653,8 @@ (force-transition basic :offset-assert 180) (stat-transition basic :offset-assert 184) (level-transition int32 :offset-assert 188) - (language-selection uint64 :offset-assert 192) - (language-direction basic :offset-assert 200) + (language-selection language-enum :offset-assert 192) + (language-direction symbol :offset-assert 200) (language-transition basic :offset-assert 204) (language-x-offset int32 :offset-assert 208) (sides-x-scale float :offset-assert 212) @@ -15231,8 +15678,8 @@ (total-nb-of-orbs int32 :offset-assert 284) (total-nb-of-buzzers int32 :offset-assert 288) (card-info mc-slot-info :offset-assert 292) - (last-option-index-change time-frame :offset-assert 296) - (video-mode-timeout time-frame :offset-assert 304) + (last-option-index-change time-frame :offset-assert 296) + (video-mode-timeout time-frame :offset-assert 304) (display-state-stack progress-screen 5 :offset-assert 312) (option-index-stack int32 5 :offset-assert 352) (display-state-pos int32 :offset-assert 372) @@ -15248,12 +15695,12 @@ :heap-base #x270 :flag-assert #x3b027002dc (:methods - (dummy-14 (_type_) none 14) - (dummy-15 (_type_) none 15) - (dummy-16 (_type_) none 16) + (progress-dummy-14 (_type_) none 14) ;; unused + (progress-dummy-15 (_type_) none 15) ;; unused + (progress-dummy-16 (_type_) none 16) ;; unused (draw-progress (_type_) none 17) - (dummy-18 () none 18) - (dummy-19 (_type_) symbol 19) + (progress-dummy-18 () none 18) ;; unused + (visible? (_type_) symbol 19) (hidden? (_type_) symbol 20) (adjust-sprites (_type_) none 21) (adjust-icons (_type_) none 22) @@ -15263,10 +15710,10 @@ (draw-buzzer-screen (_type_ int) none 26) (draw-notice-screen (_type_) none 27) (draw-options (_type_ int int float) none 28) - (dummy-29 (_type_) none 29) + (respond-common (_type_) none 29) (respond-progress (_type_) none 30) - (dummy-31 (_type_) none 31) - (dummy-32 (_type_) symbol 32) + (respond-memcard (_type_) none 31) + (can-go-back? (_type_) symbol 32) (initialize-icons (_type_) none 33) (initialize-particles (_type_) none 34) (draw-memcard-storage-error (_type_ font-context) none 35) @@ -15278,16 +15725,16 @@ (draw-memcard-auto-save-error (_type_ font-context) none 41) (draw-memcard-removed (_type_ font-context) none 42) (draw-memcard-error (_type_ font-context) none 43) - (dummy-44 (_type_) none 44) + (progress-dummy-44 (_type_) none 44) ;; unused (push! (_type_) none 45) (pop! (_type_) none 46) - (dummy-47 (_type_) none 47) + (progress-dummy-47 (_type_) none 47) ;; unused (enter! (_type_ progress-screen int) none 48) (draw-memcard-format (_type_ font-context) none 49) (draw-auto-save (_type_ font-context) none 50) (set-transition-progress! (_type_ int) none 51) (set-transition-speed! (_type_) none 52) - (dummy-53 (_type_ progress-screen) progress-screen 53) + (set-memcard-screen (_type_ progress-screen) progress-screen 53) (draw-pal-change-to-60hz (_type_ font-context) none 54) (draw-pal-now-60hz (_type_ font-context) none 55) (draw-no-disc (_type_ font-context) none 56) @@ -15675,13 +16122,13 @@ ;; - Functions -(define-extern nav-mesh-connect (function process trsqv nav-control nav-mesh)) +(define-extern nav-mesh-connect (function process trsqv nav-control nav-mesh :behavior process)) (define-extern has-nav-mesh? (function entity-actor symbol)) ;; - Symbols -(define-extern process-level-heap kheap) ;; unknown type -(define-extern *default-nav-mesh* nav-mesh) ;; unknown type +(define-extern process-level-heap kheap) +(define-extern *default-nav-mesh* nav-mesh) ;; ---------------------- @@ -15877,7 +16324,7 @@ (define-extern effect-param->sound-spec (function sound-spec (pointer float) int sound-spec)) (define-extern ear-trans (function vector)) (define-extern sound-play-by-spec (function sound-spec sound-id vector sound-id)) -(define-extern sound-play-by-name (function sound-name sound-id int int int int symbol sound-id)) +(define-extern sound-play-by-name (function sound-name sound-id int int int sound-group symbol sound-id)) (define-extern sound-angle-convert (function float int)) (define-extern sound-set-ear-trans (function vector vector float int)) (define-extern activate-progress (function process progress-screen none)) @@ -15900,18 +16347,18 @@ (define-extern swap-sound-buffers (function vector vector float int)) (define-extern free-last-sound-buffer-entry (function int)) (define-extern sound-basic-cb (function int (pointer int32) none)) -(define-extern sound-set-volume (function uint float int)) +(define-extern sound-set-volume (function sound-group float int)) (define-extern sound-set-reverb (function int float float uint int)) (define-extern sound-pause (function sound-id int)) (define-extern sound-continue (function sound-id int)) -(define-extern sound-group-pause (function uint int)) -(define-extern sound-group-stop (function uint int)) -(define-extern sound-group-continue (function uint int)) +(define-extern sound-group-pause (function sound-group int)) +(define-extern sound-group-stop (function sound-group int)) +(define-extern sound-group-continue (function sound-group int)) (define-extern sound-set-falloff-curve (function int float float int)) (define-extern sound-set-sound-falloff (function sound-name int int int int)) (define-extern sound-set-flava (function uint int)) (define-extern sound-volume-off (function int)) -(define-extern sound-set-fps (function uint int)) +(define-extern sound-set-fps (function int int)) (define-extern show-iop-info (function dma-buffer int)) (define-extern show-iop-memory (function dma-buffer int)) (define-extern make-sqrt-table (function int)) @@ -15919,14 +16366,14 @@ ;; - Symbols -(define-extern *flava-table* flava-table) ;; unknown type -(define-extern *sound-iop-info* sound-iop-info) ;; unknown type -(define-extern *ambient-spec* sound-spec) ;; unknown type -(define-extern *debug-effect-control* symbol) ;; unknown type +(define-extern *flava-table* flava-table) +(define-extern *sound-iop-info* sound-iop-info) +(define-extern *ambient-spec* sound-spec) +(define-extern *debug-effect-control* symbol) (define-extern *setting-control* setting-control) -(define-extern *sound-player-enable* symbol) ;; unknown type -(define-extern *sound-player-rpc* rpc-buffer-pair) ;; unknown type -(define-extern *sound-loader-rpc* rpc-buffer-pair) ;; unknown type +(define-extern *sound-player-enable* symbol) +(define-extern *sound-player-rpc* rpc-buffer-pair) +(define-extern *sound-loader-rpc* rpc-buffer-pair) ;; ---------------------- @@ -15989,8 +16436,8 @@ (define-extern jacc-mem-usage (function joint-anim-compressed-control memory-usage-block int joint-anim-compressed-control)) (define-extern joint-anim-inspect-elt (function joint-anim float joint-anim)) (define-extern joint-anim-login (function joint-anim-drawable joint-anim-drawable)) -(define-extern joint-control-channel-eval (function joint-control-channel float)) -(define-extern joint-control-channel-eval! (function joint-control-channel (function joint-control-channel float float float) float)) +(define-extern joint-control-channel-eval (function joint-control-channel none)) +(define-extern joint-control-channel-eval! (function joint-control-channel (function joint-control-channel float float float) none)) (define-extern joint-control-channel-group-eval! (function joint-control-channel art-joint-anim (function joint-control-channel float float float) int)) (define-extern joint-control-channel-group! (function joint-control-channel art-joint-anim (function joint-control-channel float float float) int)) (define-extern joint-control-copy! (function joint-control joint-control joint-control)) @@ -16695,7 +17142,7 @@ ;; - Unknowns -(define-extern generic-vu0-block vu-function) ;; unknown type +(define-extern generic-vu0-block vu-function) ;; ---------------------- @@ -16713,7 +17160,7 @@ ;; - Symbols -(define-extern *generic-foreground-sinks* (array generic-dma-foreground-sink)) ;; unknown type +(define-extern *generic-foreground-sinks* (array generic-dma-foreground-sink)) ;; ---------------------- @@ -16742,11 +17189,11 @@ ;; - Functions (define-extern generic-work-init (function generic-dma-foreground-sink none)) -(define-extern generic-upload-vu0 function) +(define-extern generic-upload-vu0 (function none)) (define-extern upload-vu0-program (function vu-function pointer none)) (define-extern generic-initialize-without-sink (function matrix vu-lights none)) -(define-extern generic-initialize function) -(define-extern generic-wrapup function) +(define-extern generic-initialize (function generic-dma-foreground-sink matrix vu-lights none)) +(define-extern generic-wrapup (function generic-dma-foreground-sink none)) (define-extern generic-dma-from-spr function) (define-extern generic-light-proc function) (define-extern generic-envmap-proc function) @@ -16769,12 +17216,12 @@ ;; - Symbols -(define-extern *generic-envmap-texture* texture) ;; unknown type +(define-extern *generic-envmap-texture* texture) ;; - Unknowns -(define-extern *generic-consts* generic-consts) ;; unknown type -(define-extern *target-lock* symbol) ;; unknown type +(define-extern *generic-consts* generic-consts) +(define-extern *target-lock* symbol) ;; ---------------------- @@ -16810,8 +17257,8 @@ ;; - Unknowns -(define-extern mercneric-vu0-block vu-function) ;; unknown type -(define-extern *inv-init-table* (inline-array invinitdata)) ;; unknown type +(define-extern mercneric-vu0-block vu-function) +(define-extern *inv-init-table* (inline-array invinitdata)) ;; ---------------------- @@ -16823,18 +17270,18 @@ ;; - Functions (define-extern generic-tie-dma-to-spad function) -(define-extern generic-tie-dma-to-spad-sync function) +(define-extern generic-tie-dma-to-spad-sync (function object object none)) (define-extern generic-tie-decompress function) (define-extern generic-tie-upload-next function) (define-extern generic-tie-convert-proc function) -(define-extern generic-tie-convert function) +(define-extern generic-tie-convert (function none)) (define-extern generic-tie-display-stats function) (define-extern generic-tie-debug function) (define-extern generic-tie-execute (function generic-dma-foreground-sink dma-buffer basic none)) ;; - Unknowns -(define-extern *generic-tie* symbol) ;; unknown type +(define-extern *generic-tie* symbol) ;; ---------------------- @@ -16912,7 +17359,7 @@ ;; - Unknowns -(define-extern shadow-vu0-block vu-function) ;; unknown type +(define-extern shadow-vu0-block vu-function) ;; ---------------------- @@ -16962,7 +17409,7 @@ ;; - Unknowns (define-extern shadow-vu1-block vu-function) -(define-extern *shadow-vu1-tri-template* shadow-vu1-gifbuf-template) ;; unknown type +(define-extern *shadow-vu1-tri-template* shadow-vu1-gifbuf-template) ;; ---------------------- @@ -17272,7 +17719,7 @@ (define-extern tie-debug-between (function uint uint uint)) (define-extern tie-debug-one (function uint uint uint)) (define-extern walk-tie-generic-prototypes (function none)) -(define-extern draw-inline-array-instance-tie (function pointer drawable int dma-buffer none)) +(define-extern draw-inline-array-instance-tie (function pointer (inline-array instance-tie) int dma-buffer none)) (define-extern draw-inline-array-prototype-tie-generic-asm (function dma-buffer int prototype-array-tie none)) (define-extern draw-inline-array-prototype-tie-asm (function dma-buffer int prototype-array-tie none)) (define-extern draw-inline-array-prototype-tie-near-asm (function dma-buffer int prototype-array-tie none)) @@ -17373,7 +17820,7 @@ ;; - Unknowns -(define-extern *global-toggle* int) ;; unknown type +(define-extern *global-toggle* int) (define-extern *part-id-table* (array sparticle-launcher)) (define-extern *particle-300hz-timer* int) (define-extern *sp-launch-queue* sp-launch-queue) @@ -17451,7 +17898,7 @@ ;; - Functions -(define-extern ja-channel-push! (function int int int :behavior process-drawable)) +(define-extern ja-channel-push! (function int time-frame int :behavior process-drawable)) (define-extern ja-channel-set! (function int int :behavior process-drawable)) (define-extern kill-current-level-hint (function pair pair symbol none)) (define-extern level-hint-surpress! (function none)) @@ -17669,7 +18116,7 @@ (life 201) (money 202) (money-total 203) - (moeny-per-level 204) + (money-per-level 204) (buzzer-total 205) (fuel-cell 206) (death-movie-tick 207) @@ -18177,7 +18624,7 @@ (define-extern update-mood-jungleb-blue (function mood-context float int none)) (define-extern update-mood-prt-color (function mood-context vector)) (define-extern update-mood-default (function mood-context float int none)) -(define-extern update-mood-misty (function mood-context float float none)) +(define-extern update-mood-misty (function mood-context float int none)) (define-extern update-mood-village2 (function mood-context float int none)) (define-extern update-mood-swamp (function mood-context float int none)) (define-extern update-mood-village1 (function mood-context float int none)) @@ -18362,11 +18809,11 @@ ;; - Unknowns -(define-extern *sky-work* sky-work) ;; unknown type -(define-extern *sky-tng-data* sky-tng-data) ;; unknown type -(define-extern sky-roof-polygons (inline-array sky-vertex)) ;; unknown type -(define-extern sky-cloud-polygons (inline-array sky-vertex)) ;; unknown type -(define-extern sky-cloud-polygon-indices (pointer uint8)) ;; unknown type +(define-extern *sky-work* sky-work) +(define-extern *sky-tng-data* sky-tng-data) +(define-extern sky-roof-polygons (inline-array sky-vertex)) +(define-extern sky-cloud-polygons (inline-array sky-vertex)) +(define-extern sky-cloud-polygon-indices (pointer uint8)) ;; ---------------------- @@ -18454,7 +18901,7 @@ ;; - Unknowns (define-extern *load-boundary-list* load-boundary) ;; guess for now -(define-extern *load-boundary-target* (inline-array lbvtx)) ;; unknown type +(define-extern *load-boundary-target* (inline-array lbvtx)) ;; ---------------------- @@ -18549,7 +18996,7 @@ ;; - Unknowns -(define-extern *static-load-boundary-list* (array array)) ;; unknown type +(define-extern *static-load-boundary-list* (array array)) ;; ---------------------- @@ -18691,7 +19138,7 @@ ;; - Unknowns -(define-extern collide-vu0-block vu-function) ;; unknown type +(define-extern collide-vu0-block vu-function) (define-extern *collide-probe-stack* collide-probe-stack) ;; scratchpad pointer? @@ -18781,8 +19228,8 @@ ;; - Unknowns -(define-extern *rotate-surface* surface) ;; unknown type -(define-extern *no-walk-surface* surface) ;; unknown type +(define-extern *rotate-surface* surface) +(define-extern *no-walk-surface* surface) ;; ---------------------- @@ -18795,16 +19242,16 @@ (define-extern target-attack-up (function target symbol symbol none)) (define-extern find-ground-point (function control-info vector float float vector)) -(define-extern default-collision-reaction (function collide-shape-moving collide-shape-intersect vector vector uint)) ;; TODO - not completely confirmed -(define-extern simple-collision-reaction (function collide-shape-moving collide-shape-intersect vector vector uint)) +(define-extern default-collision-reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags)) +(define-extern simple-collision-reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags)) (define-extern collide-shape-draw-debug-marks (function none)) (define-extern debug-report-col-stats (function int)) ;; - Unknowns -(define-extern *col-timer-enable* symbol) ;; unknown type -(define-extern *frame-timer* stopwatch) ;; unknown type -(define-extern *col-timer* stopwatch) ;; unknown type +(define-extern *col-timer-enable* symbol) +(define-extern *frame-timer* stopwatch) +(define-extern *col-timer* stopwatch) (define-extern *race-track-surface* surface) @@ -18816,7 +19263,7 @@ ;; - Unknowns -(define-extern *collide-vif0-init* (array uint32)) ;; unknown type +(define-extern *collide-vif0-init* (array uint32)) ;; ---------------------- @@ -18862,12 +19309,12 @@ ;; - Unknowns -(define-extern *merc-death-globals* vector) ;; unknown type -(define-extern death-beach-puppy death-info) ;; unknown type -(define-extern death-jungle-snake death-info) ;; unknown type -(define-extern death-default death-info) ;; unknown type -(define-extern death-warp-in death-info) ;; unknown type -(define-extern death-warp-out death-info) ;; unknown type +(define-extern *merc-death-globals* vector) +(define-extern death-beach-puppy death-info) +(define-extern death-jungle-snake death-info) +(define-extern death-default death-info) +(define-extern death-warp-in death-info) +(define-extern death-warp-out death-info) ;; ---------------------- @@ -18878,24 +19325,61 @@ ;; - Types +(defenum water-flags + :bitfield #t + :type uint32 + (wt00) + (wt01) + (wt02) + (wt03) + (wt04) + (wt05) + (wt06) + (wt07) + (wt08) + (wt09) + (wt10) + (wt11) + (wt12) + (wt13) + (wt14) + (wt15) + (wt16) + (wt17) + (wt18) + (wt19) + (wt20) + (wt21) + (wt22) + (wt23) + (wt24) + (wt25) + (wt26) + (wt27) + (wt28) + (wt29) + (wt30) + (wt31) + ) + (deftype water-control (basic) - ((flags uint32 :offset-assert 4) - (process process-drawable :offset-assert 8) + ((flags water-flags :offset-assert 4) + (process process-drawable :offset-assert 8) (joint-index int32 :offset-assert 12) (top-y-offset float :offset-assert 16) (ripple-size meters :offset-assert 20) - (enter-water-time time-frame :offset-assert 24) - (wade-time time-frame :offset-assert 32) - (on-water-time time-frame :offset-assert 40) - (enter-swim-time time-frame :offset-assert 48) - (swim-time time-frame :offset-assert 56) + (enter-water-time time-frame :offset-assert 24) + (wade-time time-frame :offset-assert 32) + (on-water-time time-frame :offset-assert 40) + (enter-swim-time time-frame :offset-assert 48) + (swim-time time-frame :offset-assert 56) (base-height meters :offset-assert 64) (wade-height meters :offset-assert 68) (swim-height meters :offset-assert 72) (surface-height meters :offset-assert 76) (bottom-height meters :offset-assert 80) (height meters :offset-assert 84) - (height-offset float 4 :offset-assert 88) + (height-offset float 4 :offset-assert 88) (real-ocean-offset meters :offset 88) (ocean-offset meters :offset 92) (bob-offset meters :offset 96) @@ -18903,13 +19387,13 @@ (swim-depth meters :offset-assert 104) (bob smush-control :inline :offset-assert 112) (volume handle :offset-assert 144) ;; handle? - (bottom vector 2 :inline :offset-assert 160) - (top vector 2 :inline :offset-assert 192) + (bottom vector 2 :inline :offset-assert 160) + (top vector 2 :inline :offset-assert 192) (enter-water-pos vector :inline :offset-assert 224) (drip-old-pos vector :inline :offset-assert 240) (drip-joint-index int32 :offset-assert 256) (drip-wetness float :offset-assert 260) - (drip-time time-frame :offset-assert 264) + (drip-time time-frame :offset-assert 264) (drip-speed float :offset-assert 272) (drip-height meters :offset-assert 276) (drip-mult float :offset-assert 280) @@ -18935,9 +19419,9 @@ (wade-height meters :offset-assert 180) (swim-height meters :offset-assert 184) (bottom-height meters :offset-assert 188) - (attack-event symbol :offset-assert 192) + (attack-event symbol :offset-assert 192) (target handle :offset-assert 200) - (flags uint32 :offset-assert 208) + (flags water-flags :offset-assert 208) ) :heap-base #x70 :method-count-assert 30 @@ -18950,11 +19434,11 @@ (TODO-RENAME-22 (_type_) none 22) ;; can also return an obs? (reset-root! (_type_) none 23) (set-stack-size! (_type_) none 24) - (TODO-RENAME-25 (_type_) object 25) + (TODO-RENAME-25 (_type_) none 25) (TODO-RENAME-26 (_type_) none 26) (dummy-27 (_type_) none 27) (get-ripple-height (_type_ vector) float 28) - (TODO-RENAME-29 (_type_) uint 29) + (TODO-RENAME-29 (_type_) none 29) ) ) @@ -19186,11 +19670,11 @@ (define-extern cam-collision-record-save (function vector vector int symbol camera-slave none)) (define-extern cam-string-move (function object :behavior camera-slave)) (define-extern cam-dist-analog-input (function int float float)) -(define-extern cam-los-collide (function vector vector clip-travel-vector-to-mesh-return-info int symbol :behavior camera-slave)) +(define-extern cam-los-collide (function vector vector clip-travel-vector-to-mesh-return-info pat-surface symbol :behavior camera-slave)) (define-extern dist-info-init (function collide-los-dist-info none)) (define-extern los-cw-ccw (function (inline-array collide-cache-tri) vector vector float clip-travel-vector-to-mesh-return-info vector float symbol)) (define-extern cam-debug-add-los-tri (function (inline-array collide-cache-tri) vector vector none)) -(define-extern cam-los-spline-collide (function vector vector vector float)) +(define-extern cam-los-spline-collide (function vector vector pat-surface float)) (define-extern cam-los-setup-lateral (function clip-travel-vector-to-mesh-return-info vector vector symbol :behavior camera-slave)) (define-extern slave-los-state->string (function slave-los-state string)) (define-extern dist-info-print (function collide-los-dist-info string object)) @@ -19208,11 +19692,11 @@ ;; - Unknowns -(define-extern *CAM_BIKE-bank* cam-bike-bank) ;; unknown type -(define-extern *CAM_STICK-bank* cam-stick-bank) ;; unknown type -(define-extern *CAM_STRING-bank* cam-string-bank) ;; unknown type -(define-extern *CAM_BILLY-bank* cam-billy-bank) ;; unknown type -(define-extern *CAM_EYE-bank* cam-eye-bank) ;; unknown type +(define-extern *CAM_BIKE-bank* cam-bike-bank) +(define-extern *CAM_STICK-bank* cam-stick-bank) +(define-extern *CAM_STRING-bank* cam-string-bank) +(define-extern *CAM_BILLY-bank* cam-billy-bank) +(define-extern *CAM_EYE-bank* cam-eye-bank) ;; ---------------------- @@ -19286,9 +19770,9 @@ ;; - Unknowns -(define-extern *camera-orbit-info* camera-orbit-info) ;; unknown type -(define-extern *CAM_ORBIT-bank* CAM_ORBIT-bank) ;; unknown type -(define-extern *CAM_POINT_WATCH-bank* cam-point-watch-bank) ;; unknown type +(define-extern *camera-orbit-info* camera-orbit-info) +(define-extern *CAM_ORBIT-bank* CAM_ORBIT-bank) +(define-extern *CAM_POINT_WATCH-bank* cam-point-watch-bank) ;; ---------------------- @@ -19357,6 +19841,43 @@ ) ) +(defenum vol-flags + :bitfield #t + :type uint32 + (volf00) + (volf01) + (volf02) + (volf03) + (volf04) + (volf05) + (volf06) + (volf07) + (volf08) + (volf09) + (volf10) + (volf11) + (volf12) + (volf13) + (volf14) + (volf15) + (volf16) + (volf17) + (volf18) + (volf19) + (volf20) + (volf21) + (volf22) + (volf23) + (volf24) + (volf25) + (volf26) + (volf27) + (volf28) + (volf29) + (volf30) + (volf31) + ) + (deftype vol-control (basic) ((flags uint32 :offset-assert 4) (process process-drawable :offset-assert 8) @@ -19606,28 +20127,28 @@ ;; - Unknowns -(define-extern *camera-layout-blink* symbol) ;; unknown type -(define-extern *last-cur-entity* int) ;; unknown type -(define-extern *clm-select* clm) ;; unknown type -(define-extern *clm* clm) ;; unknown type -(define-extern *camera-layout-message-ypos* int) ;; unknown type -(define-extern *CAM_LAYOUT-bank* cam-layout-bank) ;; unknown type -(define-extern *clm-edit* clm) ;; unknown type -(define-extern *clm-focalpull-attr* clm) ;; unknown type -(define-extern *clm-index-attr* clm) ;; unknown type -(define-extern *clm-intro-attr* clm) ;; unknown type -(define-extern *clm-spline-attr* clm) ;; unknown type -(define-extern *clm-vol-attr* clm) ;; unknown type -(define-extern *volume-descriptor-current* int) ;; unknown type -(define-extern *volume-point-current* int) ;; unknown type -(define-extern *volume-normal-current* int) ;; unknown type -(define-extern *volume-descriptor* vol-control) ;; unknown type -(define-extern *volume-point* vector-array) ;; unknown type -(define-extern *volume-normal* vector-array) ;; unknown type -(define-extern *clm-cam-attr* clm) ;; unknown type -(define-extern *clm-cam-lookthrough* clm) ;; unknown type -(define-extern *clm-save-all* clm) ;; unknown type -(define-extern *clm-save-one* clm) ;; unknown type +(define-extern *camera-layout-blink* symbol) +(define-extern *last-cur-entity* int) +(define-extern *clm-select* clm) +(define-extern *clm* clm) +(define-extern *camera-layout-message-ypos* int) +(define-extern *CAM_LAYOUT-bank* cam-layout-bank) +(define-extern *clm-edit* clm) +(define-extern *clm-focalpull-attr* clm) +(define-extern *clm-index-attr* clm) +(define-extern *clm-intro-attr* clm) +(define-extern *clm-spline-attr* clm) +(define-extern *clm-vol-attr* clm) +(define-extern *volume-descriptor-current* int) +(define-extern *volume-point-current* int) +(define-extern *volume-normal-current* int) +(define-extern *volume-descriptor* vol-control) +(define-extern *volume-point* vector-array) +(define-extern *volume-normal* vector-array) +(define-extern *clm-cam-attr* clm) +(define-extern *clm-cam-lookthrough* clm) +(define-extern *clm-save-all* clm) +(define-extern *clm-save-one* clm) ;; ---------------------- @@ -19720,21 +20241,21 @@ ;; - Unknowns -(define-extern *camera-old-level* string) ;; unknown type -(define-extern *camera-old-cpu* int) ;; unknown type -(define-extern *camera-old-vu* int) ;; unknown type -(define-extern *camera-old-tfrag-bytes* int) ;; unknown type -(define-extern *camera-old-stat-string-tfrag-near* string) ;; unknown type -(define-extern *camera-old-stat-string-tfrag* string) ;; unknown type -(define-extern *camera-old-stat-string-total* string) ;; unknown type -(define-extern *cam-collision-record-show* int) ;; unknown type -(define-extern *cam-collision-record* cam-collision-record-array) ;; unknown type -(define-extern *cam-collision-record-last* int) ;; unknown type -(define-extern *cam-collision-record-first* int) ;; unknown type -(define-extern *cam-debug-los-tri* (inline-array cam-debug-tri)) ;; unknown type -(define-extern *cam-debug-los-tri-current* int) ;; unknown type -(define-extern *cam-debug-coll-tri* (inline-array cam-debug-tri)) ;; unknown type -(define-extern *cam-debug-coll-tri-current* int) ;; unknown type +(define-extern *camera-old-level* string) +(define-extern *camera-old-cpu* int) +(define-extern *camera-old-vu* int) +(define-extern *camera-old-tfrag-bytes* int) +(define-extern *camera-old-stat-string-tfrag-near* string) +(define-extern *camera-old-stat-string-tfrag* string) +(define-extern *camera-old-stat-string-total* string) +(define-extern *cam-collision-record-show* int) +(define-extern *cam-collision-record* cam-collision-record-array) +(define-extern *cam-collision-record-last* int) +(define-extern *cam-collision-record-first* int) +(define-extern *cam-debug-los-tri* (inline-array cam-debug-tri)) +(define-extern *cam-debug-los-tri-current* int) +(define-extern *cam-debug-coll-tri* (inline-array cam-debug-tri)) +(define-extern *cam-debug-coll-tri-current* int) ;; ---------------------- @@ -19956,10 +20477,10 @@ (define-extern camera-look-at (function pair uint process :behavior camera-tracker)) (define-extern camera-pov-from (function pair uint process :behavior camera-tracker)) (define-extern command-get-trans (function object vector vector)) ;; object types - null | symbol (null | target) | pair -(define-extern manipy-init (function vector entity skeleton-group vector none :behavior manipy)) ;; TODO - not confirmed yet +(define-extern manipy-init (function vector entity-actor skeleton-group vector none :behavior manipy)) ;; TODO - not confirmed yet (define-extern part-tracker-notify (function object :behavior part-tracker)) (define-extern clone-anim-once (function handle int symbol string none :behavior process-drawable)) -(define-extern convert-to-hud-object (function process-drawable hud none :behavior hud)) +(define-extern convert-to-hud-object (function process-drawable hud none :behavior process-drawable)) (define-extern clone-anim (function handle int symbol string none :behavior process-drawable)) (define-extern merc-eye-anim (function process-drawable none)) (define-extern ja-anim-done? (function process symbol)) @@ -20140,7 +20661,7 @@ (define-extern collide-shape-moving-angle-set! (function collide-shape-moving vector vector none)) (define-extern target-collision-low-coverage (function control-info collide-shape-intersect vector (pointer uint32) (pointer uint64) (pointer symbol) uint)) ;; i think the pointers are lies - TODO (define-extern poly-find-nearest-edge (function vector (inline-array vector) vector vector vector)) -(define-extern target-collision-reaction (function control-info collide-shape-intersect vector vector uint)) +(define-extern target-collision-reaction (function control-info collide-shape-intersect vector vector cshape-moving-flags)) (define-extern target-collision-no-reaction (function control-info collide-shape-intersect vector vector none)) @@ -20171,7 +20692,7 @@ (define-extern add-thrust (function symbol :behavior target)) (define-extern add-gravity (function vector :behavior target)) (define-extern do-rotations2 (function int :behavior target)) -(define-extern reverse-conversions (function vector uint :behavior target)) +(define-extern reverse-conversions (function vector none :behavior target)) (define-extern bend-gravity (function symbol :behavior target)) (define-extern post-flag-setup (function none :behavior target)) (define-extern joint-points (function none :behavior target)) @@ -20188,7 +20709,7 @@ (define-extern turn-around? (function symbol :behavior target)) (define-extern target-move-dist (function time-frame float :behavior target)) (define-extern target-compute-edge-rider (function none :behavior target)) -(define-extern target-post (function none)) +(define-extern target-post (function none :behavior target)) (define-extern target-swim-post (function none :behavior target)) (define-extern target-no-stick-post (function none :behavior target)) (define-extern target-no-move-post (function none :behavior target)) @@ -20213,7 +20734,7 @@ ;; - Unknowns (define-extern *sidekick-sg* skeleton-group) -(define-extern *sidekick-remap* pair) ;; unknown type +(define-extern *sidekick-remap* pair) ;; ---------------------- @@ -20274,7 +20795,7 @@ (define-extern target-bonk-event-handler (function process int symbol event-message-block object :behavior target)) (define-extern target-standard-event-handler (function process int symbol event-message-block object :behavior target)) (define-extern target-send-attack (function process uint uint int int symbol :behavior target)) ;; i suspect the uints are actually structures/basics -(define-extern target-attacked (function symbol attack-info process process (state handle attack-info target) object :behavior target)) ;; unconfirmed, target-tube::(event target-tube-start) +(define-extern target-attacked (function symbol attack-info process process (state symbol attack-info target) object :behavior target)) (define-extern target-apply-tongue (function vector symbol :behavior target)) (define-extern get-intersect-point (function vector touching-prims-entry control-info process vector)) (define-extern target-powerup-effect (function symbol none :behavior target)) @@ -20301,7 +20822,7 @@ (define-extern target-hit-ground-anim (function symbol symbol :behavior target)) (define-extern mod-var-jump (function symbol symbol symbol vector vector :behavior target)) (define-extern init-var-jump (function float float vector vector vector vector :behavior target)) ;; 1st and 2nd vectors may be symbols instead? -(define-extern target-falling-anim (function time-frame int symbol :behavior target)) +(define-extern target-falling-anim (function time-frame time-frame symbol :behavior target)) (define-extern target-falling-trans (function basic time-frame none :behavior target)) (define-extern target-falling-anim-trans (function none :behavior target)) ;; unconfirmed @@ -20342,7 +20863,7 @@ ;; - Functions (define-extern target-swim-tilt (function float float float float float :behavior target)) -(define-extern projectile-init-by-other (function entity vector vector uint handle none :behavior projectile)) ;; 4th arg is `options`, 5th is `last-target` +(define-extern projectile-init-by-other (function entity-actor vector vector uint handle none :behavior projectile)) ;; 4th arg is `options`, 5th is `last-target` (define-extern first-person-hud-init-by-other (function none :behavior first-person-hud)) (define-extern disable-hud (function int none)) (define-extern enable-hud (function none)) @@ -20353,8 +20874,8 @@ ;; - Unknowns -(define-extern *yellow-jump-mods* surface) ;; unknown type -(define-extern *fp-hud-stack* pointer) ;; first-person-hud maybe? +(define-extern *yellow-jump-mods* surface) +(define-extern *fp-hud-stack* pointer) ;; ---------------------- @@ -20380,11 +20901,11 @@ ;; - Unknowns -(define-extern *death-spool-array* (array spool-anim)) ;; unknown type +(define-extern *death-spool-array* (array spool-anim)) (define-extern *deathcam-sg* skeleton-group) -(define-extern *smack-mods* surface) ;; unknown type -(define-extern *smack-up-mods* surface) ;; unknown type -(define-extern *auto-continue* symbol) ;; unknown type +(define-extern *smack-mods* surface) +(define-extern *smack-up-mods* surface) +(define-extern *auto-continue* symbol) ;; ---------------------- @@ -20696,7 +21217,7 @@ ;; - Types (deftype collide-puls-work (structure) - ((ignore-pat uint32 :offset-assert 0) + ((ignore-pat pat-surface :offset-assert 0) (tri-out collide-tri-result :offset-assert 4) (bsphere sphere :inline :offset-assert 16) (move-dist vector :inline :offset-assert 32) @@ -20747,8 +21268,8 @@ ;; - Functions (define-extern task-control-reset (function symbol none)) -(define-extern init-entity (function process entity none)) -(define-extern birth-viewer (function process entity object)) +(define-extern init-entity (function process entity-actor none)) +(define-extern birth-viewer (function process entity-actor object)) (define-extern update-actor-vis-box (function process-drawable vector vector none)) (define-extern process-status-bits (function process symbol none)) (define-extern entity-by-meters (function float float float entity-actor)) @@ -20942,7 +21463,7 @@ ;; - Unknowns -(define-extern *footstep-surface* int) ;; unknown type +(define-extern *footstep-surface* int) ;; ---------------------- @@ -20961,7 +21482,7 @@ (define-extern check-water-level-drop (function sparticle-system sparticle-cpuinfo vector none)) (define-extern check-water-level-drop-and-die (function sparticle-system sparticle-cpuinfo vector none)) (define-extern check-water-level-above-and-die (function sparticle-system sparticle-cpuinfo vector none)) -(define-extern water-vol-init-by-other (function entity none :behavior water-vol)) +(define-extern water-vol-init-by-other (function entity-actor none :behavior water-vol)) ;; ---------------------- @@ -21026,8 +21547,6 @@ (initialize (_type_) _type_ 20) (initialize-params (_type_ time-frame float) none 21) ) - (:states - (hud-collecting handle)) ) (deftype eco-collectable (collectable) @@ -21221,11 +21740,11 @@ (define-extern check-blue-suck (function process-drawable none :behavior eco-collectable)) (define-extern initialize-eco-by-other (function vector vector fact-info none :behavior eco)) (define-extern add-blue-shake (function vector vector vector vector)) -(define-extern money-init-by-other (function vector vector fact-info entity none :behavior money)) -(define-extern money-init-by-other-no-bob (function vector vector fact-info float entity none :behavior money)) -(define-extern fuel-cell-init-by-other (function vector vector fact-info entity none :behavior fuel-cell)) +(define-extern money-init-by-other (function vector vector fact-info entity-actor none :behavior money)) +(define-extern money-init-by-other-no-bob (function vector vector fact-info float entity-actor none :behavior money)) +(define-extern fuel-cell-init-by-other (function vector vector fact-info entity-actor none :behavior fuel-cell)) (define-extern fuel-cell-init-as-clone (function handle int none :behavior fuel-cell)) -(define-extern buzzer-init-by-other (function vector vector fact-info entity none :behavior buzzer)) +(define-extern buzzer-init-by-other (function vector vector fact-info entity-actor none :behavior buzzer)) ;; - Symbols @@ -21436,6 +21955,9 @@ ;; - Unknowns +(define-extern hud-collecting (state handle process-drawable)) + + ;; ---------------------- ;; File - hud-classes @@ -21610,7 +22132,7 @@ ;; - Functions (define-extern adjust-pos (function int int int)) -(define-extern draw-percent-bar (function int int float int none)) +(define-extern draw-percent-bar (function int int float rgba none)) (define-extern print-language-name (function int font-context int symbol font-context)) (define-extern hide-progress-icons (function none)) @@ -21631,7 +22153,7 @@ (starting-state progress-screen :offset-assert 24) (last-slot-saved int32 :offset-assert 32) (slider-backup float :offset-assert 36) - (language-backup int64 :offset-assert 40) + (language-backup language-enum :offset-assert 40) (on-off-backup symbol :offset-assert 48) (center-x-backup int32 :offset-assert 52) (center-y-backup int32 :offset-assert 56) @@ -21707,10 +22229,10 @@ ;; - Functions -(define-extern projectile-collision-reaction (function collide-shape-moving collide-shape-intersect vector vector uint)) +(define-extern projectile-collision-reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags)) (define-extern projectile-update-velocity-space-wars (function projectile none)) (define-extern find-nearest-attackable (function vector float uint uint vector float projectile)) ;; Whatever te search returns (match from search-info) -(define-extern find-ground-and-draw-shadow (function vector vector float collide-kind process float float none)) +(define-extern find-ground-and-draw-shadow (function vector vector float collide-kind process-drawable float float none)) (define-extern spawn-projectile-blue (function target none)) ;; - Unknowns @@ -21758,8 +22280,8 @@ ;; - Unknowns -(define-extern *ocean-vu0-work* ocean-vu0-work) ;; unknown type -(define-extern ocean-vu0-block vu-function) ;; unknown type +(define-extern *ocean-vu0-work* ocean-vu0-work) +(define-extern ocean-vu0-block vu-function) ;; ---------------------- @@ -21782,7 +22304,7 @@ ;; - Unknowns (define-extern ocean-texture-vu1-block vu-function) -(define-extern *ocean-texture-work* ocean-texture-work) ;; unknown type +(define-extern *ocean-texture-work* ocean-texture-work) ;; ---------------------- @@ -21815,7 +22337,7 @@ ;; - Unknowns -(define-extern ocean-mid-block vu-function) ;; unknown type +(define-extern ocean-mid-block vu-function) ;; ---------------------- @@ -21856,7 +22378,7 @@ ;; - Unknowns -(define-extern ocean-near-block vu-function) ;; unknown type +(define-extern ocean-near-block vu-function) ;; ---------------------- @@ -22676,7 +23198,7 @@ (use-proximity-notice symbol :offset-assert 204) (use-jump-blocked symbol :offset-assert 208) (use-jump-patrol symbol :offset-assert 212) - (gnd-collide-with uint64 :offset-assert 216) + (gnd-collide-with collide-kind :offset-assert 216) (debug-draw-neck symbol :offset-assert 224) (debug-draw-jump symbol :offset-assert 228) ) @@ -22685,6 +23207,43 @@ :flag-assert #x9000000e8 ) +(defenum nav-enemy-flags + :bitfield #t + :type uint32 + (navenmf0 0) + (navenmf1 1) + (navenmf2 2) + (enable-rotate 3) + (enable-travel 4) + (navenmf5 5) + (navenmf6 6) + (navenmf7 7) + (navenmf8 8) + (standing-jump 9) + (drop-jump 10) + (navenmf11 11) + (navenmf12 12) + (navenmf13 13) + (navenmf14 14) + (navenmf15 15) + (navenmf16 16) + (navenmf17 17) + (navenmf18 18) + (navenmf19 19) + (navenmf20 20) + (navenmf21 21) + (navenmf22 22) + (navenmf23 23) + (navenmf24 24) + (navenmf25 25) + (navenmf26 26) + (navenmf27 27) + (navenmf28 28) + (navenmf29 29) + (navenmf30 30) + (navenmf31 31) + ) + (deftype nav-enemy (process-drawable) ((collide-info collide-shape-moving :score 100 :offset 112) (enemy-info fact-info-enemy :score 100 :offset 144) @@ -22693,22 +23252,22 @@ (frustration-point vector :inline :offset-assert 208) (jump-dest vector :inline :offset-assert 224) (jump-trajectory trajectory :inline :offset-assert 240) - (jump-time time-frame :offset-assert 280) + (jump-time time-frame :offset-assert 280) (nav-info nav-enemy-info :offset-assert 288) (target-speed float :offset-assert 292) (momentum-speed float :offset-assert 296) (acceleration float :offset-assert 300) (rotate-speed float :offset-assert 304) - (turn-time time-frame :offset-assert 312) - (frustration-time time-frame :offset-assert 320) + (turn-time time-frame :offset-assert 312) + (frustration-time time-frame :offset-assert 320) (speed-scale float :offset-assert 328) (neck joint-mod :offset-assert 332) - (reaction-time time-frame :offset-assert 336) - (notice-time time-frame :offset-assert 344) - (state-timeout time-frame :offset-assert 352) - (free-time time-frame :offset-assert 360) - (touch-time time-frame :offset-assert 368) - (nav-enemy-flags uint32 :offset-assert 376) + (reaction-time time-frame :offset-assert 336) + (notice-time time-frame :offset-assert 344) + (state-timeout time-frame :offset-assert 352) + (free-time time-frame :offset-assert 360) + (touch-time time-frame :offset-assert 368) + (nav-enemy-flags nav-enemy-flags :offset-assert 376) (incomming-attack-id handle :offset-assert 384) (jump-return-state (state process) :offset-assert 392) (rand-gen random-generator :offset-assert 396) @@ -22870,6 +23429,43 @@ ) ) +(defenum eco-door-flags + :bitfield #t + :type int32 + (ecdf00) + (ecdf01) + (auto-close) + (one-way) + (ecdf04) + (ecdf05) + (ecdf06) + (ecdf07) + (ecdf08) + (ecdf09) + (ecdf10) + (ecdf11) + (ecdf12) + (ecdf13) + (ecdf14) + (ecdf15) + (ecdf16) + (ecdf17) + (ecdf18) + (ecdf19) + (ecdf20) + (ecdf21) + (ecdf22) + (ecdf23) + (ecdf24) + (ecdf25) + (ecdf26) + (ecdf27) + (ecdf28) + (ecdf29) + (ecdf30) + (ecdf31) + ) + (deftype eco-door (process-drawable) ((root-override collide-shape :score 100 :offset 112) (speed float :offset-assert 176) @@ -22879,7 +23475,7 @@ (open-sound sound-name :offset-assert 208) (close-sound sound-name :offset-assert 224) (state-actor entity-actor :offset-assert 240) - (flags int32 :offset-assert 244) + (flags eco-door-flags :offset-assert 244) (locked symbol :offset-assert 248) (auto-close symbol :offset-assert 252) (one-way symbol :offset-assert 256) @@ -22974,7 +23570,7 @@ ;; - Functions -(define-extern basebutton-init-by-other (function basebutton vector quaternion entity-actor symbol float none :behavior basebutton)) +(define-extern basebutton-init-by-other (function entity-actor vector quaternion entity-actor symbol float none :behavior basebutton)) ;; - Unknowns @@ -23446,7 +24042,7 @@ ;; - Unknowns -(define-extern *ropebridge-tunings* (inline-array ropebridge-tuning)) ;; unknown type +(define-extern *ropebridge-tunings* (inline-array ropebridge-tuning)) (define-extern *ropebridge-70-rest-state* (inline-array vector)) ;; can't find ropebridges with these ids in the game?? (define-extern *ropebridge-52-rest-state* (inline-array vector)) (define-extern *ropebridge-32-rest-state* (inline-array vector)) @@ -23603,18 +24199,18 @@ ;; - Functions -(define-extern mistycannon-prebind-function (function mistycannon int mistycannon none)) +(define-extern mistycannon-prebind-function (function pointer int mistycannon none)) (define-extern mistycannon-postbind-function (function mistycannon none)) (define-extern angle-tracker-init-range! (function angle-tracker float float float none)) -(define-extern mistycannon-pick-random-target-point (function float :behavior mistycannon)) +(define-extern mistycannon-pick-random-target-point (function none :behavior mistycannon)) (define-extern angle-tracker-seek! (function angle-tracker float symbol)) (define-extern mistycannon-do-aim (function vector vector none :behavior mistycannon)) ;; can return a #f is postbindinfo-ok is false (define-extern mistycannon-find-trajectory (function trajectory-params none :behavior mistycannon)) (define-extern solve-missile-velocity (function trajectory-params float none)) (define-extern spawn-mistycannon-missile (function process-tree vector vector float float float float entity none)) (define-extern angle-tracker-apply-move! (function angle-tracker float float)) -(define-extern mistycannon-missile-init-by-other (function mistycannon-init-data entity none :behavior mistycannon-missile)) -(define-extern mistycannon-collision-reaction (function collide-shape-moving collide-shape-intersect vector vector uint)) +(define-extern mistycannon-missile-init-by-other (function mistycannon-init-data entity-actor none :behavior mistycannon-missile)) +(define-extern mistycannon-collision-reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags)) (define-extern angle-tracker-get-value (function angle-tracker float)) (define-extern angle-tracker-set-value (function angle-tracker float float)) (define-extern solve-missile-tilt (function quadratic-solution float float float float symbol)) @@ -23901,7 +24497,7 @@ (define-extern flutflutegg-hit-sounds (function none :behavior flutflutegg)) (define-extern bladeassm-prebind-function (function process-drawable int bladeassm event-message-block object)) ;; TODO - first arg is very likely wrong -(define-extern flying-rock-init-by-other (function vector vector float entity none :behavior flying-rock)) +(define-extern flying-rock-init-by-other (function vector vector float entity-actor none :behavior flying-rock)) (define-extern spawn-flying-rock (function vector vector float entity none)) (define-extern move-grottopole-to-position (function grottopole none)) (define-extern move-grottopole (function grottopole float none)) @@ -24134,7 +24730,7 @@ ;; - Functions -(define-extern lurkerworm-prebind-function (function process int lurkerworm none :behavior lurkerworm)) +(define-extern lurkerworm-prebind-function (function pointer int lurkerworm none :behavior lurkerworm)) (define-extern lurkerworm-joint-callback (function lurkerworm none)) (define-extern lurkerworm-default-event-handler (function process int symbol event-message-block object :behavior lurkerworm)) (define-extern lurkerworm-default-post-behavior (function none :behavior lurkerworm)) @@ -24320,7 +24916,7 @@ ;; - Functions (define-extern seagull-init-by-other (function vector int seagullflock none :behavior seagull)) -(define-extern seagull-reaction (function collide-shape-moving collide-shape-intersect vector vector uint)) +(define-extern seagull-reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags)) (define-extern seagull-post (function none :behavior seagull)) (define-extern beach-rock-trigger (function int)) @@ -25349,7 +25945,8 @@ ;; - Functions -(define-extern static-screen-spawn (function int int int int int symbol target (pointer process))) ;; target may differ +(declare-type static-screen process) +(define-extern static-screen-spawn (function int texture-id texture-id texture-id time-frame symbol process-tree (pointer static-screen))) ;; ---------------------- @@ -25375,7 +25972,7 @@ ;; - Functions -(define-extern static-screen-init-by-other (function int int int int time-frame symbol none :behavior static-screen)) +(define-extern static-screen-init-by-other (function int texture-id texture-id texture-id time-frame symbol none :behavior static-screen)) ;; ---------------------- @@ -25467,7 +26064,7 @@ ;; - Functions -(define-extern target-has-all-the-cells? (function symbol)) +(define-extern target-has-all-the-cells? (function symbol :behavior process)) ;; ---------------------- @@ -25542,12 +26139,12 @@ ;; - Functions -(define-extern light-eco-child-init-by-other (function entity vector vector int none :behavior light-eco-child)) +(define-extern light-eco-child-init-by-other (function entity-actor vector vector int none :behavior light-eco-child)) (define-extern check-drop-level-lighteco-big-pops (function sparticle-system sparticle-cpuinfo vector none)) (define-extern check-drop-level-lighteco-pops (function sparticle-system sparticle-cpuinfo vector none)) (define-extern light-eco-child-default-event-handler (function process int symbol event-message-block object :behavior light-eco-child)) (define-extern light-eco-mother-default-event-handler (function process int symbol event-message-block int :behavior light-eco-mother)) -(define-extern light-eco-mother-init-by-other (function entity vector none :behavior light-eco-mother)) +(define-extern light-eco-mother-init-by-other (function entity-actor vector none :behavior light-eco-mother)) ;; - Unknowns @@ -25740,7 +26337,7 @@ (define-extern robotboss-manipy-trans-hook (function none :behavior robotboss)) (define-extern ecoclaw-beam-particle-callback (function part-tracker none)) (define-extern ecoclaw-handler (function process int symbol event-message-block object :behavior ecoclaw)) -(define-extern finalbosscam-init-by-other (function entity none :behavior finalbosscam)) +(define-extern finalbosscam-init-by-other (function entity-actor none :behavior finalbosscam)) ;; - Unknowns @@ -25793,8 +26390,8 @@ ;; - Functions -(define-extern green-eco-lurker-init-by-other (function entity green-eco-lurker-gen vector none :behavior green-eco-lurker)) -(define-extern green-eco-lurker-gen-init-by-other (function entity vector int none :behavior green-eco-lurker-gen)) +(define-extern green-eco-lurker-init-by-other (function entity-actor green-eco-lurker-gen vector none :behavior green-eco-lurker)) +(define-extern green-eco-lurker-gen-init-by-other (function entity-actor vector int none :behavior green-eco-lurker-gen)) ;; - Unknowns @@ -25842,7 +26439,7 @@ (define-extern robotboss-yellow-eco-off (function entity-perm-status :behavior robotboss)) (define-extern robotboss-greenshot (function vector float int symbol none :behavior robotboss)) (define-extern robotboss-handler (function process int symbol event-message-block object :behavior robotboss)) -(define-extern robotboss-darkecobomb (function vector float (pointer process) :behavior robotboss)) +(define-extern robotboss-darkecobomb (function vector float (pointer part-tracker) :behavior robotboss)) (define-extern robotboss-is-red-hit (function symbol :behavior robotboss)) (define-extern robotboss-redshot-fill-array (function redshot-launch-array none :behavior robotboss)) (define-extern robotboss-redshot (function redshot-launch-info symbol sound-id :behavior robotboss)) ;; run-func-in-process edge-case @@ -25923,7 +26520,7 @@ ;; - Functions -(define-extern powercellalt-init-by-other (function entity vector vector int none :behavior powercellalt)) +(define-extern powercellalt-init-by-other (function entity-actor vector vector int none :behavior powercellalt)) ;; - Unknowns @@ -26014,7 +26611,7 @@ ;; - Types (deftype evilbro (process-taskable) - ((evilsis entity :offset-assert 380) + ((evilsis entity-actor :offset-assert 380) ) :method-count-assert 53 :heap-base #x110 @@ -26159,6 +26756,11 @@ (plant-boss-arm-hit basic) plant-boss-back-arms-idle plant-boss-arm-idle + (plant-boss-root-die symbol) + (plant-boss-vine-die symbol) + (plant-boss-vine-hit basic) + plant-boss-vine-idle + plant-boss-root-idle ) ) @@ -26209,12 +26811,7 @@ :size-assert #x124 :flag-assert #x1400c00124 (:states - (plant-boss-root-die symbol) - (plant-boss-vine-die symbol) - (plant-boss-vine-hit basic) plant-boss-eat - plant-boss-vine-idle - plant-boss-root-idle (plant-boss-dead symbol) plant-boss-far-idle plant-boss-dead-idle @@ -26242,7 +26839,7 @@ ;; - Unknowns (define-extern *plant-boss-sg* skeleton-group) -(define-extern *plant-boss-shadow-control* shadow-control) ;; unknown type +(define-extern *plant-boss-shadow-control* shadow-control) (define-extern *plant-boss-leaf-sg* skeleton-group) (define-extern *plant-boss-root-sg* skeleton-group) (define-extern *plant-boss-vine-sg* skeleton-group) @@ -26607,7 +27204,7 @@ ;; - Unknowns -(define-extern ripple-for-jungle-water ripple-wave-set) ;; unknown type +(define-extern ripple-for-jungle-water ripple-wave-set) (define-extern *jngpusher-sg* skeleton-group) (define-extern *sidedoor-sg* skeleton-group) (define-extern *maindoor-sg* skeleton-group) @@ -26862,8 +27459,8 @@ (define-extern *fish-net-sg* skeleton-group) (define-extern *fisher-sg* skeleton-group) -(define-extern *FISHER-bank* fisher-bank) ;; unknown type -(define-extern *fisher-params* (array (inline-array fisher-params))) ;; unknown type +(define-extern *FISHER-bank* fisher-bank) +(define-extern *fisher-params* (array (inline-array fisher-params))) (define-extern *catch-fishc-sg* skeleton-group) (define-extern *catch-fishb-sg* skeleton-group) (define-extern *catch-fisha-sg* skeleton-group) @@ -27046,7 +27643,7 @@ ;; - Unknowns -(define-extern *RACER-bank* racer-bank) ;; unknown type +(define-extern *RACER-bank* racer-bank) (define-extern *balloon-sg* skeleton-group) @@ -27118,7 +27715,7 @@ ;; - Functions -(define-extern blocking-plane-spawn (function curve-control none)) +(define-extern blocking-plane-spawn (function curve-control none :behavior process)) (define-extern racer-effect (function none :behavior racer)) (define-extern blocking-plane-destroy (function none)) @@ -27137,7 +27734,7 @@ ;; - Functions -(define-extern racer-collision-reaction (function control-info collide-shape-intersect vector vector uint)) +(define-extern racer-collision-reaction (function control-info collide-shape-intersect vector vector cshape-moving-flags)) (define-extern racer-service-slide (function none :behavior target)) (define-extern racer-xz (function float float none :behavior target)) (define-extern racer-thrust (function basic float none :behavior target)) @@ -27153,14 +27750,14 @@ (define-extern racer-buzz (function float none :behavior target)) (define-extern target-racing-center-anim (function none :behavior target)) (define-extern target-racing-turn-anim (function none :behavior target)) -(define-extern target-racing-jump-anim (function basic int none :behavior target)) +(define-extern target-racing-jump-anim (function basic time-frame none :behavior target)) (define-extern target-racing-land-anim (function symbol none :behavior target)) (define-extern target-racing-post (function none :behavior target)) ;; - Unknowns -(define-extern *racer-mods* surface) ;; unknown type -(define-extern *racer-air-mods* surface) ;; unknown type +(define-extern *racer-mods* surface) +(define-extern *racer-air-mods* surface) ;; ---------------------- @@ -27257,7 +27854,7 @@ ;; - Types (deftype flut-info (basic) - ((entity basic :offset-assert 4) + ((entity entity-actor :offset-assert 4) (flut-trans vector :inline :offset-assert 16) (flut-quat vector :inline :offset-assert 32) (flut-scale vector :inline :offset-assert 48) @@ -27292,12 +27889,12 @@ ;; - Unknowns -(define-extern *flut-air-attack-mods* surface) ;; unknown type -(define-extern *FLUT-bank* flut-bank) ;; unknown type -(define-extern *flut-run-attack-mods* surface) ;; unknown type -(define-extern *flut-jump-mods* surface) ;; unknown type -(define-extern *flut-walk-mods* surface) ;; unknown type -(define-extern *flut-double-jump-mods* surface) ;; unknown type +(define-extern *flut-air-attack-mods* surface) +(define-extern *FLUT-bank* flut-bank) +(define-extern *flut-run-attack-mods* surface) +(define-extern *flut-jump-mods* surface) +(define-extern *flut-walk-mods* surface) +(define-extern *flut-double-jump-mods* surface) ;; ---------------------- @@ -27675,6 +28272,17 @@ :flag-assert #x1e007000dc ) +(deftype evilplant (process-drawable) + () + :method-count-assert 21 + :size-assert #xb0 + :heap-base #x40 + :flag-assert #x15004000b0 + (:methods + (idle () _type_ :state 20) + ) + ) + ;; - Functions (define-extern set-period (function cyclegen int float)) @@ -27685,7 +28293,7 @@ ;; - Unknowns -(define-extern ripple-for-villagea-water ripple-wave-set) ;; unknown type +(define-extern ripple-for-villagea-water ripple-wave-set) (define-extern *revcycle-sg* skeleton-group) (define-extern *revcycleprop-sg* skeleton-group) (define-extern *hutlamp-sg* skeleton-group) @@ -27708,6 +28316,7 @@ (define-extern *med-res-village12-sg* skeleton-group) (define-extern *med-res-village13-sg* skeleton-group) (define-extern *med-res-training-sg* skeleton-group) +(define-extern *evilplant-sg* skeleton-group) ;; ---------------------- @@ -27841,9 +28450,9 @@ (define-extern *fb-evilbro-sg* skeleton-group) (define-extern *fb-evilsis-sg* skeleton-group) (define-extern *fishermans-boat-sg* skeleton-group) -(define-extern *boat-turning-radius-table* (pointer float)) ;; unknown type -(define-extern *boat-throttle-control-table* (pointer float)) ;; unknown type -(define-extern *fishermans-boat-constants* rigid-body-platform-constants) ;; unknown type +(define-extern *boat-turning-radius-table* (pointer float)) +(define-extern *boat-throttle-control-table* (pointer float)) +(define-extern *fishermans-boat-constants* rigid-body-platform-constants) ;; ---------------------- @@ -27901,7 +28510,7 @@ ;; - Functions -(define-extern sequenceA-village1-init-by-other (function entity none :behavior sequenceA-village1)) +(define-extern sequenceA-village1-init-by-other (function entity-actor none :behavior sequenceA-village1)) (define-extern sequenceA-village1-trans-hook (function none :behavior sequenceA-village1)) ;; - Unknowns @@ -27995,9 +28604,9 @@ (define-extern *scarecrow-a-break-sg* skeleton-group) (define-extern *tra-iris-door-sg* skeleton-group) (define-extern *tra-pontoon-sg* skeleton-group) -(define-extern *tra-pontoon-constants* rigid-body-platform-constants) ;; unknown type +(define-extern *tra-pontoon-constants* rigid-body-platform-constants) (define-extern *training-cam-sg* skeleton-group) -(define-extern ripple-for-training-water ripple-wave-set) ;; unknown type +(define-extern ripple-for-training-water ripple-wave-set) ;; ---------------------- @@ -28159,7 +28768,7 @@ (define-extern *mistycam-sg* skeleton-group) (define-extern *mis-bone-platform-sg* skeleton-group) -(define-extern *bone-platform-constants* rigid-body-platform-constants) ;; unknown type +(define-extern *bone-platform-constants* rigid-body-platform-constants) (define-extern *breakaway-left-sg* skeleton-group) (define-extern *breakaway-mid-sg* skeleton-group) (define-extern *breakaway-right-sg* skeleton-group) @@ -28265,8 +28874,8 @@ ;; - Functions (define-extern keg-conveyor-paddle-init-by-other (function keg-conveyor-paddle none :behavior keg-conveyor-paddle)) -(define-extern keg-conveyor-spawn-keg (function keg-conveyor (pointer process))) ;; VERY likely a keg -(define-extern keg-conveyor-spawn-bouncing-keg (function keg-conveyor (pointer process))) ;; VERY likely a keg +(define-extern keg-conveyor-spawn-keg (function keg-conveyor (pointer keg))) +(define-extern keg-conveyor-spawn-bouncing-keg (function keg-conveyor (pointer keg))) (define-extern keg-init-by-other (function keg int none :behavior keg)) (define-extern keg-bounce-set-particle-rotation-callback (function part-tracker none)) (define-extern keg-update-smush (function keg float none)) @@ -28277,7 +28886,7 @@ (define-extern *keg-conveyor-sg* skeleton-group) (define-extern *keg-conveyor-paddle-sg* skeleton-group) -(define-extern *keg-conveyor-keg-spawn-table* (array int8)) ;; unknown type +(define-extern *keg-conveyor-keg-spawn-table* (array int8)) (define-extern *keg-sg* skeleton-group) @@ -28299,8 +28908,8 @@ ;; - Unknowns -(define-extern ripple-for-mud ripple-wave-set) ;; unknown type -(define-extern ripple-for-small-mud ripple-wave-set) ;; unknown type +(define-extern ripple-for-mud ripple-wave-set) +(define-extern ripple-for-small-mud ripple-wave-set) ;; ---------------------- @@ -28451,11 +29060,11 @@ ;; - Functions (define-extern orient-to-face-target (function quaternion :behavior quicksandlurker)) -(define-extern quicksandlurker-spit (function (pointer process) :behavior quicksandlurker)) -(define-extern spawn-quicksandlurker-missile (function process vector vector entity none)) +(define-extern quicksandlurker-spit (function (pointer part-tracker) :behavior quicksandlurker)) +(define-extern spawn-quicksandlurker-missile (function process vector vector entity-actor none)) (define-extern quicksandlurker-check-hide-transition (function none :behavior quicksandlurker)) (define-extern inc-angle (function (pointer float) float float)) -(define-extern quicksandlurker-missile-init-by-other (function quicksandlurker-missile-init-data entity none :behavior quicksandlurker-missile)) +(define-extern quicksandlurker-missile-init-by-other (function quicksandlurker-missile-init-data entity-actor none :behavior quicksandlurker-missile)) (define-extern get-height-over-navmesh! function) ;; unused (define-extern intersects-nav-mesh? (function nav-control vector symbol)) ;; unused (define-extern quicksandlurker-default-event-handler (function process int symbol event-message-block object :behavior quicksandlurker)) @@ -28528,10 +29137,10 @@ (explosion-force vector :inline :offset-assert 752) (explosion symbol :offset-assert 768) (explosion-joint-index uint16 2 :offset-assert 772) - (explosion-joint-index-bytes int8 4 :offset 772) ;; added overlay + (explosion-joint-index-bytes int8 4 :score 50 :offset 772) ;; added overlay (vulnerable symbol :offset-assert 776) (water-y float :offset-assert 780) - (propeller joint-mod-set-local :offset-assert 784) + (propeller joint-mod-spinner :offset-assert 784) (rudder joint-mod-set-local :offset-assert 788) (mine joint-mod-set-world 2 :offset-assert 792) (buoyancy-factor float :offset-assert 800) @@ -28589,10 +29198,10 @@ ;; - Unknowns (define-extern *balloonlurker-sg* skeleton-group) -(define-extern *balloonlurker-constants* rigid-body-platform-constants) ;; unknown type +(define-extern *balloonlurker-constants* rigid-body-platform-constants) (define-extern *balloonlurker-pilot-sg* skeleton-group) -(define-extern *BALLOONLURKER-bank* balloonlurker-bank) ;; unknown type -(define-extern *balloonlurker-rudder-joint-home* vector) ;; unknown type +(define-extern *BALLOONLURKER-bank* balloonlurker-bank) +(define-extern *balloonlurker-rudder-joint-home* vector) ;; ---------------------- @@ -28673,7 +29282,7 @@ (define-extern *darkecocan-sg* skeleton-group) (define-extern *darkecocan-glow-sg* skeleton-group) -(define-extern *lurker-army* (array army-info)) ;; unknown type +(define-extern *lurker-army* (array army-info)) (define-extern *evilbro-sg* skeleton-group) (define-extern *evilsis-sg* skeleton-group) @@ -28881,16 +29490,16 @@ ;; - Unknowns -(define-extern ripple-for-villageb-water ripple-wave-set) ;; unknown type +(define-extern ripple-for-villageb-water ripple-wave-set) (define-extern *ogreboss-village2-sg* skeleton-group) (define-extern *fireboulder-sg* skeleton-group) (define-extern *exit-chamber-dummy-sg* skeleton-group) (define-extern *ceilingflag-sg* skeleton-group) (define-extern *allpontoons-sg* skeleton-group) (define-extern *pontoonten-sg* skeleton-group) -(define-extern *pontoonten-constants* rigid-body-platform-constants) ;; unknown type +(define-extern *pontoonten-constants* rigid-body-platform-constants) (define-extern *pontoonfive-sg* skeleton-group) -(define-extern *pontoonfive-constants* rigid-body-platform-constants) ;; unknown type +(define-extern *pontoonfive-constants* rigid-body-platform-constants) (define-extern *village2cam-sg* skeleton-group) (define-extern *med-res-rolling-sg* skeleton-group) (define-extern *med-res-rolling1-sg* skeleton-group) @@ -29163,7 +29772,7 @@ ;; - Functions (define-extern swamp-rope-init-by-other (function vector entity-actor none :behavior swamp-rope)) -(define-extern swamp-blimp-setup (function none :behavior swamp-blimp)) +(define-extern swamp-blimp-setup (function int :behavior swamp-blimp)) (define-extern tetherrock-get-info (function entity tetherrock-info)) (define-extern swamp-rope-post (function none :behavior swamp-rope)) (define-extern swamp-rope-break-code (function quaternion :behavior swamp-rope)) @@ -29176,7 +29785,7 @@ ;; - Unknowns (define-extern *swamp-blimp-sg* skeleton-group) -(define-extern *SWAMP_BLIMP-bank* swamp-blimp-bank) ;; unknown type +(define-extern *SWAMP_BLIMP-bank* swamp-blimp-bank) (define-extern *swamp-rope-sg* skeleton-group) (define-extern *precursor-arm-sg* skeleton-group) (define-extern *swamp-tetherrock-sg* skeleton-group) @@ -29403,7 +30012,7 @@ (define-extern *swampcam-sg* skeleton-group) (define-extern *tar-plat-sg* skeleton-group) -(define-extern *tar-plat-constants* rigid-body-platform-constants) ;; unknown type +(define-extern *tar-plat-constants* rigid-body-platform-constants) (define-extern *swamp-rock-sg* skeleton-group) (define-extern *balance-plat-sg* skeleton-group) (define-extern *swamp-spike-sg* skeleton-group) @@ -29632,7 +30241,7 @@ ;; - Functions (define-extern swamp-rat-nest-check-dummy (function none :behavior swamp-rat-nest)) -(define-extern swamp-rat-nest-spawn-rat (function (pointer process) :behavior swamp-rat-nest)) ;; this needs a t2 symbol arg to pass to swamp-rat-init-from-other...but +(define-extern swamp-rat-nest-spawn-rat (function (pointer swamp-rat) :behavior swamp-rat-nest)) ;; this needs a t2 symbol arg to pass to swamp-rat-init-from-other...but (define-extern swamp-rat-nest-dummy-init-by-other (function swamp-rat-nest-dummy none :behavior swamp-rat-nest-dummy)) (define-extern swamp-rat-nest-pick-spawn-joint (function int :behavior swamp-rat-nest)) (define-extern swamp-rat-nest-dummy-take-damage (function int none :behavior swamp-rat-nest-dummy)) @@ -29734,7 +30343,7 @@ (define-extern kermit-get-new-patrol-point (function vector :behavior kermit)) (define-extern kermit-long-hop (function symbol :behavior kermit)) (define-extern kermit-short-hop (function symbol :behavior kermit)) -(define-extern kermit-pulse-init-by-other (function vector entity none :behavior kermit-pulse)) +(define-extern kermit-pulse-init-by-other (function vector entity-actor none :behavior kermit-pulse)) (define-extern joint-mod-tracker-callback (function cspace transformq none)) (define-extern build-matrix-from-up-and-forward-axes! (function matrix vector int vector int matrix)) (define-extern kermit-get-head-dir (function kermit vector vector)) @@ -29887,7 +30496,7 @@ ;; - Unknowns -(define-extern *cavecrystal-engine* engine) ;; unknown type +(define-extern *cavecrystal-engine* engine) ;; ---------------------- @@ -30022,7 +30631,7 @@ (define-extern *cavespatula-sg* skeleton-group) (define-extern *cavetrapdoor-sg* skeleton-group) (define-extern *cavecrusher-sg* skeleton-group) -(define-extern ripple-for-cave-water ripple-wave-set) ;; unknown type +(define-extern ripple-for-cave-water ripple-wave-set) (define-extern *maincavecam-sg* skeleton-group) @@ -30123,8 +30732,8 @@ (define-extern *dark-crystal-sg* skeleton-group) (define-extern *dark-crystal-explode-sg* skeleton-group) -(define-extern *dark-crystal-exploder-params* joint-exploder-static-params) ;; unknown type -(define-extern *dark-crystal-flash-delays* (array int32)) ;; unknown type +(define-extern *dark-crystal-exploder-params* joint-exploder-static-params) +(define-extern *dark-crystal-flash-delays* (array int32)) ;; ---------------------- @@ -30372,7 +30981,7 @@ ;; - Functions -(define-extern mother-spider-egg-init-by-other (function entity vector vector vector none :behavior mother-spider-egg)) +(define-extern mother-spider-egg-init-by-other (function entity-actor vector vector vector none :behavior mother-spider-egg)) ;; - Unknowns @@ -30420,8 +31029,8 @@ ;; - Unknowns (define-extern *mother-spider-sg* skeleton-group) -(define-extern *mother-spider-threads* (inline-array mother-spider-thread)) ;; unknown type -(define-extern *mother-spider-leg-infos* (inline-array mother-spider-leg-info)) ;; unknown type +(define-extern *mother-spider-threads* (inline-array mother-spider-thread)) +(define-extern *mother-spider-leg-infos* (inline-array mother-spider-leg-info)) (define-extern *mother-spider-leg-sg* skeleton-group) @@ -30541,7 +31150,7 @@ ;; - Unknowns (define-extern *gnawer-sg* skeleton-group) -(define-extern *gnawer-segment-infos* (inline-array gnawer-segment-info)) ;; unknown type +(define-extern *gnawer-segment-infos* (inline-array gnawer-segment-info)) (define-extern *gnawer-segment-sg* skeleton-group) @@ -30612,7 +31221,7 @@ ;; - Unknowns (define-extern *driller-lurker-sg* skeleton-group) -(define-extern *driller-lurker-shadow-control* shadow-control) ;; unknown type +(define-extern *driller-lurker-shadow-control* shadow-control) ;; ---------------------- @@ -30698,11 +31307,11 @@ ;; - Unknowns -(define-extern *tube-jump-mods* surface) ;; unknown type -(define-extern *tube-mods* surface) ;; unknown type -(define-extern *tube-surface* surface) ;; unknown type -(define-extern *tube-hit-mods* surface) ;; unknown type -(define-extern *TUBE-bank* tube-bank) ;; unknown type +(define-extern *tube-jump-mods* surface) +(define-extern *tube-mods* surface) +(define-extern *tube-surface* surface) +(define-extern *tube-hit-mods* surface) +(define-extern *TUBE-bank* tube-bank) ;; ---------------------- @@ -30753,7 +31362,7 @@ ;; - Unknowns (define-extern *seaweed-sg* skeleton-group) -(define-extern *seaweed* seaweed) ;; unknown type +(define-extern *seaweed* seaweed) (define-extern *side-to-side-plat-sg* skeleton-group) (define-extern *sunkencam-sg* skeleton-group) @@ -30781,7 +31390,7 @@ ;; - Unknowns (define-extern *shover-sg* skeleton-group) -(define-extern *shover* shover) ;; unknown type +(define-extern *shover* shover) ;; ---------------------- @@ -30948,7 +31557,7 @@ ;; - Functions -(define-extern orbit-plat-bottom-init-by-other (function entity orbit-plat none :behavior orbit-plat-bottom)) +(define-extern orbit-plat-bottom-init-by-other (function entity-actor orbit-plat none :behavior orbit-plat-bottom)) (define-extern get-rotate-point! (function vector vector vector vector float float vector)) (define-extern get-nav-point! (function vector orbit-plat vector float vector)) @@ -31108,13 +31717,13 @@ ;; - Functions -(define-extern qbert-plat-on-init-by-other (function entity qbert-plat none :behavior qbert-plat)) +(define-extern qbert-plat-on-init-by-other (function entity-actor qbert-plat none :behavior qbert-plat)) (define-extern qbert-plat-event-handler (function process int symbol event-message-block object :behavior qbert-plat)) ;; - Unknowns (define-extern *qbert-plat-sg* skeleton-group) -(define-extern *qbert-plat-constants* rigid-body-platform-constants) ;; unknown type +(define-extern *qbert-plat-constants* rigid-body-platform-constants) (define-extern *qbert-plat-on-sg* skeleton-group) @@ -31272,7 +31881,7 @@ ;; - Functions (define-extern exit-chamber-button-init-by-other (function vector quaternion entity-actor symbol none :behavior exit-chamber-button)) -(define-extern blue-eco-charger-orb-init-by-other (function entity blue-eco-charger-orb none :behavior blue-eco-charger-orb)) +(define-extern blue-eco-charger-orb-init-by-other (function entity-actor blue-eco-charger-orb none :behavior blue-eco-charger-orb)) ;; - Unknowns @@ -31338,7 +31947,7 @@ ;; - Unknowns -(define-extern ripple-for-sunken-water ripple-wave-set) ;; unknown type +(define-extern ripple-for-sunken-water ripple-wave-set) ;; ---------------------- @@ -31361,7 +31970,7 @@ :heap-base #x60 :flag-assert #x15006000cc (:methods - (dummy-20 (_type_ float) uint 20) + (dummy-20 (_type_ float) cshape-moving-flags 20) ) (:states (whirlpool-idle)) @@ -31492,7 +32101,7 @@ ;; - Functions -(define-extern bully-broken-cage-init-by-other (function entity none :behavior bully-broken-cage)) +(define-extern bully-broken-cage-init-by-other (function entity-actor none :behavior bully-broken-cage)) (define-extern bully-default-event-handler (function process int symbol event-message-block object :behavior bully)) (define-extern bully-post (function none :behavior bully)) @@ -31638,11 +32247,11 @@ ;; - Unknowns -(define-extern *helix-water* helix-water) ;; unknown type +(define-extern *helix-water* helix-water) (define-extern *helix-button-sg* skeleton-group) -(define-extern *helix-button* helix-button) ;; unknown type +(define-extern *helix-button* helix-button) (define-extern *helix-slide-door-sg* skeleton-group) -(define-extern *helix-slide-door* helix-slide-door) ;; unknown type +(define-extern *helix-slide-door* helix-slide-door) ;; ---------------------- @@ -31777,7 +32386,7 @@ ;; - Functions -(define-extern sunkenfisha-init-by-other (function entity none :behavior sunkenfisha)) +(define-extern sunkenfisha-init-by-other (function entity-actor none :behavior sunkenfisha)) ;; - Unknowns @@ -31964,14 +32573,18 @@ (define-extern gorge-trans (function none)) (define-extern gorge-start-draw-time (function symbol symbol none :behavior gorge-start)) (define-extern gorge-behind (function gorge symbol)) -(define-extern seconds->race-time (function race-time time-frame int)) -(define-extern race-time-read (function race-time int task-control time-frame symbol)) +(define-extern seconds->race-time (function race-time time-frame none)) +;; PAL version is better +;;(define-extern race-time-read (function race-time int task-control time-frame none)) +(define-extern race-time-read (function race-time task-control time-frame none)) (define-extern rolling-start-init-by-other (function vector float none :behavior rolling-start)) (define-extern gorge-finish-init-by-other (function vector vector float none :behavior gorge-finish)) (define-extern gorge-abort-init-by-other (function vector vector float none :behavior gorge-abort)) (define-extern race-time->string (function race-time string)) (define-extern race-time-less-than (function race-time race-time symbol)) -(define-extern race-time-save (function race-time int task-control symbol)) +;; PAL version is better +;;(define-extern race-time-save (function race-time int task-control symbol)) +(define-extern race-time-save (function race-time task-control symbol)) (define-extern dark-plants-all-done (function dark-plant symbol)) (define-extern dark-plant-randomize (function dark-plant vector)) (define-extern dark-plant-check-target (function dark-plant symbol)) @@ -31983,7 +32596,7 @@ ;; - Unknowns -(define-extern ripple-for-rolling-water object) ;; unknown type +(define-extern ripple-for-rolling-water object) (define-extern *rolling-start-whole-sg* skeleton-group) (define-extern *rolling-start-broken-sg* skeleton-group) (define-extern *happy-plant-sg* skeleton-group) @@ -32092,7 +32705,7 @@ (define-extern *lightning-mole-sg* skeleton-group) (define-extern *lightning-mole-nav-enemy-info* nav-enemy-info) -(define-extern *lightning-mole-hole* vector) ;; unknown type +(define-extern *lightning-mole-hole* vector) ;; ---------------------- @@ -32407,20 +33020,20 @@ (define-extern ogreboss-spawn-super-boulder (function none :behavior ogreboss)) (define-extern ogreboss-update-shuffling (function none :behavior ogreboss)) (define-extern ogreboss-player-inside-range? (function float symbol :behavior ogreboss)) -(define-extern ogreboss-super-boulder-init-by-other (function vector float entity none :behavior ogreboss-super-boulder)) +(define-extern ogreboss-super-boulder-init-by-other (function vector float entity-actor none :behavior ogreboss-super-boulder)) (define-extern ogreboss-set-stage2-camera (function none)) (define-extern ogreboss-move-far (function time-frame float none :behavior ogreboss)) (define-extern ogreboss-roll-boulder (function none :behavior ogreboss)) (define-extern ogreboss-update-super-boulder (function none :behavior ogreboss)) (define-extern ogreboss-blend-hit-anim (function none :behavior ogreboss)) -(define-extern ogreboss-bounce-boulder-init-by-other (function int entity none :behavior ogreboss-bounce-boulder)) +(define-extern ogreboss-bounce-boulder-init-by-other (function int entity-actor none :behavior ogreboss-bounce-boulder)) (define-extern ogreboss-set-stage1-camera (function none)) (define-extern ogreboss-move-near (function time-frame float none :behavior ogreboss)) -(define-extern ogreboss-shoot-boulder (function int none :behavior ogreboss)) +(define-extern ogreboss-shoot-boulder (function pickup-type none :behavior ogreboss)) (define-extern ogreboss-inc-try-count (function none :behavior ogreboss)) (define-extern ogreboss-emerge (function float none :behavior ogreboss)) (define-extern ogreboss-pick-target (function int :behavior ogreboss)) -(define-extern ogreboss-missile-init-by-other (function ogreboss-missile-init-data entity none :behavior ogreboss-missile)) +(define-extern ogreboss-missile-init-by-other (function ogreboss-missile-init-data entity-actor none :behavior ogreboss-missile)) (define-extern ogreboss-idle-loop (function none :behavior ogreboss)) (define-extern ogreboss-super-boulder-impact-effect (function none :behavior ogreboss-super-boulder)) (define-extern ogreboss-super-boulder-play-hit-anim (function object :behavior ogreboss-super-boulder)) @@ -32434,15 +33047,15 @@ ;; - Unknowns (define-extern *ogreboss-sg* skeleton-group) -(define-extern *ogreboss* ogreboss) ;; unknown type +(define-extern *ogreboss* ogreboss) (define-extern *ogreboss-cam-sg* skeleton-group) (define-extern *ogreboss-column-sg* skeleton-group) (define-extern *ogreboss-bounce-boulder-sg* skeleton-group) (define-extern *ogreboss-super-boulder-sg* skeleton-group) (define-extern *ogreboss-shoot-boulder-sg* skeleton-group) -(define-extern *ogreboss-missile-shadow-control* shadow-control) ;; unknown type +(define-extern *ogreboss-missile-shadow-control* shadow-control) (define-extern *ogreboss-shoot-boulder-break-sg* skeleton-group) -(define-extern *ogreboss-shadow-control* shadow-control) ;; unknown type +(define-extern *ogreboss-shadow-control* shadow-control) ;; ---------------------- @@ -32608,17 +33221,17 @@ (define-extern *shortcut-boulder-whole-sg* skeleton-group) (define-extern *shortcut-boulder-broken-sg* skeleton-group) -(define-extern ripple-for-ogre-lava ripple-wave-set) ;; unknown type +(define-extern ripple-for-ogre-lava ripple-wave-set) (define-extern *ogre-bridgeend-sg* skeleton-group) (define-extern *ogre-bridge-sg* skeleton-group) -(define-extern *ogre-bridge-joint-array* (array uint8)) ;; unknown type +(define-extern *ogre-bridge-joint-array* (array uint8)) (define-extern *ogre-isle-d-sg* skeleton-group) (define-extern *ogre-isle-b-sg* skeleton-group) -(define-extern *ogre-isle-constants* rigid-body-platform-constants) ;; unknown type +(define-extern *ogre-isle-constants* rigid-body-platform-constants) (define-extern *ogre-step-b-sg* skeleton-group) (define-extern *ogre-step-c-sg* skeleton-group) (define-extern *ogre-step-a-sg* skeleton-group) -(define-extern *ogre-step-constants* rigid-body-platform-constants) ;; unknown type +(define-extern *ogre-step-constants* rigid-body-platform-constants) (define-extern *tntbarrel-sg* skeleton-group) (define-extern *med-res-snow-sg* skeleton-group) (define-extern *ogre-isle-a-sg* skeleton-group) @@ -32761,7 +33374,7 @@ :flag-assert #x16004000b0 (:methods (idle () _type_ :state 20) - (active (basic symbol) _type_ :state 21) + (active (handle symbol) _type_ :state 21) ) ) @@ -32781,7 +33394,7 @@ (define-extern *gondolacables-sg* skeleton-group) (define-extern *pistons-sg* skeleton-group) (define-extern *gondola-sg* skeleton-group) -(define-extern ripple-for-villagec-lava ripple-wave-set) ;; unknown type +(define-extern ripple-for-villagec-lava ripple-wave-set) (define-extern *med-res-ogre-sg* skeleton-group) (define-extern *med-res-ogre2-sg* skeleton-group) (define-extern *med-res-ogre3-sg* skeleton-group) @@ -33210,7 +33823,7 @@ (define-extern *snow-ball-sg* skeleton-group) (define-extern *snow-ball-shadow-sg* skeleton-group) -(define-extern *snow-ball-shadow-control* shadow-control) ;; unknown type +(define-extern *snow-ball-shadow-control* shadow-control) ;; ---------------------- @@ -33407,6 +34020,7 @@ (deftype snow-button (process-drawable) ((root-override collide-shape-moving :score 100 :offset 112) (wiggled? symbol :offset-assert 176) + (trying-for-fuel-cell? symbol :offset-assert 180) ;; PAL patch here (timeout time-frame :offset-assert 184) (delay-til-wiggle time-frame :offset-assert 192) (prev-button entity-actor :offset-assert 200) @@ -33599,7 +34213,7 @@ ;; - Unknowns -(define-extern *ram-boss-nav-enemy-info-no-shield* nav-enemy-info) ;; unknown type +(define-extern *ram-boss-nav-enemy-info-no-shield* nav-enemy-info) (define-extern *ram-boss-sg* skeleton-group) (define-extern *ram-boss-nav-enemy-info* nav-enemy-info) @@ -34082,8 +34696,8 @@ ;; - Functions -(define-extern logo-slave-init-by-other (function entity skeleton-group none :behavior logo-slave)) -(define-extern logo-init-by-other (function entity vector symbol none :behavior logo)) +(define-extern logo-slave-init-by-other (function entity-actor skeleton-group none :behavior logo-slave)) +(define-extern logo-init-by-other (function entity-actor vector symbol none :behavior logo)) ;; - Unknowns diff --git a/decompiler/config/all-types2.gc b/decompiler/config/all-types2.gc new file mode 100644 index 0000000000..f1fead6ce9 --- /dev/null +++ b/decompiler/config/all-types2.gc @@ -0,0 +1,19 @@ +;; type system setup +(define-extern object type) +(define-extern type type) +(define-extern structure type) +(define-extern uint128 type) +(define-extern basic type) +(define-extern pair type) +(define-extern array type) + + + +;; some types we need. +(declare-type sparticle-launch-group basic) +(declare-type lightning-spec basic) +(declare-type sparticle-launcher basic) +(declare-type state basic) + +;; debug +(define-extern looping-code (function symbol)) diff --git a/decompiler/config/decompiler-only-types.gc b/decompiler/config/decompiler-only-types.gc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/decompiler/config/jak1_jp.jsonc b/decompiler/config/jak1_jp.jsonc new file mode 100644 index 0000000000..4432c38b04 --- /dev/null +++ b/decompiler/config/jak1_jp.jsonc @@ -0,0 +1,116 @@ +{ + "game_version": 1, + "text_version": 11, + "game_name": "jak1_jp", + "expected_elf_name": "SCPS_150.21", + + // if you want to filter to only some object names. + // it will make the decompiler much faster. + "allowed_objects": [], + "banned_objects": [], + + //////////////////////////// + // CODE ANALYSIS OPTIONS + //////////////////////////// + + // set to true to generate plain .asm files with MIPS disassembly, with no fancy decompilation. + // this is fast and should succeed 100% of the time. + "disassemble_code": false, + + // Run the decompiler + "decompile_code": false, + + // run the first pass of the decompiler + "find_functions": true, + + //////////////////////////// + // DATA ANALYSIS OPTIONS + //////////////////////////// + + // set to true to generate plain .asm files for data files. + // this will display most data as hex, but will add labels/references/type pointers/strings + // this generates a huge amount of output if you run it on the entire game. + "disassemble_data": false, + + // unpack textures to assets folder + "process_tpages": true, + // unpack game text to assets folder + "process_game_text": true, + // unpack game count to assets folder + "process_game_count": true, + // write goal imports for art groups + "process_art_groups": true, + + /////////////////////////// + // WEIRD OPTIONS + /////////////////////////// + + // these options are used rarely and should usually be left at false + + // generate the symbol_map.json file. + // this is a guess at where each symbol is first defined/used. + "generate_symbol_definition_map": false, + + // debug option for instruction decoder + "write_hex_near_instructions": false, + + // experimental tool to extract linked lists used for region scripting in Jak 2 and Jak 3. + "write_scripts": false, + + // hex dump of code/data files. + "hexdump_code": false, + "hexdump_data": false, + // dump raw obj files + "dump_objs": true, + // print control flow graph + "print_cfgs": false, + + // set to true for PAL versions. this will forcefully skip files that have some data missing at the end. + "is_pal": false, + + //////////////////////////// + // CONFIG FILES + //////////////////////////// + + "type_casts_file": "decompiler/config/jak1_pal/type_casts.jsonc", + "anonymous_function_types_file": "decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc", + "var_names_file": "decompiler/config/jak1_ntsc_black_label/var_names.jsonc", + "label_types_file": "decompiler/config/jak1_jp/label_types.jsonc", + "stack_structures_file": "decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc", + "hacks_file": "decompiler/config/jak1_pal/hacks.jsonc", + "inputs_file": "decompiler/config/jak1_ntsc_black_label/inputs.jsonc", + "art_info_file": "decompiler/config/jak1_ntsc_black_label/art_info.jsonc", + "import_deps_file": "decompiler/config/jak1_ntsc_black_label/import_deps.jsonc", + "all_types_file": "decompiler/config/all-types.gc", + + // optional: a predetermined object file name map from a file. + // this will make decompilation naming consistent even if you only run on some objects. + "obj_file_name_map_file": "goal_src/build/all_objs_jak1_jp.json", + + //////////////////////////// + // LEVEL EXTRACTION + //////////////////////////// + + // turn this on to extract level background graphics data + "levels_extract": true, + // turn this on if you want extracted levels to be saved out as .obj files + "levels_convert_to_obj": false, + // should we extract collision meshes? + // these can be displayed in game, but makes the .fr3 files slightly larger + "extract_collision": true, + + //////////////////////////// + // PATCHING OPTIONS + //////////////////////////// + + // these are options related to xdelta3 patches on specific objects + // this allows us to get a more consistent input + + // set to true to write new patch files + "write_patches": false, + // set to true to apply patch files + "apply_patches": true, + // what to patch an object to and the patch file is + "object_patches": { + } +} diff --git a/decompiler/config/jak1_jp/label_types.jsonc b/decompiler/config/jak1_jp/label_types.jsonc new file mode 100644 index 0000000000..ef7e508fa6 --- /dev/null +++ b/decompiler/config/jak1_jp/label_types.jsonc @@ -0,0 +1,2152 @@ +// the format is [label_name, type, special] + +// if the type is pointer or inline array, special should be an integer size. +// if the type is a value type (like rgba), special should be true. + +{ + "vector-h": [ + ["L32", "vector"], + ["L31", "vector"], + ["L30", "vector"], + ["L29", "vector"], + ["L28", "vector"], + ["L27", "vector"], + ["L26", "vector"] + ], + + "quaternion-h": [["L1", "quaternion"]], + + "quaternion": [ + ["L67", "vector"], + ["L68", "vector"], + ["L69", "vector"], + ["L70", "vector"], + ["L71", "vector"], + ["L72", "vector"] + ], + + "geometry": [["L112", "vector"]], + + "trigonometry": [ + ["L98", "(pointer float)", 32], + ["L99", "(pointer float)", 32], + ["L102", "vector"], + ["L101", "vector"], + ["L100", "vector"] + ], + + "video-h": [["L1", "video-parms"]], + + "font-h": [ + ["L18", "matrix"], + ["L17", "font-work"] + ], + + "display": [["L76", "(pointer uint32)", 2]], + + "capture": [["L12", "gs-store-image-packet"]], + + "main-h": [["L1", "frame-stats"]], + + "ocean-trans-tables": [ + ["L1", "(inline-array vector)", 4], + ["L2", "(pointer float)", 160], + ["L3", "(pointer float)", 100], + ["L4", "(pointer float)", 72], + ["L5", "(pointer float)", 72], + ["L6", "(pointer float)", 72], + ["L7", "(pointer float)", 72], + ["L8", "(pointer float)", 44], + ["L9", "(pointer float)", 44], + ["L10", "(pointer float)", 44], + ["L11", "(pointer float)", 44], + ["L12", "(pointer float)", 40], + ["L13", "(pointer float)", 40], + ["L14", "(pointer float)", 40], + ["L15", "(pointer float)", 40], + ["L16", "(pointer float)", 28], + ["L17", "(pointer float)", 28], + ["L18", "(pointer float)", 28], + ["L19", "(pointer float)", 28] + ], + + "pat-h": [["L1", "(inline-array pat-mode-info)", 4]], + + "joint-mod-h": [ + ["L89", "(inline-array vector)", 6], + ["L90", "(inline-array vector)", 3] + ], + + "collide-edge-grab-h": [["L1", "collide-edge-work"]], + + "assert-h": [["L4", "__assert-info-private-struct"]], + + "hud-h": [["L1", "hud-parts"]], + + "transformq": [ + ["L39", "vector"], + ["L40", "vector"] + ], + + "cylinder": [ + ["L54", "vector"], + ["L57", "vector"], + ["L56", "vector"], + ["L53", "vector"] + ], + + "sprite": [["L58", "vu-function"]], + + "sprite-distort": [["L27", "vu-function"]], + + "merc-vu1": [["L1", "vu-function"]], + + "background": [["L51", "vu-function"]], + + "debug": [ + ["L179", "vector2h"], + ["L176", "(inline-array vector)", 8], + ["L180", "vector"], + ["L181", "vector"], + ["L182", "vector"], + ["L183", "vector"], + ["L223", "rgba", true], + ["L225", "rgba", true], + ["L224", "rgba", true], + ["L222", "rgba", true], + ["L226", "rgba", true] + ], + + "shrub-work": [["L3", "instance-shrub-work"]], + + "game-info": [ + ["L468", "rgba", true], + ["L470", "rgba", true], + ["L464", "vector2h"], + ["L469", "rgba", true] + ], + + "tfrag-work": [["L1", "tfrag-work"]], + + "tie-work": [ + ["L1", "prototype-tie-work"], + ["L2", "instance-tie-work"] + ], + + "mood": [ + ["L256", "vector"], + ["L257", "vector"], + ["L258", "vector"], + ["L259", "vector"], + ["L260", "vector"], + ["L261", "vector"], + ["L262", "(inline-array vector)", 2], + ["L263", "light-ellipse"], + ["L264", "(inline-array vector)", 4], + ["L265", "vector"], + ["L266", "(inline-array vector)", 11], + ["L267", "vector"], + ["L268", "vector"], + ["L269", "vector"], + ["L270", "vector"], + ["L271", "vector"], + ["L272", "vector"], + ["L273", "vector"], + ["L274", "vector"], + ["L275", "vector"], + ["L276", "vector"], + ["L277", "vector"], + ["L278", "vector"], + ["L279", "vector"], + ["L280", "(array float)"], + ["L281", "(array float)"], + ["L282", "(array float)"], + ["L283", "(array float)"], + ["L284", "(array float)"], + ["L285", "(array float)"], + ["L286", "(array float)"], + ["L287", "(array float)"] + ], + + "mood-tables": [ + ["L12", "mood-sun-table"], + ["L13", "mood-lights-table"], + ["L14", "mood-fog-table"], + ["L15", "mood-fog-table"], + ["L16", "mood-sun-table"], + ["L17", "mood-sun-table"], + ["L18", "mood-lights-table"], + ["L19", "mood-fog-table"], + ["L20", "mood-lights-table"], + ["L21", "mood-fog-table"], + ["L22", "mood-lights-table"], + ["L23", "mood-fog-table"], + ["L24", "mood-lights-table"], + ["L25", "mood-lights-table"], + ["L26", "mood-fog-table"], + ["L27", "mood-sun-table"], + ["L28", "mood-lights-table"], + ["L29", "mood-fog-table"], + ["L30", "mood-sun-table"], + ["L31", "mood-lights-table"], + ["L32", "mood-fog-table"], + ["L33", "mood-sun-table"], + ["L34", "mood-lights-table"], + ["L35", "mood-fog-table"], + ["L36", "mood-sun-table"], + ["L37", "mood-lights-table"], + ["L38", "mood-fog-table"], + ["L39", "mood-sun-table"], + ["L40", "mood-lights-table"], + ["L41", "mood-fog-table"], + ["L42", "mood-sun-table"], + ["L43", "mood-lights-table"], + ["L44", "mood-fog-table"], + ["L45", "mood-sun-table"], + ["L46", "mood-lights-table"], + ["L47", "mood-fog-table"], + ["L48", "mood-fog-table"], + ["L49", "mood-sun-table"], + ["L50", "mood-lights-table"], + ["L51", "mood-fog-table"], + ["L52", "mood-sun-table"], + ["L53", "mood-lights-table"], + ["L54", "mood-fog-table"], + ["L55", "mood-sun-table"], + ["L56", "mood-lights-table"], + ["L57", "mood-fog-table"], + ["L58", "mood-fog-table"], + ["L59", "mood-sun-table"], + ["L60", "mood-lights-table"], + ["L61", "mood-fog-table"], + ["L62", "sky-color-day"], + ["L63", "sky-color-day"], + ["L64", "sky-color-day"], + ["L65", "sky-color-day"], + ["L66", "sky-color-day"], + ["L67", "sky-color-day"], + ["L68", "sky-color-day"] + ], + + "camera": [ + ["L257", "(inline-array qword)", 1], + ["L258", "(inline-array qword)", 1] + ], + + "target-util": [ + ["L180", "vector"], + ["L181", "vector"], + ["L182", "vector"], + ["L183", "vector"], + ["L184", "vector"], + ["L186", "vector"], + ["L187", "vector"], + ["L188", "vector"], + ["L189", "vector"], + ["L190", "vector"], + ["L225", "rgba", true] + ], + + "logic-target": [ + ["L227", "attack-info"], + ["L231", "(pointer uint64)", 1] + ], + + "progress-static": [ + ["L121", "(array game-text-id)"], + ["L195", "(array game-option)"], + ["L190", "(array game-option)"], + ["L185", "(array game-option)"], + ["L180", "(array game-option)"], + ["L174", "(array game-option)"], + ["L169", "(array game-option)"], + ["L165", "(array game-option)"], + ["L161", "(array game-option)"], + ["L157", "(array game-option)"], + ["L152", "(array game-option)"], + ["L147", "(array game-option)"], + ["L145", "(array game-option)"], + ["L143", "(array game-option)"], + ["L137", "(array game-option)"], + ["L131", "(array game-option)"], + ["L124", "(array game-option)"], + ["L123", "(array (array game-option))"], + ["L122", "(array int32)"], + ["L3", "(array level-tasks-info)"], + ["L2", "(array int32)"] + ], + + "rigid-body": [["L89", "rigid-body-platform-constants"]], + + "nav-enemy": [["L349", "attack-info"]], + + "basebutton": [ + ["L97", "vector"], + ["L102", "vector"] + ], + + "bird-lady": [["L29", "vector"]], + + "bird-lady-beach": [["L26", "vector"]], + + "mayor": [["L57", "vector"]], + + "sculptor": [["L89", "vector"]], + + "oracle": [ + ["L55", "vector"], + ["L56", "vector"], + ["L58", "vector"] + ], + + "evilbro": [ + ["L25", "vector"], + ["L30", "vector"] + ], + + "explorer": [["L77", "vector"]], + + "sage": [["L91", "vector"]], + + "misty-teetertotter": [ + ["L26", "attack-info"], + ["L27", "attack-info"] + ], + + "farmer": [["L28", "vector"]], + + "gambler": [["L52", "vector"]], + + "warrior": [["L30", "vector"]], + + "geologist": [["L38", "vector"]], + + "font": [ + ["L95", "(inline-array vector)", 250], + ["L94", "(inline-array vector)", 289] + ], + + "text": [ + ["L66", "vector"], + ["L67", "matrix"], + ["L68", "vector4w"] + ], + + "ocean-tables": [ + // see comment in ocean-tables.gc + ["L26", "ocean-spheres"], + ["L25", "ocean-colors"], + ["L23", "ocean-near-indices"], // ok + ["L22", "ocean-trans-indices"], + ["L21", "ocean-mid-indices"], + ["L19", "ocean-mid-masks"], + ["L18", "ocean-spheres"], + ["L17", "ocean-colors"], + ["L15", "ocean-near-indices"], + ["L9", "ocean-near-indices"], + + ["L14", "ocean-trans-indices"], + ["L8", "ocean-trans-indices"], + + ["L13", "ocean-mid-indices"], + ["L7", "ocean-mid-indices"], + + ["L11", "ocean-mid-masks"], + ["L5", "ocean-mid-masks"], + ["L4", "ocean-map"], + ["L3", "ocean-map"], + ["L2", "ocean-map"] + ], + + "ocean-frames": [["L1", "(pointer uint32)", 16384]], + + "shadow-cpu": [ + ["L122", "shadow-data"], + ["L121", "vu-function"] + ], + + "default-menu": [ + ["L6251", "float", true], + ["L6252", "float", true], + ["L6253", "float", true], + ["L6254", "float", true], + ["L6256", "float", true], + ["L6257", "float", true], + ["L6264", "float", true], + ["L6267", "float", true], + ["L6265", "float", true], + ["L6266", "float", true], + ["L6259", "float", true], + ["L6268", "float", true], + ["L6263", "float", true], + ["L6262", "float", true], + ["L6261", "float", true], + ["L6255", "float", true], + ["L6260", "float", true], + ["L6258", "float", true], + ["L6272", "uint64", true], + ["L6273", "uint64", true], + ["L6270", "uint64", true], + ["L6269", "uint64", true], + ["L6271", "uint64", true] + // ["L6268", "(array int)", true, 1] // printed as a float + ], + + // "default-menu": [ + // ["L519", "pair", true], + // ["L1550", "pair", true], + // ["L1552", "pair", true] + // ], + + // "generic-vu1": [ + // ["L12", "gif-tag64", true], + // ["L15", "gif-tag64", true], + // ["L14", "gif-tag-regs", true] + // ], + + "merc-blend-shape": [["L62", "(pointer int16)", 32]], + + "miners": [ + ["L111", "vector"], + ["L281", "vector"] + ], + + "entity": [ + ["L483", "vector2h"], + ["L482", "vector2h"], + ["L480", "vector2h"], + ["L479", "vector2h"], + ["L478", "vector2h"], + ["L477", "vector2h"], + ["L476", "vector2h"], + ["L475", "vector4w"], + ["L474", "vector4w"], + ["L473", "vector4w"], + ["L472", "vector4w"], + ["L471", "vector4w"] + ], + + "assistant": [["L71", "vector"]], + + "target-part": [ + ["L336", "float", true], + ["L337", "float", true], + ["L338", "float", true], + ["L339", "float", true], + ["L340", "float", true], + ["L341", "uint64", true] + ], + + "projectiles": [["L150", "attack-info"]], + "blocking-plane": [ + ["L18", "vector"], + ["L19", "vector"], + ["L20", "vector"] + ], + + "sidekick-human": [ + ["L131", "vector"], + ["L350", "vector"], + ["L940", "float", true], + ["L941", "float", true], + ["L942", "float", true], + ["L943", "float", true], + ["L944", "float", true], + ["L945", "float", true], + ["L946", "float", true], + ["L990", "float", true], + ["L991", "uint64", true], + ["L992", "uint64", true], + ["L993", "uint64", true], + ["L994", "uint64", true] + ], + + "assistant-firecanyon": [["L71", "vector"]], + + "sage-bluehut": [["L82", "vector"]], + + "flutflut-bluehut": [["L34", "vector"]], + + "sharkey": [["L101", "attack-info"]], + + "assistant-citadel": [["L28", "vector"]], + + "robotboss-h": [ + ["L67", "float", true], + ["L68", "uint64", true], + ["L69", "uint64", true] + ], + + "final-door": [ + ["L59", "vector"], + ["L60", "vector"] + ], + + "crates": [ + ["L171", "attack-info"], + ["L175", "attack-info"], + ["L181", "attack-info"], + ["L242", "float", true], + ["L243", "float", true], + ["L245", "float", true], + ["L263", "float", true] + ], + + "hint-control": [ + ["L45", "(array task-hint-control-group)"], + ["L100", "(array level-hint-control)"] + ], + + "cam-master": [ + ["L356", "vector"], + ["L357", "vector"] + ], + + "cam-states": [ + ["L630", "vector"], + ["L631", "vector"], + ["L632", "vector"], + ["L633", "vector"], + ["L672", "float", true], + ["L673", "float", true], + ["L674", "float", true], + ["L675", "float", true], + ["L676", "float", true], + ["L677", "float", true], + ["L678", "float", true], + ["L679", "float", true], + ["L680", "float", true], + ["L681", "float", true], + ["L682", "float", true], + ["L683", "float", true], + ["L684", "float", true], + ["L685", "float", true], + ["L686", "float", true], + ["L687", "float", true], + ["L688", "float", true], + ["L689", "float", true], + ["L690", "float", true], + ["L691", "float", true], + ["L692", "float", true], + ["L693", "float", true], + ["L694", "float", true], + ["L695", "float", true], + ["L696", "float", true], + ["L697", "float", true], + ["L698", "float", true], + ["L699", "float", true], + ["L700", "float", true], + ["L701", "float", true], + ["L702", "float", true], + ["L703", "float", true], + ["L704", "float", true], + ["L705", "float", true], + ["L706", "float", true], + ["L707", "float", true], + ["L708", "float", true], + ["L709", "float", true], + ["L710", "float", true], + ["L711", "float", true], + ["L712", "float", true], + ["L713", "float", true], + ["L714", "float", true], + ["L715", "float", true], + ["L716", "float", true], + ["L717", "float", true], + ["L718", "float", true], + ["L719", "float", true], + ["L720", "float", true], + ["L721", "float", true], + ["L722", "float", true], + ["L723", "float", true], + ["L724", "float", true], + ["L725", "float", true], + ["L726", "float", true], + ["L727", "float", true], + ["L728", "float", true], + ["L729", "float", true], + ["L730", "float", true], + ["L731", "float", true], + ["L732", "float", true], + ["L733", "float", true], + ["L734", "float", true], + ["L735", "float", true], + ["L736", "float", true], + ["L737", "float", true], + ["L738", "float", true], + ["L739", "float", true], + ["L740", "float", true], + ["L741", "float", true], + ["L742", "float", true], + ["L743", "float", true], + ["L744", "float", true], + ["L745", "float", true], + ["L790", "uint64", true], + ["L791", "uint64", true], + ["L792", "uint64", true], + ["L793", "uint64", true] + ], + + "cam-states-dbg": [["L78", "camera-orbit-info"]], + + "cam-layout": [ + ["L766", "quaternion"], + ["L768", "vector"], + ["L775", "vector4w"], + ["L777", "vector4w"], + ["L779", "vector4w"], + ["L781", "vector4w"], + ["L783", "vector4w"], + ["L785", "vector4w"], + ["L787", "vector4w"], + ["L788", "vector4w"], + ["L789", "vector4w"], + ["L790", "vector4w"], + ["L791", "vector"], + ["L792", "vector"], + ["L793", "vector4w"], + ["L794", "vector"], + ["L795", "vector4w"], + ["L796", "vector"], + ["L797", "vector"], + ["L798", "vector4w"], + ["L799", "vector"], + ["L800", "vector4w"], + ["L801", "vector"], + ["L802", "vector"], + ["L803", "vector4w"], + ["L804", "vector"], + ["L805", "vector"], + ["L806", "vector4w"], + ["L807", "vector4w"], + ["L808", "vector"], + ["L809", "vector"], + ["L810", "vector4w"], + ["L811", "vector4w"], + ["L812", "vector"], + ["L813", "vector"], + ["L814", "vector4w"], + ["L815", "vector"], + ["L816", "vector"], + ["L817", "vector4w"], + ["L818", "vector"], + ["L819", "vector"], + ["L820", "vector4w"], + ["L821", "vector"], + ["L822", "vector"], + ["L823", "vector"], + ["L824", "vector"], + ["L832", "vector4w"], + ["L872", "float", true], + ["L873", "float", true], + ["L874", "float", true], + ["L875", "float", true], + ["L876", "float", true], + ["L877", "float", true], + ["L878", "float", true], + ["L879", "float", true], + ["L880", "float", true], + ["L881", "float", true], + ["L882", "float", true], + ["L883", "float", true], + ["L884", "float", true], + ["L885", "float", true], + ["L886", "float", true], + ["L887", "float", true], + ["L888", "float", true], + ["L889", "float", true], + ["L890", "float", true], + ["L891", "float", true], + ["L892", "float", true], + ["L893", "float", true], + ["L894", "float", true], + ["L895", "float", true], + ["L896", "float", true], + ["L897", "float", true], + ["L898", "float", true], + ["L899", "float", true], + ["L900", "float", true], + ["L901", "uint64", true], + ["L904", "uint64", true], + ["L905", "uint64", true], + ["L906", "uint64", true], + ["L907", "uint64", true], + ["L908", "uint64", true], + ["L909", "uint64", true], + ["L910", "uint64", true] + ], + + "process-taskable": [["L251", "attack-info"]], + + "babak-with-cannon": [["L92", "vector"]], + + "flutflut": [["L94", "vector"]], + + "fishermans-boat": [ + ["L210", "vector"], + ["L410", "attack-info"], + ["L411", "vector"], + ["L412", "vector"], + ["L413", "vector"], + ["L431", "(pointer float)", 32], + ["L432", "(pointer float)", 32], + ["L434", "rigid-body-platform-constants"] + ], + + "training-obs": [["L175", "rigid-body-platform-constants"]], + + "bonelurker": [ + ["L72", "attack-info"], + ["L73", "attack-info"] + ], + + "balloonlurker": [ + ["L99", "vector"], + ["L105", "vector"], + ["L107", "attack-info"], + ["L108", "attack-info"], + ["L113", "rigid-body-platform-constants"] + ], + + "assistant-village2": [ + ["L177", "vector"], + ["L219", "attack-info"], + ["L268", "vector"] + ], + + "citb-plat": [ + ["L136", "attack-info"], + ["L155", "rigid-body-platform-constants"] + ], + + "qbert-plat": [["L99", "rigid-body-platform-constants"]], + + "misty-conveyor": [ + ["L60", "vector"], + ["L65", "vector"], + ["L66", "vector"], + ["L71", "vector"], + ["L73", "attack-info"] + ], + + "swamp-bat": [ + ["L88", "matrix"], + ["L99", "vector"], + ["L102", "vector"], + ["L103", "attack-info"] + ], + + "cavecrystal-light": [ + ["L45", "vector"], + ["L46", "vector"] + ], + + "gnawer": [ + ["L195", "attack-info"], + ["L196", "attack-info"], + ["L200", "attack-info"], + ["L216", "(inline-array gnawer-segment-info)", 10] + ], + + "target-tube": [["L142", "vector"]], + + "assistant-village3": [["L43", "vector"]], + + "sage-village3": [["L74", "vector"]], + + "target-snowball": [["L23", "vector"]], + + "ice-cube": [ + ["L210", "vector"], + ["L212", "attack-info"], + ["L213", "attack-info"], + ["L215", "attack-info"] + ], + + "assistant-lavatube": [["L30", "vector"]], + + "citadel-part": [ + ["L235", "float", true], + ["L236", "float", true], + ["L237", "float", true], + ["L238", "float", true], + ["L242", "uint64", true] + ], + + "village1-part": [ + ["L238", "float", true], + ["L239", "float", true], + ["L240", "float", true], + ["L241", "float", true], + ["L245", "uint64", true] + ], + + "sunken-part": [["L220", "uint64", true]], + + "ogre-part": [["L93", "uint64", true]], + + "collectables-part": [ + ["L309", "float", true], + ["L310", "float", true] + ], + + "village1-part2": [ + ["L122", "float", true], + ["L123", "float", true], + ["L124", "float", true], + ["L125", "uint64", true] + ], + + "village2-part": [ + ["L226", "float", true], + ["L227", "float", true], + ["L228", "float", true], + ["L229", "uint64", true], + ["L233", "uint64", true] + ], + + "village3-part": [["L244", "uint64", true]], + + "lavatube-part": [["L110", "uint64", true]], + + "hud-classes": [ + ["L279", "vector"], + ["L310", "vector"], + ["L318", "vector"] + ], + + "sky": [["L13", "vu-function"]], + + "sky-tng": [ + ["L82", "sky-work"], + // 576 bytes, 32 bytes each + ["L81", "(inline-array sky-vertex)", 12], + ["L80", "(inline-array sky-vertex)", 12], + ["L79", "(inline-array sky-vertex)", 72], + ["L78", "(pointer uint8)", 48], + ["L77", "vector"], + ["L76", "vector"] + ], + + "effect-control": [ + ["L300", "float", true], + ["L301", "float", true], + ["L302", "float", true], + ["L306", "float", true], + ["L307", "float", true], + ["L309", "float", true], + ["L310", "float", true], + ["L312", "float", true], + ["L314", "float", true] + ], + + "seagull": [["L226", "(inline-array air-box)", 10]], + + "rolling-race-ring": [ + ["L94", "vector"], + ["L95", "vector"], + ["L96", "vector"], + ["L97", "vector"], + ["L98", "vector"], + ["L99", "vector"], + ["L100", "vector"] + ], + + "anim-tester": [ + ["L509", "(inline-array list-field)", 12], + ["L523", "vector"], + ["L524", "vector"], + ["L649", "float", true], + ["L650", "float", true], + ["L651", "float", true], + ["L652", "float", true], + ["L653", "float", true], + ["L654", "float", true], + ["L655", "float", true], + ["L656", "float", true], + ["L657", "uint64", true], + ["L658", "uint64", true], + ["L663", "uint64", true], + ["L664", "uint64", true], + ["L665", "uint64", true], + ["L666", "uint64", true], + ["L667", "uint64", true], + ["L668", "uint64", true], + ["L669", "uint64", true], + ["L670", "uint64", true] + ], + + "fisher": [ + ["L262", "vector"], + ["L463", "(array (inline-array fisher-params))"] + ], + "fisher-OLD": [ + ["L262", "vector"], + ["L463", "(array (inline-array fisher-params))"] + ], + + "robotboss-weapon": [ + ["L122", "attack-info"], + ["L127", "attack-info"], + ["L138", "attack-info"], + ["L144", "vector4w"], + ["L145", "vector"] + ], + + "robotboss-misc": [["L99", "vector"]], + + "robotboss": [ + ["L646", "attack-info"], + ["L647", "attack-info"], + ["L651", "vector"], + ["L654", "vector"], + ["L655", "vector"], + ["L656", "vector"], + ["L657", "vector"], + ["L658", "vector"], + ["L659", "vector"], + ["L660", "vector"], + ["L661", "vector"], + ["L662", "vector"], + ["L678", "vector"], + ["L669", "vector"], + ["L701", "vector"], + ["L702", "vector"], + ["L703", "vector"], + ["L705", "vector"], + ["L642", "robotboss-dda"], + ["L643", "robotboss-dda"], + ["L644", "robotboss-dda"], + ["L645", "robotboss-dda"], + ["L632", "robotboss-dda"], + ["L713", "float", true], + ["L714", "float", true], + ["L715", "float", true], + ["L716", "float", true], + ["L717", "float", true], + ["L718", "float", true], + ["L719", "float", true], + ["L720", "float", true], + ["L721", "float", true], + ["L722", "float", true], + ["L723", "float", true], + ["L724", "float", true], + ["L725", "float", true], + ["L726", "float", true], + ["L727", "float", true], + ["L728", "float", true], + ["L729", "float", true], + ["L730", "float", true], + ["L731", "float", true], + ["L732", "float", true], + ["L733", "float", true], + ["L734", "float", true], + ["L735", "float", true], + ["L736", "float", true], + ["L737", "float", true], + ["L738", "float", true], + ["L739", "float", true], + ["L740", "float", true], + ["L741", "float", true], + ["L742", "float", true], + ["L743", "float", true], + ["L744", "float", true], + ["L745", "float", true], + ["L746", "float", true], + ["L747", "float", true], + ["L748", "float", true], + ["L749", "float", true], + ["L750", "float", true], + ["L751", "float", true], + ["L752", "float", true], + ["L753", "float", true], + ["L754", "float", true], + ["L755", "float", true], + ["L756", "float", true], + ["L757", "float", true], + ["L758", "float", true], + ["L759", "float", true], + ["L760", "float", true], + ["L761", "float", true], + ["L762", "float", true], + ["L763", "float", true], + ["L764", "float", true], + ["L765", "float", true], + ["L766", "float", true], + ["L767", "float", true], + ["L768", "float", true], + ["L769", "float", true], + ["L770", "float", true], + ["L771", "float", true], + ["L772", "float", true], + ["L773", "float", true], + ["L774", "float", true], + ["L775", "float", true], + ["L776", "float", true], + ["L777", "float", true], + ["L778", "float", true], + ["L779", "float", true], + ["L780", "float", true], + ["L781", "float", true], + ["L782", "float", true], + ["L783", "float", true], + ["L784", "float", true], + ["L785", "float", true], + ["L786", "float", true], + ["L787", "float", true], + ["L788", "float", true], + ["L789", "float", true], + ["L790", "float", true], + ["L791", "float", true], + ["L792", "float", true], + ["L793", "float", true], + ["L794", "float", true], + ["L795", "float", true], + ["L796", "float", true], + ["L797", "float", true], + ["L798", "float", true], + ["L799", "float", true], + ["L800", "float", true], + ["L801", "uint64", true], + ["L802", "uint64", true], + ["L803", "uint64", true], + ["L804", "uint64", true], + ["L814", "float", true], + ["L815", "uint64", true], + ["L816", "uint64", true] + ], + + "sage-finalboss": [ + ["L528", "vector"], + ["L272", "vector"], + ["L527", "quaternion"] + ], + + "sage-finalboss-OLD": [ + ["L528", "vector"], + ["L272", "vector"], + ["L527", "quaternion"] + ], + + "part-tester": [ + ["L27", "rgba", true], + ["L32", "uint64", true] + ], + + "process-drawable": [ + ["L242", "vector"], + ["L241", "vector"] + ], + + "ocean-texture": [ + ["L14", "vu-function"], + ["L15", "ocean-texture-work"] + ], + + "cavegeyserrock": [ + ["L56", "attack-info"], + ["L54", "vector"], + ["L53", "vector"], + ["L52", "vector"] + ], + + "junglesnake": [ + ["L93", "(pointer float)", 28], + ["L100", "attack-info"], + ["L101", "attack-info"] + ], + + "jungleb-obs": [["L34", "vector"]], + + "jungle-obs": [["L164", "attack-info"]], + + "misty-obs": [["L135", "rigid-body-platform-constants"]], + + "village2-obs": [ + ["L274", "rigid-body-platform-constants"], + ["L275", "rigid-body-platform-constants"], + ["L288", "vector"] + ], + + "swamp-obs": [ + ["L85", "rigid-body-platform-constants"], + ["L109", "attack-info"] + ], + + "maincave-obs": [ + ["L159", "vector"], + ["L160", "vector"], + ["L175", "attack-info"], + ["L176", "attack-info"] + ], + + "sunken-obs": [ + ["L43", "vector"], + ["L45", "vector"], + ["L47", "vector"], + ["L49", "vector"], + ["L51", "vector"] + ], + + "rolling-obs": [ + ["L234", "vector"], + ["L238", "vector"], + ["L239", "vector"], + ["L240", "vector"], + ["L241", "vector"], + ["L242", "vector"], + ["L243", "vector"], + ["L244", "vector"], + ["L245", "vector"], + ["L246", "vector"], + ["L247", "vector"], + ["L248", "vector"], + ["L257", "vector"] + ], + + "firecanyon-obs": [["L57", "attack-info"]], + + "ogre-obs": [ + ["L141", "rigid-body-platform-constants"], + ["L142", "rigid-body-platform-constants"], + ["L156", "attack-info"] + ], + + "snow-obs": [["L201", "vector"]], + + "lavatube-obs": [ + ["L162", "attack-info"], + ["L194", "attack-info"] + ], + + "tfrag": [ + ["L107", "vu-function"], + ["L106", "vector"], + ["L105", "vector"] + ], + + "generic-obs": [ + ["L455", "quaternion"], + ["L457", "attack-info"] + ], + + "collectables": [ + ["L533", "vector"], + ["L606", "float", true], + ["L607", "float", true], + ["L608", "float", true], + ["L609", "float", true], + ["L610", "float", true], + ["L611", "float", true], + ["L612", "float", true], + ["L613", "float", true], + ["L614", "float", true], + ["L615", "float", true], + ["L616", "float", true], + ["L617", "float", true], + ["L618", "float", true], + ["L619", "float", true], + ["L620", "float", true], + ["L621", "float", true], + ["L622", "float", true], + ["L623", "float", true], + ["L624", "float", true], + ["L625", "float", true], + ["L626", "float", true], + ["L627", "float", true], + ["L628", "float", true], + ["L629", "float", true], + ["L630", "float", true], + ["L631", "float", true], + ["L632", "float", true], + ["L633", "float", true], + ["L634", "float", true], + ["L635", "float", true], + ["L636", "float", true], + ["L637", "float", true], + ["L638", "float", true], + ["L639", "float", true], + ["L640", "float", true], + ["L641", "float", true], + ["L642", "float", true], + ["L643", "float", true], + ["L644", "float", true], + ["L645", "float", true], + ["L646", "float", true], + ["L647", "float", true], + ["L648", "float", true], + ["L649", "float", true], + ["L650", "float", true], + ["L651", "float", true], + ["L652", "float", true], + ["L653", "float", true], + ["L654", "float", true], + ["L655", "float", true], + ["L656", "float", true], + ["L657", "float", true], + ["L658", "float", true], + ["L659", "float", true], + ["L660", "float", true], + ["L661", "float", true], + ["L662", "float", true], + ["L663", "float", true], + ["L664", "uint64", true], + ["L666", "uint64", true], + ["L665", "uint64", true], + ["L667", "uint64", true], + ["L668", "uint64", true], + ["L669", "uint64", true], + ["L670", "uint64", true], + ["L671", "uint64", true], + ["L672", "uint64", true], + ["L585", "vector"], + ["L725", "float", true], + ["L726", "float", true], + ["L727", "float", true], + ["L728", "uint64", true], + ["L729", "uint64", true], + ["L730", "uint64", true], + ["L731", "uint64", true], + ["L732", "uint64", true], + ["L733", "uint64", true] + ], + + "plant-boss": [ + ["L343", "vector"], + ["L344", "vector"], + ["L345", "vector"], + ["L346", "vector"], + ["L347", "vector"], + ["L348", "vector"], + ["L349", "vector"], + ["L350", "vector"], + ["L351", "vector"], + ["L352", "vector"], + ["L353", "vector"], + ["L354", "vector"], + ["L355", "vector"], + ["L356", "vector"], + ["L357", "vector"], + ["L358", "vector"], + ["L359", "vector"], + ["L360", "vector"], + ["L361", "vector"], + ["L362", "vector"], + ["L363", "vector"], + ["L364", "vector"], + ["L375", "attack-info"], + ["L377", "attack-info"], + ["L399", "attack-info"], + ["L403", "attack-info"], + ["L412", "float", true], + ["L413", "float", true], + ["L414", "float", true], + ["L415", "float", true], + ["L416", "float", true], + ["L417", "float", true], + ["L418", "float", true], + ["L419", "float", true], + ["L420", "float", true], + ["L421", "float", true], + ["L422", "float", true], + ["L423", "float", true], + ["L424", "float", true], + ["L425", "float", true], + ["L426", "float", true], + ["L427", "float", true], + ["L428", "float", true], + ["L429", "float", true], + ["L430", "float", true], + ["L431", "float", true], + ["L432", "float", true], + ["L433", "float", true], + ["L434", "float", true], + ["L435", "float", true], + ["L436", "float", true], + ["L437", "float", true], + ["L438", "float", true], + ["L439", "float", true], + ["L440", "float", true], + ["L441", "float", true], + ["L442", "float", true], + ["L443", "float", true], + ["L444", "float", true], + ["L445", "float", true], + ["L446", "float", true], + ["L447", "float", true], + ["L448", "float", true], + ["L449", "float", true], + ["L450", "float", true], + ["L451", "float", true], + ["L452", "float", true], + ["L453", "float", true], + ["L454", "float", true], + ["L455", "float", true], + ["L456", "float", true], + ["L457", "float", true], + ["L458", "float", true], + ["L459", "float", true], + ["L460", "float", true], + ["L461", "float", true], + ["L462", "float", true], + ["L463", "float", true], + ["L464", "float", true], + ["L465", "float", true], + ["L466", "float", true], + ["L467", "float", true], + ["L468", "float", true], + ["L469", "float", true], + ["L470", "uint64", true], + ["L498", "float", true], + ["L499", "uint64", true], + ["L500", "uint64", true], + ["L501", "uint64", true] + ], + + "ropebridge": [ + ["L97", "(inline-array ropebridge-tuning)", 6], + ["L104", "(inline-array vector)", 18], // 70/72 words + ["L105", "(inline-array vector)", 16], // 62/64 words + ["L106", "(inline-array vector)", 26], // 102/104 words + ["L107", "(inline-array vector)", 35] // 138/140 words + ], + + "double-lurker": [ + ["L109", "vector"], + ["L122", "attack-info"], + ["L123", "attack-info"], + ["L128", "attack-info"] + ], + + "billy": [["L234", "vector"]], + + "lurkerworm": [["L56", "attack-info"]], + + "pelican": [ + ["L199", "vector"], + ["L225", "vector"] + ], + + "citadel-sages": [ + ["L179", "vector"], + ["L623", "vector"], + ["L651", "vector"], + ["L701", "vector"] + ], + + "shover": [ + ["L13", "attack-info"], + ["L14", "attack-info"] + ], + + "steam-cap": [["L51", "attack-info"]], + + "sidekick": [["L29", "vector"]], + + "target-handler": [ + ["L195", "attack-info"], + ["L197", "float", true], + ["L198", "float", true], + ["L199", "float", true], + ["L200", "float", true], + ["L201", "float", true], + ["L202", "float", true], + ["L203", "float", true], + ["L204", "float", true], + ["L205", "uint64", true], + ["L206", "uint64", true], + ["L207", "uint64", true], + ["L208", "uint64", true], + ["L209", "uint64", true] + ], + + "water": [ + ["L148", "attack-info"], + ["L149", "attack-info"], + ["L150", "attack-info"] + ], + + "racer": [["L106", "vector"]], + + "target-racer": [ + ["L237", "attack-info"], + ["L238", "attack-info"], + ["L240", "vector"] + ], + + "rolling-lightning-mole": [ + ["L181", "vector"], + ["L185", "vector4w"], + ["L186", "vector4w"], + ["L187", "vector4w"], + ["L189", "vector4w"], + ["L195", "vector"], + ["L201", "vector4w"], + ["L202", "vector4w"], + ["L203", "vector4w"], + ["L204", "vector4w"], + ["L205", "vector4w"], + ["L206", "vector4w"] + ], + + "rolling-robber": [ + ["L127", "vector"], + ["L139", "vector"], + ["L140", "vector"], + ["L145", "vector"] + ], + + "target-flut": [ + ["L399", "attack-info"], + ["L406", "float", true], + ["L407", "float", true], + ["L408", "float", true], + ["L409", "float", true], + ["L410", "float", true], + ["L411", "float", true], + ["L412", "float", true], + ["L413", "float", true], + ["L414", "float", true], + ["L415", "float", true], + ["L416", "float", true], + ["L417", "float", true], + ["L418", "float", true], + ["L419", "float", true], + ["L420", "float", true], + ["L421", "float", true], + ["L422", "float", true], + ["L423", "float", true], + ["L424", "float", true], + ["L425", "float", true], + ["L426", "float", true], + ["L427", "float", true], + ["L428", "float", true], + ["L429", "float", true], + ["L430", "float", true], + ["L431", "float", true], + ["L432", "float", true], + ["L433", "float", true], + ["L434", "float", true], + ["L435", "float", true], + ["L436", "float", true], + ["L437", "float", true], + ["L438", "float", true], + ["L439", "float", true], + ["L440", "float", true], + ["L441", "float", true], + ["L442", "float", true], + ["L443", "float", true], + ["L444", "float", true], + ["L445", "float", true], + ["L446", "float", true], + ["L447", "float", true], + ["L448", "float", true], + ["L449", "float", true], + ["L450", "float", true], + ["L451", "float", true], + ["L452", "float", true], + ["L453", "float", true], + ["L454", "float", true], + ["L455", "float", true], + ["L456", "float", true], + ["L457", "float", true], + ["L458", "uint64", true], + ["L459", "uint64", true], + ["L460", "uint64", true], + ["L461", "uint64", true], + ["L462", "uint64", true], + ["L463", "uint64", true], + ["L464", "uint64", true], + ["L465", "uint64", true], + ["L483", "uint64", true], + ["L484", "uint64", true] + ], + + "collide-shape": [ + ["L399", "attack-info"], + ["L408", "vector"], + ["L410", "vector"], + ["L411", "vector"], + ["L413", "attack-info"], + ["L414", "attack-info"], + ["L415", "attack-info"], + ["L416", "attack-info"], + ["L417", "vector"], + ["L418", "attack-info"], + ["L419", "attack-info"], + ["L420", "vector"], + ["L421", "vector"] + ], + + "collide-planes": [ + ["L53", "vector4w"], + ["L54", "vector4w"], + ["L55", "vector4w"], + ["L56", "vector4w"], + ["L57", "vector4w"], + ["L58", "vector4w"], + ["L59", "vector4w"], + ["L60", "vector4w"], + ["L63", "vector4w"], + ["L64", "vector4w"], + ["L65", "vector4w"], + ["L66", "vector4w"] + ], + + "collide-probe": [ + ["L100", "vector"], + ["L102", "vector"] + ], + + "collide-cache": [ + ["L304", "vector"], + ["L303", "vector4w"] + ], + + "load-boundary-data": [["L2", "(array array)"]], + + "tfrag-near": [["L1", "vu-function"]], + + "snow-ram-boss": [ + ["L220", "attack-info"], + ["L221", "attack-info"], + ["L222", "attack-info"], + ["L223", "attack-info"], + ["L225", "attack-info"] + ], + + "snow-ram": [["L73", "attack-info"]], + + "snow-bumper": [["L54", "attack-info"]], + + "snow-ball": [ + ["L86", "(pointer float)", 8], + ["L87", "(pointer float)", 8], + ["L89", "attack-info"] + ], + + "puffer": [["L170", "attack-info"]], + + "driller-lurker": [ + ["L174", "attack-info"], + ["L175", "attack-info"] + ], + + "dark-crystal": [["L36", "attack-info"]], + + "kermit": [["L164", "attack-info"]], + + "swamp-blimp": [ + ["L177", "vector"], + ["L182", "vector"], + ["L187", "vector"], + ["L198", "tetherrock-info"], + ["L200", "tetherrock-info"], + ["L203", "tetherrock-info"], + ["L206", "tetherrock-info"], + ["L209", "tetherrock-info"] + ], + + "mistycannon": [["L199", "attack-info"]], + + "darkvine": [["L41", "attack-info"]], + + "jungle-mirrors": [ + ["L325", "vector"], + ["L326", "vector4w-4"] + ], + + "quicksandlurker": [["L111", "attack-info"]], + + "voicebox": [ + ["L47", "vector"], + ["L48", "vector"], + ["L49", "vector"], + ["L50", "vector"], + ["L51", "vector"] + ], + + "mother-spider": [ + ["L278", "vector"], + ["L279", "vector"], + ["L288", "attack-info"], + ["L301", "(inline-array mother-spider-leg-info)", 8], + ["L302", "(inline-array mother-spider-thread)", 9] + ], + + "bully": [ + ["L90", "attack-info"], + ["L91", "attack-info"], + ["L93", "attack-info"] + ], + + "bones": [ + ["L159", "shadow-settings"], + ["L161", "vector"], + ["L162", "vu-function"] + ], + + "tie": [["L43", "vu-function"]], + + "tie-near": [["L91", "vu-function"]], + + "depth-cue": [["L17", "depth-cue-work"]], + + "navigate": [ + ["L402", "vector"], + ["L403", "vector"], + ["L404", "vector"], + ["L405", "vector"], + ["L406", "vector"], + ["L422", "vector"], + ["L419", "(pointer uint8)", 4], + ["L425", "float", true], + ["L426", "float", true], + ["L429", "float", true], + ["L430", "float", true], + ["L436", "float", true], + ["L438", "float", true], + ["L444", "float", true], + ["L442", "float", true], + ["L520", "vector"], + ["L522", "float", true], // TODO - meters + ["L523", "float", true] // TODO - meters + ], + + "eye": [ + ["L36", "eye-work"], + ["L38", "float", true], + ["L40", "float", true], + ["L44", "uint64", true] + ], + + "snow-bunny": [["L190", "attack-info"]], + + "ocean-vu0": [ + ["L8", "vu-function"], + ["L9", "ocean-vu0-work"] + ], + + "ocean-near": [ + ["L35", "vu-function"], + ["L37", "float", true], + ["L44", "float", true] + ], + + "ocean-mid": [["L150", "vu-function"]], + + "generic-merc": [ + ["L161", "(inline-array invinitdata)", 8], + ["L162", "vu-function"] + ], + + "generic-vu0": [["L1", "vu-function"]], + + "generic-vu1": [ + ["L8", "vector4w"], + ["L9", "vector4w"], + ["L10", "vu-function"] + ], + + "generic-effect": [["L95", "generic-consts"]], + + "shadow-vu1": [ + ["L5", "vu-function"], + ["L6", "shadow-vu1-gifbuf-template"] + ], + + "generic-vu0": [["L1", "vu-function"]], + "shrubbery": [["L133", "vu-function"]], + + "credits": [ + ["L32", "(array int32)"], + ["L33", "(array float)"] + ], + +// BEGIN + "ambient": [ + ["L334", "vector2h"], + ["L332", "vector2h"], + ["L331", "vector2h"], + ["L330", "vector2h"], + ["L329", "vector2h"], + ["L328", "vector2h"] + ], + + "sparticle-launcher": [["L193", "adgif-shader"]], + + "load-boundary": [ + ["L328", "(inline-array lbvtx)", 12], + ["L325", "vector"] + ], + + "cam-debug": [ + ["L172", "vector4w"], + ["L173", "vector4w"], + ["L174", "vector4w"], + ["L175", "vector4w"], + ["L176", "vector4w"], + ["L207", "vector4w"], + ["L208", "vector4w"], + ["L209", "vector4w"], + ["L210", "vector4w"], + ["L211", "vector4w"], + ["L212", "vector4w"], + ["L213", "vector4w"], + ["L214", "vector4w"], + ["L215", "vector4w"], + ["L216", "vector4w"], + ["L217", "vector4w"], + ["L218", "vector4w"], + ["L219", "vector4w"], + ["L220", "vector4w"], + ["L221", "vector4w"], + ["L222", "vector4w"], + ["L223", "vector4w"], + ["L224", "vector4w"], + ["L225", "vector4w"], + ["L226", "vector4w"], + ["L227", "vector4w"], + ["L228", "vector4w"], + ["L229", "vector4w"], + ["L230", "vector4w"], + ["L231", "vector4w"], + ["L232", "vector4w"], + ["L237", "vector4w"], + ["L238", "vector4w"], + ["L239", "vector4w"], + ["L240", "vector4w"], + ["L241", "vector"], + ["L242", "vector"], + ["L243", "vector4w"], + ["L244", "vector"], + ["L245", "vector"], + ["L252", "vector"], + ["L253", "vector"], + ["L254", "vector"], + ["L255", "vector"], + ["L261", "vector4w"] + ], + + "sequence-a-village1": [["L40", "vector"]], + + "ogreboss": [ + ["L360", "attack-info"], + ["L368", "attack-info"], + ["L371", "attack-info"], + ["L372", "attack-info"], + ["L385", "float", true], + ["L386", "float", true], + ["L387", "float", true], + ["L388", "float", true], + ["L389", "float", true], + ["L390", "float", true], + ["L391", "float", true], + ["L392", "float", true], + ["L393", "float", true], + ["L394", "float", true], + ["L395", "float", true], + ["L396", "float", true], + ["L397", "float", true], + ["L398", "float", true], + ["L399", "float", true], + ["L400", "float", true], + ["L401", "float", true], + ["L402", "float", true], + ["L403", "float", true], + ["L404", "float", true], + ["L405", "float", true], + ["L406", "float", true], + ["L407", "float", true], + ["L408", "float", true], + ["L409", "float", true], + ["L410", "float", true], + ["L411", "float", true], + ["L412", "float", true], + ["L413", "float", true], + ["L414", "float", true], + ["L415", "float", true], + ["L416", "float", true], + ["L417", "float", true], + ["L418", "float", true], + ["L419", "float", true], + ["L420", "float", true], + ["L421", "float", true], + ["L422", "float", true], + ["L423", "float", true], + ["L424", "float", true], + ["L425", "float", true], + ["L426", "float", true], + ["L427", "float", true], + ["L428", "float", true], + ["L429", "float", true], + ["L430", "float", true], + ["L431", "float", true], + ["L432", "float", true], + ["L433", "float", true], + ["L434", "float", true], + ["L435", "float", true], + ["L436", "float", true], + ["L437", "float", true], + ["L438", "float", true], + ["L439", "float", true], + ["L440", "float", true], + ["L441", "float", true], + ["L442", "float", true], + ["L443", "float", true], + ["L444", "float", true], + ["L445", "float", true], + ["L446", "float", true], + ["L447", "float", true], + ["L448", "float", true], + ["L449", "float", true], + ["L450", "float", true], + ["L451", "float", true], + ["L452", "float", true], + ["L453", "float", true], + ["L454", "float", true], + ["L455", "float", true], + ["L456", "float", true], + ["L457", "float", true], + ["L458", "float", true], + ["L459", "float", true], + ["L460", "float", true], + ["L461", "float", true], + ["L462", "rgba", true], + ["L463", "uint64", true], + ["L464", "uint64", true], + ["L465", "uint64", true], + ["L466", "uint64", true], + ["L467", "uint64", true], + ["L526", "float", true], + ["L527", "uint64", true], + ["L528", "uint64", true], + ["L529", "uint64", true], + ["L530", "uint64", true], + ["L531", "uint64", true] + ], + + "flying-lurker": [ + ["L200", "attack-info"], + ["L190", "vector"] + ], + + "target": [ + ["L728", "float", true], + ["L729", "float", true], + ["L730", "float", true], + ["L731", "float", true], + ["L732", "float", true], + ["L733", "float", true], + ["L734", "float", true], + ["L735", "float", true], + ["L736", "float", true], + ["L737", "float", true], + ["L738", "float", true], + ["L739", "float", true], + ["L740", "float", true], + ["L741", "float", true], + ["L742", "float", true], + ["L743", "float", true], + ["L744", "float", true], + ["L745", "float", true], + ["L746", "float", true], + ["L747", "float", true], + ["L748", "float", true], + ["L749", "float", true], + ["L750", "float", true], + ["L751", "float", true], + ["L752", "float", true], + ["L753", "float", true], + ["L754", "float", true], + ["L755", "float", true], + ["L756", "float", true], + ["L757", "float", true], + ["L758", "float", true], + ["L759", "float", true], + ["L760", "float", true], + ["L761", "float", true], + ["L762", "float", true], + ["L763", "float", true], + ["L764", "float", true], + ["L765", "float", true], + ["L766", "float", true], + ["L767", "float", true], + ["L768", "float", true], + ["L769", "float", true], + ["L770", "float", true], + ["L771", "float", true], + ["L772", "float", true], + ["L773", "float", true], + ["L774", "float", true], + ["L775", "float", true], + ["L776", "float", true], + ["L777", "float", true], + ["L778", "float", true], + ["L779", "float", true], + ["L780", "float", true], + ["L781", "float", true], + ["L782", "float", true], + ["L783", "float", true], + ["L784", "float", true], + ["L785", "float", true], + ["L786", "float", true], + ["L787", "float", true], + ["L788", "float", true], + ["L789", "float", true], + ["L790", "float", true], + ["L791", "float", true], + ["L792", "float", true], + ["L793", "float", true], + ["L794", "float", true], + ["L795", "float", true], + ["L796", "float", true], + ["L797", "float", true], + ["L798", "float", true], + ["L799", "float", true], + ["L800", "float", true], + ["L801", "float", true], + ["L802", "float", true], + ["L803", "float", true], + ["L804", "float", true], + ["L805", "float", true], + ["L806", "float", true], + ["L807", "float", true], + ["L808", "float", true], + ["L809", "float", true], + ["L810", "float", true], + ["L811", "float", true], + ["L812", "float", true], + ["L813", "float", true], + ["L814", "float", true], + ["L815", "float", true], + ["L816", "float", true], + ["L817", "float", true], + ["L818", "float", true], + ["L819", "float", true], + ["L820", "float", true], + ["L821", "float", true], + ["L822", "float", true], + ["L823", "uint64", true], + ["L824", "uint64", true] + ], + + "target2": [ + ["L615", "attack-info"], + ["L656", "float", true], + ["L657", "float", true], + ["L658", "float", true], + ["L659", "float", true], + ["L660", "float", true], + ["L661", "float", true], + ["L662", "float", true], + ["L663", "float", true], + ["L664", "float", true], + ["L665", "float", true], + ["L666", "float", true], + ["L667", "float", true], + ["L668", "float", true], + ["L669", "float", true], + ["L670", "float", true], + ["L671", "float", true], + ["L672", "float", true], + ["L673", "float", true], + ["L674", "float", true], + ["L675", "float", true], + ["L676", "float", true], + ["L677", "float", true], + ["L678", "float", true], + ["L679", "float", true], + ["L680", "float", true], + ["L681", "float", true], + ["L682", "float", true], + ["L683", "float", true], + ["L684", "float", true], + ["L685", "float", true], + ["L686", "float", true], + ["L687", "float", true], + ["L688", "float", true], + ["L689", "float", true], + ["L690", "float", true], + ["L691", "float", true], + ["L692", "float", true], + ["L693", "float", true], + ["L694", "float", true], + ["L695", "float", true], + ["L696", "float", true], + ["L697", "float", true], + ["L698", "float", true], + ["L699", "float", true], + ["L700", "float", true], + ["L701", "float", true], + ["L702", "float", true], + ["L703", "float", true], + ["L704", "float", true], + ["L705", "float", true], + ["L706", "float", true], + ["L707", "float", true], + ["L708", "float", true], + ["L709", "float", true], + ["L710", "float", true], + ["L711", "float", true], + ["L712", "float", true], + ["L713", "float", true], + ["L714", "float", true], + ["L715", "float", true], + ["L716", "float", true], + ["L717", "float", true], + ["L718", "float", true], + ["L719", "float", true], + ["L720", "float", true], + ["L721", "float", true], + ["L722", "float", true], + ["L723", "float", true], + ["L724", "float", true], + ["L725", "float", true], + ["L726", "float", true], + ["L727", "float", true], + ["L728", "float", true], + ["L729", "float", true], + ["L730", "float", true], + ["L731", "float", true], + ["L732", "float", true], + ["L733", "float", true], + ["L734", "float", true], + ["L735", "float", true], + ["L736", "float", true], + ["L737", "float", true], + ["L738", "float", true], + ["L739", "float", true], + ["L740", "float", true], + ["L741", "float", true], + ["L742", "float", true], + ["L743", "float", true], + ["L744", "float", true], + ["L745", "float", true], + ["L746", "float", true], + ["L747", "float", true], + ["L748", "uint64", true], + ["L759", "uint64", true] + ], + + "target-death": [ + ["L314", "vector"], + ["L322", "float", true], + ["L323", "float", true], + ["L324", "float", true], + ["L325", "float", true], + ["L326", "float", true], + ["L327", "float", true], + ["L328", "float", true], + ["L329", "float", true], + ["L330", "float", true], + ["L331", "float", true], + ["L332", "float", true], + ["L333", "float", true], + ["L334", "float", true], + ["L335", "float", true], + ["L336", "float", true], + ["L337", "float", true], + ["L338", "float", true], + ["L339", "float", true], + ["L340", "float", true], + ["L341", "float", true], + ["L342", "float", true], + ["L343", "float", true], + ["L344", "float", true], + ["L345", "float", true], + ["L346", "float", true], + ["L347", "float", true], + ["L348", "float", true], + ["L349", "float", true], + ["L350", "uint64", true], + ["L351", "uint64", true], + ["L352", "uint64", true], + ["L353", "uint64", true], + ["L354", "uint64", true], + ["L355", "uint64", true], + ["L356", "uint64", true], + ["L357", "uint64", true], + ["L358", "uint64", true], + ["L361", "float", true] + ], + + "progress": [ + ["L574", "vector"], + ["L576", "vector"], + ["L578", "vector"], + ["L580", "vector"], + ["L582", "vector"], + ["L584", "vector"], + ["L587", "float", true], + ["L588", "float", true], + ["L589", "float", true], + ["L590", "float", true], + ["L591", "float", true], + ["L592", "float", true], + ["L593", "float", true], + ["L594", "float", true], + ["L595", "float", true], + ["L596", "float", true], + ["L597", "float", true], + ["L598", "float", true], + ["L599", "float", true], + ["L600", "float", true], + ["L601", "float", true], + ["L602", "float", true], + ["L603", "float", true], + ["L604", "float", true], + ["L605", "float", true], + ["L606", "float", true], + ["L607", "float", true], + ["L608", "float", true], + ["L609", "float", true], + ["L610", "float", true], + ["L611", "float", true], + ["L612", "float", true], + ["L613", "float", true], + ["L614", "float", true], + ["L615", "float", true], + ["L617", "float", true], + ["L616", "float", true], + ["L618", "float", true], + ["L619", "float", true], + ["L620", "float", true], + ["L621", "float", true], + ["L622", "float", true], + ["L623", "float", true], + ["L624", "float", true], + ["L625", "float", true], + ["L626", "float", true], + ["L627", "float", true], + ["L628", "float", true], + ["L629", "float", true], + ["L630", "float", true], + ["L631", "float", true], + ["L632", "float", true], + ["L633", "float", true], + ["L634", "float", true], + ["L635", "float", true], + ["L636", "float", true], + ["L637", "uint64", true], + ["L638", "uint64", true], + ["L639", "uint64", true], + ["L640", "uint64", true], + ["L641", "uint64", true], + ["L642", "uint64", true], + ["L643", "uint64", true], + ["L644", "uint64", true], + ["L645", "uint64", true], + ["L646", "uint64", true], + ["L647", "uint64", true], + ["L648", "uint64", true], + ["L649", "uint64", true], + ["L650", "uint64", true], + ["L668", "uint64", true] + ], + + "citadel-obs": [["L267", "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.jsonc b/decompiler/config/jak1_ntsc_black_label.jsonc index d35033104a..3b47568866 100644 --- a/decompiler/config/jak1_ntsc_black_label.jsonc +++ b/decompiler/config/jak1_ntsc_black_label.jsonc @@ -18,7 +18,10 @@ "disassemble_code": false, // Run the decompiler - "decompile_code": true, + "decompile_code": false, + + // run the first pass of the decompiler + "find_functions": true, //////////////////////////// // DATA ANALYSIS OPTIONS @@ -35,6 +38,8 @@ "process_game_text": true, // unpack game count to assets folder "process_game_count": true, + // write goal imports for art groups + "process_art_groups": true, /////////////////////////// // WEIRD OPTIONS @@ -42,13 +47,13 @@ // these options are used rarely and should usually be left at false - // output a file type_defs.gc which is used for the types part of all-types.gc - "regenerate_all_types": false, - // generate the symbol_map.json file. // this is a guess at where each symbol is first defined/used. "generate_symbol_definition_map": false, + // genreate the all-types file + "generate_all_types" : false, + // debug option for instruction decoder "write_hex_near_instructions": false, @@ -77,7 +82,9 @@ "stack_structures_file": "decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc", "hacks_file": "decompiler/config/jak1_ntsc_black_label/hacks.jsonc", "inputs_file": "decompiler/config/jak1_ntsc_black_label/inputs.jsonc", - "new_strings_file": "decompiler/config/jak1_ntsc_black_label/new_strings.jsonc", + "art_info_file": "decompiler/config/jak1_ntsc_black_label/art_info.jsonc", + "import_deps_file": "decompiler/config/jak1_ntsc_black_label/import_deps.jsonc", + "all_types_file": "decompiler/config/all-types.gc", // optional: a predetermined object file name map from a file. // this will make decompilation naming consistent even if you only run on some objects. @@ -90,5 +97,59 @@ // turn this on to extract level background graphics data "levels_extract": true, // turn this on if you want extracted levels to be saved out as .obj files - "levels_convert_to_obj": false + "levels_convert_to_obj": false, + // should we extract collision meshes? + // these can be displayed in game, but makes the .fr3 files slightly larger + "extract_collision": true, + + //////////////////////////// + // PATCHING OPTIONS + //////////////////////////// + + // these are options related to xdelta3 patches on specific objects + // this allows us to get a more consistent input + + // set to true to write new patch files + "write_patches": false, + // set to true to apply patch files + "apply_patches": true, + // what to patch an object to and the patch file is + "object_patches": { + "0COMMON": { + "crc32": "DD2CD7E2", + "in": "decompiler_out/jak1_pal/raw_obj/0COMMON.go", + "out": "game/assets/jak1/patches/0common.xd3" + }, + "1COMMON": { + "crc32": "2B9C79F9", + "in": "decompiler_out/jak1_pal/raw_obj/1COMMON.go", + "out": "game/assets/jak1/patches/1common.xd3" + }, + "2COMMON": { + "crc32": "DA35C5F3", + "in": "decompiler_out/jak1_pal/raw_obj/2COMMON.go", + "out": "game/assets/jak1/patches/2common.xd3" + }, + "3COMMON": { + "crc32": "50C4A6A0", + "in": "decompiler_out/jak1_pal/raw_obj/3COMMON.go", + "out": "game/assets/jak1/patches/3common.xd3" + }, + "4COMMON": { + "crc32": "C475F525", + "in": "decompiler_out/jak1_pal/raw_obj/4COMMON.go", + "out": "game/assets/jak1/patches/4common.xd3" + }, + "5COMMON": { + "crc32": "92D44110", + "in": "decompiler_out/jak1_pal/raw_obj/5COMMON.go", + "out": "game/assets/jak1/patches/5common.xd3" + }, + "6COMMON": { + "crc32": "85B23FEE", + "in": "decompiler_out/jak1_pal/raw_obj/6COMMON.go", + "out": "game/assets/jak1/patches/6common.xd3" + } + } + } 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 9e456e0301..50f4d8ab12 100644 --- a/decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc @@ -506,7 +506,7 @@ ], "game-info": [ - [17, "(function symbol symbol continue-point symbol none)"], + [17, "(function symbol symbol continue-point game-save none)"], [6, "(function process-drawable none)"], [7, "(function none :behavior process-drawable)"], [8, "(function object)"] @@ -875,7 +875,7 @@ ], "target2": [ - [11, "(function vector time-frame float symbol :behavior target)"], + [11, "(function vector time-frame float symbol :behavior process)"], [99, "(function symbol)"] ], @@ -890,5 +890,7 @@ "seagull": [[30, "(function process symbol)"]], + "yakow": [[29, "(function none :behavior process)"]], + "placeholder-do-not-add-below": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/art_info.jsonc b/decompiler/config/jak1_ntsc_black_label/art_info.jsonc new file mode 100644 index 0000000000..19d3993682 --- /dev/null +++ b/decompiler/config/jak1_ntsc_black_label/art_info.jsonc @@ -0,0 +1,27 @@ +{ + ////////////////////// + // ART INFO + ////////////////////// + + // defines what art group each file or function is using. + // by default, the decompiler assumes to be the name of the current file + -ag + // so you only need to specify it when that's not the case. + // NOTE: it's fine to have a function and its file both in here. the function takes priority. + + "files": { + "target": "eichar-ag", + "target2": "eichar-ag", + "target-death": "eichar-ag", + "powerups": "eichar-ag", + "snow-ram": "ram-ag" + }, + + "functions": { + "(code target-warp-out)": "eichar-ag", + "(code mistycannon-missile-idle)": "sack-ag", + "(code billy-snack-eat)": "farthy-snack-ag", + "(code plunger-lurker-plunge)": "plunger-lurker-ag", + "(code plunger-lurker-flee)": "plunger-lurker-ag", + "(code plunger-lurker-idle)": "plunger-lurker-ag" + } +} diff --git a/decompiler/config/jak1_ntsc_black_label/hacks.jsonc b/decompiler/config/jak1_ntsc_black_label/hacks.jsonc index fbaccc3a63..df452c7c5b 100644 --- a/decompiler/config/jak1_ntsc_black_label/hacks.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/hacks.jsonc @@ -18,7 +18,8 @@ "cond_with_else_max_lengths": [ ["(method 20 res-lump)", "b0", 2], ["(method 11 res-lump)", "b0", 1], - ["(method 12 res-lump)", "b0", 1] + ["(method 12 res-lump)", "b0", 1], + ["(method 31 progress)", "b35", 1] ], // if a cond with an else case is being used a value in a place where it looks wrong @@ -140,11 +141,8 @@ "generic-envmap-only-proc", "generic-no-light", "generic-no-light+envmap", - "generic-no-light-dproc", "generic-no-light-dproc-only", "generic-no-light-proc", - "generic-interp-dproc", - "generic-envmap-dproc", "generic-prepare-dma-single", "generic-prepare-dma-double", "generic-envmap-proc", @@ -162,11 +160,9 @@ "generic-merc-init-asm", // generic-tie - "generic-tie-convert", "generic-tie-convert-proc", "generic-tie-upload-next", "generic-tie-decompress", - "generic-tie-dma-to-spad-sync", // shadow-cpu "shadow-add-double-edges", @@ -199,8 +195,6 @@ // tie-methods "draw-inline-array-prototype-tie-near-asm", "draw-inline-array-prototype-tie-asm", - "draw-inline-array-prototype-tie-generic-asm", - "draw-inline-array-instance-tie", // sparticle-launcher "sp-init-fields!", @@ -423,7 +417,7 @@ "draw-drawable-tree-ice-tfrag": [6, 8, 13, 15], "draw-drawable-tree-instance-tie": [10, 12, 18, 20, 26, 28, 37, 39], "draw-drawable-tree-instance-shrub": [5, 7, 9, 11], - + "birth-pickup-at-point": [0], "draw-bones": [0, 1, 2, 8, 81], "draw-bones-hud": [7, 8], @@ -612,7 +606,16 @@ "shadow-scissor-top", "shadow-scissor-edges", "shadow-calc-dual-verts", - "shadow-xform-verts" + "shadow-xform-verts", + + // generic tie + "draw-inline-array-instance-tie", + "generic-tie-dma-to-spad-sync", + "draw-inline-array-prototype-tie-generic-asm", + "generic-interp-dproc", + "generic-no-light-dproc", + "generic-envmap-dproc", + "generic-tie-convert" ], "mips2c_jump_table_functions": { diff --git a/decompiler/config/jak1_ntsc_black_label/import_deps.jsonc b/decompiler/config/jak1_ntsc_black_label/import_deps.jsonc new file mode 100644 index 0000000000..fc6d78ae13 --- /dev/null +++ b/decompiler/config/jak1_ntsc_black_label/import_deps.jsonc @@ -0,0 +1,470 @@ +{ + "jungle-obs": [ + "goal_src/import/maindoor-ag.gc", + "goal_src/import/junglecam-ag.gc", + "goal_src/import/precurbridge-ag.gc", + "goal_src/import/sidedoor-ag.gc", + "goal_src/import/towertop-ag.gc", + "goal_src/import/logtrap-ag.gc", + "goal_src/import/lurkerm-tall-sail-ag.gc", + "goal_src/import/medres-firecanyon-ag.gc", + "goal_src/import/lurkerm-piston-ag.gc", + "goal_src/import/accordian-ag.gc" + ], + "assistant-village2": [ + "goal_src/import/jaws-ag.gc", + "goal_src/import/assistant-village2-ag.gc" + ], + "floating-launcher": ["goal_src/import/floating-launcher-ag.gc"], + "jungle-mirrors": [ + "goal_src/import/periscope-ag.gc", + "goal_src/import/reflector-mirror-ag.gc" + ], + "citb-drop-plat": ["goal_src/import/citb-drop-plat-ag.gc"], + "rolling-robber": ["goal_src/import/robber-ag.gc"], + "balloonlurker": ["goal_src/import/balloonlurker-ag.gc"], + "racer": ["goal_src/import/racer-ag.gc"], + "mistycannon": [ + "goal_src/import/sack-ag.gc", + "goal_src/import/mistycannon-ag.gc" + ], + "beach-obs": [ + "goal_src/import/ecoventrock-ag.gc", + "goal_src/import/beachcam-ag.gc", + "goal_src/import/windmill-one-ag.gc", + "goal_src/import/kickrock-ag.gc", + "goal_src/import/harvester-ag.gc", + "goal_src/import/flutflutegg-ag.gc", + "goal_src/import/grottopole-ag.gc", + "goal_src/import/flutflut-ag.gc", + "goal_src/import/bladeassm-ag.gc" + ], + "snow-flutflut-obs": [ + "goal_src/import/snow-button-ag.gc", + "goal_src/import/flutflut-plat-med-ag.gc", + "goal_src/import/flutflut-plat-small-ag.gc", + "goal_src/import/flutflut-plat-large-ag.gc" + ], + "snow-ball": ["goal_src/import/snow-ball-ag.gc"], + "sun-iris-door": ["goal_src/import/sun-iris-door-ag.gc"], + "bouncer": ["goal_src/import/bounceytarp-ag.gc"], + "swamp-blimp": [ + "goal_src/import/swamp-tetherrock-ag.gc", + "goal_src/import/swamp-rope-ag.gc", + "goal_src/import/swamp-tetherrock-explode-ag.gc", + "goal_src/import/precursor-arm-ag.gc", + "goal_src/import/swamp-blimp-ag.gc" + ], + "village-obs": [ + "goal_src/import/windmill-sail-ag.gc", + "goal_src/import/medres-beach3-ag.gc", + "goal_src/import/mayorgears-ag.gc", + "goal_src/import/medres-village11-ag.gc", + "goal_src/import/revcycleprop-ag.gc", + "goal_src/import/medres-jungle2-ag.gc", + "goal_src/import/revcycle-ag.gc", + "goal_src/import/medres-misty-ag.gc", + "goal_src/import/sagesail-ag.gc", + "goal_src/import/windspinner-ag.gc", + "goal_src/import/medres-jungle1-ag.gc", + "goal_src/import/medres-village12-ag.gc", + "goal_src/import/hutlamp-ag.gc", + "goal_src/import/medres-jungle-ag.gc", + "goal_src/import/medres-village13-ag.gc", + "goal_src/import/medres-beach2-ag.gc", + "goal_src/import/villa-starfish-ag.gc", + "goal_src/import/medres-training-ag.gc", + "goal_src/import/medres-beach-ag.gc", + "goal_src/import/reflector-middle-ag.gc", + "goal_src/import/medres-beach1-ag.gc" + ], + "swamp-bat": ["goal_src/import/swamp-bat-ag.gc"], + "crates": ["goal_src/import/crate-ag.gc"], + "lurkerpuppy": ["goal_src/import/lurkerpuppy-ag.gc"], + "light-eco": ["goal_src/import/light-eco-ag.gc"], + "voicebox": ["goal_src/import/speaker-ag.gc"], + "green-eco-lurker": ["goal_src/import/green-eco-lurker-ag.gc"], + "helix-water": [ + "goal_src/import/helix-slide-door-ag.gc", + "goal_src/import/helix-button-ag.gc" + ], + "billy": [ + "goal_src/import/farthy-snack-ag.gc", + "goal_src/import/billy-ag.gc", + "goal_src/import/billy-sidekick-ag.gc" + ], + "snow-ram": ["goal_src/import/ram-ag.gc"], + "blocking-plane": ["goal_src/import/ef-plane-ag.gc"], + "target-util": ["goal_src/import/eichar-ag.gc"], + "beach-rocks": ["goal_src/import/lrocklrg-ag.gc"], + "sunken-obs": [ + "goal_src/import/seaweed-ag.gc", + "goal_src/import/sunkencam-ag.gc", + "goal_src/import/side-to-side-plat-ag.gc" + ], + "qbert-plat": [ + "goal_src/import/qbert-plat-ag.gc", + "goal_src/import/qbert-plat-on-ag.gc" + ], + "sun-exit-chamber": [ + "goal_src/import/exit-chamber-ag.gc", + "goal_src/import/blue-eco-charger-ag.gc", + "goal_src/import/blue-eco-charger-orb-ag.gc" + ], + "mother-spider": ["goal_src/import/mother-spider-ag.gc"], + "darkvine": ["goal_src/import/darkvine-ag.gc"], + "sidekick": ["goal_src/import/sidekick-ag.gc"], + "kermit": ["goal_src/import/kermit-ag.gc"], + "firecanyon-obs": [ + "goal_src/import/crate-darkeco-cluster-ag.gc", + "goal_src/import/spike-ag.gc" + ], + "orbit-plat": [ + "goal_src/import/orbit-plat-ag.gc", + "goal_src/import/orbit-plat-bottom-ag.gc" + ], + "fishermans-boat": [ + "goal_src/import/evilbro-ag.gc", + "goal_src/import/fishermans-boat-ag.gc", + "goal_src/import/evilsis-ag.gc" + ], + "driller-lurker": ["goal_src/import/driller-lurker-ag.gc"], + "sidekick-human": [ + "goal_src/import/darkecocan-ag.gc", + "goal_src/import/sidekick-human-ag.gc", + "goal_src/import/evilbro-ag.gc", + "goal_src/import/evilsis-ag.gc" + ], + "misty-conveyor": [ + "goal_src/import/keg-conveyor-ag.gc", + "goal_src/import/keg-conveyor-paddle-ag.gc", + "goal_src/import/keg-ag.gc" + ], + "snow-ram-boss": ["goal_src/import/ram-boss-ag.gc"], + "junglefish": ["goal_src/import/junglefish-ag.gc"], + "swamp-obs": [ + "goal_src/import/swamp-rock-ag.gc", + "goal_src/import/swamp-spike-ag.gc", + "goal_src/import/swampcam-ag.gc", + "goal_src/import/tar-plat-ag.gc", + "goal_src/import/balance-plat-ag.gc" + ], + "snow-bumper": ["goal_src/import/snow-bumper-ag.gc"], + "darkcave-obs": ["goal_src/import/cavecrystal-ag.gc"], + "junglesnake": ["goal_src/import/junglesnake-ag.gc"], + "evilbro": ["goal_src/import/evilbro-ag.gc", "goal_src/import/evilsis-ag.gc"], + "bully": ["goal_src/import/bully-ag.gc"], + "square-platform": ["goal_src/import/square-platform-ag.gc"], + "dark-crystal": ["goal_src/import/dark-crystal-ag.gc"], + "sage-village3": [ + "goal_src/import/evilsis-village3-ag.gc", + "goal_src/import/sage-village3-ag.gc", + "goal_src/import/evilbro-village3-ag.gc" + ], + "yakow": ["goal_src/import/village1cam-ag.gc", "goal_src/import/yakow-ag.gc"], + "plat-button": ["goal_src/import/plat-button-ag.gc"], + "hud-classes": ["goal_src/import/fuelcell-naked-ag.gc"], + "misty-obs": [ + "goal_src/import/breakaway-right-ag.gc", + "goal_src/import/boatpaddle-ag.gc", + "goal_src/import/breakaway-mid-ag.gc", + "goal_src/import/mis-bone-platform-ag.gc", + "goal_src/import/breakaway-left-ag.gc", + "goal_src/import/windturbine-ag.gc", + "goal_src/import/mistycam-ag.gc", + "goal_src/import/mis-bone-bridge-ag.gc" + ], + "rolling-obs": [ + "goal_src/import/rollingcam-ag.gc", + "goal_src/import/pusher-ag.gc", + "goal_src/import/happy-plant-ag.gc", + "goal_src/import/dark-plant-ag.gc", + "goal_src/import/rolling-start-ag.gc" + ], + "aphid": ["goal_src/import/aphid-lurker-ag.gc"], + "plat-eco": ["goal_src/import/plat-eco-ag.gc"], + "assistant": ["goal_src/import/assistant-ag.gc"], + "flutflut-bluehut": ["goal_src/import/flutflut-bluehut-ag.gc"], + "explorer": ["goal_src/import/explorer-ag.gc"], + "rolling-lightning-mole": ["goal_src/import/lightning-mole-ag.gc"], + "plat": [ + "goal_src/import/plat-sunken-ag.gc", + "goal_src/import/plat-ag.gc", + "goal_src/import/plat-jungleb-ag.gc" + ], + "flutflut": ["goal_src/import/flut-saddle-ag.gc"], + "training-obs": [ + "goal_src/import/scarecrow-b-ag.gc", + "goal_src/import/pontoonfive-ag.gc", + "goal_src/import/trainingcam-ag.gc", + "goal_src/import/scarecrow-a-ag.gc", + "goal_src/import/jng-iris-door-ag.gc" + ], + "snow-obs": [ + "goal_src/import/snowcam-ag.gc", + "goal_src/import/snow-fort-gate-ag.gc", + "goal_src/import/snow-eggtop-ag.gc", + "goal_src/import/snow-spatula-ag.gc", + "goal_src/import/snow-switch-ag.gc", + "goal_src/import/snow-gears-ag.gc", + "goal_src/import/snowpusher-ag.gc", + "goal_src/import/snow-log-ag.gc" + ], + "citadel-obs": [ + "goal_src/import/citb-generator-ag.gc", + "goal_src/import/citb-launcher-ag.gc", + "goal_src/import/citb-button-ag.gc", + "goal_src/import/citadelcam-ag.gc", + "goal_src/import/citb-hose-ag.gc", + "goal_src/import/citb-robotboss-ag.gc", + "goal_src/import/citb-coil-ag.gc", + "goal_src/import/citb-arm-shoulder-ag.gc", + "goal_src/import/citb-iris-door-ag.gc", + "goal_src/import/citb-disc-ag.gc", + "goal_src/import/citb-arm-ag.gc" + ], + "citadel-sages": [ + "goal_src/import/green-sagecage-ag.gc", + "goal_src/import/yellowsage-ag.gc", + "goal_src/import/redsage-ag.gc", + "goal_src/import/evilbro-citadel-ag.gc", + "goal_src/import/evilsis-citadel-ag.gc", + "goal_src/import/citb-sagecage-ag.gc", + "goal_src/import/bluesage-ag.gc" + ], + "lurkercrab": ["goal_src/import/lurkercrab-ag.gc"], + "muse": ["goal_src/import/muse-ag.gc"], + "puffer": ["goal_src/import/puffer-ag.gc"], + "robotboss-misc": [ + "goal_src/import/silodoor-ag.gc", + "goal_src/import/ecoclaw-ag.gc", + "goal_src/import/finalbosscam-ag.gc" + ], + "sage-finalboss": [ + "goal_src/import/plat-eco-finalboss-ag.gc", + "goal_src/import/green-sagecage-ag.gc", + "goal_src/import/jak-white-ag.gc", + "goal_src/import/robotboss-cinematic-ag.gc" + ], + "target-racer-h": ["goal_src/import/balloon-ag.gc"], + "gambler": ["goal_src/import/gambler-ag.gc"], + "lavatube-obs": [ + "goal_src/import/lavafallsewerb-ag.gc", + "goal_src/import/lavashortcut-ag.gc", + "goal_src/import/lavabase-ag.gc", + "goal_src/import/lavafallsewera-ag.gc", + "goal_src/import/chainmine-ag.gc", + "goal_src/import/lavafall-ag.gc", + "goal_src/import/lavaballoon-ag.gc", + "goal_src/import/darkecobarrel-ag.gc", + "goal_src/import/lavayellowtarp-ag.gc" + ], + "assistant-firecanyon": ["goal_src/import/assistant-firecanyon-ag.gc"], + "sharkey": ["goal_src/import/sharkey-ag.gc"], + "bonelurker": ["goal_src/import/bonelurker-ag.gc"], + "pelican": ["goal_src/import/pelican-ag.gc"], + "warrior": ["goal_src/import/warrior-ag.gc"], + "maincave-obs": [ + "goal_src/import/caveelevator-ag.gc", + "goal_src/import/cavespatulatwo-ag.gc", + "goal_src/import/cavetrapdoor-ag.gc", + "goal_src/import/maincavecam-ag.gc", + "goal_src/import/cavecrusher-ag.gc", + "goal_src/import/cavespatula-darkcave-ag.gc" + ], + "fisher": [ + "goal_src/import/fish-net-ag.gc", + "goal_src/import/fisher-ag.gc", + "goal_src/import/catch-fisha-ag.gc", + "goal_src/import/catch-fishb-ag.gc", + "goal_src/import/catch-fishc-ag.gc" + ], + "villagep-obs": [ + "goal_src/import/warp-gate-switch-ag.gc", + "goal_src/import/village-cam-ag.gc" + ], + "citb-bunny": ["goal_src/import/citb-bunny-ag.gc"], + "flying-lurker": [ + "goal_src/import/ogrecam-ag.gc", + "goal_src/import/plunger-lurker-ag.gc", + "goal_src/import/flying-lurker-ag.gc" + ], + "shover": ["goal_src/import/shover-ag.gc"], + "ice-cube": [ + "goal_src/import/ice-cube-ag.gc", + "goal_src/import/ice-cube-break-ag.gc" + ], + "baby-spider": ["goal_src/import/baby-spider-ag.gc"], + "minecart": ["goal_src/import/minecartsteel-ag.gc"], + "bird-lady": ["goal_src/import/bird-lady-ag.gc"], + "spider-egg": ["goal_src/import/spider-egg-ag.gc"], + "wall-plat": ["goal_src/import/wall-plat-ag.gc"], + "oracle": ["goal_src/import/oracle-ag.gc"], + "basebutton": ["goal_src/import/generic-button-ag.gc"], + "miners": [ + "goal_src/import/minershort-ag.gc", + "goal_src/import/cavegem-ag.gc", + "goal_src/import/minertall-ag.gc" + ], + "farmer": ["goal_src/import/farmer-ag.gc"], + "rolling-race-ring": ["goal_src/import/race-ring-ag.gc"], + "quicksandlurker": ["goal_src/import/quicksandlurker-ag.gc"], + "misty-warehouse": [ + "goal_src/import/silostep-ag.gc", + "goal_src/import/rounddoor-ag.gc" + ], + "yeti": ["goal_src/import/yeti-ag.gc"], + "hopper": ["goal_src/import/hopper-ag.gc"], + "target-death": ["goal_src/import/deathcam-ag.gc"], + "spiderwebs": ["goal_src/import/spiderwebs-ag.gc"], + "misty-teetertotter": ["goal_src/import/teetertotter-ag.gc"], + "village2-obs": [ + "goal_src/import/pontoonfive-ag.gc", + "goal_src/import/allpontoons-ag.gc", + "goal_src/import/medres-village2-ag.gc", + "goal_src/import/exit-chamber-dummy-ag.gc", + "goal_src/import/village2cam-ag.gc", + "goal_src/import/fireboulder-ag.gc", + "goal_src/import/ogreboss-village2-ag.gc", + "goal_src/import/ceilingflag-ag.gc", + "goal_src/import/medres-rolling1-ag.gc", + "goal_src/import/medres-rolling-ag.gc", + "goal_src/import/pontoonten-ag.gc" + ], + "plant-boss": ["goal_src/import/plant-boss-ag.gc"], + "snow-bunny": ["goal_src/import/snow-bunny-ag.gc"], + "sunken-elevator": ["goal_src/import/sunken-elevator-ag.gc"], + "sage": ["goal_src/import/sage-ag.gc"], + "robotboss-h": ["goal_src/import/robotboss-ag.gc"], + "geologist": ["goal_src/import/geologist-ag.gc"], + "village3-obs": [ + "goal_src/import/medres-ogre-ag.gc", + "goal_src/import/medres-finalboss-ag.gc", + "goal_src/import/pistons-ag.gc", + "goal_src/import/gondola-ag.gc", + "goal_src/import/medres-ogre2-ag.gc", + "goal_src/import/medres-ogre3-ag.gc", + "goal_src/import/gondolacables-ag.gc" + ], + "double-lurker": [ + "goal_src/import/double-lurker-ag.gc", + "goal_src/import/double-lurker-top-ag.gc" + ], + "ogreboss": ["goal_src/import/ogreboss-ag.gc"], + "swamp-rat": ["goal_src/import/swamp-rat-ag.gc"], + "sculptor": [ + "goal_src/import/sculptor-muse-ag.gc", + "goal_src/import/sculptor-ag.gc" + ], + "seagull": ["goal_src/import/seagull-ag.gc"], + "mayor": ["goal_src/import/mayor-ag.gc"], + "final-door": [ + "goal_src/import/power-left-ag.gc", + "goal_src/import/power-right-ag.gc", + "goal_src/import/powercellalt-ag.gc" + ], + "assistant-lavatube": ["goal_src/import/assistant-lavatube-start-ag.gc"], + "launcherdoor": [ + "goal_src/import/launcherdoor-maincave-ag.gc", + "goal_src/import/launcherdoor-ag.gc" + ], + "title-obs": [ + "goal_src/import/logo-cam-ag.gc", + "goal_src/import/logo-black-ag.gc", + "goal_src/import/logo-ag.gc", + "goal_src/import/logo-volumes-ag.gc", + "goal_src/import/ndi-cam-ag.gc", + "goal_src/import/ndi-ag.gc", + "goal_src/import/ndi-volumes-ag.gc" + ], + "whirlpool": ["goal_src/import/whirlpool-ag.gc"], + "lurkerworm": ["goal_src/import/lurkerworm-ag.gc"], + "collectables": [ + "goal_src/import/buzzer-ag.gc", + "goal_src/import/ecovalve-ag.gc", + "goal_src/import/money-ag.gc", + "goal_src/import/fuel-cell-ag.gc" + ], + "water-anim": [ + "goal_src/import/water-anim-maincave-ag.gc", + "goal_src/import/water-anim-village3-ag.gc", + "goal_src/import/water-anim-finalboss-ag.gc", + "goal_src/import/water-anim-maincave-water-ag.gc", + "goal_src/import/water-anim-sunken-ag.gc", + "goal_src/import/water-anim-lavatube-ag.gc", + "goal_src/import/water-anim-robocave-ag.gc", + "goal_src/import/water-anim-jungle-ag.gc", + "goal_src/import/water-anim-ogre-ag.gc", + "goal_src/import/water-anim-training-ag.gc", + "goal_src/import/water-anim-darkcave-ag.gc", + "goal_src/import/water-anim-village1-ag.gc", + "goal_src/import/water-anim-rolling-ag.gc", + "goal_src/import/water-anim-misty-ag.gc", + "goal_src/import/water-anim-sunken-dark-eco-ag.gc", + "goal_src/import/water-anim-village2-ag.gc" + ], + "ropebridge": [ + "goal_src/import/vil3-bridge-36-ag.gc", + "goal_src/import/ropebridge-36-ag.gc", + "goal_src/import/ropebridge-32-ag.gc", + "goal_src/import/ropebridge-52-ag.gc", + "goal_src/import/snow-bridge-36-ag.gc", + "goal_src/import/ropebridge-70-ag.gc" + ], + "robotboss": [ + "goal_src/import/robotboss-redeco-ag.gc", + "goal_src/import/robotboss-blueeco-ag.gc", + "goal_src/import/robotboss-yelloweco-ag.gc" + ], + "steam-cap": ["goal_src/import/steam-cap-ag.gc"], + "ogre-obs": [ + "goal_src/import/ogre-step-ag.gc", + "goal_src/import/tntbarrel-ag.gc", + "goal_src/import/ogre-bridge-ag.gc", + "goal_src/import/shortcut-boulder-ag.gc", + "goal_src/import/medres-snow-ag.gc", + "goal_src/import/ogre-bridgeend-ag.gc", + "goal_src/import/ogre-isle-ag.gc" + ], + "assistant-village3": ["goal_src/import/assistant-village3-ag.gc"], + "babak": ["goal_src/import/babak-ag.gc"], + "lavatube-energy": [ + "goal_src/import/energyball-ag.gc", + "goal_src/import/energybase-ag.gc", + "goal_src/import/energyhub-ag.gc", + "goal_src/import/energyarm-ag.gc", + "goal_src/import/energydoor-ag.gc" + ], + "mother-spider-egg": ["goal_src/import/spider-egg-ag.gc"], + "plat-flip": ["goal_src/import/plat-flip-ag.gc"], + "assistant-citadel": ["goal_src/import/assistant-lavatube-end-ag.gc"], + "bird-lady-beach": ["goal_src/import/bird-lady-beach-ag.gc"], + "orb-cache": ["goal_src/import/orb-cache-top-ag.gc"], + "robotboss-weapon": [ + "goal_src/import/darkecobomb-ag.gc", + "goal_src/import/greenshot-ag.gc", + "goal_src/import/redring-ag.gc" + ], + "citb-plat": [ + "goal_src/import/citb-exit-plat-ag.gc", + "goal_src/import/plat-eco-citb-ag.gc", + "goal_src/import/plat-citb-ag.gc", + "goal_src/import/citb-stopbox-ag.gc", + "goal_src/import/citb-firehose-ag.gc", + "goal_src/import/citb-rotatebox-ag.gc", + "goal_src/import/citb-chain-plat-ag.gc", + "goal_src/import/citb-donut-ag.gc" + ], + "gnawer": ["goal_src/import/gnawer-ag.gc"], + "jungleb-obs": [ + "goal_src/import/eggtop-ag.gc", + "goal_src/import/jng-iris-door-ag.gc" + ], + "swamp-rat-nest": ["goal_src/import/swamp-rat-nest-ag.gc"], + "wedge-plats": [ + "goal_src/import/wedge-plat-outer-ag.gc", + "goal_src/import/wedge-plat-ag.gc" + ], + "sunken-fish": ["goal_src/import/sunkenfisha-ag.gc"], + "sage-bluehut": ["goal_src/import/sage-bluehut-ag.gc"] +} diff --git a/decompiler/config/jak1_ntsc_black_label/inputs.jsonc b/decompiler/config/jak1_ntsc_black_label/inputs.jsonc index 957a623564..980908810c 100644 --- a/decompiler/config/jak1_ntsc_black_label/inputs.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/inputs.jsonc @@ -47,7 +47,7 @@ ], // some objects are part of STR files (streaming data). In Jak 1 this is just animations - "str_file_names": [ + "str_file_names": [/* "STR/BAFCELL.STR", "STR/SWTE4.STR", "STR/SWTE3.STR", @@ -245,7 +245,7 @@ "STR/GRSOPREB.STR", "STR/GRSOBBB.STR", "STR/SA3INTRO.STR" - ], + */], // some objects are directly stored as files on the DVD. This is just text files. "object_file_names": [ @@ -262,7 +262,14 @@ //"audio_dir_file_name": "jak1/VAG", "audio_dir_file_name": "", - "streamed_audio_file_names": ["VAGWAD.ENG", "VAGWAD.JAP"], + "streamed_audio_file_names": [ + "VAGWAD.ENG", + "VAGWAD.FRE", + "VAGWAD.SPA", + "VAGWAD.GER", + "VAGWAD.ITA", + "VAGWAD.JAP" + ], "levels_to_extract": [ "BEA.DGO", diff --git a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc index 355241485e..c2fab39ce2 100644 --- a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc @@ -157,7 +157,15 @@ ["L276", "vector"], ["L277", "vector"], ["L278", "vector"], - ["L279", "vector"] + ["L279", "vector"], + ["L280", "(array float)"], + ["L281", "(array float)"], + ["L282", "(array float)"], + ["L283", "(array float)"], + ["L284", "(array float)"], + ["L285", "(array float)"], + ["L286", "(array float)"], + ["L287", "(array float)"] ], "mood-tables": [ @@ -244,7 +252,29 @@ ["L231", "(pointer uint64)", 1] ], - "progress-static": [["L121", "(array game-text-id)"]], + "progress-static": [ + ["L121", "(array game-text-id)"], + ["L195", "(array game-option)"], + ["L190", "(array game-option)"], + ["L185", "(array game-option)"], + ["L180", "(array game-option)"], + ["L174", "(array game-option)"], + ["L169", "(array game-option)"], + ["L165", "(array game-option)"], + ["L161", "(array game-option)"], + ["L157", "(array game-option)"], + ["L152", "(array game-option)"], + ["L147", "(array game-option)"], + ["L145", "(array game-option)"], + ["L143", "(array game-option)"], + ["L137", "(array game-option)"], + ["L131", "(array game-option)"], + ["L124", "(array game-option)"], + ["L123", "(array (array game-option))"], + ["L122", "(array int32)"], + ["L3", "(array level-tasks-info)"], + ["L2", "(array int32)"] + ], "rigid-body": [["L89", "rigid-body-platform-constants"]], @@ -542,7 +572,7 @@ ], "flying-lurker": [ - ["L197", "(pointer uint32)", 26], + ["L197", "attack-info"], ["L187", "vector"] ], @@ -708,26 +738,26 @@ ["L878", "float", true], ["L879", "float", true], ["L880", "float", true], - ["L881", "(pointer float)", 1], + ["L881", "float", true], ["L882", "float", true], ["L883", "float", true], - ["L884", "(pointer float)", 1], - ["L885", "(pointer float)", 1], + ["L884", "float", true], + ["L885", "float", true], ["L886", "float", true], ["L887", "float", true], - ["L888", "(pointer float)", 1], - ["L889", "(pointer float)", 1], - ["L890", "(pointer float)", 1], - ["L891", "(pointer float)", 1], - ["L892", "(pointer float)", 1], + ["L888", "float", true], + ["L889", "float", true], + ["L890", "float", true], + ["L891", "float", true], + ["L892", "float", true], ["L893", "float", true], ["L894", "float", true], ["L895", "float", true], - ["L896", "(pointer float)", 1], - ["L897", "(pointer float)", 1], - ["L898", "(pointer float)", 1], + ["L896", "float", true], + ["L897", "float", true], + ["L898", "float", true], ["L899", "float", true], - ["L900", "(pointer float)", 1], + ["L900", "float", true], ["L901", "uint64", true], ["L904", "uint64", true], ["L905", "uint64", true], @@ -968,14 +998,14 @@ ["L509", "(inline-array list-field)", 12], ["L523", "vector"], ["L524", "vector"], - ["L649", "(pointer float)", 1], - ["L650", "(pointer float)", 1], - ["L651", "(pointer float)", 1], - ["L652", "(pointer float)", 1], - ["L653", "(pointer float)", 1], - ["L654", "(pointer float)", 1], - ["L655", "(pointer float)", 1], - ["L656", "(pointer float)", 1], + ["L649", "float", true], + ["L650", "float", true], + ["L651", "float", true], + ["L652", "float", true], + ["L653", "float", true], + ["L654", "float", true], + ["L655", "float", true], + ["L656", "float", true], ["L657", "uint64", true], ["L658", "uint64", true], ["L663", "uint64", true], @@ -1086,7 +1116,7 @@ ["L765", "float", true], ["L766", "float", true], ["L767", "float", true], - ["L768", "(pointer float)", 1], + ["L768", "float", true], ["L769", "float", true], ["L770", "float", true], ["L771", "float", true], @@ -1355,7 +1385,7 @@ ["L412", "float", true], ["L413", "float", true], ["L414", "float", true], - ["L415", "(pointer float)", 1], + ["L415", "float", true], ["L416", "float", true], ["L417", "float", true], ["L418", "float", true], @@ -1371,18 +1401,18 @@ ["L428", "float", true], ["L429", "float", true], ["L430", "float", true], - ["L431", "(pointer float)", 1], + ["L431", "float", true], ["L432", "float", true], ["L433", "float", true], ["L434", "float", true], ["L435", "float", true], ["L436", "float", true], ["L437", "float", true], - ["L438", "(pointer float)", 1], + ["L438", "float", true], ["L439", "float", true], ["L440", "float", true], ["L441", "float", true], - ["L442", "(pointer float)", 1], + ["L442", "float", true], ["L443", "float", true], ["L444", "float", true], ["L445", "float", true], @@ -1406,10 +1436,10 @@ ["L463", "float", true], ["L464", "float", true], ["L465", "float", true], - ["L466", "(pointer float)", 1], + ["L466", "float", true], ["L467", "float", true], ["L468", "float", true], - ["L469", "(pointer float)", 1], + ["L469", "float", true], ["L470", "uint64", true], ["L498", "float", true], ["L499", "uint64", true], @@ -1472,11 +1502,11 @@ ["L731", "float", true], ["L732", "float", true], ["L733", "float", true], - ["L734", "(pointer float)", 1], - ["L735", "(pointer float)", 1], - ["L736", "(pointer float)", 1], - ["L737", "(pointer float)", 1], - ["L738", "(pointer float)", 1], + ["L734", "float", true], + ["L735", "float", true], + ["L736", "float", true], + ["L737", "float", true], + ["L738", "float", true], ["L739", "float", true], ["L740", "float", true], ["L741", "float", true], @@ -1488,7 +1518,7 @@ ["L747", "float", true], ["L748", "float", true], ["L749", "float", true], - ["L750", "(pointer float)", 1], + ["L750", "float", true], ["L751", "float", true], ["L752", "float", true], ["L753", "float", true], @@ -1505,7 +1535,7 @@ ["L764", "float", true], ["L765", "float", true], ["L766", "float", true], - ["L767", "(pointer float)", 1], + ["L767", "float", true], ["L768", "float", true], ["L769", "float", true], ["L770", "float", true], @@ -1524,8 +1554,8 @@ ["L783", "float", true], ["L784", "float", true], ["L785", "float", true], - ["L786", "(pointer float)", 1], - ["L787", "(pointer float)", 1], + ["L786", "float", true], + ["L787", "float", true], ["L788", "float", true], ["L789", "float", true], ["L790", "float", true], @@ -1552,7 +1582,7 @@ ["L811", "float", true], ["L812", "float", true], ["L813", "float", true], - ["L814", "(pointer float)", 1], + ["L814", "float", true], ["L815", "uint64", true] ], @@ -1565,7 +1595,7 @@ ["L201", "float", true], ["L202", "float", true], ["L203", "float", true], - ["L204", "(pointer float)", 1], + ["L204", "float", true], ["L205", "uint64", true], ["L206", "uint64", true], ["L207", "uint64", true], @@ -1614,13 +1644,12 @@ ["L367", "attack-info"], ["L370", "attack-info"], ["L371", "attack-info"], - ["L384", "(pointer float)", 1], - ["L384", "(pointer float)", 1], - ["L385", "(pointer float)", 1], - ["L386", "(pointer float)", 1], - ["L387", "(pointer float)", 1], - ["L388", "(pointer float)", 1], - ["L389", "(pointer float)", 1], + ["L384", "float", true], + ["L385", "float", true], + ["L386", "float", true], + ["L387", "float", true], + ["L388", "float", true], + ["L389", "float", true], ["L390", "float", true], ["L391", "float", true], ["L392", "float", true], @@ -1691,7 +1720,7 @@ ["L457", "float", true], ["L458", "float", true], ["L459", "float", true], - ["L460", "(pointer float)", 1], + ["L460", "float", true], ["L461", "rgba", true], ["L462", "uint64", true], ["L463", "uint64", true], @@ -1743,8 +1772,8 @@ ["L438", "float", true], ["L439", "float", true], ["L440", "float", true], - ["L441", "(pointer float)", 1], - ["L442", "(pointer float)", 1], + ["L441", "float", true], + ["L442", "float", true], ["L443", "float", true], ["L444", "float", true], ["L445", "float", true], @@ -1759,7 +1788,7 @@ ["L454", "float", true], ["L455", "float", true], ["L456", "float", true], - ["L457", "(pointer float)", 1], + ["L457", "float", true], ["L458", "uint64", true], ["L459", "uint64", true], ["L460", "uint64", true], @@ -1898,13 +1927,13 @@ ["L735", "float", true], ["L736", "float", true], ["L737", "float", true], - ["L738", "(pointer float)", 1], + ["L738", "float", true], ["L739", "float", true], ["L740", "float", true], ["L741", "float", true], ["L742", "float", true], ["L743", "float", true], - ["L744", "(pointer int32)", 1], + ["L744", "float", true], ["L745", "uint64", true], ["L746", "uint64", true], ["L757", "uint64", true] @@ -2106,8 +2135,11 @@ ], "generic-vu0": [["L1", "vu-function"]], - "shrubbery": [ - ["L133", "vu-function"] + "shrubbery": [["L133", "vu-function"]], + + "credits": [ + ["L32", "(array int32)"], + ["L33", "(array float)"] ], // please do not add things after this entry! git is dumb. diff --git a/decompiler/config/jak1_ntsc_black_label/new_strings.jsonc b/decompiler/config/jak1_ntsc_black_label/new_strings.jsonc deleted file mode 100644 index eed40d182b..0000000000 --- a/decompiler/config/jak1_ntsc_black_label/new_strings.jsonc +++ /dev/null @@ -1,57 +0,0 @@ -{ - "same_across_languages": { - "1008": "UK ENGLISH", - "1009": "PORTUGUÊS", - "1010": "SUOMALAINEN", - "1011": "SVENSKA", - "1012": "DANSK", - "1013": "NORSK", - "1014": "KOREAN", - "1015": "RUSSIAN", - "1022": "4:3", - "1023": "5:4", - "1024": "16:9", - "1025": "21:9", - "1026": "32:9", - "1027": "640X480", - "1028": "800X600", - "1029": "1024X768", - "1030": "1280X960", - "1031": "1600X1200", - "1032": "960X768", - "1033": "1280X1024", - "1034": "1500X1200", - "1035": "854X480", - "1036": "1280X720", - "1037": "1920X1080", - "1038": "2560X1440", - "1039": "2880X1620", - "1040": "3840X2160", - "1041": "5120X2880", - "1042": "2560X1080", - "1043": "3120X1440", - "1044": "3200X1440", - "1045": "3440X1440", - "1046": "3840X1600", - "1047": "5120X2160", - "1048": "5120X1440" - }, - // will pad the rest of the array with 'TODO' placeholder - "different_across_languages": { - "1000": ["RESOLUTION"], - "1001": ["DISPLAY MODE"], - "1002": ["LETTERBOX"], - "1003": ["SUBTITLES"], - "1004": ["SUBTITLE SPEAKER"], - "1005": ["DISCORD RPC"], - "1006": ["LANGUAGE OPTIONS"], - "1007": ["SUBTITLE LANGUAGE"], - "1016": ["ON"], - "1017": ["OFF"], - "1018": ["AUTO"], - "1019": ["BORDERLESS"], - "1020": ["FULLSCREEN"], - "1021": ["WINDOWED"], - "1049": ["USE ORIGINAL ASPECT"] - } -} diff --git a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc index 21b5550e2d..eb6772b784 100644 --- a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc @@ -2245,7 +2245,11 @@ "(code nav-enemy-give-up babak)": [[16, "vector"]], - "(method 10 gui-query)": [[16, "font-context"]], + "(method 10 gui-query)": [ + [16, "font-context"], + [112, "font-context"], + [208, "font-context"] + ], "(method 46 process-taskable)": [ [16, "vector"], @@ -5492,5 +5496,7 @@ [128, "vector"] ], + "(trans fisher-done)": [[16, "font-context"]], + "placeholder-do-not-add-below!": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc index 4eea47e2b7..9381ad6233 100644 --- a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc @@ -665,16 +665,6 @@ ], "(method 12 art-group)": [[13, "a0", "art-joint-anim"]], "(method 0 path-control)": [["_stack_", 16, "res-tag"]], - "(method 0 curve-control)": [[[13, 55], "s3", "entity"]], - "nav-mesh-connect": [ - [[4, 15], "s2", "entity-actor"], - [19, "v1", "entity"], - [20, "v1", "entity-links"], - [72, "v1", "entity"], - [73, "v1", "entity-links"], - [76, "a0", "entity"], - [77, "a0", "entity-links"] - ], "add-debug-point": [ [125, "a3", "pointer"], [[27, 144], "a0", "(pointer uint64)"], @@ -824,76 +814,21 @@ [[157, 162], "a1", "dma-packet"] ], "(top-level-login task-control)": [[165, "v1", "symbol"]], - "(anon-function 494 task-control)": [[32, "v0", "float"]], - "(anon-function 493 task-control)": [[32, "v0", "float"]], - "(anon-function 480 task-control)": [[13, "v0", "float"]], - "(anon-function 477 task-control)": [[38, "v0", "float"]], - "(anon-function 476 task-control)": [[38, "v0", "float"]], - "(anon-function 475 task-control)": [ - [37, "v0", "float"], - [81, "v0", "float"] - ], - "(anon-function 474 task-control)": [ - [37, "v0", "float"], - [81, "v0", "float"] - ], - "(anon-function 426 task-control)": [[32, "v0", "float"]], - "(anon-function 425 task-control)": [[32, "v0", "float"]], - "(anon-function 415 task-control)": [[32, "v0", "float"]], - "(anon-function 414 task-control)": [[32, "v0", "float"]], - "(anon-function 365 task-control)": [[32, "v0", "float"]], - "(anon-function 364 task-control)": [[32, "v0", "float"]], - "(anon-function 363 task-control)": [[32, "v0", "float"]], - "(anon-function 362 task-control)": [[32, "v0", "float"]], - "(anon-function 337 task-control)": [[32, "v0", "float"]], - "(anon-function 336 task-control)": [[32, "v0", "float"]], - "(anon-function 227 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 286 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 366 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 367 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 368 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 369 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 380 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 383 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 390 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 393 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 400 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 403 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 435 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 445 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 455 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 38 task-control)": [[13, "v0", "float"]], - "(anon-function 28 task-control)": [[13, "v0", "float"]], + "(anon-function 227 task-control)": [[17, "v1", "float"]], + "(anon-function 286 task-control)": [[17, "v1", "float"]], + "(anon-function 366 task-control)": [[17, "v1", "float"]], + "(anon-function 367 task-control)": [[17, "v1", "float"]], + "(anon-function 368 task-control)": [[17, "v1", "float"]], + "(anon-function 369 task-control)": [[17, "v1", "float"]], + "(anon-function 380 task-control)": [[17, "v1", "float"]], + "(anon-function 383 task-control)": [[17, "v1", "float"]], + "(anon-function 390 task-control)": [[17, "v1", "float"]], + "(anon-function 393 task-control)": [[17, "v1", "float"]], + "(anon-function 400 task-control)": [[17, "v1", "float"]], + "(anon-function 403 task-control)": [[17, "v1", "float"]], + "(anon-function 435 task-control)": [[17, "v1", "float"]], + "(anon-function 445 task-control)": [[17, "v1", "float"]], + "(anon-function 455 task-control)": [[17, "v1", "float"]], "(method 18 game-info)": [ [4, "v1", "symbol"], [5, "v1", "level-load-info"], @@ -1309,7 +1244,6 @@ [171, "v1", "anim-test-seq-item"], [173, "v1", "anim-test-seq-item"] ], - "anim-tester-start": [[20, "t9", "(function process function none)"]], "anim-tester-set-name": [ [[34, 51], "s3", "anim-test-obj"], [[40, 63], "s5", "anim-test-sequence"] @@ -3606,8 +3540,8 @@ ], "v-slrp!": [ - [19, "v1", "(pointer float)"], - [26, "v1", "(pointer float)"] + [54, "s3", "float"], + [65, "s3", "float"] ], "clmf-pos-rot": [ @@ -4866,7 +4800,10 @@ "(code plant-boss-root-idle)": [[17, "v1", "art-joint-anim"]], - "(code plant-boss-eat)": [[274, "v1", "art-joint-anim"]], + "(code plant-boss-eat)": [ + [22, "v1", "float"], + [274, "v1", "art-joint-anim"] + ], "(code plant-boss-vulnerable)": [ [149, "v1", "art-joint-anim"], @@ -5140,7 +5077,10 @@ [50, "s5", "eco-collectable"] ], - "fuel-cell-init-by-other": [[118, "gp", "vector"]], + "fuel-cell-init-by-other": [ + [108, "v0", "fact-options"], + [118, "gp", "vector"] + ], "ecovalve-init-by-other": [ [95, "a0", "process-drawable"], @@ -5191,7 +5131,10 @@ "(code die eco)": [[53, "v1", "float"]], - "(trans pickup fuel-cell)": [[92, "v1", "float"]], + "(trans pickup fuel-cell)": [ + [92, "v1", "float"], + [130, "v0", "fact-options"] + ], "(enter notice-blue eco-collectable)": [[13, "v1", "float"]], @@ -5238,9 +5181,8 @@ ], "(method 12 touching-list)": [ - [4, "gp", "touching-shapes-entry"], - [6, "gp", "touching-shapes-entry"], - [67, "gp", "touching-shapes-entry"] + [[4, 67], "gp", "touching-shapes-entry"], + [67, "gp", "(inline-array touching-shapes-entry)"] ], "(method 35 collide-shape)": [ @@ -5417,12 +5359,14 @@ ], "target-hit-ground-anim": [ + [55, "v1", "float"], [79, "v1", "art-joint-anim"], [312, "v1", "art-joint-anim"], [389, "v1", "art-joint-anim"], [441, "v1", "art-joint-anim"], [520, "v1", "art-joint-anim"], [578, "v1", "art-joint-anim"], + [660, "v1", "float"], [675, "v1", "art-joint-anim"], [736, "v1", "art-joint-anim"], [846, "v1", "art-joint-anim"] @@ -5435,17 +5379,21 @@ [234, "v1", "art-joint-anim"], [298, "v1", "art-joint-anim"], [389, "v1", "art-joint-anim"], - [503, "v1", "art-joint-anim"] + [503, "v1", "art-joint-anim"], + [626, "v1", "float"] ], "(code target-walk)": [ [146, "v1", "art-joint-anim"], - [243, "v1", "art-joint-anim"] + [243, "v1", "art-joint-anim"], + [527, "v1", "float"], + [591, "v1", "float"] ], "(code target-slide-down)": [[26, "v1", "art-joint-anim"]], "(code target-jump-forward)": [[13, "v1", "art-joint-anim"]], + "(code target-jump)": [[127, "v1", "float"]], "(code target-double-jump)": [[24, "v1", "art-joint-anim"]], @@ -5464,6 +5412,8 @@ [168, "v1", "art-joint-anim"] ], + "(code target-attack-uppercut)": [[39, "v1", "float"]], + "mod-var-jump": [ [77, "f0", "float"], [80, "f0", "float"], @@ -5956,20 +5906,14 @@ [67, "v1", "art-joint-anim"] ], - "(method 56 ram-boss)": [ - [24, "v0", "ram-boss-proj"], - [58, "v1", "(pointer ram-boss-proj)"] - ], + "(method 56 ram-boss)": [[58, "v1", "(pointer ram-boss-proj)"]], "(code ram-idle)": [ [28, "v1", "art-joint-anim"], [98, "v1", "art-joint-anim"] ], - "(code ram-give-fuel-cell)": [ - [47, "v0", "snowcam"], - [69, "v1", "(pointer snowcam)"] - ], + "(code ram-give-fuel-cell)": [[69, "v1", "(pointer snowcam)"]], "(code snow-bumper-deactivate)": [ [29, "v1", "art-joint-anim"], @@ -6480,7 +6424,7 @@ [14, "t9", "(function process-drawable int process-drawable)"] ], - "(code helix-button-activate)": [[37, "v0", "sunkencam"]], + "(code helix-button-activate)": [[58, "v1", "(pointer sunkencam)"]], "(code target-flut-jump)": [[137, "v1", "float"]], @@ -7024,6 +6968,7 @@ [608, "a1", "(pointer symbol)"], [617, "v1", "(pointer symbol)"], [626, "a1", "(pointer symbol)"], + [883, "a0", "(pointer language-enum)"], [894, "a0", "(pointer symbol)"], [921, "a0", "(pointer symbol)"] ], @@ -7586,7 +7531,7 @@ [[30, 38], "a2", "dma-packet"] ], - "draw-bones-shadow" : [ + "draw-bones-shadow": [ [10, "t0", "terrain-context"], [[36, 100], "t0", "shadow-dma-packet"], [[53, 58], "t6", "(inline-array vector)"], @@ -7594,7 +7539,7 @@ [[103, 106], "v1", "dma-packet"] ], - "shadow-execute-all" : [ + "shadow-execute-all": [ [108, "gp", "shadow-dcache"], [113, "gp", "shadow-dcache"], [118, "gp", "shadow-dcache"], @@ -7605,7 +7550,7 @@ "shadow-dma-init": [ [[25, 29], "t6", "dma-packet"], - [[34,37], "t6", "gs-gif-tag"], + [[34, 37], "t6", "gs-gif-tag"], [41, "t4", "(pointer gs-reg)"], [43, "t4", "(pointer gs-reg)"], [45, "t4", "(pointer gs-test)"], @@ -7690,9 +7635,7 @@ [273, "t0", "(pointer uint64)"], [275, "t0", "(pointer gs-reg64)"] ], - "test-func": [ - [7, "f1", "float"] - ], + "test-func": [[7, "f1", "float"]], "(method 14 drawable-tree-instance-shrub)": [ [[12, 151], "gp", "prototype-bucket-shrub"], @@ -7704,9 +7647,7 @@ [151, "gp", "(inline-array prototype-bucket-shrub)"] ], - "(method 10 drawable-tree-instance-shrub)": [ - [3, "a1", "terrain-context"] - ], + "(method 10 drawable-tree-instance-shrub)": [[3, "a1", "terrain-context"]], "draw-prototype-inline-array-shrub": [ [[13, 55], "v1", "prototype-bucket-shrub"], @@ -7740,13 +7681,9 @@ [540, "v1", "terrain-context"] ], - "(method 8 drawable-tree-instance-shrub)": [ - [54, "v1", "drawable-group"] - ], + "(method 8 drawable-tree-instance-shrub)": [[54, "v1", "drawable-group"]], - "draw-drawable-tree-instance-shrub": [ - [85, "a0", "drawable-group"] - ], + "draw-drawable-tree-instance-shrub": [[85, "a0", "drawable-group"]], "shrub-init-frame": [ [[6, 12], "a0", "dma-packet"], @@ -7766,14 +7703,19 @@ [54, "v1", "(pointer uint32)"] ], - "shrub-upload-view-data": [ - [[3, 16], "a0", "dma-packet"] - ], + "shrub-upload-view-data": [[[3, 16], "a0", "dma-packet"]], "shrub-upload-model": [ [[17, 26], "a3", "dma-packet"], [[33, 41], "a0", "dma-packet"], [[47, 55], "a0", "dma-packet"] ], + + "(method 12 effect-control)": [["_stack_", 112, "res-tag"]], + + "generic-tie-execute": [ + [118, "v1", "terrain-context"], + [124, "v1", "terrain-context"] + ], "placeholder-do-not-add-below": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/var_names.jsonc b/decompiler/config/jak1_ntsc_black_label/var_names.jsonc index efd68a5e95..a9dd69ef14 100644 --- a/decompiler/config/jak1_ntsc_black_label/var_names.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/var_names.jsonc @@ -3739,7 +3739,18 @@ "s4-0": ["s4-0", "vector"], "v1-42": ["v1-42", "vector"], "s3-1": "lod-to-use", - "f30-1": "cam-dist" + "f30-1": "cam-dist", + "s3-0": "tod", + "v1-17": "shadow-msk", + "a0-10": "lev-idx", + "s0-1": "lgt", + "s1-1": "cur-lgt", + "s2-0": "vu-lgt", + "a1-22": "lgt-msk-0", + "a2-14": "lgt-msk-1", + "f26-0": "lgt-interp", + "f28-0": "interp", + "f30-0": "cur-interp" } }, @@ -4034,5 +4045,20 @@ } }, + "(method 12 touching-list)": { + "vars": { + "gp-0": ["entry", "touching-shapes-entry"], + "s5-0": "i", + "s4-0": "c1", + "s3-0": "c2" + } + }, + + "(code ogreboss-stage1)": { + "vars": { + "s5-0": ["boulder-pickup", "pickup-type"] + } + }, + "aaaaaaaaaaaaaaaaaaaaaaa": {} } diff --git a/decompiler/config/jak1_pal.jsonc b/decompiler/config/jak1_pal.jsonc index 190e3b6b8a..9621d7d2bc 100644 --- a/decompiler/config/jak1_pal.jsonc +++ b/decompiler/config/jak1_pal.jsonc @@ -1,5 +1,8 @@ { "game_version": 1, + "text_version": 11, + "game_name": "jak1_pal", + "expected_elf_name": "SCES_503.61", // if you want to filter to only some object names. // it will make the decompiler much faster. @@ -15,7 +18,10 @@ "disassemble_code": false, // Run the decompiler - "decompile_code": true, + "decompile_code": false, + + // run the first pass of the decompiler + "find_functions": true, //////////////////////////// // DATA ANALYSIS OPTIONS @@ -27,11 +33,13 @@ "disassemble_data": false, // unpack textures to assets folder - "process_tpages": false, + "process_tpages": true, // unpack game text to assets folder - "process_game_text": false, + "process_game_text": true, // unpack game count to assets folder - "process_game_count": false, + "process_game_count": true, + // write goal imports for art groups + "process_art_groups": true, /////////////////////////// // WEIRD OPTIONS @@ -39,9 +47,6 @@ // these options are used rarely and should usually be left at false - // output a file type_defs.gc which is used for the types part of all-types.gc - "regenerate_all_types": false, - // generate the symbol_map.json file. // this is a guess at where each symbol is first defined/used. "generate_symbol_definition_map": false, @@ -56,7 +61,7 @@ "hexdump_code": false, "hexdump_data": false, // dump raw obj files - "dump_objs": false, + "dump_objs": true, // print control flow graph "print_cfgs": false, @@ -68,14 +73,44 @@ //////////////////////////// "type_casts_file": "decompiler/config/jak1_pal/type_casts.jsonc", - "anonymous_function_types_file": "decompiler/config/jak1_pal/anonymous_function_types.jsonc", - "var_names_file": "decompiler/config/jak1_pal/var_names.jsonc", + "anonymous_function_types_file": "decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc", + "var_names_file": "decompiler/config/jak1_ntsc_black_label/var_names.jsonc", "label_types_file": "decompiler/config/jak1_pal/label_types.jsonc", - "stack_structures_file": "decompiler/config/jak1_pal/stack_structures.jsonc", + "stack_structures_file": "decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc", "hacks_file": "decompiler/config/jak1_pal/hacks.jsonc", - "inputs_file": "decompiler/config/jak1_pal/inputs.jsonc", + "inputs_file": "decompiler/config/jak1_ntsc_black_label/inputs.jsonc", + "art_info_file": "decompiler/config/jak1_ntsc_black_label/art_info.jsonc", + "import_deps_file": "decompiler/config/jak1_ntsc_black_label/import_deps.jsonc", + "all_types_file": "decompiler/config/all-types.gc", // optional: a predetermined object file name map from a file. // this will make decompilation naming consistent even if you only run on some objects. - "obj_file_name_map_file": "" + "obj_file_name_map_file": "goal_src/build/all_objs_jak1_pal.json", + + //////////////////////////// + // LEVEL EXTRACTION + //////////////////////////// + + // turn this on to extract level background graphics data + "levels_extract": true, + // turn this on if you want extracted levels to be saved out as .obj files + "levels_convert_to_obj": false, + // should we extract collision meshes? + // these can be displayed in game, but makes the .fr3 files slightly larger + "extract_collision": true, + + //////////////////////////// + // PATCHING OPTIONS + //////////////////////////// + + // these are options related to xdelta3 patches on specific objects + // this allows us to get a more consistent input + + // set to true to write new patch files + "write_patches": false, + // set to true to apply patch files + "apply_patches": true, + // what to patch an object to and the patch file is + "object_patches": { + } } diff --git a/decompiler/config/jak1_pal/anonymous_function_types.jsonc b/decompiler/config/jak1_pal/anonymous_function_types.jsonc deleted file mode 100644 index dd06f46574..0000000000 --- a/decompiler/config/jak1_pal/anonymous_function_types.jsonc +++ /dev/null @@ -1,776 +0,0 @@ -{ - "gkernel": [ - [16, "(function process symbol)"], - [22, "(function process symbol)"], - [25, "(function process symbol)"], - [28, "(function process symbol)"], - [30, "(function process symbol)"], - [32, "(function process symbol)"] - ], - - "hud": [ - [10, "(function none :behavior hud)"] - ], - - "main": [[4, "(function none :behavior process)"]], - - "process-drawable": [[29, "(function string symbol)"]], - - "task-control": [ - [9, "(function task-control symbol)"], - [10, "(function task-control symbol)"], - [11, "(function task-control symbol)"], - [12, "(function task-control symbol)"], - [13, "(function task-control symbol)"], - [14, "(function task-control symbol)"], - [15, "(function task-control symbol)"], - [16, "(function task-control symbol)"], - [17, "(function task-control symbol)"], - [18, "(function task-control symbol)"], - [19, "(function task-control symbol)"], - [20, "(function task-control symbol)"], - [21, "(function task-control symbol)"], - [22, "(function task-control symbol)"], - [23, "(function task-control symbol)"], - [24, "(function task-control symbol)"], - [25, "(function task-control symbol)"], - [26, "(function task-control symbol)"], - [27, "(function task-control symbol)"], - [28, "(function task-control symbol)"], - [29, "(function task-control symbol)"], - [30, "(function task-control symbol)"], - [31, "(function task-control symbol)"], - [32, "(function task-control symbol)"], - [33, "(function task-control symbol)"], - [34, "(function task-control symbol)"], - [35, "(function task-control symbol)"], - [36, "(function task-control symbol)"], - [37, "(function task-control symbol)"], - [38, "(function task-control symbol)"], - [39, "(function task-control symbol)"], - [40, "(function task-control symbol)"], - [41, "(function task-control symbol)"], - [42, "(function task-control symbol)"], - [43, "(function task-control symbol)"], - [44, "(function task-control symbol)"], - [45, "(function task-control symbol)"], - [46, "(function task-control symbol)"], - [47, "(function task-control symbol)"], - [48, "(function task-control symbol)"], - [49, "(function task-control symbol)"], - [50, "(function task-control symbol)"], - [51, "(function task-control symbol)"], - [52, "(function task-control symbol)"], - [53, "(function task-control symbol)"], - [54, "(function task-control symbol)"], - [55, "(function task-control symbol)"], - [56, "(function task-control symbol)"], - [57, "(function task-control symbol)"], - [58, "(function task-control symbol)"], - [59, "(function task-control symbol)"], - [60, "(function task-control symbol)"], - [61, "(function task-control symbol)"], - [62, "(function task-control symbol)"], - [63, "(function task-control symbol)"], - [64, "(function task-control symbol)"], - [65, "(function task-control symbol)"], - [66, "(function task-control symbol)"], - [67, "(function task-control symbol)"], - [68, "(function task-control symbol)"], - [69, "(function task-control symbol)"], - [70, "(function task-control symbol)"], - [71, "(function task-control symbol)"], - [72, "(function task-control symbol)"], - [73, "(function task-control symbol)"], - [74, "(function task-control symbol)"], - [75, "(function task-control symbol)"], - [76, "(function task-control symbol)"], - [77, "(function task-control symbol)"], - [78, "(function task-control symbol)"], - [79, "(function task-control symbol)"], - [80, "(function task-control symbol)"], - [81, "(function task-control symbol)"], - [82, "(function task-control symbol)"], - [83, "(function task-control symbol)"], - [84, "(function task-control symbol)"], - [85, "(function task-control symbol)"], - [86, "(function task-control symbol)"], - [87, "(function task-control symbol)"], - [88, "(function task-control symbol)"], - [89, "(function task-control symbol)"], - [90, "(function task-control symbol)"], - [91, "(function task-control symbol)"], - [92, "(function task-control symbol)"], - [93, "(function task-control symbol)"], - [94, "(function task-control symbol)"], - [95, "(function task-control symbol)"], - [96, "(function task-control symbol)"], - [97, "(function task-control symbol)"], - [98, "(function task-control symbol)"], - [99, "(function task-control symbol)"], - [100, "(function task-control symbol)"], - [101, "(function task-control symbol)"], - [102, "(function task-control symbol)"], - [103, "(function task-control symbol)"], - [104, "(function task-control symbol)"], - [105, "(function task-control symbol)"], - [106, "(function task-control symbol)"], - [107, "(function task-control symbol)"], - [108, "(function task-control symbol)"], - [109, "(function task-control symbol)"], - [110, "(function task-control symbol)"], - [111, "(function task-control symbol)"], - [112, "(function task-control symbol)"], - [113, "(function task-control symbol)"], - [114, "(function task-control symbol)"], - [115, "(function task-control symbol)"], - [116, "(function task-control symbol)"], - [117, "(function task-control symbol)"], - [118, "(function task-control symbol)"], - [119, "(function task-control symbol)"], - [120, "(function task-control symbol)"], - [121, "(function task-control symbol)"], - [122, "(function task-control symbol)"], - [123, "(function task-control symbol)"], - [124, "(function task-control symbol)"], - [125, "(function task-control symbol)"], - [126, "(function task-control symbol)"], - [127, "(function task-control symbol)"], - [128, "(function task-control symbol)"], - [129, "(function task-control symbol)"], - [130, "(function task-control symbol)"], - [131, "(function task-control symbol)"], - [132, "(function task-control symbol)"], - [133, "(function task-control symbol)"], - [134, "(function task-control symbol)"], - [135, "(function task-control symbol)"], - [136, "(function task-control symbol)"], - [137, "(function task-control symbol)"], - [138, "(function task-control symbol)"], - [139, "(function task-control symbol)"], - [140, "(function task-control symbol)"], - [141, "(function task-control symbol)"], - [142, "(function task-control symbol)"], - [143, "(function task-control symbol)"], - [144, "(function task-control symbol)"], - [145, "(function task-control symbol)"], - [146, "(function task-control symbol)"], - [147, "(function task-control symbol)"], - [148, "(function task-control symbol)"], - [149, "(function task-control symbol)"], - [150, "(function task-control symbol)"], - [151, "(function task-control symbol)"], - [152, "(function task-control symbol)"], - [153, "(function task-control symbol)"], - [154, "(function task-control symbol)"], - [155, "(function task-control symbol)"], - [156, "(function task-control symbol)"], - [157, "(function task-control symbol)"], - [158, "(function task-control symbol)"], - [159, "(function task-control symbol)"], - [160, "(function task-control symbol)"], - [161, "(function task-control symbol)"], - [162, "(function task-control symbol)"], - [163, "(function task-control symbol)"], - [164, "(function task-control symbol)"], - [165, "(function task-control symbol)"], - [166, "(function task-control symbol)"], - [167, "(function task-control symbol)"], - [168, "(function task-control symbol)"], - [169, "(function task-control symbol)"], - [170, "(function task-control symbol)"], - [171, "(function task-control symbol)"], - [172, "(function task-control symbol)"], - [173, "(function task-control symbol)"], - [174, "(function task-control symbol)"], - [175, "(function task-control symbol)"], - [176, "(function task-control symbol)"], - [177, "(function task-control symbol)"], - [178, "(function task-control symbol)"], - [179, "(function task-control symbol)"], - [180, "(function task-control symbol)"], - [181, "(function task-control symbol)"], - [182, "(function task-control symbol)"], - [183, "(function task-control symbol)"], - [184, "(function task-control symbol)"], - [185, "(function task-control symbol)"], - [186, "(function task-control symbol)"], - [187, "(function task-control symbol)"], - [188, "(function task-control symbol)"], - [189, "(function task-control symbol)"], - [190, "(function task-control symbol)"], - [191, "(function task-control symbol)"], - [192, "(function task-control symbol)"], - [193, "(function task-control symbol)"], - [194, "(function task-control symbol)"], - [195, "(function task-control symbol)"], - [196, "(function task-control symbol)"], - [197, "(function task-control symbol)"], - [198, "(function task-control symbol)"], - [199, "(function task-control symbol)"], - [200, "(function task-control symbol)"], - [201, "(function task-control symbol)"], - [202, "(function task-control symbol)"], - [203, "(function task-control symbol)"], - [204, "(function task-control symbol)"], - [205, "(function task-control symbol)"], - [206, "(function task-control symbol)"], - [207, "(function task-control symbol)"], - [208, "(function task-control symbol)"], - [209, "(function task-control symbol)"], - [210, "(function task-control symbol)"], - [211, "(function task-control symbol)"], - [212, "(function task-control symbol)"], - [213, "(function task-control symbol)"], - [214, "(function task-control symbol)"], - [215, "(function task-control symbol)"], - [216, "(function task-control symbol)"], - [217, "(function task-control symbol)"], - [218, "(function task-control symbol)"], - [219, "(function task-control symbol)"], - [220, "(function task-control symbol)"], - [221, "(function task-control symbol)"], - [222, "(function task-control symbol)"], - [223, "(function task-control symbol)"], - [224, "(function task-control symbol)"], - [225, "(function task-control symbol)"], - [226, "(function task-control symbol)"], - [227, "(function task-control symbol)"], - [228, "(function task-control symbol)"], - [229, "(function task-control symbol)"], - [230, "(function task-control symbol)"], - [231, "(function task-control symbol)"], - [232, "(function task-control symbol)"], - [233, "(function task-control symbol)"], - [234, "(function task-control symbol)"], - [235, "(function task-control symbol)"], - [236, "(function task-control symbol)"], - [237, "(function task-control symbol)"], - [238, "(function task-control symbol)"], - [239, "(function task-control symbol)"], - [240, "(function task-control symbol)"], - [241, "(function task-control symbol)"], - [242, "(function task-control symbol)"], - [243, "(function task-control symbol)"], - [244, "(function task-control symbol)"], - [245, "(function task-control symbol)"], - [246, "(function task-control symbol)"], - [247, "(function task-control symbol)"], - [248, "(function task-control symbol)"], - [249, "(function task-control symbol)"], - [250, "(function task-control symbol)"], - [251, "(function task-control symbol)"], - [252, "(function task-control symbol)"], - [253, "(function task-control symbol)"], - [254, "(function task-control symbol)"], - [255, "(function task-control symbol)"], - [256, "(function task-control symbol)"], - [257, "(function task-control symbol)"], - [258, "(function task-control symbol)"], - [259, "(function task-control symbol)"], - [260, "(function task-control symbol)"], - [261, "(function task-control symbol)"], - [262, "(function task-control symbol)"], - [263, "(function task-control symbol)"], - [264, "(function task-control symbol)"], - [265, "(function task-control symbol)"], - [266, "(function task-control symbol)"], - [267, "(function task-control symbol)"], - [268, "(function task-control symbol)"], - [269, "(function task-control symbol)"], - [270, "(function task-control symbol)"], - [271, "(function task-control symbol)"], - [272, "(function task-control symbol)"], - [273, "(function task-control symbol)"], - [274, "(function task-control symbol)"], - [275, "(function task-control symbol)"], - [276, "(function task-control symbol)"], - [277, "(function task-control symbol)"], - [278, "(function task-control symbol)"], - [279, "(function task-control symbol)"], - [280, "(function task-control symbol)"], - [281, "(function task-control symbol)"], - [282, "(function task-control symbol)"], - [283, "(function task-control symbol)"], - [284, "(function task-control symbol)"], - [285, "(function task-control symbol)"], - [286, "(function task-control symbol)"], - [287, "(function task-control symbol)"], - [288, "(function task-control symbol)"], - [289, "(function task-control symbol)"], - [290, "(function task-control symbol)"], - [291, "(function task-control symbol)"], - [292, "(function task-control symbol)"], - [293, "(function task-control symbol)"], - [294, "(function task-control symbol)"], - [295, "(function task-control symbol)"], - [296, "(function task-control symbol)"], - [297, "(function task-control symbol)"], - [298, "(function task-control symbol)"], - [299, "(function task-control symbol)"], - [300, "(function task-control symbol)"], - [301, "(function task-control symbol)"], - [302, "(function task-control symbol)"], - [303, "(function task-control symbol)"], - [304, "(function task-control symbol)"], - [305, "(function task-control symbol)"], - [306, "(function task-control symbol)"], - [307, "(function task-control symbol)"], - [308, "(function task-control symbol)"], - [309, "(function task-control symbol)"], - [310, "(function task-control symbol)"], - [311, "(function task-control symbol)"], - [312, "(function task-control symbol)"], - [313, "(function task-control symbol)"], - [314, "(function task-control symbol)"], - [315, "(function task-control symbol)"], - [316, "(function task-control symbol)"], - [317, "(function task-control symbol)"], - [318, "(function task-control symbol)"], - [319, "(function task-control symbol)"], - [320, "(function task-control symbol)"], - [321, "(function task-control symbol)"], - [322, "(function task-control symbol)"], - [323, "(function task-control symbol)"], - [324, "(function task-control symbol)"], - [325, "(function task-control symbol)"], - [326, "(function task-control symbol)"], - [327, "(function task-control symbol)"], - [328, "(function task-control symbol)"], - [329, "(function task-control symbol)"], - [330, "(function task-control symbol)"], - [331, "(function task-control symbol)"], - [332, "(function task-control symbol)"], - [333, "(function task-control symbol)"], - [334, "(function task-control symbol)"], - [335, "(function task-control symbol)"], - [336, "(function task-control task-control symbol)"], - [337, "(function task-control task-control symbol)"], - [338, "(function task-control symbol)"], - [339, "(function task-control symbol)"], - [340, "(function task-control symbol)"], - [341, "(function task-control symbol)"], - [342, "(function task-control symbol)"], - [343, "(function task-control symbol)"], - [344, "(function task-control symbol)"], - [345, "(function task-control symbol)"], - [346, "(function task-control symbol)"], - [347, "(function task-control symbol)"], - [348, "(function task-control symbol)"], - [349, "(function task-control symbol)"], - [350, "(function task-control symbol)"], - [351, "(function task-control symbol)"], - [352, "(function task-control symbol)"], - [353, "(function task-control symbol)"], - [354, "(function task-control symbol)"], - [355, "(function task-control symbol)"], - [356, "(function task-control symbol)"], - [357, "(function task-control symbol)"], - [358, "(function task-control symbol)"], - [359, "(function task-control symbol)"], - [360, "(function task-control symbol)"], - [361, "(function task-control symbol)"], - [362, "(function task-control task-control symbol)"], - [363, "(function task-control task-control symbol)"], - [364, "(function task-control task-control symbol)"], - [365, "(function task-control task-control symbol)"], - [366, "(function task-control symbol)"], - [367, "(function task-control symbol)"], - [368, "(function task-control symbol)"], - [369, "(function task-control symbol)"], - [370, "(function task-control symbol)"], - [371, "(function task-control symbol)"], - [372, "(function task-control symbol)"], - [373, "(function task-control symbol)"], - [374, "(function task-control symbol)"], - [375, "(function task-control symbol)"], - [376, "(function task-control symbol)"], - [377, "(function task-control symbol)"], - [378, "(function task-control symbol)"], - [379, "(function task-control symbol)"], - [380, "(function task-control symbol)"], - [381, "(function task-control symbol)"], - [382, "(function task-control symbol)"], - [383, "(function task-control symbol)"], - [384, "(function task-control symbol)"], - [385, "(function task-control symbol)"], - [386, "(function task-control symbol)"], - [387, "(function task-control symbol)"], - [388, "(function task-control symbol)"], - [389, "(function task-control symbol)"], - [390, "(function task-control symbol)"], - [391, "(function task-control symbol)"], - [392, "(function task-control symbol)"], - [393, "(function task-control symbol)"], - [394, "(function task-control symbol)"], - [395, "(function task-control symbol)"], - [396, "(function task-control symbol)"], - [397, "(function task-control symbol)"], - [398, "(function task-control symbol)"], - [399, "(function task-control symbol)"], - [400, "(function task-control symbol)"], - [401, "(function task-control symbol)"], - [402, "(function task-control symbol)"], - [403, "(function task-control symbol)"], - [404, "(function task-control symbol)"], - [405, "(function task-control symbol)"], - [406, "(function task-control symbol)"], - [407, "(function task-control symbol)"], - [408, "(function task-control symbol)"], - [409, "(function task-control symbol)"], - [410, "(function task-control symbol)"], - [411, "(function task-control symbol)"], - [412, "(function task-control symbol)"], - [413, "(function task-control symbol)"], - [414, "(function task-control task-control symbol)"], - [415, "(function task-control task-control symbol)"], - [416, "(function task-control symbol)"], - [417, "(function task-control symbol)"], - [418, "(function task-control symbol)"], - [419, "(function task-control symbol)"], - [420, "(function task-control symbol)"], - [421, "(function task-control symbol)"], - [422, "(function task-control symbol)"], - [423, "(function task-control symbol)"], - [424, "(function task-control symbol)"], - [425, "(function task-control task-control symbol)"], - [426, "(function task-control task-control symbol)"], - [427, "(function task-control symbol)"], - [428, "(function task-control symbol)"], - [429, "(function task-control symbol)"], - [430, "(function task-control symbol)"], - [431, "(function task-control symbol)"], - [432, "(function task-control task-control symbol)"], - [433, "(function task-control task-control symbol)"], - [434, "(function task-control task-control symbol)"], - [435, "(function task-control symbol)"], - [436, "(function task-control task-control symbol)"], - [437, "(function task-control task-control symbol)"], - [438, "(function task-control task-control symbol)"], - [439, "(function task-control symbol)"], - [440, "(function task-control symbol)"], - [441, "(function task-control symbol)"], - [442, "(function task-control symbol)"], - [443, "(function task-control task-control symbol)"], - [444, "(function task-control task-control symbol)"], - [445, "(function task-control symbol)"], - [446, "(function task-control task-control symbol)"], - [447, "(function task-control task-control symbol)"], - [448, "(function task-control task-control symbol)"], - [449, "(function task-control symbol)"], - [450, "(function task-control symbol)"], - [451, "(function task-control symbol)"], - [452, "(function task-control symbol)"], - [453, "(function task-control task-control symbol)"], - [454, "(function task-control task-control symbol)"], - [455, "(function task-control symbol)"], - [456, "(function task-control task-control symbol)"], - [457, "(function task-control task-control symbol)"], - [458, "(function task-control task-control symbol)"], - [459, "(function task-control symbol)"], - [460, "(function task-control symbol)"], - [461, "(function task-control symbol)"], - [462, "(function task-control symbol)"], - [463, "(function task-control symbol)"], - [464, "(function task-control symbol)"], - [465, "(function task-control symbol)"], - [466, "(function task-control symbol)"], - [467, "(function task-control symbol)"], - [468, "(function task-control symbol)"], - [469, "(function task-control symbol)"], - [470, "(function task-control symbol)"], - [471, "(function task-control symbol)"], - [472, "(function task-control symbol)"], - [473, "(function task-control symbol)"], - [474, "(function task-control task-control symbol)"], - [475, "(function task-control task-control symbol)"], - [476, "(function task-control task-control symbol)"], - [477, "(function task-control task-control symbol)"], - [478, "(function task-control symbol)"], - [479, "(function task-control symbol)"], - [480, "(function task-control symbol)"], - [481, "(function task-control symbol)"], - [482, "(function task-control symbol)"], - [483, "(function task-control symbol)"], - [484, "(function task-control symbol)"], - [485, "(function task-control symbol)"], - [486, "(function task-control symbol)"], - [487, "(function task-control symbol)"], - [488, "(function task-control symbol)"], - [489, "(function task-control symbol)"], - [490, "(function task-control symbol)"], - [491, "(function task-control symbol)"], - [492, "(function task-control symbol)"], - [493, "(function task-control symbol)"], - [494, "(function task-control symbol)"], - [495, "(function task-control symbol)"], - [496, "(function task-control symbol)"] - ], - - "game-info": [ - [17, "(function symbol symbol continue-point symbol none)"], - [6, "(function process-drawable none)"], - [7, "(function none :behavior process-drawable)"], - [8, "(function object)"] - ], - - "default-menu": [ - [3, "(function none)"], - [4, "(function int int symbol)"], // TODO - first arg is ignored - i think there's a decomp bug here - [5, "(function int int symbol)"], // TODO - first arg is ignored - [6, "(function int int target)"], // TODO - first arg is ignored - [8, "(function int)"], - [9, "(function continue-point)"], - [10, "(function none)"], - [11, "(function object)"], - [12, "(function object)"], - [13, "(function object)"], - [14, "(function quaternion)"], - [15, "(function quaternion)"], - [16, "(function int int basic)"], // TODO - first arg is ignored - [17, "(function int)"], - [18, "(function int)"], - [19, "(function int)"], - [20, "(function none)"], - [21, "(function int int basic)"], // TODO - first arg is ignored - [22, "(function int int basic)"], // TODO - first arg is ignored - [23, "(function int int basic)"], // TODO - first arg is ignored - [24, "(function int int float float)"], // TODO - first arg is ignored - [25, "(function int int float float)"], // TODO - first arg is ignored - [26, "(function int int float float)"], // TODO - first arg is ignored - [27, "(function int int target)"], // TODO - first arg is ignored - [28, "(function none)"], - [29, "(function none)"], - [30, "(function none)"], - [31, "(function none)"], - [32, "(function none)"], - [33, "(function none)"], - [34, "(function int)"], - [35, "(function int)"], - [60, "(function debug-menu int float float object)"], // TODO - instance type blocking this one, not 100% sure about the debug-menu, but it has a string at offset 0 - [61, "(function debug-menu int float float object)"], // TODO - instance type blocking this one, not 100% sure about the debug-menu, but it has a string at offset 0 - [63, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [64, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [65, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [66, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [67, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [68, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [69, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [70, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [71, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [72, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [73, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [74, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [75, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [76, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [77, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [78, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [79, "(function symbol int int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems - [80, "(function object)"], - [81, "(function object)"], - [82, "(function symbol int float float none)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) - [84, "(function symbol int none)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) - [88, "(function debug-menu debug-menu symbol)"], // not 100% sure about the debug-menu, but it has a string at offset 0 - [89, "(function debug-menu debug-menu symbol)"], // not 100% sure about the debug-menu, but it has a string at offset 0 - [90, "(function debug-menu debug-menu symbol)"] // not 100% sure about the debug-menu, but it has a string at offset 0 - ], - - "memory-usage": [ - [3, "(function basic symbol)"], - [2, "(function process symbol)"] - ], - - "anim-tester": [ - [11, "(function none :behavior anim-tester)"], - [12, "(function none :behavior anim-tester)"], - [13, "(function none :behavior anim-tester)"] - ], - - "cam-combiner": [ - [1, "(function none :behavior camera-combiner)"], - [2, "(function basic int basic event-message-block object :behavior camera-combiner)"] - ], - - "title-obs": [ - [0, "(function none)"] - ], - - "misty-warehouse": [ - [3, "(function symbol none :behavior silostep)"], - [4, "(function none :behavior silostep)"], - [6, "(function none :behavior camera-tracker)"], - [7, "(function none :behavior silostep)"], - [8, "(function process int symbol event-message-block none :behavior silostep)"] - ], - - "rigid-body": [ - [5, "(function none :behavior rigid-body-platform)"], - [6, "(function none :behavior rigid-body-platform)"], - [7, "(function none :behavior rigid-body-platform)"], - [8, "(function none :behavior rigid-body-platform)"] - ], - - "sunken-elevator": [ - [3, "(function object :behavior sunken-elevator)"], - [4, "(function int :behavior sunken-elevator)"], - [5, "(function symbol :behavior sunken-elevator)"], - [6, "(function int :behavior sunken-elevator)"] - ], - - "nav-enemy": [ - [8, "(function none :behavior nav-enemy)"], - [9, "(function none)"], // stubbed - [10, "(function uint :behavior nav-enemy)"], - [11, "(function object :behavior nav-enemy)"], - [12, "(function none :behavior nav-enemy)"], - [13, "(function object :behavior nav-enemy)"], - [14, "(function uint :behavior nav-enemy)"], - [15, "(function object :behavior nav-enemy)"], - [16, "(function object :behavior nav-enemy)"], - [17, "(function vector :behavior nav-enemy)"], - [19, "(function object :behavior nav-enemy)"], - [20, "(function uint :behavior nav-enemy)"], - [21, "(function none :behavior nav-enemy)"], - [28, "(function symbol :behavior nav-enemy)"], - [29, "(function symbol :behavior nav-enemy)"], - [30, "(function object :behavior nav-enemy)"], - [31, "(function object :behavior nav-enemy)"], - [32, "(function vector :behavior nav-enemy)"], - [33, "(function object :behavior nav-enemy)"], - [34, "(function object :behavior nav-enemy)"], - [35, "(function object :behavior nav-enemy)"], - [36, "(function uint :behavior nav-enemy)"], - [37, "(function object :behavior nav-enemy)"], - [38, "(function object :behavior nav-enemy)"], - [39, "(function uint :behavior nav-enemy)"], - [40, "(function vector :behavior nav-enemy)"], - [41, "(function none :behavior nav-enemy)"], - [42, "(function object :behavior nav-enemy)"], - [43, "(function uint :behavior nav-enemy)"], - [44, "(function none :behavior nav-enemy)"], - [45, "(function object :behavior nav-enemy)"], - [46, "(function none :behavior nav-enemy)"], - [50, "(function none :behavior nav-enemy)"], - [51, "(function object :behavior nav-enemy)"], - [52, "(function uint :behavior nav-enemy)"], - [54, "(function object :behavior nav-enemy)"], - [55, "(function uint :behavior nav-enemy)"], - [56, "(function none :behavior nav-enemy)"], - [57, "(function object :behavior nav-enemy)"], - [58, "(function uint :behavior nav-enemy)"], - [59, "(function uint :behavior nav-enemy)"], - [60, "(function none :behavior nav-enemy)"], - [61, "(function object :behavior nav-enemy)"], - [62, "(function int :behavior nav-enemy)"] - ], - - "oracle": [ - [1, "(function sparticle-launch-group :behavior oracle)"], - [2, "(function sparticle-launch-group :behavior oracle)"], - [3, "(function none :behavior oracle)"] - ], - - "time-of-day": [ - [10, "(function none :behavior time-of-day-proc)"], - [12, "(function sparticle-system sparticle-cpuinfo none)"] - ], - - "basebutton": [ - [1, "(function symbol :behavior target)"] - ], - - "entity": [ - [10, "(function process-drawable none)"] - ], - - "beach-rocks": [ - [2, "(function none :behavior beach-rock)"], - [3, "(function none :behavior beach-rock)"], - [4, "(function none :behavior beach-rock)"], - [5, "(function none :behavior beach-rock)"], - [6, "(function none :behavior beach-rock)"], - [7, "(function process int symbol event-message-block none :behavior beach-rock)"] - ], - - "projectiles": [ - [27, "(function projectile int)"] - ], - - "sidekick-human": [ - [7, "(function sparticle-launch-control :behavior sequenceC)"], - [15, "(function sparticle-launch-control :behavior sequenceB)"], - [16, "(function sparticle-launch-control :behavior sequenceB)"] - ], - - "demo-obs": [ - [1, "(function target)"] - ], - - "final-door": [ - [11, "(function final-door symbol)"], - [12, "(function final-door symbol)"] - ], - - "plat-eco": [ - [4, "(function none :behavior plat-eco)"], // trans - [5, "(function int float :behavior plat-eco)"], // enter - [6, "(function none :behavior plat-eco)"], // post - [7, "(function handle none :behavior plat-eco)"], // code - [8, "(function none :behavior plat-eco)"], // trans - [9, "(function process int symbol event-message-block object :behavior plat-eco)"], // event - [10, "(function symbol :behavior plat-eco)"], // code - [11, "(function none :behavior plat-eco)"], // trans - [12, "(function int :behavior plat-eco)"], // enter - [13, "(function process int symbol event-message-block object :behavior plat-eco)"] // event - ], - - "plat-flip": [ - [1, "(function none :behavior plat-flip)"], // code - [2, "(function process int symbol event-message-block object :behavior plat-flip)"] // event - ], - - "flying-lurker": [ - [37, "(function uint :behavior manipy)"], - [12, "(function uint :behavior manipy)"], - [11, "(function none :behavior process)"] - ], - - "ambient": [ - [29, "(function process int symbol event-message-block object :behavior level-hint)"] - ], - - "process-taskable": [ - [46, "(function process-taskable symbol)"] - ], - - "fishermans-boat": [ - [5, "(function none :behavior fishermans-boat)"], - [21, "(function none :behavior fishermans-boat)"], - [29, "(function none :behavior fishermans-boat)"] - ], - - "muse": [ - [3, "(function none :behavior muse)"] - ], - - "relocate": [ - [6, "(function sparticle-system sparticle-cpuinfo none)"] - ], - - "yakow": [ - [29, "(function none)"] - ], - - "fisher": [ - [27, "(function none :behavior process)"], - [28, "(function none :behavior fisher)"], - [20, "(function none :behavior fisher-fish)"], - [1, "(function none :behavior target)"] - ], - - "robotboss-misc": [ - [5, "(function sparticle-launch-control :behavior finalbosscam)"] - ], - - "placeholder-do-not-add-below": [] -} diff --git a/decompiler/config/jak1_pal/hacks.jsonc b/decompiler/config/jak1_pal/hacks.jsonc index 3193f29140..4c8465a0ac 100644 --- a/decompiler/config/jak1_pal/hacks.jsonc +++ b/decompiler/config/jak1_pal/hacks.jsonc @@ -18,7 +18,8 @@ "cond_with_else_max_lengths": [ ["(method 20 res-lump)", "b0", 2], ["(method 11 res-lump)", "b0", 1], - ["(method 12 res-lump)", "b0", 1] + ["(method 12 res-lump)", "b0", 1], + ["(method 31 progress)", "b35", 1] ], // if a cond with an else case is being used a value in a place where it looks wrong @@ -94,6 +95,9 @@ "vif1-handler", // F: weird asm for interrupt handler "vif1-handler-debug", + // texture + "adgif-shader<-texture!", + // vector "vector=", // asm branching @@ -127,13 +131,7 @@ "ripple-execute-init", // bones - "draw-bones-hud", - "draw-bones", - "draw-bones-check-longest-edge-asm", - "draw-bones-merc", - "bones-mtx-calc-execute", "bones-mtx-calc", - "texscroll-execute", // generic-effect "generic-debug-light-proc", @@ -143,11 +141,8 @@ "generic-envmap-only-proc", "generic-no-light", "generic-no-light+envmap", - "generic-no-light-dproc", "generic-no-light-dproc-only", "generic-no-light-proc", - "generic-interp-dproc", - "generic-envmap-dproc", "generic-prepare-dma-single", "generic-prepare-dma-double", "generic-envmap-proc", @@ -156,8 +151,7 @@ "upload-vu0-program", // generic-merc - "generic-merc-execute-all", - "generic-merc-execute-asm", + "generic-merc-execute-asm", // CFG "high-speed-reject", "mercneric-convert", "mercneric-bittable-asm", @@ -166,14 +160,11 @@ "generic-merc-init-asm", // generic-tie - "generic-tie-convert", "generic-tie-convert-proc", "generic-tie-upload-next", "generic-tie-decompress", - "generic-tie-dma-to-spad-sync", // shadow-cpu - "shadow-execute", "shadow-add-double-edges", "shadow-add-double-tris", "shadow-add-single-edges", @@ -194,8 +185,7 @@ "draw-node-cull", // shrubbery - "test-func", - "draw-inline-array-instance-shrub", + "draw-inline-array-instance-shrub", // CFG // tfrag "stats-tfrag-asm", @@ -205,8 +195,6 @@ // tie-methods "draw-inline-array-prototype-tie-near-asm", "draw-inline-array-prototype-tie-asm", - "draw-inline-array-prototype-tie-generic-asm", - "draw-inline-array-instance-tie", // sparticle-launcher "sp-init-fields!", @@ -234,139 +222,35 @@ "draw-boundary-polygon", // collide-probe - "collide-probe-instance-tie", - "collide-probe-node", - - // collide-mesh - "(method 10 collide-mesh)", - "(method 13 collide-mesh)", - "(method 9 collide-mesh-cache)", - "(method 15 collide-mesh)", - "(method 14 collide-mesh)", - "(method 11 collide-mesh)", - "(method 12 collide-mesh)", + "collide-probe-instance-tie", // CFG + "collide-probe-node", // CFG // collide-edge-grab - "(method 13 collide-edge-work)", - "(method 17 collide-edge-work)", - "(method 15 collide-edge-work)", - "(method 16 collide-edge-work)", - "(method 9 edge-grab-info)", // maybe bug - "(method 18 collide-edge-work)", - "(method 10 collide-edge-hold-list)", + "(method 15 collide-edge-work)", // CFG - // collide-shape - "(method 15 collide-shape-prim-mesh)", // BUG: - "(method 15 collide-shape-prim-sphere)", // BUG: - "(method 16 collide-shape-prim)", - "(method 15 collide-shape-prim-group)", - "(method 45 collide-shape)", - "(method 28 collide-shape-prim-mesh)", // BUG: - "(method 29 collide-shape-prim-group)", - "(method 20 collide-shape-prim-group)", - "(method 19 collide-shape-prim-sphere)", - "(method 18 collide-shape-prim-sphere)", - "(method 23 collide-shape-prim-sphere)", - "(method 23 collide-shape-prim-mesh)", // BUG: maybe - "(method 24 collide-shape-prim)", - "(method 23 collide-shape-prim-group)", - "(method 42 collide-shape)", - - // collide-shape-rider - "(method 35 collide-shape)", - - // cam-master BUG - "master-is-hopeful-better?", - - // cam-layout BUG - "cam-layout-save-cam-trans", + "(method 12 collide-mesh)", // process-drawable BUG - "cspace-inspect-tree", // BUG: - "process-drawable-birth-fuel-cell", // BUG: - "(method 19 process-drawable)", + "cspace-inspect-tree", + //"(method 19 process-drawable)", // ambient "ambient-inspect", - // generic-obs BUG - "camera-change-to", - - // target BUG - "target-falling-anim-trans", - // target2 BUG - "(anon-function 33 target2)", // BUG: - "(anon-function 67 target2)", // BUG: - "look-for-points-of-interest", - - // drawable-tree - "(method 16 drawable-tree)", + "look-for-points-of-interest", // Failed to split nested sc - looks like dead code to me // collide-cache - "(method 10 collide-puss-work)", - "(method 9 collide-puss-work)", - "(method 19 collide-cache)", - "(method 10 collide-cache-prim)", - "(method 9 collide-cache-prim)", - "(method 30 collide-cache)", - "(method 13 collide-shape-prim-group)", - "(method 13 collide-shape-prim-sphere)", - "(method 13 collide-shape-prim-mesh)", - "(method 14 collide-shape-prim-group)", - "(method 14 collide-shape-prim-sphere)", - "(method 14 collide-shape-prim-mesh)", - "(method 12 collide-shape-prim-group)", // BUG: maybe - "(method 12 collide-shape-prim-sphere)", - "(method 12 collide-shape-prim-mesh)", - "(method 29 collide-cache)", - "(method 27 collide-cache)", - "(method 14 collide-cache)", - "(method 28 collide-cache)", - "(method 26 collide-cache)", - "(method 21 collide-cache)", - "(method 32 collide-cache)", - - // memory-usage BUG - //"(method 14 level)", - - // navigate BUG - "(method 32 nav-control)", - - // collectables BUG - "add-blue-motion", + "(method 10 collide-puss-work)", // CFG + "(method 9 collide-puss-work)", // decompiler crash + "(method 32 collide-cache)", // CFG // ocean - "draw-large-polygon-ocean", + "draw-large-polygon-ocean", // CFG // ocean-vu0 - "ocean-generate-verts", - "ocean-interp-wave", - - // nav-enemy BUG - // "(anon-function 28 nav-enemy)", - - // orb-cache BUG - "(method 27 orb-cache-top)", - - // ropebridge BUG - "(method 27 ropebridge)", - - // all unchecked and in level DGO code - "(anon-function 21 plant-boss)", - "(anon-function 10 ice-cube)", - "(anon-function 15 ice-cube)", - "(anon-function 45 lavatube-energy)", - "mistycannon-find-best-solution", - "target-flut-falling-anim-trans", - "kermit-check-to-hit-player?", - "(anon-function 6 title-obs)", - "(anon-function 36 mistycannon)", - "(anon-function 43 maincave-obs)", - "(anon-function 2 target-tube)", - "(anon-function 5 orbit-plat)", - "(anon-function 2 ogreboss)" - + "ocean-generate-verts", // crash + "ocean-interp-wave" ], // these functions use pairs and the decompiler @@ -412,7 +296,17 @@ "(method 21 swamp-rat-nest-dummy-a)", "(method 21 swamp-rat-nest-dummy-b)", "(method 21 swamp-rat-nest-dummy-c)", - "(method 27 battlecontroller)" + "(method 27 battlecontroller)", + "load-boundary-from-template", + "command-get-time", + "command-get-param", + "command-get-quoted-param", + "command-get-trans", + "command-get-camera", + "(method 14 camera-tracker)", + "(enter billy-playing)", + "(code target-continue)", + "next-level" ], // If format is used with the wrong number of arguments, @@ -437,11 +331,13 @@ " pris-geo ~192H~5DK ~280Hpris-fragment~456H~5DK~%": 2, " pris-anim ~192H~5DK ~280Hpris-generic~456H~5DK~%": 2, " textures ~192H~5DK ~280Htextures~456H~5DK~%": 2, - " entity ~192H~5DK~%": 2, + " entity ~192H~5DK~%": 1, " misc ~192H~5DK ~280Hsprite~456H~5DK~%": 2, "ERROR: ~A in spool anim loop for ~A ~D, but not loaded.~": 3, "~0k~5d/~d ~6d/~d ~6d/~d ": 6, - "~0k~s~%": 1 + "~0k~s~%": 1, + "money ~A was killed in pickup~%": 0, + " id address name aid tsk lev status x y z address name state heap flags~%": 3 }, "blocks_ending_in_asm_branch": { @@ -449,25 +345,12 @@ // this one is all asm branches "circle-circle-xz-intersect": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ], "find-knot-span": [0, 1, 2, 3, 5, 6, 7, 8, 9], - "curve-evaluate!": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], + "curve-evaluate!": [0, 2, 5, 6, 7, 8, 9], "(method 9 texture-page-dir)": [4, 5], @@ -475,7 +358,7 @@ "display-loop": [44, 49, 66, 99], - "load-game-text-info": [12, 13, 14, 18], + "load-game-text-info": [12, 13, 14, 16, 17, 18], "real-main-draw-hook": [75, 77], @@ -489,19 +372,116 @@ "start-perf-stat-collection": [26], "end-perf-stat-collection": [0], "sprite-draw-distorters": [4, 5], - "draw-string":[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189], - "get-string-length":[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], - "unpack-comp-rle":[1, 3, 5, 6], - "(method 16 level)":[ 1, 5, 13, 14, 15, 19, 26, 53], - "unpack-comp-huf":[2, 4, 5, 6, 7, 8, 9], - "blerc-execute":[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33], - "(method 11 fact-info-target)":[42], - "(anon-function 9 game-save)":[3, 4, 5, 6, 7, 8], + "draw-string": [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189 + ], + "get-string-length": [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 + ], + "unpack-comp-rle": [1, 3, 5, 6], + "(method 16 level)": [1, 5, 13, 14, 15, 19, 26, 53], + "unpack-comp-huf": [2, 4, 5, 6, 7, 8, 9], + "blerc-execute": [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 + ], + "(method 11 fact-info-target)": [42], + "(anon-function 9 game-save)": [3, 4, 5, 6, 7, 8, 10], //"(anon-function 9 game-save)":[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], - "particle-adgif":[0, 1, 2, 3, 4, 5, 7], - "sp-launch-particles-var":[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66], - "(method 11 sparticle-launch-control)": [ 27, 28, 35, 46, 48, 49, 77], - "upload-vis-bits":[0,1,2,3,4,5, 6] + "particle-adgif": [0, 1, 2, 3, 4, 5, 7], + "sp-launch-particles-var": [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66 + ], + "(method 11 sparticle-launch-control)": [27, 28, 38, 49, 51, 52, 80], + "upload-vis-bits": [0, 1, 2, 3, 4, 5, 6], + + "draw-drawable-tree-tfrag": [6, 8, 13, 15], + "draw-drawable-tree-trans-tfrag": [6, 8, 13, 15], + "draw-drawable-tree-dirt-tfrag": [6, 8, 13, 15], + "draw-drawable-tree-ice-tfrag": [6, 8, 13, 15], + "draw-drawable-tree-instance-tie": [10, 12, 18, 20, 26, 28, 37, 39], + "draw-drawable-tree-instance-shrub": [5, 7, 9, 11], + + "birth-pickup-at-point": [0], + "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], + "(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], + "(anon-function 5 orbit-plat)": [4, 5, 11], + "(anon-function 21 plant-boss)": [0, 1, 3, 4], + "(method 55 ram-boss)": [5], + "(method 60 ice-cube)": [8], + "(anon-function 2 snow-ball)": [22], + "draw-bones-merc": [1, 3, 5, 7, 8, 10, 11, 12, 13], + "(anon-function 48 lavatube-energy)": [13], + "generic-tie-execute": [4, 9], + "generic-merc-execute-all": [3, 7, 12] }, // Sometimes the game might use format strings that are fetched dynamically, @@ -510,37 +490,26 @@ // e.g. "function-name":[[op, argc], [op, argc], ...] // where "op" is the op number for the call to format. "dynamic_format_arg_counts": { - "(method 35 progress)":[ + "(method 35 progress)": [ [44, 1], [92, 1] ], - "(method 49 progress)":[ - [35, 1] - ], - "(method 37 progress)":[ - [41, 1] - ], - "(method 38 progress)":[ - [106, 1] - ], - "(method 39 progress)":[ + "(method 49 progress)": [[35, 1]], + "(method 37 progress)": [[41, 1]], + "(method 38 progress)": [[106, 1]], + "(method 39 progress)": [ [56, 1], [83, 1] ], - "(method 41 progress)":[ - [73, 1] - ], - "(method 42 progress)":[ - [41, 1] - ], - "(method 43 progress)":[ + "(method 41 progress)": [[73, 1]], + "(method 42 progress)": [[41, 1]], + "(method 43 progress)": [ [51, 1], [94, 1] - ], - "":[] + ] }, - "mips2c_functions_by_name":[ + "mips2c_functions_by_name": [ "sp-init-fields!", "particle-adgif", "sp-launch-particles-var", @@ -553,8 +522,155 @@ "render-sky-tri", "init-sky-regs", "set-tex-offset", - "adgif-shader<-texture-with-update!" + "adgif-shader<-texture-with-update!", + "init-boundary-regs", + "draw-boundary-polygon", + "render-boundary-quad", + "render-boundary-tri", + "draw-inline-array-tfrag", + "stats-tfrag-asm", + "time-of-day-interp-colors-scratch", + "normalize-frame-quaternions", + "collide-do-primitives", + "moving-sphere-triangle-intersect", + "(method 12 collide-mesh)", + "(method 11 collide-mesh)", + "collide-probe-node", + "collide-probe-instance-tie", + "(method 32 collide-cache)", + "(method 28 collide-cache)", + "(method 26 collide-cache)", + "(method 27 collide-cache)", + "(method 29 collide-cache)", + "(method 12 collide-shape-prim-mesh)", + "(method 14 collide-shape-prim-mesh)", + "(method 13 collide-shape-prim-mesh)", + "(method 30 collide-cache)", + "(method 9 collide-cache-prim)", + "(method 10 collide-cache-prim)", + "(method 9 collide-puss-work)", + "(method 10 collide-puss-work)", + + // these could easily be goal, but probably faster/easier this way. + "(method 14 collide-mesh)", + "(method 15 collide-mesh)", + + "(method 16 collide-edge-work)", + "(method 10 collide-edge-hold-list)", + "(method 15 collide-edge-work)", + "(method 18 collide-edge-work)", + "normalize-frame-quaternions", + "calc-animation-from-spr", + "clear-frame-accumulator", + "bones-mtx-calc", + "cspace<-parented-transformq-joint!", + "draw-bones-merc", + "draw-bones-check-longest-edge-asm", + "setup-blerc-chains-for-one-fragment", + "blerc-execute", + + "generic-merc-execute-asm", + "high-speed-reject", + "mercneric-convert", + "mercneric-bittable-asm", + "mercneric-shader-asm", + "mercneric-matrix-asm", + "generic-merc-init-asm", + "generic-prepare-dma-double", + "generic-light-proc", + "generic-envmap-proc", + "draw-bones-generic-merc", + "generic-prepare-dma-single", + + "ripple-matrix-scale", + "ripple-apply-wave-table", + "ripple-create-wave-table", + "ripple-execute-init", + + // ocean + "init-ocean-far-regs", + "draw-large-polygon-ocean", + "render-ocean-quad", + "ocean-generate-verts", + "ocean-interp-wave", + + // shadow + "shadow-execute", + "shadow-add-double-edges", + "shadow-add-double-tris", + "shadow-add-single-edges", + "shadow-add-facing-single-tris", + "shadow-add-verts", + "shadow-find-double-edges", + "shadow-find-facing-double-tris", + "shadow-find-single-edges", + "shadow-find-facing-single-tris", + "shadow-init-vars", + "shadow-scissor-top", + "shadow-scissor-edges", + "shadow-calc-dual-verts", + "shadow-xform-verts", + + // generic tie + "draw-inline-array-instance-tie", + "generic-tie-dma-to-spad-sync", + "draw-inline-array-prototype-tie-generic-asm", + "generic-interp-dproc", + "generic-no-light-dproc", + "generic-envmap-dproc", + "generic-tie-convert" + ], + + "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 + ] + }, + + // 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]], + + // 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. + // this just suppresses a message. + "expected_merged_objs": [ + "orb-cache-top-ag", + "ecovalve-ag", + "barrel-ag", + "sack-ag", + "sharkey-ag", + "warp-gate-switch-ag", + "baby-spider-ag", + "cavetrapdoor-ag", + "spider-egg-ag", + "darkvine-ag", + "jng-iris-door-ag", + "eichar-fish+0-ag", + "launcherdoor-ag", + "plat-eco-ag", + "eichar-tube+0-ag", + "eichar-pole+0-ag", + "crate-darkeco-cluster-ag", + "ef-plane-ag", + "racer-ag", + "flut-saddle-ag", + "shover-ag", + "steam-cap-ag", + "sunkencam-ag", + "swampcam-ag", + "pontoonfive-ag", + "oracle-ag", + "village-cam-ag", + "plat-ag" ] } - - diff --git a/decompiler/config/jak1_pal/inputs.jsonc b/decompiler/config/jak1_pal/inputs.jsonc deleted file mode 100644 index b2ba6c38b3..0000000000 --- a/decompiler/config/jak1_pal/inputs.jsonc +++ /dev/null @@ -1,269 +0,0 @@ -{ - ////////////////////// - // INPUT FILES - ////////////////////// - - // input is GOAL object files, possibly in containers. - // most objects are part of CGO/DGO files (both go in dgo_names). This includes levels and the engine - // the DGOs will be processed in this order. Usually it's best to have KERNEL, ENGINE, then the levels when - // you want to run on the entire game. - "dgo_names": [ - "CGO/KERNEL.CGO", - "CGO/ENGINE.CGO", - "CGO/GAME.CGO", - "CGO/ART.CGO", - "DGO/BEA.DGO", - "DGO/CIT.DGO", - "CGO/COMMON.CGO", - "DGO/DAR.DGO", - "DGO/DEM.DGO", - "DGO/FIN.DGO", - "DGO/INT.DGO", - "DGO/JUB.DGO", - "DGO/JUN.DGO", - "CGO/JUNGLE.CGO", - "CGO/L1.CGO", - "DGO/FIC.DGO", - "DGO/LAV.DGO", - "DGO/MAI.DGO", - "CGO/MAINCAVE.CGO", - "DGO/MIS.DGO", - "DGO/OGR.DGO", - "CGO/RACERP.CGO", - "DGO/ROB.DGO", - "DGO/ROL.DGO", - "DGO/SNO.DGO", - "DGO/SUB.DGO", - "DGO/SUN.DGO", - "CGO/SUNKEN.CGO", - "DGO/SWA.DGO", - "DGO/TIT.DGO", - "DGO/TRA.DGO", - "DGO/VI1.DGO", - "DGO/VI2.DGO", - "DGO/VI3.DGO", - "CGO/VILLAGEP.CGO", - "CGO/WATER-AN.CGO" - ], - - // some objects are part of STR files (streaming data). In Jak 1 this is just animations - "str_file_names": [ - "STR/BAFCELL.STR", - "STR/SWTE4.STR", - "STR/SWTE3.STR", - "STR/SWTE2.STR", - "STR/SWTE1.STR", - "STR/SNRBSBFC.STR", - "STR/SNRBIPFC.STR", - "STR/SNRBICFC.STR", - "STR/ORR3.STR", - "STR/ORR2.STR", - "STR/MICANNON.STR", - "STR/BECANNON.STR", - "STR/SWTS4.STR", - "STR/SWTS3.STR", - "STR/SWTS2.STR", - "STR/SW4.STR", - "STR/SW3.STR", - "STR/SW2.STR", - "STR/SWTS1.STR", - "STR/ORREYE.STR", - "STR/ORLEYE.STR", - "STR/SW1.STR", - "STR/MAGFCELL.STR", - "STR/GNFCELL.STR", - "STR/ORRE3.STR", - "STR/ORRE2.STR", - "STR/ORRE1.STR", - "STR/ORR1.STR", - "STR/ORLE3.STR", - "STR/ORLE2.STR", - "STR/ORI3.STR", - "STR/ORI2.STR", - "STR/DE0202.STR", - "STR/RARSANIM.STR", - "STR/RARANIM.STR", - "STR/EIFISH.STR", - "STR/ORLE1.STR", - "STR/SWTEF4.STR", - "STR/SWTEF3.STR", - "STR/SWTEF2.STR", - "STR/SWTEF1.STR", - "STR/ORI1.STR", - "STR/EIICE.STR", - "STR/EIA3.STR", - "STR/DE0191.STR", - "STR/DE0186.STR", - "STR/DE0187.STR", - "STR/EIA4.STR", - "STR/EIPOLE.STR", - "STR/RARASECO.STR", - "STR/RARA2.STR", - "STR/DE0184.STR", - "STR/DE0181.STR", - "STR/PESEXT.STR", - "STR/DE0195.STR", - "STR/EIA2.STR", - "STR/FIR1.STR", - "STR/DE0182.STR", - "STR/BIR1.STR", - "STR/HAPOPEN.STR", - "STR/EITUBE.STR", - "STR/SCR1.STR", - "STR/DE0197.STR", - "STR/DE0193.STR", - "STR/EIA1.STR", - "STR/FAR2.STR", - "STR/FAR1.STR", - "STR/DE0199.STR", - "STR/GERMONEY.STR", - "STR/BIRESOLU.STR", - "STR/GARMONEY.STR", - "STR/BIADVENT.STR", - "STR/FUCRV1.STR", - "STR/BIREJECT.STR", - "STR/WAR1.STR", - "STR/BIACCEPT.STR", - "STR/SA3R1DEC.STR", - "STR/ASR1GENE.STR", - "STR/FIREJECT.STR", - "STR/GARRACE.STR", - "STR/GEZMONEY.STR", - "STR/LRFALLIN.STR", - "STR/EXR2.STR", - "STR/GERMOLES.STR", - "STR/FUCVICTO.STR", - "STR/MIR1ORBS.STR", - "STR/SA3R1RAM.STR", - "STR/AS2R1FLU.STR", - "STR/FUCV2.STR", - "STR/MIR1GNAW.STR", - "STR/GAZMONEY.STR", - "STR/AS3REMIN.STR", - "STR/SIHISA.STR", - "STR/FIACCEPT.STR", - "STR/FIWECO.STR", - "STR/FARESOLU.STR", - "STR/ASR1RBIK.STR", - "STR/MARDONAT.STR", - "STR/GAZRACE.STR", - "STR/FUCFV1.STR", - "STR/FUCV5.STR", - "STR/SABR1CDU.STR", - "STR/FLLINTRO.STR", - "STR/SAR1ECOR.STR", - "STR/AS2R1ROB.STR", - "STR/MIR2ORBS.STR", - "STR/MARBEAMS.STR", - "STR/LOI2.STR", - "STR/SAR1GENE.STR", - "STR/BILR1.STR", - "STR/AS2R1ROO.STR", - "STR/ASR1BESW.STR", - "STR/LOLOOP.STR", - "STR/FAINTROD.STR", - "STR/GEZMOLES.STR", - "STR/V1IN.STR", - "STR/FUCV4.STR", - "STR/SAIECORO.STR", - "STR/MIR1SWIT.STR", - "STR/LOINTRO.STR", - "STR/SAR2GENE.STR", - "STR/MUVICTOR.STR", - "STR/SAR1MCAN.STR", - "STR/FUCV7.STR", - "STR/MIZ1ORBS.STR", - "STR/FUCV8.STR", - "STR/BILR2.STR", - "STR/FUCV6.STR", - "STR/FUCV3.STR", - "STR/PLLBLOWU.STR", - "STR/PLBMAIN.STR", - "STR/WARESOLU.STR", - "STR/EIRACER.STR", - "STR/MAZDONAT.STR", - "STR/MAZBEAMS.STR", - "STR/MIISWITC.STR", - "STR/FIBRTVIL.STR", - "STR/FIBRTMIS.STR", - "STR/SABR1PAR.STR", - "STR/NDINTRO.STR", - "STR/GORDOWN.STR", - "STR/GORUP.STR", - "STR/SA3IRAMS.STR", - "STR/YERESOLU.STR", - "STR/EIFLUT.STR", - "STR/GRSDSACR.STR", - "STR/EXR1.STR", - "STR/SCRESOLU.STR", - "STR/FIRESOLU.STR", - "STR/SIHITEST.STR", - "STR/GAI1.STR", - "STR/EXRESOLU.STR", - "STR/MIZ2ORBS.STR", - "STR/ASIRBIKE.STR", - "STR/GRSOBBEC.STR", - "STR/BIINTROD.STR", - "STR/GRSOBBNC.STR", - "STR/AS2IROBB.STR", - "STR/GRSOBFIN.STR", - "STR/RERESOLU.STR", - "STR/BLRESOLU.STR", - "STR/SABIPARM.STR", - "STR/EVMEND.STR", - "STR/AS2RESOL.STR", - "STR/SAIMCANN.STR", - "STR/MIIGNAWE.STR", - "STR/GRSOBBA.STR", - "STR/GRSINTRO.STR", - "STR/SAISE.STR", - "STR/SA3IDECO.STR", - "STR/ASFRESOL.STR", - "STR/EXINTROD.STR", - "STR/BILINTRO.STR", - "STR/FIINTROD.STR", - "STR/MAINTROD.STR", - "STR/SCINTROD.STR", - "STR/AS2IFLUT.STR", - "STR/ASLERESO.STR", - "STR/ASLSRESO.STR", - "STR/AS2IROOM.STR", - "STR/GRSRESOL.STR", - "STR/SABICDUS.STR", - "STR/SIHISB.STR", - "STR/ASIBESWI.STR", - "STR/BILBRESO.STR", - "STR/FIBRT1AL.STR", - "STR/AS2INTRO.STR", - "STR/GEINTROD.STR", - "STR/SAISD1.STR", - "STR/SAISA.STR", - "STR/SIHISC.STR", - "STR/MIIORBS.STR", - "STR/WAINTROD.STR", - "STR/SAISD2.STR", - "STR/GRSOPREB.STR", - "STR/GRSOBBB.STR", - "STR/SA3INTRO.STR" - ], - - // some objects are directly stored as files on the DVD. This is just text files. - "object_file_names": [ - "TEXT/0COMMON.TXT", - "TEXT/1COMMON.TXT", - "TEXT/2COMMON.TXT", - "TEXT/3COMMON.TXT", - "TEXT/4COMMON.TXT", - "TEXT/5COMMON.TXT", - "TEXT/6COMMON.TXT" - ], - - // uncomment the next line to extract audio to wave files. - //"audio_dir_file_name": "jak1/VAG", - "audio_dir_file_name": "", - - "streamed_audio_file_names": [ - "VAGWAD.ENG", - "VAGWAD.JAP" - ] -} diff --git a/decompiler/config/jak1_pal/label_types.jsonc b/decompiler/config/jak1_pal/label_types.jsonc index e31781ce92..bf5b071280 100644 --- a/decompiler/config/jak1_pal/label_types.jsonc +++ b/decompiler/config/jak1_pal/label_types.jsonc @@ -1,10 +1,9 @@ - // the format is [label_name, type, special] +// the format is [label_name, type, special] - // if the type is pointer or inline array, special should be an integer size. - // if the type is a value type (like rgba), special should be true. +// if the type is pointer or inline array, special should be an integer size. +// if the type is a value type (like rgba), special should be true. { - "vector-h": [ ["L32", "vector"], ["L31", "vector"], @@ -17,7 +16,6 @@ "quaternion-h": [["L1", "quaternion"]], - "quaternion": [ ["L67", "vector"], ["L68", "vector"], @@ -27,9 +25,7 @@ ["L72", "vector"] ], - "geometry": [ - ["L112", "(pointer float)", 4] - ], + "geometry": [["L112", "vector"]], "trigonometry": [ ["L98", "(pointer float)", 32], @@ -46,13 +42,9 @@ ["L17", "font-work"] ], - "display": [ - ["L76", "(pointer uint32)", 2] - ], + "display": [["L76", "(pointer uint32)", 2]], - "capture": [ - ["L12", "gs-store-image-packet"] - ], + "capture": [["L12", "gs-store-image-packet"]], "main-h": [["L1", "frame-stats"]], @@ -103,21 +95,13 @@ ["L53", "vector"] ], - "sprite": [ - ["L58", "vu-function"] - ], + "sprite": [["L58", "vu-function"]], - "sprite-distort": [ - ["L27", "vu-function"] - ], + "sprite-distort": [["L27", "vu-function"]], - "merc-vu1": [ - ["L1", "vu-function"] - ], + "merc-vu1": [["L1", "vu-function"]], - "background": [ - ["L51", "vu-function"] - ], + "background": [["L51", "vu-function"]], "debug": [ ["L179", "vector2h"], @@ -173,7 +157,15 @@ ["L276", "vector"], ["L277", "vector"], ["L278", "vector"], - ["L279", "vector"] + ["L279", "vector"], + ["L280", "(array float)"], + ["L281", "(array float)"], + ["L282", "(array float)"], + ["L283", "(array float)"], + ["L284", "(array float)"], + ["L285", "(array float)"], + ["L286", "(array float)"], + ["L287", "(array float)"] ], "mood-tables": [ @@ -261,37 +253,45 @@ ], "progress-static": [ - ["L121", "(array game-text-id)"] + ["L121", "(array game-text-id)"], + ["L195", "(array game-option)"], + ["L190", "(array game-option)"], + ["L185", "(array game-option)"], + ["L180", "(array game-option)"], + ["L174", "(array game-option)"], + ["L169", "(array game-option)"], + ["L165", "(array game-option)"], + ["L161", "(array game-option)"], + ["L157", "(array game-option)"], + ["L152", "(array game-option)"], + ["L147", "(array game-option)"], + ["L145", "(array game-option)"], + ["L143", "(array game-option)"], + ["L137", "(array game-option)"], + ["L131", "(array game-option)"], + ["L124", "(array game-option)"], + ["L123", "(array (array game-option))"], + ["L122", "(array int32)"], + ["L3", "(array level-tasks-info)"], + ["L2", "(array int32)"] ], - "rigid-body": [ - ["L89", "rigid-body-platform-constants"] - ], + "rigid-body": [["L89", "rigid-body-platform-constants"]], - "nav-enemy": [ - ["L349", "attack-info"] - ], + "nav-enemy": [["L349", "attack-info"]], "basebutton": [ ["L97", "vector"], ["L102", "vector"] ], - "bird-lady": [ - ["L29", "vector"] - ], + "bird-lady": [["L29", "vector"]], - "bird-lady-beach": [ - ["L26", "vector"] - ], + "bird-lady-beach": [["L26", "vector"]], - "mayor": [ - ["L57", "vector"] - ], + "mayor": [["L57", "vector"]], - "sculptor": [ - ["L89", "vector"] - ], + "sculptor": [["L89", "vector"]], "oracle": [ ["L55", "vector"], @@ -304,34 +304,22 @@ ["L30", "vector"] ], - "explorer": [ - ["L77", "vector"] - ], + "explorer": [["L77", "vector"]], - "sage": [ - ["L91", "vector"] - ], + "sage": [["L91", "vector"]], "misty-teetertotter": [ ["L26", "attack-info"], ["L27", "attack-info"] ], - "farmer": [ - ["L28", "vector"] - ], + "farmer": [["L28", "vector"]], - "gambler": [ - ["L52", "vector"] - ], + "gambler": [["L52", "vector"]], - "warrior": [ - ["L30", "vector"] - ], + "warrior": [["L30", "vector"]], - "geologist": [ - ["L38", "vector"] - ], + "geologist": [["L38", "vector"]], "font": [ ["L95", "(inline-array vector)", 250], @@ -372,16 +360,9 @@ "ocean-frames": [["L1", "(pointer uint32)", 16384]], - "eye": [["L36", "eye-work"]], - - "shadow-cpu": [["L122", "shadow-data"]], - - "load-boundary": [ - ["L328", "(inline-array lbvtx)", 3] - ], - - "anim-tester": [ - ["L509", "(inline-array list-field)", 12] + "shadow-cpu": [ + ["L122", "shadow-data"], + ["L121", "vu-function"] ], "default-menu": [ @@ -423,9 +404,7 @@ // ["L14", "gif-tag-regs", true] // ], - "merc-blend-shape": [ - ["L62", "(pointer int16)", 32] - ], + "merc-blend-shape": [["L62", "(pointer int16)", 32]], "miners": [ ["L111", "vector"], @@ -447,83 +426,7 @@ ["L471", "vector4w"] ], - "assistant": [ - ["L71", "vector"] - ], - - "progress": [ - ["L670", "uint64", true], - ["L589", "float", true], - ["L590", "float", true], - ["L591", "float", true], - ["L592", "float", true], - ["L593", "float", true], - ["L594", "float", true], - ["L595", "float", true], - ["L596", "float", true], - ["L597", "float", true], - ["L598", "float", true], - ["L599", "float", true], - ["L600", "float", true], - ["L601", "float", true], - ["L602", "float", true], - ["L603", "float", true], - ["L604", "float", true], - ["L605", "float", true], - ["L606", "float", true], - ["L607", "float", true], - ["L608", "float", true], - ["L609", "float", true], - ["L610", "float", true], - ["L611", "float", true], - ["L612", "float", true], - ["L613", "float", true], - ["L614", "float", true], - ["L615", "float", true], - ["L617", "float", true], - ["L616", "float", true], - ["L618", "float", true], - ["L619", "float", true], - ["L620", "float", true], - ["L621", "float", true], - ["L622", "float", true], - ["L623", "float", true], - ["L624", "float", true], - ["L625", "float", true], - ["L626", "float", true], - ["L627", "float", true], - ["L628", "float", true], - ["L629", "float", true], - ["L630", "float", true], - ["L631", "float", true], - ["L632", "float", true], - ["L633", "float", true], - ["L634", "float", true], - ["L635", "float", true], - ["L636", "float", true], - ["L637", "float", true], - ["L638", "float", true], - ["L586", "vector"], - ["L584", "vector"], - ["L582", "vector"], - ["L580", "vector"], - ["L576", "vector"], - ["L578", "vector"], - ["L639", "uint64", true], - ["L640", "uint64", true], - ["L641", "uint64", true], - ["L642", "uint64", true], - ["L643", "uint64", true], - ["L644", "uint64", true], - ["L645", "uint64", true], - ["L646", "uint64", true], - ["L647", "uint64", true], - ["L648", "uint64", true], - ["L649", "uint64", true], - ["L650", "uint64", true], - ["L651", "uint64", true], - ["L652", "uint64", true] - ], + "assistant": [["L71", "vector"]], "target-part": [ ["L336", "float", true], @@ -534,14 +437,7 @@ ["L341", "uint64", true] ], - "projectiles": [ - ["L150", "attack-info"] - ], - - "generic-obs": [ - ["L455", "quaternion"] - ], - + "projectiles": [["L150", "attack-info"]], "blocking-plane": [ ["L18", "vector"], ["L19", "vector"], @@ -565,25 +461,15 @@ ["L994", "uint64", true] ], - "assistant-firecanyon": [ - ["L71", "vector"] - ], + "assistant-firecanyon": [["L71", "vector"]], - "sage-bluehut": [ - ["L82", "vector"] - ], + "sage-bluehut": [["L82", "vector"]], - "flutflut-bluehut": [ - ["L34", "vector"] - ], + "flutflut-bluehut": [["L34", "vector"]], - "sharkey": [ - ["L101", "attack-info"] - ], + "sharkey": [["L101", "attack-info"]], - "assistant-citadel": [ - ["L28", "vector"] - ], + "assistant-citadel": [["L28", "vector"]], "robotboss-h": [ ["L67", "float", true], @@ -597,44 +483,204 @@ ], "crates": [ + ["L171", "attack-info"], + ["L175", "attack-info"], + ["L181", "attack-info"], ["L242", "float", true], ["L243", "float", true], ["L245", "float", true], ["L263", "float", true] ], - "flying-lurker": [ - ["L200", "(pointer uint32)", 26], - ["L190", "vector"] - ], - - "ambient": [ - ["L334", "vector2h"], - ["L330", "vector2h"], - ["L329", "vector2h"], - ["L332", "vector2h"], - ["L331", "vector2h"] - ], - "hint-control": [ - ["L45", "(array task-hint-control-group)"] + ["L45", "(array task-hint-control-group)"], + ["L100", "(array level-hint-control)"] ], - "sparticle-launcher": [ - ["L193", "adgif-shader"] + "cam-master": [ + ["L356", "vector"], + ["L357", "vector"] ], - "process-taskable": [ - ["L251", "attack-info"] + "cam-states": [ + ["L630", "vector"], + ["L631", "vector"], + ["L632", "vector"], + ["L633", "vector"], + ["L672", "float", true], + ["L673", "float", true], + ["L674", "float", true], + ["L675", "float", true], + ["L676", "float", true], + ["L677", "float", true], + ["L678", "float", true], + ["L679", "float", true], + ["L680", "float", true], + ["L681", "float", true], + ["L682", "float", true], + ["L683", "float", true], + ["L684", "float", true], + ["L685", "float", true], + ["L686", "float", true], + ["L687", "float", true], + ["L688", "float", true], + ["L689", "float", true], + ["L690", "float", true], + ["L691", "float", true], + ["L692", "float", true], + ["L693", "float", true], + ["L694", "float", true], + ["L695", "float", true], + ["L696", "float", true], + ["L697", "float", true], + ["L698", "float", true], + ["L699", "float", true], + ["L700", "float", true], + ["L701", "float", true], + ["L702", "float", true], + ["L703", "float", true], + ["L704", "float", true], + ["L705", "float", true], + ["L706", "float", true], + ["L707", "float", true], + ["L708", "float", true], + ["L709", "float", true], + ["L710", "float", true], + ["L711", "float", true], + ["L712", "float", true], + ["L713", "float", true], + ["L714", "float", true], + ["L715", "float", true], + ["L716", "float", true], + ["L717", "float", true], + ["L718", "float", true], + ["L719", "float", true], + ["L720", "float", true], + ["L721", "float", true], + ["L722", "float", true], + ["L723", "float", true], + ["L724", "float", true], + ["L725", "float", true], + ["L726", "float", true], + ["L727", "float", true], + ["L728", "float", true], + ["L729", "float", true], + ["L730", "float", true], + ["L731", "float", true], + ["L732", "float", true], + ["L733", "float", true], + ["L734", "float", true], + ["L735", "float", true], + ["L736", "float", true], + ["L737", "float", true], + ["L738", "float", true], + ["L739", "float", true], + ["L740", "float", true], + ["L741", "float", true], + ["L742", "float", true], + ["L743", "float", true], + ["L744", "float", true], + ["L745", "float", true], + ["L790", "uint64", true], + ["L791", "uint64", true], + ["L792", "uint64", true], + ["L793", "uint64", true] ], - "babak-with-cannon": [ - ["L92", "vector"] + "cam-states-dbg": [["L78", "camera-orbit-info"]], + + "cam-layout": [ + ["L766", "quaternion"], + ["L768", "vector"], + ["L775", "vector4w"], + ["L777", "vector4w"], + ["L779", "vector4w"], + ["L781", "vector4w"], + ["L783", "vector4w"], + ["L785", "vector4w"], + ["L787", "vector4w"], + ["L788", "vector4w"], + ["L789", "vector4w"], + ["L790", "vector4w"], + ["L791", "vector"], + ["L792", "vector"], + ["L793", "vector4w"], + ["L794", "vector"], + ["L795", "vector4w"], + ["L796", "vector"], + ["L797", "vector"], + ["L798", "vector4w"], + ["L799", "vector"], + ["L800", "vector4w"], + ["L801", "vector"], + ["L802", "vector"], + ["L803", "vector4w"], + ["L804", "vector"], + ["L805", "vector"], + ["L806", "vector4w"], + ["L807", "vector4w"], + ["L808", "vector"], + ["L809", "vector"], + ["L810", "vector4w"], + ["L811", "vector4w"], + ["L812", "vector"], + ["L813", "vector"], + ["L814", "vector4w"], + ["L815", "vector"], + ["L816", "vector"], + ["L817", "vector4w"], + ["L818", "vector"], + ["L819", "vector"], + ["L820", "vector4w"], + ["L821", "vector"], + ["L822", "vector"], + ["L823", "vector"], + ["L824", "vector"], + ["L832", "vector4w"], + ["L872", "float", true], + ["L873", "float", true], + ["L874", "float", true], + ["L875", "float", true], + ["L876", "float", true], + ["L877", "float", true], + ["L878", "float", true], + ["L879", "float", true], + ["L880", "float", true], + ["L881", "float", true], + ["L882", "float", true], + ["L883", "float", true], + ["L884", "float", true], + ["L885", "float", true], + ["L886", "float", true], + ["L887", "float", true], + ["L888", "float", true], + ["L889", "float", true], + ["L890", "float", true], + ["L891", "float", true], + ["L892", "float", true], + ["L893", "float", true], + ["L894", "float", true], + ["L895", "float", true], + ["L896", "float", true], + ["L897", "float", true], + ["L898", "float", true], + ["L899", "float", true], + ["L900", "float", true], + ["L901", "uint64", true], + ["L904", "uint64", true], + ["L905", "uint64", true], + ["L906", "uint64", true], + ["L907", "uint64", true], + ["L908", "uint64", true], + ["L909", "uint64", true], + ["L910", "uint64", true] ], - "flutflut": [ - ["L94", "vector"] - ], + "process-taskable": [["L251", "attack-info"]], + + "babak-with-cannon": [["L92", "vector"]], + + "flutflut": [["L94", "vector"]], "fishermans-boat": [ ["L210", "vector"], @@ -647,9 +693,7 @@ ["L434", "rigid-body-platform-constants"] ], - "training-obs": [ - ["L175", "rigid-body-platform-constants"] - ], + "training-obs": [["L175", "rigid-body-platform-constants"]], "bonelurker": [ ["L72", "attack-info"], @@ -657,7 +701,10 @@ ], "balloonlurker": [ + ["L99", "vector"], ["L105", "vector"], + ["L107", "attack-info"], + ["L108", "attack-info"], ["L113", "rigid-body-platform-constants"] ], @@ -668,12 +715,11 @@ ], "citb-plat": [ + ["L136", "attack-info"], ["L155", "rigid-body-platform-constants"] ], - "qbert-plat": [ - ["L99", "rigid-body-platform-constants"] - ], + "qbert-plat": [["L99", "rigid-body-platform-constants"]], "misty-conveyor": [ ["L60", "vector"], @@ -696,34 +742,28 @@ ], "gnawer": [ + ["L195", "attack-info"], + ["L196", "attack-info"], + ["L200", "attack-info"], ["L216", "(inline-array gnawer-segment-info)", 10] ], - "target-tube": [ - ["L142", "vector"] - ], + "target-tube": [["L142", "vector"]], - "assistant-village3": [ - ["L43", "vector"] - ], + "assistant-village3": [["L43", "vector"]], - "sage-village3": [ - ["L74", "vector"] - ], + "sage-village3": [["L74", "vector"]], - "target-snowball": [ - ["L23", "vector"] - ], + "target-snowball": [["L23", "vector"]], "ice-cube": [ + ["L210", "vector"], ["L212", "attack-info"], ["L213", "attack-info"], ["L215", "attack-info"] ], - "assistant-lavatube": [ - ["L30", "vector"] - ], + "assistant-lavatube": [["L30", "vector"]], "citadel-part": [ ["L235", "float", true], @@ -741,13 +781,9 @@ ["L245", "uint64", true] ], - "sunken-part": [ - ["L220", "uint64", true] - ], + "sunken-part": [["L220", "uint64", true]], - "ogre-part": [ - ["L93", "uint64", true] - ], + "ogre-part": [["L93", "uint64", true]], "collectables-part": [ ["L309", "float", true], @@ -769,13 +805,9 @@ ["L233", "uint64", true] ], - "village3-part": [ - ["L244", "uint64", true] - ], + "village3-part": [["L244", "uint64", true]], - "lavatube-part": [ - ["L110", "uint64", true] - ], + "lavatube-part": [["L110", "uint64", true]], "hud-classes": [ ["L279", "vector"], @@ -783,29 +815,7 @@ ["L318", "vector"] ], - "collectables": [ - ["L611", "(pointer float)", true, 1], - ["L649", "(pointer float)", true, 1], - ["L656", "(pointer float)", true, 1], - ["L657", "(pointer float)", true, 1], - ["L658", "(pointer float)", true, 1], - ["L660", "(pointer float)", true, 1], - ["L663", "(pointer float)", true, 1], - ["L585", "vector"], - ["L725", "float", true], - ["L726", "float", true], - ["L727", "float", true], - ["L728", "uint64", true], - ["L729", "uint64", true], - ["L730", "uint64", true], - ["L731", "uint64", true], - ["L732", "uint64", true], - ["L733", "uint64", true] - ], - - "sky": [ - ["L13", "vu-function"] - ], + "sky": [["L13", "vu-function"]], "sky-tng": [ ["L82", "sky-work"], @@ -830,9 +840,7 @@ ["L314", "float", true] ], - "seagull": [ - ["L226", "(inline-array air-box)", 20] - ], + "seagull": [["L226", "(inline-array air-box)", 10]], "rolling-race-ring": [ ["L94", "vector"], @@ -844,22 +852,18 @@ ["L100", "vector"] ], - "part-tester": [ - ["L32", "uint64", true] - ], - "anim-tester": [ ["L509", "(inline-array list-field)", 12], ["L523", "vector"], ["L524", "vector"], - ["L649", "(pointer float)", 1], - ["L650", "(pointer float)", 1], - ["L651", "(pointer float)", 1], - ["L652", "(pointer float)", 1], - ["L653", "(pointer float)", 1], - ["L654", "(pointer float)", 1], - ["L655", "(pointer float)", 1], - ["L656", "(pointer float)", 1], + ["L649", "float", true], + ["L650", "float", true], + ["L651", "float", true], + ["L652", "float", true], + ["L653", "float", true], + ["L654", "float", true], + ["L655", "float", true], + ["L656", "float", true], ["L657", "uint64", true], ["L658", "uint64", true], ["L663", "uint64", true], @@ -876,6 +880,10 @@ ["L262", "vector"], ["L463", "(array (inline-array fisher-params))"] ], + "fisher-OLD": [ + ["L262", "vector"], + ["L463", "(array (inline-array fisher-params))"] + ], "robotboss-weapon": [ ["L122", "attack-info"], @@ -885,9 +893,7 @@ ["L145", "vector"] ], - "robotboss-misc": [ - ["L99", "vector"] - ], + "robotboss-misc": [["L99", "vector"]], "robotboss": [ ["L646", "attack-info"], @@ -968,7 +974,7 @@ ["L765", "float", true], ["L766", "float", true], ["L767", "float", true], - ["L768", "(pointer float)", 1], + ["L768", "float", true], ["L769", "float", true], ["L770", "float", true], ["L771", "float", true], @@ -1010,6 +1016,1137 @@ ["L816", "uint64", true] ], + "sage-finalboss": [ + ["L528", "vector"], + ["L272", "vector"], + ["L527", "quaternion"] + ], + + "sage-finalboss-OLD": [ + ["L528", "vector"], + ["L272", "vector"], + ["L527", "quaternion"] + ], + + "part-tester": [ + ["L27", "rgba", true], + ["L32", "uint64", true] + ], + + "process-drawable": [ + ["L242", "vector"], + ["L241", "vector"] + ], + + "ocean-texture": [ + ["L14", "vu-function"], + ["L15", "ocean-texture-work"] + ], + + "cavegeyserrock": [ + ["L56", "attack-info"], + ["L54", "vector"], + ["L53", "vector"], + ["L52", "vector"] + ], + + "junglesnake": [ + ["L93", "(pointer float)", 28], + ["L100", "attack-info"], + ["L101", "attack-info"] + ], + + "citadel-obs": [["L265", "attack-info"]], + + "jungleb-obs": [["L34", "vector"]], + + "jungle-obs": [["L164", "attack-info"]], + + "misty-obs": [["L135", "rigid-body-platform-constants"]], + + "village2-obs": [ + ["L274", "rigid-body-platform-constants"], + ["L275", "rigid-body-platform-constants"], + ["L288", "vector"] + ], + + "swamp-obs": [ + ["L85", "rigid-body-platform-constants"], + ["L109", "attack-info"] + ], + + "maincave-obs": [ + ["L159", "vector"], + ["L160", "vector"], + ["L175", "attack-info"], + ["L176", "attack-info"] + ], + + "sunken-obs": [ + ["L43", "vector"], + ["L45", "vector"], + ["L47", "vector"], + ["L49", "vector"], + ["L51", "vector"] + ], + + "rolling-obs": [ + ["L234", "vector"], + ["L238", "vector"], + ["L239", "vector"], + ["L240", "vector"], + ["L241", "vector"], + ["L242", "vector"], + ["L243", "vector"], + ["L244", "vector"], + ["L245", "vector"], + ["L246", "vector"], + ["L247", "vector"], + ["L248", "vector"], + ["L257", "vector"] + ], + + "firecanyon-obs": [["L57", "attack-info"]], + + "ogre-obs": [ + ["L141", "rigid-body-platform-constants"], + ["L142", "rigid-body-platform-constants"], + ["L156", "attack-info"] + ], + + "snow-obs": [["L201", "vector"]], + + "lavatube-obs": [ + ["L162", "attack-info"], + ["L194", "attack-info"] + ], + + "tfrag": [ + ["L107", "vu-function"], + ["L106", "vector"], + ["L105", "vector"] + ], + + "generic-obs": [ + ["L455", "quaternion"], + ["L457", "attack-info"] + ], + + "collectables": [ + ["L533", "vector"], + ["L606", "float", true], + ["L607", "float", true], + ["L608", "float", true], + ["L609", "float", true], + ["L610", "float", true], + ["L611", "float", true], + ["L612", "float", true], + ["L613", "float", true], + ["L614", "float", true], + ["L615", "float", true], + ["L616", "float", true], + ["L617", "float", true], + ["L618", "float", true], + ["L619", "float", true], + ["L620", "float", true], + ["L621", "float", true], + ["L622", "float", true], + ["L623", "float", true], + ["L624", "float", true], + ["L625", "float", true], + ["L626", "float", true], + ["L627", "float", true], + ["L628", "float", true], + ["L629", "float", true], + ["L630", "float", true], + ["L631", "float", true], + ["L632", "float", true], + ["L633", "float", true], + ["L634", "float", true], + ["L635", "float", true], + ["L636", "float", true], + ["L637", "float", true], + ["L638", "float", true], + ["L639", "float", true], + ["L640", "float", true], + ["L641", "float", true], + ["L642", "float", true], + ["L643", "float", true], + ["L644", "float", true], + ["L645", "float", true], + ["L646", "float", true], + ["L647", "float", true], + ["L648", "float", true], + ["L649", "float", true], + ["L650", "float", true], + ["L651", "float", true], + ["L652", "float", true], + ["L653", "float", true], + ["L654", "float", true], + ["L655", "float", true], + ["L656", "float", true], + ["L657", "float", true], + ["L658", "float", true], + ["L659", "float", true], + ["L660", "float", true], + ["L661", "float", true], + ["L662", "float", true], + ["L663", "float", true], + ["L664", "uint64", true], + ["L666", "uint64", true], + ["L665", "uint64", true], + ["L667", "uint64", true], + ["L668", "uint64", true], + ["L669", "uint64", true], + ["L670", "uint64", true], + ["L671", "uint64", true], + ["L672", "uint64", true], + ["L585", "vector"], + ["L725", "float", true], + ["L726", "float", true], + ["L727", "float", true], + ["L728", "uint64", true], + ["L729", "uint64", true], + ["L730", "uint64", true], + ["L731", "uint64", true], + ["L732", "uint64", true], + ["L733", "uint64", true] + ], + + "plant-boss": [ + ["L343", "vector"], + ["L344", "vector"], + ["L345", "vector"], + ["L346", "vector"], + ["L347", "vector"], + ["L348", "vector"], + ["L349", "vector"], + ["L350", "vector"], + ["L351", "vector"], + ["L352", "vector"], + ["L353", "vector"], + ["L354", "vector"], + ["L355", "vector"], + ["L356", "vector"], + ["L357", "vector"], + ["L358", "vector"], + ["L359", "vector"], + ["L360", "vector"], + ["L361", "vector"], + ["L362", "vector"], + ["L363", "vector"], + ["L364", "vector"], + ["L375", "attack-info"], + ["L377", "attack-info"], + ["L399", "attack-info"], + ["L403", "attack-info"], + ["L412", "float", true], + ["L413", "float", true], + ["L414", "float", true], + ["L415", "float", true], + ["L416", "float", true], + ["L417", "float", true], + ["L418", "float", true], + ["L419", "float", true], + ["L420", "float", true], + ["L421", "float", true], + ["L422", "float", true], + ["L423", "float", true], + ["L424", "float", true], + ["L425", "float", true], + ["L426", "float", true], + ["L427", "float", true], + ["L428", "float", true], + ["L429", "float", true], + ["L430", "float", true], + ["L431", "float", true], + ["L432", "float", true], + ["L433", "float", true], + ["L434", "float", true], + ["L435", "float", true], + ["L436", "float", true], + ["L437", "float", true], + ["L438", "float", true], + ["L439", "float", true], + ["L440", "float", true], + ["L441", "float", true], + ["L442", "float", true], + ["L443", "float", true], + ["L444", "float", true], + ["L445", "float", true], + ["L446", "float", true], + ["L447", "float", true], + ["L448", "float", true], + ["L449", "float", true], + ["L450", "float", true], + ["L451", "float", true], + ["L452", "float", true], + ["L453", "float", true], + ["L454", "float", true], + ["L455", "float", true], + ["L456", "float", true], + ["L457", "float", true], + ["L458", "float", true], + ["L459", "float", true], + ["L460", "float", true], + ["L461", "float", true], + ["L462", "float", true], + ["L463", "float", true], + ["L464", "float", true], + ["L465", "float", true], + ["L466", "float", true], + ["L467", "float", true], + ["L468", "float", true], + ["L469", "float", true], + ["L470", "uint64", true], + ["L498", "float", true], + ["L499", "uint64", true], + ["L500", "uint64", true], + ["L501", "uint64", true] + ], + + "ropebridge": [ + ["L97", "(inline-array ropebridge-tuning)", 6], + ["L104", "(inline-array vector)", 18], // 70/72 words + ["L105", "(inline-array vector)", 16], // 62/64 words + ["L106", "(inline-array vector)", 26], // 102/104 words + ["L107", "(inline-array vector)", 35] // 138/140 words + ], + + "double-lurker": [ + ["L109", "vector"], + ["L122", "attack-info"], + ["L123", "attack-info"], + ["L128", "attack-info"] + ], + + "billy": [["L234", "vector"]], + + "lurkerworm": [["L56", "attack-info"]], + + "pelican": [ + ["L199", "vector"], + ["L225", "vector"] + ], + + "citadel-sages": [ + ["L179", "vector"], + ["L623", "vector"], + ["L651", "vector"], + ["L701", "vector"] + ], + + "shover": [ + ["L13", "attack-info"], + ["L14", "attack-info"] + ], + + "steam-cap": [["L51", "attack-info"]], + + "sidekick": [["L29", "vector"]], + + "target-handler": [ + ["L195", "attack-info"], + ["L197", "float", true], + ["L198", "float", true], + ["L199", "float", true], + ["L200", "float", true], + ["L201", "float", true], + ["L202", "float", true], + ["L203", "float", true], + ["L204", "float", true], + ["L205", "uint64", true], + ["L206", "uint64", true], + ["L207", "uint64", true], + ["L208", "uint64", true], + ["L209", "uint64", true] + ], + + "water": [ + ["L148", "attack-info"], + ["L149", "attack-info"], + ["L150", "attack-info"] + ], + + "racer": [["L106", "vector"]], + + "target-racer": [ + ["L237", "attack-info"], + ["L238", "attack-info"], + ["L240", "vector"] + ], + + "rolling-lightning-mole": [ + ["L181", "vector"], + ["L185", "vector4w"], + ["L186", "vector4w"], + ["L187", "vector4w"], + ["L189", "vector4w"], + ["L195", "vector"], + ["L201", "vector4w"], + ["L202", "vector4w"], + ["L203", "vector4w"], + ["L204", "vector4w"], + ["L205", "vector4w"], + ["L206", "vector4w"] + ], + + "rolling-robber": [ + ["L127", "vector"], + ["L139", "vector"], + ["L140", "vector"], + ["L145", "vector"] + ], + + "target-flut": [ + ["L399", "attack-info"], + ["L406", "float", true], + ["L407", "float", true], + ["L408", "float", true], + ["L409", "float", true], + ["L410", "float", true], + ["L411", "float", true], + ["L412", "float", true], + ["L413", "float", true], + ["L414", "float", true], + ["L415", "float", true], + ["L416", "float", true], + ["L417", "float", true], + ["L418", "float", true], + ["L419", "float", true], + ["L420", "float", true], + ["L421", "float", true], + ["L422", "float", true], + ["L423", "float", true], + ["L424", "float", true], + ["L425", "float", true], + ["L426", "float", true], + ["L427", "float", true], + ["L428", "float", true], + ["L429", "float", true], + ["L430", "float", true], + ["L431", "float", true], + ["L432", "float", true], + ["L433", "float", true], + ["L434", "float", true], + ["L435", "float", true], + ["L436", "float", true], + ["L437", "float", true], + ["L438", "float", true], + ["L439", "float", true], + ["L440", "float", true], + ["L441", "float", true], + ["L442", "float", true], + ["L443", "float", true], + ["L444", "float", true], + ["L445", "float", true], + ["L446", "float", true], + ["L447", "float", true], + ["L448", "float", true], + ["L449", "float", true], + ["L450", "float", true], + ["L451", "float", true], + ["L452", "float", true], + ["L453", "float", true], + ["L454", "float", true], + ["L455", "float", true], + ["L456", "float", true], + ["L457", "float", true], + ["L458", "uint64", true], + ["L459", "uint64", true], + ["L460", "uint64", true], + ["L461", "uint64", true], + ["L462", "uint64", true], + ["L463", "uint64", true], + ["L464", "uint64", true], + ["L465", "uint64", true], + ["L483", "uint64", true], + ["L484", "uint64", true] + ], + + "collide-shape": [ + ["L399", "attack-info"], + ["L408", "vector"], + ["L410", "vector"], + ["L411", "vector"], + ["L413", "attack-info"], + ["L414", "attack-info"], + ["L415", "attack-info"], + ["L416", "attack-info"], + ["L417", "vector"], + ["L418", "attack-info"], + ["L419", "attack-info"], + ["L420", "vector"], + ["L421", "vector"] + ], + + "collide-planes": [ + ["L53", "vector4w"], + ["L54", "vector4w"], + ["L55", "vector4w"], + ["L56", "vector4w"], + ["L57", "vector4w"], + ["L58", "vector4w"], + ["L59", "vector4w"], + ["L60", "vector4w"], + ["L63", "vector4w"], + ["L64", "vector4w"], + ["L65", "vector4w"], + ["L66", "vector4w"] + ], + + "collide-probe": [ + ["L100", "vector"], + ["L102", "vector"] + ], + + "collide-cache": [ + ["L304", "vector"], + ["L303", "vector4w"] + ], + + "load-boundary-data": [["L2", "(array array)"]], + + "tfrag-near": [["L1", "vu-function"]], + + "snow-ram-boss": [ + ["L220", "attack-info"], + ["L221", "attack-info"], + ["L222", "attack-info"], + ["L223", "attack-info"], + ["L225", "attack-info"] + ], + + "snow-ram": [["L73", "attack-info"]], + + "snow-bumper": [["L54", "attack-info"]], + + "snow-ball": [ + ["L86", "(pointer float)", 8], + ["L87", "(pointer float)", 8], + ["L89", "attack-info"] + ], + + "puffer": [["L170", "attack-info"]], + + "driller-lurker": [ + ["L174", "attack-info"], + ["L175", "attack-info"] + ], + + "dark-crystal": [["L36", "attack-info"]], + + "kermit": [["L164", "attack-info"]], + + "swamp-blimp": [ + ["L177", "vector"], + ["L182", "vector"], + ["L187", "vector"], + ["L198", "tetherrock-info"], + ["L200", "tetherrock-info"], + ["L203", "tetherrock-info"], + ["L206", "tetherrock-info"], + ["L209", "tetherrock-info"] + ], + + "mistycannon": [["L199", "attack-info"]], + + "darkvine": [["L41", "attack-info"]], + + "jungle-mirrors": [ + ["L325", "vector"], + ["L326", "vector4w-4"] + ], + + "quicksandlurker": [["L111", "attack-info"]], + + "voicebox": [ + ["L47", "vector"], + ["L48", "vector"], + ["L49", "vector"], + ["L50", "vector"], + ["L51", "vector"] + ], + + "mother-spider": [ + ["L278", "vector"], + ["L279", "vector"], + ["L288", "attack-info"], + ["L301", "(inline-array mother-spider-leg-info)", 8], + ["L302", "(inline-array mother-spider-thread)", 9] + ], + + "bully": [ + ["L90", "attack-info"], + ["L91", "attack-info"], + ["L93", "attack-info"] + ], + + "bones": [ + ["L159", "shadow-settings"], + ["L161", "vector"], + ["L162", "vu-function"] + ], + + "tie": [["L43", "vu-function"]], + + "tie-near": [["L91", "vu-function"]], + + "depth-cue": [["L17", "depth-cue-work"]], + + "navigate": [ + ["L402", "vector"], + ["L403", "vector"], + ["L404", "vector"], + ["L405", "vector"], + ["L406", "vector"], + ["L422", "vector"], + ["L419", "(pointer uint8)", 4], + ["L425", "float", true], + ["L426", "float", true], + ["L429", "float", true], + ["L430", "float", true], + ["L436", "float", true], + ["L438", "float", true], + ["L444", "float", true], + ["L442", "float", true], + ["L520", "vector"], + ["L522", "float", true], // TODO - meters + ["L523", "float", true] // TODO - meters + ], + + "eye": [ + ["L36", "eye-work"], + ["L38", "float", true], + ["L40", "float", true], + ["L44", "uint64", true] + ], + + "snow-bunny": [["L190", "attack-info"]], + + "ocean-vu0": [ + ["L8", "vu-function"], + ["L9", "ocean-vu0-work"] + ], + + "ocean-near": [ + ["L35", "vu-function"], + ["L37", "float", true], + ["L44", "float", true] + ], + + "ocean-mid": [["L150", "vu-function"]], + + "generic-merc": [ + ["L161", "(inline-array invinitdata)", 8], + ["L162", "vu-function"] + ], + + "generic-vu0": [["L1", "vu-function"]], + + "generic-vu1": [ + ["L8", "vector4w"], + ["L9", "vector4w"], + ["L10", "vu-function"] + ], + + "generic-effect": [["L95", "generic-consts"]], + + "shadow-vu1": [ + ["L5", "vu-function"], + ["L6", "shadow-vu1-gifbuf-template"] + ], + + "generic-vu0": [["L1", "vu-function"]], + "shrubbery": [["L133", "vu-function"]], + + "credits": [ + ["L32", "(array int32)"], + ["L33", "(array float)"] + ], + +// BEGIN + "ambient": [ + ["L334", "vector2h"], + ["L332", "vector2h"], + ["L331", "vector2h"], + ["L330", "vector2h"], + ["L329", "vector2h"], + ["L328", "vector2h"] + ], + + "sparticle-launcher": [["L193", "adgif-shader"]], + + "load-boundary": [ + ["L328", "(inline-array lbvtx)", 12], + ["L325", "vector"] + ], + + "cam-debug": [ + ["L172", "vector4w"], + ["L173", "vector4w"], + ["L174", "vector4w"], + ["L175", "vector4w"], + ["L176", "vector4w"], + ["L207", "vector4w"], + ["L208", "vector4w"], + ["L209", "vector4w"], + ["L210", "vector4w"], + ["L211", "vector4w"], + ["L212", "vector4w"], + ["L213", "vector4w"], + ["L214", "vector4w"], + ["L215", "vector4w"], + ["L216", "vector4w"], + ["L217", "vector4w"], + ["L218", "vector4w"], + ["L219", "vector4w"], + ["L220", "vector4w"], + ["L221", "vector4w"], + ["L222", "vector4w"], + ["L223", "vector4w"], + ["L224", "vector4w"], + ["L225", "vector4w"], + ["L226", "vector4w"], + ["L227", "vector4w"], + ["L228", "vector4w"], + ["L229", "vector4w"], + ["L230", "vector4w"], + ["L231", "vector4w"], + ["L232", "vector4w"], + ["L237", "vector4w"], + ["L238", "vector4w"], + ["L239", "vector4w"], + ["L240", "vector4w"], + ["L241", "vector"], + ["L242", "vector"], + ["L243", "vector4w"], + ["L244", "vector"], + ["L245", "vector"], + ["L252", "vector"], + ["L253", "vector"], + ["L254", "vector"], + ["L255", "vector"], + ["L261", "vector4w"] + ], + + "sequence-a-village1": [["L40", "vector"]], + + "ogreboss": [ + ["L360", "attack-info"], + ["L368", "attack-info"], + ["L371", "attack-info"], + ["L372", "attack-info"], + ["L385", "float", true], + ["L386", "float", true], + ["L387", "float", true], + ["L388", "float", true], + ["L389", "float", true], + ["L390", "float", true], + ["L391", "float", true], + ["L392", "float", true], + ["L393", "float", true], + ["L394", "float", true], + ["L395", "float", true], + ["L396", "float", true], + ["L397", "float", true], + ["L398", "float", true], + ["L399", "float", true], + ["L400", "float", true], + ["L401", "float", true], + ["L402", "float", true], + ["L403", "float", true], + ["L404", "float", true], + ["L405", "float", true], + ["L406", "float", true], + ["L407", "float", true], + ["L408", "float", true], + ["L409", "float", true], + ["L410", "float", true], + ["L411", "float", true], + ["L412", "float", true], + ["L413", "float", true], + ["L414", "float", true], + ["L415", "float", true], + ["L416", "float", true], + ["L417", "float", true], + ["L418", "float", true], + ["L419", "float", true], + ["L420", "float", true], + ["L421", "float", true], + ["L422", "float", true], + ["L423", "float", true], + ["L424", "float", true], + ["L425", "float", true], + ["L426", "float", true], + ["L427", "float", true], + ["L428", "float", true], + ["L429", "float", true], + ["L430", "float", true], + ["L431", "float", true], + ["L432", "float", true], + ["L433", "float", true], + ["L434", "float", true], + ["L435", "float", true], + ["L436", "float", true], + ["L437", "float", true], + ["L438", "float", true], + ["L439", "float", true], + ["L440", "float", true], + ["L441", "float", true], + ["L442", "float", true], + ["L443", "float", true], + ["L444", "float", true], + ["L445", "float", true], + ["L446", "float", true], + ["L447", "float", true], + ["L448", "float", true], + ["L449", "float", true], + ["L450", "float", true], + ["L451", "float", true], + ["L452", "float", true], + ["L453", "float", true], + ["L454", "float", true], + ["L455", "float", true], + ["L456", "float", true], + ["L457", "float", true], + ["L458", "float", true], + ["L459", "float", true], + ["L460", "float", true], + ["L461", "float", true], + ["L462", "rgba", true], + ["L463", "uint64", true], + ["L464", "uint64", true], + ["L465", "uint64", true], + ["L466", "uint64", true], + ["L467", "uint64", true], + ["L526", "float", true], + ["L527", "uint64", true], + ["L528", "uint64", true], + ["L529", "uint64", true], + ["L530", "uint64", true], + ["L531", "uint64", true] + ], + + "flying-lurker": [ + ["L200", "attack-info"], + ["L190", "vector"] + ], + + "target": [ + ["L728", "float", true], + ["L729", "float", true], + ["L730", "float", true], + ["L731", "float", true], + ["L732", "float", true], + ["L733", "float", true], + ["L734", "float", true], + ["L735", "float", true], + ["L736", "float", true], + ["L737", "float", true], + ["L738", "float", true], + ["L739", "float", true], + ["L740", "float", true], + ["L741", "float", true], + ["L742", "float", true], + ["L743", "float", true], + ["L744", "float", true], + ["L745", "float", true], + ["L746", "float", true], + ["L747", "float", true], + ["L748", "float", true], + ["L749", "float", true], + ["L750", "float", true], + ["L751", "float", true], + ["L752", "float", true], + ["L753", "float", true], + ["L754", "float", true], + ["L755", "float", true], + ["L756", "float", true], + ["L757", "float", true], + ["L758", "float", true], + ["L759", "float", true], + ["L760", "float", true], + ["L761", "float", true], + ["L762", "float", true], + ["L763", "float", true], + ["L764", "float", true], + ["L765", "float", true], + ["L766", "float", true], + ["L767", "float", true], + ["L768", "float", true], + ["L769", "float", true], + ["L770", "float", true], + ["L771", "float", true], + ["L772", "float", true], + ["L773", "float", true], + ["L774", "float", true], + ["L775", "float", true], + ["L776", "float", true], + ["L777", "float", true], + ["L778", "float", true], + ["L779", "float", true], + ["L780", "float", true], + ["L781", "float", true], + ["L782", "float", true], + ["L783", "float", true], + ["L784", "float", true], + ["L785", "float", true], + ["L786", "float", true], + ["L787", "float", true], + ["L788", "float", true], + ["L789", "float", true], + ["L790", "float", true], + ["L791", "float", true], + ["L792", "float", true], + ["L793", "float", true], + ["L794", "float", true], + ["L795", "float", true], + ["L796", "float", true], + ["L797", "float", true], + ["L798", "float", true], + ["L799", "float", true], + ["L800", "float", true], + ["L801", "float", true], + ["L802", "float", true], + ["L803", "float", true], + ["L804", "float", true], + ["L805", "float", true], + ["L806", "float", true], + ["L807", "float", true], + ["L808", "float", true], + ["L809", "float", true], + ["L810", "float", true], + ["L811", "float", true], + ["L812", "float", true], + ["L813", "float", true], + ["L814", "float", true], + ["L815", "float", true], + ["L816", "float", true], + ["L817", "float", true], + ["L818", "float", true], + ["L819", "float", true], + ["L820", "float", true], + ["L821", "float", true], + ["L822", "float", true], + ["L823", "uint64", true], + ["L824", "uint64", true] + ], + + "target2": [ + ["L615", "attack-info"], + ["L656", "float", true], + ["L657", "float", true], + ["L658", "float", true], + ["L659", "float", true], + ["L660", "float", true], + ["L661", "float", true], + ["L662", "float", true], + ["L663", "float", true], + ["L664", "float", true], + ["L665", "float", true], + ["L666", "float", true], + ["L667", "float", true], + ["L668", "float", true], + ["L669", "float", true], + ["L670", "float", true], + ["L671", "float", true], + ["L672", "float", true], + ["L673", "float", true], + ["L674", "float", true], + ["L675", "float", true], + ["L676", "float", true], + ["L677", "float", true], + ["L678", "float", true], + ["L679", "float", true], + ["L680", "float", true], + ["L681", "float", true], + ["L682", "float", true], + ["L683", "float", true], + ["L684", "float", true], + ["L685", "float", true], + ["L686", "float", true], + ["L687", "float", true], + ["L688", "float", true], + ["L689", "float", true], + ["L690", "float", true], + ["L691", "float", true], + ["L692", "float", true], + ["L693", "float", true], + ["L694", "float", true], + ["L695", "float", true], + ["L696", "float", true], + ["L697", "float", true], + ["L698", "float", true], + ["L699", "float", true], + ["L700", "float", true], + ["L701", "float", true], + ["L702", "float", true], + ["L703", "float", true], + ["L704", "float", true], + ["L705", "float", true], + ["L706", "float", true], + ["L707", "float", true], + ["L708", "float", true], + ["L709", "float", true], + ["L710", "float", true], + ["L711", "float", true], + ["L712", "float", true], + ["L713", "float", true], + ["L714", "float", true], + ["L715", "float", true], + ["L716", "float", true], + ["L717", "float", true], + ["L718", "float", true], + ["L719", "float", true], + ["L720", "float", true], + ["L721", "float", true], + ["L722", "float", true], + ["L723", "float", true], + ["L724", "float", true], + ["L725", "float", true], + ["L726", "float", true], + ["L727", "float", true], + ["L728", "float", true], + ["L729", "float", true], + ["L730", "float", true], + ["L731", "float", true], + ["L732", "float", true], + ["L733", "float", true], + ["L734", "float", true], + ["L735", "float", true], + ["L736", "float", true], + ["L737", "float", true], + ["L738", "float", true], + ["L739", "float", true], + ["L740", "float", true], + ["L741", "float", true], + ["L742", "float", true], + ["L743", "float", true], + ["L744", "float", true], + ["L745", "float", true], + ["L746", "float", true], + ["L747", "float", true], + ["L748", "uint64", true], + ["L759", "uint64", true] + ], + + "target-death": [ + ["L314", "vector"], + ["L322", "float", true], + ["L323", "float", true], + ["L324", "float", true], + ["L325", "float", true], + ["L326", "float", true], + ["L327", "float", true], + ["L328", "float", true], + ["L329", "float", true], + ["L330", "float", true], + ["L331", "float", true], + ["L332", "float", true], + ["L333", "float", true], + ["L334", "float", true], + ["L335", "float", true], + ["L336", "float", true], + ["L337", "float", true], + ["L338", "float", true], + ["L339", "float", true], + ["L340", "float", true], + ["L341", "float", true], + ["L342", "float", true], + ["L343", "float", true], + ["L344", "float", true], + ["L345", "float", true], + ["L346", "float", true], + ["L347", "float", true], + ["L348", "float", true], + ["L349", "float", true], + ["L350", "uint64", true], + ["L351", "uint64", true], + ["L352", "uint64", true], + ["L353", "uint64", true], + ["L354", "uint64", true], + ["L355", "uint64", true], + ["L356", "uint64", true], + ["L357", "uint64", true], + ["L358", "uint64", true], + ["L361", "float", true] + ], + + "progress": [ + ["L576", "vector"], + ["L578", "vector"], + ["L580", "vector"], + ["L582", "vector"], + ["L584", "vector"], + ["L586", "vector"], + ["L589", "float", true], + ["L590", "float", true], + ["L591", "float", true], + ["L592", "float", true], + ["L593", "float", true], + ["L594", "float", true], + ["L595", "float", true], + ["L596", "float", true], + ["L597", "float", true], + ["L598", "float", true], + ["L599", "float", true], + ["L600", "float", true], + ["L601", "float", true], + ["L602", "float", true], + ["L603", "float", true], + ["L604", "float", true], + ["L605", "float", true], + ["L606", "float", true], + ["L607", "float", true], + ["L608", "float", true], + ["L609", "float", true], + ["L610", "float", true], + ["L611", "float", true], + ["L612", "float", true], + ["L613", "float", true], + ["L614", "float", true], + ["L615", "float", true], + ["L617", "float", true], + ["L616", "float", true], + ["L618", "float", true], + ["L619", "float", true], + ["L620", "float", true], + ["L621", "float", true], + ["L622", "float", true], + ["L623", "float", true], + ["L624", "float", true], + ["L625", "float", true], + ["L626", "float", true], + ["L627", "float", true], + ["L628", "float", true], + ["L629", "float", true], + ["L630", "float", true], + ["L631", "float", true], + ["L632", "float", true], + ["L633", "float", true], + ["L634", "float", true], + ["L635", "float", true], + ["L636", "float", true], + ["L637", "float", true], + ["L638", "float", true], + ["L639", "uint64", true], + ["L640", "uint64", true], + ["L641", "uint64", true], + ["L642", "uint64", true], + ["L643", "uint64", true], + ["L644", "uint64", true], + ["L645", "uint64", true], + ["L646", "uint64", true], + ["L647", "uint64", true], + ["L648", "uint64", true], + ["L649", "uint64", true], + ["L650", "uint64", true], + ["L651", "uint64", true], + ["L652", "uint64", true], + ["L670", "uint64", true] + ], + // 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_pal/stack_structures.jsonc b/decompiler/config/jak1_pal/stack_structures.jsonc deleted file mode 100644 index 59ce0b6146..0000000000 --- a/decompiler/config/jak1_pal/stack_structures.jsonc +++ /dev/null @@ -1,2978 +0,0 @@ -{ - "run-function-in-process": [ - [16, ["array", "uint64", 6]], - [64, "catch-frame"] - ], - - "matrixp*!": [[16, "matrix"]], - - "vector3s-matrix*!": [[16, "vector"]], - - "vector3s-rotate*!": [[16, "vector"]], - - "matrix-rotate-zyx!": [ - [16, "matrix"], - [80, "matrix"] - ], - - "matrix-rotate-xyz!": [ - [16, "matrix"], - [80, "matrix"] - ], - - "matrix-rotate-zxy!": [ - [16, "matrix"], - [80, "matrix"] - ], - - "matrix-rotate-yxz!": [ - [16, "matrix"], - [80, "matrix"] - ], - - "matrix-rotate-yzx!": [ - [16, "matrix"], - [80, "matrix"] - ], - - "matrix-rotate-yxy!": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "matrix-rotate-yx!": [[16, "matrix"]], - - "transform-matrix-calc!": [ - [16, "matrix"], - [80, "matrix"] - ], - - "transform-matrix-parent-calc!": [ - [16, "matrix"], - [80, "matrix"] - ], - - "matrix-with-scale->quaternion": [[16, "matrix"]], - - "quaternion-exp!": [[16, "vector"]], - "quaternion-slerp!": [[16, "vector"]], - "quaternion-zxy!": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "vector-x-quaternion!": [[16, "matrix"]], - "vector-y-quaternion!": [[16, "matrix"]], - "vector-z-quaternion!": [[16, "matrix"]], - - "quaternion-y-angle": [[16, "vector"]], - "quaternion-rotate-local-x!": [[16, "quaternion"]], - "quaternion-rotate-local-y!": [[16, "quaternion"]], - "quaternion-rotate-local-z!": [[16, "quaternion"]], - "quaternion-rotate-y!": [[16, "quaternion"]], - "quaternion-rotate-x!": [ - [16, "quaternion"], - [32, "vector"] - ], - "quaternion-rotate-z!": [ - [16, "quaternion"], - [32, "vector"] - ], - "quaternion-delta-y": [ - [16, "vector"], - [32, "vector"] - ], - "quaternion-rotate-y-to-vector!": [ - [16, "quaternion"], - [32, "vector"], - [48, "quaternion"] - ], - "quaternion-xz-angle": [ - [16, "matrix"], - [80, "vector"] - ], - "vector-rotate-y!": [ - [16, "quaternion"], - [32, "matrix"] - ], - - "eul->matrix": [[16, "vector"]], - "eul->quat": [[16, "matrix"]], - "quat->eul": [[16, "matrix"]], - - "vector-line-distance": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - "vector-line-distance-point!": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "forward-up-nopitch->inv-matrix": [[16, "vector"]], - - "forward-up-nopitch->quaternion": [[16, "matrix"]], - - "forward-up->quaternion": [ - [16, "matrix"], - [80, "vector"] - ], - - "quaternion-from-two-vectors!": [[16, "vector"]], - - "quaternion-from-two-vectors-max-angle!": [[16, "vector"]], - - "matrix-from-two-vectors!": [[16, "vector"]], - "matrix-from-two-vectors-max-angle!": [[16, "vector"]], - "matrix-from-two-vectors-max-angle-partial!": [[16, "vector"]], - "matrix-from-two-vectors-partial-linear!": [[16, "vector"]], - "matrix-remove-z-rot": [ - [16, "vector"], - [32, "matrix"] - ], - - "matrix-rot-diff!": [ - [16, "quaternion"], - [32, "quaternion"], - [48, "quaternion"] - ], - - "quaternion-seek": [ - [16, "matrix"], - [80, "matrix"], - [144, "quaternion"] - ], - "vector-deg-seek": [[16, "matrix"]], - "vector-deg-slerp": [ - [16, "matrix"], - [80, "vector"], - [96, "vector"] - ], - - "circle-test": [ - [16, "sphere"], - [32, "sphere"], - [48, "vector"], - [64, "vector"] - ], - - "move-target-from-pad": [ - [16, "vector"], - [32, "vector"], - [48, "matrix"] - ], - - "draw-sprite2d-xy": [[16, "draw-context"]], - "screen-gradient": [[16, "draw-context"]], - - "(method 10 oscillating-vector)": [[16, "vector"]], - - "show-mc-info": [[16, "mc-slot-info"]], - - "update-mood-erase-color2": [[16, "mood-fog"]], - - "make-light-kit": [[16, "matrix"]], - - "matrix<-parented-transformq!": [[16, "vector"]], - - "(method 20 trsqv)": [[16, "vector"]], - - "(method 19 trsqv)": [[16, "vector"]], - - "(method 17 trsqv)": [ - [16, "quaternion"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"] - ], - - "(method 25 trsqv)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "(method 16 trsqv)": [ - [16, "matrix"], - [80, "matrix"] - ], - - "(method 14 trsqv)": [[16, "vector"]], - - "(method 13 trsqv)": [[16, "vector"]], - - "(method 12 trsqv)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 11 trsqv)": [[16, "vector"]], - - "(method 10 trsqv)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 23 trsqv)": [[16, "vector"]], - "(method 24 trsqv)": [[16, "vector"]], - - "vector-sincos!": [[16, "vector"]], - - "init-for-transform": [ - [16, "matrix"], - [80, "matrix"], - [144, "vector4s-3"], - [192, "vector"], - [208, "vector4s-3"] - ], - - "string->sound-name": [[16, "qword"]], - - "(method 15 trajectory)": [ - [16, "vector"], - [32, "vector"] - ], - - "ripple-add-debug-sphere": [[16, "vector"]], - - "camera-teleport-to-entity": [ - [16, "transformq"], - [64, "event-message-block"] - ], - - "(method 10 cam-vector-seeker)": [[16, "vector"]], - - "joint-mod-look-at-handler": [ - [16, "vector"], - [32, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"] - ], - - "joint-mod-world-look-at-handler": [ - [16, "vector"], - [32, "vector"], - [64, "vector"], - [80, "matrix"], - [144, "vector"], - [160, "vector"], - [176, "matrix"] - ], - - "joint-mod-rotate-handler": [ - [16, "quaternion"], - [32, "quaternion"], - [48, "quaternion"] - ], - - "joint-mod-wheel-callback": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "draw-end-credits": [[16, "font-context"]], - - "draw-title-credits": [[16, "font-context"]], - - "moving-sphere-sphere-intersect": [[16, "vector"]], - - "moving-sphere-moving-sphere-intersect": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 9 cylinder-flat)": [ - [16, "vector"], - [32, "vector"], - [48, "cylinder-flat-verts"], - [208, "cylinder-flat-verts"], - [368, "matrix"], - [432, "vector"] - ], - - "(method 9 cylinder)": [ - [16, "vector"], - [32, "vector"], - [48, "cylinder-verts"], - [432, "cylinder-verts"], - [816, "matrix"], - [880, "matrix"] - ], - - "ray-arbitrary-circle-intersect": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 10 cylinder-flat)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 10 cylinder)": [ - [16, "vector"], - [32, "vector"] - ], - - "add-debug-sphere-from-table": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "make-debug-sphere-table": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "(method 20 actor-link-info)": [[16, "event-message-block"]], - "(method 21 actor-link-info)": [[16, "event-message-block"]], - "(method 23 actor-link-info)": [[16, "event-message-block"]], - - "(method 24 actor-link-info)": [[16, "event-message-block"]], - - "internal-draw-debug-line": [ - [16, "vector4w-2"], - [48, "vector4w-2"] - ], - "internal-draw-debug-text-3d": [ - [16, "vector4w"], - [32, "font-context"] - ], - "add-debug-triangle-normal": [ - [16, "vector"], - [32, "vector"] - ], - "add-debug-flat-triangle": [ - [16, "vector4w-3"], - [64, "vector4w-3"] - ], - "add-debug-point": [[16, "vector4w-2"]], - "add-debug-line2d": [ - [16, "vector4w"], - [32, "vector4w"] - ], - "add-debug-box": [ - [16, "vector"], - [32, "vector"] - ], - "add-debug-x": [ - [16, "vector"], - [32, "vector"] - ], - "add-debug-sphere-with-transform": [[16, "vector"]], - "add-debug-circle": [ - [16, "vector"], - [32, "vector"] - ], - "add-debug-vector": [[16, "vector"]], - "add-debug-yrot-vector": [[16, "vector"]], - "add-debug-arc": [ - [16, "vector"], - [32, "vector"] - ], - "add-debug-curve": [ - [16, "vector"], - [32, "vector"] - ], - "add-debug-points": [[16, "vector"]], - "add-debug-light": [[16, "vector"]], - "dma-timeout-cam": [ - [16, "vector"], - [32, "matrix"] - ], - - "(method 18 tracking-spline)": [ - [16, "tracking-spline-sampler"], - [32, "tracking-spline-sampler"] - ], - - "draw-ocean-transition": [ - [16, "sphere"] - ], - - "dm-cam-mode-func": [[16, "event-message-block"]], - "ocean-trans-add-upload-table": [ - [16, "vector"] - ], - - "dm-cam-settings-func": [[16, "event-message-block"]], - - "dm-cam-render-float": [[16, "event-message-block"]], - - "debug-create-cam-restore": [[16, "euler-angles"]], - - "dm-task-resolution": [[16, "event-message-block"]], - - "dm-task-get-money": [[16, "event-message-block"]], - - "dm-give-all-cells": [[16, "event-message-block"]], - - "dm-give-cell": [[16, "event-message-block"]], - - "(anon-function 13 default-menu)": [[16, "event-message-block"]], - - "(anon-function 12 default-menu)": [[16, "event-message-block"]], - - "(anon-function 11 default-menu)": [[16, "event-message-block"]], - - "(method 22 level)": [[16, "event-message-block"]], - "(method 9 level)": [[16, "event-message-block"]], - "(method 10 load-state)": [[16, "event-message-block"]], - "cam-slave-get-rot": [[16, "quaternion"]], - - "draw-joint-spheres": [[16, "vector"]], - "(method 16 process-drawable)": [ - [16, "matrix"], - [80, "matrix"], - [144, "vector"], - [160, "vector"] - ], - - "(anon-function 494 task-control)": [[16, "event-message-block"]], - "(anon-function 493 task-control)": [[16, "event-message-block"]], - "(anon-function 480 task-control)": [[16, "event-message-block"]], - "(anon-function 477 task-control)": [[16, "event-message-block"]], - "(anon-function 476 task-control)": [[16, "event-message-block"]], - "(anon-function 475 task-control)": [[16, "event-message-block"]], - "(anon-function 474 task-control)": [[16, "event-message-block"]], - "(anon-function 455 task-control)": [[16, "event-message-block"]], - "(anon-function 445 task-control)": [[16, "event-message-block"]], - "(anon-function 435 task-control)": [[16, "event-message-block"]], - "(anon-function 426 task-control)": [[16, "event-message-block"]], - "(anon-function 425 task-control)": [[16, "event-message-block"]], - "(anon-function 415 task-control)": [[16, "event-message-block"]], - "(anon-function 414 task-control)": [[16, "event-message-block"]], - "(anon-function 403 task-control)": [[16, "event-message-block"]], - "(anon-function 400 task-control)": [[16, "event-message-block"]], - "(anon-function 393 task-control)": [[16, "event-message-block"]], - "(anon-function 390 task-control)": [[16, "event-message-block"]], - "(anon-function 383 task-control)": [[16, "event-message-block"]], - "(anon-function 380 task-control)": [[16, "event-message-block"]], - "(anon-function 369 task-control)": [[16, "event-message-block"]], - "(anon-function 368 task-control)": [[16, "event-message-block"]], - "(anon-function 367 task-control)": [[16, "event-message-block"]], - "(anon-function 366 task-control)": [[16, "event-message-block"]], - "(anon-function 365 task-control)": [[16, "event-message-block"]], - "(anon-function 364 task-control)": [[16, "event-message-block"]], - "(anon-function 363 task-control)": [[16, "event-message-block"]], - "(anon-function 362 task-control)": [[16, "event-message-block"]], - "(anon-function 337 task-control)": [[16, "event-message-block"]], - "(anon-function 336 task-control)": [[16, "event-message-block"]], - "(anon-function 286 task-control)": [[16, "event-message-block"]], - "(anon-function 227 task-control)": [[16, "event-message-block"]], - "(anon-function 38 task-control)": [[16, "event-message-block"]], - "(anon-function 28 task-control)": [[16, "event-message-block"]], - "(method 10 border-plane)": [[16, "vector"]], - "(method 9 game-info)": [[16, "event-message-block"]], - "(method 9 continue-point)": [[16, "vector"]], - "(method 9 game-save)": [[16, "file-stream"]], - "(method 10 game-save)": [[16, "file-stream"]], - "vector-vector-deg-slerp!": [ - [16, "vector"], - [32, "vector"], - [48, "quaternion"], - [64, "quaternion"], - [80, "quaternion"], - [96, "vector"] - ], - - "closest-pt-in-triangle": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "vector-circle-tangent-new": [ - [16, "sphere"], - [32, "vector"], - [48, "vector"] - ], - - "vector-circle-tangent": [ - [16, "sphere"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "vector-plane-distance": [[16, "vector"]], - - "curve-length": [ - [16, "vector"], - [32, "vector"] - ], - - "curve-closest-point": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 27 seagull)": [ - [16, "vector"], - [32, "vector"] - ], - - "add-debug-air-box": [ - [16, "vector"], - [32, "vector"] - ], - - "mem-size": [[16, "memory-usage-block"]], - - "display-loop": [[16, "sphere"]], - - "(method 14 curve-control)": [[16, "vector"]], - - "(method 19 path-control)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "progress-allowed?": [[16, "event-message-block"]], - - "(method 9 align-control)": [ - [16, "matrix"], - [80, "quaternion"] - ], - - "(method 10 align-control)": [[16, "vector"]], - - "(method 15 load-state)": [ - [16, "event-message-block"], - [96, "event-message-block"] - ], - - "(method 43 farmer)": [ - [16, "vector"] - ], - - "yakow-post": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"] - ], - - "anim-tester-save-object-seqs": [ - [16, "file-stream"] - ], - - "anim-test-obj-list-handler": [[16, "event-message-block"]], - "anim-test-anim-list-handler": [[16, "event-message-block"]], - "anim-test-sequence-list-handler": [[16, "event-message-block"]], - "anim-test-edit-sequence-list-handler": [[16, "event-message-block"]], - "anim-test-edit-seq-insert-item": [[16, "event-message-block"]], - "anim-test-edit-sequence-list-handler": [ - [112, "event-message-block"], - [16, "font-context"] - ], - "anim-tester-add-newobj": [[16, "event-message-block"]], - "anim-tester-start": [[16, "event-message-block"]], - "anim-tester-add-sequence": [[16, "event-message-block"]], - - "(anon-function 28 task-control)": [[16, "event-message-block"]], - - "instance-tfragment-add-debug-sphere": [ - [16, "vector"] - ], - - "(method 10 game-save)": [[16, "file-stream"]], - - "cam-state-from-entity": [[16, "curve"]], - - "(method 9 cam-index)": [[16, "vector"]], - - "(method 10 cam-index)": [[16, "vector"]], - - "(method 15 tracking-spline)": [ - [16, "tracking-spline-sampler"], - [32, "tracking-point"] - ], - - "(method 16 tracking-spline)": [ - [16, "tracking-spline-sampler"], - [32, "vector"] - ], - - "(method 18 tracking-spline)": [ - [16, "tracking-spline-sampler"], - [32, "vector"] - ], - - "(method 20 tracking-spline)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 21 tracking-spline)": [ - [16, "tracking-spline-sampler"], - [32, "vector"] - ], - - "(method 22 tracking-spline)": [ - [16, "tracking-spline-sampler"], - [32, "vector"] - ], - - "cam-slave-init": [[16, "event-message-block"]], - - "cam-curve-pos": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "curve-length": [ - [16, "vector"], - [32, "vector"] - ], - - "curve-closest-point": [ - [16, "vector"], - [32, "vector"] - ], - - "cam-calc-follow!": [ - [16, "event-message-block"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [144, "vector"] - ], - - "mat-remove-z-rot": [ - [16, "vector"], - [32, "matrix"] - ], - - "slave-matrix-blend-2": [ - [16, "vector"], - [32, "quaternion"], - [48, "quaternion"], - [64, "quaternion"] - ], - - "vector-into-frustum-nosmooth!": [ - [16, "matrix"], - [80, "vector"], - [96, "vector"] - ], - - "slave-set-rotation!": [ - [16, "vector"], - [32, "matrix"], - [96, "vector"], - [112, "matrix"], // guess - [176, "vector"] // guess - ], - - "v-slrp2!": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "matrix"], - [128, "vector"] - ], - - "v-slrp3!": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "matrix"], - [128, "vector"] - ], - - "(code cam-combiner-active)": [ - [16, "vector"], - [32, "matrix"], - [80, "vector"], - [96, "matrix"] - ], - - "cam-master-init": [ - [16, "vector"], - [32, "vector"] - ], - - "plane-from-points": [[16, "vector"]], - - "update-view-planes": [ - [16, "view-frustum"], - [144, "vector"], - [160, "vector"], - [176, "vector"], - [192, "vector"], - [208, "vector"], - [224, "vector"] - ], - - "move-camera-from-pad": [[16, "vector"]], - - "cam-free-floating-move": [[16, "camera-free-floating-move-info"]], - - "update-camera": [ - [16, "vector"], - [32, "quaternion"], - [48, "vector"] - ], - - "ocean-make-trans-camera-masks": [ - [16, "vector"], - [32, "vector"] - ], - - "(anon-function 28 task-control)": [[16, "event-message-block"]], - - "update-mood-prt-color": [ - [16, "vector"] - ], - - "update-mood-swamp": [ - [16, "vector"] - ], - - "update-mood-village1": [ - [16, "vector"] - ], - - "update-mood-maincave": [ - [16, "vector"] - ], - - "update-mood-ogre": [ - [16, "vector"] - ], - - "update-mood-finalboss": [ - [16, "vector"], - [32, "vector"] - ], - - "update-mood-darkcave": [ - [16, "vector"], - [32, "vector"] - ], - - "update-mood-citadel": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"], - [112, "vector"], - [128, "vector"] - ], - - "update-mood-jungleb": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "update-mood-sunken": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "update-mood-village2": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "update-mood-rolling": [ - [16, "vector"] // TODO - really not sure about this one - ], - - "update-mood-village3": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"] - ], - - "ocean-transition-check": [ - [16, "vector"] - ], - - "ocean-trans-add-upload-strip": [ - [16, "vector"] - ], - - "draw-ocean-transition-seams": [ - [16, "sphere"] - ], - - "(method 32 mayor)": [ - [16, "event-message-block"] - ], - - "(method 43 mayor)": [ - [16, "vector"] - ], - - "(method 10 tippy)": [ - [16, "vector"] - ], - - "compute-and-draw-shadow": [ - [16, "vector"], - [32, "vector"], - [48, "sparticle-cpuinfo"] // kinda a guess - ], - - "find-ground-and-draw-shadow": [ - [16, "vector"], - [32, "vector"], - [48, "collide-tri-result"] - ], - - "(method 20 collide-cache)": [ - [16, "vector"] - ], - - "(method 12 wobbler)": [ - [16, "vector"] - ], - - "(method 12 twister)": [ - [16, "matrix"] - ], - - "target-on-end-of-teetertotter?": [ - [16, "vector"], - [32, "vector"] - ], - - "(event teetertotter-launch)": [ - [16, "event-message-block"] - ], - - "(method 17 rigid-body)": [ - [16, "vector"] - ], - - "matrix-3x3-triple-transpose-product": [ - [16, "matrix"], - [80, "matrix"] - ], - - "(method 10 rigid-body)": [ - [16, "quaternion"] - ], - - "(method 13 rigid-body)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 16 rigid-body)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 14 rigid-body)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 18 rigid-body)": [ - [16, "vector"] - ], - - "(method 24 rigid-body-platform)": [ - [16, "vector"] - ], - - "(method 26 rigid-body-platform)": [ - [16, "vector"] - ], - - "(method 27 rigid-body-platform)": [ - [16, "vector"] - ], - - "(method 22 water-anim)": [ - [16, "vector"] - ], - - "(anon-function 9 plat-eco)": [ - [16, "event-message-block"] - ], - - "default-collision-reaction": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [96, "vector"] - ], - - "(trans plat-button-move-downward sunken-elevator)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(method 29 sunken-elevator)": [ - [16, "vector"] - ], - "(anon-function 0 title-obs)": [ - [16, "font-context"] - ], - - "print-game-text": [ - [16, "font-context"] - ], - - "draw-string-xy": [ - [16, "font-context"] - ], - - "(method 50 nav-enemy)": [ - [16, "vector"] - ], - - "nav-enemy-init-by-other": [ - [16, "vector"] - ], - - "nav-enemy-turn-to-face-point": [ - [16, "vector"] - ], - - "nav-enemy-facing-point?": [ - [16, "vector"] - ], - - "nav-enemy-jump-post": [ - [16, "vector"] - ], - - "(method 41 nav-enemy)": [ - [16, "vector"], - [32, "vector"] - ], - - "nav-enemy-falling-post": [ - [16, "vector"] // TODO - check collide-shape-moving::62(type, vector, float) - ], - - "nav-enemy-death-post": [ - [16, "vector"] // TODO - check collide-shape-moving::62(type, vector, float) - ], - - "nav-enemy-jump-land-post": [ - [16, "vector"], - [32, "vector"] - ], - - "nav-enemy-facing-direction?": [ - [16, "vector"], - [32, "vector"] - ], - - "nav-enemy-initialize-custom-jump": [ - [16, "vector"], - [32, "vector"] - ], - - "nav-enemy-flee-post": [ - [16, "vector"], - [32, "vector"] - ], - - "(enter nav-enemy-jump-land nav-enemy)": [ - [16, "vector"] - ], - "(code nav-enemy-die nav-enemy)": [ - [16, "event-message-block"] - ], - "(enter nav-enemy-die nav-enemy)": [ - [16, "event-message-block"] - ], - "(trans nav-enemy-flee nav-enemy)": [ - [16, "event-message-block"] - ], - "(trans nav-enemy-patrol nav-enemy)": [ - [16, "event-message-block"] - ], - - "(method 73 nav-enemy)": [ - [16, "event-message-block"] - ], - - "(method 43 nav-enemy)": [ - [16, "event-message-block"] - ], - - "nav-enemy-send-attack": [ - [16, "event-message-block"] - ], - - "birth-pickup-at-point": [ - [16, "vector"] - ], - - "merc-blend-shape": [ - [16, ["array", "int16", 128]] - ], - - "(method 43 bird-lady)": [ - [16, "vector"] - ], - - "(method 32 bird-lady-beach)": [ - [16, "event-message-block"] - ], - - "muse-to-idle": [ - [16, "event-message-block"] - ], - - "(method 32 sculptor)": [ - [16, "event-message-block"] - ], - - "(method 43 sculptor)": [ - [16, "vector"] - ], - - "(method 32 geologist)": [ - [16, "event-message-block"] - ], - - "(method 43 geologist)": [ - [16, "vector"] - ], - - "(method 32 oracle)": [ - [16, "event-message-block"] - ], - - "(method 11 oracle)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(method 32 explorer)": [ - [16, "event-message-block"] - ], - - "(method 43 explorer)": [ - [16, "vector"] - ], - - "(method 32 assistant)": [ - [16, "event-message-block"] - ], - - "(method 43 assistant)": [ - [16, "vector"] - ], - - "(code idle assistant)": [ - [16, "vector"], - [32, "vector"] - ], - - "check-drop-level-assistant": [ - [16, "vector"] - ], - - "(method 32 sage)": [ - [16, "event-message-block"] - ], - - "(method 43 sage)": [ - [16, "vector"] - ], - - "(trans idle sage)": [ - [16, "event-message-block"] - ], - - "(method 32 gambler)": [ - [16, "event-message-block"] - ], - - "(method 43 gambler)": [ - [16, "vector"] - ], - - "(method 32 warrior)": [ - [16, "event-message-block"] - ], - - "(method 43 warrior)": [ - [16, "vector"] - ], - - "(exit play-anim warrior)": [ - [16, "event-message-block"] - ], - - "minershort-trans-hook": [ - [16, "vector"] - ], - - "(method 32 minershort)": [ - [16, "event-message-block"] - ], - - "(exit play-anim minershort)": [ - [16, "event-message-block"] - ], - - "(method 43 minershort)": [ - [16, "vector"] - ], - - "(method 33 progress)": [[16, "event-message-block"]], - "hide-progress-screen": [[16, "event-message-block"]], - "progress-init-by-other": [[16, "quaternion"]], - "(post progress-debug)": [[16, "font-context"]], - "(post progress-normal)": [[16, "font-context"]], - "(code progress-normal)": [[16, "event-message-block"]], - "fuel-cell-progress-hud-orbit-callback": [ - [16, "vector"], - [32, "vector"] - ], - "(method 24 progress)": [[16, "font-context"]], - "(method 25 progress)": [[16, "font-context"]], - "(method 26 progress)": [[16, "font-context"]], - "(method 17 progress)": [[16, "font-context"]], - "(method 28 progress)": [[16, "font-context"]], - "(method 27 progress)": [[16, "font-context"]], - - "(method 11 fact-info-target)": [ - [16, "event-message-block"] - ], - - "(anon-function 6 game-info)": [ - [16, "event-message-block"] - ], - - "(anon-function 8 game-info)": [ - [16, "event-message-block"] - ], - - "(method 24 game-info)": [ - [16, "scf-time"] - ], - - "auto-save-post": [ - [16, "font-context"], - [112, "font-context"] - ], - - "auto-save-init-by-other":[ - [16, "event-message-block"] - ], - - "(code error auto-save)": [ - [16, "event-message-block"] - ], - - "(code done auto-save)": [ - [16, "event-message-block"] - ], - - "update-time-of-day": [ - [16, "(array float)"], // TODO - broken! - [48, "vector"] - ], - - "check-drop-level-rain": [ - [16, "vector"] - ], - - "update-rain": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "sparticle-track-sun": [ - [16, "vector"] - ], - - "draw-joint-spheres": [[16, "vector"]], - "(method 16 process-drawable)": [[16, "matrix"], [80, "matrix"], [144, "vector"], [160, "vector"]], - - "(method 16 target)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "vector-local+!": [ - [16, "vector"] - ], - - "move-forward": [ - [16, "vector"], - [32, "vector"] - ], - - "set-forward-vel": [ - [16, "vector"] - ], - - "delete-back-vel": [ - [16, "vector"], - [32, "vector"] - ], - - "set-side-vel": [ - [16, "vector"] - ], - - "build-conversions": [ - [16, "vector"] - ], - - "vector-turn-to": [ - [16, "vector"], - [32, "vector"] - ], - - "warp-vector-into-surface!": [ - [16, "matrix"] - ], - - "vector<-pad-in-surface!": [ - [16, "vector"] - ], - - "local-pad-angle": [ - [16, "vector"], - [32, "vector"] - ], - - "turn-around?": [ - [16, "vector"], - [32, "vector"] - ], - - "target-move-dist": [ - [16, "vector"] - ], - - "turn-to-vector": [ - [16, "vector"], - [32, "vector"] - ], - - "add-thrust": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [144, "vector"], - [160, "vector"], - [176, "vector"], - [192, "vector"], - [208, "vector"], - [224, "vector"] - ], - - "add-gravity": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "target-compute-slopes": [ - [16, "vector"], - [32, "vector"], - [48, "matrix"] - ], - - "do-rotations2": [ - [16, "vector"], - [32, "quaternion"], - [48, "quaternion"] - ], - - "level-setup": [ - [16, "event-message-block"] - ], - - "flag-setup": [ - [16, "vector"], - [32, "event-message-block"], - [112, "vector"], - [128, "vector"], - [144, "vector"], - [160, "vector"] - ], - - "target-compute-edge": [ - [16, "event-message-block"], - [96, "vector"], - [112, "vector"] - ], - - "target-compute-edge-rider": [ - [16, "event-message-block"], - [96, "vector"] - ], - - "target-calc-camera-pos": [ - [16, "vector"] - ], - - "joint-points": [ - [16, "vector"], - [32, "vector"] - ], - - "target-real-post": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "target-swim-post": [ - [16, "vector"] - ], - - "target-no-stick-post": [ - [16, "vector"] - ], - - "target-no-move-post": [ - [16, "collide-edge-hold-list"] // a total guess - ], - - "target-slide-down-post": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "matrix"] - ], - - "target-no-ja-move-post": [ - [16, "collide-edge-hold-list"] // a total guess - ], - - "target-print-stats": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "target-compute-pole": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "event-message-block"], - [160, "vector"], - [176, "vector"], - [192, "vector"] - ], - - "can-exit-duck?": [ - [16, "collide-using-spheres-params"], - [48, ["inline-array", "sphere", 2]] - ], - - "(method 32 evilbro)": [ - [16, "event-message-block"] - ], - - "(exit play-anim evilbro)": [ - [16, "event-message-block"] - ], - - "(method 29 basebutton)": [ - [16, "event-message-block"] - ], - - "(code use warp-gate)": [ - [16, "event-message-block"] - ], - - "(trans use warp-gate)": [ - [16, "event-message-block"] - ], - - "(anon-function 1 basebutton)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(code target-warp-out)": [ - [16, "event-message-block"], - [96, "vector"], - [112, "vector"] - ], - - "dm-anim-tester-func": [ - [16, "event-message-block"] - ], - - "update-actor-vis-box": [ - [16, "vector"] - ], - - "(method 14 level-group)":[ - [16, "vector"], - [32, "vector"] - ], - - "(trans falling beach-rock)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"] - ], - - "(code falling beach-rock)": [ - [16, "event-message-block"] - ], - - "(method 11 beach-rock)": [ - [16, "vector"] - ], - - "birth-func-copy-target-y-rot": [ - [16, "matrix"] - ], - - "birth-func-ground-orient": [ - [16, "vector"], - [32, "collide-tri-result"], - [128, "vector"], - [144, "quaternion"], - [160, "quaternion"] - ], - - "birth-func-target-orient": [ - [32, "vector"], - [48, "vector"], // unused - [64, "quaternion"], - [80, "quaternion"] - ], - - "birth-func-vector-orient": [ - [16, "vector"], - [32, "vector"], // unused - [48, "quaternion"] - ], - - "part-tracker-track-target-joint": [ - [16, "vector"] - ], - - "process-drawable-burn-effect": [ - [16, "rgbaf"], - [32, "rgbaf"], - [48, "vector"] - ], - - "(anon-function 27 projectiles)": [ - [16, "vector"] - ], - - "projectile-collision-reaction": [ - [16, "vector"], - [32, "vector"], - [48, "matrix"], - [96, "vector"], - [112, "event-message-block"], - [192, "vector"], - [208, "vector"] - ], - - "(event projectile-moving projectile)": [ - [16, "event-message-block"] - ], - - "(code projectile-moving projectile)": [ - [16, "vector"] - ], - - "projectile-update-velocity-space-wars": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "(code projectile-die projectile)": [ - [16, "event-message-block"] - ], - - "projectile-init-by-other": [ - [16, "collide-edge-hold-list"] - ], - - "(method 27 projectile-yellow)": [ - [16, "vector"] - ], - - "spawn-projectile-blue": [ - [16, "vector"], - [32, "vector"] - ], - - "(enter plat-button-move-downward jungle-elevator)": [ - [16, "event-message-block"] - ], - - "(trans plat-button-move-downward jungle-elevator)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(method 29 jungle-elevator)": [ - [16, "vector"] - ], - - "(event bouncer-wait)": [ - [16, "event-message-block"] - ], - - "hopper-find-ground": [ - [16, "vector"], - [32, "collide-tri-result"] - ], - - "blocking-plane-init-by-other": [ - [16, "matrix"] - ], - - "evilsib-trans-hook-wait": [ - [16, "event-message-block"] - ], - - "(method 32 sequenceB)": [ - [16, "event-message-block"] - ], - - "(event play-anim sequenceB)": [ - [16, "event-message-block"] - ], - - "(exit play-anim sequenceB)": [ - [16, "event-message-block"] - ], - - "sequenceC-can-trans-hook-2": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "sequenceC-can-trans-hook": [ - [16, "event-message-block"] - ], - - "(method 32 sequenceC)": [ - [16, "event-message-block"] - ], - - "sequenceC-trans-hook": [ - [16, "vector"] - ], - - "(trans hidden assistant-firecanyon)": [ - [16, "font-context"] - ], - - "(method 32 sage-bluehut)": [ - [16, "event-message-block"] - ], - - "(exit play-anim sage-bluehut)": [ - [16, "event-message-block"] - ], - - "(method 43 sage-bluehut)": [ - [16, "vector"] - ], - - "(method 37 sharkey)": [ - [16, "vector"] - ], - - "(method 39 sharkey)": [ - [16, "vector"] - ], - - "sharkey-notice-player?": [ - [16, "event-message-block"] - ], - - "sharkey-move-to-attack-position": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(code nav-enemy-attack sharkey)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(trans nav-enemy-chase sharkey)": [ - [16, "event-message-block"] - ], - - "(method 43 lurkercrab)": [ - [16, "vector"], - [32, "vector"] - ], - - "(enter idle assistant-lavatube-end)": [ - [16, "event-message-block"] - ], - - "target-has-all-the-cells?": [ - [16, "event-message-block"] - ], - - "(code idle power-left)": [ - [16, "event-message-block"] - ], - - "(code jump powercellalt)": [ - [16, "trajectory"] - ], - - "(enter target-final-door)": [ - [16, "event-message-block"] - ], - - "(exit target-final-door)": [ - [16, "event-message-block"] - ], - - "(code target-final-door)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "event-message-block"] - ], - - "(method 43 aphid)": [ - [16, "event-message-block"] - ], - - "(code nav-enemy-give-up aphid)": [ - [16, "vector"] - ], - - "aphid-init-by-other": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "voicebox-track": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "crate-standard-event-handler": [ - [16, "event-message-block"] - ], - - "plat-trans": [ - [16, "vector"] - ], - - "(code door-closing eco-door)": [ - [16, "overlaps-others-params"] - ], - - "(code door-open eco-door)": [ - [16, "event-message-block"] - ], - - "(code door-opening eco-door)": [ - [16, "event-message-block"] - ], - - "(code door-closed eco-door)": [ - [16, "event-message-block"] - ], - - "(code plat-button-teleport-to-other-end plat-button)": [ - [16, "vector"] - ], - - "plat-button-camera-on": [ - [16, "event-message-block"] - ], - - "plat-button-camera-off": [ - [16, "event-message-block"] - ], - - "(trans plat-button-move-downward plat-button)": [ - [16, "vector"] - ], - - "(trans plat-button-move-upward plat-button)": [ - [16, "vector"] - ], - - "(event plat-idle plat-eco)": [ - [16, "event-message-block"] - ], - - "(trans plat-idle plat-eco)": [ - [16, "vector"] - ], - - "(anon-function 8 plat-eco)": [ - [16, "event-message-block"] - ], - - "(anon-function 7 plat-eco)": [ - [16, "vector"] // code - ], - - "(event drop-plat-idle)": [ - [16, "event-message-block"] - ], - - "(code drop-plat-rise)": [ - [16, "vector"] - ], - - "(post drop-plat-rise)": [ - [16, "quaternion"] - ], - - "(code drop-plat-drop)": [ - [16, "vector"] - ], - - "(post drop-plat-drop)": [ - [16, "quaternion"] - ], - - "(method 21 drop-plat)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "citb-drop-plat-spawn-children": [ - [16, "vector"], - [32, "vector"] - ], - - "citb-drop-plat-drop-all-children": [ - [16, "event-message-block"] - ], - - "citb-drop-plat-drop-children": [ - [16, "event-message-block"] - ], - - "(event plat-flip-idle)": [ - [16, "event-message-block"] - ], - - "(code plat-flip-idle)": [ - [16, "vector"] - ], - - "(method 27 square-platform)": [ - [16, "vector"], - [32, "vector"] - ], - - "(event wedge-plat-tip)": [ - [16, "event-message-block"] - ], - - "(event wedge-plat-outer-tip)": [ - [16, "event-message-block"] - ], - - "(event wall-plat-extending)": [ - [16, "event-message-block"] - ], - - "(code wall-plat-extending)": [ - [16, "vector"] - ], - - "(event wall-plat-retracting)": [ - [16, "event-message-block"] - ], - - "(code wall-plat-retracting)": [ - [16, "vector"] - ], - - "(event wall-plat-sync-idle)": [ - [16, "event-message-block"] - ], - - "(code wall-plat-sync-idle)": [ - [16, "vector"] - ], - - "(method 11 wall-plat)": [ - [16, "vector"] - ], - - "(code plunger-lurker-plunge)": [[16, "event-message-block"]], - "(event flying-lurker-fly)": [[16, "event-message-block"]], - "(trans flying-lurker-fly)": [[16, "event-message-block"]], - "flying-lurker-handler": [[16, "event-message-block"]], - "flying-lurker-play-intro": [[16, "event-message-block"]], - "(code flying-lurker-start)": [[16, "event-message-block"]], - "(event flying-lurker-clone)": [[16, "event-message-block"]], - "(event flying-lurker-idle)": [[16, "event-message-block"]], - "(code flying-lurker-idle)": [[16, "event-message-block"]], - "flying-lurker-calc-speed": [ - [16, "vector"], - [32, "vector"] - ], - "(method 20 flying-lurker)": [ - [16, "collide-mesh-cache-tri"], - [112, "vector"], - [128, "vector"], - [144, "bounding-box"], - [176, "vector"] - ], - "flying-lurker-rotate": [ - [16, "matrix"], - [80, "matrix"], - [144, "vector"], - [160, "vector"] - ], - - "(method 18 collide-cache)": [[16, "collide-cache-prim"]], - - "kill-current-level-hint": [[16, "event-message-block"]], - "(exit level-hint-sidekick)": [[16, "event-message-block"]], - "(method 14 level-hint)": [[16, "font-context"]], - "(code level-hint-error)": [[16, "font-context"]], - "ambient-type-hint": [[16, "font-context"]], - "ambient-type-sound": [[32, "sound-spec"]], - "ambient-type-sound-loop": [[16, "sound-spec"]], - - "sp-relaunch-particle-3d": [ - [16, "quaternion"], - [32, "vector"], - [48, "quaternion"] - ], - - "sp-adjust-launch": [ - [16, "sparticle-launchinfo"], - [64, "matrix"], - [128, "vector"], - [144, "matrix"] - ], - - "(method 10 sparticle-launch-control)":[ - [16, "vector"] - ], - - "sparticle-50-to-60":[ - [16, "quaternion"] - ], - - - "sparticle-60-to-50":[ - [16, "quaternion"] - ], - - "sp-orbiter":[ - [16, "vector"], - [32, "vector"], - [48, "matrix"] - ], - - "sp-euler-convert":[ - [16, "vector"], - [32, "quaternion"] - ], - - "sp-rotate-system": [ - [16, "matrix"], - [80, "quaternion"] - ], - - "sp-launch-particles-death": [ - [16, "sprite-vec-data-2d"] // TODO this is probably wrong. - ], - - "birth-func-copy-rot-color": [ - [16, "vector"] - ], - - "birth-func-copy2-rot-color": [ - [16, "vector"], - [32, "vector"] - ], - - "(code nav-enemy-give-up babak)": [ - [16, "vector"] - ], - - "(method 10 gui-query)": [ - [16, "font-context"] - ], - - "(method 46 process-taskable)": [ - [16, "vector"], - [32, "vector"] - ], - - "(trans release process-taskable)": [ - [16, "event-message-block"] - ], - - "(trans give-cell process-taskable)": [ - [16, "event-message-block"] - ], - - "process-taskable-play-anim-code": [ - [16, "event-message-block"] - ], - - "(event idle process-taskable)": [ - [16, "event-message-block"] - ], - - "(trans idle process-taskable)": [ - [16, "font-context"], - [112, "event-message-block"] - ], - - "(post idle process-taskable)": [ - [16, "vector"] - ], - - "babak-with-cannon-ride-cannon-post": [ - [16, "vector"] - ], - - "(code babak-with-cannon-jump-onto-cannon)": [ - [16, "vector"] - ], - - "(code othercam-running)": [ - [16, "vector"], - [32, "vector"] - ], - - "(code wait-for-start flutflut)": [ - [16, "event-message-block"], - [96, "vector"] - ], - - "(code idle flutflut)": [ - [16, "font-context"], - [112, "event-message-block"] - ], - - "(event wait-for-return flutflut)": [ - [16, "event-message-block"] - ], - - "yakow-generate-travel-vector": [ - [16, "vector"], - [32, "vector"] - ], - - "yakow-facing-direction?": [ - [16, "vector"], - [32, "vector"] - ], - - "yakow-facing-point?": [ - [16, "vector"] - ], - - "(enter yakow-graze)": [ - [16, "event-message-block"] - ], - - "(method 13 vehicle-path)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(method 12 vehicle-controller)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 14 vehicle-controller)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 10 vehicle-controller)": [ - [16, "vector"] - ], - - "(method 23 fishermans-boat)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"], - [112, "vector"] - ], - - "fishermans-boat-wave": [ - [16, "vector"] - ], - - "fishermans-boat-spawn-particles": [ - [16, "vector"] - ], - - "fishermans-boat-play-sounds": [ - [16, "vector"] - ], - - "fishermans-boat-post": [ - [16, "event-message-block"] - ], - - "(code fishermans-boat-leaving-village)": [ - [16, "event-message-block"] - ], - - "(trans fishermans-boat-entering-village)": [ - [16, "event-message-block"] - ], - - "(code fishermans-boat-leaving-misty)": [ - [16, "event-message-block"] - ], - - "(trans fishermans-boat-entering-misty)": [ - [16, "event-message-block"] - ], - - "(exit fishermans-boat-player-control)": [ - [16, "event-message-block"] - ], - - "(code fishermans-boat-player-control)": [ - [16, "event-message-block"] - ], - - "(code fishermans-boat-ride-to-misty)": [ - [16, "event-message-block"] - ], - - "(event fishermans-boat-ride-to-village1)": [ - [16, "event-message-block"] - ], - - "(code fishermans-boat-ride-to-village1)": [ - [16, "event-message-block"] - ], - - "fishermans-boat-leave-dock?": [ - [16, "font-context"] - ], - - "(trans fishermans-boat-player-control)": [ - [16, "vector"] - ], - - "(code fishermans-boat-measurements)": [ - [16, "vector"] - ], - - "(method 15 vehicle-controller)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "analyze-point-on-path-segment": [ - [16, "vector"] - ], - - "(method 51 muse)": [ - [16, "vector"] - ], - - "muse-check-dest-point": [ - [16, "point-on-path-segment-info"] - ], - - "(code muse-caught)": [ - [16, "event-message-block"] - ], - - "(method 43 bonelurker)": [ - [16, "event-message-block"] - ], - - "bonelurker-stunned-event-handler": [ - [16, "event-message-block"] - ], - - "bonelurker-push-post": [ - [16, "vector"] - ], - - "(code nav-enemy-give-up bonelurker)": [ - [16, "vector"] - ], - - "(code bonelurker-stun)": [ - [16, "vector"] - ], - - "(method 32 assistant-bluehut)": [ - [16, "event-message-block"] - ], - - "(trans idle assistant-bluehut)": [ - [16, "event-message-block"] - ], - - "(exit play-anim assistant-bluehut)": [ - [16, "event-message-block"] - ], - - "(method 32 assistant-levitator)": [ - [16, "event-message-block"] - ], - - "(exit play-anim assistant-levitator)": [ - [16, "event-message-block"] - ], - - "(method 47 assistant-bluehut)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 43 assistant-bluehut)": [ - [16, "vector"] - ], - - "check-drop-level-assistant-bluehut": [ - [16, "vector"] - ], - - "assistant-levitator-blue-glow": [ - [16, "vector"] - ], - - "(code idle assistant-bluehut)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "assistant-levitator-blue-beam": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "collide-mesh-cache-tri"], - [160, "event-message-block"] - ], - - "(trans hidden assistant-levitator)": [ - [16, "font-context"] - ], - - "(event square-platform-lowering)": [ - [16, "event-message-block"] - ], - - "(method 33 qbert-plat)": [ - [16, "event-message-block"] - ], - - "(method 32 qbert-plat)": [ - [16, "event-message-block"] - ], - - "(event qbert-plat-master-idle)": [ - [16, "event-message-block"] - ], - - "(code qbert-plat-master-do-door)": [ - [16, "event-message-block"] - ], - - "(code qbert-plat-master-wait-for-door)": [ - [16, "event-message-block"] - ], - - "(code qbert-plat-master-idle)": [ - [16, "event-message-block"], - [96, "vector"], - [112, "vector"] - ], - - "keg-event-handler": [ - [16, "event-message-block"] - ], - - "(code keg-paddle-to-path)": [ - [16, "vector"], - [32, "vector"], - [48, "quaternion"], - [64, "quaternion"], - [80, "vector"] - ], - - "(code keg-on-path)": [ - [16, "vector"], - [32, "vector3s"] - ], - - "(code keg-in-chute)": [ - [16, "vector"], - [32, "vector"] - ], - - "keg-init-by-other": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(code keg-conveyor-paddle-idle)": [ - [16, "event-message-block"] - ], - - "(method 11 keg-conveyor)": [ - [16, "vector"], - [32, "matrix"] - ], - - "swamp-bat-slave-event-handler": [ - [16, "event-message-block"] - ], - - "swamp-bat-launch-slave": [ - [16, "event-message-block"] - ], - - "swamp-bat-slave-path-post": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(code swamp-bat-slave-idle)": [ - [16, "vector"], - [32, "quaternion"], - [48, "quaternion"], - [64, "vector"] - ], - - "(code swamp-bat-slave-launch)": [ - [16, "vector"], - [32, "vector"] - ], - - "(code swamp-bat-slave-die)": [ - [16, "vector"] - ], - - "swamp-bat-make-path-select-plane": [ - [16, "vector"] - ], - - "(method 44 swamp-rat)": [ - [16, "event-message-block"] - ], - - "(method 39 swamp-rat)": [ - [16, "vector"] - ], - - "(method 38 swamp-rat)": [ - [16, "vector"] - ], - - "(code swamp-rat-spawn)": [ - [16, "vector"] - ], - - "swamp-rat-update-wiggle-target": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "swamp-rat-nest-dummy-event-handler": [ - [16, "event-message-block"] - ], - - "(trans swamp-rat-nest-gestate)": [ - [16, "event-message-block"] - ], - - "(code swamp-rat-nest-victory)": [ - [16, "event-message-block"] - ], - - "swamp-rat-nest-pick-spawn-joint": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "swamp-rat-nest-spawn-rat": [ - [16, "vector"], - [32, "vector"] - ], - - "cavecrystal-light-control-default-callback": [ - [16, "vector"] - ], - - "spiderwebs-default-event-handler": [ - [16, "event-message-block"] - ], - - "(enter nav-enemy-die baby-spider)": [ - [16, "event-message-block"] - ], - - "(code baby-spider-die-fast)": [ - [16, "event-message-block"] - ], - - "(method 39 baby-spider)": [ - [16, "vector"] - ], - - "(enter nav-enemy-idle baby-spider)": [ - [16, "vector"] - ], - - "(method 52 baby-spider)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "mother-spider-proj-update-velocity": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "(method 28 mother-spider-proj)": [ - [16, "vector"] - ], - - "(code blue-eco-charger-orb-active)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(method 21 blue-eco-charger)": [ - [16, "event-message-block"] - ], - - "(method 20 blue-eco-charger)": [ - [16, "event-message-block"] - ], - - "(code blue-eco-charger-idle)": [ - [16, "event-message-block"] - ], - - "(code exit-chamber-charger-puzzle-beaten)": [ - [16, "event-message-block"] - ], - - "(code exit-chamber-idle-in-sunken)": [ - [16, "event-message-block"] - ], - - "(event exit-chamber-idle-in-sunken)": [ - [16, "event-message-block"], - [32, "event-message-block"] - ], - - "(method 24 exit-chamber)": [ - [16, "vector"] - ], - - "(method 23 exit-chamber)": [ - [16, "vector"], - [32, "vector"], - [48, "exit-chamber-items"], - [128, "event-message-block"], - [208, "vector"] - ], - - "tube-thrust": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"] - ], - - "target-tube-post": [ - [16, "vector"], - [32, "event-message-block"], - [112, "vector"] - ], - - "(event target-tube-start)": [ - [16, "event-message-block"] - ], - - "(exit target-tube-start)": [ - [16, "event-message-block"] - ], - - "(code target-tube-start)": [ - [16, "event-message-block"], - [96, "vector"] - ], - - "(method 21 sunkenfisha)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 24 sunkenfisha)": [ - [16, "vector"], - [32, "matrix"], - [96, "vector"] - ], - - "(method 23 sunkenfisha)": [ - [16, "vector"] - ], - - "(trans sunkenfisha-idle)": [ - [16, "vector"] - ], - - "(method 27 sunkenfisha)": [ - [64, "vector"] - ], - - "(event idle minecartsteel)": [ - [16, "collide-overlap-result"] - ], - - "(method 43 assistant-villagec)": [ - [16, "vector"] - ], - - "(method 32 sage-villagec)": [ - [16, "event-message-block"] - ], - - "(method 43 sage-villagec)": [ - [16, "vector"] - ], - - "(trans idle sage-villagec)": [ - [16, "event-message-block"] - ], - - "(exit play-anim sage-villagec)": [ - [16, "event-message-block"] - ], - - "(method 20 cave-trap)": [ - [16, "spawn-baby-spider-work"], - [80, "vector"], - [96, "event-message-block"], - [176, "vector"], - [192, "vector"], - [208, "vector"] - ], - - "(trans cave-trap-idle)": [ - [16, "event-message-block"] - ], - - "ice-cube-default-event-handler": [ - [16, "event-message-block"] - ], - - "(trans yeti-slave-appear-jump-up)": [ - [16, "vector"] - ], - - "(code nav-enemy-give-up yeti-slave)": [ - [16, "vector"] - ], - - "(code yeti-resuming-start)": [ - [16, "vector"], - [32, "vector"] - ], - - "(code yeti-idle)": [ - [16, "vector"], - [32, "vector"] - ], - - "(trans hidden assistant-lavatube-start)": [ - [16, "font-context"] - ], - - "(method 18 nav-control)": [ - [16, "vector"] - ], - - "check-drop-level-firehose-pops": [ - [16, "vector"] - ], - - "birth-func-random-rot": [ - [16, "matrix"], - [80, "vector"], - [96, "vector"] - ], - - "check-drop-level-bigdoor-open-pops": [ - [16, "vector"] - ], - - "check-drop-level-eichar-lighteco-pops": [ - [16, "vector"] - ], - - "check-drop-level-maincave-drip": [ - [16, "vector"] - ], - - "part-tracker-move-to-target": [ - [16, "vector"] - ], - - "part-tracker-track-target": [ - [16, "vector"] - ], - - "check-drop-level-village1-fountain-nosplash": [ - [16, "vector"] - ], - - "check-drop-level-village1-fountain": [ - [16, "vector"] - ], - - "check-drop-level-sagehut": [ - [16, "vector"] - ], - - "check-drop-level-training-mist": [ - [16, "vector"] - ], - - "check-drop-level-training-spout-rain": [ - [16, "vector"] - ], - - "check-drop-level-sagehut2": [ - [16, "vector"] - ], - - "(method 15 hud-money-all)": [ - [16, "font-context"] - ], - - "(method 20 hud-money-all)": [ - [16, "event-message-block"] - ], - - "(method 20 hud-money)": [ - [16, "event-message-block"] - ], - - "fuel-cell-hud-orbit-callback": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 19 hud-fuel-cell)": [ - [16, "vector"] - ], - - "(method 20 hud-fuel-cell)": [ - [16, "event-message-block"], - [96, "quaternion"] - ], - - "hide-hud": [ - [16, "event-message-block"] - ], - - "hide-bottom-hud": [ - [16, "event-message-block"] - ], - - "disable-hud": [ - [16, "event-message-block"] - ], - - "enable-hud": [ - [16, "event-message-block"] - ], - - "hide-hud-quick": [ - [16, "event-message-block"] - ], - - "show-hud": [ - [16, "event-message-block"] - ], - - "convert-to-hud-object": [ - [16, "vector"] - ], - - "(method 16 hud)": [ - [16, "event-message-block"] - ], - - "(enter hud-hidden)": [ - [16, "event-message-block"] - ], - - "(enter hud-arriving)": [ - [16, "event-message-block"] - ], - - "send-hud-increment-event": [ - [16, "event-message-block"] - ], - - "(code hud-collecting)": [ - [16, "vector"] - ], - - "battlecontroller-fill-all-spawners": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "battlecontroller-camera-on": [ - [16, "event-message-block"] - ], - - "(code battlecontroller-die battlecontroller)": [ - [16, "event-message-block"] - ], - - "battlecontroller-battle-begin": [ - [16, "event-message-block"] - ], - - "battlecontroller-update-spawners": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "battlecontroller-spawn-creature-at-spawner": [ - [16, "vector"], - [32, "vector"] - ], - - "battlecontroller-camera-off": [ - [16, "event-message-block"] - ], - - "battlecontroller-spawn-creature-random-spawner": [ - [16, "event-message-block"] - ], - - "(method 10 effect-control)": [ - [16, "event-message-block"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [144, "vector"] - ], - - "(method 11 effect-control)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 12 effect-control)": [ - [16, "sound-spec"], - [96, "vector"] - ], - - "(code helix-button-startup)": [ - [16, "vector"] - ], - - "(method 43 green-eco-lurker)": [ - [16, "event-message-block"] - ], - - "(method 73 green-eco-lurker)": [ - [16, "event-message-block"] - ], - - "citb-sagecage-draw-bars": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(code sunken-pipegame-start-up)": [ - [16, "event-message-block"] - ], - - "(code race-ring-active)": [ - [16, "event-message-block"], - [96, "vector"] - ], - - "(method 11 race-ring)": [ - [16, "vector"], - [32, "vector"] - ], - - "init-sky-regs": [ - [16, "vector"] - ], - - "set-tex-offset": [ - [16, "vector"] - ], - - "sky-tng-setup-cloud-layer": [ - [16,["inline-array", "sky-vertex", 12]] - ], - - "fisher-fish-move": [[16, "vector"]], - "fisher-fish-water": [[16, "vector"]], - "(trans play-accept fisher)": [[16, "vector"]], - "(method 11 fisher)": [[16, "vector"]], - "(code fisher-fish-caught)": [[16, "event-message-block"]], - "(code fisher-fish-die)": [[16, "event-message-block"]], - "(exit fisher-done)": [[16, "event-message-block"]], - "(enter fisher-done)": [[16, "event-message-block"]], - "(event fisher-playing)": [[16, "event-message-block"]], - "(enter fisher-playing)": [[16, "event-message-block"]], - "(exit fisher-playing)": [[16, "event-message-block"]], - "(trans enter-playing fisher)": [[16, "event-message-block"]], - "(code target-fishing)": [ - [16, "event-message-block"], - [96, "vector"], - [112, "quaternion"], - [128, "quaternion"], - [144, "quaternion"] - ], - "(method 43 fisher)": [ - [16, "vector"], - [32, "vector"] - ], - "fisher-draw-display": [[16, "font-context"]], - "(trans fisher-done)": [[16, "font-context"]], - - "(method 10 torus)": [ - [16, "vector"], - [32, "vector"] - ], - "(method 12 torus)": [[16, "matrix"]], - "redshot-trans": [[16, "matrix"]], - "(trans redshot-explode)": [ - [16, "vector"], - [32, "event-message-block"], - [112, "vector"] - ], - "(code darkecobomb-explode)": [[16, "event-message-block"]], - "(event yellowshot-idle)": [[16, "event-message-block"]], - "(trans yellowshot-idle)": [[16, "event-message-block"]], - "(trans darkecobomb-countdown)": [[16, "vector"]], - - "arcing-shot-draw": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 9 torus)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "matrix"], - [128, ["inline-array", "vector", 8]] - ], - - "(method 32 finalbosscam)": [[16, "event-message-block"]], - - "(code cam-robotboss)": [ - [16, "vector"], - [32, "vector"] - ], - - "ecoclaw-beam-particle-callback": [[16, "vector"]], - "robotboss-manipy-trans-hook": [[16, "vector"]], - "robotboss-redshot": [[16, "vector"]], - "robotboss-cut-cam": [[16, "vector"]], - - "robotboss-yellowshot": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(trans robotboss-white-eco-movie)": [[16, "vector"]], - - "(code robotboss-red-wait)": [ - [16, "vector"], - [32, "redshot-launch-info"] - ], - - "(trans robotboss-yellow-wait)": [ - [16, "vector"], - [32, "event-message-block"], - [112, "vector"] - ], - - "robotboss-setup-for-hits": [ - [16, "sphere"], - [32, "event-message-block"] - ], - - "robotboss-position": [ - [16, "vector"], - [32, "matrix"], - [96, "event-message-block"], - [176, "vector"] - ], - - "robotboss-shooting-trans": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "robotboss-darkecobomb": [ - [16, "vector"], - [32, "vector"] - ], - - "robotboss-redshot-fill-array": [ - [16, "vector"], - [32, "vector"] - ], - - "robotboss-blue-beam": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "collide-mesh-cache-tri"], - [160, "vector"], - [176, "event-message-block"] - ], - - "robotboss-bomb-handler": [[16, "event-message-block"]], - "robotboss-blue-done": [[16, "event-message-block"]], - "(exit robotboss-blue-wait)": [[16, "event-message-block"]], - "(enter robotboss-blue-wait)": [[16, "event-message-block"]], - "(exit robotboss-green-wait)": [[16, "event-message-block"]], - "(event robotboss-green-wait)": [[16, "event-message-block"]], - - "(trans robotboss-red-wait)": [ - [16, "event-message-block"], - [96, "vector"] - ], - - "(exit robotboss-red-wait)": [[16, "event-message-block"]], - "(exit robotboss-yellow-wait)": [[16, "event-message-block"]], - "(code robotboss-white-eco-movie)": [[16, "event-message-block"]], - "(event robotboss-yellow-dark-bomb-wait)": [[16, "event-message-block"]], - "(exit robotboss-yellow-dark-bomb-wait)": [[16, "event-message-block"]], - "(code robotboss-daxter-sacrifice-movie)": [[16, "event-message-block"]], - - "robotboss-greenshot": [ - [16, "vector"], - [32, "vector"] - ], - - "(trans robotboss-blue-wait)": [ - [16, "vector"], - [32, "event-message-block"], - [112, "vector"] - ], - - "(code robotboss-blue-wait)": [[16, "event-message-block"]], - - "(method 44 green-eco-lurker)": [[16, "event-message-block"]], - "(method 72 green-eco-lurker)": [[16, "event-message-block"]], - "(enter nav-enemy-die green-eco-lurker)": [[16, "event-message-block"]], - "(event spawn-minions)": [[16, "event-message-block"]], - "(method 51 green-eco-lurker)": [[16, "vector"]], - "(enter green-eco-lurker-appear)": [ - [16, "vector"], - [32, "vector"] - ], - "(code spawn-minions)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "check-drop-level-lighteco-big-pops": [[16, "vector"]], - "check-drop-level-lighteco-pops": [[16, "vector"]], - "(method 20 light-eco-child)": [[16, "vector"]], - "light-eco-child-default-event-handler": [[16, "event-message-block"]], - "(code light-eco-child-die)": [[16, "event-message-block"]], - "light-eco-mother-default-event-handler": [[16, "event-message-block"]], - "(trans light-eco-child-hit-ground)": [[16, "vector"]], - "(method 21 light-eco-mother)": [[16, "vector"]], - "(method 20 light-eco-mother)": [[16, "vector"]], - - "placeholder-do-not-add-below!": [] -} diff --git a/decompiler/config/jak1_pal/type_casts.jsonc b/decompiler/config/jak1_pal/type_casts.jsonc index d6e6956738..20fc75e2c3 100644 --- a/decompiler/config/jak1_pal/type_casts.jsonc +++ b/decompiler/config/jak1_pal/type_casts.jsonc @@ -1,19 +1,4 @@ -// This file replaces type_hints.jsonc. -// Functions are identified by their "unique name". This is the name after ".function" in the IR2 file. -// Each cast entry represents an override of a register's type at a certain point the function. -// These modifications do not propagate like normal types, so you may have to apply these modifications -// over a range of indices. - -// Entry format: [index, register, override] -// - The index can either be specified as a single integer, or as [min, max]. -// In the case of [min, max], the min index is included, but the max is not. ([1, 4] = 1, 2, 3). -// - The register is a string with the plain PS2 register name. -// - The type is a string with a valid GOAL typespec. -// It is parsed exactly like the compiler, so you can use compound types. -// You should only use register types here. - { - // GCOMMON "(method 2 array)": [ [23, "gp", "(array int32)"], [43, "gp", "(array uint32)"], @@ -30,14 +15,13 @@ [249, "gp", "(array basic)"], [258, "gp", "(array basic)"] ], - "(method 3 array)": [ [44, "gp", "(array int32)"], [62, "gp", "(array uint32)"], [80, "gp", "(array int64)"], [98, "gp", "(array uint64)"], [115, "gp", "(array int8)"], - [132, "gp", "(array int8)"], // bug in game + [132, "gp", "(array int8)"], [150, "gp", "(array int16)"], [168, "gp", "(array uint16)"], [191, "gp", "(array uint128)"], @@ -45,46 +29,34 @@ [226, "gp", "(array float)"], [243, "gp", "(array basic)"] ], - - // GKERNEL "(method 0 cpu-thread)": [[[13, 28], "v0", "cpu-thread"]], - "(method 0 process)": [ [12, "a0", "int"], [[13, 43], "v0", "process"] ], - "(method 0 dead-pool-heap)": [ - [60, "v0", "int"], // a lie, actually the 115 is an align16 constant propagated on addr of heap start. - //[63, "a0", "pointer"], + [60, "v0", "int"], [[61, 73], "v0", "dead-pool-heap"] ], - "(method 21 dead-pool-heap)": [ [5, "v1", "pointer"], [13, "a0", "pointer"], [25, "v1", "pointer"] ], - "(method 5 dead-pool-heap)": [ [3, "v1", "int"], [3, "a0", "int"] ], - "(method 0 protect-frame)": [ [0, "a0", "int"], [[1, 8], "v0", "protect-frame"] ], - "(method 10 process)": [[[24, 30], "s4", "protect-frame"]], - "(method 9 process)": [[43, "s5", "process"]], - "(method 14 dead-pool)": [ [[24, 25], "v1", "(pointer process)"], [[30, 39], "s4", "(pointer process)"] ], - "inspect-process-heap": [ [[4, 11], "s5", "basic"], [17, "s5", "pointer"] @@ -97,14 +69,18 @@ [26, "a1", "symbol"], [42, "a0", "symbol"] ], - "string-cat-to-last-char": [ [3, "s5", "(pointer uint8)"], [4, "s5", "string"] ], // GSTATE - "enter-state": [[68, "s0", "protect-frame"], [101, "t9", "(function object object object object object object none)"]], + "enter-state": [ + [68, "s0", "protect-frame"], + [101, "t9", "(function object object object object object object none)"] + ], + + "send-event-function": [[[7, 12], "a0", "process"]], // MATH "log2": [[3, "v1", "int"]], @@ -128,31 +104,21 @@ [6, "a0", "vif-bank"], [13, "a0", "vif-bank"] ], - "clear-vu1-mem": [[[0, 11], "v1", "(pointer uint32)"]], "clear-vu0-mem": [[[0, 11], "v1", "(pointer uint32)"]], - "dump-vu1-mem": [[[0, 49], "gp", "(pointer uint32)"]], - "dump-vu1-range": [[[0, 54], "s4", "(pointer uint32)"]], - "ultimate-memcpy": [ [[0, 54], "s4", "dma-bank-spr"], [[0, 54], "s3", "dma-bank-spr"] ], - - // dma-buffer "dma-buffer-add-vu-function": [[[9, 33], "t2", "dma-packet"]], - - // dma-bucket "dma-buffer-add-buckets": [ [[1, 4], "v1", "dma-bucket"], [5, "v1", "pointer"], [[9, 11], "v1", "dma-bucket"], [11, "v1", "pointer"] - //[[6, 15], "v1", "dma-bucket"] ], - "dma-buffer-patch-buckets": [ [7, "a0", "(inline-array dma-bucket)"], [8, "a3", "pointer"], @@ -162,12 +128,10 @@ [13, "a0", "(inline-array dma-bucket)"], [19, "a0", "(inline-array dma-bucket)"] ], - "dma-bucket-insert-tag": [ [[2, 6], "v1", "dma-bucket"], [3, "a0", "dma-bucket"] ], - "disasm-vif-details": [ [[62, 94], "s3", "(pointer uint32)"], [[98, 130], "s3", "(pointer uint16)"], @@ -175,25 +139,19 @@ [[168, 198], "s3", "(pointer uint16)"], [[202, 225], "s3", "(pointer uint16)"] ], - "disasm-vif-tag": [ [[81, 85], "t1", "vif-stcycl-imm"], [242, "a0", "vif-unpack-imm"] ], - "disasm-dma-list": [ [25, "v1", "dma-tag"], - [153, "v1", "dma-packet"], [189, "v1", "dma-packet"], [229, "v1", "dma-packet"], [258, "v1", "dma-packet"], [302, "v1", "dma-packet"], [308, "v1", "dma-packet"], - - //[133, "v1", "(pointer uint64)"], [152, "v1", "(pointer uint64)"], - [167, "v1", "(pointer uint64)"], [176, "v1", "(pointer uint64)"], [198, "v1", "(pointer uint64)"], @@ -205,7 +163,6 @@ [324, "v1", "(pointer uint64)"], [334, "v1", "(pointer uint64)"] ], - "default-buffer-init": [ [[8, 15], "a1", "dma-gif-packet"], [[18, 24], "a1", "gs-gif-tag"], @@ -229,16 +186,11 @@ [63, "a1", "(pointer gs-reg64)"], [[69, 72], "a0", "dma-packet"] ], - - // LEVEL "lookup-level-info": [ [3, "a1", "symbol"], [[4, 16], "a1", "level-load-info"] ], - - // DISPLAY "put-display-alpha-env": [[[0, 5], "v1", "gs-bank"]], - "(method 13 profile-bar)": [ [[27, 43], "t2", "dma-packet"], [[46, 56], "t2", "gs-gif-tag"], @@ -247,7 +199,6 @@ [79, "t3", "(pointer gs-xyzf)"], [110, "t2", "(pointer gs-xyzf)"] ], - "draw-sprite2d-xy": [ [[41, 45], "a3", "dma-packet"], [[51, 54], "a3", "gs-gif-tag"], @@ -258,7 +209,6 @@ [[106, 117], "v1", "(pointer dma-tag)"], [109, "a2", "dma-tag"] ], - "draw-quad2d": [ [[22, 28], "t1", "dma-packet"], [[31, 37], "t1", "gs-gif-tag"], @@ -275,7 +225,6 @@ [[120, 131], "v1", "(pointer dma-tag)"], [123, "a2", "dma-tag"] ], - "set-display-gs-state": [ [[3, 10], "t3", "dma-packet"], [[13, 19], "t3", "gs-gif-tag"], @@ -294,7 +243,6 @@ [61, "t3", "(pointer uint64)"], [63, "t3", "(pointer gs-reg64)"] ], - "set-display-gs-state-offset": [ [[3, 10], "t5", "dma-packet"], [[13, 19], "t5", "gs-gif-tag"], @@ -313,7 +261,6 @@ [68, "t5", "(pointer uint64)"], [70, "t5", "(pointer gs-reg64)"] ], - "reset-display-gs-state": [ [[9, 16], "t0", "dma-packet"], [[19, 25], "t0", "gs-gif-tag"], @@ -323,7 +270,6 @@ [46, "a3", "(pointer gs-reg64)"], [51, "a3", "(pointer gs-frame)"], [53, "a3", "(pointer gs-reg64)"], - [55, "a3", "(pointer gs-test)"], [57, "a3", "(pointer gs-reg64)"], [60, "a3", "(pointer gs-texa)"], @@ -333,11 +279,8 @@ [67, "a3", "(pointer uint64)"], [69, "a3", "(pointer gs-reg64)"] ], - "(method 9 connection)": [[8, "a0", "pointer"]], - "(method 10 connection)": [[8, "a0", "pointer"]], - "(method 0 engine)": [[39, "v0", "pointer"]], "(method 12 engine)": [ @@ -351,56 +294,35 @@ ], "(method 15 engine)": [[[0, 36], "v1", "connection"]], - "(method 19 engine)": [[8, "a0", "connection"]], - "(method 20 engine)": [[8, "a0", "connection"]], - "gs-set-default-store-image": [ [9, "t4", "gif-tag64"], [9, "v1", "gif-tag-regs"] ], - "dma-buffer-add-ref-texture": [ [[25, 29], "a3", "dma-packet"], [[32, 44], "a3", "gs-gif-tag"], [[47, 62], "a2", "dma-packet"] ], - "(method 11 level)": [ [[13, 18], "a1", "dma-packet"], - //[19, "a0", "(pointer uint32)"], [[20, 26], "a0", "dma-packet"], - [[50, 55], "a1", "dma-packet"], - // [56, "a0", "(pointer uint32)"], [[60, 63], "a0", "dma-packet"], - [[87, 92], "a1", "dma-packet"], - // [93, "a0", "(pointer uint32)"], [[97, 100], "a0", "dma-packet"], - [[124, 129], "a1", "dma-packet"], - // [130, "a0", "(pointer uint32)"], [[134, 137], "a0", "dma-packet"], - [[162, 167], "a1", "dma-packet"], - // [168, "a0", "(pointer uint32)"], [[172, 175], "a0", "dma-packet"], - [[199, 204], "a1", "dma-packet"], - // [205, "a0", "(pointer uint32)"], [[209, 212], "a0", "dma-packet"], - [[236, 241], "a1", "dma-packet"], - // [242, "a0", "(pointer uint32)"], [[246, 249], "a0", "dma-packet"], - [[273, 278], "a1", "dma-packet"], - // [279, "a0", "(pointer uint32)"], [[283, 286], "a0", "dma-packet"] ], - "(method 14 texture-page)": [ [[18, 22], "a0", "dma-packet"], [[28, 31], "a0", "gs-gif-tag"], @@ -409,7 +331,6 @@ [[44, 45], "a0", "dma-packet"], [45, "a0", "(pointer uint64)"] ], - "(method 13 texture-page)": [ [[45, 49], "a0", "dma-packet"], [[55, 58], "a0", "gs-gif-tag"], @@ -473,11 +394,9 @@ [527, "a0", "(pointer gs-fogcol)"], [[588, 591], "v1", "dma-packet"], - [[678, 681], "v1", "dma-packet"] + [[672, 675], "v1", "dma-packet"] ], - "load-game-text-info": [[4, "v1", "game-text-info"]], - "texture-relocate": [ [[17, 21], "t4", "dma-packet"], [[27, 30], "t4", "gs-gif-tag"], @@ -491,7 +410,6 @@ [77, "t4", "(pointer gs-reg64)"], [[98, 102], "a2", "dma-packet"], [[108, 111], "a2", "gs-gif-tag"], - [132, "a2", "(pointer gs-bitbltbuf)"], [134, "a2", "(pointer gs-reg64)"], [135, "a2", "(pointer gs-trxpos)"], @@ -500,7 +418,6 @@ [141, "a2", "(pointer gs-reg64)"], [143, "a2", "(pointer gs-trxdir)"], [145, "a2", "(pointer gs-reg64)"], - [[157, 161], "a2", "dma-packet"], [[167, 170], "a2", "gs-gif-tag"], [191, "a2", "(pointer gs-bitbltbuf)"], @@ -512,7 +429,6 @@ [202, "a2", "(pointer gs-trxdir)"], [204, "a2", "(pointer gs-reg64)"] ], - "(method 11 texture-pool)": [ [[119, 123], "a0", "dma-packet"], [[129, 132], "a0", "gs-gif-tag"], @@ -521,9 +437,7 @@ [145, "a0", "dma-packet"], [146, "a0", "(pointer uint64)"] ], - "texture-page-login": [[[34, 45], "s2", "texture-page"]], - "upload-vram-data": [ [[9, 15], "a0", "dma-packet"], [[18, 24], "a0", "gs-gif-tag"], @@ -536,9 +450,7 @@ [45, "a0", "(pointer gs-trxdir)"], [47, "a0", "(pointer gs-reg64)"] ], - "texture-page-dir-inspect": [[[133, 136], "v1", "adgif-shader"]], - "upload-vram-pages": [ [[135, 140], "a0", "dma-packet"], [[144, 149], "a0", "gs-gif-tag"], @@ -546,7 +458,6 @@ [154, "a0", "(pointer uint64)"], [[162, 165], "v1", "dma-packet"] ], - "upload-vram-pages-pris": [ [[128, 134], "a0", "dma-packet"], [[137, 143], "a0", "gs-gif-tag"], @@ -554,8 +465,6 @@ [150, "a0", "(pointer gs-reg64)"], [[154, 159], "v1", "dma-packet"] ], - - // RES "(method 19 res-lump)": [ [46, "t2", "(pointer uint64)"], [100, "t3", "(pointer uint64)"], @@ -601,61 +510,35 @@ [[102, 120], "s0", "basic"], [[147, 150], "s0", "collide-mesh"], [[157, 200], "s0", "(array object)"], - //[[197, 199], "s0", "(array basic)"], - //[[236, 240], "a0", "basic"] [235, "s0", "basic"] ], - - // SHADOW-CPU-H "(method 10 shadow-control)": [[1, "v1", "int"]], - - // FACT-H - "(method 0 fact-info-enemy)": [ - [[3, 92], "gp", "fact-info-enemy"] - ], - + "(method 0 fact-info-enemy)": [[[3, 92], "gp", "fact-info-enemy"]], "(method 0 fact-info)": [ //[16, "t9", "(function string none)"], ["_stack_", 16, "res-tag"], [[32, 43], "v1", "(pointer int32)"], [86, "gp", "fact-info"] ], - "(method 0 fact-info-target)": [[[3, 20], "gp", "fact-info-target"]], - "(method 0 align-control)": [[[14, 18], "v0", "align-control"]], - "str-load": [[[20, 36], "s2", "load-chunk-msg"]], - "str-load-status": [ [[18, 22], "v1", "load-chunk-msg"], [26, "v1", "load-chunk-msg"] ], - "str-play-async": [[[8, 16], "s4", "load-chunk-msg"]], - "str-play-stop": [[[7, 14], "s5", "load-chunk-msg"]], - "str-play-queue": [[[19, 27], "s5", "load-chunk-msg"]], - "str-ambient-play": [[[7, 15], "s5", "load-chunk-msg"]], - "str-ambient-stop": [[[7, 16], "s5", "load-chunk-msg"]], - "dgo-load-begin": [[[21, 40], "s2", "load-dgo-msg"]], - "dgo-load-get-next": [[[14, 31], "v1", "load-dgo-msg"]], - "dgo-load-continue": [[[5, 21], "gp", "load-dgo-msg"]], - "string->sound-name": [[[2, 18], "a1", "(pointer uint8)"]], - "ramdisk-load": [[[8, 12], "v1", "ramdisk-rpc-load"]], - "(method 3 generic-tie-interp-point)": [[15, "gp", "(pointer uint128)"]], - "ripple-find-height": [[[22, 72], "s4", "mei-ripple"]], - "(method 0 collide-shape-prim-sphere)": [ [[4, 8], "v0", "collide-shape-prim-sphere"] ], @@ -665,48 +548,34 @@ "(method 0 collide-shape-prim-group)": [ [[11, 18], "v0", "collide-shape-prim-group"] ], - "entity-actor-count": [["_stack_", 16, "res-tag"]], - "entity-actor-lookup": [ ["_stack_", 16, "res-tag"], [[10, 33], "v1", "(pointer uint32)"] ], - "(method 11 joint-mod)": [ [15, "s3", "process-drawable"], [[26, 66], "s3", "fact-info-enemy"] ], - "joint-mod-look-at-handler": [[[2, 254], "gp", "joint-mod"]], - "joint-mod-world-look-at-handler": [[[0, 254], "gp", "joint-mod"]], - "joint-mod-rotate-handler": [[[2, 77], "s4", "joint-mod"]], - "joint-mod-joint-set-handler": [[[2, 13], "s4", "joint-mod"]], - "joint-mod-joint-set*-handler": [[[2, 31], "s5", "joint-mod"]], "joint-mod-wheel-callback": [[[2, 63], "s4", "joint-mod-wheel"]], "joint-mod-set-local-callback": [[[0, 23], "v1", "joint-mod-set-local"]], "joint-mod-set-world-callback": [[[0, 23], "v1", "joint-mod-set-world"]], "joint-mod-blend-local-callback": [[[2, 63], "gp", "joint-mod-blend-local"]], "joint-mod-spinner-callback": [[[2, 63], "gp", "joint-mod-spinner"]], - "(method 11 touching-prims-entry-pool)": [ [[0, 8], "v1", "touching-prims-entry"], [8, "v1", "pointer"], [[9, 11], "v1", "touching-prims-entry"], [[1, 20], "a1", "touching-prims-entry"] ], - "(method 0 touching-list)": [[[6, 9], "v0", "touching-list"]], - "num-func-chan": [[8, "v1", "joint-control-channel"]], - "shrubbery-login-post-texture": [ - //[[13, 41], "a3", "qword"], - // [[13, 41], "a2", "qword"] [[13, 15], "a3", "qword"], [16, "a3", "pointer"], [24, "a3", "pointer"], @@ -718,22 +587,16 @@ [[35, 37], "a3", "qword"], [[35, 37], "a2", "qword"] ], - "(method 3 sparticle-cpuinfo)": [[106, "f0", "float"]], - "camera-teleport-to-entity": [[9, "a0", "transform"]], - "add-debug-sphere-from-table": [[[9, 18], "s1", "(inline-array vector)"]], - "(method 14 actor-link-info)": [[5, "v1", "entity-links"]], "(method 15 actor-link-info)": [[5, "v1", "entity-links"]], - "(method 23 actor-link-info)": [[4, "v1", "entity-links"]], "(method 24 actor-link-info)": [[4, "v1", "entity-links"]], "(method 9 actor-link-info)": [[[0, 36], "s3", "entity-actor"]], "alt-actor-list-subtask-incomplete-count": [[19, "a0", "entity-links"]], "actor-link-dead-hook": [[1, "v1", "entity-links"]], - "check-irx-version": [[[6, 37], "gp", "sound-rpc-get-irx-version"]], "sound-bank-load": [[[9, 11], "v1", "sound-rpc-load-bank"]], "sound-bank-unload": [[[7, 9], "v1", "sound-rpc-unload-bank"]], @@ -762,7 +625,6 @@ "sound-set-falloff-curve": [[[7, 19], "v1", "sound-rpc-set-falloff-curve"]], "sound-set-sound-falloff": [[[8, 13], "v1", "sound-rpc-set-sound-falloff"]], "sound-set-flava": [[[5, 7], "v1", "sound-rpc-set-flava"]], - "sound-set-fps": [[[5, 7], "v1", "sound-rpc-set-fps"]], "(method 0 ambient-sound)": [ [136, "v1", "sound-spec"], [143, "v1", "sound-spec"], @@ -781,7 +643,6 @@ "(method 12 ambient-sound)": [[[8, 20], "v1", "sound-rpc-set-param"]], "sound-buffer-dump": [[[14, 25], "s3", "sound-rpc-play"]], "actor-link-subtask-complete-hook": [[1, "v1", "entity-links"]], - "(method 0 vol-control)": [ [30, "s5", "res-lump"], [36, "s5", "res-lump"], @@ -792,35 +653,18 @@ [113, "s5", "res-lump"], [117, "s5", "res-lump"] ], - "point-in-air-box?": [[5, "f1", "float"]], - "(method 3 air-box)": [ [16, "f0", "float"], [22, "f0", "float"], [28, "f0", "float"] ], - "joint-anim-inspect-elt": [ [9, "gp", "joint-anim-matrix"], [26, "gp", "joint-anim-transformq"] ], "(method 12 art-group)": [[13, "a0", "art-joint-anim"]], - "(method 0 path-control)": [["_stack_", 16, "res-tag"]], - - "(method 0 curve-control)": [[[13, 55], "s3", "entity"]], - - "nav-mesh-connect": [ - [[4, 15], "s2", "entity-actor"], - [19, "v1", "entity"], - [20, "v1", "entity-links"], - [72, "v1", "entity"], - [73, "v1", "entity-links"], - [76, "a0", "entity"], - [77, "a0", "entity-links"] - ], - "add-debug-point": [ [125, "a3", "pointer"], [[27, 144], "a0", "(pointer uint64)"], @@ -873,18 +717,13 @@ "(method 13 drawable-inline-array-collide-fragment)": [ [[1, 5], "v1", "collide-fragment"] ], - "(method 12 drawable-inline-array-collide-fragment)": [ [[1, 5], "v1", "collide-fragment"] ], - "(method 11 drawable-inline-array-collide-fragment)": [ [[1, 5], "v1", "collide-fragment"] ], - - "main-cheats": [ - [[1327, 1330], "v1", "dma-packet"] - ], + "main-cheats": [[[1123, 1126], "v1", "dma-packet"]], "on": [[33, "t9", "(function cpu-thread function none)"]], "bg": [[37, "a0", "symbol"]], @@ -894,9 +733,7 @@ [[121, 146], "s1", "drawable-inline-array-tfrag"], [[150, 151], "s1", "drawable-tree-instance-tie"] ], - "(method 11 setting-control)": [[[3, 25], "s4", "connection"]], - "(method 9 setting-data)": [ [[4, 345], "s3", "connection"], [[9, 12], "v1", "symbol"], @@ -954,42 +791,17 @@ [[334, 337], "a0", "int"], [[341, 344], "a0", "uint"] ], - "(method 12 level)": [[151, "a0", "symbol"]], "(method 26 level-group)": [[[65, 96], "v0", "level"]], "update-sound-banks": [[[21, 52], "t0", "symbol"]], "(method 16 level-group)": [ [[122, 146], "s1", "continue-point"], - [[115, 154], "s3", "continue-point"] + [[115, 154], "s3", "continue-point"], + [444, "v1", "symbol"] ], "(method 20 level)": [[[43, 45], "s3", "ramdisk-rpc-fill"]], - "(anon-function 29 process-drawable)": [ - [[0, 99999], "s6", "process-drawable"] - ], - - "ja-done?": [[[0, 999], "s6", "process-drawable"]], - "ja-min?": [[[0, 999], "s6", "process-drawable"]], - "ja-max?": [[[0, 999], "s6", "process-drawable"]], - "ja-num-frames": [[[0, 999], "s6", "process-drawable"]], - "ja-frame-num": [[[0, 999], "s6", "process-drawable"]], - "ja-aframe-num": [[[0, 999], "s6", "process-drawable"]], - "ja-aframe": [[[0, 999], "s6", "process-drawable"]], - "ja-step": [[[0, 999], "s6", "process-drawable"]], - "ja-channel-set!": [[[0, 999], "s6", "process-drawable"]], - "ja-channel-push!": [[[0, 999], "s6", "process-drawable"]], - "ja-group-size": [[[0, 999], "s6", "process-drawable"]], - "ja-eval": [[[0, 999], "s6", "process-drawable"]], - "ja-blend-eval": [[[0, 999], "s6", "process-drawable"]], - "ja-post": [ - [[0, 999], "s6", "process-drawable"], - [54, "a1", "process"] - ], - "transform-post": [[[0, 999], "s6", "process-drawable"]], - "rider-trans": [[[0, 999], "s6", "process-drawable"]], - "rider-post": [[[0, 999], "s6", "process-drawable"]], - "pusher-post": [[[0, 999], "s6", "process-drawable"]], - "process-drawable-delay-player": [[[0, 999], "s6", "process-drawable"]], + "ja-post": [[54, "a1", "process"]], "upload-generic-shrub": [ [[3, 13], "t0", "dma-packet"], @@ -1001,91 +813,27 @@ [[128, 152], "a2", "dma-packet"], [[157, 162], "a1", "dma-packet"] ], - "(top-level-login task-control)": [[165, "v1", "symbol"]], - - "task-control-reset": [ - [[7, 13], "a0", "task-control"], - [[17, 21], "a0", "task-control"] - ], - - "(anon-function 494 task-control)": [[32, "v0", "float"]], - "(anon-function 493 task-control)": [[32, "v0", "float"]], - "(anon-function 480 task-control)": [[13, "v0", "float"]], - "(anon-function 477 task-control)": [[38, "v0", "float"]], - "(anon-function 476 task-control)": [[38, "v0", "float"]], - "(anon-function 475 task-control)": [ - [37, "v0", "float"], - [81, "v0", "float"] - ], - "(anon-function 474 task-control)": [ - [37, "v0", "float"], - [81, "v0", "float"] - ], - "(anon-function 426 task-control)": [[32, "v0", "float"]], - "(anon-function 425 task-control)": [[32, "v0", "float"]], - "(anon-function 415 task-control)": [[32, "v0", "float"]], - "(anon-function 414 task-control)": [[32, "v0", "float"]], - "(anon-function 365 task-control)": [[32, "v0", "float"]], - "(anon-function 364 task-control)": [[32, "v0", "float"]], - "(anon-function 363 task-control)": [[32, "v0", "float"]], - "(anon-function 362 task-control)": [[32, "v0", "float"]], - "(anon-function 337 task-control)": [[32, "v0", "float"]], - "(anon-function 336 task-control)": [[32, "v0", "float"]], - "(anon-function 227 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 286 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 366 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 367 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 368 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 369 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 380 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 383 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 390 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 393 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 400 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 403 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 435 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 445 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 455 task-control)": [ - [[14, 16], "t9", "(function process event-message-block float)"] - ], - "(anon-function 38 task-control)": [[13, "v0", "float"]], - "(anon-function 28 task-control)": [[13, "v0", "float"]], - + "(anon-function 227 task-control)": [[17, "v1", "float"]], + "(anon-function 286 task-control)": [[17, "v1", "float"]], + "(anon-function 366 task-control)": [[17, "v1", "float"]], + "(anon-function 367 task-control)": [[17, "v1", "float"]], + "(anon-function 368 task-control)": [[17, "v1", "float"]], + "(anon-function 369 task-control)": [[17, "v1", "float"]], + "(anon-function 380 task-control)": [[17, "v1", "float"]], + "(anon-function 383 task-control)": [[17, "v1", "float"]], + "(anon-function 390 task-control)": [[17, "v1", "float"]], + "(anon-function 393 task-control)": [[17, "v1", "float"]], + "(anon-function 400 task-control)": [[17, "v1", "float"]], + "(anon-function 403 task-control)": [[17, "v1", "float"]], + "(anon-function 435 task-control)": [[17, "v1", "float"]], + "(anon-function 445 task-control)": [[17, "v1", "float"]], + "(anon-function 455 task-control)": [[17, "v1", "float"]], "(method 18 game-info)": [ [4, "v1", "symbol"], [5, "v1", "level-load-info"], [10, "s3", "continue-point"] ], - "(method 9 game-info)": [ [ [270, 286], @@ -1093,43 +841,41 @@ "(function cpu-thread function object object object object pointer)" ] ], - "(method 25 game-info)": [ [4, "v1", "game-save-tag"], - [69, "v1", "pointer"], - [[7, 69], "v1", "game-save-tag"], - [[88, 154], "s4", "game-save-tag"], - [170, "s4", "pointer"], - [[182, 221], "s4", "game-save-tag"], - [222, "s4", "pointer"], - [514, "s4", "pointer"], - [223, "a1", "(pointer uint8)"], + [53, "v1", "pointer"], + [[7, 53], "v1", "game-save-tag"], + [[72, 138], "s4", "game-save-tag"], + [154, "s4", "pointer"], + [[166, 205], "s4", "game-save-tag"], + [206, "s4", "pointer"], + [498, "s4", "pointer"], + [207, "a1", "(pointer uint8)"], + [[219, 220], "s4", "game-save-tag"], + [223, "s4", "pointer"], + [224, "a1", "(pointer uint8)"], [[235, 236], "s4", "game-save-tag"], - [239, "s4", "pointer"], - [240, "a1", "(pointer uint8)"], - [[251, 252], "s4", "game-save-tag"], - [265, "s4", "pointer"], - [[277, 278], "s4", "game-save-tag"], - [291, "s4", "pointer"], - [309, "s4", "game-save-tag"], - [318, "s4", "pointer"], - [319, "a2", "(pointer uint8)"], - [331, "s4", "game-save-tag"], - [335, "s4", "pointer"], - [359, "v1", "(pointer uint8)"], - [368, "v1", "(pointer uint8)"], - [[376, 436], "s4", "game-save-tag"], - [439, "s4", "pointer"], - [440, "a1", "(pointer uint8)"], - [452, "s4", "game-save-tag"], - [456, "s4", "pointer"], - [472, "s4", "game-save-tag"], - [476, "s4", "pointer"], - [492, "s4", "game-save-tag"], - [496, "s4", "pointer"], - [[509, 511], "s4", "game-save-tag"] + [249, "s4", "pointer"], + [[261, 262], "s4", "game-save-tag"], + [275, "s4", "pointer"], + [293, "s4", "game-save-tag"], + [302, "s4", "pointer"], + [303, "a2", "(pointer uint8)"], + [315, "s4", "game-save-tag"], + [319, "s4", "pointer"], + [343, "v1", "(pointer uint8)"], + [352, "v1", "(pointer uint8)"], + [[360, 420], "s4", "game-save-tag"], + [423, "s4", "pointer"], + [424, "a1", "(pointer uint8)"], + [436, "s4", "game-save-tag"], + [440, "s4", "pointer"], + [456, "s4", "game-save-tag"], + [460, "s4", "pointer"], + [476, "s4", "game-save-tag"], + [480, "s4", "pointer"], + [[493, 495], "s4", "game-save-tag"] ], - "(method 11 game-save)": [ [126, "v1", "pointer"], [213, "s4", "pointer"], @@ -1145,7 +891,6 @@ [196, "s4", "pointer"], [[203, 210], "s4", "game-save-tag"] ], - "drawable-load": [ [17, "s5", "drawable"], [18, "s5", "drawable"], @@ -1174,7 +919,6 @@ [177, "s4", "external-art-buffer"], [183, "s4", "external-art-buffer"], [190, "s4", "external-art-buffer"], - [233, "s4", "spool-anim"], [240, "s4", "spool-anim"], [243, "s4", "spool-anim"], @@ -1183,14 +927,11 @@ [253, "s4", "spool-anim"], [257, "s4", "spool-anim"] ], - - "(method 10 external-art-control)": [[18, "v1", "spool-anim"]], - + "(method 10 external-art-control)": [[18, "v1", "pointer"]], "(method 16 external-art-control)": [ [37, "a0", "process"], [17, "s5", "process-drawable"] ], - "ja-play-spooled-anim": [ [154, "a0", "process"], [286, "s2", "art-joint-anim"], @@ -1200,26 +941,21 @@ [320, "s2", "art-joint-anim"], [324, "s2", "art-joint-anim"] ], - "(method 11 external-art-control)": [ [127, "a0", "process"], [151, "a0", "process"], [168, "a0", "process"], [18, "s5", "process-drawable"] ], - "debug-menu-item-var-update-display-str": [ [[44, 49], "v1", "int"], [[61, 69], "v1", "int"] ], - "debug-menu-item-get-max-width": [[[18, 27], "a0", "debug-menu-item-var"]], - "debug-menu-send-msg": [ [[3, 14], "s2", "debug-menu-item"], [[14, 21], "s2", "debug-menu-item-submenu"] ], - "debug-menu-item-var-joypad-handler": [ [[39, 42], "a2", "int"], [[40, 42], "a3", "int"], @@ -1232,7 +968,6 @@ [[190, 194], "a0", "int"], [[193, 195], "v1", "int"] ], - "debug-menu-find-from-template": [ [3, "s4", "debug-menu"], [[4, 8], "s4", "debug-menu-item"], @@ -1243,20 +978,13 @@ "debug-menu-func-decode": [[[12, 14], "a0", "symbol"]], - "dm-cam-render-float": [[[71, 72], "v0", "float"]], - - "can-hint-be-played?": [ - [[25, 28], "a0", "level-hint"] // kinda a guess, but its the only process that makes sense - ], + "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"]], - "debug-menu-item-submenu-render": [[[39, 44], "v1", "dma-packet"]], - "debug-menu-item-function-render": [[[46, 51], "v1", "dma-packet"]], - "debug-menu-item-flag-render": [[[44, 49], "v1", "dma-packet"]], - "debug-menu-render": [ [[45, 48], "v1", "dma-packet"], [[106, 110], "v1", "dma-packet"] @@ -1268,72 +996,58 @@ [[8, 20], "v1", "(pointer float)"], [[0, 60], "f1", "float"] ], - "(anon-function 2 memory-usage)": [ [[171, 415], "s5", "process-drawable"], [[212, 213], "v1", "collide-shape"] ], - "(method 8 process-tree)": [ [31, "v1", "symbol"], [6, "a3", "symbol"] ], - "(method 9 align-control)": [ [[27, 31], "t9", "(function object object object object)"] ], - "(method 8 tie-fragment)": [ [150, "a0", "(pointer int32)"], [[157, 160], "a0", "basic"] ], - "letterbox": [[[29, 33], "v1", "dma-packet"]], - "blackout": [[[20, 24], "v1", "dma-packet"]], - - "(method 10 external-art-control)": [[18, "v1", "pointer"]], - "(method 15 load-state)": [ [31, "t9", "(function int)"], - [291, "s5", "entity-actor"], - [370, "s3", "process-drawable"] + [[291, 303], "s5", "entity-actor"], + [370, "s3", "process-drawable"], + [343, "s5", "symbol"], + [21, "s5", "symbol"] ], - "yakow-default-event-handler": [ [27, "a0", "collide-shape"], [32, "a0", "collide-shape"] ], - "(method 11 yakow)": [ [184, "v1", "vector"], [186, "v1", "vector"], [189, "v1", "vector"] ], - "yakow-post": [ [114, "a0", "collide-shape-moving"], [130, "a0", "collide-shape-moving"] ], - "raw-ray-sphere-intersect": [ [23, "v1", "float"], [36, "v1", "uint"] ], - "(method 0 anim-test-obj)": [ [9, "s4", "anim-test-obj"], [10, "s4", "anim-test-obj"], [13, "s4", "anim-test-obj"], [15, "s4", "anim-test-obj"] ], - "(method 0 anim-test-sequence)": [ [8, "s5", "anim-test-sequence"], [11, "s5", "anim-test-sequence"], [13, "s5", "anim-test-sequence"] ], - "(method 0 anim-test-seq-item)": [ [7, "v0", "anim-test-seq-item"], [8, "v1", "anim-test-seq-item"], @@ -1342,7 +1056,6 @@ [14, "v0", "anim-test-seq-item"], [17, "v0", "anim-test-seq-item"] ], - "(method 3 anim-tester)": [ [12, "s5", "anim-test-obj"], [15, "s5", "anim-test-obj"], @@ -1366,7 +1079,6 @@ [126, "s3", "anim-test-seq-item"], [128, "s3", "anim-test-seq-item"] ], - "anim-test-obj-item-valid?": [ [5, "s5", "anim-test-sequence"], [12, "s5", "anim-test-sequence"], @@ -1377,7 +1089,6 @@ [26, "v1", "anim-test-seq-item"], [28, "v1", "anim-test-seq-item"] ], - "anim-test-obj-remove-invalid": [ [84, "v1", "anim-test-sequence"], [88, "v1", "anim-test-sequence"], @@ -1405,7 +1116,6 @@ [36, "s3", "anim-test-seq-item"], [61, "a0", "anim-test-seq-item"] ], - "anim-tester-reset": [ [14, "v1", "anim-test-obj"], [30, "v1", "anim-test-obj"], @@ -1414,12 +1124,10 @@ [43, "v1", "anim-test-obj"], [[50, 53], "v1", "anim-test-obj"] ], - "anim-tester-save-all-objects": [ [[4, 19], "gp", "anim-test-obj"], [17, "v1", "anim-test-obj"] ], - "anim-tester-save-object-seqs": [ [63, "s5", "anim-test-sequence"], [69, "s5", "anim-test-sequence"], @@ -1441,7 +1149,6 @@ [121, "v1", "anim-test-seq-item"], [122, "s4", "anim-test-seq-item"] ], - "anim-test-obj-list-handler": [ [25, "s5", "anim-test-obj"], [31, "s5", "anim-test-obj"], @@ -1451,7 +1158,6 @@ [112, "v1", "anim-tester"], [[202, 205], "v1", "dma-packet"] ], - "anim-test-anim-list-handler": [ [2, "s5", "anim-test-obj"], [25, "s5", "anim-test-obj"], @@ -1472,7 +1178,6 @@ [173, "v1", "anim-test-obj"], [[263, 266], "v1", "dma-packet"] ], - "anim-test-sequence-list-handler": [ [2, "s5", "anim-test-sequence"], [25, "s5", "anim-test-sequence"], @@ -1490,7 +1195,6 @@ [151, "v1", "anim-test-sequence"], [[267, 270], "v1", "dma-packet"] ], - "anim-test-edit-sequence-list-handler": [ [[82, 85], "v1", "dma-packet"], [[148, 151], "v1", "dma-packet"], @@ -1508,7 +1212,6 @@ [491, "s3", "anim-test-seq-item"], [502, "s3", "anim-test-seq-item"] ], - "anim-tester-interface": [ [[34, 48], "gp", "anim-test-obj"], [[70, 73], "v1", "dma-packet"], @@ -1519,7 +1222,6 @@ [[156, 160], "v1", "anim-test-obj"], [[162, 165], "v1", "anim-test-sequence"] ], - "anim-tester-get-playing-item": [ [4, "t9", "(function glst-list int anim-test-seq-item)"], [20, "t9", "(function glst-list int anim-test-seq-item)"], @@ -1528,7 +1230,6 @@ [25, "v0", "anim-test-seq-item"], [5, "v0", "anim-test-seq-item"] ], - "anim-tester-add-newobj": [ ["_stack_", 128, "anim-test-obj"], [[2, 185], "s2", "anim-test-obj"], @@ -1543,22 +1244,16 @@ [171, "v1", "anim-test-seq-item"], [173, "v1", "anim-test-seq-item"] ], - - "anim-tester-start": [[20, "t9", "(function process function none)"]], - "anim-tester-set-name": [ [[34, 51], "s3", "anim-test-obj"], [[40, 63], "s5", "anim-test-sequence"] ], - "anim-tester-add-sequence": [[[33, 102], "s5", "anim-test-obj"]], - "(anon-function 11 anim-tester)": [ [[23, 113], "s4", "anim-test-obj"], [[83, 338], "gp", "anim-test-sequence"], [[123, 187], "s4", "art-joint-anim"] ], - "(method 10 bsp-header)": [ [[51, 61], "a0", "(pointer uint128)"], [[51, 61], "a1", "(pointer uint128)"], @@ -1568,34 +1263,30 @@ [5, "a0", "terrain-bsp"], [8, "a0", "terrain-bsp"] ], - "(method 15 bsp-header)": [ [5, "a0", "terrain-bsp"], [8, "a0", "terrain-bsp"] ], "upload-vis-bits": [ - [[4,16], "a1", "(pointer uint128)"], + [[4, 16], "a1", "(pointer uint128)"], [[12, 14], "a0", "(pointer uint128)"], - [[20,22], "a2", "(pointer uint128)"], + [[20, 22], "a2", "(pointer uint128)"], [[28, 30], "a0", "(pointer uint128)"], [[32, 34], "a2", "(pointer uint128)"] ], - "bsp-camera-asm": [ [[4, 14], "a1", "bsp-node"], [[0, 9], "v1", "bsp-node"], [[12, 16], "v1", "bsp-node"] ], - "level-remap-texture": [ [15, "t0", "(pointer int32)"], [21, "t0", "(pointer int32)"], [19, "t0", "(pointer uint64)"], [12, "v1", "int"] ], - "sprite-add-matrix-data": [ [[5, 15], "a2", "dma-packet"], [[24, 29], "a1", "matrix"], @@ -1603,9 +1294,7 @@ [[60, 97], "a1", "matrix"], [[116, 129], "a1", "vector"] ], - "sprite-add-frame-data": [[[8, 16], "a0", "dma-packet"]], - "sprite-add-2d-chunk": [ [[12, 20], "a0", "dma-packet"], [[45, 52], "a0", "dma-packet"], @@ -1613,7 +1302,6 @@ [[80, 87], "v1", "dma-packet"], [65, "a3", "int"] ], - "sprite-add-3d-chunk": [ [[11, 19], "a0", "dma-packet"], [[44, 51], "a0", "dma-packet"], @@ -1621,7 +1309,6 @@ [[79, 87], "v1", "dma-packet"], [65, "a3", "int"] ], - "sprite-add-shadow-chunk": [ [[11, 19], "a0", "dma-packet"], [[37, 44], "a0", "dma-packet"], @@ -1630,7 +1317,6 @@ [[105, 121], "s1", "adgif-shader"], [[130, 138], "v1", "dma-packet"] ], - "sprite-draw": [ [[33, 37], "a0", "dma-packet"], [[43, 46], "a0", "gs-gif-tag"], @@ -1643,7 +1329,6 @@ [[125, 129], "a0", "dma-packet"], [[143, 146], "v1", "dma-packet"] ], - "sprite-init-distorter": [ [59, "a3", "uint"], [[3, 7], "a2", "dma-packet"], @@ -1662,7 +1347,6 @@ [51, "a2", "(pointer gs-reg64)"], [[62, 67], "a1", "dma-packet"] ], - "sprite-draw-distorters": [ [[70, 90], "a0", "vector"], [72, "v1", "vector"], @@ -1715,7 +1399,6 @@ ], "cam-standard-event-handler": [ - [[0, 999], "s6", "camera-slave"], [[16, 30], "s5", "state"], [41, "a0", "vector"], [[5, 8], "t9", "(function object)"], @@ -1723,31 +1406,12 @@ [[30, 32], "t9", "(function object)"] ], - "cam-curve-pos": [[[0, 224], "s6", "camera-slave"]], - - "cam-combiner-init": [ - [[0, 999], "s6", "camera-combiner"] - ], - - "(code cam-combiner-active)": [[[0, 999], "s6", "camera-combiner"]], - "(event cam-combiner-active)": [ [10, "a0", "vector"], - [[0, 20], "s6", "camera-slave"], - [[20, 231], "s6", "camera-combiner"], [[99, 127], "gp", "camera-slave"], [[187, 231], "gp", "camera-slave"] ], - "cam-master-init": [ - [[0, 999], "s6", "camera-master"], - [[111, 115], "t9", "(function cpu-thread function)"], - [[139, 145], "t9", "(function cpu-thread function object object)"], - [[163, 167], "t9", "(function object)"] - ], - - "cam-curve-setup": [[[0, 82], "s6", "camera-slave"]], - "(method 15 tracking-spline)": [ [[57, 59], "a2", "vector"], [[57, 59], "a3", "vector"] @@ -1758,25 +1422,16 @@ [[40, 42], "a1", "vector"] ], - "cam-slave-init-vars": [[[0, 999], "s6", "camera-slave"]], - "cam-slave-get-vector-with-offset": [[[52, 65], "s3", "vector"]], "cam-slave-go": [[[3, 6], "t9", "(function object)"]], "cam-slave-init": [ - [[0, 999], "s6", "camera-slave"], [[47, 50], "t9", "(function object object)"], [[54, 58], "t9", "(function object object)"] ], - "update-mood-village3": [ - [[236, 245], "s0", "(array float)"], - [245, "s0", "(array int8)"], - [[246, 297], "s0", "(array float)"], - [[297, 309], "s0", "(array uint8)"], - [[309, 314], "s0", "matrix"] // TODO - there is no way this is correct lol - ], + "update-mood-village3": [[[245, 311], "s0", "village3-states"]], "update-mood-citadel": [ [291, "s5", "(pointer float)"], @@ -1808,10 +1463,11 @@ [144, "s4", "(pointer float)"] ], - "update-mood-snow": [ - [93, "s5", "vector"], - [110, "s5", "vector"] - ], + "update-mood-snow": [[[30, 111], "s5", "snow-states"]], + + "update-mood-ogre": [[[53, 145], "s4", "ogre-states"]], + + "update-mood-finalboss": [[[40, 348], "s4", "finalboss-states"]], "ocean-trans-add-upload-table": [ [44, "a0", "dma-packet"], @@ -1884,22 +1540,16 @@ [[78, 79], "a0", "dma-packet"], [79, "a0", "(pointer uint64)"] ], - "(event water-vol-idle water-anim)": [ - [6, "a0", "vector"] - ], + "(event water-vol-idle water-anim)": [[6, "a0", "vector"]], - "(method 22 water-anim)": [ - [25, "s3", "basic"] - ], + "(method 22 water-anim)": [[25, "s3", "basic"]], "(method 25 water-anim)": [ [25, "v0", "(pointer float)"], ["_stack_", 16, "res-tag"] ], - "(method 22 rigid-body-platform)": [ - [26, "f0", "float"] - ], + "(method 22 rigid-body-platform)": [[26, "f0", "float"]], "rigid-body-platform-event-handler": [ [28, "v1", "process-drawable"], @@ -1923,13 +1573,9 @@ [14, "t9", "(function process-drawable int process-drawable)"] ], - "(method 10 rigid-body)": [ - [50, "v1", "vector"] - ], + "(method 10 rigid-body)": [[50, "v1", "vector"]], - "(method 22 mud)": [ - [35, "v0", "(pointer float)"] - ], + "(method 22 mud)": [[35, "v0", "(pointer float)"]], "(method 11 twister)": [ [7, "s4", "twist-joint"], @@ -1944,21 +1590,11 @@ [82, "s4", "twist-joint"] ], - "(code teetertotter-launch)": [ - [11, "v1", "art-joint-anim"] - ], + "(code teetertotter-launch)": [[11, "v1", "art-joint-anim"]], - "(code teetertotter-bend)": [ - [10, "v1", "art-joint-anim"] - ], + "(code teetertotter-bend)": [[10, "v1", "art-joint-anim"]], - "misty-camera-view": [ - [25, "v1", "handle"] - ], - - "(method 11 silostep)": [ - [100, "v1", "art-joint-anim"] - ], + "(method 11 silostep)": [[100, "v1", "art-joint-anim"]], "(enter plat-button-pressed sunken-elevator)": [ [40, "v1", "village2cam"], @@ -1973,9 +1609,7 @@ [13, "v0", "(state sunken-elevator)"] ], - "(method 27 sunken-elevator)": [ - [37, "v1", "art-joint-anim"] - ], + "(method 27 sunken-elevator)": [[37, "v1", "art-joint-anim"]], "nav-enemy-set-base-collide-sphere-collide-with": [ [19, "v1", "collide-shape-prim-group"], @@ -1991,16 +1625,10 @@ [55, "s5", "collide-shape-prim"] ], - "nav-enemy-jump-land-anim": [ - [39, "v1", "art-joint-anim"] - ], + "nav-enemy-jump-land-anim": [[39, "v1", "art-joint-anim"]], - "(code nav-enemy-victory nav-enemy)": [ - [27, "v1", "art-joint-anim"] - ], - "(code nav-enemy-notice nav-enemy)": [ - [27, "v1", "art-joint-anim"] - ], + "(code nav-enemy-victory nav-enemy)": [[27, "v1", "art-joint-anim"]], + "(code nav-enemy-notice nav-enemy)": [[27, "v1", "art-joint-anim"]], "(code nav-enemy-patrol nav-enemy)": [ [23, "v1", "art-joint-anim"], [105, "v1", "art-joint-anim"], @@ -2013,12 +1641,8 @@ [91, "v1", "art-joint-anim"] ], - "nav-enemy-set-hit-from-direction": [ - [19, "v1", "process-drawable"] - ], - "(method 45 nav-enemy)": [ - [14, "v1", "process-mask"] - ], + "nav-enemy-set-hit-from-direction": [[19, "v1", "process-drawable"]], + "(method 45 nav-enemy)": [[14, "v1", "process-mask"]], "nav-enemy-default-event-handler": [ [62, "a0", "vector"], @@ -2031,13 +1655,9 @@ [19, "t9", "(function process-drawable int none)"] ], - "(enter nav-enemy-patrol nav-enemy)": [ - [8, "v1", "int"] - ], + "(enter nav-enemy-patrol nav-enemy)": [[8, "v1", "int"]], - "(code nav-enemy-fuel-cell nav-enemy)": [ - [31, "v1", "int"] - ], + "(code nav-enemy-fuel-cell nav-enemy)": [[31, "v1", "int"]], "(method 16 level)": [ [252, "v1", "(pointer uint128)"], @@ -2056,13 +1676,13 @@ [140, "s1", "(pointer uint128)"] ], - "unpack-comp-huf": [ - [[21, 23], "t3", "(pointer uint16)"] - ], + "(method 15 level)": [[[21, 60], "v1", "(inline-array box8s)"]], - "(method 9 merc-fragment)": [ - [[13,161], "s3", "adgif-shader"] - ], + "(method 27 level)": [[[23, 68], "s2", "(inline-array box8s)"]], + + "unpack-comp-huf": [[[21, 23], "t3", "(pointer uint16)"]], + + "(method 9 merc-fragment)": [[[13, 161], "s3", "adgif-shader"]], "(method 9 merc-effect)": [ [49, "s4", "pointer"], @@ -2077,7 +1697,7 @@ [[12, 18], "gp", "(pointer vif-tag)"] ], - "merc-vu1-init-buffer":[ + "merc-vu1-init-buffer": [ [[27, 31], "a0", "dma-packet"], [[37, 40], "a0", "gs-gif-tag"], [44, "a0", "(pointer gs-test)"], @@ -2092,41 +1712,23 @@ [103, "a1", "pointer"] ], - "merc-edge-stats": [ - [[33, 35], "v1", "merc-ctrl"] - ], + "merc-edge-stats": [[[33, 35], "v1", "merc-ctrl"]], - "(method 9 screen-filter)": [ - [[23, 26], "v1", "dma-packet"] - ], + "(method 9 screen-filter)": [[[23, 26], "v1", "dma-packet"]], - "(method 48 mayor)": [ - [32, "a0", "int"] - ], + "(method 48 mayor)": [[32, "a0", "int"]], - "(method 43 mayor)": [ - [19, "v1", "float"] - ], + "(method 43 mayor)": [[19, "v1", "float"]], - "(post idle mayor)": [ - [4, "t9", "(function none)"] - ], + "(post idle mayor)": [[4, "t9", "(function none)"]], - "(method 43 bird-lady)": [ - [19, "v1", "float"] - ], + "(method 43 bird-lady)": [[19, "v1", "float"]], - "muse-to-idle": [ - [57, "v1", "muse"] - ], + "muse-to-idle": [[57, "v1", "muse"]], - "(method 32 sculptor)": [ - [87, "v1", "muse"] - ], + "(method 32 sculptor)": [[87, "v1", "muse"]], - "(method 43 sculptor)": [ - [19, "v1", "float"] - ], + "(method 43 sculptor)": [[19, "v1", "float"]], "(code idle sculptor)": [ [71, "v1", "art-joint-anim"], @@ -2152,21 +1754,13 @@ [936, "v1", "art-joint-anim"] ], - "(method 43 geologist)": [ - [19, "v1", "float"] - ], + "(method 43 geologist)": [[19, "v1", "float"]], - "(anon-function 3 oracle)": [ - [11, "v1", "collide-shape"] - ], + "(anon-function 3 oracle)": [[11, "v1", "collide-shape"]], - "(method 43 farmer)": [ - [19, "v1", "float"] - ], + "(method 43 farmer)": [[19, "v1", "float"]], - "(method 43 explorer)": [ - [19, "v1", "float"] - ], + "(method 43 explorer)": [[19, "v1", "float"]], "(code idle explorer)": [ [36, "v1", "float"], @@ -2189,13 +1783,9 @@ [783, "v1", "art-joint-anim"] ], - "(method 32 assistant)": [ - [39, "v1", "float"] - ], + "(method 32 assistant)": [[39, "v1", "float"]], - "(method 43 assistant)": [ - [19, "v1", "float"] - ], + "(method 43 assistant)": [[19, "v1", "float"]], "(code idle assistant)": [ [35, "v1", "float"], @@ -2211,56 +1801,66 @@ [602, "v1", "art-joint-anim"] ], - "check-drop-level-assistant": [ - [17, "v1", "float"] - ], + "check-drop-level-assistant": [[17, "v1", "float"]], "(method 32 sage)": [ [76, "v1", "float"], [262, "v1", "assistant"] ], - "(method 43 sage)": [ - [19, "v1", "float"] - ], + "(method 43 sage)": [[19, "v1", "float"]], "(code idle sage)": [ [35, "v1", "float"], [155, "v1", "art-joint-anim"] ], - "(method 43 gambler)": [ - [19, "v1", "float"] - ], + "(method 43 gambler)": [[19, "v1", "float"]], - "(code idle gambler)": [ - [93, "v1", "float"] - ], + "(code idle gambler)": [[93, "v1", "float"]], - "(method 32 warrior)": [ - [76, "v1", "handle"] - ], + "(method 32 warrior)": [[76, "v1", "handle"]], - "(method 43 warrior)": [ - [19, "v1", "float"] - ], + "(method 43 warrior)": [[19, "v1", "float"]], "(method 32 minershort)": [ [44, "v1", "float"], [112, "v1", "float"] ], - "(method 43 minershort)": [ - [19, "v1", "float"] - ], + "(method 43 minershort)": [[19, "v1", "float"]], "(method 33 progress)": [ - [30, "t9", "(function process function object object object object object)"], - [159, "t9", "(function process function object object object object object)"], - [288, "t9", "(function process function object object object object object)"], - [417, "t9", "(function process function object object object object object)"], - [546, "t9", "(function process function object object object object object)"], - [675, "t9", "(function process function object object object object object)"], + [ + 30, + "t9", + "(function process function object object object object object)" + ], + [ + 159, + "t9", + "(function process function object object object object object)" + ], + [ + 288, + "t9", + "(function process function object object object object object)" + ], + [ + 417, + "t9", + "(function process function object object object object object)" + ], + [ + 546, + "t9", + "(function process function object object object object object)" + ], + [ + 675, + "t9", + "(function process function object object object object object)" + ], [35, "a0", "manipy"], [38, "v1", "manipy"], [50, "v1", "manipy"], @@ -2292,9 +1892,7 @@ [4, "f0", "float"] ], - "(method 7 progress)": [ - [16, "a2", "pointer"] - ], + "(method 7 progress)": [[16, "a2", "pointer"]], "(method 17 progress)": [ [[466, 471], "v1", "dma-packet"], @@ -2308,24 +1906,16 @@ [[198, 203], "v1", "dma-packet"] ], - "(method 23 progress)": [ - [103, "v1", "float"] - ], + "(method 23 progress)": [[103, "v1", "float"]], - "(post progress-normal)": [ - [416, "a0", "float"] - ], + "(post progress-normal)": [[416, "a0", "float"]], - "(method 53 progress)": [ - [[0, 999], "gp", "progress-screen"] - ], + "(method 53 progress)": [[[0, 999], "gp", "progress-screen"]], "(method 35 progress)": [[38, "s4", "game-text-id"]], "(method 43 progress)": [[45, "s4", "game-text-id"]], "(method 38 progress)": [[58, "a1", "game-text-id"]], - "draw-percent-bar": [ - [[33, 38], "v1", "dma-packet"] - ], + "draw-percent-bar": [[[33, 38], "v1", "dma-packet"]], "(method 11 fact-info-target)": [ [135, "v1", "target"], @@ -2344,20 +1934,18 @@ [[47, 88], "v1", "connection"] ], - "(anon-function 7 game-info)": [ - [2, "v1", "collide-shape"] - ], + "(anon-function 7 game-info)": [[2, "v1", "collide-shape"]], "(method 24 game-info)": [ [112, "s3", "pointer"], [[113, 165], "a0", "game-save-tag"], [[148, 166], "s2", "game-save-tag"], [[148, 168], "s4", "game-save-tag"], - [[171, 222], "a0", "game-save-tag"], - [[234, 241], "a0", "game-save-tag"], + [[171, 221], "a0", "game-save-tag"], + [[234, 240], "a0", "game-save-tag"], [[253, 276], "a0", "game-save-tag"], [[283, 302], "a0", "game-save-tag"], - [[319, 325], "a1", "game-save-tag"], + [[319, 324], "a1", "game-save-tag"], [[342, 348], "a1", "game-save-tag"], [[395, 468], "a0", "game-save-tag"], [[480, 488], "a0", "game-save-tag"], @@ -2367,13 +1955,11 @@ // [329, "a0", "pointer"], // [338, "a0", "pointer"], // [[173, 230], "a0", "game-save-tag"], - [252, "a0", "(pointer int32)"], + [252, "a0", "(pointer int32)"], [654, "a0", "pointer"] ], - "auto-save-post":[ - [138, "t9", "(function object string object none)"] - ], + "auto-save-post": [[138, "t9", "(function object string object none)"]], "target-compute-pole": [ [12, "s4", "swingpole"], @@ -2386,13 +1972,9 @@ [87, "s4", "swingpole"] ], - "(method 10 target)": [ - [[10, 13], "t9", "(function process-drawable none)"] - ], + "(method 10 target)": [[[10, 13], "t9", "(function process-drawable none)"]], - "draw-history": [ - [[99, 101], "v1", "int"] - ], + "draw-history": [[[99, 101], "v1", "int"]], "(method 9 attack-info)": [ [82, "v1", "process-drawable"], @@ -2401,6 +1983,8 @@ [118, "a0", "process-drawable"] ], + "dm-task-get-money": [[32, "v1", "float"]], + "ground-tween-update": [ [16, "f1", "float"], [20, "f2", "float"], @@ -2408,9 +1992,7 @@ [38, "f1", "float"] ], - "(method 32 evilbro)": [ - [20, "v1", "handle"] - ], + "(method 32 evilbro)": [[20, "v1", "handle"]], "(code idle evilbro)": [ [27, "v1", "art-joint-anim"], @@ -2419,7 +2001,8 @@ ], "all-texture-tweak-adjust": [ - [[35, 44], "s0", "adgif-shader"] + [38, "s0", "adgif-shader"], + [42, "s0", "adgif-shader"] ], "build-instance-list": [ @@ -2556,9 +2139,7 @@ [[5, 15], "v1", "level-load-info"] ], - "(method 26 basebutton)": [ - [31, "v1", "art-joint-anim"] - ], + "(method 26 basebutton)": [[31, "v1", "art-joint-anim"]], "debug-menu-item-var-make-float": [ [30, "t9", "(function int debug-menu-msg float float int)"] @@ -2569,17 +2150,11 @@ [39, "a2", "int"] ], - "process-status-bits": [ - [[15, 59], "s3", "process-drawable"] - ], + "process-status-bits": [[[15, 59], "s3", "process-drawable"]], - "(method 13 level-group)": [ - [[56, 61], "a0", "entity-actor"] - ], + "(method 13 level-group)": [[[56, 61], "a0", "entity-actor"]], - "(method 24 entity)": [ - [[39, 45], "a0", "entity-actor"] - ], + "(method 24 entity)": [[[39, 45], "a0", "entity-actor"]], "(method 23 level-group)": [ [53, "a0", "entity-actor"], @@ -2604,44 +2179,37 @@ [[123, 127], "a0", "process-drawable"] ], - "(method 3 entity)": [ - [7, "t9", "(function entity entity)"] - ], + "(method 3 entity)": [[7, "t9", "(function entity entity)"]], "(method 3 entity-actor)": [ [7, "t9", "(function entity-actor entity-actor)"] ], + "(method 10 drawable-group)": [[19, "s5", "drawable-group"]], + + "(method 15 drawable-group)": [[19, "s5", "drawable-group"]], + "(method 14 level-group)": [ [[54, 164], "s1", "process-drawable"], + [[107, 127], "s0", "(pointer int32)"], + [[153, 162], "v0", "symbol"], [[319, 342], "s0", "process-drawable"], [368, "v1", "(pointer process-drawable)"], [[384, 494], "s5", "process-drawable"] ], - "(method 22 level-group)": [ - [[28, 30], "v0", "(inline-array vector)"] - ], + "(method 22 level-group)": [[[28, 30], "v0", "(inline-array vector)"]], - "expand-vis-box-with-point": [ - [10, "v0", "(inline-array vector)"] - ], + "expand-vis-box-with-point": [[10, "v0", "(inline-array vector)"]], - "(method 28 entity-ambient)": [ - [79, "v1", "int"] - ], + "(method 28 entity-ambient)": [[79, "v1", "int"]], "(method 27 entity-ambient)": [ - [[15, 250], "s5", "symbol"] + [[15, 250], "s5", "symbol"], + [32, "v0", "symbol"] ], - "cam-master-effect": [ - [[0, 999], "s6", "camera-master"] - ], - - "birth-func-vector-orient": [ - [[7, 24], "s3", "sprite-vec-data-2d"] - ], + "birth-func-vector-orient": [[[7, 24], "s3", "sprite-vec-data-2d"]], "process-drawable-burn-effect": [ [28, "a0", "process-drawable"], @@ -2650,21 +2218,17 @@ [64, "a0", "process-drawable"] ], - "process-drawable-random-point!": [ - [[28, 40], "s4", "collide-shape"] - ], - - "(anon-function 0 dark-eco-pool)": [ - [2, "v1", "state"] - ], + "(anon-function 0 dark-eco-pool)": [[2, "v1", "state"]], "(method 25 dark-eco-pool)": [ - [22, "t9", "(function res-lump symbol symbol float structure (pointer res-tag) pointer object)"] + [ + 22, + "t9", + "(function res-lump symbol symbol float structure (pointer res-tag) pointer object)" + ] ], - "(top-level-login beach-rocks)": [ - [78, "v1", "state"] - ], + "(top-level-login beach-rocks)": [[78, "v1", "state"]], "(method 7 beach-rock)": [ [5, "v1", "int"], @@ -2672,9 +2236,7 @@ [19, "t9", "(function process-drawable int none)"] ], - "(method 10 beach-rock)": [ - [21, "t9", "(function process-drawable none)"] - ], + "(method 10 beach-rock)": [[21, "t9", "(function process-drawable none)"]], "(code falling beach-rock)": [ [138, "gp", "handle"], @@ -2682,18 +2244,14 @@ [[158, 165], "s5", "handle"] ], - "(method 11 beach-rock)": [ - [77, "v1", "int"] - ], + "(method 11 beach-rock)": [[77, "v1", "int"]], "(anon-function 27 projectiles)": [ [27, "s4", "collide-shape"], [36, "s4", "collide-shape"] ], - "projectile-update-velocity-space-wars": [ - [60, "a0", "target"] - ], + "projectile-update-velocity-space-wars": [[60, "a0", "target"]], "projectile-init-by-other": [ [70, "v1", "process-drawable"], @@ -2717,18 +2275,21 @@ ], "spawn-projectile-blue": [ - [69, "s2", "(function process function object object object object object object)"] + [ + 69, + "s2", + "(function process function object object object object object object)" + ] ], - "(method 28 projectile-blue)": [ - [27, "v1", "process-drawable"] - ], + "(method 28 projectile-blue)": [[27, "v1", "process-drawable"]], - "(method 27 projectile-yellow)": [ - [70, "v1", "process-mask"] - ], + "(method 27 projectile-yellow)": [[70, "v1", "process-mask"]], - "manipy-init": [[143, "a0", "collide-shape"]], + "manipy-init": [ + [143, "a0", "collide-shape"], + [145, "a0", "collide-shape"] + ], "forall-particles-with-key-runner": [ [32, "s3", "(inline-array sparticle-cpuinfo)"], @@ -2743,13 +2304,9 @@ [43, "t9", "(function none :behavior plat-button)"] ], - "(code bouncer-fire)": [ - [17, "v1", "art-joint-anim"] - ], + "(code bouncer-fire)": [[17, "v1", "art-joint-anim"]], - "(method 39 hopper)": [ - [16, "t9", "(function nav-enemy none)"] - ], + "(method 39 hopper)": [[16, "t9", "(function nav-enemy none)"]], "(code nav-enemy-idle hopper)": [ [16, "v1", "art-joint-anim"], @@ -2766,9 +2323,7 @@ [105, "v1", "art-joint-anim"] ], - "(method 39 junglefish)": [ - [12, "t9", "(function nav-enemy none)"] - ], + "(method 39 junglefish)": [[12, "t9", "(function nav-enemy none)"]], "(code nav-enemy-patrol junglefish)": [ [27, "v1", "art-joint-anim"], @@ -2777,9 +2332,7 @@ [251, "v1", "art-joint-anim"] ], - "(code nav-enemy-attack junglefish)": [ - [14, "v1", "art-joint-anim"] - ], + "(code nav-enemy-attack junglefish)": [[14, "v1", "art-joint-anim"]], "(code nav-enemy-victory junglefish)": [ [14, "v1", "art-joint-anim"], @@ -2800,9 +2353,7 @@ [298, "gp", "evilsis"] ], - "sequenceC-can-trans-hook": [ - [12, "v1", "process-taskable"] - ], + "sequenceC-can-trans-hook": [[12, "v1", "process-taskable"]], "(anon-function 7 sidekick-human)": [ [2, "v1", "process-taskable"], @@ -2837,9 +2388,7 @@ [23, "gp", "assistant-bluehut"] ], - "(method 43 sage-bluehut)": [ - [19, "v1", "float"] - ], + "(method 43 sage-bluehut)": [[19, "v1", "float"]], "(code idle sage-bluehut)": [ [34, "v1", "float"], @@ -2853,29 +2402,17 @@ [329, "v1", "art-joint-anim"] ], - "(method 39 sharkey)": [ - [71, "t9", "(function nav-enemy none)"] - ], + "(method 39 sharkey)": [[71, "t9", "(function nav-enemy none)"]], - "(code nav-enemy-patrol sharkey)": [ - [27, "v1", "art-joint-anim"] - ], + "(code nav-enemy-patrol sharkey)": [[27, "v1", "art-joint-anim"]], - "(code nav-enemy-attack sharkey)": [ - [144, "v1", "art-joint-anim"] - ], + "(code nav-enemy-attack sharkey)": [[144, "v1", "art-joint-anim"]], - "(code nav-enemy-chase sharkey)": [ - [40, "v1", "art-joint-anim"] - ], + "(code nav-enemy-chase sharkey)": [[40, "v1", "art-joint-anim"]], - "(code nav-enemy-stop-chase sharkey)": [ - [22, "v1", "art-joint-anim"] - ], + "(code nav-enemy-stop-chase sharkey)": [[22, "v1", "art-joint-anim"]], - "(code nav-enemy-victory sharkey)": [ - [24, "v1", "art-joint-anim"] - ], + "(code nav-enemy-victory sharkey)": [[24, "v1", "art-joint-anim"]], "(code nav-enemy-chase lurkercrab)": [ [17, "v1", "art-joint-anim"], @@ -2889,13 +2426,9 @@ [191, "v1", "art-joint-anim"] ], - "(code nav-enemy-notice lurkerpuppy)": [ - [24, "v1", "art-joint-anim"] - ], + "(code nav-enemy-notice lurkerpuppy)": [[24, "v1", "art-joint-anim"]], - "(code nav-enemy-victory lurkerpuppy)": [ - [20, "v1", "art-joint-anim"] - ], + "(code nav-enemy-victory lurkerpuppy)": [[20, "v1", "art-joint-anim"]], "(code nav-enemy-give-up lurkerpuppy)": [ [18, "v1", "art-joint-anim"], @@ -2913,56 +2446,33 @@ ], "(code target-demo)": [ - [66, "v1", "handle"], - [69, "v1", "handle"], - [96, "v1", "handle"], - [99, "v1", "handle"], - [126, "v1", "handle"], - [163, "v1", "handle"], - [196, "v1", "handle"], - [229, "v1", "handle"], - [262, "v1", "handle"], - [293, "v1", "handle"], - [323, "v1", "handle"], - [357, "v1", "handle"], - [390, "v1", "handle"], - [423, "v1", "handle"], - [456, "v1", "handle"], - [487, "v1", "handle"], - [518, "v1", "handle"], - [548, "v1", "handle"], - [578, "v1", "handle"], - [129, "v1", "handle"], - [166, "v1", "handle"], - [199, "v1", "handle"], - [232, "v1", "handle"], - [261, "v1", "handle"], - [265, "v1", "handle"], - [296, "v1", "handle"], - [298, "v1", "handle"], - [326, "v1", "handle"], - [360, "v1", "handle"], - [393, "v1", "handle"], - [426, "v1", "handle"], - [459, "v1", "handle"], - [490, "v1", "handle"], - [521, "v1", "handle"], - [551, "v1", "handle"], - [581, "v1", "handle"] + [[65, 73], "v1", "handle"], + [[95, 103], "v1", "handle"], + [[125, 133], "v1", "handle"], + [[162, 170], "v1", "handle"], + [[195, 203], "v1", "handle"], + [[228, 236], "v1", "handle"], + [[261, 269], "v1", "handle"], + [[292, 300], "v1", "handle"], + [[322, 330], "v1", "handle"], + [[356, 364], "v1", "handle"], + [[389, 397], "v1", "handle"], + [[422, 430], "v1", "handle"], + [[455, 463], "v1", "handle"], + [[486, 494], "v1", "handle"], + [[517, 525], "v1", "handle"], + [[548, 555], "v1", "handle"], + [[577, 585], "v1", "handle"] ], - "target-has-all-the-cells?": [ - [17, "v1", "float"] - ], + "target-has-all-the-cells?": [[17, "v1", "float"]], "(code open final-door)": [ [13, "v1", "art-joint-anim"], [66, "v1", "art-joint-anim"] ], - "(code idle powercellalt)": [ - [8, "a1", "process-drawable"] - ], + "(code idle powercellalt)": [[8, "a1", "process-drawable"]], "(code target-final-door)": [ [85, "gp", "handle"], @@ -2992,17 +2502,9 @@ [101, "v1", "art-joint-anim"] ], - "voicebox-track": [ - [4, "a0", "target"] - ], + "(method 27 plat-button)": [[37, "v1", "art-joint-anim"]], - "(method 27 plat-button)": [ - [37, "v1", "art-joint-anim"] - ], - - "(method 11 plat-button)": [ - [17, "v1", "vector"] - ], + "(method 11 plat-button)": [[17, "v1", "vector"]], "(trans plat-button-move-downward plat-button)": [ [[92, 999], "gp", "sound-rpc-set-param"] @@ -3012,17 +2514,11 @@ [[92, 999], "gp", "sound-rpc-set-param"] ], - "(anon-function 7 plat-eco)": [ - [22, "v1", "target"] - ], + "(anon-function 7 plat-eco)": [[22, "v1", "target"]], - "drop-plat-set-fade": [ - [7, "v1", "process-drawable"] - ], + "drop-plat-set-fade": [[7, "v1", "process-drawable"]], - "(code drop-plat-spawn)": [ - [3, "v1", "process-drawable"] - ], + "(code drop-plat-spawn)": [[3, "v1", "process-drawable"]], "(code drop-plat-rise)": [ [10, "v1", "process-drawable"], @@ -3031,29 +2527,21 @@ [85, "v1", "process-drawable"] ], - "(post drop-plat-rise)": [ - [12, "v1", "process-drawable"] - ], + "(post drop-plat-rise)": [[12, "v1", "process-drawable"]], "(code drop-plat-drop)": [ [2, "v1", "process-drawable"], [85, "v1", "process-drawable"] ], - "(post drop-plat-drop)": [ - [12, "v1", "process-drawable"] - ], + "(post drop-plat-drop)": [[12, "v1", "process-drawable"]], - "drop-plat-init-by-other": [ - [22, "v1", "process-drawable"] - ], + "drop-plat-init-by-other": [[22, "v1", "process-drawable"]], - "citb-drop-plat-drop-children": [ - [[23,29], "a0", "drop-plat"] - ], + "citb-drop-plat-drop-children": [[[23, 29], "a0", "drop-plat"]], "citb-drop-plat-spawn-children": [ - [98, "t9", "(function process function vector uint uint int)"] + [98, "t9", "(function process function vector int int int none)"] ], "(method 11 citb-drop-plat)": [ @@ -3075,9 +2563,7 @@ [192, "v1", "(pointer float)"] ], - "(method 27 square-platform)": [ - [[26, 33], "a0", "water-vol"] - ], + "(method 27 square-platform)": [[[26, 33], "a0", "water-vol"]], "(method 27 wedge-plat)": [ [4, "v1", "process-drawable"], @@ -3109,22 +2595,16 @@ [60, "v1", "art-joint-anim"] ], - "(code plunger-lurker-idle)": [ - [10, "v1", "art-joint-anim"] - ], + "(code plunger-lurker-idle)": [[10, "v1", "art-joint-anim"]], - "(code flying-lurker-idle)": [ - [92, "v1", "art-joint-anim"] - ], + "(code flying-lurker-idle)": [[92, "v1", "art-joint-anim"]], "(code flying-lurker-fly)": [ [56, "v1", "art-joint-anim"], [110, "v1", "float"] ], - "(code flying-lurker-start)": [ - [36, "v1", "float"] - ], + "(code flying-lurker-start)": [[36, "v1", "float"]], "(method 18 collide-cache)": [ [44, "v1", "collide-shape-prim-sphere"], @@ -3152,13 +2632,9 @@ [109, "v1", "manipy"] ], - "level-hint-task-process": [ - ["_stack_", 16, "res-tag"] - ], + "level-hint-task-process": [["_stack_", 16, "res-tag"]], - "kill-current-level-hint": [ - [[13, 33], "s4", "level-hint"] - ], + "kill-current-level-hint": [[[13, 33], "s4", "level-hint"]], "level-hint-init-by-other": [ [[54, 75], "a0", "string"], @@ -3201,34 +2677,28 @@ [57, "v0", "symbol"] ], "forall-particles-runner": [ - [[19,28], "s4", "sparticle-cpuinfo"], + [[19, 28], "s4", "sparticle-cpuinfo"], [34, "s4", "pointer"], [35, "s3", "pointer"] ], - "(method 2 sparticle-cpuinfo)": [ - [14, "f0", "float"] - ], + "(method 2 sparticle-cpuinfo)": [[14, "f0", "float"]], "sp-kill-particle": [ [7, "a1", "uint"], [7, "v1", "uint"] ], - "sparticle-track-root":[ - [2, "v1", "process-drawable"] - ], + "sparticle-track-root": [[2, "v1", "process-drawable"]], - "sparticle-track-root-prim":[ + "sparticle-track-root-prim": [ [2, "v1", "process-drawable"], [3, "v1", "collide-shape"] ], - "sp-orbiter":[ - [[73, 82], "v1", "sprite-vec-data-2d"] - ], + "sp-orbiter": [[[73, 82], "v1", "sprite-vec-data-2d"]], - "finish-background":[ + "finish-background": [ [249, "a0", "terrain-context"], [297, "a0", "terrain-context"], [307, "a0", "terrain-context"], @@ -3250,55 +2720,34 @@ [[598, 603], "v1", "dma-packet"] ], - "(method 11 drawable-inline-array-node)":[ - [[1, 6], "v1", "drawable"] - ], + "(method 11 drawable-inline-array-node)": [[[1, 6], "v1", "drawable"]], - "(method 12 drawable-inline-array-node)":[ - [[1, 6], "v1", "drawable"] - ], + "(method 12 drawable-inline-array-node)": [[[1, 6], "v1", "drawable"]], - "(method 13 drawable-inline-array-node)":[ - [[1, 6], "v1", "drawable"] - ], + "(method 13 drawable-inline-array-node)": [[[1, 6], "v1", "drawable"]], - "(method 17 drawable-inline-array-node)":[ - [[1, 6], "v1", "drawable"] - ], + "(method 17 drawable-inline-array-node)": [[[1, 6], "v1", "drawable"]], "(code nav-enemy-patrol babak)": [ [25, "v1", "art-joint-anim"], [79, "t9", "(function none)"] ], - "(code nav-enemy-chase babak)": [ - [55, "v1", "art-joint-anim"] - ], + "(code nav-enemy-chase babak)": [[55, "v1", "art-joint-anim"]], - "(code nav-enemy-stare babak)": [ - [154, "v1", "art-joint-anim"] - ], + "(code nav-enemy-stare babak)": [[154, "v1", "art-joint-anim"]], "(code nav-enemy-give-up babak)": [ [43, "v1", "art-joint-anim"], [101, "v1", "art-joint-anim"] ], - "(method 33 process-taskable)": [ - [15, "s5", "spool-anim"] - ], + "(method 33 process-taskable)": [[15, "s5", "spool-anim"]], - "(method 51 process-taskable)": [ - [18, "v1", "spool-anim"] - ], + "(method 51 process-taskable)": [[18, "v1", "spool-anim"]], - "(method 35 process-taskable)": [ - [15, "s5", "spool-anim"] - ] - , - "(method 37 process-taskable)": [ - [15, "s5", "spool-anim"] - ], + "(method 35 process-taskable)": [[15, "s5", "spool-anim"]], + "(method 37 process-taskable)": [[15, "s5", "spool-anim"]], "process-taskable-play-anim-code": [ [68, "gp", "spool-anim"], @@ -3315,29 +2764,17 @@ [24, "a0", "float"] ], - "(event othercam-running)": [ - [23, "v1", "process-taskable"] - ], + "(event othercam-running)": [[23, "v1", "process-taskable"]], - "(code nav-enemy-idle babak-with-cannon)": [ - [22, "v1", "art-joint-anim"] - ], + "(code nav-enemy-idle babak-with-cannon)": [[22, "v1", "art-joint-anim"]], - "(code babak-run-to-cannon)": [ - [14, "v1", "art-joint-anim"] - ], + "(code babak-run-to-cannon)": [[14, "v1", "art-joint-anim"]], - "(code babak-with-cannon-jump-onto-cannon)": [ - [118, "v1", "art-joint-anim"] - ], + "(code babak-with-cannon-jump-onto-cannon)": [[118, "v1", "art-joint-anim"]], - "(code babak-with-cannon-jump-off-cannon)": [ - [28, "v1", "art-joint-anim"] - ], + "(code babak-with-cannon-jump-off-cannon)": [[28, "v1", "art-joint-anim"]], - "(trans nav-enemy-die babak-with-cannon)": [ - [40, "v0", "(state nav-enemy)"] - ], + "(trans nav-enemy-die babak-with-cannon)": [[40, "v0", "(state nav-enemy)"]], "(enter othercam-running)": [ [50, "gp", "process-taskable"], @@ -3352,11 +2789,6 @@ [47, "s2", "process-taskable"] ], - "(method 10 gui-query)": [ - [[84, 88], "v1", "dma-packet"], - [[131, 135], "v1", "dma-packet"] - ], - "(code yakow-idle)": [ [46, "v1", "art-joint-anim"], [102, "v1", "art-joint-anim"] @@ -3367,13 +2799,9 @@ [131, "v1", "art-joint-anim"] ], - "(code yakow-graze-kicked)": [ - [10, "v1", "art-joint-anim"] - ], + "(code yakow-graze-kicked)": [[10, "v1", "art-joint-anim"]], - "(code yakow-kicked)": [ - [81, "v1", "art-joint-anim"] - ], + "(code yakow-kicked)": [[81, "v1", "art-joint-anim"]], "(method 7 fishermans-boat)": [ [20, "t9", "(function rigid-body-platform int rigid-body-platform)"] @@ -3384,13 +2812,9 @@ [87, "v1", "art-joint-anim"] ], - "(code nav-enemy-chase muse)": [ - [35, "v1", "art-joint-anim"] - ], + "(code nav-enemy-chase muse)": [[35, "v1", "art-joint-anim"]], - "(code nav-enemy-jump-land muse)": [ - [31, "v1", "art-joint-anim"] - ], + "(code nav-enemy-jump-land muse)": [[31, "v1", "art-joint-anim"]], "(code muse-caught)": [ [50, "v0", "vector"], @@ -3415,13 +2839,9 @@ [334, "v1", "art-joint-anim"] ], - "(code nav-enemy-stare bonelurker)": [ - [130, "v1", "art-joint-anim"] - ], + "(code nav-enemy-stare bonelurker)": [[130, "v1", "art-joint-anim"]], - "(code bonelurker-stun)": [ - [29, "v1", "art-joint-anim"] - ], + "(code bonelurker-stun)": [[29, "v1", "art-joint-anim"]], "(code nav-enemy-give-up bonelurker)": [ [43, "v1", "art-joint-anim"], @@ -3443,13 +2863,9 @@ [53, "s5", "sage-bluehut"] ], - "(method 43 assistant-bluehut)": [ - [19, "v1", "float"] - ], + "(method 43 assistant-bluehut)": [[19, "v1", "float"]], - "check-drop-level-assistant-bluehut": [ - [17, "v1", "float"] - ], + "check-drop-level-assistant-bluehut": [[17, "v1", "float"]], "(code idle assistant-bluehut)": [ [31, "v1", "art-joint-anim"], @@ -3461,9 +2877,7 @@ [554, "v1", "art-joint-anim"] ], - "assistant-levitator-blue-beam": [ - [15, "v1", "fireboulder"] - ], + "assistant-levitator-blue-beam": [[15, "v1", "fireboulder"]], "(code idle assistant-levitator)": [ [32, "v1", "art-joint-anim"], @@ -3473,13 +2887,9 @@ [311, "v1", "art-joint-anim"] ], - "(event square-platform-lowered)": [ - [8, "a0", "square-platform-master"] - ], + "(event square-platform-lowered)": [[8, "a0", "square-platform-master"]], - "(event square-platform-master-idle)": [ - [6, "a0", "square-platform-button"] - ], + "(event square-platform-master-idle)": [[6, "a0", "square-platform-button"]], "(method 7 square-platform)": [ [24, "t9", "(function baseplat int baseplat)"] @@ -3504,9 +2914,7 @@ [27, "gp", "(pointer rigid-body-platform)"] ], - "(method 32 qbert-plat)": [ - [[4, 10], "a0", "qbert-plat-master"] - ], + "(method 32 qbert-plat)": [[[4, 10], "a0", "qbert-plat-master"]], "(post rigid-body-platform-float qbert-plat)": [ [3, "t9", "(function none :behavior qbert-plat)"] @@ -3539,9 +2947,7 @@ [9, "v1", "process-drawable"] ], - "keg-init-by-other": [ - [142, "v1", "process-drawable"] - ], + "keg-init-by-other": [[142, "v1", "process-drawable"]], "(method 7 keg-conveyor)": [ [14, "t9", "(function process-drawable int process-drawable)"] @@ -3551,9 +2957,7 @@ [26, "t9", "(function process-drawable int process-drawable)"] ], - "(code swamp-bat-slave-die)": [ - [21, "v1", "swamp-bat"] - ], + "(code swamp-bat-slave-die)": [[21, "v1", "swamp-bat"]], // these casts should not be required "swamp-bat-check-slave-paths-match?": [ @@ -3561,63 +2965,39 @@ [7, "a1", "swamp-bat-slave"] ], - "(method 39 swamp-rat)": [ - [37, "t9", "(function nav-enemy none)"] - ], + "(method 39 swamp-rat)": [[37, "t9", "(function nav-enemy none)"]], - "(code nav-enemy-patrol swamp-rat)": [ - [23, "v1", "art-joint-anim"] - ], + "(code nav-enemy-patrol swamp-rat)": [[23, "v1", "art-joint-anim"]], - "(code nav-enemy-stare swamp-rat)": [ - [26, "v1", "art-joint-anim"] - ], + "(code nav-enemy-stare swamp-rat)": [[26, "v1", "art-joint-anim"]], "(code nav-enemy-give-up swamp-rat)": [ [14, "v1", "art-joint-anim"], [72, "v1", "art-joint-anim"] ], - "(code nav-enemy-attack swamp-rat)": [ - [14, "v1", "art-joint-anim"] - ], + "(code nav-enemy-attack swamp-rat)": [[14, "v1", "art-joint-anim"]], - "(code swamp-rat-spawn)": [ - [119, "v1", "art-joint-anim"] - ], + "(code swamp-rat-spawn)": [[119, "v1", "art-joint-anim"]], - "(code spiderwebs-bounce)": [ - [80, "v1", "art-joint-anim"] - ], + "(code spiderwebs-bounce)": [[80, "v1", "art-joint-anim"]], - "(method 39 baby-spider)": [ - [37, "t9", "(function nav-enemy none)"] - ], + "(method 39 baby-spider)": [[37, "t9", "(function nav-enemy none)"]], - "(code baby-spider-hatching)": [ - [14, "v1", "art-joint-anim"] - ], + "(code baby-spider-hatching)": [[14, "v1", "art-joint-anim"]], - "(code nav-enemy-attack baby-spider)": [ - [14, "v1", "art-joint-anim"] - ], + "(code nav-enemy-attack baby-spider)": [[14, "v1", "art-joint-anim"]], "(code nav-enemy-give-up baby-spider)": [ [14, "v1", "art-joint-anim"], [72, "v1", "art-joint-anim"] ], - "(code nav-enemy-patrol baby-spider)": [ - [23, "v1", "art-joint-anim"] - ], + "(code nav-enemy-patrol baby-spider)": [[23, "v1", "art-joint-anim"]], - "(code nav-enemy-notice baby-spider)": [ - [24, "v1", "art-joint-anim"] - ], + "(code nav-enemy-notice baby-spider)": [[24, "v1", "art-joint-anim"]], - "(code nav-enemy-stare baby-spider)": [ - [26, "v1", "art-joint-anim"] - ], + "(code nav-enemy-stare baby-spider)": [[26, "v1", "art-joint-anim"]], "(method 24 mother-spider-proj)": [ [[11, 46], "s5", "sound-rpc-set-param"], @@ -3625,12 +3005,16 @@ [33, "s4", "process-drawable"] ], - "(method 23 exit-chamber)": [ - [107, "a1", "fuel-cell"] - ], + "(method 23 exit-chamber)": [[113, "a0", "fuel-cell"]], "(code exit-chamber-rise)": [ - [15, "v1", "fuel-cell"] + [15, "v1", "fuel-cell"], + [64, "v1", "sunkencam"], + [81, "v1", "art-joint-anim"], + [157, "v1", "art-joint-anim"], + [211, "v1", "art-joint-anim"], + [292, "v1", "art-joint-anim"], + [424, "v1", "fuel-cell"] ], "(method 25 sunken-water)": [ @@ -3638,9 +3022,7 @@ [126, "v1", "uint"] ], - "(code sunkenfisha-idle)": [ - [10, "v1", "art-joint-anim"] - ], + "(code sunkenfisha-idle)": [[10, "v1", "art-joint-anim"]], "(method 27 sunkenfisha)": [ ["_stack_", 16, "res-tag"], @@ -3651,9 +3033,7 @@ [174, "v0", "(pointer float)"] ], - "(method 43 assistant-villagec)": [ - [19, "v1", "float"] - ], + "(method 43 assistant-villagec)": [[19, "v1", "float"]], "(code idle assistant-villagec)": [ [32, "v1", "art-joint-anim"], @@ -3661,19 +3041,16 @@ [176, "v1", "float"] ], - "(method 32 sage-villagec)": [ - [278, "v1", "float"] - ], + "(method 32 sage-villagec)": [[278, "v1", "float"]], - "(method 43 sage-villagec)": [ - [19, "v1", "float"] - ], + "(method 43 sage-villagec)": [[19, "v1", "float"]], "(method 20 cave-trap)": [ [77, "s2", "process-drawable"], [95, "s2", "process-drawable"], [181, "s3", "process-drawable"], - [221, "s3", "process-drawable"] + [221, "s3", "process-drawable"], + [230, "v1", "baby-spider"] ], "(method 7 cave-trap)": [ @@ -3681,24 +3058,22 @@ ], "(method 57 ice-cube)": [ - [16, "v1", "collide-shape-prim-sphere"] + [16, "v1", "collide-shape-prim-group"], + [26, "v1", "collide-shape-prim-group"] ], - "(code yeti-slave-appear-jump-up)": [ - [14, "v1", "art-joint-anim"] + "(method 58 ice-cube)": [ + [16, "v1", "collide-shape-prim-group"], + [26, "v1", "collide-shape-prim-group"] ], - "(code yeti-slave-appear-land)": [ - [14, "v1", "art-joint-anim"] - ], + "(code yeti-slave-appear-jump-up)": [[14, "v1", "art-joint-anim"]], - "(code nav-enemy-chase yeti-slave)": [ - [55, "v1", "art-joint-anim"] - ], + "(code yeti-slave-appear-land)": [[14, "v1", "art-joint-anim"]], - "(code nav-enemy-stare yeti-slave)": [ - [154, "v1", "art-joint-anim"] - ], + "(code nav-enemy-chase yeti-slave)": [[55, "v1", "art-joint-anim"]], + + "(code nav-enemy-stare yeti-slave)": [[154, "v1", "art-joint-anim"]], "(code nav-enemy-give-up yeti-slave)": [ [43, "v1", "art-joint-anim"], @@ -3712,42 +3087,26 @@ [238, "v1", "art-joint-anim"] ], - "(method 7 yeti-slave)": [ - [14, "t9", "(function nav-enemy int nav-enemy)"] - ], + "(method 7 yeti-slave)": [[14, "t9", "(function nav-enemy int nav-enemy)"]], - "(method 21 yeti)": [ - [5, "s5", "(pointer yeti-slave)"] - ], + "(method 21 yeti)": [[5, "s5", "(pointer yeti-slave)"]], "(code idle assistant-lavatube-start)": [ [32, "v1", "float"], [118, "v1", "art-joint-anim"] ], - "check-drop-level-maincave-drip": [ - [17, "v1", "float"] - ], + "check-drop-level-maincave-drip": [[17, "v1", "float"]], - "snow-bird-bob-func": [ - [3, "v1", "process-drawable"] - ], + "snow-bird-bob-func": [[3, "v1", "process-drawable"]], - "bird-bob-func": [ - [3, "v1", "process-drawable"] - ], + "bird-bob-func": [[3, "v1", "process-drawable"]], - "part-tracker-track-root": [ - [2, "v1", "process-drawable"] - ], + "part-tracker-track-root": [[2, "v1", "process-drawable"]], - "sparticle-track-root-money": [ - [5, "v1", "process-drawable"] - ], + "sparticle-track-root-money": [[5, "v1", "process-drawable"]], - "eco-fadeout": [ - [2, "v1", "process-drawable"] - ], + "eco-fadeout": [[2, "v1", "process-drawable"]], "eco-track-root-prim-fadeout": [ [2, "v1", "process-drawable"], @@ -3755,21 +3114,13 @@ [11, "v1", "process-drawable"] ], - "check-drop-level-sagehut": [ - [18, "v1", "float"] - ], + "check-drop-level-sagehut": [[18, "v1", "float"]], - "check-drop-level-training-spout-rain": [ - [17, "v1", "float"] - ], + "check-drop-level-training-spout-rain": [[17, "v1", "float"]], - "check-drop-level-sagehut2": [ - [18, "v1", "float"] - ], + "check-drop-level-sagehut2": [[18, "v1", "float"]], - "tra-bird-bob-func": [ - [3, "v1", "process-drawable"] - ], + "tra-bird-bob-func": [[3, "v1", "process-drawable"]], "(anon-function 6 relocate)": [ [3, "a0", "int"], @@ -3787,6 +3138,8 @@ [93, "v1", "process-drawable"] ], + "(code part-tester-idle)": [[[16, 22], "s5", "process-drawable"]], + "(method 20 hud-money)": [ [35, "a0", "process-drawable"], [38, "v1", "process-drawable"], @@ -3816,9 +3169,7 @@ [15, "v1", "uint"] ], - "hide-bottom-hud": [ - [22, "v1", "(pointer hud)"] - ], + "hide-bottom-hud": [[22, "v1", "(pointer hud)"]], "disable-hud": [ [22, "a0", "(pointer hud)"], @@ -3826,29 +3177,17 @@ [57, "v1", "(pointer hud)"] ], - "enable-hud": [ - [20, "v1", "(pointer hud)"] - ], + "enable-hud": [[20, "v1", "(pointer hud)"]], - "hide-hud-quick": [ - [20, "v1", "(pointer hud)"] - ], + "hide-hud-quick": [[20, "v1", "(pointer hud)"]], - "set-hud-aspect-ratio": [ - [17, "v1", "(pointer hud)"] - ], + "set-hud-aspect-ratio": [[17, "v1", "(pointer hud)"]], - "hud-hidden?": [ - [14, "v1", "(pointer hud)"] - ], + "hud-hidden?": [[14, "v1", "(pointer hud)"]], - "bottom-hud-hidden?": [ - [16, "v1", "(pointer hud)"] - ], + "bottom-hud-hidden?": [[16, "v1", "(pointer hud)"]], - "show-hud": [ - [31, "v1", "(pointer hud)"] - ], + "show-hud": [[31, "v1", "(pointer hud)"]], "fuel-cell-hud-orbit-callback": [ [12, "s3", "hud-fuel-cell"], @@ -3865,13 +3204,9 @@ [52, "v1", "dma-packet"] ], - "(method 15 hud-money)": [ - [[50, 53], "v1", "dma-packet"] - ], + "(method 15 hud-money)": [[[50, 53], "v1", "dma-packet"]], - "(method 15 hud-money-all)": [ - [[125, 128], "v1", "dma-packet"] - ], + "(method 15 hud-money-all)": [[[125, 128], "v1", "dma-packet"]], "(method 15 hud-buzzers)": [ [58, "v1", "dma-packet"], @@ -3887,9 +3222,7 @@ [311, "v0", "sound-rpc-set-param"] ], - "battlecontroller-default-event-handler": [ - [9, "a0", "process-drawable"] - ], + "battlecontroller-default-event-handler": [[9, "a0", "process-drawable"]], "battlecontroller-update-spawners": [ [19, "s4", "nav-enemy"], @@ -3918,13 +3251,9 @@ [2, "v1", "(pointer process-drawable)"] ], - "update-time-of-day": [ - [46, "v0", "(array float)"] - ], + "update-time-of-day": [[46, "v0", "(array float)"]], - "sky-make-light": [ - [[10, 23], "a0", "sky-sun-data"] - ], + "sky-make-light": [[[10, 23], "a0", "sky-sun-data"]], "make-sky-textures": [ [[90, 94], "a0", "dma-packet"], @@ -4011,20 +3340,15 @@ [4, "t9", "(function none :behavior helix-dark-eco)"] ], - "(code helix-slide-door-close)": [ - [10, "v1", "art-joint-anim"] - ], + "(code helix-slide-door-close)": [[10, "v1", "art-joint-anim"]], - "(code helix-button-startup)": [ - [39, "v1", "process-drawable"] - ], + "(code helix-button-startup)": [[39, "v1", "collectable"]], - "(method 73 green-eco-lurker)": [ - [6, "a1", "touching-shapes-entry"] - ], + "(method 73 green-eco-lurker)": [[6, "a1", "touching-shapes-entry"]], "citb-sagecage-update-collision": [ - [2, "a0", "collide-shape-prim-group"] + [2, "a0", "collide-shape-prim-mesh"], + [9, "a0", "collide-shape-prim-mesh"] ], "race-ring-set-particle-rotation-callback": [ @@ -4036,16 +3360,12 @@ ], "(code race-ring-active)": [ - [242, "v1", "handle"], - [245, "v1", "handle"], + [[241, 249], "v1", "handle"], [253, "gp", "handle"], - [269, "s5", "handle"], - [272, "s5", "handle"] + [[269, 276], "s5", "handle"] ], - "(trans race-ring-active)": [ - [26, "a0", "part-tracker"] - ], + "(trans race-ring-active)": [[26, "a0", "part-tracker"]], "(code anim-tester-process)": [ [41, "v1", "anim-test-obj"], @@ -4060,8 +3380,298 @@ [[423, 426], "v1", "dma-packet"] ], - "anim-tester-disp-frame-num": [ - [[75, 78], "v1", "dma-packet"] + "anim-tester-disp-frame-num": [[[75, 78], "v1", "dma-packet"]], + + "reset-drawable-tracking": [ + [3, "gp", "target"], + [10, "gp", "target"], + [14, "gp", "target"], + [42, "gp", "target"], + [48, "gp", "target"] + ], + "reset-drawable-follow": [ + [3, "v1", "target"], + [10, "v1", "target"], + [16, "v1", "target"] + ], + "master-track-target": [ + [62, "gp", "target"], + [65, "gp", "target"], + [96, "gp", "target"], + [103, "gp", "target"], + [423, "f0", "float"] + ], + + "master-switch-to-entity": [ + ["_stack_", 16, "res-tag"], + [88, "v0", "(pointer string)"], + [233, "v1", "camera-slave"] + ], + + "master-check-regions": [[119, "v1", "connection"]], + "(anon-function 71 cam-states)": [ + [13, "a1", "pov-camera"], + [20, "v1", "pov-camera"], + [41, "v1", "pov-camera"], + [52, "v1", "pov-camera"], + [71, "a1", "pov-camera"] + ], + "(anon-function 68 cam-states)": [[13, "a1", "pov-camera"]], + "(anon-function 75 cam-states)": [ + [13, "a1", "pov-camera"], + [21, "a0", "pov-camera"] + ], + + "(event cam-master-active)": [ + [95, "gp", "matrix"], + [184, "v1", "vector"], + [235, "v1", "process"], + [239, "v1", "process"], + [240, "v1", "process"], + [262, "v1", "process"], + [270, "v1", "process"], + [279, "v1", "process"], + [280, "v1", "process"], + [329, "v1", "float"], + [335, "a0", "float"], + [457, "v1", "camera-slave"], + [511, "v1", "camera-slave"], + [524, "v0", "camera-slave"], + [560, "a0", "camera-slave"], + [570, "v1", "camera-slave"], + [629, "v1", "camera-slave"], + [679, "a0", "camera-slave"], + [690, "v1", "camera-slave"], + [771, "v1", "camera-slave"], + [875, "v1", "camera-slave"], + [928, "v1", "camera-slave"], + [947, "v1", "camera-slave"], + [966, "v1", "camera-slave"], + [994, "v1", "camera-slave"], + [999, "a0", "camera-slave"], + [1011, "a0", "camera-slave"], + [1023, "v1", "projectile"], + [1033, "a0", "camera-slave"], + [1035, "a0", "camera-slave"], + [1049, "v1", "float"], + [1053, "v1", "float"], + [1062, "v1", "float"], + [1066, "v1", "float"], + [1071, "a0", "vector"], + [1368, "v1", "float"], + [1371, "v1", "float"] + ], + + "(code cam-pov)": [ + [13, "a1", "pov-camera"], + [21, "a0", "pov-camera"] + ], + + "(code cam-pov-track)": [[13, "a1", "pov-camera"]], + + "(code cam-pov180)": [ + [13, "a1", "pov-camera"], + [20, "v1", "pov-camera"], + [41, "v1", "pov-camera"], + [52, "v1", "pov-camera"], + [71, "a1", "pov-camera"] + ], + + "cam-los-spline-collide": [ + [[52, 83], "s3", "(inline-array collide-cache-tri)"] + ], + + "(event cam-string)": [ + [15, "v1", "float"], + [18, "v1", "float"], + [31, "a0", "vector"], + [35, "a0", "vector"] + ], + + "cam-draw-collide-cache": [ + [[2, 13], "gp", "(inline-array collide-cache-tri)"] + ], + + "cam-los-collide": [[[50, 197], "s1", "(inline-array collide-cache-tri)"]], + + "(anon-function 1 pov-camera)": [ + [9, "v1", "float"], + [16, "v1", "float"] + ], + + "camera-fov-frame": [ + [87, "a0", "vector"], + [128, "a0", "vector"], + [169, "a0", "vector"] + ], + + "camera-sphere": [[[39, 46], "v1", "cam-dbg-scratch"]], + + "camera-line-draw": [ + [34, "a0", "cam-dbg-scratch"], + [42, "a0", "cam-dbg-scratch"] + ], + + "camera-plot-float-func": [ + [54, "v1", "cam-dbg-scratch"], + [62, "a0", "cam-dbg-scratch"], + [66, "a0", "cam-dbg-scratch"], + [103, "v1", "cam-dbg-scratch"], + [240, "v1", "cam-dbg-scratch"] + ], + + "cam-line-dma": [ + [32, "t0", "vector"], + [36, "t0", "vector"], + [45, "t0", "vector"], + [50, "t0", "vector"], + [[12, 16], "a3", "dma-packet"], + [[22, 25], "a3", "gs-gif-tag"], + [[33, 38], "a3", "(pointer uint128)"], + [[46, 52], "a1", "(pointer uint128)"], + [[60, 65], "a0", "dma-packet"], + [[65, 74], "a0", "(pointer uint64)"], + [[77, 80], "a0", "dma-packet"] + ], + + "v-slrp!": [ + [54, "s3", "float"], + [65, "s3", "float"] + ], + + "clmf-pos-rot": [ + [60, "a1", "int"], + [70, "a2", "symbol"], + [71, "a1", "res-tag"], + [132, "a0", "int"], + [141, "s0", "res-tag"] + ], + + "clmf-next-entity": [[38, "a0", "connection"]], + + "cam-layout-init": [[10, "v1", "connection"]], + + "clmf-save-all": [[18, "v1", "connection"]], + + "cam-layout-save-cam-rot": [[14, "v0", "vector"]], + + "cam-layout-save-campointsoffset": [[13, "v0", "vector"]], + + "cam-layout-entity-info": [ + [205, "v1", "vector"], + [495, "v1", "vector"] + ], + + "cam-layout-save-pivot": [ + [14, "v0", "vector"], + [40, "v0", "vector"] + ], + + "cam-layout-save-interesting": [ + [14, "v0", "vector"], + [40, "v0", "vector"] + ], + + "cam-layout-save-align": [ + [14, "v0", "vector"], + [40, "v0", "vector"] + ], + + "cam-layout-save-splineoffset": [[40, "v0", "vector"]], + + "cam-layout-save-cam-trans": [ + [65, "s5", "vector"], + [67, "s5", "vector"], + [69, "s5", "vector"], + [75, "s5", "vector"], + [77, "s2", "vector"], + [82, "s2", "vector"], + [84, "s2", "vector"], + [86, "s2", "vector"], + [92, "s2", "vector"], + [94, "s5", "vector"], + [95, "s5", "symbol"], + [96, "s2", "symbol"], + [97, "s2", "symbol"], + [110, "s5", "vector"], + [113, "s5", "vector"], + [115, "s5", "vector"], + [117, "s5", "vector"] + ], + + "clmf-cam-flag-toggle": [ + [119, "a0", "int"], + [124, "v1", "int"], + [138, "v0", "int"], + [153, "a0", "int"], + [158, "v1", "int"], + [172, "v0", "int"], + [195, "a0", "int"], + [200, "v1", "int"], + [214, "v0", "int"], + [233, "a0", "int"], + [238, "v1", "int"], + [252, "v0", "int"] + ], + + "clmf-cam-float-adjust": [[49, "a1", "int"]], + + "cam-layout-do-action": [ + [66, "s5", "basic"], + [74, "s5", "basic"], + [80, "s5", "(function object symbol symbol)"] + ], + + "cam-layout-function-call": [ + [11, "gp", "basic"], + [15, "gp", "(function string int basic none)"] + ], + + "cam-layout-do-menu": [ + [[130, 176], "s3", "clm-list"], + [203, "a0", "clm-item"], + [213, "v1", "clm-item"], + [228, "s3", "clm-item"], + [233, "v1", "clm-item"], + [238, "s3", "clm-item"], + [275, "s4", "clm-list"], + [277, "s4", "clm-list"], + [279, "s4", "clm-list"], + [283, "s4", "clm-list"], + [289, "s4", "clm-list"], + [291, "s4", "clm-list"], + [303, "s4", "clm-list"], + [305, "s4", "clm-list"], + [345, "s4", "clm-list"], + [347, "s4", "clm-list"], + [350, "s4", "clm-list"], + [352, "s4", "clm-list"], + [353, "s4", "clm-list"], + [356, "s4", "clm-list"], + [357, "s4", "clm-list"], + [369, "v1", "clm-item"] + ], + + "cam-layout-print": [[[21, 24], "v1", "dma-packet"]], + + "cam-layout-entity-volume-info": [ + [58, "s4", "vector"], + [59, "s4", "vector"], + [61, "s4", "(inline-array plane-volume)"] + ], + + "cam-layout-entity-volume-info-create": [ + ["_stack_", 16, "res-tag"], + [16, "v0", "(inline-array vector)"] + ], + + "clmf-cam-string": [["_stack_", 16, "res-tag"]], + + "in-cam-entity-volume?": [ + ["_stack_", 16, "res-tag"], + [22, "v1", "(inline-array vector)"], + [29, "v1", "(inline-array vector)"], + [34, "v1", "(inline-array vector)"] ], "fisher-fish-move": [ @@ -4075,9 +3685,7 @@ [79, "v1", "fisher"] ], - "(code fisher-fish-caught)": [ - [169, "v1", "fisher"] - ], + "(code fisher-fish-caught)": [[169, "v1", "fisher"]], "(code fisher-fish-die)": [ [35, "v1", "fisher"], @@ -4097,9 +3705,7 @@ [79, "v1", "float"] ], - "(method 38 fisher)": [ - [33, "t9", "(function fisher none)"] - ], + "(method 38 fisher)": [[33, "t9", "(function fisher none)"]], "(enter fisher-done)": [ [137, "f0", "float"], @@ -4107,22 +3713,16 @@ [213, "f0", "float"] ], - "fisher-spawn-ambient": [ - [8, "v1", "float"] - ], + "fisher-spawn-ambient": [[8, "v1", "float"]], "(method 43 fisher)": [ [27, "v1", "float"], [69, "v1", "float"] ], - "(trans play-accept fisher)": [ - [101, "v0", "state"] - ], + "(trans play-accept fisher)": [[101, "v0", "state"]], - "(trans idle fisher)": [ - [4, "v0", "state"] - ], + "(trans idle fisher)": [[4, "v0", "state"]], "(code idle fisher)": [ [132, "v1", "art-joint-anim"], @@ -4134,9 +3734,7 @@ [290, "v1", "art-joint-anim"] ], - "(method 11 torus)": [ - [[5, 22], "s4", "collide-shape-prim-group"] - ], + "(method 11 torus)": [[[5, 22], "s4", "collide-shape-prim-group"]], "(method 12 torus)": [ [11, "v1", "float"], @@ -4148,55 +3746,35 @@ [75, "v1", "art-joint-anim"] ], - "(code darkecobomb-land)": [ - [36, "v1", "art-joint-anim"] - ], + "(code darkecobomb-land)": [[36, "v1", "art-joint-anim"]], "(code darkecobomb-idle)": [ [10, "v1", "art-joint-anim"], [60, "v1", "art-joint-anim"] ], - "redshot-particle-callback": [ - [2, "v1", "(pointer redshot)"] - ], + "redshot-particle-callback": [[2, "v1", "(pointer redshot)"]], - "(event cam-robotboss)": [ - [5, "v1", "vector"] - ], + "(event cam-robotboss)": [[5, "v1", "vector"]], - "ecoclaw-handler": [ - [73, "v1", "vector"] - ], + "ecoclaw-handler": [[73, "v1", "vector"]], - "(event idle silodoor)": [ - [4, "v1", "float"] - ], + "(event idle silodoor)": [[4, "v1", "float"]], "ecoclaw-beam-particle-callback": [ [1, "a0", "(pointer projectile)"], [3, "a0", "(pointer projectile)"] ], - "(method 32 finalbosscam)": [ - [156, "v1", "robotboss"] - ], + "(method 32 finalbosscam)": [[156, "v1", "robotboss"]], - "(trans ecoclaw-activate)": [ - [30, "a0", "part-tracker"] - ], + "(trans ecoclaw-activate)": [[30, "a0", "part-tracker"]], - "robotboss-position": [ - [109, "a0", "process-drawable"] - ], + "robotboss-position": [[109, "a0", "process-drawable"]], - "robotboss-bomb-handler": [ - [6, "v1", "float"] - ], + "robotboss-bomb-handler": [[6, "v1", "float"]], - "robotboss-handler": [ - [6, "v1", "float"] - ], + "robotboss-handler": [[6, "v1", "float"]], "(event robotboss-red-wait)": [ [12, "v1", "float"], @@ -4208,12 +3786,7 @@ [68, "v1", "float"] ], - "(code robotboss-white-eco-movie)": [ - [189, "v1", "handle"], - [192, "v1", "handle"], - [208, "gp", "handle"], - [211, "gp", "handle"] - ], + "(code robotboss-white-eco-movie)": [[[188, 215], "gp", "handle"]], "(code robotboss-yellow-wait)": [ [336, "v1", "float"], @@ -4266,17 +3839,13 @@ [137, "v1", "float"] ], - "(trans robotboss-blue-wait)": [ - [254, "v1", "float"] - ], + "(trans robotboss-blue-wait)": [[254, "v1", "float"]], - "(code robotboss-blue-wait)": [ - [14, "v1", "art-joint-anim"] - ], + "(code robotboss-blue-wait)": [[14, "v1", "art-joint-anim"]], "(enter green-eco-lurker-appear)": [ - [12, "v1", "robotboss"], - [17, "v1", "robotboss"] + [12, "v1", "green-eco-lurker-gen"], + [17, "v1", "green-eco-lurker-gen"] ], "(code green-eco-lurker-appear)": [ @@ -4284,17 +3853,11 @@ [93, "v1", "art-joint-anim"] ], - "(code green-eco-lurker-appear-land)": [ - [74, "v1", "art-joint-anim"] - ], + "(code green-eco-lurker-appear-land)": [[74, "v1", "art-joint-anim"]], - "(code nav-enemy-chase green-eco-lurker)": [ - [55, "v1", "art-joint-anim"] - ], + "(code nav-enemy-chase green-eco-lurker)": [[55, "v1", "art-joint-anim"]], - "(code nav-enemy-patrol green-eco-lurker)": [ - [8, "t9", "(function none)"] - ], + "(code nav-enemy-patrol green-eco-lurker)": [[8, "t9", "(function none)"]], "(trans light-eco-child-hit-ground)": [ [63, "v1", "light-eco-mother"], @@ -4302,5 +3865,3847 @@ [88, "a1", "light-eco-mother"] ], + "(event plat-path-active plat-eco-finalboss)": [[10, "v1", "float"]], + + "(method 45 sage-finalboss)": [[[40, 57], "s5", "manipy"]], + + "(method 32 sage-finalboss)": [ + [[241, 245], "v1", "manipy"], + [[309, 313], "v1", "manipy"], + [313, "v1", "silodoor"] + ], + + "(trans play-anim sage-finalboss)": [ + [186, "v1", "process-drawable"], + [223, "v1", "process-drawable"], + [300, "v1", "process-drawable"], + [339, "v1", "process-drawable"], + [376, "v1", "process-drawable"], + [399, "gp", "final-door"], + [401, "a0", "final-door"] + // [[179, 183], "a0", "manipy"], + // [[182, 187], "v1", "manipy"], + // [[216, 220], "a0", "manipy"], + // [[295, 299], "a1", "manipy"], + // [[334, 338], "a1", "manipy"], + // [[371, 375], "a1", "manipy"], + // [391, "v0", "final-door"], + // [396, "v0", "final-door"] + ], + + "load-boundary-from-template": [ + [[2, 60], "s5", "(array float)"], + [42, "a0", "pair"], + [54, "a0", "pair"] + ], + + "command-get-int": [[27, "gp", "bfloat"]], + + "command-get-float": [[30, "gp", "bfloat"]], + + "command-get-time": [[46, "gp", "bfloat"]], + + "command-get-param": [[125, "gp", "bfloat"]], + + "command-list-get-process": [[[78, 88], "s4", "process-drawable"]], + + "add-boundary-shader": [ + [[5, 8], "a1", "gs-gif-tag"], + [[11, 35], "s5", "adgif-shader"] + ], + + "render-boundary": [ + [[22, 26], "a0", "dma-packet"], + [[32, 35], "a0", "gs-gif-tag"], + + [40, "a0", "(pointer gs-zbuf)"], + [42, "a0", "(pointer gs-reg64)"], + [44, "a0", "(pointer gs-test)"], + [46, "a0", "(pointer gs-reg64)"], + [48, "a0", "(pointer gs-alpha)"], + [50, "a0", "(pointer gs-reg64)"], + [[110, 117], "s2", "dma-packet"], + [[120, 123], "v1", "dma-packet"] + ], + + "real-main-draw-hook": [ + [[225, 229], "a0", "dma-packet"], + [[235, 238], "a0", "gs-gif-tag"], + [243, "a0", "(pointer gs-zbuf)"], + [245, "a0", "(pointer gs-reg64)"], + [247, "a0", "(pointer gs-test)"], + [249, "a0", "(pointer gs-reg64)"], + [251, "a0", "(pointer gs-alpha)"], + [253, "a0", "(pointer gs-reg64)"], + [[270, 273], "v1", "dma-packet"], + [[312, 316], "a0", "dma-packet"], + [[322, 325], "a0", "gs-gif-tag"], + [330, "a0", "(pointer gs-zbuf)"], + [332, "a0", "(pointer gs-reg)"], + [334, "a0", "(pointer gs-test)"], + [336, "a0", "(pointer gs-reg64)"], + [338, "a0", "(pointer gs-alpha)"], + [340, "a0", "(pointer gs-reg64)"], + [[357, 360], "v1", "dma-packet"] + ], + + "(event target-racing-start)": [ + [35, "v1", "float"], + [121, "v1", "attack-info"], + [125, "v1", "attack-info"], + [130, "v1", "attack-info"], + [148, "v1", "float"], + [206, "v1", "float"], + [251, "a0", "process-drawable"] + ], + + "(anon-function 46 racer-states)": [[[4, 32], "v1", "target"]], + + "(anon-function 45 racer-states)": [ + [19, "a0", "target"], + [31, "a0", "target"], + [42, "v1", "target"] + ], + + "(code target-racing-smack)": [[30, "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-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"]], + + "(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"]], + + "(method 9 lod-set)": [["_stack_", 16, "res-tag"]], + + "execute-math-engine": [ + [12, "a1", "process"], + [15, "a1", "process"], + [[18, 21], "a0", "process-drawable"] + ], + + "(method 18 process-drawable)": [[[8, 11], "a0", "collide-shape"]], + + "ja-post": [[[42, 45], "a0", "collide-shape"]], + "transform-post": [[[3, 6], "a0", "collide-shape"]], + "rider-trans": [[[1, 4], "a0", "collide-shape"]], + "rider-post": [ + [[4, 7], "a0", "collide-shape"], + [[9, 12], "a0", "collide-shape"], + [[13, 16], "gp", "collide-shape"], + [8, "gp", "collide-shape"], + [3, "gp", "collide-shape"] + ], + "pusher-post": [ + [4, "a0", "collide-shape"], + [3, "gp", "collide-shape"], + [[8, 11], "gp", "collide-shape"] + ], + + "(method 14 process-drawable)": [ + [[322, 336], "gp", "collide-shape"], + [320, "v1", "vector"] + ], + + "(method 9 joint-control)": [ + [[14, 61], "gp", "(pointer float)"], + [[13, 59], "s4", "joint-control-channel"] + ], + + "ja-blend-eval": [[[3, 31], "s5", "joint-control-channel"]], + + "joint-control-reset!": [ + [4, "a1", "pointer"], + [6, "a0", "pointer"], + [9, "a1", "pointer"], + [[14, 37], "v1", "joint-control-channel"] + ], + + "ja-channel-push!": [ + [38, "v1", "pointer"], + [38, "a0", "pointer"] + ], + + "fill-skeleton-cache": [[[11, 33], "a2", "bone-cache"]], + + "dma-add-process-drawable-hud": [[[12, 27], "v1", "vu-lights"]], + + "dma-add-process-drawable": [ + [12, "a0", "terrain-context"], + [15, "a0", "terrain-context"], + [276, "a0", "terrain-context"], + [[15, 251], "s2", "vu-lights"], + [21, "s4", "vector"], + [277, "s4", "vector"], + [290, "v1", "vector"], + [292, "v1", "vector"], + [297, "v1", "vector"] + ], + + "(code notice-blue crate)": [ + [22, "v1", "process-drawable"], + [36, "v1", "collide-shape"] + ], + + "(method 17 process-drawable)": [ + [36, "a0", "terrain-context"], + [82, "t9", "(function cspace pointer none)"], + [104, "t9", "(function cspace matrix none)"], + [63, "t9", "(function cspace basic basic int)"] + ], + + "joint-control-copy!": [ + [8, "a0", "pointer"], + [8, "a2", "pointer"] + ], + + "matrix-from-control!": [ + [23, "v1", "pointer"], + [36, "v1", "pointer"], + [39, "v1", "pointer"], + [69, "v1", "pointer"], + [78, "v1", "pointer"], + [81, "v1", "pointer"], + [58, "v1", "matrix"], + [[45, 49], "v1", "matrix"] + ], + + "cloud-track": [ + [26, "s1", "handle"], + [39, "s2", "handle"], + [74, "s1", "handle"], + [76, "s2", "handle"], + [101, "s2", "handle"] + ], + + "(method 7 cavegeyserrock)": [ + [14, "t9", "(function process-drawable int process-drawable)"] + ], + + "(trans junglesnake-wake)": [[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 24 junglesnake)": [[5, "v1", "collide-shape-prim-group"]], + + "(trans junglesnake-tracking)": [[79, "v1", "collide-shape-prim-group"]], + + "(code junglesnake-wake)": [[10, "v1", "art-joint-anim"]], + + "(code junglesnake-tracking)": [[51, "v1", "art-joint-anim"]], + + "(code junglesnake-die)": [[23, "v1", "art-joint-anim"]], + + "(code junglesnake-give-up)": [[29, "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"]], + + "(code windmill-one-idle)": [[10, "v1", "art-joint-anim"]], + + "(code harvester-inflate)": [ + [11, "v1", "art-joint-anim"], + [61, "v1", "art-joint-anim"] + ], + + "(code flutflutegg-break)": [ + [38, "v1", "art-joint-anim"], + [91, "v1", "art-joint-anim"], + [191, "v1", "art-joint-anim"] + ], + + "(method 7 flutflutegg)": [ + [14, "t9", "(function process-drawable int process-drawable)"] + ], + + "(event flutflutegg-idle)": [[30, "gp", "process-drawable"]], + + "(event flutflutegg-physics)": [[37, "gp", "process-drawable"]], + + "(trans flutflutegg-idle)": [[17, "v1", "float"]], + + "beachcam-spawn": [ + [[57, 85], "gp", "handle"], + [[68, 76], "v1", "handle"], + [80, "v1", "pov-camera"], + [[84, 92], "v1", "handle"], + [[103, 110], "s5", "handle"] + ], + + "(code ecoventrock-break)": [[338, "gp", "handle"]], + + "(code target-warp-in)": [[192, "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)"] + ], + + "(code basebutton-going-down warp-gate-switch)": [ + [79, "v0", "(state basebutton)"], + [81, "t9", "(function none :behavior basebutton)"] + ], + + "(method 11 village-cam)": [[21, "s5", "entity-actor"]], + + "(code idle warp-gate)": [[35, "a0", "symbol"]], + + "(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-b)": [[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-shoulder-a)": [[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"]], + + "(code citb-coil-break)": [[19, "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-spawn)": [[14, "v1", "art-joint-anim"]], + + "(code citb-hose-die)": [[19, "v1", "art-joint-anim"]], + + "(code citadelcam-stair-plats)": [[79, "gp", "handle"]], + + "(code battlecontroller-play-intro-camera citb-battlecontroller)": [ + [55, "gp", "handle"], + [76, "gp", "handle"] + ], + + "(post plat-path-active citb-launcher)": [ + [4, "t9", "(function none :behavior citb-launcher)"] + ], + + "(code battlecontroller-die citb-battlecontroller)": [ + [9, "v0", "(state battlecontroller)"], + [11, "t9", "(function none :behavior battlecontroller)"] + ], + + "(method 27 citb-battlecontroller)": [ + [7, "t9", "(function battlecontroller none)"] + ], + + "(code eggtop-close)": [ + [108, "v1", "art-joint-anim"], + [176, "v1", "art-joint-anim"] + ], + + "(code idle logtrap)": [[12, "v1", "art-joint-anim"]], + + "(code towertop-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-piston-idle)": [[10, "v1", "art-joint-anim"]], + + "(code precurbridge-activate)": [[31, "v1", "art-joint-anim"]], + + "(event precurbridge-active)": [[4, "gp", "touching-shapes-entry"]], + + "(method 7 jngpusher)": [ + [14, "t9", "(function process-drawable int process-drawable)"] + ], + + "(method 11 lurkerm-piston)": [ + ["_stack_", 16, "res-tag"], + ["_stack_", 32, "res-tag"], + [148, "v0", "(pointer float)"] + ], + + "(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-hit)": [[21, "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)"] + ], + + "mistycam-spawn": [ + [[68, 76], "v1", "handle"], + [80, "v1", "pov-camera"], + [[84, 92], "v1", "handle"], + [[102, 110], "s5", "handle"] + ], + + "(code battlecontroller-play-intro-camera misty-battlecontroller)": [ + [34, "gp", "handle"] + ], + + "(method 27 misty-battlecontroller)": [ + [7, "t9", "(function battlecontroller none)"] + ], + + "(code boat-fuelcell-spawn)": [[50, "gp", "handle"]], + + "(code pov-camera-playing village2cam)": [ + [12, "v1", "art-joint-anim"], + [65, "v1", "art-joint-anim"] + ], + + "(method 23 pontoon)": [ + [9, "t9", "(function rigid-body-platform basic none)"] + ], + + "fireboulder-disable-blocking-collision": [ + [5, "v1", "collide-shape-prim-group"], + [14, "v1", "collide-shape-prim-group"] + ], + + "fireboulder-hover-stuff": [[20, "v1", "(pointer part-tracker)"]], + + "(code ogreboss-village2-throw)": [ + [179, "v1", "art-joint-anim"], + [227, "v1", "float"], + [434, "v1", "art-joint-anim"] + ], + + "(code ogreboss-village2-idle)": [ + [136, "v1", "art-joint-anim"], + [194, "v1", "art-joint-anim"], + [247, "v1", "art-joint-anim"], + [299, "v1", "float"], + [319, "v1", "art-joint-anim"] + ], + + "(code fireboulder-idle)": [[58, "a0", "(pointer part-tracker)"]], + + "(code swamp-spike-idle)": [ + [119, "v1", "art-joint-anim"], + [203, "v1", "art-joint-anim"], + [312, "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)"] + ], + + "(code battlecontroller-play-intro-camera swamp-battlecontroller)": [ + [38, "gp", "handle"] + ], + + "(code battlecontroller-die swamp-battlecontroller)": [ + [8, "t9", "(function none :behavior battlecontroller)"] + ], + + "swamp-spike-set-particle-rotation-callback": [ + [3, "v1", "(pointer swamp-spike)"] + ], + + "(code pov-camera-playing maincavecam)": [[[40, 54], "gp", "handle"]], + + "(code cavecrusher-idle)": [[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 trigger cavetrapdoor)": [ + [23, "v1", "art-joint-anim"], + [157, "v1", "art-joint-anim"], + [247, "v1", "art-joint-anim"] + ], + + "(method 11 caveflamepots)": [ + ["_stack_", 16, "res-tag"], + ["_stack_", 32, "res-tag"], + ["_stack_", 48, "res-tag"], + [258, "s4", "vector"], + [281, "s4", "collide-shape-prim-group"], + [290, "s4", "collide-shape-prim-group"], + [311, "v0", "(pointer float)"], + [342, "v0", "(pointer float)"], + [372, "v0", "(pointer float)"] + ], + + "(code pov-camera-playing sunkencam)": [ + [12, "v1", "art-joint-anim"], + [62, "v1", "art-joint-anim"], + [120, "v1", "art-joint-anim"], + [174, "v1", "art-joint-anim"], + [236, "v1", "art-joint-anim"], + [294, "v1", "art-joint-anim"], + [348, "v1", "art-joint-anim"], + [452, "v1", "art-joint-anim"], + [502, "v1", "art-joint-anim"] + ], + + "(code seaweed-idle)": [[36, "v1", "art-joint-anim"]], + + "(code dark-plant-death)": [[36, "v1", "art-joint-anim"]], + + "(code dark-plant-sprout)": [[34, "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-break)": [ + [11, "v1", "art-joint-anim"], + [67, "v1", "art-joint-anim"], + [117, "v1", "art-joint-anim"] + ], + + "(code dark-plant-startup)": [ + [10, "v1", "art-joint-anim"], + [26, "v1", "float"] + ], + + "(code dark-plant-idle)": [ + [85, "v1", "art-joint-anim"], + [101, "v1", "float"], + [139, "v1", "float"] + ], + + "(code dark-plant-gone)": [[14, "v1", "float"]], + + "dark-plants-all-done": [[25, "v1", "dark-plant"]], + + "(code happy-plant-opening)": [ + [76, "gp", "handle"], + [84, "gp", "handle"], + [145, "gp", "handle"], + [[167, 175], "v1", "handle"], + [179, "gp", "handle"], + [[185, 192], "s5", "handle"] + ], + + "(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-a)": [[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-d)": [[25, "t9", "(function ogre-step 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-c)": [[31, "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 water-vol-idle ogre-lava)": [[36, "v1", "art-joint-anim"]], + + "(code ogre-bridge-break)": [[10, "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-log-active)": [[30, "v1", "art-joint-anim"]], + + "(code snow-log-activate)": [[25, "v1", "art-joint-anim"]], + + "(code snow-gears-activate)": [ + [25, "v1", "art-joint-anim"], + [75, "v1", "art-joint-anim"] + ], + + "(code snow-gears-halt)": [ + [10, "v1", "art-joint-anim"], + [85, "v1", "art-joint-anim"] + ], + + "(code pov-camera-playing snowcam)": [ + [12, "v1", "art-joint-anim"], + [62, "v1", "art-joint-anim"], + [112, "v1", "art-joint-anim"], + [[242, 249], "gp", "handle"], + [274, "v1", "art-joint-anim"], + [346, "v1", "art-joint-anim"] + ], + + "(method 7 snow-fort-gate)": [ + [19, "t9", "(function process-drawable int process-drawable)"] + ], + + "(code snow-button-activate)": [[25, "v1", "art-joint-anim"]], + + "(code snow-button-deactivate)": [[26, "v1", "art-joint-anim"]], + + "(code plat-startup flutflut-plat)": [ + [62, "t9", "(function none :behavior plat)"] + ], + + "(method 7 darkecobarrel)": [ + [14, "t9", "(function darkecobarrel-base int darkecobarrel-base)"] + ], + + "(event darkecobarrel-mover-move)": [[76, "v1", "process-drawable"]], + + "(code darkecobarrel-mover-move)": [ + [10, "v1", "float"], + [29, "v1", "float"] + ], + + "(post water-vol-idle lavatube-lava)": [ + [4, "t9", "(function none :behavior lavatube-lava)"] + ], + + "darkecobarrel-mover-pos": [[135, "v1", "uint"]], + + "(code startup logo)": [[352, "v1", "art-joint-anim"]], + + "(code idle logo)": [[78, "v1", "art-joint-anim"]], + + "(method 11 training-cam)": [[21, "s5", "entity-actor"]], + + "(method 23 tra-pontoon)": [ + [9, "t9", "(function rigid-body-platform float none)"] + ], + + "(event idle scarecrow-a)": [ + [75, "v1", "process-drawable"], + [135, "gp", "target"], + [142, "gp", "target"] + ], + + "(code idle scarecrow-a)": [[14, "v1", "art-joint-anim"]], + + "(code idle scarecrow-b)": [[14, "v1", "art-joint-anim"]], + + "(code hit scarecrow-a)": [ + [30, "v1", "art-joint-anim"], + [92, "v1", "art-joint-anim"], + [143, "v1", "art-joint-anim"] + ], + + "(code hit scarecrow-b)": [ + [30, "v1", "art-joint-anim"], + [92, "v1", "art-joint-anim"], + [143, "v1", "art-joint-anim"] + ], + + "(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)"]], + + "draw-drawable-tree-tfrag": [ + [[16, 32], "v1", "drawable-inline-array-node"], + [18, "a0", "drawable-inline-array-node"], + [142, "v1", "terrain-context"], + [238, "v1", "terrain-context"], + [[38, 40], "v1", "drawable-inline-array-tfrag"], + [22, "a2", "terrain-context"], + [25, "a2", "terrain-context"], + [44, "a0", "terrain-context"], + [[128, 131], "v1", "dma-packet"], + [[224, 227], "v1", "dma-packet"] + ], + + "draw-drawable-tree-trans-tfrag": [ + [[16, 32], "v1", "drawable-inline-array-node"], + [22, "a2", "terrain-context"], + [25, "a2", "terrain-context"], + [44, "a0", "terrain-context"], + [18, "a0", "drawable-inline-array-node"], + [134, "v1", "terrain-context"], + [230, "v1", "terrain-context"], + [[120, 123], "v1", "dma-packet"], + [[216, 219], "v1", "dma-packet"] + ], + + "draw-drawable-tree-dirt-tfrag": [ + [[16, 32], "v1", "drawable-inline-array-node"], + [22, "a2", "terrain-context"], + [25, "a2", "terrain-context"], + [44, "a0", "terrain-context"], + [18, "a0", "drawable-inline-array-node"], + [134, "v1", "terrain-context"], + [230, "v1", "terrain-context"], + [[120, 123], "v1", "dma-packet"], + [[216, 219], "v1", "dma-packet"] + ], + + "draw-drawable-tree-ice-tfrag": [ + [[16, 32], "v1", "drawable-inline-array-node"], + [22, "a2", "terrain-context"], + [25, "a2", "terrain-context"], + [44, "a0", "terrain-context"], + [18, "a0", "drawable-inline-array-node"], + [134, "v1", "terrain-context"], + [230, "v1", "terrain-context"], + [[120, 123], "v1", "dma-packet"], + [[216, 219], "v1", "dma-packet"] + ], + + "(method 10 drawable-tree-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-ice-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"]], + + "tfrag-near-end-buffer": [ + [[3, 7], "a1", "dma-packet"], + [[15, 20], "a0", "(pointer vif-tag)"], + [[20, 24], "a0", "(pointer uint32)"], + [[25, 31], "a0", "(pointer vif-tag)"] + ], + + "tfrag-near-init-buffer": [ + [[11, 15], "a0", "dma-packet"], + [[21, 24], "a0", "gs-gif-tag"], + [28, "a0", "(pointer gs-test)"], + [30, "a0", "(pointer gs-reg64)"], + [[45, 50], "v1", "dma-packet"] + ], + + "tfrag-end-buffer": [ + [[3, 7], "a1", "dma-packet"], + [[13, 20], "a0", "(pointer vif-tag)"], + [[20, 24], "a0", "(pointer uint32)"], + [[25, 31], "a0", "(pointer vif-tag)"] + ], + + "tfrag-init-buffer": [ + [[11, 15], "a0", "dma-packet"], + [[21, 24], "a0", "gs-gif-tag"], + [28, "a0", "(pointer gs-test)"], + [30, "a0", "(pointer gs-reg64)"], + [[45, 50], "v1", "dma-packet"] + ], + + "add-tfrag-data": [ + [[8, 16], "a0", "dma-packet"], + [[26, 30], "v1", "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"]], + + "(anon-function 54 generic-obs)": [ + [57, "v1", "process-drawable"], + [66, "a0", "collide-shape"] + ], + + "(code manipy-idle)": [ + [58, "a1", "process-drawable"], + [73, "gp", "process-drawable"], + [79, "gp", "process-drawable"], + [109, "v1", "(pointer process)"] + ], + + "(anon-function 49 generic-obs)": [ + [25, "gp", "process-drawable"], + [30, "gp", "process-drawable"] + ], + + "ja-anim-done?": [[27, "gp", "process-drawable"]], + + "camera-pov-from": [ + [23, "gp", "process-drawable"], + [26, "gp", "process-drawable"] + ], + + "process-drawable-random-point!": [ + [29, "s4", "collide-shape"], + [33, "s4", "collide-shape"] + ], + + "launcher-init-by-other": [[134, "v0", "vector"]], + + "(method 11 launcher)": [[130, "v0", "vector"]], + + "(method 11 part-spawner)": [ + ["_stack_", 16, "res-tag"], + [62, "v0", "(pointer (pointer sparticle-launch-group))"] + ], + + "(method 11 med-res-level)": [ + ["_stack_", 16, "res-tag"], + [21, "v0", "(pointer symbol)"], + [57, "s4", "(pointer sparticle-launch-group)"] + ], + + "(anon-function 28 generic-obs)": [ + [25, "v1", "quaternion"] // code + ], + + "camera-tracker-init": [[69, "v1", "process"]], + + "camera-anim": [ + [26, "t9", "(function process function object object object object object)"] + ], + + "(event manipy-idle)": [ + [59, "t9", "(function manipy none)"], + [118, "v1", "float"], + [131, "a0", "process"], + [151, "v1", "process-drawable"], + [160, "a0", "process"], + [177, "a0", "collide-shape"], + [180, "a0", "collide-shape"], + [185, "v1", "vector"], + [313, "a0", "float"] + ], + + "command-get-trans": [[29, "s4", "target"]], + + "(trans manipy-idle)": [ + [57, "v1", "process-drawable"], + [[66, 73], "a0", "collide-shape"] + ], + + "(method 14 camera-tracker)": [ + [196, "s4", "basic"], + [202, "s4", "(function camera-tracker symbol)"], + [270, "v0", "target"] + ], + + "(event touch-tracker-idle)": [ + [105, "a0", "process"], + [129, "t9", "(function touch-tracker none)"] + ], + + "(code touch-tracker-idle)": [ + [25, "a0", "process-drawable"], + [38, "a0", "collide-shape"] + ], + + "(code part-tracker-process)": [ + [25, "gp", "process-drawable"], + [30, "gp", "process-drawable"] + ], + + "(event part-spawner-active)": [[25, "v1", "vector"]], + + "(exit launcher-active)": [[2, "v0", "sound-rpc-set-param"]], + + "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-die)": [ + [3, "v1", "collide-shape-prim-group"], + [[11, 26], "a0", "collide-shape-prim-mesh"], + [58, "v1", "art-joint-anim"], + [109, "v1", "art-joint-anim"], + [165, "v1", "art-joint-anim"], + [186, "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-dead-bounce)": [[79, "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)": [ + [45, "v1", "art-joint-anim"], + [113, "v1", "art-joint-anim"] + ], + + "(code plant-boss-root-idle)": [[17, "v1", "art-joint-anim"]], + + "(code plant-boss-eat)": [ + [22, "v1", "float"], + [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-idle)": [ + [25, "v1", "art-joint-anim"], + [177, "v1", "art-joint-anim"], + [271, "v1", "art-joint-anim"], + [304, "v1", "art-joint-anim"], + [366, "v1", "art-joint-anim"], + [404, "v1", "art-joint-anim"] + ], + + "(code plant-boss-leaf-close)": [ + [34, "v1", "art-joint-anim"], + [98, "v1", "art-joint-anim"] + ], + + "(code plant-boss-leaf-bounce)": [ + [17, "v1", "art-joint-anim"], + [72, "v1", "art-joint-anim"] + ], + + "(code plant-boss-leaf-open)": [ + [98, "v1", "art-joint-anim"], + [227, "v1", "art-joint-anim"] + ], + + "(code plant-boss-leaf-idle)": [ + [15, "v1", "art-joint-anim"], + [74, "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"]], + + "(method 7 ice-cube)": [[24, "t9", "(function nav-enemy int nav-enemy)"]], + + "(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-retract-spikes)": [[22, "v1", "art-joint-anim"]], + + "(code ice-cube-mean-turn-to-charge)": [ + [15, "v1", "art-joint-anim"], + [187, "v1", "art-joint-anim"] + ], + + "(code ice-cube-face-player)": [ + [15, "v1", "art-joint-anim"], + [187, "v1", "art-joint-anim"] + ], + + "(code ice-cube-appear-land)": [[37, "v1", "art-joint-anim"]], + + "(code nav-enemy-patrol ice-cube)": [[8, "t9", "(function none)"]], + + "(event double-lurker-top-on-shoulders)": [ + [5, "a0", "vector"], + [22, "v1", "vector"], + [24, "v1", "vector"] + ], + + "(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-both-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 nav-enemy-patrol double-lurker-top)": [[27, "t9", "(function none)"]], + + "(code nav-enemy-patrol double-lurker)": [[27, "t9", "(function none)"]], + + "double-lurker-default-event-handler": [[95, "gp", "target"]], + + "(method 51 double-lurker)": [ + [6, "v1", "collide-shape-prim-group"], + [18, "v1", "collide-shape-prim-group"], + [22, "v1", "collide-shape-prim-group"] + ], + + "(method 7 billy)": [ + [26, "t9", "(function process-drawable int process-drawable)"] + ], + + "(method 38 billy)": [[33, "t9", "(function nav-enemy none)"]], + + "(enter nav-enemy-victory billy-rat)": [[4, "v0", "(state nav-enemy)"]], + + "(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"]], + + "(method 43 billy)": [[19, "v1", "float"]], + + "(event billy-done)": [ + [15, "v1", "billy-rat"], + [19, "v1", "billy-rat"] + ], + + "(event billy-playing)": [ + [14, "v1", "float"], + [93, "s5", "billy-rat"], + [103, "v1", "float"], + [169, "v1", "billy-snack"], + [216, "v1", "billy-snack"], + [219, "v1", "billy-snack"], + [223, "v1", "billy-snack"], + [240, "s5", "billy-snack"], + [248, "v1", "handle"], + [249, "s5", "billy-snack"], + [251, "s5", "billy-snack"], + [255, "s5", "billy-snack"] + ], + + "(code lurkerworm-rise)": [[13, "v1", "art-joint-anim"]], + + "(code lurkerworm-sink)": [[10, "v1", "art-joint-anim"]], + + "(code lurkerworm-die)": [[19, "v1", "art-joint-anim"]], + + "(code lurkerworm-rest)": [ + [10, "v1", "float"], + [35, "v1", "art-joint-anim"], + [89, "v1", "float"] + ], + + "(method 7 pelican)": [ + [36, "t9", "(function process-drawable int process-drawable)"] + ], + + "pelican-fly": [ + [61, "v1", "art-joint-anim"], + [186, "v1", "art-joint-anim"] + ], + + "(code pelican-dive)": [[161, "v1", "art-joint-anim"]], + + "(code pelican-wait-at-nest)": [ + [30, "v1", "art-joint-anim"], + [118, "v1", "art-joint-anim"], + [197, "v1", "art-joint-anim"] + ], + + "(event pelican-wait-at-nest)": [[49, "v1", "process-drawable"]], + + "(code pelican-explode)": [[71, "a0", "process-drawable"]], + + "(event pelican-circle)": [[23, "v1", "float"]], + + "(code pelican-spit)": [ + [42, "gp", "handle"], + [50, "gp", "handle"], + [121, "gp", "handle"], + [143, "gp", "handle"], + [155, "gp", "handle"], + [161, "s4", "handle"], + [173, "s4", "handle"] + ], + + "(trans energyarm-no-ball)": [ + [27, "v1", "float"], + [57, "v1", "float"] + ], + + "(trans energyarm-idle)": [[21, "v1", "float"]], + + "(code energyhub-stopped)": [[11, "v1", "float"]], + + "(code energyhub-stop)": [[11, "v1", "float"]], + + "(code energyhub-idle)": [[11, "v1", "float"]], + + "(code energyarm-idle)": [ + [13, "v1", "float"], + [36, "v1", "float"] + ], + + "energyhub-set-lava-height": [ + [25, "v1", "process-drawable"], + [28, "v1", "process-drawable"] + ], + + "(post idle citb-sage)": [[3, "t9", "(function none :behavior citb-sage)"]], + + "(method 44 red-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 green-sagecage)": [[35, "t9", "(function citb-sage none)"]], + + "(method 43 red-sagecage)": [[24, "v1", "float"]], + + "(method 43 blue-sagecage)": [[24, "v1", "float"]], + + "(method 43 yellow-sagecage)": [[24, "v1", "float"]], + + "(event play-anim green-sagecage)": [[128, "s5", "process-drawable"]], + + "(method 21 citb-sagecage)": [[[27, 97], "v1", "vector"]], + + "(code citb-sagecage-idle)": [ + [9, "gp", "citb-sage"], + [15, "gp", "citb-sage"] + ], + + "add-blue-motion": [ + [25, "v1", "process-drawable"], + [34, "gp", "collide-shape"] + ], + + "(event wait eco-collectable)": [ + [118, "a0", "vector"], + [136, "a0", "vector"] + ], + + "(event pickup eco-collectable)": [ + [18, "a0", "vector"], + [[15, 21], "v1", "vector"] + ], + + "(event fuel-cell-clone-anim)": [[35, "a0", "vector"]], + + "fuel-cell-animate": [[9, "gp", "fuel-cell"]], + + "(event wait fuel-cell)": [[95, "a0", "vector"]], + + "(enter pickup fuel-cell)": [[9, "v0", "(state eco-collectable)"]], + + "(code ecovalve-idle)": [[41, "v1", "process-drawable"]], + + "(code vent-pickup)": [ + [25, "gp", "process-drawable"], + [59, "s5", "collide-shape"] + ], + + "(anon-function 69 collectables)": [ + [2, "v1", "handle"], + [5, "v1", "handle"], + [8, "v1", "handle"], + [13, "s5", "eco-collectable"], + [33, "v1", "target"], + [38, "v1", "target"], + [50, "s5", "eco-collectable"] + ], + + "fuel-cell-init-by-other": [ + [108, "v0", "fact-options"], + [118, "gp", "vector"] + ], + + "ecovalve-init-by-other": [ + [95, "a0", "process-drawable"], + [144, "v1", "process-drawable"] + ], + + "(method 11 shover)": [ + ["_stack_", 16, "res-tag"], + [120, "v0", "(pointer float)"] + ], + + "(method 11 sun-iris-door)": [ + ["_stack_", 16, "res-tag"], + [153, "v0", "(pointer float)"] + ], + + "(event sun-iris-door-closed)": [[14, "a0", "vector"]], + + "(event sun-iris-door-opening)": [[14, "a0", "vector"]], + + "(event sun-iris-door-closing)": [[14, "a0", "vector"]], + + "(event sun-iris-door-open)": [[20, "a0", "vector"]], + + "sun-iris-door-init-by-other": [[97, "v1", "art-joint-anim"]], + + "(method 7 steam-cap)": [ + [19, "t9", "(function process-drawable int process-drawable)"] + ], + + "(method 11 steam-cap)": [ + ["_stack_", 16, "res-tag"], + [139, "v0", "(pointer float)"] + ], + + "(method 11 whirlpool)": [ + ["_stack_", 16, "res-tag"], + [92, "v0", "(pointer float)"] + ], + + "(method 21 collectable)": [ + [20, "v1", "int"], + [20, "a0", "int"], + [24, "a0", "int"] + ], + + "check-blue-suck": [[25, "v1", "collide-shape"]], + + "(code die eco)": [[53, "v1", "float"]], + + "(trans pickup fuel-cell)": [ + [92, "v1", "float"], + [130, "v0", "fact-options"] + ], + + "(enter notice-blue eco-collectable)": [[13, "v1", "float"]], + + "(code pickup fuel-cell)": [ + ["_stack_", 96, "res-tag"], + [[131, 143], "v1", "(inline-array vector)"], + [438, "a0", "game-task"], + [456, "a0", "game-task"], + [474, "a0", "game-task"], + [492, "a0", "game-task"], + [509, "v1", "game-task"], + [513, "v1", "game-task"], + [517, "v1", "game-task"], + [521, "v1", "game-task"] + ], + + "(method 11 eco)": [[13, "v0", "pickup-type"]], + + "target-powerup-process": [[[200, 215], "v1", "sound-rpc-set-param"]], + + "(method 14 touching-list)": [[[0, 11], "s5", "touching-shapes-entry"]], + + "(method 13 touching-list)": [ + [[0, 51], "v0", "touching-shapes-entry"] + // [5, "v0", "touching-shapes-entry"], + // [10, "v0", "touching-shapes-entry"], + // [17, "v0", "touching-shapes-entry"], + // [26, "v0", "touching-shapes-entry"], + // [46, "v0", "touching-shapes-entry"], + // [47, "v0", "touching-shapes-entry"], + // [48, "v0", "touching-shapes-entry"], + // [50, "v0", "touching-shapes-entry"] + ], + + "(method 11 touching-list)": [ + [8, "s5", "touching-shapes-entry"], + [10, "s5", "touching-shapes-entry"], + [11, "s5", "touching-shapes-entry"], + [13, "s5", "touching-shapes-entry"], + [32, "s5", "touching-shapes-entry"], + [47, "s5", "touching-shapes-entry"], + [49, "s5", "touching-shapes-entry"], + [51, "s5", "touching-shapes-entry"] + ], + + "(method 12 touching-list)": [ + [[4, 67], "gp", "touching-shapes-entry"], + [67, "gp", "(inline-array touching-shapes-entry)"] + ], + + "(method 35 collide-shape)": [ + [23, "v1", "connection"], + [24, "s2", "collide-shape"], + [33, "s2", "collide-shape"], + [48, "s2", "collide-shape"], + [62, "v1", "process-drawable"], + [80, "s2", "collide-shape"], + [117, "v1", "connection"], + [118, "s2", "collide-shape"], + [127, "s2", "collide-shape"], + [142, "s2", "collide-shape"], + [174, "s2", "collide-shape"], + [209, "v1", "connection"], + [210, "s2", "collide-shape"], + [219, "s2", "collide-shape"], + [234, "s2", "collide-shape"], + [266, "s2", "collide-shape"], + [301, "v1", "connection"], + [302, "s2", "collide-shape"], + [311, "s2", "collide-shape"], + [326, "s2", "collide-shape"], + [358, "s2", "collide-shape"] + ], + + "(method 56 collide-shape-moving)": [[89, "v1", "target"]], + + "(method 20 collide-shape-prim-group)": [ + [40, "a0", "collide-shape-prim-group"] + ], + + "(method 25 collide-shape-prim)": [ + [43, "gp", "collide-shape-prim-group"], + [47, "gp", "collide-shape-prim-group"] + ], + + "(method 29 collide-shape-prim-group)": [ + [13, "a0", "collide-shape-prim-group"] + ], + + "(method 28 collide-shape-prim-mesh)": [ + [[22, 45], "s4", "(array collide-mesh)"] + ], + + "(method 53 collide-shape)": [[[24, 40], "v1", "collide-shape-prim-group"]], + + "(method 54 collide-shape)": [[[18, 33], "v1", "collide-shape-prim-group"]], + + "(method 45 collide-shape)": [ + [18, "v1", "connection"], + [[19, 146], "s3", "collide-shape-moving"], + [146, "v1", "connection"], + [[147, 272], "s3", "collide-shape-moving"], + [272, "v1", "connection"], + [[273, 398], "s3", "collide-shape-moving"], + [398, "v1", "connection"], + [[399, 497], "s3", "collide-shape-moving"] + ], + + "(method 55 collide-shape)": [ + [33, "s5", "process-drawable"], + [54, "s5", "process-drawable"], + [59, "s5", "process-drawable"], + [68, "s5", "process-drawable"] + ], + + "collide-shape-draw-debug-marks": [ + [24, "v1", "connection"], + [[33, 55], "s5", "collide-shape"], + [72, "v1", "connection"], + [[81, 103], "s5", "collide-shape"], + [120, "v1", "connection"], + [[129, 151], "s5", "collide-shape"], + [168, "v1", "connection"], + [[177, 199], "s5", "collide-shape"] + ], + + "(method 9 collide-edge-work)": [ + [[5, 52], "s3", "collide-edge-edge"], + [[5, 52], "s4", "collide-edge-hold-item"] + ], + + "(method 19 collide-edge-work)": [ + [150, "a1", "int"], + [150, "v1", "int"] + //[[149, 162], "a0", "collide-shape-prim-group"] + ], + + "collide-probe-make-list": [ + [18, "v1", "drawable-group"], + [29, "v1", "drawable-group"], + [45, "v1", "drawable-group"] + ], + + "(method 11 instance-tie)": [ + [28, "s1", "collide-fragment"], + [38, "s1", "collide-fragment"], + [45, "s1", "(inline-array collide-fragment)"] + ], + + "(method 12 instance-tie)": [ + [21, "s1", "collide-fragment"], + [31, "s1", "collide-fragment"], + [38, "s1", "(inline-array collide-fragment)"] + ], + + "(method 13 instance-tie)": [ + [21, "s1", "collide-fragment"], + [29, "s1", "collide-fragment"], + [36, "s1", "(inline-array collide-fragment)"] + ], + + "(method 20 collide-cache)": [ + [18, "s2", "collide-cache-prim"], + [23, "s2", "collide-cache-prim"], + [27, "s2", "collide-cache-prim"], + [33, "s2", "collide-cache-prim"], + [37, "s2", "collide-cache-prim"], + [38, "v1", "collide-shape-prim-sphere"], // could be sphere or mesh...? + [45, "s2", "collide-cache-prim"], + [48, "s2", "(inline-array collide-cache-prim)"] + ], + + "test-closest-pt-in-triangle": [ + [19, "s5", "collide-cache-tri"], + [20, "s5", "collide-cache-tri"], + [21, "s5", "collide-cache-tri"], + [26, "s5", "collide-cache-tri"], + [47, "s5", "collide-cache-tri"], + [48, "s5", "(inline-array collide-cache-tri)"] + ], + + "(method 9 collide-cache)": [ + [[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"], + [55, "gp", "collide-cache-prim"], + [36, "v1", "collide-shape-prim-sphere"] + ], + + "(method 9 collide-mesh)": [ + [[17, 62], "s5", "collide-mesh-tri"], + [62, "s5", "(inline-array collide-mesh-tri)"] + ], + + "(method 22 collide-shape-prim-mesh)": [ + [10, "s4", "collide-shape-prim-group"], + [41, "s4", "collide-shape-prim-group"] + ], + + "(method 44 collide-shape)": [[26, "a0", "process-drawable"]], + + "(method 43 collide-shape)": [ + [58, "gp", "collide-shape-moving"], + [88, "gp", "collide-shape-moving"] + ], + + "find-instance-by-name": [ + [21, "v1", "drawable-tree-instance-shrub"], + [48, "v1", "drawable-tree-instance-tie"] + ], + + "(method 63 collide-shape-moving)": [ + [[33, 53], "s0", "collide-cache-prim"], + [53, "s0", "(inline-array collide-cache-prim)"] + ], + + "target-falling-anim": [ + [51, "v1", "art-joint-anim"], + [160, "v1", "art-joint-anim"] + ], + + "target-hit-ground-anim": [ + [55, "v1", "float"], + [79, "v1", "art-joint-anim"], + [312, "v1", "art-joint-anim"], + [389, "v1", "art-joint-anim"], + [441, "v1", "art-joint-anim"], + [520, "v1", "art-joint-anim"], + [578, "v1", "art-joint-anim"], + [660, "v1", "float"], + [675, "v1", "art-joint-anim"], + [736, "v1", "art-joint-anim"], + [846, "v1", "art-joint-anim"] + ], + + "(code target-stance)": [ + [48, "v1", "art-joint-anim"], + [117, "v1", "art-joint-anim"], + [170, "v1", "art-joint-anim"], + [234, "v1", "art-joint-anim"], + [298, "v1", "art-joint-anim"], + [389, "v1", "art-joint-anim"], + [503, "v1", "art-joint-anim"], + [626, "v1", "float"] + ], + + "(code target-walk)": [ + [146, "v1", "art-joint-anim"], + [243, "v1", "art-joint-anim"], + [527, "v1", "float"], + [591, "v1", "float"] + ], + + "(code target-slide-down)": [[26, "v1", "art-joint-anim"]], + + "(code target-jump-forward)": [[13, "v1", "art-joint-anim"]], + "(code target-jump)": [[127, "v1", "float"]], + + "(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-flop)": [[13, "v1", "art-joint-anim"]], + + "(code target-duck-stance)": [ + [21, "v1", "art-joint-anim"], + [116, "v1", "art-joint-anim"], + [168, "v1", "art-joint-anim"] + ], + + "(code target-attack-uppercut)": [[39, "v1", "float"]], + + "mod-var-jump": [ + [77, "f0", "float"], + [80, "f0", "float"], + [159, "v0", "vector"] + ], + + "(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-high-jump)": [[21, "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)": [ + [34, "t9", "(function object :behavior target)"], + [40, "t9", "(function symbol object :behavior target)"] + ], + + "target-powerup-effect": [ + [267, "a0", "symbol"], + [307, "a0", "vector"] + ], + + "(method 10 water-control)": [ + [71, "a0", "collide-shape-moving"], + [147, "v1", "collide-shape-moving"], + [179, "v1", "collide-shape-moving"], + [461, "v1", "control-info"], + [473, "a0", "collide-shape-moving"], + [488, "v1", "collide-shape-moving"], + [502, "v1", "collide-shape-moving"], + [508, "v1", "collide-shape-moving"], + [580, "v1", "collide-shape-moving"], + [600, "s4", "collide-shape-moving"], + [609, "s4", "collide-shape-moving"], + [622, "s4", "collide-shape-moving"], + [627, "s4", "collide-shape-moving"], + [629, "s4", "collide-shape-moving"], + [716, "s5", "collide-shape-moving"], + [720, "s5", "collide-shape-moving"], + [721, "s5", "collide-shape-moving"], + [728, "s5", "collide-shape-moving"], + [730, "s5", "collide-shape-moving"], + [731, "s5", "collide-shape-moving"], + [744, "v1", "collide-shape-moving"], + [751, "a0", "collide-shape-moving"], + [775, "v1", "collide-shape-moving"], + [824, "a1", "collide-shape-moving"], + [826, "a0", "collide-shape-moving"], + [831, "v1", "collide-shape-moving"] + ], + + "part-water-splash-callback": [[3, "v1", "float"]], + + "(method 15 water-control)": [[42, "v1", "float"]], + + "(method 27 water-vol)": [[16, "v1", "target"]], + + "(method 26 water-vol)": [ + [19, "v1", "target"], + [33, "v1", "target"] + ], + + "(method 29 water-vol)": [ + ["_stack_", 16, "res-tag"], + [46, "v0", "(pointer float)"] + ], + + "(enter pickup racer)": [[1, "t9", "(function none :behavior racer)"]], + + "target-racing-jump-anim": [[36, "v1", "art-joint-anim"]], + + "target-racing-land-anim": [ + [23, "v1", "art-joint-anim"], + [82, "v1", "art-joint-anim"], + [144, "v1", "art-joint-anim"] + ], + + "(post target-racing-get-off-jump)": [[191, "f0", "float"]], + + "check-drop-level-rolling-dirt-finish": [[17, "v1", "float"]], + + "(code peeper-down)": [[24, "v1", "float"]], + + "(code nav-enemy-notice fleeing-nav-enemy)": [[27, "v1", "art-joint-anim"]], + + "(code lightning-mole-dive)": [[39, "v1", "art-joint-anim"]], + + "(code lightning-mole-yelp)": [[19, "v1", "art-joint-anim"]], + + "(code peeper-up)": [[10, "v1", "art-joint-anim"]], + + "(code robber-idle)": [[14, "v1", "art-joint-anim"]], + + "(code robber-initial)": [[14, "v1", "art-joint-anim"]], + + "(code robber-initial-notice)": [[43, "v1", "art-joint-anim"]], + + "(code robber-tired)": [ + [69, "v1", "art-joint-anim"], + [136, "v1", "float"] + ], + + "(code robber-flee)": [ + [69, "v1", "art-joint-anim"], + [136, "v1", "float"] + ], + + "(code robber-die)": [ + [71, "f0", "float"], + [104, "v1", "art-joint-anim"] + ], + + "target-flut-hit-ground-anim": [ + [131, "v1", "art-joint-anim"], + [204, "v1", "art-joint-anim"] + ], + + "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-air-attack)": [[98, "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-get-off-hit-ground)": [[13, "v1", "art-joint-anim"]], + + "(code target-flut-running-attack)": [ + [53, "v1", "float"], + [181, "f30", "float"], + [246, "f1", "float"], + [247, "f0", "float"], + [247, "f30", "float"], + [350, "v1", "art-joint-anim"], + [381, "f30", "float"] + ], + + "(code target-flut-double-jump)": [ + [14, "v1", "art-joint-anim"], + [78, "v1", "art-joint-anim"] + ], + + "(trans target-flut-walk)": [ + [147, "f0", "float"], + [152, "f1", "float"], + [203, "f0", "float"] + ], + + "(event target-flut-running-attack)": [ + [41, "v1", "process-drawable"], + [53, "v1", "collide-shape"], + [59, "v1", "collide-shape"] + ], + + "(code target-flut-get-on)": [ + [62, "s4", "process-drawable"], + [69, "s4", "process-drawable"], + [88, "s4", "process-drawable"], + [93, "s4", "process-drawable"] + ], + + "(code target-flut-get-off-jump)": [ + [55, "s3", "process-drawable"], + [59, "s3", "process-drawable"], + [74, "s3", "process-drawable"], + [93, "s3", "process-drawable"], + [98, "s3", "process-drawable"], + [145, "v1", "art-joint-anim"] + ], + + "(event target-flut-grab)": [[24, "a0", "process-drawable"]], + + "(post target-racing-get-on)": [ + [76, "f0", "float"], + [88, "f0", "float"], + [92, "f1", "float"] + ], + + "target-death-anim": [[18, "v1", "art-joint-anim"]], + + "target-hit-setup-anim": [ + [90, "v1", "art-joint-anim"], + [164, "v1", "art-joint-anim"] + ], + + "(anon-function 1 target-death)": [ + [12, "gp", "process-drawable"], + [16, "gp", "process-drawable"] + ], + + "next-level": [ + [7, "a1", "level-load-info"], + [10, "a1", "level-load-info"] + ], + + "target-generic-event-handler": [ + [10, "v1", "float"], + [297, "v1", "float"], + [308, "a0", "vector"], + [562, "v1", "(state object object object object target)"] + ], + + "target-standard-event-handler": [ + [167, "a0", "process"], + [182, "a0", "process"], + [197, "a0", "process"], + [223, "a0", "process"], + [242, "a0", "process"], + [257, "a0", "process"], + [272, "a0", "process"], + [280, "a1", "process"], + [303, "a0", "process"], + [330, "a0", "process"] + ], + + "(code target-load-wait)": [ + [21, "v1", "art-joint-anim"], + [138, "v1", "art-joint-anim"], + [196, "v1", "art-joint-anim"] + ], + + "(code target-grab)": [ + [133, "v1", "art-joint-anim"], + [185, "v1", "art-joint-anim"], + [322, "v1", "art-joint-anim"], + [475, "v1", "art-joint-anim"] + ], + + "(code target-pole-cycle)": [ + [87, "v1", "art-joint-anim"], + [148, "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-eco-powerup)": [ + [32, "v1", "art-joint-anim"], + [47, "v1", "float"], + [215, "v1", "float"] + ], + + "(code target-swim-stance)": [ + [31, "v1", "art-joint-anim"], + [52, "v1", "float"], + [89, "v1", "float"] + ], + + "(event target-swim-down)": [ + [9, "v1", "attack-info"], + [13, "v1", "attack-info"], + [18, "v1", "attack-info"], + [23, "v1", "attack-info"], + [38, "v1", "attack-info"], + [39, "v1", "attack-info"], + [41, "v1", "attack-info"] + ], + + "(code target-swim-walk)": [ + [54, "v1", "art-joint-anim"], + [140, "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-play-anim)": [[8, "v0", "art-joint-anim"]], + + "(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-right-func": [ + [16, "s5", "first-person-hud"], + [42, "s5", "first-person-hud"], + [46, "s5", "first-person-hud"], + [50, "s5", "first-person-hud"], + [59, "s5", "first-person-hud"] + ], + + "part-first-person-hud-left-func": [ + [16, "s5", "first-person-hud"], + [43, "s5", "first-person-hud"], + [47, "s5", "first-person-hud"], + [51, "s5", "first-person-hud"], + [60, "s5", "first-person-hud"] + ], + + "(event target-grab)": [ + [30, "a0", "process"], + [48, "a0", "process"], + [56, "a1", "process"] + ], + + "(code target-periscope)": [ + [25, "v1", "process-drawable"], + [49, "v1", "art-joint-anim"], + [130, "v1", "art-joint-anim"] + ], + + "(code target-swim-up)": [[17, "v1", "art-joint-anim"]], + + "(code target-yellow-blast)": [ + [161, "gp", "handle"], + [176, "v1", "art-joint-anim"], + [219, "gp", "handle"] + ], + + "(code target-edge-grab)": [ + [143, "v1", "art-joint-anim"], + [198, "v1", "art-joint-anim"] + ], + + "(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)"]], + + "flatten-joint-control-to-spr": [ + [14, "a1", "pointer"], + [[66, 108], "a1", "(inline-array vector)"], + [[36, 38], "a1", "(inline-array vector)"], + [[39, 60], "a1", "(inline-array vector)"], + [38, "a1", "pointer"], + [[15, 37], "a1", "(inline-array vector)"], + [56, "a2", "(pointer float)"], + [120, "a0", "terrain-context"], + [154, "a0", "terrain-context"], + [189, "a1", "terrain-context"], + [184, "v1", "terrain-context"], + [172, "a1", "terrain-context"] + ], + + "matrix-from-control-pair!": [[18, "a0", "terrain-context"]], + + "cspace<-matrix-no-push-joint!": [[4, "a0", "terrain-context"]], + + "make-joint-jump-tables": [ + [5, "a0", "terrain-context"], + [11, "a0", "terrain-context"], + [17, "a0", "terrain-context"], + [23, "a0", "terrain-context"], + [29, "a0", "terrain-context"], + [35, "a0", "terrain-context"], + [41, "a0", "terrain-context"], + [47, "a0", "terrain-context"], + [53, "a0", "terrain-context"], + [59, "a0", "terrain-context"], + [65, "a0", "terrain-context"], + [71, "a0", "terrain-context"], + [77, "a0", "terrain-context"], + [83, "a0", "terrain-context"], + [89, "a0", "terrain-context"], + [95, "a0", "terrain-context"], + [101, "a0", "terrain-context"], + [107, "a0", "terrain-context"], + [113, "a0", "terrain-context"], + [119, "a0", "terrain-context"], + [125, "a0", "terrain-context"], + [131, "a0", "terrain-context"], + [137, "a0", "terrain-context"], + [143, "a0", "terrain-context"], + [149, "a0", "terrain-context"], + [155, "a0", "terrain-context"], + [161, "a0", "terrain-context"], + [167, "a0", "terrain-context"], + [173, "a0", "terrain-context"], + [179, "a0", "terrain-context"], + [185, "a0", "terrain-context"], + [191, "a0", "terrain-context"], + [197, "a0", "terrain-context"], + [203, "a0", "terrain-context"], + [209, "a0", "terrain-context"], + [215, "a0", "terrain-context"], + [221, "a0", "terrain-context"], + [227, "a0", "terrain-context"], + [233, "a0", "terrain-context"], + [239, "a0", "terrain-context"], + [245, "a0", "terrain-context"], + [251, "a0", "terrain-context"], + [257, "a0", "terrain-context"], + [263, "a0", "terrain-context"], + [269, "a0", "terrain-context"], + [275, "a0", "terrain-context"], + [281, "a0", "terrain-context"], + [287, "a0", "terrain-context"] + ], + + "find-instance-by-index": [ + [26, "t1", "drawable-tree-instance-shrub"], + [40, "t1", "drawable-tree-instance-tie"] + ], + + "draw-instance-info": [ + [224, "s1", "drawable-group"], + [143, "v1", "prototype-shrubbery"], + [148, "v1", "prototype-shrubbery"], + [299, "v1", "prototype-tie"], + [318, "v1", "prototype-tie"] + ], + + "(method 24 ram-boss-proj)": [ + [64, "v0", "sound-rpc-set-param"], + [83, "gp", "process-drawable"], + [86, "gp", "process-drawable"] + ], + + "ram-boss-on-ground-event-handler": [[260, "v1", "ram-boss-proj"]], + + "(method 52 ram-boss)": [ + [11, "v1", "(array collide-shape-prim)"], + [21, "v1", "(array collide-shape-prim)"], + [31, "v1", "(array collide-shape-prim)"], + [41, "v1", "(array collide-shape-prim)"] + ], + + "(method 53 ram-boss)": [ + [2, "v1", "(array collide-shape-prim)"], + [5, "v1", "(array collide-shape-prim)"], + [8, "v1", "(array collide-shape-prim)"], + [11, "v1", "(array collide-shape-prim)"] + ], + + "(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-hit-ground)": [[23, "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 nav-enemy-victory ram-boss)": [[28, "v1", "art-joint-anim"]], + + "(code ram-boss-lose-shield)": [[29, "v1", "art-joint-anim"]], + + "(code ram-boss-throw)": [ + [16, "v1", "art-joint-anim"], + [67, "v1", "art-joint-anim"] + ], + + "(method 56 ram-boss)": [[58, "v1", "(pointer ram-boss-proj)"]], + + "(code ram-idle)": [ + [28, "v1", "art-joint-anim"], + [98, "v1", "art-joint-anim"] + ], + + "(code ram-give-fuel-cell)": [[69, "v1", "(pointer snowcam)"]], + + "(code snow-bumper-deactivate)": [ + [29, "v1", "art-joint-anim"], + [106, "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"]], + + "(method 7 snow-bumper)": [ + [14, "t9", "(function process-drawable int process-drawable)"] + ], + + "(method 11 snow-bumper)": [ + ["_stack_", 16, "res-tag"], + [216, "v0", "(pointer float)"] + ], + + "(code spider-egg-idle)": [ + [20, "v1", "art-joint-anim"], + [97, "v1", "art-joint-anim"], + [153, "v1", "art-joint-anim"] + ], + + "(code spider-egg-hatch)": [[62, "v1", "art-joint-anim"]], + + "(code spider-egg-die)": [[79, "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 25 puffer)": [ + [49, "v1", "puffer"], + [56, "v1", "puffer"] + ], + + "(method 23 puffer)": [[18, "v1", "process-drawable"]], + + "(trans puffer-attack)": [[23, "v1", "collide-shape-prim-group"]], + + "(method 30 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)"] + ], + + "(method 11 puffer)": [ + ["_stack_", 16, "res-tag"], + [213, "v0", "(pointer float)"] + ], + + "driller-lurker-default-event-handler": [ + [[51, 87], "s1", "touching-shapes-entry"] + ], + + "(code driller-lurker-idle-drilling)": [[33, "v1", "art-joint-anim"]], + + "(code driller-lurker-jammed-standing)": [[14, "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)"] + ], + + "(method 11 driller-lurker)": [ + ["_stack_", 16, "res-tag"], + [373, "v0", "(pointer float)"] + ], + + "kermit-short-hop": [[10, "v1", "art-joint-anim"]], + + "kermit-long-hop": [[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)": [[14, "v1", "art-joint-anim"]], + + "(code kermit-attack)": [[22, "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)"]], + + "(code falling gnawer-falling-segment)": [ + [16, "v1", "art-joint-anim"], + [70, "v1", "art-joint-anim"] + ], + + "(method 22 gnawer)": [[18, "f0", "float"]], + + "(code gnawer-chewing-on-post)": [ + [139, "v1", "art-joint-anim"], + [210, "v1", "art-joint-anim"], + [272, "v1", "art-joint-anim"], + [363, "v1", "art-joint-anim"], + [451, "v1", "art-joint-anim"] + ], + + "(code gnawer-retreat-into-post)": [[18, "v1", "art-joint-anim"]], + + "(code gnawer-die)": [[28, "v1", "art-joint-anim"]], + + "(event gnawer-run)": [[54, "a2", "touching-shapes-entry"]], + + "(method 7 gnawer)": [[19, "t9", "(function nav-enemy int nav-enemy)"]], + + "(code gnawer-give-fuel-cell)": [ + [43, "v0", "maincavecam"], + [64, "v1", "maincavecam"] + ], + + "(method 11 gnawer)": [ + ["_stack_", 16, "res-tag"], + ["_stack_", 32, "res-tag"], + ["_stack_", 48, "res-tag"], + [361, "v0", "(pointer float)"], + [426, "v0", "(pointer int32)"], + [446, "v0", "(pointer int32)"] + ], + + "(code mother-spider-egg-falling)": [[14, "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-while-falling)": [[63, "v1", "art-joint-anim"]], + + "(code mother-spider-egg-on-ground)": [ + [50, "v1", "art-joint-anim"], + [124, "v1", "art-joint-anim"] + ], + + "(method 7 swamp-blimp)": [ + [19, "t9", "(function process-drawable int process-drawable)"] + ], + + "(code swamp-tetherrock-break)": [ + [238, "s4", "handle"], + [261, "s4", "handle"], + [283, "s4", "handle"], + [300, "s4", "handle"], + [373, "a0", "swamp-blimp"] + ], + + "(event swamp-tetherrock-idle)": [[55, "gp", "process-drawable"]], + + "(code swamp-rope-break)": [ + [10, "v1", "float"], + [26, "v1", "float"], + [48, "v1", "float"], + [64, "v1", "art-joint-anim"] + ], + + "swamp-rope-trans": [ + [40, "v1", "swamp-rope"], + [48, "v1", "swamp-rope"] + ], + + "(code swamp-rope-idle-arm)": [[13, "v1", "swamp-rope"]], + + "swamp-blimp-setup": [[[26, 117], "s4", "swamp-rope"]], + + "(code swamp-rope-idle-rock)": [ + [32, "a0", "swamp-rope"], + [33, "a0", "swamp-rope"] + ], + + "(code mistycannon-missile-idle)": [ + [110, "v0", "sound-rpc-set-param"], + [207, "v1", "art-joint-anim"], + [257, "v1", "art-joint-anim"] + ], + + "(event mistycannon-missile-explode)": [[16, "v1", "mistycannon-missile"]], + + "(code cam-mistycannon)": [ + [3, "a1", "mistycannon"], + [9, "v1", "mistycannon"] + ], + + "(method 26 citb-plat)": [ + [18, "v1", "vector"], + [47, "v1", "vector"] + ], + + "(method 23 citb-chain-plat)": [ + [9, "t9", "(function rigid-body-platform float none)"] + ], + + "(code citb-firehose-blast)": [ + [10, "v1", "art-joint-anim"], + [86, "v1", "art-joint-anim"], + [157, "v1", "art-joint-anim"] + ], + + "(trans plat-button-move-downward citb-exit-plat)": [ + [10, "v0", "(state plat-button)"] + ], + + "(trans plat-button-move-upward citb-exit-plat)": [ + [10, "v0", "(state plat-button)"] + ], + + "(code darkvine-idle)": [[32, "v1", "art-joint-anim"]], + + "(code darkvine-retreat)": [ + [23, "v1", "art-joint-anim"], + [138, "v1", "art-joint-anim"] + ], + + "(enter cam-periscope)": [ + [7, "a1", "periscope"], + [13, "a1", "periscope"], + [16, "v1", "periscope"] + ], + + "(code cam-periscope)": [ + [2, "v1", "periscope"], + [4, "v1", "periscope"], + [12, "v1", "periscope"], + [71, "v1", "periscope"], + [79, "v1", "periscope"] + ], + + "periscope-crosshair": [[50, "v1", "periscope"]], + + "periscope-find-next": [[58, "v1", "vector"]], + + "(code reflector-origin-idle)": [[60, "v1", "periscope"]], + + "(code periscope-player-control)": [ + [41, "v0", "(pointer float)"], + [508, "gp", "handle"] + ], + + "quicksandlurker-post": [ + [50, "a0", "water-anim"], + [54, "a0", "water-anim"] + ], + + "(code quicksandlurker-wait)": [ + [33, "v1", "art-joint-anim"], + [89, "v1", "art-joint-anim"] + ], + + "(code quicksandlurker-yawn)": [[10, "v1", "art-joint-anim"]], + + "(code quicksandlurker-track)": [[29, "v1", "art-joint-anim"]], + + "(code quicksandlurker-attack)": [[12, "v1", "art-joint-anim"]], + + "(code quicksandlurker-hide)": [[14, "v1", "art-joint-anim"]], + + "(code quicksandlurker-popup)": [[38, "v1", "art-joint-anim"]], + + "(code quicksandlurker-die)": [[18, "v1", "art-joint-anim"]], + + "(code quicksandlurker-victory)": [ + [18, "v1", "art-joint-anim"], + [69, "v1", "art-joint-anim"] + ], + + "(method 7 balloonlurker)": [ + [29, "t9", "(function process-drawable int process-drawable)"] + ], + + "(code balloonlurker-pilot-die)": [[58, "v1", "art-joint-anim"]], + + "(code orbit-plat-bottom-idle)": [ + [29, "v1", "orbit-plat"], + [35, "v1", "orbit-plat"], + [109, "v1", "orbit-plat"], + [126, "v1", "orbit-plat"] + ], + + "(method 27 orbit-plat)": [ + [20, "s5", "orbit-plat"], + [29, "s5", "orbit-plat"], + [33, "s5", "orbit-plat"], + [40, "s5", "orbit-plat"], + [44, "s5", "orbit-plat"], + [72, "a2", "orbit-plat"], + [153, "a1", "orbit-plat"] + ], + + "(code mother-spider-leg-flying)": [ + [21, "v1", "art-joint-anim"], + [80, "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-die)": [[36, "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-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"]], + + "mother-spider-default-event-handler": [ + [52, "a0", "process-drawable"], + [138, "a0", "process-drawable"] + ], + + "mother-spider-death-event-handler": [[7, "a0", "process-drawable"]], + + "(code bully-broken-cage-explode)": [[14, "v1", "art-joint-anim"]], + + "(code bully-notice)": [[148, "v1", "art-joint-anim"]], + + "(code bully-start-spinning)": [[14, "v1", "art-joint-anim"]], + + "(code bully-die)": [[70, "v1", "art-joint-anim"]], + + "bully-default-event-handler": [[21, "gp", "process-drawable"]], + + "(trans bully-notice)": [[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"]], + + "(method 7 bully)": [ + [14, "t9", "(function process-drawable int process-drawable)"] + ], + + "(enter seagull-idle)": [[20, "v1", "float"]], + + "seagull-init-by-other": [[96, "v1", "float"]], + + "seagull-reaction": [ + [36, "s4", "seagull"], + [38, "s4", "seagull"] + ], + + "beach-rock-trigger": [[5, "v0", "seagullflock"]], + + "(method 11 seagullflock)": [ + [80, "v1", "float"], + [99, "v1", "float"] + ], + + "(code seagull-flying)": [ + [13, "v1", "art-joint-anim"], + [373, "v1", "float"] + ], + + "(code seagull-soaring)": [ + [15, "v1", "art-joint-anim"], + [296, "v1", "float"] + ], + + "(method 26 seagull)": [ + [12, "v1", "float"], + [33, "v1", "float"], + [54, "v1", "float"] + ], + + "(code seagull-idle)": [ + [51, "v1", "float"], + [67, "v1", "float"], + [143, "v1", "float"], + [218, "v1", "float"] + ], + + "(code target-ice-stance)": [ + [42, "v1", "art-joint-anim"], + [108, "v1", "art-joint-anim"], + [159, "v1", "art-joint-anim"], + [221, "v1", "art-joint-anim"], + [283, "v1", "art-joint-anim"], + [370, "v1", "art-joint-anim"], + [479, "v1", "art-joint-anim"] + ], + + "bones-set-sqwc": [[2, "v1", "dma-bank-control"]], + "bones-reset-sqwc": [[2, "v1", "dma-bank-control"]], + + "bones-init": [ + [2, "a2", "terrain-context"], + [59, "a0", "(pointer int64)"], + [9, "a2", "bone-memory"], + [13, "a2", "bone-memory"], + [17, "a2", "bone-memory"], + [21, "a2", "bone-memory"], + [25, "a2", "bone-memory"], + [29, "a2", "bone-memory"], + [[31, 39], "v1", "bone-memory"] + ], + + "draw-bones-mtx-calc": [[[5, 8], "t2", "bone-memory"]], + + "bones-mtx-calc-execute": [ + [[18, 45], "v1", "bone-memory"], + [[90, 108], "v1", "(inline-array matrix)"], + [47, "a0", "dma-bank-control"], + [118, "a0", "dma-bank-control"], + [[89, 112], "a1", "(inline-array vector)"] + ], + + "bones-wrapup": [ + [[3, 26], "v1", "bone-memory"], + [[9, 12], "a1", "dma-packet"] + ], + + "texscroll-make-request": [[[9, 39], "a1", "mei-texture-scroll"]], + + "texscroll-execute": [ + [[25, 31], "a1", "mei-texture-scroll"], + [[15, 52], "a2", "merc-fragment-control"], + [[20, 24], "t1", "merc-fragment"], + [[26, 40], "t1", "(pointer int8)"], + [19, "t1", "pointer"] + ], + + "draw-bones": [ + [[50, 53], "t4", "bone-memory"], + [[110, 123], "v1", "vu-lights"], + [199, "v1", "mei-texture-scroll"], + [334, "v1", "merc-extra-info"], + [357, "a0", "(pointer int8)"], + [[38, 43], "a2", "bone-regs"], + [545, "s2", "int"], + [49, "a1", "bone-calculation"], + [262, "s2", "(pointer uint32)"], + [89, "at", "terrain-context"], + [[312, 334], "v1", "mei-envmap-tint"], + [363, "a0", "(pointer uint8)"] + ], + + "draw-bones-hud": [ + [[14, 19], "t0", "bone-regs"], + [25, "a2", "bone-calculation"], + [[26, 29], "t6", "bone-memory"], + [[73, 89], "t2", "vu-lights"], + [89, "t1", "vu-lights"], + [78, "t1", "pointer"], + [49, "at", "terrain-context"] + ], + + "joint-mod-tracker-callback": [[[3, 99], "s4", "joint-mod-tracker"]], + + "(method 7 snow-ball)": [ + [26, "t9", "(function process-drawable int process-drawable)"] + ], + + "(method 11 mistycannon)": [ + ["_stack_", 16, "res-tag"], + ["_stack_", 32, "res-tag"], + ["_stack_", 48, "res-tag"], + [337, "v0", "(pointer float)"], + [367, "v0", "(pointer float)"] + ], + + "quicksandlurker-missile-init-by-other": [[76, "a0", "process-drawable"]], + + "mother-spider-full-joint-callback": [ + [[10, 48], "v1", "mother-spider-thread"] + ], + + "(method 11 mother-spider)": [ + ["_stack_", 16, "res-tag"], + [[500, 525], "v0", "(pointer float)"] + ], + + "(method 21 mother-spider)": [[179, "s3", "collide-shape-prim-group"]], + + "(method 11 plane-volume)": [[14, "f2", "float"]], + + "(method 9 plane-volume)": [[245, "f2", "float"]], + + "(method 21 helix-water)": [[27, "a0", "process-drawable"]], + + "(method 7 helix-water)": [ + [14, "t9", "(function process-drawable int process-drawable)"] + ], + + "(code helix-button-activate)": [[58, "v1", "(pointer sunkencam)"]], + + "(code target-flut-jump)": [[137, "v1", "float"]], + + "tie-init-engine": [ + [[14, 18], "a0", "dma-packet"], + [[24, 28], "a0", "gs-gif-tag"], + [31, "a0", "(pointer gs-test)"], + [33, "a0", "(pointer gs-reg64)"], + [[43, 51], "a0", "dma-packet"], + [[64, 69], "a0", "dma-packet"], + [[74, 78], "a0", "dma-packet"], + [[82, 89], "v1", "(inline-array vector4w)"], + [[89, 97], "v1", "(pointer vif-tag)"] + ], + + "tie-end-buffer": [ + [[6, 10], "a1", "dma-packet"], + [[16, 19], "a1", "gs-gif-tag"], + [24, "a1", "(pointer gs-test)"], + [26, "a1", "(pointer gs-reg64)"], + [[32, 36], "a1", "dma-packet"], + [[41, 52], "a0", "(pointer vif-tag)"] + ], + + "tie-ints": [[[3, 30], "gp", "(pointer uint32)"]], + + "tie-floats": [[[3, 73], "gp", "(pointer uint32)"]], + + "tie-init-buffers": [ + [[29, 32], "v1", "dma-packet"], + [[59, 62], "a0", "dma-packet"], + [65, "a0", "(pointer uint32)"], + [[96, 99], "v1", "dma-packet"], + [[126, 129], "a0", "dma-packet"], + [132, "a0", "(pointer uint32)"], + [[163, 166], "v1", "dma-packet"], + [[193, 196], "a0", "dma-packet"], + [199, "a0", "(pointer uint32)"], + [[230, 233], "v1", "dma-packet"], + [[260, 263], "a0", "dma-packet"], + [266, "a0", "(pointer uint32)"] + ], + + "draw-drawable-tree-instance-tie": [ + [[23, 36], "v1", "drawable-inline-array-node"], + [25, "a0", "drawable-inline-array-node"], + [61, "v1", "drawable-inline-array-instance-tie"], + [74, "v1", "drawable-inline-array-node"], + [84, "v1", "int"], + [86, "a0", "int"], + [66, "a1", "terrain-context"], + [[363, 366], "v1", "dma-packet"], + [[484, 487], "v1", "dma-packet"] + ], + + "(method 10 drawable-tree-instance-tie)": [[3, "a1", "terrain-context"]], + + "(method 14 drawable-tree-instance-tie)": [ + [[47, 62], "t1", "tie-fragment"], + [[102, 117], "t1", "tie-fragment"], + [[150, 165], "a1", "tie-fragment"] + ], + + "(method 11 drawable-inline-array-instance-tie)": [ + [[1, 6], "v1", "instance-tie"] + ], + + "(method 12 drawable-inline-array-instance-tie)": [ + [[1, 6], "v1", "instance-tie"] + ], + + "(method 13 drawable-inline-array-instance-tie)": [ + [[1, 6], "v1", "instance-tie"] + ], + + "(method 10 drawable-tree-array)": [[4, "v1", "terrain-context"]], + + "(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"], + [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"]], + + "(method 11 sunken-pipegame)": [ + [189, "a1", "collectable"], + [280, "s0", "collectable"], + [371, "s0", "collectable"], + [[407, 409], "v1", "(pointer sunken-pipegame-button)"] + ], + + "(method 7 sunken-pipegame)": [ + [33, "t9", "(function process-drawable int process-drawable)"] + ], + + "(code sunken-pipegame-begin-play)": [ + [179, "v1", "float"], + [260, "v1", "float"], + [519, "v1", "float"], + [596, "v1", "float"] + ], + + "(method 22 sunken-pipegame)": [ + [20, "v1", "collectable"], + [25, "v1", "collectable"], + [54, "v1", "collectable"], + [59, "v1", "collectable"] + ], + + "(enter exit-chamber-lower)": [[14, "v1", "fuel-cell"]], + + "(code exit-chamber-lower)": [ + [29, "v1", "sunkencam"], + [50, "v1", "art-joint-anim"], + [162, "v1", "art-joint-anim"], + [241, "v1", "art-joint-anim"], + [308, "v1", "fuel-cell"] + ], + + "(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"]], + + "(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"]], + + "(method 32 sequenceA-village1)": [ + [[103, 111], "v1", "handle"], + [[125, 133], "v1", "handle"] + ], + + "(exit play-anim sequenceA-village1)": [ + [[12, 20], "v1", "handle"], + [[28, 36], "v1", "handle"] + ], + + "(event play-anim sequenceA-village1)": [ + [[64, 72], "v1", "handle"], + [[86, 94], "v1", "handle"], + [[108, 116], "v1", "handle"] + ], + + "(code hud-collecting)": [ + [[2, 10], "v1", "handle"], + [13, "s4", "hud"], + [25, "s4", "hud"], + [27, "s4", "hud"] + ], + + "(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"]], + + "(method 0 joint-exploder-tuning)": [ + [[6, 50], "v0", "joint-exploder-tuning"] + ], + + "(method 23 joint-exploder)": [ + [[12, 102], "s3", "joint-exploder-joint"], + [[144, 146], "v1", "joint-exploder-list"], + [148, "v1", "matrix"], + [152, "v1", "matrix"] + ], + + "(method 20 joint-exploder)": [ + [[8, 10], "a3", "joint-exploder-joint"], + [15, "v1", "joint-exploder-joint"] + ], + + "(method 27 joint-exploder)": [ + [41, "s0", "joint-exploder-joint"], + [90, "s0", "joint-exploder-joint"], + [139, "s0", "joint-exploder-joint"] + ], + + "(method 25 joint-exploder)": [[[16, 54], "s2", "joint-exploder-joint"]], + + "(method 22 joint-exploder)": [[[18, 78], "s5", "joint-exploder-joint"]], + + "joint-exploder-joint-callback": [[[10, 18], "v1", "joint-exploder-joint"]], + + "(method 24 joint-exploder)": [[[12, 19], "v1", "joint-exploder-joint"]], + + "(method 26 joint-exploder)": [ + [[5, 8], "a2", "joint-exploder-joint"], + [18, "v1", "joint-exploder-joint"], + [28, "v1", "joint-exploder-joint"] + ], + + "racer-effects": [[739, "v0", "sound-rpc-set-param"]], + + "(code target-tube)": [[31, "v1", "art-joint-anim"]], + + "(event slide-control-ride slide-control)": [ + [24, "gp", "process-drawable"], + [31, "v1", "vector"], + [35, "v1", "vector"], + [39, "v1", "vector"] + ], + + "(code target-tube-start)": [[110, "v1", "float"]], + + "depth-cue-set-stencil": [ + [[1, 7], "t1", "dma-packet"], + [[10, 16], "t1", "gs-gif-tag"], + [27, "t1", "(pointer gs-xy-offset)"], + [29, "t1", "(pointer gs-reg64)"], + [34, "t1", "(pointer gs-frame)"], + [36, "t1", "(pointer gs-reg64)"], + [38, "t1", "(pointer gs-test)"], + [40, "t1", "(pointer gs-reg64)"], + [[43, 53], "a3", "(inline-array vector4w)"], + [[52, 80], "v0", "(inline-array vector4w)"] + ], + + "depth-cue-draw-front": [ + [[26, 32], "t6", "dma-packet"], + [[33, 41], "t6", "gs-gif-tag"], + [49, "t6", "(pointer gs-xy-offset)"], + [51, "t6", "(pointer gs-reg64)"], + [56, "t6", "(pointer gs-frame)"], + [58, "t6", "(pointer gs-reg64)"], + [64, "t6", "(pointer gs-tex0)"], + [66, "t6", "(pointer gs-reg64)"], + [68, "t6", "(pointer gs-test)"], + [70, "t6", "(pointer gs-reg64)"], + [71, "t6", "(pointer gs-alpha)"], + [73, "t6", "(pointer gs-reg64)"], + [[76, 109], "t5", "(inline-array vector4w)"], + [112, "t5", "depth-cue-work"], + [[115, 121], "t6", "dma-packet"], + [[122, 130], "t6", "gs-gif-tag"], + [137, "t6", "(pointer gs-xy-offset)"], + [139, "t6", "(pointer gs-reg64)"], + [144, "t6", "(pointer gs-frame)"], + [146, "t6", "(pointer gs-reg64)"], + [148, "t6", "(pointer gs-texa)"], + [150, "t6", "(pointer gs-reg64)"], + [156, "t6", "(pointer gs-tex0)"], + [158, "t6", "(pointer gs-reg64)"], + [160, "t6", "(pointer gs-alpha)"], + [162, "t6", "(pointer gs-reg64)"], + [[165, 190], "t5", "(inline-array vector4w)"], + [[191, 201], "t5", "vector4w"], + [201, "t5", "depth-cue-work"] + ], + + "depth-cue-draw-depth": [ + [[26, 32], "t6", "dma-packet"], + [[33, 41], "t6", "gs-gif-tag"], + [49, "t6", "(pointer gs-xy-offset)"], + [51, "t6", "(pointer gs-reg64)"], + [56, "t6", "(pointer gs-frame)"], + [58, "t6", "(pointer gs-reg64)"], + [64, "t6", "(pointer gs-tex0)"], + [66, "t6", "(pointer gs-reg64)"], + [68, "t6", "(pointer gs-test)"], + [70, "t6", "(pointer gs-reg64)"], + [[73, 106], "t5", "(inline-array vector4w)"], + [109, "t5", "depth-cue-work"], + [[112, 118], "t6", "dma-packet"], + [[121, 127], "t6", "gs-gif-tag"], + [134, "t6", "(pointer gs-xy-offset)"], + [136, "t6", "(pointer gs-reg64)"], + [141, "t6", "(pointer gs-frame)"], + [143, "t6", "(pointer gs-reg64)"], + [149, "t6", "(pointer gs-tex0)"], + [151, "t6", "(pointer gs-reg64)"], + [153, "t6", "(pointer gs-test)"], + [155, "t6", "(pointer gs-reg64)"], + [[158, 183], "t5", "(inline-array vector4w)"], + [[184, 193], "t5", "vector4w"], + [194, "t5", "depth-cue-work"] + ], + + "depth-cue": [ + [[22, 28], "a2", "dma-packet"], + [[31, 37], "a2", "gs-gif-tag"], + [42, "a2", "(pointer gs-test)"], + [44, "a2", "(pointer gs-reg64)"], + [46, "a2", "(pointer gs-zbuf)"], + [48, "a2", "(pointer gs-reg64)"], + [50, "a2", "(pointer gs-reg64)"], + [52, "a2", "(pointer gs-reg64)"], + [53, "a2", "(pointer gs-tex1)"], + [55, "a2", "(pointer gs-reg64)"], + [62, "a2", "(pointer gs-clamp)"], + [64, "a2", "(pointer gs-reg64)"], + [66, "a2", "(pointer gs-reg64)"], + [68, "a2", "(pointer gs-reg64)"], + [[94, 100], "a0", "dma-packet"], + [[103, 109], "a0", "gs-gif-tag"], + [120, "a0", "(pointer gs-xy-offset)"], + [122, "a0", "(pointer gs-reg64)"], + [127, "a0", "(pointer gs-frame)"], + [129, "a0", "(pointer gs-reg64)"], + [[133, 138], "v1", "dma-packet"] + ], + + "collide-probe-collide-fragment-tree-make-list": [ + [5, "v1", "drawable-inline-array-node"] + ], + + "collide-probe-instance-tie-tree-make-list": [ + [[5, 7], "v1", "drawable-inline-array-node"], + [[18, 20], "v1", "drawable-inline-array-instance-tie"] + ], + + "collide-upload-vu0": [ + [16, "a0", "dma-packet"], + [17, "a0", "(pointer uint64)"] + ], + + "collide-probe-make-list": [ + [[20, 22], "v1", "drawable-inline-array-node"], + [[31, 33], "v1", "drawable-inline-array-instance-tie"], + [[47, 49], "v1", "drawable-inline-array-node"] + ], + + "(method 21 collide-cache)": [ + [114, "a0", "(pointer int32)"], + [156, "t0", "(pointer int32)"], + [190, "v1", "(pointer int32)"], + [147, "v1", "collide-list-item"], + [148, "v1", "collide-list-item"], + [[91, 95], "v1", "dma-packet"], + [[112, 141], "v1", "dma-bank-spr"], + [[154, 188], "a2", "dma-bank-spr"], + [[217, 227], "s3", "collide-list-item"] + ], + + "(method 23 collide-shape-prim-sphere)": [ + [[74, 114], "s4", "collide-shape-prim-mesh"] + ], + + "(method 13 collide-mesh)": [ + [[0, 60], "a3", "(inline-array vector)"], + [[61, 123], "v1", "collide-mesh-tri"] + ], + + "(method 20 collide-shape-prim-group)": [ + [5, "gp", "pointer"], + [6, "v1", "(pointer collide-shape-prim)"], + [[7, 14], "a0", "collide-shape-prim"], + [32, "gp", "pointer"], + [33, "v1", "(pointer collide-shape-prim)"], + [[34, 40], "a0", "collide-shape-prim"], + [[40, 46], "a0", "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)": [ + [21, "a0", "connection"], + [[22, 40], "a0", "collide-shape-moving"], + [85, "a0", "connection"], + [[86, 104], "a0", "collide-shape-moving"], + [147, "a0", "connection"], + [[148, 166], "a0", "collide-shape-moving"], + [209, "a0", "connection"], + [[210, 228], "a0", "collide-shape-moving"] + ], + + "(method 15 collide-shape-prim-sphere)": [ + [[16, 55], "gp", "collide-shape-prim-mesh"] + ], + + "(method 25 collide-cache)": [ + [[83, 104], "a2", "(inline-array collide-cache-tri)"] + ], + + "(method 22 collide-cache)": [ + [14, "v1", "connection"], + [[15, 31], "v1", "collide-shape"], + [74, "v1", "connection"], + [[75, 91], "v1", "collide-shape"], + [130, "v1", "connection"], + [[131, 148], "v1", "collide-shape"], + [187, "v1", "connection"], + [[188, 205], "v1", "collide-shape"] + ], + + "(method 12 collide-shape-prim-sphere)": [ + [[13, 23], "t0", "collide-cache-prim"] + ], + + "(method 24 collide-cache)": [ + [14, "v1", "connection"], + [[15, 31], "v1", "collide-shape"], + [74, "v1", "connection"], + [[75, 91], "v1", "collide-shape"], + [130, "v1", "connection"], + [[131, 148], "v1", "collide-shape"], + [187, "v1", "connection"], + [[188, 205], "v1", "collide-shape"] + ], + + "(method 14 collide-shape-prim-sphere)": [ + [[11, 23], "t0", "collide-cache-prim"] + ], + + "(method 23 collide-cache)": [ + [20, "v1", "connection"], + [[21, 43], "v1", "collide-shape"], + [86, "v1", "connection"], + [[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)": [ + [[11, 23], "t0", "collide-cache-prim"] + ], + + "(method 31 collide-cache)": [[22, "v1", "collide-shape-prim-sphere"]], + + "(method 19 collide-cache)": [ + [[52, 94], "s4", "collide-cache-prim"], + [[1, 100], "s5", "collide-puss-work"] + ], + + "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"]], + + "(code ogreboss-super-boulder-throw)": [[16, "v1", "art-joint-anim"]], + + "ogreboss-emerge": [[47, "v1", "art-joint-anim"]], + + "(code ogreboss-die)": [[35, "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-throw)": [ + [33, "v1", "art-joint-anim"], + [89, "v1", "art-joint-anim"] + ], + + "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"]], + + "(code ogreboss-stage3-shuffle)": [ + [33, "v1", "art-joint-anim"], + [121, "v1", "art-joint-anim"], + [177, "v1", "art-joint-anim"], + [247, "v1", "art-joint-anim"], + [299, "v1", "art-joint-anim"], + [355, "v1", "art-joint-anim"], + [425, "v1", "art-joint-anim"] + ], + + "(code ogreboss-stage2)": [ + [26, "v1", "art-joint-anim"], + [104, "v1", "art-joint-anim"], + [158, "v1", "art-joint-anim"] + ], + + "ogreboss-update-super-boulder": [[12, "a1", "ogreboss-super-boulder"]], + + "(trans ogreboss-stage3-shuffle)": [[13, "v1", "ogreboss-super-boulder"]], + + "(code ogreboss-stage1)": [ + [36, "v1", "art-joint-anim"], + [93, "v1", "art-joint-anim"], + [172, "v1", "art-joint-anim"], + [273, "v1", "art-joint-anim"], + [329, "v1", "art-joint-anim"], + [386, "v1", "art-joint-anim"] + ], + + "(code ogreboss-bounce-boulder-idle)": [[81, "v1", "art-joint-anim"]], + + "ogreboss-idle-loop": [ + [145, "v1", "art-joint-anim"], + [206, "v1", "art-joint-anim"], + [261, "v1", "art-joint-anim"] + ], + + "(code ogreboss-super-boulder-roll)": [[123, "v1", "art-joint-anim"]], + + "(code ogreboss-intro)": [[92, "v1", "art-joint-anim"]], + + "ogreboss-submerge": [[130, "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-attack snow-bunny)": [[20, "v1", "art-joint-anim"]], + + "ogreboss-pick-target": [[31, "s3", "process-drawable"]], + + "(method 29 progress)": [ + [290, "a0", "(pointer symbol)"], + [299, "v1", "(pointer symbol)"], + [308, "a0", "(pointer symbol)"], + [317, "v1", "(pointer symbol)"], + [326, "a0", "(pointer symbol)"], + [589, "a0", "(pointer symbol)"], + [599, "v1", "(pointer symbol)"], + [608, "a1", "(pointer symbol)"], + [617, "v1", "(pointer symbol)"], + [626, "a1", "(pointer symbol)"], + [883, "a0", "(pointer language-enum)"], + [894, "a0", "(pointer symbol)"], + [921, "a0", "(pointer symbol)"] + ], + + "(method 9 edge-grab-info)": [ + [23, "a0", "int"], + [[24, 31], "s5", "collide-shape-prim"], + [29, "a0", "process-drawable"], + [156, "s5", "collide-shape-prim"] + ], + "circle-triangle-intersection-proc?": [[[113, 134], "v1", "vector"]], + + "(method 28 nav-control)": [ + [170, "v1", "connection"], + [[170, 245], "s0", "collide-shape"] + ], + + "(method 29 nav-mesh)": [ + [38, "v1", "int"], + [40, "v1", "int"], + [41, "v1", "int"], + [64, "f1", "float"], + [63, "v1", "float"] + ], + + "nav-mesh-update-route-table": [ + [19, "a3", "(pointer uint8)"], + [24, "a0", "(pointer uint8)"] + ], + + "nav-mesh-lookup-route": [[6, "a0", "(pointer uint8)"]], + + "(method 11 nav-mesh)": [[12, "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"]], + + "(method 18 nav-mesh)": [[34, "v1", "nav-poly"]], + + "foreground-engine-execute": [[114, "v1", "(pointer uint32)"]], + + "(event ropebridge-idle)": [ + [64, "gp", "touching-shapes-entry"], + [65, "v1", "touching-shapes-entry"], + [12, "v1", "float"] + ], + + "(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 25 ropebridge)": [ + [[4, 24], "a1", "vector"], + [[3, 24], "v1", "ropebridge-spring-point"], + [[30, 42], "v1", "ropebridge-spring-point"] + ], + + "(method 11 ropebridge)": [[[17, 21], "s4", "symbol"]], + + "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 notice-blue plat-eco)": [ + [22, "v1", "process-drawable"], + [36, "v1", "collide-shape"] + ], + + "snow-bunny-default-event-handler": [[52, "v1", "vector"]], + + "(method 15 snow-ball)": [ + [3, "v1", "(pointer snow-ball-roller)"], + [25, "v1", "(pointer snow-ball-roller)"], + [34, "v1", "(pointer snow-ball-roller)"], + [36, "v1", "(pointer snow-ball-roller)"], + [28, "a3", "(inline-array snow-ball-junction)"], + [7, "a3", "(inline-array snow-ball-junction)"], + [13, "a3", "(inline-array snow-ball-junction)"], + [20, "a3", "(inline-array snow-ball-junction)"] + ], + + "(trans snow-ball-shadow-idle)": [[4, "a0", "process-drawable"]], + + "snow-ball-shadow-init-by-other": [[20, "a0", "process-drawable"]], + + "curve-evaluate!": [[62, "s5", "pointer"]], + + "setup-blerc-chains": [ + [43, "v1", "int"], + [80, "s0", "int"], + [83, "a0", "int"], + [[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"], + [77, "a1", "merc-blend-ctrl"] + ], + + "blerc-execute": [ + [20, "a0", "(pointer int32)"], + [26, "v1", "(pointer int32)"], + [59, "a2", "(pointer int32)"], + [65, "a1", "(pointer int32)"] + ], + + "update-mood-flames": [[[6, 88], "s5", "flames-state"]], + + "update-mood-lava": [[[4, 81], "s4", "lava-state"]], + + "(method 27 ropebridge)": [ + [101, "a0", "(inline-array vector)"], + [102, "a0", "(inline-array vector)"], + [105, "a0", "(inline-array vector)"], + [106, "a0", "(inline-array vector)"] + ], + + "update-eyes": [ + [[19, 25], "a0", "dma-packet"], + [[28, 34], "a0", "gs-gif-tag"], + [39, "a0", "(pointer gs-test)"], + [41, "a0", "(pointer gs-reg64)"], + [[45, 50], "v1", "dma-packet"], + [[83, 89], "a0", "dma-packet"], + [[92, 98], "a0", "gs-gif-tag"], + [103, "a0", "(pointer gs-test)"], + [105, "a0", "(pointer gs-reg64)"], + [[109, 114], "v1", "dma-packet"], + [[147, 153], "a0", "dma-packet"], + [[156, 162], "a0", "gs-gif-tag"], + [167, "a0", "(pointer gs-test)"], + [169, "a0", "(pointer gs-reg64)"], + [[173, 178], "v1", "dma-packet"], + [212, "v1", "process-drawable"], + [218, "v1", "process-drawable"], + [[281, 286], "v1", "dma-packet"], + [[319, 324], "v1", "dma-packet"], + [[356, 362], "a0", "dma-packet"], + [[365, 371], "a0", "gs-gif-tag"], + [376, "a0", "(pointer gs-reg64)"], + [378, "a0", "(pointer gs-reg64)"], + [[382, 387], "v1", "dma-packet"], + [[415, 421], "a0", "dma-packet"], + [[424, 430], "a0", "gs-gif-tag"], + [435, "a0", "(pointer gs-reg64)"], + [437, "a0", "(pointer gs-reg64)"], + [[441, 446], "v1", "dma-packet"], + [[474, 480], "a0", "dma-packet"], + [[483, 489], "a0", "gs-gif-tag"], + [494, "a0", "(pointer gs-reg64)"], + [496, "a0", "(pointer gs-reg64)"], + [[500, 505], "v1", "dma-packet"] + ], + + "render-eyes": [ + [[45, 52], "v1", "dma-gif-packet"], + [[52, 64], "s0", "adgif-shader"], + [[68, 74], "a0", "dma-packet"], + [[77, 83], "a0", "gs-gif-tag"], + [95, "a0", "(pointer gs-scissor)"], + [97, "a0", "(pointer gs-reg64)"], + [[100, 135], "v1", "(inline-array vector4w)"], + [145, "v1", "(inline-array vector4w)"], + [[164, 170], "a2", "dma-packet"], + [[173, 179], "a2", "gs-gif-tag"], + [191, "a2", "(pointer gs-scissor)"], + [193, "a2", "(pointer gs-reg64)"], + [[199, 244], "a1", "(inline-array vector4w)"], + [250, "a1", "(inline-array vector4w)"], + [[253, 259], "a2", "dma-packet"], + [[262, 268], "a2", "gs-gif-tag"], + [280, "a2", "(pointer gs-scissor)"], + [282, "a2", "(pointer gs-reg64)"], + [[288, 337], "a1", "(inline-array vector4w)"], + [343, "v1", "(inline-array vector4w)"], + [[346, 352], "a0", "dma-packet"], + [[355, 361], "a0", "gs-gif-tag"], + [366, "a0", "(pointer gs-test)"], + [368, "a0", "(pointer gs-reg64)"], + [[373, 380], "v1", "(inline-array vector4w)"], + [[380, 392], "s0", "adgif-shader"], + [[412, 418], "a2", "dma-packet"], + [[421, 427], "a2", "gs-gif-tag"], + [439, "a2", "(pointer gs-scissor)"], + [441, "a2", "(pointer gs-reg64)"], + [[447, 497], "a1", "(inline-array vector4w)"], + [498, "a1", "(inline-array vector4w)"], + [[501, 507], "a2", "dma-packet"], + [[510, 516], "a2", "gs-gif-tag"], + [528, "a2", "(pointer gs-scissor)"], + [530, "a2", "(pointer gs-reg64)"], + [[536, 585], "a1", "(inline-array vector4w)"], + [591, "v1", "(inline-array vector4w)"], + [[594, 600], "a0", "dma-packet"], + [[603, 609], "a0", "gs-gif-tag"], + [614, "a0", "(pointer gs-test)"], + [616, "a0", "(pointer gs-reg64)"], + [[621, 628], "v1", "dma-gif-packet"], + [[628, 640], "s0", "adgif-shader"], + [641, "v1", "(inline-array dma-gif-packet)"], + [[673, 679], "a2", "dma-packet"], + [[682, 688], "a2", "gs-gif-tag"], + [700, "a2", "(pointer gs-scissor)"], + [702, "a2", "(pointer gs-reg64)"], + [[712, 759], "a1", "(inline-array vector4w)"], + [765, "a1", "(inline-array vector4w)"], + [[781, 787], "a2", "dma-packet"], + [[790, 796], "a2", "gs-gif-tag"], + [808, "a2", "(pointer gs-scissor)"], + [810, "a2", "(pointer gs-reg64)"], + [[820, 868], "a1", "(inline-array vector4w)"], + [874, "v1", "(inline-array vector4w)"] + ], + + "merc-eye-anim": [ + // [[81, 86], "v1", "(pointer int64)"], + // [[89, 94], "v1", "(pointer int64)"], + // [[119, 125], "v1", "(pointer int64)"], + // [[128, 134], "v1", "(pointer int64)"] + ], + + "ocean-near-add-call": [ + [3, "a0", "dma-packet"], + [8, "a0", "dma-packet"], + [10, "a0", "dma-packet"] + ], + + "ocean-near-add-call-flush": [ + [3, "a0", "dma-packet"], + [8, "a0", "dma-packet"], + [10, "a0", "dma-packet"] + ], + + "ocean-near-add-matrices": [ + [7, "a0", "dma-packet"], + [12, "a0", "dma-packet"], + [14, "a0", "dma-packet"], + [19, "a0", "dma-packet"], + [20, "a0", "vector"], + [22, "s4", "matrix"], + [23, "s4", "matrix"], + [47, "v1", "matrix"], + [[40, 46], "s3", "vector"] + ], + + "ocean-near-add-constants": [[[8, 16], "a0", "dma-packet"]], + + "draw-ocean-near": [ + [2, "a0", "dma-packet"], + [4, "a0", "dma-packet"], + [5, "a0", "dma-packet"], + [7, "a0", "dma-packet"], + [8, "a0", "dma-packet"], + [11, "a0", "dma-packet"], + [[14, 17], "a0", "gs-gif-tag"], + // [14, "a0", "dma-packet"], + // [16, "a0", "dma-packet"], + // [17, "a0", "dma-packet"], + [18, "a0", "dma-packet"], + [20, "a0", "dma-packet"], + [22, "a0", "(pointer gs-test)"], + [24, "a0", "(pointer gs-reg64)"], + [25, "a0", "dma-packet"], + [26, "a0", "dma-packet"], + [35, "a0", "dma-packet"], + [37, "a0", "dma-packet"], + [39, "a0", "dma-packet"], + [40, "a0", "dma-packet"], + [41, "a0", "dma-packet"], + [89, "a1", "(pointer int16)"] + ], + + "generic-reset-buffers": [ + [6, "t1", "dma-packet"], + [8, "t1", "dma-packet"], + [10, "t1", "dma-packet"], + [12, "t1", "dma-packet"], + [14, "t1", "dma-packet"], + [15, "t0", "dma-packet"] + ], + + "shadow-vu1-add-constants": [ + [2, "a1", "dma-packet"], + [7, "a1", "dma-packet"], + [9, "a1", "dma-packet"], + [14, "a1", "dma-packet"], + [[21, 58], "v1", "shadow-vu1-constants"], + [61, "a1", "dma-packet"], + [63, "a1", "dma-packet"], + [65, "a1", "dma-packet"], + [67, "a1", "dma-packet"], + [71, "a1", "dma-packet"], + [[73, 85], "a1", "shadow-vu1-gifbuf-template"] + ], + + "shadow-vu1-add-matrix": [ + [6, "a3", "dma-packet"], + [11, "a3", "dma-packet"], + [13, "a3", "dma-packet"], + [18, "a3", "dma-packet"], + [19, "a3", "dma-packet"], + [21, "v1", "dma-packet"], + [[26, 31], "v1", "matrix"] + ], + + "shadow-vu1-init-buffer": [ + [14, "a0", "dma-packet"], + [16, "a0", "dma-packet"], + [22, "a0", "dma-packet"], + [24, "a0", "dma-packet"] + ], + + "draw-bones-generic-merc": [ + [11, "v1", "generic-merc-ctrl"], + [198, "v1", "generic-merc-ctrl"], + [274, "a0", "generic-merc-ctrl"], + [277, "a0", "pointer"], + [278, "a0", "merc-fragment-control"], + [[270, 274], "a0", "dma-packet"], + [[258, 262], "a0", "dma-packet"], + [280, "a0", "pointer"], + [[303, 306], "gp", "dma-packet"], + [281, "v1", "merc-fragment"] + ], + + "generic-merc-execute-all": [ + [[165, 170], "v1", "terrain-context"], + [92, "a0", "terrain-context"], + [96, "v1", "terrain-context"], + [100, "v1", "terrain-context"], + [103, "a0", "generic-envmap-saves"], + [105, "v1", "(pointer int32)"], + [47, "v1", "terrain-context"], + [49, "v1", "terrain-context"], + [51, "v1", "terrain-context"], + [66, "a0", "terrain-context"], + [[114, 117], "v1", "dma-packet"] + ], + + "generic-initialize-without-sink": [ + [8, "a0", "terrain-context"], + [32, "a0", "terrain-context"] + ], + + "generic-work-init": [ + [10, "a0", "terrain-context"], + [13, "a0", "terrain-context"], + [16, "a0", "terrain-context"], + [18, "a0", "terrain-context"], + [[21, 42], "gp", "adgif-shader"] + ], + + "render-ocean-far": [[[23, 588], "s5", "(inline-array ocean-vertex)"]], + + "draw-ocean-far": [[[65, 72], "gp", "dma-packet"]], + + "ocean-init-buffer": [ + [[9, 14], "a2", "dma-packet"], + [[19, 22], "a2", "gs-gif-tag"], + [27, "s4", "(pointer gs-test)"], + [29, "s4", "(pointer gs-reg64)"], + [31, "s4", "(pointer gs-alpha)"], + [33, "s4", "(pointer gs-reg64)"], + [49, "s4", "(pointer gs-tex0)"], + [51, "s4", "(pointer gs-reg64)"], + [53, "s4", "(pointer gs-tex1)"], + [55, "s4", "(pointer gs-reg64)"], + [57, "s4", "(pointer gs-texa)"], + [59, "s4", "(pointer gs-reg64)"], + [71, "s4", "(pointer gs-miptbp)"], + [73, "s4", "(pointer gs-reg64)"], + [87, "s4", "(pointer gs-miptbp)"], + [89, "s4", "(pointer gs-reg64)"], + [90, "s4", "(pointer gs-clamp)"], + [92, "s4", "(pointer gs-reg64)"], + [94, "s4", "(pointer gs-fogcol)"], + [96, "s4", "(pointer gs-reg64)"] + ], + + "ocean-end-buffer": [ + [[3, 7], "a1", "dma-packet"], + [[13, 16], "a1", "gs-gif-tag"], + [22, "a0", "(pointer gs-texa)"], + [24, "a0", "(pointer gs-reg64)"] + ], + + "draw-ocean": [ + [[166, 169], "v1", "dma-packet"], + [[114, 117], "v1", "dma-packet"] + ], + + "ocean-texture-add-constants": [[[8, 16], "a0", "dma-packet"]], + + "ocean-texture-add-envmap": [[[1, 8], "v1", "(pointer uint128)"]], + + "ocean-texture-add-verts": [[[6, 11], "a0", "dma-packet"]], + + "ocean-texture-add-verts-last": [ + [[6, 11], "a3", "dma-packet"], + [[19, 24], "a0", "dma-packet"] + ], + + "ocean-texture-add-call-start": [[[3, 8], "a0", "dma-packet"]], + + "ocean-texture-add-call-rest": [[[3, 8], "a0", "dma-packet"]], + + "ocean-texture-add-call-done": [[[3, 8], "a0", "dma-packet"]], + + "draw-ocean-texture": [ + [[24, 29], "a0", "dma-packet"], + [[92, 96], "a0", "dma-packet"], + [[102, 105], "a0", "gs-gif-tag"], + [110, "s0", "(pointer gs-test)"], + [112, "s0", "(pointer gs-reg64)"], + [114, "s0", "(pointer gs-alpha)"], + [116, "s0", "(pointer gs-reg64)"], + [133, "s0", "(pointer gs-tex0)"], + [135, "s0", "(pointer gs-reg64)"], + [137, "s0", "(pointer gs-tex1)"], + [139, "s0", "(pointer gs-reg64)"], + [140, "s0", "(pointer gs-clamp)"], + [142, "s0", "(pointer gs-reg64)"], + [143, "s0", "(pointer uint64)"], + [145, "s0", "(pointer gs-reg64)"], + [[151, 155], "v1", "(pointer uint128)"], + [[156, 164], "a0", "vector4w"], + [[165, 169], "a0", "vector4w"], + [[170, 175], "a0", "vector4w"], + [[176, 182], "a0", "vector4w"], + [[183, 191], "v1", "vector4w"], + [[204, 208], "a0", "dma-packet"], + [[214, 217], "a0", "gs-gif-tag"], + [237, "s2", "(pointer gs-tex0)"], + [239, "s2", "(pointer gs-reg64)"], + [240, "s2", "(pointer uint64)"], + [242, "s2", "(pointer gs-reg64)"], + [251, "v1", "(pointer uint128)"], + [[253, 260], "a0", "vector4w"], + [[261, 265], "a0", "vector4w"], + [[266, 271], "a0", "vector4w"], + [[272, 278], "a0", "vector4w"], + [[279, 286], "v1", "vector4w"], + [[292, 296], "a0", "dma-packet"], + [[302, 305], "a0", "gs-gif-tag"], + [325, "s3", "(pointer gs-tex0)"], + [327, "s3", "(pointer gs-reg64)"], + [328, "s3", "(pointer uint64)"], + [330, "s3", "(pointer gs-reg64)"], + [339, "v1", "(pointer uint128)"], + [[341, 348], "a0", "vector4w"], + [[349, 367], "a0", "vector4w"], + [[368, 375], "v1", "vector4w"], + [[381, 385], "a0", "dma-packet"], + [[391, 394], "a0", "gs-gif-tag"], + [415, "s3", "(pointer gs-tex0)"], + [417, "s3", "(pointer gs-reg64)"], + [418, "s3", "(pointer uint64)"], + [420, "s3", "(pointer gs-reg64)"], + [429, "v1", "(pointer uint128)"], + [[431, 457], "a0", "vector4w"], + [[458, 466], "v1", "vector4w"], + [[471, 475], "a0", "dma-packet"], + [[481, 484], "a0", "gs-gif-tag"], + [505, "s3", "(pointer gs-tex0)"], + [507, "s3", "(pointer gs-reg64)"], + [508, "s3", "(pointer uint64)"], + [510, "s3", "(pointer gs-reg64)"], + [519, "v1", "(pointer uint128)"], + [[521, 547], "a0", "vector4w"], + [[548, 555], "v1", "vector4w"], + [[561, 565], "a0", "dma-packet"], + [[571, 574], "a0", "gs-gif-tag"], + [595, "s3", "(pointer gs-tex0)"], + [597, "s3", "(pointer gs-reg64)"], + [598, "s3", "(pointer uint64)"], + [600, "s3", "(pointer gs-reg64)"], + [609, "v1", "(pointer uint128)"], + [[611, 638], "a0", "vector4w"], + [[639, 646], "v1", "vector4w"], + [[652, 656], "a0", "dma-packet"], + [57, "v1", "(inline-array vector)"] + ], + + "ocean-near-add-upload": [ + [[40, 48], "a0", "dma-packet"], + [64, "a2", "(pointer int16)"], + [[81, 89], "a1", "vector4w"], + [[90, 98], "v1", "vector4w"], + [[111, 127], "t0", "vector4w"], + [[132, 146], "a1", "vector"], + [[250, 272], "a1", "(inline-array vector)"] + ], + + "draw-ocean-mid": [ + [169, "t3", "(pointer uint8)"], + [[23, 28], "a0", "dma-packet"] + ], + + "ocean-seams-add-constants": [ + [[7, 15], "a1", "dma-packet"], + [[19, 27], "a1", "vector"], + [[28, 36], "a1", "vector"], + [[37, 45], "a1", "vector"], + [[46, 55], "v1", "vector"] + ], + + "ocean-mid-add-upload-table": [ + [[44, 52], "a0", "dma-packet"], + [[54, 59], "v1", "vector4w"], + [[62, 75], "v1", "(pointer uint128)"], + [[158, 166], "a0", "dma-packet"], + [[138, 145], "v1", "(pointer uint128)"] + ], + + "ocean-mid-camera-masks-set!": [ + [30, "a2", "(pointer uint8)"], + [41, "a2", "(pointer uint8)"], + [49, "v1", "(pointer uint8)"] + ], + + "ocean-mid-mask-ptrs-bit?": [[31, "a0", "(pointer uint8)"]], + + "ocean-mid-camera-masks-bit?": [[25, "a0", "(pointer uint8)"]], + + "ocean-mid-add-upload": [ + [[48, 62], "a2", "dma-packet"], + [[76, 81], "a0", "dma-packet"], + [95, "v1", "(pointer uint64)"] + ], + + "ocean-mid-add-call-flush": [[[3, 11], "a0", "dma-packet"]], + + "ocean-mid-add-call": [[[3, 11], "a0", "dma-packet"]], + + "ocean-mid-add-matrices": [ + [[12, 20], "a0", "dma-packet"], + [[30, 34], "v1", "matrix"], + [[41, 46], "s3", "vector"] + ], + + "ocean-mid-add-constants": [[[8, 16], "a0", "dma-packet"]], + + "ocean-near-add-heights": [ + [26, "a1", "int"], + [[11, 19], "a3", "dma-packet"], + [[30, 38], "a2", "dma-packet"] + ], + + "draw-bones-shadow": [ + [10, "t0", "terrain-context"], + [[36, 100], "t0", "shadow-dma-packet"], + [[53, 58], "t6", "(inline-array vector)"], + [[64, 71], "a0", "vector"], + [[103, 106], "v1", "dma-packet"] + ], + + "shadow-execute-all": [ + [108, "gp", "shadow-dcache"], + [113, "gp", "shadow-dcache"], + [118, "gp", "shadow-dcache"], + [123, "gp", "shadow-dcache"], + [[54, 58], "v1", "shadow-dcache"], + [[86, 89], "v1", "dma-packet"] + ], + + "shadow-dma-init": [ + [[25, 29], "t6", "dma-packet"], + [[34, 37], "t6", "gs-gif-tag"], + [41, "t4", "(pointer gs-reg)"], + [43, "t4", "(pointer gs-reg)"], + [45, "t4", "(pointer gs-test)"], + [47, "t4", "(pointer gs-reg)"], + [49, "t4", "(pointer gs-alpha)"], + [51, "t4", "(pointer gs-reg)"], + [56, "t4", "(pointer gs-frame)"], + [58, "t4", "(pointer gs-reg)"], + [60, "t4", "(pointer gs-zbuf)"], + [62, "t4", "(pointer gs-reg)"], + [69, "t4", "(pointer gs-xy-offset)"], + [71, "t4", "(pointer gs-reg)"], + [77, "t4", "(pointer gs-tex0)"], + [79, "t4", "(pointer gs-reg)"], + [80, "t4", "(pointer gs-tex1)"], + [82, "t4", "(pointer gs-reg)"], + [83, "t4", "(pointer gs-miptbp)"], + [85, "t4", "(pointer gs-reg)"], + [94, "t4", "(pointer gs-clamp)"], + [101, "t3", "gs-gif-tag"], + [103, "t3", "gs-gif-tag"], + [109, "t3", "(pointer gs-prim)"], + [111, "t3", "(pointer gs-rgbaq)"], + [[120, 123], "t3", "gs-gif-tag"], + [141, "t5", "(pointer gs-xyzf)"], + [154, "t5", "(pointer gs-xyzf)"], + [[165, 168], "a3", "gs-gif-tag"], + [175, "a3", "(pointer gs-test)"], + [177, "a3", "(pointer gs-reg64)"], + [179, "a3", "(pointer gs-zbuf)"], + [181, "a3", "(pointer gs-reg64)"], + [186, "a3", "(pointer gs-frame)"], + [188, "a3", "(pointer gs-reg64)"], + [189, "a3", "(pointer uint64)"], + [191, "a3", "(pointer gs-reg64)"], + [198, "a3", "(pointer gs-test)"], + [200, "a3", "(pointer gs-reg64)"], + [202, "a3", "(pointer gs-zbuf)"], + [204, "a3", "(pointer gs-reg64)"], + [209, "a3", "(pointer gs-frame)"], + [211, "a3", "(pointer gs-reg64)"], + [212, "a3", "(pointer uint64)"], + [214, "a3", "(pointer gs-reg64)"], + [[223, 234], "v1", "(pointer uint64)"] + ], + + "shadow-dma-end": [ + [137, "f2", "int"], + [[27, 32], "t3", "dma-packet"], + [[38, 41], "t3", "gs-gif-tag"], + [45, "t3", "(pointer uint64)"], + [47, "t3", "(pointer gs-reg64)"], + [49, "t3", "(pointer gs-test)"], + [51, "t3", "(pointer gs-reg64)"], + [56, "t3", "(pointer gs-frame)"], + [58, "t3", "(pointer gs-reg64)"], + [59, "t3", "(pointer uint64)"], + [61, "t3", "(pointer gs-reg64)"], + [[68, 73], "t4", "dma-packet"], + [[111, 114], "t4", "gs-gif-tag"], + [115, "t4", "(pointer gs-prim)"], + [[107, 117], "t5", "gs-rgbaq"], + // [[75, 106], "t4", "gs-rgbaq"] + [116, "t4", "(pointer gs-rgbaq)"], + [[121, 124], "t4", "(inline-array gs-gif-tag)"], + [165, "t7", "(pointer gs-xyzf)"], + [184, "t7", "(pointer gs-st)"], + [197, "t7", "(pointer gs-xyzf)"], + [[216, 222], "t2", "(pointer uint64)"], + [[228, 232], "t0", "dma-packet"], + [[238, 241], "t0", "gs-gif-tag"], + [246, "t0", "(pointer gs-test)"], + [248, "t0", "(pointer gs-reg64)"], + [255, "t0", "(pointer gs-xy-offset)"], + [257, "t0", "(pointer gs-reg64)"], + [259, "t0", "(pointer gs-alpha)"], + [261, "t0", "(pointer gs-reg64)"], + [266, "t0", "(pointer gs-frame)"], + [268, "t0", "(pointer gs-reg64)"], + [270, "t0", "(pointer gs-zbuf)"], + [272, "t0", "(pointer gs-reg64)"], + [273, "t0", "(pointer uint64)"], + [275, "t0", "(pointer gs-reg64)"] + ], + "test-func": [[7, "f1", "float"]], + + "(method 14 drawable-tree-instance-shrub)": [ + [[12, 151], "gp", "prototype-bucket-shrub"], + [15, "a1", "drawable-group"], + [39, "v1", "drawable-group"], + [61, "s3", "shrubbery"], + [85, "v1", "drawable-group"], + [107, "s3", "shrubbery"], + [151, "gp", "(inline-array prototype-bucket-shrub)"] + ], + + "(method 10 drawable-tree-instance-shrub)": [[3, "a1", "terrain-context"]], + + "draw-prototype-inline-array-shrub": [ + [[13, 55], "v1", "prototype-bucket-shrub"], + [[15, 30], "a2", "vector4w"], + [[42, 51], "a2", "vector4w"], + [[87, 93], "a0", "dma-packet"], + [[96, 102], "a0", "gs-gif-tag"], + [107, "a1", "gs-test"], + [107, "a0", "(pointer gs-test)"], + [109, "a0", "(pointer gs-reg64)"], + [[117, 136], "v1", "matrix3"], + [[140, 145], "v1", "dma-packet"], + [[238, 247], "a0", "dma-packet"], + [[261, 266], "v1", "dma-packet"], + [[359, 368], "a0", "dma-packet"], + [[382, 387], "v1", "dma-packet"], + [[451, 457], "a1", "dma-packet"], + [[460, 466], "a1", "dma-packet"], + [[524, 530], "a0", "dma-packet"], + [55, "v1", "(inline-array prototype-bucket-shrub)"], + [156, "v1", "terrain-context"], + [212, "gp", "prototype-bucket-shrub"], + [333, "gp", "prototype-bucket-shrub"], + [[479, 518], "gp", "prototype-bucket-shrub"], + [518, "gp", "(inline-array prototype-bucket-shrub)"], + [223, "v1", "drawable-group"], + [277, "v1", "terrain-context"], + [344, "v1", "drawable-group"], + [398, "v1", "terrain-context"], + [[498, 507], "a1", "prototype-bucket-shrub"], + [540, "v1", "terrain-context"] + ], + + "(method 8 drawable-tree-instance-shrub)": [[54, "v1", "drawable-group"]], + + "draw-drawable-tree-instance-shrub": [[85, "a0", "drawable-group"]], + + "shrub-init-frame": [ + [[6, 12], "a0", "dma-packet"], + [[13, 21], "a0", "gs-gif-tag"], + [24, "v1", "(pointer gs-test)"], + [26, "v1", "(pointer gs-reg64)"] + ], + + "shrub-do-init-frame": [ + [[10, 21], "a0", "dma-packet"], + [[24, 29], "a0", "dma-packet"], + [33, "v1", "(pointer vif-tag)"], + [[35, 41], "v1", "(pointer uint32)"], + [42, "v1", "(pointer vif-tag)"], + [[43, 51], "v1", "(pointer uint32)"], + [52, "v1", "(pointer vif-tag)"], + [54, "v1", "(pointer uint32)"] + ], + + "shrub-upload-view-data": [[[3, 16], "a0", "dma-packet"]], + + "shrub-upload-model": [ + [[17, 26], "a3", "dma-packet"], + [[33, 41], "a0", "dma-packet"], + [[47, 55], "a0", "dma-packet"] + ], + + "(method 12 effect-control)": [["_stack_", 112, "res-tag"]], + + "generic-tie-execute": [ + [118, "v1", "terrain-context"], + [124, "v1", "terrain-context"] + ], + +// BEGIN + "(code target-title)": [ + // [[23, 26], "v1", "handle"], + [[61, 69], "v1", "handle"], + [[73, 81], "v1", "handle"], + [218, "s5", "handle"] + ], + + "(method 10 gui-query)": [], + + "(trans fisher-done)": [], + + "(code target-duck-high-jump)": [[77, "v0", "sound-rpc-set-param"]], + "(trans target-duck-high-jump-jump)": [[9, "v0", "sound-rpc-set-param"]], + + "(anon-function 11 target2)": [ + [[15, 135], "s4", "target"] // confusing -- the parent of a target is a target? + ], + + "(code target-death)": [ + [561, "v1", "art-joint-anim"], + [683, "v0", "int"], + [719, "v1", "process-drawable"], + [[985, 1063], "s5", "handle"] + ], + + "sound-set-fps": [[[3, 7], "v1", "sound-rpc-set-fps"]], + "placeholder-do-not-add-below": [] } diff --git a/decompiler/config/jak1_pal/var_names.jsonc b/decompiler/config/jak1_pal/var_names.jsonc deleted file mode 100644 index b4cdc6bcf1..0000000000 --- a/decompiler/config/jak1_pal/var_names.jsonc +++ /dev/null @@ -1,3560 +0,0 @@ -{ - "identity": { - "args": ["obj"] - }, - - "1/": { - "args": ["x"] - }, - - "+": { - "args": ["x", "y"] - }, - - "-": { - "args": ["x", "y"] - }, - - "*": { - "args": ["x", "y"] - }, - - "/": { - "args": ["x", "y"] - }, - - "ash": { - "args": ["value", "shift-amount"] - }, - - "mod": { - "args": ["x", "y"] - }, - - "rem": { - "args": ["x", "y"] - }, - - "abs": { - "args": ["x"] - }, - - "min": { - "args": ["x", "y"] - }, - - "max": { - "args": ["x", "y"] - }, - - "logior": { - "args": ["x", "y"] - }, - - "logand": { - "args": ["x", "y"] - }, - - "lognor": { - "args": ["x", "y"] - }, - - "logxor": { - "args": ["x", "y"] - }, - - "lognot": { - "args": ["x"] - }, - - "basic-type?": { - "args": ["obj", "parent-type"], - "vars": { "v1-0": "obj-type", "a0-1": "end-type" } - }, - - "type-type?": { - "args": ["child-type", "parent-type"], - "vars": { "v1-0": "end-type" } - }, - - "find-parent-method": { - "args": ["child-type", "method-id"], - "vars": { - "v0-0": "current-method", - "v1-2": "original-method", - "v1-5": "unused1" - } - }, - - "ref": { - "args": ["lst", "index"], - "vars": { "v1-0": "count" } - }, - - "(method 4 pair)": { - "vars": { "v0-0": "result", "v1-1": "iter" } - }, - - "last": { - "args": ["lst"], - "vars": { "v0-0": "iter" } - }, - "member": { - "args": ["obj", "lst"], - "vars": { "v1-0": "iter" } - }, - "nmember": { - "args": ["obj", "lst"] - }, - "assoc": { - "args": ["item", "alist"], - "vars": { "v1-0": "iter" } - }, - "assoce": { - "args": ["item", "alist"], - "vars": { "v1-0": "iter" } - }, - "nassoc": { - "args": ["item-name", "alist"], - "vars": { "a1-1": "key" } - }, - "nassoce": { - "args": ["item-name", "alist"], - "vars": { "s4-0": "key" } - }, - "append!": { - "args": ["front", "back"], - "vars": { "v1-1": "iter" } - }, - "delete!": { - "args": ["item", "lst"], - "vars": { "a2-0": "iter", "v1-1": "iter-prev" } - }, - "delete-car!": { - "args": ["item", "lst"], - "vars": { "a2-0": "iter", "v1-2": "iter-prev" } - }, - "insert-cons!": { - "args": ["kv", "alist"], - "vars": { "a3-0": "updated-list" } - }, - "sort": { - "args": ["lst", "compare-func"], - "vars": { - "s4-0": "unsorted-count", - "s3-0": "iter", - "s2-0": "first-elt", - "s1-0": "second-elt", - "v1-1": "compare-result" - } - }, - "(method 0 inline-array-class)": { - "args": ["allocation", "type-to-make", "size"], - "vars": { "v0-0": "obj" } - }, - "(method 0 array)": { - "args": ["allocation", "type-to-make", "content-type", "len"], - "vars": { "v0-1": "obj" } - }, - - "(method 2 array)": { - "vars": { "v1-1": "content-type-sym" } - }, - - "(method 3 array)": { - "vars": { "v1-1": "content-type-sym" } - }, - - "mem-copy!": { - "args": ["dst", "src", "size"], - "vars": { "v0-0": "result", "v1-0": "i" } - }, - "qmem-copy<-!": { - "args": ["dst", "src", "size"], - "vars": { "v0-0": "result", "v1-1": "qwc", "a2-1": "value" } - }, - "qmem-copy->!": { - "args": ["dst", "src", "size"], - "vars": { - "v0-0": "result", - "v1-1": "qwc", - "a1-1": "src-ptr", - "a0-1": "dst-ptr", - "a2-3": "value" - } - }, - "mem-set32!": { - "args": ["dst", "size", "value"], - "vars": { "v0-0": "result", "v1-0": "i" } - }, - "mem-or!": { - "args": ["dst", "src", "size"], - "vars": { "v0-0": "result", "v1-0": "i" } - }, - "fact": { - "args": ["x"] - }, - "mem-print": { - "args": ["data", "word-count"], - "vars": { "s4-0": "current-qword" } - }, - "print-tree-bitmask": { - "args": ["bits", "count"], - "vars": { "s4-0": "i" } - }, - "valid?": { - "args": ["obj", "expected-type", "name", "allow-false", "print-dest"], - "vars": { "v1-1": "in-goal-mem" } - }, - - // GKERNEL - - "(method 0 cpu-thread)": { - "vars": { "v0-0": ["obj", "cpu-thread"] } - }, - - "inspect-process-heap": { - "vars": { "s5-0": ["obj", "pointer"] } - }, - - "(method 23 dead-pool-heap)": { - "args": ["this", "rec"] - }, - - "(method 0 dead-pool-heap)": { - "vars": { "v0-0": ["obj", "dead-pool-heap"] } - }, - - "seek": { - "args": ["x", "target", "diff"], - "vars": { "f2-0": "err" } - }, - - "lerp": { - "args": ["minimum", "maximum", "amount"] - }, - - "lerp-scale": { - "args": ["min-out", "max-out", "in", "min-in", "max-in"], - "vars": { "f0-1": "scale" } - }, - - "lerp-clamp": { - "args": ["minimum", "maximum", "amount"] - }, - - "rand-vu-int-range": { - "args": ["first", "second"], - "vars": { "f0-4": "float-in-range" } - }, - - "(method 0 bit-array)": { - "args": ["allocation", "type-to-make", "length"], - "vars": { "v0-0": "obj" } - }, - - "(method 12 bit-array)": { - "vars": { "v1-2": "idx" } - }, - - "box-vector-enside?": { - "args": ["box", "pt"] - }, - - "box-vector-inside?": { - "args": ["box", "pt"] - }, - - "string=": { - "args": ["str-a", "str-b"], - "vars": { "a2-0": "a-ptr", "v1-0": "b-ptr" } - }, - - "string-charp=": { - "args": ["str", "charp"], - "vars": { "v1-0": "str-ptr" } - }, - - "copyn-string<-charp": { - "args": ["str", "charp", "len"], - "vars": { "a3-0": "i", "v1-0": "str-ptr" } - }, - - "string<-charp": { - "args": ["str", "charp"], - "vars": { "v1-0": "str-ptr" } - }, - - "charp<-string": { - "args": ["charp", "str"], - "vars": { "v1-0": "str-ptr" } - }, - - "copy-charp<-charp": { - "args": ["dst", "src"] - }, - - "cat-string<-string": { - "args": ["a", "b"], - "vars": { "v1-0": "a-ptr", "a1-1": "b-ptr" } - }, - - "catn-string<-charp": { - "args": ["a", "b", "len"], - "vars": { "v1-0": "a-ptr", "a3-2": "i" } - }, - - "cat-string<-string_to_charp": { - "args": ["a", "b", "end-ptr"], - "vars": { "v1-0": "b-ptr", "v0-0": "a-ptr" } - }, - - "append-character-to-string": { - "args": ["str", "char"], - "vars": { "v1-0": "str-ptr" } - }, - - "charp-basename": { - "args": ["charp"], - "vars": { "v1-0": "ptr" } - }, - - "string?": { - "args": ["a", "b"], - "vars": { "s4-1": "len", "v1-4": "i" } - }, - "string<=?": { - "args": ["a", "b"], - "vars": { "s4-1": "len", "v1-4": "i" } - }, - "string>=?": { - "args": ["a", "b"], - "vars": { "s4-1": "len", "v1-4": "i" } - }, - "string-cat-to-last-char": { - "args": ["base-str", "append-str", "char"], - "vars": { "s4-0": "end-of-append", "v1-0": "location-of-char" } - }, - "string-suck-up!": { - "args": ["str", "location"], - "vars": { "v1-2": "str-ptr" } - }, - "string-strip-trailing-whitespace!": { - "args": ["str"], - "vars": { "v1-6": "ptr" } - }, - - "string-get-arg!!": { - "args": ["a-str", "arg"], - "vars": { "s4-0": "arg-word-start", "s4-1": "arg-end", "v1-3": "arg-start" } - }, - - "string->int": { - "args": ["str"], - "vars": { - "a0-1": "str-ptr", - "v0-0": "result", - "a0-2": "next-char-1", - "a0-3": "next-char-2" - } - }, - - "string-get-flag!!": { - "args": ["result", "in", "first-flag", "second-flag"] - }, - - "(method 0 state)": { - "args": [ - "allocation", - "type-to-make", - "name", - "code", - "trans", - "enter", - "exit", - "event" - ], - "vars": { "v0-0": "obj" } - }, - - "previous-brother": { - "args": ["proc"], - "vars": { "v1-0": "parent", "v1-2": "child" } - }, - - // Matrix - "matrix-identity": { - "args": ["mat"], - "vars": { "f0-0": "one" } - }, - - "matrix+!": { - "args": ["dst", "src1", "src2"], - "vars": { "v1-0": "i" } - }, - - "matrix-!": { - "args": ["dst", "src1", "src2"], - "vars": { "v1-0": "i" } - }, - - "matrix*!": { - "args": ["dst", "src1", "src2"] - }, - - "matrixp*!": { - "args": ["dst", "src1", "src2"], - "vars": { "s5-0": "temp-mat" } - }, - - "vector-matrix*!": { - "args": ["dst", "vec", "mat"] - }, - - "vector-rotate*!": { - "args": ["dst", "vec", "mat"] - }, - - "vector3s-matrix*!": { - "args": ["dst", "vec", "mat"], - "vars": { "s5-0": "temp-vec3" } - }, - - "vector3s-rotate*!": { - "args": ["dst", "vec", "mat"], - "vars": { "s5-0": "temp-vec3" } - }, - - "matrix-transpose!": { - "args": ["dst", "src"] - }, - - "matrix-inverse-of-rot-trans!": { - "args": ["dst", "src"] - }, - - "matrix-4x4-inverse!": { - "args": ["dst", "src"] - }, - - "matrix-translate!": { - "args": ["dst", "trans"] - }, - - "matrix-translate+!": { - "args": ["dst", "src", "trans"] - }, - - "matrix-scale!": { - "args": ["dst", "scale"] - }, - - "scale-matrix!": { - "args": ["dst", "scale", "src"] - }, - - "matrix-inv-scale!": { - "args": ["dst", "scale"] - }, - - "column-scale-matrix!": { - "args": ["dst", "scale", "src"] - }, - - "matrix-rotate-x!": { - "args": ["dst", "rot-deg"], - "vars": { "f30-0": "rot-sin", "f0-0": "rot-cos" } - }, - - "matrix-rotate-y!": { - "args": ["dst", "rot-deg"], - "vars": { "f30-0": "rot-sin", "f0-0": "rot-cos" } - }, - - "matrix-rotate-z!": { - "args": ["dst", "rot-deg"], - "vars": { "f30-0": "rot-sin", "f0-0": "rot-cos" } - }, - - "matrix-rotate-zyx!": { - "args": ["dst", "rot-xyz-deg"], - "vars": { "gp-0": "temp-mat", "s5-0": "rot-mat" } - }, - - "matrix-rotate-xyz!": { - "args": ["dst", "rot-xyz-deg"], - "vars": { "gp-0": "temp-mat", "s5-0": "rot-mat" } - }, - - "matrix-rotate-zxy!": { - "args": ["dst", "rot-xyz-deg"], - "vars": { "gp-0": "temp-mat", "s5-0": "rot-mat" } - }, - - "matrix-rotate-yxz!": { - "args": ["dst", "rot-xyz-deg"], - "vars": { "gp-0": "temp-mat", "s5-0": "rot-mat" } - }, - - "matrix-rotate-yzx!": { - "args": ["dst", "rot-xyz-deg"], - "vars": { "gp-0": "temp-mat", "s5-0": "rot-mat" } - }, - - "matrix-rotate-yxy!": { - "args": ["dst", "rots-deg"], - "vars": { - "a2-0": "sincos-input", - "s5-0": "sin-vec", - "s4-0": "cos-vec", - "f1-1": "cos-y", - "f0-5": "sin-y", - "f2-0": "cos-x", - "f5-0": "sin-x", - "f3-0": "cos-z", - "f4-0": "sin-z" - } - }, - - "matrix-rotate-yx!": { - "args": ["dst", "rot-y-deg", "rot-x-deg"] - }, - - "matrix-axis-angle!": { - "args": ["dst", "axis", "angle-deg"] - }, - - "matrix-lerp!": { - "args": ["dst", "src1", "src2", "alpha"] - }, - - "matrix-3x3-determinant": { - "args": ["mat"] - }, - - "matrix-3x3-inverse!": { - "args": ["dst", "src"] - }, - - "matrix-3x3-inverse-transpose!": { - "args": ["dst", "src"] - }, - - "matrix3-inverse-transpose!": { - "args": ["dst", "src"] - }, - - "matrix-4x4-determinant": { - "args": ["dst", "src"] - }, - - "matrix-4x4-inverse-transpose!": { - "args": ["dst", "src"] - }, - - "matrix-y-angle": { - "args": ["mat"], - "vars": { "v1-0": "z-row" } - }, - - "(method 0 trs)": { - "vars": { "gp-0": "obj" } - }, - - "transform-matrix-calc!": { - "args": ["tf", "dst-mat"] - }, - - "transform-matrix-parent-calc!": { - "args": ["tf", "dst-mat", "inv-scale"] - }, - - "trs-matrix-calc!": { - "args": ["tf", "dst-mat"] - }, - - "quaternion-axis-angle!": { - "args": ["quat", "x", "y", "z", "angle"] - }, - - "quaternion-vector-angle!": { - "args": ["quat", "axis", "angle"] - }, - - "vector-flatten!": { - "args": ["dst", "src", "plane-normal"] - }, - - "vector-reflect!": { - "args": ["dst", "src", "plane-normal"] - }, - - "vector-reflect-flat!": { - "args": ["dst", "src", "plane-normal"] - }, - - "vector-reflect-true-flat!": { - "args": ["dst", "src", "plane-normal"] - }, - - "vector-reflect-flat-above!": { - "args": ["dst", "src", "plane-normal"] - }, - - "deg-seek": { - "args": ["in", "target", "max-diff"], - "vars": { - "v1-1": "in-int", - "a0-2": "target-int", - "a1-2": "max-diff-int", - "a2-1": "diff", - "a3-0": "abs-diff" - } - }, - - "deg-seek-smooth": { - "args": ["in", "target", "max-diff", "amount"], - "vars": { "f0-1": "step" } - }, - - "deg-lerp-clamp": { - "args": ["min-val", "max-val", "in"] - }, - - "sinerp-clamp": { - "args": ["minimum", "maximum", "amount"] - }, - - "coserp-clamp": { - "args": ["minimum", "maximum", "amount"] - }, - "coserp": { - "args": ["minimum", "maximum", "amount"] - }, - - "coserp180-clamp": { - "args": ["minimum", "maximum", "amount"] - }, - "coserp180": { - "args": ["minimum", "maximum", "amount"] - }, - "ease-in-out": { - "args": ["total", "progress"] - }, - "dma-send-to-spr": { - "args": ["sadr", "madr", "qwc", "sync"] - }, - "dma-send-to-spr-no-flush": { - "args": ["sadr", "madr", "qwc", "sync"] - }, - "dma-send-from-spr": { - "args": ["madr", "sadr", "qwc", "sync"] - }, - "dma-send-from-spr-no-flush": { - "args": ["madr", "sadr", "qwc", "sync"] - }, - "dump-vu1-range": { - "args": ["start", "total-count"] - }, - "ultimate-memcpy": { - "args": ["dst", "src", "size-bytes"], - "vars": { - "s2-0": "qwc-remaining", - "s1-0": "qwc-transferred-now", - "s4-0": "spr-to-bank", - "s3-0": "spr-from-bank" - } - }, - - "dma-buffer-add-vu-function": { - "args": ["dma-buf", "vu-func"], - "vars": { - "t1-1": "dma-buf-2", - "v1-0": "func-ptr", - "a3-0": "qlen", - "a1-1": "origin", - "t0-1": "qwc-now", - "t2-0": ["buf-ptr", "dma-packet"] - } - }, - - "dma-buffer-add-buckets": { - "args": ["dma-buf", "count"], - "vars": { "a2-0": "i", "v1-0": ["current-bucket", "dma-bucket"] } - }, - - "dma-buffer-patch-buckets": { - "args": ["bucket", "count"], - "vars": { "v1-1": "i" } - }, - - "dma-bucket-insert-tag": { - "args": ["base", "idx", "tag-start", "tag-end"], - "vars": { "v1-1": "bucket" } - }, - - "disasm-vif-details": { - "args": ["stream", "data", "kind", "count"], - "vars": { "s4-0": "count2", "s3-0": "data-ptr", "s2-0": "i" } - }, - - "disasm-vif-tag": { - "args": ["data", "words", "stream", "details"], - "vars": { - "gp-0": "byte-idx", - "v1-0": "cmd-template-idx", - "a0-12": "print-kind", - "s1-0": "first-tag", - "s0-0": "packet-size", - "t1-1": ["stcycl-imm", "vif-stcycl-imm"], - "sv-16": "cmd", - "sv-32": "data-ptr", - "sv-48": "data-idx", - "sv-64": "unpack-imm" - } - }, - - "disasm-dma-list": { - "args": ["data", "mode", "verbose", "stream", "expected-size"], - "vars": { - "sv-16": "addr", - "sv-32": "data-2", - "sv-48": "qwc", - "sv-64": "ra-1", - "sv-80": "ra-2", - "sv-96": "call-depth", - "sv-112": "current-tag", - "s2-0": "mode-2", - "s3-0": "verbose-2", - "gp-0": "stream-2", - "s1-0": "expected-size-2", - "s0-0": "end-condition", - "s4-0": "total-qwc", - "s5-0": "total-tags" - } - }, - - "cpad-invalid!": { - "args": ["pad"] - }, - - "(method 0 cpad-info)": { - "args": ["alloction", "type-to-make", "idx"], - "vars": { "s5-0": "obj" } - }, - - "analog-input": { - "args": ["in", "offset", "center-val", "max-val", "out-range"], - "vars": { - "f1-1": "offset-in", - "f0-3": "magnitude", - "v1-0": "max-magnitude" - } - }, - - "cpad-set-buzz!": { - "args": ["pad", "buzz-idx", "buzz-amount", "duration"] - }, - - "service-cpads": { - "vars": { - "gp-0": "pad-list", - "s5-0": "pad-idx", - "s4-0": "pad", - "s3-0": "buzz-idx", - "v1-29": "current-button0" - } - }, - - "buzz-stop!": { - "args": ["idx"] - }, - - "default-buffer-init": { - "args": ["buff"], - "vars": { - "v1-0": "buff-ptr", - "v1-1": "buff-ptr2", - "v1-3": "buff-ptr3", - "v1-4": "buff-ptr4", - "a1-4": ["packet", "dma-gif-packet"], - "a1-6": ["gif-tag", "gs-gif-tag"], - "a1-8": ["data", "(pointer uint64)"], - "a0-1": ["ret-packet", "dma-packet"], - "v1-2": "buff-ptr5" - } - }, - - "add-reg-gif-packet": { - "args": ["packet", "reg-idx", "reg-val"], - "vars": { "v1-0": "tag" } - }, - - "(method 9 font-context)": { - "args": ["obj", "mat"] - }, - "(method 10 font-context)": { - "args": ["obj", "x", "y"] - }, - "(method 11 font-context)": { - "args": ["obj", "z"] - }, - "(method 12 font-context)": { - "args": ["obj", "w"] - }, - "(method 13 font-context)": { - "args": ["obj", "width"] - }, - "(method 14 font-context)": { - "args": ["obj", "height"] - }, - "(method 15 font-context)": { - "args": ["obj", "proj"] - }, - "(method 16 font-context)": { - "args": ["obj", "color"] - }, - "(method 17 font-context)": { - "args": ["obj", "flags"] - }, - "(method 18 font-context)": { - "args": ["obj", "start-line"] - }, - "(method 19 font-context)": { - "args": ["obj", "scale"] - }, - "(method 0 font-context)": { - "args": [ - "allocation", - "type-to-make", - "mat", - "x", - "y", - "z", - "color", - "flags" - ], - "vars": { "v0-0": "obj" } - }, - "font-set-tex0": { - "args": ["ptr-tex0", "tex", "tex-addr", "psm", "clut-addr"] - }, - - "(method 0 display-frame)": { - "vars": { "gp-0": "obj" } - }, - - "(method 0 draw-context)": { - "args": [ - "allocation", - "type-to-make", - "org-x", - "org-y", - "width", - "height", - "color-0" - ] - }, - - "(method 0 display)": { - "args": ["allocation", "type-to-make", "psm", "w", "h", "ztest", "zpsm"], - "vars": { "gp-0": "obj" } - }, - - "(method 0 ripple-control)": { - "vars": { "v0-0": "obj" } - }, - - "vector-seek-2d-xz-smooth!": { - "args": ["vec", "target", "max-step", "alpha"], - "vars": { - "f0-1": "x-diff", - "f2-1": "z-diff", - "f1-5": "x-step", - "f0-3": "z-step", - "f2-4": "step-len" - } - }, - - "vector-seek-2d-yz-smooth!": { - "args": ["vec", "target", "max-step", "alpha"], - "vars": { - "f0-1": "y-diff", - "f2-1": "z-diff", - "f1-5": "y-step", - "f0-3": "z-step", - "f2-4": "step-len", - "f2-6": "step-scale" - } - }, - - "vector-seek-3d-smooth!": { - "args": ["vec", "target", "max-step", "alpha"], - "vars": { - "f0-1": "x-diff", - "f1-2": "y-diff", - "f3-1": "z-diff", - "f2-6": "x-step", - "f1-3": "y-step", - "f0-4": "z-step", - "f3-5": "step-len", - "f3-7": "step-scale" - } - }, - - "seek-with-smooth": { - "args": ["value", "target", "max-step", "alpha", "deadband"], - "vars": { "f0-1": "diff", "f0-2": "step", "f1-4": "min-step" } - }, - - "vector-v+!": { - "args": ["result", "position", "velocity"] - }, - - "vector-v*float+!": { - "args": ["result", "position", "velocity", "velocity-scale"] - }, - - "vector-v++!": { - "args": ["position", "velocity"] - }, - - "vector-v*float!": { - "args": ["delta-p", "velocity", "scale"] - }, - - "vector-v*float++!": { - "args": ["position", "velocity", "scale"] - }, - - "vector-lerp!": { - "args": ["out", "a", "b", "alpha"] - }, - - "vector-lerp-clamp!": { - "args": ["out", "a", "b", "alpha"] - }, - - "vector4-lerp!": { - "args": ["out", "a", "b", "alpha"] - }, - - "vector4-lerp-clamp!": { - "args": ["out", "a", "b", "alpha"] - }, - - "vector-deg-lerp-clamp!": { - "args": ["out", "min-val", "max-val", "in"] - }, - - "make-file-name": { - "args": ["kind", "name", "art-group-version"] - }, - - "make-vfile-name": { - "args": ["kind", "name"] - }, - - "file-info-correct-version?": { - "args": ["info", "kind", "version-override"], - "vars": { "s5-0": "expected-version", "s4-0": "kind-name" } - }, - - "(method 0 load-dir)": { - "args": ["allocation", "type-to-make", "length", "unk"], - "vars": { "s4-0": "obj" } - }, - - "(method 0 load-dir-art-group)": { - "args": ["allocation", "type-to-make", "length", "unk"], - "vars": { "v0-0": "obj" } - }, - - "(method 0 external-art-buffer)": { - "args": ["allocation", "type-to-make", "idx"], - "vars": { "v0-0": "obj" } - }, - - "(method 0 external-art-control)": { - "vars": { "gp-0": "obj", "s4-0": "buff-idx", "v1-9": "rec-idx" } - }, - - "(method 9 display)": { - "args": ["obj", "slowdown"], - "vars": { "gp-0": "obj", "s5-0": "ratio" } - }, - - "set-draw-env-offset": { - "args": ["env", "x", "y"] - }, - - "set-display-env": { - "args": ["env", "psm", "width", "height", "dx", "dy", "fbp"] - }, - - "set-draw-env": { - "args": ["env", "psm", "width", "height", "ztest", "zpsm", "fbp"] - }, - - "set-display": { - "args": ["disp", "psm", "w", "h", "ztest", "zpsm"] - }, - - "set-display2": { - "args": ["disp", "psm", "w", "h", "ztest", "zpsm"] - }, - - "(method 11 profile-bar)": { - "args": ["obj", "name", "color"], - "vars": { "s5-0": "new-frame" } - }, - - "(method 12 profile-bar)": { - "args": ["obj", "name", "color"], - "vars": { "v0-0": "new-frame" } - }, - - "gs-set-default-store-image": { - "args": [ - "packet", - "src-fbp", - "src-w", - "src-psm", - "ssax", - "ssay", - "rrw", - "rrh" - ] - }, - - "store-image": { - "args": ["oddeven"], - "vars": { - "s4-0": "buff0", - "s1-0": "buff1", - "s0-0": "packet", - "gp-0": "file", - "s3-0": "width", - "s2-0": "height", - "s0-1": "ptr-0", - "sv-16": "ptr-1", - "sv-32": "y-idx", - "sv-48": "y-idx-2" - } - }, - - "(method 0 draw-context)": { - "args": [ - "allocation", - "type-to-make", - "org-x", - "org-y", - "width", - "height", - "color-0" - ], - "vars": { "v0-0": "obj" } - }, - - "draw-context-set-xy": { - "args": ["ctxt", "x", "y"] - }, - - "texture-qwc": { - "args": ["w", "h", "tex-format"] - }, - - "gs-find-block": { - "args": ["bx", "by", "tex-format"] - }, - - "gs-largest-block": { - "args": ["tex-width", "tex-height", "tex-format"], - "vars": { - "s5-0": "block-width", - "v1-0": "block-height", - "a0-6": "real-width", - "a1-4": "real-height", - "s5-1": "width-blocks", - "s3-1": "height-blocks", - "s2-0": "x", - "s1-0": "y", - "s4-1": "max-block" - } - }, - - "gs-blocks-used": { - "args": ["tex-width", "tex-height", "tex-format"], - "vars": { - "s4-0": "page-width", - "v1-0": "page-height", - "a0-6": "real-width", - "a1-4": "real-height", - "s3-0": "width-blocks", - "s1-0": "height-blocks" - } - }, - - "dma-buffer-add-ref-texture": { - "args": ["buf", "data", "tex-w", "tex-h", "tex-format"], - "vars": { - "s5-0": "data-ptr", - "v1-0": "qwc", - "a0-4": "qwc-this-time", - "a1-3": "eop", - "a3-1": ["setup-dma", "dma-packet"], - "a3-3": ["setup-dif", "gs-gif-tag"], - "a2-4": ["data-dma", "dma-packet"] - } - }, - - "(method 15 texture-pool)": { - "args": ["obj", "word-count"] - }, - - "(method 22 texture-pool)": { - "args": ["obj", "tpage-id"] - }, - - "(method 10 texture-page)": { - "args": ["obj", "segment-count", "additional-size"] - }, - - "(method 16 texture-pool)": { - "args": ["obj", "segment", "size"] - }, - - "(method 9 texture-page)": { - "args": ["obj", "seg"] - }, - - "texture-page-default-allocate": { - "args": ["pool", "page", "seg", "tpage-id"], - "vars": { "s3-0": "seg-id" } - }, - - "texture-page-common-allocate": { - "args": ["pool", "page", "seg", "tpage-id"], - "vars": { "s4-0": "seg-id" } - }, - - "(method 12 texture-page)": { - "args": ["obj", "new-dest", "seg-id"], - "vars": { - "a3-4": "dst-block", - "t0-1": "tex-id", - "t1-6": "tex", - "t2-0": "num-mips", - "t3-4": "mip-id" - } - }, - - "texture-page-common-boot-allocate": { - "args": ["pool", "page", "heap", "tpage-id"], - "vars": { "s2-0": "tex-id" } - }, - - "upload-vram-data": { - "args": ["buf", "dest", "tex-data", "tex-h"], - "vars": { - "a3-2": "height-this-time", - "a0-1": ["dma", "dma-packet"], - "a0-3": ["gif", "gs-gif-tag"], - "a0-5": "gs-data" - } - }, - - "upload-vram-pages": { - "args": ["pool", "segment", "page", "mode", "bucket-idx"], - "vars": { - "s3-0": "dma-buf", - "sv-16": "tex-data", - "sv-20": "tex-dest-base-chunk", - "sv-24": "chunk-count", - "sv-48": "tex-id", - "s1-0": "upload-chunk-idx", - "v1-24": "current-dest-chunk", - "sv-32": "chunks-to-upload-count", - "sv-40": "first-chunk-idx-to-upload", - "gp-0": "total-upload-size", - "s4-0": "dma-start", - "a0-26": ["dma", "dma-packet"], - "a0-28": ["gif", "gs-gif-tag"], - "a0-30": "gif-data", - "v1-50": ["dma-end", "dma-packet"] - } - }, - - "update-vram-pages": { - "args": ["pool", "pool-segment", "page", "mode"], - "vars": { - "t1-0": "dest-block", - "t2-0": "sz", - "t0-1": "page-id", - "a1-4": "upload-chunks", - "a2-3": "chunk-idx", - "v1-2": "modified-chunk-count", - "a3-8": "vram-chunk" - } - }, - - "upload-vram-pages-pris": { - "args": ["pool", "segment", "page", "bucket-idx", "allow-cache-mask"], - "vars": { - "s3-0": "dma-buf", - "sv-16": "tex-data", - "sv-20": "tex-dest-base-chunk", - "sv-24": "chunk-count", - "sv-32": "chunks-to-upload-count", - "sv-40": "first-chunk-idx-to-upload", - "sv-48": "page-id", - "s0-0": "upload-chunk-idx", - "sv-52": "current-dest-chunk", - "sv-56": "need-tex", - "gp-0": "total-upload-size", - "a0-21": ["dma", "dma-packet"], - "a0-23": ["gif", "gs-gif-tag"], - "v1-55": ["dma-end", "dma-packet"] - } - }, - - "texture-page-near-allocate-0": { - "args": ["pool", "page", "heap", "mode"], - "vars": { - "s3-0": "common-dest", - "s2-0": "page-seg-idx", - "a1-5": "page-seg-2-size", - "v1-15": "after-seg-2-data", - "a0-8": "seg-2-data" - } - }, - - "texture-page-near-allocate-1": { - "args": ["pool", "page", "heap", "mode"], - "vars": { - "s4-0": "seg2-size", - "a1-1": "seg2-dest", - "s2-0": "common-dest", - "s1-0": "page-seg-idx" - } - }, - - "texture-page-level-allocate": { - "args": ["pool", "page", "heap", "mode"], - "vars": { - "s2-0": "common-id", - "v1-6": "level-idx" - } - }, - - "texture-page-dir-inspect": { - "args": ["dir", "mode"], - "vars": { - "v1-0": "pool", - "s4-0": "level-idx", - "a1-3": "lev", - "s4-1": "entry-idx", - "s3-0": "entry-page", - "s2-0": "entry-link", - "s1-0": "entry-list-length" - } - }, - - "texture-page-size-check": { - "args": ["pool", "level", "hide-prints"], - "vars": { - "gp-0": "oversize", - "s3-0": "tfrag-page", - "v1-0": "tfrag-mip0-size", - "v1-3": "pris-page", - "v1-5": "shrub-page", - "v1-7": "alpha-page", - "v1-9": "water-page" - } - }, - - "(method 13 texture-pool)": { - "args": ["obj", "level", "max-page-kind", "id-array"], - "vars": { - "v1-0": "page-idx", - "v1-5": "tfrag-dir-entry", - "v1-7": "pris-dir-entry", - "v1-9": "shrub-dir-entry", - "v1-11": "alpha-dir-entry", - "v1-13": "water-dir-entry", - "a2-7": "overflow-bits" - } - }, - - "(method 14 texture-pool)": { - "args": ["obj", "level", "tex-page-kind"], - "vars": { - "s3-0": "tfrag-page", - "s2-0": "tfrag-bucket", - "f30-0": "distance", - "a2-4": "pris-page", - "a3-3": "pris-bucket", - "a2-5": "shrub-page", - "f0-5": "shrub-closest", - "t0-4": "shrub-bucket", - "a3-4": "shrub-mode", - "s3-1": "alpha-page", - "f0-6": "alpha-closest", - "s2-1": "alpha-bucket", - "s1-3": "alpha-mode", - "s0-0": "alpha-dest-chunk", - "a2-7": "water-page", - "a3-6": "water-bucket" - } - }, - - "(method 13 texture-page)": { - "args": ["obj", "dma-buff", "mode"], - "vars": { - "sv-16": "total-size", - "v1-7": "start-segment", - "s5-0": "chunk-count", - "s4-0": "current-dest", - "s3-0": "current-data", - "a3-1": "chunks-now", - "a0-1": ["pkt", "dma-packet"], - "a0-3": ["gs-tag", "gs-gif-tag"], - "a0-5": "gs-reg-data" - } - }, - - "texture-relocate": { - "args": ["dma-buff", "tex", "dest-loc", "dest-fmt", "clut-dst"], - "vars": { - "v1-0": "mip-level", - "t1-1": "mip-w", - "t2-3": "mip-h", - "t4-0": ["dma-pkt", "dma-packet"], - "t4-2": ["gs-pkt", "gs-gif-tag"] - } - }, - - "(method 11 texture-pool)": { - "vars": { - "s3-0": "font-clut", - "sv-16": "heap-before-font-tex", - "sv-20": "clut-dest-addr", - "s4-0": "dma-buff", - "s5-0": "main-font-tx", - "s2-0": "font-tx-1", - "s1-0": "font-tx-1-dest", - "s0-0": "font-tx-1-fmt", - "s2-1": "font-tx-0", - "s1-1": "font-tx-0-dest", - "s0-1": "font-tx-0-fmt", - "s2-2": "font-tx-3", - "s1-2": "font-tx-3-dest", - "s0-2": "font-tx-3-fmt", - "s2-3": "font-tx-2", - "s1-3": "font-tx-2-dest", - "s0-3": "font-tx-2-fmt" - } - }, - - "link-texture-by-id": { - "vars": { - "s4-0": "dir-entry" - } - }, - - "(method 9 texture-page-dir)": { - "args": ["obj", "heap"], - "vars": { - "v1-0": "mem-start", - "a1-1": "mem-end", - "a2-0": "entry-idx", - "t1-0": "entry", - "t0-0": "tex-page", - "a3-4": "link-arr", - "t0-3": "tex-count", - "t1-4": "tex-idx", - "t2-0": "link-slot", - "t3-2": ["shader", "adgif-shader"], - "t4-1": "dist-past-end" - } - }, - - "display-loop": { - "vars": { - "s3-0": "debug-buf", - "gp-0": "disp", - "s5-2": "debug-txt-buf" - } - }, - - "adgif-shader-login": { - "args": "shader", - "vars": { - "s5-0": "tex" - } - }, - - "adgif-shader-login-fast": { - "args": ["shader"], - "vars": { - "v1-4": "tex-id", - "a0-9": "dir-entry", - "s5-0": "tex" - } - }, - - "texture-page-login": { - "args": ["id", "alloc-func", "heap"], - "vars": { - "s5-0": "dir-entry", - "s4-0": "old-alloc-func", - "s3-0": "file-name" - } - }, - - "(method 9 __assert-info-private-struct)": { - "args": ["obj", "filename", "line-num", "column-num"] - }, - - "__assert": { - "args": ["exp", "msg"] - }, - - "__assert-min-max-range-float": { - "args": ["exp", "minimum", "maximum", "msg-exp", "msg-min", "msg-max"] - }, - - "__assert-min-max-range-int": { - "args": ["exp", "minimum", "maximum", "msg-exp", "msg-min", "msg-max"] - }, - - "__assert-zero-lim-range-int": { - "args": ["exp", "maximum", "msg-exp", "msg-max"] - }, - - "fog-corrector-setup": { - "args": ["corrector", "math-cam"] - }, - - "update-math-camera": { - "args": ["math-cam", "video-mode", "aspect"], - "vars": { - "f0-4": "temp1", - "v1-1": "elim1", - "f0-6": "temp2", - "v1-2": "elim2", - "f1-3": "x-rat", - "f0-7": "y-rat", - "v1-3": "cull-info", - "f2-2": "unused-x-thing", - "f2-5": "y-thing", - "f3-11": "one-plus-2x-squared", - "f3-14": "one-plus-2y-squared", - "f2-9": "temp3", - "a0-2": "elim3", - "f2-11": "near-x", - "f1-5": "near-y", - "f0-10": "near-corner-dist-sqr", - "f2-8": "unused-thing-2", - "f1-8": "near-z", - "f0-12": "temp4", - "a0-6": "elim4", - "f1-12": "dx-rat-2", - "f0-14": "d-temp-2", - "f2-13": "dx-rat-times-4", - "f3-21": "d-temp-3", - "f4-21": "inverse-x-len", - "f5-11": "inverse-x-len-2", - "f0-16": "temp5", - "a0-7": "elim5", - "f1-15": "dy-rat", - "f0-18": "d-temp-4", - "f2-15": "dy-rat-times-4", - "f3-22": "d-temp-5", - "f4-26": "inverse-y-len", - "f5-16": "inverse-y-len-2", - "f0-20": "temp6", - "v1-4": "elim6", - "v0-2": "cam-mat", - "f2-16": "fog-constant-1", - "f3-23": "fog-constant-2", - "f0-12": "fog-contsant-3", - "f0-24": "fog-at-near-plane", - "f1-22": "fog-factor-2", - "f4-35": "cam-fov-mult", - "f5-19": "corrected-fog", - "f5-23": "hvdf-x", - "f6-29": "hvdf-y", - "f2-18": "hvdf-z", - "f4-40": "hvdf-w", - "f2-19": "persp-xx", - "f3-36": "persp-yy", - "f1-32": "persp-x", - "v1-11": "sprite-row-0", - "v1-12": "sprite-row-1", - "v1-13": "sprite-row-2", - "v1-14": "sprite-row-3", - "f1-37": "temp7", - "v1-16": "elim7", - "v1-24": "pfog", - "a0-12": "vis-gif-0", - "a0-13": "vis-gif-1", - "a0-14": "vis-gif-1-again", - "a0-15": "vis-gif-1-again-again" - } - }, - - "move-target-from-pad": { - "args": ["trans", "pad-idx"], - "vars": { - "s4-0": "local-trans", - "a0-5": "inv-cam-rot", - "s3-0": "cam-rot-mat" - } - }, - - "(method 13 profile-bar)": { - "args": ["obj", "buf", "bar-pos"], - "vars": { - "v1-1": "height", - "a1-4": "block-idx", - "a2-1": "block-count", - "t0-0": "left", - "v1-3": "end-time", - "s4-0": "worst-time-cache", - "a3-1": "screen-y", - "t2-0": ["direct-tag", "dma-packet"], - "t2-2": ["start-gif-tag", "gs-gif-tag"], - "t1-4": "block" - } - }, - - "draw-sprite2d-xy": { - "args": ["buf", "x", "y", "w", "h", "color"], - "vars": { - "t2-1": "context", - "a0-3": "draw-x", - "a1-9": "draw-y", - "t1-2": "draw-w", - "t0-2": "draw-h", - "a3-2": ["dma", "dma-packet"], - "a3-4": ["gif", "gs-gif-tag"], - "v1-10": ["end-dma", "dma-packet"], - "a0-13": "total-qwc", - "a3-6": "gif-buf" - } - }, - - "draw-quad2d": { - "args": ["buf", "context"], - "vars": { - "a2-1": "draw-x", - "a3-7": "draw-y", - "t3-0": "draw-w", - "t2-0": "draw-h", - "v1-8": "end-dma", - "t1-0": ["dma", "dma-packet"], - "t1-2": ["gif", "gs-gif-tag"], - "t1-4": "gif-buf", - "a1-11": "total-qwc" - } - }, - - "set-display-gs-state": { - "args": ["dma-buf", "fbp", "scx", "scy", "fb-msk", "psm"], - "vars": { - "t3-0": ["dma", "dma-packet"], - "t3-2": ["gif", "gs-gif-tag"], - "t3-4": "gif-buf", - "t2-0": "fbw" - } - }, - - "set-display-gs-state-offset": { - "args": [ - "dma-buf", - "fbp", - "width", - "height", - "fb-msk", - "psm", - "off-x", - "off-y" - ], - "vars": { - "t4-0": "fbw", - "t5-0": ["dma", "dma-packet"], - "t5-2": ["gif", "gs-gif-tag"], - "t5-4": ["gif-data", "(pointer uint64)"] - } - }, - - "reset-display-gs-state": { - "args": ["disp", "dma-buf", "oddeven"], - "vars": { - "a3-0": "onscreen", - "v1-0": "hoff", - "a2-6": "fbp", - "t0-0": ["dma", "dma-packet"], - "t0-2": ["gif", "gs-gif-tag"], - "a3-3": ["gif-data", "(pointer uint64)"] - } - }, - - "(method 0 engine)": { - "args": ["allocation", "type-to-make", "name", "length"], - "vars": { "v0-0": "obj", "v1-11": "idx-to-link", "a0-1": "end-idx" } - }, - - "(method 10 engine)": { - "args": ["obj", "f"], - "vars": { "a0-1": "current", "s4-0": "next" } - }, - - "(method 11 engine)": { - "args": ["obj", "f"], - "vars": { "s4-0": "iter" } - }, - - "(method 12 engine)": { - "vars": { "s4-0": ["ct", "connection"] } - }, - - "(method 13 engine)": { - "vars": { "s4-0": ["ct", "connection"], "v1-2": "result" } - }, - - "(method 19 engine)": { - "args": ["obj", "p1-value"], - "vars": { "a0-1": "current", "s4-0": "next" } - }, - - "(method 20 engine)": { - "args": ["obj", "p2-value"], - "vars": { "a0-1": "current", "s4-0": "next" } - }, - - "connection-process-apply": { - "args": ["proc", "func"], - "vars": { "s5-0": "iter" } - }, - - "(method 15 engine)": { - "args": ["obj", "proc", "func", "p1", "p2", "p3"], - "vars": { "v1-0": "con" } - }, - - "surface-interp!": { - "args": ["dst", "src0", "src1", "amount"] - }, - - "surface-mult!": { - "args": ["dst", "src0", "src1"] - }, - - "(method 0 collide-shape-prim)": { - "args": ["allocation", "type-to-make", "cshape", "prim-id", "size-bytes"] - }, - - "(method 0 collide-shape-prim-sphere)": { - "args": ["allocation", "type-to-make", "cshape", "prim-id"], - "vars": { "v0-0": ["obj", "collide-shape-prim-sphere"] } - }, - "(method 0 collide-shape-prim-mesh)": { - "args": ["allocation", "type-to-make", "cshape", "mesh-id", "prim-id"], - "vars": { "v0-0": ["obj", "collide-shape-prim-mesh"] } - }, - "(method 0 collide-shape-prim-group)": { - "args": ["allocation", "type-to-make", "cshape", "elt-count", "prim-id"], - "vars": { "v0-0": ["obj", "collide-shape-prim-group"] } - }, - "(method 0 collide-shape)": { - "args": [ - "allocation", - "type-to-make", - "proc", - "collide-list-kind", - "prim-id" - ], - "vars": { "s5-0": "obj" } - }, - "(method 0 collide-sticky-rider-group)": { - "vars": { "v0-0": "obj" } - }, - "(method 11 touching-prims-entry-pool)": { - "vars": { "a1-0": "current", "v1-0": "prev", "a2-0": "next" } - }, - "(method 0 touching-list)": { - "vars": { "v0-0": ["obj", "touching-list"] } - }, - - "cspace-by-name-no-fail": { - "vars": { "v0-0": ["result", "cspace"] } - }, - - "num-func-loop!": { - "args": ["chan", "inc"], - "vars": { "f0-1": "duration", "f1-2": "after-inc", "f0-3": "wrapped" } - }, - - "shrubbery-login-post-texture": { - "args": ["obj"], - "vars": { - "v1-1": "shader-count", - "a1-1": ["dst", "qword"], - "a2-5": ["tex-dst", "qword"], - "a3-0": ["src", "qword"], - "a2-6": ["text-dst2", "qword"], - "a3-1": ["src-2", "qword"], - "a3-2": ["src-3", "qword"] - } - }, - - "(method 20 actor-link-info)": { - "args": ["obj", "message"], - "vars": { - "s4-0": "iter", - "s5-0": "result", - "a0-1": "proc", - "a1-1": "msg-block" - } - }, - - // LEVEL - "lookup-level-info": { - "args": ["name"], - "vars": { - "a1-1": ["info", "level-load-info"], - "v1-0": "rest", - "a1-0": "current-sym" - } - }, - - "(method 21 level-group)": { - "args": ["obj", "name", "cmd-idx"], - "vars": { "v1-1": "cmd-lst" } - }, - - // SHADOW-CPU-H - "(method 0 shadow-control)": { - "args": [ - "allocation", - "type-to-make", - "bottom-offset", - "top-offset", - "dir", - "center", - "fade" - ], - "vars": { "v0-0": "obj" } - }, - - // RES - "(method 0 res-lump)": { - "args": ["allocation", "type-to-make", "data-count", "data-size"], - "vars": { "v0-0": "obj" } - }, - "(method 20 res-lump)": { - "args": ["obj", "time", "result", "buf"], - "vars": { - "t0-2": "tag-lo", - "t1-2": "tag-hi", - "v1-6": "elt-count", - "f0-2": "interp", - "a1-6": "src-lo", - "a2-13": "src-hi" - } - }, - "(method 3 res-lump)": { - "vars": { "s5-0": "i" } - }, - "(method 9 res-lump)": { - "args": ["obj", "name", "mode", "time", "default", "tag-addr", "buf-addr"], - "vars": { "s3-0": "tag-pair" } - }, - "(method 10 res-lump)": { - "args": ["obj", "name", "mode", "time", "default", "tag-addr", "buf-addr"], - "vars": { "s3-0": "tag-pair", "v1-4": "tag" } - }, - "(method 11 res-lump)": { - "args": ["obj", "name", "mode", "time", "default", "tag-addr", "buf-addr"], - "vars": { - "a2-1": "tag-pair", - "s1-0": "tag", - "s0-0": "tag-type", - "gp-1": "data" - } - }, - "(method 12 res-lump)": { - "args": ["obj", "name", "mode", "time", "default", "tag-addr", "buf-addr"], - "vars": { - "a2-1": "tag-pair", - "s1-0": "tag", - "s0-0": "tag-type", - "gp-1": "data" - } - }, - "(method 16 res-lump)": { - "vars": { - "v1-0": "tags-sorted", - "a1-0": "i", - "a2-1": "tag-stop", - "a3-2": "tag1", - "t0-3": "tag2", - "t1-6": "tag-name1", - "t2-6": "tag-name2" - } - }, - "(method 15 res-lump)": { - "vars": { - "s5-0": ["tag-pair", "res-tag-pair"], - "s2-0": "existing-tag", - "s3-0": "data-size", - "v1-25": "resource-mem" - } - }, - - "(method 17 res-lump)": { - "vars": { - "a0-2": "new-tag", - "s4-0": "tag-mem" - } - }, - - "(method 8 res-lump)": { - "args": ["obj", "block", "flags"], - "vars": { - "s3-0": "mem-use-id", - "s2-0": "mem-use-name", - "v1-22": "obj-size", - "s1-0": "tag-idx", - "s0-0": "tag-data" - } - }, - - // FACT-H - "(method 0 fact-info-target)": { - "vars": { "gp-0": "obj" } - }, - "(method 0 fact-info-enemy)": { - "vars": { - "gp-0": "obj", - "s5-0": "entity" - } - }, - - "(method 0 fact-info)": { - "args": ["allocation", "type-to-make", "proc", "pkup-type", "pkup-amount"], - "vars": { - "gp-0": ["obj", "fact-info"], - "s5-0": "ent", - "sv-16": "tag" - } - }, - - "(method 0 align-control)": { - "vars": { "v0-0": ["obj", "align-control"] } - }, - - "str-load": { - "args": ["name", "chunk-id", "address", "len"], - "vars": { "s2-0": ["cmd", "load-chunk-msg"] } - }, - - "str-load-status": { - "args": ["length-out"], - "vars": { "v1-7": "response" } - }, - - "str-play-async": { - "args": ["name", "addr"], - "vars": { "s4-0": "cmd" } - }, - - "str-play-stop": { - "args": ["name"], - "vars": { "s5-0": "cmd" } - }, - - "str-play-queue": { - "args": ["name"], - "vars": { "s5-0": "cmd" } - }, - - "str-ambient-play": { - "args": ["name"], - "vars": { "s5-0": "cmd" } - }, - - "str-ambient-stop": { - "args": ["name"], - "vars": { "s5-0": "cmd" } - }, - - "string->sound-name": { - "args": ["str"], - "vars": { - "v1-0": "snd-name", - "a1-0": ["out-ptr", "(pointer uint8)"], - "a2-0": "in-ptr" - } - }, - "dgo-load-begin": { - "args": ["name", "buffer1", "buffer2", "current-heap"], - "vars": { "s2-0": "cmd" } - }, - - "dgo-load-get-next": { - "args": ["last-object"], - "vars": { "gp-0": ["load-location", "pointer"], "v1-5": "response" } - }, - - "dgo-load-continue": { - "args": ["current-heap"], - "vars": { "gp-0": "cmd" } - }, - "dgo-load-cancel": { - "vars": { "a2-0": "cmd" } - }, - - "find-temp-buffer": { - "args": ["size"], - "vars": { "gp-0": "qwc" } - }, - - "dgo-load-link": { - "args": ["obj-file", "heap", "print-login", "last-object"], - "vars": { "s4-0": "obj-data" } - }, - - "ramdisk-load": { - "args": ["file-id", "offset", "length", "buffer"], - "vars": { "v1-1": "cmd" } - }, - - "show-mc-info": { - "args": ["dma-buf"], - "vars": { "s5-0": "info", "s4-0": "slot-idx" } - }, - - "(method 19 res-lump)": { - "args": ["obj", "name-sym", "mode", "time"], - "vars": { - "t2-4": "type-chars", - "t3-1": "max-search", - "t4-0": "min-search", - "t6-5": "diff", - "t5-2": "check-idx", - "t4-1": "tag-idx", - "t3-13": "interp-tag-idx", - "t4-4": "tag-ptr", - "t0-6": "lo-tag-idx-out", - "v1-14": "hi-tag-idx-out", - "t1-0": "most-recent-invalid-time-idx" - } - }, - - "entity-actor-count": { - "args": ["res", "name"], - "vars": { - "sv-16": "tag" - } - }, - - "(method 0 joint-mod)": { - "args": ["allocation", "type-to-make", "mode", "proc", "joint-idx"], - "vars": { - "gp-0": "obj", - "v1-7": "twist-max" - } - }, - - "joint-mod-debug-draw": { - "args": ["mod"] - }, - - "(method 9 joint-mod)": { - "args": ["obj", "handler-mode"], - "vars": { "v1-0": "joint", "a0-1": "mode" } - }, - - "(method 10 joint-mod)": { - "args": ["obj", "target-trans"], - "vars": { "f0-0": "distance" } - }, - - "(method 13 joint-mod)": { "args": ["obj", "x", "y", "z"] }, - "(method 14 joint-mod)": { "args": ["obj", "trans", "rot", "scale"] }, - "(method 11 joint-mod)": { - "args": ["obj", "target-trans", "option", "proc"], - "vars": { - "s1-0": "proc-drawable", - "s3-1": ["enemy-facts", "fact-info-enemy"], - "f30-0": "dist" - } - }, - - "joint-mod-look-at-handler": { "args": ["csp", "xform", "mat"] }, - "(method 9 collide-history)": { - "args": ["obj", "cshape", "xs", "transv", "transv-out"] - }, - - "add-debug-sphere-from-table": { - "vars": { "s1-0": ["points", "(inline-array vector)"] } - }, - - "entity-actor-lookup": { - "args": ["lump", "name", "idx"] - }, - - "(method 0 actor-link-info)": { - "args": ["allocation", "type-to-make", "proc"], - "vars": { "s5-0": "obj", "a0-1": "ent" } - }, - - "(method 25 actor-link-info)": { - "vars": { "s5-0": "actor", "gp-0": "count" } - }, - - "(method 9 actor-link-info)": { - "args": ["obj", "matching-type"], - "vars": { "s3-0": "actor", "s5-0": "mask", "s4-0": "current-bit" } - }, - - "(method 10 actor-link-info)": { - "vars": { "s5-0": "this-actor", "s4-0": "actor", "gp-0": "count" } - }, - - "alt-actor-list-subtask-incomplete-count": { - "vars": { - "s4-0": "alt-actor-count", - "gp-0": "incomplete-count", - "s3-0": "alt-actor-idx" - } - }, - - "check-irx-version": { - "vars": { "gp-0": ["cmd", "sound-rpc-get-irx-version"] } - }, - "sound-bank-load": { - "vars": { "v1-1": ["cmd", "sound-rpc-load-bank"] } - }, - "sound-bank-unload": { - "vars": { "v1-1": ["cmd", "sound-rpc-unload-bank"] } - }, - "sound-music-load": { - "vars": { "v1-1": ["cmd", "sound-rpc-load-music"] } - }, - "sound-music-unload": { - "vars": { "v1-1": ["cmd", "sound-rpc-unload-music"] } - }, - "sound-reload-info": { - "vars": { "v1-1": ["cmd", "sound-rpc-reload-info"] } - }, - "set-language": { - "vars": { "v1-1": ["cmd", "sound-rpc-set-language"] } - }, - "list-sounds": { - "vars": { "v1-1": ["cmd", "sound-rpc-list-sounds"] } - }, - "sound-set-volume": { - "vars": { "v1-0": ["cmd", "sound-rpc-set-master-volume"] } - }, - "sound-set-reverb": { - "vars": { "v1-0": ["cmd", "sound-rpc-set-reverb"] } - }, - "sound-set-ear-trans": { - "vars": { "gp-0": ["cmd", "sound-rpc-set-ear-trans"] } - }, - "sound-play-by-name": { - "args": ["name", "id", "vol", "pitch", "bend", "group", "trans"], - "vars": { - "s5-0": ["cmd", "sound-rpc-play"], - "s3-1": ["proc", "process-drawable"], - "s4-0": "sound-trans" - } - }, - "sound-play-by-spec": { - "args": ["spec", "id", "trans"], - "vars": { - "s5-0": ["cmd", "sound-rpc-play"], - "s3-1": ["proc", "process-drawable"] - } - }, - "sound-pause": { - "vars": { "v1-0": ["cmd", "sound-rpc-pause-sound"] } - }, - "sound-stop": { - "vars": { "v1-0": ["cmd", "sound-rpc-stop-sound"] } - }, - "sound-continue": { - "vars": { "v1-0": ["cmd", "sound-rpc-continue-sound"] } - }, - "sound-group-pause": { - "vars": { "v1-0": ["cmd", "sound-rpc-pause-group"] } - }, - "sound-group-stop": { - "vars": { "v1-0": ["cmd", "sound-rpc-stop-group"] } - }, - "sound-group-continue": { - "vars": { "v1-0": ["cmd", "sound-rpc-continue-group"] } - }, - "sound-set-falloff-curve": { - "vars": { "v1-0": ["cmd", "sound-rpc-set-falloff-curve"] } - }, - "sound-set-sound-falloff": { - "vars": { "v1-0": ["cmd", "sound-rpc-set-sound-falloff"] } - }, - "sound-set-flava": { - "vars": { "v1-0": ["cmd", "sound-rpc-set-flava"] } - }, - "sound-set-fps": { - "vars": { "v1-0": ["cmd", "sound-rpc-set-fps"] } - }, - "(method 0 ambient-sound)": { - "vars": { "s5-1": ["obj", "ambient-sound"], "v1-2": "bc" } - }, - "(method 9 ambient-sound)": { - "vars": { "s5-1": "spec", "s4-2": "spec-volume" } - }, - "(method 11 ambient-sound)": { - "vars": { "gp-0": ["cmd", "sound-rpc-set-param"] } - }, - "(method 12 ambient-sound)": { - "vars": { "v1-2": ["cmd", "sound-rpc-set-param"] } - }, - "sound-buffer-dump": { - "vars": { "s3-0": ["cmd", "sound-rpc-play"] } - }, - - "(method 0 path-control)": { - "args": ["allocation", "type-to-make", "proc", "name", "time"], - "vars": { - "gp-0": ["obj", "path-control"], - "s3-1": "ent", - "v1-7": "lookup-entity", - "sv-16": "tag", - "v1-9": "data" - } - }, - - "(method 0 curve-control)": { - "args": ["allocation", "type-to-make", "proc", "name", "time"], - "vars": { "gp-0": "obj", "s3-1": "ent", "v1-3": "lookup-entity" } - }, - - "nav-mesh-connect": { - "args": ["proc", "trans", "nav-cont"], - "vars": { - "s2-0": "ent", - "v0-0": "lookup-entity", - "s3-0": "entity-nav-mesh" - } - }, - - "(method 0 nav-control)": { - "args": [ - "allocation", - "type-to-make", - "shape", - "sphere-count", - "nearest-y-threshold-default" - ], - "vars": { "s5-0": ["obj", "nav-control"], "a0-3": "ent" } - }, - - "add-debug-point": { - "args": ["enable-draw", "bucket", "pt"], - "vars": { - "a0-6": ["a0-6", "(pointer uint64)"], - "a0-7": ["a0-7", "dma-packet"], - "a3-0": ["a3-0", "dma-packet"], - "a3-2": ["a3-2", "gs-gif-tag"], - "a3-4": ["a3-4", "vector4w-2"], - "a3-6": ["a3-6", "vector4w-2"], - "a3-8": ["a3-8", "vector4w-2"], - "a1-30": ["a1-30", "vector4w-2"], - "v1-7": "buf" - } - }, - "internal-draw-debug-line": { - "vars": { - "s2-0": ["s2-0", "rgba"], - "s5-0": ["s5-0", "rgba"], - "a3-1": ["a3-1", "dma-packet"], - "a3-3": ["a3-3", "gs-gif-tag"], - "a1-43": ["a1-43", "(inline-array vector4w-2)"], - "a0-31": ["a0-31", "(pointer uint64)"], - "a0-32": ["a0-32", "dma-packet"] - } - }, - "add-debug-flat-triangle": { - "vars": { - "a3-1": ["a3-1", "dma-packet"], - "a3-3": ["a3-3", "gs-gif-tag"], - "a3-5": ["a3-5", "(inline-array vector4w-3)"], - "a0-9": ["a0-9", "(pointer uint64)"], - "a0-10": ["a0-10", "dma-packet"] - } - }, - "add-debug-line2d": { - "vars": { - "a2-3": ["a2-3", "dma-packet"], - "a2-5": ["a2-5", "gs-gif-tag"], - "a2-7": ["a2-7", "(inline-array vector4w)"], - "a2-9": ["a2-9", "(inline-array vector4w)"], - "a0-20": ["a0-20", "(pointer uint64)"], - "v1-10": ["v1-10", "dma-packet"] - } - }, - "debug-percent-bar": { - "vars": { - "v1-5": ["v1-5", "dma-packet"] - } - }, - "debug-pad-display": { - "vars": { - "v1-12": ["v1-12", "dma-packet"] - } - }, - "internal-draw-debug-text-3d": { - "vars": { - "v1-11": ["v1-11", "dma-packet"] - } - }, - - "generic-init-buffers": { - "vars": { - "v1-8": ["packet", "dma-packet"], - "gp-0": ["gp-0", "gs-zbuf"], - "s5-0": ["s5-0", "gs-zbuf"] - } - }, - - "level-update-after-load": { - "args": ["loaded-level", "level-login-state"], - "vars": { - "s3-0": "level-drawable-trees", - "s5-0": "initial-timer", - "v1-4": "current-timer", - "v1-5": "elapsed-timer", - "s2-0": "current-login-pos", - "s2-1": ["current-drawable", "drawable-tree"], - "s1-0": "idx-in-drawable" - } - }, - - "(method 9 setting-data)": { - "vars": { - "s3-0": ["conn", "connection"] - } - }, - - "(method 12 level)": { - "vars": { - "s5-3": ["s5-3", "pair"] - } - }, - - "update-sound-banks": { - "vars": { - "t0-0": ["t0-0", "symbol"] - } - }, - - "(method 16 level-group)": { - "vars": { - "s1-0": ["s1-0", "continue-point"] - } - }, - - "(method 20 level)": { - "vars": { - "s3-0": ["s3-0", "ramdisk-rpc-fill"] - } - }, - - "(method 9 game-info)": { - "args": ["obj", "cause", "save-to-load", "continue-point-override"], - "vars": { - "v1-0": "selected-cause", - "s4-1": "lev-info" - } - }, - - "(method 10 game-info)": { - "args": ["obj", "item", "amount", "source"], - "vars": { - "v1-10": "proc", - "s4-1": "level-idx", - "a0-35": "buzz-task", - "s4-2": "buzz-index", - "f30-0": "buzz-count", - "s3-0": "ctrl", - "s5-2": "buzz-bits" - } - }, - - "(method 14 game-info)": { - "args": ["obj", "lev"], - "vars": { - "s5-0": "perms", - "s4-0": "lev-entities", - "s3-0": "lev-entity-idx", - "s2-0": "lev-entity-perm", - "v1-8": "info-entity-perm" - } - }, - - "(method 15 game-info)": { - "args": ["obj", "lev"], - "vars": { - "s5-0": "lev-entities", - "s4-0": "lev-entity-idx", - "s3-0": "lev-entity-perm", - "v1-7": "info-entity-perm" - } - }, - - "(method 25 game-info)": { - "args": ["obj", "save"], - "vars": { - "v1-0": ["save-data", "game-save-tag"], - "s4-0": ["data", "game-save-tag"], - "v1-9": "old-base-frame", - "v1-10": "frame-counter-diff" - } - }, - - "(method 10 game-save)": { - "args": ["obj", "filename"], - "vars": { - "s5-0": "stream", - "s3-0": "in-size", - "s4-0": "my-size" - } - }, - - "(method 11 game-save)": { - "args": ["obj", "detail"], - "vars": { - "s4-0": ["tag", "game-save-tag"], - "s3-0": "tag-idx", - "s2-1": "prog-lev-idx", - "a2-13": "lev-name" - } - }, - - "debug-menu-func-decode": { - "vars": { - "v0-0": ["ret-val", "symbol"] - } - }, - - "letterbox": { - "vars": { - "s5-0": "dma-buf", - "v1-5": ["pkt", "dma-packet"] - } - }, - - "blackout": { - "vars": { - "s5-0": "dma-buf", - "gp-0": "sprite-dma-data", - "v1-4": ["pkt", "dma-packet"] - } - }, - - "set-master-mode": { - "args": ["new-mode"], - "vars": { "v1-3": "mode" } - }, - - "main-cheats": { - "vars": { - "v1-13": "cheatmode-state", - "v1-158": "cheatmode-debug-state", - "v1-303": "cheat-language-state", - "v1-394": "cheat-pal-state", - "s5-11": "dma-buff", - "gp-11": "dma-start", - "v1-626": ["dma-pkt", "dma-packet"], - "gp-12": "timeout", - "v1-641": "inactive-timeout", - "gp-13": "game-end-proc" - } - }, - - "load-game-text-info": { - "args": ["txt-name", "curr-text", "heap"], - "vars": { - "sv-16": "heap-sym-heap", - "sv-24": "lang", - "sv-32": "load-status", - "sv-40": "heap-free" - } - }, - - "(method 13 art-group)": { - "vars": { - "s3-0": "art-elt", - "s4-0": "janim", - "v1-9": "janim-group", - "s2-0": "success" - } - }, - - "(method 14 art-group)": { - "vars": { - "s3-0": "art-elt", - "s4-0": "janim", - "v1-9": "janim-group", - "s3-1": "success" - } - }, - - "(method 16 process-drawable)": { - "vars": { - "s3-0": "body-T-world", - "s0-0": "world-T-body", - "s2-0": "grav-rt-body", - "a1-5": "vel-rt-body" - } - }, - - "(method 11 cam-float-seeker)": { - "args": ["obj", "offset"], - "vars": { - "f1-2": "pos-error", - "f0-5": "partial-velocity-limit", - "f1-3": "daccel", - "f1-6": "abs-vel", - "f0-6": "abs-vel-limit", - "f0-10": "dpos" - } - }, - - "(method 9 trsqv)": { - "args": ["obj", "dir", "vel", "frame-count"], - "vars": { - "f0-0": "yaw-error", - "f1-2": "yaw-limit", - "f30-0": "saturated-yaw", - "a1-2": "quat", - "f0-2": "old-diff" - } - }, - - "(method 13 trsqv)": { - "args": ["obj", "yaw", "vel", "frame-count"] - }, - - "(method 16 trsqv)": { - "vars": { - "s5-0": "quat", - "s1-0": "grav", - "s3-0": "rot-mat", - "s4-0": "dir-z", - "a0-4": "dir-x" - } - }, - - "(method 25 trsqv)": { - "vars": { - "s5-0": "quat", - "gp-0": "dir-z", - "s5-1": "dir-y", - "a1-2": "dir-grav", - "v1-2": "grav-z-plane", - "f0-1": "grav-dot" - } - }, - - "(method 17 trsqv)": { - "args": ["obj", "target", "y-rate", "z-rate"], - "vars": { - "gp-0": "quat", - "s5-0": "temp-quat" - } - }, - - "raw-ray-sphere-intersect": { - "vars": { - "v0-0": ["result", "float"], - "v1-0": ["v1-0", "float"] - } - }, - - "ray-sphere-intersect": { - "args": ["ray-origin", "ray-dir", "sph-origin", "radius"] - }, - - "ray-circle-intersect": { - "args": ["ray-origin", "ray-dir", "circle-origin", "radius"] - }, - - "ray-cylinder-intersect": { - "args": [ - "ray-origin", - "ray-dir", - "cyl-origin", - "cyl-axis", - "cyl-rad", - "cyl-len" - ] - }, - - "(method 10 cylinder)": { - "args": ["obj", "probe-origin", "probe-dir"], - "vars": { - "f30-0": "result", - "f0-5": "u-origin-sph", - "s4-0": "end-pt", - "f0-8": "u-end-sphere" - } - }, - - "(method 10 cylinder-flat)": { - "args": ["obj", "probe-origin", "probe-dir"], - "vars": { - "f30-0": "result", - "f0-5": "u-origin-circle", - "s5-0": "end-pt", - "f0-8": "u-end-circle" - } - }, - - "ray-arbitrary-circle-intersect": { - "args": [ - "probe-origin", - "probe-dir", - "circle-origin", - "circle-normal", - "radius" - ] - }, - - "print-tr-stat": { - "args": ["stat", "name", "dest"] - }, - - "update-subdivide-settings!": { - "args": ["settings", "math-cam", "idx"] - }, - - "start-perf-stat-collection": { - "vars": { - "v1-2": "frame-idx", - "v1-5": "bucket", - "a0-2": "which-stat", - "a0-7": "stat-idx" - } - }, - - "ja-play-spooled-anim": { - "vars": { - "sv-16": "spool-part", - "sv-28": "old-skel-status", - "sv-64": "spool-sound" - } - }, - - "(method 3 anim-tester)": { - "vars": { - "s5-0": ["s5-0", "anim-test-obj"], - "s4-0": ["s4-0", "anim-test-sequence"], - "s3-0": ["s3-0", "anim-test-seq-item"] - } - }, - - "anim-test-obj-item-valid?": { - "vars": { - "s5-0": ["s5-0", "anim-test-sequence"] - } - }, - - "anim-test-obj-remove-invalid": { - "vars": { - //"s5-0": ["s5-0", "anim-test-sequence"], - "v1-31": ["v1-31", "anim-test-sequence"], - "s3-0": ["s3-0", "anim-test-seq-item"], - "s2-0": ["s2-0", "anim-test-seq-item"] - } - }, - - "anim-tester-reset": { - "vars": { - "v1-1": ["v1-1", "anim-test-obj"] - } - }, - - "anim-tester-save-object-seqs": { - "vars": { - "s4-2": ["s4-2", "anim-test-seq-item"] - } - }, - - "sprite-setup-header": { - "args": ["hdr", "num-sprites"] - }, - - "(method 0 sprite-aux-list)": { - "args": ["allocation", "type-to-make", "size"] - }, - - "sprite-setup-frame-data": { - "args": ["data", "tbp-offset"] - }, - - "(method 0 sprite-array-2d)": { - "args": ["allocation", "type-to-make", "group-0-size", "group-1-size"], - "vars": { - "v1-0": "sprite-count", - "s4-0": "vec-data-size", - "a2-3": "adgif-data-size" - } - }, - - "(method 0 sprite-array-3d)": { - "args": ["allocation", "type-to-make", "group-0-size", "group-1-size"], - "vars": { - "v1-0": "sprite-count", - "s4-0": "vec-data-size", - "a2-3": "adgif-data-size" - } - }, - - "sprite-set-3d-quaternion": { - "args": ["data", "quat"] - }, - "sprite-get-3d-quaternion": { - "args": ["data", "quat"] - }, - "sprite-add-matrix-data": { - "args": ["dma-buff", "matrix-mode"], - "vars": { - "v1-0": "count", - "a2-1": ["pkt1", "dma-packet"], - "a1-2": ["mtx", "matrix"], - "a2-9": ["pkt2", "dma-packet"], - "a1-11": "mtx2", - "a1-20": "hvdf-idx" - } - }, - - "sprite-add-frame-data": { - "args": ["dma-buff", "tbp-offset"], - "vars": { - "a0-1": ["pkt", "dma-packet"] - } - }, - - "sprite-add-2d-chunk": { - "args": [ - "sprites", - "start-sprite-idx", - "num-sprites", - "dma-buff", - "mscal-addr" - ], - "vars": { - "a0-1": ["pkt1", "dma-packet"], - "s1-0": "qwc-pkt1", - "a1-7": "qwc-pkt2", - "a0-5": ["pkt2", "dma-packet"], - "a1-11": "qwc-pkt3", - "a0-7": ["pkt3", "dma-packet"], - "v1-7": ["pkt4", "dma-packet"] - } - }, - - "sprite-add-2d-all": { - "args": ["sprites", "dma-buff", "group-idx"], - "vars": { - "s4-0": "current-sprite-idx", - "s2-0": "remaining-sprites", - "s3-0": "mscal-addr" - } - }, - - "sprite-add-3d-chunk": { - "args": ["sprites", "start-sprite-idx", "num-sprites", "dma-buff"], - "vars": { - "a0-1": ["pkt1", "dma-packet"], - "s2-0": "qwc-pkt1", - "a1-7": "qwc-pkt2", - "a0-5": ["pkt2", "dma-packet"], - "a1-11": "qwc-pkt3", - "a0-7": ["pkt3", "dma-packet"], - "v1-7": ["pkt4", "dma-packet"] - } - }, - - "sprite-add-3d-all": { - "args": ["sprites", "dma-buff", "group-idx"], - "vars": { - "s4-0": "current-sprite-idx", - "s3-0": "remaining-sprites" - } - }, - - "sprite-add-shadow-chunk": { - "args": ["shadow-buff", "start-idx", "num-sprites", "dma-buff"], - "vars": { - "s2-0": "qwc-pkt1", - "a0-1": ["pkt1", "dma-packet"], - "a1-7": "qwc-pkt2", - "a0-5": ["pkt2", "dma-packet"], - "v1-5": "sprite-idx", - "a0-7": "dma-vec-data", - "a1-14": "in-vec-data", - "a1-15": "qwc-pkt3", - "a0-11": ["pkt3", "dma-packet"], - "s2-1": "si", - "s1-0": "dma-adgif-data", - "s0-0": "in-adgif-data", - "v1-21": ["pkt4", "dma-packet"] - } - }, - - "sprite-add-shadow-all": { - "args": ["shadow-buff", "dma-buff"], - "vars": { - "s4-0": "current-shadow", - "s3-0": "remaining-shadows" - } - }, - - "sprite-draw": { - "args": "disp", - "vars": { - "gp-0": "dma-mem-begin", - "s4-0": "dma-buff", - "s5-0": "dma-bucket-begin", - "a0-9": ["pkt1", "dma-packet"], - "a0-11": ["giftag", "gs-gif-tag"], - "a0-17": ["pkt2", "dma-packet"], - "a0-19": ["pkt3", "dma-packet"], - "a0-26": ["pkt4", "dma-packet"], - "v1-26": ["pkt5", "dma-packet"], - "v1-31": "mem-use" - } - }, - - "mem-usage-bsp-tree": { - "args": ["header", "node", "mem-use", "flags"] - }, - - "(method 8 bsp-header)": { - "args": ["obj", "mem-use", "flags"] - }, - - "(method 10 bsp-header)": { - "args": ["obj", "other-draw", "disp-frame"], - "vars": { - "s4-0": "lev", - "a2-3": "vis-list-qwc", - "v1-15": "vis-list-qwc2", - "a0-9": ["vis-list-spad", "(pointer uint128)"], - "a1-5": ["vis-list-lev", "(pointer uint128)"], - "a2-4": "current-qw" - } - }, - - "bsp-camera-asm": { - "args": ["bsp-hdr", "camera-pos"], - "vars": { - "v1-0": ["next-node", "bsp-node"], - "a1-1": "real-node" - } - }, - - "level-remap-texture": { - "args": ["tex-id"], - "vars": { - "v1-1": "bsp-hdr", - "a3-0": "table-size", - "v1-2": ["table-data-start", "(pointer uint64)"], - "t0-0": "table-data-ptr", - "a1-1": "mask1", - "a2-1": "masked-tex-id", - "a3-2": "table-data-end", - "t0-3": "midpoint", - "t1-1": "diff" - } - }, - - "debug-menu-make-from-template": { - "vars": { - "s5-1": ["s5-1", "string"] - } - }, - - "debug-menu-item-var-render": { - "vars": { - "v1-14": ["v1-14", "dma-packet"] - } - }, - - "generic-add-constants": { - "vars": { - "a0-1": ["a0-1", "dma-packet"] - } - }, - - "generic-init-buf": { - "vars": { - "a0-2": ["a0-2", "dma-packet"], - "a0-4": ["a0-4", "gs-gif-tag"], - "a0-9": ["a0-9", "dma-packet"], - "v1-7": ["v1-7", "(pointer int32)"] - } - }, - - "(anon-function 1 cam-combiner)": { - "vars": { - "pp": ["pp", "process"] - } - }, - - "(anon-function 2 cam-combiner)": { - "vars": { - "a0-3": ["vec", "(pointer vector)"] - } - }, - - "(method 14 sync-info)": { - "args": ["obj", "period", "phase"], - "vars": { - "f0-1": "period-float", - "f1-1": "value" - } - }, - - "(method 14 sync-info-eased)": { - "args": ["obj", "period", "phase", "out-param", "in-param"], - "vars": { - "f0-9": "total-easing-phase", - "f1-11": "total-normal-phase", - "f0-1": "period-float", - "f1-1": "value", - "f3-4": "y-end" - } - }, - - "(method 14 sync-info-paused)": { - "args": ["obj", "period", "phase", "out-param", "in-param"] - }, - - "(method 15 sync-info)": { - "args": [ - "obj", - "proc", - "default-period", - "default-phase", - "default-out", - "default-in" - ] - }, - - "(method 15 sync-info-eased)": { - "args": [ - "obj", - "proc", - "default-period", - "default-phase", - "default-out", - "default-in" - ] - }, - - "(method 15 sync-info-paused)": { - "args": [ - "obj", - "proc", - "default-period", - "default-phase", - "default-out", - "default-in" - ] - }, - - "(method 10 sync-info)": { - "vars": { - "v1-0": "period", - "f0-1": "period-float", - "f1-2": "current-time" - } - }, - - "(method 16 sync-info)": { - "args": ["obj", "user-time-offset"], - "vars": { - "a2-0": "period", - "f0-1": "period-float", - "v1-0": "wrapped-user-offset", - "f1-4": "current-time", - "f1-6": "current-time-wrapped", - "f1-10": "combined-offset", - "f0-3": "combined-offset-wrapped" - } - }, - - "(method 11 sync-info)": { - "vars": { - "v1-0": "period", - "f0-1": "period-float", - "f1-2": "current-time" - } - }, - - "(method 11 sync-info-paused)": { - "vars": { - "v1-0": "period", - "f1-0": "period-float", - "f0-1": "max-phase", - "f2-2": "current-time" - } - }, - - "(method 9 sync-info)": { - "args": ["obj", "max-val"], - "vars": { - "v1-0": "period", - "f0-1": "period-float", - "f1-2": "current-time" - } - }, - - "(method 13 sync-info)": { - "args": ["obj"], - "vars": { - "v1-0": "period", - "f1-0": "period-float", - "f2-2": "current-time", - "f0-1": "max-val", - "f0-2": "phase-out-of-2" - } - }, - - "(method 13 sync-info-eased)": { - "args": ["obj"], - "vars": { - "v1-0": "period", - "f1-0": "period-float", - "f0-1": "max-val", - "f2-2": "current-time", - "f0-2": "current-val", - "v1-2": "in-mirror?", - "f1-4": "tlo", - "f0-7": "eased-phase" - } - }, - - "(method 12 sync-info)": { - "args": ["obj", "max-out-val"], - "vars": { - "v1-0": "period", - "f1-0": "period-float", - "f0-1": "max-val", - "f2-2": "current-time", - "f0-2": "current-val" - } - }, - - "(method 12 sync-info-eased)": { - "args": ["obj", "max-out-val"] - }, - "(method 12 sync-info-paused)": { - "args": ["obj", "max-out-val"] - }, - - "(method 9 delayed-rand-float)": { - "args": ["obj", "min-tim", "max-time", "max-times-two"] - }, - - "(method 10 oscillating-float)": { - "args": ["obj", "target-offset"], - "vars": { "f0-3": "acc" } - }, - - "(method 9 oscillating-float)": { - "args": ["obj", "init-val", "accel", "max-vel", "damping"] - }, - - "(method 9 bouncing-float)": { - "args": [ - "obj", - "init-val", - "max-val", - "min-val", - "elast", - "accel", - "max-vel", - "damping" - ] - }, - - "(method 9 delayed-rand-vector)": { - "args": ["obj", "min-time", "max-time", "xz-range", "y-range"] - }, - - "(method 9 oscillating-vector)": { - "args": ["obj", "init-val", "accel", "max-vel", "damping"] - }, - - "(method 10 oscillating-vector)": { - "args": ["obj", "target-offset"], - "vars": { "f0-2": "vel" } - }, - - "(method 9 trajectory)": { - "args": ["obj", "time", "result"] - }, - - "(method 10 trajectory)": { - "args": ["obj", "time", "result"] - }, - - "(method 11 trajectory)": { - "args": ["obj", "from", "to", "duration", "grav"], - "vars": { "f0-3": "xz-vel" } - }, - - "(method 12 trajectory)": { - "args": ["obj", "from", "to", "xz-vel", "grav"], - "vars": { "f0-1": "duration" } - }, - - "(method 13 trajectory)": { - "args": ["obj", "from", "to", "y-vel", "grav"] - }, - - "(method 15 trajectory)": { - "vars": { - "s5-0": "prev-pos", - "s4-0": "pos", - "s3-0": "num-segments", - "f0-1": "t-eval" - } - }, - - "set-font-color-alpha": { - "args": ["idx", "alpha"] - }, - - "print-game-text-scaled": { - "args": ["str", "scale", "font-ctxt", "alpha"] - }, - - "print-game-text": { - "args": ["str", "font-ctxt", "alpha", "offset-thing"] - }, - - "display-frame-start": { - "args": ["disp", "new-frame-idx", "odd-even"], - "vars": { - "f30-0": "time-ratio", - "s3-0": "scaled-seconds", - "s3-1": "new-frame" - } - }, - - "display-frame-finish": { - "args": ["disp"], - "vars": { - "s4-0": "this-frame", - "s5-0": "this-calc-buf", - "s3-0": "bucket-idx", - "v1-7": "this-global-buf", - "a0-16": "global-buf", - "v1-19": "calc-current", - "a2-1": "calc-start", - "s4-1": "global-current", - "s5-1": "global-start", - "s3-1": "global-end" - } - }, - - "display-sync": { - "args": ["disp"], - "vars": { - "s4-0": "frame-idx", - "s5-0": "syncv-result", - "s3-0": "dma-buf-to-send", - "a1-4": "next-frame" - } - }, - - "draw-string": { - "args": ["str-in", "context"], - "vars": { - "v1-5": "fw", - "a1-1": "dma-out", - "t2-0": "flags", - "a3-0": "has-flag-size24", - "a3-1": "font-table-12", - "a3-2": "font-table-to-use", - "t0-0": "q-lo-tmpl", - "t1-0": "q-hi-tmpl", - "t3-0": "in-color", - "t3-1": "color-array-prod", - "t4-0": "fw+col", - "t3-2": "q-verts-0p", - "t5-0": "q-verts-1p", - "t3-3": "q-verts-2p", - "t4-1": "q-verts-3p", - "t5-1": "q-verts-1t", - "t5-2": "q-verts-1", - "t3-4": "q-verts-2t", - "t3-5": "q-verts-2", - "t6-0": "q-verts-0t", - "t6-1": "q-verts-0", - "t4-2": "q-verts-3t", - "t4-3": "q-verts-3", - "t3-6": "fw2", - "t4-4": "str-char", - "t5-3": "not-sc-lit1", - "t5-4": "not-sc-~", - "t4-14": "fc-cr", - "r0-0": "r0", - "r0-1": "r0", - "r0-2": "r0", - "r0-3": "r0" - } - }, - - "add-debug-outline-triangle": { - "args":["enable", "bucket", "p0", "p1", "p2", "color"] - }, - - "unpack-comp-rle": { - "args":["out", "in"], - "vars":{ - "v1-2":"current-input", - "a2-0":"repeated-value", - "v1-3":"copy-length", - "a2-1":"src-val" - } - }, - - "(method 16 level)": { - "args":["obj", "vis-info"], - "vars":{ - "a0-1":"cam-leaf-idx", - "v1-1":"curr-vis-str", - "s4-0":"desired-vis-str", - "s4-1":"vis-buffer", - "s3-1":"vis-load-result", - "v1-28":"dest-bits", - "a1-3":"len", - "a0-19":"bsp-bits", - "a1-5":"len-qw", - "s2-0":"lower-flag-bits", - "s1-0":"spad-start", - "s0-0":"spad-end", - "s3-2":"list-len", - "v1-49":"list-qwc", - "v0-1":"result" - } - }, - - "(method 9 merc-fragment)": { - "vars":{ - "s5-0":"fp-data", - "s4-0":"eye-ctrl", - "s3-0":"shader", - "v1-7":"eye-tex-block", - "v1-34":"eye-tex-block-2", - "v1-57":"tex", - "a0-36":"seg" - } - }, - - "(method 9 merc-effect)": { - "vars":{ - "v1-0":"data", - "v1-1":"tex", - "a0-8":"seg", - "s3-0":"frag-idx", - "s2-0":"ctrl-size", - "s1-0":"geo-size", - "s4-0":["geo", "merc-fragment"], - "s5-0":["ctrl", "merc-fragment-control"] - } - }, - - "merc-vu1-add-vu-function": { - "args":["dma", "func", "flush-mode"], - "vars": { - "v1-0":"func-data", - "a3-0":"qwc", - "a1-1":"dst", - "t0-1":"qwc-this-time" - } - }, - - "(method 8 merc-ctrl)": { - "vars": { - "s4-0":"ctrl-mem", - "s3-0":"effect-idx", - "s2-0":["fctrl", "merc-fragment-control"], - "s1-0":"frag-idx", - "v1-35":"effect-mem", - "a0-15":"effect-idx2", - "a1-9":["bctrl", "merc-blend-ctrl"], - "a2-1":"blend-frag-idx" - } - }, - - "(method 9 merc-ctrl)": { - "vars":{ - "v1-3":"seg", - "s5-0":"effect-idx", - "a0-4":"idx-with-bit1", - "a0-7":"this-effect", - "a1-5":"last-effect", - "a2-6":"copy-idx" - } - }, - - "merc-vu1-init-buffer": { - "args":["dma-bucket", "test"], - "vars": { - "gp-0":"bucket", - "s4-0":"dma-buf" - } - }, - - "(method 9 screen-filter)": { - "vars": { - "v1-4":["v1-4", "dma-packet"], - "s5-0":"buf" - } - }, - - "(method 11 fact-info-target)": { - "args":["obj", "kind", "amount", "source-handle"], - "vars":{"f0-29":"buzz-count","f30-0":"eco-lev"} - }, - - "auto-save-init-by-other": { - "args":["desired-mode", "notify-proc", "card-idx", "file-idx"] - }, - - "debug-menu-item-var-make-int": { - "args":["item", "callback", "inc", "has-range", "range-min", "range-max", "hex"] - }, - - "debug-menu-item-var-make-float": { - "args":["item", "callback", "inc", "has-range", "range-min", "range-max", "precision"] - }, - - "(method 0 debug-menu-item-var)": { - "args":["allocation", "type-to-make", "name", "id", "max-width"] - }, - - "debug-menu-context-grab-joypad": { - "args":["menu", "callback-arg", "callback-func"] - }, - - "debug-menu-context-default-selection": { - "args": ["ctxt", "keep-current"], - "vars": { - "s5-0":"menu", - "s4-0":"currently-active" - } - }, - - "debug-menu-rebuild": { - "args":["menu"], - "vars": { - "s4-0":"max-width", - "s5-0":"entry-count", - "s3-0":"iter", - "a0-1":"current-item" - } - }, - - "debug-menu-context-set-root-menu":{ - "args":["context", "menu"], - "vars":{ - "s4-0":"active" - } - }, - - "debug-menu-append-item": { - "args":["menu", "item"], - "vars": { - "gp-0":"context", - "s4-0":"was-active" - } - }, - - "(anon-function 82 default-menu)": { - "vars":{"s4-0":["s4-0", "texture-id"]} - }, - - "process-status-bits": { - "vars":{"s3-0":["proc-draw", "process-drawable"]} - }, - - "(method 29 entity-actor)":{ - "args":["obj", "mode", "expected-type"] - }, - - "(method 13 level-group)":{ - "args":["obj", "mode", "expected-type"] - }, - - "(method 24 entity)": { - "args":["obj", "lev-group", "lev", "aid"], - "vars":{ - "v1-4":"level-link", - "t0-5":"other-prev", - "t1-1":"other-front" - } - }, - - "update-actor-vis-box": { - "args":["proc", "min-pt", "max-pt"], - "vars":{"v1-4":"world-bounds-origin", "f0-0":"radius"} - }, - - "init-entity": { - "args":["proc", "ent"] - }, - - "(method 22 entity-actor)": { - "vars":{ - "s5-0":"entity-type", - "v1-0":"info", - "s4-0":"entity-process" - } - }, - - "(method 18 bsp-header)": { - "vars":{ - "a2-0":"existing-actor-count", - "s4-0":"birth-idx", - "a0-4":"idx-to-birth", - "v1-25":"actor-to-birth", - "a2-5":"existing-amb-count", - "s4-1":"amb-array", - "s3-0":"bsp-ambs", - "a0-10":"amb-to-birth", - "s4-2":"cams" - } - }, - - "(code falling beach-rock)": { - "vars": { - "gp-2": ["gp-2", "handle"], - "s5-1": ["s5-1", "handle"] - } - }, - - "draw-percent-bar": { - "vars": { - "v1-3": ["v1-3", "dma-packet"] - } - }, - - "(dummy-17 progress)": { - "vars": { - "v1-20": ["v1-20", "dma-packet"], - "v1-81": ["v1-81", "dma-packet"] - } - }, - - "make-current-level-available-to-progress": { - "vars": { - "a0-0": "cur-lev", - "v1-7": "lev-idx" - } - }, - - "make-levels-with-tasks-available-to-progress": { - "vars": { - "gp-0": "i", - "s4-0": "ii", - "s5-0": "tasks" - } - }, - - "get-next-task-up": { - "args": ["cur-task-idx", "lev-idx"] - }, - "get-next-task-down": { - "args": ["cur-task-idx", "lev-idx"] - }, - "get-next-level-up": { - "args": ["lev-idx"] - }, - "get-next-level-down": { - "args": ["lev-idx"] - }, - - "calculate-completion": { - "args": ["the-progress"], - "vars": { - "sv-40":"total-cells", - "sv-48":"total-buzzers", - "sv-56":"total-orbs", - "sv-16":"current-cells", - "sv-24":"current-buzzers", - "sv-32":"current-orbs" - } - }, - - "(method 48 progress)": { - "args": ["obj", "screen", "option"] - }, - - "activate-progress": { - "args": ["creator", "screen"] - }, - - "(method 23 progress)": { - "args": ["obj", "aspect", "video-mode"] - }, - - "(method 35 progress)": { - "vars": { - "s4-0": ["s4-0", "game-text-id"] - } - }, - - "(method 43 progress)": { - "vars": { - "s4-0": ["s4-0", "game-text-id"] - } - }, - - "(method 38 progress)": { - "vars": { - "a1-1": ["a1-1", "game-text-id"] - } - }, - - "(post progress-debug)": { - "vars": { - "v1-7": ["v1-7", "dma-packet"], - "v1-16": ["v1-16", "dma-packet"], - "v1-25": ["v1-25", "dma-packet"], - "v1-34": ["v1-34", "dma-packet"] - } - }, - - "voicebox-track": { - "vars": { - "a0-1": "target" - } - }, - - "citb-drop-plat-drop-children": { - "vars": { - "v1-4": ["v1-4", "handle"] - } - }, - - "(code plunger-lurker-plunge)": { - "vars": { - "gp-1": ["gp-1", "handle"], - "s5-0": ["s5-0", "othercam"] - } - }, - - "flying-lurker-play-intro": { - "vars": { - "gp-1": ["gp-1", "handle"] - } - }, - - "(code flying-lurker-start)": { - "vars": { - "v1-9": ["v1-9", "float"] - } - }, - - "(code flying-lurker-fly)": { - "vars": { - "v1-42": ["v1-42", "float"] - } - }, - - "(method 14 level-group)": { - "vars": { - "s1-1": ["s1-1", "process-drawable"] - } - }, - - "level-hint-displayed?": { - "vars": { - "a0-1": ["a0-1", "level-hint"] - } - }, - - "level-hint-init-by-other": { - "vars": { - "a0-6": ["a0-6", "string"] - } - }, - - "(method 27 entity-ambient)": { - "vars": { - "s5-0": ["s5-0", "symbol"] - } - }, - - "upload-vis-bits": { - "vars": { - "v1-2":"qwc", - "a0-1":["lev-vis-bits", "(pointer uint128)"], - "a1-1":["all-vis", "(pointer uint128)"], - "a2-2":["spad-vis", "(pointer uint128)"] - } - }, - - "(event be-clone process-taskable)": { - "vars": { - "v0-0": ["v0-0", "shadow-geo"] - } - }, - - "(event idle process-taskable)": { - "vars": { - "v0-0": ["v0-0", "symbol"] - } - }, - - "(method 9 load-dir-art-group)":{ - "args":["obj", "art-name", "do-reload", "heap", "version"] - }, - - "(method 15 hud-money)": { - "vars": { - "v1-8": ["v1-8", "dma-packet"] - } - }, - - "(method 15 hud-money-all)": { - "vars": { - "v1-32": ["v1-32", "dma-packet"] - } - }, - - "anim-tester-get-playing-item": { - "vars": { - "v0-0": ["v0-0", "anim-test-seq-item"] - } - }, - - "aaaaaaaaaaaaaaaaaaaaaaa": {} -} diff --git a/decompiler/config/jak1_us2.jsonc b/decompiler/config/jak1_us2.jsonc new file mode 100644 index 0000000000..9713a8fe6f --- /dev/null +++ b/decompiler/config/jak1_us2.jsonc @@ -0,0 +1,116 @@ +{ + "game_version": 1, + "text_version": 11, + "game_name": "jak1_us2", + "expected_elf_name": "SCUS_971.24", + + // if you want to filter to only some object names. + // it will make the decompiler much faster. + "allowed_objects": [], + "banned_objects": [], + + //////////////////////////// + // CODE ANALYSIS OPTIONS + //////////////////////////// + + // set to true to generate plain .asm files with MIPS disassembly, with no fancy decompilation. + // this is fast and should succeed 100% of the time. + "disassemble_code": false, + + // Run the decompiler + "decompile_code": false, + + // run the first pass of the decompiler + "find_functions": true, + + //////////////////////////// + // DATA ANALYSIS OPTIONS + //////////////////////////// + + // set to true to generate plain .asm files for data files. + // this will display most data as hex, but will add labels/references/type pointers/strings + // this generates a huge amount of output if you run it on the entire game. + "disassemble_data": false, + + // unpack textures to assets folder + "process_tpages": true, + // unpack game text to assets folder + "process_game_text": true, + // unpack game count to assets folder + "process_game_count": true, + // write goal imports for art groups + "process_art_groups": true, + + /////////////////////////// + // WEIRD OPTIONS + /////////////////////////// + + // these options are used rarely and should usually be left at false + + // generate the symbol_map.json file. + // this is a guess at where each symbol is first defined/used. + "generate_symbol_definition_map": false, + + // debug option for instruction decoder + "write_hex_near_instructions": false, + + // experimental tool to extract linked lists used for region scripting in Jak 2 and Jak 3. + "write_scripts": false, + + // hex dump of code/data files. + "hexdump_code": false, + "hexdump_data": false, + // dump raw obj files + "dump_objs": true, + // print control flow graph + "print_cfgs": false, + + // set to true for PAL versions. this will forcefully skip files that have some data missing at the end. + "is_pal": false, + + //////////////////////////// + // CONFIG FILES + //////////////////////////// + + "type_casts_file": "decompiler/config/jak1_pal/type_casts.jsonc", + "anonymous_function_types_file": "decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc", + "var_names_file": "decompiler/config/jak1_ntsc_black_label/var_names.jsonc", + "label_types_file": "decompiler/config/jak1_jp/label_types.jsonc", + "stack_structures_file": "decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc", + "hacks_file": "decompiler/config/jak1_pal/hacks.jsonc", + "inputs_file": "decompiler/config/jak1_ntsc_black_label/inputs.jsonc", + "art_info_file": "decompiler/config/jak1_ntsc_black_label/art_info.jsonc", + "import_deps_file": "decompiler/config/jak1_ntsc_black_label/import_deps.jsonc", + "all_types_file": "decompiler/config/all-types.gc", + + // optional: a predetermined object file name map from a file. + // this will make decompilation naming consistent even if you only run on some objects. + "obj_file_name_map_file": "goal_src/build/all_objs_jak1_jp.json", + + //////////////////////////// + // LEVEL EXTRACTION + //////////////////////////// + + // turn this on to extract level background graphics data + "levels_extract": true, + // turn this on if you want extracted levels to be saved out as .obj files + "levels_convert_to_obj": false, + // should we extract collision meshes? + // these can be displayed in game, but makes the .fr3 files slightly larger + "extract_collision": true, + + //////////////////////////// + // PATCHING OPTIONS + //////////////////////////// + + // these are options related to xdelta3 patches on specific objects + // this allows us to get a more consistent input + + // set to true to write new patch files + "write_patches": false, + // set to true to apply patch files + "apply_patches": true, + // what to patch an object to and the patch file is + "object_patches": { + } +} diff --git a/decompiler/config/jak2/anonymous_function_types.jsonc b/decompiler/config/jak2/anonymous_function_types.jsonc index cc85744d56..0e0dcd235c 100644 --- a/decompiler/config/jak2/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/anonymous_function_types.jsonc @@ -1,10 +1,3 @@ { - "gkernel":[ - [16, "(function process symbol)"], - [22, "(function process symbol)"], - [25, "(function process symbol)"], - [28, "(function process symbol)"], - [30, "(function process symbol)"], - [32, "(function process symbol)"] - ] + } \ No newline at end of file diff --git a/decompiler/config/jak2/art_info.jsonc b/decompiler/config/jak2/art_info.jsonc new file mode 100644 index 0000000000..779d289cff --- /dev/null +++ b/decompiler/config/jak2/art_info.jsonc @@ -0,0 +1,4 @@ +{ + "files":{}, + "functions":{} +} \ No newline at end of file diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index d7451025e0..be07fe5d5c 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -4,10 +4,9 @@ //////////////////////////// "types_with_bad_inspect_methods": [ - "engine", - "bsp-header", - "joint-anim-matrix", - "part-tracker" + "game-task-event", + "game-task-control", + "predator-edge" ], "no_type_analysis_functions_by_name": [], @@ -16,368 +15,56 @@ // the second argument is the name of the first condition in the cond. Use print_cfg to find it out. // The third argument is the number of cases. If you set it too small it may fail to build the CFG. "cond_with_else_max_lengths": [ - ["(method 20 res-lump)", "b0", 2], - ["(method 11 res-lump)", "b0", 1], - ["(method 12 res-lump)", "b0", 1] + ], // if a cond with an else case is being used a value in a place where it looks wrong // you can add the function name to this list and it will more aggressively reject this rewrite. "aggressively_reject_cond_to_value_rewrite": [ - "(method 10 res-lump)", - "(method 11 res-lump)", - "(method 12 res-lump)", - "(method 7 texture-page)" + ], // this provides a hint to the decompiler that these functions will have a lot of inline assembly. // currently it just leaves pcpyld as an asm op. - "hint_inline_assembly_functions": ["matrix-transpose!"], + "hint_inline_assembly_functions": [], "asm_functions_by_name": [ - // gcommon - "quad-copy!", - - // gkernel - "(method 11 cpu-thread)", - "throw", - "return-from-thread", - "return-from-thread-dead", - "reset-and-call", - "(method 10 cpu-thread)", - "(method 0 catch-frame)", - "throw-dispatch", - "set-to-run-bootstrap", - "run-function-in-process", // not asm, but it uses the stack. - - // pskernel - "return-from-exception", // F: eret - "kernel-read-function", // F: delay slot tricks - "kernel-write-function", // F: delay slot tricks - "kernel-copy-function", - "kernel-check-hardwired-addresses", - - // math - "rand-uint31-gen", - - // bounding box - "(method 9 bounding-box)", // F: asm branching - "(method 14 bounding-box)", - - // matrix - "(method 9 matrix)", // F: asm branching - "matrix-axis-sin-cos!", // F: asm branching - "matrix-axis-sin-cos-vu!", - - // geometry - "circle-circle-xz-intersect", // F: asm branching - - // trigonometry - "exp", // BUG: cfg is wrong. - "atan0", // P: manual use of stack - "sincos!", // P: manual use of stack - "sincos-rad!", - - // dma-h - "dma-count-until-done", // F: asm branching - "dma-sync-with-count", // F: asm branching - "dma-send-no-scratch", // F: asm branching - "dma-sync-fast", - - // dma - "symlink3", // F: asm branching - "symlink2", // F: asm branching - "dma-sync-hang", - - // display - "vblank-handler", // F: weird asm for interrupt handler - "vif1-handler", // F: weird asm for interrupt handler - "vif1-handler-debug", - - // vector - "vector=", // asm branching - - // collide-mesh-h - "(method 11 collide-mesh-cache)", - - // collide-func - "moving-sphere-triangle-intersect", // P: weird branching - "collide-do-primitives", // P: asm branching - - // joint - "calc-animation-from-spr", // F: asm branching - "decompress-frame-data-pair-to-accumulator", // P: asm calling - "decompress-frame-data-to-accumulator", // P: asm calling - "decompress-fixed-data-to-accumulator", // P: asm calling - "normalize-frame-quaternions", // F: asm branching, return - "clear-frame-accumulator", // F: asm branching - "cspace<-parented-transformq-joint!", - - // sprite - - // merc-blend-shape - "setup-blerc-chains-for-one-fragment", // F: asm branching - "merc-dma-chain-to-spr", // F: asm branching - "blerc-a-fragment", - - // ripple - "ripple-matrix-scale", - "ripple-apply-wave-table", - "ripple-create-wave-table", - "ripple-execute-init", - - // bones - "draw-bones-hud", - "draw-bones", - "draw-bones-check-longest-edge-asm", - "draw-bones-merc", - "bones-mtx-calc-execute", - "bones-mtx-calc", - "texscroll-execute", - - // generic-effect - "generic-debug-light-proc", - "generic-none-dma-wait", - "generic-copy-vtx-dclr-dtex", - "generic-light", - "generic-envmap-only-proc", - "generic-no-light", - "generic-no-light+envmap", - "generic-no-light-dproc", - "generic-no-light-dproc-only", - "generic-no-light-proc", - "generic-interp-dproc", - "generic-envmap-dproc", - "generic-prepare-dma-single", - "generic-prepare-dma-double", - "generic-envmap-proc", - "generic-light-proc", - "generic-dma-from-spr", - "upload-vu0-program", - - // generic-merc - "generic-merc-execute-all", - "generic-merc-execute-asm", // CFG - "high-speed-reject", - "mercneric-convert", - "mercneric-bittable-asm", - "mercneric-shader-asm", - "mercneric-matrix-asm", - "generic-merc-init-asm", - - // generic-tie - "generic-tie-convert", - "generic-tie-convert-proc", - "generic-tie-upload-next", - "generic-tie-decompress", - "generic-tie-dma-to-spad-sync", - - // shadow-cpu - "shadow-execute", - "shadow-add-double-edges", - "shadow-add-double-tris", - "shadow-add-single-edges", - "shadow-add-facing-single-tris", - "shadow-add-verts", - "shadow-find-double-edges", - "shadow-find-facing-double-tris", - "shadow-find-single-edges", - "shadow-find-facing-single-tris", - "shadow-scissor-top", - "shadow-scissor-edges", - "shadow-calc-dual-verts", - - // background - "background-upload-vu0", - - // draw-node - "draw-node-cull", - - // shrubbery - "test-func", - "draw-inline-array-instance-shrub", - - // tfrag - "stats-tfrag-asm", - "draw-inline-array-tfrag-near", - "draw-inline-array-tfrag", - - // tie-methods - "draw-inline-array-prototype-tie-near-asm", - "draw-inline-array-prototype-tie-asm", - "draw-inline-array-prototype-tie-generic-asm", - "draw-inline-array-instance-tie", - - // sparticle-launcher - "sp-init-fields!", - - // sparticle - "memcpy", - "sp-process-block-3d", - "sp-process-block-2d", - "sp-launch-particles-var", - "particle-adgif", - "sp-init-fields!", - - // time-of-day - "time-of-day-interp-colors-scratch", - "time-of-day-interp-colors", - - // sky-tng - "clip-polygon-against-negative-hyperplane", - "clip-polygon-against-positive-hyperplane", - "draw-large-polygon", - - // load-boundary - "render-boundary-tri", - "render-boundary-quad", - "draw-boundary-polygon", - - // collide-probe - "collide-probe-instance-tie", // CFG - "collide-probe-node", // CFG - - // collide-edge-grab - "(method 13 collide-edge-work)", // CFG - "(method 17 collide-edge-work)", // CFG - "(method 15 collide-edge-work)", // CFG - "(method 16 collide-edge-work)", // CFG - "(method 9 edge-grab-info)", // CFG - "(method 18 collide-edge-work)", // CFG - "(method 10 collide-edge-hold-list)", // CFG - - // collide-shape - "(method 15 collide-shape-prim-mesh)", // CFG - "(method 15 collide-shape-prim-sphere)", // CFG - "(method 16 collide-shape-prim)", // CFG - "(method 15 collide-shape-prim-group)", // CFG - "(method 18 collide-shape-prim-sphere)", - "(method 23 collide-shape-prim-sphere)", // CFG - "(method 23 collide-shape-prim-mesh)", // BUG - crash in variable pass - "(method 24 collide-shape-prim)", // CFG - "(method 23 collide-shape-prim-group)", // CFG - "(method 42 collide-shape)", // CFG - - // process-drawable BUG - "cspace-inspect-tree", - "(method 19 process-drawable)", - - // 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 - - // drawable-tree - "(method 16 drawable-tree)", - - // collide-cache - "(method 10 collide-puss-work)", // CFG - "(method 9 collide-puss-work)", // decompiler crash - "(method 19 collide-cache)", // decompiler crash - "(method 10 collide-cache-prim)", // CFG - "(method 9 collide-cache-prim)", // CFG - "(method 30 collide-cache)", // unsupported asm - c.le.s - "(method 13 collide-shape-prim-group)", // CFG - "(method 13 collide-shape-prim-mesh)", // CFG - "(method 14 collide-shape-prim-group)", // CFG - "(method 14 collide-shape-prim-mesh)", // CFG - "(method 12 collide-shape-prim-group)", // CFG - "(method 12 collide-shape-prim-mesh)", // CFG - "(method 27 collide-cache)", // CFG - "(method 14 collide-cache)", // CFG - "(method 28 collide-cache)", // CFG - "(method 26 collide-cache)", // CFG - "(method 21 collide-cache)", // CFG - "(method 32 collide-cache)", // CFG - - // memory-usage BUG - //"(method 14 level)", - - // navigate BUG - "(method 32 nav-control)", - - // ocean - "draw-large-polygon-ocean", // CFG - - // ocean-vu0 - "ocean-generate-verts", // crash - "ocean-interp-wave", - - // ropebridge BUG - "(method 27 ropebridge)", - - // all unchecked and in level DGO code - "(anon-function 21 plant-boss)", // CFG - // "(anon-function 10 ice-cube)", - // "(anon-function 15 ice-cube)", - "mistycannon-find-best-solution", - "target-flut-falling-anim-trans", // CFG failure - "kermit-check-to-hit-player?", - "(anon-function 36 mistycannon)", - "(anon-function 2 target-tube)", - "(anon-function 5 orbit-plat)", - "(anon-function 2 ogreboss)" + // checking boxed type is different now - these make the cfg stuff sad + "type?", "print", "printl", "inspect", "valid?", "name=", "(method 8 res-lump)", "joint-control-remap!", "(method 21 game-info)", "(method 12 level)", + "bg", "(anon-function 2 cam-combiner)", "cspace-inspect-tree", "command-get-process", "command-get-trans", "(method 10 script-context)", + "(method 11 script-context)", "(method 9 script-context)", "(anon-function 64 script)", "(anon-function 61 script)", "(anon-function 60 script)", + "(anon-function 54 script)", "(anon-function 52 script)", "(anon-function 49 script)", "(anon-function 33 script)", "debug-menu-func-decode", + "scene-player-init", "(method 77 spyder)", "(method 77 flamer)", "(method 77 grenadier)", "(method 224 bot)", "(method 77 rapid-gunner)", + // until loop without nop: + "rand-vu-int-count-excluding", "rand-vu-int-range-exclude", "(method 9 history)", "history-print", "history-draw", + "(method 9 sparticle-launcher)", "(method 18 tracking-spline)", "cam-string-find-position-rel!", "cam-layout-entity-volume-info-create", + "process-drawable-shock-skel-effect", "target-history-print", "display-list-control", "anim-test-anim-list-handler", + "anim-test-sequence-list-handler", "anim-tester-get-playing-item", "(method 9 mysql-nav-graph)", "(method 58 nav-graph-editor)", + "(method 120 enemy)", "start-pilot-recorder", "(anon-function 10 pilot-recorder)", "(method 0 hover-nav-control)", + "(method 24 nav-network)", "(method 11 predator-manager)", "(method 9 bot-speech-list)", "(method 9 bot-speech-list-shuffle)", + "(anon-function 10 sig-recorder)", "(method 14 trail-graph)", "(method 12 trail-graph)", "(method 11 trail-graph)", + // actual asm + "symlink2", "blerc-a-fragment", "blerc-execute", "foreground-check-longest-edge-asm", "generic-light-proc", + "shadow-add-single-edges","shadow-add-facing-single-tris", "shadow-add-double-tris", "shadow-add-double-edges", + "(method 12 collide-mesh)", "(method 17 collide-edge-work)", "(method 42 collide-shape)", "(method 12 collide-shape-prim-sphere)", + "(method 12 collide-shape-prim-mesh)", "(method 18 collide-shape-prim-mesh)", "(method 10 collide-cache-prim)", + "(method 17 collide-cache)", "(method 16 ocean)", + // unknown bug + "joint-mod-polar-look-at-guts", "(method 13 external-art-control)", "update-mood-copy-ctywide", "update-mood-copy-stadium", + "update-mood-drillb", "reset-target-tracking", "(anon-function 1 target)", "find-nearest-entity", "target-land-effect", + "(method 12 effect-control)", "(method 11 effect-control)", "(method 10 effect-control)", + "(anon-function 2 scene)", "progress-trans", "(method 10 bigmap)", "(method 9 editable-region)", "(method 57 enemy)", + "(anon-function 10 meet-brutter)", "(method 154 vehicle-racer)", "(method 188 predator)", "(anon-function 13 sig0-course)", + "(method 228 hal-sewer)", "(method 154 vehicle-city-racer)", "(method 53 squid)", "(anon-function 11 fort-floor-spike)", + "(method 29 gun-dummy)", "vehicle-explode-post", "(method 158 vehicle-guard)", "(method 207 metalhead-predator)", + "(anon-function 4 gun-states)", "(anon-function 28 grenadier)", "(anon-function 24 grenadier)" ], // these functions use pairs and the decompiler // will be less picky about types related to pairs. "pair_functions_by_name": [ - "ref", - "last", - "member", - "nmember", - "assoc", - "assoce", - "append!", - "delete!", - "delete-car!", - "insert-cons!", - "sort", - "unload-package", - "(method 4 pair)", - "nassoc", - "nassoce", - "lookup-level-info", - "(method 21 level-group)", - "(method 12 level)", - "update-sound-banks", - "(method 16 level-group)", - "bg", - "(method 18 game-info)", - "debug-menu-context-default-selection", - "debug-menu-rebuild", - "debug-menu-func-decode", - "debug-menu-make-from-template", - "debug-menu-render", - "debug-menu-context-select-next-or-prev-item", - "debug-menu-context-select-new-item", - "debug-menu-send-msg", - "debug-menu-find-from-template", - "build-continue-menu", - "(method 8 process-tree)", - "(method 16 load-state)", - "(method 15 load-state)", - "build-continue-menu", - "entity-remap-names", - "(method 21 swamp-rat-nest-dummy-a)", - "(method 21 swamp-rat-nest-dummy-b)", - "(method 21 swamp-rat-nest-dummy-c)", - "(method 27 battlecontroller)", - "load-boundary-from-template", - "command-get-time", - "command-get-param", - "command-get-quoted-param", - "command-get-trans", - "command-get-camera", - "(method 14 camera-tracker)", - "(enter billy-playing)", - "(code target-continue)", - "next-level" + ], // If format is used with the wrong number of arguments, @@ -385,108 +72,11 @@ // that they used the correct number. This will override the decompiler's // automatic detection. "bad_format_strings": { - "ERROR: dma tag has data in reserved bits ~X~%": 0, - "#: value of symbol ~A in task-controls is not a task-control~%": 0, - "~0K~10,'-S--~5,'-DK-of-~5,'-DK--~5,'-DK-of-~5,'-DK--": 5, - " bsp ~192H~5DK ~280Hdebug~456H~5DK~%": 2, - " bsp-leaf-vis-iop ~192H~5DK~%": 1, - " bsp-leaf-vis-adj ~192H~5DK~%": 1, - " level-code ~192H~5DK~%": 1, - " tfrag ~192H~5DK ~280Htfragment~456H~5DK~%": 2, - " tie-proto ~192H~5DK ~280Hsky~456H~5DK~%": 2, - " tie-instance ~192H~5DK ~280Htie-fragment~456H~5DK~%": 2, - " shrub-proto ~192H~5DK ~280Htie-near~456H~5DK~%": 2, - " shrub-instance ~192H~5DK ~280Hshrubbery~456H~5DK~%": 2, - " collision ~192H~5DK ~280Htie-generic~456H~5DK~%": 2, - " pris-geo ~192H~5DK ~280Hpris-fragment~456H~5DK~%": 2, - " pris-anim ~192H~5DK ~280Hpris-generic~456H~5DK~%": 2, - " textures ~192H~5DK ~280Htextures~456H~5DK~%": 2, - " entity ~192H~5DK~%": 1, - " misc ~192H~5DK ~280Hsprite~456H~5DK~%": 2, - "ERROR: ~A in spool anim loop for ~A ~D, but not loaded.~": 3, - "~0k~5d/~d ~6d/~d ~6d/~d ": 6, - "~0k~s~%": 1, - "money ~A was killed in pickup~%": 0 + }, "blocks_ending_in_asm_branch": { - "closest-pt-in-triangle": [17], - // this one is all asm branches - "circle-circle-xz-intersect": [ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 - ], - - "find-knot-span": [0, 1, 2, 3, 5, 6, 7, 8, 9], - - "curve-evaluate!": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], - - "(method 9 texture-page-dir)": [4, 5], - - "adgif-shader<-texture-with-update!": [0, 1], - - "display-loop": [44, 49, 66, 96], - - "load-game-text-info": [12, 13, 14, 16, 17, 18], - - "real-main-draw-hook": [75, 77], - - "(method 12 perf-stat)": [0], - "(method 11 perf-stat)": [0], - "raw-ray-sphere-intersect": [0, 1, 2, 3, 4, 5], - "ray-cylinder-intersect": [0, 1, 2, 3, 4, 5], - "ray-triangle-intersect": [0, 1, 2, 3, 4], - "bsp-camera-asm": [1, 2, 3], - "level-remap-texture": [2, 3, 4, 5, 6], - "start-perf-stat-collection": [26], - "end-perf-stat-collection": [0], - "sprite-draw-distorters": [4, 5], - "draw-string": [ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189 - ], - "get-string-length": [ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 - ], - "unpack-comp-rle": [1, 3, 5, 6], - "(method 16 level)": [1, 5, 13, 14, 15, 19, 26, 53], - "unpack-comp-huf": [2, 4, 5, 6, 7, 8, 9], - "blerc-execute": [ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 - ], - "(method 11 fact-info-target)": [42], - "(anon-function 9 game-save)": [3, 4, 5, 6, 7, 8, 10], - //"(anon-function 9 game-save)":[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], - "particle-adgif": [0, 1, 2, 3, 4, 5, 7], - "sp-launch-particles-var": [ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66 - ], - "(method 11 sparticle-launch-control)": [27, 28, 35, 46, 48, 49, 77], - "upload-vis-bits": [0, 1, 2, 3, 4, 5, 6], - - "draw-drawable-tree-tfrag": [6, 8, 13, 15], - "draw-drawable-tree-trans-tfrag": [6, 8, 13, 15], - "draw-drawable-tree-dirt-tfrag": [6, 8, 13, 15], - "draw-drawable-tree-ice-tfrag": [6, 8, 13, 15], - - "birth-pickup-at-point": [0] }, // Sometimes the game might use format strings that are fetched dynamically, @@ -495,51 +85,26 @@ // e.g. "function-name":[[op, argc], [op, argc], ...] // where "op" is the op number for the call to format. "dynamic_format_arg_counts": { - "(method 35 progress)": [ - [44, 1], - [92, 1] - ], - "(method 49 progress)": [[35, 1]], - "(method 37 progress)": [[41, 1]], - "(method 38 progress)": [[106, 1]], - "(method 39 progress)": [[41, 1]], - "(method 41 progress)": [[73, 1]], - "(method 42 progress)": [[41, 1]], - "(method 43 progress)": [ - [51, 1], - [94, 1] - ], - "": [] + }, "mips2c_functions_by_name": [ - "sp-init-fields!", - "particle-adgif", - "sp-launch-particles-var", - "sp-process-block-2d", - "sp-process-block-3d", - "draw-large-polygon", - "clip-polygon-against-positive-hyperplane", - "clip-polygon-against-negative-hyperplane", - "render-sky-quad", - "render-sky-tri", - "init-sky-regs", - "set-tex-offset", - "adgif-shader<-texture-with-update!", - "init-boundary-regs", - "draw-boundary-polygon", - "render-boundary-quad", - "render-boundary-tri", - "draw-inline-array-tfrag", - "stats-tfrag-asm", - "time-of-day-interp-colors-scratch" + + ], + "mips2c_jump_table_functions": { + + }, + // 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": [], + + // 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. + // this just suppresses a message. + "expected_merged_objs": [ + ] } - - diff --git a/decompiler/config/jak2/import_deps.jsonc b/decompiler/config/jak2/import_deps.jsonc new file mode 100644 index 0000000000..0e0dcd235c --- /dev/null +++ b/decompiler/config/jak2/import_deps.jsonc @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/decompiler/config/jak2/inputs.jsonc b/decompiler/config/jak2/inputs.jsonc index db79427b11..f7e28d62cd 100644 --- a/decompiler/config/jak2/inputs.jsonc +++ b/decompiler/config/jak2/inputs.jsonc @@ -7,7 +7,7 @@ // most objects are part of CGO/DGO files (both go in dgo_names). This includes levels and the engine // the DGOs will be processed in this order. Usually it's best to have KERNEL, ENGINE, then the levels when // you want to run on the entire game. - "dgo_names": [/* + "dgo_names": [ "CGO/ART.CGO", "CGO/KERNEL.CGO", "CGO/ENGINE.CGO", @@ -160,10 +160,10 @@ "DGO/LRACEBB.DGO", "DGO/CASCITY.DGO", "DGO/LYSAMSAM.DGO", - "DGO/VI1.DGO"*/ - ], + "DGO/VI1.DGO" +], - // some objects are part of STR files (streaming data). In Jak 1 this is just animations + // some objects are part of STR files (streaming data). "str_file_names": [ ], @@ -177,11 +177,13 @@ "TEXT/5COMMON.TXT", "TEXT/6COMMON.TXT", "TEXT/7COMMON.TXT" - ], +], // uncomment the next line to extract audio to wave files. //"audio_dir_file_name": "jak1/VAG", "audio_dir_file_name": "", - "streamed_audio_file_names": ["VAGWAD.ENG", "VAGWAD.JAP"] + "streamed_audio_file_names": [], + + "levels_to_extract": [] } diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index 64cd24a635..34c387cbf9 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -1,5045 +1,4 @@ { - "run-function-in-process": [ - [16, ["array", "uint64", 6]], - [64, "catch-frame"] - ], - - "matrixp*!": [[16, "matrix"]], - - "vector3s-matrix*!": [[16, "vector"]], - - "vector3s-rotate*!": [[16, "vector"]], - - "matrix-rotate-zyx!": [ - [16, "matrix"], - [80, "matrix"] - ], - "matrix-rotate-xyz!": [ - [16, "matrix"], - [80, "matrix"] - ], - "matrix-rotate-zxy!": [ - [16, "matrix"], - [80, "matrix"] - ], - "matrix-rotate-yxz!": [ - [16, "matrix"], - [80, "matrix"] - ], - "matrix-rotate-yzx!": [ - [16, "matrix"], - [80, "matrix"] - ], - "matrix-rotate-yxy!": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - "matrix-rotate-yx!": [[16, "matrix"]], - "transform-matrix-calc!": [ - [16, "matrix"], - [80, "matrix"] - ], - "transform-matrix-parent-calc!": [ - [16, "matrix"], - [80, "matrix"] - ], - "matrix-with-scale->quaternion": [[16, "matrix"]], - "quaternion-exp!": [[16, "vector"]], - "quaternion-slerp!": [[16, "vector"]], - "quaternion-zxy!": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - "vector-x-quaternion!": [[16, "matrix"]], - "vector-y-quaternion!": [[16, "matrix"]], - "vector-z-quaternion!": [[16, "matrix"]], - "quaternion-y-angle": [[16, "vector"]], - "quaternion-rotate-local-x!": [[16, "quaternion"]], - "quaternion-rotate-local-y!": [[16, "quaternion"]], - "quaternion-rotate-local-z!": [[16, "quaternion"]], - "quaternion-rotate-y!": [[16, "quaternion"]], - "quaternion-rotate-x!": [ - [16, "quaternion"], - [32, "vector"] - ], - "quaternion-rotate-z!": [ - [16, "quaternion"], - [32, "vector"] - ], - "quaternion-delta-y": [ - [16, "vector"], - [32, "vector"] - ], - "quaternion-rotate-y-to-vector!": [ - [16, "quaternion"], - [32, "vector"], - [48, "quaternion"] - ], - "quaternion-xz-angle": [ - [16, "matrix"], - [80, "vector"] - ], - "vector-rotate-y!": [ - [16, "quaternion"], - [32, "matrix"] - ], - "eul->matrix": [[16, "vector"]], - "eul->quat": [[16, "matrix"]], - "quat->eul": [[16, "matrix"]], - "vector-line-distance": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - "vector-line-distance-point!": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - "forward-up-nopitch->inv-matrix": [[16, "vector"]], - "forward-up-nopitch->quaternion": [[16, "matrix"]], - "forward-up->quaternion": [ - [16, "matrix"], - [80, "vector"] - ], - "quaternion-from-two-vectors!": [[16, "vector"]], - "quaternion-from-two-vectors-max-angle!": [[16, "vector"]], - "matrix-from-two-vectors!": [[16, "vector"]], - "matrix-from-two-vectors-max-angle!": [[16, "vector"]], - "matrix-from-two-vectors-max-angle-partial!": [[16, "vector"]], - "matrix-from-two-vectors-partial-linear!": [[16, "vector"]], - "matrix-remove-z-rot": [ - [16, "vector"], - [32, "matrix"] - ], - "matrix-rot-diff!": [ - [16, "quaternion"], - [32, "quaternion"], - [48, "quaternion"] - ], - "quaternion-seek": [ - [16, "matrix"], - [80, "matrix"], - [144, "quaternion"] - ], - "vector-deg-seek": [[16, "matrix"]], - "vector-deg-slerp": [ - [16, "matrix"], - [80, "vector"], - [96, "vector"] - ], - "circle-test": [ - [16, "sphere"], - [32, "sphere"], - [48, "vector"], - [64, "vector"] - ], - "move-target-from-pad": [ - [16, "vector"], - [32, "vector"], - [48, "matrix"] - ], - "draw-sprite2d-xy": [[16, "draw-context"]], - "screen-gradient": [[16, "draw-context"]], - "(method 10 oscillating-vector)": [[16, "vector"]], - "show-mc-info": [[16, "mc-slot-info"]], - "update-mood-erase-color2": [[16, "mood-fog"]], - "make-light-kit": [[16, "matrix"]], - "matrix<-parented-transformq!": [[16, "vector"]], - "(method 20 trsqv)": [[16, "vector"]], - "(method 19 trsqv)": [[16, "vector"]], - "(method 17 trsqv)": [ - [16, "quaternion"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"] - ], - "(method 25 trsqv)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - "(method 16 trsqv)": [ - [16, "matrix"], - [80, "matrix"] - ], - "(method 14 trsqv)": [[16, "vector"]], - "(method 13 trsqv)": [[16, "vector"]], - "(method 12 trsqv)": [ - [16, "vector"], - [32, "vector"] - ], - "(method 11 trsqv)": [[16, "vector"]], - "(method 10 trsqv)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 23 trsqv)": [[16, "vector"]], - "(method 24 trsqv)": [[16, "vector"]], - - "vector-sincos!": [[16, "vector"]], - - "init-for-transform": [ - [16, "matrix"], - [80, "matrix"], - [144, "vector4s-3"], - [192, "vector"], - [208, "vector4s-3"] - ], - "string->sound-name": [[16, "qword"]], - "(method 15 trajectory)": [ - [16, "vector"], - [32, "vector"] - ], - "ripple-add-debug-sphere": [[16, "vector"]], - "camera-teleport-to-entity": [ - [16, "transformq"], - [64, "event-message-block"] - ], - "(method 10 cam-vector-seeker)": [[16, "vector"]], - "joint-mod-look-at-handler": [ - [16, "vector"], - [32, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"] - ], - "joint-mod-world-look-at-handler": [ - [16, "vector"], - [32, "vector"], - [64, "vector"], - [80, "matrix"], - [144, "vector"], - [160, "vector"], - [176, "matrix"] - ], - "joint-mod-rotate-handler": [ - [16, "quaternion"], - [32, "quaternion"], - [48, "quaternion"] - ], - "joint-mod-wheel-callback": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - "draw-end-credits": [[16, "font-context"]], - "draw-title-credits": [[16, "font-context"]], - "moving-sphere-sphere-intersect": [[16, "vector"]], - "moving-sphere-moving-sphere-intersect": [ - [16, "vector"], - [32, "vector"] - ], - "(method 9 cylinder-flat)": [ - [16, "vector"], - [32, "vector"], - [48, "cylinder-flat-verts"], - [208, "cylinder-flat-verts"], - [368, "matrix"], - [432, "vector"] - ], - "(method 9 cylinder)": [ - [16, "vector"], - [32, "vector"], - [48, "cylinder-verts"], - [432, "cylinder-verts"], - [816, "matrix"], - [880, "matrix"] - ], - "ray-arbitrary-circle-intersect": [ - [16, "vector"], - [32, "vector"] - ], - "(method 10 cylinder-flat)": [ - [16, "vector"], - [32, "vector"] - ], - "(method 10 cylinder)": [ - [16, "vector"], - [32, "vector"] - ], - "add-debug-sphere-from-table": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - "make-debug-sphere-table": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - "(method 20 actor-link-info)": [[16, "event-message-block"]], - "(method 21 actor-link-info)": [[16, "event-message-block"]], - "(method 23 actor-link-info)": [[16, "event-message-block"]], - "(method 24 actor-link-info)": [[16, "event-message-block"]], - "internal-draw-debug-line": [ - [16, "vector4w-2"], - [48, "vector4w-2"] - ], - "internal-draw-debug-text-3d": [ - [16, "vector4w"], - [32, "font-context"] - ], - "add-debug-triangle-normal": [ - [16, "vector"], - [32, "vector"] - ], - "add-debug-flat-triangle": [ - [16, "vector4w-3"], - [64, "vector4w-3"] - ], - "add-debug-point": [[16, "vector4w-2"]], - "add-debug-line2d": [ - [16, "vector4w"], - [32, "vector4w"] - ], - "add-debug-box": [ - [16, "vector"], - [32, "vector"] - ], - "add-debug-x": [ - [16, "vector"], - [32, "vector"] - ], - "add-debug-sphere-with-transform": [[16, "vector"]], - "add-debug-circle": [ - [16, "vector"], - [32, "vector"] - ], - "add-debug-vector": [[16, "vector"]], - "add-debug-yrot-vector": [[16, "vector"]], - "add-debug-arc": [ - [16, "vector"], - [32, "vector"] - ], - "add-debug-curve": [ - [16, "vector"], - [32, "vector"] - ], - "add-debug-points": [[16, "vector"]], - "add-debug-light": [[16, "vector"]], - "dma-timeout-cam": [ - [16, "vector"], - [32, "matrix"] - ], - - "(method 18 tracking-spline)": [ - [16, "tracking-spline-sampler"], - [32, "tracking-spline-sampler"] - ], - - "draw-ocean-transition": [[16, "sphere"]], - - "dm-cam-mode-func": [[16, "event-message-block"]], - "ocean-trans-add-upload-table": [[16, "vector"]], - - "dm-cam-settings-func": [[16, "event-message-block"]], - - "dm-cam-render-float": [[16, "event-message-block"]], - - "debug-create-cam-restore": [[16, "euler-angles"]], - - "dm-task-resolution": [[16, "event-message-block"]], - - "dm-task-get-money": [[16, "event-message-block"]], - - "dm-give-all-cells": [[16, "event-message-block"]], - - "dm-give-cell": [[16, "event-message-block"]], - - "(anon-function 13 default-menu)": [[16, "event-message-block"]], - - "(anon-function 12 default-menu)": [[16, "event-message-block"]], - - "(anon-function 11 default-menu)": [[16, "event-message-block"]], - - "(method 22 level)": [[16, "event-message-block"]], - "(method 9 level)": [[16, "event-message-block"]], - "(method 10 load-state)": [[16, "event-message-block"]], - "cam-slave-get-rot": [[16, "quaternion"]], - - "draw-joint-spheres": [[16, "vector"]], - "(method 16 process-drawable)": [ - [16, "matrix"], - [80, "matrix"], - [144, "vector"], - [160, "vector"] - ], - "(anon-function 494 task-control)": [[16, "event-message-block"]], - "(anon-function 493 task-control)": [[16, "event-message-block"]], - "(anon-function 480 task-control)": [[16, "event-message-block"]], - "(anon-function 477 task-control)": [[16, "event-message-block"]], - "(anon-function 476 task-control)": [[16, "event-message-block"]], - "(anon-function 475 task-control)": [[16, "event-message-block"]], - "(anon-function 474 task-control)": [[16, "event-message-block"]], - "(anon-function 455 task-control)": [[16, "event-message-block"]], - "(anon-function 445 task-control)": [[16, "event-message-block"]], - "(anon-function 435 task-control)": [[16, "event-message-block"]], - "(anon-function 426 task-control)": [[16, "event-message-block"]], - "(anon-function 425 task-control)": [[16, "event-message-block"]], - "(anon-function 415 task-control)": [[16, "event-message-block"]], - "(anon-function 414 task-control)": [[16, "event-message-block"]], - "(anon-function 403 task-control)": [[16, "event-message-block"]], - "(anon-function 400 task-control)": [[16, "event-message-block"]], - "(anon-function 393 task-control)": [[16, "event-message-block"]], - "(anon-function 390 task-control)": [[16, "event-message-block"]], - "(anon-function 383 task-control)": [[16, "event-message-block"]], - "(anon-function 380 task-control)": [[16, "event-message-block"]], - "(anon-function 369 task-control)": [[16, "event-message-block"]], - "(anon-function 368 task-control)": [[16, "event-message-block"]], - "(anon-function 367 task-control)": [[16, "event-message-block"]], - "(anon-function 366 task-control)": [[16, "event-message-block"]], - "(anon-function 365 task-control)": [[16, "event-message-block"]], - "(anon-function 364 task-control)": [[16, "event-message-block"]], - "(anon-function 363 task-control)": [[16, "event-message-block"]], - "(anon-function 362 task-control)": [[16, "event-message-block"]], - "(anon-function 337 task-control)": [[16, "event-message-block"]], - "(anon-function 336 task-control)": [[16, "event-message-block"]], - "(anon-function 286 task-control)": [[16, "event-message-block"]], - "(anon-function 227 task-control)": [[16, "event-message-block"]], - "(anon-function 38 task-control)": [[16, "event-message-block"]], - "(anon-function 28 task-control)": [[16, "event-message-block"]], - "(method 10 border-plane)": [[16, "vector"]], - "(method 9 game-info)": [[16, "event-message-block"]], - "(method 9 continue-point)": [[16, "vector"]], - "(method 9 game-save)": [[16, "file-stream"]], - "(method 10 game-save)": [[16, "file-stream"]], - "vector-vector-deg-slerp!": [ - [16, "vector"], - [32, "vector"], - [48, "quaternion"], - [64, "quaternion"], - [80, "quaternion"], - [96, "vector"] - ], - "closest-pt-in-triangle": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - "vector-circle-tangent-new": [ - [16, "sphere"], - [32, "vector"], - [48, "vector"] - ], - "vector-circle-tangent": [ - [16, "sphere"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - "vector-plane-distance": [[16, "vector"]], - "curve-length": [ - [16, "vector"], - [32, "vector"] - ], - "curve-closest-point": [ - [16, "vector"], - [32, "vector"] - ], - "(method 27 seagull)": [ - [16, "vector"], - [32, "vector"] - ], - "add-debug-air-box": [ - [16, "vector"], - [32, "vector"] - ], - "mem-size": [[16, "memory-usage-block"]], - "display-loop": [[16, "sphere"]], - "(method 14 curve-control)": [[16, "vector"]], - "(method 19 path-control)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - "progress-allowed?": [[16, "event-message-block"]], - "(method 9 align-control)": [ - [16, "matrix"], - [80, "quaternion"] - ], - "(method 10 align-control)": [[16, "vector"]], - "(method 15 load-state)": [ - [16, "event-message-block"], - [96, "event-message-block"] - ], - - "(method 43 farmer)": [[16, "vector"]], - - "yakow-post": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"] - ], - - "anim-tester-save-object-seqs": [[16, "file-stream"]], - "anim-test-obj-list-handler": [[16, "event-message-block"]], - "anim-test-anim-list-handler": [[16, "event-message-block"]], - "anim-test-sequence-list-handler": [[16, "event-message-block"]], - "anim-test-edit-seq-insert-item": [[16, "event-message-block"]], - "anim-test-edit-sequence-list-handler": [ - [112, "event-message-block"], - [16, "font-context"] - ], - "anim-tester-add-newobj": [[16, "event-message-block"]], - "anim-tester-start": [[16, "event-message-block"]], - "anim-tester-add-sequence": [[16, "event-message-block"]], - - "instance-tfragment-add-debug-sphere": [[16, "vector"]], - - "cam-state-from-entity": [[16, "curve"]], - - "(method 9 cam-index)": [[16, "vector"]], - - "(method 10 cam-index)": [[16, "vector"]], - - "(method 15 tracking-spline)": [ - [16, "tracking-spline-sampler"], - [32, "tracking-point"] - ], - "(method 16 tracking-spline)": [ - [16, "tracking-spline-sampler"], - [32, "vector"] - ], - "(method 20 tracking-spline)": [ - [16, "vector"], - [32, "vector"] - ], - "(method 21 tracking-spline)": [ - [16, "tracking-spline-sampler"], - [32, "vector"] - ], - "(method 22 tracking-spline)": [ - [16, "tracking-spline-sampler"], - [32, "vector"] - ], - "cam-slave-init": [[16, "event-message-block"]], - "cam-curve-pos": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - "cam-calc-follow!": [ - [16, "event-message-block"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [144, "vector"] - ], - "mat-remove-z-rot": [ - [16, "vector"], - [32, "matrix"] - ], - "slave-matrix-blend-2": [ - [16, "vector"], - [32, "quaternion"], - [48, "quaternion"], - [64, "quaternion"] - ], - "vector-into-frustum-nosmooth!": [ - [16, "matrix"], - [80, "vector"], - [96, "vector"] - ], - "slave-set-rotation!": [ - [16, "vector"], - [32, "matrix"], - [96, "vector"], - [112, "matrix"], - [176, "vector"] - ], - "v-slrp2!": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "matrix"], - [128, "vector"] - ], - "v-slrp3!": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "matrix"], - [128, "vector"] - ], - - "(code cam-combiner-active)": [ - [16, "vector"], - [32, "matrix"], - [80, "vector"], - [96, "matrix"] - ], - "cam-master-init": [ - [16, "vector"], - [32, "vector"] - ], - "plane-from-points": [[16, "vector"]], - "update-view-planes": [ - [16, "view-frustum"], - [144, "vector"], - [160, "vector"], - [176, "vector"], - [192, "vector"], - [208, "vector"], - [224, "vector"] - ], - "move-camera-from-pad": [[16, "vector"]], - "cam-free-floating-move": [[16, "camera-free-floating-move-info"]], - "update-camera": [ - [16, "vector"], - [32, "quaternion"], - [48, "vector"] - ], - - "ocean-make-trans-camera-masks": [ - [16, "vector"], - [32, "vector"] - ], - - "update-mood-prt-color": [[16, "vector"]], - - "update-mood-swamp": [[16, "vector"]], - - "update-mood-village1": [[16, "vector"]], - - "update-mood-maincave": [[16, "vector"]], - - "update-mood-ogre": [[16, "vector"]], - - "update-mood-finalboss": [ - [16, "vector"], - [32, "vector"] - ], - - "update-mood-darkcave": [ - [16, "vector"], - [32, "vector"] - ], - - "update-mood-citadel": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"], - [112, "vector"], - [128, "vector"] - ], - - "update-mood-jungleb": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "update-mood-sunken": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "update-mood-village2": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "update-mood-rolling": [ - [16, "vector"] // TODO - really not sure about this one - ], - - "update-mood-village3": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"] - ], - - "ocean-transition-check": [[16, "vector"]], - - "ocean-trans-add-upload-strip": [[16, "vector"]], - - "draw-ocean-transition-seams": [[16, "sphere"]], - - "(method 32 mayor)": [[16, "event-message-block"]], - - "(method 43 mayor)": [[16, "vector"]], - - "(method 10 tippy)": [[16, "vector"]], - - "compute-and-draw-shadow": [ - [16, "vector"], - [32, "vector"], - [48, "sparticle-cpuinfo"] // kinda a guess - ], - - "find-ground-and-draw-shadow": [ - [16, "vector"], - [32, "vector"], - [48, "collide-tri-result"] - ], - - "(method 20 collide-cache)": [[16, "vector"]], - - "(method 12 wobbler)": [[16, "vector"]], - - "(method 12 twister)": [[16, "matrix"]], - - "target-on-end-of-teetertotter?": [ - [16, "vector"], - [32, "vector"] - ], - - "(event teetertotter-launch)": [[16, "event-message-block"]], - - "(method 17 rigid-body)": [[16, "vector"]], - - "matrix-3x3-triple-transpose-product": [ - [16, "matrix"], - [80, "matrix"] - ], - - "(method 10 rigid-body)": [[16, "quaternion"]], - - "(method 13 rigid-body)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 16 rigid-body)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 14 rigid-body)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 18 rigid-body)": [[16, "vector"]], - - "(method 24 rigid-body-platform)": [[16, "vector"]], - - "(method 26 rigid-body-platform)": [[16, "vector"]], - - "(method 27 rigid-body-platform)": [[16, "vector"]], - - "(method 22 water-anim)": [[16, "vector"]], - - "(anon-function 9 plat-eco)": [[16, "event-message-block"]], - - "(trans plat-button-move-downward sunken-elevator)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(method 29 sunken-elevator)": [[16, "vector"]], - "(anon-function 0 title-obs)": [[16, "font-context"]], - - "print-game-text": [[16, "font-context"]], - - "draw-string-xy": [[16, "font-context"]], - - "(method 50 nav-enemy)": [[16, "vector"]], - - "nav-enemy-init-by-other": [[16, "vector"]], - - "nav-enemy-turn-to-face-point": [[16, "vector"]], - - "nav-enemy-facing-point?": [[16, "vector"]], - - "nav-enemy-jump-post": [[16, "vector"]], - - "(method 41 nav-enemy)": [ - [16, "vector"], - [32, "vector"] - ], - - "nav-enemy-falling-post": [ - [16, "vector"] // TODO - check collide-shape-moving::62(type, vector, float) - ], - - "nav-enemy-death-post": [ - [16, "vector"] // TODO - check collide-shape-moving::62(type, vector, float) - ], - - "nav-enemy-jump-land-post": [ - [16, "vector"], - [32, "vector"] - ], - - "nav-enemy-facing-direction?": [ - [16, "vector"], - [32, "vector"] - ], - - "nav-enemy-initialize-custom-jump": [ - [16, "vector"], - [32, "vector"] - ], - - "nav-enemy-flee-post": [ - [16, "vector"], - [32, "vector"] - ], - - "(enter nav-enemy-jump-land nav-enemy)": [[16, "vector"]], - "(code nav-enemy-die nav-enemy)": [[16, "event-message-block"]], - "(enter nav-enemy-die nav-enemy)": [[16, "event-message-block"]], - "(trans nav-enemy-flee nav-enemy)": [[16, "event-message-block"]], - "(trans nav-enemy-patrol nav-enemy)": [[16, "event-message-block"]], - - "(method 73 nav-enemy)": [[16, "event-message-block"]], - - "(method 43 nav-enemy)": [[16, "event-message-block"]], - - "nav-enemy-send-attack": [[16, "event-message-block"]], - - "birth-pickup-at-point": [[16, "vector"]], - - "merc-blend-shape": [[16, ["array", "int16", 128]]], - - "(method 43 bird-lady)": [[16, "vector"]], - - "(method 32 bird-lady-beach)": [[16, "event-message-block"]], - - "muse-to-idle": [[16, "event-message-block"]], - - "(method 32 sculptor)": [[16, "event-message-block"]], - - "(method 43 sculptor)": [[16, "vector"]], - - "(method 32 geologist)": [[16, "event-message-block"]], - - "(method 43 geologist)": [[16, "vector"]], - - "(method 32 oracle)": [[16, "event-message-block"]], - - "(method 11 oracle)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(method 32 explorer)": [[16, "event-message-block"]], - - "(method 43 explorer)": [[16, "vector"]], - - "(method 32 assistant)": [[16, "event-message-block"]], - - "(method 43 assistant)": [[16, "vector"]], - - "(code idle assistant)": [ - [16, "vector"], - [32, "vector"] - ], - - "check-drop-level-assistant": [[16, "vector"]], - - "(method 32 sage)": [[16, "event-message-block"]], - - "(method 43 sage)": [[16, "vector"]], - - "(trans idle sage)": [[16, "event-message-block"]], - - "(method 32 gambler)": [[16, "event-message-block"]], - - "(method 43 gambler)": [[16, "vector"]], - - "(method 32 warrior)": [[16, "event-message-block"]], - - "(method 43 warrior)": [[16, "vector"]], - - "(exit play-anim warrior)": [[16, "event-message-block"]], - - "minershort-trans-hook": [[16, "vector"]], - - "(method 32 minershort)": [[16, "event-message-block"]], - - "(exit play-anim minershort)": [[16, "event-message-block"]], - - "(method 43 minershort)": [[16, "vector"]], - - "(method 33 progress)": [[16, "event-message-block"]], - "hide-progress-screen": [[16, "event-message-block"]], - "progress-init-by-other": [[16, "quaternion"]], - "(post progress-debug)": [[16, "font-context"]], - "(post progress-normal)": [[16, "font-context"]], - "(code progress-normal)": [[16, "event-message-block"]], - "fuel-cell-progress-hud-orbit-callback": [ - [16, "vector"], - [32, "vector"] - ], - "(method 24 progress)": [[16, "font-context"]], - "(method 25 progress)": [[16, "font-context"]], - "(method 26 progress)": [[16, "font-context"]], - "(method 17 progress)": [[16, "font-context"]], - "(method 28 progress)": [[16, "font-context"]], - "(method 27 progress)": [[16, "font-context"]], - - "(method 11 fact-info-target)": [[16, "event-message-block"]], - - "(anon-function 6 game-info)": [[16, "event-message-block"]], - - "(anon-function 8 game-info)": [[16, "event-message-block"]], - - "(method 24 game-info)": [[16, "scf-time"]], - - "auto-save-post": [ - [16, "font-context"], - [112, "font-context"] - ], - - "auto-save-init-by-other": [[16, "event-message-block"]], - - "(code error auto-save)": [[16, "event-message-block"]], - - "(code done auto-save)": [[16, "event-message-block"]], - - "update-time-of-day": [ - [16, "(array float)"], // TODO - broken! - [48, "vector"] - ], - - "check-drop-level-rain": [[16, "vector"]], - - "update-rain": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "sparticle-track-sun": [[16, "vector"]], - - "(method 16 target)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "vector-local+!": [[16, "vector"]], - - "move-forward": [ - [16, "vector"], - [32, "vector"] - ], - - "set-forward-vel": [[16, "vector"]], - - "delete-back-vel": [ - [16, "vector"], - [32, "vector"] - ], - - "set-side-vel": [[16, "vector"]], - - "build-conversions": [[16, "vector"]], - - "vector-turn-to": [ - [16, "vector"], - [32, "vector"] - ], - - "warp-vector-into-surface!": [[16, "matrix"]], - - "vector<-pad-in-surface!": [[16, "vector"]], - - "local-pad-angle": [ - [16, "vector"], - [32, "vector"] - ], - - "turn-around?": [ - [16, "vector"], - [32, "vector"] - ], - - "target-move-dist": [[16, "vector"]], - - "turn-to-vector": [ - [16, "vector"], - [32, "vector"] - ], - - "add-thrust": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [144, "vector"], - [160, "vector"], - [176, "vector"], - [192, "vector"], - [208, "vector"], - [224, "vector"] - ], - - "add-gravity": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "target-compute-slopes": [ - [16, "vector"], - [32, "vector"], - [48, "matrix"] - ], - - "do-rotations2": [ - [16, "vector"], - [32, "quaternion"], - [48, "quaternion"] - ], - - "level-setup": [[16, "event-message-block"]], - - "flag-setup": [ - [16, "vector"], - [32, "event-message-block"], - [112, "vector"], - [128, "vector"], - [144, "vector"], - [160, "vector"] - ], - - "target-compute-edge": [ - [16, "event-message-block"], - [96, "vector"], - [112, "vector"] - ], - - "target-compute-edge-rider": [ - [16, "event-message-block"], - [96, "vector"] - ], - - "target-calc-camera-pos": [[16, "vector"]], - - "joint-points": [ - [16, "vector"], - [32, "vector"] - ], - - "target-real-post": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "target-swim-post": [[16, "vector"]], - - "target-no-stick-post": [[16, "vector"]], - - "target-no-move-post": [ - [16, "collide-edge-hold-list"] // a total guess - ], - - "target-slide-down-post": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "matrix"] - ], - - "target-no-ja-move-post": [ - [16, "collide-edge-hold-list"] // a total guess - ], - - "target-print-stats": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "target-compute-pole": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "event-message-block"], - [160, "vector"], - [176, "vector"], - [192, "vector"] - ], - - "can-exit-duck?": [ - [16, "collide-using-spheres-params"], - [48, ["inline-array", "sphere", 2]] - ], - - "(method 32 evilbro)": [[16, "event-message-block"]], - - "(exit play-anim evilbro)": [[16, "event-message-block"]], - - "(method 29 basebutton)": [[16, "event-message-block"]], - - "(code use warp-gate)": [[16, "event-message-block"]], - - "(trans use warp-gate)": [[16, "event-message-block"]], - - "(anon-function 1 basebutton)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(code target-warp-out)": [ - [16, "event-message-block"], - [96, "vector"], - [112, "vector"] - ], - - "dm-anim-tester-func": [[16, "event-message-block"]], - - "update-actor-vis-box": [[16, "vector"]], - - "(method 14 level-group)": [ - [16, "vector"], - [32, "vector"] - ], - - "(trans falling beach-rock)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"] - ], - - "(code falling beach-rock)": [[16, "event-message-block"]], - - "(method 11 beach-rock)": [[16, "vector"]], - - "birth-func-copy-target-y-rot": [[16, "matrix"]], - - "birth-func-ground-orient": [ - [16, "vector"], - [32, "collide-tri-result"], - [128, "vector"], - [144, "quaternion"], - [160, "quaternion"] - ], - - "birth-func-target-orient": [ - [32, "vector"], - [48, "vector"], // unused - [64, "quaternion"], - [80, "quaternion"] - ], - - "birth-func-vector-orient": [ - [16, "vector"], - [32, "vector"], // unused - [48, "quaternion"] - ], - - "part-tracker-track-target-joint": [[16, "vector"]], - - "process-drawable-burn-effect": [ - [16, "rgbaf"], - [32, "rgbaf"], - [48, "vector"] - ], - - "(anon-function 27 projectiles)": [[16, "vector"]], - - "projectile-collision-reaction": [ - [16, "vector"], - [32, "vector"], - [48, "matrix"], - [96, "vector"], - [112, "event-message-block"], - [192, "vector"], - [208, "vector"] - ], - - "(event projectile-moving projectile)": [[16, "event-message-block"]], - - "(code projectile-moving projectile)": [[16, "vector"]], - - "projectile-update-velocity-space-wars": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "(code projectile-die projectile)": [[16, "event-message-block"]], - - "projectile-init-by-other": [[16, "collide-edge-hold-list"]], - - "(method 27 projectile-yellow)": [[16, "vector"]], - - "spawn-projectile-blue": [ - [16, "vector"], - [32, "vector"] - ], - - "(enter plat-button-move-downward jungle-elevator)": [ - [16, "event-message-block"] - ], - - "(trans plat-button-move-downward jungle-elevator)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(method 29 jungle-elevator)": [[16, "vector"]], - - "(event bouncer-wait)": [[16, "event-message-block"]], - - "hopper-find-ground": [ - [16, "vector"], - [32, "collide-tri-result"] - ], - - "blocking-plane-init-by-other": [[16, "matrix"]], - - "evilsib-trans-hook-wait": [[16, "event-message-block"]], - - "(method 32 sequenceB)": [[16, "event-message-block"]], - - "(event play-anim sequenceB)": [[16, "event-message-block"]], - - "(exit play-anim sequenceB)": [[16, "event-message-block"]], - - "sequenceC-can-trans-hook-2": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "sequenceC-can-trans-hook": [[16, "event-message-block"]], - - "(method 32 sequenceC)": [[16, "event-message-block"]], - - "sequenceC-trans-hook": [[16, "vector"]], - - "(trans hidden assistant-firecanyon)": [[16, "font-context"]], - - "(method 32 sage-bluehut)": [[16, "event-message-block"]], - - "(exit play-anim sage-bluehut)": [[16, "event-message-block"]], - - "(method 43 sage-bluehut)": [[16, "vector"]], - - "(method 37 sharkey)": [[16, "vector"]], - - "(method 39 sharkey)": [[16, "vector"]], - - "sharkey-notice-player?": [[16, "event-message-block"]], - - "sharkey-move-to-attack-position": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(code nav-enemy-attack sharkey)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(trans nav-enemy-chase sharkey)": [[16, "event-message-block"]], - - "(method 43 lurkercrab)": [ - [16, "vector"], - [32, "vector"] - ], - - "(enter idle assistant-lavatube-end)": [[16, "event-message-block"]], - - "target-has-all-the-cells?": [[16, "event-message-block"]], - - "(code idle power-left)": [[16, "event-message-block"]], - - "(code jump powercellalt)": [[16, "trajectory"]], - - "(enter target-final-door)": [[16, "event-message-block"]], - - "(exit target-final-door)": [[16, "event-message-block"]], - - "(code target-final-door)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "event-message-block"] - ], - - "(method 43 aphid)": [[16, "event-message-block"]], - - "(code nav-enemy-give-up aphid)": [[16, "vector"]], - - "aphid-init-by-other": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "voicebox-track": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "crate-standard-event-handler": [[16, "event-message-block"]], - - "plat-trans": [[16, "vector"]], - - "(code door-closing eco-door)": [[16, "overlaps-others-params"]], - - "(code door-open eco-door)": [[16, "event-message-block"]], - - "(code door-opening eco-door)": [[16, "event-message-block"]], - - "(code door-closed eco-door)": [[16, "event-message-block"]], - - "(code plat-button-teleport-to-other-end plat-button)": [[16, "vector"]], - - "plat-button-camera-on": [[16, "event-message-block"]], - - "plat-button-camera-off": [[16, "event-message-block"]], - - "(trans plat-button-move-downward plat-button)": [[16, "vector"]], - - "(trans plat-button-move-upward plat-button)": [[16, "vector"]], - - "(event plat-idle plat-eco)": [[16, "event-message-block"]], - - "(trans plat-idle plat-eco)": [[16, "vector"]], - - "(anon-function 8 plat-eco)": [[16, "event-message-block"]], - - "(anon-function 7 plat-eco)": [ - [16, "vector"] // code - ], - - "(event drop-plat-idle)": [[16, "event-message-block"]], - - "(code drop-plat-rise)": [[16, "vector"]], - - "(post drop-plat-rise)": [[16, "quaternion"]], - - "(code drop-plat-drop)": [[16, "vector"]], - - "(post drop-plat-drop)": [[16, "quaternion"]], - - "(method 21 drop-plat)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "citb-drop-plat-spawn-children": [ - [16, "vector"], - [32, "vector"] - ], - - "citb-drop-plat-drop-all-children": [[16, "event-message-block"]], - - "citb-drop-plat-drop-children": [[16, "event-message-block"]], - - "(event plat-flip-idle)": [[16, "event-message-block"]], - - "(code plat-flip-idle)": [[16, "vector"]], - - "(method 27 square-platform)": [ - [16, "vector"], - [32, "vector"] - ], - - "(event wedge-plat-tip)": [[16, "event-message-block"]], - - "(event wedge-plat-outer-tip)": [[16, "event-message-block"]], - - "(event wall-plat-extending)": [[16, "event-message-block"]], - - "(code wall-plat-extending)": [[16, "vector"]], - - "(event wall-plat-retracting)": [[16, "event-message-block"]], - - "(code wall-plat-retracting)": [[16, "vector"]], - - "(event wall-plat-sync-idle)": [[16, "event-message-block"]], - - "(code wall-plat-sync-idle)": [[16, "vector"]], - - "(method 11 wall-plat)": [[16, "vector"]], - - "reset-target-tracking": [[16, "vector"]], - "reset-drawable-tracking": [[16, "vector"]], - - "master-track-target": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "collide-mesh-cache-tri"], - [160, "vector"], - [176, "vector"], - [192, "vector"], - [208, "vector"], - [224, "vector"] - ], - "master-unset-region": [[16, "event-message-block"]], - "master-base-region": [ - [16, "vector"], - [32, "event-message-block"] - ], - "master-switch-to-entity": [[32, "event-message-block"]], - "master-check-regions": [[16, "event-message-block"]], - - "cam-circular-position-into-max-angle": [ - [16, "matrix"], - [80, "matrix"], - [144, "vector"], - [160, "vector"] - ], - "cam-circular-position": [ - [16, "vector"], - [32, "vector"] - ], - "cam-circular-code": [[16, "vector"]], - "(anon-function 37 cam-states)": [ - [48, "vector"], - [64, "event-message-block"], - [16, "vector"], - [32, "vector"] - ], - "cam-string-find-position-rel!": [ - [16, "vector"], - [32, "vector"], - [48, "bone"], - [144, "matrix"] - ], - "cam-los-spline-collide": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(event cam-master-active)": [ - [16, "event-message-block"], - [96, "vector"], - [112, "vector"] - ], - - "(code cam-master-active)": [[16, "event-message-block"]], - - "(exit cam-eye)": [[16, "event-message-block"]], - - "(code cam-fixed)": [[16, "vector"]], - - "(enter cam-eye)": [[16, "vector"]], - - "(enter cam-billy)": [[16, "vector"]], - - "(code cam-pov180)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "(enter cam-fixed-read-entity)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(enter cam-pov-track)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(code cam-decel)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(code cam-eye)": [ - [16, "vector"], - [32, "matrix"], - [96, "vector"], - [112, "vector"], - [128, "vector"] - ], - - "(code cam-billy)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "matrix"] - ], - - "(enter cam-standoff-read-entity)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "event-message-block"] - ], - - "(code cam-endlessfall)": [ - [16, "matrix"], - [80, "vector"], - [96, "vector"] - ], - - "(enter cam-spline)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "event-message-block"] - ], - - "(code cam-spline)": [[16, "curve"]], - - "(enter cam-circular)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "event-message-block"] - ], - - "los-cw-ccw": [ - [16, "vector"], - [32, "vector"], - [48, "matrix"], - [112, "vector"] - ], - - "cam-string-follow": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "cam-string-line-of-sight": [ - [16, "clip-travel-vector-to-mesh-return-info"], - [176, "vector"], - [192, "vector"], - [208, "vector"], - [224, "vector"], - [240, "vector"], - [256, "vector"] - ], - - "cam-string-joystick": [ - [16, "vector"], - [32, "matrix"], - [96, "vector"], - [112, "vector"] - ], - - "cam-string-find-hidden": [ - [16, "collide-mesh-cache-tri"], - [112, "vector"], - [128, "vector"] - ], - - "cam-string-move": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "collide-mesh-cache-tri"], - [192, "vector"], - [208, "vector"], - [224, "vector"] - ], - - "cam-string-code": [ - [16, "vector"], - [32, "vector"] - ], - - "(event cam-string)": [[16, "vector"]], - - "(trans cam-stick)": [ - [16, "matrix"], - [80, "vector"], - [96, "vector"], - [112, "vector"] - ], - "cam-bike-code": [ - [16, "matrix"], - [80, "vector"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [144, "vector"], - [160, "vector"], - [176, "collide-mesh-cache-tri"], - [272, "vector"] - ], - - "cam-stick-code": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "collide-mesh-cache-tri"], - [192, "vector"] - ], - - "(enter cam-string)": [ - [16, "vector"], - [32, "collide-mesh-cache-tri"], - [128, "vector"], - [144, "vector"], - [160, "vector"] - ], - - "cam-los-collide": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [144, "vector"], - [160, "vector"], - [176, "vector"], - [192, "vector"], - [208, "vector"] - ], - - "(code cam-point-watch)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "matrix"] - ], - - "(code cam-orbit)": [ - [16, "vector"], - [32, "vector"] - ], - - "(enter cam-free-floating)": [[16, "event-message-block"]], - - "(enter cam-orbit)": [[16, "vector"]], - - "(method 25 pov-camera)": [[16, "event-message-block"]], - - "(code pov-camera-start-playing pov-camera)": [[16, "event-message-block"]], - - "(code pov-camera-done-playing pov-camera)": [[16, "event-message-block"]], - - "debug-set-camera-pos-rot!": [[16, "event-message-block"]], - - "camera-master-debug": [[16, "vector"]], - - "(method 23 tracking-spline)": [ - [16, "vector"], - [32, "vector"] - ], - - "master-draw-coordinates": [ - [16, "vector"], - [32, "vector"], - [48, "matrix"] - ], - - "camera-slave-debug": [ - [16, "vector"], - [32, "vector"], - [48, "matrix"], - [112, "vector"], - [128, "curve"], - [160, "vector"], - [176, "vector"], - [192, "vector"] - ], - - "cam-debug-draw-tris": [[16, "vector4w"]], - - "cam-collision-record-draw": [ - [16, "vector4w"], - [32, "vector4w"], - [48, "collide-mesh-cache-tri"], - [144, "vector"] - ], - - "debug-euler": [ - [16, "euler-angles"], - [32, "matrix"] - ], - - "v-slrp!": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "interp-test": [ - [16, "vector"], - [32, "vector"] - ], - - "cam-layout-save-cam-trans": [[16, "vector"]], - - "cam-layout-save-pivot": [[16, "vector"]], - - "cam-layout-save-interesting": [[16, "vector"]], - - "cam-layout-save-align": [[16, "vector"]], - - "clmf-cam-flag-toggle": [[16, "clmf-cam-flag-toggle-info"]], - - "interp-test-deg": [ - [16, "vector"], - [32, "vector"] - ], - - "clmf-pos-rot": [ - [16, "vector"], - [32, "vector"], - [48, "matrix"], - [112, "matrix"], - [176, "vector"] - ], - - "clmf-input": [ - [16, "matrix"], - [80, "vector"] - ], - - "cam-layout-entity-info": [ - [16, "matrix"], - [80, "vector"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [144, "curve"], - [176, "vector"], - [192, "vector"], - [208, "vector"], - [224, "curve"], - [256, "vector"], - [272, "vector"], - [288, "vector"], - [304, "curve"], - [336, "vector"], - [352, "vector"], - [368, "interp-test-info"], - [432, "vector"] - ], - - "clmf-save-single": [[16, "file-stream"]], - - "pov-camera-play-and-reposition": [[16, "event-message-block"]], - - "cam-layout-entity-volume-info-create": [ - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [144, "vector"] - ], - - "(code plunger-lurker-plunge)": [[16, "event-message-block"]], - "(event flying-lurker-fly)": [[16, "event-message-block"]], - "(trans flying-lurker-fly)": [[16, "event-message-block"]], - "flying-lurker-handler": [[16, "event-message-block"]], - "flying-lurker-play-intro": [[16, "event-message-block"]], - "(code flying-lurker-start)": [[16, "event-message-block"]], - "(event flying-lurker-clone)": [[16, "event-message-block"]], - "(event flying-lurker-idle)": [[16, "event-message-block"]], - "(code flying-lurker-idle)": [[16, "event-message-block"]], - "flying-lurker-calc-speed": [ - [16, "vector"], - [32, "vector"] - ], - "(method 20 flying-lurker)": [ - [16, "collide-mesh-cache-tri"], - [112, "vector"], - [128, "vector"], - [144, "bounding-box"], - [176, "vector"] - ], - "flying-lurker-rotate": [ - [16, "matrix"], - [80, "matrix"], - [144, "vector"], - [160, "vector"] - ], - - "(method 18 collide-cache)": [[16, "collide-cache-prim"]], - - "kill-current-level-hint": [[16, "event-message-block"]], - "(exit level-hint-sidekick)": [[16, "event-message-block"]], - "(method 14 level-hint)": [[16, "font-context"]], - "(code level-hint-error)": [[16, "font-context"]], - "ambient-type-hint": [[16, "font-context"]], - "ambient-type-sound": [[32, "sound-spec"]], - "ambient-type-sound-loop": [[16, "sound-spec"]], - - "(trans windmill-one-idle)": [ - [16, "vector"] - ], - - "move-grottopole-to-position": [ - [16, "vector"] - ], - - "flying-rock-init-by-other": [ - [16, "vector"] - ], - - "(event flutflutegg-idle)": [ - [16, "vector"] - ], - - "(trans flutflutegg-idle)": [ - [16, "vector"] - ], - - "(event flutflutegg-physics)": [ - [16, "vector"] - ], - - "(code flutflutegg-physics-fall)": [ - [16, "vector"], - [32, "quaternion"] - ], - - "(code flutflutegg-physics)": [ - [16, "vector"], - [32, "quaternion"] - ], - - "(code flying-rock-rolling)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "move-grottopole": [ - [16, "vector"], - [32, "vector"] - ], - - "(code ecoventrock-break)": [ - [16, "event-message-block"], - [96, "vector"], - [112, "vector"] - ], - - "beachcam-spawn": [ - [16, "event-message-block"] - ], - - "(anon-function 8 beach-obs)": [ - [16, "event-message-block"] - ], - - "(code target-warp-in)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(trans active warp-gate)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(code idle warp-gate)": [ - [16, "vector"], - [32, "font-context"] - ], - - "(code active warp-gate)": [ - [16, "font-context"] - ], - - "(event basebutton-up-idle 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"] - ], - - "(event basebutton-down-idle warp-gate-switch)": [ - [16, "event-message-block"] - ], - - "(code basebutton-going-down warp-gate-switch)": [ - [16, "event-message-block"] - ], - - "(code idle citb-arm-section)": [ - [16, "vector"], - [32, "vector"] - ], - - "(event citb-disc-idle)": [ - [16, "event-message-block"] - ], - - "(post plat-path-active citb-launcher)": [ - [16, "event-message-block"] - ], - - "(event citb-robotboss-idle)": [ - [16, "event-message-block"] - ], - - "(code citb-robotboss-idle)": [ - [16, "event-message-block"] - ], - - "citb-generator-trigger-others": [ - [16, "event-message-block"] - ], - - "(code citb-generator-break)": [ - [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"] - ], - - "(method 11 eggtop)": [ - [16, "vector"] - ], - - "(anon-function 4 jungleb-obs)": [ - [16, "event-message-block"] - ], - - "(event idle logtrap)": [ - [16, "event-message-block"] - ], - - "(code pov-camera-playing precurbridgecam)": [ - [16, "event-message-block"] - ], - - "(code precurbridge-idle)": [ - [16, "event-message-block"] - ], - - "(code maindoor-closed)": [ - [16, "event-message-block"] - ], - - "(method 11 maindoor)": [ - [16, "event-message-block"] - ], - - "(code lurkerm-piston-idle)": [ - [16, "vector"] - ], - - "starfish-spawn-child": [ - [16, "vector"] - ], - - "(method 27 bone-platform)": [ - [16, "vector"] - ], - - "(event breakaway-idle)": [ - [16, "event-message-block"] - ], - - "mistycam-spawn": [ - [16, "event-message-block"] - ], - - "mis-bone-bridge-event-handler": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "event-message-block"] - ], - - "misty-cam-restore": [ - [16, "vector"], - [32, "matrix"], - [96, "event-message-block"] - ], - - "(trans allpontoons-be-clone)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"] - ], - - "fireboulder-hover-stuff": [ - [16, "vector"] - ], - - "(enter fireboulder-hover)": [ - [16, "vector"] - ], - - "boulder1-trans": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "boulder2-trans-2": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "boulder2-trans": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "boulder3-trans-2": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "boulder3-trans": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "boulder4-trans-3": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "boulder4-trans-2": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "boulder4-trans": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(code exit-chamber-dummy-idle)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(code exit-chamber-dummy-wait-to-appear)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(code ogreboss-village2-throw)": [ - [16, "event-message-block"] - ], - - "swamp-spike-default-event-handler": [ - [16, "event-message-block"] - ], - - "swamp-spike-post": [ - [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"] - ], - - "(event idle cavetrapdoor)": [ - [16, "event-message-block"] - ], - - "cavecrystal-light-control-caveelevator-callback": [ - [16, "vector"] - ], - - "(method 21 caveelevator)": [ - [16, "vector"] - ], - - "(method 20 caveelevator)": [ - [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"] - ], - - "dark-plant-check-target": [ - [16, "event-message-block"] - ], - - "(code dark-plant-idle)": [ - [16, "event-message-block"] - ], - - "(code gorge-abort-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-aborted)": [ - [16, "event-message-block"] - ], - - "(enter gorge-start-racing)": [ - [16, "event-message-block"] - ], - - "(exit gorge-start-racing)": [ - [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"] - ], - - "(method 11 gorge-start)": [ - [16, "vector"] - ], - - "(method 11 happy-plant)": [ - [16, "vector"] - ], - - "rolling-start-init-by-other": [ - [16, "matrix"] - ], - - "dark-plant-randomize": [ - [16, "vector"] - ], - - "gorge-init": [ - [16, "vector"] - ], - - "gorge-start-launch-start-banner": [ - [16, "vector"] - ], - - "gorge-behind": [ - [16, "vector"] - ], - - "gorge-in-front": [ - [16, "vector"] - ], - - "race-time-read": [ - [16, "race-time"] - ], - - "gorge-start-draw-time": [ - [16, "font-context"] - ], - - "(event balloon-idle)": [ - [16, "event-message-block"] - ], - - "(trans spike-up)": [ - [16, "event-message-block"] - ], - - "(trans spike-down)": [ - [16, "event-message-block"] - ], - - "(trans spike-idle)": [ - [16, "event-message-block"] - ], - - "(event idle crate-darkeco-cluster)": [ - [16, "event-message-block"] - ], - - "(event idle tntbarrel)": [ - [16, "event-message-block"] - ], - - "(trans ogre-bridge-idle)": [ - [16, "event-message-block"] - ], - - "(code ogre-bridge-activate)": [ - [16, "event-message-block"] - ], - - "(event ogre-bridge-break)": [ - [16, "vector"] - ], - - "(code ride-up gondola)": [ - [16, "event-message-block"] - ], - - "(code ride-down gondola)": [ - [16, "event-message-block"] - ], - - "(code idle gondola)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"], - [128, "font-context"] - ], - - "(code pov-camera-playing snowcam)": [ - [16, "event-message-block"] - ], - - "(code snow-eggtop-activate)": [ - [16, "event-message-block"] - ], - - "(event snowpusher-idle)": [ - [16, "event-message-block"] - ], - - "(code snow-log-wait-for-master)": [ - [16, "event-message-block"] - ], - - "(code snow-log-button-activate)": [ - [16, "event-message-block"] - ], - - "(method 11 snow-eggtop)": [ - [16, "vector"] - ], - - "(method 20 snow-gears)": [ - [16, "vector"] - ], - - "(code snow-switch-activate)": [ - [16, "vector"] - ], - - "(method 11 snow-switch)": [ - [16, "vector"] - ], - - "(code snow-fort-gate-activate)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "(code snow-spatula-idle)": [ - [16, "matrix"] - ], - - "(enter snow-button-activate)": [ - [16, "event-message-block"] - ], - - "(code plat-startup flutflut-plat)": [ - [16, "event-message-block"] - ], - - "(enter flutflut-plat-appear)": [ - [16, "vector"], - [32, "quaternion"] - ], - - "(enter flutflut-plat-hide)": [ - [16, "vector"], - [32, "quaternion"] - ], - - "darkecobarrel-mover-pos": [ - [16, "vector"], - [32, "matrix"], - [96, "vector"], - [112, "matrix"], - [176, "vector"] - ], - - "(code darkecobarrel-mover-die)": [ - [16, "vector"] - ], - - "(code die chainmine)": [ - [16, "vector"] - ], - - "(event idle chainmine)": [ - [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 ndi logo)": [ - [16, "event-message-block"] - ], - - "(enter target-title)": [ - [16, "event-message-block"] - ], - - "(trans target-title-wait)": [ - [16, "font-context"] - ], - - "(code target-title)": [ - [16, "mc-slot-info"] - ], - - "(post startup logo)": [ - [16, "vector"], - [32, "vector"] - ], - - "sp-relaunch-particle-3d": [ - [16, "quaternion"], - [32, "vector"], - [48, "quaternion"] - ], - - "sp-adjust-launch": [ - [16, "sparticle-launchinfo"], - [64, "matrix"], - [128, "vector"], - [144, "matrix"] - ], - - "(method 10 sparticle-launch-control)": [[16, "vector"]], - - "sparticle-50-to-60": [[16, "quaternion"]], - - "sparticle-60-to-50": [[16, "quaternion"]], - - "sp-orbiter": [ - [16, "vector"], - [32, "vector"], - [48, "matrix"] - ], - - "sp-euler-convert": [ - [16, "vector"], - [32, "quaternion"] - ], - - "sp-rotate-system": [ - [16, "matrix"], - [80, "quaternion"] - ], - - "sp-launch-particles-death": [ - [16, "sprite-vec-data-2d"] // TODO this is probably wrong. - ], - - "birth-func-copy-rot-color": [[16, "vector"]], - - "birth-func-copy2-rot-color": [ - [16, "vector"], - [32, "vector"] - ], - - "(code nav-enemy-give-up babak)": [[16, "vector"]], - - "(method 10 gui-query)": [[16, "font-context"]], - - "(method 46 process-taskable)": [ - [16, "vector"], - [32, "vector"] - ], - - "(trans release process-taskable)": [[16, "event-message-block"]], - - "(trans give-cell process-taskable)": [[16, "event-message-block"]], - - "process-taskable-play-anim-code": [[16, "event-message-block"]], - - "(event idle process-taskable)": [[16, "event-message-block"]], - - "(trans idle process-taskable)": [ - [16, "font-context"], - [112, "event-message-block"] - ], - - "(post idle process-taskable)": [[16, "vector"]], - - "babak-with-cannon-ride-cannon-post": [[16, "vector"]], - - "(code babak-with-cannon-jump-onto-cannon)": [[16, "vector"]], - - "(code othercam-running)": [ - [16, "vector"], - [32, "vector"] - ], - - "(code wait-for-start flutflut)": [ - [16, "event-message-block"], - [96, "vector"] - ], - - "(code idle flutflut)": [ - [16, "font-context"], - [112, "event-message-block"] - ], - - "(event wait-for-return flutflut)": [[16, "event-message-block"]], - - "yakow-generate-travel-vector": [ - [16, "vector"], - [32, "vector"] - ], - - "yakow-facing-direction?": [ - [16, "vector"], - [32, "vector"] - ], - - "yakow-facing-point?": [[16, "vector"]], - - "(enter yakow-graze)": [[16, "event-message-block"]], - - "(method 13 vehicle-path)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(method 12 vehicle-controller)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 14 vehicle-controller)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 10 vehicle-controller)": [[16, "vector"]], - - "(method 23 fishermans-boat)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"], - [112, "vector"] - ], - - "fishermans-boat-wave": [[16, "vector"]], - - "fishermans-boat-spawn-particles": [[16, "vector"]], - - "fishermans-boat-play-sounds": [[16, "vector"]], - - "fishermans-boat-post": [[16, "event-message-block"]], - - "(code fishermans-boat-leaving-village)": [[16, "event-message-block"]], - - "(trans fishermans-boat-entering-village)": [[16, "event-message-block"]], - - "(code fishermans-boat-leaving-misty)": [[16, "event-message-block"]], - - "(trans fishermans-boat-entering-misty)": [[16, "event-message-block"]], - - "(exit fishermans-boat-player-control)": [[16, "event-message-block"]], - - "(code fishermans-boat-player-control)": [[16, "event-message-block"]], - - "(code fishermans-boat-ride-to-misty)": [[16, "event-message-block"]], - - "(event fishermans-boat-ride-to-village1)": [[16, "event-message-block"]], - - "(code fishermans-boat-ride-to-village1)": [[16, "event-message-block"]], - - "fishermans-boat-leave-dock?": [[16, "font-context"]], - - "(trans fishermans-boat-player-control)": [[16, "vector"]], - - "(code fishermans-boat-measurements)": [[16, "vector"]], - - "(method 15 vehicle-controller)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "analyze-point-on-path-segment": [[16, "vector"]], - - "(method 51 muse)": [[16, "vector"]], - - "muse-check-dest-point": [[16, "point-on-path-segment-info"]], - - "(code muse-caught)": [[16, "event-message-block"]], - - "(method 43 bonelurker)": [[16, "event-message-block"]], - - "bonelurker-stunned-event-handler": [[16, "event-message-block"]], - - "bonelurker-push-post": [[16, "vector"]], - - "(code nav-enemy-give-up bonelurker)": [[16, "vector"]], - - "(code bonelurker-stun)": [[16, "vector"]], - - "(method 32 assistant-bluehut)": [[16, "event-message-block"]], - - "(trans idle assistant-bluehut)": [[16, "event-message-block"]], - - "(exit play-anim assistant-bluehut)": [[16, "event-message-block"]], - - "(method 32 assistant-levitator)": [[16, "event-message-block"]], - - "(exit play-anim assistant-levitator)": [[16, "event-message-block"]], - - "(method 47 assistant-bluehut)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 43 assistant-bluehut)": [[16, "vector"]], - - "check-drop-level-assistant-bluehut": [[16, "vector"]], - - "assistant-levitator-blue-glow": [[16, "vector"]], - - "(code idle assistant-bluehut)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "assistant-levitator-blue-beam": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "collide-mesh-cache-tri"], - [160, "event-message-block"] - ], - - "(trans hidden assistant-levitator)": [[16, "font-context"]], - - "(event square-platform-lowering)": [[16, "event-message-block"]], - - "(method 33 qbert-plat)": [[16, "event-message-block"]], - - "(method 32 qbert-plat)": [[16, "event-message-block"]], - - "(event qbert-plat-master-idle)": [[16, "event-message-block"]], - - "(code qbert-plat-master-do-door)": [[16, "event-message-block"]], - - "(code qbert-plat-master-wait-for-door)": [[16, "event-message-block"]], - - "(code qbert-plat-master-idle)": [ - [16, "event-message-block"], - [96, "vector"], - [112, "vector"] - ], - - "keg-event-handler": [[16, "event-message-block"]], - - "(code keg-paddle-to-path)": [ - [16, "vector"], - [32, "vector"], - [48, "quaternion"], - [64, "quaternion"], - [80, "vector"] - ], - - "(code keg-on-path)": [ - [16, "vector"], - [32, "vector3s"] - ], - - "(code keg-in-chute)": [ - [16, "vector"], - [32, "vector"] - ], - - "keg-init-by-other": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(code keg-conveyor-paddle-idle)": [[16, "event-message-block"]], - - "(method 11 keg-conveyor)": [ - [16, "vector"], - [32, "matrix"] - ], - - "swamp-bat-slave-event-handler": [[16, "event-message-block"]], - - "swamp-bat-launch-slave": [[16, "event-message-block"]], - - "swamp-bat-slave-path-post": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(code swamp-bat-slave-idle)": [ - [16, "vector"], - [32, "quaternion"], - [48, "quaternion"], - [64, "vector"] - ], - - "(code swamp-bat-slave-launch)": [ - [16, "vector"], - [32, "vector"] - ], - - "(code swamp-bat-slave-die)": [[16, "vector"]], - - "swamp-bat-make-path-select-plane": [[16, "vector"]], - - "(method 44 swamp-rat)": [[16, "event-message-block"]], - - "(method 39 swamp-rat)": [[16, "vector"]], - - "(method 38 swamp-rat)": [[16, "vector"]], - - "(code swamp-rat-spawn)": [[16, "vector"]], - - "swamp-rat-update-wiggle-target": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "swamp-rat-nest-dummy-event-handler": [[16, "event-message-block"]], - - "(trans swamp-rat-nest-gestate)": [[16, "event-message-block"]], - - "(code swamp-rat-nest-victory)": [[16, "event-message-block"]], - - "swamp-rat-nest-pick-spawn-joint": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "swamp-rat-nest-spawn-rat": [ - [16, "vector"], - [32, "vector"] - ], - - "cavecrystal-light-control-default-callback": [[16, "vector"]], - - "spiderwebs-default-event-handler": [[16, "event-message-block"]], - - "(enter nav-enemy-die baby-spider)": [[16, "event-message-block"]], - - "(code baby-spider-die-fast)": [[16, "event-message-block"]], - - "(method 39 baby-spider)": [[16, "vector"]], - - "(enter nav-enemy-idle baby-spider)": [[16, "vector"]], - - "(method 52 baby-spider)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "mother-spider-proj-update-velocity": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "(method 28 mother-spider-proj)": [[16, "vector"]], - - "(code blue-eco-charger-orb-active)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(method 21 blue-eco-charger)": [[16, "event-message-block"]], - - "(method 20 blue-eco-charger)": [[16, "event-message-block"]], - - "(code blue-eco-charger-idle)": [[16, "event-message-block"]], - - "(code exit-chamber-charger-puzzle-beaten)": [[16, "event-message-block"]], - - "(code exit-chamber-idle-in-sunken)": [[16, "event-message-block"]], - - "(event exit-chamber-idle-in-sunken)": [ - [16, "event-message-block"], - [32, "event-message-block"] - ], - - "(method 24 exit-chamber)": [[16, "vector"]], - - "(method 23 exit-chamber)": [ - [16, "vector"], - [32, "vector"], - [48, "exit-chamber-items"], - [128, "event-message-block"], - [208, "vector"] - ], - - "tube-thrust": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"] - ], - - "target-tube-post": [ - [16, "vector"], - [32, "event-message-block"], - [112, "vector"] - ], - - "(event target-tube-start)": [[16, "event-message-block"]], - - "(exit target-tube-start)": [[16, "event-message-block"]], - - "(code target-tube-start)": [ - [16, "event-message-block"], - [96, "vector"] - ], - - "(method 21 sunkenfisha)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 24 sunkenfisha)": [ - [16, "vector"], - [32, "matrix"], - [96, "vector"] - ], - - "(method 23 sunkenfisha)": [[16, "vector"]], - - "(trans sunkenfisha-idle)": [[16, "vector"]], - - "(method 27 sunkenfisha)": [[64, "vector"]], - - "(event idle minecartsteel)": [[16, "collide-overlap-result"]], - - "(method 43 assistant-villagec)": [[16, "vector"]], - - "(method 32 sage-villagec)": [[16, "event-message-block"]], - - "(method 43 sage-villagec)": [[16, "vector"]], - - "(trans idle sage-villagec)": [[16, "event-message-block"]], - - "(exit play-anim sage-villagec)": [[16, "event-message-block"]], - - "(method 20 cave-trap)": [ - [16, "spawn-baby-spider-work"], - [80, "vector"], - [96, "event-message-block"], - [176, "vector"], - [192, "vector"], - [208, "vector"] - ], - - "(trans cave-trap-idle)": [[16, "event-message-block"]], - - "ice-cube-default-event-handler": [[16, "event-message-block"]], - - "(trans yeti-slave-appear-jump-up)": [[16, "vector"]], - - "(code nav-enemy-give-up yeti-slave)": [[16, "vector"]], - - "(code yeti-resuming-start)": [ - [16, "vector"], - [32, "vector"] - ], - - "(code yeti-idle)": [ - [16, "vector"], - [32, "vector"] - ], - - "(trans hidden assistant-lavatube-start)": [[16, "font-context"]], - - "(method 18 nav-control)": [[16, "vector"]], - - "check-drop-level-firehose-pops": [[16, "vector"]], - - "birth-func-random-rot": [ - [16, "matrix"], - [80, "vector"], - [96, "vector"] - ], - - "check-drop-level-bigdoor-open-pops": [[16, "vector"]], - - "check-drop-level-eichar-lighteco-pops": [[16, "vector"]], - - "check-drop-level-maincave-drip": [[16, "vector"]], - - "part-tracker-move-to-target": [[16, "vector"]], - - "part-tracker-track-target": [[16, "vector"]], - - "check-drop-level-village1-fountain-nosplash": [[16, "vector"]], - - "check-drop-level-village1-fountain": [[16, "vector"]], - - "check-drop-level-sagehut": [[16, "vector"]], - - "check-drop-level-training-mist": [[16, "vector"]], - - "check-drop-level-training-spout-rain": [[16, "vector"]], - - "check-drop-level-sagehut2": [[16, "vector"]], - - "(method 15 hud-money-all)": [[16, "font-context"]], - - "(method 20 hud-money-all)": [[16, "event-message-block"]], - - "(method 20 hud-money)": [[16, "event-message-block"]], - - "fuel-cell-hud-orbit-callback": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 19 hud-fuel-cell)": [[16, "vector"]], - - "(method 20 hud-fuel-cell)": [ - [16, "event-message-block"], - [96, "quaternion"] - ], - - "hide-hud": [[16, "event-message-block"]], - - "hide-bottom-hud": [[16, "event-message-block"]], - - "disable-hud": [[16, "event-message-block"]], - - "enable-hud": [[16, "event-message-block"]], - - "hide-hud-quick": [[16, "event-message-block"]], - - "show-hud": [[16, "event-message-block"]], - - "convert-to-hud-object": [[16, "vector"]], - - "(method 16 hud)": [[16, "event-message-block"]], - - "(enter hud-hidden)": [[16, "event-message-block"]], - - "(enter hud-arriving)": [[16, "event-message-block"]], - - "send-hud-increment-event": [[16, "event-message-block"]], - - "(code hud-collecting)": [[16, "vector"]], - - "battlecontroller-fill-all-spawners": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "battlecontroller-camera-on": [[16, "event-message-block"]], - - "(code battlecontroller-die battlecontroller)": [[16, "event-message-block"]], - - "battlecontroller-battle-begin": [[16, "event-message-block"]], - - "battlecontroller-update-spawners": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "battlecontroller-spawn-creature-at-spawner": [ - [16, "vector"], - [32, "vector"] - ], - - "battlecontroller-camera-off": [[16, "event-message-block"]], - - "battlecontroller-spawn-creature-random-spawner": [ - [16, "event-message-block"] - ], - - "(method 10 effect-control)": [ - [16, "event-message-block"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [144, "vector"] - ], - - "(method 11 effect-control)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 12 effect-control)": [ - [16, "sound-spec"], - [96, "vector"] - ], - - "(code helix-button-startup)": [[16, "vector"]], - - "(method 43 green-eco-lurker)": [[16, "event-message-block"]], - - "(method 73 green-eco-lurker)": [[16, "event-message-block"]], - - "citb-sagecage-draw-bars": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(code sunken-pipegame-start-up)": [[16, "event-message-block"]], - - "(code race-ring-active)": [ - [16, "event-message-block"], - [96, "vector"] - ], - - "(method 11 race-ring)": [ - [16, "vector"], - [32, "vector"] - ], - - "init-sky-regs": [[16, "vector"]], - - "set-tex-offset": [[16, "vector"]], - - "sky-tng-setup-cloud-layer": [[16, ["inline-array", "sky-vertex", 12]]], - - "fisher-fish-move": [[16, "vector"]], - "fisher-fish-water": [[16, "vector"]], - "(trans play-accept fisher)": [[16, "vector"]], - "(method 11 fisher)": [[16, "vector"]], - "(code fisher-fish-caught)": [[16, "event-message-block"]], - "(code fisher-fish-die)": [[16, "event-message-block"]], - "(exit fisher-done)": [[16, "event-message-block"]], - "(enter fisher-done)": [[16, "event-message-block"]], - "(event fisher-playing)": [[16, "event-message-block"]], - "(enter fisher-playing)": [[16, "event-message-block"]], - "(exit fisher-playing)": [[16, "event-message-block"]], - "(trans enter-playing fisher)": [[16, "event-message-block"]], - "(code target-fishing)": [ - [16, "event-message-block"], - [96, "vector"], - [112, "quaternion"], - [128, "quaternion"], - [144, "quaternion"] - ], - "(method 43 fisher)": [ - [16, "vector"], - [32, "vector"] - ], - "fisher-draw-display": [[16, "font-context"]], - - "(method 10 torus)": [ - [16, "vector"], - [32, "vector"] - ], - "(method 12 torus)": [[16, "matrix"]], - "redshot-trans": [[16, "matrix"]], - "(trans redshot-explode)": [ - [16, "vector"], - [32, "event-message-block"], - [112, "vector"] - ], - "(code darkecobomb-explode)": [[16, "event-message-block"]], - "(event yellowshot-idle)": [[16, "event-message-block"]], - "(trans yellowshot-idle)": [[16, "event-message-block"]], - "(trans darkecobomb-countdown)": [[16, "vector"]], - - "arcing-shot-draw": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 9 torus)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "matrix"], - [128, ["inline-array", "vector", 8]] - ], - - "(method 32 finalbosscam)": [[16, "event-message-block"]], - - "(code cam-robotboss)": [ - [16, "vector"], - [32, "vector"] - ], - - "ecoclaw-beam-particle-callback": [[16, "vector"]], - "robotboss-manipy-trans-hook": [[16, "vector"]], - "robotboss-redshot": [[16, "vector"]], - "robotboss-cut-cam": [[16, "vector"]], - - "robotboss-yellowshot": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(trans robotboss-white-eco-movie)": [[16, "vector"]], - - "(code robotboss-red-wait)": [ - [16, "vector"], - [32, "redshot-launch-array"] - ], - - "(trans robotboss-yellow-wait)": [ - [16, "vector"], - [32, "event-message-block"], - [112, "vector"] - ], - - "robotboss-setup-for-hits": [ - [16, "sphere"], - [32, "event-message-block"] - ], - - "robotboss-position": [ - [16, "vector"], - [32, "matrix"], - [96, "event-message-block"], - [176, "vector"] - ], - - "robotboss-shooting-trans": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "robotboss-darkecobomb": [ - [16, "vector"], - [32, "vector"] - ], - - "robotboss-redshot-fill-array": [ - [16, "vector"], - [32, "vector"] - ], - - "robotboss-blue-beam": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "collide-mesh-cache-tri"], - [160, "vector"], - [176, "event-message-block"] - ], - - "robotboss-bomb-handler": [[16, "event-message-block"]], - "robotboss-blue-done": [[16, "event-message-block"]], - "(exit robotboss-blue-wait)": [[16, "event-message-block"]], - "(enter robotboss-blue-wait)": [[16, "event-message-block"]], - "(exit robotboss-green-wait)": [[16, "event-message-block"]], - "(event robotboss-green-wait)": [[16, "event-message-block"]], - - "(trans robotboss-red-wait)": [ - [16, "event-message-block"], - [96, "vector"] - ], - - "(exit robotboss-red-wait)": [[16, "event-message-block"]], - "(exit robotboss-yellow-wait)": [[16, "event-message-block"]], - "(code robotboss-white-eco-movie)": [[16, "event-message-block"]], - "(event robotboss-yellow-dark-bomb-wait)": [[16, "event-message-block"]], - "(exit robotboss-yellow-dark-bomb-wait)": [[16, "event-message-block"]], - "(code robotboss-daxter-sacrifice-movie)": [[16, "event-message-block"]], - - "robotboss-greenshot": [ - [16, "vector"], - [32, "vector"] - ], - - "(trans robotboss-blue-wait)": [ - [16, "vector"], - [32, "event-message-block"], - [112, "vector"] - ], - - "(code robotboss-blue-wait)": [[16, "event-message-block"]], - - "(method 44 green-eco-lurker)": [[16, "event-message-block"]], - "(method 72 green-eco-lurker)": [[16, "event-message-block"]], - "(enter nav-enemy-die green-eco-lurker)": [[16, "event-message-block"]], - "(event spawn-minions)": [[16, "event-message-block"]], - "(method 51 green-eco-lurker)": [[16, "vector"]], - "(enter green-eco-lurker-appear)": [ - [16, "vector"], - [32, "vector"] - ], - "(code spawn-minions)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "check-drop-level-lighteco-big-pops": [[16, "vector"]], - "check-drop-level-lighteco-pops": [[16, "vector"]], - "(method 20 light-eco-child)": [[16, "vector"]], - "light-eco-child-default-event-handler": [[16, "event-message-block"]], - "(code light-eco-child-die)": [[16, "event-message-block"]], - "light-eco-mother-default-event-handler": [[16, "event-message-block"]], - "(trans light-eco-child-hit-ground)": [[16, "vector"]], - "(method 21 light-eco-mother)": [[16, "vector"]], - "(method 20 light-eco-mother)": [[16, "vector"]], - - "(trans plat-path-active plat-eco-finalboss)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - "(method 44 sage-finalboss)": [[16, "event-message-block"]], - "(method 45 sage-finalboss)": [[16, "event-message-block"]], - "(method 32 sage-finalboss)": [[16, "event-message-block"]], - "(exit play-anim sage-finalboss)": [[16, "event-message-block"]], - "sage-finalboss-extra-trans": [[16, "event-message-block"]], - "sage-finalboss-extra-enter": [[16, "event-message-block"]], - "(trans play-anim sage-finalboss)": [ - [16, "event-message-block"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [144, "vector"], - [160, "vector"], - [176, "vector"], - [192, "vector"], - [208, "vector"], - [224, "vector"] - ], - - "lb-flip":[ - [16, "load-boundary-crossing-command"] - ], - - "---lb-save":[ - [16, "file-stream"] - ], - - "edit-load-boundaries":[ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "triangulate-boundary":[ - [16, "lbvtx"] - ], - - "fix-boundary-normals":[ - [16, "vector"] - ], - - "check-closed-boundary":[ - [16, "vector"] - ], - - "(event target-racing-start)": [ - [16, "event-message-block"] - ], - - "(exit 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-jump)": [ - [16, "vector"] - ], - - "(trans target-racing-bounce)": [ - [16, "vector"] - ], - - "(code target-racing-hit)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"] - ], - - "(exit target-racing-death)": [ - [16, "event-message-block"] - ], - - "(anon-function 17 racer-states-FIC-LAV-MIS-OGR-ROL)": [ - [16, "joint-exploder-tuning"] - ], - - "(code target-racing-death)": [ - [16, "event-message-block"], - [96, "vector"], - [112, "vector"] - ], - - "(code target-racing-get-on)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(post target-racing-get-on)": [ - [16, "vector"] - ], - - "(code target-racing-get-off-jump)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(post target-racing-get-off-jump)": [ - [16, "vector"] - ], - - "(exit 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"]], - "dma-add-process-drawable": [ - [32, "vector"], - [48, "vector"], - [64, "light-group"] - ], - - "(trans notice-blue crate)": [[16, "event-message-block"]], - "(event die crate)": [[16, "event-message-block"]], - "(code notice-blue crate)": [[16, "vector"]], - - "process-grab?": [[16, "event-message-block"]], - "process-release?": [[16, "event-message-block"]], - - "cloud-track": [ - [16, "vector"], - [32, "vector"] - ], - - "target-powerup-effect": [ - [16, "vector"] - ], - - "target-powerup-process": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "event-message-block"], - [160, "vector"], - [176, "vector"], - [192, "touching-shapes-entry"], - [208, "vector"], - [224, "vector"], - [240, "vector"], - [256, "vector"], - [272, "vector"], - [288, "vector"], - [304, "vector"], - [320, "vector"] - ], - - "process-drawable-pair-random-point!": [ - [16, "vector"], - [32, "vector"] - ], - - "update-ocean": [ - [16, "vector"] - ], - - "(method 20 cavegeyserrock)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(method 21 cavegeyserrock)": [ - [64, "vector"], - [80, "vector"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(code junglesnake-give-up)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(method 11 cavegeyserrock)": [ - [48, "vector"] - ], - - "cavecrystal-light-control-cavegeyserrock-callback": [ - [16, "vector"] - ], - - "junglesnake-default-event-handler": [ - [16, "event-message-block"] - ], - - "junglesnake-joint-callback": [ - [16, "matrix"], - [80, "matrix"], - [144, "matrix"], - [208, "vector"], - [224, "vector"], - [240, "vector"], - [256, "vector"], - [272, "vector"], - [288, "vector"], - [304, "matrix"], - [368, "matrix"] - ], - - "add-a-bunch": [ - [16, "vector"] - ], - - "(event idle scarecrow-a)": [ - [16, "vector"] - ], - - "(method 11 touching-prims-entry)": [ - [16, "vector"] - ], - - "(code hit scarecrow-a)": [ - [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)": [ - [16, "vector"], - [32, "event-message-block"] - ], - "(code orb-cache-top-complete)": [[16, "vector"]], - "(method 27 orb-cache-top)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(anon-function 54 generic-obs)": [ - [16, "vector"], - [32, "vector"] - ], - - "part-tracker-notify": [ - [16, "event-message-block"] - ], - - "process-grab?": [ - [16, "event-message-block"] - ], - - "process-release?": [ - [16, "event-message-block"] - ], - - "camera-change-to": [ - [16, "event-message-block"] - ], - - "camera-look-at": [ - [16, "event-message-block"] - ], - - "ja-anim-done?": [ - [16, "event-message-block"] - ], - - "draw-eco-beam": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "quaternion"] - ], - - "process-drawable-pair-random-point!": [ - [16, "vector"], - [32, "vector"] - ], - - "(anon-function 7 generic-obs)": [ - [16, "event-message-block"] - ], - - "(anon-function 11 generic-obs)": [ - [16, "event-message-block"] // trans - ], - - "(anon-function 13 generic-obs)": [ - [16, "event-message-block"] // event - ], - - "(anon-function 14 generic-obs)": [ - [16, "event-message-block"] // trans - ], - - "(anon-function 16 generic-obs)": [ // code - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(anon-function 18 generic-obs)": [ // enter - [16, "vector"] - ], - - "cam-launcher-long-joystick": [ - [16, "matrix"] - ], - - "(anon-function 21 generic-obs)": [ // code - [16, "event-message-block"] - ], - - "(anon-function 23 generic-obs)": [ // enter - [16, "vector"] - ], - - "cam-launcher-joystick": [ - [16, "matrix"], - [80, "vector"] - ], - - "(anon-function 31 generic-obs)": [ - [16, "vector"] // code - ], - - "(code swingpole-stance)": [ - [16, "event-message-block"] - ], - - "camera-anim": [ - [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"] - ], - - "(trans manipy-idle)": [ - [16, "vector"], - [32, "vector"] - ], - - "(anon-function 34 generic-obs)": [ - [16, "event-message-block"] - ], - - "(exit camera-tracker-process)": [ - [16, "event-message-block"] - ], - - "(code camera-tracker-process)": [ - [16, "event-message-block"] - ], - - "(code cam-launcher-shortfall)": [ - [16, "event-message-block"] - ], - - "(trans launcher-idle)": [ - [16, "event-message-block"] - ], - - "(event launcher-active)": [ - [16, "event-message-block"] - ], - - "(event touch-tracker-idle)": [ - [16, "event-message-block"] - ], - - "(trans launcher-active)": [ - [16, "event-message-block"] - ], - - "(code touch-tracker-idle)": [ - [16, "touching-shapes-entry"] - ], - - "(event manipy-idle)": [ - [16, "matrix"] - ], - - "(code med-res-level-idle)": [ - [16, "vector"] - ], - - "(enter cam-launcher-longfall)": [ - [16, "vector"] - ], - - "(enter cam-launcher-shortfall)": [ - [16, "vector"] - ], - - "(code cam-launcher-longfall)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "plant-boss-default-event-handler": [ - [16, "event-message-block"] - ], - - "(event plant-boss-vulnerable)": [ - [16, "event-message-block"] - ], - - "(code plant-boss-hit)": [ - [16, "event-message-block"] - ], - - "(code plant-boss-dead)": [ - [16, "event-message-block"] - ], - - "(event plant-boss-attack)": [ - [16, "event-message-block"] - ], - - "(code plant-boss-eat)": [ - [16, "event-message-block"] - ], - - "(anon-function 22 plant-boss)": [ - [16, "event-message-block"] - ], - - "(code 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"] - ], - - "(method 11 plant-boss)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [144, "vector"], - [160, "vector"], - [176, "vector"], - [192, "vector"] - ], - - "(method 60 ice-cube)": [ - [16, "vector"] - ], - - "(method 52 ice-cube)": [ - [16, "vector"] - ], - - "(trans ice-cube-appear)": [ - [16, "vector"] - ], - - "(code ice-cube-appear-land)": [ - [16, "vector"] - ], - - "(code ice-cube-face-player)": [ - [16, "vector"] - ], - - "(code ice-cube-mean-turn-to-charge)": [ - [16, "vector"] - ], - - "(method 54 ice-cube)": [ - [16, "vector"] - ], - - "(code ice-cube-shatter)": [ - [16, "vector"], - [32, "joint-exploder-tuning"] - ], - - "(trans ice-cube-trying-to-appear)": [ - [16, "vector"], - [32, "vector"] - ], - - "(trans ice-cube-mean-charge)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(method 51 ice-cube)": [ - [16, "vector"], - [32, "collide-tri-result"] - ], - - "(method 53 ice-cube)": [ - [16, "vector"], - [32, "collide-mesh-cache-tri"] - ], - - "(event double-lurker-top-knocked-down)": [ - [16, "event-message-block"] - ], - - "(code double-lurker-top-knocked-down)": [ - [16, "vector"] - ], - - "(method 48 double-lurker)": [ - [16, "vector"] - ], - - "(method 52 double-lurker)": [ - [16, "vector"], - [32, "vector"], - [48, "collide-mesh-cache-tri"] - ], - - "double-lurker-default-event-handler": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(code double-lurker-buddy-was-hit)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(trans double-lurker-both-knocked-back)": [ - [16, "check-vector-collision-with-nav-spheres-info"], - [64, "clip-travel-vector-to-mesh-return-info"] - ], - - "(trans double-lurker-knocked-back)": [ - [16, "check-vector-collision-with-nav-spheres-info"], - [64, "clip-travel-vector-to-mesh-return-info"] - ], - - "(code nav-enemy-die billy-rat)": [ - [16, "event-message-block"] - ], - - "(code billy-rat-eat)": [ - [16, "event-message-block"] - ], - - "(code billy-rat-salivate)": [ - [16, "event-message-block"] - ], - - "(enter nav-enemy-victory billy-rat)": [ - [16, "event-message-block"] - ], - - "(enter billy-done)": [ - [16, "event-message-block"] - ], - - "(exit billy-done)": [ - [16, "event-message-block"] - ], - - "(trans enter-playing billy)": [ - [16, "event-message-block"] - ], - - "(method 11 billy)": [ - [16, "event-message-block"] - ], - - "(method 32 billy)": [ - [16, "vector"] - ], - - "billy-rat-init-by-other": [ - [16, "vector"] - ], - - "(method 43 billy)": [ - [16, "vector"] - ], - - "(enter billy-playing)": [ - [16, "vector"] - ], - - "billy-game-update": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 20 lurkerworm)": [ - [16, "vector"] - ], - - "lurkerworm-prebind-function": [ - [16, "quaternion"] - ], - - "(method 21 lurkerworm)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "lurkerworm-default-event-handler": [ - [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"] - ], - - "pelican-path-update": [ - [16, "vector"] - ], - - "(trans pelican-wait-at-nest)": [ - [16, "vector"] - ], - - "(enter pelican-fly-to-end)": [ - [16, "vector"] - ], - - "(code pelican-spit)": [ - [16, "quaternion"], - [32, "event-message-block"], - [112, "vector"] - ], - - "(enter pelican-circle)": [ - [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"] - ], - - "(enter pelican-wait-at-nest)": [ - [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"] - ], - - "(trans energydoor-closed-till-task)": [ - [16, "event-message-block"] - ], - - "(method 11 energydoor)": [ - [16, "event-message-block"] - ], - - "(enter energyhub-stopped)": [ - [16, "event-message-block"] - ], - - "(enter energyhub-stop)": [ - [16, "event-message-block"] - ], - - "energydoor-player-dist": [ - [16, "vector"], - [32, "matrix"] - ], - - "(trans energyarm-idle)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "event-message-block"] - ], - - "energyarm-trans": [ - [16, "vector"], - [32, "matrix"] - ], - - "(trans energyball-idle)": [ - [16, "vector"], - [32, "matrix"] - ], - - "(method 11 energyhub)": [ - [16, "vector"], - [32, "matrix"] - ], - - "energyhub-trans": [ - [16, "matrix"] - ], - - "(method 43 red-sagecage)": [ - [16, "vector"] - ], - - "(method 43 blue-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"] - ], - - "(trans idle green-sagecage)": [ - [16, "event-message-block"] - ], - - "(exit 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"] - ], - - "(method 32 green-sagecage)": [ - [16, "event-message-block"] - ], - - "(event play-anim citb-sage)": [ - [16, "event-message-block"] - ], - - "(event idle citb-sage)": [ - [16, "event-message-block"] - ], - - "(event wait eco-collectable)": [ - [16, "event-message-block"] - ], - - "(enter wait eco-collectable)": [ - [16, "event-message-block"] - ], - - "(event 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"] - ], - - "(enter pickup eco-collectable)": [ - [16, "event-message-block"] - ], - - "(code die eco)": [ - [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"] - ], - - "(event vent-wait-for-touch)": [ - [16, "event-message-block"] - ], - - "add-blue-motion": [ - [16, "vector"] - ], - - "ecovalve-init-by-other": [ - [16, "vector"] - ], - - "(anon-function 69 collectables)": [ - [16, "vector"] - ], - - "(code ecovalve-idle)": [ - [16, "vector"] - ], - - "(method 9 fact-info)": [ - [16, "vector"], - [32, "collide-tri-result"] - ], - - "(method 29 buzzer)": [ - [16, "vector"] - ], - - "(trans wait eco-collectable)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(code jump eco-collectable)": [ - [16, "trajectory"] - ], - - "(event shover-idle)": [ - [16, "attack-info"], - [128, "event-message-block"] - ], - - "(method 21 sun-iris-door)": [ - [16, "vector"] - ], - - "(method 20 sun-iris-door)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(method 20 steam-cap)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(method 21 steam-cap)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [144, "vector"] - ], - - "(method 11 steam-cap)": [ - [32, "vector"] - ], - - "(trans floating-launcher-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 9 touching-list)": [ - [16, "touching-shapes-entry"] - ], - - "(method 11 touching-prims-entry)": [ - [16, "vector"] - ], - - "(method 35 collide-shape)": [ - [16, "pull-rider-info"], - [128, "matrix"], - [192, "event-message-block"], - [272, "collide-overlap-result"], - [384, "matrix"], - [448, "collide-overlap-result"], - [560, "matrix"], - [624, "collide-overlap-result"], - [736, "matrix"] - ], - - "(method 44 collide-shape)": [ - [16, "pull-rider-info"] - ], - - "(method 12 collide-mesh)": [ - [16, "matrix"] - ], - - "target-attack-up": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "event-message-block"] - ], - - "(method 30 collide-shape)": [ - [16, "vector"] - ], - - "(method 32 collide-shape)": [ - [16, "bounding-box"] - ], - - "(method 33 collide-shape)": [ - [16, "vector"] - ], - - "(method 57 collide-shape-moving)": [ - [16, "vector"] - ], - - "(method 60 collide-shape-moving)": [ - [16, "vector"], - [32, "collide-tri-result"] - ], - - "(method 59 collide-shape-moving)": [ - [16, "collide-mesh-cache-tri"], - [112, "touching-shapes-entry"] - ], - - "(method 58 collide-shape-moving)": [ - [16, "touching-shapes-entry"] - ], - - "simple-collision-reaction": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 62 collide-shape-moving)": [ - [16, "vector"], - [32, "vector"] - ], - - "default-collision-reaction": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [96, "vector"], - [112, "vector"], - [144, "vector"] - ], - - "(method 56 collide-shape-moving)": [ - [16, "event-message-block"] - ], - - "(method 63 collide-shape-moving)": [ - [16, "collide-shape-intersect"], - [160, "vector"], - [176, "vector"] - ], - - "(method 37 control-info)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"], - [112, "vector"], - [128, "vector"] - ], - - "(method 55 collide-shape)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "event-message-block"] - ], - - "(method 41 collide-shape)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 45 collide-shape)": [ - [16, "collide-work"], - [128, "vector"], - [144, "vector"], - [160, "collide-work"], - [272, "vector"], - [288, "vector"], - [304, "collide-work"], - [416, "vector"], - [432, "vector"], - [448, "collide-work"], - [560, "vector"], - [576, "vector"] - ], - - "collide-planes": [ - [16, "bounding-box"], - [48, ["inline-array", "vector", 18]], - [336, ["inline-array", "bounding-box", 18]], - [928, "vector"], - [944, "vector"], - [960, "vector"], - [976, "vector"], - [992, "vector"], - [1008, "vector"], - [1024, "vector"], - [1040, "vector"], - [1056, "vector"], - [1072, "vector"] - ], - - "dma-add-process-drawable": [ - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "marks-cam-restore": [ - [16, "vector"], - [32, "matrix"], - [96, "event-message-block"] - ], - - "gregs-village1-cam-restore": [ - [16, "vector"], - [32, "matrix"], - [96, "event-message-block"] - ], - - "gregs-texture-cam-restore": [ - [16, "vector"], - [32, "matrix"], - [96, "event-message-block"] - ], - - "gregs-texture2-cam-restore": [ - [16, "vector"], - [32, "matrix"], - [96, "event-message-block"] - ], - - "gregs-jungle-cam-restore": [ - [16, "vector"], - [32, "matrix"], - [96, "event-message-block"] - ], - - "eddie-cam-restore": [ - [16, "vector"], - [32, "matrix"] - ], - - "cave-cam-restore": [ - [16, "vector"], - [32, "matrix"] - ], - - "paals-cam-restore": [ - [16, "vector"], - [32, "matrix"] - ], - - "(method 20 target)": [ - [16, "event-message-block"] - ], - - "(method 19 collide-edge-work)": [ - [16, "vector"], - [32, "vector"], - [48, "collide-using-spheres-params"], - [80, "matrix"] - ], - - "(method 14 collide-edge-work)": [ - [16, "vector"] - ], - - "(method 10 collide-edge-work)": [ - [16, "vector"] - ], - - "(method 9 collide-edge-hold-list)": [ - [16, "vector"] - ], - - "collide-shape-moving-angle-set!": [ - [16, "vector"] - ], - - "poly-find-nearest-edge": [ - [16, "vector"], - [64, "vector"] - ], - - "target-collision-reaction": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [112, "vector"], - [128, "vector"], - [144, "vector"], - [176, "vector"], - [192, "vector"], - [208, "vector"] - ], - - "(method 31 collide-cache)": [ - [16, "vector"], - [32, "vector"] - ], - - "(method 43 collide-shape)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "event-message-block"] - ], - - "(method 15 collide-cache)": [ - [16, "bounding-box"] - ], - - "test-closest-pt-in-triangle": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "(method 9 collide-mesh)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(method 10 collide-mesh)": [ - [16, "matrix"] - ], - - "(method 22 collide-shape-prim-mesh)": [ - [16, "collide-tri-result"] - ], - - "find-ground-point": [ - [16, "vector"], - [32, "collide-mesh-cache-tri"], - [128, "bounding-box"], - [160, "vector"] - ], - - "(method 19 collide-shape-prim-sphere)": [[16, "collide-mesh-cache-tri"]], - "(method 37 collide-shape)": [[16, "vector"]], - - "starts": [ - [16, "event-message-block"] - ], - - "(trans target-flop)": [ - [16, "event-message-block"] - ], - - "(event target-wheel)": [ - [16, "event-message-block"] - ], - - "(code target-stance)": [ - [16, "ground-tween-info"] - ], - - "init-var-jump": [ - [16, "vector"] - ], - - "(code target-wheel)": [ - [16, "vector"] - ], - - "(code target-wheel-flip)": [ - [16, "vector"], - [32, "vector"] - ], - - "(enter target-flop)": [ - [16, "vector"] - ], - - "(code target-running-attack)": [ - [16, "vector"] - ], - - "(enter target-flop-hit-ground)": [ - [16, "vector"] - ], - - "(enter target-attack-air)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(enter target-hit-ground)": [ - [16, "vector"] - ], - - "(code target-flop)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(trans target-running-attack)": [ - [16, "vector"], - [32, "vector"] - ], - - "mod-var-jump": [ - [16, "vector"], - [32, "vector"] - ], - - "target-generic-event-handler": [ - [16, "event-message-block"] - ], - - "target-powerup-effect": [ - [16, "vector"] - ], - - "check-water-level-drop": [ - [16, "vector"] - ], - - "(method 13 water-control)": [ - [16, "vector"] - ], - - "(method 10 water-control)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "event-message-block"], - [144, "vector"], - [160, "vector"], - [176, "vector"], - [192, "vector"], - [208, "vector"] - ], - - "(method 15 water-control)": [ - [16, "event-message-block"] - ], - - "(anon-function 13 water)": [ - [16, "event-message-block"] - ], - - "(method 26 water-vol)": [ - [16, "event-message-block"] - ], - - "(code wait-for-start racer)": [ - [16, "event-message-block"], - [96, "vector"] - ], - - "(code idle racer)": [ - [16, "font-context"], - [112, "event-message-block"] - ], - - "(event wait-for-return racer)": [ - [16, "event-message-block"] - ], - - "racer-xz": [ - [16, "vector"] - ], - - "racer-cushion": [ - [16, "vector"] - ], - - "target-racing-post": [ - [16, "vector"], - [32, "vector"] - ], - - "racer-effects": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"], - [96, "vector"], - [112, "vector"], - [128, "vector"], - [144, "event-message-block"], - [224, "vector"], - [240, "vector"], - [256, "vector"] - ], - - "racer-sounds": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "racer-collision": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "racer-find-prop-point": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "racer-integrate": [ - [16, "quaternion"] - ], - - "fleeing-nav-enemy-clip-travel": [ - [16, "clip-travel-vector-to-mesh-return-info"], - [176, "vector"], - [192, "vector"], - [208, "vector"] - ], - - "fleeing-nav-enemy-adjust-travel": [ - [16, "matrix"], - [80, "vector"], - [96, "vector"] - ], - - "fleeing-nav-enemy-chase-post-func": [ - [16, "matrix"], - [80, "matrix"] - ], - - "fleeing-nav-enemy-chase-post": [ - [16, "vector"], - [32, "vector"], - [48, "matrix"], - [112, "vector"], - [128, "vector"] - ], - - "(post lightning-mole-debug-run)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "matrix"] - ], - - "(code fleeing-nav-enemy-debug)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "matrix"], - [144, "vector"] - ], - - "(trans nav-enemy-chase lightning-mole)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "event-message-block"] - ], - - "(trans lightning-mole-debug-blend)": [ - [16, "vector"], - [32, "vector"] - ], - - "(code lightning-mole-dive)": [ - [16, "vector"], - [32, "vector"] - ], - - "(trans lightning-mole-dive)": [ - [16, "event-message-block"] - ], - - "(trans lightning-mole-head-for-hole)": [ - [16, "event-message-block"] - ], - - "(method 43 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-finish": [ - [16, "vector"] - ], - - "(code fuel-cell-spline-slider)": [ - [16, "vector"] - ], - - "robber-find-ground": [ - [16, "vector"], - [32, "collide-mesh-cache-tri"], - [128, "vector"] - ], - - "robber-rotate": [ - [16, "matrix"], - [80, "vector"] - ], - - "robber-calc-speed": [ - [16, "vector"] - ], - - "(code robber-die)": [ - [16, "vector"] - ], - - "(code robber-initial-notice)": [ - [16, "vector"] - ], - - "(method 11 robber)": [ - [16, "matrix"] - ], - - "(code robber-debug)": [ - [16, "vector"], - [32, "vector"] - ], - - "(code target-flut-running-attack)": [ - [16, "vector"] - ], - - "(enter target-flut-running-attack)": [ - [16, "vector"], - [32, "vector"] - ], - - "(trans target-flut-running-attack)": [ - [16, "vector"], - [32, "vector"] - ], - - "(event target-flut-air-attack)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "target-flut-standard-event-handler": [ - [16, "vector"], - [32, "matrix"] - ], - - "(code target-flut-start)": [ - [16, "event-message-block"] - ], - - "(exit 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"] - ], - - "(event target-flut-jump)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(enter target-flut-air-attack)": [ - [16, "vector"] - ], - - "(post target-flut-get-on)": [ - [16, "vector"] - ], - - "(post target-flut-get-off-jump)": [ - [16, "vector"] - ], - - "(code target-flut-get-on)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(code target-flut-get-off-jump)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(code target-flut-death)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(trans target-flut-air-attack)": [ - [16, "vector"], - [32, "vector"] - ], - - "(code target-flut-hit)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "event-message-block"] - ], - - "target-hit-orient": [ - [16, "vector"] - ], - - "target-hit-move": [ - [16, "vector"], - [32, "vector"], - [48, "matrix"] - ], - - "(anon-function 20 target-death)": [ - [16, "event-message-block"] - ], - - "target-death-anim": [ - [16, "event-message-block"], - [96, "vector"] - ], - - "(code target-death)": [ - [16, "event-message-block"], - [96, "vector"] - ], - - "(code target-continue)": [ - [16, "event-message-block"], - [96, "transformq"] - ], - - "velocity-set-to-target!": [ - [16, "vector"] - ], - - "(exit target-hit)": [ - [16, "vector"] - ], - - "(code target-hit)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"], - [80, "event-message-block"] - ], - - "target-hit-push": [ - [16, "vector"] - ], - - "(anon-function 2 target-death)": [ - [16, "vector"] - ], - - "racer-collision-reaction": [ - [16, "vector"], - [32, "vector"], - [48, ["inline-array", "vector", 2]], - [112, "vector"], - [128, "vector"], - [144, "vector"], - [160, "vector"], - [176, "vector"], - [192, "vector"], - [208, "vector"], - [224, "vector"] - ], - - "target-send-attack": [ - [16, "event-message-block"], - [112, "vector"], - [144, "vector"], - [160, "vector"], - [192, "vector"], - [208, "vector"] - ], - - "target-apply-tongue": [ - [16, "vector"] - ], - - "target-bonk-event-handler": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"], - [128, "vector"] - ], - - "(code target-load-wait)": [ - [16, "event-message-block"] - ], - - "(code target-stance-look-around)": [ - [16, "event-message-block"] - ], - - "(enter target-look-around)": [ - [16, "event-message-block"] - ], - - "(exit target-look-around)": [ - [16, "event-message-block"] - ], - - "(code target-look-around)": [ - [16, "event-message-block"] - ], - - "(enter target-billy-game)": [ - [16, "event-message-block"] - ], - - "(exit target-billy-game)": [ - [16, "event-message-block"] - ], - - "(enter target-pole-cycle)": [ - [16, "event-message-block"] - ], - - "(code target-pole-flip-up-jump)": [ - [16, "event-message-block"] - ], - - "(enter target-edge-grab)": [ - [16, "event-message-block"] - ], - - "(exit target-edge-grab)": [ - [16, "event-message-block"] - ], - - "(trans target-swim-up)": [ - [16, "event-message-block"] - ], - - "(code target-launch)": [ - [16, "event-message-block"] - ], - - "(code target-play-anim)": [ - [16, "event-message-block"] - ], - - "(exit target-play-anim)": [ - [16, "event-message-block"] - ], - - "(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"] - ], - - "(code target-edge-grab-off)": [ - [16, "event-message-block"], - [96, "vector"] - ], - - "(trans target-look-around)": [ - [16, "vector"], - [32, "vector"] - ], - - "(trans target-pole-cycle)": [ - [16, "vector"] - ], - - "(code target-swim-jump)": [ - [16, "vector"] - ], - - "(anon-function 11 target2)": [ - [16, "vector"], - [48, "vector"], - [64, "vector"], - [80, "vector"] - ], - - "(enter target-yellow-blast)": [ - [16, "vector"] - ], - - "(code target-periscope)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(enter target-yellow-jump-blast)": [ - [16, "vector"] - ], - - "(code target-swim-down)": [ - [16, "vector"] - ], - - "(code target-yellow-jump-blast)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "target-swim-tilt": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - - "(code target-yellow-blast)": [ - [16, "vector"], - [32, "vector"], - [48, "event-message-block"] - ], - - "(code target-edge-grab-jump)": [ - [16, "vector"], - [32, "event-message-block"] - ], - - "(trans target-billy-game)": [ - [16, "vector"], - [32, "vector"] - ], - - "(code target-wade-walk)": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] - ], - - "clip-restore": [ - [16, "vector"], - [32, "matrix"] - ], "placeholder-do-not-add-below!": [] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index 0beac81e18..14733163c1 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -1,114 +1,4 @@ { - "(method 2 array)":[ - [23, "gp", "(array int32)"], - [43, "gp", "(array uint32)"], - [63, "gp", "(array int64)"], - [83, "gp", "(array uint64)"], - [102, "gp", "(array int8)"], - [121, "gp", "(array uint8)"], - [141, "gp", "(array int16)"], - [161, "gp", "(array uint16)"], - [185, "gp", "(array uint128)"], - [203, "gp", "(array int32)"], - [222, "gp", "(array float)"], - [231, "gp", "(array float)"], - [248, "gp", "(array basic)"], - [257, "gp", "(array basic)"] - ], - - "(method 3 array)":[ - [44, "gp", "(array int32)"], - [62, "gp", "(array uint32)"], - [80, "gp", "(array int64)"], - [98, "gp", "(array uint64)"], - [115, "gp", "(array int8)"], - [132, "gp", "(array int8)"], // bug in game - [150, "gp", "(array int16)"], - [168, "gp", "(array uint16)"], - [190, "gp", "(array uint128)"], - [203, "gp", "(array int32)"], - [225, "gp", "(array float)"], - [242, "gp", "(array basic)"] - ], - - "(method 2 handle)":[ - [10, "a3", "process"], - [11, "v1", "int"], - [15, "gp", "int"] - ], - - "(method 3 handle)":[ - [10, "gp", "int"] - ], - - "(method 0 cpu-thread)":[ - [13, "v0", "cpu-thread"] - ], - - "(method 0 dead-pool-heap)":[ - [60, "v0", "int"], // a lie, actually the 115 is an align16 constant propagated on addr of heap start. - [61, "v0", "dead-pool-heap"] - ], - - "(method 21 dead-pool-heap)":[ - [5, "v1", "pointer"], - [13, "a0", "pointer"], - [25, "v1", "pointer"] - ], - - "(method 5 dead-pool-heap)":[ - [3, "v1", "int"], - [3, "a0", "int"] - ], - - "remove-exit":[ - [0, "s6", "process"] - ], - - "(method 0 process)":[ - [12, "a0", "int"], - [13, "v0", "process"] - ], - - "inspect-process-heap":[ - [4, "s5", "basic"], - [17, "s5", "int"] - ], - - "return-from-thread-dead":[ - [0, "s6", "process"] - ], - - "(method 14 dead-pool)":[ - [23, "v1", "process"], // bad visit order with #f? - [28, "s4", "(pointer process-tree)"] // bug in real game, see gkernel.gc - ], - - "throw":[ - [20, "s4", "protect-frame"] // type case - ], - - "(method 0 protect-frame)":[ - [0, "a0", "int"], - [1, "v0", "protect-frame"] - ], - - "(method 9 process)":[ - [43, "s5", "process"] - ], - - "(method 10 process)":[ - [24, "s4", "protect-frame"] - ], - - "enter-state":[ - [67, "s0", "protect-frame"] - ], - - "name=":[ - [24, "a1", "symbol"], - [39, "a0", "symbol"] - ], "placeholder-do-not-add-below": [] } diff --git a/decompiler/config/jak2_ntsc_v1.jsonc b/decompiler/config/jak2_ntsc_v1.jsonc index 1d40c30524..a1d2f121bc 100644 --- a/decompiler/config/jak2_ntsc_v1.jsonc +++ b/decompiler/config/jak2_ntsc_v1.jsonc @@ -2,10 +2,13 @@ "game_version": 2, "text_version": 20, + "game_name": "jak2", + "expected_elf_name": "SCUS_972.65", + // if you want to filter to only some object names. // it will make the decompiler much faster. "allowed_objects": [], - "banned_objects": [], + "banned_objects": ["effect-control"], //////////////////////////// // CODE ANALYSIS OPTIONS @@ -13,10 +16,12 @@ // set to true to generate plain .asm files with MIPS disassembly, with no fancy decompilation. // this is fast and should succeed 100% of the time. - "disassemble_code": false, + "disassemble_code": true, // Run the decompiler - "decompile_code": false, + "decompile_code": true, + + "find_functions": true, //////////////////////////// // DATA ANALYSIS OPTIONS @@ -32,7 +37,9 @@ // unpack game text to assets folder "process_game_text": true, // unpack game count to assets folder - "process_game_count": false, + "process_game_count": true, + // write goal imports for art groups + "process_art_groups": true, /////////////////////////// // WEIRD OPTIONS @@ -40,9 +47,6 @@ // these options are used rarely and should usually be left at false - // output a file type_defs.gc which is used for the types part of all-types.gc - "regenerate_all_types": false, - // generate the symbol_map.json file. // this is a guess at where each symbol is first defined/used. "generate_symbol_definition_map": false, @@ -64,6 +68,13 @@ // set to true for PAL versions. this will forcefully skip files that have some data missing at the end. "is_pal": false, + "generate_all_types": true, + "write_patches": false, + "apply_patches": false, + "object_patches": [], + // jak 1's all-types, used to generate "hints" + "old_all_types_file": "decompiler/config/all-types.gc", + //////////////////////////// // CONFIG FILES //////////////////////////// @@ -75,15 +86,24 @@ "stack_structures_file": "decompiler/config/jak2/stack_structures.jsonc", "hacks_file": "decompiler/config/jak2/hacks.jsonc", "inputs_file": "decompiler/config/jak2/inputs.jsonc", + "art_info_file": "decompiler/config/jak2/art_info.jsonc", + "import_deps_file": "decompiler/config/jak2/import_deps.jsonc", + "all_types_file": "decompiler/config/all-types2.gc", + // optional: a predetermined object file name map from a file. // this will make decompilation naming consistent even if you only run on some objects. - "obj_file_name_map_file": "",//"goal_src/build/all_objs.json", + // "obj_file_name_map_file": "goal_src2/build/all_objs.json", //////////////////////////// // LEVEL EXTRACTION //////////////////////////// - "levels_to_extract":[ - ] + // turn this on to extract level background graphics data + "levels_extract": false, + // turn this on if you want extracted levels to be saved out as .obj files + "levels_convert_to_obj": false, + // should we extract collision meshes? + // these can be displayed in game, but makes the .fr3 files slightly larger + "extract_collision": true } diff --git a/decompiler/data/LinkedWordReader.h b/decompiler/data/LinkedWordReader.h index 83c533664a..5902547594 100644 --- a/decompiler/data/LinkedWordReader.h +++ b/decompiler/data/LinkedWordReader.h @@ -1,12 +1,14 @@ #pragma once #include -#include -#include #include +#include +#include + #include "common/common_types.h" -#include "decompiler/ObjectFile/LinkedWord.h" #include "common/util/Assert.h" +#include "decompiler/ObjectFile/LinkedWord.h" + namespace decompiler { class LinkedWordReader { public: @@ -17,8 +19,7 @@ class LinkedWordReader { m_offset++; return result; } else { - ASSERT(false); - throw std::runtime_error("LinkedWordReader::get_type_tag failed"); + ASSERT_MSG(false, "LinkedWordReader::get_type_tag failed"); } } diff --git a/decompiler/data/StrFileReader.cpp b/decompiler/data/StrFileReader.cpp index 8dc68b25d5..83c94ddc91 100644 --- a/decompiler/data/StrFileReader.cpp +++ b/decompiler/data/StrFileReader.cpp @@ -3,12 +3,15 @@ * Utility class to read a .STR file and extract the full file name. */ +#include "StrFileReader.h" + #include + +#include "common/util/Assert.h" #include "common/util/FileUtil.h" + #include "game/common/overlord_common.h" #include "game/common/str_rpc_types.h" -#include "StrFileReader.h" -#include "common/util/Assert.h" namespace decompiler { StrFileReader::StrFileReader(const std::string& file_path) { diff --git a/decompiler/data/StrFileReader.h b/decompiler/data/StrFileReader.h index 5a492f69c5..c97685cbb2 100644 --- a/decompiler/data/StrFileReader.h +++ b/decompiler/data/StrFileReader.h @@ -7,6 +7,7 @@ #include #include + #include "common/common_types.h" namespace decompiler { diff --git a/decompiler/data/TextureDB.cpp b/decompiler/data/TextureDB.cpp index f145fd1e58..34a53985c1 100644 --- a/decompiler/data/TextureDB.cpp +++ b/decompiler/data/TextureDB.cpp @@ -1,10 +1,12 @@ #include "TextureDB.h" -#include "third-party/fmt/core.h" -#include "common/util/Assert.h" -#include "third-party/stb_image.h" #include +#include "common/util/Assert.h" + +#include "third-party/fmt/core.h" +#include "third-party/stb_image/stb_image.h" + namespace decompiler { void TextureDB::add_texture(u32 tpage, diff --git a/decompiler/data/TextureDB.h b/decompiler/data/TextureDB.h index 79ac412c81..23e8c0ae4c 100644 --- a/decompiler/data/TextureDB.h +++ b/decompiler/data/TextureDB.h @@ -1,9 +1,10 @@ #pragma once -#include -#include #include #include +#include +#include + #include "common/common_types.h" namespace decompiler { diff --git a/decompiler/data/dir_tpages.cpp b/decompiler/data/dir_tpages.cpp index 8b5e0cde31..b7f823f5d4 100644 --- a/decompiler/data/dir_tpages.cpp +++ b/decompiler/data/dir_tpages.cpp @@ -1,7 +1,9 @@ -#include "third-party/fmt/core.h" -#include "decompiler/ObjectFile/ObjectFileDB.h" #include "dir_tpages.h" +#include "decompiler/ObjectFile/ObjectFileDB.h" + +#include "third-party/fmt/core.h" + namespace decompiler { std::string DirTpageResult::to_source() const { std::string result; diff --git a/decompiler/data/dir_tpages.h b/decompiler/data/dir_tpages.h index ddf6034f8e..f2dc95d73c 100644 --- a/decompiler/data/dir_tpages.h +++ b/decompiler/data/dir_tpages.h @@ -1,7 +1,7 @@ #pragma once -#include #include +#include namespace decompiler { diff --git a/decompiler/data/game_count.cpp b/decompiler/data/game_count.cpp index ded897cc7b..d30a0267f8 100644 --- a/decompiler/data/game_count.cpp +++ b/decompiler/data/game_count.cpp @@ -1,8 +1,11 @@ -#include "third-party/fmt/core.h" -#include "decompiler/ObjectFile/ObjectFileDB.h" #include "game_count.h" + #include "LinkedWordReader.h" +#include "decompiler/ObjectFile/ObjectFileDB.h" + +#include "third-party/fmt/core.h" + namespace decompiler { GameCountResult process_game_count(ObjectFileData& data) { GameCountResult result; diff --git a/decompiler/data/game_count.h b/decompiler/data/game_count.h index 892ee34892..a124588486 100644 --- a/decompiler/data/game_count.h +++ b/decompiler/data/game_count.h @@ -1,6 +1,8 @@ #pragma once +#include #include + #include "common/common_types.h" namespace decompiler { diff --git a/decompiler/data/game_text.cpp b/decompiler/data/game_text.cpp index 7883c1c9a6..f7f67af96d 100644 --- a/decompiler/data/game_text.cpp +++ b/decompiler/data/game_text.cpp @@ -1,13 +1,17 @@ +#include "game_text.h" + +#include #include #include #include -#include -#include "third-party/fmt/core.h" -#include "game_text.h" -#include "decompiler/ObjectFile/ObjectFileDB.h" + #include "common/goos/Reader.h" #include "common/util/BitUtils.h" +#include "decompiler/ObjectFile/ObjectFileDB.h" + +#include "third-party/fmt/core.h" + namespace decompiler { namespace { template @@ -24,6 +28,10 @@ DecompilerLabel get_label(ObjectFileData& data, const LinkedWord& word) { return data.linked_data.labels.at(word.label_id()); } +static const std::unordered_map> sTextCreditsIDs = { + {GameTextVersion::JAK1_V1, {0xb00, 0xf00}}, + {GameTextVersion::JAK1_V2, {0xb00, 0xf00}}}; + } // namespace /* @@ -125,8 +133,7 @@ GameTextResult process_game_text(ObjectFileData& data, GameTextVersion version) if (read_words[i] < 1) { std::string debug; data.linked_data.append_word_to_string(debug, words.at(i)); - printf("[%d] %d 0x%s\n", i, int(read_words[i]), debug.c_str()); - ASSERT(false); + ASSERT_MSG(false, fmt::format("[{}] {} 0x{}", i, int(read_words[i]), debug.c_str())); } } @@ -134,7 +141,7 @@ GameTextResult process_game_text(ObjectFileData& data, GameTextVersion version) } std::string write_game_text( - const Config& cfg, + GameTextVersion version, const std::unordered_map>& data) { // first sort languages: std::vector languages; @@ -145,16 +152,41 @@ std::string write_game_text( // build map std::map> text_by_id; + std::map> text_by_id_credits; + std::map> text_by_id_post_credits; + int last_credits_id = 0; + int credits_begin = 0; + int credits_end = 0; + if (auto it = sTextCreditsIDs.find(version); it != sTextCreditsIDs.end()) { + credits_begin = it->second.first; + credits_end = it->second.second; + } for (auto lang : languages) { - for (auto& text : data.at(lang)) { - text_by_id[text.first].push_back(text.second); + for (auto& [id, text] : data.at(lang)) { + if (id < credits_begin) { + // comes before credits + text_by_id[id].push_back(text); + } else if (id < credits_end) { + // comes before credits + text_by_id_credits[id].push_back(text); + if (id > last_credits_id) { + last_credits_id = id; + } + } else { + // comes after credits + text_by_id_post_credits[id].push_back(text); + } } } // write! std::string result; // = "\xEF\xBB\xBF"; // UTF-8 encode (don't need this anymore) - result += fmt::format("(language-count {})\n", languages.size()); result += "(group-name \"common\")\n"; + result += "(language-id"; + for (auto lang : languages) { + result += fmt::format(" {}", lang); + } + result += ")\n"; for (auto& x : text_by_id) { result += fmt::format("(#x{:04x}\n ", x.first); for (auto& y : x.second) { @@ -162,25 +194,45 @@ std::string write_game_text( } result += ")\n\n"; } + if (text_by_id_credits.size() > 0) { + result += fmt::format("(credits :begin #x{:04x}\n ", sTextCreditsIDs.at(version).first); - // add our own custom text additions from new_strings.jsonc - // - first add the strings that are the same across all languages - for (auto const& [key, val] : cfg.new_strings_same_across_langs) { - result += fmt::format("(#x{}\n ", key); - for (u32 i = 0; i < languages.size(); i++) { - result += fmt::format("\"{}\"\n ", val); + for (int id = sTextCreditsIDs.at(version).first; id <= last_credits_id; ++id) { + // check if the line exists first + if (text_by_id_credits.count(id) == 0) { + result += fmt::format("\"\"\n "); + continue; + } + // check if all lines are identical first + bool diff_langs = false; + bool is_first = true; + std::string last_lang; + for (auto& y : text_by_id_credits.at(id)) { + if (is_first) { + is_first = false; + } else if (last_lang != y) { + diff_langs = true; + break; + } + last_lang = y; + } + // now write them + if (!diff_langs) { + result += fmt::format("\"{}\"\n ", last_lang); + } else { + result += fmt::format("("); + for (auto& y : text_by_id_credits.at(id)) { + result += fmt::format("\"{}\"\n ", y); + } + result += ")\n "; + } } result += ")\n\n"; } - // - now add the ones that are different, if they do not have all languages defined, pad with - // placeholders - for (auto const& [key, val] : cfg.new_strings_different_across_langs) { - result += fmt::format("(#x{}\n ", key); - for (auto const& str : val) { - result += fmt::format("\"{}\"\n ", str); - } - for (u32 i = 0; i < languages.size() - val.size(); i++) { - result += fmt::format("\"{}\"\n ", "TODO"); + for (auto& x : text_by_id_post_credits) { + result += fmt::format("(#x{:04x}\n ", x.first); + for (auto& y : x.second) { + result += fmt::format("\"{}\"\n ", y); } result += ")\n\n"; } diff --git a/decompiler/data/game_text.h b/decompiler/data/game_text.h index 01fc17c234..a1b73458f2 100644 --- a/decompiler/data/game_text.h +++ b/decompiler/data/game_text.h @@ -1,11 +1,11 @@ #pragma once #include #include + #include "common/util/FontUtils.h" namespace decompiler { struct ObjectFileData; -struct Config; struct GameTextResult { int total_text = 0; @@ -16,6 +16,6 @@ struct GameTextResult { GameTextResult process_game_text(ObjectFileData& data, GameTextVersion version); std::string write_game_text( - const Config& cfg, + GameTextVersion version, const std::unordered_map>& data); } // namespace decompiler diff --git a/decompiler/data/streamed_audio.cpp b/decompiler/data/streamed_audio.cpp index 7d1855b4c0..e26aa410e1 100644 --- a/decompiler/data/streamed_audio.cpp +++ b/decompiler/data/streamed_audio.cpp @@ -1,13 +1,14 @@ -#include "common/log/log.h" -#include "common/util/FileUtil.h" -#include "common/util/BinaryReader.h" -#include "common/audio/audio_formats.h" -#include "third-party/fmt/core.h" -#include "third-party/json.hpp" - #include "streamed_audio.h" +#include "common/audio/audio_formats.h" +#include "common/log/log.h" +#include "common/util/BinaryReader.h" +#include "common/util/FileUtil.h" + +#include "third-party/fmt/core.h" +#include "third-party/json.hpp" + namespace decompiler { // number of bytes per "audio page" in the VAG directory file. diff --git a/decompiler/data/tpage.cpp b/decompiler/data/tpage.cpp index 78b6b2ff93..4d020c0973 100644 --- a/decompiler/data/tpage.cpp +++ b/decompiler/data/tpage.cpp @@ -14,12 +14,15 @@ * check duplicate names */ -#include "common/util/FileUtil.h" #include "tpage.h" -#include "common/versions.h" -#include "decompiler/ObjectFile/ObjectFileDB.h" -#include "third-party/fmt/core.h" + #include "common/texture/texture_conversion.h" +#include "common/util/FileUtil.h" +#include "common/versions.h" + +#include "decompiler/ObjectFile/ObjectFileDB.h" + +#include "third-party/fmt/core.h" namespace decompiler { namespace { @@ -276,8 +279,7 @@ Texture read_texture(ObjectFileData& data, const std::vector& words, auto kv = psms.find(tex.psm); if (kv == psms.end()) { - printf("Got unsupported texture 0x%x!\n", tex.psm); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Got unsupported texture 0x{:x}!", tex.psm)); } return tex; @@ -339,7 +341,7 @@ TexturePage read_texture_page(ObjectFileData& data, tpage.info_label = get_label(data, words.at(offset)); tpage.info = read_file_info(data, words, label_to_word_offset(tpage.info_label, true)); ASSERT(tpage.info.file_type == "texture-page"); - ASSERT(tpage.info.major_version == versions::TX_PAGE_VERSION); + ASSERT(tpage.info.major_version == versions::jak1::TX_PAGE_VERSION); ASSERT(tpage.info.minor_version == 0); ASSERT(tpage.info.maya_file_name == "Unknown"); ASSERT(tpage.info.mdb_file_name == 0); diff --git a/decompiler/extractor/main.cpp b/decompiler/extractor/main.cpp new file mode 100644 index 0000000000..473eb17696 --- /dev/null +++ b/decompiler/extractor/main.cpp @@ -0,0 +1,492 @@ +#include +#include +#include + +#include "common/log/log.h" +#include "common/util/FileUtil.h" +#include "common/util/json_util.h" +#include "common/util/read_iso_file.h" + +#include "decompiler/Disasm/OpcodeInfo.h" +#include "decompiler/ObjectFile/ObjectFileDB.h" +#include "decompiler/config.h" +#include "decompiler/level_extractor/extract_level.h" +#include "goalc/compiler/Compiler.h" + +#include "third-party/CLI11.hpp" + +enum class ExtractorErrorCode { + SUCCESS = 0, + VALIDATION_CANT_LOCATE_ELF = 4000, + VALIDATION_SERIAL_MISSING_FROM_DB = 4001, + VALIDATION_ELF_MISSING_FROM_DB = 4002, + VALIDATION_BAD_ISO_CONTENTS = 4010, + VALIDATION_INCORRECT_EXTRACTION_COUNT = 4011, + VALIDATION_BAD_EXTRACTION = 4020, + DECOMPILATION_GENERIC_ERROR = 4030, + EXTRACTION_INVALID_ISO_PATH = 4040, + EXTRACTION_ISO_UNEXPECTED_SIZE = 4041 +}; + +enum GameIsoFlags { FLAG_JAK1_BLACK_LABEL = (1 << 0) }; + +static const std::unordered_map sGameIsoFlagNames = { + {"jak1-black-label", FLAG_JAK1_BLACK_LABEL}}; + +struct ISOMetadata { + std::string canonical_name; + std::string region; + int num_files; + xxh::hash64_t contents_hash; + std::string decomp_config; + GameIsoFlags flags = (GameIsoFlags)0; +}; + +// TODO - when we support jak2 and beyond, add which game it's for as well +// this will let the installer reject (or gracefully handle) jak2 isos on the jak1 page, etc. + +// { SERIAL : { ELF_HASH : ISOMetadataDatabase } } +static const std::map> isoDatabase{ + {"SCUS-97124", + {{7280758013604870207U, + {"Jak & Daxter™: The Precursor Legacy (Black Label)", "NTSC-U", 337, 11363853835861842434U, + "jak1_ntsc_black_label", FLAG_JAK1_BLACK_LABEL}}, + {744661860962747854, + {"Jak & Daxter™: The Precursor Legacy", "NTSC-U", 338, 8538304367812415885U, "jak1_jp"}}}}, + {"SCES-50361", + {{12150718117852276522U, + {"Jak & Daxter™: The Precursor Legacy", "PAL", 338, 16850370297611763875U, "jak1_pal"}}}}, + {"SCPS-15021", + {{16909372048085114219U, + {"ジャックXダクスター ~ 旧世界の遺産", "NTSC-J", 338, 1262350561338887717, + "jak1_jp"}}}}}; + +void setup_global_decompiler_stuff(std::optional project_path_override) { + decompiler::init_opcode_info(); + file_util::setup_project_path(project_path_override); +} + +IsoFile extract_files(std::filesystem::path data_dir_path, + std::filesystem::path extracted_iso_path) { + fmt::print( + "Note: Provided game data path '{}' points to a file, not a directory. Assuming it's an ISO " + "file and attempting to extract!\n", + data_dir_path.string()); + + std::filesystem::create_directories(extracted_iso_path); + + auto fp = fopen(data_dir_path.string().c_str(), "rb"); + ASSERT_MSG(fp, "failed to open input ISO file\n"); + IsoFile iso = unpack_iso_files(fp, extracted_iso_path, true, true); + fclose(fp); + return iso; +} + +std::pair, std::optional> findElfFile( + const std::filesystem::path& extracted_iso_path) { + std::optional serial = std::nullopt; + std::optional elf_hash = std::nullopt; + for (const auto& entry : fs::directory_iterator(extracted_iso_path)) { + auto as_str = entry.path().filename().string(); + if (std::regex_match(as_str, std::regex(".{4}_.{3}\\..{2}"))) { + serial = std::make_optional( + fmt::format("{}-{}", as_str.substr(0, 4), as_str.substr(5, 3) + as_str.substr(9, 2))); + // We already found the path, so hash it while we're here + auto fp = fopen(entry.path().string().c_str(), "rb"); + fseek(fp, 0, SEEK_END); + size_t size = ftell(fp); + std::vector buffer(size); + rewind(fp); + fread(&buffer[0], sizeof(std::vector::value_type), buffer.size(), fp); + elf_hash = std::make_optional(xxh::xxhash<64>(buffer)); + break; + } + } + return {serial, elf_hash}; +} + +std::pair> validate( + const IsoFile& iso_file, + const std::filesystem::path& extracted_iso_path) { + if (!std::filesystem::exists(extracted_iso_path / "DGO")) { + fmt::print(stderr, "ERROR: input folder doesn't have a DGO folder. Is this the right input?\n"); + return {ExtractorErrorCode::VALIDATION_BAD_EXTRACTION, std::nullopt}; + } + + std::optional error_code; + std::optional serial = std::nullopt; + std::optional elf_hash = std::nullopt; + std::tie(serial, elf_hash) = findElfFile(extracted_iso_path); + + // - XOR all hashes together and hash the result. This makes the ordering of the hashes (aka + // files) irrelevant + xxh::hash64_t combined_hash = 0; + for (const auto& hash : iso_file.hashes) { + combined_hash ^= hash; + } + xxh::hash64_t contents_hash = xxh::xxhash<64>({combined_hash}); + + if (!serial || !elf_hash) { + fmt::print(stderr, "ERROR: Unable to locate a Serial/ELF file!\n"); + if (!error_code.has_value()) { + error_code = std::make_optional(ExtractorErrorCode::VALIDATION_CANT_LOCATE_ELF); + } + // No point in continuing here + return {*error_code, std::nullopt}; + } + + // Find the game in our tracking database + std::optional meta_res = std::nullopt; + if (auto dbEntry = isoDatabase.find(serial.value()); dbEntry == isoDatabase.end()) { + fmt::print(stderr, "ERROR: Serial '{}' not found in the validation database\n", serial.value()); + if (!error_code.has_value()) { + error_code = std::make_optional(ExtractorErrorCode::VALIDATION_SERIAL_MISSING_FROM_DB); + } + } else { + auto& metaMap = dbEntry->second; + auto meta_entry = metaMap.find(elf_hash.value()); + if (meta_entry == metaMap.end()) { + fmt::print(stderr, + "ERROR: ELF Hash '{}' not found in the validation database, is this a new or " + "modified version of the same game?\n", + elf_hash.value()); + if (!error_code.has_value()) { + error_code = std::make_optional(ExtractorErrorCode::VALIDATION_ELF_MISSING_FROM_DB); + } + } else { + meta_res = std::make_optional(meta_entry->second); + const auto& meta = *meta_res; + // Print out some information + fmt::print("Detected Game Metadata:\n"); + fmt::print("\tDetected - {}\n", meta.canonical_name); + fmt::print("\tRegion - {}\n", meta.region); + fmt::print("\tSerial - {}\n", dbEntry->first); + fmt::print("\tUses Decompiler Config - {}\n", meta.decomp_config); + + // - Number of Files + if (meta.num_files != iso_file.files_extracted) { + fmt::print(stderr, + "ERROR: Extracted an unexpected number of files. Expected '{}', Actual '{}'\n", + meta.num_files, iso_file.files_extracted); + if (!error_code.has_value()) { + error_code = + std::make_optional(ExtractorErrorCode::VALIDATION_INCORRECT_EXTRACTION_COUNT); + } + } + // Check the ISO Hash + if (meta.contents_hash != contents_hash) { + fmt::print(stderr, + "ERROR: Overall ISO content's hash does not match. Expected '{}', Actual '{}'\n", + meta.contents_hash, contents_hash); + } + } + } + + // Finally, return the result + if (error_code.has_value()) { + // Generate the map entry to make things simple, just convienance + if (error_code.value() == ExtractorErrorCode::VALIDATION_SERIAL_MISSING_FROM_DB) { + fmt::print( + "If this is a new release or version that should be supported, consider adding the " + "following serial entry to the database:\n"); + fmt::print( + "\t'{{\"{}\", {{{{{}U, {{\"GAME_TITLE\", \"NTSC-U/PAL/NTSC-J\", {}, {}U, " + "\"DECOMP_CONFIF_FILENAME_NO_EXTENSION\"}}}}}}}}'\n", + serial.value(), elf_hash.value(), iso_file.files_extracted, contents_hash); + } else if (error_code.value() == ExtractorErrorCode::VALIDATION_ELF_MISSING_FROM_DB) { + fmt::print( + "If this is a new release or version that should be supported, consider adding the " + "following ELF entry to the database under the '{}' serial:\n", + serial.value()); + fmt::print( + "\t'{{{}, {{\"GAME_TITLE\", \"NTSC-U/PAL/NTSC-J\", {}, {}U, " + "\"DECOMP_CONFIF_FILENAME_NO_EXTENSION\"}}}}'\n", + elf_hash.value(), iso_file.files_extracted, contents_hash); + } else { + fmt::print(stderr, + "Validation has failed to match with expected values, see the above errors for " + "specifics. This may be an error in the validation database!\n"); + } + return {*error_code, std::nullopt}; + } + + return {ExtractorErrorCode::SUCCESS, meta_res}; +} + +std::optional determineRelease(const std::filesystem::path& jak1_input_files) { + std::optional serial = std::nullopt; + std::optional elf_hash = std::nullopt; + std::tie(serial, elf_hash) = findElfFile(jak1_input_files); + + if (!serial || !elf_hash) { + return std::nullopt; + } + + // Find the game in our tracking database + auto dbEntry = isoDatabase.find(serial.value()); + if (dbEntry == isoDatabase.end()) { + return std::nullopt; + } else { + auto& metaMap = dbEntry->second; + auto meta_entry = metaMap.find(elf_hash.value()); + if (meta_entry == metaMap.end()) { + return std::nullopt; + } else { + return std::make_optional(meta_entry->second); + } + } +} + +void decompile(std::filesystem::path jak1_input_files) { + using namespace decompiler; + + // Determine which config to use from the database + auto meta = determineRelease(jak1_input_files); + std::string decomp_config = "jak1_ntsc_black_label"; + if (meta.has_value()) { + decomp_config = meta.value().decomp_config; + fmt::print("INFO: Automatically detected decompiler config, using - {}\n", decomp_config); + } + + Config config = read_config_file((file_util::get_jak_project_dir() / "decompiler" / "config" / + fmt::format("{}.jsonc", decomp_config)) + .string(), + {}); + + std::vector dgos, objs; + + // grab all DGOS we need (level + common) + for (const auto& dgo_name : config.dgo_names) { + std::string common_name = "GAME.CGO"; + if (dgo_name.length() > 3 && dgo_name.substr(dgo_name.length() - 3) == "DGO") { + // ends in DGO, it's a level + dgos.push_back((jak1_input_files / dgo_name).string()); + } else if (dgo_name.length() >= common_name.length() && + dgo_name.substr(dgo_name.length() - common_name.length()) == common_name) { + // it's COMMON.CGO, we need that too. + dgos.push_back((jak1_input_files / dgo_name).string()); + } + } + + // grab all the object files we need (just text) + for (const auto& obj_name : config.object_file_names) { + if (obj_name.length() > 3 && obj_name.substr(obj_name.length() - 3) == "TXT") { + // ends in TXT + objs.push_back((jak1_input_files / obj_name).string()); + } + } + + // set up objects + ObjectFileDB db(dgos, config.obj_file_name_map_file, objs, {}, config); + + // save object files + auto out_folder = (file_util::get_jak_project_dir() / "decompiler_out" / "jak1").string(); + auto raw_obj_folder = file_util::combine_path(out_folder, "raw_obj"); + file_util::create_dir_if_needed(raw_obj_folder); + db.dump_raw_objects(raw_obj_folder); + + // analyze object file link data + db.process_link_data(config); + db.find_code(config); + db.process_labels(); + + // ensure asset dir exists + file_util::create_dir_if_needed(file_util::get_file_path({"assets"})); + + // text files + { + auto result = db.process_game_text_files(config); + if (!result.empty()) { + file_util::write_text_file(file_util::get_file_path({"assets", "game_text.txt"}), result); + } + } + + // textures + decompiler::TextureDB tex_db; + file_util::write_text_file(file_util::get_file_path({"assets", "tpage-dir.txt"}), + db.process_tpages(tex_db)); + // texture replacements + auto replacements_path = file_util::get_file_path({"texture_replacements"}); + if (std::filesystem::exists(replacements_path)) { + tex_db.replace_textures(replacements_path); + } + + // game count + { + auto result = db.process_game_count_file(); + if (!result.empty()) { + file_util::write_text_file(file_util::get_file_path({"assets", "game_count.txt"}), result); + } + } + + // levels + { + extract_all_levels(db, tex_db, config.levels_to_extract, "GAME.CGO", config.hacks, + config.rip_levels, config.extract_collision); + } +} + +void compile(std::filesystem::path extracted_iso_path) { + Compiler compiler; + compiler.make_system().set_constant("*iso-data*", absolute(extracted_iso_path).string()); + compiler.make_system().set_constant("*use-iso-data-path*", true); + + auto buildinfo_path = (extracted_iso_path / "buildinfo.json").string(); + auto bi = parse_commented_json(file_util::read_text_file(buildinfo_path), buildinfo_path); + auto all_flags = bi.at("flags").get>(); + int flags = 0; + for (const auto& n : all_flags) { + if (auto it = sGameIsoFlagNames.find(n); it != sGameIsoFlagNames.end()) { + flags |= it->second; + } + } + compiler.make_system().set_constant("*jak1-full-game*", !(flags & FLAG_JAK1_BLACK_LABEL)); + + compiler.make_system().load_project_file( + (file_util::get_jak_project_dir() / "goal_src" / "game.gp").string()); + compiler.run_front_end_on_string("(mi)"); +} + +void launch_game() { + system(fmt::format("\"{}\"", (file_util::get_jak_project_dir() / "../gk").string()).c_str()); +} + +int main(int argc, char** argv) { + std::filesystem::path data_dir_path; + std::filesystem::path project_path_override; + bool flag_runall = false; + bool flag_extract = false; + bool flag_fail_on_validation = false; + bool flag_decompile = false; + bool flag_compile = false; + bool flag_play = false; + bool flag_folder = false; + + lg::initialize(); + + CLI::App app{"OpenGOAL Level Extraction Tool"}; + app.add_option("game-files-path", data_dir_path, + "The path to the folder with the ISO extracted or the ISO itself") + ->check(CLI::ExistingPath) + ->required(); + app.add_option("--proj-path", project_path_override, + "Explicitly set the location of the 'data/' folder") + ->check(CLI::ExistingPath); + app.add_flag("-a,--all", flag_runall, "Run all steps, from extraction to playing the game"); + app.add_flag("-e,--extract", flag_extract, "Extract the ISO"); + app.add_flag("-v,--validate", flag_fail_on_validation, "Fail on Validation Errors"); + app.add_flag("-d,--decompile", flag_decompile, "Decompile the game data"); + app.add_flag("-c,--compile", flag_compile, "Compile the game"); + app.add_flag("-p,--play", flag_play, "Play the game"); + app.add_flag("-f,--folder", flag_folder, "Extract from folder"); + app.validate_positionals(); + CLI11_PARSE(app, argc, argv); + + fmt::print("Working Directory - {}\n", std::filesystem::current_path().string()); + + // If no flag is set, we default to running everything + if (!flag_extract && !flag_decompile && !flag_compile && !flag_play) { + fmt::print("Running all steps, no flags provided!\n"); + flag_runall = true; + } + if (flag_runall) { + flag_extract = true; + flag_decompile = true; + flag_compile = true; + flag_play = true; + } + + // todo: print revision here. + if (!project_path_override.empty()) { + setup_global_decompiler_stuff(std::make_optional(project_path_override)); + } else { + setup_global_decompiler_stuff(std::nullopt); + } + + std::filesystem::path path_to_iso_files = file_util::get_jak_project_dir() / "iso_data" / "_temp"; + + // make sure the input looks right + if (!std::filesystem::exists(data_dir_path)) { + fmt::print("Error: input data path {} does not exist\n", data_dir_path.string()); + return 1; + } + + if (flag_extract) { + if (data_dir_path != path_to_iso_files) { + // in case input is also output, don't just wipe everything (weird) + std::filesystem::remove_all(path_to_iso_files); + } + std::filesystem::create_directories(path_to_iso_files); + + int flags = 0; + if (std::filesystem::is_regular_file(data_dir_path)) { + // it's a file, normalize extension case and verify it's an ISO file + std::string ext = data_dir_path.extension().string(); + std::transform(ext.begin(), ext.end(), ext.begin(), + [](unsigned char c) { return std::tolower(c); }); + + if (ext != ".iso") { + fmt::print(stderr, "ERROR: Provided game data path contains a file that isn't a .ISO!"); + return static_cast(ExtractorErrorCode::EXTRACTION_INVALID_ISO_PATH); + } + + // make sure the .iso is greater than 1GB in size + // to-do: verify game header data as well + if (std::filesystem::file_size(data_dir_path) < 1000000000) { + fmt::print( + stderr, + "ERROR: Provided game data file appears to be too small or corrupted! Size is {}", + std::filesystem::file_size(data_dir_path)); + return static_cast(ExtractorErrorCode::EXTRACTION_ISO_UNEXPECTED_SIZE); + } + auto iso_file = extract_files(data_dir_path, path_to_iso_files); + auto validation_res = validate(iso_file, path_to_iso_files); + flags = validation_res.second->flags; + if (validation_res.first == ExtractorErrorCode::VALIDATION_BAD_EXTRACTION) { + // We fail here regardless of the flag + return static_cast(validation_res.first); + } else if (flag_fail_on_validation && validation_res.first != ExtractorErrorCode::SUCCESS) { + return static_cast(validation_res.first); + } + } else if (std::filesystem::is_directory(data_dir_path)) { + if (!flag_folder) { + // if we didn't request a folder explicitly, but we got one, assume something went wrong. + fmt::print("Error: got a folder, but didn't get folder flag\n"); + return static_cast(ExtractorErrorCode::VALIDATION_BAD_ISO_CONTENTS); + } + path_to_iso_files = data_dir_path; + } + + // write out a json file with some metadata for the game + nlohmann::json buildinfo_json; + auto flags_json = nlohmann::json::array(); + for (const auto& [n, f] : sGameIsoFlagNames) { + if (flags & f) { + flags_json.push_back(n); + } + } + buildinfo_json["flags"] = flags_json; + // something tells me a ps2 game is unlikely to have a json file in root + file_util::write_text_file((path_to_iso_files / "buildinfo.json").string(), + buildinfo_json.dump(2)); + } + + if (flag_decompile) { + try { + decompile(path_to_iso_files); + } catch (std::exception& e) { + lg::error("Error during decompile: {}", e.what()); + return static_cast(ExtractorErrorCode::DECOMPILATION_GENERIC_ERROR); + } + } + + if (flag_compile) { + compile(path_to_iso_files); + } + + if (flag_play) { + launch_game(); + } + + return 0; +} diff --git a/decompiler/level_extractor/BspHeader.cpp b/decompiler/level_extractor/BspHeader.cpp index 9b9c75b4a0..a3159e855b 100644 --- a/decompiler/level_extractor/BspHeader.cpp +++ b/decompiler/level_extractor/BspHeader.cpp @@ -1,10 +1,11 @@ #include "BspHeader.h" +#include "common/dma/dma.h" + #include "decompiler/ObjectFile/LinkedObjectFile.h" #include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/util/goal_data_reader.h" #include "decompiler/util/Error.h" -#include "common/dma/dma.h" +#include "decompiler/util/goal_data_reader.h" namespace level_tools { @@ -59,6 +60,14 @@ std::string Vector::print_meters(int indent) const { return result; } +std::string Vector::print_decimal(int indent) const { + s32 d[4]; + memcpy(d, data, 16); + std::string is(indent, ' '); + std::string result; + result += fmt::format("{}\n", is, d[0], d[1], d[2], d[3]); + return result; +} void FileInfo::read_from_file(TypedRef ref, const decompiler::DecompilerTypeSystem& dts) { file_type = read_type_field(ref, "file-type", dts, true); file_name = read_string_field(ref, "file-name", dts, true); @@ -198,17 +207,6 @@ std::string TFragmentDebugData::print(int indent) const { return result; } -u32 deref_u32(const Ref& ref, int word_offset) { - if ((ref.byte_offset % 4) != 0) { - throw Error("deref_u32 bad alignment"); - } - const auto& word = ref.data->words_by_seg.at(ref.seg).at(word_offset + (ref.byte_offset / 4)); - if (word.kind() != decompiler::LinkedWord::PLAIN_DATA) { - throw Error("deref_u32 bad kind: {}", (int)word.kind()); - } - return word.data; -} - void tfrag_debug_print_unpack(Ref start, int qwc_total) { int word_offset = 0; @@ -298,8 +296,7 @@ void tfrag_debug_print_unpack(Ref start, int qwc_total) { case VifCode::Kind::NOP: break; default: - fmt::print("unknown: {}\n", next.print()); - ASSERT(false); + ASSERT_MSG(false, fmt::format("unknown: {}", next.print())); } } fmt::print("-------------------------------------------\n"); @@ -888,6 +885,15 @@ void PrototypeBucketTie::read_from_file(TypedRef ref, dists.read_from_file(get_field_ref(ref, "dists", dts)); rdists.read_from_file(get_field_ref(ref, "rdists", dts)); stiffness = read_plain_data_field(ref, "stiffness", dts); + auto fr = get_field_ref(ref, "collide-frag", dts); + { + const auto& word = fr.data->words_by_seg.at(fr.seg).at(fr.byte_offset / 4); + if (word.kind() == decompiler::LinkedWord::PTR) { + auto p = deref_label(fr); + p.byte_offset -= 4; + collide_frag.read_from_file(typed_ref_from_basic(p, dts), dts, stats); + } + } auto next_slot = get_field_ref(ref, "next", dts); for (int i = 0; i < 4; i++) { @@ -1118,6 +1124,120 @@ std::string DrawableTreeInstanceTie::my_type() const { return "drawable-tree-instance-tie"; } +void DrawableTreeCollideFragment::read_from_file(TypedRef ref, + const decompiler::DecompilerTypeSystem& dts, + DrawStats* stats) { + s16 length = read_plain_data_field(ref, "length", dts); + auto data_ref = get_field_ref(ref, "data", dts); + if ((data_ref.byte_offset % 4) != 0) { + throw Error("misaligned data array"); + } + + Ref array_slot_ref = data_ref; + array_slot_ref.byte_offset += (length - 1) * 4; + + Ref object_ref = deref_label(array_slot_ref); + object_ref.byte_offset -= 4; + last_array.read_from_file(typed_ref_from_basic(object_ref, dts), dts, stats); +} + +std::string DrawableTreeCollideFragment::print(const PrintSettings& settings, int indent) const { + return last_array.print(settings, indent); +} + +std::string DrawableTreeCollideFragment::my_type() const { + return "drawable-tree-collide-fragment"; +} + +void DrawableInlineArrayCollideFragment::read_from_file(TypedRef ref, + const decompiler::DecompilerTypeSystem& dts, + DrawStats* stats) { + ASSERT(ref.type->get_name() == "drawable-inline-array-collide-fragment"); + id = read_plain_data_field(ref, "id", dts); + length = read_plain_data_field(ref, "length", dts); + bsphere.read_from_file(get_field_ref(ref, "bsphere", dts)); + + auto data_ref = get_field_ref(ref, "data", dts); + for (int i = 0; i < length; i++) { + Ref obj_ref = data_ref; + obj_ref.byte_offset += 32 * i; // todo not a constant here + auto type = get_type_of_basic(obj_ref); + if (type != "collide-fragment") { + throw Error("bad collide fragment type: {}", type); + } + collide_fragments.emplace_back(); + collide_fragments.back().read_from_file(typed_ref_from_basic(obj_ref, dts), dts, stats); + } +} + +std::string DrawableInlineArrayCollideFragment::print(const PrintSettings& settings, + int indent) const { + std::string is(indent, ' '); + std::string result; + int next_indent = indent + 4; + result += fmt::format("{}id: {}\n", is, id); + result += fmt::format("{}length: {}\n", is, length); + result += fmt::format("{}bsphere: {}", is, bsphere.print_meters()); + + if (settings.expand_collide) { + for (u32 i = 0; i < collide_fragments.size(); i++) { + result += fmt::format("{}data [{}]:\n", is, i); + result += collide_fragments[i].print(settings, next_indent); + } + } + return result; +} + +std::string DrawableInlineArrayCollideFragment::my_type() const { + return "drawable-inline-array-collide-fragment"; +} + +void CollideFragment::read_from_file(TypedRef ref, + const decompiler::DecompilerTypeSystem& dts, + DrawStats* stats) { + bsphere.read_from_file(get_field_ref(ref, "bsphere", dts)); + auto r = deref_label(get_field_ref(ref, "mesh", dts)); + r.byte_offset -= 4; + mesh.read_from_file(typed_ref_from_basic(r, dts), dts, stats); +} + +std::string CollideFragment::print(const PrintSettings& settings, int indent) const { + std::string is(indent, ' '); + std::string result; + result += fmt::format("{}bsphere: {}", is, bsphere.print_meters()); + result += mesh.print(settings, indent); + + return result; +} + +void CollideFragMesh::read_from_file(TypedRef ref, + const decompiler::DecompilerTypeSystem& dts, + DrawStats* /*stats*/) { + strip_data_len = read_plain_data_field(ref, "strip-data-len", dts); + poly_count = read_plain_data_field(ref, "poly-count", dts); + vertex_count = read_plain_data_field(ref, "vertex-count", dts); + vertex_data_qwc = read_plain_data_field(ref, "vertex-data-qwc", dts); + total_qwc = read_plain_data_field(ref, "total-qwc", dts); + base_trans.read_from_file(get_field_ref(ref, "base-trans", dts)); + base_trans.data[3] = 0; + + packed_data = deref_label(get_field_ref(ref, "packed-data", dts)); + pat_array = deref_label(get_field_ref(ref, "pat-array", dts)); +} + +std::string CollideFragMesh::print(const PrintSettings& /*settings*/, int indent) const { + std::string is(indent, ' '); + std::string result; + result += fmt::format("{}strip-data-len: {}\n", is, strip_data_len); + result += fmt::format("{}poly-count: {}\n", is, poly_count); + result += fmt::format("{}vertex-count: {}\n", is, vertex_count); + result += fmt::format("{}vertex-data-qwc: {}\n", is, vertex_data_qwc); + result += fmt::format("{}total-qwc: {}\n", is, total_qwc); + result += fmt::format("{}base-trans: {}", is, base_trans.print_decimal()); + + return result; +} + ////////////////////////// // shrub ////////////////////////// @@ -1585,6 +1705,13 @@ std::unique_ptr make_drawable_tree(TypedRef ref, tree->read_from_file(ref, dts, stats); return tree; } + + if (ref.type->get_name() == "drawable-tree-collide-fragment") { + auto tree = std::make_unique(); + tree->read_from_file(ref, dts, stats); + return tree; + } + auto tree = std::make_unique(); tree->read_from_file(ref, dts, stats); return tree; @@ -1677,4 +1804,4 @@ std::string BspHeader::print(const PrintSettings& settings) const { result += drawable_tree_array.print(settings, next_indent); return result; } -} // namespace level_tools \ No newline at end of file +} // namespace level_tools diff --git a/decompiler/level_extractor/BspHeader.h b/decompiler/level_extractor/BspHeader.h index 1aae78f489..843aa57bb7 100644 --- a/decompiler/level_extractor/BspHeader.h +++ b/decompiler/level_extractor/BspHeader.h @@ -1,11 +1,13 @@ #pragma once -#include "common/common_types.h" -#include #include -#include #include +#include +#include +#include "common/common_types.h" + +#include "decompiler/level_extractor/common_formats.h" #include "decompiler/util/goal_data_reader.h" namespace decompiler { @@ -14,6 +16,7 @@ class DecompilerTypeSystem; } // namespace decompiler namespace level_tools { + struct PrintSettings { bool print_tfrag = false; bool expand_draw_node = false; @@ -23,7 +26,8 @@ struct PrintSettings { bool expand_drawable_tree_tie_proto_data = false; bool expand_drawable_tree_instance_tie = false; bool expand_drawable_tree_actor = false; - bool expand_shrub = true; + bool expand_shrub = false; + bool expand_collide = false; }; struct DrawStats { @@ -50,6 +54,7 @@ struct Vector { std::string print(int indent = 0) const; std::string print_meters(int indent = 0) const; + std::string print_decimal(int indent = 0) const; }; // a matrix with 16-bit integers. @@ -181,6 +186,68 @@ struct DrawableTreeActor : public DrawableTree { std::vector> arrays; }; +///////////////////// +// Collision +///////////////////// + +struct CollideFragMesh { + /* + ((packed-data uint32 :offset-assert 4) + (pat-array uint32 :offset-assert 8) + (strip-data-len uint16 :offset-assert 12) + (poly-count uint16 :offset-assert 14) + (base-trans vector :inline :offset-assert 16) + ;; these go in the w of the vector above. + (vertex-count uint8 :offset 28) + (vertex-data-qwc uint8 :offset 29) + (total-qwc uint8 :offset 30) + (unused uint8 :offset 31) + ) + */ + void read_from_file(TypedRef ref, const decompiler::DecompilerTypeSystem& dts, DrawStats* stats); + std::string print(const PrintSettings& settings, int indent) const; + + u16 strip_data_len; + u16 poly_count; + // appears to be integers... + Vector base_trans; + u8 vertex_count; + u8 vertex_data_qwc; + u8 total_qwc; + + Ref packed_data; + Ref pat_array; +}; + +struct CollideFragment { + void read_from_file(TypedRef ref, const decompiler::DecompilerTypeSystem& dts, DrawStats* stats); + std::string print(const PrintSettings& settings, int indent) const; + Vector bsphere; + CollideFragMesh mesh; +}; + +struct DrawableInlineArrayCollideFragment : public DrawableInlineArray { + void read_from_file(TypedRef ref, + const decompiler::DecompilerTypeSystem& dts, + DrawStats* stats) override; + std::string print(const PrintSettings& settings, int indent) const override; + std::string my_type() const override; + std::vector collide_fragments; + s16 id; + s16 length; + Vector bsphere; +}; + +struct DrawableTreeCollideFragment : public DrawableTree { + void read_from_file(TypedRef ref, + const decompiler::DecompilerTypeSystem& dts, + DrawStats* stats) override; + std::string print(const PrintSettings& settings, int indent) const override; + std::string my_type() const override; + + DrawableInlineArrayCollideFragment last_array; +}; + ///////////////////// // TFRAG ///////////////////// @@ -382,6 +449,7 @@ struct PrototypeBucketTie { // todo envmap shader // todo collide-frag + DrawableInlineArrayCollideFragment collide_frag; // todo tie-colors // todo data @@ -658,12 +726,6 @@ struct DrawableTreeArray { std::vector> trees; }; -// levels may remap textures if they provide one that should be shared -struct TextureRemap { - u32 original_texid; - u32 new_texid; -}; - // The "file info" struct FileInfo { std::string file_type; diff --git a/decompiler/level_extractor/MercData.cpp b/decompiler/level_extractor/MercData.cpp new file mode 100644 index 0000000000..3da09034ea --- /dev/null +++ b/decompiler/level_extractor/MercData.cpp @@ -0,0 +1,406 @@ +#include "MercData.h" + +#include "common/dma/gs.h" + +#include "decompiler/util/DecompilerTypeSystem.h" + +#include "third-party/fmt/core.h" + +namespace decompiler { +void MercCtrlHeader::from_ref(TypedRef tr, const DecompilerTypeSystem& dts) { + st_magic = read_plain_data_field(tr, "st-magic", dts); + xyz_scale = read_plain_data_field(tr, "xyz-scale", dts); + st_out_a = read_plain_data_field(tr, "st-out-a", dts); + st_out_b = read_plain_data_field(tr, "st-out-b", dts); + st_vif_add = read_plain_data_field(tr, "st-vif-add", dts); + st_int_off = read_plain_data_field(tr, "st-int-off", dts); + st_int_scale = read_plain_data_field(tr, "st-int-scale", dts); + effect_count = read_plain_data_field(tr, "effect-count", dts); + blend_target_count = read_plain_data_field(tr, "blend-target-count", dts); + fragment_count = read_plain_data_field(tr, "fragment-count", dts); + tri_count = read_plain_data_field(tr, "tri-count", dts); + matrix_count = read_plain_data_field(tr, "matrix-count", dts); + shader_count = read_plain_data_field(tr, "shader-count", dts); + transform_vertex_count = read_plain_data_field(tr, "transform-vertex-count", dts); + dvert_count = read_plain_data_field(tr, "dvert-count", dts); + one_mat_count = read_plain_data_field(tr, "one-mat-count", dts); + two_mat_count = read_plain_data_field(tr, "two-mat-count", dts); + two_mat_reuse_count = read_plain_data_field(tr, "two-mat-reuse-count", dts); + three_mat_count = read_plain_data_field(tr, "three-mat-count", dts); + three_mat_reuse_count = read_plain_data_field(tr, "three-mat-reuse-count", dts); + shader_upload_count = read_plain_data_field(tr, "shader-upload-count", dts); + matrix_upload_count = read_plain_data_field(tr, "matrix-upload-count", dts); + same_copy_count = read_plain_data_field(tr, "same-copy-count", dts); + cross_copy_count = read_plain_data_field(tr, "cross-copy-count", dts); + num_verts = read_plain_data_field(tr, "num-verts", dts); + longest_edge = read_plain_data_field(tr, "longest-edge", dts); + // todo masksk + envmap_tint = read_plain_data_field(tr, "envmap-tint", dts); + needs_clip = read_plain_data_field(tr, "needs-clip", dts); + use_isometric = read_plain_data_field(tr, "use-isometric", dts); + use_attached_shader = read_plain_data_field(tr, "use-attached-shader", dts); + display_triangles = read_plain_data_field(tr, "display-triangles", dts); + death_vertex_skip = read_plain_data_field(tr, "death-vertex-skip", dts); + death_start_vertex = read_plain_data_field(tr, "death-start-vertex", dts); + death_effect = read_plain_data_field(tr, "death-effect", dts); + use_translucent = read_plain_data_field(tr, "use-translucent", dts); + display_this_fragment = read_plain_data_field(tr, "display-this-fragment", dts); +} + +std::string MercCtrlHeader::print() const { + std::string result; + result += fmt::format(" xyz_scale: {}\n", xyz_scale); + result += fmt::format(" st_out_a: 0x{:x}\n", st_out_a); + result += fmt::format(" st_out_b: 0x{:x}\n", st_out_b); + result += fmt::format(" st_vif_add: 0x{:x}\n", st_vif_add); + result += fmt::format(" st_int_off: 0x{:x}\n", st_int_off); + result += fmt::format(" st_int_scale: {}\n", st_int_scale); + result += fmt::format(" effect_count: {}\n", effect_count); + result += fmt::format(" blend_target_count: {}\n", blend_target_count); + result += fmt::format(" fragment_count: {}\n", fragment_count); + result += fmt::format(" tri_count: {}\n", tri_count); + result += fmt::format(" matrix_count: {}\n", matrix_count); + result += fmt::format(" shader_count: {}\n", shader_count); + result += fmt::format(" transform_vertex_count: {}\n", transform_vertex_count); + result += fmt::format(" dvert_count: {}\n", dvert_count); + result += fmt::format(" one_mat_count: {}\n", one_mat_count); + result += fmt::format(" two_mat_count: {}\n", two_mat_count); + result += fmt::format(" two_mat_reuse_count: {}\n", two_mat_reuse_count); + result += fmt::format(" three_mat_count: {}\n", three_mat_count); + result += fmt::format(" three_mat_reuse_count: {}\n", three_mat_reuse_count); + result += fmt::format(" shader_upload_count: {}\n", shader_upload_count); + result += fmt::format(" matrix_upload_count: {}\n", matrix_upload_count); + result += fmt::format(" same_copy_count: {}\n", same_copy_count); + result += fmt::format(" cross_copy_count: {}\n", cross_copy_count); + result += fmt::format(" num_verts: {}\n", num_verts); + result += fmt::format(" longest_edge: {}\n", longest_edge); + result += fmt::format(" envmap_tint: {}\n", envmap_tint); + result += fmt::format(" needs_clip: {}\n", needs_clip); + result += fmt::format(" use_isometric: {}\n", use_isometric); + result += fmt::format(" use_attached_shader: {}\n", use_attached_shader); + result += fmt::format(" display_triangles: {}\n", display_triangles); + result += fmt::format(" death_vertex_skip: {}\n", death_vertex_skip); + result += fmt::format(" death_start_vertex: {}\n", death_start_vertex); + result += fmt::format(" death_effect: {}\n", death_effect); + result += fmt::format(" use_translucent: {}\n", use_translucent); + result += fmt::format(" display_this_fragment: {}\n", display_this_fragment); + return result; +} + +TypedRef MercFragmentControl::from_ref(TypedRef tr, const DecompilerTypeSystem& dts) { + unsigned_four_count = read_plain_data_field(tr, "unsigned-four-count", dts); + lump_four_count = read_plain_data_field(tr, "lump-four-count", dts); + fp_qwc = read_plain_data_field(tr, "fp-qwc", dts); + mat_xfer_count = read_plain_data_field(tr, "mat-xfer-count", dts); + ASSERT(mat_xfer_count < 10); + Ref dest_data_ref = get_field_ref(tr, "mat-dest-data", dts); + for (u8 i = 0; i < mat_xfer_count; i++) { + auto& entry = mat_dest_data.emplace_back(); + entry.matrix_number = deref_u8(dest_data_ref, i * 2); + entry.matrix_dest = deref_u8(dest_data_ref, i * 2 + 1); + } + + tr.ref.byte_offset += (4 + 2 * mat_dest_data.size()); + return tr; +} + +void MercFpHeader::from_ref(TypedRef tr, const DecompilerTypeSystem& dts) { + x_add = read_plain_data_field(tr, "x-add", dts); + y_add = read_plain_data_field(tr, "y-add", dts); + z_add = read_plain_data_field(tr, "z-add", dts); + + shader_cnt = read_plain_data_field(tr, "shader-cnt", dts); + kick_info_offset = read_plain_data_field(tr, "kick-info-offset", dts); + kick_info_step = read_plain_data_field(tr, "kick-info-step", dts); + hword_cnt = read_plain_data_field(tr, "hword-cnt", dts); +} + +std::string MercFpHeader::print() const { + std::string result; + result += fmt::format(" x_add: {}\n", x_add); + result += fmt::format(" y_add: {}\n", y_add); + result += fmt::format(" z_add: {}\n", z_add); + result += fmt::format(" shader_cnt: {}\n", shader_cnt); + result += fmt::format(" kick_info_offset: {}\n", kick_info_offset); + result += fmt::format(" kick_info_step: {}\n", kick_info_step); + result += fmt::format(" hword_cnt: {}\n", hword_cnt); + return result; +} + +void MercByteHeader::from_ref(TypedRef tr, const DecompilerTypeSystem& dts) { + srcdest_off = read_plain_data_field(tr, "srcdest-off", dts); + rgba_off = read_plain_data_field(tr, "rgba-off", dts); + lump_off = read_plain_data_field(tr, "lump-off", dts); + fp_off = read_plain_data_field(tr, "fp-off", dts); + mat1_cnt = read_plain_data_field(tr, "mat1-cnt", dts); + mat2_cnt = read_plain_data_field(tr, "mat2-cnt", dts); + mat3_cnt = read_plain_data_field(tr, "mat3-cnt", dts); + samecopy_cnt = read_plain_data_field(tr, "samecopy-cnt", dts); + crosscopy_cnt = read_plain_data_field(tr, "crosscopy-cnt", dts); + strip_len = read_plain_data_field(tr, "strip-len", dts); + mm_quadword_fp_off = read_plain_data_field(tr, "mm-quadword-fp-off", dts); + mm_quadword_size = read_plain_data_field(tr, "mm-quadword-size", dts); + perc_off = read_plain_data_field(tr, "perc-off", dts); + + auto ms = get_field_ref(tr, "perc-off", dts); + bool got_end = false; + for (int i = 0; i < MAT_SLOTS; i++) { + ms.byte_offset++; + mat_slot[i] = deref_u8(ms, 0); + if (mat_slot[i] == 128) { + got_end = true; + } else { + // ASSERT(!got_end); + if (got_end) { + // fmt::print("got something after the end\n"); // todo, should investigate more + } + } + } +} + +std::string MercByteHeader::print() const { + std::string result; + result += fmt::format(" srcdest_off: {}\n", srcdest_off); + result += fmt::format(" rgba_off: {}\n", rgba_off); + result += fmt::format(" lump_off: {}\n", lump_off); + result += fmt::format(" fp_off: {}\n", fp_off); + result += fmt::format(" mat1_cnt: {}\n", mat1_cnt); + result += fmt::format(" mat2_cnt: {}\n", mat2_cnt); + result += fmt::format(" mat3_cnt: {}\n", mat3_cnt); + result += fmt::format(" samecopy_cnt: {}\n", samecopy_cnt); + result += fmt::format(" crosscopy_cnt: {}\n", crosscopy_cnt); + result += fmt::format(" strip_len: {}\n", strip_len); + result += fmt::format(" mm_quadword_fp_off: {}\n", mm_quadword_fp_off); + result += fmt::format(" mm_quadword_size: {}\n", mm_quadword_size); + result += fmt::format(" perc_off: {}\n", perc_off); + for (int i = 0; i < MAT_SLOTS; i++) { + result += fmt::format(" mat_slot[{}]: {}\n", i, mat_slot[i]); + } + return result; +} + +std::string MercFragmentControl::print() const { + std::string result; + result += fmt::format(" unsigned_four_count: {}\n", unsigned_four_count); + result += fmt::format(" lump_four_count: {}\n", lump_four_count); + result += fmt::format(" fp_qwc: {}\n", fp_qwc); + result += fmt::format(" mat_xfer_count: {}\n", mat_xfer_count); + for (u8 i = 0; i < mat_xfer_count; i++) { + result += fmt::format(" mat[{}] {} -> {}\n", i, mat_dest_data[i].matrix_number, + mat_dest_data[i].matrix_dest); + } + return result; +} + +std::string MercShader::print() const { + std::string result; + result += fmt::format(" output_offset: {}\n", output_offset); + result += fmt::format(" strip_tag: 0x{:x}\n", next_strip_nloop); + return result; +} + +TypedRef MercFragment::from_ref(TypedRef tr, + const DecompilerTypeSystem& dts, + const MercFragmentControl& control, + const MercCtrlHeader& main_control) { + // fmt::print("frag::from_ref:\n{}\n", control.print()); + TypedRef byte_hdr(get_field_ref(tr, "header", dts), dts.ts.lookup_type("merc-byte-header")); + header.from_ref(byte_hdr, dts); + // fmt::print("{}\n", header.print()); + + // all these offsets are super confusing. + // the DMA transfers require source and dest addresses/sized to have alignment of 16 bytes. + // so the data is padded. + // the transfers increase size by 4x due to VIF unpacking + // But transferring this padding exactly would result in up to 63 bytes of wasted space. + // so they cheat the destination pointers to be slightly overlapping so the next transfer + // overlaps the padding of the previous. + // as a result, the "in VU" offsets are different from "in main memory" + + // let's figure it out from bones.gc asm + // u4 + // lbu s0, 0(gp) (fragment.control.unsigned-four-count) + // daddiu v0, s0, 3 + // srl v0, v0, 2 + // dsll32 s0, v0, 4 + // daddu t3, t2, s0 + u32 my_u4_count = ((control.unsigned_four_count + 3) / 4) * 16; + // fmt::print("my u4: {} ({} qwc)\n", my_u4_count, my_u4_count / 16); + for (u32 w = 0; w < my_u4_count / 4; w++) { + u32 val = deref_u32(tr.ref, w); + memcpy(unsigned_four_including_header.emplace_back().data(), &val, 4); + } + + // l4 + // lbu s2, 1(gp) + // daddiu s0, s2, 3 + // srl s0, s0, 2 + // dsll32 s2, s0, 4 + u32 my_l4_count = my_u4_count + ((control.lump_four_count + 3) / 4) * 16; + // fmt::print("my l4: {} ({} qwc)\n", my_l4_count, my_l4_count / 16); + // end of lump should align with mm (main memory?) fp off. which + // is used for accessing the fp data in main memory. + ASSERT(my_l4_count / 16 == header.mm_quadword_fp_off); + + // row.x/y is st-vif-add from the merc-ctrl-header. + // row.z = 0x47800000, row.w = 0x4b010000 + math::Vector row(main_control.st_vif_add, main_control.st_vif_add, 0x47800000, + 0x4b010000); + for (u32 w = my_u4_count / 4; w < my_l4_count / 4; w++) { + ASSERT((w * 4) < header.mm_quadword_fp_off * 16); + u32 val = deref_u32(tr.ref, w); + + math::Vector as_u8s; + memcpy(as_u8s.data(), &val, 4); + math::Vector as_u32s = as_u8s.cast(); + as_u32s += row; + memcpy(lump4_unpacked.emplace_back().data(), as_u32s.data(), 16); + } + + // fp header + Ref fp_ref = tr.ref; + fp_ref.byte_offset += 16 * header.mm_quadword_fp_off; + fp_header.from_ref(TypedRef(fp_ref, dts.ts.lookup_type("merc-fp-header")), dts); + fp_ref.byte_offset += 16; + + // fp shaders + for (int i = 0; i < fp_header.shader_cnt; i++) { + auto& shader = shaders.emplace_back(); + // adgif0 + u8 adgif0_addr = deref_u8(fp_ref, 8); + ASSERT(adgif0_addr == (u8)GsRegisterAddress::TEX0_1); + shader.output_offset = deref_u32(fp_ref, 3); + shader.tex0 = GsTex0(deref_u64(fp_ref, 0)); + fp_ref.byte_offset += 16; + + // adgif1 + u8 adgif1_addr = deref_u8(fp_ref, 8); + ASSERT(adgif1_addr == (u8)GsRegisterAddress::TEX1_1); + shader.tex1 = GsTex1(deref_u64(fp_ref, 0)); + u16 stash = deref_u32(fp_ref, 3); + shader.original_tex = deref_u32(fp_ref, 2); + shader.next_strip_nloop = stash & 0x7fff; + ASSERT((!!(stash & 0x8000)) == (i == fp_header.shader_cnt - 1)); // set eop on last + fp_ref.byte_offset += 16; + + // adgif2 + u8 adgif2_addr = deref_u8(fp_ref, 8); + ASSERT(adgif2_addr == (u8)GsRegisterAddress::MIPTBP1_1); + fp_ref.byte_offset += 16; + + // adgif3 + u8 adgif3_addr = deref_u8(fp_ref, 8); + ASSERT(adgif3_addr == (u8)GsRegisterAddress::CLAMP_1); + shader.clamp = deref_u64(fp_ref, 0); + fp_ref.byte_offset += 16; + + // adgif4 + u8 adgif4_addr = deref_u8(fp_ref, 8); + ASSERT(adgif4_addr == (u8)GsRegisterAddress::ALPHA_1); + shader.alpha = GsAlpha(deref_u64(fp_ref, 0)); + fp_ref.byte_offset += 16; + } + + tr.ref.byte_offset += (header.mm_quadword_size) * 16; + + // let's verify the matrix slots here. + int used_matrix_slots = 0; + for (auto x : header.mat_slot) { + if (x) { + used_matrix_slots++; + } else { + break; + } + } + ASSERT(used_matrix_slots == control.mat_xfer_count); + for (int i = 0; i < used_matrix_slots; i++) { + ASSERT(header.mat_slot[i] == control.mat_dest_data.at(i).matrix_dest); + } + + return tr; +} + +std::string MercFragment::print() const { + std::string result; + result += fmt::format(" + BYTE-HEADER\n"); + result += header.print(); + result += fmt::format(" + FP-HEADER\n"); + result += fp_header.print(); + for (const auto& shader : shaders) { + result += fmt::format(" + SHADER\n"); + result += shader.print(); + } + return result; +} + +void MercEffect::from_ref(TypedRef tr, + const DecompilerTypeSystem& dts, + const MercCtrlHeader& main_control) { + effect_bits = read_plain_data_field(tr, "effect-bits", dts); + frag_count = read_plain_data_field(tr, "frag-count", dts); + blend_frag_count = read_plain_data_field(tr, "blend-frag-count", dts); + tri_count = read_plain_data_field(tr, "tri-count", dts); + dvert_count = read_plain_data_field(tr, "dvert-count", dts); + envmap_usage = read_plain_data_field(tr, "envmap-usage", dts); + + // do frag-ctrls + TypedRef fc(deref_label(get_field_ref(tr, "frag-ctrl", dts)), + dts.ts.lookup_type("merc-fragment-control")); + for (u32 i = 0; i < frag_count; i++) { + fc = frag_ctrl.emplace_back().from_ref(fc, dts); + } + + // do actual frags + TypedRef f(deref_label(get_field_ref(tr, "frag-geo", dts)), dts.ts.lookup_type("merc-fragment")); + for (u32 i = 0; i < frag_count; i++) { + f = frag_geo.emplace_back().from_ref(f, dts, frag_ctrl.at(i), main_control); + } +} + +std::string MercEffect::print() { + std::string result; + result += fmt::format(" effect_bits: {}\n", effect_bits); + result += fmt::format(" frag_count: {}\n", frag_count); + result += fmt::format(" blend_frag_count: {}\n", blend_frag_count); + result += fmt::format(" tri_count: {}\n", tri_count); + result += fmt::format(" dvert_count: {}\n", dvert_count); + result += fmt::format(" envmap_usage: {}\n", envmap_usage); + + for (u32 i = 0; i < frag_count; i++) { + result += fmt::format(" +FRAGMENT {}\n", i); + result += fmt::format(" + CTRL\n"); + result += frag_ctrl[i].print(); + result += fmt::format(" + GEO\n"); + result += frag_geo[i].print(); + } + return result; +} + +void MercCtrl::from_ref(TypedRef tr, const DecompilerTypeSystem& dts) { + name = read_string_field(tr, "name", dts, false); + num_joints = read_plain_data_field(tr, "num-joints", dts); + auto merc_ctrl_header_ref = + TypedRef(get_field_ref(tr, "header", dts), dts.ts.lookup_type("merc-ctrl-header")); + header.from_ref(merc_ctrl_header_ref, dts); + + auto eff_ref = TypedRef(get_field_ref(tr, "effect", dts), dts.ts.lookup_type("merc-effect")); + for (u32 i = 0; i < header.effect_count; i++) { + effects.emplace_back().from_ref(eff_ref, dts, header); + eff_ref.ref.byte_offset += 32; // + } +} + +std::string MercCtrl::print() { + std::string result; + result += fmt::format("name: {}\n", name); + result += fmt::format("num_joints: {}\n", num_joints); + result += "+ HEADER\n"; + result += header.print(); + result += "\n"; + for (auto& eff : effects) { + result += fmt::format("+ EFFECT\n{}\n", eff.print()); + } + return result; +} + +} // namespace decompiler \ No newline at end of file diff --git a/decompiler/level_extractor/MercData.h b/decompiler/level_extractor/MercData.h new file mode 100644 index 0000000000..0155ed6399 --- /dev/null +++ b/decompiler/level_extractor/MercData.h @@ -0,0 +1,194 @@ +#pragma once + +#include +#include + +#include "common/common_types.h" +#include "common/dma/gs.h" +#include "common/math/Vector.h" + +#include "decompiler/util/goal_data_reader.h" + +namespace decompiler { + +/*! + * per-ctrl information. the first qw is uploaded to vu1 + */ +struct MercCtrlHeader { + float xyz_scale; + u32 st_magic; + u32 st_out_a; + u32 st_out_b; + u32 st_vif_add; + u16 st_int_off; + u16 st_int_scale; + u32 effect_count; + u32 blend_target_count; + u16 fragment_count; + u16 tri_count; + u8 matrix_count; + u8 shader_count; + u16 transform_vertex_count; + u16 dvert_count; + u16 one_mat_count; + u16 two_mat_count; + u16 two_mat_reuse_count; + u16 three_mat_count; + u16 three_mat_reuse_count; + u8 shader_upload_count; + u8 matrix_upload_count; + u16 same_copy_count; + u16 cross_copy_count; + u16 num_verts; + float longest_edge; + // todo (eye-ctrl merc-eye-ctrl :offset-assert 64) + u32 masks[3]; + // (dummy-bytes uint8 48 :offset 32) + u32 envmap_tint; + // todo (query basic :offset 36) + u8 needs_clip; + u8 use_isometric; + u8 use_attached_shader; + u8 display_triangles; + u16 death_vertex_skip; + u16 death_start_vertex; + u32 death_effect; + u8 use_translucent; + u8 display_this_fragment; + + void from_ref(TypedRef tr, const DecompilerTypeSystem& dts); + std::string print() const; +}; + +/*! + * the unsigned4 data of a fragment starts with this. + */ +struct MercByteHeader { + u8 srcdest_off; + u8 rgba_off; + u8 lump_off; + u8 fp_off; + u8 mat1_cnt; + u8 mat2_cnt; + u8 mat3_cnt; + u8 samecopy_cnt; + u8 crosscopy_cnt; + u8 strip_len; + u8 mm_quadword_fp_off; + u8 mm_quadword_size; + u8 perc_off; + static constexpr int MAT_SLOTS = 10; + u8 mat_slot[MAT_SLOTS]; + void from_ref(TypedRef tr, const DecompilerTypeSystem& dts); + std::string print() const; +}; +static_assert(sizeof(MercByteHeader) == 0x17); + +/*! + * the fp data of a fragment starts with this. + */ +struct MercFpHeader { + float x_add; + float y_add; + float z_add; + u8 shader_cnt; + u8 kick_info_offset; + u8 kick_info_step; + u8 hword_cnt; + void from_ref(TypedRef tr, const DecompilerTypeSystem& dts); + std::string print() const; +}; + +struct MercShader { + GsTex0 tex0; + GsTex1 tex1; + // skip mip + u64 clamp; + GsAlpha alpha; + u16 output_offset; + u16 next_strip_nloop; + u32 original_tex; + std::string print() const; +}; + +/*! + * info about a matrix to upload. + * it maps a per-model matrix (matrix_number) to a slot in vu1 memory (matrix_dest) + */ +struct MercMatDest { + u8 matrix_number; + u8 matrix_dest; +}; + +/*! + * per-fragment info that doesn't go to the VU + */ +struct MercFragmentControl { + // memory layout + u8 unsigned_four_count; + u8 lump_four_count; + u8 fp_qwc; + + // matrix upload info + u8 mat_xfer_count; + std::vector mat_dest_data; // inline, dynamic + + TypedRef from_ref(TypedRef tr, const DecompilerTypeSystem& dts); + std::string print() const; +}; + +/*! + * the per-vu1 upload/call data for merc. + */ +struct MercFragment { + // part1: unsigned4. it is expanded to u32 by VIF. + MercByteHeader header; + std::vector> + unsigned_four_including_header; // repeats the data above. always 0 in vu. + + // part2: lump4. it is converted to floats by VIF. + std::vector> lump4_unpacked; // at lump_off qw in VU. + + // part3: fp. it contains the fp header, shaders, and ?? + MercFpHeader fp_header; + std::vector shaders; + std::vector extra_fp_data; // ?? + + TypedRef from_ref(TypedRef tr, + const DecompilerTypeSystem& dts, + const MercFragmentControl& control, + const MercCtrlHeader& main_control); + std::string print() const; +}; + +struct MercEffect { + //((frag-geo merc-fragment :offset-assert 0) ;; ? + std::vector frag_geo; + // (frag-ctrl merc-fragment-control :offset-assert 4) + std::vector frag_ctrl; + // (blend-data merc-blend-data :offset-assert 8) ?? + // (blend-ctrl merc-blend-ctrl :offset-assert 12) ?? + // (dummy0 uint8 :offset-assert 16) ?? + u8 effect_bits; + u16 frag_count; + u16 blend_frag_count; + u16 tri_count; + u16 dvert_count; + // (dummy1 uint8 :offset-assert 26) ?? + u8 envmap_usage; + // (extra-info merc-extra-info :offset-assert 28) ?? + + void from_ref(TypedRef tr, const DecompilerTypeSystem& dts, const MercCtrlHeader& main_control); + std::string print(); +}; + +struct MercCtrl { + std::string name; + s32 num_joints; + MercCtrlHeader header; + std::vector effects; + + void from_ref(TypedRef tr, const DecompilerTypeSystem& dts); + std::string print(); +}; +} // namespace decompiler \ No newline at end of file diff --git a/decompiler/level_extractor/common_formats.h b/decompiler/level_extractor/common_formats.h new file mode 100644 index 0000000000..597b3a88aa --- /dev/null +++ b/decompiler/level_extractor/common_formats.h @@ -0,0 +1,11 @@ +#pragma once +#include "common/common_types.h" + +namespace level_tools { + +// levels may remap textures if they provide one that should be shared +struct TextureRemap { + u32 original_texid; + u32 new_texid; +}; +} // namespace level_tools \ No newline at end of file diff --git a/decompiler/level_extractor/extract_collide_frags.cpp b/decompiler/level_extractor/extract_collide_frags.cpp new file mode 100644 index 0000000000..d32fd25b83 --- /dev/null +++ b/decompiler/level_extractor/extract_collide_frags.cpp @@ -0,0 +1,283 @@ +#include "extract_collide_frags.h" + +#include "common/util/FileUtil.h" + +namespace decompiler { + +struct CollideListItem { + const level_tools::CollideFragMesh* mesh = nullptr; + const level_tools::InstanceTie* inst = nullptr; + + struct { + struct UnpackedFace { + UnpackedFace(u8 a, u8 b, u8 c) : verts(a, b, c) {} + + math::Vector verts; + u32 pat; + }; + + std::vector vu0_buffer; + std::vector faces; + } unpacked; +}; + +/*! + * Get all collide frags. + */ +std::vector build_all_frags_list( + const level_tools::DrawableTreeCollideFragment* tree, + const std::vector& ties) { + std::vector list; + for (auto& cf : tree->last_array.collide_fragments) { + auto& elt = list.emplace_back(); + elt.mesh = &cf.mesh; + elt.inst = nullptr; + } + + for (auto tt : ties) { + auto last_array = tt->arrays.back().get(); + auto as_instance_array = dynamic_cast(last_array); + ASSERT(as_instance_array); + for (auto& inst : as_instance_array->instances) { + auto& frags = tt->prototypes.prototype_array_tie.data.at(inst.bucket_index) + .collide_frag.collide_fragments; + for (auto& frag : frags) { + auto& elt = list.emplace_back(); + elt.inst = &inst; + elt.mesh = &frag.mesh; + } + } + } + return list; +} + +float u32_to_float(u32 in) { + float r; + memcpy(&r, &in, sizeof(float)); + return r; +} + +void unpack_part1_collide_list_item(CollideListItem& item) { + int in_idx = 0; + int out_idx = 0; + int qw_to_write = item.mesh->vertex_count; + + while (out_idx < qw_to_write * 4) { + auto& vert = item.unpacked.vu0_buffer.emplace_back(); + vert[0] = u32_to_float(0x4d000000 + deref_u16(item.mesh->packed_data, in_idx++)); + vert[1] = u32_to_float(0x4d000000 + deref_u16(item.mesh->packed_data, in_idx++)); + vert[2] = u32_to_float(0x4d000000 + deref_u16(item.mesh->packed_data, in_idx++)); + vert[3] = u32_to_float(0x3f800000); + out_idx += 4; + } +} + +math::Vector transform_tie(const std::array mat, + const math::Vector4f& pt) { + auto temp = mat[0] * pt.x() + mat[1] * pt.y() + mat[2] * pt.z() + mat[3]; + math::Vector4f result; + result.x() = temp.x(); + result.y() = temp.y(); + result.z() = temp.z(); + result.w() = 1.f; + return result; +} + +namespace { +// todo dedup +std::array extract_tie_matrix(const u16* data) { + std::array result; + for (int i = 0; i < 4; i++) { + s32 x = data[12 + i]; + x <<= 16; + x >>= 10; + result[3][i] = x; + } + + for (int vec = 0; vec < 3; vec++) { + for (int i = 0; i < 4; i++) { + s32 x = data[vec * 4 + i]; + x <<= 16; + x >>= 16; + result[vec][i] = (float)x / 4096.f; + } + } + + return result; +} +} // namespace + +void unpack_part2_collide_list_item(CollideListItem& item) { + float base_offset = u32_to_float(0x4d000000); + + math::Vector4f vf13_combo_offset(base_offset, base_offset, base_offset, 0); + s32 base_trans_int[4]; + memcpy(base_trans_int, item.mesh->base_trans.data, 16); + math::Vector4f vf14_base_trans_float(base_trans_int[0], base_trans_int[1], base_trans_int[2], + base_trans_int[3]); + vf13_combo_offset -= vf14_base_trans_float; + std::array mat; + if (item.inst) { + mat = extract_tie_matrix(item.inst->origin.data); + mat[3][0] += item.inst->bsphere.data[0]; + mat[3][1] += item.inst->bsphere.data[1]; + mat[3][2] += item.inst->bsphere.data[2]; + } + + for (auto& ver : item.unpacked.vu0_buffer) { + ver -= vf13_combo_offset; + if (item.inst) { + ver = transform_tie(mat, ver); + } + } +} + +void find_faces(CollideListItem& item) { + u32 byte_offset = 16 * item.mesh->vertex_data_qwc; + + while (true) { + s8 t7_start_idx = deref_s8(item.mesh->packed_data, byte_offset++); + if (t7_start_idx < 0) { + return; + } + s8 t8_start_idx = deref_s8(item.mesh->packed_data, byte_offset++); + s8 t6_start_idx = deref_s8(item.mesh->packed_data, byte_offset++); + + s8 t6_run_idx = t7_start_idx; + s8 t7_run_idx = t8_start_idx; + s8 ra_run_idx = t6_start_idx; + + item.unpacked.faces.emplace_back(t6_run_idx, t7_run_idx, ra_run_idx); + s8 s5 = 1; + while (true) { + s8 next = deref_s8(item.mesh->packed_data, byte_offset++); + if (!next) { + break; + } + if (next < 0) { + next = -((s32)next); + } else { + t6_run_idx = t7_run_idx; + s5 = -s5; + } + next--; + t7_run_idx = ra_run_idx; + ra_run_idx = next; + u8 result[3]; + result[1] = t7_run_idx; + result[1 + s5] = ra_run_idx; + result[1 - s5] = t6_run_idx; + item.unpacked.faces.emplace_back(result[0], result[1], result[2]); + ASSERT((u32)next < item.unpacked.vu0_buffer.size()); + } + } +} + +void extract_pats(CollideListItem& item) { + u32 byte_offset = 16 * item.mesh->vertex_data_qwc + item.mesh->strip_data_len; + for (auto& f : item.unpacked.faces) { + auto pat_idx = deref_u8(item.mesh->packed_data, byte_offset++); + + u32 pat = deref_u32(item.mesh->pat_array, pat_idx); + // fmt::print("pat @ {} is 0x{:x}\n", pat_idx, pat); + f.pat = pat; + } +} + +std::string debug_dump_to_obj(const std::vector& list) { + std::vector verts; + std::vector> faces; + + for (auto& item : list) { + u32 f_off = verts.size() + 1; + for (auto& f : item.unpacked.faces) { + faces.emplace_back(f.verts[0] + f_off, f.verts[1] + f_off, f.verts[2] + f_off); + } + for (u32 t = 0; t < item.unpacked.vu0_buffer.size(); t++) { + verts.push_back(item.unpacked.vu0_buffer[t] / 65536); + } + } + + std::string result; + for (auto& vert : verts) { + result += fmt::format("v {} {} {}\n", vert.x(), vert.y(), vert.z()); + } + + for (auto& face : faces) { + result += fmt::format("f {}/{} {}/{} {}/{}\n", face.x(), face.x(), face.y(), face.y(), face.z(), + face.z()); + } + + return result; +} + +void set_vertices_for_tri(tfrag3::CollisionMesh::Vertex* out, const math::Vector4f* in) { + math::Vector3f v10 = in[1].xyz() - in[0].xyz(); + math::Vector3f v20 = in[2].xyz() - in[0].xyz(); + auto normal = (v10.cross(v20).normalized() * INT16_MAX).cast(); + + for (int i = 0; i < 3; i++) { + out[i].x = in[i].x(); + out[i].y = in[i].y(); + out[i].z = in[i].z(); + out[i].nx = normal.x(); + out[i].ny = normal.y(); + out[i].nz = normal.z(); + out[i].flags = 0; // todo + out[i].pad = 0; + } +} + +void extract_collide_frags(const level_tools::DrawableTreeCollideFragment* tree, + const std::vector& ties, + const std::string& debug_name, + tfrag3::Level& out, + bool dump_level) { + // in-game, the broad-phase collision builds a list of fragments, then unpacks them with: + /* + *(dotimes (i (-> *collide-list* num-items)) + (let ((frag (-> *collide-list* items i))) + ;; to VU0 memory + (__pc-upload-collide-frag (-> frag mesh packed-data) (-> frag mesh vertex-data-qwc) (-> + frag mesh vertex-count)) + ;; from VU0 memory to scratchpad + (unpack-background-collide-mesh obj (-> frag mesh) (-> frag inst) 0) + ;; from scratchpad to collide-cache memory. + (import-mesh-func obj (-> frag mesh)) + ) + ) + */ + + auto all_frags = build_all_frags_list(tree, ties); + u32 total_faces = 0; + for (auto& frag : all_frags) { + unpack_part1_collide_list_item(frag); + unpack_part2_collide_list_item(frag); + find_faces(frag); + extract_pats(frag); + total_faces += frag.unpacked.faces.size(); + } + + if (dump_level) { + auto debug_out = debug_dump_to_obj(all_frags); + file_util::write_text_file( + file_util::get_file_path({"debug_out", fmt::format("collide-{}.obj", debug_name)}), + debug_out); + } + + for (auto& item : all_frags) { + for (auto& f : item.unpacked.faces) { + math::Vector4f verts[3] = {item.unpacked.vu0_buffer[f.verts[0]], + item.unpacked.vu0_buffer[f.verts[1]], + item.unpacked.vu0_buffer[f.verts[2]]}; + tfrag3::CollisionMesh::Vertex out_verts[3]; + set_vertices_for_tri(out_verts, verts); + for (int i = 0; i < 3; i++) { + out_verts[i].pat = f.pat; + out.collision.vertices.push_back(out_verts[i]); + } + } + } +} + +} // namespace decompiler diff --git a/decompiler/level_extractor/extract_collide_frags.h b/decompiler/level_extractor/extract_collide_frags.h new file mode 100644 index 0000000000..6ae3ee62af --- /dev/null +++ b/decompiler/level_extractor/extract_collide_frags.h @@ -0,0 +1,15 @@ +#pragma once + +#include "BspHeader.h" + +#include "common/custom_data/Tfrag3Data.h" + +namespace decompiler { + +void extract_collide_frags(const level_tools::DrawableTreeCollideFragment* tree, + const std::vector& ties, + const std::string& debug_name, + tfrag3::Level& out, + bool dump_level); + +} // namespace decompiler \ No newline at end of file diff --git a/decompiler/level_extractor/extract_common.cpp b/decompiler/level_extractor/extract_common.cpp new file mode 100644 index 0000000000..216127d2b2 --- /dev/null +++ b/decompiler/level_extractor/extract_common.cpp @@ -0,0 +1,46 @@ +#include "extract_common.h" + +#include + +u32 clean_up_vertex_indices(std::vector& idx) { + std::vector fixed; + u32 num_tris = 0; + + bool looking_for_start = true; + size_t i_of_start; + for (size_t i = 0; i < idx.size(); i++) { + if (looking_for_start) { + if (idx[i] != UINT32_MAX) { + looking_for_start = false; + i_of_start = i; + } + } else { + if (idx[i] == UINT32_MAX) { + looking_for_start = true; + size_t num_verts = i - i_of_start; + if (num_verts >= 3) { + if (!fixed.empty()) { + fixed.push_back(UINT32_MAX); + } + fixed.insert(fixed.end(), idx.begin() + i_of_start, idx.begin() + i); + num_tris += (num_verts - 2); + } + } + } + } + + if (!looking_for_start) { + size_t num_verts = idx.size() - i_of_start; + if (num_verts >= 3) { + if (!fixed.empty()) { + fixed.push_back(UINT32_MAX); + } + fixed.insert(fixed.end(), idx.begin() + i_of_start, idx.begin() + idx.size()); + num_tris += (num_verts - 2); + } + } + + idx = std::move(fixed); + + return num_tris; +} \ No newline at end of file diff --git a/decompiler/level_extractor/extract_common.h b/decompiler/level_extractor/extract_common.h new file mode 100644 index 0000000000..c50030df51 --- /dev/null +++ b/decompiler/level_extractor/extract_common.h @@ -0,0 +1,6 @@ +#pragma once +#include + +#include "common/common_types.h" + +u32 clean_up_vertex_indices(std::vector& idx); \ No newline at end of file diff --git a/decompiler/level_extractor/extract_level.cpp b/decompiler/level_extractor/extract_level.cpp index 39c6fb7e2e..58922eda34 100644 --- a/decompiler/level_extractor/extract_level.cpp +++ b/decompiler/level_extractor/extract_level.cpp @@ -1,12 +1,18 @@ -#include - #include "extract_level.h" + +#include +#include + +#include "common/util/FileUtil.h" +#include "common/util/SimpleThreadGroup.h" +#include "common/util/compress.h" + #include "decompiler/level_extractor/BspHeader.h" +#include "decompiler/level_extractor/extract_collide_frags.h" +#include "decompiler/level_extractor/extract_merc.h" +#include "decompiler/level_extractor/extract_shrub.h" #include "decompiler/level_extractor/extract_tfrag.h" #include "decompiler/level_extractor/extract_tie.h" -#include "decompiler/level_extractor/extract_shrub.h" -#include "common/util/compress.h" -#include "common/util/FileUtil.h" namespace decompiler { @@ -49,89 +55,154 @@ bool is_valid_bsp(const decompiler::LinkedObjectFile& file) { return true; } -void print_memory_usage(const tfrag3::Level& lev, int uncompressed_data_size) { - int total_accounted = 0; - auto memory_use_by_category = lev.get_memory_usage(); - - std::vector> known_categories = { - {"texture", memory_use_by_category[tfrag3::MemoryUsageCategory::TEXTURE]}, - {"tie-deinst-vis", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_DEINST_VIS]}, - {"tie-deinst-idx", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_DEINST_INDEX]}, - {"tie-inst-vis", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_INST_VIS]}, - {"tie-inst-idx", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_INST_INDEX]}, - {"tie-bvh", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_BVH]}, - {"tie-verts", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_VERTS]}, - {"tie-colors", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_TIME_OF_DAY]}, - {"tie-wind-inst-info", - memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_WIND_INSTANCE_INFO]}, - {"tie-cidx", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_CIDX]}, - {"tie-mats", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_MATRICES]}, - {"tie-grps", memory_use_by_category[tfrag3::MemoryUsageCategory::TIE_GRPS]}, - {"tfrag-vis", memory_use_by_category[tfrag3::MemoryUsageCategory::TFRAG_VIS]}, - {"tfrag-idx", memory_use_by_category[tfrag3::MemoryUsageCategory::TFRAG_INDEX]}, - {"tfrag-vert", memory_use_by_category[tfrag3::MemoryUsageCategory::TFRAG_VERTS]}, - {"tfrag-colors", memory_use_by_category[tfrag3::MemoryUsageCategory::TFRAG_TIME_OF_DAY]}, - {"tfrag-cluster", memory_use_by_category[tfrag3::MemoryUsageCategory::TFRAG_CLUSTER]}, - {"tfrag-bvh", memory_use_by_category[tfrag3::MemoryUsageCategory::TFRAG_BVH]}, - {"shrub-colors", memory_use_by_category[tfrag3::MemoryUsageCategory::SHRUB_TIME_OF_DAY]}, - {"shrub-vert", memory_use_by_category[tfrag3::MemoryUsageCategory::SHRUB_VERT]}, - {"shrub-ind", memory_use_by_category[tfrag3::MemoryUsageCategory::SHRUB_IND]}}; - for (auto& known : known_categories) { - total_accounted += known.second; - } - - known_categories.push_back({"unknown", uncompressed_data_size - total_accounted}); - - std::sort(known_categories.begin(), known_categories.end(), - [](const auto& a, const auto& b) { return a.second > b.second; }); - - for (const auto& x : known_categories) { - fmt::print("{:30s} : {:6d} kB {:3.1f}%\n", x.first, x.second / 1024, - 100.f * (float)x.second / uncompressed_data_size); - } -} - void add_all_textures_from_level(tfrag3::Level& lev, const std::string& level_name, - TextureDB& tex_db) { + const TextureDB& tex_db) { ASSERT(lev.textures.empty()); - for (auto id : tex_db.texture_ids_per_level[level_name]) { - const auto& tex = tex_db.textures.at(id); - lev.textures.emplace_back(); - auto& new_tex = lev.textures.back(); - new_tex.combo_id = id; - new_tex.w = tex.w; - new_tex.h = tex.h; - new_tex.debug_tpage_name = tex_db.tpage_names.at(tex.page); - new_tex.debug_name = new_tex.debug_tpage_name + tex.name; - new_tex.data = tex.rgba_bytes; - new_tex.combo_id = id; - new_tex.load_to_pool = true; + const auto& level_it = tex_db.texture_ids_per_level.find(level_name); + if (level_it != tex_db.texture_ids_per_level.end()) { + for (auto id : level_it->second) { + const auto& tex = tex_db.textures.at(id); + lev.textures.emplace_back(); + auto& new_tex = lev.textures.back(); + new_tex.combo_id = id; + new_tex.w = tex.w; + new_tex.h = tex.h; + new_tex.debug_tpage_name = tex_db.tpage_names.at(tex.page); + new_tex.debug_name = new_tex.debug_tpage_name + tex.name; + new_tex.data = tex.rgba_bytes; + new_tex.combo_id = id; + new_tex.load_to_pool = true; + } } } -void confirm_textures_identical(TextureDB& tex_db) { +void confirm_textures_identical(const TextureDB& tex_db) { std::unordered_map> tex_dupl; for (auto& tex : tex_db.textures) { - auto name = tex_db.tpage_names[tex.second.page] + tex.second.name; + auto name = tex_db.tpage_names.at(tex.second.page) + tex.second.name; auto it = tex_dupl.find(name); if (it == tex_dupl.end()) { tex_dupl.insert({name, tex.second.rgba_bytes}); } else { bool ok = it->second == tex.second.rgba_bytes; if (!ok) { - fmt::print("BAD duplicate: {} {} vs {}\n", name, tex.second.rgba_bytes.size(), - it->second.size()); - ASSERT(false); + ASSERT_MSG(false, fmt::format("BAD duplicate: {} {} vs {}", name, + tex.second.rgba_bytes.size(), it->second.size())); } } } } +void extract_art_groups_from_level(const ObjectFileDB& db, + const TextureDB& tex_db, + const std::vector& tex_remap, + const std::string& dgo_name, + tfrag3::Level& level_data, + bool dump_level) { + const auto& files = db.obj_files_by_dgo.at(dgo_name); + for (const auto& file : files) { + if (file.name.length() > 3 && !file.name.compare(file.name.length() - 3, 3, "-ag")) { + const auto& ag_file = db.lookup_record(file); + extract_merc(ag_file, tex_db, db.dts, tex_remap, level_data, dump_level); + } + } +} + +std::vector extract_bsp_from_level(const ObjectFileDB& db, + const TextureDB& tex_db, + const std::string& dgo_name, + const DecompileHacks& hacks, + bool dump_level, + bool extract_collision, + tfrag3::Level& level_data) { + auto bsp_rec = get_bsp_file(db.obj_files_by_dgo.at(dgo_name)); + if (!bsp_rec) { + lg::warn("Skipping extract for {} because the BSP file was not found", dgo_name); + return {}; + } + std::string level_name = bsp_rec->name.substr(0, bsp_rec->name.length() - 4); + + fmt::print("Processing level {} ({})\n", dgo_name, level_name); + const auto& bsp_file = db.lookup_record(*bsp_rec); + bool ok = is_valid_bsp(bsp_file.linked_data); + ASSERT(ok); + + level_tools::DrawStats draw_stats; + // draw_stats.debug_print_dma_data = true; + level_tools::BspHeader bsp_header; + bsp_header.read_from_file(bsp_file.linked_data, db.dts, &draw_stats); + ASSERT((int)bsp_header.drawable_tree_array.trees.size() == bsp_header.drawable_tree_array.length); + + /* + level_tools::PrintSettings settings; + settings.expand_collide = true; + fmt::print("{}\n", bsp_header.print(settings)); + */ + + const std::set tfrag_trees = { + "drawable-tree-tfrag", "drawable-tree-trans-tfrag", "drawable-tree-dirt-tfrag", + "drawable-tree-ice-tfrag", "drawable-tree-lowres-tfrag", "drawable-tree-lowres-trans-tfrag"}; + int i = 0; + + std::vector all_ties; + for (auto& draw_tree : bsp_header.drawable_tree_array.trees) { + auto as_tie_tree = dynamic_cast(draw_tree.get()); + if (as_tie_tree) { + all_ties.push_back(as_tie_tree); + } + } + + bool got_collide = false; + for (auto& draw_tree : bsp_header.drawable_tree_array.trees) { + if (tfrag_trees.count(draw_tree->my_type())) { + auto as_tfrag_tree = dynamic_cast(draw_tree.get()); + ASSERT(as_tfrag_tree); + std::vector> expected_missing_textures; + auto it = hacks.missing_textures_by_level.find(level_name); + if (it != hacks.missing_textures_by_level.end()) { + expected_missing_textures = it->second; + } + extract_tfrag(as_tfrag_tree, fmt::format("{}-{}", dgo_name, i++), + bsp_header.texture_remap_table, tex_db, expected_missing_textures, level_data, + dump_level); + } else if (draw_tree->my_type() == "drawable-tree-instance-tie") { + auto as_tie_tree = dynamic_cast(draw_tree.get()); + ASSERT(as_tie_tree); + extract_tie(as_tie_tree, fmt::format("{}-{}-tie", dgo_name, i++), + bsp_header.texture_remap_table, tex_db, level_data, dump_level); + } else if (draw_tree->my_type() == "drawable-tree-instance-shrub") { + auto as_shrub_tree = + dynamic_cast(draw_tree.get()); + ASSERT(as_shrub_tree); + extract_shrub(as_shrub_tree, fmt::format("{}-{}-shrub", dgo_name, i++), + bsp_header.texture_remap_table, tex_db, {}, level_data, dump_level); + } else if (draw_tree->my_type() == "drawable-tree-collide-fragment" && extract_collision) { + auto as_collide_frags = + dynamic_cast(draw_tree.get()); + ASSERT(as_collide_frags); + ASSERT(!got_collide); + got_collide = true; + extract_collide_frags(as_collide_frags, all_ties, fmt::format("{}-{}-collide", dgo_name, i++), + level_data, dump_level); + } else { + // fmt::print(" unsupported tree {}\n", draw_tree->my_type()); + } + } + level_data.level_name = level_name; + + return bsp_header.texture_remap_table; +} + /*! - * Extract common textures found in GAME.CGO + * Extract stuff found in GAME.CGO. + * Even though GAME.CGO isn't technically a level, the decompiler/loader treat it like one, + * but the bsp stuff is just empty. It will contain only textures/art groups. */ -void extract_common(ObjectFileDB& db, TextureDB& tex_db, const std::string& dgo_name) { +void extract_common(const ObjectFileDB& db, + const TextureDB& tex_db, + const std::string& dgo_name, + bool dump_levels) { if (db.obj_files_by_dgo.count(dgo_name) == 0) { lg::warn("Skipping common extract for {} because the DGO was not part of the input", dgo_name); return; @@ -146,10 +217,13 @@ void extract_common(ObjectFileDB& db, TextureDB& tex_db, const std::string& dgo_ tfrag3::Level tfrag_level; add_all_textures_from_level(tfrag_level, dgo_name, tex_db); + extract_art_groups_from_level(db, tex_db, {}, dgo_name, tfrag_level, dump_levels); Serializer ser; tfrag_level.serialize(ser); auto compressed = compression::compress_zstd(ser.get_save_result().first, ser.get_save_result().second); + + fmt::print("stats for {}\n", dgo_name); print_memory_usage(tfrag_level, ser.get_save_result().second); fmt::print("compressed: {} -> {} ({:.2f}%)\n", ser.get_save_result().second, compressed.size(), 100.f * compressed.size() / ser.get_save_result().second); @@ -158,85 +232,52 @@ void extract_common(ObjectFileDB& db, TextureDB& tex_db, const std::string& dgo_ compressed.data(), compressed.size()); } -void extract_from_level(ObjectFileDB& db, - TextureDB& tex_db, +void extract_from_level(const ObjectFileDB& db, + const TextureDB& tex_db, const std::string& dgo_name, const DecompileHacks& hacks, - bool dump_level) { + bool dump_level, + bool extract_collision) { if (db.obj_files_by_dgo.count(dgo_name) == 0) { lg::warn("Skipping extract for {} because the DGO was not part of the input", dgo_name); return; } + tfrag3::Level level_data; + add_all_textures_from_level(level_data, dgo_name, tex_db); - auto bsp_rec = get_bsp_file(db.obj_files_by_dgo.at(dgo_name)); - if (!bsp_rec) { - lg::warn("Skipping extract for {} because the BSP file was not found", dgo_name); - return; - } - std::string level_name = bsp_rec->name.substr(0, bsp_rec->name.length() - 4); - - fmt::print("Processing level {} ({})\n", dgo_name, level_name); - auto& bsp_file = db.lookup_record(*bsp_rec); - bool ok = is_valid_bsp(bsp_file.linked_data); - ASSERT(ok); - - level_tools::DrawStats draw_stats; - // draw_stats.debug_print_dma_data = true; - level_tools::BspHeader bsp_header; - bsp_header.read_from_file(bsp_file.linked_data, db.dts, &draw_stats); - ASSERT((int)bsp_header.drawable_tree_array.trees.size() == bsp_header.drawable_tree_array.length); - - /* - level_tools::PrintSettings settings; - settings.expand_shrub = true; - fmt::print("{}\n", bsp_header.print(settings)); - */ - - const std::set tfrag_trees = { - "drawable-tree-tfrag", "drawable-tree-trans-tfrag", "drawable-tree-dirt-tfrag", - "drawable-tree-ice-tfrag", "drawable-tree-lowres-tfrag", "drawable-tree-lowres-trans-tfrag"}; - int i = 0; - tfrag3::Level tfrag_level; - - add_all_textures_from_level(tfrag_level, dgo_name, tex_db); - - for (auto& draw_tree : bsp_header.drawable_tree_array.trees) { - if (tfrag_trees.count(draw_tree->my_type())) { - auto as_tfrag_tree = dynamic_cast(draw_tree.get()); - ASSERT(as_tfrag_tree); - std::vector> expected_missing_textures; - auto it = hacks.missing_textures_by_level.find(level_name); - if (it != hacks.missing_textures_by_level.end()) { - expected_missing_textures = it->second; - } - extract_tfrag(as_tfrag_tree, fmt::format("{}-{}", dgo_name, i++), - bsp_header.texture_remap_table, tex_db, expected_missing_textures, tfrag_level, - dump_level); - } else if (draw_tree->my_type() == "drawable-tree-instance-tie") { - auto as_tie_tree = dynamic_cast(draw_tree.get()); - ASSERT(as_tie_tree); - extract_tie(as_tie_tree, fmt::format("{}-{}-tie", dgo_name, i++), - bsp_header.texture_remap_table, tex_db, tfrag_level, dump_level); - } else if (draw_tree->my_type() == "drawable-tree-instance-shrub") { - auto as_shrub_tree = - dynamic_cast(draw_tree.get()); - ASSERT(as_shrub_tree); - extract_shrub(as_shrub_tree, fmt::format("{}-{}-shrub", dgo_name, i++), - bsp_header.texture_remap_table, tex_db, {}, tfrag_level, dump_level); - } else { - // fmt::print(" unsupported tree {}\n", draw_tree->my_type()); - } - } + // the bsp header file data + auto tex_remap = extract_bsp_from_level(db, tex_db, dgo_name, hacks, dump_level, + extract_collision, level_data); + extract_art_groups_from_level(db, tex_db, tex_remap, dgo_name, level_data, dump_level); Serializer ser; - tfrag_level.serialize(ser); + level_data.serialize(ser); auto compressed = compression::compress_zstd(ser.get_save_result().first, ser.get_save_result().second); - print_memory_usage(tfrag_level, ser.get_save_result().second); + fmt::print("stats for {}\n", dgo_name); + print_memory_usage(level_data, ser.get_save_result().second); fmt::print("compressed: {} -> {} ({:.2f}%)\n", ser.get_save_result().second, compressed.size(), 100.f * compressed.size() / ser.get_save_result().second); file_util::write_binary_file(file_util::get_file_path({fmt::format( "assets/{}.fr3", dgo_name.substr(0, dgo_name.length() - 4))}), compressed.data(), compressed.size()); } + +void extract_all_levels(const ObjectFileDB& db, + const TextureDB& tex_db, + const std::vector& dgo_names, + const std::string& common_name, + const DecompileHacks& hacks, + bool debug_dump_level, + bool extract_collision) { + extract_common(db, tex_db, common_name, debug_dump_level); + SimpleThreadGroup threads; + threads.run( + [&](int idx) { + extract_from_level(db, tex_db, dgo_names[idx], hacks, debug_dump_level, extract_collision); + }, + dgo_names.size()); + threads.join(); +} + } // namespace decompiler diff --git a/decompiler/level_extractor/extract_level.h b/decompiler/level_extractor/extract_level.h index 6952053c40..f83307e0e8 100644 --- a/decompiler/level_extractor/extract_level.h +++ b/decompiler/level_extractor/extract_level.h @@ -3,13 +3,17 @@ #include #include "common/math/Vector.h" + #include "decompiler/ObjectFile/ObjectFileDB.h" namespace decompiler { -void extract_from_level(ObjectFileDB& db, - TextureDB& tex_db, - const std::string& dgo_name, + +// extract everything +void extract_all_levels(const ObjectFileDB& db, + const TextureDB& tex_db, + const std::vector& dgo_names, + const std::string& common_name, const DecompileHacks& hacks, - bool dump_level); -void extract_common(ObjectFileDB& db, TextureDB& tex_db, const std::string& dgo_name); + bool debug_dump_level, + bool extract_collision); } // namespace decompiler diff --git a/decompiler/level_extractor/extract_merc.cpp b/decompiler/level_extractor/extract_merc.cpp new file mode 100644 index 0000000000..543f860940 --- /dev/null +++ b/decompiler/level_extractor/extract_merc.cpp @@ -0,0 +1,990 @@ +#include "extract_merc.h" + +#include "common/util/FileUtil.h" +#include "common/util/colors.h" + +#include "decompiler/level_extractor/MercData.h" +#include "decompiler/level_extractor/extract_common.h" +#include "decompiler/util/goal_data_reader.h" + +namespace decompiler { + +// number of slots on VU1 data memory to store matrices +constexpr int MERC_VU1_MATRIX_SLOTS = 18; +// the size of each "matrix". Includes a transformation and rotation matrix (for normals) +constexpr int MERC_MATRIX_STRIDE = 7; + +// converts a vu1 address to an index of a matrix slot. +// as far as I can tell, nothing in the game uses indices, they are always addresses already +u32 vu1_addr_to_matrix_slot(u32 addr) { + ASSERT(addr >= 6); + ASSERT(addr < (6 + MERC_MATRIX_STRIDE * MERC_VU1_MATRIX_SLOTS)); + addr -= 6; + ASSERT((addr % MERC_MATRIX_STRIDE) == 0); + return addr / MERC_MATRIX_STRIDE; +} + +u32 matrix_slot_to_vu1_addr(u32 slot) { + ASSERT(slot < MERC_VU1_MATRIX_SLOTS); + return 6 + (slot * MERC_MATRIX_STRIDE); +} + +/*! + * The GS settings of a merc draw (shader + tex) + */ +struct MercGsState { + // the blending, clamp, etc settings. from adgif shaders + DrawMode mode; + // the texture to use, as a "pc combo" texture index. + u32 pc_combo_tex_id; + u64 as_u64() const { return (((u64)pc_combo_tex_id) << 32) | mode.as_int(); } +}; + +/*! + * This is all the state that's required to understand how to draw a vertex. including both the GS + * state, and stuff (matrices) left behind in VU memory. The matrix slots are matrix indices into + * the original bones matrices (all the matrices in the skeleton). An index of -1 indicates that + * there is no known matrix in this slot. + */ +struct MercState { + MercGsState merc_draw_mode; + // vu1_matrix_slots[x] = y + // where x is the slot in VU1 memory, and y is the matrix index for the bones/skeleton stuff. + std::array vu1_matrix_slots; + MercState() { vu1_matrix_slots.fill(-1); } +}; + +/*! + * Required information for a "draw", consisting of a strip of triangles (represented as indices for + * OpenGL triangle strip) and the draw settings. + */ +struct MercDraw { + size_t ctrl_idx; // which merc ctrl in the level we correspond to + size_t effect_idx; // which effect within that control + size_t frag_idx; // which frag within that effect + // note that the above triple isn't enough to uniquely identify a draw - there can be multiple + // draws within a fragment. + + // draw settings + MercState state; + + // opengl indices. currently into a per-effect vertex list (likely to merge into a giant buffer + // eventually) + std::vector indices; + + // where we would be in VU1 data memory (used in construction) + u32 vtx_offset; // relative to writing output zone + u32 vtx_nloop; // nloop that goes in the gif tag drawing us. +}; + +/*! + * Merc Vertex. Not the format we'll want in the game data files, but most useful as an intermediate + * when building up draws. + */ +struct MercUnpackedVtx { + int kind = 0; // 1, 2, or 3 matrix + math::Vector3f pos; // position + math::Vector3f nrm; // normal (as input to the merc math, pretty sure legnth is bogus) + math::Vector2f st; // texture coordinates + math::Vector rgba; + + int skel_mats[3]; + float mat_weights[3]; + + u16 dst0; + u16 dst1; +}; + +/*! + * An entire merc-effect, split into draws. + * Note that copied or multiply-placed vertices will be de-deduplicated, but not identical vertices + * that actually appear in the input to merc. + */ +struct ConvertedMercEffect { + size_t ctrl_idx; + size_t effect_idx; + // draws from all fragments. + std::vector draws; + std::vector vertices; +}; + +/*! + * Extract a merc-ctrl data structure. This is mostly just copying the GOAL data to C++ classes, + * but does include the effect of processing the DMA data through VIF. + */ +MercCtrl extract_merc_ctrl(const LinkedObjectFile& file, + const DecompilerTypeSystem& dts, + int word_idx) { + Ref ref; + ref.data = &file; + ref.seg = 0; + ref.byte_offset = word_idx * 4; + + auto tr = typed_ref_from_basic(ref, dts); + + MercCtrl ctrl; + ctrl.from_ref(tr, dts); // the merc data import + return ctrl; +} + +/*! + * Find the word indices for the merc ctrls (the type tags) + */ +std::vector find_merc_ctrls(const LinkedObjectFile& file) { + std::vector result; + for (size_t i = 0; i < file.words_by_seg.at(0).size(); i++) { + const auto& word = file.words_by_seg[0][i]; + if (word.kind() == LinkedWord::TYPE_PTR && word.symbol_name() == "merc-ctrl") { + result.push_back(i); + } + } + return result; +} + +namespace { +/*! + * Merc models tend to have strange texture ids. I don't really understand why. + * On login, the texture is checked against a list of textures in the bsp, and replaced with this. + * It doesn't seem to be related to sharing textures between levels - the yakow texture uses this. + */ +u32 remap_texture(u32 original, const std::vector& map) { + auto masked = original & 0xffffff00; + for (auto& t : map) { + if (t.original_texid == masked) { + return t.new_texid | 20; + } + } + return original; +} + +/*! + * Set the alpha fields of a DrawMode (for PC renderers) based on gs alpha register + */ +void update_mode_from_alpha1(GsAlpha reg, DrawMode& mode) { + if (reg.a_mode() == GsAlpha::BlendMode::SOURCE && reg.b_mode() == GsAlpha::BlendMode::DEST && + reg.c_mode() == GsAlpha::BlendMode::SOURCE && reg.d_mode() == GsAlpha::BlendMode::DEST) { + // (Cs - Cd) * As + Cd + // Cs * As + (1 - As) * Cd + mode.set_alpha_blend(DrawMode::AlphaBlend::SRC_DST_SRC_DST); + + } else if (reg.a_mode() == GsAlpha::BlendMode::SOURCE && + reg.b_mode() == GsAlpha::BlendMode::ZERO_OR_FIXED && + reg.c_mode() == GsAlpha::BlendMode::SOURCE && + reg.d_mode() == GsAlpha::BlendMode::DEST) { + // (Cs - 0) * As + Cd + // Cs * As + (1) * CD + mode.set_alpha_blend(DrawMode::AlphaBlend::SRC_0_SRC_DST); + } else if (reg.a_mode() == GsAlpha::BlendMode::SOURCE && + reg.b_mode() == GsAlpha::BlendMode::ZERO_OR_FIXED && + reg.c_mode() == GsAlpha::BlendMode::ZERO_OR_FIXED && + reg.d_mode() == GsAlpha::BlendMode::DEST) { + ASSERT(reg.fix() == 128); + // Cv = (Cs - 0) * FIX + Cd + // if fix = 128, it works out to 1.0 + mode.set_alpha_blend(DrawMode::AlphaBlend::SRC_0_FIX_DST); + // src plus dest + } else if (reg.a_mode() == GsAlpha::BlendMode::SOURCE && + reg.b_mode() == GsAlpha::BlendMode::DEST && + reg.c_mode() == GsAlpha::BlendMode::ZERO_OR_FIXED && + reg.d_mode() == GsAlpha::BlendMode::DEST) { + // Cv = (Cs - Cd) * FIX + Cd + ASSERT(reg.fix() == 64); + mode.set_alpha_blend(DrawMode::AlphaBlend::SRC_DST_FIX_DST); + } else if (reg.a_mode() == GsAlpha::BlendMode::DEST && + reg.b_mode() == GsAlpha::BlendMode::SOURCE && + reg.c_mode() == GsAlpha::BlendMode::ZERO_OR_FIXED && + reg.d_mode() == GsAlpha::BlendMode::ZERO_OR_FIXED) { + } + + else { + // unsupported blend: a 0 b 1 c 0 d 2 is this part of generic? + fmt::print("unsupported blend: a {} b {} c {} d {}\n", (int)reg.a_mode(), (int)reg.b_mode(), + (int)reg.c_mode(), (int)reg.d_mode()); + mode.set_alpha_blend(DrawMode::AlphaBlend::SRC_DST_SRC_DST); + // ASSERT(false); + } +} + +/*! + * Convert merc shader to PC draw mode + */ +DrawMode process_draw_mode(const MercShader& info) { + DrawMode mode; + /* + * (new 'static 'gs-test + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) + */ + mode.enable_at(); + mode.set_alpha_test(DrawMode::AlphaTest::GEQUAL); + mode.set_aref(0x26); + mode.set_alpha_fail(GsTest::AlphaFail::KEEP); + mode.set_alpha_test(DrawMode::AlphaTest::GEQUAL); + mode.enable_zt(); + mode.enable_depth_write(); + mode.set_depth_test(GsTest::ZTest::GEQUAL); + + // check these + mode.disable_ab(); + mode.set_alpha_blend(DrawMode::AlphaBlend::SRC_DST_SRC_DST); + mode.set_tcc(info.tex0.tcc()); + mode.set_decal(info.tex0.tfx() == GsTex0::TextureFunction::DECAL); + mode.set_filt_enable(info.tex1.mmag()); + + // the alpha matters (maybe?) + update_mode_from_alpha1(info.alpha, mode); + + // the clamp matters + if (!(info.clamp == 0b101 || info.clamp == 0 || info.clamp == 1 || info.clamp == 0b100)) { + ASSERT_MSG(false, fmt::format("clamp: 0x{:x}", info.clamp)); + } + + mode.set_clamp_s_enable(info.clamp & 0b1); + mode.set_clamp_t_enable(info.clamp & 0b100); + + return mode; +} + +float u32_as_float(u32 in) { + float out; + memcpy(&out, &in, sizeof(float)); + return out; +} + +u32 float_as_u32(float in) { + u32 out; + memcpy(&out, &in, sizeof(float)); + return out; +} +} // namespace + +/*! + * Representing something that can be written to the merc output buffer. 1 qw + */ +struct MercOutputQuadword { + enum class Kind { + INVALID, // uninitialized, or in the middle of another thing + VTX_START, // the first qw of a vertex + SHADER_START, // the first qw of a shader (the giftag) + PRIM_START // the giftag for a list of vertices + } kind = Kind::INVALID; + + // if we're a vertex + u32 vtx_idx = -1; // index in the effect's vertex list. + bool adc = false; // if our adc flag is set. this differs between copies, so put it here. + + // if we're a primitive giftag, the number of vertices that come after us. + u32 nloop_count = 0; +}; + +struct MercMemory { + std::array memory; +}; + +/*! + * Add vertices from a fragment to memory. Emulates the unpacking. + */ +void handle_frag(const std::string& debug_name, + const MercCtrlHeader& ctrl_header, + const MercFragment& frag, + const MercFragmentControl& frag_ctrl, + const MercState& state, + std::vector& effect_vertices, + MercMemory& memory) { + (void)frag_ctrl; + (void)debug_name; + // fmt::print("handling frag: {}\n", debug_name); + // fmt::print("{}\n", frag.print()); + + // we'll iterate through the lump and rgba data + int lump_ptr = 0; // vertex data starts at the beginning of "lump" + int rgba_ptr = frag.header.rgba_off; // rgba is in u4's + int perc_ptr = frag.header.perc_off; + int last_mat2_perc = perc_ptr - 1; + int perc_toggle = 0; + + u32 mat1_cnt = frag.header.mat1_cnt; + u32 mat12_cnt = frag.header.mat2_cnt + mat1_cnt; + u32 mat123_cnt = frag.header.mat3_cnt + mat12_cnt; + + // loop through vertices. + int prev_mat0 = -1; + int prev_mat1 = -1; + int prev_mat2 = -1; + for (size_t i = 0; i < mat123_cnt; i++) { + u32 current_vtx_idx = effect_vertices.size(); // idx in effect vertex list. + auto& vtx = effect_vertices.emplace_back(); + + if (i < mat1_cnt) { + vtx.kind = 1; // 1 matrix + } else if (i < mat12_cnt) { + vtx.kind = 2; // 2 matrix + } else { + vtx.kind = 3; + } + + // the three quadwords in the source data + auto v0 = frag.lump4_unpacked.at(lump_ptr); + auto v1 = frag.lump4_unpacked.at(lump_ptr + 1); + auto v2 = frag.lump4_unpacked.at(lump_ptr + 2); + + // ilwr.x vi08, vi01 ;; load mat0 from vertex + u16 mat0_addr; + memcpy(&mat0_addr, &v0.x(), 2); + u16 mat1_addr; + memcpy(&mat1_addr, &v0.y(), 2); + + if (vtx.kind == 1) { + vtx.skel_mats[0] = state.vu1_matrix_slots.at(vu1_addr_to_matrix_slot(mat0_addr)); + vtx.skel_mats[1] = 0; + vtx.skel_mats[2] = 0; + vtx.mat_weights[0] = 1.f; + vtx.mat_weights[1] = 0.f; + vtx.mat_weights[2] = 0.f; + ASSERT(vtx.skel_mats[0] >= 0); + } else if (vtx.kind == 2) { + u8 m0 = mat0_addr & 0x7f; + u8 m1 = mat1_addr & 0x7f; + if (m0 == 0x7f) { + ASSERT(prev_mat0 != -1); + } else { + prev_mat0 = vu1_addr_to_matrix_slot(m0); + prev_mat1 = vu1_addr_to_matrix_slot(m1); + } + vtx.skel_mats[0] = state.vu1_matrix_slots.at(prev_mat0); + vtx.skel_mats[1] = state.vu1_matrix_slots.at(prev_mat1); + vtx.skel_mats[2] = 0; + + if (m0 != 0x7f && i != mat1_cnt) { + if (perc_toggle) { + perc_ptr++; + } + perc_toggle = !perc_toggle; + } + + auto perc = frag.unsigned_four_including_header.at(perc_ptr); + last_mat2_perc = perc_ptr; + + if (!perc_toggle) { + vtx.mat_weights[0] = perc.x() / 255.f; + vtx.mat_weights[1] = perc.y() / 255.f; + } else { + vtx.mat_weights[0] = perc.z() / 255.f; + vtx.mat_weights[1] = perc.w() / 255.f; + } + vtx.mat_weights[2] = 0.f; + + float sum = vtx.mat_weights[0] + vtx.mat_weights[1]; + ASSERT(std::abs(1.f - sum) < 1e-6); + } else if (vtx.kind == 3) { + u8 m0 = mat0_addr & 0x7f; + u8 m1 = mat1_addr & 0x7f; + + if (i == mat12_cnt) { + perc_ptr = last_mat2_perc; + } + + if (m0 == 0x7f) { + ASSERT(prev_mat0 != -1); + } else { + perc_ptr++; + prev_mat0 = vu1_addr_to_matrix_slot(m0); + prev_mat1 = vu1_addr_to_matrix_slot(m1); + prev_mat2 = vu1_addr_to_matrix_slot(frag.unsigned_four_including_header.at(perc_ptr).w()); + } + vtx.skel_mats[0] = state.vu1_matrix_slots.at(prev_mat0); + vtx.skel_mats[1] = state.vu1_matrix_slots.at(prev_mat1); + vtx.skel_mats[2] = state.vu1_matrix_slots.at(prev_mat2); + + auto perc = frag.unsigned_four_including_header.at(perc_ptr); + vtx.mat_weights[0] = perc.x() / 255.f; + vtx.mat_weights[1] = perc.y() / 255.f; + vtx.mat_weights[2] = perc.z() / 255.f; + + float sum = vtx.mat_weights[0] + vtx.mat_weights[1] + vtx.mat_weights[2]; + ASSERT(std::abs(1.f - sum) < 1e-6); + } else { + ASSERT(false); + } + + u16 mat1; + memcpy(&mat1, &v0.y(), 2); + u16 mat0; + memcpy(&mat0, &v0.x(), 2); + + // add.zw vf08, vf08, vf17 ;; lump offset + // vf17 = [2048, 255, -65537, xyz-add.x] (the ?? is set per fragment) + v0.z() += -65537; + v0.w() += frag.fp_header.x_add; + + // add.xyzw vf11, vf11, vf18 ;; lump offset + // vf18 = [st-out-X, st-out-X, -65537, xyz-add.y] (X = a if xtop = 0, X = b otherwise) + v1.x() += u32_as_float(ctrl_header.st_out_a); + v1.y() += u32_as_float(ctrl_header.st_out_a); + v1.z() += -65537; + v1.w() += frag.fp_header.y_add; + + // add.xyzw vf14, vf14, vf19 ;; lump offset + // vf19 = [st-magic, st-magic, -65537, xyz-add.z] + v2.x() += u32_as_float(ctrl_header.st_magic); + v2.y() += u32_as_float(ctrl_header.st_magic); + v2.z() += -65537; + v2.w() += frag.fp_header.z_add; + + vtx.pos = math::Vector3f(v0.w(), v1.w(), v2.w()); + vtx.nrm = math::Vector3f(v0.z(), v1.z(), v2.z()); + + // vtx.mat1 = 0; // not used like this + vtx.dst0 = float_as_u32(v1.x()) - 371; // xtop to output buffer offset + vtx.dst1 = float_as_u32(v1.y()) - 371; + vtx.rgba = frag.unsigned_four_including_header.at(rgba_ptr); + vtx.st = math::Vector2f(v2.x(), v2.y()); + + // crazy flag logic to set adc + s16 mat1_flag = mat1; + s16 mat0_flag = mat0; + bool dst0_adc, dst1_adc; + if (vtx.kind == 1) { + ASSERT(mat1_flag == -1 || mat1_flag == 0 || mat1_flag == 1); + dst0_adc = mat1_flag <= 0; + dst1_adc = dst0_adc && (mat1_flag != 0); + dst0_adc = !dst0_adc; + dst1_adc = !dst1_adc; + } else { + // adc logic + // ilw.y vi09, -6(vi01) + s16 vi09 = mat1_flag; + // move.xyzw vf21, vf08 + bool vf21_has_adc = false; + bool vf08_has_adc = false; + if (!(vi09 > 0)) { + vf21_has_adc = true; + } + // ibgtz vi09, L47 + // + // addx.w vf21, vf21, vf17 + // + // L47: + // ilw.x vi09, -9(vi01) + vi09 = mat0_flag; + // ftoi4.xyzw vf21, vf21 + // + // sq.xyzw vf21, 2(vi10) + dst0_adc = !vf21_has_adc; + if (!(vi09 >= 0)) { + vf21_has_adc = vf08_has_adc; + } + dst1_adc = !vf21_has_adc; + // ibgez vi09, L50 + // + // ftoi4.xyzw vf21, vf08 + // + // L50: + // sq.xyzw vf21, 2(vi13) + + // dst0_adc = mat1_flag <= 0; + // dst1_adc = dst0_adc && (mat0_flag >= 0); + // dst0_adc = !dst0_adc; + // dst1_adc = !dst1_adc; + // fmt::print("{}\n", dst1_adc); + } + + // write to two spots in memory + auto& dst0_mem = memory.memory.at(vtx.dst0); + auto& dst1_mem = memory.memory.at(vtx.dst1); + + dst0_mem.kind = MercOutputQuadword::Kind::VTX_START; + dst0_mem.vtx_idx = current_vtx_idx; + dst0_mem.adc = dst0_adc; + memory.memory.at(vtx.dst0 + 1).kind = MercOutputQuadword::Kind::INVALID; + memory.memory.at(vtx.dst0 + 2).kind = MercOutputQuadword::Kind::INVALID; + + dst1_mem.kind = MercOutputQuadword::Kind::VTX_START; + dst1_mem.vtx_idx = current_vtx_idx; + dst1_mem.adc = dst1_adc; + memory.memory.at(vtx.dst1 + 1).kind = MercOutputQuadword::Kind::INVALID; + memory.memory.at(vtx.dst1 + 2).kind = MercOutputQuadword::Kind::INVALID; + + /* + fmt::print("place vertex {} @ {} {}: {} (adc {} {}) {}\n", current_vtx_idx, vtx.dst0, vtx.dst1, + vtx.pos.to_string_aligned(), dst0_adc, dst1_adc, mat1_flag); + */ + + lump_ptr += 3; // advance 3 qw + rgba_ptr++; + } +} + +/*! + * Build OpenGL index list from a single GIF packet. + * TODO: should check we aren't putting in x x R x x R + */ +std::vector index_list_from_packet(u32 vtx_ptr, u32 nloop, const MercMemory& memory) { + std::vector result; + u32 prev_vtx = UINT32_MAX; + + result.push_back(UINT32_MAX); + while (nloop) { + auto& vtx_mem = memory.memory.at(vtx_ptr); + if (vtx_mem.kind == MercOutputQuadword::Kind::VTX_START) { + bool adc = vtx_mem.adc; + if (adc) { + result.push_back(vtx_mem.vtx_idx); + } else { + result.push_back(UINT32_MAX); + result.push_back(prev_vtx); + result.push_back(vtx_mem.vtx_idx); + } + prev_vtx = vtx_mem.vtx_idx; + } else { + // missing vertex! + fmt::print("MISSING VERTEX at {}\n", vtx_ptr); + result.push_back(UINT32_MAX); + } + + vtx_ptr += 3; + nloop--; + } + + result.push_back(UINT32_MAX); + return result; +} + +/*! + * Dump draws to obj file. + */ +std::string debug_dump_to_obj(const std::vector& draws, + const std::vector& vertices) { + std::string result; + std::vector verts; + std::vector> faces; + + for (auto& draw : draws) { + // add verts... + int queue[2]; + int q_idx = 0; + for (size_t ii = 2; ii < draw.indices.size(); ii++) { + u32 v0 = draw.indices[ii - 2]; + u32 v1 = draw.indices[ii - 1]; + u32 v2 = draw.indices[ii - 0]; + if (v0 != UINT32_MAX && v1 != UINT32_MAX && v2 != UINT32_MAX) { + faces.emplace_back(v0 + 1, v1 + 1, v2 + 1); + } + } + for (auto& idx : draw.indices) { + if (idx == UINT32_MAX) { + q_idx = 0; + } else { + if (q_idx >= 2) { + faces.emplace_back(queue[0] + 1, queue[1] + 1, idx + 1); + } + queue[(q_idx++) % 2] = idx; + } + } + } + + for (auto& vtx : vertices) { + result += fmt::format("v {} {} {}\n", vtx.pos.x() / 1024.f, vtx.pos.y() / 1024.f, + vtx.pos.z() / 1024.f); + } + + for (auto& face : faces) { + result += fmt::format("f {}/{} {}/{} {}/{}\n", face.x(), face.x(), face.y(), face.y(), face.z(), + face.z()); + } + + return result; +} + +math::Vector4 vtx_to_rgba_bone_debug(const MercUnpackedVtx& vtx) { + math::Vector4 result; + result.fill(0); + for (int i = 0; i < 3; i++) { + if (vtx.skel_mats[i] == -1 || vtx.mat_weights[i] == 0) { + continue; + } + u32 rgba_packed = colors::common_colors[vtx.skel_mats[i] % colors::COLOR_COUNT]; + result.x() += ((rgba_packed >> 16) & 0xff) * vtx.mat_weights[i]; + result.y() += ((rgba_packed >> 8) & 0xff) * vtx.mat_weights[i]; + result.z() += ((rgba_packed >> 0) & 0xff) * vtx.mat_weights[i]; + } + return result; +} + +std::string debug_dump_to_ply(const std::vector& draws, + const std::vector& vertices) { + std::vector verts; + std::vector> faces; + + for (auto& draw : draws) { + // add verts... + for (size_t ii = 2; ii < draw.indices.size(); ii++) { + u32 v0 = draw.indices[ii - 2]; + u32 v1 = draw.indices[ii - 1]; + u32 v2 = draw.indices[ii - 0]; + if (v0 != UINT32_MAX && v1 != UINT32_MAX && v2 != UINT32_MAX) { + faces.emplace_back(v0, v1, v2); + } + } + } + + std::string result = fmt::format( + "ply\nformat ascii 1.0\nelement vertex {}\nproperty float x\nproperty float y\nproperty " + "float z\nproperty uchar red\nproperty uchar green\nproperty uchar blue\nelement face " + "{}\nproperty list uchar int vertex_index\nend_header\n", + vertices.size(), faces.size()); + + for (auto& vtx : vertices) { + auto rgba = vtx_to_rgba_bone_debug(vtx); + result += fmt::format("{} {} {} {} {} {}\n", vtx.pos.x() / 1024.f, vtx.pos.y() / 1024.f, + vtx.pos.z() / 1024.f, rgba[0], rgba[1], rgba[2]); + } + + for (auto& face : faces) { + result += fmt::format("3 {} {} {}\n", face.x(), face.y(), face.z()); + } + + return result; +} + +ConvertedMercEffect convert_merc_effect(const MercEffect& input_effect, + const MercCtrlHeader& ctrl_header, + const TextureDB& tdb, + const std::vector& map, + const std::string& debug_name, + size_t ctrl_idx, + size_t effect_idx, + bool dump) { + ConvertedMercEffect result; + result.ctrl_idx = ctrl_idx; + result.effect_idx = effect_idx; + // full reset of state per effect. + // we have no idea what the previous effect draw will be - it might be given to + // mercneric. + bool shader_set = false; // no previous shader can reliably be known + MercState merc_state; // current gs settings/matrix slots + MercMemory merc_memories[2]; // double buffered output + int memory_buffer_toggle = 0; // which output we're in + + for (size_t fi = 0; fi < input_effect.frag_ctrl.size(); fi++) { + const auto& frag = input_effect.frag_geo[fi]; + const auto& frag_ctrl = input_effect.frag_ctrl[fi]; + + // first, deal with matrices + for (size_t mi = 0; mi < frag_ctrl.mat_xfer_count; mi++) { + const auto& xfer = frag_ctrl.mat_dest_data[mi]; + merc_state.vu1_matrix_slots[vu1_addr_to_matrix_slot(xfer.matrix_dest)] = xfer.matrix_number; + } + + if (!shader_set) { + // if we don't have a shader set, we shouldn't have anything that reuses the last shader + ASSERT(frag.header.strip_len == 0); + // and we should set the shader + ASSERT(frag.fp_header.shader_cnt > 0); + shader_set = true; + } + + // run the frag. + // this will add vertices to the per-effect vertex lists and also update the merc memory + // to point to these. + + handle_frag(debug_name, ctrl_header, frag, frag_ctrl, merc_state, result.vertices, + merc_memories[memory_buffer_toggle]); + + // we'll add draws after this draw, but wait to actually populate the index lists until + // we've processed all the vertices. + size_t first_draw_to_update = result.draws.size(); + + // continuation of a previous shader + if (frag.header.strip_len) { + // add the continued draw + auto& new_draw = result.draws.emplace_back(); + new_draw.ctrl_idx = ctrl_idx; + new_draw.effect_idx = effect_idx; + new_draw.frag_idx = fi; + new_draw.state = merc_state; + new_draw.vtx_offset = 1; + // just remember where it started. we might copy some vertices from a later draw in this + // fragment back to this draw, and at this point we don't know what the adc flags would be. + // (or their index, because we are deduplicated) + new_draw.vtx_nloop = frag.header.strip_len; + } + + // loop over fresh shaders + for (size_t i = 0; i < frag.fp_header.shader_cnt; i++) { + const auto& shader = frag.shaders.at(i); + // update merc state from shader (will hold over to next fragment, if needed) + merc_state.merc_draw_mode.mode = process_draw_mode(shader); + u32 new_tex = remap_texture(shader.original_tex, map); + + // texture the texture page/texture index, and convert to a PC port texture ID + u32 tpage = new_tex >> 20; + u32 tidx = (new_tex >> 8) & 0b1111'1111'1111; + u32 tex_combo = (((u32)tpage) << 16) | tidx; + // look up the texture to make sure it's valid + auto tex = tdb.textures.find(tex_combo); + ASSERT(tex != tdb.textures.end()); + // remember the texture id + merc_state.merc_draw_mode.pc_combo_tex_id = tex_combo; + + // add the draw + auto& new_draw = result.draws.emplace_back(); + new_draw.ctrl_idx = ctrl_idx; + new_draw.effect_idx = effect_idx; + new_draw.frag_idx = fi; + new_draw.state = merc_state; + // write the shader to memory + merc_memories[memory_buffer_toggle].memory.at(shader.output_offset).kind = + MercOutputQuadword::Kind::SHADER_START; + for (int mi = 1; mi < 6; mi++) { + // fill 5qw of adgif data with invalid. make sure we don't read verts from here + merc_memories[memory_buffer_toggle].memory.at(shader.output_offset + mi).kind = + MercOutputQuadword::Kind::INVALID; + } + // write the giftag for primitives + auto& prim_packet = merc_memories[memory_buffer_toggle].memory.at(shader.output_offset + 6); + prim_packet.kind = MercOutputQuadword::Kind::PRIM_START; + prim_packet.nloop_count = shader.next_strip_nloop; + + // update draw from hidden fields in adgif. + new_draw.vtx_offset = shader.output_offset + 7; + new_draw.vtx_nloop = shader.next_strip_nloop; + } + + // copy from other places inside this output buffer + u32 srcdst_ptr = frag.header.srcdest_off; + for (u32 sci = 0; sci < frag.header.samecopy_cnt; sci++) { + auto& cpy = frag.unsigned_four_including_header[srcdst_ptr]; + // fmt::print("sci: {}\n", cpy.to_string_hex_byte()); + u32 src = cpy[0]; + auto& vert = merc_memories[memory_buffer_toggle].memory.at(src); + u32 dst = cpy[1]; + auto& dvert = merc_memories[memory_buffer_toggle].memory.at(dst); + if (vert.kind == MercOutputQuadword::Kind::VTX_START) { + dvert = vert; + if (cpy[3]) { + // dvert.adc = true; + dvert.adc = !dvert.adc; + } + } else { + fmt::print("sc missing vert\n"); + dvert.kind = MercOutputQuadword::Kind::INVALID; + } + + srcdst_ptr++; + } + + // "cross" copy from the other output buffer + for (u32 cci = 0; cci < frag.header.crosscopy_cnt; cci++) { + auto& cpy = frag.unsigned_four_including_header[srcdst_ptr]; + // fmt::print("cci: {}\n", cpy.to_string_hex_byte()); + u32 src = cpy[0]; + auto& vert = merc_memories[memory_buffer_toggle ^ 1].memory.at(src); + u32 dst = cpy[1]; + auto& dvert = merc_memories[memory_buffer_toggle].memory.at(dst); + if (vert.kind == MercOutputQuadword::Kind::VTX_START) { + dvert = vert; + if (cpy[3]) { + // dvert.adc = true; + dvert.adc = !dvert.adc; + } + } else { + fmt::print("cc missing vert\n"); + dvert.kind = MercOutputQuadword::Kind::INVALID; + } + srcdst_ptr++; + } + + // now that we've copied all vertices, create index lists. + for (size_t i = first_draw_to_update; i < result.draws.size(); i++) { + auto& draw = result.draws[i]; + draw.indices = index_list_from_packet(draw.vtx_offset, draw.vtx_nloop, + merc_memories[memory_buffer_toggle]); + } + + memory_buffer_toggle ^= 1; + } + + if (dump) { + file_util::write_text_file( + file_util::get_file_path( + {"debug_out/merc", fmt::format("{}_{}.ply", debug_name, effect_idx)}), + debug_dump_to_ply(result.draws, result.vertices)); + } + + return result; +} + +u8 convert_mat(int in) { + if (in >= 0) { + return in; + } else { + return 0; + } +} + +tfrag3::MercVertex convert_vertex(const MercUnpackedVtx& vtx) { + tfrag3::MercVertex out; + out.pos[0] = vtx.pos[0]; + out.pos[1] = vtx.pos[1]; + out.pos[2] = vtx.pos[2]; + out.pad0 = 0; + out.normal[0] = vtx.nrm[0]; + out.normal[1] = vtx.nrm[1]; + out.normal[2] = vtx.nrm[2]; + out.pad1 = 0; + out.weights[0] = vtx.mat_weights[0]; + out.weights[1] = vtx.mat_weights[1]; + out.weights[2] = vtx.mat_weights[2]; + out.pad2 = 0; + out.st[0] = vtx.st[0]; + out.st[1] = vtx.st[1]; + out.rgba[0] = vtx.rgba[0]; + out.rgba[1] = vtx.rgba[1]; + out.rgba[2] = vtx.rgba[2]; + out.rgba[3] = vtx.rgba[3]; + out.mats[0] = convert_mat(vtx.skel_mats[0]); + out.mats[1] = convert_mat(vtx.skel_mats[1]); + out.mats[2] = convert_mat(vtx.skel_mats[2]); + out.pad3 = 0; + return out; +} + +/*! + * Top-level merc extraction + */ +void extract_merc(const ObjectFileData& ag_data, + const TextureDB& tex_db, + const DecompilerTypeSystem& dts, + const std::vector& map, + tfrag3::Level& out, + bool dump_level) { + if (dump_level) { + file_util::create_dir_if_needed(file_util::get_file_path({"debug_out/merc"})); + } + // find all merc-ctrls in the object file + auto ctrl_locations = find_merc_ctrls(ag_data.linked_data); + + // extract them. this does very basic unpacking of data, as done by the VIF/DMA on PS2. + std::vector ctrls; + for (auto location : ctrl_locations) { + auto ctrl = extract_merc_ctrl(ag_data.linked_data, dts, location); + ctrls.push_back(ctrl); + } + + // extract draws. this does no regrouping yet. + std::vector> all_effects; + for (size_t ci = 0; ci < ctrls.size(); ci++) { + auto& effects_in_ctrl = all_effects.emplace_back(); + for (size_t ei = 0; ei < ctrls[ci].effects.size(); ei++) { + effects_in_ctrl.push_back(convert_merc_effect(ctrls[ci].effects[ei], ctrls[ci].header, tex_db, + map, ctrls[ci].name, ci, ei, dump_level)); + } + } + + // convert to PC format + // first pass, before merging indices + u32 first_model = out.merc_data.models.size(); + std::vector>>> indices_temp; // ctrl, effect, draw, vtx + for (size_t ci = 0; ci < ctrls.size(); ci++) { + indices_temp.emplace_back(); + auto& pc_ctrl = out.merc_data.models.emplace_back(); + auto& ctrl = ctrls[ci]; + + pc_ctrl.name = ctrl.name; + pc_ctrl.scale_xyz = ctrl.header.xyz_scale; + pc_ctrl.max_draws = 0; + pc_ctrl.max_bones = 0; + + for (size_t ei = 0; ei < ctrls[ci].effects.size(); ei++) { + indices_temp[ci].emplace_back(); + auto& pc_effect = pc_ctrl.effects.emplace_back(); + auto& effect = all_effects[ci][ei]; + u32 first_vertex = out.merc_data.vertices.size(); + for (auto& vtx : effect.vertices) { + auto cvtx = convert_vertex(vtx); + out.merc_data.vertices.push_back(cvtx); + for (int i = 0; i < 3; i++) { + pc_ctrl.max_bones = std::max(pc_ctrl.max_bones, (u32)cvtx.mats[i]); + } + } + + // can do two types of de-duplication: toggling back and forth shaders and matrices + std::map draw_mode_dedup; + + for (auto& draw : effect.draws) { + pc_ctrl.max_draws++; + indices_temp[ci][ei].emplace_back(); + // find draw to add to, or create a new one + const auto& existing = draw_mode_dedup.find(draw.state.merc_draw_mode.as_u64()); + tfrag3::MercDraw* pc_draw = nullptr; + u64 pc_draw_idx = -1; + if (existing == draw_mode_dedup.end()) { + pc_draw_idx = pc_effect.draws.size(); + draw_mode_dedup[draw.state.merc_draw_mode.as_u64()] = pc_draw_idx; + pc_draw = &pc_effect.draws.emplace_back(); + pc_draw->mode = draw.state.merc_draw_mode.mode; + + u32 idx_in_level_texture = UINT32_MAX; + for (u32 i = 0; i < out.textures.size(); i++) { + if (out.textures[i].combo_id == draw.state.merc_draw_mode.pc_combo_tex_id) { + idx_in_level_texture = i; + break; + } + } + + if (idx_in_level_texture == UINT32_MAX) { + // not added to level, add it + auto tex_it = tex_db.textures.find(draw.state.merc_draw_mode.pc_combo_tex_id); + if (tex_it == tex_db.textures.end()) { + ASSERT(false); + } else { + idx_in_level_texture = out.textures.size(); + auto& new_tex = out.textures.emplace_back(); + new_tex.combo_id = draw.state.merc_draw_mode.pc_combo_tex_id; + new_tex.w = tex_it->second.w; + new_tex.h = tex_it->second.h; + new_tex.debug_name = tex_it->second.name; + new_tex.debug_tpage_name = tex_db.tpage_names.at(tex_it->second.page); + new_tex.data = tex_it->second.rgba_bytes; + } + } + + pc_draw->tree_tex_id = idx_in_level_texture; + } else { + pc_draw_idx = existing->second; + pc_draw = &pc_effect.draws.at(pc_draw_idx); + } + + for (auto idx : draw.indices) { + if (idx == UINT32_MAX) { + indices_temp[ci][ei][pc_draw_idx].push_back(idx); + } else { + indices_temp[ci][ei][pc_draw_idx].push_back(idx + first_vertex); + } + } + } + } + } + + // merge indices + for (size_t ci = 0; ci < ctrls.size(); ci++) { + auto& pc_ctrl = out.merc_data.models.at(ci + first_model); + for (size_t ei = 0; ei < ctrls[ci].effects.size(); ei++) { + auto& pc_effect = pc_ctrl.effects.at(ei); + for (size_t di = 0; di < pc_effect.draws.size(); di++) { + auto& pc_draw = pc_effect.draws.at(di); + auto& inds = indices_temp[ci][ei][di]; + pc_draw.num_triangles = clean_up_vertex_indices(inds); + pc_draw.first_index = out.merc_data.indices.size(); + pc_draw.index_count = inds.size(); + out.merc_data.indices.insert(out.merc_data.indices.end(), inds.begin(), inds.end()); + } + } + } +} +} // namespace decompiler diff --git a/decompiler/level_extractor/extract_merc.h b/decompiler/level_extractor/extract_merc.h new file mode 100644 index 0000000000..35e1a1c3b3 --- /dev/null +++ b/decompiler/level_extractor/extract_merc.h @@ -0,0 +1,17 @@ +#pragma once + +#include "common/custom_data/Tfrag3Data.h" + +#include "decompiler/ObjectFile/ObjectFileDB.h" +#include "decompiler/data/TextureDB.h" +#include "decompiler/level_extractor/common_formats.h" + +namespace decompiler { + +void extract_merc(const ObjectFileData& ag_data, + const TextureDB& tex_db, + const DecompilerTypeSystem& dts, + const std::vector& map, + tfrag3::Level& out, + bool dump_level); +} diff --git a/decompiler/level_extractor/extract_shrub.cpp b/decompiler/level_extractor/extract_shrub.cpp index fa6ecf6421..48daeba7c6 100644 --- a/decompiler/level_extractor/extract_shrub.cpp +++ b/decompiler/level_extractor/extract_shrub.cpp @@ -1,11 +1,12 @@ -#include - #include "extract_shrub.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" +#include #include "common/util/FileUtil.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "decompiler/level_extractor/extract_common.h" + namespace decompiler { using namespace level_tools; @@ -129,8 +130,7 @@ u32 remap_texture(u32 original, const std::vector& ma auto masked = original & 0xffffff00; for (auto& t : map) { if (t.original_texid == masked) { - fmt::print("OKAY! remapped!\n"); - ASSERT(false); + ASSERT_MSG(false, "OKAY! remapped!"); return t.new_texid | 20; } } @@ -396,53 +396,11 @@ std::string dump_full_to_obj(const std::vector& protos) { return result; } -u32 clean_up_vertex_indices(std::vector& idx) { - std::vector fixed; - u32 num_tris = 0; - - bool looking_for_start = true; - size_t i_of_start; - for (size_t i = 0; i < idx.size(); i++) { - if (looking_for_start) { - if (idx[i] != UINT32_MAX) { - looking_for_start = false; - i_of_start = i; - } - } else { - if (idx[i] == UINT32_MAX) { - looking_for_start = true; - size_t num_verts = i - i_of_start; - if (num_verts >= 3) { - if (!fixed.empty()) { - fixed.push_back(UINT32_MAX); - } - fixed.insert(fixed.end(), idx.begin() + i_of_start, idx.begin() + i); - num_tris += (num_verts - 2); - } - } - } - } - - if (!looking_for_start) { - size_t num_verts = idx.size() - i_of_start; - if (num_verts >= 3) { - if (!fixed.empty()) { - fixed.push_back(UINT32_MAX); - } - fixed.insert(fixed.end(), idx.begin() + i_of_start, idx.begin() + idx.size()); - num_tris += (num_verts - 2); - } - } - - idx = std::move(fixed); - - return num_tris; -} - void make_draws(tfrag3::Level& lev, tfrag3::ShrubTree& tree_out, const std::vector& protos, const TextureDB& tdb) { + std::vector> indices_regrouped_by_draw; std::unordered_map> static_draws_by_tex; size_t global_vert_counter = 0; for (auto& proto : protos) { @@ -501,14 +459,13 @@ void make_draws(tfrag3::Level& lev, // we're missing a texture, just use the first one. tex_it = tdb.textures.begin(); } else { - fmt::print( - "texture {} wasn't found. make sure it is loaded somehow. You may need to " - "include " - "ART.DGO or GAME.DGO in addition to the level DGOs for shared textures.\n", - combo_tex); - fmt::print("tpage is {}\n", combo_tex >> 16); - fmt::print("id is {} (0x{:x})\n", combo_tex & 0xffff, combo_tex & 0xffff); - ASSERT(false); + ASSERT_MSG( + false, + fmt::format( + "texture {} wasn't found. make sure it is loaded somehow. You may need to " + "include ART.DGO or GAME.DGO in addition to the level DGOs for shared " + "textures. tpage is {} id is {} (0x{:x})", + combo_tex, combo_tex >> 16, combo_tex & 0xffff, combo_tex & 0xffff)); } } // add a new texture to the level data @@ -528,10 +485,12 @@ void make_draws(tfrag3::Level& lev, // okay, we now have a texture and draw mode, let's see if we can add to an existing... auto existing_draws_in_tex = static_draws_by_tex.find(idx_in_lev_data); tfrag3::ShrubDraw* draw_to_add_to = nullptr; + std::vector* verts_to_add_to = nullptr; if (existing_draws_in_tex != static_draws_by_tex.end()) { for (auto idx : existing_draws_in_tex->second) { if (tree_out.static_draws.at(idx).mode == mode) { draw_to_add_to = &tree_out.static_draws[idx]; + verts_to_add_to = &indices_regrouped_by_draw[idx]; } } } @@ -543,6 +502,7 @@ void make_draws(tfrag3::Level& lev, draw_to_add_to = &tree_out.static_draws.back(); draw_to_add_to->mode = mode; draw_to_add_to->tree_tex_id = idx_in_lev_data; + verts_to_add_to = &indices_regrouped_by_draw.emplace_back(); } // now we have a draw, time to add vertices @@ -556,25 +516,30 @@ void make_draws(tfrag3::Level& lev, for (size_t vidx = 0; vidx < draw.vertices.size(); vidx++) { if (draw.vertices[vidx].adc) { - draw_to_add_to->vertex_index_stream.push_back(vidx + global_vert_counter); + verts_to_add_to->push_back(vidx + global_vert_counter); draw_to_add_to->num_triangles++; } else { - draw_to_add_to->vertex_index_stream.push_back(UINT32_MAX); - draw_to_add_to->vertex_index_stream.push_back(vidx + global_vert_counter - 1); - draw_to_add_to->vertex_index_stream.push_back(vidx + global_vert_counter); + verts_to_add_to->push_back(UINT32_MAX); + verts_to_add_to->push_back(vidx + global_vert_counter - 1); + verts_to_add_to->push_back(vidx + global_vert_counter); } } - draw_to_add_to->vertex_index_stream.push_back(UINT32_MAX); - + verts_to_add_to->push_back(UINT32_MAX); global_vert_counter += draw.vertices.size(); } } } } - for (auto& draw : tree_out.static_draws) { - draw.num_triangles = clean_up_vertex_indices(draw.vertex_index_stream); + for (size_t didx = 0; didx < tree_out.static_draws.size(); didx++) { + auto& draw = tree_out.static_draws[didx]; + auto& inds = indices_regrouped_by_draw[didx]; + draw.num_triangles = clean_up_vertex_indices(inds); + draw.num_indices = inds.size(); + draw.first_index_index = tree_out.indices.size(); + tree_out.indices.insert(tree_out.indices.end(), inds.begin(), inds.end()); } + tree_out.packed_vertices.total_vertex_count = global_vert_counter; } diff --git a/decompiler/level_extractor/extract_shrub.h b/decompiler/level_extractor/extract_shrub.h index 772615ea92..c57fc376bb 100644 --- a/decompiler/level_extractor/extract_shrub.h +++ b/decompiler/level_extractor/extract_shrub.h @@ -1,9 +1,10 @@ #pragma once -#include "decompiler/level_extractor/BspHeader.h" -#include "common/math/Vector.h" #include "common/custom_data/Tfrag3Data.h" +#include "common/math/Vector.h" + #include "decompiler/data/TextureDB.h" +#include "decompiler/level_extractor/BspHeader.h" namespace decompiler { diff --git a/decompiler/level_extractor/extract_tfrag.cpp b/decompiler/level_extractor/extract_tfrag.cpp index bec1c02b14..6e4c2dd2e3 100644 --- a/decompiler/level_extractor/extract_tfrag.cpp +++ b/decompiler/level_extractor/extract_tfrag.cpp @@ -1,10 +1,13 @@ #include "extract_tfrag.h" + +#include "common/custom_data/pack_helpers.h" #include "common/dma/dma.h" -#include "decompiler/util/Error.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "common/util/FileUtil.h" #include "common/dma/gs.h" #include "common/util/Assert.h" +#include "common/util/FileUtil.h" + +#include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "decompiler/util/Error.h" namespace decompiler { namespace { @@ -1760,10 +1763,9 @@ void update_mode_from_alpha1(u64 val, DrawMode& mode) { mode.set_alpha_blend(DrawMode::AlphaBlend::SRC_0_FIX_DST); // src plus dest } else { - fmt::print("unsupported blend: a {} b {} c {} d {}\n", (int)reg.a_mode(), (int)reg.b_mode(), - (int)reg.c_mode(), (int)reg.d_mode()); mode.set_alpha_blend(DrawMode::AlphaBlend::SRC_DST_SRC_DST); - ASSERT(false); + ASSERT_MSG(false, fmt::format("unsupported blend: a {} b {} c {} d {}", (int)reg.a_mode(), + (int)reg.b_mode(), (int)reg.c_mode(), (int)reg.d_mode())); } } @@ -1786,9 +1788,8 @@ void update_mode_from_test1(u64 val, DrawMode& mode) { mode.set_alpha_test(DrawMode::AlphaTest::NEVER); break; default: - fmt::print("Alpha test: {} not supported\n", (int)test.alpha_test()); mode.set_alpha_test(DrawMode::AlphaTest::ALWAYS); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Alpha test: {} not supported", (int)test.alpha_test())); } // AREF @@ -1909,8 +1910,7 @@ void process_draw_mode(std::vector& all_draws, break; case GsRegisterAddress::CLAMP_1: if (!(val == 0b101 || val == 0 || val == 1 || val == 0b100)) { - fmt::print("clamp: 0x{:x}\n", val); - ASSERT(false); + ASSERT_MSG(false, fmt::format("clamp: 0x{:x}", val)); } // this isn't quite right, but I'm hoping it's enough! @@ -2014,13 +2014,14 @@ void make_tfrag3_data(std::map>& draws, // we're missing a texture, just use the first one. tex_it = tdb.textures.begin(); } else { - fmt::print( - "texture {} wasn't found. make sure it is loaded somehow. You may need to include " - "ART.DGO or GAME.DGO in addition to the level DGOs for shared textures.\n", - combo_tex_id); - fmt::print("tpage is {}\n", combo_tex_id >> 16); - fmt::print("id is {} (0x{:x})\n", combo_tex_id & 0xffff, combo_tex_id & 0xffff); - ASSERT(false); + ASSERT_MSG( + false, + fmt::format("texture {} wasn't found. make sure it is loaded somehow. You may need " + "to include " + "ART.DGO or GAME.DGO in addition to the level DGOs for shared textures." + "tpage is {}. id is {} (0x{:x})", + combo_tex_id, combo_tex_id >> 16, combo_tex_id & 0xffff, + combo_tex_id & 0xffff)); } } tfrag3_tex_id = texture_pool.size(); @@ -2043,7 +2044,8 @@ void make_tfrag3_data(std::map>& draws, for (auto& strip : draw.strips) { tfrag3::StripDraw::VisGroup vgroup; vgroup.vis_idx_in_pc_bvh = strip.tfrag_id; // associate with the tfrag for culling - vgroup.num = strip.verts.size() + 1; // one for the primitive restart! + vgroup.num_inds = strip.verts.size() + 1; // one for the primitive restart! + vgroup.num_tris = strip.verts.size() - 2; tdraw.num_triangles += strip.verts.size() - 2; tfrag3::StripDraw::VertexRun run; @@ -2057,9 +2059,9 @@ void make_tfrag3_data(std::map>& draws, vtx.z = vert.pre_cam_trans_pos.z(); vtx.s = vert.stq.x(); vtx.t = vert.stq.y(); - vtx.q = vert.stq.z(); + vtx.q_unused = vert.stq.z(); // if this is true, we can remove a divide in the shader - ASSERT(vtx.q == 1.f); + ASSERT(vtx.q_unused == 1.f); vtx.color_index = vert.rgba / 4; // ASSERT((vert.rgba >> 2) < 1024); spider cave has 2048? ASSERT((vert.rgba & 3) == 0); @@ -2127,7 +2129,8 @@ void merge_groups(std::vector& grps) { result.push_back(grps.at(0)); for (size_t i = 1; i < grps.size(); i++) { if (grps[i].vis_idx_in_pc_bvh == result.back().vis_idx_in_pc_bvh) { - result.back().num += grps[i].num; + result.back().num_inds += grps[i].num_inds; + result.back().num_tris += grps[i].num_tris; } else { result.push_back(grps[i]); } @@ -2137,85 +2140,6 @@ void merge_groups(std::vector& grps) { } // namespace -constexpr float kClusterSize = 4096 * 40; // 100 in-game meters -constexpr float kMasterOffset = 12000 * 4096; - -std::pair position_to_cluster_and_offset(float in) { - in += kMasterOffset; - if (in < 0) { - fmt::print("negative: {}\n", in); - } - ASSERT(in >= 0); - int cluster_cell = (in / kClusterSize); - float leftover = in - (cluster_cell * kClusterSize); - u16 offset = (leftover / kClusterSize) * float(UINT16_MAX); - - float recovered = ((float)cluster_cell + ((float)offset / UINT16_MAX)) * kClusterSize; - float diff = std::fabs(recovered - in); - ASSERT(diff < 7); - ASSERT(cluster_cell >= 0); - ASSERT(cluster_cell < UINT16_MAX); - return {cluster_cell, offset}; -} - -void pack_vertices(tfrag3::PackedTfragVertices* result, - const std::vector& vertices) { - u32 next_cluster_idx = 0; - std::map clusters; - - for (auto& vtx : vertices) { - auto x = position_to_cluster_and_offset(vtx.x); - auto y = position_to_cluster_and_offset(vtx.y); - auto z = position_to_cluster_and_offset(vtx.z); - u64 cluster_id = 0; - cluster_id |= x.first; - cluster_id |= (y.first << 16); - cluster_id |= (z.first << 32); - - auto cluster_it = clusters.find(cluster_id); - u32 my_cluster_idx = 0; - if (cluster_it == clusters.end()) { - // first in cluster - clusters[cluster_id] = next_cluster_idx; - my_cluster_idx = next_cluster_idx; - next_cluster_idx++; - } else { - my_cluster_idx = cluster_it->second; - } - - tfrag3::PackedTfragVertices::Vertex out_vtx; - out_vtx.xoff = x.second; - out_vtx.yoff = y.second; - out_vtx.zoff = z.second; - out_vtx.cluster_idx = my_cluster_idx; - // TODO check these - out_vtx.s = vtx.s * 1024; - out_vtx.t = vtx.t * 1024; - out_vtx.color_index = vtx.color_index; - result->vertices.push_back(out_vtx); - } - - result->cluster_origins.resize(next_cluster_idx); - for (auto& cluster : clusters) { - auto& res = result->cluster_origins[cluster.second]; - res.x() = (u16)cluster.first; - res.y() = (u16)(cluster.first >> 16); - res.z() = (u16)(cluster.first >> 32); - } - - /* - std::unordered_set - a; - for (auto& v : result->vertices) { - a.insert(v); - } - fmt::print("SIZE: {} vs {} {}\n", a.size(), result->vertices.size(), - (float)a.size() / result->vertices.size()); - */ - - ASSERT(next_cluster_idx < UINT16_MAX); -} - void extract_tfrag(const level_tools::DrawableTreeTfrag* tree, const std::string& debug_name, const std::vector& map, @@ -2237,8 +2161,7 @@ void extract_tfrag(const level_tools::DrawableTreeTfrag* tree, } else if (tree->my_type() == "drawable-tree-trans-tfrag") { this_tree.kind = tfrag3::TFragmentTreeKind::TRANS; } else { - fmt::print("unknown tfrag tree kind: {}\n", tree->my_type()); - ASSERT(false); + ASSERT_MSG(false, fmt::format("unknown tfrag tree kind: {}", tree->my_type())); } ASSERT(tree->length == (int)tree->arrays.size()); @@ -2283,7 +2206,7 @@ void extract_tfrag(const level_tools::DrawableTreeTfrag* tree, std::vector vertices; emulate_tfrags(geom, as_tfrag_array->tfragments, debug_name, map, out, this_tree, vertices, tex_db, expected_missing_textures, dump_level); - pack_vertices(&this_tree.packed_vertices, vertices); + pack_tfrag_vertices(&this_tree.packed_vertices, vertices); extract_time_of_day(tree, this_tree); for (auto& draw : this_tree.draws) { diff --git a/decompiler/level_extractor/extract_tfrag.h b/decompiler/level_extractor/extract_tfrag.h index dbe176661b..9d4d91dbd7 100644 --- a/decompiler/level_extractor/extract_tfrag.h +++ b/decompiler/level_extractor/extract_tfrag.h @@ -1,9 +1,10 @@ #pragma once -#include "decompiler/level_extractor/BspHeader.h" -#include "common/math/Vector.h" #include "common/custom_data/Tfrag3Data.h" +#include "common/math/Vector.h" + #include "decompiler/data/TextureDB.h" +#include "decompiler/level_extractor/BspHeader.h" namespace decompiler { diff --git a/decompiler/level_extractor/extract_tie.cpp b/decompiler/level_extractor/extract_tie.cpp index 44663efc6b..acaeff9fac 100644 --- a/decompiler/level_extractor/extract_tie.cpp +++ b/decompiler/level_extractor/extract_tie.cpp @@ -1,11 +1,11 @@ -#include - #include "extract_tie.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" +#include #include "common/util/FileUtil.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" + namespace decompiler { /// @@ -325,7 +325,7 @@ struct TieFrag { u16 tgt_ip1_ptr = 0; u16 tgt_ip2_ptr = 0; u16 kick_addr = 0; - u16 clr_ptr = 0; + // u16 clr_ptr = 0; u16 point_ptr = 0; u16 misc_x = 0; // at 971's x. math::Vector4f gifbufs; @@ -464,8 +464,7 @@ u32 remap_texture(u32 original, const std::vector& ma auto masked = original & 0xffffff00; for (auto& t : map) { if (t.original_texid == masked) { - fmt::print("OKAY! remapped!\n"); - ASSERT(false); + ASSERT_MSG(false, "OKAY! remapped!"); return t.new_texid | 20; } } @@ -1251,7 +1250,7 @@ void emulate_tie_prototype_program(std::vector& protos) { // iaddi vi15, vi00, 0x0 | nop frag.prog_info.kick_addr = 0; // mtir vi03, vf_clrbuf.x | nop - frag.prog_info.clr_ptr = 198; // just forcing it to one buffer for now + // frag.prog_info.clr_ptr = 198; // just forcing it to one buffer for now // iaddiu vi_point_ptr, vi00, 0x32 | nop frag.prog_info.point_ptr = 0x32; @@ -1316,7 +1315,7 @@ void emulate_tie_instance_program(std::vector& protos) { // we omit the pipeline startup here. // this was set by the previous program that sets up this prototype frag - u16 clr_ptr = frag.prog_info.clr_ptr; + // u16 clr_ptr = frag.prog_info.clr_ptr; u16 tgt_bp1_ptr = frag.prog_info.tgt_bp1_ptr; u16 tgt_bp2_ptr = frag.prog_info.tgt_bp2_ptr; u16 tgt_ip1_ptr = frag.prog_info.tgt_ip1_ptr; @@ -1359,7 +1358,7 @@ void emulate_tie_instance_program(std::vector& protos) { // iaddi vi_clr_ptr, vi_clr_ptr, 0x7 | nop // u16 clr_ptr_base = clr_ptr; - clr_ptr += 6; // it says 7, but we want to point to the first index data. + // clr_ptr += 6; // it says 7, but we want to point to the first index data. // mtir vi_ind, vf_inds.y | addx.w vf_res13, vf_res02, vf00 <- flags crap // div Q, vf00.w, vf_pos02.w | mulaw.xyzw ACC, vf_clr2, vf00 @@ -2012,8 +2011,7 @@ DrawMode process_draw_mode(const AdgifInfo& info, bool use_atest, bool use_decal // the clamp matters if (!(info.clamp_val == 0b101 || info.clamp_val == 0 || info.clamp_val == 1 || info.clamp_val == 0b100)) { - fmt::print("clamp: 0x{:x}\n", info.clamp_val); - ASSERT(false); + ASSERT_MSG(false, fmt::format("clamp: 0x{:x}", info.clamp_val)); } mode.set_clamp_s_enable(info.clamp_val & 0b1); @@ -2036,6 +2034,10 @@ void add_vertices_and_static_draw(tfrag3::TieTree& tree, // loop over all prototypes for (auto& proto : protos) { + if (proto.uses_generic) { + // generic ties go through generic + continue; + } // bool using_wind = true; // hack, for testing bool using_wind = proto.stiffness != 0.f; @@ -2104,14 +2106,13 @@ void add_vertices_and_static_draw(tfrag3::TieTree& tree, // we're missing a texture, just use the first one. tex_it = tdb.textures.begin(); } else { - fmt::print( - "texture {} wasn't found. make sure it is loaded somehow. You may need to " - "include " - "ART.DGO or GAME.DGO in addition to the level DGOs for shared textures.\n", - combo_tex); - fmt::print("tpage is {}\n", combo_tex >> 16); - fmt::print("id is {} (0x{:x})\n", combo_tex & 0xffff, combo_tex & 0xffff); - ASSERT(false); + ASSERT_MSG( + false, + fmt::format( + "texture {} wasn't found. make sure it is loaded somehow. You may need to " + "include ART.DGO or GAME.DGO in addition to the level DGOs for shared " + "textures. tpage is {}. id is {} (0x{:x})", + combo_tex, combo_tex >> 16, combo_tex & 0xffff, combo_tex & 0xffff)); } } // add a new texture to the level data @@ -2211,8 +2212,9 @@ void add_vertices_and_static_draw(tfrag3::TieTree& tree, // now we have a draw, time to add vertices tfrag3::StripDraw::VisGroup vgroup; - vgroup.vis_idx_in_pc_bvh = inst.vis_id; // associate with the instance for culling - vgroup.num = strip.verts.size() + 1; // one for the primitive restart! + vgroup.vis_idx_in_pc_bvh = inst.vis_id; // associate with the instance for culling + vgroup.num_inds = strip.verts.size() + 1; // one for the primitive restart! + vgroup.num_tris = strip.verts.size() - 2; draw_to_add_to->num_triangles += strip.verts.size() - 2; tfrag3::PackedTieVertices::MatrixGroup grp; grp.matrix_idx = matrix_idx; @@ -2275,7 +2277,8 @@ void merge_groups(std::vector& grps) { result.push_back(grps.at(0)); for (size_t i = 1; i < grps.size(); i++) { if (grps[i].vis_idx_in_pc_bvh == result.back().vis_idx_in_pc_bvh) { - result.back().num += grps[i].num; + result.back().num_tris += grps[i].num_tris; + result.back().num_inds += grps[i].num_inds; } else { result.push_back(grps[i]); } diff --git a/decompiler/level_extractor/extract_tie.h b/decompiler/level_extractor/extract_tie.h index 59c5b167f5..6429a775ee 100644 --- a/decompiler/level_extractor/extract_tie.h +++ b/decompiler/level_extractor/extract_tie.h @@ -1,10 +1,12 @@ #pragma once #include "extract_tie.h" -#include "decompiler/level_extractor/BspHeader.h" -#include "decompiler/data/TextureDB.h" + #include "common/custom_data/Tfrag3Data.h" +#include "decompiler/data/TextureDB.h" +#include "decompiler/level_extractor/BspHeader.h" + namespace decompiler { void extract_tie(const level_tools::DrawableTreeInstanceTie* tree, diff --git a/decompiler/main.cpp b/decompiler/main.cpp index ebcf610a66..cf4e02d69f 100644 --- a/decompiler/main.cpp +++ b/decompiler/main.cpp @@ -1,29 +1,35 @@ #include #include #include -#include "ObjectFile/ObjectFileDB.h" -#include "common/log/log.h" + #include "config.h" + +#include "common/log/log.h" #include "common/util/FileUtil.h" +#include "common/util/Timer.h" +#include "common/util/diff.h" +#include "common/util/os.h" #include "common/versions.h" + +#include "ObjectFile/ObjectFileDB.h" +#include "decompiler/data/TextureDB.h" #include "decompiler/data/streamed_audio.h" #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)); + Timer decomp_timer; + fmt::print("[Mem] Top of main: {} MB\n", get_peak_rss() / (1024 * 1024)); using namespace decompiler; + if (!file_util::setup_project_path(std::nullopt)) { + return 1; + } lg::set_file(file_util::get_file_path({"log/decompiler.txt"})); lg::set_file_level(lg::level::info); lg::set_stdout_level(lg::level::info); lg::set_flush_level(lg::level::info); lg::initialize(); - lg::info("GOAL Decompiler version {}\n", versions::DECOMPILER_VERSION); - file_util::init_crc(); init_opcode_info(); if (argc < 4) { @@ -147,17 +153,20 @@ int main(int argc, char** argv) { db.process_labels(); fmt::print("[Mem] After code: {} MB\n", get_peak_rss() / (1024 * 1024)); + // top level decompile (do this before printing asm so we get function names) + if (config.find_functions) { + db.ir2_top_level_pass(config); + } + // print disassembly if (config.disassemble_code || config.disassemble_data) { db.write_disassembly(out_folder, config.disassemble_data, config.disassemble_code, config.write_hex_near_instructions); } - // regenerate all-types if needed - if (config.regenerate_all_types) { - db.analyze_functions_ir1(config); - file_util::write_text_file(file_util::combine_path(out_folder, "type_defs.gc"), - db.all_type_defs); + // process art groups (used in decompilation) + if (config.decompile_code || config.process_art_groups) { + db.extract_art_info(); } // main decompile. @@ -165,12 +174,24 @@ int main(int argc, char** argv) { db.analyze_functions_ir2(out_folder, config, {}); } + if (config.generate_all_types) { + ASSERT_MSG(config.decompile_code, "Must decompile code to generate all-types"); + db.ir2_analyze_all_types(file_util::combine_path(out_folder, "new-all-types.gc"), + config.old_all_types_file, + config.hacks.types_with_bad_inspect_methods); + } + fmt::print("[Mem] After decomp: {} MB\n", get_peak_rss() / (1024 * 1024)); // write out all symbols file_util::write_text_file(file_util::combine_path(out_folder, "all-syms.gc"), db.dts.dump_symbol_types()); + // write art groups + if (config.process_art_groups) { + db.dump_art_info(out_folder); + } + if (config.hexdump_code || config.hexdump_data) { db.write_object_file_words(out_folder, config.hexdump_data, config.hexdump_code); } @@ -212,10 +233,8 @@ int main(int argc, char** argv) { } if (config.levels_extract) { - extract_common(db, tex_db, "GAME.CGO"); - for (auto& lev : config.levels_to_extract) { - extract_from_level(db, tex_db, lev, config.hacks, config.rip_levels); - } + extract_all_levels(db, tex_db, config.levels_to_extract, "GAME.CGO", config.hacks, + config.rip_levels, config.extract_collision); } fmt::print("[Mem] After extraction: {} MB\n", get_peak_rss() / (1024 * 1024)); @@ -224,6 +243,6 @@ int main(int argc, char** argv) { process_streamed_audio(config.audio_dir_file_name, config.streamed_audio_file_names); } - lg::info("Disassembly has completed successfully."); + lg::info("Decompiler has finished successfully in {:.2f} seconds.", decomp_timer.getSeconds()); return 0; } diff --git a/decompiler/util/DataParser.cpp b/decompiler/util/DataParser.cpp index 96b1c6ff6e..335ca14167 100644 --- a/decompiler/util/DataParser.cpp +++ b/decompiler/util/DataParser.cpp @@ -1,8 +1,11 @@ -#include #include "DataParser.h" -#include "third-party/fmt/core.h" + +#include + #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + /* * Allowable lines: * L123: - label diff --git a/decompiler/util/DataParser.h b/decompiler/util/DataParser.h index ae6d8e529b..f45882c815 100644 --- a/decompiler/util/DataParser.h +++ b/decompiler/util/DataParser.h @@ -5,10 +5,11 @@ * A parser for the decompiled GOAL data format. */ -#include #include -#include "decompiler/ObjectFile/LinkedWord.h" +#include + #include "decompiler/Disasm/DecompilerLabel.h" +#include "decompiler/ObjectFile/LinkedWord.h" namespace decompiler { struct ParsedData { diff --git a/decompiler/util/DecompilerTypeSystem.cpp b/decompiler/util/DecompilerTypeSystem.cpp index e324554c23..23e766bf7f 100644 --- a/decompiler/util/DecompilerTypeSystem.cpp +++ b/decompiler/util/DecompilerTypeSystem.cpp @@ -1,10 +1,13 @@ #include "DecompilerTypeSystem.h" + +#include "TP_Type.h" + #include "common/goos/Reader.h" +#include "common/log/log.h" #include "common/type_system/defenum.h" #include "common/type_system/deftype.h" + #include "decompiler/Disasm/Register.h" -#include "common/log/log.h" -#include "TP_Type.h" namespace decompiler { DecompilerTypeSystem::DecompilerTypeSystem() { @@ -14,7 +17,7 @@ DecompilerTypeSystem::DecompilerTypeSystem() { namespace { // some utilities for parsing the type def file -goos::Object& car(goos::Object& pair) { +goos::Object& car(const goos::Object& pair) { if (pair.is_pair()) { return pair.as_pair()->car; } else { @@ -22,7 +25,7 @@ goos::Object& car(goos::Object& pair) { } } -goos::Object& cdr(goos::Object& pair) { +goos::Object& cdr(const goos::Object& pair) { if (pair.is_pair()) { return pair.as_pair()->cdr; } else { @@ -400,8 +403,8 @@ int DecompilerTypeSystem::get_format_arg_count(const std::string& str) const { } static const std::vector single_char_ignore_list = {'%', 'T'}; - static const std::vector multi_char_ignore_list = {"0L", "1L", "3L", "1K", - "2j", "0k", "30L"}; + static const std::vector multi_char_ignore_list = {"0L", "1L", "3L", "1K", + "2j", "0k", "30L", "1T"}; int arg_count = 0; for (size_t i = 0; i < str.length(); i++) { diff --git a/decompiler/util/DecompilerTypeSystem.h b/decompiler/util/DecompilerTypeSystem.h index 619a8da4e0..0eba85e1bd 100644 --- a/decompiler/util/DecompilerTypeSystem.h +++ b/decompiler/util/DecompilerTypeSystem.h @@ -1,8 +1,9 @@ #pragma once -#include "common/type_system/TypeSystem.h" -#include "decompiler/Disasm/Register.h" #include "common/goos/Reader.h" +#include "common/type_system/TypeSystem.h" + +#include "decompiler/Disasm/Register.h" namespace decompiler { class TP_Type; @@ -20,6 +21,7 @@ class DecompilerTypeSystem { std::unordered_map bad_format_strings; std::unordered_map>> format_ops_with_dynamic_string_by_func_name; + std::unordered_map> art_group_info; void add_symbol(const std::string& name) { if (symbols.find(name) == symbols.end()) { diff --git a/decompiler/util/Error.h b/decompiler/util/Error.h index 3d507351f4..2e19b91f11 100644 --- a/decompiler/util/Error.h +++ b/decompiler/util/Error.h @@ -1,6 +1,7 @@ #pragma once #include + #include "third-party/fmt/core.h" class Error : public std::runtime_error { diff --git a/decompiler/util/StackSpillMap.h b/decompiler/util/StackSpillMap.h index 7ebe8a6c68..a90bfb21f9 100644 --- a/decompiler/util/StackSpillMap.h +++ b/decompiler/util/StackSpillMap.h @@ -1,8 +1,8 @@ #pragma once +#include #include #include -#include namespace decompiler { /*! diff --git a/decompiler/util/TP_Type.cpp b/decompiler/util/TP_Type.cpp index 841898354d..8b62cf5d94 100644 --- a/decompiler/util/TP_Type.cpp +++ b/decompiler/util/TP_Type.cpp @@ -1,4 +1,5 @@ #include "TP_Type.h" + #include "third-party/fmt/core.h" namespace decompiler { diff --git a/decompiler/util/TP_Type.h b/decompiler/util/TP_Type.h index aab496b972..6b99fb2854 100644 --- a/decompiler/util/TP_Type.h +++ b/decompiler/util/TP_Type.h @@ -1,12 +1,14 @@ #pragma once -#include #include +#include + +#include "common/common_types.h" #include "common/log/log.h" #include "common/type_system/TypeSpec.h" -#include "common/common_types.h" -#include "decompiler/Disasm/Register.h" #include "common/util/Assert.h" +#include "decompiler/Disasm/Register.h" + namespace decompiler { /*! * A TP_Type is a specialized typespec used in the type propagation algorithm. diff --git a/decompiler/util/config_parsers.cpp b/decompiler/util/config_parsers.cpp index 44a3836054..d29209a2dc 100644 --- a/decompiler/util/config_parsers.cpp +++ b/decompiler/util/config_parsers.cpp @@ -1,4 +1,5 @@ #include "config_parsers.h" + #include "common/util/json_util.h" namespace decompiler { diff --git a/decompiler/util/config_parsers.h b/decompiler/util/config_parsers.h index 49fb2a9ca2..7bf13a0cd5 100644 --- a/decompiler/util/config_parsers.h +++ b/decompiler/util/config_parsers.h @@ -1,6 +1,8 @@ #pragma once #include + #include "decompiler/config.h" + #include "third-party/json.hpp" namespace decompiler { diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index 1c1ce1da43..ea1edef0fd 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -1,17 +1,20 @@ +#include "data_decompile.h" + #include -#include "data_decompile.h" -#include "third-party/fmt/core.h" -#include "common/type_system/Type.h" #include "common/goos/PrettyPrinter.h" -#include "common/util/math_util.h" #include "common/log/log.h" +#include "common/type_system/Type.h" +#include "common/util/Assert.h" +#include "common/util/math_util.h" #include "common/util/print_float.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" + #include "decompiler/IR2/Form.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" #include "decompiler/analysis/final_output.h" #include "decompiler/util/sparticle_decompile.h" -#include "common/util/Assert.h" + +#include "third-party/fmt/core.h" namespace decompiler { @@ -288,6 +291,18 @@ goos::Object decompile_value_array(const TypeSpec& elt_type, } namespace { +float word_as_float(const LinkedWord& w) { + ASSERT(w.kind() == LinkedWord::PLAIN_DATA); + float v; + memcpy(&v, &w.data, 4); + return v; +} + +s32 word_as_s32(const LinkedWord& w) { + ASSERT(w.kind() == LinkedWord::PLAIN_DATA); + return w.data; +} + std::string print_def(const goos::Object& obj) { if (obj.is_pair() && obj.as_pair()->car.is_symbol() && obj.as_pair()->car.as_symbol()->name == "quote") { @@ -578,6 +593,147 @@ goos::Object sp_launch_grp_launcher_decompile(const std::vector& wor file, TypeSpec("sparticle-group-item"), 32); } +goos::Object decompile_sound_spec(const TypeSpec& type, + const DecompilerLabel& label, + const std::vector& labels, + const std::vector>& words, + const TypeSystem& ts, + const LinkedObjectFile* file) { + // auto normal = decompile_structure(type, label, labels, words, ts, file, false); + // fmt::print("Doing: {}\n", normal.print()); + auto uncast_type_info = ts.lookup_type(type); + auto type_info = dynamic_cast(uncast_type_info); + if (!type_info) { + throw std::runtime_error(fmt::format("Type {} wasn't a structure type.", type.print())); + } + ASSERT(type_info->get_size_in_memory() == 0x4c); + + // get words for real + auto offset_location = label.offset - type_info->get_offset(); + int word_count = (type_info->get_size_in_memory() + 3) / 4; + std::vector obj_words; + obj_words.insert(obj_words.begin(), + words.at(label.target_segment).begin() + (offset_location / 4) + 1, + words.at(label.target_segment).begin() + (offset_location / 4) + word_count); + + for (int i = 0; i < word_count - 1; ++i) { + if (i == word_count - 2 && !obj_words.at(i).data) { + // just some default initialized sound spec, don't attempt anything fancy. + return decompile_structure(type, label, labels, words, ts, file, false); + } + if (obj_words.at(i).data) + break; + } + + u16 implicit_mask = 0; + u16 mask = obj_words.at(0).data; + float num = word_as_float(obj_words.at(1)); + u8 group = obj_words.at(2).data; + char sound_name[17]; + sound_name[16] = 0; + memcpy(&sound_name[0], &obj_words.at(3).data, sizeof(u32)); + memcpy(&sound_name[4], &obj_words.at(4).data, sizeof(u32)); + memcpy(&sound_name[8], &obj_words.at(5).data, sizeof(u32)); + memcpy(&sound_name[12], &obj_words.at(6).data, sizeof(u32)); + std::string name(sound_name); + + for (int i = 0; i < 4; ++i) { + if (obj_words.at(7 + i).data) { + throw std::runtime_error("static sound-spec trans was not zero."); + } + } + + s32 volume = word_as_s32(obj_words.at(11)); + s32 pitch = word_as_s32(obj_words.at(12)); + s32 bend = word_as_s32(obj_words.at(13)); + s16 fo_min = word_as_s32(obj_words.at(14)); + s16 fo_max = word_as_s32(obj_words.at(14)) >> 16; + s8 fo_curve = word_as_s32(obj_words.at(15)); + s8 priority = word_as_s32(obj_words.at(15)) >> 8; + s32 auto_time = word_as_s32(obj_words.at(16)); + s32 auto_from = word_as_s32(obj_words.at(17)); + + if (bend) { + throw std::runtime_error("static sound-spec bend was not zero."); + } + if (fo_curve) { + throw std::runtime_error("static sound-spec fo_curve was not zero."); + } + if (priority) { + throw std::runtime_error("static sound-spec priority was not zero."); + } + if (auto_time) { + throw std::runtime_error("static sound-spec auto_time was not zero."); + } + if (auto_from) { + throw std::runtime_error("static sound-spec auto_from was not zero."); + } + + std::vector the_macro; + + the_macro.push_back(pretty_print::to_symbol("static-sound-spec")); + the_macro.push_back(goos::StringObject::make_new(name)); + if (num != 1) { + the_macro.push_back(pretty_print::to_symbol(fmt::format(":num {}", num))); + } + if (group != 1) { + the_macro.push_back(pretty_print::to_symbol(fmt::format(":group {}", num))); + } + if ((mask & 1) || volume != 1024) { + implicit_mask |= 1 << 0; + float volf = volume / 10.24f; + // volume is fixed point, and floats should round towards zero, so we convert specific ints + // to better-looking floats that end up being the same value. + // there should be a more automated way to do this, but i am a bit lazy. + switch (volume) { + case 0x2cc: + volf = 70; + break; + case 0x333: + volf = 80; + break; + } + the_macro.push_back(pretty_print::to_symbol(fmt::format(":volume {}", float_to_string(volf)))); + } + if (pitch != 0) { + implicit_mask |= 1 << 1; + the_macro.push_back(pretty_print::to_symbol(fmt::format(":pitch-mod {}", pitch))); + } + if (fo_min != 0) { + implicit_mask |= 1 << 6; + the_macro.push_back(pretty_print::to_symbol(fmt::format(":fo-min {}", fo_min))); + } + if (fo_max != 0) { + implicit_mask |= 1 << 7; + the_macro.push_back(pretty_print::to_symbol(fmt::format(":fo-max {}", fo_max))); + } + + if (mask < implicit_mask) { + throw std::runtime_error( + fmt::format("static sound-spec too many implicit masks: #x{:x}", implicit_mask ^ mask)); + } + u16 final_mask = mask ^ implicit_mask; + if (final_mask) { + lg::error( + "final_mask in static sound-spec decomp: #x{:x}. This is fine, but should be reported.", + final_mask); + std::string mask_list = ":mask ("; + bool first = true; + for (const auto& m : decompile_bitfield_enum_from_int(TypeSpec("sound-mask"), ts, final_mask)) { + if (!first) { + mask_list += " "; + } + mask_list += m; + first = false; + } + mask_list += ")"; + + the_macro.push_back(pretty_print::to_symbol(mask_list)); + } + + return pretty_print::build_list(the_macro); +} + } // namespace goos::Object decompile_structure(const TypeSpec& type, @@ -587,13 +743,19 @@ goos::Object decompile_structure(const TypeSpec& type, const TypeSystem& ts, const LinkedObjectFile* file, bool use_fancy_macros) { - if (use_fancy_macros && type == TypeSpec("sp-field-init-spec")) { - return decompile_sparticle_field_init(type, label, labels, words, ts, file); + // some structures we want to decompile to fancy macros instead of a raw static definiton + if (use_fancy_macros) { + if (type == TypeSpec("sp-field-init-spec")) { + return decompile_sparticle_field_init(type, label, labels, words, ts, file); + } + if (type == TypeSpec("sparticle-group-item")) { + return decompile_sparticle_group_item(type, label, labels, words, ts, file); + } + if (type == TypeSpec("sound-spec")) { + return decompile_sound_spec(type, label, labels, words, ts, file); + } } - if (use_fancy_macros && type == TypeSpec("sparticle-group-item")) { - return decompile_sparticle_group_item(type, label, labels, words, ts, file); - } // first step, get type info and words TypeSpec actual_type = type; auto uncast_type_info = ts.lookup_type(actual_type); @@ -1115,16 +1277,8 @@ goos::Object decompile_value(const TypeSpec& type, s64 value; memcpy(&value, bytes.data(), 8); - // only rewrite if exact. - s64 seconds_int = value / (s64)TICKS_PER_SECOND; - if (seconds_int * (s64)TICKS_PER_SECOND == value) { - return pretty_print::to_symbol(fmt::format("(seconds {})", seconds_int)); - } - double seconds = (double)value / TICKS_PER_SECOND; - if (seconds * TICKS_PER_SECOND == value) { - return pretty_print::to_symbol(fmt::format("(seconds {})", float_to_string(seconds, false))); - } - return pretty_print::to_symbol(fmt::format("#x{:x}", value)); + return pretty_print::to_symbol( + fmt::format("(seconds {})", fixed_point_to_string(value, TICKS_PER_SECOND))); } else if (ts.tc(TypeSpec("uint64"), type)) { ASSERT(bytes.size() == 8); u64 value; @@ -1217,14 +1371,15 @@ goos::Object decompile_boxed_array(const DecompilerLabel& label, int array_allocated_length = size_word_2.data; auto content_type_info = ts.lookup_type(content_type); + auto params_obj = array_length == array_allocated_length + ? pretty_print::to_symbol(fmt::format("new 'static 'boxed-array :type {}", + content_type.print())) + : pretty_print::to_symbol(fmt::format( + "new 'static 'boxed-array :type {} :length {} :allocated-length {}", + content_type.print(), array_length, array_allocated_length)); if (content_type_info->is_reference() || content_type == TypeSpec("object")) { // easy, stride of 4. - std::vector result = { - pretty_print::to_symbol("new"), pretty_print::to_symbol("'static"), - pretty_print::to_symbol("'boxed-array"), - pretty_print::to_symbol(fmt::format(":type {} :length {} :allocated-length {}", - content_type.print(), array_length, - array_allocated_length))}; + std::vector result = {params_obj}; for (int elt = 0; elt < array_length; elt++) { auto& word = words.at(label.target_segment).at(first_elt_word_idx + elt); @@ -1255,12 +1410,7 @@ goos::Object decompile_boxed_array(const DecompilerLabel& label, return pretty_print::build_list(result); } else if (content_type.base_type() == "inline-array") { - std::vector result = { - pretty_print::to_symbol("new"), pretty_print::to_symbol("'static"), - pretty_print::to_symbol("'boxed-array"), - pretty_print::to_symbol(fmt::format(":type {} :length {} :allocated-length {}", - content_type.print(), array_length, - array_allocated_length))}; + std::vector result = {params_obj}; for (int elt = 0; elt < array_length; elt++) { auto& word = words.at(label.target_segment).at(first_elt_word_idx + elt); @@ -1273,12 +1423,7 @@ goos::Object decompile_boxed_array(const DecompilerLabel& label, return pretty_print::build_list(result); } else { // value array - std::vector result = { - pretty_print::to_symbol("new"), pretty_print::to_symbol("'static"), - pretty_print::to_symbol("'boxed-array"), - pretty_print::to_symbol(fmt::format(":type {} :length {} :allocated-length {}", - content_type.print(), array_length, - array_allocated_length))}; + std::vector result = {params_obj}; auto stride = content_type_info->get_size_in_memory(); for (int i = 0; i < array_length; i++) { @@ -1388,8 +1533,7 @@ goos::Object decompile_pair(const DecompilerLabel& label, // invalid. lg::error( "There is an improper list. This is probably okay, but should be checked manually " - "because we " - "could not find a test case yet."); + "because we could not find a test case yet."); list_tokens.push_back(pretty_print::to_symbol(".")); list_tokens.push_back(decompile_pair_elt(cdr_word, labels, words, ts, file)); if (add_quote) { @@ -1475,7 +1619,8 @@ std::optional> try_decompile_bitfield_from_int( int end_bit = 64 + start_bit; for (auto& field : type_info->fields()) { - if (field.offset() < start_bit || (field.offset() + field.size()) > end_bit) { + if (field.skip_in_decomp() || field.offset() < start_bit || + (field.offset() + field.size()) > end_bit) { continue; } diff --git a/decompiler/util/data_decompile.h b/decompiler/util/data_decompile.h index 64f66962ac..8106ecd548 100644 --- a/decompiler/util/data_decompile.h +++ b/decompiler/util/data_decompile.h @@ -1,14 +1,16 @@ #pragma once #include + #include "common/goos/Object.h" -#include "decompiler/Disasm/DecompilerLabel.h" -#include "decompiler/ObjectFile/LinkedWord.h" #include "common/type_system/TypeSpec.h" #include "common/type_system/TypeSystem.h" + +#include "decompiler/Disasm/DecompilerLabel.h" +#include "decompiler/IR2/LabelDB.h" +#include "decompiler/ObjectFile/LinkedWord.h" #include "decompiler/config.h" #include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/IR2/LabelDB.h" namespace decompiler { class LinkedObjectFile; diff --git a/decompiler/util/goal_data_reader.cpp b/decompiler/util/goal_data_reader.cpp index 9b216e28d8..bdd58bacf2 100644 --- a/decompiler/util/goal_data_reader.cpp +++ b/decompiler/util/goal_data_reader.cpp @@ -1,8 +1,7 @@ #include "goal_data_reader.h" -#include "decompiler/util/DecompilerTypeSystem.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" - +#include "decompiler/util/DecompilerTypeSystem.h" #include "decompiler/util/Error.h" void read_plain_data_field(const TypedRef& object, @@ -234,7 +233,8 @@ TypedRef typed_ref_from_basic(const Ref& object, const decompiler::DecompilerTyp const auto& word = object.data->words_by_seg.at(object.seg).at(byte_in_words / 4); if (word.kind() != decompiler::LinkedWord::TYPE_PTR) { - throw Error("typed_ref_from_basic did not get a type tag (offset {} words)", byte_in_words / 4); + throw Error("typed_ref_from_basic did not get a type tag (offset {} words). Got {}", + byte_in_words / 4, (int)word.kind()); } TypedRef result; @@ -252,7 +252,8 @@ Ref deref_label(const Ref& object) { const auto& word = object.data->words_by_seg.at(object.seg).at(byte_in_words / 4); if (word.kind() != decompiler::LinkedWord::PTR) { - throw Error("deref_label did not get a label (offset {} words)", byte_in_words / 4); + throw Error("deref_label did not get a label (offset {} words). Got {} {}", byte_in_words / 4, + (int)word.kind(), word.data); } const auto& lab = object.data->labels.at(word.label_id()); @@ -278,4 +279,64 @@ std::string inspect_ref(const Ref& ref) { default: ASSERT(false); } +} + +u32 deref_u32(const Ref& ref, int word_offset) { + if ((ref.byte_offset % 4) != 0) { + throw Error("deref_u32 bad alignment"); + } + const auto& word = ref.data->words_by_seg.at(ref.seg).at(word_offset + (ref.byte_offset / 4)); + if (word.kind() != decompiler::LinkedWord::PLAIN_DATA) { + throw Error("deref_u32 bad kind: {}", (int)word.kind()); + } + return word.data; +} + +u64 deref_u64(const Ref& ref, int dw_offset) { + if ((ref.byte_offset % 8) != 0) { + throw Error("deref_u64 bad alignment"); + } + const auto& word0 = ref.data->words_by_seg.at(ref.seg).at(ref.byte_offset / 4 + (dw_offset * 2)); + const auto& word1 = + ref.data->words_by_seg.at(ref.seg).at(1 + (ref.byte_offset / 4) + (dw_offset * 2)); + + if (word0.kind() != decompiler::LinkedWord::PLAIN_DATA) { + throw Error("deref_u64 bad kind: {}", (int)word0.kind()); + } + if (word1.kind() != decompiler::LinkedWord::PLAIN_DATA) { + throw Error("deref_u64 bad kind: {}", (int)word1.kind()); + } + u64 result = word1.data; + result <<= 32; + result |= word0.data; + return result; +} + +u16 deref_u16(const Ref& ref, int array_idx) { + u32 u32_offset = array_idx / 2; + u32 u32_val = deref_u32(ref, u32_offset); + if (array_idx & 1) { + return u32_val >> 16; + } else { + return (u16)u32_val; + } +} + +s8 deref_s8(const Ref& ref, int byte) { + u32 u32_offset = byte / 4; + u32 u32_val = deref_u32(ref, u32_offset); + s8 vals[4]; + memcpy(vals, &u32_val, 4); + return vals[byte & 3]; +} + +u8 deref_u8(const Ref& ref, int byte) { + u32 total_offset = ref.byte_offset + byte; + const auto& word = ref.data->words_by_seg.at(ref.seg).at(total_offset / 4); + if (word.kind() != decompiler::LinkedWord::PLAIN_DATA) { + throw Error("deref_u32 bad kind: {}", (int)word.kind()); + } + u8 vals[4]; + memcpy(vals, &word.data, 4); + return vals[total_offset & 3]; } \ No newline at end of file diff --git a/decompiler/util/goal_data_reader.h b/decompiler/util/goal_data_reader.h index 3a40e48f85..2d3f074184 100644 --- a/decompiler/util/goal_data_reader.h +++ b/decompiler/util/goal_data_reader.h @@ -1,7 +1,8 @@ #pragma once -#include #include +#include + #include "common/common_types.h" namespace decompiler { @@ -20,6 +21,9 @@ struct Ref { struct TypedRef { Ref ref; Type* type = nullptr; + + TypedRef() = default; + TypedRef(const Ref& r, Type* t) : ref(r), type(t) {} }; void read_plain_data_field(const TypedRef& object, @@ -34,7 +38,6 @@ T read_plain_data_field(const TypedRef& object, const decompiler::DecompilerTypeSystem& dts) { u8 data[sizeof(T)]; read_plain_data_field(object, field_name, dts, sizeof(T), data); - T result; memcpy(&result, data, sizeof(T)); return result; @@ -68,5 +71,9 @@ std::string get_type_of_basic(const Ref& object); TypedRef typed_ref_from_basic(const Ref& object, const decompiler::DecompilerTypeSystem& dts); Ref deref_label(const Ref& object); - +u32 deref_u32(const Ref& ref, int word_offset); +u16 deref_u16(const Ref& ref, int array_idx); +s8 deref_s8(const Ref& ref, int byte); +u8 deref_u8(const Ref& ref, int byte); +u64 deref_u64(const Ref& ref, int dw_offset); std::string inspect_ref(const Ref& ref); diff --git a/decompiler/util/sparticle_decompile.cpp b/decompiler/util/sparticle_decompile.cpp index 551eed7854..8a0f829c49 100644 --- a/decompiler/util/sparticle_decompile.cpp +++ b/decompiler/util/sparticle_decompile.cpp @@ -1,8 +1,10 @@ #include "sparticle_decompile.h" -#include "decompiler/util/data_decompile.h" + #include "common/goos/PrettyPrinter.h" -#include "common/util/print_float.h" #include "common/util/Assert.h" +#include "common/util/print_float.h" + +#include "decompiler/util/data_decompile.h" namespace decompiler { // sparticle fields. @@ -444,11 +446,11 @@ goos::Object decompile_sparticle_sound_spec(const std::vector& /*wor goos::Object decompile_sparticle_group_item(const TypeSpec& type, const DecompilerLabel& label, - const std::vector& labels, + const std::vector& /*labels*/, const std::vector>& words, const TypeSystem& ts, - const LinkedObjectFile* file) { - auto normal = decompile_structure(type, label, labels, words, ts, file, false); + const LinkedObjectFile* /*file*/) { + // auto normal = decompile_structure(type, label, labels, words, ts, file, false); // fmt::print("Doing: {}\n", normal.print()); auto uncast_type_info = ts.lookup_type(type); auto type_info = dynamic_cast(uncast_type_info); diff --git a/decompiler/util/sparticle_decompile.h b/decompiler/util/sparticle_decompile.h index 6d6118cbd9..1d3f9866fd 100644 --- a/decompiler/util/sparticle_decompile.h +++ b/decompiler/util/sparticle_decompile.h @@ -2,9 +2,10 @@ #include "common/goos/Object.h" #include "common/type_system/TypeSpec.h" + #include "decompiler/Disasm/DecompilerLabel.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" #include "decompiler/IR2/Form.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" namespace decompiler { goos::Object decompile_sparticle_field_init(const TypeSpec& type, diff --git a/default.nix b/default.nix deleted file mode 100644 index f3c73d2bd6..0000000000 --- a/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -(import (fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz"; - sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; -}) { src = ./.; }).defaultNix diff --git a/docs/img/promosmall1.png b/docs/img/promosmall1.png new file mode 100644 index 0000000000..f1100915ce Binary files /dev/null and b/docs/img/promosmall1.png differ diff --git a/docs/img/promosmall2.png b/docs/img/promosmall2.png new file mode 100644 index 0000000000..63628561af Binary files /dev/null and b/docs/img/promosmall2.png differ diff --git a/docs/img/screenshot_hut_new_small.png b/docs/img/screenshot_hut_new_small.png deleted file mode 100644 index bcf79184fe..0000000000 Binary files a/docs/img/screenshot_hut_new_small.png and /dev/null differ diff --git a/docs/img/screenshot_junglenew_custommood_small.png b/docs/img/screenshot_junglenew_custommood_small.png deleted file mode 100644 index 3b3f83c0e3..0000000000 Binary files a/docs/img/screenshot_junglenew_custommood_small.png and /dev/null differ diff --git a/docs/progress-notes/changelog.md b/docs/progress-notes/changelog.md index b55e67b620..d5d60201ef 100644 --- a/docs/progress-notes/changelog.md +++ b/docs/progress-notes/changelog.md @@ -214,4 +214,13 @@ - Asm ops requiring 128-bit inputs will now try harder to convert their inputs when it is appropriate. - 0's that are constant propagated to the input of a 128-bit instruction will use `vpxor` instruction to generate the value, instead of `xor` and a `mov`. - Add a `stack-singleton-no-clear` stack construction type. It will create a "singleton" inside this function - all other `(new 'stack-singleton` forms with the same type will return the same stack object. -- Added support for using `(new 'static 'array ...)` for setting a static field of type `(pointer ...)` \ No newline at end of file +- Added support for using `(new 'static 'array ...)` for setting a static field of type `(pointer ...)` + +## V0.9 Large change to macro expansion and constant propagation +The compiler is now much more aggressive in where and how it expands macros and handles expressions at compiler time. +- Several places where macros could be incorrectly executed more than once (possibly causing unwanted side effects) have been fixed. +- Fixed bug in size calculation of non-inline stack arrays. Previous behavior was a compiler assert. +- Correctly handle `mod` for unsigned numbers. Previous behavior was to treat all inputs as 32-bit signed integers. + +## V1.0 Revised constant propagation, speed improvements +Improved error messages around macros \ No newline at end of file diff --git a/docs/scratch/merc.md b/docs/scratch/merc.md new file mode 100644 index 0000000000..9eaa75b893 --- /dev/null +++ b/docs/scratch/merc.md @@ -0,0 +1,420 @@ +Loop over effect (skip those flagged with use-mercneric) + +Loop over fragments + +First thing is the "row" data. +row.x/y is st-vif-add from the merc-ctrl-header. +row.z = 0x47800000, row.w = 0x4b010000 + + +Next is the unsigned-four. +This is unpacked with unpack8. +It always goes to 140 in the VU memory. +The source data is just the merc-fragment (I believe it includes merc-byte-header) + +After is the lump-four. This has a STMOD enabled and is unpack8. +It goes after the unsigned-four (variable size) in VU memory. +The source data is after. Rounding in static data is ((u4c + 3) >> 2) << 4. + +After is the Floating Point data. This is copied as unpack32. + +_only_ on the first fragment of an effect, there's an upload to 132 of 8 qw: +the first 7 are lights. +the final is the first quadword of the merc-ctrl-header (xyz-scale, st-magic, st-out-a, st-out-b) + +there are secrets hidden in the lights: +- light 0's w is some flag with ignore alpha in it. + + +Next is (optional) matrix uploads. +There is a loop of transfers. These are all size 7 qw. + +Next is the MSCAL! +It has a different number of the first fragment of an effect. +This tells merc to load the light stuff. + +End Loop over fragments + +Increment effect +Increment effect info +Decrement effect count + +update some next-merc thing in the scratchpad + + +# Merc Renderer + +## Memory layout +Unpacks adgif shaders/giftags to the output memory. +Can reuse the last shader from the last frag in the effect. + +## Matrix Setup +The matrix contains a "tmat" and "nmat". The "tmat" transforms the point and the "nmat" rotates the normals. + +Matrices that are freshly uploaded with this fragment are preprocessed to include the effect of the perspective matrix. The inputs are in registers 8, 10, 12, 25, and the outputs are 9, 11, 13, 26. The output is written over the input. + +``` +mula.xyzw ACC, vf15, vf08 +maddz.xyzw vf09, vf16, vf08 +mula.xyzw ACC, vf15, vf10 +maddz.xyzw vf11, vf16, vf10 +mula.xyzw ACC, vf15, vf12 +maddz.xyzw vf13, vf16, vf12 +addax.xyzw vf20, vf00 +madda.xyzw ACC, vf27, vf25 +maddz.xyzw vf26, vf28, vf25 +``` + +with +``` +vf15 = [spdx, spdy, spdz, 0] +vf16 = [0, 0, 0, spdw] +vf27 = [pdx, pdy, pdz, 0] +vf28 = [0, 0, 0, pdw] +``` +(see `merc_asm.asm` for how to compute these in more detail) + +## Vertex layout +The "lump" data contains the vertices. The layout is: +``` +mat0, mat1, nrmx, posx +dst0, dst1, nrmy, posy +texs, text, nrmz, posz +``` +It begins with `mat1-cnt` vertices that are deformed by only a single matrix. + +The `rgba-offset` points to somewhere in the u4 data. Each vertex has a single rgba, stored as unpacked u8's. + +## Mat1 Loop +`vi01` is the lump pointer that reads vertices, `vf17`, `vf18`, `vf19` are the "lump offsets" to be applied to the unpacked vertices. + +The operations are: +```asm +ilwr.x vi08, vi01 ;; load mat0 from vertex +lqi.xyzw vf08, vi01 ;; load vertex qw 0 +lqi.xyzw vf11, vi01 ;; load vertex qw 1 +lqi.xyzw vf14, vi01 ;; load vertex qw 2 + +lq.xyz vf29, 4(vi08) ;; load nmat0 +lq.xyz vf30, 5(vi08) ;; load nmat1 +lq.xyzw vf31, 6(vi08) ;; load nmat2 + +add.zw vf08, vf08, vf17 ;; lump offset +add.xyzw vf11, vf11, vf18 ;; lump offset +add.xyzw vf14, vf14, vf19 ;; lump offset + +mtir vi10, vf11.x ;; get dest0 +mtir vi13, vf11.y ;; get dest1 + +;; rotate normal +mulaz.xyzw ACC, vf29, vf08 +maddaz.xyzw ACC, vf30, vf11 +maddz.xyz vf11, vf31, vf14 + +;; load tmat +lq.xyzw vf25, 0(vi08) +lq.xyzw vf26, 1(vi08) +lq.xyzw vf27, 2(vi08) +lq.xyzw vf28, 3(vi08) + +;; get normal 1/length +erleng.xyz P, vf11 + +;; transform point +mulaw.xyzw ACC, vf25, vf08 +maddaw.xyzw ACC, vf26, vf11 +maddw.xyzw vf08, vf27, vf14 +add.xyzw vf08, vf08, vf28 + +;; clear nrmz +mr32.z vf14, vf00 + +;; ONLY if merc prime miniw.w vf08, vf08, vf01 + +;; perspective divide +div Q, vf01.w, vf08.w +mul.xyz vf08, vf08, Q +mul.xyzw vf14, vf14, Q + +;; load rgba +lqi.xyzw vf23, vi03 + +;; hvdf offset +add.xyzw vf08, vf08, vf22 + +;; normalize normal +mfp.w vf20, P +mulw.xyzw vf11, vf11, vf20 + +;; fog max +miniw.w vf08, vf08, vf03 + +;; fetch mat1 (note that vi01 is incremented 3x in pipeline) +ilw.y vi09, -6(vi01) + +;; dot product with light +mulax.xyzw ACC, vf01, vf11 +madday.xyzw ACC, vf02, vf11 +maddz.xyzw vf11, vf03, vf11 + +;; fog min +maxw.w vf08, vf08, vf02 + +;; rgba itof +itof0.xyzw vf23, vf23 + +;; light clamp +maxx.xyzw vf11, vf11, vf00 + +move.xyzw vf21, vf08 + +;; color the lights +mulax.xyzw ACC, vf04, vf11 +madday.xyzw ACC, vf05, vf11 +maddaz.xyzw ACC, vf06, vf11 + +;; IF vi09 <= 0 +addx.w vf21, vf21, vf17 + +;; add ambient lighting +maddw.xyzw vf11, vf07, vf00 + +;; ftoi the vertex position +ftoi4.xyzw vf21, vf21 + +;; apply vertex color +mul.xyzw vf11, vf11, vf23 + +;; store dest +sq.xyzw vf21, 2(vi10) + +;; IF vi09 == 0 +ftoi4.xyzw vf21, vf08 + +;; store st +sq.xyzw vf14, 0(vi10) +sq.xyzw vf14, 0(vi13) + +;; store second position +sq.xyzw vf21, 2(vi13) + +;; final light +miniy.xyzw vf11, vf11, vf17 +ftoi0.xyzw vf11, vf11 +sq.xyzw vf11, 1(vi10) +sq.xyzw vf11, 1(vi13) + +``` +Note: it might be that the last vertex can't change its adc flag for dst2. Maybe only in some cases. Worth checking more if there are stripping issues. + +## Mat2 Loop + +NOTE: we might need to advance perc by 1 at the beginning if there are any mat0's. +```asm +;; compute perc ptr +ilw.x vi02, 3(vi12) +iadd vi02, vi02, vi12 + +;; load vertex +lqi.xyzw vf08, vi01 +lqi.xyzw vf11, vi01 +lqi.xyzw vf14, vi01 + +;; and perc +lqi.xyzw vf24, vi02 + +;; extract mat idx +mtir vi10, vf08.x +mtir vi13, vf08.y + +;; convert perc +itof0.xyzw vf24, vf24 + +;; lump offset +add.zw vf08, vf08, vf17 +add.xyzw vf11, vf11, vf18 +add.xyzw vf14, vf14, vf19 + +;; mask off sign bit of mat0 and mat1 +iand vi10, vi10, vi05 (vi05 = 0x7f) <- looks like a 0 here means "reuse prev mat" +iand vi13, vi13, vi05 + +;; scale perc +mulw.xyzw vf24, vf24, vf29 ;; vf29.w = 0.003921569 + +;; load matrices +lq.xyzw vf20, 0(vi10) ;; tmat0.0 +lq.xyzw vf25, 0(vi13) ;; tmat1.0 +lq.xyzw vf23, 1(vi10) ;; tmat0.1 +lq.xyzw vf26, 1(vi13) ;; tmat1.1 +lq.xyzw vf20, 2(vi10) ;; tmat0.2 +lq.xyzw vf27, 2(vi13) ;; tmat1.2 +lq.xyzw vf23, 3(vi10) ;; tmat0.3 +lq.xyzw vf28, 3(vi13) ;; tmat1.3 +lq.xyzw vf20, 4(vi10) ;; nmat0.0 +lq.xyz vf29, 4(vi13) ;; nmat1.0 +lq.xyzw vf23, 5(vi10) ;; nmat0.1 +lq.xyz vf30, 5(vi13) ;; nmat1.1 +lq.xyzw vf20, 6(vi10) ;; nmat0.2 +lq.xyzw vf31, 6(vi13) ;; nmat1.2 + +;; multiply rows by perc. +;; mat0 uses perc.x, mat0 uses perc.y. Matrices are added. +;; ex: tmat2 = tmat0.2 * perc.x + tmat1.2 * perc.y +Results are + +vf25 = tmat0 +vf26 = tmat1 +vf27 = tmat2 +vf28 = tmat3 + +vf29 = nmat0 +vf30 = nmat1 +vf31 = nmat2 + +;; rotate normal +mulaz.xyzw ACC, vf29, vf08 +maddaz.xyzw ACC, vf30, vf11 +maddz.xyz vf11, vf31, vf14 + +;; transform point +mulaw.xyzw ACC, vf25, vf08 +maddaw.xyzw ACC, vf26, vf11 +maddw.xyzw vf08, vf27, vf14 +add.xyzw vf08, vf08, vf28 + +;; length of normal +erleng.xyz P, vf11 + +;; rgba offset +ilwr.y vi03, vi12 +iadd vi03, vi03, vi12 + +;; persepctive divide +div Q, vf01.w, vf08.w +mul.xyz vf08, vf08, Q +mul.xyzw vf14, vf14, Q + +;; load rgba +lqi.xyzw vf23, vi03 + +;; hvdf offset +add.xyzw vf08, vf08, vf22 + +;; normalize normal +mfp.w vf20, P +mulw.xyzw vf11, vf11, vf20 + +;; fog +miniw.w vf08, vf08, vf03 +maxw.w vf08, vf08, vf02 + +;; go get mat1 again +ilw.y vi09, -6(vi01) + +;; light dot product +mulax.xyzw ACC, vf01, vf11 +madday.xyzw ACC, vf02, vf11 +maddz.xyzw vf11, vf03, vf11 + +;; vertex color convert +itof0.xyzw vf23, vf23 + +;; light clamp +maxx.xyzw vf11, vf11, vf00 + + +;; adc logic +ilw.y vi09, -6(vi01) +move.xyzw vf21, vf08 +ibgtz vi09, L47 + +addx.w vf21, vf21, vf17 + +L47: +ilw.x vi09, -9(vi01) +ftoi4.xyzw vf21, vf21 +ilw.x vi09, -9(vi01) + +sq.xyzw vf21, 2(vi10) +ibgez vi09, L50 + +ftoi4.xyzw vf21, vf08 + +L50: +sq.xyzw vf21, 2(vi13) +``` + + +## Final Copies +assuming no mercprime, leaving out pipe flush (which is a tangled mess to flush the pipes of whatever of the 3 different loops were) +``` +;; vi08 = mercprime flag +ilw.w vi08, 1(vi00) + +;; find the byte header again +xtop vi02 +iaddiu vi04, vi02, 0x8c + +;; srcdest-off +ilwr.x vi05, vi04 + +;; samecopy-cnt +ilw.w vi06, 1(vi04) + +;; crosscopy-cnt +ilw.x vi07, 2(vi04) + +;; zero out vf25, vf26 +minix.xyzw vf25, vf00, vf00 +minix.xyzw vf26, vf00, vf00 + +;; compute srcdest table address +iadd vi05, vi05, vi04 + +;; compute output zone +iaddiu vi04, vi02, 0x173 + +;; compute srcdest cross copy table address +iadd vi06, vi06, vi05 + +;; compute end of cross copy +iadd vi07, vi07, vi06 + +;; compute address of the _old_ output buffer +iaddiu vi08, vi00, 0x1ba +isub vi08, vi08, vi02 +iaddiu vi08, vi08, 0x173 + +;; move addrs to vf +mfir.x vf25, vi04 ;; vf25.x = output zone +mfir.y vf25, vi04 ;; vf25.y = output zone +mfir.x vf26, vi08 ;; vf26.x = old output zone +mfir.y vf26, vi04 ;; vf26.y = output zone + +;; set up +maxx.xyzw vf13, vf13, vf00 ;; vf13 = 0 +maxi.xy vf27, vf00, I, I = 8388608.0 ;; vf27.xy = [8388608.0 8388608.0] +maxi.w vf27, vf00, I, I = 256 ;; vf27.w = 256 + +itof0.xyzw vf25, vf25 +itof0.xyzw vf26, vf26 + +ior vi02, vi05, vi00 ;; vi02 = srcdst table + +add.xyzw vf25, vf25, vf27 ;; hack float add trick +add.xyzw vf26, vf26, vf27 + +miniy.xyzw vf13, vf13, vf17 ;; float tricks +ibne vi06, vi05, L150 ;; branch if there are samecopys + +ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 + +L150: + +;; load from copy table +lqi.xyzw vf27, vi05 +;; table to float +itof0.xyzw vf27, vf27 + +``` diff --git a/docs/scratch/merc_asm.asm b/docs/scratch/merc_asm.asm new file mode 100644 index 0000000000..7ef16356f7 --- /dev/null +++ b/docs/scratch/merc_asm.asm @@ -0,0 +1,2331 @@ +;; Register use (after init and effect setup) +;; to be extra annoying, they often stash stuff in +;; w (and sometimes z) and use xyz for other stuff. + +;; vf01 = [lt0_dir.xyz, pfog0] +;; vf02 = [lt1_dir.xyz, fog-min] +;; vf03 = [lt2_dir.xyz, fog-max] +;; vf04 = [lt0_color] +;; vf05 = [lt1_color] +;; vf06 = [lt2_color] +;; vf07 = [lt_ambient] +;; vf17 = [2048, 255, -65537, xyz-add.x] (the ?? is set per fragment) +;; vf18 = [st-out-X, st-out-X, -65537, xyz-add.y] (X = a if xtop = 0, X = b otherwise) +;; vf19 = [st-magic, st-magic, -65537, xyz-add.z] +;; vf22 = hvdf-offset (does get set to others, but is always restored) +;; vf29 = [??, ??, ??, 0.003921569] + + +;; Low Memory use (after init and effect setup) +;; 1 - [adgif_giftag, use_mercprime] +;; 2 - hvdf-offset +;; 3 - [p0x, p1y, p2z, p2w] (note p2w, not p3w here!) +;; 4 - [p3x, p3y, p3z, p3w] +;; 5 - [p0x*sc, p1y*sc, p2z*sc, p2w*sc] (where sc is the xyz-scale of the header) + +;; 132 - not double buffered, lights + merc-ctrl-header (per ctrl) +;; 132 +;; 133 light 1 dir, w has flags (0x44 for ignore alpha, ) +;; 134 light 2 dir, w has fade out parameter (how much to fade out) +;; 139 - [xyz_scale, st-magic, st-out-a, st-out-b] +;; 140 - not double buffered, header (per effect) + +;; xtop + 140 + st-out +;; this contains the uploaded fp data. +;; the first + + +;; initialization - this runs after the merc program is uploaded and the vu1 low memory +;; block is uploaded. It sets constant registers and stashes some stuff in memory. + +;; - set vf01.w to pfog0 + lq.xyzw vf01, 7(vi00) | nop ;; vf01 = fog + lq.xyzw vf25, 3(vi00) | nop ;; vf25 = perspective.row0 + lq.xyzw vf26, 4(vi00) | nop ;; vf26 = perspective.row1 + lq.xyzw vf27, 5(vi00) | nop ;; vf27 = perspective.row2 + lq.xyzw vf28, 6(vi00) | nop ;; vf28 = perspective.row3 + mr32.xyzw vf01, vf01 | nop ;; rotate pfog0 into vf01.w + move.y vf25, vf26 | nop ;; setting up vf25 + move.zw vf25, vf27 | nop ;; same + sq.xyzw vf25, 3(vi00) | nop ;; setting up low 3. + 2048.0 | nop :i ;; setup I + 255.0 | maxi.x vf17, vf00, I :i ;; setup vf17 + -65537.0 | maxi.y vf17, vf00, I :i ;; setup vf17 + mr32.xyzw vf02, vf01 | minii.z vf17, vf00, I ;; vf17, setup vf02.w + lq.xyzw vf22, 2(vi00) | minii.z vf18, vf00, I ;; vf18.z, vf22 as hvdf-offset + 0.003921569 | minii.z vf19, vf00, I :i ;; vf19.z + sq.xyzw vf28, 4(vi00) | minii.w vf29, vf00, I :e ;; setup low 4 + mr32.xyzw vf03, vf02 | nop ;; set up vf03 + +;; the 17/20 entry points are the same as 32/35, but should be used +;; on the first frag of an effect. they set up lights. + +;; enter 17 (setup lights, with merc "prime") + iaddi vi07, vi00, 0x1 | nop ;; set vi07 mercprime + b L2 | nop + isw.w vi07, 1(vi00) | nop ;; leave behind mercprime flag. +ENTER_20: ;; (setup lights, no merc prime) + iaddi vi07, vi00, 0x0 | nop ;; no mercprime for us today. +L2: ;; (setup lights common) + lq.xyzw vf25, 139(vi00) | nop ;; vf25 = merc-ctrl-header + lq.xyzw vf26, 3(vi00) | nop ;; vf26 = persp-diag + lq.xyz vf01, 132(vi00) | nop ;; setup vf01 light 0 dir + lq.xyz vf02, 133(vi00) | nop ;; setup vf02 light 1 dir + lq.xyz vf03, 134(vi00) | addy.xy vf19, vf00, vf25 ;; vf03 light setup, st-magic + lq.xyzw vf04, 135(vi00) | mulx.xyzw vf26, vf26, vf25 ;; scaled persp diag + lq.xyzw vf05, 136(vi00) | nop + lq.xyzw vf06, 137(vi00) | nop + lq.xyzw vf07, 138(vi00) | nop + b L5 | nop + sq.xyzw vf26, 5(vi00) | nop ;; stash persp diag scaled + +;; 32/35 are prime/normal entry points for normal drawing. +ENTER_32: ;; (run, use prev lights, with merc "prime") + iaddi vi07, vi00, 0x1 | nop ;; vi07 for mercprime + b L5 | nop + isw.w vi07, 1(vi00) | nop ;; stash mercprime flag +ENTER_35: + iaddi vi07, vi00, 0x0 | nop + +L5: ;; common effect drawing entry point. +;; all draw paths go to here. + lq.xyzw vf28, 139(vi00) | minix.xyzw vf15, vf00, vf00 ;; vf28 = mch, vf15 = [0, 0, 0, 0] + xtop vi15 | nop ;; vi15 = 0 (output buffer) + iaddiu vi12, vi15, 0x8c | nop ;; vi12 = xtop + 140 (merc-byte-header, u4) + ibeq vi00, vi15, L6 | nop ;; branch if output buffer a (0) + ilwr.w vi03, vi12 | maxz.xy vf18, vf00, vf28 ;; set vf18.xy = [st-out-a, st-out-a] (for a buffer) + nop | maxw.xy vf18, vf00, vf28 ;; set vf18.xy = [st-out-b, st-out-b] (for b buffer) +L6: + ilw.w vi10, 133(vi00) | nop ;; vi10 = fade out flags + iaddiu vi15, vi15, 0x173 | nop ;; vi15 = xtop + 371 + ilw.y vi02, 2(vi12) | nop ;; vi02 = strip-len + lq.xyzw vf14, 0(vi00) | nop ;; vf14 = tri-strip-gif-tag + ibeq vi00, vi10, L7 | nop ;; branch to L7 if no fade out. + iadd vi03, vi03, vi12 | nop ;; st-output location = {st-out-a, st-out-b} + xtop + 140 + + ;; modify vf14 to have :abe, setup constants for fadeout. + mr32.xyzw vf27, vf14 | nop ;; vf27 = [yzwx] of the tri-strip-gif-tag + ilw.w vi11, 134(vi00) | nop ;; vi11 = fade-out parameter + iaddiu vi13, vi00, 0x42 | nop ;; vi13 = 0x42 + mr32.y vf14, vf27 | nop ;; replace y of tag with w. (enables abe in the gs-prim) + +;; next, we set up the memory layout of the output buffer. +;; the output buffer has two (poorly name) parts: "strip" and "shader". +;; the "strip" part will continue using the shader of the previous fragment. +;; it has a single tag. This "strip" part be left out, if desired. It is always first. +;; the "strip-len" is how large this data is. + +;; the "shader" part contains a series of [shader, triangles] groups. +;; it sets the shader settings, then draws stuff. +;; the shader-cnt is how many [shader, triangle] groups there are. +;; the sizes are stored in the adgif data itself + +;; the blocks below place the shaders and gif tags in memory, setting nloops and eops. + +L7: + ilwr.w vi09, vi03 | nop ;; vi09 = fp-header u8's [shader-cnt, kick-off, kick-step, hword-cnt] + lqi.xyzw vf27, vi03 | nop ;; vf27 = xyz-add + ilw.x vi04, 1(vi12) | nop ;; vi04 = mat1-cnt + iaddiu vi05, vi00, 0x7f | addw.xyz vf15, vf15, vf00 ;; vf15 = [1, 1, 1, 0], vi05 = 0x7f + iand vi09, vi09, vi05 | nop ;; mask to get vi09 = shader-cnt + ilw.y vi06, 1(vi12) | miniz.w vf19, vf00, vf27 ;; set add, vi06 = mat2-cnt + ibeq vi00, vi02, L9 | miniy.w vf18, vf00, vf27 ;; skip to L9 if strip-len is 0 + ilwr.z vi01, vi12 | minix.w vf17, vf00, vf27 ;; vi01 = lump-off + +;; we have strip + ibne vi00, vi09, L8 | nop ;; goto L8 if we have nonzero shader-cnt + sq.yzw vf14, 0(vi15) | nop ;; store giftag (only upper 96 bits) + +;; we have strip, but no shader. set eop. + iaddiu vi02, vi02, 0x4000 | nop ;; build the first 32-bits, strip-len + eop flag + iaddiu vi02, vi02, 0x4000 | nop ;; imm 0x8000 doesn't fit, have to add 2x. + iswr.x vi02, vi15 | nop ;; store nloop = strip-len, eop. + b L12 | nop ;; skip shader setup! + nop | nop +L8: + iswr.x vi02, vi15 | nop ;; nonzero shader and nonzero strip. set nloop on the strip tag, but not eop. +L9: + lq.xyzw vf13, 1(vi00) | nop ;; vf13 = adgif gif tag. +L10: ;; shader loop + ilwr.w vi02, vi03 | nop ;; vi02 = shader control word 0 (dest offset) + lqi.xyzw vf08, vi03 | nop ;; load shader data + lqi.xyzw vf09, vi03 | nop + lqi.xyzw vf10, vi03 | nop + lqi.xyzw vf11, vi03 | nop + lqi.xyzw vf12, vi03 | nop + iadd vi02, vi02, vi15 | nop ;; compute destination + mtir vi08, vf09.w | nop ;; vi08 = shader control word 1 () + sqi.xyzw vf13, vi02 | nop ;; store giftag + sqi.xyzw vf08, vi02 | nop ;; store shader0/5 + sqi.xyzw vf09, vi02 | nop ;; store shader1/5 + mfir.x vf14, vi08 | nop ;; vf14 = post-shader giftag lower-32 + sqi.xyzw vf10, vi02 | nop ;; store shader2/5 + sqi.xyzw vf11, vi02 | nop ;; store shader3/5 + ibeq vi00, vi10, L11 | nop ;; goto L11 if no fadeout + sqi.xyzw vf12, vi02 | nop ;; store shader4/5 + +;; fade out setup (todo). it just modifies shaders + mtir vi14, vf12.z | nop + isw.x vi10, -1(vi02) | nop + ibeq vi14, vi13, L11 | nop + isw.y vi11, -1(vi02) | nop + ilw.x vi13, -4(vi02) | nop + isubiu vi14, vi00, 0x1d | nop + iand vi13, vi13, vi14 | nop + iaddi vi13, vi13, 0xc | nop + isw.x vi13, -4(vi02) | nop + iaddiu vi13, vi00, 0x42 | nop + isw.z vi13, -1(vi02) | nop + +;; loop! +L11: + ibgtz vi08, L10 | nop ;; cool trick, eop is the sign bit here. + sq.xyzw vf14, 0(vi02) | nop + +;; end of shader and strip setup. + +;; matrix crap 1 +L12: + lq.xyzw vf28, 3(vi00) | nop ;; vf28 = persp-diag + ilw.y vi08, 3(vi12) | nop ;; vi08 = mat-slot.0 + lq.xyzw vf16, 5(vi00) | nop ;; vf16 = scaled-persp-diag + lq.xyzw vf20, 4(vi00) | nop ;; vf20 = persp-off + ilw.z vi09, 3(vi12) | mul.xyzw vf27, vf28, vf15 ;; vf27 = [pdx, pdy, pdz, 0], vi09 = mat-slot.1 + ior vi11, vi08, vi00 | mul.xyzw vf28, vf28, vf00 ;; vf28 = [0, 0, 0, pdw], vi11 = vi08 = mat-slot.0 + ibeq vi00, vi08, L14 | mul.xyzw vf15, vf16, vf15 ;; vf15 = [spdx, spdy, spdz, 0], skip if slot = 0 + iaddi vi13, vi12, 0x3 | mul.xyzw vf16, vf16, vf00 ;; vi13 = mat-slot-ptr, vf16 = [0, 0, 0, spdw] + + ;; pipelined matrix thing + ;; multiply matrices and store them back + ;; run until we get a slot of 0. + ;; mula.xyzw ACC, vf15, vf08 + ;; maddz.xyzw vf09, vf16, vf08 + ;; mula.xyzw ACC, vf15, vf10 + ;; maddz.xyzw vf11, vf16, vf10 + ;; mula.xyzw ACC, vf15, vf12 + ;; maddz.xyzw vf13, vf16, vf12 + ;; addax.xyzw vf20, vf00 + ;; madda.xyzw ACC, vf27, vf25 + ;; maddz.xyzw vf26, vf28, vf25 + +L13: + lq.xyzw vf08, 0(vi08) | addax.xyzw vf20, vf00 + lq.xyzw vf10, 1(vi08) | madda.xyzw ACC, vf27, vf25 + lq.xyzw vf12, 2(vi08) | maddz.xyzw vf26, vf28, vf25 + lq.xyzw vf25, 3(vi08) | nop + sq.xyzw vf09, 0(vi11) | mula.xyzw ACC, vf15, vf08 + sq.xyzw vf11, 1(vi11) | maddz.xyzw vf09, vf16, vf08 + sq.xyzw vf13, 2(vi11) | mula.xyzw ACC, vf15, vf10 + sq.xyzw vf26, 3(vi11) | maddz.xyzw vf11, vf16, vf10 + ibeq vi00, vi08, L14 | mula.xyzw ACC, vf15, vf12 + ilwr.w vi10, vi13 | maddz.xyzw vf13, vf16, vf12 + lq.xyzw vf08, 0(vi09) | addax.xyzw vf20, vf00 + lq.xyzw vf10, 1(vi09) | madda.xyzw ACC, vf27, vf25 + lq.xyzw vf12, 2(vi09) | maddz.xyzw vf26, vf28, vf25 + lq.xyzw vf25, 3(vi09) | nop + sq.xyzw vf09, 0(vi08) | mula.xyzw ACC, vf15, vf08 + sq.xyzw vf11, 1(vi08) | maddz.xyzw vf09, vf16, vf08 + sq.xyzw vf13, 2(vi08) | mula.xyzw ACC, vf15, vf10 + sq.xyzw vf26, 3(vi08) | maddz.xyzw vf11, vf16, vf10 + ibeq vi00, vi09, L14 | mula.xyzw ACC, vf15, vf12 + ilw.x vi11, 1(vi13) | maddz.xyzw vf13, vf16, vf12 + lq.xyzw vf08, 0(vi10) | addax.xyzw vf20, vf00 + lq.xyzw vf10, 1(vi10) | madda.xyzw ACC, vf27, vf25 + lq.xyzw vf12, 2(vi10) | maddz.xyzw vf26, vf28, vf25 + lq.xyzw vf25, 3(vi10) | nop + sq.xyzw vf09, 0(vi09) | mula.xyzw ACC, vf15, vf08 + sq.xyzw vf11, 1(vi09) | maddz.xyzw vf09, vf16, vf08 + sq.xyzw vf13, 2(vi09) | mula.xyzw ACC, vf15, vf10 + sq.xyzw vf26, 3(vi09) | maddz.xyzw vf11, vf16, vf10 + ibeq vi00, vi10, L14 | mula.xyzw ACC, vf15, vf12 + ilw.y vi08, 1(vi13) | maddz.xyzw vf13, vf16, vf12 + lq.xyzw vf08, 0(vi11) | addax.xyzw vf20, vf00 + lq.xyzw vf10, 1(vi11) | madda.xyzw ACC, vf27, vf25 + lq.xyzw vf12, 2(vi11) | maddz.xyzw vf26, vf28, vf25 + lq.xyzw vf25, 3(vi11) | nop + sq.xyzw vf09, 0(vi10) | mula.xyzw ACC, vf15, vf08 + sq.xyzw vf11, 1(vi10) | maddz.xyzw vf09, vf16, vf08 + sq.xyzw vf13, 2(vi10) | mula.xyzw ACC, vf15, vf10 + sq.xyzw vf26, 3(vi10) | maddz.xyzw vf11, vf16, vf10 + iaddi vi13, vi13, 0x1 | nop + ibne vi00, vi11, L13 | mula.xyzw ACC, vf15, vf12 + ilwr.z vi09, vi13 | maddz.xyzw vf13, vf16, vf12 +;; end matrix setup + +;; the L14 -> L26 area handles mat1s. +;; it appears to set vi03 as the rgba reading pointer +;; and vi04 as the end of mat1's rgba (poniter to last, not one past the end) +;; and vi06 as the end of mat2's rgba +;; and vi07 as the end of mat3's rgba + +L14: + ilw.x vi02, 3(vi12) | nop ;; vi02 = perc-off + ibeq vi00, vi04, L26 | nop ;; goto L26 if mat1 count is 0 + iadd vi01, vi01, vi12 | nop ;; vi01 = lump. + ilwr.x vi08, vi01 | nop ;; vi08 = lump[0].x = mat-0? + lqi.xyzw vf08, vi01 | nop ;; vf08 = lump[0] = [mat0, mat1, nrmx, posx]? + lqi.xyzw vf11, vi01 | nop ;; vf11 = lump[1] = [dst0, dst1, nrmy, posy]? + lqi.xyzw vf14, vi01 | nop ;; vf14 = lump[2] = [texs, text, nrmz, posz]? + lq.xyz vf29, 4(vi08) | nop ;; vf29 = [nmat0x, nmat0y, nmat0z, 0.003921569] + lq.xyz vf30, 5(vi08) | add.zw vf08, vf08, vf17 ;; add to nrm and pos, keep loading nmat (w is ? here) + lq.xyzw vf31, 6(vi08) | add.xyzw vf11, vf11, vf18 ;; lump unpack and add + iaddi vi04, vi04, -0x1 | add.xyzw vf14, vf14, vf19 ;; lump unpack and add, subtract 1 from mat1 count + iadd vi02, vi02, vi12 | nop ;; vi02 = perc + + ;; right does matrix mul with nmat and the vertex. + ;; it rotates the normal + ;; left lqi's from perc, unpacks dst0, dst1 to vi10 and vi13 + lqi.xyzw vf24, vi02 | mulaz.xyzw ACC, vf29, vf08 + mtir vi10, vf11.x | maddaz.xyzw ACC, vf30, vf11 + mtir vi13, vf11.y | maddz.xyz vf11, vf31, vf14 + + ;; vf25, vf26, vf27, vf28 is the tmat + lq.xyzw vf25, 0(vi08) | nop + lq.xyzw vf26, 1(vi08) | itof0.xyzw vf24, vf24 ;; perc to floats: no idea what this is yet. + lq.xyzw vf27, 2(vi08) | nop + erleng.xyz P, vf11 | nop ;; p = normal length. + lq.xyzw vf28, 3(vi08) | mulaw.xyzw ACC, vf25, vf08 ;; transform point, keep loading tmat + ior vi15, vi07, vi00 | maddaw.xyzw ACC, vf26, vf11 ;; vi15 = using mercprime + mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 ;; vf14.z = 1. (clears nrmz) + lqi.xyzw vf09, vi01 | nop ;; vf09 = [mat0, mat1, nrmx, posx]? (P1) + ilwr.y vi03, vi12 | nop ;; vi03 = rgba-off + ilw.z vi07, 1(vi12) | nop ;; vi07 = mat3-cnt (why.....) + lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 ;; P1 vert load | finish xf pt + lqi.xyzw vf15, vi01 | nop ;; P1 vert load + mtir vi08, vf09.x | nop ;; P1 mat0 + ibeq vi00, vi15, L15 | nop + iadd vi03, vi03, vi12 | nop ;; vi03 = rgba + + ;; only if merc-prime + nop | miniw.w vf08, vf08, vf01 + +L15: +;; rhs is lump adding + div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 ;; perspective divide! + iadd vi04, vi04, vi03 | add.xyzw vf12, vf12, vf18 ;; vi04 = rgba + mat1-cnt - 1 (??) + ;; note: the -1 is because the last vertex is handled + lq.xyz vf29, 4(vi08) | add.xyzw vf15, vf15, vf19 ;; P1 load nmat | P1 lump add v2 + + lq.xyz vf30, 5(vi08) | nop ;; P1 load nmat + iadd vi06, vi06, vi04 | nop ;; vi06 = rgba + mat1-cnt + mat2-cnt - 1 + lq.xyzw vf31, 6(vi08) | nop ;; p1 load mat + lq.xyzw vf25, 0(vi08) | nop ;; p1 load mat + lq.xyzw vf26, 1(vi08) | mul.xyz vf08, vf08, Q ;; p1 load mat | perspective multiply + mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q ;; p1 get dst | vf14 = [s*Q, t*Q, Q, posz*Q] + mtir vi14, vf12.y | nop ;; p1 get dst + lq.xyzw vf27, 2(vi08) | nop ;; p1 load mat + lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 ;; load rgba, hvdf offset + ;; rhs is p1's normal xform + iadd vi07, vi07, vi06 | mulaz.xyzw ACC, vf29, vf09 ;; vi07 = rgba + mat1-cnt + mat2-cnt + mat3-cnt - 1 + lq.xyzw vf28, 3(vi08) | maddaz.xyzw ACC, vf30, vf12 ;; + mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 ;; vf20.w = normal length + nop | nop + 1024.0 | miniw.w vf08, vf08, vf03 :i ;; fog max + ibne vi00, vi15, L82 | mulaw.xyzw ACC, vf25, vf09 ;; if mercprime, goto L82 | rhs is p1 + ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 ;; vi09 = p0 vtx's mat1 | normalization of normal + erleng.xyz P, vf12 | nop ;; p1's nrm length + nop | maddaw.xyzw ACC, vf26, vf12 ;; p1 nrm xf + mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 ;; p1 + lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 ;; dot with light dir + ibne vi04, vi03, L17 | madday.xyzw ACC, vf02, vf11 ;; branch to L17 if not done + nop | maddz.xyzw vf11, vf03, vf11 + ibne vi06, vi03, L31 | nop ;; branch to L31 if mat2's can be done + nop | nop + b L67 | nop ;; go to mat3 + nop | nop + +;; pipelined mat1 loop here +L16: + lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 + sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 + sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 +L17: ;; entry from above. + lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 ;; all p1 + lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 ;; p1 | fog min + mtir vi08, vf10.x | itof0.xyzw vf23, vf23 ;; rgba to float + ilw.y vi09, -9(vi01) | maxx.xyzw vf11, vf11, vf00 ;; vi09 = mat1 | light clamp + div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 ;; pipe 1 + move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 ;; move | pipe1 + lq.xyz vf29, 4(vi08) | add.xyzw vf16, vf16, vf19 ;; pipe | pipe + lq.xyz vf30, 5(vi08) | mulax.xyzw ACC, vf04, vf11 ;; more lights + ibgtz vi09, L18 | madday.xyzw ACC, vf05, vf11 + lq.xyzw vf31, 6(vi08) | maddaz.xyzw ACC, vf06, vf11 + nop | addx.w vf21, vf21, vf17 +L18: + lq.xyzw vf25, 0(vi08) | maddw.xyzw vf11, vf07, vf00 ;; p1 | add ambient + lq.xyzw vf26, 1(vi08) | mul.xyz vf09, vf09, Q ;; p | p + mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q ;; p | p + mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 ;; p | position ftoi + lq.xyzw vf27, 2(vi08) | mul.xyzw vf11, vf11, vf23 ;; p | vertex coloring + lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 + ibne vi00, vi09, L19 | mulaz.xyzw ACC, vf29, vf10 + sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 + nop | ftoi4.xyzw vf21, vf08 +L19: + mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 + sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 + sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 + sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 + lq.xyzw vf28, 3(vi08) | mulw.xyzw vf12, vf12, vf20 + erleng.xyz P, vf13 | ftoi0.xyzw vf11, vf11 + ;; branch to end (first version in this loop) + ibne vi04, vi03, L20 | maddaw.xyzw ACC, vf26, vf13 + mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 + ibne vi06, vi03, L36 | nop ;; branch if there's mat2's to do + ilw.y vi09, -6(vi01) | nop ;; pipeline "exiting" + ibne vi07, vi03, L72 | nop + nop | nop + b L143 | nop + nop | nop +L20: + lqi.xyzw vf08, vi01 | mulax.xyzw ACC, vf01, vf12 ;; + sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 ;; + sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 ;; + lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 ;; + lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 ;; + mtir vi08, vf08.x | itof0.xyzw vf23, vf23 ;; + ilw.y vi09, -9(vi01) | maxx.xyzw vf12, vf12, vf00 ;; + div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 ;; + move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 ;; + lq.xyz vf29, 4(vi08) | add.xyzw vf14, vf14, vf19 + lq.xyz vf30, 5(vi08) | mulax.xyzw ACC, vf04, vf12 ;; + ibgtz vi09, L21 | madday.xyzw ACC, vf05, vf12 ;; + lq.xyzw vf31, 6(vi08) | maddaz.xyzw ACC, vf06, vf12 ;; + nop | addx.w vf21, vf21, vf17 ;; +L21: + lq.xyzw vf25, 0(vi08) | maddw.xyzw vf12, vf07, vf00 ;; + lq.xyzw vf26, 1(vi08) | mul.xyz vf10, vf10, Q ;; + mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q ;; + mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 ;; + lq.xyzw vf27, 2(vi08) | mul.xyzw vf12, vf12, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 + ibne vi00, vi09, L22 | mulaz.xyzw ACC, vf29, vf08 + sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 ;; + nop | ftoi4.xyzw vf21, vf09 +L22: + mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 ;; + sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 ;; + sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 ;; + sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 ;; + lq.xyzw vf28, 3(vi08) | mulw.xyzw vf13, vf13, vf20 ;; + erleng.xyz P, vf11 | ftoi0.xyzw vf12, vf12 ;; + ibne vi04, vi03, L23 | maddaw.xyzw ACC, vf26, vf11 + mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 + ibne vi06, vi03, L41 | nop + ilw.y vi09, -6(vi01) | nop + ibne vi07, vi03, L77 | nop + nop | nop + b L153 | nop + nop | nop +L23: + lqi.xyzw vf09, vi01 | mulax.xyzw ACC, vf01, vf13 ;; + sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 ;; + sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 ;; + lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 + lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 ;; + mtir vi08, vf09.x | itof0.xyzw vf23, vf23 ;; + ilw.y vi09, -9(vi01) | maxx.xyzw vf13, vf13, vf00 + div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 + move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 ;; + lq.xyz vf29, 4(vi08) | add.xyzw vf15, vf15, vf19 + lq.xyz vf30, 5(vi08) | mulax.xyzw ACC, vf04, vf13 ;; + ibgtz vi09, L24 | madday.xyzw ACC, vf05, vf13 ;; + lq.xyzw vf31, 6(vi08) | maddaz.xyzw ACC, vf06, vf13 ;; + nop | addx.w vf21, vf21, vf17 ;; +L24: + lq.xyzw vf25, 0(vi08) | maddw.xyzw vf13, vf07, vf00 + lq.xyzw vf26, 1(vi08) | mul.xyz vf08, vf08, Q + mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q + mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 ;; + lq.xyzw vf27, 2(vi08) | mul.xyzw vf13, vf13, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 + ibne vi00, vi09, L25 | mulaz.xyzw ACC, vf29, vf09 + sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 + nop | ftoi4.xyzw vf21, vf10 +L25: + mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 + sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 + sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 + sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 + lq.xyzw vf28, 3(vi08) | mulw.xyzw vf11, vf11, vf20 + erleng.xyz P, vf12 | ftoi0.xyzw vf13, vf13 + ibne vi04, vi03, L16 | maddaw.xyzw ACC, vf26, vf12 + mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 + ibne vi06, vi03, L30 | nop + ilw.y vi09, -6(vi01) | nop + ibne vi07, vi03, L66 | nop + nop | nop + b L163 | nop + nop | nop + +L26: ;; pipeline startup for mat2's (assuming you had no mat1's to get things started) + ibeq vi00, vi06, L61 | nop ;; goto L61 if no mat2's + iadd vi02, vi02, vi12 | nop ;; compute perc offset + lqi.xyzw vf08, vi01 | nop ;; vf08 = vtx0 = [mat0, mat1, nrmx, posx] + lqi.xyzw vf24, vi02 | nop ;; vf24 = perc + lqi.xyzw vf11, vi01 | nop ;; vf11 = vtx1 = [dst0, dst1, nrmy, posy] + lqi.xyzw vf14, vi01 | nop ;; vf14 = vtx2 = [texs, text, nrmz, posz] + mtir vi10, vf08.x | nop ;; vi10 = mat0 + mtir vi13, vf08.y | itof0.xyzw vf24, vf24 ;; vi13 = mat1 | vf24 = itof0(perc) + iaddi vi06, vi06, -0x1 | add.zw vf08, vf08, vf17 ;; dec count | lump offset + nop | add.xyzw vf11, vf11, vf18 ;; lump offset + iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 ;; vi10 = mat0 & 0x7f | lump offset + nop | mulw.xyzw vf24, vf24, vf29 ;; scale perc + iand vi13, vi13, vi05 | nop ;; vi13 = mat1 & 0x7f + + ;; left col is loading matrices, right col is multiplication by perc. + lq.xyzw vf20, 0(vi10) | nop + lq.xyzw vf25, 0(vi13) | nop + lq.xyzw vf23, 1(vi10) | nop + lq.xyzw vf26, 1(vi13) | nop + lq.xyzw vf20, 2(vi10) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf27, 2(vi13) | maddy.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 3(vi10) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf28, 3(vi13) | maddy.xyzw vf26, vf26, vf24 + lq.xyzw vf20, 4(vi10) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi13) | maddy.xyzw vf27, vf27, vf24 + lq.xyzw vf23, 5(vi10) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi13) | maddy.xyzw vf28, vf28, vf24 + lq.xyzw vf20, 6(vi10) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf31, 6(vi13) | maddy.xyz vf29, vf29, vf24 + mtir vi10, vf11.x | mulax.xyzw ACC, vf23, vf24 + mtir vi13, vf11.y | maddy.xyz vf30, vf30, vf24 + nop | mulax.xyzw ACC, vf20, vf24 + nop | maddy.xyzw vf31, vf31, vf24 ;; last perc multiply + nop | mulaz.xyzw ACC, vf29, vf08 ;; rotate normal + nop | maddaz.xyzw ACC, vf30, vf11 + nop | maddz.xyz vf11, vf31, vf14 + nop | nop + nop | nop + nop | mulaw.xyzw ACC, vf25, vf08 ;; xf point + iaddiu vi08, vi00, 0x243 | nop ;; vi08 = 0x243 = 579 + erleng.xyz P, vf11 | nop ;; length of normal + ior vi15, vi07, vi00 | maddaw.xyzw ACC, vf26, vf11 ;; vi15 = mercprimt | xf point + mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 ;; set vf14.z = 1.0 | xf point + lqi.xyzw vf09, vi01 | nop ;; pipe | + ilwr.y vi03, vi12 | nop ;; vi03 = rgba-off + ilw.z vi07, 1(vi12) | nop ;; vi07 = mat3-cnt + lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 ;; pipe | xf point + lqi.xyzw vf15, vi01 | nop ;; pipe + mtir vi11, vf09.x | nop ;; pipe + ibeq vi00, vi15, L27 | nop ;; goto L27 if no merc-prim + mtir vi14, vf09.y | nop ;; pipe + iaddiu vi08, vi00, 0x539 | miniw.w vf08, vf08, vf01 ;; ONLY RUN IF MERCPRIME +L27: + div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 ;; perspective divide | pipe + iadd vi03, vi03, vi12 | add.xyzw vf12, vf12, vf18 ;; rgba off | pipe + iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 ;; pipe | pipe + iadd vi06, vi06, vi03 | nop ;; end addr calc1 + iadd vi07, vi07, vi06 | nop ;; end addr calc2 + iand vi14, vi14, vi05 | nop ;; pipe + ibne vi05, vi11, L28 | nop ;; branch on next(?) vertex mat0 sign bit + nop | mul.xyz vf08, vf08, Q ;; perspective + mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q + mtir vi14, vf12.y | nop + b L29 | nop ;; branch to skip matrix load, if possible + lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 ;; load rgba | hvdf offset +L28: + lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q + lq.xyzw vf25, 0(vi14) | nop + lq.xyzw vf23, 1(vi11) | nop + lq.xyzw vf26, 1(vi14) | add.xyzw vf08, vf08, vf22 + lq.xyzw vf20, 2(vi11) | mulaz.xyzw ACC, vf20, vf24 + lq.xyzw vf27, 2(vi14) | maddw.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 3(vi11) | mulaz.xyzw ACC, vf23, vf24 + lq.xyzw vf28, 3(vi14) | maddw.xyzw vf26, vf26, vf24 + lq.xyzw vf20, 4(vi11) | mulaz.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi14) | maddw.xyzw vf27, vf27, vf24 + lq.xyzw vf23, 5(vi11) | mulaz.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi14) | maddw.xyzw vf28, vf28, vf24 + lq.xyzw vf20, 6(vi11) | mulaz.xyzw ACC, vf20, vf24 + lq.xyzw vf31, 6(vi14) | maddw.xyz vf29, vf29, vf24 + lqi.xyzw vf23, vi02 | mulaz.xyzw ACC, vf23, vf24 + mtir vi11, vf12.x | maddw.xyz vf30, vf30, vf24 + mtir vi14, vf12.y | mulaz.xyzw ACC, vf20, vf24 + iaddiu vi08, vi00, 0x1a1 | maddw.xyzw vf31, vf31, vf24 + ibeq vi00, vi15, L29 | nop + lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 + iaddiu vi08, vi00, 0x48e | nop +L29: + nop | mulaz.xyzw ACC, vf29, vf09 ;; pipe + nop | maddaz.xyzw ACC, vf30, vf12 ;; pipe + mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 ;; normal length | pipe + nop | nop + 1024.0 | miniw.w vf08, vf08, vf03 :i ;; fog max + ibne vi00, vi15, L93 | mulaw.xyzw ACC, vf25, vf09 ;; mercprime | pipe + ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 ;; vi09 = mat1 | normalize + erleng.xyz P, vf12 | nop ;; pipe + ibeq vi06, vi03, L65 | maddaw.xyzw ACC, vf26, vf12 ;; check done | pipe + mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 ;; pipe | pipe + lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 ;; pipe | dot product with light + jr vi08 | madday.xyzw ACC, vf02, vf11 + nop | maddz.xyzw vf11, vf03, vf11 +L30: ;; mat2 cross entry 3 + lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 + sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 + sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 +L31: + lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 + lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 + mtir vi12, vf10.x | itof0.xyzw vf23, vf23 + mtir vi15, vf10.y | maxx.xyzw vf11, vf11, vf00 + div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 + move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 + iand vi12, vi12, vi05 | add.xyzw vf16, vf16, vf19 + nop | mulax.xyzw ACC, vf04, vf11 + ibgtz vi09, L32 | madday.xyzw ACC, vf05, vf11 + iand vi15, vi15, vi05 | maddaz.xyzw ACC, vf06, vf11 + nop | addx.w vf21, vf21, vf17 +L32: + ibne vi05, vi12, L33 | maddw.xyzw vf11, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf09, vf09, Q + mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q + mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 + b L34 | mul.xyzw vf11, vf11, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 +L33: + lq.xyzw vf20, 0(vi12) | mul.xyzw vf15, vf15, Q + nop | mulw.xyzw vf24, vf24, vf29 + lq.xyzw vf25, 0(vi15) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf23, 1(vi12) | mul.xyzw vf11, vf11, vf23 + lq.xyzw vf26, 1(vi15) | add.xyzw vf09, vf09, vf22 + lq.xyzw vf20, 2(vi12) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf27, 2(vi15) | maddy.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 3(vi12) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf28, 3(vi15) | maddy.xyzw vf26, vf26, vf24 + lq.xyzw vf20, 4(vi12) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi15) | maddy.xyzw vf27, vf27, vf24 + lq.xyzw vf23, 5(vi12) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi15) | maddy.xyzw vf28, vf28, vf24 + lq.xyzw vf20, 6(vi12) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf31, 6(vi15) | maddy.xyz vf29, vf29, vf24 + mtir vi12, vf13.x | mulax.xyzw ACC, vf23, vf24 + mtir vi15, vf13.y | maddy.xyz vf30, vf30, vf24 + b L49 | mulax.xyzw ACC, vf20, vf24 + lqi.xyzw vf23, vi03 | maddy.xyzw vf31, vf31, vf24 +L34: + ibgez vi09, L35 | mulaz.xyzw ACC, vf29, vf10 + sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 + nop | ftoi4.xyzw vf21, vf08 +L35: + mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 + sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 + sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 + sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 + ilw.y vi09, -6(vi01) | mulw.xyzw vf12, vf12, vf20 + erleng.xyz P, vf13 | ftoi0.xyzw vf11, vf11 + ibne vi06, vi03, L36 | maddaw.xyzw ACC, vf26, vf13 + mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 + ibne vi07, vi03, L72 | nop + nop | nop + b L143 | nop + nop | nop +L36: ;; mat2 cross entry 1 + lqi.xyzw vf08, vi01 | mulax.xyzw ACC, vf01, vf12 + sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 + sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 + ;; END of first vertex.... + lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 + lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 + mtir vi10, vf08.x | itof0.xyzw vf23, vf23 + mtir vi13, vf08.y | maxx.xyzw vf12, vf12, vf00 + div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 + move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 + iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 + nop | mulax.xyzw ACC, vf04, vf12 + ibgtz vi09, L37 | madday.xyzw ACC, vf05, vf12 + iand vi13, vi13, vi05 | maddaz.xyzw ACC, vf06, vf12 + nop | addx.w vf21, vf21, vf17 +L37: + ibne vi05, vi10, L38 | maddw.xyzw vf12, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf10, vf10, Q + mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q + mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 + b L39 | mul.xyzw vf12, vf12, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 +L38: + lq.xyzw vf20, 0(vi10) | mul.xyzw vf16, vf16, Q + nop | mulw.xyzw vf24, vf24, vf29 + lq.xyzw vf25, 0(vi13) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf23, 1(vi10) | mul.xyzw vf12, vf12, vf23 + lq.xyzw vf26, 1(vi13) | add.xyzw vf10, vf10, vf22 + lq.xyzw vf20, 2(vi10) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf27, 2(vi13) | maddy.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 3(vi10) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf28, 3(vi13) | maddy.xyzw vf26, vf26, vf24 + lq.xyzw vf20, 4(vi10) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi13) | maddy.xyzw vf27, vf27, vf24 + lq.xyzw vf23, 5(vi10) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi13) | maddy.xyzw vf28, vf28, vf24 + lq.xyzw vf20, 6(vi10) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf31, 6(vi13) | maddy.xyz vf29, vf29, vf24 + mtir vi10, vf11.x | mulax.xyzw ACC, vf23, vf24 + mtir vi13, vf11.y | maddy.xyz vf30, vf30, vf24 + b L54 | mulax.xyzw ACC, vf20, vf24 + lqi.xyzw vf23, vi03 | maddy.xyzw vf31, vf31, vf24 +L39: + ibgez vi09, L40 | mulaz.xyzw ACC, vf29, vf08 + sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 + nop | ftoi4.xyzw vf21, vf09 +L40: + mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 + sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 + sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 + sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 + ilw.y vi09, -6(vi01) | mulw.xyzw vf13, vf13, vf20 + erleng.xyz P, vf11 | ftoi0.xyzw vf12, vf12 + ibne vi06, vi03, L41 | maddaw.xyzw ACC, vf26, vf11 + mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 + ibne vi07, vi03, L77 | nop + nop | nop + b L153 | nop + nop | nop +L41: ;; mat2 cross entry 2 + lqi.xyzw vf09, vi01 | mulax.xyzw ACC, vf01, vf13 + sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 + sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 + lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 + lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 + mtir vi11, vf09.x | itof0.xyzw vf23, vf23 + mtir vi14, vf09.y | maxx.xyzw vf13, vf13, vf00 + div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 + move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 + iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 + nop | mulax.xyzw ACC, vf04, vf13 + ibgtz vi09, L42 | madday.xyzw ACC, vf05, vf13 + iand vi14, vi14, vi05 | maddaz.xyzw ACC, vf06, vf13 + nop | addx.w vf21, vf21, vf17 +L42: + ibne vi05, vi11, L43 | maddw.xyzw vf13, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf08, vf08, Q + mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q + mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 + b L44 | mul.xyzw vf13, vf13, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 +L43: + lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q + nop | mulw.xyzw vf24, vf24, vf29 + lq.xyzw vf25, 0(vi14) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf23, 1(vi11) | mul.xyzw vf13, vf13, vf23 + lq.xyzw vf26, 1(vi14) | add.xyzw vf08, vf08, vf22 + lq.xyzw vf20, 2(vi11) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf27, 2(vi14) | maddy.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 3(vi11) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf28, 3(vi14) | maddy.xyzw vf26, vf26, vf24 + lq.xyzw vf20, 4(vi11) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi14) | maddy.xyzw vf27, vf27, vf24 + lq.xyzw vf23, 5(vi11) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi14) | maddy.xyzw vf28, vf28, vf24 + lq.xyzw vf20, 6(vi11) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf31, 6(vi14) | maddy.xyz vf29, vf29, vf24 + mtir vi11, vf12.x | mulax.xyzw ACC, vf23, vf24 + mtir vi14, vf12.y | maddy.xyz vf30, vf30, vf24 + b L59 | mulax.xyzw ACC, vf20, vf24 + lqi.xyzw vf23, vi03 | maddy.xyzw vf31, vf31, vf24 +L44: + ibgez vi09, L45 | mulaz.xyzw ACC, vf29, vf09 + sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 + nop | ftoi4.xyzw vf21, vf10 +L45: + mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 + sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 + sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 + sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 + ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 + erleng.xyz P, vf12 | ftoi0.xyzw vf13, vf13 + ibne vi06, vi03, L30 | maddaw.xyzw ACC, vf26, vf12 + mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 + ibne vi07, vi03, L66 | nop + nop | nop + b L163 | nop + nop | nop +L46: + lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 + sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 + sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 + ;; ugh, I think we jump here. + lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 ;; pipe | pipe + lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 ;; pipe | fogmin + mtir vi12, vf10.x | itof0.xyzw vf23, vf23 ;; pipe | vtx color convert + mtir vi15, vf10.y | maxx.xyzw vf11, vf11, vf00 ;; pipe | light clamp + div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 + move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 + iand vi12, vi12, vi05 | add.xyzw vf16, vf16, vf19 + nop | mulax.xyzw ACC, vf04, vf11 + ibgtz vi09, L47 | madday.xyzw ACC, vf05, vf11 + iand vi15, vi15, vi05 | maddaz.xyzw ACC, vf06, vf11 + nop | addx.w vf21, vf21, vf17 +L47: + ibne vi05, vi12, L48 | maddw.xyzw vf11, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf09, vf09, Q + mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q + mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 + b L49 | mul.xyzw vf11, vf11, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 +L48: + lq.xyzw vf20, 0(vi12) | mul.xyzw vf15, vf15, Q + lq.xyzw vf25, 0(vi15) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf23, 1(vi12) | mul.xyzw vf11, vf11, vf23 + lq.xyzw vf26, 1(vi15) | add.xyzw vf09, vf09, vf22 + lq.xyzw vf20, 2(vi12) | mulaz.xyzw ACC, vf20, vf24 + lq.xyzw vf27, 2(vi15) | maddw.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 3(vi12) | mulaz.xyzw ACC, vf23, vf24 + lq.xyzw vf28, 3(vi15) | maddw.xyzw vf26, vf26, vf24 + lq.xyzw vf20, 4(vi12) | mulaz.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi15) | maddw.xyzw vf27, vf27, vf24 + lq.xyzw vf23, 5(vi12) | mulaz.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi15) | maddw.xyzw vf28, vf28, vf24 + lq.xyzw vf20, 6(vi12) | mulaz.xyzw ACC, vf20, vf24 + lq.xyzw vf31, 6(vi15) | maddw.xyz vf29, vf29, vf24 + lqi.xyzw vf23, vi02 | mulaz.xyzw ACC, vf23, vf24 + mtir vi12, vf13.x | maddw.xyz vf30, vf30, vf24 + mtir vi15, vf13.y | mulaz.xyzw ACC, vf20, vf24 + b L34 | maddw.xyzw vf31, vf31, vf24 + lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 +L49: + ibgez vi09, L50 | mulaz.xyzw ACC, vf29, vf10 + sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 ;; first store + nop | ftoi4.xyzw vf21, vf08 +L50: + mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 + sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 + sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 + sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 ;; second store + ilw.y vi09, -6(vi01) | mulw.xyzw vf12, vf12, vf20 + erleng.xyz P, vf13 | ftoi0.xyzw vf11, vf11 + ibne vi06, vi03, L51 | maddaw.xyzw ACC, vf26, vf13 + mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 + ibne vi07, vi03, L72 | nop + nop | nop + b L143 | nop + nop | nop +L51: + lqi.xyzw vf08, vi01 | mulax.xyzw ACC, vf01, vf12 + sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 + sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 + ;; end, for real this time. + lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 + lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 + mtir vi10, vf08.x | itof0.xyzw vf23, vf23 + mtir vi13, vf08.y | maxx.xyzw vf12, vf12, vf00 + div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 + move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 + iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 + nop | mulax.xyzw ACC, vf04, vf12 + ibgtz vi09, L52 | madday.xyzw ACC, vf05, vf12 + iand vi13, vi13, vi05 | maddaz.xyzw ACC, vf06, vf12 + nop | addx.w vf21, vf21, vf17 +L52: + ibne vi05, vi10, L53 | maddw.xyzw vf12, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf10, vf10, Q + mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q + mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 + b L54 | mul.xyzw vf12, vf12, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 +L53: + lq.xyzw vf20, 0(vi10) | mul.xyzw vf16, vf16, Q + lq.xyzw vf25, 0(vi13) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf23, 1(vi10) | mul.xyzw vf12, vf12, vf23 + lq.xyzw vf26, 1(vi13) | add.xyzw vf10, vf10, vf22 + lq.xyzw vf20, 2(vi10) | mulaz.xyzw ACC, vf20, vf24 + lq.xyzw vf27, 2(vi13) | maddw.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 3(vi10) | mulaz.xyzw ACC, vf23, vf24 + lq.xyzw vf28, 3(vi13) | maddw.xyzw vf26, vf26, vf24 + lq.xyzw vf20, 4(vi10) | mulaz.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi13) | maddw.xyzw vf27, vf27, vf24 + lq.xyzw vf23, 5(vi10) | mulaz.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi13) | maddw.xyzw vf28, vf28, vf24 + lq.xyzw vf20, 6(vi10) | mulaz.xyzw ACC, vf20, vf24 + lq.xyzw vf31, 6(vi13) | maddw.xyz vf29, vf29, vf24 + lqi.xyzw vf23, vi02 | mulaz.xyzw ACC, vf23, vf24 + mtir vi10, vf11.x | maddw.xyz vf30, vf30, vf24 + mtir vi13, vf11.y | mulaz.xyzw ACC, vf20, vf24 + b L39 | maddw.xyzw vf31, vf31, vf24 + lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 +L54: + ibgez vi09, L55 | mulaz.xyzw ACC, vf29, vf08 + sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 + nop | ftoi4.xyzw vf21, vf09 +L55: + mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 + sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 + sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 + sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 + ilw.y vi09, -6(vi01) | mulw.xyzw vf13, vf13, vf20 + erleng.xyz P, vf11 | ftoi0.xyzw vf12, vf12 + ibne vi06, vi03, L56 | maddaw.xyzw ACC, vf26, vf11 + mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 + ibne vi07, vi03, L77 | nop + nop | nop + b L153 | nop + nop | nop +L56: + lqi.xyzw vf09, vi01 | mulax.xyzw ACC, vf01, vf13 + sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 + sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 + lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 + lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 + mtir vi11, vf09.x | itof0.xyzw vf23, vf23 + mtir vi14, vf09.y | maxx.xyzw vf13, vf13, vf00 + div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 + move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 + iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 + nop | mulax.xyzw ACC, vf04, vf13 + ibgtz vi09, L57 | madday.xyzw ACC, vf05, vf13 + iand vi14, vi14, vi05 | maddaz.xyzw ACC, vf06, vf13 + nop | addx.w vf21, vf21, vf17 +L57: + ibne vi05, vi11, L58 | maddw.xyzw vf13, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf08, vf08, Q + mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q + mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 + b L59 | mul.xyzw vf13, vf13, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 +L58: + lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q + lq.xyzw vf25, 0(vi14) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf23, 1(vi11) | mul.xyzw vf13, vf13, vf23 + lq.xyzw vf26, 1(vi14) | add.xyzw vf08, vf08, vf22 + lq.xyzw vf20, 2(vi11) | mulaz.xyzw ACC, vf20, vf24 + lq.xyzw vf27, 2(vi14) | maddw.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 3(vi11) | mulaz.xyzw ACC, vf23, vf24 + lq.xyzw vf28, 3(vi14) | maddw.xyzw vf26, vf26, vf24 + lq.xyzw vf20, 4(vi11) | mulaz.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi14) | maddw.xyzw vf27, vf27, vf24 + lq.xyzw vf23, 5(vi11) | mulaz.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi14) | maddw.xyzw vf28, vf28, vf24 + lq.xyzw vf20, 6(vi11) | mulaz.xyzw ACC, vf20, vf24 + lq.xyzw vf31, 6(vi14) | maddw.xyz vf29, vf29, vf24 + lqi.xyzw vf23, vi02 | mulaz.xyzw ACC, vf23, vf24 + mtir vi11, vf12.x | maddw.xyz vf30, vf30, vf24 + mtir vi14, vf12.y | mulaz.xyzw ACC, vf20, vf24 + b L44 | maddw.xyzw vf31, vf31, vf24 + lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 +L59: + ibgez vi09, L60 | mulaz.xyzw ACC, vf29, vf09 + sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 + nop | ftoi4.xyzw vf21, vf10 +L60: + mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 + sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 + sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 + sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 + ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 + erleng.xyz P, vf12 | ftoi0.xyzw vf13, vf13 + ibne vi06, vi03, L46 | maddaw.xyzw ACC, vf26, vf12 + mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 + ibne vi07, vi03, L72 | nop + nop | nop + b L163 | nop + nop | nop + +;; maybe mat3s +L61: + lqi.xyzw vf08, vi01 | nop + lqi.xyzw vf24, vi02 | nop + lqi.xyzw vf11, vi01 | nop + lqi.xyzw vf14, vi01 | nop + mtir vi10, vf08.x | nop + mtir vi13, vf08.y | itof0.xyzw vf24, vf24 + nop | add.zw vf08, vf08, vf17 + nop | add.xyzw vf11, vf11, vf18 + iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 + ilw.w vi08, -1(vi02) | mulw.xyzw vf24, vf24, vf29 + iand vi13, vi13, vi05 | nop + lq.xyzw vf20, 0(vi10) | nop + lq.xyzw vf31, 0(vi13) | nop + lq.xyzw vf25, 0(vi08) | nop + lq.xyzw vf23, 1(vi10) | nop + lq.xyzw vf20, 1(vi13) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 2(vi10) | maddz.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 2(vi13) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 3(vi10) | maddz.xyzw vf26, vf26, vf24 + lq.xyzw vf31, 3(vi13) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 + lq.xyzw vf23, 4(vi10) | maddz.xyzw vf27, vf27, vf24 + lq.xyzw vf20, 4(vi13) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 5(vi10) | maddz.xyzw vf28, vf28, vf24 + lq.xyzw vf23, 5(vi13) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 6(vi10) | maddz.xyz vf29, vf29, vf24 + lq.xyzw vf22, 6(vi13) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 + lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 + mtir vi10, vf11.x | mulax.xyzw ACC, vf20, vf24 + mtir vi13, vf11.y | madday.xyzw ACC, vf22, vf24 + lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 + nop | itof0.xyzw vf24, vf23 + nop | mulaz.xyzw ACC, vf29, vf08 + nop | maddaz.xyzw ACC, vf30, vf11 + nop | maddz.xyz vf11, vf31, vf14 + nop | nop + nop | nop + nop | mulaw.xyzw ACC, vf25, vf08 + nop | nop + erleng.xyz P, vf11 | nop + ior vi15, vi07, vi00 | maddaw.xyzw ACC, vf26, vf11 + mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 + lqi.xyzw vf09, vi01 | nop + ilwr.y vi03, vi12 | nop + ilw.z vi07, 1(vi12) | nop + lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 + lqi.xyzw vf15, vi01 | nop + mtir vi11, vf09.x | nop + ibeq vi00, vi15, L62 | nop + mtir vi14, vf09.y | nop + nop | miniw.w vf08, vf08, vf01 +L62: + div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 + iadd vi03, vi03, vi12 | add.xyzw vf12, vf12, vf18 + iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 + ilw.w vi08, -1(vi02) | nop + iadd vi07, vi07, vi03 | nop + iand vi14, vi14, vi05 | nop + ibne vi05, vi11, L63 | nop + iaddi vi07, vi07, -0x1 | mul.xyz vf08, vf08, Q + mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q + mtir vi14, vf12.y | nop + b L64 | nop + lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 +L63: + lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q + nop | mulw.xyzw vf24, vf24, vf29 + lq.xyzw vf31, 0(vi14) | nop + lq.xyzw vf25, 0(vi08) | nop + lq.xyzw vf23, 1(vi11) | add.xyzw vf08, vf08, vf22 + lq.xyzw vf20, 1(vi14) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 2(vi11) | maddz.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 2(vi14) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 3(vi11) | maddz.xyzw vf26, vf26, vf24 + lq.xyzw vf31, 3(vi14) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 + lq.xyzw vf23, 4(vi11) | maddz.xyzw vf27, vf27, vf24 + lq.xyzw vf20, 4(vi14) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 5(vi11) | maddz.xyzw vf28, vf28, vf24 + lq.xyzw vf23, 5(vi14) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 6(vi11) | maddz.xyz vf29, vf29, vf24 + lq.xyzw vf22, 6(vi14) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 + lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 + mtir vi11, vf12.x | mulax.xyzw ACC, vf20, vf24 + mtir vi14, vf12.y | madday.xyzw ACC, vf22, vf24 + lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 + lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 +L64: + nop | mulaz.xyzw ACC, vf29, vf09 + nop | maddaz.xyzw ACC, vf30, vf12 + mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 + nop | nop + 1024.0 | miniw.w vf08, vf08, vf03 :i + ibne vi00, vi15, L125 | mulaw.xyzw ACC, vf25, vf09 + ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 + erleng.xyz P, vf12 | nop + nop | maddaw.xyzw ACC, vf26, vf12 + mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 +L65: + lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 + b L67 | madday.xyzw ACC, vf02, vf11 + nop | maddz.xyzw vf11, vf03, vf11 +L66: ;; mat3 cross entry + lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 + sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 + sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 +L67: + lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 + lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 + mtir vi12, vf10.x | itof0.xyzw vf23, vf23 + mtir vi15, vf10.y | maxx.xyzw vf11, vf11, vf00 + div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 + move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 + iand vi12, vi12, vi05 | add.xyzw vf16, vf16, vf19 + ilw.w vi08, -1(vi02) | mulax.xyzw ACC, vf04, vf11 + ibgtz vi09, L68 | madday.xyzw ACC, vf05, vf11 + iand vi15, vi15, vi05 | maddaz.xyzw ACC, vf06, vf11 + nop | addx.w vf21, vf21, vf17 +L68: + ibne vi05, vi12, L69 | maddw.xyzw vf11, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf09, vf09, Q + mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q + mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 + b L70 | mul.xyzw vf11, vf11, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 +L69: + lq.xyzw vf20, 0(vi12) | mul.xyzw vf15, vf15, Q + nop | mulw.xyzw vf24, vf24, vf29 + lq.xyzw vf31, 0(vi15) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf25, 0(vi08) | mul.xyzw vf11, vf11, vf23 + lq.xyzw vf23, 1(vi12) | add.xyzw vf09, vf09, vf22 + lq.xyzw vf20, 1(vi15) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 2(vi12) | maddz.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 2(vi15) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 3(vi12) | maddz.xyzw vf26, vf26, vf24 + lq.xyzw vf31, 3(vi15) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 + lq.xyzw vf23, 4(vi12) | maddz.xyzw vf27, vf27, vf24 + lq.xyzw vf20, 4(vi15) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 5(vi12) | maddz.xyzw vf28, vf28, vf24 + lq.xyzw vf23, 5(vi15) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 6(vi12) | maddz.xyz vf29, vf29, vf24 + lq.xyzw vf22, 6(vi15) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 + lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 + mtir vi12, vf13.x | mulax.xyzw ACC, vf20, vf24 + mtir vi15, vf13.y | madday.xyzw ACC, vf22, vf24 + lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 + lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 +L70: + ibgez vi09, L71 | mulaz.xyzw ACC, vf29, vf10 + sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 + nop | ftoi4.xyzw vf21, vf08 +L71: + mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 + sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 + sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 + sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 + ilw.y vi09, -6(vi01) | mulw.xyzw vf12, vf12, vf20 + erleng.xyz P, vf13 | ftoi0.xyzw vf11, vf11 + ibeq vi07, vi03, L143 | maddaw.xyzw ACC, vf26, vf13 + mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 +L72: ;; mat3 cross entry + lqi.xyzw vf08, vi01 | mulax.xyzw ACC, vf01, vf12 + sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 + sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 + lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 + lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 + mtir vi10, vf08.x | itof0.xyzw vf23, vf23 + mtir vi13, vf08.y | maxx.xyzw vf12, vf12, vf00 + div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 + move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 + iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 + ilw.w vi08, -1(vi02) | mulax.xyzw ACC, vf04, vf12 + ibgtz vi09, L73 | madday.xyzw ACC, vf05, vf12 + iand vi13, vi13, vi05 | maddaz.xyzw ACC, vf06, vf12 + nop | addx.w vf21, vf21, vf17 +L73: + ibne vi05, vi10, L74 | maddw.xyzw vf12, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf10, vf10, Q + mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q + mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 + b L75 | mul.xyzw vf12, vf12, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 +L74: + lq.xyzw vf20, 0(vi10) | mul.xyzw vf16, vf16, Q + nop | mulw.xyzw vf24, vf24, vf29 + lq.xyzw vf31, 0(vi13) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf25, 0(vi08) | mul.xyzw vf12, vf12, vf23 + lq.xyzw vf23, 1(vi10) | add.xyzw vf10, vf10, vf22 + lq.xyzw vf20, 1(vi13) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 2(vi10) | maddz.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 2(vi13) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 3(vi10) | maddz.xyzw vf26, vf26, vf24 + lq.xyzw vf31, 3(vi13) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 + lq.xyzw vf23, 4(vi10) | maddz.xyzw vf27, vf27, vf24 + lq.xyzw vf20, 4(vi13) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 5(vi10) | maddz.xyzw vf28, vf28, vf24 + lq.xyzw vf23, 5(vi13) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 6(vi10) | maddz.xyz vf29, vf29, vf24 + lq.xyzw vf22, 6(vi13) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 + lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 + mtir vi10, vf11.x | mulax.xyzw ACC, vf20, vf24 + mtir vi13, vf11.y | madday.xyzw ACC, vf22, vf24 + lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 + lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 +L75: + ibgez vi09, L76 | mulaz.xyzw ACC, vf29, vf08 + sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 + nop | ftoi4.xyzw vf21, vf09 +L76: + mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 + sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 + sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 + sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 + ilw.y vi09, -6(vi01) | mulw.xyzw vf13, vf13, vf20 + erleng.xyz P, vf11 | ftoi0.xyzw vf12, vf12 + ibeq vi07, vi03, L153 | maddaw.xyzw ACC, vf26, vf11 + mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 +L77: ;; mat3 cross entry + lqi.xyzw vf09, vi01 | mulax.xyzw ACC, vf01, vf13 + sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 + sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 + lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 + lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 + mtir vi11, vf09.x | itof0.xyzw vf23, vf23 + mtir vi14, vf09.y | maxx.xyzw vf13, vf13, vf00 + div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 + move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 + iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 + ilw.w vi08, -1(vi02) | mulax.xyzw ACC, vf04, vf13 + ibgtz vi09, L78 | madday.xyzw ACC, vf05, vf13 + iand vi14, vi14, vi05 | maddaz.xyzw ACC, vf06, vf13 + nop | addx.w vf21, vf21, vf17 +L78: + ibne vi05, vi11, L79 | maddw.xyzw vf13, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf08, vf08, Q + mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q + mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 + b L80 | mul.xyzw vf13, vf13, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 +L79: + lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q + nop | mulw.xyzw vf24, vf24, vf29 + lq.xyzw vf31, 0(vi14) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf25, 0(vi08) | mul.xyzw vf13, vf13, vf23 + lq.xyzw vf23, 1(vi11) | add.xyzw vf08, vf08, vf22 + lq.xyzw vf20, 1(vi14) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 2(vi11) | maddz.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 2(vi14) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 3(vi11) | maddz.xyzw vf26, vf26, vf24 + lq.xyzw vf31, 3(vi14) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 + lq.xyzw vf23, 4(vi11) | maddz.xyzw vf27, vf27, vf24 + lq.xyzw vf20, 4(vi14) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 5(vi11) | maddz.xyzw vf28, vf28, vf24 + lq.xyzw vf23, 5(vi14) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 6(vi11) | maddz.xyz vf29, vf29, vf24 + lq.xyzw vf22, 6(vi14) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 + lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 + mtir vi11, vf12.x | mulax.xyzw ACC, vf20, vf24 + mtir vi14, vf12.y | madday.xyzw ACC, vf22, vf24 + lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 + lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 +L80: + ibgez vi09, L81 | mulaz.xyzw ACC, vf29, vf09 + sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 + nop | ftoi4.xyzw vf21, vf10 +L81: + mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 + sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 + sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 + sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 + ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 + erleng.xyz P, vf12 | ftoi0.xyzw vf13, vf13 + ibne vi07, vi03, L66 | maddaw.xyzw ACC, vf26, vf12 + mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 + b L163 | nop + nop | nop + +;; merc prime, or other weird things. +L82: + erleng.xyz P, vf12 | maxi.xy vf08, vf08, I + 3072.0 | nop :i + nop | minii.xy vf08, vf08, I + nop | maddaw.xyzw ACC, vf26, vf12 + mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 + lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 + ibne vi04, vi03, L84 | madday.xyzw ACC, vf02, vf11 + nop | maddz.xyzw vf11, vf03, vf11 + ibne vi06, vi03, L95 | nop + nop | nop + b L128 | nop + nop | nop +L83: + 3072.0 | mulax.xyzw ACC, vf01, vf11 :i + lqi.xyzw vf10, vi01 | minii.xy vf08, vf08, I + sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 + sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 +L84: + lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 + lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 + mtir vi08, vf10.x | itof0.xyzw vf23, vf23 + ilw.y vi09, -9(vi01) | maxx.xyzw vf11, vf11, vf00 + nop | miniw.w vf09, vf09, vf01 + div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 + move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 + lq.xyz vf29, 4(vi08) | add.xyzw vf16, vf16, vf19 + lq.xyz vf30, 5(vi08) | mulax.xyzw ACC, vf04, vf11 + ibgtz vi09, L85 | madday.xyzw ACC, vf05, vf11 + lq.xyzw vf31, 6(vi08) | maddaz.xyzw ACC, vf06, vf11 + nop | addx.w vf21, vf21, vf17 +L85: + lq.xyzw vf25, 0(vi08) | maddw.xyzw vf11, vf07, vf00 + lq.xyzw vf26, 1(vi08) | mul.xyz vf09, vf09, Q + mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q + mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 + lq.xyzw vf27, 2(vi08) | mul.xyzw vf11, vf11, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 + ibne vi00, vi09, L86 | mulaz.xyzw ACC, vf29, vf10 + sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 + nop | ftoi4.xyzw vf21, vf08 +L86: + mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 + sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 + sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 + sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 + lq.xyzw vf28, 3(vi08) | mulw.xyzw vf12, vf12, vf20 + 1024.0 | ftoi0.xyzw vf11, vf11 :i + erleng.xyz P, vf13 | maxi.xy vf09, vf09, I + ibne vi04, vi03, L87 | maddaw.xyzw ACC, vf26, vf13 + mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 + ibne vi06, vi03, L100 | nop + ilw.y vi09, -6(vi01) | nop + ibne vi07, vi03, L133 | nop + nop | nop + b L143 | nop + nop | nop +L87: + 3072.0 | mulax.xyzw ACC, vf01, vf12 :i + lqi.xyzw vf08, vi01 | minii.xy vf09, vf09, I + sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 + sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 + lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 + lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 + mtir vi08, vf08.x | itof0.xyzw vf23, vf23 + ilw.y vi09, -9(vi01) | maxx.xyzw vf12, vf12, vf00 + nop | miniw.w vf10, vf10, vf01 + div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 + move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 + lq.xyz vf29, 4(vi08) | add.xyzw vf14, vf14, vf19 + lq.xyz vf30, 5(vi08) | mulax.xyzw ACC, vf04, vf12 + ibgtz vi09, L88 | madday.xyzw ACC, vf05, vf12 + lq.xyzw vf31, 6(vi08) | maddaz.xyzw ACC, vf06, vf12 + nop | addx.w vf21, vf21, vf17 +L88: + lq.xyzw vf25, 0(vi08) | maddw.xyzw vf12, vf07, vf00 + lq.xyzw vf26, 1(vi08) | mul.xyz vf10, vf10, Q + mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q + mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 + lq.xyzw vf27, 2(vi08) | mul.xyzw vf12, vf12, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 + ibne vi00, vi09, L89 | mulaz.xyzw ACC, vf29, vf08 + sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 + nop | ftoi4.xyzw vf21, vf09 +L89: + mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 + sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 + sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 + sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 + lq.xyzw vf28, 3(vi08) | mulw.xyzw vf13, vf13, vf20 + 1024.0 | ftoi0.xyzw vf12, vf12 :i + erleng.xyz P, vf11 | maxi.xy vf10, vf10, I + ibne vi04, vi03, L90 | maddaw.xyzw ACC, vf26, vf11 + mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 + ibne vi06, vi03, L105 | nop + ilw.y vi09, -6(vi01) | nop + ibne vi07, vi03, L138 | nop + nop | nop + b L153 | nop + nop | nop +L90: + 3072.0 | mulax.xyzw ACC, vf01, vf13 :i + lqi.xyzw vf09, vi01 | minii.xy vf10, vf10, I + sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 + sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 + lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 + lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 + mtir vi08, vf09.x | itof0.xyzw vf23, vf23 + ilw.y vi09, -9(vi01) | maxx.xyzw vf13, vf13, vf00 + nop | miniw.w vf08, vf08, vf01 + div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 + move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 + lq.xyz vf29, 4(vi08) | add.xyzw vf15, vf15, vf19 + lq.xyz vf30, 5(vi08) | mulax.xyzw ACC, vf04, vf13 + ibgtz vi09, L91 | madday.xyzw ACC, vf05, vf13 + lq.xyzw vf31, 6(vi08) | maddaz.xyzw ACC, vf06, vf13 + nop | addx.w vf21, vf21, vf17 +L91: + lq.xyzw vf25, 0(vi08) | maddw.xyzw vf13, vf07, vf00 + lq.xyzw vf26, 1(vi08) | mul.xyz vf08, vf08, Q + mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q + mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 + lq.xyzw vf27, 2(vi08) | mul.xyzw vf13, vf13, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 + ibne vi00, vi09, L92 | mulaz.xyzw ACC, vf29, vf09 + sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 + nop | ftoi4.xyzw vf21, vf10 +L92: + mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 + sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 + sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 + sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 + lq.xyzw vf28, 3(vi08) | mulw.xyzw vf11, vf11, vf20 + 1024.0 | ftoi0.xyzw vf13, vf13 :i + erleng.xyz P, vf12 | maxi.xy vf08, vf08, I + ibne vi04, vi03, L83 | maddaw.xyzw ACC, vf26, vf12 + mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 + ibne vi06, vi03, L94 | nop + ilw.y vi09, -6(vi01) | nop + ibne vi07, vi03, L127 | nop + nop | nop + b L163 | nop + nop | nop +L93: + erleng.xyz P, vf12 | maxi.xy vf08, vf08, I + 3072.0 | nop :i + nop | minii.xy vf08, vf08, I + ibeq vi06, vi03, L126 | maddaw.xyzw ACC, vf26, vf12 + mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 + lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 + jr vi08 | madday.xyzw ACC, vf02, vf11 + nop | maddz.xyzw vf11, vf03, vf11 +L94: + 3072.0 | mulax.xyzw ACC, vf01, vf11 :i + lqi.xyzw vf10, vi01 | minii.xy vf08, vf08, I + sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 + sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 +L95: + lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 + lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 + mtir vi12, vf10.x | itof0.xyzw vf23, vf23 + mtir vi15, vf10.y | maxx.xyzw vf11, vf11, vf00 + nop | miniw.w vf09, vf09, vf01 + div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 + move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 + iand vi12, vi12, vi05 | add.xyzw vf16, vf16, vf19 + nop | mulax.xyzw ACC, vf04, vf11 + ibgtz vi09, L96 | madday.xyzw ACC, vf05, vf11 + iand vi15, vi15, vi05 | maddaz.xyzw ACC, vf06, vf11 + nop | addx.w vf21, vf21, vf17 +L96: + ibne vi05, vi12, L97 | maddw.xyzw vf11, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf09, vf09, Q + mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q + mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 + b L98 | mul.xyzw vf11, vf11, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 +L97: + lq.xyzw vf20, 0(vi12) | mul.xyzw vf15, vf15, Q + nop | mulw.xyzw vf24, vf24, vf29 + lq.xyzw vf25, 0(vi15) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf23, 1(vi12) | mul.xyzw vf11, vf11, vf23 + lq.xyzw vf26, 1(vi15) | add.xyzw vf09, vf09, vf22 + lq.xyzw vf20, 2(vi12) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf27, 2(vi15) | maddy.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 3(vi12) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf28, 3(vi15) | maddy.xyzw vf26, vf26, vf24 + lq.xyzw vf20, 4(vi12) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi15) | maddy.xyzw vf27, vf27, vf24 + lq.xyzw vf23, 5(vi12) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi15) | maddy.xyzw vf28, vf28, vf24 + lq.xyzw vf20, 6(vi12) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf31, 6(vi15) | maddy.xyz vf29, vf29, vf24 + mtir vi12, vf13.x | mulax.xyzw ACC, vf23, vf24 + mtir vi15, vf13.y | maddy.xyz vf30, vf30, vf24 + b L113 | mulax.xyzw ACC, vf20, vf24 + lqi.xyzw vf23, vi03 | maddy.xyzw vf31, vf31, vf24 +L98: + ibgez vi09, L99 | mulaz.xyzw ACC, vf29, vf10 + sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 + nop | ftoi4.xyzw vf21, vf08 +L99: + mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 + sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 + sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 + sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 + ilw.y vi09, -6(vi01) | mulw.xyzw vf12, vf12, vf20 + 1024.0 | ftoi0.xyzw vf11, vf11 :i + erleng.xyz P, vf13 | maxi.xy vf09, vf09, I + ibne vi06, vi03, L100 | maddaw.xyzw ACC, vf26, vf13 + mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 + ibne vi07, vi03, L133 | nop + nop | nop + b L143 | nop + nop | nop +L100: + 3072.0 | mulax.xyzw ACC, vf01, vf12 :i + lqi.xyzw vf08, vi01 | minii.xy vf09, vf09, I + sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 + sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 + lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 + lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 + mtir vi10, vf08.x | itof0.xyzw vf23, vf23 + mtir vi13, vf08.y | maxx.xyzw vf12, vf12, vf00 + nop | miniw.w vf10, vf10, vf01 + div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 + move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 + iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 + nop | mulax.xyzw ACC, vf04, vf12 + ibgtz vi09, L101 | madday.xyzw ACC, vf05, vf12 + iand vi13, vi13, vi05 | maddaz.xyzw ACC, vf06, vf12 + nop | addx.w vf21, vf21, vf17 +L101: + ibne vi05, vi10, L102 | maddw.xyzw vf12, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf10, vf10, Q + mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q + mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 + b L103 | mul.xyzw vf12, vf12, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 +L102: + lq.xyzw vf20, 0(vi10) | mul.xyzw vf16, vf16, Q + nop | mulw.xyzw vf24, vf24, vf29 + lq.xyzw vf25, 0(vi13) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf23, 1(vi10) | mul.xyzw vf12, vf12, vf23 + lq.xyzw vf26, 1(vi13) | add.xyzw vf10, vf10, vf22 + lq.xyzw vf20, 2(vi10) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf27, 2(vi13) | maddy.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 3(vi10) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf28, 3(vi13) | maddy.xyzw vf26, vf26, vf24 + lq.xyzw vf20, 4(vi10) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi13) | maddy.xyzw vf27, vf27, vf24 + lq.xyzw vf23, 5(vi10) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi13) | maddy.xyzw vf28, vf28, vf24 + lq.xyzw vf20, 6(vi10) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf31, 6(vi13) | maddy.xyz vf29, vf29, vf24 + mtir vi10, vf11.x | mulax.xyzw ACC, vf23, vf24 + mtir vi13, vf11.y | maddy.xyz vf30, vf30, vf24 + b L118 | mulax.xyzw ACC, vf20, vf24 + lqi.xyzw vf23, vi03 | maddy.xyzw vf31, vf31, vf24 +L103: + ibgez vi09, L104 | mulaz.xyzw ACC, vf29, vf08 + sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 + nop | ftoi4.xyzw vf21, vf09 +L104: + mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 + sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 + sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 + sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 + ilw.y vi09, -6(vi01) | mulw.xyzw vf13, vf13, vf20 + 1024.0 | ftoi0.xyzw vf12, vf12 :i + erleng.xyz P, vf11 | maxi.xy vf10, vf10, I + ibne vi06, vi03, L105 | maddaw.xyzw ACC, vf26, vf11 + mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 + ibne vi07, vi03, L138 | nop + nop | nop + b L153 | nop + nop | nop +L105: + 3072.0 | mulax.xyzw ACC, vf01, vf13 :i + lqi.xyzw vf09, vi01 | minii.xy vf10, vf10, I + sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 + sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 + lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 + lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 + mtir vi11, vf09.x | itof0.xyzw vf23, vf23 + mtir vi14, vf09.y | maxx.xyzw vf13, vf13, vf00 + nop | miniw.w vf08, vf08, vf01 + div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 + move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 + iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 + nop | mulax.xyzw ACC, vf04, vf13 + ibgtz vi09, L106 | madday.xyzw ACC, vf05, vf13 + iand vi14, vi14, vi05 | maddaz.xyzw ACC, vf06, vf13 + nop | addx.w vf21, vf21, vf17 +L106: + ibne vi05, vi11, L107 | maddw.xyzw vf13, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf08, vf08, Q + mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q + mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 + b L108 | mul.xyzw vf13, vf13, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 +L107: + lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q + nop | mulw.xyzw vf24, vf24, vf29 + lq.xyzw vf25, 0(vi14) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf23, 1(vi11) | mul.xyzw vf13, vf13, vf23 + lq.xyzw vf26, 1(vi14) | add.xyzw vf08, vf08, vf22 + lq.xyzw vf20, 2(vi11) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf27, 2(vi14) | maddy.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 3(vi11) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf28, 3(vi14) | maddy.xyzw vf26, vf26, vf24 + lq.xyzw vf20, 4(vi11) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi14) | maddy.xyzw vf27, vf27, vf24 + lq.xyzw vf23, 5(vi11) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi14) | maddy.xyzw vf28, vf28, vf24 + lq.xyzw vf20, 6(vi11) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf31, 6(vi14) | maddy.xyz vf29, vf29, vf24 + mtir vi11, vf12.x | mulax.xyzw ACC, vf23, vf24 + mtir vi14, vf12.y | maddy.xyz vf30, vf30, vf24 + b L123 | mulax.xyzw ACC, vf20, vf24 + lqi.xyzw vf23, vi03 | maddy.xyzw vf31, vf31, vf24 +L108: + ibgez vi09, L109 | mulaz.xyzw ACC, vf29, vf09 + sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 + nop | ftoi4.xyzw vf21, vf10 +L109: + mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 + sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 + sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 + sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 + ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 + 1024.0 | ftoi0.xyzw vf13, vf13 :i + erleng.xyz P, vf12 | maxi.xy vf08, vf08, I + ibne vi06, vi03, L94 | maddaw.xyzw ACC, vf26, vf12 + mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 + ibne vi07, vi03, L127 | nop + nop | nop + b L163 | nop + nop | nop +L110: + 3072.0 | mulax.xyzw ACC, vf01, vf11 :i + lqi.xyzw vf10, vi01 | minii.xy vf08, vf08, I + sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 + sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 + lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 + lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 + mtir vi12, vf10.x | itof0.xyzw vf23, vf23 + mtir vi15, vf10.y | maxx.xyzw vf11, vf11, vf00 + nop | miniw.w vf09, vf09, vf01 + div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 + move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 + iand vi12, vi12, vi05 | add.xyzw vf16, vf16, vf19 + nop | mulax.xyzw ACC, vf04, vf11 + ibgtz vi09, L111 | madday.xyzw ACC, vf05, vf11 + iand vi15, vi15, vi05 | maddaz.xyzw ACC, vf06, vf11 + nop | addx.w vf21, vf21, vf17 +L111: + ibne vi05, vi12, L112 | maddw.xyzw vf11, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf09, vf09, Q + mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q + mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 + b L113 | mul.xyzw vf11, vf11, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 +L112: + lq.xyzw vf20, 0(vi12) | mul.xyzw vf15, vf15, Q + lq.xyzw vf25, 0(vi15) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf23, 1(vi12) | mul.xyzw vf11, vf11, vf23 + lq.xyzw vf26, 1(vi15) | add.xyzw vf09, vf09, vf22 + lq.xyzw vf20, 2(vi12) | mulaz.xyzw ACC, vf20, vf24 + lq.xyzw vf27, 2(vi15) | maddw.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 3(vi12) | mulaz.xyzw ACC, vf23, vf24 + lq.xyzw vf28, 3(vi15) | maddw.xyzw vf26, vf26, vf24 + lq.xyzw vf20, 4(vi12) | mulaz.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi15) | maddw.xyzw vf27, vf27, vf24 + lq.xyzw vf23, 5(vi12) | mulaz.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi15) | maddw.xyzw vf28, vf28, vf24 + lq.xyzw vf20, 6(vi12) | mulaz.xyzw ACC, vf20, vf24 + lq.xyzw vf31, 6(vi15) | maddw.xyz vf29, vf29, vf24 + lqi.xyzw vf23, vi02 | mulaz.xyzw ACC, vf23, vf24 + mtir vi12, vf13.x | maddw.xyz vf30, vf30, vf24 + mtir vi15, vf13.y | mulaz.xyzw ACC, vf20, vf24 + b L98 | maddw.xyzw vf31, vf31, vf24 + lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 +L113: + ibgez vi09, L114 | mulaz.xyzw ACC, vf29, vf10 + sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 + nop | ftoi4.xyzw vf21, vf08 +L114: + mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 + sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 + sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 + sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 + ilw.y vi09, -6(vi01) | mulw.xyzw vf12, vf12, vf20 + 1024.0 | ftoi0.xyzw vf11, vf11 :i + erleng.xyz P, vf13 | maxi.xy vf09, vf09, I + ibne vi06, vi03, L115 | maddaw.xyzw ACC, vf26, vf13 + mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 + ibne vi07, vi03, L133 | nop + nop | nop + b L143 | nop + nop | nop +L115: + 3072.0 | mulax.xyzw ACC, vf01, vf12 :i + lqi.xyzw vf08, vi01 | minii.xy vf09, vf09, I + sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 + sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 + lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 + lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 + mtir vi10, vf08.x | itof0.xyzw vf23, vf23 + mtir vi13, vf08.y | maxx.xyzw vf12, vf12, vf00 + nop | miniw.w vf10, vf10, vf01 + div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 + move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 + iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 + nop | mulax.xyzw ACC, vf04, vf12 + ibgtz vi09, L116 | madday.xyzw ACC, vf05, vf12 + iand vi13, vi13, vi05 | maddaz.xyzw ACC, vf06, vf12 + nop | addx.w vf21, vf21, vf17 +L116: + ibne vi05, vi10, L117 | maddw.xyzw vf12, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf10, vf10, Q + mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q + mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 + b L118 | mul.xyzw vf12, vf12, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 +L117: + lq.xyzw vf20, 0(vi10) | mul.xyzw vf16, vf16, Q + lq.xyzw vf25, 0(vi13) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf23, 1(vi10) | mul.xyzw vf12, vf12, vf23 + lq.xyzw vf26, 1(vi13) | add.xyzw vf10, vf10, vf22 + lq.xyzw vf20, 2(vi10) | mulaz.xyzw ACC, vf20, vf24 + lq.xyzw vf27, 2(vi13) | maddw.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 3(vi10) | mulaz.xyzw ACC, vf23, vf24 + lq.xyzw vf28, 3(vi13) | maddw.xyzw vf26, vf26, vf24 + lq.xyzw vf20, 4(vi10) | mulaz.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi13) | maddw.xyzw vf27, vf27, vf24 + lq.xyzw vf23, 5(vi10) | mulaz.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi13) | maddw.xyzw vf28, vf28, vf24 + lq.xyzw vf20, 6(vi10) | mulaz.xyzw ACC, vf20, vf24 + lq.xyzw vf31, 6(vi13) | maddw.xyz vf29, vf29, vf24 + lqi.xyzw vf23, vi02 | mulaz.xyzw ACC, vf23, vf24 + mtir vi10, vf11.x | maddw.xyz vf30, vf30, vf24 + mtir vi13, vf11.y | mulaz.xyzw ACC, vf20, vf24 + b L103 | maddw.xyzw vf31, vf31, vf24 + lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 +L118: + ibgez vi09, L119 | mulaz.xyzw ACC, vf29, vf08 + sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 + nop | ftoi4.xyzw vf21, vf09 +L119: + mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 + sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 + sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 + sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 + ilw.y vi09, -6(vi01) | mulw.xyzw vf13, vf13, vf20 + 1024.0 | ftoi0.xyzw vf12, vf12 :i + erleng.xyz P, vf11 | maxi.xy vf10, vf10, I + ibne vi06, vi03, L120 | maddaw.xyzw ACC, vf26, vf11 + mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 + ibne vi07, vi03, L138 | nop + nop | nop + b L153 | nop + nop | nop +L120: + 3072.0 | mulax.xyzw ACC, vf01, vf13 :i + lqi.xyzw vf09, vi01 | minii.xy vf10, vf10, I + sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 + sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 + lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 + lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 + mtir vi11, vf09.x | itof0.xyzw vf23, vf23 + mtir vi14, vf09.y | maxx.xyzw vf13, vf13, vf00 + nop | miniw.w vf08, vf08, vf01 + div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 + move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 + iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 + nop | mulax.xyzw ACC, vf04, vf13 + ibgtz vi09, L121 | madday.xyzw ACC, vf05, vf13 + iand vi14, vi14, vi05 | maddaz.xyzw ACC, vf06, vf13 + nop | addx.w vf21, vf21, vf17 +L121: + ibne vi05, vi11, L122 | maddw.xyzw vf13, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf08, vf08, Q + mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q + mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 + b L123 | mul.xyzw vf13, vf13, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 +L122: + lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q + lq.xyzw vf25, 0(vi14) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf23, 1(vi11) | mul.xyzw vf13, vf13, vf23 + lq.xyzw vf26, 1(vi14) | add.xyzw vf08, vf08, vf22 + lq.xyzw vf20, 2(vi11) | mulaz.xyzw ACC, vf20, vf24 + lq.xyzw vf27, 2(vi14) | maddw.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 3(vi11) | mulaz.xyzw ACC, vf23, vf24 + lq.xyzw vf28, 3(vi14) | maddw.xyzw vf26, vf26, vf24 + lq.xyzw vf20, 4(vi11) | mulaz.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi14) | maddw.xyzw vf27, vf27, vf24 + lq.xyzw vf23, 5(vi11) | mulaz.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi14) | maddw.xyzw vf28, vf28, vf24 + lq.xyzw vf20, 6(vi11) | mulaz.xyzw ACC, vf20, vf24 + lq.xyzw vf31, 6(vi14) | maddw.xyz vf29, vf29, vf24 + lqi.xyzw vf23, vi02 | mulaz.xyzw ACC, vf23, vf24 + mtir vi11, vf12.x | maddw.xyz vf30, vf30, vf24 + mtir vi14, vf12.y | mulaz.xyzw ACC, vf20, vf24 + b L108 | maddw.xyzw vf31, vf31, vf24 + lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 +L123: + ibgez vi09, L124 | mulaz.xyzw ACC, vf29, vf09 + sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 + nop | ftoi4.xyzw vf21, vf10 +L124: + mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 + sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 + sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 + sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 + ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 + 1024.0 | ftoi0.xyzw vf13, vf13 :i + erleng.xyz P, vf12 | maxi.xy vf08, vf08, I + ibne vi06, vi03, L110 | maddaw.xyzw ACC, vf26, vf12 + mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 + ibne vi07, vi03, L133 | nop + nop | nop + b L163 | nop + nop | nop +L125: + erleng.xyz P, vf12 | maxi.xy vf08, vf08, I + 3072.0 | nop :i + nop | minii.xy vf08, vf08, I + nop | maddaw.xyzw ACC, vf26, vf12 + mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 +L126: + lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 + b L128 | madday.xyzw ACC, vf02, vf11 + nop | maddz.xyzw vf11, vf03, vf11 +L127: + 3072.0 | mulax.xyzw ACC, vf01, vf11 :i + lqi.xyzw vf10, vi01 | minii.xy vf08, vf08, I + sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 + sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 +L128: + lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 + lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 + mtir vi12, vf10.x | itof0.xyzw vf23, vf23 + mtir vi15, vf10.y | maxx.xyzw vf11, vf11, vf00 + nop | miniw.w vf09, vf09, vf01 + div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 + move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 + iand vi12, vi12, vi05 | add.xyzw vf16, vf16, vf19 + ilw.w vi08, -1(vi02) | mulax.xyzw ACC, vf04, vf11 + ibgtz vi09, L129 | madday.xyzw ACC, vf05, vf11 + iand vi15, vi15, vi05 | maddaz.xyzw ACC, vf06, vf11 + nop | addx.w vf21, vf21, vf17 +L129: + ibne vi05, vi12, L130 | maddw.xyzw vf11, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf09, vf09, Q + mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q + mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 + b L131 | mul.xyzw vf11, vf11, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 +L130: + lq.xyzw vf20, 0(vi12) | mul.xyzw vf15, vf15, Q + nop | mulw.xyzw vf24, vf24, vf29 + lq.xyzw vf31, 0(vi15) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf25, 0(vi08) | mul.xyzw vf11, vf11, vf23 + lq.xyzw vf23, 1(vi12) | add.xyzw vf09, vf09, vf22 + lq.xyzw vf20, 1(vi15) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 2(vi12) | maddz.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 2(vi15) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 3(vi12) | maddz.xyzw vf26, vf26, vf24 + lq.xyzw vf31, 3(vi15) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 + lq.xyzw vf23, 4(vi12) | maddz.xyzw vf27, vf27, vf24 + lq.xyzw vf20, 4(vi15) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 5(vi12) | maddz.xyzw vf28, vf28, vf24 + lq.xyzw vf23, 5(vi15) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 6(vi12) | maddz.xyz vf29, vf29, vf24 + lq.xyzw vf22, 6(vi15) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 + lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 + mtir vi12, vf13.x | mulax.xyzw ACC, vf20, vf24 + mtir vi15, vf13.y | madday.xyzw ACC, vf22, vf24 + lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 + lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 +L131: + ibgez vi09, L132 | mulaz.xyzw ACC, vf29, vf10 + sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 + nop | ftoi4.xyzw vf21, vf08 +L132: + mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 + sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 + sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 + sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 + ilw.y vi09, -6(vi01) | mulw.xyzw vf12, vf12, vf20 + 1024.0 | ftoi0.xyzw vf11, vf11 :i + erleng.xyz P, vf13 | maxi.xy vf09, vf09, I + ibeq vi07, vi03, L143 | maddaw.xyzw ACC, vf26, vf13 + mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 +L133: + 3072.0 | mulax.xyzw ACC, vf01, vf12 :i + lqi.xyzw vf08, vi01 | minii.xy vf09, vf09, I + sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 + sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 + lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 + lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 + mtir vi10, vf08.x | itof0.xyzw vf23, vf23 + mtir vi13, vf08.y | maxx.xyzw vf12, vf12, vf00 + nop | miniw.w vf10, vf10, vf01 + div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 + move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 + iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 + ilw.w vi08, -1(vi02) | mulax.xyzw ACC, vf04, vf12 + ibgtz vi09, L134 | madday.xyzw ACC, vf05, vf12 + iand vi13, vi13, vi05 | maddaz.xyzw ACC, vf06, vf12 + nop | addx.w vf21, vf21, vf17 +L134: + ibne vi05, vi10, L135 | maddw.xyzw vf12, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf10, vf10, Q + mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q + mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 + b L136 | mul.xyzw vf12, vf12, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 +L135: + lq.xyzw vf20, 0(vi10) | mul.xyzw vf16, vf16, Q + nop | mulw.xyzw vf24, vf24, vf29 + lq.xyzw vf31, 0(vi13) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf25, 0(vi08) | mul.xyzw vf12, vf12, vf23 + lq.xyzw vf23, 1(vi10) | add.xyzw vf10, vf10, vf22 + lq.xyzw vf20, 1(vi13) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 2(vi10) | maddz.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 2(vi13) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 3(vi10) | maddz.xyzw vf26, vf26, vf24 + lq.xyzw vf31, 3(vi13) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 + lq.xyzw vf23, 4(vi10) | maddz.xyzw vf27, vf27, vf24 + lq.xyzw vf20, 4(vi13) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 5(vi10) | maddz.xyzw vf28, vf28, vf24 + lq.xyzw vf23, 5(vi13) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 6(vi10) | maddz.xyz vf29, vf29, vf24 + lq.xyzw vf22, 6(vi13) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 + lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 + mtir vi10, vf11.x | mulax.xyzw ACC, vf20, vf24 + mtir vi13, vf11.y | madday.xyzw ACC, vf22, vf24 + lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 + lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 +L136: + ibgez vi09, L137 | mulaz.xyzw ACC, vf29, vf08 + sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 + nop | ftoi4.xyzw vf21, vf09 +L137: + mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 + sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 + sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 + sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 + ilw.y vi09, -6(vi01) | mulw.xyzw vf13, vf13, vf20 + 1024.0 | ftoi0.xyzw vf12, vf12 :i + erleng.xyz P, vf11 | maxi.xy vf10, vf10, I + ibeq vi07, vi03, L153 | maddaw.xyzw ACC, vf26, vf11 + mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 +L138: + 3072.0 | mulax.xyzw ACC, vf01, vf13 :i + lqi.xyzw vf09, vi01 | minii.xy vf10, vf10, I + sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 + sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 + lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 + lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 + mtir vi11, vf09.x | itof0.xyzw vf23, vf23 + mtir vi14, vf09.y | maxx.xyzw vf13, vf13, vf00 + nop | miniw.w vf08, vf08, vf01 + div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 + move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 + iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 + ilw.w vi08, -1(vi02) | mulax.xyzw ACC, vf04, vf13 + ibgtz vi09, L139 | madday.xyzw ACC, vf05, vf13 + iand vi14, vi14, vi05 | maddaz.xyzw ACC, vf06, vf13 + nop | addx.w vf21, vf21, vf17 +L139: + ibne vi05, vi11, L140 | maddw.xyzw vf13, vf07, vf00 + ilw.x vi09, -9(vi01) | mul.xyz vf08, vf08, Q + mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q + mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 + b L141 | mul.xyzw vf13, vf13, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 +L140: + lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q + nop | mulw.xyzw vf24, vf24, vf29 + lq.xyzw vf31, 0(vi14) | ftoi4.xyzw vf21, vf21 + lq.xyzw vf25, 0(vi08) | mul.xyzw vf13, vf13, vf23 + lq.xyzw vf23, 1(vi11) | add.xyzw vf08, vf08, vf22 + lq.xyzw vf20, 1(vi14) | mulax.xyzw ACC, vf20, vf24 + lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 2(vi11) | maddz.xyzw vf25, vf25, vf24 + lq.xyzw vf23, 2(vi14) | mulax.xyzw ACC, vf23, vf24 + lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 3(vi11) | maddz.xyzw vf26, vf26, vf24 + lq.xyzw vf31, 3(vi14) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 + lq.xyzw vf23, 4(vi11) | maddz.xyzw vf27, vf27, vf24 + lq.xyzw vf20, 4(vi14) | mulax.xyzw ACC, vf20, vf24 + lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 5(vi11) | maddz.xyzw vf28, vf28, vf24 + lq.xyzw vf23, 5(vi14) | mulax.xyzw ACC, vf23, vf24 + lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 + lq.xyzw vf20, 6(vi11) | maddz.xyz vf29, vf29, vf24 + lq.xyzw vf22, 6(vi14) | mulax.xyzw ACC, vf31, vf24 + lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 + lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 + mtir vi11, vf12.x | mulax.xyzw ACC, vf20, vf24 + mtir vi14, vf12.y | madday.xyzw ACC, vf22, vf24 + lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 + lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 +L141: + ibgez vi09, L142 | mulaz.xyzw ACC, vf29, vf09 + sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 + nop | ftoi4.xyzw vf21, vf10 +L142: + mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 + sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 + sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 + sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 + ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 + 1024.0 | ftoi0.xyzw vf13, vf13 :i + erleng.xyz P, vf12 | maxi.xy vf08, vf08, I + ibne vi07, vi03, L127 | maddaw.xyzw ACC, vf26, vf12 + mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 + b L163 | nop + nop | nop +L143: ;; exit cross 1 + ilw.w vi08, 1(vi00) | nop ;; vi08 = mercprime flag + xtop vi02 | mulax.xyzw ACC, vf01, vf12 ;; vi02 = out (0) | pipe + sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 ;; pipe | pipe + sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 ;; pipe | pipe + iaddiu vi04, vi02, 0x8c | add.xyzw vf10, vf10, vf28 ;; vi04 = 140 (byte header) | pipe + ilwr.x vi05, vi04 | maxw.w vf09, vf09, vf02 ;; vi05 = srcdest-off | pipe + ilw.w vi06, 1(vi04) | itof0.xyzw vf23, vf23 ;; vi06 = samecopy-cnt | pipe + ibne vi00, vi08, L151 | nop ;; goto L151 if merc prime (just a detour to set constants). + ilw.x vi07, 2(vi04) | maxx.xyzw vf12, vf12, vf00 ;; vi07 = crosscopy-cnt | pipe +L144: + div Q, vf01.w, vf10.w | minix.xyzw vf25, vf00, vf00 ;; pipe | vf25 = 0 + move.xyzw vf21, vf09 | minix.xyzw vf26, vf00, vf00 ;; pipe | vf26 = 0 + iadd vi05, vi05, vi04 | nop ;; vi05 = srcdest table addr + iaddiu vi04, vi02, 0x173 | mulax.xyzw ACC, vf04, vf12 ;; vi04 = "output zone" | pipe + ibgtz vi09, L145 | madday.xyzw ACC, vf05, vf12 ;; pipe | pipe + iadd vi06, vi06, vi05 | maddaz.xyzw ACC, vf06, vf12 ;; vi06 = cross copy table | pipe + nop | addx.w vf21, vf21, vf17 ;; pipe | pipe +L145: + iadd vi07, vi07, vi06 | maddw.xyzw vf12, vf07, vf00 ;; vi07 = end cross copy table | pipe + ilw.x vi09, -6(vi01) | mul.xyz vf10, vf10, Q ;; ?????? | pipe + iaddiu vi08, vi00, 0x1ba | mul.xyzw vf16, vf16, Q ;; vi08 = 442 | pipe + isub vi08, vi08, vi02 | ftoi4.xyzw vf21, vf21 ;; vi08 is the other buffer | pipe + iaddiu vi08, vi08, 0x173 | mul.xyzw vf12, vf12, vf23 ;; vi08 is the other buffer | pipe + lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 ;; pipe | pipe + ibgez vi09, L146 | nop ;; pipe (but weird, not applicable for mat1, but still works) + sq.xyzw vf21, 2(vi11) | nop ;; pipe + nop | ftoi4.xyzw vf21, vf09 ;; pipe (slightly wrong for mat1, but might not matter?) +L146: + mfp.w vf20, P | nop ;; pipe + sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 ;; pipe + sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 ;; pipe + sq.xyzw vf21, 2(vi14) | nop ;; pipe + ilw.y vi09, -3(vi01) | mulw.xyzw vf13, vf13, vf20 ;; werid pipe | pipe + mfir.x vf25, vi04 | ftoi0.xyzw vf12, vf12 ;; vf25.x = output zone | pipe + mfir.y vf25, vi04 | nop ;; vf25.y = output zone + mfir.x vf26, vi08 | nop ;; vf26.x = old output zone + ilw.w vi02, 1(vi00) | nop ;; vi02 = mercprime flag + mfir.y vf26, vi04 | mulax.xyzw ACC, vf01, vf13 ;; vf26.y = output zone | pipe + sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 ;; pipe | pipe + sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 ;; pipe | pipe + nop | nop ;; ? why the nop ? + ibne vi00, vi02, L152 | maxw.w vf10, vf10, vf02 ;; mercprime detour | pipe + nop | itof0.xyzw vf23, vf23 ;; pipe +L147: + 8388608.0 | maxx.xyzw vf13, vf13, vf00 :i ;; vf13 = 0 + 256.0 | maxi.xy vf27, vf00, I :i ;; vf27.xy = 8388608.0 + move.xyzw vf21, vf10 | maxi.w vf27, vf00, I ;; pipe | vf27.w = 256.0 + nop | nop ;; ?? + nop | mulax.xyzw ACC, vf04, vf13 ;; pipe + ibgtz vi09, L148 | madday.xyzw ACC, vf05, vf13 ;; pipe | pipe + nop | maddaz.xyzw ACC, vf06, vf13 ;; pipe + nop | addx.w vf21, vf21, vf17 ;; pipe +L148: + nop | maddw.xyzw vf13, vf07, vf00 ;; pipe + ilw.x vi09, -3(vi01) | itof0.xyzw vf25, vf25 ;; pipe | zone addrs to float + nop | itof0.xyzw vf26, vf26 ;; zone addrs to float + nop | ftoi4.xyzw vf21, vf21 ;; pipe + nop | mul.xyzw vf13, vf13, vf23 ;; pipe + ior vi02, vi05, vi00 | add.xyzw vf25, vf25, vf27 ;; vi02 = srcdst table | float trick + ibgez vi09, L149 | add.xyzw vf26, vf26, vf27 ;; pipe | float trick + sq.xyzw vf21, 2(vi12) | nop ;; pipe + nop | ftoi4.xyzw vf21, vf10 ;; pipe +L149: + ibne vi06, vi05, L150 | nop + sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 + ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 +L150: + sq.xyzw vf16, 0(vi15) | nop ;; pipe + sq.xyzw vf21, 2(vi15) | nop ;; pipe + lqi.xyzw vf27, vi05 | nop + nop | ftoi0.xyzw vf13, vf13 ;; pipe + nop | nop + nop | nop + nop | itof0.xyzw vf27, vf27 + sq.xyzw vf13, 1(vi12) | nop ;; pipe + b L173 | nop + sq.xyzw vf13, 1(vi15) | nop ;; pipe +L151: + 3072.0 | miniw.w vf10, vf10, vf01 :i + b L144 | minii.xy vf09, vf09, I + nop | nop +L152: + 1024.0 | nop :i + 3072.0 | maxi.xy vf10, vf10, I :i + b L147 | minii.xy vf10, vf10, I + isw.w vi00, 1(vi00) | nop + +L153: ;; exit cross 2 + ilw.w vi08, 1(vi00) | nop + xtop vi02 | mulax.xyzw ACC, vf01, vf13 + sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 + sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 + iaddiu vi04, vi02, 0x8c | add.xyzw vf08, vf08, vf28 + ilwr.x vi05, vi04 | maxw.w vf10, vf10, vf02 + ilw.w vi06, 1(vi04) | itof0.xyzw vf23, vf23 + ibne vi00, vi08, L161 | nop + ilw.x vi07, 2(vi04) | maxx.xyzw vf13, vf13, vf00 +L154: + div Q, vf01.w, vf08.w | minix.xyzw vf25, vf00, vf00 + move.xyzw vf21, vf10 | minix.xyzw vf26, vf00, vf00 + iadd vi05, vi05, vi04 | nop + iaddiu vi04, vi02, 0x173 | mulax.xyzw ACC, vf04, vf13 + ibgtz vi09, L155 | madday.xyzw ACC, vf05, vf13 + iadd vi06, vi06, vi05 | maddaz.xyzw ACC, vf06, vf13 + nop | addx.w vf21, vf21, vf17 +L155: + iadd vi07, vi07, vi06 | maddw.xyzw vf13, vf07, vf00 + ilw.x vi09, -6(vi01) | mul.xyz vf08, vf08, Q + iaddiu vi08, vi00, 0x1ba | mul.xyzw vf14, vf14, Q + isub vi08, vi08, vi02 | ftoi4.xyzw vf21, vf21 + iaddiu vi08, vi08, 0x173 | mul.xyzw vf13, vf13, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 + ibgez vi09, L156 | nop + sq.xyzw vf21, 2(vi12) | nop + nop | ftoi4.xyzw vf21, vf10 +L156: + mfp.w vf20, P | nop + sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 + sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 + sq.xyzw vf21, 2(vi15) | nop + ilw.y vi09, -3(vi01) | mulw.xyzw vf11, vf11, vf20 + mfir.x vf25, vi04 | ftoi0.xyzw vf13, vf13 + mfir.y vf25, vi04 | nop + mfir.x vf26, vi08 | nop + ilw.w vi02, 1(vi00) | nop + mfir.y vf26, vi04 | mulax.xyzw ACC, vf01, vf11 + sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 + sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 + nop | nop + ibne vi00, vi02, L162 | maxw.w vf08, vf08, vf02 + nop | itof0.xyzw vf23, vf23 +L157: + 8388608.0 | maxx.xyzw vf11, vf11, vf00 :i + 256.0 | maxi.xy vf27, vf00, I :i + move.xyzw vf21, vf08 | maxi.w vf27, vf00, I + nop | nop + nop | mulax.xyzw ACC, vf04, vf11 + ibgtz vi09, L158 | madday.xyzw ACC, vf05, vf11 + nop | maddaz.xyzw ACC, vf06, vf11 + nop | addx.w vf21, vf21, vf17 +L158: + nop | maddw.xyzw vf11, vf07, vf00 + ilw.x vi09, -3(vi01) | itof0.xyzw vf25, vf25 + nop | itof0.xyzw vf26, vf26 + nop | ftoi4.xyzw vf21, vf21 + nop | mul.xyzw vf11, vf11, vf23 + ior vi02, vi05, vi00 | add.xyzw vf25, vf25, vf27 + ibgez vi09, L159 | add.xyzw vf26, vf26, vf27 + sq.xyzw vf21, 2(vi10) | nop + nop | ftoi4.xyzw vf21, vf08 +L159: + ibne vi06, vi05, L160 | nop + sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 + ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 +L160: + sq.xyzw vf14, 0(vi13) | nop + sq.xyzw vf21, 2(vi13) | nop + lqi.xyzw vf27, vi05 | nop + nop | ftoi0.xyzw vf11, vf11 + nop | nop + nop | nop + nop | itof0.xyzw vf27, vf27 + sq.xyzw vf11, 1(vi10) | nop + b L173 | nop + sq.xyzw vf11, 1(vi13) | nop +L161: + 3072.0 | miniw.w vf08, vf08, vf01 :i + b L154 | minii.xy vf10, vf10, I + nop | nop +L162: + 1024.0 | nop :i + 3072.0 | maxi.xy vf08, vf08, I :i + b L157 | minii.xy vf08, vf08, I + isw.w vi00, 1(vi00) | nop +L163: ;; exit cross 3 + ilw.w vi08, 1(vi00) | nop + xtop vi02 | mulax.xyzw ACC, vf01, vf11 + sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 + sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 + iaddiu vi04, vi02, 0x8c | add.xyzw vf09, vf09, vf28 + ilwr.x vi05, vi04 | maxw.w vf08, vf08, vf02 + ilw.w vi06, 1(vi04) | itof0.xyzw vf23, vf23 + ibne vi00, vi08, L171 | nop + ilw.x vi07, 2(vi04) | maxx.xyzw vf11, vf11, vf00 +L164: + div Q, vf01.w, vf09.w | minix.xyzw vf25, vf00, vf00 + move.xyzw vf21, vf08 | minix.xyzw vf26, vf00, vf00 + iadd vi05, vi05, vi04 | nop + iaddiu vi04, vi02, 0x173 | mulax.xyzw ACC, vf04, vf11 + ibgtz vi09, L165 | madday.xyzw ACC, vf05, vf11 + iadd vi06, vi06, vi05 | maddaz.xyzw ACC, vf06, vf11 + nop | addx.w vf21, vf21, vf17 +L165: + iadd vi07, vi07, vi06 | maddw.xyzw vf11, vf07, vf00 + ilw.x vi09, -6(vi01) | mul.xyz vf09, vf09, Q + iaddiu vi08, vi00, 0x1ba | mul.xyzw vf15, vf15, Q + isub vi08, vi08, vi02 | ftoi4.xyzw vf21, vf21 + iaddiu vi08, vi08, 0x173 | mul.xyzw vf11, vf11, vf23 + lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 + ibgez vi09, L166 | nop + sq.xyzw vf21, 2(vi10) | nop + nop | ftoi4.xyzw vf21, vf08 +L166: + mfp.w vf20, P | nop + sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 + sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 + sq.xyzw vf21, 2(vi13) | nop + ilw.y vi09, -3(vi01) | mulw.xyzw vf12, vf12, vf20 + mfir.x vf25, vi04 | ftoi0.xyzw vf11, vf11 + mfir.y vf25, vi04 | nop + mfir.x vf26, vi08 | nop + ilw.w vi02, 1(vi00) | nop + mfir.y vf26, vi04 | mulax.xyzw ACC, vf01, vf12 + sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 + sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 + nop | nop + ibne vi00, vi02, L172 | maxw.w vf09, vf09, vf02 + nop | itof0.xyzw vf23, vf23 +L167: + 8388608.0 | maxx.xyzw vf12, vf12, vf00 :i + 256.0 | maxi.xy vf27, vf00, I :i + move.xyzw vf21, vf09 | maxi.w vf27, vf00, I + nop | nop + nop | mulax.xyzw ACC, vf04, vf12 + ibgtz vi09, L168 | madday.xyzw ACC, vf05, vf12 + nop | maddaz.xyzw ACC, vf06, vf12 + nop | addx.w vf21, vf21, vf17 +L168: + nop | maddw.xyzw vf12, vf07, vf00 + ilw.x vi09, -3(vi01) | itof0.xyzw vf25, vf25 + nop | itof0.xyzw vf26, vf26 + nop | ftoi4.xyzw vf21, vf21 + nop | mul.xyzw vf12, vf12, vf23 + ior vi02, vi05, vi00 | add.xyzw vf25, vf25, vf27 + ibgez vi09, L169 | add.xyzw vf26, vf26, vf27 + sq.xyzw vf21, 2(vi11) | nop + nop | ftoi4.xyzw vf21, vf09 +L169: + ibne vi06, vi05, L170 | nop + sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 + ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 +L170: + sq.xyzw vf15, 0(vi14) | nop + sq.xyzw vf21, 2(vi14) | nop + lqi.xyzw vf27, vi05 | nop + nop | ftoi0.xyzw vf12, vf12 + nop | nop + nop | nop + nop | itof0.xyzw vf27, vf27 + sq.xyzw vf12, 1(vi11) | nop + b L173 | nop + sq.xyzw vf12, 1(vi14) | nop +L171: + 3072.0 | miniw.w vf09, vf09, vf01 :i + b L164 | minii.xy vf08, vf08, I + nop | nop +L172: + 1024.0 | nop :i + 3072.0 | maxi.xy vf09, vf09, I :i + b L167 | minii.xy vf09, vf09, I + isw.w vi00, 1(vi00) | nop + +;; end routine. +L173: + ibeq vi07, vi02, L179 | nop + ilw.w vi15, 132(vi00) | nop + ibne vi06, vi05, L174 | add.xyzw vf11, vf27, vf25 + nop | nop + ibne vi07, vi06, L174 | nop + ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 + nop | nop + nop | nop + mtir vi08, vf11.x | nop + mtir vi10, vf11.y | nop + nop | nop + nop | nop + lq.xyzw vf16, 2(vi08) | maxx.xyzw vf15, vf11, vf00 + lq.xyzw vf13, 0(vi08) | nop + b L178 | nop + nop | nop +L174: + lqi.xyzw vf27, vi05 | nop + nop | nop + mtir vi08, vf11.x | nop + mtir vi09, vf11.y | nop + nop | itof0.xyzw vf27, vf27 + nop | nop + lq.xyzw vf12, 2(vi08) | maxx.xyzw vf15, vf11, vf00 + lq.xyzw vf13, 0(vi08) | nop + ibne vi06, vi05, L175 | add.xyzw vf11, vf27, vf25 + nop | nop + ibeq vi07, vi06, L177 | nop + ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 +L175: + lqi.xyzw vf27, vi05 | itof15.w vf12, vf12 + lq.xyzw vf14, 1(vi08) | nop + mtir vi08, vf11.x | nop + mtir vi10, vf11.y | nop + sq.xyzw vf13, 0(vi09) | itof0.xyzw vf27, vf27 + sq.xyzw vf14, 1(vi09) | add.w vf12, vf12, vf15 + lq.xyzw vf16, 2(vi08) | maxx.xyzw vf15, vf11, vf00 + lq.xyzw vf13, 0(vi08) | nop + ibne vi06, vi05, L176 | add.xyzw vf11, vf27, vf25 + sq.xyzw vf12, 2(vi09) | nop + ibne vi07, vi06, L176 | nop + ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 + move.xyzw vf12, vf16 | nop + b L177 | nop + ior vi09, vi10, vi00 | nop +L176: + lqi.xyzw vf27, vi05 | itof15.w vf16, vf16 + lq.xyzw vf14, 1(vi08) | nop + mtir vi08, vf11.x | nop + mtir vi09, vf11.y | nop + sq.xyzw vf13, 0(vi10) | itof0.xyzw vf27, vf27 + sq.xyzw vf14, 1(vi10) | add.w vf16, vf16, vf15 + lq.xyzw vf12, 2(vi08) | maxx.xyzw vf15, vf11, vf00 + lq.xyzw vf13, 0(vi08) | nop + ibne vi06, vi05, L175 | add.xyzw vf11, vf27, vf25 + sq.xyzw vf16, 2(vi10) | nop + ibne vi07, vi06, L175 | nop + ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 +L177: + nop | itof15.w vf12, vf12 + lq.xyzw vf14, 1(vi08) | nop + mtir vi08, vf11.x | nop + mtir vi10, vf11.y | nop + sq.xyzw vf13, 0(vi09) | nop + sq.xyzw vf14, 1(vi09) | add.w vf12, vf12, vf15 + lq.xyzw vf16, 2(vi08) | maxx.xyzw vf15, vf11, vf00 + lq.xyzw vf13, 0(vi08) | nop + nop | nop + sq.xyzw vf12, 2(vi09) | nop +L178: + nop | itof15.w vf16, vf16 + lq.xyzw vf14, 1(vi08) | nop + nop | nop + nop | nop + sq.xyzw vf13, 0(vi10) | nop + sq.xyzw vf14, 1(vi10) | add.w vf16, vf16, vf15 + nop | nop + nop | nop + nop | nop + sq.xyzw vf16, 2(vi10) | nop +L179: + ibne vi00, vi15, L180 | nop + nop | nop + xgkick vi04 | nop + nop | nop :e + nop | nop +L180: + lq.xyzw vf20, 132(vi00) | nop + lq.xyzw vf21, 1(vi00) | nop + iaddi vi01, vi00, 0x1 | nop + isw.x vi01, -2(vi04) | nop + iaddiu vi02, vi00, 0x47 | maxw.x vf20, vf00, vf20 + isw.z vi02, -1(vi04) | nop + sq.yzw vf21, -2(vi04) | nop + isw.w vi00, 132(vi00) | nop + sq.x vf20, -1(vi04) | nop + iaddi vi04, vi04, -0x2 | nop + xgkick vi04 | nop + nop | nop :e + nop | nop + diff --git a/docs/texture_replacement.md b/docs/texture_replacement.md index 870bf835a4..02b0bfe8f1 100644 --- a/docs/texture_replacement.md +++ b/docs/texture_replacement.md @@ -1,5 +1,12 @@ # How to replace textures +## Release build +Create a folder called `texture_replacements` inside the `data` directory. The directory structure should be +``` +data/texture_replacements/page_name/texture_name.png +``` +Where `page_name` is the name of the folder in `data/assets/textures` and `texture_name.png` is the name of the texture. +## From source Textures to be replaced should be saved in ``` jak-project/texture_replacements/page_name/texture_name.png @@ -12,7 +19,7 @@ To make this easier to set up, you can copy the default textures from `assets`, For example, you can copy the `common` folder from `assets/textures` to `texture_replacements`. Then you can modify the png files in `texture_replacements/common` # Rebuilding the game with modified textures -Run the decompiler again to rebuild with modified textures. +Run the decompiler/extractor again to rebuild with modified textures. If it worked, you will see: ``` diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 8fb7b2082b..0000000000 --- a/flake.lock +++ /dev/null @@ -1,25 +0,0 @@ -{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1612312445, - "narHash": "sha256-l8qdZFqwjAGzQrsO+jFqRJA7YnN3jMGe5LGXRMJfcPg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "6b8fca6b5752c5c6038dc9349d0086cf2c49c567", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index 985a5959ca..0000000000 --- a/flake.nix +++ /dev/null @@ -1,168 +0,0 @@ -{ - description = "Jak PC ports via OpenGOAL PC port of Naughty Dog's GOAL"; - - outputs = { self, nixpkgs }: let - getVersionPre = output: - "${nixpkgs.lib.substring 0 8 output.lastModifiedDate}.${output.shortRev or "dirty"}"; - supportedSystems = [ "x86_64-linux" "x86_64-darwin" ]; - forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); - - supportedPackages = [ "jak" "jak-dev" "jak-asan" "jak-asan-dev" ]; - forAllPackages = f: nixpkgs.lib.genAttrs supportedPackages (pname: f pname); - - release = false; - version = "0.5.0" + nixpkgs.lib.optionalString (!release) "-${getVersionPre self}"; - in { - - overlay = pkgs: pkgsSuper: { - jak = pkgs.callPackage ( - { lib, stdenv, buildPackages, fetchFromGitHub, runCommand, writeText - , jak-googletest-src, jak-zydis-src - , llvm ? null - , python3Packages ? null - , enableDevInputs ? false - , enableAsan ? false - , enableFramePointer ? enableAsan - , enablePIE ? false - , enableSourceLevelDebug ? enableAsan - }: - - let - sh = lib.escapeShellArg; - optionalFun = b: f: if b then f else x: x; - inherit (stdenv.cc) isClang; - - llvm-symbolizer = if isClang then runCommand "llvm-symbolizer" { - allowSubstitutes = false; - preferLocalBuild = true; - } '' - mkdir -p "$out/bin" - cp ${sh (lib.getBin llvm)}/bin/llvm-symbolizer "$out/bin"/llvm-symbolizer - '' else null; - - makeFlagArrayBody = prefix: flags: - lib.concatStrings - (lib.mapAttrsToList (n: v: " " + sh "${prefix}${n}=${v}" + " \\\n") flags); - makeFlagArray = name: prefix: flags: - "${name}Array+=( \\\n${makeFlagArrayBody prefix flags})"; - - in stdenv.mkDerivation { - pname = "jak"; - inherit version; - - # Workaround until `src = self;` works with Git submodules. - src = runCommand "source" { - allowSubstitutes = false; - preferLocalBuild = true; - src = self; - } '' - cp -R "$src" "$out" - chmod -R u+w "$out" - shopt -s nullglob dotglob - files=("$out/third-party/googletest"/*); if (( ''${#files[*]} == 0 )); then - echo "providing third-party/googletest submodule via Nix" - rm -df "$out/third-party/googletest" - cp -R ${sh jak-googletest-src} "$out/third-party/googletest" - fi - files=("$out/third-party/zydis"/*); if (( ''${#files[*]} == 0 )); then - echo "providing third-party/zydis submodule via Nix" - rm -df "$out/third-party/zydis" - cp -R ${sh jak-zydis-src} "$out/third-party/zydis" - fi - ''; - - nativeBuildInputs = [ - buildPackages.cmake - buildPackages.nasm - ] ++ lib.optionals enableDevInputs [ - buildPackages.clang-tools # clang-format - python3Packages.pyqt5 - python3Packages.python - ]; - - preConfigure = let - cmakeFlags = lib.pipe { - # https://github.com/NixOS/nixpkgs/pull/108496 - CMAKE_SKIP_BUILD_RPATH = "OFF"; - } [ - (optionalFun enableAsan (o: o // { - ASAN_BUILD = "TRUE"; - })) - (optionalFun enableFramePointer (o: o // { - CMAKE_C_FLAGS = o.CMAKE_C_FLAGS or "" + " -fno-omit-frame-pointer"; - CMAKE_CXX_FLAGS = o.CMAKE_CXX_FLAGS or "" + " -fno-omit-frame-pointer"; - })) - (optionalFun enablePIE (o: o // { - POSITION_INDEPENDENT_CODE = "TRUE"; - })) - (optionalFun enableSourceLevelDebug (o: o // { - CMAKE_C_FLAGS = o.CMAKE_C_FLAGS or "" + " -g"; - CMAKE_CXX_FLAGS = o.CMAKE_CXX_FLAGS or "" + " -g"; - })) - ]; - in '' - ${makeFlagArray "cmakeFlags" "-D" cmakeFlags} - ''; - - doCheck = true; - - dontStrip = enableAsan; - - preFixup = '' - '' + lib.optionalString (enableAsan && llvm-symbolizer != null) '' - for f in "$out/bin"/*; do - wrapProgram "$f" --set LLVM_SYMBOLIZER ${sh llvm-symbolizer}/bin/llvm-symbolizer - done - ''; - - meta = with lib; { - description = "OpenGOAL port of Naughty Dog's GOAL"; - homepage = "https://github.com/water111/jak-project"; - license = lib.licenses.isc; - maintainers = with maintainers; [ bb010g ]; - platforms = platforms.all; - }; - } - ) { }; - jak-dev = pkgs.jak.override { enableDevInputs = true; }; - - jak-asan = pkgs.jak.override { - inherit (pkgs.llvmPackages) llvm; - enableAsan = true; - stdenv = pkgs.clangStdenv; - }; - jak-asan-dev = pkgs.jak-asan.override { enableDevInputs = true; }; - - jak-googletest-src = pkgs.callPackage ({ fetchFromGitHub }: fetchFromGitHub { - owner = "google"; - repo = "googletest"; - rev = "adeef192947fbc0f68fa14a6c494c8df32177508"; - sha256 = "1nsl1c5il6mzwggs5fqcp8gyddk9rs6257vlz0zgpik32miq3cgw"; - }) { }; - - jak-zydis-src = pkgs.callPackage ({ fetchFromGitHub }: fetchFromGitHub { - owner = "zyantific"; - repo = "zydis"; - rev = "c88a4b0cc1271b516b9697af8d088c851745dd60"; - sha256 = "1j28vxr3r6w8xawlagcicbd95dcs85shgsm11b98g3qj45bv3haq"; - fetchSubmodules = true; - }) { }; - }; - - packages = forAllSystems (system: - let systemPackages = (import nixpkgs { - inherit system; - overlays = [ self.overlay ]; - }); in forAllPackages (pname: systemPackages.${pname}) - ); - - defaultPackage = forAllSystems (system: - self.packages.${system}.jak - ); - - devShell = forAllSystems (system: - self.packages.${system}.jak-dev - ); - - }; -} diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index 3e5d0d0472..9ae6b249b4 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -23,20 +23,39 @@ set(RUNTIME_SOURCE sce/sif_ee_memcard.cpp sce/iop.cpp sce/stubs.cpp + kernel/common/fileio.cpp + kernel/common/kboot.cpp + kernel/common/kdgo.cpp + kernel/common/kdsnetm.cpp + kernel/common/klink.cpp + kernel/common/klisten.cpp + kernel/common/kmachine.cpp + kernel/common/kmalloc.cpp + kernel/common/kmemcard.cpp + kernel/common/kprint.cpp + kernel/common/kscheme.cpp + kernel/common/ksocket.cpp + kernel/common/ksound.cpp + kernel/jak1/fileio.cpp + kernel/jak1/kboot.cpp + kernel/jak1/kdgo.cpp + kernel/jak1/klink.cpp + kernel/jak1/klisten.cpp + kernel/jak1/kmachine.cpp + kernel/jak1/kprint.cpp + kernel/jak1/kscheme.cpp + kernel/jak1/ksound.cpp + kernel/jak2/fileio.cpp + kernel/jak2/kboot.cpp + kernel/jak2/kdgo.cpp + kernel/jak2/klink.cpp + kernel/jak2/klisten.cpp + kernel/jak2/kmachine.cpp + kernel/jak2/kmalloc.cpp + kernel/jak2/kprint.cpp + kernel/jak2/kscheme.cpp + kernel/jak2/ksound.cpp kernel/asm_funcs.asm - kernel/fileio.cpp - kernel/kboot.cpp - kernel/kdgo.cpp - kernel/kdsnetm.cpp - kernel/klink.cpp - kernel/klisten.cpp - kernel/kmachine.cpp - kernel/kmalloc.cpp - kernel/kmemcard.cpp - kernel/kprint.cpp - kernel/kscheme.cpp - kernel/ksocket.cpp - kernel/ksound.cpp mips2c/mips2c_table.cpp mips2c/functions/bones.cpp mips2c/functions/collide_cache.cpp @@ -46,7 +65,9 @@ set(RUNTIME_SOURCE mips2c/functions/collide_probe.cpp mips2c/functions/draw_string.cpp mips2c/functions/generic_effect.cpp + mips2c/functions/generic_effect2.cpp mips2c/functions/generic_merc.cpp + mips2c/functions/generic_tie.cpp mips2c/functions/joint.cpp mips2c/functions/merc_blend_shape.cpp mips2c/functions/ocean.cpp @@ -59,6 +80,7 @@ set(RUNTIME_SOURCE mips2c/functions/test_func.cpp mips2c/functions/texture.cpp mips2c/functions/tfrag.cpp + mips2c/functions/tie_methods.cpp mips2c/functions/time_of_day.cpp overlord/dma.cpp overlord/fake_iso.cpp @@ -70,7 +92,6 @@ set(RUNTIME_SOURCE overlord/overlord.cpp overlord/ramdisk.cpp overlord/sbank.cpp - overlord/sndshim.cpp overlord/soundcommon.cpp overlord/srpc.cpp overlord/ssound.cpp @@ -83,6 +104,7 @@ set(RUNTIME_SOURCE graphics/opengl_renderer/background/Tfrag3.cpp graphics/opengl_renderer/background/TFragment.cpp graphics/opengl_renderer/background/Tie3.cpp + graphics/opengl_renderer/foreground/Merc2.cpp graphics/opengl_renderer/foreground/Generic2.cpp graphics/opengl_renderer/foreground/Generic2_DMA.cpp graphics/opengl_renderer/foreground/Generic2_Build.cpp @@ -95,17 +117,15 @@ set(RUNTIME_SOURCE graphics/opengl_renderer/ocean/OceanNear_PS2.cpp graphics/opengl_renderer/ocean/OceanTexture.cpp graphics/opengl_renderer/ocean/OceanTexture_PC.cpp + graphics/opengl_renderer/loader/Loader.cpp + graphics/opengl_renderer/loader/LoaderStages.cpp graphics/opengl_renderer/BucketRenderer.cpp + graphics/opengl_renderer/CollideMeshRenderer.cpp graphics/opengl_renderer/debug_gui.cpp graphics/opengl_renderer/DirectRenderer.cpp graphics/opengl_renderer/DirectRenderer2.cpp graphics/opengl_renderer/EyeRenderer.cpp - graphics/opengl_renderer/GenericProgram.cpp - graphics/opengl_renderer/GenericRenderer.cpp graphics/opengl_renderer/dma_helpers.cpp - graphics/opengl_renderer/Loader.cpp - graphics/opengl_renderer/MercProgram.cpp - graphics/opengl_renderer/MercRenderer.cpp graphics/opengl_renderer/opengl_utils.cpp graphics/opengl_renderer/OpenGLRenderer.cpp graphics/opengl_renderer/Profiler.cpp @@ -118,17 +138,52 @@ set(RUNTIME_SOURCE graphics/opengl_renderer/Sprite3.cpp graphics/opengl_renderer/SpriteRenderer.cpp graphics/opengl_renderer/TextureUploadHandler.cpp + graphics/texture/jak1_tpage_dir.cpp graphics/texture/TextureConverter.cpp graphics/texture/TexturePool.cpp graphics/pipelines/opengl.cpp system/vm/dmac.cpp - system/vm/vm.cpp) + system/vm/vm.cpp + tools/subtitles/subtitle_editor.h + tools/subtitles/subtitle_editor.cpp) +find_package(Git) + +function(write_svnrev_h) + set(GIT_VERSION "") + set(GIT_SHORT_SHA "") + set(GIT_TAG "") + if (GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) + EXECUTE_PROCESS(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD + OUTPUT_VARIABLE GIT_SHORT_SHA + OUTPUT_STRIP_TRAILING_WHITESPACE) + EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} tag --points-at HEAD + OUTPUT_VARIABLE GIT_TAG + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET) + else() + set(GIT_VERSION "unk. rev.") + endif() + if(GIT_TAG) + set(GIT_VERSION ${GIT_TAG}) + elseif(GIT_SHORT_SHA) + string(SUBSTRING ${GIT_SHORT_SHA} 0 6 GIT_SHORT_SHA) + set(GIT_VERSION "rev. ${GIT_SHORT_SHA}") + else() + set(GIT_VERSION "unk. rev.") + endif() + + file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/kernel/svnrev.h "#define GIT_VERSION \"${GIT_VERSION}\"\n") +endfunction() + +write_svnrev_h() + +add_subdirectory(sound) # we build the runtime as a static library. add_library(runtime STATIC ${RUNTIME_SOURCE} "../third-party/glad/src/glad.c") -target_link_libraries(runtime common fmt glfw imgui discord-rpc) +target_link_libraries(runtime common fmt glfw imgui discord-rpc sound stb_image) if(WIN32) target_link_libraries(runtime mman) else() diff --git a/game/assets/game_subtitle.txt b/game/assets/game_subtitle.gp similarity index 66% rename from game/assets/game_subtitle.txt rename to game/assets/game_subtitle.gp index 9db0711a4d..e1961a8f16 100644 --- a/game/assets/game_subtitle.txt +++ b/game/assets/game_subtitle.gp @@ -4,8 +4,8 @@ ;; you can find the game-text-version parsing in .cpp and an enum in goal-lib.gc (subtitle - (jak1-v1 "game/assets/subtitle/jak1/game_subtitle_en.txt") - (jak1-v1 "game/assets/subtitle/jak1/game_subtitle_es.txt") + (jak1-v1 "game/assets/jak1/subtitle/game_subtitle_en.gd") + (jak1-v1 "game/assets/jak1/subtitle/game_subtitle_es.gd") ) diff --git a/game/assets/game_text.gp b/game/assets/game_text.gp new file mode 100644 index 0000000000..ec8a8531f8 --- /dev/null +++ b/game/assets/game_text.gp @@ -0,0 +1,16 @@ +;; "project file" for text make tool. +;; it's very simple... a list of (version file) +;; eventually should also include output filename +;; you can find the game-text-version parsing in .cpp and an enum in goal-lib.gc + +(text + ;; NOTE : we compile using the fixed v2 encoding because it's what we use. + (jak1-v2 "assets/game_text.txt") ;; this is the decompiler-generated file! + ;; "patch" files so we can fix some errors and perhaps maintain consistency + (jak1-v2 "game/assets/jak1/text/text_patch_ja.gs") + ;; add custom files down here + (jak1-v2 "game/assets/jak1/text/game_text_en.gs") + (jak1-v2 "game/assets/jak1/text/game_text_ja.gs") + ) + + diff --git a/game/assets/jak1/patches/0common.xd3 b/game/assets/jak1/patches/0common.xd3 new file mode 100644 index 0000000000..380f9dcb6e Binary files /dev/null and b/game/assets/jak1/patches/0common.xd3 differ diff --git a/game/assets/jak1/patches/1common.xd3 b/game/assets/jak1/patches/1common.xd3 new file mode 100644 index 0000000000..f040c5feb4 Binary files /dev/null and b/game/assets/jak1/patches/1common.xd3 differ diff --git a/game/assets/jak1/patches/2common.xd3 b/game/assets/jak1/patches/2common.xd3 new file mode 100644 index 0000000000..cfff284d43 Binary files /dev/null and b/game/assets/jak1/patches/2common.xd3 differ diff --git a/game/assets/jak1/patches/3common.xd3 b/game/assets/jak1/patches/3common.xd3 new file mode 100644 index 0000000000..d778ffca75 Binary files /dev/null and b/game/assets/jak1/patches/3common.xd3 differ diff --git a/game/assets/jak1/patches/4common.xd3 b/game/assets/jak1/patches/4common.xd3 new file mode 100644 index 0000000000..0c6333c677 Binary files /dev/null and b/game/assets/jak1/patches/4common.xd3 differ diff --git a/game/assets/jak1/patches/5common.xd3 b/game/assets/jak1/patches/5common.xd3 new file mode 100644 index 0000000000..acda99d385 Binary files /dev/null and b/game/assets/jak1/patches/5common.xd3 differ diff --git a/game/assets/jak1/patches/6common.xd3 b/game/assets/jak1/patches/6common.xd3 new file mode 100644 index 0000000000..123fce695f Binary files /dev/null and b/game/assets/jak1/patches/6common.xd3 differ diff --git a/game/assets/jak1/subtitle/game_subtitle_en.gd b/game/assets/jak1/subtitle/game_subtitle_en.gd new file mode 100644 index 0000000000..10aa5491b7 --- /dev/null +++ b/game/assets/jak1/subtitle/game_subtitle_en.gd @@ -0,0 +1,1867 @@ +(language-id 0 6) + +;; ----------------- +;; intro +;; ----------------- + +("sage-intro-sequence-a" + (24 :offscreen "SAGE" "I HAVE SPENT MY LIFE SEARCHING FOR THE ANSWERS THAT MY FATHER, AND MY FATHER'S FATHERS FAILED TO FIND.") + (260 :offscreen "SAGE" "WHO WERE THE PRECURSORS? WHY DID THEY CREATE THE VAST MONOLITHS THAT LITHER OUR PLANET?") + (454 :offscreen "SAGE" "HOW DID THEY HARNESS ECO, THE LIFE ENERGY OF THE WORLD?") + (581 :offscreen "SAGE" "WHAT WAS THEIR PURPOSE? AND WHY DID THEY VANISH?") + (708) + (720 :offscreen "SAGE" "I HAVE ASKED THE PLANTS, BUT THEY DO NOT REMEMBER.") + (818 :offscreen "SAGE" "THE PLANTS HAVE ASKED THE ROCKS, BUT THE ROCKS DO NOT RECALL.") + (955 :offscreen "SAGE" "EVEN THE ROCKS DO NOT RECALL...") + (1064) + (1090 :offscreen "SAGE" "EVERY BONE IN MY BODY TELLS ME THAT THE ANSWERS REST ON THE SHOULDERS OF A YOUNG BOY") + (1297 :offscreen "SAGE" "OBLIVIOUS TO HIS DESTINY, UNINTERESTED IN THE SEARCH FOR TRUTH, AND REJECTING OF MY GUIDANCE!") + (1536) + (1545 :offscreen "SAGE" "AND WHY WOULD HE WANT TO LISTEN TO OLD SAMOS THE SAGE ANYWAY?") + (1680) + (1686 :offscreen "SAGE" "I'M ONLY THE MASTER OF GREEN ECO, ONE OF THE WISEST MEN ON THE PLANET!") + (1875) + (1958 :offscreen "SAGE" "SO IT SEEMS THE ANSWER BEGINS NOT WITH CAREFUL RESEARCH, OR SENSIBLE THINKING.") + (2141) + (2145 :offscreen "SAGE" "NAY! AS WITH MANY OF FATE'S MYSTERIES") + (2281 :offscreen "SAGE" "IT BEGINS WITH BUT A SMALL ACT OF DISOBEDIENCE.") + (2440 "DAXTER" "HEY! UH, JAK? OL' GREEN STUFF TOLD US NOT TO COME HERE!") + ) + +("sage-intro-sequence-d1" + (137 "SAGE" "WHAT IN GREEN TARNATION DO YOU TWO WANT?") + (220 "DAXTER" "WE- WE- WE WAS- THEY WAS- I'M- I WAS-") + (283 "SAGE" "DON'T TELL ME! INSTEAD OF HEEDING MY WISDOM, THE TWO OF YOU WENT MUCKING AROUND") + (440 "SAGE" "IN THE ONLY PLACE THAT I TOLD YOU NOT TO GO: MISTY ISLAND!") + (550 "DAXTER" "THAT'S RIGHT! AND THEN-") + (579 "SAGE" "AND, DAXTER, YOU FINALLY TOOK A MUCH-NEEDED BATH, BUT IN A BATHTUB FILLED WITH DARK ECO.") + (793 "DAXTER" "LOOK, OLD MAN, ARE YOU GONNA KEEP YAPPIN', OR YOU GONNA HELP ME OUTTA THIS MESS!?") + (920 "SAGE" "I'M GONNA KEEP YAPPIN'! BECAUSE IN MY PROFESSIONAL OPINION, THE CHANGE IS AN IMPROVEMENT.") + (1079 "SAGE" "AND BESIDES... I COULDN'T HELP YOU IF I WANTED TO.") + (1186 "DAXTER" "WHAT!?") + (1220 "SAGE" "THERE'S ONLY ONE PERSON WHO HAS STUDIED DARK ECO LONG ENOUGH") + (1329 "SAGE" "TO HAVE A CHANCE AT RETURNING YOU TO YOUR PREVIOUS FORM:") + (1431 "SAGE" "GOL ACHERON, THE SAGE.") + (1493) + (1496 :offscreen "SAGE" "BUT HE LIVES FAR TO THE NORTH. FAR, FAR TO NORTH. NOBODY HAS SPOKEN TO HIM IN AGES.") + (1718 "SAGE" "I WOULD TELEPORT YOU THERE, BUT I CAN'T DO THAT EITHER.") + (1831 "SAGE" "NONE OF THE THREE SAGES THAT MAINTAIN THE OTHER TELEPORTER GATES") + (1934 "SAGE" "HAVE SEEN FIT TO TURN THEIR ENDS ON FOR QUITE A WHILE!") + ) + +("sage-intro-sequence-d2" + (3 "SAGE" "THE ONLY OTHER WAY NORTH IS BY FOOT THROUGH THE FIRE CANYON") + (114 :offscreen "SAGE" "BUT ITS VOLCANIC SOIL IS HOT ENOUGH TO MELT PRECURSOR METAL.") + (224 "SAGE" "YOU CAN'T JUST WALK THROUGH IT.") + (270 "KEIRA" "BUT YOU COULD FLY OVER IT, IF YOU HAD A ZOOMER EQUIPPED WITH A HEAT SHIELD.") + (393) + (396 "KEIRA" "I JUST HAPPEN TO BE WORKING ON SUCH A THING AT THIS VERY MOMENT.") + (512) + (515 "KEIRA" "ALL I WOULD NEED IS TWENTY POWER CELLS TO GIVE IT ENOUGH ENERGY") + (605 "KEIRA" "TO WITHSTAND THE CANYON'S HEAT. ISN'T THAT RIGHT, DADDY?") + (696) + (699 "SAGE" "YES, KEIRA, THAT MIGHT WORK. BUT WHERE ARE A BOY") + (826 :offscreen "SAGE" "AND A HALF!") + (857 "SAGE" "GOING TO GET TWENTY POWER CELLS?") + (910 "KEIRA" "FROM THE VILLAGERS! MOST OF THEM HAVE A POWER CELL OR TWO STASHED AWAY SOMEWHERE.") + (1050 :offscreen "KEIRA" "AND EVEN IF THEY AREN'T WILLING TO JUST GIVE THEM AWAY") + (1133 "KEIRA" "GREASING THEIR PALMS WITH A FEW PRECURSOR ORBS SHOULD DO THE TRICK.") + (1243) + (1246 :offscreen "KEIRA" "AND I BET THERE ARE EVEN MORE OF THEM OUT IN THE WILDS JUST WAITING FOR SOME") + (1364 "KEIRA" "BRAVE ADVENTURER TO FIND.") + (1435 "DAXTER" "WELL WE'VE GOT THE BRAVE ADVENTURER, AT LEAST.") + (1529) + (1532 "SAGE" "BRAVE ADVENTURER?") + (1582 "SAGE" "YOU TWO COULDN'T FIND YOUR WAY OUT OF THE VILLAGE WITHOUT TRAINING!") + (1685) + (1689 "SAGE" "BEFORE YOU DO ANYTHING ELSE, YOU BETTER GO THROUGH THE WARP GATE AND GET") + (1810 "SAGE" "SOME PRACTICE ON GEYSER ROCK.") + (1872) + (1878 "DAXTER" "UH, WE WON'T FIND ANY MORE OF THAT DARK GOOEY ECO STUFF, WILL WE?") + (1993 "DAXTER" "'CAUSE I'D HATE TO FALL IN AGAIN AND TURN INTO YOU!") + (2069) + (2072 "SAGE" "GET IN THERE! BEFORE I TURN YOU BOTH INTO FERNS!") + (2189) + ) + +("sage-intro-sequence-e" + (200 "SAGE" "GOOD TRAINING, BOYS, BUT THAT'S NOTHING COMPARED TO THE CHALLENGES THAT LIE AHEAD.") + (359 "DAXTER" "AH, THEY'RE NO PROBLEM. WE GOT THE MOVES, EH JAK?") + (496 "DAXTER" "WE'D LOVE TO STAY AND CHAT, BIG GREEN, BUT WE'RE UH... ITCHING TO GET ON WITH OUR ADVENTURES.") + (660 "SAGE" "FINE, FINE, \"ADVENTURE\" AWAY THEN.") + (787 "SAGE" "AND WHILE YOU'RE OUT \"ADVENTURING,\" WHY DON'T YOU MAKE YOURSELF USEFUL?") + (940) + (952 :offscreen "SAGE" "MY DARN GREEN ECO COLLECTORS ARE CLOGGED UP AGAIN.") + (1043) + (1046 :offscreen "SAGE" "HEAD OUT TO THE FAR SIDE OF THE BEACH AND CLEAR THEM OUT WHY DON'T YOU.") + (1160) + (1169 :offscreen "SAGE" "FOLLOW THE LAMPS, THEY'LL TAKE YOU RIGHT THERE.") + (1310) + (1313 :offscreen "SAGE" "NOW, ALL OF YOU...") + (1415) + (1439 :offscreen "SAGE" "GET OUT OF HERE!") + ) + +("sidekick-human-intro-sequence-b" + (547 "OLD MAN" "CONTINUE YOUR SEARCH FOR ARTIFACTS AND ECO.") + (674 "OLD MAN" "IF THE LOCALS POSSESS PRECURSOR ITEMS, YOU KNOW WHAT TO DO.") + (842 "WOMAN" "DEAL HARSHLY WITH ANYBODY WHO STRAYS FROM THE VILLAGE.") + (937 "WOMAN" "WE WILL ATTACK IT IN DUE TIME.") + (1027) + ) + +("sidekick-human-intro-sequence-c" + (12 "DAXTER" "WHAT ARE WE DOING HERE ANYWAY, JAK? THIS PLACE GIVES ME THE CREEPS!") + (151) + (369 "DAXTER" "HUH?") + (404 "DAXTER" "(GROAN) STUPID PRECURSOR JUNK!") + (496) + (577 "DAXTER" "EEK! WHAT IS THAT DARK OOZE? IT SURE DON'T LOOK FRIENDLY.") + (721) + (777 "DAXTER" "THE SAGE YAPS ON ABOUT THE PRECURSORS THAT BUILT THIS PLACE ALL THE TIME.") + (909 "DAXTER" "\"WHERE DID THEY GO? WHY DID THEY BUILD THIS CRAP?\"") + (1014 "DAXTER" "NOW I LIKE PRECURSOR ORBS AND POWER CELLS AS MUCH AS THE NEXT GUY") + (1124 "DAXTER" "BUT IF YOU ASK ME, THEY MUST HAVE BEEN REAL LOSERS.") + (1212 "DAXTER" "WHOA! HOW DID YOU DO THAT?") + (1271) + (1331 "DAXTER" "JAK, I THINK WE'RE IN TROUBLE!") + (1386) + (1857 "DAXTER" "MAN, THAT STUNG.") + (1913) + (1941 "DAXTER" "I TOLD YOU WE SHOULDN'T HAVE COME HERE, AND YOU LISTENED?") + (2028) + (2057 "DAXTER" "WHAAAT?") + (2101) + (2189 "DAXTER" "WAAAAAAAAHHHHHHHH!!") + (2307 "DAXTER" "OKAY, OKAY. I'M FINE, I'M FINE...") + (2431) + (2481 "DAXTER" "WAAAAAAAAHHHHHHHH!!") + ) + +;; ----------------- +;; sidekick +;; ----------------- + +("sksp0001" :hint #x280 + (0 "DAXTER" "HEY! THAT SWEET-LOOKING BABE KEIRA WAS RIGHT! THERE ARE TRANS-PADS OUT HERE.") + ) + +("sksp0002" :hint #x281 + (0 "DAXTER" "TRUST ME, THOSE DARK ECO BOXES ARE BAD NEWS!") + ) + +("sksp0003" :hint #x282 + (0 "DAXTER" "I BET IF WE FOUND ALL OF THOSE SICKLY CUTE SCOUT FLIES ON EACH LEVEL") + (215 "DAXTER" "AT LEAST ONE WILL HAVE A POWER CELL!") + ) + +("sksp0004" :hint #x283 + (0 "DAXTER" "ALL RIGHT, TREASURE!") + ) + +("sksp0005" :hint #x284 + (0 "DAXTER" "THESE WOOD AND METAL BOXES DON'T LOOK THAT TOUGH!") + (166 "DAXTER" "I'LL BET THEY'LL BREAK IF YOU JUMP DIVE ONTO THEM.") + ) + +("sksp0006" :hint #x285 + (0 "DAXTER" "THOSE ALL-METAL BOXES ARE THICKER THAN A YAKOW SKULL!") + (188 "DAXTER" "BUT THERE MUST BE SOMETHING THAT CAN BUST 'EM OPEN.") + ) + +("sksp0007" :hint #x286 + (0 "DAXTER" "TWO WORDS: POWER CELLS. WE NEED TO FIND 'EM AND WE AREN'T LOOKIN' SO GOOD RIGHT NOW.") + ) + +("sksp0008" :hint #x287 + (0 "DAXTER" "WE NEED ORBS. ORBS, JAK! HOW ARE EVER GONNA BUY POWER CELLS IF WE DON'T COLLECT ORBS!") + ) + +("sksp0009" :hint #x251 + (0 "DAXTER" "WHAT A WEIRD-LOOKING THING! I'LL BET WE CAN GET THIS OPEN") + (206 "DAXTER" "IF YOU'RE POWERED UP WITH THAT ZAPPY BLUE ECO STUFF.") + ) + +("sksp0014" :hint #x233 + (0 "DAXTER" "WE SCROUNGED ENOUGH ORBS TO TRADE FOR A POWER CELL.") + (215 "DAXTER" "LET'S GET BACK AND MAKE THE SWITCH ALREADY!") + ) + +("sksp0035" :hint #x25c + (0 "DAXTER" "YEAH, SO WE GOT A PRECURSOR LAUNCHER HERE") + (117 "DAXTER" "BUT YOU AREN'T POWERED UP WITH THE BLUE STUFF. SO IT AIN'T GONNA HELP US!") + ) + +("sksp0071" :hint #x2a5 + (0 "DAXTER" "GET THE RED ECO!") + ) + +("sksp0072" :hint #x2a6 + (0 "DAXTER" "RED ECO MAKES YOUR ATTACKS STRONGER.") + ) + +("sksp0073" :hint #x2a7 + (0 "DAXTER" "WE NEED BLUE ECO TO CHARGE THIS PLATFORM UP!") + ) + +("sksp009a" :hint #x0 + (0 "DAXTER" "HA HA! WE SHOWED HIM A THING OR TWO.") + ) + +("sksp009b" :hint #x28e + (0 "DAXTER" "ALL RIGHT, MORE ORBS!") + ) + +("sksp009c" :hint #x28f + (0 "DAXTER" "DO ME A FAVOR AND KEEP AWAY FROM THOSE DARK ECO BOXES!") + ) + +("sksp009d" :hint #x290 + (0 "DAXTER" "YEAH-HA-HA-HA!") + ) + +("sksp009e" :hint #x291 + (0 "DAXTER" "WA-HOO!") + ) + +("sksp009f" :hint #x292 + (0 "DAXTER" "GET SOME, GET SOME! HA HA HA!") + ) + +("sksp009g" :hint #x293 + (0 "DAXTER" "RIGHT BEHIND YA, JAK!") + ) + +("sksp009i" :hint #x294 + (0 "DAXTER" "DID WE FIND ALL THE SCOUT FLIES IN THIS AREA?") + ) + +("sksp009j" :hint #x295 + (0 "DAXTER" "HEY! IT LOOKS LIKE SCOUT FLIES ARE ALWAYS IN RED BOXES.") + ) + +("sksp009k" :hint #x296 + (0 "DAXTER" "ALRIGHT! YOU FOUND ALL THE SCOUT FLIES IN THIS AREA!") + ) + +("sksp0145" :hint #x359 + (0 "DAXTER" "WOW! YOU CAN SHOOT FIRE BALLS WHEN YOU'RE POWERED UP WITH YELLOW ECO.") + ) + +;; ----------------- +;; village1 +;; ----------------- + +("ASSTLP01" :hint #x0 + (0 "KEIRA" "HMM...") + ) + +("ASSTLP02" :hint #x0 + (0 "KEIRA" "GOTTA GET THIS HEAT SHIELD WORKING...") + ) + +("ASSTLP03" :hint #x0 + (0 "KEIRA" "WE NEED POWER CELLS TO FUEL THE HEAT SHIELD...") + ) + +("ASSTLP04" :hint #x0 + (0 "KEIRA" "WHERE'S MY SPANNER?") + ) + +("ASSTLP05" :hint #x0 + (0 "KEIRA" "FIRE CANYON IS SO HOT...") + ) + +("EXP-AM01" :hint #x0 + (0 "JAK'S UNCLE" "I NEED TO SET OFF ON MY JOURNEY SOON. I NEED PRECURSOR ORBS!") + ) + +("EXP-AM02" :hint #x0 + (0 "JAK'S UNCLE" "LET'S SEE, NOW WHERE SHALL I GO FIRST? EH...") + ) + +("EXP-AM03" :hint #x0 + (0 "JAK'S UNCLE" "OH I DO MISS THE OPEN ROAD.") + ) + +("EXP-AM04" :hint #x0 + (0 "JAK'S UNCLE" "SO MANY PLACES TO SEE, AND SO LITTLE TIME.") + ) + +("EXP-AM05" :hint #x0 + (0 "JAK'S UNCLE" "WELL IN MY DAY, YOU COULD WALK THE LANDS WITHOUT BEING ASSAULTED BY MONSTERS!") + ) + +("EXP-LO02" :hint #x0 + (0 "JAK'S UNCLE" "I NEED MORE PRECURSOR ORBS.") + ) + +("FAR-AM01" :hint #x0 + (0 "FARMER" "(SNORES) HERE, BESSIE... HERE, BESSIE BESSIE... THAT'S A GOOD GIRL...") + ) + +("FAR-AM02" :hint #x0 + (0 "FARMER" "GOTTA BRING IN THE CROPS 'FORE THE JUNE BUGS...") + ) + +("FAR-AM2A" :hint #x0 + (0 "FARMER" "GOTTA BRING IN THE CROPS 'FORE THE JUNE BUGS GET...") + ) + +("FAR-LO01" :hint #x0 + (0 "FARMER" "(SNORES)") + ) + +("FAR-LO1A" :hint #x0 + (0 "FARMER" "(SNORES)") + ) + +("SAGELP03" :hint #x0 + (0 "SAGE" "THESE TWO COULDN'T UNBLOCK THEIR EARS...") + ) + +("SAGELP04" :hint #x0 + (0 "SAGE" "HE'LL JUST NEVER BE LIKE HIS UNCLE...") + (221 "SAGE" "I DON'T CARE WHAT THE OTHERS SAY.") + ) + +("SAGELP05" :hint #x0 + (0 "SAGE" "HELLO, BLUE SAGE? HELLO? WHERE IN THE BLUE BLAZES COULD HE BE...") + ) + +("SAGELP06" :hint #x0 + (0 "SAGE" "MY, MY, MY...") + ) + +("SAGELP11" :hint #x0 + (0 "SAGE" "ANYONE? ANYONE AT ALL? COME IN?") + ) + +("assistant-introduction-blue-eco-switch" + (23 "DAXTER" "HEY BABY. WHAT DO YOU SAY YOU AND I GO CRUISIN' ON THIS A-GRAV ZOOMER?") + (175) + (193 "KEIRA" "RULE NUMBER ONE: I DON'T DATE ANIMALS.") + (308) + (312 "DAXTER" "OH YOU DON'T KNOW WHAT YOU'RE MISSING, HE HEH.") + (430) + (505 "KEIRA" "LISTEN, IF YOU NEED SOMETHING TO KEEP YOU BUSY, MY FATHER ALWAYS TALKED") + (635 "KEIRA" "ABOUT AN ANCIENT PRECURSOR PIPELINE HIDDEN DEEP UNDERGROUND.") + (739) + (742 :offscreen "KEIRA" "SOME OF THESE PIPES END IN VENTS FROM WHICH ECO FLOWS FREELY,") + (842 :offscreen "KEIRA" "AND SOME HAVE BEEN CAPPED OFF SO THAT THE ECO IS SEALED BACK.") + (945) + (954 "KEIRA" "THERE MUST BE A WAY TO TURN THE CAPPED VENTS ON.") + (1052 :offscreen "KEIRA" "I TRACED PART OF THE PIPELINE BACK TO THE FORBIDDEN TEMPLE.") + (1138 "KEIRA" "MAYBE YOU SHOULD LOOK THERE FOR SOME TYPE OF SWITCH.") + (1246) + ) + +("assistant-introduction-race-bike" + (9 "DAXTER" "HEY BABY, WHAT'CHA WORKIN' ON?") + (63 "KEIRA" "BE CAREFUL WITH THAT! I'M TRYING TO FIGURE HOW TO TRANSPORT THE ZOOMER") + (200 "KEIRA" "USING THE TRANS-PADS THE PRECURSORS LEFT ALL OVER THE WORLD.") + (308) + (312 :offscreen "KEIRA" "IF YOU COME ACROSS ONE OF THESE PADS I CAN LOCK ON TO YOUR COMMUNICATOR'S LOCATION") + (453 :offscreen "KEIRA" "AND SEND YOU THE ZOOMER!") + (508 "KEIRA" "KEEP AN EYE OUT FOR A TRANS-PAD WHEN YOU EXPLORE MISTY ISLAND, AND WHEREVER ELSE YOU GO!") + (665) + ) + +("assistant-reminder-1-blue-eco-switch" + (23 "KEIRA" "I'M SURE IF YOU LOOKED INSIDE THE PRECURSOR FORBIDDEN TEMPLE") + (143 "KEIRA" "YOU'LL FIND A WAY TO TURN ON THAT CAPPED BLUE ECO VENT ON SENTINEL BEACH.") + (295) + ) + +("assistant-reminder-1-generic" + (25 "KEIRA" "HEY GUYS! KEEP COLLECTING POWER CELLS, THEY'RE THE KEY TO CONTINUING OUR JOURNEY NORTH.") + ) + +("assistant-reminder-1-race-bike" + (19 "KEIRA" "I'VE DEFINITELY FIGURED OUT HOW TO USE THE TRANS-PADS.") + (106 "KEIRA" "NOW GO TO MISTY ISLAND AND I'LL SEND THE ZOOMER OVER TO YOU.") + (229) + ) + +("asstvb04" :hint #x2b1 + (0 "KEIRA" "GOOD, YOU'VE COLLECTED ENOUGH POWER CELLS TO FUEL MY HEAT SHIELD!") + (233 "KEIRA" "MEET ME BY THE ENTRANCE TO THE FIRE CANYON BY CLIMBING THE CLIFF BEHIND THE FARMER'S HOUSE.") + (559 "KEIRA" "BRING THE POWER CELLS, AND HURRY! MY FATHER SAYS HE'S SEEN MORE LURKERS AROUND!") + ) + +("asstvb08" :hint #x2b2 + (0 "KEIRA" "HURRY UP WITH THOSE POWER CELLS. I'M WAITING AT THE HEAD OF FIRE CANYON") + (260 "KEIRA" "AT THE TOP OF THE CLIFF BEHIND THE FARMER'S HOUSE!") + ) + +("explorer-introduction" + (23 "JAK'S UNCLE" "WELL, HELLO THERE MY DEAR BOY. YOU'VE CAUGHT AT A MOST INOPPORTUNE MOMENT.") + (197 "JAK'S UNCLE" "I WAS TO SET OFF ON MY JOURNEYS YESTERDAY") + (288 "JAK'S UNCLE" "BUT I SEEM TO BE A SPOT SHORT ON THE OLD PRECURSOR ORBS.") + (426) + (430 "JAK'S UNCLE" "I WOULD'VE PLEDGED MY WORD THAT I HAD 90 OF THEM,") + (538 "JAK'S UNCLE" "BUT I GATHER THAT YOUR YOUNG FRIEND, YOU KNOW, THE LITTLE ANNOYING MISERABLY UGLY ONE") + (716 "JAK'S UNCLE" "MIGHT HAVE JUST PILFERED THEM AS A SORT OF A SPOT OF FUN.") + (829) + (865 "JAK'S UNCLE" "ANYWAY, WOULD YOU BE KIND ENOUGH TO LOAN YOUR DEAR OLD UNCLE 90 PRECURSOR ORBS") + (1043 "JAK'S UNCLE" "SO HE CAN GET UNDERWAY? I WOULD OFFER YOU A POWER CELL IN RETURN.") + ) + +("explorer-reminder-1" + (25 "JAK'S UNCLE" "WHAT? YOU DON'T HAVE THE FULL STASH? HARUMPH!") + (148 "JAK'S UNCLE" "WELL, ANY LESS THAN 90 PRECURSOR ORBS") + (251 "JAK'S UNCLE" "AND I SHAN'T HAVE A CHANCE TO GET UNDERWAY, DEAR BOY.") + (387) + ) + +("explorer-reminder-2" + (33 "JAK'S UNCLE" "OH SEE HERE, THE DEAL IS FOR 90 PRECURSOR ORBS FOR A POWER CELL.") + (187 "JAK'S UNCLE" "A DOWNRIGHT EVEN TRADE.") + ) + +("explorer-resolution" + (28 "JAK'S UNCLE" "I SEE YOU TWO ARE BACK TO MAKE THE TRADE. GOOD, GOOD, JOLLY GOOD!") + (179 "JAK'S UNCLE" "EH, YOU HAVE THE UH, PRECURSOR ORBS THAT WE AGREED ON?") + (310) + (324 "JAK'S UNCLE" "I HOPE YOU PUT THIS HARD-EARNED POWER CELL TO GOOD USE. CHEERIO, TA TA, BYE BYE!") + ) + +("farmer-introduction" + (1 "FARMER" "GOTTA MILK THOSE YAKOWS, GOTTA MILK THOSE YAKOWS...") + (113 "FARMER" "OH! IT'S YOU... JUST RESTIN' MY TRIED BONES. I'VE BEEN TRYING TO GET THOSE ORNERY YAKOWS") + (317 "FARMER" "BACK INTO THE PEN ALL DAY! SOME STRANGE CREATURES TRIED TO STEAL 'EM EARLIER.") + (454) + (456 "FARMER" "YOU THINK YOU CAN HELP AN OLD MAN TRY TO GET 'EM BACK INTO THE CORRAL?") + ) + +("farmer-reminder-1" + (0 "FARMER" "HEY! MY YAKOWS ARE STILL ON THE LOOSE! EH, COULD YOU BRING 'EM BACK FOR ME ALREADY?") + ) + +("farmer-reminder-2" + (0 "FARMER" "THOSE DARN YAKOWS ARE STILL ROAMIN' FREE.") + (85 "FARMER" "AIN'T YOU GONNA CHASE 'EM INTO THE CORRAL ALREADY?") + ) + +("farmer-resolution" + (0 "FARMER" "AH, WELL DONE MY BOY. YOU ACTUALLY GOT THOSE FLEABAGS PACK INTO THE PEN.") + (134 "FARMER" "NOW I CAN SLEEP IN PEACE. TAKE THIS POWER CELL FOR YOUR TROUBLE.") + (340) + ) + +("sage-introduction-misty-cannon" + (24 "SAGE" "OH, IT'S THE CONQUERING HEROES.") + (136 "SAGE" "GOOD, I WANTED TO TALK WITH YOU TWO ABOUT SOMETHING SERIOUS.") + (258) + (261 :offscreen "SAGE" "THERE APPEARS TO BE QUITE A BIT OF LURKER ACTIVITY ON MISTY ISLAND.") + (387) + (393 :offscreen "SAGE" "I CAN SEE THEM BOMBARDING THE PRECURSOR SILO FROM MY LOOKOUT TOWER.") + (525) + (528 "SAGE" "IF THE LURKERS OPEN IT UP AND RELEASE THE DARK ECO, WE COULD ALL END UP") + (663 "SAGE" "RUNNING AROUND LOOKING AS RIDICULOUS AS THIS ANNOYING LITTLE SPECIMEN.") + (788) + (807 "SAGE" "JAK, IT'S TIME FOR YOU TO PROVE YOUR WORTH.") + (906 "SAGE" "GET THE FISHERMAN TO LET YOU TAKE HIS BOAT BACK TO MISTY ISLAND") + (1018 "SAGE" "GET TO THE TOP OF THE PRECURSOR SILO AND TAKE OUT THAT CANNON.") + (1171) + (1177 "DAXTER" "AND... WHAT ABOUT ME?") + (1232) + (1235 "SAGE" "YOU? WHY DON'T YOU MOP MY FLOORS? THEY SEEM TO HAVE LOST THEIR SHINE LATELY.") + ) + +("sage-reminder-1-ecorocks" + (28 "SAGE" "SOME \"BRAVE ADVENTURERS\" YOU TWO ARE.") + (132 "SAGE" "BACK ALREADY AND WITHOUT CLEARING MY BLOCKED ECO HARVESTERS!") + (244) + (252 :offscreen "SAGE" "THEY'RE ON THE FAR SIDE OF THE BEACH, BOYS.") + (365) + (366 :offscreen "SAGE" "NOW...") + (412 :offscreen "SAGE" "GET MOVING!") + ) + +("sage-reminder-1-generic" + (54 "SAGE" "WHAT ARE YOU TWO DOING HERE? YOU HAVE POWER CELLS TO COLLECT!") + (178) + (181 "SAGE" "LEAVE ME ALONE... UNTIL YOU HAVE THEM!") + ) + +("sage-reminder-1-misty-cannon" + (24 "SAGE" "THE BOMBARDMENT IS GETTING WORSE!") + (86 :offscreen "SAGE" "FIND THE FISHERMAN IN THE JUNGLE, GET PERMISSION TO USE HIS BOAT") + (215 :offscreen "SAGE" "AND GET OVER TO MISTY ISLAND TO STOP THE CANNON.") + (317) + (320 "SAGE" "AND YOU DAXTER, YOU NEED TO GET MOPPING. THIS PLACE IS A MESS!") + ) + +("sage-reminder-2-generic" + (27 "SAGE" "YOU TWO JUST DON'T UNDERSTAND THE GRAVITY OF THE SITUATION.") + (137 "SAGE" "THIS IS ABOUT MORE THAN A SINGLE BOY GONE FUZZY. THIS IS ABOUT LIFE AS WE KNOW IT.") + (320) + (323 "SAGE" "NOW, GET OUT THERE AND FULFILL YOUR DESTINY.") + (455) + ) + +("sksp0010" :hint #x231 + (0 "DAXTER" "HEY! LET'S GO CHECK OUT OL' FISH BREATH'S SPEED-BOAT AT THE DOCK!") + ) + +("sksp0013" :hint #x232 + (0 "DAXTER" "DID YOU SEE THE SIZE OF THE BITE THAT LURKER SHARK TOOK OUT OF THE FISHERMAN'S BOAT?") + (315) + (337 "DAXTER" "WE BEST STAY WAY CLEAR OF THEM! I DON'T THINK WE CAN TACKLE A CREATURE THAT DAG NASTY.") + ) + +("sksp0015" :hint #x234 + (0 "DAXTER" "THIS MUST BE A PRECURSOR ORACLE LIKE THE SAGE ALWAYS GOES ON ABOUT.") + (228 "DAXTER" "I HOPE THEY WEREN'T AS UGLY IN PERSON!") + ) + +("sksp0017" :hint #x235 + (0 "DAXTER" "WHOA! CHECK OUT THAT FUNKY SCULPTURE SITTIN' ON THE ROCKS OVER THERE!") + ) + +("sksp0043" :hint #x24e + (0 "DAXTER" "MAYBE WE SHOULD GO ROOT OUT THE FISHERMAN.") + (106 "DAXTER" "I HEARD HE WAS IN THE JUNGLE FISHING BY THE LOWER RIVER!") + ) + +("sksp018a" :hint #x297 + (0 "DAXTER" "THAT LAZY FARMER OWES US A POWER CELL!") + (156 "DAXTER" "LET'S GO TALK TO HIM!") + ) + +;; ----------------- +;; oracle +;; ----------------- + +("oracle-intro-1" + (0 "ORACLE" "WHO AWAKENS THE ORACLE?") + (75) + (81 "ORACLE" "WAIT, ONE OF YOU HAS THE LIGHT WITHIN.") + (198) + (206 "ORACLE" "FROM BEFORE TIME, I HAVE WATCHED AND WAITED FOR THE TRUE HERO TO RETURN.") + (390) + (395 "ORACLE" "PRESENT TO ME 120 PRECURSOR ORBS FOR EACH POWER CELL I CONTAIN.") + ) + +("oracle-left-eye-1" + (0 "ORACLE" "YOU HAVE PROVEN YOURSELF WORTHY. HERE IS A POWER CELL.") + ) + +("oracle-left-eye-2" + (0 "ORACLE" "FOR YOUR SACRIFICE, I OFFER YOU A POWER CELL.") + ) + +("oracle-left-eye-3" + (0 "ORACLE" "FOR YOUR EFFORT, A POWER CELL IS THE REWARD.") + ) + +("oracle-reminder-1" + (0 "ORACLE" "BRING TO ME 120 PRECURSOR ORBS AND I WILL AWARD YOU A POWER CELL.") + ) + +("oracle-right-eye-1" + (0 "ORACLE" "FOR YOUR GIFT, ANOTHER POWER CELL IS YOURS.") + ) + +("oracle-right-eye-2" + (0 "ORACLE" "HERE IS ANOTHER POWER CELL FOR YOUR QUEST.") + ) + +("oracle-right-eye-3" + (0 "ORACLE" "YOU HAVE OBTAINED ANOTHER POWER CELL.") + ) + +;; ----------------- +;; beach +;; ----------------- + +("BIR-AM01" :hint #x0 + (0 "BIRDWATCHER" "ARE YOU NEAR THE EGG YET?") + ) + +("BIR-AM02" :hint #x0 + (0 "BIRDWATCHER" "THAT'S IT, JUST A LITTLE FURTHER!") + ) + +("BIR-AM03" :hint #x0 + (0 "BIRDWATCHER" "OH, GOOD, NOW PUSH IT. OH, GENTLY NOW!") + ) + +("BIR-AM04" :hint #x0 + (0 "BIRDWATCHER" "OH, MY, THAT WASN'T GENTLE!") + ) + +("BIR-AM05" :hint #x0 + (0 "BIRDWATCHER" "COME ON, PUSH THE EGG OFF THE CLIFF!") + ) + +("BIR-AM06" :hint #x0 + (0 "BIRDWATCHER" "OHH!") + ) + +("BIR-AM07" :hint #x0 + (0 "BIRDWATCHER" "OH, HERE, BIRDIE BIRDIE. HERE, BIRDIE BIRDIE.") + ) + +("BIR-AM08" :hint #x0 + (0 "BIRDWATCHER" "HERE, BIRDIE BIRDIE.") + ) + +("BIR-AM09" :hint #x0 + (0 "BIRDWATCHER" "BE CAREFUL, IT DOESN'T LOOK SAFE UP THERE!") + ) + +("BIR-AM10" :hint #x0 + (0 "BIRDWATCHER" "CAREFUL, EASY DOES IT!") + ) + +("BIR-AM11" :hint #x0 + (0 "BIRDWATCHER" "GOOD JOB! NOW MEET ME DOWN HERE BY THE EGG.") + ) + +("BIR-AM12" :hint #x0 + (0 "BIRDWATCHER" "YOU MUST BE A TRUE ANIMAL LOVER!") + ) + +("BIR-AM13" :hint #x0 + (0 "BIRDWATCHER" "DO YOU SEE ANY OTHER BIRDS UP THERE?") + ) + +("BIR-LO01" :hint #x0 + (0 "BIRDWATCHER" "(KISS) (WHISTLE)") + ) + +("BIR-LO02" :hint #x0 + (0 "BIRDWATCHER" "OH MY, THAT'S A PRETTY ONE.") + ) + +("BIR-LO03" :hint #x0 + (0 "BIRDWATCHER" "OH LOOK, A MUCKY-MUCK.") + ) + +("CHI-AM01" :hint #x0 + (0 "MAYOR" "THIS IS A CATASTROPHE. A CATASTROPHE I SAY!") + ) + +("CHI-AM02" :hint #x0 + (0 "MAYOR" "THEY WANT ME TO GO INTO THE JUNGLE - ME! HO HO OH...") + (214) + (219 "MAYOR" "I'D SOONER WRESTLE AN ENRAGED FLUT FLUT.") + ) + +("CHI-AM03" :hint #x0 + (0 "MAYOR" "...FIRST THE FISHERMAN'S BOAT, (STUTTERS) IT'S ATTACKED BY A MONSTER...") + (352) + (395 "MAYOR" "AND NOW, NOW THIS... WHAT ELSE COULD GO WRONG?") + ) + +("CHI-AM04" :hint #x0 + (0 "MAYOR" "I DON'T... I'D, I'D... OOH, MAYBE I SHOULD RAISE TAXES (STUTTERS) TO PAY FOR THIS MESS.") + ) + +("CHI-AM05" :hint #x0 + (0 "MAYOR" "PROBLEMS... PROBLEMS... PROBLEMS!") + ) + +("CHI-AM06" :hint #x0 + (0 "MAYOR" "(SOBS) I'LL NEVER GET RE-ELECTED NOW...") + ) + +("CHI-AM07" :hint #x0 + (0 "MAYOR" "(MOANS) WHAT'S HAPPENED TO THE VILLAGE'S ENERGY BEAM?") + ) + +("CHI-AM08" :hint #x0 + (0 "MAYOR" "I... THEY, I DON'T... (MUTTERS)") + ) + +("CHI-LO01" :hint #x0 + (0 "MAYOR" "...WINDMILL, MONSTERS, POWER, RE-ELECTION...") + ) + +("CHI-LO02" :hint #x0 + (0 "MAYOR" "...THE POLLS, I... MONSTERS, HM... RE-ELECTION, OH...") + ) + +("SCU-AM01" :hint #x0 + (0 "SCULPTOR" "AW... I JUST CAN'T DO IT ANYMORE.") + ) + +("SCU-AM02" :hint #x0 + (0 "SCULPTOR" "AW, I WISH I HAD SOME INSPIRATION.") + ) + +("SCU-AM03" :hint #x0 + (0 "SCULPTOR" "I'M AS INSPIRED AS... THIS ROCK.") + ) + +("SCU-AM04" :hint #x0 + (0 "SCULPTOR" "AW... WHERE IS MY MUSE?") + ) + +("SCU-AM05" :hint #x0 + (0 "SCULPTOR" "I CAN'T WORK LIKE THIS!") + ) + +("SCU-AM06" :hint #x0 + (0 "SCULPTOR" "AW MAN... WILL SHE EVER COME BACK TO ME?") + ) + +("SCU-LO01" :hint #x0 + (0 "SCULPTOR" "AW MAN...") + ) + +("bird-lady-beach-resolution" + (30 "BIRDWATCHER" "OH MY, I HOPE THE POOR DEAR'S OKAY. HERE'S A POWER CELL FOR YOUR VALOR.") + (243) + (306 "FLUT FLUT" "MAMA!") + (354) + (406 "FLUT FLUT" "MAMA!") + (430 "DAXTER" "OH NO! NO, NO, NO, NO!") + (533) + (535 "BIRDWATCHER" "LOOK... ISN'T THAT CUTE? IT THINKS YOU'RE ITS MAMA.") + (696) + (699 "DAXTER" "EH? I'M NOT YOUR MOM! YOU SEE ANY FEATHERS HERE?") + (803) + (807 "BIRDWATCHER" "OH, LOVE AT FIRST SIGHT! AH...") + (936) + (939 "BIRDWATCHER" "LISTEN, BOYS, I'LL TAKE THIS LITTLE CHICK BACK TO THE VILLAGE WITH ME") + (1054 "BIRDWATCHER" "AND WORK WITH THE SAGE TO TAKE CARE OF HER.") + ) + +("bird-lady-introduction" + (125 "BIRDWATCHER" "OH MY, WHAT A HORRIBLY SICK LITTLE BIRD.") + (245) + (251 "DAXTER" "HUH! YOU DON'T LOOK SO GOOD YOURSELF, LADY!") + (326) + (331 "BIRDWATCHER" "OH, SORRY. I THOUGHT YOU WERE A SPOTTED ORANGE-BELLIED RAIN FRAY.") + (454) + (457 "BIRDWATCHER" "YOU KNOW, YESTERDAY I SAW SOME TERRIBLY VICIOUS CREATURES") + (578 "BIRDWATCHER" "CAPTURE A MOTHER FLUT FLUT NEAR THE BEACH.") + (648) + (654 :offscreen "BIRDWATCHER" "NOW THERE'S THIS POOR LITTLE ORPHAN EGG SITTING IN A NEST AT THE TOP OF THE CLIFF") + (796 :offscreen "BIRDWATCHER" "AND I CAN'T GET TO IT. IF YOU COULD CLIMB UP THERE AND PUSH IT OFF, I'VE PILED") + (951 :offscreen "BIRDWATCHER" "SOME HAY DOWN AT THE BASE TO CATCH IT SAFELY.") + (1041) + (1044 "BIRDWATCHER" "DO AN OLD LADY A FAVOR, AND I'LL GIVE YOU A POWER CELL.") + (1198) + ) + +("bird-lady-reminder-1" + (56 "BIRDWATCHER" "OH, HELLO AGAIN. DID YOU BOYS FIND THAT BLUE EGG ON THE CLIFF?") + (208) + (211 "BIRDWATCHER" "PUSH IT OFF THE EDGE AND I'LL GIVE YOU A POWER CELL!") + (348) + ) + +("bird-lady-reminder-2" + (58 "BIRDWATCHER" "ARE YOU BOYS STILL PICKING AROUND HERE? HO HO HO.") + (170) + (174 "BIRDWATCHER" "I'LL BET THAT POOR LITTLE BLUE EGG ON THE CLIFF IS GETTING AWFULLY COLD BY NOW.") + (313) + (316 "BIRDWATCHER" "GO SAVE IT BY PUSHING IT OFF THE EDGE OF THE CLIFF, AND I'LL GIVE YOU A POWER CELL.") + ) + +("mayor-introduction" + (31 "MAYOR" "NO... (MUTTERS) DON'T TELL ME THAT YOU TWO HAVE PROBLEMS AS WELL!") + (171) + (174 "MAYOR" "FIRST I HEAR OF MONSTER SIGHTINGS NEAR THE VILLAGE, AND NOW THIS.") + (313) + (320 "MAYOR" "SEE THOSE GEARS UP THERE, BOYS? SEE THEM? SEE HOW THEY'RE NOT MOVING?") + (479 "MAYOR" "THAT MEANS OUR VILLAGE HAS NO POWER!") + (569) + (578 "MAYOR" "THE ECO BEAM COMING FROM THE JUNGLE TEMPLE HAS BEEN INTERRUPTED!") + (685) + (689 "MAYOR" "AND BOYS, EVERYONE'S TOO FRIGHTENED TO GO OUT AND FIND OUT WHAT'S HAPPENED.") + (850) + (864 "DAXTER" "DID YOU PAY THE BILL?") + (915) + (917 "MAYOR" "YEAH-HMM? OH-HUH-OH, YOU'RE FUNNY.") + (1071) + (1074 "MAYOR" "NOW LOOK, IF YOU TWO FIX THE ECO BEAM, I'LL GIVE YOU A POWER CELL.") + (1262 "MAYOR" "OH OOH OOH AND-AND ANOTHER THING, UH...") + (1346 "MAYOR" "IF BY ANY CHANCE YOU'RE INTERESTED IN MAKING A CONTRIBUTION TO MY RE-ELECTION CAMPAIGN,") + (1551 "MAYOR" "I-I MIGHT BE WILLING TO PART WITH YET ANOTHER POWER CELL!") + (1668) + (1671 "MAYOR" "THE MINIMUM CONTRIBUTION IS, OH, A VERY MODEST...") + (1797 "MAYOR" "90 PRECURSOR ORBS.") + ) + +("mayor-reminder-beams" + (25 "MAYOR" "BACK ALREADY? AND WITHOUT FIXING THE ECO BEAMS?") + (157 "MAYOR" "(SOBS) YOUR VILLAGE NEEDS YOU, BOYS!") + ) + +("mayor-reminder-donation" + (26 "MAYOR" "AH, HERE TO MAKE A DONATION TO MY CAMPAIGN, OH HO HO HO.") + (159 "MAYOR" "90 PRECURSOR ORBS BUYS YOU A POWER CELL, THANK YOU.") + ) + +("mayor-resolution-beams" + (28 "MAYOR" "OH HO HO, WHAT A WONDERFUL SIGHT! I THANK YOU!") + (205 "MAYOR" "AND THE ENTIRE VILLAGE WILL THANK ME -") + (269 "MAYOR" "UH, BOYS, YOU HAVE RESTORED POWER TO THE VILLAGE AND GUARANTEED MY RE-ELECTION!") + (472) + (475 "MAYOR" "AND FOR THAT, MY BOY, YOU'VE EARNED A POWER CELL.") + ) + +("mayor-resolution-donation" + (28 "MAYOR" "SO EH, YOU UH, WANNA MAKE A CONTRIBUTION? GOOD... A-A-A SIZABLE ONE I HOPE.") + (219) + (224 "MAYOR" "YOOH! EH HE HE, IT'S A, OH, THIS IS A SIZABLE CONTRIBUTION!") + (365 "MAYOR" "I, WH-WH-WH-WHY I JUST HOPE THIS POWER CELL ADEQUATELY REPRESENTS MY GRATITUDE.") + ) + +("sagevb01" :hint #x288 + (0 "SAGE" "WELL, I SEE THAT YOU TWO HAVE FINALLY DECIDED TO UNBLOCK MY COLLECTORS.") + (347) + (352 "SAGE" "I WOULD OFFER MY CONGRATULATIONS, BUT YOU HAVE SO MUCH TO DO I WON'T WASTE YOUR TIME.") + (705) + (712 "SAGE" "BY THE WAY, IF THINGS DON'T WORK OUT,") + (884 "SAGE" "DAXTER COULD ALWAYS GET A JOB CONTROLLING THE VILLAGE RAT PROBLEM.") + (1116 "SAGE" "NYEH HA HA HA HA.") + ) + +("sculptor-introduction" + (30 "SCULPTOR" "HEY... LITTLE FURRY DUDE!") + (154) + (161 "SCULPTOR" "AWW... I THOUGHT FOR A MOMENT YOU WERE MY MUSE.") + (282) + (285 "DAXTER" "YOUR WHAT?") + (334) + (343 "SCULPTOR" "HAVEN'T YOU EVER SEEN A MUSE BEFORE?") + (430) + (434 "SCULPTOR" "IT'S A LITTLE GLOWIN' SQUIRREL ABOUT YOUR SIZE, FULL OF SPUNK, AND CRAZY AS A LARK!") + (622) + (632 "DAXTER" "OH, I GET IT! LIKE A SIDEKICK.") + (757) + (763 "SCULPTOR" "AS A MATTER OF FACT, WITHOUT MY MUSE, I JUST CAN'T SCULPT.") + (920) + (923 "SCULPTOR" "BUT WITH HER AROUND... I SEE BEAUTY IN EVERYTHING, YOU KNOW?") + (1087) + (1091 "SCULPTOR" "RIGHT NOW I COULDN'T CHISEL MY WAY OUT OF A BOX.") + (1182) + (1191 :offscreen "SCULPTOR" "I THINK SHE RAN AWAY TO THAT MISTY ISLAND.") + (1278) + (1281 "SCULPTOR" "AWW, I JUST HOPE SHE'S ALL RIGHT.") + (1370) + (1376 "SCULPTOR" "IT'S WORTH A POWER CELL IF YOU BRING HER BACK TO ME!") + (1441) + (1467 "DAXTER" "WAIT A MINUTE! WE ARE NOT GOING BACK TO MISTY ISLAND!") + (1646) + (1649 "DAXTER" "ARE WE?") + ) + +("sculptor-reminder-1" + (27 "SCULPTOR" "AW HEY DUDES! DID YOU FIND MY MUSE YET?") + (169) + ) + +("sculptor-resolution" + (87 "SCULPTOR" "OH, MY MUSE! YOU SAVED HER! AW, YOU REALLY ARE THE BEST!") + (230 "SCULPTOR" "HERE, TAKE THIS POWER CELL. I WON'T NEED IT NOW THAT I HAVE MY INSPIRATION BACK!") + ) + +("sksp0019" :hint #x236 + (0 "DAXTER" "HEY, SEAGULLS! LET'S BUZZ 'EM FOR KICKS.") + ) + +("sksp0020" :hint #x268 + (0 "DAXTER" "YEAH HA HA! LET'S DO THAT AGAIN!") + ) + +("sksp0022" :hint #x26a + (0 "DAXTER" "YEAH HA HA HA HA HA!! WOO HO HO HO!") + ) + +("sksp0023" :hint #x26b + (0 "DAXTER" "WOOHOO!") + ) + +("sksp0024" :hint #x26c + (0 "DAXTER" "YEAH HA HA! YEAH!") + ) + +("sksp0025" :hint #x273 + (0 "DAXTER" "WHOA! THEY CAUSED AN AVALANCHE! LET'S CHECK IT OUT.") + ) + +("sksp0026" :hint #x237 + (0 "DAXTER" "HEY! THAT PELICAN JUST SNAGGED A POWER CELL!") + (197) + (200 "DAXTER" "LET'S GO KICK SOME BIG BIRD BUTT!") + ) + +("sksp0027" :hint #x274 + (0 "DAXTER" "QUICK! WE HAVE TO GET TO THE POWER CELL BEFORE THE PELICAN SCOOPS IT UP AGAIN.") + ) + +("sksp0029" :hint #x275 + (0 "DAXTER" "EH, WE MIGHT WANNA TALK TO THE BIRDWATCHER") + (125 "DAXTER" "AND SEE IF WE SCRAMBLED THAT FLUT FLUT EGG.") + ) + +("sksp0030" :hint #x239 + (0 "DAXTER" "HEY, TRY PUNCHING THE ROCKS TO GET 'EM OUT OF THE WAY!") + ) + +("sksp0034" :hint #x23b + (0 "DAXTER" "AWOOGA! AWOOGA! DIVE FOR THOSE ORBS, JAK, DIVE!") + ) + +("sksp0443" :hint #x2af + (0 "DAXTER" "PUNCH THOSE POLES UP FROM BELOW!") + ) + +;; ----------------- +;; jungle +;; ----------------- + +("FIS-AM01" :hint #x0 + (0 "FISHERMAN" "GRR, THESE DARN FISH... I NEVER CATCH ME A SINGLE ONE.") + ) + +("FIS-AM02" :hint #x0 + (0 "FISHERMAN" "THEM MONSTERS THAT DONE BIT ME SHIP WILL DRIVE ME BROKE.") + ) + +("FIS-AM03" :hint #x0 + (0 "FISHERMAN" "DRAT, THESE BLIGHTERS!") + (135 "FISHERMAN" "IN ME BASKET, DARN FISHIES, COME ON YEAH...") + (419) + (425 "FISHERMAN" "HEH HE HE HE HE...") + ) + +("FIS-AM04" :hint #x0 + (0 "FISHERMAN" "OH I LOVE THE SMELL OF FISH IN THE MORNIN'.") + ) + +("FIS-AM05" :hint #x0 + (0 "FISHERMAN" "OOH I COULD USE ME A SALTED FISH LIPS ON RYE.") + ) + +("FIS-AM06" :hint #x0 + (0 "FISHERMAN" "I 'MEMBER THE BIG ONE THAT GOT AWAY...") + ) + +("FIS-LO01" :hint #x0 + (0 "FISHERMAN" "GRR!") + ) + +("FIS-LO03" :hint #x0 + (0 "FISHERMAN" "HA HA HA HA HA HAH!") + ) + +("FIS-LO04" :hint #x0 + (0 "FISHERMAN" "DARN FISH... THEY NEVER GET IN ME NET!") + ) + +("FIS-LO05" :hint #x0 + (0 "FISHERMAN" "HA HA HA AH HA HA HA HAH!") + ) + +("FIS-TA01" :hint #x0 + (0 "FISHERMAN" "TO THE LEFT!") + ) + +("FIS-TA02" :hint #x0 + (0 "FISHERMAN" "RIGHT WITH YA!") + ) + +("FIS-TA03" :hint #x0 + (0 "FISHERMAN" "HERE COMES A BIG ONE!") + ) + +("FIS-TA04" :hint #x0 + (0 "FISHERMAN" "YE MISSED A JUMBO, LADDIE!") + ) + +("FIS-TA05" :hint #x0 + (0 "FISHERMAN" "DON'T MISS ONE LIKE THAT AGAIN!") + ) + +("FIS-TA06" :hint #x0 + (0 "FISHERMAN" "STEADY BOY.") + ) + +("FIS-TA07" :hint #x0 + (0 "FISHERMAN" "YOUR SAILS ARE SAGGING IN THE WIND, BOY.") + ) + +("FIS-TA08" :hint #x0 + (0 "FISHERMAN" "MISSED.") + ) + +("FIS-TA09" :hint #x0 + (0 "FISHERMAN" "LOOKS LIKE YOU COULD USE A BIGGER NET...") + ) + +("FIS-TA10" :hint #x0 + (0 "FISHERMAN" "MISSED AGAIN!") + ) + +("FIS-TA11" :hint #x0 + (0 "FISHERMAN" "HOLD STEADY! YOU'RE ALMOST THERE...") + ) + +("FIS-TA1A" :hint #x0 + (0 "FISHERMAN" "LEFT!") + ) + +("FIS-TA2A" :hint #x0 + (0 "FISHERMAN" "RIGHT!") + ) + +("asstvb02" :hint #x289 + (0 "KEIRA" "WOW, DID YOU SEE THAT? BLUE ECO VENTS HAVE BEEN ACTIVATED ALL OVER THE WORLD!") + (305) + (315 "KEIRA" "I KNEW THERE WAS A WAY TO TURN THEM ON.") + (435) + (442 "KEIRA" "THERE MUST BE PLACES TO TURN ON THE OTHER ECO VENTS AS WELL.") + ) + +("fisher-accept" + (0 :offscreen "FISHERMAN" "THERE ARE TWO TYPES OF GOOD FISH TO CATCH: ONE-POUND FISHIES, AND FIVE-POUND FISHIES.") + (220 :offscreen "FISHERMAN" "HEH. IF YOU MISS 20 POUNDS OF GOOD FISH, THEN I'M GONNA TAKE ME NET BACK FROM YA!") + (432) + (438 :offscreen "FISHERMAN" "THERE ARE POISONOUS EELS IN THIS RIVER.") + (542) + (545 :offscreen "FISHERMAN" "CATCH EVEN ONE OF THEM BOOGERS, AND YOU'LL POISON THE WHOLE DARN CATCH!") + ) + +("fisher-introduction" + (0 "DAXTER" "WHAT DO YOU HAVE IN THE BASKET?") + (50 "FISHERMAN" "NOTHING TO TALK ABOUT.") + (103) + (106 "FISHERMAN" "THEM MONSTERS PATROLIN' THE OCEAN TOOK A BITE OUT OF ME FISHIN' RIG.") + (226) + (229 "FISHERMAN" "AND NOW THEY'RE GOBLIN' UP ME CATCH!") + (290) + (293 "FISHERMAN" "NO MATTER WHAT I TRY, I CAN'T SEEM TO CATCH A SINGLE FISH IN THIS RIVER.") + (419) + (425 "DAXTER" "WHOO! MAYBE... IT'S YOUR BREATH.") + (515) + (521 "FISHERMAN" "YOU THINK YOU CAN DO BETTER? TRY SCOOPIN' UP RIVER FISH WITH A TINY NET!") + (665) + (671 "FISHERMAN" "I'LL GIVE YOU A POWER CELL IF YOU CAN CATCH 200 POUNDS OF THEM CRITTERS!") + (808) + (814 "FISHERMAN" "AND I'LL LET YOU AND SHRIMP HERE USE MY SPEEDBOAT TO GET TO MISTY ISLAND.") + (955) + (961 "FISHERMAN" "YOU'S WANT TO TRY THE CHALLENGE?") + ) + +("fisher-reject" + (2 "FISHERMAN" "WELL, IF YOU WANT TO TRY FOR THE POWER CELL SOMETIME, YOU KNOW WHERE TO FIND ME.") + ) + +("fisher-reminder-1" + (6 "FISHERMAN" "WANT TO TRY AND BEAT THE RIVER, DO YA?") + ) + +("fisher-resolution" + (0 "FISHERMAN" "YOU DID IT! YOU CAUGHT 200 POUNDS OF FISH!") + (115) + (120 "FISHERMAN" "NOT BAD FOR A COUPLE OF LAND LUBBERS!") + (185) + (199 "FISHERMAN" "HERE'S THE POWER CELL I PROMISED, AND YOU CAN USE MY BOAT IN THE VILLAGE DOCK") + (351 "FISHERMAN" "WHENEVER YOU LIKE!") + ) + +("sksp0011" :hint #x240 + (0 "DAXTER" "WE SHOULD ASK THE FISHERMAN DOWN BY THE JUNGLE RIVER") + (136 "DAXTER" "IF WE CAN BORROW HIS SPEEDBOAT TO ZOOM ON OVER TO MISTY ISLAND!") + ) + +("sksp0018" :hint #x25e + (0 "DAXTER" "WE SHOULD GO TELL THAT WINDBAG OF A MAYOR THAT HE OWES US BIG TIME") + (223 "DAXTER" "FOR CONNECTING THE VILLAGE ENERGY BEAM!") + ) + +("sksp0037" :hint #x25f + (0 "DAXTER" "THOSE TOWER DOOHICKEYS SCATTERED ALL OVER THE JUNGLE MUST REDIRECT THE ECO BEAM.") + (214) + (220 "DAXTER" "LET'S GO FIDDLE WITH THEM!") + ) + +("sksp0038" :hint #x23c + (0 "DAXTER" "HMM, IF BLUE ECO CAN BUILD A BRIDGE, THEN I BET IT'LL OPEN A DOOR!") + (275) + (281 "DAXTER" "LET'S GO BACK AND GET YOU JUICED UP AGAIN.") + ) + +("sksp0039" :hint #x25b + (0 "DAXTER" "HEY, THERE'S LITTLE LIGHTNING MARKS ON THOSE POSTS") + (202 "DAXTER" "AND THERE'S LIGHTNING COMING OUT OF THAT VENT OVER THERE.") + (391) + (400 "DAXTER" "ARE YOU THINKING WHAT I'M THINKING?") + ) + +("sksp0040" :hint #x23d + (0 "DAXTER" "LET'S GET UP ON THAT MACHINE AND BREAK THE MIRROR DIVERTING THE PRECURSOR BEAM!") + ) + +("sksp0041" :hint #x23e + (0 "DAXTER" "WE NEED TO GET TO THE TOP OF THAT TOWER!") + ) + +("sksp0049" :hint #x29c + (0 "DAXTER" "LINE UP THE BEAM BY POINTING IT AT THE NEXT TOWER!") + ) + +("sksp0050" :hint #x29d + (0 "DAXTER" "BREAK THE MIRROR, JAK!") + ) + +("sksp0051" :hint #x29e + (0 "DAXTER" "GET THE BUGS, JAK! GET THE BUGS!") + ) + +("sksp0052" :hint #x29f + (0 "DAXTER" "LET'S GO TO THE NEXT TOWER AND RECONNECT THE BEAM THERE!") + ) + +("sksp0053" :hint #x2a0 + (0 "DAXTER" "HEY! WE CAN FOLLOW THE BEAM TO FIND THE NEXT TOWER.") + ) + +("sksp0054" :hint #x2a1 + (0 "DAXTER" "WE NEED TO CHARGE YOU UP WITH THAT BLUE STUFF TO GET THIS OPEN!") + ) + +("sksp0b42" :hint #x278 + (0 "DAXTER" "STOP MISSING THE YELLOW FISH, THEY WEIGH FIVE POUNDS EACH! AND THAT'S A LOTTA FISH, JAK.") + ) + +;; ----------------- +;; misty +;; ----------------- + +("asstvb03" :hint #x28b + (0 "KEIRA" "GOOD! YOU STOPPED ALL THE MINE-DROPPING LURKERS!") + (190 "KEIRA" "THEY'VE BEEN THREATENING THE WATERS AROUND OUR VILLAGE FOR WEEKS.") + (391 "KEIRA" "BRING YOUR ZOOMER BACK TO THE TRANS-PAD AND I'LL TELEPORT IT BACK.") + ) + +("sagevb02" :hint #x28a + (6 "SAGE" "I HAVE TO ADMIT, I'M IMPRESSED. YOU TWO DIDN'T SCREW UP!") + (385) + (400 "SAGE" "NOW THAT THE LURKERS CAN'T OPEN THAT SILO, THEY CAN'T FLOOD THE WORLD WITH DARK ECO") + (710 "SAGE" "AND CAUSE UNTOLD DESTRUCTION.") + (863) + (880 "SAGE" "WIPE THAT RIDICULOUS GRIN OFF YOUR FACE, DAXTER! THE TWO OF YOU HAVE PLENTY TO DO.") + (1191 "SAGE" "GET ON WITH IT!") + ) + +("sksp0031" :hint #x23a + (0 "DAXTER" "OOH! LET'S USE THE CANNON TO BLOW THINGS UP!") + ) + +("sksp0056" :hint #x27b + (0 "DAXTER" "HEY! I SEE THE SCULPTOR'S MUSE!") + ) + +("sksp0059" :hint #x26e + (0 "DAXTER" "THIS PLACE GIVES ME THE WILLIES! LET'S KEEP YOU OUT OF THE OOZE, OKAY?") + ) + +("sksp0060" :hint #x26f + (0 "DAXTER" "(WHIMPERS) THIS PLACE GIVES ME THE CREEPS! AND TRUST ME, IT'S A WHOLE NEW EXPERIENCE") + (337 "DAXTER" "WHEN YOU'RE COVERED IN FUZZ!") + ) + +("sksp0062" :hint #x27e + (0 "DAXTER" "LET'S PLOW INTO THOSE BALLOON LURKERS AND SHRED 'EM!") + ) + +("sksp0063" :hint #x27f + (0 "DAXTER" "I SAID \"SHRED THE LURKERS,\" JAK. NOT THE MINES!") + (332) + (344 "DAXTER" "RULE NUMBER ONE: ALWAYS AVOID THE MINES!") + ) + +("sksp0064" :hint #x245 + (0 "DAXTER" "WATCH YOUR BACK! YOU REMEMBER WHAT HAPPENED THE LAST TIME WE WERE HERE.") + ) + +("sksp0067" :hint #x249 + (0 "DAXTER" "DON'T FALL INTO THE MIST BELOW US! 'CAUSE I DON'T THINK WE'LL MAKE IT BACK.") + ) + +("sksp0069" :hint #x2a3 + (0 "DAXTER" "IT'S AN AMBUSH, JAK! IT'S AN AMBUSH!") + ) + +("sksp0070" :hint #x2a4 + (0 "DAXTER" "JUMP, THEN DIVE ONTO THE TEETER-TOTTER.") + ) + +("sksp0435" :hint #x2aa + (0 "DAXTER" "KNOCK OVER THOSE BONES!") + ) + +;; ----------------- +;; firecanyon +;; ----------------- + +("assistant-firecanyon-resolution" + (25 "KEIRA" "GREAT! YOU HAVE THE 20 CELLS NEEDED TO POWER MY HEAT SHIELD!") + (140) + (143 "KEIRA" "NOW BE CAREFUL, THE SHIELD WILL ONLY PROTECT YOUR ZOOMER TILL IT REACHES 500 DEGREES,") + (295 "KEIRA" "SO TRY TO KEEP HER COOL.") + (343) + (346 :offscreen "KEIRA" "FLYING OVER OPEN LAVA WILL DEFINITELY HEAT YOU UP FAST.") + (458) + (462 "KEIRA" "HIT 500 DEGREES, AND IT'S OVER.") + (546) + (552 "DAXTER" "OVER?! LIKE BURNING MOLTEN METAL OVER?!") + (636) + (639 "KEIRA" "THE FIRE CANYON GETS PRETTY HOT, SO KEEP A LOOK OUT FOR JUMPS") + (745 "KEIRA" "TO KEEP YOU OFF THE HOT GROUND.") + (792) + (795 :offscreen "KEIRA" "I'VE ALSO RELEASED SEVERAL BLUE COOLING BALLOONS YOU CAN USE TO DROP") + (895 :offscreen "KEIRA" "THE SHIELD'S TEMPERATURE QUICKLY.") + (956) + (962 "KEIRA" "OH! AND WHEN YOU GET ACROSS, DON'T FORGET TO ACTIVATE") + (1063 "KEIRA" "THE TELEPORT GATE IN THE BLUE SAGE'S LAB.") + (1140) + (1146 "KEIRA" "THEN WE'LL BE ABLE TO TELEPORT OVER AND MEET YOU!") + (1222) + (1228 "KEIRA" "GOOD LUCK!") + ) + +("asstvb09" :hint #x24f + (0 "KEIRA" "YOU DON'T HAVE ENOUGH POWER CELLS TO FUEL MY HEAT SHIELD.") + (216) + (234 "KEIRA" "YOU CAN'T CROSS FIRE CANYON UNTIL YOU COLLECT ENOUGH POWER CELLS.") + ) + +("sksp0076" :hint #x501 + (0 "DAXTER" "JAK, HIT SOME JUMPS TO KEEP US OFF THE HOT GROUND!") + ) + +("sksp0077" :hint #x502 + (0 "DAXTER" "BALLOONS GOOD, BURNING HOT MAGMA BAD!") + ) + +("sksp0078" :hint #x503 + (0 "DAXTER" "RIDE ON THE RAISED PRECURSOR STUFF TO KEEP US COOL.") + ) + +("sksp0079" :hint #x504 + (0 "DAXTER" "AHH! I'M GONNA DIE! I'M A COMING, GRANDPAP!") + (257) + (270 "DAXTER" "YOU HAVE TO GET THIS THING TO THE OTHER SIDE BEFORE IT OVERHEATS!") + ) + +("sksp0080" :hint #x505 + (0 "DAXTER" "USE THE HOP-TURN TO STEER HARDER!") + ) + +("sksp0081" :hint #x506 + (0 "DAXTER" "AHH! MAYBE I SHOULD DRIVE!") + ) + +("sksp0082" :hint #x507 + (0 "DAXTER" "YOU ARE TRYING TO AVOID THOSE DARK ECO BOXES, RIGHT?") + ) + +("sksp0083" :hint #x508 + (0 "DAXTER" "OOH! SEE IF WE CAN CATCH AIR OFF THOSE LURKERS!") + ) + +("sksp0084" :hint #x509 + (0 "DAXTER" "TOO CLOSE, TOO CLOSE!") + ) + +("sksp0085" :hint #x50a + (0 "DAXTER" "WHOA! THIS BABY'S GETTING WAY TOO HOT!") + ) + +("sksp0086" :hint #x50b + (0 "DAXTER" "A FEW MORE SECONDS AND WE'RE FRIED FLUT FLUT!") + ) + +("sksp0087" :hint #x50d + (0 "DAXTER" "HIT THOSE BALLOONS TO COOL OFF!") + ) + +("sksp0088" :hint #x50e + (0 "DAXTER" "HERE COMES ANOTHER BALLOON!") + ) + +("sksp0089" :hint #x50f + (0 "DAXTER" "I WISH I SLEPT IN THIS MORNING!") + ) + +("sksp0090" :hint #x510 + (0 "DAXTER" "YOU MISSED A BALLOON! WE NEED THOSE OR WE'RE COOKED!") + ) + +("sksp0091" :hint #x511 + (0 "DAXTER" "THIS PUPPY'S GETTING TOO HOT!") + ) + +("sksp0092" :hint #x512 + (0 "DAXTER" "DO YOU SMELL SOMETHING BURNING?!") + ) + +("sksp0093" :hint #x513 + (0 "DAXTER" "I THINK MY TAIL'S ON FIRE!") + ) + +("sksp0094" :hint #x514 + (0 "DAXTER" "SHE'S GONNA BLOW!") + ) + +("sksp0095" :hint #x515 + (0 "DAXTER" "WAHOO! WE MADE IT!") + ) + +("sksp0096" :hint #x516 + (0 "DAXTER" "THERE'S SCOUT FLIES OUT HERE, TOO!") + ) + +;; ----------------- +;; swamp +;; ----------------- + +("billy-accept" + (5 "BILLY" "GOOD! THOSE RATS WILL BE BACK ANYTIME.") + (109 "BILLY" "SHOOT ALL THEM RATS, AND KEEP 'EM FROM EATING AT LEAST ONE OF THEM SNACKS.") + ) + +("billy-introduction" + (6 "BILLY" "HOWDY, FRIENDS! ENJOYIN' MY BEAUTIFUL SWAMP? I OWN THESE HERE PARTS. EVERYTHING THAT DOESN'T SINK INTO THE MUD, THAT IS! HA HA HA...") + (349) + (369 "DAXTER" "JUDGING BY THE SMELL, I'D WAGER YOUR BATHTUB SANK IN THE MUD LONG AGO.") + (497) + (519 "BILLY" "WHAT'S A BATHTUB? ANYWAY I GOT BIGGER PROBLEMS NOW...") + (677) + (691 "BILLY" "SEEMS SOME NASTY LURKER VARMINTS ARE GROUSIN' ABOUTS SNATCHIN' EVERYTHING THEY CAN GET THEIR GRUBBY LITTLE PAWS ON.") + (910 "BILLY" "AND SCARED AWAY MY PET HIPHOG, FARTHY.") + (1000 "BILLY" "HE'S BEEN MISSIN' FOR NIGH ON TO A COON'S AGE.") + (1136 :offscreen "BILLY" "I'VE BEEN PUTTIN' OUT HIS FAVORITE SNACK, BUT THOSE ORNERY SWAMP RATS KEEP STEALIN' EM!") + (1318 :offscreen "BILLY" "IF YOU COULD KEEP THOSE PESKY CRITTERS AWAY LONG ENOUGH, I JUST KNOW FARTHY WOULD SMELL THEM VITTLES AND COME BACK!") + (1509) + (1527 "BILLY" "WILL YA HELP ME OUT?") + ) + +("billy-reject" + (7 "BILLY" "WELL, IF YOU CHANGE YOUR MIND, YOU KNOW WHERE TO FIND ME! (LAUGHS)") + ) + +("billy-reminder-1" + (36 "BILLY" "AHH, Y'ALL BACK TO HELP STOP THEM RATS?") + ) + +("billy-resolution" + (1 "BILLY" "WELL FRY MY HIDE! YOU SURE KNOW HOW TO SHOOT! THANKS A HEAP FOR THE HELP.") + ) + +;; ----------------- +;; citadel +;; ----------------- + +("BLU-AM01" :hint #x0 + (0 "BLUE SAGE" "A LITTLE BIT OF HELP WOULD BE GOOD!") + ) + +("BLU-AM02" :hint #x0 + (0 "BLUE SAGE" "OH, THIS IS A FINE MESS.") + ) + +("BLU-AM03" :hint #x0 + (0 "BLUE SAGE" "HMM, QUITE AN ENIGMA WE'RE FACING.") + ) + +("RED-AM01" :hint #x0 + (0 "RED SAGE" "IS ANYBODY THERE?") + ) + +("RED-AM02" :hint #x0 + (0 "RED SAGE" "WELL...") + ) + +("RED-AM03" :hint #x0 + (0 "RED SAGE" "WHAT KEPT YOU?") + ) + +("YEL-AM01" :hint #x0 + (0 "RED SAGE" "TIME IS RUNNIN' OUT!") + ) + +("YEL-AM02" :hint #x0 + (0 "RED SAGE" "HEY! GET ME OUTTA HERE!") + ) + +("YEL-AM03" :hint #x0 + (0 "RED SAGE" "WHEN I GET OUTTA HERE, SOME SHOOTIN'S GONNA START!") + ) + +("bluesage-resolution" + (63 "BLUE SAGE" "GOOD WORK, FELLOWS! OLD SAMOS WAS RIGHT ABOUT YOU!") + (162) + (165 "BLUE SAGE" "GREAT PILES OF PRECURSOR METAL!") + (253 "BLUE SAGE" "THAT INSIDIOUS MECHANICAL CREATION MUST NOT BE ALLOWED TO WREAK ITS TERRIBLE HAVOC!") + (420 "BLUE SAGE" "I WILL TRY TO ACTUATE THE SHIELD DOOR BY ELLICITING A CONDUIT OF ENERGY") + (563 "BLUE SAGE" "BETWEEN MYSELF AND THE VAST PORTAL BELOW!") + (666 "DAXTER" "UH... YEAH. YOU DO THAT. WE'LL UH... JUST GO FIND MORE HELP.") + (873) + (891 :offscreen "DAXTER" "WEIRDO!") + (980) + ) + +("green-sagecage-introduction" + (130 "SAGE" "IT'S ABOUT TIME YOU TWO DECIDED TO SHOW UP!") + (207 "DAXTER" "NICE TO SEE YOU TOO! DO THEY HAVE YOU MOPPING THE FLOORS NOW?") + (343 "SAGE" "THERE'S NO TIME FOR JOKES, DAXTER. GOL AND MAIA KIDNAPPED US") + (477 "SAGE" "TO SAP OUR ENERGIES TO POWER THEIR ABOMINABLE MACHINE.") + (574) + (577 :offscreen "SAGE" "IT APPEARS THEY HAVE COMBINED THE FUNCTIONAL REMAINS OF A PRECURSOR ROBOT") + (710 :offscreen "SAGE" "WITH SCAVENGED ARTIFACTS FROM ACROSS THE LAND.") + (800) + (803 :offscreen "SAGE" "THEN THEY ADDED A FEW DIABOLICAL ADDITIONS OF THEIR OWN,") + (921 :offscreen "SAGE" "CREATING THE ONE THING CAPABLE OF OPENING THE DARK ECO SILOS.") + (1060 "SAGE" "IF YOU CAN FREE THE FOUR OF US, WE CAN USE OUR COMBINED POWERS") + (1180 "SAGE" "TO BREAK THE FORCE SHIELD SURROUNDING THE ROBOT, BEFORE THEY USE IT TO DESTROY THE WORLD.") + ) + +("green-sagecage-outro-preboss" + (56 "GOL" "YOU'RE TOO LATE, SAMOS.") + (125 "GOL" "ONCE I POSSESS LIMITLESS DARK ECO, I WILL HAVE THE KEY TO CREATION ITSELF!") + (335 "SAGE" "THIS IS MADNESS! RELEASING THAT MUCH DARK ECO WILL DESTROY EVERYTHING WE KNOW!") + (504 "SAGE" "JUST LOOK WHAT IT'S DONE TO YOU!") + (578) + (581 "MAIA" "IT HAS GIVEN US A BEAUTY BEYOND ANYTHING YOU COULD UNDERSTAND.") + (693) + (696 "DAXTER" "BEAUTY? HAVE YOU TWO LOOKED IN A MIRROR LATELY?") + (825) + (828 "MAIA" "JUST WAIT UNTIL WE OPEN THE SILOS, LITTLE ONE. YOU THINK SHORT AND FUZZY IS BAD?") + (1030 "GOL" "AND TO THINK, YOU TWO TRAVELLED ALL THIS WAY FOR MY HELP.") + (1180 "GOL" "FOOLS! ENJOY YOUR FRONT ROW SEATS TO THE RECREATION OF THE WORLD!") + (1391) + (1605 "SAGE" "JAK! TAKE THE ELEVATOR UP AND STOP THAT ROBOT!") + ) + +("green-sagecage-resolution" + (35 "SAGE" "GOOD WORK, BOYS! YOU'RE REAL HEROES NOW.") + (158 "SAGE" "I'LL COMBINE MY GREEN ECO POWER WITH THE OTHER THREE SAGES") + (280 "SAGE" "AND TOGETHER WE'LL OPEN THE SHIELD DOOR SURROUNDING THE PRECURSOR ROBOT.") + (405 "DAXTER" "YEAH YEAH THAT SOUNDS LIKE A GOOD START.") + (457 "DAXTER" "AND THEN AFTER YOU GUYS OPEN THAT SHIELD, WHAT ARE YOU GONNA DO ABOUT THE ROBOT?") + (576 "SAGE" "NOTHING, DAXTER. WE HAVE TO KEEP THE SHIELD OPEN.") + (705 "SAGE" "IT'S UP TO YOU TWO TO FIGURE OUT HOW TO DESTROY THE ROBOT.") + (823 "DAXTER" "OH, GREAT. I GET TO HELP THE GUY THAT TURNED ME INTO A FURBALL") + (983 "DAXTER" "DESTROY THE ONLY PERSON WHO CAN TURN ME BACK!") + (1111) + (1161 "SAGE" "FIRST, SAVE THE WORLD! THEN WE'LL TRY TO CONVINCE GOL TO HELP DAXTER.") + ) + +("redsage-resolution" + (58 "RED SAGE" "(CHUCKLES) YOU'VE FINALLY COME TO RESCUE ME.") + (190 "RED SAGE" "DO YOU KNOW HOW LONG I'VE BEEN IN HERE? WHAT TOOK YOU SO LONG? AND UH... (CHUCKLES)") + (378 "RED SAGE" "WHAT ARE YOUR NAMES?") + (429) + (432 "DAXTER" "I'M DAXTER! HE'S JAK, HE'S WITH ME.") + (540 :offscreen "RED SAGE" "GOOD JOB, DAXTER. YOU'RE A REAL HERO.") + (677) + (703 "RED SAGE" "YOU'VE GOT TO STOP GOL FROM LAUNCHING THE ROBOT.") + (837 "RED SAGE" "I'LL USE MY ECO POWER TO HELP OPEN THE SHIELD DOOR.") + ) + +("sksp0378" :hint #x813 + (0 "DAXTER" "THE DOOR'S OPEN, LET'S GET GOING!") + ) + +("sksp0381" :hint #x806 + (0 "DAXTER" "BREAK THE GENERATOR TO FREE THE SAGE!") + ) + +("sksp0382" :hint #x807 + (0 "DAXTER" "JUST HANG ON TO THE EDGE!") + ) + +("sksp0383" :hint #x808 + (0 "DAXTER" "WE GOT COMPANY, JAK. LOOOTS OF LURKERS!") + ) + +("sksp0384" :hint #x809 + (0 "DAXTER" "DESTROY THOSE GENERATORS!") + ) + +("sksp0385" :hint #x80a + (0 "DAXTER" "PUSH THE BUTTON!") + ) + +("sksp0386" :hint #x80b + (0 "DAXTER" "THAT ROBOT DOESN'T SCARE ME!") + ) + +("sksp0387" :hint #x80c + (0 "DAXTER" "LET'S GO CLIMB UP THOSE PLATFORMS!") + ) + +("sksp0388" :hint #x80d + (0 "DAXTER" "DON'T MISS THE NEXT LAUNCHER!") + ) + +("sksp0389" :hint #x80e + (0 "DAXTER" "WATCH IT!") + ) + +("sksp0390" :hint #x80f + (0 "DAXTER" "WE HAVE TO RESCUE ALL THE SAGES!") + ) + +("sksp0391" :hint #x810 + (0 "DAXTER" "DO YOU THINK GOL WILL STILL CHANGE ME BACK?") + ) + +("sksp0392" :hint #x811 + (0 "DAXTER" "SO THIS IS GOL AND MAIA'S CITADEL. NICE AND COZY.") + ) + +("sksp0393" :hint #x812 + (0 "DAXTER" "LAND ON THE NEXT LAUNCHER!") + ) + +("yellowsage-resolution" + (57 "YELLOW SAGE" "WHO WOULDA THOUGHT I'D LIVE TO SEE THE DAY") + (137 "YELLOW SAGE" "WHEN I NEEDED TO BE RESCUED BY A BOY AND HIS MUSKRAT!") + (271 "YELLOW SAGE" "(SIGHS) I'M GONNA GIVE GOL AND MAIA A LITTLE PAYBACK FOR THIS EMBARRASSMENT!") + (471) + (480 "YELLOW SAGE" "THEN WE'LL SEE ABOUT COOKING UP SOME MUSKRAT STEW...") + (605) + ) + +;; ----------------- +;; finalboss +;; ----------------- + +("GOL-AM01" :hint #x0 + (0 "GOL" "YOU JUST WON'T GIVE UP, WILL YOU?") + ) + +("GOL-AM02" :hint #x0 + (0 "GOL" "SOON, THE DARK ECO WILL BE OURS!") + ) + +("GOL-AM03" :hint #x0 + (0 "GOL" "FINISH THEM!") + ) + +("GOL-AM04" :hint #x0 + (0 "GOL" "FIRE!") + ) + +("GOL-AM05" :hint #x0 + (0 "GOL" "BLAST THEM!") + ) + +("GOL-AM06" :hint #x0 + (0 "GOL" "WHAT? THEM AGAIN!") + ) + +("GOL-AM07" :hint #x0 + (0 "GOL" "IT'S TOO LATE!") + ) + +("GOL-AM08" :hint #x0 + (0 "GOL" "YOU ARE MINE!") + ) + +("GOL-AM09" :hint #x0 + (0 "GOL" "I HAVE YOU NOW!") + ) + +("GOL-AM10" :hint #x0 + (0 "GOL" "AH HA HA HA HA!") + ) + +("GOL-AM11" :hint #x0 + (0 "GOL" "NO MERCY!") + ) + +("GOL-AM12" :hint #x0 + (0 "GOL" "TAKE THAT!") + ) + +("GOL-AM13" :hint #x0 + (0 "GOL" "NICE TRY!") + ) + +("GOL-AM14" :hint #x0 + (0 "GOL" "STAND STILL!") + ) + +("GOL-AM15" :hint #x0 + (0 "GOL" "PATHETIC!") + ) + +("GOL-AM16" :hint #x0 + (0 "GOL" "NOOO!") + ) + +("GOL-AM17" :hint #x0 + (0 "GOL" "AHHH!") + ) + +("GOL-AM18" :hint #x0 + (0 "GOL" "WE'LL OPEN THE SILO ALL THE WAY AND DESTROY YOU TWO!") + ) + +("GOL-AM19" :hint #x0 + (0 "GOL" "LIGHT ECO! IT DOES EXIST!") + ) + +("GOL-AM20" :hint #x0 + (0 "GOL" "WE'RE NOT GONNA TAKE IT!") + ) + +("MAI-AM01" :hint #x0 + (0 "MAIA" "FINISH THEM BOTH OFF ONCE AND FOR ALL!") + ) + +("MAI-AM02" :hint #x0 + (0 "MAIA" "TAKE THEM OUT!") + ) + +("MAI-AM03" :hint #x0 + (0 "MAIA" "HA HA HA!") + ) + +("MAI-AM04" :hint #x0 + (0 "MAIA" "ECO WON'T PROTECT YOU NOW!") + ) + +("MAI-AM05" :hint #x0 + (0 "MAIA" "DO SOMETHING!") + ) + +("MAI-AM06" :hint #x0 + (0 "MAIA" "AGH!") + ) + +("MAI-AM07" :hint #x0 + (0 "MAIA" "NOOOOO!") + ) + +("MAI-AM08" :hint #x0 + (0 "MAIA" "WE'LL OPEN THE SILO ALL THE WAY AND DESTROY YOU TWO!") + ) + +("MAI-AM09" :hint #x0 + (0 "MAIA" "THEY MUST NOT BE ALLOWED TO GET IT!") + ) + +("finalbosscam-white-eco" + (163 :offscreen "GOL" "LIGHT ECO! IT DOES EXIST!") + (268 :offscreen "MAIA" "THEY MUST NOT BE ALLOWED TO GET IT!") + ) + +("green-sagecage-daxter-sacrifice" + (0 "DAXTER" "LIGHT ECO! THAT COULD BE THE STUFF TO CHANGE ME BACK!") + (114) + (123 "DAXTER" "OR... IT MIGHT STOP THAT ROBOT.") + (235) + (274 "DAXTER" "STAY FUZZY, SAVE THE WORLD... CHOICES...") + (404) + (437 "DAXTER" "OKAY FINE WE'LL SAVE THE WORLD, BUT DO IT QUICKLY BEFORE I CHANGE MY MIND!") + (634) + ) + +("green-sagecage-outro-beat-boss-a" + (165 :offscreen "MAIA" "DO SOMETHING!") + (216) + (596 :offscreen "GOL" "NOOO!") + ) + +("green-sagecage-outro-beat-boss-b" + (522 "SAGE" "WELL IT LOOKS LIKE I MAY HAVE BEEN TOO HARD ON YOU BOYS.") + (640 "SAGE" "YOU DO HAVE WHAT IT TAKES TO BE HEROES!") + (745) + (751 "KEIRA" "BUT, DAXTER, NOW WE CAN'T CHANGE YOU BACK.") + (845) + (847 "DAXTER" "DON'T WORRY ABOUT ME, BABY. YOU KNOW WHAT THEY SAY: BIG THINGS COME IN SMALL PACKAGES.") + (1096) + (1100 "BLUE SAGE" "JAK, YOU HAVE AN INCREDIBLE TALENT FOR CHANNELING ECO!") + (1219) + (1222 "BLUE SAGE" "SAMOS, YOU MAY HAVE BEEN RIGHT ABOUT THIS ONE AFTER ALL!") + (1321) + (1323 "RED SAGE" "AND KEIRA, WITHOUT YOUR HELP AND INGENUITY NONE OF THIS WOULD HAVE BEEN POSSIBLE.") + (1515 "RED SAGE" "HM-HM-HM. PERHAPS WE FOUND ANOTHER SAGE NOW THAT GOL AND MAIA ARE LOST...") + (1728) + (1731 "SAGE" "YES, GOL AND MAIA... THE DARK ECO PROBABLY DESTROYED THEM.") + (1916 :offscreen "SAGE" "EH, PROBABLY...") + (1999) + (2003 "DAXTER" "AH WHO CARES? BRING 'EM ON WE CAN TAKE 'EM AGAIN, RIGHT JAK?") + (2168) + (2172 "DAXTER" "I SAID, RIGHT, JAK?") + (2256) + (2302 "DAXTER" "WHOA! PUT IT ON ICE, BIG GUY!") + ) + +("green-sagecage-outro-beat-boss-enough-cells" + (151 "SAGE" "HOLY YAKOW! WHAT COULD THAT BE?") + (247 "KEIRA" "WOW, IT'S AN ANCIENT PRECURSOR DOOR!") + (342 :offscreen "KEIRA" "IT LOOKS LIKE IT WILL ONLY OPEN IF WE FILL ALL 100 HOLES WITH POWER CELLS!") + (485 "DAXTER" "UH, WE'RE HEROES, REMEMBER? WE HAVE 100 POWER CELLS!") + ) + +("green-sagecage-outro-beat-boss-need-cells" + (151 "SAGE" "HOLY YAKOW! WHAT COULD THAT BE?") + (247 "KEIRA" "WOW, IT'S AN ANCIENT PRECURSOR DOOR!") + (342 :offscreen "KEIRA" "IT LOOKS LIKE IT WILL ONLY OPEN IF WE FILL ALL 100 HOLES WITH POWER CELLS!") + (485 "DAXTER" "OH BOY... HERE WE GO AGAIN!") + ) + +("green-sagecage-outro-big-finish" + (322 "DAXTER" "WOW! WHAT IS IT?") + (425) + (428 "KEIRA" "IT'S SO BEAUTIFUL...") + (516) + (519 "SAGE" "BY THE PRECURSORS...") + (602) + ) + +;; ----------------- +;; training +;; ----------------- + +("asstvb40" :hint #x900 + (0 "KEIRA" "THIS DEVICE IS A COMMUNICATOR. WITH IT, MY FATHER AND I") + (181 "KEIRA" "CAN GIVE YOU ADVICE AT ANY TIME DURING YOUR QUEST.") + ) + +("asstvb41" :hint #x901 + (0 "KEIRA" "THESE FLOATING EGG-SHAPED THINGS ARE PRECURSOR ORBS.") + (176) + (180 "KEIRA" "COLLECT ENOUGH OF THEM, AND SOME OF THE VILLAGERS WILL GIVE YOU") + (315 "KEIRA" "A POWER CELL IN EXCHANGE.") + ) + +("asstvb42" :hint #x902 + (0 "KEIRA" "THIS IS A POWER CELL, THE MOST IMPORTANT PRECURSOR ARTIFACT YOU CAN FIND!") + (327) + (333 "KEIRA" "YOU NEED TO COLLECT 20 OF THESE SO I CAN POWER THE HEAT SHIELD") + (507 "KEIRA" "FOR YOUR A-GRAV ZOOMER.") + ) + +("asstvb44" :hint #x903 + (0 "KEIRA" "HEY, YOU FOUND ONE OF MY SCOUT FLIES!") + (160 "KEIRA" "I SENT 7 OF THEM TO EACH AREA TO LOOK FOR POWER CELLS") + (343 "KEIRA" "BUT THE LURKERS MUST HAVE CAPTURED THEM ALL!") + ) + +("asstvb45" :hint #x904 + (0 "KEIRA" "WOW! THAT LAST SCOUT FLY HAD A POWER CELL!") + (219 "KEIRA" "I'LL BET IF YOU COLLECT ALL 7 IN EACH AREA YOU CAN FIND EVEN MORE POWER CELLS.") + ) + +("asstvb46" :hint #x905 + (0 "KEIRA" "BE CAREFUL IN THE OCEAN, THE WATERS ARE CHOCK-FULL OF LURKER SHARKS") + (258 "KEIRA" "AND I'VE NEVER SEEN ANYONE DEFEAT ONE.") + (419) + (426 "KEIRA" "STAY CLEAR OF THEM IF YOU KNOW WHAT'S GOOD FOR YOU!") + ) + +("asstvb47" :hint #x906 + (0 "KEIRA" "REMEMBER, THAT'S A POWER CELL. YOU NEED TO COLLECT AS MANY OF THOSE AS YOU CAN.") + ) + +("asstvb48" :hint #x907 + (0 "KEIRA" "THAT'S A BLUE ECO VENT! MORE CONCENTRATED THAN THE FLOATING CLUSTERS,") + (253 "KEIRA" "THIS VENT WILL GIVE YOU A FULL CHARGE OF BLUE ECO,") + (419 "KEIRA" "LETTING YOU USE IT FOR THE MAXIMUM TIME.") + ) + +("sagevb21" :hint #x908 + (3 "SAGE" "THOSE LITTLE GREEN BALLS OF ENERGY ON THE GROUND ARE A TYPE OF ECO.") + (280 "SAGE" "PICK UP 50 SMALL GREEN ECOES, OR ONE BIG GREEN ONE TO INCREASE YOUR HEALTH.") + ) + +("sagevb22" :hint #x909 + (0 "SAGE" "THAT'S BLUE ECO, WHICH CONTAINS THE ENERGY OF MOTION.") + (291 "SAGE" "BLUE ECO ALLOWS YOU TO RUN FAST, BREAK BOXES, AND EVEN ACTIVATE SOME PRECURSOR") + (640 "SAGE" "ARTIFACTS WHEN YOU GET NEAR THEM.") + ) + +("sagevb23" :hint #x90a + (0 "SAGE" "NOTICE HOW EACH BLUE ECO CLUSTER YOU PICK UP INCREASES THE TIME YOU CAN USE ITS POWER.") + ) + +("sagevb24" :hint #x90b + (3 "SAGE" "THIS IS A PRECURSOR DOOR. IT CAN ONLY BE OPENED BY APPROACHING THE DOOR") + (357 "SAGE" "WHILE CHANNELING BLUE ECO THROUGH YOUR BODY.") + ) + +("sagevb25" :hint #x90c + (3 "SAGE" "GOOD WORK, THE BLUE ECO CAUSED THE DOOR TO OPEN. WITH BLUE ECO, YOU CAN BREATHE") + (365 "SAGE" "ENERGY INTO ALL KINDS OF PRECURSOR ARTIFACTS THAT HAVE LAIN DORMANT FOR YEARS.") + ) + +("sagevb26" :hint #x90d + (0 "SAGE" "USE YOUR GOGGLES TO VIEW YOUR PROGRESS DURING THE ADVENTURE.") + ) + +("sagevb27" :hint #x90e + (1 "SAGE" "YOU CAN JUMP ONCE, THEN JUMP AGAIN IN THE AIR TO REACH EVEN HIGHER LEDGES.") + ) + +("sagevb28" :hint #x90f + (0 "SAGE" "WHEN YOU'RE SURROUNDED BY ENEMIES, USE YOUR SPIN KICK.") + ) + +("sagevb29" :hint #x910 + (0 "SAGE" "THAT'S NOT A SPIN KICK! TRY AGAIN.") + ) + +("sagevb30" :hint #x911 + (0 "SAGE" "COME ON, JAK! DO A SPIN KICK.") + ) + +("sagevb31" :hint #x912 + (0 "SAGE" "GOOD WORK. USE THE SPIN KICK WHEN YOU WANT A GOOD ALL-ROUND ATTACK.") + ) + +("sagevb32" :hint #x913 + (0 "SAGE" "FOR A STRAIGHT LINE, MOVING ATTACK, USE YOUR FIST TO PUNCH.") + ) + +("sagevb33" :hint #x914 + (0 "SAGE" "THAT'S NOT A PUNCH ATTACK! LET'S SEE YOU PUNCH ALREADY.") + ) + +("sagevb34" :hint #x915 + (0 "SAGE" "JAK! USE A PUNCH.") + ) + +("sagevb35" :hint #x916 + (0 "SAGE" "GREAT JOB. USE THE PUNCH TO CLOSE DISTANCE QUICKLY IN A TOUGH SPOT.") + ) + +("sagevb36" :hint #x917 + (0 "SAGE" "SOMETIMES YOU'LL WANT TO HIT THINGS WITH A GREATER FORCE.") + (218 "SAGE" "TO BREAK ONE OF THESE BOXES, YOU SHOULD JUMP IN THE AIR") + (420 "SAGE" "AND THEN DIVE DOWN ONTO IT, HANDS FIRST.") + ) + +("sagevb37" :hint #x918 + (0 "SAGE" "WHEN YOU GET SOME CONFIDENCE, TRY USING SOME OF YOUR MOVES IN COMBINATIONS.") + ) + +("sagevb38" :hint #x919 + (0 "SAGE" "YOU CAN'T COME BACK THROUGH THE WARP GATE UNTIL YOU FIND") + (168 "SAGE" "ALL 4 POWER CELLS ON THIS ISLAND.") + ) + +("sagevb39" :hint #x91a + (0 "SAGE" "GREAT! YOU FOUND ALL OF THE POWER CELLS ON THE ISLAND.") + (269 "SAGE" "COME BACK TO THE WARP GATE SO I CAN BRING YOU BACK TO THE LAB. HURRY UP!") + ) + +;; ----------------- +;; uncategorized +;; ----------------- + diff --git a/game/assets/jak1/subtitle/game_subtitle_es.gd b/game/assets/jak1/subtitle/game_subtitle_es.gd new file mode 100644 index 0000000000..711666ce86 --- /dev/null +++ b/game/assets/jak1/subtitle/game_subtitle_es.gd @@ -0,0 +1,58 @@ +(language-id 3) + +;; ----------------- +;; intro +;; ----------------- + +;; ----------------- +;; sidekick +;; ----------------- + +;; ----------------- +;; village1 +;; ----------------- + +;; ----------------- +;; oracle +;; ----------------- + +("oracle-left-eye-1" + (0 "ORÁCULO" "HABÉIS DEMOSTRADO SER HONESTOS. É AQUÍ UNA BATERÍA.") + ) + +;; ----------------- +;; beach +;; ----------------- + +;; ----------------- +;; jungle +;; ----------------- + +;; ----------------- +;; misty +;; ----------------- + +;; ----------------- +;; firecanyon +;; ----------------- + +;; ----------------- +;; swamp +;; ----------------- + +;; ----------------- +;; citadel +;; ----------------- + +;; ----------------- +;; finalboss +;; ----------------- + +;; ----------------- +;; training +;; ----------------- + +;; ----------------- +;; uncategorized +;; ----------------- + diff --git a/game/assets/jak1/subtitle/subtitle-editor-db.json b/game/assets/jak1/subtitle/subtitle-editor-db.json new file mode 100644 index 0000000000..07ed5d7d08 --- /dev/null +++ b/game/assets/jak1/subtitle/subtitle-editor-db.json @@ -0,0 +1,643 @@ +{ + "assistant-firecanyon-resolution": { + "entity_type": "assistant-firecanyon", + "process_name": "assistant-firecanyon-1", + "continue_name": "firecanyon-start", + "move_to": [-27.0, 31.0, -183.0], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": ["(dm-lavabike-ready 0 (debug-menu-msg press))"] + }, + "assistant-introduction-blue-eco-switch": { + "entity_type": "assistant", + "process_name": "assistant-11", + "continue_name": "village1-hut", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + ] + }, + "assistant-reminder-1-blue-eco-switch": { + "entity_type": "assistant", + "process_name": "assistant-11", + "continue_name": "village1-hut", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))" + ] + }, + "assistant-introduction-race-bike": { + "entity_type": "assistant", + "process_name": "assistant-11", + "continue_name": "village1-hut", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": ["(dm-give-cell (game-task jungle-eggtop))"] + }, + "assistant-reminder-1-generic": { + "entity_type": "assistant", + "process_name": "assistant-11", + "continue_name": "village1-hut", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-resolution 16 (debug-menu-msg press))", + "(dm-task-resolution 216 (debug-menu-msg press))" + ] + }, + "assistant-reminder-1-race-bike": { + "entity_type": "assistant", + "process_name": "assistant-11", + "continue_name": "village1-hut", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-give-cell (game-task jungle-eggtop))", + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))" + ] + }, + "billy-accept": { + "entity_type": "billy", + "process_name": "billy-2", + "continue_name": "swamp-game", + "move_to": [606.1, 0.45, -2024.81], + "execute_code": "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "requirements": [] + }, + "billy-introduction": { + "entity_type": "billy", + "process_name": "billy-2", + "continue_name": "swamp-game", + "move_to": [606.1, 0.45, -2024.81], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [] + }, + "billy-reject": { + "entity_type": "billy", + "process_name": "billy-2", + "continue_name": "swamp-game", + "move_to": [606.1, 0.45, -2024.81], + "execute_code": "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "requirements": [] + }, + "billy-reminder-1": { + "entity_type": "billy", + "process_name": "billy-2", + "continue_name": "swamp-game", + "move_to": [606.1, 0.45, -2024.81], + "execute_code": "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "requirements": [] + }, + "billy-resolution": { + "entity_type": "billy", + "process_name": "billy-2", + "continue_name": "swamp-game", + "move_to": [606.1, 0.45, -2024.81], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": ["(dm-task-reminder 288 (debug-menu-msg press))"] + }, + "bird-lady-beach-resolution": { + "entity_type": "bird-lady-beach", + "process_name": "bird-lady-beach-1", + "continue_name": "beach-start", + "move_to": [-76.90, 22.09, -270.7], + "move_first": true, + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(run-now-in-process (process-by-name \"flutflutegg-1\" *active-pool*) (lambda () (go flutflutegg-physics-fall)))" + ] + }, + "bird-lady-introduction": { + "entity_type": "bird-lady", + "process_name": "bird-lady-4", + "continue_name": "village1-hut", + "move_to": [-51, 10, -7], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [] + }, + "bird-lady-reminder-1": { + "entity_type": "bird-lady", + "process_name": "bird-lady-4", + "continue_name": "village1-hut", + "move_to": [-51, 10, -7], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))" + ] + }, + "bird-lady-reminder-2": { + "entity_type": "bird-lady", + "process_name": "bird-lady-4", + "continue_name": "village1-hut", + "move_to": [-51, 10, -7], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "(save-reminder (-> __GET-PROCESS__ tasks) 1 0)" + ] + }, + "lrocklrg-falling": { + "entity_type": "beach-rock", + "process_name": "lrocklrg-1", + "continue_name": "beach-start", + "move_to": [-244, 32, -332], + "execute_code": "(send-event __GET-PROCESS__ 'trigger)", + "requirements": [] + }, + "bluesage-resolution": { + "entity_type": "blue-sagecage", + "process_name": "blue-sagecage-1", + "continue_name": "citadel-plat-end", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(close-specific-task! (game-task citadel-sage-blue) (task-status need-hint))", + "(close-specific-task! (game-task citadel-sage-red) (task-status need-hint))", + "(close-specific-task! (game-task citadel-sage-green) (task-status need-hint))", + "(close-specific-task! (game-task citadel-sage-yellow) (task-status need-hint))" + ] + }, + "explorer-introduction": { + "entity_type": "explorer", + "process_name": "explorer-4", + "continue_name": "village1-hut", + "move_to": [-87.04, 9.39, 43.64], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [] + }, + "explorer-reminder-1": { + "entity_type": "explorer", + "process_name": "explorer-4", + "continue_name": "village1-hut", + "move_to": [-87.04, 9.39, 43.64], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))" + ] + }, + "explorer-reminder-2": { + "entity_type": "explorer", + "process_name": "explorer-4", + "continue_name": "village1-hut", + "move_to": [-87.04, 9.39, 43.64], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "(save-reminder (-> __GET-PROCESS__ tasks) 1 0)" + ] + }, + "explorer-resolution": { + "entity_type": "explorer", + "process_name": "explorer-4", + "continue_name": "village1-hut", + "move_to": [-87.04, 9.39, 43.64], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "(dm-task-get-money 0 (debug-menu-msg press))" + ] + }, + "farmer-introduction": { + "entity_type": "farmer", + "process_name": "farmer-3", + "continue_name": "village1-hut", + "move_to": [-3.16, 1.77, -63.1], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [] + }, + "farmer-reminder-1": { + "entity_type": "farmer", + "process_name": "farmer-3", + "continue_name": "village1-hut", + "move_to": [-3.16, 1.77, -63.1], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))" + ] + }, + "farmer-reminder-2": { + "entity_type": "farmer", + "process_name": "farmer-3", + "continue_name": "village1-hut", + "move_to": [-3.16, 1.77, -63.1], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "(save-reminder (-> __GET-PROCESS__ tasks) 1 0)" + ] + }, + "farmer-resolution": { + "entity_type": "farmer", + "process_name": "farmer-3", + "continue_name": "village1-hut", + "move_to": [-3.16, 1.77, -63.1], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": ["(dm-task-reminder 80 (debug-menu-msg press))"] + }, + "fisher-accept": { + "entity_type": "fisher", + "process_name": "fisher-1", + "continue_name": "jungle-start", + "move_to": [262.35, 2.28, -231.83], + "execute_code": "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "requirements": [] + }, + "fisher-introduction": { + "entity_type": "fisher", + "process_name": "fisher-1", + "continue_name": "jungle-start", + "move_to": [262.35, 2.28, -231.83], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [] + }, + "fisher-reject": { + "entity_type": "fisher", + "process_name": "fisher-1", + "continue_name": "jungle-start", + "move_to": [262.35, 2.28, -231.83], + "execute_code": "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "requirements": [] + }, + "fisher-reminder-1": { + "entity_type": "fisher", + "process_name": "fisher-1", + "continue_name": "jungle-start", + "move_to": [262.35, 2.28, -231.83], + "execute_code": "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "requirements": [] + }, + "fisher-resolution": { + "entity_type": "fisher", + "process_name": "fisher-1", + "continue_name": "jungle-start", + "move_to": [262.35, 2.28, -231.83], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": ["(dm-task-reminder 40 (debug-menu-msg press))"] + }, + "geologist-introduction": { + "entity_type": "geologist", + "process_name": "geologist-1", + "continue_name": "village2-start", + "move_to": [-56.6, 11.0, 32.9], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [] + }, + "green-sagecage-introduction": { + "entity_type": "green-sagecage", + "process_name": "green-sagecage-1", + "continue_name": "citadel-start", + "move_to": [262.35, 2.28, -231.83], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [] + }, + "green-sagecage-resolution": { + "entity_type": "green-sagecage", + "process_name": "green-sagecage-1", + "continue_name": "citadel-elevator", + "move_to": [262.35, 2.28, -231.83], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(close-specific-task! (game-task citadel-sage-blue) (task-status need-hint))", + "(close-specific-task! (game-task citadel-sage-red) (task-status need-hint))", + "(close-specific-task! (game-task citadel-sage-green) (task-status need-hint))", + "(close-specific-task! (game-task citadel-sage-yellow) (task-status need-hint))", + "(dm-give-all-cells 0 (debug-menu-msg press))" + ] + }, + "mayor-introduction": { + "entity_type": "mayor", + "process_name": "mayor-5", + "continue_name": "village1-hut", + "move_to": [-87.04, 9.39, 43.64], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [] + }, + "mayor-reminder-beams": { + "entity_type": "mayor", + "process_name": "mayor-5", + "continue_name": "village1-hut", + "move_to": [-87.04, 9.39, 43.64], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-introduction 24 (debug-menu-msg press))", + "(dm-task-introduction 88 (debug-menu-msg press))" + ] + }, + "mayor-reminder-donation": { + "entity_type": "mayor", + "process_name": "mayor-5", + "continue_name": "village1-hut", + "move_to": [-87.04, 9.39, 43.64], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-introduction 24 (debug-menu-msg press))", + "(dm-task-introduction 88 (debug-menu-msg press))", + "(save-reminder (-> __GET-PROCESS__ tasks) 1 0)" + ] + }, + "mayor-resolution-beams": { + "entity_type": "mayor", + "process_name": "mayor-5", + "continue_name": "village1-hut", + "move_to": [-87.04, 9.39, 43.64], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-introduction 24 (debug-menu-msg press))", + "(dm-task-introduction 88 (debug-menu-msg press))", + "(dm-task-reminder 24 (debug-menu-msg press))" + ] + }, + "mayor-resolution-donation": { + "entity_type": "mayor", + "process_name": "mayor-5", + "continue_name": "village1-hut", + "move_to": [-87.04, 9.39, 43.64], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-introduction 24 (debug-menu-msg press))", + "(dm-task-introduction 88 (debug-menu-msg press))", + "(dm-task-get-money 0 (debug-menu-msg press))" + ] + }, + "oracle-intro-1": { + "entity_type": "oracle", + "process_name": "oracle-1", + "continue_name": "village1-hut", + "move_to": [82.8, 18.2, 14.3], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-hint 104 (debug-menu-msg press))", + "(dm-task-hint 112 (debug-menu-msg press))" + ] + }, + "oracle-left-eye-1": { + "entity_type": "oracle", + "process_name": "oracle-1", + "continue_name": "village1-hut", + "move_to": [82.8, 18.2, 14.3], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-hint 104 (debug-menu-msg press))", + "(dm-task-hint 112 (debug-menu-msg press))", + "(dm-task-get-money 0 (debug-menu-msg press))", + "(dm-task-get-money 0 (debug-menu-msg press))", + "(dm-give-cell (game-task village1-oracle-money1))" + ] + }, + "oracle-left-eye-2": { + "entity_type": "oracle", + "process_name": "oracle-2", + "continue_name": "village2-start", + "move_to": [238.48, 11.9, -1532.6], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-hint 104 (debug-menu-msg press))", + "(dm-task-hint 112 (debug-menu-msg press))", + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "(dm-task-get-money 0 (debug-menu-msg press))", + "(dm-task-get-money 0 (debug-menu-msg press))", + "(dm-give-cell (game-task village2-oracle-money1))" + ] + }, + "oracle-left-eye-3": { + "entity_type": "oracle", + "process_name": "oracle-3", + "continue_name": "village3-start", + "move_to": [1024.94, 40.07, -3507.05], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-hint 104 (debug-menu-msg press))", + "(dm-task-hint 112 (debug-menu-msg press))", + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "(dm-task-get-money 0 (debug-menu-msg press))", + "(dm-task-get-money 0 (debug-menu-msg press))", + "(dm-give-cell (game-task village3-oracle-money1))" + ] + }, + "oracle-reminder-1": { + "entity_type": "oracle", + "process_name": "oracle-1", + "continue_name": "village1-hut", + "move_to": [82.8, 18.2, 14.3], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-hint 104 (debug-menu-msg press))", + "(dm-task-hint 112 (debug-menu-msg press))", + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))" + ] + }, + "oracle-right-eye-1": { + "entity_type": "oracle", + "process_name": "oracle-1", + "continue_name": "village1-hut", + "move_to": [82.8, 18.2, 14.3], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-hint 104 (debug-menu-msg press))", + "(dm-task-hint 112 (debug-menu-msg press))", + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "(dm-task-get-money 0 (debug-menu-msg press))", + "(dm-task-get-money 0 (debug-menu-msg press))" + ] + }, + "oracle-right-eye-2": { + "entity_type": "oracle", + "process_name": "oracle-2", + "continue_name": "village2-start", + "move_to": [238.48, 11.9, -1532.6], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-hint 104 (debug-menu-msg press))", + "(dm-task-hint 112 (debug-menu-msg press))", + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "(dm-task-get-money 0 (debug-menu-msg press))", + "(dm-task-get-money 0 (debug-menu-msg press))" + ] + }, + "oracle-right-eye-3": { + "entity_type": "oracle", + "process_name": "oracle-3", + "continue_name": "village3-start", + "move_to": [1024.94, 40.07, -3507.05], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-hint 104 (debug-menu-msg press))", + "(dm-task-hint 112 (debug-menu-msg press))", + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))", + "(dm-task-get-money 0 (debug-menu-msg press))", + "(dm-task-get-money 0 (debug-menu-msg press))" + ] + }, + "redsage-resolution": { + "entity_type": "red-sagecage", + "process_name": "red-sagecage-1", + "continue_name": "citadel-generator-end", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(close-specific-task! (game-task citadel-sage-blue) (task-status need-hint))", + "(close-specific-task! (game-task citadel-sage-red) (task-status need-hint))", + "(close-specific-task! (game-task citadel-sage-green) (task-status need-hint))", + "(close-specific-task! (game-task citadel-sage-yellow) (task-status need-hint))" + ] + }, + "sage-intro-sequence-a": { + "entity_type": "", + "process_name": "", + "continue_name": "intro-start", + "move_to": [], + "execute_code": "", + "requirements": [] + }, + "sage-intro-sequence-d1": { + "entity_type": "sage", + "process_name": "sage-23", + "continue_name": "village1-hut", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [] + }, + "sage-intro-sequence-d2": { + "entity_type": "sage", + "process_name": "sage-23", + "continue_name": "village1-hut", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [] + }, + "sage-intro-sequence-e": { + "entity_type": "sage", + "process_name": "sage-23", + "continue_name": "village1-hut", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-resolution 736 (debug-menu-msg press))", + "(dm-task-resolution 744 (debug-menu-msg press))", + "(dm-task-resolution 752 (debug-menu-msg press))", + "(dm-task-resolution 760 (debug-menu-msg press))", + "(dm-task-resolution 872 (debug-menu-msg press))" + ] + }, + "sage-introduction-misty-cannon": { + "entity_type": "sage", + "process_name": "sage-23", + "continue_name": "village1-hut", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-resolution 736 (debug-menu-msg press))", + "(dm-task-resolution 744 (debug-menu-msg press))", + "(dm-task-resolution 752 (debug-menu-msg press))", + "(dm-task-resolution 760 (debug-menu-msg press))", + "(dm-task-resolution 872 (debug-menu-msg press))", + "(dm-task-introduction 120 (debug-menu-msg press))" + ] + }, + "sage-reminder-1-ecorocks": { + "entity_type": "sage", + "process_name": "sage-23", + "continue_name": "village1-hut", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-resolution 736 (debug-menu-msg press))", + "(dm-task-resolution 744 (debug-menu-msg press))", + "(dm-task-resolution 752 (debug-menu-msg press))", + "(dm-task-resolution 760 (debug-menu-msg press))", + "(dm-task-resolution 872 (debug-menu-msg press))", + "(dm-task-introduction 120 (debug-menu-msg press))", + "(dm-task-introduction 208 (debug-menu-msg press))", + "(dm-task-reminder 208 (debug-menu-msg press))" + ] + }, + "sage-reminder-1-generic": { + "entity_type": "sage", + "process_name": "sage-23", + "continue_name": "village1-hut", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-resolution 736 (debug-menu-msg press))", + "(dm-task-resolution 744 (debug-menu-msg press))", + "(dm-task-resolution 752 (debug-menu-msg press))", + "(dm-task-resolution 760 (debug-menu-msg press))", + "(dm-task-resolution 872 (debug-menu-msg press))", + "(dm-task-introduction 120 (debug-menu-msg press))", + "(dm-task-introduction 208 (debug-menu-msg press))", + "(dm-task-reminder 208 (debug-menu-msg press))", + "(dm-task-resolution 120 (debug-menu-msg press))" + ] + }, + "sage-reminder-1-misty-cannon": { + "entity_type": "sage", + "process_name": "sage-23", + "continue_name": "village1-hut", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(dm-task-resolution 736 (debug-menu-msg press))", + "(dm-task-resolution 744 (debug-menu-msg press))", + "(dm-task-resolution 752 (debug-menu-msg press))", + "(dm-task-resolution 760 (debug-menu-msg press))", + "(dm-task-resolution 872 (debug-menu-msg press))", + "(dm-task-resolution 120 (debug-menu-msg press))", + "(dm-task-introduction 208 (debug-menu-msg press))" + ] + }, + "sculptor-introduction": { + "entity_type": "sculptor", + "process_name": "sculptor-6", + "continue_name": "village1-hut", + "move_to": [-110.43, 9.75, -3.46], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [] + }, + "sculptor-reminder-1": { + "entity_type": "sculptor", + "process_name": "sculptor-6", + "continue_name": "village1-hut", + "move_to": [-110.43, 9.75, -3.46], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(close-status! (-> __GET-PROCESS__ tasks) (task-status need-introduction))" + ] + }, + "sculptor-resolution": { + "entity_type": "sculptor", + "process_name": "sculptor-6", + "continue_name": "village1-hut", + "move_to": [-110.43, 9.75, -3.46], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": ["(dm-task-reminder 184 (debug-menu-msg press))"] + }, + "sidekick-human-intro-sequence-b": { + "entity_type": "", + "process_name": "", + "continue_name": "intro-start", + "move_to": [], + "execute_code": "", + "requirements": [] + }, + "sidekick-human-intro-sequence-c": { + "entity_type": "", + "process_name": "", + "continue_name": "intro-start", + "move_to": [], + "execute_code": "", + "requirements": [] + }, + "yellowsage-resolution": { + "entity_type": "yellow-sagecage", + "process_name": "yellow-sagecage-1", + "continue_name": "citadel-launch-end", + "move_to": [], + "execute_code": "(send-event __GET-PROCESS__ 'play-anim)", + "requirements": [ + "(close-specific-task! (game-task citadel-sage-blue) (task-status need-hint))", + "(close-specific-task! (game-task citadel-sage-red) (task-status need-hint))", + "(close-specific-task! (game-task citadel-sage-green) (task-status need-hint))", + "(close-specific-task! (game-task citadel-sage-yellow) (task-status need-hint))" + ] + } +} diff --git a/game/assets/jak1/subtitle/subtitle-groups.json b/game/assets/jak1/subtitle/subtitle-groups.json new file mode 100644 index 0000000000..a36aa75876 --- /dev/null +++ b/game/assets/jak1/subtitle/subtitle-groups.json @@ -0,0 +1,362 @@ +{ + "_groups": [ + "intro", + "sidekick", + "village1", + "oracle", + "beach", + "jungle", + "misty", + "firecanyon", + "swamp", + "citadel", + "finalboss", + "training", + "uncategorized" + ], + "beach": [ + "CHI-LO01", + "CHI-LO02", + "CHI-AM01", + "CHI-AM02", + "CHI-AM03", + "CHI-AM04", + "CHI-AM05", + "CHI-AM06", + "CHI-AM07", + "CHI-AM08", + "SCU-AM01", + "SCU-AM02", + "SCU-AM03", + "SCU-AM04", + "SCU-AM05", + "SCU-AM06", + "SCU-LO01", + "BIR-AM01", + "BIR-AM02", + "BIR-AM03", + "BIR-AM04", + "BIR-AM05", + "BIR-AM06", + "BIR-AM07", + "BIR-AM08", + "BIR-AM09", + "BIR-AM10", + "BIR-AM11", + "BIR-AM12", + "BIR-AM13", + "BIR-LO01", + "BIR-LO02", + "BIR-LO03", + "sksp0019", + "sksp0026", + "sksp0030", + "sksp0034", + "sksp0020", + "sksp0022", + "sksp0023", + "sksp0024", + "sksp0025", + "sksp0027", + "sksp0029", + "sagevb01", + "sksp0443", + "mayor-introduction", + "mayor-reminder-beams", + "mayor-reminder-donation", + "mayor-resolution-beams", + "mayor-resolution-donation", + "sculptor-introduction", + "sculptor-reminder-1", + "sculptor-resolution", + "bird-lady-introduction", + "bird-lady-reminder-1", + "bird-lady-reminder-2", + "bird-lady-beach-resolution" + ], + "citadel": [ + "green-sagecage-introduction", + "redsage-resolution", + "bluesage-resolution", + "yellowsage-resolution", + "green-sagecage-resolution", + "green-sagecage-outro-preboss", + "BLU-AM01", + "BLU-AM02", + "BLU-AM03", + "RED-AM01", + "RED-AM02", + "RED-AM03", + "YEL-AM01", + "YEL-AM02", + "YEL-AM03", + "sksp0381", + "sksp0382", + "sksp0383", + "sksp0384", + "sksp0385", + "sksp0386", + "sksp0387", + "sksp0388", + "sksp0389", + "sksp0390", + "sksp0391", + "sksp0392", + "sksp0393", + "sksp0378" + ], + "finalboss": [ + "GOL-AM01", + "GOL-AM02", + "GOL-AM03", + "GOL-AM04", + "GOL-AM05", + "GOL-AM06", + "GOL-AM07", + "GOL-AM08", + "GOL-AM09", + "GOL-AM10", + "GOL-AM11", + "GOL-AM12", + "GOL-AM13", + "GOL-AM14", + "GOL-AM15", + "GOL-AM16", + "GOL-AM17", + "GOL-AM18", + "GOL-AM19", + "GOL-AM20", + "MAI-AM01", + "MAI-AM02", + "MAI-AM03", + "MAI-AM04", + "MAI-AM05", + "MAI-AM06", + "MAI-AM07", + "MAI-AM08", + "MAI-AM09", + "finalbosscam-white-eco", + "green-sagecage-daxter-sacrifice", + "green-sagecage-outro-beat-boss-a", + "green-sagecage-outro-beat-boss-b", + "green-sagecage-outro-beat-boss-need-cells", + "green-sagecage-outro-beat-boss-enough-cells", + "green-sagecage-outro-big-finish" + ], + "firecanyon": [ + "asstvb09", + "sksp0076", + "sksp0077", + "sksp0078", + "sksp0079", + "sksp0080", + "sksp0081", + "sksp0082", + "sksp0083", + "sksp0084", + "sksp0085", + "sksp0086", + "sksp0087", + "sksp0088", + "sksp0089", + "sksp0090", + "sksp0091", + "sksp0092", + "sksp0093", + "sksp0094", + "sksp0095", + "sksp0096", + "assistant-firecanyon-resolution" + ], + "intro": [ + "sage-intro-sequence-a", + "sidekick-human-intro-sequence-b", + "sidekick-human-intro-sequence-c", + "sage-intro-sequence-d1", + "sage-intro-sequence-d2", + "sage-intro-sequence-e" + ], + "jungle": [ + "FIS-AM01", + "FIS-AM02", + "FIS-AM03", + "FIS-AM04", + "FIS-AM05", + "FIS-AM06", + "FIS-LO01", + "FIS-LO03", + "FIS-LO04", + "FIS-LO05", + "FIS-TA01", + "FIS-TA02", + "FIS-TA1A", + "FIS-TA2A", + "FIS-TA03", + "FIS-TA04", + "FIS-TA05", + "FIS-TA06", + "FIS-TA07", + "FIS-TA08", + "FIS-TA09", + "FIS-TA10", + "FIS-TA11", + "sksp0038", + "sksp0040", + "sksp0041", + "sksp0011", + "sksp0039", + "sksp0018", + "sksp0037", + "sksp0b42", + "asstvb02", + "sksp0049", + "sksp0050", + "sksp0051", + "sksp0052", + "sksp0053", + "sksp0054", + "fisher-introduction", + "fisher-reminder-1", + "fisher-reject", + "fisher-accept", + "fisher-resolution" + ], + "misty": [ + "sksp0031", + "sksp0064", + "sksp0067", + "sksp0059", + "sksp0060", + "sksp0056", + "sksp0062", + "sksp0063", + "sagevb02", + "asstvb03", + "sksp0069", + "sksp0070", + "sksp0435" + ], + "oracle": [ + "oracle-intro-1", + "oracle-reminder-1", + "oracle-right-eye-1", + "oracle-left-eye-1", + "oracle-right-eye-2", + "oracle-left-eye-2", + "oracle-right-eye-3", + "oracle-left-eye-3" + ], + "sidekick": [ + "sksp0014", + "sksp0009", + "sksp0035", + "sksp0001", + "sksp0002", + "sksp0003", + "sksp0004", + "sksp0005", + "sksp0006", + "sksp0007", + "sksp0008", + "sksp009a", + "sksp009b", + "sksp009c", + "sksp009d", + "sksp009e", + "sksp009f", + "sksp009g", + "sksp009i", + "sksp009j", + "sksp009k", + "sksp0071", + "sksp0072", + "sksp0073", + "sksp0145" + ], + "swamp": [ + "billy-introduction", + "billy-reject", + "billy-accept", + "billy-resolution", + "billy-reminder-1" + ], + "training": [ + "asstvb40", + "asstvb41", + "asstvb42", + "asstvb44", + "asstvb45", + "asstvb46", + "asstvb47", + "asstvb48", + "sagevb21", + "sagevb22", + "sagevb23", + "sagevb24", + "sagevb25", + "sagevb26", + "sagevb27", + "sagevb28", + "sagevb29", + "sagevb30", + "sagevb31", + "sagevb32", + "sagevb33", + "sagevb34", + "sagevb35", + "sagevb36", + "sagevb37", + "sagevb38", + "sagevb39" + ], + "uncategorized": [], + "village1": [ + "SAGELP03", + "SAGELP04", + "SAGELP05", + "SAGELP06", + "SAGELP11", + "ASSTLP01", + "ASSTLP02", + "ASSTLP03", + "ASSTLP04", + "ASSTLP05", + "EXP-AM01", + "EXP-AM02", + "EXP-AM03", + "EXP-AM04", + "EXP-AM05", + "EXP-LO02", + "FAR-AM01", + "FAR-AM02", + "FAR-AM2A", + "FAR-LO01", + "FAR-LO1A", + "sksp0010", + "sksp0013", + "sksp0015", + "sksp0017", + "sksp0043", + "sksp018a", + "asstvb04", + "asstvb08", + "sage-introduction-misty-cannon", + "sage-reminder-1-misty-cannon", + "sage-reminder-1-ecorocks", + "sage-reminder-1-generic", + "sage-reminder-2-generic", + "assistant-introduction-blue-eco-switch", + "assistant-reminder-1-blue-eco-switch", + "assistant-introduction-race-bike", + "assistant-reminder-1-race-bike", + "assistant-reminder-1-generic", + "farmer-introduction", + "farmer-reminder-1", + "farmer-reminder-2", + "farmer-resolution", + "explorer-introduction", + "explorer-reminder-1", + "explorer-reminder-2", + "explorer-resolution" + ] +} diff --git a/game/assets/jak1/text/game_text_en.gs b/game/assets/jak1/text/game_text_en.gs new file mode 100644 index 0000000000..f98fed4df0 --- /dev/null +++ b/game/assets/jak1/text/game_text_en.gs @@ -0,0 +1,293 @@ +(group-name "common") +(language-id 0 6) + +;; ----------------- +;; progress menu (insanity) + +(#x1000 "CAMERA OPTIONS" + "CAMERA OPTIONS") +(#x1001 "NORMAL" + "NORMAL") +(#x1002 "INVERTED" + "INVERTED") +(#x1003 "1ST-PERSON HORIZONTAL CAMERA" + "1ST-PERSON HORIZONTAL CAMERA") +(#x1004 "1ST-PERSON VERTICAL CAMERA" + "1ST-PERSON VERTICAL CAMERA") +(#x1005 "3RD-PERSON HORIZONTAL CAMERA" + "3RD-PERSON HORIZONTAL CAMERA") +(#x1006 "3RD-PERSON VERTICAL CAMERA" + "3RD-PERSON VERTICAL CAMERA") +(#x1007 "RESTORE DEFAULTS" + "RESTORE DEFAULTS") + +(#x100f "MISCELLANEOUS" + "MISCELLANEOUS") + +(#x1010 "ACCESSIBILITY" + "ACCESSIBILITY") +(#x1011 "PRECURSOR ORB GLOW" + "PRECURSOR ORB GLOW") + +(#x1020 "PS2 OPTIONS" + "PS2 OPTIONS") +(#x1021 "PS2 LOAD SPEED" + "PS2 LOAD SPEED") +(#x1022 "PARTICLE CULLING" + "PARTICLE CULLING") + +(#x1023 "MUSIC FADE-OUT" + "MUSIC FADE-OUT") +(#x1024 "MUSIC FADE-IN" + "MUSIC FADE-IN") + +(#x1030 "DISCORD RICH-PRESENCE" + "DISCORD RICH-PRESENCE") + +(#x1031 "DISPLAY MODE" + "DISPLAY MODE") +(#x1032 "WINDOWED" + "WINDOWED") +(#x1033 "BORDERLESS" + "BORDERLESS") +(#x1034 "FULLSCREEN" + "FULLSCREEN") + +(#x1035 "GAME RESOLUTION" + "GAME RESOLUTION") +(#x1036 "~D X ~D" + "~D X ~D") + +(#x1037 "PS2 ASPECT RATIO" + "PS2 ASPECT RATIO") +(#x1038 "WHEN PS2 ASPECT RATIO IS ENABLED, ONLY 4X3 AND 16X9 ASPECT RATIO CAN BE SELECTED. CONTINUE?" + "WHEN PS2 ASPECT RATIO IS ENABLED, ONLY 4X3 AND 16X9 ASPECT RATIO CAN BE SELECTED. CONTINUE?") +(#x1039 "ASPECT RATIO (PS2)" + "ASPECT RATIO (PS2)") +(#x103a "FIT TO SCREEN" + "FIT TO SCREEN") +(#x103b "V-SYNC" + "V-SYNC") + +(#x1050 "MSAA" + "MSAA") +(#x1051 "~DX" + "~DX") +(#x1052 "2X" + "2X") +(#x1053 "4X" + "4X") +(#x1054 "8X" + "8X") +(#x1055 "16X" + "16X") + +(#x1060 "FRAME RATE (EXPERIMENTAL)" + "FRAME RATE (EXPERIMENTAL)") +(#x1061 "60" "60") +(#x1062 "100" "100") +(#x1063 "150" "150") + +(#x1070 "LEVEL OF DETAIL (BACKGROUND)" + "LEVEL OF DETAIL (BACKGROUND)") +(#x1071 "LEVEL OF DETAIL (FOREGROUND)" + "LEVEL OF DETAIL (FOREGROUND)") +(#x1072 "MAXIMUM" + "MAXIMUM") +(#x1073 "HIGH" + "HIGH") +(#x1074 "MEDIUM" + "MEDIUM") +(#x1075 "LOW" + "LOW") +(#x1076 "MINIMUM" + "MINIMUM") +(#x1077 "PS2" + "PS2") + +(#x1078 "SUBTITLES" + "SUBTITLES") +(#x1079 "HINT SUBTITLES" + "HINT SUBTITLES") +(#x107a "SUBTITLE LANGUAGE" + "SUBTITLE LANGUAGE") +(#x107b "SHOW SPEAKER IN SUBTITLE" + "SHOW SPEAKER IN SUBTITLE") +(#x107c "ALWAYS" + "ALWAYS") +(#x107d "NEVER" + "NEVER") +(#x107e "OFF-SCREEN" + "OFF-SCREEN") + +(#x107f "HINT LOG" + "HINT LOG") + +(#x1080 "CHEATS" + "CHEATS") +(#x1081 "SECRETS" + "SECRETS") +(#x1082 "SELECT LEVEL" + "SELECT LEVEL") +(#x1083 "SELECT FLAVOR" + "SELECT FLAVOUR") +(#x1084 "FINAL BOSS" + "FINAL BOSS") +(#x1085 "CREDITS" + "CREDITS") +(#x1086 "LOCKED" + "LOCKED") +(#x1087 "KLAWW" + "KLAWW") +(#x1088 "FISHING MINI-GAME" + "FISHING MINI-GAME") +(#x1089 "CHALLENGE THEME" + "CHALLENGE THEME") + +(#x1090 "INFINITE BLUE ECO" + "INFINITE BLUE ECO") +(#x1091 "INFINITE RED ECO" + "INFINITE RED ECO") +(#x1092 "INFINITE GREEN ECO" + "INFINITE GREEN ECO") +(#x1093 "INFINITE YELLOW ECO" + "INFINITE YELLOW ECO") +(#x1094 "ALTERNATE DAXTER" + "ALTERNATE DAXTER") +(#x1095 "INVINCIBILITY" + "INVINCIBILITY") +(#x1096 "PLAY ALL MUSIC TRACKS" + "PLAY ALL MUSIC TRACKS") + +(#x10c0 "MUSIC PLAYER" + "MUSIC PLAYER") +(#x10c1 "SCENE PLAYER" + "SCENE PLAYER") +(#x10c2 "PLAY CREDITS" + "PLAY CREDITS") +(#x10c3 "SCRAPBOOK" + "SCRAPBOOK") + +(#x10d0 "DEFAULT" + "DEFAULT") +(#x10d1 "UNUSED" + "UNUSED") +(#x10d2 "SAGE" + "SAGE") +(#x10d3 "SAGE'S HUT" + "SAGE'S HUT") +(#x10d4 "BIRDWATCHER" + "BIRDWATCHER") +(#x10d5 "FARMER" + "FARMER") +(#x10d6 "KEIRA" + "KEIRA") +(#x10d7 "MAYOR" + "MAYOR") +(#x10d8 "SCULPTOR" + "SCULPTOR") +(#x10d9 "JAK'S UNCLE" + "JAK'S UNCLE") +(#x10da "DOCK" + "DOCK") +(#x10db "FORBIDDEN TEMPLE EXIT" + "FORBIDDEN TEMPLE EXIT") +(#x10dc "LURKER MACHINE" + "LURKER MACHINE") +(#x10dd "TOP OF THE TOWER" + "TOP OF THE TOWER") +(#x10de "BLUE VENT SWITCH" + "BLUE VENT SWITCH") +(#x10df "UNUSED" + "UNUSED") +(#x10e0 "SENTINELS" + "SENTINELS") +(#x10e1 "LURKER CANNON" + "LURKER CANNON") +(#x10e2 "GROTTO" + "GROTTO") +(#x10e3 "UNUSED 1" + "UNUSED 1") +(#x10e4 "LURKER BOAT" + "LURKER BOAT") +(#x10e5 "UNUSED 2" + "UNUSED 2") +(#x10e6 "ZOOMER" + "ZOOMER") +(#x10e7 "FLUT FLUT" + "FLUT FLUT") +(#x10e8 "UNUSED" + "UNUSED") +(#x10e9 "WARRIOR" + "WARRIOR") +(#x10ea "GEOLOGIST" + "GEOLOGIST") +(#x10eb "GAMBLER" + "GAMBLER") +(#x10ec "LEVITATOR MACHINE" + "LEVITATOR MACHINE") +(#x10ed "UNUSED 1" + "UNUSED 1") +(#x10ee "LAUNCHER TRAPS" + "LAUNCHER TRAPS") +(#x10ef "UNUSED 2" + "UNUSED 2") +(#x10f0 "DEAD MAN'S GORGE" + "DEAD MAN'S GORGE") +(#x10f1 "MIDDLE OF THE PASS" + "MIDDLE OF THE PASS") +(#x10f2 "END OF THE PASS" + "END OF THE PASS") +(#x10f3 "TO SPIDER CAVE" + "TO SPIDER CAVE") +(#x10f4 "TO SNOWY MOUNTAIN" + "TO SNOWY MOUNTAIN") +(#x10f5 "MINERS" + "MINERS") +(#x10f6 "ROBOT CAVE SCAFFOLDING" + "ROBOT CAVE SCAFFOLDING") +(#x10f7 "PRECURSOR ROBOT TOP" + "PRECURSOR ROBOT TOP") +(#x10f8 "MAIN CAVE" + "MAIN CAVE") +(#x10f9 "DARK CAVE" + "DARK CAVE") +(#x10fa "UNUSED" + "UNUSED") +(#x10fb "HIDDEN CAVE" + "HIDDEN CAVE") +(#x10fc "LURKER FORT" + "LURKER FORT") +(#x10fd "SNOWBALLS" + "SNOWBALLS") +(#x10fe "MIDDLE OF THE TUBE" + "MIDDLE OF THE TUBE") +(#x10ff "END OF THE TUBE" + "END OF THE TUBE") +(#x1100 "YELLOW SAGE" + "YELLOW SAGE") +(#x1101 "RED SAGE" + "RED SAGE") +(#x1102 "BLUE SAGE" + "BLUE SAGE") +(#x1103 "CITADEL HUB" + "CITADEL HUB") +(#x1104 "MIDDLE OF THE BOSS" + "MIDDLE OF THE BOSS") +(#x1105 "END OF THE BOSS" + "END OF THE BOSS") +(#x1106 "FLAVOR 1" + "FLAVOUR 1") +(#x1107 "FLAVOR 2" + "FLAVOUR 2") + + +;; ----------------- +;; test + +(#x7fff + "ARMOR" + "ARMOUR" + ) + + diff --git a/game/assets/jak1/text/game_text_ja.gs b/game/assets/jak1/text/game_text_ja.gs new file mode 100644 index 0000000000..6ee71dd962 --- /dev/null +++ b/game/assets/jak1/text/game_text_ja.gs @@ -0,0 +1,73 @@ +(group-name "common") +(language-id 5) + +;; ----------------- +;; progress menu (insanity) + +(#x1078 "じまく") +(#x1079 "ヒントじまく") +(#x107a "じまくのことば") + +(#x107f "ヒントロッグ") +(#x1080 "チート") + +(#x1082 "レベルをセレクトください") +(#x1083 "へんかをセレクトください") +(#x1084 "ラスボス") +(#x1085 "スタッフロール") +(#x1086 "ロック") +(#x1087 "ハイブリッドラーカー クロウ") +(#x1088 "サカナとりゲームのテーマ") +(#x1089 "チャレンジーのテーマ") + +(#x1090 "無限の青のエコ") +(#x1091 "無限の赤のエコ") +(#x1092 "無限の緑のエコ") +(#x1093 "無限の黄のエコ") +(#x1094 "へんかのダックスター") +(#x1095 "インヴィンシブル") +(#x1096 "全てBGMへんかを エネーブルする") + +(#x10c0 "BGMプレイヤー") + +(#x10d0 "デフォールト") +(#x10d1 "みしよう") +(#x10d2 "セイジィ") +(#x10d3 "セイジィの家") + +(#x10d6 "ケイラ") + +(#x10df "みしよう") + +(#x10e3 "みしよう1") + +(#x10e5 "みしよう2") + +(#x10e7 "フラフラ鳥") +(#x10e8 "みしよう") + +(#x10ed "みしよう1") + +(#x10ef "みしよう2") + +(#x10f3 "ヤミノ洞くつへ") +(#x10f4 "ガイセツ山へ") +(#x10f5 "宝石堀りたち") + +(#x10f8 "メイン洞くつ") +(#x10f9 "くろい洞くつ") +(#x10fa "みしよう") +(#x10fb "かくされた洞くつ") +(#x10fc "ラーカーのとりで") +(#x10fd "ゆきだま") +(#x10fe "マグマチューブの中かん") +(#x10ff "マグマチューブのけつまつ") +(#x1100 "黄の賢者") +(#x1101 "赤の賢者") +(#x1102 "青の賢者") +(#x1103 "城のハブ") +(#x1104 "ラスボスの中かん") +(#x1105 "ラスボスのけつまつ") + + + diff --git a/game/assets/jak1/text/text_patch_ja.gs b/game/assets/jak1/text/text_patch_ja.gs new file mode 100644 index 0000000000..3fafe0fb97 --- /dev/null +++ b/game/assets/jak1/text/text_patch_ja.gs @@ -0,0 +1,9 @@ +(group-name "common") +(language-id 5) + +;; ----------------- +;; fixes + + ; 闇の眷者 ゴルとマイアの城 +(#x122 "闇の賢者 ゴルとマイアの城") +(#x801 "闇の賢者 ゴルとマイアの城") diff --git a/game/assets/sdl_controller_db.txt b/game/assets/sdl_controller_db.txt new file mode 100644 index 0000000000..0db4e6b558 --- /dev/null +++ b/game/assets/sdl_controller_db.txt @@ -0,0 +1,1638 @@ +# Game Controller DB for SDL in 2.0.16 format +# Source: https://github.com/gabomdq/SDL_GameControllerDB + +# Windows +03000000fa2d00000100000000000000,3dRudder Foot Motion Controller,leftx:a0,lefty:a1,rightx:a5,righty:a2,platform:Windows, +03000000d0160000040d000000000000,4Play Adapter,a:b1,b:b3,back:b4,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b6,leftstick:b14,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b15,righttrigger:b9,rightx:a3,righty:a4,start:b5,x:b0,y:b2,platform:Windows, +03000000d0160000050d000000000000,4Play Adapter,a:b1,b:b3,back:b4,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b6,leftstick:b14,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b15,righttrigger:b9,rightx:a3,righty:a4,start:b5,x:b0,y:b2,platform:Windows, +03000000d0160000060d000000000000,4Play Adapter,a:b1,b:b3,back:b4,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b6,leftstick:b14,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b15,righttrigger:b9,rightx:a3,righty:a4,start:b5,x:b0,y:b2,platform:Windows, +03000000d0160000070d000000000000,4Play Adapter,a:b1,b:b3,back:b4,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b6,leftstick:b14,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b15,righttrigger:b9,rightx:a3,righty:a4,start:b5,x:b0,y:b2,platform:Windows, +03000000d0160000600a000000000000,4Play Adapter,a:b1,b:b3,back:b4,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b6,leftstick:b14,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b15,righttrigger:b9,rightx:a3,righty:a4,start:b5,x:b0,y:b2,platform:Windows, +03000000c82d00000031000000000000,8BitDo Adapter,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00000531000000000000,8BitDo Adapter 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00000951000000000000,8BitDo Dogbone Modkit,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b11,platform:Windows, +03000000008000000210000000000000,8BitDo F30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +030000003512000011ab000000000000,8BitDo F30 Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000c82d00001028000000000000,8BitDo F30 Arcade Joystick,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d000011ab000000000000,8BitDo F30 Arcade Joystick,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000801000000900000000000000,8BitDo F30 Arcade Stick,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00001038000000000000,8BitDo F30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000090000000000000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000650000000000000,8BitDo M30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00005106000000000000,8BitDo M30,a:b0,b:b1,back:b10,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,guide:b2,leftshoulder:b8,lefttrigger:b9,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00000151000000000000,8BitDo M30 Modkit,a:b0,b:b1,back:b10,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00000310000000000000,8BitDo N30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00002028000000000000,8BitDo N30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00008010000000000000,8BitDo N30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d0000e002000000000000,8BitDo N30,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,start:b6,platform:Windows, +03000000c82d00000451000000000000,8BitDo N30 Modkit,a:b1,b:b0,back:b10,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,start:b11,platform:Windows, +03000000c82d00000190000000000000,8BitDo N30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00001590000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00006528000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000290000000000000,8BitDo N64,+rightx:b9,+righty:b3,-rightx:b4,-righty:b8,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,platform:Windows, +03000000c82d00003038000000000000,8BitDo N64,+rightx:b9,+righty:b3,-rightx:b4,-righty:b8,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,platform:Windows, +03000000c82d000012ab000000000000,8BitDo NES30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000022000000090000000000000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000203800000900000000000000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00002038000000000000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000751000000000000,8BitDo P30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00000360000000000000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000361000000000000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000660000000000000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000131000000000000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000231000000000000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000331000000000000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000431000000000000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00002867000000000000,8BitDo S30 Modkit,a:b0,b:b1,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b8,lefttrigger:b9,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00000130000000000000,8BitDo SF30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000060000000000000,8BitDo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000061000000000000,8BitDo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows, +03000000102800000900000000000000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d000021ab000000000000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00003028000000000000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000030000000000000,8BitDo SN30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00001290000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d000020ab000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00004028000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00006228000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000351000000000000,8BitDo SN30 Modkit,a:b1,b:b0,back:b10,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000021000000000000,8BitDo SN30 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00000160000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000161000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000121000000000000,8BitDo SN30 Pro for Android,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00000260000000000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000261000000000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows, +03000000a00500003232000000000000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00001890000000000000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00003032000000000000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows, +03000000d81d00000e00000000000000,iBuffalo AC02 Arcade Joystick,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b11,righttrigger:b3,rightx:a2,righty:a5,start:b8,x:b4,y:b5,platform:Windows, +030000008f0e00001200000000000000,Acme GA02,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Windows, +03000000c01100000355000000000000,Acrux,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000fa190000f0ff000000000000,Acteck AGJ 3200,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000006d0400000bc2000000000000,Logitech WingMan Action Pad,a:b0,b:b1,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b8,lefttrigger:a5~,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b5,righttrigger:a2~,start:b8,x:b3,y:b4,platform:Windows, +03000000d1180000402c000000000000,ADT1,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a3,rightx:a2,righty:a5,x:b3,y:b4,platform:Windows, +030000006f0e00001301000000000000,Afterglow Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006f0e00001302000000000000,Afterglow Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006f0e00001304000000000000,Afterglow Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006f0e00001413000000000000,Afterglow Xbox Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00003901000000000000,Afterglow Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000ab1200000103000000000000,Afterglow Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000ad1b000000f9000000000000,Afterglow Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000341a00003608000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00000263000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001101000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001401000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001402000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001901000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001a01000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000100000008200000000000000,Akishop Customs PS360,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000007c1800000006000000000000,Alienware Dual Compatible PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000491900001904000000000000,Amazon Luna Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b9,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b7,x:b2,y:b3,platform:Windows, +03000000710100001904000000000000,Amazon Luna Controller,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b5,leftstick:b8,leftx:a0,lefty:a1,misc1:b9,rightshoulder:b4,rightstick:b7,rightx:a3,righty:a4,start:b6,x:b3,y:b2,platform:Windows, +03000000830500000160000000000000,Arcade,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b3,x:b4,y:b4,platform:Windows, +03000000120c0000100e000000000000,Armor 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000490b00004406000000000000,ASCII Seamic Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b9,x:b3,y:b4,platform:Windows, +03000000869800002500000000000000,Astro C40 TR PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000a30c00002700000000000000,Astro City Mini,a:b2,b:b1,back:b8,leftx:a3,lefty:a4,rightshoulder:b4,righttrigger:b5,start:b9,x:b3,y:b0,platform:Windows, +03000000a30c00002800000000000000,Astro City Mini,a:b2,b:b1,back:b8,leftx:a3,lefty:a4,rightshoulder:b4,righttrigger:b5,start:b9,x:b3,y:b0,platform:Windows, +03000000ef0500000300000000000000,InterAct AxisPad,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Windows, +03000000fd0500000230000000000000,InterAct AxisPad,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a5,start:b11,x:b0,y:b1,platform:Windows, +03000000e4150000103f000000000000,Batarang,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000d6200000e557000000000000,Batarang PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000c01100001352000000000000,Battalife Joystick,a:b6,b:b7,back:b2,leftshoulder:b0,leftx:a0,lefty:a1,rightshoulder:b1,start:b3,x:b4,y:b5,platform:Windows, +030000006f0e00003201000000000000,Battlefield 4 PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000ad1b000001f9000000000000,BB 070,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000d62000002a79000000000000,BDA PS4 Fightpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000bc2000005250000000000000,Beitong G3,a:b0,b:b1,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b5,righttrigger:b9,rightx:a3,righty:a4,start:b15,x:b3,y:b4,platform:Windows, +030000000d0500000208000000000000,Belkin Nostromo N40,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Windows, +03000000bc2000006012000000000000,Betop 2126F,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000bc2000000055000000000000,Betop BFM,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000bc2000006312000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000bc2000006321000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000bc2000006412000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000c01100000555000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000c01100000655000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000790000000700000000000000,Betop Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +03000000808300000300000000000000,Betop Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +030000006f0e00006401000000000000,BF One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a2,righty:a5,start:b7,x:b2,y:b3,platform:Windows, +03000000300f00000202000000000000,Bigben,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a5,righty:a2,start:b7,x:b2,y:b3,platform:Windows, +030000006b1400000209000000000000,Bigben,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006b1400000055000000000000,Bigben PS3 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000006b1400000103000000000000,Bigben PS3 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows, +03000000120c0000200e000000000000,Brook Mars PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000210e000000000000,Brook Mars PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d81d00000b00000000000000,Buffalo BSGP1601 Series,a:b5,b:b3,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b13,x:b4,y:b2,platform:Windows, +030000006d04000042c2000000000000,ChillStream,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000e82000006058000000000000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000457500000401000000000000,Cobra,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000b0400003365000000000000,Competition Pro,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Windows, +030000004c050000c505000000000000,CronusMax Adapter,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000d814000007cd000000000000,Cthulhu,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000d8140000cefa000000000000,Cthulhu,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000260900008888000000000000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a4,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Windows, +030000003807000002cb000000000000,Cyborg,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000a306000022f6000000000000,Cyborg V.3 Rumble,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000f806000000a3000000000000,DA Leader,a:b7,b:b6,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b0,leftstick:b8,lefttrigger:b1,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:b3,rightx:a2,righty:a3,start:b12,x:b4,y:b5,platform:Windows, +030000001a1c00000001000000000000,Datel Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000451300000830000000000000,Defender Game Racer X7,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000007d0400000840000000000000,Destroyer Tiltpad,+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b1,b:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,x:b0,y:b3,platform:Windows, +03000000791d00000103000000000000,Dual Box Wii,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000c0160000e105000000000000,Dual Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +030000004f040000070f000000000000,Dual Power,a:b8,b:b9,back:b4,dpdown:b1,dpleft:b2,dpright:b3,dpup:b0,leftshoulder:b13,leftstick:b6,lefttrigger:b14,leftx:a0,lefty:a1,rightshoulder:b12,rightstick:b7,righttrigger:b15,start:b5,x:b10,y:b11,platform:Windows, +030000004f04000012b3000000000000,Dual Power 3,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows, +030000004f04000020b3000000000000,Dual Trigger,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows, +03000000bd12000002e0000000000000,Dual Vibration Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Windows, +03000000ff1100003133000000000000,DualForce,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b1,platform:Windows, +030000008f0e00000910000000000000,DualShock 2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Windows, +03000000317300000100000000000000,DualShock 3,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +030000006f0e00003001000000000000,EA Sports PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000fc0400000250000000000000,Easy Grip,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b9,x:b3,y:b4,platform:Windows, +030000006e0500000a20000000000000,Elecom DUX60 MMO,a:b2,b:b3,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b14,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b15,righttrigger:b13,rightx:a3,righty:a4,start:b20,x:b0,y:b1,platform:Windows, +03000000b80500000410000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows, +03000000b80500000610000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows, +030000006e0500000520000000000000,Elecom P301U PlayStation Controller Adapter,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows, +03000000411200004450000000000000,Elecom U1012,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows, +030000006e0500000320000000000000,Elecom U3613M,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows, +030000006e0500000e20000000000000,Elecom U3912T,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows, +030000006e0500000f20000000000000,Elecom U4013S,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows, +030000006e0500001320000000000000,Elecom U4113,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006e0500001020000000000000,Elecom U4113S,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Windows, +030000006e0500000720000000000000,Elecom W01U,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows, +03000000120c0000f61c000000000000,Elite,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000430b00000300000000000000,EMS Production PS2 Adapter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000242f000000b7000000000000,ESM 9110,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Windows, +03000000101c0000181c000000000000,Essential,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b4,leftx:a1,lefty:a0,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +030000008f0e00000f31000000000000,EXEQ,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows, +03000000341a00000108000000000000,EXEQ RF Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000790000003018000000000000,Mayflash F300 Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +03000000242f00003900000000000000,Mayflash F300 Elite Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00008401000000000000,Faceoff Deluxe Nintendo Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00008001000000000000,Faceoff Pro Nintendo Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000021000000090000000000000,FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +0300000011040000c600000000000000,FC801,a:b0,b:b1,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Windows, +03000000852100000201000000000000,FF GP1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700002847000000000000,Xbox 360 Fightpad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000ad1b000028f0000000000000,Fightpad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000ad1b00002ef0000000000000,Fightpad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000ad1b000038f0000000000000,Fightpad TE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b8,rightshoulder:b5,righttrigger:b9,start:b7,x:b2,y:b3,platform:Windows, +03000000380700001847000000000000,Mad Catz Street Fighter 4 Xbox 360 FightStick,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b8,rightshoulder:b5,righttrigger:b9,start:b7,x:b2,y:b3,platform:Windows, +03000000380700008031000000000000,Mad Catz FightStick Alpha PS3 ,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000f806000001a3000000000000,Firestorm,a:b9,b:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b0,leftstick:b10,lefttrigger:b1,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b11,righttrigger:b3,start:b12,x:b8,y:b4,platform:Windows, +03000000b50700000399000000000000,Firestorm 2,a:b2,b:b4,back:b10,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b8,righttrigger:b9,start:b11,x:b3,y:b5,platform:Windows, +03000000b50700001302000000000000,Firestorm D3,a:b0,b:b2,leftshoulder:b4,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,x:b1,y:b3,platform:Windows, +03000000b40400001024000000000000,Flydigi Apex,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +03000000151900004000000000000000,Flydigi Vader 2,a:b11,b:b10,back:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,leftstick:b1,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b0,righttrigger:b4,rightx:a3,righty:a4,start:b2,x:b9,y:b8,platform:Windows, +03000000b40400001124000000000000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:b8,leftx:a0,lefty:a1,paddle1:b4,paddle2:b5,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b2,y:b3,platform:Windows, +03000000b40400001224000000000000,Flydigi Vader 2 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b15,paddle2:b16,paddle3:b17,paddle4:b18,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows, +030000008305000000a0000000000000,G08XU,a:b0,b:b1,back:b4,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b5,x:b2,y:b3,platform:Windows, +0300000066f700000100000000000000,Game VIB Joystick,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Windows, +03000000260900002625000000000000,GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,lefttrigger:a4,leftx:a0,lefty:a1,righttrigger:a5,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Windows, +03000000341a000005f7000000000000,GameCube Controller,a:b2,b:b3,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b1,y:b0,platform:Windows, +03000000430b00000500000000000000,GameCube Controller,a:b0,b:b2,dpdown:b10,dpleft:b8,dpright:b9,dpup:b11,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a3,rightx:a5,righty:a2,start:b7,x:b1,y:b3,platform:Windows, +03000000790000004718000000000000,GameCube Controller,a:b1,b:b0,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Windows, +03000000790000004618000000000000,GameCube Controller Adapter,a:b1,b:b0,x:b2,y:b3,start:b9,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a5,righty:a2,rightshoulder:b7,lefttrigger:a3,righttrigger:a4,platform:Windows, +030000008f0e00000d31000000000000,Gamepad 3 Turbo,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000280400000140000000000000,GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +03000000ac0500003d03000000000000,GameSir G3,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000ac0500005b05000000000000,GameSir G3w,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000ac0500002d02000000000000,GameSir G4,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +03000000ac0500004d04000000000000,GameSir G4,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +030000004c0e00001035000000000000,Gamester,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Windows, +030000000d0f00001110000000000000,GameStick Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +0300000047530000616d000000000000,GameStop,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000c01100000140000000000000,GameStop PS4 Fun Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000b62500000100000000000000,Gametel GT004 01,a:b3,b:b0,dpdown:b10,dpleft:b9,dpright:b8,dpup:b11,leftshoulder:b4,rightshoulder:b5,start:b7,x:b1,y:b2,platform:Windows, +030000008f0e00001411000000000000,Gamo2 Divaller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000a857000000000000,Gator Claw,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000c9110000f055000000000000,GC100XF,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000008305000009a0000000000000,Genius,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000008305000031b0000000000000,Genius Maxfire Blaze 3,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000451300000010000000000000,Genius Maxfire Grandias 12,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000005c1a00003330000000000000,Genius MaxFire Grandias 12V,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Windows, +03000000300f00000b01000000000000,GGE909 Recoil,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000f0250000c283000000000000,Gioteck PlayStation Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000f025000021c1000000000000,Gioteck PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000f0250000c383000000000000,Gioteck VX2 PlayStation Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000f0250000c483000000000000,Gioteck VX2 PlayStation Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000004f04000026b3000000000000,GP XID,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +0300000079000000d418000000000000,GPD Win,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000c6240000025b000000000000,GPX,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000007d0400000540000000000000,Gravis Eliminator Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000007d0400000340000000000000,Gravis G44011 Xterminator,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,rightx:a2,start:b9,x:b3,y:b4,platform:Windows, +030000008f0e00000610000000000000,GreenAsia,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a5,righty:a2,start:b11,x:b3,y:b0,platform:Windows, +03000000ac0500006b05000000000000,GT2a,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +03000000341a00000302000000000000,Hama Scorpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000fd0500003902000000000000,InterAct Hammerhead,a:b3,b:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b2,lefttrigger:b8,rightshoulder:b7,rightstick:b5,righttrigger:b9,start:b10,x:b0,y:b1,platform:Windows, +03000000fd0500002a26000000000000,InterAct Hammerhead FX,a:b3,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b0,y:b1,platform:Windows, +03000000fd0500002f26000000000000,InterAct Hammerhead FX,a:b4,b:b5,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b1,y:b2,platform:Windows, +030000000d0f00004900000000000000,Hatsune Miku Sho PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000001008000001e1000000000000,Havit HV G60,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b0,platform:Windows, +030000000d0f00000c00000000000000,HEXT,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000d81400000862000000000000,HitBox Edition Cthulhu,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b4,rightshoulder:b7,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows, +03000000632500002605000000000000,HJD X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +030000000d0f00000a00000000000000,Hori DOA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000000d0f00005100000000000000,Hori Fighting Commander PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008600000000000000,Hori Fighting Commander Xbox 360,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000000d0f0000ba00000000000000,Hori Fighting Commander Xbox 360,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000000d0f00008500000000000000,Hori Fighting Commander 2016 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00002500000000000000,Hori Fighting Commander 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00002d00000000000000,Hori Fighting Commander 3 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005f00000000000000,Hori Fighting Commander 4 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005e00000000000000,Hori Fighting Commander 4 PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008400000000000000,Hori Fighting Commander 5,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00001000000000000000,Hori Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000f0d00000010000000000000,Hori Fightstick 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00003200000000000000,Hori Fightstick 3W,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f0000c000000000000000,Hori Fightstick 4,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000000d0f00000d00000000000000,Hori Fightstick EX2,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Windows, +030000000d0f00003701000000000000,Hori Fightstick Mini,a:b1,b:b0,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b3,y:b2,platform:Windows, +030000000d0f00004000000000000000,Hori Fightstick Mini 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b4,rightshoulder:b7,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008700000000000000,Hori Fightstick Mini 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008800000000000000,Hori Fightstick Mini 4,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b8,x:b0,y:b3,platform:Windows, +030000000d0f00002100000000000000,Hori Fightstick V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00002700000000000000,Hori Fightstick V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f0000a000000000000000,Hori Grip TAC4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b13,x:b0,y:b3,platform:Windows, +030000000d0f00000101000000000000,Hori Mini Hatsune Miku FT,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005400000000000000,Hori Pad 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00000900000000000000,Hori Pad 3 Turbo,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00004d00000000000000,Hori Pad A,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00003801000000000000,Hori PC Engine Mini Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,platform:Windows, +030000000d0f00009200000000000000,Hori Pokken Tournament DX Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00002301000000000000,Hori PS4 Controller Light,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +030000000d0f00001100000000000000,Hori Real Arcade Pro 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00002600000000000000,Hori Real Arcade Pro 3P,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00004b00000000000000,Hori Real Arcade Pro 3W,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006a00000000000000,Hori Real Arcade Pro 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006b00000000000000,Hori Real Arcade Pro 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008a00000000000000,Hori Real Arcade Pro 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008b00000000000000,Hori Real Arcade Pro 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006f00000000000000,Hori Real Arcade Pro 4 VLX,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00007000000000000000,Hori Real Arcade Pro 4 VLX,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00003d00000000000000,Hori Real Arcade Pro N3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b10,leftstick:b4,lefttrigger:b11,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b6,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f0000ae00000000000000,Hori Real Arcade Pro N4,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000000d0f00008c00000000000000,Hori Real Arcade Pro P4,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000000d0f0000aa00000000000000,Hori Real Arcade Pro S,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f0000d800000000000000,Hori Real Arcade Pro S,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Windows, +030000000d0f00002200000000000000,Hori Real Arcade Pro V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005b00000000000000,Hori Real Arcade Pro V4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005c00000000000000,Hori Real Arcade Pro V4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f0000af00000000000000,Hori Real Arcade Pro VHS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00001b00000000000000,Hori Real Arcade Pro VX,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000ad1b000002f5000000000000,Hori Real Arcade Pro VX,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b07,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b08,righttrigger:b11,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Windows, +030000000d0f00009c00000000000000,Hori TAC Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f0000c900000000000000,Hori Taiko Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f0000c100000000000000,Horipad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006400000000000000,Horipad 3TP,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00001300000000000000,Horipad 3W,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005500000000000000,Horipad 4 FPS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006e00000000000000,Horipad 4 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006600000000000000,Horipad 4 PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00004200000000000000,Horipad A,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000ad1b000001f5000000000000,Horipad EXT2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005b1c00002400000000000000,Capcom Home Arcade Controller,a:b3,b:b4,back:b7,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b6,x:b0,y:b1,platform:Windows, +030000000d0f0000ee00000000000000,Horipad Mini 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006700000000000000,Horipad One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000000d0f0000dc00000000000000,Horipad Switch,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000008f0e00001330000000000000,HuiJia SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b9,x:b3,y:b0,platform:Windows, +03000000790000004e95000000000000,Hyperkin N64 Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a5,righty:a2,start:b9,platform:Windows, +03000000d81d00000f00000000000000,iBuffalo BSGP1204 Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000d81d00001000000000000000,iBuffalo BSGP1204P Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000005c0a00000285000000000000,iDroidCon,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b6,platform:Windows, +03000000696400006964000000000000,iDroidCon Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000b50700001403000000000000,Impact Black,a:b2,b:b3,back:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +030000006f0e00002401000000000000,Injustice Fightstick PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +03000000830500005130000000000000,InterAct ActionPad,a:b0,b:b1,back:b8,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b9,x:b3,y:b4,platform:Windows, +03000000fd0500005302000000000000,InterAct ProPad,a:b3,b:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,x:b0,y:b1,platform:Windows, +03000000ac0500002c02000000000000,Ipega Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000491900000204000000000000,Ipega PG9023,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000491900000304000000000000,Ipega PG9087,+righty:+a5,-righty:-a4,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,start:b11,x:b3,y:b4,platform:Windows, +030000007e0500000620000000000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Windows, +030000007e0500000720000000000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows, +03000000bd12000003c0000000000000,Joypad Alpha Shock,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000250900000017000000000000,Joypad to Adapter,a:b2,b:b1,back:b9,leftshoulder:b5,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b6,start:b8,x:b3,y:b0,platform:Windows, +03000000ff1100004033000000000000,JPD FFB,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a2,start:b15,x:b3,y:b0,platform:Windows, +03000000242f00002d00000000000000,JYS Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000242f00008a00000000000000,JYS Adapter,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows, +03000000c4100000c082000000000000,KADE,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000828200000180000000000000,Keio,a:b4,b:b5,back:b8,leftshoulder:b2,lefttrigger:b3,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b9,x:b0,y:b1,platform:Windows, +03000000790000000200000000000000,King PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +03000000bd12000001e0000000000000,Leadership,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +030000006f0e00000103000000000000,Logic3,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006f0e00000104000000000000,Logic3,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000008f0e00001300000000000000,Logic3,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000006d040000d1ca000000000000,Logitech ChillStream,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d040000d2ca000000000000,Logitech Cordless Precision,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d04000011c2000000000000,Logitech Cordless Wingman,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b5,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b2,righttrigger:b7,rightx:a3,righty:a4,x:b4,platform:Windows, +030000006d04000016c2000000000000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d0400001dc2000000000000,Logitech F310,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006d04000018c2000000000000,Logitech F510,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d0400001ec2000000000000,Logitech F510,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006d04000019c2000000000000,Logitech F710,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d0400001fc2000000000000,Logitech F710,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006d0400001ac2000000000000,Logitech Precision,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000006d04000009c2000000000000,Logitech WingMan,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b8,x:b3,y:b4,platform:Windows, +030000006d0400000ac2000000000000,Logitech WingMan RumblePad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,rightx:a3,righty:a4,x:b3,y:b4,platform:Windows, +03000000380700005645000000000000,Lynx,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000222200006000000000000000,Macally,a:b1,b:b2,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b33,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700003888000000000000,Mad Catz Arcade Fightstick TE S Plus PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008532000000000000,Mad Catz Arcade Fightstick TE S PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700006352000000000000,Mad Catz CTRLR,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000380700006652000000000000,Mad Catz CTRLR,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000380700005032000000000000,Mad Catz Fightpad Pro PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700005082000000000000,Mad Catz Fightpad Pro PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000003807000038b7000000000000,Mad Catz Fightstick TE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b8,rightshoulder:b5,righttrigger:b9,start:b7,x:b2,y:b3,platform:Windows, +03000000380700008433000000000000,Mad Catz Fightstick TE S PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008483000000000000,Mad Catz Fightstick TE S PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008134000000000000,Mad Catz Fightstick TE2 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b7,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b4,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008184000000000000,Mad Catz Fightstick TE2 PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,leftstick:b10,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +78696e70757403000000000000000000,Mad Catz Fightstick TES,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,start:b7,x:b2,y:b3,platform:Windows, +03000000380700006252000000000000,Mad Catz Micro CTRLR,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008232000000000000,Mad Catz PlayStation Brawlpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008731000000000000,Mad Catz PlayStation Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000003807000056a8000000000000,Mad Catz PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700001888000000000000,Mad Catz SFIV Fightstick PS3,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b4,righttrigger:b6,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000380700008081000000000000,Mad Catz SFV Arcade Fightstick Alpha PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008034000000000000,Mad Catz TE2 PS3 Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008084000000000000,Mad Catz TE2 PS4 Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000002a0600001024000000000000,Matricom,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:Windows, +030000009f000000adbb000000000000,MaxJoypad Virtual Controller,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +03000000250900000128000000000000,Mayflash Arcade Stick,a:b1,b:b2,back:b8,leftshoulder:b0,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b3,righttrigger:b7,start:b9,x:b5,y:b6,platform:Windows, +03000000790000004418000000000000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000790000004318000000000000,Mayflash GameCube Controller Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000242f00007300000000000000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows, +0300000079000000d218000000000000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000d620000010a7000000000000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000008f0e00001030000000000000,Mayflash Sega Saturn Adapter,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b5,rightshoulder:b2,righttrigger:b7,start:b9,x:b3,y:b4,platform:Windows, +0300000025090000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:b13,dpleft:b12,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows, +03000000790000000018000000000000,Mayflash WiiU Pro Adapter,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000790000002418000000000000,Mega Drive Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,rightshoulder:b2,start:b9,x:b3,y:b4,platform:Windows, +0300000079000000ae18000000000000,Mega Drive Controller,a:b0,b:b1,back:b7,dpdown:b14,dpleft:b15,dpright:b13,dpup:b2,rightshoulder:b6,righttrigger:b2,start:b9,x:b3,y:b4,platform:Windows, +03000000c0160000990a000000000000,Mega Drive Controller,a:b0,b:b1,leftx:a0,lefty:a1,righttrigger:b2,start:b3,platform:Windows, +030000005e0400002800000000000000,Microsoft Dual Strike,a:b3,b:b2,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,rightshoulder:b7,rightx:a0,righty:a1~,start:b5,x:b1,y:b0,platform:Windows, +030000005e0400000300000000000000,Microsoft SideWinder,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b8,x:b3,y:b4,platform:Windows, +030000005e0400000700000000000000,Microsoft SideWinder,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b9,x:b3,y:b4,platform:Windows, +030000005e0400000e00000000000000,Microsoft SideWinder Freestyle Pro,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,start:b8,x:b3,y:b4,platform:Windows, +030000005e0400002700000000000000,Microsoft SideWinder Plug and Play,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,lefttrigger:b4,righttrigger:b5,x:b2,y:b3,platform:Windows, +03000000280d00000202000000000000,Miller Lite Cantroller,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,start:b5,x:b2,y:b3,platform:Windows, +030000005b1c00002500000000000000,Capcom Home Arcade Controller,a:b3,b:b4,back:b7,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b6,x:b0,y:b1,platform:Windows, +03000000ad1b000023f0000000000000,MLG,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a6,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Windows, +03000000ad1b00003ef0000000000000,MLG Fightstick TE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b8,rightshoulder:b5,righttrigger:b9,start:b7,x:b2,y:b3,platform:Windows, +03000000380700006382000000000000,MLG PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000ffff00000000000000000000,Mocute M053,a:b3,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b11,leftstick:b7,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b6,righttrigger:b4,rightx:a3,righty:a4,start:b8,x:b1,y:b0,platform:Windows, +03000000d6200000e589000000000000,Moga 2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a2,righty:a5,start:b7,x:b2,y:b3,platform:Windows, +03000000d62000007162000000000000,Moga Pro,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a2,righty:a5,start:b7,x:b2,y:b3,platform:Windows, +03000000d6200000ad0d000000000000,Moga Pro,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000c62400002a89000000000000,Moga XP5A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000c62400002b89000000000000,Moga XP5A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000c62400001a89000000000000,Moga XP5X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000c62400001b89000000000000,Moga XP5X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000efbe0000edfe000000000000,Monect Virtual Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +03000000250900006688000000000000,MP-8866 Super Dual Box,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +03000000f70600000100000000000000,N64 Adaptoid,+rightx:b2,+righty:b1,-rightx:b4,-righty:b5,a:b0,b:b3,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b6,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b7,start:b8,platform:Windows, +030000006b140000010c000000000000,Nacon GC 400ES,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000006b1400001106000000000000,Nacon Revolution 3 PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000006b140000100d000000000000,Nacon Revolution Infinity PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006b140000080d000000000000,Nacon Revolution Unlimited Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000bd12000001c0000000000000,Nebular,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a5,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000eb0300000000000000000000,NeGcon Adapter,a:a2,b:b13,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,lefttrigger:a4,leftx:a1,righttrigger:b11,start:b3,x:a3,y:b12,platform:Windows, +0300000038070000efbe000000000000,NEO SE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +0300000092120000474e000000000000,NeoGeo X Arcade Stick,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,x:b3,y:b2,platform:Windows, +03000000921200004b46000000000000,NES 2 port Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b11,platform:Windows, +03000000000f00000100000000000000,NES Controller,a:b1,b:b0,back:b2,leftx:a0,lefty:a1,start:b3,platform:Windows, +03000000571d00002100000000000000,NES Controller,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Windows, +03000000921200004346000000000000,NES Controller,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Windows, +03000000790000004518000000000000,NEXILUX GameCube Controller Adapter,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Windows, +030000001008000001e5000000000000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Windows, +03000000050b00000045000000000000,Nexus,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Windows, +03000000152000000182000000000000,NGDS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000000d0500000308000000000000,Nostromo N45,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Windows, +030000007e0500001920000000000000,NSO N64 Controller,+rightx:b8,+righty:b2,-rightx:b3,-righty:b7,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,righttrigger:b10,start:b9,platform:Windows, +030000007e0500001720000000000000,NSO SNES Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b15,start:b9,x:b2,y:b3,platform:Windows, +03000000550900001472000000000000,NVIDIA Controller,a:b11,b:b10,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b7,leftstick:b5,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b4,righttrigger:a5,rightx:a3,righty:a6,start:b3,x:b9,y:b8,platform:Windows, +03000000550900001072000000000000,NVIDIA Shield,a:b9,b:b8,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b3,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b2,righttrigger:a4,rightx:a2,righty:a5,start:b0,x:b7,y:b6,platform:Windows, +030000005509000000b4000000000000,NVIDIA Virtual,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000120c00000288000000000000,Nyko Air Flo Xbox Controller,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Windows, +030000004b120000014d000000000000,Nyko Airflo,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:a3,leftstick:a0,lefttrigger:b6,rightshoulder:b5,rightstick:a2,righttrigger:b7,start:b9,x:b2,y:b3,platform:Windows, +03000000d62000001d57000000000000,Nyko Airflo PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000791d00000900000000000000,Nyko Playpad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +03000000782300000a10000000000000,Onlive Controller,a:b15,b:b14,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b11,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b13,y:b12,platform:Windows, +030000000d0f00000401000000000000,Onyx,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000008916000001fd000000000000,Onza CE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a3,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000008916000000fd000000000000,Onza TE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000d62000006d57000000000000,OPP PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006b14000001a1000000000000,Orange Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Windows, +03000000362800000100000000000000,OUYA Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:b13,rightx:a3,righty:a4,x:b1,y:b2,platform:Windows, +03000000120c0000f60e000000000000,P4 Gamepad,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b5,lefttrigger:b7,rightshoulder:b4,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows, +03000000790000002201000000000000,PC Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000006f0e00008501000000000000,PDP Fightpad Pro,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b0,platform:Windows, +030000006f0e00000901000000000000,PDP Versus Fighting,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +03000000e30500009605000000000000,PlayStation Adapter,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +030000004c050000da0c000000000000,PlayStation Classic Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Windows, +03000000632500002306000000000000,PlayStation Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows, +03000000f0250000c183000000000000,PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d9040000160f000000000000,PlayStation Controller Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +030000004c0500003713000000000000,PlayStation Vita,a:b1,b:b2,back:b8,dpdown:b13,dpleft:b15,dpright:b14,dpup:b12,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000d62000006dca000000000000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d620000013a7000000000000,PowerA Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d04000084ca000000000000,Precision,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Windows, +03000000d62000009557000000000000,Pro Elite PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000c62400001a53000000000000,Pro Ex Mini,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000d62000009f31000000000000,Pro Ex mini PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d6200000c757000000000000,Pro Ex mini PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000110e000000000000,Pro5,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000100800000100000000000000,PS1 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +030000008f0e00007530000000000000,PS1 Controller,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b1,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000100800000300000000000000,PS2 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000250900000088000000000000,PS2 Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +03000000250900006888000000000000,PS2 Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b6,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +03000000250900008888000000000000,PS2 Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +03000000666600006706000000000000,PS2 Controller,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Windows, +030000006b1400000303000000000000,PS2 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000009d0d00001330000000000000,PS2 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000120a00000100000000000000,PS3 Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +03000000120c00001307000000000000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c00001cf1000000000000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000f90e000000000000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000250900000118000000000000,PS3 Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +03000000250900000218000000000000,PS3 Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +03000000250900000500000000000000,PS3 Controller,a:b2,b:b1,back:b9,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b0,y:b3,platform:Windows, +030000004c0500006802000000000000,PS3 Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b10,lefttrigger:a3~,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:a4~,rightx:a2,righty:a5,start:b8,x:b3,y:b0,platform:Windows, +030000004f1f00000800000000000000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +03000000632500007505000000000000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000888800000803000000000000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b9,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows, +03000000888800000804000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,leftshoulder:b10,leftstick:b1,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Windows, +030000008f0e00000300000000000000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b3,y:b0,platform:Windows, +030000008f0e00001431000000000000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000ba2200002010000000000000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a5,righty:a2,start:b9,x:b3,y:b2,platform:Windows, +03000000120c00000807000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000111e000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000121e000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000130e000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000150e000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000180e000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000181e000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000191e000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c00001e0e000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000a957000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000aa57000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000f10e000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000f21c000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000f31c000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000f41c000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000f51c000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120c0000f70e000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000120e0000120c000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000160e0000120c000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000001a1e0000120c000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000004c050000a00b000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000004c050000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Windows, +030000004c050000cc09000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000004c050000e60c000000000000,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Windows, +03000000830500005020000000000000,PSX,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b2,y:b3,platform:Windows, +03000000300f00000111000000000000,Qanba 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00000211000000000000,Qanba 2P,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000300f00000011000000000000,Qanba Arcade Stick 1008,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b10,x:b0,y:b3,platform:Windows, +03000000300f00001611000000000000,Qanba Arcade Stick 4018,a:b1,b:b2,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b8,x:b0,y:b3,platform:Windows, +03000000222c00000020000000000000,Qanba Drone Arcade Stick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,rightshoulder:b5,righttrigger:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00001211000000000000,Qanba Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00001210000000000000,Qanba Joystick Plus,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows, +03000000341a00000104000000000000,Qanba Joystick Q4RAF,a:b5,b:b6,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b0,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b3,righttrigger:b7,start:b9,x:b1,y:b2,platform:Windows, +03000000222c00000223000000000000,Qanba Obsidian Arcade Stick PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000222c00000023000000000000,Qanba Obsidian Arcade Stick PS4,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000008a2400006682000000000000,R1 Mobile Controller,a:b3,b:b1,back:b7,leftx:a0,lefty:a1,start:b6,x:b4,y:b0,platform:Windows, +03000000086700006626000000000000,RadioShack,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b3,y:b0,platform:Windows, +030000009b2800002300000000000000,Raphnet 3DO Adapter,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b2,start:b3,platform:Windows, +030000009b2800006900000000000000,Raphnet 3DO Adapter,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b2,start:b3,platform:Windows, +030000009b2800000800000000000000,Raphnet Dreamcast Adapter,a:b2,b:b1,dpdown:b5,dpleft:b6,dpright:b7,dpup:b4,lefttrigger:a2,leftx:a0,righttrigger:a3,righty:a1,start:b3,x:b10,y:b9,platform:Windows, +030000009b2800003200000000000000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:+a5,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:+a2,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Windows, +030000009b2800006000000000000000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:+a5,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:+a2,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Windows, +030000009b2800001800000000000000,Raphnet Jaguar Adapter,a:b2,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b0,righttrigger:b10,start:b3,x:b11,y:b12,platform:Windows, +030000009b2800000200000000000000,Raphnet NES Adapter,a:b7,b:b6,back:b5,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,start:b4,platform:Windows, +030000009b2800004300000000000000,Raphnet Saturn,a:b0,b:b1,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b8,x:b3,y:b4,platform:Windows, +030000009b2800000500000000000000,Raphnet Saturn Adapter 2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows, +030000009b2800000300000000000000,Raphnet SNES Adapter,a:b0,b:b4,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b1,y:b5,platform:Windows, +030000009b2800005600000000000000,Raphnet SNES Adapter,a:b1,b:b4,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Windows, +030000009b2800005700000000000000,Raphnet SNES Adapter,a:b1,b:b4,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Windows, +030000009b2800001e00000000000000,Raphnet Vectrex Adapter,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a1,lefty:a2,x:b2,y:b3,platform:Windows, +030000009b2800002b00000000000000,Raphnet Wii Classic Adapter,a:b1,b:b4,back:b2,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a3,righty:a4,start:b3,x:b0,y:b5,platform:Windows, +030000009b2800002c00000000000000,Raphnet Wii Classic Adapter,a:b1,b:b4,back:b2,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a3,righty:a4,start:b3,x:b0,y:b5,platform:Windows, +03000000321500000003000000000000,Razer Hydra,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000321500000204000000000000,Razer Panthera PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000321500000104000000000000,Razer Panthera PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000321500000010000000000000,Razer Raiju,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000321500000507000000000000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000321500000707000000000000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000321500000710000000000000,Razer Raiju TE,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000321500000a10000000000000,Razer Raiju TE,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000321500000410000000000000,Razer Raiju UE,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000321500000910000000000000,Razer Raiju UE,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000321500000011000000000000,Razer Raion PS4 Fightpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000321500000009000000000000,Razer Serval,+lefty:+a2,-lefty:-a1,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,leftx:a0,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000790000001100000000000000,Retro Controller,a:b1,b:b2,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b6,lefttrigger:b7,rightshoulder:b4,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows, +03000000830500006020000000000000,Retro Controller,a:b0,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b8,righttrigger:b9,start:b7,x:b2,y:b3,platform:Windows, +03000000bd12000013d0000000000000,Retrolink Sega Saturn Classic Controller,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b5,lefttrigger:b6,rightshoulder:b2,righttrigger:b7,start:b8,x:b3,y:b4,platform:Windows, +03000000bd12000015d0000000000000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Windows, +0300000000f000000300000000000000,RetroUSB RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Windows, +0300000000f00000f100000000000000,RetroUSB Super RetroPort,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Windows, +03000000830500000960000000000000,Revenger,a:b0,b:b1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b3,x:b4,y:b5,platform:Windows, +030000006b140000010d000000000000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000006b140000020d000000000000,Revolution Pro Controller 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000006b140000130d000000000000,Revolution Pro Controller 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001f01000000000000,Rock Candy,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006f0e00004601000000000000,Rock Candy,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000c6240000fefa000000000000,Rock Candy Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006f0e00001e01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00002801000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00002f01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00008701000000000000,Rock Candy Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000050b0000e318000000000000,ROG Chakram,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,platform:Windows, +03000000050b0000e518000000000000,ROG Chakram,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,platform:Windows, +03000000050b00005819000000000000,ROG Chakram Core,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,platform:Windows, +03000000050b0000181a000000000000,ROG Chakram X,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,platform:Windows, +03000000050b00001a1a000000000000,ROG Chakram X,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,platform:Windows, +03000000050b00001c1a000000000000,ROG Chakram X,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,platform:Windows, +030000004f04000001d0000000000000,Rumble Force,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows, +030000008916000000fe000000000000,Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000c6240000045d000000000000,Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000a30600001af5000000000000,Saitek Cyborg,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000a306000023f6000000000000,Saitek Cyborg V.1 Game,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00001201000000000000,Saitek Dual Analog,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +03000000a30600000701000000000000,Saitek P220,a:b2,b:b3,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b4,righttrigger:b5,x:b0,y:b1,platform:Windows, +03000000a30600000cff000000000000,Saitek P2500 Force Rumble,a:b2,b:b3,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b0,y:b1,platform:Windows, +03000000a30600000d5f000000000000,Saitek P2600,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b8,x:b0,y:b3,platform:Windows, +03000000a30600000dff000000000000,Saitek P2600,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a5,righty:a2,start:b8,x:b0,y:b3,platform:Windows, +03000000a30600000c04000000000000,Saitek P2900,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000a306000018f5000000000000,Saitek P3200,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00001001000000000000,Saitek P480 Rumble,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +03000000a30600000901000000000000,Saitek P880,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b8,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b9,righttrigger:b5,rightx:a3,righty:a2,x:b0,y:b1,platform:Windows, +03000000a30600000b04000000000000,Saitek P990,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000a30600002106000000000000,Saitek PS1000 PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000a306000020f6000000000000,Saitek PS2700 PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00001101000000000000,Saitek Rumble,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +03000000e804000000a0000000000000,Samsung EIGP20,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000c01100000252000000000000,Sanwa Easy Grip,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b9,x:b3,y:b4,platform:Windows, +03000000c01100004350000000000000,Sanwa Micro Grip P3,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,x:b3,y:b2,platform:Windows, +03000000411200004550000000000000,Sanwa Micro Grip Pro,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a1,righty:a2,start:b9,x:b1,y:b3,platform:Windows, +03000000c01100004150000000000000,Sanwa Micro Grip Pro,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows, +03000000c01100004450000000000000,Sanwa Online Grip,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b8,rightstick:b11,righttrigger:b9,rightx:a3,righty:a2,start:b14,x:b3,y:b4,platform:Windows, +03000000730700000401000000000000,Sanwa PlayOnline Mobile,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Windows, +03000000830500006120000000000000,Sanwa Smart Grip II,a:b0,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,x:b1,y:b3,platform:Windows, +03000000c01100000051000000000000,Satechi Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +030000004f04000028b3000000000000,Score A,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000952e00002577000000000000,Scuf PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000a30c00002500000000000000,Sega Genesis Mini 3B Controller,a:b2,b:b1,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,righttrigger:b5,start:b9,platform:Windows, +03000000a30c00002400000000000000,Sega Mega Drive Mini 6B Controller,a:b2,b:b1,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,rightshoulder:b4,righttrigger:b5,start:b9,x:b3,y:b0,platform:Windows, +0300000000050000289b000000000000,Sega Saturn Adapter,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows, +0300000000f000000800000000000000,Sega Saturn Controller,a:b1,b:b2,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b3,start:b0,x:b5,y:b6,platform:Windows, +03000000730700000601000000000000,Sega Saturn Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b9,x:b3,y:b4,platform:Windows, +03000000b40400000a01000000000000,Sega Saturn Controller,a:b0,b:b1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b8,x:b3,y:b4,platform:Windows, +030000003b07000004a1000000000000,SFX,a:b0,b:b2,back:b7,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:b5,start:b8,x:b1,y:b3,platform:Windows, +03000000120c00001c1e000000000000,SnakeByte 4S PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +0300000003040000c197000000000000,SNES Controller,a:b0,b:b4,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b1,y:b5,platform:Windows, +03000000571d00002000000000000000,SNES Controller,a:b0,b:b1,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Windows, +0300000081170000960a000000000000,SNES Controller,a:b4,b:b0,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b5,y:b1,platform:Windows, +03000000811700009d0a000000000000,SNES Controller,a:b0,b:b4,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b1,y:b5,platform:Windows, +030000008b2800000300000000000000,SNES Controller,a:b0,b:b4,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b1,y:b5,platform:Windows, +03000000921200004653000000000000,SNES Controller,a:b0,b:b4,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b1,y:b5,platform:Windows, +03000000ff000000cb01000000000000,Sony PlayStation Portable,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Windows, +03000000341a00000208000000000000,Speedlink 6555,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:-a4,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a3,righty:a2,start:b7,x:b2,y:b3,platform:Windows, +03000000341a00000908000000000000,Speedlink 6566,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000380700001722000000000000,Speedlink Competition Pro,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,x:b2,y:b3,platform:Windows, +030000008f0e00000800000000000000,Speedlink Strike FX,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000c01100000591000000000000,Speedlink Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000d11800000094000000000000,Stadia Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:b11,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:Windows, +03000000de280000fc11000000000000,Steam Virtual Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000de280000ff11000000000000,Steam Virtual Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000120c0000160e000000000000,Steel Play Metaltech PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000110100001914000000000000,SteelSeries,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000381000001214000000000000,SteelSeries Free,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows, +03000000110100003114000000000000,SteelSeries Stratus Duo,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000381000001814000000000000,SteelSeries Stratus XL,a:b0,b:b1,back:b18,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b19,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b2,y:b3,platform:Windows, +03000000790000001c18000000000000,STK 7024X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000381000003014000000000000,Stratus Duo,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000381000003114000000000000,Stratus Duo,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000380700003847000000000000,Street Fighter Fightstick TE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b11,start:b7,x:b2,y:b3,platform:Windows, +030000001f08000001e4000000000000,Super Famicom Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Windows, +03000000790000000418000000000000,Super Famicom Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b33,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Windows, +03000000d620000011a7000000000000,Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f0000f600000000000000,Switch Hori,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000457500002211000000000000,Szmy Power PC Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000004f0400000ab1000000000000,T16000M,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b10,x:b2,y:b3,platform:Windows, +030000000d0f00007b00000000000000,TAC GEAR,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000d814000001a0000000000000,TE Kitty,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000fa1900000706000000000000,Team 5,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000b50700001203000000000000,Techmobility X6-38V,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +03000000ba2200000701000000000000,Technology Innovation PS2 Adapter,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b2,platform:Windows, +03000000c61100001000000000000000,Tencent Xianyou Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,x:b3,y:b4,platform:Windows, +03000000790000002601000000000000,TGZ,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b3,y:b0,platform:Windows, +030000004f04000015b3000000000000,Thrustmaster Dual Analog 4,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows, +030000004f04000023b3000000000000,Thrustmaster Dual Trigger PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000004f0400000ed0000000000000,ThrustMaster eSwap Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000004f04000008d0000000000000,ThrustMaster Ferrari 150 PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000004f04000000b3000000000000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Windows, +030000004f04000004b3000000000000,Thrustmaster Firestorm Dual Power 3,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows, +030000004f04000003d0000000000000,ThrustMaster Run N Drive PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b7,leftshoulder:a3,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:a4,rightstick:b11,righttrigger:b5,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000004f04000009d0000000000000,ThrustMaster Run N Drive PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d04000088ca000000000000,Thunderpad,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Windows, +03000000666600000488000000000000,TigerGame PlayStation Adapter,a:b2,b:b1,back:b9,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +030000004f04000007d0000000000000,TMini,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d62000006000000000000000,Tournament PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000c01100000055000000000000,Tronsmart,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000005f140000c501000000000000,Trust Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000b80500000210000000000000,Trust Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000004f04000087b6000000000000,TWCS Throttle,dpdown:b8,dpleft:b9,dpright:b7,dpup:b6,leftstick:b5,lefttrigger:-a5,leftx:a0,lefty:a1,righttrigger:+a5,platform:Windows, +03000000411200000450000000000000,Twin Shock,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a4,start:b11,x:b3,y:b0,platform:Windows, +03000000d90400000200000000000000,TwinShock PS2 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000101c0000171c000000000000,uRage Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000000b0400003065000000000000,USB Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b3,y:b0,platform:Windows, +03000000242f00006e00000000000000,USB Controller,a:b1,b:b4,back:b10,leftshoulder:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:b7,rightx:a2,righty:a5,start:b11,x:b0,y:b3,platform:Windows, +03000000300f00000701000000000000,USB Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000341a00002308000000000000,USB Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000666600000188000000000000,USB Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +03000000666600000288000000000000,USB Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +030000006b1400000203000000000000,USB Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000790000000a00000000000000,USB Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +03000000b404000081c6000000000000,USB Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b3,y:b0,platform:Windows, +03000000b50700001503000000000000,USB Controller,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a5,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +03000000bd12000012d0000000000000,USB Controller,a:b0,b:b1,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Windows, +03000000ff1100004133000000000000,USB Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000632500002305000000000000,USB Vibration Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000790000001a18000000000000,Venom,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000790000001b18000000000000,Venom Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00000302000000000000,Victrix PS4 Pro Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00000702000000000000,Victrix PS4 Pro Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +0300000034120000adbe000000000000,vJoy Device,a:b0,b:b1,back:b15,dpdown:b6,dpleft:b7,dpright:b8,dpup:b5,guide:b16,leftshoulder:b9,leftstick:b13,lefttrigger:b11,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b14,righttrigger:b12,rightx:a3,righty:a4,start:b4,x:b2,y:b3,platform:Windows, +03000000120c0000ab57000000000000,Warrior Joypad JS083,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000007e0500003003000000000000,WiiU Pro,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,leftshoulder:b6,leftstick:b11,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b12,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows, +0300000032150000030a000000000000,Wildcat,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +0300000032150000140a000000000000,Wolverine,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000002e160000efbe000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b10,rightshoulder:b5,righttrigger:b11,start:b7,x:b2,y:b3,platform:Windows, +03000000380700001647000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000380700002045000000000000,Xbox 360 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000380700002644000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a2,righty:a5,start:b8,x:b2,y:b3,platform:Windows, +03000000380700002647000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000003807000026b7000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000380700003647000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a7,righty:a5,start:b7,x:b2,y:b3,platform:Windows, +030000005e0400001907000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e0400008e02000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e0400009102000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000ad1b000000fd000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000ad1b000001fd000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000ad1b000016f0000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000ad1b00008e02000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000c62400000053000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000c6240000fdfa000000000000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000a102000000000000,Xbox 360 Wireless Receiver,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e0400000a0b000000000000,Xbox Adaptive Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000120c00000a88000000000000,Xbox Controller,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a2,righty:a4,start:b6,x:b2,y:b3,platform:Windows, +03000000120c00001088000000000000,Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2~,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5~,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000002a0600002000000000000000,Xbox Controller,a:b0,b:b1,back:b13,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,leftshoulder:b5,leftstick:b14,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b15,righttrigger:b7,rightx:a2,righty:a5,start:b12,x:b2,y:b3,platform:Windows, +03000000300f00008888000000000000,Xbox Controller,a:b0,b:b1,back:b7,dpdown:b13,dpleft:b10,dpright:b11,dpup:b12,leftshoulder:b5,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Windows, +03000000380700001645000000000000,Xbox Controller,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Windows, +03000000380700002645000000000000,Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000380700003645000000000000,Xbox Controller,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Windows, +03000000380700008645000000000000,Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e0400000202000000000000,Xbox Controller,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Windows, +030000005e0400008502000000000000,Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e0400008702000000000000,Xbox Controller,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b9,righttrigger:b7,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Windows, +030000005e0400008902000000000000,Xbox Controller,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b10,leftstick:b8,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b9,righttrigger:b4,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Windows, +030000000d0f00006300000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e0400000c0b000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000d102000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000dd02000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000e002000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000e302000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000ea02000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000fd02000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000ff02000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006f0e0000a802000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006f0e0000c802000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000c62400003a54000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000130b000000000000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000341a00000608000000000000,Xeox,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000450c00002043000000000000,Xeox SL6556BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000006f0e00000300000000000000,XGear,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a5,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000172700004431000000000000,XiaoMi Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a7,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +03000000786901006e70000000000000,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000790000004f18000000000000,ZDT Android Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000120c0000101e000000000000,Zeroplus P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, + +# Mac OS X +030000008f0e00000300000009010000,2In1 Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000c82d00000031000001000000,8BitDo Adapter,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000c82d00000531000000020000,8BitDo Adapter 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000c82d00000090000001000000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00001038000000010000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000650000001000000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000c82d00005106000000010000,8BitDo M30,a:b1,b:b0,back:b10,guide:b2,leftshoulder:b6,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00001590000001000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00006528000000010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +030000003512000012ab000001000000,8BitDo NES30,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d000012ab000001000000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000c82d00002028000000010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000022000000090000001000000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000203800000900000000010000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000190000001000000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000660000000010000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000660000000020000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000131000001000000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000231000001000000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000331000001000000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000431000001000000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000102800000900000000000000,8BitDo SFC30 Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00001290000001000000,8BitDo SN30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00004028000000010000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000160000001000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000161000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000260000001000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000a00500003232000008010000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000a00500003232000009010000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000c82d00001890000001000000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00003032000000010000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a31,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000491900001904000001010000,Amazon Luna Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b9,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b7,x:b2,y:b3,platform:Mac OS X, +03000000710100001904000000010000,Amazon Luna Controller,a:b0,b:b1,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b9,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Mac OS X, +03000000a30c00002700000003030000,Astro City Mini,a:b2,b:b1,back:b8,leftx:a3,lefty:a4,rightshoulder:b4,righttrigger:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000a30c00002800000003030000,Astro City Mini,a:b2,b:b1,back:b8,leftx:a3,lefty:a4,rightshoulder:b4,righttrigger:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000050b00000045000031000000,ASUS Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, +03000000ef0500000300000000020000,InterAct AxisPad,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Mac OS X, +03000000c62400001a89000000010000,BDA MOGA XP5-X Plus,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b14,leftshoulder:b6,leftstick:b15,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b16,righttrigger:a4,rightx:a2,righty:a3,start:b13,x:b3,y:b4,platform:Mac OS X, +03000000c62400001b89000000010000,BDA MOGA XP5-X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000d62000002a79000000010000,BDA PS4 Fightpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000120c0000200e000000010000,Brook Mars PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000120c0000210e000000010000,Brook Mars PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000008305000031b0000000000000,Cideko AK08b,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000d8140000cecf000000000000,Cthulhu,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000260900008888000088020000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a5,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Mac OS X, +03000000a306000022f6000001030000,Cyborg V3 Rumble Pad PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000791d00000103000009010000,Dual Box Wii Classic Adapter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X, +030000000d0f00008400000000010000,Hori Fighting Commander PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00008500000000010000,Hori Fighting Commander PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000151900004000000001000000,Flydigi Vader 2,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, +03000000b40400001124000000000000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:b8,leftx:a0,lefty:a1,paddle1:b4,paddle2:b5,paddle3:b17,rightshoulder:b7,rightstick:b13,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b2,y:b3,platform:Mac OS X, +03000000790000004618000000010000,GameCube Controller Adapter,a:b4,b:b0,dpdown:b56,dpleft:b60,dpright:b52,dpup:b48,lefttrigger:a12,leftx:a0,lefty:a4,rightshoulder:b28,righttrigger:a16,rightx:a20,righty:a8,start:b36,x:b8,y:b12,platform:Mac OS X, +03000000ad1b000001f9000000000000,Gamestop BB070 X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, +03000000c01100000140000000010000,GameStop PS4 Fun Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006f0e00000102000000000000,GameStop Xbox 360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000007d0400000540000001010000,Gravis Eliminator Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000280400000140000000020000,Gravis Gamepad Pro,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +030000008f0e00000300000007010000,GreenAsia Joystick,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Mac OS X, +030000000d0f00002d00000000100000,Hori Fighting Commander 3 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00005f00000000000000,Hori Fighting Commander 4 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00005f00000000010000,Hori Fighting Commander 4 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00005e00000000000000,Hori Fighting Commander 4 PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00005e00000000010000,Hori Fighting Commander 4 PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00004d00000000000000,Hori Gem Pad 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00009200000000010000,Hori Pokken Tournament DX Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00006e00000000010000,Horipad 4 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00006600000000010000,Horipad 4 PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00006600000000000000,Horipad FPS Plus 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f0000ee00000000010000,Horipad Mini 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000008f0e00001330000011010000,HuiJia SNES Controller,a:b4,b:b2,back:b16,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b12,rightshoulder:b14,start:b18,x:b6,y:b0,platform:Mac OS X, +03000000830500006020000000000000,iBuffalo Gamepad,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Mac OS X, +030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Mac OS X, +030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Mac OS X, +03000000242f00002d00000007010000,JYS Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X, +030000006d04000019c2000000000000,Logitech Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000016c2000000020000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000016c2000000030000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000016c2000014040000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000016c2000000000000,Logitech F310,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000018c2000000000000,Logitech F510,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000019c2000005030000,Logitech F710,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d0400001fc2000000000000,Logitech F710,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000006d04000018c2000000010000,Logitech RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3~,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000380700005032000000010000,Mad Catz PS3 Fightpad Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000380700008433000000010000,Mad Catz PS3 Fightstick TE S+,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000380700005082000000010000,Mad Catz PS4 Fightpad Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000380700008483000000010000,Mad Catz PS4 Fightstick TE S+,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000790000000600000007010000,Marvo GT-004,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000790000004418000000010000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000790000004318000000010000,Mayflash GameCube Adapter,a:b4,b:b0,x:b8,y:b12,start:b36,rightshoulder:b28,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a4,rightx:a20,righty:a8,lefttrigger:a12,righttrigger:a16,platform:Mac OS X, +03000000242f00007300000000020000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Mac OS X, +0300000079000000d218000026010000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000d620000010a7000003010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +0300000025090000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:b13,dpleft:b12,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Mac OS X, +03000000790000000018000000010000,Mayflash Wii U Pro Controller Adapter,a:b4,b:b8,back:b32,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b16,leftstick:b40,lefttrigger:b24,leftx:a0,lefty:a4,rightshoulder:b20,rightstick:b44,righttrigger:b28,rightx:a8,righty:a12,start:b36,x:b0,y:b12,platform:Mac OS X, +03000000790000000018000000000000,Mayflash WiiU Pro Adapter,a:b4,b:b8,back:b32,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b16,leftstick:b40,lefttrigger:b24,leftx:a0,lefty:a4,rightshoulder:b20,rightstick:b44,righttrigger:b28,rightx:a8,righty:a12,start:b36,x:b0,y:b12,platform:Mac OS X, +030000005e0400002800000002010000,Microsoft Dual Strike,a:b3,b:b2,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,rightshoulder:b7,rightx:a0,righty:a1~,start:b5,x:b1,y:b0,platform:Mac OS X, +030000005e0400002700000001010000,Microsoft SideWinder Plug and Play,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,lefttrigger:b4,righttrigger:b5,x:b2,y:b3,platform:Mac OS X, +03000000d62000007162000001000000,Moga Pro 2,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Mac OS X, +03000000c62400002a89000000010000,MOGA XP5A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000c62400002b89000000010000,MOGA XP5A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000632500007505000000020000,NeoGeo mini PAD Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,x:b2,y:b3,platform:Mac OS X, +03000000921200004b46000003020000,NES 2-port Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b11,platform:Mac OS X, +030000001008000001e5000006010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000d620000011a7000000020000,Nintendo Switch Core Plus Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000d620000011a7000010050000,Nintendo Switch PowerA Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, +030000007e0500000920000001000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, +030000007e0500001920000001000000,NSO N64 Controller,+rightx:b8,+righty:b7,-rightx:b3,-righty:b2,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,righttrigger:b10,start:b9,platform:Mac OS X, +030000007e0500001720000001000000,NSO SNES Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b15,start:b9,x:b2,y:b3,platform:Mac OS X, +03000000550900001472000025050000,NVIDIA Controller,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Mac OS X, +030000006f0e00000901000002010000,PDP Versus Fighting,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +030000008f0e00000300000000000000,Piranha Xtreme PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Mac OS X, +030000004c050000da0c000000010000,PlayStation Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +030000004c0500003713000000010000,PlayStation Vita,a:b1,b:b2,back:b8,dpdown:b13,dpleft:b15,dpright:b14,dpup:b12,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000d62000006dca000000010000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000100800000300000006010000,PS2 Adapter,a:b2,b:b1,back:b8,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X, +030000004c0500006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Mac OS X, +030000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Mac OS X, +030000004c0500006802000072050000,PS3 Controller,a:b14,b:b13,x:b15,y:b12,back:b0,guide:b16,start:b3,leftstick:b1,rightstick:b2,leftshoulder:b10,rightshoulder:b11,dpup:b4,dpdown:b6,dpleft:b7,dpright:b5,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b8,righttrigger:b9,platform:Mac OS X, +030000004c050000a00b000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c050000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +050000004c050000e60c000000010000,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Mac OS X, +03000000222c00000020000000010000,Qanba Drone Arcade Stick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000008916000000fd000000000000,Razer Onza TE,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000321500000204000000010000,Razer Panthera PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000321500000104000000010000,Razer Panthera PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000321500000010000000010000,Razer Raiju,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000321500000507000001010000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000321500000011000000010000,Razer Raion PS4 Fightpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000321500000009000000020000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X, +030000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X, +0300000032150000030a000000000000,Razer Wildcat,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000790000001100000000000000,Retro Controller,a:b1,b:b2,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b6,lefttrigger:b7,rightshoulder:b4,righttrigger:b5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000790000001100000005010000,Retro Controller,a:b1,b:b2,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b6,lefttrigger:b7,rightshoulder:b5,righttrigger:b4,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000830500006020000000010000,Retro Controller,a:b0,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b8,righttrigger:b9,start:b7,x:b2,y:b3,platform:Mac OS X, +03000000790000001100000006010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +030000006b140000010d000000010000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006b140000130d000000010000,Revolution Pro Controller 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000c6240000fefa000000000000,Rock Candy PS3,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000730700000401000000010000,Sanwa PlayOnline Mobile,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Mac OS X, +03000000811700007e05000000000000,Sega Saturn,a:b2,b:b4,dpdown:b16,dpleft:b15,dpright:b14,dpup:b17,leftshoulder:b8,lefttrigger:a5,leftx:a0,lefty:a2,rightshoulder:b9,righttrigger:a4,start:b13,x:b0,y:b6,platform:Mac OS X, +03000000b40400000a01000000000000,Sega Saturn,a:b0,b:b1,back:b5,guide:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Mac OS X, +030000003512000021ab000000000000,SFC30 Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, +0300000000f00000f100000000000000,SNES RetroPort,a:b2,b:b3,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b5,rightshoulder:b7,start:b6,x:b0,y:b1,platform:Mac OS X, +030000004c050000e60c000000010000,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c050000a00b000000000000,Sony DualShock 4 Adapter,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c050000cc09000000000000,Sony DualShock 4 V2,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000d11800000094000000010000,Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X, +030000005e0400008e02000001000000,Steam Virtual Gamepad,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000110100002014000000000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b12,x:b2,y:b3,platform:Mac OS X, +03000000110100002014000001000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,x:b2,y:b3,platform:Mac OS X, +03000000381000002014000001000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,x:b2,y:b3,platform:Mac OS X, +05000000484944204465766963650000,SteelSeries Nimbus Plus,a:b0,b:b1,back:b15,dpdown:b11,dpleft:b13,dpright:b12,dpup:b10,guide:b16,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3~,start:b14,x:b2,y:b3,platform:Mac OS X, +050000004e696d6275732b0000000000,SteelSeries Nimbus Plus,a:b0,b:b1,back:b15,dpdown:b11,dpleft:b13,dpright:b12,dpup:b10,guide:b16,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3~,start:b14,x:b2,y:b3,platform:Mac OS X, +050000004e696d6275732b008b000000,SteelSeries Nimbus Plus,a:b0,b:b1,back:b15,dpdown:b11,dpleft:b13,dpright:b12,dpup:b10,guide:b16,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3~,start:b14,x:b2,y:b3,platform:Mac OS X, +05000000556e6b6e6f776e2048494400,SteelSeries Nimbus Plus,a:b0,b:b1,back:b15,dpdown:b11,dpleft:b13,dpright:b12,dpup:b10,guide:b16,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3~,start:b14,x:b2,y:b3,platform:Mac OS X, +03000000110100001714000000000000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,start:b12,x:b2,y:b3,platform:Mac OS X, +03000000110100001714000020010000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,start:b12,x:b2,y:b3,platform:Mac OS X, +03000000457500002211000000010000,SZMY Power PC Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004f04000015b3000000000000,Thrustmaster Dual Analog 3.2,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Mac OS X, +030000004f0400000ed0000000020000,ThrustMaster eSwap Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004f04000000b3000000000000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Mac OS X, +03000000bd12000015d0000000010000,Tomee Retro Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000bd12000015d0000000000000,Tomee SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000100800000100000000000000,Twin USB Joystick,a:b4,b:b2,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b12,leftstick:b20,lefttrigger:b8,leftx:a0,lefty:a2,rightshoulder:b14,rightstick:b22,righttrigger:b10,rightx:a6,righty:a4,start:b18,x:b6,y:b0,platform:Mac OS X, +030000006f0e00000302000025040000,Victrix PS4 Pro Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006f0e00000702000003060000,Victrix PS4 Pro Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +050000005769696d6f74652028303000,Wii Remote,a:b4,b:b5,back:b7,dpdown:b3,dpleft:b0,dpright:b1,dpup:b2,guide:b8,leftshoulder:b11,lefttrigger:b12,leftx:a0,lefty:a1,start:b6,x:b10,y:b9,platform:Mac OS X, +050000005769696d6f74652028313800,Wii U Pro Controller,a:b16,b:b15,back:b7,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b8,leftshoulder:b19,leftstick:b23,lefttrigger:b21,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b24,righttrigger:b22,rightx:a2,righty:a3,start:b6,x:b18,y:b17,platform:Mac OS X, +030000005e0400008e02000000000000,Xbox 360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000006f0e00000104000000000000,Xbox 360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000c6240000045d000000000000,Xbox 360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e0400000a0b000000000000,Xbox Adaptive Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000050b000003090000,Xbox Elite Controller Series 2,a:b0,b:b1,back:b31,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b53,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +030000005e040000130b000011050000,Xbox One Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +030000005e040000200b000011050000,Xbox One Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +030000005e040000d102000000000000,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000dd02000000000000,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000e002000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Mac OS X, +030000005e040000e002000003090000,Xbox One Controller,a:b0,b:b1,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +030000005e040000e302000000000000,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000ea02000000000000,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000fd02000003090000,Xbox One Controller,a:b0,b:b1,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000c62400003a54000000000000,Xbox One PowerA Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000130b000001050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +030000005e040000130b000005050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +030000005e040000130b000009050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000172700004431000029010000,XiaoMi Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000120c0000100e000000010000,Zeroplus P4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000120c0000101e000000010000,Zeroplus P4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, + +# Linux +030000005e0400008e02000020010000,8BitDo Adapter,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c82d00000031000011010000,8BitDo Adapter,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +03000000021000000090000011010000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000090000011010000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00001038000000010000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000650000011010000,8BitDo M30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,start:b11,x:b3,y:b4,platform:Linux, +05000000c82d00005106000000010000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Linux, +03000000c82d00001590000011010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00006528000000010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000008000000210000011010000,8BitDo NES30,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +03000000c82d00000310000011010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b9,righttrigger:b8,start:b11,x:b3,y:b4,platform:Linux, +05000000c82d00008010000000010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b9,righttrigger:b8,start:b11,x:b3,y:b4,platform:Linux, +03000000022000000090000011010000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000190000011010000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000203800000900000000010000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00002038000000010000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000660000011010000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00000660000000010000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000131000011010000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000231000011010000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000331000011010000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000431000011010000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00000060000000010000,8BitDo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00000061000000010000,8BitDo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +030000003512000012ab000010010000,8BitDo SFC30,a:b2,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b0,platform:Linux, +030000003512000021ab000010010000,8BitDo SFC30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d000021ab000010010000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, +05000000102800000900000000010000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00003028000000010000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000160000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000160000011010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000161000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00001290000011010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00000161000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00006228000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000260000011010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000202800000900000000010000,8BitDo SNES30,a:b1,b:b0,back:b10,dpdown:b122,dpleft:b119,dpright:b120,dpup:b117,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, +05000000a00500003232000001000000,8BitDo Zero,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux, +05000000a00500003232000008010000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux, +03000000c82d00001890000011010000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, +050000005e040000e002000030110000,8BitDo Zero 2,a:b0,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Linux, +05000000c82d00003032000000010000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c01100000355000011010000,Acrux Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006f0e00003901000000430000,Afterglow Prismatic Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00003901000013020000,Afterglow Prismatic Controller 048-007-NA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00001302000000010000,Afterglow Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00003901000020060000,Afterglow Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000100000008200000011010000,Akishop Customs PS360,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +030000007c1800000006000010010000,Alienware Dual Compatible Game PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Linux, +05000000491900000204000021000000,Amazon Fire Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b17,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b12,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +03000000491900001904000011010000,Amazon Luna Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b9,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b7,x:b2,y:b3,platform:Linux, +05000000710100001904000000010000,Amazon Luna Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux, +03000000790000003018000011010000,Arcade Fightstick F300,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +03000000a30c00002700000011010000,Astro City Mini,a:b2,b:b1,back:b8,leftx:a0,lefty:a1,rightshoulder:b4,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux, +03000000a30c00002800000011010000,Astro City Mini,a:b2,b:b1,back:b8,leftx:a0,lefty:a1,rightshoulder:b4,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux, +05000000050b00000045000031000000,Asus Gamepad,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Linux, +05000000050b00000045000040000000,Asus Gamepad,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Linux, +03000000503200000110000000000000,Atari Classic Controller,a:b0,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b4,start:b3,x:b1,platform:Linux, +03000000503200000110000011010000,Atari Classic Controller,a:b0,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b4,start:b3,x:b1,platform:Linux, +05000000503200000110000000000000,Atari Classic Controller,a:b0,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b4,start:b3,x:b1,platform:Linux, +05000000503200000110000044010000,Atari Classic Controller,a:b0,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b4,start:b3,x:b1,platform:Linux, +05000000503200000110000046010000,Atari Classic Controller,a:b0,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b4,start:b3,x:b1,platform:Linux, +03000000503200000210000000000000,Atari Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a4,rightx:a2,righty:a3,start:b8,x:b2,y:b3,platform:Linux, +03000000503200000210000011010000,Atari Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b2,platform:Linux, +05000000503200000210000000000000,Atari Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b2,platform:Linux, +05000000503200000210000045010000,Atari Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b2,platform:Linux, +05000000503200000210000046010000,Atari Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b2,platform:Linux, +05000000503200000210000047010000,Atari VCS Modern Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:+a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:-a4,rightx:a2,righty:a3,start:b8,x:b2,y:b3,platform:Linux, +03000000120c00000500000010010000,InterAct AxisPad,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Linux, +03000000ef0500000300000000010000,InterAct AxisPad,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Linux, +03000000c62400001b89000011010000,BDA MOGA XP5X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +03000000d62000002a79000011010000,BDA PS4 Fightpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000c21100000791000011010000,Be1 GC101 Controller 1.03,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000c31100000791000011010000,Be1 GC101 Controller 1.03,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +030000005e0400008e02000003030000,Be1 GC101 Xbox 360,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +05000000bc2000000055000001000000,BETOP AX1 BFM,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +03000000bc2000006412000011010000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b30,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000006b1400000209000011010000,Bigben,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000666600006706000000010000,Boom PSX to PC Converter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Linux, +03000000120c0000200e000011010000,Brook Mars PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000120c0000210e000011010000,Brook Mars PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000120c0000f70e000011010000,Brook Universal Fighting Board,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +03000000e82000006058000001010000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000000b0400003365000000010000,Competition Pro,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Linux, +03000000260900008888000000010000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a5,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Linux, +03000000a306000022f6000011010000,Cyborg V3 Rumble,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux, +03000000791d00000103000010010000,Dual Box Wii Classic Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000004f04000004b3000010010000,Dual Power 2,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux, +030000006f0e00003001000001010000,EA Sports PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000c11100000191000011010000,EasySMX,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000242f00009100000000010000,EasySMX ESM-9101,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006e0500000320000010010000,Elecom U3613M,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Linux, +030000006e0500000720000010010000,Elecom W01U,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Linux, +03000000430b00000300000000010000,EMS Production PS2 Adapter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a5,righty:a2,start:b9,x:b3,y:b0,platform:Linux, +03000000b40400001124000011010000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b2,paddle2:b5,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +05000000151900004000000001000000,Flydigi Vader 2,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +03000000ac0500005b05000010010000,GameSir G3w,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000bc2000000055000011010000,GameSir G3w,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +03000000558500001b06000010010000,GameSir G4 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +05000000ac0500002d0200001b010000,GameSir G4s,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b33,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +03000000bc2000005656000011010000,GameSir T4w,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +030000006f0e00000104000000010000,Gamestop Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000008f0e00000800000010010000,Gasia PlayStation Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000451300000010000010010000,Genius Maxfire Grandias 12,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +03000000f0250000c183000010010000,Goodbetterbest Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +0300000079000000d418000000010000,GPD Win 2 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000007d0400000540000000010000,Gravis Eliminator Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +03000000280400000140000000010000,Gravis Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +030000008f0e00000610000000010000,GreenAsia Electronics Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Linux, +030000008f0e00001200000010010000,GreenAsia Joystick,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux, +0500000047532067616d657061640000,GS gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +03000000f0250000c383000010010000,GT VX2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +06000000adde0000efbe000002010000,Hidromancer Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000d81400000862000011010000,HitBox PS3 PC Analog Mode,a:b1,b:b2,back:b8,guide:b9,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b12,x:b0,y:b3,platform:Linux, +03000000c9110000f055000011010000,HJC Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +03000000632500002605000010010000,HJDX,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +030000000d0f00000d00000000010000,Hori,a:b0,b:b6,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b3,rightshoulder:b7,start:b9,x:b1,y:b2,platform:Linux, +030000000d0f00006d00000020010000,Hori EDGE 301,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:+a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000000d0f00008500000010010000,Hori Fighting Commander PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00008600000002010000,Hori Fighting Commander Xbox 360,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +030000000d0f00005f00000011010000,Hori Fighting Commander 4 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00005e00000011010000,Hori Fighting Commander 4 PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00005001000009040000,Hori Fighting Commander OCTA Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000000d0f00001000000011010000,Hori Fightstick 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +03000000ad1b000003f5000033050000,Hori Fightstick VX,+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b8,guide:b10,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b2,y:b3,platform:Linux, +030000000d0f00004d00000011010000,HORI Gem Pad 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000ad1b000001f5000033050000,Hori Pad EX Turbo 2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000000d0f00003801000011010000,Hori PC Engine Mini Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,platform:Linux, +030000000d0f00009200000011010000,Hori Pokken Tournament DX Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f0000aa00000011010000,Hori Real Arcade Pro,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000000d0f00002200000011010000,Hori Real Arcade Pro 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00006a00000011010000,Hori Real Arcade Pro 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00006b00000011010000,Hori Real Arcade Pro 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00001600000000010000,Hori Real Arcade Pro EXSE,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b2,y:b3,platform:Linux, +030000000d0f00006e00000011010000,Horipad 4 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00006600000011010000,Horipad 4 PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f0000ee00000011010000,Horipad Mini 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00006700000001010000,Horipad One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000000d0f0000c100000011010000,Horipad S,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +050000000d0f0000f600000001000000,HORIPAD Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +03000000341a000005f7000010010000,HuiJia GameCube Controller Adapter,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Linux, +030000008f0e00001330000010010000,HuiJia SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b9,x:b3,y:b0,platform:Linux, +03000000242e00008816000001010000,Hyperkin X91,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +050000006964726f69643a636f6e0000,idroidcon Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000b50700001503000010010000,Impact,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux, +03000000d80400008200000003000000,IMS PCU0,a:b1,b:b0,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b5,x:b3,y:b2,platform:Linux, +03000000fd0500000030000000010000,InterAct GoPad I73000,a:b3,b:b4,back:b6,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,start:b7,x:b0,y:b1,platform:Linux, +03000000fd0500002a26000000010000,InterAct HammerHead FX,a:b3,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b2,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b5,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Linux, +0500000049190000020400001b010000,Ipega PG 9069,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b161,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +03000000632500007505000011010000,Ipega PG 9099,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +0500000049190000030400001b010000,Ipega PG9099,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +05000000491900000204000000000000,Ipega PG9118,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +03000000300f00001001000010010000,Jess Tech Dual Analog Rumble,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux, +03000000300f00000b01000010010000,Jess Tech GGE909 PC Recoil,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux, +03000000ba2200002010000001010000,Jess Technology Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux, +030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Linux, +050000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Linux, +030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Linux, +050000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Linux, +03000000bd12000003c0000010010000,Joypad Alpha Shock,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000242f00002d00000011010000,JYS Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000242f00008a00000011010000,JYS Adapter,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Linux, +030000006f0e00000103000000020000,Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006d040000d1ca000000000000,Logitech Chillstream,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d04000019c2000010010000,Logitech Cordless RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d04000016c2000010010000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d04000016c2000011010000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d0400001dc2000014400000,Logitech F310,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006d0400001ec2000019200000,Logitech F510,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006d0400001ec2000020200000,Logitech F510,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006d04000019c2000011010000,Logitech F710,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d0400001fc2000005030000,Logitech F710,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006d04000018c2000010010000,Logitech RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d04000011c2000010010000,Logitech WingMan Cordless RumblePad,a:b0,b:b1,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b6,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b10,rightx:a3,righty:a4,start:b8,x:b3,y:b4,platform:Linux, +030000006d0400000ac2000010010000,Logitech WingMan RumblePad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,rightx:a3,righty:a4,x:b3,y:b4,platform:Linux, +05000000380700006652000025010000,Mad Catz CTRLR,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700008532000010010000,Mad Catz Fightpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +03000000380700005032000011010000,Mad Catz Fightpad Pro PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700005082000011010000,Mad Catz Fightpad Pro PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000ad1b00002ef0000090040000,Mad Catz Fightpad SFxT,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,start:b7,x:b2,y:b3,platform:Linux, +03000000380700008034000011010000,Mad Catz Fightstick PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700008084000011010000,Mad Catz Fightstick PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000380700008433000011010000,Mad Catz Fightstick TE S PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700008483000011010000,Mad Catz Fightstick TE S PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000380700001888000010010000,Mad Catz Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700003888000010010000,Mad Catz Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:a0,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700001647000010040000,Mad Catz Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000380700003847000090040000,Mad Catz Xbox 360 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +03000000ad1b000016f0000090040000,Mad Catz Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000120c00000500000000010000,Manta Dualshock 2,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux, +03000000790000004418000010010000,Mayflash GameCube Controller,a:b1,b:b0,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Linux, +03000000790000004318000010010000,Mayflash GameCube Adapter,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Linux, +03000000242f00007300000011010000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Linux, +0300000079000000d218000011010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000d620000010a7000011010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000242f0000f700000001010000,Mayflash Magic S Pro,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +0300000025090000e803000001010000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:a4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:a5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux, +03000000b50700001203000010010000,Mega World Logic 3 Controller,a:b2,b:b3,x:b0,y:b1,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b5,righttrigger:b7,platform:Linux, +03000000780000000600000010010000,Microntek Joystick,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux, +030000005e0400002800000000010000,Microsoft Dual Strike,a:b3,b:b2,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,rightshoulder:b7,rightx:a0,righty:a1~,start:b5,x:b1,y:b0,platform:Linux, +030000005e0400000e00000000010000,Microsoft SideWinder,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Linux, +030000005e0400000700000000010000,Microsoft SideWinder Gamepad,a:b0,b:b1,back:b8,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b9,x:b3,y:b4,platform:Linux, +030000005e0400002700000000010000,Microsoft SideWinder Plug and Play,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,lefttrigger:b4,righttrigger:b5,x:b2,y:b3,platform:Linux, +030000005e0400008502000000010000,Microsoft Xbox,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, +030000005e0400008e02000001000000,Microsoft Xbox 360,a:b0,b:b1,back:b6,dpdown:h0.1,dpleft:h0.2,dpright:h0.8,dpup:h0.4,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008e02000004010000,Microsoft Xbox 360,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008e02000056210000,Microsoft Xbox 360,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008e02000062230000,Microsoft Xbox 360,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000d102000001010000,Microsoft Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000d102000003020000,Microsoft Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +060000005e040000120b000009050000,Microsoft Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000120b00000b050000,Microsoft Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000dd02000003020000,Microsoft Xbox One 2015,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000e302000003020000,Microsoft Xbox One Elite,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000000b000008040000,Microsoft Xbox One Elite 2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +050000005e040000050b000003090000,Microsoft Xbox One Elite 2,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +030000005e040000ea02000008040000,Microsoft Xbox One S,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008902000021010000,Microsoft Xbox pad v2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, +03000000030000000300000002000000,Miroof,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux, +050000004d4f435554452d3035335800,Mocute 053X,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +050000004d4f435554452d3035305800,Mocute 054X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +05000000d6200000e589000001000000,Moga 2,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux, +05000000d6200000ad0d000001000000,Moga Pro,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux, +05000000d62000007162000001000000,Moga Pro 2,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux, +03000000c62400002b89000011010000,MOGA XP5A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +05000000c62400002a89000000010000,MOGA XP5A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b22,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +05000000c62400001a89000000010000,MOGA XP5X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +03000000250900006688000000010000,MP8866 Super Dual Box,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux, +030000006b1400000906000014010000,Nacon Asymmetric Wireless PS4 Controller,a:b0,b:b1,x:b2,y:b3,back:b6,guide:b8,start:b7,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Linux, +03000000853200000706000012010000,Nacon GC-100,a:b0,b:b1,x:b2,y:b3,back:b6,guide:b8,start:b7,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Linux, +030000006b140000010c000010010000,Nacon GC 400ES,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +030000000d0f00000900000010010000,Natec Genesis P44,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000004f1f00000800000011010000,NeoGeo PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +0300000092120000474e000000010000,NeoGeo X Arcade Stick,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,x:b3,y:b2,platform:Linux, +03000000790000004518000010010000,Nexilux GameCube Controller Adapter,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Linux, +030000001008000001e5000010010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Linux, +050000004e696d6275732b0000000000,Nimbus Plus,a:b0,b:b1,back:b10,guide:b11,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b12,x:b2,y:b3,platform:Linux, +060000007e0500003713000000000000,Nintendo 3DS,a:b0,b:b1,back:b8,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux, +030000007e0500003703000000016800,Nintendo GameCube Controller,a:b0,b:b2,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1~,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3~,start:b8,x:b1,y:b3,platform:Linux, +03000000790000004618000010010000,Nintendo GameCube Controller Adapter,a:b1,b:b0,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a5~,righty:a2~,start:b9,x:b2,y:b3,platform:Linux, +060000007e0500000620000000000000,Nintendo Switch Combined Joy-Cons,a:b0,b:b1,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux, +060000007e0500000820000000000000,Nintendo Switch Combined Joy-Cons,a:b0,b:b1,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux, +050000004c69632050726f20436f6e00,Nintendo Switch Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +050000007e0500000620000001800000,Nintendo Switch Left Joy-Con,a:b16,b:b15,back:b4,leftshoulder:b6,leftstick:b12,leftx:a1,lefty:a0~,rightshoulder:b8,start:b9,x:b14,y:b17,platform:Linux, +03000000d620000013a7000011010000,Nintendo Switch PowerA Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000d620000011a7000011010000,Nintendo Switch PowerA Core Plus Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000007e0500000920000011810000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux, +050000007e0500000920000001000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +050000007e0500000920000001800000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux, +050000007e0500000720000001800000,Nintendo Switch Right Joy-Con,a:b1,b:b2,back:b9,leftshoulder:b4,leftstick:b10,leftx:a1~,lefty:a0,rightshoulder:b6,start:b8,x:b0,y:b3,platform:Linux, +05000000010000000100000003000000,Nintendo Wii Remote,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +050000007e0500003003000001000000,Nintendo Wii Remote Pro Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux, +030000000d0500000308000010010000,Nostromo n45 Dual Analog,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Linux, +050000007e0500001920000001000000,NSO N64 Controller,+rightx:b8,+righty:b7,-rightx:b3,-righty:b2,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,righttrigger:b10,start:b9,platform:Linux, +050000007e0500001720000001000000,NSO SNES Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux, +03000000550900001072000011010000,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b8,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000550900001472000011010000,NVIDIA Controller v01.04,a:b0,b:b1,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux, +05000000550900001472000001000000,NVIDIA Controller v01.04,a:b0,b:b1,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux, +03000000451300000830000010010000,NYKO CORE,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +19000000010000000100000001010000,odroidgo2 joypad,a:b1,b:b0,dpdown:b7,dpleft:b8,dpright:b9,dpup:b6,guide:b10,leftshoulder:b4,leftstick:b12,lefttrigger:b11,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b13,righttrigger:b14,start:b15,x:b2,y:b3,platform:Linux, +19000000010000000200000011000000,odroidgo2 joypad v11,a:b1,b:b0,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b12,leftshoulder:b4,leftstick:b14,lefttrigger:b13,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b15,righttrigger:b16,start:b17,x:b2,y:b3,platform:Linux, +03000000c0160000dc27000001010000,OnyxSoft Dual JoyDivision,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,platform:Linux, +05000000362800000100000002010000,OUYA Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,platform:Linux, +05000000362800000100000003010000,OUYA Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,platform:Linux, +05000000362800000100000004010000,OUYA Controller,a:b0,b:b3,back:b14,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,leftshoulder:b4,leftstick:b6,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:b13,rightx:a3,righty:a4,start:b16,x:b1,y:b2,platform:Linux, +03000000830500005020000010010000,Padix Rockfire PlayStation Bridge,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b2,y:b3,platform:Linux, +03000000790000001c18000011010000,PC Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000ff1100003133000010010000,PC Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000006f0e0000b802000001010000,PDP Afterglow Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e0000b802000013020000,PDP Afterglow Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00006401000001010000,PDP Battlefield One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00003101000000010000,PDP EA Sports Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00008001000011010000,PDP Faceoff Nintendo Switch Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006f0e0000c802000012010000,PDP Kingdom Hearts Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00008501000011010000,PDP Nintendo Switch Fightpad Pro,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000006f0e00002801000011010000,PDP PS3 Rock Candy Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006f0e00008701000011010000,PDP Rock Nintendo Switch Candy Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000006f0e00000901000011010000,PDP Versus Fighting,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +030000006f0e0000a802000023020000,PDP Xbox One Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +030000006f0e0000a702000023020000,PDP Xbox One Raven Black,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000004c050000da0c000011010000,PlayStation Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux, +03000000d9040000160f000000010000,PlayStation Controller Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux, +030000004c0500003713000011010000,PlayStation Vita,a:b1,b:b2,back:b8,dpdown:b13,dpleft:b15,dpright:b14,dpup:b12,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Linux, +03000000c62400000053000000010000,PowerA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c62400003a54000001010000,PowerA 1428124-01,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c62400001a53000000010000,PowerA Mini Pro Ex,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000d62000006dca000011010000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000c62400001a58000001010000,PowerA Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000d62000000220000001010000,PowerA Xbox One Controller,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Linux, +03000000d62000000228000001010000,PowerA Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c62400001a54000001010000,PowerA Xbox One Mini Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006d040000d2ca000011010000,Precision Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000ff1100004133000010010000,PS2 Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux, +03000000341a00003608000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000004c0500006802000010010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +030000004c0500006802000010810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +030000004c0500006802000011010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +030000004c0500006802000011810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +030000005f1400003102000010010000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000006f0e00001402000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000008f0e00000300000010010000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +050000004c0500006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +050000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:a12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:a13,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +050000004c0500006802000000800000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +050000004c0500006802000000810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +05000000504c415953544154494f4e00,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +060000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +030000004c050000a00b000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004c050000a00b000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +030000004c050000c405000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004c050000c405000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +030000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004c050000cc09000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004c050000cc09000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +03000000c01100000140000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +050000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +050000004c050000c405000000810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +050000004c050000c405000001800000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +050000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +050000004c050000cc09000000810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +050000004c050000cc09000001800000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +030000004c050000e60c000011010000,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux, +050000004c050000e60c000000010000,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux, +03000000300f00001211000011010000,Qanba Arcade Joystick,a:b2,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b5,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b6,start:b9,x:b1,y:b3,platform:Linux, +03000000300f00001210000010010000,Qanba Joystick Plus,a:b0,b:b1,back:b8,leftshoulder:b5,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b4,righttrigger:b6,start:b9,x:b2,y:b3,platform:Linux, +030000009b2800000300000001010000,Raphnet 4nes4snes,a:b0,b:b4,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b1,y:b5,platform:Linux, +030000009b2800004200000001010000,Raphnet Dual NES Adapter,a:b0,b:b1,back:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b3,platform:Linux, +030000009b2800003200000001010000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux, +030000009b2800006000000001010000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux, +030000008916000001fd000024010000,Razer Onza Classic Edition,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000008916000000fd000024010000,Razer Onza Tournament Edition,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000321500000204000011010000,Razer Panthera PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000321500000104000011010000,Razer Panthera PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000321500000810000011010000,Razer Panthera PS4 Evo Arcade Stick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000321500000010000011010000,Razer Raiju,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000321500000507000000010000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +05000000321500000a10000001000000,Razer Raiju Tournament Edition,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000321500000011000011010000,Razer Raion PS4 Fightpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000008916000000fe000024010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c6240000045d000024010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c6240000045d000025010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000321500000009000011010000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux, +050000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux, +0300000032150000030a000001010000,Razer Wildcat,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000790000001100000010010000,Retro Controller,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b4,righttrigger:b5,start:b9,x:b0,y:b3,platform:Linux, +0300000081170000990a000001010000,Retronic Adapter,a:b0,leftx:a0,lefty:a1,platform:Linux, +0300000000f000000300000000010000,RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Linux, +00000000526574726f53746f6e653200,RetroStone 2 Controller,a:b1,b:b0,back:b10,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,leftshoulder:b6,lefttrigger:b8,rightshoulder:b7,righttrigger:b9,start:b11,x:b4,y:b3,platform:Linux, +030000006b140000010d000011010000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000006b140000130d000011010000,Revolution Pro Controller 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000006f0e00001f01000000010000,Rock Candy,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00001e01000011010000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000c6240000fefa000000010000,Rock Candy Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00004601000001010000,Rock Candy Xbox One Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000a306000023f6000011010000,Saitek Cyborg V1 PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux, +03000000a30600001005000000010000,Saitek P150,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b2,righttrigger:b5,x:b3,y:b4,platform:Linux, +03000000a30600000701000000010000,Saitek P220,a:b2,b:b3,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b4,righttrigger:b5,x:b0,y:b1,platform:Linux, +03000000a30600000cff000010010000,Saitek P2500 Force Rumble,a:b2,b:b3,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b0,y:b1,platform:Linux, +03000000a30600000c04000011010000,Saitek P2900,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b12,x:b0,y:b3,platform:Linux, +03000000a306000018f5000010010000,Saitek P3200 Rumble,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Linux, +03000000300f00001201000010010000,Saitek P380,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux, +03000000a30600000901000000010000,Saitek P880,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,x:b0,y:b1,platform:Linux, +03000000a30600000b04000000010000,Saitek P990 Dual Analog,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b8,x:b0,y:b3,platform:Linux, +03000000a306000020f6000011010000,Saitek PS2700 Rumble,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux, +03000000d81d00000e00000010010000,Savior,a:b0,b:b1,back:b8,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b11,righttrigger:b3,start:b9,x:b4,y:b5,platform:Linux, +03000000a30c00002500000011010000,Sega Genesis Mini 3B Controller,a:b2,b:b1,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,righttrigger:b5,start:b9,platform:Linux, +03000000790000001100000011010000,Sega Saturn,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b5,righttrigger:b4,start:b9,x:b0,y:b3,platform:Linux, +03000000790000002201000011010000,Sega Saturn,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,start:b9,x:b2,y:b3,platform:Linux, +03000000b40400000a01000000010000,Sega Saturn,a:b0,b:b1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b8,x:b3,y:b4,platform:Linux, +030000001f08000001e4000010010000,SFC Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Linux, +03000000632500002305000010010000,ShanWan Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000f025000021c1000010010000,Shanwan Gioteck PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000632500007505000010010000,Shanwan PS3 PC,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000bc2000000055000010010000,Shanwan PS3 PC ,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +030000005f140000c501000010010000,Shanwan Trust,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000341a00000908000010010000,SL6566,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +030000004c050000e60c000011810000,PS5 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +050000004c050000e60c000000810000,PS5 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +050000004c050000cc09000001000000,Sony DualShock 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000ff000000cb01000010010000,Sony PlayStation Portable,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Linux, +03000000250900000500000000010000,Sony PS2 pad with SmartJoy Adapter,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux, +030000005e0400008e02000073050000,Speedlink Torid,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008e02000020200000,SpeedLink Xeox Pro Analog,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000d11800000094000011010000,Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000de2800000112000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000de2800000211000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000de2800000211000011010000,Steam Controller,a:b2,b:b3,back:b10,dpdown:b18,dpleft:b19,dpright:b20,dpup:b17,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,paddle1:b16,paddle2:b15,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b5,platform:Linux, +03000000de2800004211000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000de2800004211000011010000,Steam Controller,a:b2,b:b3,back:b10,dpdown:b18,dpleft:b19,dpright:b20,dpup:b17,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,paddle1:b16,paddle2:b15,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b5,platform:Linux, +03000000de280000fc11000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +05000000de2800000212000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000de280000ff11000001000000,Steam Virtual Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000381000003014000075010000,SteelSeries Stratus Duo,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000381000003114000075010000,SteelSeries Stratus Duo,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +0500000011010000311400001b010000,SteelSeries Stratus Duo,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b32,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +05000000110100001914000009010000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +03000000ad1b000038f0000090040000,Street Fighter IV Fightstick TE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000003b07000004a1000000010000,Suncom SFX Plus,a:b0,b:b2,back:b7,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:b5,start:b8,x:b1,y:b3,platform:Linux, +03000000666600000488000000010000,Super Joy Box 5 Pro,a:b2,b:b1,back:b9,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux, +0300000000f00000f100000000010000,Super RetroPort,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Linux, +030000008f0e00000d31000010010000,SZMY Power 3 Turbo,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000457500002211000010010000,SZMY Power Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000008f0e00001431000010010000,SZMY Power PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000ba2200000701000001010000,Technology Innovation PS2 Adapter,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a5,righty:a2,start:b9,x:b3,y:b2,platform:Linux, +030000004f04000015b3000001010000,Thrustmaster Dual Analog 3.2,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux, +030000004f04000015b3000010010000,Thrustmaster Dual Analog 4,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux, +030000004f04000020b3000010010000,Thrustmaster Dual Trigger,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux, +030000004f04000023b3000000010000,Thrustmaster Dual Trigger PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004f0400000ed0000011010000,Thrustmaster eSwap Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000b50700000399000000010000,Thrustmaster Firestorm Digital 2,a:b2,b:b4,back:b11,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b8,rightstick:b0,righttrigger:b9,start:b1,x:b3,y:b5,platform:Linux, +030000004f04000003b3000010010000,Thrustmaster Firestorm Dual Analog 2,a:b0,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b9,rightx:a2,righty:a3,x:b1,y:b3,platform:Linux, +030000004f04000000b3000010010000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Linux, +030000004f04000026b3000002040000,Thrustmaster GP XID,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c6240000025b000002020000,Thrustmaster GPX,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000004f04000008d0000000010000,Thrustmaster Run N Drive PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004f04000009d0000000010000,Thrustmaster Run N Drive PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000004f04000007d0000000010000,Thrustmaster T Mini,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000004f04000012b3000010010000,Thrustmaster vibrating,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux, +03000000571d00002000000010010000,Tomee SNES Adapter,a:b0,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Linux, +03000000bd12000015d0000010010000,Tomee SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Linux, +03000000d814000007cd000011010000,Toodles 2008 Chimp PC PS3,a:b0,b:b1,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b2,platform:Linux, +030000005e0400008e02000070050000,Torid,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c01100000591000011010000,Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000100800000100000010010000,Twin PS2 Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux, +03000000100800000300000010010000,USB Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux, +03000000790000000600000007010000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Linux, +03000000790000001100000000010000,USB Gamepad,a:b2,b:b1,back:b8,dpdown:a0,dpleft:a1,dpright:a2,dpup:a4,start:b9,platform:Linux, +030000006f0e00000302000011010000,Victrix Pro Fightstick PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +030000006f0e00000702000011010000,Victrix Pro Fightstick PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +05000000ac0500003232000001000000,VR Box Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux, +0000000058626f782033363020576900,Xbox 360 Controller,a:b0,b:b1,back:b14,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,guide:b7,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Linux, +030000005e0400001907000000010000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008e02000010010000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008e02000014010000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400009102000007010000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000a102000000010000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000a102000007010000,Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008e02000000010000,Xbox 360 EasySMX,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000a102000014010000,Xbox 360 Receiver,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400000202000000010000,Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, +030000006f0e00001304000000010000,Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000ffff0000ffff000000010000,Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, +0000000058626f782047616d65706100,Xbox Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400000a0b000005040000,Xbox One Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux, +030000005e040000120b000009050000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000d102000002010000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000ea02000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000ea02000001030000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +050000005e040000e002000003090000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +050000005e040000fd02000003090000,Xbox One Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +050000005e040000fd02000030110000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +060000005e040000120b000007050000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +050000005e040000e302000002090000,Xbox One Elite,a:b0,b:b1,back:b136,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +050000005e040000050b000002090000,Xbox One Elite Series 2,a:b0,b:b1,back:b136,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +060000005e040000ea0200000b050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000120b000001050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000120b000005050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000120b00000d050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000130b000005050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +050000005e040000130b000001050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +050000005e040000130b000005050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +050000005e040000130b000009050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +050000005e040000130b000013050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +060000005e040000120b00000b050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +050000005e040000130b000011050000,Xbox Series X Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +050000005e040000130b000007050000,Xbox Wireless Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +03000000450c00002043000010010000,XEOX SL6556 BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +05000000172700004431000029010000,XiaoMi Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Linux, +03000000c0160000e105000001010000,XinMo Dual Arcade,a:b4,b:b3,back:b6,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b9,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b1,y:b0,platform:Linux, +xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000120c0000100e000011010000,Zeroplus P4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000120c0000101e000011010000,Zeroplus P4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, + +# Android +38653964633230666463343334313533,8BitDo Adapter,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +36666264316630653965636634386234,8BitDo Adapter 2,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b19,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +38426974446f20417263616465205374,8BitDo Arcade Stick,a:b0,b:b1,back:b15,guide:b5,leftshoulder:b9,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +61393962646434393836356631636132,8BitDo Arcade Stick,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b20,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b19,y:b2,platform:Android, +64323139346131306233636562663738,8BitDo Arcade Stick,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b3,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b19,y:b2,platform:Android, +64643565386136613265663236636564,8BitDo Arcade Stick,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b20,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b19,y:b2,platform:Android, +34343439373236623466343934376233,8BitDo FC30 Pro,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b28,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b29,righttrigger:b7,start:b5,x:b30,y:b2,platform:Android, +05000000c82d000006500000ffff3f00,8BitDo M30,a:b1,b:b0,back:b4,guide:b17,leftshoulder:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a4,start:b6,x:b3,y:b2,platform:Android, +05000000c82d000051060000ffff3f00,8BitDo M30,a:b1,b:b0,back:b4,guide:b17,leftshoulder:b9,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,start:b6,x:b3,y:b2,platform:Android, +33656266353630643966653238646264,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b20,righttrigger:a5,start:b10,x:b19,y:b2,platform:Android, +39366630663062373237616566353437,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:b18,start:b6,x:b2,y:b3,platform:Android, +64653533313537373934323436343563,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:a4,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:b10,start:b6,x:b2,y:b3,platform:Android, +66356438346136366337386437653934,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,righttrigger:b10,start:b18,x:b19,y:b2,platform:Android, +66393064393162303732356665666366,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,start:b6,x:b2,y:b3,platform:Android, +05000000c82d000015900000ffff3f00,8BitDo N30 Pro 2,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +05000000c82d000065280000ffff3f00,8BitDo N30 Pro 2,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b17,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +050000000220000000900000ffff3f00,8BitDo NES30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +050000002038000009000000ffff3f00,8BitDo NES30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +35376664343164386333616535333434,8BitDo Pro 2,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b17,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b18,righttrigger:a5,rightx:a3,start:b10,x:b19,y:b2,platform:Android, +38426974446f2038426974446f205072,8BitDo Pro 2,a:b1,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +38426974446f2050726f203200000000,8BitDo Pro 2,a:b1,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +62373739366537363166326238653463,8BitDo Pro 2,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b3,y:b2,platform:Android, +38386464613034326435626130396565,8BitDo Receiver,a:b1,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b19,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +38426974446f2038426974446f205265,8BitDo Receiver,a:b1,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b19,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +66303230343038613365623964393766,8BitDo Receiver,a:b1,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b19,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +05000000c82d000000600000ffff3f00,8BitDo SF30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +05000000c82d000000610000ffff3f00,8BitDo SF30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +38426974646f20534633302050726f00,8BitDo SF30 Pro,a:b1,b:b0,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b17,platform:Android, +61623334636338643233383735326439,8BitDo SFC30,a:b0,b:b1,back:b4,leftshoulder:b3,leftx:a0,lefty:a1,rightshoulder:b31,start:b5,x:b30,y:b2,platform:Android, +05000000c82d000012900000ffff3f00,8BitDo SN30,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android, +05000000c82d000062280000ffff3f00,8BitDo SN30,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android, +35383531346263653330306238353131,8BitDo SN30 PP,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +05000000c82d000001600000ffff3f00,8BitDo SN30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +36653638656632326235346264663661,8BitDo SN30 Pro Plus,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b19,y:b2,platform:Android, +38303232393133383836366330346462,8BitDo SN30 Pro Plus,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b17,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b18,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b19,y:b2,platform:Android, +38346630346135363335366265656666,8BitDo SN30 Pro Plus,a:b1,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +38426974446f20534e33302050726f2b,8BitDo SN30 Pro Plus,a:b1,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b19,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +536f6e7920436f6d707574657220456e,8BitDo SN30 Pro Plus,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +66306331643531333230306437353936,8BitDo SN30 Pro Plus,a:b1,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +05000000c82d000002600000ffff0f00,8BitDo SN30 Pro+,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b17,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +050000002028000009000000ffff3f00,8BitDo SNES30,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +050000003512000020ab000000780f00,8BitDo SNES30,a:b21,b:b20,back:b30,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b26,rightshoulder:b27,start:b31,x:b24,y:b23,platform:Android, +33666663316164653937326237613331,8BitDo Zero,a:b0,b:b1,back:b15,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b2,y:b3,platform:Android, +38426974646f205a65726f2047616d65,8BitDo Zero,a:b0,b:b1,back:b15,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b2,y:b3,platform:Android, +05000000c82d000018900000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android, +05000000c82d000030320000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android, +33663434393362303033616630346337,8BitDo Zero 2,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftx:a0,lefty:a1,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android, +34656330626361666438323266633963,8BitDo Zero 2,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b20,start:b10,x:b19,y:b2,platform:Android, +63396666386564393334393236386630,8BitDo Zero 2,a:b1,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android, +63633435623263373466343461646430,8BitDo Zero 2,a:b1,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b2,y:b3,platform:Android, +32333634613735616163326165323731,Amazon Luna Controller,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b2,y:b3,platform:Android, +417374726f2063697479206d696e6920,Astro City Mini,a:b23,b:b22,back:b29,leftx:a0,lefty:a1,rightshoulder:b25,righttrigger:b26,start:b30,x:b24,y:b21,platform:Android, +38383337343564366131323064613561,Brook Mars PS4 Controller,a:b1,b:b19,back:b17,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b0,y:b2,platform:Android, +30363230653635633863366338623265,Evo VR,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,x:b2,y:b3,platform:Android, +05000000b404000011240000dfff3f00,Flydigi Vader 2,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,paddle1:b17,paddle2:b18,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +05000000bc20000000550000ffff3f00,GameSir G3w,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +34323662653333636330306631326233,Google Nexus,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +35383633353935396534393230616564,Google Stadia Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +05000000d6020000e5890000dfff3f00,GPD XD Plus,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Android, +0500000031366332860c44aadfff0f00,GS Gamepad,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +66633030656131663837396562323935,Hori Battle,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Android, +35623466343433653739346434636330,Hori Fighting Commander 3 Pro,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b0,y:b2,platform:Android, +484f524920434f2e2c4c54442e203130,Hori Fighting Commander 3 Pro,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b20,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b3,righttrigger:b9,rightx:a2,righty:a3,start:b18,x:b0,y:b2,platform:Android, +484f524920434f2e2c4c544420205041,Hori Gem Pad 3,a:b1,b:b17,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b16,x:b0,y:b2,platform:Android, +65656436646661313232656661616130,Hori PC Engine Mini Controller,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b18,platform:Android, +31303433326562636431653534636633,Hori Real Arcade Pro 3,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b0,y:b2,platform:Android, +30306539356238653637313730656134,HORIPAD Switch Pro Controller,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b19,y:b2,platform:Android, +0500000083050000602000000ffe0000,iBuffalo SNES Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b15,rightshoulder:b16,start:b10,x:b2,y:b3,platform:Android, +64306137363261396266353433303531,InterAct GoPad,a:b24,b:b25,leftshoulder:b23,lefttrigger:b27,leftx:a0,lefty:a1,rightshoulder:b26,righttrigger:b28,x:b21,y:b22,platform:Android, +532e542e442e20496e74657261637420,InterAct HammerHead FX,a:b23,b:b24,back:b30,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b26,leftstick:b22,lefttrigger:b28,leftx:a0,lefty:a1,rightshoulder:b27,rightstick:b25,righttrigger:b29,rightx:a2,righty:a3,start:b31,x:b20,y:b21,platform:Android, +65346535636333663931613264643164,Joy Con,a:b21,b:b22,back:b29,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b25,lefttrigger:b27,leftx:a0,lefty:a1,rightshoulder:b26,righttrigger:b28,rightx:a2,righty:a3,start:b30,x:b23,y:b24,platform:Android, +33346566643039343630376565326335,Joy Con (L),a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,rightshoulder:b20,start:b17,x:b19,y:b2,platform:Android, +35313531613435623366313835326238,Joy Con (L),a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,rightshoulder:b20,start:b17,x:b19,y:b2,platform:Android, +38383665633039363066383334653465,Joy Con (R),a:b0,b:b1,back:b5,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android, +39363561613936303237333537383931,Joy Con (R),a:b0,b:b1,back:b5,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android, +4a6f792d436f6e20284c290000000000,Joy-Con (L),a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,rightshoulder:b20,start:b17,x:b19,y:b2,platform:Android, +4a6f792d436f6e202852290000000000,Joy-Con (R),a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android, +39656136363638323036303865326464,JYS Aapter,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b0,y:b2,platform:Android, +63316564383539663166353034616434,JYS Adapter,a:b1,b:b3,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b0,y:b2,platform:Android, +64623163333561643339623235373232,Logitech F310,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +35623364393661626231343866613337,Logitech F710,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +4c6f6769746563682047616d65706164,Logitech F710,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +64396331333230326333313330336533,Logitech F710,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +416d617a6f6e2047616d6520436f6e74,Luna Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Android, +4c756e612047616d6570616400000000,Luna Controller,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +30363066623539323534363639323363,Magic NS,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b0,y:b2,platform:Android, +31353762393935386662336365626334,Magic NS,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b0,y:b2,platform:Android, +39623565346366623931666633323530,Magic NS,a:b1,b:b3,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b0,y:b2,platform:Android, +32303165626138343962363666346165,Brook Mars PS4 Controller,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b0,y:b2,platform:Android, +6d6179666c617368206c696d69746564,Mayflash GameCube Adapter,a:b22,b:b21,x:b23,y:b24,start:b30,rightshoulder:b28,lefttrigger:b25,righttrigger:b26,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a5,righty:a2,platform:Android, +65666330633838383061313633326461,Mayflash N64 Adapter,a:b1,b:b19,leftshoulder:b3,rightshoulder:b20,lefttrigger:b9,start:b18,guide:b5,leftx:a0,lefty:a1,rightx:a2,righty:a3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,platform:Android, +436f6e74726f6c6c6572000000000000,Mayflash N64 Adapter,a:b1,b:b19,leftshoulder:b3,rightshoulder:b20,lefttrigger:b9,start:b18,guide:b5,leftx:a0,lefty:a1,rightx:a2,righty:a3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,platform:Android, +31323564663862633234646330373138,Mega Drive,a:b23,b:b22,leftx:a0,lefty:a1,rightshoulder:b25,righttrigger:b26,start:b30,x:b24,y:b21,platform:Android, +37333564393261653735306132613061,Mega Drive,a:b21,b:b22,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b26,lefttrigger:b28,rightshoulder:b27,righttrigger:b23,start:b30,x:b24,y:b25,platform:Android, +64363363336633363736393038313464,Mega Drive,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,x:b2,y:b3,platform:Android, +33323763323132376537376266393366,Microsoft Dual Strike,a:b24,b:b23,back:b25,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b27,lefttrigger:b29,rightshoulder:b78,rightx:a0,righty:a1~,start:b26,x:b22,y:b21,platform:Android, +30306461613834333439303734316539,Microsoft SideWinder Pro,a:b0,b:b1,leftshoulder:b20,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b19,righttrigger:b10,start:b17,x:b2,y:b3,platform:Android, +32386235353630393033393135613831,Microsoft Xbox Series Controller,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +4d4f435554452d303533582d4d35312d,Mocute 053X,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +33343361376163623438613466616531,Mocute M053,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +39306635663061636563316166303966,Mocute M053,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +7573622067616d657061642020202020,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Android, +050000007e05000009200000ffff0f00,Nintendo Switch Pro Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b16,x:b17,y:b2,platform:Android, +34323437396534643531326161633738,Nintendo Switch Pro Controller,a:b0,b:b1,back:b15,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,misc1:b5,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +50726f20436f6e74726f6c6c65720000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b2,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b10,rightx:a2,righty:a3,start:b18,y:b3,platform:Android, +36326533353166323965623661303933,NSO N64 Controller,+rightx:b17,+righty:b10,-rightx:b2,-righty:b19,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b3,lefttrigger:b9,leftx:a0,lefty:a1,misc1:b7,rightshoulder:b20,righttrigger:b15,start:b18,platform:Android, +4e363420436f6e74726f6c6c65720000,NSO N64 Controller,+rightx:b17,+righty:b10,-rightx:b2,-righty:b19,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b3,lefttrigger:b9,leftx:a0,lefty:a1,misc1:b7,rightshoulder:b20,righttrigger:b15,start:b18,platform:Android, +534e455320436f6e74726f6c6c657200,NSO SNES Controller,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android, +64623863346133633561626136366634,NSO SNES Controller,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android, +050000005509000003720000cf7f3f00,NVIDIA Controller,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000005509000010720000ffff3f00,NVIDIA Controller,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000005509000014720000df7f3f00,NVIDIA Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Android, +37336435666338653565313731303834,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +4e564944494120436f72706f72617469,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +61363931656135336130663561616264,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +39383335313438623439373538343266,OUYA Controller,a:b0,b:b2,dpdown:b18,dpleft:b15,dpright:b16,dpup:b17,leftshoulder:b3,leftstick:b9,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b10,righttrigger:b7,rightx:a3,righty:a4,x:b1,y:b19,platform:Android, +4f5559412047616d6520436f6e74726f,OUYA Controller,a:b0,b:b2,dpdown:b18,dpleft:b15,dpright:b6,dpup:b17,leftshoulder:b3,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b19,platform:Android, +506572666f726d616e63652044657369,PDP PS3 Rock Candy Controller,a:b1,b:b17,back:h0.2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b16,x:b0,y:b2,platform:Android, +62653335326261303663356263626339,PlayStation Classic Controller,a:b19,b:b1,back:b17,leftshoulder:b9,lefttrigger:b3,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:b20,start:b18,x:b2,y:b0,platform:Android, +61653962353232366130326530363061,Pokken,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,lefttrigger:b9,rightshoulder:b20,righttrigger:b10,start:b18,x:b0,y:b2,platform:Android, +32666633663735353234363064386132,PS2,a:b23,b:b22,back:b29,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b27,lefttrigger:b25,leftx:a0,lefty:a1,rightshoulder:b28,righttrigger:b26,rightx:a3,righty:a2,start:b30,x:b24,y:b21,platform:Android, +050000004c05000068020000dfff3f00,PS3 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +536f6e7920504c415953544154494f4e,PS3 Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +61363034663839376638653463633865,PS3 Controller,a:b0,b:b1,back:b15,dpdown:a14,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +66366539656564653432353139356536,PS3 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +66383132326164626636313737373037,PS3 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000004c050000c405000000783f00,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000004c050000c4050000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android, +050000004c050000c4050000ffff3f00,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000004c050000cc090000fffe3f00,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000004c050000cc090000ffff3f00,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +30303839663330346632363232623138,PS4 Controller,a:b1,b:b17,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android, +31326235383662333266633463653332,PS4 Controller,a:b1,b:b16,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a4,rightx:a2,righty:a5,start:b17,x:b0,y:b2,platform:Android, +31373231336561636235613666323035,PS4 Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +31663838336334393132303338353963,PS4 Controller,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +34613139376634626133336530386430,PS4 Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +35643031303033326130316330353564,PS4 Controller,a:b1,b:b17,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android, +37626233336235343937333961353732,PS4 Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +38393161636261653636653532386639,PS4 Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +536f6e7920496e746572616374697665,PS4 Controller,a:b0,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +576972656c65737320436f6e74726f6c,PS4 Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +63313733393535663339656564343962,PS4 Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +63393662363836383439353064663939,PS4 Controller,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +65366465656364636137653363376531,PS4 Controller,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b0,y:b2,platform:Android, +66613532303965383534396638613230,PS4 Controller,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a5,start:b18,x:b0,y:b2,platform:Android, +050000004c050000e60c0000fffe3f00,PS5 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android, +64336263393933626535303339616332,Qanba 4RAF,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b20,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b3,righttrigger:b9,rightx:a2,righty:a3,start:b18,x:b19,y:b2,platform:Android, +36626666353861663864336130363137,Razer Junglecat,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +62653861643333663663383332396665,Razer Kishi,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000003215000005070000ffff3f00,Razer Raiju Mobile,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000003215000007070000ffff3f00,Razer Raiju Mobile,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000003215000000090000bf7f3f00,Razer Serval,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b2,y:b3,platform:Android, +5a6869587520526574726f2042697420,Retro Bit Saturn Controller,a:b21,b:b22,back:b29,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b25,lefttrigger:b26,rightshoulder:b27,righttrigger:b28,start:b30,x:b23,y:b24,platform:Android, +32417865732031314b6579732047616d,Retro Bit SNES Controller,a:b0,b:b1,back:b15,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b9,rightshoulder:b10,start:b6,x:b2,y:b3,platform:Android, +36313938306539326233393732613361,Retro Bit SNES Controller,a:b0,b:b1,back:b15,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b9,rightshoulder:b10,start:b6,x:b2,y:b3,platform:Android, +526574726f466c616720576972656420,Retro Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b17,rightshoulder:b18,start:b10,x:b2,y:b3,platform:Android, +61343739353764363165343237303336,Retro Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b17,lefttrigger:b18,leftx:a0,lefty:a1,start:b10,x:b2,y:b3,platform:Android, +38653130373365613538333235303036,Retroid Pocket 2,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +64363363336633363736393038313463,Retrolink,a:b1,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b6,platform:Android, +33373336396634316434323337666361,RumblePad 2,a:b22,b:b23,back:b29,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b25,lefttrigger:b27,leftx:a0,lefty:a1,rightshoulder:b26,righttrigger:b28,rightx:a2,righty:a3,start:b30,x:b21,y:b24,platform:Android, +66386565396238363534313863353065,Sanwa Mobile,a:b21,b:b22,leftshoulder:b23,leftx:a0,lefty:a1,rightshoulder:b24,platform:Android, +32383165316333383766336338373261,Saturn,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:a4,righttrigger:a5,x:b2,y:b3,platform:Android, +37316565396364386635383230353365,Saturn,a:b21,b:b22,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b26,lefttrigger:b28,rightshoulder:b27,righttrigger:b23,start:b30,x:b24,y:b25,platform:Android, +38613865396530353338373763623431,Saturn,a:b0,b:b1,leftshoulder:b9,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b20,righttrigger:b19,start:b17,x:b2,y:b3,platform:Android, +61316232336262373631343137633631,Saturn,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:a4,righttrigger:a5,x:b2,y:b3,platform:Android, +30353835333338613130373363646337,SG H510,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b17,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b18,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b19,y:b2,platform:Android, +66386262366536653765333235343634,SG H510,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b2,y:b3,platform:Android, +66633132393363353531373465633064,SG H510,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b17,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b18,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b19,y:b2,platform:Android, +62653761636366393366613135366338,SN30 PP,a:b1,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, +38376662666661636265313264613039,SNES,a:b0,b:b1,back:b9,leftshoulder:b3,leftx:a0,lefty:a1,rightshoulder:b20,start:b10,x:b19,y:b2,platform:Android, +5346432f555342205061640000000000,SNES Adapter,a:b0,b:b1,back:b9,leftshoulder:b3,leftx:a0,lefty:a1,rightshoulder:b20,start:b10,x:b19,y:b2,platform:Android, +5553422047616d657061642000000000,SNES Controller,a:b1,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android, +32633532643734376632656664383733,PS5 Controller,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a5,start:b18,x:b0,y:b2,platform:Android, +61303162353165316365336436343139,PS5 Controller,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a5,start:b18,x:b0,y:b2,platform:Android, +63303964303462366136616266653561,Sony PSP,a:b21,b:b22,back:b27,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b25,leftx:a0,lefty:a1,rightshoulder:b26,start:b28,x:b23,y:b24,platform:Android, +63376637643462343766333462383235,Sony Vita,a:b1,b:b19,back:b17,leftshoulder:b3,leftx:a0,lefty:a1,rightshoulder:b20,rightx:a3,righty:a4,start:b18,x:b0,y:b2,platform:Android, +476f6f676c65204c4c43205374616469,Stadia Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Android, +05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Android, +0500000011010000201400000f7e0f00,SteelSeries Nimbus,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,righttrigger:b10,rightx:a2,righty:a3,x:b19,y:b2,platform:Android, +35306436396437373135383665646464,SteelSeries Nimbus Plus,a:b0,b:b1,leftshoulder:b3,leftstick:b17,lefttrigger:b9,leftx:a0,rightshoulder:b20,rightstick:b18,righttrigger:b10,rightx:a2,x:b19,y:b2,platform:Android, +050000004f0400000ed00000fffe3f00,ThrustMaster eSwap Pro Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +5477696e20555342204a6f7973746963,Twin Joystick,a:b22,b:b21,back:b28,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b26,leftstick:b30,lefttrigger:b24,leftx:a0,lefty:a1,rightshoulder:b27,rightstick:b31,righttrigger:b25,rightx:a3,righty:a2,start:b29,x:b23,y:b20,platform:Android, +30623739343039643830333266346439,Valve Steam Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,leftx:a0,lefty:a1,paddle1:b24,paddle2:b23,rightshoulder:b10,rightstick:b8,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +31643365666432386133346639383937,Valve Steam Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,leftx:a0,lefty:a1,paddle1:b24,paddle2:b23,rightshoulder:b10,rightstick:b8,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +30386438313564306161393537333663,Wii Classic Controller,a:b23,b:b22,back:b29,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b27,lefttrigger:b25,leftx:a0,lefty:a1,rightshoulder:b28,righttrigger:b26,rightx:a2,righty:a3,start:b30,x:b24,y:b21,platform:Android, +33333034646336346339646538643633,Wii Classic Controller,a:b23,b:b22,back:b29,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b27,lefttrigger:b25,leftx:a0,lefty:a1,rightshoulder:b28,righttrigger:b26,rightx:a2,righty:a3,start:b30,x:b24,y:b21,platform:Android, +050000005e0400008e02000000783f00,Xbox 360 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +30396232393162346330326334636566,Xbox 360 Controller,a:b0,b:b1,back:b4,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +38313038323730383864666463383533,Xbox 360 Controller,a:b0,b:b1,back:b4,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +58626f782033363020576972656c6573,Xbox 360 Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +65353331386662343338643939643636,Xbox 360 Controller,a:b0,b:b1,back:b4,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +65613532386633373963616462363038,Xbox 360 Controller,a:b0,b:b1,back:b4,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +47656e6572696320582d426f78207061,Xbox Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +4d6963726f736f667420582d426f7820,Xbox Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +64633436313965656664373634323364,Xbox Controller,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b19,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000005e04000091020000ff073f00,Xbox One Controller,a:b0,b:b1,back:b4,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Android, +050000005e040000e00200000ffe3f00,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b17,y:b2,platform:Android, +050000005e040000e0020000ffff3f00,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b4,leftshoulder:b3,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b17,y:b2,platform:Android, +050000005e040000fd020000ffff3f00,Xbox One Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +33356661323266333733373865656366,Xbox One Controller,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +34356136633366613530316338376136,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,x:b17,y:b2,platform:Android, +35623965373264386238353433656138,Xbox One Controller,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +36616131643361333337396261666433,Xbox One Controller,a:b0,b:b1,back:b15,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +58626f7820576972656c65737320436f,Xbox One Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000005e040000000b000000783f00,Xbox One Elite 2 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Android, +050000005e040000e002000000783f00,Xbox One S Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000005e040000ea02000000783f00,Xbox One S Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000005e040000fd020000ff7f3f00,Xbox One S Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000005e040000120b000000783f00,Xbox Series Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Android, +050000005e040000130b0000ffff3f00,Xbox Series Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +65633038363832353634653836396239,Xbox Series Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000001727000044310000ffff3f00,XiaoMi Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a6,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Android, + +# iOS +05000000ac0500000100000000006d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS, +05000000ac050000010000004f066d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS, +05000000ac05000001000000cf076d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS, +05000000ac05000001000000df076d01,*,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS, +05000000ac05000001000000ff076d01,*,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS, +05000000ac0500000200000000006d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS, +05000000ac050000020000004f066d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS, +4d466947616d65706164010000000000,MFi Extended Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:iOS, +4d466947616d65706164020000000000,MFi Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,platform:iOS, +050000004c050000cc090000df070000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS, +050000004c050000cc090000df870001,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS, +050000004c050000cc090000ff070000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS, +050000004c050000cc090000ff870001,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,touchpad:b11,x:b2,y:b3,platform:iOS, +050000004c050000cc090000ff876d01,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS, +050000004c050000e60c0000df870000,PS5 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,touchpad:b10,x:b2,y:b3,platform:iOS, +050000004c050000e60c0000ff870000,PS5 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,touchpad:b11,x:b2,y:b3,platform:iOS, +05000000ac0500000300000000006d03,Remote,a:b0,b:b2,leftx:a0,lefty:a1,platform:iOS, +05000000ac0500000300000043006d03,Remote,a:b0,b:b2,leftx:a0,lefty:a1,platform:iOS, +05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS, +05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS, +050000005e040000050b0000df070001,Xbox Elite Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b10,paddle2:b12,paddle3:b11,paddle4:b13,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS, +050000005e040000050b0000ff070001,Xbox Elite Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b13,paddle3:b12,paddle4:b14,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS, +050000005e040000e0020000df070000,Xbox One Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS, +050000005e040000e0020000ff070000,Xbox One Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS, +050000005e040000130b0000df870001,Xbox Series X Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b10,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS, +050000005e040000130b0000ff870001,Xbox Series X Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS, diff --git a/game/assets/subtitle/jak1/game_subtitle_en.txt b/game/assets/subtitle/jak1/game_subtitle_en.txt deleted file mode 100644 index a42d6e1581..0000000000 --- a/game/assets/subtitle/jak1/game_subtitle_en.txt +++ /dev/null @@ -1,111 +0,0 @@ -(language-id 0 6) - -;; ----------------- -;; oracle - -("oracle-right-eye-1" (0 #f "ORACLE" "FOR YOUR GIFT, ANOTHER POWER CELL IS YOURS.")) -("oracle-left-eye-1" (0 #f "ORACLE" "YOU HAVE PROVEN YOURSELF WORTHY. HERE IS A POWER CELL.")) -("oracle-right-eye-2" (0 #f "ORACLE" "HERE IS ANOTHER POWER CELL FOR YOUR QUEST.")) -("oracle-left-eye-2" (0 #f "ORACLE" "FOR YOUR SACRIFICE, I OFFER YOU A POWER CELL.")) -("oracle-right-eye-3" (0 #f "ORACLE" "YOU HAVE OBTAINED ANOTHER POWER CELL.")) -("oracle-left-eye-3" (0 #f "ORACLE" "FOR YOUR EFFORT, A POWER CELL IS THE REWARD.")) - -;; ----------------- -;; swamp - -("billy-introduction" - (6 #f "BILLY" "HOWDY, FRIENDS! ENJOYIN' MY BEAUTIFUL SWAMP? I OWN THESE HERE PARTS. EVERYTHING THAT DOESN'T SINK INTO THE MUD, THAT IS! (LAUGHS)") - (349 #f "" "") - (369 #f "DAXTER" "JUDGING BY THE SMELL, I'D WAGER YOUR BATHTUB SANK IN THE MUD LONG AGO.") - (497 #f "" "") - (519 #f "BILLY" "WHAT'S A BATHTUB? ANYWAY I GOT BIGGER PROBLEMS NOW...") - (677 #f "" "") - (691 #f "BILLY" "SEEMS SOME NASTY LURKER VARMINTS ARE GROUSIN' ABOUTS SNATCHIN' EVERYTHING THEY CAN GET THEIR GRUBBY LITTLE PAWS ON.") - (910 #f "BILLY" "AND SCARED AWAY MY PET HIPHOG, FARTHY.") - (1000 #f "BILLY" "HE'S BEEN MISSIN' FOR NIGH ON TO A COON'S AGE.") - (1136 #t "BILLY" "I'VE BEEN PUTTIN' OUT HIS FAVORITE SNACK, BUT THOSE ORNERY SWAMP RATS KEEP STEALIN' EM!") - (1318 #t "BILLY" "IF YOU COULD KEEP THOSE PESKY CRITTERS AWAY LONG ENOUGH, I JUST KNOW FARTHY WOULD SMELL THEM VITTLES AND COME BACK!") - (1509 #f "" "") - (1527 #f "BILLY" "WILL YA HELP ME OUT?") - ) - -("billy-reject" - (7 #f "BILLY" "WELL, IF YOU CHANGE YOUR MIND, YOU KNOW WHERE TO FIND ME! (LAUGHS)") - ) - -("billy-accept" - (5 #f "BILLY" "GOOD! THOSE RATS WILL BE BACK ANYTIME.") - (109 #f "BILLY" "SHOOT ALL THEM RATS, AND KEEP 'EM FROM EATING AT LEAST ONE OF THEM SNACKS.") - ) - -("billy-resolution" - (1 #f "BILLY" "WELL FRY MY HIDE! YOU SURE KNOW HOW TO SHOOT! THANKS A HEAP FOR THE HELP.") - ) - -("billy-reminder-1" - (36 #f "BILLY" "AHH, Y'ALL BACK TO HELP STOP THEM RATS?") - ) - -;; ----------------- -;; citadel - -("green-sagecage-introduction" - (130 #f "SAGE" "IT'S ABOUT TIME YOU TWO DECIDED TO SHOW UP!") - (207 #f "DAXTER" "NICE TO SEE YOU TOO! DO THEY HAVE YOU MOPPING THE FLOORS NOW?") - (343 #f "SAGE" "THERE'S NO TIME FOR JOKES, DAXTER. GOL AND MAIA KIDNAPPED US TO SAP OUR ENERGIES TO POWER THEIR ABOMINABLE MACHINE.") - (574 #t "SAGE" "IT APPEARS THEY HAVE COMBINED THE FUNCTIONAL REMAINS OF A PRECURSOR ROBOT WITH SCAVENGED ARTIFACTS FROM ACROSS THE LAND.") - (800 #t "SAGE" "THEN THEY ADDED A FEW DIABOLICAL ADDITIONS OF THEIR OWN, CREATING THE ONE THING CAPABLE OF OPENING THE DARK ECO SILOS.") - (1060 #f "SAGE" "IF YOU CAN FREE THE FOUR OF US, WE CAN USE OUR COMBINED POWERS") - (1180 #f "SAGE" "TO BREAK THE FORCE SHIELD SURROUNDING THE ROBOT, BEFORE THEY USE IT TO DESTROY THE WORLD.") - ) - -("redsage-resolution" - (60 #f "RED SAGE" "(CHUCKLES) YOU'VE FINALLY COME TO RESCUE ME.") - (190 #f "RED SAGE" "DO YOU KNOW HOW LONG I'VE BEEN IN HERE? WHAT TOOK YOU SO LONG, YOU KNOW? (CHUCKLES) WHAT ARE YOUR NAMES?") - (429 #f "DAXTER" "I'M DAXTER! HE'S JAK, HE'S WITH ME.") - (540 #t "RED SAGE" "GOOD JOB, DAXTER. YOU'RE A REAL HERO.") - (670 #f "" "") - (700 #f "RED SAGE" "YOU'VE GOT TO STOP GOL FROM LAUNCHING THE ROBOT. I'LL USE MY ECO POWER TO HELP OPEN THE SHIELD DOOR.") - ) - -("bluesage-resolution" - (60 #f "BLUE SAGE" "GOOD WORK, FELLOWS! OLD SAMOS WAS RIGHT ABOUT YOU!") - (165 #f "BLUE SAGE" "GREAT PILES OF PRECURSOR METAL! THAT INSIDIOUS MECHANICAL CREATION MUST NOT BE ALLOWED TO WREAK ITS TERRIBLE HAVOC!") - (420 #f "BLUE SAGE" "I WILL TRY TO ACTUATE THE SHIELD DOOR BY ELLICITING A CONDUIT OF ENERGY BETWEEN MYSELF AND THE VAST PORTAL BELOW!") - (666 #f "DAXTER" "UH... YEAH. YOU DO THAT. WE'LL UH... JUST GO FIND MORE HELP.") - (873 #f "" "") - (891 #t "DAXTER" "WEIRDO!") - (980 #f "" "") - ) - -("yellowsage-resolution" - (50 #f "YELLOW SAGE" "WHO WOULDA THOUGHT I'D LIVE TO SEE THE DAY WHEN I NEEDED TO BE RESCUED BY A BOY AND HIS MUSKRAT!") - (271 #f "YELLOW SAGE" "(SIGHS) I'M GONNA GIVE GOL AND MAIA A LITTLE PAYBACK FOR THIS EMBARRASSMENT!") - (480 #f "YELLOW SAGE" "THEN WE'LL SEE ABOUT COOKING UP SOME MUSKRAT STEW...") - (606 #f "" "") - ) - -("green-sagecage-resolution" - (30 #f "SAGE" "GOOD WORK, BOYS! YOU'RE REAL HEROES NOW. I'LL COMBINE MY GREEN ECO POWER WITH THE OTHER THREE SAGES") - (284 #f "SAGE" "AND TOGETHER WE'LL OPEN THE SHIELD DOOR SURROUNDING THE PRECURSOR ROBOT.") - (405 #f "DAXTER" "YEAH YEAH THAT SOUNDS LIKE A GOOD START. AND THEN AFTER YOU GUYS OPEN THAT SHIELD, WHAT ARE YOU GONNA DO ABOUT THE ROBOT?") - (576 #f "SAGE" "NOTHING, DAXTER. WE HAVE TO KEEP THE SHIELD OPEN, IT'S UP TO YOU TWO TO FIGURE OUT HOW TO DESTROY THE ROBOT.") - (823 #f "DAXTER" "OH, GREAT. I GET TO HELP THE GUY THAT TURNED ME INTO A FURBALL DESTROY THE ONLY PERSON WHO CAN TURN ME BACK!") - (1111 #f "" "") - (1156 #f "SAGE" "FIRST, SAVE THE WORLD! THEN WE'LL TRY TO CONVINCE GOL TO HELP DAXTER.") - ) - -("green-sagecage-outro-preboss" - (50 #f "GOL" "YOU'RE TOO LATE, SAMOS. ONCE I POSSESS LIMITLESS DARK ECO, I WILL HAVE THE KEY TO CREATION ITSELF!") - (335 #f "SAGE" "THIS IS MADNESS! RELEASING THAT MUCH DARK ECO WILL DESTROY EVERYTHING WE KNOW!") - (485 #f "SAGE" "JUST LOOK WHAT IT'S DONE TO YOU!") - (581 #f "MAIA" "IT HAS GIVEN US A BEAUTY BEYOND ANYTHING YOU COULD UNDERSTAND.") - (696 #f "DAXTER" "BEAUTY? HAVE YOU TWO LOOKED IN A MIRROR LATELY?") - (828 #f "MAIA" "JUST WAIT UNTIL WE OPEN THE SILOS, LITTLE ONE. YOU THINK SHORT AND FUZZY IS BAD?") - (1017 #f "GOL" "AND TO THINK, YOU TWO TRAVELLED ALL THIS WAY FOR MY HELP.") - (1180 #f "GOL" "FOOLS! ENJOY YOUR FRONT ROW SEATS TO THE RECREATION OF THE WORLD!") - (1382 #f "" "") - (1605 #f "SAGE" "JAK! TAKE THE ELEVATOR UP AND STOP THAT ROBOT!") - ) - - diff --git a/game/assets/subtitle/jak1/game_subtitle_es.txt b/game/assets/subtitle/jak1/game_subtitle_es.txt deleted file mode 100644 index 718a7af3ab..0000000000 --- a/game/assets/subtitle/jak1/game_subtitle_es.txt +++ /dev/null @@ -1,6 +0,0 @@ -(language-id 3) - -;; ----------------- -;; oracle - -("oracle-left-eye-1" (0 #f "ORÁCULO" "HABÉIS DEMOSTRADO SER HONESTOS. É AQUÍ UNA BATERÍA.")) diff --git a/game/common/dgo_rpc_types.h b/game/common/dgo_rpc_types.h index 18d15a2fc6..0890a3407e 100644 --- a/game/common/dgo_rpc_types.h +++ b/game/common/dgo_rpc_types.h @@ -6,8 +6,9 @@ */ #include "common/common_types.h" +#include "common/versions.h" -constexpr int DGO_RPC_ID = 0xdeb4; +constexpr PerGameVersion DGO_RPC_ID(0xdeb4, 0xfab3); constexpr int DGO_RPC_CHANNEL = 3; constexpr int DGO_RPC_LOAD_FNO = 0; constexpr int DGO_RPC_LOAD_NEXT_FNO = 1; diff --git a/game/common/loader_rpc_types.h b/game/common/loader_rpc_types.h index 1deee886fa..c7dc7d420b 100644 --- a/game/common/loader_rpc_types.h +++ b/game/common/loader_rpc_types.h @@ -5,5 +5,7 @@ * Types used for the Loader Remote Procedure Call between the EE and the IOP */ -constexpr int LOADER_RPC_ID = 0xdeb2; +#include "common/versions.h" + +constexpr PerGameVersion LOADER_RPC_ID(0xdeb2, 0xfab1); constexpr int LOADER_RPC_CHANNEL = 1; diff --git a/game/common/play_rpc_types.h b/game/common/play_rpc_types.h index 72521275a0..b9bd6039c2 100644 --- a/game/common/play_rpc_types.h +++ b/game/common/play_rpc_types.h @@ -5,6 +5,7 @@ * Types used for the play Remote Procedure Call between the EE and the IOP. * Note that PLAY and PLAYER are different. */ +#include "common/versions.h" -constexpr int PLAY_RPC_ID = 0xdeb6; +constexpr PerGameVersion PLAY_RPC_ID(0xdeb6, 0xfab5); constexpr int PLAY_RPC_CHANNEL = 5; diff --git a/game/common/player_rpc_types.h b/game/common/player_rpc_types.h index 2c2d0f1fb5..6e7dfa0503 100644 --- a/game/common/player_rpc_types.h +++ b/game/common/player_rpc_types.h @@ -5,11 +5,7 @@ * Types used for the player Remote Procedure Call between the EE and the IOP. * Note that PLAY and PLAYER are different. */ +#include "common/versions.h" -#ifndef JAK1_PLAYER_RPC_TYPES_H -#define JAK1_PLAYER_RPC_TYPES_H - -constexpr int PLAYER_RPC_ID = 0xdeb1; +constexpr PerGameVersion PLAYER_RPC_ID(0xdeb1, 0xfab0); constexpr int PLAYER_RPC_CHANNEL = 0; - -#endif // JAK1_PLAYER_RPC_TYPES_H diff --git a/game/common/ramdisk_rpc_types.h b/game/common/ramdisk_rpc_types.h index bc02176a88..2a990b5f03 100644 --- a/game/common/ramdisk_rpc_types.h +++ b/game/common/ramdisk_rpc_types.h @@ -6,8 +6,9 @@ */ #include "common/common_types.h" +#include "common/versions.h" -constexpr int RAMDISK_RPC_ID = 0xdeb3; +constexpr PerGameVersion RAMDISK_RPC_ID(0xdeb3, 0xfab2); constexpr int RAMDISK_RPC_CHANNEL = 2; constexpr int RAMDISK_GET_DATA_FNO = 0; constexpr int RAMDISK_RESET_AND_LOAD_FNO = 1; diff --git a/game/common/str_rpc_types.h b/game/common/str_rpc_types.h index 803a48d9e3..d461176cd5 100644 --- a/game/common/str_rpc_types.h +++ b/game/common/str_rpc_types.h @@ -1,9 +1,11 @@ #pragma once #include "common/common_types.h" +#include "common/versions.h" + #include "game/common/overlord_common.h" -constexpr int STR_RPC_ID = 0xdeb5; +constexpr PerGameVersion STR_RPC_ID(0xdeb5, 0xfab4); constexpr int STR_RPC_CHANNEL = 4; struct RPC_Str_Cmd { @@ -17,7 +19,12 @@ struct RPC_Str_Cmd { }; struct RPC_Play_Cmd { - u8 pad[1024]; // TODO everything + u16 rsvd; + u16 result; + u32 address; + u32 section; + u32 maxlen; + char name[48]; }; constexpr int STR_RPC_RESULT_ERROR = 1; diff --git a/game/common/vu.h b/game/common/vu.h index c8b3946264..ffecbdda5b 100644 --- a/game/common/vu.h +++ b/game/common/vu.h @@ -1,8 +1,12 @@ #pragma once -#include "immintrin.h" -#include "common/math/Vector.h" #include +#include "immintrin.h" + +#include "common/common_types.h" +#include "common/math/Vector.h" +#include "common/util/Assert.h" + enum class Mask { NONE = 0, x = 1, @@ -528,6 +532,14 @@ struct alignas(16) Accumulator { } } + void msuba(Mask mask, const Vf& a, float b) { + for (int i = 0; i < 4; i++) { + if ((u64)mask & (1 << i)) { + data[i] -= a[i] * b; + } + } + } + u16 madd_flag(Mask mask, Vf& dest, const Vf& a, float b) { u16 result = 0; for (int i = 0; i < 4; i++) { diff --git a/game/discord.cpp b/game/discord.cpp index 99d3a39e34..f1aeba9085 100644 --- a/game/discord.cpp +++ b/game/discord.cpp @@ -1,31 +1,38 @@ -#include -#include -#include - #include "discord.h" +#include +#include +#include +#include +#include + int gDiscordRpcEnabled; int64_t gStartTime; static const char* APPLICATION_ID = "938876425585434654"; -static std::map jak1_level_names = {{"intro", "Intro"}, - {"title", "Title screen"}, - {"training", "Geyser Rock"}, - {"village1", "Sandover Village"}, - {"beach", "Sentinel Beach"}, - {"jungle", "Forbidden Jungle"}, - {"misty", "Misty Island"}, - {"firecanyon", "Fire Canyon"}, - {"village2", "Rock Village"}, - {"swamp", "Boggy Swamp"}, - {"rolling", "Precursor Basin"}, - {"sunken", "Lost Precursor City"}, - {"ogre", "Mountain Pass"}, - {"village3", "Volcanic Crater"}, - {"snow", "Snowy Mountain"}, - {"maincave", "Spider Cave"}, - {"lavatube", "Lava Tube"}, - {"citadel", "Gol and Maia's Citadel"}, - {"finalboss", "Final Boss"}}; +static const std::map jak1_level_names = { + {"intro", "Intro"}, + {"title", "Title screen"}, + {"training", "Geyser Rock"}, + {"village1", "Sandover Village"}, + {"beach", "Sentinel Beach"}, + {"jungle", "Forbidden Jungle"}, + {"misty", "Misty Island"}, + {"firecanyon", "Fire Canyon"}, + {"village2", "Rock Village"}, + {"swamp", "Boggy Swamp"}, + {"rolling", "Precursor Basin"}, + {"sunken", "Lost Precursor City"}, + {"ogre", "Mountain Pass"}, + {"village3", "Volcanic Crater"}, + {"snow", "Snowy Mountain"}, + {"maincave", "Spider Cave"}, + {"lavatube", "Lava Tube"}, + {"citadel", "Gol and Maia's Citadel"}, + {"finalboss", "Final Boss"}}; +static const std::map jak1_level_name_remap = {{"jungleb", "jungle"}, + {"sunkenb", "sunken"}, + {"robocave", "maincave"}, + {"darkcave", "maincave"}}; void init_discord_rpc() { gDiscordRpcEnabled = 1; @@ -47,21 +54,48 @@ void set_discord_rpc(int state) { // get full level name from symbol name ("village1" -> "Sandover Village") const char* jak1_get_full_level_name(const char* level_name) { // ignore sublevels - if (!strcmp(level_name, "jungleb")) { - level_name = "jungle"; - } else if (!strcmp(level_name, "sunkenb")) { - level_name = "sunken"; - } else if (!strcmp(level_name, "darkcave") || !strcmp(level_name, "robocave")) { - level_name = "maincave"; - } + auto it = jak1_level_name_remap.find(level_name); + auto actual_level_name = it == jak1_level_name_remap.end() ? level_name : it->second; - const auto& nice_name = jak1_level_names.find(level_name); + const auto& nice_name = jak1_level_names.find(actual_level_name); if (nice_name != jak1_level_names.end()) { return nice_name->second.c_str(); } - return "Unknown"; + return "unknown"; }; +// time of day string to append to level name for icons +const char* time_of_day_str(float time) { + int hour = static_cast(time); + + if (hour >= 0 && hour <= 9) + return "green-sun"; + else if (hour < 22) + return "day"; + else if (hour < 25) + return "evening"; + else + return ""; +} + +// convert time of day float to a 24-hour hh:mm format string +std::string get_time_of_day(float time) { + int hour = static_cast(time); + int minutes = static_cast((time - hour) * 60); + std::stringstream ss; + ss << hour << ':' << std::setw(2) << std::setfill('0') << minutes; + return ss.str(); +} + +// are we in an area that's indoors, i.e. not affected by time of day? +int indoors(const char* level_name) { + return !strcmp(level_name, "intro") || !strcmp(level_name, "title") || + !strcmp(level_name, "jungleb") || !strcmp(level_name, "sunken") || + !strcmp(level_name, "sunkenb") || !strcmp(level_name, "maincave") || + !strcmp(level_name, "robocave") || !strcmp(level_name, "darkcave") || + !strcmp(level_name, "lavatube") || !strcmp(level_name, "citadel"); +} + void handleDiscordReady(const DiscordUser* user) { printf("\nDiscord: connected to user %s#%s - %s\n", user->username, user->discriminator, user->userId); diff --git a/game/discord.h b/game/discord.h index 7d5eed58ac..4a5498a927 100644 --- a/game/discord.h +++ b/game/discord.h @@ -1,10 +1,15 @@ #pragma once +#include + #include "third-party/discord-rpc/include/discord_rpc.h" void init_discord_rpc(); void set_discord_rpc(int state); const char* jak1_get_full_level_name(const char* level_name); +const char* time_of_day_str(float time); +std::string get_time_of_day(float time); +int indoors(const char* level_name); void handleDiscordReady(const DiscordUser* user); void handleDiscordDisconnected(int errcode, const char* message); diff --git a/game/graphics/display.cpp b/game/graphics/display.cpp index a7248945d6..d492025084 100644 --- a/game/graphics/display.cpp +++ b/game/graphics/display.cpp @@ -4,6 +4,7 @@ */ #include "display.h" + #include "gfx.h" #include "common/log/log.h" @@ -16,10 +17,6 @@ namespace { -bool renderer_is_correct(const GfxRendererModule* renderer, GfxPipeline pipeline) { - return renderer->pipeline == pipeline; -} - void set_main_display(std::shared_ptr display) { if (Display::g_displays.size() > 0) { Display::g_displays[0] = display; @@ -36,66 +33,27 @@ void set_main_display(std::shared_ptr display) { ******************************** */ -GfxDisplay::GfxDisplay(GLFWwindow* a_window) { - set_renderer(GfxPipeline::OpenGL); - set_window(a_window); -} - -GfxDisplay::~GfxDisplay() { - m_renderer->kill_display(this); - // window_generic_ptr = nullptr; -} - -void GfxDisplay::set_renderer(GfxPipeline pipeline) { - if (is_active()) { - lg::error("Can't change display's renderer while window exists."); - return; - } - if (m_renderer != nullptr) { - lg::error("A display changed renderer unexpectedly."); - return; - } - - m_renderer = Gfx::GetRenderer(pipeline); -} - -void GfxDisplay::set_window(GLFWwindow* window) { - if (!renderer_is_correct(m_renderer, GfxPipeline::OpenGL)) { - lg::error("Can't set OpenGL window when using {}", m_renderer->name); - return; - } - if (is_active()) { - lg::error("Already have a window. Close window first."); - return; - } - - this->window_glfw = window; -} - void GfxDisplay::set_title(const char* title) { if (!is_active()) { lg::error("No window to set title `{}`.", title); return; } + // TODO set title? m_title = title; } -void GfxDisplay::render_graphics() { - m_renderer->render_display(this); -} - int GfxDisplay::width() { int w; - m_renderer->display_size(this, &w, NULL); + get_size(&w, NULL); return w; } int GfxDisplay::height() { int h; - m_renderer->display_size(this, NULL, &h); + get_size(NULL, &h); #ifdef _WIN32 - if (fullscreen_mode() == 2) { + if (last_fullscreen_mode() == GfxDisplayMode::Borderless) { // windows borderless hack h--; } @@ -103,17 +61,9 @@ int GfxDisplay::height() { return h; } -void GfxDisplay::set_size(int w, int h) { - m_renderer->display_set_size(this, w, h); -} - -void GfxDisplay::get_scale(float* x, float* y) { - m_renderer->display_scale(this, x, y); -} - void GfxDisplay::backup_params() { - m_renderer->display_size(this, &m_width, &m_height); - m_renderer->display_position(this, &m_xpos, &m_ypos); + get_size(&m_width, &m_height); + get_position(&m_xpos, &m_ypos); fmt::print("backed up window: {},{} {}x{}\n", m_xpos, m_ypos, m_width, m_height); } @@ -138,11 +88,12 @@ int InitMainDisplay(int width, int height, const char* title, GfxSettings& setti return 1; } - auto display = Gfx::GetCurrentRenderer()->make_main_display(width, height, title, settings); + auto display = Gfx::GetCurrentRenderer()->make_display(width, height, title, settings, true); if (display == NULL) { lg::error("Failed to make main display."); return 1; } + display->set_imgui_visible(true); set_main_display(display); return 0; } diff --git a/game/graphics/display.h b/game/graphics/display.h index a811dacb92..26508c14d6 100644 --- a/game/graphics/display.h +++ b/game/graphics/display.h @@ -5,19 +5,20 @@ * Display for graphics. This is the game window, distinct from the runtime console. */ -#include "pipelines/opengl.h" -#include "gfx.h" -#include #include +#include + +#include "gfx.h" + +#include "common/util/Assert.h" // a GfxDisplay class is equivalent to a window that displays stuff. This holds an actual internal // window pointer used by whichever renderer. It also contains functions for setting and // retrieving certain window parameters. +// Maybe this is better implemented as an abstract class and renderers would have overrides? class GfxDisplay { const char* m_title; - const GfxRendererModule* m_renderer = nullptr; - // NOT actual size! just backups int m_width; int m_height; @@ -25,52 +26,59 @@ class GfxDisplay { int m_xpos; int m_ypos; - int m_fullscreen_mode = 0; + GfxDisplayMode m_fullscreen_target_mode = GfxDisplayMode::Windowed; + GfxDisplayMode m_last_fullscreen_mode; int m_fullscreen_screen; - int m_fullscreen_target_mode = 0; int m_fullscreen_target_screen; + bool m_imgui_visible; + + protected: + bool m_main; public: - GfxDisplay(GLFWwindow* a_window); // OpenGL window constructor - ~GfxDisplay(); // destructor - this calls the renderer's function for getting rid of a window, - // and we can then get rid of the GfxDisplay itself + virtual ~GfxDisplay() {} - // all kinds of windows for the display - union { - void* window_generic_ptr = nullptr; - GLFWwindow* window_glfw; - }; - - bool is_active() const { return window_generic_ptr != nullptr; } - void set_renderer(GfxPipeline pipeline); - void set_window(GLFWwindow* window); + virtual void* get_window() const = 0; + virtual void set_size(int w, int h) = 0; + virtual void update_fullscreen(GfxDisplayMode mode, int screen) = 0; + virtual void get_scale(float* x, float* y) = 0; + virtual int get_screen_vmode_count() = 0; + virtual void get_screen_size(int vmode_idx, s32* w, s32* h) = 0; + virtual int get_screen_rate(int vmode_idx) = 0; + virtual void get_position(int* x, int* y) = 0; + virtual void get_size(int* w, int* h) = 0; + virtual GfxDisplayMode get_fullscreen() = 0; + virtual void render() = 0; + virtual void set_lock(bool lock) = 0; + virtual bool minimized() = 0; + bool is_active() const { return get_window() != nullptr; } void set_title(const char* title); - void set_size(int w, int h); - void get_scale(float* w, float* h); const char* title() const { return m_title; } - bool fullscreen_pending() { return m_fullscreen_mode != m_fullscreen_target_mode; } + bool fullscreen_pending() { return get_fullscreen() != m_fullscreen_target_mode; } void fullscreen_flush() { - m_renderer->set_fullscreen(this, m_fullscreen_target_mode, m_fullscreen_target_screen); - m_fullscreen_mode = m_fullscreen_target_mode; + update_fullscreen(m_fullscreen_target_mode, m_fullscreen_target_screen); + // TODO no m_fullscreen_screen = m_fullscreen_target_screen; } - void set_fullscreen(int mode, int screen) { + void set_fullscreen(GfxDisplayMode mode, int screen) { m_fullscreen_target_mode = mode; m_fullscreen_target_screen = screen; } - int fullscreen_mode() { return m_fullscreen_mode; } - int fullscreen_screen() { return m_fullscreen_screen; } + void update_last_fullscreen_mode() { m_last_fullscreen_mode = get_fullscreen(); } + GfxDisplayMode last_fullscreen_mode() const { return m_last_fullscreen_mode; } + int fullscreen_screen() const { return m_fullscreen_screen; } + void set_imgui_visible(bool visible) { m_imgui_visible = visible; } + bool is_imgui_visible() const { return m_imgui_visible; } + bool windowed() { return get_fullscreen() == GfxDisplayMode::Windowed; } void backup_params(); - int width_backup() { return m_width; } - int height_backup() { return m_height; } - int xpos_backup() { return m_xpos; } - int ypos_backup() { return m_ypos; } + int width_backup() const { return m_width; } + int height_backup() const { return m_height; } + int xpos_backup() const { return m_xpos; } + int ypos_backup() const { return m_ypos; } int width(); int height(); - - void render_graphics(); }; namespace Display { diff --git a/game/graphics/gfx.cpp b/game/graphics/gfx.cpp index 50813fb627..b1cecce2c4 100644 --- a/game/graphics/gfx.cpp +++ b/game/graphics/gfx.cpp @@ -3,21 +3,24 @@ * Graphics component for the runtime. Abstraction layer for the main graphics routines. */ -#include -#include -#include - #include "gfx.h" -#include "display.h" -#include "pipelines/opengl.h" -#include "common/symbols.h" +#include +#include +#include + +#include "display.h" + #include "common/log/log.h" +#include "common/symbols.h" #include "common/util/FileUtil.h" + #include "game/common/file_paths.h" -#include "game/kernel/kscheme.h" +#include "game/kernel/common/kscheme.h" +#include "game/kernel/svnrev.h" #include "game/runtime.h" #include "game/system/newpad.h" +#include "pipelines/opengl.h" namespace { // initializes a gfx settings. @@ -55,6 +58,7 @@ GfxSettings g_settings; void LoadSettings() { const auto filename = file_util::get_file_path({GAME_CONFIG_DIR_NAME, SETTINGS_GFX_FILE_NAME}); if (std::filesystem::exists(filename)) { + // this is just wrong LOL FILE* fp = fopen(filename.c_str(), "rb"); lg::info("Found graphics configuration file. Checking version."); u64 version; @@ -83,13 +87,12 @@ void SaveSettings() { const GfxRendererModule* GetRenderer(GfxPipeline pipeline) { switch (pipeline) { case GfxPipeline::Invalid: - lg::error("Requested invalid graphics pipeline!"); + lg::error("Requested invalid renderer", pipeline); return NULL; - break; case GfxPipeline::OpenGL: - return &moduleOpenGL; + return &gRendererOpenGL; default: - lg::error("Unknown graphics pipeline {}", (u64)pipeline); + lg::error("Requested unknown renderer {}", (u64)pipeline); return NULL; } } @@ -119,9 +122,10 @@ u32 Init() { } if (g_main_thread_id != std::this_thread::get_id()) { - lg::warn("Ran Gfx::Init outside main thread. Init display elsewhere?"); + lg::error("Ran Gfx::Init outside main thread. Init display elsewhere?"); } else { - Display::InitMainDisplay(640, 480, "OpenGOAL GL Window", g_settings); + Display::InitMainDisplay( + 640, 480, fmt::format("OpenGOAL - Work in Progress - {}", GIT_VERSION).c_str(), g_settings); } return 0; @@ -133,7 +137,7 @@ void Loop(std::function f) { // check if we have a display if (Display::GetMainDisplay()) { // lg::debug("run display"); - Display::GetMainDisplay()->render_graphics(); + Display::GetMainDisplay()->render(); } } } @@ -184,7 +188,9 @@ void set_levels(const std::vector& levels) { } void poll_events() { - GetCurrentRenderer()->poll_events(); + if (GetCurrentRenderer()) { + GetCurrentRenderer()->poll_events(); + } } u64 get_window_width() { @@ -215,19 +221,61 @@ void get_window_scale(float* x, float* y) { } } +GfxDisplayMode get_fullscreen() { + if (Display::GetMainDisplay()) { + return Display::GetMainDisplay()->get_fullscreen(); + } else { + return GfxDisplayMode::Windowed; + } +} + +int get_screen_vmode_count() { + if (Display::GetMainDisplay()) { + return Display::GetMainDisplay()->get_screen_vmode_count(); + } + return 0; +} + +int get_screen_rate(s64 vmode_idx) { + if (Display::GetMainDisplay()) { + return Display::GetMainDisplay()->get_screen_rate(vmode_idx); + } + return 0; +} + +void get_screen_size(s64 vmode_idx, s32* w, s32* h) { + if (Display::GetMainDisplay()) { + Display::GetMainDisplay()->get_screen_size(vmode_idx, w, h); + } +} + +void set_vsync(bool vsync) { + g_global_settings.vsync = vsync; +} + +void set_frame_rate(int rate) { + g_global_settings.target_fps = rate; +} + void set_letterbox(int w, int h) { g_global_settings.lbox_w = w; g_global_settings.lbox_h = h; } -void set_fullscreen(int mode, int screen) { +void set_fullscreen(GfxDisplayMode mode, int screen) { if (Display::GetMainDisplay()) { Display::GetMainDisplay()->set_fullscreen(mode, screen); } } +void set_window_lock(bool lock) { + if (Display::GetMainDisplay()) { + Display::GetMainDisplay()->set_lock(lock); + } +} + void input_mode_set(u32 enable) { - if (enable == s7.offset + FIX_SYM_TRUE) { // #t + if (enable == s7.offset + jak1_symbols::FIX_SYM_TRUE) { // #t Pad::g_input_mode_mapping = g_settings.pad_mapping_info; Pad::EnterInputMode(); } else { @@ -276,4 +324,76 @@ void SetLod(RendererTreeType tree, int lod) { } } +bool CollisionRendererGetMask(GfxGlobalSettings::CollisionRendererMode mode, int mask_id) { + int arr_idx = mask_id / 32; + int arr_ofs = mask_id % 32; + + switch (mode) { + case GfxGlobalSettings::CollisionRendererMode::Mode: + return (g_global_settings.collision_mode_mask[arr_idx] >> arr_ofs) & 1; + case GfxGlobalSettings::CollisionRendererMode::Event: + return (g_global_settings.collision_event_mask[arr_idx] >> arr_ofs) & 1; + case GfxGlobalSettings::CollisionRendererMode::Material: + return (g_global_settings.collision_material_mask[arr_idx] >> arr_ofs) & 1; + case GfxGlobalSettings::CollisionRendererMode::Skip: + ASSERT(arr_idx == 0); + return (g_global_settings.collision_skip_mask >> arr_ofs) & 1; + default: + lg::error("{} invalid params {} {}", __PRETTY_FUNCTION__, mode, mask_id); + return false; + } +} + +void CollisionRendererSetMask(GfxGlobalSettings::CollisionRendererMode mode, int mask_id) { + int arr_idx = mask_id / 32; + int arr_ofs = mask_id % 32; + + switch (mode) { + case GfxGlobalSettings::CollisionRendererMode::Mode: + g_global_settings.collision_mode_mask[arr_idx] |= 1 << arr_ofs; + break; + case GfxGlobalSettings::CollisionRendererMode::Event: + g_global_settings.collision_event_mask[arr_idx] |= 1 << arr_ofs; + break; + case GfxGlobalSettings::CollisionRendererMode::Material: + g_global_settings.collision_material_mask[arr_idx] |= 1 << arr_ofs; + break; + case GfxGlobalSettings::CollisionRendererMode::Skip: + ASSERT(arr_idx == 0); + g_global_settings.collision_skip_mask |= 1 << arr_ofs; + break; + default: + lg::error("{} invalid params {} {}", __PRETTY_FUNCTION__, mode, mask_id); + break; + } +} + +void CollisionRendererClearMask(GfxGlobalSettings::CollisionRendererMode mode, int mask_id) { + int arr_idx = mask_id / 32; + int arr_ofs = mask_id % 32; + + switch (mode) { + case GfxGlobalSettings::CollisionRendererMode::Mode: + g_global_settings.collision_mode_mask[arr_idx] &= ~(1 << arr_ofs); + break; + case GfxGlobalSettings::CollisionRendererMode::Event: + g_global_settings.collision_event_mask[arr_idx] &= ~(1 << arr_ofs); + break; + case GfxGlobalSettings::CollisionRendererMode::Material: + g_global_settings.collision_material_mask[arr_idx] &= ~(1 << arr_ofs); + break; + case GfxGlobalSettings::CollisionRendererMode::Skip: + ASSERT(arr_idx == 0); + g_global_settings.collision_skip_mask &= ~(1 << arr_ofs); + break; + default: + lg::error("{} invalid params {} {}", __PRETTY_FUNCTION__, mode, mask_id); + break; + } +} + +void CollisionRendererSetMode(GfxGlobalSettings::CollisionRendererMode mode) { + g_global_settings.collision_mode = mode; +} + } // namespace Gfx diff --git a/game/graphics/gfx.h b/game/graphics/gfx.h index b1d2ee24b0..e4bbeb11c6 100644 --- a/game/graphics/gfx.h +++ b/game/graphics/gfx.h @@ -5,11 +5,13 @@ * Graphics component for the runtime. Abstraction layer for the main graphics routines. */ +#include #include #include #include "common/common_types.h" -#include "game/kernel/kboot.h" + +#include "game/kernel/common/kboot.h" #include "game/system/newpad.h" // forward declarations @@ -18,19 +20,14 @@ class GfxDisplay; // enum for rendering pipeline enum class GfxPipeline { Invalid = 0, OpenGL }; +enum GfxDisplayMode { Windowed = 0, Fullscreen = 1, Borderless = 2 }; // module for the different rendering pipelines struct GfxRendererModule { std::function init; - std::function(int w, int h, const char* title, GfxSettings& settings)> - make_main_display; - std::function kill_display; - std::function render_display; - std::function display_position; - std::function display_size; - std::function display_set_size; - std::function display_scale; - std::function set_fullscreen; + std::function(int width, int height, const char* title, GfxSettings& settings, bool is_main)> + make_display; std::function exit; std::function vsync; std::function sync_path; @@ -45,6 +42,7 @@ struct GfxRendererModule { }; // store settings related to the gfx systems +// TODO merge with globalsettings struct GfxSettings { // current version of the settings. this should be set up so that newer versions are always higher // than older versions @@ -64,6 +62,9 @@ struct GfxSettings { }; // runtime settings +static constexpr int PAT_MOD_COUNT = 3; +static constexpr int PAT_EVT_COUNT = 7; +static constexpr int PAT_MAT_COUNT = 23; struct GfxGlobalSettings { // note: this is actually the size of the display that ISN'T letterboxed // the excess space is what will be letterboxed away. @@ -76,15 +77,35 @@ struct GfxGlobalSettings { // lod settings, used by bucket renderers int lod_tfrag = 0; int lod_tie = 0; + + // collision renderer settings + bool collision_enable = false; + bool collision_wireframe = true; + + // vsync enable + bool vsync = true; + bool old_vsync = false; + // target frame rate + float target_fps = 60; + // use custom frame limiter + bool framelimiter = true; + + bool experimental_accurate_lag = false; + bool sleep_in_frame_limiter = true; + + // matching enum in kernel-defs.gc !! + enum CollisionRendererMode { None, Mode, Event, Material, Skip } collision_mode = Mode; + std::array collision_mode_mask = {UINT32_MAX}; + std::array collision_event_mask = {UINT32_MAX}; + std::array collision_material_mask = {UINT32_MAX}; + u32 collision_skip_mask = UINT32_MAX; }; namespace Gfx { extern GfxGlobalSettings g_global_settings; extern GfxSettings g_settings; -// extern const std::vector renderers; -const GfxRendererModule* GetRenderer(GfxPipeline pipeline); const GfxRendererModule* GetCurrentRenderer(); u32 Init(); @@ -102,8 +123,15 @@ u64 get_window_width(); u64 get_window_height(); void set_window_size(u64 w, u64 h); void get_window_scale(float* x, float* y); +GfxDisplayMode get_fullscreen(); +int get_screen_vmode_count(); +int get_screen_rate(s64 vmode_idx); +void get_screen_size(s64 vmode_idx, s32* w, s32* h); +void set_frame_rate(int rate); +void set_vsync(bool vsync); void set_letterbox(int w, int h); -void set_fullscreen(int mode, int screen); +void set_fullscreen(GfxDisplayMode mode, int screen); +void set_window_lock(bool lock); void input_mode_set(u32 enable); void input_mode_save(); s64 get_mapped_button(s64 pad, s64 button); @@ -114,5 +142,9 @@ int PadAnalogValue(Pad::Analog analog, int port); // matching enum in kernel-defs.gc !! enum class RendererTreeType { NONE = 0, TFRAG3 = 1, TIE3 = 2, INVALID }; void SetLod(RendererTreeType tree, int lod); +bool CollisionRendererGetMask(GfxGlobalSettings::CollisionRendererMode mode, int mask_id); +void CollisionRendererSetMask(GfxGlobalSettings::CollisionRendererMode mode, int mask_id); +void CollisionRendererClearMask(GfxGlobalSettings::CollisionRendererMode mode, int mask_id); +void CollisionRendererSetMode(GfxGlobalSettings::CollisionRendererMode mode); } // namespace Gfx diff --git a/game/graphics/opengl_renderer/BucketRenderer.cpp b/game/graphics/opengl_renderer/BucketRenderer.cpp index 7edc882e65..f16d3e3ce2 100644 --- a/game/graphics/opengl_renderer/BucketRenderer.cpp +++ b/game/graphics/opengl_renderer/BucketRenderer.cpp @@ -1,7 +1,7 @@ #include "BucketRenderer.h" -#include "third-party/imgui/imgui.h" #include "third-party/fmt/core.h" +#include "third-party/imgui/imgui.h" std::string BucketRenderer::name_and_id() const { return fmt::format("[{:2d}] {}", (int)m_my_id, m_name); @@ -59,7 +59,7 @@ void SkipRenderer::render(DmaFollower& dma, } void SharedRenderState::reset() { - has_camera_planes = false; + has_pc_data = false; for (auto& x : occlusion_vis) { x.valid = false; } @@ -89,4 +89,16 @@ void RenderMux::draw_debug_window() { ImGui::ListBox("Pick", &m_render_idx, m_name_str_ptrs.data(), m_renderers.size()); ImGui::Separator(); m_renderers[m_render_idx]->draw_debug_window(); +} + +void RenderMux::init_textures(TexturePool& tp) { + for (auto& rend : m_renderers) { + rend->init_textures(tp); + } +} + +void RenderMux::init_shaders(ShaderLibrary& sl) { + for (auto& rend : m_renderers) { + rend->init_shaders(sl); + } } \ No newline at end of file diff --git a/game/graphics/opengl_renderer/BucketRenderer.h b/game/graphics/opengl_renderer/BucketRenderer.h index 3493c42f92..8b43835072 100644 --- a/game/graphics/opengl_renderer/BucketRenderer.h +++ b/game/graphics/opengl_renderer/BucketRenderer.h @@ -1,13 +1,15 @@ #pragma once -#include #include +#include + #include "common/dma/dma_chain_read.h" -#include "game/graphics/opengl_renderer/Shader.h" -#include "game/graphics/texture/TexturePool.h" + #include "game/graphics/opengl_renderer/Profiler.h" -#include "game/graphics/opengl_renderer/Loader.h" +#include "game/graphics/opengl_renderer/Shader.h" #include "game/graphics/opengl_renderer/buckets.h" +#include "game/graphics/opengl_renderer/loader/Loader.h" +#include "game/graphics/texture/TexturePool.h" struct LevelVis { bool valid = false; @@ -37,16 +39,19 @@ struct SharedRenderState { bool use_sky_cpu = true; bool use_occlusion_culling = true; bool enable_merc_xgkick = true; - bool enable_generic_xgkick = true; - bool use_direct2 = true; - bool use_generic2 = true; math::Vector fog_color; float fog_intensity = 1.f; + bool no_multidraw = false; void reset(); - bool has_camera_planes = false; + bool has_pc_data = false; LevelVis occlusion_vis[2]; + math::Vector4f camera_planes[4]; + math::Vector4f camera_matrix[4]; + math::Vector4f camera_hvdf_off; + math::Vector4f camera_fog; + math::Vector4f camera_pos; EyeRenderer* eye_renderer = nullptr; @@ -83,6 +88,9 @@ class RenderMux : public BucketRenderer { std::vector> renderers); void render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) override; void draw_debug_window() override; + void init_shaders(ShaderLibrary&) override; + void init_textures(TexturePool&) override; + void set_idx(u32 i) { m_render_idx = i; }; private: std::vector> m_renderers; @@ -108,4 +116,4 @@ class SkipRenderer : public BucketRenderer { void render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) override; bool empty() const override { return true; } void draw_debug_window() override {} -}; \ No newline at end of file +}; diff --git a/game/graphics/opengl_renderer/CollideMeshRenderer.cpp b/game/graphics/opengl_renderer/CollideMeshRenderer.cpp new file mode 100644 index 0000000000..20262c9430 --- /dev/null +++ b/game/graphics/opengl_renderer/CollideMeshRenderer.cpp @@ -0,0 +1,111 @@ +#include "CollideMeshRenderer.h" + +#include "game/graphics/opengl_renderer/background/background_common.h" + +CollideMeshRenderer::CollideMeshRenderer() { + glGenVertexArrays(1, &m_vao); +} + +CollideMeshRenderer::~CollideMeshRenderer() { + glDeleteVertexArrays(1, &m_vao); +} + +void CollideMeshRenderer::render(SharedRenderState* render_state, ScopedProfilerNode& prof) { + if (!render_state->has_pc_data) { + return; + } + + auto levels = render_state->loader->get_in_use_levels(); + if (levels.empty()) { + return; + } + render_state->shaders[ShaderId::COLLISION].activate(); + + glBindVertexArray(m_vao); + TfragRenderSettings settings; + memcpy(settings.math_camera.data(), render_state->camera_matrix[0].data(), 64); + settings.hvdf_offset = render_state->camera_hvdf_off; + settings.fog = render_state->camera_fog; + settings.tree_idx = 0; + for (int i = 0; i < 4; i++) { + settings.planes[i] = render_state->camera_planes[i]; + } + auto shader = render_state->shaders[ShaderId::COLLISION].id(); + glUniformMatrix4fv(glGetUniformLocation(shader, "camera"), 1, GL_FALSE, + settings.math_camera.data()); + glUniform4f(glGetUniformLocation(shader, "hvdf_offset"), settings.hvdf_offset[0], + settings.hvdf_offset[1], settings.hvdf_offset[2], settings.hvdf_offset[3]); + const auto& trans = render_state->camera_pos; + glUniform4f(glGetUniformLocation(shader, "camera_position"), trans[0], trans[1], trans[2], + trans[3]); + glUniform1f(glGetUniformLocation(shader, "fog_constant"), settings.fog.x()); + glUniform1f(glGetUniformLocation(shader, "fog_min"), settings.fog.y()); + glUniform1f(glGetUniformLocation(shader, "fog_max"), settings.fog.z()); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_GEQUAL); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // ? + glDepthMask(GL_TRUE); + + for (auto lev : levels) { + glBindBuffer(GL_ARRAY_BUFFER, lev->collide_vertices); + glEnableVertexAttribArray(0); + glEnableVertexAttribArray(1); + glEnableVertexAttribArray(2); + glEnableVertexAttribArray(3); + glVertexAttribPointer(0, // location 0 in the shader + 3, // 3 values per vert + GL_FLOAT, // floats + GL_FALSE, // normalized + sizeof(tfrag3::CollisionMesh::Vertex), // stride + 0 // offset (0) + ); + glVertexAttribIPointer(1, // location 1 in the shader + 1, // 3 values per vert + GL_UNSIGNED_INT, // u32 + sizeof(tfrag3::CollisionMesh::Vertex), // stride + (void*)offsetof(tfrag3::CollisionMesh::Vertex, flags) // offset + ); + glVertexAttribPointer(2, // location 2 in the shader + 3, // 3 values per vert + GL_SHORT, // floats + GL_TRUE, // normalized + sizeof(tfrag3::CollisionMesh::Vertex), // stride + (void*)offsetof(tfrag3::CollisionMesh::Vertex, nx) // offset (0) + ); + glVertexAttribIPointer(3, // location 3 in the shader + 1, // 3 values per vert + GL_UNSIGNED_INT, // u32 + sizeof(tfrag3::CollisionMesh::Vertex), // stride + (void*)offsetof(tfrag3::CollisionMesh::Vertex, pat) // offset (0) + ); + glUniform1i(glGetUniformLocation(shader, "wireframe"), 0); + glUniform1uiv(glGetUniformLocation(shader, "collision_mode_mask"), + Gfx::g_global_settings.collision_mode_mask.size(), + Gfx::g_global_settings.collision_mode_mask.data()); + glUniform1uiv(glGetUniformLocation(shader, "collision_event_mask"), + Gfx::g_global_settings.collision_event_mask.size(), + Gfx::g_global_settings.collision_event_mask.data()); + glUniform1uiv(glGetUniformLocation(shader, "collision_material_mask"), + Gfx::g_global_settings.collision_material_mask.size(), + Gfx::g_global_settings.collision_material_mask.data()); + glUniform1ui(glGetUniformLocation(shader, "collision_skip_mask"), + Gfx::g_global_settings.collision_skip_mask); + glUniform1i(glGetUniformLocation(shader, "mode"), Gfx::g_global_settings.collision_mode); + glDrawArrays(GL_TRIANGLES, 0, lev->level->collision.vertices.size()); + + if (Gfx::g_global_settings.collision_wireframe) { + glUniform1i(glGetUniformLocation(shader, "wireframe"), 1); + glDisable(GL_BLEND); + glDepthMask(GL_FALSE); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + glDrawArrays(GL_TRIANGLES, 0, lev->level->collision.vertices.size()); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glEnable(GL_BLEND); + glDepthMask(GL_TRUE); + } + + prof.add_draw_call(); + prof.add_tri(lev->level->collision.vertices.size() / 3); + } +} diff --git a/game/graphics/opengl_renderer/CollideMeshRenderer.h b/game/graphics/opengl_renderer/CollideMeshRenderer.h new file mode 100644 index 0000000000..13bb1c4202 --- /dev/null +++ b/game/graphics/opengl_renderer/CollideMeshRenderer.h @@ -0,0 +1,12 @@ +#pragma once +#include "game/graphics/opengl_renderer/BucketRenderer.h" + +class CollideMeshRenderer { + public: + CollideMeshRenderer(); + void render(SharedRenderState* render_state, ScopedProfilerNode& prof); + ~CollideMeshRenderer(); + + private: + GLuint m_vao; +}; diff --git a/game/graphics/opengl_renderer/DirectRenderer.cpp b/game/graphics/opengl_renderer/DirectRenderer.cpp index fe8b150f6c..8777e84f67 100644 --- a/game/graphics/opengl_renderer/DirectRenderer.cpp +++ b/game/graphics/opengl_renderer/DirectRenderer.cpp @@ -1,11 +1,14 @@ #include "DirectRenderer.h" + #include "common/dma/gs.h" #include "common/log/log.h" -#include "third-party/fmt/core.h" -#include "game/graphics/pipelines/opengl.h" -#include "third-party/imgui/imgui.h" #include "common/util/Assert.h" +#include "game/graphics/pipelines/opengl.h" + +#include "third-party/fmt/core.h" +#include "third-party/imgui/imgui.h" + DirectRenderer::DirectRenderer(const std::string& name, BucketId my_id, int batch_size) : BucketRenderer(name, my_id), m_prim_buffer(batch_size) { glGenBuffers(1, &m_ogl.vertex_buffer); @@ -253,8 +256,7 @@ void DirectRenderer::update_gl_prim(SharedRenderState* render_state) { case GsTest::AlphaTest::NEVER: break; default: - fmt::print("unknown alpha test: {}\n", (int)m_test_state.alpha_test); - ASSERT(false); + ASSERT_MSG(false, fmt::format("unknown alpha test: {}", (int)m_test_state.alpha_test)); } } @@ -270,8 +272,8 @@ void DirectRenderer::update_gl_prim(SharedRenderState* render_state) { m_ogl.alpha_mult); glUniform4f(glGetUniformLocation(render_state->shaders[ShaderId::DIRECT_BASIC_TEXTURED].id(), "fog_color"), - render_state->fog_color[0], render_state->fog_color[1], render_state->fog_color[2], - render_state->fog_intensity); + render_state->fog_color[0] / 255.f, render_state->fog_color[1] / 255.f, + render_state->fog_color[2] / 255.f, render_state->fog_intensity / 255); } else { render_state->shaders[ShaderId::DIRECT_BASIC].activate(); @@ -617,10 +619,9 @@ void DirectRenderer::render_gif(const u8* data, } if (size != UINT32_MAX) { - if (!(offset + 15) / 16 == size / 16) { - fmt::print("DirectRenderer size failed in {}\n", name_and_id()); - fmt::print("expected: {}, got: {}\n", size, offset); - ASSERT(false); + if ((offset + 15) / 16 != size / 16) { + ASSERT_MSG(false, fmt::format("DirectRenderer size failed in {}. expected: {}, got: {}", + name_and_id(), size, offset)); } } @@ -693,8 +694,7 @@ void DirectRenderer::handle_ad(const u8* data, } break; default: - fmt::print("Address {} is not supported\n", register_address_name(addr)); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Address {} is not supported", register_address_name(addr))); } } @@ -1053,8 +1053,8 @@ void DirectRenderer::handle_xyzf2_common(u32 x, } } break; default: - fmt::print("prim type {} is unsupported in {}.\n", (int)m_prim_building.kind, name_and_id()); - ASSERT(false); + ASSERT_MSG(false, fmt::format("prim type {} is unsupported in {}.", (int)m_prim_building.kind, + name_and_id())); } } diff --git a/game/graphics/opengl_renderer/DirectRenderer.h b/game/graphics/opengl_renderer/DirectRenderer.h index a88d5e7035..9217879bf2 100644 --- a/game/graphics/opengl_renderer/DirectRenderer.h +++ b/game/graphics/opengl_renderer/DirectRenderer.h @@ -1,12 +1,14 @@ #pragma once #include -#include "game/graphics/opengl_renderer/BucketRenderer.h" + #include "common/dma/gs.h" +#include "common/log/log.h" #include "common/math/Vector.h" #include "common/util/SmallVector.h" + +#include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/pipelines/opengl.h" -#include "common/log/log.h" /*! * The direct renderer will handle rendering GIFtags directly. diff --git a/game/graphics/opengl_renderer/DirectRenderer2.cpp b/game/graphics/opengl_renderer/DirectRenderer2.cpp index b495c29df2..30383256fb 100644 --- a/game/graphics/opengl_renderer/DirectRenderer2.cpp +++ b/game/graphics/opengl_renderer/DirectRenderer2.cpp @@ -1,8 +1,11 @@ #include "DirectRenderer2.h" -#include "third-party/imgui/imgui.h" -#include "common/log/log.h" + #include +#include "common/log/log.h" + +#include "third-party/imgui/imgui.h" + DirectRenderer2::DirectRenderer2(u32 max_verts, u32 max_inds, u32 max_draws, @@ -235,8 +238,7 @@ void DirectRenderer2::setup_opengl_for_draw_mode(const Draw& draw, case DrawMode::AlphaTest::NEVER: break; default: - fmt::print("unknown alpha test: {}\n", (int)draw.mode.get_alpha_test()); - ASSERT(false); + ASSERT_MSG(false, fmt::format("unknown alpha test: {}", (int)draw.mode.get_alpha_test())); } } @@ -326,8 +328,9 @@ void DirectRenderer2::setup_opengl_for_draw_mode(const Draw& draw, render_state->shaders[ShaderId::DIRECT2].activate(); glUniform1f(m_ogl.alpha_reject, alpha_reject); glUniform1f(m_ogl.color_mult, color_mult); - glUniform4f(m_ogl.fog_color, render_state->fog_color[0], render_state->fog_color[1], - render_state->fog_color[2], render_state->fog_intensity); + glUniform4f(m_ogl.fog_color, render_state->fog_color[0] / 255.f, + render_state->fog_color[1] / 255.f, render_state->fog_color[2] / 255.f, + render_state->fog_intensity / 255); } } @@ -540,8 +543,7 @@ void DirectRenderer2::handle_ad(const u8* data) { case GsRegisterAddress::TEXFLUSH: break; default: - fmt::print("Address {} is not supported\n", register_address_name(addr)); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Address {} is not supported", register_address_name(addr))); } } @@ -827,4 +829,4 @@ void DirectRenderer2::handle_alpha1(u64 val) { // ASSERT(false); } } -} \ No newline at end of file +} diff --git a/game/graphics/opengl_renderer/DirectRenderer2.h b/game/graphics/opengl_renderer/DirectRenderer2.h index c99b46905a..57ca0d6af6 100644 --- a/game/graphics/opengl_renderer/DirectRenderer2.h +++ b/game/graphics/opengl_renderer/DirectRenderer2.h @@ -1,10 +1,12 @@ #pragma once #include + #include "common/common_types.h" -#include "game/graphics/opengl_renderer/BucketRenderer.h" #include "common/dma/gs.h" +#include "game/graphics/opengl_renderer/BucketRenderer.h" + class DirectRenderer2 { public: DirectRenderer2(u32 max_verts, diff --git a/game/graphics/opengl_renderer/EyeRenderer.cpp b/game/graphics/opengl_renderer/EyeRenderer.cpp index 4144d5107f..64cc80b242 100644 --- a/game/graphics/opengl_renderer/EyeRenderer.cpp +++ b/game/graphics/opengl_renderer/EyeRenderer.cpp @@ -1,7 +1,9 @@ #include "EyeRenderer.h" -#include "game/graphics/opengl_renderer/AdgifHandler.h" #include "common/util/FileUtil.h" + +#include "game/graphics/opengl_renderer/AdgifHandler.h" + #include "third-party/imgui/imgui.h" ///////////////////////// @@ -24,8 +26,9 @@ void EyeRenderer::init_textures(TexturePool& texture_pool) { in.gpu_texture = gl_tex; in.w = 32; in.h = 32; - in.page_name = "PC-EYES"; - in.name = fmt::format("{}-eye-cpu-{}", lr ? "left" : "right", pair_idx); + in.debug_page_name = "PC-EYES"; + in.debug_name = fmt::format("{}-eye-cpu-{}", lr ? "left" : "right", pair_idx); + in.id = texture_pool.allocate_pc_port_texture(); auto* gpu_tex = texture_pool.give_texture_and_load_to_vram(in, tbp); m_cpu_eye_textures[tidx] = {gl_tex, gpu_tex, tbp}; } @@ -37,8 +40,9 @@ void EyeRenderer::init_textures(TexturePool& texture_pool) { in.gpu_texture = m_gpu_eye_textures[tidx].fb.texture(); in.w = 32; in.h = 32; - in.page_name = "PC-EYES"; - in.name = fmt::format("{}-eye-gpu-{}", lr ? "left" : "right", pair_idx); + in.debug_page_name = "PC-EYES"; + in.debug_name = fmt::format("{}-eye-gpu-{}", lr ? "left" : "right", pair_idx); + in.id = texture_pool.allocate_pc_port_texture(); m_gpu_eye_textures[tidx].gpu_tex = texture_pool.give_texture_and_load_to_vram(in, tbp); m_gpu_eye_textures[tidx].tbp = tbp; } @@ -247,7 +251,7 @@ std::vector EyeRenderer::get_draws(DmaFollower& dma pair_idx = y0 / SINGLE_EYE_SIZE; l_draw.pair = pair_idx; r_draw.pair = pair_idx; - if (tex0->get_data_ptr()) { + if (tex0 && tex0->get_data_ptr()) { u32 tex_val; memcpy(&tex_val, tex0->get_data_ptr(), 4); l_draw.clear_color = tex_val; @@ -278,7 +282,7 @@ std::vector EyeRenderer::get_draws(DmaFollower& dma AdgifHelper adgif1(adgif1_dma.data + 16); auto tex1 = render_state->texture_pool->lookup_gpu_texture(adgif1.tex0().tbp0()); - { + if (tex1 && tex1->get_data_ptr()) { l_draw.pupil = read_eye_draw(dma); r_draw.pupil = read_eye_draw(dma); l_draw.pupil_tex = tex1; @@ -577,7 +581,7 @@ void EyeRenderer::run_gpu(const std::vector& draws, // first, the clear float clear[4] = {0, 0, 0, 0}; for (int i = 0; i < 4; i++) { - clear[i] = (draw.clear_color >> (8 * i)) / 255.f; + clear[i] = ((draw.clear_color >> (8 * i)) & 0xff) / 255.f; } glClearBufferfv(GL_COLOR, 0, clear); diff --git a/game/graphics/opengl_renderer/EyeRenderer.h b/game/graphics/opengl_renderer/EyeRenderer.h index 21d6a4d990..a85b6e6154 100644 --- a/game/graphics/opengl_renderer/EyeRenderer.h +++ b/game/graphics/opengl_renderer/EyeRenderer.h @@ -1,9 +1,10 @@ #pragma once #include + #include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/pipelines/opengl.h" #include "game/graphics/opengl_renderer/opengl_utils.h" +#include "game/graphics/pipelines/opengl.h" constexpr int EYE_BASE_BLOCK = 8160; constexpr int NUM_EYE_PAIRS = 11; diff --git a/game/graphics/opengl_renderer/GenericProgram.cpp b/game/graphics/opengl_renderer/GenericProgram.cpp deleted file mode 100644 index 3ac9886654..0000000000 --- a/game/graphics/opengl_renderer/GenericProgram.cpp +++ /dev/null @@ -1,1097 +0,0 @@ -#include "game/graphics/opengl_renderer/GenericRenderer.h" - -void GenericRenderer::lq_buffer(Mask mask, Vf& dest, u16 addr) { - ASSERT(addr * 16 < sizeof(m_buffer.data)); - for (int i = 0; i < 4; i++) { - if ((u64)mask & (1 << i)) { - memcpy(dest.data + i, m_buffer.data + addr * 16 + i * 4, 4); - } - } -} - -void GenericRenderer::isw_buffer(Mask mask, u16 val, u16 addr) { - ASSERT(addr * 16 < sizeof(m_buffer.data)); - u32 val32 = val; - int offset; - switch (mask) { - case Mask::x: - offset = 0; - break; - case Mask::y: - offset = 4; - break; - case Mask::z: - offset = 8; - break; - case Mask::w: - offset = 12; - break; - default: - ASSERT(false); - } - memcpy(m_buffer.data + addr * 16 + offset, &val32, 4); -} - -u16 clip(const Vf& vector, float val, u16 old_clip) { - u16 result = (old_clip << 6); - float plus = std::abs(val); - float minus = -plus; - - if (vector.x() > plus) { - result |= 0b1; - } - if (vector.x() < minus) { - result |= 0b10; - } - - if (vector.y() > plus) { - result |= 0b100; - } - if (vector.y() < minus) { - result |= 0b1000; - } - - if (vector.z() > plus) { - result |= 0b10000; - } - if (vector.z() < minus) { - result |= 0b100000; - } - return result; -} - -bool clipping_hack = true; - -constexpr float kFogFloatOffset = 3071.f; - -// clang-format off -void GenericRenderer::mscal0() { - // L4: - // iaddiu vi01, vi00, 0x381 | nop - vu.vi01 = 0x381; /* 897 */ - // lq.xyzw vf01, 0(vi01) | nop - lq_buffer(Mask::xyzw, gen.fog, vu.vi01); - // lq.xyzw vf02, 1(vi01) | nop - lq_buffer(Mask::xyzw, gen.adgif_tmpl, vu.vi01 + 1); - // lq.xyzw vf03, 2(vi01) | nop - // lq_buffer(Mask::xyzw, vu.vf03, vu.vi01 + 2); - vu.vf03.fill(0); - // lq.xyzw vf04, 3(vi01) | nop - lq_buffer(Mask::xyzw, gen.hvdf_off, vu.vi01 + 3); - // lq.xyzw vf05, 4(vi01) | nop - lq_buffer(Mask::xyzw, gen.hmge_scale, vu.vi01 + 4); - // lq.xyzw vf06, 5(vi01) | nop - // lq_buffer(Mask::xyzw, vu.vf06, vu.vi01 + 5); not used - // lq.xyzw vf07, 6(vi01) | nop - lq_buffer(Mask::xyzw, gen.guard, vu.vi01 + 6); - // L5: - // iaddiu vi13, vi00, 0x363 | nop - vu.vi13 = 0x363; /* 867 */ - // iaddi vi02, vi13, 0x5 | nop - vu.vi02 = vu.vi13 + 5; - // iaddi vi12, vi00, 0x0 | nop - vu.vi12 = 0; - // isw.x vi02, 9(vi01) | nop - isw_buffer(Mask::x, vu.vi02, vu.vi01 + 9); - // isw.y vi02, 9(vi01) | nop - isw_buffer(Mask::y, vu.vi02, vu.vi01 + 9); - // sq.xyzw vf00, 907(vi00) | nop - sq_buffer(Mask::xyzw, vu.vf00, 907); - // sq.xyzw vf00, 914(vi00) | nop - sq_buffer(Mask::xyzw, vu.vf00, 914); - // sq.xyzw vf00, 921(vi00) | nop - sq_buffer(Mask::xyzw, vu.vf00, 921); - // sq.xyzw vf00, 928(vi00) | nop - sq_buffer(Mask::xyzw, vu.vf00, 928); - // sq.xyzw vf00, 935(vi00) | nop - sq_buffer(Mask::xyzw, vu.vf00, 935); - // sq.xyzw vf00, 942(vi00) | nop - sq_buffer(Mask::xyzw, vu.vf00, 942); - // iaddiu vi01, vi00, 0x40f | nop - vu.vi01 = 0x40f; /* 1039 */ - // isw.z vi01, 907(vi00) | nop - isw_buffer(Mask::z, vu.vi01, 907); - // iaddiu vi01, vi00, 0x411 | nop - vu.vi01 = 0x411; /* 1041 */ - // isw.z vi01, 914(vi00) | nop - isw_buffer(Mask::z, vu.vi01, 914); - // iaddiu vi01, vi00, 0x413 | nop - vu.vi01 = 0x413; /* 1043 */ - // isw.z vi01, 921(vi00) | nop - isw_buffer(Mask::z, vu.vi01, 921); - // iaddiu vi01, vi00, 0x415 | nop - vu.vi01 = 0x415; /* 1045 */ - // isw.z vi01, 928(vi00) | nop - isw_buffer(Mask::z, vu.vi01, 928); - // iaddiu vi01, vi00, 0x417 | nop - vu.vi01 = 0x417; /* 1047 */ - // isw.z vi01, 935(vi00) | nop - isw_buffer(Mask::z, vu.vi01, 935); - // iaddiu vi01, vi00, 0x419 | nop :e - vu.vi01 = 0x419; /* 1049 */ - // isw.z vi01, 942(vi00) | nop - isw_buffer(Mask::z, vu.vi01, 942); -} - -void GenericRenderer::ilw_buffer(Mask mask, u16& dest, u16 addr) { - // fmt::print("addr is {}\n", addr); - ASSERT(addr * 16 < sizeof(m_buffer.data)); - int offset; - switch (mask) { - case Mask::x: - offset = 0; - break; - case Mask::y: - offset = 4; - break; - case Mask::z: - offset = 8; - break; - case Mask::w: - offset = 12; - break; - default: - ASSERT(false); - } - memcpy(&dest, m_buffer.data + addr * 16 + offset, 2); -} - -void GenericRenderer::mscal_noclip_nopipe(SharedRenderState *render_state, ScopedProfilerNode &prof) { - // buffer crap - vu.vi02 = vu.vi13 - 0x363; // 867 - vu.vi13 = vu.vi13 + 0x1e; - if (vu.vi02 == 0) { - vu.vi13 = 0x345; /* 837 */ - } - - - vu.vi03 = vu.vi13 + 7; - ilw_buffer(Mask::w, vu.vi01, vu.vi13 + 5); - isw_buffer(Mask::x, vu.vi03, 906); - vu.vi10 = vu.vi12 + 9; - - lq_buffer(Mask::xyzw, gen.mat0, vu.vi13); - lq_buffer(Mask::xyzw, gen.mat1, vu.vi13 + 1); - lq_buffer(Mask::xyzw, gen.mat2, vu.vi13 + 2); - lq_buffer(Mask::xyzw, gen.mat3, vu.vi13 + 3); - vu.vi02 = vu.vi01 + vu.vi01; - vu.vi01 = vu.vi01 + vu.vi02; - vu.vi11 = -2; - vu.vi14 = vu.vi10 + vu.vi01; - isw_buffer(Mask::w, vu.vi12, 906); - - vu.vf18.sub(Mask::w, vu.vf00, vu.vf00.w()); - - vu.vf22.add(Mask::z, vu.vf00, vu.vf00.w()); - vu.vf22.ftoi12_check(Mask::z, vu.vf22); - - // this is the vertex transformation loop, unpipelined. - while (vu.vi10 != vu.vi14) { - // lq.xy vf22, 0(vi10) texture load? - lq_buffer(Mask::xy, vu.vf22, vu.vi10); - // lq.xyz vf16, 2(vi10) vertex load - lq_buffer(Mask::xyz, gen.vtx_load0, vu.vi10 + 2); - // mtir vi02, vf22.x grab s coordinate of texture - vu.vi02 = vu.vf22.x_as_u16(); - - // mulaw.xyzw ACC, vf11, vf00 matrix multiply W - vu.acc.mula(Mask::xyzw, gen.mat3, vu.vf00.w()); - - // maddax.xyzw ACC, vf08, vf16 matrix multiply X - vu.acc.madda(Mask::xyzw, gen.mat0, gen.vtx_load0.x()); - - // madday.xyzw ACC, vf09, vf16 matrix multiply Y - vu.acc.madda(Mask::xyzw, gen.mat1, gen.vtx_load0.y()); - - // iand vi06, vi02, vi11 mask s tex coord - vu.vi06 = vu.vi02 & vu.vi11; - - // mfir.x vf22, vi06 replace s coord - vu.vf22.mfir(Mask::x, vu.vi06); - - // maddz.xyzw vf12, vf10, vf16 matrix multiply Z - vu.acc.madd(Mask::xyzw, gen.vtx_p0, gen.mat2, gen.vtx_load0.z()); - - // div Q, vf01.x, vf12.w perspective divide - vu.Q = gen.fog.x() / gen.vtx_p0.w(); - - // itof12.xyz vf18, vf22 texture int to float - vu.vf18.itof12(Mask::xyz, vu.vf22); - - // mul.xyz vf12, vf12, Q persepective divide - gen.vtx_p0.mul(Mask::xyz, gen.vtx_p0, vu.Q); - - // mul.xyz vf18, vf18, Q texture perspective divide - vu.vf18.mul(Mask::xyz, vu.vf18, vu.Q); - - // add.xyzw vf12, vf12, vf04 apply hvdf - gen.vtx_p0.add(Mask::xyzw, gen.vtx_p0, gen.hvdf_off); - - // miniz.w vf12, vf12, vf01 fog clamp - gen.vtx_p0.mini(Mask::w, gen.vtx_p0, gen.fog.z()); - - // maxy.w vf12, vf12, vf01 fog clamp 2 - gen.vtx_p0.max(Mask::w, gen.vtx_p0, gen.fog.y()); - - // addw.w vf12, vf12, vf01 ONLY if vi02 != vi06 fog offset. - if (vu.vi02 != vu.vi06) { - gen.vtx_p0.add(Mask::w, gen.vtx_p0, kFogFloatOffset); - } - // ftoi4.xyzw vf12, vf12 to ints for GS - gen.vtx_p0.ftoi4_check(Mask::xyzw, gen.vtx_p0); - - // store! - sq_buffer(Mask::xyzw, gen.vtx_p0, vu.vi10 + 2); - // this divide should happen in the vertex shader to get perspective correct textures. - // vu.vf18.x() /= vu.vf18.z(); - // vu.vf18.y() /= vu.vf18.z(); - // vu.vf18.z() = 1.f; - - // fmt::print("tex.z = {}\n", vu.vf18.z()); - sq_buffer(Mask::xyzw, vu.vf18, vu.vi10); - - - // iaddi vi10, vi10, 0x3 inc vertex pointer - vu.vi10 = vu.vi10 + 3; - } - - - // this loop places giftag templates and adgif shaders - // it allows the same vertices to be drawn several times with different shaders. - bool bc; - // iaddi vi14, vi13, 0x7 | nop 1060 - vu.vi14 = vu.vi13 + 7; - // lq.xyzw vf03, 4(vi13) | nop 1061 - Vf draw_hdr2; - lq_buffer(Mask::xyzw, draw_hdr2, vu.vi13 + 4); - // ilw.w vi02, 6(vi13) | nop 1062 - ilw_buffer(Mask::w, vu.vi02, vu.vi13 + 6); - // lq.xyzw vf21, 5(vi13) | nop 1063 - Vf draw_hdr0; - lq_buffer(Mask::xyzw, draw_hdr0, vu.vi13 + 5); - // lq.xyzw vf22, 6(vi13) | nop 1064 - Vf draw_hdr1; - lq_buffer(Mask::xyzw, draw_hdr1, vu.vi13 + 6); - L83: - // ilwr.w vi03, vi14 | nop 1065 - ilw_buffer(Mask::w, vu.vi03, vu.vi14); - // ilw.w vi04, 1(vi14) | nop 1066 - ilw_buffer(Mask::w, vu.vi04, vu.vi14 + 1); - // lqi.xyzw vf16, vi14 | nop 1067 - Vf adgif_temp0; - lq_buffer(Mask::xyzw, adgif_temp0, vu.vi14++); - // lqi.xyzw vf17, vi14 | nop 1068 - Vf adgif_temp1; - lq_buffer(Mask::xyzw, adgif_temp1, vu.vi14++); - // lqi.xyzw vf18, vi14 | nop 1069 - Vf adgif_temp2; - lq_buffer(Mask::xyzw, adgif_temp2, vu.vi14++); - // lqi.xyzw vf19, vi14 | nop 1070 - Vf adgif_temp3; - lq_buffer(Mask::xyzw, adgif_temp3, vu.vi14++); - // lqi.xyzw vf20, vi14 | nop 1071 - Vf adgif_temp4; - lq_buffer(Mask::xyzw, adgif_temp4, vu.vi14++); - // iadd vi06, vi03, vi12 | nop 1072 - vu.vi06 = vu.vi03 + vu.vi12; - // sqi.xyzw vf02, vi06 | nop 1073 - sq_buffer(Mask::xyzw, gen.adgif_tmpl, vu.vi06++); - // sqi.xyzw vf16, vi06 | nop 1074 - sq_buffer(Mask::xyzw, adgif_temp0, vu.vi06++); - // sqi.xyzw vf17, vi06 | nop 1075 - sq_buffer(Mask::xyzw, adgif_temp1, vu.vi06++); - // sqi.xyzw vf18, vi06 | nop 1076 - sq_buffer(Mask::xyzw, adgif_temp2, vu.vi06++); - // sqi.xyzw vf19, vi06 | nop 1077 - sq_buffer(Mask::xyzw, adgif_temp3, vu.vi06++); - // sqi.xyzw vf20, vi06 | nop 1078 - sq_buffer(Mask::xyzw, adgif_temp4, vu.vi06++); - // sqi.xyzw vf21, vi06 | nop 1079 - sq_buffer(Mask::xyzw, draw_hdr0, vu.vi06++); - // sqi.xyzw vf22, vi06 | nop 1080 - sq_buffer(Mask::xyzw, draw_hdr1, vu.vi06++); - // sqi.xyzw vf03, vi06 | nop 1081 - sq_buffer(Mask::xyzw, draw_hdr2, vu.vi06++); - // BRANCH! - // ibgez vi04, L83 | nop 1082 - bc = ((s16)vu.vi04) >= 0; - // isw.x vi04, -1(vi06) | nop 1083 - isw_buffer(Mask::x, vu.vi04, vu.vi06 + -1); - if (bc) { goto L83; } - - // iadd vi02, vi12, vi02 | nop 1084 - vu.vi02 = vu.vi12 + vu.vi02; - // nop | nop 1085 - - // xgkick vi02 | nop 1086 - xgkick(vu.vi02, render_state, prof); - // isubiu vi01, vi12, 0x22e | nop 1087 - vu.vi01 = vu.vi12 - 0x22e; /* 558 */ - // nop | nop 1088 - - // BRANCH! - // ibltz vi01, L84 | nop 1089 - bc = ((s16)vu.vi01) < 0; - // iaddiu vi12, vi12, 0x117 | nop 1090 - vu.vi12 = vu.vi12 + 0x117; /* 279 */ - if (bc) { goto L84; } - - // iaddi vi12, vi00, 0x0 | nop 1091 - vu.vi12 = 0; - L84: - // nop | nop :e 1092 - - // nop | nop 1093 - - return; -} - - -void GenericRenderer::mscal_dispatch(int imm, SharedRenderState* render_state, ScopedProfilerNode& prof) { - bool bc; - u16 cf = 0; - u16 cf0, cf1, cf2; - switch(imm) { - case 6: - goto L33; - case 8: - mscal_noclip_nopipe(render_state, prof); - return; - default: - fmt::print("Generic dispatch mscal: {}\n", imm); - ASSERT(false); - } - - L33: // R - // isubiu vi02, vi13, 0x363 | addw.z vf22, vf00, vf00 360 - vu.vf22.add(Mask::z, vu.vf00, vu.vf00.w()); vu.vi02 = vu.vi13 - 0x363; /* 867 */ - // iaddiu vi13, vi13, 0x1e | addw.z vf23, vf00, vf00 361 - vu.vf23.add(Mask::z, vu.vf00, vu.vf00.w()); vu.vi13 = vu.vi13 + 0x1e; /* 30 */ - // BRANCH! - // ibne vi00, vi02, L34 | addw.z vf24, vf00, vf00 362 - vu.vf24.add(Mask::z, vu.vf00, vu.vf00.w()); bc = (vu.vi02 != 0); - // nop | addw.z vf25, vf00, vf00 363 - vu.vf25.add(Mask::z, vu.vf00, vu.vf00.w()); - if (bc) { goto L34; } - - // iaddiu vi13, vi00, 0x345 | nop 364 - vu.vi13 = 0x345; /* 837 */ - L34: // R - // iaddi vi03, vi13, 0x7 | nop 365 - vu.vi03 = vu.vi13 + 7; - // ilw.w vi01, 5(vi13) | nop 366 - ilw_buffer(Mask::w, vu.vi01, vu.vi13 + 5); - // isw.x vi03, 906(vi00) | nop 367 - isw_buffer(Mask::x, vu.vi03, 906); - // iaddi vi10, vi12, 0x9 | subw.w vf18, vf00, vf00 368 - vu.vf18.sub(Mask::w, vu.vf00, vu.vf00.w()); vu.vi10 = vu.vi12 + 9; - // lq.xyzw vf08, 0(vi13) | subw.w vf19, vf00, vf00 369 - vu.vf19.sub(Mask::w, vu.vf00, vu.vf00.w()); lq_buffer(Mask::xyzw, gen.mat0, vu.vi13); - // lq.xyzw vf09, 1(vi13) | subw.w vf20, vf00, vf00 370 - vu.vf20.sub(Mask::w, vu.vf00, vu.vf00.w()); lq_buffer(Mask::xyzw, gen.mat1, vu.vi13 + 1); - // lq.xyzw vf10, 2(vi13) | subw.w vf21, vf00, vf00 371 - vu.vf21.sub(Mask::w, vu.vf00, vu.vf00.w()); lq_buffer(Mask::xyzw, gen.mat2, vu.vi13 + 2); - // lq.xyzw vf11, 3(vi13) | ftoi12.z vf22, vf22 372 - vu.vf22.ftoi12_check(Mask::z, vu.vf22); lq_buffer(Mask::xyzw, gen.mat3, vu.vi13 + 3); - // iadd vi02, vi01, vi01 | ftoi12.z vf23, vf23 373 - vu.vf23.ftoi12_check(Mask::z, vu.vf23); vu.vi02 = vu.vi01 + vu.vi01; - // iadd vi01, vi01, vi02 | sub.xyzw vf16, vf16, vf16 374 - gen.vtx_load0.set_zero(); vu.vi01 = vu.vi01 + vu.vi02; - // iaddi vi11, vi00, -0x2 | nop 375 - vu.vi11 = -2; - // iadd vi14, vi10, vi01 | ftoi12.z vf24, vf24 376 - vu.vf24.ftoi12_check(Mask::z, vu.vf24); vu.vi14 = vu.vi10 + vu.vi01; - // isw.w vi12, 906(vi00) | ftoi12.z vf25, vf25 377 - vu.vf25.ftoi12_check(Mask::z, vu.vf25); isw_buffer(Mask::w, vu.vi12, 906); - // iaddi vi14, vi14, 0x9 | nop 378 - vu.vi14 = vu.vi14 + 9; - // lq.xy vf22, 0(vi10) | nop 379 - lq_buffer(Mask::xy, vu.vf22, vu.vi10); - // lq.xyz vf16, 2(vi10) | nop 380 - lq_buffer(Mask::xyz, gen.vtx_load0, vu.vi10 + 2); - // nop | nop 381 - - // nop | nop 382 - - // nop | mulaw.xyzw ACC, vf11, vf00 383 - vu.acc.mula(Mask::xyzw, gen.mat3, vu.vf00.w()); - // mtir vi02, vf22.x | maddax.xyzw ACC, vf08, vf16 384 - vu.acc.madda(Mask::xyzw, gen.mat0, gen.vtx_load0.x()); vu.vi02 = vu.vf22.x_as_u16(); - // iaddi vi10, vi10, 0x3 | madday.xyzw ACC, vf09, vf16 385 - vu.acc.madda(Mask::xyzw, gen.mat1, gen.vtx_load0.y()); vu.vi10 = vu.vi10 + 3; - // lq.xy vf23, 0(vi10) | maddz.xyzw vf12, vf10, vf16 386 - vu.acc.madd(Mask::xyzw, gen.vtx_p0, gen.mat2, gen.vtx_load0.z()); lq_buffer(Mask::xy, vu.vf23, vu.vi10); - // lq.xyz vf16, 2(vi10) | nop 387 - lq_buffer(Mask::xyz, gen.vtx_load0, vu.vi10 + 2); - // iand vi06, vi02, vi11 | nop 388 - vu.vi06 = vu.vi02 & vu.vi11; - // mfir.x vf22, vi06 | nop 389 - vu.vf22.mfir(Mask::x, vu.vi06); - // nop | nop 390 - - // nop | nop 391 - - // nop | nop 392 - - // nop | itof12.xyz vf18, vf22 393 - vu.vf18.itof12(Mask::xyz, vu.vf22); - // div Q, vf01.x, vf12.w | mul.xyzw vf26, vf12, vf05 394 - vu.vf26.mul(Mask::xyzw, gen.vtx_p0, gen.hmge_scale); vu.Q = gen.fog.x() / gen.vtx_p0.w(); - // nop | nop 395 - - // nop | mulaw.xyzw ACC, vf11, vf00 396 - vu.acc.mula(Mask::xyzw, gen.mat3, vu.vf00.w()); - // mtir vi03, vf23.x | maddax.xyzw ACC, vf08, vf16 397 - vu.acc.madda(Mask::xyzw, gen.mat0, gen.vtx_load0.x()); vu.vi03 = vu.vf23.x_as_u16(); - // iaddi vi10, vi10, 0x3 | madday.xyzw ACC, vf09, vf16 398 - vu.acc.madda(Mask::xyzw, gen.mat1, gen.vtx_load0.y()); vu.vi10 = vu.vi10 + 3; - // lq.xy vf24, 0(vi10) | maddz.xyzw vf13, vf10, vf16 399 - vu.acc.madd(Mask::xyzw, gen.vtx_p1, gen.mat2, gen.vtx_load0.z()); lq_buffer(Mask::xy, vu.vf24, vu.vi10); - // lq.xyz vf16, 2(vi10) | nop 400 - lq_buffer(Mask::xyz, gen.vtx_load0, vu.vi10 + 2); - // iand vi07, vi03, vi11 | nop 401 - vu.vi07 = vu.vi03 & vu.vi11; - // mfir.x vf23, vi07 | mul.xyz vf12, vf12, Q 402 - gen.vtx_p0.mul(Mask::xyz, gen.vtx_p0, vu.Q); vu.vf23.mfir(Mask::x, vu.vi07); - // fcset 0x0 | nop 403 - cf = 0; - // nop | nop 404 - - // nop | mul.xyz vf18, vf18, Q 405 - vu.vf18.mul(Mask::xyz, vu.vf18, vu.Q); - // nop | itof12.xyz vf19, vf23 406 - vu.vf19.itof12(Mask::xyz, vu.vf23); - // div Q, vf01.x, vf13.w | mulaw.xyzw ACC, vf11, vf00 407 - vu.acc.mula(Mask::xyzw, gen.mat3, vu.vf00.w()); vu.Q = gen.fog.x() / gen.vtx_p1.w(); - // nop | add.xyzw vf12, vf12, vf04 408 - gen.vtx_p0.add(Mask::xyzw, gen.vtx_p0, gen.hvdf_off); - // nop | maddax.xyzw ACC, vf08, vf16 409 - vu.acc.madda(Mask::xyzw, gen.mat0, gen.vtx_load0.x()); - // mtir vi04, vf24.x | madday.xyzw ACC, vf09, vf16 410 - vu.acc.madda(Mask::xyzw, gen.mat1, gen.vtx_load0.y()); vu.vi04 = vu.vf24.x_as_u16(); - // iaddi vi10, vi10, 0x3 | maddz.xyzw vf14, vf10, vf16 411 - vu.acc.madd(Mask::xyzw, gen.vtx_p2, gen.mat2, gen.vtx_load0.z()); vu.vi10 = vu.vi10 + 3; - // lq.xy vf25, 0(vi10) | miniz.w vf12, vf12, vf01 412 - gen.vtx_p0.mini(Mask::w, gen.vtx_p0, gen.fog.z()); lq_buffer(Mask::xy, vu.vf25, vu.vi10); - // lq.xyz vf16, 2(vi10) | mul.xyzw vf27, vf13, vf05 413 - vu.vf27.mul(Mask::xyzw, gen.vtx_p1, gen.hmge_scale); lq_buffer(Mask::xyz, gen.vtx_load0, vu.vi10 + 2); - // iand vi08, vi04, vi11 | nop 414 - vu.vi08 = vu.vi04 & vu.vi11; - // mfir.x vf24, vi08 | mul.xyz vf13, vf13, Q 415 - gen.vtx_p1.mul(Mask::xyz, gen.vtx_p1, vu.Q); vu.vf24.mfir(Mask::x, vu.vi08); - // nop | maxy.w vf12, vf12, vf01 416 - gen.vtx_p0.max(Mask::w, gen.vtx_p0, gen.fog.y()); - // nop | clipw.xyz vf26, vf26 417 - cf = clip(vu.vf26, vu.vf26.w(), cf); - // nop | mul.xyz vf19, vf19, Q 418 - vu.vf19.mul(Mask::xyz, vu.vf19, vu.Q); - // BRANCH! - // ibeq vi02, vi06, L35 | itof12.xyz vf20, vf24 419 - vu.vf20.itof12(Mask::xyz, vu.vf24); bc = (vu.vi02 == vu.vi06); - // div Q, vf01.x, vf14.w | mulaw.xyzw ACC, vf11, vf00 420 - vu.acc.mula(Mask::xyzw, gen.mat3, vu.vf00.w()); vu.Q = gen.fog.x() / gen.vtx_p2.w(); - if (bc) { goto L35; } - - // nop | addw.w vf12, vf12, vf01 421 - gen.vtx_p0.add(Mask::w, gen.vtx_p0, kFogFloatOffset); - L35: - // nop | add.xyzw vf13, vf13, vf04 422 - gen.vtx_p1.add(Mask::xyzw, gen.vtx_p1, gen.hvdf_off); - // nop | maddax.xyzw ACC, vf08, vf16 423 - vu.acc.madda(Mask::xyzw, gen.mat0, gen.vtx_load0.x()); - // mtir vi05, vf25.x | madday.xyzw ACC, vf09, vf16 424 - vu.acc.madda(Mask::xyzw, gen.mat1, gen.vtx_load0.y()); vu.vi05 = vu.vf25.x_as_u16(); - // iaddi vi10, vi10, 0x3 | maddz.xyzw vf15, vf10, vf16 425 - vu.acc.madd(Mask::xyzw, gen.vtx_p3, gen.mat2, gen.vtx_load0.z()); vu.vi10 = vu.vi10 + 3; - // lq.xy vf22, 0(vi10) | miniz.w vf13, vf13, vf01 426 - gen.vtx_p1.mini(Mask::w, gen.vtx_p1, gen.fog.z()); lq_buffer(Mask::xy, vu.vf22, vu.vi10); - // lq.xyz vf16, 2(vi10) | mul.xyzw vf28, vf14, vf05 427 - vu.vf28.mul(Mask::xyzw, gen.vtx_p2, gen.hmge_scale); lq_buffer(Mask::xyz, gen.vtx_load0, vu.vi10 + 2); - // iand vi09, vi05, vi11 | ftoi4.xyzw vf12, vf12 428 - gen.vtx_p0.ftoi4_check(Mask::xyzw, gen.vtx_p0); vu.vi09 = vu.vi05 & vu.vi11; - // mfir.x vf25, vi09 | mul.xyz vf14, vf14, Q 429 - gen.vtx_p2.mul(Mask::xyz, gen.vtx_p2, vu.Q); vu.vf25.mfir(Mask::x, vu.vi09); - // sq.xyzw vf18, -12(vi10) | maxy.w vf13, vf13, vf01 430 - gen.vtx_p1.max(Mask::w, gen.vtx_p1, gen.fog.y()); sq_buffer(Mask::xyzw, vu.vf18, vu.vi10 + -12); - // BRANCH! - // ibeq vi14, vi10, L46 | clipw.xyz vf27, vf27 431 - cf = clip(vu.vf27, vu.vf27.w(), cf); bc = (vu.vi14 == vu.vi10); - // sq.xyzw vf12, -10(vi10) | mul.xyz vf20, vf20, Q 432 - vu.vf20.mul(Mask::xyz, vu.vf20, vu.Q); sq_buffer(Mask::xyzw, gen.vtx_p0, vu.vi10 + -10); - if (bc) { goto L46; } - - // BRANCH! - // ibeq vi03, vi07, L36 | itof12.xyz vf21, vf25 433 - vu.vf21.itof12(Mask::xyz, vu.vf25); bc = (vu.vi03 == vu.vi07); - // div Q, vf01.x, vf15.w | mulaw.xyzw ACC, vf11, vf00 434 - vu.acc.mula(Mask::xyzw, gen.mat3, vu.vf00.w()); vu.Q = gen.fog.x() / gen.vtx_p3.w(); - if (bc) { goto L36; } - - // nop | addw.w vf13, vf13, vf01 435 - gen.vtx_p1.add(Mask::w, gen.vtx_p1, kFogFloatOffset); - L36: - // nop | add.xyzw vf14, vf14, vf04 436 - gen.vtx_p2.add(Mask::xyzw, gen.vtx_p2, gen.hvdf_off); - // nop | maddax.xyzw ACC, vf08, vf16 437 - vu.acc.madda(Mask::xyzw, gen.mat0, gen.vtx_load0.x()); - // mtir vi02, vf22.x | madday.xyzw ACC, vf09, vf16 438 - vu.acc.madda(Mask::xyzw, gen.mat1, gen.vtx_load0.y()); vu.vi02 = vu.vf22.x_as_u16(); - // iaddi vi10, vi10, 0x3 | maddz.xyzw vf12, vf10, vf16 439 - vu.acc.madd(Mask::xyzw, gen.vtx_p0, gen.mat2, gen.vtx_load0.z()); vu.vi10 = vu.vi10 + 3; - // lq.xy vf23, 0(vi10) | miniz.w vf14, vf14, vf01 440 - gen.vtx_p2.mini(Mask::w, gen.vtx_p2, gen.fog.z()); lq_buffer(Mask::xy, vu.vf23, vu.vi10); - // lq.xyz vf16, 2(vi10) | mul.xyzw vf29, vf15, vf05 441 - vu.vf29.mul(Mask::xyzw, gen.vtx_p3, gen.hmge_scale); lq_buffer(Mask::xyz, gen.vtx_load0, vu.vi10 + 2); - // iand vi06, vi02, vi11 | ftoi4.xyzw vf13, vf13 442 - gen.vtx_p1.ftoi4_check(Mask::xyzw, gen.vtx_p1); vu.vi06 = vu.vi02 & vu.vi11; - // mfir.x vf22, vi06 | mul.xyz vf15, vf15, Q 443 - gen.vtx_p3.mul(Mask::xyz, gen.vtx_p3, vu.Q); vu.vf22.mfir(Mask::x, vu.vi06); - // sq.xyzw vf19, -12(vi10) | maxy.w vf14, vf14, vf01 444 - gen.vtx_p2.max(Mask::w, gen.vtx_p2, gen.fog.y()); sq_buffer(Mask::xyzw, vu.vf19, vu.vi10 + -12); - // BRANCH! - // ibeq vi14, vi10, L46 | clipw.xyz vf28, vf28 445 - cf = clip(vu.vf28, vu.vf28.w(), cf); bc = (vu.vi14 == vu.vi10); - // sq.xyzw vf13, -10(vi10) | mul.xyz vf21, vf21, Q 446 - vu.vf21.mul(Mask::xyz, vu.vf21, vu.Q); sq_buffer(Mask::xyzw, gen.vtx_p1, vu.vi10 + -10); - if (bc) { goto L46; } - - L37: - // BRANCH! - // ibeq vi04, vi08, L38 | itof12.xyz vf18, vf22 447 - vu.vf18.itof12(Mask::xyz, vu.vf22); bc = (vu.vi04 == vu.vi08); - // div Q, vf01.x, vf12.w | mulaw.xyzw ACC, vf11, vf00 448 - vu.acc.mula(Mask::xyzw, gen.mat3, vu.vf00.w()); vu.Q = gen.fog.x() / gen.vtx_p0.w(); - if (bc) { goto L38; } - - // nop | addw.w vf14, vf14, vf01 449 - gen.vtx_p2.add(Mask::w, gen.vtx_p2, kFogFloatOffset); - L38: - // fcand vi01, 0x3ffff | add.xyzw vf15, vf15, vf04 450 - gen.vtx_p3.add(Mask::xyzw, gen.vtx_p3, gen.hvdf_off); vu.vi01 = cf & 0x3ffff; - - // BRANCH! - // ibne vi00, vi01, L55 | maddax.xyzw ACC, vf08, vf16 451 - vu.acc.madda(Mask::xyzw, gen.mat0, gen.vtx_load0.x()); bc = (vu.vi01 != 0); - // mtir vi03, vf23.x | madday.xyzw ACC, vf09, vf16 452 - vu.acc.madda(Mask::xyzw, gen.mat1, gen.vtx_load0.y()); vu.vi03 = vu.vf23.x_as_u16(); - if (bc) { goto L55; } - - L39: - // iaddi vi10, vi10, 0x3 | maddz.xyzw vf13, vf10, vf16 453 - vu.acc.madd(Mask::xyzw, gen.vtx_p1, gen.mat2, gen.vtx_load0.z()); vu.vi10 = vu.vi10 + 3; - // lq.xy vf24, 0(vi10) | miniz.w vf15, vf15, vf01 454 - gen.vtx_p3.mini(Mask::w, gen.vtx_p3, gen.fog.z()); lq_buffer(Mask::xy, vu.vf24, vu.vi10); - // lq.xyz vf16, 2(vi10) | mul.xyzw vf26, vf12, vf05 455 - vu.vf26.mul(Mask::xyzw, gen.vtx_p0, gen.hmge_scale); lq_buffer(Mask::xyz, gen.vtx_load0, vu.vi10 + 2); - // iand vi07, vi03, vi11 | ftoi4.xyzw vf14, vf14 456 - gen.vtx_p2.ftoi4_check(Mask::xyzw, gen.vtx_p2); vu.vi07 = vu.vi03 & vu.vi11; - // mfir.x vf23, vi07 | mul.xyz vf12, vf12, Q 457 - gen.vtx_p0.mul(Mask::xyz, gen.vtx_p0, vu.Q); vu.vf23.mfir(Mask::x, vu.vi07); - // sq.xyzw vf20, -12(vi10) | maxy.w vf15, vf15, vf01 458 - gen.vtx_p3.max(Mask::w, gen.vtx_p3, gen.fog.y()); sq_buffer(Mask::xyzw, vu.vf20, vu.vi10 + -12); - // BRANCH! - // ibeq vi14, vi10, L46 | clipw.xyz vf29, vf29 459 - cf = clip(vu.vf29, vu.vf29.w(), cf); bc = (vu.vi14 == vu.vi10); - // sq.xyzw vf14, -10(vi10) | mul.xyz vf18, vf18, Q 460 - vu.vf18.mul(Mask::xyz, vu.vf18, vu.Q); sq_buffer(Mask::xyzw, gen.vtx_p2, vu.vi10 + -10); - if (bc) { goto L46; } - - // BRANCH! - // ibeq vi05, vi09, L40 | itof12.xyz vf19, vf23 461 - vu.vf19.itof12(Mask::xyz, vu.vf23); bc = (vu.vi05 == vu.vi09); - // div Q, vf01.x, vf13.w | mulaw.xyzw ACC, vf11, vf00 462 - vu.acc.mula(Mask::xyzw, gen.mat3, vu.vf00.w()); vu.Q = gen.fog.x() / gen.vtx_p1.w(); - if (bc) { goto L40; } - - // nop | addw.w vf15, vf15, vf01 463 - gen.vtx_p3.add(Mask::w, gen.vtx_p3, kFogFloatOffset); - L40: - // fcand vi01, 0x3ffff | add.xyzw vf12, vf12, vf04 464 - gen.vtx_p0.add(Mask::xyzw, gen.vtx_p0, gen.hvdf_off); vu.vi01 = cf & 0x3ffff; - - // BRANCH! - // ibne vi00, vi01, L59 | maddax.xyzw ACC, vf08, vf16 465 - vu.acc.madda(Mask::xyzw, gen.mat0, gen.vtx_load0.x()); bc = (vu.vi01 != 0); - // mtir vi04, vf24.x | madday.xyzw ACC, vf09, vf16 466 - vu.acc.madda(Mask::xyzw, gen.mat1, gen.vtx_load0.y()); vu.vi04 = vu.vf24.x_as_u16(); - if (bc) { goto L59; } - - L41: - // iaddi vi10, vi10, 0x3 | maddz.xyzw vf14, vf10, vf16 467 - vu.acc.madd(Mask::xyzw, gen.vtx_p2, gen.mat2, gen.vtx_load0.z()); vu.vi10 = vu.vi10 + 3; - // lq.xy vf25, 0(vi10) | miniz.w vf12, vf12, vf01 468 - gen.vtx_p0.mini(Mask::w, gen.vtx_p0, gen.fog.z()); lq_buffer(Mask::xy, vu.vf25, vu.vi10); - // lq.xyz vf16, 2(vi10) | mul.xyzw vf27, vf13, vf05 469 - vu.vf27.mul(Mask::xyzw, gen.vtx_p1, gen.hmge_scale); lq_buffer(Mask::xyz, gen.vtx_load0, vu.vi10 + 2); - // iand vi08, vi04, vi11 | ftoi4.xyzw vf15, vf15 470 - gen.vtx_p3.ftoi4_check(Mask::xyzw, gen.vtx_p3); vu.vi08 = vu.vi04 & vu.vi11; - // mfir.x vf24, vi08 | mul.xyz vf13, vf13, Q 471 - gen.vtx_p1.mul(Mask::xyz, gen.vtx_p1, vu.Q); vu.vf24.mfir(Mask::x, vu.vi08); - // sq.xyzw vf21, -12(vi10) | maxy.w vf12, vf12, vf01 472 - gen.vtx_p0.max(Mask::w, gen.vtx_p0, gen.fog.y()); sq_buffer(Mask::xyzw, vu.vf21, vu.vi10 + -12); - // BRANCH! - // ibeq vi14, vi10, L46 | clipw.xyz vf26, vf26 473 - cf = clip(vu.vf26, vu.vf26.w(), cf); bc = (vu.vi14 == vu.vi10); - // sq.xyzw vf15, -10(vi10) | mul.xyz vf19, vf19, Q 474 - vu.vf19.mul(Mask::xyz, vu.vf19, vu.Q); sq_buffer(Mask::xyzw, gen.vtx_p3, vu.vi10 + -10); - if (bc) { goto L46; } - - // BRANCH! - // ibeq vi02, vi06, L42 | itof12.xyz vf20, vf24 475 - vu.vf20.itof12(Mask::xyz, vu.vf24); bc = (vu.vi02 == vu.vi06); - // div Q, vf01.x, vf14.w | mulaw.xyzw ACC, vf11, vf00 476 - vu.acc.mula(Mask::xyzw, gen.mat3, vu.vf00.w()); vu.Q = gen.fog.x() / gen.vtx_p2.w(); - if (bc) { goto L42; } - - // nop | addw.w vf12, vf12, vf01 477 - gen.vtx_p0.add(Mask::w, gen.vtx_p0, kFogFloatOffset); - L42: - // fcand vi01, 0x3ffff | add.xyzw vf13, vf13, vf04 478 - gen.vtx_p1.add(Mask::xyzw, gen.vtx_p1, gen.hvdf_off); vu.vi01 = cf & 0x3ffff; - - // BRANCH! - // ibne vi00, vi01, L47 | maddax.xyzw ACC, vf08, vf16 479 - vu.acc.madda(Mask::xyzw, gen.mat0, gen.vtx_load0.x()); bc = (vu.vi01 != 0); - // mtir vi05, vf25.x | madday.xyzw ACC, vf09, vf16 480 - vu.acc.madda(Mask::xyzw, gen.mat1, gen.vtx_load0.y()); vu.vi05 = vu.vf25.x_as_u16(); - if (bc) { goto L47; } - - L43: - // iaddi vi10, vi10, 0x3 | maddz.xyzw vf15, vf10, vf16 481 - vu.acc.madd(Mask::xyzw, gen.vtx_p3, gen.mat2, gen.vtx_load0.z()); vu.vi10 = vu.vi10 + 3; - // lq.xy vf22, 0(vi10) | miniz.w vf13, vf13, vf01 482 - gen.vtx_p1.mini(Mask::w, gen.vtx_p1, gen.fog.z()); lq_buffer(Mask::xy, vu.vf22, vu.vi10); - // lq.xyz vf16, 2(vi10) | mul.xyzw vf28, vf14, vf05 483 - vu.vf28.mul(Mask::xyzw, gen.vtx_p2, gen.hmge_scale); lq_buffer(Mask::xyz, gen.vtx_load0, vu.vi10 + 2); - // iand vi09, vi05, vi11 | ftoi4.xyzw vf12, vf12 484 - gen.vtx_p0.ftoi4_check(Mask::xyzw, gen.vtx_p0); vu.vi09 = vu.vi05 & vu.vi11; - // mfir.x vf25, vi09 | mul.xyz vf14, vf14, Q 485 - gen.vtx_p2.mul(Mask::xyz, gen.vtx_p2, vu.Q); vu.vf25.mfir(Mask::x, vu.vi09); - // sq.xyzw vf18, -12(vi10) | maxy.w vf13, vf13, vf01 486 - gen.vtx_p1.max(Mask::w, gen.vtx_p1, gen.fog.y()); sq_buffer(Mask::xyzw, vu.vf18, vu.vi10 + -12); - // BRANCH! - // ibeq vi14, vi10, L46 | clipw.xyz vf27, vf27 487 - cf = clip(vu.vf27, vu.vf27.w(), cf); bc = (vu.vi14 == vu.vi10); - // sq.xyzw vf12, -10(vi10) | mul.xyz vf20, vf20, Q 488 - vu.vf20.mul(Mask::xyz, vu.vf20, vu.Q); sq_buffer(Mask::xyzw, gen.vtx_p0, vu.vi10 + -10); - if (bc) { goto L46; } - - // BRANCH! - // ibeq vi03, vi07, L44 | itof12.xyz vf21, vf25 489 - vu.vf21.itof12(Mask::xyz, vu.vf25); bc = (vu.vi03 == vu.vi07); - // div Q, vf01.x, vf15.w | mulaw.xyzw ACC, vf11, vf00 490 - vu.acc.mula(Mask::xyzw, gen.mat3, vu.vf00.w()); vu.Q = gen.fog.x() / gen.vtx_p3.w(); - if (bc) { goto L44; } - - // nop | addw.w vf13, vf13, vf01 491 - gen.vtx_p1.add(Mask::w, gen.vtx_p1, kFogFloatOffset); - L44: - // fcand vi01, 0x3ffff | add.xyzw vf14, vf14, vf04 492 - gen.vtx_p2.add(Mask::xyzw, gen.vtx_p2, gen.hvdf_off); vu.vi01 = cf & 0x3ffff; - - // BRANCH! - // ibne vi00, vi01, L51 | maddax.xyzw ACC, vf08, vf16 493 - vu.acc.madda(Mask::xyzw, gen.mat0, gen.vtx_load0.x()); bc = (vu.vi01 != 0); - // mtir vi02, vf22.x | madday.xyzw ACC, vf09, vf16 494 - vu.acc.madda(Mask::xyzw, gen.mat1, gen.vtx_load0.y()); vu.vi02 = vu.vf22.x_as_u16(); - if (bc) { goto L51; } - - L45: - // iaddi vi10, vi10, 0x3 | maddz.xyzw vf12, vf10, vf16 495 - vu.acc.madd(Mask::xyzw, gen.vtx_p0, gen.mat2, gen.vtx_load0.z()); vu.vi10 = vu.vi10 + 3; - // lq.xy vf23, 0(vi10) | miniz.w vf14, vf14, vf01 496 - gen.vtx_p2.mini(Mask::w, gen.vtx_p2, gen.fog.z()); lq_buffer(Mask::xy, vu.vf23, vu.vi10); - // lq.xyz vf16, 2(vi10) | mul.xyzw vf29, vf15, vf05 497 - vu.vf29.mul(Mask::xyzw, gen.vtx_p3, gen.hmge_scale); lq_buffer(Mask::xyz, gen.vtx_load0, vu.vi10 + 2); - // iand vi06, vi02, vi11 | ftoi4.xyzw vf13, vf13 498 - gen.vtx_p1.ftoi4_check(Mask::xyzw, gen.vtx_p1); vu.vi06 = vu.vi02 & vu.vi11; - // mfir.x vf22, vi06 | mul.xyz vf15, vf15, Q 499 - gen.vtx_p3.mul(Mask::xyz, gen.vtx_p3, vu.Q); vu.vf22.mfir(Mask::x, vu.vi06); - // sq.xyzw vf19, -12(vi10) | maxy.w vf14, vf14, vf01 500 - gen.vtx_p2.max(Mask::w, gen.vtx_p2, gen.fog.y()); sq_buffer(Mask::xyzw, vu.vf19, vu.vi10 + -12); - // BRANCH! - // ibne vi14, vi10, L37 | clipw.xyz vf28, vf28 501 - cf = clip(vu.vf28, vu.vf28.w(), cf); bc = (vu.vi14 != vu.vi10); - // sq.xyzw vf13, -10(vi10) | mul.xyz vf21, vf21, Q 502 - vu.vf21.mul(Mask::xyz, vu.vf21, vu.Q); sq_buffer(Mask::xyzw, gen.vtx_p1, vu.vi10 + -10); - if (bc) { goto L37; } - - L46: - // BRANCH! - // b L82 | nop 503 - bc = true; - // ilw.w vi12, 906(vi00) | nop 504 - ilw_buffer(Mask::w, vu.vi12, 906); - if (bc) { goto L82; } - - L47: - // BRANCH! - // ibne vi02, vi06, L43 | nop 505 - bc = (vu.vi02 != vu.vi06); - // sq.xyzw vf23, 998(vi00) | addw.w vf12, vf12, vf01 506 - gen.vtx_p0.add(Mask::w, gen.vtx_p0, kFogFloatOffset); sq_buffer(Mask::xyzw, vu.vf23, 998); - if (bc) { goto L43; } - - // sq.xyzw vf24, 999(vi00) | mul.xyzw vf23, vf28, vf07 507 - vu.vf23.mul(Mask::xyzw, vu.vf28, gen.guard); sq_buffer(Mask::xyzw, vu.vf24, 999); - // sq.xyzw vf25, 1000(vi00) | mul.xyzw vf24, vf29, vf07 508 - vu.vf24.mul(Mask::xyzw, vu.vf29, gen.guard); sq_buffer(Mask::xyzw, vu.vf25, 1000); - // isw.x vi01, 1001(vi00) | mul.xyzw vf25, vf26, vf07 509 - vu.vf25.mul(Mask::xyzw, vu.vf26, gen.guard); isw_buffer(Mask::x, vu.vi01, 1001); - // isw.y vi02, 1001(vi00) | nop 510 - isw_buffer(Mask::y, vu.vi02, 1001); - // isw.z vi03, 1001(vi00) | clipw.xyz vf23, vf23 511 - // TODO: check clipping pipeline here. - cf0 = clip(vu.vf23, vu.vf23.w(), cf); isw_buffer(Mask::z, vu.vi03, 1001); - // isw.w vi04, 1001(vi00) | clipw.xyz vf24, vf24 512 - cf1 = clip(vu.vf24, vu.vf24.w(), cf0); isw_buffer(Mask::w, vu.vi04, 1001); - // mfir.x vf31, vi05 | clipw.xyz vf25, vf25 513 - cf2 = clip(vu.vf25, vu.vf25.w(), cf1); vu.vf31.mfir(Mask::x, vu.vi05); - // iaddiu vi04, vi00, 0x3f | nop 514 - vu.vi04 = 0x3f; /* 63 */ - // fcget vi01 | nop 515 - vu.vi01 = cf0; - // fcget vi02 | nop 516 - vu.vi02 = cf1; - // fcget vi03 | nop 517 - vu.vi03 = cf2; - cf = cf2; - // iand vi01, vi01, vi04 | clipw.xyz vf28, vf28 518 - // TODO, is this right? - cf = clip(vu.vf28, vu.vf28.w(), cf); vu.vi01 = vu.vi01 & vu.vi04; - // iand vi01, vi01, vi02 | clipw.xyz vf29, vf29 519 - cf = clip(vu.vf29, vu.vf29.w(), cf); vu.vi01 = vu.vi01 & vu.vi02; - // iand vi01, vi01, vi03 | clipw.xyz vf26, vf26 520 - cf = clip(vu.vf26, vu.vf26.w(), cf); vu.vi01 = vu.vi01 & vu.vi03; - // mfir.y vf31, vi06 | nop 521 - vu.vf31.mfir(Mask::y, vu.vi06); - // BRANCH! - // ibeq vi00, vi01, L49 | nop 522 - bc = (vu.vi01 == 0); - // mfir.z vf31, vi07 | nop 523 - vu.vf31.mfir(Mask::z, vu.vi07); - if (!clipping_hack && bc) { goto L49; } - - // L48: - // div Q, vf01.x, vf14.w | nop 524 - vu.Q = gen.fog.x() / gen.vtx_p2.w(); - // lq.xyzw vf23, 998(vi00) | nop 525 - lq_buffer(Mask::xyzw, vu.vf23, 998); - // lq.xyzw vf24, 999(vi00) | nop 526 - lq_buffer(Mask::xyzw, vu.vf24, 999); - // lq.xyzw vf25, 1000(vi00) | nop 527 - lq_buffer(Mask::xyzw, vu.vf25, 1000); - // ilw.x vi01, 1001(vi00) | nop 528 - ilw_buffer(Mask::x, vu.vi01, 1001); - // ilw.y vi02, 1001(vi00) | nop 529 - ilw_buffer(Mask::y, vu.vi02, 1001); - // ilw.z vi03, 1001(vi00) | nop 530 - ilw_buffer(Mask::z, vu.vi03, 1001); - // BRANCH! - // b L43 | nop 531 - bc = true; - // ilw.w vi04, 1001(vi00) | nop 532 - ilw_buffer(Mask::w, vu.vi04, 1001); - if (bc) { goto L43; } - - L49: - ASSERT(false); - - L51: - // BRANCH! - // ibne vi03, vi07, L45 | nop 588 - bc = (vu.vi03 != vu.vi07); - // sq.xyzw vf23, 998(vi00) | addw.w vf13, vf13, vf01 589 - gen.vtx_p1.add(Mask::w, gen.vtx_p1, kFogFloatOffset); sq_buffer(Mask::xyzw, vu.vf23, 998); - if (bc) { goto L45; } - - // sq.xyzw vf24, 999(vi00) | mul.xyzw vf23, vf29, vf07 590 - vu.vf23.mul(Mask::xyzw, vu.vf29, gen.guard); sq_buffer(Mask::xyzw, vu.vf24, 999); - // sq.xyzw vf25, 1000(vi00) | mul.xyzw vf24, vf26, vf07 591 - vu.vf24.mul(Mask::xyzw, vu.vf26, gen.guard); sq_buffer(Mask::xyzw, vu.vf25, 1000); - // isw.x vi01, 1001(vi00) | mul.xyzw vf25, vf27, vf07 592 - vu.vf25.mul(Mask::xyzw, vu.vf27, gen.guard); isw_buffer(Mask::x, vu.vi01, 1001); - // isw.y vi02, 1001(vi00) | nop 593 - isw_buffer(Mask::y, vu.vi02, 1001); - // TODO more clipping pipeline? - // isw.z vi03, 1001(vi00) | clipw.xyz vf23, vf23 594 - cf0 = clip(vu.vf23, vu.vf23.w(), cf); isw_buffer(Mask::z, vu.vi03, 1001); - // isw.w vi04, 1001(vi00) | clipw.xyz vf24, vf24 595 - cf1 = clip(vu.vf24, vu.vf24.w(), cf0); isw_buffer(Mask::w, vu.vi04, 1001); - // mfir.x vf31, vi05 | clipw.xyz vf25, vf25 596 - cf2 = clip(vu.vf25, vu.vf25.w(), cf1); vu.vf31.mfir(Mask::x, vu.vi05); - // iaddiu vi04, vi00, 0x3f | nop 597 - vu.vi04 = 0x3f; /* 63 */ - // fcget vi01 | nop 598 - vu.vi01 = cf0; - // fcget vi02 | nop 599 - vu.vi02 = cf1; - // fcget vi03 | nop 600 - vu.vi03 = cf2; - cf = cf2; - // iand vi01, vi01, vi04 | clipw.xyz vf29, vf29 601 - cf = clip(vu.vf29, vu.vf29.w(), cf); vu.vi01 = vu.vi01 & vu.vi04; - // iand vi01, vi01, vi02 | clipw.xyz vf26, vf26 602 - cf = clip(vu.vf26, vu.vf26.w(), cf); vu.vi01 = vu.vi01 & vu.vi02; - // iand vi01, vi01, vi03 | clipw.xyz vf27, vf27 603 - cf = clip(vu.vf27, vu.vf27.w(), cf); vu.vi01 = vu.vi01 & vu.vi03; - // mfir.y vf31, vi06 | nop 604 - vu.vf31.mfir(Mask::y, vu.vi06); - // BRANCH! - // ibeq vi00, vi01, L53 | nop 605 - bc = (vu.vi01 == 0); - // mfir.z vf31, vi07 | nop 606 - vu.vf31.mfir(Mask::z, vu.vi07); - if (!clipping_hack && bc) { goto L53; } - - // L52: - // div Q, vf01.x, vf15.w | nop 607 - vu.Q = gen.fog.x() / gen.vtx_p3.w(); - // lq.xyzw vf23, 998(vi00) | nop 608 - lq_buffer(Mask::xyzw, vu.vf23, 998); - // lq.xyzw vf24, 999(vi00) | nop 609 - lq_buffer(Mask::xyzw, vu.vf24, 999); - // lq.xyzw vf25, 1000(vi00) | nop 610 - lq_buffer(Mask::xyzw, vu.vf25, 1000); - // ilw.x vi01, 1001(vi00) | nop 611 - ilw_buffer(Mask::x, vu.vi01, 1001); - // ilw.y vi02, 1001(vi00) | nop 612 - ilw_buffer(Mask::y, vu.vi02, 1001); - // ilw.z vi03, 1001(vi00) | nop 613 - ilw_buffer(Mask::z, vu.vi03, 1001); - // BRANCH! - // b L45 | nop 614 - bc = true; - // ilw.w vi04, 1001(vi00) | nop 615 - ilw_buffer(Mask::w, vu.vi04, 1001); - if (bc) { goto L45; } - - L53: - ASSERT(false); - - L55: - // BRANCH! - // ibne vi04, vi08, L39 | nop 671 - bc = (vu.vi04 != vu.vi08); - // sq.xyzw vf23, 998(vi00) | addw.w vf14, vf14, vf01 672 - gen.vtx_p2.add(Mask::w, gen.vtx_p2, kFogFloatOffset); sq_buffer(Mask::xyzw, vu.vf23, 998); - if (bc) { goto L39; } - - // sq.xyzw vf24, 999(vi00) | mul.xyzw vf23, vf26, vf07 673 - vu.vf23.mul(Mask::xyzw, vu.vf26, gen.guard); sq_buffer(Mask::xyzw, vu.vf24, 999); - // sq.xyzw vf25, 1000(vi00) | mul.xyzw vf24, vf27, vf07 674 - vu.vf24.mul(Mask::xyzw, vu.vf27, gen.guard); sq_buffer(Mask::xyzw, vu.vf25, 1000); - // isw.x vi01, 1001(vi00) | mul.xyzw vf25, vf28, vf07 675 - vu.vf25.mul(Mask::xyzw, vu.vf28, gen.guard); isw_buffer(Mask::x, vu.vi01, 1001); - // isw.y vi02, 1001(vi00) | nop 676 - isw_buffer(Mask::y, vu.vi02, 1001); - // TODO more clipping? - // isw.z vi03, 1001(vi00) | clipw.xyz vf23, vf23 677 - cf0 = clip(vu.vf23, vu.vf23.w(), cf); isw_buffer(Mask::z, vu.vi03, 1001); - // isw.w vi04, 1001(vi00) | clipw.xyz vf24, vf24 678 - cf1 = clip(vu.vf24, vu.vf24.w(), cf0); isw_buffer(Mask::w, vu.vi04, 1001); - // mfir.x vf31, vi05 | clipw.xyz vf25, vf25 679 - cf2 = clip(vu.vf25, vu.vf25.w(), cf1); vu.vf31.mfir(Mask::x, vu.vi05); - // iaddiu vi04, vi00, 0x3f | nop 680 - vu.vi04 = 0x3f; /* 63 */ - // fcget vi01 | nop 681 - vu.vi01 = cf0; - // fcget vi02 | nop 682 - vu.vi02 = cf1; - // fcget vi03 | nop 683 - vu.vi03 = cf2; - cf = cf2; - // iand vi01, vi01, vi04 | clipw.xyz vf26, vf26 684 - cf = clip(vu.vf26, vu.vf26.w(), cf); vu.vi01 = vu.vi01 & vu.vi04; - // iand vi01, vi01, vi02 | clipw.xyz vf27, vf27 685 - cf = clip(vu.vf27, vu.vf27.w(), cf); vu.vi01 = vu.vi01 & vu.vi02; - // iand vi01, vi01, vi03 | clipw.xyz vf28, vf28 686 - cf = clip(vu.vf28, vu.vf28.w(), cf); vu.vi01 = vu.vi01 & vu.vi03; - // mfir.y vf31, vi06 | nop 687 - vu.vf31.mfir(Mask::y, vu.vi06); - // BRANCH! - // ibeq vi00, vi01, L57 | nop 688 - bc = (vu.vi01 == 0); - // mfir.z vf31, vi07 | nop 689 - vu.vf31.mfir(Mask::z, vu.vi07); - if (!clipping_hack && bc) { goto L57; } - - // L56: - // div Q, vf01.x, vf12.w | nop 690 - vu.Q = gen.fog.x() / gen.vtx_p0.w(); - // lq.xyzw vf23, 998(vi00) | nop 691 - lq_buffer(Mask::xyzw, vu.vf23, 998); - // lq.xyzw vf24, 999(vi00) | nop 692 - lq_buffer(Mask::xyzw, vu.vf24, 999); - // lq.xyzw vf25, 1000(vi00) | nop 693 - lq_buffer(Mask::xyzw, vu.vf25, 1000); - // ilw.x vi01, 1001(vi00) | nop 694 - ilw_buffer(Mask::x, vu.vi01, 1001); - // ilw.y vi02, 1001(vi00) | nop 695 - ilw_buffer(Mask::y, vu.vi02, 1001); - // ilw.z vi03, 1001(vi00) | nop 696 - ilw_buffer(Mask::z, vu.vi03, 1001); - // BRANCH! - // b L39 | nop 697 - bc = true; - // ilw.w vi04, 1001(vi00) | nop 698 - ilw_buffer(Mask::w, vu.vi04, 1001); - if (bc) { goto L39; } - - L57: - ASSERT(false); - - L59: - // BRANCH! - // ibne vi05, vi09, L41 | nop 754 - bc = (vu.vi05 != vu.vi09); - // sq.xyzw vf23, 998(vi00) | addw.w vf15, vf15, vf01 755 - gen.vtx_p3.add(Mask::w, gen.vtx_p3, kFogFloatOffset); sq_buffer(Mask::xyzw, vu.vf23, 998); - if (bc) { goto L41; } - - // sq.xyzw vf24, 999(vi00) | mul.xyzw vf23, vf27, vf07 756 - vu.vf23.mul(Mask::xyzw, vu.vf27, gen.guard); sq_buffer(Mask::xyzw, vu.vf24, 999); - // sq.xyzw vf25, 1000(vi00) | mul.xyzw vf24, vf28, vf07 757 - vu.vf24.mul(Mask::xyzw, vu.vf28, gen.guard); sq_buffer(Mask::xyzw, vu.vf25, 1000); - // isw.x vi01, 1001(vi00) | mul.xyzw vf25, vf29, vf07 758 - vu.vf25.mul(Mask::xyzw, vu.vf29, gen.guard); isw_buffer(Mask::x, vu.vi01, 1001); - // isw.y vi02, 1001(vi00) | nop 759 - isw_buffer(Mask::y, vu.vi02, 1001); - // isw.z vi03, 1001(vi00) | clipw.xyz vf23, vf23 760 - // TODO more clipping - cf0 = clip(vu.vf23, vu.vf23.w(), cf); isw_buffer(Mask::z, vu.vi03, 1001); - // isw.w vi04, 1001(vi00) | clipw.xyz vf24, vf24 761 - cf1 = clip(vu.vf24, vu.vf24.w(), cf0); isw_buffer(Mask::w, vu.vi04, 1001); - // mfir.x vf31, vi05 | clipw.xyz vf25, vf25 762 - cf2 = clip(vu.vf25, vu.vf25.w(), cf1); vu.vf31.mfir(Mask::x, vu.vi05); - // iaddiu vi04, vi00, 0x3f | nop 763 - cf = cf2; - vu.vi04 = 0x3f; /* 63 */ - // fcget vi01 | nop 764 - vu.vi01 = cf0; - // fcget vi02 | nop 765 - vu.vi02 = cf1; - // fcget vi03 | nop 766 - vu.vi03 = cf2; - // iand vi01, vi01, vi04 | clipw.xyz vf27, vf27 767 - cf = clip(vu.vf27, vu.vf27.w(), cf); vu.vi01 = vu.vi01 & vu.vi04; - // iand vi01, vi01, vi02 | clipw.xyz vf28, vf28 768 - cf = clip(vu.vf28, vu.vf28.w(), cf); vu.vi01 = vu.vi01 & vu.vi02; - // iand vi01, vi01, vi03 | clipw.xyz vf29, vf29 769 - cf = clip(vu.vf29, vu.vf29.w(), cf); vu.vi01 = vu.vi01 & vu.vi03; - // mfir.y vf31, vi06 | nop 770 - vu.vf31.mfir(Mask::y, vu.vi06); - // BRANCH! - // ibeq vi00, vi01, L61 | nop 771 - bc = (vu.vi01 == 0); - // mfir.z vf31, vi07 | nop 772 - vu.vf31.mfir(Mask::z, vu.vi07); - if (!clipping_hack && bc) { goto L61; } - - // L60: - // div Q, vf01.x, vf13.w | nop 773 - vu.Q = gen.fog.x() / gen.vtx_p1.w(); - // lq.xyzw vf23, 998(vi00) | nop 774 - lq_buffer(Mask::xyzw, vu.vf23, 998); - // lq.xyzw vf24, 999(vi00) | nop 775 - lq_buffer(Mask::xyzw, vu.vf24, 999); - // lq.xyzw vf25, 1000(vi00) | nop 776 - lq_buffer(Mask::xyzw, vu.vf25, 1000); - // ilw.x vi01, 1001(vi00) | nop 777 - ilw_buffer(Mask::x, vu.vi01, 1001); - // ilw.y vi02, 1001(vi00) | nop 778 - ilw_buffer(Mask::y, vu.vi02, 1001); - // ilw.z vi03, 1001(vi00) | nop 779 - ilw_buffer(Mask::z, vu.vi03, 1001); - // BRANCH! - // b L41 | nop 780 - bc = true; - // ilw.w vi04, 1001(vi00) | nop 781 - ilw_buffer(Mask::w, vu.vi04, 1001); - if (bc) { goto L41; } - - L61: - ASSERT(false); - - - L82: // R - // iaddi vi14, vi13, 0x7 | nop 1060 - vu.vi14 = vu.vi13 + 7; - // lq.xyzw vf03, 4(vi13) | nop 1061 - lq_buffer(Mask::xyzw, vu.vf03, vu.vi13 + 4); - // ilw.w vi02, 6(vi13) | nop 1062 - ilw_buffer(Mask::w, vu.vi02, vu.vi13 + 6); - // lq.xyzw vf21, 5(vi13) | nop 1063 - lq_buffer(Mask::xyzw, vu.vf21, vu.vi13 + 5); - // lq.xyzw vf22, 6(vi13) | nop 1064 - lq_buffer(Mask::xyzw, vu.vf22, vu.vi13 + 6); - L83: - // ilwr.w vi03, vi14 | nop 1065 - ilw_buffer(Mask::w, vu.vi03, vu.vi14); - // ilw.w vi04, 1(vi14) | nop 1066 - ilw_buffer(Mask::w, vu.vi04, vu.vi14 + 1); - // lqi.xyzw vf16, vi14 | nop 1067 - Vf adgif_temp0; - lq_buffer(Mask::xyzw, adgif_temp0, vu.vi14++); - // lqi.xyzw vf17, vi14 | nop 1068 - Vf adgif_temp1; - lq_buffer(Mask::xyzw, adgif_temp1, vu.vi14++); - // lqi.xyzw vf18, vi14 | nop 1069 - lq_buffer(Mask::xyzw, vu.vf18, vu.vi14++); - // lqi.xyzw vf19, vi14 | nop 1070 - lq_buffer(Mask::xyzw, vu.vf19, vu.vi14++); - // lqi.xyzw vf20, vi14 | nop 1071 - lq_buffer(Mask::xyzw, vu.vf20, vu.vi14++); - // iadd vi06, vi03, vi12 | nop 1072 - vu.vi06 = vu.vi03 + vu.vi12; - // sqi.xyzw vf02, vi06 | nop 1073 - sq_buffer(Mask::xyzw, gen.adgif_tmpl, vu.vi06++); - // sqi.xyzw vf16, vi06 | nop 1074 - sq_buffer(Mask::xyzw, adgif_temp0, vu.vi06++); - // sqi.xyzw vf17, vi06 | nop 1075 - sq_buffer(Mask::xyzw, adgif_temp1, vu.vi06++); - // sqi.xyzw vf18, vi06 | nop 1076 - sq_buffer(Mask::xyzw, vu.vf18, vu.vi06++); - // sqi.xyzw vf19, vi06 | nop 1077 - sq_buffer(Mask::xyzw, vu.vf19, vu.vi06++); - // sqi.xyzw vf20, vi06 | nop 1078 - sq_buffer(Mask::xyzw, vu.vf20, vu.vi06++); - // sqi.xyzw vf21, vi06 | nop 1079 - sq_buffer(Mask::xyzw, vu.vf21, vu.vi06++); - // sqi.xyzw vf22, vi06 | nop 1080 - sq_buffer(Mask::xyzw, vu.vf22, vu.vi06++); - // sqi.xyzw vf03, vi06 | nop 1081 - sq_buffer(Mask::xyzw, vu.vf03, vu.vi06++); - // BRANCH! - // ibgez vi04, L83 | nop 1082 - bc = ((s16)vu.vi04) >= 0; - // isw.x vi04, -1(vi06) | nop 1083 - isw_buffer(Mask::x, vu.vi04, vu.vi06 + -1); - if (bc) { goto L83; } - - // iadd vi02, vi12, vi02 | nop 1084 - vu.vi02 = vu.vi12 + vu.vi02; - // nop | nop 1085 - - // xgkick vi02 | nop 1086 - xgkick(vu.vi02, render_state, prof); - // isubiu vi01, vi12, 0x22e | nop 1087 - vu.vi01 = vu.vi12 - 0x22e; /* 558 */ - // nop | nop 1088 - - // BRANCH! - // ibltz vi01, L84 | nop 1089 - bc = ((s16)vu.vi01) < 0; - // iaddiu vi12, vi12, 0x117 | nop 1090 - vu.vi12 = vu.vi12 + 0x117; /* 279 */ - if (bc) { goto L84; } - - // iaddi vi12, vi00, 0x0 | nop 1091 - vu.vi12 = 0; - L84: - // nop | nop :e 1092 - - // nop | nop 1093 - - return; -} \ No newline at end of file diff --git a/game/graphics/opengl_renderer/GenericRenderer.cpp b/game/graphics/opengl_renderer/GenericRenderer.cpp deleted file mode 100644 index 1f66576c09..0000000000 --- a/game/graphics/opengl_renderer/GenericRenderer.cpp +++ /dev/null @@ -1,323 +0,0 @@ -#include "GenericRenderer.h" -#include "third-party/imgui/imgui.h" - -GenericRenderer::GenericRenderer(const std::string& name, BucketId my_id) - : BucketRenderer(name, my_id), - m_direct2(30000, 60000, 1000, name, true), - m_debug_gen2(name, my_id, 1500000, 10000, 3000, 800) {} - -void GenericRenderer::init_shaders(ShaderLibrary& shaders) { - m_direct2.init_shaders(shaders); - m_debug_gen2.init_shaders(shaders); -} - -void GenericRenderer::render(DmaFollower& dma, - SharedRenderState* render_state, - ScopedProfilerNode& prof) { - if (render_state->use_generic2) { - m_debug_gen2.render(dma, render_state, prof); - return; - } - m_xgkick_idx = 0; - m_skipped_tags = 0; - m_debug.clear(); - - // if the first draw should have no blending, it sets ABE in PRIM, but not ALPHA. - // the default ALPHA doesn't seem to be right. I don't know what's supposed to set it here. - // although this is definitely a hack, it doesn't seem to cause problems when the first thing to - // draw is transparent. - // m_direct.hack_disable_blend(); - - // skip if disabled - if (!m_enabled) { - while (dma.current_tag_offset() != render_state->next_bucket) { - dma.read_and_advance(); - } - return; - } - - while (dma.current_tag_offset() != render_state->next_bucket) { - auto data = dma.read_and_advance(); - m_debug += fmt::format("{} : {} {}\n", data.size_bytes, data.vifcode0().print(), - data.vifcode1().print()); - auto v0 = data.vifcode0(); - auto v1 = data.vifcode1(); - if (data.size_bytes == 0) { - m_debug += "Emtpy Tag\n"; - switch (v0.kind) { - case VifCode::Kind::STCYCL: - vu.stcycl = v0.immediate; - break; - case VifCode::Kind::NOP: - break; - default: - fmt::print("unknown vifcode0 empty tag: {}\n", v0.print()); - ASSERT(false); - } - switch (v1.kind) { - case VifCode::Kind::STCYCL: - vu.stcycl = v1.immediate; - break; - case VifCode::Kind::NOP: - break; - case VifCode::Kind::MSCAL: - mscal(v1.immediate, render_state, prof); - break; - default: - fmt::print("unknown vifcode1 empty tag: {}\n", v1.print()); - ASSERT(false); - } - } else if (v0.kind == VifCode::Kind::FLUSHA && v1.kind == VifCode::Kind::DIRECT) { - if (render_state->use_direct2) { - m_direct2.render_gif_data(data.data, render_state, prof); - } - ASSERT(v1.immediate == data.size_bytes / 16); - } else if (v0.kind == VifCode::Kind::NOP && v1.kind == VifCode::Kind::DIRECT) { - if (render_state->use_direct2) { - m_direct2.render_gif_data(data.data, render_state, prof); - } - ASSERT(v1.immediate == data.size_bytes / 16); - } else if (v0.kind == VifCode::Kind::STCYCL && v1.kind == VifCode::Kind::UNPACK_V4_32) { - vu.stcycl = v0.immediate; - u32 bytes_used = unpack32_4(VifCodeUnpack(v1), data.data, v1.num); - if (bytes_used < data.size_bytes) { - handle_dma_stream(data.data + bytes_used, data.size_bytes - bytes_used, render_state, prof); - } else if (bytes_used > data.size_bytes) { - ASSERT(false); - } - } else if (v0.kind == VifCode::Kind::MSCALF && v1.kind == VifCode::Kind::STMOD) { - mscal(v0.immediate, render_state, prof); - ASSERT(v1.immediate == 0); - - u32 data_offset = 0; - u32 base_vifcode_data; - memcpy(&base_vifcode_data, data.data + data_offset, 4); - VifCode base_vc(base_vifcode_data); - ASSERT(base_vc.immediate == 0); - data_offset += 4; - - u32 offset_vifcode_data; - memcpy(&offset_vifcode_data, data.data + data_offset, 4); - VifCode offset_vc(offset_vifcode_data); - ASSERT(offset_vc.immediate == 0); - data_offset += 4; - - for (int i = 0; i < 1; i++) { - u32 nop_vifcode_data; - memcpy(&nop_vifcode_data, data.data + data_offset, 4); - VifCode next_vc(nop_vifcode_data); - ASSERT(next_vc.kind == VifCode::Kind::NOP); - data_offset += 4; - } - - u32 strow_vifcode_data; - memcpy(&strow_vifcode_data, data.data + data_offset, 4); - VifCode strow_vc(strow_vifcode_data); - data_offset += 4; - ASSERT(strow_vc.kind == VifCode::Kind::STROW); - - memcpy(vu.row, data.data + data_offset, 16); - data_offset += 16; - - ASSERT(data_offset == 32); - ASSERT(data_offset == data.size_bytes); - } else if (v0.kind == VifCode::Kind::NOP && v1.kind == VifCode::Kind::UNPACK_V3_32) { - u32 bytes_used = unpack32_3(VifCodeUnpack(v1), data.data, v1.num); - if (bytes_used < data.size_bytes) { - handle_dma_stream(data.data + bytes_used, data.size_bytes - bytes_used, render_state, prof); - } else if (bytes_used > data.size_bytes) { - ASSERT(false); - } - } else { - fmt::print("Generic encountered unknown DMA.\n"); - fmt::print("Size bytes: {}\n", data.size_bytes); - fmt::print("VIF0: {}\n", data.vifcode0().print()); - fmt::print("VIF1: {}\n", data.vifcode1().print()); - ASSERT(false); - } - m_skipped_tags++; - } - if (render_state->use_direct2) { - m_direct2.flush_pending(render_state, prof); - } -} - -void GenericRenderer::handle_dma_stream(const u8* data, - u32 bytes, - SharedRenderState* render_state, - ScopedProfilerNode& prof) { - while (bytes) { - u32 tag_data; - memcpy(&tag_data, data, 4); - bytes -= 4; - data += 4; - VifCode vc(tag_data); - switch (vc.kind) { - case VifCode::Kind::NOP: - break; - case VifCode::Kind::STCYCL: - vu.stcycl = vc.immediate; - break; - case VifCode::Kind::UNPACK_V3_32: { - u32 bytes_transferred = unpack32_3(VifCodeUnpack(vc), data, vc.num); - bytes -= bytes_transferred; - data += bytes_transferred; - } break; - case VifCode::Kind::UNPACK_V4_8: { - u32 bytes_transferred = unpack8_4(VifCodeUnpack(vc), data, vc.num); - bytes -= bytes_transferred; - data += bytes_transferred; - } break; - case VifCode::Kind::UNPACK_V2_16: { - u32 bytes_transferred = unpack16_2(VifCodeUnpack(vc), data, vc.num); - bytes -= bytes_transferred; - data += bytes_transferred; - } break; - case VifCode::Kind::UNPACK_V4_32: { - u32 bytes_transferred = unpack32_4(VifCodeUnpack(vc), data, vc.num); - bytes -= bytes_transferred; - data += bytes_transferred; - } break; - case VifCode::Kind::MSCAL: - mscal(vc.immediate, render_state, prof); - break; - default: - fmt::print("Generic encountered unknown DMA in handle_dma_stream.\n"); - fmt::print("Bytes remaining: {}\n", bytes); - fmt::print("VIF: {}\n", vc.print()); - ASSERT(false); - } - } -} - -void GenericRenderer::draw_debug_window() { - ImGui::Text("Skipped %d tags", m_skipped_tags); - ImGui::InputInt("kick min", &m_min_xgkick); - ImGui::InputInt("kick max", &m_max_xgkick); - ImGui::Text("Debug:\n%s\n", m_debug.c_str()); - if (ImGui::TreeNode("Gen2")) { - m_debug_gen2.draw_debug_window(); - ImGui::TreePop(); - } -} - -u32 GenericRenderer::unpack32_4(const VifCodeUnpack& up, const u8* data, u32 imm) { - ASSERT(vu.stcycl == 0x404); - ASSERT(!up.is_unsigned); - u32 addr = up.addr_qw; - ASSERT(imm != 0); - // ASSERT(!m_vif.stmod); - ASSERT(!up.use_tops_flag); - // if (up.use_tops_flag) { - // addr += xitop(); - // } - - u32 start_in_buff = (addr)*16; - u32 end_in_buff = start_in_buff + imm * 16; - ASSERT(start_in_buff < sizeof(m_buffer.data)); - ASSERT(end_in_buff <= sizeof(m_buffer.data)); - memcpy(m_buffer.data + start_in_buff, data, imm * 16); - - // fmt::print("---------------------------------unpack32_4: {} to {}\n", addr, addr + imm); - return imm * 16; -} - -u32 GenericRenderer::unpack32_3(const VifCodeUnpack& up, const u8* data, u32 imm) { - u32 bytes_read = 0; - ASSERT(!up.use_tops_flag); - ASSERT(!up.is_unsigned); - ASSERT(vu.stcycl == 0x103); // w = 1, c = 3 - ASSERT(imm != 0); - - for (u32 i = 0; i < imm; i++) { - u32 xyzw[4]; - memcpy(xyzw, data + bytes_read, 12); - bytes_read += 12; - xyzw[3] = 0xbeef; - - // check for garbage going into GENERIC VU1 code. - float f[3]; - memcpy(f, xyzw, 12); - // if (std::abs(f[0]) > 100000) { - // fmt::print("VERY SUSPICIOUS VERTEX: {} 0x{:x} at 0x{:x}\n", f[0], xyzw[0], - // (data + bytes_read) - g_ee_main_mem); - // } - - // fmt::print("vtx: {} {} {}\n", f[0], f[1], f[2]); - u32 total_addr = 16 * (up.addr_qw + 3 * i); - ASSERT(total_addr + 16 <= sizeof(m_buffer.data)); - memcpy(m_buffer.data + total_addr, xyzw, 16); - } - // fmt::print("---------------------------------unpack32_3: {} to {} imm {}\n", up.addr_qw, - // (up.addr_qw + 3 * imm), imm); - return bytes_read; -} - -u32 GenericRenderer::unpack8_4(const VifCodeUnpack& up, const u8* data, u32 imm) { - u32 bytes_read = 0; - ASSERT(!up.use_tops_flag); - ASSERT(up.is_unsigned); - ASSERT(vu.stcycl == 0x103); // w = 1, c = 3 - ASSERT(imm != 0); - for (u32 i = 0; i < imm; i++) { - u32 xyzw[4] = {data[0], data[1], data[2], data[3]}; - bytes_read += 4; - data += 4; - u32 total_addr = 16 * (up.addr_qw + 3 * i); - ASSERT(total_addr + 16 <= sizeof(m_buffer.data)); - memcpy(m_buffer.data + total_addr, xyzw, 16); - } - // fmt::print("---------------------------------unpack8_4: {} to {} imm {}\n", up.addr_qw, - // (up.addr_qw + 3 * imm), imm); - return bytes_read; -} - -u32 GenericRenderer::unpack16_2(const VifCodeUnpack& up, const u8* data, u32 imm) { - u32 bytes_read = 0; - ASSERT(!up.use_tops_flag); - ASSERT(!up.is_unsigned); - ASSERT(vu.stcycl == 0x103); // w = 1, c = 3 - ASSERT(imm != 0); - for (u32 i = 0; i < imm; i++) { - s32 xyzw[4]; - s16 x, y; - memcpy(&x, data + bytes_read, 2); - memcpy(&y, data + bytes_read + 2, 2); - bytes_read += 4; - xyzw[0] = x; - xyzw[1] = y; - xyzw[2] = 0; - xyzw[3] = 0; - - u32 total_addr = 16 * (up.addr_qw + 3 * i); - ASSERT(total_addr + 16 <= sizeof(m_buffer.data)); - memcpy(m_buffer.data + total_addr, xyzw, 16); - } - // fmt::print("---------------------------------unpack16_2: {} to {} imm {}\n", up.addr_qw, - // (up.addr_qw + 3 * imm), imm); - return bytes_read; -} - -void GenericRenderer::mscal(int imm, SharedRenderState* render_state, ScopedProfilerNode& prof) { - m_debug += fmt::format("mscal: {}\n", imm); - switch (imm) { - case 0: - mscal0(); - break; - default: - mscal_dispatch(imm, render_state, prof); - break; - } -} - -void GenericRenderer::xgkick(u16 addr, SharedRenderState* render_state, ScopedProfilerNode& prof) { - if (render_state->enable_generic_xgkick && m_xgkick_idx >= m_min_xgkick && - m_xgkick_idx < m_max_xgkick) { - if (!render_state->use_generic2) { - if (render_state->use_direct2) { - m_direct2.render_gif_data(m_buffer.data + (16 * addr), render_state, prof); - } - } - } - m_xgkick_idx++; -} \ No newline at end of file diff --git a/game/graphics/opengl_renderer/GenericRenderer.h b/game/graphics/opengl_renderer/GenericRenderer.h deleted file mode 100644 index ce994ffa08..0000000000 --- a/game/graphics/opengl_renderer/GenericRenderer.h +++ /dev/null @@ -1,82 +0,0 @@ -#pragma once - -#include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/opengl_renderer/DirectRenderer2.h" -#include "game/graphics/opengl_renderer/foreground/Generic2.h" -#include "game/common/vu.h" - -class GenericRenderer : public BucketRenderer { - public: - GenericRenderer(const std::string& name, BucketId my_id); - void render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) override; - void draw_debug_window() override; - void init_shaders(ShaderLibrary& shaders) override; - - private: - u32 unpack32_4(const VifCodeUnpack& up, const u8* data, u32 imm); - u32 unpack32_3(const VifCodeUnpack& up, const u8* data, u32 imm); - u32 unpack8_4(const VifCodeUnpack& up, const u8* data, u32 imm); - u32 unpack16_2(const VifCodeUnpack& up, const u8* data, u32 imm); - - void mscal(int imm, SharedRenderState* render_state, ScopedProfilerNode& prof); - void mscal0(); - void mscal_dispatch(int imm, SharedRenderState* render_state, ScopedProfilerNode& prof); - void mscal_noclip_nopipe(SharedRenderState* render_state, ScopedProfilerNode& prof); - void handle_dma_stream(const u8* data, - u32 bytes, - SharedRenderState* render_state, - ScopedProfilerNode& prof); - void lq_buffer(Mask mask, Vf& dest, u16 addr); - void isw_buffer(Mask mask, u16 val, u16 addr); - void ilw_buffer(Mask mask, u16& dest, u16 addr); - void xgkick(u16 addr, SharedRenderState* render_state, ScopedProfilerNode& prof); - - void sq_buffer(Mask mask, const Vf& data, u32 qw) { - ASSERT(qw * 16 < sizeof(m_buffer.data)); - for (int i = 0; i < 4; i++) { - if ((u64)mask & (1 << i)) { - memcpy(m_buffer.data + qw * 16 + i * 4, data.data + i, 4); - } - } - } - - int m_skipped_tags = 0; - DirectRenderer2 m_direct2; - Generic2 m_debug_gen2; - std::string m_debug; - - struct Vu { - u32 row[4]; - u32 stcycl = 0; - Vf vf03, vf18, vf19, vf20, vf21, vf22, vf23, vf24, vf25, vf26, vf27, vf28, vf29, vf30, vf31; - const Vf vf00; - u16 vi01, vi02, vi03, vi04, vi05, vi06, vi07, vi09, vi08, vi11, vi12, vi13, vi10, vi14, vi15; - float I, P, Q; - - Accumulator acc; - const u16 vi00 = 0; - Vu() : vf00(0, 0, 0, 1) {} - } vu; - - struct { - Vf fog; - Vf adgif_tmpl; - Vf hvdf_off; - Vf hmge_scale; - Vf guard; - - Vf mat0, mat1, mat2, mat3; - - Vf vtx_p0, vtx_p1, vtx_p2, vtx_p3; - - Vf vtx_load0, vtx_load1; - } gen; - - struct alignas(16) BufferMemory { - u8 data[1024 * 16]; - } m_buffer; - - int m_xgkick_idx = 0; - int m_min_xgkick = 0; - int m_max_xgkick = 1000000; -}; diff --git a/game/graphics/opengl_renderer/Loader.cpp b/game/graphics/opengl_renderer/Loader.cpp deleted file mode 100644 index ae353a047d..0000000000 --- a/game/graphics/opengl_renderer/Loader.cpp +++ /dev/null @@ -1,658 +0,0 @@ -#include "Loader.h" -#include "common/util/Timer.h" -#include "common/util/FileUtil.h" -#include "common/util/compress.h" - -namespace { -std::string uppercase_string(const std::string& s) { - std::string result; - for (auto c : s) { - result.push_back(toupper(c)); - } - return result; -} -} // namespace - -Loader::Loader() { - m_loader_thread = std::thread(&Loader::loader_thread, this); -} - -Loader::~Loader() { - { - std::lock_guard lk(m_loader_mutex); - m_want_shutdown = true; - m_loader_cv.notify_all(); - } - m_loader_thread.join(); -} - -/*! - * Try to get a loaded level by name. It may fail and return nullptr. - * Getting a level will reset the counter for the level and prevent it from being kicked out - * for a little while. - * - * This is safe to call from the graphics thread - */ -const Loader::LevelData* Loader::get_tfrag3_level(const std::string& level_name) { - std::unique_lock lk(m_loader_mutex); - const auto& existing = m_loaded_tfrag3_levels.find(level_name); - if (existing == m_loaded_tfrag3_levels.end()) { - return nullptr; - } else { - existing->second.frames_since_last_used = 0; - return &existing->second.data; - } -} - -/*! - * The game calls this to give the loader a hint on which levels we want. - * If the loader is not busy, it will begin loading the level. - * This should be called on every frame. - */ -void Loader::set_want_levels(const std::vector& levels) { - std::unique_lock lk(m_loader_mutex); - m_desired_levels = levels; - if (!m_level_to_load.empty()) { - // can't do anything, we're loading a level right now - return; - } - - if (!m_initializing_tfrag3_levels.empty()) { - // can't do anything, we're initializing a level right now - return; - } - - // loader isn't busy, try to load one of the requested levels. - for (auto& lev : levels) { - auto it = m_loaded_tfrag3_levels.find(lev); - if (it == m_loaded_tfrag3_levels.end()) { - // we haven't loaded it yet. Request this level to load and wake up the thread. - m_level_to_load = lev; - lk.unlock(); - m_loader_cv.notify_all(); - return; - } - } -} - -/*! - * Loader function that runs in a completely separate thread. - * This is used for file I/O and unpacking. - */ -void Loader::loader_thread() { - while (!m_want_shutdown) { - std::unique_lock lk(m_loader_mutex); - - // this will keep us asleep until we've got a level to load. - m_loader_cv.wait(lk, [&] { return !m_level_to_load.empty() || m_want_shutdown; }); - if (m_want_shutdown) { - return; - } - std::string lev = m_level_to_load; - // don't hold the lock while reading the file. - lk.unlock(); - - // simulate slower hard drive (so that the loader thread can lose to the game loads) - // std::this_thread::sleep_for(std::chrono::milliseconds(1500)); - - // load the fr3 file - Timer disk_timer; - auto data = file_util::read_binary_file( - file_util::get_file_path({fmt::format("assets/{}.fr3", uppercase_string(lev))})); - double disk_load_time = disk_timer.getSeconds(); - - // the FR3 files are compressed - Timer decomp_timer; - auto decomp_data = compression::decompress_zstd(data.data(), data.size()); - double decomp_time = decomp_timer.getSeconds(); - - // Read back into the tfrag3::Level structure - Timer import_timer; - auto result = std::make_unique(); - Serializer ser(decomp_data.data(), decomp_data.size()); - result->serialize(ser); - double import_time = import_timer.getSeconds(); - - // and finally "unpack", which creates the vertex data we'll upload to the GPU - Timer unpack_timer; - for (auto& tie_tree : result->tie_trees) { - for (auto& tree : tie_tree) { - tree.unpack(); - for (auto& d : tree.static_draws) { - d.unpack(); - } - } - } - for (auto& t_tree : result->tfrag_trees) { - for (auto& tree : t_tree) { - tree.unpack(); - for (auto& d : tree.draws) { - d.unpack(); - } - } - } - - for (auto& shrub_tree : result->shrub_trees) { - shrub_tree.unpack(); - } - fmt::print( - "------------> Load from file: {:.3f}s, import {:.3f}s, decomp {:.3f}s unpack {:.3f}s\n", - disk_load_time, import_time, decomp_time, unpack_timer.getSeconds()); - - // grab the lock again - lk.lock(); - // move this level to "initializing" state. - m_initializing_tfrag3_levels[lev].data = {}; // reset load state - m_initializing_tfrag3_levels[lev].data.level = std::move(result); - m_level_to_load = ""; - m_file_load_done_cv.notify_all(); - } -} - -/*! - * Load a "common" FR3 file that has non-level textures. - * This should be called during initialization, before any threaded loading goes on. - */ -void Loader::load_common(TexturePool& tex_pool, const std::string& name) { - auto data = - file_util::read_binary_file(file_util::get_file_path({fmt::format("assets/{}.fr3", name)})); - - auto decomp_data = compression::decompress_zstd(data.data(), data.size()); - Serializer ser(decomp_data.data(), decomp_data.size()); - m_common_level.serialize(ser); - for (auto& tex : m_common_level.textures) { - add_texture(tex_pool, tex, true); - } -} - -/*! - * Upload a texture to the GPU, and give it to the pool. - */ -u64 Loader::add_texture(TexturePool& pool, const tfrag3::Texture& tex, bool is_common) { - GLuint gl_tex; - glGenTextures(1, &gl_tex); - glBindTexture(GL_TEXTURE_2D, gl_tex); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.w, tex.h, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, - tex.data.data()); - glBindTexture(GL_TEXTURE_2D, 0); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, gl_tex); - glGenerateMipmap(GL_TEXTURE_2D); - float aniso = 0.0f; - glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY, &aniso); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY, aniso); - if (tex.load_to_pool) { - TextureInput in; - in.page_name = tex.debug_tpage_name; - in.name = tex.debug_name; - in.w = tex.w; - in.h = tex.h; - in.gpu_texture = gl_tex; - in.common = is_common; - in.combo_id = tex.combo_id; - in.src_data = (const u8*)tex.data.data(); - pool.give_texture(in); - } - - return gl_tex; -} - -bool Loader::init_tfrag(Timer& timer, LevelData& data) { - if (data.tfrag_load_done) { - return true; - } - - if (data.level->tfrag_trees.front().empty()) { - data.tfrag_load_done = true; - return true; - } - - if (!data.tfrag_opengl_created) { - for (int geo = 0; geo < tfrag3::TFRAG_GEOS; geo++) { - auto& in_trees = data.level->tfrag_trees[geo]; - for (auto& in_tree : in_trees) { - GLuint& tree_out = data.tfrag_vertex_data[geo].emplace_back(); - glGenBuffers(1, &tree_out); - glBindBuffer(GL_ARRAY_BUFFER, tree_out); - glBufferData(GL_ARRAY_BUFFER, - in_tree.unpacked.vertices.size() * sizeof(tfrag3::PreloadedVertex), nullptr, - GL_STATIC_DRAW); - } - } - data.tfrag_opengl_created = true; - return false; - } - - constexpr u32 CHUNK_SIZE = 32768; - u32 uploaded_bytes = 0; - - while (true) { - const auto& tree = data.level->tfrag_trees[data.tfrag_next_geo][data.tfrag_next_tree]; - u32 end_vert_in_tree = tree.unpacked.vertices.size(); - // the number of vertices we'd need to finish the tree right now - size_t num_verts_left_in_tree = end_vert_in_tree - data.tfrag_next_vert; - size_t start_vert_for_chunk; - size_t end_vert_for_chunk; - - bool complete_tree; - - if (num_verts_left_in_tree > CHUNK_SIZE) { - complete_tree = false; - // should only do partial - start_vert_for_chunk = data.tfrag_next_vert; - end_vert_for_chunk = start_vert_for_chunk + CHUNK_SIZE; - data.tfrag_next_vert += CHUNK_SIZE; - } else { - // should do all! - start_vert_for_chunk = data.tfrag_next_vert; - end_vert_for_chunk = end_vert_in_tree; - complete_tree = true; - } - - // glBindVertexArray(m_trees[m_load_state.vert_geo][m_load_state.vert_tree].vao); - glBindBuffer(GL_ARRAY_BUFFER, - data.tfrag_vertex_data[data.tfrag_next_geo][data.tfrag_next_tree]); - u32 upload_size = (end_vert_for_chunk - start_vert_for_chunk) * sizeof(tfrag3::PreloadedVertex); - glBufferSubData(GL_ARRAY_BUFFER, start_vert_for_chunk * sizeof(tfrag3::PreloadedVertex), - upload_size, tree.unpacked.vertices.data() + start_vert_for_chunk); - uploaded_bytes += upload_size; - - if (complete_tree) { - // and move on to next tree - data.tfrag_next_vert = 0; - data.tfrag_next_tree++; - if (data.tfrag_next_tree >= data.level->tfrag_trees[data.tfrag_next_geo].size()) { - data.tfrag_next_tree = 0; - data.tfrag_next_geo++; - if (data.tfrag_next_geo >= tfrag3::TFRAG_GEOS) { - data.tfrag_load_done = true; - data.tfrag_next_tree = 0; - data.tfrag_next_geo = 0; - data.tfrag_next_vert = 0; - return true; - } - } - } - - if (timer.getMs() > Loader::TIE_LOAD_BUDGET || (uploaded_bytes / 1024) > 2048) { - return false; - } - } -} - -bool Loader::init_shrub(Timer& timer, LevelData& data) { - if (data.shrub_load_done) { - return true; - } - - if (data.level->shrub_trees.empty()) { - data.shrub_load_done = true; - return true; - } - - if (!data.shrub_opengl_created) { - for (auto& in_tree : data.level->shrub_trees) { - GLuint& tree_out = data.shrub_vertex_data.emplace_back(); - glGenBuffers(1, &tree_out); - glBindBuffer(GL_ARRAY_BUFFER, tree_out); - glBufferData(GL_ARRAY_BUFFER, - in_tree.unpacked.vertices.size() * sizeof(tfrag3::ShrubGpuVertex), nullptr, - GL_STATIC_DRAW); - } - data.shrub_opengl_created = true; - return false; - } - - constexpr u32 CHUNK_SIZE = 32768; - u32 uploaded_bytes = 0; - - while (true) { - const auto& tree = data.level->shrub_trees[data.shrub_next_tree]; - u32 end_vert_in_tree = tree.unpacked.vertices.size(); - // the number of vertices we'd need to finish the tree right now - size_t num_verts_left_in_tree = end_vert_in_tree - data.shrub_next_vert; - size_t start_vert_for_chunk; - size_t end_vert_for_chunk; - - bool complete_tree; - - if (num_verts_left_in_tree > CHUNK_SIZE) { - complete_tree = false; - // should only do partial - start_vert_for_chunk = data.shrub_next_vert; - end_vert_for_chunk = start_vert_for_chunk + CHUNK_SIZE; - data.shrub_next_vert += CHUNK_SIZE; - } else { - // should do all! - start_vert_for_chunk = data.shrub_next_vert; - end_vert_for_chunk = end_vert_in_tree; - complete_tree = true; - } - - // glBindVertexArray(m_trees[m_load_state.vert_geo][m_load_state.vert_tree].vao); - glBindBuffer(GL_ARRAY_BUFFER, data.shrub_vertex_data[data.shrub_next_tree]); - u32 upload_size = (end_vert_for_chunk - start_vert_for_chunk) * sizeof(tfrag3::ShrubGpuVertex); - glBufferSubData(GL_ARRAY_BUFFER, start_vert_for_chunk * sizeof(tfrag3::ShrubGpuVertex), - upload_size, tree.unpacked.vertices.data() + start_vert_for_chunk); - uploaded_bytes += upload_size; - - if (complete_tree) { - // and move on to next tree - data.shrub_next_vert = 0; - data.shrub_next_tree++; - if (data.shrub_next_tree >= data.level->shrub_trees.size()) { - data.shrub_load_done = true; - return true; - } - } - - if (timer.getMs() > Loader::TIE_LOAD_BUDGET || (uploaded_bytes / 1024) > 2048) { - return false; - } - } -} - -bool Loader::init_tie(Timer& timer, LevelData& data) { - if (data.tie_load_done) { - return true; - } - - if (data.level->tie_trees.front().empty()) { - data.tie_load_done = true; - return true; - } - - if (!data.tie_opengl_created) { - for (int geo = 0; geo < tfrag3::TIE_GEOS; geo++) { - auto& in_trees = data.level->tie_trees[geo]; - for (auto& in_tree : in_trees) { - LevelData::TieOpenGL& tree_out = data.tie_data[geo].emplace_back(); - glGenBuffers(1, &tree_out.vertex_buffer); - glBindBuffer(GL_ARRAY_BUFFER, tree_out.vertex_buffer); - glBufferData(GL_ARRAY_BUFFER, - in_tree.unpacked.vertices.size() * sizeof(tfrag3::PreloadedVertex), nullptr, - GL_STATIC_DRAW); - } - } - data.tie_opengl_created = true; - return false; - } - - if (!data.tie_verts_done) { - constexpr u32 CHUNK_SIZE = 32768; - u32 uploaded_bytes = 0; - - while (true) { - const auto& tree = data.level->tie_trees[data.tie_next_geo][data.tie_next_tree]; - u32 end_vert_in_tree = tree.unpacked.vertices.size(); - // the number of vertices we'd need to finish the tree right now - size_t num_verts_left_in_tree = end_vert_in_tree - data.tie_next_vert; - size_t start_vert_for_chunk; - size_t end_vert_for_chunk; - - bool complete_tree; - - if (num_verts_left_in_tree > CHUNK_SIZE) { - complete_tree = false; - // should only do partial - start_vert_for_chunk = data.tie_next_vert; - end_vert_for_chunk = start_vert_for_chunk + CHUNK_SIZE; - data.tie_next_vert += CHUNK_SIZE; - } else { - // should do all! - start_vert_for_chunk = data.tie_next_vert; - end_vert_for_chunk = end_vert_in_tree; - complete_tree = true; - } - - // glBindVertexArray(m_trees[m_load_state.vert_geo][m_load_state.vert_tree].vao); - glBindBuffer(GL_ARRAY_BUFFER, - data.tie_data[data.tie_next_geo][data.tie_next_tree].vertex_buffer); - u32 upload_size = - (end_vert_for_chunk - start_vert_for_chunk) * sizeof(tfrag3::PreloadedVertex); - glBufferSubData(GL_ARRAY_BUFFER, start_vert_for_chunk * sizeof(tfrag3::PreloadedVertex), - upload_size, tree.unpacked.vertices.data() + start_vert_for_chunk); - uploaded_bytes += upload_size; - - if (complete_tree) { - // and move on to next tree - data.tie_next_vert = 0; - data.tie_next_tree++; - if (data.tie_next_tree >= data.level->tie_trees[data.tie_next_geo].size()) { - data.tie_next_tree = 0; - data.tie_next_geo++; - if (data.tie_next_geo >= tfrag3::TIE_GEOS) { - data.tie_verts_done = true; - data.tie_next_tree = 0; - data.tie_next_geo = 0; - data.tie_next_vert = 0; - return false; - } - } - } - - if (timer.getMs() > Loader::TIE_LOAD_BUDGET || (uploaded_bytes / 1024) > 2048) { - return false; - } - } - } - - if (!data.tie_wind_indices_done) { - bool abort = false; - for (; data.tie_next_geo < tfrag3::TIE_GEOS; data.tie_next_geo++) { - auto& geo_trees = data.level->tie_trees[data.tie_next_geo]; - for (; data.tie_next_tree < geo_trees.size(); data.tie_next_tree++) { - if (abort) { - return false; - } - auto& in_tree = geo_trees[data.tie_next_tree]; - auto& out_tree = data.tie_data[data.tie_next_geo][data.tie_next_tree]; - size_t wind_idx_buffer_len = 0; - for (auto& draw : in_tree.instanced_wind_draws) { - wind_idx_buffer_len += draw.vertex_index_stream.size(); - } - if (wind_idx_buffer_len > 0) { - out_tree.has_wind = true; - glGenBuffers(1, &out_tree.wind_indices); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, out_tree.wind_indices); - std::vector temp; - temp.resize(wind_idx_buffer_len); - u32 off = 0; - for (auto& draw : in_tree.instanced_wind_draws) { - memcpy(temp.data() + off, draw.vertex_index_stream.data(), - draw.vertex_index_stream.size() * sizeof(u32)); - off += draw.vertex_index_stream.size(); - } - - glBufferData(GL_ELEMENT_ARRAY_BUFFER, wind_idx_buffer_len * sizeof(u32), temp.data(), - GL_STATIC_DRAW); - abort = true; - } - } - } - - data.tie_wind_indices_done = true; - data.tie_load_done = true; - return true; - } - - return false; -} - -bool Loader::upload_textures(Timer& timer, LevelData& data, TexturePool& texture_pool) { - // try to move level from initializing to initialized: - - constexpr int MAX_TEX_BYTES_PER_FRAME = 1024 * 128; - - int bytes_this_run = 0; - int tex_this_run = 0; - if (data.textures.size() < data.level->textures.size()) { - std::unique_lock tpool_lock(texture_pool.mutex()); - while (data.textures.size() < data.level->textures.size()) { - auto& tex = data.level->textures[data.textures.size()]; - data.textures.push_back(add_texture(texture_pool, tex, false)); - bytes_this_run += tex.w * tex.h * 4; - tex_this_run++; - if (tex_this_run > 20) { - break; - } - if (bytes_this_run > MAX_TEX_BYTES_PER_FRAME || timer.getMs() > SHARED_TEXTURE_LOAD_BUDGET) { - break; - } - } - } - return data.textures.size() == data.level->textures.size(); -} - -void Loader::update_blocking(TexturePool& tex_pool) { - fmt::print("NOTE: coming out of blackout on next frame, doing all loads now...\n"); - - bool missing_levels = true; - while (missing_levels) { - bool needs_run = true; - - while (needs_run) { - needs_run = false; - { - std::unique_lock lk(m_loader_mutex); - if (!m_level_to_load.empty()) { - m_file_load_done_cv.wait(lk, [&]() { return m_level_to_load.empty(); }); - } - } - } - - needs_run = true; - - while (needs_run) { - needs_run = false; - { - std::unique_lock lk(m_loader_mutex); - if (!m_initializing_tfrag3_levels.empty()) { - needs_run = true; - } - } - - if (needs_run) { - update(tex_pool); - } - } - - { - std::unique_lock lk(m_loader_mutex); - missing_levels = false; - for (auto& des : m_desired_levels) { - if (m_loaded_tfrag3_levels.find(des) == m_loaded_tfrag3_levels.end()) { - fmt::print("blackout loader doing additional level {}...\n", des); - missing_levels = true; - } - } - } - - if (missing_levels) { - set_want_levels(m_desired_levels); - } - } - - fmt::print("Blackout loads done. Current status:"); - std::unique_lock lk(m_loader_mutex); - for (auto& ld : m_loaded_tfrag3_levels) { - fmt::print(" {} is loaded.\n", ld.first); - } -} - -void Loader::update(TexturePool& texture_pool) { - Timer loader_timer; - - // only main thread can touch this. - for (auto& lev : m_loaded_tfrag3_levels) { - lev.second.frames_since_last_used++; - } - - bool did_gpu_stuff = false; - - // work on moving initializing to initialized. - { - // accessing initializing, should lock - std::unique_lock lk(m_loader_mutex); - // grab the first initializing level: - const auto& it = m_initializing_tfrag3_levels.begin(); - if (it != m_initializing_tfrag3_levels.end()) { - std::string name = it->first; - auto& lev = it->second; - // we're the only place that erases, so it's okay to unlock and hold a reference - lk.unlock(); - if (!lev.data.tfrag_load_done) { - did_gpu_stuff = true; - } - if (upload_textures(loader_timer, lev.data, texture_pool)) { - if (init_tie(loader_timer, lev.data)) { - if (init_tfrag(loader_timer, lev.data)) { - if (init_shrub(loader_timer, lev.data)) { - // we're done! lock before removing from loaded. - lk.lock(); - it->second.data.load_id = m_id++; - - m_loaded_tfrag3_levels[name] = std::move(lev); - m_initializing_tfrag3_levels.erase(it); - } - } - } - } - } - } - - if (!did_gpu_stuff) { - // try to remove levels. - if (m_loaded_tfrag3_levels.size() >= 3) { - for (const auto& lev : m_loaded_tfrag3_levels) { - if (lev.second.frames_since_last_used > 180) { - std::unique_lock lk(texture_pool.mutex()); - fmt::print("------------------------- PC unloading {}\n", lev.first); - for (size_t i = 0; i < lev.second.data.level->textures.size(); i++) { - auto& tex = lev.second.data.level->textures[i]; - if (tex.load_to_pool) { - texture_pool.unload_texture(tex.debug_name, lev.second.data.textures.at(i)); - } - } - lk.unlock(); - for (auto tex : lev.second.data.textures) { - if (EXTRA_TEX_DEBUG) { - for (auto& slot : texture_pool.all_textures()) { - if (slot.source) { - ASSERT(slot.gpu_texture != tex); - } else { - ASSERT(slot.gpu_texture != tex); - } - } - } - - glBindTexture(GL_TEXTURE_2D, tex); - glDeleteTextures(1, &tex); - } - - for (auto& tie_geo : lev.second.data.tie_data) { - for (auto& tie_tree : tie_geo) { - glDeleteBuffers(1, &tie_tree.vertex_buffer); - if (tie_tree.has_wind) { - glDeleteBuffers(1, &tie_tree.wind_indices); - } - } - } - - for (auto& tfrag_geo : lev.second.data.tfrag_vertex_data) { - for (auto& tfrag_buff : tfrag_geo) { - glDeleteBuffers(1, &tfrag_buff); - } - } - - m_loaded_tfrag3_levels.erase(lev.first); - break; - } - } - } - } - - if (loader_timer.getMs() > 5) { - fmt::print("Loader::update slow setup: {:.1f}ms\n", loader_timer.getMs()); - } -} diff --git a/game/graphics/opengl_renderer/Loader.h b/game/graphics/opengl_renderer/Loader.h deleted file mode 100644 index b03f31c30e..0000000000 --- a/game/graphics/opengl_renderer/Loader.h +++ /dev/null @@ -1,92 +0,0 @@ -#pragma once - -#include -#include -#include - -#include "game/graphics/pipelines/opengl.h" -#include "game/graphics/texture/TexturePool.h" -#include "common/custom_data/Tfrag3Data.h" -#include "common/util/Timer.h" - -class Loader { - public: - static constexpr float TIE_LOAD_BUDGET = 1.5f; - static constexpr float SHARED_TEXTURE_LOAD_BUDGET = 3.f; - Loader(); - ~Loader(); - void update(TexturePool& tex_pool); - void update_blocking(TexturePool& tex_pool); - - struct LevelData { - std::unique_ptr level; - std::vector textures; - u64 load_id = 0; - - struct TieOpenGL { - GLuint vertex_buffer; - bool has_wind = false; - GLuint wind_indices; - }; - std::array, tfrag3::TIE_GEOS> tie_data; - std::array, tfrag3::TIE_GEOS> tfrag_vertex_data; - std::vector shrub_vertex_data; - - // internal load state - bool tie_opengl_created = false; - bool tie_verts_done = false; - bool tie_wind_indices_done = false; - bool tie_load_done = false; - u32 tie_next_geo = 0; - u32 tie_next_tree = 0; - u32 tie_next_vert = 0; - - bool tfrag_opengl_created = false; - bool tfrag_load_done = false; - u32 tfrag_next_geo = 0; - u32 tfrag_next_tree = 0; - u32 tfrag_next_vert = 0; - - bool shrub_opengl_created = false; - bool shrub_load_done = false; - u32 shrub_next_tree = 0; - u32 shrub_next_vert = 0; - }; - - const LevelData* get_tfrag3_level(const std::string& level_name); - void load_common(TexturePool& tex_pool, const std::string& name); - void set_want_levels(const std::vector& levels); - - private: - struct Level { - LevelData data; - int frames_since_last_used = 0; - }; - - void loader_thread(); - u64 add_texture(TexturePool& pool, const tfrag3::Texture& tex, bool is_common); - - bool upload_textures(Timer& timer, LevelData& data, TexturePool& texture_pool); - bool init_tie(Timer& timer, LevelData& data); - bool init_tfrag(Timer& timer, LevelData& data); - bool init_shrub(Timer& timer, LevelData& data); - - // used by game and loader thread - std::unordered_map m_initializing_tfrag3_levels; - - tfrag3::Level m_common_level; - - std::string m_level_to_load; - - std::thread m_loader_thread; - std::mutex m_loader_mutex; - std::condition_variable m_loader_cv; - std::condition_variable m_file_load_done_cv; - bool m_want_shutdown = false; - uint64_t m_id = 0; - - // used only by game thread - std::unordered_map m_loaded_tfrag3_levels; - - std::vector m_desired_levels; -}; diff --git a/game/graphics/opengl_renderer/MercProgram.cpp b/game/graphics/opengl_renderer/MercProgram.cpp deleted file mode 100644 index a95bec9270..0000000000 --- a/game/graphics/opengl_renderer/MercProgram.cpp +++ /dev/null @@ -1,5397 +0,0 @@ -#include "game/graphics/opengl_renderer/MercRenderer.h" - -void MercRenderer::mscal(int enter_address, - SharedRenderState* render_state, - ScopedProfilerNode& prof) { - mscal_impl(enter_address, render_state, prof); -} - -static inline REALLY_INLINE float erleng(const Vf& in) { - float len = in.x() * in.x() + in.y() * in.y() + in.z() * in.z(); - return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(len))); -} - -u16 MercRenderer::xitop() { - return m_dbf ? BUFFER_BASE : 0; -} - -u16 MercRenderer::xtop() { - return m_dbf ? 0 : BUFFER_BASE; -} - -void MercRenderer::lq_buffer(Mask mask, Vf& dest, u16 addr) { - ASSERT(addr * 16 < sizeof(m_buffer.data)); - for (int i = 0; i < 4; i++) { - if ((u64)mask & (1 << i)) { - memcpy(dest.data + i, m_buffer.data + addr * 16 + i * 4, 4); - } - } -} - -template -REALLY_INLINE void MercRenderer::lq_buffer_xyzw(Vf& dest, u16 addr) { - if constexpr (DEBUG) { - ASSERT(addr * 16 < sizeof(m_buffer.data)); - } - copy_vector(dest.data, m_buffer.data + addr * 16); -} - -template -REALLY_INLINE void MercRenderer::lq_buffer_xyz(Vf& dest, u16 addr) { - if constexpr (DEBUG) { - ASSERT(addr * 16 < sizeof(m_buffer.data)); - } - auto reg = _mm_load_ps(dest.data); - auto mem = _mm_load_ps((const float*)(m_buffer.data + addr * 16)); - _mm_store_ps(dest.data, _mm_blend_ps(mem, reg, 0b1000)); -} - -template -REALLY_INLINE void MercRenderer::sq_buffer_xyzw(const Vf& src, u16 addr) { - if constexpr (DEBUG) { - ASSERT(addr * 16 < sizeof(m_buffer.data)); - } - copy_vector(m_buffer.data + addr * 16, src.data); -} - -void MercRenderer::isw_buffer(Mask mask, u16 val, u16 addr) { - ASSERT(addr * 16 < sizeof(m_buffer.data)); - u32 val32 = val; - int offset; - switch (mask) { - case Mask::x: - offset = 0; - break; - case Mask::y: - offset = 4; - break; - case Mask::z: - offset = 8; - break; - case Mask::w: - offset = 12; - break; - default: - ASSERT(false); - } - memcpy(m_buffer.data + addr * 16 + offset, &val32, 4); -} - -void MercRenderer::ilw_buffer(Mask mask, u16& dest, u16 addr) { - // fmt::print("addr is {}\n", addr); - ASSERT(addr * 16 < sizeof(m_buffer.data)); - int offset; - switch (mask) { - case Mask::x: - offset = 0; - break; - case Mask::y: - offset = 4; - break; - case Mask::z: - offset = 8; - break; - case Mask::w: - offset = 12; - break; - default: - ASSERT(false); - } - memcpy(&dest, m_buffer.data + addr * 16 + offset, 2); -} - -// clang-format off -template -void MercRenderer::mscal_impl(int enter_address, - SharedRenderState* render_state, - ScopedProfilerNode& prof) { - bool bc = false; - // bool bc = false; - switch (enter_address) { - case 0: - goto ENTER_0; - case 17: - goto ENTER_17; - case 20: - goto ENTER_20; - case 32: - goto ENTER_32; - case 35: - goto ENTER_35; - default: - ASSERT(false); - } - ENTER_0: - // lq.xyzw vf01, 7(vi00) | nop - lq_buffer_xyzw(vu.vf01, 7); - // lq.xyzw vf25, 3(vi00) | nop - lq_buffer_xyzw(vu.vf25, 3); - // lq.xyzw vf26, 4(vi00) | nop - lq_buffer_xyzw(vu.vf26, 4); - // lq.xyzw vf27, 5(vi00) | nop - lq_buffer_xyzw(vu.vf27, 5); - // lq.xyzw vf28, 6(vi00) | nop - lq_buffer_xyzw(vu.vf28, 6); - // mr32.xyzw vf01, vf01 | nop - vu.vf01.mr32(Mask::xyzw, vu.vf01); - // move.y vf25, vf26 | nop - vu.vf25.move(Mask::y, vu.vf26); - // move.zw vf25, vf27 | nop - vu.vf25.move(Mask::zw, vu.vf27); - // sq.xyzw vf25, 3(vi00) | nop - sq_buffer_xyzw(vu.vf25, 3); - // 2048.0 | nop :i - vu.I = 2048.0; - // 255.0 | maxi.x vf17, vf00, I :i - vu.vf17.maxi(Mask::x, vu.vf00, vu.I); vu.I = 255.0; - // -65537.0 | maxi.y vf17, vf00, I :i - vu.vf17.maxi(Mask::y, vu.vf00, vu.I); vu.I = -65537.0; - // mr32.xyzw vf02, vf01 | minii.z vf17, vf00, I - vu.vf17.minii(Mask::z, vu.vf00, vu.I); vu.vf02.mr32(Mask::xyzw, vu.vf01); - // lq.xyzw vf22, 2(vi00) | minii.z vf18, vf00, I - vu.vf18.minii(Mask::z, vu.vf00, vu.I); lq_buffer_xyzw(vu.vf22, 2); - // 0.003921569 | minii.z vf19, vf00, I :i - vu.vf19.minii(Mask::z, vu.vf00, vu.I); vu.I = 0.003921569; - // sq.xyzw vf28, 4(vi00) | minii.w vf29, vf00, I :e - vu.vf29.minii(Mask::w, vu.vf00, vu.I); sq_buffer_xyzw(vu.vf28, 4); - // mr32.xyzw vf03, vf02 | nop - vu.vf03.mr32(Mask::xyzw, vu.vf02); - return; - - ENTER_17: - // iaddi vi07, vi00, 0x1 | nop - vu.vi07 = 1; -// BRANCH! - // b L2 | nop - bc = true; - // isw.w vi07, 1(vi00) | nop - isw_buffer(Mask::w, vu.vi07, 1); - if (bc) { goto L2; } - - - ENTER_20: - // iaddi vi07, vi00, 0x0 | nop - vu.vi07 = 0; - L2: - // lq.xyzw vf25, 139(vi00) | nop - lq_buffer_xyzw(vu.vf25, 139); - // lq.xyzw vf26, 3(vi00) | nop - lq_buffer_xyzw(vu.vf26, 3); - // lq.xyz vf01, 132(vi00) | nop - lq_buffer_xyz(vu.vf01, 132); - // lq.xyz vf02, 133(vi00) | nop - lq_buffer_xyz(vu.vf02, 133); - // lq.xyz vf03, 134(vi00) | addy.xy vf19, vf00, vf25 - vu.vf19.add(Mask::xy, vu.vf00, vu.vf25.y()); lq_buffer_xyz(vu.vf03, 134); - // lq.xyzw vf04, 135(vi00) | mulx.xyzw vf26, vf26, vf25 - vu.vf26.mul_xyzw(vu.vf26, vu.vf25.x()); lq_buffer_xyzw(vu.vf04, 135); - // lq.xyzw vf05, 136(vi00) | nop - lq_buffer_xyzw(vu.vf05, 136); - // lq.xyzw vf06, 137(vi00) | nop - lq_buffer_xyzw(vu.vf06, 137); - // lq.xyzw vf07, 138(vi00) | nop - lq_buffer_xyzw(vu.vf07, 138); -// BRANCH! - // b L4 | nop - bc = true; - // sq.xyzw vf26, 5(vi00) | nop - sq_buffer_xyzw(vu.vf26, 5); - if (bc) { goto L4; } - - ENTER_32: - - // iaddi vi07, vi00, 0x1 | nop - vu.vi07 = 1; -// BRANCH! - // b L4 | nop - bc = true; - // isw.w vi07, 1(vi00) | nop - isw_buffer(Mask::w, vu.vi07, 1); - if (bc) { goto L4; } - - - ENTER_35: - // iaddi vi07, vi00, 0x0 | nop - vu.vi07 = 0; - L4: - // lq.xyzw vf28, 139(vi00) | minix.xyzw vf15, vf00, vf00 - vu.vf15.mini_xyzw(vu.vf00, vu.vf00.x()); lq_buffer_xyzw(vu.vf28, 139); - // xtop vi15 | nop - vu.vi15 = xtop(); - // iaddiu vi12, vi15, 0x8c | nop - vu.vi12 = vu.vi15 + 0x8c; /* 140 */ -// BRANCH! - // ibeq vi00, vi15, L5 | nop - bc = (vu.vi15 == 0); - // ilwr.w vi03, vi12 | maxz.xy vf18, vf00, vf28 - vu.vf18.max(Mask::xy, vu.vf00, vu.vf28.z()); ilw_buffer(Mask::w, vu.vi03, vu.vi12); - if (bc) { goto L5; } - - - // nop | maxw.xy vf18, vf00, vf28 - vu.vf18.max(Mask::xy, vu.vf00, vu.vf28.w()); - L5: - // ilw.w vi10, 133(vi00) | nop - ilw_buffer(Mask::w, vu.vi10, 133); - // iaddiu vi15, vi15, 0x173 | nop - vu.vi15 = vu.vi15 + 0x173; /* 371 */ - // ilw.y vi02, 2(vi12) | nop - ilw_buffer(Mask::y, vu.vi02, vu.vi12 + 2); - // lq.xyzw vf14, 0(vi00) | nop - lq_buffer_xyzw(vu.vf14, 0); -// BRANCH! - // ibeq vi00, vi10, L6 | nop - bc = (vu.vi10 == 0); - // iadd vi03, vi03, vi12 | nop - vu.vi03 = vu.vi03 + vu.vi12; - if (bc) { goto L6; } - - - // mr32.xyzw vf27, vf14 | nop - vu.vf27.mr32(Mask::xyzw, vu.vf14); - // ilw.w vi11, 134(vi00) | nop - ilw_buffer(Mask::w, vu.vi11, 134); - // iaddiu vi13, vi00, 0x42 | nop - vu.vi13 = 0x42; /* 66 */ - - // mr32.y vf14, vf27 | nop - vu.vf14.mr32(Mask::y, vu.vf27); - L6: - // ilwr.w vi09, vi03 | nop - ilw_buffer(Mask::w, vu.vi09, vu.vi03); - // lqi.xyzw vf27, vi03 | nop - lq_buffer_xyzw(vu.vf27, vu.vi03++); - // ilw.x vi04, 1(vi12) | nop - ilw_buffer(Mask::x, vu.vi04, vu.vi12 + 1); - // iaddiu vi05, vi00, 0x7f | addw.xyz vf15, vf15, vf00 - vu.vf15.add(Mask::xyz, vu.vf15, vu.vf00.w()); vu.vi05 = 0x7f; /* 127 */ - - // iand vi09, vi09, vi05 | nop - vu.vi09 = vu.vi09 & vu.vi05; - // ilw.y vi06, 1(vi12) | miniz.w vf19, vf00, vf27 - vu.vf19.mini(Mask::w, vu.vf00, vu.vf27.z()); ilw_buffer(Mask::y, vu.vi06, vu.vi12 + 1); -// BRANCH! - // ibeq vi00, vi02, L8 | miniy.w vf18, vf00, vf27 - vu.vf18.mini(Mask::w, vu.vf00, vu.vf27.y()); bc = (vu.vi02 == 0); - // ilwr.z vi01, vi12 | minix.w vf17, vf00, vf27 - vu.vf17.mini(Mask::w, vu.vf00, vu.vf27.x()); ilw_buffer(Mask::z, vu.vi01, vu.vi12); - if (bc) { goto L8; } - - -// BRANCH! - // ibne vi00, vi09, L7 | nop - bc = (vu.vi09 != 0); - // sq.yzw vf14, 0(vi15) | nop - sq_buffer(Mask::yzw, vu.vf14, vu.vi15); - if (bc) { goto L7; } - - - // iaddiu vi02, vi02, 0x4000 | nop - vu.vi02 = vu.vi02 + 0x4000; /* 16384 */ - // iaddiu vi02, vi02, 0x4000 | nop - vu.vi02 = vu.vi02 + 0x4000; /* 16384 */ - // iswr.x vi02, vi15 | nop - isw_buffer(Mask::x, vu.vi02, vu.vi15); -// BRANCH! - // b L11 | nop - bc = true; - // nop | nop - - if (bc) { goto L11; } - - - L7: - // iswr.x vi02, vi15 | nop - isw_buffer(Mask::x, vu.vi02, vu.vi15); - L8: - // lq.xyzw vf13, 1(vi00) | nop - lq_buffer_xyzw(vu.vf13, 1); - L9: - // ilwr.w vi02, vi03 | nop - ilw_buffer(Mask::w, vu.vi02, vu.vi03); - // lqi.xyzw vf08, vi03 | nop - lq_buffer_xyzw(vu.vf08, vu.vi03++); - // lqi.xyzw vf09, vi03 | nop - lq_buffer_xyzw(vu.vf09, vu.vi03++); - // lqi.xyzw vf10, vi03 | nop - lq_buffer_xyzw(vu.vf10, vu.vi03++); - // lqi.xyzw vf11, vi03 | nop - lq_buffer_xyzw(vu.vf11, vu.vi03++); - // lqi.xyzw vf12, vi03 | nop - lq_buffer_xyzw(vu.vf12, vu.vi03++); - // iadd vi02, vi02, vi15 | nop - vu.vi02 = vu.vi02 + vu.vi15; - // mtir vi08, vf09.w | nop - vu.vi08 = vu.vf09.w_as_u16(); - // sqi.xyzw vf13, vi02 | nop - sq_buffer_xyzw(vu.vf13, vu.vi02++); - // sqi.xyzw vf08, vi02 | nop - sq_buffer_xyzw(vu.vf08, vu.vi02++); - // sqi.xyzw vf09, vi02 | nop - sq_buffer_xyzw(vu.vf09, vu.vi02++); - // mfir.x vf14, vi08 | nop - vu.vf14.mfir(Mask::x, vu.vi08); - // sqi.xyzw vf10, vi02 | nop - sq_buffer_xyzw(vu.vf10, vu.vi02++); - // sqi.xyzw vf11, vi02 | nop - sq_buffer_xyzw(vu.vf11, vu.vi02++); -// BRANCH! - // ibeq vi00, vi10, L10 | nop - bc = (vu.vi10 == 0); - // sqi.xyzw vf12, vi02 | nop - sq_buffer_xyzw(vu.vf12, vu.vi02++); - if (bc) { goto L10; } - - - // mtir vi14, vf12.z | nop - vu.vi14 = vu.vf12.z_as_u16(); - // isw.x vi10, -1(vi02) | nop - isw_buffer(Mask::x, vu.vi10, vu.vi02 + -1); -// BRANCH! - // ibeq vi14, vi13, L10 | nop - bc = (vu.vi14 == vu.vi13); - // isw.y vi11, -1(vi02) | nop - isw_buffer(Mask::y, vu.vi11, vu.vi02 + -1); - if (bc) { goto L10; } - - - // ilw.x vi13, -4(vi02) | nop - ilw_buffer(Mask::x, vu.vi13, vu.vi02 + -4); - // isubiu vi14, vi00, 0x1d | nop - vu.vi14 = -29; - - // iand vi13, vi13, vi14 | nop - vu.vi13 = vu.vi13 & vu.vi14; - // iaddi vi13, vi13, 0xc | nop - vu.vi13 = vu.vi13 + 12; - // isw.x vi13, -4(vi02) | nop - isw_buffer(Mask::x, vu.vi13, vu.vi02 + -4); - // iaddiu vi13, vi00, 0x42 | nop - vu.vi13 = 0x42; /* 66 */ - - // isw.z vi13, -1(vi02) | nop - isw_buffer(Mask::z, vu.vi13, vu.vi02 + -1); - L10: -// BRANCH! - // ibgtz vi08, L9 | nop - bc = ((s16)vu.vi08) > 0; - // sq.xyzw vf14, 0(vi02) | nop - sq_buffer_xyzw(vu.vf14, vu.vi02); - if (bc) { goto L9; } - - - L11: - // lq.xyzw vf28, 3(vi00) | nop - lq_buffer_xyzw(vu.vf28, 3); - // ilw.y vi08, 3(vi12) | nop - ilw_buffer(Mask::y, vu.vi08, vu.vi12 + 3); - // lq.xyzw vf16, 5(vi00) | nop - lq_buffer_xyzw(vu.vf16, 5); - // lq.xyzw vf20, 4(vi00) | nop - lq_buffer_xyzw(vu.vf20, 4); - // ilw.z vi09, 3(vi12) | mul.xyzw vf27, vf28, vf15 - vu.vf27.mul_xyzw(vu.vf28, vu.vf15); ilw_buffer(Mask::z, vu.vi09, vu.vi12 + 3); - // ior vi11, vi08, vi00 | mul.xyzw vf28, vf28, vf00 - vu.vf28.mul_xyzw(vu.vf28, vu.vf00); vu.vi11 = vu.vi08; -// BRANCH! - // ibeq vi00, vi08, L13 | mul.xyzw vf15, vf16, vf15 - vu.vf15.mul_xyzw(vu.vf16, vu.vf15); bc = (vu.vi08 == 0); - // iaddi vi13, vi12, 0x3 | mul.xyzw vf16, vf16, vf00 - vu.vf16.mul_xyzw(vu.vf16, vu.vf00); vu.vi13 = vu.vi12 + 3; - if (bc) { goto L13; } - - - L12: - // lq.xyzw vf08, 0(vi08) | addax.xyzw vf20, vf00 - vu.acc.adda(Mask::xyzw, vu.vf20, vu.vf00.x()); lq_buffer_xyzw(vu.vf08, vu.vi08); - // lq.xyzw vf10, 1(vi08) | madda.xyzw ACC, vf27, vf25 - vu.acc.madda_xyzw(vu.vf27, vu.vf25); lq_buffer_xyzw(vu.vf10, vu.vi08 + 1); - // lq.xyzw vf12, 2(vi08) | maddz.xyzw vf26, vf28, vf25 - vu.acc.madd_xyzw(vu.vf26, vu.vf28, vu.vf25.z()); lq_buffer_xyzw(vu.vf12, vu.vi08 + 2); - // lq.xyzw vf25, 3(vi08) | nop - lq_buffer_xyzw(vu.vf25, vu.vi08 + 3); - // sq.xyzw vf09, 0(vi11) | mula.xyzw ACC, vf15, vf08 - vu.acc.mula_xyzw(vu.vf15, vu.vf08); sq_buffer_xyzw(vu.vf09, vu.vi11); - // sq.xyzw vf11, 1(vi11) | maddz.xyzw vf09, vf16, vf08 - vu.acc.madd_xyzw(vu.vf09, vu.vf16, vu.vf08.z()); sq_buffer_xyzw(vu.vf11, vu.vi11 + 1); - // sq.xyzw vf13, 2(vi11) | mula.xyzw ACC, vf15, vf10 - vu.acc.mula_xyzw(vu.vf15, vu.vf10); sq_buffer_xyzw(vu.vf13, vu.vi11 + 2); - // sq.xyzw vf26, 3(vi11) | maddz.xyzw vf11, vf16, vf10 - vu.acc.madd_xyzw(vu.vf11, vu.vf16, vu.vf10.z()); sq_buffer_xyzw(vu.vf26, vu.vi11 + 3); -// BRANCH! - // ibeq vi00, vi08, L13 | mula.xyzw ACC, vf15, vf12 - vu.acc.mula_xyzw(vu.vf15, vu.vf12); bc = (vu.vi08 == 0); - // ilwr.w vi10, vi13 | maddz.xyzw vf13, vf16, vf12 - vu.acc.madd_xyzw(vu.vf13, vu.vf16, vu.vf12.z()); ilw_buffer(Mask::w, vu.vi10, vu.vi13); - if (bc) { goto L13; } - - - // lq.xyzw vf08, 0(vi09) | addax.xyzw vf20, vf00 - vu.acc.adda(Mask::xyzw, vu.vf20, vu.vf00.x()); lq_buffer_xyzw(vu.vf08, vu.vi09); - // lq.xyzw vf10, 1(vi09) | madda.xyzw ACC, vf27, vf25 - vu.acc.madda_xyzw(vu.vf27, vu.vf25); lq_buffer_xyzw(vu.vf10, vu.vi09 + 1); - // lq.xyzw vf12, 2(vi09) | maddz.xyzw vf26, vf28, vf25 - vu.acc.madd_xyzw(vu.vf26, vu.vf28, vu.vf25.z()); lq_buffer_xyzw(vu.vf12, vu.vi09 + 2); - // lq.xyzw vf25, 3(vi09) | nop - lq_buffer_xyzw(vu.vf25, vu.vi09 + 3); - // sq.xyzw vf09, 0(vi08) | mula.xyzw ACC, vf15, vf08 - vu.acc.mula_xyzw(vu.vf15, vu.vf08); sq_buffer_xyzw(vu.vf09, vu.vi08); - // sq.xyzw vf11, 1(vi08) | maddz.xyzw vf09, vf16, vf08 - vu.acc.madd_xyzw(vu.vf09, vu.vf16, vu.vf08.z()); sq_buffer_xyzw(vu.vf11, vu.vi08 + 1); - // sq.xyzw vf13, 2(vi08) | mula.xyzw ACC, vf15, vf10 - vu.acc.mula_xyzw(vu.vf15, vu.vf10); sq_buffer_xyzw(vu.vf13, vu.vi08 + 2); - // sq.xyzw vf26, 3(vi08) | maddz.xyzw vf11, vf16, vf10 - vu.acc.madd_xyzw(vu.vf11, vu.vf16, vu.vf10.z()); sq_buffer_xyzw(vu.vf26, vu.vi08 + 3); -// BRANCH! - // ibeq vi00, vi09, L13 | mula.xyzw ACC, vf15, vf12 - vu.acc.mula_xyzw(vu.vf15, vu.vf12); bc = (vu.vi09 == 0); - // ilw.x vi11, 1(vi13) | maddz.xyzw vf13, vf16, vf12 - vu.acc.madd_xyzw(vu.vf13, vu.vf16, vu.vf12.z()); ilw_buffer(Mask::x, vu.vi11, vu.vi13 + 1); - if (bc) { goto L13; } - - - // lq.xyzw vf08, 0(vi10) | addax.xyzw vf20, vf00 - vu.acc.adda(Mask::xyzw, vu.vf20, vu.vf00.x()); lq_buffer_xyzw(vu.vf08, vu.vi10); - // lq.xyzw vf10, 1(vi10) | madda.xyzw ACC, vf27, vf25 - vu.acc.madda_xyzw(vu.vf27, vu.vf25); lq_buffer_xyzw(vu.vf10, vu.vi10 + 1); - // lq.xyzw vf12, 2(vi10) | maddz.xyzw vf26, vf28, vf25 - vu.acc.madd_xyzw(vu.vf26, vu.vf28, vu.vf25.z()); lq_buffer_xyzw(vu.vf12, vu.vi10 + 2); - // lq.xyzw vf25, 3(vi10) | nop - lq_buffer_xyzw(vu.vf25, vu.vi10 + 3); - // sq.xyzw vf09, 0(vi09) | mula.xyzw ACC, vf15, vf08 - vu.acc.mula_xyzw(vu.vf15, vu.vf08); sq_buffer_xyzw(vu.vf09, vu.vi09); - // sq.xyzw vf11, 1(vi09) | maddz.xyzw vf09, vf16, vf08 - vu.acc.madd_xyzw(vu.vf09, vu.vf16, vu.vf08.z()); sq_buffer_xyzw(vu.vf11, vu.vi09 + 1); - // sq.xyzw vf13, 2(vi09) | mula.xyzw ACC, vf15, vf10 - vu.acc.mula_xyzw(vu.vf15, vu.vf10); sq_buffer_xyzw(vu.vf13, vu.vi09 + 2); - // sq.xyzw vf26, 3(vi09) | maddz.xyzw vf11, vf16, vf10 - vu.acc.madd_xyzw(vu.vf11, vu.vf16, vu.vf10.z()); sq_buffer_xyzw(vu.vf26, vu.vi09 + 3); -// BRANCH! - // ibeq vi00, vi10, L13 | mula.xyzw ACC, vf15, vf12 - vu.acc.mula_xyzw(vu.vf15, vu.vf12); bc = (vu.vi10 == 0); - // ilw.y vi08, 1(vi13) | maddz.xyzw vf13, vf16, vf12 - vu.acc.madd_xyzw(vu.vf13, vu.vf16, vu.vf12.z()); ilw_buffer(Mask::y, vu.vi08, vu.vi13 + 1); - if (bc) { goto L13; } - - - // lq.xyzw vf08, 0(vi11) | addax.xyzw vf20, vf00 - vu.acc.adda(Mask::xyzw, vu.vf20, vu.vf00.x()); lq_buffer_xyzw(vu.vf08, vu.vi11); - // lq.xyzw vf10, 1(vi11) | madda.xyzw ACC, vf27, vf25 - vu.acc.madda_xyzw(vu.vf27, vu.vf25); lq_buffer_xyzw(vu.vf10, vu.vi11 + 1); - // lq.xyzw vf12, 2(vi11) | maddz.xyzw vf26, vf28, vf25 - vu.acc.madd_xyzw(vu.vf26, vu.vf28, vu.vf25.z()); lq_buffer_xyzw(vu.vf12, vu.vi11 + 2); - // lq.xyzw vf25, 3(vi11) | nop - lq_buffer_xyzw(vu.vf25, vu.vi11 + 3); - // sq.xyzw vf09, 0(vi10) | mula.xyzw ACC, vf15, vf08 - vu.acc.mula_xyzw(vu.vf15, vu.vf08); sq_buffer_xyzw(vu.vf09, vu.vi10); - // sq.xyzw vf11, 1(vi10) | maddz.xyzw vf09, vf16, vf08 - vu.acc.madd_xyzw(vu.vf09, vu.vf16, vu.vf08.z()); sq_buffer_xyzw(vu.vf11, vu.vi10 + 1); - // sq.xyzw vf13, 2(vi10) | mula.xyzw ACC, vf15, vf10 - vu.acc.mula_xyzw(vu.vf15, vu.vf10); sq_buffer_xyzw(vu.vf13, vu.vi10 + 2); - // sq.xyzw vf26, 3(vi10) | maddz.xyzw vf11, vf16, vf10 - vu.acc.madd_xyzw(vu.vf11, vu.vf16, vu.vf10.z()); sq_buffer_xyzw(vu.vf26, vu.vi10 + 3); - // iaddi vi13, vi13, 0x1 | nop - vu.vi13 = vu.vi13 + 1; -// BRANCH! - // ibne vi00, vi11, L12 | mula.xyzw ACC, vf15, vf12 - vu.acc.mula_xyzw(vu.vf15, vu.vf12); bc = (vu.vi11 != 0); - // ilwr.z vi09, vi13 | maddz.xyzw vf13, vf16, vf12 - vu.acc.madd_xyzw(vu.vf13, vu.vf16, vu.vf12.z()); ilw_buffer(Mask::z, vu.vi09, vu.vi13); - if (bc) { goto L12; } - - - L13: - // ilw.x vi02, 3(vi12) | nop - ilw_buffer(Mask::x, vu.vi02, vu.vi12 + 3); -// BRANCH! - // ibeq vi00, vi04, L25 | nop - bc = (vu.vi04 == 0); - // iadd vi01, vi01, vi12 | nop - vu.vi01 = vu.vi01 + vu.vi12; - if (bc) { goto L25; } - - - // ilwr.x vi08, vi01 | nop - ilw_buffer(Mask::x, vu.vi08, vu.vi01); - // lqi.xyzw vf08, vi01 | nop - lq_buffer_xyzw(vu.vf08, vu.vi01++); - // lqi.xyzw vf11, vi01 | nop - lq_buffer_xyzw(vu.vf11, vu.vi01++); - // lqi.xyzw vf14, vi01 | nop - lq_buffer_xyzw(vu.vf14, vu.vi01++); - // lq.xyz vf29, 4(vi08) | nop - lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyz vf30, 5(vi08) | add.zw vf08, vf08, vf17 - vu.vf08.add(Mask::zw, vu.vf08, vu.vf17); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); - // lq.xyzw vf31, 6(vi08) | add.xyzw vf11, vf11, vf18 - vu.vf11.add_xyzw(vu.vf11, vu.vf18); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - // iaddi vi04, vi04, -0x1 | add.xyzw vf14, vf14, vf19 - vu.vf14.add_xyzw(vu.vf14, vu.vf19); vu.vi04 = vu.vi04 + -1; - // iadd vi02, vi02, vi12 | nop - vu.vi02 = vu.vi02 + vu.vi12; - // lqi.xyzw vf24, vi02 | mulaz.xyzw ACC, vf29, vf08 - vu.acc.mula_xyzw(vu.vf29, vu.vf08.z()); lq_buffer_xyzw(vu.vf24, vu.vi02++); - // mtir vi10, vf11.x | maddaz.xyzw ACC, vf30, vf11 - vu.acc.madda_xyzw(vu.vf30, vu.vf11.z()); vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | maddz.xyz vf11, vf31, vf14 - vu.vi13 = vu.vf11.y_as_u16(); vu.acc.madd_xyz(vu.vf11, vu.vf31, vu.vf14.z()); - // lq.xyzw vf25, 0(vi08) | nop - lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf26, 1(vi08) | itof0.xyzw vf24, vf24 - vu.vf24.itof0(Mask::xyzw, vu.vf24); lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // lq.xyzw vf27, 2(vi08) | nop - lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // erleng.xyz P, vf11 | nop - vu.P = erleng(vu.vf11); /* TODO erleng */ - // lq.xyzw vf28, 3(vi08) | mulaw.xyzw ACC, vf25, vf08 - vu.acc.mula_xyzw(vu.vf25, vu.vf08.w()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // ior vi15, vi07, vi00 | maddaw.xyzw ACC, vf26, vf11 - vu.acc.madda_xyzw(vu.vf26, vu.vf11.w()); vu.vi15 = vu.vi07; - // mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 - vu.acc.madd_xyzw(vu.vf08, vu.vf27, vu.vf14.w()); vu.vf14.z() = 1.f; - // lqi.xyzw vf09, vi01 | nop - lq_buffer_xyzw(vu.vf09, vu.vi01++); - // ilwr.y vi03, vi12 | nop - ilw_buffer(Mask::y, vu.vi03, vu.vi12); - // ilw.z vi07, 1(vi12) | nop - ilw_buffer(Mask::z, vu.vi07, vu.vi12 + 1); - // lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 - vu.vf08.add_xyzw(vu.vf08, vu.vf28); lq_buffer_xyzw(vu.vf12, vu.vi01++); - // lqi.xyzw vf15, vi01 | nop - lq_buffer_xyzw(vu.vf15, vu.vi01++); - // mtir vi08, vf09.x | nop - vu.vi08 = vu.vf09.x_as_u16(); -// BRANCH! - // ibeq vi00, vi15, L14 | nop - bc = (vu.vi15 == 0); - // iadd vi03, vi03, vi12 | nop - vu.vi03 = vu.vi03 + vu.vi12; - if (bc) { goto L14; } - - - // nop | miniw.w vf08, vf08, vf01 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf01.w()); - L14: - // div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 - vu.vf09.add(Mask::zw, vu.vf09, vu.vf17); vu.Q = vu.vf01.w() / vu.vf08.w(); - - // iadd vi04, vi04, vi03 | add.xyzw vf12, vf12, vf18 - vu.vf12.add_xyzw(vu.vf12, vu.vf18); vu.vi04 = vu.vi04 + vu.vi03; - // lq.xyz vf29, 4(vi08) | add.xyzw vf15, vf15, vf19 - vu.vf15.add_xyzw(vu.vf15, vu.vf19); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyz vf30, 5(vi08) | nop - lq_buffer_xyz(vu.vf30, vu.vi08 + 5); - // iadd vi06, vi06, vi04 | nop - vu.vi06 = vu.vi06 + vu.vi04; - // lq.xyzw vf31, 6(vi08) | nop - lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - // lq.xyzw vf25, 0(vi08) | nop - lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf26, 1(vi08) | mul.xyz vf08, vf08, Q - vu.vf08.mul(Mask::xyz, vu.vf08, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | nop - vu.vi14 = vu.vf12.y_as_u16(); - // lq.xyzw vf27, 2(vi08) | nop - lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - // iadd vi07, vi07, vi06 | mulaz.xyzw ACC, vf29, vf09 - vu.acc.mula_xyzw(vu.vf29, vu.vf09.z()); vu.vi07 = vu.vi07 + vu.vi06; - // lq.xyzw vf28, 3(vi08) | maddaz.xyzw ACC, vf30, vf12 - vu.acc.madda_xyzw(vu.vf30, vu.vf12.z()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 - vu.acc.madd_xyz(vu.vf12, vu.vf31, vu.vf15.z()); vu.vf20.mfp(Mask::w, vu.P); - // nop | nop - - // 1024.0 | miniw.w vf08, vf08, vf03 :i - vu.vf08.mini(Mask::w, vu.vf08, vu.vf03.w()); vu.I = 1024.0; -// BRANCH! - // ibne vi00, vi15, L82 | mulaw.xyzw ACC, vf25, vf09 - vu.acc.mula_xyzw(vu.vf25, vu.vf09.w()); bc = (vu.vi15 != 0); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 - vu.vf11.mul_xyzw(vu.vf11, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - if (bc) { goto L82; } - - - // erleng.xyz P, vf12 | nop - vu.P = erleng(vu.vf12); /* TODO erleng */ - // nop | maddaw.xyzw ACC, vf26, vf12 - vu.acc.madda_xyzw(vu.vf26, vu.vf12.w()); - // mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 - vu.acc.madd_xyzw(vu.vf09, vu.vf27, vu.vf15.w()); vu.vf15.z() = 1.f; - // lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); lq_buffer_xyzw(vu.vf10, vu.vi01++); -// BRANCH! - // ibne vi04, vi03, L16 | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); bc = (vu.vi04 != vu.vi03); - // nop | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); - if (bc) { goto L16; } - - -// BRANCH! - // ibne vi06, vi03, JUMP_1A1 | nop - bc = (vu.vi06 != vu.vi03); - // nop | nop - - if (bc) { goto JUMP_1A1; } - - -// BRANCH! - // b L67 | nop - bc = true; - // nop | nop - - if (bc) { goto L67; } - - - L15: - // lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); lq_buffer_xyzw(vu.vf10, vu.vi01++); - // sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); sq_buffer_xyzw(vu.vf13, vu.vi12 + 1); - // sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); sq_buffer_xyzw(vu.vf13, vu.vi15 + 1); - L16: - // lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 - vu.vf09.add_xyzw(vu.vf09, vu.vf28); lq_buffer_xyzw(vu.vf13, vu.vi01++); - // lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 - vu.vf08.max(Mask::w, vu.vf08, vu.vf02.w()); lq_buffer_xyzw(vu.vf16, vu.vi01++); - // mtir vi08, vf10.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi08 = vu.vf10.x_as_u16(); - // ilw.y vi09, -9(vi01) | maxx.xyzw vf11, vf11, vf00 - vu.vf11.max_xyzw(vu.vf11, vu.vf00.x()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -9); - // div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 - vu.vf10.add(Mask::zw, vu.vf10, vu.vf17); vu.Q = vu.vf01.w() / vu.vf09.w(); - - // move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 - vu.vf13.add_xyzw(vu.vf13, vu.vf18); vu.vf21.move_xyzw(vu.vf08); - // lq.xyz vf29, 4(vi08) | add.xyzw vf16, vf16, vf19 - vu.vf16.add_xyzw(vu.vf16, vu.vf19); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyz vf30, 5(vi08) | mulax.xyzw ACC, vf04, vf11 - vu.acc.mula_xyzw(vu.vf04, vu.vf11.x()); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); -// BRANCH! - // ibgtz vi09, L17 | madday.xyzw ACC, vf05, vf11 - vu.acc.madda_xyzw(vu.vf05, vu.vf11.y()); bc = ((s16)vu.vi09) > 0; - // lq.xyzw vf31, 6(vi08) | maddaz.xyzw ACC, vf06, vf11 - vu.acc.madda_xyzw(vu.vf06, vu.vf11.z()); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - if (bc) { goto L17; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L17: - // lq.xyzw vf25, 0(vi08) | maddw.xyzw vf11, vf07, vf00 - vu.acc.madd_xyzw(vu.vf11, vu.vf07, vu.vf00.w()); lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf26, 1(vi08) | mul.xyz vf09, vf09, Q - vu.vf09.mul(Mask::xyz, vu.vf09, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ vu.vi12 = vu.vf13.x_as_u16(); - // mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi15 = vu.vf13.y_as_u16(); - // lq.xyzw vf27, 2(vi08) | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); -// BRANCH! - // ibne vi00, vi09, L18 | mulaz.xyzw ACC, vf29, vf10 - vu.acc.mula_xyzw(vu.vf29, vu.vf10.z()); bc = (vu.vi09 != 0); - // sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 - vu.acc.madda_xyzw(vu.vf30, vu.vf13.z()); sq_buffer_xyzw(vu.vf21, vu.vi10 + 2); - if (bc) { goto L18; } - - - // nop | ftoi4.xyzw vf21, vf08 - vu.vf21.ftoi4(Mask::xyzw, vu.vf08); - L18: - // mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 - vu.acc.madd_xyz(vu.vf13, vu.vf31, vu.vf16.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 - vu.vf11.mini_xyzw(vu.vf11, vu.vf17.y()); sq_buffer_xyzw(vu.vf14, vu.vi10); - // sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 - vu.vf09.mini(Mask::w, vu.vf09, vu.vf03.w()); sq_buffer_xyzw(vu.vf14, vu.vi13); - // sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 - vu.acc.mula_xyzw(vu.vf25, vu.vf10.w()); sq_buffer_xyzw(vu.vf21, vu.vi13 + 2); - // lq.xyzw vf28, 3(vi08) | mulw.xyzw vf12, vf12, vf20 - vu.vf12.mul_xyzw(vu.vf12, vu.vf20.w()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // erleng.xyz P, vf13 | ftoi0.xyzw vf11, vf11 - vu.vf11.ftoi0(Mask::xyzw, vu.vf11); vu.P = erleng(vu.vf13); /* TODO erleng */ -// BRANCH! - // ibne vi04, vi03, L19 | maddaw.xyzw ACC, vf26, vf13 - vu.acc.madda_xyzw(vu.vf26, vu.vf13.w()); bc = (vu.vi04 != vu.vi03); - // mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 - vu.acc.madd_xyzw(vu.vf10, vu.vf27, vu.vf16.w()); vu.vf16.z() = 1.f; - if (bc) { goto L19; } - - -// BRANCH! - // ibne vi06, vi03, L35 | nop - bc = (vu.vi06 != vu.vi03); - // ilw.y vi09, -6(vi01) | nop - ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - if (bc) { goto L35; } - - -// BRANCH! - // ibne vi07, vi03, L72 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L72; } - - -// BRANCH! - // b L143 | nop - bc = true; - // nop | nop - - if (bc) { goto L143; } - - - L19: - // lqi.xyzw vf08, vi01 | mulax.xyzw ACC, vf01, vf12 - vu.acc.mula_xyzw(vu.vf01, vu.vf12.x()); lq_buffer_xyzw(vu.vf08, vu.vi01++); - // sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 - vu.acc.madda_xyzw(vu.vf02, vu.vf12.y()); sq_buffer_xyzw(vu.vf11, vu.vi10 + 1); - // sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 - vu.acc.madd_xyzw(vu.vf12, vu.vf03, vu.vf12.z()); sq_buffer_xyzw(vu.vf11, vu.vi13 + 1); - // lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 - vu.vf10.add_xyzw(vu.vf10, vu.vf28); lq_buffer_xyzw(vu.vf11, vu.vi01++); - // lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 - vu.vf09.max(Mask::w, vu.vf09, vu.vf02.w()); lq_buffer_xyzw(vu.vf14, vu.vi01++); - // mtir vi08, vf08.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi08 = vu.vf08.x_as_u16(); - // ilw.y vi09, -9(vi01) | maxx.xyzw vf12, vf12, vf00 - vu.vf12.max_xyzw(vu.vf12, vu.vf00.x()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -9); - // div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 - vu.vf08.add(Mask::zw, vu.vf08, vu.vf17); vu.Q = vu.vf01.w() / vu.vf10.w(); - - // move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 - vu.vf11.add_xyzw(vu.vf11, vu.vf18); vu.vf21.move_xyzw(vu.vf09); - // lq.xyz vf29, 4(vi08) | add.xyzw vf14, vf14, vf19 - vu.vf14.add_xyzw(vu.vf14, vu.vf19); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyz vf30, 5(vi08) | mulax.xyzw ACC, vf04, vf12 - vu.acc.mula_xyzw(vu.vf04, vu.vf12.x()); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); -// BRANCH! - // ibgtz vi09, L20 | madday.xyzw ACC, vf05, vf12 - vu.acc.madda_xyzw(vu.vf05, vu.vf12.y()); bc = ((s16)vu.vi09) > 0; - // lq.xyzw vf31, 6(vi08) | maddaz.xyzw ACC, vf06, vf12 - vu.acc.madda_xyzw(vu.vf06, vu.vf12.z()); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - if (bc) { goto L20; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L20: - // lq.xyzw vf25, 0(vi08) | maddw.xyzw vf12, vf07, vf00 - vu.acc.madd_xyzw(vu.vf12, vu.vf07, vu.vf00.w()); lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf26, 1(vi08) | mul.xyz vf10, vf10, Q - vu.vf10.mul(Mask::xyz, vu.vf10, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi13 = vu.vf11.y_as_u16(); - // lq.xyzw vf27, 2(vi08) | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); -// BRANCH! - // ibne vi00, vi09, L21 | mulaz.xyzw ACC, vf29, vf08 - vu.acc.mula_xyzw(vu.vf29, vu.vf08.z()); bc = (vu.vi09 != 0); - // sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 - vu.acc.madda_xyzw(vu.vf30, vu.vf11.z()); sq_buffer_xyzw(vu.vf21, vu.vi11 + 2); - if (bc) { goto L21; } - - - // nop | ftoi4.xyzw vf21, vf09 - vu.vf21.ftoi4(Mask::xyzw, vu.vf09); - L21: - // mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 - vu.acc.madd_xyz(vu.vf11, vu.vf31, vu.vf14.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 - vu.vf12.mini_xyzw(vu.vf12, vu.vf17.y()); sq_buffer_xyzw(vu.vf15, vu.vi11); - // sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 - vu.vf10.mini(Mask::w, vu.vf10, vu.vf03.w()); sq_buffer_xyzw(vu.vf15, vu.vi14); - // sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 - vu.acc.mula_xyzw(vu.vf25, vu.vf08.w()); sq_buffer_xyzw(vu.vf21, vu.vi14 + 2); - // lq.xyzw vf28, 3(vi08) | mulw.xyzw vf13, vf13, vf20 - vu.vf13.mul_xyzw(vu.vf13, vu.vf20.w()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // erleng.xyz P, vf11 | ftoi0.xyzw vf12, vf12 - vu.vf12.ftoi0(Mask::xyzw, vu.vf12); vu.P = erleng(vu.vf11); /* TODO erleng */ -// BRANCH! - // ibne vi04, vi03, L22 | maddaw.xyzw ACC, vf26, vf11 - vu.acc.madda_xyzw(vu.vf26, vu.vf11.w()); bc = (vu.vi04 != vu.vi03); - // mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 - vu.acc.madd_xyzw(vu.vf08, vu.vf27, vu.vf14.w()); vu.vf14.z() = 1.f; - if (bc) { goto L22; } - - -// BRANCH! - // ibne vi06, vi03, L40 | nop - bc = (vu.vi06 != vu.vi03); - // ilw.y vi09, -6(vi01) | nop - ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - if (bc) { goto L40; } - - -// BRANCH! - // ibne vi07, vi03, L77 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L77; } - - -// BRANCH! - // b L153 | nop - bc = true; - // nop | nop - - if (bc) { goto L153; } - - - L22: - // lqi.xyzw vf09, vi01 | mulax.xyzw ACC, vf01, vf13 - vu.acc.mula_xyzw(vu.vf01, vu.vf13.x()); lq_buffer_xyzw(vu.vf09, vu.vi01++); - // sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 - vu.acc.madda_xyzw(vu.vf02, vu.vf13.y()); sq_buffer_xyzw(vu.vf12, vu.vi11 + 1); - // sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 - vu.acc.madd_xyzw(vu.vf13, vu.vf03, vu.vf13.z()); sq_buffer_xyzw(vu.vf12, vu.vi14 + 1); - // lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 - vu.vf08.add_xyzw(vu.vf08, vu.vf28); lq_buffer_xyzw(vu.vf12, vu.vi01++); - // lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 - vu.vf10.max(Mask::w, vu.vf10, vu.vf02.w()); lq_buffer_xyzw(vu.vf15, vu.vi01++); - // mtir vi08, vf09.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi08 = vu.vf09.x_as_u16(); - // ilw.y vi09, -9(vi01) | maxx.xyzw vf13, vf13, vf00 - vu.vf13.max_xyzw(vu.vf13, vu.vf00.x()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -9); - // div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 - vu.vf09.add(Mask::zw, vu.vf09, vu.vf17); vu.Q = vu.vf01.w() / vu.vf08.w(); - - // move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 - vu.vf12.add_xyzw(vu.vf12, vu.vf18); vu.vf21.move_xyzw(vu.vf10); - // lq.xyz vf29, 4(vi08) | add.xyzw vf15, vf15, vf19 - vu.vf15.add_xyzw(vu.vf15, vu.vf19); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyz vf30, 5(vi08) | mulax.xyzw ACC, vf04, vf13 - vu.acc.mula_xyzw(vu.vf04, vu.vf13.x()); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); -// BRANCH! - // ibgtz vi09, L23 | madday.xyzw ACC, vf05, vf13 - vu.acc.madda_xyzw(vu.vf05, vu.vf13.y()); bc = ((s16)vu.vi09) > 0; - // lq.xyzw vf31, 6(vi08) | maddaz.xyzw ACC, vf06, vf13 - vu.acc.madda_xyzw(vu.vf06, vu.vf13.z()); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - if (bc) { goto L23; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L23: - // lq.xyzw vf25, 0(vi08) | maddw.xyzw vf13, vf07, vf00 - vu.acc.madd_xyzw(vu.vf13, vu.vf07, vu.vf00.w()); lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf26, 1(vi08) | mul.xyz vf08, vf08, Q - vu.vf08.mul(Mask::xyz, vu.vf08, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi14 = vu.vf12.y_as_u16(); - // lq.xyzw vf27, 2(vi08) | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); -// BRANCH! - // ibne vi00, vi09, L24 | mulaz.xyzw ACC, vf29, vf09 - vu.acc.mula_xyzw(vu.vf29, vu.vf09.z()); bc = (vu.vi09 != 0); - // sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 - vu.acc.madda_xyzw(vu.vf30, vu.vf12.z()); sq_buffer_xyzw(vu.vf21, vu.vi12 + 2); - if (bc) { goto L24; } - - - // nop | ftoi4.xyzw vf21, vf10 - vu.vf21.ftoi4(Mask::xyzw, vu.vf10); - L24: - // mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 - vu.acc.madd_xyz(vu.vf12, vu.vf31, vu.vf15.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 - vu.vf13.mini_xyzw(vu.vf13, vu.vf17.y()); sq_buffer_xyzw(vu.vf16, vu.vi12); - // sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf03.w()); sq_buffer_xyzw(vu.vf16, vu.vi15); - // sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 - vu.acc.mula_xyzw(vu.vf25, vu.vf09.w()); sq_buffer_xyzw(vu.vf21, vu.vi15 + 2); - // lq.xyzw vf28, 3(vi08) | mulw.xyzw vf11, vf11, vf20 - vu.vf11.mul_xyzw(vu.vf11, vu.vf20.w()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // erleng.xyz P, vf12 | ftoi0.xyzw vf13, vf13 - vu.vf13.ftoi0(Mask::xyzw, vu.vf13); vu.P = erleng(vu.vf12); /* TODO erleng */ -// BRANCH! - // ibne vi04, vi03, L15 | maddaw.xyzw ACC, vf26, vf12 - vu.acc.madda_xyzw(vu.vf26, vu.vf12.w()); bc = (vu.vi04 != vu.vi03); - // mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 - vu.acc.madd_xyzw(vu.vf09, vu.vf27, vu.vf15.w()); vu.vf15.z() = 1.f; - if (bc) { goto L15; } - - -// BRANCH! - // ibne vi06, vi03, L29 | nop - bc = (vu.vi06 != vu.vi03); - // ilw.y vi09, -6(vi01) | nop - ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - if (bc) { goto L29; } - - -// BRANCH! - // ibne vi07, vi03, L66 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L66; } - - -// BRANCH! - // b L163 | nop - bc = true; - // nop | nop - - if (bc) { goto L163; } - - - L25: -// BRANCH! - // ibeq vi00, vi06, L61 | nop - bc = (vu.vi06 == 0); - // iadd vi02, vi02, vi12 | nop - vu.vi02 = vu.vi02 + vu.vi12; - if (bc) { goto L61; } - - - // lqi.xyzw vf08, vi01 | nop - lq_buffer_xyzw(vu.vf08, vu.vi01++); - // lqi.xyzw vf24, vi02 | nop - lq_buffer_xyzw(vu.vf24, vu.vi02++); - // lqi.xyzw vf11, vi01 | nop - lq_buffer_xyzw(vu.vf11, vu.vi01++); - // lqi.xyzw vf14, vi01 | nop - lq_buffer_xyzw(vu.vf14, vu.vi01++); - // mtir vi10, vf08.x | nop - vu.vi10 = vu.vf08.x_as_u16(); - // mtir vi13, vf08.y | itof0.xyzw vf24, vf24 - vu.vf24.itof0(Mask::xyzw, vu.vf24); vu.vi13 = vu.vf08.y_as_u16(); - // iaddi vi06, vi06, -0x1 | add.zw vf08, vf08, vf17 - vu.vf08.add(Mask::zw, vu.vf08, vu.vf17); vu.vi06 = vu.vi06 + -1; - // nop | add.xyzw vf11, vf11, vf18 - vu.vf11.add_xyzw(vu.vf11, vu.vf18); - // iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 - vu.vf14.add_xyzw(vu.vf14, vu.vf19); vu.vi10 = vu.vi10 & vu.vi05; - // nop | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); - // iand vi13, vi13, vi05 | nop - vu.vi13 = vu.vi13 & vu.vi05; - // lq.xyzw vf20, 0(vi10) | nop - lq_buffer_xyzw(vu.vf20, vu.vi10); - // lq.xyzw vf25, 0(vi13) | nop - lq_buffer_xyzw(vu.vf25, vu.vi13); - // lq.xyzw vf23, 1(vi10) | nop - lq_buffer_xyzw(vu.vf23, vu.vi10 + 1); - // lq.xyzw vf26, 1(vi13) | nop - lq_buffer_xyzw(vu.vf26, vu.vi13 + 1); - // lq.xyzw vf20, 2(vi10) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 2); - // lq.xyzw vf27, 2(vi13) | maddy.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi13 + 2); - // lq.xyzw vf23, 3(vi10) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi10 + 3); - // lq.xyzw vf28, 3(vi13) | maddy.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi13 + 3); - // lq.xyzw vf20, 4(vi10) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 4); - // lq.xyz vf29, 4(vi13) | maddy.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi13 + 4); - // lq.xyzw vf23, 5(vi10) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi10 + 5); - // lq.xyz vf30, 5(vi13) | maddy.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi13 + 5); - // lq.xyzw vf20, 6(vi10) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 6); - // lq.xyzw vf31, 6(vi13) | maddy.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi13 + 6); - // mtir vi10, vf11.x | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | maddy.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.y()); vu.vi13 = vu.vf11.y_as_u16(); - // nop | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); - // nop | maddy.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.y()); - // nop | mulaz.xyzw ACC, vf29, vf08 - vu.acc.mula_xyzw(vu.vf29, vu.vf08.z()); - // nop | maddaz.xyzw ACC, vf30, vf11 - vu.acc.madda_xyzw(vu.vf30, vu.vf11.z()); - // nop | maddz.xyz vf11, vf31, vf14 - vu.acc.madd_xyz(vu.vf11, vu.vf31, vu.vf14.z()); - // nop | nop - - // nop | nop - - // nop | mulaw.xyzw ACC, vf25, vf08 - vu.acc.mula_xyzw(vu.vf25, vu.vf08.w()); - // iaddiu vi08, vi00, 0x243 | nop - vu.vi08 = 0x243; /* 579 */ - - // erleng.xyz P, vf11 | nop - vu.P = erleng(vu.vf11); /* TODO erleng */ - // ior vi15, vi07, vi00 | maddaw.xyzw ACC, vf26, vf11 - vu.acc.madda_xyzw(vu.vf26, vu.vf11.w()); vu.vi15 = vu.vi07; - // mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 - vu.acc.madd_xyzw(vu.vf08, vu.vf27, vu.vf14.w()); vu.vf14.z() = 1.f; - // lqi.xyzw vf09, vi01 | nop - lq_buffer_xyzw(vu.vf09, vu.vi01++); - // ilwr.y vi03, vi12 | nop - ilw_buffer(Mask::y, vu.vi03, vu.vi12); - // ilw.z vi07, 1(vi12) | nop - ilw_buffer(Mask::z, vu.vi07, vu.vi12 + 1); - // lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 - vu.vf08.add_xyzw(vu.vf08, vu.vf28); lq_buffer_xyzw(vu.vf12, vu.vi01++); - // lqi.xyzw vf15, vi01 | nop - lq_buffer_xyzw(vu.vf15, vu.vi01++); - // mtir vi11, vf09.x | nop - vu.vi11 = vu.vf09.x_as_u16(); -// BRANCH! - // ibeq vi00, vi15, L26 | nop - bc = (vu.vi15 == 0); - // mtir vi14, vf09.y | nop - vu.vi14 = vu.vf09.y_as_u16(); - if (bc) { goto L26; } - - - // iaddiu vi08, vi00, 0x539 | miniw.w vf08, vf08, vf01 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf01.w()); vu.vi08 = 0x539; /* 1337 */ - - L26: - // div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 - vu.vf09.add(Mask::zw, vu.vf09, vu.vf17); vu.Q = vu.vf01.w() / vu.vf08.w(); - - // iadd vi03, vi03, vi12 | add.xyzw vf12, vf12, vf18 - vu.vf12.add_xyzw(vu.vf12, vu.vf18); vu.vi03 = vu.vi03 + vu.vi12; - // iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 - vu.vf15.add_xyzw(vu.vf15, vu.vf19); vu.vi11 = vu.vi11 & vu.vi05; - // iadd vi06, vi06, vi03 | nop - vu.vi06 = vu.vi06 + vu.vi03; - // iadd vi07, vi07, vi06 | nop - vu.vi07 = vu.vi07 + vu.vi06; - // iand vi14, vi14, vi05 | nop - vu.vi14 = vu.vi14 & vu.vi05; -// BRANCH! - // ibne vi05, vi11, L27 | nop - bc = (vu.vi05 != vu.vi11); - // nop | mul.xyz vf08, vf08, Q - vu.vf08.mul(Mask::xyz, vu.vf08, vu.Q); /* TODO mulq */ - if (bc) { goto L27; } - - - // mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | nop - vu.vi14 = vu.vf12.y_as_u16(); -// BRANCH! - // b L28 | nop - bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L28; } - - - L27: - // lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi11); - // lq.xyzw vf25, 0(vi14) | nop - lq_buffer_xyzw(vu.vf25, vu.vi14); - // lq.xyzw vf23, 1(vi11) | nop - lq_buffer_xyzw(vu.vf23, vu.vi11 + 1); - // lq.xyzw vf26, 1(vi14) | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf26, vu.vi14 + 1); - // lq.xyzw vf20, 2(vi11) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 2); - // lq.xyzw vf27, 2(vi14) | maddw.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.w()); lq_buffer_xyzw(vu.vf27, vu.vi14 + 2); - // lq.xyzw vf23, 3(vi11) | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi11 + 3); - // lq.xyzw vf28, 3(vi14) | maddw.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.w()); lq_buffer_xyzw(vu.vf28, vu.vi14 + 3); - // lq.xyzw vf20, 4(vi11) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 4); - // lq.xyz vf29, 4(vi14) | maddw.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.w()); lq_buffer_xyz(vu.vf29, vu.vi14 + 4); - // lq.xyzw vf23, 5(vi11) | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi11 + 5); - // lq.xyz vf30, 5(vi14) | maddw.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.w()); lq_buffer_xyz(vu.vf30, vu.vi14 + 5); - // lq.xyzw vf20, 6(vi11) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 6); - // lq.xyzw vf31, 6(vi14) | maddw.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.w()); lq_buffer_xyzw(vu.vf31, vu.vi14 + 6); - // lqi.xyzw vf23, vi02 | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi11, vf12.x | maddw.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.w()); vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); vu.vi14 = vu.vf12.y_as_u16(); - // iaddiu vi08, vi00, 0x1a1 | maddw.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.w()); vu.vi08 = 0x1a1; /* 417 */ - -// BRANCH! - // ibeq vi00, vi15, L28 | nop - bc = (vu.vi15 == 0); - // lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L28; } - - - // iaddiu vi08, vi00, 0x48e | nop - vu.vi08 = 0x48e; /* 1166 */ - - L28: - // nop | mulaz.xyzw ACC, vf29, vf09 - vu.acc.mula_xyzw(vu.vf29, vu.vf09.z()); - // nop | maddaz.xyzw ACC, vf30, vf12 - vu.acc.madda_xyzw(vu.vf30, vu.vf12.z()); - // mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 - vu.acc.madd_xyz(vu.vf12, vu.vf31, vu.vf15.z()); vu.vf20.mfp(Mask::w, vu.P); - // nop | nop - - // 1024.0 | miniw.w vf08, vf08, vf03 :i - vu.vf08.mini(Mask::w, vu.vf08, vu.vf03.w()); vu.I = 1024.0; -// BRANCH! - // ibne vi00, vi15, L93 | mulaw.xyzw ACC, vf25, vf09 - vu.acc.mula_xyzw(vu.vf25, vu.vf09.w()); bc = (vu.vi15 != 0); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 - vu.vf11.mul_xyzw(vu.vf11, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - if (bc) { goto L93; } - - - // erleng.xyz P, vf12 | nop - vu.P = erleng(vu.vf12); /* TODO erleng */ -// BRANCH! - // ibeq vi06, vi03, L65 | maddaw.xyzw ACC, vf26, vf12 - vu.acc.madda_xyzw(vu.vf26, vu.vf12.w()); bc = (vu.vi06 == vu.vi03); - // mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 - vu.acc.madd_xyzw(vu.vf09, vu.vf27, vu.vf15.w()); vu.vf15.z() = 1.f; - if (bc) { goto L65; } - - - // lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); lq_buffer_xyzw(vu.vf10, vu.vi01++); - // jr vi08 | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); - // nop | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); - switch (vu.vi08) { - case 0x1a1: - goto JUMP_1A1; - case 0x48e: - goto JUMP_48E; -case 0x243: -goto JUMP_243; -default: -ASSERT(false); -} - L29: - // lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); lq_buffer_xyzw(vu.vf10, vu.vi01++); - // sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); sq_buffer_xyzw(vu.vf13, vu.vi12 + 1); - // sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); sq_buffer_xyzw(vu.vf13, vu.vi15 + 1); - JUMP_1A1: - // lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 - vu.vf09.add_xyzw(vu.vf09, vu.vf28); lq_buffer_xyzw(vu.vf13, vu.vi01++); - // lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 - vu.vf08.max(Mask::w, vu.vf08, vu.vf02.w()); lq_buffer_xyzw(vu.vf16, vu.vi01++); - // mtir vi12, vf10.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi12 = vu.vf10.x_as_u16(); - // mtir vi15, vf10.y | maxx.xyzw vf11, vf11, vf00 - vu.vf11.max_xyzw(vu.vf11, vu.vf00.x()); vu.vi15 = vu.vf10.y_as_u16(); - // div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 - vu.vf10.add(Mask::zw, vu.vf10, vu.vf17); vu.Q = vu.vf01.w() / vu.vf09.w(); - - // move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 - vu.vf13.add_xyzw(vu.vf13, vu.vf18); vu.vf21.move_xyzw(vu.vf08); - // iand vi12, vi12, vi05 | add.xyzw vf16, vf16, vf19 - vu.vf16.add_xyzw(vu.vf16, vu.vf19); vu.vi12 = vu.vi12 & vu.vi05; - // nop | mulax.xyzw ACC, vf04, vf11 - vu.acc.mula_xyzw(vu.vf04, vu.vf11.x()); -// BRANCH! - // ibgtz vi09, L31 | madday.xyzw ACC, vf05, vf11 - vu.acc.madda_xyzw(vu.vf05, vu.vf11.y()); bc = ((s16)vu.vi09) > 0; - // iand vi15, vi15, vi05 | maddaz.xyzw ACC, vf06, vf11 - vu.acc.madda_xyzw(vu.vf06, vu.vf11.z()); vu.vi15 = vu.vi15 & vu.vi05; - if (bc) { goto L31; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L31: -// BRANCH! - // ibne vi05, vi12, L32 | maddw.xyzw vf11, vf07, vf00 - vu.acc.madd_xyzw(vu.vf11, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi12); - // ilw.x vi09, -9(vi01) | mul.xyz vf09, vf09, Q - vu.vf09.mul(Mask::xyz, vu.vf09, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L32; } - - - // mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ vu.vi12 = vu.vf13.x_as_u16(); - // mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi15 = vu.vf13.y_as_u16(); -// BRANCH! - // b L33 | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L33; } - - - L32: - // lq.xyzw vf20, 0(vi12) | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi12); - // nop | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); - // lq.xyzw vf25, 0(vi15) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf25, vu.vi15); - // lq.xyzw vf23, 1(vi12) | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi12 + 1); - // lq.xyzw vf26, 1(vi15) | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf26, vu.vi15 + 1); - // lq.xyzw vf20, 2(vi12) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 2); - // lq.xyzw vf27, 2(vi15) | maddy.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi15 + 2); - // lq.xyzw vf23, 3(vi12) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi12 + 3); - // lq.xyzw vf28, 3(vi15) | maddy.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi15 + 3); - // lq.xyzw vf20, 4(vi12) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 4); - // lq.xyz vf29, 4(vi15) | maddy.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi15 + 4); - // lq.xyzw vf23, 5(vi12) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi12 + 5); - // lq.xyz vf30, 5(vi15) | maddy.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi15 + 5); - // lq.xyzw vf20, 6(vi12) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 6); - // lq.xyzw vf31, 6(vi15) | maddy.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi15 + 6); - // mtir vi12, vf13.x | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); vu.vi12 = vu.vf13.x_as_u16(); - // mtir vi15, vf13.y | maddy.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.y()); vu.vi15 = vu.vf13.y_as_u16(); -// BRANCH! - // b L49 | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); bc = true; - // lqi.xyzw vf23, vi03 | maddy.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.y()); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L49; } - - - L33: -// BRANCH! - // ibgez vi09, L34 | mulaz.xyzw ACC, vf29, vf10 - vu.acc.mula_xyzw(vu.vf29, vu.vf10.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 - vu.acc.madda_xyzw(vu.vf30, vu.vf13.z()); sq_buffer_xyzw(vu.vf21, vu.vi10 + 2); - if (bc) { goto L34; } - - - // nop | ftoi4.xyzw vf21, vf08 - vu.vf21.ftoi4(Mask::xyzw, vu.vf08); - L34: - // mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 - vu.acc.madd_xyz(vu.vf13, vu.vf31, vu.vf16.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 - vu.vf11.mini_xyzw(vu.vf11, vu.vf17.y()); sq_buffer_xyzw(vu.vf14, vu.vi10); - // sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 - vu.vf09.mini(Mask::w, vu.vf09, vu.vf03.w()); sq_buffer_xyzw(vu.vf14, vu.vi13); - // sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 - vu.acc.mula_xyzw(vu.vf25, vu.vf10.w()); sq_buffer_xyzw(vu.vf21, vu.vi13 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf12, vf12, vf20 - vu.vf12.mul_xyzw(vu.vf12, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // erleng.xyz P, vf13 | ftoi0.xyzw vf11, vf11 - vu.vf11.ftoi0(Mask::xyzw, vu.vf11); vu.P = erleng(vu.vf13); /* TODO erleng */ -// BRANCH! - // ibne vi06, vi03, L35 | maddaw.xyzw ACC, vf26, vf13 - vu.acc.madda_xyzw(vu.vf26, vu.vf13.w()); bc = (vu.vi06 != vu.vi03); - // mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 - vu.acc.madd_xyzw(vu.vf10, vu.vf27, vu.vf16.w()); vu.vf16.z() = 1.f; - if (bc) { goto L35; } - - -// BRANCH! - // ibne vi07, vi03, L72 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L72; } - - -// BRANCH! - // b L143 | nop - bc = true; - // nop | nop - - if (bc) { goto L143; } - - - L35: - // lqi.xyzw vf08, vi01 | mulax.xyzw ACC, vf01, vf12 - vu.acc.mula_xyzw(vu.vf01, vu.vf12.x()); lq_buffer_xyzw(vu.vf08, vu.vi01++); - // sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 - vu.acc.madda_xyzw(vu.vf02, vu.vf12.y()); sq_buffer_xyzw(vu.vf11, vu.vi10 + 1); - // sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 - vu.acc.madd_xyzw(vu.vf12, vu.vf03, vu.vf12.z()); sq_buffer_xyzw(vu.vf11, vu.vi13 + 1); - // lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 - vu.vf10.add_xyzw(vu.vf10, vu.vf28); lq_buffer_xyzw(vu.vf11, vu.vi01++); - // lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 - vu.vf09.max(Mask::w, vu.vf09, vu.vf02.w()); lq_buffer_xyzw(vu.vf14, vu.vi01++); - // mtir vi10, vf08.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi10 = vu.vf08.x_as_u16(); - // mtir vi13, vf08.y | maxx.xyzw vf12, vf12, vf00 - vu.vf12.max_xyzw(vu.vf12, vu.vf00.x()); vu.vi13 = vu.vf08.y_as_u16(); - // div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 - vu.vf08.add(Mask::zw, vu.vf08, vu.vf17); vu.Q = vu.vf01.w() / vu.vf10.w(); - - // move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 - vu.vf11.add_xyzw(vu.vf11, vu.vf18); vu.vf21.move_xyzw(vu.vf09); - // iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 - vu.vf14.add_xyzw(vu.vf14, vu.vf19); vu.vi10 = vu.vi10 & vu.vi05; - // nop | mulax.xyzw ACC, vf04, vf12 - vu.acc.mula_xyzw(vu.vf04, vu.vf12.x()); -// BRANCH! - // ibgtz vi09, L36 | madday.xyzw ACC, vf05, vf12 - vu.acc.madda_xyzw(vu.vf05, vu.vf12.y()); bc = ((s16)vu.vi09) > 0; - // iand vi13, vi13, vi05 | maddaz.xyzw ACC, vf06, vf12 - vu.acc.madda_xyzw(vu.vf06, vu.vf12.z()); vu.vi13 = vu.vi13 & vu.vi05; - if (bc) { goto L36; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L36: -// BRANCH! - // ibne vi05, vi10, L37 | maddw.xyzw vf12, vf07, vf00 - vu.acc.madd_xyzw(vu.vf12, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi10); - // ilw.x vi09, -9(vi01) | mul.xyz vf10, vf10, Q - vu.vf10.mul(Mask::xyz, vu.vf10, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L37; } - - - // mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi13 = vu.vf11.y_as_u16(); -// BRANCH! - // b L38 | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L38; } - - - L37: - // lq.xyzw vf20, 0(vi10) | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi10); - // nop | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); - // lq.xyzw vf25, 0(vi13) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf25, vu.vi13); - // lq.xyzw vf23, 1(vi10) | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi10 + 1); - // lq.xyzw vf26, 1(vi13) | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf26, vu.vi13 + 1); - // lq.xyzw vf20, 2(vi10) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 2); - // lq.xyzw vf27, 2(vi13) | maddy.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi13 + 2); - // lq.xyzw vf23, 3(vi10) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi10 + 3); - // lq.xyzw vf28, 3(vi13) | maddy.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi13 + 3); - // lq.xyzw vf20, 4(vi10) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 4); - // lq.xyz vf29, 4(vi13) | maddy.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi13 + 4); - // lq.xyzw vf23, 5(vi10) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi10 + 5); - // lq.xyz vf30, 5(vi13) | maddy.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi13 + 5); - // lq.xyzw vf20, 6(vi10) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 6); - // lq.xyzw vf31, 6(vi13) | maddy.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi13 + 6); - // mtir vi10, vf11.x | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | maddy.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.y()); vu.vi13 = vu.vf11.y_as_u16(); -// BRANCH! - // b L54 | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); bc = true; - // lqi.xyzw vf23, vi03 | maddy.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.y()); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L54; } - - - L38: -// BRANCH! - // ibgez vi09, L39 | mulaz.xyzw ACC, vf29, vf08 - vu.acc.mula_xyzw(vu.vf29, vu.vf08.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 - vu.acc.madda_xyzw(vu.vf30, vu.vf11.z()); sq_buffer_xyzw(vu.vf21, vu.vi11 + 2); - if (bc) { goto L39; } - - - // nop | ftoi4.xyzw vf21, vf09 - vu.vf21.ftoi4(Mask::xyzw, vu.vf09); - L39: - // mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 - vu.acc.madd_xyz(vu.vf11, vu.vf31, vu.vf14.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 - vu.vf12.mini_xyzw(vu.vf12, vu.vf17.y()); sq_buffer_xyzw(vu.vf15, vu.vi11); - // sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 - vu.vf10.mini(Mask::w, vu.vf10, vu.vf03.w()); sq_buffer_xyzw(vu.vf15, vu.vi14); - // sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 - vu.acc.mula_xyzw(vu.vf25, vu.vf08.w()); sq_buffer_xyzw(vu.vf21, vu.vi14 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf13, vf13, vf20 - vu.vf13.mul_xyzw(vu.vf13, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // erleng.xyz P, vf11 | ftoi0.xyzw vf12, vf12 - vu.vf12.ftoi0(Mask::xyzw, vu.vf12); vu.P = erleng(vu.vf11); /* TODO erleng */ -// BRANCH! - // ibne vi06, vi03, L40 | maddaw.xyzw ACC, vf26, vf11 - vu.acc.madda_xyzw(vu.vf26, vu.vf11.w()); bc = (vu.vi06 != vu.vi03); - // mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 - vu.acc.madd_xyzw(vu.vf08, vu.vf27, vu.vf14.w()); vu.vf14.z() = 1.f; - if (bc) { goto L40; } - - -// BRANCH! - // ibne vi07, vi03, L77 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L77; } - - -// BRANCH! - // b L153 | nop - bc = true; - // nop | nop - - if (bc) { goto L153; } - - - L40: - // lqi.xyzw vf09, vi01 | mulax.xyzw ACC, vf01, vf13 - vu.acc.mula_xyzw(vu.vf01, vu.vf13.x()); lq_buffer_xyzw(vu.vf09, vu.vi01++); - // sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 - vu.acc.madda_xyzw(vu.vf02, vu.vf13.y()); sq_buffer_xyzw(vu.vf12, vu.vi11 + 1); - // sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 - vu.acc.madd_xyzw(vu.vf13, vu.vf03, vu.vf13.z()); sq_buffer_xyzw(vu.vf12, vu.vi14 + 1); - // lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 - vu.vf08.add_xyzw(vu.vf08, vu.vf28); lq_buffer_xyzw(vu.vf12, vu.vi01++); - // lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 - vu.vf10.max(Mask::w, vu.vf10, vu.vf02.w()); lq_buffer_xyzw(vu.vf15, vu.vi01++); - // mtir vi11, vf09.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi11 = vu.vf09.x_as_u16(); - // mtir vi14, vf09.y | maxx.xyzw vf13, vf13, vf00 - vu.vf13.max_xyzw(vu.vf13, vu.vf00.x()); vu.vi14 = vu.vf09.y_as_u16(); - // div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 - vu.vf09.add(Mask::zw, vu.vf09, vu.vf17); vu.Q = vu.vf01.w() / vu.vf08.w(); - - // move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 - vu.vf12.add_xyzw(vu.vf12, vu.vf18); vu.vf21.move_xyzw(vu.vf10); - // iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 - vu.vf15.add_xyzw(vu.vf15, vu.vf19); vu.vi11 = vu.vi11 & vu.vi05; - // nop | mulax.xyzw ACC, vf04, vf13 - vu.acc.mula_xyzw(vu.vf04, vu.vf13.x()); -// BRANCH! - // ibgtz vi09, L41 | madday.xyzw ACC, vf05, vf13 - vu.acc.madda_xyzw(vu.vf05, vu.vf13.y()); bc = ((s16)vu.vi09) > 0; - // iand vi14, vi14, vi05 | maddaz.xyzw ACC, vf06, vf13 - vu.acc.madda_xyzw(vu.vf06, vu.vf13.z()); vu.vi14 = vu.vi14 & vu.vi05; - if (bc) { goto L41; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L41: -// BRANCH! - // ibne vi05, vi11, L42 | maddw.xyzw vf13, vf07, vf00 - vu.acc.madd_xyzw(vu.vf13, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi11); - // ilw.x vi09, -9(vi01) | mul.xyz vf08, vf08, Q - vu.vf08.mul(Mask::xyz, vu.vf08, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L42; } - - - // mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi14 = vu.vf12.y_as_u16(); -// BRANCH! - // b L43 | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L43; } - - - L42: - // lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi11); - // nop | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); - // lq.xyzw vf25, 0(vi14) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf25, vu.vi14); - // lq.xyzw vf23, 1(vi11) | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi11 + 1); - // lq.xyzw vf26, 1(vi14) | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf26, vu.vi14 + 1); - // lq.xyzw vf20, 2(vi11) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 2); - // lq.xyzw vf27, 2(vi14) | maddy.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi14 + 2); - // lq.xyzw vf23, 3(vi11) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi11 + 3); - // lq.xyzw vf28, 3(vi14) | maddy.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi14 + 3); - // lq.xyzw vf20, 4(vi11) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 4); - // lq.xyz vf29, 4(vi14) | maddy.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi14 + 4); - // lq.xyzw vf23, 5(vi11) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi11 + 5); - // lq.xyz vf30, 5(vi14) | maddy.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi14 + 5); - // lq.xyzw vf20, 6(vi11) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 6); - // lq.xyzw vf31, 6(vi14) | maddy.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi14 + 6); - // mtir vi11, vf12.x | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | maddy.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.y()); vu.vi14 = vu.vf12.y_as_u16(); -// BRANCH! - // b L59 | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); bc = true; - // lqi.xyzw vf23, vi03 | maddy.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.y()); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L59; } - - - L43: -// BRANCH! - // ibgez vi09, L44 | mulaz.xyzw ACC, vf29, vf09 - vu.acc.mula_xyzw(vu.vf29, vu.vf09.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 - vu.acc.madda_xyzw(vu.vf30, vu.vf12.z()); sq_buffer_xyzw(vu.vf21, vu.vi12 + 2); - if (bc) { goto L44; } - - - // nop | ftoi4.xyzw vf21, vf10 - vu.vf21.ftoi4(Mask::xyzw, vu.vf10); - L44: - // mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 - vu.acc.madd_xyz(vu.vf12, vu.vf31, vu.vf15.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 - vu.vf13.mini_xyzw(vu.vf13, vu.vf17.y()); sq_buffer_xyzw(vu.vf16, vu.vi12); - // sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf03.w()); sq_buffer_xyzw(vu.vf16, vu.vi15); - // sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 - vu.acc.mula_xyzw(vu.vf25, vu.vf09.w()); sq_buffer_xyzw(vu.vf21, vu.vi15 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 - vu.vf11.mul_xyzw(vu.vf11, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // erleng.xyz P, vf12 | ftoi0.xyzw vf13, vf13 - vu.vf13.ftoi0(Mask::xyzw, vu.vf13); vu.P = erleng(vu.vf12); /* TODO erleng */ -// BRANCH! - // ibne vi06, vi03, L29 | maddaw.xyzw ACC, vf26, vf12 - vu.acc.madda_xyzw(vu.vf26, vu.vf12.w()); bc = (vu.vi06 != vu.vi03); - // mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 - vu.acc.madd_xyzw(vu.vf09, vu.vf27, vu.vf15.w()); vu.vf15.z() = 1.f; - if (bc) { goto L29; } - - -// BRANCH! - // ibne vi07, vi03, L66 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L66; } - - -// BRANCH! - // b L163 | nop - bc = true; - // nop | nop - - if (bc) { goto L163; } - - - L45: - // lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); lq_buffer_xyzw(vu.vf10, vu.vi01++); - // sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); sq_buffer_xyzw(vu.vf13, vu.vi12 + 1); - // sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); sq_buffer_xyzw(vu.vf13, vu.vi15 + 1); - JUMP_243: - // lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 - vu.vf09.add_xyzw(vu.vf09, vu.vf28); lq_buffer_xyzw(vu.vf13, vu.vi01++); - // lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 - vu.vf08.max(Mask::w, vu.vf08, vu.vf02.w()); lq_buffer_xyzw(vu.vf16, vu.vi01++); - // mtir vi12, vf10.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi12 = vu.vf10.x_as_u16(); - // mtir vi15, vf10.y | maxx.xyzw vf11, vf11, vf00 - vu.vf11.max_xyzw(vu.vf11, vu.vf00.x()); vu.vi15 = vu.vf10.y_as_u16(); - // div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 - vu.vf10.add(Mask::zw, vu.vf10, vu.vf17); vu.Q = vu.vf01.w() / vu.vf09.w(); - - // move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 - vu.vf13.add_xyzw(vu.vf13, vu.vf18); vu.vf21.move_xyzw(vu.vf08); - // iand vi12, vi12, vi05 | add.xyzw vf16, vf16, vf19 - vu.vf16.add_xyzw(vu.vf16, vu.vf19); vu.vi12 = vu.vi12 & vu.vi05; - // nop | mulax.xyzw ACC, vf04, vf11 - vu.acc.mula_xyzw(vu.vf04, vu.vf11.x()); -// BRANCH! - // ibgtz vi09, L47 | madday.xyzw ACC, vf05, vf11 - vu.acc.madda_xyzw(vu.vf05, vu.vf11.y()); bc = ((s16)vu.vi09) > 0; - // iand vi15, vi15, vi05 | maddaz.xyzw ACC, vf06, vf11 - vu.acc.madda_xyzw(vu.vf06, vu.vf11.z()); vu.vi15 = vu.vi15 & vu.vi05; - if (bc) { goto L47; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L47: -// BRANCH! - // ibne vi05, vi12, L48 | maddw.xyzw vf11, vf07, vf00 - vu.acc.madd_xyzw(vu.vf11, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi12); - // ilw.x vi09, -9(vi01) | mul.xyz vf09, vf09, Q - vu.vf09.mul(Mask::xyz, vu.vf09, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L48; } - - - // mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ vu.vi12 = vu.vf13.x_as_u16(); - // mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi15 = vu.vf13.y_as_u16(); -// BRANCH! - // b L49 | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L49; } - - - L48: - // lq.xyzw vf20, 0(vi12) | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi12); - // lq.xyzw vf25, 0(vi15) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf25, vu.vi15); - // lq.xyzw vf23, 1(vi12) | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi12 + 1); - // lq.xyzw vf26, 1(vi15) | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf26, vu.vi15 + 1); - // lq.xyzw vf20, 2(vi12) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 2); - // lq.xyzw vf27, 2(vi15) | maddw.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.w()); lq_buffer_xyzw(vu.vf27, vu.vi15 + 2); - // lq.xyzw vf23, 3(vi12) | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi12 + 3); - // lq.xyzw vf28, 3(vi15) | maddw.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.w()); lq_buffer_xyzw(vu.vf28, vu.vi15 + 3); - // lq.xyzw vf20, 4(vi12) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 4); - // lq.xyz vf29, 4(vi15) | maddw.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.w()); lq_buffer_xyz(vu.vf29, vu.vi15 + 4); - // lq.xyzw vf23, 5(vi12) | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi12 + 5); - // lq.xyz vf30, 5(vi15) | maddw.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.w()); lq_buffer_xyz(vu.vf30, vu.vi15 + 5); - // lq.xyzw vf20, 6(vi12) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 6); - // lq.xyzw vf31, 6(vi15) | maddw.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.w()); lq_buffer_xyzw(vu.vf31, vu.vi15 + 6); - // lqi.xyzw vf23, vi02 | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi12, vf13.x | maddw.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.w()); vu.vi12 = vu.vf13.x_as_u16(); - // mtir vi15, vf13.y | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); vu.vi15 = vu.vf13.y_as_u16(); -// BRANCH! - // b L33 | maddw.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.w()); bc = true; - // lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L33; } - - - L49: -// BRANCH! - // ibgez vi09, L50 | mulaz.xyzw ACC, vf29, vf10 - vu.acc.mula_xyzw(vu.vf29, vu.vf10.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 - vu.acc.madda_xyzw(vu.vf30, vu.vf13.z()); sq_buffer_xyzw(vu.vf21, vu.vi10 + 2); - if (bc) { goto L50; } - - - // nop | ftoi4.xyzw vf21, vf08 - vu.vf21.ftoi4(Mask::xyzw, vu.vf08); - L50: - // mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 - vu.acc.madd_xyz(vu.vf13, vu.vf31, vu.vf16.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 - vu.vf11.mini_xyzw(vu.vf11, vu.vf17.y()); sq_buffer_xyzw(vu.vf14, vu.vi10); - // sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 - vu.vf09.mini(Mask::w, vu.vf09, vu.vf03.w()); sq_buffer_xyzw(vu.vf14, vu.vi13); - // sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 - vu.acc.mula_xyzw(vu.vf25, vu.vf10.w()); sq_buffer_xyzw(vu.vf21, vu.vi13 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf12, vf12, vf20 - vu.vf12.mul_xyzw(vu.vf12, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // erleng.xyz P, vf13 | ftoi0.xyzw vf11, vf11 - vu.vf11.ftoi0(Mask::xyzw, vu.vf11); vu.P = erleng(vu.vf13); /* TODO erleng */ -// BRANCH! - // ibne vi06, vi03, L51 | maddaw.xyzw ACC, vf26, vf13 - vu.acc.madda_xyzw(vu.vf26, vu.vf13.w()); bc = (vu.vi06 != vu.vi03); - // mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 - vu.acc.madd_xyzw(vu.vf10, vu.vf27, vu.vf16.w()); vu.vf16.z() = 1.f; - if (bc) { goto L51; } - - -// BRANCH! - // ibne vi07, vi03, L72 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L72; } - - -// BRANCH! - // b L143 | nop - bc = true; - // nop | nop - - if (bc) { goto L143; } - - - L51: - // lqi.xyzw vf08, vi01 | mulax.xyzw ACC, vf01, vf12 - vu.acc.mula_xyzw(vu.vf01, vu.vf12.x()); lq_buffer_xyzw(vu.vf08, vu.vi01++); - // sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 - vu.acc.madda_xyzw(vu.vf02, vu.vf12.y()); sq_buffer_xyzw(vu.vf11, vu.vi10 + 1); - // sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 - vu.acc.madd_xyzw(vu.vf12, vu.vf03, vu.vf12.z()); sq_buffer_xyzw(vu.vf11, vu.vi13 + 1); - // lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 - vu.vf10.add_xyzw(vu.vf10, vu.vf28); lq_buffer_xyzw(vu.vf11, vu.vi01++); - // lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 - vu.vf09.max(Mask::w, vu.vf09, vu.vf02.w()); lq_buffer_xyzw(vu.vf14, vu.vi01++); - // mtir vi10, vf08.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi10 = vu.vf08.x_as_u16(); - // mtir vi13, vf08.y | maxx.xyzw vf12, vf12, vf00 - vu.vf12.max_xyzw(vu.vf12, vu.vf00.x()); vu.vi13 = vu.vf08.y_as_u16(); - // div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 - vu.vf08.add(Mask::zw, vu.vf08, vu.vf17); vu.Q = vu.vf01.w() / vu.vf10.w(); - - // move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 - vu.vf11.add_xyzw(vu.vf11, vu.vf18); vu.vf21.move_xyzw(vu.vf09); - // iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 - vu.vf14.add_xyzw(vu.vf14, vu.vf19); vu.vi10 = vu.vi10 & vu.vi05; - // nop | mulax.xyzw ACC, vf04, vf12 - vu.acc.mula_xyzw(vu.vf04, vu.vf12.x()); -// BRANCH! - // ibgtz vi09, L52 | madday.xyzw ACC, vf05, vf12 - vu.acc.madda_xyzw(vu.vf05, vu.vf12.y()); bc = ((s16)vu.vi09) > 0; - // iand vi13, vi13, vi05 | maddaz.xyzw ACC, vf06, vf12 - vu.acc.madda_xyzw(vu.vf06, vu.vf12.z()); vu.vi13 = vu.vi13 & vu.vi05; - if (bc) { goto L52; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L52: -// BRANCH! - // ibne vi05, vi10, L53 | maddw.xyzw vf12, vf07, vf00 - vu.acc.madd_xyzw(vu.vf12, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi10); - // ilw.x vi09, -9(vi01) | mul.xyz vf10, vf10, Q - vu.vf10.mul(Mask::xyz, vu.vf10, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L53; } - - - // mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi13 = vu.vf11.y_as_u16(); -// BRANCH! - // b L54 | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L54; } - - - L53: - // lq.xyzw vf20, 0(vi10) | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi10); - // lq.xyzw vf25, 0(vi13) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf25, vu.vi13); - // lq.xyzw vf23, 1(vi10) | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi10 + 1); - // lq.xyzw vf26, 1(vi13) | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf26, vu.vi13 + 1); - // lq.xyzw vf20, 2(vi10) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 2); - // lq.xyzw vf27, 2(vi13) | maddw.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.w()); lq_buffer_xyzw(vu.vf27, vu.vi13 + 2); - // lq.xyzw vf23, 3(vi10) | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi10 + 3); - // lq.xyzw vf28, 3(vi13) | maddw.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.w()); lq_buffer_xyzw(vu.vf28, vu.vi13 + 3); - // lq.xyzw vf20, 4(vi10) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 4); - // lq.xyz vf29, 4(vi13) | maddw.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.w()); lq_buffer_xyz(vu.vf29, vu.vi13 + 4); - // lq.xyzw vf23, 5(vi10) | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi10 + 5); - // lq.xyz vf30, 5(vi13) | maddw.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.w()); lq_buffer_xyz(vu.vf30, vu.vi13 + 5); - // lq.xyzw vf20, 6(vi10) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 6); - // lq.xyzw vf31, 6(vi13) | maddw.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.w()); lq_buffer_xyzw(vu.vf31, vu.vi13 + 6); - // lqi.xyzw vf23, vi02 | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi10, vf11.x | maddw.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.w()); vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); vu.vi13 = vu.vf11.y_as_u16(); -// BRANCH! - // b L38 | maddw.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.w()); bc = true; - // lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L38; } - - - L54: -// BRANCH! - // ibgez vi09, L55 | mulaz.xyzw ACC, vf29, vf08 - vu.acc.mula_xyzw(vu.vf29, vu.vf08.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 - vu.acc.madda_xyzw(vu.vf30, vu.vf11.z()); sq_buffer_xyzw(vu.vf21, vu.vi11 + 2); - if (bc) { goto L55; } - - - // nop | ftoi4.xyzw vf21, vf09 - vu.vf21.ftoi4(Mask::xyzw, vu.vf09); - L55: - // mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 - vu.acc.madd_xyz(vu.vf11, vu.vf31, vu.vf14.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 - vu.vf12.mini_xyzw(vu.vf12, vu.vf17.y()); sq_buffer_xyzw(vu.vf15, vu.vi11); - // sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 - vu.vf10.mini(Mask::w, vu.vf10, vu.vf03.w()); sq_buffer_xyzw(vu.vf15, vu.vi14); - // sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 - vu.acc.mula_xyzw(vu.vf25, vu.vf08.w()); sq_buffer_xyzw(vu.vf21, vu.vi14 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf13, vf13, vf20 - vu.vf13.mul_xyzw(vu.vf13, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // erleng.xyz P, vf11 | ftoi0.xyzw vf12, vf12 - vu.vf12.ftoi0(Mask::xyzw, vu.vf12); vu.P = erleng(vu.vf11); /* TODO erleng */ -// BRANCH! - // ibne vi06, vi03, L56 | maddaw.xyzw ACC, vf26, vf11 - vu.acc.madda_xyzw(vu.vf26, vu.vf11.w()); bc = (vu.vi06 != vu.vi03); - // mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 - vu.acc.madd_xyzw(vu.vf08, vu.vf27, vu.vf14.w()); vu.vf14.z() = 1.f; - if (bc) { goto L56; } - - -// BRANCH! - // ibne vi07, vi03, L77 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L77; } - - -// BRANCH! - // b L153 | nop - bc = true; - // nop | nop - - if (bc) { goto L153; } - - - L56: - // lqi.xyzw vf09, vi01 | mulax.xyzw ACC, vf01, vf13 - vu.acc.mula_xyzw(vu.vf01, vu.vf13.x()); lq_buffer_xyzw(vu.vf09, vu.vi01++); - // sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 - vu.acc.madda_xyzw(vu.vf02, vu.vf13.y()); sq_buffer_xyzw(vu.vf12, vu.vi11 + 1); - // sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 - vu.acc.madd_xyzw(vu.vf13, vu.vf03, vu.vf13.z()); sq_buffer_xyzw(vu.vf12, vu.vi14 + 1); - // lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 - vu.vf08.add_xyzw(vu.vf08, vu.vf28); lq_buffer_xyzw(vu.vf12, vu.vi01++); - // lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 - vu.vf10.max(Mask::w, vu.vf10, vu.vf02.w()); lq_buffer_xyzw(vu.vf15, vu.vi01++); - // mtir vi11, vf09.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi11 = vu.vf09.x_as_u16(); - // mtir vi14, vf09.y | maxx.xyzw vf13, vf13, vf00 - vu.vf13.max_xyzw(vu.vf13, vu.vf00.x()); vu.vi14 = vu.vf09.y_as_u16(); - // div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 - vu.vf09.add(Mask::zw, vu.vf09, vu.vf17); vu.Q = vu.vf01.w() / vu.vf08.w(); - - // move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 - vu.vf12.add_xyzw(vu.vf12, vu.vf18); vu.vf21.move_xyzw(vu.vf10); - // iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 - vu.vf15.add_xyzw(vu.vf15, vu.vf19); vu.vi11 = vu.vi11 & vu.vi05; - // nop | mulax.xyzw ACC, vf04, vf13 - vu.acc.mula_xyzw(vu.vf04, vu.vf13.x()); -// BRANCH! - // ibgtz vi09, L57 | madday.xyzw ACC, vf05, vf13 - vu.acc.madda_xyzw(vu.vf05, vu.vf13.y()); bc = ((s16)vu.vi09) > 0; - // iand vi14, vi14, vi05 | maddaz.xyzw ACC, vf06, vf13 - vu.acc.madda_xyzw(vu.vf06, vu.vf13.z()); vu.vi14 = vu.vi14 & vu.vi05; - if (bc) { goto L57; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L57: -// BRANCH! - // ibne vi05, vi11, L58 | maddw.xyzw vf13, vf07, vf00 - vu.acc.madd_xyzw(vu.vf13, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi11); - // ilw.x vi09, -9(vi01) | mul.xyz vf08, vf08, Q - vu.vf08.mul(Mask::xyz, vu.vf08, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L58; } - - - // mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi14 = vu.vf12.y_as_u16(); -// BRANCH! - // b L59 | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L59; } - - - L58: - // lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi11); - // lq.xyzw vf25, 0(vi14) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf25, vu.vi14); - // lq.xyzw vf23, 1(vi11) | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi11 + 1); - // lq.xyzw vf26, 1(vi14) | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf26, vu.vi14 + 1); - // lq.xyzw vf20, 2(vi11) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 2); - // lq.xyzw vf27, 2(vi14) | maddw.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.w()); lq_buffer_xyzw(vu.vf27, vu.vi14 + 2); - // lq.xyzw vf23, 3(vi11) | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi11 + 3); - // lq.xyzw vf28, 3(vi14) | maddw.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.w()); lq_buffer_xyzw(vu.vf28, vu.vi14 + 3); - // lq.xyzw vf20, 4(vi11) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 4); - // lq.xyz vf29, 4(vi14) | maddw.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.w()); lq_buffer_xyz(vu.vf29, vu.vi14 + 4); - // lq.xyzw vf23, 5(vi11) | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi11 + 5); - // lq.xyz vf30, 5(vi14) | maddw.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.w()); lq_buffer_xyz(vu.vf30, vu.vi14 + 5); - // lq.xyzw vf20, 6(vi11) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 6); - // lq.xyzw vf31, 6(vi14) | maddw.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.w()); lq_buffer_xyzw(vu.vf31, vu.vi14 + 6); - // lqi.xyzw vf23, vi02 | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi11, vf12.x | maddw.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.w()); vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); vu.vi14 = vu.vf12.y_as_u16(); -// BRANCH! - // b L43 | maddw.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.w()); bc = true; - // lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L43; } - - - L59: -// BRANCH! - // ibgez vi09, L60 | mulaz.xyzw ACC, vf29, vf09 - vu.acc.mula_xyzw(vu.vf29, vu.vf09.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 - vu.acc.madda_xyzw(vu.vf30, vu.vf12.z()); sq_buffer_xyzw(vu.vf21, vu.vi12 + 2); - if (bc) { goto L60; } - - - // nop | ftoi4.xyzw vf21, vf10 - vu.vf21.ftoi4(Mask::xyzw, vu.vf10); - L60: - // mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 - vu.acc.madd_xyz(vu.vf12, vu.vf31, vu.vf15.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 - vu.vf13.mini_xyzw(vu.vf13, vu.vf17.y()); sq_buffer_xyzw(vu.vf16, vu.vi12); - // sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf03.w()); sq_buffer_xyzw(vu.vf16, vu.vi15); - // sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 - vu.acc.mula_xyzw(vu.vf25, vu.vf09.w()); sq_buffer_xyzw(vu.vf21, vu.vi15 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 - vu.vf11.mul_xyzw(vu.vf11, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // erleng.xyz P, vf12 | ftoi0.xyzw vf13, vf13 - vu.vf13.ftoi0(Mask::xyzw, vu.vf13); vu.P = erleng(vu.vf12); /* TODO erleng */ -// BRANCH! - // ibne vi06, vi03, L45 | maddaw.xyzw ACC, vf26, vf12 - vu.acc.madda_xyzw(vu.vf26, vu.vf12.w()); bc = (vu.vi06 != vu.vi03); - // mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 - vu.acc.madd_xyzw(vu.vf09, vu.vf27, vu.vf15.w()); vu.vf15.z() = 1.f; - if (bc) { goto L45; } - - -// BRANCH! - // ibne vi07, vi03, L72 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L72; } - - -// BRANCH! - // b L163 | nop - bc = true; - // nop | nop - - if (bc) { goto L163; } - - - L61: - // lqi.xyzw vf08, vi01 | nop - lq_buffer_xyzw(vu.vf08, vu.vi01++); - // lqi.xyzw vf24, vi02 | nop - lq_buffer_xyzw(vu.vf24, vu.vi02++); - // lqi.xyzw vf11, vi01 | nop - lq_buffer_xyzw(vu.vf11, vu.vi01++); - // lqi.xyzw vf14, vi01 | nop - lq_buffer_xyzw(vu.vf14, vu.vi01++); - // mtir vi10, vf08.x | nop - vu.vi10 = vu.vf08.x_as_u16(); - // mtir vi13, vf08.y | itof0.xyzw vf24, vf24 - vu.vf24.itof0(Mask::xyzw, vu.vf24); vu.vi13 = vu.vf08.y_as_u16(); - // nop | add.zw vf08, vf08, vf17 - vu.vf08.add(Mask::zw, vu.vf08, vu.vf17); - // nop | add.xyzw vf11, vf11, vf18 - vu.vf11.add_xyzw(vu.vf11, vu.vf18); - // iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 - vu.vf14.add_xyzw(vu.vf14, vu.vf19); vu.vi10 = vu.vi10 & vu.vi05; - // ilw.w vi08, -1(vi02) | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); ilw_buffer(Mask::w, vu.vi08, vu.vi02 + -1); - // iand vi13, vi13, vi05 | nop - vu.vi13 = vu.vi13 & vu.vi05; - // lq.xyzw vf20, 0(vi10) | nop - lq_buffer_xyzw(vu.vf20, vu.vi10); - // lq.xyzw vf31, 0(vi13) | nop - lq_buffer_xyzw(vu.vf31, vu.vi13); - // lq.xyzw vf25, 0(vi08) | nop - lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf23, 1(vi10) | nop - lq_buffer_xyzw(vu.vf23, vu.vi10 + 1); - // lq.xyzw vf20, 1(vi13) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi13 + 1); - // lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // lq.xyzw vf31, 2(vi10) | maddz.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi10 + 2); - // lq.xyzw vf23, 2(vi13) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi13 + 2); - // lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lq.xyzw vf20, 3(vi10) | maddz.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 3); - // lq.xyzw vf31, 3(vi13) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf31, vu.vi13 + 3); - // lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // lq.xyzw vf23, 4(vi10) | maddz.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi10 + 4); - // lq.xyzw vf20, 4(vi13) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi13 + 4); - // lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyzw vf31, 5(vi10) | maddz.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi10 + 5); - // lq.xyzw vf23, 5(vi13) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi13 + 5); - // lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); - // lq.xyzw vf20, 6(vi10) | maddz.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 6); - // lq.xyzw vf22, 6(vi13) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf22, vu.vi13 + 6); - // lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - // lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi10, vf11.x | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | madday.xyzw ACC, vf22, vf24 - vu.acc.madda_xyzw(vu.vf22, vu.vf24.y()); vu.vi13 = vu.vf11.y_as_u16(); - // lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.z()); lq_buffer_xyzw(vu.vf22, 2); - // nop | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); - // nop | mulaz.xyzw ACC, vf29, vf08 - vu.acc.mula_xyzw(vu.vf29, vu.vf08.z()); - // nop | maddaz.xyzw ACC, vf30, vf11 - vu.acc.madda_xyzw(vu.vf30, vu.vf11.z()); - // nop | maddz.xyz vf11, vf31, vf14 - vu.acc.madd_xyz(vu.vf11, vu.vf31, vu.vf14.z()); - // nop | nop - - // nop | nop - - // nop | mulaw.xyzw ACC, vf25, vf08 - vu.acc.mula_xyzw(vu.vf25, vu.vf08.w()); - // nop | nop - - // erleng.xyz P, vf11 | nop - vu.P = erleng(vu.vf11); /* TODO erleng */ - // ior vi15, vi07, vi00 | maddaw.xyzw ACC, vf26, vf11 - vu.acc.madda_xyzw(vu.vf26, vu.vf11.w()); vu.vi15 = vu.vi07; - // mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 - vu.acc.madd_xyzw(vu.vf08, vu.vf27, vu.vf14.w()); vu.vf14.z() = 1.f; - // lqi.xyzw vf09, vi01 | nop - lq_buffer_xyzw(vu.vf09, vu.vi01++); - // ilwr.y vi03, vi12 | nop - ilw_buffer(Mask::y, vu.vi03, vu.vi12); - // ilw.z vi07, 1(vi12) | nop - ilw_buffer(Mask::z, vu.vi07, vu.vi12 + 1); - // lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 - vu.vf08.add_xyzw(vu.vf08, vu.vf28); lq_buffer_xyzw(vu.vf12, vu.vi01++); - // lqi.xyzw vf15, vi01 | nop - lq_buffer_xyzw(vu.vf15, vu.vi01++); - // mtir vi11, vf09.x | nop - vu.vi11 = vu.vf09.x_as_u16(); -// BRANCH! - // ibeq vi00, vi15, L62 | nop - bc = (vu.vi15 == 0); - // mtir vi14, vf09.y | nop - vu.vi14 = vu.vf09.y_as_u16(); - if (bc) { goto L62; } - - - // nop | miniw.w vf08, vf08, vf01 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf01.w()); - L62: - // div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 - vu.vf09.add(Mask::zw, vu.vf09, vu.vf17); vu.Q = vu.vf01.w() / vu.vf08.w(); - - // iadd vi03, vi03, vi12 | add.xyzw vf12, vf12, vf18 - vu.vf12.add_xyzw(vu.vf12, vu.vf18); vu.vi03 = vu.vi03 + vu.vi12; - // iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 - vu.vf15.add_xyzw(vu.vf15, vu.vf19); vu.vi11 = vu.vi11 & vu.vi05; - // ilw.w vi08, -1(vi02) | nop - ilw_buffer(Mask::w, vu.vi08, vu.vi02 + -1); - // iadd vi07, vi07, vi03 | nop - vu.vi07 = vu.vi07 + vu.vi03; - // iand vi14, vi14, vi05 | nop - vu.vi14 = vu.vi14 & vu.vi05; -// BRANCH! - // ibne vi05, vi11, L63 | nop - bc = (vu.vi05 != vu.vi11); - // iaddi vi07, vi07, -0x1 | mul.xyz vf08, vf08, Q - vu.vf08.mul(Mask::xyz, vu.vf08, vu.Q); /* TODO mulq */ vu.vi07 = vu.vi07 + -1; - if (bc) { goto L63; } - - - // mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | nop - vu.vi14 = vu.vf12.y_as_u16(); -// BRANCH! - // b L64 | nop - bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L64; } - - - L63: - // lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi11); - // nop | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); - // lq.xyzw vf31, 0(vi14) | nop - lq_buffer_xyzw(vu.vf31, vu.vi14); - // lq.xyzw vf25, 0(vi08) | nop - lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf23, 1(vi11) | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi11 + 1); - // lq.xyzw vf20, 1(vi14) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi14 + 1); - // lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // lq.xyzw vf31, 2(vi11) | maddz.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi11 + 2); - // lq.xyzw vf23, 2(vi14) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi14 + 2); - // lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lq.xyzw vf20, 3(vi11) | maddz.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 3); - // lq.xyzw vf31, 3(vi14) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf31, vu.vi14 + 3); - // lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // lq.xyzw vf23, 4(vi11) | maddz.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi11 + 4); - // lq.xyzw vf20, 4(vi14) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi14 + 4); - // lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyzw vf31, 5(vi11) | maddz.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi11 + 5); - // lq.xyzw vf23, 5(vi14) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi14 + 5); - // lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); - // lq.xyzw vf20, 6(vi11) | maddz.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 6); - // lq.xyzw vf22, 6(vi14) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf22, vu.vi14 + 6); - // lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - // lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi11, vf12.x | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | madday.xyzw ACC, vf22, vf24 - vu.acc.madda_xyzw(vu.vf22, vu.vf24.y()); vu.vi14 = vu.vf12.y_as_u16(); - // lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.z()); lq_buffer_xyzw(vu.vf22, 2); - // lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi03++); - L64: - // nop | mulaz.xyzw ACC, vf29, vf09 - vu.acc.mula_xyzw(vu.vf29, vu.vf09.z()); - // nop | maddaz.xyzw ACC, vf30, vf12 - vu.acc.madda_xyzw(vu.vf30, vu.vf12.z()); - // mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 - vu.acc.madd_xyz(vu.vf12, vu.vf31, vu.vf15.z()); vu.vf20.mfp(Mask::w, vu.P); - // nop | nop - - // 1024.0 | miniw.w vf08, vf08, vf03 :i - vu.vf08.mini(Mask::w, vu.vf08, vu.vf03.w()); vu.I = 1024.0; -// BRANCH! - // ibne vi00, vi15, L125 | mulaw.xyzw ACC, vf25, vf09 - vu.acc.mula_xyzw(vu.vf25, vu.vf09.w()); bc = (vu.vi15 != 0); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 - vu.vf11.mul_xyzw(vu.vf11, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - if (bc) { goto L125; } - - - // erleng.xyz P, vf12 | nop - vu.P = erleng(vu.vf12); /* TODO erleng */ - // nop | maddaw.xyzw ACC, vf26, vf12 - vu.acc.madda_xyzw(vu.vf26, vu.vf12.w()); - // mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 - vu.acc.madd_xyzw(vu.vf09, vu.vf27, vu.vf15.w()); vu.vf15.z() = 1.f; - L65: - // lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); lq_buffer_xyzw(vu.vf10, vu.vi01++); -// BRANCH! - // b L67 | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); bc = true; - // nop | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); - if (bc) { goto L67; } - - - L66: - // lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); lq_buffer_xyzw(vu.vf10, vu.vi01++); - // sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); sq_buffer_xyzw(vu.vf13, vu.vi12 + 1); - // sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); sq_buffer_xyzw(vu.vf13, vu.vi15 + 1); - L67: - // lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 - vu.vf09.add_xyzw(vu.vf09, vu.vf28); lq_buffer_xyzw(vu.vf13, vu.vi01++); - // lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 - vu.vf08.max(Mask::w, vu.vf08, vu.vf02.w()); lq_buffer_xyzw(vu.vf16, vu.vi01++); - // mtir vi12, vf10.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi12 = vu.vf10.x_as_u16(); - // mtir vi15, vf10.y | maxx.xyzw vf11, vf11, vf00 - vu.vf11.max_xyzw(vu.vf11, vu.vf00.x()); vu.vi15 = vu.vf10.y_as_u16(); - // div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 - vu.vf10.add(Mask::zw, vu.vf10, vu.vf17); vu.Q = vu.vf01.w() / vu.vf09.w(); - - // move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 - vu.vf13.add_xyzw(vu.vf13, vu.vf18); vu.vf21.move_xyzw(vu.vf08); - // iand vi12, vi12, vi05 | add.xyzw vf16, vf16, vf19 - vu.vf16.add_xyzw(vu.vf16, vu.vf19); vu.vi12 = vu.vi12 & vu.vi05; - // ilw.w vi08, -1(vi02) | mulax.xyzw ACC, vf04, vf11 - vu.acc.mula_xyzw(vu.vf04, vu.vf11.x()); ilw_buffer(Mask::w, vu.vi08, vu.vi02 + -1); -// BRANCH! - // ibgtz vi09, L68 | madday.xyzw ACC, vf05, vf11 - vu.acc.madda_xyzw(vu.vf05, vu.vf11.y()); bc = ((s16)vu.vi09) > 0; - // iand vi15, vi15, vi05 | maddaz.xyzw ACC, vf06, vf11 - vu.acc.madda_xyzw(vu.vf06, vu.vf11.z()); vu.vi15 = vu.vi15 & vu.vi05; - if (bc) { goto L68; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L68: -// BRANCH! - // ibne vi05, vi12, L69 | maddw.xyzw vf11, vf07, vf00 - vu.acc.madd_xyzw(vu.vf11, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi12); - // ilw.x vi09, -9(vi01) | mul.xyz vf09, vf09, Q - vu.vf09.mul(Mask::xyz, vu.vf09, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L69; } - - - // mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ vu.vi12 = vu.vf13.x_as_u16(); - // mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi15 = vu.vf13.y_as_u16(); -// BRANCH! - // b L70 | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L70; } - - - L69: - // lq.xyzw vf20, 0(vi12) | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi12); - // nop | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); - // lq.xyzw vf31, 0(vi15) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf31, vu.vi15); - // lq.xyzw vf25, 0(vi08) | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf23, 1(vi12) | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi12 + 1); - // lq.xyzw vf20, 1(vi15) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi15 + 1); - // lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // lq.xyzw vf31, 2(vi12) | maddz.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi12 + 2); - // lq.xyzw vf23, 2(vi15) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi15 + 2); - // lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lq.xyzw vf20, 3(vi12) | maddz.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 3); - // lq.xyzw vf31, 3(vi15) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf31, vu.vi15 + 3); - // lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // lq.xyzw vf23, 4(vi12) | maddz.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi12 + 4); - // lq.xyzw vf20, 4(vi15) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi15 + 4); - // lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyzw vf31, 5(vi12) | maddz.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi12 + 5); - // lq.xyzw vf23, 5(vi15) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi15 + 5); - // lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); - // lq.xyzw vf20, 6(vi12) | maddz.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 6); - // lq.xyzw vf22, 6(vi15) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf22, vu.vi15 + 6); - // lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - // lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi12, vf13.x | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); vu.vi12 = vu.vf13.x_as_u16(); - // mtir vi15, vf13.y | madday.xyzw ACC, vf22, vf24 - vu.acc.madda_xyzw(vu.vf22, vu.vf24.y()); vu.vi15 = vu.vf13.y_as_u16(); - // lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.z()); lq_buffer_xyzw(vu.vf22, 2); - // lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi03++); - L70: -// BRANCH! - // ibgez vi09, L71 | mulaz.xyzw ACC, vf29, vf10 - vu.acc.mula_xyzw(vu.vf29, vu.vf10.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 - vu.acc.madda_xyzw(vu.vf30, vu.vf13.z()); sq_buffer_xyzw(vu.vf21, vu.vi10 + 2); - if (bc) { goto L71; } - - - // nop | ftoi4.xyzw vf21, vf08 - vu.vf21.ftoi4(Mask::xyzw, vu.vf08); - L71: - // mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 - vu.acc.madd_xyz(vu.vf13, vu.vf31, vu.vf16.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 - vu.vf11.mini_xyzw(vu.vf11, vu.vf17.y()); sq_buffer_xyzw(vu.vf14, vu.vi10); - // sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 - vu.vf09.mini(Mask::w, vu.vf09, vu.vf03.w()); sq_buffer_xyzw(vu.vf14, vu.vi13); - // sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 - vu.acc.mula_xyzw(vu.vf25, vu.vf10.w()); sq_buffer_xyzw(vu.vf21, vu.vi13 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf12, vf12, vf20 - vu.vf12.mul_xyzw(vu.vf12, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // erleng.xyz P, vf13 | ftoi0.xyzw vf11, vf11 - vu.vf11.ftoi0(Mask::xyzw, vu.vf11); vu.P = erleng(vu.vf13); /* TODO erleng */ -// BRANCH! - // ibeq vi07, vi03, L143 | maddaw.xyzw ACC, vf26, vf13 - vu.acc.madda_xyzw(vu.vf26, vu.vf13.w()); bc = (vu.vi07 == vu.vi03); - // mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 - vu.acc.madd_xyzw(vu.vf10, vu.vf27, vu.vf16.w()); vu.vf16.z() = 1.f; - if (bc) { goto L143; } - - - L72: - // lqi.xyzw vf08, vi01 | mulax.xyzw ACC, vf01, vf12 - vu.acc.mula_xyzw(vu.vf01, vu.vf12.x()); lq_buffer_xyzw(vu.vf08, vu.vi01++); - // sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 - vu.acc.madda_xyzw(vu.vf02, vu.vf12.y()); sq_buffer_xyzw(vu.vf11, vu.vi10 + 1); - // sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 - vu.acc.madd_xyzw(vu.vf12, vu.vf03, vu.vf12.z()); sq_buffer_xyzw(vu.vf11, vu.vi13 + 1); - // lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 - vu.vf10.add_xyzw(vu.vf10, vu.vf28); lq_buffer_xyzw(vu.vf11, vu.vi01++); - // lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 - vu.vf09.max(Mask::w, vu.vf09, vu.vf02.w()); lq_buffer_xyzw(vu.vf14, vu.vi01++); - // mtir vi10, vf08.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi10 = vu.vf08.x_as_u16(); - // mtir vi13, vf08.y | maxx.xyzw vf12, vf12, vf00 - vu.vf12.max_xyzw(vu.vf12, vu.vf00.x()); vu.vi13 = vu.vf08.y_as_u16(); - // div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 - vu.vf08.add(Mask::zw, vu.vf08, vu.vf17); vu.Q = vu.vf01.w() / vu.vf10.w(); - - // move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 - vu.vf11.add_xyzw(vu.vf11, vu.vf18); vu.vf21.move_xyzw(vu.vf09); - // iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 - vu.vf14.add_xyzw(vu.vf14, vu.vf19); vu.vi10 = vu.vi10 & vu.vi05; - // ilw.w vi08, -1(vi02) | mulax.xyzw ACC, vf04, vf12 - vu.acc.mula_xyzw(vu.vf04, vu.vf12.x()); ilw_buffer(Mask::w, vu.vi08, vu.vi02 + -1); -// BRANCH! - // ibgtz vi09, L73 | madday.xyzw ACC, vf05, vf12 - vu.acc.madda_xyzw(vu.vf05, vu.vf12.y()); bc = ((s16)vu.vi09) > 0; - // iand vi13, vi13, vi05 | maddaz.xyzw ACC, vf06, vf12 - vu.acc.madda_xyzw(vu.vf06, vu.vf12.z()); vu.vi13 = vu.vi13 & vu.vi05; - if (bc) { goto L73; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L73: -// BRANCH! - // ibne vi05, vi10, L74 | maddw.xyzw vf12, vf07, vf00 - vu.acc.madd_xyzw(vu.vf12, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi10); - // ilw.x vi09, -9(vi01) | mul.xyz vf10, vf10, Q - vu.vf10.mul(Mask::xyz, vu.vf10, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L74; } - - - // mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi13 = vu.vf11.y_as_u16(); -// BRANCH! - // b L75 | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L75; } - - - L74: - // lq.xyzw vf20, 0(vi10) | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi10); - // nop | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); - // lq.xyzw vf31, 0(vi13) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf31, vu.vi13); - // lq.xyzw vf25, 0(vi08) | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf23, 1(vi10) | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi10 + 1); - // lq.xyzw vf20, 1(vi13) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi13 + 1); - // lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // lq.xyzw vf31, 2(vi10) | maddz.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi10 + 2); - // lq.xyzw vf23, 2(vi13) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi13 + 2); - // lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lq.xyzw vf20, 3(vi10) | maddz.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 3); - // lq.xyzw vf31, 3(vi13) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf31, vu.vi13 + 3); - // lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // lq.xyzw vf23, 4(vi10) | maddz.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi10 + 4); - // lq.xyzw vf20, 4(vi13) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi13 + 4); - // lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyzw vf31, 5(vi10) | maddz.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi10 + 5); - // lq.xyzw vf23, 5(vi13) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi13 + 5); - // lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); - // lq.xyzw vf20, 6(vi10) | maddz.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 6); - // lq.xyzw vf22, 6(vi13) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf22, vu.vi13 + 6); - // lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - // lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi10, vf11.x | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | madday.xyzw ACC, vf22, vf24 - vu.acc.madda_xyzw(vu.vf22, vu.vf24.y()); vu.vi13 = vu.vf11.y_as_u16(); - // lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.z()); lq_buffer_xyzw(vu.vf22, 2); - // lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi03++); - L75: -// BRANCH! - // ibgez vi09, L76 | mulaz.xyzw ACC, vf29, vf08 - vu.acc.mula_xyzw(vu.vf29, vu.vf08.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 - vu.acc.madda_xyzw(vu.vf30, vu.vf11.z()); sq_buffer_xyzw(vu.vf21, vu.vi11 + 2); - if (bc) { goto L76; } - - - // nop | ftoi4.xyzw vf21, vf09 - vu.vf21.ftoi4(Mask::xyzw, vu.vf09); - L76: - // mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 - vu.acc.madd_xyz(vu.vf11, vu.vf31, vu.vf14.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 - vu.vf12.mini_xyzw(vu.vf12, vu.vf17.y()); sq_buffer_xyzw(vu.vf15, vu.vi11); - // sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 - vu.vf10.mini(Mask::w, vu.vf10, vu.vf03.w()); sq_buffer_xyzw(vu.vf15, vu.vi14); - // sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 - vu.acc.mula_xyzw(vu.vf25, vu.vf08.w()); sq_buffer_xyzw(vu.vf21, vu.vi14 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf13, vf13, vf20 - vu.vf13.mul_xyzw(vu.vf13, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // erleng.xyz P, vf11 | ftoi0.xyzw vf12, vf12 - vu.vf12.ftoi0(Mask::xyzw, vu.vf12); vu.P = erleng(vu.vf11); /* TODO erleng */ -// BRANCH! - // ibeq vi07, vi03, L153 | maddaw.xyzw ACC, vf26, vf11 - vu.acc.madda_xyzw(vu.vf26, vu.vf11.w()); bc = (vu.vi07 == vu.vi03); - // mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 - vu.acc.madd_xyzw(vu.vf08, vu.vf27, vu.vf14.w()); vu.vf14.z() = 1.f; - if (bc) { goto L153; } - - - L77: - // lqi.xyzw vf09, vi01 | mulax.xyzw ACC, vf01, vf13 - vu.acc.mula_xyzw(vu.vf01, vu.vf13.x()); lq_buffer_xyzw(vu.vf09, vu.vi01++); - // sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 - vu.acc.madda_xyzw(vu.vf02, vu.vf13.y()); sq_buffer_xyzw(vu.vf12, vu.vi11 + 1); - // sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 - vu.acc.madd_xyzw(vu.vf13, vu.vf03, vu.vf13.z()); sq_buffer_xyzw(vu.vf12, vu.vi14 + 1); - // lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 - vu.vf08.add_xyzw(vu.vf08, vu.vf28); lq_buffer_xyzw(vu.vf12, vu.vi01++); - // lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 - vu.vf10.max(Mask::w, vu.vf10, vu.vf02.w()); lq_buffer_xyzw(vu.vf15, vu.vi01++); - // mtir vi11, vf09.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi11 = vu.vf09.x_as_u16(); - // mtir vi14, vf09.y | maxx.xyzw vf13, vf13, vf00 - vu.vf13.max_xyzw(vu.vf13, vu.vf00.x()); vu.vi14 = vu.vf09.y_as_u16(); - // div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 - vu.vf09.add(Mask::zw, vu.vf09, vu.vf17); vu.Q = vu.vf01.w() / vu.vf08.w(); - - // move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 - vu.vf12.add_xyzw(vu.vf12, vu.vf18); vu.vf21.move_xyzw(vu.vf10); - // iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 - vu.vf15.add_xyzw(vu.vf15, vu.vf19); vu.vi11 = vu.vi11 & vu.vi05; - // ilw.w vi08, -1(vi02) | mulax.xyzw ACC, vf04, vf13 - vu.acc.mula_xyzw(vu.vf04, vu.vf13.x()); ilw_buffer(Mask::w, vu.vi08, vu.vi02 + -1); -// BRANCH! - // ibgtz vi09, L78 | madday.xyzw ACC, vf05, vf13 - vu.acc.madda_xyzw(vu.vf05, vu.vf13.y()); bc = ((s16)vu.vi09) > 0; - // iand vi14, vi14, vi05 | maddaz.xyzw ACC, vf06, vf13 - vu.acc.madda_xyzw(vu.vf06, vu.vf13.z()); vu.vi14 = vu.vi14 & vu.vi05; - if (bc) { goto L78; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L78: -// BRANCH! - // ibne vi05, vi11, L79 | maddw.xyzw vf13, vf07, vf00 - vu.acc.madd_xyzw(vu.vf13, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi11); - // ilw.x vi09, -9(vi01) | mul.xyz vf08, vf08, Q - vu.vf08.mul(Mask::xyz, vu.vf08, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L79; } - - - // mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi14 = vu.vf12.y_as_u16(); -// BRANCH! - // b L80 | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L80; } - - - L79: - // lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi11); - // nop | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); - // lq.xyzw vf31, 0(vi14) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf31, vu.vi14); - // lq.xyzw vf25, 0(vi08) | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf23, 1(vi11) | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi11 + 1); - // lq.xyzw vf20, 1(vi14) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi14 + 1); - // lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // lq.xyzw vf31, 2(vi11) | maddz.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi11 + 2); - // lq.xyzw vf23, 2(vi14) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi14 + 2); - // lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lq.xyzw vf20, 3(vi11) | maddz.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 3); - // lq.xyzw vf31, 3(vi14) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf31, vu.vi14 + 3); - // lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // lq.xyzw vf23, 4(vi11) | maddz.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi11 + 4); - // lq.xyzw vf20, 4(vi14) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi14 + 4); - // lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyzw vf31, 5(vi11) | maddz.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi11 + 5); - // lq.xyzw vf23, 5(vi14) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi14 + 5); - // lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); - // lq.xyzw vf20, 6(vi11) | maddz.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 6); - // lq.xyzw vf22, 6(vi14) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf22, vu.vi14 + 6); - // lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - // lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi11, vf12.x | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | madday.xyzw ACC, vf22, vf24 - vu.acc.madda_xyzw(vu.vf22, vu.vf24.y()); vu.vi14 = vu.vf12.y_as_u16(); - // lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.z()); lq_buffer_xyzw(vu.vf22, 2); - // lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi03++); - L80: -// BRANCH! - // ibgez vi09, L81 | mulaz.xyzw ACC, vf29, vf09 - vu.acc.mula_xyzw(vu.vf29, vu.vf09.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 - vu.acc.madda_xyzw(vu.vf30, vu.vf12.z()); sq_buffer_xyzw(vu.vf21, vu.vi12 + 2); - if (bc) { goto L81; } - - - // nop | ftoi4.xyzw vf21, vf10 - vu.vf21.ftoi4(Mask::xyzw, vu.vf10); - L81: - // mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 - vu.acc.madd_xyz(vu.vf12, vu.vf31, vu.vf15.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 - vu.vf13.mini_xyzw(vu.vf13, vu.vf17.y()); sq_buffer_xyzw(vu.vf16, vu.vi12); - // sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf03.w()); sq_buffer_xyzw(vu.vf16, vu.vi15); - // sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 - vu.acc.mula_xyzw(vu.vf25, vu.vf09.w()); sq_buffer_xyzw(vu.vf21, vu.vi15 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 - vu.vf11.mul_xyzw(vu.vf11, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // erleng.xyz P, vf12 | ftoi0.xyzw vf13, vf13 - vu.vf13.ftoi0(Mask::xyzw, vu.vf13); vu.P = erleng(vu.vf12); /* TODO erleng */ -// BRANCH! - // ibne vi07, vi03, L66 | maddaw.xyzw ACC, vf26, vf12 - vu.acc.madda_xyzw(vu.vf26, vu.vf12.w()); bc = (vu.vi07 != vu.vi03); - // mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 - vu.acc.madd_xyzw(vu.vf09, vu.vf27, vu.vf15.w()); vu.vf15.z() = 1.f; - if (bc) { goto L66; } - - -// BRANCH! - // b L163 | nop - bc = true; - // nop | nop - - if (bc) { goto L163; } - - - L82: - // erleng.xyz P, vf12 | maxi.xy vf08, vf08, I - vu.vf08.maxi(Mask::xy, vu.vf08, vu.I); vu.P = erleng(vu.vf12); /* TODO erleng */ - // 3072.0 | nop :i - vu.I = 3072.0; - // nop | minii.xy vf08, vf08, I - vu.vf08.minii(Mask::xy, vu.vf08, vu.I); - // nop | maddaw.xyzw ACC, vf26, vf12 - vu.acc.madda_xyzw(vu.vf26, vu.vf12.w()); - // mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 - vu.acc.madd_xyzw(vu.vf09, vu.vf27, vu.vf15.w()); vu.vf15.z() = 1.f; - // lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); lq_buffer_xyzw(vu.vf10, vu.vi01++); -// BRANCH! - // ibne vi04, vi03, L84 | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); bc = (vu.vi04 != vu.vi03); - // nop | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); - if (bc) { goto L84; } - - -// BRANCH! - // ibne vi06, vi03, JUMP_48E | nop - bc = (vu.vi06 != vu.vi03); - // nop | nop - - if (bc) { goto JUMP_48E; } - - -// BRANCH! - // b L128 | nop - bc = true; - // nop | nop - - if (bc) { goto L128; } - - - L83: - // 3072.0 | mulax.xyzw ACC, vf01, vf11 :i - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); vu.I = 3072.0; - // lqi.xyzw vf10, vi01 | minii.xy vf08, vf08, I - vu.vf08.minii(Mask::xy, vu.vf08, vu.I); lq_buffer_xyzw(vu.vf10, vu.vi01++); - // sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); sq_buffer_xyzw(vu.vf13, vu.vi12 + 1); - // sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); sq_buffer_xyzw(vu.vf13, vu.vi15 + 1); - L84: - // lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 - vu.vf09.add_xyzw(vu.vf09, vu.vf28); lq_buffer_xyzw(vu.vf13, vu.vi01++); - // lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 - vu.vf08.max(Mask::w, vu.vf08, vu.vf02.w()); lq_buffer_xyzw(vu.vf16, vu.vi01++); - // mtir vi08, vf10.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi08 = vu.vf10.x_as_u16(); - // ilw.y vi09, -9(vi01) | maxx.xyzw vf11, vf11, vf00 - vu.vf11.max_xyzw(vu.vf11, vu.vf00.x()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -9); - // nop | miniw.w vf09, vf09, vf01 - vu.vf09.mini(Mask::w, vu.vf09, vu.vf01.w()); - // div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 - vu.vf10.add(Mask::zw, vu.vf10, vu.vf17); vu.Q = vu.vf01.w() / vu.vf09.w(); - - // move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 - vu.vf13.add_xyzw(vu.vf13, vu.vf18); vu.vf21.move_xyzw(vu.vf08); - // lq.xyz vf29, 4(vi08) | add.xyzw vf16, vf16, vf19 - vu.vf16.add_xyzw(vu.vf16, vu.vf19); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyz vf30, 5(vi08) | mulax.xyzw ACC, vf04, vf11 - vu.acc.mula_xyzw(vu.vf04, vu.vf11.x()); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); -// BRANCH! - // ibgtz vi09, L85 | madday.xyzw ACC, vf05, vf11 - vu.acc.madda_xyzw(vu.vf05, vu.vf11.y()); bc = ((s16)vu.vi09) > 0; - // lq.xyzw vf31, 6(vi08) | maddaz.xyzw ACC, vf06, vf11 - vu.acc.madda_xyzw(vu.vf06, vu.vf11.z()); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - if (bc) { goto L85; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L85: - // lq.xyzw vf25, 0(vi08) | maddw.xyzw vf11, vf07, vf00 - vu.acc.madd_xyzw(vu.vf11, vu.vf07, vu.vf00.w()); lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf26, 1(vi08) | mul.xyz vf09, vf09, Q - vu.vf09.mul(Mask::xyz, vu.vf09, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ vu.vi12 = vu.vf13.x_as_u16(); - // mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi15 = vu.vf13.y_as_u16(); - // lq.xyzw vf27, 2(vi08) | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); -// BRANCH! - // ibne vi00, vi09, L86 | mulaz.xyzw ACC, vf29, vf10 - vu.acc.mula_xyzw(vu.vf29, vu.vf10.z()); bc = (vu.vi09 != 0); - // sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 - vu.acc.madda_xyzw(vu.vf30, vu.vf13.z()); sq_buffer_xyzw(vu.vf21, vu.vi10 + 2); - if (bc) { goto L86; } - - - // nop | ftoi4.xyzw vf21, vf08 - vu.vf21.ftoi4(Mask::xyzw, vu.vf08); - L86: - // mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 - vu.acc.madd_xyz(vu.vf13, vu.vf31, vu.vf16.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 - vu.vf11.mini_xyzw(vu.vf11, vu.vf17.y()); sq_buffer_xyzw(vu.vf14, vu.vi10); - // sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 - vu.vf09.mini(Mask::w, vu.vf09, vu.vf03.w()); sq_buffer_xyzw(vu.vf14, vu.vi13); - // sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 - vu.acc.mula_xyzw(vu.vf25, vu.vf10.w()); sq_buffer_xyzw(vu.vf21, vu.vi13 + 2); - // lq.xyzw vf28, 3(vi08) | mulw.xyzw vf12, vf12, vf20 - vu.vf12.mul_xyzw(vu.vf12, vu.vf20.w()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // 1024.0 | ftoi0.xyzw vf11, vf11 :i - vu.vf11.ftoi0(Mask::xyzw, vu.vf11); vu.I = 1024.0; - // erleng.xyz P, vf13 | maxi.xy vf09, vf09, I - vu.vf09.maxi(Mask::xy, vu.vf09, vu.I); vu.P = erleng(vu.vf13); /* TODO erleng */ -// BRANCH! - // ibne vi04, vi03, L87 | maddaw.xyzw ACC, vf26, vf13 - vu.acc.madda_xyzw(vu.vf26, vu.vf13.w()); bc = (vu.vi04 != vu.vi03); - // mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 - vu.acc.madd_xyzw(vu.vf10, vu.vf27, vu.vf16.w()); vu.vf16.z() = 1.f; - if (bc) { goto L87; } - - -// BRANCH! - // ibne vi06, vi03, L100 | nop - bc = (vu.vi06 != vu.vi03); - // ilw.y vi09, -6(vi01) | nop - ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - if (bc) { goto L100; } - - -// BRANCH! - // ibne vi07, vi03, L133 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L133; } - - -// BRANCH! - // b L143 | nop - bc = true; - // nop | nop - - if (bc) { goto L143; } - - - L87: - // 3072.0 | mulax.xyzw ACC, vf01, vf12 :i - vu.acc.mula_xyzw(vu.vf01, vu.vf12.x()); vu.I = 3072.0; - // lqi.xyzw vf08, vi01 | minii.xy vf09, vf09, I - vu.vf09.minii(Mask::xy, vu.vf09, vu.I); lq_buffer_xyzw(vu.vf08, vu.vi01++); - // sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 - vu.acc.madda_xyzw(vu.vf02, vu.vf12.y()); sq_buffer_xyzw(vu.vf11, vu.vi10 + 1); - // sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 - vu.acc.madd_xyzw(vu.vf12, vu.vf03, vu.vf12.z()); sq_buffer_xyzw(vu.vf11, vu.vi13 + 1); - // lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 - vu.vf10.add_xyzw(vu.vf10, vu.vf28); lq_buffer_xyzw(vu.vf11, vu.vi01++); - // lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 - vu.vf09.max(Mask::w, vu.vf09, vu.vf02.w()); lq_buffer_xyzw(vu.vf14, vu.vi01++); - // mtir vi08, vf08.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi08 = vu.vf08.x_as_u16(); - // ilw.y vi09, -9(vi01) | maxx.xyzw vf12, vf12, vf00 - vu.vf12.max_xyzw(vu.vf12, vu.vf00.x()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -9); - // nop | miniw.w vf10, vf10, vf01 - vu.vf10.mini(Mask::w, vu.vf10, vu.vf01.w()); - // div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 - vu.vf08.add(Mask::zw, vu.vf08, vu.vf17); vu.Q = vu.vf01.w() / vu.vf10.w(); - - // move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 - vu.vf11.add_xyzw(vu.vf11, vu.vf18); vu.vf21.move_xyzw(vu.vf09); - // lq.xyz vf29, 4(vi08) | add.xyzw vf14, vf14, vf19 - vu.vf14.add_xyzw(vu.vf14, vu.vf19); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyz vf30, 5(vi08) | mulax.xyzw ACC, vf04, vf12 - vu.acc.mula_xyzw(vu.vf04, vu.vf12.x()); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); -// BRANCH! - // ibgtz vi09, L88 | madday.xyzw ACC, vf05, vf12 - vu.acc.madda_xyzw(vu.vf05, vu.vf12.y()); bc = ((s16)vu.vi09) > 0; - // lq.xyzw vf31, 6(vi08) | maddaz.xyzw ACC, vf06, vf12 - vu.acc.madda_xyzw(vu.vf06, vu.vf12.z()); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - if (bc) { goto L88; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L88: - // lq.xyzw vf25, 0(vi08) | maddw.xyzw vf12, vf07, vf00 - vu.acc.madd_xyzw(vu.vf12, vu.vf07, vu.vf00.w()); lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf26, 1(vi08) | mul.xyz vf10, vf10, Q - vu.vf10.mul(Mask::xyz, vu.vf10, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi13 = vu.vf11.y_as_u16(); - // lq.xyzw vf27, 2(vi08) | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); -// BRANCH! - // ibne vi00, vi09, L89 | mulaz.xyzw ACC, vf29, vf08 - vu.acc.mula_xyzw(vu.vf29, vu.vf08.z()); bc = (vu.vi09 != 0); - // sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 - vu.acc.madda_xyzw(vu.vf30, vu.vf11.z()); sq_buffer_xyzw(vu.vf21, vu.vi11 + 2); - if (bc) { goto L89; } - - - // nop | ftoi4.xyzw vf21, vf09 - vu.vf21.ftoi4(Mask::xyzw, vu.vf09); - L89: - // mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 - vu.acc.madd_xyz(vu.vf11, vu.vf31, vu.vf14.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 - vu.vf12.mini_xyzw(vu.vf12, vu.vf17.y()); sq_buffer_xyzw(vu.vf15, vu.vi11); - // sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 - vu.vf10.mini(Mask::w, vu.vf10, vu.vf03.w()); sq_buffer_xyzw(vu.vf15, vu.vi14); - // sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 - vu.acc.mula_xyzw(vu.vf25, vu.vf08.w()); sq_buffer_xyzw(vu.vf21, vu.vi14 + 2); - // lq.xyzw vf28, 3(vi08) | mulw.xyzw vf13, vf13, vf20 - vu.vf13.mul_xyzw(vu.vf13, vu.vf20.w()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // 1024.0 | ftoi0.xyzw vf12, vf12 :i - vu.vf12.ftoi0(Mask::xyzw, vu.vf12); vu.I = 1024.0; - // erleng.xyz P, vf11 | maxi.xy vf10, vf10, I - vu.vf10.maxi(Mask::xy, vu.vf10, vu.I); vu.P = erleng(vu.vf11); /* TODO erleng */ -// BRANCH! - // ibne vi04, vi03, L90 | maddaw.xyzw ACC, vf26, vf11 - vu.acc.madda_xyzw(vu.vf26, vu.vf11.w()); bc = (vu.vi04 != vu.vi03); - // mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 - vu.acc.madd_xyzw(vu.vf08, vu.vf27, vu.vf14.w()); vu.vf14.z() = 1.f; - if (bc) { goto L90; } - - -// BRANCH! - // ibne vi06, vi03, L105 | nop - bc = (vu.vi06 != vu.vi03); - // ilw.y vi09, -6(vi01) | nop - ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - if (bc) { goto L105; } - - -// BRANCH! - // ibne vi07, vi03, L138 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L138; } - - -// BRANCH! - // b L153 | nop - bc = true; - // nop | nop - - if (bc) { goto L153; } - - - L90: - // 3072.0 | mulax.xyzw ACC, vf01, vf13 :i - vu.acc.mula_xyzw(vu.vf01, vu.vf13.x()); vu.I = 3072.0; - // lqi.xyzw vf09, vi01 | minii.xy vf10, vf10, I - vu.vf10.minii(Mask::xy, vu.vf10, vu.I); lq_buffer_xyzw(vu.vf09, vu.vi01++); - // sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 - vu.acc.madda_xyzw(vu.vf02, vu.vf13.y()); sq_buffer_xyzw(vu.vf12, vu.vi11 + 1); - // sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 - vu.acc.madd_xyzw(vu.vf13, vu.vf03, vu.vf13.z()); sq_buffer_xyzw(vu.vf12, vu.vi14 + 1); - // lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 - vu.vf08.add_xyzw(vu.vf08, vu.vf28); lq_buffer_xyzw(vu.vf12, vu.vi01++); - // lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 - vu.vf10.max(Mask::w, vu.vf10, vu.vf02.w()); lq_buffer_xyzw(vu.vf15, vu.vi01++); - // mtir vi08, vf09.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi08 = vu.vf09.x_as_u16(); - // ilw.y vi09, -9(vi01) | maxx.xyzw vf13, vf13, vf00 - vu.vf13.max_xyzw(vu.vf13, vu.vf00.x()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -9); - // nop | miniw.w vf08, vf08, vf01 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf01.w()); - // div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 - vu.vf09.add(Mask::zw, vu.vf09, vu.vf17); vu.Q = vu.vf01.w() / vu.vf08.w(); - - // move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 - vu.vf12.add_xyzw(vu.vf12, vu.vf18); vu.vf21.move_xyzw(vu.vf10); - // lq.xyz vf29, 4(vi08) | add.xyzw vf15, vf15, vf19 - vu.vf15.add_xyzw(vu.vf15, vu.vf19); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyz vf30, 5(vi08) | mulax.xyzw ACC, vf04, vf13 - vu.acc.mula_xyzw(vu.vf04, vu.vf13.x()); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); -// BRANCH! - // ibgtz vi09, L91 | madday.xyzw ACC, vf05, vf13 - vu.acc.madda_xyzw(vu.vf05, vu.vf13.y()); bc = ((s16)vu.vi09) > 0; - // lq.xyzw vf31, 6(vi08) | maddaz.xyzw ACC, vf06, vf13 - vu.acc.madda_xyzw(vu.vf06, vu.vf13.z()); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - if (bc) { goto L91; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L91: - // lq.xyzw vf25, 0(vi08) | maddw.xyzw vf13, vf07, vf00 - vu.acc.madd_xyzw(vu.vf13, vu.vf07, vu.vf00.w()); lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf26, 1(vi08) | mul.xyz vf08, vf08, Q - vu.vf08.mul(Mask::xyz, vu.vf08, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi14 = vu.vf12.y_as_u16(); - // lq.xyzw vf27, 2(vi08) | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); -// BRANCH! - // ibne vi00, vi09, L92 | mulaz.xyzw ACC, vf29, vf09 - vu.acc.mula_xyzw(vu.vf29, vu.vf09.z()); bc = (vu.vi09 != 0); - // sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 - vu.acc.madda_xyzw(vu.vf30, vu.vf12.z()); sq_buffer_xyzw(vu.vf21, vu.vi12 + 2); - if (bc) { goto L92; } - - - // nop | ftoi4.xyzw vf21, vf10 - vu.vf21.ftoi4(Mask::xyzw, vu.vf10); - L92: - // mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 - vu.acc.madd_xyz(vu.vf12, vu.vf31, vu.vf15.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 - vu.vf13.mini_xyzw(vu.vf13, vu.vf17.y()); sq_buffer_xyzw(vu.vf16, vu.vi12); - // sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf03.w()); sq_buffer_xyzw(vu.vf16, vu.vi15); - // sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 - vu.acc.mula_xyzw(vu.vf25, vu.vf09.w()); sq_buffer_xyzw(vu.vf21, vu.vi15 + 2); - // lq.xyzw vf28, 3(vi08) | mulw.xyzw vf11, vf11, vf20 - vu.vf11.mul_xyzw(vu.vf11, vu.vf20.w()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // 1024.0 | ftoi0.xyzw vf13, vf13 :i - vu.vf13.ftoi0(Mask::xyzw, vu.vf13); vu.I = 1024.0; - // erleng.xyz P, vf12 | maxi.xy vf08, vf08, I - vu.vf08.maxi(Mask::xy, vu.vf08, vu.I); vu.P = erleng(vu.vf12); /* TODO erleng */ -// BRANCH! - // ibne vi04, vi03, L83 | maddaw.xyzw ACC, vf26, vf12 - vu.acc.madda_xyzw(vu.vf26, vu.vf12.w()); bc = (vu.vi04 != vu.vi03); - // mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 - vu.acc.madd_xyzw(vu.vf09, vu.vf27, vu.vf15.w()); vu.vf15.z() = 1.f; - if (bc) { goto L83; } - - -// BRANCH! - // ibne vi06, vi03, L94 | nop - bc = (vu.vi06 != vu.vi03); - // ilw.y vi09, -6(vi01) | nop - ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - if (bc) { goto L94; } - - -// BRANCH! - // ibne vi07, vi03, L127 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L127; } - - -// BRANCH! - // b L163 | nop - bc = true; - // nop | nop - - if (bc) { goto L163; } - - - L93: - // erleng.xyz P, vf12 | maxi.xy vf08, vf08, I - vu.vf08.maxi(Mask::xy, vu.vf08, vu.I); vu.P = erleng(vu.vf12); /* TODO erleng */ - // 3072.0 | nop :i - vu.I = 3072.0; - // nop | minii.xy vf08, vf08, I - vu.vf08.minii(Mask::xy, vu.vf08, vu.I); -// BRANCH! - // ibeq vi06, vi03, L126 | maddaw.xyzw ACC, vf26, vf12 - vu.acc.madda_xyzw(vu.vf26, vu.vf12.w()); bc = (vu.vi06 == vu.vi03); - // mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 - vu.acc.madd_xyzw(vu.vf09, vu.vf27, vu.vf15.w()); vu.vf15.z() = 1.f; - if (bc) { goto L126; } - - - // lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); lq_buffer_xyzw(vu.vf10, vu.vi01++); - // jr vi08 | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); - // nop | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); - switch (vu.vi08) { - case 0x1a1: - goto JUMP_1A1; - case 0x48e: - goto JUMP_48E; - case 0x243: - goto JUMP_243; - case 0x539: - goto JUMP_539; - default: - fmt::print("bad jump to {:x}\n", vu.vi08); - ASSERT(false); - } - L94: - // 3072.0 | mulax.xyzw ACC, vf01, vf11 :i - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); vu.I = 3072.0; - // lqi.xyzw vf10, vi01 | minii.xy vf08, vf08, I - vu.vf08.minii(Mask::xy, vu.vf08, vu.I); lq_buffer_xyzw(vu.vf10, vu.vi01++); - // sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); sq_buffer_xyzw(vu.vf13, vu.vi12 + 1); - // sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); sq_buffer_xyzw(vu.vf13, vu.vi15 + 1); - JUMP_48E: - // lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 - vu.vf09.add_xyzw(vu.vf09, vu.vf28); lq_buffer_xyzw(vu.vf13, vu.vi01++); - // lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 - vu.vf08.max(Mask::w, vu.vf08, vu.vf02.w()); lq_buffer_xyzw(vu.vf16, vu.vi01++); - // mtir vi12, vf10.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi12 = vu.vf10.x_as_u16(); - // mtir vi15, vf10.y | maxx.xyzw vf11, vf11, vf00 - vu.vf11.max_xyzw(vu.vf11, vu.vf00.x()); vu.vi15 = vu.vf10.y_as_u16(); - // nop | miniw.w vf09, vf09, vf01 - vu.vf09.mini(Mask::w, vu.vf09, vu.vf01.w()); - // div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 - vu.vf10.add(Mask::zw, vu.vf10, vu.vf17); vu.Q = vu.vf01.w() / vu.vf09.w(); - - // move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 - vu.vf13.add_xyzw(vu.vf13, vu.vf18); vu.vf21.move_xyzw(vu.vf08); - // iand vi12, vi12, vi05 | add.xyzw vf16, vf16, vf19 - vu.vf16.add_xyzw(vu.vf16, vu.vf19); vu.vi12 = vu.vi12 & vu.vi05; - // nop | mulax.xyzw ACC, vf04, vf11 - vu.acc.mula_xyzw(vu.vf04, vu.vf11.x()); -// BRANCH! - // ibgtz vi09, L96 | madday.xyzw ACC, vf05, vf11 - vu.acc.madda_xyzw(vu.vf05, vu.vf11.y()); bc = ((s16)vu.vi09) > 0; - // iand vi15, vi15, vi05 | maddaz.xyzw ACC, vf06, vf11 - vu.acc.madda_xyzw(vu.vf06, vu.vf11.z()); vu.vi15 = vu.vi15 & vu.vi05; - if (bc) { goto L96; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L96: -// BRANCH! - // ibne vi05, vi12, L97 | maddw.xyzw vf11, vf07, vf00 - vu.acc.madd_xyzw(vu.vf11, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi12); - // ilw.x vi09, -9(vi01) | mul.xyz vf09, vf09, Q - vu.vf09.mul(Mask::xyz, vu.vf09, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L97; } - - - // mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ vu.vi12 = vu.vf13.x_as_u16(); - // mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi15 = vu.vf13.y_as_u16(); -// BRANCH! - // b L98 | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L98; } - - - L97: - // lq.xyzw vf20, 0(vi12) | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi12); - // nop | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); - // lq.xyzw vf25, 0(vi15) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf25, vu.vi15); - // lq.xyzw vf23, 1(vi12) | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi12 + 1); - // lq.xyzw vf26, 1(vi15) | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf26, vu.vi15 + 1); - // lq.xyzw vf20, 2(vi12) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 2); - // lq.xyzw vf27, 2(vi15) | maddy.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi15 + 2); - // lq.xyzw vf23, 3(vi12) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi12 + 3); - // lq.xyzw vf28, 3(vi15) | maddy.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi15 + 3); - // lq.xyzw vf20, 4(vi12) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 4); - // lq.xyz vf29, 4(vi15) | maddy.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi15 + 4); - // lq.xyzw vf23, 5(vi12) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi12 + 5); - // lq.xyz vf30, 5(vi15) | maddy.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi15 + 5); - // lq.xyzw vf20, 6(vi12) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 6); - // lq.xyzw vf31, 6(vi15) | maddy.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi15 + 6); - // mtir vi12, vf13.x | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); vu.vi12 = vu.vf13.x_as_u16(); - // mtir vi15, vf13.y | maddy.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.y()); vu.vi15 = vu.vf13.y_as_u16(); -// BRANCH! - // b L113 | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); bc = true; - // lqi.xyzw vf23, vi03 | maddy.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.y()); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L113; } - - - L98: -// BRANCH! - // ibgez vi09, L99 | mulaz.xyzw ACC, vf29, vf10 - vu.acc.mula_xyzw(vu.vf29, vu.vf10.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 - vu.acc.madda_xyzw(vu.vf30, vu.vf13.z()); sq_buffer_xyzw(vu.vf21, vu.vi10 + 2); - if (bc) { goto L99; } - - - // nop | ftoi4.xyzw vf21, vf08 - vu.vf21.ftoi4(Mask::xyzw, vu.vf08); - L99: - // mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 - vu.acc.madd_xyz(vu.vf13, vu.vf31, vu.vf16.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 - vu.vf11.mini_xyzw(vu.vf11, vu.vf17.y()); sq_buffer_xyzw(vu.vf14, vu.vi10); - // sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 - vu.vf09.mini(Mask::w, vu.vf09, vu.vf03.w()); sq_buffer_xyzw(vu.vf14, vu.vi13); - // sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 - vu.acc.mula_xyzw(vu.vf25, vu.vf10.w()); sq_buffer_xyzw(vu.vf21, vu.vi13 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf12, vf12, vf20 - vu.vf12.mul_xyzw(vu.vf12, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // 1024.0 | ftoi0.xyzw vf11, vf11 :i - vu.vf11.ftoi0(Mask::xyzw, vu.vf11); vu.I = 1024.0; - // erleng.xyz P, vf13 | maxi.xy vf09, vf09, I - vu.vf09.maxi(Mask::xy, vu.vf09, vu.I); vu.P = erleng(vu.vf13); /* TODO erleng */ -// BRANCH! - // ibne vi06, vi03, L100 | maddaw.xyzw ACC, vf26, vf13 - vu.acc.madda_xyzw(vu.vf26, vu.vf13.w()); bc = (vu.vi06 != vu.vi03); - // mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 - vu.acc.madd_xyzw(vu.vf10, vu.vf27, vu.vf16.w()); vu.vf16.z() = 1.f; - if (bc) { goto L100; } - - -// BRANCH! - // ibne vi07, vi03, L133 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L133; } - - -// BRANCH! - // b L143 | nop - bc = true; - // nop | nop - - if (bc) { goto L143; } - - - L100: - // 3072.0 | mulax.xyzw ACC, vf01, vf12 :i - vu.acc.mula_xyzw(vu.vf01, vu.vf12.x()); vu.I = 3072.0; - // lqi.xyzw vf08, vi01 | minii.xy vf09, vf09, I - vu.vf09.minii(Mask::xy, vu.vf09, vu.I); lq_buffer_xyzw(vu.vf08, vu.vi01++); - // sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 - vu.acc.madda_xyzw(vu.vf02, vu.vf12.y()); sq_buffer_xyzw(vu.vf11, vu.vi10 + 1); - // sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 - vu.acc.madd_xyzw(vu.vf12, vu.vf03, vu.vf12.z()); sq_buffer_xyzw(vu.vf11, vu.vi13 + 1); - // lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 - vu.vf10.add_xyzw(vu.vf10, vu.vf28); lq_buffer_xyzw(vu.vf11, vu.vi01++); - // lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 - vu.vf09.max(Mask::w, vu.vf09, vu.vf02.w()); lq_buffer_xyzw(vu.vf14, vu.vi01++); - // mtir vi10, vf08.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi10 = vu.vf08.x_as_u16(); - // mtir vi13, vf08.y | maxx.xyzw vf12, vf12, vf00 - vu.vf12.max_xyzw(vu.vf12, vu.vf00.x()); vu.vi13 = vu.vf08.y_as_u16(); - // nop | miniw.w vf10, vf10, vf01 - vu.vf10.mini(Mask::w, vu.vf10, vu.vf01.w()); - // div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 - vu.vf08.add(Mask::zw, vu.vf08, vu.vf17); vu.Q = vu.vf01.w() / vu.vf10.w(); - - // move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 - vu.vf11.add_xyzw(vu.vf11, vu.vf18); vu.vf21.move_xyzw(vu.vf09); - // iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 - vu.vf14.add_xyzw(vu.vf14, vu.vf19); vu.vi10 = vu.vi10 & vu.vi05; - // nop | mulax.xyzw ACC, vf04, vf12 - vu.acc.mula_xyzw(vu.vf04, vu.vf12.x()); -// BRANCH! - // ibgtz vi09, L101 | madday.xyzw ACC, vf05, vf12 - vu.acc.madda_xyzw(vu.vf05, vu.vf12.y()); bc = ((s16)vu.vi09) > 0; - // iand vi13, vi13, vi05 | maddaz.xyzw ACC, vf06, vf12 - vu.acc.madda_xyzw(vu.vf06, vu.vf12.z()); vu.vi13 = vu.vi13 & vu.vi05; - if (bc) { goto L101; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L101: -// BRANCH! - // ibne vi05, vi10, L102 | maddw.xyzw vf12, vf07, vf00 - vu.acc.madd_xyzw(vu.vf12, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi10); - // ilw.x vi09, -9(vi01) | mul.xyz vf10, vf10, Q - vu.vf10.mul(Mask::xyz, vu.vf10, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L102; } - - - // mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi13 = vu.vf11.y_as_u16(); -// BRANCH! - // b L103 | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L103; } - - - L102: - // lq.xyzw vf20, 0(vi10) | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi10); - // nop | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); - // lq.xyzw vf25, 0(vi13) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf25, vu.vi13); - // lq.xyzw vf23, 1(vi10) | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi10 + 1); - // lq.xyzw vf26, 1(vi13) | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf26, vu.vi13 + 1); - // lq.xyzw vf20, 2(vi10) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 2); - // lq.xyzw vf27, 2(vi13) | maddy.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi13 + 2); - // lq.xyzw vf23, 3(vi10) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi10 + 3); - // lq.xyzw vf28, 3(vi13) | maddy.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi13 + 3); - // lq.xyzw vf20, 4(vi10) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 4); - // lq.xyz vf29, 4(vi13) | maddy.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi13 + 4); - // lq.xyzw vf23, 5(vi10) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi10 + 5); - // lq.xyz vf30, 5(vi13) | maddy.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi13 + 5); - // lq.xyzw vf20, 6(vi10) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 6); - // lq.xyzw vf31, 6(vi13) | maddy.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi13 + 6); - // mtir vi10, vf11.x | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | maddy.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.y()); vu.vi13 = vu.vf11.y_as_u16(); -// BRANCH! - // b L118 | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); bc = true; - // lqi.xyzw vf23, vi03 | maddy.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.y()); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L118; } - - - L103: -// BRANCH! - // ibgez vi09, L104 | mulaz.xyzw ACC, vf29, vf08 - vu.acc.mula_xyzw(vu.vf29, vu.vf08.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 - vu.acc.madda_xyzw(vu.vf30, vu.vf11.z()); sq_buffer_xyzw(vu.vf21, vu.vi11 + 2); - if (bc) { goto L104; } - - - // nop | ftoi4.xyzw vf21, vf09 - vu.vf21.ftoi4(Mask::xyzw, vu.vf09); - L104: - // mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 - vu.acc.madd_xyz(vu.vf11, vu.vf31, vu.vf14.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 - vu.vf12.mini_xyzw(vu.vf12, vu.vf17.y()); sq_buffer_xyzw(vu.vf15, vu.vi11); - // sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 - vu.vf10.mini(Mask::w, vu.vf10, vu.vf03.w()); sq_buffer_xyzw(vu.vf15, vu.vi14); - // sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 - vu.acc.mula_xyzw(vu.vf25, vu.vf08.w()); sq_buffer_xyzw(vu.vf21, vu.vi14 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf13, vf13, vf20 - vu.vf13.mul_xyzw(vu.vf13, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // 1024.0 | ftoi0.xyzw vf12, vf12 :i - vu.vf12.ftoi0(Mask::xyzw, vu.vf12); vu.I = 1024.0; - // erleng.xyz P, vf11 | maxi.xy vf10, vf10, I - vu.vf10.maxi(Mask::xy, vu.vf10, vu.I); vu.P = erleng(vu.vf11); /* TODO erleng */ -// BRANCH! - // ibne vi06, vi03, L105 | maddaw.xyzw ACC, vf26, vf11 - vu.acc.madda_xyzw(vu.vf26, vu.vf11.w()); bc = (vu.vi06 != vu.vi03); - // mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 - vu.acc.madd_xyzw(vu.vf08, vu.vf27, vu.vf14.w()); vu.vf14.z() = 1.f; - if (bc) { goto L105; } - - -// BRANCH! - // ibne vi07, vi03, L138 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L138; } - - -// BRANCH! - // b L153 | nop - bc = true; - // nop | nop - - if (bc) { goto L153; } - - - L105: - // 3072.0 | mulax.xyzw ACC, vf01, vf13 :i - vu.acc.mula_xyzw(vu.vf01, vu.vf13.x()); vu.I = 3072.0; - // lqi.xyzw vf09, vi01 | minii.xy vf10, vf10, I - vu.vf10.minii(Mask::xy, vu.vf10, vu.I); lq_buffer_xyzw(vu.vf09, vu.vi01++); - // sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 - vu.acc.madda_xyzw(vu.vf02, vu.vf13.y()); sq_buffer_xyzw(vu.vf12, vu.vi11 + 1); - // sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 - vu.acc.madd_xyzw(vu.vf13, vu.vf03, vu.vf13.z()); sq_buffer_xyzw(vu.vf12, vu.vi14 + 1); - // lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 - vu.vf08.add_xyzw(vu.vf08, vu.vf28); lq_buffer_xyzw(vu.vf12, vu.vi01++); - // lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 - vu.vf10.max(Mask::w, vu.vf10, vu.vf02.w()); lq_buffer_xyzw(vu.vf15, vu.vi01++); - // mtir vi11, vf09.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi11 = vu.vf09.x_as_u16(); - // mtir vi14, vf09.y | maxx.xyzw vf13, vf13, vf00 - vu.vf13.max_xyzw(vu.vf13, vu.vf00.x()); vu.vi14 = vu.vf09.y_as_u16(); - // nop | miniw.w vf08, vf08, vf01 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf01.w()); - // div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 - vu.vf09.add(Mask::zw, vu.vf09, vu.vf17); vu.Q = vu.vf01.w() / vu.vf08.w(); - - // move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 - vu.vf12.add_xyzw(vu.vf12, vu.vf18); vu.vf21.move_xyzw(vu.vf10); - // iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 - vu.vf15.add_xyzw(vu.vf15, vu.vf19); vu.vi11 = vu.vi11 & vu.vi05; - // nop | mulax.xyzw ACC, vf04, vf13 - vu.acc.mula_xyzw(vu.vf04, vu.vf13.x()); -// BRANCH! - // ibgtz vi09, L106 | madday.xyzw ACC, vf05, vf13 - vu.acc.madda_xyzw(vu.vf05, vu.vf13.y()); bc = ((s16)vu.vi09) > 0; - // iand vi14, vi14, vi05 | maddaz.xyzw ACC, vf06, vf13 - vu.acc.madda_xyzw(vu.vf06, vu.vf13.z()); vu.vi14 = vu.vi14 & vu.vi05; - if (bc) { goto L106; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L106: -// BRANCH! - // ibne vi05, vi11, L107 | maddw.xyzw vf13, vf07, vf00 - vu.acc.madd_xyzw(vu.vf13, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi11); - // ilw.x vi09, -9(vi01) | mul.xyz vf08, vf08, Q - vu.vf08.mul(Mask::xyz, vu.vf08, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L107; } - - - // mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi14 = vu.vf12.y_as_u16(); -// BRANCH! - // b L108 | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L108; } - - - L107: - // lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi11); - // nop | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); - // lq.xyzw vf25, 0(vi14) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf25, vu.vi14); - // lq.xyzw vf23, 1(vi11) | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi11 + 1); - // lq.xyzw vf26, 1(vi14) | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf26, vu.vi14 + 1); - // lq.xyzw vf20, 2(vi11) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 2); - // lq.xyzw vf27, 2(vi14) | maddy.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi14 + 2); - // lq.xyzw vf23, 3(vi11) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi11 + 3); - // lq.xyzw vf28, 3(vi14) | maddy.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi14 + 3); - // lq.xyzw vf20, 4(vi11) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 4); - // lq.xyz vf29, 4(vi14) | maddy.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi14 + 4); - // lq.xyzw vf23, 5(vi11) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi11 + 5); - // lq.xyz vf30, 5(vi14) | maddy.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi14 + 5); - // lq.xyzw vf20, 6(vi11) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 6); - // lq.xyzw vf31, 6(vi14) | maddy.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi14 + 6); - // mtir vi11, vf12.x | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | maddy.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.y()); vu.vi14 = vu.vf12.y_as_u16(); -// BRANCH! - // b L123 | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); bc = true; - // lqi.xyzw vf23, vi03 | maddy.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.y()); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L123; } - - - L108: -// BRANCH! - // ibgez vi09, L109 | mulaz.xyzw ACC, vf29, vf09 - vu.acc.mula_xyzw(vu.vf29, vu.vf09.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 - vu.acc.madda_xyzw(vu.vf30, vu.vf12.z()); sq_buffer_xyzw(vu.vf21, vu.vi12 + 2); - if (bc) { goto L109; } - - - // nop | ftoi4.xyzw vf21, vf10 - vu.vf21.ftoi4(Mask::xyzw, vu.vf10); - L109: - // mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 - vu.acc.madd_xyz(vu.vf12, vu.vf31, vu.vf15.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 - vu.vf13.mini_xyzw(vu.vf13, vu.vf17.y()); sq_buffer_xyzw(vu.vf16, vu.vi12); - // sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf03.w()); sq_buffer_xyzw(vu.vf16, vu.vi15); - // sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 - vu.acc.mula_xyzw(vu.vf25, vu.vf09.w()); sq_buffer_xyzw(vu.vf21, vu.vi15 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 - vu.vf11.mul_xyzw(vu.vf11, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // 1024.0 | ftoi0.xyzw vf13, vf13 :i - vu.vf13.ftoi0(Mask::xyzw, vu.vf13); vu.I = 1024.0; - // erleng.xyz P, vf12 | maxi.xy vf08, vf08, I - vu.vf08.maxi(Mask::xy, vu.vf08, vu.I); vu.P = erleng(vu.vf12); /* TODO erleng */ -// BRANCH! - // ibne vi06, vi03, L94 | maddaw.xyzw ACC, vf26, vf12 - vu.acc.madda_xyzw(vu.vf26, vu.vf12.w()); bc = (vu.vi06 != vu.vi03); - // mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 - vu.acc.madd_xyzw(vu.vf09, vu.vf27, vu.vf15.w()); vu.vf15.z() = 1.f; - if (bc) { goto L94; } - - -// BRANCH! - // ibne vi07, vi03, L127 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L127; } - - -// BRANCH! - // b L163 | nop - bc = true; - // nop | nop - - if (bc) { goto L163; } - - - L110: - // 3072.0 | mulax.xyzw ACC, vf01, vf11 :i - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); vu.I = 3072.0; - // lqi.xyzw vf10, vi01 | minii.xy vf08, vf08, I - vu.vf08.minii(Mask::xy, vu.vf08, vu.I); lq_buffer_xyzw(vu.vf10, vu.vi01++); - // sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); sq_buffer_xyzw(vu.vf13, vu.vi12 + 1); - // sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); sq_buffer_xyzw(vu.vf13, vu.vi15 + 1); - JUMP_539: - // lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 - vu.vf09.add_xyzw(vu.vf09, vu.vf28); lq_buffer_xyzw(vu.vf13, vu.vi01++); - // lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 - vu.vf08.max(Mask::w, vu.vf08, vu.vf02.w()); lq_buffer_xyzw(vu.vf16, vu.vi01++); - // mtir vi12, vf10.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi12 = vu.vf10.x_as_u16(); - // mtir vi15, vf10.y | maxx.xyzw vf11, vf11, vf00 - vu.vf11.max_xyzw(vu.vf11, vu.vf00.x()); vu.vi15 = vu.vf10.y_as_u16(); - // nop | miniw.w vf09, vf09, vf01 - vu.vf09.mini(Mask::w, vu.vf09, vu.vf01.w()); - // div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 - vu.vf10.add(Mask::zw, vu.vf10, vu.vf17); vu.Q = vu.vf01.w() / vu.vf09.w(); - - // move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 - vu.vf13.add_xyzw(vu.vf13, vu.vf18); vu.vf21.move_xyzw(vu.vf08); - // iand vi12, vi12, vi05 | add.xyzw vf16, vf16, vf19 - vu.vf16.add_xyzw(vu.vf16, vu.vf19); vu.vi12 = vu.vi12 & vu.vi05; - // nop | mulax.xyzw ACC, vf04, vf11 - vu.acc.mula_xyzw(vu.vf04, vu.vf11.x()); -// BRANCH! - // ibgtz vi09, L111 | madday.xyzw ACC, vf05, vf11 - vu.acc.madda_xyzw(vu.vf05, vu.vf11.y()); bc = ((s16)vu.vi09) > 0; - // iand vi15, vi15, vi05 | maddaz.xyzw ACC, vf06, vf11 - vu.acc.madda_xyzw(vu.vf06, vu.vf11.z()); vu.vi15 = vu.vi15 & vu.vi05; - if (bc) { goto L111; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L111: -// BRANCH! - // ibne vi05, vi12, L112 | maddw.xyzw vf11, vf07, vf00 - vu.acc.madd_xyzw(vu.vf11, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi12); - // ilw.x vi09, -9(vi01) | mul.xyz vf09, vf09, Q - vu.vf09.mul(Mask::xyz, vu.vf09, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L112; } - - - // mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ vu.vi12 = vu.vf13.x_as_u16(); - // mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi15 = vu.vf13.y_as_u16(); -// BRANCH! - // b L113 | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L113; } - - - L112: - // lq.xyzw vf20, 0(vi12) | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi12); - // lq.xyzw vf25, 0(vi15) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf25, vu.vi15); - // lq.xyzw vf23, 1(vi12) | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi12 + 1); - // lq.xyzw vf26, 1(vi15) | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf26, vu.vi15 + 1); - // lq.xyzw vf20, 2(vi12) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 2); - // lq.xyzw vf27, 2(vi15) | maddw.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.w()); lq_buffer_xyzw(vu.vf27, vu.vi15 + 2); - // lq.xyzw vf23, 3(vi12) | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi12 + 3); - // lq.xyzw vf28, 3(vi15) | maddw.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.w()); lq_buffer_xyzw(vu.vf28, vu.vi15 + 3); - // lq.xyzw vf20, 4(vi12) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 4); - // lq.xyz vf29, 4(vi15) | maddw.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.w()); lq_buffer_xyz(vu.vf29, vu.vi15 + 4); - // lq.xyzw vf23, 5(vi12) | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi12 + 5); - // lq.xyz vf30, 5(vi15) | maddw.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.w()); lq_buffer_xyz(vu.vf30, vu.vi15 + 5); - // lq.xyzw vf20, 6(vi12) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 6); - // lq.xyzw vf31, 6(vi15) | maddw.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.w()); lq_buffer_xyzw(vu.vf31, vu.vi15 + 6); - // lqi.xyzw vf23, vi02 | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi12, vf13.x | maddw.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.w()); vu.vi12 = vu.vf13.x_as_u16(); - // mtir vi15, vf13.y | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); vu.vi15 = vu.vf13.y_as_u16(); -// BRANCH! - // b L98 | maddw.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.w()); bc = true; - // lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L98; } - - - L113: -// BRANCH! - // ibgez vi09, L114 | mulaz.xyzw ACC, vf29, vf10 - vu.acc.mula_xyzw(vu.vf29, vu.vf10.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 - vu.acc.madda_xyzw(vu.vf30, vu.vf13.z()); sq_buffer_xyzw(vu.vf21, vu.vi10 + 2); - if (bc) { goto L114; } - - - // nop | ftoi4.xyzw vf21, vf08 - vu.vf21.ftoi4(Mask::xyzw, vu.vf08); - L114: - // mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 - vu.acc.madd_xyz(vu.vf13, vu.vf31, vu.vf16.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 - vu.vf11.mini_xyzw(vu.vf11, vu.vf17.y()); sq_buffer_xyzw(vu.vf14, vu.vi10); - // sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 - vu.vf09.mini(Mask::w, vu.vf09, vu.vf03.w()); sq_buffer_xyzw(vu.vf14, vu.vi13); - // sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 - vu.acc.mula_xyzw(vu.vf25, vu.vf10.w()); sq_buffer_xyzw(vu.vf21, vu.vi13 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf12, vf12, vf20 - vu.vf12.mul_xyzw(vu.vf12, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // 1024.0 | ftoi0.xyzw vf11, vf11 :i - vu.vf11.ftoi0(Mask::xyzw, vu.vf11); vu.I = 1024.0; - // erleng.xyz P, vf13 | maxi.xy vf09, vf09, I - vu.vf09.maxi(Mask::xy, vu.vf09, vu.I); vu.P = erleng(vu.vf13); /* TODO erleng */ -// BRANCH! - // ibne vi06, vi03, L115 | maddaw.xyzw ACC, vf26, vf13 - vu.acc.madda_xyzw(vu.vf26, vu.vf13.w()); bc = (vu.vi06 != vu.vi03); - // mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 - vu.acc.madd_xyzw(vu.vf10, vu.vf27, vu.vf16.w()); vu.vf16.z() = 1.f; - if (bc) { goto L115; } - - -// BRANCH! - // ibne vi07, vi03, L133 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L133; } - - -// BRANCH! - // b L143 | nop - bc = true; - // nop | nop - - if (bc) { goto L143; } - - - L115: - // 3072.0 | mulax.xyzw ACC, vf01, vf12 :i - vu.acc.mula_xyzw(vu.vf01, vu.vf12.x()); vu.I = 3072.0; - // lqi.xyzw vf08, vi01 | minii.xy vf09, vf09, I - vu.vf09.minii(Mask::xy, vu.vf09, vu.I); lq_buffer_xyzw(vu.vf08, vu.vi01++); - // sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 - vu.acc.madda_xyzw(vu.vf02, vu.vf12.y()); sq_buffer_xyzw(vu.vf11, vu.vi10 + 1); - // sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 - vu.acc.madd_xyzw(vu.vf12, vu.vf03, vu.vf12.z()); sq_buffer_xyzw(vu.vf11, vu.vi13 + 1); - // lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 - vu.vf10.add_xyzw(vu.vf10, vu.vf28); lq_buffer_xyzw(vu.vf11, vu.vi01++); - // lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 - vu.vf09.max(Mask::w, vu.vf09, vu.vf02.w()); lq_buffer_xyzw(vu.vf14, vu.vi01++); - // mtir vi10, vf08.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi10 = vu.vf08.x_as_u16(); - // mtir vi13, vf08.y | maxx.xyzw vf12, vf12, vf00 - vu.vf12.max_xyzw(vu.vf12, vu.vf00.x()); vu.vi13 = vu.vf08.y_as_u16(); - // nop | miniw.w vf10, vf10, vf01 - vu.vf10.mini(Mask::w, vu.vf10, vu.vf01.w()); - // div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 - vu.vf08.add(Mask::zw, vu.vf08, vu.vf17); vu.Q = vu.vf01.w() / vu.vf10.w(); - - // move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 - vu.vf11.add_xyzw(vu.vf11, vu.vf18); vu.vf21.move_xyzw(vu.vf09); - // iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 - vu.vf14.add_xyzw(vu.vf14, vu.vf19); vu.vi10 = vu.vi10 & vu.vi05; - // nop | mulax.xyzw ACC, vf04, vf12 - vu.acc.mula_xyzw(vu.vf04, vu.vf12.x()); -// BRANCH! - // ibgtz vi09, L116 | madday.xyzw ACC, vf05, vf12 - vu.acc.madda_xyzw(vu.vf05, vu.vf12.y()); bc = ((s16)vu.vi09) > 0; - // iand vi13, vi13, vi05 | maddaz.xyzw ACC, vf06, vf12 - vu.acc.madda_xyzw(vu.vf06, vu.vf12.z()); vu.vi13 = vu.vi13 & vu.vi05; - if (bc) { goto L116; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L116: -// BRANCH! - // ibne vi05, vi10, L117 | maddw.xyzw vf12, vf07, vf00 - vu.acc.madd_xyzw(vu.vf12, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi10); - // ilw.x vi09, -9(vi01) | mul.xyz vf10, vf10, Q - vu.vf10.mul(Mask::xyz, vu.vf10, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L117; } - - - // mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi13 = vu.vf11.y_as_u16(); -// BRANCH! - // b L118 | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L118; } - - - L117: - // lq.xyzw vf20, 0(vi10) | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi10); - // lq.xyzw vf25, 0(vi13) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf25, vu.vi13); - // lq.xyzw vf23, 1(vi10) | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi10 + 1); - // lq.xyzw vf26, 1(vi13) | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf26, vu.vi13 + 1); - // lq.xyzw vf20, 2(vi10) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 2); - // lq.xyzw vf27, 2(vi13) | maddw.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.w()); lq_buffer_xyzw(vu.vf27, vu.vi13 + 2); - // lq.xyzw vf23, 3(vi10) | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi10 + 3); - // lq.xyzw vf28, 3(vi13) | maddw.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.w()); lq_buffer_xyzw(vu.vf28, vu.vi13 + 3); - // lq.xyzw vf20, 4(vi10) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 4); - // lq.xyz vf29, 4(vi13) | maddw.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.w()); lq_buffer_xyz(vu.vf29, vu.vi13 + 4); - // lq.xyzw vf23, 5(vi10) | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi10 + 5); - // lq.xyz vf30, 5(vi13) | maddw.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.w()); lq_buffer_xyz(vu.vf30, vu.vi13 + 5); - // lq.xyzw vf20, 6(vi10) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 6); - // lq.xyzw vf31, 6(vi13) | maddw.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.w()); lq_buffer_xyzw(vu.vf31, vu.vi13 + 6); - // lqi.xyzw vf23, vi02 | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi10, vf11.x | maddw.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.w()); vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); vu.vi13 = vu.vf11.y_as_u16(); -// BRANCH! - // b L103 | maddw.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.w()); bc = true; - // lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L103; } - - - L118: -// BRANCH! - // ibgez vi09, L119 | mulaz.xyzw ACC, vf29, vf08 - vu.acc.mula_xyzw(vu.vf29, vu.vf08.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 - vu.acc.madda_xyzw(vu.vf30, vu.vf11.z()); sq_buffer_xyzw(vu.vf21, vu.vi11 + 2); - if (bc) { goto L119; } - - - // nop | ftoi4.xyzw vf21, vf09 - vu.vf21.ftoi4(Mask::xyzw, vu.vf09); - L119: - // mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 - vu.acc.madd_xyz(vu.vf11, vu.vf31, vu.vf14.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 - vu.vf12.mini_xyzw(vu.vf12, vu.vf17.y()); sq_buffer_xyzw(vu.vf15, vu.vi11); - // sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 - vu.vf10.mini(Mask::w, vu.vf10, vu.vf03.w()); sq_buffer_xyzw(vu.vf15, vu.vi14); - // sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 - vu.acc.mula_xyzw(vu.vf25, vu.vf08.w()); sq_buffer_xyzw(vu.vf21, vu.vi14 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf13, vf13, vf20 - vu.vf13.mul_xyzw(vu.vf13, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // 1024.0 | ftoi0.xyzw vf12, vf12 :i - vu.vf12.ftoi0(Mask::xyzw, vu.vf12); vu.I = 1024.0; - // erleng.xyz P, vf11 | maxi.xy vf10, vf10, I - vu.vf10.maxi(Mask::xy, vu.vf10, vu.I); vu.P = erleng(vu.vf11); /* TODO erleng */ -// BRANCH! - // ibne vi06, vi03, L120 | maddaw.xyzw ACC, vf26, vf11 - vu.acc.madda_xyzw(vu.vf26, vu.vf11.w()); bc = (vu.vi06 != vu.vi03); - // mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 - vu.acc.madd_xyzw(vu.vf08, vu.vf27, vu.vf14.w()); vu.vf14.z() = 1.f; - if (bc) { goto L120; } - - -// BRANCH! - // ibne vi07, vi03, L138 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L138; } - - -// BRANCH! - // b L153 | nop - bc = true; - // nop | nop - - if (bc) { goto L153; } - - - L120: - // 3072.0 | mulax.xyzw ACC, vf01, vf13 :i - vu.acc.mula_xyzw(vu.vf01, vu.vf13.x()); vu.I = 3072.0; - // lqi.xyzw vf09, vi01 | minii.xy vf10, vf10, I - vu.vf10.minii(Mask::xy, vu.vf10, vu.I); lq_buffer_xyzw(vu.vf09, vu.vi01++); - // sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 - vu.acc.madda_xyzw(vu.vf02, vu.vf13.y()); sq_buffer_xyzw(vu.vf12, vu.vi11 + 1); - // sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 - vu.acc.madd_xyzw(vu.vf13, vu.vf03, vu.vf13.z()); sq_buffer_xyzw(vu.vf12, vu.vi14 + 1); - // lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 - vu.vf08.add_xyzw(vu.vf08, vu.vf28); lq_buffer_xyzw(vu.vf12, vu.vi01++); - // lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 - vu.vf10.max(Mask::w, vu.vf10, vu.vf02.w()); lq_buffer_xyzw(vu.vf15, vu.vi01++); - // mtir vi11, vf09.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi11 = vu.vf09.x_as_u16(); - // mtir vi14, vf09.y | maxx.xyzw vf13, vf13, vf00 - vu.vf13.max_xyzw(vu.vf13, vu.vf00.x()); vu.vi14 = vu.vf09.y_as_u16(); - // nop | miniw.w vf08, vf08, vf01 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf01.w()); - // div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 - vu.vf09.add(Mask::zw, vu.vf09, vu.vf17); vu.Q = vu.vf01.w() / vu.vf08.w(); - - // move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 - vu.vf12.add_xyzw(vu.vf12, vu.vf18); vu.vf21.move_xyzw(vu.vf10); - // iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 - vu.vf15.add_xyzw(vu.vf15, vu.vf19); vu.vi11 = vu.vi11 & vu.vi05; - // nop | mulax.xyzw ACC, vf04, vf13 - vu.acc.mula_xyzw(vu.vf04, vu.vf13.x()); -// BRANCH! - // ibgtz vi09, L121 | madday.xyzw ACC, vf05, vf13 - vu.acc.madda_xyzw(vu.vf05, vu.vf13.y()); bc = ((s16)vu.vi09) > 0; - // iand vi14, vi14, vi05 | maddaz.xyzw ACC, vf06, vf13 - vu.acc.madda_xyzw(vu.vf06, vu.vf13.z()); vu.vi14 = vu.vi14 & vu.vi05; - if (bc) { goto L121; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L121: -// BRANCH! - // ibne vi05, vi11, L122 | maddw.xyzw vf13, vf07, vf00 - vu.acc.madd_xyzw(vu.vf13, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi11); - // ilw.x vi09, -9(vi01) | mul.xyz vf08, vf08, Q - vu.vf08.mul(Mask::xyz, vu.vf08, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L122; } - - - // mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi14 = vu.vf12.y_as_u16(); -// BRANCH! - // b L123 | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L123; } - - - L122: - // lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi11); - // lq.xyzw vf25, 0(vi14) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf25, vu.vi14); - // lq.xyzw vf23, 1(vi11) | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi11 + 1); - // lq.xyzw vf26, 1(vi14) | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf26, vu.vi14 + 1); - // lq.xyzw vf20, 2(vi11) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 2); - // lq.xyzw vf27, 2(vi14) | maddw.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.w()); lq_buffer_xyzw(vu.vf27, vu.vi14 + 2); - // lq.xyzw vf23, 3(vi11) | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi11 + 3); - // lq.xyzw vf28, 3(vi14) | maddw.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.w()); lq_buffer_xyzw(vu.vf28, vu.vi14 + 3); - // lq.xyzw vf20, 4(vi11) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 4); - // lq.xyz vf29, 4(vi14) | maddw.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.w()); lq_buffer_xyz(vu.vf29, vu.vi14 + 4); - // lq.xyzw vf23, 5(vi11) | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi11 + 5); - // lq.xyz vf30, 5(vi14) | maddw.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.w()); lq_buffer_xyz(vu.vf30, vu.vi14 + 5); - // lq.xyzw vf20, 6(vi11) | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 6); - // lq.xyzw vf31, 6(vi14) | maddw.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.w()); lq_buffer_xyzw(vu.vf31, vu.vi14 + 6); - // lqi.xyzw vf23, vi02 | mulaz.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi11, vf12.x | maddw.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.w()); vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | mulaz.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.z()); vu.vi14 = vu.vf12.y_as_u16(); -// BRANCH! - // b L108 | maddw.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.w()); bc = true; - // lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L108; } - - - L123: -// BRANCH! - // ibgez vi09, L124 | mulaz.xyzw ACC, vf29, vf09 - vu.acc.mula_xyzw(vu.vf29, vu.vf09.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 - vu.acc.madda_xyzw(vu.vf30, vu.vf12.z()); sq_buffer_xyzw(vu.vf21, vu.vi12 + 2); - if (bc) { goto L124; } - - - // nop | ftoi4.xyzw vf21, vf10 - vu.vf21.ftoi4(Mask::xyzw, vu.vf10); - L124: - // mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 - vu.acc.madd_xyz(vu.vf12, vu.vf31, vu.vf15.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 - vu.vf13.mini_xyzw(vu.vf13, vu.vf17.y()); sq_buffer_xyzw(vu.vf16, vu.vi12); - // sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf03.w()); sq_buffer_xyzw(vu.vf16, vu.vi15); - // sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 - vu.acc.mula_xyzw(vu.vf25, vu.vf09.w()); sq_buffer_xyzw(vu.vf21, vu.vi15 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 - vu.vf11.mul_xyzw(vu.vf11, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // 1024.0 | ftoi0.xyzw vf13, vf13 :i - vu.vf13.ftoi0(Mask::xyzw, vu.vf13); vu.I = 1024.0; - // erleng.xyz P, vf12 | maxi.xy vf08, vf08, I - vu.vf08.maxi(Mask::xy, vu.vf08, vu.I); vu.P = erleng(vu.vf12); /* TODO erleng */ -// BRANCH! - // ibne vi06, vi03, L110 | maddaw.xyzw ACC, vf26, vf12 - vu.acc.madda_xyzw(vu.vf26, vu.vf12.w()); bc = (vu.vi06 != vu.vi03); - // mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 - vu.acc.madd_xyzw(vu.vf09, vu.vf27, vu.vf15.w()); vu.vf15.z() = 1.f; - if (bc) { goto L110; } - - -// BRANCH! - // ibne vi07, vi03, L133 | nop - bc = (vu.vi07 != vu.vi03); - // nop | nop - - if (bc) { goto L133; } - - -// BRANCH! - // b L163 | nop - bc = true; - // nop | nop - - if (bc) { goto L163; } - - - L125: - // erleng.xyz P, vf12 | maxi.xy vf08, vf08, I - vu.vf08.maxi(Mask::xy, vu.vf08, vu.I); vu.P = erleng(vu.vf12); /* TODO erleng */ - // 3072.0 | nop :i - vu.I = 3072.0; - // nop | minii.xy vf08, vf08, I - vu.vf08.minii(Mask::xy, vu.vf08, vu.I); - // nop | maddaw.xyzw ACC, vf26, vf12 - vu.acc.madda_xyzw(vu.vf26, vu.vf12.w()); - // mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 - vu.acc.madd_xyzw(vu.vf09, vu.vf27, vu.vf15.w()); vu.vf15.z() = 1.f; - L126: - // lqi.xyzw vf10, vi01 | mulax.xyzw ACC, vf01, vf11 - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); lq_buffer_xyzw(vu.vf10, vu.vi01++); -// BRANCH! - // b L128 | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); bc = true; - // nop | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); - if (bc) { goto L128; } - - - L127: - // 3072.0 | mulax.xyzw ACC, vf01, vf11 :i - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); vu.I = 3072.0; - // lqi.xyzw vf10, vi01 | minii.xy vf08, vf08, I - vu.vf08.minii(Mask::xy, vu.vf08, vu.I); lq_buffer_xyzw(vu.vf10, vu.vi01++); - // sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); sq_buffer_xyzw(vu.vf13, vu.vi12 + 1); - // sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); sq_buffer_xyzw(vu.vf13, vu.vi15 + 1); - L128: - // lqi.xyzw vf13, vi01 | add.xyzw vf09, vf09, vf28 - vu.vf09.add_xyzw(vu.vf09, vu.vf28); lq_buffer_xyzw(vu.vf13, vu.vi01++); - // lqi.xyzw vf16, vi01 | maxw.w vf08, vf08, vf02 - vu.vf08.max(Mask::w, vu.vf08, vu.vf02.w()); lq_buffer_xyzw(vu.vf16, vu.vi01++); - // mtir vi12, vf10.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi12 = vu.vf10.x_as_u16(); - // mtir vi15, vf10.y | maxx.xyzw vf11, vf11, vf00 - vu.vf11.max_xyzw(vu.vf11, vu.vf00.x()); vu.vi15 = vu.vf10.y_as_u16(); - // nop | miniw.w vf09, vf09, vf01 - vu.vf09.mini(Mask::w, vu.vf09, vu.vf01.w()); - // div Q, vf01.w, vf09.w | add.zw vf10, vf10, vf17 - vu.vf10.add(Mask::zw, vu.vf10, vu.vf17); vu.Q = vu.vf01.w() / vu.vf09.w(); - - // move.xyzw vf21, vf08 | add.xyzw vf13, vf13, vf18 - vu.vf13.add_xyzw(vu.vf13, vu.vf18); vu.vf21.move_xyzw(vu.vf08); - // iand vi12, vi12, vi05 | add.xyzw vf16, vf16, vf19 - vu.vf16.add_xyzw(vu.vf16, vu.vf19); vu.vi12 = vu.vi12 & vu.vi05; - // ilw.w vi08, -1(vi02) | mulax.xyzw ACC, vf04, vf11 - vu.acc.mula_xyzw(vu.vf04, vu.vf11.x()); ilw_buffer(Mask::w, vu.vi08, vu.vi02 + -1); -// BRANCH! - // ibgtz vi09, L129 | madday.xyzw ACC, vf05, vf11 - vu.acc.madda_xyzw(vu.vf05, vu.vf11.y()); bc = ((s16)vu.vi09) > 0; - // iand vi15, vi15, vi05 | maddaz.xyzw ACC, vf06, vf11 - vu.acc.madda_xyzw(vu.vf06, vu.vf11.z()); vu.vi15 = vu.vi15 & vu.vi05; - if (bc) { goto L129; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L129: -// BRANCH! - // ibne vi05, vi12, L130 | maddw.xyzw vf11, vf07, vf00 - vu.acc.madd_xyzw(vu.vf11, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi12); - // ilw.x vi09, -9(vi01) | mul.xyz vf09, vf09, Q - vu.vf09.mul(Mask::xyz, vu.vf09, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L130; } - - - // mtir vi12, vf13.x | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ vu.vi12 = vu.vf13.x_as_u16(); - // mtir vi15, vf13.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi15 = vu.vf13.y_as_u16(); -// BRANCH! - // b L131 | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L131; } - - - L130: - // lq.xyzw vf20, 0(vi12) | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi12); - // nop | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); - // lq.xyzw vf31, 0(vi15) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf31, vu.vi15); - // lq.xyzw vf25, 0(vi08) | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf23, 1(vi12) | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi12 + 1); - // lq.xyzw vf20, 1(vi15) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi15 + 1); - // lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // lq.xyzw vf31, 2(vi12) | maddz.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi12 + 2); - // lq.xyzw vf23, 2(vi15) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi15 + 2); - // lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lq.xyzw vf20, 3(vi12) | maddz.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 3); - // lq.xyzw vf31, 3(vi15) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf31, vu.vi15 + 3); - // lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // lq.xyzw vf23, 4(vi12) | maddz.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi12 + 4); - // lq.xyzw vf20, 4(vi15) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi15 + 4); - // lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyzw vf31, 5(vi12) | maddz.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi12 + 5); - // lq.xyzw vf23, 5(vi15) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi15 + 5); - // lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); - // lq.xyzw vf20, 6(vi12) | maddz.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi12 + 6); - // lq.xyzw vf22, 6(vi15) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf22, vu.vi15 + 6); - // lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - // lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi12, vf13.x | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); vu.vi12 = vu.vf13.x_as_u16(); - // mtir vi15, vf13.y | madday.xyzw ACC, vf22, vf24 - vu.acc.madda_xyzw(vu.vf22, vu.vf24.y()); vu.vi15 = vu.vf13.y_as_u16(); - // lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.z()); lq_buffer_xyzw(vu.vf22, 2); - // lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi03++); - L131: -// BRANCH! - // ibgez vi09, L132 | mulaz.xyzw ACC, vf29, vf10 - vu.acc.mula_xyzw(vu.vf29, vu.vf10.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi10) | maddaz.xyzw ACC, vf30, vf13 - vu.acc.madda_xyzw(vu.vf30, vu.vf13.z()); sq_buffer_xyzw(vu.vf21, vu.vi10 + 2); - if (bc) { goto L132; } - - - // nop | ftoi4.xyzw vf21, vf08 - vu.vf21.ftoi4(Mask::xyzw, vu.vf08); - L132: - // mfp.w vf20, P | maddz.xyz vf13, vf31, vf16 - vu.acc.madd_xyz(vu.vf13, vu.vf31, vu.vf16.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 - vu.vf11.mini_xyzw(vu.vf11, vu.vf17.y()); sq_buffer_xyzw(vu.vf14, vu.vi10); - // sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 - vu.vf09.mini(Mask::w, vu.vf09, vu.vf03.w()); sq_buffer_xyzw(vu.vf14, vu.vi13); - // sq.xyzw vf21, 2(vi13) | mulaw.xyzw ACC, vf25, vf10 - vu.acc.mula_xyzw(vu.vf25, vu.vf10.w()); sq_buffer_xyzw(vu.vf21, vu.vi13 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf12, vf12, vf20 - vu.vf12.mul_xyzw(vu.vf12, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // 1024.0 | ftoi0.xyzw vf11, vf11 :i - vu.vf11.ftoi0(Mask::xyzw, vu.vf11); vu.I = 1024.0; - // erleng.xyz P, vf13 | maxi.xy vf09, vf09, I - vu.vf09.maxi(Mask::xy, vu.vf09, vu.I); vu.P = erleng(vu.vf13); /* TODO erleng */ -// BRANCH! - // ibeq vi07, vi03, L143 | maddaw.xyzw ACC, vf26, vf13 - vu.acc.madda_xyzw(vu.vf26, vu.vf13.w()); bc = (vu.vi07 == vu.vi03); - // mr32.z vf16, vf00 | maddw.xyzw vf10, vf27, vf16 - vu.acc.madd_xyzw(vu.vf10, vu.vf27, vu.vf16.w()); vu.vf16.z() = 1.f; - if (bc) { goto L143; } - - - L133: - // 3072.0 | mulax.xyzw ACC, vf01, vf12 :i - vu.acc.mula_xyzw(vu.vf01, vu.vf12.x()); vu.I = 3072.0; - // lqi.xyzw vf08, vi01 | minii.xy vf09, vf09, I - vu.vf09.minii(Mask::xy, vu.vf09, vu.I); lq_buffer_xyzw(vu.vf08, vu.vi01++); - // sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 - vu.acc.madda_xyzw(vu.vf02, vu.vf12.y()); sq_buffer_xyzw(vu.vf11, vu.vi10 + 1); - // sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 - vu.acc.madd_xyzw(vu.vf12, vu.vf03, vu.vf12.z()); sq_buffer_xyzw(vu.vf11, vu.vi13 + 1); - // lqi.xyzw vf11, vi01 | add.xyzw vf10, vf10, vf28 - vu.vf10.add_xyzw(vu.vf10, vu.vf28); lq_buffer_xyzw(vu.vf11, vu.vi01++); - // lqi.xyzw vf14, vi01 | maxw.w vf09, vf09, vf02 - vu.vf09.max(Mask::w, vu.vf09, vu.vf02.w()); lq_buffer_xyzw(vu.vf14, vu.vi01++); - // mtir vi10, vf08.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi10 = vu.vf08.x_as_u16(); - // mtir vi13, vf08.y | maxx.xyzw vf12, vf12, vf00 - vu.vf12.max_xyzw(vu.vf12, vu.vf00.x()); vu.vi13 = vu.vf08.y_as_u16(); - // nop | miniw.w vf10, vf10, vf01 - vu.vf10.mini(Mask::w, vu.vf10, vu.vf01.w()); - // div Q, vf01.w, vf10.w | add.zw vf08, vf08, vf17 - vu.vf08.add(Mask::zw, vu.vf08, vu.vf17); vu.Q = vu.vf01.w() / vu.vf10.w(); - - // move.xyzw vf21, vf09 | add.xyzw vf11, vf11, vf18 - vu.vf11.add_xyzw(vu.vf11, vu.vf18); vu.vf21.move_xyzw(vu.vf09); - // iand vi10, vi10, vi05 | add.xyzw vf14, vf14, vf19 - vu.vf14.add_xyzw(vu.vf14, vu.vf19); vu.vi10 = vu.vi10 & vu.vi05; - // ilw.w vi08, -1(vi02) | mulax.xyzw ACC, vf04, vf12 - vu.acc.mula_xyzw(vu.vf04, vu.vf12.x()); ilw_buffer(Mask::w, vu.vi08, vu.vi02 + -1); -// BRANCH! - // ibgtz vi09, L134 | madday.xyzw ACC, vf05, vf12 - vu.acc.madda_xyzw(vu.vf05, vu.vf12.y()); bc = ((s16)vu.vi09) > 0; - // iand vi13, vi13, vi05 | maddaz.xyzw ACC, vf06, vf12 - vu.acc.madda_xyzw(vu.vf06, vu.vf12.z()); vu.vi13 = vu.vi13 & vu.vi05; - if (bc) { goto L134; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L134: -// BRANCH! - // ibne vi05, vi10, L135 | maddw.xyzw vf12, vf07, vf00 - vu.acc.madd_xyzw(vu.vf12, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi10); - // ilw.x vi09, -9(vi01) | mul.xyz vf10, vf10, Q - vu.vf10.mul(Mask::xyz, vu.vf10, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L135; } - - - // mtir vi10, vf11.x | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi13 = vu.vf11.y_as_u16(); -// BRANCH! - // b L136 | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L136; } - - - L135: - // lq.xyzw vf20, 0(vi10) | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi10); - // nop | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); - // lq.xyzw vf31, 0(vi13) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf31, vu.vi13); - // lq.xyzw vf25, 0(vi08) | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf23, 1(vi10) | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi10 + 1); - // lq.xyzw vf20, 1(vi13) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi13 + 1); - // lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // lq.xyzw vf31, 2(vi10) | maddz.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi10 + 2); - // lq.xyzw vf23, 2(vi13) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi13 + 2); - // lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lq.xyzw vf20, 3(vi10) | maddz.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 3); - // lq.xyzw vf31, 3(vi13) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf31, vu.vi13 + 3); - // lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // lq.xyzw vf23, 4(vi10) | maddz.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi10 + 4); - // lq.xyzw vf20, 4(vi13) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi13 + 4); - // lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyzw vf31, 5(vi10) | maddz.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi10 + 5); - // lq.xyzw vf23, 5(vi13) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi13 + 5); - // lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); - // lq.xyzw vf20, 6(vi10) | maddz.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi10 + 6); - // lq.xyzw vf22, 6(vi13) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf22, vu.vi13 + 6); - // lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - // lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi10, vf11.x | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); vu.vi10 = vu.vf11.x_as_u16(); - // mtir vi13, vf11.y | madday.xyzw ACC, vf22, vf24 - vu.acc.madda_xyzw(vu.vf22, vu.vf24.y()); vu.vi13 = vu.vf11.y_as_u16(); - // lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.z()); lq_buffer_xyzw(vu.vf22, 2); - // lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi03++); - L136: -// BRANCH! - // ibgez vi09, L137 | mulaz.xyzw ACC, vf29, vf08 - vu.acc.mula_xyzw(vu.vf29, vu.vf08.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi11) | maddaz.xyzw ACC, vf30, vf11 - vu.acc.madda_xyzw(vu.vf30, vu.vf11.z()); sq_buffer_xyzw(vu.vf21, vu.vi11 + 2); - if (bc) { goto L137; } - - - // nop | ftoi4.xyzw vf21, vf09 - vu.vf21.ftoi4(Mask::xyzw, vu.vf09); - L137: - // mfp.w vf20, P | maddz.xyz vf11, vf31, vf14 - vu.acc.madd_xyz(vu.vf11, vu.vf31, vu.vf14.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 - vu.vf12.mini_xyzw(vu.vf12, vu.vf17.y()); sq_buffer_xyzw(vu.vf15, vu.vi11); - // sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 - vu.vf10.mini(Mask::w, vu.vf10, vu.vf03.w()); sq_buffer_xyzw(vu.vf15, vu.vi14); - // sq.xyzw vf21, 2(vi14) | mulaw.xyzw ACC, vf25, vf08 - vu.acc.mula_xyzw(vu.vf25, vu.vf08.w()); sq_buffer_xyzw(vu.vf21, vu.vi14 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf13, vf13, vf20 - vu.vf13.mul_xyzw(vu.vf13, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // 1024.0 | ftoi0.xyzw vf12, vf12 :i - vu.vf12.ftoi0(Mask::xyzw, vu.vf12); vu.I = 1024.0; - // erleng.xyz P, vf11 | maxi.xy vf10, vf10, I - vu.vf10.maxi(Mask::xy, vu.vf10, vu.I); vu.P = erleng(vu.vf11); /* TODO erleng */ -// BRANCH! - // ibeq vi07, vi03, L153 | maddaw.xyzw ACC, vf26, vf11 - vu.acc.madda_xyzw(vu.vf26, vu.vf11.w()); bc = (vu.vi07 == vu.vi03); - // mr32.z vf14, vf00 | maddw.xyzw vf08, vf27, vf14 - vu.acc.madd_xyzw(vu.vf08, vu.vf27, vu.vf14.w()); vu.vf14.z() = 1.f; - if (bc) { goto L153; } - - - L138: - // 3072.0 | mulax.xyzw ACC, vf01, vf13 :i - vu.acc.mula_xyzw(vu.vf01, vu.vf13.x()); vu.I = 3072.0; - // lqi.xyzw vf09, vi01 | minii.xy vf10, vf10, I - vu.vf10.minii(Mask::xy, vu.vf10, vu.I); lq_buffer_xyzw(vu.vf09, vu.vi01++); - // sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 - vu.acc.madda_xyzw(vu.vf02, vu.vf13.y()); sq_buffer_xyzw(vu.vf12, vu.vi11 + 1); - // sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 - vu.acc.madd_xyzw(vu.vf13, vu.vf03, vu.vf13.z()); sq_buffer_xyzw(vu.vf12, vu.vi14 + 1); - // lqi.xyzw vf12, vi01 | add.xyzw vf08, vf08, vf28 - vu.vf08.add_xyzw(vu.vf08, vu.vf28); lq_buffer_xyzw(vu.vf12, vu.vi01++); - // lqi.xyzw vf15, vi01 | maxw.w vf10, vf10, vf02 - vu.vf10.max(Mask::w, vu.vf10, vu.vf02.w()); lq_buffer_xyzw(vu.vf15, vu.vi01++); - // mtir vi11, vf09.x | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); vu.vi11 = vu.vf09.x_as_u16(); - // mtir vi14, vf09.y | maxx.xyzw vf13, vf13, vf00 - vu.vf13.max_xyzw(vu.vf13, vu.vf00.x()); vu.vi14 = vu.vf09.y_as_u16(); - // nop | miniw.w vf08, vf08, vf01 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf01.w()); - // div Q, vf01.w, vf08.w | add.zw vf09, vf09, vf17 - vu.vf09.add(Mask::zw, vu.vf09, vu.vf17); vu.Q = vu.vf01.w() / vu.vf08.w(); - - // move.xyzw vf21, vf10 | add.xyzw vf12, vf12, vf18 - vu.vf12.add_xyzw(vu.vf12, vu.vf18); vu.vf21.move_xyzw(vu.vf10); - // iand vi11, vi11, vi05 | add.xyzw vf15, vf15, vf19 - vu.vf15.add_xyzw(vu.vf15, vu.vf19); vu.vi11 = vu.vi11 & vu.vi05; - // ilw.w vi08, -1(vi02) | mulax.xyzw ACC, vf04, vf13 - vu.acc.mula_xyzw(vu.vf04, vu.vf13.x()); ilw_buffer(Mask::w, vu.vi08, vu.vi02 + -1); -// BRANCH! - // ibgtz vi09, L139 | madday.xyzw ACC, vf05, vf13 - vu.acc.madda_xyzw(vu.vf05, vu.vf13.y()); bc = ((s16)vu.vi09) > 0; - // iand vi14, vi14, vi05 | maddaz.xyzw ACC, vf06, vf13 - vu.acc.madda_xyzw(vu.vf06, vu.vf13.z()); vu.vi14 = vu.vi14 & vu.vi05; - if (bc) { goto L139; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L139: -// BRANCH! - // ibne vi05, vi11, L140 | maddw.xyzw vf13, vf07, vf00 - vu.acc.madd_xyzw(vu.vf13, vu.vf07, vu.vf00.w()); bc = (vu.vi05 != vu.vi11); - // ilw.x vi09, -9(vi01) | mul.xyz vf08, vf08, Q - vu.vf08.mul(Mask::xyz, vu.vf08, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -9); - if (bc) { goto L140; } - - - // mtir vi11, vf12.x | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi14 = vu.vf12.y_as_u16(); -// BRANCH! - // b L141 | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); bc = true; - // lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); - if (bc) { goto L141; } - - - L140: - // lq.xyzw vf20, 0(vi11) | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ lq_buffer_xyzw(vu.vf20, vu.vi11); - // nop | mulw.xyzw vf24, vf24, vf29 - vu.vf24.mul_xyzw(vu.vf24, vu.vf29.w()); - // lq.xyzw vf31, 0(vi14) | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); lq_buffer_xyzw(vu.vf31, vu.vi14); - // lq.xyzw vf25, 0(vi08) | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); lq_buffer_xyzw(vu.vf25, vu.vi08); - // lq.xyzw vf23, 1(vi11) | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi11 + 1); - // lq.xyzw vf20, 1(vi14) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi14 + 1); - // lq.xyzw vf26, 1(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyzw(vu.vf26, vu.vi08 + 1); - // lq.xyzw vf31, 2(vi11) | maddz.xyzw vf25, vf25, vf24 - vu.acc.madd_xyzw(vu.vf25, vu.vf25, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi11 + 2); - // lq.xyzw vf23, 2(vi14) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi14 + 2); - // lq.xyzw vf27, 2(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyzw(vu.vf27, vu.vi08 + 2); - // lq.xyzw vf20, 3(vi11) | maddz.xyzw vf26, vf26, vf24 - vu.acc.madd_xyzw(vu.vf26, vu.vf26, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 3); - // lq.xyzw vf31, 3(vi14) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf31, vu.vi14 + 3); - // lq.xyzw vf28, 3(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf28, vu.vi08 + 3); - // lq.xyzw vf23, 4(vi11) | maddz.xyzw vf27, vf27, vf24 - vu.acc.madd_xyzw(vu.vf27, vu.vf27, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi11 + 4); - // lq.xyzw vf20, 4(vi14) | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); lq_buffer_xyzw(vu.vf20, vu.vi14 + 4); - // lq.xyz vf29, 4(vi08) | madday.xyzw ACC, vf31, vf24 - vu.acc.madda_xyzw(vu.vf31, vu.vf24.y()); lq_buffer_xyz(vu.vf29, vu.vi08 + 4); - // lq.xyzw vf31, 5(vi11) | maddz.xyzw vf28, vf28, vf24 - vu.acc.madd_xyzw(vu.vf28, vu.vf28, vu.vf24.z()); lq_buffer_xyzw(vu.vf31, vu.vi11 + 5); - // lq.xyzw vf23, 5(vi14) | mulax.xyzw ACC, vf23, vf24 - vu.acc.mula_xyzw(vu.vf23, vu.vf24.x()); lq_buffer_xyzw(vu.vf23, vu.vi14 + 5); - // lq.xyz vf30, 5(vi08) | madday.xyzw ACC, vf20, vf24 - vu.acc.madda_xyzw(vu.vf20, vu.vf24.y()); lq_buffer_xyz(vu.vf30, vu.vi08 + 5); - // lq.xyzw vf20, 6(vi11) | maddz.xyz vf29, vf29, vf24 - vu.acc.madd_xyz(vu.vf29, vu.vf29, vu.vf24.z()); lq_buffer_xyzw(vu.vf20, vu.vi11 + 6); - // lq.xyzw vf22, 6(vi14) | mulax.xyzw ACC, vf31, vf24 - vu.acc.mula_xyzw(vu.vf31, vu.vf24.x()); lq_buffer_xyzw(vu.vf22, vu.vi14 + 6); - // lq.xyzw vf31, 6(vi08) | madday.xyzw ACC, vf23, vf24 - vu.acc.madda_xyzw(vu.vf23, vu.vf24.y()); lq_buffer_xyzw(vu.vf31, vu.vi08 + 6); - // lqi.xyzw vf23, vi02 | maddz.xyz vf30, vf30, vf24 - vu.acc.madd_xyz(vu.vf30, vu.vf30, vu.vf24.z()); lq_buffer_xyzw(vu.vf23, vu.vi02++); - // mtir vi11, vf12.x | mulax.xyzw ACC, vf20, vf24 - vu.acc.mula_xyzw(vu.vf20, vu.vf24.x()); vu.vi11 = vu.vf12.x_as_u16(); - // mtir vi14, vf12.y | madday.xyzw ACC, vf22, vf24 - vu.acc.madda_xyzw(vu.vf22, vu.vf24.y()); vu.vi14 = vu.vf12.y_as_u16(); - // lq.xyzw vf22, 2(vi00) | maddz.xyzw vf31, vf31, vf24 - vu.acc.madd_xyzw(vu.vf31, vu.vf31, vu.vf24.z()); lq_buffer_xyzw(vu.vf22, 2); - // lqi.xyzw vf23, vi03 | itof0.xyzw vf24, vf23 - vu.vf24.itof0(Mask::xyzw, vu.vf23); lq_buffer_xyzw(vu.vf23, vu.vi03++); - L141: -// BRANCH! - // ibgez vi09, L142 | mulaz.xyzw ACC, vf29, vf09 - vu.acc.mula_xyzw(vu.vf29, vu.vf09.z()); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi12) | maddaz.xyzw ACC, vf30, vf12 - vu.acc.madda_xyzw(vu.vf30, vu.vf12.z()); sq_buffer_xyzw(vu.vf21, vu.vi12 + 2); - if (bc) { goto L142; } - - - // nop | ftoi4.xyzw vf21, vf10 - vu.vf21.ftoi4(Mask::xyzw, vu.vf10); - L142: - // mfp.w vf20, P | maddz.xyz vf12, vf31, vf15 - vu.acc.madd_xyz(vu.vf12, vu.vf31, vu.vf15.z()); vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 - vu.vf13.mini_xyzw(vu.vf13, vu.vf17.y()); sq_buffer_xyzw(vu.vf16, vu.vi12); - // sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf03.w()); sq_buffer_xyzw(vu.vf16, vu.vi15); - // sq.xyzw vf21, 2(vi15) | mulaw.xyzw ACC, vf25, vf09 - vu.acc.mula_xyzw(vu.vf25, vu.vf09.w()); sq_buffer_xyzw(vu.vf21, vu.vi15 + 2); - // ilw.y vi09, -6(vi01) | mulw.xyzw vf11, vf11, vf20 - vu.vf11.mul_xyzw(vu.vf11, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -6); - // 1024.0 | ftoi0.xyzw vf13, vf13 :i - vu.vf13.ftoi0(Mask::xyzw, vu.vf13); vu.I = 1024.0; - // erleng.xyz P, vf12 | maxi.xy vf08, vf08, I - vu.vf08.maxi(Mask::xy, vu.vf08, vu.I); vu.P = erleng(vu.vf12); /* TODO erleng */ -// BRANCH! - // ibne vi07, vi03, L127 | maddaw.xyzw ACC, vf26, vf12 - vu.acc.madda_xyzw(vu.vf26, vu.vf12.w()); bc = (vu.vi07 != vu.vi03); - // mr32.z vf15, vf00 | maddw.xyzw vf09, vf27, vf15 - vu.acc.madd_xyzw(vu.vf09, vu.vf27, vu.vf15.w()); vu.vf15.z() = 1.f; - if (bc) { goto L127; } - - -// BRANCH! - // b L163 | nop - bc = true; - // nop | nop - - if (bc) { goto L163; } - - - L143: - // ilw.w vi08, 1(vi00) | nop - ilw_buffer(Mask::w, vu.vi08, 1); - // xtop vi02 | mulax.xyzw ACC, vf01, vf12 - vu.acc.mula_xyzw(vu.vf01, vu.vf12.x()); vu.vi02 = xtop(); - // sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 - vu.acc.madda_xyzw(vu.vf02, vu.vf12.y()); sq_buffer_xyzw(vu.vf11, vu.vi10 + 1); - // sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 - vu.acc.madd_xyzw(vu.vf12, vu.vf03, vu.vf12.z()); sq_buffer_xyzw(vu.vf11, vu.vi13 + 1); - // iaddiu vi04, vi02, 0x8c | add.xyzw vf10, vf10, vf28 - vu.vf10.add_xyzw(vu.vf10, vu.vf28); vu.vi04 = vu.vi02 + 0x8c; /* 140 */ - // ilwr.x vi05, vi04 | maxw.w vf09, vf09, vf02 - vu.vf09.max(Mask::w, vu.vf09, vu.vf02.w()); ilw_buffer(Mask::x, vu.vi05, vu.vi04); - // ilw.w vi06, 1(vi04) | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); ilw_buffer(Mask::w, vu.vi06, vu.vi04 + 1); -// BRANCH! - // ibne vi00, vi08, L151 | nop - bc = (vu.vi08 != 0); - // ilw.x vi07, 2(vi04) | maxx.xyzw vf12, vf12, vf00 - vu.vf12.max_xyzw(vu.vf12, vu.vf00.x()); ilw_buffer(Mask::x, vu.vi07, vu.vi04 + 2); - if (bc) { goto L151; } - - - L144: - // div Q, vf01.w, vf10.w | minix.xyzw vf25, vf00, vf00 - vu.vf25.mini_xyzw(vu.vf00, vu.vf00.x()); vu.Q = vu.vf01.w() / vu.vf10.w(); - - // move.xyzw vf21, vf09 | minix.xyzw vf26, vf00, vf00 - vu.vf26.mini_xyzw(vu.vf00, vu.vf00.x()); vu.vf21.move_xyzw(vu.vf09); - // iadd vi05, vi05, vi04 | nop - vu.vi05 = vu.vi05 + vu.vi04; - // iaddiu vi04, vi02, 0x173 | mulax.xyzw ACC, vf04, vf12 - vu.acc.mula_xyzw(vu.vf04, vu.vf12.x()); vu.vi04 = vu.vi02 + 0x173; /* 371 */ -// BRANCH! - // ibgtz vi09, L145 | madday.xyzw ACC, vf05, vf12 - vu.acc.madda_xyzw(vu.vf05, vu.vf12.y()); bc = ((s16)vu.vi09) > 0; - // iadd vi06, vi06, vi05 | maddaz.xyzw ACC, vf06, vf12 - vu.acc.madda_xyzw(vu.vf06, vu.vf12.z()); vu.vi06 = vu.vi06 + vu.vi05; - if (bc) { goto L145; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L145: - // iadd vi07, vi07, vi06 | maddw.xyzw vf12, vf07, vf00 - vu.acc.madd_xyzw(vu.vf12, vu.vf07, vu.vf00.w()); vu.vi07 = vu.vi07 + vu.vi06; - // ilw.x vi09, -6(vi01) | mul.xyz vf10, vf10, Q - vu.vf10.mul(Mask::xyz, vu.vf10, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -6); - // iaddiu vi08, vi00, 0x1ba | mul.xyzw vf16, vf16, Q - vu.vf16.mul_xyzw(vu.vf16, vu.Q); /* TODO mulq */ vu.vi08 = 0x1ba; /* 442 */ - - // isub vi08, vi08, vi02 | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi08 = vu.vi08 - vu.vi02; - // iaddiu vi08, vi08, 0x173 | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); vu.vi08 = vu.vi08 + 0x173; /* 371 */ - // lqi.xyzw vf23, vi03 | add.xyzw vf10, vf10, vf22 - vu.vf10.add_xyzw(vu.vf10, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); -// BRANCH! - // ibgez vi09, L146 | nop - bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi11) | nop - sq_buffer_xyzw(vu.vf21, vu.vi11 + 2); - if (bc) { goto L146; } - - - // nop | ftoi4.xyzw vf21, vf09 - vu.vf21.ftoi4(Mask::xyzw, vu.vf09); - L146: - // mfp.w vf20, P | nop - vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 - vu.vf12.mini_xyzw(vu.vf12, vu.vf17.y()); sq_buffer_xyzw(vu.vf15, vu.vi11); - // sq.xyzw vf15, 0(vi14) | miniw.w vf10, vf10, vf03 - vu.vf10.mini(Mask::w, vu.vf10, vu.vf03.w()); sq_buffer_xyzw(vu.vf15, vu.vi14); - // sq.xyzw vf21, 2(vi14) | nop - sq_buffer_xyzw(vu.vf21, vu.vi14 + 2); - // ilw.y vi09, -3(vi01) | mulw.xyzw vf13, vf13, vf20 - vu.vf13.mul_xyzw(vu.vf13, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -3); - // mfir.x vf25, vi04 | ftoi0.xyzw vf12, vf12 - vu.vf12.ftoi0(Mask::xyzw, vu.vf12); vu.vf25.mfir(Mask::x, vu.vi04); - // mfir.y vf25, vi04 | nop - vu.vf25.mfir(Mask::y, vu.vi04); - // mfir.x vf26, vi08 | nop - vu.vf26.mfir(Mask::x, vu.vi08); - // ilw.w vi02, 1(vi00) | nop - ilw_buffer(Mask::w, vu.vi02, 1); - // mfir.y vf26, vi04 | mulax.xyzw ACC, vf01, vf13 - vu.acc.mula_xyzw(vu.vf01, vu.vf13.x()); vu.vf26.mfir(Mask::y, vu.vi04); - // sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 - vu.acc.madda_xyzw(vu.vf02, vu.vf13.y()); sq_buffer_xyzw(vu.vf12, vu.vi11 + 1); - // sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 - vu.acc.madd_xyzw(vu.vf13, vu.vf03, vu.vf13.z()); sq_buffer_xyzw(vu.vf12, vu.vi14 + 1); - // nop | nop - -// BRANCH! - // ibne vi00, vi02, L152 | maxw.w vf10, vf10, vf02 - vu.vf10.max(Mask::w, vu.vf10, vu.vf02.w()); bc = (vu.vi02 != 0); - // nop | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); - if (bc) { goto L152; } - - - L147: - // 8388608.0 | maxx.xyzw vf13, vf13, vf00 :i - vu.vf13.max_xyzw(vu.vf13, vu.vf00.x()); vu.I = 8388608.0; - // 256.0 | maxi.xy vf27, vf00, I :i - vu.vf27.maxi(Mask::xy, vu.vf00, vu.I); vu.I = 256.0; - // move.xyzw vf21, vf10 | maxi.w vf27, vf00, I - vu.vf27.maxi(Mask::w, vu.vf00, vu.I); vu.vf21.move_xyzw(vu.vf10); - // nop | nop - - // nop | mulax.xyzw ACC, vf04, vf13 - vu.acc.mula_xyzw(vu.vf04, vu.vf13.x()); -// BRANCH! - // ibgtz vi09, L148 | madday.xyzw ACC, vf05, vf13 - vu.acc.madda_xyzw(vu.vf05, vu.vf13.y()); bc = ((s16)vu.vi09) > 0; - // nop | maddaz.xyzw ACC, vf06, vf13 - vu.acc.madda_xyzw(vu.vf06, vu.vf13.z()); - if (bc) { goto L148; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L148: - // nop | maddw.xyzw vf13, vf07, vf00 - vu.acc.madd_xyzw(vu.vf13, vu.vf07, vu.vf00.w()); - // ilw.x vi09, -3(vi01) | itof0.xyzw vf25, vf25 - vu.vf25.itof0(Mask::xyzw, vu.vf25); ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -3); - // nop | itof0.xyzw vf26, vf26 - vu.vf26.itof0(Mask::xyzw, vu.vf26); - // nop | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); - // nop | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); - // ior vi02, vi05, vi00 | add.xyzw vf25, vf25, vf27 - vu.vf25.add_xyzw(vu.vf25, vu.vf27); vu.vi02 = vu.vi05; -// BRANCH! - // ibgez vi09, L149 | add.xyzw vf26, vf26, vf27 - vu.vf26.add_xyzw(vu.vf26, vu.vf27); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi12) | nop - sq_buffer_xyzw(vu.vf21, vu.vi12 + 2); - if (bc) { goto L149; } - - - // nop | ftoi4.xyzw vf21, vf10 - vu.vf21.ftoi4(Mask::xyzw, vu.vf10); - L149: -// BRANCH! - // ibne vi06, vi05, L150 | nop - bc = (vu.vi06 != vu.vi05); - // sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 - vu.vf13.mini_xyzw(vu.vf13, vu.vf17.y()); sq_buffer_xyzw(vu.vf16, vu.vi12); - if (bc) { goto L150; } - - - // ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 - vu.vf25.max_xyzw(vu.vf26, vu.vf26); vu.vi06 = vu.vi07; - L150: - // sq.xyzw vf16, 0(vi15) | nop - sq_buffer_xyzw(vu.vf16, vu.vi15); - // sq.xyzw vf21, 2(vi15) | nop - sq_buffer_xyzw(vu.vf21, vu.vi15 + 2); - // lqi.xyzw vf27, vi05 | nop - lq_buffer_xyzw(vu.vf27, vu.vi05++); - // nop | ftoi0.xyzw vf13, vf13 - vu.vf13.ftoi0(Mask::xyzw, vu.vf13); - // nop | nop - - // nop | nop - - // nop | itof0.xyzw vf27, vf27 - vu.vf27.itof0(Mask::xyzw, vu.vf27); - // sq.xyzw vf13, 1(vi12) | nop - sq_buffer_xyzw(vu.vf13, vu.vi12 + 1); -// BRANCH! - // b L173 | nop - bc = true; - // sq.xyzw vf13, 1(vi15) | nop - sq_buffer_xyzw(vu.vf13, vu.vi15 + 1); - if (bc) { goto L173; } - - - L151: - // 3072.0 | miniw.w vf10, vf10, vf01 :i - vu.vf10.mini(Mask::w, vu.vf10, vu.vf01.w()); vu.I = 3072.0; -// BRANCH! - // b L144 | minii.xy vf09, vf09, I - vu.vf09.minii(Mask::xy, vu.vf09, vu.I); bc = true; - // nop | nop - - if (bc) { goto L144; } - - - L152: - // 1024.0 | nop :i - vu.I = 1024.0; - // 3072.0 | maxi.xy vf10, vf10, I :i - vu.vf10.maxi(Mask::xy, vu.vf10, vu.I); vu.I = 3072.0; -// BRANCH! - // b L147 | minii.xy vf10, vf10, I - vu.vf10.minii(Mask::xy, vu.vf10, vu.I); bc = true; - // isw.w vi00, 1(vi00) | nop - isw_buffer(Mask::w, vu.vi00, 1); - if (bc) { goto L147; } - - - L153: - // ilw.w vi08, 1(vi00) | nop - ilw_buffer(Mask::w, vu.vi08, 1); - // xtop vi02 | mulax.xyzw ACC, vf01, vf13 - vu.acc.mula_xyzw(vu.vf01, vu.vf13.x()); vu.vi02 = xtop(); - // sq.xyzw vf12, 1(vi11) | madday.xyzw ACC, vf02, vf13 - vu.acc.madda_xyzw(vu.vf02, vu.vf13.y()); sq_buffer_xyzw(vu.vf12, vu.vi11 + 1); - // sq.xyzw vf12, 1(vi14) | maddz.xyzw vf13, vf03, vf13 - vu.acc.madd_xyzw(vu.vf13, vu.vf03, vu.vf13.z()); sq_buffer_xyzw(vu.vf12, vu.vi14 + 1); - // iaddiu vi04, vi02, 0x8c | add.xyzw vf08, vf08, vf28 - vu.vf08.add_xyzw(vu.vf08, vu.vf28); vu.vi04 = vu.vi02 + 0x8c; /* 140 */ - // ilwr.x vi05, vi04 | maxw.w vf10, vf10, vf02 - vu.vf10.max(Mask::w, vu.vf10, vu.vf02.w()); ilw_buffer(Mask::x, vu.vi05, vu.vi04); - // ilw.w vi06, 1(vi04) | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); ilw_buffer(Mask::w, vu.vi06, vu.vi04 + 1); -// BRANCH! - // ibne vi00, vi08, L161 | nop - bc = (vu.vi08 != 0); - // ilw.x vi07, 2(vi04) | maxx.xyzw vf13, vf13, vf00 - vu.vf13.max_xyzw(vu.vf13, vu.vf00.x()); ilw_buffer(Mask::x, vu.vi07, vu.vi04 + 2); - if (bc) { goto L161; } - - - L154: - // div Q, vf01.w, vf08.w | minix.xyzw vf25, vf00, vf00 - vu.vf25.mini_xyzw(vu.vf00, vu.vf00.x()); vu.Q = vu.vf01.w() / vu.vf08.w(); - - // move.xyzw vf21, vf10 | minix.xyzw vf26, vf00, vf00 - vu.vf26.mini_xyzw(vu.vf00, vu.vf00.x()); vu.vf21.move_xyzw(vu.vf10); - // iadd vi05, vi05, vi04 | nop - vu.vi05 = vu.vi05 + vu.vi04; - // iaddiu vi04, vi02, 0x173 | mulax.xyzw ACC, vf04, vf13 - vu.acc.mula_xyzw(vu.vf04, vu.vf13.x()); vu.vi04 = vu.vi02 + 0x173; /* 371 */ -// BRANCH! - // ibgtz vi09, L155 | madday.xyzw ACC, vf05, vf13 - vu.acc.madda_xyzw(vu.vf05, vu.vf13.y()); bc = ((s16)vu.vi09) > 0; - // iadd vi06, vi06, vi05 | maddaz.xyzw ACC, vf06, vf13 - vu.acc.madda_xyzw(vu.vf06, vu.vf13.z()); vu.vi06 = vu.vi06 + vu.vi05; - if (bc) { goto L155; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L155: - // iadd vi07, vi07, vi06 | maddw.xyzw vf13, vf07, vf00 - vu.acc.madd_xyzw(vu.vf13, vu.vf07, vu.vf00.w()); vu.vi07 = vu.vi07 + vu.vi06; - // ilw.x vi09, -6(vi01) | mul.xyz vf08, vf08, Q - vu.vf08.mul(Mask::xyz, vu.vf08, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -6); - // iaddiu vi08, vi00, 0x1ba | mul.xyzw vf14, vf14, Q - vu.vf14.mul_xyzw(vu.vf14, vu.Q); /* TODO mulq */ vu.vi08 = 0x1ba; /* 442 */ - - // isub vi08, vi08, vi02 | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi08 = vu.vi08 - vu.vi02; - // iaddiu vi08, vi08, 0x173 | mul.xyzw vf13, vf13, vf23 - vu.vf13.mul_xyzw(vu.vf13, vu.vf23); vu.vi08 = vu.vi08 + 0x173; /* 371 */ - // lqi.xyzw vf23, vi03 | add.xyzw vf08, vf08, vf22 - vu.vf08.add_xyzw(vu.vf08, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); -// BRANCH! - // ibgez vi09, L156 | nop - bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi12) | nop - sq_buffer_xyzw(vu.vf21, vu.vi12 + 2); - if (bc) { goto L156; } - - - // nop | ftoi4.xyzw vf21, vf10 - vu.vf21.ftoi4(Mask::xyzw, vu.vf10); - L156: - // mfp.w vf20, P | nop - vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf16, 0(vi12) | miniy.xyzw vf13, vf13, vf17 - vu.vf13.mini_xyzw(vu.vf13, vu.vf17.y()); sq_buffer_xyzw(vu.vf16, vu.vi12); - // sq.xyzw vf16, 0(vi15) | miniw.w vf08, vf08, vf03 - vu.vf08.mini(Mask::w, vu.vf08, vu.vf03.w()); sq_buffer_xyzw(vu.vf16, vu.vi15); - // sq.xyzw vf21, 2(vi15) | nop - sq_buffer_xyzw(vu.vf21, vu.vi15 + 2); - // ilw.y vi09, -3(vi01) | mulw.xyzw vf11, vf11, vf20 - vu.vf11.mul_xyzw(vu.vf11, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -3); - // mfir.x vf25, vi04 | ftoi0.xyzw vf13, vf13 - vu.vf13.ftoi0(Mask::xyzw, vu.vf13); vu.vf25.mfir(Mask::x, vu.vi04); - // mfir.y vf25, vi04 | nop - vu.vf25.mfir(Mask::y, vu.vi04); - // mfir.x vf26, vi08 | nop - vu.vf26.mfir(Mask::x, vu.vi08); - // ilw.w vi02, 1(vi00) | nop - ilw_buffer(Mask::w, vu.vi02, 1); - // mfir.y vf26, vi04 | mulax.xyzw ACC, vf01, vf11 - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); vu.vf26.mfir(Mask::y, vu.vi04); - // sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); sq_buffer_xyzw(vu.vf13, vu.vi12 + 1); - // sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); sq_buffer_xyzw(vu.vf13, vu.vi15 + 1); - // nop | nop - -// BRANCH! - // ibne vi00, vi02, L162 | maxw.w vf08, vf08, vf02 - vu.vf08.max(Mask::w, vu.vf08, vu.vf02.w()); bc = (vu.vi02 != 0); - // nop | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); - if (bc) { goto L162; } - - - L157: - // 8388608.0 | maxx.xyzw vf11, vf11, vf00 :i - vu.vf11.max_xyzw(vu.vf11, vu.vf00.x()); vu.I = 8388608.0; - // 256.0 | maxi.xy vf27, vf00, I :i - vu.vf27.maxi(Mask::xy, vu.vf00, vu.I); vu.I = 256.0; - // move.xyzw vf21, vf08 | maxi.w vf27, vf00, I - vu.vf27.maxi(Mask::w, vu.vf00, vu.I); vu.vf21.move_xyzw(vu.vf08); - // nop | nop - - // nop | mulax.xyzw ACC, vf04, vf11 - vu.acc.mula_xyzw(vu.vf04, vu.vf11.x()); -// BRANCH! - // ibgtz vi09, L158 | madday.xyzw ACC, vf05, vf11 - vu.acc.madda_xyzw(vu.vf05, vu.vf11.y()); bc = ((s16)vu.vi09) > 0; - // nop | maddaz.xyzw ACC, vf06, vf11 - vu.acc.madda_xyzw(vu.vf06, vu.vf11.z()); - if (bc) { goto L158; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L158: - // nop | maddw.xyzw vf11, vf07, vf00 - vu.acc.madd_xyzw(vu.vf11, vu.vf07, vu.vf00.w()); - // ilw.x vi09, -3(vi01) | itof0.xyzw vf25, vf25 - vu.vf25.itof0(Mask::xyzw, vu.vf25); ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -3); - // nop | itof0.xyzw vf26, vf26 - vu.vf26.itof0(Mask::xyzw, vu.vf26); - // nop | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); - // nop | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); - // ior vi02, vi05, vi00 | add.xyzw vf25, vf25, vf27 - vu.vf25.add_xyzw(vu.vf25, vu.vf27); vu.vi02 = vu.vi05; -// BRANCH! - // ibgez vi09, L159 | add.xyzw vf26, vf26, vf27 - vu.vf26.add_xyzw(vu.vf26, vu.vf27); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi10) | nop - sq_buffer_xyzw(vu.vf21, vu.vi10 + 2); - if (bc) { goto L159; } - - - // nop | ftoi4.xyzw vf21, vf08 - vu.vf21.ftoi4(Mask::xyzw, vu.vf08); - L159: -// BRANCH! - // ibne vi06, vi05, L160 | nop - bc = (vu.vi06 != vu.vi05); - // sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 - vu.vf11.mini_xyzw(vu.vf11, vu.vf17.y()); sq_buffer_xyzw(vu.vf14, vu.vi10); - if (bc) { goto L160; } - - - // ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 - vu.vf25.max_xyzw(vu.vf26, vu.vf26); vu.vi06 = vu.vi07; - L160: - // sq.xyzw vf14, 0(vi13) | nop - sq_buffer_xyzw(vu.vf14, vu.vi13); - // sq.xyzw vf21, 2(vi13) | nop - sq_buffer_xyzw(vu.vf21, vu.vi13 + 2); - // lqi.xyzw vf27, vi05 | nop - lq_buffer_xyzw(vu.vf27, vu.vi05++); - // nop | ftoi0.xyzw vf11, vf11 - vu.vf11.ftoi0(Mask::xyzw, vu.vf11); - // nop | nop - - // nop | nop - - // nop | itof0.xyzw vf27, vf27 - vu.vf27.itof0(Mask::xyzw, vu.vf27); - // sq.xyzw vf11, 1(vi10) | nop - sq_buffer_xyzw(vu.vf11, vu.vi10 + 1); -// BRANCH! - // b L173 | nop - bc = true; - // sq.xyzw vf11, 1(vi13) | nop - sq_buffer_xyzw(vu.vf11, vu.vi13 + 1); - if (bc) { goto L173; } - - - L161: - // 3072.0 | miniw.w vf08, vf08, vf01 :i - vu.vf08.mini(Mask::w, vu.vf08, vu.vf01.w()); vu.I = 3072.0; -// BRANCH! - // b L154 | minii.xy vf10, vf10, I - vu.vf10.minii(Mask::xy, vu.vf10, vu.I); bc = true; - // nop | nop - - if (bc) { goto L154; } - - - L162: - // 1024.0 | nop :i - vu.I = 1024.0; - // 3072.0 | maxi.xy vf08, vf08, I :i - vu.vf08.maxi(Mask::xy, vu.vf08, vu.I); vu.I = 3072.0; -// BRANCH! - // b L157 | minii.xy vf08, vf08, I - vu.vf08.minii(Mask::xy, vu.vf08, vu.I); bc = true; - // isw.w vi00, 1(vi00) | nop - isw_buffer(Mask::w, vu.vi00, 1); - if (bc) { goto L157; } - - - L163: - // ilw.w vi08, 1(vi00) | nop - ilw_buffer(Mask::w, vu.vi08, 1); - // xtop vi02 | mulax.xyzw ACC, vf01, vf11 - vu.acc.mula_xyzw(vu.vf01, vu.vf11.x()); vu.vi02 = xtop(); - // sq.xyzw vf13, 1(vi12) | madday.xyzw ACC, vf02, vf11 - vu.acc.madda_xyzw(vu.vf02, vu.vf11.y()); sq_buffer_xyzw(vu.vf13, vu.vi12 + 1); - // sq.xyzw vf13, 1(vi15) | maddz.xyzw vf11, vf03, vf11 - vu.acc.madd_xyzw(vu.vf11, vu.vf03, vu.vf11.z()); sq_buffer_xyzw(vu.vf13, vu.vi15 + 1); - // iaddiu vi04, vi02, 0x8c | add.xyzw vf09, vf09, vf28 - vu.vf09.add_xyzw(vu.vf09, vu.vf28); vu.vi04 = vu.vi02 + 0x8c; /* 140 */ - // ilwr.x vi05, vi04 | maxw.w vf08, vf08, vf02 - vu.vf08.max(Mask::w, vu.vf08, vu.vf02.w()); ilw_buffer(Mask::x, vu.vi05, vu.vi04); - // ilw.w vi06, 1(vi04) | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); ilw_buffer(Mask::w, vu.vi06, vu.vi04 + 1); -// BRANCH! - // ibne vi00, vi08, L171 | nop - bc = (vu.vi08 != 0); - // ilw.x vi07, 2(vi04) | maxx.xyzw vf11, vf11, vf00 - vu.vf11.max_xyzw(vu.vf11, vu.vf00.x()); ilw_buffer(Mask::x, vu.vi07, vu.vi04 + 2); - if (bc) { goto L171; } - - - L164: - // div Q, vf01.w, vf09.w | minix.xyzw vf25, vf00, vf00 - vu.vf25.mini_xyzw(vu.vf00, vu.vf00.x()); vu.Q = vu.vf01.w() / vu.vf09.w(); - - // move.xyzw vf21, vf08 | minix.xyzw vf26, vf00, vf00 - vu.vf26.mini_xyzw(vu.vf00, vu.vf00.x()); vu.vf21.move_xyzw(vu.vf08); - // iadd vi05, vi05, vi04 | nop - vu.vi05 = vu.vi05 + vu.vi04; - // iaddiu vi04, vi02, 0x173 | mulax.xyzw ACC, vf04, vf11 - vu.acc.mula_xyzw(vu.vf04, vu.vf11.x()); vu.vi04 = vu.vi02 + 0x173; /* 371 */ -// BRANCH! - // ibgtz vi09, L165 | madday.xyzw ACC, vf05, vf11 - vu.acc.madda_xyzw(vu.vf05, vu.vf11.y()); bc = ((s16)vu.vi09) > 0; - // iadd vi06, vi06, vi05 | maddaz.xyzw ACC, vf06, vf11 - vu.acc.madda_xyzw(vu.vf06, vu.vf11.z()); vu.vi06 = vu.vi06 + vu.vi05; - if (bc) { goto L165; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L165: - // iadd vi07, vi07, vi06 | maddw.xyzw vf11, vf07, vf00 - vu.acc.madd_xyzw(vu.vf11, vu.vf07, vu.vf00.w()); vu.vi07 = vu.vi07 + vu.vi06; - // ilw.x vi09, -6(vi01) | mul.xyz vf09, vf09, Q - vu.vf09.mul(Mask::xyz, vu.vf09, vu.Q); /* TODO mulq */ ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -6); - // iaddiu vi08, vi00, 0x1ba | mul.xyzw vf15, vf15, Q - vu.vf15.mul_xyzw(vu.vf15, vu.Q); /* TODO mulq */ vu.vi08 = 0x1ba; /* 442 */ - - // isub vi08, vi08, vi02 | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); vu.vi08 = vu.vi08 - vu.vi02; - // iaddiu vi08, vi08, 0x173 | mul.xyzw vf11, vf11, vf23 - vu.vf11.mul_xyzw(vu.vf11, vu.vf23); vu.vi08 = vu.vi08 + 0x173; /* 371 */ - // lqi.xyzw vf23, vi03 | add.xyzw vf09, vf09, vf22 - vu.vf09.add_xyzw(vu.vf09, vu.vf22); lq_buffer_xyzw(vu.vf23, vu.vi03++); -// BRANCH! - // ibgez vi09, L166 | nop - bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi10) | nop - sq_buffer_xyzw(vu.vf21, vu.vi10 + 2); - if (bc) { goto L166; } - - - // nop | ftoi4.xyzw vf21, vf08 - vu.vf21.ftoi4(Mask::xyzw, vu.vf08); - L166: - // mfp.w vf20, P | nop - vu.vf20.mfp(Mask::w, vu.P); - // sq.xyzw vf14, 0(vi10) | miniy.xyzw vf11, vf11, vf17 - vu.vf11.mini_xyzw(vu.vf11, vu.vf17.y()); sq_buffer_xyzw(vu.vf14, vu.vi10); - // sq.xyzw vf14, 0(vi13) | miniw.w vf09, vf09, vf03 - vu.vf09.mini(Mask::w, vu.vf09, vu.vf03.w()); sq_buffer_xyzw(vu.vf14, vu.vi13); - // sq.xyzw vf21, 2(vi13) | nop - sq_buffer_xyzw(vu.vf21, vu.vi13 + 2); - // ilw.y vi09, -3(vi01) | mulw.xyzw vf12, vf12, vf20 - vu.vf12.mul_xyzw(vu.vf12, vu.vf20.w()); ilw_buffer(Mask::y, vu.vi09, vu.vi01 + -3); - // mfir.x vf25, vi04 | ftoi0.xyzw vf11, vf11 - vu.vf11.ftoi0(Mask::xyzw, vu.vf11); vu.vf25.mfir(Mask::x, vu.vi04); - // mfir.y vf25, vi04 | nop - vu.vf25.mfir(Mask::y, vu.vi04); - // mfir.x vf26, vi08 | nop - vu.vf26.mfir(Mask::x, vu.vi08); - // ilw.w vi02, 1(vi00) | nop - ilw_buffer(Mask::w, vu.vi02, 1); - // mfir.y vf26, vi04 | mulax.xyzw ACC, vf01, vf12 - vu.acc.mula_xyzw(vu.vf01, vu.vf12.x()); vu.vf26.mfir(Mask::y, vu.vi04); - // sq.xyzw vf11, 1(vi10) | madday.xyzw ACC, vf02, vf12 - vu.acc.madda_xyzw(vu.vf02, vu.vf12.y()); sq_buffer_xyzw(vu.vf11, vu.vi10 + 1); - // sq.xyzw vf11, 1(vi13) | maddz.xyzw vf12, vf03, vf12 - vu.acc.madd_xyzw(vu.vf12, vu.vf03, vu.vf12.z()); sq_buffer_xyzw(vu.vf11, vu.vi13 + 1); - // nop | nop - -// BRANCH! - // ibne vi00, vi02, L172 | maxw.w vf09, vf09, vf02 - vu.vf09.max(Mask::w, vu.vf09, vu.vf02.w()); bc = (vu.vi02 != 0); - // nop | itof0.xyzw vf23, vf23 - vu.vf23.itof0(Mask::xyzw, vu.vf23); - if (bc) { goto L172; } - - - L167: - // 8388608.0 | maxx.xyzw vf12, vf12, vf00 :i - vu.vf12.max_xyzw(vu.vf12, vu.vf00.x()); vu.I = 8388608.0; - // 256.0 | maxi.xy vf27, vf00, I :i - vu.vf27.maxi(Mask::xy, vu.vf00, vu.I); vu.I = 256.0; - // move.xyzw vf21, vf09 | maxi.w vf27, vf00, I - vu.vf27.maxi(Mask::w, vu.vf00, vu.I); vu.vf21.move_xyzw(vu.vf09); - // nop | nop - - // nop | mulax.xyzw ACC, vf04, vf12 - vu.acc.mula_xyzw(vu.vf04, vu.vf12.x()); -// BRANCH! - // ibgtz vi09, L168 | madday.xyzw ACC, vf05, vf12 - vu.acc.madda_xyzw(vu.vf05, vu.vf12.y()); bc = ((s16)vu.vi09) > 0; - // nop | maddaz.xyzw ACC, vf06, vf12 - vu.acc.madda_xyzw(vu.vf06, vu.vf12.z()); - if (bc) { goto L168; } - - - // nop | addx.w vf21, vf21, vf17 - vu.vf21.add(Mask::w, vu.vf21, vu.vf17.x()); - L168: - // nop | maddw.xyzw vf12, vf07, vf00 - vu.acc.madd_xyzw(vu.vf12, vu.vf07, vu.vf00.w()); - // ilw.x vi09, -3(vi01) | itof0.xyzw vf25, vf25 - vu.vf25.itof0(Mask::xyzw, vu.vf25); ilw_buffer(Mask::x, vu.vi09, vu.vi01 + -3); - // nop | itof0.xyzw vf26, vf26 - vu.vf26.itof0(Mask::xyzw, vu.vf26); - // nop | ftoi4.xyzw vf21, vf21 - vu.vf21.ftoi4(Mask::xyzw, vu.vf21); - // nop | mul.xyzw vf12, vf12, vf23 - vu.vf12.mul_xyzw(vu.vf12, vu.vf23); - // ior vi02, vi05, vi00 | add.xyzw vf25, vf25, vf27 - vu.vf25.add_xyzw(vu.vf25, vu.vf27); vu.vi02 = vu.vi05; -// BRANCH! - // ibgez vi09, L169 | add.xyzw vf26, vf26, vf27 - vu.vf26.add_xyzw(vu.vf26, vu.vf27); bc = ((s16)vu.vi09) >= 0; - // sq.xyzw vf21, 2(vi11) | nop - sq_buffer_xyzw(vu.vf21, vu.vi11 + 2); - if (bc) { goto L169; } - - - // nop | ftoi4.xyzw vf21, vf09 - vu.vf21.ftoi4(Mask::xyzw, vu.vf09); - L169: -// BRANCH! - // ibne vi06, vi05, L170 | nop - bc = (vu.vi06 != vu.vi05); - // sq.xyzw vf15, 0(vi11) | miniy.xyzw vf12, vf12, vf17 - vu.vf12.mini_xyzw(vu.vf12, vu.vf17.y()); sq_buffer_xyzw(vu.vf15, vu.vi11); - if (bc) { goto L170; } - - - // ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 - vu.vf25.max_xyzw(vu.vf26, vu.vf26); vu.vi06 = vu.vi07; - L170: - // sq.xyzw vf15, 0(vi14) | nop - sq_buffer_xyzw(vu.vf15, vu.vi14); - // sq.xyzw vf21, 2(vi14) | nop - sq_buffer_xyzw(vu.vf21, vu.vi14 + 2); - // lqi.xyzw vf27, vi05 | nop - lq_buffer_xyzw(vu.vf27, vu.vi05++); - // nop | ftoi0.xyzw vf12, vf12 - vu.vf12.ftoi0(Mask::xyzw, vu.vf12); - // nop | nop - - // nop | nop - - // nop | itof0.xyzw vf27, vf27 - vu.vf27.itof0(Mask::xyzw, vu.vf27); - // sq.xyzw vf12, 1(vi11) | nop - sq_buffer_xyzw(vu.vf12, vu.vi11 + 1); -// BRANCH! - // b L173 | nop - bc = true; - // sq.xyzw vf12, 1(vi14) | nop - sq_buffer_xyzw(vu.vf12, vu.vi14 + 1); - if (bc) { goto L173; } - - - L171: - // 3072.0 | miniw.w vf09, vf09, vf01 :i - vu.vf09.mini(Mask::w, vu.vf09, vu.vf01.w()); vu.I = 3072.0; -// BRANCH! - // b L164 | minii.xy vf08, vf08, I - vu.vf08.minii(Mask::xy, vu.vf08, vu.I); bc = true; - // nop | nop - - if (bc) { goto L164; } - - - L172: - // 1024.0 | nop :i - vu.I = 1024.0; - // 3072.0 | maxi.xy vf09, vf09, I :i - vu.vf09.maxi(Mask::xy, vu.vf09, vu.I); vu.I = 3072.0; -// BRANCH! - // b L167 | minii.xy vf09, vf09, I - vu.vf09.minii(Mask::xy, vu.vf09, vu.I); bc = true; - // isw.w vi00, 1(vi00) | nop - isw_buffer(Mask::w, vu.vi00, 1); - if (bc) { goto L167; } - - - L173: -// BRANCH! - // ibeq vi07, vi02, L179 | nop - bc = (vu.vi07 == vu.vi02); - // ilw.w vi15, 132(vi00) | nop - vu.hack_old_vi15 = vu.vi15; - ilw_buffer(Mask::w, vu.vi15, 132); - if (bc) { goto L179; } - - -// BRANCH! - // ibne vi06, vi05, L174 | add.xyzw vf11, vf27, vf25 - vu.vf11.add_xyzw(vu.vf27, vu.vf25); bc = (vu.vi06 != vu.vi05); - // nop | nop - - if (bc) { goto L174; } - - -// BRANCH! - // ibne vi07, vi06, L174 | nop - bc = (vu.vi07 != vu.vi06); - // ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 - vu.vf25.max_xyzw(vu.vf26, vu.vf26); vu.vi06 = vu.vi07; - if (bc) { goto L174; } - - - // nop | nop - - // nop | nop - - // mtir vi08, vf11.x | nop - vu.vi08 = vu.vf11.x_as_u16(); - // mtir vi10, vf11.y | nop - vu.vi10 = vu.vf11.y_as_u16(); - // nop | nop - - // nop | nop - - // lq.xyzw vf16, 2(vi08) | maxx.xyzw vf15, vf11, vf00 - vu.vf15.max_xyzw(vu.vf11, vu.vf00.x()); lq_buffer_xyzw(vu.vf16, vu.vi08 + 2); - // lq.xyzw vf13, 0(vi08) | nop - lq_buffer_xyzw(vu.vf13, vu.vi08); -// BRANCH! - // b L178 | nop - bc = true; - // nop | nop - - if (bc) { goto L178; } - - - L174: - // lqi.xyzw vf27, vi05 | nop - lq_buffer_xyzw(vu.vf27, vu.vi05++); - // nop | nop - - // mtir vi08, vf11.x | nop - vu.vi08 = vu.vf11.x_as_u16(); - // mtir vi09, vf11.y | nop - vu.vi09 = vu.vf11.y_as_u16(); - // nop | itof0.xyzw vf27, vf27 - vu.vf27.itof0(Mask::xyzw, vu.vf27); - // nop | nop - - // lq.xyzw vf12, 2(vi08) | maxx.xyzw vf15, vf11, vf00 - vu.vf15.max_xyzw(vu.vf11, vu.vf00.x()); lq_buffer_xyzw(vu.vf12, vu.vi08 + 2); - // lq.xyzw vf13, 0(vi08) | nop - lq_buffer_xyzw(vu.vf13, vu.vi08); -// BRANCH! - // ibne vi06, vi05, L175 | add.xyzw vf11, vf27, vf25 - vu.vf11.add_xyzw(vu.vf27, vu.vf25); bc = (vu.vi06 != vu.vi05); - // nop | nop - - if (bc) { goto L175; } - - -// BRANCH! - // ibeq vi07, vi06, L177 | nop - bc = (vu.vi07 == vu.vi06); - // ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 - vu.vf25.max_xyzw(vu.vf26, vu.vf26); vu.vi06 = vu.vi07; - if (bc) { goto L177; } - - - L175: - // lqi.xyzw vf27, vi05 | itof15.w vf12, vf12 - vu.vf12.itof15(Mask::w, vu.vf12); lq_buffer_xyzw(vu.vf27, vu.vi05++); - // lq.xyzw vf14, 1(vi08) | nop - lq_buffer_xyzw(vu.vf14, vu.vi08 + 1); - // mtir vi08, vf11.x | nop - vu.vi08 = vu.vf11.x_as_u16(); - // mtir vi10, vf11.y | nop - vu.vi10 = vu.vf11.y_as_u16(); - // sq.xyzw vf13, 0(vi09) | itof0.xyzw vf27, vf27 - vu.vf27.itof0(Mask::xyzw, vu.vf27); sq_buffer_xyzw(vu.vf13, vu.vi09); - // sq.xyzw vf14, 1(vi09) | add.w vf12, vf12, vf15 - vu.vf12.add(Mask::w, vu.vf12, vu.vf15); sq_buffer_xyzw(vu.vf14, vu.vi09 + 1); - // lq.xyzw vf16, 2(vi08) | maxx.xyzw vf15, vf11, vf00 - vu.vf15.max_xyzw(vu.vf11, vu.vf00.x()); lq_buffer_xyzw(vu.vf16, vu.vi08 + 2); - // lq.xyzw vf13, 0(vi08) | nop - lq_buffer_xyzw(vu.vf13, vu.vi08); -// BRANCH! - // ibne vi06, vi05, L176 | add.xyzw vf11, vf27, vf25 - vu.vf11.add_xyzw(vu.vf27, vu.vf25); bc = (vu.vi06 != vu.vi05); - // sq.xyzw vf12, 2(vi09) | nop - sq_buffer_xyzw(vu.vf12, vu.vi09 + 2); - if (bc) { goto L176; } - - -// BRANCH! - // ibne vi07, vi06, L176 | nop - bc = (vu.vi07 != vu.vi06); - // ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 - vu.vf25.max_xyzw(vu.vf26, vu.vf26); vu.vi06 = vu.vi07; - if (bc) { goto L176; } - - - // move.xyzw vf12, vf16 | nop - vu.vf12.move_xyzw(vu.vf16); -// BRANCH! - // b L177 | nop - bc = true; - // ior vi09, vi10, vi00 | nop - vu.vi09 = vu.vi10; - if (bc) { goto L177; } - - - L176: - // lqi.xyzw vf27, vi05 | itof15.w vf16, vf16 - vu.vf16.itof15(Mask::w, vu.vf16); lq_buffer_xyzw(vu.vf27, vu.vi05++); - // lq.xyzw vf14, 1(vi08) | nop - lq_buffer_xyzw(vu.vf14, vu.vi08 + 1); - // mtir vi08, vf11.x | nop - vu.vi08 = vu.vf11.x_as_u16(); - // mtir vi09, vf11.y | nop - vu.vi09 = vu.vf11.y_as_u16(); - // sq.xyzw vf13, 0(vi10) | itof0.xyzw vf27, vf27 - vu.vf27.itof0(Mask::xyzw, vu.vf27); sq_buffer_xyzw(vu.vf13, vu.vi10); - // sq.xyzw vf14, 1(vi10) | add.w vf16, vf16, vf15 - vu.vf16.add(Mask::w, vu.vf16, vu.vf15); sq_buffer_xyzw(vu.vf14, vu.vi10 + 1); - // lq.xyzw vf12, 2(vi08) | maxx.xyzw vf15, vf11, vf00 - vu.vf15.max_xyzw(vu.vf11, vu.vf00.x()); lq_buffer_xyzw(vu.vf12, vu.vi08 + 2); - // lq.xyzw vf13, 0(vi08) | nop - lq_buffer_xyzw(vu.vf13, vu.vi08); -// BRANCH! - // ibne vi06, vi05, L175 | add.xyzw vf11, vf27, vf25 - vu.vf11.add_xyzw(vu.vf27, vu.vf25); bc = (vu.vi06 != vu.vi05); - // sq.xyzw vf16, 2(vi10) | nop - sq_buffer_xyzw(vu.vf16, vu.vi10 + 2); - if (bc) { goto L175; } - - -// BRANCH! - // ibne vi07, vi06, L175 | nop - bc = (vu.vi07 != vu.vi06); - // ior vi06, vi07, vi00 | max.xyzw vf25, vf26, vf26 - vu.vf25.max_xyzw(vu.vf26, vu.vf26); vu.vi06 = vu.vi07; - if (bc) { goto L175; } - - - L177: - // nop | itof15.w vf12, vf12 - vu.vf12.itof15(Mask::w, vu.vf12); - // lq.xyzw vf14, 1(vi08) | nop - lq_buffer_xyzw(vu.vf14, vu.vi08 + 1); - // mtir vi08, vf11.x | nop - vu.vi08 = vu.vf11.x_as_u16(); - // mtir vi10, vf11.y | nop - vu.vi10 = vu.vf11.y_as_u16(); - // sq.xyzw vf13, 0(vi09) | nop - sq_buffer_xyzw(vu.vf13, vu.vi09); - // sq.xyzw vf14, 1(vi09) | add.w vf12, vf12, vf15 - vu.vf12.add(Mask::w, vu.vf12, vu.vf15); sq_buffer_xyzw(vu.vf14, vu.vi09 + 1); - // lq.xyzw vf16, 2(vi08) | maxx.xyzw vf15, vf11, vf00 - vu.vf15.max_xyzw(vu.vf11, vu.vf00.x()); lq_buffer_xyzw(vu.vf16, vu.vi08 + 2); - // lq.xyzw vf13, 0(vi08) | nop - lq_buffer_xyzw(vu.vf13, vu.vi08); - // nop | nop - - // sq.xyzw vf12, 2(vi09) | nop - sq_buffer_xyzw(vu.vf12, vu.vi09 + 2); - L178: - // nop | itof15.w vf16, vf16 - vu.vf16.itof15(Mask::w, vu.vf16); - // lq.xyzw vf14, 1(vi08) | nop - lq_buffer_xyzw(vu.vf14, vu.vi08 + 1); - // nop | nop - - // nop | nop - - // sq.xyzw vf13, 0(vi10) | nop - sq_buffer_xyzw(vu.vf13, vu.vi10); - // sq.xyzw vf14, 1(vi10) | add.w vf16, vf16, vf15 - vu.vf16.add(Mask::w, vu.vf16, vu.vf15); sq_buffer_xyzw(vu.vf14, vu.vi10 + 1); - // nop | nop - - // nop | nop - - // nop | nop - - // sq.xyzw vf16, 2(vi10) | nop - sq_buffer_xyzw(vu.vf16, vu.vi10 + 2); - L179: -// BRANCH! - // ibne vi00, vi15, L180 | nop - bc = (vu.vi15 != 0); - // nop | nop - - if (bc) { goto L180; } - - - // xgkick vi04 | nop - xgkick(vu.vi04, render_state, prof); - // nop | nop :e - return; - - // nop | nop - - L180: - // lq.xyzw vf20, 132(vi00) | nop - lq_buffer_xyzw(vu.vf20, 132); - // lq.xyzw vf21, 1(vi00) | nop - lq_buffer_xyzw(vu.vf21, 1); - // iaddi vi01, vi00, 0x1 | nop - vu.vi01 = 1; - // isw.x vi01, -2(vi04) | nop - isw_buffer(Mask::x, vu.vi01, vu.vi04 + -2); - // iaddiu vi02, vi00, 0x47 | maxw.x vf20, vf00, vf20 - vu.vf20.max(Mask::x, vu.vf00, vu.vf20.w()); vu.vi02 = 0x47; /* 71 */ - - // isw.z vi02, -1(vi04) | nop - isw_buffer(Mask::z, vu.vi02, vu.vi04 + -1); - // sq.yzw vf21, -2(vi04) | nop - sq_buffer(Mask::yzw, vu.vf21, vu.vi04 + -2); - // isw.w vi00, 132(vi00) | nop - isw_buffer(Mask::w, vu.vi00, 132); - // sq.x vf20, -1(vi04) | nop - sq_buffer(Mask::x, vu.vf20, vu.vi04 + -1); - // iaddi vi04, vi04, -0x2 | nop - vu.vi04 = vu.vi04 + -2; - // xgkick vi04 | nop - xgkick(vu.vi04, render_state, prof); - // nop | nop :e -} - diff --git a/game/graphics/opengl_renderer/MercRenderer.cpp b/game/graphics/opengl_renderer/MercRenderer.cpp deleted file mode 100644 index ce52d2895c..0000000000 --- a/game/graphics/opengl_renderer/MercRenderer.cpp +++ /dev/null @@ -1,360 +0,0 @@ -#include "MercRenderer.h" - -#include "third-party/imgui/imgui.h" - -MercRenderer::MercRenderer(const std::string& name, BucketId my_id) - : BucketRenderer(name, my_id), - m_direct(fmt::format("{}-dir", name), my_id, 0x30000), - m_direct2(20000, 40000, 1000, name, false) { - memset(m_buffer.data, 0, sizeof(m_buffer.data)); -} - -void MercRenderer::init_shaders(ShaderLibrary& shaders) { - m_direct2.init_shaders(shaders); -} - -void MercRenderer::render(DmaFollower& dma, - SharedRenderState* render_state, - ScopedProfilerNode& prof) { - m_stats = Stats(); - - // skip if disabled - if (!m_enabled) { - while (dma.current_tag_offset() != render_state->next_bucket) { - dma.read_and_advance(); - } - return; - } - - // process the first tag. this is just jumping to the merc-specific dma. - auto data0 = dma.read_and_advance(); - ASSERT(data0.vif1() == 0); - ASSERT(data0.vif0() == 0); - ASSERT(data0.size_bytes == 0); - if (dma.current_tag().kind == DmaTag::Kind::CALL) { - // renderer didn't run, let's just get out of here. - for (int i = 0; i < 4; i++) { - dma.read_and_advance(); - } - ASSERT(dma.current_tag_offset() == render_state->next_bucket); - return; - } - m_stats.had_data = true; - ASSERT(data0.size_bytes == 0); - ASSERT(data0.vif0() == 0); - ASSERT(data0.vif1() == 0); - - // if we reach here, there's stuff to draw - handle_setup(dma, render_state, prof); - - m_direct2.reset_state(); - m_direct.reset_state(); - - while (dma.current_tag_offset() != render_state->next_bucket) { - handle_merc_chain(dma, render_state, prof); - } - ASSERT(dma.current_tag_offset() == render_state->next_bucket); - m_direct2.flush_pending(render_state, prof); - - m_direct.flush_pending(render_state, prof); -} - -bool tag_is_nothing_next(const DmaFollower& dma) { - return dma.current_tag().kind == DmaTag::Kind::NEXT && dma.current_tag().qwc == 0 && - dma.current_tag_vif0() == 0 && dma.current_tag_vif1() == 0; -} - -void MercRenderer::unpack32(const VifCodeUnpack& up, const u8* data, u32 imm) { - ASSERT(!up.is_unsigned); - u32 addr = up.addr_qw; - ASSERT(imm != 0); - ASSERT(!m_vif.stmod); - if (up.use_tops_flag) { - addr += xitop(); - } - - u32 start_in_buff = (addr)*16; - u32 end_in_buff = start_in_buff + imm * 16; - ASSERT(start_in_buff < sizeof(m_buffer.data)); - ASSERT(end_in_buff <= sizeof(m_buffer.data)); - memcpy(m_buffer.data + start_in_buff, data, imm * 16); -} - -void MercRenderer::unpack8(const VifCodeUnpack& up, const u8* data, u32 imm) { - // ASSERT(m_vif.stmod); - - ASSERT(up.is_unsigned); - u32 addr = up.addr_qw; - if (up.use_tops_flag) { - addr += xitop(); - } - ASSERT(imm != 0); - - u32 start_in_buff = (addr)*16; - u32 end_in_buff = start_in_buff + imm * 16; - ASSERT(start_in_buff < sizeof(m_buffer.data)); - ASSERT(end_in_buff <= sizeof(m_buffer.data)); - - u8* out_ptr = m_buffer.data + start_in_buff; - - if (m_vif.stmod) { - // use row - auto row = _mm_loadu_si128((const __m128i*)m_vif.row); - for (u32 qw = 0; qw < imm; qw++) { - _mm_storeu_si128((__m128i*)out_ptr, - _mm_add_epi32(row, _mm_cvtepu8_epi32(_mm_loadu_si64(data)))); - data += 4; - out_ptr += 16; - } - } else { - // no row - for (u32 qw = 0; qw < imm; qw++) { - _mm_storeu_si128((__m128i*)out_ptr, _mm_cvtepu8_epi32(_mm_loadu_si64(data))); - data += 4; - out_ptr += 16; - } - } - - /* - u32 row[4]; - if (m_vif.stmod) { - memcpy(row, m_vif.row, 16); - } else { - memset(row, 0, 16); - } - - u32 temp[4]; - for (u32 i = 0; i < imm; i++) { - for (u32 j = 0; j < 4; j++) { - temp[j] = row[j] + data[4 * i + j]; - } - memcpy(m_buffer.data + start_in_buff + i * 16, temp, 16); - } - */ -} - -void MercRenderer::handle_merc_chain(DmaFollower& dma, - SharedRenderState* render_state, - ScopedProfilerNode& prof) { - // fmt::print("DMA: {}\n", dma.current_tag().print()); - while (tag_is_nothing_next(dma)) { - auto nothing = dma.read_and_advance(); - ASSERT(nothing.size_bytes == 0); - } - if (dma.current_tag().kind == DmaTag::Kind::CALL) { - for (int i = 0; i < 4; i++) { - dma.read_and_advance(); - } - return; - } - - auto init = dma.read_and_advance(); - - ASSERT(init.vifcode0().kind == VifCode::Kind::STROW); - ASSERT(init.size_bytes == 16); - m_vif.row[0] = init.vif1(); - memcpy(m_vif.row + 1, init.data, 12); - u32 extra; - memcpy(&extra, init.data + 12, 4); - ASSERT(extra == 0); - DmaTransfer next; - - bool setting_up = true; - u32 mscal_addr = -1; - while (setting_up) { - next = dma.read_and_advance(); - u32 offset_in_data = 0; - // fmt::print("START {} : {} {}\n", next.size_bytes, next.vifcode0().print(), - // next.vifcode1().print()); - auto vif0 = next.vifcode0(); - switch (vif0.kind) { - case VifCode::Kind::NOP: - case VifCode::Kind::FLUSHE: - break; - case VifCode::Kind::STMOD: - ASSERT(vif0.immediate == 0 || vif0.immediate == 1); - m_vif.stmod = vif0.immediate; - break; - default: - ASSERT(false); - } - - auto vif1 = next.vifcode1(); - switch (vif1.kind) { - case VifCode::Kind::UNPACK_V4_8: { - // todo unpack - m_stats.unpack_count++; - m_stats.unpack_bytes += vif1.num * 4; - VifCodeUnpack up(vif1); - unpack8(up, next.data, vif1.num); - offset_in_data += 4 * vif1.num; - } break; - case VifCode::Kind::UNPACK_V4_32: { - // todo unpack - VifCodeUnpack up(vif1); - unpack32(up, next.data, vif1.num); - m_stats.unpack_bytes += vif1.num * 16; - offset_in_data += 16 * vif1.num; - } break; - case VifCode::Kind::MSCAL: - mscal_addr = vif1.immediate; - ASSERT(next.size_bytes == 0); - setting_up = false; - break; - default: - ASSERT(false); - } - - ASSERT(offset_in_data <= next.size_bytes); - if (offset_in_data < next.size_bytes) { - ASSERT((offset_in_data % 4) == 0); - u32 leftover = next.size_bytes - offset_in_data; - if (leftover < 16) { - for (u32 i = 0; i < leftover; i++) { - ASSERT(next.data[offset_in_data + i] == 0); - } - } else { - ASSERT(false); - } - } - } - - m_dbf = !m_dbf; - switch (mscal_addr) { - case 17: - m_stats.mscal_17++; - if (m_enable_prime_mscals) { - mscal(17, render_state, prof); - } - break; - case 32: - m_stats.mscal_32++; - if (m_enable_prime_mscals) { - mscal(32, render_state, prof); - } - break; - - case 20: - m_stats.mscal_20++; - if (m_enable_normal_mscals) { - mscal(20, render_state, prof); - } - break; - case 35: - m_stats.mscal_35++; - if (m_enable_normal_mscals) { - mscal(35, render_state, prof); - } - break; - default: - fmt::print("unknown mscal: {}\n", mscal_addr); - ASSERT(false); - } - - // while (true) { - // next = dma.read_and_advance(); - // if (next.vif0() == 0 && next.vifcode1().kind == VifCode::Kind::UNPACK_V4_8) { - // - // } else { - // fmt::print("{} : {} {}\n", next.size_bytes, next.vifcode0().print(), - // next.vifcode1().print()); ASSERT(false); - // } - // } -} - -/*! - * Handle the setup DMA data prepared by merc-vu1-init-buffer in GOAL - */ -void MercRenderer::handle_setup(DmaFollower& dma, - SharedRenderState* render_state, - ScopedProfilerNode& prof) { - auto first = dma.read_and_advance(); - - // 10 quadword setup packet - ASSERT(first.size_bytes == 10 * 16); - // m_stats.str += fmt::format("Setup 0: {} {} {}", first.size_bytes / 16, - // first.vifcode0().print(), first.vifcode1().print()); - - // transferred vifcodes - { - auto vif0 = first.vifcode0(); - auto vif1 = first.vifcode1(); - // STCYCL 4, 4 - ASSERT(vif0.kind == VifCode::Kind::STCYCL); - auto vif0_st = VifCodeStcycl(vif0); - ASSERT(vif0_st.cl == 4 && vif0_st.wl == 4); - // STMOD - ASSERT(vif1.kind == VifCode::Kind::STMOD); - ASSERT(vif1.immediate == 0); - } - - // 1 qw with 4 vifcodes. - u32 vifcode_data[4]; - memcpy(vifcode_data, first.data, 16); - { - auto vif0 = VifCode(vifcode_data[0]); - ASSERT(vif0.kind == VifCode::Kind::BASE); - ASSERT(vif0.immediate == MercDataMemory::BUFFER_BASE); - auto vif1 = VifCode(vifcode_data[1]); - ASSERT(vif1.kind == VifCode::Kind::OFFSET); - ASSERT((s16)vif1.immediate == MercDataMemory::BUFFER_OFFSET); - auto vif2 = VifCode(vifcode_data[2]); - ASSERT(vif2.kind == VifCode::Kind::NOP); - auto vif3 = VifCode(vifcode_data[3]); - ASSERT(vif3.kind == VifCode::Kind::UNPACK_V4_32); - VifCodeUnpack up(vif3); - ASSERT(up.addr_qw == MercDataMemory::LOW_MEMORY); - ASSERT(!up.use_tops_flag); - ASSERT(vif3.num == 8); - } - - // 8 qw's of low memory data - memcpy(&m_low_memory, first.data + 16, sizeof(LowMemory)); - m_stats.str += fmt::format("Fog: {}\n", m_low_memory.fog.to_string_aligned()); - - // 1 qw with another 4 vifcodes. - u32 vifcode_final_data[4]; - memcpy(vifcode_final_data, first.data + 16 + sizeof(LowMemory), 16); - { - ASSERT(VifCode(vifcode_final_data[0]).kind == VifCode::Kind::FLUSHE); - ASSERT(vifcode_final_data[1] == 0); - ASSERT(vifcode_final_data[2] == 0); - VifCode mscal(vifcode_final_data[3]); - ASSERT(mscal.kind == VifCode::Kind::MSCAL); - ASSERT(mscal.immediate == 0); - } - - // copy low memory into the VU "emulation" RAM. - memcpy(m_buffer.data, &m_low_memory, sizeof(LowMemory)); - mscal(0, render_state, prof); - - auto second = dma.read_and_advance(); - ASSERT(second.size_bytes == 32); // setting up test register. - m_direct.render_gif(second.data, 32, render_state, prof); - auto nothing = dma.read_and_advance(); - ASSERT(nothing.size_bytes == 0); - ASSERT(nothing.vif0() == 0); - ASSERT(nothing.vif1() == 0); -} - -void MercRenderer::draw_debug_window() { - ImGui::Text("Ran? %d\n", m_stats.had_data); - ImGui::Text("%d unpacks, %d bytes\n", m_stats.unpack_count, m_stats.unpack_bytes); - ImGui::Text("MSCAL: [17] %d [20] %d [32] %d [35] %d \n", m_stats.mscal_17, m_stats.mscal_20, - m_stats.mscal_32, m_stats.mscal_35); - ImGui::Text("Debug:\n%s\n", m_stats.str.c_str()); - ImGui::Checkbox("Normal MSCAL enable", &m_enable_normal_mscals); - ImGui::Checkbox("Prime MSCAL enable", &m_enable_prime_mscals); - ImGui::Checkbox("Send to direct", &m_enable_send_to_direct); - m_direct2.draw_debug_window(); -} - -void MercRenderer::xgkick(u16 addr, SharedRenderState* render_state, ScopedProfilerNode& prof) { - if (m_enable_send_to_direct && render_state->enable_merc_xgkick) { - if (render_state->use_direct2) { - m_direct2.render_gif_data(m_buffer.data + (16 * addr), render_state, prof); - } else { - m_direct.render_gif(m_buffer.data + (16 * addr), UINT32_MAX, render_state, prof); - } - } -} diff --git a/game/graphics/opengl_renderer/MercRenderer.h b/game/graphics/opengl_renderer/MercRenderer.h deleted file mode 100644 index fe5e88dae5..0000000000 --- a/game/graphics/opengl_renderer/MercRenderer.h +++ /dev/null @@ -1,124 +0,0 @@ -#pragma once - -#include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "common/math/Vector.h" -#include "game/graphics/opengl_renderer/DirectRenderer.h" -#include "game/common/vu.h" -#include "game/graphics/opengl_renderer/DirectRenderer2.h" - -class MercRenderer : public BucketRenderer { - public: - MercRenderer(const std::string& name, BucketId my_id); - void init_shaders(ShaderLibrary& shaders) override; - - void render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) override; - void draw_debug_window() override; - - private: - void handle_setup(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof); - void handle_merc_chain(DmaFollower& dma, - SharedRenderState* render_state, - ScopedProfilerNode& prof); - void unpack8(const VifCodeUnpack& up, const u8* data, u32 imm); - void unpack32(const VifCodeUnpack& up, const u8* data, u32 imm); - - void mscal(int enter_address, SharedRenderState* render_state, ScopedProfilerNode& prof); - - template - void mscal_impl(int enter_address, SharedRenderState* render_state, ScopedProfilerNode& prof); - - void xgkick(u16 addr, SharedRenderState* render_state, ScopedProfilerNode& prof); - - enum MercDataMemory { - LOW_MEMORY = 0, - BUFFER_BASE = 442, - // this negative offset is what broke jak graphics in Dobiestation for a long time. - BUFFER_OFFSET = -442 - }; - - struct LowMemory { - u8 tri_strip_tag[16]; - u8 ad_gif_tag[16]; - math::Vector4f hvdf_offset; - math::Vector4f perspective[4]; - math::Vector4f fog; - } m_low_memory; - static_assert(sizeof(LowMemory) == 0x80); - - struct alignas(16) BufferMemory { - u8 data[1024 * 16]; - } m_buffer; - - void sq_buffer(Mask mask, const Vf& data, u32 qw) { - // if (data.x_as_u32() == 0x80000000 && data.y_as_u32() == 0x80000000) { - // fmt::print("big store line {}: {} : {} {} {} {}\n", line_number, qw, data.x(), data.y(), - // data.z(), data.w()); - // } - // sketchy... - // qw &= 1023; - ASSERT(qw * 16 < sizeof(m_buffer.data)); - for (int i = 0; i < 4; i++) { - if ((u64)mask & (1 << i)) { - memcpy(m_buffer.data + qw * 16 + i * 4, data.data + i, 4); - } - } - } - - void lq_buffer(Mask mask, Vf& dest, u16 addr); - - template - void lq_buffer_xyzw(Vf& dest, u16 addr); - - template - void lq_buffer_xyz(Vf& dest, u16 addr); - - template - void sq_buffer_xyzw(const Vf& src, u16 addr); - - void isw_buffer(Mask mask, u16 val, u16 addr); - void ilw_buffer(Mask mask, u16& dest, u16 addr); - - u16 xtop(); - u16 xitop(); - - DirectRenderer m_direct; - DirectRenderer2 m_direct2; - - struct { - u32 row[4] = {0, 0, 0, 0}; - bool stmod = false; - } m_vif; - - struct Stats { - int unpack_count = 0; - int unpack_bytes = 0; - int mscal_35 = 0; - int mscal_20 = 0; - int mscal_17 = 0; - int mscal_32 = 0; - bool had_data = false; - std::string str; - } m_stats; - - bool m_dbf = false; - - bool m_enable_prime_mscals = true; - bool m_enable_normal_mscals = true; - bool m_enable_send_to_direct = true; - - struct Vu { - Vf vf01, vf02, vf03, vf04, vf05, vf06, vf07, vf08, vf09, vf10, vf11, vf12, vf13, vf14, vf15, - vf16, vf17, vf18, vf19, vf20, vf21, vf22, vf23, vf24, vf25, vf26, vf27, vf28, vf29, vf30, - vf31; - const Vf vf00; - u16 vi01, vi02, vi03, vi04, vi05, vi06, vi07, vi09, vi08, vi11, vi12, vi13, vi10, vi14, vi15; - float I, P, Q; - - Accumulator acc; - const u16 vi00 = 0; - - u16 hack_old_vi15 = 0; - - Vu() : vf00(0, 0, 0, 1) {} - } vu; -}; diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index 340201051f..431c51614d 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -1,26 +1,30 @@ #include "OpenGLRenderer.h" #include "common/log/log.h" -#include "game/graphics/pipelines/opengl.h" -#include "game/graphics/opengl_renderer/DirectRenderer.h" -#include "game/graphics/opengl_renderer/SpriteRenderer.h" -#include "game/graphics/opengl_renderer/TextureUploadHandler.h" -#include "third-party/imgui/imgui.h" #include "common/util/FileUtil.h" -#include "game/graphics/opengl_renderer/SkyRenderer.h" -#include "game/graphics/opengl_renderer/Sprite3.h" -#include "game/graphics/opengl_renderer/background/TFragment.h" -#include "game/graphics/opengl_renderer/background/Tie3.h" -#include "game/graphics/opengl_renderer/background/Shrub.h" -#include "game/graphics/opengl_renderer/MercRenderer.h" + +#include "game/graphics/opengl_renderer/DirectRenderer.h" #include "game/graphics/opengl_renderer/EyeRenderer.h" #include "game/graphics/opengl_renderer/ShadowRenderer.h" -#include "game/graphics/opengl_renderer/GenericRenderer.h" +#include "game/graphics/opengl_renderer/SkyRenderer.h" +#include "game/graphics/opengl_renderer/Sprite3.h" +#include "game/graphics/opengl_renderer/SpriteRenderer.h" +#include "game/graphics/opengl_renderer/TextureUploadHandler.h" +#include "game/graphics/opengl_renderer/background/Shrub.h" +#include "game/graphics/opengl_renderer/background/TFragment.h" +#include "game/graphics/opengl_renderer/background/Tie3.h" +#include "game/graphics/opengl_renderer/foreground/Generic2.h" +#include "game/graphics/opengl_renderer/foreground/Merc2.h" #include "game/graphics/opengl_renderer/ocean/OceanMidAndFar.h" #include "game/graphics/opengl_renderer/ocean/OceanNear.h" +#include "game/graphics/pipelines/opengl.h" + +#include "third-party/imgui/imgui.h" // for the vif callback -#include "game/kernel/kmachine.h" +#include "game/kernel/common/kmachine.h" +#include "game/runtime.h" + namespace { std::string g_current_render; @@ -55,7 +59,6 @@ OpenGLRenderer::OpenGLRenderer(std::shared_ptr texture_pool, std::shared_ptr loader) : m_render_state(texture_pool, loader) { // setup OpenGL errors - glEnable(GL_DEBUG_OUTPUT); glDebugMessageCallback(opengl_error_callback, nullptr); // disable specific errors @@ -107,11 +110,11 @@ void OpenGLRenderer::init_bucket_renderers() { // 9 : TIE_LEVEL0 init_bucket_renderer("l0-tfrag-tie", BucketCategory::TIE, BucketId::TIE_LEVEL0, 0); // 10 : MERC_TFRAG_TEX_LEVEL0 - init_bucket_renderer("l0-tfrag-merc", BucketCategory::MERC, - BucketId::MERC_TFRAG_TEX_LEVEL0); + init_bucket_renderer("l0-tfrag-merc", BucketCategory::MERC, + BucketId::MERC_TFRAG_TEX_LEVEL0); // 11 : GMERC_TFRAG_TEX_LEVEL0 - init_bucket_renderer("l0-tfrag-gmerc", BucketCategory::GENERIC_MERC, - BucketId::GMERC_TFRAG_TEX_LEVEL0); + init_bucket_renderer("l0-tfrag-generic", BucketCategory::GENERIC, + BucketId::GENERIC_TFRAG_TEX_LEVEL0, 1500000, 10000, 10000, 800); //----------------------- // LEVEL 1 tfrag texture @@ -127,11 +130,11 @@ void OpenGLRenderer::init_bucket_renderers() { // 16 : TIE_LEVEL1 init_bucket_renderer("l1-tfrag-tie", BucketCategory::TIE, BucketId::TIE_LEVEL1, 1); // 17 : MERC_TFRAG_TEX_LEVEL1 - init_bucket_renderer("l1-tfrag-merc", BucketCategory::MERC, - BucketId::MERC_TFRAG_TEX_LEVEL1); + init_bucket_renderer("l1-tfrag-merc", BucketCategory::MERC, + BucketId::MERC_TFRAG_TEX_LEVEL1); // 18 : GMERC_TFRAG_TEX_LEVEL1 - init_bucket_renderer("l1-tfrag-gmerc", BucketCategory::GENERIC_MERC, - BucketId::GMERC_TFRAG_TEX_LEVEL1); + init_bucket_renderer("l1-tfrag-generic", BucketCategory::GENERIC, + BucketId::GENERIC_TFRAG_TEX_LEVEL1, 1500000, 10000, 10000, 800); //----------------------- // LEVEL 0 shrub texture @@ -158,8 +161,8 @@ void OpenGLRenderer::init_bucket_renderers() { // 28 : SHRUB_BILLBOARD_LEVEL1 // 29 : SHRUB_TRANS_LEVEL1 // 30 : SHRUB_GENERIC_LEVEL1 - init_bucket_renderer("mystery-generic", BucketCategory::GENERIC_MERC, - BucketId::SHRUB_GENERIC_LEVEL1); + init_bucket_renderer("mystery-generic", BucketCategory::GENERIC, + BucketId::SHRUB_GENERIC_LEVEL1); //----------------------- // LEVEL 0 alpha texture @@ -195,11 +198,11 @@ void OpenGLRenderer::init_bucket_renderers() { BucketId::TFRAG_ICE_LEVEL1, ice_tfrags, false, 1); // 44 - init_bucket_renderer("common-alpha-merc", BucketCategory::MERC, - BucketId::MERC_AFTER_ALPHA); + init_bucket_renderer("common-alpha-merc", BucketCategory::MERC, + BucketId::MERC_AFTER_ALPHA); - init_bucket_renderer("common-alpha-generic", BucketCategory::GENERIC_MERC, - BucketId::GENERIC_ALPHA); // 46 + init_bucket_renderer("common-alpha-generic", BucketCategory::GENERIC, + BucketId::GENERIC_ALPHA); // 46 init_bucket_renderer("shadow", BucketCategory::OTHER, BucketId::SHADOW); // 47 //----------------------- @@ -207,48 +210,50 @@ void OpenGLRenderer::init_bucket_renderers() { //----------------------- init_bucket_renderer("l0-pris-tex", BucketCategory::TEX, BucketId::PRIS_TEX_LEVEL0); // 48 - init_bucket_renderer("l0-pris-merc", BucketCategory::MERC, - BucketId::MERC_PRIS_LEVEL0); // 49 - init_bucket_renderer("l0-pris-generic", BucketCategory::GENERIC_MERC, - BucketId::GENERIC_PRIS_LEVEL0); // 50 + init_bucket_renderer("l0-pris-merc", BucketCategory::MERC, + BucketId::MERC_PRIS_LEVEL0); // 49 + init_bucket_renderer("l0-pris-generic", BucketCategory::GENERIC, + BucketId::GENERIC_PRIS_LEVEL0); // 50 //----------------------- // LEVEL 1 pris texture //----------------------- init_bucket_renderer("l1-pris-tex", BucketCategory::TEX, BucketId::PRIS_TEX_LEVEL1); // 51 - init_bucket_renderer("l1-pris-merc", BucketCategory::MERC, - BucketId::MERC_PRIS_LEVEL1); // 52 - init_bucket_renderer("l1-pris-generic", BucketCategory::GENERIC_MERC, - BucketId::GENERIC_PRIS_LEVEL1); // 53 + init_bucket_renderer("l1-pris-merc", BucketCategory::MERC, + BucketId::MERC_PRIS_LEVEL1); // 52 + init_bucket_renderer("l1-pris-generic", BucketCategory::GENERIC, + BucketId::GENERIC_PRIS_LEVEL1); // 53 // other renderers may output to the eye renderer m_render_state.eye_renderer = init_bucket_renderer( "common-pris-eyes", BucketCategory::OTHER, BucketId::MERC_EYES_AFTER_PRIS); // 54 - init_bucket_renderer("common-pris-merc", BucketCategory::MERC, - BucketId::MERC_AFTER_PRIS); // 55 - init_bucket_renderer("common-pris-generic", BucketCategory::GENERIC_MERC, - BucketId::GENERIC_PRIS); // 56 + + // hack: set to merc2 for debugging + init_bucket_renderer("common-pris-merc", BucketCategory::MERC, + BucketId::MERC_AFTER_PRIS); // 55 + init_bucket_renderer("common-pris-generic", BucketCategory::GENERIC, + BucketId::GENERIC_PRIS); // 56 //----------------------- // LEVEL 0 water texture //----------------------- init_bucket_renderer("l0-water-tex", BucketCategory::TEX, BucketId::WATER_TEX_LEVEL0); // 57 - init_bucket_renderer("l0-water-merc", BucketCategory::MERC, - BucketId::MERC_WATER_LEVEL0); // 58 - init_bucket_renderer("l0-water-generic", BucketCategory::GENERIC_MERC, - BucketId::GENERIC_WATER_LEVEL0); // 59 + init_bucket_renderer("l0-water-merc", BucketCategory::MERC, + BucketId::MERC_WATER_LEVEL0); // 58 + init_bucket_renderer("l0-water-generic", BucketCategory::GENERIC, + BucketId::GENERIC_WATER_LEVEL0); // 59 //----------------------- // LEVEL 1 water texture //----------------------- init_bucket_renderer("l1-water-tex", BucketCategory::TEX, BucketId::WATER_TEX_LEVEL1); // 60 - init_bucket_renderer("l1-water-merc", BucketCategory::MERC, - BucketId::MERC_WATER_LEVEL1); // 61 - init_bucket_renderer("l1-water-generic", BucketCategory::GENERIC_MERC, - BucketId::GENERIC_WATER_LEVEL1); // 62 + init_bucket_renderer("l1-water-merc", BucketCategory::MERC, + BucketId::MERC_WATER_LEVEL1); // 61 + init_bucket_renderer("l1-water-generic", BucketCategory::GENERIC, + BucketId::GENERIC_WATER_LEVEL1); // 62 init_bucket_renderer("ocean-near", BucketCategory::OCEAN, BucketId::OCEAN_NEAR); // 63 // 64? @@ -266,10 +271,11 @@ void OpenGLRenderer::init_bucket_renderers() { init_bucket_renderer("sprite", BucketCategory::SPRITE, BucketId::SPRITE, std::move(sprite_renderers)); // 66 - init_bucket_renderer("debug-draw-0", BucketCategory::OTHER, - BucketId::DEBUG_DRAW_0, 0x20000); - init_bucket_renderer("debug-draw-1", BucketCategory::OTHER, - BucketId::DEBUG_DRAW_1, 0x8000); + init_bucket_renderer("debug", BucketCategory::OTHER, BucketId::DEBUG, 0x20000); + init_bucket_renderer("debug-no-zbuf", BucketCategory::OTHER, + BucketId::DEBUG_NO_ZBUF, 0x8000); + init_bucket_renderer("subtitle", BucketCategory::OTHER, BucketId::SUBTITLE, + 0x2000); // for now, for any unset renderers, just set them to an EmptyBucketRenderer. for (size_t i = 0; i < m_bucket_renderers.size(); i++) { @@ -294,7 +300,6 @@ void OpenGLRenderer::render(DmaFollower dma, const RenderOptions& settings) { m_render_state.reset(); m_render_state.ee_main_memory = g_ee_main_mem; m_render_state.offset_of_s7 = offset_of_s7(); - m_render_state.has_camera_planes = false; { auto prof = m_profiler.root()->make_scoped_child("frame-setup"); @@ -354,6 +359,10 @@ void OpenGLRenderer::render(DmaFollower dma, const RenderOptions& settings) { m_small_profiler.draw(m_render_state.load_status_debug, stats); } + if (settings.draw_subtitle_editor_window) { + m_subtitle_editor.draw_window(); + } + if (settings.save_screenshot) { finish_screenshot(settings.screenshot_path, settings.window_width_px, settings.window_height_px, settings.lbox_width_px, settings.lbox_height_px); @@ -366,14 +375,12 @@ void OpenGLRenderer::render(DmaFollower dma, const RenderOptions& settings) { void OpenGLRenderer::draw_renderer_selection_window() { ImGui::Begin("Renderer Debug"); + ImGui::Checkbox("Use old single-draw", &m_render_state.no_multidraw); ImGui::SliderFloat("Fog Adjust", &m_render_state.fog_intensity, 0, 10); ImGui::Checkbox("Sky CPU", &m_render_state.use_sky_cpu); ImGui::Checkbox("Occlusion Cull", &m_render_state.use_occlusion_culling); ImGui::Checkbox("Merc XGKICK", &m_render_state.enable_merc_xgkick); - ImGui::Checkbox("Generic XGKICK", &m_render_state.enable_generic_xgkick); ImGui::Checkbox("Blackout Loads", &m_enable_fast_blackout_loads); - ImGui::Checkbox("Direct 2", &m_render_state.use_direct2); - ImGui::Checkbox("Generic 2", &m_render_state.use_generic2); for (size_t i = 0; i < m_bucket_renderers.size(); i++) { auto renderer = m_bucket_renderers[i].get(); @@ -456,6 +463,13 @@ void OpenGLRenderer::dispatch_buckets(DmaFollower dma, ScopedProfilerNode& prof) m_render_state.next_bucket += 16; vif_interrupt_callback(); m_category_times[(int)m_bucket_categories[bucket_id]] += bucket_prof.get_elapsed_time(); + + // hack to draw the collision mesh in the middle the drawing + if (bucket_id == (int)BucketId::ALPHA_TEX_LEVEL0 - 1 && + Gfx::g_global_settings.collision_enable) { + auto p = prof.make_scoped_child("collision-draw"); + m_collide_renderer.render(&m_render_state, p); + } } g_current_render = ""; @@ -501,4 +515,4 @@ void OpenGLRenderer::do_pcrtc_effects(float alp, glEnable(GL_DEPTH_TEST); } -} \ No newline at end of file +} diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.h b/game/graphics/opengl_renderer/OpenGLRenderer.h index bc2e5e98b9..3e9794409b 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.h +++ b/game/graphics/opengl_renderer/OpenGLRenderer.h @@ -4,10 +4,13 @@ #include #include "common/dma/dma_chain_read.h" -#include "game/graphics/opengl_renderer/Shader.h" + #include "game/graphics/opengl_renderer/BucketRenderer.h" +#include "game/graphics/opengl_renderer/CollideMeshRenderer.h" #include "game/graphics/opengl_renderer/Profiler.h" +#include "game/graphics/opengl_renderer/Shader.h" #include "game/graphics/opengl_renderer/opengl_utils.h" +#include "game/tools/subtitles/subtitle_editor.h" struct RenderOptions { int window_height_px = 0; @@ -17,6 +20,7 @@ struct RenderOptions { bool draw_render_debug_window = false; bool draw_profiler_window = false; bool draw_small_profiler_window = false; + bool draw_subtitle_editor_window = false; bool save_screenshot = false; std::string screenshot_path; @@ -24,9 +28,19 @@ struct RenderOptions { float pmode_alp_register = 0.f; }; +/*! + * Main OpenGL renderer. + * This handles the glClear and all game rendering, but not actual setup, synchronization or imgui + * stuff. + * + * It is simply a collection of bucket renderers, and a few special case ones. + */ class OpenGLRenderer { public: OpenGLRenderer(std::shared_ptr texture_pool, std::shared_ptr loader); + + // rendering interface: takes the dma chain from the game, and some size/debug settings from + // the graphics system. void render(DmaFollower dma, const RenderOptions& settings); private: @@ -36,7 +50,6 @@ 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); - template T* init_bucket_renderer(const std::string& name, BucketCategory cat, @@ -52,12 +65,14 @@ class OpenGLRenderer { SharedRenderState m_render_state; Profiler m_profiler; SmallProfiler m_small_profiler; + SubtitleEditor m_subtitle_editor; std::array, (int)BucketId::MAX_BUCKETS> m_bucket_renderers; std::array m_bucket_categories; std::array m_category_times; FullScreenDraw m_blackout_renderer; + CollideMeshRenderer m_collide_renderer; float m_last_pmode_alp = 1.; bool m_enable_fast_blackout_loads = true; diff --git a/game/graphics/opengl_renderer/Profiler.cpp b/game/graphics/opengl_renderer/Profiler.cpp index 3a6d1d82d3..430f6dbc44 100644 --- a/game/graphics/opengl_renderer/Profiler.cpp +++ b/game/graphics/opengl_renderer/Profiler.cpp @@ -1,11 +1,12 @@ -#include - #include "Profiler.h" +#include + #include "common/log/log.h" #include "common/util/colors.h" -#include "third-party/imgui/imgui.h" + #include "third-party/fmt/core.h" +#include "third-party/imgui/imgui.h" ProfilerNode::ProfilerNode(const std::string& name) : m_name(name) {} @@ -185,7 +186,7 @@ void FramePlot::draw(float max) { auto* me = (FramePlot*)data; return me->m_buffer[(me->m_idx + idx) % SIZE]; }, - (void*)this, SIZE, 0, nullptr, 0, max, ImVec2(300, 40)); + (void*)this, SIZE, 0, nullptr, 0, max, ImVec2(300, 20)); } void SmallProfiler::draw(const std::string& status, const SmallProfilerStats& stats) { @@ -219,4 +220,4 @@ void SmallProfiler::draw(const std::string& status, const SmallProfilerStats& st } } ImGui::End(); -} \ No newline at end of file +} diff --git a/game/graphics/opengl_renderer/Profiler.h b/game/graphics/opengl_renderer/Profiler.h index eade3f690d..ad701c96f1 100644 --- a/game/graphics/opengl_renderer/Profiler.h +++ b/game/graphics/opengl_renderer/Profiler.h @@ -1,10 +1,11 @@ #pragma once +#include #include #include -#include #include "common/common_types.h" +#include "common/global_profiler/GlobalProfiler.h" #include "common/util/Timer.h" #include "game/graphics/opengl_renderer/buckets.h" @@ -53,7 +54,8 @@ class ProfilerNode { class ScopedProfilerNode { public: - ScopedProfilerNode(ProfilerNode* node) : m_node(node) {} + ScopedProfilerNode(ProfilerNode* node) + : m_node(node), m_global_event(scoped_prof(node->name().c_str())) {} ScopedProfilerNode(const ScopedProfilerNode& other) = delete; ScopedProfilerNode& operator=(const ScopedProfilerNode& other) = delete; ProfilerNode* make_child(const std::string& name) { return m_node->make_child(name); } @@ -68,6 +70,7 @@ class ScopedProfilerNode { private: ProfilerNode* m_node; + ScopedEvent m_global_event; }; class Profiler { diff --git a/game/graphics/opengl_renderer/Shader.cpp b/game/graphics/opengl_renderer/Shader.cpp index 022c23718c..05b072e593 100644 --- a/game/graphics/opengl_renderer/Shader.cpp +++ b/game/graphics/opengl_renderer/Shader.cpp @@ -1,8 +1,10 @@ #include "Shader.h" -#include "common/util/FileUtil.h" + #include "common/log/log.h" -#include "game/graphics/pipelines/opengl.h" #include "common/util/Assert.h" +#include "common/util/FileUtil.h" + +#include "game/graphics/pipelines/opengl.h" Shader::Shader(const std::string& shader_name) { // read the shader source @@ -83,4 +85,10 @@ ShaderLibrary::ShaderLibrary() { at(ShaderId::OCEAN_COMMON) = {"ocean_common"}; at(ShaderId::SHRUB) = {"shrub"}; at(ShaderId::SHADOW) = {"shadow"}; + at(ShaderId::COLLISION) = {"collision"}; + at(ShaderId::MERC2) = {"merc2"}; + + for (auto& shader : m_shaders) { + ASSERT_MSG(shader.okay(), "Shader compiled"); + } } diff --git a/game/graphics/opengl_renderer/Shader.h b/game/graphics/opengl_renderer/Shader.h index 52d013928d..ec50baf37a 100644 --- a/game/graphics/opengl_renderer/Shader.h +++ b/game/graphics/opengl_renderer/Shader.h @@ -40,6 +40,8 @@ enum class ShaderId { OCEAN_COMMON = 15, SHADOW = 16, SHRUB = 17, + COLLISION = 18, + MERC2 = 19, MAX_SHADERS }; diff --git a/game/graphics/opengl_renderer/ShadowRenderer.cpp b/game/graphics/opengl_renderer/ShadowRenderer.cpp index 6245f35f69..4409e9ea05 100644 --- a/game/graphics/opengl_renderer/ShadowRenderer.cpp +++ b/game/graphics/opengl_renderer/ShadowRenderer.cpp @@ -1,8 +1,9 @@ #include "ShadowRenderer.h" -#include "third-party/imgui/imgui.h" #include +#include "third-party/imgui/imgui.h" + ShadowRenderer::ShadowRenderer(const std::string& name, BucketId my_id) : BucketRenderer(name, my_id) { // create OpenGL objects @@ -96,8 +97,8 @@ void ShadowRenderer::xgkick(u16 imm) { // fmt::print("rgba: {} {} {} {}: {}\n", rgba[0], rgba[1], rgba[2], rgba[3], Q); } break; default: - fmt::print("Address {} is not supported\n", register_address_name(addr)); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Address {} is not supported", + register_address_name(addr))); } } break; case GifTag::RegisterDescriptor::ST: { @@ -308,8 +309,7 @@ void ShadowRenderer::render(DmaFollower& dma, dma.read_and_advance(); } else { - fmt::print("{} {}\n", next.vifcode0().print(), next.vifcode1().print()); - ASSERT(false); + ASSERT_MSG(false, fmt::format("{} {}", next.vifcode0().print(), next.vifcode1().print())); } } @@ -423,4 +423,4 @@ void ShadowRenderer::draw(SharedRenderState* render_state, ScopedProfilerNode& p glDepthMask(GL_TRUE); glDisable(GL_STENCIL_TEST); -} \ No newline at end of file +} diff --git a/game/graphics/opengl_renderer/ShadowRenderer.h b/game/graphics/opengl_renderer/ShadowRenderer.h index 16f7e4647a..e7eaca1367 100644 --- a/game/graphics/opengl_renderer/ShadowRenderer.h +++ b/game/graphics/opengl_renderer/ShadowRenderer.h @@ -1,8 +1,7 @@ #pragma once -#include "game/graphics/opengl_renderer/BucketRenderer.h" - #include "game/common/vu.h" +#include "game/graphics/opengl_renderer/BucketRenderer.h" class ShadowRenderer : public BucketRenderer { public: diff --git a/game/graphics/opengl_renderer/Shadow_PS2.cpp b/game/graphics/opengl_renderer/Shadow_PS2.cpp index fed663f0b6..285cbb8f97 100644 --- a/game/graphics/opengl_renderer/Shadow_PS2.cpp +++ b/game/graphics/opengl_renderer/Shadow_PS2.cpp @@ -131,8 +131,7 @@ void ShadowRenderer::handle_jalr_to_end_block(u16 val, u32& first_flag, u32& sec // nop | nop 739 return; default: - fmt::print("unhandled end block: {}\n", val); - ASSERT(false); + ASSERT_MSG(false, fmt::format("unhandled end block: {}", val)); } } @@ -1715,8 +1714,7 @@ void ShadowRenderer::run_mscal_vu2c(u16 imm) { case 699: goto INSTR_699; default: - fmt::print("unknown vu.vi15 @ L46: {}\n", vu.vi15); - ASSERT(false); + ASSERT_MSG(false, fmt::format("unknown vu.vi15 @ L46: {}", vu.vi15)); } // clang-format off // nop | nop 663 @@ -1890,7 +1888,6 @@ void ShadowRenderer::run_mscal_vu2c(u16 imm) { case 527: goto INSTR_527; default: - fmt::print("unknown vu.vi15 @ 722: {}\n", vu.vi15); - ASSERT(false); + ASSERT_MSG(false, fmt::format("unknown vu.vi15 @ 722: {}", vu.vi15)); } } diff --git a/game/graphics/opengl_renderer/SkyBlendCPU.cpp b/game/graphics/opengl_renderer/SkyBlendCPU.cpp index 181966635c..0fc81fa979 100644 --- a/game/graphics/opengl_renderer/SkyBlendCPU.cpp +++ b/game/graphics/opengl_renderer/SkyBlendCPU.cpp @@ -1,9 +1,11 @@ #include "SkyBlendCPU.h" -#include "game/graphics/opengl_renderer/AdgifHandler.h" -#include "common/util/os.h" #include +#include "common/util/os.h" + +#include "game/graphics/opengl_renderer/AdgifHandler.h" + SkyBlendCPU::SkyBlendCPU() { for (int i = 0; i < 2; i++) { glGenTextures(1, &m_textures[i].gl); @@ -44,7 +46,7 @@ void blend_sky_initial_fast(u8 intensity, u8* out, const u8* in, u32 size) { tex_data16 = _mm_mullo_epi16(tex_data16, intensity_vec); tex_data16 = _mm_srli_epi16(tex_data16, 7); auto result = _mm_packus_epi16(tex_data16, tex_data16); - _mm_storeu_si64((__m128i*)(out + (i * 8)), result); + _mm_storel_epi64((__m128i*)(out + (i * 8)), result); } } } @@ -81,7 +83,7 @@ void blend_sky_fast(u8 intensity, u8* out, const u8* in, u32 size) { tex_data16 = _mm_min_epi16(max_intensity, tex_data16); auto result = _mm_packus_epi16(tex_data16, tex_data16); out_val = _mm_adds_epu8(out_val, result); - _mm_storeu_si64((__m128i*)(out + (i * 8)), out_val); + _mm_storel_epi64((__m128i*)(out + (i * 8)), out_val); } } /* @@ -151,13 +153,16 @@ SkyBlendStats SkyBlendCPU::do_sky_blends(DmaFollower& dma, } */ if (tex->get_data_ptr()) { - if (is_first_draw) { - blend_sky_initial_fast(intensity, m_texture_data[buffer_idx].data(), tex->get_data_ptr(), - tex->data_size()); - } else { - blend_sky_fast(intensity, m_texture_data[buffer_idx].data(), tex->get_data_ptr(), - tex->data_size()); + if (m_texture_data[buffer_idx].size() == tex->data_size()) { + if (is_first_draw) { + blend_sky_initial_fast(intensity, m_texture_data[buffer_idx].data(), tex->get_data_ptr(), + m_texture_data[buffer_idx].size()); + } else { + blend_sky_fast(intensity, m_texture_data[buffer_idx].data(), tex->get_data_ptr(), + m_texture_data[buffer_idx].size()); + } } + if (buffer_idx == 0) { if (is_first_draw) { stats.sky_draws++; @@ -194,7 +199,8 @@ void SkyBlendCPU::init_textures(TexturePool& tex_pool) { in.gpu_texture = m_textures[i].gl; in.w = m_sizes[i]; in.h = m_sizes[i]; - in.name = fmt::format("PC-SKY-CPU-{}", i); + in.debug_name = fmt::format("PC-SKY-CPU-{}", i); + in.id = tex_pool.allocate_pc_port_texture(); u32 tbp = SKY_TEXTURE_VRAM_ADDRS[i]; m_textures[i].tex = tex_pool.give_texture_and_load_to_vram(in, tbp); m_textures[i].tbp = tbp; diff --git a/game/graphics/opengl_renderer/SkyBlendCPU.h b/game/graphics/opengl_renderer/SkyBlendCPU.h index 77de41d1b6..116755c4f0 100644 --- a/game/graphics/opengl_renderer/SkyBlendCPU.h +++ b/game/graphics/opengl_renderer/SkyBlendCPU.h @@ -1,9 +1,10 @@ #pragma once #include "common/dma/dma_chain_read.h" + #include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/pipelines/opengl.h" #include "game/graphics/opengl_renderer/SkyBlendCommon.h" +#include "game/graphics/pipelines/opengl.h" class SkyBlendCPU { public: diff --git a/game/graphics/opengl_renderer/SkyBlendGPU.cpp b/game/graphics/opengl_renderer/SkyBlendGPU.cpp index 44ca9d70b9..5c0715fdbb 100644 --- a/game/graphics/opengl_renderer/SkyBlendGPU.cpp +++ b/game/graphics/opengl_renderer/SkyBlendGPU.cpp @@ -1,6 +1,7 @@ #include "SkyBlendGPU.h" #include "common/log/log.h" + #include "game/graphics/opengl_renderer/AdgifHandler.h" SkyBlendGPU::SkyBlendGPU() { @@ -65,7 +66,8 @@ void SkyBlendGPU::init_textures(TexturePool& tex_pool) { in.gpu_texture = m_textures[i]; in.w = m_sizes[i]; in.h = in.w; - in.name = fmt::format("PC-SKY-GPU-{}", i); + in.debug_name = fmt::format("PC-SKY-GPU-{}", i); + in.id = tex_pool.allocate_pc_port_texture(); u32 tbp = SKY_TEXTURE_VRAM_ADDRS[i]; m_tex_info[i] = {tex_pool.give_texture_and_load_to_vram(in, tbp), tbp}; } diff --git a/game/graphics/opengl_renderer/SkyBlendGPU.h b/game/graphics/opengl_renderer/SkyBlendGPU.h index 0b43e33f4e..ddce74a7ac 100644 --- a/game/graphics/opengl_renderer/SkyBlendGPU.h +++ b/game/graphics/opengl_renderer/SkyBlendGPU.h @@ -1,8 +1,9 @@ #include "common/dma/dma_chain_read.h" + #include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/pipelines/opengl.h" #include "game/graphics/opengl_renderer/SkyBlendCommon.h" +#include "game/graphics/pipelines/opengl.h" class SkyBlendGPU { public: diff --git a/game/graphics/opengl_renderer/SkyRenderer.cpp b/game/graphics/opengl_renderer/SkyRenderer.cpp index b58f2521a0..3d3a86172f 100644 --- a/game/graphics/opengl_renderer/SkyRenderer.cpp +++ b/game/graphics/opengl_renderer/SkyRenderer.cpp @@ -1,9 +1,12 @@ #include "SkyRenderer.h" -#include "third-party/imgui/imgui.h" -#include "game/graphics/pipelines/opengl.h" -#include "game/graphics/opengl_renderer/AdgifHandler.h" + #include "common/log/log.h" +#include "game/graphics/opengl_renderer/AdgifHandler.h" +#include "game/graphics/pipelines/opengl.h" + +#include "third-party/imgui/imgui.h" + // The sky texture system blends together sky textures from different levels and times of day // to create the final sky texture. diff --git a/game/graphics/opengl_renderer/SkyRenderer.h b/game/graphics/opengl_renderer/SkyRenderer.h index 019518413f..d677f6ccc1 100644 --- a/game/graphics/opengl_renderer/SkyRenderer.h +++ b/game/graphics/opengl_renderer/SkyRenderer.h @@ -1,10 +1,10 @@ #pragma once +#include "game/graphics//opengl_renderer/SkyBlendCPU.h" +#include "game/graphics//opengl_renderer/SkyBlendGPU.h" #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/DirectRenderer.h" #include "game/graphics/opengl_renderer/background/TFragment.h" -#include "game/graphics//opengl_renderer/SkyBlendGPU.h" -#include "game/graphics//opengl_renderer/SkyBlendCPU.h" /*! * Handles texture blending for the sky. diff --git a/game/graphics/opengl_renderer/Sprite3.cpp b/game/graphics/opengl_renderer/Sprite3.cpp index 2b91d9c515..f59a125d05 100644 --- a/game/graphics/opengl_renderer/Sprite3.cpp +++ b/game/graphics/opengl_renderer/Sprite3.cpp @@ -2,10 +2,11 @@ #include "Sprite3.h" +#include "game/graphics/opengl_renderer/background/background_common.h" +#include "game/graphics/opengl_renderer/dma_helpers.h" + #include "third-party/fmt/core.h" #include "third-party/imgui/imgui.h" -#include "game/graphics/opengl_renderer/dma_helpers.h" -#include "game/graphics/opengl_renderer/background/background_common.h" namespace { @@ -213,38 +214,24 @@ void Sprite3::render_2d_group0(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) { // opengl sprite frame setup - glUniform4fv(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "hvdf_offset"), - 1, m_3d_matrix_data.hvdf_offset.data()); - glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "pfog0"), - m_frame_data.pfog0); - glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "min_scale"), - m_frame_data.min_scale); - glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "max_scale"), - m_frame_data.max_scale); - glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "fog_min"), - m_frame_data.fog_min); - glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "fog_max"), - m_frame_data.fog_max); - glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "bonus"), - m_frame_data.bonus); - glUniform4fv(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "hmge_scale"), 1, - m_frame_data.hmge_scale.data()); - glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "deg_to_rad"), - m_frame_data.deg_to_rad); - glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "inv_area"), - m_frame_data.inv_area); - glUniformMatrix4fv(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "camera"), - 1, GL_FALSE, m_3d_matrix_data.camera.data()); - glUniform4fv(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "xy_array"), 8, - m_frame_data.xy_array[0].data()); - glUniform4fv(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "xyz_array"), 4, - m_frame_data.xyz_array[0].data()); - glUniform4fv(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "st_array"), 4, - m_frame_data.st_array[0].data()); - glUniform4fv(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "basis_x"), 1, - m_frame_data.basis_x.data()); - glUniform4fv(glGetUniformLocation(render_state->shaders[ShaderId::SPRITE3].id(), "basis_y"), 1, - m_frame_data.basis_y.data()); + auto shid = render_state->shaders[ShaderId::SPRITE3].id(); + glUniform4fv(glGetUniformLocation(shid, "hvdf_offset"), 1, m_3d_matrix_data.hvdf_offset.data()); + glUniform1f(glGetUniformLocation(shid, "pfog0"), m_frame_data.pfog0); + glUniform1f(glGetUniformLocation(shid, "min_scale"), m_frame_data.min_scale); + glUniform1f(glGetUniformLocation(shid, "max_scale"), m_frame_data.max_scale); + glUniform1f(glGetUniformLocation(shid, "fog_min"), m_frame_data.fog_min); + glUniform1f(glGetUniformLocation(shid, "fog_max"), m_frame_data.fog_max); + // glUniform1f(glGetUniformLocation(shid, "bonus"), m_frame_data.bonus); + // glUniform4fv(glGetUniformLocation(shid, "hmge_scale"), 1, m_frame_data.hmge_scale.data()); + glUniform1f(glGetUniformLocation(shid, "deg_to_rad"), m_frame_data.deg_to_rad); + glUniform1f(glGetUniformLocation(shid, "inv_area"), m_frame_data.inv_area); + glUniformMatrix4fv(glGetUniformLocation(shid, "camera"), 1, GL_FALSE, + m_3d_matrix_data.camera.data()); + glUniform4fv(glGetUniformLocation(shid, "xy_array"), 8, m_frame_data.xy_array[0].data()); + glUniform4fv(glGetUniformLocation(shid, "xyz_array"), 4, m_frame_data.xyz_array[0].data()); + glUniform4fv(glGetUniformLocation(shid, "st_array"), 4, m_frame_data.st_array[0].data()); + glUniform4fv(glGetUniformLocation(shid, "basis_x"), 1, m_frame_data.basis_x.data()); + glUniform4fv(glGetUniformLocation(shid, "basis_y"), 1, m_frame_data.basis_y.data()); u16 last_prog = -1; @@ -577,8 +564,7 @@ void Sprite3::handle_clamp(u64 val, SharedRenderState* /*render_state*/, ScopedProfilerNode& /*prof*/) { if (!(val == 0b101 || val == 0 || val == 1 || val == 0b100)) { - fmt::print("clamp: 0x{:x}\n", val); - ASSERT(false); + ASSERT_MSG(false, fmt::format("clamp: 0x{:x}", val)); } m_current_mode.set_clamp_s_enable(val & 0b001); @@ -650,7 +636,7 @@ void Sprite3::do_block_common(SpriteMode mode, flush_sprites(render_state, prof, mode == ModeHUD); } - if (mode == Mode2D && render_state->has_camera_planes && m_enable_culling) { + if (mode == Mode2D && render_state->has_pc_data && m_enable_culling) { // we can skip sprites that are out of view // it's probably possible to do this for 3D as well. auto bsphere = m_vec_data_2d[sprite_idx].xyz_sx; diff --git a/game/graphics/opengl_renderer/Sprite3.h b/game/graphics/opengl_renderer/Sprite3.h index 3ebc43d519..4b20be892f 100644 --- a/game/graphics/opengl_renderer/Sprite3.h +++ b/game/graphics/opengl_renderer/Sprite3.h @@ -1,14 +1,15 @@ #pragma once -#include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/opengl_renderer/DirectRenderer.h" +#include + #include "common/dma/gs.h" #include "common/math/Vector.h" -#include "game/graphics/opengl_renderer/sprite_common.h" -#include "game/graphics/opengl_renderer/background/background_common.h" -#include +#include "game/graphics/opengl_renderer/BucketRenderer.h" +#include "game/graphics/opengl_renderer/DirectRenderer.h" +#include "game/graphics/opengl_renderer/background/background_common.h" +#include "game/graphics/opengl_renderer/sprite_common.h" class Sprite3 : public BucketRenderer { public: diff --git a/game/graphics/opengl_renderer/SpriteRenderer.cpp b/game/graphics/opengl_renderer/SpriteRenderer.cpp index ab51fd48b6..dcd84df9de 100644 --- a/game/graphics/opengl_renderer/SpriteRenderer.cpp +++ b/game/graphics/opengl_renderer/SpriteRenderer.cpp @@ -1,8 +1,10 @@ +#include "SpriteRenderer.h" + +#include "game/graphics/opengl_renderer/background/background_common.h" +#include "game/graphics/opengl_renderer/dma_helpers.h" + #include "third-party/fmt/core.h" #include "third-party/imgui/imgui.h" -#include "SpriteRenderer.h" -#include "game/graphics/opengl_renderer/dma_helpers.h" -#include "game/graphics/opengl_renderer/background/background_common.h" namespace { @@ -526,8 +528,7 @@ void SpriteRenderer::handle_clamp(u64 val, SharedRenderState* /*render_state*/, ScopedProfilerNode& /*prof*/) { if (!(val == 0b101 || val == 0 || val == 1 || val == 0b100)) { - fmt::print("clamp: 0x{:x}\n", val); - ASSERT(false); + ASSERT_MSG(false, fmt::format("clamp: 0x{:x}", val)); } m_adgif_state.reg_clamp = val; @@ -654,7 +655,7 @@ void SpriteRenderer::do_block_common(SpriteMode mode, flush_sprites(render_state, prof); } - if (mode == Mode2D && render_state->has_camera_planes && m_enable_culling) { + if (mode == Mode2D && render_state->has_pc_data && m_enable_culling) { // we can skip sprites that are out of view // it's probably possible to do this for 3D as well. auto bsphere = m_vec_data_2d[sprite_idx].xyz_sx; diff --git a/game/graphics/opengl_renderer/SpriteRenderer.h b/game/graphics/opengl_renderer/SpriteRenderer.h index e3e0371dfc..fd721be0af 100644 --- a/game/graphics/opengl_renderer/SpriteRenderer.h +++ b/game/graphics/opengl_renderer/SpriteRenderer.h @@ -1,9 +1,10 @@ #pragma once +#include "common/dma/gs.h" +#include "common/math/Vector.h" + #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/DirectRenderer.h" -#include "common/dma/gs.h" -#include "common/math/Vector.h" #include "game/graphics/opengl_renderer/sprite_common.h" class SpriteRenderer : public BucketRenderer { diff --git a/game/graphics/opengl_renderer/TextureUploadHandler.cpp b/game/graphics/opengl_renderer/TextureUploadHandler.cpp index f8e1f8ffa8..fa12a70a47 100644 --- a/game/graphics/opengl_renderer/TextureUploadHandler.cpp +++ b/game/graphics/opengl_renderer/TextureUploadHandler.cpp @@ -1,10 +1,11 @@ +#include "TextureUploadHandler.h" + +#include "game/graphics/opengl_renderer/EyeRenderer.h" +#include "game/graphics/pipelines/opengl.h" + #include "third-party/fmt/core.h" #include "third-party/imgui/imgui.h" -#include "TextureUploadHandler.h" -#include "game/graphics/pipelines/opengl.h" -#include "game/graphics/opengl_renderer/EyeRenderer.h" - TextureUploadHandler::TextureUploadHandler(const std::string& name, BucketId my_id) : BucketRenderer(name, my_id) {} @@ -23,6 +24,7 @@ void TextureUploadHandler::render(DmaFollower& dma, // note: these uploads may have texture that we need for eye rendering. flush_uploads(uploads, render_state); render_state->eye_renderer->handle_eye_dma2(dma, render_state, prof); + uploads.clear(); } auto data = dma.read_and_advance(); diff --git a/game/graphics/opengl_renderer/background/Shrub.cpp b/game/graphics/opengl_renderer/background/Shrub.cpp index 8b2c0e4945..88a9ef4d62 100644 --- a/game/graphics/opengl_renderer/background/Shrub.cpp +++ b/game/graphics/opengl_renderer/background/Shrub.cpp @@ -51,17 +51,17 @@ void Shrub::render(DmaFollower& dma, SharedRenderState* render_state, ScopedProf 2 * (0xff & m_pc_port_data.itimes[i / 2].data()[2 * (i % 2)]) / 127.f; } + update_render_state_from_pc_settings(render_state, m_pc_port_data); + for (int i = 0; i < 4; i++) { settings.planes[i] = m_pc_port_data.planes[i]; - render_state->camera_planes[i] = m_pc_port_data.planes[i]; } - render_state->has_camera_planes = true; m_has_level = setup_for_level(m_pc_port_data.level_name, render_state); render_all_trees(settings, render_state, prof); } -void Shrub::update_load(const Loader::LevelData* loader_data) { +void Shrub::update_load(const LevelData* loader_data) { const tfrag3::Level* lev_data = loader_data->level.get(); // We changed level! discard_tree_cache(); @@ -69,14 +69,23 @@ void Shrub::update_load(const Loader::LevelData* loader_data) { size_t max_draws = 0; size_t time_of_day_count = 0; + size_t max_num_grps = 0; + size_t max_inds = 0; + for (u32 l_tree = 0; l_tree < lev_data->shrub_trees.size(); l_tree++) { - size_t idx_buffer_len = 0; + size_t num_grps = 0; + const auto& tree = lev_data->shrub_trees[l_tree]; max_draws = std::max(tree.static_draws.size(), max_draws); for (auto& draw : tree.static_draws) { - idx_buffer_len += draw.vertex_index_stream.size(); + (void)draw; + // num_grps += draw.vis_groups.size(); TODO + max_num_grps += 1; } + max_num_grps = std::max(max_num_grps, num_grps); + time_of_day_count = std::max(tree.time_of_day_colors.size(), time_of_day_count); + max_inds = std::max(tree.indices.size(), max_inds); u32 verts = tree.unpacked.vertices.size(); glGenVertexArrays(1, &m_trees[l_tree].vao); glBindVertexArray(m_trees[l_tree].vao); @@ -84,6 +93,7 @@ void Shrub::update_load(const Loader::LevelData* loader_data) { m_trees[l_tree].vert_count = verts; m_trees[l_tree].draws = &tree.static_draws; m_trees[l_tree].colors = &tree.time_of_day_colors; + m_trees[l_tree].index_data = tree.indices.data(); m_trees[l_tree].tod_cache = swizzle_time_of_day(tree.time_of_day_colors); glBindBuffer(GL_ARRAY_BUFFER, m_trees[l_tree].vertex_buffer); glEnableVertexAttribArray(0); @@ -122,10 +132,11 @@ void Shrub::update_load(const Loader::LevelData* loader_data) { (void*)offsetof(tfrag3::ShrubGpuVertex, color_index) // offset (0) ); + glGenBuffers(1, &m_trees[l_tree].single_draw_index_buffer); glGenBuffers(1, &m_trees[l_tree].index_buffer); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_trees[l_tree].index_buffer); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, idx_buffer_len * sizeof(u32), nullptr, GL_STREAM_DRAW); - m_trees[l_tree].index_list.resize(idx_buffer_len); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, tree.indices.size() * sizeof(u32), tree.indices.data(), + GL_STATIC_DRAW); glActiveTexture(GL_TEXTURE10); glGenTextures(1, &m_trees[l_tree].time_of_day_texture); @@ -138,7 +149,11 @@ void Shrub::update_load(const Loader::LevelData* loader_data) { glBindVertexArray(0); } + m_cache.multidraw_offset_per_stripdraw.resize(max_draws); + m_cache.multidraw_count_buffer.resize(max_num_grps); + m_cache.multidraw_index_offset_buffer.resize(max_num_grps); m_cache.draw_idx_temp.resize(max_draws); + m_cache.index_temp.resize(max_inds); ASSERT(time_of_day_count <= TIME_OF_DAY_COLOR_COUNT); } @@ -176,6 +191,7 @@ void Shrub::discard_tree_cache() { glBindTexture(GL_TEXTURE_1D, tree.time_of_day_texture); glDeleteTextures(1, &tree.time_of_day_texture); glDeleteBuffers(1, &tree.index_buffer); + glDeleteBuffers(1, &tree.single_draw_index_buffer); glDeleteVertexArrays(1, &tree.vao); } @@ -197,8 +213,6 @@ void Shrub::render_tree(int idx, Timer tree_timer; auto& tree = m_trees.at(idx); tree.perf.draws = 0; - tree.perf.verts = 0; - tree.perf.full_draws = 0; tree.perf.wind_draws = 0; if (!m_has_level) { return; @@ -222,32 +236,45 @@ void Shrub::render_tree(int idx, glBindVertexArray(tree.vao); glBindBuffer(GL_ARRAY_BUFFER, tree.vertex_buffer); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, tree.index_buffer); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, + render_state->no_multidraw ? tree.single_draw_index_buffer : tree.index_buffer); glActiveTexture(GL_TEXTURE0); glEnable(GL_PRIMITIVE_RESTART); glPrimitiveRestartIndex(UINT32_MAX); tree.perf.tod_time.add(setup_timer.getSeconds()); int last_texture = -1; - u32 idx_buffer_ptr = 0; tree.perf.cull_time.add(0); Timer index_timer; - idx_buffer_ptr = make_all_visible_index_list(m_cache.draw_idx_temp.data(), tree.index_list.data(), - *tree.draws); + if (render_state->no_multidraw) { + u32 idx_buffer_size = make_all_visible_index_list( + m_cache.draw_idx_temp.data(), m_cache.index_temp.data(), *tree.draws, tree.index_data); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, idx_buffer_size * sizeof(u32), m_cache.index_temp.data(), + GL_STREAM_DRAW); + } else { + make_all_visible_multidraws(m_cache.multidraw_offset_per_stripdraw.data(), + m_cache.multidraw_count_buffer.data(), + m_cache.multidraw_index_offset_buffer.data(), *tree.draws); + } + tree.perf.index_time.add(index_timer.getSeconds()); - tree.perf.index_upload = sizeof(u32) * idx_buffer_ptr; Timer draw_timer; - glBufferData(GL_ELEMENT_ARRAY_BUFFER, idx_buffer_ptr * sizeof(u32), tree.index_list.data(), - GL_STREAM_DRAW); for (size_t draw_idx = 0; draw_idx < tree.draws->size(); draw_idx++) { const auto& draw = tree.draws->operator[](draw_idx); - const auto& indices = m_cache.draw_idx_temp[draw_idx]; + const auto& multidraw_indices = m_cache.multidraw_offset_per_stripdraw[draw_idx]; + const auto& singledraw_indices = m_cache.draw_idx_temp[draw_idx]; - if (indices.second <= indices.first) { - continue; + if (render_state->no_multidraw) { + if (singledraw_indices.second == 0) { + continue; + } + } else { + if (multidraw_indices.second == 0) { + continue; + } } if ((int)draw.tree_tex_id != last_texture) { @@ -256,39 +283,42 @@ void Shrub::render_tree(int idx, } auto double_draw = setup_tfrag_shader(render_state, draw.mode, ShaderId::SHRUB); - int draw_size = indices.second - indices.first; - void* offset = (void*)(indices.first * sizeof(u32)); prof.add_draw_call(); - prof.add_tri(draw.num_triangles * (float)draw_size / draw.vertex_index_stream.size()); - - bool is_full = draw_size == (int)draw.vertex_index_stream.size(); + prof.add_tri(draw.num_triangles); tree.perf.draws++; - if (is_full) { - tree.perf.full_draws++; - } - tree.perf.verts += draw_size; - glDrawElements(GL_TRIANGLE_STRIP, draw_size, GL_UNSIGNED_INT, (void*)offset); + if (render_state->no_multidraw) { + glDrawElements(GL_TRIANGLE_STRIP, singledraw_indices.second, GL_UNSIGNED_INT, + (void*)(singledraw_indices.first * sizeof(u32))); + } else { + glMultiDrawElements(GL_TRIANGLE_STRIP, + &m_cache.multidraw_count_buffer[multidraw_indices.first], GL_UNSIGNED_INT, + &m_cache.multidraw_index_offset_buffer[multidraw_indices.first], + multidraw_indices.second); + } switch (double_draw.kind) { case DoubleDrawKind::NONE: break; case DoubleDrawKind::AFAIL_NO_DEPTH_WRITE: tree.perf.draws++; - tree.perf.verts += draw_size; - if (is_full) { - tree.perf.full_draws++; - } prof.add_draw_call(); - prof.add_tri(draw_size); glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::SHRUB].id(), "alpha_min"), -10.f); glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::SHRUB].id(), "alpha_max"), double_draw.aref_second); glDepthMask(GL_FALSE); - glDrawElements(GL_TRIANGLE_STRIP, draw_size, GL_UNSIGNED_INT, (void*)offset); + if (render_state->no_multidraw) { + glDrawElements(GL_TRIANGLE_STRIP, singledraw_indices.second, GL_UNSIGNED_INT, + (void*)(singledraw_indices.first * sizeof(u32))); + } else { + glMultiDrawElements( + GL_TRIANGLE_STRIP, &m_cache.multidraw_count_buffer[multidraw_indices.first], + GL_UNSIGNED_INT, &m_cache.multidraw_index_offset_buffer[multidraw_indices.first], + multidraw_indices.second); + } break; default: ASSERT(false); @@ -300,4 +330,4 @@ void Shrub::render_tree(int idx, tree.perf.tree_time.add(tree_timer.getSeconds()); } -void Shrub::draw_debug_window() {} \ No newline at end of file +void Shrub::draw_debug_window() {} diff --git a/game/graphics/opengl_renderer/background/Shrub.h b/game/graphics/opengl_renderer/background/Shrub.h index 88ef8086e7..ed7ef39634 100644 --- a/game/graphics/opengl_renderer/background/Shrub.h +++ b/game/graphics/opengl_renderer/background/Shrub.h @@ -2,12 +2,13 @@ #include -#include "game/graphics/gfx.h" -#include "game/graphics/opengl_renderer/background/background_common.h" -#include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/pipelines/opengl.h" #include "common/util/FilteredValue.h" +#include "game/graphics/gfx.h" +#include "game/graphics/opengl_renderer/BucketRenderer.h" +#include "game/graphics/opengl_renderer/background/background_common.h" +#include "game/graphics/pipelines/opengl.h" + class Shrub : public BucketRenderer { public: Shrub(const std::string& name, BucketId my_id); @@ -24,32 +25,24 @@ class Shrub : public BucketRenderer { void draw_debug_window() override; private: - void update_load(const Loader::LevelData* loader_data); + void update_load(const LevelData* loader_data); void discard_tree_cache(); struct Tree { GLuint vertex_buffer; GLuint index_buffer; + GLuint single_draw_index_buffer; GLuint time_of_day_texture; - std::vector index_list; GLuint vao; u32 vert_count; const std::vector* draws = nullptr; const std::vector* instance_info = nullptr; const std::vector* colors = nullptr; + const u32* index_data = nullptr; SwizzledTimeOfDay tod_cache; - std::vector> wind_matrix_cache; - - bool has_wind = false; - GLuint wind_vertex_index_buffer; - std::vector wind_vertex_index_offsets; - struct { - u32 index_upload = 0; - u32 verts = 0; u32 draws = 0; - u32 full_draws = 0; // ones that have all visible u32 wind_draws = 0; Filtered cull_time; Filtered index_time; @@ -72,6 +65,10 @@ class Shrub : public BucketRenderer { struct Cache { std::vector> draw_idx_temp; + std::vector index_temp; + std::vector> multidraw_offset_per_stripdraw; + std::vector multidraw_count_buffer; + std::vector multidraw_index_offset_buffer; } m_cache; TfragPcPortData m_pc_port_data; }; diff --git a/game/graphics/opengl_renderer/background/TFragment.cpp b/game/graphics/opengl_renderer/background/TFragment.cpp index 8b685510f6..43ab439b05 100644 --- a/game/graphics/opengl_renderer/background/TFragment.cpp +++ b/game/graphics/opengl_renderer/background/TFragment.cpp @@ -1,8 +1,9 @@ #include "TFragment.h" -#include "third-party/imgui/imgui.h" #include "game/graphics/opengl_renderer/dma_helpers.h" +#include "third-party/imgui/imgui.h" + namespace { bool looks_like_tfragment_dma(const DmaFollower& follow) { return follow.current_tag_vifcode0().kind == VifCode::Kind::STCYCL; @@ -31,15 +32,9 @@ TFragment::TFragment(const std::string& name, } } -constexpr const char* level_names[] = {"bea", "cit", "dar", "fin", "int", "jub", "jun", "fic", - "lav", "mai", "mis", "ogr", "rob", "rol", "sno", "sub", - "sun", "swa", "tit", "tra", "vi1", "vi2", "vi3"}; - void TFragment::render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) { - m_debug_string.clear(); - if (!m_enabled) { while (dma.current_tag_offset() != render_state->next_bucket) { dma.read_and_advance(); @@ -127,11 +122,11 @@ void TFragment::render(DmaFollower& dma, settings.occlusion_culling = render_state->occlusion_vis[m_level_id].data; } + update_render_state_from_pc_settings(render_state, m_pc_port_data); + for (int i = 0; i < 4; i++) { settings.planes[i] = m_pc_port_data.planes[i]; - render_state->camera_planes[i] = m_pc_port_data.planes[i]; } - render_state->has_camera_planes = true; if (m_override_time_of_day) { for (int i = 0; i < 8; i++) { @@ -148,50 +143,9 @@ void TFragment::render(DmaFollower& dma, m_tfrag3.render_matching_trees(m_tfrag3.lod(), m_tree_kinds, settings, render_state, t3prof); } - m_debug_string += fmt::format("fail: {}\n", dma.current_tag().print()); - while (dma.current_tag_offset() != render_state->next_bucket) { auto tag = dma.current_tag().print(); - auto data = dma.read_and_advance(); - m_debug_string += - fmt::format("DMA {} {} bytes, {}\n", tag, data.size_bytes, data.vifcode0().print()); - } - - if (m_hack_test_many_levels) { - std::vector all_kinds = { - tfrag3::TFragmentTreeKind::NORMAL, tfrag3::TFragmentTreeKind::TRANS, - tfrag3::TFragmentTreeKind::DIRT, tfrag3::TFragmentTreeKind::ICE, - tfrag3::TFragmentTreeKind::LOWRES, tfrag3::TFragmentTreeKind::LOWRES_TRANS}; - for (int i = 0; i < HackManyLevels::NUM_LEVELS; i++) { - if (m_many_level_render.level_enables[i]) { - if (!m_many_level_render.tfrag_level_renderers[i]) { - m_many_level_render.tfrag_level_renderers[i] = std::make_unique(); - } - if (!m_many_level_render.tie_level_renderers[i]) { - m_many_level_render.tie_level_renderers[i] = std::make_unique("tie", m_my_id, 0); - } - m_many_level_render.tfrag_level_renderers[i]->setup_for_level(all_kinds, level_names[i], - render_state); - m_many_level_render.tie_level_renderers[i]->setup_for_level(level_names[i], render_state); - TfragRenderSettings settings; - settings.hvdf_offset = m_tfrag_data.hvdf_offset; - settings.fog = m_tfrag_data.fog; - memcpy(settings.math_camera.data(), - &m_buffered_data[0].pad[TFragDataMem::TFragMatrix0 * 16], 64); - settings.tree_idx = 0; - for (int j = 0; j < 8; j++) { - settings.time_of_day_weights[j] = m_time_of_days[j]; - } - - auto t3prof = prof.make_scoped_child(level_names[i]); - - m_many_level_render.tfrag_level_renderers[i]->debug_render_all_trees_nolores( - 0, settings, render_state, t3prof); - // always renders max lod - m_many_level_render.tie_level_renderers[i]->render_all_trees(0, settings, render_state, - t3prof); - } - } + dma.read_and_advance(); } } @@ -203,16 +157,7 @@ void TFragment::draw_debug_window() { } } - ImGui::Checkbox("Hack Test Many (danger)", &m_hack_test_many_levels); - if (m_hack_test_many_levels) { - for (int i = 0; i < HackManyLevels::NUM_LEVELS; i++) { - ImGui::Checkbox(level_names[i], &m_many_level_render.level_enables[i]); - } - } - m_tfrag3.draw_debug_window(); - - ImGui::TextUnformatted(m_debug_string.data()); } void TFragment::handle_initialization(DmaFollower& dma) { @@ -238,7 +183,6 @@ void TFragment::handle_initialization(DmaFollower& dma) { auto data_upload = dma.read_and_advance(); unpack_to_stcycl(&m_tfrag_data, data_upload, VifCode::Kind::UNPACK_V4_32, 4, 4, sizeof(TFragData), TFragDataMem::TFragFrameData, false, false); - m_debug_string += fmt::format("Frame Data:\n {}\n", m_tfrag_data.print()); // call the setup program auto mscal_setup = dma.read_and_advance(); @@ -249,19 +193,6 @@ void TFragment::handle_initialization(DmaFollower& dma) { memcpy(&m_pc_port_data, pc_port_data.data, sizeof(TfragPcPortData)); m_pc_port_data.level_name[11] = '\0'; - for (int i = 0; i < 4; i++) { - m_debug_string += fmt::format("p[{}]: {}\n", i, m_pc_port_data.planes[i].to_string_aligned()); - } - - for (int i = 0; i < 4; i++) { - m_debug_string += fmt::format("t[{}]: {:x} {:x} {:x} {:x}\n", i, m_pc_port_data.itimes[i].x(), - m_pc_port_data.itimes[i].y(), m_pc_port_data.itimes[i].z(), - m_pc_port_data.itimes[i].w()); - } - - m_debug_string += - fmt::format("level: {}, tree: {}\n", m_pc_port_data.level_name, m_pc_port_data.tree_idx); - // setup double buffering. auto db_setup = dma.read_and_advance(); ASSERT(db_setup.size_bytes == 0); diff --git a/game/graphics/opengl_renderer/background/TFragment.h b/game/graphics/opengl_renderer/background/TFragment.h index 1b091824ab..cef6da68dc 100644 --- a/game/graphics/opengl_renderer/background/TFragment.h +++ b/game/graphics/opengl_renderer/background/TFragment.h @@ -1,11 +1,12 @@ #pragma once +#include "common/dma/gs.h" +#include "common/math/Vector.h" + #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/DirectRenderer.h" #include "game/graphics/opengl_renderer/background/Tfrag3.h" #include "game/graphics/opengl_renderer/background/Tie3.h" -#include "common/dma/gs.h" -#include "common/math/Vector.h" using math::Matrix4f; using math::Vector4f; @@ -46,9 +47,7 @@ class TFragment : public BucketRenderer { private: void handle_initialization(DmaFollower& dma); - std::string m_debug_string; bool m_child_mode = false; - bool m_hack_test_many_levels = false; bool m_override_time_of_day = false; float m_time_of_days[8] = {1, 0, 0, 0, 0, 0, 0, 0}; @@ -81,11 +80,4 @@ class TFragment : public BucketRenderer { Tfrag3 m_tfrag3; std::vector m_tree_kinds; int m_level_id; - - struct HackManyLevels { - static constexpr int NUM_LEVELS = 23; - std::unique_ptr tfrag_level_renderers[NUM_LEVELS]; - std::unique_ptr tie_level_renderers[NUM_LEVELS]; - bool level_enables[NUM_LEVELS] = {0}; - } m_many_level_render; }; diff --git a/game/graphics/opengl_renderer/background/Tfrag3.cpp b/game/graphics/opengl_renderer/background/Tfrag3.cpp index 2e949dc86c..a1ee89a64a 100644 --- a/game/graphics/opengl_renderer/background/Tfrag3.cpp +++ b/game/graphics/opengl_renderer/background/Tfrag3.cpp @@ -39,7 +39,7 @@ Tfrag3::~Tfrag3() { } void Tfrag3::update_load(const std::vector& tree_kinds, - const Loader::LevelData* loader_data) { + const LevelData* loader_data) { const auto* lev_data = loader_data->level.get(); discard_tree_cache(); for (int geom = 0; geom < GEOM_MAX; ++geom) { @@ -48,22 +48,24 @@ void Tfrag3::update_load(const std::vector& tree_kind size_t time_of_day_count = 0; size_t vis_temp_len = 0; - size_t max_draw = 0; + size_t max_draws = 0; + size_t max_num_grps = 0; + size_t max_inds = 0; for (int geom = 0; geom < GEOM_MAX; ++geom) { for (size_t tree_idx = 0; tree_idx < lev_data->tfrag_trees[geom].size(); tree_idx++) { - size_t idx_buffer_len = 0; - const auto& tree = lev_data->tfrag_trees[geom][tree_idx]; - auto& tree_cache = m_cached_trees[geom].emplace_back(); - - tree_cache.kind = tree.kind; if (std::find(tree_kinds.begin(), tree_kinds.end(), tree.kind) != tree_kinds.end()) { - max_draw = std::max(tree.draws.size(), max_draw); + auto& tree_cache = m_cached_trees[geom].emplace_back(); + tree_cache.kind = tree.kind; + max_draws = std::max(tree.draws.size(), max_draws); + size_t num_grps = 0; for (auto& draw : tree.draws) { - idx_buffer_len += draw.unpacked.vertex_index_stream.size(); + num_grps += draw.vis_groups.size(); } + max_num_grps = std::max(max_num_grps, num_grps); + max_inds = std::max(tree.unpacked.indices.size(), max_inds); time_of_day_count = std::max(tree.colors.size(), time_of_day_count); u32 verts = tree.packed_vertices.vertices.size(); glGenVertexArrays(1, &tree_cache.vao); @@ -74,7 +76,9 @@ void Tfrag3::update_load(const std::vector& tree_kind tree_cache.draws = &tree.draws; // todo - should we just copy this? tree_cache.colors = &tree.colors; tree_cache.vis = &tree.bvh; + tree_cache.index_data = tree.unpacked.indices.data(); tree_cache.tod_cache = swizzle_time_of_day(tree.colors); + tree_cache.draw_mode = tree.use_strips ? GL_TRIANGLE_STRIP : GL_TRIANGLES; vis_temp_len = std::max(vis_temp_len, tree.bvh.vis_nodes.size()); glBindBuffer(GL_ARRAY_BUFFER, tree_cache.vertex_buffer); // glBufferData(GL_ARRAY_BUFFER, verts * sizeof(tfrag3::PreloadedVertex), @@ -106,12 +110,11 @@ void Tfrag3::update_load(const std::vector& tree_kind sizeof(tfrag3::PreloadedVertex), // stride (void*)offsetof(tfrag3::PreloadedVertex, color_index) // offset (0) ); - + glGenBuffers(1, &tree_cache.single_draw_index_buffer); glGenBuffers(1, &tree_cache.index_buffer); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, tree_cache.index_buffer); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, idx_buffer_len * sizeof(u32), nullptr, - GL_STREAM_DRAW); - tree_cache.index_list.resize(idx_buffer_len); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, tree.unpacked.indices.size() * sizeof(u32), + tree.unpacked.indices.data(), GL_STREAM_DRAW); glGenTextures(1, &tree_cache.time_of_day_texture); glBindTexture(GL_TEXTURE_1D, tree_cache.time_of_day_texture); @@ -125,8 +128,11 @@ void Tfrag3::update_load(const std::vector& tree_kind } m_cache.vis_temp.resize(vis_temp_len); - m_cache.draw_idx_temp.resize(max_draw); - + m_cache.multidraw_offset_per_stripdraw.resize(max_draws); + m_cache.multidraw_count_buffer.resize(max_num_grps); + m_cache.multidraw_index_offset_buffer.resize(max_num_grps); + m_cache.draw_idx_temp.resize(max_draws); + m_cache.index_temp.resize(max_inds); ASSERT(time_of_day_count <= TIME_OF_DAY_COLOR_COUNT); } @@ -188,7 +194,8 @@ void Tfrag3::render_tree(int geom, glBindVertexArray(tree.vao); glBindBuffer(GL_ARRAY_BUFFER, tree.vertex_buffer); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, tree.index_buffer); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, + render_state->no_multidraw ? tree.single_draw_index_buffer : tree.index_buffer); glActiveTexture(GL_TEXTURE0); glEnable(GL_PRIMITIVE_RESTART); glPrimitiveRestartIndex(UINT32_MAX); @@ -196,18 +203,34 @@ void Tfrag3::render_tree(int geom, cull_check_all_slow(settings.planes, tree.vis->vis_nodes, settings.occlusion_culling, m_cache.vis_temp.data()); - int idx_buffer_ptr = make_index_list_from_vis_string( - m_cache.draw_idx_temp.data(), tree.index_list.data(), *tree.draws, m_cache.vis_temp); + u32 total_tris; + if (render_state->no_multidraw) { + u32 idx_buffer_size = make_index_list_from_vis_string( + m_cache.draw_idx_temp.data(), m_cache.index_temp.data(), *tree.draws, m_cache.vis_temp, + tree.index_data, &total_tris); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, idx_buffer_size * sizeof(u32), m_cache.index_temp.data(), + GL_STREAM_DRAW); + } else { + total_tris = make_multidraws_from_vis_string( + m_cache.multidraw_offset_per_stripdraw.data(), m_cache.multidraw_count_buffer.data(), + m_cache.multidraw_index_offset_buffer.data(), *tree.draws, m_cache.vis_temp); + } - glBufferData(GL_ELEMENT_ARRAY_BUFFER, idx_buffer_ptr * sizeof(u32), tree.index_list.data(), - GL_STREAM_DRAW); + prof.add_tri(total_tris); for (size_t draw_idx = 0; draw_idx < tree.draws->size(); draw_idx++) { const auto& draw = tree.draws->operator[](draw_idx); - const auto& indices = m_cache.draw_idx_temp[draw_idx]; + const auto& multidraw_indices = m_cache.multidraw_offset_per_stripdraw[draw_idx]; + const auto& singledraw_indices = m_cache.draw_idx_temp[draw_idx]; - if (indices.second <= indices.first) { - continue; + if (render_state->no_multidraw) { + if (singledraw_indices.second == 0) { + continue; + } + } else { + if (multidraw_indices.second == 0) { + continue; + } } ASSERT(m_textures); @@ -215,26 +238,37 @@ void Tfrag3::render_tree(int geom, auto double_draw = setup_tfrag_shader(render_state, draw.mode, ShaderId::TFRAG3); tree.tris_this_frame += draw.num_triangles; tree.draws_this_frame++; - int draw_size = indices.second - indices.first; - void* offset = (void*)(indices.first * sizeof(u32)); prof.add_draw_call(); - prof.add_tri(draw.num_triangles * (float)draw_size / draw.unpacked.vertex_index_stream.size()); - - glDrawElements(GL_TRIANGLE_STRIP, draw_size, GL_UNSIGNED_INT, (void*)offset); + if (render_state->no_multidraw) { + glDrawElements(tree.draw_mode, singledraw_indices.second, GL_UNSIGNED_INT, + (void*)(singledraw_indices.first * sizeof(u32))); + } else { + glMultiDrawElements(tree.draw_mode, &m_cache.multidraw_count_buffer[multidraw_indices.first], + GL_UNSIGNED_INT, + &m_cache.multidraw_index_offset_buffer[multidraw_indices.first], + multidraw_indices.second); + } switch (double_draw.kind) { case DoubleDrawKind::NONE: break; case DoubleDrawKind::AFAIL_NO_DEPTH_WRITE: prof.add_draw_call(); - prof.add_tri(draw_size); glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::TFRAG3].id(), "alpha_min"), -10.f); glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::TFRAG3].id(), "alpha_max"), double_draw.aref_second); glDepthMask(GL_FALSE); - glDrawElements(GL_TRIANGLE_STRIP, draw_size, GL_UNSIGNED_INT, (void*)offset); + if (render_state->no_multidraw) { + glDrawElements(tree.draw_mode, singledraw_indices.second, GL_UNSIGNED_INT, + (void*)(singledraw_indices.first * sizeof(u32))); + } else { + glMultiDrawElements( + tree.draw_mode, &m_cache.multidraw_count_buffer[multidraw_indices.first], + GL_UNSIGNED_INT, &m_cache.multidraw_index_offset_buffer[multidraw_indices.first], + multidraw_indices.second); + } break; default: ASSERT(false); @@ -284,33 +318,9 @@ void Tfrag3::render_matching_trees(int geom, } } -void Tfrag3::debug_render_all_trees_nolores(int geom, - const TfragRenderSettings& settings, - SharedRenderState* render_state, - ScopedProfilerNode& prof) { - TfragRenderSettings settings_copy = settings; - for (size_t i = 0; i < m_cached_trees.size(); i++) { - if (m_cached_trees[geom][i].kind != tfrag3::TFragmentTreeKind::INVALID && - m_cached_trees[geom][i].kind != tfrag3::TFragmentTreeKind::LOWRES_TRANS && - m_cached_trees[geom][i].kind != tfrag3::TFragmentTreeKind::LOWRES) { - settings_copy.tree_idx = i; - render_tree(geom, settings_copy, render_state, prof); - } - } - - // for (size_t i = 0; i < m_cached_trees.size(); i++) { - // if (m_cached_trees[i].kind != tfrag3::TFragmentTreeKind::INVALID && - // m_cached_trees[i].kind != tfrag3::TFragmentTreeKind::LOWRES_TRANS && - // m_cached_trees[i].kind != tfrag3::TFragmentTreeKind::LOWRES) { - // settings_copy.tree_idx = i; - // render_tree_cull_debug(settings_copy, render_state, prof); - // } - // } -} - void Tfrag3::draw_debug_window() { - for (int i = 0; i < (int)m_cached_trees.size(); i++) { - auto& tree = m_cached_trees[lod()][i]; + for (int i = 0; i < (int)m_cached_trees.at(lod()).size(); i++) { + auto& tree = m_cached_trees.at(lod()).at(i); if (tree.kind == tfrag3::TFragmentTreeKind::INVALID) { continue; } @@ -336,7 +346,7 @@ void Tfrag3::discard_tree_cache() { if (tree.kind != tfrag3::TFragmentTreeKind::INVALID) { glBindTexture(GL_TEXTURE_1D, tree.time_of_day_texture); glDeleteTextures(1, &tree.time_of_day_texture); - // glDeleteBuffers(1, &tree.vertex_buffer); + glDeleteBuffers(1, &tree.single_draw_index_buffer); glDeleteBuffers(1, &tree.index_buffer); glDeleteVertexArrays(1, &tree.vao); } diff --git a/game/graphics/opengl_renderer/background/Tfrag3.h b/game/graphics/opengl_renderer/background/Tfrag3.h index 07fc50f9e7..9e67ba6c58 100644 --- a/game/graphics/opengl_renderer/background/Tfrag3.h +++ b/game/graphics/opengl_renderer/background/Tfrag3.h @@ -2,21 +2,17 @@ #include "common/custom_data/Tfrag3Data.h" #include "common/math/Vector.h" + #include "game/graphics/gfx.h" #include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/pipelines/opengl.h" #include "game/graphics/opengl_renderer/background/background_common.h" +#include "game/graphics/pipelines/opengl.h" class Tfrag3 { public: Tfrag3(); ~Tfrag3(); - void debug_render_all_trees_nolores(int geom, - const TfragRenderSettings& settings, - SharedRenderState* render_state, - ScopedProfilerNode& prof); - void render_all_trees(int geom, const TfragRenderSettings& settings, SharedRenderState* render_state, @@ -49,7 +45,7 @@ class Tfrag3 { }; void update_load(const std::vector& tree_kinds, - const Loader::LevelData* loader_data); + const LevelData* loader_data); int lod() const { return Gfx::g_global_settings.lod_tfrag; } @@ -57,17 +53,19 @@ class Tfrag3 { static constexpr int GEOM_MAX = 3; struct TreeCache { - tfrag3::TFragmentTreeKind kind; + tfrag3::TFragmentTreeKind kind = tfrag3::TFragmentTreeKind::INVALID; GLuint vertex_buffer = -1; GLuint index_buffer = -1; - std::vector index_list; - GLuint time_of_day_texture; - GLuint vao; + GLuint single_draw_index_buffer = -1; + GLuint time_of_day_texture = -1; + GLuint vao = -1; u32 vert_count = 0; const std::vector* draws = nullptr; const std::vector* colors = nullptr; const tfrag3::BVH* vis = nullptr; + const u32* index_data = nullptr; SwizzledTimeOfDay tod_cache; + u64 draw_mode = 0; void reset_stats() { rendered_this_frame = false; @@ -85,6 +83,10 @@ class Tfrag3 { struct Cache { std::vector vis_temp; std::vector> draw_idx_temp; + std::vector index_temp; + std::vector> multidraw_offset_per_stripdraw; + std::vector multidraw_count_buffer; + std::vector multidraw_index_offset_buffer; } m_cache; std::string m_level_name; diff --git a/game/graphics/opengl_renderer/background/Tie3.cpp b/game/graphics/opengl_renderer/background/Tie3.cpp index 95b8204941..f68cbb8fbc 100644 --- a/game/graphics/opengl_renderer/background/Tie3.cpp +++ b/game/graphics/opengl_renderer/background/Tie3.cpp @@ -14,7 +14,7 @@ Tie3::~Tie3() { discard_tree_cache(); } -void Tie3::update_load(const Loader::LevelData* loader_data) { +void Tie3::update_load(const LevelData* loader_data) { const tfrag3::Level* lev_data = loader_data->level.get(); m_wind_vectors.clear(); // We changed level! @@ -25,17 +25,20 @@ void Tie3::update_load(const Loader::LevelData* loader_data) { size_t vis_temp_len = 0; size_t max_draws = 0; + size_t max_num_grps = 0; u16 max_wind_idx = 0; size_t time_of_day_count = 0; + size_t max_inds = 0; for (u32 l_geo = 0; l_geo < tfrag3::TIE_GEOS; l_geo++) { for (u32 l_tree = 0; l_tree < lev_data->tie_trees[l_geo].size(); l_tree++) { - size_t idx_buffer_len = 0; size_t wind_idx_buffer_len = 0; + size_t num_grps = 0; const auto& tree = lev_data->tie_trees[l_geo][l_tree]; max_draws = std::max(tree.static_draws.size(), max_draws); for (auto& draw : tree.static_draws) { - idx_buffer_len += draw.unpacked.vertex_index_stream.size(); + num_grps += draw.vis_groups.size(); } + max_num_grps = std::max(max_num_grps, num_grps); for (auto& draw : tree.instanced_wind_draws) { wind_idx_buffer_len += draw.vertex_index_stream.size(); } @@ -43,6 +46,7 @@ void Tie3::update_load(const Loader::LevelData* loader_data) { max_wind_idx = std::max(max_wind_idx, inst.wind_idx); } time_of_day_count = std::max(tree.colors.size(), time_of_day_count); + max_inds = std::max(tree.unpacked.indices.size(), max_inds); u32 verts = tree.packed_vertices.color_indices.size(); auto& lod_tree = m_trees.at(l_geo); glGenVertexArrays(1, &lod_tree[l_tree].vao); @@ -52,6 +56,7 @@ void Tie3::update_load(const Loader::LevelData* loader_data) { lod_tree[l_tree].draws = &tree.static_draws; lod_tree[l_tree].colors = &tree.colors; lod_tree[l_tree].vis = &tree.bvh; + lod_tree[l_tree].index_data = tree.unpacked.indices.data(); lod_tree[l_tree].instance_info = &tree.wind_instance_info; lod_tree[l_tree].wind_draws = &tree.instanced_wind_draws; vis_temp_len = std::max(vis_temp_len, tree.bvh.vis_nodes.size()); @@ -84,10 +89,12 @@ void Tie3::update_load(const Loader::LevelData* loader_data) { (void*)offsetof(tfrag3::PreloadedVertex, color_index) // offset (0) ); + glGenBuffers(1, &lod_tree[l_tree].single_draw_index_buffer); glGenBuffers(1, &lod_tree[l_tree].index_buffer); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, lod_tree[l_tree].index_buffer); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, idx_buffer_len * sizeof(u32), nullptr, GL_STREAM_DRAW); - lod_tree[l_tree].index_list.resize(idx_buffer_len); + // todo: move to loader, this will probably be quite slow. + glBufferData(GL_ELEMENT_ARRAY_BUFFER, tree.unpacked.indices.size() * sizeof(u32), + tree.unpacked.indices.data(), GL_STATIC_DRAW); if (wind_idx_buffer_len > 0) { lod_tree[l_tree].wind_matrix_cache.resize(tree.wind_instance_info.size()); @@ -114,8 +121,12 @@ void Tie3::update_load(const Loader::LevelData* loader_data) { } m_cache.vis_temp.resize(vis_temp_len); - m_cache.draw_idx_temp.resize(max_draws); + m_cache.multidraw_offset_per_stripdraw.resize(max_draws); + m_cache.multidraw_count_buffer.resize(max_num_grps); + m_cache.multidraw_index_offset_buffer.resize(max_num_grps); m_wind_vectors.resize(4 * max_wind_idx + 4); // 4x u32's per wind. + m_cache.draw_idx_temp.resize(max_draws); + m_cache.index_temp.resize(max_inds); ASSERT(time_of_day_count <= TIME_OF_DAY_COLOR_COUNT); } @@ -268,6 +279,7 @@ void Tie3::discard_tree_cache() { glBindTexture(GL_TEXTURE_1D, tree.time_of_day_texture); glDeleteTextures(1, &tree.time_of_day_texture); glDeleteBuffers(1, &tree.index_buffer); + glDeleteBuffers(1, &tree.single_draw_index_buffer); glDeleteVertexArrays(1, &tree.vao); } @@ -341,11 +353,11 @@ void Tie3::render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfi settings.occlusion_culling = render_state->occlusion_vis[m_level_id].data; } + update_render_state_from_pc_settings(render_state, m_pc_port_data); + for (int i = 0; i < 4; i++) { settings.planes[i] = m_pc_port_data.planes[i]; - render_state->camera_planes[i] = m_pc_port_data.planes[i]; } - render_state->has_camera_planes = true; if (false) { // for (int i = 0; i < 8; i++) { @@ -357,6 +369,7 @@ void Tie3::render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfi 2 * (0xff & m_pc_port_data.itimes[i / 2].data()[2 * (i % 2)]) / 127.f; } } + if (!m_override_level) { m_has_level = setup_for_level(m_pc_port_data.level_name, render_state); } @@ -460,7 +473,6 @@ void Tie3::render_tree_wind(int idx, tree.perf.draws++; tree.perf.wind_draws++; - tree.perf.verts += grp.num; glDrawElements(GL_TRIANGLE_STRIP, grp.num, GL_UNSIGNED_INT, (void*)((off + tree.wind_vertex_index_offsets.at(draw_idx)) * sizeof(u32))); @@ -472,7 +484,6 @@ void Tie3::render_tree_wind(int idx, case DoubleDrawKind::AFAIL_NO_DEPTH_WRITE: tree.perf.draws++; tree.perf.wind_draws++; - tree.perf.verts += grp.num; prof.add_draw_call(); prof.add_tri(grp.num); glUniform1f( @@ -497,16 +508,18 @@ void Tie3::render_tree(int idx, const TfragRenderSettings& settings, SharedRenderState* render_state, ScopedProfilerNode& prof) { + // reset perf Timer tree_timer; auto& tree = m_trees.at(geom).at(idx); tree.perf.draws = 0; - tree.perf.verts = 0; - tree.perf.full_draws = 0; tree.perf.wind_draws = 0; + + // don't render if we haven't loaded if (!m_has_level) { return; } + // update time of day if (m_color_result.size() < tree.colors->size()) { m_color_result.resize(tree.colors->size()); } @@ -525,49 +538,81 @@ void Tie3::render_tree(int idx, glTexSubImage1D(GL_TEXTURE_1D, 0, 0, tree.colors->size(), GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, m_color_result.data()); + // setup OpenGL shader first_tfrag_draw_setup(settings, render_state, ShaderId::TFRAG3); glBindVertexArray(tree.vao); glBindBuffer(GL_ARRAY_BUFFER, tree.vertex_buffer); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, tree.index_buffer); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, + render_state->no_multidraw ? tree.single_draw_index_buffer : tree.index_buffer); glActiveTexture(GL_TEXTURE0); glEnable(GL_PRIMITIVE_RESTART); glPrimitiveRestartIndex(UINT32_MAX); tree.perf.tod_time.add(setup_timer.getSeconds()); int last_texture = -1; - u32 idx_buffer_ptr = 0; - if (m_debug_all_visible) { - tree.perf.cull_time.add(0); - Timer index_timer; - idx_buffer_ptr = make_all_visible_index_list(m_cache.draw_idx_temp.data(), - tree.index_list.data(), *tree.draws); - tree.perf.index_time.add(index_timer.getSeconds()); - tree.perf.index_upload = sizeof(u32) * idx_buffer_ptr; - } else { + if (!m_debug_all_visible) { + // need culling data Timer cull_timer; cull_check_all_slow(settings.planes, tree.vis->vis_nodes, settings.occlusion_culling, m_cache.vis_temp.data()); tree.perf.cull_time.add(cull_timer.getSeconds()); + } else { + // no culling. + tree.perf.cull_time.add(0); + } + u32 num_tris; + if (render_state->no_multidraw) { Timer index_timer; - idx_buffer_ptr = make_index_list_from_vis_string( - m_cache.draw_idx_temp.data(), tree.index_list.data(), *tree.draws, m_cache.vis_temp); + u32 idx_buffer_size; + if (m_debug_all_visible) { + idx_buffer_size = + make_all_visible_index_list(m_cache.draw_idx_temp.data(), m_cache.index_temp.data(), + *tree.draws, tree.index_data, &num_tris); + } else { + idx_buffer_size = make_index_list_from_vis_string( + m_cache.draw_idx_temp.data(), m_cache.index_temp.data(), *tree.draws, m_cache.vis_temp, + tree.index_data, &num_tris); + } + + glBufferData(GL_ELEMENT_ARRAY_BUFFER, idx_buffer_size * sizeof(u32), m_cache.index_temp.data(), + GL_STREAM_DRAW); tree.perf.index_time.add(index_timer.getSeconds()); - tree.perf.index_upload = sizeof(u32) * idx_buffer_ptr; + + } else { + if (m_debug_all_visible) { + Timer index_timer; + num_tris = make_all_visible_multidraws( + m_cache.multidraw_offset_per_stripdraw.data(), m_cache.multidraw_count_buffer.data(), + m_cache.multidraw_index_offset_buffer.data(), *tree.draws); + tree.perf.index_time.add(index_timer.getSeconds()); + } else { + Timer index_timer; + num_tris = make_multidraws_from_vis_string( + m_cache.multidraw_offset_per_stripdraw.data(), m_cache.multidraw_count_buffer.data(), + m_cache.multidraw_index_offset_buffer.data(), *tree.draws, m_cache.vis_temp); + tree.perf.index_time.add(index_timer.getSeconds()); + } } Timer draw_timer; - glBufferData(GL_ELEMENT_ARRAY_BUFFER, idx_buffer_ptr * sizeof(u32), tree.index_list.data(), - GL_STREAM_DRAW); + prof.add_tri(num_tris); for (size_t draw_idx = 0; draw_idx < tree.draws->size(); draw_idx++) { const auto& draw = tree.draws->operator[](draw_idx); - const auto& indices = m_cache.draw_idx_temp[draw_idx]; + const auto& multidraw_indices = m_cache.multidraw_offset_per_stripdraw[draw_idx]; + const auto& singledraw_indices = m_cache.draw_idx_temp[draw_idx]; - if (indices.second <= indices.first) { - continue; + if (render_state->no_multidraw) { + if (singledraw_indices.second == 0) { + continue; + } + } else { + if (multidraw_indices.second == 0) { + continue; + } } if ((int)draw.tree_tex_id != last_texture) { @@ -576,45 +621,47 @@ void Tie3::render_tree(int idx, } auto double_draw = setup_tfrag_shader(render_state, draw.mode, ShaderId::TFRAG3); - int draw_size = indices.second - indices.first; - void* offset = (void*)(indices.first * sizeof(u32)); prof.add_draw_call(); - prof.add_tri(draw.num_triangles * (float)draw_size / draw.unpacked.vertex_index_stream.size()); - - bool is_full = draw_size == (int)draw.unpacked.vertex_index_stream.size(); tree.perf.draws++; - if (is_full) { - tree.perf.full_draws++; - } - tree.perf.verts += draw_size; - glDrawElements(GL_TRIANGLE_STRIP, draw_size, GL_UNSIGNED_INT, (void*)offset); + if (render_state->no_multidraw) { + glDrawElements(GL_TRIANGLE_STRIP, singledraw_indices.second, GL_UNSIGNED_INT, + (void*)(singledraw_indices.first * sizeof(u32))); + } else { + glMultiDrawElements(GL_TRIANGLE_STRIP, + &m_cache.multidraw_count_buffer[multidraw_indices.first], GL_UNSIGNED_INT, + &m_cache.multidraw_index_offset_buffer[multidraw_indices.first], + multidraw_indices.second); + } switch (double_draw.kind) { case DoubleDrawKind::NONE: break; case DoubleDrawKind::AFAIL_NO_DEPTH_WRITE: tree.perf.draws++; - tree.perf.verts += draw_size; - if (is_full) { - tree.perf.full_draws++; - } prof.add_draw_call(); - prof.add_tri(draw_size); glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::TFRAG3].id(), "alpha_min"), -10.f); glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::TFRAG3].id(), "alpha_max"), double_draw.aref_second); glDepthMask(GL_FALSE); - glDrawElements(GL_TRIANGLE_STRIP, draw_size, GL_UNSIGNED_INT, (void*)offset); + if (render_state->no_multidraw) { + glDrawElements(GL_TRIANGLE_STRIP, singledraw_indices.second, GL_UNSIGNED_INT, + (void*)(singledraw_indices.first * sizeof(u32))); + } else { + glMultiDrawElements( + GL_TRIANGLE_STRIP, &m_cache.multidraw_count_buffer[multidraw_indices.first], + GL_UNSIGNED_INT, &m_cache.multidraw_index_offset_buffer[multidraw_indices.first], + multidraw_indices.second); + } break; default: ASSERT(false); } - if (m_debug_wireframe) { + if (m_debug_wireframe && !render_state->no_multidraw) { render_state->shaders[ShaderId::TFRAG3_NO_TEX].activate(); glUniformMatrix4fv( glGetUniformLocation(render_state->shaders[ShaderId::TFRAG3_NO_TEX].id(), "camera"), 1, @@ -628,10 +675,12 @@ void Tie3::render_tree(int idx, settings.fog.x()); glDisable(GL_BLEND); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glDrawElements(GL_TRIANGLE_STRIP, draw_size, GL_UNSIGNED_INT, (void*)offset); + glMultiDrawElements(GL_TRIANGLE_STRIP, + &m_cache.multidraw_count_buffer[multidraw_indices.first], GL_UNSIGNED_INT, + &m_cache.multidraw_index_offset_buffer[multidraw_indices.first], + multidraw_indices.second); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); prof.add_draw_call(); - prof.add_tri(draw_size); render_state->shaders[ShaderId::TFRAG3].activate(); } } @@ -662,9 +711,8 @@ void Tie3::draw_debug_window() { for (u32 i = 0; i < m_trees[lod()].size(); i++) { auto& perf = m_trees[lod()][i].perf; ImGui::Text("Tree: %d", i); - ImGui::Text("index data bytes: %d", perf.index_upload); ImGui::Text("time of days: %d", (int)m_trees[lod()][i].colors->size()); - ImGui::Text("draw: %d, full: %d, verts: %d", perf.draws, perf.full_draws, perf.verts); + ImGui::Text("draw: %d", perf.draws); ImGui::Text("wind draw: %d", perf.wind_draws); ImGui::Text("total: %.2f", perf.tree_time.get()); ImGui::Text("cull: %.2f index: %.2f tod: %.2f setup: %.2f draw: %.2f", diff --git a/game/graphics/opengl_renderer/background/Tie3.h b/game/graphics/opengl_renderer/background/Tie3.h index 723b4a7bba..ed819c369a 100644 --- a/game/graphics/opengl_renderer/background/Tie3.h +++ b/game/graphics/opengl_renderer/background/Tie3.h @@ -2,12 +2,13 @@ #include -#include "game/graphics/gfx.h" -#include "game/graphics/opengl_renderer/background/background_common.h" -#include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/pipelines/opengl.h" #include "common/util/FilteredValue.h" +#include "game/graphics/gfx.h" +#include "game/graphics/opengl_renderer/BucketRenderer.h" +#include "game/graphics/opengl_renderer/background/background_common.h" +#include "game/graphics/pipelines/opengl.h" + class Tie3 : public BucketRenderer { public: Tie3(const std::string& name, BucketId my_id, int level_id); @@ -40,7 +41,7 @@ class Tie3 : public BucketRenderer { int lod() const { return Gfx::g_global_settings.lod_tie; } private: - void update_load(const Loader::LevelData* loader_data); + void update_load(const LevelData* loader_data); void discard_tree_cache(); void render_tree_wind(int idx, int geom, @@ -51,8 +52,8 @@ class Tie3 : public BucketRenderer { struct Tree { GLuint vertex_buffer; GLuint index_buffer; + GLuint single_draw_index_buffer; GLuint time_of_day_texture; - std::vector index_list; GLuint vao; u32 vert_count; const std::vector* draws = nullptr; @@ -60,6 +61,7 @@ class Tie3 : public BucketRenderer { const std::vector* instance_info = nullptr; const std::vector* colors = nullptr; const tfrag3::BVH* vis = nullptr; + const u32* index_data = nullptr; SwizzledTimeOfDay tod_cache; std::vector> wind_matrix_cache; @@ -69,10 +71,7 @@ class Tie3 : public BucketRenderer { std::vector wind_vertex_index_offsets; struct { - u32 index_upload = 0; - u32 verts = 0; u32 draws = 0; - u32 full_draws = 0; // ones that have all visible u32 wind_draws = 0; Filtered cull_time; Filtered index_time; @@ -89,8 +88,12 @@ class Tie3 : public BucketRenderer { u64 m_load_id = -1; struct Cache { - std::vector vis_temp; std::vector> draw_idx_temp; + std::vector index_temp; + std::vector vis_temp; + std::vector> multidraw_offset_per_stripdraw; + std::vector multidraw_count_buffer; + std::vector multidraw_index_offset_buffer; } m_cache; std::vector> m_color_result; diff --git a/game/graphics/opengl_renderer/background/background_common.cpp b/game/graphics/opengl_renderer/background/background_common.cpp index 4fc14ec005..7e5443a3a3 100644 --- a/game/graphics/opengl_renderer/background/background_common.cpp +++ b/game/graphics/opengl_renderer/background/background_common.cpp @@ -1,12 +1,14 @@ #include "background_common.h" -#include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/pipelines/opengl.h" -#include "common/util/os.h" #include +#include "common/util/os.h" + +#include "game/graphics/opengl_renderer/BucketRenderer.h" +#include "game/graphics/pipelines/opengl.h" + DoubleDraw setup_opengl_from_draw_mode(DrawMode mode, u32 tex_unit, bool mipmap) { glActiveTexture(tex_unit); @@ -103,9 +105,13 @@ DoubleDraw setup_opengl_from_draw_mode(DrawMode mode, u32 tex_unit, bool mipmap) // ok, no need for double draw break; case GsTest::AlphaFail::FB_ONLY: - // darn, we need to draw twice - double_draw.kind = DoubleDrawKind::AFAIL_NO_DEPTH_WRITE; - double_draw.aref_second = alpha_min; + if (mode.get_depth_write_enable()) { + // darn, we need to draw twice + double_draw.kind = DoubleDrawKind::AFAIL_NO_DEPTH_WRITE; + double_draw.aref_second = alpha_min; + } else { + alpha_min = 0.f; + } break; default: ASSERT(false); @@ -144,21 +150,18 @@ void first_tfrag_draw_setup(const TfragRenderSettings& settings, SharedRenderState* render_state, ShaderId shader) { render_state->shaders[shader].activate(); - glUniform1i(glGetUniformLocation(render_state->shaders[shader].id(), "tex_T0"), 0); - glUniformMatrix4fv(glGetUniformLocation(render_state->shaders[shader].id(), "camera"), 1, - GL_FALSE, settings.math_camera.data()); - glUniform4f(glGetUniformLocation(render_state->shaders[shader].id(), "hvdf_offset"), - settings.hvdf_offset[0], settings.hvdf_offset[1], settings.hvdf_offset[2], - settings.hvdf_offset[3]); - glUniform1f(glGetUniformLocation(render_state->shaders[shader].id(), "fog_constant"), - settings.fog.x()); - glUniform1f(glGetUniformLocation(render_state->shaders[shader].id(), "fog_min"), - settings.fog.y()); - glUniform1f(glGetUniformLocation(render_state->shaders[shader].id(), "fog_max"), - settings.fog.z()); - glUniform4f(glGetUniformLocation(render_state->shaders[shader].id(), "fog_color"), - render_state->fog_color[0], render_state->fog_color[1], render_state->fog_color[2], - render_state->fog_intensity); + auto shid = render_state->shaders[shader].id(); + glUniform1i(glGetUniformLocation(shid, "tex_T0"), 0); + glUniformMatrix4fv(glGetUniformLocation(shid, "camera"), 1, GL_FALSE, + settings.math_camera.data()); + glUniform4f(glGetUniformLocation(shid, "hvdf_offset"), settings.hvdf_offset[0], + settings.hvdf_offset[1], settings.hvdf_offset[2], settings.hvdf_offset[3]); + glUniform1f(glGetUniformLocation(shid, "fog_constant"), settings.fog.x()); + glUniform1f(glGetUniformLocation(shid, "fog_min"), settings.fog.y()); + glUniform1f(glGetUniformLocation(shid, "fog_max"), settings.fog.z()); + glUniform4f(glGetUniformLocation(shid, "fog_color"), render_state->fog_color[0] / 255.f, + render_state->fog_color[1] / 255.f, render_state->fog_color[2] / 255.f, + render_state->fog_intensity / 255); } void interp_time_of_day_slow(const float weights[8], @@ -396,7 +399,7 @@ void interp_time_of_day_fast(const float weights[8], auto result = _mm_packus_epi16(color0, color0); // store result - _mm_storeu_si64((__m128i*)(&out[color_quad * 4]), result); + _mm_storel_epi64((__m128i*)(&out[color_quad * 4]), result); } { @@ -451,7 +454,7 @@ void interp_time_of_day_fast(const float weights[8], auto result = _mm_packus_epi16(color0, color0); // store result - _mm_storeu_si64((__m128i*)(&out[color_quad * 4 + 2]), result); + _mm_storel_epi64((__m128i*)(&out[color_quad * 4 + 2]), result); } } } @@ -483,45 +486,110 @@ void cull_check_all_slow(const math::Vector4f* planes, } } +void make_all_visible_multidraws(std::pair* draw_ptrs_out, + GLsizei* counts_out, + void** index_offsets_out, + const std::vector& draws) { + u64 md_idx = 0; + for (size_t i = 0; i < draws.size(); i++) { + const auto& draw = draws[i]; + u64 iidx = draw.first_index_index; + std::pair ds; + ds.first = md_idx; + ds.second = 1; + counts_out[md_idx] = draw.num_indices; + index_offsets_out[md_idx] = (void*)(iidx * sizeof(u32)); + md_idx++; + draw_ptrs_out[i] = ds; + } +} + +u32 make_all_visible_multidraws(std::pair* draw_ptrs_out, + GLsizei* counts_out, + void** index_offsets_out, + const std::vector& draws) { + u64 md_idx = 0; + u32 num_tris = 0; + for (size_t i = 0; i < draws.size(); i++) { + const auto& draw = draws[i]; + u64 iidx = draw.unpacked.idx_of_first_idx_in_full_buffer; + std::pair ds; + ds.first = md_idx; + ds.second = 0; + for (auto& grp : draw.vis_groups) { + // visible! + // let's use a multidraw + counts_out[md_idx] = grp.num_inds; + index_offsets_out[md_idx] = (void*)(iidx * sizeof(u32)); + ds.second++; + md_idx++; + num_tris += grp.num_tris; + iidx += grp.num_inds; + } + draw_ptrs_out[i] = ds; + } + return num_tris; +} + u32 make_all_visible_index_list(std::pair* group_out, u32* idx_out, - const std::vector& draws) { + const std::vector& draws, + const u32* idx_in) { int idx_buffer_ptr = 0; for (size_t i = 0; i < draws.size(); i++) { const auto& draw = draws[i]; std::pair ds; ds.first = idx_buffer_ptr; - memcpy(&idx_out[idx_buffer_ptr], draw.unpacked.vertex_index_stream.data(), - draw.unpacked.vertex_index_stream.size() * sizeof(u32)); - idx_buffer_ptr += draw.unpacked.vertex_index_stream.size(); - ds.second = idx_buffer_ptr; + memcpy(&idx_out[idx_buffer_ptr], idx_in + draw.first_index_index, + draw.num_indices * sizeof(u32)); + idx_buffer_ptr += draw.num_indices; + ds.second = idx_buffer_ptr - ds.first; group_out[i] = ds; } return idx_buffer_ptr; } -u32 make_all_visible_index_list(std::pair* group_out, - u32* idx_out, - const std::vector& draws) { - int idx_buffer_ptr = 0; +u32 make_multidraws_from_vis_string(std::pair* draw_ptrs_out, + GLsizei* counts_out, + void** index_offsets_out, + const std::vector& draws, + const std::vector& vis_data) { + u64 md_idx = 0; + u32 num_tris = 0; + u32 sanity_check = 0; for (size_t i = 0; i < draws.size(); i++) { const auto& draw = draws[i]; + u64 iidx = draw.unpacked.idx_of_first_idx_in_full_buffer; + ASSERT(sanity_check == iidx); std::pair ds; - ds.first = idx_buffer_ptr; - memcpy(&idx_out[idx_buffer_ptr], draw.vertex_index_stream.data(), - draw.vertex_index_stream.size() * sizeof(u32)); - idx_buffer_ptr += draw.vertex_index_stream.size(); - ds.second = idx_buffer_ptr; - group_out[i] = ds; + ds.first = md_idx; + ds.second = 0; + for (auto& grp : draw.vis_groups) { + sanity_check += grp.num_inds; + if (grp.vis_idx_in_pc_bvh == 0xffffffff || vis_data[grp.vis_idx_in_pc_bvh]) { + // visible! + // let's use a multidraw + counts_out[md_idx] = grp.num_inds; + index_offsets_out[md_idx] = (void*)(iidx * sizeof(u32)); + ds.second++; + md_idx++; + num_tris += grp.num_tris; + } + iidx += grp.num_inds; + } + draw_ptrs_out[i] = ds; } - return idx_buffer_ptr; + return num_tris; } u32 make_index_list_from_vis_string(std::pair* group_out, u32* idx_out, const std::vector& draws, - const std::vector& vis_data) { + const std::vector& vis_data, + const u32* idx_in, + u32* num_tris_out) { int idx_buffer_ptr = 0; + u32 num_tris = 0; for (size_t i = 0; i < draws.size(); i++) { const auto& draw = draws[i]; int vtx_idx = 0; @@ -532,13 +600,17 @@ u32 make_index_list_from_vis_string(std::pair* group_out, int run_start_in = 0; for (auto& grp : draw.vis_groups) { bool vis = grp.vis_idx_in_pc_bvh == 0xffffffff || vis_data[grp.vis_idx_in_pc_bvh]; + if (vis) { + num_tris += grp.num_tris; + } + if (building_run) { if (vis) { - idx_buffer_ptr += grp.num; + idx_buffer_ptr += grp.num_inds; } else { building_run = false; - idx_buffer_ptr += grp.num; - memcpy(&idx_out[run_start_out], &draw.unpacked.vertex_index_stream[run_start_in], + memcpy(&idx_out[run_start_out], + idx_in + draw.unpacked.idx_of_first_idx_in_full_buffer + run_start_in, (idx_buffer_ptr - run_start_out) * sizeof(u32)); } } else { @@ -546,19 +618,60 @@ u32 make_index_list_from_vis_string(std::pair* group_out, building_run = true; run_start_out = idx_buffer_ptr; run_start_in = vtx_idx; - idx_buffer_ptr += grp.num; - } else { + idx_buffer_ptr += grp.num_inds; } } - vtx_idx += grp.num; + vtx_idx += grp.num_inds; } + if (building_run) { - memcpy(&idx_out[run_start_out], &draw.unpacked.vertex_index_stream[run_start_in], + memcpy(&idx_out[run_start_out], + idx_in + draw.unpacked.idx_of_first_idx_in_full_buffer + run_start_in, (idx_buffer_ptr - run_start_out) * sizeof(u32)); } - ds.second = idx_buffer_ptr; + ds.second = idx_buffer_ptr - ds.first; group_out[i] = ds; } + *num_tris_out = num_tris; return idx_buffer_ptr; } + +u32 make_all_visible_index_list(std::pair* group_out, + u32* idx_out, + const std::vector& draws, + const u32* idx_in, + u32* num_tris_out) { + int idx_buffer_ptr = 0; + u32 num_tris = 0; + for (size_t i = 0; i < draws.size(); i++) { + const auto& draw = draws[i]; + std::pair ds; + ds.first = idx_buffer_ptr; + u32 num_inds = 0; + for (auto& grp : draw.vis_groups) { + num_inds += grp.num_inds; + num_tris += grp.num_tris; + } + memcpy(&idx_out[idx_buffer_ptr], idx_in + draw.unpacked.idx_of_first_idx_in_full_buffer, + num_inds * sizeof(u32)); + idx_buffer_ptr += num_inds; + ds.second = idx_buffer_ptr - ds.first; + group_out[i] = ds; + } + *num_tris_out = num_tris; + return idx_buffer_ptr; +} + +void update_render_state_from_pc_settings(SharedRenderState* state, const TfragPcPortData& data) { + if (!state->has_pc_data) { + for (int i = 0; i < 4; i++) { + state->camera_planes[i] = data.planes[i]; + state->camera_matrix[i] = data.camera[i]; + } + state->camera_pos = data.cam_trans; + state->camera_hvdf_off = data.hvdf_off; + state->camera_fog = data.fog; + state->has_pc_data = true; + } +} diff --git a/game/graphics/opengl_renderer/background/background_common.h b/game/graphics/opengl_renderer/background/background_common.h index 57266be720..1218b96cfe 100644 --- a/game/graphics/opengl_renderer/background/background_common.h +++ b/game/graphics/opengl_renderer/background/background_common.h @@ -1,8 +1,22 @@ #pragma once #include "common/math/Vector.h" + #include "game/graphics/opengl_renderer/BucketRenderer.h" +// data passed from game to PC renderers +// the GOAL code assumes this memory layout. +struct TfragPcPortData { + math::Vector4f planes[4]; + math::Vector itimes[4]; + math::Vector4f camera[4]; + math::Vector4f hvdf_off; + math::Vector4f fog; + math::Vector4f cam_trans; + char level_name[16]; +}; + +// inputs to background renderers. struct TfragRenderSettings { math::Matrix4f math_camera; math::Vector4f hvdf_offset; @@ -12,7 +26,6 @@ struct TfragRenderSettings { math::Vector4f planes[4]; bool debug_culling = false; const u8* occlusion_culling = nullptr; - // todo occlusion culling string. }; enum class DoubleDrawKind { NONE, AFAIL_NO_DEPTH_WRITE }; @@ -50,23 +63,38 @@ void cull_check_all_slow(const math::Vector4f* planes, u8* out); bool sphere_in_view_ref(const math::Vector4f& sphere, const math::Vector4f* planes); -struct TfragPcPortData { - math::Vector4f planes[4]; - math::Vector itimes[4]; - math::Vector4f camera[4]; - math::Vector4f hvdf_off; - math::Vector4f fog; - char level_name[12]; - u32 tree_idx; -}; +void update_render_state_from_pc_settings(SharedRenderState* state, const TfragPcPortData& data); + +void make_all_visible_multidraws(std::pair* draw_ptrs_out, + GLsizei* counts_out, + void** index_offsets_out, + const std::vector& draws); + +u32 make_all_visible_multidraws(std::pair* draw_ptrs_out, + GLsizei* counts_out, + void** index_offsets_out, + const std::vector& draws); + +u32 make_multidraws_from_vis_string(std::pair* draw_ptrs_out, + GLsizei* counts_out, + void** index_offsets_out, + const std::vector& draws, + const std::vector& vis_data); + +u32 make_all_visible_index_list(std::pair* group_out, + u32* idx_out, + const std::vector& draws, + const u32* idx_in, + u32* num_tris_out); u32 make_index_list_from_vis_string(std::pair* group_out, u32* idx_out, const std::vector& draws, - const std::vector& vis_data); + const std::vector& vis_data, + const u32* idx_in, + u32* num_tris_out); + u32 make_all_visible_index_list(std::pair* group_out, u32* idx_out, - const std::vector& draws); -u32 make_all_visible_index_list(std::pair* group_out, - u32* idx_out, - const std::vector& draws); \ No newline at end of file + const std::vector& draws, + const u32* idx_in); \ No newline at end of file diff --git a/game/graphics/opengl_renderer/buckets.h b/game/graphics/opengl_renderer/buckets.h index de32c772c6..676bd885ba 100644 --- a/game/graphics/opengl_renderer/buckets.h +++ b/game/graphics/opengl_renderer/buckets.h @@ -14,14 +14,14 @@ enum class BucketId { TIE_NEAR_LEVEL0 = 8, TIE_LEVEL0 = 9, MERC_TFRAG_TEX_LEVEL0 = 10, - GMERC_TFRAG_TEX_LEVEL0 = 11, + GENERIC_TFRAG_TEX_LEVEL0 = 11, TFRAG_TEX_LEVEL1 = 12, TFRAG_LEVEL1 = 13, TFRAG_NEAR_LEVEL1 = 14, TIE_NEAR_LEVEL1 = 15, TIE_LEVEL1 = 16, MERC_TFRAG_TEX_LEVEL1 = 17, - GMERC_TFRAG_TEX_LEVEL1 = 18, + GENERIC_TFRAG_TEX_LEVEL1 = 18, SHRUB_TEX_LEVEL0 = 19, SHRUB_NORMAL_LEVEL0 = 20, // 21 @@ -70,9 +70,10 @@ enum class BucketId { // 64 PRE_SPRITE_TEX = 65, // maybe it's just common textures? SPRITE = 66, - DEBUG_DRAW_0 = 67, - DEBUG_DRAW_1 = 68, - MAX_BUCKETS = 69 + DEBUG = 67, + DEBUG_NO_ZBUF = 68, + SUBTITLE = 69, + MAX_BUCKETS = 70 }; enum class BucketCategory { @@ -81,7 +82,7 @@ enum class BucketCategory { SHRUB, TEX, MERC, - GENERIC_MERC, + GENERIC, SPRITE, OCEAN, OTHER, @@ -89,4 +90,4 @@ enum class BucketCategory { }; constexpr const char* BUCKET_CATEGORY_NAMES[(int)BucketCategory::MAX_CATEGORIES] = { - "tfrag", "tie", "shrub", "tex", "merc", "mercneric", "sprite", "ocean", "other"}; \ No newline at end of file + "tfrag", "tie", "shrub", "tex", "merc", "generic", "sprite", "ocean", "other"}; diff --git a/game/graphics/opengl_renderer/debug_gui.cpp b/game/graphics/opengl_renderer/debug_gui.cpp index 5f07ae118e..2fb9fcffba 100644 --- a/game/graphics/opengl_renderer/debug_gui.cpp +++ b/game/graphics/opengl_renderer/debug_gui.cpp @@ -1,6 +1,11 @@ #include "debug_gui.h" + #include + +#include "game/graphics/gfx.h" +#include "game/kernel/svnrev.h" + #include "third-party/imgui/imgui.h" void FrameTimeRecorder::finish_frame() { @@ -97,6 +102,11 @@ void OpenGlDebugGui::draw(const DmaStats& dma_stats) { ImGui::EndMenu(); } + if (ImGui::BeginMenu("Tools")) { + ImGui::MenuItem("Subtitle Editor", nullptr, &m_subtitle_editor); + ImGui::EndMenu(); + } + if (ImGui::BeginMenu("Screenshot")) { ImGui::MenuItem("Screenshot Next Frame!", nullptr, &m_want_screenshot); ImGui::InputText("File", m_screenshot_save_name, 50); @@ -104,16 +114,33 @@ void OpenGlDebugGui::draw(const DmaStats& dma_stats) { } if (ImGui::BeginMenu("Frame Rate")) { - ImGui::Checkbox("Enable V-Sync", &m_vsync); + ImGui::Checkbox("Enable V-Sync", &Gfx::g_global_settings.vsync); ImGui::Separator(); - ImGui::Checkbox("Framelimiter", &framelimiter); - ImGui::InputFloat("Target FPS", &m_target_fps_text); + ImGui::Checkbox("Framelimiter", &Gfx::g_global_settings.framelimiter); + ImGui::InputFloat("Target FPS", &target_fps_input); if (ImGui::MenuItem("Apply")) { - target_fps = m_target_fps_text; + Gfx::g_global_settings.target_fps = target_fps_input; } ImGui::Separator(); - ImGui::Checkbox("Accurate Lag Mode", &experimental_accurate_lag); - ImGui::Checkbox("Sleep in Frame Limiter", &sleep_in_frame_limiter); + ImGui::Checkbox("Accurate Lag Mode", &Gfx::g_global_settings.experimental_accurate_lag); + ImGui::Checkbox("Sleep in Frame Limiter", &Gfx::g_global_settings.sleep_in_frame_limiter); + ImGui::EndMenu(); + } + + if (ImGui::BeginMenu("Event Profiler")) { + ImGui::Checkbox("Record", &record_events); + ImGui::MenuItem("Dump to file", nullptr, &dump_events); + ImGui::EndMenu(); + } + + if (ImGui::BeginMenu("Debug Mode")) { + if (ImGui::MenuItem("Reboot now!")) { + want_reboot_in_debug = true; + } + ImGui::EndMenu(); + } + + if (ImGui::BeginMenu(fmt::format("WORK IN PROGRESS VERSION ({})!", GIT_VERSION).c_str())) { ImGui::EndMenu(); } } diff --git a/game/graphics/opengl_renderer/debug_gui.h b/game/graphics/opengl_renderer/debug_gui.h index 49eca5c228..bdefa0d093 100644 --- a/game/graphics/opengl_renderer/debug_gui.h +++ b/game/graphics/opengl_renderer/debug_gui.h @@ -5,8 +5,8 @@ * The debug menu-bar and frame timing window */ -#include "common/util/Timer.h" #include "common/dma/dma.h" +#include "common/util/Timer.h" class FrameTimeRecorder { public: @@ -44,10 +44,11 @@ class OpenGlDebugGui { void draw(const DmaStats& dma_stats); bool should_draw_render_debug() const { return m_draw_debug; } bool should_draw_profiler() const { return m_draw_profiler; } + bool should_draw_subtitle_editor() const { return m_subtitle_editor; } const char* screenshot_name() const { return m_screenshot_save_name; } bool should_advance_frame() { return m_frame_timer.should_advance_frame(); } - bool should_gl_finish() { return m_frame_timer.do_gl_finish; } + bool should_gl_finish() const { return m_frame_timer.do_gl_finish; } bool get_screenshot_flag() { if (m_want_screenshot) { @@ -57,21 +58,18 @@ class OpenGlDebugGui { return false; } - bool get_vsync_flag() { return m_vsync; } - - bool framelimiter = false; - float target_fps = 60.f; - bool experimental_accurate_lag = false; - bool sleep_in_frame_limiter = true; bool small_profiler = false; + bool record_events = false; + bool dump_events = false; + bool want_reboot_in_debug = false; private: FrameTimeRecorder m_frame_timer; bool m_draw_frame_time = false; bool m_draw_profiler = false; bool m_draw_debug = false; + bool m_subtitle_editor = false; bool m_want_screenshot = false; char m_screenshot_save_name[256] = "screenshot.png"; - bool m_vsync = true; - float m_target_fps_text = 60.0; + float target_fps_input = 60.f; }; diff --git a/game/graphics/opengl_renderer/foreground/Generic2.cpp b/game/graphics/opengl_renderer/foreground/Generic2.cpp index e9d8b42899..1f1183c481 100644 --- a/game/graphics/opengl_renderer/foreground/Generic2.cpp +++ b/game/graphics/opengl_renderer/foreground/Generic2.cpp @@ -1,6 +1,7 @@ #include "Generic2.h" #include "game/graphics/opengl_renderer/AdgifHandler.h" + #include "third-party/imgui/imgui.h" Generic2::Generic2(const std::string& name, @@ -30,6 +31,18 @@ void Generic2::draw_debug_window() { ImGui::Checkbox("Alpha 4", &m_alpha_draw_enable[3]); ImGui::Checkbox("Alpha 5", &m_alpha_draw_enable[4]); ImGui::Checkbox("Alpha 6", &m_alpha_draw_enable[5]); + + ImGui::Text("Max Seen:"); + ImGui::Text(" frag: %d/%d %.1f%%", m_max_frags_seen, (int)m_fragments.size(), + 100.f * m_max_frags_seen / (float)m_fragments.size()); + ImGui::Text(" vert: %d/%d %.1f%%", m_max_verts_seen, (int)m_verts.size(), + 100.f * m_max_verts_seen / (float)m_verts.size()); + ImGui::Text(" adgif: %d/%d %.1f%%", m_max_frags_seen, (int)m_adgifs.size(), + 100.f * m_max_adgifs_seen / (float)m_adgifs.size()); + ImGui::Text(" idx: %d/%d %.1f%%", m_max_frags_seen, (int)m_indices.size(), + 100.f * m_max_indices_seen / (float)m_indices.size()); + ImGui::Text(" bucket: %d/%d %.1f%%", m_max_frags_seen, (int)m_fragments.size(), + 100.f * m_max_frags_seen / (float)m_fragments.size()); } /*! diff --git a/game/graphics/opengl_renderer/foreground/Generic2.h b/game/graphics/opengl_renderer/foreground/Generic2.h index ed2848cc55..dc1107e266 100644 --- a/game/graphics/opengl_renderer/foreground/Generic2.h +++ b/game/graphics/opengl_renderer/foreground/Generic2.h @@ -6,15 +6,14 @@ class Generic2 : public BucketRenderer { public: Generic2(const std::string& name, BucketId my_id, - u32 num_verts, - u32 num_frags, - u32 num_adgif, - u32 num_buckets); + u32 num_verts = 200000, + u32 num_frags = 2000, + u32 num_adgif = 3000, + u32 num_buckets = 800); ~Generic2(); void render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) override; void draw_debug_window() override; void init_shaders(ShaderLibrary& shaders) override; - // void init_shaders(ShaderLibrary& shaders) override; struct Vertex { math::Vector xyz; @@ -151,18 +150,23 @@ class Generic2 : public BucketRenderer { u32 m_next_free_frag = 0; std::vector m_fragments; + u32 m_max_frags_seen = 0; u32 m_next_free_vert = 0; std::vector m_verts; + u32 m_max_verts_seen = 0; u32 m_next_free_adgif = 0; std::vector m_adgifs; + u32 m_max_adgifs_seen = 0; u32 m_next_free_bucket = 0; std::vector m_buckets; + u32 m_max_buckets_seen = 0; u32 m_next_free_idx = 0; std::vector m_indices; + u32 m_max_indices_seen = 0; Fragment& next_frag() { ASSERT(m_next_free_frag < m_fragments.size()); @@ -185,8 +189,8 @@ class Generic2 : public BucketRenderer { u32 dma_tags = 0; } m_stats; - static constexpr int ALPHA_MODE_COUNT = 6; - bool m_alpha_draw_enable[ALPHA_MODE_COUNT] = {true, true, true, true, true, true}; + static constexpr int ALPHA_MODE_COUNT = 7; + bool m_alpha_draw_enable[ALPHA_MODE_COUNT] = {true, true, true, true, true, true, true}; struct { GLuint vao; diff --git a/game/graphics/opengl_renderer/foreground/Generic2_Build.cpp b/game/graphics/opengl_renderer/foreground/Generic2_Build.cpp index 10cce737d7..6814b6d19d 100644 --- a/game/graphics/opengl_renderer/foreground/Generic2_Build.cpp +++ b/game/graphics/opengl_renderer/foreground/Generic2_Build.cpp @@ -108,16 +108,25 @@ void Generic2::determine_draw_modes() { u64 bonus_adgif_data[4]; memcpy(bonus_adgif_data, frag.header + (5 * 16), 4 * sizeof(u64)); - // ADGIF 5 - ASSERT((u8)bonus_adgif_data[1] == (u8)(GsRegisterAddress::TEST_1)); - u64 final_test = bonus_adgif_data[0]; - // ADGIF 6 - if ((u8)bonus_adgif_data[3] == (u8)(GsRegisterAddress::ALPHA_1)) { - final_alpha = bonus_adgif_data[2]; - } else { + u64 final_test; + if ((u8)bonus_adgif_data[1] == (u8)(GsRegisterAddress::ALPHA_1)) { + ASSERT((u8)bonus_adgif_data[1] == (u8)(GsRegisterAddress::ALPHA_1)); + final_alpha = bonus_adgif_data[0]; ASSERT((u8)bonus_adgif_data[3] == (u8)(GsRegisterAddress::TEST_1)); final_test = bonus_adgif_data[2]; + } else { + // ADGIF 5 + ASSERT((u8)bonus_adgif_data[1] == (u8)(GsRegisterAddress::TEST_1)); + final_test = bonus_adgif_data[0]; + + // ADGIF 6 + if ((u8)bonus_adgif_data[3] == (u8)(GsRegisterAddress::ALPHA_1)) { + final_alpha = bonus_adgif_data[2]; + } else { + ASSERT((u8)bonus_adgif_data[3] == (u8)(GsRegisterAddress::TEST_1)); + final_test = bonus_adgif_data[2]; + } } if (final_alpha) { @@ -146,10 +155,12 @@ void Generic2::determine_draw_modes() { } else if (a == GsAlpha::BlendMode::SOURCE && b == GsAlpha::BlendMode::ZERO_OR_FIXED && c == GsAlpha::BlendMode::DEST && d == GsAlpha::BlendMode::DEST) { current_mode.set_alpha_blend(DrawMode::AlphaBlend::SRC_0_DST_DST); + } else if (a == GsAlpha::BlendMode::SOURCE && b == GsAlpha::BlendMode::ZERO_OR_FIXED && + c == GsAlpha::BlendMode::ZERO_OR_FIXED && d == GsAlpha::BlendMode::DEST) { + current_mode.set_alpha_blend(DrawMode::AlphaBlend::SRC_0_FIX_DST); } else { - // unsupported blend: a 0 b 2 c 2 d 1 - // lg::error("unsupported blend: a {} b {} c {} d {}", (int)a, (int)b, (int)c, (int)d); - // ASSERT(false); + fmt::print("unsupported blend: a {} b {} c {} d {}\n", (int)a, (int)b, (int)c, (int)d); + // ASSERT(false); } } } diff --git a/game/graphics/opengl_renderer/foreground/Generic2_DMA.cpp b/game/graphics/opengl_renderer/foreground/Generic2_DMA.cpp index 2278d493f6..f534702772 100644 --- a/game/graphics/opengl_renderer/foreground/Generic2_DMA.cpp +++ b/game/graphics/opengl_renderer/foreground/Generic2_DMA.cpp @@ -100,6 +100,12 @@ bool Generic2::handle_bucket_setup_dma(DmaFollower& dma, u32 next_bucket) { } void Generic2::reset_buffers() { + m_max_frags_seen = std::max(m_next_free_frag, m_max_frags_seen); + m_max_verts_seen = std::max(m_next_free_vert, m_max_verts_seen); + m_max_adgifs_seen = std::max(m_next_free_adgif, m_max_adgifs_seen); + m_max_buckets_seen = std::max(m_next_free_bucket, m_max_buckets_seen); + m_max_indices_seen = std::max(m_next_free_idx, m_max_indices_seen); + m_next_free_frag = 0; m_next_free_vert = 0; m_next_free_adgif = 0; @@ -180,8 +186,7 @@ u32 Generic2::handle_fragments_after_unpack_v4_32(const u8* data, // continue in this transfer off += first_unpack_bytes; if (off == end_of_vif) { - fmt::print("nothing after header upload\n"); - ASSERT(false); + ASSERT_MSG(false, "nothing after header upload"); } // the next thing is the vertex positions. @@ -379,4 +384,4 @@ void Generic2::process_dma(DmaFollower& dma, u32 next_bucket) { } } } -} \ No newline at end of file +} diff --git a/game/graphics/opengl_renderer/foreground/Generic2_OpenGL.cpp b/game/graphics/opengl_renderer/foreground/Generic2_OpenGL.cpp index b65b2c7e28..21382011fe 100644 --- a/game/graphics/opengl_renderer/foreground/Generic2_OpenGL.cpp +++ b/game/graphics/opengl_renderer/foreground/Generic2_OpenGL.cpp @@ -78,8 +78,9 @@ void Generic2::init_shaders(ShaderLibrary& shaders) { void Generic2::opengl_bind_and_setup_proj(SharedRenderState* render_state) { render_state->shaders[ShaderId::GENERIC].activate(); - glUniform4f(m_ogl.fog_color, render_state->fog_color[0], render_state->fog_color[1], - render_state->fog_color[2], render_state->fog_intensity); + glUniform4f(m_ogl.fog_color, render_state->fog_color[0] / 255.f, + render_state->fog_color[1] / 255.f, render_state->fog_color[2] / 255.f, + render_state->fog_intensity / 255); glUniform4f(m_ogl.scale, m_drawing_config.proj_scale[0], m_drawing_config.proj_scale[1], m_drawing_config.proj_scale[2], 0); glUniform1f(m_ogl.mat_23, m_drawing_config.proj_mat_23); @@ -106,8 +107,7 @@ void Generic2::setup_opengl_for_draw_mode(const DrawMode& draw_mode, case DrawMode::AlphaTest::NEVER: break; default: - fmt::print("unknown alpha test: {}\n", (int)draw_mode.get_alpha_test()); - ASSERT(false); + ASSERT_MSG(false, fmt::format("unknown alpha test: {}", (int)draw_mode.get_alpha_test())); } } @@ -152,7 +152,10 @@ void Generic2::setup_opengl_for_draw_mode(const DrawMode& draw_mode, // (Cs - 0) * Ad + Cd glBlendFunc(GL_DST_ALPHA, GL_ONE); glBlendEquation(GL_FUNC_ADD); - color_mult = 0.5f; // HACK, should probably be 0.5 + color_mult = 0.5f; + } else if (draw_mode.get_alpha_blend() == DrawMode::AlphaBlend::SRC_0_FIX_DST) { + glBlendEquation(GL_FUNC_ADD); + glBlendFuncSeparate(GL_ONE, GL_ONE, GL_ONE, GL_ZERO); } else { ASSERT(false); } @@ -190,8 +193,9 @@ void Generic2::setup_opengl_for_draw_mode(const DrawMode& draw_mode, glUniform1f(m_ogl.alpha_reject, alpha_reject); glUniform1f(m_ogl.color_mult, color_mult); - glUniform4f(m_ogl.fog_color, render_state->fog_color[0], render_state->fog_color[1], - render_state->fog_color[2], render_state->fog_intensity); + glUniform4f(m_ogl.fog_color, render_state->fog_color[0] / 255.f, + render_state->fog_color[1] / 255.f, render_state->fog_color[2] / 255.f, + render_state->fog_intensity / 255); } void Generic2::setup_opengl_tex(u16 unit, @@ -295,9 +299,10 @@ void Generic2::do_draws(SharedRenderState* render_state, ScopedProfilerNode& pro opengl_bind_and_setup_proj(render_state); constexpr DrawMode::AlphaBlend alpha_order[ALPHA_MODE_COUNT] = { - DrawMode::AlphaBlend::SRC_SRC_SRC_SRC, DrawMode::AlphaBlend::SRC_DST_SRC_DST, - DrawMode::AlphaBlend::SRC_0_SRC_DST, DrawMode::AlphaBlend::ZERO_SRC_SRC_DST, - DrawMode::AlphaBlend::SRC_DST_FIX_DST, DrawMode::AlphaBlend::SRC_0_DST_DST, + DrawMode::AlphaBlend::SRC_0_FIX_DST, DrawMode::AlphaBlend::SRC_SRC_SRC_SRC, + DrawMode::AlphaBlend::SRC_DST_SRC_DST, DrawMode::AlphaBlend::SRC_0_SRC_DST, + DrawMode::AlphaBlend::ZERO_SRC_SRC_DST, DrawMode::AlphaBlend::SRC_DST_FIX_DST, + DrawMode::AlphaBlend::SRC_0_DST_DST, }; for (int i = 0; i < ALPHA_MODE_COUNT; i++) { @@ -315,4 +320,4 @@ void Generic2::do_draws(SharedRenderState* render_state, ScopedProfilerNode& pro do_hud_draws(render_state, prof); } -} \ No newline at end of file +} diff --git a/game/graphics/opengl_renderer/foreground/Merc2.cpp b/game/graphics/opengl_renderer/foreground/Merc2.cpp new file mode 100644 index 0000000000..01807731fb --- /dev/null +++ b/game/graphics/opengl_renderer/foreground/Merc2.cpp @@ -0,0 +1,629 @@ +#include "Merc2.h" + +#include "game/graphics/opengl_renderer/background/background_common.h" + +#include "third-party/imgui/imgui.h" + +Merc2::Merc2(const std::string& name, BucketId my_id) : BucketRenderer(name, my_id) { + glGenVertexArrays(1, &m_vao); + glBindVertexArray(m_vao); + + glGenBuffers(1, &m_bones_buffer); + glBindBuffer(GL_UNIFORM_BUFFER, m_bones_buffer); + std::vector temp(MAX_SHADER_BONE_VECTORS * sizeof(math::Vector4f)); + glBufferData(GL_UNIFORM_BUFFER, MAX_SHADER_BONE_VECTORS * sizeof(math::Vector4f), temp.data(), + GL_DYNAMIC_DRAW); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + GLint val; + glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &val); + if (val <= 16) { + // somehow doubt this can happen, but just in case + m_opengl_buffer_alignment = 1; + } else { + m_opengl_buffer_alignment = val / 16; // number of bone vectors + if (m_opengl_buffer_alignment * 16 != (u32)val) { + ASSERT_MSG(false, + fmt::format("opengl uniform buffer alignment is {}, which is strange\n", val)); + } + } + + for (int i = 0; i < MAX_LEVELS; i++) { + auto& draws = m_level_draw_buckets.emplace_back(); + draws.draws.resize(MAX_DRAWS_PER_LEVEL); + } +} + +/*! + * Handle the merc renderer switching to a different model. + */ +void Merc2::init_pc_model(const DmaTransfer& setup, SharedRenderState* render_state) { + // determine the name. We've packed this in a separate PC-port specific packet. + char name[128]; + strcpy(name, (const char*)setup.data); + + // get the model from the loader + m_current_model = render_state->loader->get_merc_model(name); + + // update stats + m_stats.num_models++; + if (m_current_model) { + for (const auto& effect : m_current_model->model->effects) { + m_stats.num_effects++; + m_stats.num_predicted_draws += effect.draws.size(); + for (const auto& draw : effect.draws) { + m_stats.num_predicted_tris += draw.num_triangles; + } + } + } +} + +/*! + * Once-per-frame initialization + */ +void Merc2::init_for_frame(SharedRenderState* render_state) { + // reset state + m_current_model = std::nullopt; + m_stats = {}; + + // activate the merc shader used for all draws + render_state->shaders[ShaderId::MERC2].activate(); + + // set uniforms that we know from render_state + glUniform4f(m_uniforms.fog_color, render_state->fog_color[0] / 255.f, + render_state->fog_color[1] / 255.f, render_state->fog_color[2] / 255.f, + render_state->fog_intensity / 255); +} + +void Merc2::draw_debug_window() { + ImGui::Text("Models : %d", m_stats.num_models); + ImGui::Text("Effects : %d", m_stats.num_effects); + ImGui::Text("Draws (p): %d", m_stats.num_predicted_draws); + ImGui::Text("Tris (p): %d", m_stats.num_predicted_tris); + ImGui::Text("Bones : %d", m_stats.num_bones_uploaded); + ImGui::Text("Lights : %d", m_stats.num_lights); + ImGui::Text("Dflush : %d", m_stats.num_draw_flush); +} + +void Merc2::init_shaders(ShaderLibrary& shaders) { + shaders[ShaderId::MERC2].activate(); + m_uniforms.light_direction[0] = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "light_dir0"); + m_uniforms.light_direction[1] = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "light_dir1"); + m_uniforms.light_direction[2] = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "light_dir2"); + m_uniforms.light_color[0] = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "light_col0"); + m_uniforms.light_color[1] = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "light_col1"); + m_uniforms.light_color[2] = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "light_col2"); + m_uniforms.light_ambient = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "light_ambient"); + + m_uniforms.hvdf_offset = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "hvdf_offset"); + m_uniforms.perspective[0] = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "perspective0"); + m_uniforms.perspective[1] = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "perspective1"); + m_uniforms.perspective[2] = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "perspective2"); + m_uniforms.perspective[3] = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "perspective3"); + + m_uniforms.fog = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "fog_constants"); + m_uniforms.decal = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "decal_enable"); + + m_uniforms.fog_color = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "fog_color"); + m_uniforms.perspective_matrix = + glGetUniformLocation(shaders[ShaderId::MERC2].id(), "perspective_matrix"); + m_uniforms.ignore_alpha = glGetUniformLocation(shaders[ShaderId::MERC2].id(), "ignore_alpha"); +} + +/*! + * Main merc2 rendering. + */ +void Merc2::render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) { + // skip if disabled + if (!m_enabled) { + while (dma.current_tag_offset() != render_state->next_bucket) { + dma.read_and_advance(); + } + return; + } + + init_for_frame(render_state); + + // iterate through the dma chain, filling buckets + handle_all_dma(dma, render_state, prof); + + // flush model data to buckets + flush_pending_model(render_state, prof); + // flush buckets to draws + flush_draw_buckets(render_state, prof); +} + +u32 Merc2::alloc_lights(const VuLights& lights) { + ASSERT(m_next_free_light < MAX_LIGHTS); + m_stats.num_lights++; + u32 light_idx = m_next_free_light; + m_lights_buffer[m_next_free_light++] = lights; + static_assert(sizeof(VuLights) == 7 * 16); + return light_idx; +} + +/*! + * Store light values + */ +void Merc2::set_lights(const DmaTransfer& dma) { + memcpy(&m_current_lights, dma.data, sizeof(VuLights)); +} + +void Merc2::handle_matrix_dma(const DmaTransfer& dma) { + int slot = dma.vif0() & 0xff; + ASSERT(slot < MAX_SKEL_BONES); + memcpy(&m_skel_matrix_buffer[slot], dma.data, sizeof(MercMat)); +} + +/*! + * Main MERC2 function to handle DMA + */ +void Merc2::handle_all_dma(DmaFollower& dma, + SharedRenderState* render_state, + ScopedProfilerNode& prof) { + // process the first tag. this is just jumping to the merc-specific dma. + auto data0 = dma.read_and_advance(); + ASSERT(data0.vif1() == 0); + ASSERT(data0.vif0() == 0); + ASSERT(data0.size_bytes == 0); + if (dma.current_tag().kind == DmaTag::Kind::CALL) { + // renderer didn't run, let's just get out of here. + for (int i = 0; i < 4; i++) { + dma.read_and_advance(); + } + ASSERT(dma.current_tag_offset() == render_state->next_bucket); + return; + } + ASSERT(data0.size_bytes == 0); + ASSERT(data0.vif0() == 0); + ASSERT(data0.vif1() == 0); + + // if we reach here, there's stuff to draw + // this handles merc-specific setup DMA + handle_setup_dma(dma); + + // handle each merc transfer + while (dma.current_tag_offset() != render_state->next_bucket) { + handle_merc_chain(dma, render_state, prof); + } + ASSERT(dma.current_tag_offset() == render_state->next_bucket); +} + +namespace { +void set_uniform(GLuint uniform, const math::Vector3f& val) { + glUniform3f(uniform, val.x(), val.y(), val.z()); +} +void set_uniform(GLuint uniform, const math::Vector4f& val) { + glUniform4f(uniform, val.x(), val.y(), val.z(), val.w()); +} +} // namespace + +void Merc2::handle_setup_dma(DmaFollower& dma) { + auto first = dma.read_and_advance(); + + // 10 quadword setup packet + ASSERT(first.size_bytes == 10 * 16); + // m_stats.str += fmt::format("Setup 0: {} {} {}", first.size_bytes / 16, + // first.vifcode0().print(), first.vifcode1().print()); + + // transferred vifcodes + { + auto vif0 = first.vifcode0(); + auto vif1 = first.vifcode1(); + // STCYCL 4, 4 + ASSERT(vif0.kind == VifCode::Kind::STCYCL); + auto vif0_st = VifCodeStcycl(vif0); + ASSERT(vif0_st.cl == 4 && vif0_st.wl == 4); + // STMOD + ASSERT(vif1.kind == VifCode::Kind::STMOD); + ASSERT(vif1.immediate == 0); + } + + // 1 qw with 4 vifcodes. + u32 vifcode_data[4]; + memcpy(vifcode_data, first.data, 16); + { + auto vif0 = VifCode(vifcode_data[0]); + ASSERT(vif0.kind == VifCode::Kind::BASE); + ASSERT(vif0.immediate == MercDataMemory::BUFFER_BASE); + auto vif1 = VifCode(vifcode_data[1]); + ASSERT(vif1.kind == VifCode::Kind::OFFSET); + ASSERT((s16)vif1.immediate == MercDataMemory::BUFFER_OFFSET); + auto vif2 = VifCode(vifcode_data[2]); + ASSERT(vif2.kind == VifCode::Kind::NOP); + auto vif3 = VifCode(vifcode_data[3]); + ASSERT(vif3.kind == VifCode::Kind::UNPACK_V4_32); + VifCodeUnpack up(vif3); + ASSERT(up.addr_qw == MercDataMemory::LOW_MEMORY); + ASSERT(!up.use_tops_flag); + ASSERT(vif3.num == 8); + } + + // 8 qw's of low memory data + memcpy(&m_low_memory, first.data + 16, sizeof(LowMemory)); + set_uniform(m_uniforms.hvdf_offset, m_low_memory.hvdf_offset); + set_uniform(m_uniforms.fog, m_low_memory.fog); + for (int i = 0; i < 4; i++) { + set_uniform(m_uniforms.perspective[i], m_low_memory.perspective[i]); + } + // todo rm. + glUniformMatrix4fv(m_uniforms.perspective_matrix, 1, GL_FALSE, &m_low_memory.perspective[0].x()); + + // 1 qw with another 4 vifcodes. + u32 vifcode_final_data[4]; + memcpy(vifcode_final_data, first.data + 16 + sizeof(LowMemory), 16); + { + ASSERT(VifCode(vifcode_final_data[0]).kind == VifCode::Kind::FLUSHE); + ASSERT(vifcode_final_data[1] == 0); + ASSERT(vifcode_final_data[2] == 0); + VifCode mscal(vifcode_final_data[3]); + ASSERT(mscal.kind == VifCode::Kind::MSCAL); + ASSERT(mscal.immediate == 0); + } + + // TODO: process low memory initialization + + auto second = dma.read_and_advance(); + ASSERT(second.size_bytes == 32); // setting up test register. + auto nothing = dma.read_and_advance(); + ASSERT(nothing.size_bytes == 0); + ASSERT(nothing.vif0() == 0); + ASSERT(nothing.vif1() == 0); +} + +namespace { +bool tag_is_nothing_next(const DmaFollower& dma) { + return dma.current_tag().kind == DmaTag::Kind::NEXT && dma.current_tag().qwc == 0 && + dma.current_tag_vif0() == 0 && dma.current_tag_vif1() == 0; +} +bool tag_is_nothing_cnt(const DmaFollower& dma) { + return dma.current_tag().kind == DmaTag::Kind::CNT && dma.current_tag().qwc == 0 && + dma.current_tag_vif0() == 0 && dma.current_tag_vif1() == 0; +} +} // namespace + +void Merc2::handle_merc_chain(DmaFollower& dma, + SharedRenderState* render_state, + ScopedProfilerNode& prof) { + while (tag_is_nothing_next(dma)) { + auto nothing = dma.read_and_advance(); + ASSERT(nothing.size_bytes == 0); + } + if (dma.current_tag().kind == DmaTag::Kind::CALL) { + for (int i = 0; i < 4; i++) { + dma.read_and_advance(); + } + return; + } + + auto init = dma.read_and_advance(); + + if (init.vifcode1().kind == VifCode::Kind::PC_PORT) { + // we got a PC PORT packet. this contains some extra data to set up the model + flush_pending_model(render_state, prof); + init_pc_model(init, render_state); + ASSERT(tag_is_nothing_cnt(dma)); + init = dma.read_and_advance(); // dummy tag in pc port + init = dma.read_and_advance(); + } + + // row stuff. + ASSERT(init.vifcode0().kind == VifCode::Kind::STROW); + ASSERT(init.size_bytes == 16); + // m_vif.row[0] = init.vif1(); + // memcpy(m_vif.row + 1, init.data, 12); + u32 extra; + memcpy(&extra, init.data + 12, 4); + // ASSERT(extra == 0); + m_current_effect_enable_bits = extra; + m_current_ignore_alpha_bits = extra >> 16; + DmaTransfer next; + + bool setting_up = true; + u32 mscal_addr = -1; + while (setting_up) { + next = dma.read_and_advance(); + // fmt::print("next: {}", dma.current_tag().print()); + u32 offset_in_data = 0; + // fmt::print("START {} : {} {}\n", next.size_bytes, next.vifcode0().print(), + // next.vifcode1().print()); + auto vif0 = next.vifcode0(); + switch (vif0.kind) { + case VifCode::Kind::NOP: + case VifCode::Kind::FLUSHE: + break; + case VifCode::Kind::STMOD: + ASSERT(vif0.immediate == 0 || vif0.immediate == 1); + // m_vif.stmod = vif0.immediate; + break; + default: + ASSERT(false); + } + + auto vif1 = next.vifcode1(); + switch (vif1.kind) { + case VifCode::Kind::UNPACK_V4_8: { + VifCodeUnpack up(vif1); + offset_in_data += 4 * vif1.num; + } break; + case VifCode::Kind::UNPACK_V4_32: { + VifCodeUnpack up(vif1); + if (up.addr_qw == 132 && vif1.num == 8) { + set_lights(next); + } else if (vif1.num == 7) { + handle_matrix_dma(next); + } + offset_in_data += 16 * vif1.num; + } break; + case VifCode::Kind::MSCAL: + // fmt::print("cal\n"); + mscal_addr = vif1.immediate; + ASSERT(next.size_bytes == 0); + setting_up = false; + break; + default: + ASSERT(false); + } + + ASSERT(offset_in_data <= next.size_bytes); + if (offset_in_data < next.size_bytes) { + ASSERT((offset_in_data % 4) == 0); + u32 leftover = next.size_bytes - offset_in_data; + if (leftover < 16) { + for (u32 i = 0; i < leftover; i++) { + ASSERT(next.data[offset_in_data + i] == 0); + } + } else { + ASSERT(false); + } + } + } +} + +/*! + * Queue up some bones to be included in the bone buffer. + * Returns the index of the first bone vector. + */ +u32 Merc2::alloc_bones(int count, float scale) { + u32 first_bone_vector = m_next_free_bone_vector; + ASSERT(count * 8 + first_bone_vector <= MAX_SHADER_BONE_VECTORS); + + // model should have under 128 bones. + ASSERT(count <= MAX_SKEL_BONES); + + // iterate over each bone we need + for (int i = 0; i < count; i++) { + auto& skel_mat = m_skel_matrix_buffer[i]; + auto* shader_mat = &m_shader_bone_vector_buffer[m_next_free_bone_vector]; + int bv = 0; + + // scale the transformation matrix (todo: can we move this to the extraction) + // and copy to the large bone buffer. + for (int j = 0; j < 3; j++) { + shader_mat[bv++] = skel_mat.tmat[j] * scale; + } + shader_mat[bv++] = skel_mat.tmat[3]; + + for (int j = 0; j < 3; j++) { + shader_mat[bv++] = skel_mat.nmat[j]; + } + + // we could include the effect of the perspective matrix here. + // for (int j = 0; j < 3; j++) { + // tbone_buffer[i][j] = vf15.elementwise_multiply(bone_mat[j]); + // tbone_buffer[i][j].w() += p.w() * bone_mat[j].z(); + // tbone_buffer[i][j] *= scale; + // } + // + // tbone_buffer[i][3] = vf15.elementwise_multiply(bone_mat[3]) + + // m_low_memory.perspective[3]; tbone_buffer[i][3].w() += p.w() * bone_mat[3].z(); + + m_next_free_bone_vector += 8; + } + + auto b0 = m_next_free_bone_vector; + m_next_free_bone_vector += m_opengl_buffer_alignment - 1; + m_next_free_bone_vector /= m_opengl_buffer_alignment; + m_next_free_bone_vector *= m_opengl_buffer_alignment; + ASSERT(b0 <= m_next_free_bone_vector); + ASSERT(first_bone_vector + count * 8 <= m_next_free_bone_vector); + return first_bone_vector; +} +/*! + * Flush a model to draw buckets + */ +void Merc2::flush_pending_model(SharedRenderState* render_state, ScopedProfilerNode& prof) { + if (!m_current_model) { + return; + } + + const LevelData* lev = m_current_model->level; + const tfrag3::MercModel* model = m_current_model->model; + + int bone_count = model->max_bones + 1; + + if (m_next_free_light >= MAX_LIGHTS) { + fmt::print("MERC2 out of lights, consider increasing MAX_LIGHTS\n"); + flush_draw_buckets(render_state, prof); + } + + if (m_next_free_bone_vector + m_opengl_buffer_alignment + bone_count * 8 > + MAX_SHADER_BONE_VECTORS) { + fmt::print("MERC2 out of bones, consider increasing MAX_SHADER_BONE_VECTORS\n"); + flush_draw_buckets(render_state, prof); + } + + // find a level bucket + LevelDrawBucket* lev_bucket = nullptr; + for (u32 i = 0; i < m_next_free_level_bucket; i++) { + if (m_level_draw_buckets[i].level == lev) { + lev_bucket = &m_level_draw_buckets[i]; + break; + } + } + + if (!lev_bucket) { + // no existing bucket + if (m_next_free_level_bucket >= m_level_draw_buckets.size()) { + // out of room, flush + // fmt::print("MERC2 out of levels, consider increasing MAX_LEVELS\n"); + flush_draw_buckets(render_state, prof); + // and retry the whole thing. + flush_pending_model(render_state, prof); + return; + } + // alloc a new one + lev_bucket = &m_level_draw_buckets[m_next_free_level_bucket++]; + lev_bucket->reset(); + lev_bucket->level = lev; + } + + if (lev_bucket->next_free_draw + model->max_draws >= lev_bucket->draws.size()) { + // out of room, flush + fmt::print("MERC2 out of draws, consider increasing MAX_DRAWS_PER_LEVEL\n"); + flush_draw_buckets(render_state, prof); + // and retry the whole thing. + flush_pending_model(render_state, prof); + return; + } + + u32 first_bone = alloc_bones(bone_count, model->scale_xyz); + + // allocate lights + u32 lights = alloc_lights(m_current_lights); + // + for (size_t ei = 0; ei < model->effects.size(); ei++) { + if (!(m_current_effect_enable_bits & (1 << ei))) { + continue; + } + + u8 ignore_alpha = (m_current_ignore_alpha_bits & (1 << ei)); + auto& effect = model->effects[ei]; + for (auto& mdraw : effect.draws) { + Draw* draw = &lev_bucket->draws[lev_bucket->next_free_draw++]; + draw->first_index = mdraw.first_index; + draw->index_count = mdraw.index_count; + draw->mode = mdraw.mode; + draw->texture = mdraw.tree_tex_id; + draw->first_bone = first_bone; + draw->light_idx = lights; + draw->num_triangles = mdraw.num_triangles; + draw->ignore_alpha = ignore_alpha; + } + } + + m_current_model = std::nullopt; +} + +void Merc2::flush_draw_buckets(SharedRenderState* /*render_state*/, ScopedProfilerNode& prof) { + m_stats.num_draw_flush++; + + for (u32 li = 0; li < m_next_free_level_bucket; li++) { + const auto& lev_bucket = m_level_draw_buckets[li]; + const auto* lev = lev_bucket.level; + glBindVertexArray(m_vao); + glBindBuffer(GL_ARRAY_BUFFER, lev->merc_vertices); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, lev->merc_indices); + + glEnable(GL_PRIMITIVE_RESTART); + glPrimitiveRestartIndex(UINT32_MAX); + glEnableVertexAttribArray(0); + glEnableVertexAttribArray(1); + glEnableVertexAttribArray(2); + glEnableVertexAttribArray(3); + glEnableVertexAttribArray(4); + glEnableVertexAttribArray(5); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_GEQUAL); + + glVertexAttribPointer(0, // location 0 in the shader + 3, // 3 values per vert + GL_FLOAT, // floats + GL_FALSE, // normalized + sizeof(tfrag3::MercVertex), // stride + (void*)offsetof(tfrag3::MercVertex, pos) // offset (0) + ); + + glVertexAttribPointer(1, // location 1 in the + 3, // 3 values per vert + GL_FLOAT, // floats + GL_FALSE, // normalized + sizeof(tfrag3::MercVertex), // stride + (void*)offsetof(tfrag3::MercVertex, normal[0]) // offset (0) + ); + + glVertexAttribPointer(2, // location 1 in the + 3, // 3 values per vert + GL_FLOAT, // floats + GL_FALSE, // normalized + sizeof(tfrag3::MercVertex), // stride + (void*)offsetof(tfrag3::MercVertex, weights[0]) // offset (0) + ); + + glVertexAttribPointer(3, // location 1 in the shader + 2, // 3 values per vert + GL_FLOAT, // floats + GL_FALSE, // normalized + sizeof(tfrag3::MercVertex), // stride + (void*)offsetof(tfrag3::MercVertex, st[0]) // offset (0) + ); + + glVertexAttribPointer(4, // location 1 in the shader + 3, // 3 values per vert + GL_UNSIGNED_BYTE, // floats + GL_TRUE, // normalized + sizeof(tfrag3::MercVertex), // stride + (void*)offsetof(tfrag3::MercVertex, rgba[0]) // offset (0) + ); + + glVertexAttribIPointer(5, // location 0 in the + 3, // 3 floats per vert + GL_UNSIGNED_BYTE, // u8's + sizeof(tfrag3::MercVertex), // + (void*)offsetof(tfrag3::MercVertex, mats[0]) // offset in array + ); + + int last_tex = -1; + int last_light = -1; + m_stats.num_bones_uploaded += m_next_free_bone_vector; + + glBindBuffer(GL_UNIFORM_BUFFER, m_bones_buffer); + glBufferSubData(GL_UNIFORM_BUFFER, 0, m_next_free_bone_vector * sizeof(math::Vector4f), + m_shader_bone_vector_buffer); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + for (u32 di = 0; di < lev_bucket.next_free_draw; di++) { + auto& draw = lev_bucket.draws[di]; + glUniform1i(m_uniforms.ignore_alpha, draw.ignore_alpha); + if ((int)draw.texture != last_tex) { + glBindTexture(GL_TEXTURE_2D, lev->textures.at(draw.texture)); + last_tex = draw.texture; + } + + if ((int)draw.light_idx != last_light) { + set_uniform(m_uniforms.light_direction[0], m_lights_buffer[draw.light_idx].direction0); + set_uniform(m_uniforms.light_direction[1], m_lights_buffer[draw.light_idx].direction1); + set_uniform(m_uniforms.light_direction[2], m_lights_buffer[draw.light_idx].direction2); + set_uniform(m_uniforms.light_color[0], m_lights_buffer[draw.light_idx].color0); + set_uniform(m_uniforms.light_color[1], m_lights_buffer[draw.light_idx].color1); + set_uniform(m_uniforms.light_color[2], m_lights_buffer[draw.light_idx].color2); + set_uniform(m_uniforms.light_ambient, m_lights_buffer[draw.light_idx].ambient); + last_light = draw.light_idx; + } + setup_opengl_from_draw_mode(draw.mode, GL_TEXTURE0, true); + + glUniform1i(m_uniforms.decal, draw.mode.get_decal()); + + prof.add_draw_call(); + prof.add_tri(draw.num_triangles); + glBindBufferRange(GL_UNIFORM_BUFFER, 1, m_bones_buffer, + sizeof(math::Vector4f) * draw.first_bone, 128 * sizeof(ShaderMercMat)); + glDrawElements(GL_TRIANGLE_STRIP, draw.index_count, GL_UNSIGNED_INT, + (void*)(sizeof(u32) * draw.first_index)); + } + } + + m_next_free_light = 0; + m_next_free_bone_vector = 0; + m_next_free_level_bucket = 0; +} diff --git a/game/graphics/opengl_renderer/foreground/Merc2.h b/game/graphics/opengl_renderer/foreground/Merc2.h new file mode 100644 index 0000000000..2c8f83241c --- /dev/null +++ b/game/graphics/opengl_renderer/foreground/Merc2.h @@ -0,0 +1,151 @@ +#pragma once +#include "game/graphics/opengl_renderer/BucketRenderer.h" + +class Merc2 : public BucketRenderer { + public: + Merc2(const std::string& name, BucketId my_id); + void draw_debug_window() override; + void init_shaders(ShaderLibrary& shaders) override; + void render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) override; + void handle_merc_chain(DmaFollower& dma, + SharedRenderState* render_state, + ScopedProfilerNode& prof); + + private: + enum MercDataMemory { + LOW_MEMORY = 0, + BUFFER_BASE = 442, + // this negative offset is what broke jak graphics in Dobiestation for a long time. + BUFFER_OFFSET = -442 + }; + + struct LowMemory { + u8 tri_strip_tag[16]; + u8 ad_gif_tag[16]; + math::Vector4f hvdf_offset; + math::Vector4f perspective[4]; + math::Vector4f fog; + } m_low_memory; + static_assert(sizeof(LowMemory) == 0x80); + + struct VuLights { + math::Vector3f direction0; + u32 w0; + math::Vector3f direction1; + u32 w1; + math::Vector3f direction2; + u32 w2; + math::Vector3f color0; + u32 w3; + math::Vector3f color1; + u32 w4; + math::Vector3f color2; + u32 w5; + math::Vector3f ambient; + u32 w6; + }; + + void init_for_frame(SharedRenderState* render_state); + void init_pc_model(const DmaTransfer& setup, SharedRenderState* render_state); + void handle_all_dma(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof); + void handle_setup_dma(DmaFollower& dma); + u32 alloc_lights(const VuLights& lights); + void set_lights(const DmaTransfer& dma); + void handle_matrix_dma(const DmaTransfer& dma); + void flush_pending_model(SharedRenderState* render_state, ScopedProfilerNode& prof); + + u32 alloc_bones(int count, float scale); + + std::optional m_current_model = std::nullopt; + u16 m_current_effect_enable_bits = 0; + u16 m_current_ignore_alpha_bits = 0; + + struct MercMat { + math::Vector4f tmat[4]; + math::Vector4f nmat[3]; + }; + + struct ShaderMercMat { + math::Vector4f tmat[4]; + math::Vector4f nmat[3]; + math::Vector4f pad; + }; + + static constexpr int MAX_SKEL_BONES = 128; + static constexpr int BONE_VECTORS_PER_BONE = 7; + static constexpr int MAX_SHADER_BONE_VECTORS = 1024 * 32; // ?? + + static constexpr int MAX_LEVELS = 3; + static constexpr int MAX_DRAWS_PER_LEVEL = 1024; + + math::Vector4f m_shader_bone_vector_buffer[MAX_SHADER_BONE_VECTORS]; + ShaderMercMat m_skel_matrix_buffer[MAX_SKEL_BONES]; + + struct { + GLuint light_direction[3]; + GLuint light_color[3]; + GLuint light_ambient; + + GLuint hvdf_offset; + GLuint perspective[4]; + GLuint fog; + + GLuint tbone; + GLuint nbone; + + GLuint fog_color; + GLuint perspective_matrix; + + GLuint ignore_alpha; + GLuint decal; + } m_uniforms; + + GLuint m_vao; + + GLuint m_bones_buffer; + + struct Stats { + int num_models = 0; + int num_chains = 0; + int num_effects = 0; + int num_predicted_draws = 0; + int num_predicted_tris = 0; + int num_bones_uploaded = 0; + int num_lights = 0; + int num_draw_flush = 0; + } m_stats; + + struct Draw { + u32 first_index; + u32 index_count; + DrawMode mode; + u32 texture; + u32 num_triangles; + u16 first_bone; + u16 light_idx; + u8 ignore_alpha; + }; + + struct LevelDrawBucket { + const LevelData* level = nullptr; + std::vector draws; + u32 next_free_draw = 0; + + void reset() { + level = nullptr; + next_free_draw = 0; + } + }; + + static constexpr int MAX_LIGHTS = 1024; + VuLights m_lights_buffer[MAX_LIGHTS]; + u32 m_next_free_light = 0; + VuLights m_current_lights; + + std::vector m_level_draw_buckets; + u32 m_next_free_level_bucket = 0; + u32 m_next_free_bone_vector = 0; + size_t m_opengl_buffer_alignment = 0; + + void flush_draw_buckets(SharedRenderState* render_state, ScopedProfilerNode& prof); +}; diff --git a/game/graphics/opengl_renderer/loader/Loader.cpp b/game/graphics/opengl_renderer/loader/Loader.cpp new file mode 100644 index 0000000000..5121dee7ea --- /dev/null +++ b/game/graphics/opengl_renderer/loader/Loader.cpp @@ -0,0 +1,412 @@ +#include "Loader.h" + +#include "common/util/FileUtil.h" +#include "common/util/Timer.h" +#include "common/util/compress.h" + +#include "game/graphics/opengl_renderer/loader/LoaderStages.h" + +namespace { +std::string uppercase_string(const std::string& s) { + std::string result; + for (auto c : s) { + result.push_back(toupper(c)); + } + return result; +} +} // namespace + +Loader::Loader() { + m_loader_thread = std::thread(&Loader::loader_thread, this); + m_loader_stages = make_loader_stages(); +} + +Loader::~Loader() { + { + std::lock_guard lk(m_loader_mutex); + m_want_shutdown = true; + m_loader_cv.notify_all(); + } + m_loader_thread.join(); +} + +/*! + * Try to get a loaded level by name. It may fail and return nullptr. + * Getting a level will reset the counter for the level and prevent it from being kicked out + * for a little while. + * + * This is safe to call from the graphics thread + */ +const LevelData* Loader::get_tfrag3_level(const std::string& level_name) { + std::unique_lock lk(m_loader_mutex); + const auto& existing = m_loaded_tfrag3_levels.find(level_name); + if (existing == m_loaded_tfrag3_levels.end()) { + return nullptr; + } else { + existing->second->frames_since_last_used = 0; + return existing->second.get(); + } +} + +/*! + * The game calls this to give the loader a hint on which levels we want. + * If the loader is not busy, it will begin loading the level. + * This should be called on every frame. + */ +void Loader::set_want_levels(const std::vector& levels) { + std::unique_lock lk(m_loader_mutex); + m_desired_levels = levels; + if (!m_level_to_load.empty()) { + // can't do anything, we're loading a level right now + return; + } + + if (!m_initializing_tfrag3_levels.empty()) { + // can't do anything, we're initializing a level right now + return; + } + + // loader isn't busy, try to load one of the requested levels. + for (auto& lev : levels) { + auto it = m_loaded_tfrag3_levels.find(lev); + if (it == m_loaded_tfrag3_levels.end()) { + // we haven't loaded it yet. Request this level to load and wake up the thread. + m_level_to_load = lev; + lk.unlock(); + m_loader_cv.notify_all(); + return; + } + } +} + +/*! + * Get all levels that are in memory and used very recently. + */ +std::vector Loader::get_in_use_levels() { + std::vector result; + std::unique_lock lk(m_loader_mutex); + + for (auto& lev : m_loaded_tfrag3_levels) { + if (lev.second->frames_since_last_used < 5) { + result.push_back(lev.second.get()); + } + } + return result; +} + +/*! + * Loader function that runs in a completely separate thread. + * This is used for file I/O and unpacking. + */ +void Loader::loader_thread() { + while (!m_want_shutdown) { + std::unique_lock lk(m_loader_mutex); + + // this will keep us asleep until we've got a level to load. + m_loader_cv.wait(lk, [&] { return !m_level_to_load.empty() || m_want_shutdown; }); + if (m_want_shutdown) { + return; + } + std::string lev = m_level_to_load; + // don't hold the lock while reading the file. + lk.unlock(); + + // simulate slower hard drive (so that the loader thread can lose to the game loads) + // std::this_thread::sleep_for(std::chrono::milliseconds(1500)); + + // load the fr3 file + Timer disk_timer; + auto data = file_util::read_binary_file( + file_util::get_file_path({fmt::format("assets/{}.fr3", uppercase_string(lev))})); + double disk_load_time = disk_timer.getSeconds(); + + // the FR3 files are compressed + Timer decomp_timer; + auto decomp_data = compression::decompress_zstd(data.data(), data.size()); + double decomp_time = decomp_timer.getSeconds(); + + // Read back into the tfrag3::Level structure + Timer import_timer; + auto result = std::make_unique(); + Serializer ser(decomp_data.data(), decomp_data.size()); + result->serialize(ser); + double import_time = import_timer.getSeconds(); + + // and finally "unpack", which creates the vertex data we'll upload to the GPU + Timer unpack_timer; + for (auto& tie_tree : result->tie_trees) { + for (auto& tree : tie_tree) { + tree.unpack(); + } + } + for (auto& t_tree : result->tfrag_trees) { + for (auto& tree : t_tree) { + tree.unpack(); + } + } + + for (auto& shrub_tree : result->shrub_trees) { + shrub_tree.unpack(); + } + fmt::print( + "------------> Load from file: {:.3f}s, import {:.3f}s, decomp {:.3f}s unpack {:.3f}s\n", + disk_load_time, import_time, decomp_time, unpack_timer.getSeconds()); + + // grab the lock again + lk.lock(); + // move this level to "initializing" state. + m_initializing_tfrag3_levels[lev] = std::make_unique(); // reset load state + m_initializing_tfrag3_levels[lev]->level = std::move(result); + m_level_to_load = ""; + m_file_load_done_cv.notify_all(); + } +} + +/*! + * Load a "common" FR3 file that has non-level textures. + * This should be called during initialization, before any threaded loading goes on. + */ +void Loader::load_common(TexturePool& tex_pool, const std::string& name) { + auto data = + file_util::read_binary_file(file_util::get_file_path({fmt::format("assets/{}.fr3", name)})); + + auto decomp_data = compression::decompress_zstd(data.data(), data.size()); + Serializer ser(decomp_data.data(), decomp_data.size()); + m_common_level.level = std::make_unique(); + m_common_level.level->serialize(ser); + for (auto& tex : m_common_level.level->textures) { + m_common_level.textures.push_back(add_texture(tex_pool, tex, true)); + } + + Timer tim; + MercLoaderStage mls; + LoaderInput input; + input.tex_pool = &tex_pool; + input.mercs = &m_all_merc_models; + input.lev_data = &m_common_level; + bool done = false; + while (!done) { + done = mls.run(tim, input); + } +} + +bool Loader::upload_textures(Timer& timer, LevelData& data, TexturePool& texture_pool) { + // try to move level from initializing to initialized: + + constexpr int MAX_TEX_BYTES_PER_FRAME = 1024 * 128; + + int bytes_this_run = 0; + int tex_this_run = 0; + if (data.textures.size() < data.level->textures.size()) { + std::unique_lock tpool_lock(texture_pool.mutex()); + while (data.textures.size() < data.level->textures.size()) { + auto& tex = data.level->textures[data.textures.size()]; + data.textures.push_back(add_texture(texture_pool, tex, false)); + bytes_this_run += tex.w * tex.h * 4; + tex_this_run++; + if (tex_this_run > 20) { + break; + } + if (bytes_this_run > MAX_TEX_BYTES_PER_FRAME || timer.getMs() > SHARED_TEXTURE_LOAD_BUDGET) { + break; + } + } + } + return data.textures.size() == data.level->textures.size(); +} + +void Loader::update_blocking(TexturePool& tex_pool) { + fmt::print("NOTE: coming out of blackout on next frame, doing all loads now...\n"); + + bool missing_levels = true; + while (missing_levels) { + bool needs_run = true; + + while (needs_run) { + needs_run = false; + { + std::unique_lock lk(m_loader_mutex); + if (!m_level_to_load.empty()) { + m_file_load_done_cv.wait(lk, [&]() { return m_level_to_load.empty(); }); + } + } + } + + needs_run = true; + + while (needs_run) { + needs_run = false; + { + std::unique_lock lk(m_loader_mutex); + if (!m_initializing_tfrag3_levels.empty()) { + needs_run = true; + } + } + + if (needs_run) { + update(tex_pool); + } + } + + { + std::unique_lock lk(m_loader_mutex); + missing_levels = false; + for (auto& des : m_desired_levels) { + if (m_loaded_tfrag3_levels.find(des) == m_loaded_tfrag3_levels.end()) { + fmt::print("blackout loader doing additional level {}...\n", des); + missing_levels = true; + } + } + } + + if (missing_levels) { + set_want_levels(m_desired_levels); + } + } + + fmt::print("Blackout loads done. Current status:"); + std::unique_lock lk(m_loader_mutex); + for (auto& ld : m_loaded_tfrag3_levels) { + fmt::print(" {} is loaded.\n", ld.first); + } +} + +void Loader::update(TexturePool& texture_pool) { + Timer loader_timer; + + // only main thread can touch this. + for (auto& lev : m_loaded_tfrag3_levels) { + lev.second->frames_since_last_used++; + } + + bool did_gpu_stuff = false; + + // work on moving initializing to initialized. + { + // accessing initializing, should lock + std::unique_lock lk(m_loader_mutex); + // grab the first initializing level: + const auto& it = m_initializing_tfrag3_levels.begin(); + if (it != m_initializing_tfrag3_levels.end()) { + did_gpu_stuff = true; + std::string name = it->first; + auto& lev = it->second; + if (it->second->load_id == UINT64_MAX) { + it->second->load_id = m_id++; + } + + // we're the only place that erases, so it's okay to unlock and hold a reference + lk.unlock(); + bool done = true; + LoaderInput loader_input; + loader_input.lev_data = lev.get(); + loader_input.mercs = &m_all_merc_models; + loader_input.tex_pool = &texture_pool; + + for (auto& stage : m_loader_stages) { + Timer stage_timer; + done = stage->run(loader_timer, loader_input); + if (stage_timer.getMs() > 5.f) { + fmt::print("stage {} took {:.2f} ms\n", stage->name(), stage_timer.getMs()); + } + if (!done) { + break; + } + } + + if (done) { + lk.lock(); + m_loaded_tfrag3_levels[name] = std::move(lev); + m_initializing_tfrag3_levels.erase(it); + + for (auto& stage : m_loader_stages) { + stage->reset(); + } + } + } + } + + if (!did_gpu_stuff) { + // try to remove levels. + Timer unload_timer; + if (m_loaded_tfrag3_levels.size() >= 3) { + for (auto& lev : m_loaded_tfrag3_levels) { + if (lev.second->frames_since_last_used > 180) { + std::unique_lock lk(texture_pool.mutex()); + fmt::print("------------------------- PC unloading {}\n", lev.first); + for (size_t i = 0; i < lev.second->level->textures.size(); i++) { + auto& tex = lev.second->level->textures[i]; + if (tex.load_to_pool) { + texture_pool.unload_texture(PcTextureId::from_combo_id(tex.combo_id), + lev.second->textures.at(i)); + } + } + lk.unlock(); + for (auto tex : lev.second->textures) { + if (EXTRA_TEX_DEBUG) { + for (auto& slot : texture_pool.all_textures()) { + if (slot.source) { + ASSERT(slot.gpu_texture != tex); + } else { + ASSERT(slot.gpu_texture != tex); + } + } + } + + glBindTexture(GL_TEXTURE_2D, tex); + glDeleteTextures(1, &tex); + } + + for (auto& tie_geo : lev.second->tie_data) { + for (auto& tie_tree : tie_geo) { + glDeleteBuffers(1, &tie_tree.vertex_buffer); + if (tie_tree.has_wind) { + glDeleteBuffers(1, &tie_tree.wind_indices); + } + } + } + + for (auto& tfrag_geo : lev.second->tfrag_vertex_data) { + for (auto& tfrag_buff : tfrag_geo) { + glDeleteBuffers(1, &tfrag_buff); + } + } + + glDeleteBuffers(1, &lev.second->collide_vertices); + glDeleteBuffers(1, &lev.second->merc_vertices); + glDeleteBuffers(1, &lev.second->merc_indices); + + for (auto& model : lev.second->level->merc_data.models) { + auto& mercs = m_all_merc_models.at(model.name); + MercRef ref{&model, lev.second->load_id}; + auto it = std::find(mercs.begin(), mercs.end(), ref); + ASSERT_MSG(it != mercs.end(), fmt::format("missing merc: {}\n", model.name)); + mercs.erase(it); + } + + m_loaded_tfrag3_levels.erase(lev.first); + break; + } + } + } + + if (unload_timer.getMs() > 5.f) { + fmt::print("Unload took {:.2f}\n", unload_timer.getMs()); + } + } + + if (loader_timer.getMs() > 5) { + fmt::print("Loader::update slow setup: {:.1f}ms\n", loader_timer.getMs()); + } +} + +std::optional Loader::get_merc_model(const char* model_name) { + // don't think we need to lock here... + const auto& it = m_all_merc_models.find(model_name); + if (it != m_all_merc_models.end() && !it->second.empty()) { + // it->second.front().parent_level->frames_since_last_used = 0; + return it->second.front(); + } else { + return std::nullopt; + } +} \ No newline at end of file diff --git a/game/graphics/opengl_renderer/loader/Loader.h b/game/graphics/opengl_renderer/loader/Loader.h new file mode 100644 index 0000000000..dccdb683ee --- /dev/null +++ b/game/graphics/opengl_renderer/loader/Loader.h @@ -0,0 +1,53 @@ +#pragma once + +#include +#include +#include + +#include "common/custom_data/Tfrag3Data.h" +#include "common/util/Timer.h" + +#include "game/graphics/opengl_renderer/loader/common.h" +#include "game/graphics/pipelines/opengl.h" +#include "game/graphics/texture/TexturePool.h" + +class Loader { + public: + static constexpr float TIE_LOAD_BUDGET = 1.5f; + static constexpr float SHARED_TEXTURE_LOAD_BUDGET = 3.f; + Loader(); + ~Loader(); + void update(TexturePool& tex_pool); + void update_blocking(TexturePool& tex_pool); + const LevelData* get_tfrag3_level(const std::string& level_name); + std::optional get_merc_model(const char* model_name); + void load_common(TexturePool& tex_pool, const std::string& name); + void set_want_levels(const std::vector& levels); + std::vector get_in_use_levels(); + + private: + void loader_thread(); + bool upload_textures(Timer& timer, LevelData& data, TexturePool& texture_pool); + + // used by game and loader thread + std::unordered_map> m_initializing_tfrag3_levels; + + LevelData m_common_level; + + std::string m_level_to_load; + + std::thread m_loader_thread; + std::mutex m_loader_mutex; + std::condition_variable m_loader_cv; + std::condition_variable m_file_load_done_cv; + bool m_want_shutdown = false; + uint64_t m_id = 0; + + // used only by game thread + std::unordered_map> m_loaded_tfrag3_levels; + + std::unordered_map> m_all_merc_models; + + std::vector m_desired_levels; + std::vector> m_loader_stages; +}; diff --git a/game/graphics/opengl_renderer/loader/LoaderStages.cpp b/game/graphics/opengl_renderer/loader/LoaderStages.cpp new file mode 100644 index 0000000000..7208b06bb4 --- /dev/null +++ b/game/graphics/opengl_renderer/loader/LoaderStages.cpp @@ -0,0 +1,535 @@ +#include "LoaderStages.h" + +#include "Loader.h" + +constexpr float LOAD_BUDGET = 2.5f; + +/*! + * Upload a texture to the GPU, and give it to the pool. + */ +u64 add_texture(TexturePool& pool, const tfrag3::Texture& tex, bool is_common) { + GLuint gl_tex; + glGenTextures(1, &gl_tex); + glBindTexture(GL_TEXTURE_2D, gl_tex); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.w, tex.h, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, + tex.data.data()); + glBindTexture(GL_TEXTURE_2D, 0); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, gl_tex); + glGenerateMipmap(GL_TEXTURE_2D); + float aniso = 0.0f; + glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY, &aniso); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY, aniso); + if (tex.load_to_pool) { + TextureInput in; + in.debug_page_name = tex.debug_tpage_name; + in.debug_name = tex.debug_name; + in.w = tex.w; + in.h = tex.h; + in.gpu_texture = gl_tex; + in.common = is_common; + in.id = PcTextureId::from_combo_id(tex.combo_id); + in.src_data = (const u8*)tex.data.data(); + pool.give_texture(in); + } + + return gl_tex; +} + +class TextureLoaderStage : public LoaderStage { + public: + TextureLoaderStage() : LoaderStage("texture") {} + bool run(Timer& timer, LoaderInput& data) override { + constexpr int MAX_TEX_BYTES_PER_FRAME = 1024 * 512; + + int bytes_this_run = 0; + int tex_this_run = 0; + if (data.lev_data->textures.size() < data.lev_data->level->textures.size()) { + std::unique_lock tpool_lock(data.tex_pool->mutex()); + while (data.lev_data->textures.size() < data.lev_data->level->textures.size()) { + auto& tex = data.lev_data->level->textures[data.lev_data->textures.size()]; + data.lev_data->textures.push_back(add_texture(*data.tex_pool, tex, false)); + bytes_this_run += tex.w * tex.h * 4; + tex_this_run++; + if (tex_this_run > 20) { + break; + } + if (bytes_this_run > MAX_TEX_BYTES_PER_FRAME || timer.getMs() > LOAD_BUDGET) { + break; + } + } + } + return data.lev_data->textures.size() == data.lev_data->level->textures.size(); + } + void reset() override {} +}; + +class TfragLoadStage : public LoaderStage { + public: + TfragLoadStage() : LoaderStage("tfrag") {} + bool run(Timer& timer, LoaderInput& data) override { + if (m_done) { + return true; + } + + if (data.lev_data->level->tfrag_trees.front().empty()) { + m_done = true; + return true; + } + + if (!m_opengl_created) { + for (int geo = 0; geo < tfrag3::TFRAG_GEOS; geo++) { + auto& in_trees = data.lev_data->level->tfrag_trees[geo]; + for (auto& in_tree : in_trees) { + GLuint& tree_out = data.lev_data->tfrag_vertex_data[geo].emplace_back(); + glGenBuffers(1, &tree_out); + glBindBuffer(GL_ARRAY_BUFFER, tree_out); + + glBufferData(GL_ARRAY_BUFFER, + in_tree.unpacked.vertices.size() * sizeof(tfrag3::PreloadedVertex), nullptr, + GL_STATIC_DRAW); + } + } + m_opengl_created = true; + return false; + } + + constexpr u32 CHUNK_SIZE = 32768; + u32 uploaded_bytes = 0; + u32 unique_buffers = 0; + + while (true) { + bool complete_tree; + + if (data.lev_data->level->tfrag_trees[m_next_geo].empty()) { + complete_tree = true; + } else { + const auto& tree = data.lev_data->level->tfrag_trees[m_next_geo][m_next_tree]; + u32 end_vert_in_tree = tree.unpacked.vertices.size(); + // the number of vertices we'd need to finish the tree right now + size_t num_verts_left_in_tree = end_vert_in_tree - m_next_vert; + size_t start_vert_for_chunk; + size_t end_vert_for_chunk; + + if (num_verts_left_in_tree > CHUNK_SIZE) { + complete_tree = false; + // should only do partial + start_vert_for_chunk = m_next_vert; + end_vert_for_chunk = start_vert_for_chunk + CHUNK_SIZE; + m_next_vert += CHUNK_SIZE; + } else { + // should do all! + start_vert_for_chunk = m_next_vert; + end_vert_for_chunk = end_vert_in_tree; + complete_tree = true; + } + + glBindBuffer(GL_ARRAY_BUFFER, data.lev_data->tfrag_vertex_data[m_next_geo][m_next_tree]); + u32 upload_size = + (end_vert_for_chunk - start_vert_for_chunk) * sizeof(tfrag3::PreloadedVertex); + glBufferSubData(GL_ARRAY_BUFFER, start_vert_for_chunk * sizeof(tfrag3::PreloadedVertex), + upload_size, tree.unpacked.vertices.data() + start_vert_for_chunk); + uploaded_bytes += upload_size; + } + + if (complete_tree) { + unique_buffers++; + // and move on to next tree + m_next_vert = 0; + m_next_tree++; + if (m_next_tree >= data.lev_data->level->tfrag_trees[m_next_geo].size()) { + m_next_tree = 0; + m_next_geo++; + if (m_next_geo >= tfrag3::TFRAG_GEOS) { + m_next_tree = true; + m_next_tree = 0; + m_next_geo = 0; + m_next_vert = 0; + m_done = true; + return true; + } + } + + return false; + } + + if (timer.getMs() > LOAD_BUDGET || (uploaded_bytes / 1024) > 2048) { + return false; + } + } + } + + void reset() override { + m_done = false; + m_opengl_created = false; + m_next_geo = 0; + m_next_tree = 0; + m_next_vert = 0; + } + + private: + bool m_done = false; + bool m_opengl_created = false; + u32 m_next_geo = 0; + u32 m_next_tree = 0; + u32 m_next_vert = 0; +}; + +class ShrubLoadStage : public LoaderStage { + public: + ShrubLoadStage() : LoaderStage("shrub") {} + bool run(Timer& timer, LoaderInput& data) override { + if (m_done) { + return true; + } + + if (data.lev_data->level->shrub_trees.empty()) { + m_done = true; + return true; + } + + if (!m_opengl_created) { + for (auto& in_tree : data.lev_data->level->shrub_trees) { + GLuint& tree_out = data.lev_data->shrub_vertex_data.emplace_back(); + glGenBuffers(1, &tree_out); + glBindBuffer(GL_ARRAY_BUFFER, tree_out); + glBufferData(GL_ARRAY_BUFFER, + in_tree.unpacked.vertices.size() * sizeof(tfrag3::ShrubGpuVertex), nullptr, + GL_STATIC_DRAW); + } + m_opengl_created = true; + return false; + } + + constexpr u32 CHUNK_SIZE = 32768; + u32 uploaded_bytes = 0; + + while (true) { + const auto& tree = data.lev_data->level->shrub_trees[m_next_tree]; + u32 end_vert_in_tree = tree.unpacked.vertices.size(); + // the number of vertices we'd need to finish the tree right now + size_t num_verts_left_in_tree = end_vert_in_tree - m_next_vert; + size_t start_vert_for_chunk; + size_t end_vert_for_chunk; + + bool complete_tree; + + if (num_verts_left_in_tree > CHUNK_SIZE) { + complete_tree = false; + // should only do partial + start_vert_for_chunk = m_next_vert; + end_vert_for_chunk = start_vert_for_chunk + CHUNK_SIZE; + m_next_vert += CHUNK_SIZE; + } else { + // should do all! + start_vert_for_chunk = m_next_vert; + end_vert_for_chunk = end_vert_in_tree; + complete_tree = true; + } + + glBindBuffer(GL_ARRAY_BUFFER, data.lev_data->shrub_vertex_data[m_next_tree]); + u32 upload_size = + (end_vert_for_chunk - start_vert_for_chunk) * sizeof(tfrag3::ShrubGpuVertex); + glBufferSubData(GL_ARRAY_BUFFER, start_vert_for_chunk * sizeof(tfrag3::ShrubGpuVertex), + upload_size, tree.unpacked.vertices.data() + start_vert_for_chunk); + uploaded_bytes += upload_size; + + if (complete_tree) { + // and move on to next tree + m_next_vert = 0; + m_next_tree++; + if (m_next_tree >= data.lev_data->level->shrub_trees.size()) { + m_done = true; + return true; + } + } + + if (timer.getMs() > LOAD_BUDGET || (uploaded_bytes / 128) > 2048) { + return false; + } + } + } + + void reset() override { + m_done = false; + m_opengl_created = false; + m_next_tree = 0; + m_next_vert = 0; + } + + private: + bool m_done = false; + bool m_opengl_created = false; + u32 m_next_tree = 0; + u32 m_next_vert = 0; +}; + +class TieLoadStage : public LoaderStage { + public: + TieLoadStage() : LoaderStage("tie") {} + bool run(Timer& timer, LoaderInput& data) override { + if (m_done) { + return true; + } + + if (data.lev_data->level->tie_trees.front().empty()) { + m_done = true; + return true; + } + + if (!m_opengl_created) { + for (int geo = 0; geo < tfrag3::TIE_GEOS; geo++) { + auto& in_trees = data.lev_data->level->tie_trees[geo]; + for (auto& in_tree : in_trees) { + LevelData::TieOpenGL& tree_out = data.lev_data->tie_data[geo].emplace_back(); + glGenBuffers(1, &tree_out.vertex_buffer); + glBindBuffer(GL_ARRAY_BUFFER, tree_out.vertex_buffer); + glBufferData(GL_ARRAY_BUFFER, + in_tree.unpacked.vertices.size() * sizeof(tfrag3::PreloadedVertex), nullptr, + GL_STATIC_DRAW); + } + } + m_opengl_created = true; + return false; + } + + if (!m_verts_done) { + constexpr u32 CHUNK_SIZE = 32768; + u32 uploaded_bytes = 0; + + while (true) { + const auto& tree = data.lev_data->level->tie_trees[m_next_geo][m_next_tree]; + u32 end_vert_in_tree = tree.unpacked.vertices.size(); + // the number of vertices we'd need to finish the tree right now + size_t num_verts_left_in_tree = end_vert_in_tree - m_next_vert; + size_t start_vert_for_chunk; + size_t end_vert_for_chunk; + + bool complete_tree; + + if (num_verts_left_in_tree > CHUNK_SIZE) { + complete_tree = false; + // should only do partial + start_vert_for_chunk = m_next_vert; + end_vert_for_chunk = start_vert_for_chunk + CHUNK_SIZE; + m_next_vert += CHUNK_SIZE; + } else { + // should do all! + start_vert_for_chunk = m_next_vert; + end_vert_for_chunk = end_vert_in_tree; + complete_tree = true; + } + + glBindBuffer(GL_ARRAY_BUFFER, + data.lev_data->tie_data[m_next_geo][m_next_tree].vertex_buffer); + u32 upload_size = + (end_vert_for_chunk - start_vert_for_chunk) * sizeof(tfrag3::PreloadedVertex); + glBufferSubData(GL_ARRAY_BUFFER, start_vert_for_chunk * sizeof(tfrag3::PreloadedVertex), + upload_size, tree.unpacked.vertices.data() + start_vert_for_chunk); + uploaded_bytes += upload_size; + + if (complete_tree) { + // and move on to next tree + m_next_vert = 0; + m_next_tree++; + if (m_next_tree >= data.lev_data->level->tie_trees[m_next_geo].size()) { + m_next_tree = 0; + m_next_geo++; + if (m_next_geo >= tfrag3::TIE_GEOS) { + m_verts_done = true; + m_next_tree = 0; + m_next_geo = 0; + m_next_vert = 0; + return false; + } + } + } + + if (timer.getMs() > LOAD_BUDGET || (uploaded_bytes / 1024) > 2048) { + return false; + } + } + } + + if (!m_wind_indices_done) { + bool abort = false; + for (; m_next_geo < tfrag3::TIE_GEOS; m_next_geo++) { + auto& geo_trees = data.lev_data->level->tie_trees[m_next_geo]; + for (; m_next_tree < geo_trees.size(); m_next_tree++) { + if (abort) { + return false; + } + auto& in_tree = geo_trees[m_next_tree]; + auto& out_tree = data.lev_data->tie_data[m_next_geo][m_next_tree]; + size_t wind_idx_buffer_len = 0; + for (auto& draw : in_tree.instanced_wind_draws) { + wind_idx_buffer_len += draw.vertex_index_stream.size(); + } + if (wind_idx_buffer_len > 0) { + out_tree.has_wind = true; + glGenBuffers(1, &out_tree.wind_indices); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, out_tree.wind_indices); + std::vector temp; + temp.resize(wind_idx_buffer_len); + u32 off = 0; + for (auto& draw : in_tree.instanced_wind_draws) { + memcpy(temp.data() + off, draw.vertex_index_stream.data(), + draw.vertex_index_stream.size() * sizeof(u32)); + off += draw.vertex_index_stream.size(); + } + + glBufferData(GL_ELEMENT_ARRAY_BUFFER, wind_idx_buffer_len * sizeof(u32), temp.data(), + GL_STATIC_DRAW); + abort = true; + } + } + m_next_tree = 0; + } + + m_indices_done = true; + m_done = true; + return true; + } + + return false; + } + + void reset() override { + m_done = false; + m_opengl_created = false; + m_next_geo = 0; + m_next_tree = 0; + m_next_vert = 0; + m_verts_done = false; + m_indices_done = false; + m_wind_indices_done = false; + } + + private: + bool m_done = false; + bool m_opengl_created = false; + bool m_verts_done = false; + bool m_indices_done = false; + bool m_wind_indices_done = false; + u32 m_next_geo = 0; + u32 m_next_tree = 0; + u32 m_next_vert = 0; +}; + +class CollideLoaderStage : public LoaderStage { + public: + CollideLoaderStage() : LoaderStage("collide") {} + bool run(Timer& /*timer*/, LoaderInput& data) override { + if (m_done) { + return true; + } + if (!m_opengl_created) { + glGenBuffers(1, &data.lev_data->collide_vertices); + glBindBuffer(GL_ARRAY_BUFFER, data.lev_data->collide_vertices); + glBufferData( + GL_ARRAY_BUFFER, + data.lev_data->level->collision.vertices.size() * sizeof(tfrag3::CollisionMesh::Vertex), + nullptr, GL_STATIC_DRAW); + m_opengl_created = true; + return false; + } + + u32 start = m_vtx; + u32 end = std::min((u32)data.lev_data->level->collision.vertices.size(), start + 32768); + glBindBuffer(GL_ARRAY_BUFFER, data.lev_data->collide_vertices); + glBufferSubData(GL_ARRAY_BUFFER, start * sizeof(tfrag3::CollisionMesh::Vertex), + (end - start) * sizeof(tfrag3::CollisionMesh::Vertex), + data.lev_data->level->collision.vertices.data() + start); + m_vtx = end; + + if (m_vtx == data.lev_data->level->collision.vertices.size()) { + m_done = true; + return true; + } else { + return false; + } + } + void reset() override { + m_opengl_created = false; + m_vtx = 0; + m_done = false; + } + + private: + bool m_opengl_created = false; + u32 m_vtx = 0; + bool m_done = false; +}; + +MercLoaderStage::MercLoaderStage() : LoaderStage("merc") {} +void MercLoaderStage::reset() { + m_done = false; + m_opengl = false; + m_vtx_uploaded = false; + m_idx = 0; +} + +bool MercLoaderStage::run(Timer& /*timer*/, LoaderInput& data) { + if (m_done) { + return true; + } + + if (!m_opengl) { + glGenBuffers(1, &data.lev_data->merc_indices); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.lev_data->merc_indices); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, + data.lev_data->level->merc_data.indices.size() * sizeof(u32), nullptr, + GL_STATIC_DRAW); + + glGenBuffers(1, &data.lev_data->merc_vertices); + glBindBuffer(GL_ARRAY_BUFFER, data.lev_data->merc_vertices); + glBufferData(GL_ARRAY_BUFFER, + data.lev_data->level->merc_data.vertices.size() * sizeof(tfrag3::MercVertex), + nullptr, GL_STATIC_DRAW); + m_opengl = true; + } + + if (!m_vtx_uploaded) { + u32 start = m_idx; + m_idx = std::min(start + 32768, (u32)data.lev_data->level->merc_data.indices.size()); + glBindBuffer(GL_ARRAY_BUFFER, data.lev_data->merc_indices); + glBufferSubData(GL_ARRAY_BUFFER, start * sizeof(u32), (m_idx - start) * sizeof(u32), + data.lev_data->level->merc_data.indices.data() + start); + if (m_idx != data.lev_data->level->merc_data.indices.size()) { + return false; + } else { + m_idx = 0; + m_vtx_uploaded = true; + } + } + + u32 start = m_idx; + m_idx = std::min(start + 32768, (u32)data.lev_data->level->merc_data.vertices.size()); + glBindBuffer(GL_ARRAY_BUFFER, data.lev_data->merc_vertices); + glBufferSubData(GL_ARRAY_BUFFER, start * sizeof(tfrag3::MercVertex), + (m_idx - start) * sizeof(tfrag3::MercVertex), + data.lev_data->level->merc_data.vertices.data() + start); + + if (m_idx != data.lev_data->level->merc_data.vertices.size()) { + return false; + } else { + m_done = true; + for (auto& model : data.lev_data->level->merc_data.models) { + data.lev_data->merc_model_lookup[model.name] = &model; + (*data.mercs)[model.name].push_back({&model, data.lev_data->load_id, data.lev_data}); + } + return true; + } + return true; +} + +std::vector> make_loader_stages() { + std::vector> ret; + ret.push_back(std::make_unique()); + ret.push_back(std::make_unique()); + ret.push_back(std::make_unique()); + ret.push_back(std::make_unique()); + ret.push_back(std::make_unique()); + ret.push_back(std::make_unique()); + return ret; +} \ No newline at end of file diff --git a/game/graphics/opengl_renderer/loader/LoaderStages.h b/game/graphics/opengl_renderer/loader/LoaderStages.h new file mode 100644 index 0000000000..a2e1f43e41 --- /dev/null +++ b/game/graphics/opengl_renderer/loader/LoaderStages.h @@ -0,0 +1,19 @@ +#pragma once + +#include "game/graphics/opengl_renderer/loader/common.h" + +std::vector> make_loader_stages(); +u64 add_texture(TexturePool& pool, const tfrag3::Texture& tex, bool is_common); + +class MercLoaderStage : public LoaderStage { + public: + MercLoaderStage(); + bool run(Timer& timer, LoaderInput& data) override; + void reset() override; + + private: + bool m_done = false; + bool m_opengl = false; + bool m_vtx_uploaded = false; + u32 m_idx = 0; +}; \ No newline at end of file diff --git a/game/graphics/opengl_renderer/loader/common.h b/game/graphics/opengl_renderer/loader/common.h new file mode 100644 index 0000000000..4c60809fa0 --- /dev/null +++ b/game/graphics/opengl_renderer/loader/common.h @@ -0,0 +1,58 @@ +#pragma once + +#include "common/common_types.h" +#include "common/custom_data/Tfrag3Data.h" +#include "common/util/Timer.h" + +#include "game/graphics/texture/TexturePool.h" + +#include "third-party/glad/include/glad/glad.h" + +struct LevelData { + std::unique_ptr level; + std::vector textures; + u64 load_id = UINT64_MAX; + + struct TieOpenGL { + GLuint vertex_buffer; + bool has_wind = false; + GLuint wind_indices; + }; + std::array, tfrag3::TIE_GEOS> tie_data; + std::array, tfrag3::TIE_GEOS> tfrag_vertex_data; + std::vector shrub_vertex_data; + GLuint collide_vertices; + + GLuint merc_vertices; + GLuint merc_indices; + std::unordered_map merc_model_lookup; + + int frames_since_last_used = 0; +}; + +struct MercRef { + const tfrag3::MercModel* model = nullptr; + u64 load_id = 0; + const LevelData* level = nullptr; + bool operator==(const MercRef& other) const { + return model == other.model && load_id == other.load_id; + } +}; + +struct LoaderInput { + LevelData* lev_data; + TexturePool* tex_pool; + std::unordered_map>* mercs; +}; + +class LoaderStage { + public: + LoaderStage(const std::string& name) : m_name(name) {} + virtual bool run(Timer& timer, LoaderInput& data) = 0; + virtual void reset() = 0; + virtual ~LoaderStage() = default; + const std::string& name() const { return m_name; } + + protected: + std::string m_name; +}; diff --git a/game/graphics/opengl_renderer/ocean/CommonOceanRenderer.cpp b/game/graphics/opengl_renderer/ocean/CommonOceanRenderer.cpp index 9643d27ce2..2f8ff68fb2 100644 --- a/game/graphics/opengl_renderer/ocean/CommonOceanRenderer.cpp +++ b/game/graphics/opengl_renderer/ocean/CommonOceanRenderer.cpp @@ -275,8 +275,8 @@ void CommonOceanRenderer::flush_near(SharedRenderState* render_state, ScopedProf GL_STREAM_DRAW); render_state->shaders[ShaderId::OCEAN_COMMON].activate(); glUniform4f(glGetUniformLocation(render_state->shaders[ShaderId::OCEAN_COMMON].id(), "fog_color"), - render_state->fog_color[0], render_state->fog_color[1], render_state->fog_color[2], - render_state->fog_intensity); + render_state->fog_color[0] / 255.f, render_state->fog_color[1] / 255.f, + render_state->fog_color[2] / 255.f, render_state->fog_intensity / 255); glDepthMask(GL_FALSE); glEnable(GL_DEPTH_TEST); @@ -450,8 +450,8 @@ void CommonOceanRenderer::flush_mid(SharedRenderState* render_state, ScopedProfi GL_STREAM_DRAW); render_state->shaders[ShaderId::OCEAN_COMMON].activate(); glUniform4f(glGetUniformLocation(render_state->shaders[ShaderId::OCEAN_COMMON].id(), "fog_color"), - render_state->fog_color[0], render_state->fog_color[1], render_state->fog_color[2], - render_state->fog_intensity); + render_state->fog_color[0] / 255.f, render_state->fog_color[1] / 255.f, + render_state->fog_color[2] / 255.f, render_state->fog_intensity / 255); glDepthMask(GL_TRUE); glEnable(GL_DEPTH_TEST); @@ -521,4 +521,4 @@ void CommonOceanRenderer::flush_mid(SharedRenderState* render_state, ScopedProfi prof.add_draw_call(); prof.add_tri(m_next_free_index[bucket]); } -} \ No newline at end of file +} diff --git a/game/graphics/opengl_renderer/ocean/OceanMid.cpp b/game/graphics/opengl_renderer/ocean/OceanMid.cpp index 9be7a481f5..0e192fa22d 100644 --- a/game/graphics/opengl_renderer/ocean/OceanMid.cpp +++ b/game/graphics/opengl_renderer/ocean/OceanMid.cpp @@ -122,12 +122,10 @@ void OceanMid::run(DmaFollower& dma, SharedRenderState* render_state, ScopedProf run_call43_vu2c(); break; default: - fmt::print("unknown call2: {}\n", v0.immediate); - ASSERT(false); + ASSERT_MSG(false, fmt::format("unknown call2: {}", v0.immediate)); } } else { - fmt::print("{} {}\n", data.vifcode0().print(), data.vifcode1().print()); - ASSERT(false); + ASSERT_MSG(false, fmt::format("{} {}", data.vifcode0().print(), data.vifcode1().print())); } } m_common_ocean_renderer.flush_mid(render_state, prof); @@ -139,4 +137,4 @@ void OceanMid::run_call0() { void OceanMid::xgkick(u16 addr) { m_common_ocean_renderer.kick_from_mid((const u8*)&m_vu_data[addr]); -} \ No newline at end of file +} diff --git a/game/graphics/opengl_renderer/ocean/OceanMid.h b/game/graphics/opengl_renderer/ocean/OceanMid.h index 8f9fac96d3..cae1932d28 100644 --- a/game/graphics/opengl_renderer/ocean/OceanMid.h +++ b/game/graphics/opengl_renderer/ocean/OceanMid.h @@ -1,8 +1,8 @@ #pragma once +#include "game/common/vu.h" #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/DirectRenderer.h" -#include "game/common/vu.h" #include "game/graphics/opengl_renderer/ocean/CommonOceanRenderer.h" class OceanMid { diff --git a/game/graphics/opengl_renderer/ocean/OceanMidAndFar.cpp b/game/graphics/opengl_renderer/ocean/OceanMidAndFar.cpp index 4df6660a3f..d3fe99a7a2 100644 --- a/game/graphics/opengl_renderer/ocean/OceanMidAndFar.cpp +++ b/game/graphics/opengl_renderer/ocean/OceanMidAndFar.cpp @@ -1,4 +1,5 @@ #include "OceanMidAndFar.h" + #include "third-party/imgui/imgui.h" OceanMidAndFar::OceanMidAndFar(const std::string& name, BucketId my_id) diff --git a/game/graphics/opengl_renderer/ocean/OceanMidAndFar.h b/game/graphics/opengl_renderer/ocean/OceanMidAndFar.h index 81df49b644..91fedcfb20 100644 --- a/game/graphics/opengl_renderer/ocean/OceanMidAndFar.h +++ b/game/graphics/opengl_renderer/ocean/OceanMidAndFar.h @@ -2,9 +2,9 @@ #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/DirectRenderer.h" -#include "game/graphics/opengl_renderer/opengl_utils.h" -#include "game/graphics/opengl_renderer/ocean/OceanTexture.h" #include "game/graphics/opengl_renderer/ocean/OceanMid.h" +#include "game/graphics/opengl_renderer/ocean/OceanTexture.h" +#include "game/graphics/opengl_renderer/opengl_utils.h" /*! * OceanMidAndFar is the handler for the first ocean bucket. diff --git a/game/graphics/opengl_renderer/ocean/OceanNear.cpp b/game/graphics/opengl_renderer/ocean/OceanNear.cpp index 554f5901ca..66997cb5a5 100644 --- a/game/graphics/opengl_renderer/ocean/OceanNear.cpp +++ b/game/graphics/opengl_renderer/ocean/OceanNear.cpp @@ -1,4 +1,5 @@ #include "OceanNear.h" + #include "third-party/imgui/imgui.h" OceanNear::OceanNear(const std::string& name, BucketId my_id) @@ -102,8 +103,7 @@ void OceanNear::render(DmaFollower& dma, run_call39_vu2c(); break; default: - fmt::print("unknown ocean near call: {}\n", v0.immediate); - ASSERT(false); + ASSERT_MSG(false, fmt::format("unknown ocean near call: {}", v0.immediate)); } } } @@ -117,4 +117,4 @@ void OceanNear::render(DmaFollower& dma, void OceanNear::xgkick(u16 addr) { m_common_ocean_renderer.kick_from_near((const u8*)&m_vu_data[addr]); -} \ No newline at end of file +} diff --git a/game/graphics/opengl_renderer/ocean/OceanNear.h b/game/graphics/opengl_renderer/ocean/OceanNear.h index 81f9516a72..9aeca8975d 100644 --- a/game/graphics/opengl_renderer/ocean/OceanNear.h +++ b/game/graphics/opengl_renderer/ocean/OceanNear.h @@ -1,9 +1,9 @@ #pragma once -#include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/opengl_renderer/ocean/OceanTexture.h" #include "game/common/vu.h" +#include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/ocean/CommonOceanRenderer.h" +#include "game/graphics/opengl_renderer/ocean/OceanTexture.h" class OceanNear : public BucketRenderer { public: diff --git a/game/graphics/opengl_renderer/ocean/OceanTexture.cpp b/game/graphics/opengl_renderer/ocean/OceanTexture.cpp index 13300ae36f..2c5f037cf1 100644 --- a/game/graphics/opengl_renderer/ocean/OceanTexture.cpp +++ b/game/graphics/opengl_renderer/ocean/OceanTexture.cpp @@ -1,5 +1,7 @@ #include "OceanTexture.h" + #include "game/graphics/opengl_renderer/AdgifHandler.h" + #include "third-party/imgui/imgui.h" constexpr int OCEAN_TEX_TBP = 8160; // todo @@ -56,8 +58,9 @@ void OceanTexture::init_textures(TexturePool& pool) { in.gpu_texture = m_result_texture.texture(); in.w = TEX0_SIZE; in.h = TEX0_SIZE; - in.page_name = "PC-OCEAN"; - in.name = fmt::format("pc-ocean-mip-{}", m_generate_mipmaps); + in.debug_page_name = "PC-OCEAN"; + in.debug_name = fmt::format("pc-ocean-mip-{}", m_generate_mipmaps); + in.id = pool.allocate_pc_port_texture(); m_tex0_gpu = pool.give_texture_and_load_to_vram(in, OCEAN_TEX_TBP); } diff --git a/game/graphics/opengl_renderer/ocean/OceanTexture.h b/game/graphics/opengl_renderer/ocean/OceanTexture.h index b4fb7c2ba5..cfa4e13125 100644 --- a/game/graphics/opengl_renderer/ocean/OceanTexture.h +++ b/game/graphics/opengl_renderer/ocean/OceanTexture.h @@ -1,9 +1,9 @@ #pragma once +#include "game/common/vu.h" #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/DirectRenderer.h" #include "game/graphics/opengl_renderer/opengl_utils.h" -#include "game/common/vu.h" class OceanTexture { public: diff --git a/game/graphics/opengl_renderer/opengl_utils.cpp b/game/graphics/opengl_renderer/opengl_utils.cpp index 1977649f1e..c17abcfae6 100644 --- a/game/graphics/opengl_renderer/opengl_utils.cpp +++ b/game/graphics/opengl_renderer/opengl_utils.cpp @@ -1,8 +1,11 @@ #include "opengl_utils.h" -#include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "common/util/Assert.h" -#include + #include +#include + +#include "common/util/Assert.h" + +#include "game/graphics/opengl_renderer/BucketRenderer.h" FramebufferTexturePair::FramebufferTexturePair(int w, int h, u64 texture_format, int num_levels) : m_w(w), m_h(h) { diff --git a/game/graphics/opengl_renderer/opengl_utils.h b/game/graphics/opengl_renderer/opengl_utils.h index a9548206aa..2f0bcd9d5d 100644 --- a/game/graphics/opengl_renderer/opengl_utils.h +++ b/game/graphics/opengl_renderer/opengl_utils.h @@ -1,8 +1,9 @@ #pragma once -#include "game/graphics/pipelines/opengl.h" #include "common/math/Vector.h" +#include "game/graphics/pipelines/opengl.h" + struct SharedRenderState; class ScopedProfilerNode; diff --git a/game/graphics/opengl_renderer/shaders/collision.frag b/game/graphics/opengl_renderer/shaders/collision.frag new file mode 100644 index 0000000000..4d83e7f1da --- /dev/null +++ b/game/graphics/opengl_renderer/shaders/collision.frag @@ -0,0 +1,10 @@ +#version 430 core + +out vec4 color; + +in vec4 fragment_color; + +void main() { + if (fragment_color.a <= 0) discard; + color = fragment_color; +} diff --git a/game/graphics/opengl_renderer/shaders/collision.vert b/game/graphics/opengl_renderer/shaders/collision.vert new file mode 100644 index 0000000000..d774c5e797 --- /dev/null +++ b/game/graphics/opengl_renderer/shaders/collision.vert @@ -0,0 +1,150 @@ +#version 430 core + +layout (location = 0) in vec3 position_in; +layout (location = 1) in uint flags; +layout (location = 2) in vec3 normal_in; +layout (location = 3) in uint pat; + +uniform vec4 hvdf_offset; +uniform mat4 camera; +uniform vec4 camera_position; +uniform float fog_constant; +uniform float fog_min; +uniform float fog_max; +uniform int wireframe; +uniform int mode; + +out vec4 fragment_color; + +const int PAT_MOD_COUNT = 3; +const int PAT_EVT_COUNT = 7; +const int PAT_MAT_COUNT = 23; +uniform uint collision_mode_mask[(PAT_MOD_COUNT + 31) / 32]; +uniform uint collision_event_mask[(PAT_EVT_COUNT + 31) / 32]; +uniform uint collision_material_mask[(PAT_MAT_COUNT + 31) / 32]; +uniform uint collision_skip_mask; + +const int MODE_NONE = 0; +const int MODE_MODE = 1; +const int MODE_EVENT = 2; +const int MODE_MATERIAL = 3; + +uint pat_get_mode(uint p) { return (p >> 3) & 0x7; } +uint pat_get_material(uint p) { return (p >> 6) & 0x3f; } +uint pat_get_event(uint p) { return (p >> 14) & 0x3f; } + +bool logtest(uint a, uint b) { return (a & b) != 0; } +bool logtesta(uint a, uint b) { return (a & b) == b; } + +void main() { + // Step 3, the camera transform + vec4 transformed = -camera[3].xyzw; + transformed += -camera[0] * position_in.x; + transformed += -camera[1] * position_in.y; + transformed += -camera[2] * position_in.z; + + // compute Q + float Q = fog_constant / transformed[3]; + + // perspective divide! + transformed.xyz *= Q; + + // offset + transformed.xyz += hvdf_offset.xyz; + + // correct xy offset + transformed.xy -= (2048.); + + // correct z scale + transformed.z /= (8388608); + transformed.z -= 1; + + // correct xy scale + transformed.x /= (256); + transformed.y /= -(128); + + // hack + transformed.xyz *= transformed.w; + + gl_Position = transformed; + // scissoring area adjust + gl_Position.y *= 512.0/448.0; + + // wireframe check + if (wireframe == 0) { + // lighting check + vec3 to_cam = camera_position.xyz - position_in; + float dist_from_cam = length(to_cam); + vec3 to_cam_n = to_cam / dist_from_cam; + float cam_dot = abs(dot(to_cam_n, normal_in)); + + // base colors + fragment_color = vec4(0.5, 0.6, 0.6, 1); + fragment_color.xyz *= (pow(cam_dot, 3) + 0.3); + + // pat checks + uint pMode = pat_get_mode(pat); + uint pMat = pat_get_material(pat); + uint pEvent = pat_get_event(pat); + if (logtest(collision_mode_mask[pMode/32], 1 << (pMode & 0x1f)) && + logtest(collision_material_mask[pMat/32], 1 << (pMat & 0x1f)) && + logtest(collision_event_mask[pEvent/32], 1 << (pEvent & 0x1f)) && + logtesta(collision_skip_mask, pat)) { + // fancy colors + if (mode == MODE_MODE) { + switch ( pMode ) { + case 0: fragment_color.rgb *= vec3(1.25, 0.1, 0.1); break; // ground + case 1: fragment_color.rgb *= vec3(0.1, 0.1, 1.0); break; // wall + case 2: fragment_color.rgb *= vec3(1.0, 0.1, 1.0); break; // obstacle + default: fragment_color.rgb = vec3(1, 0, 1); break; + } + } else if (mode == MODE_EVENT) { + switch ( pEvent ) { + case 0: fragment_color.rgb *= vec3(1.0); break; // none + case 1: fragment_color.rgb *= vec3(0.2, 1.0, 1.0); break; // deadly + case 2: fragment_color.rgb *= vec3(0.1, 1.0, 0.1); break; // endlessfall + case 3: fragment_color.rgb *= vec3(1.0, 1.0, 0.1); break; // burn + case 4: fragment_color.rgb *= vec3(0.1, 0.1, 1.0); break; // deadlyup + case 5: fragment_color.rgb *= vec3(1.0, 0.1, 0.5); break; // burnup + case 6: fragment_color.rgb *= vec3(1.0, 0.1, 0.1); break; // melt + default: fragment_color.rgb = vec3(1, 0, 1); break; + } + } else if (mode == MODE_MATERIAL) { + switch ( pMat ) { + case 0: fragment_color.rgb *= vec3(1.0, 0.7, 1.0); break; // stone + case 1: fragment_color.rgb *= vec3(0.1, 2.0, 2.0); break; // ice + case 2: fragment_color.rgb *= vec3(0.75, 0.25, 0.1); break; // quicksand + case 3: fragment_color.rgb *= vec3(0.1, 0.25, 0.75); break; // waterbottom + case 4: fragment_color.rgb *= vec3(0.5, 0.15, 0.1); break; // tar + case 5: fragment_color.rgb *= vec3(2.0, 1.5, 0.5); break; // sand + case 6: fragment_color.rgb *= vec3(1.5, 0.75, 0.1); break; // wood + case 7: fragment_color.rgb *= vec3(0.1, 1.35, 0.1); break; // grass + case 8: fragment_color.rgb *= vec3(1.7, 1.3, 0.1); break; // pcmetal + case 9: fragment_color.rgb *= vec3(1.8); break; // snow + case 10: fragment_color.rgb *= vec3(1.5, 0.2, 1.0); break; // deepsnow + case 11: fragment_color.rgb *= vec3(1.2, 0.5, 0.3); break; // hotcoals + case 12: fragment_color.rgb *= vec3(1.4, 0.1, 0.1); break; // lava + case 13: fragment_color.rgb *= vec3(0.8, 0.3, 0.1); break; // crwood + case 14: fragment_color.rgb *= vec3(1.0, 0.4, 1.0); break; // gravel + case 15: fragment_color.rgb *= vec3(1.5, 0.5, 0.15); break; // dirt + case 16: fragment_color.rgb *= vec3(0.7, 0.7, 1.0); break; // metal + case 17: fragment_color.rgb *= vec3(0.1, 0.1, 1.2); break; // straw + case 18: fragment_color.rgb *= vec3(0.75, 1.75, 0.75); break; // tube + case 19: fragment_color.rgb *= vec3(0.4, 0.1, 0.8); break; // swamp + case 20: fragment_color.rgb *= vec3(0.1, 0.4, 0.8); break; // stopproj + case 21: fragment_color.rgb *= vec3(1.9, 0.1, 1.9); break; // rotate + case 22: fragment_color.rgb *= vec3(1.0); break; // neutral + default: fragment_color.rgb = vec3(1, 0, 1); break; + } + } else { + fragment_color = vec4((normal_in + 1)*.5, 1); + fragment_color.xyz *= (pow(cam_dot, 3) + 0.3); + } + } else { + // filtered out. goodbye! + fragment_color.rgba = vec4(0); + } + } else { + fragment_color = vec4(0.12, 0.12, 0.12, 0.5); + } +} diff --git a/game/graphics/opengl_renderer/shaders/direct2.frag b/game/graphics/opengl_renderer/shaders/direct2.frag index 9a241d72f5..4aaca62154 100644 --- a/game/graphics/opengl_renderer/shaders/direct2.frag +++ b/game/graphics/opengl_renderer/shaders/direct2.frag @@ -70,6 +70,6 @@ void main() { discard; } if ((tex_info.y & 4u) != 0) { - color.xyz = mix(color.xyz, fog_color.xyz / 255., clamp(fog_color.w * (1 - fog), 0, 1)); + color.xyz = mix(color.xyz, fog_color.rgb, clamp(fog_color.a * fog, 0, 1)); } } diff --git a/game/graphics/opengl_renderer/shaders/direct2.vert b/game/graphics/opengl_renderer/shaders/direct2.vert index 7895564c61..310ca4ffb9 100644 --- a/game/graphics/opengl_renderer/shaders/direct2.vert +++ b/game/graphics/opengl_renderer/shaders/direct2.vert @@ -22,5 +22,5 @@ void main() { fragment_color = vec4(rgba_in.x, rgba_in.y, rgba_in.z, rgba_in.w * 2.); tex_coord = tex_coord_in; tex_info = byte_info.xy; - fog = float(byte_info.z) / 255.; + fog = 255 - byte_info.z; } diff --git a/game/graphics/opengl_renderer/shaders/direct_basic_textured.frag b/game/graphics/opengl_renderer/shaders/direct_basic_textured.frag index 01dc44c7e8..8e67fa7425 100644 --- a/game/graphics/opengl_renderer/shaders/direct_basic_textured.frag +++ b/game/graphics/opengl_renderer/shaders/direct_basic_textured.frag @@ -73,7 +73,7 @@ void main() { discard; } if (tex_info.w == 1) { - color.xyz = mix(color.xyz, fog_color.xyz / 255., clamp(fog_color.w * (1 - fog), 0, 1)); + color.xyz = mix(color.xyz, fog_color.rgb, clamp(fog_color.a * fog, 0, 1)); } } diff --git a/game/graphics/opengl_renderer/shaders/direct_basic_textured.vert b/game/graphics/opengl_renderer/shaders/direct_basic_textured.vert index e60ccbf733..89ce20f923 100644 --- a/game/graphics/opengl_renderer/shaders/direct_basic_textured.vert +++ b/game/graphics/opengl_renderer/shaders/direct_basic_textured.vert @@ -19,5 +19,5 @@ void main() { fragment_color = vec4(rgba_in.x, rgba_in.y, rgba_in.z, rgba_in.w * 2.); tex_coord = tex_coord_in; tex_info = tex_info_in; - fog = position_in.w / 255.; + fog = 255 - position_in.w; } diff --git a/game/graphics/opengl_renderer/shaders/generic.frag b/game/graphics/opengl_renderer/shaders/generic.frag index 622a789b11..8642942ded 100644 --- a/game/graphics/opengl_renderer/shaders/generic.frag +++ b/game/graphics/opengl_renderer/shaders/generic.frag @@ -73,6 +73,6 @@ void main() { discard; } if ((tex_info.y & 4u) != 0) { - color.xyz = mix(color.xyz, fog_color.xyz / 255., clamp(fog_color.w * (fog), 0, 1)); + color.xyz = mix(color.xyz, fog_color.rgb, clamp(fog_color.a * fog, 0, 1)); } -} \ No newline at end of file +} diff --git a/game/graphics/opengl_renderer/shaders/generic.vert b/game/graphics/opengl_renderer/shaders/generic.vert index b2f5dfa8fd..e364b1f3af 100644 --- a/game/graphics/opengl_renderer/shaders/generic.vert +++ b/game/graphics/opengl_renderer/shaders/generic.vert @@ -46,10 +46,7 @@ void main() { // vu.Q = gen.fog.x() / gen.vtx_p0.w(); float Q = fog_constants.x / transformed.w; - float fog1 = -transformed.w + hvdf_offset.w; - float fog2 = min(fog1, fog_constants.z); - float fog3 = max(fog2, fog_constants.y); - fog = 1 - (fog3/256); + fog = 255 - clamp(-transformed.w + hvdf_offset.w, fog_constants.y, fog_constants.z); // itof12.xyz vf18, vf22 texture int to float // vu.vf18.itof12(Mask::xyz, vu.vf22); @@ -84,6 +81,6 @@ void main() { // scissoring area adjust gl_Position.y *= 512.0/448.0; - fragment_color = vec4(rgba_in.x, rgba_in.y, rgba_in.z, rgba_in.w * 2.); + fragment_color = vec4(rgba_in.rgb, rgba_in.a * 2); tex_info = byte_info.xy; -} \ No newline at end of file +} diff --git a/game/graphics/opengl_renderer/shaders/merc2.frag b/game/graphics/opengl_renderer/shaders/merc2.frag new file mode 100644 index 0000000000..ab461cbba2 --- /dev/null +++ b/game/graphics/opengl_renderer/shaders/merc2.frag @@ -0,0 +1,34 @@ +#version 430 core + +out vec4 color; +in vec3 vtx_color; +in vec2 vtx_st; +in float fog; + + +uniform sampler2D tex_T0; + +uniform vec4 fog_color; +uniform int ignore_alpha; + +uniform int decal_enable; + + +void main() { + vec4 T0 = texture(tex_T0, vtx_st); + + if (decal_enable == 0) { + color.xyz = vtx_color * T0.xyz; + } else { + color.xyz = T0.xyz * 0.5; + } + color.w = T0.w; + color *= 2; + + + if (ignore_alpha == 0 && color.w < 0.128) { + discard; + } + + color.xyz = mix(color.xyz, fog_color.rgb, clamp(fog_color.a * fog, 0, 1)); +} diff --git a/game/graphics/opengl_renderer/shaders/merc2.vert b/game/graphics/opengl_renderer/shaders/merc2.vert new file mode 100644 index 0000000000..b0b2663840 --- /dev/null +++ b/game/graphics/opengl_renderer/shaders/merc2.vert @@ -0,0 +1,120 @@ +#version 430 core + +// merc vertex definition +layout (location = 0) in vec3 position_in; +layout (location = 1) in vec3 normal_in; +layout (location = 2) in vec3 weights_in; +layout (location = 3) in vec2 st_in; +layout (location = 4) in vec3 rgba; +layout (location = 5) in uvec3 mats; + +// light control +uniform vec3 light_dir0; +uniform vec3 light_dir1; +uniform vec3 light_dir2; +uniform vec3 light_col0; +uniform vec3 light_col1; +uniform vec3 light_col2; +uniform vec3 light_ambient; + +// camera control +uniform vec4 hvdf_offset; +uniform vec4 perspective0; +uniform vec4 perspective1; +uniform vec4 perspective2; +uniform vec4 perspective3; +uniform vec4 fog_constants; + +uniform mat4 perspective_matrix; + +const float SCISSOR_ADJUST = 512.0/448.0; + +// output +out vec3 vtx_color; +out vec2 vtx_st; + +out float fog; + +struct MercMatrixData { + mat4 X; + mat3 R; + vec4 pad; +}; + +layout (std140, binding = 1) uniform ub_bones { + MercMatrixData bones[128]; +}; + + +/* +The inputs are in registers 8, 10, 12, 25, and the outputs are 9, 11, 13, 26. The output is written over the input. + +``` +mula.xyzw ACC, vf15, vf08 +maddz.xyzw vf09, vf16, vf08 +mula.xyzw ACC, vf15, vf10 +maddz.xyzw vf11, vf16, vf10 +mula.xyzw ACC, vf15, vf12 +maddz.xyzw vf13, vf16, vf12 +addax.xyzw vf20, vf00 +madda.xyzw ACC, vf27, vf25 +maddz.xyzw vf26, vf28, vf25 +``` +*/ +void main() { + // vec4 transformed = -perspective3.xyzw; + // transformed += -perspective0 * position_in.x; + // transformed += -perspective1 * position_in.y; + // transformed += -perspective2 * position_in.z; + + +// vec4 transformed = -hmat3.xyzw; +// transformed += -hmat0 * position_in.x; +// transformed += -hmat1 * position_in.y; +// transformed += -hmat2 * position_in.z; + + vec4 p = vec4(position_in, 1); + vec4 vtx_pos = -bones[mats[0]].X * p * weights_in[0]; + vec3 rotated_nrm = bones[mats[0]].R * normal_in * weights_in[0]; + + // game may send garbage bones if the weight is 0, don't let NaNs sneak in. + if (weights_in[1] > 0) { + vtx_pos += -bones[mats[1]].X * p * weights_in[1]; + rotated_nrm += bones[mats[1]].R * normal_in * weights_in[1]; + } + if (weights_in[2] > 0) { + vtx_pos += -bones[mats[2]].X * p * weights_in[2]; + rotated_nrm += bones[mats[2]].R * normal_in * weights_in[2]; + } + + vec4 transformed = perspective_matrix * vtx_pos; + + rotated_nrm = normalize(rotated_nrm); + vec3 light_intensity = light_dir0 * rotated_nrm.x + light_dir1 * rotated_nrm.y + light_dir2 * rotated_nrm.z; + light_intensity = max(light_intensity, vec3(0, 0, 0)); + + vec3 light_color = light_ambient + + light_intensity.x * light_col0 + + light_intensity.y * light_col1 + + light_intensity.z * light_col2; + + + + float Q = fog_constants.x / transformed[3]; + fog = 255 - clamp(-transformed.w + hvdf_offset.w, fog_constants.y, fog_constants.z); + + transformed.xyz *= Q; + transformed.xyz += hvdf_offset.xyz; + transformed.xy -= (2048.); + transformed.z /= (8388608); + transformed.z -= 1; + transformed.x /= (256); + transformed.y /= -(128); + transformed.xyz *= transformed.w; + transformed.y *= SCISSOR_ADJUST; + gl_Position = transformed; + + + vtx_color = rgba * light_color; + vtx_st = st_in; +} diff --git a/game/graphics/opengl_renderer/shaders/ocean_common.frag b/game/graphics/opengl_renderer/shaders/ocean_common.frag index e920be3b93..13adb17ce2 100644 --- a/game/graphics/opengl_renderer/shaders/ocean_common.frag +++ b/game/graphics/opengl_renderer/shaders/ocean_common.frag @@ -17,22 +17,14 @@ uniform sampler2D tex_T0; void main() { vec4 T0 = texture(tex_T0, tex_coord.xy / tex_coord.z); if (bucket == 0) { - color.xyz = fragment_color.xyz * T0.xyz; - color.w = fragment_color.w; - color.xyz *= 2; - color.xyz = mix(color.xyz, fog_color.xyz / 255., clamp(fog_color.w * (1 - fog), 0, 1)); - } else if (bucket == 1) { - color = fragment_color * T0; - color.xyzw *= 2; - } else if (bucket == 2) { + color.rgb = fragment_color.rgb * T0.rgb; + color.a = fragment_color.a; + color.rgb = mix(color.rgb, fog_color.rgb, clamp(fog_color.a * fog, 0, 1)); + } else if (bucket == 1 || bucket == 2 || bucket == 4) { color = fragment_color * T0; } else if (bucket == 3) { color = fragment_color * T0; - color.xyzw *= 2; - color.xyz = mix(color.xyz, fog_color.xyz / 255., clamp(fog_color.w * (1 - fog), 0, 1)); - } else if (bucket == 4) { - color = fragment_color * T0; - color.w = 0; + color.rgb = mix(color.rgb, fog_color.rgb, clamp(fog_color.a * fog, 0, 1)); } } diff --git a/game/graphics/opengl_renderer/shaders/ocean_common.vert b/game/graphics/opengl_renderer/shaders/ocean_common.vert index c1779606ea..9e71b5f696 100644 --- a/game/graphics/opengl_renderer/shaders/ocean_common.vert +++ b/game/graphics/opengl_renderer/shaders/ocean_common.vert @@ -9,11 +9,23 @@ out vec4 fragment_color; out vec3 tex_coord; out float fog; +const float SCISSOR_ADJUST = 512.0/448.0; + +uniform int bucket; + void main() { gl_Position = vec4((position_in.x - 0.5) * 16., -(position_in.y - 0.5) * 32, position_in.z * 2 - 1., 1.0); // scissoring area adjust - gl_Position.y *= 512.0/448.0; - fragment_color = vec4(rgba_in.x, rgba_in.y, rgba_in.z, rgba_in.w * 2.); + gl_Position.y *= SCISSOR_ADJUST; + fragment_color = vec4(rgba_in.rgb, rgba_in.a * 2); tex_coord = tex_coord_in; - fog = float(fog_in) / 255.; + fog = 255 - fog_in; + + if (bucket == 0) { + fragment_color.rgb *= 2; + } else if (bucket == 1 || bucket == 3) { + fragment_color *= 2; + } else if (bucket == 4) { + fragment_color.a = 0; + } } diff --git a/game/graphics/opengl_renderer/shaders/ocean_texture.frag b/game/graphics/opengl_renderer/shaders/ocean_texture.frag index a6305cf3f7..f48ea2fd66 100644 --- a/game/graphics/opengl_renderer/shaders/ocean_texture.frag +++ b/game/graphics/opengl_renderer/shaders/ocean_texture.frag @@ -8,6 +8,5 @@ uniform sampler2D tex_T0; void main() { vec4 tex = texture(tex_T0, tex_coord); - tex.xyz *= 2; color = fragment_color * tex; -} \ No newline at end of file +} diff --git a/game/graphics/opengl_renderer/shaders/ocean_texture.vert b/game/graphics/opengl_renderer/shaders/ocean_texture.vert index c1de212665..847912c2b8 100644 --- a/game/graphics/opengl_renderer/shaders/ocean_texture.vert +++ b/game/graphics/opengl_renderer/shaders/ocean_texture.vert @@ -10,6 +10,6 @@ out vec2 tex_coord; void main() { // inputs are 0 - 2048. gl_Position = vec4((position_in.x - 1024) / 1024, (position_in.y - 1024) / 1024, 0.5, 1.0); - fragment_color = vec4(rgba_in.x, rgba_in.y, rgba_in.z, 1); + fragment_color = vec4(rgba_in.rgb * 2, 1); tex_coord = tex_coord_in; } diff --git a/game/graphics/opengl_renderer/shaders/shrub.frag b/game/graphics/opengl_renderer/shaders/shrub.frag index 481940e1c5..aafd4e9e63 100644 --- a/game/graphics/opengl_renderer/shaders/shrub.frag +++ b/game/graphics/opengl_renderer/shaders/shrub.frag @@ -13,16 +13,11 @@ uniform vec4 fog_color; void main() { vec4 T0 = texture(tex_T0, tex_coord.xy / 4096.f); - color = fragment_color * T0 * 2.0; - color.w *= 2; + color = fragment_color * T0; - if (color.a < alpha_min * 2) { + if (color.a < alpha_min || color.a > alpha_max) { discard; } - if (color.a > alpha_max) { - discard; - } - - color.xyz = mix(color.xyz, fog_color.xyz / 255., clamp(fogginess/255 * fog_color.w, 0., 1.)); + color.xyz = mix(color.xyz, fog_color.rgb, clamp(fogginess * fog_color.a, 0, 1)); } diff --git a/game/graphics/opengl_renderer/shaders/shrub.vert b/game/graphics/opengl_renderer/shaders/shrub.vert index 7a7a4b28a6..b84897eda4 100644 --- a/game/graphics/opengl_renderer/shaders/shrub.vert +++ b/game/graphics/opengl_renderer/shaders/shrub.vert @@ -16,6 +16,8 @@ out vec4 fragment_color; out vec3 tex_coord; out float fogginess; +const float SCISSOR_ADJUST = 512.0/448.0; + void main() { @@ -32,47 +34,36 @@ void main() { // gs is 12.4 fixed point, set up with 2048.0 as the center. // the itof0 is done in the preprocessing step. now we have floats. - + // Step 3, the camera transform - vec4 transformed = -camera[3].xyzw; - transformed += -camera[0] * position_in.x; - transformed += -camera[1] * position_in.y; - transformed += -camera[2] * position_in.z; + vec4 transformed = -camera[3]; + transformed -= camera[0] * position_in.x; + transformed -= camera[1] * position_in.y; + transformed -= camera[2] * position_in.z; // compute Q - float Q = fog_constant / transformed[3]; + float Q = fog_constant / transformed.w; - float fog1 = -transformed.w + hvdf_offset.w; - float fog2 = min(fog1, fog_max); - float fog3 = max(fog2, fog_min); - fogginess = 255 - fog3; + // do fog! + fogginess = 255 - clamp(-transformed.w + hvdf_offset.w, fog_min, fog_max); // perspective divide! transformed.xyz *= Q; - // offset transformed.xyz += hvdf_offset.xyz; - - // ftoi4 - //transformed.xyzw *= 16; - // correct xy offset transformed.xy -= (2048.); - // correct z scale transformed.z /= (8388608); transformed.z -= 1; - // correct xy scale transformed.x /= (256); transformed.y /= -(128); - // hack transformed.xyz *= transformed.w; - - gl_Position = transformed; // scissoring area adjust - gl_Position.y *= 512.0/448.0; + transformed.y *= SCISSOR_ADJUST; + gl_Position = transformed; // time of day lookup // start with the vertex color (only rgb, VIF filled in the 255.) @@ -80,7 +71,8 @@ void main() { // get the time of day multiplier vec4 tod_color = texelFetch(tex_T1, time_of_day_index, 0); // combine - fragment_color *= tod_color * 2; + fragment_color *= tod_color * 4; + fragment_color.a *= 2; tex_coord = tex_coord_in; } diff --git a/game/graphics/opengl_renderer/shaders/sprite3_3d.frag b/game/graphics/opengl_renderer/shaders/sprite3_3d.frag index c22fa3a44e..5262d1206b 100644 --- a/game/graphics/opengl_renderer/shaders/sprite3_3d.frag +++ b/game/graphics/opengl_renderer/shaders/sprite3_3d.frag @@ -15,13 +15,9 @@ void main() { if (tex_info.y == 0) { T0.w = 1.0; } - color = fragment_color * T0 * 2.0; + color = fragment_color * T0; - if (color.a < alpha_min) { - discard; - } - - if (color.a > alpha_max) { + if (color.a < alpha_min || color.a > alpha_max) { discard; } } diff --git a/game/graphics/opengl_renderer/shaders/sprite3_3d.vert b/game/graphics/opengl_renderer/shaders/sprite3_3d.vert index c05c400af7..be42f88fd9 100644 --- a/game/graphics/opengl_renderer/shaders/sprite3_3d.vert +++ b/game/graphics/opengl_renderer/shaders/sprite3_3d.vert @@ -16,12 +16,10 @@ uniform float fog_min; uniform float fog_max; uniform float min_scale; uniform float max_scale; -uniform float bonus; uniform float deg_to_rad; uniform float inv_area; uniform vec4 basis_x; uniform vec4 basis_y; -uniform vec4 hmge_scale; uniform vec4 xy_array[8]; uniform vec4 xyz_array[4]; uniform vec4 st_array[4]; @@ -30,6 +28,8 @@ out flat vec4 fragment_color; out vec3 tex_coord; out flat uvec2 tex_info; +const float SCISSOR_ADJUST = 512.0/448.0; + vec4 matrix_transform(mat4 mtx, vec3 pt) { return mtx[3] + mtx[0] * pt.x @@ -114,8 +114,8 @@ void main() { fge = false; } */ - scales_vf01.z = min(max(scales_vf01.z, min_scale), max_scale); - scales_vf01.w = min(max(scales_vf01.w, min_scale), max_scale); + scales_vf01.z = clamp(scales_vf01.z, min_scale, max_scale); + scales_vf01.w = clamp(scales_vf01.w, min_scale, max_scale); quat.z *= deg_to_rad; float sp_sin = sin(quat.z); @@ -131,6 +131,7 @@ void main() { transformed = offset_pos_vf10 + vf12_rotated * xy0_vf19.x + vf13_rotated_trans * xy0_vf19.y; } else if (rendermode == 2) { // hud sprites + transformed_pos_vf02.xyz *= Q; vec4 offset_pos_vf10 = transformed_pos_vf02 + (matrix == 0 ? hud_hvdf_offset : hud_hvdf_user[matrix - 1]); @@ -159,22 +160,19 @@ void main() { // STEP 5: final adjustments // correct xy offset transformed.xy -= (2048.); - // correct z scale transformed.z /= (8388608); transformed.z -= 1; - // correct xy scale transformed.x /= (256); transformed.y /= -(128); - // hack transformed.xyz *= transformed.w; - - gl_Position = transformed; // scissoring area adjust - gl_Position.y *= 512.0/448.0; + transformed.y *= SCISSOR_ADJUST; + gl_Position = transformed; + fragment_color *= 2; fragment_color.w *= 2; tex_info = tex_info_in.xy; diff --git a/game/graphics/opengl_renderer/shaders/tfrag3.frag b/game/graphics/opengl_renderer/shaders/tfrag3.frag index bb51ed66ed..379482da8d 100644 --- a/game/graphics/opengl_renderer/shaders/tfrag3.frag +++ b/game/graphics/opengl_renderer/shaders/tfrag3.frag @@ -14,15 +14,11 @@ uniform vec4 fog_color; void main() { //vec4 T0 = texture(tex_T0, tex_coord); vec4 T0 = texture(tex_T0, tex_coord.xy); - color = fragment_color * T0 * 2.0; + color = fragment_color * T0; - if (color.a < alpha_min) { + if (color.a < alpha_min || color.a > alpha_max) { discard; } - if (color.a > alpha_max) { - discard; - } - - color.xyz = mix(color.xyz, fog_color.xyz / 255., clamp(fogginess/255 * fog_color.w, 0., 1.)); + color.rgb = mix(color.rgb, fog_color.rgb, clamp(fogginess * fog_color.a, 0, 1)); } diff --git a/game/graphics/opengl_renderer/shaders/tfrag3.vert b/game/graphics/opengl_renderer/shaders/tfrag3.vert index c0a70e2df1..e78e96b363 100644 --- a/game/graphics/opengl_renderer/shaders/tfrag3.vert +++ b/game/graphics/opengl_renderer/shaders/tfrag3.vert @@ -15,6 +15,8 @@ out vec4 fragment_color; out vec3 tex_coord; out float fogginess; +const float SCISSOR_ADJUST = 512.0/448.0; + void main() { @@ -33,54 +35,46 @@ void main() { // the itof0 is done in the preprocessing step. now we have floats. // Step 3, the camera transform - vec4 transformed = -camera[3].xyzw; - transformed += -camera[0] * position_in.x; - transformed += -camera[1] * position_in.y; - transformed += -camera[2] * position_in.z; + vec4 transformed = -camera[3]; + transformed -= camera[0] * position_in.x; + transformed -= camera[1] * position_in.y; + transformed -= camera[2] * position_in.z; // compute Q - float Q = fog_constant / transformed[3]; + float Q = fog_constant / transformed.w; - float fog1 = -transformed.w + hvdf_offset.w; - float fog2 = min(fog1, fog_max); - float fog3 = max(fog2, fog_min); - fogginess = 255 - fog3; + // do fog! + fogginess = 255 - clamp(-transformed.w + hvdf_offset.w, fog_min, fog_max); // perspective divide! transformed.xyz *= Q; - // offset transformed.xyz += hvdf_offset.xyz; - - // ftoi4 - //transformed.xyzw *= 16; - // correct xy offset transformed.xy -= (2048.); - // correct z scale transformed.z /= (8388608); transformed.z -= 1; - // correct xy scale transformed.x /= (256); transformed.y /= -(128); - // hack transformed.xyz *= transformed.w; - - gl_Position = transformed; // scissoring area adjust - gl_Position.y *= 512.0/448.0; + transformed.y *= SCISSOR_ADJUST; + gl_Position = transformed; // time of day lookup fragment_color = texelFetch(tex_T1, time_of_day_index, 0); - fragment_color.w *= 2; // fog hack if (fragment_color.r < 0.0075 && fragment_color.g < 0.0075 && fragment_color.b < 0.0075) { fogginess = 0; } + // color adjustment + fragment_color *= 2; + fragment_color.a *= 2; + tex_coord = tex_coord_in; } diff --git a/game/graphics/opengl_renderer/shaders/tfrag3_no_tex.vert b/game/graphics/opengl_renderer/shaders/tfrag3_no_tex.vert index 809877d2bc..8970445db0 100644 --- a/game/graphics/opengl_renderer/shaders/tfrag3_no_tex.vert +++ b/game/graphics/opengl_renderer/shaders/tfrag3_no_tex.vert @@ -9,43 +9,35 @@ uniform float fog_constant; out vec4 fragment_color; +const float SCISSOR_ADJUST = 512.0/448.0; + // this is just for debugging. void main() { - vec4 transformed = -camera[3].xyzw; - transformed += -camera[0] * position_in.x; - transformed += -camera[1] * position_in.y; - transformed += -camera[2] * position_in.z; + vec4 transformed = camera[3]; + transformed += camera[0] * position_in.x; + transformed += camera[1] * position_in.y; + transformed += camera[2] * position_in.z; // compute Q - float Q = fog_constant / transformed[3]; + float Q = fog_constant / transformed.w; // perspective divide! transformed.xyz *= Q; - // offset transformed.xyz += hvdf_offset.xyz; - - // ftoi4 - //transformed.xyzw *= 16; - // correct xy offset transformed.xy -= (2048.); - // correct z scale - transformed.z /= (16777216); - transformed.z *= 2; + transformed.z /= (8388608); transformed.z -= 1; - // correct xy scale transformed.x /= (256); transformed.y /= -(128); - // hack transformed.xyz *= transformed.w; - - gl_Position = transformed; // scissoring area adjust - gl_Position.y *= 512.0/448.0; + transformed.y *= SCISSOR_ADJUST; + gl_Position = transformed; // time of day lookup fragment_color = rgba_in; diff --git a/game/graphics/opengl_renderer/sprite_common.h b/game/graphics/opengl_renderer/sprite_common.h index 936b3a10d0..c26daf0a8f 100644 --- a/game/graphics/opengl_renderer/sprite_common.h +++ b/game/graphics/opengl_renderer/sprite_common.h @@ -1,9 +1,10 @@ #pragma once +#include "common/dma/gs.h" +#include "common/math/Vector.h" + #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/DirectRenderer.h" -#include "common/dma/gs.h" -#include "common/math/Vector.h" using math::Matrix4f; using math::Vector4f; diff --git a/game/graphics/pipelines/opengl.cpp b/game/graphics/pipelines/opengl.cpp index fc39ebaf91..9e350b1507 100644 --- a/game/graphics/pipelines/opengl.cpp +++ b/game/graphics/pipelines/opengl.cpp @@ -1,33 +1,35 @@ /*! * @file opengl.cpp - * Lower-level OpenGL implementation. + * Lower-level OpenGL interface. No actual rendering is performed here! */ +#include "opengl.h" + +#include #include #include -#include + +#include "common/dma/dma_copy.h" +#include "common/global_profiler/GlobalProfiler.h" +#include "common/goal_constants.h" +#include "common/log/log.h" +#include "common/util/FileUtil.h" +#include "common/util/FrameLimiter.h" +#include "common/util/Timer.h" +#include "common/util/compress.h" + +#include "game/graphics/display.h" +#include "game/graphics/gfx.h" +#include "game/graphics/opengl_renderer/OpenGLRenderer.h" +#include "game/graphics/opengl_renderer/debug_gui.h" +#include "game/graphics/texture/TexturePool.h" +#include "game/runtime.h" +#include "game/system/newpad.h" #include "third-party/imgui/imgui.h" #include "third-party/imgui/imgui_impl_glfw.h" #include "third-party/imgui/imgui_impl_opengl3.h" - -#include "opengl.h" - -#include "game/graphics/gfx.h" -#include "game/graphics/display.h" -#include "game/graphics/opengl_renderer/OpenGLRenderer.h" -#include "game/graphics/texture/TexturePool.h" -#include "common/dma/dma_copy.h" -#include "game/system/newpad.h" -#include "common/log/log.h" -#include "common/goal_constants.h" -#include "common/util/image_loading.h" -#include "game/runtime.h" -#include "common/util/Timer.h" -#include "game/graphics/opengl_renderer/debug_gui.h" -#include "common/util/FileUtil.h" -#include "common/util/compress.h" -#include "common/util/FrameLimiter.h" +#include "third-party/stb_image/stb_image.h" namespace { @@ -37,7 +39,6 @@ struct GraphicsData { // vsync std::mutex sync_mutex; std::condition_variable sync_cv; - bool vsync_enabled = true; // dma chain transfer std::mutex dma_mutex; @@ -62,6 +63,8 @@ struct GraphicsData { double last_engine_time = 1. / 60.; float pmode_alp = 0.f; + std::string imgui_log_filename, imgui_filename; + GraphicsData() : dma_copier(EE_MAIN_MEM_SIZE), texture_pool(std::make_shared()), @@ -73,13 +76,20 @@ std::unique_ptr g_gfx_data; void SetDisplayCallbacks(GLFWwindow* d) { glfwSetKeyCallback( - d, [](GLFWwindow* /*window*/, int key, int /*scancode*/, int action, int /*mods*/) { + d, [](GLFWwindow* window, int key, int /*scancode*/, int action, int /*mods*/) { if (action == GlfwKeyAction::Press) { // lg::debug("KEY PRESS: key: {} scancode: {} mods: {:X}", key, scancode, mods); Pad::OnKeyPress(key); } else if (action == GlfwKeyAction::Release) { // lg::debug("KEY RELEASE: key: {} scancode: {} mods: {:X}", key, scancode, mods); Pad::OnKeyRelease(key); + GLDisplay* display = reinterpret_cast(glfwGetWindowUserPointer(window)); + if (display != NULL) { // toggle ImGui when pressing Alt + if ((key == GLFW_KEY_LEFT_ALT || key == GLFW_KEY_RIGHT_ALT) && + glfwGetWindowAttrib(window, GLFW_FOCUSED)) { + display->set_imgui_visible(!display->is_imgui_visible()); + } + } } }); } @@ -126,7 +136,8 @@ static int gl_init(GfxSettings& settings) { glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_FALSE); } glfwWindowHint(GLFW_DOUBLEBUFFER, GLFW_TRUE); - glfwWindowHint(GLFW_SAMPLES, 4); + glfwWindowHint(GLFW_SAMPLES, 1); + glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); return 0; } @@ -138,47 +149,82 @@ static void gl_exit() { gl_inited = false; } -static std::shared_ptr gl_make_main_display(int width, - int height, - const char* title, - GfxSettings& settings) { +static std::shared_ptr gl_make_display(int width, + int height, + const char* title, + GfxSettings& settings, + bool is_main) { GLFWwindow* window = glfwCreateWindow(width, height, title, NULL, NULL); if (!window) { - lg::error("gl_make_main_display failed - Could not create display window"); + lg::error("gl_make_display failed - Could not create display window"); return NULL; } glfwMakeContextCurrent(window); - gladLoadGLLoader((GLADloadproc)glfwGetProcAddress); - if (!gl_inited && !gladLoadGL()) { - lg::error("GL init fail"); - return NULL; + if (!gl_inited) { + gladLoadGLLoader((GLADloadproc)glfwGetProcAddress); + if (!gladLoadGL()) { + lg::error("GL init fail"); + return NULL; + } + g_gfx_data = std::make_unique(); + + gl_inited = true; } - std::string image_path = fmt::format("{}/game/assets/appicon.png", file_util::get_project_path()); + // window icon + std::string image_path = + (file_util::get_jak_project_dir() / "game" / "assets" / "appicon.png").string(); GLFWimage images[1]; images[0].pixels = stbi_load(image_path.c_str(), &images[0].width, &images[0].height, 0, 4); // rgba channels glfwSetWindowIcon(window, 1, images); stbi_image_free(images[0].pixels); - g_gfx_data = std::make_unique(); - gl_inited = true; - // enable vsync by default - // glfwSwapInterval(1); - glfwSwapInterval(settings.vsync); + // init framerate settings + /* + if (GLFWmonitor* primary_monitor = glfwGetPrimaryMonitor()) { + auto primary_monitor_video_mode = glfwGetVideoMode(primary_monitor); + + if (primary_monitor_video_mode && primary_monitor_video_mode->refreshRate > 60) { + // Use the framelimiter by default and disable vsync + Gfx::g_global_settings.framelimiter = true; + Gfx::g_global_settings.vsync = false; + glfwSwapInterval(0); + if (primary_monitor_video_mode->refreshRate > 100) { + BootVideoMode = VideoMode::FPS150; + Gfx::g_global_settings.target_fps = 150; + } else if (primary_monitor_video_mode->refreshRate > 60) { + BootVideoMode = VideoMode::FPS100; + Gfx::g_global_settings.target_fps = 100; + } + } else { + // enable vsync + Gfx::g_global_settings.framelimiter = false; + Gfx::g_global_settings.vsync = true; + // glfwSwapInterval(1); + glfwSwapInterval(settings.vsync); + } + } else { + // enable vsync + Gfx::g_global_settings.framelimiter = false; + Gfx::g_global_settings.vsync = true; + // glfwSwapInterval(1); + glfwSwapInterval(settings.vsync); + } + */ SetDisplayCallbacks(window); Pad::initialize(); if (HasError()) { - lg::error("gl_make_main_display error"); + lg::error("gl_make_display error"); return NULL; } - std::shared_ptr display = std::make_shared(window); + auto display = std::make_shared(window, is_main); // lg::debug("init display #x{:x}", (uintptr_t)display); // setup imgui @@ -189,6 +235,13 @@ static std::shared_ptr gl_make_main_display(int width, // this does initialization for stuff like the font data ImGui::CreateContext(); + // Init ImGui settings + g_gfx_data->imgui_filename = file_util::get_file_path({"imgui.ini"}); + g_gfx_data->imgui_log_filename = file_util::get_file_path({"imgui_log.txt"}); + ImGuiIO& io = ImGui::GetIO(); + io.IniFilename = g_gfx_data->imgui_filename.c_str(); + io.LogFilename = g_gfx_data->imgui_log_filename.c_str(); + // set up to get inputs for this window ImGui_ImplGlfw_InitForOpenGL(window, true); @@ -198,16 +251,28 @@ static std::shared_ptr gl_make_main_display(int width, glfwGetError(NULL); // set up the renderer - ImGui_ImplOpenGL3_Init("#version 130"); + ImGui_ImplOpenGL3_Init("#version 430"); - return display; + return std::static_pointer_cast(display); } -static void gl_kill_display(GfxDisplay* display) { +GLDisplay::GLDisplay(GLFWwindow* window, bool is_main) : m_window(window) { + m_main = is_main; + glfwSetWindowUserPointer(window, reinterpret_cast(this)); +} + +GLDisplay::~GLDisplay() { + ImGuiIO& io = ImGui::GetIO(); + io.IniFilename = nullptr; + io.LogFilename = nullptr; + glfwSetWindowUserPointer(m_window, nullptr); ImGui_ImplOpenGL3_Shutdown(); ImGui_ImplGlfw_Shutdown(); ImGui::DestroyContext(); - glfwDestroyWindow(display->window_glfw); + glfwDestroyWindow(m_window); + if (m_main) { + gl_exit(); + } } namespace { @@ -217,10 +282,16 @@ std::string make_output_file_name(const std::string& file_name) { } } // namespace +static bool endsWith(std::string_view str, std::string_view suffix) { + return str.size() >= suffix.size() && + 0 == str.compare(str.size() - suffix.size(), suffix.size(), suffix); +} + void render_game_frame(int width, int height, int lbox_width, int lbox_height) { // wait for a copied chain. bool got_chain = false; { + auto p = scoped_prof("wait-for-dma"); std::unique_lock lock(g_gfx_data->dma_mutex); // note: there's a timeout here. If the engine is messed up and not sending us frames, // we still want to run the glfw loop. @@ -237,16 +308,23 @@ void render_game_frame(int width, int height, int lbox_width, int lbox_height) { options.lbox_width_px = lbox_width; options.draw_render_debug_window = g_gfx_data->debug_gui.should_draw_render_debug(); options.draw_profiler_window = g_gfx_data->debug_gui.should_draw_profiler(); + options.draw_subtitle_editor_window = g_gfx_data->debug_gui.should_draw_subtitle_editor(); options.save_screenshot = g_gfx_data->debug_gui.get_screenshot_flag(); options.draw_small_profiler_window = g_gfx_data->debug_gui.small_profiler; options.pmode_alp_register = g_gfx_data->pmode_alp; if (options.save_screenshot) { - options.screenshot_path = make_output_file_name(g_gfx_data->debug_gui.screenshot_name()); + // ensure the screenshot has an extension + std::string temp_path = g_gfx_data->debug_gui.screenshot_name(); + if (!endsWith(temp_path, ".png")) { + temp_path += ".png"; + } + options.screenshot_path = make_output_file_name(temp_path); } if constexpr (run_dma_copy) { auto& chain = g_gfx_data->dma_copier.get_last_result(); g_gfx_data->ogl_renderer.render(DmaFollower(chain.data.data(), chain.start_offset), options); } else { + auto p = scoped_prof("ogl-render"); g_gfx_data->ogl_renderer.render(DmaFollower(g_gfx_data->dma_copier.get_last_input_data(), g_gfx_data->dma_copier.get_last_input_offset()), options); @@ -264,83 +342,165 @@ void render_game_frame(int width, int height, int lbox_width, int lbox_height) { } } -static void gl_display_position(GfxDisplay* display, int* x, int* y) { - glfwGetWindowPos(display->window_glfw, x, y); +void GLDisplay::get_position(int* x, int* y) { + glfwGetWindowPos(m_window, x, y); } -static void gl_display_size(GfxDisplay* display, int* width, int* height) { - glfwGetFramebufferSize(display->window_glfw, width, height); +void GLDisplay::get_size(int* width, int* height) { + glfwGetFramebufferSize(m_window, width, height); } -static void gl_display_set_size(GfxDisplay* display, int width, int height) { - glfwSetWindowSize(display->window_glfw, width, height); +void GLDisplay::get_scale(float* xs, float* ys) { + glfwGetWindowContentScale(m_window, xs, ys); } -static void gl_display_scale(GfxDisplay* display, float* xs, float* ys) { - glfwGetWindowContentScale(display->window_glfw, xs, ys); +void GLDisplay::set_size(int width, int height) { + glfwSetWindowSize(m_window, width, height); } -static void gl_set_fullscreen(GfxDisplay* display, int mode, int /*screen*/) { +void GLDisplay::update_fullscreen(GfxDisplayMode mode, int /*screen*/) { GLFWmonitor* monitor = glfwGetPrimaryMonitor(); // todo - auto window = display->window_glfw; switch (mode) { - case 0: { + case GfxDisplayMode::Windowed: { // windowed - glfwSetWindowAttrib(window, GLFW_DECORATED, GLFW_TRUE); - glfwSetWindowFocusCallback(window, NULL); - glfwSetWindowAttrib(window, GLFW_FLOATING, GLFW_FALSE); - glfwSetWindowMonitor(window, NULL, display->xpos_backup(), display->ypos_backup(), - display->width_backup(), display->height_backup(), GLFW_DONT_CARE); + glfwSetWindowAttrib(m_window, GLFW_DECORATED, GLFW_TRUE); + glfwSetWindowFocusCallback(m_window, NULL); + glfwSetWindowAttrib(m_window, GLFW_FLOATING, GLFW_FALSE); + glfwSetWindowMonitor(m_window, NULL, xpos_backup(), ypos_backup(), width_backup(), + height_backup(), GLFW_DONT_CARE); + set_imgui_visible(true); } break; - case 1: { + case GfxDisplayMode::Fullscreen: { // fullscreen - if (display->fullscreen_mode() == 0) { - display->backup_params(); + if (windowed()) { + backup_params(); } const GLFWvidmode* vmode = glfwGetVideoMode(monitor); - glfwSetWindowMonitor(window, monitor, 0, 0, vmode->width, vmode->height, 60); - glfwSetWindowFocusCallback(window, FocusCallback); + glfwSetWindowAttrib(m_window, GLFW_DECORATED, GLFW_TRUE); + glfwSetWindowFocusCallback(m_window, NULL); + glfwSetWindowAttrib(m_window, GLFW_FLOATING, GLFW_FALSE); + glfwSetWindowMonitor(m_window, monitor, 0, 0, vmode->width, vmode->height, 60); + set_imgui_visible(false); } break; - case 2: { + case GfxDisplayMode::Borderless: { // borderless fullscreen - if (display->fullscreen_mode() == 0) { - display->backup_params(); + if (windowed()) { + backup_params(); } int x, y; glfwGetMonitorPos(monitor, &x, &y); const GLFWvidmode* vmode = glfwGetVideoMode(monitor); - glfwSetWindowAttrib(window, GLFW_DECORATED, GLFW_FALSE); - glfwSetWindowAttrib(window, GLFW_FLOATING, GLFW_TRUE); - glfwSetWindowFocusCallback(window, FocusCallback); + glfwSetWindowAttrib(m_window, GLFW_DECORATED, GLFW_FALSE); + // glfwSetWindowAttrib(m_window, GLFW_FLOATING, GLFW_TRUE); + // glfwSetWindowFocusCallback(m_window, FocusCallback); #ifdef _WIN32 - glfwSetWindowMonitor(window, NULL, x, y, vmode->width, vmode->height + 1, GLFW_DONT_CARE); + glfwSetWindowMonitor(m_window, NULL, x, y, vmode->width, vmode->height + 1, GLFW_DONT_CARE); #else - glfwSetWindowMonitor(window, NULL, x, y, vmode->width, vmode->height, GLFW_DONT_CARE); + glfwSetWindowMonitor(m_window, NULL, x, y, vmode->width, vmode->height, GLFW_DONT_CARE); #endif + set_imgui_visible(false); } break; } } -static void gl_render_display(GfxDisplay* display) { - GLFWwindow* window = display->window_glfw; +GfxDisplayMode GLDisplay::get_fullscreen() { + GLFWmonitor* monitor = glfwGetPrimaryMonitor(); // todo + const GLFWvidmode* vmode = glfwGetVideoMode(monitor); + if (width() >= vmode->width && height() >= vmode->height) { + return glfwGetWindowAttrib(m_window, GLFW_DECORATED) == GLFW_TRUE ? GfxDisplayMode::Fullscreen + : GfxDisplayMode::Borderless; + } else { + return GfxDisplayMode::Windowed; + } +} +int GLDisplay::get_screen_vmode_count() { + int count = 0; + auto vmodes = glfwGetVideoModes(glfwGetPrimaryMonitor(), &count); + return count; +} + +void GLDisplay::get_screen_size(int vmode_idx, s32* w_out, s32* h_out) { + auto vmode = glfwGetVideoMode(glfwGetPrimaryMonitor()); + int count = 0; + auto vmodes = glfwGetVideoModes(glfwGetPrimaryMonitor(), &count); + if (vmode_idx >= 0) { + vmode = &vmodes[vmode_idx]; + } else if (get_fullscreen() == GfxDisplayMode::Fullscreen) { + for (int i = 0; i < count; ++i) { + if (!vmode || vmode->height < vmodes[i].height) { + vmode = &vmodes[i]; + } + } + } + if (w_out) { + *w_out = vmode->width; + } + if (h_out) { + *h_out = vmode->height; + } +} + +int GLDisplay::get_screen_rate(int vmode_idx) { + auto vmode = glfwGetVideoMode(glfwGetPrimaryMonitor()); + int count = 0; + auto vmodes = glfwGetVideoModes(glfwGetPrimaryMonitor(), &count); + if (vmode_idx >= 0) { + vmode = &vmodes[vmode_idx]; + } else if (get_fullscreen() == GfxDisplayMode::Fullscreen) { + for (int i = 0; i < count; ++i) { + if (!vmode || vmode->refreshRate < vmodes[i].refreshRate) { + vmode = &vmodes[i]; + } + } + } + return vmode->refreshRate; +} + +bool GLDisplay::minimized() { + return glfwGetWindowAttrib(m_window, GLFW_ICONIFIED); +} + +void GLDisplay::set_lock(bool lock) { + glfwSetWindowAttrib(m_window, GLFW_RESIZABLE, lock ? GLFW_TRUE : GLFW_FALSE); +} + +void update_global_profiler() { + if (g_gfx_data->debug_gui.dump_events) { + prof().set_enable(false); + g_gfx_data->debug_gui.dump_events = false; + prof().dump_to_json((file_util::get_jak_project_dir() / "prof.json").string()); + } + prof().set_enable(g_gfx_data->debug_gui.record_events); +} + +/*! + * Main function called to render graphics frames. This is called in a loop. + */ +void GLDisplay::render() { // poll events - glfwPollEvents(); - glfwMakeContextCurrent(window); - Pad::update_gamepads(); + { + auto p = scoped_prof("poll-gamepads"); + glfwPollEvents(); + glfwMakeContextCurrent(m_window); + Pad::update_gamepads(); + } // imgui start of frame - ImGui_ImplOpenGL3_NewFrame(); - ImGui_ImplGlfw_NewFrame(); - ImGui::NewFrame(); + { + auto p = scoped_prof("imgui-init"); + ImGui_ImplOpenGL3_NewFrame(); + ImGui_ImplGlfw_NewFrame(); + ImGui::NewFrame(); + } // window size int width = Gfx::g_global_settings.lbox_w; int height = Gfx::g_global_settings.lbox_h; int fbuf_w, fbuf_h; - glfwGetFramebufferSize(window, &fbuf_w, &fbuf_h); + glfwGetFramebufferSize(m_window, &fbuf_w, &fbuf_h); #ifdef _WIN32 - if (display->fullscreen_mode() == 2) { + if (last_fullscreen_mode() == GfxDisplayMode::Borderless) { // pretend the framebuffer is 1 pixel shorter on borderless. fullscreen issues! fbuf_h--; } @@ -350,7 +510,7 @@ static void gl_render_display(GfxDisplay* display) { // vertical letterbox size int lbox_h = (fbuf_h - height) / 2; #ifdef _WIN32 - if (display->fullscreen_mode() == 2) { + if (last_fullscreen_mode() == GfxDisplayMode::Borderless) { // add one pixel of vertical letterbox on borderless to make up for extra line lbox_h++; } @@ -358,38 +518,52 @@ static void gl_render_display(GfxDisplay* display) { // render game! if (g_gfx_data->debug_gui.should_advance_frame()) { + auto p = scoped_prof("game-render"); render_game_frame(width, height, lbox_w, lbox_h); } if (g_gfx_data->debug_gui.should_gl_finish()) { + auto p = scoped_prof("gl-finish"); glFinish(); } - // render imgui - g_gfx_data->debug_gui.draw(g_gfx_data->dma_copier.get_last_result().stats); - ImGui::Render(); - ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); + // render debug + if (is_imgui_visible()) { + auto p = scoped_prof("debug-gui"); + g_gfx_data->debug_gui.draw(g_gfx_data->dma_copier.get_last_result().stats); + } + { + auto p = scoped_prof("imgui-render"); + ImGui::Render(); + ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); + } // switch vsync modes, if requested - 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); + if (Gfx::g_global_settings.vsync != Gfx::g_global_settings.old_vsync) { + Gfx::g_global_settings.old_vsync = Gfx::g_global_settings.vsync; + glfwSwapInterval(Gfx::g_global_settings.vsync); } // actual vsync g_gfx_data->debug_gui.finish_frame(); - glfwSwapBuffers(window); - if (g_gfx_data->debug_gui.framelimiter) { + { + auto p = scoped_prof("swap-buffers"); + glfwSwapBuffers(m_window); + } + if (Gfx::g_global_settings.framelimiter) { + auto p = scoped_prof("frame-limiter"); g_gfx_data->frame_limiter.run( - g_gfx_data->debug_gui.target_fps, g_gfx_data->debug_gui.experimental_accurate_lag, - g_gfx_data->debug_gui.sleep_in_frame_limiter, g_gfx_data->last_engine_time); + Gfx::g_global_settings.target_fps, Gfx::g_global_settings.experimental_accurate_lag, + Gfx::g_global_settings.sleep_in_frame_limiter, g_gfx_data->last_engine_time); } g_gfx_data->debug_gui.start_frame(); + prof().instant_event("ROOT"); + update_global_profiler(); - if (display->fullscreen_pending()) { - display->fullscreen_flush(); + if (!minimized() && fullscreen_pending()) { + fullscreen_flush(); } + update_last_fullscreen_mode(); // toggle even odd and wake up engine waiting on vsync. { @@ -398,10 +572,16 @@ static void gl_render_display(GfxDisplay* display) { g_gfx_data->sync_cv.notify_all(); } + // reboot whole game, if requested + if (g_gfx_data->debug_gui.want_reboot_in_debug) { + g_gfx_data->debug_gui.want_reboot_in_debug = false; + MasterExit = RuntimeExitStatus::RESTART_IN_DEBUG; + } + // exit if display window was closed - if (glfwWindowShouldClose(window)) { + if (glfwWindowShouldClose(m_window)) { std::unique_lock lock(g_gfx_data->sync_mutex); - MasterExit = 2; + MasterExit = RuntimeExitStatus::EXIT; g_gfx_data->sync_cv.notify_all(); } } @@ -416,7 +596,9 @@ u32 gl_vsync() { } std::unique_lock lock(g_gfx_data->sync_mutex); auto init_frame = g_gfx_data->frame_idx_of_input_data; - g_gfx_data->sync_cv.wait(lock, [=] { return MasterExit || g_gfx_data->frame_idx > init_frame; }); + g_gfx_data->sync_cv.wait(lock, [=] { + return (MasterExit != RuntimeExitStatus::RUNNING) || g_gfx_data->frame_idx > init_frame; + }); return g_gfx_data->frame_idx & 1; } @@ -493,16 +675,9 @@ void gl_set_pmode_alp(float val) { g_gfx_data->pmode_alp = val; } -const GfxRendererModule moduleOpenGL = { +const GfxRendererModule gRendererOpenGL = { gl_init, // init - gl_make_main_display, // make_main_display - gl_kill_display, // kill_display - gl_render_display, // render_display - gl_display_position, // display_position - gl_display_size, // display_size - gl_display_set_size, // display_set_size - gl_display_scale, // display_scale - gl_set_fullscreen, // set_fullscreen + gl_make_display, // make_display gl_exit, // exit gl_vsync, // vsync gl_sync_path, // sync_path diff --git a/game/graphics/pipelines/opengl.h b/game/graphics/pipelines/opengl.h index 404aca575e..0f13215c67 100644 --- a/game/graphics/pipelines/opengl.h +++ b/game/graphics/pipelines/opengl.h @@ -6,15 +6,38 @@ */ #define GLFW_INCLUDE_NONE +#include "game/graphics/display.h" +#include "game/graphics/gfx.h" + #include "third-party/glad/include/glad/glad.h" #include "third-party/glfw/include/GLFW/glfw3.h" -#include "game/graphics/gfx.h" - enum GlfwKeyAction { Release = GLFW_RELEASE, // falling edge of key press Press = GLFW_PRESS, // rising edge of key press Repeat = GLFW_REPEAT // repeated input on hold e.g. when typing something }; -extern const GfxRendererModule moduleOpenGL; +class GLDisplay : public GfxDisplay { + GLFWwindow* m_window; + + public: + GLDisplay(GLFWwindow* window, bool is_main); + virtual ~GLDisplay(); + + void* get_window() const { return m_window; } + void get_position(int* x, int* y); + void get_size(int* w, int* h); + void get_scale(float* x, float* y); + void get_screen_size(int vmode_idx, s32* w, s32* h); + int get_screen_rate(int vmode_idx); + int get_screen_vmode_count(); + GfxDisplayMode get_fullscreen(); + void set_size(int w, int h); + void update_fullscreen(GfxDisplayMode mode, int screen); + void render(); + bool minimized(); + void set_lock(bool lock); +}; + +extern const GfxRendererModule gRendererOpenGL; diff --git a/game/graphics/sceGraphicsInterface.cpp b/game/graphics/sceGraphicsInterface.cpp index d291f90b1e..641b76d233 100644 --- a/game/graphics/sceGraphicsInterface.cpp +++ b/game/graphics/sceGraphicsInterface.cpp @@ -1,8 +1,12 @@ #include "game/graphics/sceGraphicsInterface.h" -#include "game/graphics/gfx.h" + #include + #include "common/util/Assert.h" +#include "game/graphics/gfx.h" +#include "game/overlord/srpc.h" + /*! * Wait for rendering to complete. * In the PC Port, this currently does nothing. @@ -28,5 +32,6 @@ u32 sceGsSyncPath(u32 mode, u32 timeout) { */ u32 sceGsSyncV(u32 mode) { ASSERT(mode == 0); + VBlank_Handler(); return Gfx::vsync(); } diff --git a/game/graphics/texture/TextureConverter.cpp b/game/graphics/texture/TextureConverter.cpp index 00db9ca831..cdc424a40a 100644 --- a/game/graphics/texture/TextureConverter.cpp +++ b/game/graphics/texture/TextureConverter.cpp @@ -1,8 +1,10 @@ #include "TextureConverter.h" -#include "third-party/fmt/core.h" -#include "common/util/FileUtil.h" + #include "common/texture/texture_conversion.h" #include "common/util/Assert.h" +#include "common/util/FileUtil.h" + +#include "third-party/fmt/core.h" TextureConverter::TextureConverter() { m_vram.resize(4 * 1024 * 1024); diff --git a/game/graphics/texture/TexturePool.cpp b/game/graphics/texture/TexturePool.cpp index bdb9684826..42e1c07ddd 100644 --- a/game/graphics/texture/TexturePool.cpp +++ b/game/graphics/texture/TexturePool.cpp @@ -1,14 +1,17 @@ -#include -#include - #include "TexturePool.h" +#include +#include + +#include "common/log/log.h" +#include "common/util/Assert.h" +#include "common/util/Timer.h" + +#include "game/graphics/pipelines/opengl.h" +#include "game/graphics/texture/jak1_tpage_dir.h" + #include "third-party/fmt/core.h" #include "third-party/imgui/imgui.h" -#include "common/util/Timer.h" -#include "common/log/log.h" -#include "game/graphics/pipelines/opengl.h" -#include "common/util/Assert.h" namespace { const char empty_string[] = ""; @@ -49,41 +52,33 @@ u64 upload_to_gpu(const u8* data, u16 w, u16 h) { } GpuTexture* TexturePool::give_texture(const TextureInput& in) { - const auto& it = m_loaded_textures.find(in.name); - if (it == m_loaded_textures.end()) { + // const auto& it = m_loaded_textures.find(in.name); + const auto existing = m_loaded_textures.lookup_or_insert(in.id); + if (!existing.second) { // nothing references this texture yet. - GpuTexture gtex; - gtex.page_name = in.page_name; - gtex.name = in.name; - gtex.w = in.w; - gtex.h = in.h; - gtex.is_common = in.common; - gtex.gpu_textures = {{in.gpu_texture, in.src_data}}; - gtex.combo_id = in.combo_id; - gtex.is_placeholder = false; - - return &m_loaded_textures.insert({in.name, gtex}).first->second; + existing.first->tex_id = in.id; + existing.first->w = in.w; + existing.first->h = in.h; + existing.first->is_common = in.common; + existing.first->gpu_textures = {{in.gpu_texture, in.src_data}}; + existing.first->is_placeholder = false; + *m_id_to_name.lookup_or_insert(in.id).first = + fmt::format("{}/{}", in.debug_page_name, in.debug_name); + return existing.first; } else { - if (!it->second.is_placeholder) { - fmt::print( - "[tex2] loader providing {}, but we already have an entry for it {} common? {} mine " - "{}x{} 0x{:x} new {}x{} 0x{:x}.\n", - in.name, it->second.name, it->second.is_common, in.w, in.h, in.combo_id, it->second.w, - it->second.h, it->second.combo_id); - ASSERT(!it->second.gpu_textures.empty()); + if (!existing.first->is_placeholder) { + // two sources for texture. this is fine. + ASSERT(!existing.first->gpu_textures.empty()); } else { - ASSERT(it->second.gpu_textures.empty()); + ASSERT(existing.first->gpu_textures.empty()); } - it->second.is_placeholder = false; - it->second.page_name = in.page_name; - it->second.name = in.name; - it->second.w = in.w; - it->second.h = in.h; - it->second.gpu_textures.push_back({in.gpu_texture, in.src_data}); - it->second.is_common = in.common; - it->second.combo_id = in.combo_id; - refresh_links(it->second); - return &it->second; + existing.first->is_placeholder = false; + existing.first->w = in.w; + existing.first->h = in.h; + existing.first->gpu_textures.push_back({in.gpu_texture, in.src_data}); + existing.first->is_common = in.common; + refresh_links(*existing.first); + return existing.first; } } @@ -133,25 +128,27 @@ void TexturePool::refresh_links(GpuTexture& texture) { } } -void TexturePool::unload_texture(const std::string& name, u64 id) { - auto& tex = m_loaded_textures.at(name); - if (tex.is_common) { +void TexturePool::unload_texture(PcTextureId tex_id, u64 gpu_id) { + auto* tex = m_loaded_textures.lookup_existing(tex_id); + ASSERT(tex); + if (tex->is_common) { ASSERT(false); return; } - if (tex.is_placeholder) { - fmt::print("trying to unload something that was already placholdered: {} {}\n", name, - tex.gpu_textures.size()); + if (tex->is_placeholder) { + fmt::print("trying to unload something that was already placholdered: {} {}\n", + get_debug_texture_name(tex_id), tex->gpu_textures.size()); } - ASSERT(!tex.is_placeholder); - auto it = std::find_if(tex.gpu_textures.begin(), tex.gpu_textures.end(), - [&](const auto& a) { return a.gl == id; }); - ASSERT(it != tex.gpu_textures.end()); - tex.gpu_textures.erase(it); - if (tex.gpu_textures.empty()) { - tex.is_placeholder = true; + ASSERT(!tex->is_placeholder); + auto it = std::find_if(tex->gpu_textures.begin(), tex->gpu_textures.end(), + [&](const auto& a) { return a.gl == gpu_id; }); + ASSERT(it != tex->gpu_textures.end()); + + tex->gpu_textures.erase(it); + if (tex->gpu_textures.empty()) { + tex->is_placeholder = true; } - refresh_links(tex); + refresh_links(*tex); } void GpuTexture::remove_slot(u32 slot) { @@ -208,19 +205,26 @@ void TexturePool::handle_upload_now(const u8* tpage, int mode, const u8* memory_ // each texture may have multiple mip levels. for (int mip_idx = 0; mip_idx < tex.num_mips; mip_idx++) { if (has_segment[tex.segment_of_mip(mip_idx)]) { - auto name = std::string(goal_string(texture_page.name_ptr, memory_base)) + - goal_string(tex.name_ptr, memory_base); + PcTextureId current_id(texture_page.id, tex_idx); + if (!m_id_to_name.lookup_existing(current_id)) { + auto name = std::string(goal_string(texture_page.name_ptr, memory_base)) + + goal_string(tex.name_ptr, memory_base); + *m_id_to_name.lookup_or_insert(current_id).first = name; + m_name_to_id[name] = current_id; + } + auto& slot = m_textures[tex.dest[mip_idx]]; + if (slot.source) { - if (slot.source->name == name) { + if (slot.source->tex_id == current_id) { // we already have it, no need to do anything } else { slot.source->remove_slot(tex.dest[mip_idx]); - slot.source = get_gpu_texture_for_slot(name, tex.dest[mip_idx]); + slot.source = get_gpu_texture_for_slot(current_id, tex.dest[mip_idx]); ASSERT(slot.gpu_texture != (u64)-1); } } else { - slot.source = get_gpu_texture_for_slot(name, tex.dest[mip_idx]); + slot.source = get_gpu_texture_for_slot(current_id, tex.dest[mip_idx]); ASSERT(slot.gpu_texture != (u64)-1); } } @@ -246,18 +250,19 @@ void TexturePool::relocate(u32 destination, u32 source, u32 format) { } } -GpuTexture* TexturePool::get_gpu_texture_for_slot(const std::string& name, u32 slot) { - auto it = m_loaded_textures.find(name); - if (it == m_loaded_textures.end()) { - GpuTexture placeholder; - placeholder.name = name; +GpuTexture* TexturePool::get_gpu_texture_for_slot(PcTextureId id, u32 slot) { + auto it = m_loaded_textures.lookup_or_insert(id); + if (!it.second) { + GpuTexture& placeholder = *it.first; + placeholder.tex_id = id; placeholder.is_placeholder = true; placeholder.slots.push_back(slot); - auto r = m_loaded_textures.insert({name, placeholder}); + + // auto r = m_loaded_textures.insert({name, placeholder}); m_textures[slot].gpu_texture = m_placeholder_texture_id; - return &r.first->second; + return it.first; } else { - auto result = &it->second; + auto result = it.first; result->add_slot(slot); m_textures[slot].gpu_texture = result->is_placeholder ? m_placeholder_texture_id : result->gpu_textures.at(0).gl; @@ -276,7 +281,8 @@ std::optional TexturePool::lookup_mt4hh(u32 location) { return {}; } -TexturePool::TexturePool() { +TexturePool::TexturePool() + : m_loaded_textures(get_jak1_tpage_dir()), m_id_to_name(get_jak1_tpage_dir()) { m_placeholder_data.resize(16 * 16); u32 c0 = 0xa0303030; u32 c1 = 0xa0e0e0e0; @@ -301,14 +307,17 @@ void TexturePool::draw_debug_window() { auto& record = m_textures[i]; total_textures++; if (record.source) { - if (std::regex_search(record.source->name, regex)) { + if (std::regex_search(get_debug_texture_name(record.source->tex_id), regex)) { ImGui::PushID(id++); - draw_debug_for_tex(record.source->name, record.source, i); + draw_debug_for_tex(get_debug_texture_name(record.source->tex_id), record.source, i); ImGui::PopID(); total_displayed_textures++; } - total_vram_bytes += - record.source->w * record.source->h * 4; // todo, if we support other formats + if (!record.source->gpu_textures.empty()) { + total_vram_bytes += + record.source->w * record.source->h * 4; // todo, if we support other formats + } + total_uploaded_textures++; } } @@ -328,7 +337,7 @@ void TexturePool::draw_debug_for_tex(const std::string& name, GpuTexture* tex, u ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.8, 0.8, 0.3, 1.0)); } if (ImGui::TreeNode(fmt::format("{} {}", name, slot).c_str())) { - ImGui::Text("P: %s sz: %d x %d", tex->page_name.c_str(), tex->w, tex->h); + ImGui::Text("P: %s sz: %d x %d", get_debug_texture_name(tex->tex_id).c_str(), tex->w, tex->h); if (!tex->is_placeholder) { ImGui::Image((void*)tex->gpu_textures.at(0).gl, ImVec2(tex->w, tex->h)); } else { @@ -339,4 +348,18 @@ void TexturePool::draw_debug_for_tex(const std::string& name, GpuTexture* tex, u ImGui::Separator(); } ImGui::PopStyleColor(); +} + +PcTextureId TexturePool::allocate_pc_port_texture() { + ASSERT(m_next_pc_texture_to_allocate < EXTRA_PC_PORT_TEXTURE_COUNT); + return PcTextureId(get_jak1_tpage_dir().size() - 1, m_next_pc_texture_to_allocate++); +} + +std::string TexturePool::get_debug_texture_name(PcTextureId id) { + auto it = m_id_to_name.lookup_existing(id); + if (it) { + return *it; + } else { + return "???"; + } } \ No newline at end of file diff --git a/game/graphics/texture/TexturePool.h b/game/graphics/texture/TexturePool.h index c5b5899c3d..5b62aceefa 100644 --- a/game/graphics/texture/TexturePool.h +++ b/game/graphics/texture/TexturePool.h @@ -2,13 +2,16 @@ #include #include -#include #include #include +#include #include + #include "common/common_types.h" -#include "game/graphics/texture/TextureConverter.h" #include "common/util/Serializer.h" +#include "common/util/SmallVector.h" + +#include "game/graphics/texture/TextureConverter.h" // verify all texture lookups. // will make texture lookups slower and likely caused dropped frames when loading @@ -67,6 +70,71 @@ constexpr int SKY_TEXTURE_VRAM_ADDRS[2] = {8064, 8096}; * The game will inform us when it uploads to VRAM */ +struct PcTextureId { + u16 page = -1; + u16 tex = -1; + + PcTextureId(u16 p, u16 t) : page(p), tex(t) {} + PcTextureId() = default; + + static PcTextureId from_combo_id(u32 val) { return PcTextureId(val >> 16, val & 0xffff); } + + bool operator==(const PcTextureId& other) const { return page == other.page && tex == other.tex; } +}; + +template +class TextureMap { + public: + TextureMap(const std::vector& tpage_dir) { + u32 off = 0; + for (auto& x : tpage_dir) { + m_dir.push_back(off); + off += x; + } + m_data.resize(off); + } + + T* lookup_existing(PcTextureId id) { + auto& elt = m_data[m_dir[id.page] + id.tex]; + if (elt.present) { + return &elt.val; + } else { + return nullptr; + } + } + + T& at(PcTextureId id) { + auto& elt = m_data[m_dir[id.page] + id.tex]; + if (elt.present) { + return elt.val; + } + ASSERT(false); + } + + std::pair lookup_or_insert(PcTextureId id) { + auto& elt = m_data[m_dir[id.page] + id.tex]; + if (elt.present) { + return std::make_pair(&elt.val, true); + } else { + elt.present = true; + return std::make_pair(&elt.val, false); + } + } + + void erase(PcTextureId id) { + auto& elt = m_data[m_dir[id.page] + id.tex]; + elt.present = false; + } + + private: + std::vector m_dir; + struct Element { + T val; + bool present = false; + }; + std::vector m_data; +}; + /*! * The lowest level reference to texture data. */ @@ -80,8 +148,9 @@ struct TextureData { * It's possible for there to be 0 instances of the texture loaded yet. */ struct GpuTexture { - std::string page_name; - std::string name; + GpuTexture(PcTextureId id) : tex_id(id) {} + GpuTexture() = default; + PcTextureId tex_id; // all the currently loaded copies of this texture std::vector gpu_textures; @@ -92,9 +161,6 @@ struct GpuTexture { // the vram address that contain this texture, stored in mt4hh format std::vector mt4hh_slots; - // our "combo id", containing the tpage and texture ID - u32 combo_id = -1; - // texture dimensions u16 w, h; @@ -137,11 +203,13 @@ struct TextureVRAMReference { * A texture provided by the loader. */ struct TextureInput { - std::string page_name; - std::string name; + std::string debug_page_name; + std::string debug_name; + + PcTextureId id; + u64 gpu_texture = -1; bool common = false; - u32 combo_id = -1; const u8* src_data; u16 w, h; }; @@ -236,7 +304,7 @@ class TexturePool { void handle_upload_now(const u8* tpage, int mode, const u8* memory_base, u32 s7_ptr); GpuTexture* give_texture(const TextureInput& in); GpuTexture* give_texture_and_load_to_vram(const TextureInput& in, u32 vram_slot); - void unload_texture(const std::string& name, u64 id); + void unload_texture(PcTextureId tex_id, u64 gpu_id); /*! * Look up an OpenGL texture by vram address. Return std::nullopt if the game hasn't loaded @@ -284,10 +352,13 @@ class TexturePool { void move_existing_to_vram(GpuTexture* tex, u32 slot_addr); std::mutex& mutex() { return m_mutex; } + PcTextureId allocate_pc_port_texture(); + + std::string get_debug_texture_name(PcTextureId id); private: void refresh_links(GpuTexture& texture); - GpuTexture* get_gpu_texture_for_slot(const std::string& name, u32 slot); + GpuTexture* get_gpu_texture_for_slot(PcTextureId id, u32 slot); char m_regex_input[256] = ""; std::array m_textures; @@ -300,7 +371,14 @@ class TexturePool { std::vector m_placeholder_data; u64 m_placeholder_texture_id = 0; - std::unordered_map m_loaded_textures; + TextureMap m_loaded_textures; + + // we maintain a mapping of all textures/ids we've seen so far. + // this is only used for debug. + TextureMap m_id_to_name; + std::unordered_map m_name_to_id; + + u32 m_next_pc_texture_to_allocate = 0; std::mutex m_mutex; }; \ No newline at end of file diff --git a/game/graphics/texture/jak1_tpage_dir.cpp b/game/graphics/texture/jak1_tpage_dir.cpp new file mode 100644 index 0000000000..31ecb88597 --- /dev/null +++ b/game/graphics/texture/jak1_tpage_dir.cpp @@ -0,0 +1,104 @@ +#include "jak1_tpage_dir.h" + +#include + +#include "common/common_types.h" +namespace { + +std::vector tpage_dir = { + 0x0, 0x2, 0x37, 0x1, 0x1, 0x10, 0x2, 0x4, 0x3, 0x2, 0x1, 0x5, 0x7, 0x8, 0x1, 0x1, 0x1, 0xb, 0xe, + 0x8, 0x1, 0x6, 0x4, 0x6, 0x3, 0x3, 0x6, 0x6, 0x4, 0x4, 0x4, 0xd, 0x1, 0x4, 0x9, 0xc, 0x1, 0x1, + 0x6, 0x3, 0x2, 0x14, 0x1, 0x1, 0x2, 0x2, 0x34, 0x34, 0x4, 0x15, 0x1, 0x1, 0x1, 0x8, 0x6, 0xb, + 0xb, 0x7, 0x17, 0x1, 0x7, 0x20, 0xd, 0xa, 0x1, 0x1, 0xb, 0x11, 0x2, 0x9, 0xb, 0xa, 0xe, 0x1, + 0x6, 0x6, 0x1, 0x2, 0x2, 0x33, 0x33, 0xd, 0x2, 0x9, 0x4, 0x68, 0x1, 0x9, 0x1, 0x2, 0x1, 0x5, + 0x9, 0x7, 0x14, 0xa, 0x1, 0x1, 0x1, 0x2, 0x10, 0x4, 0x2, 0x17, 0x2, 0x1, 0x13, 0x6, 0x1, 0x1, + 0x1, 0x2, 0x1, 0x16, 0x1, 0x5, 0x1, 0xe, 0x3, 0x2, 0x1, 0x9, 0x15, 0x3, 0x1, 0x2, 0x40, 0x6, + 0xb, 0x9, 0x2, 0x8, 0xf, 0x2, 0x2, 0x7, 0x11, 0x5, 0x7, 0x13, 0x9, 0x1, 0x1, 0x1, 0x8, 0x1, 0x1, + 0x1, 0x1, 0x1, 0x2, 0x2, 0x9, 0x2, 0xb, 0x5, 0x1, 0xa, 0x15, 0x2e, 0x4, 0x22, 0xb, 0x2e, 0x1e, + 0x6, 0x4, 0x6, 0x3, 0x3, 0x6, 0x6, 0x2, 0x19, 0x5, 0x5, 0x8, 0x37, 0x15, 0x2, 0x1, 0x1, 0x4, + 0x4, 0x8, 0x9, 0x9, 0x9, 0x9, 0x8, 0x6, 0x1e, 0x7, 0x1, 0x5, 0x9, 0x72, 0xc, 0x5, 0x16, 0x5, + 0x4, 0x1, 0x6, 0x3, 0x3, 0x3, 0x3, 0x1, 0x1, 0x1c, 0xa3, 0x47, 0x1b, 0xc9, 0xa, 0x1, 0x16, 0x1, + 0x4, 0x4, 0x4, 0x4, 0x4, 0xd, 0x4, 0xc, 0x2d, 0x4, 0x1, 0x1, 0xf, 0x2, 0x2, 0x10, 0x3, 0x3, 0x1, + 0x1, 0x1, 0x1, 0x1, 0x4, 0x4, 0x9, 0x9, 0x5, 0x6, 0xa, 0x4, 0x1, 0x5, 0x4, 0x9, 0x2, 0x1, 0x4, + 0x2, 0x2, 0x3, 0x12, 0xa, 0x8, 0x4, 0x5, 0x1, 0x1, 0x6, 0x6, 0x7, 0xf, 0x1d, 0x4, 0x4, 0x93, + 0x1, 0x2, 0x15, 0x1, 0xc, 0x1, 0xb, 0x1, 0x5, 0x1e, 0x1, 0x3c, 0x10, 0x5, 0x4, 0x5, 0x3, 0xb, + 0x4, 0x8, 0x4, 0x4, 0x9, 0x6, 0x3, 0x1d, 0x2e, 0x1, 0x3, 0x15, 0xb, 0x1, 0x1, 0x1, 0x2, 0x1, + 0x1, 0x1, 0x1, 0x9, 0x8, 0x1a, 0x5, 0xe, 0x1, 0x1e, 0xc, 0x57, 0x71, 0x1, 0x4, 0x8, 0x5, 0x15, + 0x7, 0xa, 0x1f, 0xc, 0x6, 0x12, 0x1, 0x2, 0x9, 0x4c, 0xa, 0xc9, 0x1, 0x8, 0x8, 0x1b, 0x8, 0x1d, + 0x15, 0x1, 0x19, 0x97, 0x6c, 0xd, 0x3, 0x4, 0x4, 0x2, 0x2, 0x3d, 0xa, 0x36, 0x4, 0x8, 0x21, + 0x15, 0x1, 0x1, 0x2, 0x6, 0x2, 0xb, 0x6, 0xb, 0xc, 0x5, 0x4, 0x15, 0x14, 0x1, 0x21, 0x5, 0x6, + 0xb, 0x1, 0x1b, 0x57, 0x1e, 0x2, 0xc, 0x16, 0x9, 0x5, 0x9, 0x1, 0x1, 0x2f, 0x1a, 0x9, 0x80, + 0x19, 0x97, 0xd, 0x26, 0x8, 0xb, 0x8, 0x1, 0x6, 0x4, 0x1, 0x2, 0x1c, 0x9, 0x13, 0xe, 0x8, 0x1, + 0x1, 0x8, 0x4, 0x6, 0x1, 0xd, 0x6, 0x1c, 0x8, 0x1, 0x1d, 0x1, 0x3, 0x4, 0x2, 0x2, 0x1, 0x1, + 0x12, 0x3d, 0x13, 0x5, 0x1, 0x25, 0x1, 0x1, 0xb, 0xa, 0x1, 0xe, 0x1, 0xb, 0xa, 0xb, 0x1, 0x38, + 0x5, 0x8, 0x1, 0x2, 0x51, 0xc, 0x2, 0x1, 0x5, 0x2, 0x7a, 0x5, 0x5, 0x1, 0x1, 0x2, 0x1, 0x1, 0x7, + 0xe, 0xd, 0x2, 0x4, 0x1, 0x1, 0xc, 0x5, 0x3, 0x1, 0x2, 0x24, 0x15, 0x24, 0x8, 0x11, 0x1, 0x1, + 0x1, 0x5, 0x1, 0x1, 0x8, 0x2, 0x2, 0x1, 0x1, 0xb, 0xa, 0xa, 0x5, 0x1, 0x1d, 0x4, 0x6, 0x2, 0x4, + 0x9, 0x15, 0x4, 0x4, 0x1, 0x6, 0x2, 0x5c, 0x70, 0x9, 0x1, 0xc, 0x74, 0x5, 0x2, 0x7, 0x2, 0x4, + 0x2, 0x5, 0x19, 0x1, 0x71, 0x4, 0x8, 0x6, 0x2, 0x2, 0x2, 0x11, 0x11, 0x2, 0x6, 0x5, 0xa, 0x2, + 0x1, 0x2, 0x4, 0xf, 0x3b, 0x2, 0x5, 0x5, 0x4, 0x5, 0x4, 0xf, 0xd, 0x2, 0x2, 0x2, 0x7, 0x3f, 0xc, + 0x9, 0x3a, 0xa, 0x15, 0x14, 0x4, 0x4, 0x1, 0xa, 0x9, 0x8, 0x1, 0x7, 0x5b, 0x9, 0x13, 0x1c, 0x18, + 0x5, 0x5, 0x6, 0x18, 0x4, 0x8, 0x14, 0x3a, 0x13, 0x1, 0x43, 0x4, 0x3, 0x17, 0x1, 0x16, 0x15, + 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x8a, 0x1, 0x4, 0x1, 0x1, 0x8, 0x1, 0x1, 0x1, 0x1, 0x9, 0x6, 0x6, + 0x1, 0x13, 0xa, 0x10, 0x5, 0x3, 0x6, 0x6, 0x3, 0x3, 0x4, 0xf, 0x13, 0xb, 0x3, 0x1, 0x1, 0x3, + 0x3, 0x3, 0x14, 0x13, 0x6, 0x15, 0xa, 0x1, 0x5, 0x4, 0x1, 0x2, 0x5, 0x2, 0xd, 0x9, 0xf, 0x5d, + 0x9, 0x47, 0xd, 0x6, 0x5, 0x5d, 0xa, 0x47, 0x15, 0x42, 0x9, 0x6, 0x3, 0x5, 0x2, 0xe, 0xd, 0x11, + 0x4, 0x5, 0x2, 0x1, 0x15, 0x1, 0x1, 0x4, 0x2, 0x13, 0xf, 0x11, 0x11, 0x2, 0xa, 0x9, 0x5, 0x5, + 0x7, 0x5, 0x4, 0x3, 0x4, 0x13, 0x5, 0xb, 0x1, 0x12, 0x12, 0x4, 0x13, 0x1, 0x1, 0x1, 0x1, 0xc, + 0x11, 0x9, 0x5b, 0xa, 0x13, 0xd, 0xa, 0x8, 0x1, 0x1, 0x2, 0x9, 0x6, 0x1, 0x1, 0x1, 0x2, 0x1, + 0x1, 0xa, 0x9, 0x2, 0xf, 0x1, 0x8, 0x3, 0x9, 0x3, 0x1, 0x9, 0x6, 0x6, 0x5, 0x2, 0x5, 0x2, 0x5, + 0x3, 0x1, 0x57, 0x3, 0x1, 0x1, 0x7, 0x3, 0x1, 0x9, 0x7, 0x3, 0x3, 0x3, 0xb1, 0x2, 0x1, 0x12, + 0x2b, 0x3, 0x1, 0x3, 0x2, 0x4, 0x1, 0x2, 0x5, 0x6, 0xd, 0x1, 0x1, 0x1, 0x2, 0x2, 0x6, 0x5, 0x2, + 0x2, 0x2, 0x10, 0x1, 0x1, 0x24, 0x1, 0x1, 0x1, 0x1, 0x6, 0x4, 0x7, 0x21, 0x2, 0x9, 0xa, 0xa, + 0x16, 0xb, 0x34, 0x5, 0x3, 0x10, 0x1, 0x1, 0x2e, 0x13, 0x2, 0x13, 0x1, 0x1, 0x1, 0x25, 0x13, + 0x4, 0x47, 0x8, 0x7, 0x4, 0x35, 0x1, 0xb, 0x19, 0x2, 0x2, 0x8, 0x8, 0x7, 0x10, 0xd, 0x6, 0x6, + 0xa, 0x3, 0x6a, 0x13, 0x18, 0x12, 0x3, 0x57, 0x1d, 0x1, 0xb, 0x5, 0x4, 0x7, 0x1, 0x1, 0x2, 0x2, + 0x2, 0x7, 0x15, 0x2f, 0x1, 0x2, 0xb, 0x4, 0x4, 0x3, 0x5, 0xb, 0xa, 0x9, 0x1, 0x4, 0x5, 0x3, 0x3, + 0x3, 0xb, 0x1b, 0x32, 0x9, 0x4, 0x4, 0x1, 0x1, 0x15, 0x1d, 0x13, 0x12, 0x6, 0xe, 0x4, 0x2, 0x7, + 0x2, 0xc, 0x6, 0x2, 0x5, 0x3, 0x3, 0x9, 0x7, 0xe, 0x9, 0x2, 0x1, 0x3, 0x5, 0x3, 0x3, 0x4, 0x4, + 0x3, 0x6, 0x5, 0x5, 0x19, 0x6, 0x3, 0x1, 0x11, 0x12, 0x84, 0x1c, 0x19, 0xa3, 0x2e, 0xe, 0x13, + 0x47, 0x1, 0x1, 0xc, 0x2, 0x1, 0x5, 0x4, 0x5, 0x4, 0x8, 0x7, 0x7, 0x5, 0x5, 0x3, 0xa, 0x5, 0x3, + 0x5, 0x4, 0x1, 0x6, 0x4, 0x4, 0x1, 0xe, 0x7, 0x2, 0x15, 0x2, 0x2, 0x14, 0x1, 0xc, 0xa, 0x5d, + 0x4, 0x3, 0x2, 0xa, 0x5d, 0x19, 0x1, 0x2, 0x1, 0x1, 0xa, 0x14, 0x1, 0x12, 0x2, 0x2, 0x2, 0x2, + 0x2, 0x2, 0x17, 0x1, 0x1, 0x13, 0x2, 0x2, 0x1, 0x3, 0x1a, 0x5, 0x15, 0x1, 0x5, 0x1, 0x1a, 0x2, + 0x1, 0xc, 0x6, 0x1, 0x1, 0x1, 0x1, 0x7, 0x7, 0x7, 0xc, 0xd, 0xd, 0x10, 0x1b, 0x1, 0x1, 0x1, 0x1, + 0x1, 0x1, 0x5, 0x2, 0x4d, 0x2b, 0x8, 0x1, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x9, 0xe, 0xb, 0xa, 0x1, + 0xb, 0x1, 0xb, 0xa, 0x1, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x9, 0x1, 0x1, 0x15, 0x11, 0x1, 0x8, + 0x1, 0x5, 0x1, 0x1, 0x5, 0x4, 0x4, 0x5, 0xb, 0x6, 0x7, 0x2, 0x1, 0x1, 0x2, 0x1, 0x19, 0x19, 0x2, + 0x2, 0x2, 0x6, 0x8, 0x3, 0x3, 0x4, 0x8, 0x8, 0x3, 0x1, 0x1a, 0xe, 0x3, 0x1, 0xf, 0x1, 0x9, 0x4, + 0xc, 0x5, 0x5, 0x6, 0x1, 0x3b, 0x16, 0x8, 0x7, 0x2, 0x5, 0x32, 0xd, 0x2, 0x55, 0xe, 0x3, 0x14, + 0x3, 0x9, 0x9, 0x3, 0x2, 0x12, 0x12, 0x8, 0x14, 0x13, 0x12, 0x12, 0x9, 0xa, 0x39, 0xf, 0x7, 0x6, + 0x2, 0x1, 0x5, 0x9, 0x9, 0x9, 0x1, 0x9, 0xe, 0x18, 0x1, 0x3, 0x9, 0x3, 0x9, 0x1, 0x4, 0x2, 0x4, + 0x4, 0x2, 0x9, 0x9, 0x9, 0x3, 0x1, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x3, 0x16, 0x5, 0x2, + 0x2, 0x3, 0x1, 0x9, 0x3, 0x3f, 0x28, 0x9, 0x26, 0x9, 0xa, 0x65, 0x39, 0xc, 0x15, 0x9, 0x1, 0x2, + 0x7, 0xb, 0xc, 0xb, 0xb, 0x2e, 0x4, 0x1e, 0x15, 0x1, 0x2, 0x1, 0x1, 0x2, 0x3, 0x2, 0x2, 0xb, + 0x9, 0x1, 0x4, 0x4, 0x65, 0x16, 0x8f, 0x1, 0x10, 0xf, 0xf, 0x7, 0x9, 0x41, 0x9, 0xb, 0xb, 0xe, + 0x12, 0x20, 0x2, 0x2, 0x2, 0x2, 0x2, 0x9, 0x15, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, + 0x1, 0x1, 0x1, 0xa, 0xd, 0xd, 0x9, 0x1, 0x1, 0xd, 0x68, 0x17, 0x94, 0x1, 0xf, 0x1, 0x1, 0x1, + 0xd, 0x79, 0x17, 0x94, 0xd, 0xf, 0x10, 0x16, 0xf, 0x13, 0xd, 0xc, 0x10, 0xb, 0x8, 0x4, 0x2, 0x2, + 0x1, 0xb, 0x4, 0x9, 0x61, 0x1, 0x2, 0x7, 0xb, 0xb, 0xf, 0xa, 0x1d, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, + 0x2, 0x2, 0x10, 0x4, 0x5, 0x1, 0x9, 0x9, 0x1, 0x9, 0x3, 0x3f, 0x13, 0x9, 0x41, 0xa, 0x20, 0x9, + 0x3f, 0xc, 0x3a, 0x9, 0xa, 0x63, 0x39, 0x1, 0xb, 0xb, 0x1, 0xa, 0x6, 0x1, 0x4, 0x4, 0x4, 0x18, + 0xa, 0x39, 0x10, 0x19, 0x7, 0x8, 0x9, 0x53, 0x6, 0x2b, 0x1, 0x2, 0x1, 0x2, 0x5, 0x3, 0x1, 0x1, + 0x2, 0xd, 0x9, 0x2, 0x1, 0x17, 0x3, 0x1, 0xc, 0xf, 0x10, 0x16, 0x1, 0xd, 0x9, 0x4, 0x7, 0xd, + 0xb, 0xd, 0xc, 0xc, 0x1a, 0x2, 0xc, 0x15, 0x2, 0x2, 0xd, 0x1, 0x1, 0xa, 0x8, 0x8, 0xa, 0xa, 0xa, + 0x8, 0x7, 0xd, 0x9, 0x2, 0x3, 0xf, 0xb, 0xf, 0xf, 0x1, 0xd, 0xa, 0x14, 0x11, 0x16, 0x12, 0x1, + 0x7, 0x1, 0x2, 0x2, 0x1, 0x9, 0x9, 0x2, 0x2, 0x3, 0x9, 0x61, 0x5, 0xb1, 0x12, 0x2a, 0x4a, 0x6, + 0x2, 0x6, 0x13, 0x13, 0x1, 0x2f, 0xb, 0x12, 0x9, 0x3e, 0x4, 0x28, 0x2, 0x1, 0x4, 0x5, 0x3, 0x3, + 0x4, 0x1, 0xf, 0x19, 0x10, 0x1, 0x1, 0x1, 0x1, 0x1, 0x9, 0x17, 0x27, 0x3, 0x9, 0x7, 0x3, 0x27, + 0x2, 0x1, 0x5, 0x6, 0xe, 0x8, 0x8, 0x1, 0x8, 0x9, 0x3, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1a, 0x1, + 0x10, 0x3, 0x9, 0x1, 0x9, 0x9, 0x9, 0x9, 0x3, 0x3, 0x3, 0x19, 0x9, 0x3a, 0x3, 0x1, 0x5, 0x11, + 0xa, 0xa, 0x1, 0x11, 0x1, 0x1, 0x1, 0x4, 0x4, 0x4, 0x6, 0x9, 0x9, 0x2, 0x3, 0xa, 0xf, 0x8, 0x6, + 0x7, 0xb, 0x9, 0xa, 0x5, 0xa, 0x5, 0x9, 0x6, 0x9, 0x4, 0x1, 0x3, 0x3, 0x4, 0x4, 0x3, 0x3, 0xa, + 0x11, 0x9, 0xe, 0x11, 0xe, 0x8, 0x7, 0x8, 0x7, 0x8, 0x4, 0x5, 0x6, 0x5, 0xa, 0x5, 0xe, 0xd, 0x5, + 0xe, 0xd, 0x5, 0x5, 0x5, 0x6, 0x5, 0x6, 0xf, 0x8, 0x8, 0x7, 0x6, 0x8, 0x3, 0x1, 0x5, 0x1, 0x1, + 0x4, 0x4, 0x1, 0x1, 0x9, 0x2, 0xd, 0x7, 0xc, 0xc, 0xa, 0x6, 0x4, 0x1, 0x1, 0x3, 0x2, 0x9, 0x4, + 0x2, 0x2, 0x4, 0x4, 0x1, 0x4, 0x2, 0x21, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x2, + 0x3, + // Pc port texture page: + EXTRA_PC_PORT_TEXTURE_COUNT}; +} + +const std::vector get_jak1_tpage_dir() { + return tpage_dir; +} \ No newline at end of file diff --git a/game/graphics/texture/jak1_tpage_dir.h b/game/graphics/texture/jak1_tpage_dir.h new file mode 100644 index 0000000000..d77702fe24 --- /dev/null +++ b/game/graphics/texture/jak1_tpage_dir.h @@ -0,0 +1,8 @@ +#pragma once + +#include + +#include "common/common_types.h" + +const std::vector get_jak1_tpage_dir(); +constexpr u32 EXTRA_PC_PORT_TEXTURE_COUNT = 50; \ No newline at end of file diff --git a/game/kernel/Ptr.h b/game/kernel/common/Ptr.h similarity index 99% rename from game/kernel/Ptr.h rename to game/kernel/common/Ptr.h index 2e99ae000e..79f4fb8ec9 100644 --- a/game/kernel/Ptr.h +++ b/game/kernel/common/Ptr.h @@ -5,10 +5,11 @@ * Representation of a GOAL pointer which can be converted to/from a C pointer. */ -#include "game/runtime.h" #include "common/common_types.h" #include "common/util/Assert.h" +#include "game/runtime.h" + /*! * GOAL pointer to a T. Represented as a 32-bit unsigned offset from g_ee_main_mem. * A NULL pointer has an offset of 0. diff --git a/game/kernel/common/Symbol4.h b/game/kernel/common/Symbol4.h new file mode 100644 index 0000000000..c423f5bab1 --- /dev/null +++ b/game/kernel/common/Symbol4.h @@ -0,0 +1,17 @@ +#pragma once + +#include "common/common_types.h" +#include "common/util/Assert.h" + +#include "game/kernel/common/Ptr.h" + +template +struct Symbol4 { + u8 foo; + T& value() { return *reinterpret_cast(&foo - 1); } + const T& value() const { return *reinterpret_cast(&foo - 1); } + const char* name_cstr() const { + ASSERT_MSG(false, "nyi"); + return nullptr; + } +}; diff --git a/game/kernel/common/fileio.cpp b/game/kernel/common/fileio.cpp new file mode 100644 index 0000000000..753313b393 --- /dev/null +++ b/game/kernel/common/fileio.cpp @@ -0,0 +1,346 @@ +#include "fileio.h" + +#include + +#include "common/common_types.h" +#include "common/util/Assert.h" + +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/kmalloc.h" +#include "game/kernel/common/kprint.h" +#include "game/sce/sif_ee.h" + +using namespace ee; + +// buffer for file paths. This might be static char buffer[512]. Maybe 633 is the line number? +char buffer_633[512]; + +void fileio_init_globals() { + memset(buffer_633, 0, 512); +} + +/*! + * Return pointer to null terminator of string. + * const is for losers. + * DONE, EXACT + */ +char* strend(char* str) { + while (*str) + str++; + return str; +} + +/*! + * An implementation of Huffman decoding. + * In this limited decoder, your data must have lower two bits equal to zero. + * @param loc_ptr pointer to pointer to data to read (will be modified to point to next word) + * @return decoded word + * UNUSED, EXACT + */ +u32 ReadHufWord(u8** loc_ptr) { + u8* loc = *loc_ptr; // pointer to data to read + u32 value = *(u32*)loc; // read word + u8* next_loc = loc + 1; // next data to read + u32 length = value & 3; // length of word is stored in lower two bits. + switch (length) { + case 0: // already all set. + break; + + case 1: + value = (value & 0xfc) | (loc[1] << 8); + next_loc = loc + 2; + break; + + case 2: + value = (value & 0xfc) | (loc[1] << 8) | (loc[2] << 0x10); + next_loc = loc + 3; + break; + + case 3: + value = (value & 0xfc) | (loc[1] << 8) | (loc[2] << 0x10) | (loc[3] << 0x18); + next_loc = loc + 4; + break; + + default: + ASSERT(false); + } + + // update location pointer + *loc_ptr = next_loc; + return value; +} + +/*! + * Copy a string from src to dst. The null terminator is copied too. + * This is identical to normal strcpy. + * DONE, EXACT + */ +void kstrcpy(char* dst, const char* src) { + char* dst_ptr = dst; + const char* src_ptr = src; + + while (*src_ptr != 0) { + *dst_ptr = *src_ptr; + src_ptr++; + dst_ptr++; + } + *dst_ptr = 0; +} + +/*! + * Copy a string from src to dst, making all letters upper case. + * The null terminator is copied too. + * DONE, EXACT + */ +void kstrcpyup(char* dst, const char* src) { + while (*src) { + char c = *src; + if (c >= 'a' && c <= 'z') { // A-Z,a-z + c -= 0x20; + } + *dst = c; + dst++; + src++; + } + *dst = 0; +} + +/*! + * Concatenate two strings. Src is added to dest. + * The new string is null terminated. No bounds checking is done. + * DONE, EXACT + */ +void kstrcat(char* dest, const char* src) { + // seek to end of first string + while (*dest) { + dest++; + } + // copy second string + while (*src) { + *dest = *src; + src++; + dest++; + } + // null terminate + *dest = 0; +} + +/*! + * Concatenate two strings with a maximum length for the resulting string + * The maximum length should be larger than the length of the original string. + * The resulting string will be truncated when it reaches the given length. + * The null terminator is added, but doesn't count toward the length. + * DONE, EXACT + */ +void kstrncat(char* dest, const char* src, s32 count) { + // seek to null terminator of first string, count length + s32 i = 0; + while (*dest) { + dest++; + i++; + } + + // append second string, not exceeding length + while (*src && (i < count)) { + *dest = *src; + src++; + dest++; + i++; + } + + // null terminate + *dest = 0; +} + +/*! + * Insert the pad char at the beginning of a string, count times. + * DONE, EXACT + */ +char* kstrinsert(char* str, char pad, s32 count) { + // shift string+null terminator to the right. + s32 len = strlen(str); + while (len > -1) { + str[len + count] = str[len]; + len--; + } + + // pad + len = 0; + while (len < count) { + str[len++] = pad; + } + return str; +} + +/*! + * Get filename from path. + * This function is renamed to basename_goal so it doesn't conflict with "basename" that is + * already defined on my computer. + * For example: + * a/b/c.e will return c.e + * a\b\c.e will return c.e + * asdf.asdf will return asdf.asdf + * DONE, EXACT + */ +char* basename_goal(char* s) { + char* input = s; + char* pt = s; + + // seek to end + for (;;) { + char c = *pt; + if (c) { + pt++; + } else { + break; + } + } + + /* Original code, has memory bug. + // back up... + for (;;) { + if (pt < input) { + return input; + } + pt--; + char c = *pt; + // until we hit a slash. + if (c == '\\' || c == '/') { // slashes + return pt + 1; // and return one past + } + } + */ + + // back up... + for (;;) { + if (pt <= input) { + return input; + } + pt--; + char c = *pt; + // until we hit a slash. + if (c == '\\' || c == '/') { // slashes + return pt + 1; // and return one past + } + } +} + +/*! + * Does the file exist? No. It doesn't. + * @return 0 always, even if the file exists. + * DONE, EXACT, UNUSED + */ +u32 FileExists(const char* name) { + (void)name; + return 0; +} + +/*! + * Does nothing. Likely is supposed to delete a file. + * @param name + * DONE, EXACT, UNUSED + */ +void FileDelete(const char* name) { + (void)name; +} + +/*! + * Does nothing. Likely is supposed to copy a file. + * @param a + * @param b + * DONE, EXACT, UNUSED + */ +void FileCopy(const char* a, const char* b) { + (void)a; + (void)b; +} + +/*! + * Determine the file length in bytes. + * DONE, EXACT + */ +s32 FileLength(char* filename) { + s32 fd = sceOpen(filename, SCE_RDONLY); + if (fd < 0) { + MsgErr("dkernel: file length !open \'%s\' (%d)\n", filename, fd); + sceClose(fd); + return 0xfffffffb; + } else { + s32 rv = sceLseek(fd, 0, SCE_SEEK_END); + sceClose(fd); + return rv; + } +} + +/*! + * Load a file into memory + * @param name : file name + * @param heap : heap to allocate into, if memory is null + * @param memory : memory to load into. If null, allocates on the given kheap (with 64 extra bytes) + * @param malloc_flags : flags for the kmalloc + * @param size_out : file size is written here, if it's not null + * @return pointer to file data + * DONE, EXACT + */ +Ptr FileLoad(char* name, Ptr heap, Ptr memory, u32 malloc_flags, s32* size_out) { + s32 fd = sceOpen(name, SCE_RDONLY); + if (fd < 0) { + MsgErr("dkernel: file read !open \'%s\' (%d)\n", name, fd); + sceClose(fd); + return Ptr(0xfffffffb); + } + + // determine size + s32 initial_pos = sceLseek(fd, 0, SCE_SEEK_CUR); + s32 size = sceLseek(fd, 0, SCE_SEEK_END); + sceLseek(fd, initial_pos, SCE_SEEK_SET); + + if (size > 0) { + if (memory.offset == 0) { + memory = kmalloc(heap, size + 0x40, malloc_flags, name); + } + if (memory.offset == 0) { + MsgErr("dkernel: mem full for file read: '%s' (%d bytes)\n", name, size); + return Ptr(0xfffffffd); + } + + s32 read_amount = sceRead(fd, memory.c(), size); + if (read_amount == size) { + sceClose(fd); + if (size_out) + *size_out = size; + return memory; + } else { + MsgErr("dkernel: can't read full file (%d of %d): '%s'\n", read_amount, size, name); + sceClose(fd); + return Ptr(0xfffffffb); + } + } else { + return Ptr(0); + } +} + +/*! + * Write a file. + * DONE, EXACT + */ +s32 FileSave(char* name, u8* data, s32 size) { + s32 fd = sceOpen(name, SCE_WRONLY | SCE_TRUNC | SCE_CREAT); + if (fd < 0) { + MsgErr("dkernel: file write !open '%s'\n", name); + sceClose(fd); + return 0xfffffffa; + } + + if (size != 0) { + s32 written = sceWrite(fd, data, size); + if (written != size) { + MsgErr("dkernel: can't write full file '%s'\n", name); + sceClose(fd); + return 0xfffffffa; + } + } + + sceClose(fd); + return 0; +} diff --git a/game/kernel/fileio.h b/game/kernel/common/fileio.h similarity index 71% rename from game/kernel/fileio.h rename to game/kernel/common/fileio.h index bb52a4598a..55bc258a20 100644 --- a/game/kernel/fileio.h +++ b/game/kernel/common/fileio.h @@ -1,16 +1,23 @@ #pragma once -/*! - * @file fileio.h - * GOAL Low-Level File I/O and String Utilities - */ - -#ifndef RUNTIME_FILEIO_H -#define RUNTIME_FILEIO_H - #include "common/common_types.h" -#include "Ptr.h" -#include "kmalloc.h" + +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/kmalloc.h" + +constexpr char FOLDER_PREFIX[] = ""; + +void fileio_init_globals(); +char* strend(char* str); +void kstrcpy(char* dst, const char* src); +char* basename_goal(char* s); +void kstrcpyup(char* dst, const char* src); +void kstrcat(char* dest, const char* src); +char* kstrinsert(char* str, char pad, s32 count); +void kstrncat(char* dest, const char* src, s32 count); +Ptr FileLoad(char* name, Ptr heap, Ptr memory, u32 malloc_flags, s32* size_out); + +extern char buffer_633[512]; // GOAL File Types enum GoalFileType { @@ -21,7 +28,7 @@ enum GoalFileType { LISTENER_TO_KERNEL_LOCK_FILE_TYPE = 5, KERNEL_TO_LISTENER_LOCK_FILE_TYPE = 6, IOP_MODULE_FILE_TYPE = 8, - DATA_FILE_TYPE = 0x20, + DATA_FILE_TYPE = 0x20, // called FINAL in jak2 TX_PAGE_FILE_TYPE = 0x21, JA_FILE_TYPE = 0x22, JG_FILE_TYPE = 0x23, @@ -41,29 +48,12 @@ enum GoalFileType { GAME_CGO_FILE_TYPE = 0x39, CNT_FILE_TYPE = 0x3a, RES_FILE_TYPE = 0x3b, + SND_BNK_FILE_TYPE = 0x3c, + MUSIC_BNK_FILE_TYPE = 0x3d, + VAG_FILE_TYPE = 0x3e, + MISC_FILE_TYPE = 0x3f, // jak2 only + MAP_FILE_TYPE = 0x40, // jak2 only REFPLANT_FILE_TYPE = 0x301, // added this, allows access directly to out/iso from fileio. ISO_FILE_TYPE = 0x302 -}; - -constexpr char FOLDER_PREFIX[] = ""; - -char* strend(char* str); -u32 ReadHufWord(u8** loc_ptr); -void kstrcpy(char* dst, const char* src); -void kstrcpyup(char* dst, const char* src); -void kstrcat(char* dest, const char* src); -void kstrncat(char* dest, const char* src, s32 count); -char* kstrinsert(char* str, char pad, s32 count); -char* basename_goal(char* s); -char* DecodeFileName(const char* name); -char* MakeFileName(int type, const char* name, int new_string); -u32 FileExists(const char* name); -void FileDelete(const char* name); -void FileCopy(const char* a, const char* b); -s32 FileLength(char* filename); -Ptr FileLoad(char* name, Ptr heap, Ptr memory, u32 malloc_flags, s32* size_out); -s32 FileSave(char* name, u8* data, s32 size); -void fileio_init_globals(); - -#endif // RUNTIME_FILEIO_H +}; \ No newline at end of file diff --git a/game/kernel/common/kboot.cpp b/game/kernel/common/kboot.cpp new file mode 100644 index 0000000000..433c6fb303 --- /dev/null +++ b/game/kernel/common/kboot.cpp @@ -0,0 +1,37 @@ +#include "kboot.h" + +#include + +// Set to 1 to kill GOAL kernel +RuntimeExitStatus MasterExit; + +// Set to 1 to load game engine after boot automatically +u32 DiskBoot; + +// Set to 1 to enable debug heap +u32 MasterDebug; + +// Set to 1 to load debug code +u32 DebugSegment; + +u32 MasterUseKernel; + +// Level to load on boot +char DebugBootLevel[64]; + +// Pass to GOAL kernel on boot +char DebugBootMessage[64]; + +// game configuration +MasterConfig masterConfig; + +void kboot_init_globals_common() { + MasterExit = RuntimeExitStatus::RUNNING; + DiskBoot = 0; + MasterDebug = 1; + DebugSegment = 1; + MasterUseKernel = 1; + strcpy(DebugBootLevel, "#f"); // no specified level + strcpy(DebugBootMessage, "play"); // play mode, the default retail mode + memset(&masterConfig, 0, sizeof(MasterConfig)); +} \ No newline at end of file diff --git a/game/kernel/kboot.h b/game/kernel/common/kboot.h similarity index 56% rename from game/kernel/kboot.h rename to game/kernel/common/kboot.h index 2f652b612b..458a2680a4 100644 --- a/game/kernel/kboot.h +++ b/game/kernel/common/kboot.h @@ -1,35 +1,29 @@ #pragma once - -/*! - * @file kboot.h - * GOAL Boot. Contains the "main" function to launch GOAL runtime. - */ - #include "common/common_types.h" #define GAME_TERRITORY_SCEA 0 // sony america #define GAME_TERRITORY_SCEE 1 // sony europe #define GAME_TERRITORY_SCEI 2 // sony inc. (japan) -struct MasterConfig { - u16 language; //! GOAL language 0 - u16 aspect; //! SCE_ASPECT 2 - u16 disable_game; // 4 - u16 inactive_timeout; // todo 6 - u16 timeout; // todo 8 - u16 volume; // todo 12 - - u16 territory; // added. this is normally burnt onto the disc executable. +enum class RuntimeExitStatus { + RUNNING = 0, + RESTART_RUNTIME = 1, + EXIT = 2, + RESTART_IN_DEBUG = 3, }; -// Level to load on boot -extern char DebugBootLevel[64]; +enum class VideoMode { + NTSC = 0, + PAL = 1, + FPS100 = 2, + FPS150 = 3, +}; -// Pass to GOAL kernel on boot -extern char DebugBootMessage[64]; +// Set to nonzero to kill GOAL kernel +extern RuntimeExitStatus MasterExit; -// Set to 1 to kill GOAL kernel -extern u32 MasterExit; +// Set to 1 to load game engine after boot automatically +extern u32 DiskBoot; // Set to 1 to enable debug heap extern u32 MasterDebug; @@ -37,33 +31,30 @@ extern u32 MasterDebug; // Set to 1 to load debug code extern u32 DebugSegment; -// Set to 1 to load game engine after boot automatically -extern u32 DiskBoot; +// Level to load on boot +extern char DebugBootLevel[64]; + +// Pass to GOAL kernel on boot +extern char DebugBootMessage[64]; + +// Added in PC port, option to run listener functions without the kernel for debugging +extern u32 MasterUseKernel; + +struct MasterConfig { + u16 language; //! GOAL language 0 + u16 aspect; //! SCE_ASPECT 2 + u16 disable_game; // 4 + u16 inactive_timeout; // todo 6 + u16 timeout; // todo 8 + u16 jak2_only_unused; // seems unused 12 + u16 volume; // todo 14 in jak 2, 12 in jak 1 + + u16 disable_sound = 0; // added. disables all sound code. +}; extern MasterConfig masterConfig; /*! * Initialize global variables for kboot */ -void kboot_init_globals(); - -/*! - * Launch the GOAL Kernel (EE). - * See InitParms for launch argument details. - * @param argc : argument count - * @param argv : argument list - * @return 0 on success, otherwise failure. - */ -s32 goal_main(int argc, const char* const* argv); - -/*! - * Run the GOAL Kernel. - */ -void KernelCheckAndDispatch(); - -/*! - * Stop running the GOAL Kernel. - */ -void KernelShutdown(); - -extern u32 MasterUseKernel; +void kboot_init_globals_common(); \ No newline at end of file diff --git a/game/kernel/kdgo.cpp b/game/kernel/common/kdgo.cpp similarity index 67% rename from game/kernel/kdgo.cpp rename to game/kernel/common/kdgo.cpp index 568f7b8d05..a92ebb9877 100644 --- a/game/kernel/kdgo.cpp +++ b/game/kernel/common/kdgo.cpp @@ -1,36 +1,29 @@ -/*! - * @file kdgo.cpp - * Loading DGO Files. Also has some general SIF RPC stuff used for RPCs other than DGO loading. - * DONE! - */ +#include "kdgo.h" #include -#include "kdgo.h" -#include "kprint.h" -#include "kmalloc.h" -#include "fileio.h" -#include "klink.h" -#include "game/sce/sif_ee.h" -#include "game/common/dgo_rpc_types.h" -#include "game/common/player_rpc_types.h" -#include "game/common/ramdisk_rpc_types.h" -#include "game/common/loader_rpc_types.h" -#include "game/common/play_rpc_types.h" -#include "game/common/str_rpc_types.h" + #include "common/log/log.h" -using namespace ee; +#include "game/common/dgo_rpc_types.h" +#include "game/common/loader_rpc_types.h" +#include "game/common/play_rpc_types.h" +#include "game/common/player_rpc_types.h" +#include "game/common/ramdisk_rpc_types.h" +#include "game/common/str_rpc_types.h" +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/kprint.h" +#include "game/sce/sif_ee.h" -sceSifClientData cd[6]; //! client data for each IOP Remove Procedure Call. -u16 x[8]; //! stupid temporary for storing a message -u32 sShowStallMsg; //! setting to show a "stalled on iop" message -u32 sMsgNum; //! Toggle for double buffered message sending. -RPC_Dgo_Cmd* sLastMsg; //! Last DGO command sent to IOP -RPC_Dgo_Cmd sMsg[2]; //! DGO message buffers +ee::sceSifClientData cd[6]; //! client data for each IOP Remove Procedure Call. +u32 sShowStallMsg; //! setting to show a "stalled on iop" message +u16 x[8]; //! stupid temporary for storing a message +u32 sMsgNum; //! Toggle for double buffered message sending. +RPC_Dgo_Cmd* sLastMsg; //! Last DGO command sent to IOP +RPC_Dgo_Cmd sMsg[2]; //! DGO message buffers void kdgo_init_globals() { - memset(cd, 0, sizeof(cd)); memset(x, 0, sizeof(x)); + memset(cd, 0, sizeof(cd)); sShowStallMsg = 1; sLastMsg = nullptr; memset(sMsg, 0, sizeof(sMsg)); @@ -116,6 +109,7 @@ u32 RpcBind(s32 channel, s32 id) { } Msg(6, "kernel: RPC port #%d started [%4.4X]\n", channel, id); // FlushCache(0); + // In Jak 2 they do a sceSifCheckStatRpc, but we can just skip that. // this was not optimized out in Jak 1, but is _almost_ optimized out in Jak 2 and later. u32 i = 0; @@ -140,9 +134,12 @@ u32 RpcBind(s32 channel, s32 id) { * Setup all RPCs */ u32 InitRPC() { - if (!RpcBind(PLAYER_RPC_CHANNEL, PLAYER_RPC_ID) && !RpcBind(LOADER_RPC_CHANNEL, LOADER_RPC_ID) && - !RpcBind(RAMDISK_RPC_CHANNEL, RAMDISK_RPC_ID) && !RpcBind(DGO_RPC_CHANNEL, DGO_RPC_ID) && - !RpcBind(STR_RPC_CHANNEL, STR_RPC_ID) && !RpcBind(PLAY_RPC_CHANNEL, PLAY_RPC_ID)) { + if (!RpcBind(PLAYER_RPC_CHANNEL, PLAYER_RPC_ID[g_game_version]) && + !RpcBind(LOADER_RPC_CHANNEL, LOADER_RPC_ID[g_game_version]) && + !RpcBind(RAMDISK_RPC_CHANNEL, RAMDISK_RPC_ID[g_game_version]) && + !RpcBind(DGO_RPC_CHANNEL, DGO_RPC_ID[g_game_version]) && + !RpcBind(STR_RPC_CHANNEL, STR_RPC_ID[g_game_version]) && + !RpcBind(PLAY_RPC_CHANNEL, PLAY_RPC_ID[g_game_version])) { return 0; } printf("Entering endless loop ... please wait\n"); @@ -155,8 +152,8 @@ u32 InitRPC() { */ void StopIOP() { x[2] = 0x14; // todo - this type and message - // RpcSync(PLAYER_RPC_CHANNEL); - // RpcCall(PLAYER_RPC_CHANNEL, 0, false, x, 0x50, nullptr, 0); + // RpcSync(PLAYER_RPC_CHANNEL); + // RpcCall(PLAYER_RPC_CHANNEL, 0, false, x, 0x50, nullptr, 0); printf("IOP shut down\n"); // sceDmaSync(0x10009000, 0, 0); printf("DMA shut down\n"); @@ -298,84 +295,4 @@ void LoadDGOTest() { } sShowStallMsg = lastShowStall; -} - -/*! - * Load and link a DGO file. - * This does not use the mutli-threaded linker and will block until the entire file is done. - */ -void load_and_link_dgo(u64 name_gstr, u64 heap_info, u64 flag, u64 buffer_size) { - auto name = Ptr(name_gstr + 4).c(); - auto heap = Ptr(heap_info); - load_and_link_dgo_from_c(name, heap, flag, buffer_size, false); -} - -/*! - * Load and link a DGO file. - * This does not use the mutli-threaded linker and will block until the entire file is done.e - */ -void load_and_link_dgo_from_c(const char* name, - Ptr heap, - u32 linkFlag, - s32 bufferSize, - bool jump_from_c_to_goal) { - lg::debug("[Load and Link DGO From C] {}", name); - u32 oldShowStall = sShowStallMsg; - - // remember where the heap top point is so we can clear temporary allocations - auto oldHeapTop = heap->top; - - // allocate temporary buffers from top of the given heap - // align 64 for IOP DMA - // note: both buffers named dgo-buffer-2 - auto buffer2 = kmalloc(heap, bufferSize, KMALLOC_TOP | KMALLOC_ALIGN_64, "dgo-buffer-2"); - auto buffer1 = kmalloc(heap, bufferSize, KMALLOC_TOP | KMALLOC_ALIGN_64, "dgo-buffer-2"); - - // build filename. If no extension is given, default to CGO. - char fileName[16]; - kstrcpyup(fileName, name); - if (fileName[strlen(fileName) - 4] != '.') { - strcat(fileName, ".CGO"); - } - - // no stall messages, as this is a blocking load and when spending 100% CPU time on linking, - // the linker can beat the DVD drive. - sShowStallMsg = 0; - - // start load on IOP. - BeginLoadingDGO( - fileName, buffer1, buffer2, - Ptr((heap->current + 0x3f).offset & 0xffffffc0)); // 64-byte aligned for IOP DMA - - u32 lastObjectLoaded = 0; - while (!lastObjectLoaded) { - // check to see if next object is loaded (I believe it always is?) - auto dgoObj = GetNextDGO(&lastObjectLoaded); - if (!dgoObj.offset) { - continue; - } - - // if we're on the last object, it is loaded at cheap->current. So we can safely reset the two - // dgo-buffer allocations. We do this _before_ we link! This way, the last file loaded has more - // heap available, which is important when we need to use the entire memory. - if (lastObjectLoaded) { - heap->top = oldHeapTop; - } - - // determine the size and name of the object we got - auto obj = dgoObj + 0x40; // seek past dgo object header - u32 objSize = *(dgoObj.cast()); // size from object's link block - - char objName[64]; - strcpy(objName, (dgoObj + 4).cast().c()); // name from dgo object header - lg::debug("[link and exec] {:18s} {} {:6d} heap-use {:8d} {:8d}", objName, lastObjectLoaded, - objSize, kheapused(kglobalheap), kdebugheap.offset ? kheapused(kdebugheap) : 0); - link_and_exec(obj, objName, objSize, heap, linkFlag, jump_from_c_to_goal); // link now! - - // inform IOP we are done - if (!lastObjectLoaded) { - ContinueLoadingDGO(Ptr((heap->current + 0x3f).offset & 0xffffffc0)); - } - } - sShowStallMsg = oldShowStall; -} +} \ No newline at end of file diff --git a/game/kernel/common/kdgo.h b/game/kernel/common/kdgo.h new file mode 100644 index 0000000000..5a75d0b1d0 --- /dev/null +++ b/game/kernel/common/kdgo.h @@ -0,0 +1,25 @@ +#pragma once + +#include "common/common_types.h" + +#include "game/kernel/common/Ptr.h" + +s32 RpcCall(s32 rpcChannel, + u32 fno, + bool async, + void* sendBuff, + s32 sendSize, + void* recvBuff, + s32 recvSize); +void BeginLoadingDGO(const char* name, Ptr buffer1, Ptr buffer2, Ptr currentHeap); +Ptr GetNextDGO(u32* lastObjectFlag); +void ContinueLoadingDGO(Ptr heapPtr); +u64 RpcCall_wrapper(void* _args); +u32 RpcBusy(s32 channel); +void RpcSync(s32 channel); +void LoadDGOTest(); +void kdgo_init_globals(); +u32 InitRPC(); +void StopIOP(); + +extern u32 sShowStallMsg; diff --git a/game/kernel/kdsnetm.cpp b/game/kernel/common/kdsnetm.cpp similarity index 87% rename from game/kernel/kdsnetm.cpp rename to game/kernel/common/kdsnetm.cpp index eacc7de04f..0949563e20 100644 --- a/game/kernel/kdsnetm.cpp +++ b/game/kernel/common/kdsnetm.cpp @@ -1,18 +1,10 @@ -/*! - * @file kdsnetm.cpp - * Low-level DECI2 wrapper for ksocket - * DONE! - */ - -#include -#include -#include "game/sce/deci2.h" -#include "game/system/deci_common.h" // todo, reorganize to avoid this include #include "kdsnetm.h" -#include "kprint.h" -#include "common/util/Assert.h" -using namespace ee; +#include + +#include "game/kernel/common/kprint.h" +#include "game/sce/deci2.h" +#include "game/system/deci_common.h" /*! * Current state of the GOAL Protocol @@ -23,7 +15,7 @@ GoalProtoBlock protoBlock; /*! * Initialize global variables for kdsnetm */ -void kdsnetm_init_globals() { +void kdsnetm_init_globals_common() { protoBlock.reset(); } @@ -32,7 +24,7 @@ void kdsnetm_init_globals() { * DONE, EXACT */ void InitGoalProto() { - protoBlock.socket = sceDeci2Open(DECI2_PROTOCOL, &protoBlock, GoalProtoHandler); + protoBlock.socket = ee::sceDeci2Open(DECI2_PROTOCOL, &protoBlock, GoalProtoHandler); if (protoBlock.socket < 0) { MsgErr("gproto: open proto error\n"); } else { @@ -52,7 +44,7 @@ void InitGoalProto() { */ void ShutdownGoalProto() { if (protoBlock.socket > 0) { - sceDeci2Close(protoBlock.socket); + ee::sceDeci2Close(protoBlock.socket); } } @@ -86,7 +78,7 @@ void GoalProtoHandler(int event, int param, void* opt) { if (pb->receive_progress + param <= (int)DEBUG_MESSAGE_BUFFER_SIZE) { // actually get data from DECI2 s32 received = - sceDeci2ExRecv(pb->socket, ((u8*)pb->receive_buffer) + pb->receive_progress, param); + ee::sceDeci2ExRecv(pb->socket, ((u8*)pb->receive_buffer) + pb->receive_progress, param); if (received < 0) { // receive failure @@ -104,21 +96,21 @@ void GoalProtoHandler(int event, int param, void* opt) { } break; - // read is finished! + // read is finished! case DECI2_READDONE: // set last_receive_size to indicate that there is a pending message in the buffer. pb->last_receive_size = pb->receive_progress; pb->receive_progress = 0; break; - // send some data + // send some data case DECI2_WRITE: { // note that we should not attempt to send more than 0xffff bytes at a time, or this will be // wrong. This is correctly checked for prints, but not for outputs. ASSERT(pb->send_remaining < 0xffff); // why and it with 0xffff? Seems like saturation would be better. Either way some data // will be lost, so I guess it doesn't matter. - s32 sent = sceDeci2ExSend(pb->socket, (void*)pb->send_ptr, pb->send_remaining & 0xffff); + s32 sent = ee::sceDeci2ExSend(pb->socket, (void*)pb->send_ptr, pb->send_remaining & 0xffff); if (sent < 0) { // if we got an error, put it in send status, signaling a send error (negative) pb->send_status = sent; @@ -129,7 +121,7 @@ void GoalProtoHandler(int event, int param, void* opt) { } } break; - // done sending! + // done sending! case DECI2_WRITEDONE: if (pb->send_remaining <= 0) { // if we've send everything we want, set status to zero to indicate success @@ -148,7 +140,7 @@ void GoalProtoHandler(int event, int param, void* opt) { case DECI2_CHSTATUS: break; - // other events are undefined, so we just error. + // other events are undefined, so we just error. default: pb->last_receive_size = -1; break; @@ -165,7 +157,7 @@ s32 SendFromBufferD(s32 msg_kind, u64 msg_id, char* data, s32 size) { // wait for send to finish or error first... while (protoBlock.send_status > 0) { // on actual PS2, the kernel will run this in another thread. - LIBRARY_sceDeci2_run_sends(); + ee::LIBRARY_sceDeci2_run_sends(); } // retry at most 10 times until we complete without an error. @@ -193,7 +185,7 @@ s32 SendFromBufferD(s32 msg_kind, u64 msg_id, char* data, s32 size) { header->msg_id = msg_id; // start send! - auto rv = sceDeci2ReqSend(protoBlock.socket, header->deci2_header.dst); + auto rv = ee::sceDeci2ReqSend(protoBlock.socket, header->deci2_header.dst); if (rv < 0) { printf("1sceDeci2ReqSend fail, reason code = %08x\n", rv); return 0xfffffffa; @@ -201,7 +193,7 @@ s32 SendFromBufferD(s32 msg_kind, u64 msg_id, char* data, s32 size) { // wait for send to complete or error. while (protoBlock.send_status > 0) { - LIBRARY_sceDeci2_run_sends(); + ee::LIBRARY_sceDeci2_run_sends(); } // if send completes, exit. Otherwise if there's an error, just try again. diff --git a/game/kernel/kdsnetm.h b/game/kernel/common/kdsnetm.h similarity index 92% rename from game/kernel/kdsnetm.h rename to game/kernel/common/kdsnetm.h index 3e4f46bdea..9f86ccd124 100644 --- a/game/kernel/kdsnetm.h +++ b/game/kernel/common/kdsnetm.h @@ -6,12 +6,10 @@ * DONE! */ -#ifndef JAK_KDSNETM_H -#define JAK_KDSNETM_H - -#include "Ptr.h" #include "common/listener_common.h" +#include "game/kernel/common/Ptr.h" + struct GoalProtoBlock { s32 socket = 0; ListenerMessageHeader* send_buffer = nullptr; @@ -41,7 +39,7 @@ extern GoalProtoBlock protoBlock; /*! * Initialize global variables for kdsnetm */ -void kdsnetm_init_globals(); +void kdsnetm_init_globals_common(); /*! * Register GOAL DECI2 Protocol Driver with DECI2 service @@ -74,5 +72,3 @@ s32 SendFromBufferD(s32 p1, u64 msg_id, char* data, s32 size); * Print GOAL Protocol status */ void GoalProtoStatus(); - -#endif // JAK_KDSNETM_H diff --git a/game/kernel/common/kernel_types.h b/game/kernel/common/kernel_types.h new file mode 100644 index 0000000000..a75be55d03 --- /dev/null +++ b/game/kernel/common/kernel_types.h @@ -0,0 +1,38 @@ +#pragma once + +//! Mirror of cpad-info +struct CPadInfo { + u8 valid; + u8 status; + u16 button0; + u8 rightx; + u8 righty; + u8 leftx; + u8 lefty; + u8 abutton[12]; + u8 dummy[12]; + s32 number; + s32 cpad_file; + u32 button0_abs[3]; + u32 button0_shadow_abs[1]; + u32 button0_rel[3]; + float stick0_dir; + float stick0_speed; + s32 new_pad; + s32 state; + u8 align[6]; + u8 direct[6]; + u8 buzz_val[2]; + u8 __pad[2]; + u64 buzz_time[2]; + u32 buzz; + s32 buzz_act; + s32 change_time; // actually u64 in goal! +}; + +struct FileStream { + u32 flags; + u32 mode; // basic + u32 name; // basic + s32 file; // int32 +}; diff --git a/game/kernel/common/klink.cpp b/game/kernel/common/klink.cpp new file mode 100644 index 0000000000..4a89d7694c --- /dev/null +++ b/game/kernel/common/klink.cpp @@ -0,0 +1,260 @@ +#include "klink.h" + +#include "common/goal_constants.h" +#include "common/symbols.h" + +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/kscheme.h" + +#include "third-party/fmt/core.h" + +namespace { +// turn on printf's for debugging linking issues. +constexpr bool link_debug_printfs = false; + +bool is_opengoal_object(const void* data) { + auto* header = (const LinkHeaderV2*)data; + return !(header->type_tag == 0xffffffff && (header->version == 2 || header->version == 4)); +} +} // namespace + +// space to store a single in-progress linking state. +link_control saved_link_control; + +// pointer to GOAL *ultimate-memcpy*, if its loaded. +Ptr gfunc_774; + +void klink_init_globals() { + saved_link_control.reset(); + gfunc_774.offset = 0; +} + +/*! + * Initialize the link control. + * TODO: this hasn't been carefully checked for jak 2 differences. + */ +void link_control::begin(Ptr object_file, + const char* name, + int32_t size, + Ptr heap, + uint32_t flags) { + if (is_opengoal_object(object_file.c())) { + // save data from call to begin + m_object_data = object_file; + kstrcpy(m_object_name, name); + m_object_size = size; + m_heap = heap; + m_flags = flags; + + // initialize link control + m_entry.offset = 0; + m_heap_top = m_heap->top; + m_keep_debug = false; + m_opengoal = true; + m_busy = true; + + if (link_debug_printfs) { + char* goal_name = object_file.cast().c(); + printf("link %s\n", m_object_name); + printf("link_control::begin %c%c%c%c\n", goal_name[0], goal_name[1], goal_name[2], + goal_name[3]); + } + + // points to the beginning of the linking data + m_link_block_ptr = object_file + BASIC_OFFSET; + m_code_size = 0; + m_code_start = object_file; + m_state = 0; + m_segment_process = 0; + + ObjectFileHeader* ofh = m_link_block_ptr.cast().c(); + if (ofh->goal_version_major != versions::GOAL_VERSION_MAJOR) { + fprintf( + stderr, + "VERSION ERROR: C Kernel built from GOAL %d.%d, but object file %s is from GOAL %d.%d\n", + versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR, name, ofh->goal_version_major, + ofh->goal_version_minor); + ASSERT(false); + } + if (link_debug_printfs) { + printf("Object file header:\n"); + printf(" GOAL ver %d.%d obj %d len %d\n", ofh->goal_version_major, ofh->goal_version_minor, + ofh->object_file_version, ofh->link_block_length); + printf(" segment count %d\n", ofh->segment_count); + for (int i = 0; i < N_SEG; i++) { + printf(" seg %d link 0x%04x, 0x%04x data 0x%04x, 0x%04x\n", i, ofh->link_infos[i].offset, + ofh->link_infos[i].size, ofh->code_infos[i].offset, ofh->code_infos[i].size); + } + } + + m_version = ofh->object_file_version; + if (ofh->object_file_version < 4) { + // three segment file + + // seek past the header + m_object_data.offset += ofh->link_block_length; + // todo, set m_code_size + + if (m_link_block_ptr.offset < m_heap->base.offset || + m_link_block_ptr.offset >= m_heap->top.offset) { + // the link block is outside our heap, or in the top of our heap. It's somebody else's + // problem. + if (link_debug_printfs) { + printf("Link block somebody else's problem\n"); + } + + if (m_heap->base.offset <= m_object_data.offset && // above heap base + m_object_data.offset < m_heap->top.offset && // less than heap top (not needed?) + m_object_data.offset < m_heap->current.offset) { // less than heap current + if (link_debug_printfs) { + printf("Code block in the heap, kicking it out for copy into heap\n"); + } + m_heap->current = m_object_data; + } + } else { + // in our heap, we need to move it so we can free up its space later on + if (link_debug_printfs) { + printf("Link block needs to be moved!\n"); + } + + // allocate space for a new one + auto new_link_block = kmalloc(m_heap, ofh->link_block_length, KMALLOC_TOP, "link-block"); + auto old_link_block = m_link_block_ptr - BASIC_OFFSET; + + // copy it (was ultimate memcpy, but just use normal one to make it easier) + memmove(new_link_block.c(), old_link_block.c(), ofh->link_block_length); + m_link_block_ptr = new_link_block + BASIC_OFFSET; + + // if we can save some memory here + if (old_link_block.offset < m_heap->current.offset) { + if (link_debug_printfs) { + printf("Kick out old link block\n"); + } + m_heap->current = old_link_block; + } + } + } else { + ASSERT_MSG(false, "UNHANDLED OBJECT FILE VERSION"); + } + + if ((m_flags & LINK_FLAG_FORCE_DEBUG) && MasterDebug && !DiskBoot) { + m_keep_debug = true; + } + } else { + m_opengoal = false; + // not an open goal object. + if (link_debug_printfs) { + printf("Linking GOAL style object\n"); + } + + // initialize + m_object_data = object_file; + kstrcpy(m_object_name, name); + m_object_size = size; + m_heap = heap; + m_flags = flags; + m_entry.offset = 0; + m_heap_top = m_heap->top; + m_keep_debug = false; + m_link_block_ptr = object_file + BASIC_OFFSET; + m_code_size = 0; + m_code_start = object_file; + m_state = 0; + m_segment_process = 0; + + const auto* header = (LinkHeaderV2*)(m_link_block_ptr.c() - 4); + + m_version = header->version; + if (header->version < 4) { + // seek past header + m_object_data.offset += header->length; + m_code_size = m_object_size - header->length; + if (m_link_block_ptr.offset < m_heap->base.offset || + m_link_block_ptr.offset >= m_heap->top.offset) { + // the link block is outside our heap, or in the top of our heap. It's somebody else's + // problem. + if (link_debug_printfs) { + printf("Link block somebody else's problem\n"); + } + + if (m_heap->base.offset <= m_object_data.offset && // above heap base + m_object_data.offset < m_heap->top.offset && // less than heap top (not needed?) + m_object_data.offset < m_heap->current.offset) { // less than heap current + if (link_debug_printfs) { + printf("Code block in the heap, kicking it out for copy into heap\n"); + } + m_heap->current = m_object_data; + } + } else { + // in our heap, we need to move it so we can free up its space later on + if (link_debug_printfs) { + printf("Link block needs to be moved!\n"); + } + + // allocate space for a new one + auto new_link_block = kmalloc(m_heap, header->length, KMALLOC_TOP, "link-block"); + auto old_link_block = m_link_block_ptr - BASIC_OFFSET; + + // copy it (was ultimate memcpy) + memmove(new_link_block.c(), old_link_block.c(), header->length); + m_link_block_ptr = new_link_block + BASIC_OFFSET; + + // if we can save some memory here + if (old_link_block.offset < m_heap->current.offset) { + if (link_debug_printfs) { + printf("Kick out old link block\n"); + } + m_heap->current = old_link_block; + } + } + + } else { + auto header_v4 = (const LinkHeaderV4*)header; + auto old_object_data = m_object_data; + m_link_block_ptr = + old_object_data + header_v4->code_size + sizeof(LinkHeaderV4) + BASIC_OFFSET; + m_object_data = old_object_data + sizeof(LinkHeaderV4); + m_code_size = header_v4->code_size; + } + + if ((m_flags & LINK_FLAG_FORCE_DEBUG) && MasterDebug && !DiskBoot) { + m_keep_debug = true; + } + } +} + +Ptr c_symlink2(Ptr objData, Ptr linkObj, Ptr relocTable) { + u8* relocPtr = relocTable.c(); + Ptr objPtr = objData; + + do { + u8 table_value = *relocPtr; + u32 result = table_value; + u8* next_reloc = relocPtr + 1; + + if (result & 3) { + result = (relocPtr[1] << 8) | table_value; + next_reloc = relocPtr + 2; + if (result & 2) { + result = (relocPtr[2] << 16) | result; + next_reloc = relocPtr + 3; + if (result & 1) { + result = (relocPtr[3] << 24) | result; + next_reloc = relocPtr + 4; + } + } + } + + relocPtr = next_reloc; + objPtr = objPtr + (result & 0xfffffffc); + u32 objValue = *(objPtr.cast()); + if (objValue == 0xffffffff) { + *(objPtr.cast()) = linkObj.offset; + } else { + // I don't think we should hit this ever. + ASSERT(false); + } + } while (*relocPtr); + + return make_ptr(relocPtr + 1); +} \ No newline at end of file diff --git a/game/kernel/klink.h b/game/kernel/common/klink.h similarity index 78% rename from game/kernel/klink.h rename to game/kernel/common/klink.h index bc45781fb7..652b6c2f0f 100644 --- a/game/kernel/klink.h +++ b/game/kernel/common/klink.h @@ -1,15 +1,12 @@ #pragma once +#include -/*! - * @file klink.cpp - * GOAL Linker for x86-64 - * DONE! - */ - -#include "Ptr.h" -#include "kmalloc.h" -#include "common/link_types.h" #include "common/common_types.h" +#include "common/link_types.h" + +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/kmalloc.h" +#include "game/kernel/common/kscheme.h" constexpr int LINK_FLAG_OUTPUT_LOAD = 0x1; constexpr int LINK_FLAG_OUTPUT_TRUE = 0x2; @@ -18,6 +15,24 @@ constexpr int LINK_FLAG_PRINT_LOGIN = 0x8; //! Note, doesn't actually do anythi constexpr int LINK_FLAG_FORCE_DEBUG = 0x10; constexpr int LINK_FLAG_FORCE_FAST_LINK = 0x20; +// only used in OpenGOAL +struct SegmentInfo { + uint32_t offset; + uint32_t size; +}; + +// only used in OpenGOAL +struct ObjectFileHeader { + uint16_t goal_version_major; + uint16_t goal_version_minor; + uint32_t object_file_version; + uint32_t segment_count; + SegmentInfo link_infos[N_SEG]; + SegmentInfo code_infos[N_SEG]; + uint32_t link_block_length; +}; + +void klink_init_globals(); /*! * Stores the state of the linker. Used for multi-threaded linking, so it can be suspended. */ @@ -44,15 +59,23 @@ struct link_control { int m_table_toggle; bool m_opengoal; + bool m_busy; // only in jak2, but doesn't hurt to set it in jak 1. void begin(Ptr object_file, const char* name, int32_t size, Ptr heap, uint32_t flags); - uint32_t work(); - uint32_t work_v3(); - uint32_t work_v2(); - void finish(bool jump_from_c_to_goal); + + // was originally "work" + uint32_t jak1_work(); + uint32_t jak2_work(); + + uint32_t jak1_work_v3(); + uint32_t jak1_work_v2(); + uint32_t jak2_work_v3(); + uint32_t jak2_work_v2(); + void jak1_finish(bool jump_from_c_to_goal); + void jak2_finish(bool jump_from_c_to_goal); void reset() { m_object_data.offset = 0; @@ -69,40 +92,12 @@ struct link_control { m_state = 0; m_segment_process = 0; m_version = 0; + m_busy = false; } }; -// only used in OpenGOAL -struct SegmentInfo { - uint32_t offset; - uint32_t size; -}; - -// only used in OpenGOAL -struct ObjectFileHeader { - uint16_t goal_version_major; - uint16_t goal_version_minor; - uint32_t object_file_version; - uint32_t segment_count; - SegmentInfo link_infos[N_SEG]; - SegmentInfo code_infos[N_SEG]; - uint32_t link_block_length; -}; - void klink_init_globals(); - -u64 link_and_exec_wrapper(u64* args); - -Ptr link_and_exec(Ptr data, - const char* name, - int32_t size, - Ptr heap, - uint32_t flags, - bool jump_from_c_to_goal); - -uint64_t link_begin(u64* args); - -uint64_t link_resume(); -void ultimate_memcpy(void* dst, void* src, uint32_t size); +Ptr c_symlink2(Ptr objData, Ptr linkObj, Ptr relocTable); extern link_control saved_link_control; +extern Ptr gfunc_774; // actually 807 in jak2. diff --git a/game/kernel/common/klisten.cpp b/game/kernel/common/klisten.cpp new file mode 100644 index 0000000000..df321f2508 --- /dev/null +++ b/game/kernel/common/klisten.cpp @@ -0,0 +1,76 @@ +#include "klisten.h" + +#include +#include + +#include "common/listener_common.h" + +#include "game/kernel/common/kdsnetm.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/common/ksocket.h" + +Ptr print_column; +u32 ListenerStatus; + +void klisten_init_globals() { + print_column.offset = 0; + ListenerStatus = 0; +} + +/*! + * Flush pending messages. If debugging, will send to compiler, otherwise to stdout. + */ +void ClearPending() { + if (!MasterDebug) { + // if we aren't debugging print the print buffer to stdout. + if (PrintPending.offset != 0) { + auto size = strlen(PrintBufArea.cast().c() + sizeof(ListenerMessageHeader)); + if (size > 0) { + printf("%s", PrintBufArea.cast().c() + sizeof(ListenerMessageHeader)); + } + clear_print(); + } + } else { + if (ListenerStatus) { + if (OutputPending.offset != 0) { + Ptr msg = OutputBufArea.cast() + sizeof(ListenerMessageHeader); + auto size = strlen(msg.c()); + // note - if size is ever greater than 2^16 this will cause an issue. + SendFromBuffer(msg.c(), size); + clear_output(); + } + + if (PrintPending.offset != 0) { + char* msg = PrintBufArea.cast().c() + sizeof(ListenerMessageHeader); + auto size = strlen(msg); + while (size > 0) { + // sends larger than 64 kB are broken by the GoalProtoBuffer thing, so they are split + auto send_size = size; + if (send_size > 64000) { + send_size = 64000; + } + SendFromBufferD(2, 0, msg, send_size); + size -= send_size; + msg += send_size; + } + clear_print(); + } + } + } +} + +/*! + * Send an "ack" message. The original game had the AckBufArea which stores "ack", but did not + * calculate the length correctly, so the message would not actually contain the "ack" text. + * The "ack" text is unimportant, as the compiler can recognize the messages as ACK due to the + * ListenerMessageKind::MSG_ACK field. Both the type and msg_id fields are sent, which is enough + * for it to work. + * Note: jak2 sent 0 length acks. + */ +void SendAck() { + if (MasterDebug) { + SendFromBufferD(u16(ListenerMessageKind::MSG_ACK), protoBlock.msg_id, + AckBufArea + sizeof(ListenerMessageHeader), + strlen(AckBufArea + sizeof(ListenerMessageHeader))); + } +} diff --git a/game/kernel/common/klisten.h b/game/kernel/common/klisten.h new file mode 100644 index 0000000000..f1f7d30b31 --- /dev/null +++ b/game/kernel/common/klisten.h @@ -0,0 +1,12 @@ +#pragma once + +#include "common/common_types.h" + +#include "game/kernel/common/Ptr.h" + +extern Ptr print_column; +extern u32 ListenerStatus; + +void klisten_init_globals(); +void ClearPending(); +void SendAck(); \ No newline at end of file diff --git a/game/kernel/common/kmachine.cpp b/game/kernel/common/kmachine.cpp new file mode 100644 index 0000000000..b7768ab56a --- /dev/null +++ b/game/kernel/common/kmachine.cpp @@ -0,0 +1,470 @@ +#include "kmachine.h" + +#include "common/global_profiler/GlobalProfiler.h" +#include "common/log/log.h" +#include "common/symbols.h" +#include "common/util/FileUtil.h" +#include "common/util/Timer.h" + +#include "game/graphics/gfx.h" +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/kernel_types.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/common/kscheme.h" +#include "game/sce/libcdvd_ee.h" +#include "game/sce/libpad.h" +#include "game/sce/libscf.h" +#include "game/sce/sif_ee.h" + +/*! + * Where does OVERLORD load its data from? + */ +OverlordDataSource isodrv; + +// Get IOP modules from DVD or from dsefilesv +u32 modsrc; + +// Reboot IOP with IOP kernel from DVD/CD on boot +u32 reboot; + +const char* init_types[] = {"fakeiso", "deviso", "iso_cd"}; +u8 pad_dma_buf[2 * SCE_PAD_DMA_BUFFER_SIZE]; + +// added +u32 vif1_interrupt_handler = 0; + +Timer ee_clock_timer; + +void kmachine_init_globals_common() { + memset(pad_dma_buf, 0, sizeof(pad_dma_buf)); + isodrv = fakeiso; // changed. fakeiso is the only one that works in opengoal. + modsrc = 1; + reboot = 1; + vif1_interrupt_handler = 0; + ee_clock_timer = Timer(); +} + +/*! + * Initialize the CD Drive + * DONE, EXACT + */ +void InitCD() { + lg::info("Initializing CD drive. This may take a while..."); + ee::sceCdInit(SCECdINIT); + ee::sceCdMmode(SCECdDVD); + while (ee::sceCdDiskReady(0) == SCECdNotReady) { + lg::debug("Drive not ready... insert a disk!"); + } + lg::debug("Disk type {}\n", ee::sceCdGetDiskType()); +} + +/*! + * Initialize the GS and display the splash screen. + * Not yet implemented. TODO + */ +void InitVideo() {} + +/*! + * Flush caches. Does all the memory, regardless of what you specify + */ +void CacheFlush(void* mem, int size) { + (void)mem; + (void)size; + // FlushCache(0); + // FlushCache(2); +} + +/*! + * Open a new controller pad. + * Set the new_pad flag to 1 and state to 0. + * Prints an error if it fails to open. + */ +u64 CPadOpen(u64 cpad_info, s32 pad_number) { + auto cpad = Ptr(cpad_info).c(); + if (cpad->cpad_file == 0) { + // not open, so we will open it + cpad->cpad_file = + ee::scePadPortOpen(pad_number, 0, pad_dma_buf + pad_number * SCE_PAD_DMA_BUFFER_SIZE); + if (cpad->cpad_file < 1) { + MsgErr("dkernel: !open cpad #%d (%d)\n", pad_number, cpad->cpad_file); + } + cpad->new_pad = 1; + cpad->state = 0; + } + return cpad_info; +} + +/*! + * Not checked super carefully for jak 2, but looks the same + */ +u64 CPadGetData(u64 cpad_info) { + using namespace ee; + auto cpad = Ptr(cpad_info).c(); + auto pad_state = scePadGetState(cpad->number, 0); + if (pad_state == scePadStateDiscon) { + cpad->state = 0; + } + cpad->valid = pad_state | 0x80; + switch (cpad->state) { + // case 99: // functional + default: // controller is functioning as normal + if (pad_state == scePadStateStable || pad_state == scePadStateFindCTP1) { + scePadRead(cpad->number, 0, (u8*)cpad); + // ps2 controllers would send an enabled bit if the button was NOT pressed, but we don't do + // that here. removed code that flipped the bits. + + if (cpad->change_time != 0) { + scePadSetActDirect(cpad->number, 0, cpad->direct); + } + cpad->valid = pad_state; + } + break; + case 0: // unavailable + if (pad_state == scePadStateStable || pad_state == scePadStateFindCTP1) { + auto pad_mode = scePadInfoMode(cpad->number, 0, InfoModeCurID, 0); + if (pad_mode != 0) { + auto vibration_mode = scePadInfoMode(cpad->number, 0, InfoModeCurExID, 0); + if (vibration_mode > 0) { + // vibration supported + pad_mode = vibration_mode; + } + if (pad_mode == 4) { + // controller mode + cpad->state = 40; + } else if (pad_mode == 7) { + // dualshock mode + cpad->state = 70; + } else { + // who knows mode + cpad->state = 90; + } + } + } + break; + case 40: // controller mode - check for extra modes + cpad->change_time = 0; + if (scePadInfoMode(cpad->number, 0, InfoModeIdTable, -1) == 0) { + // no controller modes + cpad->state = 90; + return cpad_info; + } + cpad->state = 41; + case 41: // controller mode - change to dualshock mode! + // try to enter the 2nd controller mode (dualshock for ds2's) + if (scePadSetMainMode(cpad->number, 0, 1, 3) == 1) { + cpad->state = 42; + } + break; + case 42: // controller mode change check + if (scePadGetReqState(cpad->number, 0) == scePadReqStateFailed) { + // failed to change to DS2 + cpad->state = 41; + } + if (scePadGetReqState(cpad->number, 0) == scePadReqStateComplete) { + // change successful. go back to the beginning. + cpad->state = 0; + } + break; + case 70: // dualshock mode - check vibration + // get number of actuators (2 for DS2) + if (scePadInfoAct(cpad->number, 0, -1, 0) < 1) { + // no actuators means no vibration. skip to end! + cpad->change_time = 0; + cpad->state = 99; + } else { + // we have actuators to use. + cpad->change_time = 1; // remember to update pad times. + cpad->state = 75; + } + break; + case 75: // set actuator vib param info + if (scePadSetActAlign(cpad->number, 0, cpad->align) != 0) { + if (scePadInfoPressMode(cpad->number, 0) == 1) { + // pressure buttons supported + cpad->state = 76; + } else { + // no pressure buttons, done with controller setup + cpad->state = 99; + } + } + break; + case 76: // enter pressure mode + if (scePadEnterPressMode(cpad->number, 0) == 1) { + cpad->state = 78; + } + break; + case 78: // pressure mode request check + if (scePadGetReqState(cpad->number, 0) == scePadReqStateFailed) { + cpad->state = 76; + } + if (scePadGetReqState(cpad->number, 0) == scePadReqStateComplete) { + cpad->state = 99; + } + break; + case 90: + break; // unsupported controller. too bad! + } + return cpad_info; +} + +// should make sure this works the same way in jak 2 +void InstallHandler(u32 handler_idx, u32 handler_func) { + ASSERT(handler_idx == 5); // vif1 + vif1_interrupt_handler = handler_func; +} + +// nothing used this in jak1, hopefully same for 2 +void InstallDebugHandler() { + ASSERT(false); +} + +/*! + * Get length of a file. + */ +s32 klength(u64 fs) { + auto file_stream = Ptr(fs).c(); + if ((file_stream->flags ^ 1) & 1) { + // first flag bit not set. This means no errors + auto end_seek = ee::sceLseek(file_stream->file, 0, SCE_SEEK_END); + auto reset_seek = ee::sceLseek(file_stream->file, 0, SCE_SEEK_SET); + if (reset_seek < 0 || end_seek < 0) { + // seeking failed, flag it + file_stream->flags |= 1; + } + return end_seek; + } else { + return 0; + } +} + +/*! + * Seek a file stream. + */ +s32 kseek(u64 fs, s32 offset, s32 where) { + s32 result = -1; + auto file_stream = Ptr(fs).c(); + if ((file_stream->flags ^ 1) & 1) { + result = ee::sceLseek(file_stream->file, offset, where); + if (result < 0) { + file_stream->flags |= 1; + } + } + return result; +} + +/*! + * Read from a file stream. + */ +s32 kread(u64 fs, u64 buffer, s32 size) { + s32 result = -1; + auto file_stream = Ptr(fs).c(); + if ((file_stream->flags ^ 1) & 1) { + result = ee::sceRead(file_stream->file, Ptr(buffer).c(), size); + if (result < 0) { + file_stream->flags |= 1; + } + } + return result; +} + +/*! + * Write to a file stream. + */ +s32 kwrite(u64 fs, u64 buffer, s32 size) { + s32 result = -1; + auto file_stream = Ptr(fs).c(); + if ((file_stream->flags ^ 1) & 1) { + result = ee::sceWrite(file_stream->file, Ptr(buffer).c(), size); + if (result < 0) { + file_stream->flags |= 1; + } + } + return result; +} + +/*! + * Close a file stream. + */ +u64 kclose(u64 fs) { + auto file_stream = Ptr(fs).c(); + if ((file_stream->flags ^ 1) & 1) { + ee::sceClose(file_stream->file); + file_stream->file = -1; + } + file_stream->flags = 0; + return fs; +} + +// TODO dma_to_iop +void dma_to_iop() { + ASSERT(false); +} + +u64 DecodeLanguage() { + return masterConfig.language; +} + +u64 DecodeAspect() { + return masterConfig.aspect; +} + +u64 DecodeVolume() { + return masterConfig.volume; +} + +// NOTE: this is originally hardcoded, and returns different values depending on the disc region. +// it returns 0 for NTSC-U, 1 for PAL and 2 for NTSC-J +u64 DecodeTerritory() { + return GAME_TERRITORY_SCEA; +} + +u64 DecodeTimeout() { + return masterConfig.timeout; +} + +u64 DecodeInactiveTimeout() { + return masterConfig.inactive_timeout; +} + +void DecodeTime(u32 ptr) { + Ptr clock(ptr); + // in jak2, if this fails, they do a sceScfGetLocalTimefromRTC + sceCdReadClock(clock.c()); +} + +/*! + * PC PORT FUNCTIONS BEGIN + */ +/*! + * Get a 300MHz timer value. + */ +u64 read_ee_timer() { + u64 ns = ee_clock_timer.getNs(); + return (ns * 3) / 10; +} + +/*! + * Do a fast memory copy. + */ +void c_memmove(u32 dst, u32 src, u32 size) { + memmove(Ptr(dst).c(), Ptr(src).c(), size); +} + +/*! + * Returns size of window. + */ +void get_window_size(u32 w_ptr, u32 h_ptr) { + if (w_ptr) { + auto w = Ptr(w_ptr).c(); + *w = Gfx::get_window_width(); + } + if (h_ptr) { + auto h = Ptr(h_ptr).c(); + *h = Gfx::get_window_height(); + } +} + +/*! + * Returns scale of window. This is for DPI stuff. + */ +void get_window_scale(u32 x_ptr, u32 y_ptr) { + float* x = x_ptr ? Ptr(x_ptr).c() : NULL; + float* y = y_ptr ? Ptr(y_ptr).c() : NULL; + Gfx::get_window_scale(x, y); +} + +/*! + * Returns resolution of the monitor. + */ +void get_screen_size(s64 vmode_idx, u32 w_ptr, u32 h_ptr) { + s32 *w_out = 0, *h_out = 0; + if (w_ptr) { + w_out = Ptr(w_ptr).c(); + } + if (h_ptr) { + h_out = Ptr(h_ptr).c(); + } + Gfx::get_screen_size(vmode_idx, w_out, h_out); +} + +/*! + * Returns refresh rate of the monitor. + */ +s64 get_screen_rate(s64 vmode_idx) { + return Gfx::get_screen_rate(vmode_idx); +} + +/*! + * Returns amount of video modes of the monitor. + */ +s64 get_screen_vmode_count() { + return Gfx::get_screen_vmode_count(); +} + +void mkdir_path(u32 filepath) { + auto filepath_str = std::string(Ptr(filepath).c()->data()); + file_util::create_dir_if_needed_for_file(filepath_str); +} + +u64 filepath_exists(u32 filepath) { + auto filepath_str = std::string(Ptr(filepath).c()->data()); + if (std::filesystem::exists(filepath_str)) { + return s7.offset + true_symbol_offset(g_game_version); + } + return s7.offset; +} + +void prof_event(u32 name, u32 kind) { + prof().event(Ptr(name).c()->data(), (ProfNode::Kind)kind); +} + +void set_frame_rate(s64 rate) { + Gfx::set_frame_rate(rate); +} + +void set_vsync(u32 symptr) { + Gfx::set_vsync(symptr != s7.offset); +} + +void set_window_lock(u32 symptr) { + Gfx::set_window_lock(symptr == s7.offset); +} + +void set_collision(u32 symptr) { + Gfx::g_global_settings.collision_enable = symptr != s7.offset; +} + +void set_collision_wireframe(u32 symptr) { + Gfx::g_global_settings.collision_wireframe = symptr != s7.offset; +} + +void set_collision_mask(GfxGlobalSettings::CollisionRendererMode mode, int mask, u32 symptr) { + if (symptr != s7.offset) { + Gfx::CollisionRendererSetMask(mode, mask); + } else { + Gfx::CollisionRendererClearMask(mode, mask); + } +} + +u32 get_collision_mask(GfxGlobalSettings::CollisionRendererMode mode, int mask) { + return Gfx::CollisionRendererGetMask(mode, mask) ? s7.offset + true_symbol_offset(g_game_version) + : s7.offset; +} + +/*! + * PC PORT FUNCTIONS END + */ + +void vif_interrupt_callback() { + // added for the PC port for faking VIF interrupts from the graphics system. + if (vif1_interrupt_handler && MasterExit == RuntimeExitStatus::RUNNING) { + call_goal(Ptr(vif1_interrupt_handler), 0, 0, 0, s7.offset, g_ee_main_mem); + } +} + +/*! + * Added in PC port. + */ +u32 offset_of_s7() { + return s7.offset; +} \ No newline at end of file diff --git a/game/kernel/common/kmachine.h b/game/kernel/common/kmachine.h new file mode 100644 index 0000000000..61e1290616 --- /dev/null +++ b/game/kernel/common/kmachine.h @@ -0,0 +1,77 @@ +#pragma once + +#include "common/common_types.h" + +#include "game/graphics/gfx.h" + +/*! + * Where does OVERLORD load its data from? + */ +enum OverlordDataSource : u32 { + fakeiso = 0, //! some sort of development way of getting data + deviso = 1, //! some sort of development way of getting data + iso_cd = 2, //! use the actual DVD drive +}; + +extern OverlordDataSource isodrv; + +// Get IOP modules from DVD or from dsefilesv +extern u32 modsrc; + +// Reboot IOP on start? +extern u32 reboot; + +extern const char* init_types[]; + +void kmachine_init_globals_common(); + +/*! + * Initialize the CD Drive + */ +void InitCD(); + +/*! + * Initialize the GS and display the splash screen. + */ +void InitVideo(); + +/*! + * Flush caches. Does all the memory, regardless of what you specify + */ +void CacheFlush(void* mem, int size); +u64 CPadOpen(u64 cpad_info, s32 pad_number); +u64 CPadGetData(u64 cpad_info); +void InstallHandler(u32 handler_idx, u32 handler_func); +void InstallDebugHandler(); +s32 klength(u64 fs); +s32 kseek(u64 fs, s32 offset, s32 where); +s32 kread(u64 fs, u64 buffer, s32 size); +s32 kwrite(u64 fs, u64 buffer, s32 size); +u64 kclose(u64 fs); +void dma_to_iop(); +u64 DecodeLanguage(); +u64 DecodeAspect(); +u64 DecodeVolume(); +u64 DecodeTerritory(); +u64 DecodeTimeout(); +u64 DecodeInactiveTimeout(); +void DecodeTime(u32 ptr); +u64 read_ee_timer(); +void c_memmove(u32 dst, u32 src, u32 size); +void get_window_size(u32 w_ptr, u32 h_ptr); +void get_window_scale(u32 x_ptr, u32 y_ptr); +void get_screen_size(s64 vmode_idx, u32 w_ptr, u32 h_ptr); +s64 get_screen_rate(s64 vmode_idx); +s64 get_screen_vmode_count(); +void mkdir_path(u32 filepath); +u64 filepath_exists(u32 filepath); +void prof_event(u32 name, u32 kind); +void set_frame_rate(s64 rate); +void set_vsync(u32 symptr); +void set_window_lock(u32 symptr); +void set_collision(u32 symptr); +void set_collision_wireframe(u32 symptr); +void set_collision_mask(GfxGlobalSettings::CollisionRendererMode mode, int mask, u32 symptr); +u32 get_collision_mask(GfxGlobalSettings::CollisionRendererMode mode, int mask); +u32 offset_of_s7(); +void vif_interrupt_callback(); \ No newline at end of file diff --git a/game/kernel/kmalloc.cpp b/game/kernel/common/kmalloc.cpp similarity index 90% rename from game/kernel/kmalloc.cpp rename to game/kernel/common/kmalloc.cpp index 821f859957..996f73545a 100644 --- a/game/kernel/kmalloc.cpp +++ b/game/kernel/common/kmalloc.cpp @@ -1,22 +1,19 @@ -/*! - * @file kmalloc.cpp - * GOAL Kernel memory allocator. - * Simple two-sided bump allocator. - * DONE - */ - -#include -#include -#include "common/goal_constants.h" #include "kmalloc.h" -#include "kprint.h" -#include "kscheme.h" + +#include +#include + +#include "common/goal_constants.h" + +#include "game/kernel/common/kprint.h" +#include "game/kernel/common/kscheme.h" +#include "game/kernel/common/memory_layout.h" // global and debug kernel heaps Ptr kglobalheap; Ptr kdebugheap; -void kmalloc_init_globals() { +void kmalloc_init_globals_common() { // _globalheap and _debugheap kglobalheap.offset = GLOBAL_HEAP_INFO_ADDR; kdebugheap.offset = DEBUG_HEAP_INFO_ADDR; @@ -57,7 +54,7 @@ Ptr ksmalloc(Ptr heap, s32 size, u32 flags, char const* name) { * which will not be sent to the Listener. * DONE, EXACT */ -void kheapstatus(Ptr heap) { +Ptr kheapstatus(Ptr heap) { Msg(6, "[%8x] kheap\n" "\tbase: #x%x\n" @@ -66,16 +63,20 @@ void kheapstatus(Ptr heap) { "\ttop: #x%x\n", heap.offset, heap->base.offset, heap->top_base.offset, heap->current.offset, heap->top.offset); + // note: max symbols here is game-version dependent Msg(6, "\t used bot: %d of %d bytes\n" "\t used top: %d of %d bytes\n" "\t symbols: %d of %d\n", heap->current - heap->base, heap->top_base - heap->base, heap->top_base - heap->top, - heap->top_base - heap->base, NumSymbols, GOAL_MAX_SYMBOLS); + heap->top_base - heap->base, NumSymbols, max_symbols(g_game_version)); if (heap == kglobalheap) { Msg(6, "\t %d bytes before stack\n", GLOBAL_HEAP_END - heap->current.offset); } + + // might not have returned heap in jak 1 + return heap; } /*! @@ -113,7 +114,8 @@ Ptr kmalloc(Ptr heap, s32 size, u32 flags, char const* name) { // if we got a null heap, put it on the global heap, but warn about it if (!heap.offset) { - Msg(6, "-----------> kmalloc: alloc %s, mem %s #x%x (a:%d %dbytes)\n", "DEBUG", name, -1, + // the 0 is uninitialized in jak1, set to zero in jak 2. might just be compiler differences. + Msg(6, "-----------> kmalloc: alloc %s, mem %s #x%x (a:%d %dbytes)\n", "DEBUG", name, 0, alignment_flag, size); heap = kglobalheap; } diff --git a/game/kernel/kmalloc.h b/game/kernel/common/kmalloc.h similarity index 75% rename from game/kernel/kmalloc.h rename to game/kernel/common/kmalloc.h index 4efbaea194..464fc4cbc9 100644 --- a/game/kernel/kmalloc.h +++ b/game/kernel/common/kmalloc.h @@ -1,18 +1,8 @@ #pragma once -/*! - * @file kmalloc.h - * GOAL Kernel memory allocator. - * Simple two-sided bump allocator. - * DONE - */ - -#ifndef JAK_KMALLOC_H -#define JAK_KMALLOC_H - #include "common/common_types.h" -#include "Ptr.h" -#include "kmachine.h" + +#include "game/kernel/common/Ptr.h" /*! * A kheap has a top/bottom linear allocator @@ -35,14 +25,11 @@ constexpr u32 KMALLOC_ALIGN_256 = 0x100; constexpr u32 KMALLOC_ALIGN_64 = 0x40; constexpr u32 KMALLOC_ALIGN_16 = 0x10; -// kmalloc funcions +void kmalloc_init_globals_common(); + Ptr ksmalloc(Ptr heap, s32 size, u32 flags, char const* name); -void kheapstatus(Ptr heap); +Ptr kheapstatus(Ptr heap); Ptr kinitheap(Ptr heap, Ptr mem, s32 size); u32 kheapused(Ptr heap); Ptr kmalloc(Ptr heap, s32 size, u32 flags, char const* name); -void kfree(Ptr a); - -void kmalloc_init_globals(); - -#endif // JAK_KMALLOC_H +void kfree(Ptr a); \ No newline at end of file diff --git a/game/kernel/common/kmemcard.cpp b/game/kernel/common/kmemcard.cpp new file mode 100644 index 0000000000..425b7bea9a --- /dev/null +++ b/game/kernel/common/kmemcard.cpp @@ -0,0 +1,674 @@ +/*! + * @file kmemcard.cpp + * Memory card interface. Very messy code. Most of it is commented out now, as we've switched away + * from memory cards to just raw saves. + * + * Not checked carefully for differences in jak 2. + */ + +#include "kmemcard.h" + +#include +#include +#include + +#include "common/util/Assert.h" +#include "common/util/FileUtil.h" +#include "common/util/Timer.h" + +#include "game/sce/sif_ee.h" +#include "game/sce/sif_ee_memcard.h" + +#include "third-party/fmt/core.h" + +static constexpr bool memcard_debug = false; + +using McCallbackFunc = void (*)(s32); + +McCallbackFunc callback; + +static s32 language; +static MemoryCardOperation op; +// instead of two memory cards we just simulate the 4 save files (8 banks). +static MemoryCardFile mc_files[4]; +// keep track of latest file selected. this is only used in an auto-save mode thats not used +static int mc_last_file = -1; + +// a random value we will use as the memory card "handle" for the pc port, which has no memcards. +constexpr u32 PC_MEM_CARD_HANDLE = 0x6C616F67; + +constexpr u32 MEM_CARD_MAGIC = 0x12345678; + +struct McHeader { + u32 save_count; + u32 checksum; + u32 magic; + u8 preview_data[64]; + u8 data[944]; + u32 unk1_repeated; +}; +static_assert(sizeof(McHeader) == 0x400, "McHeader size"); +constexpr s32 BANK_TOTAL_SIZE = BANK_SIZE + sizeof(McHeader) * 2; + +static McHeader header; + +// these are the return value for sceMcGetInfo. +static s32 p1, p2, p3, p4; +using namespace ee; + +template +void mc_print(const std::string& str, Args&&... args) { + if (memcard_debug) { + fmt::print("[MC] "); + if (!str.empty() && str.back() == '\n') { + fmt::print(str, std::forward(args)...); + } else { + fmt::print(str + '\n', std::forward(args)...); + } + } +} + +const char* filename[12] = { + "BASCUS-97124AYBABTU!", "BASCUS-97124AYBABTU!/icon.sys", + "BASCUS-97124AYBABTU!/icon.ico", "BASCUS-97124AYBABTU!/BASCUS-97124AYBABTU!", + "BASCUS-97124AYBABTU!/bank0.bin", "BASCUS-97124AYBABTU!/bank1.bin", + "BASCUS-97124AYBABTU!/bank2.bin", "BASCUS-97124AYBABTU!/bank3.bin", + "BASCUS-97124AYBABTU!/bank4.bin", "BASCUS-97124AYBABTU!/bank5.bin", + "BASCUS-97124AYBABTU!/bank6.bin", "BASCUS-97124AYBABTU!/bank7.bin"}; + +void kmemcard_init_globals() { + // next = 0; + language = 0; + op = {}; + // mc[0] = {}; + // mc[1] = {}; + mc_files[0] = {}; + mc_files[1] = {}; + mc_files[2] = {}; + mc_files[3] = {}; + callback = nullptr; + p1 = 0; + p2 = 0; + p3 = 0; + p4 = 0; + // memset(&dirent, 0, sizeof(sceMcTblGetDir)); + memset(&header, 0, sizeof(McHeader)); +} + +/*! + * A questionable checksum used on memory card data. + */ +u32 mc_checksum(Ptr data, s32 size) { + if (size < 0) { + size += 3; + } + + u32 result = 0; + u32* data_u32 = (u32*)data.c(); + for (s32 i = 0; i < size / 4; i++) { + result = result << 1 ^ (s32)result >> 0x1f ^ data_u32[i] ^ MEM_CARD_MAGIC; + } + + return result ^ 0xedd1e666; +} + +/*! + * PC port function that returns whether a given bank ID's file exists or not. + */ +bool file_is_present(int id, int bank = 0) { + auto bankname = file_util::get_user_memcard_dir() / filename[4 + id * 2 + bank]; + if (!std::filesystem::exists(bankname) || + std::filesystem::file_size(bankname) < BANK_TOTAL_SIZE) { + // file doesn't exist, or size is bad. we do not want to open files that will crash on read! + return false; + } + // avoid file check here tbh. there shouldn't be any saves with a save count of zero anyway. + // the file check is quite slow and ultimately not very useful. + return true; + + /* + // file exists. but let's see if it's an empty one. + // this prevents the game from reading a bank but classifying it as corrupt data. + // which a file full of zeros logically is. + auto fp = fopen(bankname.c_str(), "rb"); + + // we can actually just check if the save count is over zero... + u32 savecount = 0; + fread(&savecount, sizeof(u32), 1, fp); + fclose(fp); + return savecount > 0; + */ +} + +/*! + * PC port function to set memcard info. We don't use a memory card, instead just the raw savefiles. + */ +void pc_update_card() { + // int highest_save_count = 0; + mc_last_file = -1; + for (s32 file = 0; file < 4; file++) { + auto bankname = file_util::get_user_memcard_dir() / filename[4 + file * 2]; + mc_files[file].present = file_is_present(file); + if (mc_files[file].present) { + auto bankdata = file_util::read_binary_file(bankname.string()); + auto header1 = reinterpret_cast(bankdata.data()); + if (file_is_present(file, 1)) { + auto bankname2 = file_util::get_user_memcard_dir() / filename[1 + 4 + file * 2]; + auto bankdata2 = file_util::read_binary_file(bankname2.string()); + auto header2 = reinterpret_cast(bankdata2.data()); + + if (header2->save_count > header1->save_count) { + // use most recent bank here. + header1 = header2; + } + + // banks chosen and checked. copy data and set info. + mc_files[file].last_saved_bank = header1 == header2; + mc_files[file].most_recent_save_count = header1->save_count; + + memcpy(mc_files[file].data, header1->preview_data, 64); + } else { + // banks chosen and checked. copy data and set info. + mc_files[file].last_saved_bank = 0; + mc_files[file].most_recent_save_count = header1->save_count; + + memcpy(mc_files[file].data, header1->preview_data, 64); + } + + // if (mc_files[file].most_recent_save_count > highest_save_count) { + // mc_last_file = file; + // highest_save_count = mc_files[file].most_recent_save_count; + // } + } + } +} + +/*! + * PC port function to save a file. This does the whole saving at once, synchronously. + */ +void pc_game_save_synch() { + Timer mc_timer; + mc_timer.start(); + pc_update_card(); + auto path = file_util::get_user_memcard_dir() / filename[0]; + file_util::create_dir_if_needed_for_file(path.string()); + + // cd_reprobe_save // + if (!file_is_present(op.param2)) { + mc_print("reprobe save: first time!"); + // first time saving! + p2 = 0; // save count 0 + p4 = 0; // first bank for file + } else { + p2 = mc_files[op.param2].most_recent_save_count + 1; // increment save count + p4 = mc_files[op.param2].last_saved_bank ^ 1; // use the other bank + } + + // reserve 0 as "I never saved" and use 1 instead. + if (p2 == 0) { + p2 = 1; + } + + // file*2 + p4 is the bank (2 banks per file, p4 is 0 or 1 to select the bank) + // 4 is the first bank file + mc_print("open {} for saving", filename[op.param2 * 2 + 4 + p4]); + auto save_path = file_util::get_user_memcard_dir() / filename[op.param2 * 2 + 4 + p4]; + file_util::create_dir_if_needed_for_file(save_path.string()); + auto fd = fopen(save_path.string().c_str(), "wb"); + mc_print("synchronous save file open took {:.2f}ms\n", mc_timer.getMs()); + if (fd) { + // cb_openedsave // + mc_print("save file opened, writing header..."); + memset(&header, 0, sizeof(McHeader)); + header.save_count = p2; + header.checksum = mc_checksum(op.data_ptr, BANK_SIZE); + header.magic = MEM_CARD_MAGIC; + header.unk1_repeated = p2; + memcpy(header.preview_data, op.data_ptr2.c(), 64); + if (fwrite(&header, sizeof(McHeader), 1, fd) == 1) { + // cb_savedheader // + mc_print("save file writing main data"); + if (fwrite(op.data_ptr.c(), BANK_SIZE, 1, fd) == 1) { + // cb_saveddata // + mc_print("save file writing footer"); + if (fwrite(&header, sizeof(McHeader), 1, fd) == 1) { + // cb_savedfooter // + if (fclose(fd) == 0) { + // cb_closedsave // + mc_print("All done with saving!!"); + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::OK; + mc_files[op.param2].present = 1; + mc_files[op.param2].most_recent_save_count = p2; + mc_files[op.param2].last_saved_bank = p4; + memcpy(mc_files[op.param2].data, op.data_ptr2.c(), 64); + mc_last_file = op.param2; + } else { + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::INTERNAL_ERROR; + } + } else { + fclose(fd); + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::INTERNAL_ERROR; + } + } else { + fclose(fd); + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::INTERNAL_ERROR; + } + } else { + fclose(fd); + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::INTERNAL_ERROR; + } + } else { + fmt::print("[MC] Error opening file, errno - {}", errno); + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::INTERNAL_ERROR; + } + + mc_print("[MC] synchronous save took {:.2f}ms\n", mc_timer.getMs()); +} + +void pc_game_load_open_file(FILE* fd) { + if (fd) { + // cb_openedload // + size_t read_size = BANK_TOTAL_SIZE; + mc_print("reading save file..."); + if (fread(op.data_ptr.c() + p2 * read_size, read_size, 1, fd) == 1) { + // cb_readload // + mc_print("closing save file.."); + if (fclose(fd) == 0) { + // cb_closedload // + // added : check if aux bank exists + if (p2 < 1 && std::filesystem::exists(file_util::get_user_memcard_dir() / + filename[op.param2 * 2 + 4 + p2 + 1])) { + p2++; + mc_print("reading next save bank {}", filename[op.param2 * 2 + 4 + p2]); + auto new_bankname = file_util::get_user_memcard_dir() / filename[op.param2 * 2 + 4 + p2]; + auto new_fd = fopen(new_bankname.string().c_str(), "rb"); + pc_game_load_open_file(new_fd); + } else { + // let's verify the data. + McHeader* headers[2]; + McHeader* footers[2]; + bool ok[2]; + + headers[0] = (McHeader*)(op.data_ptr.c()); + footers[0] = (McHeader*)(op.data_ptr.c() + sizeof(McHeader) + BANK_SIZE); + headers[1] = (McHeader*)(op.data_ptr.c() + BANK_TOTAL_SIZE); + footers[1] = + (McHeader*)(op.data_ptr.c() + BANK_TOTAL_SIZE + sizeof(McHeader) + BANK_SIZE); + static_assert(BANK_TOTAL_SIZE * 2 == 0x21000, "save layout"); + ok[0] = true; + ok[1] = p2 == 1; + + for (int idx = 0; idx < 2; idx++) { + u32 expected_save_count = headers[idx]->save_count; + if (headers[idx]->unk1_repeated == expected_save_count && + footers[idx]->save_count == expected_save_count && + footers[idx]->unk1_repeated == expected_save_count) { + // save count is okay! + if (headers[idx]->magic == MEM_CARD_MAGIC && footers[idx]->magic == MEM_CARD_MAGIC) { + // magic numbers okay! + if (headers[idx]->checksum == footers[idx]->checksum) { + // checksum + auto expected_checksum = headers[idx]->checksum; + if (mc_checksum(make_u8_ptr(headers[idx] + 1), BANK_SIZE) != expected_checksum) { + mc_print("failed checksum"); + ok[idx] = false; + } + } else { + mc_print("corrupted checksum"); + ok[idx] = false; + } + } else { + mc_print("bad magic"); + ok[idx] = false; + } + } else { + mc_print("bad save count"); + ok[idx] = false; + } + } + + mc_print("checking loaded banks"); + + // + if (!ok[0] && !ok[1]) { + // no good data. + if (headers[0]->save_count == 0 && headers[0]->checksum == 0 && + headers[0]->magic == 0 && headers[0]->unk1_repeated == 0 && + headers[1]->save_count == 0 && headers[1]->checksum == 0 && + headers[1]->magic == 0 && headers[1]->unk1_repeated == 0) { + // this is a fresh file that you tried to load from... + mc_print("new game result"); + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::NEW_GAME; + mc_last_file = op.param2; + } else { + mc_print("corrupted data"); + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::READ_ERROR; + } + } else { + // pick the bank + int bank = 0; + + if (!ok[0] || !ok[1]) { + if (ok[1]) { + bank = 1; + } + } else { + bank = headers[0]->save_count <= headers[1]->save_count; + } + + mc_print(fmt::format("loading bank {}", bank)); + u32 current_save_count = headers[bank]->save_count; + memmove(op.data_ptr.c(), op.data_ptr.c() + bank * BANK_TOTAL_SIZE + sizeof(McHeader), + BANK_SIZE); + mc_last_file = op.param2; + mc_files[op.param2].most_recent_save_count = current_save_count; + mc_files[op.param2].last_saved_bank = bank; + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::OK; + mc_print("load succeeded"); + } + } + } else { + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::INTERNAL_ERROR; + } + } else { + fclose(fd); + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::INTERNAL_ERROR; + } + } else { + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::INTERNAL_ERROR; + } +} + +/*! + * PC port function to load a file. This does the whole loading at once, synchronously. + */ +void pc_game_load_synch() { + Timer mc_timer; + mc_timer.start(); + pc_update_card(); + + // cb_reprobe_load // + p2 = 0; + mc_print("opening save file {}", filename[op.param2 * 2 + 4]); + + auto path = file_util::get_user_memcard_dir() / filename[op.param2 * 2 + 4]; + auto fd = fopen(path.string().c_str(), "rb"); + pc_game_load_open_file(fd); + + mc_print("synchronous load took {:.2f}ms\n", mc_timer.getMs()); +} + +/*! + * Run the Memory Card state machine. This is called once per frame in GOAL. + * It: + * - does nothing if there is an in-progress memory card operation + * - if async memory card functions are done, runs their callbacks + * - if there is a requested operation, starts running sony functions. + * - if there is none of the above, and unknown cards, finds out about them. + * - every now and then, recheck cards. + */ +void MC_run() { + // if we have an in-progress operation, it will have set a callback. + if (callback) { + s32 sony_cmd, sony_status; + // check the status + s32 status = sceMcSync(1, &sony_cmd, &sony_status); + McCallbackFunc callback_for_sync = callback; + if (status == sceMcExecRun) { + // busy, return. + return; + } + + if (status == sceMcExecFinish) { + // sony function is done. do the callback. + callback = nullptr; + (*callback_for_sync)(sony_status); + } else { + // sony function is done, but failed. + callback = nullptr; + (*callback_for_sync)(0); + } + + if (callback) { + // if we got another callback, it means there's another op started by the prev callback. + // and this case, we want to wait for that operation to finish. + return; + } + } + + // if we got here, there is no in-progress sony function. So start the next one, if we should + if (op.operation == MemoryCardOperationKind::FORMAT) { + // format memory card. Not used in PC port, so lets move on. + return; + } else if (op.operation == MemoryCardOperationKind::UNFORMAT) { + // unformat memory card. + return; + } else if (op.operation == MemoryCardOperationKind::CREATE_FILE) { + // create the game file. + // there's no cards, keep in mind. + return; + } else if (op.operation == MemoryCardOperationKind::SAVE) { + // write game save. + // there's no cards, keep in mind. + pc_game_save_synch(); + // allow some number of errors. + op.retry_count--; + if (op.retry_count == 0) { + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::INTERNAL_ERROR; + } + } else if (op.operation == MemoryCardOperationKind::LOAD) { + // load game save. + // potato. + if (!file_is_present(op.param2)) { + // tried to load, but there's no save data in the file. + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::NO_MEMORY; + } else { + pc_game_load_synch(); + op.retry_count--; + if (op.retry_count == 0) { + op.operation = MemoryCardOperationKind::NO_OP; + op.result = McStatusCode::INTERNAL_ERROR; + } + } + } +} + +///////////////////////// +// Memory Card Functions +///////////////////////// + +// These functions are called from GOAL to start memory card operations. + +/*! + * Set the language or something. + * Why is this a memory card func? + */ +void MC_set_language(s32 l) { + printf("Language set to %d\n", l); + language = l; +} + +/*! + * Set the current memory card operation to FORMAT the given card. + * Doesn't do anything in the port because we don't use memory cards. + */ +u64 MC_format(s32 /*card_idx*/) { + return u64(McStatusCode::OK); + // u64 can_add = op.operation == MemoryCardOperationKind::NO_OP; + // mc_print("requested format"); + // if (can_add) { + // mc_print("setting op to format"); + // op.operation = MemoryCardOperationKind::FORMAT; + // op.result = McStatusCode::BUSY; + // op.retry_count = 100; + // op.param = card_idx; + //} + // return can_add; +} + +/*! + * Set the current memory card operation to UNFORMAT the given card. + * You get the idea. + */ +u64 MC_unformat(s32 /*card_idx*/) { + return u64(McStatusCode::OK); + // u64 can_add = op.operation == MemoryCardOperationKind::NO_OP; + // mc_print("requested unformat"); + // if (can_add) { + // mc_print("setting op to unformat"); + // op.operation = MemoryCardOperationKind::UNFORMAT; + // op.result = McStatusCode::BUSY; + // op.retry_count = 100; + // op.param = card_idx; + //} + // return can_add; +} + +/*! + * Set the current memory card operation to create the save file. + * The data I believe is just an empty buffer used as temporary storage. + */ +u64 MC_createfile(s32 /*param*/, Ptr /*data*/) { + return u64(McStatusCode::OK); + // u64 can_add = op.operation == MemoryCardOperationKind::NO_OP; + // mc_print("requested createfile"); + // if (can_add) { + // mc_print("setting op to create file"); + // op.operation = MemoryCardOperationKind::CREATE_FILE; + // op.result = McStatusCode::BUSY; + // op.retry_count = 100; + // op.param = param; + // op.data_ptr = data; + //} + // return can_add; +} + +/*! + * Set the current operation to SAVE. + * The "summary data" is data that will be used when previewing save files (number of orbs etc) + * TODO put synchronous call here + */ +u64 MC_save(s32 card_idx, s32 file_idx, Ptr save_data, Ptr save_summary_data) { + mc_print("requested save"); + u64 can_add = op.operation == MemoryCardOperationKind::NO_OP; + if (can_add) { + mc_print("setting op to save"); + op.operation = MemoryCardOperationKind::SAVE; + op.result = McStatusCode::BUSY; + op.retry_count = 100; + op.param = card_idx; + op.param2 = file_idx; + op.data_ptr = save_data; + op.data_ptr2 = save_summary_data; + } + return can_add; +} + +/*! + * Set the current operation to LOAD. + * TODO put synchronous call here + */ +u64 MC_load(s32 card_idx, s32 file_idx, Ptr data) { + mc_print("requested load"); + u64 can_add = op.operation == MemoryCardOperationKind::NO_OP; + if (can_add) { + mc_print("setting op to load"); + op.operation = MemoryCardOperationKind::LOAD; + op.result = McStatusCode::BUSY; + op.retry_count = 100; + op.param = card_idx; + op.param2 = file_idx; + op.data_ptr = data; + } + return can_add; +} + +/*! + * Some sort of test function for memory card stuff. + * This is exported as a GOAL function, but nothing calls it. + */ +void MC_makefile(s32 port, s32 size) { + sceMcMkdir(port, 0, "/BASCUS-00000XXXXXXXX"); + // wait for operation to complete + s32 cmd, result, fd; + sceMcSync(0, &cmd, &result); + + if (result == sceMcResSucceed || result == sceMcResNoEntry) { + // it worked, or the folder already exists... + + // open file + sceMcOpen(port, 0, "/BASCUS-00000XXXXXXXX/BASCUS-00000XXXXXXXX", SCE_CREAT | SCE_WRONLY); + sceMcSync(0, &cmd, &fd); + + if (result < 0) { + printf("Can't open file on memcard [%d]\n", result); + } else { + // write some random crap into the memory card. + sceMcWrite(fd, Ptr(0x1000000).c(), size); + sceMcSync(0, &cmd, &result); + if (result != size) { + printf("Only written %d bytes\n", result); + } + sceMcClose(fd); + sceMcSync(0, &cmd, &result); + } + } else { + printf("Can\'t create garbage folder [%d]\n", result); + } +} + +/*! + * Get the result of the currently executing (or most recently executed) command + */ +u32 MC_check_result() { + return (u32)op.result; +} + +/*! + * Update the info for the given slot. + * You can call this at any time. + * The slot includes the four save slots (8 banks), and a few other files. + */ +void MC_get_status(s32 /*slot*/, Ptr info) { + // slot is ignored, so you'll get the same thing regardless of what slot you pick + + info->handle = 0; + info->known = 0; + info->formatted = 0; + info->initted = 0; + for (s32 i = 0; i < 4; i++) { + info->files[i].present = 0; + } + info->last_file = 0xffffffff; + info->mem_required = SAVE_SIZE; + info->mem_actual = 0; + + pc_update_card(); + info->known = 1; + info->handle = PC_MEM_CARD_HANDLE; + info->formatted = 1; + info->mem_actual = SAVE_SIZE; // idk TODO does this matter? + info->initted = 1; + // copy over the preview data. + for (s32 file = 0; file < 4; file++) { + info->files[file].present = mc_files[file].present; + for (s32 i = 0; i < 64; i++) { // actually a loop over u32's + info->files[file].data[i] = mc_files[file].data[i]; + } + } + info->last_file = mc_last_file; +} diff --git a/game/kernel/kmemcard.h b/game/kernel/common/kmemcard.h similarity index 96% rename from game/kernel/kmemcard.h rename to game/kernel/common/kmemcard.h index 78bd54b10f..c28386b711 100644 --- a/game/kernel/kmemcard.h +++ b/game/kernel/common/kmemcard.h @@ -6,11 +6,12 @@ */ #include "common/common_types.h" -#include "kmachine.h" + +#include "game/kernel/common/Ptr.h" void kmemcard_init_globals(); -constexpr s32 SAVE_SIZE = 691; // likely different by versions! 692 on PAL/JPN +constexpr s32 SAVE_SIZE = 691; // likely different between versions! 692 on PAL/JPN constexpr s32 BANK_SIZE = 0x10000; // each card can be in one of these states: diff --git a/game/kernel/common/kprint.cpp b/game/kernel/common/kprint.cpp new file mode 100644 index 0000000000..f53ed0536d --- /dev/null +++ b/game/kernel/common/kprint.cpp @@ -0,0 +1,572 @@ +#include "kprint.h" + +#include +#include +#include +#include + +#include "common/cross_os_debug/xdbg.h" +#include "common/listener_common.h" + +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/klink.h" +#include "game/kernel/common/kmalloc.h" +#include "game/kernel/common/kscheme.h" + +// Pointer set to something in the middle of the output buffer, if there is something in the buffer. +Ptr OutputPending; + +// Pointer set to something in the middle of the print buffer, if there is something in the buffer +Ptr PrintPending; + +// Size of incoming message. +s32 MessCount; + +// Pointer to message buffer, the compiler to target buffer +Ptr MessBufArea; + +// Pointer to the output buffer, the runtime to compiler buffer +Ptr OutputBufArea; + +// Pointer to print buffer, the buffer for printing and string formatting. +Ptr PrintBufArea; + +// integer printing conversion table +char ConvertTable[16]; + +// buffer for sending an "acknowledge" message to the compiler +char AckBufArea[40]; + +/*! + * Initialize global variables for kprint + */ +void kprint_init_globals_common() { + OutputPending.offset = 0; + PrintPending.offset = 0; + MessCount = 0; + MessBufArea.offset = 0; + OutputBufArea.offset = 0; + PrintBufArea.offset = 0; + memcpy(ConvertTable, "0123456789abcdef", 16); + memset(AckBufArea, 0, sizeof(AckBufArea)); +} + +/*! + * Initialize GOAL Kernel printing/messaging system. + * Allocates buffers. + */ +void init_output() { + // Note: slightly different behavior in jak 1/jak 2 here. + // I think the jak 2 version makes clear_wrong do the wrong thing if you are masterdebug but not + // debugsegment. + bool use_debug; + switch (g_game_version) { + case GameVersion::Jak1: + use_debug = MasterDebug; + break; + case GameVersion::Jak2: + use_debug = MasterDebug && DebugSegment; + break; + default: + ASSERT(false); + } + + if (use_debug) { + MessBufArea = kmalloc(kdebugheap, DEBUG_MESSAGE_BUFFER_SIZE, KMALLOC_MEMSET | KMALLOC_ALIGN_256, + "mess-buf"); + OutputBufArea = kmalloc(kdebugheap, DEBUG_OUTPUT_BUFFER_SIZE, + KMALLOC_MEMSET | KMALLOC_ALIGN_256, "output-buf"); + PrintBufArea = kmalloc(kdebugheap, DEBUG_PRINT_BUFFER_SIZE, KMALLOC_MEMSET | KMALLOC_ALIGN_256, + "print-buf"); + } else { + // no compiler connection, so we do not allocate buffers + MessBufArea = Ptr(0); + OutputBufArea = Ptr(0); + + // we still need a (small) print buffer for string maniuplation and debugging prints. + PrintBufArea = + kmalloc(kglobalheap, PRINT_BUFFER_SIZE, KMALLOC_MEMSET | KMALLOC_ALIGN_256, "print-buf"); + } +} + +/*! + * Empty output buffer (only if MasterDebug) + */ +void clear_output() { + if (MasterDebug) { + kstrcpy((char*)Ptr(OutputBufArea + sizeof(ListenerMessageHeader)).c(), ""); + OutputPending = Ptr(0); + } +} + +/*! + * Clear all data in the print buffer + */ +void clear_print() { + *Ptr(PrintBufArea + sizeof(ListenerMessageHeader)) = 0; + PrintPending = Ptr(0); +} + +/*! + * Buffer message to compiler indicating the target has reset. + * Write to the beginning of the output buffer. + */ +void reset_output() { + if (MasterDebug) { +// original GOAL: +// sprintf(OutputBufArea.cast().c() + sizeof(ListenerMessageHeader), "reset #x%x\n", +// s7.offset); + +// modified for OpenGOAL: +#ifdef _WIN32 + sprintf(OutputBufArea.cast().c() + sizeof(ListenerMessageHeader), + "reset #x%x #x%llx %s\n", s7.offset, (unsigned long long)g_ee_main_mem, // grr + xdbg::get_current_thread_id().to_string().c_str()); +#else + sprintf(OutputBufArea.cast().c() + sizeof(ListenerMessageHeader), "reset #x%x #x%lx %s\n", + s7.offset, (uintptr_t)g_ee_main_mem, xdbg::get_current_thread_id().to_string().c_str()); +#endif + OutputPending = OutputBufArea + sizeof(ListenerMessageHeader); + } +} + +/*! + * Buffer message to compiler indicating some object file has been unloaded. + * DONE, EXACT + */ +void output_unload(const char* name) { + if (MasterDebug) { + sprintf(strend(OutputBufArea.cast().c() + sizeof(ListenerMessageHeader)), + "unload \"%s\"\n", name); + OutputPending = OutputBufArea + sizeof(ListenerMessageHeader); + } +} + +/*! + * Buffer message to compiler indicating some object file has been loaded. + */ +void output_segment_load(const char* name, Ptr link_block, u32 flags) { + if (MasterDebug) { + char* buffer = strend(OutputBufArea.cast().c() + sizeof(ListenerMessageHeader)); + char true_str[] = "t"; + char false_str[] = "nil"; + char* flag_str = (flags & LINK_FLAG_OUTPUT_TRUE) ? true_str : false_str; + auto lbp = link_block.cast(); + // modified to also include segment sizes, and work from opengoal linker + // original game used link_block_v3's here. + sprintf(buffer, "load \"%s\" %s #x%x #x%x #x%x #x%x #x%x #x%x\n", name, flag_str, + lbp->code_infos[0].offset, lbp->code_infos[1].offset, lbp->code_infos[2].offset, + lbp->code_infos[0].size, lbp->code_infos[1].size, lbp->code_infos[2].size); + OutputPending = OutputBufArea + sizeof(ListenerMessageHeader); + } +} + +/*! + * Print to the GOAL print buffer from C + * seeks PrintPending to begining of what was just printed. + * This is a different behavior from all the other prints! + * DONE, EXACT + */ +void cprintf(const char* format, ...) { + va_list args; + va_start(args, format); + char* str = PrintPending.cast().c(); + if (!PrintPending.offset) + str = PrintBufArea.cast().c() + sizeof(ListenerMessageHeader); + PrintPending = make_ptr(strend(str)).cast(); + vsprintf((char*)PrintPending.c(), format, args); + + va_end(args); +} + +/*! + * Print directly to the C stdout + * The "k" parameter is ignored, so this is just like printf + * DONE, EXACT + */ +void Msg(s32 k, const char* format, ...) { + (void)k; + va_list args; + va_start(args, format); + vprintf(format, args); + va_end(args); +} + +/*! + * Print directly to the C stdout + * This is idential to Msg + * DONE, EXACT + */ +void MsgWarn(const char* format, ...) { + va_list args; + va_start(args, format); + vprintf(format, args); + va_end(args); +} + +/*! + * Print directly to the C stdout + * This is idential to Msg + * DONE, EXACT + */ +void MsgErr(const char* format, ...) { + va_list args; + va_start(args, format); + vprintf(format, args); + va_end(args); +} + +/*! + * Reverse string in place. + * DONE, EXACT + */ +void reverse(char* str) { + s32 i = 0; + s32 end = (s32)strlen(str); + while (end--, i < end) { + char c = str[i]; + str[i] = str[end]; + str[end] = c; + i++; + } +} + +/*! + * Some sort of rounding for printing floating point numbers. + * It is unused and believed to be not correct. + * Currently copy-pasta from GHIDRA + * (not checked in jak2) + */ +char* round(float x, s32* param1, char* start, char* sEnd, char padchar, s32* param4) { + char cVar1; + char* local_58; + float f; + + if (x == 0.00000000) { + f = padchar - '0'; + } else { + modff(x * 10.00000000, &f); + } + if (4.00000000 < f) { + while (true) { + if (*sEnd == '.') { + sEnd = sEnd + -1; + } + cVar1 = *sEnd; + *sEnd = cVar1 + 1; + if ((char)(cVar1 + 1) <= '9') { + return start; + } + *sEnd = '0'; + if (sEnd == start) + break; + sEnd = sEnd + -1; + } + if (param1 == (int*)0x0) { + sEnd[-1] = '1'; + local_58 = start + -1; + } else { + *sEnd = '1'; + *param1 = *param1 + 1; + local_58 = start; + } + } else { + local_58 = start; + if (*param4 == 0x2d) { + while (true) { + if (*sEnd == '.') { + sEnd = sEnd + -1; + } + local_58 = start; + if (*sEnd != '0') + break; + if (sEnd == start) { + *param4 = 0; + } + sEnd = sEnd + -1; + } + } + } + return local_58; +} + +/*! + * Convert floating point to string intermediate function. + * Places a null character as the first character, then the integers, decimal, fraction digits + * Presumably, if rounding worked, it would sometimes add an additional digit in front instead of + * the null but rounding doesn't, so you get a null in front every time. There is no null terminator + * added, you have to do it yourself. returned value is length : buff[last_char] - buff[1] (not + * including the leading null) if the number is negative, *lead_char = '-'. Otherwise it's '\0'. + * The negative is not inserted for you. + * The precision is how many digits after decimal to print. + * The flag could have a 1 to enable rounding, but this doesn't work, so don't use it. + * Without rounding the printing is a little bit off but you don't notice unless you look too + * closely. + * + * DONE, added some sanity checks and removed support for "rounding" as round isn't implemented and + * rounding is never used in the game. + * + * Not checked closely in jak 2. + */ +s32 cvt_float(float x, s32 precision, s32* lead_char, char* buff_start, char* buff_end, u32 flags) { + // put a null at the beginning of the output + *buff_start = 0; + s32 forward_count = 0; + + // compute absolute value and set lead char to `-` if needed. + float abs_x; + if (x < 0.0f) { + abs_x = -x; + *lead_char = '-'; + } else { + *lead_char = 0; + abs_x = x; + } + + // nan check + u32 abs_x_u32 = *(u32*)&abs_x; + if ((abs_x_u32 & 0x7fffffff) == 0x7fffffff) { + kstrcpy(buff_start, "NaN"); + return 3; // the length of NaN + } + + // find fraction and integer parts of absolute value. + float integer_part; + float fraction_part = std::modf(abs_x, &integer_part); + + char* start_ptr = buff_start + 1; // the null terminator is at buff_start[0]. + char* end_ptr = buff_end - 1; // the last char we can write to. + + // loop over integer digits (increasing significance) + while (start_ptr <= end_ptr && (integer_part != 0.0f)) { + // the fractional part will be the lowest place integer divided by 10 + float next_int = std::modf(integer_part / 10.f, &integer_part); + + // the float to round to get the integer + float rounder = next_int * 10.f + 0.5f; + + // but wait, the PS2 is stupid and maybe has weird floats that might not convert well. + // this checks for very large exponent or negative sign bit, which would only happen if the + // float is all messed up. + u32 ru32 = *(u32*)&rounder; + s32 value; + if (((ru32 >> 0x17) & 0xff) < 0x9e) { // exponent + value = (char)rounder; + } else if (!(ru32 >> 31)) { // sign bit + value = 0; + // ASSERT(false); // not sure what happens here. + } else { + value = -1; // happens on NaN's + } + + // place number at the end of the buffer and move pointer back + *end_ptr = '0' + value; + end_ptr--; + + // track how many integers we've written + forward_count++; + } + + char* count_chrp = start_ptr; // one after the buffer start (null) + if (forward_count == 0) { // no integers + *start_ptr = '0'; // put leading zero + count_chrp = buff_start + 2; // and set count to two after buffer start + } else { + while (end_ptr = end_ptr + 1, + end_ptr < buff_end) { // copy back to the beginning (will be in right order) + *count_chrp = *end_ptr; + count_chrp++; + } + } + + // if we have digits after decimal, place decimal. + if (precision) { + *count_chrp = '.'; + count_chrp++; + } + + s32 prec = precision; + + // if we have a fractional part, we may need to either print it, or do rounding. + if (fraction_part != 0.0f) { + prec = precision; + if (precision) { + // same loop as before, but only over the number of digits we actually want to print. + do { + float next_int; + fraction_part = std::modf(fraction_part * 10.f, &next_int); + u32 ru32 = *(u32*)&next_int; + s32 value; + if (((ru32 >> 0x17) & 0xff) < 0x9e) { + value = (char)next_int; + } else if (!(ru32 >> 0x1f)) { + value = 0; + // ASSERT(false); // not sure what happens here. + } else { + value = -1; // happens on NaN's + } + *count_chrp = value + '0'; + count_chrp++; + prec--; + } while ((prec) && (fraction_part != 0.f)); + } + + // if the rounding flag is enabled, we would round here. + // however, the rounding flag is always disabled and the rounding code doesn't work. + if ((fraction_part != 0.f) && ((flags & 1) != 0)) { + start_ptr = round(fraction_part, nullptr, start_ptr, count_chrp - 1, 0, lead_char); + ASSERT(false); + } + } + + // if there are any left over digits (fraction part = 0 before we got to the end), append zeros. + while (prec = prec - 1, prec != -1) { + *count_chrp = '0'; + count_chrp++; + } + // return length. not including the null character at the beginning. + return count_chrp - start_ptr; +} + +/*! + * Convert floating point to a string. + * Don't set the precision too high or you get NaN (if float is longer than 31 digits without + * negative sign) Don't set the flags. Rounding is a little bit off, but it adds character. Highly + * recommended to pad with spaces, not zeros. If you pad with spaces you get " -1.23" If you pad + * with zeros, you get "0000000-1.23" which most people consider to be wrong. + * @param out_str : output buffer to write null terminated string into + * @param x : number + * @param desired_len : length (will pad if under, nothing if over) + * @param pad_char : character to pad with + * @param precision + * @param flags + * + * DONE + * Not checked super closely in jak 2. + */ +void ftoa(char* out_str, float x, s32 desired_len, char pad_char, s32 precision, u32 flags) { + char buff[0x100]; + char* current_buff = buff; + s32 lead_char; + + // do conversion, but only write into the first half of the buffer (128 chars) + s32 count = cvt_float(x, precision, &lead_char, current_buff, buff + 0x7f, flags); + + // if it ends up larger than 31 characters, it's probably gone horribly wrong and we should just + // put NaN instead. Or maybe somebody requested a lot of precision. That would be stupid and they + // deserve to see NaN. + if (count > 0x3f) { + kstrcpy(current_buff, "NaN"); + count = 3; + lead_char = 0; + } + + // always true because we don't round, + if (buff[0] == 0) { + current_buff = buff + 1; + } + + // length, including the leading negative (if we need it). + s32 real_count = (lead_char != 0) + count; + + char* out_ptr = out_str; + + // pad + if ((desired_len > 0) && (desired_len > real_count)) { + for (s32 i = 0; i < (desired_len - real_count); i++) { + *out_ptr = pad_char; + out_ptr++; + } + } + + // leading + if (lead_char) { + *out_ptr = lead_char; + out_ptr++; + } + + // copy numbers + for (s32 i = 0; i < count; i++) { + *out_ptr = *current_buff; + out_ptr++; + current_buff++; + } + + // null terminate! + *out_ptr = 0; +} + +/*! + * Convert integer to string. + * @param buffer : buffer to print into. Must be at least as long as the longest possible number to + * print + * @param value : value to print. + * @param base : base to print in (2, 10, 16 supported) + * @param length : length. if shorter than length, pad with pad. If longer, only truncate leading + * f's 1's in base 16 or 2 + * @param pad : character to pad with + * @param flags : flag. Only the 2nd bit is used, which will disable negative sings on + * binary/hexadecimal truncated numbers. Something like -1 (0xffffffff) will print as -fffffff.... + * Not checked super closely in jak 2 + */ +char* kitoa(char* buffer, s64 value, u64 base, s32 length, char pad, u32 flag) { + s64 negativeValue = 0; + s64 value_to_print = value; + + // if negative and base ten, we print the opposite of the value and add a negative sign + if ((value < 0) && base == 10) { + negativeValue = value; + value_to_print = -value; + } + + // write number in reverse + int count = 0; + do { + buffer[count++] = ConvertTable[(u64)value_to_print % (u64)base]; + value_to_print = (u64)value_to_print / (u64)base; + } while (value_to_print); + + // append negative if we need to + if (negativeValue < 0) { + buffer[count++] = '-'; + } + + // pad (probably some sort of for loop) + s32 rLen = length; + if (0 < length - count) { + rLen = length - count; + while (0 < rLen) { + buffer[count++] = pad; + rLen--; + } + } + + // truncate f's / 1's + if (rLen > 0 && value < 0 && (base == 2 || base == 16) && rLen < count) { + char c = (base == 16) ? 'f' : '1'; + + while (rLen < count && (buffer[count - 1] == c)) { + count--; + } + + if (!(flag & 2)) { + buffer[count++] = '-'; + } + } + + // null terminate, reverse, return! + buffer[count] = 0; + reverse(buffer); + return buffer; +} + +/*! + * Convert 128-bit integer to string. Not implemented because it is never used in the game. + * It would also require passing 128-bit values between GOAL and C++ and this is not worth + * implementing. It is only used by the "format" function, which cannot use it properly. "format" + * uses C varags, but 128-bit varags don't work, so "format" always passes 0 for quadword printing. + */ +void kqtoa() { + ASSERT(false); +} \ No newline at end of file diff --git a/game/kernel/kprint.h b/game/kernel/common/kprint.h similarity index 90% rename from game/kernel/kprint.h rename to game/kernel/common/kprint.h index 6364ab3e2c..515f7f1c39 100644 --- a/game/kernel/kprint.h +++ b/game/kernel/common/kprint.h @@ -1,20 +1,8 @@ #pragma once -/*! - * @file kprint.h - * GOAL Print. Contains GOAL I/O, Print, Format... - */ - -#ifndef RUNTIME_KPRINT_H -#define RUNTIME_KPRINT_H - -#include "kmachine.h" - -constexpr u32 DEBUG_MESSAGE_BUFFER_SIZE = 0x80000; -constexpr u32 DEBUG_OUTPUT_BUFFER_SIZE = 0x80000; -constexpr u32 DEBUG_PRINT_BUFFER_SIZE = 0x200000; -constexpr u32 PRINT_BUFFER_SIZE = 0x2000; +#include "common/common_types.h" +#include "game/kernel/common/Ptr.h" /////////// // SDATA /////////// @@ -23,14 +11,25 @@ extern Ptr PrintPending; extern s32 MessCount; extern char AckBufArea[40]; +extern char ConvertTable[16]; // todo rm extern Ptr MessBufArea; extern Ptr OutputBufArea; extern Ptr PrintBufArea; -/*! - * Initialize global variables for kprint - */ -void kprint_init_globals(); +constexpr u32 DEBUG_MESSAGE_BUFFER_SIZE = 0x80000; +constexpr u32 DEBUG_OUTPUT_BUFFER_SIZE = 0x80000; +constexpr u32 DEBUG_PRINT_BUFFER_SIZE = 0x200000; +constexpr u32 PRINT_BUFFER_SIZE = 0x2000; + +struct format_struct { + char data[0x40]; + void reset() { + for (auto& c : data) + c = -1; + } +}; + +void kprint_init_globals_common(); /*! * Initialize GOAL Kernel printing/messaging system. @@ -76,6 +75,11 @@ void cprintf(const char* format, ...) __attribute__((format(printf, 1, 2))); void cprintf(const char* format, ...); #endif +/*! + * Reverse string in place. + */ +void reverse(char* s); + #ifdef __linux__ /*! * Print directly to the C stdout @@ -103,7 +107,6 @@ void MsgWarn(const char* format, ...) __attribute__((format(printf, 1, 2))); */ void MsgWarn(const char* format, ...); #endif - #ifdef __linux__ /*! * Print directly to the C stdout @@ -118,11 +121,6 @@ void MsgErr(const char* format, ...) __attribute__((format(printf, 1, 2))); void MsgErr(const char* format, ...); #endif -/*! - * Reverse string in place. - */ -void reverse(char* s); - /*! * Helper function for floating point to string conversion. */ @@ -143,10 +141,4 @@ char* kitoa(char* buffer, s64 value, u64 base, s32 length, char pad, u32 flag); * The format function does have the ability to call it, but it always passes a zero because * getting a 128-bit integer in PS2 gcc's varargs doesn't work. */ -void kqtoa(); - -extern "C" { -s32 format_impl(uint64_t* args); -} - -#endif // RUNTIME_KPRINT_H +void kqtoa(); \ No newline at end of file diff --git a/game/kernel/common/kscheme.cpp b/game/kernel/common/kscheme.cpp new file mode 100644 index 0000000000..a701696ec3 --- /dev/null +++ b/game/kernel/common/kscheme.cpp @@ -0,0 +1,289 @@ +#include "kscheme.h" + +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/kmalloc.h" +#include "game/kernel/common/kprint.h" + +// total number of symbols in the table +s32 NumSymbols; + +// value of the GOAL s7 register, pointing to the middle of the symbol table +Ptr s7; + +// used for crc32 calculation +u32 crc_table[0x100]; + +// pointer to the "second" symbol table +Ptr SymbolTable2; + +// pointer to the last symbol +Ptr LastSymbol; + +//! Controls link mode when EnableMethodSet = 0, MasterDebug = 1, DiskBoot = 0. Will enable a +//! warning message if EnableMethodSet = 1 +u32 FastLink; + +// set to true to enable propagating method overrides to child types +// this is an O(N_max_symbols) operation, so it is avoided when loading DGOs for levels. +// but is enabled when loading the engine. +Ptr EnableMethodSet; + +void kscheme_init_globals_common() { + SymbolTable2.offset = 0; + LastSymbol.offset = 0; + NumSymbols = 0; + s7.offset = 0; + for (auto& x : crc_table) { + x = 0; + } + EnableMethodSet.offset = 0; + FastLink = 0; +} + +/*! + * Initialize CRC Table. + */ +void init_crc() { + for (u32 i = 0; i < 0x100; i++) { + u32 n = i << 24; + for (u32 j = 0; j < 8; j++) { + n = n & 0x80000000 ? (n << 1) ^ CRC_POLY : (n << 1); + } + crc_table[i] = n; + } +} + +/*! + * Take the CRC32 hash of some data + */ +u32 crc32(const u8* data, s32 size) { + uint32_t crc = 0; + for (int i = size; i != 0; i--, data++) { + crc = crc_table[crc >> 24] ^ ((crc << 8) | *data); + } + + ASSERT(~crc); + return ~crc; +} + +/*! + * Delete method for types which cannot have "delete" used on them. + * Prints an error to stdout and returns false. + */ +u64 delete_illegal(u32 obj) { + MsgErr("dkernel: illegal attempt to call delete method of static object @ #x%x\n", obj); + return s7.offset; // todo, maybe don't return anything? +} + +/*! + * Wrapper around kmalloc to allow GOAL programs to allocate on kernel heaps. + */ +u64 goal_malloc(u32 heap, u32 size, u32 flags, u32 name) { + return kmalloc(Ptr(heap), size, flags, Ptr(name)->data()).offset; +} + +extern "C" { +// defined in asm_funcs.asm +#ifdef __linux__ +uint64_t _call_goal_asm_linux(u64 a0, u64 a1, u64 a2, void* fptr, void* st_ptr, void* offset); +uint64_t _call_goal_on_stack_asm_linux(u64 rsp, + u64 u0, + u64 u1, + void* fptr, + void* st_ptr, + void* offset); +#elif _WIN32 +uint64_t _call_goal_asm_win32(u64 a0, u64 a1, u64 a2, void* fptr, void* st_ptr, void* offset); +uint64_t _call_goal_on_stack_asm_win32(u64 rsp, void* fptr, void* st_ptr, void* offset); +#endif +} + +/*! + * Wrapper around _call_goal_asm for calling a GOAL function from C. + * Calls from the parent stack. + */ +u64 call_goal(Ptr f, u64 a, u64 b, u64 c, u64 st, void* offset) { + // auto st_ptr = (void*)((uint8_t*)(offset) + st); updated for the new compiler! + void* st_ptr = (void*)st; + + void* fptr = f.c(); +#ifdef __linux__ + return _call_goal_asm_linux(a, b, c, fptr, st_ptr, offset); +#elif _WIN32 + return _call_goal_asm_win32(a, b, c, fptr, st_ptr, offset); +#endif +} + +/*! + * Wrapper around _call_goal_asm_on_stack for switching stacks and calling a GOAL function there. + */ +u64 call_goal_on_stack(Ptr f, u64 rsp, u64 st, void* offset) { + void* st_ptr = (void*)st; + + void* fptr = f.c(); +#ifdef __linux__ + return _call_goal_on_stack_asm_linux(rsp, 0, 0, fptr, st_ptr, offset); +#elif _WIN32 + return _call_goal_on_stack_asm_win32(rsp, fptr, st_ptr, offset); +#endif +} + +/*! + * Call a GOAL function with no arguments. + */ +u64 call_goal_function(Ptr func) { + return call_goal(func, 0, 0, 0, s7.offset, g_ee_main_mem); +} + +/*! + * Default print method for structures. + * Structures have no runtime type info, so there's not much we can do here. + */ +u64 print_structure(u32 s) { + cprintf("#", s); + return s; +} + +/*! + * Print an integer. Works correctly for 64-bit integers. + */ +u64 print_integer(u64 obj) { + // not sure why this is any better than cprintf("%ld") or similar. Maybe a tiny bit faster? + char* str = PrintPending.cast().c(); + if (!str) { + str = (PrintBufArea + 0x18).cast().c(); + } + + PrintPending = make_ptr(strend(str)).cast(); + kitoa((char*)PrintPending.c(), obj, 10, 0xffffffff, '0', 0); + return obj; +} + +/*! + * Print a boxed integer. Works correctly for 64-bit integers. Assumes signed. + */ +u64 print_binteger(u64 obj) { + char* str = PrintPending.cast().c(); + if (!PrintPending.offset) { + str = (PrintBufArea + 0x18).cast().c(); + } + + PrintPending = make_ptr(strend(str)).cast(); + kitoa((char*)PrintPending.c(), ((s64)obj) >> 3, 10, 0xffffffff, '0', 0); + return obj; +} + +/*! + * Print floating point number. + */ +u64 print_float(u32 f) { + // again not sure why this is any better than cprintf("%f") or similar. Maybe a tiny bit faster? + float ff; + *(u32*)&ff = f; + char* str = PrintPending.cast().c(); + if (!PrintPending.offset) { + str = (PrintBufArea + 0x18).cast().c(); + } + + PrintPending = make_ptr(strend(str)).cast(); + + ftoa((char*)PrintPending.c(), ff, 0xffffffff, ' ', 4, 0); + return f; +} + +/*! + * Print method for VU functions. Again, just prints address. + */ +u64 print_vu_function(u32 obj) { + cprintf("#", obj); + return obj; +} + +/*! + * Copy method that does no copying. + */ +u64 copy_fixed(u32 it) { + return it; +} + +/*! + * Default copy for a structure. Since this has no idea of the actual type, it doesn't know what + * size to copy. So we do no copy and return a reference to the original data. + */ +u64 copy_structure(u32 it, u32 unknown) { + (void)unknown; + return it; +} + +/*! + * Inspect an integer (works correctly on 64-bit integers) + */ +u64 inspect_integer(u64 obj) { + // and now we're using cprintf. Why doesn't print do this? + cprintf("[%16lx] fixnum %ld\n", obj, obj); + return obj; +} + +/*! + * Inspect a boxed integer (works correctly on 64-integers) + */ +u64 inspect_binteger(u64 obj) { + cprintf("[%16lx] boxed-fixnum %ld\n", obj, s64(obj) >> 3); + return obj; +} + +/*! + * Inspect a floating point number + */ +u64 inspect_float(u32 f) { + float ff; + ff = *(float*)(&f); + cprintf("[%8x] float ", f); + + // likely copy-pasta - no need for this check because of the cprintf immediately before. + char* str = PrintPending.cast().c(); + if (!str) { + str = (PrintBufArea + 0x18).cast().c(); + } + + PrintPending = make_ptr(strend(str)).cast(); + + ftoa(PrintPending.cast().c(), ff, -1, ' ', 4, 0); + cprintf("\n"); + return f; +} + +/*! + * Inspect a structure. + */ +u64 inspect_structure(u32 obj) { + cprintf("[%8x] structure\n", obj); + return obj; +} + +/*! + * Inspect a VU Function. Doesn't seem to be used. Also the concept of "vu-function" + * isn't really used. VU0 macro mode stuff goes in normal functions, and micro-mode stuff goes + * in a giant dump of many functions thats loaded and unloaded all at the same time. + */ +u64 inspect_vu_function(u32 obj) { + struct VuFunction { + u32 length; + u32 origin; + u32 qlength; + }; + + auto vf = Ptr(obj); + cprintf("[%8x] vu-function\n\tlength: %d\n\torigin: #x%x\n\tqlength: %d\n", obj, vf->length, + vf->origin, vf->qlength); + return obj; +} + +/*! + * This doesn't exist in the game, but we add it as a wrapper around kheapstatus. + * Note that this isn't a great inspect as it prints to stdout instead of the printbuffer. + */ +u64 inspect_kheap(u32 obj) { + kheapstatus(Ptr(obj)); + return obj; +} \ No newline at end of file diff --git a/game/kernel/common/kscheme.h b/game/kernel/common/kscheme.h new file mode 100644 index 0000000000..b78d1e759a --- /dev/null +++ b/game/kernel/common/kscheme.h @@ -0,0 +1,49 @@ +#pragma once + +#include "common/common_types.h" + +#include "game/kernel/common/Ptr.h" + +extern s32 NumSymbols; +extern Ptr s7; +extern Ptr SymbolTable2; +extern Ptr LastSymbol; +extern u32 FastLink; +extern Ptr EnableMethodSet; + +void kscheme_init_globals_common(); + +constexpr u32 CRC_POLY = 0x04c11db7; +constexpr u32 EMPTY_HASH = 0x8454B6E6; +constexpr u32 OFFSET_MASK = 7; + +constexpr uint32_t UNKNOWN_PP = UINT32_MAX; + +struct String { + u32 len; + char* data() { return ((char*)this) + sizeof(String); } +}; + +struct Function {}; + +void init_crc(); +u32 crc32(const u8* data, s32 size); +u64 delete_illegal(u32 obj); +u64 goal_malloc(u32 heap, u32 size, u32 flags, u32 name); + +u64 call_goal(Ptr f, u64 a, u64 b, u64 c, u64 st, void* offset); +u64 call_goal_on_stack(Ptr f, u64 rsp, u64 st, void* offset); +u64 call_goal_function(Ptr func); +u64 print_structure(u32 s); +u64 print_integer(u64 obj); +u64 print_binteger(u64 obj); +u64 print_float(u32 f); +u64 print_vu_function(u32 obj); +u64 copy_fixed(u32 it); +u64 copy_structure(u32 it, u32 unknown); +u64 inspect_integer(u64 obj); +u64 inspect_binteger(u64 obj); +u64 inspect_float(u32 f); +u64 inspect_structure(u32 obj); +u64 inspect_vu_function(u32 obj); +u64 inspect_kheap(u32 obj); \ No newline at end of file diff --git a/game/kernel/ksocket.cpp b/game/kernel/common/ksocket.cpp similarity index 93% rename from game/kernel/ksocket.cpp rename to game/kernel/common/ksocket.cpp index 34322c2250..cf6042eca4 100644 --- a/game/kernel/ksocket.cpp +++ b/game/kernel/common/ksocket.cpp @@ -1,15 +1,8 @@ -/*! - * @file ksocket.cpp - * GOAL Socket connection to listener using DECI2/DSNET - * DONE! - */ - #include "ksocket.h" -#include "kdsnetm.h" -#include "kprint.h" -#include "kboot.h" -#include "fileio.h" -#include "klisten.h" + +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/kdsnetm.h" +#include "game/kernel/common/kprint.h" /*! * Update GOAL message header after receiving and verify message is ok. diff --git a/game/kernel/ksocket.h b/game/kernel/common/ksocket.h similarity index 74% rename from game/kernel/ksocket.h rename to game/kernel/common/ksocket.h index 41397ff1a7..fd7d51e7bd 100644 --- a/game/kernel/ksocket.h +++ b/game/kernel/common/ksocket.h @@ -1,16 +1,17 @@ #pragma once -/*! - * @file ksocket.h - * GOAL Socket connection to listener using DECI2/DSNET - */ - -#ifndef JAK_KSOCKET_H -#define JAK_KSOCKET_H - #include "common/common_types.h" -#include "kmachine.h" -#include "Ptr.h" + +#include "game/kernel/common/Ptr.h" + +/*! + * Update GOAL message header after receiving and verify message is ok. + * Return the size of the message in bytes (not including DECI or GOAL headers) + * Return -1 on error. + * The buffer parameter is unused. + * DONE, removed call to FlushCache(0); + */ +u32 ReceiveToBuffer(char* buff); /*! * Update GOAL message header after receiving and verify message is ok. @@ -48,6 +49,4 @@ Ptr WaitForMessageAndAck(); /*! * Doesn't close anything, just print a closed message. */ -void CloseListener(); - -#endif // JAK_KSOCKET_H +void CloseListener(); \ No newline at end of file diff --git a/game/kernel/common/ksound.cpp b/game/kernel/common/ksound.cpp new file mode 100644 index 0000000000..35d49e4329 --- /dev/null +++ b/game/kernel/common/ksound.cpp @@ -0,0 +1,27 @@ +#include "ksound.h" + +#include "common/common_types.h" + +#include "game/overlord/srpc.h" +#include "game/sound/989snd/ame_handler.h" + +/*! + * Does nothing! + */ +void InitSound() {} + +/*! + * Does nothing! + */ +void ShutdownSound() {} + +/*! + * PC port functions + */ +void set_flava_hack(u64 val) { + snd::SoundFlavaHack = val; +} + +void set_fade_hack(u64 val) { + gMusicFadeHack = val; +} diff --git a/game/kernel/common/ksound.h b/game/kernel/common/ksound.h new file mode 100644 index 0000000000..2e167338a7 --- /dev/null +++ b/game/kernel/common/ksound.h @@ -0,0 +1,7 @@ +#pragma once +#include "common/common_types.h" + +void InitSound(); +void ShutdownSound(); +void set_flava_hack(u64 val); +void set_fade_hack(u64 val); \ No newline at end of file diff --git a/game/kernel/common/memory_layout.h b/game/kernel/common/memory_layout.h new file mode 100644 index 0000000000..2a808d7f85 --- /dev/null +++ b/game/kernel/common/memory_layout.h @@ -0,0 +1,31 @@ +#pragma once + +#include "common/common_types.h" + +//! Toggle to use more memory. To simulate the original game's memory layout, set this to false. +// Make sure this matches the const in gcommon.gc. +constexpr bool BIG_MEMORY = true; + +//! How much space to leave for the stack when creating the debug heap +// In the game, it's 16 kB, but we increase it to 64 kB. +// ASAN builds + fmt stuff uses a _ton_ of stack when no optimizations are on and we +// need more. +constexpr u32 DEBUG_HEAP_SPACE_FOR_STACK = 0x10000; + +//! First free address for the GOAL heap +constexpr u32 HEAP_START = 0x13fd20; + +//! Where to end the global heap so it doesn't overlap with the stack. +constexpr u32 GLOBAL_HEAP_END = 0x1ffc000 + (BIG_MEMORY ? (0x1ffc000 - HEAP_START) : 0); // doubled + +//! Location of kglobalheap, kdebugheap kheapinfo structures. +constexpr u32 GLOBAL_HEAP_INFO_ADDR = 0x13AD00; +constexpr u32 DEBUG_HEAP_INFO_ADDR = 0x13AD10; +constexpr u32 LINK_CONTROL_NAME_ADDR = 0x13AD80; + +//! Where to place the debug heap +constexpr u32 DEBUG_HEAP_START = 0x5000000; + +namespace jak2 { +constexpr u32 DEBUG_HEAP_SIZE = 0x2f00000; +} \ No newline at end of file diff --git a/game/kernel/fileio.cpp b/game/kernel/jak1/fileio.cpp similarity index 50% rename from game/kernel/fileio.cpp rename to game/kernel/jak1/fileio.cpp index 6070d2255c..f491a54807 100644 --- a/game/kernel/fileio.cpp +++ b/game/kernel/jak1/fileio.cpp @@ -1,233 +1,14 @@ -/*! - * @file fileio.cpp - * GOAL Low-Level File I/O and String Utilities - * DONE! - */ - -#include -#include -#include "game/sce/sif_ee.h" #include "fileio.h" -#include "kprint.h" + +#include +#include + #include "common/versions.h" -#include "common/util/Assert.h" -namespace { -// buffer for file paths. This might be static char buffer[512]. Maybe 633 is the line number? -char buffer_633[512]; -} // namespace +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/kmalloc.h" -void fileio_init_globals() { - memset(buffer_633, 0, 512); -} - -using namespace ee; - -/*! - * Return pointer to null terminator of string. - * const is for losers. - * DONE, EXACT - */ -char* strend(char* str) { - while (*str) - str++; - return str; -} - -/*! - * An implementation of Huffman decoding. - * In this limited decoder, your data must have lower two bits equal to zero. - * @param loc_ptr pointer to pointer to data to read (will be modified to point to next word) - * @return decoded word - * UNUSED, EXACT - */ -u32 ReadHufWord(u8** loc_ptr) { - u8* loc = *loc_ptr; // pointer to data to read - u32 value = *(u32*)loc; // read word - u8* next_loc = loc + 1; // next data to read - u32 length = value & 3; // length of word is stored in lower two bits. - switch (length) { - case 0: // already all set. - break; - - case 1: - value = (value & 0xfc) | (loc[1] << 8); - next_loc = loc + 2; - break; - - case 2: - value = (value & 0xfc) | (loc[1] << 8) | (loc[2] << 0x10); - next_loc = loc + 3; - break; - - case 3: - value = (value & 0xfc) | (loc[1] << 8) | (loc[2] << 0x10) | (loc[3] << 0x18); - next_loc = loc + 4; - break; - - default: - ASSERT(false); - } - - // update location pointer - *loc_ptr = next_loc; - return value; -} - -/*! - * Copy a string from src to dst. The null terminator is copied too. - * This is identical to normal strcpy. - * DONE, EXACT - */ -void kstrcpy(char* dst, const char* src) { - char* dst_ptr = dst; - const char* src_ptr = src; - - while (*src_ptr != 0) { - *dst_ptr = *src_ptr; - src_ptr++; - dst_ptr++; - } - *dst_ptr = 0; -} - -/*! - * Copy a string from src to dst, making all letters upper case. - * The null terminator is copied too. - * DONE, EXACT - */ -void kstrcpyup(char* dst, const char* src) { - while (*src) { - char c = *src; - if (c >= 'a' && c <= 'z') { // A-Z,a-z - c -= 0x20; - } - *dst = c; - dst++; - src++; - } - *dst = 0; -} - -/*! - * Concatenate two strings. Src is added to dest. - * The new string is null terminated. No bounds checking is done. - * DONE, EXACT - */ -void kstrcat(char* dest, const char* src) { - // seek to end of first string - while (*dest) { - dest++; - } - // copy second string - while (*src) { - *dest = *src; - src++; - dest++; - } - // null terminate - *dest = 0; -} - -/*! - * Concatenate two strings with a maximum length for the resulting string - * The maximum length should be larger than the length of the original string. - * The resulting string will be truncated when it reaches the given length. - * The null terminator is added, but doesn't count toward the length. - * DONE, EXACT - */ -void kstrncat(char* dest, const char* src, s32 count) { - // seek to null terminator of first string, count length - s32 i = 0; - while (*dest) { - dest++; - i++; - } - - // append second string, not exceeding length - while (*src && (i < count)) { - *dest = *src; - src++; - dest++; - i++; - } - - // null terminate - *dest = 0; -} - -/*! - * Insert the pad char at the beginning of a string, count times. - * DONE, EXACT - */ -char* kstrinsert(char* str, char pad, s32 count) { - // shift string+null terminator to the right. - s32 len = strlen(str); - while (len > -1) { - str[len + count] = str[len]; - len--; - } - - // pad - len = 0; - while (len < count) { - str[len++] = pad; - } - return str; -} - -/*! - * Get filename from path. - * This function is renamed to basename_goal so it doesn't conflict with "basename" that is - * already defined on my computer. - * For example: - * a/b/c.e will return c.e - * a\b\c.e will return c.e - * asdf.asdf will return asdf.asdf - * DONE, EXACT - */ -char* basename_goal(char* s) { - char* input = s; - char* pt = s; - - // seek to end - for (;;) { - char c = *pt; - if (c) { - pt++; - } else { - break; - } - } - - /* Original code, has memory bug. - // back up... - for (;;) { - if (pt < input) { - return input; - } - pt--; - char c = *pt; - // until we hit a slash. - if (c == '\\' || c == '/') { // slashes - return pt + 1; // and return one past - } - } - */ - - // back up... - for (;;) { - if (pt <= input) { - return input; - } - pt--; - char c = *pt; - // until we hit a slash. - if (c == '\\' || c == '/') { // slashes - return pt + 1; // and return one past - } - } -} +namespace jak1 { /*! * Turn file name into file's path. @@ -278,7 +59,7 @@ char* DecodeFileName(const char* name) { * PC PORT NOTE : Changed some paths so that they work for us (namely, got rid of 'host') */ char* MakeFileName(int type, const char* name, int new_string) { - using namespace versions; + using namespace versions::jak1; // start with network filesystem // kstrcpy(buffer_633, "host:"); kstrcpy(buffer_633, ""); @@ -404,122 +185,4 @@ char* MakeFileName(int type, const char* name, int new_string) { return result; } -/*! - * Does the file exist? No. It doesn't. - * @return 0 always, even if the file exists. - * DONE, EXACT, UNUSED - */ -u32 FileExists(const char* name) { - (void)name; - return 0; -} - -/*! - * Does nothing. Likely is supposed to delete a file. - * @param name - * DONE, EXACT, UNUSED - */ -void FileDelete(const char* name) { - (void)name; -} - -/*! - * Does nothing. Likely is supposed to copy a file. - * @param a - * @param b - * DONE, EXACT, UNUSED - */ -void FileCopy(const char* a, const char* b) { - (void)a; - (void)b; -} - -/*! - * Determine the file length in bytes. - * DONE, EXACT - */ -s32 FileLength(char* filename) { - s32 fd = sceOpen(filename, SCE_RDONLY); - if (fd < 0) { - MsgErr("dkernel: file length !open \'%s\' (%d)\n", filename, fd); - sceClose(fd); - return 0xfffffffb; - } else { - s32 rv = sceLseek(fd, 0, SCE_SEEK_END); - sceClose(fd); - return rv; - } -} - -/*! - * Load a file into memory - * @param name : file name - * @param heap : heap to allocate into, if memory is null - * @param memory : memory to load into. If null, allocates on the given kheap (with 64 extra bytes) - * @param malloc_flags : flags for the kmalloc - * @param size_out : file size is written here, if it's not null - * @return pointer to file data - * DONE, EXACT - */ -Ptr FileLoad(char* name, Ptr heap, Ptr memory, u32 malloc_flags, s32* size_out) { - s32 fd = sceOpen(name, SCE_RDONLY); - if (fd < 0) { - MsgErr("dkernel: file read !open \'%s\' (%d)\n", name, fd); - sceClose(fd); - return Ptr(0xfffffffb); - } - - // determine size - s32 initial_pos = sceLseek(fd, 0, SCE_SEEK_CUR); - s32 size = sceLseek(fd, 0, SCE_SEEK_END); - sceLseek(fd, initial_pos, SCE_SEEK_SET); - - if (size > 0) { - if (memory.offset == 0) { - memory = kmalloc(heap, size + 0x40, malloc_flags, name); - } - if (memory.offset == 0) { - MsgErr("dkernel: mem full for file read: '%s' (%d bytes)\n", name, size); - return Ptr(0xfffffffd); - } - - s32 read_amount = sceRead(fd, memory.c(), size); - if (read_amount == size) { - sceClose(fd); - if (size_out) - *size_out = size; - return memory; - } else { - MsgErr("dkernel: can't read full file (%d of %d): '%s'\n", read_amount, size, name); - sceClose(fd); - return Ptr(0xfffffffb); - } - } else { - return Ptr(0); - } -} - -/*! - * Write a file. - * DONE, EXACT - */ -s32 FileSave(char* name, u8* data, s32 size) { - s32 fd = sceOpen(name, SCE_WRONLY | SCE_TRUNC | SCE_CREAT); - if (fd < 0) { - MsgErr("dkernel: file write !open '%s'\n", name); - sceClose(fd); - return 0xfffffffa; - } - - if (size != 0) { - s32 written = sceWrite(fd, data, size); - if (written != size) { - MsgErr("dkernel: can't write full file '%s'\n", name); - sceClose(fd); - return 0xfffffffa; - } - } - - sceClose(fd); - return 0; -} +} // namespace jak1 diff --git a/game/kernel/jak1/fileio.h b/game/kernel/jak1/fileio.h new file mode 100644 index 0000000000..4daad7a1e1 --- /dev/null +++ b/game/kernel/jak1/fileio.h @@ -0,0 +1,6 @@ +#pragma once + +namespace jak1 { +char* MakeFileName(int type, const char* name, int new_string); +char* DecodeFileName(const char* name); +} // namespace jak1 \ No newline at end of file diff --git a/game/kernel/kboot.cpp b/game/kernel/jak1/kboot.cpp similarity index 79% rename from game/kernel/kboot.cpp rename to game/kernel/jak1/kboot.cpp index ef65bef02e..029b524af6 100644 --- a/game/kernel/kboot.cpp +++ b/game/kernel/jak1/kboot.cpp @@ -4,66 +4,32 @@ * DONE! */ -#include +#include "kboot.h" + #include +#include #include #include #include #include "common/common_types.h" #include "common/util/Timer.h" -#include "game/common/game_common_types.h" -#include "game/sce/libscf.h" -#include "kboot.h" -#include "kmachine.h" -#include "kscheme.h" -#include "ksocket.h" -#include "klisten.h" -#include "kprint.h" -#ifdef _WIN32 -#include "Windows.h" -#include -#elif __linux__ -#include -#endif +#include "game/common/game_common_types.h" +#include "game/kernel/common/klisten.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/common/kscheme.h" +#include "game/kernel/common/ksocket.h" +#include "game/kernel/jak1/klisten.h" +#include "game/kernel/jak1/kmachine.h" +#include "game/sce/libscf.h" using namespace ee; -// Level to load on boot -char DebugBootLevel[64]; +namespace jak1 { +VideoMode BootVideoMode; -// Pass to GOAL kernel on boot -char DebugBootMessage[64]; - -// game configuration -MasterConfig masterConfig; - -// Set to 1 to kill GOAL kernel -u32 MasterExit; - -// Set to 1 to enable debug heap -u32 MasterDebug; - -// Set to 1 to load debug code -u32 DebugSegment; - -// Set to 1 to load game engine after boot automatically -u32 DiskBoot; - -u32 MasterUseKernel; - -void kboot_init_globals() { - strcpy(DebugBootLevel, "#f"); // no specified level - strcpy(DebugBootMessage, "play"); // play mode, the default retail mode - - MasterExit = 0; - MasterDebug = 1; - MasterUseKernel = 1; - DebugSegment = 1; - DiskBoot = 0; - memset(&masterConfig, 0, sizeof(MasterConfig)); -} +void kboot_init_globals() {} /*! * Launch the GOAL Kernel (EE). @@ -118,9 +84,6 @@ s32 goal_main(int argc, const char* const* argv) { masterConfig.aspect = SCE_ASPECT_FULL; } - // Added - the territory is originally hardcoded. this allows us to change it whenever. - masterConfig.territory = GAME_TERRITORY_SCEA; - // In retail game, disable debugging modes, and force on DiskBoot // MasterDebug = 0; // DiskBoot = 1; @@ -144,7 +107,7 @@ s32 goal_main(int argc, const char* const* argv) { void KernelCheckAndDispatch() { u64 goal_stack = u64(g_ee_main_mem) + EE_MAIN_MEM_SIZE - 8; - while (!MasterExit) { + while (MasterExit == RuntimeExitStatus::RUNNING) { // try to get a message from the listener, and process it if needed Ptr new_message = WaitForMessageAndAck(); if (new_message.offset) { @@ -198,5 +161,6 @@ void KernelCheckAndDispatch() { * DONE, EXACT */ void KernelShutdown() { - MasterExit = 2; // GOAL Kernel Dispatch loop will stop now. + MasterExit = RuntimeExitStatus::EXIT; // GOAL Kernel Dispatch loop will stop now. } +} // namespace jak1 \ No newline at end of file diff --git a/game/kernel/jak1/kboot.h b/game/kernel/jak1/kboot.h new file mode 100644 index 0000000000..cf1c452d67 --- /dev/null +++ b/game/kernel/jak1/kboot.h @@ -0,0 +1,41 @@ +#pragma once + +/*! + * @file kboot.h + * GOAL Boot. Contains the "main" function to launch GOAL runtime. + */ + +#include "common/common_types.h" + +#include "game/kernel/common/kboot.h" + +namespace jak1 { + +// Video Mode that's set based on display refresh rate on boot +extern VideoMode BootVideoMode; + +/*! + * Initialize global variables for kboot + */ +void kboot_init_globals(); + +/*! + * Launch the GOAL Kernel (EE). + * See InitParms for launch argument details. + * @param argc : argument count + * @param argv : argument list + * @return 0 on success, otherwise failure. + */ +s32 goal_main(int argc, const char* const* argv); + +/*! + * Run the GOAL Kernel. + */ +void KernelCheckAndDispatch(); + +/*! + * Stop running the GOAL Kernel. + */ +void KernelShutdown(); + +} // namespace jak1 diff --git a/game/kernel/jak1/kdgo.cpp b/game/kernel/jak1/kdgo.cpp new file mode 100644 index 0000000000..f165b7556e --- /dev/null +++ b/game/kernel/jak1/kdgo.cpp @@ -0,0 +1,93 @@ +#include "kdgo.h" + +#include "common/common_types.h" +#include "common/log/log.h" + +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/kdgo.h" +#include "game/kernel/common/kmalloc.h" +#include "game/kernel/jak1/klink.h" + +namespace jak1 { +/*! + * Load and link a DGO file. + * This does not use the mutli-threaded linker and will block until the entire file is done. + */ +void load_and_link_dgo(u64 name_gstr, u64 heap_info, u64 flag, u64 buffer_size) { + auto name = Ptr(name_gstr + 4).c(); + auto heap = Ptr(heap_info); + load_and_link_dgo_from_c(name, heap, flag, buffer_size, false); +} + +/*! + * Load and link a DGO file. + * This does not use the mutli-threaded linker and will block until the entire file is done.e + */ +void load_and_link_dgo_from_c(const char* name, + Ptr heap, + u32 linkFlag, + s32 bufferSize, + bool jump_from_c_to_goal) { + lg::debug("[Load and Link DGO From C] {}", name); + u32 oldShowStall = sShowStallMsg; + + // remember where the heap top point is so we can clear temporary allocations + auto oldHeapTop = heap->top; + + // allocate temporary buffers from top of the given heap + // align 64 for IOP DMA + // note: both buffers named dgo-buffer-2 + auto buffer2 = kmalloc(heap, bufferSize, KMALLOC_TOP | KMALLOC_ALIGN_64, "dgo-buffer-2"); + auto buffer1 = kmalloc(heap, bufferSize, KMALLOC_TOP | KMALLOC_ALIGN_64, "dgo-buffer-2"); + + // build filename. If no extension is given, default to CGO. + char fileName[16]; + kstrcpyup(fileName, name); + if (fileName[strlen(fileName) - 4] != '.') { + strcat(fileName, ".CGO"); + } + + // no stall messages, as this is a blocking load and when spending 100% CPU time on linking, + // the linker can beat the DVD drive. + sShowStallMsg = 0; + + // start load on IOP. + BeginLoadingDGO( + fileName, buffer1, buffer2, + Ptr((heap->current + 0x3f).offset & 0xffffffc0)); // 64-byte aligned for IOP DMA + + u32 lastObjectLoaded = 0; + while (!lastObjectLoaded) { + // check to see if next object is loaded (I believe it always is?) + auto dgoObj = GetNextDGO(&lastObjectLoaded); + if (!dgoObj.offset) { + continue; + } + + // if we're on the last object, it is loaded at cheap->current. So we can safely reset the two + // dgo-buffer allocations. We do this _before_ we link! This way, the last file loaded has more + // heap available, which is important when we need to use the entire memory. + if (lastObjectLoaded) { + heap->top = oldHeapTop; + } + + // determine the size and name of the object we got + auto obj = dgoObj + 0x40; // seek past dgo object header + u32 objSize = *(dgoObj.cast()); // size from object's link block + + char objName[64]; + strcpy(objName, (dgoObj + 4).cast().c()); // name from dgo object header + lg::debug("[link and exec] {:18s} {} {:6d} heap-use {:8d} {:8d}: 0x{:x}", objName, + lastObjectLoaded, objSize, kheapused(kglobalheap), + kdebugheap.offset ? kheapused(kdebugheap) : 0, kglobalheap->current.offset); + link_and_exec(obj, objName, objSize, heap, linkFlag, jump_from_c_to_goal); // link now! + + // inform IOP we are done + if (!lastObjectLoaded) { + ContinueLoadingDGO(Ptr((heap->current + 0x3f).offset & 0xffffffc0)); + } + } + sShowStallMsg = oldShowStall; +} +} // namespace jak1 \ No newline at end of file diff --git a/game/kernel/jak1/kdgo.h b/game/kernel/jak1/kdgo.h new file mode 100644 index 0000000000..65b38c0af6 --- /dev/null +++ b/game/kernel/jak1/kdgo.h @@ -0,0 +1,13 @@ +#pragma once +#include "common/common_types.h" + +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/kmalloc.h" +namespace jak1 { +void load_and_link_dgo_from_c(const char* name, + Ptr heap, + u32 linkFlag, + s32 bufferSize, + bool jump_from_c_to_goal); +void load_and_link_dgo(u64 name_gstr, u64 heap_info, u64 flag, u64 buffer_size); +} // namespace jak1 \ No newline at end of file diff --git a/game/kernel/klink.cpp b/game/kernel/jak1/klink.cpp similarity index 63% rename from game/kernel/klink.cpp rename to game/kernel/jak1/klink.cpp index 6094a2d59c..de2b56f9d4 100644 --- a/game/kernel/klink.cpp +++ b/game/kernel/jak1/klink.cpp @@ -1,349 +1,49 @@ -/*! - * @file klink.cpp - * GOAL Linker for x86-64 - * Note - this is significantly different from the MIPS linker because the object file format is - * different. - * DONE! - */ - -#include -#include -#include #include "klink.h" -#include "fileio.h" -#include "kscheme.h" -#include "kboot.h" -#include "kprint.h" + +#include "common/log/log.h" #include "common/symbols.h" -#include "common/goal_constants.h" + +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/klink.h" +#include "game/kernel/common/kmachine.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/common/kscheme.h" +#include "game/kernel/common/memory_layout.h" +#include "game/kernel/jak1/kscheme.h" #include "game/mips2c/mips2c_table.h" -#include "common/util/Assert.h" -namespace { -// turn on printf's for debugging linking issues. -constexpr bool link_debug_printfs = false; - -bool is_opengoal_object(const void* data) { - auto* header = (const LinkHeaderV2*)data; - return !(header->type_tag == 0xffffffff && (header->version == 2 || header->version == 4)); -} -} // namespace - -// space to store a single in-progress linking state. -link_control saved_link_control; - -// pointer to GOAL *ultimate-memcpy*, if its loaded. -Ptr gfunc_774; - -void klink_init_globals() { - saved_link_control.reset(); - gfunc_774.offset = 0; -} - -/*! - * Initialize the link control. - */ -void link_control::begin(Ptr object_file, - const char* name, - int32_t size, - Ptr heap, - uint32_t flags) { - if (is_opengoal_object(object_file.c())) { - // save data from call to begin - m_object_data = object_file; - kstrcpy(m_object_name, name); - m_object_size = size; - m_heap = heap; - m_flags = flags; - - // initialize link control - m_entry.offset = 0; - m_heap_top = m_heap->top; - m_keep_debug = false; - m_opengoal = true; - - if (link_debug_printfs) { - char* goal_name = object_file.cast().c(); - printf("link %s\n", m_object_name); - printf("link_control::begin %c%c%c%c\n", goal_name[0], goal_name[1], goal_name[2], - goal_name[3]); - } - - // points to the beginning of the linking data - m_link_block_ptr = object_file + BASIC_OFFSET; - m_code_size = 0; - m_code_start = object_file; - m_state = 0; - m_segment_process = 0; - - ObjectFileHeader* ofh = m_link_block_ptr.cast().c(); - if (ofh->goal_version_major != versions::GOAL_VERSION_MAJOR) { - fprintf( - stderr, - "VERSION ERROR: C Kernel built from GOAL %d.%d, but object file %s is from GOAL %d.%d\n", - versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR, name, ofh->goal_version_major, - ofh->goal_version_minor); - ASSERT(false); - } - if (link_debug_printfs) { - printf("Object file header:\n"); - printf(" GOAL ver %d.%d obj %d len %d\n", ofh->goal_version_major, ofh->goal_version_minor, - ofh->object_file_version, ofh->link_block_length); - printf(" segment count %d\n", ofh->segment_count); - for (int i = 0; i < N_SEG; i++) { - printf(" seg %d link 0x%04x, 0x%04x data 0x%04x, 0x%04x\n", i, ofh->link_infos[i].offset, - ofh->link_infos[i].size, ofh->code_infos[i].offset, ofh->code_infos[i].size); - } - } - - m_version = ofh->object_file_version; - if (ofh->object_file_version < 4) { - // three segment file - - // seek past the header - m_object_data.offset += ofh->link_block_length; - // todo, set m_code_size - - if (m_link_block_ptr.offset < m_heap->base.offset || - m_link_block_ptr.offset >= m_heap->top.offset) { - // the link block is outside our heap, or in the top of our heap. It's somebody else's - // problem. - if (link_debug_printfs) { - printf("Link block somebody else's problem\n"); - } - - if (m_heap->base.offset <= m_object_data.offset && // above heap base - m_object_data.offset < m_heap->top.offset && // less than heap top (not needed?) - m_object_data.offset < m_heap->current.offset) { // less than heap current - if (link_debug_printfs) { - printf("Code block in the heap, kicking it out for copy into heap\n"); - } - m_heap->current = m_object_data; - } - } else { - // in our heap, we need to move it so we can free up its space later on - if (link_debug_printfs) { - printf("Link block needs to be moved!\n"); - } - - // allocate space for a new one - auto new_link_block = kmalloc(m_heap, ofh->link_block_length, KMALLOC_TOP, "link-block"); - auto old_link_block = m_link_block_ptr - BASIC_OFFSET; - - // copy it - ultimate_memcpy(new_link_block.c(), old_link_block.c(), ofh->link_block_length); - m_link_block_ptr = new_link_block + BASIC_OFFSET; - - // if we can save some memory here - if (old_link_block.offset < m_heap->current.offset) { - if (link_debug_printfs) { - printf("Kick out old link block\n"); - } - m_heap->current = old_link_block; - } - } - } else { - printf("UNHANDLED OBJECT FILE VERSION\n"); - ASSERT(false); - } - - if ((m_flags & LINK_FLAG_FORCE_DEBUG) && MasterDebug && !DiskBoot) { - m_keep_debug = true; - } - } else { - m_opengoal = false; - // not an open goal object. - if (link_debug_printfs) { - printf("Linking GOAL style object\n"); - } - - // initialize - m_object_data = object_file; - kstrcpy(m_object_name, name); - m_object_size = size; - m_heap = heap; - m_flags = flags; - m_entry.offset = 0; - m_heap_top = m_heap->top; - m_keep_debug = false; - m_link_block_ptr = object_file + BASIC_OFFSET; - m_code_size = 0; - m_code_start = object_file; - m_state = 0; - m_segment_process = 0; - - const auto* header = (LinkHeaderV2*)(m_link_block_ptr.c() - 4); - - m_version = header->version; - if (header->version < 4) { - // seek past header - m_object_data.offset += header->length; - m_code_size = m_object_size - header->length; - if (m_link_block_ptr.offset < m_heap->base.offset || - m_link_block_ptr.offset >= m_heap->top.offset) { - // the link block is outside our heap, or in the top of our heap. It's somebody else's - // problem. - if (link_debug_printfs) { - printf("Link block somebody else's problem\n"); - } - - if (m_heap->base.offset <= m_object_data.offset && // above heap base - m_object_data.offset < m_heap->top.offset && // less than heap top (not needed?) - m_object_data.offset < m_heap->current.offset) { // less than heap current - if (link_debug_printfs) { - printf("Code block in the heap, kicking it out for copy into heap\n"); - } - m_heap->current = m_object_data; - } - } else { - // in our heap, we need to move it so we can free up its space later on - if (link_debug_printfs) { - printf("Link block needs to be moved!\n"); - } - - // allocate space for a new one - auto new_link_block = kmalloc(m_heap, header->length, KMALLOC_TOP, "link-block"); - auto old_link_block = m_link_block_ptr - BASIC_OFFSET; - - // copy it - ultimate_memcpy(new_link_block.c(), old_link_block.c(), header->length); - m_link_block_ptr = new_link_block + BASIC_OFFSET; - - // if we can save some memory here - if (old_link_block.offset < m_heap->current.offset) { - if (link_debug_printfs) { - printf("Kick out old link block\n"); - } - m_heap->current = old_link_block; - } - } - - } else { - auto header_v4 = (const LinkHeaderV4*)header; - auto old_object_data = m_object_data; - m_link_block_ptr = - old_object_data + header_v4->code_size + sizeof(LinkHeaderV4) + BASIC_OFFSET; - m_object_data = old_object_data + sizeof(LinkHeaderV4); - m_code_size = header_v4->code_size; - } - - if ((m_flags & LINK_FLAG_FORCE_DEBUG) && MasterDebug && !DiskBoot) { - m_keep_debug = true; - } - } -} +#include "third-party/fmt/core.h" +static constexpr bool link_debug_printfs = false; /*! * Make progress on linking. */ -uint32_t link_control::work() { +uint32_t link_control::jak1_work() { auto old_debug_segment = DebugSegment; if (m_keep_debug) { - DebugSegment = s7.offset + FIX_SYM_TRUE; + DebugSegment = s7.offset + true_symbol_offset(g_game_version); } // set type tag of link block - *((m_link_block_ptr - 4).cast()) = *((s7 + FIX_SYM_LINK_BLOCK).cast()); + *((m_link_block_ptr - 4).cast()) = *((s7 + jak1_symbols::FIX_SYM_LINK_BLOCK).cast()); uint32_t rv; if (m_version == 3) { ASSERT(m_opengoal); - rv = work_v3(); + rv = jak1_work_v3(); } else if (m_version == 2 || m_version == 4) { ASSERT(!m_opengoal); - rv = work_v2(); + rv = jak1_work_v2(); } else { - printf("UNHANDLED OBJECT FILE VERSION %d IN WORK!\n", m_version); - ASSERT(false); + ASSERT_MSG(false, fmt::format("UNHANDLED OBJECT FILE VERSION {} IN WORK!", m_version)); return 0; } DebugSegment = old_debug_segment; return rv; } - -/*! - * Link type pointers for a single type in "v3 equivalent" link data - * Returns a pointer to the link table data after the typelinking data. - */ -uint32_t typelink_v3(Ptr link, Ptr data) { - // get the name of the type - uint32_t seek = 0; - char sym_name[256]; - while (link.c()[seek]) { - sym_name[seek] = link.c()[seek]; - seek++; - ASSERT(seek < 256); - } - sym_name[seek] = 0; - seek++; - - // determine the number of methods - uint8_t method_count = link.c()[seek++]; - - // intern the GOAL type, creating the vtable if it doesn't exist. - auto type_ptr = intern_type_from_c(sym_name, method_count); - - // prepare to read the locations of the type pointers - Ptr offsets = link.cast() + seek; - uint32_t offset_count = *offsets; - offsets = offsets + 4; - seek += 4; - - // write the type pointers into memory - for (uint32_t i = 0; i < offset_count; i++) { - *(data + offsets.c()[i]).cast() = type_ptr.offset; - seek += 4; - } - - return seek; -} - -/*! - * Link symbols (both offsets and pointers) in "v3 equivalent" link data. - * Returns a pointer to the link table data after the linking data for this symbol. - */ -uint32_t symlink_v3(Ptr link, Ptr data) { - // get the symbol name - uint32_t seek = 0; - char sym_name[256]; - while (link.c()[seek]) { - sym_name[seek] = link.c()[seek]; - seek++; - ASSERT(seek < 256); - } - sym_name[seek] = 0; - seek++; - - // intern - auto sym = intern_from_c(sym_name); - int32_t sym_offset = sym.cast() - s7; - uint32_t sym_addr = sym.cast().offset; - - // prepare to read locations of symbol links - Ptr offsets = link.cast() + seek; - uint32_t offset_count = *offsets; - offsets = offsets + 4; - seek += 4; - - for (uint32_t i = 0; i < offset_count; i++) { - uint32_t offset = offsets.c()[i]; - seek += 4; - auto data_ptr = (data + offset).cast(); - - if (*data_ptr == -1) { - // a "-1" indicates that we should store the address. - *(data + offset).cast() = sym_addr; - } else { - // otherwise store the offset to st. Eventually this should become an s16 instead. - *(data + offset).cast() = sym_offset; - } - } - - return seek; -} - +namespace { /*! * Link a single relative offset (used for RIP) */ @@ -392,11 +92,93 @@ uint32_t ptr_link_v3(Ptr link, ObjectFileHeader* ofh, int current_seg) { return 8; } +/*! + * Link type pointers for a single type in "v3 equivalent" link data + * Returns a pointer to the link table data after the typelinking data. + */ +uint32_t typelink_v3(Ptr link, Ptr data) { + // get the name of the type + uint32_t seek = 0; + char sym_name[256]; + while (link.c()[seek]) { + sym_name[seek] = link.c()[seek]; + seek++; + ASSERT(seek < 256); + } + sym_name[seek] = 0; + seek++; + + // determine the number of methods + uint8_t method_count = link.c()[seek++]; + + // intern the GOAL type, creating the vtable if it doesn't exist. + auto type_ptr = jak1::intern_type_from_c(sym_name, method_count); + + // prepare to read the locations of the type pointers + Ptr offsets = link.cast() + seek; + uint32_t offset_count = *offsets; + offsets = offsets + 4; + seek += 4; + + // write the type pointers into memory + for (uint32_t i = 0; i < offset_count; i++) { + *(data + offsets.c()[i]).cast() = type_ptr.offset; + seek += 4; + } + + return seek; +} + +/*! + * Link symbols (both offsets and pointers) in "v3 equivalent" link data. + * Returns a pointer to the link table data after the linking data for this symbol. + */ +uint32_t symlink_v3(Ptr link, Ptr data) { + // get the symbol name + uint32_t seek = 0; + char sym_name[256]; + while (link.c()[seek]) { + sym_name[seek] = link.c()[seek]; + seek++; + ASSERT(seek < 256); + } + sym_name[seek] = 0; + seek++; + + // intern + auto sym = jak1::intern_from_c(sym_name); + int32_t sym_offset = sym.cast() - s7; + uint32_t sym_addr = sym.cast().offset; + + // prepare to read locations of symbol links + Ptr offsets = link.cast() + seek; + uint32_t offset_count = *offsets; + offsets = offsets + 4; + seek += 4; + + for (uint32_t i = 0; i < offset_count; i++) { + uint32_t offset = offsets.c()[i]; + seek += 4; + auto data_ptr = (data + offset).cast(); + + if (*data_ptr == -1) { + // a "-1" indicates that we should store the address. + *(data + offset).cast() = sym_addr; + } else { + // otherwise store the offset to st. Eventually this should become an s16 instead. + *(data + offset).cast() = sym_offset; + } + } + + return seek; +} + +} // namespace /*! * Run the linker. For now, all linking is done in two runs. If this turns out to be too slow, * this should be modified to do incremental linking over multiple runs. */ -uint32_t link_control::work_v3() { +uint32_t link_control::jak1_work_v3() { ObjectFileHeader* ofh = m_link_block_ptr.cast().c(); if (m_state == 0) { // state 0 <- copying data. @@ -427,8 +209,8 @@ uint32_t link_control::work_v3() { ofh->code_infos[seg_id].size); return 1; } - ultimate_memcpy(Ptr(ofh->code_infos[seg_id].offset).c(), src.c(), - ofh->code_infos[seg_id].size); + jak1::ultimate_memcpy(Ptr(ofh->code_infos[seg_id].offset).c(), src.c(), + ofh->code_infos[seg_id].size); } } } else if (seg_id == MAIN_SEGMENT) { @@ -443,8 +225,8 @@ uint32_t link_control::work_v3() { ofh->code_infos[seg_id].size); return 1; } - ultimate_memcpy(Ptr(ofh->code_infos[seg_id].offset).c(), src.c(), - ofh->code_infos[seg_id].size); + jak1::ultimate_memcpy(Ptr(ofh->code_infos[seg_id].offset).c(), src.c(), + ofh->code_infos[seg_id].size); } } else if (seg_id == TOP_LEVEL_SEGMENT) { if (ofh->code_infos[seg_id].size == 0) { @@ -459,8 +241,8 @@ uint32_t link_control::work_v3() { ofh->code_infos[seg_id].size); return 1; } - ultimate_memcpy(Ptr(ofh->code_infos[seg_id].offset).c(), src.c(), - ofh->code_infos[seg_id].size); + jak1::ultimate_memcpy(Ptr(ofh->code_infos[seg_id].offset).c(), src.c(), + ofh->code_infos[seg_id].size); } } else { printf("UNHANDLED SEG ID IN WORK V3 STATE 1\n"); @@ -502,8 +284,7 @@ uint32_t link_control::work_v3() { lp = lp + ptr_link_v3(lp, ofh, m_segment_process); break; default: - printf("unknown link table thing %d\n", *lp); - ASSERT(false); + ASSERT_MSG(false, fmt::format("unknown link table thing {}", *lp)); break; } } @@ -525,49 +306,13 @@ uint32_t link_control::work_v3() { } } -Ptr c_symlink2(Ptr objData, Ptr linkObj, Ptr relocTable) { - u8* relocPtr = relocTable.c(); - Ptr objPtr = objData; - - do { - u8 table_value = *relocPtr; - u32 result = table_value; - u8* next_reloc = relocPtr + 1; - - if (result & 3) { - result = (relocPtr[1] << 8) | table_value; - next_reloc = relocPtr + 2; - if (result & 2) { - result = (relocPtr[2] << 16) | result; - next_reloc = relocPtr + 3; - if (result & 1) { - result = (relocPtr[3] << 24) | result; - next_reloc = relocPtr + 4; - } - } - } - - relocPtr = next_reloc; - objPtr = objPtr + (result & 0xfffffffc); - u32 objValue = *(objPtr.cast()); - if (objValue == 0xffffffff) { - *(objPtr.cast()) = linkObj.offset; - } else { - // I don't think we should hit this ever. - ASSERT(false); - } - } while (*relocPtr); - - return make_ptr(relocPtr + 1); -} - #define LINK_V2_STATE_INIT_COPY 0 #define LINK_V2_STATE_OFFSETS 1 #define LINK_V2_STATE_SYMBOL_TABLE 2 #define OBJ_V2_CLOSE_ENOUGH 0x90 #define OBJ_V2_MAX_TRANSFER 0x80000 -uint32_t link_control::work_v2() { +uint32_t link_control::jak1_work_v2() { // u32 startCycle = kernel.read_clock(); todo if (m_state == LINK_V2_STATE_INIT_COPY) { // initialization and copying to heap @@ -614,14 +359,15 @@ uint32_t link_control::work_v2() { u32 size = m_code_size - m_segment_process; if (size > OBJ_V2_MAX_TRANSFER) { // around .5 MB - ultimate_memcpy((m_object_data + m_segment_process).c(), source.c(), OBJ_V2_MAX_TRANSFER); + jak1::ultimate_memcpy((m_object_data + m_segment_process).c(), source.c(), + OBJ_V2_MAX_TRANSFER); m_segment_process += OBJ_V2_MAX_TRANSFER; return 0; // return, don't want to take too long. } // if we have bytes to copy, but they are less than the max transfer, do it in one shot! if (size) { - ultimate_memcpy((m_object_data + m_segment_process).c(), source.c(), size); + jak1::ultimate_memcpy((m_object_data + m_segment_process).c(), source.c(), size); if (m_segment_process > 0) { // if we did a previous copy, we return now.... m_state = LINK_V2_STATE_OFFSETS; m_segment_process = 0; @@ -731,7 +477,7 @@ uint32_t link_control::work_v2() { if (link_debug_printfs) { printf("[work_v2] symlink: %s\n", name); } - goalObj = intern_from_c(name).cast(); + goalObj = jak1::intern_from_c(name).cast(); } else { // type! u8 nMethods = relocation & 0x7f; @@ -742,7 +488,7 @@ uint32_t link_control::work_v2() { if (link_debug_printfs) { printf("[work_v2] symlink -type: %s\n", name); } - goalObj = intern_type_from_c(name, nMethods).cast(); + goalObj = jak1::intern_type_from_c(name, nMethods).cast(); } m_reloc_ptr.offset += strlen(name) + 1; // DECOMPILER->hookStartSymlinkV3(_state - 1, _objectData, std::string(name)); @@ -767,12 +513,12 @@ uint32_t link_control::work_v2() { /*! * Complete linking. This will execute the top-level code for v3 object files, if requested. */ -void link_control::finish(bool jump_from_c_to_goal) { +void link_control::jak1_finish(bool jump_from_c_to_goal) { CacheFlush(m_code_start.c(), m_code_size); auto old_debug_segment = DebugSegment; if (m_keep_debug) { // note - this probably doesn't work because DebugSegment isn't *debug-segment*. - DebugSegment = s7.offset + FIX_SYM_TRUE; + DebugSegment = s7.offset + jak1_symbols::FIX_SYM_TRUE; } if (m_flags & LINK_FLAG_FORCE_FAST_LINK) { FastLink = 1; @@ -780,6 +526,7 @@ void link_control::finish(bool jump_from_c_to_goal) { *EnableMethodSet = *EnableMethodSet + m_keep_debug; ObjectFileHeader* ofh = m_link_block_ptr.cast().c(); + lg::info("link finish: {}", m_object_name); if (ofh->object_file_version == 3) { // todo check function type of entry @@ -807,9 +554,9 @@ void link_control::finish(bool jump_from_c_to_goal) { auto entry = m_entry; auto name = basename_goal(m_object_name); strcpy(Ptr(LINK_CONTROL_NAME_ADDR).c(), name); - call_method_of_type_arg2(entry.offset, Ptr(*((entry - 4).cast())), - GOAL_RELOC_METHOD, m_heap.offset, - Ptr(LINK_CONTROL_NAME_ADDR).offset); + jak1::call_method_of_type_arg2(entry.offset, Ptr(*((entry - 4).cast())), + GOAL_RELOC_METHOD, m_heap.offset, + Ptr(LINK_CONTROL_NAME_ADDR).offset); } } @@ -819,6 +566,8 @@ void link_control::finish(bool jump_from_c_to_goal) { DebugSegment = old_debug_segment; } +namespace jak1 { + /*! * Immediately link and execute an object file. * DONE, EXACT @@ -833,9 +582,9 @@ Ptr link_and_exec(Ptr data, lc.begin(data, name, size, heap, flags); uint32_t done; do { - done = lc.work(); + done = lc.jak1_work(); } while (!done); - lc.finish(jump_from_c_to_goal); + lc.jak1_finish(jump_from_c_to_goal); return lc.m_entry; } @@ -858,11 +607,11 @@ uint64_t link_begin(u64* args) { // object data, name size, heap flags saved_link_control.begin(Ptr(args[0]), Ptr(args[1]).c(), args[2], Ptr(args[3]), args[4]); - auto work_result = saved_link_control.work(); + auto work_result = saved_link_control.jak1_work(); // if we managed to finish in one shot, take care of calling finish if (work_result) { // called from goal - saved_link_control.finish(false); + saved_link_control.jak1_finish(false); } return work_result != 0; @@ -872,10 +621,10 @@ uint64_t link_begin(u64* args) { * GOAL exported function for doing a small amount of linking work on the saved_link_control */ uint64_t link_resume() { - auto work_result = saved_link_control.work(); + auto work_result = saved_link_control.jak1_work(); if (work_result) { // called from goal - saved_link_control.finish(false); + saved_link_control.jak1_finish(false); } return work_result != 0; } @@ -891,7 +640,7 @@ void ultimate_memcpy(void* dst, void* src, uint32_t size) { if (!(u64(dst) & 0xf) && !(u64(src) & 0xf) && !(u64(size) & 0xf) && size > 0xfff) { if (!gfunc_774.offset) { // GOAL function is unknown, lets see if its loaded: - auto sym = find_symbol_from_c("ultimate-memcpy"); + auto sym = jak1::find_symbol_from_c("ultimate-memcpy"); if (sym->value == 0) { memmove(dst, src, size); return; @@ -906,16 +655,4 @@ void ultimate_memcpy(void* dst, void* src, uint32_t size) { memmove(dst, src, size); } } - -// The functions below are not ported because they are specific to the MIPS implementation. -// In the MIPS implementation, the c_ functions are used until GOAL loads its GOAL-implemented -// versions of the same functions. The update_goal_fns detects this and causes the linker to use -// the GOAL versions once possible. The GOAL version is much faster, but functionally equivalent to -// the C version. The C version is compiled without optimization, so this isn't too surprising. -// the rellink function is unused. -/* -c_rellink3__FPvP12link_segmentPUc -c_symlink2__FPvUiPUc -c_symlink3__FPvUiPUc -update_goal_fns__Fv - */ +} // namespace jak1 \ No newline at end of file diff --git a/game/kernel/jak1/klink.h b/game/kernel/jak1/klink.h new file mode 100644 index 0000000000..f3b16c0e83 --- /dev/null +++ b/game/kernel/jak1/klink.h @@ -0,0 +1,19 @@ +#pragma once + +#include "common/common_types.h" + +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/kmalloc.h" + +namespace jak1 { +Ptr link_and_exec(Ptr data, + const char* name, + int32_t size, + Ptr heap, + uint32_t flags, + bool jump_from_c_to_goal); +void ultimate_memcpy(void* dst, void* src, uint32_t size); +u64 link_and_exec_wrapper(u64* args); +uint64_t link_begin(u64* args); +uint64_t link_resume(); +} // namespace jak1 diff --git a/game/kernel/klisten.cpp b/game/kernel/jak1/klisten.cpp similarity index 57% rename from game/kernel/klisten.cpp rename to game/kernel/jak1/klisten.cpp index 1aa2199d43..8e514a2d4e 100644 --- a/game/kernel/klisten.cpp +++ b/game/kernel/jak1/klisten.cpp @@ -1,36 +1,29 @@ -/*! - * @file klisten.cpp - * Implementation of the Listener protocol - * Done - */ +#include "klisten.h" -#include #include #include -#include "klisten.h" -#include "kboot.h" -#include "kprint.h" -#include "kdsnetm.h" -#include "ksocket.h" -#include "kmalloc.h" -#include "klink.h" -#include "kscheme.h" +#include + #include "common/symbols.h" +#include "game/kernel/common/kdsnetm.h" +#include "game/kernel/common/klink.h" +#include "game/kernel/common/klisten.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/jak1/klink.h" + +namespace jak1 { +using namespace jak1_symbols; Ptr ListenerLinkBlock; Ptr ListenerFunction; Ptr kernel_dispatcher; Ptr kernel_packages; -Ptr print_column; -u32 ListenerStatus; void klisten_init_globals() { ListenerLinkBlock.offset = 0; ListenerFunction.offset = 0; kernel_dispatcher.offset = 0; kernel_packages.offset = 0; - print_column.offset = 0; - ListenerStatus = 0; } /*! @@ -55,62 +48,6 @@ void InitListener() { // } } -/*! - * Flush pending messages. If debugging, will send to compiler, otherwise to stdout. - */ -void ClearPending() { - if (!MasterDebug) { - // if we aren't debugging print the print buffer to stdout. - if (PrintPending.offset != 0) { - auto size = strlen(PrintBufArea.cast().c() + sizeof(ListenerMessageHeader)); - if (size > 0) { - printf("%s", PrintBufArea.cast().c() + sizeof(ListenerMessageHeader)); - } - } - } else { - if (ListenerStatus) { - if (OutputPending.offset != 0) { - Ptr msg = OutputBufArea.cast() + sizeof(ListenerMessageHeader); - auto size = strlen(msg.c()); - // note - if size is ever greater than 2^16 this will cause an issue. - SendFromBuffer(msg.c(), size); - clear_output(); - } - - if (PrintPending.offset != 0) { - char* msg = PrintBufArea.cast().c() + sizeof(ListenerMessageHeader); - auto size = strlen(msg); - while (size > 0) { - // sends larger than 64 kB are broken by the GoalProtoBuffer thing, so they are split - auto send_size = size; - if (send_size > 64000) { - send_size = 64000; - } - SendFromBufferD(2, 0, msg, send_size); - size -= send_size; - msg += send_size; - } - clear_print(); - } - } - } -} - -/*! - * Send an "ack" message. The original game had the AckBufArea which stores "ack", but did not - * calculate the length correctly, so the message would not actually contain the "ack" text. - * The "ack" text is unimportant, as the compiler can recognize the messages as ACK due to the - * ListenerMessageKind::MSG_ACK field. Both the type and msg_id fields are sent, which is enough - * for it to work. - */ -void SendAck() { - if (MasterDebug) { - SendFromBufferD(u16(ListenerMessageKind::MSG_ACK), protoBlock.msg_id, - AckBufArea + sizeof(ListenerMessageHeader), - strlen(AckBufArea + sizeof(ListenerMessageHeader))); - } -} - /*! * Handle an incoming listener message */ @@ -134,10 +71,10 @@ void ProcessListenerMessage(Ptr msg) { printf("[ERROR] unsupported message kind LTT_MSG_PRINT_SYMBOLS (NYI)\n"); break; case LTT_MSG_RESET: - MasterExit = 1; + MasterExit = RuntimeExitStatus::RESTART_RUNTIME; break; case LTT_MSG_SHUTDOWN: - MasterExit = 2; + MasterExit = RuntimeExitStatus::EXIT; break; case LTT_MSG_CODE: { auto buffer = kmalloc(kdebugheap, MessCount, 0, "listener-link-block"); @@ -163,3 +100,5 @@ void ProcessListenerMessage(Ptr msg) { } SendAck(); } + +} // namespace jak1 diff --git a/game/kernel/jak1/klisten.h b/game/kernel/jak1/klisten.h new file mode 100644 index 0000000000..8caa9d8173 --- /dev/null +++ b/game/kernel/jak1/klisten.h @@ -0,0 +1,14 @@ +#pragma once + +#include "game/kernel/jak1/kscheme.h" + +namespace jak1 { +extern Ptr ListenerFunction; +extern Ptr kernel_dispatcher; +extern Ptr kernel_packages; + +void klisten_init_globals(); + +void InitListener(); +void ProcessListenerMessage(Ptr msg); +} // namespace jak1 \ No newline at end of file diff --git a/game/kernel/kmachine.cpp b/game/kernel/jak1/kmachine.cpp similarity index 63% rename from game/kernel/kmachine.cpp rename to game/kernel/jak1/kmachine.cpp index 5d19c2dcd1..e387a98b77 100644 --- a/game/kernel/kmachine.cpp +++ b/game/kernel/jak1/kmachine.cpp @@ -1,75 +1,45 @@ -/*! - * @file kmachine.cpp - * GOAL Machine. Contains low-level hardware interfaces for GOAL. - * Not yet done - some controller stuff isn't implemented, and also many of the SCE functions - * are just stubs or commented out for now. Legal splash screen stuff is also missing. - */ - -#include -#include #include "kmachine.h" -#include "kboot.h" -#include "kprint.h" -#include "fileio.h" -#include "kmalloc.h" -#include "kdsnetm.h" -#include "ksocket.h" -#include "kscheme.h" -#include "ksound.h" -#include "kdgo.h" -#include "ksound.h" -#include "klink.h" -#include "klisten.h" -#include "game/sce/sif_ee.h" + +#include +#include + +#include "common/log/log.h" +#include "common/symbols.h" +#include "common/util/FileUtil.h" + +#include "game/discord.h" +#include "game/graphics/gfx.h" +#include "game/graphics/sceGraphicsInterface.h" +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/kboot.h" +#include "game/kernel/common/kdgo.h" +#include "game/kernel/common/kdsnetm.h" +#include "game/kernel/common/kernel_types.h" +#include "game/kernel/common/klink.h" +#include "game/kernel/common/kmachine.h" +#include "game/kernel/common/kmalloc.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/common/kscheme.h" +#include "game/kernel/common/ksocket.h" +#include "game/kernel/common/ksound.h" +#include "game/kernel/common/memory_layout.h" +#include "game/kernel/jak1/kboot.h" +#include "game/kernel/jak1/kdgo.h" +#include "game/kernel/jak1/klisten.h" +#include "game/kernel/jak1/kscheme.h" +#include "game/kernel/jak1/ksound.h" +#include "game/kernel/svnrev.h" +#include "game/mips2c/mips2c_table.h" #include "game/sce/libcdvd_ee.h" -#include "game/sce/stubs.h" #include "game/sce/libdma.h" #include "game/sce/libgraph.h" -#include "game/sce/libpad.h" -#include "common/symbols.h" -#include "common/log/log.h" -#include "common/util/FileUtil.h" -#include "common/util/Timer.h" -#include "game/graphics/sceGraphicsInterface.h" -#include "game/graphics/gfx.h" -#include "common/dma/dma_chain_read.h" -#include "common/dma/dma_copy.h" -#include "game/mips2c/mips2c_table.h" +#include "game/sce/sif_ee.h" +#include "game/sce/stubs.h" #include "game/system/vm/vm.h" -#include "game/system/newpad.h" -#include "game/sce/libscf.h" -#include "common/util/Assert.h" -#include "game/discord.h" + using namespace ee; -/*! - * Where does OVERLORD load its data from? - */ -OverlordDataSource isodrv; - -// Get IOP modules from DVD or from dsefilesv -u32 modsrc; - -// Reboot IOP with IOP kernel from DVD/CD on boot -u32 reboot; - -u8 pad_dma_buf[2 * SCE_PAD_DMA_BUFFER_SIZE]; - -const char* init_types[] = {"fakeiso", "deviso", "iso_cd"}; - -Timer ee_clock_timer; - -// added -u32 vif1_interrupt_handler = 0; - -void kmachine_init_globals() { - isodrv = iso_cd; - modsrc = 1; - reboot = 1; - memset(pad_dma_buf, 0, sizeof(pad_dma_buf)); - ee_clock_timer = Timer(); - vif1_interrupt_handler = 0; -} +namespace jak1 { /*! * Initialize global variables based on command line parameters. Not called in retail versions, @@ -78,6 +48,16 @@ void kmachine_init_globals() { * Modified to use std::string, and removed call to fflush. */ void InitParms(int argc, const char* const* argv) { + // Modified default settings: + if (argc == 1) { + DiskBoot = 1; + isodrv = fakeiso; + modsrc = 0; + reboot = 0; + DebugSegment = 0; + MasterDebug = 0; + } + for (int i = 1; i < argc; i++) { std::string arg = argv[i]; // DVD Settings @@ -121,6 +101,12 @@ void InitParms(int argc, const char* const* argv) { MasterUseKernel = false; } + // an added mode to allow booting without sound for testing + if (arg == "-nosound") { + Msg(6, "dkernel: no sound mode\n"); + masterConfig.disable_sound = true; + } + // GOAL Settings // ---------------------------- @@ -164,20 +150,6 @@ void InitParms(int argc, const char* const* argv) { } } -/*! - * Initialize the CD Drive - * DONE, EXACT - */ -void InitCD() { - lg::info("Initializing CD drive. This may take a while..."); - sceCdInit(SCECdINIT); - sceCdMmode(SCECdDVD); - while (sceCdDiskReady(0) == SCECdNotReady) { - lg::debug("Drive not ready... insert a disk!"); - } - lg::debug("Disk type {}\n", sceCdGetDiskType()); -} - /*! * Initialize the I/O Processor * Removed calls to exit(0) if loading modules fails. @@ -225,10 +197,17 @@ void InitIOP() { // we begin putting together a boot command for OVERLORD, the IOP driver, which must know the data // source and the name of the boot splash screen of the game. char overlord_boot_command[256]; - kstrcpy(overlord_boot_command, init_types[(int)isodrv]); - char* cmd = overlord_boot_command + strlen(overlord_boot_command) + 1; + char* cmd = overlord_boot_command; + kstrcpy(cmd, init_types[(int)isodrv]); + cmd = cmd + strlen(cmd) + 1; kstrcpy(cmd, "SCREEN1.USA"); - auto len = strlen(cmd); + cmd = cmd + strlen(cmd) + 1; + if (masterConfig.disable_sound) { + kstrcpy(cmd, "-nosound"); + cmd = cmd + strlen(cmd) + 1; + } + + int total_len = cmd - overlord_boot_command; if (modsrc == fakeiso) { // load from network @@ -260,8 +239,7 @@ void InitIOP() { sceSifLoadModule("host0:/usr/home/src/989snd10/iop/989ERR.IRX", 0, nullptr); lg::debug("Initializing CD library..."); - auto rv = sceSifLoadModule("host0:binee/overlord.irx", cmd + len + 1 - overlord_boot_command, - overlord_boot_command); + auto rv = sceSifLoadModule("host0:binee/overlord.irx", total_len, overlord_boot_command); if (rv < 0) { MsgErr("loading overlord.irx failed\n"); } @@ -292,8 +270,8 @@ void InitIOP() { } lg::debug("Initializing CD library in ISO_CD mode..."); - auto rv = sceSifLoadModule("cdrom0:\\\\DRIVERS\\\\OVERLORD.IRX;1", - cmd + len + 1 - overlord_boot_command, overlord_boot_command); + auto rv = + sceSifLoadModule("cdrom0:\\\\DRIVERS\\\\OVERLORD.IRX;1", total_len, overlord_boot_command); if (rv < 0) { MsgErr("loading overlord.irx failed\n"); } @@ -306,12 +284,6 @@ void InitIOP() { } } -/*! - * Initialize the GS and display the splash screen. - * Not yet implemented. TODO - */ -void InitVideo() {} - /*! * Initialize GOAL Runtime. This is the main initialization which is called before entering * the GOAL kernel dispatch loop (KernelCheckAndDispatch). @@ -340,24 +312,25 @@ int InitMachine() { kdebugheap.offset = 0; } - init_output(); // GOAL input/output buffer setup - InitIOP(); // start IOP/OVERLORD, loading our legal splash screen + init_output(); // GOAL input/output buffer setup + jak1::InitIOP(); // start IOP/OVERLORD, loading our legal splash screen - // sceGsResetPath(); // reset VIF1, VU1, GIF + // sceGsResetPath(); // reset VIF1, VU1, GIF InitVideo(); // display legal splash screen - // FlushCache(WRITEBACK_DCACHE); - // FlushCache(INVALIDATE_ICACHE); - // sceGsSyncV(0); // wait for it to show up on the screen + // FlushCache(WRITEBACK_DCACHE); + // FlushCache(INVALIDATE_ICACHE); + // sceGsSyncV(0); // wait for it to show up on the screen // - // if(scePadInit(0) != 1) { // init controllers - // MsgErr("dkernel: !init pad\n"); - // } + // if(scePadInit(0) != 1) { // init controllers + // MsgErr("dkernel: !init pad\n"); + // } - if (MasterDebug) { // connect to GOAL compiler - InitGoalProto(); - } + // do this always + // if (MasterDebug) { // connect to GOAL compiler + InitGoalProto(); + //} lg::info("InitSound"); InitSound(); // do nothing! @@ -397,155 +370,7 @@ int ShutdownMachine() { return 0; } -/*! - * Flush caches. Does all the memory, regardless of what you specify - */ -void CacheFlush(void* mem, int size) { - (void)mem; - (void)size; - // FlushCache(0); - // FlushCache(2); -} - -/*! - * Open a new controller pad. - * Set the new_pad flag to 1 and state to 0. - * Prints an error if it fails to open. - */ -u64 CPadOpen(u64 cpad_info, s32 pad_number) { - auto cpad = Ptr(cpad_info).c(); - if (cpad->cpad_file == 0) { - // not open, so we will open it - cpad->cpad_file = - ee::scePadPortOpen(pad_number, 0, pad_dma_buf + pad_number * SCE_PAD_DMA_BUFFER_SIZE); - if (cpad->cpad_file < 1) { - MsgErr("dkernel: !open cpad #%d (%d)\n", pad_number, cpad->cpad_file); - } - cpad->new_pad = 1; - cpad->state = 0; - } - return cpad_info; -} - -u64 CPadGetData(u64 cpad_info) { - auto cpad = Ptr(cpad_info).c(); - auto pad_state = scePadGetState(cpad->number, 0); - if (pad_state == scePadStateDiscon) { - cpad->state = 0; - } - cpad->valid = pad_state | 0x80; - switch (cpad->state) { - // case 99: // functional - default: // controller is functioning as normal - if (pad_state == scePadStateStable || pad_state == scePadStateFindCTP1) { - scePadRead(cpad->number, 0, (u8*)cpad); - // ps2 controllers would send an enabled bit if the button was NOT pressed, but we don't do - // that here. removed code that flipped the bits. - - if (cpad->change_time != 0) { - scePadSetActDirect(cpad->number, 0, cpad->direct); - } - cpad->valid = pad_state; - } - break; - case 0: // unavailable - if (pad_state == scePadStateStable || pad_state == scePadStateFindCTP1) { - auto pad_mode = scePadInfoMode(cpad->number, 0, InfoModeCurID, 0); - if (pad_mode != 0) { - auto vibration_mode = scePadInfoMode(cpad->number, 0, InfoModeCurExID, 0); - if (vibration_mode > 0) { - // vibration supported - pad_mode = vibration_mode; - } - if (pad_mode == 4) { - // controller mode - cpad->state = 40; - } else if (pad_mode == 7) { - // dualshock mode - cpad->state = 70; - } else { - // who knows mode - cpad->state = 90; - } - } - } - break; - case 40: // controller mode - check for extra modes - cpad->change_time = 0; - if (scePadInfoMode(cpad->number, 0, InfoModeIdTable, -1) == 0) { - // no controller modes - cpad->state = 90; - return cpad_info; - } - cpad->state = 41; - case 41: // controller mode - change to dualshock mode! - // try to enter the 2nd controller mode (dualshock for ds2's) - if (scePadSetMainMode(cpad->number, 0, 1, 3) == 1) { - cpad->state = 42; - } - break; - case 42: // controller mode change check - if (scePadGetReqState(cpad->number, 0) == scePadReqStateFailed) { - // failed to change to DS2 - cpad->state = 41; - } - if (scePadGetReqState(cpad->number, 0) == scePadReqStateComplete) { - // change successful. go back to the beginning. - cpad->state = 0; - } - break; - case 70: // dualshock mode - check vibration - // get number of actuators (2 for DS2) - if (scePadInfoAct(cpad->number, 0, -1, 0) < 1) { - // no actuators means no vibration. skip to end! - cpad->change_time = 0; - cpad->state = 99; - } else { - // we have actuators to use. - cpad->change_time = 1; // remember to update pad times. - cpad->state = 75; - } - break; - case 75: // set actuator vib param info - if (scePadSetActAlign(cpad->number, 0, cpad->align) != 0) { - if (scePadInfoPressMode(cpad->number, 0) == 1) { - // pressure buttons supported - cpad->state = 76; - } else { - // no pressure buttons, done with controller setup - cpad->state = 99; - } - } - break; - case 76: // enter pressure mode - if (scePadEnterPressMode(cpad->number, 0) == 1) { - cpad->state = 78; - } - break; - case 78: // pressure mode request check - if (scePadGetReqState(cpad->number, 0) == scePadReqStateFailed) { - cpad->state = 76; - } - if (scePadGetReqState(cpad->number, 0) == scePadReqStateComplete) { - cpad->state = 99; - } - break; - case 90: - break; // unsupported controller. too bad! - } - return cpad_info; -} - -// TODO InstallHandler -void InstallHandler(u32 handler_idx, u32 handler_func) { - ASSERT(handler_idx == 5); // vif1 - vif1_interrupt_handler = handler_func; -} -// TODO InstallDebugHandler -void InstallDebugHandler() { - ASSERT(false); -} - +// todo, these could probably be moved to common void send_gfx_dma_chain(u32 /*bank*/, u32 chain) { Gfx::send_chain(g_ee_main_mem, chain); } @@ -602,146 +427,17 @@ u64 kopen(u64 fs, u64 name, u64 mode) { return fs; } -/*! - * Get length of a file. - */ -s32 klength(u64 fs) { - auto file_stream = Ptr(fs).c(); - if ((file_stream->flags ^ 1) & 1) { - // first flag bit not set. This means no errors - auto end_seek = sceLseek(file_stream->file, 0, SCE_SEEK_END); - auto reset_seek = sceLseek(file_stream->file, 0, SEEK_SET); - if (reset_seek < 0 || end_seek < 0) { - // seeking failed, flag it - file_stream->flags |= 1; - } - return end_seek; - } else { - return 0; - } -} - -/*! - * Seek a file stream. - */ -s32 kseek(u64 fs, s32 offset, s32 where) { - s32 result = -1; - auto file_stream = Ptr(fs).c(); - if ((file_stream->flags ^ 1) & 1) { - result = sceLseek(file_stream->file, offset, where); - if (result < 0) { - file_stream->flags |= 1; - } - } - return result; -} - -/*! - * Read from a file stream. - */ -s32 kread(u64 fs, u64 buffer, s32 size) { - s32 result = -1; - auto file_stream = Ptr(fs).c(); - if ((file_stream->flags ^ 1) & 1) { - result = sceRead(file_stream->file, Ptr(buffer).c(), size); - if (result < 0) { - file_stream->flags |= 1; - } - } - return result; -} - -/*! - * Write to a file stream. - */ -s32 kwrite(u64 fs, u64 buffer, s32 size) { - s32 result = -1; - auto file_stream = Ptr(fs).c(); - if ((file_stream->flags ^ 1) & 1) { - result = sceWrite(file_stream->file, Ptr(buffer).c(), size); - if (result < 0) { - file_stream->flags |= 1; - } - } - return result; -} - -/*! - * Close a file stream. - */ -u64 kclose(u64 fs) { - auto file_stream = Ptr(fs).c(); - if ((file_stream->flags ^ 1) & 1) { - sceClose(file_stream->file); - file_stream->file = -1; - } - file_stream->flags = 0; - return fs; -} - -// TODO dma_to_iop -void dma_to_iop() { - ASSERT(false); -} - -u64 DecodeLanguage() { - return masterConfig.language; -} - -u64 DecodeAspect() { - return masterConfig.aspect; -} - -u64 DecodeVolume() { - return masterConfig.volume; -} - -// NOTE: this is originally hardcoded, and returns different values depending on the disc region. -// it returns 0 for NTSC-U, 1 for PAL and 2 for NTSC-J -u64 DecodeTerritory() { - return masterConfig.territory; -} - -u64 DecodeTimeout() { - return masterConfig.timeout; -} - -u64 DecodeInactiveTimeout() { - return masterConfig.inactive_timeout; -} - -void DecodeTime(u32 ptr) { - Ptr clock(ptr); - sceCdReadClock(clock.c()); -} - -// TODO PutDisplayEnv void PutDisplayEnv(u32 ptr) { + // we can mostly ignore this, except for one value that sets the 'blackout' amount. u8 alp = Ptr(ptr).c()[1]; auto* renderer = Gfx::GetCurrentRenderer(); if (renderer) { renderer->set_pmode_alp(alp / 255.f); } - // ASSERT(false); } /*! - * PC Port function to get a 300MHz timer value. - */ -u64 read_ee_timer() { - u64 ns = ee_clock_timer.getNs(); - return (ns * 3) / 10; -} - -/*! - * PC Port function to do a fast memory copy. - */ -void c_memmove(u32 dst, u32 src, u32 size) { - memmove(Ptr(dst).c(), Ptr(src).c(), size); -} - -/*! - * PC Port function to return the current OS as a symbol. + * Return the current OS as a symbol. Actually returns what it was compiled for! */ u64 get_os() { #ifdef _WIN32 @@ -753,47 +449,59 @@ u64 get_os() { #endif } -/*! - * PC Port function - */ -void get_window_size(u32 w_ptr, u32 h_ptr) { - if (w_ptr) { - auto w = Ptr(w_ptr).c(); - *w = Gfx::get_window_width(); - } - if (h_ptr) { - auto h = Ptr(h_ptr).c(); - *h = Gfx::get_window_height(); - } -} - -/*! - * PC Port function - */ -void get_window_scale(u32 x_ptr, u32 y_ptr) { - float* x = x_ptr ? Ptr(x_ptr).c() : NULL; - float* y = y_ptr ? Ptr(y_ptr).c() : NULL; - Gfx::get_window_scale(x, y); -} - void update_discord_rpc(u32 discord_info) { if (gDiscordRpcEnabled) { DiscordRichPresence rpc; char state[128]; + char large_image_key[128]; + char large_image_text[128]; + char small_image_key[128]; + char small_image_text[128]; auto info = discord_info ? Ptr(discord_info).c() : NULL; if (info) { int cells = (int)*Ptr(info->fuel).c(); int orbs = (int)*Ptr(info->money_total).c(); int scout_flies = (int)*Ptr(info->buzzer_total).c(); + int deaths = *Ptr(info->deaths).c(); + float time = *Ptr(info->time_of_day).c(); auto cutscene = Ptr(info->cutscene)->value; + auto ogreboss = Ptr(info->ogreboss)->value; + auto plantboss = Ptr(info->plantboss)->value; + auto racer = Ptr(info->racer)->value; + auto flutflut = Ptr(info->flutflut)->value; char* status = Ptr(info->status).c()->data(); char* level = Ptr(info->level).c()->data(); const char* full_level_name = jak1_get_full_level_name(Ptr(info->level).c()->data()); memset(&rpc, 0, sizeof(rpc)); + if (!indoors(level)) { + char level_with_tod[128]; + strcpy(level_with_tod, level); + strcat(level_with_tod, "-"); + strcat(level_with_tod, time_of_day_str(time)); + strcpy(large_image_key, level_with_tod); + } else { + strcpy(large_image_key, level); + } + strcpy(large_image_text, full_level_name); + if (!strcmp(full_level_name, "unknown")) { + strcpy(large_image_key, full_level_name); + strcpy(large_image_text, level); + } + rpc.largeImageKey = large_image_key; if (!strcmp(level, "finalboss")) { strcpy(state, "Fighting Final Boss"); + } else if (plantboss != offset_of_s7()) { + strcpy(state, "Fighting Dark Eco Plant"); + rpc.largeImageKey = "plant-boss"; + strcpy(large_image_text, "Dark Eco Plant"); + } else if (ogreboss != offset_of_s7()) { + strcpy(state, "Fighting Klaww"); + rpc.largeImageKey = "ogreboss"; + strcpy(large_image_text, "Klaww"); } else if (!strcmp(level, "title")) { strcpy(state, "On title screen"); + rpc.largeImageKey = "title"; + strcpy(large_image_text, "Title screen"); } else if (!strcmp(level, "intro")) { strcpy(state, "Intro"); } else if (cutscene != offset_of_s7()) { @@ -803,16 +511,40 @@ void update_discord_rpc(u32 discord_info) { strcat(state, std::to_string(cells).c_str()); strcat(state, " | Orbs: "); strcat(state, std::to_string(orbs).c_str()); - strcat(state, " | Scout flies: "); + strcat(state, " | Flies: "); strcat(state, std::to_string(scout_flies).c_str()); + + strcat(large_image_text, " | Cells: "); + strcat(large_image_text, std::to_string(cells).c_str()); + strcat(large_image_text, " | Orbs: "); + strcat(large_image_text, std::to_string(orbs).c_str()); + strcat(large_image_text, " | Flies: "); + strcat(large_image_text, std::to_string(scout_flies).c_str()); + strcat(large_image_text, " | Deaths: "); + strcat(large_image_text, std::to_string(deaths).c_str()); } + rpc.largeImageText = large_image_text; rpc.state = state; + if (racer != offset_of_s7()) { + strcpy(small_image_key, "target-racer"); + strcpy(small_image_text, "Driving A-Grav Zoomer"); + } else if (flutflut != offset_of_s7()) { + strcpy(small_image_key, "flutflut"); + strcpy(small_image_text, "Riding on Flut Flut"); + } else { + if (!indoors(level)) { + strcpy(small_image_key, time_of_day_str(time)); + strcpy(small_image_text, "Time of day: "); + strcat(small_image_text, get_time_of_day(time).c_str()); + } else { + strcpy(small_image_key, ""); + strcpy(small_image_text, ""); + } + } + rpc.smallImageKey = small_image_key; + rpc.smallImageText = small_image_text; rpc.startTimestamp = gStartTime; rpc.details = status; - rpc.largeImageKey = level; - rpc.largeImageText = full_level_name; - rpc.smallImageKey = 0; - rpc.smallImageText = 0; rpc.partySize = 0; rpc.partyMax = 0; Discord_UpdatePresence(&rpc); @@ -822,21 +554,31 @@ void update_discord_rpc(u32 discord_info) { } } -u64 filepath_exists(u32 filepath) { - auto filepath_str = std::string(Ptr(filepath).c()->data()); - if (std::filesystem::exists(filepath_str)) { - return intern_from_c("#t").offset; +u32 get_fullscreen() { + switch (Gfx::get_fullscreen()) { + default: + case GfxDisplayMode::Windowed: + return intern_from_c("windowed").offset; + case GfxDisplayMode::Borderless: + return intern_from_c("borderless").offset; + case GfxDisplayMode::Fullscreen: + return intern_from_c("fullscreen").offset; } - return s7.offset; } -void mkdir_path(u32 filepath) { - auto filepath_str = std::string(Ptr(filepath).c()->data()); - file_util::create_dir_if_needed_for_file(filepath_str); +void set_fullscreen(u32 symptr, s64 screen) { + if (symptr == intern_from_c("windowed").offset || symptr == s7.offset) { + Gfx::set_fullscreen(GfxDisplayMode::Windowed, screen); + } else if (symptr == intern_from_c("borderless").offset) { + Gfx::set_fullscreen(GfxDisplayMode::Borderless, screen); + } else if (symptr == intern_from_c("fullscreen").offset) { + Gfx::set_fullscreen(GfxDisplayMode::Fullscreen, screen); + } } void InitMachine_PCPort() { // PC Port added functions + make_function_symbol_from_c("__read-ee-timer", (void*)read_ee_timer); make_function_symbol_from_c("__mem-move", (void*)c_memmove); make_function_symbol_from_c("__send-gfx-dma-chain", (void*)send_gfx_dma_chain); @@ -858,10 +600,24 @@ void InitMachine_PCPort() { make_function_symbol_from_c("pc-get-os", (void*)get_os); make_function_symbol_from_c("pc-get-window-size", (void*)get_window_size); make_function_symbol_from_c("pc-get-window-scale", (void*)get_window_scale); + make_function_symbol_from_c("pc-get-fullscreen", (void*)get_fullscreen); + make_function_symbol_from_c("pc-get-screen-size", (void*)get_screen_size); + make_function_symbol_from_c("pc-get-screen-rate", (void*)get_screen_rate); + make_function_symbol_from_c("pc-get-screen-vmode-count", (void*)get_screen_vmode_count); make_function_symbol_from_c("pc-set-window-size", (void*)Gfx::set_window_size); + make_function_symbol_from_c("pc-set-fullscreen", (void*)set_fullscreen); + make_function_symbol_from_c("pc-set-frame-rate", (void*)set_frame_rate); + make_function_symbol_from_c("pc-set-vsync", (void*)set_vsync); + make_function_symbol_from_c("pc-set-window-lock", (void*)set_window_lock); + + // graphics things make_function_symbol_from_c("pc-set-letterbox", (void*)Gfx::set_letterbox); - make_function_symbol_from_c("pc-set-fullscreen", (void*)Gfx::set_fullscreen); make_function_symbol_from_c("pc-renderer-tree-set-lod", (void*)Gfx::SetLod); + make_function_symbol_from_c("pc-set-collision-mode", (void*)Gfx::CollisionRendererSetMode); + make_function_symbol_from_c("pc-set-collision-mask", (void*)set_collision_mask); + make_function_symbol_from_c("pc-get-collision-mask", (void*)get_collision_mask); + make_function_symbol_from_c("pc-set-collision-wireframe", (void*)set_collision_wireframe); + make_function_symbol_from_c("pc-set-collision", (void*)set_collision); // file related functions make_function_symbol_from_c("pc-filepath-exists?", (void*)filepath_exists); @@ -871,6 +627,9 @@ void InitMachine_PCPort() { make_function_symbol_from_c("pc-discord-rpc-set", (void*)set_discord_rpc); make_function_symbol_from_c("pc-discord-rpc-update", (void*)update_discord_rpc); + // profiler + make_function_symbol_from_c("pc-prof", (void*)prof_event); + // init ps2 VM if (VM::use) { make_function_symbol_from_c("vm-ptr", (void*)VM::get_vm_ptr); @@ -884,20 +643,7 @@ void InitMachine_PCPort() { // TODO - we will eventually need a better way to know what game we are playing auto settings_path = file_util::get_user_settings_dir(); intern_from_c("*pc-settings-folder*")->value = make_string_from_c(settings_path.string().c_str()); -} - -void vif_interrupt_callback() { - // added for the PC port for faking VIF interrupts from the graphics system. - if (vif1_interrupt_handler && MasterExit == 0) { - call_goal(Ptr(vif1_interrupt_handler), 0, 0, 0, s7.offset, g_ee_main_mem); - } -} - -/*! - * Added in PC port. - */ -u32 offset_of_s7() { - return s7.offset; + intern_from_c("*pc-settings-built-sha*")->value = make_string_from_c(GIT_VERSION); } /*! @@ -936,8 +682,8 @@ void InitMachineScheme() { make_function_symbol_from_c("scf-get-timeout", (void*)DecodeTimeout); // used make_function_symbol_from_c("scf-get-inactive-timeout", (void*)DecodeInactiveTimeout); // used make_function_symbol_from_c("dma-to-iop", (void*)dma_to_iop); // unused - make_function_symbol_from_c("kernel-shutdown", (void*)KernelShutdown); // used - make_function_symbol_from_c("aybabtu", (void*)sceCdMmode); // used + make_function_symbol_from_c("kernel-shutdown", (void*)jak1::KernelShutdown); // used TODO jak1 + make_function_symbol_from_c("aybabtu", (void*)sceCdMmode); // used InitMachine_PCPort(); InitSoundScheme(); @@ -958,7 +704,7 @@ void InitMachineScheme() { LINK_FLAG_OUTPUT_LOAD | LINK_FLAG_EXECUTE | LINK_FLAG_PRINT_LOGIN, 0x400000, true); *EnableMethodSet = (*EnableMethodSet) - 1; - + using namespace jak1_symbols; kernel_packages->value = new_pair(s7.offset + FIX_SYM_GLOBAL_HEAP, *((s7 + FIX_SYM_PAIR_TYPE).cast()), make_string_from_c("engine"), kernel_packages->value); @@ -969,7 +715,9 @@ void InitMachineScheme() { new_pair(s7.offset + FIX_SYM_GLOBAL_HEAP, *((s7 + FIX_SYM_PAIR_TYPE).cast()), make_string_from_c("common"), kernel_packages->value); - lg::info("calling fake play"); + lg::info("calling play"); call_goal_function_by_name("play"); } } + +} // namespace jak1 \ No newline at end of file diff --git a/game/kernel/jak1/kmachine.h b/game/kernel/jak1/kmachine.h new file mode 100644 index 0000000000..b27062f7c2 --- /dev/null +++ b/game/kernel/jak1/kmachine.h @@ -0,0 +1,42 @@ +#pragma once + +#include "common/common_types.h" +// Discord RPC +struct DiscordRichPresence; +extern int gDiscordRpcEnabled; +extern int64_t gStartTime; +namespace jak1 { +/*! + * Initialize global variables based on command line parameters + */ +void InitParms(int argc, const char* const* argv); +/*! + * Initialize the I/O Processor + */ +void InitIOP(); +/*! + * Initialze GOAL Runtime + */ +int InitMachine(); +/*! + * Shutdown GOAL runtime. + */ +int ShutdownMachine(); + +void InitMachineScheme(); + +struct DiscordInfo { + u32 fuel; + u32 money_total; + u32 buzzer_total; + u32 deaths; + u32 status; + u32 level; + u32 cutscene; // check if cutscene is playing + u32 ogreboss; // are we fighting ogreboss? + u32 plantboss; // are we fighting plant-boss? + u32 racer; // are we driving the zoomer? + u32 flutflut; // are we riding on flut flut? + u32 time_of_day; +}; +} // namespace jak1 \ No newline at end of file diff --git a/game/kernel/kprint.cpp b/game/kernel/jak1/kprint.cpp similarity index 50% rename from game/kernel/kprint.cpp rename to game/kernel/jak1/kprint.cpp index 6f98418d1d..942b9aa511 100644 --- a/game/kernel/kprint.cpp +++ b/game/kernel/jak1/kprint.cpp @@ -1,585 +1,25 @@ -/*! - * @file kprint.cpp - * GOAL Print. Contains GOAL I/O, Print, Format... - */ - -#include -#include -#include -#include - -#include "common/goal_constants.h" -#include "common/common_types.h" -#include "common/cross_os_debug/xdbg.h" -#include "game/sce/sif_ee.h" #include "kprint.h" -#include "kmachine.h" -#include "kboot.h" -#include "kmalloc.h" -#include "kdsnetm.h" -#include "fileio.h" -#include "kscheme.h" -#include "klisten.h" -#include "klink.h" + +#include +#include + +#include "common/listener_common.h" #include "common/symbols.h" -#include "common/util/Assert.h" + +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/klisten.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/common/kscheme.h" +#include "game/kernel/jak1/kscheme.h" +#include "game/sce/sif_ee.h" + +using namespace jak1_symbols; /////////// // SDATA /////////// -// Pointer set to something in the middle of the output buffer, if there is something in the buffer. -Ptr OutputPending; - -// Pointer set to something in the middle of the print buffer, if there is something in the buffer -Ptr PrintPending; - -// Size of incoming message. -s32 MessCount; - -// Pointer to message buffer, the compiler to target buffer -Ptr MessBufArea; - -// Pointer to the output buffer, the runtime to compiler buffer -Ptr OutputBufArea; - -// Pointer to print buffer, the buffer for printing and string formatting. -Ptr PrintBufArea; - -// integer printing conversion table -char ConvertTable[16]; - -// buffer for sending an "acknowledge" message to the compiler -char AckBufArea[40]; - -/*! - * Initialize global variables for kprint - */ -void kprint_init_globals() { - OutputPending.offset = 0; - PrintPending.offset = 0; - MessCount = 0; - MessBufArea.offset = 0; - OutputBufArea.offset = 0; - PrintBufArea.offset = 0; - memcpy(ConvertTable, "0123456789abcdef", 16); - memset(AckBufArea, 0, sizeof(AckBufArea)); -} - -/*! - * Initialize GOAL Kernel printing/messaging system. - * Allocates buffers. - * DONE, EXACT - */ -void init_output() { - if (MasterDebug) { - MessBufArea = kmalloc(kdebugheap, DEBUG_MESSAGE_BUFFER_SIZE, KMALLOC_MEMSET | KMALLOC_ALIGN_256, - "mess-buf"); - OutputBufArea = kmalloc(kdebugheap, DEBUG_OUTPUT_BUFFER_SIZE, - KMALLOC_MEMSET | KMALLOC_ALIGN_256, "output-buf"); - PrintBufArea = kmalloc(kdebugheap, DEBUG_PRINT_BUFFER_SIZE, KMALLOC_MEMSET | KMALLOC_ALIGN_256, - "print-buf"); - } else { - // no compiler connection, so we do not allocate buffers - MessBufArea = Ptr(0); - OutputBufArea = Ptr(0); - - // we still need a (small) print buffer for string maniuplation and debugging prints. - PrintBufArea = - kmalloc(kglobalheap, PRINT_BUFFER_SIZE, KMALLOC_MEMSET | KMALLOC_ALIGN_256, "print-buf"); - } -} - -/*! - * Empty output buffer (only if MasterDebug) - * DONE - * EXACT - */ -void clear_output() { - if (MasterDebug) { - kstrcpy((char*)Ptr(OutputBufArea + sizeof(ListenerMessageHeader)).c(), ""); - OutputPending = Ptr(0); - } -} - -/*! - * Clear all data in the print buffer - * DONE - * EXACT - */ -void clear_print() { - *Ptr(PrintBufArea + sizeof(ListenerMessageHeader)) = 0; - PrintPending = Ptr(0); -} - -/*! - * Buffer message to compiler indicating the target has reset. - * Write to the beginning of the output buffer. - * DONE, EXACT - */ -void reset_output() { - if (MasterDebug) { -// original GOAL: -// sprintf(OutputBufArea.cast().c() + sizeof(ListenerMessageHeader), "reset #x%x\n", -// s7.offset); - -// modified for OpenGOAL: -#ifdef _WIN32 - sprintf(OutputBufArea.cast().c() + sizeof(ListenerMessageHeader), - "reset #x%x #x%llx %s\n", s7.offset, (unsigned long long)g_ee_main_mem, // grr - xdbg::get_current_thread_id().to_string().c_str()); -#else - sprintf(OutputBufArea.cast().c() + sizeof(ListenerMessageHeader), "reset #x%x #x%lx %s\n", - s7.offset, (uintptr_t)g_ee_main_mem, xdbg::get_current_thread_id().to_string().c_str()); -#endif - OutputPending = OutputBufArea + sizeof(ListenerMessageHeader); - } -} - -/*! - * Buffer message to compiler indicating some object file has been unloaded. - * DONE, EXACT - */ -void output_unload(const char* name) { - if (MasterDebug) { - sprintf(strend(OutputBufArea.cast().c() + sizeof(ListenerMessageHeader)), - "unload \"%s\"\n", name); - OutputPending = OutputBufArea + sizeof(ListenerMessageHeader); - } -} - -/*! - * Buffer message to compiler indicating some object file has been loaded. - */ -void output_segment_load(const char* name, Ptr link_block, u32 flags) { - if (MasterDebug) { - char* buffer = strend(OutputBufArea.cast().c() + sizeof(ListenerMessageHeader)); - char true_str[] = "t"; - char false_str[] = "nil"; - char* flag_str = (flags & LINK_FLAG_OUTPUT_TRUE) ? true_str : false_str; - auto lbp = link_block.cast(); - // modified to also include segment sizes. - sprintf(buffer, "load \"%s\" %s #x%x #x%x #x%x #x%x #x%x #x%x\n", name, flag_str, - lbp->code_infos[0].offset, lbp->code_infos[1].offset, lbp->code_infos[2].offset, - lbp->code_infos[0].size, lbp->code_infos[1].size, lbp->code_infos[2].size); - OutputPending = OutputBufArea + sizeof(ListenerMessageHeader); - } -} - -/*! - * Print to the GOAL print buffer from C - * seeks PrintPending to begining of what was just printed. - * This is a different behavior from all the other prints! - * DONE, EXACT - */ -void cprintf(const char* format, ...) { - va_list args; - va_start(args, format); - char* str = PrintPending.cast().c(); - if (!PrintPending.offset) - str = PrintBufArea.cast().c() + sizeof(ListenerMessageHeader); - PrintPending = make_ptr(strend(str)).cast(); - vsprintf((char*)PrintPending.c(), format, args); - - va_end(args); -} - -/*! - * Print directly to the C stdout - * The "k" parameter is ignored, so this is just like printf - * DONE, EXACT - */ -void Msg(s32 k, const char* format, ...) { - (void)k; - va_list args; - va_start(args, format); - vprintf(format, args); - va_end(args); -} - -/*! - * Print directly to the C stdout - * This is idential to Msg - * DONE, EXACT - */ -void MsgWarn(const char* format, ...) { - va_list args; - va_start(args, format); - vprintf(format, args); - va_end(args); -} - -/*! - * Print directly to the C stdout - * This is idential to Msg - * DONE, EXACT - */ -void MsgErr(const char* format, ...) { - va_list args; - va_start(args, format); - vprintf(format, args); - va_end(args); -} - -/*! - * Reverse string in place. - * DONE, EXACT - */ -void reverse(char* str) { - s32 i = 0; - s32 end = (s32)strlen(str); - while (end--, i < end) { - char c = str[i]; - str[i] = str[end]; - str[end] = c; - i++; - } -} - -/*! - * Some sort of rounding for printing floating point numbers. - * It is unused and believed to be not correct. - * Currently copy-pasta from GHIDRA - */ -char* round(float x, s32* param1, char* start, char* sEnd, char padchar, s32* param4) { - char cVar1; - char* local_58; - float f; - - if (x == 0.00000000) { - f = padchar - '0'; - } else { - modff(x * 10.00000000, &f); - } - if (4.00000000 < f) { - while (true) { - if (*sEnd == '.') { - sEnd = sEnd + -1; - } - cVar1 = *sEnd; - *sEnd = cVar1 + 1; - if ((char)(cVar1 + 1) <= '9') { - return start; - } - *sEnd = '0'; - if (sEnd == start) - break; - sEnd = sEnd + -1; - } - if (param1 == (int*)0x0) { - sEnd[-1] = '1'; - local_58 = start + -1; - } else { - *sEnd = '1'; - *param1 = *param1 + 1; - local_58 = start; - } - } else { - local_58 = start; - if (*param4 == 0x2d) { - while (true) { - if (*sEnd == '.') { - sEnd = sEnd + -1; - } - local_58 = start; - if (*sEnd != '0') - break; - if (sEnd == start) { - *param4 = 0; - } - sEnd = sEnd + -1; - } - } - } - return local_58; -} - -/*! - * Convert floating point to string intermediate function. - * Places a null character as the first character, then the integers, decimal, fraction digits - * Presumably, if rounding worked, it would sometimes add an additional digit in front instead of - * the null but rounding doesn't, so you get a null in front every time. There is no null terminator - * added, you have to do it yourself. returned value is length : buff[last_char] - buff[1] (not - * including the leading null) if the number is negative, *lead_char = '-'. Otherwise it's '\0'. - * The negative is not inserted for you. - * The precision is how many digits after decimal to print. - * The flag could have a 1 to enable rounding, but this doesn't work, so don't use it. - * Without rounding the printing is a little bit off but you don't notice unless you look too - * closely. - * - * DONE, added some sanity checks and removed support for "rounding" as round isn't implemented and - * rounding is never used in the game. - */ -s32 cvt_float(float x, s32 precision, s32* lead_char, char* buff_start, char* buff_end, u32 flags) { - // put a null at the beginning of the output - *buff_start = 0; - s32 forward_count = 0; - - // compute absolute value and set lead char to `-` if needed. - float abs_x; - if (x < 0.0f) { - abs_x = -x; - *lead_char = '-'; - } else { - *lead_char = 0; - abs_x = x; - } - - // nan check - u32 abs_x_u32 = *(u32*)&abs_x; - if ((abs_x_u32 & 0x7fffffff) == 0x7fffffff) { - kstrcpy(buff_start, "NaN"); - return 3; // the length of NaN - } - - // find fraction and integer parts of absolute value. - float integer_part; - float fraction_part = std::modf(abs_x, &integer_part); - - char* start_ptr = buff_start + 1; // the null terminator is at buff_start[0]. - char* end_ptr = buff_end - 1; // the last char we can write to. - - // loop over integer digits (increasing significance) - while (start_ptr <= end_ptr && (integer_part != 0.0f)) { - // the fractional part will be the lowest place integer divided by 10 - float next_int = std::modf(integer_part / 10.f, &integer_part); - - // the float to round to get the integer - float rounder = next_int * 10.f + 0.5f; - - // but wait, the PS2 is stupid and maybe has weird floats that might not convert well. - // this checks for very large exponent or negative sign bit, which would only happen if the - // float is all messed up. - u32 ru32 = *(u32*)&rounder; - s32 value; - if (((ru32 >> 0x17) & 0xff) < 0x9e) { // exponent - value = (char)rounder; - } else if (!(ru32 >> 31)) { // sign bit - value = 0; - // ASSERT(false); // not sure what happens here. - } else { - value = -1; // happens on NaN's - } - - // place number at the end of the buffer and move pointer back - *end_ptr = '0' + value; - end_ptr--; - - // track how many integers we've written - forward_count++; - } - - char* count_chrp = start_ptr; // one after the buffer start (null) - if (forward_count == 0) { // no integers - *start_ptr = '0'; // put leading zero - count_chrp = buff_start + 2; // and set count to two after buffer start - } else { - while (end_ptr = end_ptr + 1, - end_ptr < buff_end) { // copy back to the beginning (will be in right order) - *count_chrp = *end_ptr; - count_chrp++; - } - } - - // if we have digits after decimal, place decimal. - if (precision) { - *count_chrp = '.'; - count_chrp++; - } - - s32 prec = precision; - - // if we have a fractional part, we may need to either print it, or do rounding. - if (fraction_part != 0.0f) { - prec = precision; - if (precision) { - // same loop as before, but only over the number of digits we actually want to print. - do { - float next_int; - fraction_part = std::modf(fraction_part * 10.f, &next_int); - u32 ru32 = *(u32*)&next_int; - s32 value; - if (((ru32 >> 0x17) & 0xff) < 0x9e) { - value = (char)next_int; - } else if (!(ru32 >> 0x1f)) { - value = 0; - // ASSERT(false); // not sure what happens here. - } else { - value = -1; // happens on NaN's - } - *count_chrp = value + '0'; - count_chrp++; - prec--; - } while ((prec) && (fraction_part != 0.f)); - } - - // if the rounding flag is enabled, we would round here. - // however, the rounding flag is always disabled and the rounding code doesn't work. - if ((fraction_part != 0.f) && ((flags & 1) != 0)) { - start_ptr = round(fraction_part, nullptr, start_ptr, count_chrp - 1, 0, lead_char); - ASSERT(false); - } - } - - // if there are any left over digits (fraction part = 0 before we got to the end), append zeros. - while (prec = prec - 1, prec != -1) { - *count_chrp = '0'; - count_chrp++; - } - // return length. not including the null character at the beginning. - return count_chrp - start_ptr; -} - -/*! - * Convert floating point to a string. - * Don't set the precision too high or you get NaN (if float is longer than 31 digits without - * negative sign) Don't set the flags. Rounding is a little bit off, but it adds character. Highly - * recommended to pad with spaces, not zeros. If you pad with spaces you get " -1.23" If you pad - * with zeros, you get "0000000-1.23" which most people consider to be wrong. - * @param out_str : output buffer to write null terminated string into - * @param x : number - * @param desired_len : length (will pad if under, nothing if over) - * @param pad_char : character to pad with - * @param precision - * @param flags - * - * DONE - * - */ -void ftoa(char* out_str, float x, s32 desired_len, char pad_char, s32 precision, u32 flags) { - char buff[0x100]; - char* current_buff = buff; - s32 lead_char; - - // do conversion, but only write into the first half of the buffer (128 chars) - s32 count = cvt_float(x, precision, &lead_char, current_buff, buff + 0x7f, flags); - - // if it ends up larger than 31 characters, it's probably gone horribly wrong and we should just - // put NaN instead. Or maybe somebody requested a lot of precision. That would be stupid and they - // deserve to see NaN. - if (count > 0x3f) { - kstrcpy(current_buff, "NaN"); - count = 3; - lead_char = 0; - } - - // always true because we don't round, - if (buff[0] == 0) { - current_buff = buff + 1; - } - - // length, including the leading negative (if we need it). - s32 real_count = (lead_char != 0) + count; - - char* out_ptr = out_str; - - // pad - if ((desired_len > 0) && (desired_len > real_count)) { - for (s32 i = 0; i < (desired_len - real_count); i++) { - *out_ptr = pad_char; - out_ptr++; - } - } - - // leading - if (lead_char) { - *out_ptr = lead_char; - out_ptr++; - } - - // copy numbers - for (s32 i = 0; i < count; i++) { - *out_ptr = *current_buff; - out_ptr++; - current_buff++; - } - - // null terminate! - *out_ptr = 0; -} - -/*! - * Convert integer to string. - * @param buffer : buffer to print into. Must be at least as long as the longest possible number to - * print - * @param value : value to print. - * @param base : base to print in (2, 10, 16 supported) - * @param length : length. if shorter than length, pad with pad. If longer, only truncate leading - * f's 1's in base 16 or 2 - * @param pad : character to pad with - * @param flags : flag. Only the 2nd bit is used, which will disable negative sings on - * binary/hexadecimal truncated numbers. Something like -1 (0xffffffff) will print as -fffffff.... - */ - -char* kitoa(char* buffer, s64 value, u64 base, s32 length, char pad, u32 flag) { - s64 negativeValue = 0; - s64 value_to_print = value; - - // if negative and base ten, we print the opposite of the value and add a negative sign - if ((value < 0) && base == 10) { - negativeValue = value; - value_to_print = -value; - } - - // write number in reverse - int count = 0; - do { - buffer[count++] = ConvertTable[(u64)value_to_print % (u64)base]; - value_to_print = (u64)value_to_print / (u64)base; - } while (value_to_print); - - // append negative if we need to - if (negativeValue < 0) { - buffer[count++] = '-'; - } - - // pad (probably some sort of for loop) - s32 rLen = length; - if (0 < length - count) { - rLen = length - count; - while (0 < rLen) { - buffer[count++] = pad; - rLen--; - } - } - - // truncate f's / 1's - if (rLen > 0 && value < 0 && (base == 2 || base == 16) && rLen < count) { - char c = (base == 16) ? 'f' : '1'; - - while (rLen < count && (buffer[count - 1] == c)) { - count--; - } - - if (!(flag & 2)) { - buffer[count++] = '-'; - } - } - - // null terminate, reverse, return! - buffer[count] = 0; - reverse(buffer); - return buffer; -} - -/*! - * Convert 128-bit integer to string. Not implemented because it is never used in the game. - * It would also require passing 128-bit values between GOAL and C++ and this is not worth - * implementing. It is only used by the "format" function, which cannot use it properly. "format" - * uses C varags, but 128-bit varags don't work, so "format" always passes 0 for quadword printing. - */ -void kqtoa() { - ASSERT(false); -} - -struct format_struct { - char data[0x40]; - void reset() { - for (auto& c : data) - c = -1; - } -}; - /*! * The GOAL "format" function. The actual function is named "format". However, GOAL's calling * convention differs from x86-64, so GOAL cannot directly call format. There is an assembly @@ -592,7 +32,8 @@ struct format_struct { * defined in format_wrapper.nasm that places the GOAL arguments on the stack and calls this * format_impl function with a single argument that is a pointer to the argument array. */ -s32 format_impl(uint64_t* args) { +s32 format_impl_jak1(uint64_t* args) { + using namespace jak1; // first two args are dest, format string uint64_t* arg_regs = args + 2; diff --git a/game/kernel/jak1/kprint.h b/game/kernel/jak1/kprint.h new file mode 100644 index 0000000000..2e896eb899 --- /dev/null +++ b/game/kernel/jak1/kprint.h @@ -0,0 +1,12 @@ +#pragma once + +/*! + * @file kprint.h + * GOAL Print. Contains GOAL I/O, Print, Format... + */ + +#include "common/common_types.h" + +extern "C" { +s32 format_impl_jak1(uint64_t* args); +} diff --git a/game/kernel/kscheme.cpp b/game/kernel/jak1/kscheme.cpp similarity index 87% rename from game/kernel/kscheme.cpp rename to game/kernel/jak1/kscheme.cpp index 5280e60ffd..8ee98872a5 100644 --- a/game/kernel/kscheme.cpp +++ b/game/kernel/jak1/kscheme.cpp @@ -1,96 +1,36 @@ -/*! - * @file kscheme.cpp - * Implementation of GOAL runtime. - */ +#include "kscheme.h" #include -#include "kscheme.h" + #include "common/common_types.h" -#include "common/goal_constants.h" -#include "kmachine.h" -#include "klisten.h" -#include "kmalloc.h" -#include "kprint.h" -#include "fileio.h" -#include "kmemcard.h" -#include "kboot.h" -#include "kdsnetm.h" -#include "kdgo.h" -#include "klink.h" -#include "common/symbols.h" -#include "common/versions.h" -#include "common/goal_constants.h" #include "common/log/log.h" +#include "common/symbols.h" #include "common/util/Timer.h" + +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/kdgo.h" +#include "game/kernel/common/kdsnetm.h" +#include "game/kernel/common/klink.h" +#include "game/kernel/common/kmalloc.h" +#include "game/kernel/common/kmemcard.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/common/kscheme.h" +#include "game/kernel/jak1/fileio.h" +#include "game/kernel/jak1/kdgo.h" +#include "game/kernel/jak1/klink.h" +#include "game/kernel/jak1/klisten.h" +#include "game/kernel/jak1/kmachine.h" +#include "game/kernel/jak1/kprint.h" #include "game/mips2c/mips2c_table.h" -#include "common/util/Assert.h" -//! Controls link mode when EnableMethodSet = 0, MasterDebug = 1, DiskBoot = 0. Will enable a -//! warning message if EnableMethodSet = 1 -u32 FastLink; +using namespace jak1_symbols; +namespace jak1 { // where to put a new symbol for the most recently searched for symbol that wasn't found u32 symbol_slot; -// pointer to the "second" symbol table -Ptr SymbolTable2; - -// pointer to the last symbol -Ptr LastSymbol; - -// total number of symbols in the table -s32 NumSymbols; - -// set to true to enable propagating method overrides to child types -// this is an O(N_max_symbols) operation, so it is avoided when loading DGOs for levels. -// but is enabled when loading the engine. -Ptr EnableMethodSet; - -// used for crc32 calculation -u32 crc_table[0x100]; - -// value of the GOAL s7 register, pointing to the middle of the symbol table -Ptr s7; - void kscheme_init_globals() { - for (auto& x : crc_table) { - x = 0; - } - NumSymbols = 0; - s7.offset = 0; - SymbolTable2.offset = 0; - LastSymbol.offset = 0; - EnableMethodSet.offset = 0; - FastLink = 0; -} - -/*! - * Initialize CRC Table. - */ -void init_crc() { - for (u32 i = 0; i < 0x100; i++) { - u32 n = i << 24; - for (u32 j = 0; j < 8; j++) { - n = n & 0x80000000 ? (n << 1) ^ CRC_POLY : (n << 1); - } - crc_table[i] = n; - } -} - -/*! - * Take the CRC32 hash of some data - */ -u32 crc32(const u8* data, s32 size) { - uint32_t crc = 0; - for (int i = size; i != 0; i--, data++) { - crc = crc_table[crc >> 24] ^ ((crc << 8) | *data); - } - - if ((~crc) == 0) { - // if this happens, I think the hash table implementation breaks. - ASSERT(false); - } - return ~crc; + symbol_slot = 0; } /*! @@ -104,22 +44,6 @@ u64 new_illegal(u32 allocation, u32 type) { return s7.offset; } -/*! - * Delete method for types which cannot have "delete" used on them. - * Prints an error to stdout and returns false. - */ -u64 delete_illegal(u32 obj) { - MsgErr("dkernel: illegal attempt to call delete of static object @ #x%x\n", obj); - return s7.offset; // todo, maybe don't return anything? -} - -/*! - * Wrapper around kmalloc to allow GOAL programs to allocate on kernel heaps. - */ -u64 goal_malloc(u32 heap, u32 size, u32 flags, u32 name) { - return kmalloc(Ptr(heap), size, flags, Ptr(name)->data()).offset; -} - /*! * Allocate memory from the specified heap. If symbol is 'process, does a process allocation. * If symbol is 'scratch, does a scratch allocation (this is not used). @@ -132,6 +56,7 @@ u64 goal_malloc(u32 heap, u32 size, u32 flags, u32 name) { * UNKNOWN_PROCESS (UINT32_MAX). */ u64 alloc_from_heap(u32 heapSymbol, u32 type, s32 size, u32 pp) { + using namespace jak1_symbols; ASSERT(size > 0); // align to 16 bytes (part one) @@ -298,6 +223,7 @@ void delete_pair(u32 s) { * Allocates from the global heap. */ u64 make_string(u32 size) { + using namespace jak1_symbols; auto mem_size = size + 1; // null if (mem_size < 8) { mem_size = 8; // min size of string @@ -708,10 +634,10 @@ Ptr find_symbol_from_c(const char* name) { } } - auto bits = bits_for_sym() - 1; + auto bits = jak1::bits_for_sym() - 1; s32 sh1 = hash << (0x20 - bits); s32 sh2 = sh1 >> (0x20 - bits - 3); - // will be signed, bottom 3 bits 0 (for alignment, symbol are every 8 bytes) + // will be signed, bottom 3 bits 0 (for alignment, symbols are every 8 bytes) // upper 16 bits are the same, so we will reach +/- 8 kb around 0. if (sh2 > 0) { @@ -850,7 +776,6 @@ Ptr intern_type_from_c(const char* name, u64 methods) { return type; } } - /*! * Wrapper of intern_type_from_c to use with GOAL. It accepts a gstring as a name. */ @@ -858,6 +783,23 @@ u64 intern_type(u32 name, u64 methods) { return intern_type_from_c(Ptr(name)->data(), methods).offset; } +/*! + * Configure a type. + */ +Ptr set_type_values(Ptr type, Ptr parent, u64 flags) { + type->parent = parent; + type->allocated_size = (flags & 0xffff); + type->heap_base = (flags >> 16) & 0xffff; + type->padded_size = ((type->allocated_size + 0xf) & 0xfff0); + + u16 new_methods = (flags >> 32) & 0xffff; + if (type->num_methods < new_methods) { + type->num_methods = new_methods; + } + + return type; +} + /*! * Setup a type which is located in a fixed spot of the symbol table. */ @@ -937,13 +879,6 @@ u64 new_type(u32 symbol, u32 parent, u64 flags) { Ptr* child_slots = &(new_type->new_method); Ptr* parent_slots = &(Ptr(parent)->new_method); - // if (Ptr(parent)->num_methods < n_methods) { - // printf("%s %d %d\n", info(Ptr(symbol))->str.c()->data(), - // Ptr(parent)->num_methods, - // n_methods); - // ASSERT(false); - // } - // BUG! This uses the child method count, but should probably use the parent method count. for (u32 i = 0; i < n_methods; i++) { // for (u32 i = 0; i < Ptr(parent)->num_methods; i++) { @@ -953,23 +888,6 @@ u64 new_type(u32 symbol, u32 parent, u64 flags) { return set_type_values(new_type, Ptr(parent), flags).offset; } -/*! - * Configure a type. - */ -Ptr set_type_values(Ptr type, Ptr parent, u64 flags) { - type->parent = parent; - type->allocated_size = (flags & 0xffff); - type->heap_base = (flags >> 16) & 0xffff; - type->padded_size = ((type->allocated_size + 0xf) & 0xfff0); - - u16 new_methods = (flags >> 32) & 0xffff; - if (type->num_methods < new_methods) { - type->num_methods = new_methods; - } - - return type; -} - /*! * Is t1 a t2? */ @@ -1113,52 +1031,6 @@ u64 method_set(u32 type_, u32 method_id, u32 method) { return method; } -extern "C" { -// defined in asm_funcs.asm -#ifdef __linux__ -uint64_t _call_goal_asm_linux(u64 a0, u64 a1, u64 a2, void* fptr, void* st_ptr, void* offset); -uint64_t _call_goal_on_stack_asm_linux(u64 rsp, - u64 u0, - u64 u1, - void* fptr, - void* st_ptr, - void* offset); -#elif _WIN32 -uint64_t _call_goal_asm_win32(u64 a0, u64 a1, u64 a2, void* fptr, void* st_ptr, void* offset); -uint64_t _call_goal_on_stack_asm_win32(u64 rsp, void* fptr, void* st_ptr, void* offset); -#endif -} - -/*! - * Wrapper around _call_goal_asm for calling a GOAL function from C. - * Calls from the parent stack. - */ -u64 call_goal(Ptr f, u64 a, u64 b, u64 c, u64 st, void* offset) { - // auto st_ptr = (void*)((uint8_t*)(offset) + st); updated for the new compiler! - void* st_ptr = (void*)st; - - void* fptr = f.c(); -#ifdef __linux__ - return _call_goal_asm_linux(a, b, c, fptr, st_ptr, offset); -#elif _WIN32 - return _call_goal_asm_win32(a, b, c, fptr, st_ptr, offset); -#endif -} - -/*! - * Wrapper around _call_goal_asm_on_stack for switching stacks and calling a GOAL function there. - */ -u64 call_goal_on_stack(Ptr f, u64 rsp, u64 st, void* offset) { - void* st_ptr = (void*)st; - - void* fptr = f.c(); -#ifdef __linux__ - return _call_goal_on_stack_asm_linux(rsp, 0, 0, fptr, st_ptr, offset); -#elif _WIN32 - return _call_goal_on_stack_asm_win32(rsp, fptr, st_ptr, offset); -#endif -} - /*! * Call a GOAL method of a given type. */ @@ -1181,13 +1053,6 @@ u64 call_method_of_type(u32 arg, Ptr type, u32 method_id) { return arg; } -/*! - * Call a GOAL function with no arguments. - */ -u64 call_goal_function(Ptr func) { - return call_goal(func, 0, 0, 0, s7.offset, g_ee_main_mem); -} - /*! * Call a global GOAL function by name. */ @@ -1213,11 +1078,13 @@ u64 call_method_of_type_arg2(u32 arg, Ptr type, u32 method_id, u32 a1, u32 (*type_tag).offset); } } - printf("[ERROR] call_method_of_type_arg2 failed!\n"); - ASSERT(false); + ASSERT_MSG(false, "[ERROR] call_method_of_type_arg2 failed!"); return arg; } +u64 print_object(u32 obj); +u64 print_pair(u32 obj); + /*! * Print an object with a newline after it to the GOAL PrintBuffer (not stdout) */ @@ -1250,15 +1117,6 @@ u64 print_object(u32 obj) { return obj; } -/*! - * Default print method for structures. - * Structures have no runtime type info, so there's not much we can do here. - */ -u64 print_structure(u32 s) { - cprintf("#", s); - return s; -} - /*! * Default print method a basic. * Confirms basic is valid and prints the type name. @@ -1309,53 +1167,6 @@ u64 print_pair(u32 obj) { return obj; } -/*! - * Print an integer. Works correctly for 64-bit integers. - */ -u64 print_integer(u64 obj) { - // not sure why this is any better than cprintf("%ld") or similar. Maybe a tiny bit faster? - char* str = PrintPending.cast().c(); - if (!str) { - str = (PrintBufArea + 0x18).cast().c(); - } - - PrintPending = make_ptr(strend(str)).cast(); - kitoa((char*)PrintPending.c(), obj, 10, 0xffffffff, '0', 0); - return obj; -} - -/*! - * Print a boxed integer. Works correctly for 64-bit integers. Assumes signed. - */ -u64 print_binteger(u64 obj) { - char* str = PrintPending.cast().c(); - if (!PrintPending.offset) { - str = (PrintBufArea + 0x18).cast().c(); - } - - PrintPending = make_ptr(strend(str)).cast(); - kitoa((char*)PrintPending.c(), ((s64)obj) >> 3, 10, 0xffffffff, '0', 0); - return obj; -} - -/*! - * Print floating point number. - */ -u64 print_float(u32 f) { - // again not sure why this is any better than cprintf("%f") or similar. Maybe a tiny bit faster? - float ff; - *(u32*)&ff = f; - char* str = PrintPending.cast().c(); - if (!PrintPending.offset) { - str = (PrintBufArea + 0x18).cast().c(); - } - - PrintPending = make_ptr(strend(str)).cast(); - - ftoa((char*)PrintPending.c(), ff, 0xffffffff, ' ', 4, 0); - return f; -} - /*! * Print method for symbol. Just prints the name without quotes or anything fancy. */ @@ -1409,14 +1220,6 @@ u64 print_function(u32 obj) { return obj; } -/*! - * Print method for VU functions. Again, just prints address. - */ -u64 print_vu_function(u32 obj) { - cprintf("#", obj); - return obj; -} - /*! * Get the allocated size field of a basic. By default we grab this from the type struct. * Dynamically sized basics should override this method. @@ -1425,22 +1228,6 @@ u64 asize_of_basic(u32 it) { return Ptr(*Ptr(it - BASIC_OFFSET))->allocated_size; } -/*! - * Copy method that does no copying. - */ -u64 copy_fixed(u32 it) { - return it; -} - -/*! - * Default copy for a structure. Since this has no idea of the actual type, it doesn't know what - * size to copy. So we do no copy and return a reference to the original data. - */ -u64 copy_structure(u32 it, u32 unknown) { - (void)unknown; - return it; -} - /*! * Create a copy of a basic. If the destination isn't identified as a symbol, treat it as an * address. This seems a little bit unsafe to me, as it reads the 4-bytes before the given address @@ -1467,6 +1254,8 @@ u64 copy_basic(u32 obj, u32 heap, u32 /*unused*/, u32 pp) { return result; } +u64 inspect_pair(u32 obj); + /*! * Highest level inspect method. Won't inspect 64-bit bintegers correctly. */ @@ -1499,44 +1288,6 @@ u64 inspect_pair(u32 obj) { return obj; } -/*! - * Inspect an integer (works correctly on 64-bit integers) - */ -u64 inspect_integer(u64 obj) { - // and now we're using cprintf. Why doesn't print do this? - cprintf("[%16lx] fixnum %ld\n", obj, obj); - return obj; -} - -/*! - * Inspect a boxed integer (works correctly on 64-integers) - */ -u64 inspect_binteger(u64 obj) { - cprintf("[%16lx] boxed-fixnum %ld\n", obj, s64(obj) >> 3); - return obj; -} - -/*! - * Inspect a floating point number - */ -u64 inspect_float(u32 f) { - float ff; - ff = *(float*)(&f); - cprintf("[%8x] float ", f); - - // likely copy-pasta - no need for this check because of the cprintf immediately before. - char* str = PrintPending.cast().c(); - if (!str) { - str = (PrintBufArea + 0x18).cast().c(); - } - - PrintPending = make_ptr(strend(str)).cast(); - - ftoa(PrintPending.cast().c(), ff, -1, ' ', 4, 0); - cprintf("\n"); - return f; -} - /*! * Inspect a string. There's a typo in allocated_length (has underscore instead of dash). * This typo is fixed in later games. @@ -1598,14 +1349,6 @@ u64 inspect_type(u32 obj) { return obj; } -/*! - * Inspect a structure. - */ -u64 inspect_structure(u32 obj) { - cprintf("[%8x] structure\n", obj); - return obj; -} - /*! * Inspect a basic. This is just a fallback for basics which don't know how to inspect themselves. * We just use print_object. @@ -1640,33 +1383,6 @@ u64 inspect_link_block(u32 ob) { return ob; } -/*! - * Inspect a VU Function. Doesn't seem to be used. Also the concept of "vu-function" - * isn't really used. VU0 macro mode stuff goes in normal functions, and micro-mode stuff goes - * in a giant dump of many functions thats loaded and unloaded all at the same time. - */ -u64 inspect_vu_function(u32 obj) { - struct VuFunction { - u32 length; - u32 origin; - u32 qlength; - }; - - auto vf = Ptr(obj); - cprintf("[%8x] vu-function\n\tlength: %d\n\torigin: #x%x\n\tqlength: %d\n", obj, vf->length, - vf->origin, vf->qlength); - return obj; -} - -/*! - * This doesn't exist in the game, but we add it as a wrapper around kheapstatus. - * Note that this isn't a great inspect as it prints to stdout instead of the printbuffer. - */ -u64 inspect_kheap(u32 obj) { - kheapstatus(Ptr(obj)); - return obj; -} - /*! * Doesn't exist in the game. Maybe it was a macro? */ @@ -1674,31 +1390,6 @@ u64 pack_type_flag(u64 methods, u64 heap_base, u64 size) { return (methods << 32) + (heap_base << 16) + (size); } -// void iterate_symbol_table(std::function f) { -// auto sym = s7.offset; -// for (; sym < LastSymbol.offset; sym += 8) { -// f(sym); -// } -// -// sym = SymbolTable2.offset; -// for (; sym < s7.offset; sym += 8) { -// f(sym); -// } -//} -// -// void print_symbol_table() { -// u32 sym_cnt = 0; -// iterate_symbol_table([&](u32 sym) { -// if (info(Ptr(sym))->hash) { -// sym_cnt++; -// inspect_object(sym); -// // inspect_object(Ptr(sym)->value); -// // printf("\n"); -// } -// }); -// cprintf("Total %d symbols\n", sym_cnt); -//} - /*! * TODO remove me! */ @@ -1718,10 +1409,10 @@ s32 InitHeapAndSymbol() { Mips2C::gLinkedFunctionTable = {}; // allocate memory for the symbol table auto symbol_table = - kmalloc(kglobalheap, SYM_TABLE_MEM_SIZE, KMALLOC_MEMSET, "symbol-table").cast(); + kmalloc(kglobalheap, jak1::SYM_TABLE_MEM_SIZE, KMALLOC_MEMSET, "symbol-table").cast(); // pointer to the middle symbol is stored in the s7 register. - s7 = symbol_table + (GOAL_MAX_SYMBOLS / 2) * 8 + BASIC_OFFSET; + s7 = symbol_table + (jak1::GOAL_MAX_SYMBOLS / 2) * 8 + BASIC_OFFSET; // pointer to the first symbol (SymbolTable2 is the "lower" symbol table) SymbolTable2 = symbol_table + BASIC_OFFSET; // the last symbol we will ever access. @@ -1957,7 +1648,7 @@ s32 InitHeapAndSymbol() { make_function_symbol_from_c("load", (void*)load); make_function_symbol_from_c("loado", (void*)loado); make_function_symbol_from_c("unload", (void*)unload); - make_stack_arg_function_symbol_from_c("_format", (void*)format_impl); + make_stack_arg_function_symbol_from_c("_format", (void*)format_impl_jak1); // allocations make_function_symbol_from_c("malloc", (void*)alloc_heap_memory); @@ -2005,11 +1696,10 @@ s32 InitHeapAndSymbol() { method_set_symbol->value = 0; // set *boot-video-mode* - intern_from_c("*boot-video-mode*")->value = 0; + intern_from_c("*boot-video-mode*")->value = 0; // (u32)BootVideoMode; lg::info("Initialized GOAL heap in {:.2} ms", heap_init_timer.getMs()); // load the kernel! - // todo, remove MasterUseKernel if (MasterUseKernel) { Timer kernel_load_timer; method_set_symbol->value++; @@ -2041,7 +1731,7 @@ s32 InitHeapAndSymbol() { InitListener(); // Do final initialization, including loading and initializing the engine. - InitMachineScheme(); + jak1::InitMachineScheme(); // testing stuff: make_function_symbol_from_c("test-function", (void*)test_function); @@ -2142,4 +1832,4 @@ s64 load_and_link(const char* filename, char* decode_name, kheapinfo* heap, u32 return (s32)rv.offset; } -// todo, read lcock code +} // namespace jak1 diff --git a/game/kernel/kscheme.h b/game/kernel/jak1/kscheme.h similarity index 66% rename from game/kernel/kscheme.h rename to game/kernel/jak1/kscheme.h index 921c4eaf15..facf58077b 100644 --- a/game/kernel/kscheme.h +++ b/game/kernel/jak1/kscheme.h @@ -1,34 +1,11 @@ #pragma once -/*! - * @file kscheme.h - * Implementation of GOAL runtime. - */ - -#include "common/common_types.h" #include "common/goal_constants.h" -#include "kmachine.h" -#include "kmalloc.h" -extern u32 FastLink; -extern s32 NumSymbols; -extern Ptr EnableMethodSet; -extern Ptr s7; -extern Ptr SymbolTable2; -extern Ptr LastSymbol; +#include "game/kernel/common/kmalloc.h" +#include "game/kernel/common/kscheme.h" -constexpr u32 EMPTY_HASH = 0x8454B6E6; -constexpr u32 OFFSET_MASK = 7; -constexpr u32 CRC_POLY = 0x04c11db7; -constexpr u32 SYM_TABLE_END = GOAL_MAX_SYMBOLS - 32; - -constexpr u32 DEFAULT_METHOD_COUNT = 12; -constexpr u32 FALLBACK_UNKNOWN_METHOD_COUNT = 44; - -struct String { - u32 len; - char* data() { return ((char*)this) + sizeof(String); } -}; +namespace jak1 { struct SymInfo { u32 hash; @@ -40,10 +17,12 @@ struct Symbol { }; inline Ptr info(Ptr s) { - return s.cast() + SYM_INFO_OFFSET; + return s.cast() + jak1::SYM_INFO_OFFSET; } -struct Function {}; +constexpr u32 DEFAULT_METHOD_COUNT = 12; +constexpr u32 FALLBACK_UNKNOWN_METHOD_COUNT = 44; +constexpr u32 SYM_TABLE_END = jak1::GOAL_MAX_SYMBOLS - 32; /*! * GOAL Type @@ -73,37 +52,25 @@ struct Type { } }; -constexpr uint32_t UNKNOWN_PP = UINT32_MAX; - -u32 crc32(const u8* data, s32 size); void kscheme_init_globals(); -void init_crc(); -u64 alloc_from_heap(u32 heapSymbol, u32 type, s32 size, u32 pp); -u64 alloc_heap_object(u32 heap, u32 type, u32 size, u32 pp); Ptr intern_from_c(const char* name); -Ptr intern_type_from_c(const char* name, u64 methods); -Ptr set_type_values(Ptr type, Ptr parent, u64 flags); -u64 print_object(u32 obj); -u64 print_pair(u32 obj); -u64 print_binteger(u64 obj); -u64 inspect_pair(u32 obj); -u64 inspect_binteger(u64 obj); -s32 InitHeapAndSymbol(); -u64 call_goal(Ptr f, u64 a, u64 b, u64 c, u64 st, void* offset); -u64 call_goal_on_stack(Ptr f, u64 rsp, u64 st, void* offset); -void print_symbol_table(); -u64 make_string_from_c(const char* c_str); -Ptr find_symbol_from_c(const char* name); -u64 call_method_of_type(u32 arg, Ptr type, u32 method_id); -u64 inspect_object(u32 obj); -u64 new_pair(u32 heap, u32 type, u32 car, u32 cdr); -s64 load_and_link(const char* filename, char* decode_name, kheapinfo* heap, u32 flags); u64 load(u32 file_name_in, u32 heap_in); u64 loado(u32 file_name_in, u32 heap_in); u64 unload(u32 name); +s64 load_and_link(const char* filename, char* decode_name, kheapinfo* heap, u32 flags); +u64 make_string_from_c(const char* c_str); +u64 new_pair(u32 heap, u32 type, u32 car, u32 cdr); +u64 inspect_object(u32 obj); +u64 print_object(u32 obj); +Ptr find_symbol_from_c(const char* name); +u64 call_method_of_type(u32 arg, Ptr type, u32 method_id); +Ptr intern_type_from_c(const char* name, u64 methods); +u64 call_method_of_type_arg2(u32 arg, Ptr type, u32 method_id, u32 a1, u32 a2); +u64 alloc_heap_object(u32 heap, u32 type, u32 size, u32 pp); Ptr make_function_symbol_from_c(const char* name, void* f); Ptr make_stack_arg_function_symbol_from_c(const char* name, void* f); +s32 InitHeapAndSymbol(); u64 call_goal_function_by_name(const char* name); -u64 call_method_of_type_arg2(u32 arg, Ptr type, u32 method_id, u32 a1, u32 a2); Ptr alloc_and_init_type(Ptr sym, u32 method_count); Ptr set_fixed_symbol(u32 offset, const char* name, u32 value); +} // namespace jak1 diff --git a/game/kernel/ksound.cpp b/game/kernel/jak1/ksound.cpp similarity index 53% rename from game/kernel/ksound.cpp rename to game/kernel/jak1/ksound.cpp index 7bbc056416..433407244c 100644 --- a/game/kernel/ksound.cpp +++ b/game/kernel/jak1/ksound.cpp @@ -1,23 +1,10 @@ -/*! - * @file ksound.cpp - * There's not much here. My guess is this was set up as framework to match the kmachine.cpp format, - * but whoever did the sound didn't use this. - */ - #include "ksound.h" -#include "kscheme.h" -#include "kdgo.h" -/*! - * Does nothing! - */ -void InitSound() {} - -/*! - * Does nothing! - */ -void ShutdownSound() {} +#include "game/kernel/common/kdgo.h" +#include "game/kernel/common/ksound.h" +#include "game/kernel/jak1/kscheme.h" +namespace jak1 { /*! * Set up some functions which are somewhat related to sound. */ @@ -26,4 +13,9 @@ void InitSoundScheme() { make_function_symbol_from_c("rpc-busy?", (void*)RpcBusy); make_function_symbol_from_c("test-load-dgo-c", (void*)LoadDGOTest); make_stack_arg_function_symbol_from_c("rpc-call", (void*)RpcCall_wrapper); -} \ No newline at end of file + + // PC port interns + make_function_symbol_from_c("pc-sound-set-flava-hack", (void*)set_flava_hack); + make_function_symbol_from_c("pc-sound-set-fade-hack", (void*)set_fade_hack); +} +} // namespace jak1 \ No newline at end of file diff --git a/game/kernel/jak1/ksound.h b/game/kernel/jak1/ksound.h new file mode 100644 index 0000000000..dc12758a1e --- /dev/null +++ b/game/kernel/jak1/ksound.h @@ -0,0 +1,5 @@ +#pragma once + +namespace jak1 { +void InitSoundScheme(); +} \ No newline at end of file diff --git a/game/kernel/jak2/fileio.cpp b/game/kernel/jak2/fileio.cpp new file mode 100644 index 0000000000..13aea7328c --- /dev/null +++ b/game/kernel/jak2/fileio.cpp @@ -0,0 +1,206 @@ +#include "fileio.h" + +#include +#include + +#include "common/versions.h" + +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/kmalloc.h" + +namespace jak2 { + +/*! + * Turn file name into file's path. + * DONE, EXACT + */ +char* DecodeFileName(const char* name) { + char* result; + // names starting with $ are special: + if (name[0] == '$') { + if (!strncmp(name, "$TEXTURE/", 9)) { + result = MakeFileName(TX_PAGE_FILE_TYPE, name + 9, 0); + } else if (!strncmp(name, "$ART_GROUP/", 0xb)) { + result = MakeFileName(ART_GROUP_FILE_TYPE, name + 0xb, 0); + } else if (!strncmp(name, "$LEVEL/", 7)) { + int len = (int)strlen(name); + if (name[len - 4] == '.') { + result = MakeFileName(LEVEL_WITH_EXTENSION_FILE_TYPE, name + 7, 0); + } else { + // level files can omit a file type if desired + result = MakeFileName(LEVEL_FILE_TYPE, name + 7, 0); + } + } else if (!strncmp(name, "$FINAL/", 6)) { // in jak2, this is FINAL instead of DATA + result = MakeFileName(DATA_FILE_TYPE, name + 6, 0); + } else if (!strncmp(name, "$CODE/", 6)) { + result = MakeFileName(CODE_FILE_TYPE, name + 6, 0); + } else if (!strncmp(name, "$RES/", 5)) { + result = MakeFileName(RES_FILE_TYPE, name + 5, 0); + } else if (!strncmp(name, "$MISC/", 6)) { + result = MakeFileName(MISC_FILE_TYPE, name + 6, 0); + } else if (!strncmp(name, "$MAP/", 5)) { + result = MakeFileName(MAP_FILE_TYPE, name + 5, 0); + } else if (!strncmp(name, "$ISO/", 5)) { + result = MakeFileName(ISO_FILE_TYPE, name + 5, 0); + } else { + printf("[ERROR] DecodeFileName: UNKNOWN FILE NAME %s\n", name); + result = nullptr; + } + } else { + // if no special prefix is given, assume $CODE + result = MakeFileName(CODE_FILE_TYPE, name, 0); + } + return result; +} + +/*! + * Build a file name based on type. + * @param type: the file type. + * @param name: the file name + * @param new_string: if true, allocate a new global string for file name. + * will otherwise use a static buffer. + * DONE, Had unused int, char*, and MakeFileNameInfo params. + * PC PORT NOTE : Changed some paths so that they work for us (namely, got rid of 'host') + */ +char* MakeFileName(int type, const char* name, int new_string) { + using namespace versions::jak2; + // start with network filesystem + // kstrcpy(buffer_633, "host:"); + kstrcpy(buffer_633, ""); + char* buf = strend(buffer_633); + + // prefix to build directory + char prefix[64]; + kstrcpy(prefix, FOLDER_PREFIX); + + // build file name + if (type == LISTENER_TO_KERNEL_FILE_TYPE) { + kstrcpy(buf, + "kernel/LISTENERTOKERNEL"); // unused (I guess this is an old method to transfer data?) + } else if (type == KERNEL_TO_LISTENER_FILE_TYPE) { + kstrcpy(buf, + "kernel/KERNELTOLISTENER"); // unused (I guess this is an old method to transfer data?) + } else if (type == CODE_FILE_TYPE) { + sprintf(buf, "game/obj/%s.o", name); // game object file (CODE) + } else if (type == GAMEPAD_FILE_TYPE) { + sprintf(buffer_633, "pad:0"); // I guess the gamepad could be opened like a file at some point? + } else if (type == LISTENER_TO_KERNEL_LOCK_FILE_TYPE) { + kstrcpy(buf, "kernel/LISTENERTOKERNEL_LOCK"); // unused (likely used for LISTENERTOKERNEL?) + } else if (type == KERNEL_TO_LISTENER_LOCK_FILE_TYPE) { + kstrcpy(buf, "kernel/KERNELTOLISTENER_LOCK"); // unused (likley used for KERNELTOLISTENER?) + } else if (type == IOP_MODULE_FILE_TYPE) { // IOP module, overwrite the whole thing. + // this is unused, even by the remaining code to load IOP modules from the network. + // note this uses host0, which I believe is the PS2 TOOL's built in Linux SBC. + sprintf(buffer_633, "host0:/usr/local/sce/iop/modules/%s.irx", name); + } else if (type == DATA_FILE_TYPE) { + // GOAL object file, but containing data instead of code. + // likely packed by a tool that isn't the GOAL compiler. + // sprintf(buf, "%sfinal/%s.go", prefix, name); + sprintf(buf, "%sout/obj/%s.go", prefix, name); + } else if (type == TX_PAGE_FILE_TYPE) { + // Texture Page + // part of level files, so it has a version number. + // sprintf(buf, "%sdata/texture-page%d/%s.go", prefix, TX_PAGE_VERSION, name); + sprintf(buf, "%sout/obj/%s.go", prefix, name); + } else if (type == JA_FILE_TYPE) { + // Art JA (joint animation? no idea) + // part of level files, so it has a version number + sprintf(buf, "%sdb/artdata%d/%s-ja.go", prefix, ART_FILE_VERSION, name); + } else if (type == JG_FILE_TYPE) { + // Art JG (joint group? no idea) + // part of level files, so it has a version number + sprintf(buf, "%sdb/artdata%d/%s-jg.go", prefix, ART_FILE_VERSION, name); + } else if (type == MA_FILE_TYPE) { + // Art MA (??) + // part of level files, so it has a version number + sprintf(buf, "%sdb/artdata%d/%s-ma.go", prefix, ART_FILE_VERSION, name); + } else if (type == MG_FILE_TYPE) { + // Art MG (??) + // part of level files, so it has a version number + sprintf(buf, "%sdb/artdata%d/%s-mg.go", prefix, ART_FILE_VERSION, name); + } else if (type == TG_FILE_TYPE) { + // unused, DATA TG file + sprintf(buf, "%sdb/%s-tg.go", prefix, name); + } else if (type == LEVEL_FILE_TYPE) { + // Level main file. + // part of level files, so it has a version number (a high one, 30!) + sprintf(buf, "%sdb/level%d/%s-bt.go", prefix, LEVEL_FILE_VERSION, name); + // -ag missing in jak2???? + // } else if (type == ART_GROUP_FILE_TYPE) { + // // Level art group file. + // // part of level files, so it has a version number + // sprintf(buf, "%sdata/art-group%d/%s-ag.go", prefix, ART_FILE_VERSION, name); + } else if (type == VS_FILE_TYPE) { + // Level vs file, unused, unknown + // possibly early visibility file? + sprintf(buf, "%sfinal/level%d/%s-vs.go", prefix, LEVEL_FILE_VERSION, name); + } else if (type == TX_FILE_TYPE) { + // Resource? TX file? some sort of texture? + sprintf(buf, "%sfinal/res%d/%s-tx.go", prefix, 1, name); + } else if (type == VS_BIN_FILE_TYPE) { + // level VS bin + // perhaps another format of early visibility data + sprintf(buf, "%sfinal/level%d/%s-vs.bin", prefix, LEVEL_FILE_VERSION, name); + } else if (type == DGO_TXT_FILE_TYPE) { + // Text file in the DGO directory? + // Could have contained a list of files inside the DGO. + sprintf(buf, "%sfinal/dgo%d/%s.txt", prefix, DGO_FILE_VERSION, name); + } else if (type == LEVEL_WITH_EXTENSION_FILE_TYPE) { + // Level file, but with an extension already on it. + sprintf(buf, "%sfinal/level%d/%s", prefix, LEVEL_FILE_VERSION, name); + } else if (type == DATA_DGO_FILE_TYPE) { + // data DGO file (unused, all DGO/CGOs loaded through IOP) + sprintf(buf, "%sfinal/dgo%d/%s.dgo", prefix, DGO_FILE_VERSION, name); + } else if (type == GAME_DGO_FILE_TYPE) { + // game DGO file (unused, all DGO/CGOs loaded through IOP) + sprintf(buf, "game/dgo%d/%s.dgo", DGO_FILE_VERSION, name); + } else if (type == DATA_CGO_FILE_TYPE) { + // data CGO file (unused, all DGO/CGOs loaded through IOP) + sprintf(buf, "%sfinal/dgo%d/%s.cgo", prefix, DGO_FILE_VERSION, name); + } else if (type == GAME_CGO_FILE_TYPE) { + // game CGO file (unused, all DGO/CGOs loaded through IOP) + sprintf(buf, "game/dgo%d/%s.cgo", DGO_FILE_VERSION, name); + } else if (type == CNT_FILE_TYPE) { + // game cnt file (continue point?) + sprintf(buf, "%sfinal/res%d/game-cnt.go", prefix, 1); + } else if (type == RES_FILE_TYPE) { + // RES go file? + sprintf(buf, "%sfinal/res%d/%s.go", prefix, 1, name); + } else if (type == SND_BNK_FILE_TYPE) { + // sound bank + sprintf(buf, "%sfinal/sound%d/%s.bnk", prefix, 1, name); // v1 + } else if (type == MUSIC_BNK_FILE_TYPE) { + // sound bank + sprintf(buf, "%sfinal/music%d/%s.bnk", prefix, 1, name); // v1 + } else if (type == VAG_FILE_TYPE) { + // vagwad file (why the 2?) + sprintf(buf, "%sfinal/vagwad2/%s.%s", prefix, name, ""); // v1, memory bug here + } else if (type == MISC_FILE_TYPE) { + // sound bank + sprintf(buf, "%sfinal/misc/%s", prefix, name); + } else if (type == MAP_FILE_TYPE) { + // map + sprintf(buf, "%sfinal/map%d/%s", prefix, 1, name); // v1 + } else if (type == REFPLANT_FILE_TYPE) { + // REFPLANT? no idea. it's different in jak2. + sprintf(buf, "%sdb/refplant/%s", prefix, name); + } else if (type == ISO_FILE_TYPE) { + sprintf(buffer_633, "/out/iso/%s", name); + } else { + printf("UNKNOWN FILE TYPE %d\n", type); + } + + char* result; + if (!new_string) { + // return pointer to static filename buffer + result = buffer_633; + } else { + // or create a new string on the global heap. + int l = (int)strlen(buffer_633); + result = (char*)kmalloc(kglobalheap, l + 1, 0, "filename").c(); + kstrcpy(result, buffer_633); + } + + return result; +} +} // namespace jak2 diff --git a/game/kernel/jak2/fileio.h b/game/kernel/jak2/fileio.h new file mode 100644 index 0000000000..bf7101172f --- /dev/null +++ b/game/kernel/jak2/fileio.h @@ -0,0 +1,5 @@ +#pragma once + +namespace jak2 { +char* MakeFileName(int type, const char* name, int new_string); +} \ No newline at end of file diff --git a/game/kernel/jak2/kboot.cpp b/game/kernel/jak2/kboot.cpp new file mode 100644 index 0000000000..149632615f --- /dev/null +++ b/game/kernel/jak2/kboot.cpp @@ -0,0 +1,153 @@ +#include "kboot.h" + +#include +#include +#include + +#include "common/goal_constants.h" +#include "common/util/Timer.h" + +#include "game/common/game_common_types.h" +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/Symbol4.h" +#include "game/kernel/common/klisten.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/common/kscheme.h" +#include "game/kernel/common/ksocket.h" +#include "game/kernel/jak2/klisten.h" +#include "game/kernel/jak2/kmachine.h" +#include "game/sce/libscf.h" + +namespace jak2 { + +char DebugBootUser[64]; +char DebugBootArtGroup[64]; + +void kboot_init_globals() { + memset(DebugBootUser, 0, sizeof(DebugBootUser)); + memset(DebugBootArtGroup, 0, sizeof(DebugBootArtGroup)); + strcpy(DebugBootUser, "unknown"); +} + +void KernelCheckAndDispatch(); + +s32 goal_main(int argc, const char* const* argv) { + // only in PC port + InitParms(argc, argv); + + init_crc(); + masterConfig.aspect = ee::sceScfGetAspect(); + auto sony_language = ee::sceScfGetLanguage(); + masterConfig.inactive_timeout = 0; + masterConfig.volume = 100; + masterConfig.timeout = 0; + switch (sony_language) { + case SCE_JAPANESE_LANGUAGE: + masterConfig.language = (u16)Language::Japanese; + break; + case SCE_FRENCH_LANGUAGE: + masterConfig.language = (u16)Language::French; + break; + case SCE_SPANISH_LANGUAGE: + masterConfig.language = (u16)Language::Spanish; + break; + case SCE_GERMAN_LANGUAGE: + masterConfig.language = (u16)Language::German; + break; + case SCE_ITALIAN_LANGUAGE: + masterConfig.language = (u16)Language::Italian; + default: + masterConfig.language = (u16)Language::English; + break; + } + // Set up aspect ratio override in demo + if (!strcmp(DebugBootMessage, "demo") || !strcmp(DebugBootMessage, "demo-shared")) { + masterConfig.aspect = SCE_ASPECT_FULL; + } + // removed in PC port + // DiskBoot = 1; + // MasterDebug = 0; + // DebugSegment = 0; + + // Launch GOAL! + if (InitMachine() >= 0) { // init kernel + KernelCheckAndDispatch(); // run kernel + ShutdownMachine(); // kernel died, we should too. + // movie playback stuff removed. + } else { + fprintf(stderr, "InitMachine failed\n"); + exit(1); + } + return 0; +} + +void KernelDispatch(u32 dispatcher_func) { + // place our stack at the end of EE memory + u64 goal_stack = u64(g_ee_main_mem) + EE_MAIN_MEM_SIZE - 8; + + // try to get a message from the listener, and process it if needed + Ptr new_message = WaitForMessageAndAck(); + if (new_message.offset) { + ProcessListenerMessage(new_message); + } + + // remember the old listener + auto old_listener_function = ListenerFunction->value(); + + // run the kernel! + Timer dispatch_timer; + if (MasterUseKernel) { + call_goal_on_stack(Ptr(dispatcher_func), goal_stack, s7.offset, g_ee_main_mem); + } else { + // added, just calls the listener function + if (ListenerFunction->value() != s7.offset) { + auto result = call_goal_on_stack(Ptr(ListenerFunction->value()), goal_stack, + s7.offset, g_ee_main_mem); +#ifdef __linux__ + cprintf("%ld\n", result); +#else + cprintf("%lld\n", result); +#endif + ListenerFunction->value() = s7.offset; + } + } + + float time_ms = dispatch_timer.getMs(); + if (time_ms > 50) { + printf("Kernel dispatch time: %.3f ms\n", time_ms); + } + + // flush stdout + ClearPending(); + + // now run the extra "kernel function" + auto bonus_function = KernelFunction->value(); + if (bonus_function != s7.offset) { + // clear the pending kernel function + KernelFunction->value() = s7.offset; + // and run + call_goal_on_stack(Ptr(bonus_function), goal_stack, s7.offset, g_ee_main_mem); + } + + // send ack to indicate that the listener function has been processed and the result printed + if (MasterDebug && ListenerFunction->value() != old_listener_function) { + SendAck(); + } + + // prevent crazy spinning if we're not vsyncing (added) + if (time_ms < 4) { + std::this_thread::sleep_for(std::chrono::microseconds(1000)); + } +} + +void KernelShutdown(u32 reason) { + MasterExit = (RuntimeExitStatus)reason; +} + +void KernelCheckAndDispatch() { + while (MasterExit == RuntimeExitStatus::RUNNING) { + KernelDispatch(kernel_dispatcher->value()); + } +} + +} // namespace jak2 diff --git a/game/kernel/jak2/kboot.h b/game/kernel/jak2/kboot.h new file mode 100644 index 0000000000..4d00e59214 --- /dev/null +++ b/game/kernel/jak2/kboot.h @@ -0,0 +1,14 @@ +#pragma once + +#include "common/common_types.h" + +#include "game/kernel/common/kboot.h" + +namespace jak2 { +extern char DebugBootUser[64]; +extern char DebugBootArtGroup[64]; +s32 goal_main(int argc, const char* const* argv); +void kboot_init_globals(); +void KernelDispatch(u32 dispatcher_func); +void KernelShutdown(u32 reason); +} // namespace jak2 \ No newline at end of file diff --git a/game/kernel/jak2/kdgo.cpp b/game/kernel/jak2/kdgo.cpp new file mode 100644 index 0000000000..246186b37a --- /dev/null +++ b/game/kernel/jak2/kdgo.cpp @@ -0,0 +1,94 @@ +#include "kdgo.h" + +#include "common/log/log.h" + +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/kdgo.h" +#include "game/kernel/common/kmalloc.h" +#include "game/kernel/jak2/klink.h" + +namespace jak2 { + +/*! + * Load and link a DGO file. + * This does not use the mutli-threaded linker and will block until the entire file is done. + */ +void load_and_link_dgo(u64 name_gstr, u64 heap_info, u64 flag, u64 buffer_size) { + auto name = Ptr(name_gstr + 4).c(); + auto heap = Ptr(heap_info); + load_and_link_dgo_from_c(name, heap, flag, buffer_size, false); +} + +/*! + * Load and link a DGO file. + * This does not use the mutli-threaded linker and will block until the entire file is done.e + */ +void load_and_link_dgo_from_c(const char* name, + Ptr heap, + u32 linkFlag, + s32 bufferSize, + bool jump_from_c_to_goal) { + lg::debug("[Load and Link DGO From C] {}", name); + u32 oldShowStall = sShowStallMsg; + + // remember where the heap top point is so we can clear temporary allocations + auto oldHeapTop = heap->top; + + // allocate temporary buffers from top of the given heap + // align 64 for IOP DMA + // note: both buffers named dgo-buffer-2 + auto buffer2 = kmalloc(heap, bufferSize, KMALLOC_TOP | KMALLOC_ALIGN_64, "dgo-buffer-2"); + auto buffer1 = kmalloc(heap, bufferSize, KMALLOC_TOP | KMALLOC_ALIGN_64, "dgo-buffer-2"); + + // build filename. If no extension is given, default to CGO. + char fileName[16]; + kstrcpyup(fileName, name); + if (fileName[strlen(fileName) - 4] != '.') { + strcat(fileName, ".CGO"); + } + + // no stall messages, as this is a blocking load and when spending 100% CPU time on linking, + // the linker can beat the DVD drive. + sShowStallMsg = 0; + + // start load on IOP. + BeginLoadingDGO( + fileName, buffer1, buffer2, + Ptr((heap->current + 0x3f).offset & 0xffffffc0)); // 64-byte aligned for IOP DMA + + u32 lastObjectLoaded = 0; + while (!lastObjectLoaded) { + // check to see if next object is loaded (I believe it always is?) + auto dgoObj = GetNextDGO(&lastObjectLoaded); + if (!dgoObj.offset) { + continue; + } + + // if we're on the last object, it is loaded at cheap->current. So we can safely reset the two + // dgo-buffer allocations. We do this _before_ we link! This way, the last file loaded has more + // heap available, which is important when we need to use the entire memory. + if (lastObjectLoaded) { + heap->top = oldHeapTop; + } + + // determine the size and name of the object we got + auto obj = dgoObj + 0x40; // seek past dgo object header + u32 objSize = *(dgoObj.cast()); // size from object's link block + + char objName[64]; + strcpy(objName, (dgoObj + 4).cast().c()); // name from dgo object header + lg::debug("[link and exec] {:18s} {} {:6d} heap-use {:8d} {:8d}: 0x{:x}", objName, + lastObjectLoaded, objSize, kheapused(kglobalheap), + kdebugheap.offset ? kheapused(kdebugheap) : 0, kglobalheap->current.offset); + link_and_exec(obj, objName, objSize, heap, linkFlag, jump_from_c_to_goal); // link now! + + // inform IOP we are done + if (!lastObjectLoaded) { + ContinueLoadingDGO(Ptr((heap->current + 0x3f).offset & 0xffffffc0)); + } + } + sShowStallMsg = oldShowStall; +} + +} // namespace jak2 \ No newline at end of file diff --git a/game/kernel/jak2/kdgo.h b/game/kernel/jak2/kdgo.h new file mode 100644 index 0000000000..912a901868 --- /dev/null +++ b/game/kernel/jak2/kdgo.h @@ -0,0 +1,13 @@ +#pragma once +#include "common/common_types.h" + +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/kmalloc.h" +namespace jak2 { +void load_and_link_dgo_from_c(const char* name, + Ptr heap, + u32 linkFlag, + s32 bufferSize, + bool jump_from_c_to_goal); +void load_and_link_dgo(u64 name_gstr, u64 heap_info, u64 flag, u64 buffer_size); +} // namespace jak2 \ No newline at end of file diff --git a/game/kernel/jak2/klink.cpp b/game/kernel/jak2/klink.cpp new file mode 100644 index 0000000000..f32f483f46 --- /dev/null +++ b/game/kernel/jak2/klink.cpp @@ -0,0 +1,676 @@ +#include "klink.h" + +#include "common/goal_constants.h" +#include "common/log/log.h" +#include "common/symbols.h" + +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/klink.h" +#include "game/kernel/common/kmachine.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/common/kscheme.h" +#include "game/kernel/common/memory_layout.h" +#include "game/kernel/jak2/kscheme.h" + +#include "third-party/fmt/core.h" +static constexpr bool link_debug_printfs = false; + +/*! + * Make progress on linking. + */ +uint32_t link_control::jak2_work() { + auto old_debug_segment = DebugSegment; + if (m_keep_debug) { + DebugSegment = s7.offset + true_symbol_offset(g_game_version); + } + + // set type tag of link block + *((m_link_block_ptr - 4).cast()) = + *((s7 + jak2_symbols::FIX_SYM_LINK_BLOCK - 1).cast()); + + uint32_t rv; + + if (m_version == 3) { + ASSERT(m_opengoal); + rv = jak2_work_v3(); + } else if (m_version == 2 || m_version == 4) { + ASSERT(!m_opengoal); + rv = jak2_work_v2(); + } else { + ASSERT_MSG(false, fmt::format("UNHANDLED OBJECT FILE VERSION {} IN WORK!", m_version)); + return 0; + } + + DebugSegment = old_debug_segment; + return rv; +} + +namespace { +/*! + * Link a single relative offset (used for RIP) + */ +uint32_t cross_seg_dist_link_v3(Ptr link, + ObjectFileHeader* ofh, + int current_seg, + int size) { + // target seg, dist into mine, dist into target, patch loc in mine + uint8_t target_seg = *link; + ASSERT(target_seg < ofh->segment_count); + + uint32_t* link_data = (link + 1).cast().c(); + int32_t mine = link_data[0] + ofh->code_infos[current_seg].offset; + int32_t tgt = link_data[1] + ofh->code_infos[target_seg].offset; + int32_t diff = tgt - mine; + uint32_t offset_of_patch = link_data[2] + ofh->code_infos[current_seg].offset; + + // second debug segment case added for jak 2. + if (!ofh->code_infos[target_seg].offset || (!DebugSegment && target_seg == DEBUG_SEGMENT)) { + // we want to address GOAL 0. In the case where this is a rip-relative load or store, this + // will crash, which is what we want. If it's an lea and just getting an address, this will get + // us a nullptr. If you do a method-set! with a null pointer it does nothing, so it's safe to + // method-set! to things that are in unloaded segments and it'll just keep the old method. + diff = -mine; + } + // printf("link object in seg %d diff %d at %d (%d + %d)\n", target_seg, diff, offset_of_patch, + // link_data[2], ofh->code_infos[current_seg].offset); + + // both 32-bit and 64-bit pointer links are supported, though 64-bit ones are no longer in use. + // we still support it just in case we want to run ancient code. + if (size == 4) { + *Ptr(offset_of_patch).c() = diff; + } else if (size == 8) { + *Ptr(offset_of_patch).c() = diff; + } else { + ASSERT(false); + } + + return 1 + 3 * 4; +} + +uint32_t ptr_link_v3(Ptr link, ObjectFileHeader* ofh, int current_seg) { + auto* link_data = link.cast().c(); + u32 patch_loc = link_data[0] + ofh->code_infos[current_seg].offset; + u32 patch_value = link_data[1] + ofh->code_infos[current_seg].offset; + *Ptr(patch_loc).c() = patch_value; + return 8; +} + +/*! + * Link type pointers for a single type in "v3 equivalent" link data + * Returns a pointer to the link table data after the typelinking data. + */ +uint32_t typelink_v3(Ptr link, Ptr data) { + // get the name of the type + uint32_t seek = 0; + char sym_name[256]; + while (link.c()[seek]) { + sym_name[seek] = link.c()[seek]; + seek++; + ASSERT(seek < 256); + } + sym_name[seek] = 0; + seek++; + + // determine the number of methods + uint32_t method_count = link.c()[seek++]; + // jak2 special + method_count *= 4; + if (method_count) { + method_count += 3; + } + + // intern the GOAL type, creating the vtable if it doesn't exist. + auto type_ptr = jak2::intern_type_from_c(sym_name, method_count); + + // prepare to read the locations of the type pointers + Ptr offsets = link.cast() + seek; + uint32_t offset_count = *offsets; + offsets = offsets + 4; + seek += 4; + + // write the type pointers into memory + for (uint32_t i = 0; i < offset_count; i++) { + *(data + offsets.c()[i]).cast() = type_ptr.offset; + seek += 4; + } + + return seek; +} +/*! + * Link symbols (both offsets and pointers) in "v3 equivalent" link data. + * Returns a pointer to the link table data after the linking data for this symbol. + */ +uint32_t symlink_v3(Ptr link, Ptr data) { + // get the symbol name + uint32_t seek = 0; + char sym_name[256]; + while (link.c()[seek]) { + sym_name[seek] = link.c()[seek]; + seek++; + ASSERT(seek < 256); + } + sym_name[seek] = 0; + seek++; + + // intern + auto sym = jak2::intern_from_c(sym_name); + int32_t sym_offset = sym.cast() - s7; + uint32_t sym_addr = sym.cast().offset; + + // prepare to read locations of symbol links + Ptr offsets = link.cast() + seek; + uint32_t offset_count = *offsets; + offsets = offsets + 4; + seek += 4; + + for (uint32_t i = 0; i < offset_count; i++) { + uint32_t offset = offsets.c()[i]; + seek += 4; + auto data_ptr = (data + offset).cast(); + + if (*data_ptr == -1) { + // a "-1" indicates that we should store the address. + *(data + offset).cast() = sym_addr; + } else { + // otherwise store the offset to st. Eventually this should become an s16 instead. + *(data + offset).cast() = sym_offset; + } + } + + return seek; +} +} // namespace + +/*! + * Run the linker. For now, all linking is done in two runs. If this turns out to be too slow, + * this should be modified to do incremental linking over multiple runs. + */ +uint32_t link_control::jak2_work_v3() { + ObjectFileHeader* ofh = m_link_block_ptr.cast().c(); + if (m_state == 0) { + // state 0 <- copying data. + // the actual game does all copying in one shot. I assume this is ok because v3 files are just + // code and always small. Large data which takes too long to copy should use v2. + + // loop over segments + for (s32 seg_id = ofh->segment_count - 1; seg_id >= 0; seg_id--) { + // link the infos + ofh->link_infos[seg_id].offset += m_link_block_ptr.offset; + ofh->code_infos[seg_id].offset += m_object_data.offset; + + if (seg_id == DEBUG_SEGMENT) { + if (!DebugSegment) { + // clear code info if we aren't going to copy the debug segment. + ofh->code_infos[seg_id].offset = 0; + ofh->code_infos[seg_id].size = 0; + } else { + if (ofh->code_infos[seg_id].size == 0) { + // not actually present + ofh->code_infos[seg_id].offset = 0; + } else { + Ptr src(ofh->code_infos[seg_id].offset); + ofh->code_infos[seg_id].offset = + kmalloc(kdebugheap, ofh->code_infos[seg_id].size, 0, "debug-segment").offset; + if (ofh->code_infos[seg_id].offset == 0) { + MsgErr("dkernel: unable to malloc %d bytes for debug-segment\n", + ofh->code_infos[seg_id].size); + return 1; + } + jak2::ultimate_memcpy(Ptr(ofh->code_infos[seg_id].offset).c(), src.c(), + ofh->code_infos[seg_id].size); + } + } + } else if (seg_id == MAIN_SEGMENT) { + if (ofh->code_infos[seg_id].size == 0) { + ofh->code_infos[seg_id].offset = 0; + } else { + Ptr src(ofh->code_infos[seg_id].offset); + ofh->code_infos[seg_id].offset = + kmalloc(m_heap, ofh->code_infos[seg_id].size, 0, "main-segment").offset; + if (ofh->code_infos[seg_id].offset == 0) { + MsgErr("dkernel: unable to malloc %d bytes for main-segment\n", + ofh->code_infos[seg_id].size); + return 1; + } + jak2::ultimate_memcpy(Ptr(ofh->code_infos[seg_id].offset).c(), src.c(), + ofh->code_infos[seg_id].size); + } + } else if (seg_id == TOP_LEVEL_SEGMENT) { + if (ofh->code_infos[seg_id].size == 0) { + ofh->code_infos[seg_id].offset = 0; + } else { + Ptr src(ofh->code_infos[seg_id].offset); + ofh->code_infos[seg_id].offset = + kmalloc(m_heap, ofh->code_infos[seg_id].size, KMALLOC_TOP, "top-level-segment") + .offset; + if (ofh->code_infos[seg_id].offset == 0) { + MsgErr("dkernel: unable to malloc %d bytes for top-level-segment\n", + ofh->code_infos[seg_id].size); + return 1; + } + jak2::ultimate_memcpy(Ptr(ofh->code_infos[seg_id].offset).c(), src.c(), + ofh->code_infos[seg_id].size); + } + } else { + printf("UNHANDLED SEG ID IN WORK V3 STATE 1\n"); + } + } + + m_state = 1; + m_segment_process = 0; + return 0; + } else if (m_state == 1) { + // state 1: linking. For now all links are done at once. This is probably going to be fine on a + // modern computer. But the game broke this into multiple steps. + if (m_segment_process < ofh->segment_count) { + if (ofh->code_infos[m_segment_process].offset) { + Ptr lp(ofh->link_infos[m_segment_process].offset); + + while (*lp) { + switch (*lp) { + case LINK_TABLE_END: + break; + case LINK_SYMBOL_OFFSET: + lp = lp + 1; + lp = lp + symlink_v3(lp, Ptr(ofh->code_infos[m_segment_process].offset)); + break; + case LINK_TYPE_PTR: + lp = lp + 1; // seek past id + lp = lp + typelink_v3(lp, Ptr(ofh->code_infos[m_segment_process].offset)); + break; + case LINK_DISTANCE_TO_OTHER_SEG_64: + lp = lp + 1; + lp = lp + cross_seg_dist_link_v3(lp, ofh, m_segment_process, 8); + break; + case LINK_DISTANCE_TO_OTHER_SEG_32: + lp = lp + 1; + lp = lp + cross_seg_dist_link_v3(lp, ofh, m_segment_process, 4); + break; + case LINK_PTR: + lp = lp + 1; + lp = lp + ptr_link_v3(lp, ofh, m_segment_process); + break; + default: + ASSERT_MSG(false, fmt::format("unknown link table thing {}", *lp)); + break; + } + } + } + + m_segment_process++; + } else { + // all done, can set the entry point to the top-level. + m_entry = Ptr(ofh->code_infos[TOP_LEVEL_SEGMENT].offset) + 4; + return 1; + } + + return 0; + } + + else { + printf("WORK v3 INVALID STATE\n"); + return 1; + } +} + +#define LINK_V2_STATE_INIT_COPY 0 +#define LINK_V2_STATE_OFFSETS 1 +#define LINK_V2_STATE_SYMBOL_TABLE 2 +#define OBJ_V2_CLOSE_ENOUGH 0x90 +#define OBJ_V2_MAX_TRANSFER 0x80000 + +uint32_t link_control::jak2_work_v2() { + // u32 startCycle = kernel.read_clock(); todo + + if (m_state == LINK_V2_STATE_INIT_COPY) { // initialization and copying to heap + // we move the data segment to eliminate gaps + // very small gaps can be tolerated, as it is not worth the time penalty to move large objects + // many bytes. if this requires copying a large amount of data, we will do it in smaller chunks, + // allowing the copy to be spread over multiple game frames + + // state initialization + if (m_segment_process == 0) { + m_heap_gap = + m_object_data - m_heap->current; // distance between end of heap and start of object + } + + if (m_heap_gap < + OBJ_V2_CLOSE_ENOUGH) { // close enough, don't relocate the object, just expand the heap + if (link_debug_printfs) { + printf("[work_v2] close enough, not moving\n"); + } + m_heap->current = m_object_data + m_code_size; + if (m_heap->top.offset <= m_heap->current.offset) { + MsgErr("dkernel: heap overflow\n"); // game has ~% instead of \n :P + return 1; + } + } else { // not close enough, need to move the object + + // on the first run of this state... + if (m_segment_process == 0) { + m_original_object_location = m_object_data; + // allocate on heap, will have no gap + m_object_data = kmalloc(m_heap, m_code_size, 0, "data-segment"); + if (link_debug_printfs) { + printf("[work_v2] moving from 0x%x to 0x%x\n", m_original_object_location.offset, + m_object_data.offset); + } + if (!m_object_data.offset) { + MsgErr("dkernel: unable to malloc %d bytes for data-segment\n", m_code_size); + return 1; + } + } + + // the actual copy + Ptr source = m_original_object_location + m_segment_process; + u32 size = m_code_size - m_segment_process; + + if (size > OBJ_V2_MAX_TRANSFER) { // around .5 MB + jak2::ultimate_memcpy((m_object_data + m_segment_process).c(), source.c(), + OBJ_V2_MAX_TRANSFER); + m_segment_process += OBJ_V2_MAX_TRANSFER; + return 0; // return, don't want to take too long. + } + + // if we have bytes to copy, but they are less than the max transfer, do it in one shot! + if (size) { + jak2::ultimate_memcpy((m_object_data + m_segment_process).c(), source.c(), size); + if (m_segment_process > 0) { // if we did a previous copy, we return now.... + m_state = LINK_V2_STATE_OFFSETS; + m_segment_process = 0; + return 0; + } + } + } + + // otherwise go straight into the next state. + m_state = LINK_V2_STATE_OFFSETS; + m_segment_process = 0; + } + + // init offset phase + if (m_state == LINK_V2_STATE_OFFSETS && m_segment_process == 0) { + m_reloc_ptr = m_link_block_ptr + 8; // seek to link table + if (*m_reloc_ptr == 0) { // do we have pointer links to do? + m_reloc_ptr.offset++; // if not, seek past the \0, and go to next state + m_state = LINK_V2_STATE_SYMBOL_TABLE; + m_segment_process = 0; + } else { + m_base_ptr = m_object_data; // base address for offsetting. + m_loc_ptr = m_object_data; // pointer which seeks thru the code + m_table_toggle = 0; // are we seeking or fixing? + m_segment_process = 1; // we've done first time setup + } + } + + if (m_state == LINK_V2_STATE_OFFSETS) { // pointer fixup + // this state reads through a table. Values alternate between "seek amount" and "number of + // consecutive 4-byte + // words to fix up". The counts are encoded using a variable length encoding scheme. They use + // a very stupid + // method of encoding values which requires O(n) bytes to store the value n. + + // to avoid dropping a frame, we check every 0x400 relocations to see if 0.5 milliseconds have + // elapsed. + u32 relocCounter = 0x400; + while (true) { // loop over entire table + while (true) { // loop over current mode + + // read and seek table + u8 count = *m_reloc_ptr; + m_reloc_ptr.offset++; + + if (!m_table_toggle) { // seek mode + m_loc_ptr.offset += + 4 * + count; // perform seek (MIPS instructions are 4 bytes, so we >> 2 the seek amount) + } else { // offset mode + for (u32 i = 0; i < count; i++) { + if (m_loc_ptr.offset % 4) { + ASSERT(false); + } + u32 code = *(m_loc_ptr.cast()); + code += m_base_ptr.offset; + *(m_loc_ptr.cast()) = code; + m_loc_ptr.offset += 4; + } + } + + if (count != 0xff) { + break; + } + + if (*m_reloc_ptr == 0) { + m_reloc_ptr.offset++; + m_table_toggle = m_table_toggle ^ 1; + } + } + + // reached the end of the tableToggle mode + m_table_toggle = m_table_toggle ^ 1; + if (*m_reloc_ptr == 0) { + break; // end of the state + } + relocCounter--; + if (relocCounter == 0) { + // u32 clock_value = kernel.read_clock(); + // if(clock_value - startCycle > 150000) { // 0.5 milliseconds + // return 0; + // } + relocCounter = 0x400; + } + } + m_reloc_ptr.offset++; + m_state = 2; + m_segment_process = 0; + } + + if (m_state == 2) { // GOAL object fixup + if (*m_reloc_ptr == 0) { + m_state = 3; + m_segment_process = 0; + } else { + while (true) { + u32 relocation = *m_reloc_ptr; + m_reloc_ptr.offset++; + Ptr goalObj; + char* name; + if ((relocation & 0x80) == 0) { + // symbol! + if (relocation > 9) { + m_reloc_ptr.offset--; // no idea what this is. + } + name = m_reloc_ptr.cast().c(); + if (link_debug_printfs) { + printf("[work_v2] symlink: %s\n", name); + } + goalObj = jak2::intern_from_c(name).cast(); + } else { + // type! + u8 nMethods = relocation & 0x7f; + if (nMethods == 0) { + nMethods = 1; + } + name = m_reloc_ptr.cast().c(); + if (link_debug_printfs) { + printf("[work_v2] symlink -type: %s\n", name); + } + goalObj = jak2::intern_type_from_c(name, nMethods).cast(); + } + m_reloc_ptr.offset += strlen(name) + 1; + // DECOMPILER->hookStartSymlinkV3(_state - 1, _objectData, std::string(name)); + m_reloc_ptr = c_symlink2(m_object_data, goalObj, m_reloc_ptr); + // DECOMPILER->hookFinishSymlinkV3(); + if (*m_reloc_ptr == 0) { + break; // done + } + // u32 currentCycle = kernel.read_clock(); + // if(currentCycle - startCycle > 150000) { + // return 0; + // } + } + m_state = 3; + m_segment_process = 0; + } + } + m_entry = m_object_data + 4; + return 1; +} + +/*! + * Complete linking. This will execute the top-level code for v3 object files, if requested. + */ +void link_control::jak2_finish(bool jump_from_c_to_goal) { + CacheFlush(m_code_start.c(), m_code_size); + auto old_debug_segment = DebugSegment; + if (m_keep_debug) { + // note - this probably doesn't work because DebugSegment isn't *debug-segment*. + DebugSegment = s7.offset + jak2_symbols::FIX_SYM_TRUE; + } + if (m_flags & LINK_FLAG_FORCE_FAST_LINK) { + FastLink = 1; + } + *EnableMethodSet = *EnableMethodSet + m_keep_debug; + + ObjectFileHeader* ofh = m_link_block_ptr.cast().c(); + lg::info("link finish: {}", m_object_name); + if (ofh->object_file_version == 3) { + // todo check function type of entry + + // setup mips2c functions + /* + for (auto& x : Mips2C::gMips2CLinkCallbacks[m_object_name]) { + x(); + } + */ + + // execute top level! + if (m_entry.offset && (m_flags & LINK_FLAG_EXECUTE)) { + if (jump_from_c_to_goal) { + u64 goal_stack = u64(g_ee_main_mem) + EE_MAIN_MEM_SIZE - 8; + call_goal_on_stack(m_entry.cast(), goal_stack, s7.offset, g_ee_main_mem); + } else { + call_goal(m_entry.cast(), 0, 0, 0, s7.offset, g_ee_main_mem); + } + } + + // inform compiler that we loaded. + if (m_flags & LINK_FLAG_OUTPUT_LOAD) { + output_segment_load(m_object_name, m_link_block_ptr, m_flags); + } + } else { + if (m_flags & LINK_FLAG_EXECUTE) { + auto entry = m_entry; + auto name = basename_goal(m_object_name); + strcpy(Ptr(LINK_CONTROL_NAME_ADDR).c(), name); + jak2::call_method_of_type_arg2(entry.offset, Ptr(*((entry - 4).cast())), + GOAL_RELOC_METHOD, m_heap.offset, + Ptr(LINK_CONTROL_NAME_ADDR).offset); + } + } + + *EnableMethodSet = *EnableMethodSet - m_keep_debug; + FastLink = 0; // nested fast links won't work right. + m_heap->top = m_heap_top; + DebugSegment = old_debug_segment; + m_busy = false; +} + +namespace jak2 { +u32 link_busy() { + return saved_link_control.m_busy; +} + +void link_reset() { + // seems like a bad idea to do this - you'll probably leak memory. + saved_link_control.m_busy = 0; +} + +Ptr link_and_exec(Ptr data, + const char* name, + int32_t size, + Ptr heap, + uint32_t flags, + bool jump_from_c_to_goal) { + if (link_busy()) { + printf("-------------> saved link is busy\n"); + // probably won't end well... + } + link_control lc; + lc.begin(data, name, size, heap, flags); + uint32_t done; + do { + done = lc.jak2_work(); + } while (!done); + lc.jak2_finish(jump_from_c_to_goal); + return lc.m_entry; +} + +/*! + * Wrapper so this can be called from GOAL. Not in original game. + */ +u64 link_and_exec_wrapper(u64* args) { + // data, name, size, heap, flags + return link_and_exec(Ptr(args[0]), Ptr(args[1]).c(), args[2], Ptr(args[3]), + args[4], false) + .offset; +} + +/*! + * GOAL exported function for beginning a link with the saved_link_control + * 47 -> output_load, output_true, execute, 8, force fast + * 39 -> no 8 (s7) + */ +uint64_t link_begin(u64* args) { + // object data, name size, heap flags + saved_link_control.begin(Ptr(args[0]), Ptr(args[1]).c(), args[2], + Ptr(args[3]), args[4]); + auto work_result = saved_link_control.jak2_work(); + // if we managed to finish in one shot, take care of calling finish + if (work_result) { + // called from goal + saved_link_control.jak2_finish(false); + } + + return work_result != 0; +} + +/*! + * GOAL exported function for doing a small amount of linking work on the saved_link_control + */ +uint64_t link_resume() { + auto work_result = saved_link_control.jak2_work(); + if (work_result) { + // called from goal + saved_link_control.jak2_finish(false); + } + return work_result != 0; +} + +/*! + * The ULTIMATE MEMORY COPY + * IT IS VERY FAST + * but it may use the scratchpad. It is implemented in GOAL, and falls back to normal C memcpy + * if GOAL isn't loaded, or if the alignment isn't good enough. + */ +void ultimate_memcpy(void* dst, void* src, uint32_t size) { + // only possible if alignment is good. + if (!(u64(dst) & 0xf) && !(u64(src) & 0xf) && !(u64(size) & 0xf) && size > 0xfff) { + if (!gfunc_774.offset) { + // GOAL function is unknown, lets see if its loaded: + auto sym = jak2::find_symbol_from_c("ultimate-memcpy"); + if (sym->value() == 0) { + memmove(dst, src, size); + return; + } + gfunc_774.offset = sym->value(); + } + + Ptr(call_goal(gfunc_774, make_u8_ptr(dst).offset, make_u8_ptr(src).offset, size, s7.offset, + g_ee_main_mem)) + .c(); + } else { + memmove(dst, src, size); + } +} +} // namespace jak2 \ No newline at end of file diff --git a/game/kernel/jak2/klink.h b/game/kernel/jak2/klink.h new file mode 100644 index 0000000000..5417d9cead --- /dev/null +++ b/game/kernel/jak2/klink.h @@ -0,0 +1,20 @@ +#pragma once + +#include "common/common_types.h" + +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/kmalloc.h" + +namespace jak2 { +void ultimate_memcpy(void* dst, void* src, uint32_t size); +Ptr link_and_exec(Ptr data, + const char* name, + int32_t size, + Ptr heap, + uint32_t flags, + bool jump_from_c_to_goal); +u32 link_busy(); +void link_reset(); +uint64_t link_begin(u64* args); +uint64_t link_resume(); +} // namespace jak2 diff --git a/game/kernel/jak2/klisten.cpp b/game/kernel/jak2/klisten.cpp new file mode 100644 index 0000000000..ea0c534881 --- /dev/null +++ b/game/kernel/jak2/klisten.cpp @@ -0,0 +1,154 @@ +#include "klisten.h" + +#include +#include + +#include "common/symbols.h" + +#include "game/kernel/common/kdsnetm.h" +#include "game/kernel/common/klink.h" +#include "game/kernel/common/klisten.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/jak2/kboot.h" +#include "game/kernel/jak2/klink.h" +#include "game/kernel/jak2/kprint.h" +#include "game/kernel/jak2/kscheme.h" + +namespace jak2 { +using namespace jak2_symbols; + +Ptr> ListenerLinkBlock; +Ptr> ListenerFunction; +Ptr> KernelFunction; // new in jak2 +Ptr> kernel_dispatcher; +Ptr> kernel_packages; +Ptr> sync_dispatcher; + +void klisten_init_globals() { + ListenerLinkBlock.offset = 0; + ListenerFunction.offset = 0; + KernelFunction.offset = 0; + kernel_dispatcher.offset = 0; + kernel_packages.offset = 0; + sync_dispatcher.offset = 0; +} + +/*! + * Initialize the Listener by setting up symbols shared between GOAL and C for the listener. + * Also adds "kernel" to the kernel_packages list. + * There was an "ACK" message sent here, but this is removed because we don't need it. + */ +void InitListener() { + ListenerLinkBlock = intern_from_c("*listener-link-block*"); + ListenerFunction = intern_from_c("*listener-function*"); + KernelFunction = intern_from_c("*kernel-function*"); + kernel_dispatcher = intern_from_c("kernel-dispatcher"); + sync_dispatcher = intern_from_c("sync-dispatcher"); + kernel_packages = intern_from_c("*kernel-packages*"); + print_column = intern_from_c("*print-column*").cast(); + ListenerLinkBlock->value() = s7.offset; + ListenerFunction->value() = s7.offset; + KernelFunction->value() = s7.offset; + + kernel_packages->value() = + new_pair(s7.offset + FIX_SYM_GLOBAL_HEAP, *((s7 + FIX_SYM_PAIR_TYPE - 1).cast()), + make_string_from_c("kernel"), kernel_packages->value()); + // if(MasterDebug) { + // SendFromBufferD(MSG_ACK, 0, AckBufArea + sizeof(ListenerMessageHeader), 0); + // } +} + +/*! + * Handle an incoming listener message + */ +void ProcessListenerMessage(Ptr msg) { + // flag that the listener is connected! + ListenerStatus = 1; + switch (protoBlock.msg_kind) { + case LTT_MSG_POKE: + // just flush any pending stuff. + ClearPending(); + break; + case LTT_MSG_INSEPCT: + inspect_object(atoi(msg.c())); + ClearPending(); + break; + case LTT_MSG_PRINT: + print_object(atoi(msg.c())); + ClearPending(); + break; + case LTT_MSG_PRINT_SYMBOLS: + printf("[ERROR] unsupported message kind LTT_MSG_PRINT_SYMBOLS (NYI)\n"); + break; + case LTT_MSG_RESET: + MasterExit = RuntimeExitStatus::RESTART_RUNTIME; + break; + case LTT_MSG_SHUTDOWN: + MasterExit = RuntimeExitStatus::EXIT; + break; + case LTT_MSG_CODE: { + auto buffer = kmalloc(kdebugheap, MessCount, 0, "listener-link-block"); + memcpy(buffer.c(), msg.c(), MessCount); + ListenerLinkBlock->value() = buffer.offset + 4; + // note - this will stash the linked code in the top level and free it. + // it will then be used-after-free, but this is OK because nobody else will allocate. + // the kernel dispatcher should immediately execute the listener function to avoid this + // getting squashed. + + // this setup allows listener function execution to clean up after itself. + + // we have added the LINK_FLAG_OUTPUT_LOAD + // jump from c to goal because this is called from the C++ stack. + ListenerFunction->value() = link_and_exec(buffer, "*listener*", 0, kdebugheap, + LINK_FLAG_FORCE_DEBUG | LINK_FLAG_OUTPUT_LOAD, true) + .offset; + return; // don't ack yet, this will happen after the function runs. + } break; + default: + MsgErr("dkernel: unknown message error: <%d> of %d bytes\n", protoBlock.msg_kind, MessCount); + break; + } + SendAck(); +} + +int sql_query_sync(Ptr string_in) { + if (!MasterDebug) { + // not debugging, no sql results. + return s7.offset + FIX_SYM_EMPTY_PAIR - 1; + } else { + // clear old result + SqlResult->value() = s7.offset; + // output sql query to the compiler + output_sql_query(string_in->data()); + // clear pending listener stuff, so we don't run it again. + ListenerFunction->value() = s7.offset; + ListenerStatus = 1; + ClearPending(); + SendAck(); + + kdebugheap->top.offset -= 0x4000; // not sure what it's used for... + + // didn't we just set these to false? + if (ListenerFunction->value() == s7.offset && SqlResult->value() == s7.offset) { + do { + KernelDispatch(sync_dispatcher->value()); + SendAck(); + if (SqlResult->value() != s7.offset) { + break; + } + std::this_thread::sleep_for(std::chrono::milliseconds(10)); // ? + /* + iVar2 = 99999; + do { + bVar1 = iVar2 != 0; + iVar2 = iVar2 + -1; + } while (bVar1); + */ + } while (SqlResult->value() == s7.offset); + } + kdebugheap->top.offset += 0x4000; + return SqlResult->value(); + } +} + +} // namespace jak2 diff --git a/game/kernel/jak2/klisten.h b/game/kernel/jak2/klisten.h new file mode 100644 index 0000000000..55b737e832 --- /dev/null +++ b/game/kernel/jak2/klisten.h @@ -0,0 +1,20 @@ +#pragma once +#include "common/common_types.h" + +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/Symbol4.h" +#include "game/kernel/common/kscheme.h" + +namespace jak2 { +extern Ptr> ListenerLinkBlock; +extern Ptr> ListenerFunction; +extern Ptr> KernelFunction; // new in jak2 +extern Ptr> kernel_dispatcher; +extern Ptr> sync_dispatcher; // new in jak2 +extern Ptr> kernel_packages; + +void klisten_init_globals(); +void ProcessListenerMessage(Ptr msg); +int sql_query_sync(Ptr string_in); +void InitListener(); +} // namespace jak2 \ No newline at end of file diff --git a/game/kernel/jak2/kmachine.cpp b/game/kernel/jak2/kmachine.cpp new file mode 100644 index 0000000000..5e235c9614 --- /dev/null +++ b/game/kernel/jak2/kmachine.cpp @@ -0,0 +1,624 @@ +#include "kmachine.h" + +#include +#include + +#include "common/log/log.h" +#include "common/symbols.h" +#include "common/util/FileUtil.h" + +#include "game/kernel/common/Symbol4.h" +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/kboot.h" +#include "game/kernel/common/kdgo.h" +#include "game/kernel/common/kdsnetm.h" +#include "game/kernel/common/kernel_types.h" +#include "game/kernel/common/klink.h" +#include "game/kernel/common/kmachine.h" +#include "game/kernel/common/kmalloc.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/common/kscheme.h" +#include "game/kernel/common/ksocket.h" +#include "game/kernel/common/ksound.h" +#include "game/kernel/common/memory_layout.h" +#include "game/kernel/jak2/kboot.h" +#include "game/kernel/jak2/kdgo.h" +#include "game/kernel/jak2/klink.h" +#include "game/kernel/jak2/klisten.h" +#include "game/kernel/jak2/kmalloc.h" +#include "game/kernel/jak2/kscheme.h" +#include "game/kernel/jak2/ksound.h" +#include "game/kernel/svnrev.h" +#include "game/sce/libdma.h" +#include "game/sce/libgraph.h" +#include "game/sce/sif_ee.h" +#include "game/sce/stubs.h" +#include "game/system/vm/vm.h" + +using namespace ee; + +namespace jak2 { +/*! + * Initialize global variables based on command line parameters. Not called in retail versions, + * but it is present in the ELF. + * DONE + * Modified to use std::string, and removed call to fflush. + */ +void InitParms(int argc, const char* const* argv) { + // Modified default settings to boot up the game like normal if no arguments are present. + if (argc == 1) { + DiskBoot = 1; + isodrv = fakeiso; + modsrc = 0; + reboot = 0; + DebugSegment = 0; + MasterDebug = 0; + } + + for (int i = 1; i < argc; i++) { + std::string arg = argv[i]; + // DVD Settings + // ---------------------------- + + // the "cd" mode uses the DVD drive for everything. This is how the game runs in retail + if (arg == "-cd") { + Msg(6, "dkernel: cd mode\n"); + isodrv = iso_cd; // use the actual DVD drive for data files + modsrc = 1; // use the DVD drive data for IOP modules + reboot = 1; // Reboot the IOP (load new IOP runtime) + } + + // the "cddata" uses the DVD drive for everything but IOP modules. + if (arg == "-cddata") { + Msg(6, "dkernel: cddata mode\n"); + isodrv = iso_cd; // tell IOP to use actual DVD drive for data files + modsrc = 0; // don't use DVD drive for IOP modules + reboot = 0; // no need to reboot the IOP + } + + if (arg == "-demo") { + Msg(6, "dkernel: demo mode\n"); + kstrcpy(DebugBootMessage, "demo"); + } + + // new for jak 2 + if (arg == "-kiosk") { + Msg(6, "dkernel: kiosk mode\n"); + kstrcpy(DebugBootMessage, "kiosk"); + } + + // new for jak 2 + if (arg == "-preview") { + Msg(6, "dkernel: preview mode\n"); + kstrcpy(DebugBootMessage, "preview"); + } + + // the "deviso" mode is one of two modes for testing without the need for DVDs + if (arg == "-deviso") { + Msg(6, "dkernel: deviso mode\n"); + isodrv = deviso; // IOP deviso mode + modsrc = 2; // now 2 for Jak 2 + reboot = 0; + } + // the "fakeiso" mode is the other of two modes for testing without the need for DVDs + if (arg == "-fakeiso") { + Msg(6, "dkernel: fakeiso mode\n"); + isodrv = fakeiso; // IOP fakeeiso mode + modsrc = 0; // no IOP module loading (there's no DVD to load from!) + reboot = 0; + } + + // the "boot" mode is used to set GOAL up for running the game in retail mode + if (arg == "-boot") { + Msg(6, "dkernel: boot mode\n"); + MasterDebug = 0; + DiskBoot = 1; + DebugSegment = 0; + } + + // new for jak 2 + if (arg == "-debug-boot") { + Msg(6, "dkernel: debug-boot mode\n"); + MasterDebug = 0; + DebugSegment = 1; + DiskBoot = 1; + } + + // traditional debug mode + if (arg == "-debug") { + Msg(6, "dkernel: debug mode\n"); + MasterDebug = 1; + DebugSegment = 1; + } + + // the "debug-mem" mode is used to set up GOAL in debug mode, but not to load debug-segments + if (arg == "-debug-mem") { + Msg(6, "dkernel: debug-mem mode\n"); + MasterDebug = 1; + DebugSegment = 0; + } + + // the "-level [level-name]" mode is used to inform the game to boot a specific level + // the default level is "#f". + if (arg == "-level") { + i++; + std::string levelName = argv[i]; + Msg(6, "dkernel: level %s\n", levelName.c_str()); + kstrcpy(DebugBootLevel, levelName.c_str()); + } + + // new for jak 2 + if (arg == "-user") { + i++; + std::string levelName = argv[i]; + Msg(6, "dkernel: user %s\n", levelName.c_str()); + kstrcpy(DebugBootUser, levelName.c_str()); + } + + // new for jak 2 + if (arg == "-art") { + i++; + std::string levelName = argv[i]; + Msg(6, "dkernel: art-group %s\n", levelName.c_str()); + kstrcpy(DebugBootArtGroup, levelName.c_str()); + kstrcpy(DebugBootMessage, "art-group"); + } + + // an added mode to allow booting without a KERNEL.CGO for testing + if (arg == "-nokernel") { + Msg(6, "dkernel: no kernel mode\n"); + MasterUseKernel = false; + } + + // an added mode to allow booting without sound for testing + if (arg == "-nosound") { + Msg(6, "dkernel: no sound mode\n"); + masterConfig.disable_sound = true; + } + } +} + +void InitIOP() { + Msg(6, "dkernel: boot:%d debug:%d mem:%d dev:%d mod:%d\n", DiskBoot, MasterDebug, DebugSegment, + isodrv, modsrc); + sceSifInitRpc(0); + + // init cd if we need it + if (((isodrv == iso_cd) || (modsrc == 1)) || (reboot == 1)) { + InitCD(); + } + + if (reboot == 0) { + // iop with dev kernel + printf("Rebooting IOP...\n"); + while (!sceSifRebootIop("host0:/usr/local/sce/iop/modules/ioprp271.img")) { + printf("Failed, retrying...\n"); + } + while (!sceSifSyncIop()) { + } + } else { + printf("Rebooting IOP...\n"); + while (!sceSifRebootIop("cdrom0:\\DRIVERS\\IOPRP271.IMG")) { + printf("Failed, retrying...\n"); + } + while (!sceSifSyncIop()) { + } + } + sceSifInitRpc(0); + if ((isodrv == iso_cd) || (modsrc == 1)) { + InitCD(); + sceFsReset(); + } + + char overlord_boot_command[256]; + char* cmd = overlord_boot_command; + kstrcpy(cmd, init_types[(int)isodrv]); + cmd = cmd + strlen(cmd) + 1; + if (!strncmp(DebugBootMessage, "demo", 4)) { + kstrcpy(cmd, "SCREEN1.DEM"); + } else { + kstrcpy(cmd, "SCREEN1.USA"); + } + cmd = cmd + strlen(cmd) + 1; + if (masterConfig.disable_sound) { + kstrcpy(cmd, "-nosound"); + cmd = cmd + strlen(cmd) + 1; + } + + int total_len = cmd - overlord_boot_command; + + if (modsrc == 0) { + if (sceSifLoadModule("host0:/usr/local/sce/iop/modules/sio2man.irx", 0, nullptr) < 0) { + MsgErr("loading sio2man.irx failed\n"); + exit(0); + } + + if (sceSifLoadModule("host0:/usr/local/sce/iop/modules/padman.irx", 0, nullptr) < 0) { + MsgErr("loading padman.irx failed\n"); + exit(0); + } + if (sceSifLoadModule("host0:/usr/local/sce/iop/modules/libsd.irx", 0, nullptr) < 0) { + MsgErr("loading libsd.irx failed\n"); + exit(0); + } + if (sceSifLoadModule("host0:/usr/local/sce/iop/modules/mcman.irx", 0, nullptr) < 0) { + MsgErr("loading mcman.irx failed\n"); + exit(0); + } + if (sceSifLoadModule("host0:/usr/local/sce/iop/modules/mcserv.irx", 0, nullptr) < 0) { + MsgErr("loading mcserv.irx failed\n"); + exit(0); + } + if (sceSifLoadModule("host0:/usr/home/src/989snd23/iop/sce27/989nostr.irx", 0, nullptr) < 0) { + MsgErr("loading %s failed\n", "host0:/usr/home/src/989snd23/iop/sce27/989nostr.irx"); + exit(0); + } + if (DebugSegment) { + sceSifLoadModule("host0:/usr/home/src/989snd23/iop/sce27/989err.irx", 0, nullptr); + } + if (sceSifLoadModule("host0:/usr/local/sce/iop/modules/scrtchpd.irx", 0, nullptr) < 0) { + MsgErr("loading scrtchpd.irx failed\n"); + exit(0); + } + printf("Initializing CD library in FAKEISO mode\n"); + if (sceSifLoadModule("host0:bin/overlord.irx", total_len, overlord_boot_command) < 0) { + MsgErr("loading overlord.irx <3> failed\n"); + exit(0); + } + } else { + if (modsrc == 1) { + if (sceSifLoadModule("cdrom0:\\DRIVERS\\SIO2MAN.IRX;1", 0, nullptr) < 0) { + MsgErr("loading SIO2MAN.IRX failed\n"); + exit(0); + } + if (sceSifLoadModule("cdrom0:\\DRIVERS\\PADMAN.IRX;1", 0, nullptr) < 0) { + MsgErr("loading PADMAN.IRX failed\n"); + exit(0); + } + if (sceSifLoadModule("cdrom0:\\DRIVERS\\LIBSD.IRX;1", 0, nullptr) < 0) { + MsgErr("loading LIBSD.IRX failed\n"); + exit(0); + } + if (sceSifLoadModule("cdrom0:\\DRIVERS\\MCMAN.IRX;1", 0, nullptr) < 0) { + MsgErr("loading MCMAN.IRX failed\n"); + exit(0); + } + + if (sceSifLoadModule("cdrom0:\\DRIVERS\\MCSERV.IRX;1", 0, nullptr) < 0) { + MsgErr("loading MCSERV.IRX failed\n"); + exit(0); + } + if (sceSifLoadModule("cdrom0:\\DRIVERS\\989NOSTR.IRX;1", 0, nullptr) < 0) { + MsgErr("loading 989SND.IRX failed\n"); + exit(0); + } + if (sceSifLoadModule("cdrom0:\\DRIVERS\\SCRTCHPD.IRX;1", 0, nullptr) < 0) { + MsgErr("loading SCRTCHPD.IRX failed\n"); + exit(0); + } + printf("Initializing CD library in ISO_CD mode\n"); + auto rv = + sceSifLoadModule("cdrom0:\\DRIVERS\\OVERLORD.IRX;1", total_len, overlord_boot_command); + if (rv < 0) { + MsgErr("loading OVERLORD.IRX failed %d\n", rv); + exit(0); + } + } else { + if (modsrc == 2) { + if (sceSifLoadModule("host0:isoimage/DRIVERS/SIO2MAN.IRX", 0, nullptr) < 0) { + MsgErr("loading sio2man.irx failed\n"); + exit(0); + } + if (sceSifLoadModule("host0:isoimage/DRIVERS/PADMAN.IRX", 0, nullptr) < 0) { + MsgErr("loading padman.irx failed\n"); + exit(0); + } + if (sceSifLoadModule("host0:isoimage/DRIVERS/LIBSD.IRX", 0, nullptr) < 0) { + MsgErr("loading libsd.irx failed\n"); + exit(0); + } + if (sceSifLoadModule("host0:isoimage/DRIVERS/MCMAN.IRX", 0, nullptr) < 0) { + MsgErr("loading mcman.irx failed\n"); + exit(0); + } + if (sceSifLoadModule("host0:isoimage/DRIVERS/MCSERV.IRX", 0, nullptr) < 0) { + MsgErr("loading mcserv.irx failed\n"); + exit(0); + } + if (sceSifLoadModule("host:isoimage/DRIVERS/989NOSTR.IRX", 1, "do_rpc=0") < 0) { + MsgErr("loading 989snd.irx failed\n"); + exit(0); + } + sceSifLoadModule("host0:/usr/home/src/989snd23/iop/sce27/989err.irx", 0, nullptr); + + if (sceSifLoadModule("host0:isoimage/DRIVERS/SCRTCHPD.IRX;1", 0, nullptr) < 0) { + MsgErr("loading scrtchpd.irx failed\n"); + exit(0); + } + printf("Initializing CD library in DEVISO mode\n"); + + auto rv = sceSifLoadModule("host0:isoimage/DRIVERS/OVERLORD.IRX", total_len, + overlord_boot_command); + if (rv < 0) { + MsgErr("loading overlord.irx <2> failed\n"); + exit(0); + } + } + } + } + int rv = sceMcInit(); + if (rv < 0) { + MsgErr("MC driver init failed %d\n", rv); + exit(0); + } + printf("InitIOP OK\n"); +} + +int InitMachine() { + // heap_start = malloc(0x10); + // set up global heap (modified, the default size in the release game is 32 MB in all cases) + u32 global_heap_size = GLOBAL_HEAP_END - HEAP_START; + float size_mb = ((float)global_heap_size) / (float)(1 << 20); + lg::info("gkernel: global heap 0x{:08x} to 0x{:08x} (size {:.3f} MB)", HEAP_START, + GLOBAL_HEAP_END, size_mb); + kinitheap(kglobalheap, Ptr(HEAP_START), global_heap_size); + + kmemopen_from_c(kglobalheap, "global"); + kmemopen_from_c(kglobalheap, "scheme-globals"); + if (!MasterDebug && !DebugSegment) { + // if no debug, we make the kheapinfo structure NULL so GOAL knows not to use it. + // note: either MasterDebug or DebugSegment is enough to give use the debug heap. + kdebugheap.offset = 0; + } else { + kinitheap(kdebugheap, Ptr(DEBUG_HEAP_START), jak2::DEBUG_HEAP_SIZE); + } + init_output(); + InitIOP(); + // sceGsResetPath(); + InitVideo(); + // FlushCache(0); + // FlushCache(2); + // sceGsSyncV(0); + // if (scePadInit(0) != 1) { + // MsgErr("dkernel: !init pad\n"); + // } + // if (MasterDebug != 0) { + InitGoalProto(); + // } + + printf("InitSound\n"); + InitSound(); + printf("InitRPC\n"); + InitRPC(); + reset_output(); + clear_print(); + auto status = InitHeapAndSymbol(); + if (status >= 0) { + printf("InitListenerConnect\n"); + InitListenerConnect(); + printf("InitCheckListener\n"); + InitCheckListener(); + Msg(6, "kernel: machine started\n"); + return 0; + } else { + return status; + } +} + +/*! + * Shutdown the runtime. + */ +int ShutdownMachine() { + Msg(6, "kernel: machine shutdown (reason %d)\n", MasterExit); + ASSERT(false); + /* + StopIOP(); + ShutdownSound(); + CloseListener(); + */ + ShutdownGoalProto(); + + // OpenGOAL only - kill ps2 VM + if (VM::use) { + VM::vm_kill(); + } + return 0; +} + +Ptr MouseGetData(Ptr mouse) { + // stubbed out in the actual game + return mouse; +} + +/*! + * Open a file-stream. Name is a GOAL string. Mode is a GOAL symbol. Use 'read for readonly + * and anything else for write only. + */ +u64 kopen(u64 fs, u64 name, u64 mode) { + auto file_stream = Ptr(fs).c(); + file_stream->mode = mode; + file_stream->name = name; + file_stream->flags = 0; + printf("****** CALL TO kopen() ******\n"); + char buffer[128]; + // sprintf(buffer, "host:%s", Ptr(name)->data()); + sprintf(buffer, "%s", Ptr(name)->data()); + if (!strcmp(Ptr>(mode)->name_cstr(), "read")) { + // 0x1 + file_stream->file = sceOpen(buffer, SCE_RDONLY); + } else if (!strcmp(Ptr>(mode)->name_cstr(), "append")) { + // new in jak 2! + // 0x202 + file_stream->file = sceOpen(buffer, SCE_CREAT | SCE_WRONLY); + } else { + // 0x602 + file_stream->file = sceOpen(buffer, SCE_TRUNC | SCE_CREAT | SCE_WRONLY); + } + + return fs; +} + +void InitMachine_PCPort() { + // PC Port added functions + + make_function_symbol_from_c("__read-ee-timer", (void*)read_ee_timer); + make_function_symbol_from_c("__mem-move", (void*)c_memmove); + // make_function_symbol_from_c("__send-gfx-dma-chain", (void*)send_gfx_dma_chain); + // make_function_symbol_from_c("__pc-texture-upload-now", (void*)pc_texture_upload_now); + // make_function_symbol_from_c("__pc-texture-relocate", (void*)pc_texture_relocate); + // make_function_symbol_from_c("__pc-get-mips2c", (void*)pc_get_mips2c); + // make_function_symbol_from_c("__pc-set-levels", (void*)pc_set_levels); + + // pad stuff + make_function_symbol_from_c("pc-pad-get-mapped-button", (void*)Gfx::get_mapped_button); + make_function_symbol_from_c("pc-pad-input-map-save!", (void*)Gfx::input_mode_save); + make_function_symbol_from_c("pc-pad-input-mode-set", (void*)Gfx::input_mode_set); + make_function_symbol_from_c("pc-pad-input-pad-set", (void*)Pad::input_mode_pad_set); + make_function_symbol_from_c("pc-pad-input-mode-get", (void*)Pad::input_mode_get); + make_function_symbol_from_c("pc-pad-input-key-get", (void*)Pad::input_mode_get_key); + make_function_symbol_from_c("pc-pad-input-index-get", (void*)Pad::input_mode_get_index); + + // os stuff + // make_function_symbol_from_c("pc-get-os", (void*)get_os); + make_function_symbol_from_c("pc-get-window-size", (void*)get_window_size); + make_function_symbol_from_c("pc-get-window-scale", (void*)get_window_scale); + // make_function_symbol_from_c("pc-get-fullscreen", (void*)get_fullscreen); + make_function_symbol_from_c("pc-get-screen-size", (void*)get_screen_size); + make_function_symbol_from_c("pc-get-screen-rate", (void*)get_screen_rate); + make_function_symbol_from_c("pc-get-screen-vmode-count", (void*)get_screen_vmode_count); + make_function_symbol_from_c("pc-set-window-size", (void*)Gfx::set_window_size); + // make_function_symbol_from_c("pc-set-fullscreen", (void*)set_fullscreen); + make_function_symbol_from_c("pc-set-frame-rate", (void*)set_frame_rate); + make_function_symbol_from_c("pc-set-vsync", (void*)set_vsync); + make_function_symbol_from_c("pc-set-window-lock", (void*)set_window_lock); + + // graphics things + make_function_symbol_from_c("pc-set-letterbox", (void*)Gfx::set_letterbox); + make_function_symbol_from_c("pc-renderer-tree-set-lod", (void*)Gfx::SetLod); + make_function_symbol_from_c("pc-set-collision-mode", (void*)Gfx::CollisionRendererSetMode); + make_function_symbol_from_c("pc-set-collision-mask", (void*)set_collision_mask); + make_function_symbol_from_c("pc-get-collision-mask", (void*)get_collision_mask); + make_function_symbol_from_c("pc-set-collision-wireframe", (void*)set_collision_wireframe); + make_function_symbol_from_c("pc-set-collision", (void*)set_collision); + + // file related functions + make_function_symbol_from_c("pc-filepath-exists?", (void*)filepath_exists); + make_function_symbol_from_c("pc-mkdir-file-path", (void*)mkdir_path); + + // discord rich presence + // make_function_symbol_from_c("pc-discord-rpc-set", (void*)set_discord_rpc); + // make_function_symbol_from_c("pc-discord-rpc-update", (void*)update_discord_rpc); + + // profiler + make_function_symbol_from_c("pc-prof", (void*)prof_event); + + // init ps2 VM + if (VM::use) { + make_function_symbol_from_c("vm-ptr", (void*)VM::get_vm_ptr); + VM::vm_init(); + } + + // setup string constants + auto user_dir_path = file_util::get_user_game_dir(); + intern_from_c("*pc-user-dir-base-path*")->value() = + make_string_from_c(user_dir_path.string().c_str()); + // TODO - we will eventually need a better way to know what game we are playing + auto settings_path = file_util::get_user_settings_dir(); + intern_from_c("*pc-settings-folder*")->value() = + make_string_from_c(settings_path.string().c_str()); + intern_from_c("*pc-settings-built-sha*")->value() = make_string_from_c(GIT_VERSION); +} + +void PutDisplayEnv(u32 /*ptr*/) { + ASSERT(false); +} + +u32 sceGsSyncV(u32 mode) { + // stub, jak2 probably works differently here + ASSERT(false); + return 0; + /* + ASSERT(mode == 0); + VBlank_Handler(); + return Gfx::vsync(); + */ +} + +u32 sceGsSyncPath(u32 mode, u32 timeout) { + // stub, jak2 probably works differently here + ASSERT(mode == 0 && timeout == 0); + ASSERT(false); + return 0; + // return Gfx::sync_path(); +} + +void aybabtu() {} + +void InitMachineScheme() { + make_function_symbol_from_c("put-display-env", (void*)PutDisplayEnv); + make_function_symbol_from_c("syncv", (void*)sceGsSyncV); + make_function_symbol_from_c("sync-path", (void*)sceGsSyncPath); + make_function_symbol_from_c("reset-path", (void*)ee::sceGsResetPath); + make_function_symbol_from_c("reset-graph", (void*)sceGsResetGraph); + make_function_symbol_from_c("dma-sync", (void*)sceDmaSync); + make_function_symbol_from_c("gs-put-imr", (void*)sceGsPutIMR); + make_function_symbol_from_c("gs-get-imr", (void*)sceGsGetIMR); + make_function_symbol_from_c("gs-store-image", (void*)sceGsExecStoreImage); + make_function_symbol_from_c("flush-cache", (void*)FlushCache); + make_function_symbol_from_c("cpad-open", (void*)CPadOpen); + make_function_symbol_from_c("cpad-get-data", (void*)CPadGetData); + make_function_symbol_from_c("mouse-get-data", (void*)MouseGetData); + make_function_symbol_from_c("install-handler", (void*)InstallHandler); + make_function_symbol_from_c("install-debug-handler", (void*)InstallDebugHandler); + make_function_symbol_from_c("file-stream-open", (void*)kopen); + make_function_symbol_from_c("file-stream-close", (void*)kclose); + make_function_symbol_from_c("file-stream-length", (void*)klength); + make_function_symbol_from_c("file-stream-seek", (void*)kseek); + make_function_symbol_from_c("file-stream-read", (void*)kread); + make_function_symbol_from_c("file-stream-write", (void*)kwrite); + make_function_symbol_from_c("scf-get-language", (void*)DecodeLanguage); + make_function_symbol_from_c("scf-get-time", (void*)DecodeTime); + make_function_symbol_from_c("scf-get-aspect", (void*)DecodeAspect); + make_function_symbol_from_c("scf-get-volume", (void*)DecodeVolume); + make_function_symbol_from_c("scf-get-territory", (void*)DecodeTerritory); + make_function_symbol_from_c("scf-get-timeout", (void*)DecodeTimeout); + make_function_symbol_from_c("scf-get-inactive-timeout", (void*)DecodeInactiveTimeout); + make_function_symbol_from_c("dma-to-iop", (void*)dma_to_iop); + make_function_symbol_from_c("kernel-shutdown", (void*)KernelShutdown); + make_function_symbol_from_c("aybabtu", (void*)aybabtu); // was nothing function + + InitMachine_PCPort(); + + InitSoundScheme(); + intern_from_c("*stack-top*")->value() = 0x7f00000; + intern_from_c("*stack-base*")->value() = 0x7ffffff; + intern_from_c("*stack-size*")->value() = 0x100000; + intern_from_c("*kernel-boot-message*")->value() = intern_from_c(DebugBootMessage).offset; + intern_from_c("*user*")->value() = make_string_from_c(DebugBootUser); + if (DiskBoot) { + intern_from_c("*kernel-boot-mode*")->value() = intern_from_c("boot").offset; + } + intern_from_c("*kernel-boot-level*")->value() = intern_from_c(DebugBootLevel).offset; + intern_from_c("*kernel-boot-art-group*")->value() = make_string_from_c(DebugBootArtGroup); + if (DiskBoot) { + *EnableMethodSet = *EnableMethodSet + 1; + load_and_link_dgo_from_c("game", kglobalheap, + LINK_FLAG_OUTPUT_LOAD | LINK_FLAG_EXECUTE | LINK_FLAG_PRINT_LOGIN, + 0x400000, true); + *EnableMethodSet = *EnableMethodSet + -1; + using namespace jak2_symbols; + kernel_packages->value() = + new_pair(s7.offset + FIX_SYM_GLOBAL_HEAP, *((s7 + FIX_SYM_PAIR_TYPE - 1).cast()), + make_string_from_c("engine"), kernel_packages->value()); + kernel_packages->value() = + new_pair(s7.offset + FIX_SYM_GLOBAL_HEAP, *((s7 + FIX_SYM_PAIR_TYPE - 1).cast()), + make_string_from_c("art"), kernel_packages->value()); + kernel_packages->value() = + new_pair(s7.offset + FIX_SYM_GLOBAL_HEAP, *((s7 + FIX_SYM_PAIR_TYPE).cast()), + make_string_from_c("common"), kernel_packages->value()); + printf("calling play-boot!\n"); + call_goal_function_by_name("play-boot"); // new function for jak2! + } +} + +} // namespace jak2 \ No newline at end of file diff --git a/game/kernel/jak2/kmachine.h b/game/kernel/jak2/kmachine.h new file mode 100644 index 0000000000..dd9c1b2d32 --- /dev/null +++ b/game/kernel/jak2/kmachine.h @@ -0,0 +1,11 @@ +#pragma once + +namespace jak2 { +void InitParms(int argc, const char* const* argv); +void InitIOP(); +int InitMachine(); +int ShutdownMachine(); +void InitMachineScheme(); + +struct MouseInfo {}; +} // namespace jak2 \ No newline at end of file diff --git a/game/kernel/jak2/kmalloc.cpp b/game/kernel/jak2/kmalloc.cpp new file mode 100644 index 0000000000..6f00253b8b --- /dev/null +++ b/game/kernel/jak2/kmalloc.cpp @@ -0,0 +1,24 @@ +#include "kmalloc.h" + +/* + * Jak 2 adds a few "memopen" functions. I think these were used to categorize memory allocations. + * GOAL and C++ code will call "memopen" with an appropriate category name before making + * allocations. + * + * These functions do nothing in the release version (and all known versions), but they might be + * interested for us to track memory usage. + */ + +namespace jak2 { +void kmemopen_from_c(Ptr heap, const char* name) { + (void)heap; + (void)name; +} + +void kmemopen(u32 heap, u32 name) { + (void)heap; + (void)name; +} + +void kmemclose() {} +} // namespace jak2 diff --git a/game/kernel/jak2/kmalloc.h b/game/kernel/jak2/kmalloc.h new file mode 100644 index 0000000000..97fd850bb1 --- /dev/null +++ b/game/kernel/jak2/kmalloc.h @@ -0,0 +1,9 @@ +#pragma once + +#include "game/kernel/common/kmalloc.h" + +namespace jak2 { +void kmemopen_from_c(Ptr heap, const char* name); +void kmemopen(u32 heap, u32 name); +void kmemclose(); +} // namespace jak2 diff --git a/game/kernel/jak2/kprint.cpp b/game/kernel/jak2/kprint.cpp new file mode 100644 index 0000000000..1c442f8c19 --- /dev/null +++ b/game/kernel/jak2/kprint.cpp @@ -0,0 +1,565 @@ +#include "kprint.h" + +#include +#include + +#include "common/goal_constants.h" +#include "common/listener_common.h" +#include "common/symbols.h" + +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/kboot.h" +#include "game/kernel/common/klisten.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/jak2/kscheme.h" +#include "game/sce/sif_ee.h" + +namespace jak2 { + +void output_sql_query(char* query_name) { + if (MasterDebug != 0) { + sprintf(strend(OutputBufArea.cast().c() + sizeof(ListenerMessageHeader)), "sql-query \""); + + char* buffer_ptr = strend(OutputBufArea.cast().c() + sizeof(ListenerMessageHeader)); + char query_char = *query_name; + char query_char_to_add = *query_name; + while (query_char != 0) { + if (query_char_to_add == '\"') { + *buffer_ptr = '\\'; + buffer_ptr[1] = *query_name; + buffer_ptr += 2; + } else { + *buffer_ptr = query_char_to_add; + buffer_ptr++; + } + query_name = query_name + 1; + query_char = *query_name; + query_char_to_add = *query_name; + } + *buffer_ptr = '\"'; + buffer_ptr[1] = '\n'; + buffer_ptr[2] = 0; + OutputPending = OutputBufArea + sizeof(ListenerMessageHeader); + } +} +} // namespace jak2 + +/*! + * The GOAL "format" function. The actual function is named "format". However, GOAL's calling + * convention differs from x86-64, so GOAL cannot directly call format. There is an assembly + * function in format_wrapper.nasm named format. It takes the GOAL argument registers, stores them + * in an array on the stack, and calls this function with a pointer to that array. + * + * This function is a disaster. For now, it's copied from jak1, with the obvious fixes made, but + * it's probably worth another pass. + */ +s32 format_impl_jak2(uint64_t* args) { + using namespace jak2_symbols; + using namespace jak2; + + // first two args are dest, format string + uint64_t* arg_regs = args + 2; + + // data for arguments in a format command + format_struct argument_data[8]; + + u32 arg_reg_idx = 0; + + // the gstring + char* format_gstring = Ptr(args[1]).c(); + + u32 original_dest = args[0]; + + // set up print pending + char* print_temp = PrintPending.cast().c(); + if (!PrintPending.offset) { + print_temp = PrintBufArea.cast().c() + sizeof(ListenerMessageHeader); + } + PrintPending = make_ptr(strend(print_temp)).cast(); + + // what we write to + char* output_ptr = PrintPending.cast().c(); + + // convert gstring to cstring + char* format_cstring = format_gstring + 4; + + // mysteries + char* PrintPendingLocal2 = PrintPending.cast().c(); + char* PrintPendingLocal3 = output_ptr; + + // start by computing indentation + u32 indentation = 0; + + // read goal binteger + if (print_column.offset) { + // added the if check so we can format even if the kernel didn't load right. + indentation = (*print_column) >> 3; + } + + // which arg we're on + u32 arg_idx = 0; + + // if last char was newline and we have tabs, do tabs + if (indentation && output_ptr[-1] == '\n') { + for (u32 i = 0; i < indentation; i++) { + *output_ptr = ' '; + output_ptr++; + } + } + + // input pointer + char* format_ptr = format_cstring; + + // loop over the format string + while (*format_ptr) { + // got a command? + if (*format_ptr == '~') { + char* arg_start = format_ptr; + // get some arguments + arg_idx = 0; + u8 justify = 0; + for (auto& x : argument_data) { + x.reset(); + } + + // read arguments + while ((u8)(format_ptr[1] - '0') < 10 || // number 0 to 10 + format_ptr[1] == ',' || // comma + format_ptr[1] == '\'' || // quote + format_ptr[1] == '`' || // backtick + (argument_data[arg_idx].data[0] == -1 && + (format_ptr[1] == '-' || format_ptr[1] == '+') // flags1 == -1 && +/- + )) { + // here format_ptr[1] points to next unread character in argument + // format_ptr[0] is originally the ~ + // should exit loop with format_ptr[1] == the command character + char arg_char = format_ptr[1]; // gVar1 + + if (arg_char == ',') { + // advance to next argument + arg_idx++; // increment which argument we're on + format_ptr++; // increment past comma, and try again + continue; + } + + // character argument + if (arg_char == '\'') { // 0x27 + argument_data[arg_idx].data[0] = format_ptr[2]; + format_ptr += 2; + continue; + } + + // string argument + if (arg_char == '`') { // 0x60 + u32 i = 0; + format_ptr += 2; + // read string + while (*format_ptr != '`') { + argument_data[arg_idx].data[i] = *format_ptr; + i++; + format_ptr++; + } + // null terminate + argument_data[arg_idx].data[i] = 0; + continue; + } + + if (arg_char == '-') { // 0x2d + // negative flag + argument_data[arg_idx].data[1] = 1; + format_ptr++; + continue; + } + + if (arg_char == '+') { // 0x2b + // positive flag does nothing + format_ptr++; + continue; + } + + // otherwise: + + // null terminate if we got no args + if (argument_data[arg_idx].data[0] == -1) { + argument_data[arg_idx].data[0] = 0; + } + + // otherwise it's a number + argument_data[arg_idx].data[0] = argument_data[arg_idx].data[0] * 10 + arg_char - '0'; + format_ptr++; + } // end argument while + + // switch on command + switch (format_ptr[1]) { + // offset of 0x25 + + case '%': // newline + *output_ptr = '\n'; + output_ptr++; + // indent the next line if there is one + if (indentation && format_ptr[2]) { + for (u32 i = 0; i < indentation; i++) { + *output_ptr = ' '; + output_ptr++; + } + } + break; + + case '~': // tilde escape + *output_ptr = '~'; + output_ptr++; + break; + + // pass through arguments + case 'H': // 23 -> 48, H + case 'J': // 25 -> 4A, J + case 'K': // 26 -> 4B, K + case 'L': // 27 -> 4C, L + case 'N': // 29 -> 4E, N + case 'V': // 31 -> 56, V + case 'W': // 32 -> 57, W + case 'Y': // 34 -> 59, Y + case 'Z': // 35 -> 5A, Z + case 'h': + case 'j': + case 'k': + case 'l': + case 'n': + case 'v': + case 'w': + case 'y': + case 'z': + while (arg_start < format_ptr + 1) { + *output_ptr = *arg_start; + arg_start++; + output_ptr++; + } + *output_ptr = format_ptr[1]; + output_ptr++; + break; + + case 'G': // like %s, prints a C string + case 'g': { + *output_ptr = 0; + u32 in = arg_regs[arg_reg_idx++]; + kstrcat(output_ptr, Ptr(in).c()); + output_ptr = strend(output_ptr); + } break; + + case 'A': // print a boxed object + case 'a': // pad,padchar (like ) ~8,'0A + { + s8 arg0 = argument_data[0].data[0]; + s32 desired_length = arg0; + *output_ptr = 0; + u32 in = arg_regs[arg_reg_idx++]; + jak2::print_object(in); + if (desired_length != -1) { + s32 print_len = strlen(output_ptr); + if (desired_length < print_len) { + // too long! + if (desired_length > 1) { // mark with tilde that we will truncate + output_ptr[desired_length - 1] = '~'; + } + output_ptr[desired_length] = 0; // and truncate + } else if (print_len < desired_length) { + // too short + if (justify == 0) { + char pad = ' '; + if (argument_data[1].data[0] != -1) { + pad = argument_data[1].data[0]; + } + kstrinsert(output_ptr, pad, desired_length - print_len); + } else { + ASSERT(false); + // output_ptr = strend(output_ptr); + // while(0 < (desired_length - print_len)) { + // char pad = ' '; + // if(argument_data[0].data[1] != -1) { + // pad = argument_data[0].data[1]; + // } + // output_ptr[0] = pad; + // output_ptr++; + // + // } + // *output_ptr = 0; + } + } + } + output_ptr = strend(output_ptr); + + } break; + + case 'S': // like A, but strings are printed without quotes + case 's': { + s8 arg0 = argument_data[0].data[0]; + s32 desired_length = arg0; + *output_ptr = 0; + u32 in = arg_regs[arg_reg_idx++]; + + // if it's a string + if (((in & 0x7) == 0x4) && *Ptr(in - 4) == *(s7 + FIX_SYM_STRING_TYPE - 1)) { + cprintf("%s", Ptr(in).c() + 4); + } else { + jak2::print_object(in); + } + + if (desired_length != -1) { + s32 print_len = strlen(output_ptr); + if (desired_length < print_len) { + // too long! + if (desired_length > 1) { // mark with tilde that we will truncate + output_ptr[desired_length - 1] = '~'; + } + output_ptr[desired_length] = 0; // and truncate + } else if (print_len < desired_length) { + // too short + if (justify == 0) { + char pad = ' '; + if (argument_data[1].data[0] != -1) { + pad = argument_data[1].data[0]; + } + kstrinsert(output_ptr, pad, desired_length - print_len); + + } else { + ASSERT(false); + // output_ptr = strend(output_ptr); + // u32 l140 = 0; + // while(l140 < (desired_length - print_len)) { + // char* l108 = output_ptr; + // + // char pad = ' '; + // if(argument_data[0].data[1] != -1) { + // pad = argument_data[0].data[1]; + // } + // output_ptr[0] = pad; + // output_ptr++; + // } + // *output_ptr = 0; + } + } + } + output_ptr = strend(output_ptr); + } break; + + case 'C': // character + case 'c': + *output_ptr = arg_regs[arg_reg_idx++]; + output_ptr++; + break; + + case 'P': // like ~A, but can specify type explicitly + case 'p': { + *output_ptr = 0; + s8 arg0 = argument_data[0].data[0]; + u32 in = arg_regs[arg_reg_idx++]; + if (arg0 == -1) { + jak2::print_object(in); + } else { + auto sym = jak2::find_symbol_from_c(argument_data[0].data); + if (sym.offset) { + Ptr type(sym->value()); + if (type.offset) { + call_method_of_type(in, type, GOAL_PRINT_METHOD); + } + } else { + ASSERT(false); // bad type. + } + } + output_ptr = strend(output_ptr); + } break; + + case 'I': // like ~P, but calls inpsect + case 'i': { + *output_ptr = 0; + s8 arg0 = argument_data[0].data[0]; + u32 in = arg_regs[arg_reg_idx++]; + if (arg0 == -1) { + inspect_object(in); + } else { + auto sym = find_symbol_from_c(argument_data[0].data); + if (sym.offset) { + Ptr type(sym->value()); + if (type.offset) { + call_method_of_type(in, type, GOAL_INSPECT_METHOD); + } + } else { + ASSERT(false); // bad type + } + } + output_ptr = strend(output_ptr); + } break; + + case 'Q': // not yet implemented. hopefully andy gavin finishes this one soon. + case 'q': + ASSERT(false); + break; + + case 'X': // hex, 64 bit, pad padchar + case 'x': { + char pad = '0'; + if (argument_data[1].data[0] != -1) { + pad = argument_data[1].data[0]; + } + u64 in = arg_regs[arg_reg_idx++]; + kitoa(output_ptr, in, 16, argument_data[0].data[0], pad, 0); + output_ptr = strend(output_ptr); + } break; + + case 'D': // integer 64, pad padchar + case 'd': { + char pad = ' '; + if (argument_data[1].data[0] != -1) { + pad = argument_data[1].data[0]; + } + u64 in = arg_regs[arg_reg_idx++]; + kitoa(output_ptr, in, 10, argument_data[0].data[0], pad, 0); + output_ptr = strend(output_ptr); + } break; + + case 'B': // integer 64, pad padchar + case 'b': { + char pad = '0'; + if (argument_data[1].data[0] != -1) { + pad = argument_data[1].data[0]; + } + u64 in = arg_regs[arg_reg_idx++]; + kitoa(output_ptr, in, 2, argument_data[0].data[0], pad, 0); + output_ptr = strend(output_ptr); + } break; + + case 'F': // float 12 pad, 4 precision + { + float in = *(float*)&arg_regs[arg_reg_idx++]; + ftoa(output_ptr, in, 0xc, ' ', 4, 0); + output_ptr = strend(output_ptr); + } break; + + case 'f': // float with args + { + float in = *(float*)&arg_regs[arg_reg_idx++]; + s8 pad_length = argument_data[0].data[0]; + s8 pad_char = argument_data[1].data[0]; + if (pad_char == -1) + pad_char = ' '; + s8 precision = argument_data[2].data[0]; + if (precision == -1) + precision = 4; + ftoa(output_ptr, in, pad_length, pad_char, precision, 0); + output_ptr = strend(output_ptr); + } break; + + case 'R': // rotation degrees + case 'r': { + float in = *(float*)&arg_regs[arg_reg_idx++]; + s8 pad_length = argument_data[0].data[0]; + s8 pad_char = argument_data[1].data[0]; + if (pad_char == -1) + pad_char = ' '; + s8 precision = argument_data[2].data[0]; + if (precision == -1) + precision = 4; + ftoa(output_ptr, in * 360.f / 65536.f, pad_length, pad_char, precision, 0); + output_ptr = strend(output_ptr); + } break; + + case 'M': // distance meters + case 'm': { + float in = *(float*)&arg_regs[arg_reg_idx++]; + s8 pad_length = argument_data[0].data[0]; + s8 pad_char = argument_data[1].data[0]; + if (pad_char == -1) + pad_char = ' '; + s8 precision = argument_data[2].data[0]; + if (precision == -1) + precision = 4; + ftoa(output_ptr, in / 4096.f, pad_length, pad_char, precision, 0); + output_ptr = strend(output_ptr); + } break; + + case 'E': // time seconds + case 'e': { + s64 in = arg_regs[arg_reg_idx++]; + s8 pad_length = argument_data[0].data[0]; + s8 pad_char = argument_data[0].data[1]; + if (pad_char == -1) + pad_char = ' '; + s8 precision = argument_data[0].data[2]; + if (precision == -1) + precision = 4; + float value; + if (in < 0) { + ASSERT(false); // i don't get this one + } else { + value = in; + } + ftoa(output_ptr, value / 300.f, pad_length, pad_char, precision, 0); + output_ptr = strend(output_ptr); + } break; + + case 'T': + case 't': { + sprintf(output_ptr, "\t"); + output_ptr = strend(output_ptr); + } break; + + default: + MsgErr("format: unknown code 0x%02x\n", format_ptr[1]); + ASSERT(false); + break; + } + format_ptr++; + } else { + // got normal char, just copy it + *output_ptr = *format_ptr; + output_ptr++; + } + format_ptr++; + } // end format string while + + // end + *output_ptr = 0; + output_ptr++; + + if (original_dest == s7.offset + FIX_SYM_TRUE) { + // do nothing, we're done + return 0; + } else if (original_dest == s7.offset + FIX_SYM_FALSE) { + // #f means print to new string + u32 string = make_string_from_c(PrintPendingLocal3); + PrintPending = make_ptr(PrintPendingLocal2).cast(); + *PrintPendingLocal3 = 0; + return string; + } else if (original_dest == 0) { + printf("%s", PrintPendingLocal3); + fflush(stdout); + PrintPending = make_ptr(PrintPendingLocal2).cast(); + *PrintPendingLocal3 = 0; + return 0; + } else { + if ((original_dest & OFFSET_MASK) == BASIC_OFFSET) { + Ptr type = *Ptr>(original_dest - 4); + if (type == *Ptr>(s7.offset + FIX_SYM_STRING_TYPE - 1)) { + u32 len = *Ptr(original_dest); + char* str = Ptr(original_dest + 4).c(); + kstrncat(str, PrintPendingLocal3, len); + PrintPending = make_ptr(PrintPendingLocal2).cast(); + *PrintPendingLocal3 = 0; + return 0; + } else if (type == *Ptr>(s7.offset + FIX_SYM_FILE_STREAM - 1)) { + size_t len = strlen(PrintPendingLocal3); + // sceWrite + ee::sceWrite(*Ptr(original_dest + 12), PrintPendingLocal3, len); + + PrintPending = make_ptr(PrintPendingLocal2).cast(); + *PrintPendingLocal3 = 0; + return 0; + } + } + ASSERT(false); // unknown destination + return 0; + } + + ASSERT(false); // ?????? + return 7; +} diff --git a/game/kernel/jak2/kprint.h b/game/kernel/jak2/kprint.h new file mode 100644 index 0000000000..d07a17cc68 --- /dev/null +++ b/game/kernel/jak2/kprint.h @@ -0,0 +1,12 @@ +#pragma once + +#include "common/common_types.h" + +namespace jak2 { +void output_sql_query(char* query_name); +} + +// todo, do we actually have to do this, now that we aren't calling it from asm? +extern "C" { +s32 format_impl_jak2(uint64_t* args); +} \ No newline at end of file diff --git a/game/kernel/jak2/kscheme.cpp b/game/kernel/jak2/kscheme.cpp new file mode 100644 index 0000000000..83d5547e94 --- /dev/null +++ b/game/kernel/jak2/kscheme.cpp @@ -0,0 +1,1646 @@ + +#include "kscheme.h" + +#include +#include + +#include "common/common_types.h" +#include "common/goal_constants.h" +#include "common/log/log.h" +#include "common/symbols.h" + +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/kdsnetm.h" +#include "game/kernel/common/klink.h" +#include "game/kernel/common/kmalloc.h" +#include "game/kernel/common/kmemcard.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/common/kscheme.h" +#include "game/kernel/jak2/kdgo.h" +#include "game/kernel/jak2/klink.h" +#include "game/kernel/jak2/klisten.h" +#include "game/kernel/jak2/kmachine.h" +#include "game/kernel/jak2/kmalloc.h" +#include "game/kernel/jak2/kprint.h" + +namespace jak2 { +using namespace jak2_symbols; +// where to put a new symbol for the most recently searched for symbol that wasn't found +u32 symbol_slot; + +Ptr> LevelTypeList; +Ptr> CollapseQuote; +Ptr> SqlResult; +Ptr KernelDebug; + +void kscheme_init_globals() { + symbol_slot = 0; + LevelTypeList.offset = 0; + CollapseQuote.offset = 0; + SqlResult.offset = 0; + KernelDebug.offset = 0; +} + +/*! + * New method for types which cannot have "new" used on them. + * Prints an error to stdout and returns false. + */ +u64 new_illegal(u32 allocation, u32 type) { + (void)allocation; + MsgErr("dkernel: illegal attempt to call new method of static object type %s\n", + Ptr(type)->symbol->name_cstr()); + return s7.offset; +} + +template +Ptr> sym_to_string_ptr(Ptr> in) { + return Ptr>(in.offset + SYM_TO_STRING_OFFSET); +} + +template +Ptr sym_to_string(Ptr> in) { + return *sym_to_string_ptr(in); +} + +template +Ptr sym_to_hash(Ptr> in) { + return Ptr(in.offset + SYM_TO_HASH_OFFSET); +} + +u32 u32_in_fixed_sym(u32 offset) { + return Ptr>(s7.offset + offset)->value(); +} + +void fixed_sym_set(u32 offset, u32 value) { + Ptr>(s7.offset + offset)->value() = value; +} + +u64 alloc_from_heap(u32 heap_symbol, u32 type, s32 size, u32 pp) { + using namespace jak2_symbols; + auto heap_ptr = Ptr>>(heap_symbol)->value(); + + s32 aligned_size = ((size + 0xf) / 0x10) * 0x10; + if ((((heap_symbol == s7.offset + FIX_SYM_GLOBAL_HEAP) || + (heap_symbol == s7.offset + FIX_SYM_DEBUG)) || + (heap_symbol == s7.offset + FIX_SYM_LOADING_LEVEL)) || + (heap_symbol == s7.offset + FIX_SYM_PROCESS_LEVEL_HEAP)) { + if (!type) { // no type given, just call it a global-object + return kmalloc(heap_ptr, size, KMALLOC_MEMSET, "global-object").offset; + } + + Ptr typ(type); + if (!typ->symbol.offset) { // type doesn't have a symbol, just call it a global-object + return kmalloc(heap_ptr, size, KMALLOC_MEMSET, "global-object").offset; + } + + Ptr gstr = sym_to_string(typ->symbol); + if (!gstr->len) { // string has nothing in it. + return kmalloc(heap_ptr, size, KMALLOC_MEMSET, "global-object").offset; + } + + return kmalloc(heap_ptr, size, KMALLOC_MEMSET, gstr->data()).offset; + } else if (heap_symbol == s7.offset + FIX_SYM_PROCESS_TYPE) { + u32 start = *Ptr(pp + 0x64); + u32 heapEnd = *Ptr(pp + 0x60); + u32 allocEnd = start + aligned_size; + + if (allocEnd < heapEnd) { + *Ptr(pp + 0x64) = allocEnd; + memset(Ptr(start).c(), 0, aligned_size); + return start; + } else { + MsgErr("kmalloc: !alloc mem in heap for # (%d bytes)\n", pp, aligned_size); + return 0; + } + } else if (heap_symbol == s7.offset + FIX_SYM_SCRATCH) { + ASSERT(false); // nyi, I think unused. + return 0; + } else { + memset(Ptr(heap_symbol).c(), 0, aligned_size); // treat it as a stack address + return heap_symbol; + } +} + +/*! + * Allocate untyped memory. + */ +u64 alloc_heap_memory(u32 heap, u32 size) { + // should never happen on process heap + return alloc_from_heap(heap, 0, size, UNKNOWN_PP); +} + +/*! + * Allocate memory and add type tag for an object. + * For allocating basics. + * Called from GOAL. + */ +u64 alloc_heap_object(u32 heap, u32 type, u32 size, u32 pp) { + auto mem = alloc_from_heap(heap, type, size, pp); + if (!mem) { + return 0; + } + + *Ptr(mem) = type; + return mem + BASIC_OFFSET; +} + +/*! + * Allocate a structure and get the structure size from the type. + */ +u64 new_structure(u32 heap, u32 type) { + // should never happen on process heap + return alloc_from_heap(heap, type, Ptr(type)->allocated_size, UNKNOWN_PP); +} + +/*! + * Allocate a structure with a dynamic size + */ +u64 new_dynamic_structure(u32 heap_symbol, u32 type, u32 size) { + // should never happen on process heap + return alloc_from_heap(heap_symbol, type, size, UNKNOWN_PP); +} + +/*! + * Delete a structure. Not supported, as it uses kfree, which doesn't do anything. + */ +void delete_structure(u32 s) { + kfree(Ptr(s)); +} + +/*! + * Allocate a basic of fixed size. + */ +u64 new_basic(u32 heap, u32 type, u32 /*size*/, u32 pp) { + return alloc_heap_object(heap, type, Ptr(type)->allocated_size, pp); +} + +/*! + * Delete a basic. Not supported, as it uses kfree. + */ +void delete_basic(u32 s) { + // note that the game has a bug here and has s as a uint* and does -4 which is actually a + // 16-byte offset. Luckily kfree does nothing so there's no harm done. But it's a good indication + // that the "freeing memory" feature never made it very far in development. This bug exists in + // Jak 3 as well. + kfree(Ptr(s - BASIC_OFFSET * 4)); // replicate the bug +} + +/*! + * Allocate a new pair and set its car and cdr. + */ +u64 new_pair(u32 heap, u32 type, u32 car, u32 cdr) { + auto mem = alloc_from_heap(heap, type, Ptr(type)->allocated_size, UNKNOWN_PP); + if (!mem) { + return 0; + } + + u32* m = Ptr(mem).c(); + m[0] = car; + m[1] = cdr; + return mem + PAIR_OFFSET; +} + +/*! + * Delete a pair. BUG + */ +void delete_pair(u32 s) { + // the -8 should be a -2, but s is likely a u32* in the code. + kfree(Ptr(s - 8)); +} + +/*! + * Make an empty string of given size. + * Allocates from the global heap. + */ +u64 make_string(u32 size) { + using namespace jak2_symbols; + auto mem_size = size + 1; // null + if (mem_size < 8) { + mem_size = 8; // min size of string + } + + // total size is mem_size (chars + null term), plus basic_offset (type tag) + 4 (string size) + auto mem = + alloc_heap_object((s7 + FIX_SYM_GLOBAL_HEAP).offset, u32_in_fixed_sym(FIX_SYM_STRING_TYPE), + mem_size + BASIC_OFFSET + sizeof(uint32_t), UNKNOWN_PP); + + // set the string size field. + if (mem) { + *Ptr(mem) = size; + } + return mem; +} + +/*! + * Convert a C string to a GOAL string. + * Allocates from the global heap and copies the string data. + */ +u64 make_string_from_c(const char* c_str) { + auto str_size = strlen(c_str); + auto mem_size = str_size + 1; + if (mem_size < 8) { + mem_size = 8; + } + + auto mem = + alloc_heap_object((s7 + FIX_SYM_GLOBAL_HEAP).offset, u32_in_fixed_sym(FIX_SYM_STRING_TYPE), + mem_size + BASIC_OFFSET + 4, UNKNOWN_PP); + // there's no check for failed allocation here! + + // string size field + *Ptr(mem) = str_size; + + // rest is chars + kstrcpy(Ptr(mem + 4).c(), c_str); + return mem; +} + +extern "C" { +void _arg_call_linux(); +} + +/*! + * This creates an OpenGOAL function from a C++ function. Only 6 arguments can be accepted. + * But calling this function is fast. It used to be really fast but wrong. + */ +Ptr make_function_from_c_linux(void* func, bool arg3_is_pp) { + auto mem = Ptr(alloc_heap_object(s7.offset + FIX_SYM_GLOBAL_HEAP, + u32_in_fixed_sym(FIX_SYM_FUNCTION_TYPE), 0x40, UNKNOWN_PP)); + auto f = (uint64_t)func; + auto target_function = (u8*)&f; + auto trampoline_function_addr = _arg_call_linux; + auto trampoline = (u8*)&trampoline_function_addr; + + // movabs rax, target_function + int offset = 0; + mem.c()[offset++] = 0x48; + mem.c()[offset++] = 0xb8; + for (int i = 0; i < 8; i++) { + mem.c()[offset++] = target_function[i]; + } + + // push rax + mem.c()[offset++] = 0x50; + + // movabs rax, trampoline + mem.c()[offset++] = 0x48; + mem.c()[offset++] = 0xb8; + for (int i = 0; i < 8; i++) { + mem.c()[offset++] = trampoline[i]; + } + + if (arg3_is_pp) { + // mov rcx, r13. Puts pp in the third argument. + mem.c()[offset++] = 0x4c; + mem.c()[offset++] = 0x89; + mem.c()[offset++] = 0xe9; + } + + // jmp rax + mem.c()[offset++] = 0xff; + mem.c()[offset++] = 0xe0; + // the asm function's ret will return to the caller of this (GOAL code) directlyz. + + // CacheFlush(mem, 0x34); + + return mem.cast(); +} + +/*! + * Create a GOAL function from a C function. This doesn't export it as a global function, it just + * creates a function object on the global heap. + * + * This creates a simple trampoline function which jumps to the C function and reorders the + * arguments to be correct for Windows. + */ +Ptr make_function_from_c_win32(void* func, bool arg3_is_pp) { + // allocate a function object on the global heap + auto mem = Ptr(alloc_heap_object(s7.offset + FIX_SYM_GLOBAL_HEAP, + u32_in_fixed_sym(FIX_SYM_FUNCTION_TYPE), 0x80, UNKNOWN_PP)); + auto f = (uint64_t)func; + auto fp = (u8*)&f; + + int i = 0; + // we will put the function address in RAX with a movabs rax, imm8 + mem.c()[i++] = 0x48; + mem.c()[i++] = 0xb8; + for (int j = 0; j < 8; j++) { + mem.c()[i++] = fp[j]; + } + + /* + push rdi + push rsi + push rdx + push rcx + pop r9 + pop r8 + pop rdx + pop rcx + push r10 + push r11 + sub rsp, 40 + */ + for (auto x : {0x57, 0x56, 0x52, 0x51, 0x41, 0x59, 0x41, 0x58, 0x5A, 0x59, 0x41, 0x52, 0x41, 0x53, + 0x48, 0x83, 0xEC, 0x28}) { + mem.c()[i++] = x; + } + + if (arg3_is_pp) { + // mov r9, r13. Puts pp in the third argument. + mem.c()[i++] = 0x4d; + mem.c()[i++] = 0x89; + mem.c()[i++] = 0xe9; + } + + /* + call rax + add rsp, 40 + pop r11 + pop r10 + ret + */ + for (auto x : {0xFF, 0xD0, 0x48, 0x83, 0xC4, 0x28, 0x41, 0x5B, 0x41, 0x5A, 0xC3}) { + mem.c()[i++] = x; + } + + // CacheFlush(mem, 0x34); + + return mem.cast(); +} + +extern "C" { +void _stack_call_linux(); +void _stack_call_win32(); +} + +Ptr make_stack_arg_function_from_c_linux(void* func) { + // allocate a function object on the global heap + auto mem = Ptr(alloc_heap_object(s7.offset + FIX_SYM_GLOBAL_HEAP, + u32_in_fixed_sym(FIX_SYM_FUNCTION_TYPE), 0x40, UNKNOWN_PP)); + auto f = (uint64_t)func; + auto target_function = (u8*)&f; + auto trampoline_function_addr = _stack_call_linux; + auto trampoline = (u8*)&trampoline_function_addr; + + // movabs rax, target_function + int offset = 0; + mem.c()[offset++] = 0x48; + mem.c()[offset++] = 0xb8; + for (int i = 0; i < 8; i++) { + mem.c()[offset++] = target_function[i]; + } + + // push rax + mem.c()[offset++] = 0x50; + + // movabs rax, trampoline + mem.c()[offset++] = 0x48; + mem.c()[offset++] = 0xb8; + for (int i = 0; i < 8; i++) { + mem.c()[offset++] = trampoline[i]; + } + + // jmp rax + mem.c()[offset++] = 0xff; + mem.c()[offset++] = 0xe0; + + // CacheFlush(mem, 0x34); + + return mem.cast(); +} + +/*! + * Create a GOAL function from a C function. This calls a windows function, but doesn't scramble + * the argument order. It's supposed to be used with _format_win32 which assumes GOAL order. + */ +Ptr make_stack_arg_function_from_c_win32(void* func) { + // allocate a function object on the global heap + auto mem = Ptr(alloc_heap_object(s7.offset + FIX_SYM_GLOBAL_HEAP, + u32_in_fixed_sym(FIX_SYM_FUNCTION_TYPE), 0x80, UNKNOWN_PP)); + auto f = (uint64_t)func; + auto fp = (u8*)&f; + auto trampoline_function_addr = _stack_call_win32; + auto trampoline = (u8*)&trampoline_function_addr; + + int i = 0; + // we will put the function address in RAX with a movabs rax, imm8 + mem.c()[i++] = 0x48; + mem.c()[i++] = 0xb8; + for (int j = 0; j < 8; j++) { + mem.c()[i++] = fp[j]; + } + + // push rax + mem.c()[i++] = 0x50; + + // we will put the function address in RAX with a movabs rax, imm8 + mem.c()[i++] = 0x48; + mem.c()[i++] = 0xb8; + for (int j = 0; j < 8; j++) { + mem.c()[i++] = trampoline[j]; + } + + /* + * jmp rax + */ + for (auto x : {0xFF, 0xE0}) { + mem.c()[i++] = x; + } + + return mem.cast(); +} + +/*! + * Create a GOAL function from a C function. This doesn't export it as a global function, it just + * creates a function object on the global heap. + * + * The implementation is to create a simple trampoline function which jumps to the C function. + */ +Ptr make_function_from_c(void* func, bool arg3_is_pp = false) { +#ifdef __linux__ + return make_function_from_c_linux(func, arg3_is_pp); +#elif _WIN32 + return make_function_from_c_win32(func, arg3_is_pp); +#endif +} + +Ptr make_stack_arg_function_from_c(void* func) { +#ifdef __linux__ + return make_stack_arg_function_from_c_linux(func); +#elif _WIN32 + return make_stack_arg_function_from_c_win32(func); +#endif +} + +/*! + * Create a GOAL function which does nothing and immediately returns. + */ +Ptr make_nothing_func() { + auto mem = Ptr(alloc_heap_object(s7.offset + FIX_SYM_GLOBAL_HEAP, + u32_in_fixed_sym(FIX_SYM_FUNCTION_TYPE), 0x14, UNKNOWN_PP)); + + // a single x86-64 ret. + mem.c()[0] = 0xc3; + // CacheFlush(mem, 8); + return mem.cast(); +} + +/*! + * Create a GOAL function which returns 0. + */ +Ptr make_zero_func() { + auto mem = Ptr(alloc_heap_object(s7.offset + FIX_SYM_GLOBAL_HEAP, + u32_in_fixed_sym(FIX_SYM_FUNCTION_TYPE), 0x14, UNKNOWN_PP)); + // xor eax, eax + mem.c()[0] = 0x31; + mem.c()[1] = 0xc0; + // ret + mem.c()[2] = 0xc3; + // CacheFlush(mem, 8); + return mem.cast(); +} + +/*! + * Given a C function and a name, create a GOAL function and store it in the symbol with the given + * name. This effectively creates a global GOAL function with the given name which calls the given C + * function. + * + * This work on both Linux and Windows, but only supports up to 6 arguments. + */ +Ptr make_function_symbol_from_c(const char* name, void* f) { + auto sym = intern_from_c(name); + auto func = make_function_from_c(f); + sym->value() = func.offset; + return func; +} + +/*! + * Like make_function_symbol_from_c, but all 8 GOAL arguments are put into an array on the stack. + * The address of this array is passed as the first and only argument to f. + */ +Ptr make_stack_arg_function_symbol_from_c(const char* name, void* f) { + auto sym = intern_from_c(name); + auto func = make_stack_arg_function_from_c(f); + sym->value() = func.offset; + return func; +} + +/*! + * Set the named symbol to the value. This isn't specific to functions. + */ +u32 make_raw_function_symbol_from_c(const char* name, u32 value) { + intern_from_c(name)->value() = value; + return value; +} + +/*! + * Configure a "fixed" symbol to have a given name and value. The "fixed" symbols are symbols + * which have their location in the symbol table determined ahead of time and not looked up by the + * hash function. + */ +Ptr> set_fixed_symbol(u32 offset, const char* name, u32 value) { + // grab the symbol directly + Ptr> sym(s7.offset + offset); + ASSERT((sym.offset & 3) == 1); // + sym->value() = value; + + // set name of the symbol + *sym_to_string_ptr(sym).c() = Ptr(make_string_from_c(name)); + + // set hash of the symbol + *sym_to_hash(sym).c() = crc32((const u8*)name, strlen(name)); + + NumSymbols++; + return sym; +} + +/*! + * Search the hash table's fixed area for a symbol. + * Returns null if we didn't find it. + */ +Ptr> find_symbol_in_fixed_area(u32 hash, const char* name) { + for (u32 i = s7.offset; i < s7.offset + FIX_FIXED_SYM_END_OFFSET; i += 4) { + auto sym = Ptr>(i); + if (*sym_to_hash(sym) == hash) { + if (!strcmp(sym_to_string(sym)->data(), name)) { + return sym; + } + } + } + return Ptr>(0); +} + +/*! + * Do a linear probe from start to end to find a symbol (or a slot for a new symbol). + * If we run into the end without finding anything, returns 1 to indicate the linear probe needs to + * wrap around. If we run into a blank space, mark that as the slot. Also search the fixed area for + * the symbol. If we fail to find it without wrapping, and it's not in the fixed area, return 0. + */ +Ptr> find_symbol_in_area(u32 hash, const char* name, u32 start, u32 end) { + for (u32 i = start; i < end; i += 4) { + auto sym = Ptr>(i); + + // note - this may break if any symbols hash to zero! + if (*sym_to_hash(sym) == hash) { + if (!strcmp(sym_to_string(sym)->data(), name)) { + return sym; + } + } + + if (!(*sym_to_hash(sym))) { + // open slot! + // means we don't need to wrap. + symbol_slot = i; + + // check the fixed area, in case it's not dynamically placed. + return find_symbol_in_fixed_area(hash, name); + } + } + + // we got to the end without finding the symbol or an empty slot. Return 1 to indicate this. + return Ptr>(1); +} + +/*! + * Searches the table for a symbol. If the symbol is found, returns it. + * If not, returns 0, but symbol_slot will contain the slot for the symbol. + * If both are 0, the symbol table is full and you are sad. + * Also allows you to find the empty pair by searching for _empty_ + */ +Ptr> find_symbol_from_c(const char* name) { + symbol_slot = 0; // nowhere to put the symbol yet, clear any old symbol_slot result. + u32 hash = crc32((const u8*)name, (int)strlen(name)); + + // check if we've got the empty pair. + if (hash == EMPTY_HASH) { + if (!strcmp(name, "_empty_")) { + return (s7 + FIX_SYM_EMPTY_PAIR).cast>(); + } + } + + s32 sh1 = hash << 0x13; + s32 sh2 = sh1 >> 0x10; + // will be signed, bottom 3 bits 0 (for alignment, symbols are every 8 bytes) + // upper 16 bits are the same, so we will reach +/- 8 kb around 0. + + if (sh2 > 0) { + // upper table first. + auto probe = find_symbol_in_area(hash, name, s7.offset + sh2, LastSymbol.offset); + if (probe.offset != 1) { + return probe; + } + + // overflow! + probe = find_symbol_in_area(hash, name, SymbolTable2.offset, s7.offset - 0x10); + if (probe.offset == 1) { + // uh oh, both overflowed! + printf("[BIG WARNING] symbol table probe double overflow!\n"); + return find_symbol_in_fixed_area(hash, name); + } else { + return probe; + } + + } else { + // lower table first + auto probe = find_symbol_in_area(hash, name, s7.offset + sh2, s7.offset - 0x10); + if (probe.offset != 1) { + return probe; + } + + // overflow! + probe = + find_symbol_in_area(hash, name, s7.offset + FIX_FIXED_SYM_END_OFFSET, LastSymbol.offset); + if (probe.offset == 1) { + printf("[BIG WARNING] symbol table probe double overflow!\n"); + return find_symbol_in_fixed_area(hash, name); + } else { + return probe; + } + } +} + +/*! + * Returns a symbol with the given name. If this is the first time, make a new symbol, otherwise it + * returns the old one. Basically a LISP symbol intern + */ +Ptr> intern_from_c(const char* name) { + auto symbol = find_symbol_from_c(name); + if (symbol.offset) { + // already exists, return it! + return symbol; + } + + // otherwise, a new symbol! + symbol = Ptr>(symbol_slot); + + u32 hash = crc32((const u8*)name, (int)strlen(name)); + auto str = make_string_from_c(name); + *sym_to_string_ptr(symbol) = Ptr(str); + *sym_to_hash(symbol) = hash; + + NumSymbols++; + return symbol; +} + +/*! + * GOAL intern function. + */ +u64 intern(u32 name) { + return intern_from_c(Ptr(name)->data()).offset; +} + +namespace { +u32 size_of_type(u32 method_count) { + return (4 * method_count + 0x23) & 0xfffffff0; +} +} // namespace + +/*! + * Given a symbol for the type name, allocate memory for a type and add it to the symbol table. + * New: in Jak 2, there's a level type list + */ +Ptr alloc_and_init_type(Ptr>> sym, + u32 method_count, + bool force_global_type) { + // number of bytes for this type + u32 type_size = size_of_type(method_count); + u32 type_mem = 0; + ASSERT(sym.offset & 1); + + if (!force_global_type && + u32_in_fixed_sym(FIX_SYM_LOADING_LEVEL) != u32_in_fixed_sym(FIX_SYM_GLOBAL_HEAP)) { + printf("using level types!\n"); // added + u32 type_list_ptr = LevelTypeList->value(); + if (type_list_ptr == 0) { + // we don't have a type-list... just alloc on global + MsgErr("dkernel: trying to init loading level type \'%s\' while type-list is undefined\n", + sym_to_string(sym)->data()); + type_mem = alloc_heap_object(s7.offset + FIX_SYM_GLOBAL_HEAP, + u32_in_fixed_sym(FIX_SYM_TYPE_TYPE), type_size, UNKNOWN_PP); + } else { + // we do have a type list! allocate on the level heap + type_mem = alloc_heap_object(s7.offset + FIX_SYM_LOADING_LEVEL, + u32_in_fixed_sym(FIX_SYM_TYPE_TYPE), type_size, UNKNOWN_PP); + // link us! + u32 old_head = *Ptr(type_list_ptr); + *Ptr(type_list_ptr) = type_mem; + // I guess we hide this in the memusage method. + Ptr(type_mem)->memusage_method.offset = old_head; + } + } else { + // normal global type + type_mem = alloc_heap_object(s7.offset + FIX_SYM_GLOBAL_HEAP, + u32_in_fixed_sym(FIX_SYM_TYPE_TYPE), type_size, UNKNOWN_PP); + } + + Ptr the_type(type_mem); + sym->value() = the_type; + the_type->allocated_size = type_size; + the_type->padded_size = ((type_size + 0xf) & 0xfff0); + return the_type; +} + +/*! + * Like intern, but returns a type instead of a symbol. If the type doesn't exist, a new one is + * allocated. + */ +Ptr intern_type_from_c(const char* name, u64 methods) { + // there's a weird flag system used here. + // if methods is a number that's not 0 or 1, its used as the desired number of methods. + // If method is 0, and a new type needs to be created, it uses 12 methods + // If method is 1, and a new type needs to be created, it uses 44 methods + // If method is 0 or 1 and no new type needs to be created, there is no error. + // Requesting a type to have fewer methods than the existing type has is ok. + // Requesting a type to have more methods than the existing type is not ok and prints an error. + + auto symbol = intern_from_c(name); + u32 sym_value = symbol->value(); + + if (!sym_value) { + // new type + int n_methods = methods; + + if (methods == 0) { + // some stupid types like user-defined children of integers have "0" as the method count + n_methods = 0xc; + } else if (methods == 1) { + // whatever builds the v2/v4 object files (level data) doesn't actually know method counts. + // so it just puts a 1. In this case, we should put lots of methods, just in case. + // I guess 44 was the number they picked. + n_methods = 0x2c; + } + + // create the type. + auto casted_sym = symbol.cast>>(); + auto type = alloc_and_init_type(casted_sym, n_methods, 0); // allow level types + type->symbol = casted_sym; + type->num_methods = n_methods; + return type; + } else { + // the type exists. + auto type = Ptr(sym_value); + // note - flags of 0 or 1 will pass through here without triggering the error. + if (size_of_type(type->num_methods) < size_of_type(methods)) { + MsgErr( + "dkernel: trying to redefine a type '%s' with %d methods when it had %d, try " + "restarting\n", + name, (u32)methods, type->num_methods); + ASSERT(false); + } + return type; + } +} + +/*! + * Wrapper of intern_type_from_c to use with GOAL. It accepts a gstring as a name. + */ +u64 intern_type(u32 name, u64 methods) { + return intern_type_from_c(Ptr(name)->data(), methods).offset; +} + +/*! + * Configure a type. + */ +Ptr set_type_values(Ptr type, Ptr parent, u64 flags) { + type->parent = parent; + type->allocated_size = (flags & 0xffff); + type->heap_base = (flags >> 16) & 0xffff; + type->padded_size = ((type->allocated_size + 0xf) & 0xfff0); + + u16 new_methods = (flags >> 32) & 0xffff; // i think this accidentally uses jak1 style flags. + if (type->num_methods < new_methods) { + type->num_methods = new_methods; + } + + return type; +} + +/*! + * Setup a type which is located in a fixed spot of the symbol table. + */ +Ptr set_fixed_type(u32 offset, + const char* name, + Ptr>> parent_symbol, + u64 flags, + u32 print, + u32 inspect) { + Ptr>> type_symbol(s7.offset + offset); + Ptr symbol_value = type_symbol->value(); + + // set the symbol's name and hash + *sym_to_string_ptr(type_symbol) = Ptr(make_string_from_c(name)); + *sym_to_hash(type_symbol) = crc32((const u8*)name, strlen(name)); + NumSymbols++; + + if (symbol_value.offset == 0) { + // no type memory exists, let's allocate it. force it global + // the flag logic here multiplies the method count 2, hopefully + // this will set up the symbol + symbol_value = alloc_and_init_type(type_symbol, (flags >> 0x1f) & 0xffff, 1); + } + + // remember our symbol + symbol_value->symbol = type_symbol; + // make our type a type (we're a basic) + u32 type_of_type = u32_in_fixed_sym(FIX_SYM_TYPE_TYPE); + *Ptr(symbol_value.offset - 4) = type_of_type; + + Ptr parent_type = parent_symbol->value(); + set_type_values(symbol_value, parent_type, flags); + + symbol_value->new_method = parent_type->new_method; + symbol_value->delete_method = parent_type->delete_method; + + if (!print) { + symbol_value->print_method = parent_type->print_method; + } else { + symbol_value->print_method.offset = print; + } + + if (!inspect) { + symbol_value->inspect_method = parent_type->inspect_method; + } else { + symbol_value->inspect_method.offset = inspect; + } + + symbol_value->length_method.offset = u32_in_fixed_sym(FIX_SYM_ZERO_FUNC); + symbol_value->asize_of_method = parent_type->asize_of_method; + symbol_value->copy_method = parent_type->copy_method; + return symbol_value; +} + +/*! + * New method of type. A GOAL (deftype) will end up calling this method. + * Internally does an intern. + */ +u64 new_type(u32 symbol, u32 parent, u64 flags) { + ASSERT(false); // nyi + return 0; +} + +/*! + * Is t1 a t2? + */ +u64 type_typep(Ptr t1, Ptr t2) { + if (t1 == t2) { + return (s7 + FIX_SYM_TRUE).offset; + } + + do { + t1 = t1->parent; + if (t1 == t2) { + return (s7 + FIX_SYM_TRUE).offset; + } + } while (t1.offset && t1.offset != u32_in_fixed_sym(FIX_SYM_OBJECT_TYPE)); + return s7.offset; +} + +u64 method_set(u32 type_, u32 method_id, u32 method) { + ASSERT(false); // nyi + return 0; +} + +/*! + * Call a GOAL method of a given type. + */ +u64 call_method_of_type(u32 arg, Ptr type, u32 method_id) { + if (((type.offset < SymbolTable2.offset || 0x7ffffff < type.offset) && // not in normal memory + (type.offset < 0x84000 || 0x100000 <= type.offset)) // not in kernel memory + || ((type.offset & OFFSET_MASK) != BASIC_OFFSET)) { // invalid type + cprintf("#<#%x has invalid type ptr #x%x>\n", arg, type.offset); + } else { + auto type_tag = Ptr>(type.offset - 4); + if ((*type_tag).offset == u32_in_fixed_sym(FIX_SYM_TYPE_TYPE)) { + auto f = type->get_method(method_id); + return call_goal(f, arg, 0, 0, s7.offset, g_ee_main_mem); + } else { + cprintf("#<#x%x has invalid type ptr #x%x, bad type #x%x>\n", arg, type.offset, + (*type_tag).offset); + } + } + printf("[ERROR] call_method_of_type failed!\n"); + return arg; +} + +/*! + * Call a GOAL function with 2 arguments. + */ +u64 call_goal_function_arg2(Ptr func, u64 a, u64 b) { + return call_goal(func, a, b, 0, s7.offset, g_ee_main_mem); +} + +/*! + * Call a global GOAL function by name. + */ +u64 call_goal_function_by_name(const char* name) { + return call_goal_function(Ptr(intern_from_c(name)->value())); +} + +/*! + * Like call_method_of_type, but has two arguments. Used to "relocate" v2/s4 loads. + */ +u64 call_method_of_type_arg2(u32 arg, Ptr type, u32 method_id, u32 a1, u32 a2) { + if (((type.offset < SymbolTable2.offset || 0x7ffffff < type.offset) && // not in normal memory + (type.offset < 0x84000 || 0x100000 <= type.offset)) // not in kernel memory + || ((type.offset & OFFSET_MASK) != BASIC_OFFSET)) { // invalid type + cprintf("#<#%x has invalid type ptr #x%x>\n", arg, type.offset); + } else { + auto type_tag = Ptr>(type.offset - 4); + if ((*type_tag).offset == u32_in_fixed_sym(FIX_SYM_TYPE_TYPE)) { + // return type->get_method(method_id).cast().c()(arg,a1,a2); + return call_goal(type->get_method(method_id), arg, a1, a2, s7.offset, g_ee_main_mem); + } else { + cprintf("#<#x%x has invalid type ptr #x%x, bad type #x%x>\n", arg, type.offset, + (*type_tag).offset); + } + } + ASSERT_MSG(false, "[ERROR] call_method_of_type_arg2 failed!"); + return arg; +} + +u64 print_object(u32 obj); +u64 print_pair(u32 obj); +u64 print_symbol(u32 obj); + +/*! + * Print an object with a newline after it to the GOAL PrintBuffer (not stdout) + */ +u64 sprint(u32 obj) { + auto rv = print_object(obj); + cprintf("\n"); + return rv; +} + +/*! + * Most generic printing method. + * Does not correctly handle 64 bit boxed integers or object64's correctly. + * It is important that no objects of type object actually exist or this will loop! + */ +u64 print_object(u32 obj) { + if ((obj & OFFSET_MASK) == BINTEGER_OFFSET) { + return print_binteger(s64(s32(obj))); + } else { + if ((obj < SymbolTable2.offset || 0x7ffffff < obj) && // not in normal memory + (obj < 0x84000 || 0x100000 <= obj)) { // not in kernel memory + cprintf("#", obj); + } else if ((obj & OFFSET_MASK) == PAIR_OFFSET) { + return print_pair(obj); + } else if ((obj & 1) == PAIR_OFFSET && obj >= SymbolTable2.offset && obj < LastSymbol.offset) { + return print_symbol(obj); + } else if ((obj & OFFSET_MASK) == BASIC_OFFSET) { + return call_method_of_type(obj, Ptr(*Ptr(obj - 4)), GOAL_PRINT_METHOD); + } else { + cprintf("#", obj & OFFSET_MASK, obj); + } + } + return obj; +} + +/*! + * Default print method a basic. + * Confirms basic is valid and prints the type name. + */ +u64 print_basic(u32 obj) { + if (((obj < SymbolTable2.offset || 0x7ffffff < obj) && // not in normal memory + (obj < 0x84000 || 0x100000 <= obj)) // not in kernel memory + || ((obj & OFFSET_MASK) != BASIC_OFFSET)) { + cprintf("#", obj); + } else { + cprintf("#<%s @ #x%x>", sym_to_string(Ptr(*Ptr(obj - 4))->symbol)->data(), obj); + } + return obj; +} + +/*! + * Print a pair as a LISP list. Don't try to print circular lists or it will get stuck + * Can print improper lists + */ +u64 print_pair(u32 obj) { + if (obj == s7.offset + FIX_SYM_EMPTY_PAIR) { + cprintf("()"); + } else { + // clang-format off + // we want to treat ('quote ) as just ' unless + if (CollapseQuote->value() == s7.offset // CollapseQuote is enabled + || ((obj & 7) != 2) // this object isn't a pair + || *Ptr(obj - 2) != s7.offset + FIX_SYM_QUOTE // the car isn't 'quote + || (*Ptr(obj + 2) & 7) != 2 // the cdr isn't a pair + || *Ptr(*Ptr(obj + 2) + 2) != s7.offset + FIX_SYM_EMPTY_PAIR // the cddr isn't '() + ) { + // clang-format on + cprintf("("); + auto toPrint = obj; + for (;;) { + if ((toPrint & OFFSET_MASK) == PAIR_OFFSET) { + // print CAR + print_object(*Ptr(toPrint - 2)); + + // load up CDR + auto cdr = *Ptr(toPrint + 2); + toPrint = cdr; + if (cdr == s7.offset + FIX_SYM_EMPTY_PAIR) { // end of proper list + cprintf(")"); + return obj; + } else { // continue list + cprintf(" "); + } + } else { // improper list + cprintf(". "); + print_object(toPrint); + cprintf(")"); + return obj; + } + } + } else { + cprintf("'"); + print_object(*Ptr(*Ptr(obj + 2) - 2)); + } + } + return obj; +} + +/*! + * Print method for symbol. Just prints the name without quotes or anything fancy. + */ +u64 print_symbol(u32 obj) { + if (((obj < SymbolTable2.offset || 0x7ffffff < obj) && // not in normal memory + (obj < 0x84000 || 0x100000 <= obj)) // not in kernel memory + || ((obj & 1) != 1) || obj < SymbolTable2.offset || obj >= LastSymbol.offset) { + cprintf("#", obj); + } else { + char* str = sym_to_string(Ptr>(obj))->data(); + cprintf("%s", str); + } + return obj; +} + +/*! + * Print method for type. Just prints the name without quotes + */ +u64 print_type(u32 obj) { + if (((obj < SymbolTable2.offset || 0x7ffffff < obj) && // not in normal memory + (obj < 0x84000 || 0x100000 <= obj)) // not in kernel memory + || ((obj & OFFSET_MASK) != BASIC_OFFSET) || + *Ptr(obj - 4) != u32_in_fixed_sym(FIX_SYM_TYPE_TYPE)) { + cprintf("#", obj); + } else { + cprintf("%s", sym_to_string(Ptr(obj)->symbol)->data()); + } + return obj; +} + +/*! + * Print method for string. Prints the string in quotes. + */ +u64 print_string(u32 obj) { + if (((obj < SymbolTable2.offset || 0x7ffffff < obj) && // not in normal memory + (obj < 0x84000 || 0x100000 <= obj)) // not in kernel memory + || ((obj & OFFSET_MASK) != BASIC_OFFSET) || + *Ptr(obj - 4) != u32_in_fixed_sym(FIX_SYM_STRING_TYPE)) { + if (obj == s7.offset) { + cprintf("#f"); // new in jak 2. + + } else { + cprintf("#", obj); + } + } else { + cprintf("\"%s\"", Ptr(obj)->data()); + } + return obj; +} + +/*! + * Print method for function. Just prints the address because functions can't identify themselves. + */ +u64 print_function(u32 obj) { + cprintf("#", sym_to_string(Ptr(*Ptr(obj - 4))->symbol)->data(), + obj); + return obj; +} + +/*! + * Get the allocated size field of a basic. By default we grab this from the type struct. + * Dynamically sized basics should override this method. + */ +u64 asize_of_basic(u32 it) { + return Ptr(*Ptr(it - BASIC_OFFSET))->allocated_size; +} + +/*! + * Create a copy of a basic. If the destination isn't identified as a symbol, treat it as an + * address. This seems a little bit unsafe to me, as it reads the 4-bytes before the given address + * and checks it against the symbol type pointer to see if its a symbol. It seems possible to have a + * false positive for this check. + */ +u64 copy_basic(u32 obj, u32 heap, u32 /*unused*/, u32 pp) { + // determine size of basic. We call a method instead of using asize_of_basic in case the type has + // overridden the default asize_of method. + u32 size = call_method_of_type(obj, Ptr(*Ptr(obj - BASIC_OFFSET)), GOAL_ASIZE_METHOD); + u32 result; + + if ((heap & 1) == 1) { + // we think we're creating a new copy on a heap. First allocate memory... + result = alloc_heap_object(heap, *Ptr(obj - BASIC_OFFSET), size, pp); + // then copy! (minus the type tag, alloc_heap_object already did it for us) + memcpy(Ptr(result).c(), Ptr(obj).c(), size - BASIC_OFFSET); + } else { + printf("DANGER COPY BASIC!\n"); + // copy directly (including type tag) + memcpy(Ptr(heap - BASIC_OFFSET).c(), Ptr(obj - BASIC_OFFSET).c(), size); + result = heap; + } + return result; +} + +u64 inspect_pair(u32 obj); +u64 inspect_symbol(u32 obj); +/*! + * Highest level inspect method. Won't inspect 64-bit bintegers correctly. + */ +u64 inspect_object(u32 obj) { + if ((obj & OFFSET_MASK) == BINTEGER_OFFSET) { + return inspect_binteger(obj); + } else { + if ((obj < SymbolTable2.offset || 0x7ffffff < obj) && // not in normal memory + (obj < 0x84000 || 0x100000 <= obj)) { // not in kernel memory + cprintf("#", obj); + } else if ((obj & OFFSET_MASK) == PAIR_OFFSET) { + return inspect_pair(obj); + } else if ((obj & 1) == PAIR_OFFSET && obj >= SymbolTable2.offset && obj < LastSymbol.offset) { + return inspect_symbol(obj); + } else if ((obj & OFFSET_MASK) == BASIC_OFFSET) { + return call_method_of_type(obj, Ptr(*Ptr(obj - BASIC_OFFSET)), + GOAL_INSPECT_METHOD); + } else { + cprintf("#", obj & OFFSET_MASK, obj); + } + } + return obj; +} + +/*! + * Inspect a pair. + */ +u64 inspect_pair(u32 obj) { + cprintf("[%8x] pair ", obj); + print_pair(obj); + cprintf("\n"); + return obj; +} + +/*! + * Inspect a string. There's a typo in allocated_length (has underscore instead of dash). + * This typo is fixed in later games. + */ +u64 inspect_string(u32 obj) { + if (((obj < SymbolTable2.offset || 0x7ffffff < obj) && // not in normal memory + (obj < 0x84000 || 0x100000 <= obj)) // not in kernel memory + || ((obj & OFFSET_MASK) != BASIC_OFFSET) || + *Ptr(obj - 4) != u32_in_fixed_sym(FIX_SYM_STRING_TYPE)) { + cprintf("#\n", obj); + } else { + auto str = Ptr(obj); + cprintf("[%8x] string\n\tallocated_length: %d\n\tdata: \"%s\"\n", obj, str->len, str->data()); + } + return obj; +} + +/*! + * Inspect a symbol. + */ +u64 inspect_symbol(u32 obj) { + if (((obj < SymbolTable2.offset || 0x7ffffff < obj) && // not in normal memory + (obj < 0x84000 || 0x100000 <= obj)) // not in kernel memory + || ((obj & 1) != 1) || obj < SymbolTable2.offset || obj >= LastSymbol.offset) { + cprintf("#", obj); + } else { + auto sym = Ptr>(obj); + cprintf("[%8x] symbol\n\tname: %s\n\thash: #x%x\n\tvalue: ", obj, sym_to_string(sym)->data(), + *sym_to_hash(sym)); + print_object(sym->value()); + cprintf("\n"); + } + return obj; +} + +/*! + * Inspect a type. + */ +u64 inspect_type(u32 obj) { + if (((obj < SymbolTable2.offset || 0x7ffffff < obj) && // not in normal memory + (obj < 0x84000 || 0x100000 <= obj)) // not in kernel memory + || ((obj & OFFSET_MASK) != BASIC_OFFSET) || + *Ptr(obj - 4) != u32_in_fixed_sym(FIX_SYM_TYPE_TYPE)) { + cprintf("#\n", obj); + } else { + auto typ = Ptr(obj); + auto sym = typ->symbol; + ; + + cprintf("[%8x] type\n\tname: %s\n\tparent: ", obj, sym_to_string(sym)->data()); + print_object(typ->parent.offset); + cprintf("\n\tsize: %d/%d\n\theap-base: %d\n\tallocated-length: %d\n\tprint: ", + typ->allocated_size, typ->padded_size, typ->heap_base, typ->num_methods); + print_object(typ->print_method.offset); + cprintf("\n\tinspect: "); + print_object(typ->inspect_method.offset); + cprintf("\n"); + } + return obj; +} + +/*! + * Inspect a basic. This is just a fallback for basics which don't know how to inspect themselves. + * We just use print_object. + */ +u64 inspect_basic(u32 obj) { + if (((obj < SymbolTable2.offset || 0x7ffffff < obj) && // not in normal memory + (obj < 0x84000 || 0x100000 <= obj)) // not in kernel memory + || ((obj & OFFSET_MASK) != BASIC_OFFSET)) { + if (obj == s7.offset) { + // added in jak2 + return inspect_symbol(obj); + } else { + cprintf("#\n", obj); + } + } else { + cprintf("[%8x] ", obj); + print_object(*Ptr(obj - 4)); + cprintf("\n"); + } + return obj; +} + +/*! + * Inspect a link block. This link block doesn't seem to be used at all. + */ +u64 inspect_link_block(u32 ob) { + struct LinkBlock { + u32 length; + u32 version; + }; + + auto lb = Ptr(ob); + cprintf("[%8x] link-block\n\tallocated_length: %d\n\tversion: %d\n\tfunction: ", ob, lb->length, + lb->version); + print_object(ob + lb->length); + cprintf("\n"); + return ob; +} + +Ptr>> get_fixed_type_symbol(u32 offset) { + return (s7 + offset).cast>>(); +} + +namespace { +u64 pack_type_flag(u64 methods, u64 heap_base, u64 size) { + return (methods << 32) + (heap_base << 16) + (size); +} +} // namespace + +int InitHeapAndSymbol() { + // allocate memory for all 3 tables + Ptr symbol_table = + kmalloc(kglobalheap, jak2::SYM_TABLE_MEM_SIZE, KMALLOC_MEMSET, "symbol-table").cast(); + // setup table pointers + LastSymbol = symbol_table + 0xff00; + SymbolTable2 = symbol_table + 5; + s7 = symbol_table + 0x8001; + NumSymbols = 0; + printf("st alloced\n"); + + // inform compiler of s7 + reset_output(); + printf("reset output\n"); + + // empty pair (this is extra confusing). + *Ptr(s7.offset + FIX_SYM_EMPTY_CAR - 1) = s7.offset + FIX_SYM_EMPTY_PAIR - 1; + *Ptr(s7.offset + FIX_SYM_EMPTY_CDR - 1) = s7.offset + FIX_SYM_EMPTY_PAIR - 1; + printf("setup pair\n"); + + // 'global + fixed_sym_set(FIX_SYM_GLOBAL_HEAP, kglobalheap.offset); + + // basic types required to actually set up symbols + alloc_and_init_type((s7 + FIX_SYM_TYPE_TYPE).cast>>(), 9, true); + alloc_and_init_type((s7 + FIX_SYM_SYMBOL_TYPE).cast>>(), 9, true); + alloc_and_init_type((s7 + FIX_SYM_STRING_TYPE).cast>>(), 9, true); + alloc_and_init_type((s7 + FIX_SYM_FUNCTION_TYPE).cast>>(), 9, true); + + // set up symbols! + set_fixed_symbol(FIX_SYM_FALSE, "#f", s7.offset + FIX_SYM_FALSE); + set_fixed_symbol(FIX_SYM_TRUE, "#t", s7.offset + FIX_SYM_TRUE); + set_fixed_symbol(FIX_SYM_NOTHING_FUNC, "nothing", make_nothing_func().offset); + set_fixed_symbol(FIX_SYM_ZERO_FUNC, "zero-func", make_zero_func().offset); + set_fixed_symbol(FIX_SYM_ASIZE_OF_BASIC_FUNC, "asize-of-basic-func", + make_function_from_c((void*)asize_of_basic).offset); + set_fixed_symbol(FIX_SYM_COPY_BASIC_FUNC, "asize-of-basic-func", + make_function_from_c((void*)copy_basic).offset); + set_fixed_symbol(FIX_SYM_DELETE_BASIC, "delete-basic", + make_function_from_c((void*)delete_basic).offset); + set_fixed_symbol(FIX_SYM_GLOBAL_HEAP, "global", kglobalheap.offset); + set_fixed_symbol(FIX_SYM_DEBUG, "debug", kdebugheap.offset); + set_fixed_symbol(FIX_SYM_STATIC, "static", s7.offset + FIX_SYM_STATIC); + set_fixed_symbol(FIX_SYM_LOADING_LEVEL, "loading-level", kglobalheap.offset); + set_fixed_symbol(FIX_SYM_LOADING_PACKAGE, "loading-package", kglobalheap.offset); + set_fixed_symbol(FIX_SYM_PROCESS_LEVEL_HEAP, "process-level-heap", kglobalheap.offset); + set_fixed_symbol(FIX_SYM_STACK, "stack", s7.offset + FIX_SYM_STACK); + set_fixed_symbol(FIX_SYM_SCRATCH, "scratch", s7.offset + FIX_SYM_SCRATCH); + set_fixed_symbol(FIX_SYM_SCRATCH_TOP, "*scratch-top*", 0x70000000); + set_fixed_symbol(FIX_SYM_LEVEL, "level", 0); + set_fixed_symbol(FIX_SYM_ART_GROUP, "art-group", 0); + set_fixed_symbol(FIX_SYM_TEXTURE_PAGE_DIR, "texture-page-dir", 0); + set_fixed_symbol(FIX_SYM_TEXTURE_PAGE, "texture-page", 0); + set_fixed_symbol(FIX_SYM_SOUND, "sound", 0); + set_fixed_symbol(FIX_SYM_DGO, "dgo", 0); + set_fixed_symbol(FIX_SYM_TOP_LEVEL, "top-level", u32_in_fixed_sym(FIX_SYM_NOTHING_FUNC)); + set_fixed_symbol(FIX_SYM_QUOTE, "quote", s7.offset + FIX_SYM_QUOTE); + + // set up types + auto new_illegal_func = make_function_from_c((void*)new_illegal); + auto delete_illegal_func = make_function_from_c((void*)delete_illegal); + auto print_object_func = make_function_from_c((void*)print_object); + auto inspect_object_func = make_function_from_c((void*)inspect_object); + + // OBJECT + set_fixed_type(FIX_SYM_OBJECT_TYPE, "object", get_fixed_type_symbol(FIX_SYM_OBJECT_TYPE), + pack_type_flag(9, 0, 4), print_object_func.offset, inspect_object_func.offset); + auto object_type = Ptr(u32_in_fixed_sym(FIX_SYM_OBJECT_TYPE)); + object_type->new_method = Ptr(u32_in_fixed_sym(FIX_SYM_NOTHING_FUNC)); // new for jak 2 + object_type->delete_method = delete_illegal_func; + object_type->asize_of_method = Ptr(u32_in_fixed_sym(FIX_SYM_NOTHING_FUNC)); + object_type->copy_method = make_function_from_c((void*)copy_fixed); + + // STRUCTURE + auto structure_type = + set_fixed_type(FIX_SYM_STRUCTURE, "structure", get_fixed_type_symbol(FIX_SYM_OBJECT_TYPE), + pack_type_flag(9, 0, 4), make_function_from_c((void*)print_structure).offset, + make_function_from_c((void*)inspect_structure).offset); + structure_type->new_method = make_function_from_c((void*)new_structure); + structure_type->delete_method = make_function_from_c((void*)delete_structure); + + // BASIC + auto basic_type = + set_fixed_type(FIX_SYM_BASIC, "basic", get_fixed_type_symbol(FIX_SYM_STRUCTURE), + pack_type_flag(9, 0, 4), make_function_from_c((void*)print_basic).offset, + make_function_from_c((void*)inspect_basic).offset); + basic_type->new_method = make_function_from_c((void*)new_basic); + basic_type->delete_method = Ptr(u32_in_fixed_sym(FIX_SYM_DELETE_BASIC)); + basic_type->asize_of_method = Ptr(u32_in_fixed_sym(FIX_SYM_ASIZE_OF_BASIC_FUNC)); + basic_type->copy_method = Ptr(u32_in_fixed_sym(FIX_SYM_COPY_BASIC_FUNC)); + + // SYMBOL + set_fixed_type(FIX_SYM_SYMBOL_TYPE, "symbol", get_fixed_type_symbol(FIX_SYM_OBJECT_TYPE), + pack_type_flag(9, 0, 4), make_function_from_c((void*)print_symbol).offset, + make_function_from_c((void*)inspect_symbol).offset); + auto sym_type = Ptr(u32_in_fixed_sym(FIX_SYM_SYMBOL_TYPE)); + sym_type->new_method = new_illegal_func; + sym_type->delete_method = delete_illegal_func; + + // TYPE + set_fixed_type(FIX_SYM_TYPE_TYPE, "type", get_fixed_type_symbol(FIX_SYM_BASIC), + pack_type_flag(9, 0, 0x38), make_function_from_c((void*)print_type).offset, + make_function_from_c((void*)inspect_type).offset); + auto type_type = Ptr(u32_in_fixed_sym(FIX_SYM_TYPE_TYPE)); + type_type->new_method = make_function_from_c((void*)new_type); + type_type->delete_method = delete_illegal_func; + + // STRING + set_fixed_type(FIX_SYM_STRING_TYPE, "string", get_fixed_type_symbol(FIX_SYM_BASIC), + pack_type_flag(9, 0, 8), make_function_from_c((void*)print_string).offset, + make_function_from_c((void*)inspect_string).offset); + + // FUNCTION + set_fixed_type(FIX_SYM_FUNCTION_TYPE, "function", get_fixed_type_symbol(FIX_SYM_BASIC), + pack_type_flag(9, 0, 4), make_function_from_c((void*)print_function).offset, 0); + auto function_type = Ptr(u32_in_fixed_sym(FIX_SYM_FUNCTION_TYPE)); + function_type->new_method = new_illegal_func; + function_type->delete_method = delete_illegal_func; + + // VU FUNCTION + set_fixed_type(FIX_SYM_VU_FUNCTION, "vu-function", get_fixed_type_symbol(FIX_SYM_STRUCTURE), + pack_type_flag(9, 0, 0x16), make_function_from_c((void*)print_vu_function).offset, + make_function_from_c((void*)inspect_vu_function).offset); + Ptr(u32_in_fixed_sym(FIX_SYM_VU_FUNCTION))->delete_method = delete_illegal_func; + + // LINK BLOCK + set_fixed_type(FIX_SYM_LINK_BLOCK, "link-block", get_fixed_type_symbol(FIX_SYM_BASIC), + pack_type_flag(9, 0, 0xc), 0, + make_function_from_c((void*)inspect_link_block).offset); + auto link_block_type = Ptr(u32_in_fixed_sym(FIX_SYM_LINK_BLOCK)); + link_block_type->new_method = new_illegal_func; + link_block_type->delete_method = delete_illegal_func; + + // KHEAP + set_fixed_type(FIX_SYM_HEAP, "kheap", get_fixed_type_symbol(FIX_SYM_STRUCTURE), + pack_type_flag(9, 0, 0x10), 0, make_function_from_c((void*)inspect_kheap).offset); + + // ARRAY + set_fixed_type(FIX_SYM_ARRAY, "array", get_fixed_type_symbol(FIX_SYM_BASIC), + pack_type_flag(9, 0, 0x10), 0, 0); + + // PAIR + set_fixed_type(FIX_SYM_PAIR_TYPE, "pair", get_fixed_type_symbol(FIX_SYM_OBJECT_TYPE), + pack_type_flag(9, 0, 8), make_function_from_c((void*)print_pair).offset, + make_function_from_c((void*)inspect_pair).offset); + Ptr(u32_in_fixed_sym(FIX_SYM_PAIR_TYPE))->new_method = + make_function_from_c((void*)new_pair); + Ptr(u32_in_fixed_sym(FIX_SYM_PAIR_TYPE))->delete_method = + make_function_from_c((void*)delete_pair); + + // KERNEL + set_fixed_type(FIX_SYM_PROCESS_TREE, "process-tree", get_fixed_type_symbol(FIX_SYM_BASIC), + pack_type_flag(0xe, 0, 0x24), 0, 0); + set_fixed_type(FIX_SYM_PROCESS_TYPE, "process", get_fixed_type_symbol(FIX_SYM_PROCESS_TREE), + pack_type_flag(0xe, 0, 0x80), 0, 0); + set_fixed_type(FIX_SYM_THREAD, "thread", get_fixed_type_symbol(FIX_SYM_BASIC), + pack_type_flag(0xc, 0, 0x28), 0, 0); + set_fixed_type(FIX_SYM_CONNECTABLE, "connectable", get_fixed_type_symbol(FIX_SYM_STRUCTURE), + pack_type_flag(9, 0, 0x10), 0, 0); + set_fixed_type(FIX_SYM_STACK_FRAME, "stack-frame", get_fixed_type_symbol(FIX_SYM_BASIC), + pack_type_flag(9, 0, 0xc), 0, 0); + set_fixed_type(FIX_SYM_FILE_STREAM, "file-stream", get_fixed_type_symbol(FIX_SYM_BASIC), + pack_type_flag(9, 0, 0x14), 0, 0); + + // POINTER + set_fixed_type(FIX_SYM_POINTER, "pointer", get_fixed_type_symbol(FIX_SYM_OBJECT_TYPE), + pack_type_flag(9, 0, 4), 0, 0); + Ptr(u32_in_fixed_sym(FIX_SYM_POINTER))->new_method = new_illegal_func; + + // NUMERIC + set_fixed_type(FIX_SYM_NUMBER, "number", get_fixed_type_symbol(FIX_SYM_OBJECT_TYPE), + pack_type_flag(9, 0, 8), make_function_from_c((void*)print_integer).offset, + make_function_from_c((void*)inspect_integer).offset); + Ptr(u32_in_fixed_sym(FIX_SYM_NUMBER))->new_method = new_illegal_func; + + set_fixed_type(FIX_SYM_FLOAT, "float", get_fixed_type_symbol(FIX_SYM_NUMBER), + pack_type_flag(9, 0, 4), make_function_from_c((void*)print_float).offset, + make_function_from_c((void*)inspect_float).offset); + + set_fixed_type(FIX_SYM_INTEGER, "integer", get_fixed_type_symbol(FIX_SYM_NUMBER), + pack_type_flag(9, 0, 8), 0, 0); + + set_fixed_type(FIX_SYM_BINTEGER, "binteger", get_fixed_type_symbol(FIX_SYM_INTEGER), + pack_type_flag(9, 0, 8), make_function_from_c((void*)print_binteger).offset, + make_function_from_c((void*)inspect_binteger).offset); + + set_fixed_type(FIX_SYM_SINTEGER, "sinteger", get_fixed_type_symbol(FIX_SYM_INTEGER), + pack_type_flag(9, 0, 8), 0, 0); + set_fixed_type(FIX_SYM_INT8, "int8", get_fixed_type_symbol(FIX_SYM_SINTEGER), + pack_type_flag(9, 0, 1), 0, 0); + set_fixed_type(FIX_SYM_INT16, "int16", get_fixed_type_symbol(FIX_SYM_SINTEGER), + pack_type_flag(9, 0, 2), 0, 0); + set_fixed_type(FIX_SYM_INT32, "int32", get_fixed_type_symbol(FIX_SYM_SINTEGER), + pack_type_flag(9, 0, 4), 0, 0); + set_fixed_type(FIX_SYM_INT64, "int64", get_fixed_type_symbol(FIX_SYM_SINTEGER), + pack_type_flag(9, 0, 8), 0, 0); + set_fixed_type(FIX_SYM_INT128, "int128", get_fixed_type_symbol(FIX_SYM_SINTEGER), + pack_type_flag(9, 0, 16), 0, 0); + + set_fixed_type(FIX_SYM_UINTEGER, "uinteger", get_fixed_type_symbol(FIX_SYM_INTEGER), + pack_type_flag(9, 0, 8), 0, 0); + set_fixed_type(FIX_SYM_UINT8, "uint8", get_fixed_type_symbol(FIX_SYM_UINTEGER), + pack_type_flag(9, 0, 1), 0, 0); + set_fixed_type(FIX_SYM_UINT16, "uint16", get_fixed_type_symbol(FIX_SYM_UINTEGER), + pack_type_flag(9, 0, 2), 0, 0); + set_fixed_type(FIX_SYM_UINT32, "uint32", get_fixed_type_symbol(FIX_SYM_UINTEGER), + pack_type_flag(9, 0, 4), 0, 0); + set_fixed_type(FIX_SYM_UINT64, "uint64", get_fixed_type_symbol(FIX_SYM_UINTEGER), + pack_type_flag(9, 0, 8), 0, 0); + set_fixed_type(FIX_SYM_UINT128, "uint128", get_fixed_type_symbol(FIX_SYM_UINTEGER), + pack_type_flag(9, 0, 16), 0, 0); + + Ptr(u32_in_fixed_sym(FIX_SYM_OBJECT_TYPE))->new_method = + make_function_from_c((void*)alloc_heap_object); + + make_function_symbol_from_c("string->symbol", (void*)intern); + make_function_symbol_from_c("print", (void*)sprint); + make_function_symbol_from_c("inspect", (void*)inspect_object); + make_function_symbol_from_c("load", (void*)load); + make_function_symbol_from_c("loadb", (void*)loadb); + make_function_symbol_from_c("loado", (void*)loado); + make_function_symbol_from_c("unload", (void*)unload); + make_function_symbol_from_c("_format", (void*)format_impl_jak2); + make_function_symbol_from_c("malloc", (void*)alloc_heap_memory); + make_function_symbol_from_c("kmalloc", (void*)goal_malloc); + make_function_symbol_from_c("kmemopen", (void*)kmemopen); + make_function_symbol_from_c("kmemclose", (void*)kmemclose); + make_function_symbol_from_c("new-dynamic-structure", (void*)new_dynamic_structure); + make_function_symbol_from_c("method-set!", (void*)method_set); + make_function_symbol_from_c("link", (void*)link_and_exec); + make_function_symbol_from_c("link-busy?", (void*)link_busy); + make_function_symbol_from_c("link-reset", (void*)link_reset); + make_function_symbol_from_c("dgo-load", (void*)load_and_link_dgo); + make_raw_function_symbol_from_c("ultimate-memcpy", 0); + make_raw_function_symbol_from_c("memcpy-and-rellink", 0); + make_raw_function_symbol_from_c("symlink2", 0); + make_raw_function_symbol_from_c("symlink3", 0); + make_function_symbol_from_c("link-begin", (void*)link_begin); + make_function_symbol_from_c("link-resume", (void*)link_resume); + make_function_symbol_from_c("sql-query", (void*)sql_query_sync); + make_function_symbol_from_c("mc-run", (void*)MC_run); + make_function_symbol_from_c("mc-format", (void*)MC_format); + make_function_symbol_from_c("mc-unformat", (void*)MC_unformat); + make_function_symbol_from_c("mc-create-file", (void*)MC_createfile); + make_function_symbol_from_c("mc-save", (void*)MC_save); + make_function_symbol_from_c("mc-load", (void*)MC_load); + make_function_symbol_from_c("mc-check-result", (void*)MC_check_result); + make_function_symbol_from_c("mc-get-slot-info", (void*)MC_get_status); + make_function_symbol_from_c("mc-makefile", (void*)MC_makefile); + make_function_symbol_from_c("kset-language", (void*)MC_set_language); + + auto ds_symbol = intern_from_c("*debug-segment*"); + if (DebugSegment) { + ds_symbol->value() = (s7 + FIX_SYM_TRUE).offset; + } else { + ds_symbol->value() = (s7 + FIX_SYM_FALSE).offset; + } + + auto method_set_symbol = intern_from_c("*enable-method-set*"); + EnableMethodSet = method_set_symbol.cast() - 1; + method_set_symbol->value() = 0; + + KernelDebug = intern_from_c("*kernel-debug*").cast() - 1; + *KernelDebug = 0; + + intern_from_c("*boot-video-mode*")->value() = 0; + intern_from_c("*video-mode*")->value() = 0; + + SqlResult = intern_from_c("*sql-result*"); + SqlResult->value() = s7.offset; + + CollapseQuote = intern_from_c("*collapse-quote*"); + CollapseQuote->value() = s7.offset + FIX_SYM_TRUE; + LevelTypeList = intern_from_c("*level-type-list*"); + + // load kernel! + + if (MasterUseKernel) { + *EnableMethodSet = *EnableMethodSet + 1; + load_and_link_dgo_from_c("kernel", kglobalheap, + LINK_FLAG_OUTPUT_LOAD | LINK_FLAG_EXECUTE | LINK_FLAG_PRINT_LOGIN, + 0x400000, true); + *EnableMethodSet = *EnableMethodSet + -1; + + auto kernel_version = intern_from_c("*kernel-version*")->value(); + if (!kernel_version || ((kernel_version >> 0x13) != KERNEL_VERSION_MAJOR)) { + MsgErr("\n"); + MsgErr( + "dkernel: compiled C kernel version is %d.%d but the goal kernel is %d.%d\n\tfrom the " + "goal> prompt (:mch) then mkee your kernel in linux.\n", + KERNEL_VERSION_MAJOR, KERNEL_VERSION_MINOR, kernel_version >> 0x13, + (kernel_version >> 3) & 0xffff); + return -1; + } else { + lg::info("Got correct kernel version {}.{}", kernel_version >> 0x13, + (kernel_version >> 3) & 0xffff); + } + } + + // in real jak2, the -1 occurs in the GoalProtoHandler. But let's just do it here to make + // things consistent. + protoBlock.deci2count = intern_from_c("*deci-count*").cast() - 1; + + // load stuff for the listener interface + InitListener(); + + // Do final initialization, including loading and initializing the engine. + InitMachineScheme(); + kmemclose(); + return 0; +} + +u64 load(u32 file_name_in, u32 heap_in) { + ASSERT(false); + return 0; +} + +u64 loadb(u32 file_name_in, u32 heap_in, u32 param3) { + ASSERT(false); + return 0; +} + +u64 loadc(const char* file_name, kheapinfo* heap, u32 flags) { + ASSERT(false); + return 0; +} + +u64 loado(u32 file_name_in, u32 heap_in) { + ASSERT(false); + return 0; +} + +/*! + * "Unload". Doesn't free memory, just informs listener we unloaded. + */ +u64 unload(u32 name) { + output_unload(Ptr(name)->data()); + return 0; +} + +s64 load_and_link(const char* filename, char* decode_name, kheapinfo* heap, u32 flags) { + ASSERT(false); + return 0; +} +} // namespace jak2 \ No newline at end of file diff --git a/game/kernel/jak2/kscheme.h b/game/kernel/jak2/kscheme.h new file mode 100644 index 0000000000..1b6798d487 --- /dev/null +++ b/game/kernel/jak2/kscheme.h @@ -0,0 +1,60 @@ +#pragma once +#include "common/common_types.h" + +#include "game/kernel/common/Ptr.h" +#include "game/kernel/common/Symbol4.h" +#include "game/kernel/common/kscheme.h" + +namespace jak2 { + +constexpr s32 SYMBOL_OFFSET = 1; + +extern Ptr> SqlResult; + +/*! + * GOAL Type + */ +struct Type { + Ptr>> symbol; //! The type's symbol 0x0 + Ptr parent; //! The type's parent 0x4 + u16 allocated_size; //! The type's size in memory 0x8 + u16 padded_size; //! The type's size, when padded? 0xa + + u16 heap_base; //! relative location of heap 0xc + u16 num_methods; //! allocated-length field 0xe - 0xf + + Ptr new_method; // 16 0 + Ptr delete_method; // 20 1 + Ptr print_method; // 24 2 + Ptr inspect_method; // 28 3 + Ptr length_method; // 32 4 + Ptr asize_of_method; // 36 5 + Ptr copy_method; // 40 6 + Ptr relocate_method; // 44 7 + Ptr memusage_method; // 48 8 + + Ptr& get_method(u32 i) { + Ptr* f = &new_method; + return f[i]; + } +}; + +void kscheme_init_globals(); +Ptr> intern_from_c(const char* name); +Ptr intern_type_from_c(const char* name, u64 methods); +u64 call_method_of_type_arg2(u32 arg, Ptr type, u32 method_id, u32 a1, u32 a2); +Ptr> find_symbol_from_c(const char* name); +u64 make_string_from_c(const char* c_str); +u64 new_pair(u32 heap, u32 type, u32 car, u32 cdr); +u64 inspect_object(u32 obj); +u64 print_object(u32 obj); +Ptr make_function_symbol_from_c(const char* name, void* f); +Ptr make_stack_arg_function_symbol_from_c(const char* name, void* f); +int InitHeapAndSymbol(); +u64 load(u32 file_name_in, u32 heap_in); +u64 loadb(u32 file_name_in, u32 heap_in, u32 param3); +u64 loado(u32 file_name_in, u32 heap_in); +u64 unload(u32 name); +u64 call_method_of_type(u32 arg, Ptr type, u32 method_id); +u64 call_goal_function_by_name(const char* name); +} // namespace jak2 \ No newline at end of file diff --git a/game/kernel/jak2/ksound.cpp b/game/kernel/jak2/ksound.cpp new file mode 100644 index 0000000000..e5604224fb --- /dev/null +++ b/game/kernel/jak2/ksound.cpp @@ -0,0 +1,21 @@ +#include "ksound.h" + +#include "game/kernel/common/kdgo.h" +#include "game/kernel/common/ksound.h" +#include "game/kernel/jak2/kscheme.h" + +namespace jak2 { +/*! + * Set up some functions which are somewhat related to sound. + */ +void InitSoundScheme() { + make_function_symbol_from_c("rpc-call", (void*)RpcCall_wrapper); + make_function_symbol_from_c("rpc-busy?", (void*)RpcBusy); + make_function_symbol_from_c("test-load-dgo-c", (void*)LoadDGOTest); + make_stack_arg_function_symbol_from_c("rpc-call", (void*)RpcCall_wrapper); + + // PC port interns + make_function_symbol_from_c("pc-sound-set-flava-hack", (void*)set_flava_hack); + make_function_symbol_from_c("pc-sound-set-fade-hack", (void*)set_fade_hack); +} +} // namespace jak2 \ No newline at end of file diff --git a/game/kernel/jak2/ksound.h b/game/kernel/jak2/ksound.h new file mode 100644 index 0000000000..d7d9c613ef --- /dev/null +++ b/game/kernel/jak2/ksound.h @@ -0,0 +1,5 @@ +#pragma once + +namespace jak2 { +void InitSoundScheme(); +} \ No newline at end of file diff --git a/game/kernel/kdgo.h b/game/kernel/kdgo.h deleted file mode 100644 index 30eaebd364..0000000000 --- a/game/kernel/kdgo.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -/*! - * @file kdgo.h - * Loading DGO Files. Also has some general SIF RPC stuff used for RPCs other than DGO loading. - * DONE! - */ - -#include "common/common_types.h" -#include "Ptr.h" -#include "kmalloc.h" - -void kdgo_init_globals(); -u32 InitRPC(); -void load_and_link_dgo_from_c(const char* name, - Ptr heap, - u32 linkFlag, - s32 bufferSize, - bool jump_from_c_to_goal); -void load_and_link_dgo(u64 name_gstr, u64 heap_info, u64 flag, u64 buffer_size); -void StopIOP(); - -u64 RpcCall_wrapper(void* args); -s32 RpcCall(s32 rpcChannel, - u32 fno, - bool async, - void* sendBuff, - s32 sendSize, - void* recvBuff, - s32 recvSize); -u32 RpcBusy(s32 channel); -void LoadDGOTest(); diff --git a/game/kernel/klisten.h b/game/kernel/klisten.h deleted file mode 100644 index f8781e33b6..0000000000 --- a/game/kernel/klisten.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -/*! - * @file klisten.h - * Implementation of the Listener protocol - * Done - */ - -#ifndef JAK_KLISTEN_H -#define JAK_KLISTEN_H - -#include "kmachine.h" -#include "kscheme.h" - -extern Ptr ListenerFunction; -extern Ptr kernel_dispatcher; -extern Ptr print_column; -extern Ptr kernel_packages; - -void klisten_init_globals(); -void InitListener(); -void ClearPending(); -void SendAck(); -void ProcessListenerMessage(Ptr msg); - -#endif // JAK_KLISTEN_H diff --git a/game/kernel/kmachine.h b/game/kernel/kmachine.h deleted file mode 100644 index ead8e82537..0000000000 --- a/game/kernel/kmachine.h +++ /dev/null @@ -1,149 +0,0 @@ -#pragma once - -/*! - * @file kmachine.h - * GOAL Machine. Contains low-level hardware interfaces for GOAL. - */ - -#include "common/common_types.h" -#include "Ptr.h" - -//! Toggle to use more memory. To simulate the original game's memory layout, set this to false. -// Make sure this matches the const in gcommon.gc. -constexpr bool BIG_MEMORY = true; - -//! How much space to leave for the stack when creating the debug heap -// In the game, it's 16 kB, but we increase it to 64 kB. -// ASAN builds + fmt / spdlog stuff uses a _ton_ of stack when no optimizations are on and we -// need more. -constexpr u32 DEBUG_HEAP_SPACE_FOR_STACK = 0x10000; - -//! First free address for the GOAL heap -constexpr u32 HEAP_START = 0x13fd20; - -//! Where to end the global heap so it doesn't overlap with the stack. -constexpr u32 GLOBAL_HEAP_END = 0x1ffc000 + (BIG_MEMORY ? (0x1ffc000 - HEAP_START) : 0); // doubled - -//! Location of kglobalheap, kdebugheap kheapinfo structures. -constexpr u32 GLOBAL_HEAP_INFO_ADDR = 0x13AD00; -constexpr u32 DEBUG_HEAP_INFO_ADDR = 0x13AD10; -constexpr u32 LINK_CONTROL_NAME_ADDR = 0x13AD80; - -//! Where to place the debug heap -constexpr u32 DEBUG_HEAP_START = 0x5000000; - -/*! - * Where does OVERLORD load its data from? - */ -enum OverlordDataSource : u32 { - fakeiso = 0, //! some sort of development way of getting data - deviso = 1, //! some sort of development way of getting data - iso_cd = 2, //! use the actual DVD drive -}; - -extern OverlordDataSource isodrv; - -// Get IOP modules from DVD or from dsefilesv -extern u32 modsrc; - -// Reboot IOP on start? -extern u32 reboot; - -// Discord RPC -struct DiscordRichPresence; -extern int gDiscordRpcEnabled; -extern int64_t gStartTime; - -/*! - * Initialize globals for kmachine. - * This should be called before running main. - */ -void kmachine_init_globals(); - -/*! - * Initialize global variables based on command line parameters - */ -void InitParms(int argc, const char* const* argv); - -/*! - * Initialize the CD Drive - */ -void InitCD(); - -/*! - * Initialize the I/O Processor - */ -void InitIOP(); - -/*! - * Initialize the GS and display the splash screen. - */ -void InitVideo(); - -/*! - * Initialze GOAL Runtime - */ -int InitMachine(); - -/*! - * Shutdown GOAL runtime. - */ -int ShutdownMachine(); - -/*! - * Flush caches. Does all the memory, regardless of what you specify - */ -void CacheFlush(void* mem, int size); - -void InitMachineScheme(); - -//! Mirror of cpad-info -struct CPadInfo { - u8 valid; - u8 status; - u16 button0; - u8 rightx; - u8 righty; - u8 leftx; - u8 lefty; - u8 abutton[12]; - u8 dummy[12]; - s32 number; - s32 cpad_file; - u32 button0_abs[3]; - u32 button0_shadow_abs[1]; - u32 button0_rel[3]; - float stick0_dir; - float stick0_speed; - s32 new_pad; - s32 state; - u8 align[6]; - u8 direct[6]; - u8 buzz_val[2]; - u8 __pad[2]; - u64 buzz_time[2]; - u32 buzz; - s32 buzz_act; - s32 change_time; // actually u64 in goal! -}; - -struct FileStream { - u32 flags; - u32 mode; // basic - u32 name; // basic - s32 file; // int32 -}; - -struct DiscordInfo { - u32 fuel; - u32 money_total; - u32 buzzer_total; - u32 status; - u32 level; - u32 cutscene; // check if cutscene is playing -}; - -// static_assert(offsetof(CpadInfo, new_pad) == 76, "cpad type offset"); - -void vif_interrupt_callback(); -u32 offset_of_s7(); diff --git a/game/kernel/kmemcard.cpp b/game/kernel/kmemcard.cpp deleted file mode 100644 index 26f7ca5bdc..0000000000 --- a/game/kernel/kmemcard.cpp +++ /dev/null @@ -1,1650 +0,0 @@ -/*! - * @file kmemcard.cpp - * Memory card interface. Very messy code. Most of it is commented out now, as we've switched away - * from memory cards to just raw saves. - */ - -#include -#include -#include - -#include "third-party/fmt/core.h" - -#include "game/sce/sif_ee.h" -#include "game/sce/sif_ee_memcard.h" -#include "kmemcard.h" -#include "game/kernel/kdgo.h" -#include "game/common/ramdisk_rpc_types.h" -#include "game/kernel/fileio.h" -#include "common/util/FileUtil.h" -#include "common/util/Timer.h" -#include "common/util/Assert.h" - -static constexpr bool memcard_debug = false; - -using McCallbackFunc = void (*)(s32); - -McCallbackFunc callback; - -// static s32 next; -static s32 language; -static MemoryCardOperation op; -// static MemoryCard mc[2]; -// instead of two memory cards we just simulate the 4 save files (8 banks). -static MemoryCardFile mc_files[4]; -// keep track of latest file selected. this is only used in an auto-save mode thats not used -static int mc_last_file = -1; -// static RPC_Ramdisk_LoadCmd ramdisk_cmd; -// static ee::sceMcTblGetDir dirent; - -// a random value we will use as the memory card "handle" for the pc port, which has no memcards. -constexpr u32 PC_MEM_CARD_HANDLE = 0x6C616F67; - -constexpr u32 MEM_CARD_MAGIC = 0x12345678; - -struct McHeader { - u32 save_count; - u32 checksum; - u32 magic; - u8 preview_data[64]; - u8 data[944]; - u32 unk1_repeated; -}; -static_assert(sizeof(McHeader) == 0x400, "McHeader size"); -constexpr s32 BANK_TOTAL_SIZE = BANK_SIZE + sizeof(McHeader) * 2; - -static McHeader header; - -// these are the return value for sceMcGetInfo. -static s32 p1, p2, p3, p4; -using namespace ee; - -// void cb_reprobe_format(s32); -// void cb_format_complete(s32); -// void cb_unformat(s32); -// void cb_reprobe_createfile(s32); -// void cb_wait_for_ramdisk(s32); -// void cb_wait_for_ramdisk_load(s32); -// void cb_createfile_erasing(s32); -// void cb_createdir(s32); -// void cb_createdfile(s32); -// void cb_writtenfile(s32); -// void cb_closedfile(s32); -// void cb_reprobe_save(s32); -// void cb_reprobe_load(s32); -// void cb_probe(s32); -// void cb_reprobe(s32); -// void cb_getdir(s32); -// void cb_check_open(s32); -// void cb_check_read(s32); -// void cb_check_close(s32); -// void cb_openedsave(s32); -// void cb_savedheader(s32); -// void cb_saveddata(s32); -// void cb_savedfooter(s32); -// void cb_closedsave(s32); -// void cb_openedload(s32); -// void cb_readload(s32); -// void cb_closedload(s32); - -template -void mc_print(const std::string& str, Args&&... args) { - if (memcard_debug) { - fmt::print("[MC] "); - if (!str.empty() && str.back() == '\n') { - fmt::print(str, std::forward(args)...); - } else { - fmt::print(str + '\n', std::forward(args)...); - } - } -} - -const char* filename[12] = { - "BASCUS-97124AYBABTU!", "BASCUS-97124AYBABTU!/icon.sys", - "BASCUS-97124AYBABTU!/icon.ico", "BASCUS-97124AYBABTU!/BASCUS-97124AYBABTU!", - "BASCUS-97124AYBABTU!/bank0.bin", "BASCUS-97124AYBABTU!/bank1.bin", - "BASCUS-97124AYBABTU!/bank2.bin", "BASCUS-97124AYBABTU!/bank3.bin", - "BASCUS-97124AYBABTU!/bank4.bin", "BASCUS-97124AYBABTU!/bank5.bin", - "BASCUS-97124AYBABTU!/bank6.bin", "BASCUS-97124AYBABTU!/bank7.bin"}; - -void kmemcard_init_globals() { - // next = 0; - language = 0; - op = {}; - // mc[0] = {}; - // mc[1] = {}; - mc_files[0] = {}; - mc_files[1] = {}; - mc_files[2] = {}; - mc_files[3] = {}; - callback = nullptr; - p1 = 0; - p2 = 0; - p3 = 0; - p4 = 0; - // memset(&dirent, 0, sizeof(sceMcTblGetDir)); - memset(&header, 0, sizeof(McHeader)); -} - -/*! - * Get a new memory card handle. - * Will never return 0. - * A handle is a unique integer that can be passed up to the GOAL game code and represents a - * specific memory card. If the card is removed, the handle will become invalid. - */ -// s32 new_mc_handle() { -// s32 handle = next++; -// -// // if you wrap around, it avoids the zero handle. -// // it doesn't seem like you will need billions of memory card handles -// if (handle == 0) { -// handle = next++; -// } -// return handle; -//} - -/*! - * A questionable checksum used on memory card data. - */ -u32 mc_checksum(Ptr data, s32 size) { - if (size < 0) { - size += 3; - } - - u32 result = 0; - u32* data_u32 = (u32*)data.c(); - for (s32 i = 0; i < size / 4; i++) { - result = result << 1 ^ (s32)result >> 0x1f ^ data_u32[i] ^ MEM_CARD_MAGIC; - } - - return result ^ 0xedd1e666; -} - -/*! - * Get the slot for a handle. The card must be in the given state. - * Return -1 if it fails. - * There are no slots in the port. This function should not be used. - */ -// s32 handle_to_slot(u32 handle, MemoryCardState state) { -// if (mc[0].state == state && mc[0].handle == handle) { -// return 0; -// } -// if (mc[1].state == state && mc[0].handle == handle) { -// return 1; -// } else { -// return -1; -// } -//} - -/*! - * PC port function that returns whether a given bank ID's file exists or not. - */ -bool file_is_present(int id, int bank = 0) { - auto bankname = file_util::get_user_memcard_dir() / filename[4 + id * 2 + bank]; - if (!std::filesystem::exists(bankname)) { - // file doesn't exist... - return false; - } - // avoid file check tbh. there shouldn't be any saves with a save count of zero anyway. - // the file check is quite slow and ultimately not very useful. - return true; - - /* - // file exists. but let's see if it's an empty one. - // this prevents the game from reading a bank but classifying it as corrupt data. - // which a file full of zeros logically is. - auto fp = fopen(bankname.c_str(), "rb"); - - // we can actually just check if the save count is over zero... - u32 savecount = 0; - fread(&savecount, sizeof(u32), 1, fp); - fclose(fp); - return savecount > 0; - */ -} - -/*! - * PC port function to set memcard info. We don't use a memory card, instead just the raw savefiles. - */ -void pc_update_card() { - // int highest_save_count = 0; - mc_last_file = -1; - for (s32 file = 0; file < 4; file++) { - auto bankname = file_util::get_user_memcard_dir() / filename[4 + file * 2]; - mc_files[file].present = file_is_present(file); - if (mc_files[file].present) { - auto bankdata = file_util::read_binary_file(bankname.string()); - auto header1 = reinterpret_cast(bankdata.data()); - if (file_is_present(file, 1)) { - auto bankname2 = file_util::get_user_memcard_dir() / filename[1 + 4 + file * 2]; - auto bankdata2 = file_util::read_binary_file(bankname2.string()); - auto header2 = reinterpret_cast(bankdata.data()); - - if (header2->save_count > header1->save_count) { - // use most recent bank here. - header1 = header2; - } - - // banks chosen and checked. copy data and set info. - mc_files[file].last_saved_bank = header1 == header2; - mc_files[file].most_recent_save_count = header1->save_count; - - memcpy(mc_files[file].data, header1->preview_data, 64); - } else { - // banks chosen and checked. copy data and set info. - mc_files[file].last_saved_bank = 0; - mc_files[file].most_recent_save_count = header1->save_count; - - memcpy(mc_files[file].data, header1->preview_data, 64); - } - - // if (mc_files[file].most_recent_save_count > highest_save_count) { - // mc_last_file = file; - // highest_save_count = mc_files[file].most_recent_save_count; - // } - } - } -} - -/*! - * PC port function to save a file. This does the whole saving at once, synchronously. - */ -void pc_game_save_synch() { - Timer mc_timer; - mc_timer.start(); - pc_update_card(); - auto path = file_util::get_user_memcard_dir() / filename[0]; - file_util::create_dir_if_needed_for_file(path.string()); - - // cd_reprobe_save // - if (!file_is_present(op.param2)) { - mc_print("reprobe save: first time!"); - // first time saving! - p2 = 0; // save count 0 - p4 = 0; // first bank for file - } else { - p2 = mc_files[op.param2].most_recent_save_count + 1; // increment save count - p4 = mc_files[op.param2].last_saved_bank ^ 1; // use the other bank - } - - // reserve 0 as "I never saved" and use 1 instead. - if (p2 == 0) { - p2 = 1; - } - - // file*2 + p4 is the bank (2 banks per file, p4 is 0 or 1 to select the bank) - // 4 is the first bank file - mc_print("open {} for saving", filename[op.param2 * 2 + 4 + p4]); - auto save_path = file_util::get_user_memcard_dir() / filename[op.param2 * 2 + 4 + p4]; - file_util::create_dir_if_needed_for_file(save_path.string()); - auto fd = fopen(save_path.string().c_str(), "wb"); - fmt::print("[MC] synchronous save file open took {:.2f}ms\n", mc_timer.getMs()); - if (fd) { - // cb_openedsave // - mc_print("save file opened, writing header..."); - memset(&header, 0, sizeof(McHeader)); - header.save_count = p2; - header.checksum = mc_checksum(op.data_ptr, BANK_SIZE); - header.magic = MEM_CARD_MAGIC; - header.unk1_repeated = p2; - memcpy(header.preview_data, op.data_ptr2.c(), 64); - if (fwrite(&header, sizeof(McHeader), 1, fd) == 1) { - // cb_savedheader // - mc_print("save file writing main data"); - if (fwrite(op.data_ptr.c(), BANK_SIZE, 1, fd) == 1) { - // cb_saveddata // - mc_print("save file writing footer"); - if (fwrite(&header, sizeof(McHeader), 1, fd) == 1) { - // cb_savedfooter // - if (fclose(fd) == 0) { - // cb_closedsave // - mc_print("All done with saving!!"); - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::OK; - mc_files[op.param2].present = 1; - mc_files[op.param2].most_recent_save_count = p2; - mc_files[op.param2].last_saved_bank = p4; - memcpy(mc_files[op.param2].data, op.data_ptr2.c(), 64); - mc_last_file = op.param2; - } else { - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::INTERNAL_ERROR; - } - } else { - fclose(fd); - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::INTERNAL_ERROR; - } - } else { - fclose(fd); - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::INTERNAL_ERROR; - } - } else { - fclose(fd); - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::INTERNAL_ERROR; - } - } else { - fmt::print("[MC] Error opening file, errno - {}", errno); - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::INTERNAL_ERROR; - } - - fmt::print("[MC] synchronous save took {:.2f}ms\n", mc_timer.getMs()); -} - -void pc_game_load_open_file(FILE* fd) { - if (fd) { - // cb_openedload // - size_t read_size = BANK_TOTAL_SIZE; - mc_print("reading save file..."); - if (fread(op.data_ptr.c() + p2 * read_size, read_size, 1, fd) == 1) { - // cb_readload // - mc_print("closing save file.."); - if (fclose(fd) == 0) { - // cb_closedload // - p2++; - // added : check if aux bank exists - auto new_bankname = file_util::get_user_memcard_dir() / filename[op.param2 * 2 + 4 + p2]; - bool aux_exists = std::filesystem::exists(new_bankname); - if (p2 < 2 && aux_exists) { - mc_print("reading next save bank {}", filename[op.param2 * 2 + 4 + p2]); - auto new_fd = fopen(new_bankname.string().c_str(), "rb"); - pc_game_load_open_file(new_fd); - } else { - // let's verify the data. - McHeader* headers[2]; - McHeader* footers[2]; - bool ok[2]; - - headers[0] = (McHeader*)(op.data_ptr.c()); - footers[0] = (McHeader*)(op.data_ptr.c() + sizeof(McHeader) + BANK_SIZE); - headers[1] = (McHeader*)(op.data_ptr.c() + BANK_TOTAL_SIZE); - footers[1] = - (McHeader*)(op.data_ptr.c() + BANK_TOTAL_SIZE + sizeof(McHeader) + BANK_SIZE); - static_assert(BANK_TOTAL_SIZE * 2 == 0x21000, "save layout"); - ok[0] = true; - ok[1] = aux_exists; - - for (int idx = 0; idx < 2; idx++) { - u32 expected_save_count = headers[idx]->save_count; - if (headers[idx]->unk1_repeated == expected_save_count && - footers[idx]->save_count == expected_save_count && - footers[idx]->unk1_repeated == expected_save_count) { - // save count is okay! - if (headers[idx]->magic == MEM_CARD_MAGIC && footers[idx]->magic == MEM_CARD_MAGIC) { - // magic numbers okay! - if (headers[idx]->checksum == footers[idx]->checksum) { - // checksum - auto expected_checksum = headers[idx]->checksum; - if (mc_checksum(make_u8_ptr(headers[idx] + 1), BANK_SIZE) != expected_checksum) { - mc_print("failed checksum"); - ok[idx] = false; - } - } else { - mc_print("corrupted checksum"); - ok[idx] = false; - } - } else { - mc_print("bad magic"); - ok[idx] = false; - } - } else { - mc_print("bad save count"); - ok[idx] = false; - } - } - - mc_print("checking loaded banks"); - - // - if (!ok[0] && !ok[1]) { - // no good data. - if (headers[0]->save_count == 0 && headers[0]->checksum == 0 && - headers[0]->magic == 0 && headers[0]->unk1_repeated == 0 && - headers[1]->save_count == 0 && headers[1]->checksum == 0 && - headers[1]->magic == 0 && headers[1]->unk1_repeated == 0) { - // this is a fresh file that you tried to load from... - mc_print("new game result"); - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::NEW_GAME; - mc_last_file = op.param2; - } else { - mc_print("corrupted data"); - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::READ_ERROR; - } - } else { - // pick the bank - int bank = 0; - - if (!ok[0] || !ok[1]) { - if (ok[1]) { - bank = 1; - } - } else { - bank = headers[0]->save_count <= headers[1]->save_count; - } - - mc_print(fmt::format("loading bank {}", bank)); - u32 current_save_count = headers[bank]->save_count; - memcpy(op.data_ptr.c(), op.data_ptr.c() + bank * BANK_TOTAL_SIZE + sizeof(McHeader), - BANK_SIZE); - mc_last_file = op.param2; - mc_files[op.param2].most_recent_save_count = current_save_count; - mc_files[op.param2].last_saved_bank = bank; - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::OK; - mc_print("load succeeded"); - } - } - } else { - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::INTERNAL_ERROR; - } - } else { - fclose(fd); - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::INTERNAL_ERROR; - } - } else { - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::INTERNAL_ERROR; - } -} - -/*! - * PC port function to load a file. This does the whole loading at once, synchronously. - */ -void pc_game_load_synch() { - Timer mc_timer; - mc_timer.start(); - pc_update_card(); - - // cb_reprobe_load // - p2 = 0; - mc_print("opening save file {}", filename[op.param2 * 2 + 4]); - - auto path = file_util::get_user_memcard_dir() / filename[op.param2 * 2 + 4]; - auto fd = fopen(path.string().c_str(), "rb"); - pc_game_load_open_file(fd); - - fmt::print("[MC] synchronous load took {:.2f}ms\n", mc_timer.getMs()); -} - -/*! - * Run the Memory Card state machine. This is called once per frame in GOAL. - * It: - * - does nothing if there is an in-progress memory card operation - * - if async memory card functions are done, runs their callbacks - * - if there is a requested operation, starts running sony functions. - * - if there is none of the above, and unknown cards, finds out about them. - * - every now and then, recheck cards. - */ -void MC_run() { - // if we have an in-progress operation, it will have set a callback. - if (callback) { - s32 sony_cmd, sony_status; - // check the status - s32 status = sceMcSync(1, &sony_cmd, &sony_status); - McCallbackFunc callback_for_sync = callback; - if (status == sceMcExecRun) { - // busy, return. - return; - } - - if (status == sceMcExecFinish) { - // sony function is done. do the callback. - callback = nullptr; - (*callback_for_sync)(sony_status); - } else { - // sony function is done, but failed. - callback = nullptr; - (*callback_for_sync)(0); - } - - if (callback) { - // if we got another callback, it means there's another op started by the prev callback. - // and this case, we want to wait for that operation to finish. - return; - } - } - - // if we got here, there is no in-progress sony function. So start the next one, if we should - if (op.operation == MemoryCardOperationKind::FORMAT) { - // format memory card. Not used in PC port, so lets move on. - return; - /* - mc_print("begin format operation"); - // grab the slot. should be open, but not formatted - p1 = handle_to_slot(op.param, MemoryCardState::OPEN_BUT_UNFORMATTED); - if (p1 == -1) { - // no slot in the right state. - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::BAD_HANDLE; - } else { - // do a getInfo - s32 info_result = sceMcGetInfo(p1, 0, &p2, &p3, &p4); - if (info_result == sceMcResSucceed) { - callback = cb_reprobe_format; - } - // allow some number of errors. - op.retry_count--; - if (op.retry_count == 0) { - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::INTERNAL_ERROR; - } - } */ - } else if (op.operation == MemoryCardOperationKind::UNFORMAT) { - // unformat memory card. - return; - /* - mc_print("begin unformat operation"); - p1 = handle_to_slot(op.param, MemoryCardState::FORMATTED); - if (p1 == -1) { - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::BAD_HANDLE; - } else { - s32 rv = sceMcUnformat(p1, 0); - if (rv == sceMcResSucceed) { - callback = cb_unformat; - } - op.retry_count--; - if (op.retry_count == 0) { - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::INTERNAL_ERROR; - } - } - */ - } else if (op.operation == MemoryCardOperationKind::CREATE_FILE) { - // create the game file. - // there's no cards, keep in mind. - return; - /* - mc_print("begin create file operation"); - p1 = handle_to_slot(op.param, MemoryCardState::FORMATTED); - if (p1 == -1) { - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::BAD_HANDLE; - } else { - s32 info_result = sceMcGetInfo(p1, 0, &p2, &p3, &p4); - if (info_result == sceMcResSucceed) { - callback = cb_reprobe_createfile; - } - // allow some number of errors. - op.retry_count--; - if (op.retry_count == 0) { - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::INTERNAL_ERROR; - } - } */ - } else if (op.operation == MemoryCardOperationKind::SAVE) { - // write game save. - // there's no cards, keep in mind. - pc_game_save_synch(); - // allow some number of errors. - op.retry_count--; - if (op.retry_count == 0) { - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::INTERNAL_ERROR; - } - // p1 = handle_to_slot(op.param, MemoryCardState::FORMATTED); - // if (p1 == -1) { - // op.operation = MemoryCardOperationKind::NO_OP; - // op.result = McStatusCode::BAD_HANDLE; - //} else { - // s32 info_result = sceMcGetInfo(p1, 0, &p2, &p3, &p4); - // if (info_result == sceMcResSucceed) { - // callback = cb_reprobe_save; - // } - // // allow some number of errors. - // op.retry_count--; - // if (op.retry_count == 0) { - // op.operation = MemoryCardOperationKind::NO_OP; - // op.result = McStatusCode::INTERNAL_ERROR; - // } - //} - } else if (op.operation == MemoryCardOperationKind::LOAD) { - // load game save. - // potato. - if (!file_is_present(op.param2)) { - // tried to load, but there's no save data in the file. - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::NO_MEMORY; - } else { - pc_game_load_synch(); - op.retry_count--; - if (op.retry_count == 0) { - op.operation = MemoryCardOperationKind::NO_OP; - op.result = McStatusCode::INTERNAL_ERROR; - } - } - // mc_print("begin load operation"); - // p1 = handle_to_slot(op.param, MemoryCardState::FORMATTED); - // if (p1 == -1) { - // op.operation = MemoryCardOperationKind::NO_OP; - // op.result = McStatusCode::BAD_HANDLE; - //} else { - // if (!mc[p1].files[op.param2].present) { - // // tried to load, but there's no save data in the file. - // op.operation = MemoryCardOperationKind::NO_OP; - // op.result = McStatusCode::NO_MEMORY; - // } else { - // s32 info_result = sceMcGetInfo(p1, 0, &p2, &p3, &p4); - // if (info_result == sceMcResSucceed) { - // callback = cb_reprobe_load; - // } - // op.retry_count--; - // if (op.retry_count == 0) { - // op.operation = MemoryCardOperationKind::NO_OP; - // op.result = McStatusCode::INTERNAL_ERROR; - // } - // } - //} - // below here is just doing maintenance to look for new/removed memory cards. - // it's cut from the port. we do not use memory cards. just raw saves. - } /* else if (mc[0].state == MemoryCardState::UNKNOWN) { - mc_print("begin probe operation for slot 0"); - // don't know anything about port 0, try and see - p1 = 0; - if (sceMcGetInfo(0, 0, &p2, &p3, &p4) == sceMcResSucceed) { - callback = cb_probe; - } - } else if (mc[1].state == MemoryCardState::UNKNOWN) { - mc_print("begin probe operation for slot 1"); - // don't know anything about port 1, try and see - p1 = 1; - if (sceMcGetInfo(1, 0, &p2, &p3, &p4) == sceMcResSucceed) { - callback = cb_probe; - } - } else if (mc[0].state == MemoryCardState::KNOWN) { - if (mc[0].countdown_to_check == 1) { - // we're about to recheck the memory card. If we're only inknown, reset to unknown so we do a - // completely fresh probe instead of a reprobe. - mc[0].state = MemoryCardState::UNKNOWN; - } - } else if (mc[0].countdown_to_check == 1) { - // it's been a while, do a check and see if the memory card is still there. - p1 = 0; - mc[0].countdown_to_check--; - mc_print("begin reprobe operation for slot 0"); - if (sceMcGetInfo(0, 0, &p2, &p3, &p4) == sceMcResSucceed) { - callback = cb_reprobe; - } - return; - } else { - // decrement port 0's countdown - mc[0].countdown_to_check--; - - // do the same thing for port 1 - if (mc[1].state == MemoryCardState::KNOWN) { - mc[1].countdown_to_check--; - if (mc[1].countdown_to_check == 0) { - // hack - will make us do a probe next time we get here. - mc[1].state = MemoryCardState::UNKNOWN; - } - } else { - mc[1].countdown_to_check--; - if (mc[1].countdown_to_check == 0) { - p1 = 1; - mc_print("begin probe operation for slot 0"); - if (sceMcGetInfo(1, 0, &p2, &p3, &p4) == sceMcResSucceed) { - callback = cb_reprobe; - } - } - } - }*/ -} - -///////////////////////// -// Memory Card Functions -///////////////////////// - -// These functions are called from GOAL to start memory card operations. - -/*! - * Set the language or something. - * Why is this a memory card func? - */ -void MC_set_language(s32 l) { - printf("Language set to %d\n", l); - language = l; -} - -/*! - * Set the current memory card operation to FORMAT the given card. - * Doesn't do anything in the port because we don't use memory cards. - */ -u64 MC_format(s32 /*card_idx*/) { - return u64(McStatusCode::OK); - // u64 can_add = op.operation == MemoryCardOperationKind::NO_OP; - // mc_print("requested format"); - // if (can_add) { - // mc_print("setting op to format"); - // op.operation = MemoryCardOperationKind::FORMAT; - // op.result = McStatusCode::BUSY; - // op.retry_count = 100; - // op.param = card_idx; - //} - // return can_add; -} - -/*! - * Set the current memory card operation to UNFORMAT the given card. - * You get the idea. - */ -u64 MC_unformat(s32 /*card_idx*/) { - return u64(McStatusCode::OK); - // u64 can_add = op.operation == MemoryCardOperationKind::NO_OP; - // mc_print("requested unformat"); - // if (can_add) { - // mc_print("setting op to unformat"); - // op.operation = MemoryCardOperationKind::UNFORMAT; - // op.result = McStatusCode::BUSY; - // op.retry_count = 100; - // op.param = card_idx; - //} - // return can_add; -} - -/*! - * Set the current memory card operation to create the save file. - * The data I believe is just an empty buffer used as temporary storage. - */ -u64 MC_createfile(s32 /*param*/, Ptr /*data*/) { - return u64(McStatusCode::OK); - // u64 can_add = op.operation == MemoryCardOperationKind::NO_OP; - // mc_print("requested createfile"); - // if (can_add) { - // mc_print("setting op to create file"); - // op.operation = MemoryCardOperationKind::CREATE_FILE; - // op.result = McStatusCode::BUSY; - // op.retry_count = 100; - // op.param = param; - // op.data_ptr = data; - //} - // return can_add; -} - -/*! - * Set the current operation to SAVE. - * The "summary data" is data that will be used when previewing save files (number of orbs etc) - * TODO put synchronous call here - */ -u64 MC_save(s32 card_idx, s32 file_idx, Ptr save_data, Ptr save_summary_data) { - mc_print("requested save"); - u64 can_add = op.operation == MemoryCardOperationKind::NO_OP; - if (can_add) { - mc_print("setting op to save"); - op.operation = MemoryCardOperationKind::SAVE; - op.result = McStatusCode::BUSY; - op.retry_count = 100; - op.param = card_idx; - op.param2 = file_idx; - op.data_ptr = save_data; - op.data_ptr2 = save_summary_data; - } - return can_add; -} - -/*! - * Set the current operation to LOAD. - * TODO put synchronous call here - */ -u64 MC_load(s32 card_idx, s32 file_idx, Ptr data) { - mc_print("requested load"); - u64 can_add = op.operation == MemoryCardOperationKind::NO_OP; - if (can_add) { - mc_print("setting op to load"); - op.operation = MemoryCardOperationKind::LOAD; - op.result = McStatusCode::BUSY; - op.retry_count = 100; - op.param = card_idx; - op.param2 = file_idx; - op.data_ptr = data; - } - return can_add; -} - -/*! - * Some sort of test function for memory card stuff. - * This is exported as a GOAL function, but nothing calls it. - */ -void MC_makefile(s32 port, s32 size) { - sceMcMkdir(port, 0, "/BASCUS-00000XXXXXXXX"); - // wait for operation to complete - s32 cmd, result, fd; - sceMcSync(0, &cmd, &result); - - if (result == sceMcResSucceed || result == sceMcResNoEntry) { - // it worked, or the folder already exists... - - // open file - sceMcOpen(port, 0, "/BASCUS-00000XXXXXXXX/BASCUS-00000XXXXXXXX", SCE_CREAT | SCE_WRONLY); - sceMcSync(0, &cmd, &fd); - - if (result < 0) { - printf("Can't open file on memcard [%d]\n", result); - } else { - // write some random crap into the memory card. - sceMcWrite(fd, Ptr(0x1000000).c(), size); - sceMcSync(0, &cmd, &result); - if (result != size) { - printf("Only written %d bytes\n", result); - } - sceMcClose(fd); - sceMcSync(0, &cmd, &result); - } - } else { - printf("Can\'t create garbage folder [%d]\n", result); - } -} - -/*! - * Get the result of the currently executing (or most recently executed) command - */ -u32 MC_check_result() { - return (u32)op.result; -} - -/*! - * Update the info for the given slot. - * You can call this at any time. - * The slot includes the four save slots (8 banks), and a few other files. - */ -void MC_get_status(s32 slot, Ptr info) { - ASSERT(slot == 0); // no memory cards so only allow "slot 0"!!! - - info->handle = 0; - info->known = 0; - info->formatted = 0; - info->initted = 0; - for (s32 i = 0; i < 4; i++) { - info->files[i].present = 0; - } - info->last_file = 0xffffffff; - info->mem_required = SAVE_SIZE; - info->mem_actual = 0; - - pc_update_card(); - info->known = 1; - info->handle = PC_MEM_CARD_HANDLE; - info->formatted = 1; - info->mem_actual = SAVE_SIZE; // idk TODO does this matter? - info->initted = 1; - // copy over the preview data. - for (s32 file = 0; file < 4; file++) { - info->files[file].present = mc_files[file].present; - for (s32 i = 0; i < 64; i++) { // actually a loop over u32's - info->files[file].data[i] = mc_files[file].data[i]; - } - } - info->last_file = mc_last_file; - - /* - switch (mc[slot].state) { - case MemoryCardState::KNOWN: - info->known = 1; - break; - case MemoryCardState::OPEN_BUT_UNFORMATTED: - info->known = 1; - info->handle = mc[slot].handle; - break; - case MemoryCardState::FORMATTED: - info->known = 1; - info->handle = mc[slot].handle; - info->formatted = 1; - if (mc[slot].inited == 0) { - info->mem_actual = mc[slot].mem_size; - } else { - info->initted = 1; - // copy over the preview data. - for (s32 file = 0; file < 4; file++) { - info->files[file].present = mc[slot].files[file].present; - for (s32 i = 0; i < 64; i++) { // actually a loop over u32's - info->files[file].data[i] = mc[slot].files[file].data[i]; - } - } - info->last_file = mc[slot].last_file; - } - break; - case MemoryCardState::UNKNOWN: - break; - }*/ -} - -/*! - * Check for an error. Returns true if there is an error and sets op.result as needed - */ -// u64 cb_check(s32 sony_error, McStatusCode goal_error) { -// if (sony_error < 0) { -// // sony thing failed. -// if (sony_error < -9) { -// // memory card gone. reset state -// mc[p1].state = MemoryCardState::UNKNOWN; -// // kill in progress op -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::BAD_HANDLE; -// return 1; -// } else { -// // return the given GOAL error. -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = goal_error; -// return 1; -// } -// } -// return 0; -//} - -/*! - * Is this sync-result an error? If so, set status to unknown. - */ -// bool cb_pcheck(s32 sync_result) { -// if (sync_result < 0) { -// mc[p1].state = MemoryCardState::UNKNOWN; -// } -// return sync_result < 0; -//} - -/*! - * Callback for sceMcGetInfo for the first time (assumes nothing about the card) - * Cut. We don't use memory cards. - */ -// void cb_probe(s32 sync_result) { -// if (sync_result < -9) { -// // changed card. We have the card, but we don't know anything about it. -// mc[p1].state = MemoryCardState::KNOWN; -// mc[p1].countdown_to_check = 100; -// mc_print("probe: bad sync, trying again in a bit"); -// } else { -// // there is a memory card. -// if (p2 == sceMcTypePS2) { -// // it is the right type. -// // create a new handle -// mc[p1].handle = new_mc_handle(); -// if (p4 == 0) { -// mc_print("probe: got a card, but it's not formatted"); -// // it's not formatted. But open (we have a handle) -// mc[p1].state = MemoryCardState::OPEN_BUT_UNFORMATTED; -// mc[p1].countdown_to_check = 100; -// } else { -// mc_print("probe: got a formatted card, trying getdir"); -// // it's formatted. Get the size -// mc[p1].mem_size = p3; -// p2 = 0; -// -// // and get our jak and daxter directory -// if (sceMcGetDir(p1, 0, filename[0], 0, 1, &dirent) == sceMcResSucceed) { -// callback = cb_getdir; -// } else { -// mc[p1].state = MemoryCardState::UNKNOWN; -// } -// } -// -// } else { -// mc_print("probe: bad card type, trying again in a bit"); -// mc[p1].state = MemoryCardState::KNOWN; -// mc[p1].countdown_to_check = 100; -// } -// } -//} - -/*! - * Callback for sceMcGetDir. This runs again and again to check all files - */ -// void cb_getdir(s32 sync_result) { -// // called after sceMcGetDir -// if (sync_result == 0) { -// // didn't find the jak and daxter dir, or some stuff is missing. -// // call this uninitialized. -// mc[p1].inited = false; -// mc[p1].state = MemoryCardState::FORMATTED; -// mc[p1].countdown_to_check = 100; -// mc[p1].last_file = -1; -// } else if (sync_result == 1) { -// // found whatever we were looking for -// p2++; -// if (p2 == 12) { -// // all done checking for files. -// mc[p1].inited = true; -// mc[p1].countdown_to_check = 100; -// mc[p1].last_file = -1; -// for (int i = 0; i < 4; i++) { -// mc[p1].files[i].present = 0; -// } -// -// // now open file 4, which is the first bank. -// p2 = 4; -// mc_print("opening first bank..."); -// if (sceMcOpen(p1, 0, filename[4], 1) == sceMcResSucceed) { -// callback = cb_check_open; -// } else { -// mc[p1].state = MemoryCardState::UNKNOWN; -// } -// } else { -// // still checking files, check the next one. -// mc_print("checking {}", filename[p2]); -// if (sceMcGetDir(p1, 0, filename[p2], 0, 1, &dirent) == sceMcResSucceed) { -// callback = cb_getdir; -// } else { -// mc[p1].state = MemoryCardState::UNKNOWN; -// } -// } -// } else { -// mc[p1].state = MemoryCardState::UNKNOWN; -// } -//} - -/*! - * Callback for sceMcOpen for opening bank files. - */ -// void cb_check_open(s32 sync_result) { -// if (!cb_pcheck(sync_result)) { -// p3 = sync_result; -// // read the header. -// mc_print("read header"); -// if (sceMcRead(sync_result, &header, sizeof(McHeader)) == sceMcResSucceed) { -// callback = cb_check_read; -// } else { -// mc[p1].state = MemoryCardState::UNKNOWN; -// } -// } -//} - -/*! - * Callback for sceMcRead for reading the header of a bank file. - */ -// void cb_check_read(s32 sync_result) { -// if (!cb_pcheck(sync_result)) { -// if (header.save_count != 0 && // we've saved into this bank -// header.magic == MEM_CARD_MAGIC // looks valid -// ) { -// // each file has two banks. so if you corrupt a save, you hopefully have the other bank. -// // get the file that goes with this bank -// s32 file_idx = (p2 - 4) / 2; -// if (mc_files[file_idx].present == 0 || // haven't found any banks for this file -// header.save_count > mc_files[file_idx].most_recent_save_count // newer than prev. -// ) { -// // this is so far our best guess at the right bank to use. -// mc_files[file_idx].present = 1; -// mc_files[file_idx].most_recent_save_count = header.save_count; -// mc_files[file_idx].last_saved_bank = p2 & 1; -// // copy header data (for GOAL to read) -// for (int i = 0; i < 64; i++) { -// mc_files[file_idx].data[i] = header.preview_data[i]; -// } -// } -// } -// -// if (sceMcClose(p3) == sceMcResSucceed) { -// // close the file -// callback = cb_check_close; -// } else { -// mc[p1].state = MemoryCardState::UNKNOWN; -// } -// } -//} - -/*! - * Callback for closing a file after reading the header - */ -// void cb_check_close(s32 sync_result) { -// if (!cb_pcheck(sync_result)) { -// // next bank. -// p2++; -// if (p2 == 12) { -// // done with banks -// mc[p1].state = MemoryCardState::FORMATTED; -// // and we're done! -// } else { -// // on to the next bank... -// if (sceMcOpen(p1, 0, filename[p2], 1) == sceMcResSucceed) { -// callback = cb_check_open; -// } else { -// mc[p1].state = MemoryCardState::UNKNOWN; -// } -// } -// } -//} - -/*! - * Callback for checking on a known memory card. If it is swapped, will reset. - */ -// void cb_reprobe(s32 sync_result) { -// if (sync_result == sceMcResSucceed) { -// // nobody took out the memory card. try again in 100 frames -// mc[p1].countdown_to_check = 100; -// } else { -// // somebody took it out. reset everything! -// mc[p1].state = MemoryCardState::UNKNOWN; -// } -//} - -/*! - * Callback for probe before formatting. - */ -// void cb_reprobe_format(s32 sync_result) { -// if (sync_result == sceMcResSucceed) { -// // get info succeeded. we can format. -// s32 format_result = sceMcFormat(p1, 0); -// if (format_result == sceMcResSucceed) { -// callback = cb_format_complete; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } else { -// // get info failed. Revert the state to unknown, this will restart everything. -// mc[p1].state = MemoryCardState::UNKNOWN; -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::BAD_HANDLE; -// } -//} - -/*! - * Callback for actual formatting operation - */ -// void cb_format_complete(s32 sync_result) { -// if (sync_result == sceMcResSucceed) { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::OK; -// mc[p1].state = MemoryCardState::FORMATTED; -// mc[p1].countdown_to_check = 100; -// mc[p1].inited = 0; -// for (int i = 0; i < 4; i++) { -// mc[p1].files[i].present = 0; -// } -// mc[p1].last_file = -1; -// mc[p1].mem_size = 8000; -// } else { -// mc[p1].state = MemoryCardState::UNKNOWN; -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::FORMAT_FAILED; -// } -//} - -/*! - * Callback for actual unformatting operation - */ -// void cb_unformat(s32 sync_result) { -// if (sync_result == sceMcResSucceed) { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::OK; -// mc[p1].state = MemoryCardState::UNKNOWN; -// } else { -// mc[p1].state = MemoryCardState::UNKNOWN; -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::FORMAT_FAILED; -// } -//} - -/*! - * Callback for probe before creating save files. - */ -// void cb_reprobe_createfile(s32 sync_result) { -// if (sync_result == sceMcResSucceed) { -// // if the ramdisk is ready, just jump directly to its callback -// if (!RpcBusy(RAMDISK_RPC_CHANNEL)) { -// cb_wait_for_ramdisk(0); -// } else { -// // I think this is a typo and should be cb_reprobe_createfile again. -// callback = cb_wait_for_ramdisk; -// } -// } else { -// mc[p1].state = MemoryCardState::UNKNOWN; -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::BAD_HANDLE; -// } -//} - -/*! - * Actually start the ramdisk load of the icon file to temp buffer - */ -// void cb_wait_for_ramdisk(s32) { -// ramdisk_cmd.pad = 0; -// // caller should have given us a temporary buffer. -// ramdisk_cmd.file_id_or_ee_addr = op.data_ptr.offset; -// ramdisk_cmd.offset_into_file = 0; -// ramdisk_cmd.size = 0x1e800; -// memcpy(ramdisk_cmd.name, "SAVEGAME.ICO", 13); // was 16. -// RpcCall(RAMDISK_RPC_CHANNEL, RAMDISK_BYPASS_LOAD_FILE, 1, &ramdisk_cmd, 0x20, nullptr, 0); -// callback = cb_wait_for_ramdisk_load; -//} - -/*! - * Callback for checking if the ramdisk load is done - */ -// void cb_wait_for_ramdisk_load(s32) { -// if (RpcBusy(RAMDISK_RPC_CHANNEL) == 0) { -// // ramdisk is done. start deleting 12 files -// p2 = 11; // filenames left to delete -// mc_print("start delete {}", filename[11]); -// if (sceMcDelete(p1, 0, filename[11]) == sceMcResSucceed) { -// callback = cb_createfile_erasing; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } else { -// // still waiting... -// callback = cb_wait_for_ramdisk_load; -// } -//} - -/*! - * Callback to start erasing previous save files. - */ -// void cb_createfile_erasing(s32 sync_result) { -// if (sync_result == sceMcResSucceed || sync_result == sceMcResNoEntry || -// sync_result == sceMcResNotEmpty) { -// mc[p1].inited = 0; -// // delete didn't fail. -// if (p2 < 1) { -// // on the last one. move on on to creating the directory again. -// mc_print("create dir {}", filename[0]); -// if (sceMcMkdir(p1, 0, filename[0]) == sceMcResSucceed) { -// callback = cb_createdir; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } else { -// p2--; -// mc_print("delete next {}", filename[p2]); -// if (sceMcDelete(p1, 0, filename[p2]) == sceMcResSucceed) { -// callback = cb_createfile_erasing; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } -// } else { -// if (sync_result == sceMcResDeniedPermit) { -// mc_print("erasing: denied"); -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } else { -// mc_print("erasing: other bad"); -// mc[p1].state = MemoryCardState::UNKNOWN; -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::BAD_HANDLE; -// } -// } -//} - -/*! - * Callback after creating directory for jak save data - */ -// void cb_createdir(s32 sync_result) { -// if (!cb_check(sync_result, McStatusCode::WRITE_ERROR)) { -// // this sets up some stuff for the icon file that we will ignore. -// // memset(&iconsys,0,0x3c4); -// // kstrcpy(&iconsys,&DAT_00137000); -// // if (language == Language::Japanese) { -// // kstrcpy(&DAT_00137560,titles[5]); -// // } else { -// // // non japanese need to convert to shift-JIS format. -// // ASCII2SJIS(&DAT_00137560,titles[language]); -// // } -// // DAT_001374a6 = 0x20; -// // DAT_001374ac = 0; -// // memcpy(&DAT_001374b0,bgcolor.610,0x40); -// // memcpy(&DAT_001374f0,lightdir.611,0x30); -// // memcpy(&DAT_00137520,lightcol.612,0x30); -// // memcpy(&DAT_00137550,ambient.613,0x10); -// // kstrcpy(&DAT_001375a4,"icon.ico"); -// // kstrcpy(&DAT_001375e4,"icon.ico"); -// // kstrcpy(&DAT_00137624,"icon.ico"); -// -// p2 = 1; -// // move on to creating files -// mc_print("starting create file at {}", filename[p2]); -// if (sceMcOpen(p1, 0, filename[1], 0x203) == 0) { -// callback = cb_createdfile; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } -//} - -/*! - * Callback after creating the file. - */ -// void cb_createdfile(s32 sync_result) { -// if (!cb_check(sync_result, McStatusCode::WRITE_ERROR)) { -// mc_print("create file cb {}", filename[p2]); -// if (p2 == 1) { -// p3 = sync_result; // the fd of the icon file. -// // actually would write the icon sys file. -// if (sceMcWrite(sync_result, nullptr, 0) == sceMcResSucceed) { -// callback = cb_writtenfile; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } else if (p2 == 2) { -// p3 = sync_result; -// // would write the icon data (ramdisk loaded into the temp buffer) -// if (sceMcWrite(sync_result, nullptr, 0) == sceMcResSucceed) { -// callback = cb_writtenfile; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } else if (p2 == 3) { -// // writes the aybabtu meme file -// p3 = sync_result; -// kstrcpy(op.data_ptr.cast().c(), "Nope, the save game data isn\'t in this file!\n"); -// if (sceMcWrite(p3, op.data_ptr.c(), strlen((const char*)op.data_ptr.c())) == -// sceMcResSucceed) { -// callback = cb_writtenfile; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } else { -// // writes the actual bank files. -// p3 = sync_result; -// memset(op.data_ptr.c(), 0, 0x11800); -// if (sceMcWrite(p3, op.data_ptr.c(), 0x11800) == sceMcResSucceed) { -// callback = cb_writtenfile; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } -// } -//} - -/*! - * Callback after writing data to files. - */ -// void cb_writtenfile(s32 sync_result) { -// if (!cb_check(sync_result, McStatusCode::WRITE_ERROR)) { -// if (sceMcClose(p3) == sceMcResSucceed) { -// callback = cb_closedfile; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } -//} - -/*! - * Callback after closing the file. - */ -// void cb_closedfile(s32 sync_result) { -// if (!cb_check(sync_result, McStatusCode::WRITE_ERROR)) { -// p2++; -// if (p2 < 12) { -// // open the next one -// if (sceMcOpen(p1, 0, filename[p2], 0x203) == sceMcResSucceed) { -// callback = cb_createdfile; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } else { -// // done! -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::OK; -// -// // save data is inited -// mc[p1].inited = 1; -// // but no files have anything in it. -// for (int i = 0; i < 4; i++) { -// mc[p1].files[i].present = 0; -// } -// mc[p1].last_file = -1; -// } -// } -//} - -/*! - * Callback after check before saving. - */ -// void cb_reprobe_save(s32 sync_result) { -// if (sync_result == sceMcResSucceed) { -// if (!mc[p1].files[op.param2].present) { -// mc_print("reprobe save: first time!"); -// // first time saving! -// p2 = 0; // save count 0 -// p4 = 0; // first bank for file -// } else { -// p2 = mc_files[op.param2].most_recent_save_count + 1; // increment save count -// p4 = mc_files[op.param2].last_saved_bank ^ 1; // use the other bank -// } -// -// // reserve 0 as "I never saved" and use 1 instead. -// if (p2 == 0) { -// p2 = 1; -// } -// -// // file*2 + p4 is the bank (2 banks per file, p4 is 0 or 1 to select the bank) -// // 4 is the first bank file -// mc_print("open {} for saving", filename[op.param2 * 2 + 4 + p4]); -// if (sceMcOpen(p1, 0, filename[op.param2 * 2 + 4 + p4], 2) == sceMcResSucceed) { -// callback = cb_openedsave; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } else { -// // mc[p1].state = MemoryCardState::UNKNOWN; -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::BAD_HANDLE; -// } -//} -// -// void cb_openedsave(s32 sync_result) { -// mc_print("save file opened, writing header..."); -// if (!cb_check(sync_result, McStatusCode::WRITE_ERROR)) { -// p3 = sync_result; -// memset(&header, 0, sizeof(McHeader)); -// header.save_count = p2; -// header.checksum = mc_checksum(op.data_ptr, BANK_SIZE); -// header.magic = MEM_CARD_MAGIC; -// header.unk1_repeated = p2; -// for (int i = 0; i < 64; i++) { -// header.preview_data[i] = op.data_ptr2.c()[i]; -// } -// if (sceMcWrite(p3, &header, sizeof(McHeader)) == sceMcResSucceed) { -// callback = cb_savedheader; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } -//} -// -// void cb_savedheader(s32 sync_result) { -// mc_print("save file writing main data"); -// if (!cb_check(sync_result, McStatusCode::WRITE_ERROR)) { -// if (sceMcWrite(p3, op.data_ptr.c(), BANK_SIZE) == sceMcResSucceed) { -// callback = cb_saveddata; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } -//} -// -// void cb_saveddata(s32 sync_result) { -// mc_print("save file writing footer"); -// if (!cb_check(sync_result, McStatusCode::WRITE_ERROR)) { -// if (sceMcWrite(p3, &header, sizeof(McHeader)) == sceMcResSucceed) { -// callback = cb_savedfooter; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } -//} -// -// void cb_savedfooter(s32 sync_result) { -// mc_print("closing after save"); -// if (!cb_check(sync_result, McStatusCode::WRITE_ERROR)) { -// if (sceMcClose(p3) == sceMcResSucceed) { -// callback = cb_closedsave; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } -//} -// -// void cb_closedsave(s32 sync_result) { -// if (!cb_check(sync_result, McStatusCode::WRITE_ERROR)) { -// mc_print("All done with saving!!"); -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::OK; -// // mc_files[op.param2].present = 1; -// mc_files[op.param2].most_recent_save_count = p2; -// mc_files[op.param2].last_saved_bank = p4; -// for (int i = 0; i < 64; i++) { -// mc_files[op.param2].data[i] = op.data_ptr2.c()[i]; -// } -// mc_last_file = op.param2; -// flush_memory_card_to_file(); -// } -//} -// -// void cb_reprobe_load(s32 sync_result) { -// if (sync_result == 0) { -// p2 = 0; -// mc_print("opening save file {}", filename[op.param2 * 2 + 4]); -// if (sceMcOpen(p1, 0, filename[op.param2 * 2 + 4], 1) == sceMcResSucceed) { -// callback = cb_openedload; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } else { -// // mc[p1].state = MemoryCardState::UNKNOWN; -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::BAD_HANDLE; -// } -//} -// -// void cb_openedload(s32 sync_result) { -// if (cb_check(sync_result, McStatusCode::READ_ERROR) == 0) { -// p3 = sync_result; -// size_t read_size = BANK_TOTAL_SIZE; -// mc_print("reading save file..."); -// if (sceMcRead(sync_result, op.data_ptr.c() + p2 * read_size, read_size) == sceMcResSucceed) { -// callback = cb_readload; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } -//} -// -// void cb_readload(s32 sync_result) { -// if (cb_check(sync_result, McStatusCode::READ_ERROR) == 0) { -// mc_print("closing save file.."); -// if (sceMcClose(p3) == sceMcResSucceed) { -// callback = cb_closedload; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } -//} -// -// void cb_closedload(s32 sync_result) { -// if (cb_check(sync_result, McStatusCode::READ_ERROR) == 0) { -// p2++; -// if (p2 < 2) { -// mc_print("reading next save bank {}", filename[op.param2 * 2 + 4 + p2]); -// if (sceMcOpen(p1, 0, filename[op.param2 * 2 + 4 + p2], 1) == sceMcResSucceed) { -// callback = cb_openedload; -// } else { -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::INTERNAL_ERROR; -// } -// } else { -// // let's verify the data. -// McHeader* headers[2]; -// McHeader* footers[2]; -// bool ok[2]; -// -// headers[0] = (McHeader*)(op.data_ptr.c()); -// footers[0] = (McHeader*)(op.data_ptr.c() + sizeof(McHeader) + BANK_SIZE); -// headers[1] = (McHeader*)(op.data_ptr.c() + BANK_TOTAL_SIZE); -// footers[1] = (McHeader*)(op.data_ptr.c() + BANK_TOTAL_SIZE + sizeof(McHeader) + BANK_SIZE); -// static_assert(BANK_TOTAL_SIZE * 2 == 0x21000, "save layout"); -// ok[0] = true; -// ok[1] = true; -// -// for (int idx = 0; idx < 2; idx++) { -// u32 expected_save_count = headers[idx]->save_count; -// if (headers[idx]->unk1_repeated == expected_save_count && -// footers[idx]->save_count == expected_save_count && -// footers[idx]->unk1_repeated == expected_save_count) { -// // save count is okay! -// if (headers[idx]->magic == MEM_CARD_MAGIC && footers[idx]->magic == MEM_CARD_MAGIC) { -// // magic numbers okay! -// if (headers[idx]->checksum == footers[idx]->checksum) { -// // checksum -// auto expected_checksum = headers[idx]->checksum; -// if (mc_checksum(make_u8_ptr(headers[idx] + 1), BANK_SIZE) != expected_checksum) { -// mc_print("failed checksum"); -// ok[idx] = false; -// } -// } else { -// mc_print("corrupted checksum"); -// ok[idx] = false; -// } -// } else { -// mc_print("bad magic"); -// ok[idx] = false; -// } -// } else { -// mc_print("bad save count"); -// ok[idx] = false; -// } -// } -// -// mc_print("checking loaded banks"); -// -// // -// if (!ok[0] && !ok[1]) { -// // no good data. -// if (headers[0]->save_count == 0 && headers[0]->checksum == 0 && headers[0]->magic == 0 && -// headers[0]->unk1_repeated == 0 && headers[1]->save_count == 0 && -// headers[1]->checksum == 0 && headers[1]->magic == 0 && headers[1]->unk1_repeated == 0) -// { -// // this is a fresh file that you tried to load from... -// mc_print("new game result"); -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::NEW_GAME; -// mc_last_file = op.param2; -// } else { -// mc_print("corrupted data"); -// op.operation = MemoryCardOperationKind::NO_OP; -// op.result = McStatusCode::READ_ERROR; -// } -// } else { -// // pick the bank -// int bank = 0; -// -// if (!ok[0] || !ok[1]) { -// if (ok[1]) { -// bank = 1; -// } -// } else { -// bank = headers[0]->save_count <= headers[1]->save_count; -// } -// -// u32 current_save_count = headers[bank]->save_count; -// memcpy(op.data_ptr.c(), op.data_ptr.c() + bank * BANK_TOTAL_SIZE + sizeof(McHeader), -// BANK_SIZE); mc_last_file = op.param2; mc_files[op.param2].most_recent_save_count = -// current_save_count; mc_files[op.param2].last_saved_bank = bank; op.operation = -// MemoryCardOperationKind::NO_OP; op.result = McStatusCode::OK; mc_print("load succeeded"); -// } -// } -// } -//} diff --git a/game/kernel/ksound.h b/game/kernel/ksound.h deleted file mode 100644 index 865de08950..0000000000 --- a/game/kernel/ksound.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -/*! - * @file ksound.h - * There's not much here. My guess is this was set up as framework to match the kmachine.cpp format, - * but whoever did the sound didn't use this. - */ - -#ifndef JAK_KSOUND_H -#define JAK_KSOUND_H - -void InitSound(); -void ShutdownSound(); -void InitSoundScheme(); - -#endif // JAK_KSOUND_H diff --git a/game/main.cpp b/game/main.cpp index 93b44ba7ce..d689fde7a3 100644 --- a/game/main.cpp +++ b/game/main.cpp @@ -4,16 +4,23 @@ */ #include + #include "runtime.h" -#include "common/versions.h" + #include "common/log/log.h" #include "common/util/FileUtil.h" -#include "game/discord.h" #include "common/util/os.h" +#include "common/versions.h" + +#include "game/discord.h" // Discord RPC extern int64_t gStartTime; +/*! + * Set up logging system to log to file. + * @param verbose : should we print debug-level messages to stdout? + */ void setup_logging(bool verbose) { lg::set_file(file_util::get_file_path({"log/game.txt"})); if (verbose) { @@ -21,24 +28,29 @@ void setup_logging(bool verbose) { lg::set_stdout_level(lg::level::debug); lg::set_flush_level(lg::level::debug); } else { - lg::set_file_level(lg::level::warn); + lg::set_file_level(lg::level::debug); lg::set_stdout_level(lg::level::warn); lg::set_flush_level(lg::level::warn); } lg::initialize(); } +/*! + * Entry point for the game. + */ int main(int argc, char** argv) { - // do this as soon as possible - stuff like memcpy might use AVX instructions and we want to - // warn the user instead of just crashing. + // Figure out if the CPU has AVX2 to enable higher performance AVX2 versions of functions. setup_cpu_info(); + // If the CPU doesn't have AVX, GOAL code won't work and we exit. if (!get_cpu_info().has_avx) { printf("Your CPU does not support AVX, which is required for OpenGOAL.\n"); return -1; } + // parse arguments bool verbose = false; bool disable_avx2 = false; + std::optional project_path_override = std::nullopt; for (int i = 1; i < argc; i++) { if (std::string("-v") == argv[i]) { verbose = true; @@ -48,9 +60,20 @@ int main(int argc, char** argv) { if (std::string("-no-avx2") == argv[i]) { disable_avx2 = true; } + + if (std::string("-proj-path") == argv[i] && i + 1 < argc) { + project_path_override = std::make_optional(std::filesystem::path(argv[i + 1])); + } } - gStartTime = time(0); + // set up file paths for resources. This is the full repository when developing, and the data + // directory (a subset of the full repo) in release versions + if (!file_util::setup_project_path(project_path_override)) { + return 1; + } + + // set up discord stuff + gStartTime = time(nullptr); init_discord_rpc(); if (disable_avx2) { @@ -61,7 +84,7 @@ int main(int argc, char** argv) { #ifndef __AVX2__ if (get_cpu_info().has_avx2) { - printf("Note: your CPU supports AVX2, but this build was not compiled with AVX2 support\n"); + // printf("Note: your CPU supports AVX2, but this build was not compiled with AVX2 support\n"); get_cpu_info().has_avx2 = false; } #endif @@ -74,12 +97,35 @@ int main(int argc, char** argv) { setup_logging(verbose); + bool force_debug_next_time = false; while (true) { + std::vector args; + for (int i = 0; i < argc; i++) { + args.push_back(argv[i]); + } + if (force_debug_next_time) { + args.push_back("-boot"); + args.push_back("-debug"); + force_debug_next_time = false; + } + std::vector ptrs; + for (auto& str : args) { + ptrs.push_back(str.data()); + } + // run the runtime in a loop so we can reset the game and have it restart cleanly lg::info("OpenGOAL Runtime {}.{}", versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR); + auto exit_status = exec_runtime(ptrs.size(), ptrs.data()); - if (exec_runtime(argc, argv) == 2) { - return 0; + switch (exit_status) { + case RuntimeExitStatus::EXIT: + return 0; + case RuntimeExitStatus::RESTART_RUNTIME: + case RuntimeExitStatus::RUNNING: + break; + case RuntimeExitStatus::RESTART_IN_DEBUG: + force_debug_next_time = true; + break; } } return 0; diff --git a/game/mips2c/functions/bones.cpp b/game/mips2c/functions/bones.cpp index 3a2a91b70c..dcd4aa6f30 100644 --- a/game/mips2c/functions/bones.cpp +++ b/game/mips2c/functions/bones.cpp @@ -2,7 +2,8 @@ //--------------------------MIPS2C--------------------- // clang-format off #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +#include "game/kernel/jak1/kscheme.h" +using namespace jak1; namespace Mips2C { namespace bones_mtx_calc { @@ -691,7 +692,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace draw_bones_merc { struct Cache { @@ -700,6 +701,51 @@ struct Cache { void* fake_scratchpad_data; } cache; +/* + (deftype merc-effect-bucket-info (structure) + ((color-fade rgba :offset-assert 0) + (use-mercneric uint8 :offset-assert 4) + (ignore-alpha uint8 :offset-assert 5) + (pad0 uint8 :offset-assert 6) + (pad1 uint8 :offset-assert 7) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; information for everything being submitted. +(deftype merc-bucket-info (structure) + ((light vu-lights :inline :offset-assert 0) + (needs-clip int32 :offset-assert 112) + (need-mercprime-if-merc int32 :offset-assert 116) + (must-use-mercneric-for-clip int32 :offset-assert 120) + (effect merc-effect-bucket-info 16 :inline :offset-assert 124) + ) + :method-count-assert 9 + :size-assert #xfc + :flag-assert #x9000000fc + ) + */ + +struct MercEffectBucketInfo { + u8 color_fade[4]; + u8 use_mercneric; + u8 ignore_alpha; + u8 pad0; + u8 pad1; +}; + +struct MercBucketInfo { + u8 lights[0x70]; + u32 needs_clip; + u32 mercprime; + u32 mercneric; + MercEffectBucketInfo effects[16]; +}; +static_assert(sizeof(MercBucketInfo) == 0xfc); + u64 execute(void* ctxt) { auto* c = (ExecutionContext*)ctxt; bool bc = false; @@ -714,20 +760,20 @@ u64 execute(void* ctxt) { c->sq(gp, 112, sp); // sq gp, 112(sp) c->mov64(t8, a3); // or t8, a3, r0 c->mov64(v1, t0); // or v1, t0, r0 - c->lui(t0, 4096); // lui t0, 4096 - c->lui(t1, 18304); // lui t1, 18304 + c->lui(t0, 4096); // lui t0, 4096 0x1000 + c->lui(t1, 18304); // lui t1, 18304 0x4780 c->daddiu(t0, t0, 1); // daddiu t0, t0, 1 c->dsll32(t1, t1, 0); // dsll32 t1, t1, 0 - c->lui(a3, 12288); // lui a3, 12288 - c->lui(t7, 19201); // lui t7, 19201 + c->lui(a3, 12288); // lui a3, 12288 0x3000 + c->lui(t7, 19201); // lui t7, 19201 0x4B01 c->pcpyld(t0, a3, t0); // pcpyld t0, a3, t0 c->lbu(a3, 58, a0); // lbu a3, 58(a0) c->pcpyld(t1, t7, t1); // pcpyld t1, t7, t1 - c->lui(t2, 28160); // lui t2, 28160 + c->lui(t2, 28160); // lui t2, 28160 0x6E00 c->addiu(t7, r0, 8); // addiu t7, r0, 8 c->multu3(a3, a3, t7); // multu3 a3, a3, t7 - c->lui(t3, 1280); // lui t3, 1280 - c->lui(t4, 27648); // lui t4, 27648 + c->lui(t3, 1280); // lui t3, 1280 0x500 + c->lui(t4, 27648); // lui t4, 27648 0x6C00 c->dsll32(t2, t2, 0); // dsll32 t2, t2, 0 c->dsll32(t4, t4, 0); // dsll32 t4, t4, 0 c->daddu(t4, t4, t3); // daddu t4, t4, t3 @@ -735,11 +781,11 @@ u64 execute(void* ctxt) { c->daddiu(t3, t3, 1); // daddiu t3, t3, 1 c->daddu(a0, a3, a0); // daddu a0, a3, a0 c->pcpyld(t2, t2, r0); // pcpyld t2, t2, r0 - c->lw(t7, 24, a0); // lw t7, 24(a0) + c->lw(t7, 24, a0); // lw t7, 24(a0) // load the merc-ctrl! c->pcpyld(t3, t3, r0); // pcpyld t3, t3, r0 c->pcpyld(t4, t4, r0); // pcpyld t4, t4, r0 c->mov64(a0, a2); // or a0, a2, r0 - c->lui(t5, 12288); // lui t5, 12288 + c->lui(t5, 12288); // lui t5, 12288 // 0x3000 c->lui(t6, 4096); // lui t6, 4096 c->daddiu(t5, t5, 7); // daddiu t5, t5, 7 c->lui(t9, 5120); // lui t9, 5120 @@ -748,144 +794,194 @@ u64 execute(void* ctxt) { c->dsll32(a3, a3, 0); // dsll32 a3, a3, 0 c->dsll32(t9, t8, 0); // dsll32 t9, t8, 0 c->pcpyld(t5, a3, t5); // pcpyld t5, a3, t5 - c->lwu(t8, 52, t7); // lwu t8, 52(t7) + c->lwu(t8, 52, t7); // lwu t8, 52(t7) // effect count. c->pcpyld(t6, t9, t6); // pcpyld t6, t9, t6 - c->daddiu(t9, t7, 108); // daddiu t9, t7, 108 + c->daddiu(t9, t7, 108); // daddiu t9, t7, 108 // the actual merc-effect c->load_symbol(a3, cache.merc_bucket_info); // lw a3, *merc-bucket-info*(s7) - c->daddiu(ra, a3, 124); // daddiu ra, a3, 124 + // PC HACK: built a bitmask of which effects end up using mercneric. + const MercBucketInfo* mbi = (const MercBucketInfo*)(g_ee_main_mem + c->sgpr64(a3)); + u16 use_pc_merc_bits = 0; + u16 ignore_alpha_bits = 0; + for (int i = 0; i < 16; i++) { + if (!mbi->effects[i].use_mercneric) { + use_pc_merc_bits |= (1 << i); + } + if (mbi->effects[i].ignore_alpha) { + ignore_alpha_bits |= (1 << i); + } + } + + c->daddiu(ra, a3, 124); // daddiu ra, a3, 124 // effect bucket infos + + // effect loop! block_1: - c->lbu(gp, 4, ra); // lbu gp, 4(ra) + c->lbu(gp, 4, ra); // lbu gp, 4(ra) effect.use-mercneric c->load_symbol(a3, cache.merc_global_stats); // lw a3, *merc-global-stats*(s7) c->daddu(a3, r0, a3); // daddu a3, r0, a3 bc = c->sgpr64(gp) != 0; // bne gp, r0, L77 - c->lhu(s4, 2, a3); // lhu s4, 2(a3) - if (bc) {goto block_11;} // branch non-likely + c->lhu(s4, 2, a3); // lhu s4, 2(a3) merc-global-stats.merc.fragments + if (bc) {goto block_11;} // branch non-likely skip mercneric effects - c->lhu(s3, 18, t9); // lhu s3, 18(t9) - c->lwu(gp, 4, a3); // lwu gp, 4(a3) - c->lhu(s5, 22, t9); // lhu s5, 22(t9) - c->daddu(s4, s4, s3); // daddu s4, s4, s3 - c->lwu(s3, 8, a3); // lwu s3, 8(a3) - c->lhu(s2, 24, t9); // lhu s2, 24(t9) - c->daddu(gp, gp, s5); // daddu gp, gp, s5 - c->sh(s4, 2, a3); // sh s4, 2(a3) - c->sw(gp, 4, a3); // sw gp, 4(a3) - c->daddu(s5, s3, s2); // daddu s5, s3, s2 - c->lwu(t2, 0, t9); // lwu t2, 0(t9) - c->lwu(gp, 4, t9); // lwu gp, 4(t9) - c->lui(s4, 12288); // lui s4, 12288 - c->dsll32(t2, t2, 0); // dsll32 t2, t2, 0 - c->sw(s5, 8, a3); // sw s5, 8(a3) - c->or_(t2, t2, s4); // or t2, t2, s4 - c->addiu(s5, r0, 0); // addiu s5, r0, 0 - c->lhu(s4, 18, t9); // lhu s4, 18(t9) + // ra is the effect-info + // t9 is the effect + // a3 is merc-global-stats + c->lhu(s3, 18, t9); // lhu s3, 18(t9) // s3 = effect.frag-count + c->lwu(gp, 4, a3); // lwu gp, 4(a3) // gp = global-stats.merc.tris + c->lhu(s5, 22, t9); // lhu s5, 22(t9) // s5 = merc-effect.tri-count + c->daddu(s4, s4, s3); // daddu s4, s4, s3 // inc frag count + c->lwu(s3, 8, a3); // lwu s3, 8(a3) // s3 = global-stats.merc.dverts + c->lhu(s2, 24, t9); // lhu s2, 24(t9) // s2 = merc-effect.dvert-count + c->daddu(gp, gp, s5); // daddu gp, gp, s5 // inc tri count + c->sh(s4, 2, a3); // sh s4, 2(a3) // store frag count + c->sw(gp, 4, a3); // sw gp, 4(a3) // store tri count + c->daddu(s5, s3, s2); // daddu s5, s3, s2 // inc dvert count + c->lwu(t2, 0, t9); // lwu t2, 0(t9) // t2 = merc-fragment + c->lwu(gp, 4, t9); // lwu gp, 4(t9) // gp = merc-fragment-control + c->lui(s4, 12288); // lui s4, 12288 // dma thing? + c->dsll32(t2, t2, 0); // dsll32 t2, t2, 0 // dma merc-fragment + c->sw(s5, 8, a3); // sw s5, 8(a3) // store dvert stats + c->or_(t2, t2, s4); // or t2, t2, s4 // lower 64 of dma tag? + c->addiu(s5, r0, 0); // addiu s5, r0, 0 // s5 = 0 (frag counter) + c->lhu(s4, 18, t9); // lhu s4, 18(t9) // s4 = effect.frag-count - block_3: - c->lbu(s0, 0, gp); // lbu s0, 0(gp) + // fragment loop + // (note: frag 0 gets added before header) + // 0 = strow tag + // 16 = strow data + // 32 = + // DMA: 0xe1e903000000f + // vif0: 0x0 + // vif1: 0x6e39c08c + // unpack8 (top true): 140, 57 + + +block_3: + c->lbu(s0, 0, gp); // lbu s0, 0(gp) // s0 = fragment-control.unsigned-four-count (4-byte word count in EE mem) // nop // sll r0, r0, 0 - c->lbu(s2, 1, gp); // lbu s2, 1(gp) - c->xori(s1, r0, 49292); // xori s1, r0, 49292 - c->lbu(s3, 2, gp); // lbu s3, 2(gp) - c->daddiu(v0, s0, 3); // daddiu v0, s0, 3 - c->lw(a3, 44, t7); // lw a3, 44(t7) - c->srl(v0, v0, 2); // srl v0, v0, 2 - c->sq(t0, 0, a2); // sq t0, 0(a2) - c->xor_(t2, t2, v0); // xor t2, t2, v0 - c->sq(t2, 32, a2); // sq t2, 32(a2) - c->xor_(t2, t2, v0); // xor t2, t2, v0 - c->sh(s1, 44, a2); // sh s1, 44(a2) - c->daddu(s1, s1, s0); // daddu s1, s1, s0 - c->sb(s0, 46, a2); // sb s0, 46(a2) - c->dsll32(s0, v0, 4); // dsll32 s0, v0, 4 - c->daddu(t3, t2, s0); // daddu t3, t2, s0 - c->daddiu(s0, s2, 3); // daddiu s0, s2, 3 - c->sw(a3, 12, a2); // sw a3, 12(a2) - c->srl(s0, s0, 2); // srl s0, s0, 2 - c->sq(t1, 16, a2); // sq t1, 16(a2) + c->lbu(s2, 1, gp); // lbu s2, 1(gp) // s2 = fragment-control.lump-four-count + c->xori(s1, r0, 49292); // xori s1, r0, 49292 // maybe vif crap 0xC08C + c->lbu(s3, 2, gp); // lbu s3, 2(gp) // s3 = fragment-control.fp-qwc + c->daddiu(v0, s0, 3); // daddiu v0, s0, 3 // v0 = unsigned-four-count + 3 + c->lw(a3, 44, t7); // lw a3, 44(t7) // a3 = merc-ctrl.header.st-vif-add + c->srl(v0, v0, 2); // srl v0, v0, 2 // v0 = qwc to transfer for unsigned-four-count + + c->sq(t0, 0, a2); // sq t0, 0(a2) // dma/vif template for strow setup + + c->xor_(t2, t2, v0); // xor t2, t2, v0 // add qwc + c->sq(t2, 32, a2); // sq t2, 32(a2) // this is the 0xC08C first unpack 8 with top. always to 140. unsigned-four data. + c->xor_(t2, t2, v0); // xor t2, t2, v0 // remove qwc + c->sh(s1, 44, a2); // sh s1, 44(a2) // here's the 0xc08c store + + c->daddu(s1, s1, s0); // daddu s1, s1, s0 // s1 is VU data ptr (qw), inc by number of 4 byte words because we're unpacking 4x. + c->sb(s0, 46, a2); // sb s0, 46(a2) // store qw to unpack in viftag (output qw's) + c->dsll32(s0, v0, 4); // dsll32 s0, v0, 4 // qw -> bytes for input unsigned-fours (add offset to addr field of dma tag, it's 4 + 32 bit shift) + c->daddu(t3, t2, s0); // daddu t3, t2, s0 // t3 = next + c->daddiu(s0, s2, 3); // daddiu s0, s2, 3 // s0 = lump-four-count + 3 + c->sw(a3, 12, a2); // sw a3, 12(a2) // st-vif-add's x. + c->srl(s0, s0, 2); // srl s0, s0, 2 // lump fours / 4 + c->sq(t1, 16, a2); // sq t1, 16(a2) // row y (will be overwritten) z w (nop). + // PC HACK: sneak in the bits here: + memcpy(g_ee_main_mem + c->sgpr64(a2) + 28, &use_pc_merc_bits, 2); + memcpy(g_ee_main_mem + c->sgpr64(a2) + 30, &ignore_alpha_bits, 2); + + + // store the dma tag for the lump fours c->xor_(t3, t3, s0); // xor t3, t3, s0 c->sq(t3, 48, a2); // sq t3, 48(a2) c->xor_(t3, t3, s0); // xor t3, t3, s0 - c->sh(s1, 60, a2); // sh s1, 60(a2) - c->daddu(s1, s1, s2); // daddu s1, s1, s2 - c->sb(s2, 62, a2); // sb s2, 62(a2) - c->dsll32(s2, s0, 4); // dsll32 s2, s0, 4 - c->sw(a3, 16, a2); // sw a3, 16(a2) - c->daddu(t4, t3, s2); // daddu t4, t3, s2 - c->xor_(t4, t4, s3); // xor t4, t4, s3 + + c->sh(s1, 60, a2); // sh s1, 60(a2) // lump 4 destination. + c->daddu(s1, s1, s2); // daddu s1, s1, s2 // inc VU dest ptr + c->sb(s2, 62, a2); // sb s2, 62(a2) // unpack qwc + c->dsll32(s2, s0, 4); // dsll32 s2, s0, 4 // EE bytes + c->sw(a3, 16, a2); // sw a3, 16(a2) // row y overwrite with st-vif-add + c->daddu(t4, t3, s2); // daddu t4, t3, s2 // next dma + c->xor_(t4, t4, s3); // xor t4, t4, s3 // fp-qwc c->xori(a3, s1, 16384); // xori a3, s1, 16384 - c->sq(t4, 64, a2); // sq t4, 64(a2) + c->sq(t4, 64, a2); // sq t4, 64(a2) // dma for fp's c->xor_(t4, t4, s3); // xor t4, t4, s3 - c->sb(s3, 78, a2); // sb s3, 78(a2) - c->dsll32(s3, s3, 4); // dsll32 s3, s3, 4 - c->sh(a3, 76, a2); // sh a3, 76(a2) - c->daddu(t2, t4, s3); // daddu t2, t4, s3 - c->lbu(s3, 3, gp); // lbu s3, 3(gp) - c->daddiu(gp, gp, 4); // daddiu gp, gp, 4 + c->sb(s3, 78, a2); // sb s3, 78(a2) // unpack qwc + c->dsll32(s3, s3, 4); // dsll32 s3, s3, 4 // bytes (in upper 32) + c->sh(a3, 76, a2); // sh a3, 76(a2) // destination in VU + c->daddu(t2, t4, s3); // daddu t2, t4, s3 // next dma + c->lbu(s3, 3, gp); // lbu s3, 3(gp) // frag-ctrl.mat-xfer-count + c->daddiu(gp, gp, 4); // daddiu gp, gp, 4 // gp = frag-ctrl.mat-dest-data + + // skip ahead if on not-first fragment. bc = c->sgpr64(s5) != 0; // bne s5, r0, L73 c->daddiu(a2, a2, 80); // daddiu a2, a2, 80 if (bc) {goto block_5;} // branch non-likely + // on first, need to set up lights and stuff common to all fragments. + // setup 8 qw upload (132 - 140) c->sd(t6, 0, a2); // sd t6, 0(a2) c->addiu(s2, r0, 8); // addiu s2, r0, 8 c->sd(t6, 8, a2); // sd t6, 8(a2) c->lui(a3, 27656); // lui a3, 27656 c->sb(s2, 0, a2); // sb s2, 0(a2) - c->daddiu(a3, a3, 132); // daddiu a3, a3, 132 + c->daddiu(a3, a3, 132); // daddiu a3, a3, 132 // (inc global dma buf) + c->load_symbol(s2, cache.merc_bucket_info); // lw s2, *merc-bucket-info*(s7) c->daddu(s2, r0, s2); // daddu s2, r0, s2 c->sw(a3, 12, a2); // sw a3, 12(a2) - c->lq(a3, 0, s2); // lq a3, 0(s2) - c->lq(s1, 16, s2); // lq s1, 16(s2) - c->lq(s0, 32, s2); // lq s0, 32(s2) - c->lq(v0, 48, s2); // lq v0, 48(s2) - c->sq(a3, 16, a2); // sq a3, 16(a2) - c->sq(s1, 32, a2); // sq s1, 32(a2) - c->sq(s0, 48, a2); // sq s0, 48(a2) - c->sq(v0, 64, a2); // sq v0, 64(a2) - c->lq(a3, 64, s2); // lq a3, 64(s2) - c->lq(s1, 80, s2); // lq s1, 80(s2) - c->lq(s0, 96, s2); // lq s0, 96(s2) - c->lui(v0, 16261); // lui v0, 16261 - c->lq(s2, 28, t7); // lq s2, 28(t7) - c->daddiu(v0, v0, 619); // daddiu v0, v0, 619 - c->sq(a3, 80, a2); // sq a3, 80(a2) - c->lbu(a3, 5, ra); // lbu a3, 5(ra) - c->sq(s1, 96, a2); // sq s1, 96(a2) - c->sq(s0, 112, a2); // sq s0, 112(a2) - c->dsubu(a3, v0, a3); // dsubu a3, v0, a3 + + c->lq(a3, 0, s2); // lq a3, 0(s2) // load l0 + c->lq(s1, 16, s2); // lq s1, 16(s2) // load l1 + c->lq(s0, 32, s2); // lq s0, 32(s2) // load l2 + c->lq(v0, 48, s2); // lq v0, 48(s2) // load l3 + c->sq(a3, 16, a2); // sq a3, 16(a2) // store l0 + c->sq(s1, 32, a2); // sq s1, 32(a2) // store l1 + c->sq(s0, 48, a2); // sq s0, 48(a2) // store l2 + c->sq(v0, 64, a2); // sq v0, 64(a2) // store l3 + c->lq(a3, 64, s2); // lq a3, 64(s2) // load l4 + c->lq(s1, 80, s2); // lq s1, 80(s2) // load l5 + c->lq(s0, 96, s2); // lq s0, 96(s2) // load l6 + c->lui(v0, 16261); // lui v0, 16261 // 0x3F85 + c->lq(s2, 28, t7); // lq s2, 28(t7) // first qw of merc-ctrl header. + c->daddiu(v0, v0, 619); // daddiu v0, v0, 619 // 0x26B + c->sq(a3, 80, a2); // sq a3, 80(a2) // store l4 + c->lbu(a3, 5, ra); // lbu a3, 5(ra) // effect-info.ignore-alpha + c->sq(s1, 96, a2); // sq s1, 96(a2) // store l5 + c->sq(s0, 112, a2); // sq s0, 112(a2) // store l6 + c->dsubu(a3, v0, a3); // dsubu a3, v0, a3 // c->sq(s2, 128, a2); // sq s2, 128(a2) c->sw(a3, 28, a2); // sw a3, 28(a2) c->daddiu(a2, a2, 144); // daddiu a2, a2, 144 + // after first frag setup block_5: bc = c->sgpr64(s3) == 0; // beq s3, r0, L75 - c->addiu(s2, r0, 128); // addiu s2, r0, 128 + c->addiu(s2, r0, 128); // addiu s2, r0, 128 // s2 = mat size if (bc) {goto block_8;} // branch non-likely - c->lbu(a3, 0, gp); // lbu a3, 0(gp) + c->lbu(a3, 0, gp); // lbu a3, 0(gp) // a3 = mat-number block_7: - c->multu3(s1, a3, s2); // multu3 s1, a3, s2 - c->sq(t5, 0, a2); // sq t5, 0(a2) - c->lbu(s0, 1, gp); // lbu s0, 1(gp) - c->daddiu(gp, gp, 2); // daddiu gp, gp, 2 - c->lbu(a3, 0, gp); // lbu a3, 0(gp) - c->daddiu(s3, s3, -1); // daddiu s3, s3, -1 - c->sb(s0, 12, a2); // sb s0, 12(a2) - c->daddiu(a2, a2, 16); // daddiu a2, a2, 16 - c->daddu(s1, s1, a1); // daddu s1, s1, a1 + c->multu3(s1, a3, s2); // multu3 s1, a3, s2 // s1 = mat-number * 128 + c->sq(t5, 0, a2); // sq t5, 0(a2) // dma template + c->lbu(s0, 1, gp); // lbu s0, 1(gp) // s0 = mat-dest + c->daddiu(gp, gp, 2); // daddiu gp, gp, 2 // inc mat-dest-data pr + + // HACK for PC PORT: stash the source matrix number in the unused bits of nop viftag. + c->sb(a3, 8, a2); + + c->lbu(a3, 0, gp); // lbu a3, 0(gp) // load for next iter (ugh) + c->daddiu(s3, s3, -1); // daddiu s3, s3, -1 // dec count + c->sb(s0, 12, a2); // sb s0, 12(a2) // store matrix destination. + c->daddiu(a2, a2, 16); // daddiu a2, a2, 16 // increment dma output. + c->daddu(s1, s1, a1); // daddu s1, s1, a1 // matrix data + 128 * mat-number // nop // sll r0, r0, 0 - bc = c->sgpr64(s3) != 0; // bne s3, r0, L74 - c->sw(s1, -12, a2); // sw s1, -12(a2) + bc = c->sgpr64(s3) != 0; // bne s3, r0, L74 // see if we're done + c->sw(s1, -12, a2); // sw s1, -12(a2) // store pointer in input matrix data in dma tag if (bc) {goto block_7;} // branch non-likely block_8: - c->sq(t6, 0, a2); // sq t6, 0(a2) - c->daddiu(a2, a2, 16); // daddiu a2, a2, 16 - bc = c->sgpr64(s5) != 0; // bne s5, r0, L76 - c->daddiu(s5, s5, 1); // daddiu s5, s5, 1 + c->sq(t6, 0, a2); // sq t6, 0(a2) // dma tag template + c->daddiu(a2, a2, 16); // daddiu a2, a2, 16 // inc + bc = c->sgpr64(s5) != 0; // bne s5, r0, L76 // skip ahead on non-first fragment + c->daddiu(s5, s5, 1); // daddiu s5, s5, 1 // inc fragment counter if (bc) {goto block_10;} // branch non-likely c->mov64(a3, v1); // or a3, v1, r0 @@ -949,7 +1045,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace draw_bones_check_longest_edge_asm { struct Cache { diff --git a/game/mips2c/functions/collide_cache.cpp b/game/mips2c/functions/collide_cache.cpp index 6b27e26c77..b369167279 100644 --- a/game/mips2c/functions/collide_cache.cpp +++ b/game/mips2c/functions/collide_cache.cpp @@ -1,9 +1,9 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" - #include "common/dma/gs.h" +#include "game/kernel/jak1/kscheme.h" +#include "game/mips2c/mips2c_private.h" +using namespace jak1; namespace { u32 vu0_buffer[1024]; // todo, maybe can be 512. u32 vi1 = 0; @@ -790,7 +790,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_28_collide_cache { struct Cache { @@ -1073,7 +1073,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_27_collide_cache { struct Cache { @@ -1369,7 +1369,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_29_collide_cache { struct Cache { @@ -1558,7 +1558,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_12_collide_shape_prim_mesh { struct Cache { @@ -1740,7 +1740,7 @@ u64 execute(void* ctxt) { printf("too many prims\n"); call_addr = c->gprs[t9].du32[0]; // function call: c->sll(v0, ra, 0); // sll v0, ra, 0 - c->jalr(call_addr); // jalr ra, t9 + // c->jalr(call_addr); // jalr ra, t9 //beq r0, r0, L147 // beq r0, r0, L147 // nop // sll r0, r0, 0 goto block_15; // branch always @@ -1804,7 +1804,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_14_collide_shape_prim_mesh { struct Cache { @@ -2049,7 +2049,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_13_collide_shape_prim_mesh { struct Cache { @@ -2300,7 +2300,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_30_collide_cache { u64 execute(void* ctxt) { @@ -2502,7 +2502,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_9_collide_cache_prim { struct Cache { @@ -2690,7 +2690,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_10_collide_cache_prim { struct Cache { @@ -2902,7 +2902,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_10_collide_puss_work { u64 execute(void* ctxt) { @@ -3071,7 +3071,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_9_collide_puss_work { struct Cache { diff --git a/game/mips2c/functions/collide_edge_grab.cpp b/game/mips2c/functions/collide_edge_grab.cpp index e5e6a7b468..155e43450d 100644 --- a/game/mips2c/functions/collide_edge_grab.cpp +++ b/game/mips2c/functions/collide_edge_grab.cpp @@ -1,7 +1,8 @@ //--------------------------MIPS2C--------------------- +#include "game/kernel/jak1/kscheme.h" #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +using namespace jak1; namespace Mips2C { namespace method_16_collide_edge_work { struct Cache { @@ -104,6 +105,12 @@ u64 execute(void* ctxt) { c->vmadd_bc(DEST::w, BC::z, vf9, vf0, vf9); // vmaddz.w vf9, vf0, vf9 // nop // sll r0, r0, 0 c->vrsqrt(vf0, BC::w, vf9, BC::w); // vrsqrt Q, vf0.w, vf9.w + if (c->vfs[vf9].f[3] == 0.f) { + // hack to prevent NaNs from getting in the collide data if we have a zero-area triangle + // this value doesn't matter - the normal is zeros anyway and the triangle will be rejected + // by every other step. + c->Q = 0.f; + } // nop // sll r0, r0, 0 c->dsll32(t5, t5, 12); // dsll32 t5, t5, 12 c->dsrl32(t5, t5, 26); // dsrl32 t5, t5, 26 @@ -589,7 +596,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_10_collide_edge_hold_list { u64 execute(void* ctxt) { @@ -683,7 +690,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_18_collide_edge_work { struct Cache { diff --git a/game/mips2c/functions/collide_func.cpp b/game/mips2c/functions/collide_func.cpp index c13bf20d5e..c0c6a0ccdf 100644 --- a/game/mips2c/functions/collide_func.cpp +++ b/game/mips2c/functions/collide_func.cpp @@ -1,7 +1,7 @@ //--------------------------MIPS2C--------------------- +#include "game/kernel/jak1/kscheme.h" #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" - +using namespace jak1; // clang-format off namespace Mips2C { namespace collide_do_primitives { @@ -261,7 +261,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace moving_sphere_triangle_intersect { struct Cache { diff --git a/game/mips2c/functions/collide_mesh.cpp b/game/mips2c/functions/collide_mesh.cpp index 0a3d9d2a1f..0128af6224 100644 --- a/game/mips2c/functions/collide_mesh.cpp +++ b/game/mips2c/functions/collide_mesh.cpp @@ -1,7 +1,8 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +#include "game/kernel/jak1/kscheme.h" +#include "game/mips2c/mips2c_private.h" +using namespace jak1; // clang-format off namespace Mips2C { namespace method_12_collide_mesh { @@ -202,7 +203,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_11_collide_mesh { struct Cache { @@ -377,7 +378,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_14_collide_mesh { u64 execute(void* ctxt) { @@ -581,7 +582,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace method_15_collide_mesh { u64 execute(void* ctxt) { diff --git a/game/mips2c/functions/collide_probe.cpp b/game/mips2c/functions/collide_probe.cpp index 8d2cb26453..aaf7513906 100644 --- a/game/mips2c/functions/collide_probe.cpp +++ b/game/mips2c/functions/collide_probe.cpp @@ -2,7 +2,8 @@ //--------------------------MIPS2C--------------------- // clang-format off #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +#include "game/kernel/jak1/kscheme.h" +using namespace jak1; namespace Mips2C { namespace collide_probe_node { struct Cache { @@ -353,7 +354,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace collide_probe_instance_tie { struct Cache { diff --git a/game/mips2c/functions/draw_string.cpp b/game/mips2c/functions/draw_string.cpp index ee082a87d9..31aceffe66 100644 --- a/game/mips2c/functions/draw_string.cpp +++ b/game/mips2c/functions/draw_string.cpp @@ -1,7 +1,8 @@ //--------------------------MIPS2C--------------------- // clang-format off #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +#include "game/kernel/jak1/kscheme.h" +using namespace jak1; namespace Mips2C { namespace draw_string { struct Cache { diff --git a/game/mips2c/functions/generic_effect.cpp b/game/mips2c/functions/generic_effect.cpp index a4fec92ecd..13032c7a6c 100644 --- a/game/mips2c/functions/generic_effect.cpp +++ b/game/mips2c/functions/generic_effect.cpp @@ -1,8 +1,9 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +#include "game/kernel/jak1/kscheme.h" +#include "game/mips2c/mips2c_private.h" +using namespace jak1; // clang-format off namespace Mips2C { @@ -449,7 +450,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace generic_light_proc { struct Cache { @@ -889,7 +890,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace generic_envmap_proc { struct Cache { @@ -1658,7 +1659,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace generic_prepare_dma_single { struct Cache { diff --git a/game/mips2c/functions/generic_effect2.cpp b/game/mips2c/functions/generic_effect2.cpp new file mode 100644 index 0000000000..bb44dd2f26 --- /dev/null +++ b/game/mips2c/functions/generic_effect2.cpp @@ -0,0 +1,1015 @@ +//--------------------------MIPS2C--------------------- + +#include "game/kernel/jak1/kscheme.h" +#include "game/mips2c/mips2c_private.h" +using namespace jak1; +namespace Mips2C { + +// clang-format off +void vcallms48(ExecutionContext* c) { + // nop | mulx.xyzw vf13, vf09, vf31 + c->vfs[vf13].vf.mul(Mask::xyzw, c->vf_src(vf09).vf, c->vf_src(vf31).vf.x()); + // nop | subw.z vf21, vf21, vf00 + c->vfs[vf21].vf.sub(Mask::z, c->vf_src(vf21).vf, c->vf_src(vf00).vf.w()); + // nop | addy.x vf29, vf29, vf29 + c->vfs[vf29].vf.add(Mask::x, c->vf_src(vf29).vf, c->vf_src(vf29).vf.y()); + // nop | mulx.xyz vf08, vf08, vf30 + c->vfs[vf08].vf.mul(Mask::xyz, c->vf_src(vf08).vf, c->vf_src(vf30).vf.x()); + // nop | addw.xy vf05, vf05, vf31 + c->vfs[vf05].vf.add(Mask::xy, c->vf_src(vf05).vf, c->vf_src(vf31).vf.w()); + // nop | mul.xyz vf30, vf21, vf13 + c->vfs[vf30].vf.mul(Mask::xyz, c->vf_src(vf21).vf, c->vf_src(vf13).vf); + // nop | addz.x vf29, vf29, vf29 + c->vfs[vf29].vf.add(Mask::x, c->vf_src(vf29).vf, c->vf_src(vf29).vf.z()); + // nop | add.xyz vf08, vf08, vf16 + c->vfs[vf08].vf.add(Mask::xyz, c->vf_src(vf08).vf, c->vf_src(vf16).vf); + // move.xyzw vf28, vf27 | ftoi12.xy vf17, vf05 + c->vfs[vf17].vf.ftoi12(Mask::xy, c->vf_src(vf05).vf); c->vfs[vf28].vf.move(Mask::xyzw, c->vf_src(vf27).vf); + // move.xyzw vf02, vf22 | addy.x vf30, vf30, vf30 + c->vfs[vf30].vf.add(Mask::x, c->vf_src(vf30).vf, c->vf_src(vf30).vf.y()); c->vfs[vf02].vf.move(Mask::xyzw, c->vf_src(vf22).vf); + // rsqrt Q, vf31.z, vf29.x | mul.xyz vf06, vf06, Q + c->vfs[vf06].vf.mul(Mask::xyz, c->vf_src(vf06).vf, c->Q); c->Q = c->vf_src(vf31).vf.z() / std::sqrt(c->vf_src(vf29).vf.x()); + // nop | mul.xyz vf29, vf08, vf08 + c->vfs[vf29].vf.mul(Mask::xyz, c->vf_src(vf08).vf, c->vf_src(vf08).vf); + // nop | mulx.xyz vf01, vf21, vf28 + c->vfs[vf01].vf.mul(Mask::xyz, c->vf_src(vf21).vf, c->vf_src(vf28).vf.x()); + // nop | addz.x vf30, vf30, vf30 + c->vfs[vf30].vf.add(Mask::x, c->vf_src(vf30).vf, c->vf_src(vf30).vf.z()); + // nop | mulx.xyzw vf14, vf10, vf31 + c->vfs[vf14].vf.mul(Mask::xyzw, c->vf_src(vf10).vf, c->vf_src(vf31).vf.x()); + // nop | subw.z vf02, vf02, vf00 + c->vfs[vf02].vf.sub(Mask::z, c->vf_src(vf02).vf, c->vf_src(vf00).vf.w()); + // nop | addy.x vf29, vf29, vf29 + c->vfs[vf29].vf.add(Mask::x, c->vf_src(vf29).vf, c->vf_src(vf29).vf.y()); + // nop | mulx.xyz vf01, vf01, vf30 + c->vfs[vf01].vf.mul(Mask::xyz, c->vf_src(vf01).vf, c->vf_src(vf30).vf.x()); + // nop | addw.xy vf06, vf06, vf31 + c->vfs[vf06].vf.add(Mask::xy, c->vf_src(vf06).vf, c->vf_src(vf31).vf.w()); + // nop | mul.xyz vf30, vf02, vf14 + c->vfs[vf30].vf.mul(Mask::xyz, c->vf_src(vf02).vf, c->vf_src(vf14).vf); + // nop | addz.x vf29, vf29, vf29 + c->vfs[vf29].vf.add(Mask::x, c->vf_src(vf29).vf, c->vf_src(vf29).vf.z()); + // nop | add.xyz vf01, vf01, vf13 + c->vfs[vf01].vf.add(Mask::xyz, c->vf_src(vf01).vf, c->vf_src(vf13).vf); + // nop | ftoi12.xy vf18, vf06 + c->vfs[vf18].vf.ftoi12(Mask::xy, c->vf_src(vf06).vf); + // nop | addy.x vf30, vf30, vf30 + c->vfs[vf30].vf.add(Mask::x, c->vf_src(vf30).vf, c->vf_src(vf30).vf.y()); + // rsqrt Q, vf31.z, vf29.x | mul.xyz vf07, vf07, Q + c->vfs[vf07].vf.mul(Mask::xyz, c->vf_src(vf07).vf, c->Q); c->Q = c->vf_src(vf31).vf.z() / std::sqrt(c->vf_src(vf29).vf.x()); + // move.xyzw vf03, vf23 | mul.xyz vf29, vf01, vf01 + c->vfs[vf29].vf.mul(Mask::xyz, c->vf_src(vf01).vf, c->vf_src(vf01).vf); c->vfs[vf03].vf.move(Mask::xyzw, c->vf_src(vf23).vf); + // nop | muly.xyz vf02, vf02, vf28 + c->vfs[vf02].vf.mul(Mask::xyz, c->vf_src(vf02).vf, c->vf_src(vf28).vf.y()); + // nop | addz.x vf30, vf30, vf30 + c->vfs[vf30].vf.add(Mask::x, c->vf_src(vf30).vf, c->vf_src(vf30).vf.z()); + // nop | mulx.xyzw vf15, vf11, vf31 + c->vfs[vf15].vf.mul(Mask::xyzw, c->vf_src(vf11).vf, c->vf_src(vf31).vf.x()); + // nop | subw.z vf03, vf03, vf00 + c->vfs[vf03].vf.sub(Mask::z, c->vf_src(vf03).vf, c->vf_src(vf00).vf.w()); + // nop | addy.x vf29, vf29, vf29 + c->vfs[vf29].vf.add(Mask::x, c->vf_src(vf29).vf, c->vf_src(vf29).vf.y()); + // nop | mulx.xyz vf02, vf02, vf30 + c->vfs[vf02].vf.mul(Mask::xyz, c->vf_src(vf02).vf, c->vf_src(vf30).vf.x()); + // nop | addw.xy vf07, vf07, vf31 + c->vfs[vf07].vf.add(Mask::xy, c->vf_src(vf07).vf, c->vf_src(vf31).vf.w()); + // nop | mul.xyz vf30, vf03, vf15 + c->vfs[vf30].vf.mul(Mask::xyz, c->vf_src(vf03).vf, c->vf_src(vf15).vf); + // nop | addz.x vf29, vf29, vf29 + c->vfs[vf29].vf.add(Mask::x, c->vf_src(vf29).vf, c->vf_src(vf29).vf.z()); + // nop | add.xyz vf02, vf02, vf14 + c->vfs[vf02].vf.add(Mask::xyz, c->vf_src(vf02).vf, c->vf_src(vf14).vf); + // nop | ftoi12.xy vf19, vf07 + c->vfs[vf19].vf.ftoi12(Mask::xy, c->vf_src(vf07).vf); + // nop | addy.x vf30, vf30, vf30 + c->vfs[vf30].vf.add(Mask::x, c->vf_src(vf30).vf, c->vf_src(vf30).vf.y()); + // rsqrt Q, vf31.z, vf29.x | mul.xyz vf08, vf08, Q + c->vfs[vf08].vf.mul(Mask::xyz, c->vf_src(vf08).vf, c->Q); c->Q = c->vf_src(vf31).vf.z() / std::sqrt(c->vf_src(vf29).vf.x()); + // move.xyzw vf04, vf24 | mul.xyz vf29, vf02, vf02 + c->vfs[vf29].vf.mul(Mask::xyz, c->vf_src(vf02).vf, c->vf_src(vf02).vf); c->vfs[vf04].vf.move(Mask::xyzw, c->vf_src(vf24).vf); + // nop | mulz.xyz vf03, vf03, vf28 + c->vfs[vf03].vf.mul(Mask::xyz, c->vf_src(vf03).vf, c->vf_src(vf28).vf.z()); + // nop | addz.x vf30, vf30, vf30 + c->vfs[vf30].vf.add(Mask::x, c->vf_src(vf30).vf, c->vf_src(vf30).vf.z()); + // nop | mulx.xyzw vf16, vf12, vf31 + c->vfs[vf16].vf.mul(Mask::xyzw, c->vf_src(vf12).vf, c->vf_src(vf31).vf.x()); + // nop | subw.z vf04, vf04, vf00 + c->vfs[vf04].vf.sub(Mask::z, c->vf_src(vf04).vf, c->vf_src(vf00).vf.w()); + // nop | addy.x vf29, vf29, vf29 + c->vfs[vf29].vf.add(Mask::x, c->vf_src(vf29).vf, c->vf_src(vf29).vf.y()); + // nop | mulx.xyz vf03, vf03, vf30 + c->vfs[vf03].vf.mul(Mask::xyz, c->vf_src(vf03).vf, c->vf_src(vf30).vf.x()); + // nop | addw.xy vf08, vf08, vf31 + c->vfs[vf08].vf.add(Mask::xy, c->vf_src(vf08).vf, c->vf_src(vf31).vf.w()); + // nop | mul.xyz vf30, vf04, vf16 + c->vfs[vf30].vf.mul(Mask::xyz, c->vf_src(vf04).vf, c->vf_src(vf16).vf); + // nop | addz.x vf29, vf29, vf29 + c->vfs[vf29].vf.add(Mask::x, c->vf_src(vf29).vf, c->vf_src(vf29).vf.z()); + // nop | add.xyz vf03, vf03, vf15 + c->vfs[vf03].vf.add(Mask::xyz, c->vf_src(vf03).vf, c->vf_src(vf15).vf); + // nop | ftoi12.xy vf20, vf08 + c->vfs[vf20].vf.ftoi12(Mask::xy, c->vf_src(vf08).vf); + // nop | addy.x vf30, vf30, vf30 + c->vfs[vf30].vf.add(Mask::x, c->vf_src(vf30).vf, c->vf_src(vf30).vf.y()); + // rsqrt Q, vf31.z, vf29.x | mul.xyz vf05, vf01, Q + c->vfs[vf05].vf.mul(Mask::xyz, c->vf_src(vf01).vf, c->Q); c->Q = c->vf_src(vf31).vf.z() / std::sqrt(c->vf_src(vf29).vf.x()); + // move.xyzw vf06, vf02 | mul.xyz vf29, vf03, vf03 + c->vfs[vf29].vf.mul(Mask::xyz, c->vf_src(vf03).vf, c->vf_src(vf03).vf); c->vfs[vf06].vf.move(Mask::xyzw, c->vf_src(vf02).vf); + // move.xyzw vf07, vf03 | mulw.xyz vf08, vf04, vf28 :e + c->vfs[vf08].vf.mul(Mask::xyz, c->vf_src(vf04).vf, c->vf_src(vf28).vf.w()); c->vfs[vf07].vf.move(Mask::xyzw, c->vf_src(vf03).vf); + // nop | addz.x vf30, vf30, vf30 + c->vfs[vf30].vf.add(Mask::x, c->vf_src(vf30).vf, c->vf_src(vf30).vf.z()); + +} + +namespace generic_envmap_dproc { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + // nop // sll r0, r0, 0 + get_fake_spad_addr(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->lui(v1, 16256); // lui v1, 16256 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->lwu(a1, 60, at); // lwu a1, 60(at) + // nop // sll r0, r0, 0 + c->lw(v1, 12048, at); // lw v1, 12048(at) + // nop // sll r0, r0, 0 + c->lw(a2, 4, a1); // lw a2, 4(a1) + c->mov64(a0, a2); // or a0, a2, r0 + c->lhu(a1, 20, a1); // lhu a1, 20(a1) + // nop // sll r0, r0, 0 + c->lwc1(f4, 24, a2); // lwc1 f4, 24(a2) + c->daddiu(a1, a1, -4); // daddiu a1, a1, -4 + c->lwc1(f3, 56, a2); // lwc1 f3, 56(a2) + // nop // sll r0, r0, 0 + c->lwc1(f2, 88, a2); // lwc1 f2, 88(a2) + // nop // sll r0, r0, 0 + c->lwc1(f1, 120, a2); // lwc1 f1, 120(a2) + // nop // sll r0, r0, 0 + c->lq(t2, 16, a2); // lq t2, 16(a2) + c->subs(f4, f4, f0); // sub.s f4, f4, f0 + c->lq(t3, 48, a2); // lq t3, 48(a2) + c->divs(f4, f0, f4); // div.s f4, f0, f4 + c->lq(t4, 80, a2); // lq t4, 80(a2) + // nop // sll r0, r0, 0 + c->lq(t5, 112, a2); // lq t5, 112(a2) + // nop // sll r0, r0, 0 + c->lqc2(vf31, 12016, at); // lqc2 vf31, 12016(at) + // nop // sll r0, r0, 0 + c->lq(t6, 0, a2); // lq t6, 0(a2) + // nop // sll r0, r0, 0 + c->lq(a3, 32, a2); // lq a3, 32(a2) + // nop // sll r0, r0, 0 + c->lq(t0, 64, a2); // lq t0, 64(a2) + // nop // sll r0, r0, 0 + c->lq(t1, 96, a2); // lq t1, 96(a2) + c->muls(f4, f4, f0); // mul.s f4, f4, f0 + c->mov128_vf_gpr(vf21, t2); // qmtc2.i vf21, t2 + c->subs(f3, f3, f0); // sub.s f3, f3, f0 + c->mov128_vf_gpr(vf22, t3); // qmtc2.ni vf22, t3 + c->divs(f3, f0, f3); // div.s f3, f0, f3 + c->mov128_vf_gpr(vf23, t4); // qmtc2.ni vf23, t4 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf24, t5); // qmtc2.ni vf24, t5 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf9, t6); // qmtc2.ni vf9, t6 + c->subs(f2, f2, f0); // sub.s f2, f2, f0 + c->mfc1(t2, f4); // mfc1 t2, f4 + c->subs(f1, f1, f0); // sub.s f1, f1, f0 + c->mov128_vf_gpr(vf10, a3); // qmtc2.ni vf10, a3 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf11, t0); // qmtc2.ni vf11, t0 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf12, t1); // qmtc2.ni vf12, t1 + c->muls(f3, f3, f0); // mul.s f3, f3, f0 + // nop // sll r0, r0, 0 + c->divs(f2, f0, f2); // div.s f2, f0, f2 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(a3, f3); // mfc1 a3, f3 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->muls(f2, f2, f0); // mul.s f2, f2, f0 + // nop // sll r0, r0, 0 + c->divs(f1, f0, f1); // div.s f1, f0, f1 + // nop // sll r0, r0, 0 + c->pextlw(a3, a3, t2); // pextlw a3, a3, t2 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(t0, f2); // mfc1 t0, f2 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(a2, a2, 128); // daddiu a2, a2, 128 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(t1, f1); // mfc1 t1, f1 + c->pextlw(t0, t1, t0); // pextlw t0, t1, t0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyld(a3, t0, a3); // pcpyld a3, t0, a3 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf27, a3); // qmtc2.ni vf27, a3 + // nop // sll r0, r0, 0 + // Unknown instr: vcallms 48 + vcallms48(c); + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->lwc1(f4, 24, a2); // lwc1 f4, 24(a2) + // nop // sll r0, r0, 0 + c->lwc1(f3, 56, a2); // lwc1 f3, 56(a2) + // nop // sll r0, r0, 0 + c->lwc1(f2, 88, a2); // lwc1 f2, 88(a2) + // nop // sll r0, r0, 0 + c->lwc1(f1, 120, a2); // lwc1 f1, 120(a2) + // nop // sll r0, r0, 0 + c->lq(a3, 16, a2); // lq a3, 16(a2) + c->subs(f4, f4, f0); // sub.s f4, f4, f0 + // nop // sll r0, r0, 0 + c->subs(f3, f3, f0); // sub.s f3, f3, f0 + // nop // sll r0, r0, 0 + c->subs(f2, f2, f0); // sub.s f2, f2, f0 + // nop // sll r0, r0, 0 + c->subs(f1, f1, f0); // sub.s f1, f1, f0 + // nop // sll r0, r0, 0 + c->divs(f4, f0, f4); // div.s f4, f0, f4 + c->lq(t0, 48, a2); // lq t0, 48(a2) + // nop // sll r0, r0, 0 + c->lq(t1, 80, a2); // lq t1, 80(a2) + // nop // sll r0, r0, 0 + c->lq(t2, 112, a2); // lq t2, 112(a2) + // nop // sll r0, r0, 0 + c->lq(t3, 0, a2); // lq t3, 0(a2) + // nop // sll r0, r0, 0 + c->lq(t4, 32, a2); // lq t4, 32(a2) + // nop // sll r0, r0, 0 + c->lq(t5, 64, a2); // lq t5, 64(a2) + // nop // sll r0, r0, 0 + c->lq(t6, 96, a2); // lq t6, 96(a2) + c->muls(f4, f4, f0); // mul.s f4, f4, f0 + // nop // sll r0, r0, 0 + c->divs(f3, f0, f3); // div.s f3, f0, f3 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(t7, f4); // mfc1 t7, f4 + // nop // sll r0, r0, 0 + c->daddiu(a2, a2, 128); // daddiu a2, a2, 128 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->muls(f3, f3, f0); // mul.s f3, f3, f0 + // nop // sll r0, r0, 0 + c->divs(f2, f0, f2); // div.s f2, f0, f2 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(t8, f3); // mfc1 t8, f3 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->muls(f2, f2, f0); // mul.s f2, f2, f0 + // nop // sll r0, r0, 0 + c->divs(f1, f0, f1); // div.s f1, f0, f1 + // nop // sll r0, r0, 0 + c->pextlw(t7, t8, t7); // pextlw t7, t8, t7 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(t8, f2); // mfc1 t8, f2 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(t9, f1); // mfc1 t9, f1 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf21, a3); // qmtc2.ni vf21, a3 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf9, t3); // qmtc2.ni vf9, t3 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf10, t4); // qmtc2.ni vf10, t4 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf11, t5); // qmtc2.ni vf11, t5 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf12, t6); // qmtc2.ni vf12, t6 + c->pextlw(a3, t9, t8); // pextlw a3, t9, t8 + // nop // sll r0, r0, 0 + c->pcpyld(a3, a3, t7); // pcpyld a3, a3, t7 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf22, t0); // qmtc2.ni vf22, t0 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf23, t1); // qmtc2.ni vf23, t1 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf24, t2); // qmtc2.ni vf24, t2 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf27, a3); // qmtc2.ni vf27, a3 + // nop // sll r0, r0, 0 + // Unknown instr: vcallms 48 + vcallms48(c); + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->lwc1(f1, 24, a2); // lwc1 f1, 24(a2) + c->subs(f1, f1, f0); // sub.s f1, f1, f0 + c->lwc1(f2, 56, a2); // lwc1 f2, 56(a2) + c->divs(f3, f0, f1); // div.s f3, f0, f1 + c->lwc1(f5, 88, a2); // lwc1 f5, 88(a2) + // nop // sll r0, r0, 0 + c->lwc1(f1, 120, a2); // lwc1 f1, 120(a2) + // nop // sll r0, r0, 0 + c->lq(a3, 16, a2); // lq a3, 16(a2) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->subs(f4, f2, f0); // sub.s f4, f2, f0 + // nop // sll r0, r0, 0 + c->subs(f2, f5, f0); // sub.s f2, f5, f0 + // nop // sll r0, r0, 0 + c->subs(f1, f1, f0); // sub.s f1, f1, f0 + // nop // sll r0, r0, 0 + c->muls(f3, f3, f0); // mul.s f3, f3, f0 + c->lq(t0, 48, a2); // lq t0, 48(a2) + c->divs(f4, f0, f4); // div.s f4, f0, f4 + c->lq(t1, 80, a2); // lq t1, 80(a2) + // nop // sll r0, r0, 0 + c->lq(t2, 112, a2); // lq t2, 112(a2) + // nop // sll r0, r0, 0 + c->lq(t3, 0, a2); // lq t3, 0(a2) + // nop // sll r0, r0, 0 + c->lq(t4, 32, a2); // lq t4, 32(a2) + // nop // sll r0, r0, 0 + c->lq(t5, 64, a2); // lq t5, 64(a2) + // nop // sll r0, r0, 0 + c->lq(t6, 96, a2); // lq t6, 96(a2) + // nop // sll r0, r0, 0 + c->mfc1(t7, f3); // mfc1 t7, f3 + c->muls(f3, f4, f0); // mul.s f3, f4, f0 + // nop // sll r0, r0, 0 + c->divs(f2, f0, f2); // div.s f2, f0, f2 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(a2, a2, 128); // daddiu a2, a2, 128 + // nop // sll r0, r0, 0 + c->mfc1(t8, f3); // mfc1 t8, f3 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->muls(f2, f2, f0); // mul.s f2, f2, f0 + // nop // sll r0, r0, 0 + c->divs(f1, f0, f1); // div.s f1, f0, f1 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(t9, f2); // mfc1 t9, f2 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->pextlw(t7, t8, t7); // pextlw t7, t8, t7 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(t8, f1); // mfc1 t8, f1 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->pextlw(t8, t8, t9); // pextlw t8, t8, t9 + // nop // sll r0, r0, 0 + c->pcpyld(t7, t8, t7); // pcpyld t7, t8, t7 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf21, a3); // qmtc2.ni vf21, a3 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf22, t0); // qmtc2.ni vf22, t0 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf23, t1); // qmtc2.ni vf23, t1 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf24, t2); // qmtc2.ni vf24, t2 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf9, t3); // qmtc2.ni vf9, t3 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf10, t4); // qmtc2.ni vf10, t4 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf11, t5); // qmtc2.ni vf11, t5 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf12, t6); // qmtc2.ni vf12, t6 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf27, t7); // qmtc2.ni vf27, t7 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t1, vf17); // qmfc2.ni t1, vf17 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t2, vf18); // qmfc2.ni t2, vf18 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t0, vf19); // qmfc2.ni t0, vf19 + bc = ((s64)c->sgpr64(a1)) <= 0; // blez a1, L47 + c->mov128_gpr_vf(a3, vf20); // qmfc2.ni a3, vf20 + if (bc) {goto block_2;} // branch non-likely + + + block_1: + c->ppach(t1, r0, t1); // ppach t1, r0, t1 + // Unknown instr: vcallms 48 + vcallms48(c); + c->ppach(t2, r0, t2); // ppach t2, r0, t2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->ppach(t0, r0, t0); // ppach t0, r0, t0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->ppach(a3, r0, a3); // ppach a3, r0, a3 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->sw(t1, 16, a0); // sw t1, 16(a0) + // nop // sll r0, r0, 0 + c->sw(t2, 48, a0); // sw t2, 48(a0) + // nop // sll r0, r0, 0 + c->sw(t0, 80, a0); // sw t0, 80(a0) + // nop // sll r0, r0, 0 + c->sw(a3, 112, a0); // sw a3, 112(a0) + // nop // sll r0, r0, 0 + c->lwc1(f4, 24, a2); // lwc1 f4, 24(a2) + // nop // sll r0, r0, 0 + c->lwc1(f3, 56, a2); // lwc1 f3, 56(a2) + // nop // sll r0, r0, 0 + c->lwc1(f2, 88, a2); // lwc1 f2, 88(a2) + // nop // sll r0, r0, 0 + c->lwc1(f1, 120, a2); // lwc1 f1, 120(a2) + // nop // sll r0, r0, 0 + c->lq(a3, 16, a2); // lq a3, 16(a2) + c->subs(f4, f4, f0); // sub.s f4, f4, f0 + c->sw(v1, 20, a0); // sw v1, 20(a0) + c->subs(f3, f3, f0); // sub.s f3, f3, f0 + c->sw(v1, 52, a0); // sw v1, 52(a0) + c->subs(f2, f2, f0); // sub.s f2, f2, f0 + c->sw(v1, 84, a0); // sw v1, 84(a0) + c->subs(f1, f1, f0); // sub.s f1, f1, f0 + c->sw(v1, 116, a0); // sw v1, 116(a0) + c->divs(f4, f0, f4); // div.s f4, f0, f4 + c->lq(t3, 48, a2); // lq t3, 48(a2) + // nop // sll r0, r0, 0 + c->lq(t4, 80, a2); // lq t4, 80(a2) + // nop // sll r0, r0, 0 + c->lq(t5, 112, a2); // lq t5, 112(a2) + // nop // sll r0, r0, 0 + c->lq(t6, 0, a2); // lq t6, 0(a2) + // nop // sll r0, r0, 0 + c->lq(t2, 32, a2); // lq t2, 32(a2) + // nop // sll r0, r0, 0 + c->lq(t0, 64, a2); // lq t0, 64(a2) + // nop // sll r0, r0, 0 + c->lq(t1, 96, a2); // lq t1, 96(a2) + c->daddiu(a1, a1, -4); // daddiu a1, a1, -4 + c->daddiu(a0, a0, 128); // daddiu a0, a0, 128 + c->muls(f4, f4, f0); // mul.s f4, f4, f0 + // nop // sll r0, r0, 0 + c->divs(f3, f0, f3); // div.s f3, f0, f3 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(t7, f4); // mfc1 t7, f4 + // nop // sll r0, r0, 0 + c->daddiu(a2, a2, 128); // daddiu a2, a2, 128 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->muls(f3, f3, f0); // mul.s f3, f3, f0 + // nop // sll r0, r0, 0 + c->divs(f2, f0, f2); // div.s f2, f0, f2 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(t8, f3); // mfc1 t8, f3 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->muls(f2, f2, f0); // mul.s f2, f2, f0 + // nop // sll r0, r0, 0 + c->divs(f1, f0, f1); // div.s f1, f0, f1 + // nop // sll r0, r0, 0 + c->pextlw(t7, t8, t7); // pextlw t7, t8, t7 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(t8, f2); // mfc1 t8, f2 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(t9, f1); // mfc1 t9, f1 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf21, a3); // qmtc2.ni vf21, a3 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf22, t3); // qmtc2.ni vf22, t3 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf23, t4); // qmtc2.ni vf23, t4 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf24, t5); // qmtc2.ni vf24, t5 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf9, t6); // qmtc2.ni vf9, t6 + c->pextlw(a3, t9, t8); // pextlw a3, t9, t8 + c->mov128_vf_gpr(vf10, t2); // qmtc2.ni vf10, t2 + c->pcpyld(a3, a3, t7); // pcpyld a3, a3, t7 + c->mov128_vf_gpr(vf11, t0); // qmtc2.ni vf11, t0 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf12, t1); // qmtc2.ni vf12, t1 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf27, a3); // qmtc2.ni vf27, a3 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t1, vf17); // qmfc2.ni t1, vf17 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t2, vf18); // qmfc2.ni t2, vf18 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t0, vf19); // qmfc2.ni t0, vf19 + bc = ((s64)c->sgpr64(a1)) > 0; // bgtz a1, L46 + c->mov128_gpr_vf(a3, vf20); // qmfc2.ni a3, vf20 + if (bc) {goto block_1;} // branch non-likely + + + block_2: + c->ppach(a1, r0, t1); // ppach a1, r0, t1 + c->sw(v1, 20, a0); // sw v1, 20(a0) + c->ppach(a2, r0, t2); // ppach a2, r0, t2 + c->sw(v1, 52, a0); // sw v1, 52(a0) + c->ppach(t0, r0, t0); // ppach t0, r0, t0 + c->sw(a1, 16, a0); // sw a1, 16(a0) + c->ppach(a1, r0, a3); // ppach a1, r0, a3 + c->sw(a2, 48, a0); // sw a2, 48(a0) + // nop // sll r0, r0, 0 + c->sw(t0, 80, a0); // sw t0, 80(a0) + // nop // sll r0, r0, 0 + c->sw(a1, 112, a0); // sw a1, 112(a0) + // nop // sll r0, r0, 0 + c->sw(v1, 84, a0); // sw v1, 84(a0) + // nop // sll r0, r0, 0 + c->sw(v1, 116, a0); // sw v1, 116(a0) + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("generic-envmap-dproc", execute, 256); +} + +} // namespace generic_envmap_dproc +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +#include "game/mips2c/mips2c_private.h" + +namespace Mips2C { +namespace generic_interp_dproc { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + get_fake_spad_addr(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + // nop // sll r0, r0, 0 + c->lw(v1, 80, at); // lw v1, 80(at) + // nop // sll r0, r0, 0 + c->lw(a0, 60, at); // lw a0, 60(at) + bc = c->sgpr64(v1) == 0; // beq v1, r0, L44 + // nop // sll r0, r0, 0 + if (bc) {goto block_7;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(t0, 8, v1); // lw t0, 8(v1) + // nop // sll r0, r0, 0 + c->lw(a2, 4, a0); // lw a2, 4(a0) + // nop // sll r0, r0, 0 + c->lh(a0, 0, v1); // lh a0, 0(v1) + // nop // sll r0, r0, 0 + c->lh(a1, 2, v1); // lh a1, 2(v1) + bc = c->sgpr64(a0) != 0; // bne a0, r0, L44 + c->lh(a0, 4, v1); // lh a0, 4(v1) + if (bc) {goto block_7;} // branch non-likely + + c->dsll(t1, a0, 5); // dsll t1, a0, 5 + c->lh(a0, 12, v1); // lh a0, 12(v1) + c->daddiu(a3, a1, 7); // daddiu a3, a1, 7 + c->lh(a1, 14, v1); // lh a1, 14(v1) + bc = c->sgpr64(a1) == 0; // beq a1, r0, L44 + c->daddu(v1, t1, a2); // daddu v1, t1, a2 + if (bc) {goto block_7;} // branch non-likely + + c->pextlh(a0, a0, a0); // pextlh a0, a0, a0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlw(a0, a0, a0); // pextlw a0, a0, a0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyld(a0, a0, a0); // pcpyld a0, a0, a0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlh(a1, a1, a1); // pextlh a1, a1, a1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlw(a1, a1, a1); // pextlw a1, a1, a1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyld(a1, a1, a1); // pcpyld a1, a1, a1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlw(a2, a2, a2); // pextlw a2, a2, a2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyld(a2, a2, a2); // pcpyld a2, a2, a2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsra(a3, a3, 3); // dsra a3, a3, 3 + // nop // sll r0, r0, 0 + c->dsll(a3, a3, 4); // dsll a3, a3, 4 + c->ld(t1, 0, t0); // ld t1, 0(t0) + c->daddu(a3, t0, a3); // daddu a3, t0, a3 + c->daddiu(t0, t0, 8); // daddiu t0, t0, 8 + c->pextlb(t1, r0, t1); // pextlb t1, r0, t1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psllh(t2, t1, 5); // psllh t2, t1, 5 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextuh(t1, r0, t2); // pextuh t1, r0, t2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlh(t2, r0, t2); // pextlh t2, r0, t2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->paddw(t2, t2, a2); // paddw t2, t2, a2 + c->mfc1(r0, f31); // mfc1 r0, f31 + //beq r0, r0, L43 // beq r0, r0, L43 + c->pcpyud(t5, t2, r0); // pcpyud t5, t2, r0 + goto block_5; // branch always + + + block_4: + c->dsrl32(t5, t6, 0); // dsrl32 t5, t6, 0 + c->dsrl32(t4, t3, 0); // dsrl32 t4, t3, 0 + c->pextuh(t1, r0, t2); // pextuh t1, r0, t2 + c->sw(t6, 16, v1); // sw t6, 16(v1) + c->pextlh(t2, r0, t2); // pextlh t2, r0, t2 + c->sw(t5, 48, v1); // sw t5, 48(v1) + c->paddw(t2, t2, a2); // paddw t2, t2, a2 + c->sw(t3, 80, v1); // sw t3, 80(v1) + c->pcpyud(t5, t2, r0); // pcpyud t5, t2, r0 + c->sw(t4, 112, v1); // sw t4, 112(v1) + c->daddiu(t0, t0, 8); // daddiu t0, t0, 8 + c->daddiu(v1, v1, 128); // daddiu v1, v1, 128 + + block_5: + c->paddw(t1, t1, a2); // paddw t1, t1, a2 + c->lwu(t3, 16, t2); // lwu t3, 16(t2) + c->pcpyud(t6, t1, r0); // pcpyud t6, t1, r0 + c->lwu(t4, 16, t5); // lwu t4, 16(t5) + c->dsrl32(t8, t2, 0); // dsrl32 t8, t2, 0 + c->lwu(t2, 16, t1); // lwu t2, 16(t1) + c->dsrl32(t9, t5, 0); // dsrl32 t9, t5, 0 + c->lwu(t5, 16, t6); // lwu t5, 16(t6) + c->dsrl32(t7, t1, 0); // dsrl32 t7, t1, 0 + c->lwu(t1, 16, t8); // lwu t1, 16(t8) + c->dsrl32(t8, t6, 0); // dsrl32 t8, t6, 0 + c->lwu(t6, 16, t9); // lwu t6, 16(t9) + c->pextlw(t4, t4, t3); // pextlw t4, t4, t3 + c->lwu(t3, 16, t7); // lwu t3, 16(t7) + c->pextlw(t2, t5, t2); // pextlw t2, t5, t2 + c->lwu(t5, 16, t8); // lwu t5, 16(t8) + c->pcpyld(t2, t2, t4); // pcpyld t2, t2, t4 + c->lwu(t4, 16, v1); // lwu t4, 16(v1) + c->pextlw(t6, t6, t1); // pextlw t6, t6, t1 + c->lwu(t1, 48, v1); // lwu t1, 48(v1) + c->pextlw(t3, t5, t3); // pextlw t3, t5, t3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyld(t3, t3, t6); // pcpyld t3, t3, t6 + c->lwu(t5, 80, v1); // lwu t5, 80(v1) + c->pextlw(t1, t1, t4); // pextlw t1, t1, t4 + c->lwu(t4, 112, v1); // lwu t4, 112(v1) + c->pmulth(r0, t2, a1); // pmulth r0, t2, a1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlw(t2, t4, t5); // pextlw t2, t4, t5 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmaddh(r0, t3, a1); // pmaddh r0, t3, a1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyld(t1, t2, t1); // pcpyld t1, t2, t1 + c->ld(t2, 0, t0); // ld t2, 0(t0) + c->pmaddh(r0, t1, a0); // pmaddh r0, t1, a0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlb(t1, r0, t2); // pextlb t1, r0, t2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psllh(t2, t1, 5); // psllh t2, t1, 5 + c->mfc1(r0, f31); // mfc1 r0, f31 + // Unknown instr: pmfhl.lw t3 + c->pmfhl_lw(t3); + c->mfc1(r0, f31); // mfc1 r0, f31 + // Unknown instr: pmfhl.uw t1 + c->pmfhl_uw(t1); + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psraw(t3, t3, 8); // psraw t3, t3, 8 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psraw(t1, t1, 8); // psraw t1, t1, 8 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pinteh(t6, t1, t3); // pinteh t6, t1, t3 + c->mfc1(r0, f31); // mfc1 r0, f31 + bc = c->sgpr64(t0) != c->sgpr64(a3); // bne t0, a3, L42 + c->pcpyud(t3, t6, r0); // pcpyud t3, t6, r0 + if (bc) {goto block_4;} // branch non-likely + + c->dsrl32(a0, t6, 0); // dsrl32 a0, t6, 0 + c->sw(t6, 16, v1); // sw t6, 16(v1) + c->dsrl32(a1, t3, 0); // dsrl32 a1, t3, 0 + c->sw(a0, 48, v1); // sw a0, 48(v1) + // nop // sll r0, r0, 0 + c->sw(t3, 80, v1); // sw t3, 80(v1) + // nop // sll r0, r0, 0 + c->sw(a1, 112, v1); // sw a1, 112(v1) + + block_7: + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("generic-interp-dproc", execute, 128); +} + +} // namespace generic_interp_dproc +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +#include "game/mips2c/mips2c_private.h" + +namespace Mips2C { +namespace generic_no_light_dproc { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + c->daddiu(sp, sp, -128); // daddiu sp, sp, -128 + c->sd(ra, 12432, at); // sd ra, 12432(at) + c->sq(s0, 12448, at); // sq s0, 12448(at) + c->sq(s1, 12464, at); // sq s1, 12464(at) + c->sq(s2, 12480, at); // sq s2, 12480(at) + c->sq(s3, 12496, at); // sq s3, 12496(at) + c->sq(s4, 12512, at); // sq s4, 12512(at) + c->sq(s5, 12528, at); // sq s5, 12528(at) + c->sq(gp, 12544, at); // sq gp, 12544(at) + get_fake_spad_addr(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + // nop // sll r0, r0, 0 + c->lw(a1, 60, at); // lw a1, 60(at) + // nop // sll r0, r0, 0 + c->lw(a0, 52, at); // lw a0, 52(at) + // nop // sll r0, r0, 0 + c->lw(v1, 0, a1); // lw v1, 0(a1) + // nop // sll r0, r0, 0 + c->lw(a2, 4, a1); // lw a2, 4(a1) + c->daddiu(a0, a0, 3); // daddiu a0, a0, 3 + // nop // sll r0, r0, 0 + c->dsra(a0, a0, 2); // dsra a0, a0, 2 + // nop // sll r0, r0, 0 + c->dsll(a0, a0, 3); // dsll a0, a0, 3 + c->addiu(a3, r0, 255); // addiu a3, r0, 255 + c->lui(a1, -2); // lui a1, -2 + c->addiu(t1, r0, 256); // addiu t1, r0, 256 + c->ori(a1, a1, 65534); // ori a1, a1, 65534 + c->daddu(a0, v1, a0); // daddu a0, v1, a0 + c->pextlw(a1, a1, a1); // pextlw a1, a1, a1 + c->lw(t2, 20, at); // lw t2, 20(at) + c->pextlw(a1, a1, a1); // pextlw a1, a1, a1 + c->lw(t3, 24, at); // lw t3, 24(at) + c->pextlw(a2, a2, a2); // pextlw a2, a2, a2 + c->lw(t5, 28, at); // lw t5, 28(at) + c->pextlw(a2, a2, a2); // pextlw a2, a2, a2 + c->lw(t4, 32, at); // lw t4, 32(at) + c->pcpyh(a3, a3); // pcpyh a3, a3 + c->lw(t6, 36, at); // lw t6, 36(at) + c->pcpyld(a3, a3, a3); // pcpyld a3, a3, a3 + c->lq(t0, 12160, at); // lq t0, 12160(at) + c->pcpyh(t1, t1); // pcpyh t1, t1 + c->ld(t7, 0, v1); // ld t7, 0(v1) + c->pcpyld(t1, t1, t1); // pcpyld t1, t1, t1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlh(t8, r0, t7); // pextlh t8, r0, t7 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pand(t7, t8, a3); // pand t7, t8, a3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psllw(t7, t7, 5); // psllw t7, t7, 5 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->daddiu(t2, t2, -48); // daddiu t2, t2, -48 + c->daddiu(t3, t3, -16); // daddiu t3, t3, -16 + c->daddiu(t4, t4, -16); // daddiu t4, t4, -16 + c->daddiu(t5, t5, -16); // daddiu t5, t5, -16 + //beq r0, r0, L34 // beq r0, r0, L34 + c->daddiu(t6, t6, -16); // daddiu t6, t6, -16 + goto block_3; // branch always + + // nop // sll r0, r0, 0 + + block_2: + c->pextlh(t8, r0, gp); // pextlh t8, r0, gp + c->sq(t7, 0, t2); // sq t7, 0(t2) + c->pand(t7, t8, a3); // pand t7, t8, a3 + c->sq(t9, 16, t2); // sq t9, 16(t2) + c->psllw(t7, t7, 5); // psllw t7, t7, 5 + c->sq(ra, 32, t2); // sq ra, 32(t2) + + block_3: + c->paddw(s3, t7, a2); // paddw s3, t7, a2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsrl32(s2, s3, 0); // dsrl32 s2, s3, 0 + c->daddiu(t2, t2, 48); // daddiu t2, t2, 48 + c->pcpyud(s5, s3, r0); // pcpyud s5, s3, r0 + c->lq(t7, 0, s3); // lq t7, 0(s3) + c->dsrl32(s4, s5, 0); // dsrl32 s4, s5, 0 + c->daddiu(t3, t3, 16); // daddiu t3, t3, 16 + c->pand(t8, t8, t1); // pand t8, t8, t1 + c->lq(t9, 0, s2); // lq t9, 0(s2) + c->psraw(gp, t8, 8); // psraw gp, t8, 8 + c->lq(t8, 0, s5); // lq t8, 0(s5) + c->pextuw(s1, t9, t7); // pextuw s1, t9, t7 + c->lq(ra, 0, s4); // lq ra, 0(s4) + c->daddiu(t5, t5, 16); // daddiu t5, t5, 16 + c->daddiu(v1, v1, 8); // daddiu v1, v1, 8 + c->daddiu(t4, t4, 16); // daddiu t4, t4, 16 + c->daddiu(t6, t6, 16); // daddiu t6, t6, 16 + c->pextuw(s0, ra, t8); // pextuw s0, ra, t8 + c->lq(s3, 16, s3); // lq s3, 16(s3) + c->pcpyud(s1, s1, s0); // pcpyud s1, s1, s0 + c->lq(s2, 16, s2); // lq s2, 16(s2) + c->paddh(s0, s1, t0); // paddh s0, s1, t0 + c->lq(s1, 16, s5); // lq s1, 16(s5) + c->pand(s5, s0, a1); // pand s5, s0, a1 + c->lq(s0, 16, s4); // lq s0, 16(s4) + c->pextlw(s4, s2, s3); // pextlw s4, s2, s3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextuw(s3, s2, s3); // pextuw s3, s2, s3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlw(s2, s0, s1); // pextlw s2, s0, s1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextuw(s0, s0, s1); // pextuw s0, s0, s1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyld(s1, s2, s4); // pcpyld s1, s2, s4 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyud(s4, s4, s2); // pcpyud s4, s4, s2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyud(s3, s3, s0); // pcpyud s3, s3, s0 + c->sq(s4, 0, t4); // sq s4, 0(t4) + c->pand(s4, s1, a1); // pand s4, s1, a1 + c->sq(s3, 0, t3); // sq s3, 0(t3) + c->por(s4, s4, gp); // por s4, s4, gp + c->mfc1(r0, f31); // mfc1 r0, f31 + c->por(gp, s5, gp); // por gp, s5, gp + c->sq(s4, 0, t6); // sq s4, 0(t6) + c->prot3w(ra, ra); // prot3w ra, ra + c->sq(gp, 0, t5); // sq gp, 0(t5) + c->prot3w(t9, t9); // prot3w t9, t9 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextuw(s5, t9, t7); // pextuw s5, t9, t7 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyld(t9, t8, t9); // pcpyld t9, t8, t9 + c->ld(gp, 0, v1); // ld gp, 0(v1) + c->pcpyld(t7, s5, t7); // pcpyld t7, s5, t7 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextuw(t8, ra, t8); // pextuw t8, ra, t8 + c->mfc1(r0, f31); // mfc1 r0, f31 + bc = c->sgpr64(v1) != c->sgpr64(a0); // bne v1, a0, L33 + c->pcpyld(ra, ra, t8); // pcpyld ra, ra, t8 + if (bc) {goto block_2;} // branch non-likely + + // nop // sll r0, r0, 0 + c->sq(t7, 0, t2); // sq t7, 0(t2) + // nop // sll r0, r0, 0 + c->sq(t9, 16, t2); // sq t9, 16(t2) + // nop // sll r0, r0, 0 + c->sq(ra, 32, t2); // sq ra, 32(t2) + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 12432, at); // ld ra, 12432(at) + c->lq(gp, 12544, at); // lq gp, 12544(at) + c->lq(s5, 12528, at); // lq s5, 12528(at) + c->lq(s4, 12512, at); // lq s4, 12512(at) + c->lq(s3, 12496, at); // lq s3, 12496(at) + c->lq(s2, 12480, at); // lq s2, 12480(at) + c->lq(s1, 12464, at); // lq s1, 12464(at) + c->lq(s0, 12448, at); // lq s0, 12448(at) + //jr ra // jr ra + c->daddiu(sp, sp, 128); // daddiu sp, sp, 128 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("generic-no-light-dproc", execute, 256); +} + +} // namespace generic_no_light_dproc +} // namespace Mips2C + + diff --git a/game/mips2c/functions/generic_merc.cpp b/game/mips2c/functions/generic_merc.cpp index 4174d4cce8..7b0f8afe7a 100644 --- a/game/mips2c/functions/generic_merc.cpp +++ b/game/mips2c/functions/generic_merc.cpp @@ -1,5 +1,6 @@ +#include "game/kernel/jak1/kscheme.h" #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +using namespace jak1; namespace Mips2C { namespace generic_prepare_dma_single { @@ -282,7 +283,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace generic_merc_execute_asm { struct Cache { @@ -1350,7 +1351,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace mercneric_convert { struct Cache { @@ -1921,8 +1922,7 @@ void vcallms_311(ExecutionContext* c, u16* vis) { vcallms_311_case_427(c, vis); break; default: - fmt::print("BAD JUMP {}\n", vis[vi01]); - ASSERT(false); + ASSERT_MSG(false, fmt::format("BAD JUMP {}", vis[vi01])); } } @@ -1955,8 +1955,7 @@ void vcallms_311_reference(ExecutionContext* c, u16* vis) { case 427: goto JUMP_427; default: - fmt::print("BAD JUMP {}\n", vis[vi01]); - ASSERT(false); + ASSERT_MSG(false, fmt::format("BAD JUMP {}", vis[vi01])); } JUMP_314: @@ -3539,7 +3538,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace high_speed_reject { struct Cache { diff --git a/game/mips2c/functions/generic_tie.cpp b/game/mips2c/functions/generic_tie.cpp new file mode 100644 index 0000000000..3d14810105 --- /dev/null +++ b/game/mips2c/functions/generic_tie.cpp @@ -0,0 +1,2195 @@ +// clang-format off +//--------------------------MIPS2C--------------------- +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak1/kscheme.h" +using namespace jak1; +namespace Mips2C { +namespace generic_tie_dma_to_spad_sync { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + // nop // sll r0, r0, 0 + get_fake_spad_addr(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->ori(a2, r0, 65535); // ori a2, r0, 65535 + c->lui(v1, 4096); // lui v1, 4096 + // nop // sll r0, r0, 0 + c->ori(v1, v1, 54272); // ori v1, v1, 54272 // SPR TO + c->and_(a2, a1, a2); // and a2, a1, a2 + /* + block_1: + c->lw(a3, 0, v1); // lw a3, 0(v1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(a3, a3, 256); // andi a3, a3, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a3) == 0; // beq a3, r0, L90 + // nop // sll r0, r0, 0 + if (bc) {goto block_3;} // branch non-likely + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + //beq r0, r0, L89 // beq r0, r0, L89 + // nop // sll r0, r0, 0 + goto block_1; // branch always + */ + + + c->addiu(a3, r0, 324); // addiu a3, r0, 324 + // c->sw(a2, 128, v1); // sw a2, 128(v1) + u32 sadr = c->sgpr64(a2); + // c->sw(a0, 48, v1); // sw a0, 48(v1) + u32 tadr = c->sgpr64(a0); + // c->sw(r0, 32, v1); // sw r0, 32(v1) + // Unknown instr: sync.l + // c->sw(a3, 0, v1); // sw a3, 0(v1) + // same and hack as generic merc. + spad_to_dma_blerc_chain(cache.fake_scratchpad_data, sadr & 0x3fff, tadr); + + /* + block_4: + c->lw(a0, 0, v1); // lw a0, 0(v1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(a0, a0, 256); // andi a0, a0, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a0) == 0; // beq a0, r0, L92 + // nop // sll r0, r0, 0 + if (bc) {goto block_6;} // branch non-likely + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + //beq r0, r0, L91 // beq r0, r0, L91 + // nop // sll r0, r0, 0 + goto block_4; // branch always + */ + + + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("generic-tie-dma-to-spad-sync", execute, 128); +} + +} // namespace generic_tie_dma_to_spad_sync +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +#include "game/mips2c/mips2c_private.h" + +namespace Mips2C { + +namespace generic_prepare_dma_double { +extern u64 execute(void* ctxt); +} + +namespace generic_envmap_dproc { +extern u64 execute(void* ctxt); +} +namespace generic_interp_dproc { +extern u64 execute(void* ctxt); +} +namespace generic_no_light_dproc { +extern u64 execute(void* ctxt); +} + +namespace generic_tie_convert { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; + +u16 vis[16]; + +u8 vu0_data_mem[1024 * 4]; + +void sq_buffer(Mask mask, const Vf& data, u32 qw) { + ASSERT(qw * 16 < sizeof(vu0_data_mem)); + for (int i = 0; i < 4; i++) { + if ((u64)mask & (1 << i)) { + memcpy(vu0_data_mem + qw * 16 + i * 4, data.data + i, 4); + } + } +} + +void lq_buffer(Mask mask, Vf& data, u32 qw) { + ASSERT(qw * 16 < sizeof(vu0_data_mem)); + for (int i = 0; i < 4; i++) { + if ((u64)mask & (1 << i)) { + memcpy(data.data + i, vu0_data_mem + qw * 16 + i * 4, 4); + } + } +} + + +void vcallms_104() { + // iaddi vi02, vi00, 0x0 | nop 104 + vis[vi02] = 0; + // iadd vi03, vi02, vi08 | nop 105 + vis[vi03] = vis[vi02] + vis[vi08]; + // iaddiu vi03, vi03, 0x10 | nop 106 + vis[vi03] = vis[vi03] + 0x10; /* 16 */ + // iadd vi01, vi03, vi09 | nop 107 + vis[vi01] = vis[vi03] + vis[vi09]; + // iadd vi01, vi01, vi09 | nop 108 + vis[vi01] = vis[vi01] + vis[vi09]; + // iaddiu vi01, vi01, 0x10 | nop 109 + vis[vi01] = vis[vi01] + 0x10; /* 16 */ + // iaddi vi10, vi00, 0x0 | nop 110 + vis[vi10] = 0; + // ior vi11, vi03, vi00 | nop 111 + vis[vi11] = vis[vi03]; + // ior vi12, vi01, vi00 | nop :e 112 + vis[vi12] = vis[vi01]; + // iadd vi13, vi01, vi08 | nop 113 + vis[vi13] = vis[vi01] + vis[vi08]; +} + +void vcallms_114(ExecutionContext* c) { + // nop | itof12.xyzw vf09, vf05 114 + c->vfs[vf09].vf.itof12(Mask::xyzw, c->vf_src(vf05).vf); + // nop | itof12.xyzw vf10, vf06 115 + c->vfs[vf10].vf.itof12(Mask::xyzw, c->vf_src(vf06).vf); + // nop | itof12.xyzw vf11, vf07 116 + c->vfs[vf11].vf.itof12(Mask::xyzw, c->vf_src(vf07).vf); + // nop | itof12.xyzw vf12, vf08 117 + c->vfs[vf12].vf.itof12(Mask::xyzw, c->vf_src(vf08).vf); + // sqi.xyzw vf09, vi01 | nop 118 + sq_buffer(Mask::xyzw, c->vf_src(vf09).vf, vis[vi01]++); + // sqi.xyzw vf10, vi01 | nop 119 + sq_buffer(Mask::xyzw, c->vf_src(vf10).vf, vis[vi01]++); + // sqi.xyzw vf11, vi01 | nop :e 120 + sq_buffer(Mask::xyzw, c->vf_src(vf11).vf, vis[vi01]++); + // sqi.xyzw vf12, vi01 | nop 121 + sq_buffer(Mask::xyzw, c->vf_src(vf12).vf, vis[vi01]++); +} + +void vcallms_122(ExecutionContext* c) { + // mr32.w vf17, vf13 | itof0.xyz vf09, vf01 122 + c->vfs[vf09].vf.itof0(Mask::xyz, c->vf_src(vf01).vf); c->vfs[vf17].vf.mr32(Mask::w, c->vf_src(vf13).vf); + // mr32.w vf18, vf14 | itof0.xyz vf10, vf02 123 + c->vfs[vf10].vf.itof0(Mask::xyz, c->vf_src(vf02).vf); c->vfs[vf18].vf.mr32(Mask::w, c->vf_src(vf14).vf); + // mr32.w vf19, vf15 | itof0.xyz vf11, vf03 124 + c->vfs[vf11].vf.itof0(Mask::xyz, c->vf_src(vf03).vf); c->vfs[vf19].vf.mr32(Mask::w, c->vf_src(vf15).vf); + // mr32.w vf20, vf16 | itof0.xyz vf12, vf04 125 + c->vfs[vf12].vf.itof0(Mask::xyz, c->vf_src(vf04).vf); c->vfs[vf20].vf.mr32(Mask::w, c->vf_src(vf16).vf); + // move.w vf09, vf17 | nop 126 + c->vfs[vf09].vf.move(Mask::w, c->vf_src(vf17).vf); + // move.w vf10, vf18 | nop 127 + c->vfs[vf10].vf.move(Mask::w, c->vf_src(vf18).vf); + // move.w vf11, vf19 | nop 128 + c->vfs[vf11].vf.move(Mask::w, c->vf_src(vf19).vf); + // move.w vf12, vf20 | nop 129 + c->vfs[vf12].vf.move(Mask::w, c->vf_src(vf20).vf); + // sqi.xyzw vf09, vi02 | nop 130 + sq_buffer(Mask::xyzw, c->vf_src(vf09).vf, vis[vi02]++); + // sqi.xyzw vf10, vi02 | nop 131 + sq_buffer(Mask::xyzw, c->vf_src(vf10).vf, vis[vi02]++); + // sqi.xyzw vf11, vi02 | nop :e 132 + sq_buffer(Mask::xyzw, c->vf_src(vf11).vf, vis[vi02]++); + // sqi.xyzw vf12, vi02 | nop 133 + sq_buffer(Mask::xyzw, c->vf_src(vf12).vf, vis[vi02]++); +} + +void vcallms_134(ExecutionContext* c) { + // mr32.w vf17, vf13 | itof0.xyz vf09, vf01 134 + c->vfs[vf09].vf.itof0(Mask::xyz, c->vf_src(vf01).vf); c->vfs[vf17].vf.mr32(Mask::w, c->vf_src(vf13).vf); + // mr32.w vf18, vf14 | itof0.xyz vf10, vf02 135 + c->vfs[vf10].vf.itof0(Mask::xyz, c->vf_src(vf02).vf); c->vfs[vf18].vf.mr32(Mask::w, c->vf_src(vf14).vf); + // nop | itof0.xyz vf11, vf03 136 + c->vfs[vf11].vf.itof0(Mask::xyz, c->vf_src(vf03).vf); + // nop | nop 137 + + // move.w vf09, vf17 | nop 138 + c->vfs[vf09].vf.move(Mask::w, c->vf_src(vf17).vf); + // move.w vf10, vf18 | nop 139 + c->vfs[vf10].vf.move(Mask::w, c->vf_src(vf18).vf); + // nop | nop 140 + + // iaddi vi03, vi03, 0x2 | nop 141 + vis[vi03] = vis[vi03] + 2; + // sqi.xyzw vf09, vi02 | nop 142 + sq_buffer(Mask::xyzw, c->vf_src(vf09).vf, vis[vi02]++); + // sq.xyzw vf10, -2(vi03) | nop :e 143 + sq_buffer(Mask::xyzw, c->vf_src(vf10).vf, vis[vi03] + -2); + // sq.xyzw vf11, -1(vi03) | nop 144 + sq_buffer(Mask::xyzw, c->vf_src(vf11).vf, vis[vi03] + -1); +} + +void vcallms_145(ExecutionContext* c) { + // mr32.w vf17, vf13 | itof0.xyz vf09, vf01 145 + c->vfs[vf09].vf.itof0(Mask::xyz, c->vf_src(vf01).vf); c->vfs[vf17].vf.mr32(Mask::w, c->vf_src(vf13).vf); + // mr32.w vf18, vf14 | itof0.xyz vf10, vf02 146 + c->vfs[vf10].vf.itof0(Mask::xyz, c->vf_src(vf02).vf); c->vfs[vf18].vf.mr32(Mask::w, c->vf_src(vf14).vf); + // mr32.w vf19, vf15 | itof0.xyz vf11, vf03 147 + c->vfs[vf11].vf.itof0(Mask::xyz, c->vf_src(vf03).vf); c->vfs[vf19].vf.mr32(Mask::w, c->vf_src(vf15).vf); + // nop | itof0.xyz vf12, vf04 148 + c->vfs[vf12].vf.itof0(Mask::xyz, c->vf_src(vf04).vf); + // move.w vf09, vf17 | nop 149 + c->vfs[vf09].vf.move(Mask::w, c->vf_src(vf17).vf); + // move.w vf10, vf18 | nop 150 + c->vfs[vf10].vf.move(Mask::w, c->vf_src(vf18).vf); + // move.w vf11, vf19 | nop 151 + c->vfs[vf11].vf.move(Mask::w, c->vf_src(vf19).vf); + // iaddi vi03, vi03, 0x2 | nop 152 + vis[vi03] = vis[vi03] + 2; + // sqi.xyzw vf09, vi02 | nop 153 + sq_buffer(Mask::xyzw, c->vf_src(vf09).vf, vis[vi02]++); + // sqi.xyzw vf10, vi02 | nop 154 + sq_buffer(Mask::xyzw, c->vf_src(vf10).vf, vis[vi02]++); + // sq.xyzw vf11, -2(vi03) | nop :e 155 + sq_buffer(Mask::xyzw, c->vf_src(vf11).vf, vis[vi03] + -2); + // sq.xyzw vf12, -1(vi03) | nop 156 + sq_buffer(Mask::xyzw, c->vf_src(vf12).vf, vis[vi03] + -1); +} + +void vcallms_157(ExecutionContext* c) { + // mr32.w vf17, vf13 | itof0.xyz vf09, vf01 157 + c->vfs[vf09].vf.itof0(Mask::xyz, c->vf_src(vf01).vf); c->vfs[vf17].vf.mr32(Mask::w, c->vf_src(vf13).vf); + // mr32.w vf18, vf14 | itof0.xyz vf10, vf02 158 + c->vfs[vf10].vf.itof0(Mask::xyz, c->vf_src(vf02).vf); c->vfs[vf18].vf.mr32(Mask::w, c->vf_src(vf14).vf); + // mr32.w vf19, vf15 | itof0.xyz vf11, vf03 159 + c->vfs[vf11].vf.itof0(Mask::xyz, c->vf_src(vf03).vf); c->vfs[vf19].vf.mr32(Mask::w, c->vf_src(vf15).vf); + // nop | nop 160 + + // move.w vf09, vf17 | nop 161 + c->vfs[vf09].vf.move(Mask::w, c->vf_src(vf17).vf); + // move.w vf10, vf18 | nop 162 + c->vfs[vf10].vf.move(Mask::w, c->vf_src(vf18).vf); + // move.w vf11, vf19 | nop 163 + c->vfs[vf11].vf.move(Mask::w, c->vf_src(vf19).vf); + // nop | nop 164 + + // sqi.xyzw vf09, vi02 | nop 165 + sq_buffer(Mask::xyzw, c->vf_src(vf09).vf, vis[vi02]++); + // sqi.xyzw vf10, vi02 | nop :e 166 + sq_buffer(Mask::xyzw, c->vf_src(vf10).vf, vis[vi02]++); + // sqi.xyzw vf11, vi02 | nop 167 + sq_buffer(Mask::xyzw, c->vf_src(vf11).vf, vis[vi02]++); +} + +void vcallms_168(ExecutionContext* c) { + // mr32.w vf17, vf13 | itof0.xyz vf09, vf01 168 + c->vfs[vf09].vf.itof0(Mask::xyz, c->vf_src(vf01).vf); c->vfs[vf17].vf.mr32(Mask::w, c->vf_src(vf13).vf); + // mr32.w vf19, vf14 | itof0.xyz vf10, vf02 169 + c->vfs[vf10].vf.itof0(Mask::xyz, c->vf_src(vf02).vf); c->vfs[vf19].vf.mr32(Mask::w, c->vf_src(vf14).vf); + // nop | itof0.xyz vf11, vf03 170 + c->vfs[vf11].vf.itof0(Mask::xyz, c->vf_src(vf03).vf); + // iaddi vi03, vi03, 0x4 | itof0.xyz vf12, vf04 171 + c->vfs[vf12].vf.itof0(Mask::xyz, c->vf_src(vf04).vf); vis[vi03] = vis[vi03] + 4; + // move.w vf09, vf17 | nop 172 + c->vfs[vf09].vf.move(Mask::w, c->vf_src(vf17).vf); + // move.w vf11, vf19 | nop 173 + c->vfs[vf11].vf.move(Mask::w, c->vf_src(vf19).vf); + // sq.xyz vf10, -3(vi03) | nop 174 + sq_buffer(Mask::xyz, c->vf_src(vf10).vf, vis[vi03] + -3); + // sq.xyz vf12, -1(vi03) | nop 175 + sq_buffer(Mask::xyz, c->vf_src(vf12).vf, vis[vi03] + -1); + // sq.xyzw vf09, -4(vi03) | nop :e 176 + sq_buffer(Mask::xyzw, c->vf_src(vf09).vf, vis[vi03] + -4); + // sq.xyzw vf11, -2(vi03) | nop 177 + sq_buffer(Mask::xyzw, c->vf_src(vf11).vf, vis[vi03] + -2); +} + +void vcallms_183(ExecutionContext* c); + +void vcallms_178(ExecutionContext* c) { + // ior vi02, vi10, vi00 | nop 178 + vis[vi02] = vis[vi10]; + // ior vi01, vi12, vi00 | nop 179 + vis[vi01] = vis[vi12]; + // lqi.xyzw vf05, vi02 | nop 180 + lq_buffer(Mask::xyzw, c->vfs[vf05].vf, vis[vi02]++); + // nop | nop 181 + + // nop | nop 182 + vcallms_183(c); +} + +void vcallms_183(ExecutionContext* c) { + // lqi.xyzw vf09, vi01 | mulaw.xyzw ACC, vf04, vf00 183 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf04).vf, c->vf_src(vf00).vf.w()); lq_buffer(Mask::xyzw, c->vfs[vf09].vf, vis[vi01]++); + // move.xyzw vf19, vf21 | maddax.xyzw ACC, vf01, vf05 184 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf05].vf.x()); c->vfs[vf19].vf.move(Mask::xyzw, c->vf_src(vf21).vf); + // move.xyzw vf16, vf22 | madday.xyzw ACC, vf02, vf05 185 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf05].vf.y()); c->vfs[vf16].vf.move(Mask::xyzw, c->vf_src(vf22).vf); + // move.xyzw vf20, vf23 | maddz.xyz vf13, vf03, vf05 186 + c->acc.vf.madd(Mask::xyz, c->vfs[vf13].vf, c->vf_src(vf03).vf, c->vf_src(vf05).vf.z()); c->vfs[vf20].vf.move(Mask::xyzw, c->vf_src(vf23).vf); + // lqi.xyzw vf06, vi02 | mulax.xyzw ACC, vf01, vf09 187 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf09).vf.x()); lq_buffer(Mask::xyzw, c->vfs[vf06].vf, vis[vi02]++); + // move.xyzw vf15, vf24 | madday.xyzw ACC, vf02, vf09 188 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf09].vf.y()); c->vfs[vf15].vf.move(Mask::xyzw, c->vf_src(vf24).vf); + // nop | maddz.xyzw vf17, vf03, vf09 189 + c->acc.vf.madd(Mask::xyzw, c->vfs[vf17].vf, c->vf_src(vf03).vf, c->vf_src(vf09).vf.z()); + // lqi.xyzw vf10, vi01 | mulaw.xyzw ACC, vf04, vf00 190 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf04).vf, c->vf_src(vf00).vf.w()); lq_buffer(Mask::xyzw, c->vfs[vf10].vf, vis[vi01]++); + // move.w vf13, vf05 | maddax.xyzw ACC, vf01, vf06 191 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf06].vf.x()); c->vfs[vf13].vf.move(Mask::w, c->vf_src(vf05).vf); + // nop | madday.xyzw ACC, vf02, vf06 192 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf06].vf.y()); + // nop | maddz.xyz vf14, vf03, vf06 193 + c->acc.vf.madd(Mask::xyz, c->vfs[vf14].vf, c->vf_src(vf03).vf, c->vf_src(vf06).vf.z()); + // lqi.xyzw vf07, vi02 | mulax.xyzw ACC, vf01, vf10 194 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf10).vf.x()); lq_buffer(Mask::xyzw, c->vfs[vf07].vf, vis[vi02]++); + // nop | madday.xyzw ACC, vf02, vf10 195 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf10].vf.y()); + // nop | maddz.xyzw vf18, vf03, vf10 196 + c->acc.vf.madd(Mask::xyzw, c->vfs[vf18].vf, c->vf_src(vf03).vf, c->vf_src(vf10).vf.z()); + // lqi.xyzw vf11, vi01 | mulaw.xyzw ACC, vf04, vf00 197 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf04).vf, c->vf_src(vf00).vf.w()); lq_buffer(Mask::xyzw, c->vfs[vf11].vf, vis[vi01]++); + // move.w vf14, vf06 | maddax.xyzw ACC, vf01, vf07 198 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf07].vf.x()); c->vfs[vf14].vf.move(Mask::w, c->vf_src(vf06).vf); + // nop | madday.xyzw ACC, vf02, vf07 199 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf07].vf.y()); + // nop | maddz.xyz vf24, vf03, vf07 200 + c->acc.vf.madd(Mask::xyz, c->vfs[vf24].vf, c->vf_src(vf03).vf, c->vf_src(vf07).vf.z()); + // lqi.xyzw vf08, vi02 | mulax.xyzw ACC, vf01, vf11 201 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf11).vf.x()); lq_buffer(Mask::xyzw, c->vfs[vf08].vf, vis[vi02]++); + // nop | madday.xyzw ACC, vf02, vf11 202 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf11].vf.y()); + // nop | maddz.xyzw vf21, vf03, vf11 203 + c->acc.vf.madd(Mask::xyzw, c->vfs[vf21].vf, c->vf_src(vf03).vf, c->vf_src(vf11).vf.z()); + // lqi.xyzw vf12, vi01 | mulaw.xyzw ACC, vf04, vf00 204 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf04).vf, c->vf_src(vf00).vf.w()); lq_buffer(Mask::xyzw, c->vfs[vf12].vf, vis[vi01]++); + // move.w vf24, vf07 | maddax.xyzw ACC, vf01, vf08 205 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf08].vf.x()); c->vfs[vf24].vf.move(Mask::w, c->vf_src(vf07).vf); + // nop | madday.xyzw ACC, vf02, vf08 206 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf08].vf.y()); + // nop | maddz.xyz vf22, vf03, vf08 207 + c->acc.vf.madd(Mask::xyz, c->vfs[vf22].vf, c->vf_src(vf03).vf, c->vf_src(vf08).vf.z()); + // lqi.xyzw vf05, vi02 | mulax.xyzw ACC, vf01, vf12 208 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf12).vf.x()); lq_buffer(Mask::xyzw, c->vfs[vf05].vf, vis[vi02]++); + // move.w vf22, vf08 | madday.xyzw ACC, vf02, vf12 :e 209 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf12].vf.y()); c->vfs[vf22].vf.move(Mask::w, c->vf_src(vf08).vf); + // nop | maddz.xyzw vf23, vf03, vf12 210 + c->acc.vf.madd(Mask::xyzw, c->vfs[vf23].vf, c->vf_src(vf03).vf, c->vf_src(vf12).vf.z()); +} + +void vcallms_211(ExecutionContext* c) { + // move.xyzw vf19, vf21 | nop 211 + c->vfs[vf19].vf.move(Mask::xyzw, c->vf_src(vf21).vf); + // move.xyzw vf16, vf22 | nop 212 + c->vfs[vf16].vf.move(Mask::xyzw, c->vf_src(vf22).vf); + // move.xyzw vf20, vf23 | nop :e 213 + c->vfs[vf20].vf.move(Mask::xyzw, c->vf_src(vf23).vf); + // move.xyzw vf15, vf24 | nop 214 + c->vfs[vf15].vf.move(Mask::xyzw, c->vf_src(vf24).vf); +} +void vcallms_221(ExecutionContext* c); + +void vcallms_215(ExecutionContext* c) { + // ior vi03, vi11, vi00 | nop 215 + vis[vi03] = vis[vi11]; + // ior vi01, vi13, vi00 | nop 216 + vis[vi01] = vis[vi13]; + // lqi.xyzw vf05, vi03 | nop 217 + lq_buffer(Mask::xyzw, c->vfs[vf05].vf, vis[vi03]++); + // lqi.xyzw vf25, vi03 | nop 218 + lq_buffer(Mask::xyzw, c->vfs[vf25].vf, vis[vi03]++); + // lqi.xyzw vf09, vi01 | nop 219 + lq_buffer(Mask::xyzw, c->vfs[vf09].vf, vis[vi01]++); + // nop | nop 220 + vcallms_221(c); +} + +void vcallms_221(ExecutionContext* c) { + // move.xyzw vf16, vf21 | mulax.xyz ACC, vf05, vf29 221 + c->acc.vf.mula(Mask::xyz, c->vf_src(vf05).vf, c->vf_src(vf29).vf.x()); c->vfs[vf16].vf.move(Mask::xyzw, c->vf_src(vf21).vf); + // nop | maddw.xyz vf30, vf25, vf00 222 + c->acc.vf.madd(Mask::xyz, c->vfs[vf30].vf, c->vf_src(vf25).vf, c->vf_src(vf00).vf.w()); + // nop | mulax.xyzw ACC, vf01, vf09 223 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf09).vf.x()); + // nop | madday.xyzw ACC, vf02, vf09 224 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf09].vf.y()); + // move.w vf13, vf05 | maddz.xyz vf17, vf03, vf09 225 + c->acc.vf.madd(Mask::xyz, c->vfs[vf17].vf, c->vf_src(vf03).vf, c->vf_src(vf09).vf.z()); c->vfs[vf13].vf.move(Mask::w, c->vf_src(vf05).vf); + // lqi.xyzw vf06, vi03 | mulaw.xyzw ACC, vf04, vf00 226 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf04).vf, c->vf_src(vf00).vf.w()); lq_buffer(Mask::xyzw, c->vfs[vf06].vf, vis[vi03]++); + // lqi.xyzw vf26, vi03 | maddax.xyzw ACC, vf01, vf30 227 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf30].vf.x()); lq_buffer(Mask::xyzw, c->vfs[vf26].vf, vis[vi03]++); + // lqi.xyzw vf10, vi01 | madday.xyzw ACC, vf02, vf30 228 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf30].vf.y()); lq_buffer(Mask::xyzw, c->vfs[vf10].vf, vis[vi01]++); + // nop | maddz.xyz vf13, vf03, vf30 229 + c->acc.vf.madd(Mask::xyz, c->vfs[vf13].vf, c->vf_src(vf03).vf, c->vf_src(vf30).vf.z()); + // nop | mulax.xyz ACC, vf06, vf29 230 + c->acc.vf.mula(Mask::xyz, c->vf_src(vf06).vf, c->vf_src(vf29).vf.x()); + // nop | maddw.xyz vf30, vf26, vf00 231 + c->acc.vf.madd(Mask::xyz, c->vfs[vf30].vf, c->vf_src(vf26).vf, c->vf_src(vf00).vf.w()); + // nop | mulax.xyzw ACC, vf01, vf10 232 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf10).vf.x()); + // nop | madday.xyzw ACC, vf02, vf10 233 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf10].vf.y()); + // move.w vf14, vf06 | maddz.xyz vf18, vf03, vf10 234 + c->acc.vf.madd(Mask::xyz, c->vfs[vf18].vf, c->vf_src(vf03).vf, c->vf_src(vf10).vf.z()); c->vfs[vf14].vf.move(Mask::w, c->vf_src(vf06).vf); + // lqi.xyzw vf07, vi03 | mulaw.xyzw ACC, vf04, vf00 235 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf04).vf, c->vf_src(vf00).vf.w()); lq_buffer(Mask::xyzw, c->vfs[vf07].vf, vis[vi03]++); + // lqi.xyzw vf27, vi03 | maddax.xyzw ACC, vf01, vf30 236 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf30].vf.x()); lq_buffer(Mask::xyzw, c->vfs[vf27].vf, vis[vi03]++); + // lqi.xyzw vf11, vi01 | madday.xyzw ACC, vf02, vf30 237 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf30].vf.y()); lq_buffer(Mask::xyzw, c->vfs[vf11].vf, vis[vi01]++); + // nop | maddz.xyz vf14, vf03, vf30 238 + c->acc.vf.madd(Mask::xyz, c->vfs[vf14].vf, c->vf_src(vf03).vf, c->vf_src(vf30).vf.z()); + // nop | mulax.xyz ACC, vf07, vf29 239 + c->acc.vf.mula(Mask::xyz, c->vf_src(vf07).vf, c->vf_src(vf29).vf.x()); + // nop | maddw.xyz vf30, vf27, vf00 240 + c->acc.vf.madd(Mask::xyz, c->vfs[vf30].vf, c->vf_src(vf27).vf, c->vf_src(vf00).vf.w()); + // nop | mulax.xyzw ACC, vf01, vf11 241 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf11).vf.x()); + // nop | madday.xyzw ACC, vf02, vf11 242 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf11].vf.y()); + // move.w vf15, vf07 | maddz.xyz vf19, vf03, vf11 243 + c->acc.vf.madd(Mask::xyz, c->vfs[vf19].vf, c->vf_src(vf03).vf, c->vf_src(vf11).vf.z()); c->vfs[vf15].vf.move(Mask::w, c->vf_src(vf07).vf); + // lqi.xyzw vf08, vi03 | mulaw.xyzw ACC, vf04, vf00 244 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf04).vf, c->vf_src(vf00).vf.w()); lq_buffer(Mask::xyzw, c->vfs[vf08].vf, vis[vi03]++); + // lqi.xyzw vf28, vi03 | maddax.xyzw ACC, vf01, vf30 245 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf30].vf.x()); lq_buffer(Mask::xyzw, c->vfs[vf28].vf, vis[vi03]++); + // lqi.xyzw vf12, vi01 | madday.xyzw ACC, vf02, vf30 246 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf30].vf.y()); lq_buffer(Mask::xyzw, c->vfs[vf12].vf, vis[vi01]++); + // nop | maddz.xyz vf15, vf03, vf30 247 + c->acc.vf.madd(Mask::xyz, c->vfs[vf15].vf, c->vf_src(vf03).vf, c->vf_src(vf30).vf.z()); + // nop | mulax.xyz ACC, vf08, vf29 248 + c->acc.vf.mula(Mask::xyz, c->vf_src(vf08).vf, c->vf_src(vf29).vf.x()); + // nop | maddw.xyz vf30, vf28, vf00 249 + c->acc.vf.madd(Mask::xyz, c->vfs[vf30].vf, c->vf_src(vf28).vf, c->vf_src(vf00).vf.w()); + // nop | mulax.xyzw ACC, vf01, vf12 250 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf12).vf.x()); + // nop | madday.xyzw ACC, vf02, vf12 251 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf12].vf.y()); + // move.w vf21, vf08 | maddz.xyz vf20, vf03, vf12 252 + c->acc.vf.madd(Mask::xyz, c->vfs[vf20].vf, c->vf_src(vf03).vf, c->vf_src(vf12).vf.z()); c->vfs[vf21].vf.move(Mask::w, c->vf_src(vf08).vf); + // lqi.xyzw vf05, vi03 | mulaw.xyzw ACC, vf04, vf00 253 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf04).vf, c->vf_src(vf00).vf.w()); lq_buffer(Mask::xyzw, c->vfs[vf05].vf, vis[vi03]++); + // lqi.xyzw vf25, vi03 | maddax.xyzw ACC, vf01, vf30 254 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf30].vf.x()); lq_buffer(Mask::xyzw, c->vfs[vf25].vf, vis[vi03]++); + // lqi.xyzw vf09, vi01 | madday.xyzw ACC, vf02, vf30 :e 255 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf30].vf.y()); lq_buffer(Mask::xyzw, c->vfs[vf09].vf, vis[vi01]++); + // nop | maddz.xyz vf21, vf03, vf30 256 + c->acc.vf.madd(Mask::xyz, c->vfs[vf21].vf, c->vf_src(vf03).vf, c->vf_src(vf30).vf.z()); +} + +void vcallms_257(ExecutionContext* c) { + // move.xyzw vf16, vf21 | nop :e 257 + c->vfs[vf16].vf.move(Mask::xyzw, c->vf_src(vf21).vf); + // nop | nop 258 +} + +void vcallms_264(ExecutionContext* c); +void vcallms_259(ExecutionContext* c) { + // ior vi01, vi13, vi00 | nop 259 + vis[vi01] = vis[vi13]; + // lqi.xyzw vf09, vi01 | nop 260 + lq_buffer(Mask::xyzw, c->vfs[vf09].vf, vis[vi01]++); + // ior vi03, vi11, vi00 | nop 261 + vis[vi03] = vis[vi11]; + // lq.xyzw vf05, 1(vi03) | nop 262 + lq_buffer(Mask::xyzw, c->vfs[vf05].vf, vis[vi03] + 1); + // iaddi vi03, vi03, 0x2 | nop 263 + vis[vi03] = vis[vi03] + 2; + vcallms_264(c); +} + +void vcallms_264(ExecutionContext* c) { + // move.xyzw vf15, vf21 | mulax.xyzw ACC, vf01, vf09 264 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf09).vf.x()); c->vfs[vf15].vf.move(Mask::xyzw, c->vf_src(vf21).vf); + // move.xyzw vf20, vf22 | madday.xyzw ACC, vf02, vf09 265 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf09].vf.y()); c->vfs[vf20].vf.move(Mask::xyzw, c->vf_src(vf22).vf); + // lq.w vf13, -2(vi03) | maddz.xyz vf17, vf03, vf09 266 + c->acc.vf.madd(Mask::xyz, c->vfs[vf17].vf, c->vf_src(vf03).vf, c->vf_src(vf09).vf.z()); lq_buffer(Mask::w, c->vfs[vf13].vf, vis[vi03] + -2); + // lqi.xyzw vf10, vi01 | mulaw.xyzw ACC, vf04, vf00 267 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf04).vf, c->vf_src(vf00).vf.w()); lq_buffer(Mask::xyzw, c->vfs[vf10].vf, vis[vi01]++); + // move.xyzw vf16, vf23 | maddax.xyzw ACC, vf01, vf05 268 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf05].vf.x()); c->vfs[vf16].vf.move(Mask::xyzw, c->vf_src(vf23).vf); + // lq.xyzw vf06, 1(vi03) | madday.xyzw ACC, vf02, vf05 269 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf05].vf.y()); lq_buffer(Mask::xyzw, c->vfs[vf06].vf, vis[vi03] + 1); + // iaddi vi03, vi03, 0x2 | maddz.xyz vf13, vf03, vf05 270 + c->acc.vf.madd(Mask::xyz, c->vfs[vf13].vf, c->vf_src(vf03).vf, c->vf_src(vf05).vf.z()); vis[vi03] = vis[vi03] + 2; + // nop | mulax.xyzw ACC, vf01, vf10 271 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf10).vf.x()); + // nop | madday.xyzw ACC, vf02, vf10 272 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf10].vf.y()); + // lq.w vf14, -2(vi03) | maddz.xyz vf18, vf03, vf10 273 + c->acc.vf.madd(Mask::xyz, c->vfs[vf18].vf, c->vf_src(vf03).vf, c->vf_src(vf10).vf.z()); lq_buffer(Mask::w, c->vfs[vf14].vf, vis[vi03] + -2); + // lqi.xyzw vf11, vi01 | mulaw.xyzw ACC, vf04, vf00 274 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf04).vf, c->vf_src(vf00).vf.w()); lq_buffer(Mask::xyzw, c->vfs[vf11].vf, vis[vi01]++); + // nop | maddax.xyzw ACC, vf01, vf06 275 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf06].vf.x()); + // lq.xyzw vf07, 1(vi03) | madday.xyzw ACC, vf02, vf06 276 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf06].vf.y()); lq_buffer(Mask::xyzw, c->vfs[vf07].vf, vis[vi03] + 1); + // iaddi vi03, vi03, 0x2 | maddz.xyz vf14, vf03, vf06 277 + c->acc.vf.madd(Mask::xyz, c->vfs[vf14].vf, c->vf_src(vf03).vf, c->vf_src(vf06).vf.z()); vis[vi03] = vis[vi03] + 2; + // nop | mulax.xyzw ACC, vf01, vf11 278 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf11).vf.x()); + // nop | madday.xyzw ACC, vf02, vf11 279 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf11].vf.y()); + // lq.w vf21, -2(vi03) | maddz.xyz vf19, vf03, vf11 280 + c->acc.vf.madd(Mask::xyz, c->vfs[vf19].vf, c->vf_src(vf03).vf, c->vf_src(vf11).vf.z()); lq_buffer(Mask::w, c->vfs[vf21].vf, vis[vi03] + -2); + // lqi.xyzw vf12, vi01 | mulaw.xyzw ACC, vf04, vf00 281 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf04).vf, c->vf_src(vf00).vf.w()); lq_buffer(Mask::xyzw, c->vfs[vf12].vf, vis[vi01]++); + // nop | maddax.xyzw ACC, vf01, vf07 282 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf07].vf.x()); + // lq.xyzw vf08, 1(vi03) | madday.xyzw ACC, vf02, vf07 283 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf07].vf.y()); lq_buffer(Mask::xyzw, c->vfs[vf08].vf, vis[vi03] + 1); + // iaddi vi03, vi03, 0x2 | maddz.xyz vf21, vf03, vf07 284 + c->acc.vf.madd(Mask::xyz, c->vfs[vf21].vf, c->vf_src(vf03).vf, c->vf_src(vf07).vf.z()); vis[vi03] = vis[vi03] + 2; + // nop | mulax.xyzw ACC, vf01, vf12 285 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf12).vf.x()); + // nop | madday.xyzw ACC, vf02, vf12 286 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf12].vf.y()); + // lq.w vf23, -2(vi03) | maddz.xyz vf22, vf03, vf12 287 + c->acc.vf.madd(Mask::xyz, c->vfs[vf22].vf, c->vf_src(vf03).vf, c->vf_src(vf12).vf.z()); lq_buffer(Mask::w, c->vfs[vf23].vf, vis[vi03] + -2); + // lqi.xyzw vf09, vi01 | mulaw.xyzw ACC, vf04, vf00 288 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf04).vf, c->vf_src(vf00).vf.w()); lq_buffer(Mask::xyzw, c->vfs[vf09].vf, vis[vi01]++); + // nop | maddax.xyzw ACC, vf01, vf08 289 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf08].vf.x()); + // lq.xyzw vf05, 1(vi03) | madday.xyzw ACC, vf02, vf08 :e 290 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf02].vf, c->vfs[vf08].vf.y()); lq_buffer(Mask::xyzw, c->vfs[vf05].vf, vis[vi03] + 1); + // iaddi vi03, vi03, 0x2 | maddz.xyz vf23, vf03, vf08 291 + c->acc.vf.madd(Mask::xyz, c->vfs[vf23].vf, c->vf_src(vf03).vf, c->vf_src(vf08).vf.z()); vis[vi03] = vis[vi03] + 2; +} + +void vcallms_292(ExecutionContext* c) { + // move.xyzw vf15, vf21 | nop 292 + c->vfs[vf15].vf.move(Mask::xyzw, c->vf_src(vf21).vf); + // move.xyzw vf20, vf22 | nop :e 293 + c->vfs[vf20].vf.move(Mask::xyzw, c->vf_src(vf22).vf); + // move.xyzw vf16, vf23 | nop 294 + c->vfs[vf16].vf.move(Mask::xyzw, c->vf_src(vf23).vf); +} + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + get_fake_spad_addr(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + u32 call_addr = 0; + u32 madr, sadr, qwc; + c->daddiu(sp, sp, -128); // daddiu sp, sp, -128 + c->sd(ra, 384, at); // sd ra, 384(at) + c->sq(s0, 400, at); // sq s0, 400(at) + c->sq(s1, 416, at); // sq s1, 416(at) + c->sq(s2, 432, at); // sq s2, 432(at) + c->sq(s3, 448, at); // sq s3, 448(at) + c->sq(s4, 464, at); // sq s4, 464(at) + c->sq(s5, 480, at); // sq s5, 480(at) + c->sq(gp, 496, at); // sq gp, 496(at) + + block_1: + c->lui(v1, 4096); // lui v1, 4096 + get_fake_spad_addr(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->ori(v1, v1, 54272); // ori v1, v1, 54272 + // nop // sll r0, r0, 0 + + /* + block_2: + c->lw(a0, 0, v1); // lw a0, 0(v1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(a0, a0, 256); // andi a0, a0, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a0) == 0; // beq a0, r0, L11 + // nop // sll r0, r0, 0 + if (bc) {goto block_4;} // branch non-likely + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(gp, gp, 1); // daddiu gp, gp, 1 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + //beq r0, r0, L10 // beq r0, r0, L10 + // nop // sll r0, r0, 0 + goto block_2; // branch always + */ + + + // nop // sll r0, r0, 0 + c->lw(v1, 724, at); // lw v1, 724(at) + // nop // sll r0, r0, 0 + c->lw(a2, 728, at); // lw a2, 728(at) + c->dsubu(a0, v1, r0); // dsubu a0, v1, r0 + c->lw(a1, 732, at); // lw a1, 732(at) + bc = c->sgpr64(a0) != 0; // bne a0, r0, L15 + c->daddiu(a0, at, 640); // daddiu a0, at, 640 + if (bc) {goto block_13;} // branch non-likely + + c->addiu(t0, a1, 16); // addiu t0, a1, 16 + c->lhu(a3, 0, a1); // lhu a3, 0(a1) + c->sll(t2, a3, 4); // sll t2, a3, 4 + c->lw(t1, 8, a1); // lw t1, 8(a1) + c->addiu(a2, at, 7632); // addiu a2, at, 7632 + c->addu(a1, t0, t2); // addu a1, t0, t2 + // nop // sll r0, r0, 0 + c->lq(t2, 0, t1); // lq t2, 0(t1) + // nop // sll r0, r0, 0 + c->lq(t3, 16, t1); // lq t3, 16(t1) + // nop // sll r0, r0, 0 + c->lq(t4, 32, t1); // lq t4, 32(t1) + // nop // sll r0, r0, 0 + c->lq(t5, 48, t1); // lq t5, 48(t1) + // nop // sll r0, r0, 0 + c->lq(t1, 64, t1); // lq t1, 64(t1) + // nop // sll r0, r0, 0 + c->sq(t2, 12064, at); // sq t2, 12064(at) + // nop // sll r0, r0, 0 + c->sq(t3, 12080, at); // sq t3, 12080(at) + // nop // sll r0, r0, 0 + c->sq(t4, 12096, at); // sq t4, 12096(at) + // nop // sll r0, r0, 0 + c->sq(t5, 12112, at); // sq t5, 12112(at) + // nop // sll r0, r0, 0 + c->sq(t1, 12128, at); // sq t1, 12128(at) + c->mov64(t1, a2); // or t1, a2, r0 + // nop // sll r0, r0, 0 + c->daddiu(t2, a3, -4); // daddiu t2, a3, -4 + c->mov64(t1, t1); // or t1, t1, r0 + bc = ((s64)c->sgpr64(t2)) < 0; // bltz t2, L13 + c->mov64(t0, t0); // or t0, t0, r0 + if (bc) {goto block_7;} // branch non-likely + + + block_6: + // nop // sll r0, r0, 0 + c->lq(t5, 0, t0); // lq t5, 0(t0) + // nop // sll r0, r0, 0 + c->lq(t2, 16, t0); // lq t2, 16(t0) + c->daddiu(a3, a3, -4); // daddiu a3, a3, -4 + c->lq(t3, 32, t0); // lq t3, 32(t0) + c->daddiu(t1, t1, 64); // daddiu t1, t1, 64 + c->lq(t4, 48, t0); // lq t4, 48(t0) + c->daddiu(t0, t0, 64); // daddiu t0, t0, 64 + c->sq(t5, -64, t1); // sq t5, -64(t1) + c->daddiu(t5, a3, -4); // daddiu t5, a3, -4 + c->sq(t2, -48, t1); // sq t2, -48(t1) + // nop // sll r0, r0, 0 + c->sq(t3, -32, t1); // sq t3, -32(t1) + bc = ((s64)c->sgpr64(t5)) >= 0; // bgez t5, L12 + c->sq(t4, -16, t1); // sq t4, -16(t1) + if (bc) {goto block_6;} // branch non-likely + + + block_7: + bc = c->sgpr64(a3) == 0; // beq a3, r0, L14 + c->lq(t2, 0, t0); // lq t2, 0(t0) + if (bc) {goto block_12;} // branch non-likely + + c->daddiu(t0, t0, 16); // daddiu t0, t0, 16 + c->daddiu(t1, t1, 16); // daddiu t1, t1, 16 + c->daddiu(a3, a3, -1); // daddiu a3, a3, -1 + c->sq(t2, -16, t1); // sq t2, -16(t1) + bc = c->sgpr64(a3) == 0; // beq a3, r0, L14 + c->lq(t2, 0, t0); // lq t2, 0(t0) + if (bc) {goto block_12;} // branch non-likely + + c->daddiu(t0, t0, 16); // daddiu t0, t0, 16 + c->daddiu(t1, t1, 16); // daddiu t1, t1, 16 + c->daddiu(a3, a3, -1); // daddiu a3, a3, -1 + c->sq(t2, -16, t1); // sq t2, -16(t1) + bc = c->sgpr64(a3) == 0; // beq a3, r0, L14 + c->lq(t2, 0, t0); // lq t2, 0(t0) + if (bc) {goto block_12;} // branch non-likely + + c->daddiu(t0, t0, 16); // daddiu t0, t0, 16 + c->daddiu(t1, t1, 16); // daddiu t1, t1, 16 + c->daddiu(a3, a3, -1); // daddiu a3, a3, -1 + c->sq(t2, -16, t1); // sq t2, -16(t1) + bc = c->sgpr64(a3) == 0; // beq a3, r0, L14 + c->lq(t2, 0, t0); // lq t2, 0(t0) + if (bc) {goto block_12;} // branch non-likely + + c->daddiu(t0, t0, 16); // daddiu t0, t0, 16 + c->daddiu(t0, t1, 16); // daddiu t0, t1, 16 + c->daddiu(a3, a3, -1); // daddiu a3, a3, -1 + c->sq(t2, -16, t0); // sq t2, -16(t0) + + block_12: + c->gprs[a3].du64[0] = 0; // or a3, r0, r0 + //beq r0, r0, L16 // beq r0, r0, L16 + c->sw(a2, 640, at); // sw a2, 640(at) + goto block_15; // branch always + + + block_13: + c->daddiu(a3, v1, -1); // daddiu a3, v1, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a3) != 0; // bne a3, r0, L17 + c->mov64(t2, a2); // or t2, a2, r0 + if (bc) {goto block_16;} // branch non-likely + + // nop // sll r0, r0, 0 + c->daddiu(a1, a1, 528); // daddiu a1, a1, 528 + // nop // sll r0, r0, 0 + + block_15: + c->addiu(a2, a1, 16); // addiu a2, a1, 16 + c->lhu(a3, 0, a1); // lhu a3, 0(a1) + c->sll(t0, a3, 4); // sll t0, a3, 4 + c->lwu(t1, 28, a2); // lwu t1, 28(a2) + c->sll(t2, t1, 2); // sll t2, t1, 2 + c->lwu(a3, 12, a1); // lwu a3, 12(a1) + c->addu(t1, t2, t1); // addu t1, t2, t1 + c->lwu(a1, 8, a1); // lwu a1, 8(a1) + c->addu(t0, a2, t0); // addu t0, a2, t0 + c->sw(a3, 48, a0); // sw a3, 48(a0) + c->sll(a3, t1, 4); // sll a3, t1, 4 + c->sw(a1, 52, a0); // sw a1, 52(a0) + c->daddiu(a1, t0, 16); // daddiu a1, t0, 16 + c->lhu(t0, 0, t0); // lhu t0, 0(t0) + c->daddu(a3, a2, a3); // daddu a3, a2, a3 + c->sw(a2, 4, a0); // sw a2, 4(a0) + c->sll(a2, t0, 4); // sll a2, t0, 4 + c->sw(a3, 8, a0); // sw a3, 8(a0) + c->daddu(a2, a1, a2); // daddu a2, a1, a2 + c->sw(a1, 12, a0); // sw a1, 12(a0) + c->daddiu(a1, a2, 16); // daddiu a1, a2, 16 + c->lhu(a2, 0, a2); // lhu a2, 0(a2) + c->sll(t2, a2, 4); // sll t2, a2, 4 + c->lhu(a2, 14, a1); // lhu a2, 14(a1) + c->daddiu(a3, a1, 32); // daddiu a3, a1, 32 + c->lhu(t0, 10, a1); // lhu t0, 10(a1) + c->daddu(t0, t0, a1); // daddu t0, t0, a1 + c->lhu(t1, 12, a1); // lhu t1, 12(a1) + c->daddu(t1, t1, a1); // daddu t1, t1, a1 + c->lhu(t3, 0, a1); // lhu t3, 0(a1) + c->daddu(t2, a1, t2); // daddu t2, a1, t2 + c->sw(a1, 16, a0); // sw a1, 16(a0) + c->daddiu(t2, t2, 16); // daddiu t2, t2, 16 + c->sw(a3, 20, a0); // sw a3, 20(a0) + c->daddu(a1, a2, a1); // daddu a1, a2, a1 + c->sw(t1, 28, a0); // sw t1, 28(a0) + // nop // sll r0, r0, 0 + c->sw(a1, 32, a0); // sw a1, 32(a0) + //beq r0, r0, L17 // beq r0, r0, L17 + c->sw(t0, 24, a0); // sw t0, 24(a0) + goto block_16; // branch always + + + block_16: + c->daddiu(a1, t2, 16); // daddiu a1, t2, 16 + c->lwu(a3, 12, t2); // lwu a3, 12(t2) + c->daddiu(a2, a1, 112); // daddiu a2, a1, 112 + c->sw(a3, 44, a0); // sw a3, 44(a0) + // nop // sll r0, r0, 0 + c->lhu(a3, -16, a2); // lhu a3, -16(a2) + // nop // sll r0, r0, 0 + c->sw(a1, 36, a0); // sw a1, 36(a0) + // nop // sll r0, r0, 0 + c->sw(a2, 40, a0); // sw a2, 40(a0) + // nop // sll r0, r0, 0 + c->sw(v1, 56, a0); // sw v1, 56(a0) + // nop // sll r0, r0, 0 + c->lw(v1, 744, at); // lw v1, 744(at) + // nop // sll r0, r0, 0 + c->lw(a0, 76, at); // lw a0, 76(at) + c->dsubu(v1, a0, v1); // dsubu v1, a0, v1 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(v1)) >= 0; // bgez v1, L51 + // nop // sll r0, r0, 0 + if (bc) {goto block_70;} // branch non-likely + + get_fake_spad_addr(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lw(v1, 684, at); // lw v1, 684(at) + c->lui(a1, 1); // lui a1, 1 + c->lw(a0, 688, at); // lw a0, 688(at) + c->dsubu(a1, v1, a1); // dsubu a1, v1, a1 + c->lw(a2, 692, at); // lw a2, 692(at) + bc = ((s64)c->sgpr64(a1)) > 0; // bgtz a1, L19 + c->lw(a1, 728, at); // lw a1, 728(at) + if (bc) {goto block_23;} // branch non-likely + + bc = c->sgpr64(a2) != 0; // bne a2, r0, L18 + c->lw(v1, 732, at); // lw v1, 732(at) + if (bc) {goto block_21;} // branch non-likely + + c->xori(a1, v1, 3248); // xori a1, v1, 3248 + c->mov64(v1, a0); // or v1, a0, r0 + c->daddiu(a3, a1, 2880); // daddiu a3, a1, 2880 + c->sw(a1, 732, at); // sw a1, 732(at) + c->xori(a2, a3, 7264); // xori a2, a3, 7264 + c->sw(a3, 728, at); // sw a3, 728(at) + c->addiu(a3, r0, 0); // addiu a3, r0, 0 + c->daddu(a1, a1, r0); // daddu a1, a1, r0 + c->andi(a2, a2, 65535); // andi a2, a2, 65535 + c->sw(a3, 724, at); // sw a3, 724(at) + bc = c->sgpr64(a0) != 0; // bne a0, r0, L20 + c->sw(a2, 736, at); // sw a2, 736(at) + if (bc) {goto block_24;} // branch non-likely + + c->addiu(v1, r0, 1); // addiu v1, r0, 1 + // nop // sll r0, r0, 0 + //beq r0, r0, L21 // beq r0, r0, L21 + c->sw(v1, 740, at); // sw v1, 740(at) + goto block_25; // branch always + + + block_21: + c->xori(a1, v1, 3248); // xori a1, v1, 3248 + c->mov64(v1, a0); // or v1, a0, r0 + c->daddiu(a3, a1, 2880); // daddiu a3, a1, 2880 + c->sw(a1, 732, at); // sw a1, 732(at) + c->xori(a2, a3, 7264); // xori a2, a3, 7264 + c->sw(a3, 728, at); // sw a3, 728(at) + c->addiu(a3, r0, 1); // addiu a3, r0, 1 + c->daddiu(a1, a1, 528); // daddiu a1, a1, 528 + c->andi(a2, a2, 65535); // andi a2, a2, 65535 + c->sw(a3, 724, at); // sw a3, 724(at) + bc = c->sgpr64(a0) != 0; // bne a0, r0, L20 + c->sw(a2, 736, at); // sw a2, 736(at) + if (bc) {goto block_24;} // branch non-likely + + c->addiu(v1, r0, 1); // addiu v1, r0, 1 + // nop // sll r0, r0, 0 + //beq r0, r0, L21 // beq r0, r0, L21 + c->sw(v1, 740, at); // sw v1, 740(at) + goto block_25; // branch always + + + block_23: + c->mov64(v1, v1); // or v1, v1, r0 + c->lw(a2, 736, at); // lw a2, 736(at) + c->addiu(a0, r0, 2); // addiu a0, r0, 2 + // nop // sll r0, r0, 0 + c->xor_(a1, a1, a2); // xor a1, a1, a2 + c->sw(a0, 724, at); // sw a0, 724(at) + //beq r0, r0, L20 // beq r0, r0, L20 + c->sw(a1, 728, at); // sw a1, 728(at) + goto block_24; // branch always + + + block_24: + get_fake_spad_addr(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->ori(a2, r0, 65535); // ori a2, r0, 65535 + c->lui(a0, 4096); // lui a0, 4096 + // nop // sll r0, r0, 0 + c->ori(a0, a0, 54272); // ori a0, a0, 54272 + c->and_(a1, a1, a2); // and a1, a1, a2 + c->addiu(a2, r0, 324); // addiu a2, r0, 324 + { + // spr to + sadr = c->sgpr64(a1); + u32 tadr = c->sgpr64(v1); + spad_to_dma_blerc_chain(cache.fake_scratchpad_data, sadr & 0x3fff, tadr); + } +// c->sw(a1, 128, a0); // sw a1, 128(a0) +// c->sw(v1, 48, a0); // sw v1, 48(a0) +// c->sw(r0, 32, a0); // sw r0, 32(a0) +// c->sw(a2, 0, a0); // sw a2, 0(a0) + + block_25: + // nop // sll r0, r0, 0 + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + get_fake_spad_addr(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->daddiu(t2, at, 640); // daddiu t2, at, 640 + c->lw(a0, 716, at); // lw a0, 716(at) + // nop // sll r0, r0, 0 + c->lw(a1, 56, t2); // lw a1, 56(t2) + // nop // sll r0, r0, 0 + c->lw(v1, 4, t2); // lw v1, 4(t2) + // nop // sll r0, r0, 0 + c->lw(v1, 8, t2); // lw v1, 8(t2) + // nop // sll r0, r0, 0 + c->lw(t3, 12, t2); // lw t3, 12(t2) + // nop // sll r0, r0, 0 + c->lw(t1, 16, t2); // lw t1, 16(t2) + // nop // sll r0, r0, 0 + c->lw(v1, 32, t2); // lw v1, 32(t2) + // nop // sll r0, r0, 0 + c->lw(t5, 20, t2); // lw t5, 20(t2) + // nop // sll r0, r0, 0 + c->lw(t6, 24, t2); // lw t6, 24(t2) + // nop // sll r0, r0, 0 + c->lw(t4, 28, t2); // lw t4, 28(t2) + // nop // sll r0, r0, 0 + c->lw(a3, 36, t2); // lw a3, 36(t2) + // nop // sll r0, r0, 0 + c->lw(v1, 40, t2); // lw v1, 40(t2) + // nop // sll r0, r0, 0 + c->lw(t0, 0, t2); // lw t0, 0(t2) + // nop // sll r0, r0, 0 + c->lhu(a2, 20, t1); // lhu a2, 20(t1) + // nop // sll r0, r0, 0 + c->lhu(t8, 18, t1); // lhu t8, 18(t1) + c->daddiu(a2, a1, -2); // daddiu a2, a1, -2 + c->lbu(a1, 2, t1); // lbu a1, 2(t1) + bc = c->sgpr64(a2) == 0; // beq a2, r0, L38 + c->lbu(a2, 3, t1); // lbu a2, 3(t1) + if (bc) {goto block_52;} // branch non-likely + + c->daddu(t7, t8, t8); // daddu t7, t8, t8 + c->addiu(t9, r0, -16); // addiu t9, r0, -16 + c->daddiu(ra, t7, 15); // daddiu ra, t7, 15 + c->daddiu(t7, a0, 32); // daddiu t7, a0, 32 + c->and_(t9, ra, t9); // and t9, ra, t9 + c->lq(ra, 16, t1); // lq ra, 16(t1) + c->daddu(t9, t7, t9); // daddu t9, t7, t9 + c->sq(ra, 16, a0); // sq ra, 16(a0) + c->dsll(ra, t8, 5); // dsll ra, t8, 5 + c->sw(t7, 0, a0); // sw t7, 0(a0) + c->daddu(ra, t9, ra); // daddu ra, t9, ra + c->sw(t9, 4, a0); // sw t9, 4(a0) + c->daddiu(t8, t8, 7); // daddiu t8, t8, 7 + c->sw(ra, 8, a0); // sw ra, 8(a0) + c->dsra(t9, t8, 3); // dsra t9, t8, 3 + // nop // sll r0, r0, 0 + c->addiu(t8, r0, 2); // addiu t8, r0, 2 + // nop // sll r0, r0, 0 + c->mult3(s3, t8, t9); // mult3 s3, t8, t9 + c->mov64(ra, t6); // or ra, t6, r0 + c->mov64(t6, t8); // or t6, t8, r0 + c->mov64(t7, t7); // or t7, t7, r0 + c->addiu(t8, r0, 513); // addiu t8, r0, 513 + c->addiu(t9, r0, 257); // addiu t9, r0, 257 + c->dsll(s1, t8, 18); // dsll s1, t8, 18 + c->dsll(s2, t9, 16); // dsll s2, t9, 16 + c->or_(t8, t8, s1); // or t8, t8, s1 + c->or_(t9, t9, s2); // or t9, t9, s2 + c->dsll32(s1, t8, 4); // dsll32 s1, t8, 4 + c->dsll32(s2, t9, 0); // dsll32 s2, t9, 0 + c->or_(t8, t8, s1); // or t8, t8, s1 + c->or_(t9, t9, s2); // or t9, t9, s2 + c->pcpyld(t8, t8, t8); // pcpyld t8, t8, t8 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyld(t9, t9, t9); // pcpyld t9, t9, t9 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->daddu(s3, s3, ra); // daddu s3, s3, ra + c->mfc1(r0, f31); // mfc1 r0, f31 + c->lhu(s2, 0, ra); // lhu s2, 0(ra) + c->daddu(ra, ra, t6); // daddu ra, ra, t6 + // nop // sll r0, r0, 0 + c->mov64(t5, t5); // or t5, t5, r0 + // nop // sll r0, r0, 0 + c->pextlb(s2, s2, s2); // pextlb s2, s2, s2 + //beq r0, r0, L23 // beq r0, r0, L23 + c->pextlb(s1, s2, s2); // pextlb s1, s2, s2 + goto block_28; // branch always + + + block_27: + c->daddiu(t5, t5, 16); // daddiu t5, t5, 16 + // nop // sll r0, r0, 0 + c->daddu(ra, ra, t6); // daddu ra, ra, t6 + c->daddiu(t7, t7, 32); // daddiu t7, t7, 32 + c->pextlb(s1, s1, s1); // pextlb s1, s1, s1 + c->sq(s2, -16, t7); // sq s2, -16(t7) + + block_28: + c->pextlb(s2, s1, s1); // pextlb s2, s1, s1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pand(s2, s2, t8); // pand s2, s2, t8 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pceqb(s1, s2, t8); // pceqb s1, s2, t8 + c->lq(s2, 0, t5); // lq s2, 0(t5) + c->pand(v0, s1, t9); // pand v0, s1, t9 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlb(s1, v0, s2); // pextlb s1, v0, s2 + c->lhu(s0, 0, ra); // lhu s0, 0(ra) + c->pextub(s2, v0, s2); // pextub s2, v0, s2 + c->sq(s1, 0, t7); // sq s1, 0(t7) + bc = c->sgpr64(ra) != c->sgpr64(s3); // bne ra, s3, L22 + c->pextlb(s1, s0, s0); // pextlb s1, s0, s0 + if (bc) {goto block_27;} // branch non-likely + + // nop // sll r0, r0, 0 + c->sq(s2, 16, t7); // sq s2, 16(t7) + c->gprs[t5].du64[0] = 0; // or t5, r0, r0 + bc = c->sgpr64(a2) == 0; // beq a2, r0, L24 + // nop // sll r0, r0, 0 + if (bc) {goto block_31;} // branch non-likely + + c->daddiu(t6, a2, 7); // daddiu t6, a2, 7 + c->daddiu(t5, at, 700); // daddiu t5, at, 700 + // nop // sll r0, r0, 0 + c->lw(t2, 32, t2); // lw t2, 32(t2) + c->sra(t6, t6, 3); // sra t6, t6, 3 + c->sh(r0, 0, t5); // sh r0, 0(t5) + // nop // sll r0, r0, 0 + c->sh(a1, 4, t5); // sh a1, 4(t5) + // nop // sll r0, r0, 0 + c->sh(a2, 2, t5); // sh a2, 2(t5) + // nop // sll r0, r0, 0 + c->sw(t2, 8, t5); // sw t2, 8(t5) + // nop // sll r0, r0, 0 + c->sw(t5, 80, at); // sw t5, 80(at) + //beq r0, r0, L25 // beq r0, r0, L25 + // nop // sll r0, r0, 0 + goto block_32; // branch always + + + block_31: + // nop // sll r0, r0, 0 + c->sw(r0, 80, at); // sw r0, 80(at) + // nop // sll r0, r0, 0 + + block_32: + c->daddu(t5, a1, a2); // daddu t5, a1, a2 + c->mov64(t2, t4); // or t2, t4, r0 + c->daddiu(t4, t5, 3); // daddiu t4, t5, 3 + vis[vi09] = c->gpr_src(a2).du16[0]; // ctc2.i vi9, a2 + c->sra(t5, t4, 2); // sra t5, t4, 2 + c->lq(t4, 0, t2); // lq t4, 0(t2) + c->sll(t5, t5, 4); // sll t5, t5, 4 + c->daddiu(t2, t2, 16); // daddiu t2, t2, 16 + c->pextub(t7, t4, r0); // pextub t7, t4, r0 + vis[vi08] = c->gpr_src(a1).du16[0]; // ctc2.i vi8, a1 + c->pextlb(t6, t4, r0); // pextlb t6, t4, r0 + vis[vi09] = c->gpr_src(a2).du16[0]; // ctc2.i vi9, a2 + c->daddu(t4, t2, t5); // daddu t4, t2, t5 + // Unknown instr: vcallms 104 + vcallms_104(); + + block_33: + c->pextuh(t5, t7, r0); // pextuh t5, t7, r0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlh(t7, t7, r0); // pextlh t7, t7, r0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextuh(t8, t6, r0); // pextuh t8, t6, r0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlh(t6, t6, r0); // pextlh t6, t6, r0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psraw(t9, t6, 19); // psraw t9, t6, 19 + c->lq(t6, 0, t2); // lq t6, 0(t2) + c->psraw(t8, t8, 19); // psraw t8, t8, 19 + c->mov128_vf_gpr(vf5, t9); // qmtc2.ni vf5, t9 + c->psraw(t7, t7, 19); // psraw t7, t7, 19 + c->mov128_vf_gpr(vf6, t8); // qmtc2.ni vf6, t8 + c->psraw(t5, t5, 19); // psraw t5, t5, 19 + c->mov128_vf_gpr(vf7, t7); // qmtc2.ni vf7, t7 + c->pextub(t7, t6, r0); // pextub t7, t6, r0 + c->mov128_vf_gpr(vf8, t5); // qmtc2.ni vf8, t5 + c->pextlb(t6, t6, r0); // pextlb t6, t6, r0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + // Unknown instr: vcallms 114 + vcallms_114(c); + bc = c->sgpr64(t2) != c->sgpr64(t4); // bne t2, t4, L26 + c->daddiu(t2, t2, 16); // daddiu t2, t2, 16 + if (bc) {goto block_33;} // branch non-likely + + // nop // sll r0, r0, 0 + c->mov64(t2, t3); // or t2, t3, r0 + bc = c->sgpr64(a1) == 0; // beq a1, r0, L34 + c->daddiu(t4, a1, -4); // daddiu t4, a1, -4 + if (bc) {goto block_48;} // branch non-likely + + bc = ((s64)c->sgpr64(t4)) <= 0; // blez t4, L29 + // nop // sll r0, r0, 0 + if (bc) {goto block_39;} // branch non-likely + + c->mov64(t2, t3); // or t2, t3, r0 + c->ld(t5, 0, t3); // ld t5, 0(t3) + c->daddiu(t4, a1, -8); // daddiu t4, a1, -8 + c->ld(t6, 16, t3); // ld t6, 16(t3) + c->pextlh(t7, t5, r0); // pextlh t7, t5, r0 + c->ld(t5, 32, t3); // ld t5, 32(t3) + c->pextlh(ra, t6, r0); // pextlh ra, t6, r0 + c->ld(t6, 48, t3); // ld t6, 48(t3) + c->pextlh(t8, t5, r0); // pextlh t8, t5, r0 + c->lwu(t5, 8, t3); // lwu t5, 8(t3) + c->pextlh(t9, t6, r0); // pextlh t9, t6, r0 + c->lwu(t6, 24, t3); // lwu t6, 24(t3) + c->psraw(s3, t7, 10); // psraw s3, t7, 10 + c->lwu(t7, 40, t3); // lwu t7, 40(t3) + c->psraw(ra, ra, 10); // psraw ra, ra, 10 + c->lwu(t3, 56, t3); // lwu t3, 56(t3) + c->psraw(t8, t8, 10); // psraw t8, t8, 10 + c->mov128_vf_gpr(vf1, s3); // qmtc2.ni vf1, s3 + c->psraw(t9, t9, 10); // psraw t9, t9, 10 + c->mov128_vf_gpr(vf2, ra); // qmtc2.ni vf2, ra + c->daddiu(t2, t2, 64); // daddiu t2, t2, 64 + c->mov128_vf_gpr(vf3, t8); // qmtc2.ni vf3, t8 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf4, t9); // qmtc2.ni vf4, t9 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf13, t5); // qmtc2.ni vf13, t5 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf14, t6); // qmtc2.ni vf14, t6 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf15, t7); // qmtc2.ni vf15, t7 + bc = ((s64)c->sgpr64(t4)) <= 0; // blez t4, L28 + c->mov128_vf_gpr(vf16, t3); // qmtc2.ni vf16, t3 + if (bc) {goto block_38;} // branch non-likely + + + block_37: + // Unknown instr: vcallms 122 + vcallms_122(c); + c->ld(t3, 0, t2); // ld t3, 0(t2) + c->daddiu(t4, t4, -4); // daddiu t4, t4, -4 + c->ld(t5, 16, t2); // ld t5, 16(t2) + c->pextlh(t8, t3, r0); // pextlh t8, t3, r0 + c->ld(t3, 32, t2); // ld t3, 32(t2) + c->pextlh(t9, t5, r0); // pextlh t9, t5, r0 + c->ld(t5, 48, t2); // ld t5, 48(t2) + c->pextlh(t6, t3, r0); // pextlh t6, t3, r0 + c->lwu(t3, 8, t2); // lwu t3, 8(t2) + c->pextlh(t7, t5, r0); // pextlh t7, t5, r0 + c->lwu(t5, 24, t2); // lwu t5, 24(t2) + c->psraw(ra, t8, 10); // psraw ra, t8, 10 + c->lwu(t8, 40, t2); // lwu t8, 40(t2) + c->psraw(t9, t9, 10); // psraw t9, t9, 10 + c->lwu(s3, 56, t2); // lwu s3, 56(t2) + c->psraw(t6, t6, 10); // psraw t6, t6, 10 + c->mov128_vf_gpr(vf1, ra); // qmtc2.ni vf1, ra + c->psraw(t7, t7, 10); // psraw t7, t7, 10 + c->mov128_vf_gpr(vf2, t9); // qmtc2.ni vf2, t9 + c->daddiu(t2, t2, 64); // daddiu t2, t2, 64 + c->mov128_vf_gpr(vf3, t6); // qmtc2.ni vf3, t6 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf4, t7); // qmtc2.ni vf4, t7 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf13, t3); // qmtc2.ni vf13, t3 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf14, t5); // qmtc2.ni vf14, t5 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf15, t8); // qmtc2.ni vf15, t8 + bc = ((s64)c->sgpr64(t4)) > 0; // bgtz t4, L27 + c->mov128_vf_gpr(vf16, s3); // qmtc2.ni vf16, s3 + if (bc) {goto block_37;} // branch non-likely + + + block_38: + // Unknown instr: vcallms 122 + vcallms_122(c); + // nop // sll r0, r0, 0 + + block_39: + bc = c->sgpr64(a2) == 0; // beq a2, r0, L33 + c->andi(t3, a1, 3); // andi t3, a1, 3 + if (bc) {goto block_47;} // branch non-likely + + bc = c->sgpr64(t3) == 0; // beq t3, r0, L33 + c->daddiu(t3, t3, -1); // daddiu t3, t3, -1 + if (bc) {goto block_47;} // branch non-likely + + bc = c->sgpr64(t3) == 0; // beq t3, r0, L30 + c->daddiu(t3, t3, -1); // daddiu t3, t3, -1 + if (bc) {goto block_44;} // branch non-likely + + bc = c->sgpr64(t3) == 0; // beq t3, r0, L31 + c->daddiu(t3, t3, -1); // daddiu t3, t3, -1 + if (bc) {goto block_45;} // branch non-likely + + //beq r0, r0, L32 // beq r0, r0, L32 + // nop // sll r0, r0, 0 + goto block_46; // branch always + + + block_44: + // nop // sll r0, r0, 0 + c->ld(t3, 0, t2); // ld t3, 0(t2) + // nop // sll r0, r0, 0 + c->ld(t4, 16, t2); // ld t4, 16(t2) + c->pextlh(t3, t3, r0); // pextlh t3, t3, r0 + c->ld(t6, 24, t2); // ld t6, 24(t2) + c->pextlh(t4, t4, r0); // pextlh t4, t4, r0 + c->lwu(t5, 8, t2); // lwu t5, 8(t2) + c->pextlh(t6, t6, r0); // pextlh t6, t6, r0 + c->lwu(t7, 32, t2); // lwu t7, 32(t2) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->psraw(t3, t3, 10); // psraw t3, t3, 10 + c->mov128_vf_gpr(vf13, t5); // qmtc2.ni vf13, t5 + c->psraw(t4, t4, 10); // psraw t4, t4, 10 + c->mov128_vf_gpr(vf14, t7); // qmtc2.ni vf14, t7 + c->psraw(t5, t6, 10); // psraw t5, t6, 10 + c->mov128_vf_gpr(vf1, t3); // qmtc2.ni vf1, t3 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf2, t4); // qmtc2.ni vf2, t4 + c->daddiu(t2, t2, 40); // daddiu t2, t2, 40 + c->mov128_vf_gpr(vf3, t5); // qmtc2.ni vf3, t5 + //beq r0, r0, L34 // beq r0, r0, L34 + // Unknown instr: vcallms 134 + vcallms_134(c); + goto block_48; // branch always + + + block_45: + // nop // sll r0, r0, 0 + c->ld(t4, 0, t2); // ld t4, 0(t2) + // nop // sll r0, r0, 0 + c->ld(t3, 16, t2); // ld t3, 16(t2) + c->pextlh(t8, t4, r0); // pextlh t8, t4, r0 + c->ld(t5, 32, t2); // ld t5, 32(t2) + c->pextlh(t4, t3, r0); // pextlh t4, t3, r0 + c->ld(t3, 40, t2); // ld t3, 40(t2) + c->pextlh(t5, t5, r0); // pextlh t5, t5, r0 + c->lwu(t6, 8, t2); // lwu t6, 8(t2) + c->pextlh(t7, t3, r0); // pextlh t7, t3, r0 + c->lwu(t3, 24, t2); // lwu t3, 24(t2) + c->psraw(t9, t8, 10); // psraw t9, t8, 10 + c->lwu(t8, 48, t2); // lwu t8, 48(t2) + c->psraw(t4, t4, 10); // psraw t4, t4, 10 + c->mov128_vf_gpr(vf13, t6); // qmtc2.ni vf13, t6 + c->psraw(t5, t5, 10); // psraw t5, t5, 10 + c->mov128_vf_gpr(vf1, t9); // qmtc2.ni vf1, t9 + c->psraw(t6, t7, 10); // psraw t6, t7, 10 + c->mov128_vf_gpr(vf2, t4); // qmtc2.ni vf2, t4 + c->daddiu(t2, t2, 56); // daddiu t2, t2, 56 + c->mov128_vf_gpr(vf3, t5); // qmtc2.ni vf3, t5 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf4, t6); // qmtc2.ni vf4, t6 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf14, t3); // qmtc2.ni vf14, t3 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf15, t8); // qmtc2.ni vf15, t8 + //beq r0, r0, L34 // beq r0, r0, L34 + // Unknown instr: vcallms 145 + vcallms_145(c); + goto block_48; // branch always + + + block_46: + // nop // sll r0, r0, 0 + c->ld(t4, 0, t2); // ld t4, 0(t2) + // nop // sll r0, r0, 0 + c->ld(t3, 16, t2); // ld t3, 16(t2) + c->pextlh(t7, t4, r0); // pextlh t7, t4, r0 + c->ld(t4, 32, t2); // ld t4, 32(t2) + c->pextlh(t5, t3, r0); // pextlh t5, t3, r0 + c->lwu(t3, 8, t2); // lwu t3, 8(t2) + c->pextlh(t6, t4, r0); // pextlh t6, t4, r0 + c->lwu(t4, 24, t2); // lwu t4, 24(t2) + c->psraw(t7, t7, 10); // psraw t7, t7, 10 + c->lwu(t8, 40, t2); // lwu t8, 40(t2) + c->psraw(t5, t5, 10); // psraw t5, t5, 10 + c->mov128_vf_gpr(vf13, t3); // qmtc2.ni vf13, t3 + c->psraw(t3, t6, 10); // psraw t3, t6, 10 + c->mov128_vf_gpr(vf1, t7); // qmtc2.ni vf1, t7 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf2, t5); // qmtc2.ni vf2, t5 + c->daddiu(t2, t2, 48); // daddiu t2, t2, 48 + c->mov128_vf_gpr(vf3, t3); // qmtc2.ni vf3, t3 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf14, t4); // qmtc2.ni vf14, t4 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf15, t8); // qmtc2.ni vf15, t8 + //beq r0, r0, L34 // beq r0, r0, L34 + // Unknown instr: vcallms 157 + vcallms_157(c); + goto block_48; // branch always + + + block_47: + // nop // sll r0, r0, 0 + c->ld(t3, 0, t2); // ld t3, 0(t2) + // nop // sll r0, r0, 0 + c->ld(t4, 16, t2); // ld t4, 16(t2) + c->pextlh(t7, t3, r0); // pextlh t7, t3, r0 + c->ld(t3, 32, t2); // ld t3, 32(t2) + c->pextlh(t8, t4, r0); // pextlh t8, t4, r0 + c->ld(t4, 48, t2); // ld t4, 48(t2) + c->pextlh(t5, t3, r0); // pextlh t5, t3, r0 + c->lwu(t3, 8, t2); // lwu t3, 8(t2) + c->pextlh(t6, t4, r0); // pextlh t6, t4, r0 + c->lwu(t4, 24, t2); // lwu t4, 24(t2) + c->psraw(t9, t7, 10); // psraw t9, t7, 10 + c->lwu(t7, 40, t2); // lwu t7, 40(t2) + c->psraw(t8, t8, 10); // psraw t8, t8, 10 + c->lwu(ra, 56, t2); // lwu ra, 56(t2) + c->psraw(t5, t5, 10); // psraw t5, t5, 10 + c->mov128_vf_gpr(vf1, t9); // qmtc2.ni vf1, t9 + c->psraw(t6, t6, 10); // psraw t6, t6, 10 + c->mov128_vf_gpr(vf2, t8); // qmtc2.ni vf2, t8 + c->daddiu(t2, t2, 64); // daddiu t2, t2, 64 + c->mov128_vf_gpr(vf3, t5); // qmtc2.ni vf3, t5 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf4, t6); // qmtc2.ni vf4, t6 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf13, t3); // qmtc2.ni vf13, t3 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf14, t4); // qmtc2.ni vf14, t4 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf15, t7); // qmtc2.ni vf15, t7 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf16, ra); // qmtc2.ni vf16, ra + bc = c->sgpr64(a2) == 0; // beq a2, r0, L37 + // Unknown instr: vcallms 122 + vcallms_122(c); + if (bc) {goto block_51;} // branch non-likely + + + block_48: + // nop // sll r0, r0, 0 + c->ld(t4, 0, t2); // ld t4, 0(t2) + c->daddiu(t3, a2, -2); // daddiu t3, a2, -2 + c->ld(t5, 8, t2); // ld t5, 8(t2) + c->pextlh(t4, t4, r0); // pextlh t4, t4, r0 + c->ld(t6, 24, t2); // ld t6, 24(t2) + c->pextlh(t5, t5, r0); // pextlh t5, t5, r0 + c->ld(t7, 32, t2); // ld t7, 32(t2) + c->pextlh(t6, t6, r0); // pextlh t6, t6, r0 + c->lwu(t8, 16, t2); // lwu t8, 16(t2) + c->pextlh(t7, t7, r0); // pextlh t7, t7, r0 + c->lwu(t9, 40, t2); // lwu t9, 40(t2) + c->psraw(t4, t4, 10); // psraw t4, t4, 10 + c->mov128_vf_gpr(vf13, t8); // qmtc2.ni vf13, t8 + c->psraw(t5, t5, 10); // psraw t5, t5, 10 + c->mov128_vf_gpr(vf14, t9); // qmtc2.ni vf14, t9 + c->psraw(t6, t6, 10); // psraw t6, t6, 10 + c->mov128_vf_gpr(vf1, t4); // qmtc2.ni vf1, t4 + c->psraw(t4, t7, 10); // psraw t4, t7, 10 + c->mov128_vf_gpr(vf2, t5); // qmtc2.ni vf2, t5 + c->daddiu(t2, t2, 48); // daddiu t2, t2, 48 + c->mov128_vf_gpr(vf3, t6); // qmtc2.ni vf3, t6 + bc = ((s64)c->sgpr64(t3)) <= 0; // blez t3, L36 + c->mov128_vf_gpr(vf4, t4); // qmtc2.ni vf4, t4 + if (bc) {goto block_50;} // branch non-likely + + + block_49: + // Unknown instr: vcallms 168 + vcallms_168(c); + c->ld(t4, 0, t2); // ld t4, 0(t2) + c->daddiu(t3, t3, -2); // daddiu t3, t3, -2 + c->ld(t5, 8, t2); // ld t5, 8(t2) + c->pextlh(t4, t4, r0); // pextlh t4, t4, r0 + c->ld(t6, 24, t2); // ld t6, 24(t2) + c->pextlh(t5, t5, r0); // pextlh t5, t5, r0 + c->ld(t7, 32, t2); // ld t7, 32(t2) + c->pextlh(t6, t6, r0); // pextlh t6, t6, r0 + c->lwu(t8, 16, t2); // lwu t8, 16(t2) + c->pextlh(t7, t7, r0); // pextlh t7, t7, r0 + c->lwu(t9, 40, t2); // lwu t9, 40(t2) + c->psraw(t4, t4, 10); // psraw t4, t4, 10 + c->mov128_vf_gpr(vf13, t8); // qmtc2.ni vf13, t8 + c->psraw(t5, t5, 10); // psraw t5, t5, 10 + c->mov128_vf_gpr(vf14, t9); // qmtc2.ni vf14, t9 + c->psraw(t6, t6, 10); // psraw t6, t6, 10 + c->mov128_vf_gpr(vf1, t4); // qmtc2.ni vf1, t4 + c->psraw(t4, t7, 10); // psraw t4, t7, 10 + c->mov128_vf_gpr(vf2, t5); // qmtc2.ni vf2, t5 + c->daddiu(t2, t2, 48); // daddiu t2, t2, 48 + c->mov128_vf_gpr(vf3, t6); // qmtc2.ni vf3, t6 + bc = ((s64)c->sgpr64(t3)) > 0; // bgtz t3, L35 + c->mov128_vf_gpr(vf4, t4); // qmtc2.ni vf4, t4 + if (bc) {goto block_49;} // branch non-likely + + + block_50: + // Unknown instr: vcallms 168 + vcallms_168(c); + // nop // sll r0, r0, 0 + + block_51: + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + + block_52: + c->mov64(t3, a1); // or t3, a1, r0 + c->lw(t6, 80, a3); // lw t6, 80(a3) + c->mov64(t4, v1); // or t4, v1, r0 + c->lw(t1, 4, t1); // lw t1, 4(t1) + c->daddiu(t5, at, 12048); // daddiu t5, at, 12048 + c->sw(t6, 92, at); // sw t6, 92(at) + c->pextlb(t2, r0, t1); // pextlb t2, r0, t1 + c->lq(t1, 0, a3); // lq t1, 0(a3) + c->pextlh(t7, t6, t6); // pextlh t7, t6, t6 + c->lq(t6, 16, a3); // lq t6, 16(a3) + c->pextlh(t8, t7, t7); // pextlh t8, t7, t7 + c->lq(t7, 32, a3); // lq t7, 32(a3) + c->pmulth(r0, t2, t8); // pmulth r0, t2, t8 + c->lq(t2, 48, a3); // lq t2, 48(a3) + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf1, t1); // qmtc2.ni vf1, t1 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf2, t6); // qmtc2.ni vf2, t6 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf3, t7); // qmtc2.ni vf3, t7 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf4, t2); // qmtc2.ni vf4, t2 + // Unknown instr: vcallms 178 + vcallms_178(c); + c->mov64(t1, t0); // or t1, t0, r0 + c->pextlw(t2, t1, t1); // pextlw t2, t1, t1 + c->lw(t1, 4, a0); // lw t1, 4(a0) + c->pcpyld(t2, t2, t2); // pcpyld t2, t2, t2 + c->lw(t8, 96, at); // lw t8, 96(at) + c->pmfhl_lh(t7); // pmfhl.lh t7 + c->lw(t6, 84, a3); // lw t6, 84(a3) + c->pextlb(t8, r0, t8); // pextlb t8, r0, t8 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psrlh(t7, t7, 7); // psrlh t7, t7, 7 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmulth(r0, t7, t8); // pmulth r0, t7, t8 + c->mfc1(r0, f31); // mfc1 r0, f31 + bc = c->sgpr64(t6) != 0; // bne t6, r0, L39 + c->mfc1(r0, f31); // mfc1 r0, f31 + if (bc) {goto block_54;} // branch non-likely + + // nop // sll r0, r0, 0 + c->addiu(t6, r0, 8); // addiu t6, r0, 8 + //beq r0, r0, L40 // beq r0, r0, L40 + c->sh(t6, 11984, at); // sh t6, 11984(at) + goto block_55; // branch always + + + block_54: + // nop // sll r0, r0, 0 + c->addiu(t6, r0, 6); // addiu t6, r0, 6 + // nop // sll r0, r0, 0 + c->sh(t6, 11984, at); // sh t6, 11984(at) + + block_55: + c->pmfhl_lh(t6); // pmfhl.lh t6 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psrlh(t6, t6, 7); // psrlh t6, t6, 7 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->ppacb(t6, r0, t6); // ppacb t6, r0, t6 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->lw(t7, 0, t4); // lw t7, 0(t4) + c->daddiu(t4, t4, 4); // daddiu t4, t4, 4 + c->sw(t6, 0, t5); // sw t6, 0(t5) + c->pextlb(t7, r0, t7); // pextlb t7, r0, t7 + c->sw(t6, 4, t5); // sw t6, 4(t5) + c->pextlh(t7, r0, t7); // pextlh t7, r0, t7 + c->sw(t6, 8, t5); // sw t6, 8(t5) + c->psllw(t7, t7, 2); // psllw t7, t7, 2 + c->sw(t6, 12, t5); // sw t6, 12(t5) + c->paddw(t9, t7, t2); // paddw t9, t7, t2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsrl32(s3, t9, 0); // dsrl32 s3, t9, 0 + c->mov128_gpr_vf(t7, vf17); // qmfc2.ni t7, vf17 + c->pcpyud(t5, t9, r0); // pcpyud t5, t9, r0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsrl32(t6, t5, 0); // dsrl32 t6, t5, 0 + c->mov128_gpr_vf(ra, vf13); // qmfc2.ni ra, vf13 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t8, vf14); // qmfc2.ni t8, vf14 + // nop // sll r0, r0, 0 + c->lwu(t9, 0, t9); // lwu t9, 0(t9) + // nop // sll r0, r0, 0 + c->lwu(s3, 0, s3); // lwu s3, 0(s3) + // nop // sll r0, r0, 0 + c->lwu(t5, 0, t5); // lwu t5, 0(t5) + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(s0, vf18); // qmfc2.ni s0, vf18 + // nop // sll r0, r0, 0 + c->lwu(t6, 0, t6); // lwu t6, 0(t6) + // nop // sll r0, r0, 0 + c->sq(ra, 0, t1); // sq ra, 0(t1) + c->daddiu(t3, t3, -4); // daddiu t3, t3, -4 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(t3)) <= 0; // blez t3, L42 + // nop // sll r0, r0, 0 + if (bc) {goto block_57;} // branch non-likely + + + block_56: + // Unknown instr: vcallms 183 + vcallms_183(c); + c->sq(t7, 16, t1); // sq t7, 16(t1) + // nop // sll r0, r0, 0 + c->sw(t9, 28, t1); // sw t9, 28(t1) + // nop // sll r0, r0, 0 + c->sq(t8, 32, t1); // sq t8, 32(t1) + // nop // sll r0, r0, 0 + c->sq(s0, 48, t1); // sq s0, 48(t1) + // nop // sll r0, r0, 0 + c->sw(s3, 60, t1); // sw s3, 60(t1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->lw(t8, 0, t4); // lw t8, 0(t4) + c->daddiu(t4, t4, 4); // daddiu t4, t4, 4 + c->mov128_gpr_vf(t7, vf19); // qmfc2.ni t7, vf19 + c->pextlb(t9, r0, t8); // pextlb t9, r0, t8 + c->mov128_gpr_vf(t8, vf20); // qmfc2.ni t8, vf20 + c->pextlh(t9, r0, t9); // pextlh t9, r0, t9 + c->mov128_gpr_vf(s3, vf15); // qmfc2.ni s3, vf15 + c->psllw(ra, t9, 2); // psllw ra, t9, 2 + c->mov128_gpr_vf(t9, vf16); // qmfc2.ni t9, vf16 + c->paddw(s0, ra, t2); // paddw s0, ra, t2 + c->sq(t7, 80, t1); // sq t7, 80(t1) + c->dsrl32(v0, s0, 0); // dsrl32 v0, s0, 0 + c->mov128_gpr_vf(t7, vf17); // qmfc2.ni t7, vf17 + c->pcpyud(ra, s0, r0); // pcpyud ra, s0, r0 + c->sq(s3, 64, t1); // sq s3, 64(t1) + c->dsrl32(s2, ra, 0); // dsrl32 s2, ra, 0 + c->mov128_gpr_vf(s1, vf13); // qmfc2.ni s1, vf13 + // nop // sll r0, r0, 0 + c->sq(t8, 112, t1); // sq t8, 112(t1) + // nop // sll r0, r0, 0 + c->sw(t5, 92, t1); // sw t5, 92(t1) + // nop // sll r0, r0, 0 + c->sw(t6, 124, t1); // sw t6, 124(t1) + // nop // sll r0, r0, 0 + c->sq(t9, 96, t1); // sq t9, 96(t1) + // nop // sll r0, r0, 0 + c->lwu(t9, 0, s0); // lwu t9, 0(s0) + // nop // sll r0, r0, 0 + c->lwu(s3, 0, v0); // lwu s3, 0(v0) + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t8, vf14); // qmfc2.ni t8, vf14 + c->daddiu(t1, t1, 128); // daddiu t1, t1, 128 + c->mov128_gpr_vf(s0, vf18); // qmfc2.ni s0, vf18 + c->daddiu(t3, t3, -4); // daddiu t3, t3, -4 + c->lwu(t5, 0, ra); // lwu t5, 0(ra) + // nop // sll r0, r0, 0 + c->sq(s1, 0, t1); // sq s1, 0(t1) + bc = ((s64)c->sgpr64(t3)) > 0; // bgtz t3, L41 + c->lwu(t6, 0, s2); // lwu t6, 0(s2) + if (bc) {goto block_56;} // branch non-likely + + + block_57: + // Unknown instr: vcallms 211 + vcallms_211(c); + c->sq(t7, 16, t1); // sq t7, 16(t1) + // nop // sll r0, r0, 0 + c->sw(t9, 28, t1); // sw t9, 28(t1) + // nop // sll r0, r0, 0 + c->sq(t8, 32, t1); // sq t8, 32(t1) + // nop // sll r0, r0, 0 + c->sq(s0, 48, t1); // sq s0, 48(t1) + // nop // sll r0, r0, 0 + c->sw(s3, 60, t1); // sw s3, 60(t1) + // nop // sll r0, r0, 0 + // nop // vnop + // nop // sll r0, r0, 0 + c->sqc2(vf19, 80, t1); // sqc2 vf19, 80(t1) + // nop // sll r0, r0, 0 + c->sqc2(vf15, 64, t1); // sqc2 vf15, 64(t1) + // nop // sll r0, r0, 0 + c->sqc2(vf16, 96, t1); // sqc2 vf16, 96(t1) + // nop // sll r0, r0, 0 + c->sqc2(vf20, 112, t1); // sqc2 vf20, 112(t1) + // nop // sll r0, r0, 0 + c->sw(t5, 92, t1); // sw t5, 92(t1) + // nop // sll r0, r0, 0 + c->sw(t6, 124, t1); // sw t6, 124(t1) + bc = c->sgpr64(a2) == 0; // beq a2, r0, L48 + // nop // sll r0, r0, 0 + if (bc) {goto block_65;} // branch non-likely + + c->mov64(t1, t0); // or t1, t0, r0 + c->lqc2(vf29, 64, a3); // lqc2 vf29, 64(a3) + c->mov64(t0, v1); // or t0, v1, r0 + c->lwc1(f0, 72, a3); // lwc1 f0, 72(a3) + c->daddiu(t0, a1, 3); // daddiu t0, a1, 3 + c->lwc1(f2, 76, a3); // lwc1 f2, 76(a3) + c->addiu(a3, r0, -4); // addiu a3, r0, -4 + // nop // sll r0, r0, 0 + c->cvtws(f0, f0); // cvt.w.s f0, f0 + c->and_(a3, t0, a3); // and a3, t0, a3 + c->cvtws(f2, f2); // cvt.w.s f2, f2 + c->lw(t2, 4, a0); // lw t2, 4(a0) + c->mfc1(a0, f0); // mfc1 a0, f0 + c->mov64(t0, a2); // or t0, a2, r0 + c->mfc1(t3, f2); // mfc1 t3, f2 + c->dsll(a2, a1, 5); // dsll a2, a1, 5 + c->dsra(a1, t3, 1); // dsra a1, t3, 1 + c->daddu(a3, v1, a3); // daddu a3, v1, a3 + bc = c->sgpr64(a1) == 0; // beq a1, r0, L45 + c->daddu(a2, t2, a2); // daddu a2, t2, a2 + if (bc) {goto block_62;} // branch non-likely + + c->pcpyh(v1, a0); // pcpyh v1, a0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyld(v1, v1, v1); // pcpyld v1, v1, v1 + c->sh(v1, 712, at); // sh v1, 712(at) + c->pcpyh(a0, a1); // pcpyh a0, a1 + c->sh(a0, 714, at); // sh a0, 714(at) + c->pcpyld(a0, a0, a0); // pcpyld a0, a0, a0 + c->ldr(s5, 0, a3); // ldr s5, 0(a3) + c->pextlw(a1, t1, t1); // pextlw a1, t1, t1 + c->ldl(s5, 7, a3); // ldl s5, 7(a3) + c->pcpyld(a1, a1, a1); // pcpyld a1, a1, a1 + c->ldr(s4, 8, a3); // ldr s4, 8(a3) + c->pextlb(t2, r0, s5); // pextlb t2, r0, s5 + c->ldl(s4, 15, a3); // ldl s4, 15(a3) + c->pextuh(t1, r0, t2); // pextuh t1, r0, t2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlh(t3, r0, t2); // pextlh t3, r0, t2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlb(t4, r0, s4); // pextlb t4, r0, s4 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextuh(t2, r0, t4); // pextuh t2, r0, t4 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlh(t5, r0, t4); // pextlh t5, r0, t4 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psllw(t3, t3, 2); // psllw t3, t3, 2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psllw(t4, t1, 2); // psllw t4, t1, 2 + // Unknown instr: vcallms 215 + vcallms_215(c); + + c->psllw(t6, t5, 2); // psllw t6, t5, 2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psllw(t5, t2, 2); // psllw t5, t2, 2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->paddw(t1, t3, a1); // paddw t1, t3, a1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->paddw(t4, t4, a1); // paddw t4, t4, a1 + c->lwu(t3, 0, t1); // lwu t3, 0(t1) + c->paddw(t2, t6, a1); // paddw t2, t6, a1 + c->lwu(t9, 0, t4); // lwu t9, 0(t4) + c->paddw(t5, t5, a1); // paddw t5, t5, a1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsrl32(s4, t1, 0); // dsrl32 s4, t1, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsrl32(s3, t4, 0); // dsrl32 s3, t4, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsrl32(ra, t2, 0); // dsrl32 ra, t2, 0 + c->daddiu(a2, a2, -128); // daddiu a2, a2, -128 + c->dsrl32(t8, t5, 0); // dsrl32 t8, t5, 0 + c->daddiu(a3, a3, 16); // daddiu a3, a3, 16 + c->pcpyud(t7, t1, r0); // pcpyud t7, t1, r0 + c->lwu(s5, 0, t2); // lwu s5, 0(t2) + c->pcpyud(t6, t4, r0); // pcpyud t6, t4, r0 + c->lwu(s2, 0, t5); // lwu s2, 0(t5) + c->pcpyud(t4, t2, r0); // pcpyud t4, t2, r0 + c->lwu(s4, 0, s4); // lwu s4, 0(s4) + c->pcpyud(t5, t5, r0); // pcpyud t5, t5, r0 + c->lwu(s3, 0, s3); // lwu s3, 0(s3) + c->pextlw(t9, t9, t3); // pextlw t9, t9, t3 + c->lwu(ra, 0, ra); // lwu ra, 0(ra) + c->pextlw(t3, s2, s5); // pextlw t3, s2, s5 + c->lwu(s2, 0, t8); // lwu s2, 0(t8) + c->pextlw(s5, s3, s4); // pextlw s5, s3, s4 + c->lwu(t8, 0, t7); // lwu t8, 0(t7) + c->pextlw(t7, s2, ra); // pextlw t7, s2, ra + c->lwu(ra, 0, t6); // lwu ra, 0(t6) + c->pextlb(t6, r0, t9); // pextlb t6, r0, t9 + c->lwu(t9, 0, t4); // lwu t9, 0(t4) + c->pextlb(t4, r0, s5); // pextlb t4, r0, s5 + c->lwu(s5, 0, t5); // lwu s5, 0(t5) + c->pextlw(ra, ra, t8); // pextlw ra, ra, t8 + c->mov128_gpr_vf(t5, vf17); // qmfc2.ni t5, vf17 + c->pextlw(t8, s5, t9); // pextlw t8, s5, t9 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlb(t9, r0, ra); // pextlb t9, r0, ra + c->mfc1(r0, f31); // mfc1 r0, f31 + c->paddh(t9, t4, t9); // paddh t9, t4, t9 + c->mov128_gpr_vf(t4, vf13); // qmfc2.ni t4, vf13 + c->pmulth(r0, t9, a0); // pmulth r0, t9, a0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlb(t3, r0, t3); // pextlb t3, r0, t3 + c->sq(t5, 144, a2); // sq t5, 144(a2) + c->pmaddh(r0, t6, v1); // pmaddh r0, t6, v1 + c->sq(t4, 128, a2); // sq t4, 128(a2) + c->pextlb(t5, r0, t7); // pextlb t5, r0, t7 + c->ldr(t1, 0, a3); // ldr t1, 0(a3) + c->pextlb(t7, r0, t8); // pextlb t7, r0, t8 + c->ldl(t1, 7, a3); // ldl t1, 7(a3) + c->pmfhl_lh(t6); // pmfhl.lh t6 + c->mov128_gpr_vf(t4, vf18); // qmfc2.ni t4, vf18 + c->paddh(t5, t5, t7); // paddh t5, t5, t7 + c->ldr(t2, 8, a3); // ldr t2, 8(a3) + c->psrlh(t6, t6, 8); // psrlh t6, t6, 8 + c->ldl(t2, 15, a3); // ldl t2, 15(a3) + c->ppacb(t6, r0, t6); // ppacb t6, r0, t6 + c->sq(t4, 176, a2); // sq t4, 176(a2) + c->dsrl32(t4, t6, 0); // dsrl32 t4, t6, 0 + c->daddiu(t0, t0, -4); // daddiu t0, t0, -4 + c->pmulth(r0, t5, a0); // pmulth r0, t5, a0 + c->mov128_gpr_vf(t5, vf14); // qmfc2.ni t5, vf14 + c->pextlb(t1, r0, t1); // pextlb t1, r0, t1 + c->sw(t6, 156, a2); // sw t6, 156(a2) + c->pmaddh(r0, t3, v1); // pmaddh r0, t3, v1 + c->sw(t4, 188, a2); // sw t4, 188(a2) + c->pextlb(t3, r0, t2); // pextlb t3, r0, t2 + c->sq(t5, 160, a2); // sq t5, 160(a2) + c->pextuh(t2, r0, t1); // pextuh t2, r0, t1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmfhl_lh(t6); // pmfhl.lh t6 + c->mov128_gpr_vf(t5, vf19); // qmfc2.ni t5, vf19 + c->pextlh(t4, r0, t1); // pextlh t4, r0, t1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psrlh(t1, t6, 8); // psrlh t1, t6, 8 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->ppacb(t6, r0, t1); // ppacb t6, r0, t1 + c->sq(t5, 208, a2); // sq t5, 208(a2) + c->dsrl32(t1, t6, 0); // dsrl32 t1, t6, 0 + c->sw(t6, 220, a2); // sw t6, 220(a2) + c->pextuh(t5, r0, t3); // pextuh t5, r0, t3 + c->mov128_gpr_vf(t6, vf15); // qmfc2.ni t6, vf15 + c->pextlh(t7, r0, t3); // pextlh t7, r0, t3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psllw(t3, t4, 2); // psllw t3, t4, 2 + c->sq(t6, 192, a2); // sq t6, 192(a2) + c->psllw(t4, t2, 2); // psllw t4, t2, 2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psllw(t6, t7, 2); // psllw t6, t7, 2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psllw(t5, t5, 2); // psllw t5, t5, 2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->paddw(s5, t3, a1); // paddw s5, t3, a1 + c->mov128_gpr_vf(t2, vf20); // qmfc2.ni t2, vf20 + c->paddw(t4, t4, a1); // paddw t4, t4, a1 + c->lwu(t3, 0, s5); // lwu t3, 0(s5) + c->paddw(s4, t6, a1); // paddw s4, t6, a1 + c->lwu(t9, 0, t4); // lwu t9, 0(t4) + bc = ((s64)c->sgpr64(t0)) <= 0; // blez t0, L44 + c->paddw(t5, t5, a1); // paddw t5, t5, a1 + if (bc) {goto block_61;} // branch non-likely + + + block_60: + c->dsrl32(s3, s5, 0); // dsrl32 s3, s5, 0 + // Unknown instr: vcallms 221 + vcallms_221(c); + + c->dsrl32(s0, t4, 0); // dsrl32 s0, t4, 0 + c->dsrl32(s2, s4, 0); // dsrl32 s2, s4, 0 + c->dsrl32(t8, t5, 0); // dsrl32 t8, t5, 0 + c->daddiu(a2, a2, 128); // daddiu a2, a2, 128 + c->pcpyud(t7, s5, r0); // pcpyud t7, s5, r0 + c->lwu(ra, 0, s4); // lwu ra, 0(s4) + c->pcpyud(t6, t4, r0); // pcpyud t6, t4, r0 + c->lwu(s1, 0, t5); // lwu s1, 0(t5) + c->pcpyud(t4, s4, r0); // pcpyud t4, s4, r0 + c->lwu(s3, 0, s3); // lwu s3, 0(s3) + c->pcpyud(t5, t5, r0); // pcpyud t5, t5, r0 + c->lwu(s0, 0, s0); // lwu s0, 0(s0) + c->pextlw(t9, t9, t3); // pextlw t9, t9, t3 + c->lwu(s2, 0, s2); // lwu s2, 0(s2) + c->pextlw(t3, s1, ra); // pextlw t3, s1, ra + c->lwu(s1, 0, t8); // lwu s1, 0(t8) + c->pextlw(ra, s0, s3); // pextlw ra, s0, s3 + c->lwu(t8, 0, t7); // lwu t8, 0(t7) + c->pextlw(t7, s1, s2); // pextlw t7, s1, s2 + c->lwu(s3, 0, t6); // lwu s3, 0(t6) + c->pextlb(t6, r0, t9); // pextlb t6, r0, t9 + c->lwu(t9, 0, t4); // lwu t9, 0(t4) + c->pextlb(t4, r0, ra); // pextlb t4, r0, ra + c->lwu(t5, 0, t5); // lwu t5, 0(t5) + c->pextlw(t8, s3, t8); // pextlw t8, s3, t8 + c->sq(t2, 112, a2); // sq t2, 112(a2) + c->pextlw(t2, t5, t9); // pextlw t2, t5, t9 + c->mov128_gpr_vf(t5, vf17); // qmfc2.ni t5, vf17 + c->pextlb(t8, r0, t8); // pextlb t8, r0, t8 + c->sw(t1, 124, a2); // sw t1, 124(a2) + c->paddh(t1, t4, t8); // paddh t1, t4, t8 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmulth(r0, t1, a0); // pmulth r0, t1, a0 + c->mov128_gpr_vf(t4, vf13); // qmfc2.ni t4, vf13 + c->pextlb(t1, r0, t3); // pextlb t1, r0, t3 + c->sq(t5, 144, a2); // sq t5, 144(a2) + c->pmaddh(r0, t6, v1); // pmaddh r0, t6, v1 + c->ldr(s5, 16, a3); // ldr s5, 16(a3) + c->pextlb(t3, r0, t7); // pextlb t3, r0, t7 + c->sq(t4, 128, a2); // sq t4, 128(a2) + c->pextlb(t2, r0, t2); // pextlb t2, r0, t2 + c->ldl(s5, 23, a3); // ldl s5, 23(a3) + c->pmfhl_lh(t4); // pmfhl.lh t4 + c->ldr(s4, 24, a3); // ldr s4, 24(a3) + c->paddh(t2, t3, t2); // paddh t2, t3, t2 + c->mov128_gpr_vf(t5, vf18); // qmfc2.ni t5, vf18 + c->psrlh(t3, t4, 8); // psrlh t3, t4, 8 + c->ldl(s4, 31, a3); // ldl s4, 31(a3) + c->ppacb(t3, r0, t3); // ppacb t3, r0, t3 + c->sq(t5, 176, a2); // sq t5, 176(a2) + c->dsrl32(t5, t3, 0); // dsrl32 t5, t3, 0 + c->daddiu(t0, t0, -4); // daddiu t0, t0, -4 + c->pmulth(r0, t2, a0); // pmulth r0, t2, a0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlb(t4, r0, s5); // pextlb t4, r0, s5 + c->mov128_gpr_vf(t6, vf14); // qmfc2.ni t6, vf14 + c->pmaddh(r0, t1, v1); // pmaddh r0, t1, v1 + c->sw(t3, 156, a2); // sw t3, 156(a2) + c->pextlb(t3, r0, s4); // pextlb t3, r0, s4 + c->sw(t5, 188, a2); // sw t5, 188(a2) + c->pextuh(t2, r0, t4); // pextuh t2, r0, t4 + c->sq(t6, 160, a2); // sq t6, 160(a2) + c->pmfhl_lh(t6); // pmfhl.lh t6 + c->mov128_gpr_vf(t1, vf16); // qmfc2.ni t1, vf16 + c->pextlh(t4, r0, t4); // pextlh t4, r0, t4 + c->mov128_gpr_vf(t5, vf19); // qmfc2.ni t5, vf19 + c->psrlh(t6, t6, 8); // psrlh t6, t6, 8 + c->sq(t1, 96, a2); // sq t1, 96(a2) + c->ppacb(t6, r0, t6); // ppacb t6, r0, t6 + c->sq(t5, 208, a2); // sq t5, 208(a2) + c->dsrl32(t1, t6, 0); // dsrl32 t1, t6, 0 + c->daddiu(a3, a3, 16); // daddiu a3, a3, 16 + c->pextuh(t5, r0, t3); // pextuh t5, r0, t3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlh(t7, r0, t3); // pextlh t7, r0, t3 + c->mov128_gpr_vf(t8, vf15); // qmfc2.ni t8, vf15 + c->psllw(t3, t4, 2); // psllw t3, t4, 2 + c->sw(t6, 220, a2); // sw t6, 220(a2) + c->psllw(t4, t2, 2); // psllw t4, t2, 2 + c->sq(t8, 192, a2); // sq t8, 192(a2) + c->psllw(t6, t7, 2); // psllw t6, t7, 2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psllw(t5, t5, 2); // psllw t5, t5, 2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->paddw(s5, t3, a1); // paddw s5, t3, a1 + c->mov128_gpr_vf(t2, vf20); // qmfc2.ni t2, vf20 + c->paddw(t4, t4, a1); // paddw t4, t4, a1 + c->lwu(t3, 0, s5); // lwu t3, 0(s5) + c->paddw(s4, t6, a1); // paddw s4, t6, a1 + c->lwu(t9, 0, t4); // lwu t9, 0(t4) + bc = ((s64)c->sgpr64(t0)) > 0; // bgtz t0, L43 + c->paddw(t5, t5, a1); // paddw t5, t5, a1 + if (bc) {goto block_60;} // branch non-likely + + + block_61: + // nop // sll r0, r0, 0 + // Unknown instr: vcallms 257 + vcallms_257(c); + + // nop // sll r0, r0, 0 + c->sq(t2, 240, a2); // sq t2, 240(a2) + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(v1, vf16); // qmfc2.i v1, vf16 + // nop // sll r0, r0, 0 + c->sw(t1, 252, a2); // sw t1, 252(a2) + //beq r0, r0, L48 // beq r0, r0, L48 + c->sq(v1, 224, a2); // sq v1, 224(a2) + goto block_65; // branch always + + + block_62: + // Unknown instr: vcallms 259 + vcallms_259(c); + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sh(a0, 712, at); // sh a0, 712(at) + // nop // sll r0, r0, 0 + c->sh(a1, 714, at); // sh a1, 714(at) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lbu(v1, 0, a3); // lbu v1, 0(a3) + // nop // sll r0, r0, 0 + c->lbu(a0, 4, a3); // lbu a0, 4(a3) + // nop // sll r0, r0, 0 + c->lbu(a1, 8, a3); // lbu a1, 8(a3) + c->dsll(v1, v1, 2); // dsll v1, v1, 2 + c->lbu(t2, 12, a3); // lbu t2, 12(a3) + c->dsll(a0, a0, 2); // dsll a0, a0, 2 + // nop // sll r0, r0, 0 + c->dsll(t3, a1, 2); // dsll t3, a1, 2 + // nop // sll r0, r0, 0 + c->dsll(t4, t2, 2); // dsll t4, t2, 2 + c->mov128_gpr_vf(t2, vf17); // qmfc2.i t2, vf17 + c->daddu(s5, v1, t1); // daddu s5, v1, t1 + c->daddiu(v1, a3, 16); // daddiu v1, a3, 16 + c->daddu(a1, a0, t1); // daddu a1, a0, t1 + // nop // sll r0, r0, 0 + c->daddu(s4, t3, t1); // daddu s4, t3, t1 + // nop // sll r0, r0, 0 + c->daddu(a0, t4, t1); // daddu a0, t4, t1 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t7, vf13); // qmfc2.ni t7, vf13 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a3, vf18); // qmfc2.ni a3, vf18 + // nop // sll r0, r0, 0 + c->lwu(t6, 0, s5); // lwu t6, 0(s5) + // nop // sll r0, r0, 0 + c->lwu(t3, 0, a1); // lwu t3, 0(a1) + // nop // sll r0, r0, 0 + c->lwu(t4, 0, s4); // lwu t4, 0(s4) + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t5, vf14); // qmfc2.ni t5, vf14 + // nop // sll r0, r0, 0 + c->lwu(a0, 0, a0); // lwu a0, 0(a0) + c->daddiu(a1, t0, -4); // daddiu a1, t0, -4 + c->sq(t7, 0, a2); // sq t7, 0(a2) + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t0, vf19); // qmfc2.ni t0, vf19 + // nop // sll r0, r0, 0 + c->sq(t2, 16, a2); // sq t2, 16(a2) + // nop // sll r0, r0, 0 + c->sw(t6, 28, a2); // sw t6, 28(a2) + bc = ((s64)c->sgpr64(a1)) <= 0; // blez a1, L47 + c->sq(a3, 48, a2); // sq a3, 48(a2) + if (bc) {goto block_64;} // branch non-likely + + + block_63: + // Unknown instr: vcallms 264 + vcallms_264(c); + + c->sw(t3, 60, a2); // sw t3, 60(a2) + // nop // sll r0, r0, 0 + c->sq(t5, 32, a2); // sq t5, 32(a2) + // nop // sll r0, r0, 0 + c->sq(t0, 80, a2); // sq t0, 80(a2) + // nop // sll r0, r0, 0 + c->sw(t4, 92, a2); // sw t4, 92(a2) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lbu(a3, 0, v1); // lbu a3, 0(v1) + // nop // sll r0, r0, 0 + c->lbu(t0, 4, v1); // lbu t0, 4(v1) + // nop // sll r0, r0, 0 + c->lbu(t2, 8, v1); // lbu t2, 8(v1) + c->dsll(t3, a3, 2); // dsll t3, a3, 2 + c->lbu(a3, 12, v1); // lbu a3, 12(v1) + c->dsll(t6, t0, 2); // dsll t6, t0, 2 + c->mov128_gpr_vf(t0, vf15); // qmfc2.i t0, vf15 + c->dsll(t4, t2, 2); // dsll t4, t2, 2 + c->mov128_gpr_vf(t2, vf20); // qmfc2.ni t2, vf20 + c->dsll(t5, a3, 2); // dsll t5, a3, 2 + c->mov128_gpr_vf(a3, vf17); // qmfc2.ni a3, vf17 + c->daddu(s5, t3, t1); // daddu s5, t3, t1 + c->daddiu(v1, v1, 16); // daddiu v1, v1, 16 + c->daddu(t3, t6, t1); // daddu t3, t6, t1 + c->mov128_gpr_vf(t6, vf16); // qmfc2.ni t6, vf16 + c->daddu(s4, t4, t1); // daddu s4, t4, t1 + c->sq(t0, 64, a2); // sq t0, 64(a2) + c->daddu(t0, t5, t1); // daddu t0, t5, t1 + c->sq(t2, 112, a2); // sq t2, 112(a2) + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t2, vf13); // qmfc2.ni t2, vf13 + // nop // sll r0, r0, 0 + c->sw(a0, 124, a2); // sw a0, 124(a2) + // nop // sll r0, r0, 0 + c->sq(t6, 96, a2); // sq t6, 96(a2) + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t6, vf18); // qmfc2.ni t6, vf18 + // nop // sll r0, r0, 0 + c->lwu(t7, 0, s5); // lwu t7, 0(s5) + // nop // sll r0, r0, 0 + c->lwu(t3, 0, t3); // lwu t3, 0(t3) + // nop // sll r0, r0, 0 + c->lwu(t4, 0, s4); // lwu t4, 0(s4) + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t5, vf14); // qmfc2.ni t5, vf14 + c->daddiu(a2, a2, 128); // daddiu a2, a2, 128 + c->lwu(a0, 0, t0); // lwu a0, 0(t0) + c->daddiu(a1, a1, -4); // daddiu a1, a1, -4 + c->sq(t2, 0, a2); // sq t2, 0(a2) + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t0, vf19); // qmfc2.ni t0, vf19 + // nop // sll r0, r0, 0 + c->sq(a3, 16, a2); // sq a3, 16(a2) + // nop // sll r0, r0, 0 + c->sw(t7, 28, a2); // sw t7, 28(a2) + bc = ((s64)c->sgpr64(a1)) > 0; // bgtz a1, L46 + c->sq(t6, 48, a2); // sq t6, 48(a2) + if (bc) {goto block_63;} // branch non-likely + + + block_64: + // nop // sll r0, r0, 0 + // Unknown instr: vcallms 292 + vcallms_292(c); + + // nop // sll r0, r0, 0 + c->sw(t3, 60, a2); // sw t3, 60(a2) + // nop // sll r0, r0, 0 + c->sq(t5, 32, a2); // sq t5, 32(a2) + // nop // sll r0, r0, 0 + c->sq(t0, 80, a2); // sq t0, 80(a2) + // nop // sll r0, r0, 0 + c->sw(t4, 92, a2); // sw t4, 92(a2) + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(v1, vf15); // qmfc2.i v1, vf15 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a1, vf20); // qmfc2.ni a1, vf20 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a3, vf16); // qmfc2.ni a3, vf16 + // nop // sll r0, r0, 0 + c->sq(v1, 64, a2); // sq v1, 64(a2) + // nop // sll r0, r0, 0 + c->sq(a1, 112, a2); // sq a1, 112(a2) + // nop // sll r0, r0, 0 + c->sw(a0, 124, a2); // sw a0, 124(a2) + // nop // sll r0, r0, 0 + c->sq(a3, 96, a2); // sq a3, 96(a2) + + block_65: + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->lw(v1, 644, at); // lw v1, 644(at) + c->lw(a0, 716, at); // lw a0, 716(at) + c->daddiu(a1, at, 12064); // daddiu a1, at, 12064 + c->sw(v1, 64, at); // sw v1, 64(at) + c->sw(a0, 60, at); // sw a0, 60(at) + c->sw(a1, 68, at); // sw a1, 68(at) + c->sw(r0, 72, at); // sw r0, 72(at) + c->lw(v1, 748, at); // lw v1, 748(at) + call_addr = c->gprs[v1].du32[0]; // function call: + // Unknown instr: sllv v0, ra, r0 + // c->jalr(call_addr); // jalr ra, v1 + generic_prepare_dma_double::execute(c); + c->lw(v1, 752, at); // lw v1, 752(at) + call_addr = c->gprs[v1].du32[0]; // function call: + // Unknown instr: sllv v0, ra, r0 + // c->jalr(call_addr); // jalr ra, v1 + generic_envmap_dproc::execute(c); + c->lw(v1, 756, at); // lw v1, 756(at) + call_addr = c->gprs[v1].du32[0]; // function call: + // Unknown instr: sllv v0, ra, r0 + // c->jalr(call_addr); // jalr ra, v1 + generic_interp_dproc::execute(c); + c->lw(v1, 760, at); // lw v1, 760(at) + call_addr = c->gprs[v1].du32[0]; // function call: + // Unknown instr: sllv v0, ra, r0 + // c->jalr(call_addr); // jalr ra, v1 + generic_no_light_dproc::execute(c); + c->lw(v1, 40, at); // lw v1, 40(at) + c->lw(a0, 56, at); // lw a0, 56(at) + c->mov64(a3, v1); // or a3, v1, r0 + // nop // sll r0, r0, 0 + get_fake_spad_addr(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->lui(a2, 4096); // lui a2, 4096 + c->lwu(a1, 76, at); // lwu a1, 76(at) + c->ori(a2, a2, 53248); // ori a2, a2, 53248 + // c->lw(t1, 0, a2); // lw t1, 0(a2) + // nop // sll r0, r0, 0 + c->daddiu(t0, at, 108); // daddiu t0, at, 108 + c->andi(a3, a3, 16383); // andi a3, a3, 16383 + c->andi(t1, t1, 256); // andi t1, t1, 256 + // nop // sll r0, r0, 0 + bc = true; // c->sgpr64(t1) == 0; // beq t1, r0, L50 + // nop // sll r0, r0, 0 + if (bc) {goto block_69;} // branch non-likely + + c->mov64(t1, a2); // or t1, a2, r0 + // nop // sll r0, r0, 0 + + block_67: + c->lw(t2, 0, t0); // lw t2, 0(t0) + // nop // sll r0, r0, 0 + c->lw(t3, 0, t1); // lw t3, 0(t1) + // nop // sll r0, r0, 0 + c->andi(t3, t3, 256); // andi t3, t3, 256 + c->daddiu(t2, t2, 1); // daddiu t2, t2, 1 + bc = c->sgpr64(t3) != 0; // bne t3, r0, L49 + c->sw(t2, 0, t0); // sw t2, 0(t0) + if (bc) {goto block_67;} // branch non-likely + + c->gprs[t0].du64[0] = 0; // or t0, r0, r0 + + block_69: + c->dsll(t0, a0, 4); // dsll t0, a0, 4 + // c->sw(a3, 128, a2); // sw a3, 128(a2) + sadr = c->sgpr64(a3); + // nop // sll r0, r0, 0 + // c->sw(a1, 16, a2); // sw a1, 16(a2) + madr = c->sgpr64(a1); + c->addiu(a3, r0, 256); // addiu a3, r0, 256 + // c->sw(a0, 32, a2); // sw a0, 32(a2) + qwc = c->sgpr64(a0); + c->daddu(a0, a1, t0); // daddu a0, a1, t0 + // c->sw(a3, 0, a2); // sw a3, 0(a2) + spad_from_dma_no_sadr_off(cache.fake_scratchpad_data, madr, sadr, qwc); + // nop // sll r0, r0, 0 + c->sw(a0, 76, at); // sw a0, 76(at) + c->gprs[a0].du64[0] = 0; // or a0, r0, r0 + c->xori(v1, v1, 4608); // xori v1, v1, 4608 + c->sw(v1, 40, at); // sw v1, 40(at) + // nop // sll r0, r0, 0 + c->lw(v1, 740, at); // lw v1, 740(at) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L9 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + + block_70: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 384, at); // ld ra, 384(at) + c->lq(gp, 496, at); // lq gp, 496(at) + c->lq(s5, 480, at); // lq s5, 480(at) + c->lq(s4, 464, at); // lq s4, 464(at) + c->lq(s3, 448, at); // lq s3, 448(at) + c->lq(s2, 432, at); // lq s2, 432(at) + c->lq(s1, 416, at); // lq s1, 416(at) + c->lq(s0, 400, at); // lq s0, 400(at) + //jr ra // jr ra + c->daddiu(sp, sp, 128); // daddiu sp, sp, 128 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("generic-tie-convert", execute, 256); +} + +} // namespace generic_tie_convert +} // namespace Mips2C + diff --git a/game/mips2c/functions/joint.cpp b/game/mips2c/functions/joint.cpp index 3a594da7f6..d358e759dc 100644 --- a/game/mips2c/functions/joint.cpp +++ b/game/mips2c/functions/joint.cpp @@ -1,7 +1,7 @@ //--------------------------MIPS2C--------------------- +#include "game/kernel/jak1/kscheme.h" #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" - +using namespace jak1; // clang-format off namespace { @@ -819,7 +819,7 @@ u32 jump_table_vals[16] = { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace decompress_frame_data_to_accumulator { u64 execute(void* ctxt) { @@ -1419,7 +1419,7 @@ u32 jump_table_vals[16] = { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace decompress_fixed_data_to_accumulator { u64 execute(void* ctxt) { @@ -2035,7 +2035,7 @@ u32 jump_table_vals[16] = { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace normalize_frame_quaternions { u64 execute(void* ctxt) { @@ -2089,7 +2089,7 @@ u64 execute(void* ctxt) { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace clear_frame_accumulator { u64 execute(void* ctxt) { @@ -2149,7 +2149,7 @@ u64 execute(void* ctxt) { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace calc_animation_from_spr { @@ -2395,7 +2395,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace cspace_parented_transformq_joint { u64 execute(void* ctxt) { diff --git a/game/mips2c/functions/merc_blend_shape.cpp b/game/mips2c/functions/merc_blend_shape.cpp index 3ab10d2483..069447c0f0 100644 --- a/game/mips2c/functions/merc_blend_shape.cpp +++ b/game/mips2c/functions/merc_blend_shape.cpp @@ -2,7 +2,8 @@ // clang-format off //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +#include "game/kernel/jak1/kscheme.h" +using namespace jak1; namespace Mips2C { namespace blerc_execute { struct Cache { @@ -406,7 +407,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace setup_blerc_chains_for_one_fragment { struct Cache { diff --git a/game/mips2c/functions/ocean.cpp b/game/mips2c/functions/ocean.cpp index 3df9501262..aaebe4f7c1 100644 --- a/game/mips2c/functions/ocean.cpp +++ b/game/mips2c/functions/ocean.cpp @@ -2,7 +2,8 @@ //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +#include "game/kernel/jak1/kscheme.h" +using namespace jak1; namespace Mips2C { ExecutionContext ocean_regs_vfs; @@ -73,7 +74,7 @@ u64 execute(void* ctxt); } //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace draw_large_polygon_ocean { struct Cache { @@ -267,7 +268,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace render_ocean_quad { struct Cache { diff --git a/game/mips2c/functions/ocean_vu0.cpp b/game/mips2c/functions/ocean_vu0.cpp index 1500153372..bcdcb63a66 100644 --- a/game/mips2c/functions/ocean_vu0.cpp +++ b/game/mips2c/functions/ocean_vu0.cpp @@ -1,7 +1,8 @@ // clang-format off //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +#include "game/kernel/jak1/kscheme.h" +using namespace jak1; namespace Mips2C { namespace ocean_interp_wave { struct Cache { @@ -202,7 +203,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace ocean_generate_verts { struct Cache { diff --git a/game/mips2c/functions/ripple.cpp b/game/mips2c/functions/ripple.cpp index fc768aed81..e75a904200 100644 --- a/game/mips2c/functions/ripple.cpp +++ b/game/mips2c/functions/ripple.cpp @@ -1,7 +1,8 @@ //--------------------------MIPS2C--------------------- +#include "game/kernel/jak1/kscheme.h" #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +using namespace jak1; namespace Mips2C { struct RippleVu0 { @@ -88,7 +89,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace ripple_create_wave_table { struct Cache { @@ -419,7 +420,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace ripple_apply_wave_table { struct Cache { @@ -523,7 +524,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace ripple_matrix_scale { u64 execute(void* ctxt) { diff --git a/game/mips2c/functions/shadow.cpp b/game/mips2c/functions/shadow.cpp index 0e4d6effdf..9413f991ca 100644 --- a/game/mips2c/functions/shadow.cpp +++ b/game/mips2c/functions/shadow.cpp @@ -1,6 +1,7 @@ //--------------------------MIPS2C--------------------- +#include "game/kernel/jak1/kscheme.h" #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +using namespace jak1; namespace Mips2C { // clang-format off namespace { @@ -374,7 +375,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace shadow_calc_dual_verts { u64 execute(void* ctxt) { @@ -580,7 +581,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace shadow_scissor_edges { u64 execute(void* ctxt) { @@ -688,7 +689,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace shadow_scissor_top { u64 execute(void* ctxt) { @@ -764,7 +765,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace shadow_init_vars { struct Cache { @@ -830,7 +831,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace shadow_find_facing_single_tris { u64 execute(void* ctxt) { @@ -1134,7 +1135,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace shadow_find_single_edges { u64 execute(void* ctxt) { @@ -1234,7 +1235,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace shadow_find_facing_double_tris { u64 execute(void* ctxt) { @@ -1516,7 +1517,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace shadow_find_double_edges { u64 execute(void* ctxt) { @@ -1622,7 +1623,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace shadow_add_verts { struct Cache { @@ -1806,7 +1807,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace shadow_add_facing_single_tris { struct Cache { @@ -1885,7 +1886,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace shadow_add_single_edges { struct Cache { @@ -1968,7 +1969,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace shadow_add_double_tris { struct Cache { @@ -2045,7 +2046,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace shadow_add_double_edges { struct Cache { @@ -2128,7 +2129,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace shadow_execute { struct Cache { diff --git a/game/mips2c/functions/sky_tng.cpp b/game/mips2c/functions/sky_tng.cpp index 8fe39cc8fc..8aef0c43a5 100644 --- a/game/mips2c/functions/sky_tng.cpp +++ b/game/mips2c/functions/sky_tng.cpp @@ -1,7 +1,8 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +#include "game/kernel/jak1/kscheme.h" +#include "game/mips2c/mips2c_private.h" +using namespace jak1; namespace Mips2C { ExecutionContext sky_regs_vfs; @@ -11,7 +12,7 @@ ExecutionContext sky_regs_vfs; // clang-format off //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace init_sky_regs { struct Cache { @@ -106,7 +107,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace set_tex_offset { u64 execute(void* ctxt) { @@ -154,7 +155,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace clip_polygon_against_positive_hyperplane { u64 execute(void* ctxt) { @@ -439,7 +440,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace clip_polygon_against_negative_hyperplane { u64 execute(void* ctxt) { @@ -734,7 +735,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace draw_large_polygon { struct Cache { @@ -884,7 +885,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace render_sky_quad { struct Cache { @@ -988,7 +989,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace render_sky_tri { struct Cache { diff --git a/game/mips2c/functions/sparticle.cpp b/game/mips2c/functions/sparticle.cpp index 97ee17525d..1d0cdfb798 100644 --- a/game/mips2c/functions/sparticle.cpp +++ b/game/mips2c/functions/sparticle.cpp @@ -1,7 +1,8 @@ // clang-format off //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +#include "game/kernel/jak1/kscheme.h" +using namespace jak1; namespace Mips2C { namespace sp_process_block_3d { struct Cache { @@ -369,7 +370,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace sp_process_block_2d { struct Cache { diff --git a/game/mips2c/functions/sparticle_launcher.cpp b/game/mips2c/functions/sparticle_launcher.cpp index 95bf01b67e..44721696e7 100644 --- a/game/mips2c/functions/sparticle_launcher.cpp +++ b/game/mips2c/functions/sparticle_launcher.cpp @@ -1,7 +1,8 @@ //--------------------------MIPS2C--------------------- // clang-format off #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +#include "game/kernel/jak1/kscheme.h" +using namespace jak1; namespace Mips2C { namespace sp_init_fields { struct Cache { @@ -341,7 +342,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace particle_adgif { struct Cache { @@ -471,7 +472,7 @@ void link() { //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace sp_launch_particles_var { struct Cache { diff --git a/game/mips2c/functions/test_func.cpp b/game/mips2c/functions/test_func.cpp index 0a15c880ba..6f770af8e0 100644 --- a/game/mips2c/functions/test_func.cpp +++ b/game/mips2c/functions/test_func.cpp @@ -1,6 +1,7 @@ //--------------------------MIPS2C--------------------- +#include "game/kernel/jak1/kscheme.h" #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +using namespace jak1; namespace Mips2C { namespace test_func { u64 execute(void* ctxt) { @@ -18,9 +19,8 @@ u64 execute(void* ctxt) { } // namespace Mips2C //--------------------------MIPS2C--------------------- + #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" -#include "game/kernel/kprint.h" namespace Mips2C { namespace goal_call_test { struct Cache { diff --git a/game/mips2c/functions/texture.cpp b/game/mips2c/functions/texture.cpp index 914f8ecafa..04dae9f04a 100644 --- a/game/mips2c/functions/texture.cpp +++ b/game/mips2c/functions/texture.cpp @@ -1,7 +1,8 @@ //--------------------------MIPS2C--------------------- // clang-format off #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +#include "game/kernel/jak1/kscheme.h" +using namespace jak1; namespace Mips2C { namespace adgif_shader_texture_with_update { u64 execute(void* ctxt) { diff --git a/game/mips2c/functions/tfrag.cpp b/game/mips2c/functions/tfrag.cpp index fc0c0dc507..6bb421e9e1 100644 --- a/game/mips2c/functions/tfrag.cpp +++ b/game/mips2c/functions/tfrag.cpp @@ -1,7 +1,8 @@ //--------------------------MIPS2C--------------------- +#include "game/kernel/jak1/kscheme.h" #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +using namespace jak1; namespace Mips2C { namespace draw_inline_array_tfrag { struct Cache { @@ -714,7 +715,7 @@ void link() { // clang-format off //--------------------------MIPS2C--------------------- #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" + namespace Mips2C { namespace stats_tfrag_asm { struct Cache { diff --git a/game/mips2c/functions/tie_methods.cpp b/game/mips2c/functions/tie_methods.cpp new file mode 100644 index 0000000000..e240e25d71 --- /dev/null +++ b/game/mips2c/functions/tie_methods.cpp @@ -0,0 +1,1962 @@ + +//--------------------------MIPS2C--------------------- +#include "game/kernel/jak1/kscheme.h" +#include "game/mips2c/mips2c_private.h" +using namespace jak1; +namespace Mips2C { +namespace draw_inline_array_instance_tie { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* instance_tie_work_copy; // *instance-tie-work-copy* + void* wind_work; // *wind-work* + void* math_camera; // *math-camera* +} cache; + +Vf background_vu0_data[16]; + +u16 vcallms_42(ExecutionContext* c) { + // TODO + // lq.xyzw vf16, 0(vi00) | nop + c->vfs[vf16].vf = background_vu0_data[0]; + // lq.xyzw vf17, 1(vi00) | nop + c->vfs[vf17].vf = background_vu0_data[1]; + // lq.xyzw vf18, 2(vi00) | nop + c->vfs[vf18].vf = background_vu0_data[2]; + // lq.xyzw vf19, 3(vi00) | nop + c->vfs[vf19].vf = background_vu0_data[3]; + // lq.xyzw vf28, 8(vi00) | mulax.xyzw ACC, vf16, vf02 + c->vfs[vf28].vf = background_vu0_data[8]; + c->acc.vf.mula(Mask::xyzw, c->vfs[vf16].vf, c->vfs[vf02].vf.x()); + + // lq.xyzw vf29, 9(vi00) | madday.xyzw ACC, vf17, vf02 + c->vfs[vf29].vf = background_vu0_data[9]; + c->acc.vf.madda(Mask::xyzw, c->vfs[vf17].vf, c->vfs[vf02].vf.y()); + + // lq.xyzw vf30, 10(vi00) | maddaz.xyzw ACC, vf18, vf02 + c->vfs[vf30].vf = background_vu0_data[10]; + c->acc.vf.madda(Mask::xyzw, c->vfs[vf18].vf, c->vfs[vf02].vf.z()); + + // lq.xyzw vf31, 11(vi00) | msubaw.xyzw ACC, vf19, vf00 + c->vfs[vf31].vf = background_vu0_data[11]; + c->acc.vf.msuba(Mask::xyzw, c->vfs[vf19].vf, 1.f); + + // lq.xyzw vf24, 4(vi00) | maddw.xyzw vf04, vf01, vf02 + c->vfs[vf24].vf = background_vu0_data[4]; + u16 vi01 = + c->acc.vf.madd_flag(Mask::xyzw, c->vfs[vf04].vf, c->vfs[vf01].vf, c->vfs[vf02].vf.w()) & 0xf0; + + // lq.xyzw vf25, 5(vi00) | mulax.xyzw ACC, vf28, vf02 + c->vfs[vf25].vf = background_vu0_data[5]; + c->acc.vf.mula(Mask::xyzw, c->vfs[vf28].vf, c->vfs[vf02].vf.x()); + // lq.xyzw vf26, 6(vi00) | madday.xyzw ACC, vf29, vf02 + c->vfs[vf26].vf = background_vu0_data[6]; + c->acc.vf.madda(Mask::xyzw, c->vfs[vf29].vf, c->vfs[vf02].vf.y()); + // lq.xyzw vf27, 7(vi00) | maddaz.xyzw ACC, vf30, vf02 + c->vfs[vf27].vf = background_vu0_data[7]; + c->acc.vf.madda(Mask::xyzw, c->vfs[vf30].vf, c->vfs[vf02].vf.z()); + // fmand vi01, vi02 | maddw.xyzw vf05, vf31, vf00 + c->acc.vf.madd(Mask::xyzw, c->vfs[vf05].vf, c->vfs[vf31].vf, 1.f); + // nop | mulax.xyzw ACC, vf24, vf02 + c->acc.vf.mula(Mask::xyzw, c->vfs[vf24].vf, c->vfs[vf02].vf.x()); + // nop | madday.xyzw ACC, vf25, vf02 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf25].vf, c->vfs[vf02].vf.y()); + // nop | maddaz.xyzw ACC, vf26, vf02 :e + c->acc.vf.madda(Mask::xyzw, c->vfs[vf26].vf, c->vfs[vf02].vf.z()); + // nop | maddw.xyzw vf06, vf27, vf00 + c->acc.vf.madd(Mask::xyzw, c->vfs[vf06].vf, c->vfs[vf27].vf, 1.f); + + return vi01; +} + +void vcallms_29(ExecutionContext* c) { + // lq.xyzw vf24, 4(vi00) | nop + c->vfs[vf24].vf = background_vu0_data[4]; + // lq.xyzw vf25, 5(vi00) | nop + c->vfs[vf25].vf = background_vu0_data[5]; + // lq.xyzw vf26, 6(vi00) | nop :e + c->vfs[vf26].vf = background_vu0_data[6]; + // lq.xyzw vf27, 7(vi00) | nop + c->vfs[vf27].vf = background_vu0_data[7]; +} + +/*! + * Set up the VU0 context like it would be for background. See background-upload-vu0 in + * background.gc for more details. + */ +void init_background(ExecutionContext* c) { + // this first part is GOAL to init VU1 vf registers from the math camera. + + // lw v1, *math-camera*(s7) + c->load_symbol(v1, cache.math_camera); + // lqc2 vf16, 860(v1) + c->lqc2(vf16, 860, v1); + // lqc2 vf17, 876(v1) + c->lqc2(vf17, 876, v1); + // lqc2 vf18, 892(v1) + c->lqc2(vf18, 892, v1); + // lqc2 vf19, 908(v1) + c->lqc2(vf19, 908, v1); + // lqc2 vf20, 988(v1) + c->lqc2(vf20, 988, v1); + // lqc2 vf21, 1004(v1) + c->lqc2(vf21, 1004, v1); + // lqc2 vf22, 1020(v1) + c->lqc2(vf22, 1020, v1); + // lqc2 vf23, 1036(v1) + c->lqc2(vf23, 1036, v1); + // lqc2 vf24, 364(v1) + c->lqc2(vf24, 364, v1); + // lqc2 vf25, 380(v1) + c->lqc2(vf25, 380, v1); + // lqc2 vf26, 396(v1) + c->lqc2(vf26, 396, v1); + // lqc2 vf27, 412(v1) + c->lqc2(vf27, 412, v1); + // lqc2 vf28, 572(v1) + c->lqc2(vf28, 572, v1); + // lqc2 vf29, 588(v1) + c->lqc2(vf29, 588, v1); + // lqc2 vf30, 604(v1) + c->lqc2(vf30, 604, v1); + // lqc2 vf31, 620(v1) + c->lqc2(vf31, 620, v1); + // lqc2 vf31, 620(v1) + c->lqc2(vf31, 620, v1); + + // dump them in VU0 data memory for fast access later. + // sq.xyzw vf24, 4(vi00) | maxw.xyzw vf01, vf00, vf00 + c->vfs[vf01].vf.fill(1.f); + background_vu0_data[4] = c->vfs[vf24].vf; + // sq.xyzw vf25, 5(vi00) | nop + background_vu0_data[5] = c->vfs[vf25].vf; + // sq.xyzw vf26, 6(vi00) | nop + background_vu0_data[6] = c->vfs[vf26].vf; + // sq.xyzw vf27, 7(vi00) | nop + background_vu0_data[7] = c->vfs[vf27].vf; + // sq.xyzw vf16, 0(vi00) | mulz.xyzw vf24, vf01, vf24 + background_vu0_data[0] = c->vfs[vf16].vf; + c->vfs[vf24].vf.mul(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf24].vf.z()); + // sq.xyzw vf17, 1(vi00) | mulz.xyzw vf25, vf01, vf25 + background_vu0_data[1] = c->vfs[vf17].vf; + c->vfs[vf25].vf.mul(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf25].vf.z()); + // sq.xyzw vf18, 2(vi00) | mulz.xyzw vf26, vf01, vf26 + background_vu0_data[2] = c->vfs[vf18].vf; + c->vfs[vf26].vf.mul(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf26].vf.z()); + // sq.xyzw vf19, 3(vi00) | mulz.xyzw vf27, vf01, vf27 + background_vu0_data[3] = c->vfs[vf19].vf; + c->vfs[vf27].vf.mul(Mask::xyzw, c->vfs[vf01].vf, c->vfs[vf27].vf.z()); + // sq.xyzw vf24, 12(vi00) | nop + background_vu0_data[12] = c->vfs[vf24].vf; + // sq.xyzw vf25, 13(vi00) | nop + background_vu0_data[13] = c->vfs[vf25].vf; + // sq.xyzw vf26, 14(vi00) | nop + background_vu0_data[14] = c->vfs[vf26].vf; + // sq.xyzw vf27, 15(vi00) | nop + background_vu0_data[15] = c->vfs[vf27].vf; + // sq.xyzw vf28, 8(vi00) | nop + background_vu0_data[8] = c->vfs[vf28].vf; + // sq.xyzw vf29, 9(vi00) | nop + background_vu0_data[9] = c->vfs[vf29].vf; + // sq.xyzw vf30, 10(vi00) | nop + background_vu0_data[10] = c->vfs[vf30].vf; + // sq.xyzw vf31, 11(vi00) | nop :e + background_vu0_data[11] = c->vfs[vf31].vf; + // iaddiu vi02, vi00, 0xf0 | nop +} + +// clang-format off +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + init_background(c); + bool bc = false; + u16 vi01 = 0; + + u32 madr, sadr, qwc; + c->daddiu(sp, sp, -128); // daddiu sp, sp, -128 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s0, 16, sp); // sq s0, 16(sp) + c->sq(s1, 32, sp); // sq s1, 32(sp) + c->sq(s2, 48, sp); // sq s2, 48(sp) + c->sq(s3, 64, sp); // sq s3, 64(sp) + c->sq(s4, 80, sp); // sq s4, 80(sp) + c->sq(s5, 96, sp); // sq s5, 96(sp) + c->sq(gp, 112, sp); // sq gp, 112(sp) + get_fake_spad_addr(t4, cache.fake_scratchpad_data, 0, c);// lui t4, 28672 + c->lw(v1, 4, a3); // lw v1, 4(a3) + c->lui(t1, 4096); // lui t1, 4096 + c->lui(t2, 4096); // lui t2, 4096 + // sync.l + // cache dxwbin v1, 0 + // sync.l + // cache dxwbin v1, 1 + // sync.l + c->load_symbol(t0, cache.instance_tie_work_copy); // lw t0, *instance-tie-work-copy*(s7) + c->ori(t1, t1, 54272); // ori t1, t1, 54272 SPR TO + c->sw(a3, 396, t0); // sw a3, 396(t0) + c->ori(a3, t2, 53248); // ori a3, t2, 53248 SPR FROM + c->load_symbol(t5, cache.wind_work); // lw t5, *wind-work*(s7) + c->lw(t6, 0, a0); // lw t6, 0(a0) + c->ori(t2, t4, 16); // ori t2, t4, 16 + c->vmax_bc(DEST::xyzw, BC::w, vf1, vf0, vf0); // vmaxw.xyzw vf1, vf0, vf0 + c->addiu(t3, a1, -4); // addiu t3, a1, -4 + c->ori(a1, t4, 4112); // ori a1, t4, 4112 + c->sw(t1, 400, t0); // sw t1, 400(t0) + c->addiu(t9, r0, 0); // addiu t9, r0, 0 + c->sw(a3, 404, t0); // sw a3, 404(t0) + c->mov64(t8, a1); // or t8, a1, r0 + c->sw(t5, 408, t0); // sw t5, 408(t0) + // nop // sll r0, r0, 0 + c->lqc2(vf3, 64, t0); // lqc2 vf3, 64(t0) + // nop // sll r0, r0, 0 + c->sw(r0, 432, t0); // sw r0, 432(t0) + + block_1: + bc = c->sgpr64(t6) != 0; // bne t6, r0, L139 + // nop // sll r0, r0, 0 + if (bc) {goto block_4;} // branch non-likely + + c->addiu(a0, a0, 4); // addiu a0, a0, 4 + c->addiu(t3, t3, 2048); // addiu t3, t3, 2048 + c->daddiu(a2, a2, -32); // daddiu a2, a2, -32 + c->lw(t6, 0, a0); // lw t6, 0(a0) + bc = ((s64)c->sgpr64(a2)) <= 0; // blez a2, L177 + // nop // sll r0, r0, 0 + if (bc) {goto block_70;} // branch non-likely + + //beq r0, r0, L138 // beq r0, r0, L138 + // nop // sll r0, r0, 0 + goto block_1; // branch always + + + block_4: + /* Wait for SPR TO to be free. + c->lw(t4, 0, t1); // lw t4, 0(t1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(t4, t4, 256); // andi t4, t4, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t4) != 0; // bne t4, r0, L139 + // nop // sll r0, r0, 0 + if (bc) {goto block_4;} // branch non-likely + */ + + // c->sw(t3, 16, t1); // sw t3, 16(t1) + madr = c->sgpr64(t3); + c->xori(t4, t2, 2048); // xori t4, t2, 2048 + // c->sw(t4, 128, t1); // sw t4, 128(t1) + sadr = c->sgpr64(t4); + c->addiu(t4, r0, 128); // addiu t4, r0, 128 + // c->sw(t4, 32, t1); // sw t4, 32(t1) + qwc = c->sgpr64(t4); + c->addiu(t4, r0, 256); // addiu t4, r0, 256 + // c->sw(t4, 0, t1); // sw t4, 0(t1) + spad_to_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + // nop // sll r0, r0, 0 + + block_6: + c->mov64(ra, a0); // or ra, a0, r0 + c->xori(t2, t2, 2048); // xori t2, t2, 2048 + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + c->mov64(t7, a0); // or t7, a0, r0 + c->mov64(t4, t2); // or t4, t2, r0 + c->daddiu(t6, a2, -32); // daddiu t6, a2, -32 + bc = ((s64)c->sgpr64(t6)) > 0; // bgtz t6, L142 + c->lw(t6, 0, a0); // lw t6, 0(a0) + if (bc) {goto block_11;} // branch non-likely + + //beq r0, r0, L145 // beq r0, r0, L145 + // nop // sll r0, r0, 0 + goto block_15; // branch always + + // nop // sll r0, r0, 0 + c->lw(v1, 400, r0); // lw v1, 400(r0) + + block_9: + c->daddiu(a2, a2, -32); // daddiu a2, a2, -32 + c->addiu(a0, a0, 4); // addiu a0, a0, 4 + bc = ((s64)c->sgpr64(a2)) <= 0; // blez a2, L145 + c->lw(t6, 0, a0); // lw t6, 0(a0) + if (bc) {goto block_15;} // branch non-likely + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + + block_11: + bc = c->sgpr64(t6) == 0; // beq t6, r0, L141 + c->addiu(t3, t3, 2048); // addiu t3, t3, 2048 + if (bc) {goto block_9;} // branch non-likely + + /* Wait on DMA TO + block_12: + c->lw(t6, 0, t1); // lw t6, 0(t1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(t6, t6, 256); // andi t6, t6, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t6) == 0; // beq t6, r0, L144 + // nop // sll r0, r0, 0 + if (bc) {goto block_14;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(t6, 444, t0); // lw t6, 444(t0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(t6, t6, 1); // daddiu t6, t6, 1 + // nop // sll r0, r0, 0 + c->sw(t6, 444, t0); // sw t6, 444(t0) + //beq r0, r0, L143 // beq r0, r0, L143 + // nop // sll r0, r0, 0 + goto block_12; // branch always + */ + + + // block_14: + // c->sw(t3, 16, t1); // sw t3, 16(t1) + madr = c->sgpr64(t3); + c->xori(t6, t2, 2048); // xori t6, t2, 2048 + // c->sw(t6, 128, t1); // sw t6, 128(t1) + sadr = c->sgpr64(t6); + c->addiu(t6, r0, 128); // addiu t6, r0, 128 + // c->sw(t6, 32, t1); // sw t6, 32(t1) + qwc = c->sgpr64(t6); + c->addiu(t6, r0, 256); // addiu t6, r0, 256 + //beq r0, r0, L146 // beq r0, r0, L146 + // c->sw(t6, 0, t1); // sw t6, 0(t1) + spad_to_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + goto block_17; // branch always + + + block_15: + /* + c->lw(t6, 0, t1); // lw t6, 0(t1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(t6, t6, 256); // andi t6, t6, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t6) == 0; // beq t6, r0, L146 + // nop // sll r0, r0, 0 + if (bc) {goto block_17;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(t6, 444, t0); // lw t6, 444(t0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(t6, t6, 1); // daddiu t6, t6, 1 + // nop // sll r0, r0, 0 + c->sw(t6, 444, t0); // sw t6, 444(t0) + //beq r0, r0, L145 // beq r0, r0, L145 + // nop // sll r0, r0, 0 + goto block_15; // branch always + */ + + + block_17: + c->lb(t6, 0, ra); // lb t6, 0(ra) + c->addiu(ra, ra, 1); // addiu ra, ra, 1 + // nop // sll r0, r0, 0 + c->sw(ra, 412, t0); // sw ra, 412(t0) + bc = c->sgpr64(t6) != 0; // bne t6, r0, L147 + c->sw(t7, 416, t0); // sw t7, 416(t0) + if (bc) {goto block_19;} // branch non-likely + + c->daddiu(a2, a2, -8); // daddiu a2, a2, -8 + c->addiu(t4, t4, 512); // addiu t4, t4, 512 + //beq r0, r0, L173 // beq r0, r0, L173 + // nop // sll r0, r0, 0 + goto block_62; // branch always + + + block_19: + c->addiu(t7, r0, 128); // addiu t7, r0, 128 + c->lqc2(vf2, 16, t4); // lqc2 vf2, 16(t4) + + block_20: + c->daddiu(ra, t9, -246); // daddiu ra, t9, -246 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(ra)) <= 0; // blez ra, L151 + // vcallms 42 + vi01 = vcallms_42(c); + if (bc) {goto block_24;} // branch non-likely + + /* + block_21: + c->lw(t8, 0, a3); // lw t8, 0(a3) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(t8, t8, 256); // andi t8, t8, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t8) == 0; // beq t8, r0, L150 + // nop // sll r0, r0, 0 + if (bc) {goto block_23;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(t8, 440, t0); // lw t8, 440(t0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(t8, t8, 1); // daddiu t8, t8, 1 + // nop // sll r0, r0, 0 + c->sw(t8, 440, t0); // sw t8, 440(t0) + //beq r0, r0, L149 // beq r0, r0, L149 + // nop // sll r0, r0, 0 + goto block_21; // branch always + */ + + + // block_23: + // c->sw(a1, 128, a3); // sw a1, 128(a3) + sadr = c->sgpr64(a1); + c->xori(a1, a1, 12288); // xori a1, a1, 12288 + // c->sw(v1, 16, a3); // sw v1, 16(a3) + madr = c->sgpr64(v1); + c->sll(t8, t9, 4); // sll t8, t9, 4 + c->addu(v1, v1, t8); // addu v1, v1, t8 + c->mov64(t8, a1); // or t8, a1, r0 + // c->sw(t9, 32, a3); // sw t9, 32(a3) + qwc = c->sgpr64(t9); + c->addiu(t9, r0, 256); // addiu t9, r0, 256 + // c->sw(t9, 0, a3); // sw t9, 0(a3) + spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + c->addiu(t9, r0, 0); // addiu t9, r0, 0 + + block_24: + // nop // sll r0, r0, 0 + c->lw(ra, 12, t4); // lw ra, 12(t4) + c->and_(gp, t6, t7); // and gp, t6, t7 + c->ld(s5, 56, t4); // ld s5, 56(t4) + bc = c->sgpr64(gp) == 0; // beq gp, r0, L172 + c->ld(s2, 32, t4); // ld s2, 32(t4) + if (bc) {goto block_61;} // branch non-likely + + c->sll(gp, t9, 4); // sll gp, t9, 4 + c->ld(s4, 40, t4); // ld s4, 40(t4) + c->pextlh(s3, s5, r0); // pextlh s3, s5, r0 + c->ld(s5, 48, t4); // ld s5, 48(t4) + c->psraw(s3, s3, 10); // psraw s3, s3, 10 + c->lq(s1, 28, ra); // lq s1, 28(ra) + c->pextlh(s2, s2, r0); // pextlh s2, s2, r0 + c->lq(s0, 44, ra); // lq s0, 44(ra) + c->psraw(s2, s2, 16); // psraw s2, s2, 16 + c->mov128_vf_gpr(vf14, s1); // qmtc2.ni vf14, s1 + c->pextlh(s4, s4, r0); // pextlh s4, s4, r0 + c->mov128_vf_gpr(vf15, s0); // qmtc2.ni vf15, s0 + c->psraw(s4, s4, 16); // psraw s4, s4, 16 + c->mov128_vf_gpr(vf13, s3); // qmtc2.ni vf13, s3 + c->pextlh(s5, s5, r0); // pextlh s5, s5, r0 + c->mov128_vf_gpr(vf10, s2); // qmtc2.ni vf10, s2 + c->psraw(s3, s5, 16); // psraw s3, s5, 16 + c->lhu(s2, 62, t4); // lhu s2, 62(t4) + c->addu(gp, gp, v1); // addu gp, gp, v1 + c->mov128_vf_gpr(vf11, s4); // qmtc2.ni vf11, s4 + c->dsll(s5, s2, 4); // dsll s5, s2, 4 + c->mov128_vf_gpr(vf12, s3); // qmtc2.ni vf12, s3 + c->daddu(s4, s2, t5); // daddu s4, s2, t5 + c->lw(s2, 408, t0); // lw s2, 408(t0) + c->andi(s4, s4, 63); // andi s4, s4, 63 + c->lw(s3, 384, t0); // lw s3, 384(t0) + c->sll(s1, s4, 4); // sll s1, s4, 4 + c->lw(s4, 4, ra); // lw s4, 4(ra) + c->daddu(s5, s3, s5); // daddu s5, s3, s5 + c->addu(s3, s1, s2); // addu s3, s1, s2 + c->andi(s1, s4, 1); // andi s1, s4, 1 + c->andi(s4, s4, 2); // andi s4, s4, 2 + bc = c->sgpr64(s1) != 0; // bne s1, r0, L172 + c->gprs[s1].du64[0] = vi01; // cfc2.ni s1, vi1 + if (bc) {goto block_61;} // branch non-likely + + c->vitof0(DEST::xyzw, vf13, vf13); // vitof0.xyzw vf13, vf13 + c->lw(t5, 1324, s2); // lw t5, 1324(s2) + bc = c->sgpr64(s1) != 0; // bne s1, r0, L172 + c->lqc2(vf25, 112, t0); // lqc2 vf25, 112(t0) + if (bc) {goto block_61;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lqc2(vf16, 16, t0); // lqc2 vf16, 16(t0) + // nop // sll r0, r0, 0 + c->lqc2(vf17, 32, t0); // lqc2 vf17, 32(t0) + c->vmula_bc(DEST::xyzw, BC::z, vf1, vf6); // vmulaz.xyzw acc, vf1, vf6 + c->sw(gp, 196, t0); // sw gp, 196(t0) + c->vmsub_bc(DEST::xyzw, BC::w, vf8, vf1, vf2); // vmsubw.xyzw vf8, vf1, vf2 + c->sw(gp, 276, t0); // sw gp, 276(t0) + c->vadd(DEST::xyz, vf5, vf0, vf0); // vadd.xyz vf5, vf0, vf0 + // nop // sll r0, r0, 0 + c->vadd(DEST::xyz, vf13, vf13, vf2); // vadd.xyz vf13, vf13, vf2 + // nop // sll r0, r0, 0 + // Unknown instr: vmula.xyzw acc, vf1, vf1 + c->vmula(DEST::xyzw, vf1, vf1); + // nop // sll r0, r0, 0 + c->vsub(DEST::xyzw, vf14, vf8, vf14); // vsub.xyzw vf14, vf8, vf14 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::w, BC::w, vf5, vf5, vf17); // vaddw.w vf5, vf5, vf17 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lqc2(vf30, 80, t0); // lqc2 vf30, 80(t0) + c->vmini(DEST::xyzw, vf25, vf8, vf25); // vmini.xyzw vf25, vf8, vf25 + // nop // sll r0, r0, 0 + // Unknown instr: vmsub.xyz vf15, vf14, vf15 + c->vmsub(DEST::xyz, vf15, vf14, vf15); + // nop // sll r0, r0, 0 + c->vmini_bc(DEST::w, BC::y, vf5, vf5, vf16); // vminiy.w vf5, vf5, vf16 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lqc2(vf24, 128, t0); // lqc2 vf24, 128(t0) + // nop // sll r0, r0, 0 + c->sqc2(vf25, 112, t0); // sqc2 vf25, 112(t0) + c->vmini(DEST::xyz, vf15, vf15, vf1); // vmini.xyz vf15, vf15, vf1 + // nop // sll r0, r0, 0 + c->vmax_bc(DEST::w, BC::x, vf5, vf5, vf16); // vmaxx.w vf5, vf5, vf16 + // nop // sll r0, r0, 0 + c->vsub_bc(DEST::xyzw, BC::z, vf16, vf8, vf16); // vsubz.xyzw vf16, vf8, vf16 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lqc2(vf25, 144, t0); // lqc2 vf25, 144(t0) + // nop // sll r0, r0, 0 + c->lqc2(vf26, 160, t0); // lqc2 vf26, 160(t0) + // nop // sll r0, r0, 0 + c->lqc2(vf27, 176, t0); // lqc2 vf27, 176(t0) + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf2); // vmulax.xyzw acc, vf24, vf2 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf2); // vmadday.xyzw acc, vf25, vf2 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::z, vf26, vf2); // vmaddaz.xyzw acc, vf26, vf2 + // nop // sll r0, r0, 0 + c->vmsuba_bc(DEST::xyzw, BC::w, vf27, vf0); // vmsubaw.xyzw acc, vf27, vf0 + // nop // sll r0, r0, 0 + c->vmsub_bc(DEST::xyzw, BC::w, vf24, vf1, vf2); // vmsubw.xyzw vf24, vf1, vf2 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(s2, vf16); // qmfc2.i s2, vf16 + c->vmul_bc(DEST::xyzw, BC::w, vf28, vf15, vf30); // vmulw.xyzw vf28, vf15, vf30 + // nop // sll r0, r0, 0 + c->vmul_bc(DEST::xyzw, BC::w, vf29, vf15, vf30); // vmulw.xyzw vf29, vf15, vf30 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lqc2(vf19, 0, t0); // lqc2 vf19, 0(t0) + c->vitof12(DEST::xyzw, vf10, vf10); // vitof12.xyzw vf10, vf10 + // nop // sll r0, r0, 0 + c->pcgtw(s1, r0, s2); // pcgtw s1, r0, s2 + c->mov128_gpr_vf(s0, vf24); // qmfc2.i s0, vf24 + c->vmul_bc(DEST::xyzw, BC::x, vf28, vf1, vf28); // vmulx.xyzw vf28, vf1, vf28 + // nop // sll r0, r0, 0 + c->vmul_bc(DEST::xyzw, BC::z, vf29, vf1, vf29); // vmulz.xyzw vf29, vf1, vf29 + c->lw(s2, 56, ra); // lw s2, 56(ra) + c->pcgtw(s0, r0, s0); // pcgtw s0, r0, s0 + c->sqc2(vf5, 80, t8); // sqc2 vf5, 80(t8) + c->ppach(s0, r0, s0); // ppach s0, r0, s0 + c->sw(s4, 80, t8); // sw s4, 80(t8) + c->or_(s1, s0, s1); // or s1, s0, s1 + c->sqc2(vf14, 96, t0); // sqc2 vf14, 96(t0) + c->ppacb(s1, r0, s1); // ppacb s1, r0, s1 + c->mfc1(r0, f31); // mfc1 r0, f31 + bc = c->sgpr64(s2) == 0; // beq s2, r0, L153 + c->sw(s1, 84, t8); // sw s1, 84(t8) + if (bc) {goto block_33;} // branch non-likely + + c->vftoi0(DEST::zw, vf28, vf28); // vftoi0.zw vf28, vf28 + c->ld(s1, 8, s5); // ld s1, 8(s5) + c->vftoi0(DEST::zw, vf29, vf29); // vftoi0.zw vf29, vf29 + c->ld(s2, 0, s5); // ld s2, 0(s5) + c->pextlw(s1, r0, s1); // pextlw s1, r0, s1 + c->lqc2(vf16, 12, s3); // lqc2 vf16, 12(s3) + c->pextlw(s3, r0, s2); // pextlw s3, r0, s2 + c->mov128_vf_gpr(vf18, s1); // qmtc2.i vf18, s1 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf17, s3); // qmtc2.i vf17, s3 + // Unknown instr: vmula.xyzw acc, vf16, vf1 + c->vmula(DEST::xyzw, vf16, vf1); + // nop // sll r0, r0, 0 + c->vmsuba_bc(DEST::xyzw, BC::x, vf18, vf19); // vmsubax.xyzw acc, vf18, vf19 + // nop // sll r0, r0, 0 + c->vmsub_bc(DEST::xyzw, BC::y, vf16, vf17, vf19); // vmsuby.xyzw vf16, vf17, vf19 + // nop // sll r0, r0, 0 + c->vsub_bc(DEST::x, BC::x, vf28, vf30, vf15); // vsubx.x vf28, vf30, vf15 + // nop // sll r0, r0, 0 + c->vsub_bc(DEST::x, BC::z, vf29, vf1, vf15); // vsubz.x vf29, vf1, vf15 + // nop // sll r0, r0, 0 + c->vitof0(DEST::zw, vf28, vf28); // vitof0.zw vf28, vf28 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::z, vf16, vf19); // vmulaz.xyzw acc, vf16, vf19 + // nop // sll r0, r0, 0 + c->vmadd(DEST::xyzw, vf18, vf1, vf18); // vmadd.xyzw vf18, vf1, vf18 + // nop // sll r0, r0, 0 + c->vitof0(DEST::zw, vf29, vf29); // vitof0.zw vf29, vf29 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::y, BC::y, vf28, vf0, vf0); // vaddy.y vf28, vf0, vf0 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::y, BC::y, vf29, vf0, vf0); // vaddy.y vf29, vf0, vf0 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::z, vf18, vf19); // vmulaz.xyzw acc, vf18, vf19 + // nop // sll r0, r0, 0 + c->vmadd(DEST::xyzw, vf17, vf17, vf1); // vmadd.xyzw vf17, vf17, vf1 + // nop // sll r0, r0, 0 + c->vitof12(DEST::xyzw, vf11, vf11); // vitof12.xyzw vf11, vf11 + // nop // sll r0, r0, 0 + c->vitof12(DEST::xyzw, vf12, vf12); // vitof12.xyzw vf12, vf12 + // nop // sll r0, r0, 0 + c->vsub_bc(DEST::w, BC::w, vf28, vf30, vf28); // vsubw.w vf28, vf30, vf28 + // nop // sll r0, r0, 0 + c->vmini_bc(DEST::xyzw, BC::w, vf17, vf17, vf0); // vminiw.xyzw vf17, vf17, vf0 + // nop // sll r0, r0, 0 + c->vsub_bc(DEST::w, BC::w, vf29, vf30, vf29); // vsubw.w vf29, vf30, vf29 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(s3, vf18); // qmfc2.i s3, vf18 + c->vmax_bc(DEST::xyzw, BC::w, vf27, vf17, vf19); // vmaxw.xyzw vf27, vf17, vf19 + // nop // sll r0, r0, 0 + c->ppacw(s3, r0, s3); // ppacw s3, r0, s3 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->vmul_bc(DEST::xyzw, BC::w, vf27, vf27, vf15); // vmulw.xyzw vf27, vf27, vf15 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::yw, BC::x, vf0, vf0); // vmulax.yw acc, vf0, vf0 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xz, BC::y, vf27, vf10); // vmulay.xz acc, vf27, vf10 + // nop // sll r0, r0, 0 + c->vmadd(DEST::xyzw, vf10, vf1, vf10); // vmadd.xyzw vf10, vf1, vf10 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(s2, vf27); // qmfc2.i s2, vf27 + c->vmula_bc(DEST::yw, BC::x, vf0, vf0); // vmulax.yw acc, vf0, vf0 + c->lw(s1, 436, t0); // lw s1, 436(t0) + c->vmula_bc(DEST::xz, BC::y, vf27, vf11); // vmulay.xz acc, vf27, vf11 + // nop // sll r0, r0, 0 + c->vmadd(DEST::xyzw, vf11, vf1, vf11); // vmadd.xyzw vf11, vf1, vf11 + // nop // sll r0, r0, 0 + bc = c->sgpr64(s1) != c->sgpr64(s7); // bne s1, s7, L152 + c->ppacw(s2, r0, s2); // ppacw s2, r0, s2 + if (bc) {goto block_31;} // branch non-likely + + c->vmula_bc(DEST::yw, BC::x, vf0, vf0); // vmulax.yw acc, vf0, vf0 + c->sd(s3, 8, s5); // sd s3, 8(s5) + c->vmula_bc(DEST::xz, BC::y, vf27, vf12); // vmulay.xz acc, vf27, vf12 + c->sd(s2, 0, s5); // sd s2, 0(s5) + bc = c->sgpr64(s4) != 0; // bne s4, r0, L164 + c->vmadd(DEST::xyzw, vf12, vf1, vf12); // vmadd.xyzw vf12, vf1, vf12 + if (bc) {goto block_49;} // branch non-likely + + //beq r0, r0, L154 // beq r0, r0, L154 + // nop // sll r0, r0, 0 + goto block_34; // branch always + + + block_31: + c->vmula_bc(DEST::yw, BC::x, vf0, vf0); // vmulax.yw acc, vf0, vf0 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xz, BC::y, vf27, vf12); // vmulay.xz acc, vf27, vf12 + // nop // sll r0, r0, 0 + bc = c->sgpr64(s4) != 0; // bne s4, r0, L164 + c->vmadd(DEST::xyzw, vf12, vf1, vf12); // vmadd.xyzw vf12, vf1, vf12 + if (bc) {goto block_49;} // branch non-likely + + //beq r0, r0, L154 // beq r0, r0, L154 + // nop // sll r0, r0, 0 + goto block_34; // branch always + + + block_33: + c->vftoi0(DEST::zw, vf28, vf28); // vftoi0.zw vf28, vf28 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::zw, vf29, vf29); // vftoi0.zw vf29, vf29 + // nop // sll r0, r0, 0 + c->vsub_bc(DEST::x, BC::x, vf28, vf30, vf15); // vsubx.x vf28, vf30, vf15 + // nop // sll r0, r0, 0 + c->vsub_bc(DEST::x, BC::z, vf29, vf1, vf15); // vsubz.x vf29, vf1, vf15 + // nop // sll r0, r0, 0 + c->vitof0(DEST::zw, vf28, vf28); // vitof0.zw vf28, vf28 + // nop // sll r0, r0, 0 + c->vitof0(DEST::zw, vf29, vf29); // vitof0.zw vf29, vf29 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::y, BC::y, vf28, vf0, vf0); // vaddy.y vf28, vf0, vf0 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::y, BC::y, vf29, vf0, vf0); // vaddy.y vf29, vf0, vf0 + // nop // sll r0, r0, 0 + c->vsub_bc(DEST::w, BC::w, vf28, vf30, vf28); // vsubw.w vf28, vf30, vf28 + // nop // sll r0, r0, 0 + c->vsub_bc(DEST::w, BC::w, vf29, vf30, vf29); // vsubw.w vf29, vf30, vf29 + // nop // sll r0, r0, 0 + c->vitof12(DEST::xyzw, vf11, vf11); // vitof12.xyzw vf11, vf11 + // nop // sll r0, r0, 0 + bc = c->sgpr64(s4) != 0; // bne s4, r0, L164 + c->vitof12(DEST::xyzw, vf12, vf12); // vitof12.xyzw vf12, vf12 + if (bc) {goto block_49;} // branch non-likely + + + block_34: + // nop // sll r0, r0, 0 + c->lw(s5, 84, t8); // lw s5, 84(t8) + // nop // sll r0, r0, 0 + c->lw(s4, 108, t0); // lw s4, 108(t0) + c->addiu(t9, t9, 6); // addiu t9, t9, 6 + c->lw(s3, 104, t0); // lw s3, 104(t0) + bc = c->sgpr64(s5) != 0; // bne s5, r0, L158 + c->vsub_bc(DEST::w, BC::w, vf10, vf10, vf10); // vsubw.w vf10, vf10, vf10 + if (bc) {goto block_41;} // branch non-likely + + bc = ((s64)c->sgpr64(s4)) > 0; // bgtz s4, L156 + // nop // sll r0, r0, 0 + if (bc) {goto block_39;} // branch non-likely + + bc = ((s64)c->sgpr64(s3)) > 0; // bgtz s3, L155 + // nop // sll r0, r0, 0 + if (bc) {goto block_38;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lh(s4, 78, ra); // lh s4, 78(ra) + // nop // sll r0, r0, 0 + c->lw(s5, 64, ra); // lw s5, 64(ra) + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->sqc2(vf28, 64, t8); // sqc2 vf28, 64(t8) + c->vmula_bc(DEST::xyzw, BC::x, vf20, vf10); // vmulax.xyzw acc, vf20, vf10 + c->addiu(gp, gp, 96); // addiu gp, gp, 96 + c->vmadda_bc(DEST::xyzw, BC::y, vf21, vf10); // vmadday.xyzw acc, vf21, vf10 + c->sw(gp, 64, ra); // sw gp, 64(ra) + c->vmadd_bc(DEST::xyzw, BC::z, vf10, vf22, vf10); // vmaddz.xyzw vf10, vf22, vf10 + c->sh(s4, 78, ra); // sh s4, 78(ra) + c->vmula_bc(DEST::xyzw, BC::x, vf20, vf11); // vmulax.xyzw acc, vf20, vf11 + c->lbu(s4, 109, ra); // lbu s4, 109(ra) + c->vmadda_bc(DEST::xyzw, BC::y, vf21, vf11); // vmadday.xyzw acc, vf21, vf11 + c->lhu(gp, 118, ra); // lhu gp, 118(ra) + c->vmadd_bc(DEST::xyzw, BC::z, vf11, vf22, vf11); // vmaddz.xyzw vf11, vf22, vf11 + c->lbu(s3, 113, ra); // lbu s3, 113(ra) + //beq r0, r0, L157 // beq r0, r0, L157 + // nop // sll r0, r0, 0 + goto block_40; // branch always + + + block_38: + // nop // sll r0, r0, 0 + c->lh(s4, 80, ra); // lh s4, 80(ra) + // nop // sll r0, r0, 0 + c->lw(s5, 68, ra); // lw s5, 68(ra) + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->sqc2(vf29, 64, t8); // sqc2 vf29, 64(t8) + c->vmula_bc(DEST::xyzw, BC::x, vf20, vf10); // vmulax.xyzw acc, vf20, vf10 + c->addiu(gp, gp, 96); // addiu gp, gp, 96 + c->vmadda_bc(DEST::xyzw, BC::y, vf21, vf10); // vmadday.xyzw acc, vf21, vf10 + c->sw(gp, 68, ra); // sw gp, 68(ra) + c->vmadd_bc(DEST::xyzw, BC::z, vf10, vf22, vf10); // vmaddz.xyzw vf10, vf22, vf10 + c->sh(s4, 80, ra); // sh s4, 80(ra) + c->vmula_bc(DEST::xyzw, BC::x, vf20, vf11); // vmulax.xyzw acc, vf20, vf11 + c->lbu(s4, 110, ra); // lbu s4, 110(ra) + c->vmadda_bc(DEST::xyzw, BC::y, vf21, vf11); // vmadday.xyzw acc, vf21, vf11 + c->lhu(gp, 120, ra); // lhu gp, 120(ra) + c->vmadd_bc(DEST::xyzw, BC::z, vf11, vf22, vf11); // vmaddz.xyzw vf11, vf22, vf11 + c->lbu(s3, 114, ra); // lbu s3, 114(ra) + //beq r0, r0, L157 // beq r0, r0, L157 + // nop // sll r0, r0, 0 + goto block_40; // branch always + + + block_39: + // nop // sll r0, r0, 0 + c->lh(s4, 82, ra); // lh s4, 82(ra) + // nop // sll r0, r0, 0 + c->lw(s5, 72, ra); // lw s5, 72(ra) + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->sqc2(vf30, 64, t8); // sqc2 vf30, 64(t8) + c->vmula_bc(DEST::xyzw, BC::x, vf20, vf10); // vmulax.xyzw acc, vf20, vf10 + c->addiu(gp, gp, 96); // addiu gp, gp, 96 + c->vmadda_bc(DEST::xyzw, BC::y, vf21, vf10); // vmadday.xyzw acc, vf21, vf10 + c->sw(gp, 72, ra); // sw gp, 72(ra) + c->vmadd_bc(DEST::xyzw, BC::z, vf10, vf22, vf10); // vmaddz.xyzw vf10, vf22, vf10 + c->sh(s4, 82, ra); // sh s4, 82(ra) + c->vmula_bc(DEST::xyzw, BC::x, vf20, vf11); // vmulax.xyzw acc, vf20, vf11 + c->lbu(s4, 111, ra); // lbu s4, 111(ra) + c->vmadda_bc(DEST::xyzw, BC::y, vf21, vf11); // vmadday.xyzw acc, vf21, vf11 + c->lhu(gp, 122, ra); // lhu gp, 122(ra) + c->vmadd_bc(DEST::xyzw, BC::z, vf11, vf22, vf11); // vmaddz.xyzw vf11, vf22, vf11 + c->lbu(s3, 115, ra); // lbu s3, 115(ra) + + block_40: + c->vmula_bc(DEST::xyzw, BC::x, vf20, vf12); // vmulax.xyzw acc, vf20, vf12 + c->lq(s2, 224, t0); // lq s2, 224(t0) + c->vmadda_bc(DEST::xyzw, BC::y, vf21, vf12); // vmadday.xyzw acc, vf21, vf12 + c->lq(s1, 240, t0); // lq s1, 240(t0) + c->vmadd_bc(DEST::xyzw, BC::z, vf12, vf22, vf12); // vmaddz.xyzw vf12, vf22, vf12 + c->dsll(gp, gp, 4); // dsll gp, gp, 4 + c->vmula_bc(DEST::xyzw, BC::x, vf20, vf13); // vmulax.xyzw acc, vf20, vf13 + c->daddu(s3, s3, ra); // daddu s3, s3, ra + c->vmadda_bc(DEST::xyzw, BC::y, vf21, vf13); // vmadday.xyzw acc, vf21, vf13 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::z, vf22, vf13); // vmaddaz.xyzw acc, vf22, vf13 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::w, vf13, vf23, vf0); // vmaddw.xyzw vf13, vf23, vf0 + // nop // sll r0, r0, 0 + c->sqc2(vf10, 0, t8); // sqc2 vf10, 0(t8) + // nop // sll r0, r0, 0 + c->sqc2(vf11, 16, t8); // sqc2 vf11, 16(t8) + c->movz(s2, s1, s5); // movz s2, s1, s5 + c->sqc2(vf12, 32, t8); // sqc2 vf12, 32(t8) + c->daddiu(t8, t8, 96); // daddiu t8, t8, 96 + //beq r0, r0, L159 // beq r0, r0, L159 + c->sqc2(vf13, -48, t8); // sqc2 vf13, -48(t8) + goto block_42; // branch always + + + block_41: + // nop // sll r0, r0, 0 + c->lqc2(vf24, 320, t0); // lqc2 vf24, 320(t0) + // nop // sll r0, r0, 0 + c->lqc2(vf25, 336, t0); // lqc2 vf25, 336(t0) + // nop // sll r0, r0, 0 + c->lqc2(vf26, 352, t0); // lqc2 vf26, 352(t0) + // nop // sll r0, r0, 0 + c->lqc2(vf27, 368, t0); // lqc2 vf27, 368(t0) + // nop // sll r0, r0, 0 + c->lh(s4, 76, ra); // lh s4, 76(ra) + // nop // sll r0, r0, 0 + c->lw(s5, 60, ra); // lw s5, 60(ra) + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->sqc2(vf28, 64, t8); // sqc2 vf28, 64(t8) + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf10); // vmulax.xyzw acc, vf24, vf10 + c->addiu(gp, gp, 96); // addiu gp, gp, 96 + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf10); // vmadday.xyzw acc, vf25, vf10 + c->sw(gp, 60, ra); // sw gp, 60(ra) + c->vmadd_bc(DEST::xyzw, BC::z, vf10, vf26, vf10); // vmaddz.xyzw vf10, vf26, vf10 + c->sh(s4, 76, ra); // sh s4, 76(ra) + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf11); // vmulax.xyzw acc, vf24, vf11 + c->lbu(s4, 108, ra); // lbu s4, 108(ra) + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf11); // vmadday.xyzw acc, vf25, vf11 + c->lhu(gp, 116, ra); // lhu gp, 116(ra) + c->vmadd_bc(DEST::xyzw, BC::z, vf11, vf26, vf11); // vmaddz.xyzw vf11, vf26, vf11 + c->lbu(s3, 112, ra); // lbu s3, 112(ra) + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf12); // vmulax.xyzw acc, vf24, vf12 + c->lq(s2, 224, t0); // lq s2, 224(t0) + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf12); // vmadday.xyzw acc, vf25, vf12 + c->lq(s1, 240, t0); // lq s1, 240(t0) + c->vmadd_bc(DEST::xyzw, BC::z, vf12, vf26, vf12); // vmaddz.xyzw vf12, vf26, vf12 + c->dsll(gp, gp, 4); // dsll gp, gp, 4 + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf13); // vmulax.xyzw acc, vf24, vf13 + c->daddu(s3, s3, ra); // daddu s3, s3, ra + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf13); // vmadday.xyzw acc, vf25, vf13 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::z, vf26, vf13); // vmaddaz.xyzw acc, vf26, vf13 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::w, vf13, vf27, vf0); // vmaddw.xyzw vf13, vf27, vf0 + // nop // sll r0, r0, 0 + c->sqc2(vf10, 0, t8); // sqc2 vf10, 0(t8) + // nop // sll r0, r0, 0 + c->sqc2(vf11, 16, t8); // sqc2 vf11, 16(t8) + // nop // sll r0, r0, 0 + c->sqc2(vf12, 32, t8); // sqc2 vf12, 32(t8) + c->movz(s2, s1, s5); // movz s2, s1, s5 + c->sqc2(vf13, 48, t8); // sqc2 vf13, 48(t8) + c->daddiu(t8, t8, 96); // daddiu t8, t8, 96 + + block_42: + // nop // sll r0, r0, 0 + c->lw(ra, 8, t4); // lw ra, 8(t4) + // nop // sll r0, r0, 0 + c->sq(s2, 256, t0); // sq s2, 256(t0) + // nop // sll r0, r0, 0 + c->lbu(s2, 144, s3); // lbu s2, 144(s3) + c->addu(s1, gp, ra); // addu s1, gp, ra + c->sw(s5, 260, t0); // sw s5, 260(t0) + c->daddiu(t9, t9, 3); // daddiu t9, t9, 3 + c->sw(s1, 212, t0); // sw s1, 212(t0) + c->sll(s1, s2, 2); // sll s1, s2, 2 + c->sh(s2, 208, t0); // sh s2, 208(t0) + c->sll(s2, s2, 4); // sll s2, s2, 4 + c->sb(s1, 222, t0); // sb s1, 222(t0) + c->daddu(gp, gp, s2); // daddu gp, gp, s2 + c->lq(s2, 192, t0); // lq s2, 192(t0) + c->daddiu(s5, s5, 48); // daddiu s5, s5, 48 + c->lq(s1, 208, t0); // lq s1, 208(t0) + c->daddiu(t8, t8, 48); // daddiu t8, t8, 48 + c->lq(s0, 256, t0); // lq s0, 256(t0) + c->daddiu(s3, s3, 1); // daddiu s3, s3, 1 + c->sq(s2, -48, t8); // sq s2, -48(t8) + c->daddiu(s4, s4, -1); // daddiu s4, s4, -1 + c->sq(s1, -32, t8); // sq s1, -32(t8) + bc = ((s64)c->sgpr64(s4)) <= 0; // blez s4, L172 + c->sq(s0, -16, t8); // sq s0, -16(t8) + if (bc) {goto block_61;} // branch non-likely + + + block_43: + c->daddiu(s2, t9, -252); // daddiu s2, t9, -252 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(s2)) <= 0; // blez s2, L163 + // nop // sll r0, r0, 0 + if (bc) {goto block_47;} // branch non-likely + + /* + block_44: + c->lw(t8, 0, a3); // lw t8, 0(a3) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(t8, t8, 256); // andi t8, t8, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t8) == 0; // beq t8, r0, L162 + // nop // sll r0, r0, 0 + if (bc) {goto block_46;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(t8, 440, t0); // lw t8, 440(t0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(t8, t8, 1); // daddiu t8, t8, 1 + // nop // sll r0, r0, 0 + c->sw(t8, 440, t0); // sw t8, 440(t0) + //beq r0, r0, L161 // beq r0, r0, L161 + // nop // sll r0, r0, 0 + goto block_44; // branch always + */ + + + // block_46: + // c->sw(a1, 128, a3); // sw a1, 128(a3) + sadr = c->sgpr64(a1); + c->xori(a1, a1, 12288); // xori a1, a1, 12288 + // c->sw(v1, 16, a3); // sw v1, 16(a3) + madr = c->sgpr64(v1); + c->sll(t8, t9, 4); // sll t8, t9, 4 + c->addu(v1, v1, t8); // addu v1, v1, t8 + c->mov64(t8, a1); // or t8, a1, r0 + // c->sw(t9, 32, a3); // sw t9, 32(a3) + qwc = c->sgpr64(t9); + c->addiu(t9, r0, 256); // addiu t9, r0, 256 + // c->sw(t9, 0, a3); // sw t9, 0(a3) + spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + c->addiu(t9, r0, 0); // addiu t9, r0, 0 + + block_47: + // nop // sll r0, r0, 0 + c->lbu(s2, 144, s3); // lbu s2, 144(s3) + c->addu(s1, gp, ra); // addu s1, gp, ra + c->sw(s5, 260, t0); // sw s5, 260(t0) + c->daddiu(t9, t9, 3); // daddiu t9, t9, 3 + c->sw(s1, 212, t0); // sw s1, 212(t0) + c->sll(s1, s2, 2); // sll s1, s2, 2 + c->sh(s2, 208, t0); // sh s2, 208(t0) + c->sll(s2, s2, 4); // sll s2, s2, 4 + c->sb(s1, 222, t0); // sb s1, 222(t0) + c->daddu(gp, gp, s2); // daddu gp, gp, s2 + c->lq(s2, 192, t0); // lq s2, 192(t0) + c->daddiu(s5, s5, 48); // daddiu s5, s5, 48 + c->lq(s1, 208, t0); // lq s1, 208(t0) + c->daddiu(t8, t8, 48); // daddiu t8, t8, 48 + c->lq(s0, 256, t0); // lq s0, 256(t0) + c->daddiu(s3, s3, 1); // daddiu s3, s3, 1 + c->sq(s2, -48, t8); // sq s2, -48(t8) + c->daddiu(s4, s4, -1); // daddiu s4, s4, -1 + c->sq(s1, -32, t8); // sq s1, -32(t8) + bc = ((s64)c->sgpr64(s4)) > 0; // bgtz s4, L160 + c->sq(s0, -16, t8); // sq s0, -16(t8) + if (bc) {goto block_43;} // branch non-likely + + //beq r0, r0, L172 // beq r0, r0, L172 + // nop // sll r0, r0, 0 + goto block_61; // branch always + + + block_49: + c->vmul(DEST::xyz, vf16, vf6, vf6); // vmul.xyz vf16, vf6, vf6 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lqc2(vf9, 124, ra); // lqc2 vf9, 124(ra) + c->vsub_bc(DEST::w, BC::w, vf10, vf10, vf10); // vsubw.w vf10, vf10, vf10 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->vadda_bc(DEST::x, BC::y, vf16, vf16); // vadday.x acc, vf16, vf16 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::x, BC::z, vf16, vf1, vf16); // vmaddz.x vf16, vf1, vf16 + // nop // sll r0, r0, 0 + c->vsqrt(vf16, BC::x); // vsqrt Q, vf16.x + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::y, vf1, vf9); // vmulay.xyzw acc, vf1, vf9 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::w, vf1, vf2); // vmaddaw.xyzw acc, vf1, vf2 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->vwaitq(); // vwaitq + // Unknown instr: vmsubq.xyzw vf16, vf1, Q + c->vmsubq(DEST::xyzw, vf16, vf1); + // nop // sll r0, r0, 0 + c->vmul_bc(DEST::xyzw, BC::x, vf16, vf16, vf9); // vmulx.xyzw vf16, vf16, vf9 + // nop // sll r0, r0, 0 + c->vmax_bc(DEST::x, BC::x, vf16, vf16, vf0); // vmaxx.x vf16, vf16, vf0 + // nop // sll r0, r0, 0 + c->vmini_bc(DEST::x, BC::y, vf16, vf16, vf3); // vminiy.x vf16, vf16, vf3 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf16, vf16); // vftoi0.xyzw vf16, vf16 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(s5, vf16); // qmfc2.i s5, vf16 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(s5, s5, 255); // andi s5, s5, 255 + // nop // sll r0, r0, 0 + bc = c->sgpr64(s5) == 0; // beq s5, r0, L154 + // nop // sll r0, r0, 0 + if (bc) {goto block_34;} // branch non-likely + + // Unknown instr: vcallms 29 + vcallms_29(c); + c->sw(s4, 432, t0); // sw s4, 432(t0) + // nop // sll r0, r0, 0 + c->lw(s4, 108, t0); // lw s4, 108(t0) + c->addiu(t9, t9, 6); // addiu t9, t9, 6 + c->lw(s3, 104, t0); // lw s3, 104(t0) + // nop // sll r0, r0, 0 + c->sw(s5, 80, t8); // sw s5, 80(t8) + bc = ((s64)c->sgpr64(s4)) > 0; // bgtz s4, L166 + // nop // sll r0, r0, 0 + if (bc) {goto block_54;} // branch non-likely + + bc = ((s64)c->sgpr64(s3)) > 0; // bgtz s3, L165 + // nop // sll r0, r0, 0 + if (bc) {goto block_53;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lh(s4, 86, ra); // lh s4, 86(ra) + // nop // sll r0, r0, 0 + c->lw(s5, 96, ra); // lw s5, 96(ra) + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->sqc2(vf28, 64, t8); // sqc2 vf28, 64(t8) + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf10); // vmulax.xyzw acc, vf24, vf10 + c->addiu(gp, gp, 96); // addiu gp, gp, 96 + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf10); // vmadday.xyzw acc, vf25, vf10 + c->sw(gp, 96, ra); // sw gp, 96(ra) + c->vmadd_bc(DEST::xyzw, BC::z, vf10, vf26, vf10); // vmaddz.xyzw vf10, vf26, vf10 + c->sh(s4, 86, ra); // sh s4, 86(ra) + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf11); // vmulax.xyzw acc, vf24, vf11 + c->lbu(s3, 109, ra); // lbu s3, 109(ra) + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf11); // vmadday.xyzw acc, vf25, vf11 + c->lhu(gp, 118, ra); // lhu gp, 118(ra) + c->vmadd_bc(DEST::xyzw, BC::z, vf11, vf26, vf11); // vmaddz.xyzw vf11, vf26, vf11 + c->lbu(s4, 113, ra); // lbu s4, 113(ra) + //beq r0, r0, L167 // beq r0, r0, L167 + // nop // sll r0, r0, 0 + goto block_55; // branch always + + + block_53: + // nop // sll r0, r0, 0 + c->lh(s4, 88, ra); // lh s4, 88(ra) + // nop // sll r0, r0, 0 + c->lw(s5, 100, ra); // lw s5, 100(ra) + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->sqc2(vf29, 64, t8); // sqc2 vf29, 64(t8) + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf10); // vmulax.xyzw acc, vf24, vf10 + c->addiu(gp, gp, 96); // addiu gp, gp, 96 + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf10); // vmadday.xyzw acc, vf25, vf10 + c->sw(gp, 100, ra); // sw gp, 100(ra) + c->vmadd_bc(DEST::xyzw, BC::z, vf10, vf26, vf10); // vmaddz.xyzw vf10, vf26, vf10 + c->sh(s4, 88, ra); // sh s4, 88(ra) + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf11); // vmulax.xyzw acc, vf24, vf11 + c->lbu(s3, 110, ra); // lbu s3, 110(ra) + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf11); // vmadday.xyzw acc, vf25, vf11 + c->lhu(gp, 120, ra); // lhu gp, 120(ra) + c->vmadd_bc(DEST::xyzw, BC::z, vf11, vf26, vf11); // vmaddz.xyzw vf11, vf26, vf11 + c->lbu(s4, 114, ra); // lbu s4, 114(ra) + //beq r0, r0, L167 // beq r0, r0, L167 + // nop // sll r0, r0, 0 + goto block_55; // branch always + + + block_54: + // nop // sll r0, r0, 0 + c->lh(s4, 90, ra); // lh s4, 90(ra) + // nop // sll r0, r0, 0 + c->lw(s5, 104, ra); // lw s5, 104(ra) + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->sqc2(vf30, 64, t8); // sqc2 vf30, 64(t8) + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf10); // vmulax.xyzw acc, vf24, vf10 + c->addiu(gp, gp, 96); // addiu gp, gp, 96 + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf10); // vmadday.xyzw acc, vf25, vf10 + c->sw(gp, 104, ra); // sw gp, 104(ra) + c->vmadd_bc(DEST::xyzw, BC::z, vf10, vf26, vf10); // vmaddz.xyzw vf10, vf26, vf10 + c->sh(s4, 90, ra); // sh s4, 90(ra) + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf11); // vmulax.xyzw acc, vf24, vf11 + c->lbu(s3, 111, ra); // lbu s3, 111(ra) + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf11); // vmadday.xyzw acc, vf25, vf11 + c->lhu(gp, 122, ra); // lhu gp, 122(ra) + c->vmadd_bc(DEST::xyzw, BC::z, vf11, vf26, vf11); // vmaddz.xyzw vf11, vf26, vf11 + c->lbu(s4, 115, ra); // lbu s4, 115(ra) + + block_55: + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf12); // vmulax.xyzw acc, vf24, vf12 + c->dsll(gp, gp, 4); // dsll gp, gp, 4 + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf12); // vmadday.xyzw acc, vf25, vf12 + c->daddu(s4, s4, ra); // daddu s4, s4, ra + c->vmadd_bc(DEST::xyzw, BC::z, vf12, vf26, vf12); // vmaddz.xyzw vf12, vf26, vf12 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf13); // vmulax.xyzw acc, vf24, vf13 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf13); // vmadday.xyzw acc, vf25, vf13 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::z, vf26, vf13); // vmaddaz.xyzw acc, vf26, vf13 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::w, vf13, vf27, vf0); // vmaddw.xyzw vf13, vf27, vf0 + // nop // sll r0, r0, 0 + c->sqc2(vf10, 0, t8); // sqc2 vf10, 0(t8) + // nop // sll r0, r0, 0 + c->sqc2(vf11, 16, t8); // sqc2 vf11, 16(t8) + // nop // sll r0, r0, 0 + c->sqc2(vf12, 32, t8); // sqc2 vf12, 32(t8) + // nop // sll r0, r0, 0 + c->sqc2(vf13, 48, t8); // sqc2 vf13, 48(t8) + c->daddiu(t8, t8, 96); // daddiu t8, t8, 96 + // nop // sll r0, r0, 0 + c->lw(ra, 8, t4); // lw ra, 8(t4) + // nop // sll r0, r0, 0 + c->lbu(s2, 144, s4); // lbu s2, 144(s4) + c->addu(s1, gp, ra); // addu s1, gp, ra + c->sw(s5, 284, t0); // sw s5, 284(t0) + c->daddiu(t9, t9, 3); // daddiu t9, t9, 3 + c->sw(s1, 292, t0); // sw s1, 292(t0) + c->sll(s1, s2, 4); // sll s1, s2, 4 + c->sh(s2, 288, t0); // sh s2, 288(t0) + c->daddu(gp, gp, s1); // daddu gp, gp, s1 + c->lq(s2, 272, t0); // lq s2, 272(t0) + c->daddiu(s5, s5, 48); // daddiu s5, s5, 48 + c->lq(s1, 288, t0); // lq s1, 288(t0) + c->daddiu(t8, t8, 48); // daddiu t8, t8, 48 + c->lq(s0, 304, t0); // lq s0, 304(t0) + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->sq(s2, -48, t8); // sq s2, -48(t8) + c->daddiu(s3, s3, -1); // daddiu s3, s3, -1 + c->sq(s1, -32, t8); // sq s1, -32(t8) + bc = ((s64)c->sgpr64(s3)) <= 0; // blez s3, L172 + c->sq(s0, -16, t8); // sq s0, -16(t8) + if (bc) {goto block_61;} // branch non-likely + + + block_56: + c->daddiu(s2, t9, -252); // daddiu s2, t9, -252 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(s2)) <= 0; // blez s2, L171 + // nop // sll r0, r0, 0 + if (bc) {goto block_60;} // branch non-likely + + /* + block_57: + c->lw(t8, 0, a3); // lw t8, 0(a3) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(t8, t8, 256); // andi t8, t8, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t8) == 0; // beq t8, r0, L170 + // nop // sll r0, r0, 0 + if (bc) {goto block_59;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(t8, 440, t0); // lw t8, 440(t0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(t8, t8, 1); // daddiu t8, t8, 1 + // nop // sll r0, r0, 0 + c->sw(t8, 440, t0); // sw t8, 440(t0) + //beq r0, r0, L169 // beq r0, r0, L169 + // nop // sll r0, r0, 0 + goto block_57; // branch always + */ + + + // block_59: + // c->sw(a1, 128, a3); // sw a1, 128(a3) + sadr = c->sgpr64(a1); + c->xori(a1, a1, 12288); // xori a1, a1, 12288 + // c->sw(v1, 16, a3); // sw v1, 16(a3) + madr = c->sgpr64(v1); + c->sll(t8, t9, 4); // sll t8, t9, 4 + c->addu(v1, v1, t8); // addu v1, v1, t8 + c->mov64(t8, a1); // or t8, a1, r0 + // c->sw(t9, 32, a3); // sw t9, 32(a3) + qwc = c->sgpr64(t9); + c->addiu(t9, r0, 256); // addiu t9, r0, 256 + // c->sw(t9, 0, a3); // sw t9, 0(a3) + spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + c->addiu(t9, r0, 0); // addiu t9, r0, 0 + + block_60: + // nop // sll r0, r0, 0 + c->lbu(s2, 144, s4); // lbu s2, 144(s4) + c->addu(s1, gp, ra); // addu s1, gp, ra + c->sw(s5, 284, t0); // sw s5, 284(t0) + c->daddiu(t9, t9, 3); // daddiu t9, t9, 3 + c->sw(s1, 292, t0); // sw s1, 292(t0) + c->sll(s1, s2, 4); // sll s1, s2, 4 + c->sh(s2, 288, t0); // sh s2, 288(t0) + c->daddu(gp, gp, s1); // daddu gp, gp, s1 + c->lq(s2, 272, t0); // lq s2, 272(t0) + c->daddiu(s5, s5, 48); // daddiu s5, s5, 48 + c->lq(s1, 288, t0); // lq s1, 288(t0) + c->daddiu(t8, t8, 48); // daddiu t8, t8, 48 + c->lq(s0, 304, t0); // lq s0, 304(t0) + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->sq(s2, -48, t8); // sq s2, -48(t8) + c->daddiu(s3, s3, -1); // daddiu s3, s3, -1 + c->sq(s1, -32, t8); // sq s1, -32(t8) + bc = ((s64)c->sgpr64(s3)) > 0; // bgtz s3, L168 + c->sq(s0, -16, t8); // sq s0, -16(t8) + if (bc) {goto block_56;} // branch non-likely + + + block_61: + c->addiu(a2, a2, -1); // addiu a2, a2, -1 + c->srl(t7, t7, 1); // srl t7, t7, 1 + c->daddiu(t4, t4, 64); // daddiu t4, t4, 64 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t7) != 0; // bne t7, r0, L148 + c->lqc2(vf2, 16, t4); // lqc2 vf2, 16(t4) + if (bc) {goto block_20;} // branch non-likely + + + block_62: + // nop // sll r0, r0, 0 + c->lw(ra, 412, t0); // lw ra, 412(t0) + // nop // sll r0, r0, 0 + c->lw(t7, 416, t0); // lw t7, 416(t0) + bc = c->sgpr64(ra) != c->sgpr64(t7); // bne ra, t7, L146 + // nop // sll r0, r0, 0 + if (bc) {goto block_17;} // branch non-likely + + bc = ((s64)c->sgpr64(a2)) > 0; // bgtz a2, L140 + // nop // sll r0, r0, 0 + if (bc) {goto block_6;} // branch non-likely + + bc = c->sgpr64(t9) == 0; // beq t9, r0, L176 + // nop // sll r0, r0, 0 + if (bc) {goto block_68;} // branch non-likely + + /* + block_65: + c->lw(a0, 0, a3); // lw a0, 0(a3) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(a0, a0, 256); // andi a0, a0, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a0) == 0; // beq a0, r0, L175 + // nop // sll r0, r0, 0 + if (bc) {goto block_67;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(a0, 440, t0); // lw a0, 440(t0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(a0, a0, 1); // daddiu a0, a0, 1 + // nop // sll r0, r0, 0 + c->sw(a0, 440, t0); // sw a0, 440(t0) + //beq r0, r0, L174 // beq r0, r0, L174 + // nop // sll r0, r0, 0 + goto block_65; // branch always + */ + + + // block_67: + // c->sw(a1, 128, a3); // sw a1, 128(a3) + sadr = c->sgpr64(a1); + c->xori(a0, a1, 12288); // xori a0, a1, 12288 + // c->sw(v1, 16, a3); // sw v1, 16(a3) + madr = c->sgpr64(v1); + c->sll(a1, t9, 4); // sll a1, t9, 4 + c->addu(v1, v1, a1); // addu v1, v1, a1 + c->mov64(a0, a0); // or a0, a0, r0 + // c->sw(t9, 32, a3); // sw t9, 32(a3) + qwc = c->sgpr64(t9); + c->addiu(a0, r0, 256); // addiu a0, r0, 256 + // c->sw(a0, 0, a3); // sw a0, 0(a3) + spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + + block_68: + /* + c->lw(a0, 0, a3); // lw a0, 0(a3) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(a0, a0, 256); // andi a0, a0, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a0) == 0; // beq a0, r0, L177 + // nop // sll r0, r0, 0 + if (bc) {goto block_70;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(a0, 440, t0); // lw a0, 440(t0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(a0, a0, 1); // daddiu a0, a0, 1 + // nop // sll r0, r0, 0 + c->sw(a0, 440, t0); // sw a0, 440(t0) + //beq r0, r0, L176 // beq r0, r0, L176 + // nop // sll r0, r0, 0 + goto block_68; // branch always + */ + + + block_70: + c->lw(a0, 396, t0); // lw a0, 396(t0) + // nop // sll r0, r0, 0 + c->sw(v1, 4, a0); // sw v1, 4(a0) + // nop // sll r0, r0, 0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 112, sp); // lq gp, 112(sp) + c->lq(s5, 96, sp); // lq s5, 96(sp) + c->lq(s4, 80, sp); // lq s4, 80(sp) + c->lq(s3, 64, sp); // lq s3, 64(sp) + c->lq(s2, 48, sp); // lq s2, 48(sp) + c->lq(s1, 32, sp); // lq s1, 32(sp) + c->lq(s0, 16, sp); // lq s0, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 128); // daddiu sp, sp, 128 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c(); + cache.instance_tie_work_copy = intern_from_c("*instance-tie-work-copy*").c(); + cache.wind_work = intern_from_c("*wind-work*").c(); + cache.math_camera = intern_from_c("*math-camera*").c(); + gLinkedFunctionTable.reg("draw-inline-array-instance-tie", execute, 512); +} + +} // namespace draw_inline_array_instance_tie +} // namespace Mips2C + + +//--------------------------MIPS2C--------------------- +#include "game/mips2c/mips2c_private.h" + +namespace Mips2C { +namespace draw_inline_array_prototype_tie_generic_asm { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* prototype_tie_work; // *prototype-tie-work* +} cache; + +void block29_call(ExecutionContext* c) { + bool bc; + u32 sadr, madr, qwc; + // block_29: + c->addiu(t6, t6, 32); // addiu t6, t6, 32 + c->sw(t5, 232, t0); // sw t5, 232(t0) + + block_30: + c->addiu(t7, a0, 4); // addiu t7, a0, 4 + c->addiu(t8, r0, 255); // addiu t8, r0, 255 + c->dsubu(t8, t8, t7); // dsubu t8, t8, t7 + c->lw(t7, 0, t6); // lw t7, 0(t6) + bc = ((s64)c->sgpr64(t8)) >= 0; // bgez t8, L131 + c->lhu(t8, 30, t6); // lhu t8, 30(t6) + if (bc) {goto block_34;} // branch non-likely + + /* + block_31: + c->lw(a1, 0, t1); // lw a1, 0(t1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(a1, a1, 256); // andi a1, a1, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a1) == 0; // beq a1, r0, L130 + // nop // sll r0, r0, 0 + if (bc) {goto block_33;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(a1, 284, t0); // lw a1, 284(t0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 + // nop // sll r0, r0, 0 + c->sw(a1, 284, t0); // sw a1, 284(t0) + //beq r0, r0, L129 // beq r0, r0, L129 + // nop // sll r0, r0, 0 + goto block_31; // branch always + */ + + + // block_33: + // c->sw(t2, 128, t1); // sw t2, 128(t1) + sadr = c->sgpr64(t2); + c->xori(t2, t2, 4096); // xori t2, t2, 4096 + // c->sw(v1, 16, t1); // sw v1, 16(t1) + madr = c->sgpr64(v1); + c->sll(a1, a0, 4); // sll a1, a0, 4 + c->addu(v1, v1, a1); // addu v1, v1, a1 + c->mov64(a1, t2); // or a1, t2, r0 + // c->sw(a0, 32, t1); // sw a0, 32(t1) + qwc = c->sgpr64(a0); + c->addiu(a0, r0, 256); // addiu a0, r0, 256 + // c->sw(a0, 0, t1); // sw a0, 0(t1) + spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + + block_34: + // nop // sll r0, r0, 0 + c->lhu(t9, 28, t6); // lhu t9, 28(t6) + c->daddu(t8, t8, t9); // daddu t8, t8, t9 + c->lw(t9, 4, t6); // lw t9, 4(t6) + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + c->lhu(gp, 32, t6); // lhu gp, 32(t6) + c->sll(s5, a0, 4); // sll s5, a0, 4 + c->sw(t7, 212, t0); // sw t7, 212(t0) + c->daddu(t7, s5, v1); // daddu t7, s5, v1 + c->sh(t8, 208, t0); // sh t8, 208(t0) + // nop // sll r0, r0, 0 + c->sw(t7, 220, t0); // sw t7, 220(t0) + // nop // sll r0, r0, 0 + c->sw(a2, 260, t0); // sw a2, 260(t0) + // nop // sll r0, r0, 0 + c->sw(t9, 228, t0); // sw t9, 228(t0) + // nop // sll r0, r0, 0 + c->sh(gp, 224, t0); // sh gp, 224(t0) + // nop // sll r0, r0, 0 + c->lw(t7, 48, t6); // lw t7, 48(t6) + // nop // sll r0, r0, 0 + c->lhu(t8, 52, t6); // lhu t8, 52(t6) + // nop // sll r0, r0, 0 + c->sw(t7, 244, t0); // sw t7, 244(t0) + // nop // sll r0, r0, 0 + c->sh(t8, 240, t0); // sh t8, 240(t0) + // nop // sll r0, r0, 0 + c->lq(t7, 208, t0); // lq t7, 208(t0) + // nop // sll r0, r0, 0 + c->lq(t8, 224, t0); // lq t8, 224(t0) + // nop // sll r0, r0, 0 + c->lq(t9, 240, t0); // lq t9, 240(t0) + // nop // sll r0, r0, 0 + c->lq(gp, 256, t0); // lq gp, 256(t0) + // nop // sll r0, r0, 0 + c->sq(t7, 0, a1); // sq t7, 0(a1) + c->daddiu(t5, t5, -1); // daddiu t5, t5, -1 + c->sq(t8, 16, a1); // sq t8, 16(a1) + c->daddiu(a2, a2, 48); // daddiu a2, a2, 48 + c->sq(t9, 32, a1); // sq t9, 32(a1) + c->sq(gp, 48, a1); // sq gp, 48(a1) + c->daddiu(a1, a1, 64); // daddiu a1, a1, 64 + bc = ((s64)c->sgpr64(t5)) > 0; // bgtz t5, L128 + c->daddiu(t6, t6, 64); // daddiu t6, t6, 64 + if (bc) {goto block_30;} // branch non-likely + + //jr ra // jr ra + // nop // sll r0, r0, 0 +} + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 madr, sadr, qwc; + c->daddiu(sp, sp, -112); // daddiu sp, sp, -112 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s1, 16, sp); // sq s1, 16(sp) + c->sq(s2, 32, sp); // sq s2, 32(sp) + c->sq(s3, 48, sp); // sq s3, 48(sp) + c->sq(s4, 64, sp); // sq s4, 64(sp) + c->sq(s5, 80, sp); // sq s5, 80(sp) + c->sq(gp, 96, sp); // sq gp, 96(sp) + // nop // sll r0, r0, 0 + get_fake_spad_addr(a3, cache.fake_scratchpad_data, 0, c);// lui a3, 28672 + c->lw(v1, 4, a0); // lw v1, 4(a0) + c->lui(t1, 4096); // lui t1, 4096 + c->lui(t2, 4096); // lui t2, 4096 + // sync.l + // cache dxwbin v1, 0 + // sync.l + // cache dxwbin v1, 1 + // sync.l + c->load_symbol(t0, cache.prototype_tie_work); // lw t0, *prototype-tie-work*(s7) + c->ori(t1, t1, 53248); // ori t1, t1, 53248 + c->ori(t4, t2, 54272); // ori t4, t2, 54272 SPR TO + c->ori(t3, a3, 16); // ori t3, a3, 16 + c->ori(t2, a3, 2064); // ori t2, a3, 2064 + c->sw(a0, 10260, a3); // sw a0, 10260(a3) + c->daddiu(t7, a1, -1); // daddiu t7, a1, -1 + // nop // sll r0, r0, 0 + c->lw(t6, 12, a2); // lw t6, 12(a2) + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + c->mov64(a1, t2); // or a1, t2, r0 + + block_1: + // nop // sll r0, r0, 0 + c->lq(t5, 92, t6); // lq t5, 92(t6) + c->daddiu(t8, a2, 4); // daddiu t8, a2, 4 + c->sw(t7, 10256, a3); // sw t7, 10256(a3) + c->dsrl32(a2, t5, 0); // dsrl32 a2, t5, 0 + c->sw(t8, 280, t0); // sw t8, 280(t0) + c->pcpyud(t7, t5, t5); // pcpyud t7, t5, t5 + c->lw(t9, 140, t6); // lw t9, 140(t6) + c->or_(t7, a2, t7); // or t7, a2, t7 + c->lw(a2, 108, t6); // lw a2, 108(t6) + bc = c->sgpr64(t7) == 0; // beq t7, r0, L126 + c->lw(t8, 4, a3); // lw t8, 4(a3) + if (bc) {goto block_27;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lq(t7, 12, t6); // lq t7, 12(t6) + // nop // sll r0, r0, 0 + c->sq(t5, 10272, a3); // sq t5, 10272(a3) + // nop // sll r0, r0, 0 + c->sw(a2, 10304, a3); // sw a2, 10304(a3) + // nop // sll r0, r0, 0 + c->sq(t7, 10288, a3); // sq t7, 10288(a3) + // nop // sll r0, r0, 0 + c->ld(a2, 272, t0); // ld a2, 272(t0) + // nop // sll r0, r0, 0 + c->lw(t7, 4, t9); // lw t7, 4(t9) + c->daddiu(ra, t9, 12); // daddiu ra, t9, 12 + c->lq(t5, 1852, t8); // lq t5, 1852(t8) + c->sra(t9, t7, 2); // sra t9, t7, 2 + // nop // sll r0, r0, 0 + c->addu(t9, t9, a0); // addu t9, t9, a0 + c->addiu(gp, r0, 221); // addiu gp, r0, 221 + c->dsubu(t9, gp, t9); // dsubu t9, gp, t9 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(t9)) >= 0; // bgez t9, L114 + // nop // sll r0, r0, 0 + if (bc) {goto block_6;} // branch non-likely + + /* + block_3: + c->lw(a1, 0, t1); // lw a1, 0(t1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(a1, a1, 256); // andi a1, a1, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a1) == 0; // beq a1, r0, L113 + // nop // sll r0, r0, 0 + if (bc) {goto block_5;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(a1, 284, t0); // lw a1, 284(t0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 + // nop // sll r0, r0, 0 + c->sw(a1, 284, t0); // sw a1, 284(t0) + //beq r0, r0, L112 // beq r0, r0, L112 + // nop // sll r0, r0, 0 + goto block_3; // branch always + */ + + + // block_5: + // c->sw(t2, 128, t1); // sw t2, 128(t1) + sadr = c->sgpr64(t2); + c->xori(t2, t2, 4096); // xori t2, t2, 4096 + // c->sw(v1, 16, t1); // sw v1, 16(t1) + madr = c->sgpr64(v1); + c->sll(a1, a0, 4); // sll a1, a0, 4 + c->addu(v1, v1, a1); // addu v1, v1, a1 + c->mov64(a1, t2); // or a1, t2, r0 + // c->sw(a0, 32, t1); // sw a0, 32(t1) + qwc = c->sgpr64(a0); + c->addiu(a0, r0, 256); // addiu a0, r0, 256 + // c->sw(a0, 0, t1); // sw a0, 0(t1) + spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + + block_6: + c->addiu(t7, t7, 31); // addiu t7, t7, 31 + c->lw(t6, 132, t6); // lw t6, 132(t6) + c->sra(t7, t7, 5); // sra t7, t7, 5 + c->addiu(a0, a0, 1); // addiu a0, a0, 1 + c->sll(t7, t7, 3); // sll t7, t7, 3 + c->sw(t6, 200, t0); // sw t6, 200(t0) + c->addu(a0, a0, t7); // addu a0, a0, t7 + c->sh(t7, 192, t0); // sh t7, 192(t0) + c->sll(t9, t7, 2); // sll t9, t7, 2 + c->lq(t6, 1868, t8); // lq t6, 1868(t8) + // nop // sll r0, r0, 0 + c->lq(gp, 192, t0); // lq gp, 192(t0) + // nop // sll r0, r0, 0 + c->lq(t7, 1884, t8); // lq t7, 1884(t8) + // nop // sll r0, r0, 0 + c->sq(gp, 0, a1); // sq gp, 0(a1) + c->addiu(a1, a1, 16); // addiu a1, a1, 16 + c->lq(t8, 1900, t8); // lq t8, 1900(t8) + + /* + block_7: + c->lw(gp, 0, t4); // lw gp, 0(t4) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(gp, gp, 256); // andi gp, gp, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(gp) == 0; // beq gp, r0, L116 + // nop // sll r0, r0, 0 + if (bc) {goto block_9;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(gp, 288, t0); // lw gp, 288(t0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(gp, gp, 1); // daddiu gp, gp, 1 + // nop // sll r0, r0, 0 + c->sw(gp, 288, t0); // sw gp, 288(t0) + //beq r0, r0, L115 // beq r0, r0, L115 + // nop // sll r0, r0, 0 + goto block_7; // branch always + */ + + + // block_9: + // c->sw(ra, 16, t4); // sw ra, 16(t4) + madr = c->sgpr64(ra); + c->daddiu(t9, t9, -32); // daddiu t9, t9, -32 + // c->sw(t3, 128, t4); // sw t3, 128(t4) + sadr = c->sgpr64(t3); + c->addiu(gp, r0, 64); // addiu gp, r0, 64 + // c->sw(gp, 32, t4); // sw gp, 32(t4) + qwc = c->sgpr64(gp); + c->addiu(gp, r0, 256); // addiu gp, r0, 256 + // c->sw(gp, 0, t4); // sw gp, 0(t4) + spad_to_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + c->daddiu(ra, ra, 1024); // daddiu ra, ra, 1024 + + block_10: + c->mov64(s5, t3); // or s5, t3, r0 + c->xori(t3, t3, 1024); // xori t3, t3, 1024 + bc = ((s64)c->sgpr64(t9)) <= 0; // blez t9, L120 + c->daddiu(t9, t9, -32); // daddiu t9, t9, -32 + if (bc) {goto block_14;} // branch non-likely + + /* + block_11: + c->lw(gp, 0, t4); // lw gp, 0(t4) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(gp, gp, 256); // andi gp, gp, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(gp) == 0; // beq gp, r0, L119 + // nop // sll r0, r0, 0 + if (bc) {goto block_13;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(gp, 288, t0); // lw gp, 288(t0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(gp, gp, 1); // daddiu gp, gp, 1 + // nop // sll r0, r0, 0 + c->sw(gp, 288, t0); // sw gp, 288(t0) + //beq r0, r0, L118 // beq r0, r0, L118 + // nop // sll r0, r0, 0 + goto block_11; // branch always + */ + + + // block_13: + // c->sw(ra, 16, t4); // sw ra, 16(t4) + madr = c->sgpr64(ra); + // nop // sll r0, r0, 0 + // c->sw(t3, 128, t4); // sw t3, 128(t4) + sadr = c->sgpr64(t3); + c->addiu(gp, r0, 64); // addiu gp, r0, 64 + // c->sw(gp, 32, t4); // sw gp, 32(t4) + qwc = c->sgpr64(gp); + c->addiu(gp, r0, 256); // addiu gp, r0, 256 + // c->sw(gp, 0, t4); // sw gp, 0(t4) + spad_to_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + c->daddiu(ra, ra, 1024); // daddiu ra, ra, 1024 + //beq r0, r0, L121 // beq r0, r0, L121 + // nop // sll r0, r0, 0 + goto block_16; // branch always + + + block_14: + /* + c->lw(gp, 0, t4); // lw gp, 0(t4) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(gp, gp, 256); // andi gp, gp, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(gp) == 0; // beq gp, r0, L121 + // nop // sll r0, r0, 0 + if (bc) {goto block_16;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(gp, 288, t0); // lw gp, 288(t0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(gp, gp, 1); // daddiu gp, gp, 1 + // nop // sll r0, r0, 0 + c->sw(gp, 288, t0); // sw gp, 288(t0) + //beq r0, r0, L120 // beq r0, r0, L120 + // nop // sll r0, r0, 0 + goto block_14; // branch always + */ + + + block_16: + c->addiu(gp, a1, 128); // addiu gp, a1, 128 + c->lq(s2, 12, s5); // lq s2, 12(s5) + // nop // sll r0, r0, 0 + c->lq(s4, 28, s5); // lq s4, 28(s5) + c->pextlb(s3, r0, s2); // pextlb s3, r0, s2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextub(s2, r0, s2); // pextub s2, r0, s2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmulth(r0, s3, t5); // pmulth r0, s3, t5 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlb(s3, r0, s4); // pextlb s3, r0, s4 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmaddh(r0, s2, t6); // pmaddh r0, s2, t6 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextub(s4, r0, s4); // pextub s4, r0, s4 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmaddh(r0, s3, t7); // pmaddh r0, s3, t7 + c->lq(s3, 44, s5); // lq s3, 44(s5) + c->addiu(s5, s5, 32); // addiu s5, s5, 32 + // nop // sll r0, r0, 0 + c->pmaddh(r0, s4, t8); // pmaddh r0, s4, t8 + c->lq(s4, 28, s5); // lq s4, 28(s5) + c->pextlb(s2, r0, s3); // pextlb s2, r0, s3 + c->mfc1(r0, f31); // mfc1 r0, f31 + + block_17: + c->pextub(s3, r0, s3); // pextub s3, r0, s3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmfhl_lh(s1); // pmfhl.lh s1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmulth(r0, s2, t5); // pmulth r0, s2, t5 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psrlh(s2, s1, 6); // psrlh s2, s1, 6 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyud(s1, s2, s2); // pcpyud s1, s2, s2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->paddh(s2, s1, s2); // paddh s2, s1, s2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pminh(s2, s2, a2); // pminh s2, s2, a2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->ppacb(s1, r0, s2); // ppacb s1, r0, s2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlb(s2, r0, s4); // pextlb s2, r0, s4 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmaddh(r0, s3, t6); // pmaddh r0, s3, t6 + c->sw(s1, 0, a1); // sw s1, 0(a1) + c->pextub(s4, r0, s4); // pextub s4, r0, s4 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmaddh(r0, s2, t7); // pmaddh r0, s2, t7 + c->lq(s3, 44, s5); // lq s3, 44(s5) + c->addiu(s5, s5, 32); // addiu s5, s5, 32 + c->addiu(a1, a1, 4); // addiu a1, a1, 4 + c->pmaddh(r0, s4, t8); // pmaddh r0, s4, t8 + c->lq(s4, 28, s5); // lq s4, 28(s5) + bc = c->sgpr64(a1) != c->sgpr64(gp); // bne a1, gp, L122 + c->pextlb(s2, r0, s3); // pextlb s2, r0, s3 + if (bc) {goto block_17;} // branch non-likely + + bc = ((s64)c->sgpr64(t9)) >= 0; // bgez t9, L117 + // nop // sll r0, r0, 0 + if (bc) {goto block_10;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(a2, 10272, a3); // lw a2, 10272(a3) + // nop // sll r0, r0, 0 + c->lw(t6, 10292, a3); // lw t6, 10292(a3) + bc = c->sgpr64(a2) == 0; // beq a2, r0, L123 + c->lbu(t5, 10305, a3); // lbu t5, 10305(a3) + if (bc) {goto block_21;} // branch non-likely + + // Unknown instr: bgezal r0, L127 + block29_call(c); + // nop // sll r0, r0, 0 + + + + block_21: + // nop // sll r0, r0, 0 + c->lw(a2, 10276, a3); // lw a2, 10276(a3) + // nop // sll r0, r0, 0 + c->lw(t6, 10292, a3); // lw t6, 10292(a3) + bc = c->sgpr64(a2) == 0; // beq a2, r0, L124 + c->lbu(t5, 10305, a3); // lbu t5, 10305(a3) + if (bc) {goto block_23;} // branch non-likely + + // Unknown instr: bgezal r0, L127 + // nop // sll r0, r0, 0 + block29_call(c); + + + block_23: + // nop // sll r0, r0, 0 + c->lw(a2, 10280, a3); // lw a2, 10280(a3) + // nop // sll r0, r0, 0 + c->lw(t6, 10296, a3); // lw t6, 10296(a3) + bc = c->sgpr64(a2) == 0; // beq a2, r0, L125 + c->lbu(t5, 10306, a3); // lbu t5, 10306(a3) + if (bc) {goto block_25;} // branch non-likely + + // Unknown instr: bgezal r0, L127 + // nop // sll r0, r0, 0 + block29_call(c); + + + block_25: + // nop // sll r0, r0, 0 + c->lw(a2, 10284, a3); // lw a2, 10284(a3) + // nop // sll r0, r0, 0 + c->lw(t6, 10300, a3); // lw t6, 10300(a3) + bc = c->sgpr64(a2) == 0; // beq a2, r0, L126 + c->lbu(t5, 10307, a3); // lbu t5, 10307(a3) + if (bc) {goto block_27;} // branch non-likely + + // Unknown instr: bgezal r0, L127 + // nop // sll r0, r0, 0 + block29_call(c); + + + block_27: + // nop // sll r0, r0, 0 + c->lw(a2, 280, t0); // lw a2, 280(t0) + // nop // sll r0, r0, 0 + c->lw(t5, 10256, a3); // lw t5, 10256(a3) + // nop // sll r0, r0, 0 + c->lw(t6, 12, a2); // lw t6, 12(a2) + // nop // sll r0, r0, 0 + c->sw(r0, -56, a1); // sw r0, -56(a1) + bc = c->sgpr64(t5) != 0; // bne t5, r0, L111 + c->daddiu(t7, t5, -1); // daddiu t7, t5, -1 + if (bc) {goto block_1;} // branch non-likely + + //beq r0, r0, L132 // beq r0, r0, L132 + c->sw(r0, -52, a1); // sw r0, -52(a1) + goto block_36; // branch always + + + ASSERT(false); + + block_36: + bc = c->sgpr64(a0) == 0; // beq a0, r0, L135 + // nop // sll r0, r0, 0 + if (bc) {goto block_40;} // branch non-likely + + /* + block_37: + c->lw(a1, 0, t1); // lw a1, 0(t1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(a1, a1, 256); // andi a1, a1, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a1) == 0; // beq a1, r0, L134 + // nop // sll r0, r0, 0 + if (bc) {goto block_39;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(a1, 284, t0); // lw a1, 284(t0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 + // nop // sll r0, r0, 0 + c->sw(a1, 284, t0); // sw a1, 284(t0) + //beq r0, r0, L133 // beq r0, r0, L133 + // nop // sll r0, r0, 0 + goto block_37; // branch always + */ + + + // block_39: + // c->sw(t2, 128, t1); // sw t2, 128(t1) + sadr = c->sgpr64(t2); + // nop // sll r0, r0, 0 + // c->sw(v1, 16, t1); // sw v1, 16(t1) + madr = c->sgpr64(v1); + c->sll(a1, a0, 4); // sll a1, a0, 4 + c->addu(v1, v1, a1); // addu v1, v1, a1 + // nop // sll r0, r0, 0 + // c->sw(a0, 32, t1); // sw a0, 32(t1) + qwc = c->sgpr64(a0); + c->addiu(a0, r0, 256); // addiu a0, r0, 256 + // c->sw(a0, 0, t1); // sw a0, 0(t1) + spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + // nop // sll r0, r0, 0 + + block_40: + /* + c->lw(a0, 0, t1); // lw a0, 0(t1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->andi(a0, a0, 256); // andi a0, a0, 256 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a0) == 0; // beq a0, r0, L136 + // nop // sll r0, r0, 0 + if (bc) {goto block_42;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(a0, 284, t0); // lw a0, 284(t0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(a0, a0, 1); // daddiu a0, a0, 1 + // nop // sll r0, r0, 0 + c->sw(a0, 284, t0); // sw a0, 284(t0) + //beq r0, r0, L135 // beq r0, r0, L135 + // nop // sll r0, r0, 0 + goto block_40; // branch always + */ + + + // block_42: + c->lw(a0, 10260, a3); // lw a0, 10260(a3) + // nop // sll r0, r0, 0 + c->sw(v1, 4, a0); // sw v1, 4(a0) + // nop // sll r0, r0, 0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 96, sp); // lq gp, 96(sp) + c->lq(s5, 80, sp); // lq s5, 80(sp) + c->lq(s4, 64, sp); // lq s4, 64(sp) + c->lq(s3, 48, sp); // lq s3, 48(sp) + c->lq(s2, 32, sp); // lq s2, 32(sp) + c->lq(s1, 16, sp); // lq s1, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 112); // daddiu sp, sp, 112 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c(); + cache.prototype_tie_work = intern_from_c("*prototype-tie-work*").c(); + gLinkedFunctionTable.reg("draw-inline-array-prototype-tie-generic-asm", execute, 256); +} + +} // namespace draw_inline_array_prototype_tie_generic_asm +} // namespace Mips2C diff --git a/game/mips2c/functions/time_of_day.cpp b/game/mips2c/functions/time_of_day.cpp index 8226ee422d..7ab849afd6 100644 --- a/game/mips2c/functions/time_of_day.cpp +++ b/game/mips2c/functions/time_of_day.cpp @@ -1,7 +1,9 @@ //--------------------------MIPS2C--------------------- + +#include "game/kernel/jak1/kscheme.h" #include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" +using namespace jak1; // clang-format off namespace Mips2C { diff --git a/game/mips2c/mips2c_private.h b/game/mips2c/mips2c_private.h index d0a678146a..a04619534f 100644 --- a/game/mips2c/mips2c_private.h +++ b/game/mips2c/mips2c_private.h @@ -1,16 +1,18 @@ #pragma once -#include -#include #include +#include +#include #include "common/common_types.h" -#include "game/mips2c/mips2c_table.h" -#include "common/util/BitUtils.h" -#include "third-party/fmt/core.h" -#include "common/util/Assert.h" #include "common/dma/dma.h" +#include "common/util/Assert.h" +#include "common/util/BitUtils.h" + #include "game/common/vu.h" +#include "game/mips2c/mips2c_table.h" + +#include "third-party/fmt/core.h" // This file contains utility functions for code generated by the mips2c pass. // This is only useful for @@ -475,6 +477,15 @@ struct ExecutionContext { } } + void ppacw(int rd, int rs, int rt) { + auto s = gpr_src(rs); + auto t = gpr_src(rt); + gprs[rd].du32[0] = t.du32[0]; + gprs[rd].du32[1] = t.du32[2]; + gprs[rd].du32[2] = s.du32[0]; + gprs[rd].du32[3] = s.du32[2]; + } + void ppach(int rd, int rs, int rt) { auto s = gpr_src(rs); auto t = gpr_src(rt); @@ -713,6 +724,20 @@ struct ExecutionContext { gprs[dest].du16[7] = hi.du16[6]; } + void pmfhl_uw(int dest) { + gprs[dest].du32[0] = lo.du32[1]; + gprs[dest].du32[1] = hi.du32[1]; + gprs[dest].du32[2] = lo.du32[3]; + gprs[dest].du32[3] = hi.du32[3]; + } + + void pmfhl_lw(int dest) { + gprs[dest].du32[0] = lo.du32[0]; + gprs[dest].du32[1] = hi.du32[0]; + gprs[dest].du32[2] = lo.du32[2]; + gprs[dest].du32[3] = hi.du32[2]; + } + void vsub_bc(DEST mask, BC bc, int dest, int src0, int src1) { auto s0 = vf_src(src0); auto s1 = vf_src(src1); @@ -801,6 +826,17 @@ struct ExecutionContext { } } + void vmula(DEST mask, int src0, int src1) { + auto s0 = vf_src(src0); + auto s1 = vf_src(src1); + + for (int i = 0; i < 4; i++) { + if ((u64)mask & (1 << i)) { + acc.f[i] = s0.f[i] * s1.f[i]; + } + } + } + void vadda_bc(DEST mask, BC bc, int src0, int src1) { auto s0 = vf_src(src0); auto s1 = vf_src(src1); @@ -878,6 +914,27 @@ struct ExecutionContext { } } + void vmsub(DEST mask, int dst, int src0, int src1) { + auto s0 = vf_src(src0); + auto s1 = vf_src(src1); + + for (int i = 0; i < 4; i++) { + if ((u64)mask & (1 << i)) { + vfs[dst].f[i] = acc.f[i] - s0.f[i] * s1.f[i]; + } + } + } + + void vmsubq(DEST mask, int dst, int src0) { + auto s0 = vf_src(src0); + + for (int i = 0; i < 4; i++) { + if ((u64)mask & (1 << i)) { + vfs[dst].f[i] = acc.f[i] - s0.f[i] * Q; + } + } + } + void vdiv(int src0, BC bc0, int src1, BC bc1) { Q = vf_src(src0).f[(int)bc0] / vf_src(src1).f[(int)bc1]; } diff --git a/game/mips2c/mips2c_table.cpp b/game/mips2c/mips2c_table.cpp index 9bacb966d6..4133c91e61 100644 --- a/game/mips2c/mips2c_table.cpp +++ b/game/mips2c/mips2c_table.cpp @@ -1,10 +1,14 @@ #include "mips2c_table.h" -#include "common/log/log.h" -#include "game/kernel/kmalloc.h" -#include "game/kernel/kscheme.h" +#include "common/log/log.h" #include "common/symbols.h" +#include "game/kernel/common/kmalloc.h" +#include "game/kernel/common/kscheme.h" +#include "game/kernel/jak1/kscheme.h" + +using namespace jak1_symbols; + extern "C" { void _mips2c_call_linux(); void _mips2c_call_windows(); @@ -320,6 +324,29 @@ extern void link(); namespace shadow_xform_verts { extern void link(); } +namespace draw_inline_array_instance_tie { +extern void link(); +} +namespace draw_inline_array_prototype_tie_generic_asm { +extern void link(); +} + +namespace generic_tie_dma_to_spad_sync { +extern void link(); +} +namespace generic_envmap_dproc { +extern void link(); +} +namespace generic_interp_dproc { +extern void link(); +} +namespace generic_no_light_dproc { +extern void link(); +} + +namespace generic_tie_convert { +extern void link(); +} LinkedFunctionTable gLinkedFunctionTable; Rng gRng; std::unordered_map> gMips2CLinkCallbacks = { @@ -361,7 +388,8 @@ std::unordered_map> gMips2CLinkCallbacks = high_speed_reject::link}}, {"generic-effect", {generic_prepare_dma_double::link, generic_light_proc::link, generic_envmap_proc::link, - generic_prepare_dma_single::link}}, + generic_prepare_dma_single::link, generic_envmap_dproc::link, generic_interp_dproc::link, + generic_no_light_dproc::link}}, {"ripple", {ripple_execute_init::link, ripple_create_wave_table::link, ripple_apply_wave_table::link, ripple_matrix_scale::link}}, @@ -373,7 +401,10 @@ std::unordered_map> gMips2CLinkCallbacks = shadow_find_double_edges::link, shadow_find_facing_double_tris::link, shadow_find_single_edges::link, shadow_find_facing_single_tris::link, shadow_init_vars::link, shadow_scissor_top::link, shadow_scissor_edges::link, shadow_calc_dual_verts::link, - shadow_xform_verts::link}}}; + shadow_xform_verts::link}}, + {"tie-methods", + {draw_inline_array_instance_tie::link, draw_inline_array_prototype_tie_generic_asm::link}}, + {"generic-tie", {generic_tie_dma_to_spad_sync::link, generic_tie_convert::link}}}; void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) { const auto& it = m_executes.insert({name, {exec, Ptr()}}); @@ -383,8 +414,9 @@ void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 s } // this is short stub that will jump to the appropriate function. - auto jump_to_asm = Ptr(alloc_heap_object(s7.offset + FIX_SYM_GLOBAL_HEAP, - *(s7 + FIX_SYM_FUNCTION_TYPE), 0x40, UNKNOWN_PP)); + // todo jak1 + auto jump_to_asm = Ptr(jak1::alloc_heap_object( + s7.offset + FIX_SYM_GLOBAL_HEAP, *(s7 + FIX_SYM_FUNCTION_TYPE), 0x40, UNKNOWN_PP)); it.first->second.goal_trampoline = jump_to_asm; u8* ptr = jump_to_asm.c(); diff --git a/game/mips2c/mips2c_table.h b/game/mips2c/mips2c_table.h index b2cb64fe82..a95e9fad77 100644 --- a/game/mips2c/mips2c_table.h +++ b/game/mips2c/mips2c_table.h @@ -1,15 +1,16 @@ #pragma once -#include -#include -#include #include #include +#include +#include +#include -#include "game/kernel/Ptr.h" #include "common/common_types.h" #include "common/util/Assert.h" +#include "game/kernel/common/Ptr.h" + namespace Mips2C { class LinkedFunctionTable { diff --git a/game/overlord/dma.cpp b/game/overlord/dma.cpp index 4cbc30f65e..3164927408 100644 --- a/game/overlord/dma.cpp +++ b/game/overlord/dma.cpp @@ -4,11 +4,16 @@ * This code is not great. */ -#include -#include #include "dma.h" + +#include +#include + #include "common/common_types.h" + #include "game/sce/iop.h" +#include "game/sound/sdshim.h" +#include "game/sound/sndshim.h" using namespace iop; @@ -85,9 +90,24 @@ void DMA_SendToEE(void* data, u32 size, void* dest) { * SPU DMA interrupt handler. */ -u32 intr() { +s32 intr(s32 /*channel*/, void* /*userdata*/) { strobe = 1; return 0; } -// TODO DMA_SendToSPUAndSync() \ No newline at end of file +bool DMA_SendToSPUAndSync(void* src_addr, u32 size, u32 dst_addr) { + s32 channel = snd_GetFreeSPUDMA(); + if (channel == -1) + return false; + strobe = 0; + sceSdSetTransIntrHandler(channel, intr, nullptr); + // Skip this, we end up memcpy's from OOB (which trips asan) + // u32 size_aligned = (size + 63) & 0xFFFFFFF0; + u32 size_aligned = size; + u32 transferred = sceSdVoiceTrans(channel, 0, src_addr, dst_addr, size_aligned); + while (!strobe) + ; + sceSdSetTransIntrHandler(channel, nullptr, nullptr); + snd_FreeSPUDMA(channel); + return transferred >= size_aligned; +} diff --git a/game/overlord/dma.h b/game/overlord/dma.h index aca9c0fb21..dd390c17c8 100644 --- a/game/overlord/dma.h +++ b/game/overlord/dma.h @@ -13,6 +13,7 @@ void DMA_Sync(); void DMA_SendToEE(void* data, u32 size, void* dest); +bool DMA_SendToSPUAndSync(void* src_addr, u32 size, u32 dst_addr); void dma_init_globals(); #endif // JAK_V2_DMA_H diff --git a/game/overlord/fake_iso.cpp b/game/overlord/fake_iso.cpp index 9b137001e5..0f1aef2d64 100644 --- a/game/overlord/fake_iso.cpp +++ b/game/overlord/fake_iso.cpp @@ -9,19 +9,23 @@ * should work. */ +#include "fake_iso.h" + #include #include -#include "fake_iso.h" + +#include "isocommon.h" +#include "overlord.h" + +#include "common/log/log.h" +#include "common/util/Assert.h" +#include "common/util/FileUtil.h" + #include "game/overlord/sbank.h" -#include "game/overlord/sndshim.h" #include "game/overlord/soundcommon.h" #include "game/overlord/srpc.h" #include "game/sce/iop.h" -#include "isocommon.h" -#include "overlord.h" -#include "common/util/FileUtil.h" -#include "common/log/log.h" -#include "common/util/Assert.h" +#include "game/sound/sndshim.h" using namespace iop; @@ -39,7 +43,7 @@ static LoadStackEntry sLoadStack[MAX_OPEN_FILES]; //! List of all files that ar FakeIsoEntry fake_iso_entries[MAX_ISO_FILES]; //! List of all known files static FileRecord sFiles[MAX_ISO_FILES]; //! List of "FileRecords" for IsoFs API consumers u32 fake_iso_entry_count; //! Total count of fake iso files -static bool read_in_progress; //! Does the ISO Thread think we're reading? +static LoadStackEntry* sReadInfo; // LoadStackEntry for currently reading file static int FS_Init(u8* buffer); static FileRecord* FS_Find(const char* name); @@ -76,7 +80,7 @@ void fake_iso_init_globals() { fake_iso.load_music = FS_LoadMusic; fake_iso.poll_drive = FS_PollDrive; - read_in_progress = false; + sReadInfo = nullptr; } /*! @@ -147,7 +151,7 @@ FileRecord* FS_FindIN(const char* iso_name) { static const char* get_file_path(FileRecord* fr) { ASSERT(fr->location < fake_iso_entry_count); static char path_buffer[1024]; - strcpy(path_buffer, file_util::get_project_path().c_str()); + strcpy(path_buffer, file_util::get_jak_project_dir().string().c_str()); strcat(path_buffer, "/"); strcat(path_buffer, fake_iso_entries[fr->location].file_path); return path_buffer; @@ -224,7 +228,9 @@ void FS_Close(LoadStackEntry* fd) { // close the FD fd->fr = nullptr; - read_in_progress = false; + if (fd == sReadInfo) { + sReadInfo = nullptr; + } } /*! @@ -276,7 +282,7 @@ uint32_t FS_BeginRead(LoadStackEntry* fd, void* buffer, int32_t len) { } fd->location += (len / SECTOR_SIZE); - read_in_progress = true; + sReadInfo = fd; fclose(fp); @@ -288,8 +294,8 @@ uint32_t FS_BeginRead(LoadStackEntry* fd, void* buffer, int32_t len) { */ uint32_t FS_SyncRead() { // FS_BeginRead is blocking, so this is useless. - if (read_in_progress) { - read_in_progress = false; + if (sReadInfo) { + sReadInfo = nullptr; return CMD_STATUS_IN_PROGRESS; } else { return CMD_STATUS_READ_ERR; diff --git a/game/overlord/iso.cpp b/game/overlord/iso.cpp index 868d018508..48ac46d4c9 100644 --- a/game/overlord/iso.cpp +++ b/game/overlord/iso.cpp @@ -4,34 +4,64 @@ * This is a huge mess */ -#include "common/log/log.h" -#include -#include #include "iso.h" -#include "iso_cd.h" -#include "iso_queue.h" -#include "iso_api.h" -#include "game/sce/iop.h" -#include "stream.h" + +#include +#include + #include "dma.h" #include "fake_iso.h" -#include "game/common/dgo_rpc_types.h" +#include "iso_api.h" +#include "iso_cd.h" +#include "iso_queue.h" +#include "stream.h" + +#include "common/log/log.h" #include "common/util/Assert.h" +#include "game/common/dgo_rpc_types.h" +#include "game/overlord/srpc.h" +#include "game/runtime.h" +#include "game/sce/iop.h" +#include "game/sound/sdshim.h" +#include "game/sound/sndshim.h" + using namespace iop; u32 ISOThread(); u32 DGOThread(); -u32 ProcessVAGData(IsoMessage* _cmd, IsoBufferHeader* buffer_header); u32 RunDGOStateMachine(IsoMessage* _cmd, IsoBufferHeader* buffer_header); u32 CopyDataToEE(IsoMessage* _cmd, IsoBufferHeader* buffer_header); u32 CopyDataToIOP(IsoMessage* _cmd, IsoBufferHeader* buffer_header); u32 NullCallback(IsoMessage* _cmd, IsoBufferHeader* buffer_header); -constexpr int VAGDIR_SIZE = 0x28b4; +static void InitVAGCmd(VagCommand* cmd, u32 x); +static u32 ProcessVAGData(IsoMessage* _cmd, IsoBufferHeader* buffer_header); +static s32 CheckVAGStreamProgress(VagCommand* vag); +static void StopVAG(VagCommand* vag); +static void PauseVAG(VagCommand* vag); +static void UnpauseVAG(VagCommand* vag); +static void SetVAGVol(); +static s32 GetPlayPos(); +static void UpdatePlayPos(); +static void VAG_MarkLoopEnd(void* data, u32 size); + constexpr int LOADING_SCREEN_SIZE = 0x800000; constexpr u32 LOADING_SCREEN_DEST_ADDR = 0x1000000; +static constexpr s32 LOOP_END = 1; +static constexpr s32 LOOP_REPEAT = 2; +static constexpr s32 LOOP_START = 4; + +// Empty ADPCM block with loop flags +// clang-format off +static u8 VAG_SilentLoop[0x60] = { + 0x0, LOOP_START | LOOP_REPEAT, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, LOOP_REPEAT, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, LOOP_END | LOOP_REPEAT, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, +}; +// clang-format on + IsoFs* isofs; u32 iso_init_flag; s32 sync_mbx; @@ -41,10 +71,23 @@ s32 iso_thread; s32 dgo_thread; s32 str_thread; s32 play_thread; -u8 gVagDir[VAGDIR_SIZE]; +VagDir gVagDir; u32 gPlayPos; static RPC_Dgo_Cmd sRPCBuff[1]; // todo move... DgoCommand scmd; +static VagCommand vag_cmd; +VagCommand* gVAGCMD = nullptr; +s32 gDialogVolume = 0; +s32 gFakeVAGClockPaused = 0; +s32 gFakeVAGClockRunning = 0; +s32 gFakeVAGClock = 0; +s32 gRealVAGClockRunning = 0; +s32 gRealVAGClock = 0; +s32 gRealVAGClockS = 0; +s32 gPlaying = 0; +s32 gSampleRate = 0; +bool gLastVagHalf = false; +s32 gVoice; void iso_init_globals() { isofs = nullptr; @@ -56,7 +99,7 @@ void iso_init_globals() { dgo_thread = 0; str_thread = 0; play_thread = 0; - memset(gVagDir, 0, sizeof(gVagDir)); + memset(&gVagDir, 0, sizeof(gVagDir)); gPlayPos = 0; memset(sRPCBuff, 0, sizeof(sRPCBuff)); memset(&scmd, 0, sizeof(DgoCommand)); @@ -119,10 +162,9 @@ u32 InitISOFS(const char* fs_mode, const char* loading_screen) { // mark us as NOT initialized. iso_init_flag = 1; - // TODO ADD - // while(!DMA_SendToSPUAndSync(&VAG_SilentLoop, 0x30, gTrapSRAM)) { - // DelayThread(1000); - // } + while (!DMA_SendToSPUAndSync(&VAG_SilentLoop, 0x30, gTrapSRAM)) { + DelayThread(1000); + } // INITIALIZE MESSAGE BOXES MbxParam mbx_param; @@ -205,7 +247,7 @@ u32 InitISOFS(const char* fs_mode, const char* loading_screen) { // LOAD VAGDIR file FileRecord* vagdir_file = FindISOFile("VAGDIR.AYB"); if (vagdir_file) { - LoadISOFileToIOP(vagdir_file, gVagDir, VAGDIR_SIZE); + LoadISOFileToIOP(vagdir_file, &gVagDir, sizeof(gVagDir)); } FileRecord* loading_screen_file = FindISOFile(loading_screen); if (loading_screen_file) { @@ -230,29 +272,15 @@ u32 GetISOFileLength(FileRecord* f) { return isofs->get_length(f); } -struct VagDirEntry { - union { - char name[8]; - s32 name_as_s32s[2]; - }; - - u32 unknown; -}; -static_assert(sizeof(VagDirEntry) == 12, "bad size of VagDirEntry"); - /*! * Find VAG file by "name", where name is 8 bytes (chars with spaces at the end, treated as two * s32's). Returns pointer to name in the VAGDIR file data. */ -VagDirEntry* FindVAGFile(s32* name) { - // First 4 bytes of VAGDIR file are the number of entries. - // Next is a list of entries. - VagDirEntry* entry = (VagDirEntry*)(gVagDir + 4); - - // loop over entries - for (s32 idx = 0; idx < *(s32*)gVagDir; idx++) { +VagDirEntry* FindVAGFile(const char* name) { + VagDirEntry* entry = gVagDir.vag; + for (u32 idx = 0; idx < gVagDir.count; idx++) { // check if matching name - if (entry->name_as_s32s[0] == name[0] && entry->name_as_s32s[1] == name[1]) { + if (memcmp(entry->name, name, 8) == 0) { return entry; } entry++; @@ -271,6 +299,8 @@ u32 ISOThread() { FreeBuffer(temp_buffer); VagCommand* in_progress_vag_command = nullptr; + s32 vag_paused = 0; + s32 unk = 0; // main CD/DVD read loop for (;;) { @@ -280,23 +310,27 @@ u32 ISOThread() { // receive a message IsoMessage* msg_from_mbx; - IsoCommandLoadSingle* load_single_cmd; s32 mbx_status = PollMbx((MsgPacket**)(&msg_from_mbx), iso_mbx); - load_single_cmd = (IsoCommandLoadSingle*)msg_from_mbx; - if (mbx_status == 0) { + if (mbx_status == KE_OK) { // we got a new message! - // initialize fields of the message msg_from_mbx->callback_buffer = nullptr; msg_from_mbx->ready_for_data = 1; msg_from_mbx->callback_function = NullCallback; msg_from_mbx->fd = nullptr; - if (msg_from_mbx->cmd_id == LOAD_TO_EE_CMD_ID || msg_from_mbx->cmd_id == LOAD_TO_IOP_CMD_ID || - msg_from_mbx->cmd_id == LOAD_TO_EE_OFFSET_CMD_ID) { - // A Simple File Load, add it to the queue - if (QueueMessage(msg_from_mbx, 2, "LoadSingle")) { + switch (msg_from_mbx->cmd_id) { + case LOAD_TO_EE_CMD_ID: + case LOAD_TO_IOP_CMD_ID: + case LOAD_TO_EE_OFFSET_CMD_ID: { + // A Simple File Load, add it to the queue + if (!QueueMessage(msg_from_mbx, 2, "LoadSingle")) { + break; + } + + auto* load_single_cmd = (IsoCommandLoadSingle*)msg_from_mbx; + // if queued successfully, start by opening the file: if (load_single_cmd->cmd_id == LOAD_TO_EE_OFFSET_CMD_ID) { load_single_cmd->fd = @@ -314,39 +348,41 @@ u32 ISOThread() { UnqueueMessage(load_single_cmd); // and wake up whoever requested this. ReturnMessage(load_single_cmd); - } else { - // yep, opened correctly. Set up the pointers/sizes - load_single_cmd->dst_ptr = load_single_cmd->dest_addr; - load_single_cmd->bytes_done = 0; - // by default, copy size is the full file. - load_single_cmd->length_to_copy = isofs->get_length(load_single_cmd->file_record); - - if (load_single_cmd->length_to_copy == 0) { - // if we get zero for some reason, use the commanded length. - ASSERT(false); - load_single_cmd->length_to_copy = load_single_cmd->length; - } else if (load_single_cmd->length < load_single_cmd->length_to_copy) { - // if we ask for less than the full length, use the smaller value. - load_single_cmd->length_to_copy = load_single_cmd->length; - } - - // set status and callback function. - load_single_cmd->status = CMD_STATUS_IN_PROGRESS; - switch (msg_from_mbx->cmd_id) { - case LOAD_TO_EE_CMD_ID: - case LOAD_TO_EE_OFFSET_CMD_ID: - msg_from_mbx->callback_function = CopyDataToEE; - break; - case LOAD_TO_IOP_CMD_ID: - msg_from_mbx->callback_function = CopyDataToIOP; - break; - } + break; } - } - } else if (msg_from_mbx->cmd_id == LOAD_DGO_CMD_ID) { - // Got a DGO command. There is one LoadDGO command for the entire DGO. - if (QueueMessage(msg_from_mbx, 0, "LoadDGO")) { + + // yep, opened correctly. Set up the pointers/sizes + load_single_cmd->dst_ptr = load_single_cmd->dest_addr; + load_single_cmd->bytes_done = 0; + // by default, copy size is the full file. + load_single_cmd->length_to_copy = isofs->get_length(load_single_cmd->file_record); + + if (load_single_cmd->length_to_copy == 0) { + // if we get zero for some reason, use the commanded length. + ASSERT(false); + load_single_cmd->length_to_copy = load_single_cmd->length; + } else if (load_single_cmd->length < load_single_cmd->length_to_copy) { + // if we ask for less than the full length, use the smaller value. + load_single_cmd->length_to_copy = load_single_cmd->length; + } + + // set status and callback function. + load_single_cmd->status = CMD_STATUS_IN_PROGRESS; + u32 cmd_id = msg_from_mbx->cmd_id; + if (cmd_id == LOAD_TO_EE_CMD_ID || cmd_id == LOAD_TO_EE_OFFSET_CMD_ID) { + msg_from_mbx->callback_function = CopyDataToEE; + } else if (cmd_id == LOAD_TO_IOP_CMD_ID) { + msg_from_mbx->callback_function = CopyDataToIOP; + } + + } break; + case LOAD_DGO_CMD_ID: { + if (!QueueMessage(msg_from_mbx, 0, "LoadDGO")) { + break; + } + // Got a DGO command. There is one LoadDGO command for the entire DGO. // queued successfully, open the file. + auto* load_single_cmd = (IsoCommandLoadSingle*)msg_from_mbx; load_single_cmd->fd = isofs->open(load_single_cmd->file_record, -1); if (!load_single_cmd->fd) { // failed to open, return error @@ -359,56 +395,214 @@ u32 ISOThread() { ((DgoCommand*)load_single_cmd)->dgo_state = DgoState::Init; load_single_cmd->callback_function = RunDGOStateMachine; } - } - } else if (msg_from_mbx->cmd_id == LOAD_SOUND_BANK) { - // if there's an in progress vag command, try again. - if (!in_progress_vag_command || !in_progress_vag_command->field_0x3c) { + + } break; + case LOAD_SOUND_BANK: { + // if there's an in progress vag command, try again. + if (in_progress_vag_command && !in_progress_vag_command->paused) { + SendMbx(iso_mbx, msg_from_mbx); + break; + } + auto buff = TryAllocateBuffer(BUFFER_PAGE_SIZE); if (!buff) { // no buffers, try again. SendMbx(iso_mbx, msg_from_mbx); - } else { - auto* cmd = (SoundBankLoadCommand*)msg_from_mbx; - isofs->load_sound_bank(cmd->bank_name, cmd->bank); - FreeBuffer(buff); - ReturnMessage(msg_from_mbx); + break; } - } else { - // just try again... - SendMbx(iso_mbx, msg_from_mbx); - } - } else if (msg_from_mbx->cmd_id == LOAD_MUSIC) { - // if there's an in progress vag command, try again. - if (!in_progress_vag_command || !in_progress_vag_command->field_0x3c) { + + auto* cmd = (SoundBankLoadCommand*)msg_from_mbx; + isofs->load_sound_bank(cmd->bank_name, cmd->bank); + FreeBuffer(buff); + ReturnMessage(msg_from_mbx); + } break; + case LOAD_MUSIC: { + // NOTE: this check has been removed. there doesn't seem to be any issues with this, and + // it fixes some other issues. there doesn't appear to be any extra safety from it either + + // if there's an in progress vag command, try again. + // if (in_progress_vag_command && !in_progress_vag_command->paused) { + // SendMbx(iso_mbx, msg_from_mbx); + // break; + // } + auto buff = TryAllocateBuffer(BUFFER_PAGE_SIZE); if (!buff) { // no buffers, try again. SendMbx(iso_mbx, msg_from_mbx); - } else { - auto* cmd = (MusicLoadCommand*)msg_from_mbx; - isofs->load_music(cmd->music_name, cmd->music_handle); - FreeBuffer(buff); - ReturnMessage(msg_from_mbx); + break; } - } else { - // just try again... - SendMbx(iso_mbx, msg_from_mbx); - } - } - else { - printf("[OVERLORD] Unknown ISOThread message id 0x%x\n", msg_from_mbx->cmd_id); - } + auto* cmd = (MusicLoadCommand*)msg_from_mbx; + isofs->load_music(cmd->music_name, cmd->music_handle); + FreeBuffer(buff); + ReturnMessage(msg_from_mbx); - // TODO magic number - } else if (mbx_status == -0x1a9) { + } break; + case QUEUE_VAG_STREAM: { + auto* cmd = (VagCommand*)msg_from_mbx; + if (cmd->vag && + (!in_progress_vag_command || in_progress_vag_command->vag != cmd->vag || + in_progress_vag_command->file != cmd->file) && + (!in_progress_vag_command || (!vag_paused && in_progress_vag_command->paused))) { + if (in_progress_vag_command) { + gVAGCMD = nullptr; + StopVAG(in_progress_vag_command); + ReleaseMessage(in_progress_vag_command); + } + in_progress_vag_command = &vag_cmd; + memcpy(&vag_cmd, cmd, sizeof(vag_cmd)); + InitVAGCmd(&vag_cmd, 1); + LoadStackEntry* file = nullptr; + if (QueueMessage(&vag_cmd, 3, "QueueVAG")) { + if (vag_cmd.vag) { + file = isofs->open_wad(vag_cmd.file, vag_cmd.vag->offset); + } + vag_cmd.fd = file; + vag_cmd.status = -1; + vag_cmd.callback_function = ProcessVAGData; + gVAGCMD = &vag_cmd; + } else { + in_progress_vag_command = nullptr; + } + } + ReturnMessage(cmd); + } break; + case PLAY_VAG_STREAM: { + auto* cmd = (VagCommand*)msg_from_mbx; + bool thing = true; + if (in_progress_vag_command && in_progress_vag_command->vag == cmd->vag && + in_progress_vag_command->file == cmd->file) { + in_progress_vag_command->volume = cmd->volume; + in_progress_vag_command->sound_id = cmd->sound_id; + if (in_progress_vag_command->paused) { + if (vag_paused) { + unk = 1; + } else { + UnpauseVAG(in_progress_vag_command); + } + } + } else { + if (in_progress_vag_command && !in_progress_vag_command->paused && + cmd->priority < in_progress_vag_command->priority) { + thing = false; + } + if (thing) { + if (in_progress_vag_command) { + gVAGCMD = nullptr; + StopVAG(in_progress_vag_command); + ReleaseMessage(in_progress_vag_command); + } + in_progress_vag_command = &vag_cmd; + memcpy(&vag_cmd, cmd, sizeof(vag_cmd)); + if (vag_paused) { + InitVAGCmd(&vag_cmd, 1); + unk = 1; + } else { + InitVAGCmd(&vag_cmd, 0); + } + vag_cmd.messagebox_to_reply = 0; + vag_cmd.thread_id = 0; + if (QueueMessage(&vag_cmd, 3, "PlayVag")) { + if (vag_cmd.vag) { + vag_cmd.fd = isofs->open_wad(vag_cmd.file, vag_cmd.vag->offset); + } else { + vag_cmd.fd = nullptr; + } + vag_cmd.status = -1; + vag_cmd.callback_function = ProcessVAGData; + gVAGCMD = &vag_cmd; + } else { + in_progress_vag_command = nullptr; + } + } + } + if (thing) { + if (!in_progress_vag_command || in_progress_vag_command->fd) { + gRealVAGClock = 0; + gRealVAGClockS = 0; + gRealVAGClockRunning = true; + } else { + gFakeVAGClock = 0; + gFakeVAGClockRunning = true; + gFakeVAGClockPaused = 0; + } + gVAG_Id = in_progress_vag_command->sound_id; + } + ReturnMessage(cmd); + } break; + case STOP_VAG_STREAM: { + auto* cmd = (VagCommand*)msg_from_mbx; + if (in_progress_vag_command && (!cmd->vag || in_progress_vag_command->vag == cmd->vag) && + (cmd->priority >= in_progress_vag_command->priority)) { + gVAGCMD = nullptr; + StopVAG(in_progress_vag_command); + ReleaseMessage(in_progress_vag_command); + in_progress_vag_command = nullptr; + } + vag_paused = 0; + unk = 0; + ReturnMessage(cmd); + } break; + case PAUSE_VAG_STREAM: { + auto* cmd = (VagCommand*)msg_from_mbx; + gFakeVAGClockPaused = 1; + if (!vag_paused) { + if (!in_progress_vag_command || in_progress_vag_command->paused) { + unk = 0; + } else { + PauseVAG(in_progress_vag_command); + unk = 1; + } + vag_paused = 1; + } + ReturnMessage(cmd); + } break; + case CONTINUE_VAG_STREAM: { + auto* cmd = (VagCommand*)msg_from_mbx; + gFakeVAGClockPaused = 0; + if (vag_paused) { + if (unk) { + UnpauseVAG(in_progress_vag_command); + } + vag_paused = 0; + unk = 0; + } + ReturnMessage(cmd); + } break; + case SET_VAG_VOLUME: { + auto* cmd = (VagCommand*)msg_from_mbx; + if (in_progress_vag_command) { + in_progress_vag_command->volume = cmd->volume; + SetVAGVol(); + } + ReturnMessage(cmd); + } break; + case SET_DIALOG_VOLUME: { + auto* cmd = (VagCommand*)msg_from_mbx; + gDialogVolume = cmd->volume; + if (in_progress_vag_command) + SetVAGVol(); + ReturnMessage(cmd); + } break; + default: + printf("[OVERLORD] Unknown ISOThread message id 0x%x\n", msg_from_mbx->cmd_id); + } + } else if (mbx_status == KE_WAIT_DELETE) { return 0; } //////////////////////////// - // Handle Sound (TODO) + // Handle Sound //////////////////////////// + if (in_progress_vag_command && !CheckVAGStreamProgress(in_progress_vag_command)) { + gVAGCMD = nullptr; + StopVAG(in_progress_vag_command); + ReleaseMessage(in_progress_vag_command); + in_progress_vag_command = nullptr; + } + //////////////////////////// // Begin a read //////////////////////////// @@ -455,6 +649,11 @@ u32 ISOThread() { ProcessMessageData(); if (!read_buffer) { + // HACK!! sometimes when we want to exit, some other threads will wait for stuff to be loaded + // in such cases, we continue running until we're the last thread alive when it's safe to die + if (ThreadWantsExit(GetThreadId()) && OnlyThreadAlive(GetThreadId())) { + return 0; + } // didn't actually start a read, just delay for a bit I guess. DelayThread(100); } else { @@ -770,15 +969,16 @@ u32 NullCallback(IsoMessage* _cmd, IsoBufferHeader* buffer_header) { /*! * Initialize a VagCommand. */ -void InitVAGCmd(VagCommand* cmd, u32 x) { - cmd->field_0x30 = 0; - cmd->field_0x34 = 0; - cmd->field_0x38 = 0; - cmd->field_0x3c = x; - cmd->field_0x40 = 0; - cmd->field_0x44 = 0; - cmd->field_0x48 = 0xffffffff; - gPlayPos = 0x30; +static void InitVAGCmd(VagCommand* cmd, u32 x) { + cmd->buffer_number = 0; + cmd->data_left = 0; + cmd->started = 0; + cmd->paused = x; + cmd->sample_rate = 0; + cmd->stop = 0; + cmd->end_point = -1; + cmd->unk2 = 0; + gPlayPos = 48; cmd->messagebox_to_reply = 0; cmd->thread_id = 0; } @@ -790,24 +990,271 @@ u32 bswap(u32 in) { return ((in >> 0x18) & 0xff) | ((in >> 8) & 0xff00) | ((in & 0xff00) << 8) | (in << 0x18); } -/*! - * TODO - implement. - */ -u32 ProcessVAGData(IsoMessage* _cmd, IsoBufferHeader* buffer_header) { - (void)_cmd; - (void)buffer_header; - ASSERT(false); - return 0; +static u32 ProcessVAGData(IsoMessage* _cmd, IsoBufferHeader* buffer_header) { + auto* vag = (VagCommand*)_cmd; + if (vag->stop) { + buffer_header->data_size = 0; + return CMD_STATUS_IN_PROGRESS; + } + + if (vag->buffer_number == 0) { + // first buffer, set stuff up + u32* data = (u32*)buffer_header->data; + if (data[0] != 0x70474156 /* 'pGAV' */ && data[0] != 0x56414770 /* 'VAGp' */) { + vag->stop = true; + buffer_header->data_size = 0; + return CMD_STATUS_IN_PROGRESS; + } + + vag->sample_rate = data[4]; + vag->data_left = data[3]; + if (data[0] == 0x70474156 /* 'pGAV' */) { + vag->sample_rate = bswap(vag->sample_rate); + vag->data_left = bswap(vag->data_left); + } + + gSampleRate = vag->sample_rate; + gLastVagHalf = false; + vag->data_left += 48; + if (buffer_header->data_size >= vag->data_left) { + vag->end_point = vag->data_left - 16; + } + + if (!DMA_SendToSPUAndSync(buffer_header->data, buffer_header->data_size, gStreamSRAM)) { + return CMD_STATUS_IN_PROGRESS; + } + + sceSdSetParam(gVoice | SD_VP_VOLL, 0); + sceSdSetParam(gVoice | SD_VP_VOLR, 0); + u32 vmix = sceSdGetSwitch((gVoice & 1) | SD_S_VMIXL); + sceSdSetSwitch((gVoice & 1) | SD_S_VMIXL, vmix | (1 << (gVoice >> 1))); + vmix = sceSdGetSwitch((gVoice & 1) | SD_S_VMIXR); + sceSdSetSwitch((gVoice & 1) | SD_S_VMIXR, vmix | (1 << (gVoice >> 1))); + sceSdSetParam(gVoice | SD_VP_PITCH, 0); + sceSdSetAddr(gVoice | SD_VA_SSA, gStreamSRAM + 0x30); + sceSdSetParam(gVoice | SD_VP_ADSR1, 0xf); + sceSdSetParam(gVoice | SD_VP_ADSR2, 0x1fc0); + if (vag->end_point == -1) { + sceSdSetAddr(gVoice | SD_VA_LSAX, gTrapSRAM); + } + snd_keyOnVoiceRaw(gVoice & 1, gVoice >> 1); + vag->started = 1; + vag->data_left -= buffer_header->data_size; + buffer_header->data_size = 0; + } + + if (vag->buffer_number == 1) { + if (buffer_header->data_size < vag->data_left) { + VAG_MarkLoopEnd(buffer_header->data, buffer_header->data_size); + FlushDcache(); + } else { + vag->end_point = vag->data_left + 0x5FF0; + } + + if (!DMA_SendToSPUAndSync(buffer_header->data, buffer_header->data_size, + gStreamSRAM + 0x6000)) { + return CMD_STATUS_IN_PROGRESS; + } + + if (!vag->paused) { + vag->paused = 1; + UnpauseVAG(vag); + } + + vag->ready_for_data = 0; + vag->data_left -= buffer_header->data_size; + buffer_header->data_size = 0; + gPlayPos = 48; + gPlaying = true; + } + + if (vag->buffer_number > 1) { + if ((vag->buffer_number & 1) != 0) { + if (buffer_header->data_size < vag->data_left) { + VAG_MarkLoopEnd(buffer_header->data, buffer_header->data_size); + FlushDcache(); + } else { + vag->end_point = vag->data_left + 0x5FF0; + } + + if (!DMA_SendToSPUAndSync(buffer_header->data, buffer_header->data_size, + gStreamSRAM + 0x6000)) { + return CMD_STATUS_IN_PROGRESS; + } + + sceSdSetAddr(gVoice | SD_VA_LSAX, gStreamSRAM + 0x6000); + } else { + if (buffer_header->data_size < vag->data_left) { + VAG_MarkLoopEnd(buffer_header->data, buffer_header->data_size); + FlushDcache(); + } else { + vag->end_point = vag->data_left - 16; + } + + if (!DMA_SendToSPUAndSync(buffer_header->data, buffer_header->data_size, gStreamSRAM)) { + return CMD_STATUS_IN_PROGRESS; + } + + sceSdSetAddr(gVoice | SD_VA_LSAX, gStreamSRAM); + } + + vag->ready_for_data = 0; + vag->data_left -= buffer_header->data_size; + buffer_header->data_size = 0; + } + + vag->buffer_number++; + return CMD_STATUS_IN_PROGRESS; } -// TODO - StopVAG -// TODO - PauseVAG -// TODO - CalculateVAGVolumes -// TODO - UnpauseVAG -// TODO - SetVAGVol -// TODO - GetPlayPos -// TODO - UpdatePlayPos -// TODO - CheckVAGStreamProgress +static s32 CheckVAGStreamProgress(VagCommand* vag) { + if (vag->stop) { + return 0; + } + + if (!vag->started) { + return 1; + } + + if (vag->end_point != -1) { + if ((s32)(gPlayPos & 0xFFFFFFF0) == vag->end_point) { + return 0; + } + + if (((gPlayPos < 0x6000) && (vag->end_point < 0x6000)) || + ((0x5fff < gPlayPos && (0x5fff < vag->end_point)))) { + if ((vag->unk2 == 0) && (gPlayPos < (u32)vag->end_point)) { + sceSdSetAddr(gVoice | SD_VA_LSAX, gStreamSRAM + vag->end_point); + vag->unk2 = 1; + } + + return 1; + } + } + + if (gPlayPos < 0x6000) { + if ((vag->buffer_number & 1) != 0) { + vag->ready_for_data = 1; + sceSdSetAddr(gVoice | SD_VA_LSAX, gTrapSRAM); + } + + } else { + if ((vag->buffer_number & 1) == 0) { + vag->ready_for_data = 1; + sceSdSetAddr(gVoice | SD_VA_LSAX, gTrapSRAM); + } + } + + return 1; +} + +static void StopVAG(VagCommand* vag) { + gPlaying = false; + PauseVAG(vag); + snd_keyOffVoiceRaw(gVoice & 1, gVoice >> 1); + gFakeVAGClockRunning = false; + gRealVAGClockRunning = false; + gVAG_Id = 1; +} + +static void PauseVAG(VagCommand* vag) { + gFakeVAGClockPaused = true; + if (vag->paused) { + return; + } + + vag->paused = true; + if (vag->started) { + sceSdSetParam(gVoice | SD_VP_VOLL, 0); + sceSdSetParam(gVoice | SD_VP_VOLR, 0); + sceSdSetParam(gVoice | SD_VP_PITCH, 0); + } +} + +static void CalculateVAGVolumes(s32 volume, s32 positioned, Vec3w* trans, s32* left, s32* right) { + if (positioned) { + volume = CalculateFallofVolume(trans, (volume * gDialogVolume) >> 10, 1, 10, 50); + auto* pan = &gPanTable[(630 - CalculateAngle(trans)) % 360]; + *left = (pan->left * volume) >> 10; + *right = (pan->right * volume) >> 10; + if (*left >= 0x4000) { + *left = 0x3FFF; + } + if (*right >= 0x4000) { + *right = 0x3FFF; + } + } else { + volume = (volume * gDialogVolume) >> 6; + if (volume >= 0x4000) { + volume = 0x3FFF; + } + + *left = volume; + *right = volume; + } +} + +static void UnpauseVAG(VagCommand* vag) { + gFakeVAGClockPaused = false; + if (vag->paused) { + if (vag->started) { + s32 left = 0, right = 0; + CalculateVAGVolumes(vag->volume, vag->positioned, &vag->trans, &left, &right); + sceSdSetParam(gVoice | SD_VP_VOLL, left); + sceSdSetParam(gVoice | SD_VP_VOLR, right); + sceSdSetParam(gVoice | SD_VP_PITCH, (vag->sample_rate << 12) / 48000); + } + + vag->paused = false; + } +} + +static void SetVAGVol() { + if (gVAGCMD && gVAGCMD->started && !gVAGCMD->paused) { + s32 left = 0, right = 0; + CalculateVAGVolumes(gVAGCMD->volume, gVAGCMD->positioned, &gVAGCMD->trans, &left, &right); + sceSdSetParam(gVoice | SD_VP_VOLL, left); + sceSdSetParam(gVoice | SD_VP_VOLR, right); + } +} + +static s32 GetPlayPos() { + // This does the safe NAX read by reading NAX in a loop until it returns + // the same value 3 times in a row. We can skip this on pc. + u32 NAX = sceSdGetAddr(gVoice | SD_VA_NAX); + // We can also say our sample buffer always starts at 0 to simplify things. + if (NAX > 0xBFFF) { + return -1; + } else { + return NAX; + } +} + +static void UpdatePlayPos() { + if (!gPlaying) { + return; + } + + u32 pos = GetPlayPos(); + if (pos == 0xffffffff) { + if (gLastVagHalf) { + pos = 0xC000; + } else { + pos = 0x6000; + } + } else { + gLastVagHalf = pos >= 0x6000; + } + + if (pos >= gPlayPos) { + gRealVAGClockS += pos - gPlayPos; + } else { + gRealVAGClockS += pos + 0xC000 - gPlayPos; + } + + gRealVAGClock = 4 * (0x1C00 * (gRealVAGClockS / 16) / gSampleRate); + gPlayPos = pos; +} void* RPC_DGO(unsigned int fno, void* _cmd, int y); void LoadDGO(RPC_Dgo_Cmd* cmd); @@ -825,7 +1272,7 @@ u32 DGOThread() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, DGO_RPC_ID, RPC_DGO, sRPCBuff, nullptr, nullptr, &dq); + sceSifRegisterRpc(&serve, DGO_RPC_ID[g_game_version], RPC_DGO, sRPCBuff, nullptr, nullptr, &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; @@ -969,8 +1416,17 @@ void CancelDGO(RPC_Dgo_Cmd* cmd) { } } -// TODO - GetVAGStreamPos -// TODO - VAG_MarkLoopStart -// TODO - VAG_MarkLoopEnd -// TODO - VAG_MarkNonloopStart -// TODO - VAG_MarkNonloopEnd +s32 GetVAGStreamPos() { + UpdatePlayPos(); + if (gFakeVAGClockRunning) { + return gFakeVAGClock; + } + if (gRealVAGClockRunning) { + return gRealVAGClock; + } + return -1; +} + +static void VAG_MarkLoopEnd(void* data, u32 size) { + ((u8*)data)[size - 15] = 3; +} diff --git a/game/overlord/iso.h b/game/overlord/iso.h index a43bde5f04..7962d342c7 100644 --- a/game/overlord/iso.h +++ b/game/overlord/iso.h @@ -6,10 +6,30 @@ * This is a huge mess */ -#include "common/common_types.h" #include "isocommon.h" +#include "common/common_types.h" + +extern s32 gFakeVAGClockPaused; +extern s32 gFakeVAGClockRunning; +extern s32 gFakeVAGClock; +extern s32 gRealVAGClock; +extern s32 gVoice; + +struct VagDirEntry { + char name[8]; + u32 offset; +}; + +static constexpr int VAG_COUNT = 868; +struct VagDir { + u32 count; + VagDirEntry vag[VAG_COUNT]; +}; + void iso_init_globals(); FileRecord* FindISOFile(const char* name); u32 GetISOFileLength(FileRecord* f); u32 InitISOFS(const char* fs_mode, const char* loading_screen); +VagDirEntry* FindVAGFile(const char* name); +s32 GetVAGStreamPos(); diff --git a/game/overlord/iso_api.cpp b/game/overlord/iso_api.cpp index ac8e918b7a..40b8b70e2d 100644 --- a/game/overlord/iso_api.cpp +++ b/game/overlord/iso_api.cpp @@ -1,9 +1,13 @@ #include "iso_api.h" + +#include "iso_queue.h" +#include "sbank.h" + +#include "common/log/log.h" +#include "common/util/Assert.h" + #include "game/overlord/srpc.h" #include "game/sce/iop.h" -#include "common/log/log.h" -#include "sbank.h" -#include "common/util/Assert.h" using namespace iop; @@ -11,7 +15,7 @@ using namespace iop; * Load a File to IOP memory (blocking) */ s32 LoadISOFileToIOP(FileRecord* file, void* addr, uint32_t length) { - lg::debug("[OVERLORD] LoadISOFileToIOP {}, {}/{} bytes", file->name, length, file->size); + lg::debug("[OVERLORD] LoadISOFileToIOP {}, {}/{} bytes", file->name, length, (s32)file->size); IsoCommandLoadSingle cmd; cmd.cmd_id = LOAD_TO_IOP_CMD_ID; cmd.messagebox_to_reply = 0; @@ -33,7 +37,7 @@ s32 LoadISOFileToIOP(FileRecord* file, void* addr, uint32_t length) { * Load a File to IOP memory (blocking) */ s32 LoadISOFileToEE(FileRecord* file, uint32_t addr, uint32_t length) { - lg::debug("[OVERLORD] LoadISOFileToEE {}, {}/{} bytes", file->name, length, file->size); + lg::debug("[OVERLORD] LoadISOFileToEE {}, {}/{} bytes", file->name, length, (s32)file->size); IsoCommandLoadSingle cmd; cmd.cmd_id = LOAD_TO_EE_CMD_ID; cmd.messagebox_to_reply = 0; @@ -97,7 +101,7 @@ void LoadMusic(const char* music_name, s32* bank) { SendMbx(iso_mbx, &cmd); SleepThread(); - for (int i = 0; i < gMusicTweakInfo.TweakCount; i++) { + for (u32 i = 0; i < gMusicTweakInfo.TweakCount; i++) { if (!strcmp(gMusicTweakInfo.MusicTweak[i].MusicName, music_name)) { gMusicTweak = gMusicTweakInfo.MusicTweak[i].VolumeAdjust; return; @@ -106,3 +110,92 @@ void LoadMusic(const char* music_name, s32* bank) { gMusicTweak = 0x80; } + +void QueueVAGStream(FileRecord* file, VagDirEntry* vag, u32 sound_id, u32 priority) { + if (vag == nullptr) { + return; + } + + auto* cmd = GetVAGCommand(); + cmd->cmd_id = QUEUE_VAG_STREAM; + cmd->messagebox_to_reply = 0; + cmd->thread_id = 0; + cmd->file = file; + cmd->vag = vag; + cmd->sound_id = sound_id; + cmd->priority = priority; + cmd->positioned = 0; + + SendMbx(iso_mbx, cmd); +} + +void PlayVAGStream(FileRecord* file, + VagDirEntry* vag, + u32 sound_id, + s32 volume, + u32 priority, + Vec3w* trans) { + auto cmd = GetVAGCommand(); + cmd->cmd_id = PLAY_VAG_STREAM; + cmd->messagebox_to_reply = 0; + cmd->thread_id = 0; + cmd->file = file; + cmd->vag = vag; + cmd->sound_id = sound_id; + cmd->volume = volume; + cmd->priority = priority; + + if (trans) { + cmd->trans = *trans; + cmd->positioned = 1; + } else { + cmd->positioned = 0; + } + + SendMbx(iso_mbx, cmd); +} + +void SetVAGStreamVolume(s32 volume) { + auto cmd = GetVAGCommand(); + cmd->cmd_id = 1029; + cmd->messagebox_to_reply = 0; + cmd->thread_id = 0; + cmd->volume = volume; + SendMbx(iso_mbx, cmd); +} + +void SetDialogVolume(s32 volume) { + auto cmd = GetVAGCommand(); + cmd->cmd_id = 1030; + cmd->messagebox_to_reply = 0; + cmd->thread_id = 0; + cmd->volume = volume; + SendMbx(iso_mbx, cmd); +} + +void StopVAGStream(VagDirEntry* vag, u32 priority) { + auto cmd = GetVAGCommand(); + cmd->cmd_id = STOP_VAG_STREAM; + cmd->messagebox_to_reply = 0; + cmd->thread_id = 0; + cmd->vag = vag; + cmd->priority = priority; + + SendMbx(iso_mbx, cmd); +} + +void PauseVAGStream() { + auto cmd = GetVAGCommand(); + cmd->cmd_id = 1027; + cmd->messagebox_to_reply = 0; + cmd->thread_id = 0; + SendMbx(iso_mbx, cmd); +} + +void UnpauseVAGStream() { + auto cmd = GetVAGCommand(); + cmd->cmd_id = 1028; + cmd->messagebox_to_reply = 0; + cmd->thread_id = 0; + SendMbx(iso_mbx, cmd); +} diff --git a/game/overlord/iso_api.h b/game/overlord/iso_api.h index fa8e2bb262..94985f35a3 100644 --- a/game/overlord/iso_api.h +++ b/game/overlord/iso_api.h @@ -3,9 +3,23 @@ #include "isocommon.h" struct SoundBank; +struct VagDirEntry; s32 LoadISOFileToIOP(FileRecord* file, void* addr, uint32_t length); s32 LoadISOFileToEE(FileRecord* file, uint32_t ee_addr, uint32_t length); s32 LoadISOFileChunkToEE(FileRecord* file, uint32_t dest_addr, uint32_t length, uint32_t offset); void LoadSoundBank(const char* bank_name, SoundBank* bank); void LoadMusic(const char* music_name, s32* bank); + +void QueueVAGStream(FileRecord* file, VagDirEntry* vag, u32 sound_id, u32 unk); +void PlayVAGStream(FileRecord* file, + VagDirEntry* vag, + u32 sound_id, + s32 volume, + u32 unk, + Vec3w* trans); +void SetVAGStreamVolume(s32 volume); +void SetDialogVolume(s32 volume); +void StopVAGStream(VagDirEntry* vag, u32 unk); +void PauseVAGStream(); +void UnpauseVAGStream(); diff --git a/game/overlord/iso_cd.cpp b/game/overlord/iso_cd.cpp index 491a3083ce..ac3e305054 100644 --- a/game/overlord/iso_cd.cpp +++ b/game/overlord/iso_cd.cpp @@ -3,16 +3,20 @@ * IsoFs API for accessing the CD/DVD drive. */ -#include -#include "game/sce/iop.h" -#include "game/sce/stubs.h" #include "iso_cd.h" + +#include + #include "isocommon.h" #include "overlord.h" #include "soundcommon.h" #include "srpc.h" + #include "common/log/log.h" +#include "game/sce/iop.h" +#include "game/sce/stubs.h" + // iso_cd is an implementation of the IsoFs API for loading files from a CD/DVD with an ISO and/or // DUP filesystem. // The DUP filesystem is a custom Naughty Dog filesystem which attempts to hide @@ -54,7 +58,7 @@ mmode_func cdmmode = nullptr; // function to call to set the expec static sceCdRMode sNominalMode; // drive settings for "nominal" reading static sceCdRMode sStreamMode; // drive settings for "streaming" reading static sceCdRMode* sMode; // pointer to currently selected read mode -LoadStackEntry* sReadInfo; // LoadStackEntry for currently reading file +static LoadStackEntry* sReadInfo; // LoadStackEntry for currently reading file static u8* sSecBuffer[3]; // Buffers for a single sector u32 add_files; // Should we add files we discover to the sFiles list? static FileRecord sFiles[MAX_ISO_FILES]; // Info for all files on the disc diff --git a/game/overlord/iso_cd.h b/game/overlord/iso_cd.h index 922d207ea3..93545cc501 100644 --- a/game/overlord/iso_cd.h +++ b/game/overlord/iso_cd.h @@ -8,9 +8,10 @@ #ifndef JAK_ISO_CD_H #define JAK_ISO_CD_H -#include "common/common_types.h" #include "iso.h" +#include "common/common_types.h" + void iso_cd_init_globals(); extern IsoFs iso_cd_; diff --git a/game/overlord/iso_queue.cpp b/game/overlord/iso_queue.cpp index cb0c68283c..7f10c418c3 100644 --- a/game/overlord/iso_queue.cpp +++ b/game/overlord/iso_queue.cpp @@ -1,11 +1,15 @@ -#include -#include -#include "common/log/log.h" -#include "game/sce/iop.h" #include "iso_queue.h" + +#include +#include + #include "isocommon.h" + +#include "common/log/log.h" #include "common/util/Assert.h" +#include "game/sce/iop.h" + using namespace iop; constexpr int N_BUFFERS = 4; @@ -35,9 +39,6 @@ VagCommand vag_cmds[N_VAG_CMDS]; static s32 sSema; -void ReleaseMessage(IsoMessage* cmd); -void FreeVAGCommand(VagCommand* cmd); - void iso_queue_init_globals() { memset(sBuffer, 0, sizeof(sBuffer)); memset(sStrBuffer, 0, sizeof(sStrBuffer)); @@ -163,7 +164,7 @@ void FreeBuffer(IsoBufferHeader* buffer) { void DisplayQueue() { for (int pri = 0; pri < N_PRIORITIES; pri++) { for (int cmd = 0; cmd < (int)gPriStack[pri].n; cmd++) { - lg::debug(" PRI {} elt {} {}\n", pri, cmd, gPriStack[pri].names[cmd]); + lg::debug(" PRI {} elt {} {}", pri, cmd, gPriStack[pri].names[cmd]); } } } @@ -260,41 +261,30 @@ IsoMessage* GetMessage() { * Execute callbacks and maintain buffers for finished reads in the priority stack */ void ProcessMessageData() { - int32_t pri = N_PRIORITIES - 1; + for (s32 pri = N_PRIORITIES - 1; pri >= 0; pri--) { + for (s32 n = gPriStack[pri].n - 1; n >= 0; n--) { + IsoMessage* cmd = gPriStack[pri].cmds[n]; - for (;;) { - if (pri < 0) - return; - int32_t cmdID = gPriStack[pri].n; - IsoMessage* popped_command; - do { - cmdID--; - if (cmdID < 0) - goto end_cur; - popped_command = gPriStack[pri].cmds[cmdID]; - auto* callback_buffer = popped_command->callback_buffer; - if (popped_command->status == CMD_STATUS_IN_PROGRESS && - callback_buffer) { // if we have a callback buffer (meaning a read finished and let us - // know) - // execute the callback! - uint32_t callback_result = - popped_command->callback_function(popped_command, callback_buffer); - popped_command->status = callback_result; - // printf("ProcessMessage Data set command %p status to %d\n", popped_command, - // popped_command->status); - // if we're done with the buffer, free it and load the next one (if there is one) - if (callback_buffer->data_size == 0) { - popped_command->callback_buffer = (IsoBufferHeader*)callback_buffer->next; - FreeBuffer(callback_buffer); + if (cmd->status == CMD_STATUS_IN_PROGRESS) { + IsoBufferHeader* callback_buffer = cmd->callback_buffer; + + if (callback_buffer != nullptr) { + cmd->status = cmd->callback_function(cmd, callback_buffer); + + if (callback_buffer->data_size == 0) { + cmd->callback_buffer = (IsoBufferHeader*)callback_buffer->next; + FreeBuffer(callback_buffer); + } } } - } while (popped_command->status == CMD_STATUS_IN_PROGRESS); - ReleaseMessage(popped_command); - ReturnMessage(popped_command); - // return message todo this will free vag commands! - pri++; - end_cur: - pri--; + + if (cmd->status != CMD_STATUS_IN_PROGRESS) { + ReleaseMessage(cmd); + ReturnMessage(cmd); + pri++; + break; + } + } } } @@ -342,8 +332,9 @@ VagCommand* GetVAGCommand() { } // wait for VAG semaphore - while (WaitSema(sSema)) { - } + // while (WaitSema(sSema)) { + //} + // try to get something. for (s32 i = 0; i < N_VAG_CMDS; i++) { if (!((vag_cmd_used >> (i & 0x1f)) & 1)) { @@ -353,24 +344,24 @@ VagCommand* GetVAGCommand() { if (vag_cmd_cnt > max_vag_cmd_cnt) { max_vag_cmd_cnt = vag_cmd_cnt; } - SignalSema(sSema); + // SignalSema(sSema); return &vag_cmds[i]; } } - SignalSema(sSema); + // SignalSema(sSema); } } void FreeVAGCommand(VagCommand* cmd) { s32 idx = cmd - vag_cmds; if (idx >= 0 && idx < N_VAG_CMDS && ((vag_cmd_used >> (idx & 0x1f)) & 1)) { - while (WaitSema(sSema)) { - } + // while (WaitSema(sSema)) { + // } vag_cmd_used &= ~(1 << (idx & 0x1f)); vag_cmd_cnt--; - SignalSema(sSema); + // SignalSema(sSema); } else { printf("[OVERLORD] Invalid FreeVAGCommand!\n"); } diff --git a/game/overlord/iso_queue.h b/game/overlord/iso_queue.h index 409f3b729b..91072a95ab 100644 --- a/game/overlord/iso_queue.h +++ b/game/overlord/iso_queue.h @@ -1,8 +1,9 @@ #pragma once -#include "common/common_types.h" #include "isocommon.h" +#include "common/common_types.h" + void iso_queue_init_globals(); void InitBuffers(); IsoBufferHeader* AllocateBuffer(uint32_t size); @@ -13,3 +14,7 @@ IsoMessage* GetMessage(); void ProcessMessageData(); void ReturnMessage(IsoMessage* cmd); IsoBufferHeader* TryAllocateBuffer(uint32_t size); + +VagCommand* GetVAGCommand(); +void FreeVAGCommand(VagCommand* cmd); +void ReleaseMessage(IsoMessage* cmd); diff --git a/game/overlord/isocommon.cpp b/game/overlord/isocommon.cpp index 07399584eb..47614cd6e1 100644 --- a/game/overlord/isocommon.cpp +++ b/game/overlord/isocommon.cpp @@ -3,9 +3,11 @@ * Common ISO utilities. */ -#include "common/common_types.h" -#include #include "isocommon.h" + +#include + +#include "common/common_types.h" #include "common/util/Assert.h" /*! diff --git a/game/overlord/isocommon.h b/game/overlord/isocommon.h index e7c9d9c809..85ffcefdbe 100644 --- a/game/overlord/isocommon.h +++ b/game/overlord/isocommon.h @@ -9,9 +9,12 @@ #define JAK_V2_ISOCOMMON_H #include + #include "common/common_types.h" #include "common/link_types.h" + #include "game/common/overlord_common.h" +#include "game/overlord/ssound.h" constexpr int PRI_STACK_LENGTH = 4; // number of queued commands per priority constexpr int N_PRIORITIES = 4; // number of priorities @@ -32,6 +35,13 @@ constexpr int LOAD_TO_EE_OFFSET_CMD_ID = 0x102; // command to load file to ee w constexpr int LOAD_DGO_CMD_ID = 0x200; // command to load DGO constexpr int LOAD_SOUND_BANK = 0x300; // Command to load a sound bank constexpr int LOAD_MUSIC = 0x380; // Command to load music +constexpr int QUEUE_VAG_STREAM = 0x400; // Command to load a vag stream +constexpr int PLAY_VAG_STREAM = 0x401; // Command to play a vag stream +constexpr int STOP_VAG_STREAM = 0x402; // Command to stop a vag stream +constexpr int PAUSE_VAG_STREAM = 0x403; // Command to pause a vag stream +constexpr int CONTINUE_VAG_STREAM = 0x404; // Command to continue a vag stream +constexpr int SET_VAG_VOLUME = 0x405; // Command to set the volume of vag playback +constexpr int SET_DIALOG_VOLUME = 0x406; // Command to set the volume of vag playback constexpr int MAX_ISO_FILES = 350; // maximum files on FS constexpr int MAX_OPEN_FILES = 16; // maximum number of open files at a time. @@ -104,19 +114,26 @@ struct IsoCommandLoadSingle : public IsoMessage { s32 bytes_done; // 0x40 }; +struct VagDirEntry; /*! * Command to do something. */ struct VagCommand : public IsoMessage { - u32 field_0x30; - u32 field_0x34; - u32 field_0x38; - u32 field_0x3c; - u32 field_0x40; - u32 field_0x44; - u32 field_0x48; - u32 field_0x4c; - // 0x6c max + FileRecord* file; + VagDirEntry* vag; + u32 buffer_number; + u32 data_left; + u32 started; + u32 paused; + u32 sample_rate; + u32 stop; + s32 end_point; + u32 unk2; + s32 volume; + u32 sound_id; + u32 priority; + u32 positioned; + Vec3w trans; }; struct SoundBank; diff --git a/game/overlord/overlord.cpp b/game/overlord/overlord.cpp index ccf069985e..170eb29bc7 100644 --- a/game/overlord/overlord.cpp +++ b/game/overlord/overlord.cpp @@ -1,11 +1,16 @@ -#include #include "overlord.h" -#include "game/sce/iop.h" -#include "ramdisk.h" + +#include + #include "iso.h" -#include "ssound.h" +#include "ramdisk.h" #include "sbank.h" #include "srpc.h" +#include "ssound.h" + +#include "common/util/Assert.h" + +#include "game/sce/iop.h" using namespace iop; @@ -17,9 +22,18 @@ int start_overlord(int argc, const char* const* argv) { sceSifInit(); } + bool disable_sound = false; + for (int i = 1; i < argc; i++) { + if (std::string("-nosound") == argv[i]) { + disable_sound = true; + } + } + sceSifInitRpc(0); InitBanks(); - InitSound_Overlord(); + if (!disable_sound) { + InitSound_Overlord(); + } InitRamdisk(); // RegisterVblankHandler(0, 0x20, VBlank_Handler, nullptr); diff --git a/game/overlord/ramdisk.cpp b/game/overlord/ramdisk.cpp index 2697e3c1b8..3186e2c5b9 100644 --- a/game/overlord/ramdisk.cpp +++ b/game/overlord/ramdisk.cpp @@ -4,16 +4,21 @@ * Also called "Server". */ -#include -#include -#include "common/common_types.h" -#include "game/common/ramdisk_rpc_types.h" #include "ramdisk.h" + +#include +#include + #include "iso.h" #include "iso_api.h" -#include "game/sce/iop.h" + +#include "common/common_types.h" #include "common/util/Assert.h" +#include "game/common/ramdisk_rpc_types.h" +#include "game/runtime.h" +#include "game/sce/iop.h" + // Note - the RAMDISK code supports having multiple files, but it appears only one file can ever be // used at a time. @@ -95,7 +100,8 @@ u32 Thread_Server() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, RAMDISK_RPC_ID, RPC_Ramdisk, gRPCBuf, nullptr, nullptr, &dq); + sceSifRegisterRpc(&serve, RAMDISK_RPC_ID[g_game_version], RPC_Ramdisk, gRPCBuf, nullptr, nullptr, + &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; diff --git a/game/overlord/ramdisk.h b/game/overlord/ramdisk.h index bb64d0a76c..e48c9d508e 100644 --- a/game/overlord/ramdisk.h +++ b/game/overlord/ramdisk.h @@ -11,6 +11,8 @@ #include "common/common_types.h" +extern u32 gMemFreeAtStart; + void ramdisk_init_globals(); void InitRamdisk(); u32 Thread_Server(); diff --git a/game/overlord/sbank.cpp b/game/overlord/sbank.cpp index 5a53aed469..54bbbf0271 100644 --- a/game/overlord/sbank.cpp +++ b/game/overlord/sbank.cpp @@ -1,5 +1,7 @@ -#include #include "sbank.h" + +#include + #include "soundcommon.h" constexpr int N_BANKS = 3; @@ -60,8 +62,8 @@ s32 LookupSoundIndex(const char* name, SoundBank** bank_out) { break; } - for (int i = 0; i < bank->sound_count; i++) { - if (memcmp(bank->name, name, 16) == 0) { + for (int i = 0; i < (int)bank->sound_count; i++) { + if (memcmp(bank->sound[i].name, name, 16) == 0) { *bank_out = bank; return i; } diff --git a/game/overlord/sndshim.cpp b/game/overlord/sndshim.cpp deleted file mode 100644 index 0d2e533a28..0000000000 --- a/game/overlord/sndshim.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "sndshim.h" -#include - -void snd_StartSoundSystem() { - // printf("snd_StartSoundSystem\n"); -} -void snd_StopSoundSystem() { - // printf("snd_StopSoundSystem\n"); -} -void snd_RegisterIOPMemAllocator(AllocFun, FreeFun) { - // printf("snd_RegisterIOPMemAllocator\n"); -} -void snd_LockVoiceAllocator(s32) { - // printf("snd_LockVoiceAllocator\n"); -} -void snd_UnlockVoiceAllocator() { - // printf("snd_UnlockVoiceAllocator\n"); -} -s32 snd_ExternVoiceVoiceAlloc(s32, s32) { - // printf("snd_ExternVoiceVoiceAlloc\n"); - return 0; -} -u32 snd_SRAMMalloc(u32) { - // printf("snd_SRAMMalloc\n"); - return 0; -} -void snd_SetMixerMode(s32, s32) { - // printf("snd_SetMixerMode\n"); -} -void snd_SetGroupVoiceRange(s32, s32, s32) { - // printf("snd_SetGroupVoiceRange\n"); -} -void snd_SetReverbDepth(s32, s32, s32) { - // printf("snd_SetReverbDepth\n"); -} -void snd_SetReverbType(s32, s32) { - // printf("snd_SetReverbType\n"); -} -void snd_SetPanTable(s16*) { - // printf("snd_SetPanTable\n"); -} -void snd_SetPlayBackMode(s32) { - // printf("snd_SetPlayBackMode\n"); -} -s32 snd_SoundIsStillPlaying(s32) { - // printf("snd_SoundIsStillPlaying\n"); - return 0; -} -void snd_StopSound(s32) { - // printf("snd_StopSound\n"); -} -void snd_SetSoundVolPan(s32, s32, s32) { - // printf("snd_SetSoundVolPan\n"); -} -void snd_SetMasterVolume(s32, s32) { - // printf("snd_SetMasterVolume\n"); -} -void snd_UnloadBank(s32) { - // printf("snd_UnloadBank\n"); -} -void snd_ResolveBankXREFS() { - // printf("snd_ResolveBankXREFS\n"); -} -void snd_ContinueAllSoundsInGroup(u8) { - // printf("snd_ContinueAllSoundsInGroup\n"); -} -void snd_PauseAllSoundsInGroup(u8) { - // printf("snd_PauseAllSoundsInGroup\n"); -} - -void snd_SetMIDIRegister(s32, u8, u8) { - // printf("snd_SetMIDIRegister\n"); -} - -s32 snd_PlaySoundVolPanPMPB(s32, s32, s32, s32, s32, s32) { - // printf("snd_PlaySoundVolPanPMPB\n"); - return 0; -} -void snd_SetSoundPitchModifier(s32, s32) { - // printf("snd_SetSoundPitchModifier\n"); -} -void snd_SetSoundPitchBend(s32, s32) { - // printf("snd_SetSoundPitchBend\n"); -} -void snd_PauseSound(s32) { - // printf("snd_PauseSound\n"); -} -void snd_ContinueSound(s32) { - // printf("snd_ContinueSound\n"); -} -void snd_AutoPitch(s32, s32, s32, s32) { - // printf("snd_AutoPitch\n"); -} -void snd_AutoPitchBend(s32, s32, s32, s32) { - // printf("snd_AutoPitchBend\n"); -} - -s32 snd_BankLoadEx(const char*, s32, s32, s32) { - // printf("snd_BankLoadEx\n"); - return 0; -} diff --git a/game/overlord/soundcommon.cpp b/game/overlord/soundcommon.cpp index 868ceb3c9f..14dc234187 100644 --- a/game/overlord/soundcommon.cpp +++ b/game/overlord/soundcommon.cpp @@ -1,5 +1,8 @@ #include "soundcommon.h" + #include +#include + #include "common/util/Assert.h" // TODO strcpy_toupper @@ -14,9 +17,14 @@ void ReadBankSoundInfo(SoundBank* bank, SoundBank* unk, s32 unk2) { } void PrintBankInfo(SoundBank* bank) { + // we dont need this and it spams the console too much + return; + printf("Bank %s\n\n", bank->name); - for (int i = 0; i < bank->sound_count; i++) { - printf("%d : %16s : min %d max %d curve %d\n", i, bank->sound[i].name, + for (u32 i = 0; i < bank->sound_count; i++) { + // Some characters use the full 16 characters (bonelurker-grunt) and dont have a null terminator + std::string name = std::string(bank->sound[i].name, 16); + printf("%d : %16s : min %d max %d curve %d\n", i, name.c_str(), bank->sound[i].fallof_params & 0x3fff, (bank->sound[i].fallof_params >> 14) & 0x3fff, bank->sound[i].fallof_params >> 28); } diff --git a/game/overlord/soundcommon.h b/game/overlord/soundcommon.h index 116d8086d5..ba9ef49490 100644 --- a/game/overlord/soundcommon.h +++ b/game/overlord/soundcommon.h @@ -3,6 +3,7 @@ #ifndef JAK_V2_SOUNDCOMMON_H #define JAK_V2_SOUNDCOMMON_H #include "common/common_types.h" + #include "game/overlord/sbank.h" void PrintBankInfo(SoundBank* buffer); diff --git a/game/overlord/srpc.cpp b/game/overlord/srpc.cpp index 7aa54f2897..375243c288 100644 --- a/game/overlord/srpc.cpp +++ b/game/overlord/srpc.cpp @@ -1,22 +1,32 @@ -#include -#include -#include "game/overlord/sndshim.h" #include "srpc.h" -#include "game/sce/iop.h" + +#include +#include + +#include "iso.h" +#include "iso_api.h" +#include "ramdisk.h" +#include "sbank.h" + +#include "common/util/Assert.h" +#include "common/versions.h" + +#include "game/common/game_common_types.h" #include "game/common/loader_rpc_types.h" #include "game/common/player_rpc_types.h" -#include "game/common/game_common_types.h" -#include "common/versions.h" -#include "sbank.h" -#include "iso_api.h" -#include "common/util/Assert.h" +#include "game/graphics/gfx.h" +#include "game/runtime.h" +#include "game/sce/iop.h" +#include "game/sound/sndshim.h" + +#include "third-party/fmt/core.h" using namespace iop; MusicTweaks gMusicTweakInfo; constexpr int SRPC_MESSAGE_SIZE = 0x50; static uint8_t gLoaderBuf[SRPC_MESSAGE_SIZE]; -static uint8_t gPlayerBuf[SRPC_MESSAGE_SIZE * 127]; +static uint8_t gPlayerBuf[SRPC_MESSAGE_SIZE * 128]; int32_t gSoundEnable = 1; static u32 gInfoEE = 0; // EE address where we should send info on each frame. s16 gFlava; @@ -24,6 +34,12 @@ static s32 gMusic; s32 gMusicTweak = 0x80; s32 gMusicPause = 0; u32 gFreeMem = 0; +u32 gFrameNum = 0; + +// added +u32 gMusicFadeHack = 0; + +static SoundIopInfo info; s32 gVAG_Id = 0; // TODO probably doesn't belong here. @@ -50,7 +66,8 @@ u32 Thread_Player() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, PLAYER_RPC_ID, RPC_Player, gPlayerBuf, nullptr, nullptr, &dq); + sceSifRegisterRpc(&serve, PLAYER_RPC_ID[g_game_version], RPC_Player, gPlayerBuf, nullptr, nullptr, + &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; @@ -66,7 +83,8 @@ u32 Thread_Loader() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, LOADER_RPC_ID, RPC_Loader, gLoaderBuf, nullptr, nullptr, &dq); + sceSifRegisterRpc(&serve, LOADER_RPC_ID[g_game_version], RPC_Loader, gLoaderBuf, nullptr, nullptr, + &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; @@ -103,38 +121,39 @@ void* RPC_Player(unsigned int /*fno*/, void* data, int size) { while (n_messages > 0) { switch (cmd->command) { case SoundCommand::PLAY: { - // spool- soundsn are vag sounds? + if (cmd->play.sound_id == 0) { + break; + } if (!memcmp(cmd->play.name, "spool-", 6)) { - char namebuf[8]; - char langbuf[8]; - auto name = cmd->play.name; + char namebuf[16]; + const char* name = &cmd->play.name[6]; size_t len = strlen(name); if (len < 9) { - memset(namebuf, 32, sizeof(namebuf)); + memset(namebuf, ' ', 8); memcpy(namebuf, name, len); } else { - memcpy(namebuf, name, sizeof(namebuf)); + memcpy(namebuf, name, 8); } + // ASCII toupper for (int i = 0; i < 8; i++) { if (namebuf[i] >= 0x61 && namebuf[i] < 0x7b) { namebuf[i] -= 0x20; } } - // TODO vagfile = FindVAGFile(namebuf); - void* vagfile = nullptr; + auto vagfile = FindVAGFile(namebuf); - memcpy(namebuf, "VAGWAD ", sizeof(namebuf)); - strcpy(langbuf, gLanguage); + memcpy(namebuf, "VAGWAD ", 8); + strcpy(&namebuf[8], gLanguage); FileRecord* rec = isofs->find_in(namebuf); if (vagfile != nullptr) { if (cmd->play.parms.pitch_mod) { // ??? TODO Verify what is being checked here - // PlayVagStream(rec, vagfile, cmd->play.sound_id, cmd->play.parms.volume, 0, - // cmd->play.parms.trans); + PlayVAGStream(rec, vagfile, cmd->play.sound_id, cmd->play.parms.volume, 0, + &cmd->play.parms.trans); } else { - // PlayVagStream(rec, vagfile, cmd->play.sound_id, cmd->play.parms.volume, 0, 0); + PlayVAGStream(rec, vagfile, cmd->play.sound_id, cmd->play.parms.volume, 0, nullptr); } } break; @@ -190,31 +209,31 @@ void* RPC_Player(unsigned int /*fno*/, void* data, int size) { sound->params.pitch_mod, sound->params.bend); sound->sound_handle = handle; if (sound->sound_handle) { - sound->id = index; + sound->id = cmd->play.sound_id; } } break; case SoundCommand::PAUSE_SOUND: { Sound* sound = LookupSound(cmd->sound_id.sound_id); if (sound != nullptr) { snd_PauseSound(sound->sound_handle); - } else if (cmd->sound_id.sound_id == gVAG_Id) { - // TODO PauseVAGStream(); + } else if (cmd->sound_id.sound_id == (u32)gVAG_Id) { + PauseVAGStream(); } } break; case SoundCommand::STOP_SOUND: { Sound* sound = LookupSound(cmd->sound_id.sound_id); if (sound != nullptr) { snd_StopSound(sound->sound_handle); - } else if (cmd->sound_id.sound_id == gVAG_Id) { - // TODO StopVAGStream(); + } else if (cmd->sound_id.sound_id == (u32)gVAG_Id) { + StopVAGStream(nullptr, 0); } } break; case SoundCommand::CONTINUE_SOUND: { Sound* sound = LookupSound(cmd->sound_id.sound_id); if (sound != nullptr) { snd_ContinueSound(sound->sound_handle); - } else if (cmd->sound_id.sound_id == gVAG_Id) { - // TODO UNpauseVAGStream(); + } else if (cmd->sound_id.sound_id == (u32)gVAG_Id) { + UnpauseVAGStream(); } } break; case SoundCommand::SET_PARAM: { @@ -222,7 +241,7 @@ void* RPC_Player(unsigned int /*fno*/, void* data, int size) { u32 mask = cmd->param.parms.mask; if (sound != nullptr) { if (mask & 1) { - if (mask & 0x20) { + if (mask & 0x10) { sound->auto_time = cmd->param.auto_time; sound->new_volume = cmd->param.parms.volume; } else { @@ -239,7 +258,7 @@ void* RPC_Player(unsigned int /*fno*/, void* data, int size) { sound->params.pitch_mod = cmd->param.parms.pitch_mod; if (mask & 0x10) { snd_AutoPitch(sound->sound_handle, sound->params.pitch_mod, cmd->param.auto_time, - cmd->param.auto_time); + cmd->param.auto_from); } else { snd_SetSoundPitchModifier(sound->sound_handle, cmd->param.parms.pitch_mod); } @@ -248,14 +267,14 @@ void* RPC_Player(unsigned int /*fno*/, void* data, int size) { sound->params.bend = cmd->param.parms.bend; if (mask & 0x10) { snd_AutoPitchBend(sound->sound_handle, sound->params.bend, cmd->param.auto_time, - cmd->param.auto_time); + cmd->param.auto_from); } else { snd_SetSoundPitchBend(sound->sound_handle, cmd->param.parms.bend); } } - } else if (cmd->sound_id.sound_id == gVAG_Id) { - // TODO SetVAGStreamVolume(); + } else if (cmd->sound_id.sound_id == (u32)gVAG_Id) { + SetVAGStreamVolume(cmd->param.parms.volume); } } break; case SoundCommand::SET_MASTER_VOLUME: { @@ -265,7 +284,7 @@ void* RPC_Player(unsigned int /*fno*/, void* data, int size) { if (i == 1) { gMusicVol = cmd->master_volume.volume; } else if (i == 2) { - // TODO SetDialogVolume(cmd->master_volume.volume); + SetDialogVolume(cmd->master_volume.volume); } else { snd_SetMasterVolume(i, cmd->master_volume.volume); } @@ -275,7 +294,7 @@ void* RPC_Player(unsigned int /*fno*/, void* data, int size) { case SoundCommand::PAUSE_GROUP: { snd_PauseAllSoundsInGroup(cmd->group.group); if ((cmd->group.group & 4) != 0) { - // TODO PauseVAGStream(0,0); + PauseVAGStream(); } if (cmd->group.group & 2) { gMusicPause = 1; @@ -285,13 +304,13 @@ void* RPC_Player(unsigned int /*fno*/, void* data, int size) { u8 group = cmd->group.group; KillSoundsInGroup(group); if ((group & 4) != 0) { - // TODO StopVAGStream(0,0); + StopVAGStream(nullptr, 0); } } break; case SoundCommand::CONTINUE_GROUP: { snd_ContinueAllSoundsInGroup(cmd->group.group); if (cmd->group.group & 4) { - // UnpauseVAGStream(); + UnpauseVAGStream(); } if (cmd->group.group & 2) { @@ -322,8 +341,7 @@ void* RPC_Player(unsigned int /*fno*/, void* data, int size) { // TODO ShutdownFilingSystem(); } break; default: { - printf("Unhandled RPC Player command %d\n", (int)cmd->command); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Unhandled RPC Player command {}", (int)cmd->command)); } break; } n_messages--; @@ -410,8 +428,7 @@ void* RPC_Loader(unsigned int /*fno*/, void* data, int size) { // SignalSema(gSema); } break; default: - printf("Unhandled RPC Loader command %d\n", (int)cmd->command); - ASSERT(false); + ASSERT_MSG(false, fmt::format("Unhandled RPC Loader command {}", (int)cmd->command)); } n_messages--; cmd++; @@ -420,6 +437,71 @@ void* RPC_Loader(unsigned int /*fno*/, void* data, int size) { return nullptr; } +static s32 dmaid = 0; + s32 VBlank_Handler() { + if (!gSoundEnable) + return 1; + + if (gMusicFadeDir > 0) { + gMusicFade += (0x10000 / 64); + if (gMusicFade > 0x10000 || (gMusicFadeHack & 1)) { + gMusicFade = 0x10000; + gMusicFadeDir = 0; + } + } else if (gMusicFadeDir < 0) { + gMusicFade -= (0x10000 / 128); + if (gMusicFade < 0 || (gMusicFadeHack & 2)) { + gMusicFade = 0; + gMusicFadeDir = 0; + } + } + + if (!gInfoEE) + return 1; + + gFrameNum++; + + if (gFakeVAGClockRunning && !gFakeVAGClockPaused) { + gFakeVAGClock += (s32)(1024 / Gfx::g_global_settings.target_fps); + } + + // We don't need this, our DMA's are instant + // if (dmaid) { + // if (sceSifDmaStat(dmaid) >= 0) { + // return 1; + // } + // dmaid = 0; + //} + + info.frame = gFrameNum; + info.strpos = GetVAGStreamPos(); + info.std_id = gVAG_Id; + info.freemem = gFreeMem; + info.freemem2 = gMemFreeAtStart; + // info.nocd = gNoCD; + // info.dirtycd = gDirtyCD; + info.nocd = 0; + info.dirtycd = 0; + // info.diskspeed[0] = gDiskSpeed[0]; + // info.diskspeed[1] = gDiskSpeed[1]; + // info.lastspeed = gLastSpeed; + // info.dupseg = gDupSeg; + + for (int i = 0; i < 48; i++) { + if (snd_GetVoiceStatus(i) == 1) { + info.chinfo[i] = -1; + } else { + info.chinfo[i] = 0; + } + } + + sceSifDmaData dma; + dma.data = &info; + dma.addr = (void*)(uintptr_t)gInfoEE; + dma.size = 0x110; + dma.mode = 0; + dmaid = sceSifSetDma(&dma, 1); + return 1; } diff --git a/game/overlord/srpc.h b/game/overlord/srpc.h index 9c4817d92b..f8fb8aac43 100644 --- a/game/overlord/srpc.h +++ b/game/overlord/srpc.h @@ -1,10 +1,14 @@ #pragma once #include "ssound.h" + #include "common/common_types.h" void srpc_init_globals(); +extern const char* gLanguage; +extern s32 gVAG_Id; + constexpr int MUSIC_TWEAK_COUNT = 32; struct MusicTweaks { @@ -143,6 +147,23 @@ struct SoundRpcCommand { static_assert(sizeof(SoundRpcCommand) == 0x50); +struct SoundIopInfo { + u32 frame; + s32 strpos; + u32 std_id; + u32 freemem; + u8 chinfo[48]; + u32 freemem2; + u32 nocd; + u32 dirtycd; + u32 diskspeed[2]; + u32 lastspeed; + s32 dupseg; + u32 times[41]; + u32 times_seq; + u8 pad[10]; // pad up to transfer size +}; + extern MusicTweaks gMusicTweakInfo; extern s32 gMusicTweak; @@ -150,3 +171,6 @@ u32 Thread_Loader(); u32 Thread_Player(); s32 VBlank_Handler(); + +// added for PC port +extern u32 gMusicFadeHack; diff --git a/game/overlord/ssound.cpp b/game/overlord/ssound.cpp index a79efef572..d1a1448e7a 100644 --- a/game/overlord/ssound.cpp +++ b/game/overlord/ssound.cpp @@ -1,9 +1,12 @@ +#include "ssound.h" + #include #include -#include "game/overlord/srpc.h" -#include "ssound.h" + #include "common/util/Assert.h" -#include "sndshim.h" + +#include "game/overlord/srpc.h" +#include "game/sound/sndshim.h" using namespace iop; @@ -19,8 +22,9 @@ s32 gMusicVol = 0x400; s32 gMusicFade = 0; s32 gMusicFadeDir = 0; -u32 gVoice; -u32 gStreamSRAM; +u32 gStreamSRAM = 0; +u32 gTrapSRAM = 0; + s32 gSema; static u32 sLastTick; @@ -87,10 +91,12 @@ void InitSound_Overlord() { // The voice allocator returns a number in the range 0-47 where voices // 0-23 are on SPU Core 0 and 24-47 are on core 2. // For some reason we convert it to this format where 0-47 alternate core every step. - gVoice = voice / 24 + ((voice % 24) * 2); + voice = voice / 24 + ((voice % 24) * 2); // Allocate SPU RAM for our streams. + // (Which we don't need on PC) gStreamSRAM = snd_SRAMMalloc(0xc030); + gTrapSRAM = gStreamSRAM + 0xC000; snd_SetMixerMode(0, 0); @@ -100,9 +106,10 @@ void InitSound_Overlord() { snd_SetGroupVoiceRange(1, 0, 0xf); snd_SetGroupVoiceRange(2, 0, 0xf); - snd_SetReverbDepth(3, 0, 0); - snd_SetReverbType(1, 0); - snd_SetReverbType(2, 0); + + snd_SetReverbDepth(SND_CORE_0 | SND_CORE_1, 0, 0); + snd_SetReverbType(SND_CORE_0, SD_REV_MODE_OFF); + snd_SetReverbType(SND_CORE_1, SD_REV_MODE_OFF); CatalogSRAM(); @@ -209,7 +216,7 @@ Sound* AllocateSound() { s32 CalculateFallofVolume(Vec3w* pos, s32 volume, s32 fo_curve, s32 fo_min, s32 fo_max) { if (fo_curve == 0) { - return 0; + return volume; } s32 xdiff = gEarTrans.x - pos->x; @@ -249,10 +256,10 @@ s32 CalculateFallofVolume(Vec3w* pos, s32 volume, s32 fo_curve, s32 fo_min, s32 zdiff >>= 1; } - s32 distance = xdiff * xdiff + ydiff * ydiff + zdiff * zdiff; + u32 distance = xdiff * xdiff + ydiff * ydiff + zdiff * zdiff; if (distance != 0) { s32 steps = 0; - while ((steps & 0xc0000000) == 0) { + while ((distance & 0xc0000000) == 0) { distance <<= 2; steps++; } @@ -262,11 +269,11 @@ s32 CalculateFallofVolume(Vec3w* pos, s32 volume, s32 fo_curve, s32 fo_min, s32 distance = 0; } - if (distance <= min) { + if (distance <= (u32)min) { return volume; } - if (distance >= max) { + if (distance >= (u32)max) { return 0; } @@ -284,7 +291,7 @@ s32 CalculateFallofVolume(Vec3w* pos, s32 volume, s32 fo_curve, s32 fo_min, s32 } s32 factor = ((gCurve[fo_curve].unk4 << 16) + gCurve[fo_curve].unk3 * v13 + - gCurve[fo_curve].unk2 * ((v13 * 13) >> 16) + + gCurve[fo_curve].unk2 * ((v13 * v13) >> 16) + gCurve[fo_curve].unk1 * (((((v13 * v13) >> 16) * v13) >> 16) >> 16)) >> 12; @@ -292,7 +299,7 @@ s32 CalculateFallofVolume(Vec3w* pos, s32 volume, s32 fo_curve, s32 fo_min, s32 factor = 0x10000; } - return factor; // TODO + return (factor * volume) >> 16; } s32 CalculateAngle(Vec3w* trans) { @@ -303,14 +310,14 @@ s32 CalculateAngle(Vec3w* trans) { s32 lookupZ = diffZ; if (diffX < 0) { - lookupZ = trans->x - gCamTrans.x; + lookupX = trans->x - gCamTrans.x; } if (diffZ < 0) { lookupZ = trans->z - gCamTrans.z; } - if (diffX == 0 && diffZ == 0) { + if (lookupX == 0 && lookupZ == 0) { return 0; } @@ -339,7 +346,7 @@ s32 CalculateAngle(Vec3w* trans) { } else if (diffZ >= 0) { angle = angle + 270; } else { - angle = 270 - 90; + angle = 270 - angle; } } @@ -413,10 +420,10 @@ static void UpdateAutoVol(Sound* sound, s32 ticks) { if (sound->new_volume == -4) { snd_StopSound(sound->sound_handle); sound->id = 0; - return; + } else { + sound->params.volume = sound->new_volume; } - sound->params.volume = sound->new_volume; sound->auto_time = 0; } @@ -432,8 +439,8 @@ void UpdateVolume(Sound* sound) { } void SetEarTrans(Vec3w* ear_trans, Vec3w* cam_trans, s32 cam_angle) { - s32 tick = 0; // snd_GetTick(); - s32 delta = tick - sLastTick; + s32 tick = snd_GetTick(); + u32 delta = tick - sLastTick; sLastTick = tick; gEarTrans = *ear_trans; @@ -488,4 +495,4 @@ void SetMusicVol() { static void* SndMemAlloc() { return nullptr; } -static void SndMemFree(void* ptr) {} +static void SndMemFree(void* /*ptr*/) {} diff --git a/game/overlord/ssound.h b/game/overlord/ssound.h index bd6c435a0f..df016bae36 100644 --- a/game/overlord/ssound.h +++ b/game/overlord/ssound.h @@ -2,15 +2,23 @@ #ifndef JAK_V2_SSOUND_H #define JAK_V2_SSOUND_H -#include "game/sce/iop.h" #include "sbank.h" +#include "game/sce/iop.h" + +struct VolumePair { + s16 left; + s16 right; +}; + extern s32 gSema; extern s32 gMusicFade; extern s32 gMusicFadeDir; extern s32 gMusicVol; +extern VolumePair gPanTable[361]; +extern u32 gStreamSRAM; +extern u32 gTrapSRAM; -// FIXME where to put this struct Vec3w { s32 x; s32 y; @@ -47,11 +55,6 @@ struct Curve { s32 unk4; }; -struct VolumePair { - s16 left; - s16 right; -}; - void InitSound_Overlord(); void SetCurve(s32 curve, s32 fallof, s32 ease); void SetEarTrans(Vec3w* ear_trans, Vec3w* cam_trans, s32 cam_angle); @@ -63,5 +66,7 @@ Sound* AllocateSound(); void UpdateVolume(Sound* sound); s32 GetVolume(Sound* sound); s32 GetPan(Sound* sound); +s32 CalculateFallofVolume(Vec3w* pos, s32 volume, s32 fo_curve, s32 fo_min, s32 fo_max); +s32 CalculateAngle(Vec3w* trans); #endif // JAK_V2_SSOUND_H diff --git a/game/overlord/stream.cpp b/game/overlord/stream.cpp index da9b753c92..b7055d32bf 100644 --- a/game/overlord/stream.cpp +++ b/game/overlord/stream.cpp @@ -4,22 +4,32 @@ * Supports loading a file directly to the EE, or loading chunks of a chunked file. */ -#include #include "stream.h" -#include "game/sce/iop.h" -#include "game/common/str_rpc_types.h" -#include "game/common/play_rpc_types.h" -#include "game/overlord/isocommon.h" -#include "game/overlord/iso_api.h" + +#include + #include "common/util/Assert.h" +#include "game/common/play_rpc_types.h" +#include "game/common/str_rpc_types.h" +#include "game/overlord/iso.h" +#include "game/overlord/iso_api.h" +#include "game/overlord/isocommon.h" +#include "game/overlord/srpc.h" +#include "game/runtime.h" +#include "game/sce/iop.h" + using namespace iop; static RPC_Str_Cmd sSTRBuf; -static RPC_Play_Cmd sPLAYBuf; // todo type +static RPC_Play_Cmd sPLAYBuf[2]; // todo type void* RPC_STR(unsigned int fno, void* _cmd, int y); void* RPC_PLAY(unsigned int fno, void* _cmd, int y); +static constexpr int PLAY_MSG_SIZE = 0x40; + +static u32 global_vag_count = 0; + /*! * We cache the chunk file headers so we can avoid seeking to the chunk header each time we * need to load another chunk, even if we load chunks out of order. @@ -52,7 +62,7 @@ u32 STRThread() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, STR_RPC_ID, RPC_STR, &sSTRBuf, nullptr, nullptr, &dq); + sceSifRegisterRpc(&serve, STR_RPC_ID[g_game_version], RPC_STR, &sSTRBuf, nullptr, nullptr, &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; @@ -65,7 +75,7 @@ u32 PLAYThread() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, PLAY_RPC_ID, RPC_PLAY, &sPLAYBuf, nullptr, nullptr, &dq); + sceSifRegisterRpc(&serve, PLAY_RPC_ID[g_game_version], RPC_PLAY, sPLAYBuf, nullptr, nullptr, &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; @@ -148,12 +158,63 @@ void* RPC_STR(unsigned int fno, void* _cmd, int y) { } } } + return cmd; } -void* RPC_PLAY(unsigned int fno, void* _cmd, int y) { - (void)fno; - (void)y; - // printf("[RPC_PLAY] ignoring...\n"); +void* RPC_PLAY([[maybe_unused]] unsigned int fno, void* _cmd, int size) { + s32 n_messages = size / PLAY_MSG_SIZE; + char namebuf[16]; + + auto* cmd = (RPC_Play_Cmd*)(_cmd); + while (n_messages > 0) { + if (cmd->name[0] == '$') { + char* name_part = &cmd->name[1]; + size_t name_len = strlen(name_part); + + if (name_len < 9) { + memset(namebuf, ' ', 8); + memcpy(namebuf, name_part, name_len); + } else { + memcpy(namebuf, name_part, 8); + } + + // ASCII toupper + for (int i = 0; i < 8; i++) { + if (namebuf[i] >= 0x61 && namebuf[i] < 0x7b) { + namebuf[i] -= 0x20; + } + } + } else { + ISONameFromAnimationName(namebuf, cmd->name); + } + + auto vag = FindVAGFile(namebuf); + memcpy(namebuf, "VAGWAD ", 8); + strcpy(&namebuf[8], gLanguage); + + FileRecord* file = nullptr; + + global_vag_count = (global_vag_count + 1) & 0x3f; + if (!cmd->result && global_vag_count == 0) { + namebuf[0] -= 3; + file = isofs->find_in(namebuf); + namebuf[0] += 3; + } + + file = isofs->find_in(namebuf); + + if (cmd->result == 0) { + PlayVAGStream(file, vag, cmd->address, 0x400, 1, nullptr); + } else if (cmd->result == 1) { + StopVAGStream(vag, 1); + } else { + QueueVAGStream(file, vag, 0, 1); + } + + n_messages--; + cmd++; + } + return _cmd; } diff --git a/game/runtime.cpp b/game/runtime.cpp index f8f6a6cf37..80895546a0 100644 --- a/game/runtime.cpp +++ b/game/runtime.cpp @@ -5,10 +5,14 @@ #ifdef __linux__ #include + #include #elif _WIN32 #include + #include "third-party/mman/mman.h" +#define NOMINMAX +#define WIN32_LEAN_AND_MEAN #include #endif @@ -16,49 +20,55 @@ #include #include -#include "common/log/log.h" #include "runtime.h" -#include "system/SystemThread.h" -#include "sce/libcdvd_ee.h" -#include "sce/deci2.h" -#include "sce/sif_ee.h" -#include "sce/iop.h" -#include "game/system/Deci2Server.h" -#include "game/kernel/fileio.h" -#include "game/kernel/kboot.h" -#include "game/kernel/klink.h" -#include "game/kernel/kscheme.h" -#include "game/kernel/kdsnetm.h" -#include "game/kernel/klisten.h" -#include "game/kernel/kmemcard.h" -#include "game/kernel/kprint.h" -#include "game/kernel/kdgo.h" - -#include "game/system/iop_thread.h" - -#include "game/overlord/dma.h" -#include "game/overlord/iso.h" -#include "game/overlord/fake_iso.h" -#include "game/overlord/iso_queue.h" -#include "game/overlord/ramdisk.h" -#include "game/overlord/iso_cd.h" -#include "game/overlord/overlord.h" -#include "game/overlord/srpc.h" -#include "game/overlord/stream.h" -#include "game/overlord/sbank.h" +#include "common/cross_os_debug/xdbg.h" +#include "common/goal_constants.h" +#include "common/log/log.h" +#include "common/util/FileUtil.h" +#include "common/versions.h" #include "game/graphics/gfx.h" - -#include "game/system/vm/vm.h" +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/kdgo.h" +#include "game/kernel/common/kdsnetm.h" +#include "game/kernel/common/klink.h" +#include "game/kernel/common/klisten.h" +#include "game/kernel/common/kmachine.h" +#include "game/kernel/common/kmalloc.h" +#include "game/kernel/common/kmemcard.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/common/kscheme.h" +#include "game/kernel/jak1/kboot.h" +#include "game/kernel/jak1/klisten.h" +#include "game/kernel/jak1/kscheme.h" +#include "game/kernel/jak2/kboot.h" +#include "game/kernel/jak2/klisten.h" +#include "game/kernel/jak2/kscheme.h" +#include "game/overlord/dma.h" +#include "game/overlord/fake_iso.h" +#include "game/overlord/iso.h" +#include "game/overlord/iso_cd.h" +#include "game/overlord/iso_queue.h" +#include "game/overlord/overlord.h" +#include "game/overlord/ramdisk.h" +#include "game/overlord/sbank.h" +#include "game/overlord/srpc.h" +#include "game/overlord/ssound.h" +#include "game/overlord/stream.h" +#include "game/system/Deci2Server.h" +#include "game/system/iop_thread.h" #include "game/system/vm/dmac.h" - -#include "common/goal_constants.h" -#include "common/cross_os_debug/xdbg.h" -#include "common/util/FileUtil.h" +#include "game/system/vm/vm.h" +#include "sce/deci2.h" +#include "sce/iop.h" +#include "sce/libcdvd_ee.h" +#include "sce/sif_ee.h" +#include "system/SystemThread.h" u8* g_ee_main_mem = nullptr; std::thread::id g_main_thread_id = std::thread::id(); +GameVersion g_game_version = GameVersion::Jak1; namespace { @@ -74,7 +84,7 @@ void deci2_runner(SystemThreadInterface& iface) { std::function shutdown_callback = [&]() { return iface.get_want_exit(); }; // create and register server - Deci2Server server(shutdown_callback); + Deci2Server server(shutdown_callback, DECI2_PORT); ee::LIBRARY_sceDeci2_register(&server); // now its ok to continue with initialization @@ -84,20 +94,21 @@ void deci2_runner(SystemThreadInterface& iface) { lg::debug("[DECI2] Waiting for EE to register protos"); server.wait_for_protos_ready(); // then allow the server to accept connections - if (!server.init()) { - ASSERT(false); + bool server_ok = server.init_server(); + if (!server_ok) { + lg::error("[DECI2] failed to initialize, REPL will not work.\n"); } lg::debug("[DECI2] Waiting for listener..."); bool saw_listener = false; while (!iface.get_want_exit()) { - if (server.check_for_listener()) { + if (server_ok && server.is_client_connected()) { if (!saw_listener) { lg::debug("[DECI2] Connected!"); } saw_listener = true; // we have a listener, run! - server.run(); + server.read_data(); } else { // no connection yet. Do a sleep so we don't spam checking the listener. std::this_thread::sleep_for(std::chrono::microseconds(50000)); @@ -143,30 +154,45 @@ void ee_runner(SystemThreadInterface& iface) { // this may not work well on systems with a page size > 1 MB. mprotect((void*)g_ee_main_mem, EE_MAIN_MEM_LOW_PROTECT, PROT_NONE); fileio_init_globals(); - kboot_init_globals(); + jak1::kboot_init_globals(); + jak2::kboot_init_globals(); + + kboot_init_globals_common(); kdgo_init_globals(); - kdsnetm_init_globals(); + kdsnetm_init_globals_common(); klink_init_globals(); - kmachine_init_globals(); - kscheme_init_globals(); - kmalloc_init_globals(); + kmachine_init_globals_common(); + jak1::kscheme_init_globals(); + jak2::kscheme_init_globals(); + kscheme_init_globals_common(); + kmalloc_init_globals_common(); klisten_init_globals(); + jak1::klisten_init_globals(); + jak2::klisten_init_globals(); + kmemcard_init_globals(); - kprint_init_globals(); + kprint_init_globals_common(); // Added for OpenGOAL's debugger xdbg::allow_debugging(); - goal_main(g_argc, g_argv); + switch (g_game_version) { + case GameVersion::Jak1: + jak1::goal_main(g_argc, g_argv); + break; + case GameVersion::Jak2: + jak2::goal_main(g_argc, g_argv); + break; + default: + ASSERT_MSG(false, "Unsupported game version"); + } lg::debug("[EE] Done!"); // // kill the IOP todo iop::LIBRARY_kill(); - munmap(g_ee_main_mem, EE_MAIN_MEM_SIZE); - // after main returns, trigger a shutdown. iface.trigger_shutdown(); } @@ -273,13 +299,11 @@ void dmac_runner(SystemThreadInterface& iface) { * Main function to launch the runtime. * GOAL kernel arguments are currently ignored. */ -u32 exec_runtime(int argc, char** argv) { +RuntimeExitStatus exec_runtime(int argc, char** argv) { g_argc = argc; g_argv = argv; g_main_thread_id = std::this_thread::get_id(); - file_util::create_dir_if_needed("game_config/"); - // parse opengoal arguments bool enable_display = true; for (int i = 1; i < argc; i++) { @@ -289,6 +313,8 @@ u32 exec_runtime(int argc, char** argv) { VM::use = true; } else if (std::string("-novm") == argv[i]) { // disable debug ps2 VM VM::use = false; + } else if (std::string("-jak2") == argv[i]) { + g_game_version = GameVersion::Jak2; } } @@ -314,22 +340,22 @@ u32 exec_runtime(int argc, char** argv) { // step 3: start the EE! iop_thread.start(iop_runner); - ee_thread.start(ee_runner); deci_thread.start(deci2_runner); + ee_thread.start(ee_runner); if (VM::use) { vm_dmac_thread.start(dmac_runner); - } else { - vm_dmac_thread.start(null_runner); } // step 4: wait for EE to signal a shutdown. meanwhile, run video loop on main thread. // TODO relegate this to its own function - // TODO also sync this up with how the game actually renders things (this is just a placeholder) if (enable_display) { - Gfx::Loop([]() { return !MasterExit; }); + Gfx::Loop([]() { return MasterExit == RuntimeExitStatus::RUNNING; }); Gfx::Exit(); } + // hack to make the IOP die quicker if it's loading/unloading music + gMusicFade = 0; + deci_thread.join(); // DECI has been killed, shutdown! @@ -339,5 +365,6 @@ u32 exec_runtime(int argc, char** argv) { // join and exit tm.join(); lg::info("GOAL Runtime Shutdown (code {})", MasterExit); + munmap(g_ee_main_mem, EE_MAIN_MEM_SIZE); return MasterExit; } diff --git a/game/runtime.h b/game/runtime.h index 3296379720..5311f8d125 100644 --- a/game/runtime.h +++ b/game/runtime.h @@ -5,10 +5,16 @@ * Setup and launcher for the runtime. */ -#include "common/common_types.h" #include +#include "common/common_types.h" +#include "common/versions.h" + +#include "game/kernel/common/kboot.h" + extern u8* g_ee_main_mem; -u32 exec_runtime(int argc, char** argv); +extern GameVersion g_game_version; + +RuntimeExitStatus exec_runtime(int argc, char** argv); extern std::thread::id g_main_thread_id; diff --git a/game/sce/deci2.cpp b/game/sce/deci2.cpp index 9a5c39835a..6a41dcaa5d 100644 --- a/game/sce/deci2.cpp +++ b/game/sce/deci2.cpp @@ -3,13 +3,16 @@ * Implementation of SCE DECI2 library. */ +#include "deci2.h" + #include #include + #include "common/log/log.h" -#include "deci2.h" -#include "game/system/Deci2Server.h" #include "common/util/Assert.h" +#include "game/system/Deci2Server.h" + namespace ee { namespace { diff --git a/game/sce/deci2.h b/game/sce/deci2.h index b4149cde7c..0bc71609df 100644 --- a/game/sce/deci2.h +++ b/game/sce/deci2.h @@ -5,9 +5,6 @@ * Implementation of SCE DECI2 library. */ -#ifndef JAK1_DECI2_H -#define JAK1_DECI2_H - #include "common/listener_common.h" class Deci2Server; @@ -25,5 +22,3 @@ s32 sceDeci2ExRecv(s32 s, void* buf, u16 len); s32 sceDeci2ExSend(s32 s, void* buf, u16 len); } // namespace ee - -#endif // JAK1_DECI2_H diff --git a/game/sce/iop.cpp b/game/sce/iop.cpp index 99e9f05740..d0e916ce02 100644 --- a/game/sce/iop.cpp +++ b/game/sce/iop.cpp @@ -1,8 +1,11 @@ -#include #include "iop.h" -#include "game/system/iop_thread.h" + +#include + #include "common/util/Assert.h" +#include "game/system/iop_thread.h" + namespace iop { /*! * Is the SIF initialized? @@ -217,4 +220,12 @@ s32 WakeupThread(s32 thid) { iop->kernel.WakeupThread(thid); return 0; } + +bool ThreadWantsExit(s32 thid) { + return iop->kernel.GetWantExit(thid); +} + +bool OnlyThreadAlive(s32 thid) { + return iop->kernel.OnlyThreadAlive(thid); +} } // namespace iop diff --git a/game/sce/iop.h b/game/sce/iop.h index f0ced35b3d..a5ce58d56c 100644 --- a/game/sce/iop.h +++ b/game/sce/iop.h @@ -1,8 +1,5 @@ #pragma once -#ifndef JAK1_IOP_H -#define JAK1_IOP_H - #include "common/common_types.h" #define SMEM_Low (0) @@ -22,7 +19,9 @@ #define SCECdComplete 0x02 #define SCECdNotReady 0x06 +#define KE_OK 0 #define KE_MBOX_NOMSG -424 +#define KE_WAIT_DELETE -425 #define TH_C 0x02000000 @@ -99,6 +98,9 @@ void DelayThread(u32 usec); s32 CreateThread(ThreadParam* param); s32 StartThread(s32 thid, u32 arg); s32 WakeupThread(s32 thid); +// kind of a hack +bool ThreadWantsExit(s32 thid); +bool OnlyThreadAlive(s32 thid); void sceSifInitRpc(int mode); void sceSifInitRpc(unsigned int mode); @@ -141,5 +143,3 @@ void LIBRARY_INIT(); void LIBRARY_register(::IOP* i); void LIBRARY_kill(); } // namespace iop - -#endif // JAK1_IOP_H diff --git a/game/sce/libcdvd_ee.cpp b/game/sce/libcdvd_ee.cpp index 5e4182d7f0..a3ab7beb99 100644 --- a/game/sce/libcdvd_ee.cpp +++ b/game/sce/libcdvd_ee.cpp @@ -4,6 +4,7 @@ */ #include "libcdvd_ee.h" + #include "common/util/Assert.h" namespace ee { diff --git a/game/sce/libgraph.cpp b/game/sce/libgraph.cpp index 6d40bb84d7..dbfc64b72a 100644 --- a/game/sce/libgraph.cpp +++ b/game/sce/libgraph.cpp @@ -1,4 +1,5 @@ #include "libgraph.h" + #include "common/log/log.h" namespace ee { diff --git a/game/sce/libpad.cpp b/game/sce/libpad.cpp index c2c1e9ac36..2b1736c06c 100644 --- a/game/sce/libpad.cpp +++ b/game/sce/libpad.cpp @@ -1,9 +1,10 @@ #include "libpad.h" -#include "game/kernel/kmachine.h" -#include "game/graphics/gfx.h" #include "common/util/Assert.h" +#include "game/graphics/gfx.h" +#include "game/kernel/common/kernel_types.h" + /*! * @file libpad.cpp * Stub implementation of the EE pad (controller) library diff --git a/game/sce/sif_ee.cpp b/game/sce/sif_ee.cpp index 104c0747ff..52cdc04406 100644 --- a/game/sce/sif_ee.cpp +++ b/game/sce/sif_ee.cpp @@ -1,11 +1,14 @@ -#include -#include -#include -#include "common/util/FileUtil.h" #include "sif_ee.h" -#include "game/system/iop_thread.h" -#include "game/runtime.h" + +#include +#include +#include + #include "common/util/Assert.h" +#include "common/util/FileUtil.h" + +#include "game/runtime.h" +#include "game/system/iop_thread.h" namespace ee { @@ -42,7 +45,7 @@ void sceFsReset() {} int sceSifLoadModule(const char* name, int arg_size, const char* args) { if (!strcmp(name, "cdrom0:\\\\DRIVERS\\\\OVERLORD.IRX;1") || - !strcmp(name, "host0:binee/overlord.irx")) { + !strcmp(name, "host0:binee/overlord.irx") || !strcmp(name, "host0:bin/overlord.irx")) { const char* src = args; char* dst = iop->overlord_arg_data; int cnt; @@ -81,12 +84,12 @@ s32 sceSifCallRpc(sceSifClientData* bd, ASSERT(!end_para); ASSERT(mode == 1); // async iop->kernel.sif_rpc(bd->rpcd.id, fno, mode, send, ssize, recv, rsize); - iop->signal_run_iop(); + iop->signal_run_iop(false); return 0; } s32 sceSifCheckStatRpc(sceSifRpcData* bd) { - iop->signal_run_iop(); + iop->signal_run_iop(false); return iop->kernel.sif_busy(bd->id); } diff --git a/game/sce/sif_ee_memcard.cpp b/game/sce/sif_ee_memcard.cpp index 8f4fdee63b..9c5d87916b 100644 --- a/game/sce/sif_ee_memcard.cpp +++ b/game/sce/sif_ee_memcard.cpp @@ -1,14 +1,16 @@ -#include -#include -#include -#include - #include "sif_ee_memcard.h" -#include "game/sce/sif_ee.h" -#include "common/util/Serializer.h" -#include "common/util/FileUtil.h" + +#include +#include +#include +#include + #include "common/util/Assert.h" +#include "common/util/FileUtil.h" +#include "common/util/Serializer.h" + +#include "game/sce/sif_ee.h" namespace ee { /*! diff --git a/game/sce/stubs.cpp b/game/sce/stubs.cpp index 1e3dbb3e86..9dc56afb67 100644 --- a/game/sce/stubs.cpp +++ b/game/sce/stubs.cpp @@ -1,5 +1,7 @@ -#include #include "stubs.h" + +#include + #include "common/util/Assert.h" namespace ee { diff --git a/game/sound/989snd/ame_handler.cpp b/game/sound/989snd/ame_handler.cpp new file mode 100644 index 0000000000..9f8c16631f --- /dev/null +++ b/game/sound/989snd/ame_handler.cpp @@ -0,0 +1,325 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#include "ame_handler.h" + +#include "game/sound/989snd/blocksound_handler.h" + +namespace snd { + +// added! +u64 SoundFlavaHack = 0; + +ame_handler::ame_handler(MultiMIDIBlockHeader* block, + voice_manager& vm, + MIDISound& sound, + s32 vol, + s32 pan, + locator& loc, + u32 bank) + : m_sound(sound), + m_bank(bank), + m_header(block), + m_locator(loc), + m_vm(vm), + m_repeats(sound.Repeats) { + if (vol == VOLUME_DONT_CHANGE) { + vol = 1024; + } + + m_vol = (vol * m_sound.Vol) >> 10; + + if (m_vol >= 128) { + m_vol = 127; + } + + if (pan == PAN_DONT_CHANGE || pan == PAN_RESET) { + m_pan = m_sound.Pan; + } else { + m_pan = pan; + } + + start_segment(0); +}; + +bool ame_handler::tick() { + for (auto it = m_midis.begin(); it != m_midis.end();) { + bool done = it->second->tick(); + if (done) { + fmt::print("stopping segment {}\n", it->first); + it = m_midis.erase(it); + } else { + it++; + } + } + + return m_midis.empty(); +}; + +void ame_handler::start_segment(u32 id) { + auto midiblock = (MIDIBlockHeader*)(m_header->BlockPtr[id] + (uintptr_t)m_header); + fmt::print("starting segment {}\n", id); + m_midis.emplace(id, std::make_unique(midiblock, m_vm, m_sound, m_vol, m_pan, + m_locator, m_bank, this)); +} + +void ame_handler::stop() { + for (auto it = m_midis.begin(); it != m_midis.end();) { + it->second->stop(); + it = m_midis.erase(it); + } +} + +void ame_handler::stop_segment(u32 id) { + auto m = m_midis.find(id); + if (m == m_midis.end()) + return; + + m->second->stop(); + m_midis.erase(id); +} + +void ame_handler::pause() { + for (auto& m : m_midis) { + m.second->pause(); + } +} + +void ame_handler::unpause() { + for (auto& m : m_midis) { + m.second->unpause(); + } +} + +void ame_handler::set_vol_pan(s32 vol, s32 pan) { + if (vol >= 0) { + if (vol != VOLUME_DONT_CHANGE) { + m_vol = (m_sound.Vol * vol) >> 10; + } + } else { + m_vol = -vol; + } + + if (m_vol >= 128) { + m_vol = 127; + } + + if (pan == PAN_RESET) { + m_pan = m_sound.Pan; + } else if (pan != PAN_DONT_CHANGE) { + m_pan = pan; + } + + for (auto& m : m_midis) { + m.second->set_vol_pan(vol, pan); + } +} + +void ame_handler::set_pmod(s32 mod) { + // TODO +} + +#define AME_BEGIN(op) \ + if (skip) { \ + if (skip == 1) { \ + skip = 0; \ + } \ + } else \ + do { +#define AME_END(x) \ + } \ + while (0) \ + ; \ + stream += (x); + +std::pair ame_handler::run_ame(midi_handler& midi, u8* stream) { + int skip = 0; + bool done = false; + bool cont = true; + + while (!done) { + auto op = static_cast(*stream++); + switch (op) { + case 0x0: { + AME_BEGIN(op) + if (m_excite <= (stream[0] + 1)) { + skip = 1; + } + AME_END(1) + } break; + case 0x1: { + AME_BEGIN(op) + if (m_excite != (stream[0] + 1)) { + skip = 1; + } + AME_END(1) + } break; + case 0x2: { + AME_BEGIN(op) + if (m_excite > (stream[0] + 1)) { + skip = 1; + } + AME_END(1) + } break; + case 0x3: { + AME_BEGIN(op) + stop_segment(stream[0]); + AME_END(1) + } break; + case 0x4: { + // fmt::print("ame trace 4\n"); + if (skip == 1) { + skip = 2; + } + } break; + case 0x5: { + // fmt::print("ame trace 5\n"); + if (skip == 2) { + skip = 0; + } + } break; + case 0x6: { + AME_BEGIN(op) + if (m_register[stream[0]] > (stream[1] - 1)) { + skip = 1; + } + AME_END(2) + } break; + case 0x7: { + AME_BEGIN(op) + if (m_register[stream[0]] < (stream[1] + 1)) { + skip = 1; + } + AME_END(2) + } break; + case 0xB: { + // fmt::print("ame trace b\n"); + m_macro[stream[0]] = &stream[1]; + while (*stream != 0xf7) { + stream++; + } + stream++; + } break; + case 0xc: { + AME_BEGIN(op) + auto [sub_cont, ptr] = run_ame(midi, m_macro[stream[0]]); + if (!sub_cont) { + cont = false; + done = true; + } + AME_END(1) + } break; + case 0xd: { + AME_BEGIN(op) + cont = false; + done = true; + start_segment(m_register[stream[0] - 1]); + AME_END(1) + } break; + case 0xe: { + AME_BEGIN(op) + start_segment(m_register[stream[0] - 1]); + AME_END(1) + } break; + case 0xf: { + // fmt::print("ame trace f\n"); + if (skip) { + while (*stream != 0x7f) { + stream++; + } + stream++; + if (skip == 1) + skip = 0; + } else { + auto group = *stream++; + m_groups[group].basis = *stream++; + u8 channel = 0; + while (*stream != 0xf7) { + m_groups[group].channel[channel] = *stream++; + m_groups[group].excite_min[channel] = *stream++; + m_groups[group].excite_max[channel] = *stream++; + channel++; + } + m_groups[group].num_channels = channel; + stream++; + } + } break; + case 0x10: { + AME_BEGIN(op) + u8 group = stream[0]; + u8 comp = 0; + if (m_groups[group].basis == 0) { + comp = m_excite; + } else { + comp = m_register[m_groups[group].basis - 1]; + } + // fmt::print("group: {} basis: {} excite: {}\n", group, m_groups[group].basis, comp); + for (int i = 0; i < m_groups[group].num_channels; i++) { + // auto xmin = m_groups[group].excite_min[i]; + // auto xmax = m_groups[group].excite_max[i]; + // fmt::print("chan {} excite: {}-{}\n", i, xmin, xmax); + // note : added hack here! :-) + if (!SoundFlavaHack && + (comp < m_groups[group].excite_min[i] || comp > m_groups[group].excite_max[i])) { + midi.mute_channel(m_groups[group].channel[i]); + } else { + midi.unmute_channel(m_groups[group].channel[i]); + } + } + AME_END(1) + } break; + case 0x11: { + AME_BEGIN(op) + done = true; + cont = false; + start_segment(stream[0]); + AME_END(1) + } break; + case 0x12: { + AME_BEGIN(op) + start_segment(stream[0]); + AME_END(1) + } break; + case 0x13: { + AME_BEGIN(op) + m_register[stream[0]] = stream[1]; + AME_END(2) + } break; + case 0x14: { + AME_BEGIN(op) + if (m_register[stream[0]] < 0x7f) { + m_register[stream[0]]++; + } + AME_END(1) + } break; + case 0x15: { + AME_BEGIN(op) + if (m_register[stream[0]] > 0) { + m_register[stream[0]]--; + } + AME_END(1) + } break; + case 0x16: { + AME_BEGIN(op) + if (m_register[stream[0]] != stream[1]) { + skip = 1; + } + AME_END(2) + } break; + default: { + throw ame_error(fmt::format("Unhandled AME event {:02x}", (u8)op)); + } break; + } + + if (*stream == 0xf7) { + // fmt::print("ame done\n"); + stream++; + done = true; + } + } + + return {cont, stream}; +} + +} // namespace snd +#undef AME_BEGIN +#undef AME_END diff --git a/game/sound/989snd/ame_handler.h b/game/sound/989snd/ame_handler.h new file mode 100644 index 0000000000..2f9707191c --- /dev/null +++ b/game/sound/989snd/ame_handler.h @@ -0,0 +1,80 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#pragma once +#include + +#include "loader.h" +#include "midi_handler.h" +#include "sound_handler.h" +#include "vagvoice.h" + +#include "common/common_types.h" + +namespace snd { + +// added! +extern u64 SoundFlavaHack; + +class midi_handler; +class ame_handler : public sound_handler { + friend class midi_handler; + + public: + ame_handler(MultiMIDIBlockHeader* block, + voice_manager& vm, + MIDISound& sound, + s32 vol, + s32 pan, + locator& loc, + u32 bank); + bool tick() override; + u32 bank() override { return m_bank; }; + + void pause() override; + void unpause() override; + void stop() override; + u8 group() override { return m_sound.VolGroup; }; + void set_vol_pan(s32 vol, s32 pan) override; + + void set_register(u8 reg, u8 value) override { m_register[reg] = value; } + void set_pmod(s32 mod) override; + + private: + struct ame_error : public std::exception { + ame_error(std::string text) : msg(std::move(text)) {} + ame_error() : msg("Unknown AME error") {} + std::string msg; + const char* what() const noexcept override { return msg.c_str(); } + }; + + struct GroupDescription { + /* 0 */ s8 num_channels; + /* 1 */ s8 basis; + /* 2 */ s8 pad[2]; + /* 4 */ s8 channel[16]; + /* 14 */ s8 excite_min[16]; + /* 24 */ s8 excite_max[16]; + }; + + void start_segment(u32 id); + void stop_segment(u32 id); + std::pair run_ame(midi_handler&, u8* stream); + + MIDISound& m_sound; + u32 m_bank{0}; + + MultiMIDIBlockHeader* m_header{nullptr}; + locator& m_locator; + voice_manager& m_vm; + s32 m_vol{0}; + s32 m_pan{0}; + s8 m_repeats{0}; + + std::unordered_map> m_midis; + + u8 m_excite{0}; + std::array m_groups{}; + std::array m_register{}; + std::array m_macro{}; +}; +} // namespace snd diff --git a/game/sound/989snd/blocksound_handler.cpp b/game/sound/989snd/blocksound_handler.cpp new file mode 100644 index 0000000000..79030bf84b --- /dev/null +++ b/game/sound/989snd/blocksound_handler.cpp @@ -0,0 +1,234 @@ +#include "blocksound_handler.h" + +#include +#include + +#include "util.h" + +namespace snd { +void blocksound_handler::init() { + m_next_grain = 0; + m_countdown = m_sfx.grains[0].Delay; + + // if (m_sfx.d.Flags & 2) { + // fmt::print("solo flag\n"); + // m_done = true; + // return; + // } + + while (m_countdown <= 0 && !m_done) { + do_grain(); + } +} + +bool blocksound_handler::tick() { + m_voices.remove_if([](std::weak_ptr& p) { return p.expired(); }); + + if (m_done) { + if (m_voices.empty()) { + // fmt::print("{}: voices empty\n", (void*)this); + return m_done; + } else { + return false; + } + } + + if (m_paused) + return false; + + m_countdown--; + while (m_countdown <= 0 && !m_done) { + do_grain(); + } + + return false; +}; + +void blocksound_handler::pause() { + m_paused = true; + + for (auto& p : m_voices) { + auto voice = p.lock(); + if (voice == nullptr) { + continue; + } + + m_vm.pause(voice); + } +} + +void blocksound_handler::unpause() { + m_paused = false; + + for (auto& p : m_voices) { + auto voice = p.lock(); + if (voice == nullptr) { + continue; + } + + m_vm.unpause(voice); + } +} + +void blocksound_handler::stop() { + m_done = true; + + for (auto& p : m_voices) { + auto voice = p.lock(); + if (voice == nullptr) { + continue; + } + + voice->key_off(); + } +} + +void blocksound_handler::set_vol_pan(s32 vol, s32 pan) { + if (vol >= 0) { + if (vol != VOLUME_DONT_CHANGE) { + m_app_volume = (vol * m_sfx.d.Vol) >> 10; + } + } else { + m_app_volume = -vol; + } + + if (m_app_volume >= 128) { + m_app_volume = 127; + } + + if (pan == PAN_RESET) { + m_app_pan = m_sfx.d.Pan; + } else if (pan != PAN_DONT_CHANGE) { + m_app_pan = pan; + } + + vol = m_app_volume; // + lfo vol + // TODO LFO logic here + + pan = m_app_pan; // + lfo pan + while (pan >= 360) { + pan -= 360; + } + + while (pan < 0) { + pan += 360; + } + + if (pan != m_cur_pan || vol != m_cur_volume) { + m_cur_volume = vol; + m_cur_pan = pan; + + for (auto& p : m_voices) { + auto voice = p.lock(); + if (voice == nullptr) { + continue; + } + + auto volume = + m_vm.make_volume(127, 0, m_cur_volume, m_cur_pan, voice->tone.Vol, voice->tone.Pan); + auto left = m_vm.adjust_vol_to_group(volume.left, m_sfx.d.VolGroup); + auto right = m_vm.adjust_vol_to_group(volume.right, m_sfx.d.VolGroup); + + voice->set_volume(left >> 1, right >> 1); + } + } +} + +void blocksound_handler::update_pitch() { + m_cur_pm = m_app_pm; + m_cur_pb = m_app_pb; + + for (auto& p : m_voices) { + auto voice = p.lock(); + if (voice == nullptr) { + continue; + } + + auto note = pitchbend(voice->tone, m_cur_pb, m_cur_pm, m_note, m_fine); + auto pitch = + PS1Note2Pitch(voice->tone.CenterNote, voice->tone.CenterFine, note.first, note.second); + voice->set_pitch(pitch); + } +} + +void blocksound_handler::set_pmod(s32 mod) { + m_app_pm = mod; + update_pitch(); +} + +void blocksound_handler::set_pbend(s32 bend) { + m_app_pb = bend; + update_pitch(); +} + +s32 blocksound_handler::null(SFXGrain& grain) { + return 0; +} + +s32 blocksound_handler::play_tone(SFXGrain& grain) { + auto voice = std::make_shared(grain.GrainParams.tone); + + voice->basevol = m_vm.make_volume(127, 0, m_cur_volume, m_cur_pan, grain.GrainParams.tone.Vol, + grain.GrainParams.tone.Pan); + + voice->start_note = m_note; + voice->start_fine = m_fine; + voice->group = m_group; + + m_vm.start_tone(voice); + m_voices.emplace_front(voice); + + return 0; +} + +s32 blocksound_handler::rand_play(SFXGrain& grain) { + int options = grain.GrainParams.control.param[0]; + int count = grain.GrainParams.control.param[1]; + int previous = grain.GrainParams.control.param[2]; + + int rnd = rand() % options; + if (rnd == previous) { + rnd++; + if (rnd >= options) { + rnd = 0; + } + } + + grain.GrainParams.control.param[2] = rnd; + m_next_grain += rnd * count; + m_grains_to_play = count + 1; + m_grains_to_skip = (options - 1 - rnd) * count; + m_skip_grains = true; + + return 0; +} + +void blocksound_handler::do_grain() { + auto& grain = m_sfx.grains[m_next_grain]; + + auto handler = m_grain_handler.find((grain_type)grain.Type); + if (handler != m_grain_handler.end()) { + (this->*(handler->second))(grain); + } else { + throw std::runtime_error( + fmt::format("{}: Ignoring grain {}, type {}\n", (void*)this, m_next_grain, grain.Type)); + } + + if (m_skip_grains) { + m_grains_to_play--; + if (m_grains_to_play == 0) { + m_next_grain += m_grains_to_skip; + m_skip_grains = false; + } + } + + m_next_grain++; + if (m_next_grain >= m_sfx.grains.size()) { + m_done = true; + return; + } + + m_countdown = m_sfx.grains[m_next_grain].Delay; +} + +} // namespace snd diff --git a/game/sound/989snd/blocksound_handler.h b/game/sound/989snd/blocksound_handler.h new file mode 100644 index 0000000000..07f919bb6e --- /dev/null +++ b/game/sound/989snd/blocksound_handler.h @@ -0,0 +1,134 @@ +#pragma once +#include + +#include "sfxblock.h" +#include "sound_handler.h" +#include "vagvoice.h" + +#include "common/common_types.h" + +namespace snd { +class blocksound_handler : public sound_handler { + public: + blocksound_handler(SFX& sfx, voice_manager& vm, s32 vol, s32 pan, s32 pm, s32 pb, u32 bank_id) + : m_sfx(sfx), m_vm(vm), m_bank(bank_id) { + vol = (vol * m_sfx.d.Vol) >> 10; + if (vol >= 128) { + vol = 127; + } + + if (pan >= PAN_DONT_CHANGE) { + pan = m_sfx.d.Pan; + } + + m_cur_volume = vol; + m_cur_pan = pan; + m_cur_pm = pm; + m_cur_pb = pb; + + m_app_volume = vol; + m_app_pan = pan; + m_app_pm = 0; // why only this one? + m_app_pb = pb; + + m_orig_pan = m_sfx.d.Pan; + m_orig_volume = m_sfx.d.Vol; + + m_group = sfx.d.VolGroup; + + m_grain_handler.insert(std::make_pair(grain_type::null, &blocksound_handler::null)); + m_grain_handler.insert(std::make_pair(grain_type::tone, &blocksound_handler::play_tone)); + m_grain_handler.insert(std::make_pair(grain_type::rand_play, &blocksound_handler::rand_play)); + } + + ~blocksound_handler() override { + for (auto& p : m_voices) { + auto v = p.lock(); + if (v != nullptr) { + v->stop(); + } + } + } + + bool tick() override; + u32 bank() override { return m_bank; }; + + void pause() override; + void unpause() override; + void stop() override; + u8 group() override { return m_group; }; + void set_vol_pan(s32 vol, s32 pan) override; + void set_pmod(s32 mod) override; + void set_pbend(s32 bend); // TODO override; + + void init(); + + private: + enum class grain_type : u32 { + null = 0, + tone = 1, + xref_id = 2, + xref_num = 3, + lfo_settings = 4, + loop_start = 21, + loop_end = 22, + loop_continue = 23, + rand_play = 25, + rand_delay = 26, + }; + + void do_grain(); + + s32 null(SFXGrain& grain); + s32 play_tone(SFXGrain& grain); + s32 rand_play(SFXGrain& grain); + void update_pitch(); + + using grain_fp = int (blocksound_handler::*)(SFXGrain& grain); + std::unordered_map m_grain_handler; + + bool m_paused{false}; + + u8 m_group{0}; + bool m_done{false}; + + u32 m_grains_to_play{0}; + u32 m_grains_to_skip{0}; + bool m_skip_grains{false}; + + SFX& m_sfx; + voice_manager& m_vm; + + std::list> m_voices; + + s32 m_current_pb{0}; + s32 m_current_pm{0}; + + s32 m_orig_volume{0}; + s32 m_orig_pan{0}; + s32 m_cur_volume{0}; + s32 m_cur_pan{0}; + s32 m_cur_pm{0}; + s32 m_cur_pb{0}; + s32 m_app_volume{0}; + s32 m_app_pan{0}; + s32 m_app_pm{0}; + s32 m_app_pb{0}; + + s32 m_lfo_volume{0}; + s32 m_lfo_pan{0}; + s32 m_lfo_pm{0}; + + u32 m_bank{0}; + + u8 m_note{60}; + u8 m_fine{0}; + + std::array m_registers{}; + + // TODO LFO + + s32 m_countdown{0}; + u32 m_next_grain{0}; +}; +} // namespace snd diff --git a/game/sound/989snd/handle_allocator.h b/game/sound/989snd/handle_allocator.h new file mode 100644 index 0000000000..82707bf0af --- /dev/null +++ b/game/sound/989snd/handle_allocator.h @@ -0,0 +1,32 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#pragma once + +#include +#include + +#include "common/common_types.h" + +namespace snd { + +class id_allocator { + public: + u32 get_id() { + u32 id = 0; + if (m_free_ids.empty()) { + id = next_id++; + } else { + id = m_free_ids.front(); + m_free_ids.pop(); + } + return id; + } + + void free_id(u32 id) { m_free_ids.push(id); } + + private: + u32 next_id{1}; + std::queue m_free_ids; +}; + +} // namespace snd diff --git a/game/sound/989snd/loader.cpp b/game/sound/989snd/loader.cpp new file mode 100644 index 0000000000..3205dab306 --- /dev/null +++ b/game/sound/989snd/loader.cpp @@ -0,0 +1,200 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#include "loader.h" + +#include +#include + +#include "midi_handler.h" + +#include + +namespace snd { +enum chunk : u32 { bank, samples, midi }; + +#define FOURCC(a, b, c, d) ((u32)(((d) << 24) | ((c) << 16) | ((b) << 8) | (a))) + +u32 loader::read_music_bank(SoundBankData* data) { + u32 handle = m_id_allocator.get_id(); + + auto bank = std::make_unique(*this); + + auto sound = (MIDISound*)((uintptr_t)data + data->FirstSound); + for (int i = 0; i < data->NumSounds; i++) { + bank->sounds.emplace_back(sound[i]); + } + + auto progdata = (ProgData*)((uintptr_t)data + data->FirstProg); + for (int i = 0; i < data->NumProgs; i++) { + Prog prog; + prog.d = progdata[i]; + bank->programs.emplace_back(std::move(prog)); + } + + for (auto& prog : bank->programs) { + auto tonedata = (Tone*)((uintptr_t)data + prog.d.FirstTone); + for (int i = 0; i < prog.d.NumTones; i++) { + Tone tone = tonedata[i]; + tone.BankID = handle; + prog.tones.emplace_back(tone); + } + } + + bank->type = BankType::Music; + + bank->bank_id = handle; + bank->bank_name = data->BankID; + m_soundbanks.emplace(handle, std::move(bank)); + + fmt::print("Loaded music bank {:.4}\n", (char*)&data->BankID); + + return handle; +} + +u32 loader::read_sfx_bank(SFXBlockData* data) { + u32 handle = m_id_allocator.get_id(); + + auto bank = std::make_unique(*this); + + auto sounddata = (SFXData*)((uintptr_t)data + data->FirstSound); + for (int i = 0; i < data->NumSounds; i++) { + SFX sound; + sound.d = sounddata[i]; + bank->sounds.push_back(sound); + } + + for (auto& sound : bank->sounds) { + auto graindata = (SFXGrain*)((uintptr_t)data + data->FirstGrain + sound.d.FirstGrain); + for (int i = 0; i < sound.d.NumGrains; i++) { + SFXGrain grain = graindata[i]; + if (grain.Type == 1) { + grain.GrainParams.tone.BankID = handle; + } + sound.grains.push_back(grain); + } + } + + bank->type = BankType::SFX; + + bank->bank_id = handle; + m_soundbanks.emplace(handle, std::move(bank)); + return handle; +} + +u32 loader::read_bank(std::fstream& in) { + size_t origin = in.tellg(); + FileAttributes<3> attr; + in.read((char*)(&attr), sizeof(attr)); + + if (attr.type != 1 && attr.type != 3) { + fmt::print("Error: File type {} not supported.", attr.type); + return -1; + } + + if (attr.num_chunks > 2) { + // Fix for bugged tooling I assume? + attr.where[chunk::bank].size += 4; + } + + // auto pos = in.tellg(); + auto bank_buf = std::make_unique(attr.where[chunk::bank].size); + in.seekg(origin + attr.where[chunk::bank].offset, std::fstream::beg); + in.read((char*)bank_buf.get(), attr.where[chunk::bank].size); + auto bank = (BankTag*)bank_buf.get(); + + u32 bank_id = 0; + + if (bank->DataID == FOURCC('S', 'B', 'v', '2')) { + bank_id = read_music_bank((SoundBankData*)bank_buf.get()); + } else if (bank->DataID == FOURCC('S', 'B', 'l', 'k')) { + bank_id = read_sfx_bank((SFXBlockData*)bank_buf.get()); + } else { + throw std::runtime_error("Unknown bank ID, bad file?"); + } + + if (attr.num_chunks >= 2) { + in.seekg(origin + attr.where[chunk::samples].offset, std::fstream::beg); + auto samples = std::make_unique(attr.where[chunk::samples].size); + in.read((char*)samples.get(), attr.where[chunk::samples].size); + load_samples(bank_id, std::move(samples)); + } + + if (attr.num_chunks >= 3) { + in.seekg(origin + attr.where[chunk::midi].offset, std::fstream::beg); + load_midi(in); + } + + fmt::print("Created bank {}\n", bank_id); + + return bank_id; +} + +void loader::load_midi(std::fstream& in) { + FileAttributes<1> attr; + u32 cur = in.tellg(); + + in.read((char*)&attr, sizeof(attr)); + in.seekg(cur + attr.where[0].offset, std::fstream::beg); + + auto midi = std::make_unique(attr.where[0].size); + in.read((char*)midi.get(), attr.where[0].size); + + auto h = (MIDIBlock*)midi.get(); + fmt::print("Loaded midi {:.4}\n", (char*)&h->ID); + + m_midi.emplace(h->ID, (MIDIBlock*)midi.get()); + m_midi_chunks.emplace_back(std::move(midi)); +} + +SoundBank* loader::get_bank_by_handle(u32 id) { + if (m_soundbanks.find(id) == m_soundbanks.end()) { + return nullptr; + } + + return m_soundbanks[id].get(); +} + +MusicBank* loader::get_bank_by_name(u32 id) { + for (auto& b : m_soundbanks) { + if (b.second->type == BankType::Music) { + auto* bank = static_cast(b.second.get()); + if (bank->bank_name == id) { + return bank; + } + } + } + + return nullptr; +} + +MIDIBlock* loader::get_midi(u32 id) { + return m_midi.at(id); +} + +u8* loader::get_bank_samples(u32 id) { + return m_soundbanks.at(id).get()->sampleBuf.get(); +} + +void loader::load_samples(u32 bank_id, std::unique_ptr samples) { + auto& bank = m_soundbanks.at(bank_id); + bank->sampleBuf = std::move(samples); +} + +void loader::unload_bank(u32 id) { + fmt::print("Deleting bank {}\n", id); + for (auto it = m_midi_chunks.begin(); it != m_midi_chunks.end();) { + bool del = false; + // FIXME delete midi + + if (del) { + it = m_midi_chunks.erase(it); + } else { + ++it; + } + } + + m_soundbanks.erase(id); + m_id_allocator.free_id(id); +} + +} // namespace snd diff --git a/game/sound/989snd/loader.h b/game/sound/989snd/loader.h new file mode 100644 index 0000000000..6fefe9cc28 --- /dev/null +++ b/game/sound/989snd/loader.h @@ -0,0 +1,61 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#pragma once +#include +#include +#include + +#include "handle_allocator.h" +#include "musicbank.h" +#include "sfxblock.h" +#include "sound_handler.h" +#include "soundbank.h" + +#include "common/common_types.h" + +#include "../common/synth.h" + +namespace snd { + +#define FOURCC(a, b, c, d) ((u32)(((d) << 24) | ((c) << 16) | ((b) << 8) | (a))) +struct LocAndSize { + /* 0 */ u32 offset; + /* 4 */ u32 size; +}; + +template +struct FileAttributes { + /* 0 */ u32 type; + /* 4 */ u32 num_chunks; + /* 8 */ LocAndSize where[chunks]; +}; + +class loader : public locator { + public: + SoundBank* get_bank_by_handle(u32 id) override; + MusicBank* get_bank_by_name(u32 id) override; + MIDIBlock* get_midi(u32 id) override; + u8* get_bank_samples(u32 id) override; + + void unload_bank(u32 id); + + u32 read_bank(std::fstream& in); + void load_midi(std::fstream& in); + + bool read_midi(); + + private: + void load_samples(u32 bank, std::unique_ptr samples); + u32 read_music_bank(SoundBankData* data); + u32 read_sfx_bank(SFXBlockData* data); + + id_allocator m_id_allocator; + std::unordered_map> m_soundbanks; + + std::vector> m_midi_chunks; + + std::unordered_map m_midi; + + u32 m_next_id{0}; +}; +} // namespace snd diff --git a/game/sound/989snd/locator.h b/game/sound/989snd/locator.h new file mode 100644 index 0000000000..77c1257de1 --- /dev/null +++ b/game/sound/989snd/locator.h @@ -0,0 +1,19 @@ +#pragma once + +#include "common/common_types.h" + +namespace snd { + +class MusicBank; +class SoundBank; +struct MIDIBlock; + +class locator { + public: + virtual ~locator() = default; + virtual SoundBank* get_bank_by_handle(u32 id) = 0; + virtual MusicBank* get_bank_by_name(u32 id) = 0; + virtual u8* get_bank_samples(u32 id) = 0; + virtual MIDIBlock* get_midi(u32 id) = 0; +}; +} // namespace snd diff --git a/game/sound/989snd/midi_handler.cpp b/game/sound/989snd/midi_handler.cpp new file mode 100644 index 0000000000..b2690332a6 --- /dev/null +++ b/game/sound/989snd/midi_handler.cpp @@ -0,0 +1,407 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#include "midi_handler.h" + +#include "ame_handler.h" + +#include + +namespace snd { +/* +** In the original 989snd, the player struct can live in different places +** depending on the type of file. +** +** For files with multiple tracks it lives in-place before the sequence data +** where the file is loaded. For single track (like sunken) it lives separetely +** +** the sequencer ticks at 240hz +** +*/ + +midi_handler::midi_handler(MIDIBlockHeader* block, + voice_manager& vm, + MIDISound& sound, + s32 vol, + s32 pan, + locator& loc, + u32 bank) + : m_sound(sound), + m_locator(loc), + m_repeats(sound.Repeats), + m_bank(bank), + m_header(block), + m_vm(vm) { + if (vol == VOLUME_DONT_CHANGE) { + vol = 1024; + } + + m_vol = (vol * m_sound.Vol) >> 10; + if (m_vol >= 128) { + m_vol = 127; + } + + if (pan == PAN_DONT_CHANGE || pan == PAN_RESET) { + m_pan = m_sound.Pan; + } else { + m_pan = pan; + } + + init_midi(); +} + +midi_handler::midi_handler(MIDIBlockHeader* block, + voice_manager& vm, + MIDISound& sound, + s32 vol, + s32 pan, + locator& loc, + u32 bank, + std::optional parent) + : m_parent(parent), + m_sound(sound), + m_locator(loc), + m_vol(vol), + m_pan(pan), + m_repeats(sound.Repeats), + m_bank(bank), + m_header(block), + m_vm(vm) { + init_midi(); +} + +void midi_handler::init_midi() { + m_seq_data_start = (u8*)((uintptr_t)m_header + (uintptr_t)m_header->DataStart); + m_seq_ptr = m_seq_data_start; + m_tempo = m_header->Tempo; + m_ppq = m_header->PPQ; + m_chanvol.fill(0x7f); + m_chanpan.fill(0); +} + +std::pair midi_handler::read_vlq(u8* value) { + size_t len = 1; + u32 out = *value & 0x7f; + // fmt::print("starting with {:x}\n", *value); + + if ((*value & 0x80) != 0) { + while ((*value & 0x80) != 0) { + len++; + value++; + out = (out << 7) + (*value & 0x7f); + } + } + + return {len, out}; +} + +void midi_handler::pause() { + m_paused = true; + + for (auto& p : m_voices) { + auto voice = p.lock(); + if (voice == nullptr) { + continue; + } + + m_vm.pause(voice); + } +} + +void midi_handler::unpause() { + m_paused = false; + + for (auto& p : m_voices) { + auto voice = p.lock(); + if (voice == nullptr) { + continue; + } + + m_vm.unpause(voice); + } +} + +void midi_handler::stop() { + m_track_complete = true; + + for (auto& p : m_voices) { + auto voice = p.lock(); + if (voice == nullptr) { + continue; + } + + voice->key_off(); + } +} + +void midi_handler::set_vol_pan(s32 vol, s32 pan) { + // TODO +} + +void midi_handler::set_pmod(s32 mod) { + // TODO +} + +void midi_handler::mute_channel(u8 channel) { + // fmt::print("{:x} ame muting channel {}\n", (u64)this, channel); + m_mute_state[channel] = true; +} + +void midi_handler::unmute_channel(u8 channel) { + // fmt::print("{:x} ame unmuting channel {}\n", (u64)this, channel); + m_mute_state[channel] = false; +} + +void midi_handler::note_on() { + u8 channel = m_status & 0xf; + u8 note = m_seq_ptr[0]; + u8 velocity = m_seq_ptr[1]; + + if (velocity == 0) { + note_off(); + return; + } + + if (m_mute_state[channel]) { + m_seq_ptr += 2; + return; + } + + // fmt::print("{:x} {}: [ch{:01x}] note on {:02x} {:02x}\n", (u64)this, m_time, channel, note, + // velocity); + + // Key on all the applicable tones for the program + auto bank = dynamic_cast(m_locator.get_bank_by_name(m_header->BankID)); + auto& program = bank->programs[m_programs[channel]]; + + for (auto& t : program.tones) { + if (note >= t.MapLow && note <= t.MapHigh) { + s16 pan = m_chanpan[channel] + m_pan; + if (pan >= 360) { + pan -= 360; + } + + auto voice = std::make_shared(t); + voice->basevol = m_vm.make_volume_b(m_vol, (velocity * m_chanvol[channel]) / 0x7f, pan, + program.d.Vol, program.d.Pan, t.Vol, t.Pan); + + voice->note = note; + voice->channel = channel; + + voice->start_note = note; + voice->start_fine = 0; + + // TODO + // voice->current_pm = 0; + // voice->current_pb = 0; + + voice->group = m_sound.VolGroup; + m_vm.start_tone(voice); + m_voices.emplace_front(voice); + } + } + + m_seq_ptr += 2; +} + +void midi_handler::note_off() { + u8 channel = m_status & 0xf; + u8 note = m_seq_ptr[0]; + // Yep, no velocity for note-offs + [[maybe_unused]] u8 velocity = m_seq_ptr[1]; + + // fmt::print("{}: note off {:02x} {:02x} {:02x}\n", m_time, m_status, m_seq_ptr[0], + // m_seq_ptr[1]); + + for (auto& v : m_voices) { + auto voice = v.lock(); + if (voice == nullptr) { + continue; + } + + if (voice->channel == channel && voice->note == note) { + voice->key_off(); + } + } + + m_seq_ptr += 2; +} + +void midi_handler::program_change() { + u8 channel = m_status & 0xf; + u8 program = m_seq_ptr[0]; + + m_programs[channel] = program; + + // fmt::print("{:x} {}: [ch{:01x}] program change {:02x} -> {:02x}\n", (u64)this, m_time, channel, + // m_programs[channel], program); + m_seq_ptr += 1; +} + +void midi_handler::channel_pressure() { + u8 channel = m_status & 0xf; + u8 note = m_seq_ptr[0]; + // fmt::print("{}: channel pressure {:02x} {:02x}\n", m_time, m_status, m_seq_ptr[0]); + + for (auto& v : m_voices) { + auto voice = v.lock(); + if (voice == nullptr) { + continue; + } + + if (voice->channel == channel && voice->note == note) { + voice->key_off(); + } + } + + m_seq_ptr += 1; +} + +void midi_handler::channel_pitch() { + u8 channel = m_status & 0xF; + u32 pitch = (m_seq_ptr[0] << 7) | m_seq_ptr[1]; + fmt::print("{}: pitch ch{:01x} {:04x}\n", m_time, channel, pitch); + m_seq_ptr += 2; +} + +void midi_handler::meta_event() { + // fmt::print("{}: meta event {:02x}\n", m_time, *m_seq_ptr); + size_t len = m_seq_ptr[1]; + + if (*m_seq_ptr == 0x2f) { + m_seq_ptr = m_seq_data_start; + + // If repeats was 0 we'll go negative, fail this test, and loop infinitely as intended + m_repeats--; + if (m_repeats == 0) { + m_track_complete = true; + } + + if (m_repeats < 0) { + m_repeats = 0; + } + + return; + } + + if (*m_seq_ptr == 0x51) { + m_tempo = (m_seq_ptr[2] << 16) | (m_seq_ptr[3] << 8) | (m_seq_ptr[4]); + } + + m_seq_ptr += len + 2; +} + +void midi_handler::system_event() { + // fmt::print("{}: system event {:02x}\n", m_time, *m_seq_ptr); + + switch (*m_seq_ptr) { + case 0x75: + m_seq_ptr++; + if (m_parent.has_value()) { + auto [cont, ptr] = m_parent.value()->run_ame(*this, m_seq_ptr); + m_seq_ptr = ptr; + + if (!cont) { + // fmt::print("{:x} track stopped by ame\n", (u64)this); + m_track_complete = true; + } + } else { + throw midi_error("MIDI tried to run AME without an AME handler"); + } + break; + default: + throw midi_error(fmt::format("Unknown system message {:02x}", *m_seq_ptr)); + } +} + +bool midi_handler::tick() { + if (m_paused) { + return m_track_complete; + } + + try { + m_voices.remove_if([](auto& v) { return v.expired(); }); + step(); + } catch (midi_error& e) { + m_track_complete = true; + fmt::print("MIDI Error: {}\n", e.what()); + + fmt::print("Sequence following: "); + for (int i = 0; i < 10; i++) { + fmt::print("{:x} ", m_seq_ptr[i]); + } + fmt::print("\n"); + } + + return m_track_complete; +} + +void midi_handler::new_delta() { + auto [len, delta] = read_vlq(m_seq_ptr); + + m_seq_ptr += len; + m_time += delta; + + m_ppt = 100 * mics_per_tick / (m_tempo / m_ppq); + m_tickdelta = 100 * delta + m_tickerror; + if (m_tickdelta < 0 || m_tickdelta < m_ppt / 2) { + m_tickerror = m_tickdelta; + m_tickdelta = 0; + } + if (m_tickdelta != 0) { + m_tick_countdown = (m_tickdelta / 100 * m_tempo / m_ppq - 1 + mics_per_tick) / mics_per_tick; + m_tickerror = m_tickdelta - m_ppt * m_tick_countdown; + } +} + +void midi_handler::step() { + if (m_get_delta) { + new_delta(); + m_get_delta = false; + } else { + m_tick_countdown--; + } + + while (!m_tick_countdown && !m_track_complete) { + // running status, new events always have top bit + if (*m_seq_ptr & 0x80) { + m_status = *m_seq_ptr; + m_seq_ptr++; + } + + switch (m_status >> 4) { + case 0x8: + note_off(); + break; + case 0x9: + note_on(); + break; + case 0xD: + channel_pressure(); + break; + case 0xC: + program_change(); + break; + case 0xE: + channel_pitch(); + break; + case 0xF: + // normal meta-event + if (m_status == 0xFF) { + meta_event(); + break; + } + if (m_status == 0xF0) { + system_event(); + break; + } + [[fallthrough]]; + default: + throw midi_error(fmt::format("invalid status {}", m_status)); + return; + } + + new_delta(); + } +} + +} // namespace snd diff --git a/game/sound/989snd/midi_handler.h b/game/sound/989snd/midi_handler.h new file mode 100644 index 0000000000..ed27145959 --- /dev/null +++ b/game/sound/989snd/midi_handler.h @@ -0,0 +1,144 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#pragma once +#include +#include +#include +#include +#include +#include + +#include "ame_handler.h" +#include "loader.h" +#include "sound_handler.h" +#include "vagvoice.h" + +#include "common/common_types.h" + +namespace snd { + +struct ProgData { + /* 0 */ s8 NumTones; + /* 1 */ s8 Vol; + /* 2 */ s16 Pan; + /* 4 */ /*Tone**/ u32 FirstTone; +}; + +struct Prog { + ProgData d; + std::vector tones; +}; + +class midi_voice : public vag_voice { + public: + midi_voice(Tone& t) : vag_voice(t) {} + u8 note{0}; + u8 channel{0}; +}; + +class ame_handler; +class midi_handler : public sound_handler { + public: + midi_handler(MIDIBlockHeader* block, + voice_manager& vm, + MIDISound& sound, + s32 vol, + s32 pan, + locator& loc, + u32 bank); + + midi_handler(MIDIBlockHeader* block, + voice_manager& vm, + MIDISound& sound, + s32 vol, + s32 pan, + locator& loc, + u32 bank, + std::optional parent); + + ~midi_handler() override { + for (auto& p : m_voices) { + auto v = p.lock(); + if (v != nullptr) { + v->stop(); + } + } + } + void init_midi(); + void start(); + bool tick() override; + void mute_channel(u8 channel); + void unmute_channel(u8 channel); + u32 bank() override { return m_bank; }; + + void pause() override; + void stop() override; + void unpause() override; + u8 group() override { return m_sound.VolGroup; } + void set_vol_pan(s32 vol, s32 pan) override; + + bool complete() { return m_track_complete; }; + void set_pmod(s32 mod) override; + + private: + static constexpr int tickrate = 240; + static constexpr int mics_per_tick = 1000000 / tickrate; + struct midi_error : public std::exception { + midi_error(std::string text) : msg(std::move(text)) {} + midi_error() : msg("Unknown MIDI error") {} + std::string msg; + const char* what() const noexcept override { return msg.c_str(); } + }; + + std::optional m_parent; + + std::list> m_voices; + + MIDISound& m_sound; + locator& m_locator; + s32 m_vol{0x7f}; + s32 m_pan{0}; + s8 m_repeats{0}; + u32 m_bank; + + bool m_paused{false}; + + MIDIBlockHeader* m_header{nullptr}; + + std::array m_mute_state{}; + std::array m_chanvol{}; + std::array m_chanpan{}; + u8* m_sample_data{nullptr}; + + u8* m_seq_data_start{nullptr}; + u8* m_seq_ptr{nullptr}; + u8 m_status{0}; + u32 m_tempo{500000}; + u32 m_ppq{480}; + u32 m_time{0}; + s32 m_tickerror{0}; + s32 m_tickdelta{0}; + s32 m_ppt{0}; + u64 m_tick_countdown{0}; + bool m_get_delta{true}; + bool m_track_complete{false}; + u32 m_muted_channels{0}; + + std::array m_programs{}; + + voice_manager& m_vm; + + void step(); + void new_delta(); + + void note_on(); + void note_off(); + void channel_pressure(); + void program_change(); + void meta_event(); + void system_event(); + void channel_pitch(); + + static std::pair read_vlq(u8* value); +}; +} // namespace snd diff --git a/game/sound/989snd/musicbank.cpp b/game/sound/989snd/musicbank.cpp new file mode 100644 index 0000000000..d85dcb77f4 --- /dev/null +++ b/game/sound/989snd/musicbank.cpp @@ -0,0 +1,31 @@ +#include "musicbank.h" + +#include "ame_handler.h" +#include "midi_handler.h" + +#include "../common/synth.h" + +namespace snd { +std::unique_ptr MusicBank::make_handler(voice_manager& vm, + u32 sound_id, + s32 vol, + s32 pan, + s32 pm, + s32 pb) { + auto& sound = sounds[sound_id]; + std::unique_ptr handler; + + if (sound.Type == 4) { // midi + auto midi = static_cast(m_locator.get_midi(sound.MIDIID)); + handler = std::make_unique(midi, vm, sound, vol, pan, m_locator, bank_id); + } else if (sound.Type == 5) { // ame + auto midi = static_cast(m_locator.get_midi(sound.MIDIID)); + handler = std::make_unique(midi, vm, sound, vol, pan, m_locator, bank_id); + } else { + // error + } + + return handler; +} + +} // namespace snd diff --git a/game/sound/989snd/musicbank.h b/game/sound/989snd/musicbank.h new file mode 100644 index 0000000000..7033440270 --- /dev/null +++ b/game/sound/989snd/musicbank.h @@ -0,0 +1,77 @@ +#pragma once +#include + +#include "soundbank.h" + +namespace snd { +struct SoundBankData : BankTag { + /* 10 */ s8 BankNum; + /* 11 */ s8 pad1; + /* 12 */ s16 pad2; + /* 14 */ s16 NumSounds; + /* 16 */ s16 NumProgs; + /* 18 */ s16 NumTones; + /* 1a */ s16 NumVAGs; + /* 1c */ /*Sound**/ u32 FirstSound; + /* 20 */ /*Prog**/ u32 FirstProg; + /* 24 */ /*Tone**/ u32 FirstTone; + /* 28 */ /*void**/ u32 VagsInSR; + /* 2c */ u32 VagDataSize; + /* 30 */ /*SoundBank**/ u32 NextBank; +}; + +struct MIDIBlock { + /* 0 */ u32 DataID; + /* 4 */ s16 Version; + /* 6 */ s8 Flags; + /* 7 */ s8 NumMIDIBlocks; + /* 8 */ u32 ID; +}; + +struct MIDIBlockHeader : MIDIBlock { + /* c */ /*void**/ u32 NextMIDIBlock; + /* 10 */ u32 BankID; + /* 14 */ /*SoundBank**/ u32 BankPtr; + /* 18 */ /*s8**/ u32 DataStart; + /* 1c */ /*s8**/ u32 MultiMIDIParent; + /* 20 */ u32 Tempo; + /* 24 */ u32 PPQ; +}; + +struct MultiMIDIBlockHeader : MIDIBlock { + /* c */ /*void**/ u32 NextMIDIBlock; + /* 10 */ /*s8**/ u32 BlockPtr[0]; +}; + +struct MIDISound { + /* 0 */ s32 Type; + /* 4 */ /*SoundBank**/ u32 Bank; + /* 8 */ /*void**/ u32 OrigBank; + /* c */ u32 MIDIID; + /* 10 */ s16 Vol; + /* 12 */ s8 Repeats; + /* 13 */ s8 VolGroup; + /* 14 */ s16 Pan; + /* 16 */ s8 Index; + /* 17 */ s8 Flags; + /* 18 */ /*void**/ u32 MIDIBlock; +}; + +struct Prog; +class MusicBank : public SoundBank { + public: + MusicBank(locator& loc) : m_locator(loc) {} + std::unique_ptr make_handler(voice_manager& vm, + u32 sound_id, + s32 vol, + s32 pan, + s32 pm, + s32 pb) override; + + std::vector programs; + std::vector sounds; + + private: + locator& m_locator; +}; +} // namespace snd diff --git a/game/sound/989snd/player.cpp b/game/sound/989snd/player.cpp new file mode 100644 index 0000000000..b42705653e --- /dev/null +++ b/game/sound/989snd/player.cpp @@ -0,0 +1,287 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#include "player.h" + +#include + +#include + +#ifdef _WIN32 +#include +#endif + +namespace snd { + +player::player() : m_vmanager(m_synth, m_loader) { + init_cubeb(); +} + +player::~player() { + destroy_cubeb(); +} + +void player::init_cubeb() { +#ifdef _WIN32 + HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); + m_coinitialized = SUCCEEDED(hr); + if (FAILED(hr) && hr != RPC_E_CHANGED_MODE) { + fmt::print("Couldn't initialize COM\n"); + fmt::print("Cubeb init failed\n"); + return; + } +#endif + + cubeb_init(&m_ctx, "OpenGOAL", nullptr); + + cubeb_stream_params outparam = {}; + outparam.channels = 2; + outparam.format = CUBEB_SAMPLE_S16LE; + outparam.rate = 48000; + outparam.layout = CUBEB_LAYOUT_STEREO; + outparam.prefs = CUBEB_STREAM_PREF_NONE; + + s32 err = 0; + u32 latency = 0; + err = cubeb_get_min_latency(m_ctx, &outparam, &latency); + if (err != CUBEB_OK) { + fmt::print("Cubeb init failed\n"); + return; + } + + err = cubeb_stream_init(m_ctx, &m_stream, "OpenGOAL", nullptr, nullptr, nullptr, &outparam, + latency, &sound_callback, &state_callback, this); + if (err != CUBEB_OK) { + fmt::print("Cubeb init failed\n"); + return; + } + + err = cubeb_stream_start(m_stream); + if (err != CUBEB_OK) { + fmt::print("Cubeb init failed\n"); + return; + } +} + +void player::destroy_cubeb() { + cubeb_stream_stop(m_stream); + cubeb_stream_destroy(m_stream); + cubeb_destroy(m_ctx); +#ifdef _WIN32 + if (m_coinitialized) { + CoUninitialize(); + m_coinitialized = false; + } +#endif +} + +long player::sound_callback([[maybe_unused]] cubeb_stream* stream, + void* user, + [[maybe_unused]] const void* input, + void* output_buffer, + long nframes) { + ((player*)user)->tick((s16_output*)output_buffer, nframes); + return nframes; +} + +void player::state_callback([[maybe_unused]] cubeb_stream* stream, + [[maybe_unused]] void* user, + [[maybe_unused]] cubeb_state state) {} + +void player::tick(s16_output* stream, int samples) { + std::scoped_lock lock(m_ticklock); + m_tick++; + static int htick = 200; + static int stick = 48000; + for (int i = 0; i < samples; i++) { + // The handlers expect to tick at 240hz + // 48000/240 = 200 + if (htick == 200) { + for (auto it = m_handlers.begin(); it != m_handlers.end();) { + bool done = it->second->tick(); + if (done) { + // fmt::print("erasing handler\n"); + m_handle_allocator.free_id(it->first); + it = m_handlers.erase(it); + } else { + ++it; + } + } + + htick = 0; + } + + if (stick == 48000) { + // fmt::print("{} handlers active\n", m_handlers.size()); + stick = 0; + } + + stick++; + htick++; + *stream++ = m_synth.tick(); + } +} + +u32 player::play_sound(u32 bank_id, u32 sound_id, s32 vol, s32 pan, s32 pm, s32 pb) { + std::scoped_lock lock(m_ticklock); + auto bank = m_loader.get_bank_by_handle(bank_id); + if (bank == nullptr) { + fmt::print("play_sound: Bank {} does not exist\n", bank_id); + return 0; + } + + auto handler = bank->make_handler(m_vmanager, sound_id, vol, pan, pm, pb); + if (handler == nullptr) { + return 0; + } + + u32 handle = m_handle_allocator.get_id(); + m_handlers.emplace(handle, std::move(handler)); + // fmt::print("play_sound {}:{} - {}\n", bank_id, sound_id, handle); + + return handle; +} + +void player::stop_sound(u32 sound_id) { + std::scoped_lock lock(m_ticklock); + auto handler = m_handlers.find(sound_id); + if (handler == m_handlers.end()) + return; + + handler->second->stop(); + + // m_handle_allocator.free_id(sound_id); + // m_handlers.erase(sound_id); +} + +void player::set_midi_reg(u32 sound_id, u8 reg, u8 value) { + std::scoped_lock lock(m_ticklock); + if (m_handlers.find(sound_id) == m_handlers.end()) { + // fmt::print("set_midi_reg: Handler {} does not exist\n", sound_id); + return; + } + + auto* handler = m_handlers.at(sound_id).get(); + handler->set_register(reg, value); +} + +bool player::sound_still_active(u32 sound_id) { + std::scoped_lock lock(m_ticklock); + auto handler = m_handlers.find(sound_id); + if (handler == m_handlers.end()) + return false; + + // fmt::print("sound_still_active {}\n", sound_id); + return true; +} + +void player::set_master_volume(u32 group, s32 volume) { + std::scoped_lock lock(m_ticklock); + if (volume > 0x400) + volume = 0x400; + + if (volume < 0) + volume = 0; + + if (group == 15) + return; + + m_vmanager.set_master_vol(group, volume); + + // Master volume + if (group == 16) { + m_synth.set_master_vol(0x3ffff * volume / 0x400); + } +} + +u32 player::load_bank(std::filesystem::path& filepath, size_t offset) { + std::scoped_lock lock(m_ticklock); + fmt::print("Loading bank {}\n", filepath.string()); + std::fstream in(filepath, std::fstream::binary | std::fstream::in); + in.seekg(offset, std::fstream::beg); + + return m_loader.read_bank(in); +} + +void player::unload_bank(u32 bank_handle) { + std::scoped_lock lock(m_ticklock); + auto* bank = m_loader.get_bank_by_handle(bank_handle); + if (bank == nullptr) + return; + + for (auto it = m_handlers.begin(); it != m_handlers.end();) { + if (it->second->bank() == bank_handle) { + m_handle_allocator.free_id(it->first); + it = m_handlers.erase(it); + } else { + ++it; + } + } + + m_loader.unload_bank(bank_handle); +} + +void player::set_pan_table(vol_pair* pantable) { + std::scoped_lock lock(m_ticklock); + m_vmanager.set_pan_table(pantable); +} + +void player::set_playback_mode(s32 mode) { + std::scoped_lock lock(m_ticklock); + m_vmanager.set_playback_mode(mode); +} + +void player::pause_sound(s32 sound_id) { + std::scoped_lock lock(m_ticklock); + auto handler = m_handlers.find(sound_id); + if (handler == m_handlers.end()) + return; + + handler->second->pause(); +} + +void player::continue_sound(s32 sound_id) { + std::scoped_lock lock(m_ticklock); + auto handler = m_handlers.find(sound_id); + if (handler == m_handlers.end()) + return; + + handler->second->unpause(); +} + +void player::pause_all_sounds_in_group(u8 group) { + std::scoped_lock lock(m_ticklock); + + for (auto& h : m_handlers) { + if ((1 << h.second->group()) & group) { + h.second->pause(); + } + } +} + +void player::continue_all_sounds_in_group(u8 group) { + std::scoped_lock lock(m_ticklock); + + for (auto& h : m_handlers) { + if ((1 << h.second->group()) & group) { + h.second->unpause(); + } + } +} + +void player::set_sound_vol_pan(s32 sound_id, s32 vol, s32 pan) { + std::scoped_lock lock(m_ticklock); + auto handler = m_handlers.find(sound_id); + if (handler == m_handlers.end()) + return; + + handler->second->set_vol_pan(vol, pan); +} + +void player::set_sound_pmod(s32 sound_handle, s32 mod) { + auto handler = m_handlers.find(sound_handle); + if (handler == m_handlers.end()) + return; + + handler->second->set_pmod(mod); +} +} // namespace snd diff --git a/game/sound/989snd/player.h b/game/sound/989snd/player.h new file mode 100644 index 0000000000..e2a6ffcceb --- /dev/null +++ b/game/sound/989snd/player.h @@ -0,0 +1,82 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#pragma once +#include +#include +#include +#include +#include + +#include "ame_handler.h" +#include "handle_allocator.h" +#include "loader.h" +#include "midi_handler.h" +#include "sound_handler.h" + +#include "common/common_types.h" + +#include "../common/synth.h" +#include "game/sound/989snd/vagvoice.h" + +#include "third-party/cubeb/cubeb/include/cubeb/cubeb.h" + +namespace snd { + +class player { + public: + player(); + ~player(); + player(const player&) = delete; + player operator=(const player&) = delete; + + // player(player&& other) noexcept = default; + // player& operator=(player&& other) noexcept = default; + + u32 load_bank(std::filesystem::path& path, size_t offset); + + u32 play_sound(u32 bank, u32 sound, s32 vol, s32 pan, s32 pm, s32 pb); + void set_midi_reg(u32 sound_id, u8 reg, u8 value); + bool sound_still_active(u32 sound_id); + void set_master_volume(u32 group, s32 volume); + void unload_bank(u32 bank_handle); + void stop_sound(u32 sound_handle); + void set_pan_table(vol_pair* pantable); + void set_playback_mode(s32 mode); + void pause_sound(s32 sound_handle); + void continue_sound(s32 sound_handle); + void pause_all_sounds_in_group(u8 group); + void continue_all_sounds_in_group(u8 group); + void set_sound_vol_pan(s32 sound_handle, s32 vol, s32 pan); + void submit_voice(std::shared_ptr& voice) { m_synth.add_voice(voice); }; + void set_sound_pmod(s32 sound_handle, s32 mod); + void init_cubeb(); + void destroy_cubeb(); + s32 get_tick() { return m_tick; }; + + private: + std::recursive_mutex m_ticklock; // TODO does not need to recursive with some light restructuring + id_allocator m_handle_allocator; + std::unordered_map> m_handlers; + + void tick(s16_output* stream, int samples); + +#ifdef _WIN32 + bool m_coinitialized = false; +#endif + + loader m_loader; + synth m_synth; + voice_manager m_vmanager; + s32 m_tick{0}; + + cubeb* m_ctx{nullptr}; + cubeb_stream* m_stream{nullptr}; + + static long sound_callback(cubeb_stream* stream, + void* user, + const void* input, + void* output_buffer, + long len); + static void state_callback(cubeb_stream* stream, void* user, cubeb_state state); +}; +} // namespace snd diff --git a/game/sound/989snd/sfxblock.cpp b/game/sound/989snd/sfxblock.cpp new file mode 100644 index 0000000000..96c7196612 --- /dev/null +++ b/game/sound/989snd/sfxblock.cpp @@ -0,0 +1,25 @@ +#include "sfxblock.h" + +#include "blocksound_handler.h" + +namespace snd { +std::unique_ptr SFXBlock::make_handler(voice_manager& vm, + u32 sound_id, + s32 vol, + s32 pan, + s32 pm, + s32 pb) { + std::unique_ptr handler; + auto& SFX = sounds[sound_id]; + + if (SFX.grains.empty()) { + // fmt::print("skipping empty sfx\n"); + return nullptr; + } + + handler = std::make_unique(sounds[sound_id], vm, vol, pan, pm, pb, bank_id); + handler->init(); + return handler; +} + +} // namespace snd diff --git a/game/sound/989snd/sfxblock.h b/game/sound/989snd/sfxblock.h new file mode 100644 index 0000000000..83cae18384 --- /dev/null +++ b/game/sound/989snd/sfxblock.h @@ -0,0 +1,128 @@ +#pragma once +#include + +#include "soundbank.h" + +namespace snd { + +struct SFXBlockData : BankTag { + /* 10 */ s8 BlockNum; + /* 11 */ s8 pad1; + /* 12 */ s16 pad2; + /* 14 */ s16 pad3; + /* 16 */ s16 NumSounds; + /* 18 */ s16 NumGrains; + /* 1a */ s16 NumVAGs; + /* 1c */ u32 FirstSound; + /* 20 */ u32 FirstGrain; + /* 24 */ u32 VagsInSR; + /* 28 */ u32 VagDataSize; + /* 2c */ u32 SRAMAllocSize; + /* 30 */ u32 NextBlock; + /* 34 */ u32 BlockNames; + /* 38 */ u32 SFXUD; +}; + +static_assert(sizeof(SFXBlockData) == 0x38 + 4); + +struct XREFGrainParams { + /* 0 */ u32 BankID; + /* 4 */ u32 SoundIndex; + /* 8 */ s32 PitchMod; + /* c */ u32 Flags; +}; + +struct RandDelayParams { + /* 0 */ s32 Amount; +}; + +struct ControlParams { + /* 0 */ s16 param[4]; +}; + +struct LFOParams { + /* 0 */ u8 which_lfo; + /* 1 */ u8 target; + /* 2 */ u8 target_extra; + /* 3 */ u8 shape; + /* 4 */ u16 duty_cycle; + /* 6 */ u16 depth; + /* 8 */ u16 flags; + /* a */ u16 start_offset; + /* c */ u32 step_size; +}; + +struct PlaySoundParams { + /* 0 */ s32 vol; + /* 4 */ s32 pan; + /* 8 */ s8 reg_settings[4]; + /* c */ s32 sound_id; + /* 10 */ char snd_name[16]; +}; + +struct PluginParams { + /* 0 */ u32 id; + /* 4 */ u32 index; + /* 8 */ u8 data[24]; +}; + +struct LargestGrainParamStruct { + /* 0 */ char blank[32]; +}; + +/* +** Type 1 = Tone +*/ + +struct SFXGrain { + /* 0 */ u32 Type; + /* 4 */ s32 Delay; + union { + /* 8 */ Tone tone; + /* 8 */ XREFGrainParams xref; + /* 8 */ RandDelayParams delay; + /* 8 */ ControlParams control; + /* 8 */ LFOParams lfo; + /* 8 */ PlaySoundParams play_sound; + /* 8 */ PluginParams plugin_params; + /* 8 */ LargestGrainParamStruct junk; + } GrainParams; +}; + +struct SFXData { + /* 0 */ s8 Vol; + /* 1 */ s8 VolGroup; + /* 2 */ s16 Pan; + /* 4 */ s8 NumGrains; + /* 5 */ s8 InstanceLimit; + /* 6 */ u16 Flags; + /* 8 */ u32 FirstGrain; +}; + +enum SFXFlags { + Looper = 1, + SoloSound = 2, // Stop previous instances +}; + +struct SFX { + SFXData d; + std::vector grains; +}; + +class SFXBlock : public SoundBank { + public: + SFXBlock(locator& loc) : m_locator(loc) {} + std::unique_ptr make_handler(voice_manager& vm, + u32 sound_id, + s32 vol, + s32 pan, + s32 pm, + s32 pb) override; + + std::vector sounds; + + private: + locator& m_locator; +}; + +} // namespace snd diff --git a/game/sound/989snd/sndplay.cpp b/game/sound/989snd/sndplay.cpp new file mode 100644 index 0000000000..b0d5f2cdf0 --- /dev/null +++ b/game/sound/989snd/sndplay.cpp @@ -0,0 +1,29 @@ +#include + +#include "player.h" + +int main(int argc, char* argv[]) { + snd::player player; + unsigned bankid = 0; + + std::filesystem::path file = argv[1]; + + if (argc > 2) { + bankid = player.load_bank(file, 0); + unsigned sound = player.play_sound(bankid, atoi(argv[2]), 0x400, 0, 0, 0); + fmt::print("sound {} started\n", sound); + } + + while (true) { + timespec rqtp{}, rmtp{}; + rqtp.tv_nsec = 0; + rqtp.tv_sec = 1; +#ifdef __linux + if (nanosleep(&rqtp, &rmtp) == -1) { + break; + } +#endif + } + + return 0; +} diff --git a/game/sound/989snd/sound_handler.h b/game/sound/989snd/sound_handler.h new file mode 100644 index 0000000000..0550c56d33 --- /dev/null +++ b/game/sound/989snd/sound_handler.h @@ -0,0 +1,25 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#pragma once + +#include "common/common_types.h" + +static constexpr int PAN_RESET = -1; +static constexpr int PAN_DONT_CHANGE = -2; +static constexpr int VOLUME_DONT_CHANGE = 0x7fffffff; + +namespace snd { +class sound_handler { + public: + virtual ~sound_handler() = default; + virtual bool tick() = 0; + virtual u32 bank() = 0; + virtual void pause() = 0; + virtual void unpause() = 0; + virtual u8 group() = 0; + virtual void stop() = 0; + virtual void set_vol_pan(s32 vol, s32 pan) = 0; + virtual void set_pmod(s32 mod) = 0; + virtual void set_register(u8 /*reg*/, u8 /*value*/) {} +}; +} // namespace snd diff --git a/game/sound/989snd/soundbank.h b/game/sound/989snd/soundbank.h new file mode 100644 index 0000000000..099b98e6f6 --- /dev/null +++ b/game/sound/989snd/soundbank.h @@ -0,0 +1,41 @@ +#pragma once +#include + +#include "locator.h" +#include "sound_handler.h" +#include "vagvoice.h" + +#include "common/common_types.h" + +#include "../common/synth.h" + +namespace snd { +struct BankTag { + /* 0 */ u32 DataID; + /* 4 */ u32 Version; + /* 8 */ u32 Flags; + /* c */ u32 BankID; +}; + +enum class BankType { + Music, + SFX, +}; + +class SoundBank { + public: + virtual ~SoundBank() = default; + BankType type; + virtual std::unique_ptr make_handler(voice_manager& vm, + u32 sound_id, + s32 vol, + s32 pan, + s32 pm, + s32 pb) = 0; + + u32 bank_id; + u32 bank_name; + std::unique_ptr sampleBuf; +}; + +} // namespace snd diff --git a/game/sound/989snd/util.cpp b/game/sound/989snd/util.cpp new file mode 100644 index 0000000000..52b9f9b97b --- /dev/null +++ b/game/sound/989snd/util.cpp @@ -0,0 +1,141 @@ +#include "util.h" + +namespace snd { +const u16 NotePitchTable[] = { + 0x8000, 0x879C, 0x8FAC, 0x9837, 0xA145, 0xAADC, 0xB504, 0xBFC8, 0xCB2F, 0xD744, 0xE411, 0xF1A1, + 0x8000, 0x800E, 0x801D, 0x802C, 0x803B, 0x804A, 0x8058, 0x8067, 0x8076, 0x8085, 0x8094, 0x80A3, + 0x80B1, 0x80C0, 0x80CF, 0x80DE, 0x80ED, 0x80FC, 0x810B, 0x811A, 0x8129, 0x8138, 0x8146, 0x8155, + 0x8164, 0x8173, 0x8182, 0x8191, 0x81A0, 0x81AF, 0x81BE, 0x81CD, 0x81DC, 0x81EB, 0x81FA, 0x8209, + 0x8218, 0x8227, 0x8236, 0x8245, 0x8254, 0x8263, 0x8272, 0x8282, 0x8291, 0x82A0, 0x82AF, 0x82BE, + 0x82CD, 0x82DC, 0x82EB, 0x82FA, 0x830A, 0x8319, 0x8328, 0x8337, 0x8346, 0x8355, 0x8364, 0x8374, + 0x8383, 0x8392, 0x83A1, 0x83B0, 0x83C0, 0x83CF, 0x83DE, 0x83ED, 0x83FD, 0x840C, 0x841B, 0x842A, + 0x843A, 0x8449, 0x8458, 0x8468, 0x8477, 0x8486, 0x8495, 0x84A5, 0x84B4, 0x84C3, 0x84D3, 0x84E2, + 0x84F1, 0x8501, 0x8510, 0x8520, 0x852F, 0x853E, 0x854E, 0x855D, 0x856D, 0x857C, 0x858B, 0x859B, + 0x85AA, 0x85BA, 0x85C9, 0x85D9, 0x85E8, 0x85F8, 0x8607, 0x8617, 0x8626, 0x8636, 0x8645, 0x8655, + 0x8664, 0x8674, 0x8683, 0x8693, 0x86A2, 0x86B2, 0x86C1, 0x86D1, 0x86E0, 0x86F0, 0x8700, 0x870F, + 0x871F, 0x872E, 0x873E, 0x874E, 0x875D, 0x876D, 0x877D, 0x878C}; + +u16 sceSdNote2Pitch(u16 center_note, u16 center_fine, u16 note, short fine) { + s32 _fine; + s32 _fine2; + s32 _note; + s32 offset1, offset2; + s32 val; + s32 val2; + s32 val3; + s32 ret; + + _fine = fine + (u16)center_fine; + _fine2 = _fine; + + if (_fine < 0) + _fine2 = _fine + 127; + + _fine2 = _fine2 / 128; + _note = note + _fine2 - center_note; + val3 = _note / 6; + + if (_note < 0) + val3--; + + offset2 = _fine - _fine2 * 128; + + if (_note < 0) + val2 = -1; + else + val2 = 0; + if (val3 < 0) + val3--; + + val2 = (val3 / 2) - val2; + val = val2 - 2; + offset1 = _note - (val2 * 12); + + if ((offset1 < 0) || ((offset1 == 0) && (offset2 < 0))) { + offset1 = offset1 + 12; + val = val2 - 3; + } + + if (offset2 < 0) { + offset1 = (offset1 - 1) + _fine2; + offset2 += (_fine2 + 1) * 128; + } + + ret = (NotePitchTable[offset1] * NotePitchTable[offset2 + 12]) / 0x10000; + + if (val < 0) + ret = (ret + (1 << (-val - 1))) >> -val; + + return (u16)ret; +} + +const vol_pair normalPanTable[181] = { + {0x3fff, 0x0000}, {0x3ffe, 0x008e}, {0x3ffc, 0x011d}, {0x3ff9, 0x01ac}, {0x3ff5, 0x023b}, + {0x3fef, 0x02ca}, {0x3fe8, 0x0359}, {0x3fe0, 0x03e8}, {0x3fd7, 0x0476}, {0x3fcc, 0x0505}, + {0x3fc0, 0x0593}, {0x3fb3, 0x0622}, {0x3fa5, 0x06b0}, {0x3f95, 0x073e}, {0x3f84, 0x07cc}, + {0x3f72, 0x085a}, {0x3f5f, 0x08e8}, {0x3f4b, 0x0975}, {0x3f35, 0x0a02}, {0x3f1e, 0x0a8f}, + {0x3f06, 0x0b1c}, {0x3eec, 0x0ba9}, {0x3ed1, 0x0c36}, {0x3eb6, 0x0cc2}, {0x3e98, 0x0d4e}, + {0x3e7a, 0x0dd9}, {0x3e5b, 0x0e65}, {0x3e3a, 0x0ef0}, {0x3e18, 0x0f7b}, {0x3df5, 0x1005}, + {0x3dd0, 0x1090}, {0x3dab, 0x111a}, {0x3d84, 0x11a3}, {0x3d5c, 0x122d}, {0x3d33, 0x12b5}, + {0x3d08, 0x133e}, {0x3cdd, 0x13c6}, {0x3cb0, 0x144e}, {0x3c82, 0x14d5}, {0x3c53, 0x155c}, + {0x3c22, 0x15e3}, {0x3bf1, 0x1669}, {0x3bbe, 0x16ef}, {0x3b8b, 0x1774}, {0x3b56, 0x17f9}, + {0x3b1f, 0x187d}, {0x3ae8, 0x1901}, {0x3ab0, 0x1984}, {0x3a76, 0x1a07}, {0x3a3b, 0x1a89}, + {0x3a00, 0x1b0b}, {0x39c3, 0x1b8d}, {0x3984, 0x1c0d}, {0x3945, 0x1c8e}, {0x3905, 0x1d0d}, + {0x38c3, 0x1d8c}, {0x3881, 0x1e0b}, {0x383d, 0x1e89}, {0x37f8, 0x1f06}, {0x37b3, 0x1f83}, + {0x376c, 0x1fff}, {0x3724, 0x207b}, {0x36da, 0x20f5}, {0x3690, 0x2170}, {0x3645, 0x21e9}, + {0x35f9, 0x2262}, {0x35ab, 0x22da}, {0x355d, 0x2352}, {0x350e, 0x23c9}, {0x34bd, 0x243f}, + {0x346c, 0x24b4}, {0x3419, 0x2529}, {0x33c6, 0x259d}, {0x3371, 0x2610}, {0x331c, 0x2683}, + {0x32c5, 0x26f5}, {0x326d, 0x2766}, {0x3215, 0x27d6}, {0x31bb, 0x2846}, {0x3161, 0x28b4}, + {0x3106, 0x2922}, {0x30a9, 0x298f}, {0x304c, 0x29fc}, {0x2fee, 0x2a67}, {0x2f8e, 0x2ad2}, + {0x2f2e, 0x2b3c}, {0x2ecd, 0x2ba5}, {0x2e6b, 0x2c0d}, {0x2e08, 0x2c74}, {0x2da5, 0x2cda}, + {0x2d40, 0x2d40}, {0x2cda, 0x2da5}, {0x2c74, 0x2e08}, {0x2c0d, 0x2e6b}, {0x2ba5, 0x2ecd}, + {0x2b3c, 0x2f2e}, {0x2ad2, 0x2f8e}, {0x2a67, 0x2fee}, {0x29fc, 0x304c}, {0x298f, 0x30a9}, + {0x2922, 0x3106}, {0x28b4, 0x3161}, {0x2846, 0x31bb}, {0x27d6, 0x3215}, {0x2766, 0x326d}, + {0x26f5, 0x32c5}, {0x2683, 0x331c}, {0x2610, 0x3371}, {0x259d, 0x33c6}, {0x2529, 0x3419}, + {0x24b4, 0x346c}, {0x243f, 0x34bd}, {0x23c9, 0x350e}, {0x2352, 0x355d}, {0x22da, 0x35ab}, + {0x2262, 0x35f9}, {0x21e9, 0x3645}, {0x2170, 0x3690}, {0x20f5, 0x36da}, {0x207b, 0x3724}, + {0x1fff, 0x376c}, {0x1f83, 0x37b3}, {0x1f06, 0x37f8}, {0x1e89, 0x383d}, {0x1e0b, 0x3881}, + {0x1d8c, 0x38c3}, {0x1d0d, 0x3905}, {0x1c8e, 0x3945}, {0x1c0d, 0x3984}, {0x1b8d, 0x39c3}, + {0x1b0b, 0x3a00}, {0x1a89, 0x3a3b}, {0x1a07, 0x3a76}, {0x1984, 0x3ab0}, {0x1901, 0x3ae8}, + {0x187d, 0x3b1f}, {0x17f9, 0x3b56}, {0x1774, 0x3b8b}, {0x16ef, 0x3bbe}, {0x1669, 0x3bf1}, + {0x15e3, 0x3c22}, {0x155c, 0x3c53}, {0x14d5, 0x3c82}, {0x144e, 0x3cb0}, {0x13c6, 0x3cdd}, + {0x133e, 0x3d08}, {0x12b5, 0x3d33}, {0x122d, 0x3d5c}, {0x11a3, 0x3d84}, {0x111a, 0x3dab}, + {0x1090, 0x3dd0}, {0x1005, 0x3df5}, {0x0f7b, 0x3e18}, {0x0ef0, 0x3e3a}, {0x0e65, 0x3e5b}, + {0x0dd9, 0x3e7a}, {0x0d4e, 0x3e98}, {0x0cc2, 0x3eb6}, {0x0c36, 0x3ed1}, {0x0ba9, 0x3eec}, + {0x0b1c, 0x3f06}, {0x0a8f, 0x3f1e}, {0x0a02, 0x3f35}, {0x0975, 0x3f4b}, {0x08e8, 0x3f5f}, + {0x085a, 0x3f72}, {0x07cc, 0x3f84}, {0x073e, 0x3f95}, {0x06b0, 0x3fa5}, {0x0622, 0x3fb3}, + {0x0593, 0x3fc0}, {0x0505, 0x3fcc}, {0x0476, 0x3fd7}, {0x03e8, 0x3fe0}, {0x0359, 0x3fe8}, + {0x02ca, 0x3fef}, {0x023b, 0x3ff5}, {0x01ac, 0x3ff9}, {0x011d, 0x3ffc}, {0x008e, 0x3ffe}, +}; + +u16 PS1Note2Pitch(s8 center_note, s8 center_fine, short note, short fine) { + bool ps1_note = false; + if (center_note >= 0) { + ps1_note = true; + } else { + center_note = -center_note; + } + + u16 pitch = sceSdNote2Pitch(center_note, center_fine, note, fine); + if (ps1_note) { + pitch = 44100 * pitch / 48000; + } + + return pitch; +} + +std::pair pitchbend(Tone& tone, + int current_pb, + int current_pm, + int start_note, + int start_fine) { + auto v9 = (start_note << 7) + start_fine + current_pm; + u32 v7; + if (current_pb >= 0) + v7 = tone.PBHigh * (current_pb << 7) / 0x7fff + v9; + else + v7 = tone.PBLow * (current_pb << 7) / 0x7fff + v9; + return {v7 / 128, v7 % 128}; +} + +} // namespace snd diff --git a/game/sound/989snd/util.h b/game/sound/989snd/util.h new file mode 100644 index 0000000000..809871c3df --- /dev/null +++ b/game/sound/989snd/util.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +#include "common/common_types.h" + +#include "game/sound/989snd/vagvoice.h" + +namespace snd { + +extern const u16 NotePitchTable[]; +extern const vol_pair normalPanTable[181]; + +u16 PS1Note2Pitch(s8 center_note, s8 center_fine, short note, short fine); +u16 sceSdNote2Pitch(u16 center_note, u16 center_fine, u16 note, short fine); +std::pair pitchbend(Tone& tone, + int current_pb, + int current_pm, + int start_note, + int start_fine); + +} // namespace snd diff --git a/game/sound/989snd/vagvoice.cpp b/game/sound/989snd/vagvoice.cpp new file mode 100644 index 0000000000..2a5cbcca59 --- /dev/null +++ b/game/sound/989snd/vagvoice.cpp @@ -0,0 +1,224 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#include "vagvoice.h" + +#include + +#include "util.h" + +#include "../common/voice.h" + +namespace snd { +voice_manager::voice_manager(synth& synth, locator& loc) : m_synth(synth), m_locator(loc) { + m_pan_table = normalPanTable; + m_master_vol.fill(0x400); + m_group_duck.fill(0x10000); +} + +void voice_manager::start_tone(std::shared_ptr voice) { + s16 left = adjust_vol_to_group(voice->basevol.left, voice->group); + s16 right = adjust_vol_to_group(voice->basevol.right, voice->group); + + voice->set_volume(left >> 1, right >> 1); + + if ((voice->tone.Flags & 0x10) != 0x0) { + throw std::runtime_error("reverb only voice not handler"); + } + + std::pair note = pitchbend(voice->tone, voice->current_pb, voice->current_pm, + voice->start_note, voice->start_fine); + + auto pitch = + PS1Note2Pitch(voice->tone.CenterNote, voice->tone.CenterFine, note.first, note.second); + + voice->set_pitch(pitch); + voice->set_asdr1(voice->tone.ADSR1); + voice->set_asdr2(voice->tone.ADSR2); + + u8* sbuf = m_locator.get_bank_samples(voice->tone.BankID); + voice->set_sample((u16*)(sbuf + voice->tone.VAGInSR)); + + voice->key_on(); + + clean_voices(); + m_voices.emplace_front(voice); + m_synth.add_voice(voice); +} +vol_pair voice_manager::make_volume(int vol1, int pan1, int vol2, int pan2, int vol3, int pan3) { + // Scale up as close as we can to max positive 16bit volume + // I'd have just used shifting but I guess this does get closer + + s32 vol = vol1 * 258; + vol = (vol * vol2) / 0x7f; + vol = (vol * vol3) / 0x7f; + + // volume accurate up to here for sure + if (vol == 0) { + return {0, 0}; + } + + if (m_stereo_or_mono == 1) { + return {(s16)vol, (s16)vol}; + } + + int total_pan = pan1 + pan3 + pan2; + while (total_pan >= 360) { + total_pan -= 360; + } + + while (total_pan < 0) { + total_pan += 360; + } + + if (total_pan >= 270) { + total_pan -= 270; + } else { + total_pan += 90; + } + + // fmt::print("total pan {}\n", total_pan); + s16 lvol = 0; + s16 rvol = 0; + + // TODO Presumable for the purposes of some effects this function needs + // to know the sign of the previous volume so that it can maintain + // it. (For surround audio positioning?) + + if (total_pan < 180) { + lvol = (m_pan_table[total_pan].left * vol) / 0x3fff; + rvol = (m_pan_table[total_pan].right * vol) / 0x3fff; + } else { + rvol = (m_pan_table[total_pan - 180].left * vol) / 0x3fff; + lvol = (m_pan_table[total_pan - 180].right * vol) / 0x3fff; + } + + // TODO rest of this function + // there is a whole bunch of math depending on what the volume was previously? + + return {lvol, rvol}; +} + +vol_pair voice_manager::make_volume_b(int sound_vol, + int velocity_volume, + int pan, + int prog_vol, + int prog_pan, + int tone_vol, + int tone_pan) { + // Scale up as close as we can to max positive 16bit volume + // I'd have just used shifting but I guess this does get closer + + s32 vol = sound_vol * 258; + vol = (vol * velocity_volume) / 0x7f; + vol = (vol * prog_vol) / 0x7f; + vol = (vol * tone_vol) / 0x7f; + + // volume accurate up to here for sure + if (vol == 0) { + return {0, 0}; + } + + if (m_stereo_or_mono == 1) { + return {(s16)vol, (s16)vol}; + } + + int total_pan = pan + tone_pan + prog_pan; + while (total_pan >= 360) { + total_pan -= 360; + } + + while (total_pan < 0) { + total_pan += 360; + } + + if (total_pan >= 270) { + total_pan -= 270; + } else { + total_pan += 90; + } + + // fmt::print("total pan {}\n", total_pan); + s16 lvol = 0; + s16 rvol = 0; + + // TODO Presumable for the purposes of some effects this function needs + // to know the sign of the previous volume so that it can maintain + // it. (For surround audio positioning?) + + if (total_pan < 180) { + lvol = (m_pan_table[total_pan].left * vol) / 0x3fff; + rvol = (m_pan_table[total_pan].right * vol) / 0x3fff; + } else { + rvol = (m_pan_table[total_pan - 180].left * vol) / 0x3fff; + lvol = (m_pan_table[total_pan - 180].right * vol) / 0x3fff; + } + + // TODO rest of this function + // there is a whole bunch of math depending on what the volume was previously? + + return {lvol, rvol}; +} + +s16 voice_manager::adjust_vol_to_group(s16 involume, int group) { + s32 volume = involume; + // NOTE grou >= 7 in version 2 + if (group >= 15) + return volume; + + if (volume >= 0x7fff) + volume = 0x7ffe; + + // NOTE no duckers in version 2 + s32 modifier = (m_master_vol[group] * m_group_duck[group]) / 0x10000; + volume = (volume * modifier) / 0x400; + int sign = 1; + if (volume < 0) { + sign = -1; + } + + // fmt::print("made volume {:x} -> {:x}\n", involume, volume); + s16 retval = static_cast((volume * volume) / 0x7ffe * sign); + return retval; +} + +void voice_manager::set_master_vol(u8 group, s32 volume) { + m_master_vol[group] = volume; + + for (auto& p : m_voices) { + auto voice = p.lock(); + if (voice == nullptr || voice->paused) { + continue; + } + + if (voice->group == group) { + s16 left = adjust_vol_to_group(voice->basevol.left, voice->group); + s16 right = adjust_vol_to_group(voice->basevol.right, voice->group); + + voice->set_volume(left >> 1, right >> 1); + } + } +} + +void voice_manager::pause(std::shared_ptr voice) { + voice->set_volume(0, 0); + voice->set_pitch(0); + voice->paused = true; +} + +void voice_manager::unpause(std::shared_ptr voice) { + s16 left = adjust_vol_to_group(voice->basevol.left, voice->group); + s16 right = adjust_vol_to_group(voice->basevol.right, voice->group); + + voice->set_volume(left >> 1, right >> 1); + + std::pair note = pitchbend(voice->tone, voice->current_pb, voice->current_pm, + voice->start_note, voice->start_fine); + + auto pitch = + PS1Note2Pitch(voice->tone.CenterNote, voice->tone.CenterFine, note.first, note.second); + + voice->set_pitch(pitch); + voice->paused = false; +} + +}; // namespace snd diff --git a/game/sound/989snd/vagvoice.h b/game/sound/989snd/vagvoice.h new file mode 100644 index 0000000000..5ce8544e99 --- /dev/null +++ b/game/sound/989snd/vagvoice.h @@ -0,0 +1,95 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#pragma once +#include +#include + +#include "locator.h" + +#include "common/common_types.h" + +#include "game/sound/common/synth.h" +#include "game/sound/common/voice.h" + +namespace snd { + +enum class toneflag : u16 { + out_reverb = 1, + out_dry = 0x10, +}; + +struct Tone { + /* 0 */ s8 Priority; + /* 1 */ s8 Vol; + /* 2 */ s8 CenterNote; + /* 3 */ s8 CenterFine; + /* 4 */ s16 Pan; + /* 6 */ s8 MapLow; + /* 7 */ s8 MapHigh; + /* 8 */ s8 PBLow; + /* 9 */ s8 PBHigh; + /* a */ s16 ADSR1; + /* c */ s16 ADSR2; + /* e */ s16 Flags; + /* 10 */ /*void**/ u32 VAGInSR; + ///* 14 */ u32 reserved1; confiscated + + // FIXME I'd rather restructure things than mess about like this. + // If we have to edit the structs they should't be loaded like this + /* 14 */ u32 BankID; +}; + +class vag_voice : public voice { + public: + vag_voice(Tone& t) : tone(t) {} + Tone& tone; + u8 group{0}; + vol_pair basevol{}; + s32 current_pm{0}; + s32 current_pb{0}; + s32 start_note{0}; + s32 start_fine{0}; + bool paused{false}; +}; + +class voice_manager { + public: + voice_manager(synth& synth, locator& loc); + void start_tone(std::shared_ptr voice); + void pause(std::shared_ptr voice); + void unpause(std::shared_ptr voice); + void set_pan_table(vol_pair* table) { m_pan_table = table; }; + + vol_pair make_volume(int vol1, int pan1, int vol2, int pan2, int vol3, int pan3); + + // This is super silly, but it's what 989snd does + vol_pair make_volume_b(int sound_vol, + int velocity_volume, + int pan, + int prog_vol, + int prog_pan, + int tone_vol, + int tone_pan); + + void set_master_vol(u8 group, s32 volume); + void set_playback_mode(s32 mode) { m_stereo_or_mono = mode; } + s16 adjust_vol_to_group(s16 involume, int group); + + private: + synth& m_synth; + locator& m_locator; + + std::list> m_voices; + void clean_voices() { + m_voices.remove_if([](auto& v) { return v.expired(); }); + } + + s32 m_stereo_or_mono{0}; + + std::array m_master_vol; + std::array m_group_duck; + + const vol_pair* m_pan_table{nullptr}; +}; + +} // namespace snd diff --git a/game/sound/CMakeLists.txt b/game/sound/CMakeLists.txt new file mode 100644 index 0000000000..4dc75ba4a3 --- /dev/null +++ b/game/sound/CMakeLists.txt @@ -0,0 +1,38 @@ +set(CMAKE_CXX_STANDARD 17) + +set(SOUND_SOURCES + 989snd/player.cpp + 989snd/midi_handler.cpp + 989snd/ame_handler.cpp + 989snd/blocksound_handler.cpp + 989snd/musicbank.cpp + 989snd/sfxblock.cpp + 989snd/loader.cpp + 989snd/vagvoice.cpp + 989snd/util.cpp + common/synth.cpp + common/voice.cpp + common/envelope.cpp + sndshim.cpp + sdshim.cpp + ) + +add_library(sound STATIC ${SOUND_SOURCES}) +target_link_libraries(sound PRIVATE fmt cubeb) + +add_executable(sndplay 989snd/sndplay.cpp) +if(WIN32) + target_link_libraries(sndplay PRIVATE sound cubeb) +else() + target_link_libraries(sndplay PRIVATE sound cubeb stdc++fs) +endif() + +if (NOT WIN32) + target_compile_options(sound + PRIVATE + -Wno-unknown-warning-option + -Wno-unused-private-field + -Wno-unused-parameter + -Wno-shadow + ) +endif() \ No newline at end of file diff --git a/game/sound/common/bitfield.h b/game/sound/common/bitfield.h new file mode 100644 index 0000000000..a657869be8 --- /dev/null +++ b/game/sound/common/bitfield.h @@ -0,0 +1,21 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#pragma once + +/* Bitfield convenience class for use with unions + * should be allowed as per common initial subsequence rule regarding unions */ +template +class bitfield { + public: + constexpr type get() { return static_cast((underlying >> pos) & mask()); }; + + constexpr void set(type value) { + underlying &= ~(mask() << pos); + underlying |= (value & mask()) << pos; + }; + + private: + sourcetype underlying; + + constexpr int mask() { return (1 << width) - 1; }; +}; diff --git a/game/sound/common/envelope.cpp b/game/sound/common/envelope.cpp new file mode 100644 index 0000000000..372dee0a40 --- /dev/null +++ b/game/sound/common/envelope.cpp @@ -0,0 +1,165 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC + +#include "envelope.h" + +#include +#include + +namespace snd { +void Envelope::Step() { + // arbitrary number of bits, this is probably incorrect for the + // "reserved" and infinite duration values + // test hw or copy mednafen instead? + u32 cStep = 0x800000; + + s32 shift = m_Shift - 11; + if (shift > 0) + cStep >>= shift; + + s16 step = static_cast(m_Step << std::max(0, 11 - m_Shift)); + + if (m_Exp) { + if (!m_Decrease && m_Level > 0x6000) + cStep >>= 2; + + if (m_Decrease) + step = static_cast((step * m_Level) >> 15); + } + + m_Counter += cStep; + + if (m_Counter >= 0x800000) { + m_Counter = 0; + m_Level = std::clamp(m_Level + step, 0, INT16_MAX); + } +} + +void ADSR::Run() { + // Let's not waste time calculating silent voices + if (m_Phase == Phase::Stopped) + return; + + Step(); + + if (m_Phase == Phase::Sustain) + return; + + if ((!m_Decrease && m_Level >= m_Target) || (m_Decrease && m_Level <= m_Target)) { + switch (m_Phase) { + case Phase::Attack: + m_Phase = Phase::Decay; + break; + case Phase::Decay: + m_Phase = Phase::Sustain; + break; + case Phase::Release: + m_Phase = Phase::Stopped; + break; + default: + break; + } + + UpdateSettings(); + } +} + +void ADSR::UpdateSettings() { + switch (m_Phase) { + case Phase::Attack: + m_Exp = m_Reg.AttackExp.get(); + m_Decrease = false; + m_Shift = m_Reg.AttackShift.get(); + m_Step = static_cast(7 - m_Reg.AttackStep.get()); + m_Target = 0x7FFF; + break; + case Phase::Decay: + m_Exp = true; + m_Decrease = true; + m_Shift = m_Reg.DecayShift.get(); + m_Step = -8; + m_Target = (m_Reg.SustainLevel.get() + 1) << 11; + break; + case Phase::Sustain: + m_Exp = m_Reg.SustainExp.get(); + m_Decrease = m_Reg.SustainDecr.get(); + m_Shift = m_Reg.SustainShift.get(); + m_Step = m_Decrease ? static_cast(-8 + m_Reg.SustainStep.get()) + : static_cast(7 - m_Reg.SustainStep.get()); + m_Target = 0; // unused for sustain + break; + case Phase::Release: + m_Exp = m_Reg.ReleaseExp.get(); + m_Decrease = true; + m_Shift = m_Reg.ReleaseShift.get(); + m_Step = -8; + m_Target = 0; + break; + default: + break; + } +} + +void ADSR::Attack() { + m_Phase = Phase::Attack; + m_Level = 0; + m_Counter = 0; + UpdateSettings(); +} + +void ADSR::Release() { + m_Phase = Phase::Release; + m_Counter = 0; + UpdateSettings(); +} + +void ADSR::Stop() { + m_Phase = Phase::Stopped; + m_Level = 0; +} + +s16 ADSR::Level() const { + return static_cast(m_Level); +} + +void Volume::Run() { + if (!m_Sweep.EnableSweep.get()) + return; + + Step(); +} + +void Volume::Set(u16 volume) { + m_Sweep.bits = volume; + + if (!m_Sweep.EnableSweep.get()) { + m_Level = static_cast(m_Sweep.bits << 1); + return; + } + + m_Exp = m_Sweep.SweepExp.get(); + m_Decrease = m_Sweep.SweepDecrease.get(); + m_Shift = m_Sweep.SweepShift.get(); + m_Step = m_Decrease ? static_cast(-8 + m_Sweep.SweepStep.get()) + : static_cast(7 - m_Sweep.SweepStep.get()); + + if (m_Exp && m_Decrease) { + // if (m_Sweep.NegativePhase) + // Console.WriteLn("Disqualified from inv"); + m_Inv = false; + } else { + m_Inv = m_Sweep.NegativePhase.get(); + } + + // Console.WriteLn(Color_Red, "start sweep, e:%d d:%d sh:%d st:%d inv:%d", m_Exp, m_Decrease, + // m_Shift, m_Step, m_Inv); Console.WriteLn(Color_Red, "Current level %08x", m_Level); +} + +u16 Volume::Get() const { + return m_Sweep.bits; +} + +s16 Volume::GetCurrent() const { + return static_cast(m_Level); +} +} // namespace snd diff --git a/game/sound/common/envelope.h b/game/sound/common/envelope.h new file mode 100644 index 0000000000..e17a77a78d --- /dev/null +++ b/game/sound/common/envelope.h @@ -0,0 +1,131 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#pragma once + +#include "bitfield.h" + +#include "common/common_types.h" + +namespace snd { +union ADSRReg { + u32 bits; + + bitfield hi; + bitfield lo; + + bitfield SustainExp; + bitfield SustainDecr; + bitfield Unused; + bitfield SustainShift; + bitfield SustainStep; + bitfield ReleaseExp; + bitfield ReleaseShift; + + bitfield AttackExp; + bitfield AttackShift; + bitfield AttackStep; + bitfield DecayShift; + bitfield SustainLevel; +}; + +union VolReg { + u16 bits; + + bitfield EnableSweep; + bitfield SweepExp; + bitfield SweepDecrease; + bitfield NegativePhase; + bitfield SweepShift; + bitfield SweepStep; +}; + +class Envelope { + public: + void Step(); + + protected: + u8 m_Shift{0}; + s8 m_Step{0}; + bool m_Inv{false}; + bool m_Exp{false}; + bool m_Decrease{false}; + + u32 m_Counter{0}; + s32 m_Level{0}; +}; + +class ADSR : Envelope { + public: + enum class Phase { + Attack, + Decay, + Sustain, + Release, + Stopped, + }; + + void Run(); + void Attack(); + void Release(); + void Stop(); + [[nodiscard]] s16 Level() const; + void SetLevel(s16 value) { m_Level = value; } + void UpdateSettings(); + ADSRReg m_Reg{0}; + [[nodiscard]] Phase GetPhase() const { return m_Phase; } + + void Reset() { + m_Phase = Phase::Stopped; + m_Target = 0; + m_Counter = 0; + m_Level = 0; + m_Exp = false; + m_Decrease = false; + m_Inv = false; + m_Step = 0; + m_Shift = 0; + } + + private: + Phase m_Phase{Phase::Stopped}; + s32 m_Target{0}; +}; + +class Volume : Envelope { + public: + void Run(); + void Set(u16 volume); + [[nodiscard]] u16 Get() const; + [[nodiscard]] s16 GetCurrent() const; + + void Reset() { + m_Sweep.bits = 0; + + m_Counter = 0; + m_Level = 0; + m_Exp = false; + m_Decrease = false; + m_Inv = false; + m_Step = 0; + m_Shift = 0; + } + + private: + VolReg m_Sweep{0}; +}; + +struct VolumePair { + Volume left{}; + Volume right{}; + + void Run() { + left.Run(); + right.Run(); + } + + void Reset() { + left.Reset(); + right.Reset(); + } +}; +} // namespace snd diff --git a/game/sound/common/fifo.h b/game/sound/common/fifo.h new file mode 100644 index 0000000000..02503d00cf --- /dev/null +++ b/game/sound/common/fifo.h @@ -0,0 +1,41 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#pragma once + +#include +#include + +// This class is only valid for sizes that are power of two +template +class fifo { + public: + Tp Pop() { return array[Mask(read++)]; } + void Push(Tp val) { array[Mask(write++)] = val; } + + Tp& Front() { return array[Mask(read)]; } + Tp& Back() { return array[Mask(write)]; } + + Tp Peek() { return array[Mask(read + 1)]; } + Tp Peek(size_t offset) { return array[Mask(read + offset)]; } + + size_t Size() { return write - read; } + bool Full() { return Size() == capacity; } + bool Empty() { return read == write; } + + void Reset() { + array.fill(Tp{}); + read = 0; + write = 0; + } + + private: + static constexpr bool is_power_of_two(int v) { return v && ((v & (v - 1)) == 0); } + static_assert(is_power_of_two(Nm), "FIFO size must be power of 2 for correct operation"); + + size_t Mask(size_t val) { return val & (capacity - 1); } + + std::array array = {}; + size_t capacity = Nm; + size_t read = {}; + size_t write = {}; +}; diff --git a/game/sound/common/interp_table.inc b/game/sound/common/interp_table.inc new file mode 100644 index 0000000000..f6d0b84fc1 --- /dev/null +++ b/game/sound/common/interp_table.inc @@ -0,0 +1,258 @@ +std::array, 256> interp_table = { { + { 0x12C7, 0x59B3, 0x1307, -0x0001 }, + { 0x1288, 0x59B2, 0x1347, -0x0001 }, + { 0x1249, 0x59B0, 0x1388, -0x0001 }, + { 0x120B, 0x59AD, 0x13C9, -0x0001 }, + { 0x11CD, 0x59A9, 0x140B, -0x0001 }, + { 0x118F, 0x59A4, 0x144D, -0x0001 }, + { 0x1153, 0x599E, 0x1490, -0x0001 }, + { 0x1116, 0x5997, 0x14D4, -0x0001 }, + { 0x10DB, 0x598F, 0x1517, -0x0001 }, + { 0x109F, 0x5986, 0x155C, -0x0001 }, + { 0x1065, 0x597C, 0x15A0, -0x0001 }, + { 0x102A, 0x5971, 0x15E6, -0x0001 }, + { 0x0FF1, 0x5965, 0x162C, -0x0001 }, + { 0x0FB7, 0x5958, 0x1672, -0x0001 }, + { 0x0F7F, 0x5949, 0x16B9, -0x0001 }, + { 0x0F46, 0x593A, 0x1700, -0x0001 }, + { 0x0F0F, 0x592A, 0x1747, 0x0000 }, + { 0x0ED7, 0x5919, 0x1790, 0x0000 }, + { 0x0EA1, 0x5907, 0x17D8, 0x0000 }, + { 0x0E6B, 0x58F4, 0x1821, 0x0000 }, + { 0x0E35, 0x58E0, 0x186B, 0x0000 }, + { 0x0E00, 0x58CB, 0x18B5, 0x0000 }, + { 0x0DCB, 0x58B5, 0x1900, 0x0000 }, + { 0x0D97, 0x589E, 0x194B, 0x0001 }, + { 0x0D63, 0x5886, 0x1996, 0x0001 }, + { 0x0D30, 0x586D, 0x19E2, 0x0001 }, + { 0x0CFD, 0x5853, 0x1A2E, 0x0001 }, + { 0x0CCB, 0x5838, 0x1A7B, 0x0002 }, + { 0x0C99, 0x581C, 0x1AC8, 0x0002 }, + { 0x0C68, 0x57FF, 0x1B16, 0x0002 }, + { 0x0C38, 0x57E2, 0x1B64, 0x0003 }, + { 0x0C07, 0x57C3, 0x1BB3, 0x0003 }, + { 0x0BD8, 0x57A3, 0x1C02, 0x0003 }, + { 0x0BA9, 0x5782, 0x1C51, 0x0004 }, + { 0x0B7A, 0x5761, 0x1CA1, 0x0004 }, + { 0x0B4C, 0x573E, 0x1CF1, 0x0005 }, + { 0x0B1E, 0x571B, 0x1D42, 0x0005 }, + { 0x0AF1, 0x56F6, 0x1D93, 0x0006 }, + { 0x0AC4, 0x56D1, 0x1DE5, 0x0007 }, + { 0x0A98, 0x56AB, 0x1E37, 0x0007 }, + { 0x0A6C, 0x5684, 0x1E89, 0x0008 }, + { 0x0A40, 0x565B, 0x1EDC, 0x0009 }, + { 0x0A16, 0x5632, 0x1F2F, 0x0009 }, + { 0x09EB, 0x5609, 0x1F82, 0x000A }, + { 0x09C1, 0x55DE, 0x1FD6, 0x000B }, + { 0x0998, 0x55B2, 0x202A, 0x000C }, + { 0x096F, 0x5585, 0x207F, 0x000D }, + { 0x0946, 0x5558, 0x20D4, 0x000E }, + { 0x091E, 0x5529, 0x2129, 0x000F }, + { 0x08F7, 0x54FA, 0x217F, 0x0010 }, + { 0x08D0, 0x54CA, 0x21D5, 0x0011 }, + { 0x08A9, 0x5499, 0x222C, 0x0012 }, + { 0x0883, 0x5467, 0x2282, 0x0013 }, + { 0x085D, 0x5434, 0x22DA, 0x0015 }, + { 0x0838, 0x5401, 0x2331, 0x0016 }, + { 0x0813, 0x53CC, 0x2389, 0x0018 }, + { 0x07EF, 0x5397, 0x23E1, 0x0019 }, + { 0x07CB, 0x5361, 0x2439, 0x001B }, + { 0x07A7, 0x532A, 0x2492, 0x001C }, + { 0x0784, 0x52F3, 0x24EB, 0x001E }, + { 0x0762, 0x52BA, 0x2545, 0x0020 }, + { 0x0740, 0x5281, 0x259E, 0x0021 }, + { 0x071E, 0x5247, 0x25F8, 0x0023 }, + { 0x06FD, 0x520C, 0x2653, 0x0025 }, + { 0x06DC, 0x51D0, 0x26AD, 0x0027 }, + { 0x06BB, 0x5194, 0x2708, 0x0029 }, + { 0x069B, 0x5156, 0x2763, 0x002C }, + { 0x067C, 0x5118, 0x27BE, 0x002E }, + { 0x065C, 0x50DA, 0x281A, 0x0030 }, + { 0x063E, 0x509A, 0x2876, 0x0033 }, + { 0x061F, 0x505A, 0x28D2, 0x0035 }, + { 0x0601, 0x5019, 0x292E, 0x0038 }, + { 0x05E4, 0x4FD7, 0x298B, 0x003A }, + { 0x05C7, 0x4F95, 0x29E7, 0x003D }, + { 0x05AA, 0x4F52, 0x2A44, 0x0040 }, + { 0x058E, 0x4F0E, 0x2AA1, 0x0043 }, + { 0x0572, 0x4EC9, 0x2AFF, 0x0046 }, + { 0x0556, 0x4E84, 0x2B5C, 0x0049 }, + { 0x053B, 0x4E3E, 0x2BBA, 0x004D }, + { 0x0520, 0x4DF7, 0x2C18, 0x0050 }, + { 0x0506, 0x4DB0, 0x2C76, 0x0054 }, + { 0x04EC, 0x4D68, 0x2CD4, 0x0057 }, + { 0x04D2, 0x4D20, 0x2D33, 0x005B }, + { 0x04B9, 0x4CD7, 0x2D91, 0x005F }, + { 0x04A0, 0x4C8D, 0x2DF0, 0x0063 }, + { 0x0488, 0x4C42, 0x2E4F, 0x0067 }, + { 0x0470, 0x4BF7, 0x2EAE, 0x006B }, + { 0x0458, 0x4BAC, 0x2F0D, 0x006F }, + { 0x0441, 0x4B5F, 0x2F6C, 0x0074 }, + { 0x042A, 0x4B13, 0x2FCC, 0x0078 }, + { 0x0413, 0x4AC5, 0x302B, 0x007D }, + { 0x03FC, 0x4A77, 0x308B, 0x0082 }, + { 0x03E7, 0x4A29, 0x30EA, 0x0087 }, + { 0x03D1, 0x49D9, 0x314A, 0x008C }, + { 0x03BC, 0x498A, 0x31AA, 0x0091 }, + { 0x03A7, 0x493A, 0x3209, 0x0096 }, + { 0x0392, 0x48E9, 0x3269, 0x009C }, + { 0x037E, 0x4898, 0x32C9, 0x00A1 }, + { 0x036A, 0x4846, 0x3329, 0x00A7 }, + { 0x0356, 0x47F4, 0x3389, 0x00AD }, + { 0x0343, 0x47A1, 0x33E9, 0x00B3 }, + { 0x0330, 0x474E, 0x3449, 0x00BA }, + { 0x031D, 0x46FA, 0x34A9, 0x00C0 }, + { 0x030B, 0x46A6, 0x3509, 0x00C7 }, + { 0x02F9, 0x4651, 0x3569, 0x00CD }, + { 0x02E7, 0x45FC, 0x35C9, 0x00D4 }, + { 0x02D6, 0x45A6, 0x3629, 0x00DB }, + { 0x02C4, 0x4550, 0x3689, 0x00E3 }, + { 0x02B4, 0x44FA, 0x36E8, 0x00EA }, + { 0x02A3, 0x44A3, 0x3748, 0x00F2 }, + { 0x0293, 0x444C, 0x37A8, 0x00FA }, + { 0x0283, 0x43F4, 0x3807, 0x0101 }, + { 0x0273, 0x439C, 0x3867, 0x010A }, + { 0x0264, 0x4344, 0x38C6, 0x0112 }, + { 0x0255, 0x42EB, 0x3926, 0x011B }, + { 0x0246, 0x4292, 0x3985, 0x0123 }, + { 0x0237, 0x4239, 0x39E4, 0x012C }, + { 0x0229, 0x41DF, 0x3A43, 0x0135 }, + { 0x021B, 0x4185, 0x3AA2, 0x013F }, + { 0x020D, 0x412A, 0x3B00, 0x0148 }, + { 0x0200, 0x40D0, 0x3B5F, 0x0152 }, + { 0x01F2, 0x4074, 0x3BBD, 0x015C }, + { 0x01E5, 0x4019, 0x3C1B, 0x0166 }, + { 0x01D9, 0x3FBD, 0x3C79, 0x0171 }, + { 0x01CC, 0x3F62, 0x3CD7, 0x017B }, + { 0x01C0, 0x3F05, 0x3D35, 0x0186 }, + { 0x01B4, 0x3EA9, 0x3D92, 0x0191 }, + { 0x01A8, 0x3E4C, 0x3DEF, 0x019C }, + { 0x019C, 0x3DEF, 0x3E4C, 0x01A8 }, + { 0x0191, 0x3D92, 0x3EA9, 0x01B4 }, + { 0x0186, 0x3D35, 0x3F05, 0x01C0 }, + { 0x017B, 0x3CD7, 0x3F62, 0x01CC }, + { 0x0171, 0x3C79, 0x3FBD, 0x01D9 }, + { 0x0166, 0x3C1B, 0x4019, 0x01E5 }, + { 0x015C, 0x3BBD, 0x4074, 0x01F2 }, + { 0x0152, 0x3B5F, 0x40D0, 0x0200 }, + { 0x0148, 0x3B00, 0x412A, 0x020D }, + { 0x013F, 0x3AA2, 0x4185, 0x021B }, + { 0x0135, 0x3A43, 0x41DF, 0x0229 }, + { 0x012C, 0x39E4, 0x4239, 0x0237 }, + { 0x0123, 0x3985, 0x4292, 0x0246 }, + { 0x011B, 0x3926, 0x42EB, 0x0255 }, + { 0x0112, 0x38C6, 0x4344, 0x0264 }, + { 0x010A, 0x3867, 0x439C, 0x0273 }, + { 0x0101, 0x3807, 0x43F4, 0x0283 }, + { 0x00FA, 0x37A8, 0x444C, 0x0293 }, + { 0x00F2, 0x3748, 0x44A3, 0x02A3 }, + { 0x00EA, 0x36E8, 0x44FA, 0x02B4 }, + { 0x00E3, 0x3689, 0x4550, 0x02C4 }, + { 0x00DB, 0x3629, 0x45A6, 0x02D6 }, + { 0x00D4, 0x35C9, 0x45FC, 0x02E7 }, + { 0x00CD, 0x3569, 0x4651, 0x02F9 }, + { 0x00C7, 0x3509, 0x46A6, 0x030B }, + { 0x00C0, 0x34A9, 0x46FA, 0x031D }, + { 0x00BA, 0x3449, 0x474E, 0x0330 }, + { 0x00B3, 0x33E9, 0x47A1, 0x0343 }, + { 0x00AD, 0x3389, 0x47F4, 0x0356 }, + { 0x00A7, 0x3329, 0x4846, 0x036A }, + { 0x00A1, 0x32C9, 0x4898, 0x037E }, + { 0x009C, 0x3269, 0x48E9, 0x0392 }, + { 0x0096, 0x3209, 0x493A, 0x03A7 }, + { 0x0091, 0x31AA, 0x498A, 0x03BC }, + { 0x008C, 0x314A, 0x49D9, 0x03D1 }, + { 0x0087, 0x30EA, 0x4A29, 0x03E7 }, + { 0x0082, 0x308B, 0x4A77, 0x03FC }, + { 0x007D, 0x302B, 0x4AC5, 0x0413 }, + { 0x0078, 0x2FCC, 0x4B13, 0x042A }, + { 0x0074, 0x2F6C, 0x4B5F, 0x0441 }, + { 0x006F, 0x2F0D, 0x4BAC, 0x0458 }, + { 0x006B, 0x2EAE, 0x4BF7, 0x0470 }, + { 0x0067, 0x2E4F, 0x4C42, 0x0488 }, + { 0x0063, 0x2DF0, 0x4C8D, 0x04A0 }, + { 0x005F, 0x2D91, 0x4CD7, 0x04B9 }, + { 0x005B, 0x2D33, 0x4D20, 0x04D2 }, + { 0x0057, 0x2CD4, 0x4D68, 0x04EC }, + { 0x0054, 0x2C76, 0x4DB0, 0x0506 }, + { 0x0050, 0x2C18, 0x4DF7, 0x0520 }, + { 0x004D, 0x2BBA, 0x4E3E, 0x053B }, + { 0x0049, 0x2B5C, 0x4E84, 0x0556 }, + { 0x0046, 0x2AFF, 0x4EC9, 0x0572 }, + { 0x0043, 0x2AA1, 0x4F0E, 0x058E }, + { 0x0040, 0x2A44, 0x4F52, 0x05AA }, + { 0x003D, 0x29E7, 0x4F95, 0x05C7 }, + { 0x003A, 0x298B, 0x4FD7, 0x05E4 }, + { 0x0038, 0x292E, 0x5019, 0x0601 }, + { 0x0035, 0x28D2, 0x505A, 0x061F }, + { 0x0033, 0x2876, 0x509A, 0x063E }, + { 0x0030, 0x281A, 0x50DA, 0x065C }, + { 0x002E, 0x27BE, 0x5118, 0x067C }, + { 0x002C, 0x2763, 0x5156, 0x069B }, + { 0x0029, 0x2708, 0x5194, 0x06BB }, + { 0x0027, 0x26AD, 0x51D0, 0x06DC }, + { 0x0025, 0x2653, 0x520C, 0x06FD }, + { 0x0023, 0x25F8, 0x5247, 0x071E }, + { 0x0021, 0x259E, 0x5281, 0x0740 }, + { 0x0020, 0x2545, 0x52BA, 0x0762 }, + { 0x001E, 0x24EB, 0x52F3, 0x0784 }, + { 0x001C, 0x2492, 0x532A, 0x07A7 }, + { 0x001B, 0x2439, 0x5361, 0x07CB }, + { 0x0019, 0x23E1, 0x5397, 0x07EF }, + { 0x0018, 0x2389, 0x53CC, 0x0813 }, + { 0x0016, 0x2331, 0x5401, 0x0838 }, + { 0x0015, 0x22DA, 0x5434, 0x085D }, + { 0x0013, 0x2282, 0x5467, 0x0883 }, + { 0x0012, 0x222C, 0x5499, 0x08A9 }, + { 0x0011, 0x21D5, 0x54CA, 0x08D0 }, + { 0x0010, 0x217F, 0x54FA, 0x08F7 }, + { 0x000F, 0x2129, 0x5529, 0x091E }, + { 0x000E, 0x20D4, 0x5558, 0x0946 }, + { 0x000D, 0x207F, 0x5585, 0x096F }, + { 0x000C, 0x202A, 0x55B2, 0x0998 }, + { 0x000B, 0x1FD6, 0x55DE, 0x09C1 }, + { 0x000A, 0x1F82, 0x5609, 0x09EB }, + { 0x0009, 0x1F2F, 0x5632, 0x0A16 }, + { 0x0009, 0x1EDC, 0x565B, 0x0A40 }, + { 0x0008, 0x1E89, 0x5684, 0x0A6C }, + { 0x0007, 0x1E37, 0x56AB, 0x0A98 }, + { 0x0007, 0x1DE5, 0x56D1, 0x0AC4 }, + { 0x0006, 0x1D93, 0x56F6, 0x0AF1 }, + { 0x0005, 0x1D42, 0x571B, 0x0B1E }, + { 0x0005, 0x1CF1, 0x573E, 0x0B4C }, + { 0x0004, 0x1CA1, 0x5761, 0x0B7A }, + { 0x0004, 0x1C51, 0x5782, 0x0BA9 }, + { 0x0003, 0x1C02, 0x57A3, 0x0BD8 }, + { 0x0003, 0x1BB3, 0x57C3, 0x0C07 }, + { 0x0003, 0x1B64, 0x57E2, 0x0C38 }, + { 0x0002, 0x1B16, 0x57FF, 0x0C68 }, + { 0x0002, 0x1AC8, 0x581C, 0x0C99 }, + { 0x0002, 0x1A7B, 0x5838, 0x0CCB }, + { 0x0001, 0x1A2E, 0x5853, 0x0CFD }, + { 0x0001, 0x19E2, 0x586D, 0x0D30 }, + { 0x0001, 0x1996, 0x5886, 0x0D63 }, + { 0x0001, 0x194B, 0x589E, 0x0D97 }, + { 0x0000, 0x1900, 0x58B5, 0x0DCB }, + { 0x0000, 0x18B5, 0x58CB, 0x0E00 }, + { 0x0000, 0x186B, 0x58E0, 0x0E35 }, + { 0x0000, 0x1821, 0x58F4, 0x0E6B }, + { 0x0000, 0x17D8, 0x5907, 0x0EA1 }, + { 0x0000, 0x1790, 0x5919, 0x0ED7 }, + { 0x0000, 0x1747, 0x592A, 0x0F0F }, + { -0x0001, 0x1700, 0x593A, 0x0F46 }, + { -0x0001, 0x16B9, 0x5949, 0x0F7F }, + { -0x0001, 0x1672, 0x5958, 0x0FB7 }, + { -0x0001, 0x162C, 0x5965, 0x0FF1 }, + { -0x0001, 0x15E6, 0x5971, 0x102A }, + { -0x0001, 0x15A0, 0x597C, 0x1065 }, + { -0x0001, 0x155C, 0x5986, 0x109F }, + { -0x0001, 0x1517, 0x598F, 0x10DB }, + { -0x0001, 0x14D4, 0x5997, 0x1116 }, + { -0x0001, 0x1490, 0x599E, 0x1153 }, + { -0x0001, 0x144D, 0x59A4, 0x118F }, + { -0x0001, 0x140B, 0x59A9, 0x11CD }, + { -0x0001, 0x13C9, 0x59AD, 0x120B }, + { -0x0001, 0x1388, 0x59B0, 0x1249 }, + { -0x0001, 0x1347, 0x59B2, 0x1288 }, + { -0x0001, 0x1307, 0x59B3, 0x12C7 }, +} }; diff --git a/game/sound/common/sound_types.h b/game/sound/common/sound_types.h new file mode 100644 index 0000000000..5803ca3451 --- /dev/null +++ b/game/sound/common/sound_types.h @@ -0,0 +1,23 @@ +#pragma once +#include + +#include "common/common_types.h" + +namespace snd { + +struct vol_pair { + s16 left; + s16 right; +}; + +struct s16_output { + s16 left{0}, right{0}; + + s16_output& operator+=(const s16_output& rhs) { + left = static_cast(std::clamp(left + rhs.left, INT16_MIN, INT16_MAX)); + right = static_cast(std::clamp(right + rhs.right, INT16_MIN, INT16_MAX)); + return *this; + } +}; + +} // namespace snd diff --git a/game/sound/common/synth.cpp b/game/sound/common/synth.cpp new file mode 100644 index 0000000000..50de71864d --- /dev/null +++ b/game/sound/common/synth.cpp @@ -0,0 +1,37 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#include "synth.h" + +#include + +namespace snd { + +static s16 ApplyVolume(s16 sample, s32 volume) { + return (sample * volume) >> 15; +} + +s16_output synth::tick() { + s16_output out{}; + + m_voices.remove_if([](std::shared_ptr& v) { return v->dead(); }); + for (auto& v : m_voices) { + out += v->run(); + } + + out.left = ApplyVolume(out.left, m_Volume.left.Get()); + out.right = ApplyVolume(out.right, m_Volume.right.Get()); + + m_Volume.Run(); + + return out; +} + +void synth::add_voice(std::shared_ptr voice) { + m_voices.emplace_front(voice); +} + +void synth::set_master_vol(u32 volume) { + m_Volume.left.Set(volume); + m_Volume.right.Set(volume); +} +} // namespace snd diff --git a/game/sound/common/synth.h b/game/sound/common/synth.h new file mode 100644 index 0000000000..e3457a19cd --- /dev/null +++ b/game/sound/common/synth.h @@ -0,0 +1,37 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#pragma once +#include +#include +#include +#include + +#include "envelope.h" +#include "sound_types.h" +#include "voice.h" + +#include "common/common_types.h" + +namespace snd { +struct SpuVolume { + /* 0 */ s16 left; + /* 2 */ s16 right; +}; + +class synth { + public: + synth() { + m_Volume.left.Set(0x3FFF); + m_Volume.right.Set(0x3FFF); + } + + s16_output tick(); + void add_voice(std::shared_ptr voice); + void set_master_vol(u32 volume); + + private: + std::forward_list> m_voices; + + VolumePair m_Volume{}; +}; +} // namespace snd diff --git a/game/sound/common/voice.cpp b/game/sound/common/voice.cpp new file mode 100644 index 0000000000..162baf66a1 --- /dev/null +++ b/game/sound/common/voice.cpp @@ -0,0 +1,140 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#include "voice.h" + +#include + +#include "third-party/fmt/core.h" + +namespace snd { +#include "interp_table.inc" + +// Integer math version of ps-adpcm coefs +static constexpr std::array, 5> adpcm_coefs = {{ + {0, 0}, + {60, 0}, + {115, -52}, + {98, -55}, + {122, -60}, +}}; + +void voice::DecodeSamples() { + // This doesn't exactly match the real behaviour, + // it seems to initially decode a bigger chunk + // and then decode more data after a bit has drained + if (m_DecodeBuf.Size() >= 16) { + // sufficient data buffered + return; + } + + // Skip decoding for stopped voices. + if (m_ADSR.GetPhase() == ADSR::Phase::Stopped) { + for (int i = 0; i < 4; i++) + m_DecodeBuf.Push(0); + } else { + u32 data = m_sample[m_NAX]; + for (int i = 0; i < 4; i++) { + s32 sample = (s16)((data & 0xF) << 12); + sample >>= m_CurHeader.Shift.get(); + + // TODO do the right thing for invalid shift/filter values + sample += (adpcm_coefs[m_CurHeader.Filter.get()][0] * m_DecodeHist1) >> 6; + sample += (adpcm_coefs[m_CurHeader.Filter.get()][1] * m_DecodeHist2) >> 6; + + // We do get overflow here otherwise, should we? + sample = std::clamp(sample, INT16_MIN, INT16_MAX); + + m_DecodeHist2 = m_DecodeHist1; + m_DecodeHist1 = static_cast(sample); + + m_DecodeBuf.Push(static_cast(sample)); + data >>= 4; + } + } + + m_NAX++; + + if ((m_NAX & 0x7) == 0) { + if (m_CurHeader.LoopEnd.get()) { + m_NAX = m_LSA; + m_ENDX = true; + + if (!m_CurHeader.LoopRepeat.get()) { + // Need to inhibit stopping here in noise is on + // seems to result in the right thing but would like to verify + if (!m_Noise) + m_ADSR.Stop(); + } + } + + UpdateBlockHeader(); + + m_NAX++; + } +} + +void voice::UpdateBlockHeader() { + m_CurHeader.bits = m_sample[m_NAX & ~0x7]; + if (m_CurHeader.LoopStart.get() && !m_CustomLoop) + m_LSA = m_NAX & ~0x7; +} + +static s16 ApplyVolume(s16 sample, s32 volume) { + return (sample * volume) >> 15; +} + +void voice::key_on() { + m_NAX = m_SSA; + m_NAX++; + + UpdateBlockHeader(); + + m_ENDX = false; + m_ADSR.Attack(); + m_Counter = 0; + m_DecodeHist1 = 0; + m_DecodeHist2 = 0; + m_DecodeBuf.Reset(); + m_CustomLoop = false; + // Console.WriteLn("SPU[%d]:VOICE[%d] Key On, SSA %08x", m_SPU.m_Id, m_Id, m_SSA); + // fmt::print("Key On {} {} {} {:x}\n",(void*)m_sample, m_Volume.left.Get(), m_Volume.right.Get(), + // m_ADSR.m_Reg.bits); +} +void voice::key_off() { + m_ADSR.Release(); + // fmt::print("Key Off\n"); +} + +s16_output voice::run() { + DecodeSamples(); + + u32 index = (m_Counter & 0x0FF0) >> 4; + + s16 sample = 0; + sample = static_cast(sample + ((m_DecodeBuf.Peek(0) * interp_table[index][0]) >> 15)); + sample = static_cast(sample + ((m_DecodeBuf.Peek(1) * interp_table[index][1]) >> 15)); + sample = static_cast(sample + ((m_DecodeBuf.Peek(2) * interp_table[index][2]) >> 15)); + sample = static_cast(sample + ((m_DecodeBuf.Peek(3) * interp_table[index][3]) >> 15)); + + s32 step = m_Pitch; + step = std::min(step, 0x3FFF); + m_Counter += step; + + auto steps = m_Counter >> 12; + m_Counter &= 0xFFF; + + while (steps > 0) { + steps--; + m_DecodeBuf.Pop(); + } + + sample = ApplyVolume(sample, m_ADSR.Level()); + s16 left = ApplyVolume(sample, m_Volume.left.GetCurrent()); + s16 right = ApplyVolume(sample, m_Volume.right.GetCurrent()); + + m_ADSR.Run(); + m_Volume.Run(); + + return s16_output{left, right}; +} +} // namespace snd diff --git a/game/sound/common/voice.h b/game/sound/common/voice.h new file mode 100644 index 0000000000..790e35bc56 --- /dev/null +++ b/game/sound/common/voice.h @@ -0,0 +1,116 @@ +// Copyright: 2021 - 2022, Ziemas +// SPDX-License-Identifier: ISC +#pragma once +#include "bitfield.h" +#include "envelope.h" +#include "fifo.h" +#include "sound_types.h" + +#include "common/common_types.h" + +#include "third-party/fmt/core.h" + +namespace snd { + +class voice { + public: + enum class AllocationType { + managed, + permanent, + }; + + voice(AllocationType alloc = AllocationType::managed) : m_Alloc(alloc) {} + s16_output run(); + + void key_on(); + void key_off(); + + bool dead() { + if (m_Alloc == AllocationType::permanent) { + return false; + } + + return m_ADSR.GetPhase() == ADSR::Phase::Stopped; + } + + void set_pitch(u16 reg) { + // fmt::print("VOICE[{}] PITCH WRITE {:x}\n", m_channel, reg); + m_Pitch = reg; + } + void set_asdr1(u16 reg) { + // fmt::print("VOICE[{}] ADSR1 WRITE {:x}\n", m_channel, reg); + m_ADSR.m_Reg.lo.set(reg); + } + void set_asdr2(u16 reg) { + // fmt::print("VOICE[{}] ADSR2 WRITE {:x}\n", m_channel, reg); + m_ADSR.m_Reg.hi.set(reg); + } + void set_volume(u16 left, u16 right) { + // fmt::print("VOICE[{}] VOLL WRITE {:x}\n", m_channel, left); + // fmt::print("VOICE[{}] VOLR WRITE {:x}\n", m_channel, right); + m_Volume.left.Set(left); + m_Volume.right.Set(right); + } + + void set_volume_l(u16 vol) { m_Volume.left.Set(vol); } + + void set_volume_r(u16 vol) { m_Volume.right.Set(vol); } + + s16 get_envx() { return m_ADSR.Level(); } + + void set_sample(u16* sample) { + m_sample = sample; + m_SSA = 0; + } + + u32 get_nax() { return m_NAX; } + + void set_ssa(u32 addr) { m_SSA = addr; } + + void set_lsa(u32 addr) { + m_LSA = addr; + m_CustomLoop = true; + } + + void stop() { m_ADSR.Stop(); } + + private: + union ADPCMHeader { + u16 bits; + bitfield LoopStart; + bitfield LoopRepeat; + bitfield LoopEnd; + bitfield Filter; + bitfield Shift; + }; + + AllocationType m_Alloc; + bool m_Noise{false}; + bool m_PitchMod{false}; + bool m_KeyOn{false}; + bool m_KeyOff{false}; + bool m_ENDX{false}; + + void DecodeSamples(); + void UpdateBlockHeader(); + + fifo m_DecodeBuf{}; + s16 m_DecodeHist1{0}; + s16 m_DecodeHist2{0}; + u32 m_Counter{0}; + + u16 m_Pitch{0}; + s16 m_Out{0}; + + u16* m_sample{nullptr}; + u32 m_SSA{0}; + u32 m_NAX{0}; + u32 m_LSA{0}; + bool m_CustomLoop{false}; + + ADPCMHeader m_CurHeader{}; + + ADSR m_ADSR{}; + VolumePair m_Volume{}; +}; +} // namespace snd diff --git a/game/sound/sdshim.cpp b/game/sound/sdshim.cpp new file mode 100644 index 0000000000..d8958741c5 --- /dev/null +++ b/game/sound/sdshim.cpp @@ -0,0 +1,97 @@ +#include "sdshim.h" + +#include + +#include "common/common_types.h" + +#include "game/sound/common/voice.h" + +#include "third-party/fmt/core.h" + +std::shared_ptr voice; +u8 spu_memory[0xc060]; + +static sceSdTransIntrHandler trans_handler[2] = {nullptr, nullptr}; +static void* userdata[2] = {nullptr, nullptr}; + +u32 sceSdGetSwitch(u32 entry) { + // we can ignore this, only used for getting vmix + return 0; +} + +u32 sceSdGetAddr(u32 entry) { + if (!voice) { + return 0; + } + // u32 core = entry & 1; + // u32 voice->id = (entry >> 1) & 0x1f; + // u32 reg = entry & ~0x3f; + + // Only ever used for getting NAX + + return voice->get_nax() << 1; +} + +void sceSdSetSwitch(u32 entry, u32 value) { + // we can ignore this, only used for vmix +} + +void sceSdSetAddr(u32 entry, u32 value) { + if (!voice) { + return; + } + [[maybe_unused]] u32 core = entry & 1; + [[maybe_unused]] u32 voice_id = (entry >> 1) & 0x1f; + u32 reg = entry & ~0x3f; + + switch (reg) { + case SD_VA_SSA: { + voice->set_ssa(value >> 1); + } break; + case SD_VA_LSAX: { + voice->set_lsa(value >> 1); + } break; + } +} + +void sceSdSetParam(u32 entry, u32 value) { + if (!voice) { + return; + } + [[maybe_unused]] u32 core = entry & 1; + [[maybe_unused]] u32 voice_id = (entry >> 1) & 0x1f; + u32 reg = entry & ~0x3f; + + switch (reg) { + case SD_VP_VOLL: { + voice->set_volume_l(value); + } break; + case SD_VP_VOLR: { + voice->set_volume_r(value); + } break; + case SD_VP_PITCH: { + voice->set_pitch(value); + } break; + case SD_VP_ADSR1: { + voice->set_asdr1(value); + } break; + case SD_VP_ADSR2: { + voice->set_asdr2(value); + } break; + default: { + } break; + } +} + +void sceSdSetTransIntrHandler(s32 channel, sceSdTransIntrHandler handler, void* data) { + trans_handler[channel] = handler; + userdata[channel] = data; +} + +u32 sceSdVoiceTrans(s32 channel, s32 mode, void* iop_addr, u32 spu_addr, u32 size) { + memcpy(&spu_memory[spu_addr], iop_addr, size); + if (trans_handler[channel] != nullptr) { + trans_handler[channel](channel, userdata); + } + return size; +} diff --git a/game/sound/sdshim.h b/game/sound/sdshim.h new file mode 100644 index 0000000000..5d3755d008 --- /dev/null +++ b/game/sound/sdshim.h @@ -0,0 +1,28 @@ +#pragma once +#include "common/common_types.h" + +#include "game/sound/common/voice.h" + +#define SD_VA_SSA ((0x20 << 8) + (0x01 << 6)) +#define SD_VA_LSAX ((0x21 << 8) + (0x01 << 6)) +#define SD_S_VMIXL (0x18 << 8) +#define SD_S_VMIXR (0x1a << 8) +#define SD_VP_VOLL (0x00 << 8) +#define SD_VP_VOLR (0x01 << 8) +#define SD_VP_PITCH (0x02 << 8) +#define SD_VP_ADSR1 (0x03 << 8) +#define SD_VP_ADSR2 (0x04 << 8) +#define SD_VA_NAX ((0x22 << 8) + (0x01 << 6)) + +extern std::shared_ptr voice; +extern u8 spu_memory[0xc060]; + +using sceSdTransIntrHandler = int (*)(int, void*); + +u32 sceSdGetSwitch(u32 entry); +u32 sceSdGetAddr(u32 entry); +void sceSdSetSwitch(u32 entry, u32 value); +void sceSdSetAddr(u32 entry, u32 value); +void sceSdSetParam(u32 entry, u32 value); +void sceSdSetTransIntrHandler(s32 channel, sceSdTransIntrHandler, void* data); +u32 sceSdVoiceTrans(s32 channel, s32 mode, void* iop_addr, u32 spu_addr, u32 size); diff --git a/game/sound/sndshim.cpp b/game/sound/sndshim.cpp new file mode 100644 index 0000000000..e01e0cc682 --- /dev/null +++ b/game/sound/sndshim.cpp @@ -0,0 +1,207 @@ +#include "sndshim.h" + +#include + +#include "sdshim.h" + +#include "989snd/player.h" + +std::unique_ptr player; + +void snd_StartSoundSystem() { + player = std::make_unique(); + + voice = std::make_shared(snd::voice::AllocationType::permanent); + voice->set_sample((u16*)spu_memory); + player->submit_voice(voice); +} + +void snd_StopSoundSystem() { + if (player) { + player.reset(); + } +} + +// dma is always instant, allocation not required +s32 snd_GetFreeSPUDMA() { + return 0; +} + +void snd_FreeSPUDMA([[maybe_unused]] s32 channel) {} + +s32 snd_GetTick() { + if (player) { + return player->get_tick(); + } else { + return 0; + } +} + +void snd_RegisterIOPMemAllocator(AllocFun, FreeFun) { + // printf("snd_RegisterIOPMemAllocator\n"); +} + +void snd_LockVoiceAllocator(s32) { + // printf("snd_LockVoiceAllocator\n"); +} + +void snd_UnlockVoiceAllocator() { + // printf("snd_UnlockVoiceAllocator\n"); +} + +s32 snd_ExternVoiceVoiceAlloc(s32, s32) { + // printf("snd_ExternVoiceVoiceAlloc\n"); + return 0; +} + +u32 snd_SRAMMalloc(u32) { + // spu memory currently hardcoded + return 0; +} + +void snd_SetMixerMode(s32, s32) {} + +void snd_SetGroupVoiceRange(s32, s32, s32) {} + +void snd_SetReverbDepth(s32, s32, s32) {} + +void snd_SetReverbType(s32, s32) {} + +void snd_SetPanTable(s16* table) { + if (player) { + player->set_pan_table((snd::vol_pair*)table); + } +} + +void snd_SetPlayBackMode(s32 mode) { + if (player) { + player->set_playback_mode(mode); + } +} + +s32 snd_SoundIsStillPlaying(s32 sound_handle) { + if (player) { + if (player->sound_still_active(sound_handle)) { + return sound_handle; + } + } + + return 0; +} + +void snd_StopSound(s32 handle) { + if (player) { + player->stop_sound(handle); + } +} + +void snd_SetSoundVolPan(s32 sound_handle, s32 vol, s32 pan) { + if (player) { + player->set_sound_vol_pan(sound_handle, vol, pan); + } +} + +void snd_SetMasterVolume(s32 group, s32 volume) { + if (player) { + player->set_master_volume(group, volume); + } +} + +void snd_UnloadBank(s32 bank_handle) { + if (player) { + player->unload_bank(bank_handle); + } +} + +void snd_ResolveBankXREFS() { + // Currently no-op, idk if we'd ever need it +} + +void snd_ContinueAllSoundsInGroup(u8 group) { + if (player) { + player->continue_all_sounds_in_group(group); + } +} + +void snd_PauseAllSoundsInGroup(u8 group) { + if (player) { + player->pause_all_sounds_in_group(group); + } +} + +void snd_SetMIDIRegister(s32 sound_handle, u8 reg, u8 value) { + if (player) { + player->set_midi_reg(sound_handle, reg, value); + } +} + +s32 snd_PlaySoundVolPanPMPB(s32 bank, s32 sound, s32 vol, s32 pan, s32 pm, s32 pb) { + if (player) { + return player->play_sound(bank, sound, vol, pan, pm, pb); + } else { + return 0; + } +} + +void snd_SetSoundPitchModifier(s32 sound, s32 mod) { + if (player) { + player->set_sound_pmod(sound, mod); + } +} + +void snd_SetSoundPitchBend(s32 sound, s32 bend) { + if (bend != 0) { + } +} + +void snd_PauseSound(s32 sound_handle) { + if (player) { + player->pause_sound(sound_handle); + } +} + +void snd_ContinueSound(s32 sound_handle) { + if (player) { + player->continue_sound(sound_handle); + } +} + +void snd_AutoPitch(s32, s32, s32, s32) { + // TODO + printf("snd_AutoPitch\n"); +} +void snd_AutoPitchBend(s32, s32, s32, s32) { + // TODO + printf("snd_AutoPitchBend\n"); +} + +s32 snd_BankLoadEx(const char* filename, s32 offset, s32, s32) { + // printf("snd_BankLoadEx\n"); + if (player) { + std::filesystem::path path = filename; + return player->load_bank(path, offset); + } else { + return 0; + } +} + +s32 snd_GetVoiceStatus(s32 voice) { + // hacky thincg to say that voice 0 is uses allocated + if (voice == 0) { + return 2; + } + + return 0; +} + +void snd_keyOnVoiceRaw(u32 core, u32 voice_id) { + if (voice) { + voice->key_on(); + } +} + +void snd_keyOffVoiceRaw(u32 core, u32 voice_id) { + if (voice) { + voice->key_off(); + } +} diff --git a/game/overlord/sndshim.h b/game/sound/sndshim.h similarity index 82% rename from game/overlord/sndshim.h rename to game/sound/sndshim.h index 78ffb27251..5f19184b56 100644 --- a/game/overlord/sndshim.h +++ b/game/sound/sndshim.h @@ -3,11 +3,16 @@ #pragma once #include "common/common_types.h" +constexpr int SND_CORE_0 = 1; +constexpr int SND_CORE_1 = 2; +constexpr int SD_REV_MODE_OFF = 0; + typedef void* (*AllocFun)(); typedef void (*FreeFun)(void*); void snd_StartSoundSystem(); void snd_StopSoundSystem(); +s32 snd_GetTick(); void snd_RegisterIOPMemAllocator(AllocFun, FreeFun); void snd_LockVoiceAllocator(s32); void snd_UnlockVoiceAllocator(); @@ -36,5 +41,10 @@ void snd_ContinueSound(s32); void snd_AutoPitch(s32, s32, s32, s32); void snd_AutoPitchBend(s32, s32, s32, s32); s32 snd_BankLoadEx(const char* filepath, s32 data_offset, s32 unk1, s32 unk2); +s32 snd_GetVoiceStatus(s32 voice); +s32 snd_GetFreeSPUDMA(); +void snd_FreeSPUDMA(s32 channel); +void snd_keyOnVoiceRaw(u32, u32); +void snd_keyOffVoiceRaw(u32, u32); #endif // SNDSHIM_H_ diff --git a/game/system/Deci2Server.cpp b/game/system/Deci2Server.cpp index 87b66f50cd..5519e6d6f6 100644 --- a/game/system/Deci2Server.cpp +++ b/game/system/Deci2Server.cpp @@ -4,154 +4,62 @@ * Works with deci2.cpp (sceDeci2) to implement the networking on target */ -#include -#include +// clang-format off +#include "Deci2Server.h" -// TODO - i think im not including the dependency right..? -#include "common/cross_sockets/xsocket.h" +#include "common/cross_sockets/XSocket.h" +#include "common/versions.h" +#include +#include -#ifdef __linux -#include -#include -#include -#elif _WIN32 +#include "third-party/fmt/core.h" + +#ifdef _WIN32 +#define NOMINMAX +#define WIN32_LEAN_AND_MEAN #include #include #include #endif - -#include "common/listener_common.h" -#include "common/versions.h" -#include "Deci2Server.h" -#include "common/util/Assert.h" - -Deci2Server::Deci2Server(std::function shutdown_callback) { - buffer = new char[BUFFER_SIZE]; - want_exit = std::move(shutdown_callback); -} +// clang-format on Deci2Server::~Deci2Server() { - close_server_socket(); - close_socket(new_sock); - - // if accept thread is running, kill it + // Cleanup the accept thread if (accept_thread_running) { kill_accept_thread = true; + // NOTE - if we don't want to wait for the roundtrip timeout to exit the game gracefully + // we should just terminate the thread forcefully accept_thread.join(); accept_thread_running = false; } - delete[] buffer; + close_socket(accepted_socket); } -/*! - * Start waiting for the Listener to connect - */ -bool Deci2Server::init() { - server_socket = open_socket(AF_INET, SOCK_STREAM, 0); - if (server_socket < 0) { - server_socket = -1; - return false; - } - -#ifdef __linux - int server_socket_opt = SO_REUSEADDR | SO_REUSEPORT; -#elif _WIN32 - int server_socket_opt = SO_EXCLUSIVEADDRUSE; -#endif - - int opt = 1; - if (set_socket_option(server_socket, SOL_SOCKET, server_socket_opt, &opt, sizeof(opt)) < 0) { - close_server_socket(); - return false; - }; - - if (set_socket_option(server_socket, TCP_SOCKET_LEVEL, TCP_NODELAY, &opt, sizeof(opt)) < 0) { - close_server_socket(); - return false; - } - - if (set_socket_timeout(server_socket, 100000) < 0) { - close_server_socket(); - return false; - } - - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = INADDR_ANY; - addr.sin_port = htons(DECI2_PORT); - - if (bind(server_socket, (sockaddr*)&addr, sizeof(addr)) < 0) { - printf("[Deci2Server] Failed to bind\n"); - close_server_socket(); - return false; - } - - if (listen(server_socket, 0) < 0) { - printf("[Deci2Server] Failed to listen\n"); - close_server_socket(); - return false; - } - - server_initialized = true; +void Deci2Server::post_init() { + fmt::print("[Deci2Server:{}] awaiting connections\n", tcp_port); accept_thread_running = true; kill_accept_thread = false; accept_thread = std::thread(&Deci2Server::accept_thread_func, this); - return true; } -void Deci2Server::close_server_socket() { - close_socket(server_socket); - server_socket = -1; -} - -/*! - * Return true if the listener is connected. - */ -bool Deci2Server::check_for_listener() { - if (server_connected) { - if (accept_thread_running) { - accept_thread.join(); - accept_thread_running = false; - } - return true; - } else { - return false; - } -} - -/*! - * Send data from buffer. User must provide appropriate headers. - */ -void Deci2Server::send_data(void* buf, u16 len) { - lock(); - if (!server_connected) { - printf("[DECI2] send while not connected, not sending!\n"); - } else { - uint16_t prog = 0; - while (prog < len) { - int wrote = write_to_socket(new_sock, (char*)(buf) + prog, len - prog); - prog += wrote; - if (!server_connected || want_exit()) { - unlock(); - return; - } +void Deci2Server::accept_thread_func() { + socklen_t addr_len = sizeof(addr); + while (!kill_accept_thread) { + accepted_socket = select_and_accept_socket(listening_socket, (sockaddr*)&addr, &addr_len, + 100000); // 0.1 second timeout + if (accepted_socket >= 0) { + set_socket_timeout(accepted_socket, 100000); + u32 versions[2] = {versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR}; + write_to_socket(accepted_socket, (char*)&versions, 8); // todo, check result? + client_connected = true; + return; } } - unlock(); } -/*! - * Lock the DECI mutex. Should be done before modifying protocols. - */ -void Deci2Server::lock() { - deci_mutex.lock(); -} - -/*! - * Unlock the DECI mutex. Should be done after modifying protocols. - */ -void Deci2Server::unlock() { - deci_mutex.unlock(); +bool Deci2Server::is_client_connected() { + return client_connected; } /*! @@ -161,7 +69,7 @@ void Deci2Server::unlock() { void Deci2Server::wait_for_protos_ready() { if (protocols_ready) return; - std::unique_lock lk(deci_mutex); + std::unique_lock lk(server_mutex); cv.wait(lk, [&] { return protocols_ready; }); } @@ -180,20 +88,24 @@ void Deci2Server::send_proto_ready(Deci2Driver* drivers, int* driver_count) { cv.notify_all(); } -void Deci2Server::run() { +void Deci2Server::read_data() { + if (!is_client_connected()) { + return; + } + int desired_size = (int)sizeof(Deci2Header); int got = 0; while (got < desired_size) { - ASSERT(got + desired_size < BUFFER_SIZE); - auto x = read_from_socket(new_sock, buffer + got, desired_size - got); - if (want_exit()) { + ASSERT(got + desired_size < (int)buffer.size()); + auto x = read_from_socket(accepted_socket, buffer.data() + got, desired_size - got); + if (want_exit_callback()) { return; } got += x > 0 ? x : 0; } - auto* hdr = (Deci2Header*)(buffer); + auto* hdr = (Deci2Header*)(buffer.data()); fprintf(stderr, "[DECI2] Got message: %d %d 0x%x %c -> %c\n", hdr->len, hdr->rsvd, hdr->proto, hdr->src, hdr->dst); @@ -222,12 +134,12 @@ void Deci2Server::run() { auto& driver = d2_drivers[handler]; u32 sent_to_program = 0; - while (!want_exit() && (hdr->rsvd < hdr->len || sent_to_program < hdr->rsvd)) { + while (!want_exit_callback() && (hdr->rsvd < hdr->len || sent_to_program < hdr->rsvd)) { // send what we have to the program if (sent_to_program < hdr->rsvd) { // driver.next_recv_size = 0; // driver.next_recv = nullptr; - driver.recv_buffer = buffer + sent_to_program; + driver.recv_buffer = buffer.data() + sent_to_program; driver.available_to_receive = hdr->rsvd - sent_to_program; (driver.handler)(DECI2_READ, driver.available_to_receive, driver.opt); // memcpy(driver.next_recv, buffer + sent_to_program, driver.next_recv_size); @@ -236,8 +148,8 @@ void Deci2Server::run() { // receive from network if (hdr->rsvd < hdr->len) { - auto x = read_from_socket(new_sock, buffer + hdr->rsvd, hdr->len - hdr->rsvd); - if (want_exit()) { + auto x = read_from_socket(accepted_socket, buffer.data() + hdr->rsvd, hdr->len - hdr->rsvd); + if (want_exit_callback()) { return; } got += x > 0 ? x : 0; @@ -249,21 +161,28 @@ void Deci2Server::run() { unlock(); } -/*! - * Background thread for waiting for the listener. - */ -void Deci2Server::accept_thread_func() { - socklen_t l = sizeof(addr); - while (!kill_accept_thread) { - // TODO - might want to do a WSAStartUp call here as well, else it won't be balanced on the - // close - new_sock = accept(server_socket, (sockaddr*)&addr, &l); - if (new_sock >= 0) { - set_socket_timeout(new_sock, 100000); - u32 versions[2] = {versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR}; - write_to_socket(new_sock, (char*)&versions, 8); // todo, check result? - server_connected = true; - return; +void Deci2Server::send_data(void* buf, u16 len) { + lock(); + if (!client_connected) { + printf("[DECI2] send while not connected, not sending!\n"); + } else { + uint16_t prog = 0; + while (prog < len) { + int wrote = write_to_socket(accepted_socket, (char*)(buf) + prog, len - prog); + prog += wrote; + if (!client_connected || want_exit_callback()) { + unlock(); + return; + } } } + unlock(); +} + +void Deci2Server::lock() { + server_mutex.lock(); +} + +void Deci2Server::unlock() { + server_mutex.unlock(); } diff --git a/game/system/Deci2Server.h b/game/system/Deci2Server.h index 5f11188057..ee37e74107 100644 --- a/game/system/Deci2Server.h +++ b/game/system/Deci2Server.h @@ -1,55 +1,45 @@ #pragma once -/*! - * @file Deci2Server.h - * Basic implementation of a DECI2 server. - * Works with deci2.cpp (sceDeci2) to implement the networking on target - */ - -#ifdef __linux -#include -#elif _WIN32 -#include -#endif -#include -#include #include -#include -#include "game/system/deci_common.h" -class Deci2Server { +#include "deci_common.h" + +#include "common/cross_sockets/XSocketServer.h" + +/// @brief Basic implementation of a DECI2 server. +/// Works with deci2.cpp(sceDeci2) to implement the networking on target +class Deci2Server : public XSocketServer { public: - static constexpr int BUFFER_SIZE = 32 * 1024 * 1024; - Deci2Server(std::function shutdown_callback); - ~Deci2Server(); - bool init(); - bool check_for_listener(); + using XSocketServer::XSocketServer; + virtual ~Deci2Server(); + + void post_init() override; + + void read_data(); void send_data(void* buf, u16 len); - void lock(); - void unlock(); + bool is_client_connected(); void wait_for_protos_ready(); void send_proto_ready(Deci2Driver* drivers, int* driver_count); - void run(); + void lock(); + void unlock(); + + protected: + void accept_thread_func(); private: - void close_server_socket(); - void accept_thread_func(); - bool kill_accept_thread = false; - char* buffer = nullptr; - int server_socket = -1; - struct sockaddr_in addr = {}; - int new_sock = -1; - bool server_initialized = false; - bool accept_thread_running = false; - bool server_connected = false; - std::function want_exit; - std::thread accept_thread; - - std::condition_variable cv; bool protocols_ready = false; - std::mutex deci_mutex; + std::condition_variable cv; Deci2Driver* d2_drivers = nullptr; int* d2_driver_count = nullptr; + + int accepted_socket = -1; + bool kill_accept_thread = false; + bool accept_thread_running = false; + + std::thread accept_thread; + std::mutex server_mutex; + + bool client_connected = false; }; diff --git a/game/system/IOP_Kernel.cpp b/game/system/IOP_Kernel.cpp index 4e76470c63..cd6dd05728 100644 --- a/game/system/IOP_Kernel.cpp +++ b/game/system/IOP_Kernel.cpp @@ -1,8 +1,11 @@ -#include #include "IOP_Kernel.h" -#include "game/sce/iop.h" + +#include + #include "common/util/Assert.h" +#include "game/sce/iop.h" + /*! * Create a new thread. Will not run the thread. */ @@ -105,6 +108,21 @@ void IOP_Kernel::WakeupThread(s32 id) { // todo, should we ever switch directly to that thread? } +bool IOP_Kernel::OnlyThreadAlive(s32 thid) { + bool yes = false; + for (u64 i = 0; i < threads.size(); i++) { + if (threads[i].started && !threads[i].done) { + if ((s32)i != thid) { + return false; + } + if ((s32)i == thid) { + yes = true; + } + } + } + return yes; +} + /*! * Dispatch all IOP threads. */ diff --git a/game/system/IOP_Kernel.h b/game/system/IOP_Kernel.h index 567b8de4f7..629059df62 100644 --- a/game/system/IOP_Kernel.h +++ b/game/system/IOP_Kernel.h @@ -3,16 +3,19 @@ #ifndef JAK_IOP_KERNEL_H #define JAK_IOP_KERNEL_H -#include -#include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include + #include "common/common_types.h" #include "common/util/Assert.h" +#include "game/sce/iop.h" + class IOP_Kernel; namespace iop { struct sceSifQueueData; @@ -122,11 +125,6 @@ class IOP_Kernel { * Returns if it got something. */ s32 PollMbx(void** msg, s32 mbx) { - if (_currentThread != -1 && threads.at(_currentThread).wantExit) { - // total hack - returning this value causes the ISO thread to error out and quit. - return -0x1a9; - } - ASSERT(mbx < (s32)mbxs.size()); s32 gotSomething = mbxs[mbx].empty() ? 0 : 1; if (gotSomething) { @@ -139,7 +137,7 @@ class IOP_Kernel { mbxs[mbx].pop(); } - return gotSomething ? 0 : -424; + return gotSomething ? KE_OK : KE_MBOX_NOMSG; } /*! @@ -164,6 +162,9 @@ class IOP_Kernel { void* recvBuff, s32 recvSize); + bool GetWantExit(s32 thid) const { return threads.at(thid).wantExit; } + bool OnlyThreadAlive(s32 thid); + private: void setupThread(s32 id); void runThread(s32 id); diff --git a/game/system/SystemThread.cpp b/game/system/SystemThread.cpp index 86daaab03b..d96df8f142 100644 --- a/game/system/SystemThread.cpp +++ b/game/system/SystemThread.cpp @@ -1,8 +1,5 @@ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - #include "SystemThread.h" + #include "common/log/log.h" ////////////////////// diff --git a/game/system/SystemThread.h b/game/system/SystemThread.h index 1fc6664378..569f543a7e 100644 --- a/game/system/SystemThread.h +++ b/game/system/SystemThread.h @@ -8,12 +8,12 @@ #ifndef RUNTIME_SYSTEMTHREAD_H #define RUNTIME_SYSTEMTHREAD_H -#include -#include #include -#include -#include #include +#include +#include +#include +#include #include "common/util/Timer.h" diff --git a/game/system/deci_common.h b/game/system/deci_common.h index 4adbcbace8..623a3022d5 100644 --- a/game/system/deci_common.h +++ b/game/system/deci_common.h @@ -1,7 +1,5 @@ #pragma once -#ifndef JAK_DECIM_COMMON_H -#define JAK_DECIM_COMMON_H #include "common/common_types.h" struct Deci2Driver { @@ -22,5 +20,3 @@ struct Deci2Driver { #define DECI2_WRITE 3 #define DECI2_WRITEDONE 4 #define DECI2_CHSTATUS 5 - -#endif // JAK_DECIM_COMMON_H diff --git a/game/system/iop_thread.cpp b/game/system/iop_thread.cpp index 2ed60fcdac..7c55f5f96b 100644 --- a/game/system/iop_thread.cpp +++ b/game/system/iop_thread.cpp @@ -5,10 +5,10 @@ #elif _WIN32 #include #endif -#include "SystemThread.h" - #include +#include "SystemThread.h" + IOP::IOP() {} void IOP::send_status(IOP_Status new_status) { @@ -68,76 +68,20 @@ void IOP::wait_run_iop() { void IOP::kill_from_ee() { want_exit = true; - signal_run_iop(); + signal_run_iop(true); } -void IOP::signal_run_iop() { +void IOP::signal_run_iop(bool force) { std::unique_lock lk(iters_mutex); - iop_iters_des++; // todo, tune this - if (iop_iters_des - iop_iters_act > 500) { - iop_iters_des = iop_iters_act + 500; + if (iop_iters_act == iop_iters_des || force) { + iop_iters_des++; // todo, tune this + if (iop_iters_des - iop_iters_act > 500) { + iop_iters_des = iop_iters_act + 500; + } + iop_run_cv.notify_all(); } - iop_run_cv.notify_all(); } IOP::~IOP() { reset_allocator(); -} - -// void launch_iop(SystemThreadInterface& interface) { -// IOP iop; -// -// printf("\n\n\n[IOP] Restart!\n"); -// iop.reset_allocator(); -// -//// dma_init_globals(); -//// iso_init_globals(); -//// fake_iso_init_globals(); -//// // iso_api -//// iso_cd_init_globals(); -//// iso_queue_init_globals(); -//// // isocommon -//// // overlord -//// ramdisk_init_globals(); -//// // sbank -//// // soundcommon -//// srpc_init_globals(); -// // ssound -// // stream -// -//// SCE_IOP::PS2_RegisterIOP(&iop); -//// PS2_RegisterIOP_EE(&iop); -// interface.initialization_complete(); -// -// printf("[IOP] Wait for OVERLORD to be started...\n"); -// iop.wait_for_overlord_start_cmd(); -// if(iop.status == IOP_OVERLORD_INIT) { -// printf("[IOP] Run!\n"); -// } else { -// printf("[IOP] shutdown!\n"); -// return; -// } -// -// iop.reset_allocator(); -// -// // init -//#ifdef ENABLE_OVERLORD -// start(iop.overlord_argc, iop.overlord_argv); -//#endif -// -// // unblock the EE, the overlord is set up! -// iop.signal_overlord_init_finish(); -// -// // IOP Kernel loop -// while(!interface.get_want_exit() && !iop.want_exit) { -// // the IOP kernel just runs at full blast, so we only run the IOP when the EE is waiting on -// the IOP. -// // Each time the EE is waiting on the IOP, it will run an iteration of the IOP kernel. -// iop.wait_run_iop(); -// iop.kernel.dispatchAll(); -// } -// -// // stop all threads in the iop kernel. -// // if the threads are not stopped nicely, we will deadlock on trying to destroy the kernel's -// condition variables. iop.kernel.shutdown(); -//} \ No newline at end of file +} \ No newline at end of file diff --git a/game/system/iop_thread.h b/game/system/iop_thread.h index bd42fc127c..bb3c7a157a 100644 --- a/game/system/iop_thread.h +++ b/game/system/iop_thread.h @@ -3,9 +3,10 @@ #ifndef JAK1_IOP_THREAD_H #define JAK1_IOP_THREAD_H -#include "common/common_types.h" #include "IOP_Kernel.h" +#include "common/common_types.h" + enum IOP_Status { IOP_WAIT_FOR_LOAD, IOP_OVERLORD_INIT, IOP_OVERLORD_RUN, IOP_OVERLORD_STOP }; class IOP { @@ -18,7 +19,7 @@ class IOP { void wait_for_overlord_start_cmd(); void wait_for_overlord_init_finish(); void signal_overlord_init_finish(); - void signal_run_iop(); + void signal_run_iop(bool force); void wait_run_iop(); void kill_from_ee(); diff --git a/game/system/newpad.cpp b/game/system/newpad.cpp index 07bbbf5046..6c9025a6dc 100644 --- a/game/system/newpad.cpp +++ b/game/system/newpad.cpp @@ -5,10 +5,12 @@ */ #include "newpad.h" + #include "common/log/log.h" +#include "common/util/Assert.h" +#include #include "game/graphics/pipelines/opengl.h" // for GLFW macros -#include "game/kernel/kscheme.h" namespace Pad { @@ -18,14 +20,17 @@ namespace Pad { ******************************** */ -std::unordered_map g_key_status; -std::unordered_map g_buffered_key_status; +constexpr int NUM_KEYS = GLFW_KEY_LAST + 1; +// key-down status of any detected key. +bool g_key_status[NUM_KEYS] = {0}; +// key-down status of any detected key. this is buffered for the remainder of a frame. +bool g_buffered_key_status[NUM_KEYS] = {0}; -bool g_gamepad_buttons[(int)Button::Max] = {0}; -float g_gamepad_analogs[(int)Analog::Max] = {0}; +bool g_gamepad_buttons[CONTROLLER_COUNT][(int)Button::Max] = {{0}}; +float g_gamepad_analogs[CONTROLLER_COUNT][(int)Analog::Max] = {{0}}; struct GamepadState { - int gamepad_idx = -1; + int gamepad_idx[CONTROLLER_COUNT] = {-1, -1}; } g_gamepads; // input mode for controller mapping @@ -37,14 +42,17 @@ u64 input_mode_index = 0; MappingInfo g_input_mode_mapping; void ForceClearKeys() { - g_key_status.clear(); - g_buffered_key_status.clear(); + for (auto& key : g_key_status) { + key = false; + } + for (auto& key : g_buffered_key_status) { + key = false; + } } void ClearKeys() { - g_buffered_key_status.clear(); - for (auto& key : g_key_status) { - g_buffered_key_status.insert(std::make_pair(key.first, key.second)); + for (int key = 0; key < NUM_KEYS; key++) { + g_buffered_key_status[key] = g_key_status[key]; } } @@ -62,31 +70,18 @@ void OnKeyPress(int key) { return; } // set absolute key status - if (g_key_status.find(key) == g_key_status.end()) { - g_key_status.insert(std::make_pair(key, 1)); - } else { - g_key_status.at(key) = 1; - } - + ASSERT(key < NUM_KEYS); + g_key_status[key] = true; // set buffered key status - if (g_buffered_key_status.find(key) == g_buffered_key_status.end()) { - g_buffered_key_status.insert(std::make_pair(key, 1)); - } else { - g_buffered_key_status.at(key) = 1; - } + g_buffered_key_status[key] = true; } void OnKeyRelease(int key) { if (input_mode == InputModeStatus::Enabled) { return; } - - // if we come out of input mode, the key wont be found. - if (g_key_status.find(key) == g_key_status.end()) { - return; - } - // set absolute key status - g_key_status.at(key) = 0; + ASSERT(key < NUM_KEYS); + g_key_status[key] = false; } /* @@ -109,16 +104,15 @@ int IsPressed(MappingInfo& mapping, Button button, int pad = 0) { return 0; } - if (pad == 0 && g_gamepad_buttons[(int)button]) { + if (g_gamepad_buttons[pad][(int)button]) { return 1; } auto key = mapping.pad_mapping[pad][(int)button]; if (key == -1) return 0; auto& keymap = mapping.buffer_mode ? g_buffered_key_status : g_key_status; - if (keymap.find(key) == keymap.end()) - return 0; - return keymap.at(key); + ASSERT(key < NUM_KEYS); + return keymap[key]; } // returns the value of the analog axis (in the future, likely pressure sensitive if we support it?) @@ -131,8 +125,7 @@ int AnalogValue(MappingInfo& /*mapping*/, Analog analog, int pad = 0) { return 127; } - if (g_gamepads.gamepad_idx == -1) { // Gamepad not present - use keyboard - + if (pad == 0 && g_gamepads.gamepad_idx[0] == -1) { // Gamepad not present - use keyboard // Movement controls mapped to WASD keys if (g_buffered_key_status[GLFW_KEY_W] && analog == Analog::Left_Y) input += -1.0f; @@ -152,9 +145,28 @@ int AnalogValue(MappingInfo& /*mapping*/, Analog analog, int pad = 0) { input += -1.0f; if (g_buffered_key_status[GLFW_KEY_L] && analog == Analog::Right_X) input += 1.0f; + } else if (pad == 1 && g_gamepads.gamepad_idx[1] == -1) { + // these bindings are not sane + if (g_buffered_key_status[GLFW_KEY_KP_5] && analog == Analog::Left_Y) + input += -1.0f; + if (g_buffered_key_status[GLFW_KEY_KP_2] && analog == Analog::Left_Y) + input += 1.0f; + if (g_buffered_key_status[GLFW_KEY_KP_1] && analog == Analog::Left_X) + input += -1.0f; + if (g_buffered_key_status[GLFW_KEY_KP_3] && analog == Analog::Left_X) + input += 1.0f; + // these bindings are not sane + if (g_buffered_key_status[GLFW_KEY_KP_DIVIDE] && analog == Analog::Right_Y) + input += -1.0f; + if (g_buffered_key_status[GLFW_KEY_KP_8] && analog == Analog::Right_Y) + input += 1.0f; + if (g_buffered_key_status[GLFW_KEY_KP_7] && analog == Analog::Right_X) + input += -1.0f; + if (g_buffered_key_status[GLFW_KEY_KP_9] && analog == Analog::Right_X) + input += 1.0f; } else { // Gamepad present - input = g_gamepad_analogs[(int)analog]; + input = g_gamepad_analogs[pad][(int)analog]; } // GLFW provides float in range -1 to 1, caller expects 0-255 @@ -187,6 +199,11 @@ void DefaultMapping(MappingInfo& mapping) { } } + // TODO - these are different from the analog bindings above and cause + // the keyboard to be bound to controls regardless + // + // Need someway to toggle off -- where do we have access to the game's settings? + // R1 / L1 MapButton(mapping, Button::L1, 0, GLFW_KEY_Q); MapButton(mapping, Button::R1, 0, GLFW_KEY_O); @@ -247,48 +264,59 @@ void input_mode_pad_set(s64 idx) { ******************************** */ -void check_gamepad() { - if (g_gamepads.gamepad_idx == -1) { - for (int i = GLFW_JOYSTICK_1; i <= GLFW_JOYSTICK_LAST; i++) { - if (glfwJoystickPresent(i) && glfwJoystickIsGamepad(i)) { - g_gamepads.gamepad_idx = i; - lg::info("Using joystick {}: {}, {}", i, glfwGetJoystickName(i), glfwGetGamepadName(i)); - break; +void check_gamepads() { + auto check_pad = [](int pad) { // -> bool + if (g_gamepads.gamepad_idx[pad] == -1) { + for (int i = GLFW_JOYSTICK_1; i <= GLFW_JOYSTICK_LAST; i++) { + if (pad == 1 && i == g_gamepads.gamepad_idx[0]) + continue; + if (glfwJoystickPresent(i) && glfwJoystickIsGamepad(i)) { + g_gamepads.gamepad_idx[pad] = i; + lg::info("Using joystick {}: {}, {}", i, glfwGetJoystickName(i), glfwGetGamepadName(i)); + break; + } } + } else if (!glfwJoystickPresent(g_gamepads.gamepad_idx[pad])) { + lg::info("Pad {} has been disconnected", pad); + g_gamepads.gamepad_idx[pad] = -1; + return false; } - } else if (!glfwJoystickPresent(g_gamepads.gamepad_idx)) { - lg::info("Gamepad has been disconnected"); - g_gamepads.gamepad_idx = -1; - } + return true; // pad already exists or was created + }; + if (check_pad(0)) + check_pad(1); + else + g_gamepads.gamepad_idx[1] = -1; } void initialize() { - check_gamepad(); - if (g_gamepads.gamepad_idx == -1) { + std::string mapping_path = + (file_util::get_jak_project_dir() / "game" / "assets" / "sdl_controller_db.txt").string(); + glfwUpdateGamepadMappings(file_util::read_text_file(mapping_path).c_str()); + check_gamepads(); + if (g_gamepads.gamepad_idx[0] == -1) { lg::info("No joysticks found."); } } -void clear_gamepads() { +void clear_pad(int pad) { for (int i = 0; i < (int)Button::Max; ++i) { - g_gamepad_buttons[i] = false; + g_gamepad_buttons[pad][i] = false; } for (int i = 0; i < 4; ++i) { - g_gamepad_analogs[i] = 0; + g_gamepad_analogs[pad][i] = 0; } } void update_gamepads() { - check_gamepad(); + check_gamepads(); - if (g_gamepads.gamepad_idx == -1) { - clear_gamepads(); + if (g_gamepads.gamepad_idx[0] == -1) { + clear_pad(0); + clear_pad(1); return; } - GLFWgamepadstate state; - glfwGetGamepadState(g_gamepads.gamepad_idx, &state); - constexpr std::pair gamepad_map[] = { {Button::Select, GLFW_GAMEPAD_BUTTON_BACK}, {Button::L3, GLFW_GAMEPAD_BUTTON_LEFT_THUMB}, @@ -311,16 +339,28 @@ void update_gamepads() { {Analog::Right_X, GLFW_GAMEPAD_AXIS_RIGHT_X}, {Analog::Right_Y, GLFW_GAMEPAD_AXIS_RIGHT_Y}}; - for (const auto& [button, idx] : gamepad_map) { - g_gamepad_buttons[(int)button] = state.buttons[idx]; - } + auto read_pad_state = [gamepad_map, gamepad_analog_map](int pad) { + GLFWgamepadstate state; + glfwGetGamepadState(g_gamepads.gamepad_idx[pad], &state); - g_gamepad_buttons[(int)Button::L2] = state.axes[GLFW_GAMEPAD_AXIS_LEFT_TRIGGER] > 0; - g_gamepad_buttons[(int)Button::R2] = state.axes[GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER] > 0; + for (const auto& [button, idx] : gamepad_map) { + g_gamepad_buttons[pad][(int)button] = state.buttons[idx]; + } - for (const auto& [analog_vector, idx] : gamepad_analog_map) { - g_gamepad_analogs[(int)analog_vector] = state.axes[idx]; - } + g_gamepad_buttons[pad][(int)Button::L2] = state.axes[GLFW_GAMEPAD_AXIS_LEFT_TRIGGER] > 0; + g_gamepad_buttons[pad][(int)Button::R2] = state.axes[GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER] > 0; + + for (const auto& [analog_vector, idx] : gamepad_analog_map) { + g_gamepad_analogs[pad][(int)analog_vector] = state.axes[idx]; + } + }; + + read_pad_state(0); + + if (g_gamepads.gamepad_idx[1] != -1) + read_pad_state(1); + else + clear_pad(1); } }; // namespace Pad diff --git a/game/system/newpad.h b/game/system/newpad.h index df7db72f44..e47f81f316 100644 --- a/game/system/newpad.h +++ b/game/system/newpad.h @@ -14,6 +14,7 @@ */ #include + #include "common/common_types.h" namespace Pad { @@ -67,11 +68,6 @@ struct MappingInfo { // TODO complex button mapping & key macros (e.g. shift+x for l2+r2 press etc.) }; -// key-down status of any detected key. -extern std::unordered_map g_key_status; -// key-down status of any detected key. this is buffered for the remainder of a frame. -extern std::unordered_map g_buffered_key_status; - void OnKeyPress(int key); void OnKeyRelease(int key); void ForceClearKeys(); diff --git a/game/system/vm/dmac.cpp b/game/system/vm/dmac.cpp index 0b3751e10d..54d68d96ce 100644 --- a/game/system/vm/dmac.cpp +++ b/game/system/vm/dmac.cpp @@ -5,11 +5,14 @@ */ #include "dmac.h" + #include "vm.h" -#include "game/runtime.h" -#include "game/kernel/kmalloc.h" + #include "common/log/log.h" +#include "game/kernel/common/kmalloc.h" +#include "game/runtime.h" + namespace VM { Ptr dmac; diff --git a/game/system/vm/dmac.h b/game/system/vm/dmac.h index 2f0c98ba33..a8b7503d02 100644 --- a/game/system/vm/dmac.h +++ b/game/system/vm/dmac.h @@ -7,7 +7,8 @@ */ #include "common/common_types.h" -#include "game/kernel/Ptr.h" + +#include "game/kernel/common/Ptr.h" namespace VM { diff --git a/game/system/vm/vm.cpp b/game/system/vm/vm.cpp index 5dfd96df23..ca97d03922 100644 --- a/game/system/vm/vm.cpp +++ b/game/system/vm/vm.cpp @@ -6,12 +6,14 @@ */ #include "vm.h" -#include "dmac.h" -#include "common/log/log.h" -#include "game/kernel/kscheme.h" + #include #include +#include "dmac.h" + +#include "common/log/log.h" + namespace VM { bool use = true; // enable VM by default, since we're debugging right now diff --git a/game/tools/subtitles/subtitle_editor.cpp b/game/tools/subtitles/subtitle_editor.cpp new file mode 100644 index 0000000000..a975bdf366 --- /dev/null +++ b/game/tools/subtitles/subtitle_editor.cpp @@ -0,0 +1,576 @@ +#include "subtitle_editor.h" + +#include +#include + +#include "common/deserialization/subtitles/subtitles.h" +#include "common/util/FileUtil.h" +#include "common/util/json_util.h" + +#include "third-party/fmt/core.h" +#include "third-party/imgui/imgui.h" +#include "third-party/imgui/imgui_stdlib.h" + +SubtitleEditor::SubtitleEditor() : m_repl(8181) { + std::string db_path = (file_util::get_jak_project_dir() / "game" / "assets" / "jak1" / + "subtitle" / "subtitle-editor-db.json") + .string(); + auto config_str = file_util::read_text_file(db_path); + auto db_data = parse_commented_json(config_str, db_path); + + for (const auto& [key, val] : db_data.items()) { + auto new_entry = SubtitleEditorDB::Entry(); + try { + new_entry.entity_type = val.at("entity_type").get(); + new_entry.process_name = val.at("process_name").get(); + new_entry.continue_name = val.at("continue_name").get(); + new_entry.move_to = val.at("move_to").get>(); + if (val.contains("move_first")) { + new_entry.move_first = val.at("move_first").get(); + } else { + new_entry.move_first = false; + } + if (new_entry.move_to.size() != 0 && new_entry.move_to.size() != 3) { + fmt::print("Bad subtitle db entry, provide 0 or 3 coordinates for 'move_to' - {}", key); + continue; + } + new_entry.execute_code = val.at("execute_code").get(); + new_entry.requirements = val.at("requirements").get>(); + m_db.emplace(key, new_entry); + } catch (std::exception& ex) { + fmt::print("Bad subtitle db entry - {} - {}", key, ex.what()); + } + } + + m_subtitle_db = load_subtitle_project(); + m_filter = m_filter_placeholder; + m_filter_hints = m_filter_placeholder; +} + +void SubtitleEditor::repl_set_continue_point(const std::string_view& continue_point) { + m_repl.eval( + fmt::format("(start 'play (get-continue-by-name *game-info* \"{}\"))", continue_point)); +} + +void SubtitleEditor::repl_move_jak(const double x, const double y, const double z) { + m_repl.eval( + fmt::format("(move-to-point! (-> *target* control) (new 'static 'vector :x (meters {:.1f}) " + ":y (meters {:.1f}) :z (meters {:.1f})))", + x, y, z)); + m_repl.eval("(send-event *camera* 'teleport)"); +} + +void SubtitleEditor::repl_reset_game() { + m_repl.eval("(set! (-> *game-info* mode) 'debug)"); + m_repl.eval("(initialize! *game-info* 'game (the-as game-save #f) (the-as string #f))"); +} + +std::string SubtitleEditor::repl_get_process_string(const std::string_view& entity_type, + const std::string_view& process_name) { + return fmt::format("(the-as {} (process-by-name \"{}\" *active-pool*))", entity_type, + process_name); +} + +void SubtitleEditor::repl_play_hint(const std::string_view& hint_name) { + repl_reset_game(); + repl_set_continue_point("village1-hut"); + // TODO - move into water fountain + m_repl.eval( + fmt::format("(level-hint-spawn (game-text-id zero) \"{}\" (the-as entity #f) *entity-pool* " + "(game-task none))", + hint_name)); +} + +void SubtitleEditor::repl_execute_cutscene_code(const SubtitleEditorDB::Entry& entry) { + // Reset the game first to get to a known state + repl_reset_game(); + + if (entry.move_first) { + // Set Jak's Continue Point + if (!entry.continue_name.empty()) { + repl_set_continue_point(entry.continue_name); + } + // Move Jak into position + if (!entry.move_to.empty()) { + repl_move_jak(entry.move_to[0], entry.move_to[1], entry.move_to[2]); + } + } + + // Run any requirements to setup the task state + if (!entry.requirements.empty()) { + // Replace __GET-PROCESS__ + for (const auto& form : entry.requirements) { + std::string temp = form; + temp = std::regex_replace(temp, std::regex("__GET-PROCESS__"), + repl_get_process_string(entry.entity_type, entry.process_name)); + m_repl.eval(temp); + } + } + + if (!entry.move_first) { + // Set Jak's Continue Point + if (!entry.continue_name.empty()) { + repl_set_continue_point(entry.continue_name); + } + // Move Jak into position + if (!entry.move_to.empty()) { + repl_move_jak(entry.move_to[0], entry.move_to[1], entry.move_to[2]); + } + } + + // Execute the critical code - typically this means sending a 'play-anim event to the + // process-taskable in question + if (!entry.execute_code.empty()) { + std::string temp = entry.execute_code; + temp = std::regex_replace(temp, std::regex("__GET-PROCESS__"), + repl_get_process_string(entry.entity_type, entry.process_name)); + m_repl.eval(temp); + } +} + +void SubtitleEditor::repl_rebuild_text() { + m_repl.eval("(make-text)"); + // NOTE - still no clue how this doesn't switch languages lol + m_repl.eval("(1+! (-> *subtitle-text* lang))"); +} + +bool SubtitleEditor::is_scene_in_current_lang(const std::string& scene_name) { + return m_subtitle_db.m_banks.at(m_current_language)->m_scenes.count(scene_name) > 0; +} + +void SubtitleEditor::draw_window() { + ImGui::Begin("Subtitle Editor"); + + if (ImGui::Button("Save Changes")) { + m_files_saved_successfully = std::make_optional(write_subtitle_db_to_files(m_subtitle_db)); + repl_rebuild_text(); + } + if (m_files_saved_successfully.has_value()) { + ImGui::SameLine(); + if (m_files_saved_successfully.value()) { + ImGui::PushStyleColor(ImGuiCol_Text, m_success_text_color); + ImGui::Text("Saved!"); + ImGui::PopStyleColor(); + } else { + ImGui::PushStyleColor(ImGuiCol_Text, m_success_text_color); + ImGui::Text("Error!"); + ImGui::PopStyleColor(); + } + } + + draw_edit_options(); + draw_repl_options(); + + if (!m_current_scene) { + ImGui::PushStyleColor(ImGuiCol_Text, m_disabled_text_color); + } else { + ImGui::PushStyleColor(ImGuiCol_Text, m_selected_text_color); + } + if (ImGui::TreeNode("Currently Selected Cutscene")) { + ImGui::PopStyleColor(); + if (m_current_scene) { + draw_subtitle_options(*m_current_scene, true); + } else { + ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(255, 0, 0, 255)); + ImGui::Text("Select a Scene from Below!"); + ImGui::PopStyleColor(); + } + ImGui::TreePop(); + } else { + ImGui::PopStyleColor(); + } + + if (ImGui::TreeNode("All Cutscenes")) { + ImGui::InputText("New Scene Name", &m_new_scene_name); + // TODO - make this a dropdown + ImGui::InputText("New Scene Group", &m_new_scene_group); + ImGui::InputText("Filter", &m_filter, ImGuiInputTextFlags_::ImGuiInputTextFlags_AutoSelectAll); + if (is_scene_in_current_lang(m_new_scene_name)) { + ImGui::PushStyleColor(ImGuiCol_Text, m_error_text_color); + ImGui::Text("Scene already exists with that name, no!"); + ImGui::PopStyleColor(); + } + if (m_new_scene_group.empty()) { + ImGui::PushStyleColor(ImGuiCol_Text, m_error_text_color); + ImGui::Text("You must provide a group to sort the scene into!"); + ImGui::PopStyleColor(); + } + if (!is_scene_in_current_lang(m_new_scene_name) && !m_new_scene_group.empty()) { + if (ImGui::Button("Add Scene")) { + GameSubtitleSceneInfo newScene; + newScene.m_name = m_new_scene_name; + newScene.m_kind = SubtitleSceneKind::Movie; + newScene.m_id = 0; // TODO - id is always zero, bug in subtitles.cpp? + newScene.m_sorting_group = m_new_scene_group; + m_subtitle_db.m_banks.at(m_current_language)->add_scene(newScene); + m_new_scene_name = ""; + } + } + + draw_all_cutscene_groups(); + ImGui::TreePop(); + } + + if (ImGui::TreeNode("All Hints")) { + ImGui::InputText("New Scene Name", &m_new_scene_name); + // TODO - make this a dropdown + ImGui::InputText("New Scene ID (hex)", &m_new_scene_id); + ImGui::InputText("New Scene Group", &m_new_scene_group); + ImGui::InputText("Filter", &m_filter, ImGuiInputTextFlags_::ImGuiInputTextFlags_AutoSelectAll); + if (is_scene_in_current_lang(m_new_scene_name)) { + ImGui::PushStyleColor(ImGuiCol_Text, m_error_text_color); + ImGui::Text("Scene already exists with that name, no!"); + ImGui::PopStyleColor(); + } + if (m_new_scene_group.empty()) { + ImGui::PushStyleColor(ImGuiCol_Text, m_error_text_color); + ImGui::Text("You must provide a group to sort the scene into!"); + ImGui::PopStyleColor(); + } + if (!is_scene_in_current_lang(m_new_scene_name) && !m_new_scene_group.empty()) { + if (ImGui::Button("Add Scene")) { + GameSubtitleSceneInfo newScene; + newScene.m_name = m_new_scene_name; + if (m_new_scene_id == "0") { + newScene.m_kind = SubtitleSceneKind::Hint; + newScene.m_id = strtoul(m_new_scene_id.c_str(), nullptr, 16); + } else { + newScene.m_kind = SubtitleSceneKind::HintNamed; + newScene.m_id = strtoul(m_new_scene_id.c_str(), nullptr, 16); + } + newScene.m_sorting_group = m_new_scene_group; + m_subtitle_db.m_banks.at(m_current_language)->add_scene(newScene); + m_new_scene_name = ""; + } + } + + draw_all_hint_groups(); + ImGui::TreePop(); + } + + ImGui::End(); +} + +void SubtitleEditor::draw_edit_options() { + if (ImGui::TreeNode("Editing Options")) { + if (ImGui::BeginCombo( + "Editing Language ID", + fmt::format("[{}] {}", m_subtitle_db.m_banks[m_current_language]->m_lang_id, + m_subtitle_db.m_banks[m_current_language]->file_path) + .c_str())) { + for (const auto& [key, value] : m_subtitle_db.m_banks) { + const bool isSelected = m_current_language == key; + if (ImGui::Selectable(fmt::format("[{}] {}", value->m_lang_id, value->file_path).c_str(), + isSelected)) { + m_current_language = key; + } + if (isSelected) { + ImGui::SetItemDefaultFocus(); + } + } + ImGui::EndCombo(); + } + if (ImGui::BeginCombo("Base Language ID", + fmt::format("[{}] {}", m_subtitle_db.m_banks[m_base_language]->m_lang_id, + m_subtitle_db.m_banks[m_base_language]->file_path) + .c_str())) { + for (const auto& [key, value] : m_subtitle_db.m_banks) { + const bool isSelected = m_base_language == key; + if (ImGui::Selectable(fmt::format("[{}] {}", value->m_lang_id, value->file_path).c_str(), + isSelected)) { + m_base_language = key; + } + if (isSelected) { + ImGui::SetItemDefaultFocus(); + } + } + ImGui::EndCombo(); + } + ImGui::Checkbox("Show missing cutscenes from base", &m_base_show_missing_cutscenes); + ImGui::InputText("New Subtitle Group Name", &m_new_scene_group_name); + if (!m_new_scene_group_name.empty()) { + if (m_new_scene_group_name == "_groups" || + std::find(m_subtitle_db.m_subtitle_groups->m_group_order.begin(), + m_subtitle_db.m_subtitle_groups->m_group_order.end(), m_new_scene_group_name) != + m_subtitle_db.m_subtitle_groups->m_group_order.end()) { + ImGui::PushStyleColor(ImGuiCol_Text, m_error_text_color); + ImGui::Text("Invalid group name, has to be unique and not '_groups'"); + ImGui::PopStyleColor(); + } else if (ImGui::Button("Add New Group")) { + m_subtitle_db.m_subtitle_groups->m_group_order.push_back(m_new_scene_group_name); + m_new_scene_group_name = ""; + } + } + ImGui::TreePop(); + } +} + +void SubtitleEditor::draw_repl_options() { + if (ImGui::TreeNode("REPL Options")) { + // TODO - the ReplServer should eventually be able to return statuses to make this easier: + // - Has the game been built before? + // - Is the repl connected? + ImGui::TextWrapped( + "This tool requires a REPL connected to the game, with the game built. Run the following " + "to do so:"); + ImGui::Text(" - `task repl`"); + ImGui::Text(" - `(lt)`"); + ImGui::Text(" - `(mi)`"); + ImGui::Text(" - Click Connect Below!"); + if (m_repl.is_connected()) { + ImGui::PushStyleColor(ImGuiCol_Text, m_success_text_color); + ImGui::Text("REPL Connected, should be good to go!"); + ImGui::PopStyleColor(); + } else { + if (ImGui::Button("Connect to REPL")) { + m_repl.connect(); + if (!m_repl.is_connected()) { + ImGui::PushStyleColor(ImGuiCol_Text, m_error_text_color); + ImGui::Text("Could not connect."); + ImGui::PopStyleColor(); + } + } + } + ImGui::TreePop(); + } +} + +void SubtitleEditor::draw_all_cutscene_groups() { + for (auto& group_name : m_subtitle_db.m_subtitle_groups->m_group_order) { + ImGui::SetNextItemOpen(true); + if (ImGui::TreeNode(group_name.c_str())) { + draw_all_scenes(group_name, false); + draw_all_scenes(group_name, true); + ImGui::TreePop(); + } + } +} + +void SubtitleEditor::draw_all_hint_groups() { + for (auto& group_name : m_subtitle_db.m_subtitle_groups->m_group_order) { + ImGui::SetNextItemOpen(true); + if (ImGui::TreeNode(group_name.c_str())) { + draw_all_hints(group_name, false); + draw_all_hints(group_name, true); + ImGui::TreePop(); + } + } +} + +void SubtitleEditor::draw_all_scenes(std::string group_name, bool base_cutscenes) { + auto& scenes = + m_subtitle_db.m_banks.at(base_cutscenes ? m_base_language : m_current_language)->m_scenes; + auto scenes_in_group = m_subtitle_db.m_subtitle_groups->m_groups[group_name]; + for (auto& scene_name : scenes_in_group) { + if (scenes.count(scene_name) == 0) { + continue; + } + auto& scene_info = scenes[scene_name]; + // Don't duplicate entries + if (base_cutscenes && is_scene_in_current_lang(scene_name)) { + continue; + } + bool is_current_scene = m_current_scene && m_current_scene->m_name == scene_info.m_name; + if (scene_info.m_kind != SubtitleSceneKind::Movie) { + continue; + } + if ((!m_filter.empty() && m_filter != m_filter_placeholder) && + scene_name.find(m_filter) == std::string::npos) { + continue; + } + if (!base_cutscenes && is_current_scene) { + ImGui::PushStyleColor(ImGuiCol_Text, m_selected_text_color); + } + if (base_cutscenes) { + ImGui::PushStyleColor(ImGuiCol_Text, m_disabled_text_color); + } + + if (ImGui::TreeNode( + fmt::format("{}-{}", scene_name, base_cutscenes ? m_base_language : m_current_language) + .c_str(), + "%s", scene_name.c_str())) { + if (base_cutscenes || is_current_scene) { + ImGui::PopStyleColor(); + } + if (!base_cutscenes && !is_current_scene) { + if (ImGui::Button("Select as Current")) { + m_current_scene = &scene_info; + } + } + if (base_cutscenes) { + if (ImGui::Button("Copy from Base Language")) { + m_subtitle_db.m_banks.at(m_current_language)->add_scene(scene_info); + } + } + draw_subtitle_options(scene_info); + ImGui::TreePop(); + } else if (base_cutscenes || is_current_scene) { + ImGui::PopStyleColor(); + } + } +} + +void SubtitleEditor::draw_all_hints(std::string group_name, bool base_cutscenes) { + auto& scenes = + m_subtitle_db.m_banks.at(base_cutscenes ? m_base_language : m_current_language)->m_scenes; + auto scenes_in_group = m_subtitle_db.m_subtitle_groups->m_groups[group_name]; + for (auto& scene_name : scenes_in_group) { + if (scenes.count(scene_name) == 0) { + continue; + } + auto& scene_info = scenes[scene_name]; + // Don't duplicate entries + if (base_cutscenes && is_scene_in_current_lang(scene_name)) { + continue; + } + if (scene_info.m_kind != SubtitleSceneKind::Hint && + scene_info.m_kind != SubtitleSceneKind::HintNamed) { + continue; + } + if ((!m_filter.empty() && m_filter != m_filter_placeholder) && + scene_name.find(m_filter) == std::string::npos) { + continue; + } + if (base_cutscenes) { + ImGui::PushStyleColor(ImGuiCol_Text, m_disabled_text_color); + } + + if (ImGui::TreeNode( + fmt::format("{}-{}", scene_name, base_cutscenes ? m_base_language : m_current_language) + .c_str(), + "%s", scene_name.c_str())) { + if (base_cutscenes) { + ImGui::PopStyleColor(); + } + if (base_cutscenes) { + if (ImGui::Button("Copy from Base Language")) { + m_subtitle_db.m_banks.at(m_current_language)->add_scene(scene_info); + } + } + draw_subtitle_options(scene_info); + ImGui::TreePop(); + } else if (base_cutscenes) { + ImGui::PopStyleColor(); + } + } +} + +void SubtitleEditor::draw_subtitle_options(GameSubtitleSceneInfo& scene, bool current_scene) { + if (!m_repl.is_connected()) { + ImGui::PushStyleColor(ImGuiCol_Text, m_error_text_color); + ImGui::Text("REPL not connected, can't play!"); + ImGui::PopStyleColor(); + } else { + // Cutscenes + if (scene.m_kind == SubtitleSceneKind::Movie && m_db.count(scene.m_name) > 0) { + if (ImGui::Button("Play Scene")) { + repl_execute_cutscene_code(m_db[scene.m_name]); + } + ImGui::SameLine(); + ImGui::PushStyleColor(ImGuiCol_Text, m_disabled_text_color); + ImGui::TextWrapped("You may have to click twice, load times cause issues"); + ImGui::PopStyleColor(); + ImGui::NewLine(); + } + // Hints + else if (scene.m_kind == SubtitleSceneKind::Hint || + scene.m_kind == SubtitleSceneKind::HintNamed) { + if (ImGui::Button("Play Hint")) { + repl_play_hint(scene.m_name); + } + ImGui::SameLine(); + ImGui::PushStyleColor(ImGuiCol_Text, m_disabled_text_color); + ImGui::TextWrapped("You may have to click twice, load times cause issues"); + ImGui::PopStyleColor(); + ImGui::NewLine(); + } + } + if (ImGui::BeginCombo("Sorting Group", scene.m_sorting_group.c_str())) { + for (size_t i = 0; i < m_subtitle_db.m_subtitle_groups->m_group_order.size(); ++i) { + const bool isSelected = (scene.m_sorting_group_idx == (int)i); + if (ImGui::Selectable(m_subtitle_db.m_subtitle_groups->m_group_order[i].c_str(), + isSelected)) { + // Remove from current group + m_subtitle_db.m_subtitle_groups->remove_scene(scene.m_sorting_group, scene.m_name); + // Add to new group + scene.m_sorting_group_idx = i; + scene.m_sorting_group = m_subtitle_db.m_subtitle_groups->m_group_order.at(i); + m_subtitle_db.m_subtitle_groups->add_scene(scene.m_sorting_group, scene.m_name); + } + if (isSelected) { + ImGui::SetItemDefaultFocus(); + } + } + ImGui::EndCombo(); + } + if (current_scene) { + draw_new_cutscene_line_form(); + } + for (size_t i = 0; i < scene.m_lines.size(); i++) { + auto& subtitleLine = scene.m_lines.at(i); + std::string summary; + if (subtitleLine.line_utf8.empty()) { + summary = fmt::format("[{}] Clear Screen", subtitleLine.frame); + } else { + summary = fmt::format("[{}] {} - '{}...'", subtitleLine.frame, subtitleLine.speaker_utf8, + subtitleLine.line_utf8.substr(0, 30)); + } + if (subtitleLine.line_utf8.empty()) { + ImGui::PushStyleColor(ImGuiCol_Text, m_disabled_text_color); + } else if (subtitleLine.offscreen) { + ImGui::PushStyleColor(ImGuiCol_Text, m_offscreen_text_color); + } + if (ImGui::TreeNode(fmt::format("{}", i).c_str(), "%s", summary.c_str())) { + if (subtitleLine.line_utf8.empty() || subtitleLine.offscreen) { + ImGui::PopStyleColor(); + } + ImGui::InputInt("Starting Frame", &subtitleLine.frame, + ImGuiInputTextFlags_::ImGuiInputTextFlags_CharsDecimal); + ImGui::InputText("Speaker", &subtitleLine.speaker_utf8); + ImGui::InputText("Text", &subtitleLine.line_utf8); + ImGui::Checkbox("Offscreen?", &subtitleLine.offscreen); + ImGui::PushStyleColor(ImGuiCol_Button, m_warning_color); + if (ImGui::Button("Remove Line")) { + scene.m_lines.erase(scene.m_lines.begin() + i); + } + ImGui::PopStyleColor(); + ImGui::TreePop(); + } else if (subtitleLine.line_utf8.empty() || subtitleLine.offscreen) { + ImGui::PopStyleColor(); + } + } +} + +void SubtitleEditor::draw_new_cutscene_line_form() { + ImGui::InputInt("Frame Number", &m_current_scene_frame, + ImGuiInputTextFlags_::ImGuiInputTextFlags_CharsDecimal); + ImGui::InputText("Text", &m_current_scene_text); + ImGui::InputText("Speaker", &m_current_scene_speaker); + ImGui::Checkbox("Offscreen", &m_current_scene_offscreen); + bool rendered_text_entry_btn = false; + if (m_current_scene_frame < 0 || m_current_scene_text.empty() || + m_current_scene_speaker.empty()) { + ImGui::PushStyleColor(ImGuiCol_Text, m_error_text_color); + ImGui::Text("Can't add a new text entry with the current fields!"); + ImGui::PopStyleColor(); + } else { + rendered_text_entry_btn = true; + if (ImGui::Button("Add Text Entry")) { + m_current_scene->add_line(m_current_scene_frame, "", m_current_scene_text, "", + m_current_scene_speaker, m_current_scene_offscreen); + } + } + if (m_current_scene_frame < 0) { + ImGui::PushStyleColor(ImGuiCol_Text, m_error_text_color); + ImGui::Text("Can't add a clear screen entry with the current fields!"); + ImGui::PopStyleColor(); + } else { + if (rendered_text_entry_btn) { + ImGui::SameLine(); + if (ImGui::Button("Add Clear Screen Entry")) { + m_current_scene->add_line(m_current_scene_frame, "", "", "", "", false); + } + } + } + ImGui::NewLine(); +} diff --git a/game/tools/subtitles/subtitle_editor.h b/game/tools/subtitles/subtitle_editor.h new file mode 100644 index 0000000000..4d979482c2 --- /dev/null +++ b/game/tools/subtitles/subtitle_editor.h @@ -0,0 +1,91 @@ +#pragma once + +#include +#include + +#include "common/nrepl/ReplClient.h" +#include "common/serialization/subtitles/subtitles.h" + +#include "third-party/imgui/imgui.h" + +class SubtitleEditorDB { + public: + struct Entry { + std::string entity_type; + std::string process_name; + std::string continue_name; + std::vector move_to; + std::string execute_code; + bool move_first; + std::vector requirements; + }; +}; + +// TODO Later: +// - Hints, these seem less annoying but there are a lot of them + +class SubtitleEditor { + public: + SubtitleEditor(); + void draw_window(); + + private: + void draw_edit_options(); + void draw_repl_options(); + + void draw_all_cutscene_groups(); + void draw_all_scenes(std::string group_name, bool base_cutscenes = false); + void draw_subtitle_options(GameSubtitleSceneInfo& scene, bool current_scene = false); + void draw_new_cutscene_line_form(); + void draw_all_hint_groups(); + void draw_all_hints(std::string group_name, bool base_cutscenes); + + GameSubtitleDB m_subtitle_db; + std::map m_db = {}; + GameSubtitleSceneInfo* m_current_scene = nullptr; + std::string m_filter; + std::string m_filter_hints; + + ReplClient m_repl; + + int m_current_scene_frame = 0; + std::string m_current_scene_text = ""; + std::string m_current_scene_speaker = ""; + bool m_current_scene_offscreen = false; + + std::string m_new_scene_name = ""; + std::string m_new_scene_group = ""; + std::string m_new_scene_id = "0"; + + std::string m_new_scene_group_name = ""; + + std::string m_filter_placeholder = "Filter List..."; + + std::optional m_files_saved_successfully = {}; + + int m_base_language = 0; + int m_current_language = 0; + // bool m_base_show_lines = false; + bool m_base_show_missing_cutscenes = true; + + // TODO - let the user customize these colors + ImVec4 m_normal_text_color = ImVec4(1.0f, 0.0f, 1.0f, 1.0f); + int m_selected_text_color = IM_COL32(89, 227, 225, 255); + ImVec4 m_success_text_color = ImVec4(0.0f, 1.0f, 0.0f, 1.0f); + ImVec4 m_error_text_color = ImVec4(1.0f, 0.0f, 0.0f, 1.0f); + ImVec4 m_disabled_text_color = ImVec4(1.0f, 1.0f, 1.0f, 0.7f); + ImVec4 m_warning_color = ImVec4(0.619f, 0.443f, 0.0f, 1.0f); + int m_offscreen_text_color = IM_COL32(240, 242, 102, 255); + // TODO - cycle speaker colors + + void repl_set_continue_point(const std::string_view& continue_point); + void repl_move_jak(const double x, const double y, const double z); + void repl_reset_game(); + std::string repl_get_process_string(const std::string_view& entity_type, + const std::string_view& process_name); + void repl_execute_cutscene_code(const SubtitleEditorDB::Entry& entry); + void repl_rebuild_text(); + void repl_play_hint(const std::string_view& hint_name); + + bool is_scene_in_current_lang(const std::string& scene_name); +}; diff --git a/goal_src/build/all_files.gc b/goal_src/build/all_files.gc deleted file mode 100644 index 1cfabb873c..0000000000 --- a/goal_src/build/all_files.gc +++ /dev/null @@ -1,517 +0,0 @@ -(defglobalconstant all-kernel-goal-files - ("goal_src/kernel/gcommon.gc" - "goal_src/kernel/gstring-h.gc" - "goal_src/kernel/gkernel-h.gc" - "goal_src/kernel/gkernel.gc" - "goal_src/kernel/pskernel.gc" - "goal_src/kernel/gstring.gc" - "goal_src/kernel/dgo-h.gc" - "goal_src/kernel/gstate.gc") - ) - -(defglobalconstant all-goal-files - ( - "goal_src/engine/util/types-h.gc" - "goal_src/engine/ps2/vu1-macros.gc" - "goal_src/engine/math/math.gc" - "goal_src/engine/math/vector-h.gc" - "goal_src/engine/physics/gravity-h.gc" - "goal_src/engine/geometry/bounding-box-h.gc" - "goal_src/engine/math/matrix-h.gc" - "goal_src/engine/math/quaternion-h.gc" - "goal_src/engine/math/euler-h.gc" - "goal_src/engine/math/transform-h.gc" - "goal_src/engine/geometry/geometry-h.gc" - "goal_src/engine/math/trigonometry-h.gc" - "goal_src/engine/math/transformq-h.gc" - "goal_src/engine/geometry/bounding-box.gc" - "goal_src/engine/math/matrix.gc" - "goal_src/engine/math/transform.gc" - "goal_src/engine/math/quaternion.gc" - "goal_src/engine/math/euler.gc" - "goal_src/engine/geometry/geometry.gc" - "goal_src/engine/math/trigonometry.gc" - "goal_src/engine/sound/gsound-h.gc" - "goal_src/engine/ps2/timer-h.gc" - "goal_src/engine/ps2/timer.gc" - "goal_src/engine/ps2/vif-h.gc" - "goal_src/engine/dma/dma-h.gc" - "goal_src/engine/gfx/hw/video-h.gc" - "goal_src/engine/gfx/hw/vu1-user-h.gc" - "goal_src/engine/dma/dma.gc" - "goal_src/engine/dma/dma-buffer.gc" - "goal_src/engine/dma/dma-bucket.gc" - "goal_src/engine/dma/dma-disasm.gc" - "goal_src/pc/pckernel-h.gc" ;; added - "goal_src/engine/ps2/pad.gc" - "goal_src/engine/gfx/hw/gs.gc" - "goal_src/engine/gfx/hw/display-h.gc" - "goal_src/engine/math/vector.gc" - "goal_src/engine/load/file-io.gc" - "goal_src/engine/load/loader-h.gc" - "goal_src/engine/gfx/texture-h.gc" - "goal_src/engine/level/level-h.gc" - "goal_src/engine/camera/math-camera-h.gc" - "goal_src/engine/camera/math-camera.gc" - "goal_src/engine/gfx/font-h.gc" - "goal_src/engine/gfx/decomp-h.gc" - "goal_src/engine/gfx/hw/display.gc" - "goal_src/engine/engine/connect.gc" - "goal_src/engine/ui/text-h.gc" - "goal_src/engine/game/settings-h.gc" - "goal_src/engine/gfx/capture.gc" - "goal_src/engine/debug/memory-usage-h.gc" - "goal_src/engine/gfx/texture.gc" - "goal_src/engine/game/main-h.gc" - "goal_src/engine/anim/mspace-h.gc" - "goal_src/engine/draw/drawable-h.gc" - "goal_src/engine/draw/drawable-group-h.gc" - "goal_src/engine/draw/drawable-inline-array-h.gc" - "goal_src/engine/draw/draw-node-h.gc" - "goal_src/engine/draw/drawable-tree-h.gc" - "goal_src/engine/draw/drawable-actor-h.gc" - "goal_src/engine/draw/drawable-ambient-h.gc" - "goal_src/engine/game/task/game-task-h.gc" - "goal_src/engine/game/task/hint-control-h.gc" - "goal_src/engine/gfx/generic/generic-h.gc" - "goal_src/engine/gfx/lights-h.gc" - "goal_src/engine/gfx/ocean/ocean-h.gc" - "goal_src/engine/gfx/ocean/ocean-trans-tables.gc" - "goal_src/engine/gfx/ocean/ocean-tables.gc" - "goal_src/engine/gfx/ocean/ocean-frames.gc" - "goal_src/engine/gfx/sky/sky-h.gc" - "goal_src/engine/gfx/mood-h.gc" - "goal_src/engine/gfx/time-of-day-h.gc" - "goal_src/engine/data/art-h.gc" - "goal_src/engine/gfx/generic/generic-vu1-h.gc" - "goal_src/engine/gfx/merc/merc-h.gc" - "goal_src/engine/gfx/merc/generic-merc-h.gc" - "goal_src/engine/gfx/tie/generic-tie-h.gc" - "goal_src/engine/gfx/generic/generic-work-h.gc" - "goal_src/engine/gfx/shadow/shadow-cpu-h.gc" - "goal_src/engine/gfx/shadow/shadow-vu1-h.gc" - "goal_src/engine/ps2/memcard-h.gc" - "goal_src/engine/game/game-info-h.gc" - "goal_src/engine/gfx/wind-h.gc" - "goal_src/engine/gfx/tie/prototype-h.gc" - "goal_src/engine/anim/joint-h.gc" - "goal_src/engine/anim/bones-h.gc" - "goal_src/engine/engine/engines.gc" - "goal_src/engine/data/res-h.gc" - "goal_src/engine/data/res.gc" - "goal_src/engine/gfx/lights.gc" - "goal_src/engine/physics/dynamics-h.gc" - "goal_src/engine/target/surface-h.gc" - "goal_src/engine/target/pat-h.gc" - "goal_src/engine/game/fact-h.gc" - "goal_src/engine/anim/aligner-h.gc" - "goal_src/engine/game/game-h.gc" - "goal_src/engine/game/generic-obs-h.gc" - "goal_src/engine/camera/pov-camera-h.gc" - "goal_src/engine/util/sync-info-h.gc" - "goal_src/engine/util/smush-control-h.gc" - "goal_src/engine/physics/trajectory-h.gc" - "goal_src/engine/debug/debug-h.gc" - "goal_src/engine/target/joint-mod-h.gc" - "goal_src/engine/collide/collide-func-h.gc" - "goal_src/engine/collide/collide-mesh-h.gc" - "goal_src/engine/collide/collide-shape-h.gc" - "goal_src/engine/collide/collide-target-h.gc" - "goal_src/engine/collide/collide-touch-h.gc" - "goal_src/engine/collide/collide-edge-grab-h.gc" - "goal_src/engine/draw/process-drawable-h.gc" - "goal_src/engine/game/effect-control-h.gc" - "goal_src/engine/collide/collide-frag-h.gc" - "goal_src/engine/game/projectiles-h.gc" - "goal_src/engine/target/target-h.gc" - "goal_src/engine/gfx/depth-cue-h.gc" - "goal_src/engine/debug/stats-h.gc" - "goal_src/engine/gfx/vis/bsp-h.gc" - "goal_src/engine/collide/collide-cache-h.gc" - "goal_src/engine/collide/collide-h.gc" - "goal_src/engine/gfx/shrub/shrubbery-h.gc" - "goal_src/engine/gfx/tie/tie-h.gc" - "goal_src/engine/gfx/tfrag/tfrag-h.gc" - "goal_src/engine/gfx/background-h.gc" - "goal_src/engine/gfx/tfrag/subdivide-h.gc" - "goal_src/engine/entity/entity-h.gc" - "goal_src/engine/gfx/sprite/sprite-h.gc" - "goal_src/engine/gfx/shadow/shadow-h.gc" - "goal_src/engine/gfx/eye-h.gc" - "goal_src/engine/sparticle/sparticle-launcher-h.gc" - "goal_src/engine/sparticle/sparticle-h.gc" - "goal_src/engine/entity/actor-link-h.gc" - "goal_src/engine/camera/camera-h.gc" - "goal_src/engine/camera/cam-debug-h.gc" - "goal_src/engine/camera/cam-interface-h.gc" - "goal_src/engine/camera/cam-update-h.gc" - "goal_src/engine/debug/assert-h.gc" - "goal_src/engine/ui/hud-h.gc" - "goal_src/engine/ui/progress-h.gc" - "goal_src/engine/ps2/rpc-h.gc" - "goal_src/engine/nav/path-h.gc" - "goal_src/engine/nav/navigate-h.gc" - "goal_src/engine/load/load-dgo.gc" - "goal_src/engine/load/ramdisk.gc" - "goal_src/engine/sound/gsound.gc" - "goal_src/engine/math/transformq.gc" - "goal_src/engine/collide/collide-func.gc" - "goal_src/engine/anim/joint.gc" - "goal_src/engine/geometry/cylinder.gc" - "goal_src/engine/gfx/wind.gc" - "goal_src/engine/gfx/vis/bsp.gc" - "goal_src/engine/gfx/tfrag/subdivide.gc" - "goal_src/engine/gfx/sprite/sprite.gc" - "goal_src/engine/gfx/sprite/sprite-distort.gc" - "goal_src/engine/debug/debug-sphere.gc" - "goal_src/engine/debug/debug.gc" - "goal_src/engine/gfx/merc/merc-vu1.gc" - "goal_src/engine/gfx/merc/merc-blend-shape.gc" - "goal_src/engine/gfx/merc/merc.gc" - "goal_src/engine/gfx/ripple.gc" - "goal_src/engine/anim/bones.gc" - "goal_src/engine/gfx/generic/generic-vu0.gc" - "goal_src/engine/gfx/generic/generic.gc" - "goal_src/engine/gfx/generic/generic-vu1.gc" - "goal_src/engine/gfx/generic/generic-effect.gc" - "goal_src/engine/gfx/generic/generic-merc.gc" - "goal_src/engine/gfx/generic/generic-tie.gc" - "goal_src/engine/gfx/shadow/shadow-cpu.gc" - "goal_src/engine/gfx/shadow/shadow-vu1.gc" - "goal_src/engine/gfx/depth-cue.gc" - "goal_src/engine/gfx/font.gc" - "goal_src/engine/load/decomp.gc" - "goal_src/engine/gfx/background.gc" - "goal_src/engine/draw/draw-node.gc" - "goal_src/engine/gfx/shrub/shrubbery.gc" - "goal_src/engine/gfx/shrub/shrub-work.gc" - "goal_src/engine/gfx/tfrag/tfrag-near.gc" - "goal_src/engine/gfx/tfrag/tfrag.gc" - "goal_src/engine/gfx/tfrag/tfrag-methods.gc" - "goal_src/engine/gfx/tfrag/tfrag-work.gc" - "goal_src/engine/gfx/tie/tie.gc" - "goal_src/engine/gfx/tie/tie-near.gc" - "goal_src/engine/gfx/tie/tie-work.gc" - "goal_src/engine/gfx/tie/tie-methods.gc" - "goal_src/engine/util/sync-info.gc" - "goal_src/engine/physics/trajectory.gc" - "goal_src/engine/sparticle/sparticle-launcher.gc" - "goal_src/engine/sparticle/sparticle.gc" - "goal_src/engine/entity/entity-table.gc" - "goal_src/engine/load/loader.gc" - "goal_src/engine/game/task/task-control-h.gc" - "goal_src/engine/game/game-info.gc" - "goal_src/engine/game/game-save.gc" - "goal_src/engine/game/settings.gc" - "goal_src/pc/pckernel.gc" ;; added - "goal_src/engine/ambient/mood-tables.gc" - "goal_src/engine/ambient/mood.gc" - "goal_src/engine/ambient/weather-part.gc" - "goal_src/engine/gfx/time-of-day.gc" - "goal_src/engine/gfx/sky/sky-utils.gc" - "goal_src/engine/gfx/sky/sky.gc" - "goal_src/engine/gfx/sky/sky-tng.gc" - "goal_src/engine/level/load-boundary-h.gc" - "goal_src/engine/level/load-boundary.gc" - "goal_src/engine/level/load-boundary-data.gc" - "goal_src/engine/level/level-info.gc" - "goal_src/engine/level/level.gc" - "goal_src/engine/ui/text.gc" - "goal_src/pc/subtitle.gc" ;; added - "goal_src/engine/collide/collide-probe.gc" - "goal_src/engine/collide/collide-frag.gc" - "goal_src/engine/collide/collide-mesh.gc" - "goal_src/engine/collide/collide-touch.gc" - "goal_src/engine/collide/collide-edge-grab.gc" - "goal_src/engine/collide/collide-shape.gc" - "goal_src/engine/collide/collide-shape-rider.gc" - "goal_src/engine/collide/collide.gc" - "goal_src/engine/collide/collide-planes.gc" - "goal_src/engine/gfx/merc/merc-death.gc" - "goal_src/engine/gfx/water/water-h.gc" - "goal_src/engine/camera/camera.gc" - "goal_src/engine/camera/cam-interface.gc" - "goal_src/engine/camera/cam-master.gc" - "goal_src/engine/camera/cam-states.gc" - "goal_src/engine/camera/cam-states-dbg.gc" - "goal_src/engine/camera/cam-combiner.gc" - "goal_src/engine/camera/cam-update.gc" - "goal_src/engine/geometry/vol-h.gc" - "goal_src/engine/camera/cam-layout.gc" - "goal_src/engine/camera/cam-debug.gc" - "goal_src/engine/camera/cam-start.gc" - "goal_src/engine/draw/process-drawable.gc" - "goal_src/engine/game/task/hint-control.gc" - "goal_src/engine/ambient/ambient.gc" - "goal_src/engine/debug/assert.gc" - "goal_src/engine/game/generic-obs.gc" - "goal_src/engine/target/target-util.gc" - "goal_src/engine/target/target-part.gc" - "goal_src/engine/collide/collide-reaction-target.gc" - "goal_src/engine/target/logic-target.gc" - "goal_src/engine/target/sidekick.gc" - "goal_src/engine/game/voicebox.gc" - "goal_src/engine/target/target-handler.gc" - "goal_src/engine/target/target.gc" - "goal_src/engine/target/target2.gc" - "goal_src/engine/target/target-death.gc" - "goal_src/engine/debug/menu.gc" - "goal_src/engine/draw/drawable.gc" - "goal_src/engine/draw/drawable-group.gc" - "goal_src/engine/draw/drawable-inline-array.gc" - "goal_src/engine/draw/drawable-tree.gc" - "goal_src/engine/gfx/tie/prototype.gc" - "goal_src/engine/collide/main-collide.gc" - "goal_src/engine/game/video.gc" - "goal_src/engine/game/main.gc" - "goal_src/engine/collide/collide-cache.gc" - "goal_src/engine/entity/relocate.gc" - "goal_src/engine/debug/memory-usage.gc" - "goal_src/engine/entity/entity.gc" - "goal_src/engine/nav/path.gc" - "goal_src/engine/geometry/vol.gc" - "goal_src/engine/nav/navigate.gc" - "goal_src/engine/anim/aligner.gc" - "goal_src/engine/game/effect-control.gc" - "goal_src/engine/gfx/water/water.gc" - "goal_src/engine/game/collectables-part.gc" - "goal_src/engine/game/collectables.gc" - "goal_src/engine/game/task/task-control.gc" - "goal_src/engine/game/task/process-taskable.gc" - "goal_src/engine/camera/pov-camera.gc" - "goal_src/engine/game/powerups.gc" - "goal_src/engine/game/crates.gc" - "goal_src/engine/ui/hud.gc" - "goal_src/engine/ui/hud-classes.gc" - "goal_src/engine/ui/progress/progress-static.gc" - "goal_src/engine/ui/progress/progress-part.gc" - "goal_src/engine/ui/progress/progress-draw.gc" - "goal_src/engine/ui/progress/progress.gc" - "goal_src/engine/ui/credits.gc" - "goal_src/engine/game/projectiles.gc" - "goal_src/engine/gfx/ocean/ocean.gc" - "goal_src/engine/gfx/ocean/ocean-vu0.gc" - "goal_src/engine/gfx/ocean/ocean-texture.gc" - "goal_src/engine/gfx/ocean/ocean-mid.gc" - "goal_src/engine/gfx/ocean/ocean-transition.gc" - "goal_src/engine/gfx/ocean/ocean-near.gc" - "goal_src/engine/gfx/shadow/shadow.gc" - "goal_src/engine/gfx/eye.gc" - "goal_src/engine/util/glist-h.gc" - "goal_src/engine/util/glist.gc" - "goal_src/engine/debug/anim-tester.gc" - "goal_src/engine/debug/viewer.gc" - "goal_src/engine/debug/part-tester.gc" - "goal_src/engine/debug/default-menu.gc" - "goal_src/levels/common/texture-upload.gc" - "goal_src/levels/common/rigid-body-h.gc" - "goal_src/levels/common/water-anim.gc" - "goal_src/levels/common/dark-eco-pool.gc" - "goal_src/levels/common/rigid-body.gc" - "goal_src/levels/common/nav-enemy-h.gc" - "goal_src/levels/common/nav-enemy.gc" - "goal_src/levels/common/baseplat.gc" - "goal_src/levels/common/basebutton.gc" - "goal_src/levels/common/tippy.gc" - "goal_src/levels/common/joint-exploder.gc" - "goal_src/levels/common/babak.gc" - "goal_src/levels/common/sharkey.gc" - "goal_src/levels/common/orb-cache.gc" - "goal_src/levels/common/plat.gc" - "goal_src/levels/common/plat-button.gc" - "goal_src/levels/common/plat-eco.gc" - "goal_src/levels/common/ropebridge.gc" - "goal_src/levels/common/ticky.gc" - "goal_src/levels/misty/mistycannon.gc" - "goal_src/levels/misty/babak-with-cannon.gc" - "goal_src/levels/beach/air-h.gc" - "goal_src/levels/beach/air.gc" - "goal_src/levels/beach/wobbler.gc" - "goal_src/levels/beach/twister.gc" - "goal_src/levels/beach/beach-obs.gc" - "goal_src/levels/beach/bird-lady.gc" - "goal_src/levels/beach/bird-lady-beach.gc" - "goal_src/levels/beach/mayor.gc" - "goal_src/levels/beach/sculptor.gc" - "goal_src/levels/beach/pelican.gc" - "goal_src/levels/beach/lurkerworm.gc" - "goal_src/levels/beach/lurkercrab.gc" - "goal_src/levels/beach/lurkerpuppy.gc" - "goal_src/levels/beach/beach-rocks.gc" - "goal_src/levels/beach/seagull.gc" - "goal_src/levels/beach/beach-part.gc" - "goal_src/levels/village_common/villagep-obs.gc" - "goal_src/levels/village_common/oracle.gc" - "goal_src/levels/common/battlecontroller.gc" - "goal_src/levels/citadel/citadel-part.gc" - "goal_src/levels/citadel/citadel-obs.gc" - "goal_src/levels/citadel/citb-plat.gc" - "goal_src/levels/citadel/citadel-sages.gc" - "goal_src/levels/snow/snow-bunny.gc" - "goal_src/levels/citadel/citb-bunny.gc" - "goal_src/levels/citadel/citb-drop-plat.gc" - "goal_src/old/citb-drop-plat-OLD.gc" - "goal_src/levels/citadel/assistant-citadel.gc" - "goal_src/levels/demo/demo-obs.gc" - "goal_src/levels/demo/static-screen.gc" - "goal_src/levels/finalboss/robotboss-h.gc" - "goal_src/levels/finalboss/robotboss-part.gc" - "goal_src/levels/finalboss/sage-finalboss-part.gc" - "goal_src/levels/finalboss/light-eco.gc" - "goal_src/levels/finalboss/robotboss-weapon.gc" - "goal_src/levels/finalboss/robotboss-misc.gc" - "goal_src/levels/finalboss/green-eco-lurker.gc" - "goal_src/levels/finalboss/robotboss.gc" - "goal_src/levels/finalboss/final-door.gc" - "goal_src/levels/finalboss/sage-finalboss.gc" - "goal_src/old/sage-finalboss-OLD.gc" - "goal_src/levels/intro/evilbro.gc" - "goal_src/levels/jungleb/jungleb-obs.gc" - "goal_src/levels/jungleb/plat-flip.gc" - "goal_src/levels/jungleb/aphid.gc" - "goal_src/levels/jungleb/plant-boss.gc" - "goal_src/levels/jungle/jungle-elevator.gc" - "goal_src/levels/jungle/bouncer.gc" - "goal_src/levels/jungle/hopper.gc" - "goal_src/levels/jungle/junglesnake.gc" - "goal_src/levels/jungle/darkvine.gc" - "goal_src/levels/jungle/jungle-obs.gc" - "goal_src/levels/jungle/jungle-mirrors.gc" - "goal_src/levels/jungle/junglefish.gc" - "goal_src/levels/jungle/fisher.gc" - "goal_src/old/fisher-OLD.gc" - "goal_src/levels/jungle/jungle-part.gc" - "goal_src/levels/common/launcherdoor.gc" - "goal_src/old/target-racer-h-OLD.gc" - "goal_src/levels/racer_common/target-racer-h.gc" - "goal_src/levels/racer_common/racer-part.gc" - "goal_src/levels/racer_common/racer.gc" - "goal_src/old/target-racer-OLD.gc" - "goal_src/levels/racer_common/target-racer.gc" - "goal_src/old/racer-states-OLD.gc" - "goal_src/levels/racer_common/racer-states.gc" - "goal_src/levels/racer_common/collide-reaction-racer.gc" - "goal_src/levels/common/blocking-plane.gc" - "goal_src/levels/flut_common/flut-part.gc" - "goal_src/levels/flut_common/flutflut.gc" - "goal_src/levels/flut_common/target-flut.gc" - "goal_src/levels/village1/farmer.gc" - "goal_src/levels/village1/explorer.gc" - "goal_src/levels/village1/assistant.gc" - "goal_src/levels/village1/sage.gc" - "goal_src/levels/village1/yakow.gc" - "goal_src/old/village-obs-OLD.gc" - "goal_src/levels/village1/village-obs.gc" - "goal_src/levels/village1/fishermans-boat.gc" - "goal_src/levels/village1/village1-part.gc" - "goal_src/levels/village1/village1-part2.gc" - "goal_src/levels/village1/sequence-a-village1.gc" - "goal_src/levels/training/training-obs.gc" - "goal_src/levels/training/training-part.gc" - "goal_src/levels/misty/misty-obs.gc" - "goal_src/levels/misty/misty-warehouse.gc" - "goal_src/levels/misty/misty-conveyor.gc" - "goal_src/levels/misty/mud.gc" - "goal_src/levels/misty/muse.gc" - "goal_src/levels/misty/bonelurker.gc" - "goal_src/levels/misty/quicksandlurker.gc" - "goal_src/levels/misty/misty-teetertotter.gc" - "goal_src/levels/misty/balloonlurker.gc" - "goal_src/levels/misty/misty-part.gc" - "goal_src/levels/misty/sidekick-human.gc" - "goal_src/levels/firecanyon/firecanyon-part.gc" - "goal_src/levels/firecanyon/assistant-firecanyon.gc" - "goal_src/levels/village2/village2-part.gc" - "goal_src/levels/village2/village2-obs.gc" - "goal_src/levels/village2/village2-part2.gc" - "goal_src/levels/village2/gambler.gc" - "goal_src/levels/village2/warrior.gc" - "goal_src/levels/village2/geologist.gc" - "goal_src/levels/village2/swamp-blimp.gc" - "goal_src/levels/village2/sage-bluehut.gc" - "goal_src/levels/village2/flutflut-bluehut.gc" - "goal_src/levels/village2/assistant-village2.gc" - "goal_src/levels/village2/sunken-elevator.gc" - "goal_src/levels/swamp/swamp-obs.gc" - "goal_src/levels/swamp/swamp-bat.gc" - "goal_src/levels/swamp/swamp-rat.gc" - "goal_src/levels/swamp/swamp-rat-nest.gc" - "goal_src/levels/swamp/kermit.gc" - "goal_src/levels/swamp/swamp-part.gc" - "goal_src/levels/swamp/billy.gc" - "goal_src/levels/maincave/cavecrystal-light.gc" - "goal_src/levels/darkcave/darkcave-obs.gc" - "goal_src/levels/maincave/maincave-obs.gc" - "goal_src/levels/maincave/maincave-part.gc" - "goal_src/levels/maincave/spiderwebs.gc" - "goal_src/levels/maincave/dark-crystal.gc" - "goal_src/levels/maincave/baby-spider.gc" - "goal_src/levels/maincave/mother-spider-h.gc" - "goal_src/levels/maincave/mother-spider-egg.gc" - "goal_src/levels/maincave/mother-spider-proj.gc" - "goal_src/levels/maincave/mother-spider.gc" - "goal_src/levels/maincave/gnawer.gc" - "goal_src/levels/maincave/driller-lurker.gc" - "goal_src/levels/sunken/sunken-part.gc" - "goal_src/levels/sunken/sunken-part2.gc" - "goal_src/levels/sunken/sunken-part3.gc" - "goal_src/levels/sunken/sunken-part4.gc" - "goal_src/levels/sunken/sunken-part5.gc" - "goal_src/levels/sunken/target-tube.gc" - "goal_src/levels/sunken/sunken-obs.gc" - "goal_src/levels/sunken/shover.gc" - "goal_src/levels/sunken/square-platform.gc" - "goal_src/levels/sunken/sun-iris-door.gc" - "goal_src/levels/sunken/orbit-plat.gc" - "goal_src/levels/sunken/wedge-plats.gc" - "goal_src/levels/sunken/wall-plat.gc" - "goal_src/levels/sunken/qbert-plat.gc" - "goal_src/levels/sunken/steam-cap.gc" - "goal_src/levels/sunken/sun-exit-chamber.gc" - "goal_src/levels/sunken/floating-launcher.gc" - "goal_src/levels/sunken/sunken-water.gc" - "goal_src/levels/sunken/whirlpool.gc" - "goal_src/levels/sunken/sunken-pipegame.gc" - "goal_src/levels/sunken/bully.gc" - "goal_src/levels/sunken/double-lurker.gc" - "goal_src/levels/sunken/helix-water.gc" - "goal_src/levels/sunken/puffer.gc" - "goal_src/levels/sunken/sunken-fish.gc" - "goal_src/levels/rolling/rolling-obs.gc" - "goal_src/levels/rolling/rolling-lightning-mole.gc" - "goal_src/levels/rolling/rolling-robber.gc" - "goal_src/levels/rolling/rolling-race-ring.gc" - "goal_src/levels/firecanyon/firecanyon-obs.gc" - "goal_src/levels/ogre/ogre-part.gc" - "goal_src/levels/ogre/ogreboss.gc" - "goal_src/levels/ogre/ogre-obs.gc" - "goal_src/levels/ogre/flying-lurker.gc" - "goal_src/levels/village3/village3-part.gc" - "goal_src/levels/village3/village3-obs.gc" - "goal_src/levels/village3/minecart.gc" - "goal_src/levels/village3/miners.gc" - "goal_src/levels/village3/assistant-village3.gc" - "goal_src/levels/village3/sage-village3.gc" - "goal_src/levels/robocave/cave-trap.gc" - "goal_src/levels/robocave/spider-egg.gc" - "goal_src/levels/robocave/robocave-part.gc" - "goal_src/levels/snow/target-snowball.gc" - "goal_src/levels/snow/target-ice.gc" - "goal_src/levels/snow/ice-cube.gc" - "goal_src/levels/snow/snow-ball.gc" - "goal_src/levels/snow/snow-obs.gc" - "goal_src/levels/snow/snow-flutflut-obs.gc" - "goal_src/levels/snow/snow-bumper.gc" - "goal_src/levels/snow/snow-ram-h.gc" - "goal_src/levels/snow/snow-ram-boss.gc" - "goal_src/levels/snow/snow-ram.gc" - "goal_src/levels/snow/snow-part.gc" - "goal_src/levels/snow/yeti.gc" - "goal_src/levels/lavatube/lavatube-obs.gc" - "goal_src/levels/lavatube/lavatube-energy.gc" - "goal_src/levels/lavatube/lavatube-part.gc" - "goal_src/levels/lavatube/assistant-lavatube.gc" - "goal_src/levels/title/title-obs.gc" - "goal_src/old/lava/lava.gc" - ) - ) diff --git a/goal_src/build/all_objs_jak1_jp.json b/goal_src/build/all_objs_jak1_jp.json new file mode 100644 index 0000000000..a32e40c804 --- /dev/null +++ b/goal_src/build/all_objs_jak1_jp.json @@ -0,0 +1,2132 @@ +[["gcommon", "gcommon", 3, ["KERNEL"], ""], +["gstring-h", "gstring-h", 3, ["KERNEL"], ""], +["gkernel-h", "gkernel-h", 3, ["KERNEL"], ""], +["gkernel", "gkernel", 3, ["KERNEL"], ""], +["pskernel", "pskernel", 3, ["KERNEL"], ""], +["gstring", "gstring", 3, ["KERNEL"], ""], +["dgo-h", "dgo-h", 3, ["KERNEL"], ""], +["gstate", "gstate", 3, ["KERNEL"], ""], +["types-h", "types-h", 3, ["ENGINE", "GAME"], ""], +["vu1-macros", "vu1-macros", 3, ["ENGINE", "GAME"], ""], +["math", "math", 3, ["ENGINE", "GAME"], ""], +["vector-h", "vector-h", 3, ["ENGINE", "GAME"], ""], +["gravity-h", "gravity-h", 3, ["ENGINE", "GAME"], ""], +["bounding-box-h", "bounding-box-h", 3, ["ENGINE", "GAME"], ""], +["matrix-h", "matrix-h", 3, ["ENGINE", "GAME"], ""], +["quaternion-h", "quaternion-h", 3, ["ENGINE", "GAME"], ""], +["euler-h", "euler-h", 3, ["ENGINE", "GAME"], ""], +["transform-h", "transform-h", 3, ["ENGINE", "GAME"], ""], +["geometry-h", "geometry-h", 3, ["ENGINE", "GAME"], ""], +["trigonometry-h", "trigonometry-h", 3, ["ENGINE", "GAME"], ""], +["transformq-h", "transformq-h", 3, ["ENGINE", "GAME"], ""], +["bounding-box", "bounding-box", 3, ["ENGINE", "GAME"], ""], +["matrix", "matrix", 3, ["ENGINE", "GAME"], ""], +["transform", "transform", 3, ["ENGINE", "GAME"], ""], +["quaternion", "quaternion", 3, ["ENGINE", "GAME"], ""], +["euler", "euler", 3, ["ENGINE", "GAME"], ""], +["geometry", "geometry", 3, ["ENGINE", "GAME"], ""], +["trigonometry", "trigonometry", 3, ["ENGINE", "GAME"], ""], +["gsound-h", "gsound-h", 3, ["ENGINE", "GAME"], ""], +["timer-h", "timer-h", 3, ["ENGINE", "GAME"], ""], +["timer", "timer", 3, ["ENGINE", "GAME"], ""], +["vif-h", "vif-h", 3, ["ENGINE", "GAME"], ""], +["dma-h", "dma-h", 3, ["ENGINE", "GAME"], ""], +["video-h", "video-h", 3, ["ENGINE", "GAME"], ""], +["vu1-user-h", "vu1-user-h", 3, ["ENGINE", "GAME"], ""], +["dma", "dma", 3, ["ENGINE", "GAME"], ""], +["dma-buffer", "dma-buffer", 3, ["ENGINE", "GAME"], ""], +["dma-bucket", "dma-bucket", 3, ["ENGINE", "GAME"], ""], +["dma-disasm", "dma-disasm", 3, ["ENGINE", "GAME"], ""], +["pad", "pad", 3, ["ENGINE", "GAME"], ""], +["gs", "gs", 3, ["ENGINE", "GAME"], ""], +["display-h", "display-h", 3, ["ENGINE", "GAME"], ""], +["vector", "vector", 3, ["ENGINE", "GAME"], ""], +["file-io", "file-io", 3, ["ENGINE", "GAME"], ""], +["loader-h", "loader-h", 3, ["ENGINE", "GAME"], ""], +["texture-h", "texture-h", 3, ["ENGINE", "GAME"], ""], +["level-h", "level-h", 3, ["ENGINE", "GAME"], ""], +["math-camera-h", "math-camera-h", 3, ["ENGINE", "GAME"], ""], +["math-camera", "math-camera", 3, ["ENGINE", "GAME"], ""], +["font-h", "font-h", 3, ["ENGINE", "GAME"], ""], +["decomp-h", "decomp-h", 3, ["ENGINE", "GAME"], ""], +["display", "display", 3, ["ENGINE", "GAME"], ""], +["connect", "connect", 3, ["ENGINE", "GAME"], ""], +["text-h", "text-h", 3, ["ENGINE", "GAME"], ""], +["settings-h", "settings-h", 3, ["ENGINE", "GAME"], ""], +["capture", "capture", 3, ["ENGINE", "GAME"], ""], +["memory-usage-h", "memory-usage-h", 3, ["ENGINE", "GAME"], ""], +["texture", "texture", 3, ["ENGINE", "GAME"], ""], +["main-h", "main-h", 3, ["ENGINE", "GAME"], ""], +["mspace-h", "mspace-h", 3, ["ENGINE", "GAME"], ""], +["drawable-h", "drawable-h", 3, ["ENGINE", "GAME"], ""], +["drawable-group-h", "drawable-group-h", 3, ["ENGINE", "GAME"], ""], +["drawable-inline-array-h", "drawable-inline-array-h", 3, ["ENGINE", "GAME"], ""], +["draw-node-h", "draw-node-h", 3, ["ENGINE", "GAME"], ""], +["drawable-tree-h", "drawable-tree-h", 3, ["ENGINE", "GAME"], ""], +["drawable-actor-h", "drawable-actor-h", 3, ["ENGINE", "GAME"], ""], +["drawable-ambient-h", "drawable-ambient-h", 3, ["ENGINE", "GAME"], ""], +["game-task-h", "game-task-h", 3, ["ENGINE", "GAME"], ""], +["hint-control-h", "hint-control-h", 3, ["ENGINE", "GAME"], ""], +["generic-h", "generic-h", 3, ["ENGINE", "GAME"], ""], +["lights-h", "lights-h", 3, ["ENGINE", "GAME"], ""], +["ocean-h", "ocean-h", 3, ["ENGINE", "GAME"], ""], +["ocean-trans-tables", "ocean-trans-tables", 3, ["ENGINE", "GAME"], ""], +["ocean-tables", "ocean-tables", 3, ["ENGINE", "GAME"], ""], +["ocean-frames", "ocean-frames", 3, ["ENGINE", "GAME"], ""], +["sky-h", "sky-h", 3, ["ENGINE", "GAME"], ""], +["mood-h", "mood-h", 3, ["ENGINE", "GAME"], ""], +["time-of-day-h", "time-of-day-h", 3, ["ENGINE", "GAME"], ""], +["art-h", "art-h", 3, ["ENGINE", "GAME"], ""], +["generic-vu1-h", "generic-vu1-h", 3, ["ENGINE", "GAME"], ""], +["merc-h", "merc-h", 3, ["ENGINE", "GAME"], ""], +["generic-merc-h", "generic-merc-h", 3, ["ENGINE", "GAME"], ""], +["generic-tie-h", "generic-tie-h", 3, ["ENGINE", "GAME"], ""], +["generic-work-h", "generic-work-h", 3, ["ENGINE", "GAME"], ""], +["shadow-cpu-h", "shadow-cpu-h", 3, ["ENGINE", "GAME"], ""], +["shadow-vu1-h", "shadow-vu1-h", 3, ["ENGINE", "GAME"], ""], +["memcard-h", "memcard-h", 3, ["ENGINE", "GAME"], ""], +["game-info-h", "game-info-h", 3, ["ENGINE", "GAME"], ""], +["wind-h", "wind-h", 3, ["ENGINE", "GAME"], ""], +["prototype-h", "prototype-h", 3, ["ENGINE", "GAME"], ""], +["joint-h", "joint-h", 3, ["ENGINE", "GAME"], ""], +["bones-h", "bones-h", 3, ["ENGINE", "GAME"], ""], +["engines", "engines", 3, ["ENGINE", "GAME"], ""], +["res-h", "res-h", 3, ["ENGINE", "GAME"], ""], +["res", "res", 3, ["ENGINE", "GAME"], ""], +["lights", "lights", 3, ["ENGINE", "GAME"], ""], +["dynamics-h", "dynamics-h", 3, ["ENGINE", "GAME"], ""], +["surface-h", "surface-h", 3, ["ENGINE", "GAME"], ""], +["pat-h", "pat-h", 3, ["ENGINE", "GAME"], ""], +["fact-h", "fact-h", 3, ["ENGINE", "GAME"], ""], +["aligner-h", "aligner-h", 3, ["ENGINE", "GAME"], ""], +["game-h", "game-h", 3, ["ENGINE", "GAME"], ""], +["generic-obs-h", "generic-obs-h", 3, ["ENGINE", "GAME"], ""], +["pov-camera-h", "pov-camera-h", 3, ["ENGINE", "GAME"], ""], +["sync-info-h", "sync-info-h", 3, ["ENGINE", "GAME"], ""], +["smush-control-h", "smush-control-h", 3, ["ENGINE", "GAME"], ""], +["trajectory-h", "trajectory-h", 3, ["ENGINE", "GAME"], ""], +["debug-h", "debug-h", 3, ["ENGINE", "GAME"], ""], +["joint-mod-h", "joint-mod-h", 3, ["ENGINE", "GAME"], ""], +["collide-func-h", "collide-func-h", 3, ["ENGINE", "GAME"], ""], +["collide-mesh-h", "collide-mesh-h", 3, ["ENGINE", "GAME"], ""], +["collide-shape-h", "collide-shape-h", 3, ["ENGINE", "GAME"], ""], +["collide-target-h", "collide-target-h", 3, ["ENGINE", "GAME"], ""], +["collide-touch-h", "collide-touch-h", 3, ["ENGINE", "GAME"], ""], +["collide-edge-grab-h", "collide-edge-grab-h", 3, ["ENGINE", "GAME"], ""], +["process-drawable-h", "process-drawable-h", 3, ["ENGINE", "GAME"], ""], +["effect-control-h", "effect-control-h", 3, ["ENGINE", "GAME"], ""], +["collide-frag-h", "collide-frag-h", 3, ["ENGINE", "GAME"], ""], +["projectiles-h", "projectiles-h", 3, ["ENGINE", "GAME"], ""], +["target-h", "target-h", 3, ["ENGINE", "GAME"], ""], +["depth-cue-h", "depth-cue-h", 3, ["ENGINE", "GAME"], ""], +["stats-h", "stats-h", 3, ["ENGINE", "GAME"], ""], +["bsp-h", "bsp-h", 3, ["ENGINE", "GAME"], ""], +["collide-cache-h", "collide-cache-h", 3, ["ENGINE", "GAME"], ""], +["collide-h", "collide-h", 3, ["ENGINE", "GAME"], ""], +["shrubbery-h", "shrubbery-h", 3, ["ENGINE", "GAME"], ""], +["tie-h", "tie-h", 3, ["ENGINE", "GAME"], ""], +["tfrag-h", "tfrag-h", 3, ["ENGINE", "GAME"], ""], +["background-h", "background-h", 3, ["ENGINE", "GAME"], ""], +["subdivide-h", "subdivide-h", 3, ["ENGINE", "GAME"], ""], +["entity-h", "entity-h", 3, ["ENGINE", "GAME"], ""], +["sprite-h", "sprite-h", 3, ["ENGINE", "GAME"], ""], +["shadow-h", "shadow-h", 3, ["ENGINE", "GAME"], ""], +["eye-h", "eye-h", 3, ["ENGINE", "GAME"], ""], +["sparticle-launcher-h", "sparticle-launcher-h", 3, ["ENGINE", "GAME"], ""], +["sparticle-h", "sparticle-h", 3, ["ENGINE", "GAME"], ""], +["actor-link-h", "actor-link-h", 3, ["ENGINE", "GAME"], ""], +["camera-h", "camera-h", 3, ["ENGINE", "GAME"], ""], +["cam-debug-h", "cam-debug-h", 3, ["ENGINE", "GAME"], ""], +["cam-interface-h", "cam-interface-h", 3, ["ENGINE", "GAME"], ""], +["cam-update-h", "cam-update-h", 3, ["ENGINE", "GAME"], ""], +["assert-h", "assert-h", 3, ["ENGINE", "GAME"], ""], +["hud-h", "hud-h", 3, ["ENGINE", "GAME"], ""], +["progress-h", "progress-h", 3, ["ENGINE", "GAME"], ""], +["rpc-h", "rpc-h", 3, ["ENGINE", "GAME"], ""], +["path-h", "path-h", 3, ["ENGINE", "GAME"], ""], +["navigate-h", "navigate-h", 3, ["ENGINE", "GAME"], ""], +["load-dgo", "load-dgo", 3, ["ENGINE", "GAME"], ""], +["ramdisk", "ramdisk", 3, ["ENGINE", "GAME"], ""], +["gsound", "gsound", 3, ["ENGINE", "GAME"], ""], +["transformq", "transformq", 3, ["ENGINE", "GAME"], ""], +["collide-func", "collide-func", 3, ["ENGINE", "GAME"], ""], +["joint", "joint", 3, ["ENGINE", "GAME"], ""], +["cylinder", "cylinder", 3, ["ENGINE", "GAME"], ""], +["wind", "wind", 3, ["ENGINE", "GAME"], ""], +["bsp", "bsp", 3, ["ENGINE", "GAME"], ""], +["subdivide", "subdivide", 3, ["ENGINE", "GAME"], ""], +["sprite", "sprite", 3, ["ENGINE", "GAME"], ""], +["sprite-distort", "sprite-distort", 3, ["ENGINE", "GAME"], ""], +["debug-sphere", "debug-sphere", 3, ["ENGINE", "GAME"], ""], +["debug", "debug", 3, ["ENGINE", "GAME"], ""], +["merc-vu1", "merc-vu1", 3, ["ENGINE", "GAME"], ""], +["merc-blend-shape", "merc-blend-shape", 3, ["ENGINE", "GAME"], ""], +["merc", "merc", 3, ["ENGINE", "GAME"], ""], +["ripple", "ripple", 3, ["ENGINE", "GAME"], ""], +["bones", "bones", 3, ["ENGINE", "GAME"], ""], +["generic-vu0", "generic-vu0", 3, ["ENGINE", "GAME"], ""], +["generic", "generic", 3, ["ENGINE", "GAME"], ""], +["generic-vu1", "generic-vu1", 3, ["ENGINE", "GAME"], ""], +["generic-effect", "generic-effect", 3, ["ENGINE", "GAME"], ""], +["generic-merc", "generic-merc", 3, ["ENGINE", "GAME"], ""], +["generic-tie", "generic-tie", 3, ["ENGINE", "GAME"], ""], +["shadow-cpu", "shadow-cpu", 3, ["ENGINE", "GAME"], ""], +["shadow-vu1", "shadow-vu1", 3, ["ENGINE", "GAME"], ""], +["depth-cue", "depth-cue", 3, ["ENGINE", "GAME"], ""], +["font", "font", 3, ["ENGINE", "GAME"], ""], +["decomp", "decomp", 3, ["ENGINE", "GAME"], ""], +["background", "background", 3, ["ENGINE", "GAME"], ""], +["draw-node", "draw-node", 3, ["ENGINE", "GAME"], ""], +["shrubbery", "shrubbery", 3, ["ENGINE", "GAME"], ""], +["shrub-work", "shrub-work", 3, ["ENGINE", "GAME"], ""], +["tfrag-near", "tfrag-near", 3, ["ENGINE", "GAME"], ""], +["tfrag", "tfrag", 3, ["ENGINE", "GAME"], ""], +["tfrag-methods", "tfrag-methods", 3, ["ENGINE", "GAME"], ""], +["tfrag-work", "tfrag-work", 3, ["ENGINE", "GAME"], ""], +["tie", "tie", 3, ["ENGINE", "GAME"], ""], +["tie-near", "tie-near", 3, ["ENGINE", "GAME"], ""], +["tie-work", "tie-work", 3, ["ENGINE", "GAME"], ""], +["tie-methods", "tie-methods", 3, ["ENGINE", "GAME"], ""], +["sync-info", "sync-info", 3, ["ENGINE", "GAME"], ""], +["trajectory", "trajectory", 3, ["ENGINE", "GAME"], ""], +["sparticle-launcher", "sparticle-launcher", 3, ["ENGINE", "GAME"], ""], +["sparticle", "sparticle", 3, ["ENGINE", "GAME"], ""], +["entity-table", "entity-table", 3, ["ENGINE", "GAME"], ""], +["loader", "loader", 3, ["ENGINE", "GAME"], ""], +["task-control-h", "task-control-h", 3, ["ENGINE", "GAME"], ""], +["game-info", "game-info", 3, ["ENGINE", "GAME"], ""], +["game-save", "game-save", 3, ["ENGINE", "GAME"], ""], +["settings", "settings", 3, ["ENGINE", "GAME"], ""], +["mood-tables", "mood-tables", 3, ["ENGINE", "GAME"], ""], +["mood", "mood", 3, ["ENGINE", "GAME"], ""], +["weather-part", "weather-part", 3, ["ENGINE", "GAME"], ""], +["time-of-day", "time-of-day", 3, ["ENGINE", "GAME"], ""], +["sky-utils", "sky-utils", 3, ["ENGINE", "GAME"], ""], +["sky", "sky", 3, ["ENGINE", "GAME"], ""], +["sky-tng", "sky-tng", 3, ["ENGINE", "GAME"], ""], +["load-boundary-h", "load-boundary-h", 3, ["ENGINE", "GAME"], ""], +["load-boundary", "load-boundary", 3, ["ENGINE", "GAME"], ""], +["load-boundary-data", "load-boundary-data", 3, ["ENGINE", "GAME"], ""], +["level-info", "level-info", 3, ["ENGINE", "GAME"], ""], +["level", "level", 3, ["ENGINE", "GAME"], ""], +["text", "text", 3, ["ENGINE", "GAME"], ""], +["collide-probe", "collide-probe", 3, ["ENGINE", "GAME"], ""], +["collide-frag", "collide-frag", 3, ["ENGINE", "GAME"], ""], +["collide-mesh", "collide-mesh", 3, ["ENGINE", "GAME"], ""], +["collide-touch", "collide-touch", 3, ["ENGINE", "GAME"], ""], +["collide-edge-grab", "collide-edge-grab", 3, ["ENGINE", "GAME"], ""], +["collide-shape", "collide-shape", 3, ["ENGINE", "GAME"], ""], +["collide-shape-rider", "collide-shape-rider", 3, ["ENGINE", "GAME"], ""], +["collide", "collide", 3, ["ENGINE", "GAME"], ""], +["collide-planes", "collide-planes", 3, ["ENGINE", "GAME"], ""], +["merc-death", "merc-death", 3, ["ENGINE", "GAME"], ""], +["water-h", "water-h", 3, ["ENGINE", "GAME"], ""], +["camera", "camera", 3, ["ENGINE", "GAME"], ""], +["cam-interface", "cam-interface", 3, ["ENGINE", "GAME"], ""], +["cam-master", "cam-master", 3, ["ENGINE", "GAME"], ""], +["cam-states", "cam-states", 3, ["ENGINE", "GAME"], ""], +["cam-states-dbg", "cam-states-dbg", 3, ["ENGINE", "GAME"], ""], +["cam-combiner", "cam-combiner", 3, ["ENGINE", "GAME"], ""], +["cam-update", "cam-update", 3, ["ENGINE", "GAME"], ""], +["vol-h", "vol-h", 3, ["ENGINE", "GAME"], ""], +["cam-layout", "cam-layout", 3, ["ENGINE", "GAME"], ""], +["cam-debug", "cam-debug", 3, ["ENGINE", "GAME"], ""], +["cam-start", "cam-start", 3, ["ENGINE", "GAME"], ""], +["process-drawable", "process-drawable", 3, ["ENGINE", "GAME"], ""], +["hint-control", "hint-control", 3, ["ENGINE", "GAME"], ""], +["ambient", "ambient", 3, ["ENGINE", "GAME"], ""], +["assert", "assert", 3, ["ENGINE", "GAME"], ""], +["generic-obs", "generic-obs", 3, ["ENGINE", "GAME"], ""], +["target-util", "target-util", 3, ["ENGINE", "GAME"], ""], +["target-part", "target-part", 3, ["ENGINE", "GAME"], ""], +["collide-reaction-target", "collide-reaction-target", 3, ["ENGINE", "GAME"], ""], +["logic-target", "logic-target", 3, ["ENGINE", "GAME"], ""], +["sidekick", "sidekick", 3, ["ENGINE", "GAME"], ""], +["voicebox", "voicebox", 3, ["ENGINE", "GAME"], ""], +["target-handler", "target-handler", 3, ["ENGINE", "GAME"], ""], +["target", "target", 3, ["ENGINE", "GAME"], ""], +["target2", "target2", 3, ["ENGINE", "GAME"], ""], +["target-death", "target-death", 3, ["ENGINE", "GAME"], ""], +["menu", "menu", 3, ["ENGINE", "GAME"], ""], +["drawable", "drawable", 3, ["ENGINE", "GAME"], ""], +["drawable-group", "drawable-group", 3, ["ENGINE", "GAME"], ""], +["drawable-inline-array", "drawable-inline-array", 3, ["ENGINE", "GAME"], ""], +["drawable-tree", "drawable-tree", 3, ["ENGINE", "GAME"], ""], +["prototype", "prototype", 3, ["ENGINE", "GAME"], ""], +["main-collide", "main-collide", 3, ["ENGINE", "GAME"], ""], +["video", "video", 3, ["ENGINE", "GAME"], ""], +["main", "main", 3, ["ENGINE", "GAME"], ""], +["collide-cache", "collide-cache", 3, ["ENGINE", "GAME"], ""], +["relocate", "relocate", 3, ["ENGINE", "GAME"], ""], +["memory-usage", "memory-usage", 3, ["ENGINE", "GAME"], ""], +["entity", "entity", 3, ["ENGINE", "GAME"], ""], +["path", "path", 3, ["ENGINE", "GAME"], ""], +["vol", "vol", 3, ["ENGINE", "GAME"], ""], +["navigate", "navigate", 3, ["ENGINE", "GAME"], ""], +["aligner", "aligner", 3, ["ENGINE", "GAME"], ""], +["effect-control", "effect-control", 3, ["ENGINE", "GAME"], ""], +["water", "water", 3, ["ENGINE", "GAME"], ""], +["collectables-part", "collectables-part", 3, ["ENGINE", "GAME"], ""], +["collectables", "collectables", 3, ["ENGINE", "GAME"], ""], +["task-control", "task-control", 3, ["ENGINE", "GAME"], ""], +["process-taskable", "process-taskable", 3, ["ENGINE", "GAME"], ""], +["pov-camera", "pov-camera", 3, ["ENGINE", "GAME"], ""], +["powerups", "powerups", 3, ["ENGINE", "GAME"], ""], +["crates", "crates", 3, ["ENGINE", "GAME"], ""], +["hud", "hud", 3, ["ENGINE", "GAME"], ""], +["hud-classes", "hud-classes", 3, ["ENGINE", "GAME"], ""], +["progress-static", "progress-static", 3, ["ENGINE", "GAME"], ""], +["progress-part", "progress-part", 3, ["ENGINE", "GAME"], ""], +["progress-draw", "progress-draw", 3, ["ENGINE", "GAME"], ""], +["progress", "progress", 3, ["ENGINE", "GAME"], ""], +["credits", "credits", 3, ["ENGINE", "GAME"], ""], +["projectiles", "projectiles", 3, ["ENGINE", "GAME"], ""], +["ocean", "ocean", 3, ["ENGINE", "GAME"], ""], +["ocean-vu0", "ocean-vu0", 3, ["ENGINE", "GAME"], ""], +["ocean-texture", "ocean-texture", 3, ["ENGINE", "GAME"], ""], +["ocean-mid", "ocean-mid", 3, ["ENGINE", "GAME"], ""], +["ocean-transition", "ocean-transition", 3, ["ENGINE", "GAME"], ""], +["ocean-near", "ocean-near", 3, ["ENGINE", "GAME"], ""], +["shadow", "shadow", 3, ["ENGINE", "GAME"], ""], +["eye", "eye", 3, ["ENGINE", "GAME"], ""], +["glist-h", "glist-h", 3, ["ENGINE", "GAME"], ""], +["glist", "glist", 3, ["ENGINE", "GAME"], ""], +["anim-tester", "anim-tester", 3, ["ENGINE", "GAME"], ""], +["viewer", "viewer", 3, ["ENGINE", "GAME"], ""], +["part-tester", "part-tester", 3, ["ENGINE", "GAME"], ""], +["default-menu", "default-menu", 3, ["ENGINE", "GAME"], ""], +["dir-tpages", "dir-tpages", 4, ["GAME", "ART"], ""], +["tpage-463", "tpage-463", 4, ["GAME", "ART"], ""], +["tpage-2", "tpage-2", 4, ["GAME", "ART"], ""], +["tpage-880", "tpage-880", 4, ["GAME", "ART"], ""], +["tpage-256", "tpage-256", 4, ["GAME", "ART"], ""], +["tpage-1278", "tpage-1278", 4, ["GAME", "ART"], ""], +["texture-upload", "texture-upload", 3, ["GAME", "ART"], ""], +["tpage-1032", "tpage-1032", 4, ["GAME", "ART"], ""], +["tpage-62", "tpage-62", 4, ["GAME", "ART"], ""], +["tpage-1532", "tpage-1532", 4, ["GAME", "ART"], ""], +["fuel-cell-ag", "fuel-cell", 4, ["GAME", "ART"], ""], +["money-ag", "money", 4, ["GAME", "ART"], ""], +["buzzer-ag", "buzzer", 4, ["GAME", "ART"], ""], +["ecovalve-ag", "ecovalve", 4, ["GAME", "ART"], ""], +["ecovalve-ag", "ecovalve", 4, ["BEA"], ""], +["ecovalve-ag", "ecovalve", 4, ["CIT"], ""], +["ecovalve-ag", "ecovalve", 4, ["FIN"], ""], +["ecovalve-ag", "ecovalve", 4, ["JUB", "JUN"], ""], +["ecovalve-ag", "ecovalve", 4, ["FIC", "OGR"], ""], +["ecovalve-ag", "ecovalve", 4, ["LAV"], ""], +["ecovalve-ag", "ecovalve", 4, ["MAI"], ""], +["ecovalve-ag", "ecovalve", 4, ["ROB"], ""], +["ecovalve-ag", "ecovalve", 4, ["ROL"], ""], +["ecovalve-ag", "ecovalve", 4, ["SNO"], ""], +["ecovalve-ag", "ecovalve", 4, ["SUB"], ""], +["ecovalve-ag", "ecovalve", 4, ["SWA"], ""], +["ecovalve-ag", "ecovalve", 4, ["TRA"], ""], +["crate-ag", "crate", 4, ["GAME", "ART"], ""], +["speaker-ag", "speaker", 4, ["GAME", "ART"], ""], +["fuelcell-naked-ag", "fuelcell-naked", 4, ["GAME", "ART"], ""], +["eichar-ag", "eichar", 4, ["GAME", "ART"], ""], +["sidekick-ag", "sidekick", 4, ["GAME", "ART"], ""], +["deathcam-ag", "deathcam", 4, ["GAME", "ART"], ""], +["game-cnt", "game-cnt", 4, ["GAME", "ART"], ""], +["rigid-body-h", "rigid-body-h", 3, ["GAME", "COMMON", "L1"], ""], +["water-anim", "water-anim", 3, ["GAME", "COMMON", "L1", "WATER-AN"], ""], +["dark-eco-pool", "dark-eco-pool", 3, ["GAME", "COMMON", "L1"], ""], +["rigid-body", "rigid-body", 3, ["GAME", "COMMON", "L1"], ""], +["nav-enemy-h", "nav-enemy-h", 3, ["GAME", "COMMON", "L1"], ""], +["nav-enemy", "nav-enemy", 3, ["GAME", "COMMON", "L1"], ""], +["baseplat", "baseplat", 3, ["GAME", "COMMON", "L1"], ""], +["basebutton", "basebutton", 3, ["GAME", "COMMON", "L1"], ""], +["tippy", "tippy", 3, ["GAME", "COMMON", "L1"], ""], +["joint-exploder", "joint-exploder", 3, ["GAME", "COMMON", "L1"], ""], +["babak", "babak", 3, ["GAME", "COMMON", "L1"], ""], +["sharkey", "sharkey", 3, ["GAME", "COMMON", "L1"], ""], +["orb-cache", "orb-cache", 3, ["GAME", "COMMON", "L1"], ""], +["plat", "plat", 3, ["GAME", "COMMON", "L1"], ""], +["plat-button", "plat-button", 3, ["GAME", "COMMON", "L1"], ""], +["plat-eco", "plat-eco", 3, ["GAME", "COMMON", "L1"], ""], +["ropebridge", "ropebridge", 3, ["GAME", "COMMON", "L1"], ""], +["ticky", "ticky", 3, ["GAME", "COMMON", "L1"], ""], +["mistycannon", "mistycannon", 3, ["BEA", "L1", "MIS"], ""], +["babak-with-cannon", "babak-with-cannon", 3, ["BEA", "L1", "MIS"], ""], +["air-h", "air-h", 3, ["BEA", "L1"], ""], +["air", "air", 3, ["BEA", "L1"], ""], +["wobbler", "wobbler", 3, ["BEA", "L1"], ""], +["twister", "twister", 3, ["BEA", "L1"], ""], +["beach-obs", "beach-obs", 3, ["BEA", "L1"], ""], +["bird-lady", "bird-lady", 3, ["BEA", "L1"], ""], +["bird-lady-beach", "bird-lady-beach", 3, ["BEA", "L1"], ""], +["mayor", "mayor", 3, ["BEA", "L1"], ""], +["sculptor", "sculptor", 3, ["BEA", "L1"], ""], +["pelican", "pelican", 3, ["BEA", "L1"], ""], +["lurkerworm", "lurkerworm", 3, ["BEA", "L1"], ""], +["lurkercrab", "lurkercrab", 3, ["BEA", "L1"], ""], +["lurkerpuppy", "lurkerpuppy", 3, ["BEA", "L1"], ""], +["beach-rocks", "beach-rocks", 3, ["BEA", "L1"], ""], +["seagull", "seagull", 3, ["BEA", "L1"], ""], +["beach-part", "beach-part", 3, ["BEA", "L1"], ""], +["tpage-212", "tpage-212", 4, ["BEA"], ""], +["tpage-214", "tpage-214", 4, ["BEA"], ""], +["tpage-213", "tpage-213", 4, ["BEA"], ""], +["tpage-215", "tpage-215", 4, ["BEA"], ""], +["babak-ag", "babak", 4, ["BEA", "CIT", "JUN", "FIC", "MIS", "ROB", "ROL", "SNO", "SUB", "SUN", "SWA"], ""], +["barrel-ag", "barrel", 4, ["BEA"], ""], +["barrel-ag", "barrel", 4, ["VI2"], ""], +["beachcam-ag", "beachcam", 4, ["BEA"], ""], +["bird-lady-ag", "bird-lady", 4, ["BEA"], ""], +["bird-lady-beach-ag", "bird-lady-beach", 4, ["BEA"], ""], +["bladeassm-ag", "bladeassm", 4, ["BEA"], ""], +["ecoventrock-ag", "ecoventrock", 4, ["BEA"], ""], +["flutflut-ag", "flutflut", 4, ["BEA"], ""], +["flutflutegg-ag", "flutflutegg", 4, ["BEA"], ""], +["grottopole-ag", "grottopole", 4, ["BEA"], ""], +["harvester-ag", "harvester", 4, ["BEA"], ""], +["kickrock-ag", "kickrock", 4, ["BEA"], ""], +["lrocklrg-ag", "lrocklrg", 4, ["BEA"], ""], +["lurkercrab-ag", "lurkercrab", 4, ["BEA"], ""], +["lurkerpuppy-ag", "lurkerpuppy", 4, ["BEA"], ""], +["lurkerworm-ag", "lurkerworm", 4, ["BEA"], ""], +["mayor-ag", "mayor", 4, ["BEA"], ""], +["mistycannon-ag", "mistycannon", 4, ["BEA", "MIS"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["BEA"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["CIT"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["JUN"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["MIS"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["SNO"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["SUN"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["VI1"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["VI2"], ""], +["pelican-ag", "pelican", 4, ["BEA"], ""], +["sack-ag", "sack", 4, ["BEA"], ""], +["sack-ag", "sack", 4, ["MIS"], ""], +["sculptor-ag", "sculptor", 4, ["BEA"], ""], +["sculptor-muse-ag", "sculptor-muse", 4, ["BEA"], ""], +["seagull-ag", "seagull", 4, ["BEA"], ""], +["sharkey-ag", "sharkey", 4, ["BEA", "TRA", "VI2"], ""], +["sharkey-ag", "sharkey", 4, ["JUN", "MIS"], ""], +["sharkey-ag", "sharkey", 4, ["SWA"], ""], +["sharkey-ag", "sharkey", 4, ["VI1"], ""], +["windmill-one-ag", "windmill-one", 4, ["BEA"], ""], +["beach-vis", "beach-vis", 4, ["BEA"], ""], +["villagep-obs", "villagep-obs", 3, ["CIT", "L1", "VI1", "VI2", "VI3", "VILLAGEP"], ""], +["oracle", "oracle", 3, ["CIT", "L1", "VI1", "VI2", "VI3", "VILLAGEP"], ""], +["battlecontroller", "battlecontroller", 3, ["CIT", "L1", "MIS", "SWA"], ""], +["citadel-part", "citadel-part", 3, ["CIT", "L1"], ""], +["citadel-obs", "citadel-obs", 3, ["CIT"], ""], +["citadel-obs-OLD", "citadel-obs", 3, ["L1"], ""], +["citb-plat", "citb-plat", 3, ["CIT", "L1"], ""], +["citadel-sages", "citadel-sages", 3, ["CIT"], ""], +["citadel-sages-OLD", "citadel-sages", 3, ["L1"], ""], +["snow-bunny", "snow-bunny", 3, ["CIT", "L1", "SNO"], ""], +["citb-bunny", "citb-bunny", 3, ["CIT", "L1"], ""], +["citb-drop-plat", "citb-drop-plat", 3, ["CIT", "L1"], ""], +["assistant-citadel", "assistant-citadel", 3, ["CIT", "L1"], ""], +["tpage-1415", "tpage-1415", 4, ["CIT"], ""], +["tpage-1417", "tpage-1417", 4, ["CIT"], ""], +["tpage-1416", "tpage-1416", 4, ["CIT"], ""], +["tpage-1414", "tpage-1414", 4, ["CIT"], ""], +["assistant-lavatube-end-ag", "assistant-lavatube-end", 4, ["CIT"], ""], +["bluesage-ag", "bluesage", 4, ["CIT"], ""], +["citadelcam-ag", "citadelcam", 4, ["CIT"], ""], +["citb-arm-ag", "citb-arm", 4, ["CIT"], ""], +["citb-arm-shoulder-ag", "citb-arm-shoulder", 4, ["CIT"], ""], +["citb-bunny-ag", "citb-bunny", 4, ["CIT"], ""], +["citb-button-ag", "citb-button", 4, ["CIT"], ""], +["citb-chain-plat-ag", "citb-chain-plat", 4, ["CIT"], ""], +["citb-chains-ag", "citb-chains", 4, ["CIT"], ""], +["citb-coil-ag", "citb-coil", 4, ["CIT"], ""], +["citb-disc-ag", "citb-disc", 4, ["CIT"], ""], +["citb-donut-ag", "citb-donut", 4, ["CIT"], ""], +["citb-drop-plat-ag", "citb-drop-plat", 4, ["CIT"], ""], +["citb-exit-plat-ag", "citb-exit-plat", 4, ["CIT"], ""], +["citb-firehose-ag", "citb-firehose", 4, ["CIT"], ""], +["citb-generator-ag", "citb-generator", 4, ["CIT"], ""], +["citb-hose-ag", "citb-hose", 4, ["CIT"], ""], +["citb-iris-door-ag", "citb-iris-door", 4, ["CIT"], ""], +["citb-launcher-ag", "citb-launcher", 4, ["CIT"], ""], +["citb-robotboss-ag", "citb-robotboss", 4, ["CIT"], ""], +["citb-rotatebox-ag", "citb-rotatebox", 4, ["CIT"], ""], +["citb-sagecage-ag", "citb-sagecage", 4, ["CIT"], ""], +["citb-stopbox-ag", "citb-stopbox", 4, ["CIT"], ""], +["evilbro-citadel-ag", "evilbro-citadel", 4, ["CIT"], ""], +["evilsis-citadel-ag", "evilsis-citadel", 4, ["CIT"], ""], +["green-sagecage-ag", "green-sagecage", 4, ["CIT", "FIN"], ""], +["plat-citb-ag", "plat-citb", 4, ["CIT"], ""], +["plat-eco-citb-ag", "plat-eco-citb", 4, ["CIT"], ""], +["redsage-ag", "redsage", 4, ["CIT"], ""], +["warp-gate-switch-ag", "warp-gate-switch", 4, ["CIT"], ""], +["warp-gate-switch-ag", "warp-gate-switch", 4, ["TRA"], ""], +["warp-gate-switch-ag", "warp-gate-switch", 4, ["VI1", "VI3"], ""], +["warp-gate-switch-ag", "warp-gate-switch", 4, ["VI2"], ""], +["warpgate-ag", "warpgate", 4, ["CIT", "TRA", "VI1", "VI2", "VI3"], ""], +["yellowsage-ag", "yellowsage", 4, ["CIT"], ""], +["citadel-vis", "citadel-vis", 4, ["CIT"], ""], +["darkcave-obs", "darkcave-obs", 3, ["DAR", "L1"], ""], +["tpage-1306", "tpage-1306", 4, ["DAR"], ""], +["tpage-1307", "tpage-1307", 4, ["DAR"], ""], +["tpage-1305", "tpage-1305", 4, ["DAR"], ""], +["tpage-1304", "tpage-1304", 4, ["DAR"], ""], +["tpage-1352", "tpage-1352", 4, ["DAR"], ""], +["baby-spider-ag", "baby-spider", 4, ["DAR"], ""], +["baby-spider-ag", "baby-spider", 4, ["MAI"], ""], +["baby-spider-ag", "baby-spider", 4, ["ROB"], ""], +["cavecrystal-ag", "cavecrystal", 4, ["DAR"], ""], +["caveelevator-ag", "caveelevator", 4, ["DAR", "ROB"], ""], +["cavespatula-darkcave-ag", "cavespatula-darkcave", 4, ["DAR"], ""], +["cavetrapdoor-ag", "cavetrapdoor", 4, ["DAR"], ""], +["cavetrapdoor-ag", "cavetrapdoor", 4, ["MAI"], ""], +["cavetrapdoor-ag", "cavetrapdoor", 4, ["ROB"], ""], +["dark-crystal-ag", "dark-crystal", 4, ["DAR", "MAI"], ""], +["mother-spider-ag", "mother-spider", 4, ["DAR", "MAI"], ""], +["spider-egg-ag", "spider-egg", 4, ["DAR", "MAI"], ""], +["spider-egg-ag", "spider-egg", 4, ["ROB"], ""], +["water-anim-darkcave-ag", "water-anim-darkcave", 4, ["DAR"], ""], +["darkcave-vis", "darkcave-vis", 4, ["DAR"], ""], +["demo-obs", "demo-obs", 3, ["DEM", "L1"], ""], +["tpage-1485", "tpage-1485", 4, ["DEM", "L1"], ""], +["tpage-1486", "tpage-1486", 4, ["DEM", "L1"], ""], +["tpage-1487", "tpage-1487", 4, ["DEM", "L1"], ""], +["tpage-1599", "tpage-1599", 4, ["DEM", "L1"], ""], +["tpage-1600", "tpage-1600", 4, ["DEM", "L1"], ""], +["tpage-1601", "tpage-1601", 4, ["DEM", "L1"], ""], +["tpage-1602", "tpage-1602", 4, ["DEM", "L1"], ""], +["tpage-1603", "tpage-1603", 4, ["DEM", "L1"], ""], +["tpage-1604", "tpage-1604", 4, ["DEM", "L1"], ""], +["tpage-1605", "tpage-1605", 4, ["DEM", "L1"], ""], +["tpage-1606", "tpage-1606", 4, ["DEM", "L1"], ""], +["tpage-1607", "tpage-1607", 4, ["DEM", "L1"], ""], +["static-screen", "static-screen", 3, ["DEM", "L1", "TIT"], ""], +["tpage-1480", "tpage-1480", 4, ["DEM"], ""], +["tpage-1479", "tpage-1479", 4, ["DEM"], ""], +["demo-vis", "demo-vis", 4, ["DEM"], ""], +["robotboss-h", "robotboss-h", 3, ["FIN", "L1"], ""], +["robotboss-part", "robotboss-part", 3, ["FIN", "L1"], ""], +["sage-finalboss-part", "sage-finalboss-part", 3, ["FIN", "L1"], ""], +["light-eco", "light-eco", 3, ["FIN", "L1"], ""], +["robotboss-weapon", "robotboss-weapon", 3, ["FIN", "L1"], ""], +["robotboss-misc", "robotboss-misc", 3, ["FIN", "L1"], ""], +["green-eco-lurker", "green-eco-lurker", 3, ["FIN", "L1"], ""], +["robotboss", "robotboss", 3, ["FIN", "L1"], ""], +["final-door", "final-door", 3, ["FIN", "L1"], ""], +["sage-finalboss", "sage-finalboss", 3, ["FIN", "L1"], ""], +["tpage-1419", "tpage-1419", 4, ["FIN"], ""], +["tpage-1420", "tpage-1420", 4, ["FIN"], ""], +["tpage-634", "tpage-634", 4, ["FIN"], ""], +["tpage-1418", "tpage-1418", 4, ["FIN"], ""], +["tpage-545", "tpage-545", 4, ["FIN"], ""], +["darkecobomb-ag", "darkecobomb", 4, ["FIN"], ""], +["ecoclaw-ag", "ecoclaw", 4, ["FIN"], ""], +["finalbosscam-ag", "finalbosscam", 4, ["FIN"], ""], +["green-eco-lurker-ag", "green-eco-lurker", 4, ["FIN"], ""], +["greenshot-ag", "greenshot", 4, ["FIN"], ""], +["jak-white-ag", "jak-white", 4, ["FIN"], ""], +["light-eco-ag", "light-eco", 4, ["FIN"], ""], +["plat-eco-finalboss-ag", "plat-eco-finalboss", 4, ["FIN"], ""], +["power-left-ag", "power-left", 4, ["FIN"], ""], +["power-right-ag", "power-right", 4, ["FIN"], ""], +["powercellalt-ag", "powercellalt", 4, ["FIN"], ""], +["redring-ag", "redring", 4, ["FIN"], ""], +["robotboss-ag", "robotboss", 4, ["FIN"], ""], +["robotboss-blueeco-ag", "robotboss-blueeco", 4, ["FIN"], ""], +["robotboss-cinematic-ag", "robotboss-cinematic", 4, ["FIN"], ""], +["robotboss-redeco-ag", "robotboss-redeco", 4, ["FIN"], ""], +["robotboss-yelloweco-ag", "robotboss-yelloweco", 4, ["FIN"], ""], +["silodoor-ag", "silodoor", 4, ["FIN"], ""], +["water-anim-finalboss-ag", "water-anim-finalboss", 4, ["FIN"], ""], +["finalboss-vis", "finalboss-vis", 4, ["FIN"], ""], +["evilbro", "evilbro", 3, ["INT", "L1"], ""], +["tpage-1455", "tpage-1455", 4, ["INT"], ""], +["tpage-1457", "tpage-1457", 4, ["INT"], ""], +["tpage-1456", "tpage-1456", 4, ["INT"], ""], +["tpage-1454", "tpage-1454", 4, ["INT"], ""], +["evilbro-ag", "evilbro", 4, ["INT"], ""], +["evilsis-ag", "evilsis", 4, ["INT"], ""], +["intro-vis", "intro-vis", 4, ["INT"], ""], +["jungleb-obs", "jungleb-obs", 3, ["JUB", "L1"], ""], +["plat-flip", "plat-flip", 3, ["JUB", "L1"], ""], +["plant-boss-main+0-ag", "plant-boss-main+0", 4, ["JUB", "L1"], ""], +["aphid", "aphid", 3, ["JUB", "L1"], ""], +["plant-boss", "plant-boss", 3, ["JUB", "L1"], ""], +["tpage-485", "tpage-485", 4, ["JUB"], ""], +["tpage-510", "tpage-510", 4, ["JUB"], ""], +["tpage-507", "tpage-507", 4, ["JUB"], ""], +["tpage-966", "tpage-966", 4, ["JUB"], ""], +["aphid-lurker-ag", "aphid-lurker", 4, ["JUB"], ""], +["darkvine-ag", "darkvine", 4, ["JUB"], ""], +["darkvine-ag", "darkvine", 4, ["JUN"], ""], +["eggtop-ag", "eggtop", 4, ["JUB"], ""], +["jng-iris-door-ag", "jng-iris-door", 4, ["JUB"], ""], +["jng-iris-door-ag", "jng-iris-door", 4, ["TRA"], ""], +["plant-boss-ag", "plant-boss", 4, ["JUB"], ""], +["plat-flip-ag", "plat-flip", 4, ["JUB"], ""], +["plat-jungleb-ag", "plat-jungleb", 4, ["JUB"], ""], +["jungleb-vis", "jungleb-vis", 4, ["JUB"], ""], +["eichar-fish+0-ag", "eichar-fish+0", 4, ["JUN"], ""], +["eichar-fish+0-ag", "eichar-fish+0", 4, ["JUNGLE"], ""], +["eichar-fish+0-ag", "eichar-fish+0", 4, ["L1"], ""], +["jungle-elevator", "jungle-elevator", 3, ["JUN", "JUNGLE", "L1"], ""], +["bouncer", "bouncer", 3, ["JUN", "JUNGLE", "L1"], ""], +["hopper", "hopper", 3, ["JUN", "JUNGLE", "L1"], ""], +["junglesnake", "junglesnake", 3, ["JUN", "JUNGLE", "L1"], ""], +["darkvine", "darkvine", 3, ["JUN", "JUNGLE", "L1"], ""], +["jungle-obs", "jungle-obs", 3, ["JUN", "JUNGLE", "L1"], ""], +["jungle-mirrors", "jungle-mirrors", 3, ["JUN", "JUNGLE", "L1"], ""], +["junglefish", "junglefish", 3, ["JUN", "JUNGLE", "L1"], ""], +["fisher", "fisher", 3, ["JUN", "JUNGLE", "L1"], ""], +["jungle-part", "jungle-part", 3, ["JUN", "JUNGLE", "L1"], ""], +["launcherdoor", "launcherdoor", 3, ["JUN", "JUNGLE", "L1", "MAI", "MAINCAVE", "SUN", "SUNKEN"], ""], +["tpage-385", "tpage-385", 4, ["JUN"], ""], +["tpage-531", "tpage-531", 4, ["JUN"], ""], +["tpage-386", "tpage-386", 4, ["JUN"], ""], +["tpage-388", "tpage-388", 4, ["JUN"], ""], +["tpage-765", "tpage-765", 4, ["JUN"], ""], +["accordian-ag", "accordian", 4, ["JUN"], ""], +["bounceytarp-ag", "bounceytarp", 4, ["JUN"], ""], +["catch-fisha-ag", "catch-fisha", 4, ["JUN"], ""], +["catch-fishb-ag", "catch-fishb", 4, ["JUN"], ""], +["catch-fishc-ag", "catch-fishc", 4, ["JUN"], ""], +["fish-net-ag", "fish-net", 4, ["JUN"], ""], +["fisher-ag", "fisher", 4, ["JUN"], ""], +["hopper-ag", "hopper", 4, ["JUN"], ""], +["junglecam-ag", "junglecam", 4, ["JUN"], ""], +["junglefish-ag", "junglefish", 4, ["JUN"], ""], +["junglesnake-ag", "junglesnake", 4, ["JUN"], ""], +["launcherdoor-ag", "launcherdoor", 4, ["JUN"], ""], +["launcherdoor-ag", "launcherdoor", 4, ["SUN"], ""], +["logtrap-ag", "logtrap", 4, ["JUN"], ""], +["lurkerm-piston-ag", "lurkerm-piston", 4, ["JUN"], ""], +["lurkerm-tall-sail-ag", "lurkerm-tall-sail", 4, ["JUN"], ""], +["maindoor-ag", "maindoor", 4, ["JUN"], ""], +["medres-firecanyon-ag", "medres-firecanyon", 4, ["JUN"], ""], +["periscope-ag", "periscope", 4, ["JUN"], ""], +["plat-button-ag", "plat-button", 4, ["JUN"], ""], +["plat-eco-ag", "plat-eco", 4, ["JUN"], ""], +["plat-eco-ag", "plat-eco", 4, ["MIS"], ""], +["plat-eco-ag", "plat-eco", 4, ["ROB"], ""], +["plat-eco-ag", "plat-eco", 4, ["TRA"], ""], +["precurbridge-ag", "precurbridge", 4, ["JUN"], ""], +["reflector-mirror-ag", "reflector-mirror", 4, ["JUN"], ""], +["ropebridge-52-ag", "ropebridge-52", 4, ["JUN"], ""], +["ropebridge-70-ag", "ropebridge-70", 4, ["JUN"], ""], +["sidedoor-ag", "sidedoor", 4, ["JUN"], ""], +["towertop-ag", "towertop", 4, ["JUN"], ""], +["water-anim-jungle-ag", "water-anim-jungle", 4, ["JUN"], ""], +["jungle-vis", "jungle-vis", 4, ["JUN"], ""], +["target-racer-h", "target-racer-h", 3, ["FIC", "LAV", "MIS", "OGR", "ROL"], ""], +["target-racer-h-OLD", "target-racer-h", 3, ["L1", "RACERP"], ""], +["racer-part", "racer-part", 3, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["racer", "racer", 3, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["target-racer", "target-racer", 3, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["racer-states", "racer-states", 3, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["collide-reaction-racer", "collide-reaction-racer", 3, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["eichar-racer+0-ag", "eichar-racer+0", 4, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["tpage-1119", "tpage-1119", 4, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["blocking-plane", "blocking-plane", 3, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL", "SNO", "SWA"], ""], +["flut-part", "flut-part", 3, ["L1", "SNO", "SWA"], ""], +["flutflut", "flutflut", 3, ["L1", "SNO", "SWA"], ""], +["target-flut", "target-flut", 3, ["L1", "SNO", "SWA"], ""], +["eichar-flut+0-ag", "eichar-flut+0", 4, ["L1", "SNO", "SWA"], ""], +["farmer", "farmer", 3, ["L1", "VI1"], ""], +["explorer", "explorer", 3, ["L1", "VI1"], ""], +["assistant", "assistant", 3, ["L1", "VI1"], ""], +["sage", "sage", 3, ["L1", "VI1"], ""], +["yakow", "yakow", 3, ["VI1"], ""], +["yakow-OLD", "yakow", 3, ["L1"], ""], +["village-obs", "village-obs", 3, ["L1", "VI1"], ""], +["fishermans-boat", "fishermans-boat", 3, ["L1", "VI1"], ""], +["village1-part", "village1-part", 3, ["L1", "VI1"], ""], +["village1-part2", "village1-part2", 3, ["L1", "VI1"], ""], +["sequence-a-village1", "sequence-a-village1", 3, ["L1", "VI1"], ""], +["training-obs", "training-obs", 3, ["L1", "TRA"], ""], +["training-part", "training-part", 3, ["L1", "TRA"], ""], +["misty-obs", "misty-obs", 3, ["L1", "MIS"], ""], +["misty-warehouse", "misty-warehouse", 3, ["L1", "MIS"], ""], +["misty-conveyor", "misty-conveyor", 3, ["L1", "MIS"], ""], +["mud", "mud", 3, ["L1", "MIS"], ""], +["muse", "muse", 3, ["L1", "MIS"], ""], +["bonelurker", "bonelurker", 3, ["L1", "MIS"], ""], +["quicksandlurker", "quicksandlurker", 3, ["L1", "MIS"], ""], +["misty-teetertotter", "misty-teetertotter", 3, ["L1", "MIS"], ""], +["balloonlurker", "balloonlurker", 3, ["L1", "MIS"], ""], +["misty-part", "misty-part", 3, ["L1", "MIS"], ""], +["sidekick-human", "sidekick-human", 3, ["L1", "MIS"], ""], +["firecanyon-part", "firecanyon-part", 3, ["L1", "FIC"], ""], +["assistant-firecanyon", "assistant-firecanyon", 3, ["L1", "FIC"], ""], +["village2-part", "village2-part", 3, ["L1", "VI2"], ""], +["village2-obs", "village2-obs", 3, ["L1", "VI2"], ""], +["village2-part2", "village2-part2", 3, ["L1", "VI2"], ""], +["gambler", "gambler", 3, ["L1", "VI2"], ""], +["warrior", "warrior", 3, ["L1", "VI2"], ""], +["geologist", "geologist", 3, ["L1", "VI2"], ""], +["swamp-blimp", "swamp-blimp", 3, ["L1", "VI2"], ""], +["sage-bluehut", "sage-bluehut", 3, ["L1", "VI2"], ""], +["flutflut-bluehut", "flutflut-bluehut", 3, ["L1", "VI2"], ""], +["assistant-village2", "assistant-village2", 3, ["L1", "VI2"], ""], +["sunken-elevator", "sunken-elevator", 3, ["L1", "VI2"], ""], +["swamp-obs", "swamp-obs", 3, ["L1", "SWA"], ""], +["swamp-bat", "swamp-bat", 3, ["L1", "SWA"], ""], +["swamp-rat", "swamp-rat", 3, ["L1", "SWA"], ""], +["swamp-rat-nest", "swamp-rat-nest", 3, ["L1", "SWA"], ""], +["kermit", "kermit", 3, ["L1", "SWA"], ""], +["swamp-part", "swamp-part", 3, ["L1", "SWA"], ""], +["billy", "billy", 3, ["L1", "SWA"], ""], +["cavecrystal-light", "cavecrystal-light", 3, ["L1", "MAI", "MAINCAVE"], ""], +["maincave-obs", "maincave-obs", 3, ["L1", "MAI", "MAINCAVE"], ""], +["maincave-part", "maincave-part", 3, ["L1", "MAI", "MAINCAVE"], ""], +["spiderwebs", "spiderwebs", 3, ["L1", "MAI", "MAINCAVE"], ""], +["dark-crystal", "dark-crystal", 3, ["L1", "MAI", "MAINCAVE"], ""], +["baby-spider", "baby-spider", 3, ["L1", "MAI", "MAINCAVE"], ""], +["mother-spider-h", "mother-spider-h", 3, ["L1", "MAI", "MAINCAVE"], ""], +["mother-spider-egg", "mother-spider-egg", 3, ["L1", "MAI", "MAINCAVE"], ""], +["mother-spider-proj", "mother-spider-proj", 3, ["L1", "MAI", "MAINCAVE"], ""], +["mother-spider", "mother-spider", 3, ["L1", "MAI", "MAINCAVE"], ""], +["gnawer", "gnawer", 3, ["L1", "MAI", "MAINCAVE"], ""], +["driller-lurker", "driller-lurker", 3, ["L1", "MAI", "MAINCAVE"], ""], +["sunken-part", "sunken-part", 3, ["L1", "SUN", "SUNKEN"], ""], +["sunken-part2", "sunken-part2", 3, ["L1", "SUN", "SUNKEN"], ""], +["sunken-part3", "sunken-part3", 3, ["L1", "SUN", "SUNKEN"], ""], +["sunken-part4", "sunken-part4", 3, ["L1", "SUN", "SUNKEN"], ""], +["sunken-part5", "sunken-part5", 3, ["L1", "SUN", "SUNKEN"], ""], +["target-tube", "target-tube", 3, ["L1", "SUN", "SUNKEN"], ""], +["eichar-tube+0-ag", "eichar-tube+0", 4, ["L1", "SUNKEN"], ""], +["eichar-tube+0-ag", "eichar-tube+0", 4, ["SUN"], ""], +["sunken-obs", "sunken-obs", 3, ["L1", "SUN", "SUNKEN"], ""], +["shover", "shover", 3, ["L1", "SUN", "SUNKEN"], ""], +["square-platform", "square-platform", 3, ["L1", "SUN", "SUNKEN"], ""], +["sun-iris-door", "sun-iris-door", 3, ["L1", "SUN", "SUNKEN"], ""], +["orbit-plat", "orbit-plat", 3, ["L1", "SUN", "SUNKEN"], ""], +["wedge-plats", "wedge-plats", 3, ["L1", "SUN", "SUNKEN"], ""], +["wall-plat", "wall-plat", 3, ["L1", "SUN", "SUNKEN"], ""], +["qbert-plat", "qbert-plat", 3, ["L1", "SUN", "SUNKEN"], ""], +["steam-cap", "steam-cap", 3, ["L1", "SUN", "SUNKEN"], ""], +["sun-exit-chamber", "sun-exit-chamber", 3, ["L1", "SUN", "SUNKEN"], ""], +["floating-launcher", "floating-launcher", 3, ["L1", "SUN", "SUNKEN"], ""], +["sunken-water", "sunken-water", 3, ["L1", "SUN", "SUNKEN"], ""], +["whirlpool", "whirlpool", 3, ["L1", "SUN", "SUNKEN"], ""], +["sunken-pipegame", "sunken-pipegame", 3, ["L1", "SUN", "SUNKEN"], ""], +["bully", "bully", 3, ["L1", "SUN", "SUNKEN"], ""], +["double-lurker", "double-lurker", 3, ["L1", "SUN", "SUNKEN"], ""], +["helix-water", "helix-water", 3, ["L1", "SUN", "SUNKEN"], ""], +["puffer", "puffer", 3, ["L1", "SUN", "SUNKEN"], ""], +["sunken-fish", "sunken-fish", 3, ["L1", "SUN", "SUNKEN"], ""], +["rolling-obs", "rolling-obs", 3, ["L1", "ROL"], ""], +["rolling-lightning-mole", "rolling-lightning-mole", 3, ["L1", "ROL"], ""], +["rolling-robber", "rolling-robber", 3, ["L1", "ROL"], ""], +["rolling-race-ring", "rolling-race-ring", 3, ["L1", "ROL"], ""], +["firecanyon-obs", "firecanyon-obs", 3, ["L1", "FIC", "OGR"], ""], +["ogre-part", "ogre-part", 3, ["L1", "OGR"], ""], +["ogreboss", "ogreboss", 3, ["L1", "OGR"], ""], +["ogre-obs", "ogre-obs", 3, ["L1", "OGR"], ""], +["flying-lurker", "flying-lurker", 3, ["L1", "OGR"], ""], +["village3-part", "village3-part", 3, ["L1", "VI3"], ""], +["village3-obs", "village3-obs", 3, ["L1", "VI3"], ""], +["minecart", "minecart", 3, ["L1", "VI3"], ""], +["miners", "miners", 3, ["L1", "VI3"], ""], +["assistant-village3", "assistant-village3", 3, ["L1", "VI3"], ""], +["sage-village3", "sage-village3", 3, ["L1", "VI3"], ""], +["cave-trap", "cave-trap", 3, ["L1", "ROB"], ""], +["spider-egg", "spider-egg", 3, ["L1", "ROB"], ""], +["robocave-part", "robocave-part", 3, ["L1", "ROB"], ""], +["target-snowball", "target-snowball", 3, ["L1", "SNO"], ""], +["target-ice", "target-ice", 3, ["L1", "SNO"], ""], +["ice-cube", "ice-cube", 3, ["L1", "SNO"], ""], +["snow-ball", "snow-ball", 3, ["L1", "SNO"], ""], +["snow-obs", "snow-obs", 3, ["L1", "SNO"], ""], +["snow-flutflut-obs", "snow-flutflut-obs", 3, ["L1", "SNO"], ""], +["snow-bumper", "snow-bumper", 3, ["L1", "SNO"], ""], +["snow-ram-h", "snow-ram-h", 3, ["L1", "SNO"], ""], +["snow-ram-boss", "snow-ram-boss", 3, ["L1", "SNO"], ""], +["snow-ram", "snow-ram", 3, ["L1", "SNO"], ""], +["snow-part", "snow-part", 3, ["L1", "SNO"], ""], +["yeti", "yeti", 3, ["L1", "SNO"], ""], +["eichar-pole+0-ag", "eichar-pole+0", 4, ["L1"], ""], +["eichar-pole+0-ag", "eichar-pole+0", 4, ["ROB"], ""], +["eichar-pole+0-ag", "eichar-pole+0", 4, ["SNO"], ""], +["eichar-pole+0-ag", "eichar-pole+0", 4, ["SWA"], ""], +["eichar-ice+0-ag", "eichar-ice+0", 4, ["L1", "SNO"], ""], +["lavatube-obs", "lavatube-obs", 3, ["L1", "LAV"], ""], +["lavatube-energy", "lavatube-energy", 3, ["L1", "LAV"], ""], +["lavatube-part", "lavatube-part", 3, ["L1", "LAV"], ""], +["assistant-lavatube", "assistant-lavatube", 3, ["L1", "LAV"], ""], +["tpage-815", "tpage-815", 4, ["FIC"], ""], +["tpage-822", "tpage-822", 4, ["FIC"], ""], +["tpage-854", "tpage-854", 4, ["FIC"], ""], +["tpage-1123", "tpage-1123", 4, ["FIC"], ""], +["assistant-firecanyon-ag", "assistant-firecanyon", 4, ["FIC"], ""], +["balloon-ag", "balloon", 4, ["FIC"], ""], +["crate-darkeco-cluster-ag", "crate-darkeco-cluster", 4, ["FIC"], ""], +["crate-darkeco-cluster-ag", "crate-darkeco-cluster", 4, ["OGR"], ""], +["ef-plane-ag", "ef-plane", 4, ["FIC", "LAV", "OGR", "ROL", "SNO", "SWA"], ""], +["ef-plane-ag", "ef-plane", 4, ["MIS"], ""], +["racer-ag", "racer", 4, ["FIC", "ROL"], ""], +["racer-ag", "racer", 4, ["LAV"], ""], +["racer-ag", "racer", 4, ["MIS"], ""], +["racer-ag", "racer", 4, ["OGR"], ""], +["spike-ag", "spike", 4, ["FIC"], ""], +["firecanyon-vis", "firecanyon-vis", 4, ["FIC"], ""], +["tpage-1338", "tpage-1338", 4, ["LAV"], ""], +["tpage-1340", "tpage-1340", 4, ["LAV"], ""], +["tpage-1339", "tpage-1339", 4, ["LAV"], ""], +["tpage-1337", "tpage-1337", 4, ["LAV"], ""], +["assistant-lavatube-start-ag", "assistant-lavatube-start", 4, ["LAV"], ""], +["chainmine-ag", "chainmine", 4, ["LAV"], ""], +["darkecobarrel-ag", "darkecobarrel", 4, ["LAV"], ""], +["energyarm-ag", "energyarm", 4, ["LAV"], ""], +["energyball-ag", "energyball", 4, ["LAV"], ""], +["energybase-ag", "energybase", 4, ["LAV"], ""], +["energydoor-ag", "energydoor", 4, ["LAV"], ""], +["energyhub-ag", "energyhub", 4, ["LAV"], ""], +["lavaballoon-ag", "lavaballoon", 4, ["LAV"], ""], +["lavabase-ag", "lavabase", 4, ["LAV"], ""], +["lavafall-ag", "lavafall", 4, ["LAV"], ""], +["lavafallsewera-ag", "lavafallsewera", 4, ["LAV"], ""], +["lavafallsewerb-ag", "lavafallsewerb", 4, ["LAV"], ""], +["lavashortcut-ag", "lavashortcut", 4, ["LAV"], ""], +["lavayellowtarp-ag", "lavayellowtarp", 4, ["LAV"], ""], +["water-anim-lavatube-ag", "water-anim-lavatube", 4, ["LAV"], ""], +["lavatube-vis", "lavatube-vis", 4, ["LAV"], ""], +["tpage-1313", "tpage-1313", 4, ["MAI"], ""], +["tpage-1315", "tpage-1315", 4, ["MAI"], ""], +["tpage-1314", "tpage-1314", 4, ["MAI"], ""], +["tpage-1312", "tpage-1312", 4, ["MAI"], ""], +["tpage-767", "tpage-767", 4, ["MAI"], ""], +["driller-lurker-ag", "driller-lurker", 4, ["MAI", "ROB"], ""], +["gnawer-ag", "gnawer", 4, ["MAI"], ""], +["launcherdoor-maincave-ag", "launcherdoor-maincave", 4, ["MAI"], ""], +["maincavecam-ag", "maincavecam", 4, ["MAI"], ""], +["plat-ag", "plat", 4, ["MAI"], ""], +["plat-ag", "plat", 4, ["ROB"], ""], +["spiderwebs-ag", "spiderwebs", 4, ["MAI", "ROB"], ""], +["water-anim-maincave-ag", "water-anim-maincave", 4, ["MAI"], ""], +["water-anim-maincave-water-ag", "water-anim-maincave-water", 4, ["MAI"], ""], +["maincave-vis", "maincave-vis", 4, ["MAI"], ""], +["tpage-516", "tpage-516", 4, ["MIS"], ""], +["tpage-521", "tpage-521", 4, ["MIS"], ""], +["tpage-518", "tpage-518", 4, ["MIS"], ""], +["tpage-520", "tpage-520", 4, ["MIS"], ""], +["balloonlurker-ag", "balloonlurker", 4, ["MIS"], ""], +["boatpaddle-ag", "boatpaddle", 4, ["MIS"], ""], +["bonelurker-ag", "bonelurker", 4, ["MIS"], ""], +["breakaway-left-ag", "breakaway-left", 4, ["MIS"], ""], +["breakaway-mid-ag", "breakaway-mid", 4, ["MIS"], ""], +["breakaway-right-ag", "breakaway-right", 4, ["MIS"], ""], +["darkecocan-ag", "darkecocan", 4, ["MIS"], ""], +["keg-ag", "keg", 4, ["MIS"], ""], +["keg-conveyor-ag", "keg-conveyor", 4, ["MIS"], ""], +["keg-conveyor-paddle-ag", "keg-conveyor-paddle", 4, ["MIS"], ""], +["mis-bone-bridge-ag", "mis-bone-bridge", 4, ["MIS"], ""], +["mis-bone-platform-ag", "mis-bone-platform", 4, ["MIS"], ""], +["mistycam-ag", "mistycam", 4, ["MIS"], ""], +["muse-ag", "muse", 4, ["MIS"], ""], +["quicksandlurker-ag", "quicksandlurker", 4, ["MIS"], ""], +["ropebridge-36-ag", "ropebridge-36", 4, ["MIS"], ""], +["rounddoor-ag", "rounddoor", 4, ["MIS"], ""], +["sidekick-human-ag", "sidekick-human", 4, ["MIS"], ""], +["silostep-ag", "silostep", 4, ["MIS"], ""], +["teetertotter-ag", "teetertotter", 4, ["MIS"], ""], +["water-anim-misty-ag", "water-anim-misty", 4, ["MIS"], ""], +["wheel-ag", "wheel", 4, ["MIS"], ""], +["windturbine-ag", "windturbine", 4, ["MIS"], ""], +["misty-vis", "misty-vis", 4, ["MIS"], ""], +["tpage-875", "tpage-875", 4, ["OGR"], ""], +["tpage-967", "tpage-967", 4, ["OGR"], ""], +["tpage-884", "tpage-884", 4, ["OGR"], ""], +["tpage-1117", "tpage-1117", 4, ["OGR"], ""], +["flying-lurker-ag", "flying-lurker", 4, ["OGR"], ""], +["medres-snow-ag", "medres-snow", 4, ["OGR"], ""], +["ogre-bridge-ag", "ogre-bridge", 4, ["OGR"], ""], +["ogre-bridgeend-ag", "ogre-bridgeend", 4, ["OGR"], ""], +["ogre-isle-ag", "ogre-isle", 4, ["OGR"], ""], +["ogre-step-ag", "ogre-step", 4, ["OGR"], ""], +["ogreboss-ag", "ogreboss", 4, ["OGR"], ""], +["ogrecam-ag", "ogrecam", 4, ["OGR"], ""], +["plunger-lurker-ag", "plunger-lurker", 4, ["OGR"], ""], +["shortcut-boulder-ag", "shortcut-boulder", 4, ["OGR"], ""], +["tntbarrel-ag", "tntbarrel", 4, ["OGR"], ""], +["water-anim-ogre-ag", "water-anim-ogre", 4, ["OGR"], ""], +["ogre-vis", "ogre-vis", 4, ["OGR"], ""], +["tpage-1318", "tpage-1318", 4, ["ROB"], ""], +["tpage-1319", "tpage-1319", 4, ["ROB"], ""], +["tpage-1317", "tpage-1317", 4, ["ROB"], ""], +["tpage-1316", "tpage-1316", 4, ["ROB"], ""], +["cavecrusher-ag", "cavecrusher", 4, ["ROB"], ""], +["cavespatulatwo-ag", "cavespatulatwo", 4, ["ROB"], ""], +["water-anim-robocave-ag", "water-anim-robocave", 4, ["ROB"], ""], +["robocave-vis", "robocave-vis", 4, ["ROB"], ""], +["tpage-923", "tpage-923", 4, ["ROL"], ""], +["tpage-926", "tpage-926", 4, ["ROL"], ""], +["tpage-924", "tpage-924", 4, ["ROL"], ""], +["tpage-925", "tpage-925", 4, ["ROL"], ""], +["tpage-1353", "tpage-1353", 4, ["ROL"], ""], +["dark-plant-ag", "dark-plant", 4, ["ROL"], ""], +["happy-plant-ag", "happy-plant", 4, ["ROL"], ""], +["lightning-mole-ag", "lightning-mole", 4, ["ROL"], ""], +["pusher-ag", "pusher", 4, ["ROL"], ""], +["race-ring-ag", "race-ring", 4, ["ROL"], ""], +["robber-ag", "robber", 4, ["ROL"], ""], +["rolling-start-ag", "rolling-start", 4, ["ROL"], ""], +["rollingcam-ag", "rollingcam", 4, ["ROL"], ""], +["water-anim-rolling-ag", "water-anim-rolling", 4, ["ROL"], ""], +["rolling-vis", "rolling-vis", 4, ["ROL"], ""], +["tpage-710", "tpage-710", 4, ["SNO"], ""], +["tpage-842", "tpage-842", 4, ["SNO"], ""], +["tpage-711", "tpage-711", 4, ["SNO"], ""], +["tpage-712", "tpage-712", 4, ["SNO"], ""], +["flut-saddle-ag", "flut-saddle", 4, ["SNO"], ""], +["flut-saddle-ag", "flut-saddle", 4, ["SWA"], ""], +["flutflut-plat-large-ag", "flutflut-plat-large", 4, ["SNO"], ""], +["flutflut-plat-med-ag", "flutflut-plat-med", 4, ["SNO"], ""], +["flutflut-plat-small-ag", "flutflut-plat-small", 4, ["SNO"], ""], +["ice-cube-ag", "ice-cube", 4, ["SNO"], ""], +["ice-cube-break-ag", "ice-cube-break", 4, ["SNO"], ""], +["ram-ag", "ram", 4, ["SNO"], ""], +["ram-boss-ag", "ram-boss", 4, ["SNO"], ""], +["snow-ball-ag", "snow-ball", 4, ["SNO"], ""], +["snow-bridge-36-ag", "snow-bridge-36", 4, ["SNO"], ""], +["snow-bumper-ag", "snow-bumper", 4, ["SNO"], ""], +["snow-bunny-ag", "snow-bunny", 4, ["SNO"], ""], +["snow-button-ag", "snow-button", 4, ["SNO"], ""], +["snow-eggtop-ag", "snow-eggtop", 4, ["SNO"], ""], +["snow-fort-gate-ag", "snow-fort-gate", 4, ["SNO"], ""], +["snow-gears-ag", "snow-gears", 4, ["SNO"], ""], +["snow-log-ag", "snow-log", 4, ["SNO"], ""], +["snow-spatula-ag", "snow-spatula", 4, ["SNO"], ""], +["snow-switch-ag", "snow-switch", 4, ["SNO"], ""], +["snowcam-ag", "snowcam", 4, ["SNO"], ""], +["snowpusher-ag", "snowpusher", 4, ["SNO"], ""], +["yeti-ag", "yeti", 4, ["SNO"], ""], +["snow-vis", "snow-vis", 4, ["SNO"], ""], +["tpage-163", "tpage-163", 4, ["SUB"], ""], +["tpage-164", "tpage-164", 4, ["SUB"], ""], +["tpage-166", "tpage-166", 4, ["SUB"], ""], +["tpage-162", "tpage-162", 4, ["SUB"], ""], +["tpage-764", "tpage-764", 4, ["SUB"], ""], +["blue-eco-charger-ag", "blue-eco-charger", 4, ["SUB"], ""], +["blue-eco-charger-orb-ag", "blue-eco-charger-orb", 4, ["SUB"], ""], +["bully-ag", "bully", 4, ["SUB", "SUN"], ""], +["floating-launcher-ag", "floating-launcher", 4, ["SUB"], ""], +["helix-button-ag", "helix-button", 4, ["SUB"], ""], +["helix-slide-door-ag", "helix-slide-door", 4, ["SUB"], ""], +["shover-ag", "shover", 4, ["SUB"], ""], +["shover-ag", "shover", 4, ["SUN"], ""], +["steam-cap-ag", "steam-cap", 4, ["SUB"], ""], +["steam-cap-ag", "steam-cap", 4, ["SUN"], ""], +["sunkencam-ag", "sunkencam", 4, ["SUB"], ""], +["sunkencam-ag", "sunkencam", 4, ["SUN"], ""], +["sunkenfisha-ag", "sunkenfisha", 4, ["SUB", "SUN"], ""], +["wall-plat-ag", "wall-plat", 4, ["SUB", "SUN"], ""], +["water-anim-sunken-ag", "water-anim-sunken", 4, ["SUB", "SUN"], ""], +["water-anim-sunken-dark-eco-ag", "water-anim-sunken-dark-eco", 4, ["SUB", "SUN"], ""], +["sunkenb-vis", "sunkenb-vis", 4, ["SUB"], ""], +["tpage-661", "tpage-661", 4, ["SUN"], ""], +["tpage-663", "tpage-663", 4, ["SUN"], ""], +["tpage-714", "tpage-714", 4, ["SUN"], ""], +["tpage-662", "tpage-662", 4, ["SUN"], ""], +["tpage-766", "tpage-766", 4, ["SUN"], ""], +["double-lurker-ag", "double-lurker", 4, ["SUN"], ""], +["double-lurker-top-ag", "double-lurker-top", 4, ["SUN"], ""], +["exit-chamber-ag", "exit-chamber", 4, ["SUN"], ""], +["generic-button-ag", "generic-button", 4, ["SUN"], ""], +["orbit-plat-ag", "orbit-plat", 4, ["SUN"], ""], +["orbit-plat-bottom-ag", "orbit-plat-bottom", 4, ["SUN"], ""], +["plat-sunken-ag", "plat-sunken", 4, ["SUN"], ""], +["puffer-ag", "puffer", 4, ["SUN"], ""], +["qbert-plat-ag", "qbert-plat", 4, ["SUN"], ""], +["qbert-plat-on-ag", "qbert-plat-on", 4, ["SUN"], ""], +["seaweed-ag", "seaweed", 4, ["SUN"], ""], +["side-to-side-plat-ag", "side-to-side-plat", 4, ["SUN"], ""], +["square-platform-ag", "square-platform", 4, ["SUN"], ""], +["sun-iris-door-ag", "sun-iris-door", 4, ["SUN"], ""], +["wedge-plat-ag", "wedge-plat", 4, ["SUN"], ""], +["wedge-plat-outer-ag", "wedge-plat-outer", 4, ["SUN"], ""], +["whirlpool-ag", "whirlpool", 4, ["SUN"], ""], +["sunken-vis", "sunken-vis", 4, ["SUN"], ""], +["tpage-358", "tpage-358", 4, ["SWA"], ""], +["tpage-659", "tpage-659", 4, ["SWA"], ""], +["tpage-629", "tpage-629", 4, ["SWA"], ""], +["tpage-630", "tpage-630", 4, ["SWA"], ""], +["balance-plat-ag", "balance-plat", 4, ["SWA"], ""], +["billy-ag", "billy", 4, ["SWA"], ""], +["billy-sidekick-ag", "billy-sidekick", 4, ["SWA"], ""], +["farthy-snack-ag", "farthy-snack", 4, ["SWA"], ""], +["kermit-ag", "kermit", 4, ["SWA"], ""], +["swamp-bat-ag", "swamp-bat", 4, ["SWA"], ""], +["swamp-rat-ag", "swamp-rat", 4, ["SWA"], ""], +["swamp-rat-nest-ag", "swamp-rat-nest", 4, ["SWA"], ""], +["swamp-rock-ag", "swamp-rock", 4, ["SWA"], ""], +["swamp-spike-ag", "swamp-spike", 4, ["SWA"], ""], +["swampcam-ag", "swampcam", 4, ["SWA"], ""], +["swampcam-ag", "swampcam", 4, ["VI2"], ""], +["tar-plat-ag", "tar-plat", 4, ["SWA"], ""], +["swamp-vis", "swamp-vis", 4, ["SWA"], ""], +["title-obs", "title-obs", 3, ["TIT"], ""], +["tpage-1609", "tpage-1609", 4, ["TIT"], ""], +["tpage-416", "tpage-416", 4, ["TIT"], ""], +["tpage-415", "tpage-415", 4, ["TIT"], ""], +["tpage-397", "tpage-397", 4, ["TIT"], ""], +["tpage-1499", "tpage-1499", 4, ["TIT"], ""], +["logo-ag", "logo", 4, ["TIT"], ""], +["logo-black-ag", "logo-black", 4, ["TIT"], ""], +["logo-cam-ag", "logo-cam", 4, ["TIT"], ""], +["logo-volumes-ag", "logo-volumes", 4, ["TIT"], ""], +["ndi-ag", "ndi", 4, ["TIT"], ""], +["ndi-cam-ag", "ndi-cam", 4, ["TIT"], ""], +["ndi-volumes-ag", "ndi-volumes", 4, ["TIT"], ""], +["title-vis", "title-vis", 4, ["TIT"], ""], +["tpage-1309", "tpage-1309", 4, ["TRA"], ""], +["tpage-1311", "tpage-1311", 4, ["TRA"], ""], +["tpage-1310", "tpage-1310", 4, ["TRA"], ""], +["tpage-1308", "tpage-1308", 4, ["TRA"], ""], +["tpage-775", "tpage-775", 4, ["TRA"], ""], +["pontoonfive-ag", "pontoonfive", 4, ["TRA"], ""], +["pontoonfive-ag", "pontoonfive", 4, ["VI2"], ""], +["scarecrow-a-ag", "scarecrow-a", 4, ["TRA"], ""], +["scarecrow-b-ag", "scarecrow-b", 4, ["TRA"], ""], +["trainingcam-ag", "trainingcam", 4, ["TRA"], ""], +["water-anim-training-ag", "water-anim-training", 4, ["TRA"], ""], +["training-vis", "training-vis", 4, ["TRA"], ""], +["tpage-398", "tpage-398", 4, ["VI1"], ""], +["tpage-400", "tpage-400", 4, ["VI1"], ""], +["tpage-399", "tpage-399", 4, ["VI1"], ""], +["tpage-401", "tpage-401", 4, ["VI1"], ""], +["tpage-1470", "tpage-1470", 4, ["VI1"], ""], +["assistant-ag", "assistant", 4, ["VI1"], ""], +["evilplant-ag", "evilplant", 4, ["VI1"], ""], +["explorer-ag", "explorer", 4, ["VI1"], ""], +["farmer-ag", "farmer", 4, ["VI1"], ""], +["fishermans-boat-ag", "fishermans-boat", 4, ["VI1"], ""], +["hutlamp-ag", "hutlamp", 4, ["VI1"], ""], +["mayorgears-ag", "mayorgears", 4, ["VI1"], ""], +["medres-beach-ag", "medres-beach", 4, ["VI1"], ""], +["medres-beach1-ag", "medres-beach1", 4, ["VI1"], ""], +["medres-beach2-ag", "medres-beach2", 4, ["VI1"], ""], +["medres-beach3-ag", "medres-beach3", 4, ["VI1"], ""], +["medres-jungle-ag", "medres-jungle", 4, ["VI1"], ""], +["medres-jungle1-ag", "medres-jungle1", 4, ["VI1"], ""], +["medres-jungle2-ag", "medres-jungle2", 4, ["VI1"], ""], +["medres-misty-ag", "medres-misty", 4, ["VI1"], ""], +["medres-training-ag", "medres-training", 4, ["VI1"], ""], +["medres-village11-ag", "medres-village11", 4, ["VI1"], ""], +["medres-village12-ag", "medres-village12", 4, ["VI1"], ""], +["medres-village13-ag", "medres-village13", 4, ["VI1"], ""], +["oracle-ag", "oracle", 4, ["VI1"], ""], +["oracle-ag", "oracle", 4, ["VI2"], ""], +["oracle-ag", "oracle", 4, ["VI3"], ""], +["reflector-middle-ag", "reflector-middle", 4, ["VI1"], ""], +["revcycle-ag", "revcycle", 4, ["VI1"], ""], +["revcycleprop-ag", "revcycleprop", 4, ["VI1"], ""], +["ropebridge-32-ag", "ropebridge-32", 4, ["VI1"], ""], +["sage-ag", "sage", 4, ["VI1"], ""], +["sagesail-ag", "sagesail", 4, ["VI1"], ""], +["villa-starfish-ag", "villa-starfish", 4, ["VI1"], ""], +["village-cam-ag", "village-cam", 4, ["VI1"], ""], +["village-cam-ag", "village-cam", 4, ["VI2"], ""], +["village-cam-ag", "village-cam", 4, ["VI3"], ""], +["village1cam-ag", "village1cam", 4, ["VI1"], ""], +["water-anim-village1-ag", "water-anim-village1", 4, ["VI1"], ""], +["windmill-sail-ag", "windmill-sail", 4, ["VI1"], ""], +["windspinner-ag", "windspinner", 4, ["VI1"], ""], +["yakow-ag", "yakow", 4, ["VI1"], ""], +["village1-vis", "village1-vis", 4, ["VI1"], ""], +["tpage-919", "tpage-919", 4, ["VI2"], ""], +["tpage-922", "tpage-922", 4, ["VI2"], ""], +["tpage-920", "tpage-920", 4, ["VI2"], ""], +["tpage-921", "tpage-921", 4, ["VI2"], ""], +["tpage-1476", "tpage-1476", 4, ["VI2"], ""], +["allpontoons-ag", "allpontoons", 4, ["VI2"], ""], +["assistant-village2-ag", "assistant-village2", 4, ["VI2"], ""], +["ceilingflag-ag", "ceilingflag", 4, ["VI2"], ""], +["exit-chamber-dummy-ag", "exit-chamber-dummy", 4, ["VI2"], ""], +["fireboulder-ag", "fireboulder", 4, ["VI2"], ""], +["flutflut-bluehut-ag", "flutflut-bluehut", 4, ["VI2"], ""], +["gambler-ag", "gambler", 4, ["VI2"], ""], +["geologist-ag", "geologist", 4, ["VI2"], ""], +["jaws-ag", "jaws", 4, ["VI2"], ""], +["medres-rolling-ag", "medres-rolling", 4, ["VI2"], ""], +["medres-rolling1-ag", "medres-rolling1", 4, ["VI2"], ""], +["medres-village2-ag", "medres-village2", 4, ["VI2"], ""], +["ogreboss-village2-ag", "ogreboss-village2", 4, ["VI2"], ""], +["pontoonten-ag", "pontoonten", 4, ["VI2"], ""], +["precursor-arm-ag", "precursor-arm", 4, ["VI2"], ""], +["sage-bluehut-ag", "sage-bluehut", 4, ["VI2"], ""], +["sunken-elevator-ag", "sunken-elevator", 4, ["VI2"], ""], +["swamp-blimp-ag", "swamp-blimp", 4, ["VI2"], ""], +["swamp-rope-ag", "swamp-rope", 4, ["VI2"], ""], +["swamp-tetherrock-ag", "swamp-tetherrock", 4, ["VI2"], ""], +["swamp-tetherrock-explode-ag", "swamp-tetherrock-explode", 4, ["VI2"], ""], +["village2cam-ag", "village2cam", 4, ["VI2"], ""], +["warrior-ag", "warrior", 4, ["VI2"], ""], +["water-anim-village2-ag", "water-anim-village2", 4, ["VI2"], ""], +["village2-vis", "village2-vis", 4, ["VI2"], ""], +["tpage-1208", "tpage-1208", 4, ["VI3"], ""], +["tpage-1210", "tpage-1210", 4, ["VI3"], ""], +["tpage-1209", "tpage-1209", 4, ["VI3"], ""], +["tpage-1194", "tpage-1194", 4, ["VI3"], ""], +["assistant-village3-ag", "assistant-village3", 4, ["VI3"], ""], +["cavegem-ag", "cavegem", 4, ["VI3"], ""], +["evilbro-village3-ag", "evilbro-village3", 4, ["VI3"], ""], +["evilsis-village3-ag", "evilsis-village3", 4, ["VI3"], ""], +["gondola-ag", "gondola", 4, ["VI3"], ""], +["gondolacables-ag", "gondolacables", 4, ["VI3"], ""], +["lavaspoutdrip-ag", "lavaspoutdrip", 4, ["VI3"], ""], +["medres-finalboss-ag", "medres-finalboss", 4, ["VI3"], ""], +["medres-ogre-ag", "medres-ogre", 4, ["VI3"], ""], +["medres-ogre2-ag", "medres-ogre2", 4, ["VI3"], ""], +["medres-ogre3-ag", "medres-ogre3", 4, ["VI3"], ""], +["minecartsteel-ag", "minecartsteel", 4, ["VI3"], ""], +["minershort-ag", "minershort", 4, ["VI3"], ""], +["minertall-ag", "minertall", 4, ["VI3"], ""], +["pistons-ag", "pistons", 4, ["VI3"], ""], +["sage-village3-ag", "sage-village3", 4, ["VI3"], ""], +["vil3-bridge-36-ag", "vil3-bridge-36", 4, ["VI3"], ""], +["water-anim-village3-ag", "water-anim-village3", 4, ["VI3"], ""], +["village3-vis", "village3-vis", 4, ["VI3"], ""], +["lava", "lava", 3, ["WATER-AN"], ""], +["0COMMON", "0COMMON", 2, ["NO-XGO"], ""], +["1COMMON", "1COMMON", 2, ["NO-XGO"], ""], +["2COMMON", "2COMMON", 2, ["NO-XGO"], ""], +["3COMMON", "3COMMON", 2, ["NO-XGO"], ""], +["4COMMON", "4COMMON", 2, ["NO-XGO"], ""], +["5COMMON", "5COMMON", 2, ["NO-XGO"], ""], +["6COMMON", "6COMMON", 2, ["NO-XGO"], ""], +["balloon-fuel-cell+0", "balloon-fuel-cell+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-4+0", "swamp-tetherrock-explode-4+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-3+0", "swamp-tetherrock-explode-3+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-2+0", "swamp-tetherrock-explode-2+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-1+0", "swamp-tetherrock-explode-1+0", 2, ["NO-XGO"], ""], +["snowcam-ram-boss-snow-ball-fuel-cell+0", "snowcam-ram-boss-snow-ball-fuel-cell+0", 2, ["NO-XGO"], ""], +["snowcam-ram-boss-ice-pond-fuel-cell+0", "snowcam-ram-boss-ice-pond-fuel-cell+0", 2, ["NO-XGO"], ""], +["snowcam-ram-boss-in-cave-fuel-cell+0", "snowcam-ram-boss-in-cave-fuel-cell+0", 2, ["NO-XGO"], ""], +["oracle-reminder-3+0", "oracle-reminder-3+0", 2, ["NO-XGO"], ""], +["oracle-reminder-3+1", "oracle-reminder-3+1", 2, ["NO-XGO"], ""], +["oracle-reminder-2+0", "oracle-reminder-2+0", 2, ["NO-XGO"], ""], +["oracle-reminder-2+1", "oracle-reminder-2+1", 2, ["NO-XGO"], ""], +["mistycam-cannon+0", "mistycam-cannon+0", 2, ["NO-XGO"], ""], +["beachcam-cannon+0", "beachcam-cannon+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-swamprockexplode-4+0", "swamp-tetherrock-swamprockexplode-4+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-swamprockexplode-3+0", "swamp-tetherrock-swamprockexplode-3+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-swamprockexplode-2+0", "swamp-tetherrock-swamprockexplode-2+0", 2, ["NO-XGO"], ""], +["swamprockexplode-4+0", "swamprockexplode-4+0", 2, ["NO-XGO"], ""], +["swamprockexplode-3+0", "swamprockexplode-3+0", 2, ["NO-XGO"], ""], +["swamprockexplode-2+0", "swamprockexplode-2+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-swamprockexplode-1+0", "swamp-tetherrock-swamprockexplode-1+0", 2, ["NO-XGO"], ""], +["oracle-right-eye+0", "oracle-right-eye+0", 2, ["NO-XGO"], ""], +["oracle-left-eye+0", "oracle-left-eye+0", 2, ["NO-XGO"], ""], +["swamprockexplode-1+0", "swamprockexplode-1+0", 2, ["NO-XGO"], ""], +["maincavecam-gnawer-fuel-cell+0", "maincavecam-gnawer-fuel-cell+0", 2, ["NO-XGO"], ""], +["gnawer-fuel-cell+0", "gnawer-fuel-cell+0", 2, ["NO-XGO"], ""], +["oracle-right-eye-3+0", "oracle-right-eye-3+0", 2, ["NO-XGO"], ""], +["oracle-right-eye-3+1", "oracle-right-eye-3+1", 2, ["NO-XGO"], ""], +["oracle-right-eye-2+0", "oracle-right-eye-2+0", 2, ["NO-XGO"], ""], +["oracle-right-eye-2+1", "oracle-right-eye-2+1", 2, ["NO-XGO"], ""], +["oracle-right-eye-1+0", "oracle-right-eye-1+0", 2, ["NO-XGO"], ""], +["oracle-right-eye-1+1", "oracle-right-eye-1+1", 2, ["NO-XGO"], ""], +["oracle-reminder-1+0", "oracle-reminder-1+0", 2, ["NO-XGO"], ""], +["oracle-reminder-1+1", "oracle-reminder-1+1", 2, ["NO-XGO"], ""], +["oracle-reminder-1+2", "oracle-reminder-1+2", 2, ["NO-XGO"], ""], +["oracle-reminder-1+3", "oracle-reminder-1+3", 2, ["NO-XGO"], ""], +["oracle-left-eye-3+0", "oracle-left-eye-3+0", 2, ["NO-XGO"], ""], +["oracle-left-eye-3+1", "oracle-left-eye-3+1", 2, ["NO-XGO"], ""], +["oracle-left-eye-2+0", "oracle-left-eye-2+0", 2, ["NO-XGO"], ""], +["oracle-left-eye-2+1", "oracle-left-eye-2+1", 2, ["NO-XGO"], ""], +["oracle-intro-3+0", "oracle-intro-3+0", 2, ["NO-XGO"], ""], +["oracle-intro-3+1", "oracle-intro-3+1", 2, ["NO-XGO"], ""], +["oracle-intro-3+2", "oracle-intro-3+2", 2, ["NO-XGO"], ""], +["oracle-intro-3+3", "oracle-intro-3+3", 2, ["NO-XGO"], ""], +["oracle-intro-2+0", "oracle-intro-2+0", 2, ["NO-XGO"], ""], +["oracle-intro-2+1", "oracle-intro-2+1", 2, ["NO-XGO"], ""], +["oracle-intro-2+2", "oracle-intro-2+2", 2, ["NO-XGO"], ""], +["oracle-intro-2+3", "oracle-intro-2+3", 2, ["NO-XGO"], ""], +["death-0202+0", "death-0202+0", 2, ["NO-XGO"], ""], +["race-ring-second-anim+0", "race-ring-second-anim+0", 2, ["NO-XGO"], ""], +["race-ring-second-anim+1", "race-ring-second-anim+1", 2, ["NO-XGO"], ""], +["race-ring-anim+0", "race-ring-anim+0", 2, ["NO-XGO"], ""], +["race-ring-anim+1", "race-ring-anim+1", 2, ["NO-XGO"], ""], +["eichar-fish+0", "eichar-fish+0", 2, ["NO-XGO"], ""], +["oracle-left-eye-1+0", "oracle-left-eye-1+0", 2, ["NO-XGO"], ""], +["oracle-left-eye-1+1", "oracle-left-eye-1+1", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-4+0", "swamp-tetherrock-explode-final-4+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-4+1", "swamp-tetherrock-explode-final-4+1", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-4+2", "swamp-tetherrock-explode-final-4+2", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-3+0", "swamp-tetherrock-explode-final-3+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-3+1", "swamp-tetherrock-explode-final-3+1", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-3+2", "swamp-tetherrock-explode-final-3+2", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-2+0", "swamp-tetherrock-explode-final-2+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-2+1", "swamp-tetherrock-explode-final-2+1", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-2+2", "swamp-tetherrock-explode-final-2+2", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-1+0", "swamp-tetherrock-explode-final-1+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-1+1", "swamp-tetherrock-explode-final-1+1", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-1+2", "swamp-tetherrock-explode-final-1+2", 2, ["NO-XGO"], ""], +["oracle-intro-1+0", "oracle-intro-1+0", 2, ["NO-XGO"], ""], +["oracle-intro-1+1", "oracle-intro-1+1", 2, ["NO-XGO"], ""], +["oracle-intro-1+2", "oracle-intro-1+2", 2, ["NO-XGO"], ""], +["oracle-intro-1+3", "oracle-intro-1+3", 2, ["NO-XGO"], ""], +["oracle-intro-1+4", "oracle-intro-1+4", 2, ["NO-XGO"], ""], +["eichar-ice+0", "eichar-ice+0", 2, ["NO-XGO"], ""], +["eichar-ambient-3+0", "eichar-ambient-3+0", 2, ["NO-XGO"], ""], +["death-0191+0", "death-0191+0", 2, ["NO-XGO"], ""], +["death-0186+0", "death-0186+0", 2, ["NO-XGO"], ""], +["death-0187+0", "death-0187+0", 2, ["NO-XGO"], ""], +["eichar-ambient-4+0", "eichar-ambient-4+0", 2, ["NO-XGO"], ""], +["eichar-pole+0", "eichar-pole+0", 2, ["NO-XGO"], ""], +["race-ring-anim-second+0", "race-ring-anim-second+0", 2, ["NO-XGO"], ""], +["race-ring-anim-second+1", "race-ring-anim-second+1", 2, ["NO-XGO"], ""], +["race-ring-anim-2+0", "race-ring-anim-2+0", 2, ["NO-XGO"], ""], +["race-ring-anim-2+1", "race-ring-anim-2+1", 2, ["NO-XGO"], ""], +["death-0184+0", "death-0184+0", 2, ["NO-XGO"], ""], +["death-0181+0", "death-0181+0", 2, ["NO-XGO"], ""], +["pelican-spit-ext+0", "pelican-spit-ext+0", 2, ["NO-XGO"], ""], +["pelican-spit-ext+1", "pelican-spit-ext+1", 2, ["NO-XGO"], ""], +["death-0195+0", "death-0195+0", 2, ["NO-XGO"], ""], +["eichar-ambient-2+0", "eichar-ambient-2+0", 2, ["NO-XGO"], ""], +["fisher-reminder-1+0", "fisher-reminder-1+0", 2, ["NO-XGO"], ""], +["death-0182+0", "death-0182+0", 2, ["NO-XGO"], ""], +["billy-reminder-1+0", "billy-reminder-1+0", 2, ["NO-XGO"], ""], +["billy-reminder-1+1", "billy-reminder-1+1", 2, ["NO-XGO"], ""], +["happy-plant-open+0", "happy-plant-open+0", 2, ["NO-XGO"], ""], +["happy-plant-open+1", "happy-plant-open+1", 2, ["NO-XGO"], ""], +["eichar-tube+0", "eichar-tube+0", 2, ["NO-XGO"], ""], +["sculptor-reminder-1+0", "sculptor-reminder-1+0", 2, ["NO-XGO"], ""], +["sculptor-reminder-1+1", "sculptor-reminder-1+1", 2, ["NO-XGO"], ""], +["death-0197+0", "death-0197+0", 2, ["NO-XGO"], ""], +["death-0197+1", "death-0197+1", 2, ["NO-XGO"], ""], +["death-0193+0", "death-0193+0", 2, ["NO-XGO"], ""], +["death-0193+1", "death-0193+1", 2, ["NO-XGO"], ""], +["eichar-ambient-1+0", "eichar-ambient-1+0", 2, ["NO-XGO"], ""], +["farmer-reminder-2+0", "farmer-reminder-2+0", 2, ["NO-XGO"], ""], +["farmer-reminder-2+1", "farmer-reminder-2+1", 2, ["NO-XGO"], ""], +["farmer-reminder-1+0", "farmer-reminder-1+0", 2, ["NO-XGO"], ""], +["farmer-reminder-1+1", "farmer-reminder-1+1", 2, ["NO-XGO"], ""], +["death-0199+0", "death-0199+0", 2, ["NO-XGO"], ""], +["death-0199+1", "death-0199+1", 2, ["NO-XGO"], ""], +["geologist-reminder-money+0", "geologist-reminder-money+0", 2, ["NO-XGO"], ""], +["geologist-reminder-money+1", "geologist-reminder-money+1", 2, ["NO-XGO"], ""], +["billy-resolution+0", "billy-resolution+0", 2, ["NO-XGO"], ""], +["billy-resolution+1", "billy-resolution+1", 2, ["NO-XGO"], ""], +["gambler-reminder-money+0", "gambler-reminder-money+0", 2, ["NO-XGO"], ""], +["gambler-reminder-money+1", "gambler-reminder-money+1", 2, ["NO-XGO"], ""], +["big-adventure+0", "big-adventure+0", 2, ["NO-XGO"], ""], +["big-adventure+1", "big-adventure+1", 2, ["NO-XGO"], ""], +["big-adventure+2", "big-adventure+2", 2, ["NO-XGO"], ""], +["big-adventure+3", "big-adventure+3", 2, ["NO-XGO"], ""], +["big-adventure+4", "big-adventure+4", 2, ["NO-XGO"], ""], +["big-adventure+5", "big-adventure+5", 2, ["NO-XGO"], ""], +["big-adventure+6", "big-adventure+6", 2, ["NO-XGO"], ""], +["big-adventure+7", "big-adventure+7", 2, ["NO-XGO"], ""], +["fuel-cell-racer-victory-1+0", "fuel-cell-racer-victory-1+0", 2, ["NO-XGO"], ""], +["fuel-cell-racer-victory-1+1", "fuel-cell-racer-victory-1+1", 2, ["NO-XGO"], ""], +["billy-reject+0", "billy-reject+0", 2, ["NO-XGO"], ""], +["billy-reject+1", "billy-reject+1", 2, ["NO-XGO"], ""], +["billy-reject+2", "billy-reject+2", 2, ["NO-XGO"], ""], +["warrior-reminder-1+0", "warrior-reminder-1+0", 2, ["NO-XGO"], ""], +["warrior-reminder-1+1", "warrior-reminder-1+1", 2, ["NO-XGO"], ""], +["warrior-reminder-1+2", "warrior-reminder-1+2", 2, ["NO-XGO"], ""], +["billy-accept+0", "billy-accept+0", 2, ["NO-XGO"], ""], +["billy-accept+1", "billy-accept+1", 2, ["NO-XGO"], ""], +["billy-accept+2", "billy-accept+2", 2, ["NO-XGO"], ""], +["sage-village3-reminder-1-dark-eco+0", "sage-village3-reminder-1-dark-eco+0", 2, ["NO-XGO"], ""], +["sage-village3-reminder-1-dark-eco+1", "sage-village3-reminder-1-dark-eco+1", 2, ["NO-XGO"], ""], +["assistant-reminder-1-generic+0", "assistant-reminder-1-generic+0", 2, ["NO-XGO"], ""], +["assistant-reminder-1-generic+1", "assistant-reminder-1-generic+1", 2, ["NO-XGO"], ""], +["fisher-reject+0", "fisher-reject+0", 2, ["NO-XGO"], ""], +["fisher-reject+1", "fisher-reject+1", 2, ["NO-XGO"], ""], +["gambler-reminder-race+0", "gambler-reminder-race+0", 2, ["NO-XGO"], ""], +["gambler-reminder-race+1", "gambler-reminder-race+1", 2, ["NO-XGO"], ""], +["geologist-resolution-money+0", "geologist-resolution-money+0", 2, ["NO-XGO"], ""], +["geologist-resolution-money+1", "geologist-resolution-money+1", 2, ["NO-XGO"], ""], +["lrocklrg-falling+0", "lrocklrg-falling+0", 2, ["NO-XGO"], ""], +["lrocklrg-falling+1", "lrocklrg-falling+1", 2, ["NO-XGO"], ""], +["lrocklrg-falling+2", "lrocklrg-falling+2", 2, ["NO-XGO"], ""], +["lrocklrg-falling+3", "lrocklrg-falling+3", 2, ["NO-XGO"], ""], +["explorer-reminder-2+0", "explorer-reminder-2+0", 2, ["NO-XGO"], ""], +["explorer-reminder-2+1", "explorer-reminder-2+1", 2, ["NO-XGO"], ""], +["explorer-reminder-2+2", "explorer-reminder-2+2", 2, ["NO-XGO"], ""], +["geologist-reminder-moles+0", "geologist-reminder-moles+0", 2, ["NO-XGO"], ""], +["geologist-reminder-moles+1", "geologist-reminder-moles+1", 2, ["NO-XGO"], ""], +["geologist-reminder-moles+2", "geologist-reminder-moles+2", 2, ["NO-XGO"], ""], +["fuel-cell-victory+0", "fuel-cell-victory+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory+1", "fuel-cell-victory+1", 2, ["NO-XGO"], ""], +["minershort-reminder-1-orbs+0", "minershort-reminder-1-orbs+0", 2, ["NO-XGO"], ""], +["minershort-reminder-1-orbs+1", "minershort-reminder-1-orbs+1", 2, ["NO-XGO"], ""], +["minershort-reminder-1-orbs+2", "minershort-reminder-1-orbs+2", 2, ["NO-XGO"], ""], +["sage-village3-reminder-1-rams+0", "sage-village3-reminder-1-rams+0", 2, ["NO-XGO"], ""], +["sage-village3-reminder-1-rams+1", "sage-village3-reminder-1-rams+1", 2, ["NO-XGO"], ""], +["sage-village3-reminder-1-rams+2", "sage-village3-reminder-1-rams+2", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-flutflut+0", "assistant-village2-reminder-1-flutflut+0", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-flutflut+1", "assistant-village2-reminder-1-flutflut+1", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-flutflut+2", "assistant-village2-reminder-1-flutflut+2", 2, ["NO-XGO"], ""], +["fuel-cell-victory-2+0", "fuel-cell-victory-2+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory-2+1", "fuel-cell-victory-2+1", 2, ["NO-XGO"], ""], +["minershort-reminder-1-gnawers+0", "minershort-reminder-1-gnawers+0", 2, ["NO-XGO"], ""], +["minershort-reminder-1-gnawers+1", "minershort-reminder-1-gnawers+1", 2, ["NO-XGO"], ""], +["minershort-reminder-1-gnawers+2", "minershort-reminder-1-gnawers+2", 2, ["NO-XGO"], ""], +["gambler-resolution-money+0", "gambler-resolution-money+0", 2, ["NO-XGO"], ""], +["gambler-resolution-money+1", "gambler-resolution-money+1", 2, ["NO-XGO"], ""], +["assistant-village3-reminder+0", "assistant-village3-reminder+0", 2, ["NO-XGO"], ""], +["assistant-village3-reminder+1", "assistant-village3-reminder+1", 2, ["NO-XGO"], ""], +["assistant-village3-reminder+2", "assistant-village3-reminder+2", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+0", "sidekick-human-intro-sequence-a+0", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+1", "sidekick-human-intro-sequence-a+1", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+2", "sidekick-human-intro-sequence-a+2", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+3", "sidekick-human-intro-sequence-a+3", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+4", "sidekick-human-intro-sequence-a+4", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+5", "sidekick-human-intro-sequence-a+5", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+6", "sidekick-human-intro-sequence-a+6", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+7", "sidekick-human-intro-sequence-a+7", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+8", "sidekick-human-intro-sequence-a+8", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+9", "sidekick-human-intro-sequence-a+9", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+10", "sidekick-human-intro-sequence-a+10", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+11", "sidekick-human-intro-sequence-a+11", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+12", "sidekick-human-intro-sequence-a+12", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+13", "sidekick-human-intro-sequence-a+13", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+14", "sidekick-human-intro-sequence-a+14", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+15", "sidekick-human-intro-sequence-a+15", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+16", "sidekick-human-intro-sequence-a+16", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+17", "sidekick-human-intro-sequence-a+17", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+18", "sidekick-human-intro-sequence-a+18", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+19", "sidekick-human-intro-sequence-a+19", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+20", "sidekick-human-intro-sequence-a+20", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+21", "sidekick-human-intro-sequence-a+21", 2, ["NO-XGO"], ""], +["fisher-accept+0", "fisher-accept+0", 2, ["NO-XGO"], ""], +["fisher-accept+1", "fisher-accept+1", 2, ["NO-XGO"], ""], +["fisher-accept+2", "fisher-accept+2", 2, ["NO-XGO"], ""], +["fisher-accept+3", "fisher-accept+3", 2, ["NO-XGO"], ""], +["fisher-accept+4", "fisher-accept+4", 2, ["NO-XGO"], ""], +["fisher-accept+5", "fisher-accept+5", 2, ["NO-XGO"], ""], +["finalbosscam-white-eco+0", "finalbosscam-white-eco+0", 2, ["NO-XGO"], ""], +["finalbosscam-white-eco+1", "finalbosscam-white-eco+1", 2, ["NO-XGO"], ""], +["finalbosscam-white-eco+2", "finalbosscam-white-eco+2", 2, ["NO-XGO"], ""], +["farmer-resolution+0", "farmer-resolution+0", 2, ["NO-XGO"], ""], +["farmer-resolution+1", "farmer-resolution+1", 2, ["NO-XGO"], ""], +["farmer-resolution+2", "farmer-resolution+2", 2, ["NO-XGO"], ""], +["farmer-resolution+3", "farmer-resolution+3", 2, ["NO-XGO"], ""], +["assistant-reminder-1-race-bike+0", "assistant-reminder-1-race-bike+0", 2, ["NO-XGO"], ""], +["assistant-reminder-1-race-bike+1", "assistant-reminder-1-race-bike+1", 2, ["NO-XGO"], ""], +["assistant-reminder-1-race-bike+2", "assistant-reminder-1-race-bike+2", 2, ["NO-XGO"], ""], +["mayor-reminder-donation+0", "mayor-reminder-donation+0", 2, ["NO-XGO"], ""], +["mayor-reminder-donation+1", "mayor-reminder-donation+1", 2, ["NO-XGO"], ""], +["mayor-reminder-donation+2", "mayor-reminder-donation+2", 2, ["NO-XGO"], ""], +["gambler-resolution-race+0", "gambler-resolution-race+0", 2, ["NO-XGO"], ""], +["gambler-resolution-race+1", "gambler-resolution-race+1", 2, ["NO-XGO"], ""], +["gambler-resolution-race+2", "gambler-resolution-race+2", 2, ["NO-XGO"], ""], +["fuel-cell-flut-victory-1+0", "fuel-cell-flut-victory-1+0", 2, ["NO-XGO"], ""], +["fuel-cell-flut-victory-1+1", "fuel-cell-flut-victory-1+1", 2, ["NO-XGO"], ""], +["fuel-cell-victory-5+0", "fuel-cell-victory-5+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory-5+1", "fuel-cell-victory-5+1", 2, ["NO-XGO"], ""], +["sage-bluehut-reminder-1-crop-dusting+0", "sage-bluehut-reminder-1-crop-dusting+0", 2, ["NO-XGO"], ""], +["sage-bluehut-reminder-1-crop-dusting+1", "sage-bluehut-reminder-1-crop-dusting+1", 2, ["NO-XGO"], ""], +["sage-bluehut-reminder-1-crop-dusting+2", "sage-bluehut-reminder-1-crop-dusting+2", 2, ["NO-XGO"], ""], +["flying-lurker-intro+0", "flying-lurker-intro+0", 2, ["NO-XGO"], ""], +["flying-lurker-intro+1", "flying-lurker-intro+1", 2, ["NO-XGO"], ""], +["sage-reminder-1-ecorocks+0", "sage-reminder-1-ecorocks+0", 2, ["NO-XGO"], ""], +["sage-reminder-1-ecorocks+1", "sage-reminder-1-ecorocks+1", 2, ["NO-XGO"], ""], +["sage-reminder-1-ecorocks+2", "sage-reminder-1-ecorocks+2", 2, ["NO-XGO"], ""], +["sage-reminder-1-ecorocks+3", "sage-reminder-1-ecorocks+3", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-robbers+0", "assistant-village2-reminder-1-robbers+0", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-robbers+1", "assistant-village2-reminder-1-robbers+1", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-robbers+2", "assistant-village2-reminder-1-robbers+2", 2, ["NO-XGO"], ""], +["minershort-reminder-2-orbs+0", "minershort-reminder-2-orbs+0", 2, ["NO-XGO"], ""], +["minershort-reminder-2-orbs+1", "minershort-reminder-2-orbs+1", 2, ["NO-XGO"], ""], +["mayor-reminder-beams+0", "mayor-reminder-beams+0", 2, ["NO-XGO"], ""], +["mayor-reminder-beams+1", "mayor-reminder-beams+1", 2, ["NO-XGO"], ""], +["mayor-reminder-beams+2", "mayor-reminder-beams+2", 2, ["NO-XGO"], ""], +["logo-intro-2+0", "logo-intro-2+0", 2, ["NO-XGO"], ""], +["logo-intro-2+1", "logo-intro-2+1", 2, ["NO-XGO"], ""], +["logo-intro-2+2", "logo-intro-2+2", 2, ["NO-XGO"], ""], +["logo-intro-2+3", "logo-intro-2+3", 2, ["NO-XGO"], ""], +["logo-intro-2+4", "logo-intro-2+4", 2, ["NO-XGO"], ""], +["logo-intro-2+5", "logo-intro-2+5", 2, ["NO-XGO"], ""], +["logo-intro-2+6", "logo-intro-2+6", 2, ["NO-XGO"], ""], +["logo-intro-2+7", "logo-intro-2+7", 2, ["NO-XGO"], ""], +["logo-intro-2+8", "logo-intro-2+8", 2, ["NO-XGO"], ""], +["logo-intro-2+9", "logo-intro-2+9", 2, ["NO-XGO"], ""], +["logo-intro-2+10", "logo-intro-2+10", 2, ["NO-XGO"], ""], +["logo-intro-2+11", "logo-intro-2+11", 2, ["NO-XGO"], ""], +["logo-intro-2+12", "logo-intro-2+12", 2, ["NO-XGO"], ""], +["logo-intro-2+13", "logo-intro-2+13", 2, ["NO-XGO"], ""], +["logo-intro-2+14", "logo-intro-2+14", 2, ["NO-XGO"], ""], +["sage-reminder-1-generic+0", "sage-reminder-1-generic+0", 2, ["NO-XGO"], ""], +["sage-reminder-1-generic+1", "sage-reminder-1-generic+1", 2, ["NO-XGO"], ""], +["sage-reminder-1-generic+2", "sage-reminder-1-generic+2", 2, ["NO-XGO"], ""], +["bird-lady-reminder-1+0", "bird-lady-reminder-1+0", 2, ["NO-XGO"], ""], +["bird-lady-reminder-1+1", "bird-lady-reminder-1+1", 2, ["NO-XGO"], ""], +["bird-lady-reminder-1+2", "bird-lady-reminder-1+2", 2, ["NO-XGO"], ""], +["bird-lady-reminder-1+3", "bird-lady-reminder-1+3", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-room+0", "assistant-village2-reminder-1-room+0", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-room+1", "assistant-village2-reminder-1-room+1", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-room+2", "assistant-village2-reminder-1-room+2", 2, ["NO-XGO"], ""], +["assistant-reminder-1-blue-eco-switch+0", "assistant-reminder-1-blue-eco-switch+0", 2, ["NO-XGO"], ""], +["assistant-reminder-1-blue-eco-switch+1", "assistant-reminder-1-blue-eco-switch+1", 2, ["NO-XGO"], ""], +["assistant-reminder-1-blue-eco-switch+2", "assistant-reminder-1-blue-eco-switch+2", 2, ["NO-XGO"], ""], +["logo-loop+0", "logo-loop+0", 2, ["NO-XGO"], ""], +["logo-loop+1", "logo-loop+1", 2, ["NO-XGO"], ""], +["logo-loop+2", "logo-loop+2", 2, ["NO-XGO"], ""], +["logo-loop+3", "logo-loop+3", 2, ["NO-XGO"], ""], +["logo-loop+4", "logo-loop+4", 2, ["NO-XGO"], ""], +["logo-loop+5", "logo-loop+5", 2, ["NO-XGO"], ""], +["logo-loop+6", "logo-loop+6", 2, ["NO-XGO"], ""], +["logo-loop+7", "logo-loop+7", 2, ["NO-XGO"], ""], +["logo-loop+8", "logo-loop+8", 2, ["NO-XGO"], ""], +["logo-loop+9", "logo-loop+9", 2, ["NO-XGO"], ""], +["logo-loop+10", "logo-loop+10", 2, ["NO-XGO"], ""], +["logo-loop+11", "logo-loop+11", 2, ["NO-XGO"], ""], +["logo-loop+12", "logo-loop+12", 2, ["NO-XGO"], ""], +["logo-loop+13", "logo-loop+13", 2, ["NO-XGO"], ""], +["logo-loop+14", "logo-loop+14", 2, ["NO-XGO"], ""], +["logo-loop+15", "logo-loop+15", 2, ["NO-XGO"], ""], +["logo-loop+16", "logo-loop+16", 2, ["NO-XGO"], ""], +["farmer-introduction+0", "farmer-introduction+0", 2, ["NO-XGO"], ""], +["farmer-introduction+1", "farmer-introduction+1", 2, ["NO-XGO"], ""], +["farmer-introduction+2", "farmer-introduction+2", 2, ["NO-XGO"], ""], +["farmer-introduction+3", "farmer-introduction+3", 2, ["NO-XGO"], ""], +["farmer-introduction+4", "farmer-introduction+4", 2, ["NO-XGO"], ""], +["geologist-resolution-moles+0", "geologist-resolution-moles+0", 2, ["NO-XGO"], ""], +["geologist-resolution-moles+1", "geologist-resolution-moles+1", 2, ["NO-XGO"], ""], +["geologist-resolution-moles+2", "geologist-resolution-moles+2", 2, ["NO-XGO"], ""], +["v1-in+0", "v1-in+0", 2, ["NO-XGO"], ""], +["v1-in+1", "v1-in+1", 2, ["NO-XGO"], ""], +["fuel-cell-victory-4+0", "fuel-cell-victory-4+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory-4+1", "fuel-cell-victory-4+1", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+0", "sage-introduction-ecorocks+0", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+1", "sage-introduction-ecorocks+1", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+2", "sage-introduction-ecorocks+2", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+3", "sage-introduction-ecorocks+3", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+4", "sage-introduction-ecorocks+4", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+5", "sage-introduction-ecorocks+5", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+6", "sage-introduction-ecorocks+6", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+7", "sage-introduction-ecorocks+7", 2, ["NO-XGO"], ""], +["minershort-reminder-1-switch+0", "minershort-reminder-1-switch+0", 2, ["NO-XGO"], ""], +["minershort-reminder-1-switch+1", "minershort-reminder-1-switch+1", 2, ["NO-XGO"], ""], +["minershort-reminder-1-switch+2", "minershort-reminder-1-switch+2", 2, ["NO-XGO"], ""], +["minershort-reminder-1-switch+3", "minershort-reminder-1-switch+3", 2, ["NO-XGO"], ""], +["minershort-reminder-1-switch+4", "minershort-reminder-1-switch+4", 2, ["NO-XGO"], ""], +["logo-intro+0", "logo-intro+0", 2, ["NO-XGO"], ""], +["logo-intro+1", "logo-intro+1", 2, ["NO-XGO"], ""], +["logo-intro+2", "logo-intro+2", 2, ["NO-XGO"], ""], +["sage-reminder-2-generic+0", "sage-reminder-2-generic+0", 2, ["NO-XGO"], ""], +["sage-reminder-2-generic+1", "sage-reminder-2-generic+1", 2, ["NO-XGO"], ""], +["sage-reminder-2-generic+2", "sage-reminder-2-generic+2", 2, ["NO-XGO"], ""], +["sage-reminder-2-generic+3", "sage-reminder-2-generic+3", 2, ["NO-XGO"], ""], +["muse-victory+0", "muse-victory+0", 2, ["NO-XGO"], ""], +["muse-victory+1", "muse-victory+1", 2, ["NO-XGO"], ""], +["sage-reminder-1-misty-cannon+0", "sage-reminder-1-misty-cannon+0", 2, ["NO-XGO"], ""], +["sage-reminder-1-misty-cannon+1", "sage-reminder-1-misty-cannon+1", 2, ["NO-XGO"], ""], +["sage-reminder-1-misty-cannon+2", "sage-reminder-1-misty-cannon+2", 2, ["NO-XGO"], ""], +["sage-reminder-1-misty-cannon+3", "sage-reminder-1-misty-cannon+3", 2, ["NO-XGO"], ""], +["sage-reminder-1-misty-cannon+4", "sage-reminder-1-misty-cannon+4", 2, ["NO-XGO"], ""], +["fuel-cell-victory-7+0", "fuel-cell-victory-7+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory-7+1", "fuel-cell-victory-7+1", 2, ["NO-XGO"], ""], +["minershort-resolution-1-orbs+0", "minershort-resolution-1-orbs+0", 2, ["NO-XGO"], ""], +["minershort-resolution-1-orbs+1", "minershort-resolution-1-orbs+1", 2, ["NO-XGO"], ""], +["fuel-cell-victory-8+0", "fuel-cell-victory-8+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory-8+1", "fuel-cell-victory-8+1", 2, ["NO-XGO"], ""], +["bird-lady-reminder-2+0", "bird-lady-reminder-2+0", 2, ["NO-XGO"], ""], +["bird-lady-reminder-2+1", "bird-lady-reminder-2+1", 2, ["NO-XGO"], ""], +["bird-lady-reminder-2+2", "bird-lady-reminder-2+2", 2, ["NO-XGO"], ""], +["bird-lady-reminder-2+3", "bird-lady-reminder-2+3", 2, ["NO-XGO"], ""], +["bird-lady-reminder-2+4", "bird-lady-reminder-2+4", 2, ["NO-XGO"], ""], +["fuel-cell-victory-6+0", "fuel-cell-victory-6+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory-6+1", "fuel-cell-victory-6+1", 2, ["NO-XGO"], ""], +["fuel-cell-victory-3+0", "fuel-cell-victory-3+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory-3+1", "fuel-cell-victory-3+1", 2, ["NO-XGO"], ""], +["plunger-lurker-blowup+0", "plunger-lurker-blowup+0", 2, ["NO-XGO"], ""], +["plunger-lurker-blowup+1", "plunger-lurker-blowup+1", 2, ["NO-XGO"], ""], +["plunger-lurker-blowup+2", "plunger-lurker-blowup+2", 2, ["NO-XGO"], ""], +["plunger-lurker-blowup+3", "plunger-lurker-blowup+3", 2, ["NO-XGO"], ""], +["plant-boss-main+0", "plant-boss-main+0", 2, ["NO-XGO"], ""], +["warrior-resolution+0", "warrior-resolution+0", 2, ["NO-XGO"], ""], +["warrior-resolution+1", "warrior-resolution+1", 2, ["NO-XGO"], ""], +["warrior-resolution+2", "warrior-resolution+2", 2, ["NO-XGO"], ""], +["warrior-resolution+3", "warrior-resolution+3", 2, ["NO-XGO"], ""], +["warrior-resolution+4", "warrior-resolution+4", 2, ["NO-XGO"], ""], +["warrior-resolution+5", "warrior-resolution+5", 2, ["NO-XGO"], ""], +["eichar-racer+0", "eichar-racer+0", 2, ["NO-XGO"], ""], +["mayor-resolution-donation+0", "mayor-resolution-donation+0", 2, ["NO-XGO"], ""], +["mayor-resolution-donation+1", "mayor-resolution-donation+1", 2, ["NO-XGO"], ""], +["mayor-resolution-donation+2", "mayor-resolution-donation+2", 2, ["NO-XGO"], ""], +["mayor-resolution-donation+3", "mayor-resolution-donation+3", 2, ["NO-XGO"], ""], +["mayor-resolution-donation+4", "mayor-resolution-donation+4", 2, ["NO-XGO"], ""], +["mayor-resolution-beams+0", "mayor-resolution-beams+0", 2, ["NO-XGO"], ""], +["mayor-resolution-beams+1", "mayor-resolution-beams+1", 2, ["NO-XGO"], ""], +["mayor-resolution-beams+2", "mayor-resolution-beams+2", 2, ["NO-XGO"], ""], +["mayor-resolution-beams+3", "mayor-resolution-beams+3", 2, ["NO-XGO"], ""], +["mayor-resolution-beams+4", "mayor-resolution-beams+4", 2, ["NO-XGO"], ""], +["mayor-resolution-beams+5", "mayor-resolution-beams+5", 2, ["NO-XGO"], ""], +["minershort-introduction-switch+0", "minershort-introduction-switch+0", 2, ["NO-XGO"], ""], +["minershort-introduction-switch+1", "minershort-introduction-switch+1", 2, ["NO-XGO"], ""], +["minershort-introduction-switch+2", "minershort-introduction-switch+2", 2, ["NO-XGO"], ""], +["minershort-introduction-switch+3", "minershort-introduction-switch+3", 2, ["NO-XGO"], ""], +["minershort-introduction-switch+4", "minershort-introduction-switch+4", 2, ["NO-XGO"], ""], +["minershort-introduction-switch+5", "minershort-introduction-switch+5", 2, ["NO-XGO"], ""], +["minershort-introduction-switch+6", "minershort-introduction-switch+6", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1+0", "fishermans-boat-ride-to-village1+0", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1+1", "fishermans-boat-ride-to-village1+1", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1+2", "fishermans-boat-ride-to-village1+2", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-misty+0", "fishermans-boat-ride-to-misty+0", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-misty+1", "fishermans-boat-ride-to-misty+1", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-misty+2", "fishermans-boat-ride-to-misty+2", 2, ["NO-XGO"], ""], +["sage-bluehut-reminder-1-prec-arm+0", "sage-bluehut-reminder-1-prec-arm+0", 2, ["NO-XGO"], ""], +["sage-bluehut-reminder-1-prec-arm+1", "sage-bluehut-reminder-1-prec-arm+1", 2, ["NO-XGO"], ""], +["sage-bluehut-reminder-1-prec-arm+2", "sage-bluehut-reminder-1-prec-arm+2", 2, ["NO-XGO"], ""], +["sage-bluehut-reminder-1-prec-arm+3", "sage-bluehut-reminder-1-prec-arm+3", 2, ["NO-XGO"], ""], +["ndi-intro+0", "ndi-intro+0", 2, ["NO-XGO"], ""], +["ndi-intro+1", "ndi-intro+1", 2, ["NO-XGO"], ""], +["ndi-intro+2", "ndi-intro+2", 2, ["NO-XGO"], ""], +["ndi-intro+3", "ndi-intro+3", 2, ["NO-XGO"], ""], +["gondola-ride-down+0", "gondola-ride-down+0", 2, ["NO-XGO"], ""], +["gondola-ride-down+1", "gondola-ride-down+1", 2, ["NO-XGO"], ""], +["gondola-ride-down+2", "gondola-ride-down+2", 2, ["NO-XGO"], ""], +["gondola-ride-up+0", "gondola-ride-up+0", 2, ["NO-XGO"], ""], +["gondola-ride-up+1", "gondola-ride-up+1", 2, ["NO-XGO"], ""], +["gondola-ride-up+2", "gondola-ride-up+2", 2, ["NO-XGO"], ""], +["sage-village3-introduction-rams+0", "sage-village3-introduction-rams+0", 2, ["NO-XGO"], ""], +["sage-village3-introduction-rams+1", "sage-village3-introduction-rams+1", 2, ["NO-XGO"], ""], +["sage-village3-introduction-rams+2", "sage-village3-introduction-rams+2", 2, ["NO-XGO"], ""], +["sage-village3-introduction-rams+3", "sage-village3-introduction-rams+3", 2, ["NO-XGO"], ""], +["sage-village3-introduction-rams+4", "sage-village3-introduction-rams+4", 2, ["NO-XGO"], ""], +["sage-village3-introduction-rams+5", "sage-village3-introduction-rams+5", 2, ["NO-XGO"], ""], +["yellowsage-resolution+0", "yellowsage-resolution+0", 2, ["NO-XGO"], ""], +["yellowsage-resolution+1", "yellowsage-resolution+1", 2, ["NO-XGO"], ""], +["yellowsage-resolution+2", "yellowsage-resolution+2", 2, ["NO-XGO"], ""], +["yellowsage-resolution+3", "yellowsage-resolution+3", 2, ["NO-XGO"], ""], +["yellowsage-resolution+4", "yellowsage-resolution+4", 2, ["NO-XGO"], ""], +["yellowsage-resolution+5", "yellowsage-resolution+5", 2, ["NO-XGO"], ""], +["eichar-flut+0", "eichar-flut+0", 2, ["NO-XGO"], ""], +["green-sagecage-daxter-sacrifice+0", "green-sagecage-daxter-sacrifice+0", 2, ["NO-XGO"], ""], +["green-sagecage-daxter-sacrifice+1", "green-sagecage-daxter-sacrifice+1", 2, ["NO-XGO"], ""], +["green-sagecage-daxter-sacrifice+2", "green-sagecage-daxter-sacrifice+2", 2, ["NO-XGO"], ""], +["green-sagecage-daxter-sacrifice+3", "green-sagecage-daxter-sacrifice+3", 2, ["NO-XGO"], ""], +["green-sagecage-daxter-sacrifice+4", "green-sagecage-daxter-sacrifice+4", 2, ["NO-XGO"], ""], +["green-sagecage-daxter-sacrifice+5", "green-sagecage-daxter-sacrifice+5", 2, ["NO-XGO"], ""], +["explorer-reminder-1+0", "explorer-reminder-1+0", 2, ["NO-XGO"], ""], +["explorer-reminder-1+1", "explorer-reminder-1+1", 2, ["NO-XGO"], ""], +["explorer-reminder-1+2", "explorer-reminder-1+2", 2, ["NO-XGO"], ""], +["explorer-reminder-1+3", "explorer-reminder-1+3", 2, ["NO-XGO"], ""], +["explorer-reminder-1+4", "explorer-reminder-1+4", 2, ["NO-XGO"], ""], +["sculptor-resolution+0", "sculptor-resolution+0", 2, ["NO-XGO"], ""], +["sculptor-resolution+1", "sculptor-resolution+1", 2, ["NO-XGO"], ""], +["sculptor-resolution+2", "sculptor-resolution+2", 2, ["NO-XGO"], ""], +["sculptor-resolution+3", "sculptor-resolution+3", 2, ["NO-XGO"], ""], +["fisher-resolution+0", "fisher-resolution+0", 2, ["NO-XGO"], ""], +["fisher-resolution+1", "fisher-resolution+1", 2, ["NO-XGO"], ""], +["fisher-resolution+2", "fisher-resolution+2", 2, ["NO-XGO"], ""], +["fisher-resolution+3", "fisher-resolution+3", 2, ["NO-XGO"], ""], +["sidekick-human-intro-test+0", "sidekick-human-intro-test+0", 2, ["NO-XGO"], ""], +["sidekick-human-intro-test+1", "sidekick-human-intro-test+1", 2, ["NO-XGO"], ""], +["sidekick-human-intro-test+2", "sidekick-human-intro-test+2", 2, ["NO-XGO"], ""], +["sidekick-human-intro-test+3", "sidekick-human-intro-test+3", 2, ["NO-XGO"], ""], +["sidekick-human-intro-test+4", "sidekick-human-intro-test+4", 2, ["NO-XGO"], ""], +["sidekick-human-intro-test+5", "sidekick-human-intro-test+5", 2, ["NO-XGO"], ""], +["gambler-introduction-1+0", "gambler-introduction-1+0", 2, ["NO-XGO"], ""], +["gambler-introduction-1+1", "gambler-introduction-1+1", 2, ["NO-XGO"], ""], +["gambler-introduction-1+2", "gambler-introduction-1+2", 2, ["NO-XGO"], ""], +["gambler-introduction-1+3", "gambler-introduction-1+3", 2, ["NO-XGO"], ""], +["gambler-introduction-1+4", "gambler-introduction-1+4", 2, ["NO-XGO"], ""], +["gambler-introduction-1+5", "gambler-introduction-1+5", 2, ["NO-XGO"], ""], +["gambler-introduction-1+6", "gambler-introduction-1+6", 2, ["NO-XGO"], ""], +["gambler-introduction-1+7", "gambler-introduction-1+7", 2, ["NO-XGO"], ""], +["gambler-introduction-1+8", "gambler-introduction-1+8", 2, ["NO-XGO"], ""], +["explorer-resolution+0", "explorer-resolution+0", 2, ["NO-XGO"], ""], +["explorer-resolution+1", "explorer-resolution+1", 2, ["NO-XGO"], ""], +["explorer-resolution+2", "explorer-resolution+2", 2, ["NO-XGO"], ""], +["explorer-resolution+3", "explorer-resolution+3", 2, ["NO-XGO"], ""], +["explorer-resolution+4", "explorer-resolution+4", 2, ["NO-XGO"], ""], +["minershort-resolution-2-orbs+0", "minershort-resolution-2-orbs+0", 2, ["NO-XGO"], ""], +["minershort-resolution-2-orbs+1", "minershort-resolution-2-orbs+1", 2, ["NO-XGO"], ""], +["minershort-resolution-2-orbs+2", "minershort-resolution-2-orbs+2", 2, ["NO-XGO"], ""], +["minershort-resolution-2-orbs+3", "minershort-resolution-2-orbs+3", 2, ["NO-XGO"], ""], +["minershort-resolution-2-orbs+4", "minershort-resolution-2-orbs+4", 2, ["NO-XGO"], ""], +["minershort-resolution-2-orbs+5", "minershort-resolution-2-orbs+5", 2, ["NO-XGO"], ""], +["assistant-introduction-race-bike+0", "assistant-introduction-race-bike+0", 2, ["NO-XGO"], ""], +["assistant-introduction-race-bike+1", "assistant-introduction-race-bike+1", 2, ["NO-XGO"], ""], +["assistant-introduction-race-bike+2", "assistant-introduction-race-bike+2", 2, ["NO-XGO"], ""], +["assistant-introduction-race-bike+3", "assistant-introduction-race-bike+3", 2, ["NO-XGO"], ""], +["assistant-introduction-race-bike+4", "assistant-introduction-race-bike+4", 2, ["NO-XGO"], ""], +["assistant-introduction-race-bike+5", "assistant-introduction-race-bike+5", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-enough-cells+0", "green-sagecage-outro-beat-boss-enough-cells+0", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-enough-cells+1", "green-sagecage-outro-beat-boss-enough-cells+1", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-enough-cells+2", "green-sagecage-outro-beat-boss-enough-cells+2", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-enough-cells+3", "green-sagecage-outro-beat-boss-enough-cells+3", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-enough-cells+4", "green-sagecage-outro-beat-boss-enough-cells+4", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-enough-cells+5", "green-sagecage-outro-beat-boss-enough-cells+5", 2, ["NO-XGO"], ""], +["billy-introduction+0", "billy-introduction+0", 2, ["NO-XGO"], ""], +["billy-introduction+1", "billy-introduction+1", 2, ["NO-XGO"], ""], +["billy-introduction+2", "billy-introduction+2", 2, ["NO-XGO"], ""], +["billy-introduction+3", "billy-introduction+3", 2, ["NO-XGO"], ""], +["billy-introduction+4", "billy-introduction+4", 2, ["NO-XGO"], ""], +["billy-introduction+5", "billy-introduction+5", 2, ["NO-XGO"], ""], +["billy-introduction+6", "billy-introduction+6", 2, ["NO-XGO"], ""], +["billy-introduction+7", "billy-introduction+7", 2, ["NO-XGO"], ""], +["billy-introduction+8", "billy-introduction+8", 2, ["NO-XGO"], ""], +["billy-introduction+9", "billy-introduction+9", 2, ["NO-XGO"], ""], +["billy-introduction+10", "billy-introduction+10", 2, ["NO-XGO"], ""], +["billy-introduction+11", "billy-introduction+11", 2, ["NO-XGO"], ""], +["billy-introduction+12", "billy-introduction+12", 2, ["NO-XGO"], ""], +["billy-introduction+13", "billy-introduction+13", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+0", "green-sagecage-outro-beat-boss-need-cells+0", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+1", "green-sagecage-outro-beat-boss-need-cells+1", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+2", "green-sagecage-outro-beat-boss-need-cells+2", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+3", "green-sagecage-outro-beat-boss-need-cells+3", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+4", "green-sagecage-outro-beat-boss-need-cells+4", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+5", "green-sagecage-outro-beat-boss-need-cells+5", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+6", "green-sagecage-outro-beat-boss-need-cells+6", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+7", "green-sagecage-outro-beat-boss-need-cells+7", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-robbers+0", "assistant-village2-introduction-robbers+0", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-robbers+1", "assistant-village2-introduction-robbers+1", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-robbers+2", "assistant-village2-introduction-robbers+2", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-robbers+3", "assistant-village2-introduction-robbers+3", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-robbers+4", "assistant-village2-introduction-robbers+4", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-robbers+5", "assistant-village2-introduction-robbers+5", 2, ["NO-XGO"], ""], +["green-sagecage-outro-big-finish+0", "green-sagecage-outro-big-finish+0", 2, ["NO-XGO"], ""], +["green-sagecage-outro-big-finish+1", "green-sagecage-outro-big-finish+1", 2, ["NO-XGO"], ""], +["green-sagecage-outro-big-finish+2", "green-sagecage-outro-big-finish+2", 2, ["NO-XGO"], ""], +["green-sagecage-outro-big-finish+3", "green-sagecage-outro-big-finish+3", 2, ["NO-XGO"], ""], +["green-sagecage-outro-big-finish+4", "green-sagecage-outro-big-finish+4", 2, ["NO-XGO"], ""], +["green-sagecage-outro-big-finish+5", "green-sagecage-outro-big-finish+5", 2, ["NO-XGO"], ""], +["green-sagecage-outro-big-finish+6", "green-sagecage-outro-big-finish+6", 2, ["NO-XGO"], ""], +["redsage-resolution+0", "redsage-resolution+0", 2, ["NO-XGO"], ""], +["redsage-resolution+1", "redsage-resolution+1", 2, ["NO-XGO"], ""], +["redsage-resolution+2", "redsage-resolution+2", 2, ["NO-XGO"], ""], +["redsage-resolution+3", "redsage-resolution+3", 2, ["NO-XGO"], ""], +["redsage-resolution+4", "redsage-resolution+4", 2, ["NO-XGO"], ""], +["redsage-resolution+5", "redsage-resolution+5", 2, ["NO-XGO"], ""], +["redsage-resolution+6", "redsage-resolution+6", 2, ["NO-XGO"], ""], +["redsage-resolution+7", "redsage-resolution+7", 2, ["NO-XGO"], ""], +["redsage-resolution+8", "redsage-resolution+8", 2, ["NO-XGO"], ""], +["bluesage-resolution+0", "bluesage-resolution+0", 2, ["NO-XGO"], ""], +["bluesage-resolution+1", "bluesage-resolution+1", 2, ["NO-XGO"], ""], +["bluesage-resolution+2", "bluesage-resolution+2", 2, ["NO-XGO"], ""], +["bluesage-resolution+3", "bluesage-resolution+3", 2, ["NO-XGO"], ""], +["bluesage-resolution+4", "bluesage-resolution+4", 2, ["NO-XGO"], ""], +["bluesage-resolution+5", "bluesage-resolution+5", 2, ["NO-XGO"], ""], +["bluesage-resolution+6", "bluesage-resolution+6", 2, ["NO-XGO"], ""], +["bluesage-resolution+7", "bluesage-resolution+7", 2, ["NO-XGO"], ""], +["bluesage-resolution+8", "bluesage-resolution+8", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+0", "sage-bluehut-introduction-prec-arm+0", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+1", "sage-bluehut-introduction-prec-arm+1", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+2", "sage-bluehut-introduction-prec-arm+2", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+3", "sage-bluehut-introduction-prec-arm+3", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+4", "sage-bluehut-introduction-prec-arm+4", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+5", "sage-bluehut-introduction-prec-arm+5", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+6", "sage-bluehut-introduction-prec-arm+6", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+7", "sage-bluehut-introduction-prec-arm+7", 2, ["NO-XGO"], ""], +["evilbro-misty-end+0", "evilbro-misty-end+0", 2, ["NO-XGO"], ""], +["evilbro-misty-end+1", "evilbro-misty-end+1", 2, ["NO-XGO"], ""], +["evilbro-misty-end+2", "evilbro-misty-end+2", 2, ["NO-XGO"], ""], +["evilbro-misty-end+3", "evilbro-misty-end+3", 2, ["NO-XGO"], ""], +["evilbro-misty-end+4", "evilbro-misty-end+4", 2, ["NO-XGO"], ""], +["evilbro-misty-end+5", "evilbro-misty-end+5", 2, ["NO-XGO"], ""], +["evilbro-misty-end+6", "evilbro-misty-end+6", 2, ["NO-XGO"], ""], +["evilbro-misty-end+7", "evilbro-misty-end+7", 2, ["NO-XGO"], ""], +["evilbro-misty-end+8", "evilbro-misty-end+8", 2, ["NO-XGO"], ""], +["assistant-village2-resolution+0", "assistant-village2-resolution+0", 2, ["NO-XGO"], ""], +["assistant-village2-resolution+1", "assistant-village2-resolution+1", 2, ["NO-XGO"], ""], +["assistant-village2-resolution+2", "assistant-village2-resolution+2", 2, ["NO-XGO"], ""], +["assistant-village2-resolution+3", "assistant-village2-resolution+3", 2, ["NO-XGO"], ""], +["assistant-village2-resolution+4", "assistant-village2-resolution+4", 2, ["NO-XGO"], ""], +["assistant-village2-resolution+5", "assistant-village2-resolution+5", 2, ["NO-XGO"], ""], +["assistant-village2-resolution+6", "assistant-village2-resolution+6", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+0", "sage-introduction-misty-cannon+0", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+1", "sage-introduction-misty-cannon+1", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+2", "sage-introduction-misty-cannon+2", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+3", "sage-introduction-misty-cannon+3", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+4", "sage-introduction-misty-cannon+4", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+5", "sage-introduction-misty-cannon+5", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+6", "sage-introduction-misty-cannon+6", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+7", "sage-introduction-misty-cannon+7", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+8", "sage-introduction-misty-cannon+8", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+9", "sage-introduction-misty-cannon+9", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+10", "sage-introduction-misty-cannon+10", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+11", "sage-introduction-misty-cannon+11", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+0", "minershort-introduction-gnawers+0", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+1", "minershort-introduction-gnawers+1", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+2", "minershort-introduction-gnawers+2", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+3", "minershort-introduction-gnawers+3", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+4", "minershort-introduction-gnawers+4", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+5", "minershort-introduction-gnawers+5", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+6", "minershort-introduction-gnawers+6", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+7", "minershort-introduction-gnawers+7", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+0", "green-sagecage-outro-beat-boss-a+0", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+1", "green-sagecage-outro-beat-boss-a+1", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+2", "green-sagecage-outro-beat-boss-a+2", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+3", "green-sagecage-outro-beat-boss-a+3", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+4", "green-sagecage-outro-beat-boss-a+4", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+5", "green-sagecage-outro-beat-boss-a+5", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+6", "green-sagecage-outro-beat-boss-a+6", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+7", "green-sagecage-outro-beat-boss-a+7", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+0", "green-sagecage-introduction+0", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+1", "green-sagecage-introduction+1", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+2", "green-sagecage-introduction+2", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+3", "green-sagecage-introduction+3", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+4", "green-sagecage-introduction+4", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+5", "green-sagecage-introduction+5", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+6", "green-sagecage-introduction+6", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+7", "green-sagecage-introduction+7", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+8", "green-sagecage-introduction+8", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+9", "green-sagecage-introduction+9", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+10", "green-sagecage-introduction+10", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+11", "green-sagecage-introduction+11", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+0", "sage-intro-sequence-e+0", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+1", "sage-intro-sequence-e+1", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+2", "sage-intro-sequence-e+2", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+3", "sage-intro-sequence-e+3", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+4", "sage-intro-sequence-e+4", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+5", "sage-intro-sequence-e+5", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+6", "sage-intro-sequence-e+6", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+7", "sage-intro-sequence-e+7", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+8", "sage-intro-sequence-e+8", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+9", "sage-intro-sequence-e+9", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+10", "sage-intro-sequence-e+10", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+11", "sage-intro-sequence-e+11", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+12", "sage-intro-sequence-e+12", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+0", "sage-village3-introduction-dark-eco+0", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+1", "sage-village3-introduction-dark-eco+1", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+2", "sage-village3-introduction-dark-eco+2", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+3", "sage-village3-introduction-dark-eco+3", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+4", "sage-village3-introduction-dark-eco+4", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+5", "sage-village3-introduction-dark-eco+5", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+6", "sage-village3-introduction-dark-eco+6", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+7", "sage-village3-introduction-dark-eco+7", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+8", "sage-village3-introduction-dark-eco+8", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+0", "assistant-firecanyon-resolution+0", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+1", "assistant-firecanyon-resolution+1", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+2", "assistant-firecanyon-resolution+2", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+3", "assistant-firecanyon-resolution+3", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+4", "assistant-firecanyon-resolution+4", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+5", "assistant-firecanyon-resolution+5", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+6", "assistant-firecanyon-resolution+6", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+7", "assistant-firecanyon-resolution+7", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+8", "assistant-firecanyon-resolution+8", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+9", "assistant-firecanyon-resolution+9", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+10", "assistant-firecanyon-resolution+10", 2, ["NO-XGO"], ""], +["explorer-introduction+0", "explorer-introduction+0", 2, ["NO-XGO"], ""], +["explorer-introduction+1", "explorer-introduction+1", 2, ["NO-XGO"], ""], +["explorer-introduction+2", "explorer-introduction+2", 2, ["NO-XGO"], ""], +["explorer-introduction+3", "explorer-introduction+3", 2, ["NO-XGO"], ""], +["explorer-introduction+4", "explorer-introduction+4", 2, ["NO-XGO"], ""], +["explorer-introduction+5", "explorer-introduction+5", 2, ["NO-XGO"], ""], +["explorer-introduction+6", "explorer-introduction+6", 2, ["NO-XGO"], ""], +["explorer-introduction+7", "explorer-introduction+7", 2, ["NO-XGO"], ""], +["explorer-introduction+8", "explorer-introduction+8", 2, ["NO-XGO"], ""], +["explorer-introduction+9", "explorer-introduction+9", 2, ["NO-XGO"], ""], +["explorer-introduction+10", "explorer-introduction+10", 2, ["NO-XGO"], ""], +["bird-lady-introduction+0", "bird-lady-introduction+0", 2, ["NO-XGO"], ""], +["bird-lady-introduction+1", "bird-lady-introduction+1", 2, ["NO-XGO"], ""], +["bird-lady-introduction+2", "bird-lady-introduction+2", 2, ["NO-XGO"], ""], +["bird-lady-introduction+3", "bird-lady-introduction+3", 2, ["NO-XGO"], ""], +["bird-lady-introduction+4", "bird-lady-introduction+4", 2, ["NO-XGO"], ""], +["bird-lady-introduction+5", "bird-lady-introduction+5", 2, ["NO-XGO"], ""], +["bird-lady-introduction+6", "bird-lady-introduction+6", 2, ["NO-XGO"], ""], +["bird-lady-introduction+7", "bird-lady-introduction+7", 2, ["NO-XGO"], ""], +["bird-lady-introduction+8", "bird-lady-introduction+8", 2, ["NO-XGO"], ""], +["bird-lady-introduction+9", "bird-lady-introduction+9", 2, ["NO-XGO"], ""], +["bird-lady-introduction+10", "bird-lady-introduction+10", 2, ["NO-XGO"], ""], +["fisher-introduction+0", "fisher-introduction+0", 2, ["NO-XGO"], ""], +["fisher-introduction+1", "fisher-introduction+1", 2, ["NO-XGO"], ""], +["fisher-introduction+2", "fisher-introduction+2", 2, ["NO-XGO"], ""], +["fisher-introduction+3", "fisher-introduction+3", 2, ["NO-XGO"], ""], +["fisher-introduction+4", "fisher-introduction+4", 2, ["NO-XGO"], ""], +["fisher-introduction+5", "fisher-introduction+5", 2, ["NO-XGO"], ""], +["fisher-introduction+6", "fisher-introduction+6", 2, ["NO-XGO"], ""], +["fisher-introduction+7", "fisher-introduction+7", 2, ["NO-XGO"], ""], +["fisher-introduction+8", "fisher-introduction+8", 2, ["NO-XGO"], ""], +["mayor-introduction+0", "mayor-introduction+0", 2, ["NO-XGO"], ""], +["mayor-introduction+1", "mayor-introduction+1", 2, ["NO-XGO"], ""], +["mayor-introduction+2", "mayor-introduction+2", 2, ["NO-XGO"], ""], +["mayor-introduction+3", "mayor-introduction+3", 2, ["NO-XGO"], ""], +["mayor-introduction+4", "mayor-introduction+4", 2, ["NO-XGO"], ""], +["mayor-introduction+5", "mayor-introduction+5", 2, ["NO-XGO"], ""], +["mayor-introduction+6", "mayor-introduction+6", 2, ["NO-XGO"], ""], +["mayor-introduction+7", "mayor-introduction+7", 2, ["NO-XGO"], ""], +["mayor-introduction+8", "mayor-introduction+8", 2, ["NO-XGO"], ""], +["mayor-introduction+9", "mayor-introduction+9", 2, ["NO-XGO"], ""], +["mayor-introduction+10", "mayor-introduction+10", 2, ["NO-XGO"], ""], +["mayor-introduction+11", "mayor-introduction+11", 2, ["NO-XGO"], ""], +["mayor-introduction+12", "mayor-introduction+12", 2, ["NO-XGO"], ""], +["mayor-introduction+13", "mayor-introduction+13", 2, ["NO-XGO"], ""], +["mayor-introduction+14", "mayor-introduction+14", 2, ["NO-XGO"], ""], +["mayor-introduction+15", "mayor-introduction+15", 2, ["NO-XGO"], ""], +["sculptor-introduction+0", "sculptor-introduction+0", 2, ["NO-XGO"], ""], +["sculptor-introduction+1", "sculptor-introduction+1", 2, ["NO-XGO"], ""], +["sculptor-introduction+2", "sculptor-introduction+2", 2, ["NO-XGO"], ""], +["sculptor-introduction+3", "sculptor-introduction+3", 2, ["NO-XGO"], ""], +["sculptor-introduction+4", "sculptor-introduction+4", 2, ["NO-XGO"], ""], +["sculptor-introduction+5", "sculptor-introduction+5", 2, ["NO-XGO"], ""], +["sculptor-introduction+6", "sculptor-introduction+6", 2, ["NO-XGO"], ""], +["sculptor-introduction+7", "sculptor-introduction+7", 2, ["NO-XGO"], ""], +["sculptor-introduction+8", "sculptor-introduction+8", 2, ["NO-XGO"], ""], +["sculptor-introduction+9", "sculptor-introduction+9", 2, ["NO-XGO"], ""], +["sculptor-introduction+10", "sculptor-introduction+10", 2, ["NO-XGO"], ""], +["sculptor-introduction+11", "sculptor-introduction+11", 2, ["NO-XGO"], ""], +["sculptor-introduction+12", "sculptor-introduction+12", 2, ["NO-XGO"], ""], +["sculptor-introduction+13", "sculptor-introduction+13", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+0", "assistant-village2-introduction-flutflut+0", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+1", "assistant-village2-introduction-flutflut+1", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+2", "assistant-village2-introduction-flutflut+2", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+3", "assistant-village2-introduction-flutflut+3", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+4", "assistant-village2-introduction-flutflut+4", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+5", "assistant-village2-introduction-flutflut+5", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+6", "assistant-village2-introduction-flutflut+6", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+7", "assistant-village2-introduction-flutflut+7", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+0", "assistant-lavatube-end-resolution+0", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+1", "assistant-lavatube-end-resolution+1", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+2", "assistant-lavatube-end-resolution+2", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+3", "assistant-lavatube-end-resolution+3", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+4", "assistant-lavatube-end-resolution+4", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+5", "assistant-lavatube-end-resolution+5", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+6", "assistant-lavatube-end-resolution+6", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+7", "assistant-lavatube-end-resolution+7", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+8", "assistant-lavatube-end-resolution+8", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+9", "assistant-lavatube-end-resolution+9", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+10", "assistant-lavatube-end-resolution+10", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+0", "assistant-lavatube-start-resolution+0", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+1", "assistant-lavatube-start-resolution+1", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+2", "assistant-lavatube-start-resolution+2", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+3", "assistant-lavatube-start-resolution+3", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+4", "assistant-lavatube-start-resolution+4", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+5", "assistant-lavatube-start-resolution+5", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+6", "assistant-lavatube-start-resolution+6", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+7", "assistant-lavatube-start-resolution+7", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+8", "assistant-lavatube-start-resolution+8", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+9", "assistant-lavatube-start-resolution+9", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+10", "assistant-lavatube-start-resolution+10", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+0", "assistant-village2-introduction-room+0", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+1", "assistant-village2-introduction-room+1", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+2", "assistant-village2-introduction-room+2", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+3", "assistant-village2-introduction-room+3", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+4", "assistant-village2-introduction-room+4", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+5", "assistant-village2-introduction-room+5", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+6", "assistant-village2-introduction-room+6", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+7", "assistant-village2-introduction-room+7", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+8", "assistant-village2-introduction-room+8", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+9", "assistant-village2-introduction-room+9", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+0", "green-sagecage-resolution+0", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+1", "green-sagecage-resolution+1", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+2", "green-sagecage-resolution+2", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+3", "green-sagecage-resolution+3", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+4", "green-sagecage-resolution+4", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+5", "green-sagecage-resolution+5", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+6", "green-sagecage-resolution+6", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+7", "green-sagecage-resolution+7", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+8", "green-sagecage-resolution+8", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+9", "green-sagecage-resolution+9", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+10", "green-sagecage-resolution+10", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+11", "green-sagecage-resolution+11", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+0", "sage-bluehut-introduction-crop-dusting+0", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+1", "sage-bluehut-introduction-crop-dusting+1", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+2", "sage-bluehut-introduction-crop-dusting+2", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+3", "sage-bluehut-introduction-crop-dusting+3", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+4", "sage-bluehut-introduction-crop-dusting+4", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+5", "sage-bluehut-introduction-crop-dusting+5", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+6", "sage-bluehut-introduction-crop-dusting+6", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+7", "sage-bluehut-introduction-crop-dusting+7", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+8", "sage-bluehut-introduction-crop-dusting+8", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+9", "sage-bluehut-introduction-crop-dusting+9", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+10", "sage-bluehut-introduction-crop-dusting+10", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+11", "sage-bluehut-introduction-crop-dusting+11", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+0", "sidekick-human-intro-sequence-b+0", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+1", "sidekick-human-intro-sequence-b+1", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+2", "sidekick-human-intro-sequence-b+2", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+3", "sidekick-human-intro-sequence-b+3", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+4", "sidekick-human-intro-sequence-b+4", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+5", "sidekick-human-intro-sequence-b+5", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+6", "sidekick-human-intro-sequence-b+6", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+7", "sidekick-human-intro-sequence-b+7", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+8", "sidekick-human-intro-sequence-b+8", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+9", "sidekick-human-intro-sequence-b+9", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+10", "sidekick-human-intro-sequence-b+10", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+0", "assistant-introduction-blue-eco-switch+0", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+1", "assistant-introduction-blue-eco-switch+1", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+2", "assistant-introduction-blue-eco-switch+2", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+3", "assistant-introduction-blue-eco-switch+3", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+4", "assistant-introduction-blue-eco-switch+4", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+5", "assistant-introduction-blue-eco-switch+5", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+6", "assistant-introduction-blue-eco-switch+6", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+7", "assistant-introduction-blue-eco-switch+7", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+8", "assistant-introduction-blue-eco-switch+8", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+9", "assistant-introduction-blue-eco-switch+9", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+10", "assistant-introduction-blue-eco-switch+10", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+0", "bird-lady-beach-resolution+0", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+1", "bird-lady-beach-resolution+1", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+2", "bird-lady-beach-resolution+2", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+3", "bird-lady-beach-resolution+3", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+4", "bird-lady-beach-resolution+4", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+5", "bird-lady-beach-resolution+5", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+6", "bird-lady-beach-resolution+6", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+7", "bird-lady-beach-resolution+7", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+8", "bird-lady-beach-resolution+8", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+9", "bird-lady-beach-resolution+9", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+0", "fishermans-boat-ride-to-village1-alt+0", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+1", "fishermans-boat-ride-to-village1-alt+1", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+2", "fishermans-boat-ride-to-village1-alt+2", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+3", "fishermans-boat-ride-to-village1-alt+3", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+4", "fishermans-boat-ride-to-village1-alt+4", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+5", "fishermans-boat-ride-to-village1-alt+5", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+6", "fishermans-boat-ride-to-village1-alt+6", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+7", "fishermans-boat-ride-to-village1-alt+7", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+8", "fishermans-boat-ride-to-village1-alt+8", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+9", "fishermans-boat-ride-to-village1-alt+9", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+10", "fishermans-boat-ride-to-village1-alt+10", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+11", "fishermans-boat-ride-to-village1-alt+11", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+0", "assistant-village2-introduction+0", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+1", "assistant-village2-introduction+1", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+2", "assistant-village2-introduction+2", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+3", "assistant-village2-introduction+3", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+4", "assistant-village2-introduction+4", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+5", "assistant-village2-introduction+5", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+6", "assistant-village2-introduction+6", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+7", "assistant-village2-introduction+7", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+8", "assistant-village2-introduction+8", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+9", "assistant-village2-introduction+9", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+10", "assistant-village2-introduction+10", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+11", "assistant-village2-introduction+11", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+12", "assistant-village2-introduction+12", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+13", "assistant-village2-introduction+13", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+14", "assistant-village2-introduction+14", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+15", "assistant-village2-introduction+15", 2, ["NO-XGO"], ""], +["geologist-introduction+0", "geologist-introduction+0", 2, ["NO-XGO"], ""], +["geologist-introduction+1", "geologist-introduction+1", 2, ["NO-XGO"], ""], +["geologist-introduction+2", "geologist-introduction+2", 2, ["NO-XGO"], ""], +["geologist-introduction+3", "geologist-introduction+3", 2, ["NO-XGO"], ""], +["geologist-introduction+4", "geologist-introduction+4", 2, ["NO-XGO"], ""], +["geologist-introduction+5", "geologist-introduction+5", 2, ["NO-XGO"], ""], +["geologist-introduction+6", "geologist-introduction+6", 2, ["NO-XGO"], ""], +["geologist-introduction+7", "geologist-introduction+7", 2, ["NO-XGO"], ""], +["geologist-introduction+8", "geologist-introduction+8", 2, ["NO-XGO"], ""], +["geologist-introduction+9", "geologist-introduction+9", 2, ["NO-XGO"], ""], +["geologist-introduction+10", "geologist-introduction+10", 2, ["NO-XGO"], ""], +["geologist-introduction+11", "geologist-introduction+11", 2, ["NO-XGO"], ""], +["geologist-introduction+12", "geologist-introduction+12", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+0", "sage-intro-sequence-d1+0", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+1", "sage-intro-sequence-d1+1", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+2", "sage-intro-sequence-d1+2", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+3", "sage-intro-sequence-d1+3", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+4", "sage-intro-sequence-d1+4", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+5", "sage-intro-sequence-d1+5", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+6", "sage-intro-sequence-d1+6", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+7", "sage-intro-sequence-d1+7", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+8", "sage-intro-sequence-d1+8", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+9", "sage-intro-sequence-d1+9", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+10", "sage-intro-sequence-d1+10", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+11", "sage-intro-sequence-d1+11", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+12", "sage-intro-sequence-d1+12", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+13", "sage-intro-sequence-d1+13", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+14", "sage-intro-sequence-d1+14", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+15", "sage-intro-sequence-d1+15", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+16", "sage-intro-sequence-d1+16", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+0", "sage-intro-sequence-a+0", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+1", "sage-intro-sequence-a+1", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+2", "sage-intro-sequence-a+2", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+3", "sage-intro-sequence-a+3", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+4", "sage-intro-sequence-a+4", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+5", "sage-intro-sequence-a+5", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+6", "sage-intro-sequence-a+6", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+7", "sage-intro-sequence-a+7", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+8", "sage-intro-sequence-a+8", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+9", "sage-intro-sequence-a+9", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+10", "sage-intro-sequence-a+10", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+11", "sage-intro-sequence-a+11", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+12", "sage-intro-sequence-a+12", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+13", "sage-intro-sequence-a+13", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+14", "sage-intro-sequence-a+14", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+15", "sage-intro-sequence-a+15", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+16", "sage-intro-sequence-a+16", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+17", "sage-intro-sequence-a+17", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+18", "sage-intro-sequence-a+18", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+19", "sage-intro-sequence-a+19", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+20", "sage-intro-sequence-a+20", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+21", "sage-intro-sequence-a+21", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+0", "sidekick-human-intro-sequence-c+0", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+1", "sidekick-human-intro-sequence-c+1", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+2", "sidekick-human-intro-sequence-c+2", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+3", "sidekick-human-intro-sequence-c+3", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+4", "sidekick-human-intro-sequence-c+4", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+5", "sidekick-human-intro-sequence-c+5", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+6", "sidekick-human-intro-sequence-c+6", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+7", "sidekick-human-intro-sequence-c+7", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+8", "sidekick-human-intro-sequence-c+8", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+9", "sidekick-human-intro-sequence-c+9", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+10", "sidekick-human-intro-sequence-c+10", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+11", "sidekick-human-intro-sequence-c+11", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+12", "sidekick-human-intro-sequence-c+12", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+13", "sidekick-human-intro-sequence-c+13", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+14", "sidekick-human-intro-sequence-c+14", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+15", "sidekick-human-intro-sequence-c+15", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+16", "sidekick-human-intro-sequence-c+16", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+17", "sidekick-human-intro-sequence-c+17", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+18", "sidekick-human-intro-sequence-c+18", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+19", "sidekick-human-intro-sequence-c+19", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+20", "sidekick-human-intro-sequence-c+20", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+21", "sidekick-human-intro-sequence-c+21", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+0", "minershort-introduction-orbs+0", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+1", "minershort-introduction-orbs+1", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+2", "minershort-introduction-orbs+2", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+3", "minershort-introduction-orbs+3", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+4", "minershort-introduction-orbs+4", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+5", "minershort-introduction-orbs+5", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+6", "minershort-introduction-orbs+6", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+7", "minershort-introduction-orbs+7", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+8", "minershort-introduction-orbs+8", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+9", "minershort-introduction-orbs+9", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+10", "minershort-introduction-orbs+10", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+11", "minershort-introduction-orbs+11", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+12", "minershort-introduction-orbs+12", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+13", "minershort-introduction-orbs+13", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+14", "minershort-introduction-orbs+14", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+15", "minershort-introduction-orbs+15", 2, ["NO-XGO"], ""], +["warrior-introduction+0", "warrior-introduction+0", 2, ["NO-XGO"], ""], +["warrior-introduction+1", "warrior-introduction+1", 2, ["NO-XGO"], ""], +["warrior-introduction+2", "warrior-introduction+2", 2, ["NO-XGO"], ""], +["warrior-introduction+3", "warrior-introduction+3", 2, ["NO-XGO"], ""], +["warrior-introduction+4", "warrior-introduction+4", 2, ["NO-XGO"], ""], +["warrior-introduction+5", "warrior-introduction+5", 2, ["NO-XGO"], ""], +["warrior-introduction+6", "warrior-introduction+6", 2, ["NO-XGO"], ""], +["warrior-introduction+7", "warrior-introduction+7", 2, ["NO-XGO"], ""], +["warrior-introduction+8", "warrior-introduction+8", 2, ["NO-XGO"], ""], +["warrior-introduction+9", "warrior-introduction+9", 2, ["NO-XGO"], ""], +["warrior-introduction+10", "warrior-introduction+10", 2, ["NO-XGO"], ""], +["warrior-introduction+11", "warrior-introduction+11", 2, ["NO-XGO"], ""], +["warrior-introduction+12", "warrior-introduction+12", 2, ["NO-XGO"], ""], +["warrior-introduction+13", "warrior-introduction+13", 2, ["NO-XGO"], ""], +["warrior-introduction+14", "warrior-introduction+14", 2, ["NO-XGO"], ""], +["warrior-introduction+15", "warrior-introduction+15", 2, ["NO-XGO"], ""], +["warrior-introduction+16", "warrior-introduction+16", 2, ["NO-XGO"], ""], +["warrior-introduction+17", "warrior-introduction+17", 2, ["NO-XGO"], ""], +["warrior-introduction+18", "warrior-introduction+18", 2, ["NO-XGO"], ""], +["warrior-introduction+19", "warrior-introduction+19", 2, ["NO-XGO"], ""], +["warrior-introduction+20", "warrior-introduction+20", 2, ["NO-XGO"], ""], +["warrior-introduction+21", "warrior-introduction+21", 2, ["NO-XGO"], ""], +["warrior-introduction+22", "warrior-introduction+22", 2, ["NO-XGO"], ""], +["warrior-introduction+23", "warrior-introduction+23", 2, ["NO-XGO"], ""], +["warrior-introduction+24", "warrior-introduction+24", 2, ["NO-XGO"], ""], +["warrior-introduction+25", "warrior-introduction+25", 2, ["NO-XGO"], ""], +["warrior-introduction+26", "warrior-introduction+26", 2, ["NO-XGO"], ""], +["warrior-introduction+27", "warrior-introduction+27", 2, ["NO-XGO"], ""], +["warrior-introduction+28", "warrior-introduction+28", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+0", "sage-intro-sequence-d2+0", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+1", "sage-intro-sequence-d2+1", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+2", "sage-intro-sequence-d2+2", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+3", "sage-intro-sequence-d2+3", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+4", "sage-intro-sequence-d2+4", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+5", "sage-intro-sequence-d2+5", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+6", "sage-intro-sequence-d2+6", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+7", "sage-intro-sequence-d2+7", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+8", "sage-intro-sequence-d2+8", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+9", "sage-intro-sequence-d2+9", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+10", "sage-intro-sequence-d2+10", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+11", "sage-intro-sequence-d2+11", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+12", "sage-intro-sequence-d2+12", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+13", "sage-intro-sequence-d2+13", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+14", "sage-intro-sequence-d2+14", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+15", "sage-intro-sequence-d2+15", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+16", "sage-intro-sequence-d2+16", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+17", "sage-intro-sequence-d2+17", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+18", "sage-intro-sequence-d2+18", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+19", "sage-intro-sequence-d2+19", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+0", "green-sagecage-outro-preboss+0", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+1", "green-sagecage-outro-preboss+1", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+2", "green-sagecage-outro-preboss+2", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+3", "green-sagecage-outro-preboss+3", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+4", "green-sagecage-outro-preboss+4", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+5", "green-sagecage-outro-preboss+5", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+6", "green-sagecage-outro-preboss+6", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+7", "green-sagecage-outro-preboss+7", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+8", "green-sagecage-outro-preboss+8", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+9", "green-sagecage-outro-preboss+9", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+10", "green-sagecage-outro-preboss+10", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+11", "green-sagecage-outro-preboss+11", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+12", "green-sagecage-outro-preboss+12", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+13", "green-sagecage-outro-preboss+13", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+14", "green-sagecage-outro-preboss+14", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+15", "green-sagecage-outro-preboss+15", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+16", "green-sagecage-outro-preboss+16", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+17", "green-sagecage-outro-preboss+17", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+18", "green-sagecage-outro-preboss+18", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+19", "green-sagecage-outro-preboss+19", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+20", "green-sagecage-outro-preboss+20", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+21", "green-sagecage-outro-preboss+21", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+0", "green-sagecage-outro-beat-boss-b+0", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+1", "green-sagecage-outro-beat-boss-b+1", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+2", "green-sagecage-outro-beat-boss-b+2", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+3", "green-sagecage-outro-beat-boss-b+3", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+4", "green-sagecage-outro-beat-boss-b+4", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+5", "green-sagecage-outro-beat-boss-b+5", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+6", "green-sagecage-outro-beat-boss-b+6", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+7", "green-sagecage-outro-beat-boss-b+7", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+8", "green-sagecage-outro-beat-boss-b+8", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+9", "green-sagecage-outro-beat-boss-b+9", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+10", "green-sagecage-outro-beat-boss-b+10", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+11", "green-sagecage-outro-beat-boss-b+11", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+12", "green-sagecage-outro-beat-boss-b+12", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+13", "green-sagecage-outro-beat-boss-b+13", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+14", "green-sagecage-outro-beat-boss-b+14", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+15", "green-sagecage-outro-beat-boss-b+15", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+16", "green-sagecage-outro-beat-boss-b+16", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+17", "green-sagecage-outro-beat-boss-b+17", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+18", "green-sagecage-outro-beat-boss-b+18", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+19", "green-sagecage-outro-beat-boss-b+19", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+20", "green-sagecage-outro-beat-boss-b+20", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+21", "green-sagecage-outro-beat-boss-b+21", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+22", "green-sagecage-outro-beat-boss-b+22", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+23", "green-sagecage-outro-beat-boss-b+23", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+24", "green-sagecage-outro-beat-boss-b+24", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+25", "green-sagecage-outro-beat-boss-b+25", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+26", "green-sagecage-outro-beat-boss-b+26", 2, ["NO-XGO"], ""], +["sage-village3-introduction+0", "sage-village3-introduction+0", 2, ["NO-XGO"], ""], +["sage-village3-introduction+1", "sage-village3-introduction+1", 2, ["NO-XGO"], ""], +["sage-village3-introduction+2", "sage-village3-introduction+2", 2, ["NO-XGO"], ""], +["sage-village3-introduction+3", "sage-village3-introduction+3", 2, ["NO-XGO"], ""], +["sage-village3-introduction+4", "sage-village3-introduction+4", 2, ["NO-XGO"], ""], +["sage-village3-introduction+5", "sage-village3-introduction+5", 2, ["NO-XGO"], ""], +["sage-village3-introduction+6", "sage-village3-introduction+6", 2, ["NO-XGO"], ""], +["sage-village3-introduction+7", "sage-village3-introduction+7", 2, ["NO-XGO"], ""], +["sage-village3-introduction+8", "sage-village3-introduction+8", 2, ["NO-XGO"], ""], +["sage-village3-introduction+9", "sage-village3-introduction+9", 2, ["NO-XGO"], ""], +["sage-village3-introduction+10", "sage-village3-introduction+10", 2, ["NO-XGO"], ""], +["sage-village3-introduction+11", "sage-village3-introduction+11", 2, ["NO-XGO"], ""], +["sage-village3-introduction+12", "sage-village3-introduction+12", 2, ["NO-XGO"], ""], +["sage-village3-introduction+13", "sage-village3-introduction+13", 2, ["NO-XGO"], ""], +["sage-village3-introduction+14", "sage-village3-introduction+14", 2, ["NO-XGO"], ""], +["sage-village3-introduction+15", "sage-village3-introduction+15", 2, ["NO-XGO"], ""], +["sage-village3-introduction+16", "sage-village3-introduction+16", 2, ["NO-XGO"], ""], +["sage-village3-introduction+17", "sage-village3-introduction+17", 2, ["NO-XGO"], ""], +["sage-village3-introduction+18", "sage-village3-introduction+18", 2, ["NO-XGO"], ""], +["sage-village3-introduction+19", "sage-village3-introduction+19", 2, ["NO-XGO"], ""], +["sage-village3-introduction+20", "sage-village3-introduction+20", 2, ["NO-XGO"], ""], +["sage-village3-introduction+21", "sage-village3-introduction+21", 2, ["NO-XGO"], ""], +["sage-village3-introduction+22", "sage-village3-introduction+22", 2, ["NO-XGO"], ""], +["sage-village3-introduction+23", "sage-village3-introduction+23", 2, ["NO-XGO"], ""], +["sage-village3-introduction+24", "sage-village3-introduction+24", 2, ["NO-XGO"], ""], +["sage-village3-introduction+25", "sage-village3-introduction+25", 2, ["NO-XGO"], ""], +["sage-village3-introduction+26", "sage-village3-introduction+26", 2, ["NO-XGO"], ""], +["sage-village3-introduction+27", "sage-village3-introduction+27", 2, ["NO-XGO"], ""], +["sage-village3-introduction+28", "sage-village3-introduction+28", 2, ["NO-XGO"], ""], +["sage-village3-introduction+29", "sage-village3-introduction+29", 2, ["NO-XGO"], ""], +["sage-village3-introduction+30", "sage-village3-introduction+30", 2, ["NO-XGO"], ""], +["sage-village3-introduction+31", "sage-village3-introduction+31", 2, ["NO-XGO"], ""], +["sage-village3-introduction+32", "sage-village3-introduction+32", 2, ["NO-XGO"], ""], +["sage-village3-introduction+33", "sage-village3-introduction+33", 2, ["NO-XGO"], ""], +["sage-village3-introduction+34", "sage-village3-introduction+34", 2, ["NO-XGO"], ""], +["sage-village3-introduction+35", "sage-village3-introduction+35", 2, ["NO-XGO"], ""], +["sage-village3-introduction+36", "sage-village3-introduction+36", 2, ["NO-XGO"], ""], +["sage-village3-introduction+37", "sage-village3-introduction+37", 2, ["NO-XGO"], ""], +["sage-village3-introduction+38", "sage-village3-introduction+38", 2, ["NO-XGO"], ""], +["sage-village3-introduction+39", "sage-village3-introduction+39", 2, ["NO-XGO"], ""], +["sage-village3-introduction+40", "sage-village3-introduction+40", 2, ["NO-XGO"], ""], +["sage-village3-introduction+41", "sage-village3-introduction+41", 2, ["NO-XGO"], ""], +["sage-village3-introduction+42", "sage-village3-introduction+42", 2, ["NO-XGO"], ""], +["sage-village3-introduction+43", "sage-village3-introduction+43", 2, ["NO-XGO"], ""], +["sage-village3-introduction+44", "sage-village3-introduction+44", 2, ["NO-XGO"], ""], +["sage-village3-introduction+45", "sage-village3-introduction+45", 2, ["NO-XGO"], ""], +["sage-village3-introduction+46", "sage-village3-introduction+46", 2, ["NO-XGO"], ""], +["sage-village3-introduction+47", "sage-village3-introduction+47", 2, ["NO-XGO"], ""], +["sage-village3-introduction+48", "sage-village3-introduction+48", 2, ["NO-XGO"], ""], +["sage-village3-introduction+49", "sage-village3-introduction+49", 2, ["NO-XGO"], ""], +["sage-village3-introduction+50", "sage-village3-introduction+50", 2, ["NO-XGO"], ""], +["sage-village3-introduction+51", "sage-village3-introduction+51", 2, ["NO-XGO"], ""], +["sage-village3-introduction+52", "sage-village3-introduction+52", 2, ["NO-XGO"], ""], +["sage-village3-introduction+53", "sage-village3-introduction+53", 2, ["NO-XGO"], ""], +["sage-village3-introduction+54", "sage-village3-introduction+54", 2, ["NO-XGO"], ""], +["sage-village3-introduction+55", "sage-village3-introduction+55", 2, ["NO-XGO"], ""], +["sage-village3-introduction+56", "sage-village3-introduction+56", 2, ["NO-XGO"], ""], +["sage-village3-introduction+57", "sage-village3-introduction+57", 2, ["NO-XGO"], ""]] diff --git a/goal_src/build/all_objs_jak1_pal.json b/goal_src/build/all_objs_jak1_pal.json new file mode 100644 index 0000000000..2a247c1169 --- /dev/null +++ b/goal_src/build/all_objs_jak1_pal.json @@ -0,0 +1,2128 @@ +[["gcommon", "gcommon", 3, ["KERNEL"], ""], +["gstring-h", "gstring-h", 3, ["KERNEL"], ""], +["gkernel-h", "gkernel-h", 3, ["KERNEL"], ""], +["gkernel", "gkernel", 3, ["KERNEL"], ""], +["pskernel", "pskernel", 3, ["KERNEL"], ""], +["gstring", "gstring", 3, ["KERNEL"], ""], +["dgo-h", "dgo-h", 3, ["KERNEL"], ""], +["gstate", "gstate", 3, ["KERNEL"], ""], +["types-h", "types-h", 3, ["ENGINE", "GAME"], ""], +["vu1-macros", "vu1-macros", 3, ["ENGINE", "GAME"], ""], +["math", "math", 3, ["ENGINE", "GAME"], ""], +["vector-h", "vector-h", 3, ["ENGINE", "GAME"], ""], +["gravity-h", "gravity-h", 3, ["ENGINE", "GAME"], ""], +["bounding-box-h", "bounding-box-h", 3, ["ENGINE", "GAME"], ""], +["matrix-h", "matrix-h", 3, ["ENGINE", "GAME"], ""], +["quaternion-h", "quaternion-h", 3, ["ENGINE", "GAME"], ""], +["euler-h", "euler-h", 3, ["ENGINE", "GAME"], ""], +["transform-h", "transform-h", 3, ["ENGINE", "GAME"], ""], +["geometry-h", "geometry-h", 3, ["ENGINE", "GAME"], ""], +["trigonometry-h", "trigonometry-h", 3, ["ENGINE", "GAME"], ""], +["transformq-h", "transformq-h", 3, ["ENGINE", "GAME"], ""], +["bounding-box", "bounding-box", 3, ["ENGINE", "GAME"], ""], +["matrix", "matrix", 3, ["ENGINE", "GAME"], ""], +["transform", "transform", 3, ["ENGINE", "GAME"], ""], +["quaternion", "quaternion", 3, ["ENGINE", "GAME"], ""], +["euler", "euler", 3, ["ENGINE", "GAME"], ""], +["geometry", "geometry", 3, ["ENGINE", "GAME"], ""], +["trigonometry", "trigonometry", 3, ["ENGINE", "GAME"], ""], +["gsound-h", "gsound-h", 3, ["ENGINE", "GAME"], ""], +["timer-h", "timer-h", 3, ["ENGINE", "GAME"], ""], +["timer", "timer", 3, ["ENGINE", "GAME"], ""], +["vif-h", "vif-h", 3, ["ENGINE", "GAME"], ""], +["dma-h", "dma-h", 3, ["ENGINE", "GAME"], ""], +["video-h", "video-h", 3, ["ENGINE", "GAME"], ""], +["vu1-user-h", "vu1-user-h", 3, ["ENGINE", "GAME"], ""], +["dma", "dma", 3, ["ENGINE", "GAME"], ""], +["dma-buffer", "dma-buffer", 3, ["ENGINE", "GAME"], ""], +["dma-bucket", "dma-bucket", 3, ["ENGINE", "GAME"], ""], +["dma-disasm", "dma-disasm", 3, ["ENGINE", "GAME"], ""], +["pad", "pad", 3, ["ENGINE", "GAME"], ""], +["gs", "gs", 3, ["ENGINE", "GAME"], ""], +["display-h", "display-h", 3, ["ENGINE", "GAME"], ""], +["vector", "vector", 3, ["ENGINE", "GAME"], ""], +["file-io", "file-io", 3, ["ENGINE", "GAME"], ""], +["loader-h", "loader-h", 3, ["ENGINE", "GAME"], ""], +["texture-h", "texture-h", 3, ["ENGINE", "GAME"], ""], +["level-h", "level-h", 3, ["ENGINE", "GAME"], ""], +["math-camera-h", "math-camera-h", 3, ["ENGINE", "GAME"], ""], +["math-camera", "math-camera", 3, ["ENGINE", "GAME"], ""], +["font-h", "font-h", 3, ["ENGINE", "GAME"], ""], +["decomp-h", "decomp-h", 3, ["ENGINE", "GAME"], ""], +["display", "display", 3, ["ENGINE", "GAME"], ""], +["connect", "connect", 3, ["ENGINE", "GAME"], ""], +["text-h", "text-h", 3, ["ENGINE", "GAME"], ""], +["settings-h", "settings-h", 3, ["ENGINE", "GAME"], ""], +["capture", "capture", 3, ["ENGINE", "GAME"], ""], +["memory-usage-h", "memory-usage-h", 3, ["ENGINE", "GAME"], ""], +["texture", "texture", 3, ["ENGINE", "GAME"], ""], +["main-h", "main-h", 3, ["ENGINE", "GAME"], ""], +["mspace-h", "mspace-h", 3, ["ENGINE", "GAME"], ""], +["drawable-h", "drawable-h", 3, ["ENGINE", "GAME"], ""], +["drawable-group-h", "drawable-group-h", 3, ["ENGINE", "GAME"], ""], +["drawable-inline-array-h", "drawable-inline-array-h", 3, ["ENGINE", "GAME"], ""], +["draw-node-h", "draw-node-h", 3, ["ENGINE", "GAME"], ""], +["drawable-tree-h", "drawable-tree-h", 3, ["ENGINE", "GAME"], ""], +["drawable-actor-h", "drawable-actor-h", 3, ["ENGINE", "GAME"], ""], +["drawable-ambient-h", "drawable-ambient-h", 3, ["ENGINE", "GAME"], ""], +["game-task-h", "game-task-h", 3, ["ENGINE", "GAME"], ""], +["hint-control-h", "hint-control-h", 3, ["ENGINE", "GAME"], ""], +["generic-h", "generic-h", 3, ["ENGINE", "GAME"], ""], +["lights-h", "lights-h", 3, ["ENGINE", "GAME"], ""], +["ocean-h", "ocean-h", 3, ["ENGINE", "GAME"], ""], +["ocean-trans-tables", "ocean-trans-tables", 3, ["ENGINE", "GAME"], ""], +["ocean-tables", "ocean-tables", 3, ["ENGINE", "GAME"], ""], +["ocean-frames", "ocean-frames", 3, ["ENGINE", "GAME"], ""], +["sky-h", "sky-h", 3, ["ENGINE", "GAME"], ""], +["mood-h", "mood-h", 3, ["ENGINE", "GAME"], ""], +["time-of-day-h", "time-of-day-h", 3, ["ENGINE", "GAME"], ""], +["art-h", "art-h", 3, ["ENGINE", "GAME"], ""], +["generic-vu1-h", "generic-vu1-h", 3, ["ENGINE", "GAME"], ""], +["merc-h", "merc-h", 3, ["ENGINE", "GAME"], ""], +["generic-merc-h", "generic-merc-h", 3, ["ENGINE", "GAME"], ""], +["generic-tie-h", "generic-tie-h", 3, ["ENGINE", "GAME"], ""], +["generic-work-h", "generic-work-h", 3, ["ENGINE", "GAME"], ""], +["shadow-cpu-h", "shadow-cpu-h", 3, ["ENGINE", "GAME"], ""], +["shadow-vu1-h", "shadow-vu1-h", 3, ["ENGINE", "GAME"], ""], +["memcard-h", "memcard-h", 3, ["ENGINE", "GAME"], ""], +["game-info-h", "game-info-h", 3, ["ENGINE", "GAME"], ""], +["wind-h", "wind-h", 3, ["ENGINE", "GAME"], ""], +["prototype-h", "prototype-h", 3, ["ENGINE", "GAME"], ""], +["joint-h", "joint-h", 3, ["ENGINE", "GAME"], ""], +["bones-h", "bones-h", 3, ["ENGINE", "GAME"], ""], +["engines", "engines", 3, ["ENGINE", "GAME"], ""], +["res-h", "res-h", 3, ["ENGINE", "GAME"], ""], +["res", "res", 3, ["ENGINE", "GAME"], ""], +["lights", "lights", 3, ["ENGINE", "GAME"], ""], +["dynamics-h", "dynamics-h", 3, ["ENGINE", "GAME"], ""], +["surface-h", "surface-h", 3, ["ENGINE", "GAME"], ""], +["pat-h", "pat-h", 3, ["ENGINE", "GAME"], ""], +["fact-h", "fact-h", 3, ["ENGINE", "GAME"], ""], +["aligner-h", "aligner-h", 3, ["ENGINE", "GAME"], ""], +["game-h", "game-h", 3, ["ENGINE", "GAME"], ""], +["generic-obs-h", "generic-obs-h", 3, ["ENGINE", "GAME"], ""], +["pov-camera-h", "pov-camera-h", 3, ["ENGINE", "GAME"], ""], +["sync-info-h", "sync-info-h", 3, ["ENGINE", "GAME"], ""], +["smush-control-h", "smush-control-h", 3, ["ENGINE", "GAME"], ""], +["trajectory-h", "trajectory-h", 3, ["ENGINE", "GAME"], ""], +["debug-h", "debug-h", 3, ["ENGINE", "GAME"], ""], +["joint-mod-h", "joint-mod-h", 3, ["ENGINE", "GAME"], ""], +["collide-func-h", "collide-func-h", 3, ["ENGINE", "GAME"], ""], +["collide-mesh-h", "collide-mesh-h", 3, ["ENGINE", "GAME"], ""], +["collide-shape-h", "collide-shape-h", 3, ["ENGINE", "GAME"], ""], +["collide-target-h", "collide-target-h", 3, ["ENGINE", "GAME"], ""], +["collide-touch-h", "collide-touch-h", 3, ["ENGINE", "GAME"], ""], +["collide-edge-grab-h", "collide-edge-grab-h", 3, ["ENGINE", "GAME"], ""], +["process-drawable-h", "process-drawable-h", 3, ["ENGINE", "GAME"], ""], +["effect-control-h", "effect-control-h", 3, ["ENGINE", "GAME"], ""], +["collide-frag-h", "collide-frag-h", 3, ["ENGINE", "GAME"], ""], +["projectiles-h", "projectiles-h", 3, ["ENGINE", "GAME"], ""], +["target-h", "target-h", 3, ["ENGINE", "GAME"], ""], +["depth-cue-h", "depth-cue-h", 3, ["ENGINE", "GAME"], ""], +["stats-h", "stats-h", 3, ["ENGINE", "GAME"], ""], +["bsp-h", "bsp-h", 3, ["ENGINE", "GAME"], ""], +["collide-cache-h", "collide-cache-h", 3, ["ENGINE", "GAME"], ""], +["collide-h", "collide-h", 3, ["ENGINE", "GAME"], ""], +["shrubbery-h", "shrubbery-h", 3, ["ENGINE", "GAME"], ""], +["tie-h", "tie-h", 3, ["ENGINE", "GAME"], ""], +["tfrag-h", "tfrag-h", 3, ["ENGINE", "GAME"], ""], +["background-h", "background-h", 3, ["ENGINE", "GAME"], ""], +["subdivide-h", "subdivide-h", 3, ["ENGINE", "GAME"], ""], +["entity-h", "entity-h", 3, ["ENGINE", "GAME"], ""], +["sprite-h", "sprite-h", 3, ["ENGINE", "GAME"], ""], +["shadow-h", "shadow-h", 3, ["ENGINE", "GAME"], ""], +["eye-h", "eye-h", 3, ["ENGINE", "GAME"], ""], +["sparticle-launcher-h", "sparticle-launcher-h", 3, ["ENGINE", "GAME"], ""], +["sparticle-h", "sparticle-h", 3, ["ENGINE", "GAME"], ""], +["actor-link-h", "actor-link-h", 3, ["ENGINE", "GAME"], ""], +["camera-h", "camera-h", 3, ["ENGINE", "GAME"], ""], +["cam-debug-h", "cam-debug-h", 3, ["ENGINE", "GAME"], ""], +["cam-interface-h", "cam-interface-h", 3, ["ENGINE", "GAME"], ""], +["cam-update-h", "cam-update-h", 3, ["ENGINE", "GAME"], ""], +["assert-h", "assert-h", 3, ["ENGINE", "GAME"], ""], +["hud-h", "hud-h", 3, ["ENGINE", "GAME"], ""], +["progress-h", "progress-h", 3, ["ENGINE", "GAME"], ""], +["rpc-h", "rpc-h", 3, ["ENGINE", "GAME"], ""], +["path-h", "path-h", 3, ["ENGINE", "GAME"], ""], +["navigate-h", "navigate-h", 3, ["ENGINE", "GAME"], ""], +["load-dgo", "load-dgo", 3, ["ENGINE", "GAME"], ""], +["ramdisk", "ramdisk", 3, ["ENGINE", "GAME"], ""], +["gsound", "gsound", 3, ["ENGINE", "GAME"], ""], +["transformq", "transformq", 3, ["ENGINE", "GAME"], ""], +["collide-func", "collide-func", 3, ["ENGINE", "GAME"], ""], +["joint", "joint", 3, ["ENGINE", "GAME"], ""], +["cylinder", "cylinder", 3, ["ENGINE", "GAME"], ""], +["wind", "wind", 3, ["ENGINE", "GAME"], ""], +["bsp", "bsp", 3, ["ENGINE", "GAME"], ""], +["subdivide", "subdivide", 3, ["ENGINE", "GAME"], ""], +["sprite", "sprite", 3, ["ENGINE", "GAME"], ""], +["sprite-distort", "sprite-distort", 3, ["ENGINE", "GAME"], ""], +["debug-sphere", "debug-sphere", 3, ["ENGINE", "GAME"], ""], +["debug", "debug", 3, ["ENGINE", "GAME"], ""], +["merc-vu1", "merc-vu1", 3, ["ENGINE", "GAME"], ""], +["merc-blend-shape", "merc-blend-shape", 3, ["ENGINE", "GAME"], ""], +["merc", "merc", 3, ["ENGINE", "GAME"], ""], +["ripple", "ripple", 3, ["ENGINE", "GAME"], ""], +["bones", "bones", 3, ["ENGINE", "GAME"], ""], +["generic-vu0", "generic-vu0", 3, ["ENGINE", "GAME"], ""], +["generic", "generic", 3, ["ENGINE", "GAME"], ""], +["generic-vu1", "generic-vu1", 3, ["ENGINE", "GAME"], ""], +["generic-effect", "generic-effect", 3, ["ENGINE", "GAME"], ""], +["generic-merc", "generic-merc", 3, ["ENGINE", "GAME"], ""], +["generic-tie", "generic-tie", 3, ["ENGINE", "GAME"], ""], +["shadow-cpu", "shadow-cpu", 3, ["ENGINE", "GAME"], ""], +["shadow-vu1", "shadow-vu1", 3, ["ENGINE", "GAME"], ""], +["depth-cue", "depth-cue", 3, ["ENGINE", "GAME"], ""], +["font", "font", 3, ["ENGINE", "GAME"], ""], +["decomp", "decomp", 3, ["ENGINE", "GAME"], ""], +["background", "background", 3, ["ENGINE", "GAME"], ""], +["draw-node", "draw-node", 3, ["ENGINE", "GAME"], ""], +["shrubbery", "shrubbery", 3, ["ENGINE", "GAME"], ""], +["shrub-work", "shrub-work", 3, ["ENGINE", "GAME"], ""], +["tfrag-near", "tfrag-near", 3, ["ENGINE", "GAME"], ""], +["tfrag", "tfrag", 3, ["ENGINE", "GAME"], ""], +["tfrag-methods", "tfrag-methods", 3, ["ENGINE", "GAME"], ""], +["tfrag-work", "tfrag-work", 3, ["ENGINE", "GAME"], ""], +["tie", "tie", 3, ["ENGINE", "GAME"], ""], +["tie-near", "tie-near", 3, ["ENGINE", "GAME"], ""], +["tie-work", "tie-work", 3, ["ENGINE", "GAME"], ""], +["tie-methods", "tie-methods", 3, ["ENGINE", "GAME"], ""], +["sync-info", "sync-info", 3, ["ENGINE", "GAME"], ""], +["trajectory", "trajectory", 3, ["ENGINE", "GAME"], ""], +["sparticle-launcher", "sparticle-launcher", 3, ["ENGINE", "GAME"], ""], +["sparticle", "sparticle", 3, ["ENGINE", "GAME"], ""], +["entity-table", "entity-table", 3, ["ENGINE", "GAME"], ""], +["loader", "loader", 3, ["ENGINE", "GAME"], ""], +["task-control-h", "task-control-h", 3, ["ENGINE", "GAME"], ""], +["game-info", "game-info", 3, ["ENGINE", "GAME"], ""], +["game-save", "game-save", 3, ["ENGINE", "GAME"], ""], +["settings", "settings", 3, ["ENGINE", "GAME"], ""], +["mood-tables", "mood-tables", 3, ["ENGINE", "GAME"], ""], +["mood", "mood", 3, ["ENGINE", "GAME"], ""], +["weather-part", "weather-part", 3, ["ENGINE", "GAME"], ""], +["time-of-day", "time-of-day", 3, ["ENGINE", "GAME"], ""], +["sky-utils", "sky-utils", 3, ["ENGINE", "GAME"], ""], +["sky", "sky", 3, ["ENGINE", "GAME"], ""], +["sky-tng", "sky-tng", 3, ["ENGINE", "GAME"], ""], +["load-boundary-h", "load-boundary-h", 3, ["ENGINE", "GAME"], ""], +["load-boundary", "load-boundary", 3, ["ENGINE", "GAME"], ""], +["load-boundary-data", "load-boundary-data", 3, ["ENGINE", "GAME"], ""], +["level-info", "level-info", 3, ["ENGINE", "GAME"], ""], +["level", "level", 3, ["ENGINE", "GAME"], ""], +["text", "text", 3, ["ENGINE", "GAME"], ""], +["collide-probe", "collide-probe", 3, ["ENGINE", "GAME"], ""], +["collide-frag", "collide-frag", 3, ["ENGINE", "GAME"], ""], +["collide-mesh", "collide-mesh", 3, ["ENGINE", "GAME"], ""], +["collide-touch", "collide-touch", 3, ["ENGINE", "GAME"], ""], +["collide-edge-grab", "collide-edge-grab", 3, ["ENGINE", "GAME"], ""], +["collide-shape", "collide-shape", 3, ["ENGINE", "GAME"], ""], +["collide-shape-rider", "collide-shape-rider", 3, ["ENGINE", "GAME"], ""], +["collide", "collide", 3, ["ENGINE", "GAME"], ""], +["collide-planes", "collide-planes", 3, ["ENGINE", "GAME"], ""], +["merc-death", "merc-death", 3, ["ENGINE", "GAME"], ""], +["water-h", "water-h", 3, ["ENGINE", "GAME"], ""], +["camera", "camera", 3, ["ENGINE", "GAME"], ""], +["cam-interface", "cam-interface", 3, ["ENGINE", "GAME"], ""], +["cam-master", "cam-master", 3, ["ENGINE", "GAME"], ""], +["cam-states", "cam-states", 3, ["ENGINE", "GAME"], ""], +["cam-states-dbg", "cam-states-dbg", 3, ["ENGINE", "GAME"], ""], +["cam-combiner", "cam-combiner", 3, ["ENGINE", "GAME"], ""], +["cam-update", "cam-update", 3, ["ENGINE", "GAME"], ""], +["vol-h", "vol-h", 3, ["ENGINE", "GAME"], ""], +["cam-layout", "cam-layout", 3, ["ENGINE", "GAME"], ""], +["cam-debug", "cam-debug", 3, ["ENGINE", "GAME"], ""], +["cam-start", "cam-start", 3, ["ENGINE", "GAME"], ""], +["process-drawable", "process-drawable", 3, ["ENGINE", "GAME"], ""], +["hint-control", "hint-control", 3, ["ENGINE", "GAME"], ""], +["ambient", "ambient", 3, ["ENGINE", "GAME"], ""], +["assert", "assert", 3, ["ENGINE", "GAME"], ""], +["generic-obs", "generic-obs", 3, ["ENGINE", "GAME"], ""], +["target-util", "target-util", 3, ["ENGINE", "GAME"], ""], +["target-part", "target-part", 3, ["ENGINE", "GAME"], ""], +["collide-reaction-target", "collide-reaction-target", 3, ["ENGINE", "GAME"], ""], +["logic-target", "logic-target", 3, ["ENGINE", "GAME"], ""], +["sidekick", "sidekick", 3, ["ENGINE", "GAME"], ""], +["voicebox", "voicebox", 3, ["ENGINE", "GAME"], ""], +["target-handler", "target-handler", 3, ["ENGINE", "GAME"], ""], +["target", "target", 3, ["ENGINE", "GAME"], ""], +["target2", "target2", 3, ["ENGINE", "GAME"], ""], +["target-death", "target-death", 3, ["ENGINE", "GAME"], ""], +["menu", "menu", 3, ["ENGINE", "GAME"], ""], +["drawable", "drawable", 3, ["ENGINE", "GAME"], ""], +["drawable-group", "drawable-group", 3, ["ENGINE", "GAME"], ""], +["drawable-inline-array", "drawable-inline-array", 3, ["ENGINE", "GAME"], ""], +["drawable-tree", "drawable-tree", 3, ["ENGINE", "GAME"], ""], +["prototype", "prototype", 3, ["ENGINE", "GAME"], ""], +["main-collide", "main-collide", 3, ["ENGINE", "GAME"], ""], +["video", "video", 3, ["ENGINE", "GAME"], ""], +["main", "main", 3, ["ENGINE", "GAME"], ""], +["collide-cache", "collide-cache", 3, ["ENGINE", "GAME"], ""], +["relocate", "relocate", 3, ["ENGINE", "GAME"], ""], +["memory-usage", "memory-usage", 3, ["ENGINE", "GAME"], ""], +["entity", "entity", 3, ["ENGINE", "GAME"], ""], +["path", "path", 3, ["ENGINE", "GAME"], ""], +["vol", "vol", 3, ["ENGINE", "GAME"], ""], +["navigate", "navigate", 3, ["ENGINE", "GAME"], ""], +["aligner", "aligner", 3, ["ENGINE", "GAME"], ""], +["effect-control", "effect-control", 3, ["ENGINE", "GAME"], ""], +["water", "water", 3, ["ENGINE", "GAME"], ""], +["collectables-part", "collectables-part", 3, ["ENGINE", "GAME"], ""], +["collectables", "collectables", 3, ["ENGINE", "GAME"], ""], +["task-control", "task-control", 3, ["ENGINE", "GAME"], ""], +["process-taskable", "process-taskable", 3, ["ENGINE", "GAME"], ""], +["pov-camera", "pov-camera", 3, ["ENGINE", "GAME"], ""], +["powerups", "powerups", 3, ["ENGINE", "GAME"], ""], +["crates", "crates", 3, ["ENGINE", "GAME"], ""], +["hud", "hud", 3, ["ENGINE", "GAME"], ""], +["hud-classes", "hud-classes", 3, ["ENGINE", "GAME"], ""], +["progress-static", "progress-static", 3, ["ENGINE", "GAME"], ""], +["progress-part", "progress-part", 3, ["ENGINE", "GAME"], ""], +["progress-draw", "progress-draw", 3, ["ENGINE", "GAME"], ""], +["progress", "progress", 3, ["ENGINE", "GAME"], ""], +["credits", "credits", 3, ["ENGINE", "GAME"], ""], +["projectiles", "projectiles", 3, ["ENGINE", "GAME"], ""], +["ocean", "ocean", 3, ["ENGINE", "GAME"], ""], +["ocean-vu0", "ocean-vu0", 3, ["ENGINE", "GAME"], ""], +["ocean-texture", "ocean-texture", 3, ["ENGINE", "GAME"], ""], +["ocean-mid", "ocean-mid", 3, ["ENGINE", "GAME"], ""], +["ocean-transition", "ocean-transition", 3, ["ENGINE", "GAME"], ""], +["ocean-near", "ocean-near", 3, ["ENGINE", "GAME"], ""], +["shadow", "shadow", 3, ["ENGINE", "GAME"], ""], +["eye", "eye", 3, ["ENGINE", "GAME"], ""], +["glist-h", "glist-h", 3, ["ENGINE", "GAME"], ""], +["glist", "glist", 3, ["ENGINE", "GAME"], ""], +["anim-tester", "anim-tester", 3, ["ENGINE", "GAME"], ""], +["viewer", "viewer", 3, ["ENGINE", "GAME"], ""], +["part-tester", "part-tester", 3, ["ENGINE", "GAME"], ""], +["default-menu", "default-menu", 3, ["GAME"], ""], +["dir-tpages", "dir-tpages", 4, ["GAME", "ART"], ""], +["tpage-463", "tpage-463", 4, ["GAME", "ART"], ""], +["tpage-2", "tpage-2", 4, ["GAME", "ART"], ""], +["tpage-880", "tpage-880", 4, ["GAME", "ART"], ""], +["tpage-256", "tpage-256", 4, ["GAME", "ART"], ""], +["tpage-1278", "tpage-1278", 4, ["GAME", "ART"], ""], +["texture-upload", "texture-upload", 3, ["GAME", "ART"], ""], +["tpage-1032", "tpage-1032", 4, ["GAME", "ART"], ""], +["tpage-62", "tpage-62", 4, ["GAME", "ART"], ""], +["tpage-1532", "tpage-1532", 4, ["GAME", "ART"], ""], +["fuel-cell-ag", "fuel-cell", 4, ["GAME", "ART"], ""], +["money-ag", "money", 4, ["GAME", "ART"], ""], +["buzzer-ag", "buzzer", 4, ["GAME", "ART"], ""], +["ecovalve-ag", "ecovalve", 4, ["GAME", "ART"], ""], +["ecovalve-ag", "ecovalve", 4, ["BEA"], ""], +["ecovalve-ag", "ecovalve", 4, ["CIT"], ""], +["ecovalve-ag", "ecovalve", 4, ["FIN"], ""], +["ecovalve-ag", "ecovalve", 4, ["JUB", "JUN"], ""], +["ecovalve-ag", "ecovalve", 4, ["FIC", "OGR"], ""], +["ecovalve-ag", "ecovalve", 4, ["LAV"], ""], +["ecovalve-ag", "ecovalve", 4, ["MAI"], ""], +["ecovalve-ag", "ecovalve", 4, ["ROB"], ""], +["ecovalve-ag", "ecovalve", 4, ["ROL"], ""], +["ecovalve-ag", "ecovalve", 4, ["SNO"], ""], +["ecovalve-ag", "ecovalve", 4, ["SUB"], ""], +["ecovalve-ag", "ecovalve", 4, ["SWA"], ""], +["ecovalve-ag", "ecovalve", 4, ["TRA"], ""], +["crate-ag", "crate", 4, ["GAME", "ART"], ""], +["speaker-ag", "speaker", 4, ["GAME", "ART"], ""], +["fuelcell-naked-ag", "fuelcell-naked", 4, ["GAME", "ART"], ""], +["eichar-ag", "eichar", 4, ["GAME", "ART"], ""], +["sidekick-ag", "sidekick", 4, ["GAME", "ART"], ""], +["deathcam-ag", "deathcam", 4, ["GAME", "ART"], ""], +["game-cnt", "game-cnt", 4, ["GAME", "ART"], ""], +["rigid-body-h", "rigid-body-h", 3, ["GAME", "COMMON", "L1"], ""], +["water-anim", "water-anim", 3, ["GAME", "COMMON", "L1", "WATER-AN"], ""], +["dark-eco-pool", "dark-eco-pool", 3, ["GAME", "COMMON", "L1"], ""], +["rigid-body", "rigid-body", 3, ["GAME", "COMMON", "L1"], ""], +["nav-enemy-h", "nav-enemy-h", 3, ["GAME", "COMMON", "L1"], ""], +["nav-enemy", "nav-enemy", 3, ["GAME", "COMMON", "L1"], ""], +["baseplat", "baseplat", 3, ["GAME", "COMMON", "L1"], ""], +["basebutton", "basebutton", 3, ["GAME", "COMMON", "L1"], ""], +["tippy", "tippy", 3, ["GAME", "COMMON", "L1"], ""], +["joint-exploder", "joint-exploder", 3, ["GAME", "COMMON", "L1"], ""], +["babak", "babak", 3, ["GAME", "COMMON", "L1"], ""], +["sharkey", "sharkey", 3, ["GAME", "COMMON", "L1"], ""], +["orb-cache", "orb-cache", 3, ["GAME", "COMMON", "L1"], ""], +["plat", "plat", 3, ["GAME", "COMMON", "L1"], ""], +["plat-button", "plat-button", 3, ["GAME", "COMMON", "L1"], ""], +["plat-eco", "plat-eco", 3, ["GAME", "COMMON", "L1"], ""], +["ropebridge", "ropebridge", 3, ["GAME", "COMMON", "L1"], ""], +["mistycannon", "mistycannon", 3, ["BEA", "L1", "MIS"], ""], +["babak-with-cannon", "babak-with-cannon", 3, ["BEA", "L1", "MIS"], ""], +["air-h", "air-h", 3, ["BEA", "L1"], ""], +["air", "air", 3, ["BEA", "L1"], ""], +["wobbler", "wobbler", 3, ["BEA", "L1"], ""], +["twister", "twister", 3, ["BEA", "L1"], ""], +["beach-obs", "beach-obs", 3, ["BEA", "L1"], ""], +["bird-lady", "bird-lady", 3, ["BEA", "L1"], ""], +["bird-lady-beach", "bird-lady-beach", 3, ["BEA", "L1"], ""], +["mayor", "mayor", 3, ["BEA", "L1"], ""], +["sculptor", "sculptor", 3, ["BEA", "L1"], ""], +["pelican", "pelican", 3, ["BEA", "L1"], ""], +["lurkerworm", "lurkerworm", 3, ["BEA", "L1"], ""], +["lurkercrab", "lurkercrab", 3, ["BEA", "L1"], ""], +["lurkerpuppy", "lurkerpuppy", 3, ["BEA", "L1"], ""], +["beach-rocks", "beach-rocks", 3, ["BEA", "L1"], ""], +["seagull", "seagull", 3, ["BEA", "L1"], ""], +["beach-part", "beach-part", 3, ["BEA", "L1"], ""], +["tpage-212", "tpage-212", 4, ["BEA"], ""], +["tpage-214", "tpage-214", 4, ["BEA"], ""], +["tpage-213", "tpage-213", 4, ["BEA"], ""], +["tpage-215", "tpage-215", 4, ["BEA"], ""], +["babak-ag", "babak", 4, ["BEA", "CIT", "JUN", "FIC", "MIS", "ROB", "ROL", "SNO", "SUB", "SUN", "SWA"], ""], +["barrel-ag", "barrel", 4, ["BEA"], ""], +["barrel-ag", "barrel", 4, ["VI2"], ""], +["beachcam-ag", "beachcam", 4, ["BEA"], ""], +["bird-lady-ag", "bird-lady", 4, ["BEA"], ""], +["bird-lady-beach-ag", "bird-lady-beach", 4, ["BEA"], ""], +["bladeassm-ag", "bladeassm", 4, ["BEA"], ""], +["ecoventrock-ag", "ecoventrock", 4, ["BEA"], ""], +["flutflut-ag", "flutflut", 4, ["BEA"], ""], +["flutflutegg-ag", "flutflutegg", 4, ["BEA"], ""], +["grottopole-ag", "grottopole", 4, ["BEA"], ""], +["harvester-ag", "harvester", 4, ["BEA"], ""], +["kickrock-ag", "kickrock", 4, ["BEA"], ""], +["lrocklrg-ag", "lrocklrg", 4, ["BEA"], ""], +["lurkercrab-ag", "lurkercrab", 4, ["BEA"], ""], +["lurkerpuppy-ag", "lurkerpuppy", 4, ["BEA"], ""], +["lurkerworm-ag", "lurkerworm", 4, ["BEA"], ""], +["mayor-ag", "mayor", 4, ["BEA"], ""], +["mistycannon-ag", "mistycannon", 4, ["BEA", "MIS"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["BEA"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["CIT"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["JUN"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["MIS"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["SNO"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["SUN"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["VI1"], ""], +["orb-cache-top-ag", "orb-cache-top", 4, ["VI2"], ""], +["pelican-ag", "pelican", 4, ["BEA"], ""], +["sack-ag", "sack", 4, ["BEA"], ""], +["sack-ag", "sack", 4, ["MIS"], ""], +["sculptor-ag", "sculptor", 4, ["BEA"], ""], +["sculptor-muse-ag", "sculptor-muse", 4, ["BEA"], ""], +["seagull-ag", "seagull", 4, ["BEA"], ""], +["sharkey-ag", "sharkey", 4, ["BEA", "TRA", "VI2"], ""], +["sharkey-ag", "sharkey", 4, ["JUN", "MIS"], ""], +["sharkey-ag", "sharkey", 4, ["SWA"], ""], +["sharkey-ag", "sharkey", 4, ["VI1"], ""], +["windmill-one-ag", "windmill-one", 4, ["BEA"], ""], +["beach-vis", "beach-vis", 4, ["BEA"], ""], +["villagep-obs", "villagep-obs", 3, ["CIT", "L1", "VI1", "VI2", "VI3", "VILLAGEP"], ""], +["oracle", "oracle", 3, ["CIT", "L1", "VI1", "VI2", "VI3", "VILLAGEP"], ""], +["battlecontroller", "battlecontroller", 3, ["CIT", "L1", "MIS", "SWA"], ""], +["citadel-part", "citadel-part", 3, ["CIT", "L1"], ""], +["citadel-obs", "citadel-obs", 3, ["CIT", "L1"], ""], +["citb-plat", "citb-plat", 3, ["CIT", "L1"], ""], +["citadel-sages", "citadel-sages", 3, ["CIT", "L1"], ""], +["snow-bunny", "snow-bunny", 3, ["CIT", "L1", "SNO"], ""], +["citb-bunny", "citb-bunny", 3, ["CIT", "L1"], ""], +["citb-drop-plat", "citb-drop-plat", 3, ["CIT", "L1"], ""], +["assistant-citadel", "assistant-citadel", 3, ["CIT", "L1"], ""], +["tpage-1415", "tpage-1415", 4, ["CIT"], ""], +["tpage-1417", "tpage-1417", 4, ["CIT"], ""], +["tpage-1416", "tpage-1416", 4, ["CIT"], ""], +["tpage-1414", "tpage-1414", 4, ["CIT"], ""], +["assistant-lavatube-end-ag", "assistant-lavatube-end", 4, ["CIT"], ""], +["bluesage-ag", "bluesage", 4, ["CIT"], ""], +["citadelcam-ag", "citadelcam", 4, ["CIT"], ""], +["citb-arm-ag", "citb-arm", 4, ["CIT"], ""], +["citb-arm-shoulder-ag", "citb-arm-shoulder", 4, ["CIT"], ""], +["citb-bunny-ag", "citb-bunny", 4, ["CIT"], ""], +["citb-button-ag", "citb-button", 4, ["CIT"], ""], +["citb-chain-plat-ag", "citb-chain-plat", 4, ["CIT"], ""], +["citb-chains-ag", "citb-chains", 4, ["CIT"], ""], +["citb-coil-ag", "citb-coil", 4, ["CIT"], ""], +["citb-disc-ag", "citb-disc", 4, ["CIT"], ""], +["citb-donut-ag", "citb-donut", 4, ["CIT"], ""], +["citb-drop-plat-ag", "citb-drop-plat", 4, ["CIT"], ""], +["citb-exit-plat-ag", "citb-exit-plat", 4, ["CIT"], ""], +["citb-firehose-ag", "citb-firehose", 4, ["CIT"], ""], +["citb-generator-ag", "citb-generator", 4, ["CIT"], ""], +["citb-hose-ag", "citb-hose", 4, ["CIT"], ""], +["citb-iris-door-ag", "citb-iris-door", 4, ["CIT"], ""], +["citb-launcher-ag", "citb-launcher", 4, ["CIT"], ""], +["citb-robotboss-ag", "citb-robotboss", 4, ["CIT"], ""], +["citb-rotatebox-ag", "citb-rotatebox", 4, ["CIT"], ""], +["citb-sagecage-ag", "citb-sagecage", 4, ["CIT"], ""], +["citb-stopbox-ag", "citb-stopbox", 4, ["CIT"], ""], +["evilbro-citadel-ag", "evilbro-citadel", 4, ["CIT"], ""], +["evilsis-citadel-ag", "evilsis-citadel", 4, ["CIT"], ""], +["green-sagecage-ag", "green-sagecage", 4, ["CIT", "FIN"], ""], +["plat-citb-ag", "plat-citb", 4, ["CIT"], ""], +["plat-eco-citb-ag", "plat-eco-citb", 4, ["CIT"], ""], +["redsage-ag", "redsage", 4, ["CIT"], ""], +["warp-gate-switch-ag", "warp-gate-switch", 4, ["CIT"], ""], +["warp-gate-switch-ag", "warp-gate-switch", 4, ["TRA"], ""], +["warp-gate-switch-ag", "warp-gate-switch", 4, ["VI1", "VI3"], ""], +["warp-gate-switch-ag", "warp-gate-switch", 4, ["VI2"], ""], +["warpgate-ag", "warpgate", 4, ["CIT", "TRA", "VI1", "VI2", "VI3"], ""], +["yellowsage-ag", "yellowsage", 4, ["CIT"], ""], +["citadel-vis", "citadel-vis", 4, ["CIT"], ""], +["ticky", "ticky", 3, ["COMMON", "L1"], ""], +["darkcave-obs", "darkcave-obs", 3, ["DAR", "L1"], ""], +["tpage-1306", "tpage-1306", 4, ["DAR"], ""], +["tpage-1307", "tpage-1307", 4, ["DAR"], ""], +["tpage-1305", "tpage-1305", 4, ["DAR"], ""], +["tpage-1304", "tpage-1304", 4, ["DAR"], ""], +["tpage-1352", "tpage-1352", 4, ["DAR"], ""], +["baby-spider-ag", "baby-spider", 4, ["DAR"], ""], +["baby-spider-ag", "baby-spider", 4, ["MAI"], ""], +["baby-spider-ag", "baby-spider", 4, ["ROB"], ""], +["cavecrystal-ag", "cavecrystal", 4, ["DAR"], ""], +["caveelevator-ag", "caveelevator", 4, ["DAR", "ROB"], ""], +["cavespatula-darkcave-ag", "cavespatula-darkcave", 4, ["DAR"], ""], +["cavetrapdoor-ag", "cavetrapdoor", 4, ["DAR"], ""], +["cavetrapdoor-ag", "cavetrapdoor", 4, ["MAI"], ""], +["cavetrapdoor-ag", "cavetrapdoor", 4, ["ROB"], ""], +["dark-crystal-ag", "dark-crystal", 4, ["DAR", "MAI"], ""], +["mother-spider-ag", "mother-spider", 4, ["DAR", "MAI"], ""], +["spider-egg-ag", "spider-egg", 4, ["DAR", "MAI"], ""], +["spider-egg-ag", "spider-egg", 4, ["ROB"], ""], +["water-anim-darkcave-ag", "water-anim-darkcave", 4, ["DAR"], ""], +["darkcave-vis", "darkcave-vis", 4, ["DAR"], ""], +["demo-obs", "demo-obs", 3, ["DEM", "L1"], ""], +["tpage-1485", "tpage-1485", 4, ["DEM", "L1"], ""], +["tpage-1486", "tpage-1486", 4, ["DEM", "L1"], ""], +["tpage-1487", "tpage-1487", 4, ["DEM", "L1"], ""], +["tpage-1599", "tpage-1599", 4, ["DEM", "L1"], ""], +["tpage-1600", "tpage-1600", 4, ["DEM", "L1"], ""], +["tpage-1601", "tpage-1601", 4, ["DEM", "L1"], ""], +["tpage-1602", "tpage-1602", 4, ["DEM", "L1"], ""], +["tpage-1603", "tpage-1603", 4, ["DEM", "L1"], ""], +["tpage-1604", "tpage-1604", 4, ["DEM", "L1"], ""], +["tpage-1605", "tpage-1605", 4, ["DEM", "L1"], ""], +["tpage-1606", "tpage-1606", 4, ["DEM", "L1"], ""], +["tpage-1607", "tpage-1607", 4, ["DEM", "L1"], ""], +["static-screen", "static-screen", 3, ["DEM", "L1", "TIT"], ""], +["tpage-1480", "tpage-1480", 4, ["DEM"], ""], +["tpage-1479", "tpage-1479", 4, ["DEM"], ""], +["demo-vis", "demo-vis", 4, ["DEM"], ""], +["robotboss-h", "robotboss-h", 3, ["FIN", "L1"], ""], +["robotboss-part", "robotboss-part", 3, ["FIN", "L1"], ""], +["sage-finalboss-part", "sage-finalboss-part", 3, ["FIN", "L1"], ""], +["light-eco", "light-eco", 3, ["FIN", "L1"], ""], +["robotboss-weapon", "robotboss-weapon", 3, ["FIN", "L1"], ""], +["robotboss-misc", "robotboss-misc", 3, ["FIN", "L1"], ""], +["green-eco-lurker", "green-eco-lurker", 3, ["FIN", "L1"], ""], +["robotboss", "robotboss", 3, ["FIN", "L1"], ""], +["final-door", "final-door", 3, ["FIN", "L1"], ""], +["sage-finalboss", "sage-finalboss", 3, ["FIN", "L1"], ""], +["tpage-1419", "tpage-1419", 4, ["FIN"], ""], +["tpage-1420", "tpage-1420", 4, ["FIN"], ""], +["tpage-634", "tpage-634", 4, ["FIN"], ""], +["tpage-1418", "tpage-1418", 4, ["FIN"], ""], +["tpage-545", "tpage-545", 4, ["FIN"], ""], +["darkecobomb-ag", "darkecobomb", 4, ["FIN"], ""], +["ecoclaw-ag", "ecoclaw", 4, ["FIN"], ""], +["finalbosscam-ag", "finalbosscam", 4, ["FIN"], ""], +["green-eco-lurker-ag", "green-eco-lurker", 4, ["FIN"], ""], +["greenshot-ag", "greenshot", 4, ["FIN"], ""], +["jak-white-ag", "jak-white", 4, ["FIN"], ""], +["light-eco-ag", "light-eco", 4, ["FIN"], ""], +["plat-eco-finalboss-ag", "plat-eco-finalboss", 4, ["FIN"], ""], +["power-left-ag", "power-left", 4, ["FIN"], ""], +["power-right-ag", "power-right", 4, ["FIN"], ""], +["powercellalt-ag", "powercellalt", 4, ["FIN"], ""], +["redring-ag", "redring", 4, ["FIN"], ""], +["robotboss-ag", "robotboss", 4, ["FIN"], ""], +["robotboss-blueeco-ag", "robotboss-blueeco", 4, ["FIN"], ""], +["robotboss-cinematic-ag", "robotboss-cinematic", 4, ["FIN"], ""], +["robotboss-redeco-ag", "robotboss-redeco", 4, ["FIN"], ""], +["robotboss-yelloweco-ag", "robotboss-yelloweco", 4, ["FIN"], ""], +["silodoor-ag", "silodoor", 4, ["FIN"], ""], +["water-anim-finalboss-ag", "water-anim-finalboss", 4, ["FIN"], ""], +["finalboss-vis", "finalboss-vis", 4, ["FIN"], ""], +["evilbro", "evilbro", 3, ["INT", "L1"], ""], +["tpage-1455", "tpage-1455", 4, ["INT"], ""], +["tpage-1457", "tpage-1457", 4, ["INT"], ""], +["tpage-1456", "tpage-1456", 4, ["INT"], ""], +["tpage-1454", "tpage-1454", 4, ["INT"], ""], +["evilbro-ag", "evilbro", 4, ["INT"], ""], +["evilsis-ag", "evilsis", 4, ["INT"], ""], +["intro-vis", "intro-vis", 4, ["INT"], ""], +["jungleb-obs", "jungleb-obs", 3, ["JUB", "L1"], ""], +["plat-flip", "plat-flip", 3, ["JUB", "L1"], ""], +["plant-boss-main+0-ag", "plant-boss-main+0", 4, ["JUB", "L1"], ""], +["aphid", "aphid", 3, ["JUB", "L1"], ""], +["plant-boss", "plant-boss", 3, ["JUB", "L1"], ""], +["tpage-485", "tpage-485", 4, ["JUB"], ""], +["tpage-510", "tpage-510", 4, ["JUB"], ""], +["tpage-507", "tpage-507", 4, ["JUB"], ""], +["tpage-966", "tpage-966", 4, ["JUB"], ""], +["aphid-lurker-ag", "aphid-lurker", 4, ["JUB"], ""], +["darkvine-ag", "darkvine", 4, ["JUB"], ""], +["darkvine-ag", "darkvine", 4, ["JUN"], ""], +["eggtop-ag", "eggtop", 4, ["JUB"], ""], +["jng-iris-door-ag", "jng-iris-door", 4, ["JUB"], ""], +["jng-iris-door-ag", "jng-iris-door", 4, ["TRA"], ""], +["plant-boss-ag", "plant-boss", 4, ["JUB"], ""], +["plat-flip-ag", "plat-flip", 4, ["JUB"], ""], +["plat-jungleb-ag", "plat-jungleb", 4, ["JUB"], ""], +["jungleb-vis", "jungleb-vis", 4, ["JUB"], ""], +["eichar-fish+0-ag", "eichar-fish+0", 4, ["JUN"], ""], +["eichar-fish+0-ag", "eichar-fish+0", 4, ["JUNGLE"], ""], +["eichar-fish+0-ag", "eichar-fish+0", 4, ["L1"], ""], +["jungle-elevator", "jungle-elevator", 3, ["JUN", "JUNGLE", "L1"], ""], +["bouncer", "bouncer", 3, ["JUN", "JUNGLE", "L1"], ""], +["hopper", "hopper", 3, ["JUN", "JUNGLE", "L1"], ""], +["junglesnake", "junglesnake", 3, ["JUN", "JUNGLE", "L1"], ""], +["darkvine", "darkvine", 3, ["JUN", "JUNGLE", "L1"], ""], +["jungle-obs", "jungle-obs", 3, ["JUN", "JUNGLE", "L1"], ""], +["jungle-mirrors", "jungle-mirrors", 3, ["JUN", "JUNGLE", "L1"], ""], +["junglefish", "junglefish", 3, ["JUN", "JUNGLE", "L1"], ""], +["fisher", "fisher", 3, ["JUN", "JUNGLE", "L1"], ""], +["jungle-part", "jungle-part", 3, ["JUN", "JUNGLE", "L1"], ""], +["launcherdoor", "launcherdoor", 3, ["JUN", "JUNGLE", "L1", "MAI", "MAINCAVE", "SUN", "SUNKEN"], ""], +["tpage-385", "tpage-385", 4, ["JUN"], ""], +["tpage-531", "tpage-531", 4, ["JUN"], ""], +["tpage-386", "tpage-386", 4, ["JUN"], ""], +["tpage-388", "tpage-388", 4, ["JUN"], ""], +["tpage-765", "tpage-765", 4, ["JUN"], ""], +["accordian-ag", "accordian", 4, ["JUN"], ""], +["bounceytarp-ag", "bounceytarp", 4, ["JUN"], ""], +["catch-fisha-ag", "catch-fisha", 4, ["JUN"], ""], +["catch-fishb-ag", "catch-fishb", 4, ["JUN"], ""], +["catch-fishc-ag", "catch-fishc", 4, ["JUN"], ""], +["fish-net-ag", "fish-net", 4, ["JUN"], ""], +["fisher-ag", "fisher", 4, ["JUN"], ""], +["hopper-ag", "hopper", 4, ["JUN"], ""], +["junglecam-ag", "junglecam", 4, ["JUN"], ""], +["junglefish-ag", "junglefish", 4, ["JUN"], ""], +["junglesnake-ag", "junglesnake", 4, ["JUN"], ""], +["launcherdoor-ag", "launcherdoor", 4, ["JUN"], ""], +["launcherdoor-ag", "launcherdoor", 4, ["SUN"], ""], +["logtrap-ag", "logtrap", 4, ["JUN"], ""], +["lurkerm-piston-ag", "lurkerm-piston", 4, ["JUN"], ""], +["lurkerm-tall-sail-ag", "lurkerm-tall-sail", 4, ["JUN"], ""], +["maindoor-ag", "maindoor", 4, ["JUN"], ""], +["medres-firecanyon-ag", "medres-firecanyon", 4, ["JUN"], ""], +["periscope-ag", "periscope", 4, ["JUN"], ""], +["plat-button-ag", "plat-button", 4, ["JUN"], ""], +["plat-eco-ag", "plat-eco", 4, ["JUN"], ""], +["plat-eco-ag", "plat-eco", 4, ["MIS"], ""], +["plat-eco-ag", "plat-eco", 4, ["ROB"], ""], +["plat-eco-ag", "plat-eco", 4, ["TRA"], ""], +["precurbridge-ag", "precurbridge", 4, ["JUN"], ""], +["reflector-mirror-ag", "reflector-mirror", 4, ["JUN"], ""], +["ropebridge-52-ag", "ropebridge-52", 4, ["JUN"], ""], +["ropebridge-70-ag", "ropebridge-70", 4, ["JUN"], ""], +["sidedoor-ag", "sidedoor", 4, ["JUN"], ""], +["towertop-ag", "towertop", 4, ["JUN"], ""], +["water-anim-jungle-ag", "water-anim-jungle", 4, ["JUN"], ""], +["jungle-vis", "jungle-vis", 4, ["JUN"], ""], +["target-racer-h", "target-racer-h", 3, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["racer-part", "racer-part", 3, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["racer", "racer", 3, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["target-racer", "target-racer", 3, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["racer-states", "racer-states", 3, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["collide-reaction-racer", "collide-reaction-racer", 3, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["eichar-racer+0-ag", "eichar-racer+0", 4, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["tpage-1119", "tpage-1119", 4, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL"], ""], +["blocking-plane", "blocking-plane", 3, ["L1", "FIC", "LAV", "MIS", "OGR", "RACERP", "ROL", "SNO", "SWA"], ""], +["flut-part", "flut-part", 3, ["L1", "SNO", "SWA"], ""], +["flutflut", "flutflut", 3, ["L1", "SNO", "SWA"], ""], +["target-flut", "target-flut", 3, ["L1", "SNO", "SWA"], ""], +["eichar-flut+0-ag", "eichar-flut+0", 4, ["L1", "SNO", "SWA"], ""], +["farmer", "farmer", 3, ["L1", "VI1"], ""], +["explorer", "explorer", 3, ["L1", "VI1"], ""], +["assistant", "assistant", 3, ["L1", "VI1"], ""], +["sage", "sage", 3, ["L1", "VI1"], ""], +["yakow", "yakow", 3, ["L1", "VI1"], ""], +["village-obs", "village-obs", 3, ["L1", "VI1"], ""], +["fishermans-boat", "fishermans-boat", 3, ["L1", "VI1"], ""], +["village1-part", "village1-part", 3, ["L1", "VI1"], ""], +["village1-part2", "village1-part2", 3, ["L1", "VI1"], ""], +["sequence-a-village1", "sequence-a-village1", 3, ["L1", "VI1"], ""], +["training-obs", "training-obs", 3, ["L1", "TRA"], ""], +["training-part", "training-part", 3, ["L1", "TRA"], ""], +["misty-obs", "misty-obs", 3, ["L1", "MIS"], ""], +["misty-warehouse", "misty-warehouse", 3, ["L1", "MIS"], ""], +["misty-conveyor", "misty-conveyor", 3, ["L1", "MIS"], ""], +["mud", "mud", 3, ["L1", "MIS"], ""], +["muse", "muse", 3, ["L1", "MIS"], ""], +["bonelurker", "bonelurker", 3, ["L1", "MIS"], ""], +["quicksandlurker", "quicksandlurker", 3, ["L1", "MIS"], ""], +["misty-teetertotter", "misty-teetertotter", 3, ["L1", "MIS"], ""], +["balloonlurker", "balloonlurker", 3, ["L1", "MIS"], ""], +["misty-part", "misty-part", 3, ["L1", "MIS"], ""], +["sidekick-human", "sidekick-human", 3, ["L1", "MIS"], ""], +["firecanyon-part", "firecanyon-part", 3, ["L1", "FIC"], ""], +["assistant-firecanyon", "assistant-firecanyon", 3, ["L1", "FIC"], ""], +["village2-part", "village2-part", 3, ["L1", "VI2"], ""], +["village2-obs", "village2-obs", 3, ["L1", "VI2"], ""], +["village2-part2", "village2-part2", 3, ["L1", "VI2"], ""], +["gambler", "gambler", 3, ["L1", "VI2"], ""], +["warrior", "warrior", 3, ["L1", "VI2"], ""], +["geologist", "geologist", 3, ["L1", "VI2"], ""], +["swamp-blimp", "swamp-blimp", 3, ["L1", "VI2"], ""], +["sage-bluehut", "sage-bluehut", 3, ["L1", "VI2"], ""], +["flutflut-bluehut", "flutflut-bluehut", 3, ["L1", "VI2"], ""], +["assistant-village2", "assistant-village2", 3, ["L1", "VI2"], ""], +["sunken-elevator", "sunken-elevator", 3, ["L1", "VI2"], ""], +["swamp-obs", "swamp-obs", 3, ["L1", "SWA"], ""], +["swamp-bat", "swamp-bat", 3, ["L1", "SWA"], ""], +["swamp-rat", "swamp-rat", 3, ["L1", "SWA"], ""], +["swamp-rat-nest", "swamp-rat-nest", 3, ["L1", "SWA"], ""], +["kermit", "kermit", 3, ["L1", "SWA"], ""], +["swamp-part", "swamp-part", 3, ["L1", "SWA"], ""], +["billy", "billy", 3, ["L1", "SWA"], ""], +["cavecrystal-light", "cavecrystal-light", 3, ["L1", "MAI", "MAINCAVE"], ""], +["maincave-obs", "maincave-obs", 3, ["L1", "MAI", "MAINCAVE"], ""], +["maincave-part", "maincave-part", 3, ["L1", "MAI", "MAINCAVE"], ""], +["spiderwebs", "spiderwebs", 3, ["L1", "MAI", "MAINCAVE"], ""], +["dark-crystal", "dark-crystal", 3, ["L1", "MAI", "MAINCAVE"], ""], +["baby-spider", "baby-spider", 3, ["L1", "MAI", "MAINCAVE"], ""], +["mother-spider-h", "mother-spider-h", 3, ["L1", "MAI", "MAINCAVE"], ""], +["mother-spider-egg", "mother-spider-egg", 3, ["L1", "MAI", "MAINCAVE"], ""], +["mother-spider-proj", "mother-spider-proj", 3, ["L1", "MAI", "MAINCAVE"], ""], +["mother-spider", "mother-spider", 3, ["L1", "MAI", "MAINCAVE"], ""], +["gnawer", "gnawer", 3, ["L1", "MAI", "MAINCAVE"], ""], +["driller-lurker", "driller-lurker", 3, ["L1", "MAI", "MAINCAVE"], ""], +["sunken-part", "sunken-part", 3, ["L1", "SUN", "SUNKEN"], ""], +["sunken-part2", "sunken-part2", 3, ["L1", "SUN", "SUNKEN"], ""], +["sunken-part3", "sunken-part3", 3, ["L1", "SUN", "SUNKEN"], ""], +["sunken-part4", "sunken-part4", 3, ["L1", "SUN", "SUNKEN"], ""], +["sunken-part5", "sunken-part5", 3, ["L1", "SUN", "SUNKEN"], ""], +["target-tube", "target-tube", 3, ["L1", "SUN", "SUNKEN"], ""], +["eichar-tube+0-ag", "eichar-tube+0", 4, ["L1", "SUNKEN"], ""], +["eichar-tube+0-ag", "eichar-tube+0", 4, ["SUN"], ""], +["sunken-obs", "sunken-obs", 3, ["L1", "SUN", "SUNKEN"], ""], +["shover", "shover", 3, ["L1", "SUN", "SUNKEN"], ""], +["square-platform", "square-platform", 3, ["L1", "SUN", "SUNKEN"], ""], +["sun-iris-door", "sun-iris-door", 3, ["L1", "SUN", "SUNKEN"], ""], +["orbit-plat", "orbit-plat", 3, ["L1", "SUN", "SUNKEN"], ""], +["wedge-plats", "wedge-plats", 3, ["L1", "SUN", "SUNKEN"], ""], +["wall-plat", "wall-plat", 3, ["L1", "SUN", "SUNKEN"], ""], +["qbert-plat", "qbert-plat", 3, ["L1", "SUN", "SUNKEN"], ""], +["steam-cap", "steam-cap", 3, ["L1", "SUN", "SUNKEN"], ""], +["sun-exit-chamber", "sun-exit-chamber", 3, ["L1", "SUN", "SUNKEN"], ""], +["floating-launcher", "floating-launcher", 3, ["L1", "SUN", "SUNKEN"], ""], +["sunken-water", "sunken-water", 3, ["L1", "SUN", "SUNKEN"], ""], +["whirlpool", "whirlpool", 3, ["L1", "SUN", "SUNKEN"], ""], +["sunken-pipegame", "sunken-pipegame", 3, ["L1", "SUN", "SUNKEN"], ""], +["bully", "bully", 3, ["L1", "SUN", "SUNKEN"], ""], +["double-lurker", "double-lurker", 3, ["L1", "SUN", "SUNKEN"], ""], +["helix-water", "helix-water", 3, ["L1", "SUN", "SUNKEN"], ""], +["puffer", "puffer", 3, ["L1", "SUN", "SUNKEN"], ""], +["sunken-fish", "sunken-fish", 3, ["L1", "SUN", "SUNKEN"], ""], +["rolling-obs", "rolling-obs", 3, ["L1", "ROL"], ""], +["rolling-lightning-mole", "rolling-lightning-mole", 3, ["L1", "ROL"], ""], +["rolling-robber", "rolling-robber", 3, ["L1", "ROL"], ""], +["rolling-race-ring", "rolling-race-ring", 3, ["L1", "ROL"], ""], +["firecanyon-obs", "firecanyon-obs", 3, ["L1", "FIC", "OGR"], ""], +["ogre-part", "ogre-part", 3, ["L1", "OGR"], ""], +["ogreboss", "ogreboss", 3, ["L1", "OGR"], ""], +["ogre-obs", "ogre-obs", 3, ["L1", "OGR"], ""], +["flying-lurker", "flying-lurker", 3, ["L1", "OGR"], ""], +["village3-part", "village3-part", 3, ["L1", "VI3"], ""], +["village3-obs", "village3-obs", 3, ["L1", "VI3"], ""], +["minecart", "minecart", 3, ["L1", "VI3"], ""], +["miners", "miners", 3, ["L1", "VI3"], ""], +["assistant-village3", "assistant-village3", 3, ["L1", "VI3"], ""], +["sage-village3", "sage-village3", 3, ["L1", "VI3"], ""], +["cave-trap", "cave-trap", 3, ["L1", "ROB"], ""], +["spider-egg", "spider-egg", 3, ["L1", "ROB"], ""], +["robocave-part", "robocave-part", 3, ["L1", "ROB"], ""], +["target-snowball", "target-snowball", 3, ["L1", "SNO"], ""], +["target-ice", "target-ice", 3, ["L1", "SNO"], ""], +["ice-cube", "ice-cube", 3, ["L1", "SNO"], ""], +["snow-ball", "snow-ball", 3, ["L1", "SNO"], ""], +["snow-obs", "snow-obs", 3, ["L1", "SNO"], ""], +["snow-flutflut-obs", "snow-flutflut-obs", 3, ["L1", "SNO"], ""], +["snow-bumper", "snow-bumper", 3, ["L1", "SNO"], ""], +["snow-ram-h", "snow-ram-h", 3, ["L1", "SNO"], ""], +["snow-ram-boss", "snow-ram-boss", 3, ["L1", "SNO"], ""], +["snow-ram", "snow-ram", 3, ["L1", "SNO"], ""], +["snow-part", "snow-part", 3, ["L1", "SNO"], ""], +["yeti", "yeti", 3, ["L1", "SNO"], ""], +["eichar-pole+0-ag", "eichar-pole+0", 4, ["L1"], ""], +["eichar-pole+0-ag", "eichar-pole+0", 4, ["ROB"], ""], +["eichar-pole+0-ag", "eichar-pole+0", 4, ["SNO"], ""], +["eichar-pole+0-ag", "eichar-pole+0", 4, ["SWA"], ""], +["eichar-ice+0-ag", "eichar-ice+0", 4, ["L1", "SNO"], ""], +["lavatube-obs", "lavatube-obs", 3, ["L1", "LAV"], ""], +["lavatube-energy", "lavatube-energy", 3, ["L1", "LAV"], ""], +["lavatube-part", "lavatube-part", 3, ["L1", "LAV"], ""], +["assistant-lavatube", "assistant-lavatube", 3, ["L1", "LAV"], ""], +["tpage-815", "tpage-815", 4, ["FIC"], ""], +["tpage-822", "tpage-822", 4, ["FIC"], ""], +["tpage-854", "tpage-854", 4, ["FIC"], ""], +["tpage-1123", "tpage-1123", 4, ["FIC"], ""], +["assistant-firecanyon-ag", "assistant-firecanyon", 4, ["FIC"], ""], +["balloon-ag", "balloon", 4, ["FIC"], ""], +["crate-darkeco-cluster-ag", "crate-darkeco-cluster", 4, ["FIC"], ""], +["crate-darkeco-cluster-ag", "crate-darkeco-cluster", 4, ["OGR"], ""], +["ef-plane-ag", "ef-plane", 4, ["FIC", "LAV", "OGR", "ROL", "SNO", "SWA"], ""], +["ef-plane-ag", "ef-plane", 4, ["MIS"], ""], +["racer-ag", "racer", 4, ["FIC", "ROL"], ""], +["racer-ag", "racer", 4, ["LAV"], ""], +["racer-ag", "racer", 4, ["MIS"], ""], +["racer-ag", "racer", 4, ["OGR"], ""], +["spike-ag", "spike", 4, ["FIC"], ""], +["firecanyon-vis", "firecanyon-vis", 4, ["FIC"], ""], +["tpage-1338", "tpage-1338", 4, ["LAV"], ""], +["tpage-1340", "tpage-1340", 4, ["LAV"], ""], +["tpage-1339", "tpage-1339", 4, ["LAV"], ""], +["tpage-1337", "tpage-1337", 4, ["LAV"], ""], +["assistant-lavatube-start-ag", "assistant-lavatube-start", 4, ["LAV"], ""], +["chainmine-ag", "chainmine", 4, ["LAV"], ""], +["darkecobarrel-ag", "darkecobarrel", 4, ["LAV"], ""], +["energyarm-ag", "energyarm", 4, ["LAV"], ""], +["energyball-ag", "energyball", 4, ["LAV"], ""], +["energybase-ag", "energybase", 4, ["LAV"], ""], +["energydoor-ag", "energydoor", 4, ["LAV"], ""], +["energyhub-ag", "energyhub", 4, ["LAV"], ""], +["lavaballoon-ag", "lavaballoon", 4, ["LAV"], ""], +["lavabase-ag", "lavabase", 4, ["LAV"], ""], +["lavafall-ag", "lavafall", 4, ["LAV"], ""], +["lavafallsewera-ag", "lavafallsewera", 4, ["LAV"], ""], +["lavafallsewerb-ag", "lavafallsewerb", 4, ["LAV"], ""], +["lavashortcut-ag", "lavashortcut", 4, ["LAV"], ""], +["lavayellowtarp-ag", "lavayellowtarp", 4, ["LAV"], ""], +["water-anim-lavatube-ag", "water-anim-lavatube", 4, ["LAV"], ""], +["lavatube-vis", "lavatube-vis", 4, ["LAV"], ""], +["tpage-1313", "tpage-1313", 4, ["MAI"], ""], +["tpage-1315", "tpage-1315", 4, ["MAI"], ""], +["tpage-1314", "tpage-1314", 4, ["MAI"], ""], +["tpage-1312", "tpage-1312", 4, ["MAI"], ""], +["tpage-767", "tpage-767", 4, ["MAI"], ""], +["driller-lurker-ag", "driller-lurker", 4, ["MAI", "ROB"], ""], +["gnawer-ag", "gnawer", 4, ["MAI"], ""], +["launcherdoor-maincave-ag", "launcherdoor-maincave", 4, ["MAI"], ""], +["maincavecam-ag", "maincavecam", 4, ["MAI"], ""], +["plat-ag", "plat", 4, ["MAI"], ""], +["plat-ag", "plat", 4, ["ROB"], ""], +["spiderwebs-ag", "spiderwebs", 4, ["MAI", "ROB"], ""], +["water-anim-maincave-ag", "water-anim-maincave", 4, ["MAI"], ""], +["water-anim-maincave-water-ag", "water-anim-maincave-water", 4, ["MAI"], ""], +["maincave-vis", "maincave-vis", 4, ["MAI"], ""], +["tpage-516", "tpage-516", 4, ["MIS"], ""], +["tpage-521", "tpage-521", 4, ["MIS"], ""], +["tpage-518", "tpage-518", 4, ["MIS"], ""], +["tpage-520", "tpage-520", 4, ["MIS"], ""], +["balloonlurker-ag", "balloonlurker", 4, ["MIS"], ""], +["boatpaddle-ag", "boatpaddle", 4, ["MIS"], ""], +["bonelurker-ag", "bonelurker", 4, ["MIS"], ""], +["breakaway-left-ag", "breakaway-left", 4, ["MIS"], ""], +["breakaway-mid-ag", "breakaway-mid", 4, ["MIS"], ""], +["breakaway-right-ag", "breakaway-right", 4, ["MIS"], ""], +["darkecocan-ag", "darkecocan", 4, ["MIS"], ""], +["keg-ag", "keg", 4, ["MIS"], ""], +["keg-conveyor-ag", "keg-conveyor", 4, ["MIS"], ""], +["keg-conveyor-paddle-ag", "keg-conveyor-paddle", 4, ["MIS"], ""], +["mis-bone-bridge-ag", "mis-bone-bridge", 4, ["MIS"], ""], +["mis-bone-platform-ag", "mis-bone-platform", 4, ["MIS"], ""], +["mistycam-ag", "mistycam", 4, ["MIS"], ""], +["muse-ag", "muse", 4, ["MIS"], ""], +["quicksandlurker-ag", "quicksandlurker", 4, ["MIS"], ""], +["ropebridge-36-ag", "ropebridge-36", 4, ["MIS"], ""], +["rounddoor-ag", "rounddoor", 4, ["MIS"], ""], +["sidekick-human-ag", "sidekick-human", 4, ["MIS"], ""], +["silostep-ag", "silostep", 4, ["MIS"], ""], +["teetertotter-ag", "teetertotter", 4, ["MIS"], ""], +["water-anim-misty-ag", "water-anim-misty", 4, ["MIS"], ""], +["wheel-ag", "wheel", 4, ["MIS"], ""], +["windturbine-ag", "windturbine", 4, ["MIS"], ""], +["misty-vis", "misty-vis", 4, ["MIS"], ""], +["tpage-875", "tpage-875", 4, ["OGR"], ""], +["tpage-967", "tpage-967", 4, ["OGR"], ""], +["tpage-884", "tpage-884", 4, ["OGR"], ""], +["tpage-1117", "tpage-1117", 4, ["OGR"], ""], +["flying-lurker-ag", "flying-lurker", 4, ["OGR"], ""], +["medres-snow-ag", "medres-snow", 4, ["OGR"], ""], +["ogre-bridge-ag", "ogre-bridge", 4, ["OGR"], ""], +["ogre-bridgeend-ag", "ogre-bridgeend", 4, ["OGR"], ""], +["ogre-isle-ag", "ogre-isle", 4, ["OGR"], ""], +["ogre-step-ag", "ogre-step", 4, ["OGR"], ""], +["ogreboss-ag", "ogreboss", 4, ["OGR"], ""], +["ogrecam-ag", "ogrecam", 4, ["OGR"], ""], +["plunger-lurker-ag", "plunger-lurker", 4, ["OGR"], ""], +["shortcut-boulder-ag", "shortcut-boulder", 4, ["OGR"], ""], +["tntbarrel-ag", "tntbarrel", 4, ["OGR"], ""], +["water-anim-ogre-ag", "water-anim-ogre", 4, ["OGR"], ""], +["ogre-vis", "ogre-vis", 4, ["OGR"], ""], +["tpage-1318", "tpage-1318", 4, ["ROB"], ""], +["tpage-1319", "tpage-1319", 4, ["ROB"], ""], +["tpage-1317", "tpage-1317", 4, ["ROB"], ""], +["tpage-1316", "tpage-1316", 4, ["ROB"], ""], +["cavecrusher-ag", "cavecrusher", 4, ["ROB"], ""], +["cavespatulatwo-ag", "cavespatulatwo", 4, ["ROB"], ""], +["water-anim-robocave-ag", "water-anim-robocave", 4, ["ROB"], ""], +["robocave-vis", "robocave-vis", 4, ["ROB"], ""], +["tpage-923", "tpage-923", 4, ["ROL"], ""], +["tpage-926", "tpage-926", 4, ["ROL"], ""], +["tpage-924", "tpage-924", 4, ["ROL"], ""], +["tpage-925", "tpage-925", 4, ["ROL"], ""], +["tpage-1353", "tpage-1353", 4, ["ROL"], ""], +["dark-plant-ag", "dark-plant", 4, ["ROL"], ""], +["happy-plant-ag", "happy-plant", 4, ["ROL"], ""], +["lightning-mole-ag", "lightning-mole", 4, ["ROL"], ""], +["pusher-ag", "pusher", 4, ["ROL"], ""], +["race-ring-ag", "race-ring", 4, ["ROL"], ""], +["robber-ag", "robber", 4, ["ROL"], ""], +["rolling-start-ag", "rolling-start", 4, ["ROL"], ""], +["rollingcam-ag", "rollingcam", 4, ["ROL"], ""], +["water-anim-rolling-ag", "water-anim-rolling", 4, ["ROL"], ""], +["rolling-vis", "rolling-vis", 4, ["ROL"], ""], +["tpage-710", "tpage-710", 4, ["SNO"], ""], +["tpage-842", "tpage-842", 4, ["SNO"], ""], +["tpage-711", "tpage-711", 4, ["SNO"], ""], +["tpage-712", "tpage-712", 4, ["SNO"], ""], +["flut-saddle-ag", "flut-saddle", 4, ["SNO"], ""], +["flut-saddle-ag", "flut-saddle", 4, ["SWA"], ""], +["flutflut-plat-large-ag", "flutflut-plat-large", 4, ["SNO"], ""], +["flutflut-plat-med-ag", "flutflut-plat-med", 4, ["SNO"], ""], +["flutflut-plat-small-ag", "flutflut-plat-small", 4, ["SNO"], ""], +["ice-cube-ag", "ice-cube", 4, ["SNO"], ""], +["ice-cube-break-ag", "ice-cube-break", 4, ["SNO"], ""], +["ram-ag", "ram", 4, ["SNO"], ""], +["ram-boss-ag", "ram-boss", 4, ["SNO"], ""], +["snow-ball-ag", "snow-ball", 4, ["SNO"], ""], +["snow-bridge-36-ag", "snow-bridge-36", 4, ["SNO"], ""], +["snow-bumper-ag", "snow-bumper", 4, ["SNO"], ""], +["snow-bunny-ag", "snow-bunny", 4, ["SNO"], ""], +["snow-button-ag", "snow-button", 4, ["SNO"], ""], +["snow-eggtop-ag", "snow-eggtop", 4, ["SNO"], ""], +["snow-fort-gate-ag", "snow-fort-gate", 4, ["SNO"], ""], +["snow-gears-ag", "snow-gears", 4, ["SNO"], ""], +["snow-log-ag", "snow-log", 4, ["SNO"], ""], +["snow-spatula-ag", "snow-spatula", 4, ["SNO"], ""], +["snow-switch-ag", "snow-switch", 4, ["SNO"], ""], +["snowcam-ag", "snowcam", 4, ["SNO"], ""], +["snowpusher-ag", "snowpusher", 4, ["SNO"], ""], +["yeti-ag", "yeti", 4, ["SNO"], ""], +["snow-vis", "snow-vis", 4, ["SNO"], ""], +["tpage-163", "tpage-163", 4, ["SUB"], ""], +["tpage-164", "tpage-164", 4, ["SUB"], ""], +["tpage-166", "tpage-166", 4, ["SUB"], ""], +["tpage-162", "tpage-162", 4, ["SUB"], ""], +["tpage-764", "tpage-764", 4, ["SUB"], ""], +["blue-eco-charger-ag", "blue-eco-charger", 4, ["SUB"], ""], +["blue-eco-charger-orb-ag", "blue-eco-charger-orb", 4, ["SUB"], ""], +["bully-ag", "bully", 4, ["SUB", "SUN"], ""], +["floating-launcher-ag", "floating-launcher", 4, ["SUB"], ""], +["helix-button-ag", "helix-button", 4, ["SUB"], ""], +["helix-slide-door-ag", "helix-slide-door", 4, ["SUB"], ""], +["shover-ag", "shover", 4, ["SUB"], ""], +["shover-ag", "shover", 4, ["SUN"], ""], +["steam-cap-ag", "steam-cap", 4, ["SUB"], ""], +["steam-cap-ag", "steam-cap", 4, ["SUN"], ""], +["sunkencam-ag", "sunkencam", 4, ["SUB"], ""], +["sunkencam-ag", "sunkencam", 4, ["SUN"], ""], +["sunkenfisha-ag", "sunkenfisha", 4, ["SUB", "SUN"], ""], +["wall-plat-ag", "wall-plat", 4, ["SUB", "SUN"], ""], +["water-anim-sunken-ag", "water-anim-sunken", 4, ["SUB", "SUN"], ""], +["water-anim-sunken-dark-eco-ag", "water-anim-sunken-dark-eco", 4, ["SUB", "SUN"], ""], +["sunkenb-vis", "sunkenb-vis", 4, ["SUB"], ""], +["tpage-661", "tpage-661", 4, ["SUN"], ""], +["tpage-663", "tpage-663", 4, ["SUN"], ""], +["tpage-714", "tpage-714", 4, ["SUN"], ""], +["tpage-662", "tpage-662", 4, ["SUN"], ""], +["tpage-766", "tpage-766", 4, ["SUN"], ""], +["double-lurker-ag", "double-lurker", 4, ["SUN"], ""], +["double-lurker-top-ag", "double-lurker-top", 4, ["SUN"], ""], +["exit-chamber-ag", "exit-chamber", 4, ["SUN"], ""], +["generic-button-ag", "generic-button", 4, ["SUN"], ""], +["orbit-plat-ag", "orbit-plat", 4, ["SUN"], ""], +["orbit-plat-bottom-ag", "orbit-plat-bottom", 4, ["SUN"], ""], +["plat-sunken-ag", "plat-sunken", 4, ["SUN"], ""], +["puffer-ag", "puffer", 4, ["SUN"], ""], +["qbert-plat-ag", "qbert-plat", 4, ["SUN"], ""], +["qbert-plat-on-ag", "qbert-plat-on", 4, ["SUN"], ""], +["seaweed-ag", "seaweed", 4, ["SUN"], ""], +["side-to-side-plat-ag", "side-to-side-plat", 4, ["SUN"], ""], +["square-platform-ag", "square-platform", 4, ["SUN"], ""], +["sun-iris-door-ag", "sun-iris-door", 4, ["SUN"], ""], +["wedge-plat-ag", "wedge-plat", 4, ["SUN"], ""], +["wedge-plat-outer-ag", "wedge-plat-outer", 4, ["SUN"], ""], +["whirlpool-ag", "whirlpool", 4, ["SUN"], ""], +["sunken-vis", "sunken-vis", 4, ["SUN"], ""], +["tpage-358", "tpage-358", 4, ["SWA"], ""], +["tpage-659", "tpage-659", 4, ["SWA"], ""], +["tpage-629", "tpage-629", 4, ["SWA"], ""], +["tpage-630", "tpage-630", 4, ["SWA"], ""], +["balance-plat-ag", "balance-plat", 4, ["SWA"], ""], +["billy-ag", "billy", 4, ["SWA"], ""], +["billy-sidekick-ag", "billy-sidekick", 4, ["SWA"], ""], +["farthy-snack-ag", "farthy-snack", 4, ["SWA"], ""], +["kermit-ag", "kermit", 4, ["SWA"], ""], +["swamp-bat-ag", "swamp-bat", 4, ["SWA"], ""], +["swamp-rat-ag", "swamp-rat", 4, ["SWA"], ""], +["swamp-rat-nest-ag", "swamp-rat-nest", 4, ["SWA"], ""], +["swamp-rock-ag", "swamp-rock", 4, ["SWA"], ""], +["swamp-spike-ag", "swamp-spike", 4, ["SWA"], ""], +["swampcam-ag", "swampcam", 4, ["SWA"], ""], +["swampcam-ag", "swampcam", 4, ["VI2"], ""], +["tar-plat-ag", "tar-plat", 4, ["SWA"], ""], +["swamp-vis", "swamp-vis", 4, ["SWA"], ""], +["title-obs", "title-obs", 3, ["TIT"], ""], +["tpage-1609", "tpage-1609", 4, ["TIT"], ""], +["tpage-416", "tpage-416", 4, ["TIT"], ""], +["tpage-415", "tpage-415", 4, ["TIT"], ""], +["tpage-397", "tpage-397", 4, ["TIT"], ""], +["tpage-1499", "tpage-1499", 4, ["TIT"], ""], +["logo-ag", "logo", 4, ["TIT"], ""], +["logo-black-ag", "logo-black", 4, ["TIT"], ""], +["logo-cam-ag", "logo-cam", 4, ["TIT"], ""], +["logo-volumes-ag", "logo-volumes", 4, ["TIT"], ""], +["ndi-ag", "ndi", 4, ["TIT"], ""], +["ndi-cam-ag", "ndi-cam", 4, ["TIT"], ""], +["ndi-volumes-ag", "ndi-volumes", 4, ["TIT"], ""], +["title-vis", "title-vis", 4, ["TIT"], ""], +["tpage-1309", "tpage-1309", 4, ["TRA"], ""], +["tpage-1311", "tpage-1311", 4, ["TRA"], ""], +["tpage-1310", "tpage-1310", 4, ["TRA"], ""], +["tpage-1308", "tpage-1308", 4, ["TRA"], ""], +["tpage-775", "tpage-775", 4, ["TRA"], ""], +["pontoonfive-ag", "pontoonfive", 4, ["TRA"], ""], +["pontoonfive-ag", "pontoonfive", 4, ["VI2"], ""], +["scarecrow-a-ag", "scarecrow-a", 4, ["TRA"], ""], +["scarecrow-b-ag", "scarecrow-b", 4, ["TRA"], ""], +["trainingcam-ag", "trainingcam", 4, ["TRA"], ""], +["water-anim-training-ag", "water-anim-training", 4, ["TRA"], ""], +["training-vis", "training-vis", 4, ["TRA"], ""], +["tpage-398", "tpage-398", 4, ["VI1"], ""], +["tpage-400", "tpage-400", 4, ["VI1"], ""], +["tpage-399", "tpage-399", 4, ["VI1"], ""], +["tpage-401", "tpage-401", 4, ["VI1"], ""], +["tpage-1470", "tpage-1470", 4, ["VI1"], ""], +["assistant-ag", "assistant", 4, ["VI1"], ""], +["evilplant-ag", "evilplant", 4, ["VI1"], ""], +["explorer-ag", "explorer", 4, ["VI1"], ""], +["farmer-ag", "farmer", 4, ["VI1"], ""], +["fishermans-boat-ag", "fishermans-boat", 4, ["VI1"], ""], +["hutlamp-ag", "hutlamp", 4, ["VI1"], ""], +["mayorgears-ag", "mayorgears", 4, ["VI1"], ""], +["medres-beach-ag", "medres-beach", 4, ["VI1"], ""], +["medres-beach1-ag", "medres-beach1", 4, ["VI1"], ""], +["medres-beach2-ag", "medres-beach2", 4, ["VI1"], ""], +["medres-beach3-ag", "medres-beach3", 4, ["VI1"], ""], +["medres-jungle-ag", "medres-jungle", 4, ["VI1"], ""], +["medres-jungle1-ag", "medres-jungle1", 4, ["VI1"], ""], +["medres-jungle2-ag", "medres-jungle2", 4, ["VI1"], ""], +["medres-misty-ag", "medres-misty", 4, ["VI1"], ""], +["medres-training-ag", "medres-training", 4, ["VI1"], ""], +["medres-village11-ag", "medres-village11", 4, ["VI1"], ""], +["medres-village12-ag", "medres-village12", 4, ["VI1"], ""], +["medres-village13-ag", "medres-village13", 4, ["VI1"], ""], +["oracle-ag", "oracle", 4, ["VI1"], ""], +["oracle-ag", "oracle", 4, ["VI2"], ""], +["oracle-ag", "oracle", 4, ["VI3"], ""], +["reflector-middle-ag", "reflector-middle", 4, ["VI1"], ""], +["revcycle-ag", "revcycle", 4, ["VI1"], ""], +["revcycleprop-ag", "revcycleprop", 4, ["VI1"], ""], +["ropebridge-32-ag", "ropebridge-32", 4, ["VI1"], ""], +["sage-ag", "sage", 4, ["VI1"], ""], +["sagesail-ag", "sagesail", 4, ["VI1"], ""], +["villa-starfish-ag", "villa-starfish", 4, ["VI1"], ""], +["village-cam-ag", "village-cam", 4, ["VI1"], ""], +["village-cam-ag", "village-cam", 4, ["VI2"], ""], +["village-cam-ag", "village-cam", 4, ["VI3"], ""], +["village1cam-ag", "village1cam", 4, ["VI1"], ""], +["water-anim-village1-ag", "water-anim-village1", 4, ["VI1"], ""], +["windmill-sail-ag", "windmill-sail", 4, ["VI1"], ""], +["windspinner-ag", "windspinner", 4, ["VI1"], ""], +["yakow-ag", "yakow", 4, ["VI1"], ""], +["village1-vis", "village1-vis", 4, ["VI1"], ""], +["tpage-919", "tpage-919", 4, ["VI2"], ""], +["tpage-922", "tpage-922", 4, ["VI2"], ""], +["tpage-920", "tpage-920", 4, ["VI2"], ""], +["tpage-921", "tpage-921", 4, ["VI2"], ""], +["tpage-1476", "tpage-1476", 4, ["VI2"], ""], +["allpontoons-ag", "allpontoons", 4, ["VI2"], ""], +["assistant-village2-ag", "assistant-village2", 4, ["VI2"], ""], +["ceilingflag-ag", "ceilingflag", 4, ["VI2"], ""], +["exit-chamber-dummy-ag", "exit-chamber-dummy", 4, ["VI2"], ""], +["fireboulder-ag", "fireboulder", 4, ["VI2"], ""], +["flutflut-bluehut-ag", "flutflut-bluehut", 4, ["VI2"], ""], +["gambler-ag", "gambler", 4, ["VI2"], ""], +["geologist-ag", "geologist", 4, ["VI2"], ""], +["jaws-ag", "jaws", 4, ["VI2"], ""], +["medres-rolling-ag", "medres-rolling", 4, ["VI2"], ""], +["medres-rolling1-ag", "medres-rolling1", 4, ["VI2"], ""], +["medres-village2-ag", "medres-village2", 4, ["VI2"], ""], +["ogreboss-village2-ag", "ogreboss-village2", 4, ["VI2"], ""], +["pontoonten-ag", "pontoonten", 4, ["VI2"], ""], +["precursor-arm-ag", "precursor-arm", 4, ["VI2"], ""], +["sage-bluehut-ag", "sage-bluehut", 4, ["VI2"], ""], +["sunken-elevator-ag", "sunken-elevator", 4, ["VI2"], ""], +["swamp-blimp-ag", "swamp-blimp", 4, ["VI2"], ""], +["swamp-rope-ag", "swamp-rope", 4, ["VI2"], ""], +["swamp-tetherrock-ag", "swamp-tetherrock", 4, ["VI2"], ""], +["swamp-tetherrock-explode-ag", "swamp-tetherrock-explode", 4, ["VI2"], ""], +["village2cam-ag", "village2cam", 4, ["VI2"], ""], +["warrior-ag", "warrior", 4, ["VI2"], ""], +["water-anim-village2-ag", "water-anim-village2", 4, ["VI2"], ""], +["village2-vis", "village2-vis", 4, ["VI2"], ""], +["tpage-1208", "tpage-1208", 4, ["VI3"], ""], +["tpage-1210", "tpage-1210", 4, ["VI3"], ""], +["tpage-1209", "tpage-1209", 4, ["VI3"], ""], +["tpage-1194", "tpage-1194", 4, ["VI3"], ""], +["assistant-village3-ag", "assistant-village3", 4, ["VI3"], ""], +["cavegem-ag", "cavegem", 4, ["VI3"], ""], +["evilbro-village3-ag", "evilbro-village3", 4, ["VI3"], ""], +["evilsis-village3-ag", "evilsis-village3", 4, ["VI3"], ""], +["gondola-ag", "gondola", 4, ["VI3"], ""], +["gondolacables-ag", "gondolacables", 4, ["VI3"], ""], +["lavaspoutdrip-ag", "lavaspoutdrip", 4, ["VI3"], ""], +["medres-finalboss-ag", "medres-finalboss", 4, ["VI3"], ""], +["medres-ogre-ag", "medres-ogre", 4, ["VI3"], ""], +["medres-ogre2-ag", "medres-ogre2", 4, ["VI3"], ""], +["medres-ogre3-ag", "medres-ogre3", 4, ["VI3"], ""], +["minecartsteel-ag", "minecartsteel", 4, ["VI3"], ""], +["minershort-ag", "minershort", 4, ["VI3"], ""], +["minertall-ag", "minertall", 4, ["VI3"], ""], +["pistons-ag", "pistons", 4, ["VI3"], ""], +["sage-village3-ag", "sage-village3", 4, ["VI3"], ""], +["vil3-bridge-36-ag", "vil3-bridge-36", 4, ["VI3"], ""], +["water-anim-village3-ag", "water-anim-village3", 4, ["VI3"], ""], +["village3-vis", "village3-vis", 4, ["VI3"], ""], +["lava", "lava", 3, ["WATER-AN"], ""], +["0COMMON", "0COMMON", 2, ["NO-XGO"], ""], +["1COMMON", "1COMMON", 2, ["NO-XGO"], ""], +["2COMMON", "2COMMON", 2, ["NO-XGO"], ""], +["3COMMON", "3COMMON", 2, ["NO-XGO"], ""], +["4COMMON", "4COMMON", 2, ["NO-XGO"], ""], +["5COMMON", "5COMMON", 2, ["NO-XGO"], ""], +["6COMMON", "6COMMON", 2, ["NO-XGO"], ""], +["balloon-fuel-cell+0", "balloon-fuel-cell+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-4+0", "swamp-tetherrock-explode-4+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-3+0", "swamp-tetherrock-explode-3+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-2+0", "swamp-tetherrock-explode-2+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-1+0", "swamp-tetherrock-explode-1+0", 2, ["NO-XGO"], ""], +["snowcam-ram-boss-snow-ball-fuel-cell+0", "snowcam-ram-boss-snow-ball-fuel-cell+0", 2, ["NO-XGO"], ""], +["snowcam-ram-boss-ice-pond-fuel-cell+0", "snowcam-ram-boss-ice-pond-fuel-cell+0", 2, ["NO-XGO"], ""], +["snowcam-ram-boss-in-cave-fuel-cell+0", "snowcam-ram-boss-in-cave-fuel-cell+0", 2, ["NO-XGO"], ""], +["oracle-reminder-3+0", "oracle-reminder-3+0", 2, ["NO-XGO"], ""], +["oracle-reminder-3+1", "oracle-reminder-3+1", 2, ["NO-XGO"], ""], +["oracle-reminder-2+0", "oracle-reminder-2+0", 2, ["NO-XGO"], ""], +["oracle-reminder-2+1", "oracle-reminder-2+1", 2, ["NO-XGO"], ""], +["mistycam-cannon+0", "mistycam-cannon+0", 2, ["NO-XGO"], ""], +["beachcam-cannon+0", "beachcam-cannon+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-swamprockexplode-4+0", "swamp-tetherrock-swamprockexplode-4+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-swamprockexplode-3+0", "swamp-tetherrock-swamprockexplode-3+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-swamprockexplode-2+0", "swamp-tetherrock-swamprockexplode-2+0", 2, ["NO-XGO"], ""], +["swamprockexplode-4+0", "swamprockexplode-4+0", 2, ["NO-XGO"], ""], +["swamprockexplode-3+0", "swamprockexplode-3+0", 2, ["NO-XGO"], ""], +["swamprockexplode-2+0", "swamprockexplode-2+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-swamprockexplode-1+0", "swamp-tetherrock-swamprockexplode-1+0", 2, ["NO-XGO"], ""], +["oracle-right-eye+0", "oracle-right-eye+0", 2, ["NO-XGO"], ""], +["oracle-left-eye+0", "oracle-left-eye+0", 2, ["NO-XGO"], ""], +["swamprockexplode-1+0", "swamprockexplode-1+0", 2, ["NO-XGO"], ""], +["maincavecam-gnawer-fuel-cell+0", "maincavecam-gnawer-fuel-cell+0", 2, ["NO-XGO"], ""], +["gnawer-fuel-cell+0", "gnawer-fuel-cell+0", 2, ["NO-XGO"], ""], +["oracle-right-eye-3+0", "oracle-right-eye-3+0", 2, ["NO-XGO"], ""], +["oracle-right-eye-3+1", "oracle-right-eye-3+1", 2, ["NO-XGO"], ""], +["oracle-right-eye-2+0", "oracle-right-eye-2+0", 2, ["NO-XGO"], ""], +["oracle-right-eye-2+1", "oracle-right-eye-2+1", 2, ["NO-XGO"], ""], +["oracle-right-eye-1+0", "oracle-right-eye-1+0", 2, ["NO-XGO"], ""], +["oracle-right-eye-1+1", "oracle-right-eye-1+1", 2, ["NO-XGO"], ""], +["oracle-reminder-1+0", "oracle-reminder-1+0", 2, ["NO-XGO"], ""], +["oracle-reminder-1+1", "oracle-reminder-1+1", 2, ["NO-XGO"], ""], +["oracle-reminder-1+2", "oracle-reminder-1+2", 2, ["NO-XGO"], ""], +["oracle-reminder-1+3", "oracle-reminder-1+3", 2, ["NO-XGO"], ""], +["oracle-left-eye-3+0", "oracle-left-eye-3+0", 2, ["NO-XGO"], ""], +["oracle-left-eye-3+1", "oracle-left-eye-3+1", 2, ["NO-XGO"], ""], +["oracle-left-eye-2+0", "oracle-left-eye-2+0", 2, ["NO-XGO"], ""], +["oracle-left-eye-2+1", "oracle-left-eye-2+1", 2, ["NO-XGO"], ""], +["oracle-intro-3+0", "oracle-intro-3+0", 2, ["NO-XGO"], ""], +["oracle-intro-3+1", "oracle-intro-3+1", 2, ["NO-XGO"], ""], +["oracle-intro-3+2", "oracle-intro-3+2", 2, ["NO-XGO"], ""], +["oracle-intro-3+3", "oracle-intro-3+3", 2, ["NO-XGO"], ""], +["oracle-intro-2+0", "oracle-intro-2+0", 2, ["NO-XGO"], ""], +["oracle-intro-2+1", "oracle-intro-2+1", 2, ["NO-XGO"], ""], +["oracle-intro-2+2", "oracle-intro-2+2", 2, ["NO-XGO"], ""], +["oracle-intro-2+3", "oracle-intro-2+3", 2, ["NO-XGO"], ""], +["death-0202+0", "death-0202+0", 2, ["NO-XGO"], ""], +["race-ring-second-anim+0", "race-ring-second-anim+0", 2, ["NO-XGO"], ""], +["race-ring-second-anim+1", "race-ring-second-anim+1", 2, ["NO-XGO"], ""], +["race-ring-anim+0", "race-ring-anim+0", 2, ["NO-XGO"], ""], +["race-ring-anim+1", "race-ring-anim+1", 2, ["NO-XGO"], ""], +["eichar-fish+0", "eichar-fish+0", 2, ["NO-XGO"], ""], +["oracle-left-eye-1+0", "oracle-left-eye-1+0", 2, ["NO-XGO"], ""], +["oracle-left-eye-1+1", "oracle-left-eye-1+1", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-4+0", "swamp-tetherrock-explode-final-4+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-4+1", "swamp-tetherrock-explode-final-4+1", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-4+2", "swamp-tetherrock-explode-final-4+2", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-3+0", "swamp-tetherrock-explode-final-3+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-3+1", "swamp-tetherrock-explode-final-3+1", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-3+2", "swamp-tetherrock-explode-final-3+2", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-2+0", "swamp-tetherrock-explode-final-2+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-2+1", "swamp-tetherrock-explode-final-2+1", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-2+2", "swamp-tetherrock-explode-final-2+2", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-1+0", "swamp-tetherrock-explode-final-1+0", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-1+1", "swamp-tetherrock-explode-final-1+1", 2, ["NO-XGO"], ""], +["swamp-tetherrock-explode-final-1+2", "swamp-tetherrock-explode-final-1+2", 2, ["NO-XGO"], ""], +["oracle-intro-1+0", "oracle-intro-1+0", 2, ["NO-XGO"], ""], +["oracle-intro-1+1", "oracle-intro-1+1", 2, ["NO-XGO"], ""], +["oracle-intro-1+2", "oracle-intro-1+2", 2, ["NO-XGO"], ""], +["oracle-intro-1+3", "oracle-intro-1+3", 2, ["NO-XGO"], ""], +["oracle-intro-1+4", "oracle-intro-1+4", 2, ["NO-XGO"], ""], +["eichar-ice+0", "eichar-ice+0", 2, ["NO-XGO"], ""], +["eichar-ambient-3+0", "eichar-ambient-3+0", 2, ["NO-XGO"], ""], +["death-0191+0", "death-0191+0", 2, ["NO-XGO"], ""], +["death-0186+0", "death-0186+0", 2, ["NO-XGO"], ""], +["death-0187+0", "death-0187+0", 2, ["NO-XGO"], ""], +["eichar-ambient-4+0", "eichar-ambient-4+0", 2, ["NO-XGO"], ""], +["eichar-pole+0", "eichar-pole+0", 2, ["NO-XGO"], ""], +["race-ring-anim-second+0", "race-ring-anim-second+0", 2, ["NO-XGO"], ""], +["race-ring-anim-second+1", "race-ring-anim-second+1", 2, ["NO-XGO"], ""], +["race-ring-anim-2+0", "race-ring-anim-2+0", 2, ["NO-XGO"], ""], +["race-ring-anim-2+1", "race-ring-anim-2+1", 2, ["NO-XGO"], ""], +["death-0184+0", "death-0184+0", 2, ["NO-XGO"], ""], +["death-0181+0", "death-0181+0", 2, ["NO-XGO"], ""], +["pelican-spit-ext+0", "pelican-spit-ext+0", 2, ["NO-XGO"], ""], +["pelican-spit-ext+1", "pelican-spit-ext+1", 2, ["NO-XGO"], ""], +["death-0195+0", "death-0195+0", 2, ["NO-XGO"], ""], +["eichar-ambient-2+0", "eichar-ambient-2+0", 2, ["NO-XGO"], ""], +["fisher-reminder-1+0", "fisher-reminder-1+0", 2, ["NO-XGO"], ""], +["death-0182+0", "death-0182+0", 2, ["NO-XGO"], ""], +["billy-reminder-1+0", "billy-reminder-1+0", 2, ["NO-XGO"], ""], +["billy-reminder-1+1", "billy-reminder-1+1", 2, ["NO-XGO"], ""], +["happy-plant-open+0", "happy-plant-open+0", 2, ["NO-XGO"], ""], +["happy-plant-open+1", "happy-plant-open+1", 2, ["NO-XGO"], ""], +["eichar-tube+0", "eichar-tube+0", 2, ["NO-XGO"], ""], +["sculptor-reminder-1+0", "sculptor-reminder-1+0", 2, ["NO-XGO"], ""], +["sculptor-reminder-1+1", "sculptor-reminder-1+1", 2, ["NO-XGO"], ""], +["death-0197+0", "death-0197+0", 2, ["NO-XGO"], ""], +["death-0197+1", "death-0197+1", 2, ["NO-XGO"], ""], +["death-0193+0", "death-0193+0", 2, ["NO-XGO"], ""], +["death-0193+1", "death-0193+1", 2, ["NO-XGO"], ""], +["eichar-ambient-1+0", "eichar-ambient-1+0", 2, ["NO-XGO"], ""], +["farmer-reminder-2+0", "farmer-reminder-2+0", 2, ["NO-XGO"], ""], +["farmer-reminder-2+1", "farmer-reminder-2+1", 2, ["NO-XGO"], ""], +["farmer-reminder-1+0", "farmer-reminder-1+0", 2, ["NO-XGO"], ""], +["farmer-reminder-1+1", "farmer-reminder-1+1", 2, ["NO-XGO"], ""], +["death-0199+0", "death-0199+0", 2, ["NO-XGO"], ""], +["death-0199+1", "death-0199+1", 2, ["NO-XGO"], ""], +["geologist-reminder-money+0", "geologist-reminder-money+0", 2, ["NO-XGO"], ""], +["geologist-reminder-money+1", "geologist-reminder-money+1", 2, ["NO-XGO"], ""], +["billy-resolution+0", "billy-resolution+0", 2, ["NO-XGO"], ""], +["billy-resolution+1", "billy-resolution+1", 2, ["NO-XGO"], ""], +["gambler-reminder-money+0", "gambler-reminder-money+0", 2, ["NO-XGO"], ""], +["gambler-reminder-money+1", "gambler-reminder-money+1", 2, ["NO-XGO"], ""], +["big-adventure+0", "big-adventure+0", 2, ["NO-XGO"], ""], +["big-adventure+1", "big-adventure+1", 2, ["NO-XGO"], ""], +["big-adventure+2", "big-adventure+2", 2, ["NO-XGO"], ""], +["big-adventure+3", "big-adventure+3", 2, ["NO-XGO"], ""], +["big-adventure+4", "big-adventure+4", 2, ["NO-XGO"], ""], +["big-adventure+5", "big-adventure+5", 2, ["NO-XGO"], ""], +["big-adventure+6", "big-adventure+6", 2, ["NO-XGO"], ""], +["big-adventure+7", "big-adventure+7", 2, ["NO-XGO"], ""], +["fuel-cell-racer-victory-1+0", "fuel-cell-racer-victory-1+0", 2, ["NO-XGO"], ""], +["fuel-cell-racer-victory-1+1", "fuel-cell-racer-victory-1+1", 2, ["NO-XGO"], ""], +["billy-reject+0", "billy-reject+0", 2, ["NO-XGO"], ""], +["billy-reject+1", "billy-reject+1", 2, ["NO-XGO"], ""], +["billy-reject+2", "billy-reject+2", 2, ["NO-XGO"], ""], +["warrior-reminder-1+0", "warrior-reminder-1+0", 2, ["NO-XGO"], ""], +["warrior-reminder-1+1", "warrior-reminder-1+1", 2, ["NO-XGO"], ""], +["warrior-reminder-1+2", "warrior-reminder-1+2", 2, ["NO-XGO"], ""], +["billy-accept+0", "billy-accept+0", 2, ["NO-XGO"], ""], +["billy-accept+1", "billy-accept+1", 2, ["NO-XGO"], ""], +["billy-accept+2", "billy-accept+2", 2, ["NO-XGO"], ""], +["sage-village3-reminder-1-dark-eco+0", "sage-village3-reminder-1-dark-eco+0", 2, ["NO-XGO"], ""], +["sage-village3-reminder-1-dark-eco+1", "sage-village3-reminder-1-dark-eco+1", 2, ["NO-XGO"], ""], +["assistant-reminder-1-generic+0", "assistant-reminder-1-generic+0", 2, ["NO-XGO"], ""], +["assistant-reminder-1-generic+1", "assistant-reminder-1-generic+1", 2, ["NO-XGO"], ""], +["fisher-reject+0", "fisher-reject+0", 2, ["NO-XGO"], ""], +["fisher-reject+1", "fisher-reject+1", 2, ["NO-XGO"], ""], +["gambler-reminder-race+0", "gambler-reminder-race+0", 2, ["NO-XGO"], ""], +["gambler-reminder-race+1", "gambler-reminder-race+1", 2, ["NO-XGO"], ""], +["geologist-resolution-money+0", "geologist-resolution-money+0", 2, ["NO-XGO"], ""], +["geologist-resolution-money+1", "geologist-resolution-money+1", 2, ["NO-XGO"], ""], +["lrocklrg-falling+0", "lrocklrg-falling+0", 2, ["NO-XGO"], ""], +["lrocklrg-falling+1", "lrocklrg-falling+1", 2, ["NO-XGO"], ""], +["lrocklrg-falling+2", "lrocklrg-falling+2", 2, ["NO-XGO"], ""], +["lrocklrg-falling+3", "lrocklrg-falling+3", 2, ["NO-XGO"], ""], +["explorer-reminder-2+0", "explorer-reminder-2+0", 2, ["NO-XGO"], ""], +["explorer-reminder-2+1", "explorer-reminder-2+1", 2, ["NO-XGO"], ""], +["explorer-reminder-2+2", "explorer-reminder-2+2", 2, ["NO-XGO"], ""], +["geologist-reminder-moles+0", "geologist-reminder-moles+0", 2, ["NO-XGO"], ""], +["geologist-reminder-moles+1", "geologist-reminder-moles+1", 2, ["NO-XGO"], ""], +["geologist-reminder-moles+2", "geologist-reminder-moles+2", 2, ["NO-XGO"], ""], +["fuel-cell-victory+0", "fuel-cell-victory+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory+1", "fuel-cell-victory+1", 2, ["NO-XGO"], ""], +["minershort-reminder-1-orbs+0", "minershort-reminder-1-orbs+0", 2, ["NO-XGO"], ""], +["minershort-reminder-1-orbs+1", "minershort-reminder-1-orbs+1", 2, ["NO-XGO"], ""], +["minershort-reminder-1-orbs+2", "minershort-reminder-1-orbs+2", 2, ["NO-XGO"], ""], +["sage-village3-reminder-1-rams+0", "sage-village3-reminder-1-rams+0", 2, ["NO-XGO"], ""], +["sage-village3-reminder-1-rams+1", "sage-village3-reminder-1-rams+1", 2, ["NO-XGO"], ""], +["sage-village3-reminder-1-rams+2", "sage-village3-reminder-1-rams+2", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-flutflut+0", "assistant-village2-reminder-1-flutflut+0", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-flutflut+1", "assistant-village2-reminder-1-flutflut+1", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-flutflut+2", "assistant-village2-reminder-1-flutflut+2", 2, ["NO-XGO"], ""], +["fuel-cell-victory-2+0", "fuel-cell-victory-2+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory-2+1", "fuel-cell-victory-2+1", 2, ["NO-XGO"], ""], +["minershort-reminder-1-gnawers+0", "minershort-reminder-1-gnawers+0", 2, ["NO-XGO"], ""], +["minershort-reminder-1-gnawers+1", "minershort-reminder-1-gnawers+1", 2, ["NO-XGO"], ""], +["minershort-reminder-1-gnawers+2", "minershort-reminder-1-gnawers+2", 2, ["NO-XGO"], ""], +["gambler-resolution-money+0", "gambler-resolution-money+0", 2, ["NO-XGO"], ""], +["gambler-resolution-money+1", "gambler-resolution-money+1", 2, ["NO-XGO"], ""], +["assistant-village3-reminder+0", "assistant-village3-reminder+0", 2, ["NO-XGO"], ""], +["assistant-village3-reminder+1", "assistant-village3-reminder+1", 2, ["NO-XGO"], ""], +["assistant-village3-reminder+2", "assistant-village3-reminder+2", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+0", "sidekick-human-intro-sequence-a+0", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+1", "sidekick-human-intro-sequence-a+1", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+2", "sidekick-human-intro-sequence-a+2", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+3", "sidekick-human-intro-sequence-a+3", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+4", "sidekick-human-intro-sequence-a+4", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+5", "sidekick-human-intro-sequence-a+5", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+6", "sidekick-human-intro-sequence-a+6", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+7", "sidekick-human-intro-sequence-a+7", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+8", "sidekick-human-intro-sequence-a+8", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+9", "sidekick-human-intro-sequence-a+9", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+10", "sidekick-human-intro-sequence-a+10", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+11", "sidekick-human-intro-sequence-a+11", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+12", "sidekick-human-intro-sequence-a+12", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+13", "sidekick-human-intro-sequence-a+13", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+14", "sidekick-human-intro-sequence-a+14", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+15", "sidekick-human-intro-sequence-a+15", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+16", "sidekick-human-intro-sequence-a+16", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+17", "sidekick-human-intro-sequence-a+17", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+18", "sidekick-human-intro-sequence-a+18", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+19", "sidekick-human-intro-sequence-a+19", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+20", "sidekick-human-intro-sequence-a+20", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-a+21", "sidekick-human-intro-sequence-a+21", 2, ["NO-XGO"], ""], +["fisher-accept+0", "fisher-accept+0", 2, ["NO-XGO"], ""], +["fisher-accept+1", "fisher-accept+1", 2, ["NO-XGO"], ""], +["fisher-accept+2", "fisher-accept+2", 2, ["NO-XGO"], ""], +["fisher-accept+3", "fisher-accept+3", 2, ["NO-XGO"], ""], +["fisher-accept+4", "fisher-accept+4", 2, ["NO-XGO"], ""], +["fisher-accept+5", "fisher-accept+5", 2, ["NO-XGO"], ""], +["finalbosscam-white-eco+0", "finalbosscam-white-eco+0", 2, ["NO-XGO"], ""], +["finalbosscam-white-eco+1", "finalbosscam-white-eco+1", 2, ["NO-XGO"], ""], +["finalbosscam-white-eco+2", "finalbosscam-white-eco+2", 2, ["NO-XGO"], ""], +["farmer-resolution+0", "farmer-resolution+0", 2, ["NO-XGO"], ""], +["farmer-resolution+1", "farmer-resolution+1", 2, ["NO-XGO"], ""], +["farmer-resolution+2", "farmer-resolution+2", 2, ["NO-XGO"], ""], +["farmer-resolution+3", "farmer-resolution+3", 2, ["NO-XGO"], ""], +["assistant-reminder-1-race-bike+0", "assistant-reminder-1-race-bike+0", 2, ["NO-XGO"], ""], +["assistant-reminder-1-race-bike+1", "assistant-reminder-1-race-bike+1", 2, ["NO-XGO"], ""], +["assistant-reminder-1-race-bike+2", "assistant-reminder-1-race-bike+2", 2, ["NO-XGO"], ""], +["mayor-reminder-donation+0", "mayor-reminder-donation+0", 2, ["NO-XGO"], ""], +["mayor-reminder-donation+1", "mayor-reminder-donation+1", 2, ["NO-XGO"], ""], +["mayor-reminder-donation+2", "mayor-reminder-donation+2", 2, ["NO-XGO"], ""], +["gambler-resolution-race+0", "gambler-resolution-race+0", 2, ["NO-XGO"], ""], +["gambler-resolution-race+1", "gambler-resolution-race+1", 2, ["NO-XGO"], ""], +["gambler-resolution-race+2", "gambler-resolution-race+2", 2, ["NO-XGO"], ""], +["fuel-cell-flut-victory-1+0", "fuel-cell-flut-victory-1+0", 2, ["NO-XGO"], ""], +["fuel-cell-flut-victory-1+1", "fuel-cell-flut-victory-1+1", 2, ["NO-XGO"], ""], +["fuel-cell-victory-5+0", "fuel-cell-victory-5+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory-5+1", "fuel-cell-victory-5+1", 2, ["NO-XGO"], ""], +["sage-bluehut-reminder-1-crop-dusting+0", "sage-bluehut-reminder-1-crop-dusting+0", 2, ["NO-XGO"], ""], +["sage-bluehut-reminder-1-crop-dusting+1", "sage-bluehut-reminder-1-crop-dusting+1", 2, ["NO-XGO"], ""], +["sage-bluehut-reminder-1-crop-dusting+2", "sage-bluehut-reminder-1-crop-dusting+2", 2, ["NO-XGO"], ""], +["flying-lurker-intro+0", "flying-lurker-intro+0", 2, ["NO-XGO"], ""], +["flying-lurker-intro+1", "flying-lurker-intro+1", 2, ["NO-XGO"], ""], +["sage-reminder-1-ecorocks+0", "sage-reminder-1-ecorocks+0", 2, ["NO-XGO"], ""], +["sage-reminder-1-ecorocks+1", "sage-reminder-1-ecorocks+1", 2, ["NO-XGO"], ""], +["sage-reminder-1-ecorocks+2", "sage-reminder-1-ecorocks+2", 2, ["NO-XGO"], ""], +["sage-reminder-1-ecorocks+3", "sage-reminder-1-ecorocks+3", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-robbers+0", "assistant-village2-reminder-1-robbers+0", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-robbers+1", "assistant-village2-reminder-1-robbers+1", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-robbers+2", "assistant-village2-reminder-1-robbers+2", 2, ["NO-XGO"], ""], +["minershort-reminder-2-orbs+0", "minershort-reminder-2-orbs+0", 2, ["NO-XGO"], ""], +["minershort-reminder-2-orbs+1", "minershort-reminder-2-orbs+1", 2, ["NO-XGO"], ""], +["mayor-reminder-beams+0", "mayor-reminder-beams+0", 2, ["NO-XGO"], ""], +["mayor-reminder-beams+1", "mayor-reminder-beams+1", 2, ["NO-XGO"], ""], +["mayor-reminder-beams+2", "mayor-reminder-beams+2", 2, ["NO-XGO"], ""], +["logo-intro-2+0", "logo-intro-2+0", 2, ["NO-XGO"], ""], +["logo-intro-2+1", "logo-intro-2+1", 2, ["NO-XGO"], ""], +["logo-intro-2+2", "logo-intro-2+2", 2, ["NO-XGO"], ""], +["logo-intro-2+3", "logo-intro-2+3", 2, ["NO-XGO"], ""], +["logo-intro-2+4", "logo-intro-2+4", 2, ["NO-XGO"], ""], +["logo-intro-2+5", "logo-intro-2+5", 2, ["NO-XGO"], ""], +["logo-intro-2+6", "logo-intro-2+6", 2, ["NO-XGO"], ""], +["logo-intro-2+7", "logo-intro-2+7", 2, ["NO-XGO"], ""], +["logo-intro-2+8", "logo-intro-2+8", 2, ["NO-XGO"], ""], +["logo-intro-2+9", "logo-intro-2+9", 2, ["NO-XGO"], ""], +["logo-intro-2+10", "logo-intro-2+10", 2, ["NO-XGO"], ""], +["logo-intro-2+11", "logo-intro-2+11", 2, ["NO-XGO"], ""], +["logo-intro-2+12", "logo-intro-2+12", 2, ["NO-XGO"], ""], +["logo-intro-2+13", "logo-intro-2+13", 2, ["NO-XGO"], ""], +["logo-intro-2+14", "logo-intro-2+14", 2, ["NO-XGO"], ""], +["sage-reminder-1-generic+0", "sage-reminder-1-generic+0", 2, ["NO-XGO"], ""], +["sage-reminder-1-generic+1", "sage-reminder-1-generic+1", 2, ["NO-XGO"], ""], +["sage-reminder-1-generic+2", "sage-reminder-1-generic+2", 2, ["NO-XGO"], ""], +["bird-lady-reminder-1+0", "bird-lady-reminder-1+0", 2, ["NO-XGO"], ""], +["bird-lady-reminder-1+1", "bird-lady-reminder-1+1", 2, ["NO-XGO"], ""], +["bird-lady-reminder-1+2", "bird-lady-reminder-1+2", 2, ["NO-XGO"], ""], +["bird-lady-reminder-1+3", "bird-lady-reminder-1+3", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-room+0", "assistant-village2-reminder-1-room+0", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-room+1", "assistant-village2-reminder-1-room+1", 2, ["NO-XGO"], ""], +["assistant-village2-reminder-1-room+2", "assistant-village2-reminder-1-room+2", 2, ["NO-XGO"], ""], +["assistant-reminder-1-blue-eco-switch+0", "assistant-reminder-1-blue-eco-switch+0", 2, ["NO-XGO"], ""], +["assistant-reminder-1-blue-eco-switch+1", "assistant-reminder-1-blue-eco-switch+1", 2, ["NO-XGO"], ""], +["assistant-reminder-1-blue-eco-switch+2", "assistant-reminder-1-blue-eco-switch+2", 2, ["NO-XGO"], ""], +["logo-loop+0", "logo-loop+0", 2, ["NO-XGO"], ""], +["logo-loop+1", "logo-loop+1", 2, ["NO-XGO"], ""], +["logo-loop+2", "logo-loop+2", 2, ["NO-XGO"], ""], +["logo-loop+3", "logo-loop+3", 2, ["NO-XGO"], ""], +["logo-loop+4", "logo-loop+4", 2, ["NO-XGO"], ""], +["logo-loop+5", "logo-loop+5", 2, ["NO-XGO"], ""], +["logo-loop+6", "logo-loop+6", 2, ["NO-XGO"], ""], +["logo-loop+7", "logo-loop+7", 2, ["NO-XGO"], ""], +["logo-loop+8", "logo-loop+8", 2, ["NO-XGO"], ""], +["logo-loop+9", "logo-loop+9", 2, ["NO-XGO"], ""], +["logo-loop+10", "logo-loop+10", 2, ["NO-XGO"], ""], +["logo-loop+11", "logo-loop+11", 2, ["NO-XGO"], ""], +["logo-loop+12", "logo-loop+12", 2, ["NO-XGO"], ""], +["logo-loop+13", "logo-loop+13", 2, ["NO-XGO"], ""], +["logo-loop+14", "logo-loop+14", 2, ["NO-XGO"], ""], +["logo-loop+15", "logo-loop+15", 2, ["NO-XGO"], ""], +["logo-loop+16", "logo-loop+16", 2, ["NO-XGO"], ""], +["farmer-introduction+0", "farmer-introduction+0", 2, ["NO-XGO"], ""], +["farmer-introduction+1", "farmer-introduction+1", 2, ["NO-XGO"], ""], +["farmer-introduction+2", "farmer-introduction+2", 2, ["NO-XGO"], ""], +["farmer-introduction+3", "farmer-introduction+3", 2, ["NO-XGO"], ""], +["farmer-introduction+4", "farmer-introduction+4", 2, ["NO-XGO"], ""], +["geologist-resolution-moles+0", "geologist-resolution-moles+0", 2, ["NO-XGO"], ""], +["geologist-resolution-moles+1", "geologist-resolution-moles+1", 2, ["NO-XGO"], ""], +["geologist-resolution-moles+2", "geologist-resolution-moles+2", 2, ["NO-XGO"], ""], +["v1-in+0", "v1-in+0", 2, ["NO-XGO"], ""], +["v1-in+1", "v1-in+1", 2, ["NO-XGO"], ""], +["fuel-cell-victory-4+0", "fuel-cell-victory-4+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory-4+1", "fuel-cell-victory-4+1", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+0", "sage-introduction-ecorocks+0", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+1", "sage-introduction-ecorocks+1", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+2", "sage-introduction-ecorocks+2", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+3", "sage-introduction-ecorocks+3", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+4", "sage-introduction-ecorocks+4", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+5", "sage-introduction-ecorocks+5", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+6", "sage-introduction-ecorocks+6", 2, ["NO-XGO"], ""], +["sage-introduction-ecorocks+7", "sage-introduction-ecorocks+7", 2, ["NO-XGO"], ""], +["minershort-reminder-1-switch+0", "minershort-reminder-1-switch+0", 2, ["NO-XGO"], ""], +["minershort-reminder-1-switch+1", "minershort-reminder-1-switch+1", 2, ["NO-XGO"], ""], +["minershort-reminder-1-switch+2", "minershort-reminder-1-switch+2", 2, ["NO-XGO"], ""], +["minershort-reminder-1-switch+3", "minershort-reminder-1-switch+3", 2, ["NO-XGO"], ""], +["minershort-reminder-1-switch+4", "minershort-reminder-1-switch+4", 2, ["NO-XGO"], ""], +["logo-intro+0", "logo-intro+0", 2, ["NO-XGO"], ""], +["logo-intro+1", "logo-intro+1", 2, ["NO-XGO"], ""], +["logo-intro+2", "logo-intro+2", 2, ["NO-XGO"], ""], +["sage-reminder-2-generic+0", "sage-reminder-2-generic+0", 2, ["NO-XGO"], ""], +["sage-reminder-2-generic+1", "sage-reminder-2-generic+1", 2, ["NO-XGO"], ""], +["sage-reminder-2-generic+2", "sage-reminder-2-generic+2", 2, ["NO-XGO"], ""], +["sage-reminder-2-generic+3", "sage-reminder-2-generic+3", 2, ["NO-XGO"], ""], +["muse-victory+0", "muse-victory+0", 2, ["NO-XGO"], ""], +["muse-victory+1", "muse-victory+1", 2, ["NO-XGO"], ""], +["sage-reminder-1-misty-cannon+0", "sage-reminder-1-misty-cannon+0", 2, ["NO-XGO"], ""], +["sage-reminder-1-misty-cannon+1", "sage-reminder-1-misty-cannon+1", 2, ["NO-XGO"], ""], +["sage-reminder-1-misty-cannon+2", "sage-reminder-1-misty-cannon+2", 2, ["NO-XGO"], ""], +["sage-reminder-1-misty-cannon+3", "sage-reminder-1-misty-cannon+3", 2, ["NO-XGO"], ""], +["sage-reminder-1-misty-cannon+4", "sage-reminder-1-misty-cannon+4", 2, ["NO-XGO"], ""], +["fuel-cell-victory-7+0", "fuel-cell-victory-7+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory-7+1", "fuel-cell-victory-7+1", 2, ["NO-XGO"], ""], +["minershort-resolution-1-orbs+0", "minershort-resolution-1-orbs+0", 2, ["NO-XGO"], ""], +["minershort-resolution-1-orbs+1", "minershort-resolution-1-orbs+1", 2, ["NO-XGO"], ""], +["fuel-cell-victory-8+0", "fuel-cell-victory-8+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory-8+1", "fuel-cell-victory-8+1", 2, ["NO-XGO"], ""], +["bird-lady-reminder-2+0", "bird-lady-reminder-2+0", 2, ["NO-XGO"], ""], +["bird-lady-reminder-2+1", "bird-lady-reminder-2+1", 2, ["NO-XGO"], ""], +["bird-lady-reminder-2+2", "bird-lady-reminder-2+2", 2, ["NO-XGO"], ""], +["bird-lady-reminder-2+3", "bird-lady-reminder-2+3", 2, ["NO-XGO"], ""], +["bird-lady-reminder-2+4", "bird-lady-reminder-2+4", 2, ["NO-XGO"], ""], +["fuel-cell-victory-6+0", "fuel-cell-victory-6+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory-6+1", "fuel-cell-victory-6+1", 2, ["NO-XGO"], ""], +["fuel-cell-victory-3+0", "fuel-cell-victory-3+0", 2, ["NO-XGO"], ""], +["fuel-cell-victory-3+1", "fuel-cell-victory-3+1", 2, ["NO-XGO"], ""], +["plunger-lurker-blowup+0", "plunger-lurker-blowup+0", 2, ["NO-XGO"], ""], +["plunger-lurker-blowup+1", "plunger-lurker-blowup+1", 2, ["NO-XGO"], ""], +["plunger-lurker-blowup+2", "plunger-lurker-blowup+2", 2, ["NO-XGO"], ""], +["plunger-lurker-blowup+3", "plunger-lurker-blowup+3", 2, ["NO-XGO"], ""], +["plant-boss-main+0", "plant-boss-main+0", 2, ["NO-XGO"], ""], +["warrior-resolution+0", "warrior-resolution+0", 2, ["NO-XGO"], ""], +["warrior-resolution+1", "warrior-resolution+1", 2, ["NO-XGO"], ""], +["warrior-resolution+2", "warrior-resolution+2", 2, ["NO-XGO"], ""], +["warrior-resolution+3", "warrior-resolution+3", 2, ["NO-XGO"], ""], +["warrior-resolution+4", "warrior-resolution+4", 2, ["NO-XGO"], ""], +["warrior-resolution+5", "warrior-resolution+5", 2, ["NO-XGO"], ""], +["eichar-racer+0", "eichar-racer+0", 2, ["NO-XGO"], ""], +["mayor-resolution-donation+0", "mayor-resolution-donation+0", 2, ["NO-XGO"], ""], +["mayor-resolution-donation+1", "mayor-resolution-donation+1", 2, ["NO-XGO"], ""], +["mayor-resolution-donation+2", "mayor-resolution-donation+2", 2, ["NO-XGO"], ""], +["mayor-resolution-donation+3", "mayor-resolution-donation+3", 2, ["NO-XGO"], ""], +["mayor-resolution-donation+4", "mayor-resolution-donation+4", 2, ["NO-XGO"], ""], +["mayor-resolution-beams+0", "mayor-resolution-beams+0", 2, ["NO-XGO"], ""], +["mayor-resolution-beams+1", "mayor-resolution-beams+1", 2, ["NO-XGO"], ""], +["mayor-resolution-beams+2", "mayor-resolution-beams+2", 2, ["NO-XGO"], ""], +["mayor-resolution-beams+3", "mayor-resolution-beams+3", 2, ["NO-XGO"], ""], +["mayor-resolution-beams+4", "mayor-resolution-beams+4", 2, ["NO-XGO"], ""], +["mayor-resolution-beams+5", "mayor-resolution-beams+5", 2, ["NO-XGO"], ""], +["minershort-introduction-switch+0", "minershort-introduction-switch+0", 2, ["NO-XGO"], ""], +["minershort-introduction-switch+1", "minershort-introduction-switch+1", 2, ["NO-XGO"], ""], +["minershort-introduction-switch+2", "minershort-introduction-switch+2", 2, ["NO-XGO"], ""], +["minershort-introduction-switch+3", "minershort-introduction-switch+3", 2, ["NO-XGO"], ""], +["minershort-introduction-switch+4", "minershort-introduction-switch+4", 2, ["NO-XGO"], ""], +["minershort-introduction-switch+5", "minershort-introduction-switch+5", 2, ["NO-XGO"], ""], +["minershort-introduction-switch+6", "minershort-introduction-switch+6", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1+0", "fishermans-boat-ride-to-village1+0", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1+1", "fishermans-boat-ride-to-village1+1", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1+2", "fishermans-boat-ride-to-village1+2", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-misty+0", "fishermans-boat-ride-to-misty+0", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-misty+1", "fishermans-boat-ride-to-misty+1", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-misty+2", "fishermans-boat-ride-to-misty+2", 2, ["NO-XGO"], ""], +["sage-bluehut-reminder-1-prec-arm+0", "sage-bluehut-reminder-1-prec-arm+0", 2, ["NO-XGO"], ""], +["sage-bluehut-reminder-1-prec-arm+1", "sage-bluehut-reminder-1-prec-arm+1", 2, ["NO-XGO"], ""], +["sage-bluehut-reminder-1-prec-arm+2", "sage-bluehut-reminder-1-prec-arm+2", 2, ["NO-XGO"], ""], +["sage-bluehut-reminder-1-prec-arm+3", "sage-bluehut-reminder-1-prec-arm+3", 2, ["NO-XGO"], ""], +["ndi-intro+0", "ndi-intro+0", 2, ["NO-XGO"], ""], +["ndi-intro+1", "ndi-intro+1", 2, ["NO-XGO"], ""], +["ndi-intro+2", "ndi-intro+2", 2, ["NO-XGO"], ""], +["ndi-intro+3", "ndi-intro+3", 2, ["NO-XGO"], ""], +["gondola-ride-down+0", "gondola-ride-down+0", 2, ["NO-XGO"], ""], +["gondola-ride-down+1", "gondola-ride-down+1", 2, ["NO-XGO"], ""], +["gondola-ride-down+2", "gondola-ride-down+2", 2, ["NO-XGO"], ""], +["gondola-ride-up+0", "gondola-ride-up+0", 2, ["NO-XGO"], ""], +["gondola-ride-up+1", "gondola-ride-up+1", 2, ["NO-XGO"], ""], +["gondola-ride-up+2", "gondola-ride-up+2", 2, ["NO-XGO"], ""], +["sage-village3-introduction-rams+0", "sage-village3-introduction-rams+0", 2, ["NO-XGO"], ""], +["sage-village3-introduction-rams+1", "sage-village3-introduction-rams+1", 2, ["NO-XGO"], ""], +["sage-village3-introduction-rams+2", "sage-village3-introduction-rams+2", 2, ["NO-XGO"], ""], +["sage-village3-introduction-rams+3", "sage-village3-introduction-rams+3", 2, ["NO-XGO"], ""], +["sage-village3-introduction-rams+4", "sage-village3-introduction-rams+4", 2, ["NO-XGO"], ""], +["sage-village3-introduction-rams+5", "sage-village3-introduction-rams+5", 2, ["NO-XGO"], ""], +["yellowsage-resolution+0", "yellowsage-resolution+0", 2, ["NO-XGO"], ""], +["yellowsage-resolution+1", "yellowsage-resolution+1", 2, ["NO-XGO"], ""], +["yellowsage-resolution+2", "yellowsage-resolution+2", 2, ["NO-XGO"], ""], +["yellowsage-resolution+3", "yellowsage-resolution+3", 2, ["NO-XGO"], ""], +["yellowsage-resolution+4", "yellowsage-resolution+4", 2, ["NO-XGO"], ""], +["yellowsage-resolution+5", "yellowsage-resolution+5", 2, ["NO-XGO"], ""], +["eichar-flut+0", "eichar-flut+0", 2, ["NO-XGO"], ""], +["green-sagecage-daxter-sacrifice+0", "green-sagecage-daxter-sacrifice+0", 2, ["NO-XGO"], ""], +["green-sagecage-daxter-sacrifice+1", "green-sagecage-daxter-sacrifice+1", 2, ["NO-XGO"], ""], +["green-sagecage-daxter-sacrifice+2", "green-sagecage-daxter-sacrifice+2", 2, ["NO-XGO"], ""], +["green-sagecage-daxter-sacrifice+3", "green-sagecage-daxter-sacrifice+3", 2, ["NO-XGO"], ""], +["green-sagecage-daxter-sacrifice+4", "green-sagecage-daxter-sacrifice+4", 2, ["NO-XGO"], ""], +["green-sagecage-daxter-sacrifice+5", "green-sagecage-daxter-sacrifice+5", 2, ["NO-XGO"], ""], +["explorer-reminder-1+0", "explorer-reminder-1+0", 2, ["NO-XGO"], ""], +["explorer-reminder-1+1", "explorer-reminder-1+1", 2, ["NO-XGO"], ""], +["explorer-reminder-1+2", "explorer-reminder-1+2", 2, ["NO-XGO"], ""], +["explorer-reminder-1+3", "explorer-reminder-1+3", 2, ["NO-XGO"], ""], +["explorer-reminder-1+4", "explorer-reminder-1+4", 2, ["NO-XGO"], ""], +["sculptor-resolution+0", "sculptor-resolution+0", 2, ["NO-XGO"], ""], +["sculptor-resolution+1", "sculptor-resolution+1", 2, ["NO-XGO"], ""], +["sculptor-resolution+2", "sculptor-resolution+2", 2, ["NO-XGO"], ""], +["sculptor-resolution+3", "sculptor-resolution+3", 2, ["NO-XGO"], ""], +["fisher-resolution+0", "fisher-resolution+0", 2, ["NO-XGO"], ""], +["fisher-resolution+1", "fisher-resolution+1", 2, ["NO-XGO"], ""], +["fisher-resolution+2", "fisher-resolution+2", 2, ["NO-XGO"], ""], +["fisher-resolution+3", "fisher-resolution+3", 2, ["NO-XGO"], ""], +["sidekick-human-intro-test+0", "sidekick-human-intro-test+0", 2, ["NO-XGO"], ""], +["sidekick-human-intro-test+1", "sidekick-human-intro-test+1", 2, ["NO-XGO"], ""], +["sidekick-human-intro-test+2", "sidekick-human-intro-test+2", 2, ["NO-XGO"], ""], +["sidekick-human-intro-test+3", "sidekick-human-intro-test+3", 2, ["NO-XGO"], ""], +["sidekick-human-intro-test+4", "sidekick-human-intro-test+4", 2, ["NO-XGO"], ""], +["sidekick-human-intro-test+5", "sidekick-human-intro-test+5", 2, ["NO-XGO"], ""], +["gambler-introduction-1+0", "gambler-introduction-1+0", 2, ["NO-XGO"], ""], +["gambler-introduction-1+1", "gambler-introduction-1+1", 2, ["NO-XGO"], ""], +["gambler-introduction-1+2", "gambler-introduction-1+2", 2, ["NO-XGO"], ""], +["gambler-introduction-1+3", "gambler-introduction-1+3", 2, ["NO-XGO"], ""], +["gambler-introduction-1+4", "gambler-introduction-1+4", 2, ["NO-XGO"], ""], +["gambler-introduction-1+5", "gambler-introduction-1+5", 2, ["NO-XGO"], ""], +["gambler-introduction-1+6", "gambler-introduction-1+6", 2, ["NO-XGO"], ""], +["gambler-introduction-1+7", "gambler-introduction-1+7", 2, ["NO-XGO"], ""], +["gambler-introduction-1+8", "gambler-introduction-1+8", 2, ["NO-XGO"], ""], +["explorer-resolution+0", "explorer-resolution+0", 2, ["NO-XGO"], ""], +["explorer-resolution+1", "explorer-resolution+1", 2, ["NO-XGO"], ""], +["explorer-resolution+2", "explorer-resolution+2", 2, ["NO-XGO"], ""], +["explorer-resolution+3", "explorer-resolution+3", 2, ["NO-XGO"], ""], +["explorer-resolution+4", "explorer-resolution+4", 2, ["NO-XGO"], ""], +["minershort-resolution-2-orbs+0", "minershort-resolution-2-orbs+0", 2, ["NO-XGO"], ""], +["minershort-resolution-2-orbs+1", "minershort-resolution-2-orbs+1", 2, ["NO-XGO"], ""], +["minershort-resolution-2-orbs+2", "minershort-resolution-2-orbs+2", 2, ["NO-XGO"], ""], +["minershort-resolution-2-orbs+3", "minershort-resolution-2-orbs+3", 2, ["NO-XGO"], ""], +["minershort-resolution-2-orbs+4", "minershort-resolution-2-orbs+4", 2, ["NO-XGO"], ""], +["minershort-resolution-2-orbs+5", "minershort-resolution-2-orbs+5", 2, ["NO-XGO"], ""], +["assistant-introduction-race-bike+0", "assistant-introduction-race-bike+0", 2, ["NO-XGO"], ""], +["assistant-introduction-race-bike+1", "assistant-introduction-race-bike+1", 2, ["NO-XGO"], ""], +["assistant-introduction-race-bike+2", "assistant-introduction-race-bike+2", 2, ["NO-XGO"], ""], +["assistant-introduction-race-bike+3", "assistant-introduction-race-bike+3", 2, ["NO-XGO"], ""], +["assistant-introduction-race-bike+4", "assistant-introduction-race-bike+4", 2, ["NO-XGO"], ""], +["assistant-introduction-race-bike+5", "assistant-introduction-race-bike+5", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-enough-cells+0", "green-sagecage-outro-beat-boss-enough-cells+0", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-enough-cells+1", "green-sagecage-outro-beat-boss-enough-cells+1", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-enough-cells+2", "green-sagecage-outro-beat-boss-enough-cells+2", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-enough-cells+3", "green-sagecage-outro-beat-boss-enough-cells+3", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-enough-cells+4", "green-sagecage-outro-beat-boss-enough-cells+4", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-enough-cells+5", "green-sagecage-outro-beat-boss-enough-cells+5", 2, ["NO-XGO"], ""], +["billy-introduction+0", "billy-introduction+0", 2, ["NO-XGO"], ""], +["billy-introduction+1", "billy-introduction+1", 2, ["NO-XGO"], ""], +["billy-introduction+2", "billy-introduction+2", 2, ["NO-XGO"], ""], +["billy-introduction+3", "billy-introduction+3", 2, ["NO-XGO"], ""], +["billy-introduction+4", "billy-introduction+4", 2, ["NO-XGO"], ""], +["billy-introduction+5", "billy-introduction+5", 2, ["NO-XGO"], ""], +["billy-introduction+6", "billy-introduction+6", 2, ["NO-XGO"], ""], +["billy-introduction+7", "billy-introduction+7", 2, ["NO-XGO"], ""], +["billy-introduction+8", "billy-introduction+8", 2, ["NO-XGO"], ""], +["billy-introduction+9", "billy-introduction+9", 2, ["NO-XGO"], ""], +["billy-introduction+10", "billy-introduction+10", 2, ["NO-XGO"], ""], +["billy-introduction+11", "billy-introduction+11", 2, ["NO-XGO"], ""], +["billy-introduction+12", "billy-introduction+12", 2, ["NO-XGO"], ""], +["billy-introduction+13", "billy-introduction+13", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+0", "green-sagecage-outro-beat-boss-need-cells+0", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+1", "green-sagecage-outro-beat-boss-need-cells+1", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+2", "green-sagecage-outro-beat-boss-need-cells+2", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+3", "green-sagecage-outro-beat-boss-need-cells+3", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+4", "green-sagecage-outro-beat-boss-need-cells+4", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+5", "green-sagecage-outro-beat-boss-need-cells+5", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+6", "green-sagecage-outro-beat-boss-need-cells+6", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-need-cells+7", "green-sagecage-outro-beat-boss-need-cells+7", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-robbers+0", "assistant-village2-introduction-robbers+0", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-robbers+1", "assistant-village2-introduction-robbers+1", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-robbers+2", "assistant-village2-introduction-robbers+2", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-robbers+3", "assistant-village2-introduction-robbers+3", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-robbers+4", "assistant-village2-introduction-robbers+4", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-robbers+5", "assistant-village2-introduction-robbers+5", 2, ["NO-XGO"], ""], +["green-sagecage-outro-big-finish+0", "green-sagecage-outro-big-finish+0", 2, ["NO-XGO"], ""], +["green-sagecage-outro-big-finish+1", "green-sagecage-outro-big-finish+1", 2, ["NO-XGO"], ""], +["green-sagecage-outro-big-finish+2", "green-sagecage-outro-big-finish+2", 2, ["NO-XGO"], ""], +["green-sagecage-outro-big-finish+3", "green-sagecage-outro-big-finish+3", 2, ["NO-XGO"], ""], +["green-sagecage-outro-big-finish+4", "green-sagecage-outro-big-finish+4", 2, ["NO-XGO"], ""], +["green-sagecage-outro-big-finish+5", "green-sagecage-outro-big-finish+5", 2, ["NO-XGO"], ""], +["green-sagecage-outro-big-finish+6", "green-sagecage-outro-big-finish+6", 2, ["NO-XGO"], ""], +["redsage-resolution+0", "redsage-resolution+0", 2, ["NO-XGO"], ""], +["redsage-resolution+1", "redsage-resolution+1", 2, ["NO-XGO"], ""], +["redsage-resolution+2", "redsage-resolution+2", 2, ["NO-XGO"], ""], +["redsage-resolution+3", "redsage-resolution+3", 2, ["NO-XGO"], ""], +["redsage-resolution+4", "redsage-resolution+4", 2, ["NO-XGO"], ""], +["redsage-resolution+5", "redsage-resolution+5", 2, ["NO-XGO"], ""], +["redsage-resolution+6", "redsage-resolution+6", 2, ["NO-XGO"], ""], +["redsage-resolution+7", "redsage-resolution+7", 2, ["NO-XGO"], ""], +["redsage-resolution+8", "redsage-resolution+8", 2, ["NO-XGO"], ""], +["bluesage-resolution+0", "bluesage-resolution+0", 2, ["NO-XGO"], ""], +["bluesage-resolution+1", "bluesage-resolution+1", 2, ["NO-XGO"], ""], +["bluesage-resolution+2", "bluesage-resolution+2", 2, ["NO-XGO"], ""], +["bluesage-resolution+3", "bluesage-resolution+3", 2, ["NO-XGO"], ""], +["bluesage-resolution+4", "bluesage-resolution+4", 2, ["NO-XGO"], ""], +["bluesage-resolution+5", "bluesage-resolution+5", 2, ["NO-XGO"], ""], +["bluesage-resolution+6", "bluesage-resolution+6", 2, ["NO-XGO"], ""], +["bluesage-resolution+7", "bluesage-resolution+7", 2, ["NO-XGO"], ""], +["bluesage-resolution+8", "bluesage-resolution+8", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+0", "sage-bluehut-introduction-prec-arm+0", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+1", "sage-bluehut-introduction-prec-arm+1", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+2", "sage-bluehut-introduction-prec-arm+2", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+3", "sage-bluehut-introduction-prec-arm+3", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+4", "sage-bluehut-introduction-prec-arm+4", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+5", "sage-bluehut-introduction-prec-arm+5", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+6", "sage-bluehut-introduction-prec-arm+6", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-prec-arm+7", "sage-bluehut-introduction-prec-arm+7", 2, ["NO-XGO"], ""], +["evilbro-misty-end+0", "evilbro-misty-end+0", 2, ["NO-XGO"], ""], +["evilbro-misty-end+1", "evilbro-misty-end+1", 2, ["NO-XGO"], ""], +["evilbro-misty-end+2", "evilbro-misty-end+2", 2, ["NO-XGO"], ""], +["evilbro-misty-end+3", "evilbro-misty-end+3", 2, ["NO-XGO"], ""], +["evilbro-misty-end+4", "evilbro-misty-end+4", 2, ["NO-XGO"], ""], +["evilbro-misty-end+5", "evilbro-misty-end+5", 2, ["NO-XGO"], ""], +["evilbro-misty-end+6", "evilbro-misty-end+6", 2, ["NO-XGO"], ""], +["evilbro-misty-end+7", "evilbro-misty-end+7", 2, ["NO-XGO"], ""], +["evilbro-misty-end+8", "evilbro-misty-end+8", 2, ["NO-XGO"], ""], +["assistant-village2-resolution+0", "assistant-village2-resolution+0", 2, ["NO-XGO"], ""], +["assistant-village2-resolution+1", "assistant-village2-resolution+1", 2, ["NO-XGO"], ""], +["assistant-village2-resolution+2", "assistant-village2-resolution+2", 2, ["NO-XGO"], ""], +["assistant-village2-resolution+3", "assistant-village2-resolution+3", 2, ["NO-XGO"], ""], +["assistant-village2-resolution+4", "assistant-village2-resolution+4", 2, ["NO-XGO"], ""], +["assistant-village2-resolution+5", "assistant-village2-resolution+5", 2, ["NO-XGO"], ""], +["assistant-village2-resolution+6", "assistant-village2-resolution+6", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+0", "sage-introduction-misty-cannon+0", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+1", "sage-introduction-misty-cannon+1", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+2", "sage-introduction-misty-cannon+2", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+3", "sage-introduction-misty-cannon+3", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+4", "sage-introduction-misty-cannon+4", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+5", "sage-introduction-misty-cannon+5", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+6", "sage-introduction-misty-cannon+6", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+7", "sage-introduction-misty-cannon+7", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+8", "sage-introduction-misty-cannon+8", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+9", "sage-introduction-misty-cannon+9", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+10", "sage-introduction-misty-cannon+10", 2, ["NO-XGO"], ""], +["sage-introduction-misty-cannon+11", "sage-introduction-misty-cannon+11", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+0", "minershort-introduction-gnawers+0", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+1", "minershort-introduction-gnawers+1", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+2", "minershort-introduction-gnawers+2", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+3", "minershort-introduction-gnawers+3", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+4", "minershort-introduction-gnawers+4", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+5", "minershort-introduction-gnawers+5", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+6", "minershort-introduction-gnawers+6", 2, ["NO-XGO"], ""], +["minershort-introduction-gnawers+7", "minershort-introduction-gnawers+7", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+0", "green-sagecage-outro-beat-boss-a+0", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+1", "green-sagecage-outro-beat-boss-a+1", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+2", "green-sagecage-outro-beat-boss-a+2", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+3", "green-sagecage-outro-beat-boss-a+3", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+4", "green-sagecage-outro-beat-boss-a+4", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+5", "green-sagecage-outro-beat-boss-a+5", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+6", "green-sagecage-outro-beat-boss-a+6", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-a+7", "green-sagecage-outro-beat-boss-a+7", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+0", "green-sagecage-introduction+0", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+1", "green-sagecage-introduction+1", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+2", "green-sagecage-introduction+2", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+3", "green-sagecage-introduction+3", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+4", "green-sagecage-introduction+4", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+5", "green-sagecage-introduction+5", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+6", "green-sagecage-introduction+6", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+7", "green-sagecage-introduction+7", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+8", "green-sagecage-introduction+8", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+9", "green-sagecage-introduction+9", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+10", "green-sagecage-introduction+10", 2, ["NO-XGO"], ""], +["green-sagecage-introduction+11", "green-sagecage-introduction+11", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+0", "sage-intro-sequence-e+0", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+1", "sage-intro-sequence-e+1", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+2", "sage-intro-sequence-e+2", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+3", "sage-intro-sequence-e+3", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+4", "sage-intro-sequence-e+4", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+5", "sage-intro-sequence-e+5", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+6", "sage-intro-sequence-e+6", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+7", "sage-intro-sequence-e+7", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+8", "sage-intro-sequence-e+8", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+9", "sage-intro-sequence-e+9", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+10", "sage-intro-sequence-e+10", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+11", "sage-intro-sequence-e+11", 2, ["NO-XGO"], ""], +["sage-intro-sequence-e+12", "sage-intro-sequence-e+12", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+0", "sage-village3-introduction-dark-eco+0", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+1", "sage-village3-introduction-dark-eco+1", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+2", "sage-village3-introduction-dark-eco+2", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+3", "sage-village3-introduction-dark-eco+3", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+4", "sage-village3-introduction-dark-eco+4", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+5", "sage-village3-introduction-dark-eco+5", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+6", "sage-village3-introduction-dark-eco+6", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+7", "sage-village3-introduction-dark-eco+7", 2, ["NO-XGO"], ""], +["sage-village3-introduction-dark-eco+8", "sage-village3-introduction-dark-eco+8", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+0", "assistant-firecanyon-resolution+0", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+1", "assistant-firecanyon-resolution+1", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+2", "assistant-firecanyon-resolution+2", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+3", "assistant-firecanyon-resolution+3", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+4", "assistant-firecanyon-resolution+4", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+5", "assistant-firecanyon-resolution+5", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+6", "assistant-firecanyon-resolution+6", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+7", "assistant-firecanyon-resolution+7", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+8", "assistant-firecanyon-resolution+8", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+9", "assistant-firecanyon-resolution+9", 2, ["NO-XGO"], ""], +["assistant-firecanyon-resolution+10", "assistant-firecanyon-resolution+10", 2, ["NO-XGO"], ""], +["explorer-introduction+0", "explorer-introduction+0", 2, ["NO-XGO"], ""], +["explorer-introduction+1", "explorer-introduction+1", 2, ["NO-XGO"], ""], +["explorer-introduction+2", "explorer-introduction+2", 2, ["NO-XGO"], ""], +["explorer-introduction+3", "explorer-introduction+3", 2, ["NO-XGO"], ""], +["explorer-introduction+4", "explorer-introduction+4", 2, ["NO-XGO"], ""], +["explorer-introduction+5", "explorer-introduction+5", 2, ["NO-XGO"], ""], +["explorer-introduction+6", "explorer-introduction+6", 2, ["NO-XGO"], ""], +["explorer-introduction+7", "explorer-introduction+7", 2, ["NO-XGO"], ""], +["explorer-introduction+8", "explorer-introduction+8", 2, ["NO-XGO"], ""], +["explorer-introduction+9", "explorer-introduction+9", 2, ["NO-XGO"], ""], +["explorer-introduction+10", "explorer-introduction+10", 2, ["NO-XGO"], ""], +["bird-lady-introduction+0", "bird-lady-introduction+0", 2, ["NO-XGO"], ""], +["bird-lady-introduction+1", "bird-lady-introduction+1", 2, ["NO-XGO"], ""], +["bird-lady-introduction+2", "bird-lady-introduction+2", 2, ["NO-XGO"], ""], +["bird-lady-introduction+3", "bird-lady-introduction+3", 2, ["NO-XGO"], ""], +["bird-lady-introduction+4", "bird-lady-introduction+4", 2, ["NO-XGO"], ""], +["bird-lady-introduction+5", "bird-lady-introduction+5", 2, ["NO-XGO"], ""], +["bird-lady-introduction+6", "bird-lady-introduction+6", 2, ["NO-XGO"], ""], +["bird-lady-introduction+7", "bird-lady-introduction+7", 2, ["NO-XGO"], ""], +["bird-lady-introduction+8", "bird-lady-introduction+8", 2, ["NO-XGO"], ""], +["bird-lady-introduction+9", "bird-lady-introduction+9", 2, ["NO-XGO"], ""], +["bird-lady-introduction+10", "bird-lady-introduction+10", 2, ["NO-XGO"], ""], +["fisher-introduction+0", "fisher-introduction+0", 2, ["NO-XGO"], ""], +["fisher-introduction+1", "fisher-introduction+1", 2, ["NO-XGO"], ""], +["fisher-introduction+2", "fisher-introduction+2", 2, ["NO-XGO"], ""], +["fisher-introduction+3", "fisher-introduction+3", 2, ["NO-XGO"], ""], +["fisher-introduction+4", "fisher-introduction+4", 2, ["NO-XGO"], ""], +["fisher-introduction+5", "fisher-introduction+5", 2, ["NO-XGO"], ""], +["fisher-introduction+6", "fisher-introduction+6", 2, ["NO-XGO"], ""], +["fisher-introduction+7", "fisher-introduction+7", 2, ["NO-XGO"], ""], +["fisher-introduction+8", "fisher-introduction+8", 2, ["NO-XGO"], ""], +["mayor-introduction+0", "mayor-introduction+0", 2, ["NO-XGO"], ""], +["mayor-introduction+1", "mayor-introduction+1", 2, ["NO-XGO"], ""], +["mayor-introduction+2", "mayor-introduction+2", 2, ["NO-XGO"], ""], +["mayor-introduction+3", "mayor-introduction+3", 2, ["NO-XGO"], ""], +["mayor-introduction+4", "mayor-introduction+4", 2, ["NO-XGO"], ""], +["mayor-introduction+5", "mayor-introduction+5", 2, ["NO-XGO"], ""], +["mayor-introduction+6", "mayor-introduction+6", 2, ["NO-XGO"], ""], +["mayor-introduction+7", "mayor-introduction+7", 2, ["NO-XGO"], ""], +["mayor-introduction+8", "mayor-introduction+8", 2, ["NO-XGO"], ""], +["mayor-introduction+9", "mayor-introduction+9", 2, ["NO-XGO"], ""], +["mayor-introduction+10", "mayor-introduction+10", 2, ["NO-XGO"], ""], +["mayor-introduction+11", "mayor-introduction+11", 2, ["NO-XGO"], ""], +["mayor-introduction+12", "mayor-introduction+12", 2, ["NO-XGO"], ""], +["mayor-introduction+13", "mayor-introduction+13", 2, ["NO-XGO"], ""], +["mayor-introduction+14", "mayor-introduction+14", 2, ["NO-XGO"], ""], +["mayor-introduction+15", "mayor-introduction+15", 2, ["NO-XGO"], ""], +["sculptor-introduction+0", "sculptor-introduction+0", 2, ["NO-XGO"], ""], +["sculptor-introduction+1", "sculptor-introduction+1", 2, ["NO-XGO"], ""], +["sculptor-introduction+2", "sculptor-introduction+2", 2, ["NO-XGO"], ""], +["sculptor-introduction+3", "sculptor-introduction+3", 2, ["NO-XGO"], ""], +["sculptor-introduction+4", "sculptor-introduction+4", 2, ["NO-XGO"], ""], +["sculptor-introduction+5", "sculptor-introduction+5", 2, ["NO-XGO"], ""], +["sculptor-introduction+6", "sculptor-introduction+6", 2, ["NO-XGO"], ""], +["sculptor-introduction+7", "sculptor-introduction+7", 2, ["NO-XGO"], ""], +["sculptor-introduction+8", "sculptor-introduction+8", 2, ["NO-XGO"], ""], +["sculptor-introduction+9", "sculptor-introduction+9", 2, ["NO-XGO"], ""], +["sculptor-introduction+10", "sculptor-introduction+10", 2, ["NO-XGO"], ""], +["sculptor-introduction+11", "sculptor-introduction+11", 2, ["NO-XGO"], ""], +["sculptor-introduction+12", "sculptor-introduction+12", 2, ["NO-XGO"], ""], +["sculptor-introduction+13", "sculptor-introduction+13", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+0", "assistant-village2-introduction-flutflut+0", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+1", "assistant-village2-introduction-flutflut+1", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+2", "assistant-village2-introduction-flutflut+2", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+3", "assistant-village2-introduction-flutflut+3", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+4", "assistant-village2-introduction-flutflut+4", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+5", "assistant-village2-introduction-flutflut+5", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+6", "assistant-village2-introduction-flutflut+6", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-flutflut+7", "assistant-village2-introduction-flutflut+7", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+0", "assistant-lavatube-end-resolution+0", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+1", "assistant-lavatube-end-resolution+1", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+2", "assistant-lavatube-end-resolution+2", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+3", "assistant-lavatube-end-resolution+3", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+4", "assistant-lavatube-end-resolution+4", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+5", "assistant-lavatube-end-resolution+5", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+6", "assistant-lavatube-end-resolution+6", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+7", "assistant-lavatube-end-resolution+7", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+8", "assistant-lavatube-end-resolution+8", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+9", "assistant-lavatube-end-resolution+9", 2, ["NO-XGO"], ""], +["assistant-lavatube-end-resolution+10", "assistant-lavatube-end-resolution+10", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+0", "assistant-lavatube-start-resolution+0", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+1", "assistant-lavatube-start-resolution+1", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+2", "assistant-lavatube-start-resolution+2", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+3", "assistant-lavatube-start-resolution+3", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+4", "assistant-lavatube-start-resolution+4", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+5", "assistant-lavatube-start-resolution+5", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+6", "assistant-lavatube-start-resolution+6", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+7", "assistant-lavatube-start-resolution+7", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+8", "assistant-lavatube-start-resolution+8", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+9", "assistant-lavatube-start-resolution+9", 2, ["NO-XGO"], ""], +["assistant-lavatube-start-resolution+10", "assistant-lavatube-start-resolution+10", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+0", "assistant-village2-introduction-room+0", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+1", "assistant-village2-introduction-room+1", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+2", "assistant-village2-introduction-room+2", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+3", "assistant-village2-introduction-room+3", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+4", "assistant-village2-introduction-room+4", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+5", "assistant-village2-introduction-room+5", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+6", "assistant-village2-introduction-room+6", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+7", "assistant-village2-introduction-room+7", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+8", "assistant-village2-introduction-room+8", 2, ["NO-XGO"], ""], +["assistant-village2-introduction-room+9", "assistant-village2-introduction-room+9", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+0", "green-sagecage-resolution+0", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+1", "green-sagecage-resolution+1", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+2", "green-sagecage-resolution+2", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+3", "green-sagecage-resolution+3", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+4", "green-sagecage-resolution+4", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+5", "green-sagecage-resolution+5", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+6", "green-sagecage-resolution+6", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+7", "green-sagecage-resolution+7", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+8", "green-sagecage-resolution+8", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+9", "green-sagecage-resolution+9", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+10", "green-sagecage-resolution+10", 2, ["NO-XGO"], ""], +["green-sagecage-resolution+11", "green-sagecage-resolution+11", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+0", "sage-bluehut-introduction-crop-dusting+0", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+1", "sage-bluehut-introduction-crop-dusting+1", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+2", "sage-bluehut-introduction-crop-dusting+2", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+3", "sage-bluehut-introduction-crop-dusting+3", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+4", "sage-bluehut-introduction-crop-dusting+4", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+5", "sage-bluehut-introduction-crop-dusting+5", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+6", "sage-bluehut-introduction-crop-dusting+6", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+7", "sage-bluehut-introduction-crop-dusting+7", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+8", "sage-bluehut-introduction-crop-dusting+8", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+9", "sage-bluehut-introduction-crop-dusting+9", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+10", "sage-bluehut-introduction-crop-dusting+10", 2, ["NO-XGO"], ""], +["sage-bluehut-introduction-crop-dusting+11", "sage-bluehut-introduction-crop-dusting+11", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+0", "sidekick-human-intro-sequence-b+0", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+1", "sidekick-human-intro-sequence-b+1", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+2", "sidekick-human-intro-sequence-b+2", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+3", "sidekick-human-intro-sequence-b+3", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+4", "sidekick-human-intro-sequence-b+4", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+5", "sidekick-human-intro-sequence-b+5", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+6", "sidekick-human-intro-sequence-b+6", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+7", "sidekick-human-intro-sequence-b+7", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+8", "sidekick-human-intro-sequence-b+8", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+9", "sidekick-human-intro-sequence-b+9", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-b+10", "sidekick-human-intro-sequence-b+10", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+0", "assistant-introduction-blue-eco-switch+0", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+1", "assistant-introduction-blue-eco-switch+1", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+2", "assistant-introduction-blue-eco-switch+2", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+3", "assistant-introduction-blue-eco-switch+3", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+4", "assistant-introduction-blue-eco-switch+4", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+5", "assistant-introduction-blue-eco-switch+5", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+6", "assistant-introduction-blue-eco-switch+6", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+7", "assistant-introduction-blue-eco-switch+7", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+8", "assistant-introduction-blue-eco-switch+8", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+9", "assistant-introduction-blue-eco-switch+9", 2, ["NO-XGO"], ""], +["assistant-introduction-blue-eco-switch+10", "assistant-introduction-blue-eco-switch+10", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+0", "bird-lady-beach-resolution+0", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+1", "bird-lady-beach-resolution+1", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+2", "bird-lady-beach-resolution+2", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+3", "bird-lady-beach-resolution+3", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+4", "bird-lady-beach-resolution+4", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+5", "bird-lady-beach-resolution+5", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+6", "bird-lady-beach-resolution+6", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+7", "bird-lady-beach-resolution+7", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+8", "bird-lady-beach-resolution+8", 2, ["NO-XGO"], ""], +["bird-lady-beach-resolution+9", "bird-lady-beach-resolution+9", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+0", "fishermans-boat-ride-to-village1-alt+0", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+1", "fishermans-boat-ride-to-village1-alt+1", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+2", "fishermans-boat-ride-to-village1-alt+2", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+3", "fishermans-boat-ride-to-village1-alt+3", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+4", "fishermans-boat-ride-to-village1-alt+4", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+5", "fishermans-boat-ride-to-village1-alt+5", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+6", "fishermans-boat-ride-to-village1-alt+6", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+7", "fishermans-boat-ride-to-village1-alt+7", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+8", "fishermans-boat-ride-to-village1-alt+8", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+9", "fishermans-boat-ride-to-village1-alt+9", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+10", "fishermans-boat-ride-to-village1-alt+10", 2, ["NO-XGO"], ""], +["fishermans-boat-ride-to-village1-alt+11", "fishermans-boat-ride-to-village1-alt+11", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+0", "assistant-village2-introduction+0", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+1", "assistant-village2-introduction+1", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+2", "assistant-village2-introduction+2", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+3", "assistant-village2-introduction+3", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+4", "assistant-village2-introduction+4", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+5", "assistant-village2-introduction+5", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+6", "assistant-village2-introduction+6", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+7", "assistant-village2-introduction+7", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+8", "assistant-village2-introduction+8", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+9", "assistant-village2-introduction+9", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+10", "assistant-village2-introduction+10", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+11", "assistant-village2-introduction+11", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+12", "assistant-village2-introduction+12", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+13", "assistant-village2-introduction+13", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+14", "assistant-village2-introduction+14", 2, ["NO-XGO"], ""], +["assistant-village2-introduction+15", "assistant-village2-introduction+15", 2, ["NO-XGO"], ""], +["geologist-introduction+0", "geologist-introduction+0", 2, ["NO-XGO"], ""], +["geologist-introduction+1", "geologist-introduction+1", 2, ["NO-XGO"], ""], +["geologist-introduction+2", "geologist-introduction+2", 2, ["NO-XGO"], ""], +["geologist-introduction+3", "geologist-introduction+3", 2, ["NO-XGO"], ""], +["geologist-introduction+4", "geologist-introduction+4", 2, ["NO-XGO"], ""], +["geologist-introduction+5", "geologist-introduction+5", 2, ["NO-XGO"], ""], +["geologist-introduction+6", "geologist-introduction+6", 2, ["NO-XGO"], ""], +["geologist-introduction+7", "geologist-introduction+7", 2, ["NO-XGO"], ""], +["geologist-introduction+8", "geologist-introduction+8", 2, ["NO-XGO"], ""], +["geologist-introduction+9", "geologist-introduction+9", 2, ["NO-XGO"], ""], +["geologist-introduction+10", "geologist-introduction+10", 2, ["NO-XGO"], ""], +["geologist-introduction+11", "geologist-introduction+11", 2, ["NO-XGO"], ""], +["geologist-introduction+12", "geologist-introduction+12", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+0", "sage-intro-sequence-d1+0", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+1", "sage-intro-sequence-d1+1", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+2", "sage-intro-sequence-d1+2", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+3", "sage-intro-sequence-d1+3", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+4", "sage-intro-sequence-d1+4", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+5", "sage-intro-sequence-d1+5", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+6", "sage-intro-sequence-d1+6", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+7", "sage-intro-sequence-d1+7", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+8", "sage-intro-sequence-d1+8", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+9", "sage-intro-sequence-d1+9", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+10", "sage-intro-sequence-d1+10", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+11", "sage-intro-sequence-d1+11", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+12", "sage-intro-sequence-d1+12", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+13", "sage-intro-sequence-d1+13", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+14", "sage-intro-sequence-d1+14", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+15", "sage-intro-sequence-d1+15", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d1+16", "sage-intro-sequence-d1+16", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+0", "sage-intro-sequence-a+0", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+1", "sage-intro-sequence-a+1", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+2", "sage-intro-sequence-a+2", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+3", "sage-intro-sequence-a+3", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+4", "sage-intro-sequence-a+4", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+5", "sage-intro-sequence-a+5", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+6", "sage-intro-sequence-a+6", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+7", "sage-intro-sequence-a+7", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+8", "sage-intro-sequence-a+8", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+9", "sage-intro-sequence-a+9", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+10", "sage-intro-sequence-a+10", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+11", "sage-intro-sequence-a+11", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+12", "sage-intro-sequence-a+12", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+13", "sage-intro-sequence-a+13", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+14", "sage-intro-sequence-a+14", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+15", "sage-intro-sequence-a+15", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+16", "sage-intro-sequence-a+16", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+17", "sage-intro-sequence-a+17", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+18", "sage-intro-sequence-a+18", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+19", "sage-intro-sequence-a+19", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+20", "sage-intro-sequence-a+20", 2, ["NO-XGO"], ""], +["sage-intro-sequence-a+21", "sage-intro-sequence-a+21", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+0", "sidekick-human-intro-sequence-c+0", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+1", "sidekick-human-intro-sequence-c+1", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+2", "sidekick-human-intro-sequence-c+2", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+3", "sidekick-human-intro-sequence-c+3", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+4", "sidekick-human-intro-sequence-c+4", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+5", "sidekick-human-intro-sequence-c+5", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+6", "sidekick-human-intro-sequence-c+6", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+7", "sidekick-human-intro-sequence-c+7", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+8", "sidekick-human-intro-sequence-c+8", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+9", "sidekick-human-intro-sequence-c+9", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+10", "sidekick-human-intro-sequence-c+10", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+11", "sidekick-human-intro-sequence-c+11", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+12", "sidekick-human-intro-sequence-c+12", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+13", "sidekick-human-intro-sequence-c+13", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+14", "sidekick-human-intro-sequence-c+14", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+15", "sidekick-human-intro-sequence-c+15", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+16", "sidekick-human-intro-sequence-c+16", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+17", "sidekick-human-intro-sequence-c+17", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+18", "sidekick-human-intro-sequence-c+18", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+19", "sidekick-human-intro-sequence-c+19", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+20", "sidekick-human-intro-sequence-c+20", 2, ["NO-XGO"], ""], +["sidekick-human-intro-sequence-c+21", "sidekick-human-intro-sequence-c+21", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+0", "minershort-introduction-orbs+0", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+1", "minershort-introduction-orbs+1", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+2", "minershort-introduction-orbs+2", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+3", "minershort-introduction-orbs+3", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+4", "minershort-introduction-orbs+4", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+5", "minershort-introduction-orbs+5", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+6", "minershort-introduction-orbs+6", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+7", "minershort-introduction-orbs+7", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+8", "minershort-introduction-orbs+8", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+9", "minershort-introduction-orbs+9", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+10", "minershort-introduction-orbs+10", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+11", "minershort-introduction-orbs+11", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+12", "minershort-introduction-orbs+12", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+13", "minershort-introduction-orbs+13", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+14", "minershort-introduction-orbs+14", 2, ["NO-XGO"], ""], +["minershort-introduction-orbs+15", "minershort-introduction-orbs+15", 2, ["NO-XGO"], ""], +["warrior-introduction+0", "warrior-introduction+0", 2, ["NO-XGO"], ""], +["warrior-introduction+1", "warrior-introduction+1", 2, ["NO-XGO"], ""], +["warrior-introduction+2", "warrior-introduction+2", 2, ["NO-XGO"], ""], +["warrior-introduction+3", "warrior-introduction+3", 2, ["NO-XGO"], ""], +["warrior-introduction+4", "warrior-introduction+4", 2, ["NO-XGO"], ""], +["warrior-introduction+5", "warrior-introduction+5", 2, ["NO-XGO"], ""], +["warrior-introduction+6", "warrior-introduction+6", 2, ["NO-XGO"], ""], +["warrior-introduction+7", "warrior-introduction+7", 2, ["NO-XGO"], ""], +["warrior-introduction+8", "warrior-introduction+8", 2, ["NO-XGO"], ""], +["warrior-introduction+9", "warrior-introduction+9", 2, ["NO-XGO"], ""], +["warrior-introduction+10", "warrior-introduction+10", 2, ["NO-XGO"], ""], +["warrior-introduction+11", "warrior-introduction+11", 2, ["NO-XGO"], ""], +["warrior-introduction+12", "warrior-introduction+12", 2, ["NO-XGO"], ""], +["warrior-introduction+13", "warrior-introduction+13", 2, ["NO-XGO"], ""], +["warrior-introduction+14", "warrior-introduction+14", 2, ["NO-XGO"], ""], +["warrior-introduction+15", "warrior-introduction+15", 2, ["NO-XGO"], ""], +["warrior-introduction+16", "warrior-introduction+16", 2, ["NO-XGO"], ""], +["warrior-introduction+17", "warrior-introduction+17", 2, ["NO-XGO"], ""], +["warrior-introduction+18", "warrior-introduction+18", 2, ["NO-XGO"], ""], +["warrior-introduction+19", "warrior-introduction+19", 2, ["NO-XGO"], ""], +["warrior-introduction+20", "warrior-introduction+20", 2, ["NO-XGO"], ""], +["warrior-introduction+21", "warrior-introduction+21", 2, ["NO-XGO"], ""], +["warrior-introduction+22", "warrior-introduction+22", 2, ["NO-XGO"], ""], +["warrior-introduction+23", "warrior-introduction+23", 2, ["NO-XGO"], ""], +["warrior-introduction+24", "warrior-introduction+24", 2, ["NO-XGO"], ""], +["warrior-introduction+25", "warrior-introduction+25", 2, ["NO-XGO"], ""], +["warrior-introduction+26", "warrior-introduction+26", 2, ["NO-XGO"], ""], +["warrior-introduction+27", "warrior-introduction+27", 2, ["NO-XGO"], ""], +["warrior-introduction+28", "warrior-introduction+28", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+0", "sage-intro-sequence-d2+0", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+1", "sage-intro-sequence-d2+1", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+2", "sage-intro-sequence-d2+2", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+3", "sage-intro-sequence-d2+3", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+4", "sage-intro-sequence-d2+4", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+5", "sage-intro-sequence-d2+5", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+6", "sage-intro-sequence-d2+6", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+7", "sage-intro-sequence-d2+7", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+8", "sage-intro-sequence-d2+8", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+9", "sage-intro-sequence-d2+9", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+10", "sage-intro-sequence-d2+10", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+11", "sage-intro-sequence-d2+11", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+12", "sage-intro-sequence-d2+12", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+13", "sage-intro-sequence-d2+13", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+14", "sage-intro-sequence-d2+14", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+15", "sage-intro-sequence-d2+15", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+16", "sage-intro-sequence-d2+16", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+17", "sage-intro-sequence-d2+17", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+18", "sage-intro-sequence-d2+18", 2, ["NO-XGO"], ""], +["sage-intro-sequence-d2+19", "sage-intro-sequence-d2+19", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+0", "green-sagecage-outro-preboss+0", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+1", "green-sagecage-outro-preboss+1", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+2", "green-sagecage-outro-preboss+2", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+3", "green-sagecage-outro-preboss+3", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+4", "green-sagecage-outro-preboss+4", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+5", "green-sagecage-outro-preboss+5", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+6", "green-sagecage-outro-preboss+6", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+7", "green-sagecage-outro-preboss+7", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+8", "green-sagecage-outro-preboss+8", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+9", "green-sagecage-outro-preboss+9", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+10", "green-sagecage-outro-preboss+10", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+11", "green-sagecage-outro-preboss+11", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+12", "green-sagecage-outro-preboss+12", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+13", "green-sagecage-outro-preboss+13", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+14", "green-sagecage-outro-preboss+14", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+15", "green-sagecage-outro-preboss+15", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+16", "green-sagecage-outro-preboss+16", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+17", "green-sagecage-outro-preboss+17", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+18", "green-sagecage-outro-preboss+18", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+19", "green-sagecage-outro-preboss+19", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+20", "green-sagecage-outro-preboss+20", 2, ["NO-XGO"], ""], +["green-sagecage-outro-preboss+21", "green-sagecage-outro-preboss+21", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+0", "green-sagecage-outro-beat-boss-b+0", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+1", "green-sagecage-outro-beat-boss-b+1", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+2", "green-sagecage-outro-beat-boss-b+2", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+3", "green-sagecage-outro-beat-boss-b+3", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+4", "green-sagecage-outro-beat-boss-b+4", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+5", "green-sagecage-outro-beat-boss-b+5", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+6", "green-sagecage-outro-beat-boss-b+6", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+7", "green-sagecage-outro-beat-boss-b+7", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+8", "green-sagecage-outro-beat-boss-b+8", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+9", "green-sagecage-outro-beat-boss-b+9", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+10", "green-sagecage-outro-beat-boss-b+10", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+11", "green-sagecage-outro-beat-boss-b+11", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+12", "green-sagecage-outro-beat-boss-b+12", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+13", "green-sagecage-outro-beat-boss-b+13", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+14", "green-sagecage-outro-beat-boss-b+14", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+15", "green-sagecage-outro-beat-boss-b+15", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+16", "green-sagecage-outro-beat-boss-b+16", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+17", "green-sagecage-outro-beat-boss-b+17", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+18", "green-sagecage-outro-beat-boss-b+18", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+19", "green-sagecage-outro-beat-boss-b+19", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+20", "green-sagecage-outro-beat-boss-b+20", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+21", "green-sagecage-outro-beat-boss-b+21", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+22", "green-sagecage-outro-beat-boss-b+22", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+23", "green-sagecage-outro-beat-boss-b+23", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+24", "green-sagecage-outro-beat-boss-b+24", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+25", "green-sagecage-outro-beat-boss-b+25", 2, ["NO-XGO"], ""], +["green-sagecage-outro-beat-boss-b+26", "green-sagecage-outro-beat-boss-b+26", 2, ["NO-XGO"], ""], +["sage-village3-introduction+0", "sage-village3-introduction+0", 2, ["NO-XGO"], ""], +["sage-village3-introduction+1", "sage-village3-introduction+1", 2, ["NO-XGO"], ""], +["sage-village3-introduction+2", "sage-village3-introduction+2", 2, ["NO-XGO"], ""], +["sage-village3-introduction+3", "sage-village3-introduction+3", 2, ["NO-XGO"], ""], +["sage-village3-introduction+4", "sage-village3-introduction+4", 2, ["NO-XGO"], ""], +["sage-village3-introduction+5", "sage-village3-introduction+5", 2, ["NO-XGO"], ""], +["sage-village3-introduction+6", "sage-village3-introduction+6", 2, ["NO-XGO"], ""], +["sage-village3-introduction+7", "sage-village3-introduction+7", 2, ["NO-XGO"], ""], +["sage-village3-introduction+8", "sage-village3-introduction+8", 2, ["NO-XGO"], ""], +["sage-village3-introduction+9", "sage-village3-introduction+9", 2, ["NO-XGO"], ""], +["sage-village3-introduction+10", "sage-village3-introduction+10", 2, ["NO-XGO"], ""], +["sage-village3-introduction+11", "sage-village3-introduction+11", 2, ["NO-XGO"], ""], +["sage-village3-introduction+12", "sage-village3-introduction+12", 2, ["NO-XGO"], ""], +["sage-village3-introduction+13", "sage-village3-introduction+13", 2, ["NO-XGO"], ""], +["sage-village3-introduction+14", "sage-village3-introduction+14", 2, ["NO-XGO"], ""], +["sage-village3-introduction+15", "sage-village3-introduction+15", 2, ["NO-XGO"], ""], +["sage-village3-introduction+16", "sage-village3-introduction+16", 2, ["NO-XGO"], ""], +["sage-village3-introduction+17", "sage-village3-introduction+17", 2, ["NO-XGO"], ""], +["sage-village3-introduction+18", "sage-village3-introduction+18", 2, ["NO-XGO"], ""], +["sage-village3-introduction+19", "sage-village3-introduction+19", 2, ["NO-XGO"], ""], +["sage-village3-introduction+20", "sage-village3-introduction+20", 2, ["NO-XGO"], ""], +["sage-village3-introduction+21", "sage-village3-introduction+21", 2, ["NO-XGO"], ""], +["sage-village3-introduction+22", "sage-village3-introduction+22", 2, ["NO-XGO"], ""], +["sage-village3-introduction+23", "sage-village3-introduction+23", 2, ["NO-XGO"], ""], +["sage-village3-introduction+24", "sage-village3-introduction+24", 2, ["NO-XGO"], ""], +["sage-village3-introduction+25", "sage-village3-introduction+25", 2, ["NO-XGO"], ""], +["sage-village3-introduction+26", "sage-village3-introduction+26", 2, ["NO-XGO"], ""], +["sage-village3-introduction+27", "sage-village3-introduction+27", 2, ["NO-XGO"], ""], +["sage-village3-introduction+28", "sage-village3-introduction+28", 2, ["NO-XGO"], ""], +["sage-village3-introduction+29", "sage-village3-introduction+29", 2, ["NO-XGO"], ""], +["sage-village3-introduction+30", "sage-village3-introduction+30", 2, ["NO-XGO"], ""], +["sage-village3-introduction+31", "sage-village3-introduction+31", 2, ["NO-XGO"], ""], +["sage-village3-introduction+32", "sage-village3-introduction+32", 2, ["NO-XGO"], ""], +["sage-village3-introduction+33", "sage-village3-introduction+33", 2, ["NO-XGO"], ""], +["sage-village3-introduction+34", "sage-village3-introduction+34", 2, ["NO-XGO"], ""], +["sage-village3-introduction+35", "sage-village3-introduction+35", 2, ["NO-XGO"], ""], +["sage-village3-introduction+36", "sage-village3-introduction+36", 2, ["NO-XGO"], ""], +["sage-village3-introduction+37", "sage-village3-introduction+37", 2, ["NO-XGO"], ""], +["sage-village3-introduction+38", "sage-village3-introduction+38", 2, ["NO-XGO"], ""], +["sage-village3-introduction+39", "sage-village3-introduction+39", 2, ["NO-XGO"], ""], +["sage-village3-introduction+40", "sage-village3-introduction+40", 2, ["NO-XGO"], ""], +["sage-village3-introduction+41", "sage-village3-introduction+41", 2, ["NO-XGO"], ""], +["sage-village3-introduction+42", "sage-village3-introduction+42", 2, ["NO-XGO"], ""], +["sage-village3-introduction+43", "sage-village3-introduction+43", 2, ["NO-XGO"], ""], +["sage-village3-introduction+44", "sage-village3-introduction+44", 2, ["NO-XGO"], ""], +["sage-village3-introduction+45", "sage-village3-introduction+45", 2, ["NO-XGO"], ""], +["sage-village3-introduction+46", "sage-village3-introduction+46", 2, ["NO-XGO"], ""], +["sage-village3-introduction+47", "sage-village3-introduction+47", 2, ["NO-XGO"], ""], +["sage-village3-introduction+48", "sage-village3-introduction+48", 2, ["NO-XGO"], ""], +["sage-village3-introduction+49", "sage-village3-introduction+49", 2, ["NO-XGO"], ""], +["sage-village3-introduction+50", "sage-village3-introduction+50", 2, ["NO-XGO"], ""], +["sage-village3-introduction+51", "sage-village3-introduction+51", 2, ["NO-XGO"], ""], +["sage-village3-introduction+52", "sage-village3-introduction+52", 2, ["NO-XGO"], ""], +["sage-village3-introduction+53", "sage-village3-introduction+53", 2, ["NO-XGO"], ""], +["sage-village3-introduction+54", "sage-village3-introduction+54", 2, ["NO-XGO"], ""], +["sage-village3-introduction+55", "sage-village3-introduction+55", 2, ["NO-XGO"], ""], +["sage-village3-introduction+56", "sage-village3-introduction+56", 2, ["NO-XGO"], ""], +["sage-village3-introduction+57", "sage-village3-introduction+57", 2, ["NO-XGO"], ""]] diff --git a/goal_src/build/game_dgos.gc b/goal_src/build/game_dgos.gc deleted file mode 100644 index f0846b0af4..0000000000 --- a/goal_src/build/game_dgos.gc +++ /dev/null @@ -1,1908 +0,0 @@ -;; DGO File Listing -;; This file lists the object files found in each CGO/DGO and will be used to build DGO/CGO files. - -;; Each entry contains the CGO/DGO name, followed by a list of objects. Each object is a pair of filename, dgo-name. -;; The file name is used to find the file in data/, and the dgo name is what goes into the DGO itself. -;; This order is _not_ the compile order, but the order the files are placed in the CGO/DGO and loaded - -;; The naming scheme for filenames works like this: -;; start with the dgo name -;; if an "art-group", append -ag (many art groups have the same name as code for thing they contain art for) -;; if multiple objects with the same name exist, but different data, append names of DGOs that each are found in. -;; if v3, extension of object file is .o, otherwise .go -;; this gets us unique names for all unique objects. There is no case of two objects with the same data and same name. -;; (note that the "-ag" trick is required for this to work!) - -;; Example: "fisher-ag.go", v4, art group. Only one version exists. -;; Example: "fisher-JUNGLE-L1.o", v3, not art group. Multiple versions exist, this one is for JUNGLE.CGO and L1.CGO - -("ART.CGO" - ("dir-tpages.go" "dir-tpages") - ("tpage-463.go" "tpage-463") - ("tpage-2.go" "tpage-2") - ("tpage-880.go" "tpage-880") - ("tpage-256.go" "tpage-256") - ("tpage-1278.go" "tpage-1278") - ("texture-upload.o" "texture-upload") - ("tpage-1032.go" "tpage-1032") - ("tpage-62.go" "tpage-62") - ("tpage-1532.go" "tpage-1532") - ("fuel-cell-ag.go" "fuel-cell") - ("money-ag.go" "money") - ("buzzer-ag.go" "buzzer") - ("ecovalve-ag.go" "ecovalve") - ("crate-ag.go" "crate") - ("speaker-ag.go" "speaker") - ("fuelcell-naked-ag.go" "fuelcell-naked") - ("eichar-ag.go" "eichar") - ("sidekick-ag.go" "sidekick") - ("deathcam-ag.go" "deathcam") - ("game-cnt.go" "game-cnt") - ) - -("BEA.DGO" - ("mistycannon.o" "mistycannon") - ("babak-with-cannon.o" "babak-with-cannon") - ("air-h.o" "air-h") - ("air.o" "air") - ("wobbler.o" "wobbler") - ("twister.o" "twister") - ("beach-obs.o" "beach-obs") - ("bird-lady.o" "bird-lady") - ("bird-lady-beach.o" "bird-lady-beach") - ("mayor.o" "mayor") - ("sculptor.o" "sculptor") - ("pelican.o" "pelican") - ("lurkerworm.o" "lurkerworm") - ("lurkercrab.o" "lurkercrab") - ("lurkerpuppy.o" "lurkerpuppy") - ("beach-rocks.o" "beach-rocks") - ("seagull.o" "seagull") - ("beach-part.o" "beach-part") - ("tpage-212.go" "tpage-212") - ("tpage-214.go" "tpage-214") - ("tpage-213.go" "tpage-213") - ("tpage-215.go" "tpage-215") - ("babak-ag.go" "babak") - ("barrel-ag.go" "barrel") - ("beachcam-ag.go" "beachcam") - ("bird-lady-ag.go" "bird-lady") - ("bird-lady-beach-ag.go" "bird-lady-beach") - ("bladeassm-ag.go" "bladeassm") - ("ecovalve-ag.go" "ecovalve") - ("ecoventrock-ag.go" "ecoventrock") - ("flutflut-ag.go" "flutflut") - ("flutflutegg-ag.go" "flutflutegg") - ("grottopole-ag.go" "grottopole") - ("harvester-ag.go" "harvester") - ("kickrock-ag.go" "kickrock") - ("lrocklrg-ag.go" "lrocklrg") - ("lurkercrab-ag.go" "lurkercrab") - ("lurkerpuppy-ag.go" "lurkerpuppy") - ("lurkerworm-ag.go" "lurkerworm") - ("mayor-ag.go" "mayor") - ("mistycannon-ag.go" "mistycannon") - ("orb-cache-top-ag.go" "orb-cache-top") - ("pelican-ag.go" "pelican") - ("sack-ag.go" "sack") - ("sculptor-ag.go" "sculptor") - ("sculptor-muse-ag.go" "sculptor-muse") - ("seagull-ag.go" "seagull") - ("sharkey-ag.go" "sharkey") - ("windmill-one-ag.go" "windmill-one") - ("beach-vis.go" "beach-vis") - ) - -("CIT.DGO" - ("villagep-obs.o" "villagep-obs") - ("oracle.o" "oracle") - ("battlecontroller.o" "battlecontroller") - ("citadel-part.o" "citadel-part") - ("citadel-obs.o" "citadel-obs") - ("citb-plat.o" "citb-plat") - ("citadel-sages.o" "citadel-sages") - ("snow-bunny.o" "snow-bunny") - ("citb-bunny.o" "citb-bunny") - ("citb-drop-plat.o" "citb-drop-plat") - ("assistant-citadel.o" "assistant-citadel") - ("tpage-1415.go" "tpage-1415") - ("tpage-1417.go" "tpage-1417") - ("tpage-1416.go" "tpage-1416") - ("tpage-1414.go" "tpage-1414") - ("assistant-lavatube-end-ag.go" "assistant-lavatube-end") - ("babak-ag.go" "babak") - ("bluesage-ag.go" "bluesage") - ("citadelcam-ag.go" "citadelcam") - ("citb-arm-ag.go" "citb-arm") - ("citb-arm-shoulder-ag.go" "citb-arm-shoulder") - ("citb-bunny-ag.go" "citb-bunny") - ("citb-button-ag.go" "citb-button") - ("citb-chain-plat-ag.go" "citb-chain-plat") - ("citb-chains-ag.go" "citb-chains") - ("citb-coil-ag.go" "citb-coil") - ("citb-disc-ag.go" "citb-disc") - ("citb-donut-ag.go" "citb-donut") - ("citb-drop-plat-ag.go" "citb-drop-plat") - ("citb-exit-plat-ag.go" "citb-exit-plat") - ("citb-firehose-ag.go" "citb-firehose") - ("citb-generator-ag.go" "citb-generator") - ("citb-hose-ag.go" "citb-hose") - ("citb-iris-door-ag.go" "citb-iris-door") - ("citb-launcher-ag.go" "citb-launcher") - ("citb-robotboss-ag.go" "citb-robotboss") - ("citb-rotatebox-ag.go" "citb-rotatebox") - ("citb-sagecage-ag.go" "citb-sagecage") - ("citb-stopbox-ag.go" "citb-stopbox") - ("ecovalve-ag.go" "ecovalve") - ("evilbro-citadel-ag.go" "evilbro-citadel") - ("evilsis-citadel-ag.go" "evilsis-citadel") - ("green-sagecage-ag.go" "green-sagecage") - ("orb-cache-top-ag.go" "orb-cache-top") - ("plat-citb-ag.go" "plat-citb") - ("plat-eco-citb-ag.go" "plat-eco-citb") - ("redsage-ag.go" "redsage") - ("warp-gate-switch-ag.go" "warp-gate-switch") - ("warpgate-ag.go" "warpgate") - ("yellowsage-ag.go" "yellowsage") - ("citadel-vis.go" "citadel-vis") - ) - -("COMMON.CGO" - ("rigid-body-h.o" "rigid-body-h") - ("water-anim.o" "water-anim") - ("dark-eco-pool.o" "dark-eco-pool") - ("rigid-body.o" "rigid-body") - ("nav-enemy-h.o" "nav-enemy-h") - ("nav-enemy.o" "nav-enemy") - ("baseplat.o" "baseplat") - ("basebutton.o" "basebutton") - ("tippy.o" "tippy") - ("joint-exploder.o" "joint-exploder") - ("babak.o" "babak") - ("sharkey.o" "sharkey") - ("orb-cache.o" "orb-cache") - ("plat.o" "plat") - ("plat-button.o" "plat-button") - ("plat-eco.o" "plat-eco") - ("ropebridge.o" "ropebridge") - ("ticky.o" "ticky") - ) - -("DAR.DGO" - ("darkcave-obs.o" "darkcave-obs") - ("tpage-1306.go" "tpage-1306") - ("tpage-1307.go" "tpage-1307") - ("tpage-1305.go" "tpage-1305") - ("tpage-1304.go" "tpage-1304") - ("tpage-1352.go" "tpage-1352") - ("baby-spider-ag.go" "baby-spider") - ("cavecrystal-ag.go" "cavecrystal") - ("caveelevator-ag.go" "caveelevator") - ("cavespatula-darkcave-ag.go" "cavespatula-darkcave") - ("cavetrapdoor-ag.go" "cavetrapdoor") - ("dark-crystal-ag.go" "dark-crystal") - ("mother-spider-ag.go" "mother-spider") - ("spider-egg-ag.go" "spider-egg") - ("water-anim-darkcave-ag.go" "water-anim-darkcave") - ("darkcave-vis.go" "darkcave-vis") - ) - -("DEM.DGO" - ("demo-obs.o" "demo-obs") - ("tpage-1485.go" "tpage-1485") - ("tpage-1486.go" "tpage-1486") - ("tpage-1487.go" "tpage-1487") - ("tpage-1599.go" "tpage-1599") - ("tpage-1600.go" "tpage-1600") - ("tpage-1601.go" "tpage-1601") - ("tpage-1602.go" "tpage-1602") - ("tpage-1603.go" "tpage-1603") - ("tpage-1604.go" "tpage-1604") - ("tpage-1605.go" "tpage-1605") - ("tpage-1606.go" "tpage-1606") - ("tpage-1607.go" "tpage-1607") - ("static-screen.o" "static-screen") - ("tpage-1480.go" "tpage-1480") - ("tpage-1479.go" "tpage-1479") - ("demo-vis.go" "demo-vis") - ) - -("ENGINE.CGO" - ("types-h.o" "types-h") - ("vu1-macros.o" "vu1-macros") - - ;; the "math" section - ("math.o" "math") - ("vector-h.o" "vector-h") - ("gravity-h.o" "gravity-h") - ("bounding-box-h.o" "bounding-box-h") - ("matrix-h.o" "matrix-h") - ("quaternion-h.o" "quaternion-h") - ("euler-h.o" "euler-h") - ("transform-h.o" "transform-h") - ("geometry-h.o" "geometry-h") - ("trigonometry-h.o" "trigonometry-h") - ("transformq-h.o" "transformq-h") - ("bounding-box.o" "bounding-box") - ("matrix.o" "matrix") - ("transform.o" "transform") - ("quaternion.o" "quaternion") - ("euler.o" "euler") - ("geometry.o" "geometry") - ("trigonometry.o" "trigonometry") - - - ("gsound-h.o" "gsound-h") - ("timer-h.o" "timer-h") - ("timer.o" "timer") - ("vif-h.o" "vif-h") - ("dma-h.o" "dma-h") - ("video-h.o" "video-h") - ("vu1-user-h.o" "vu1-user-h") - ("dma.o" "dma") - ("dma-buffer.o" "dma-buffer") - ("dma-bucket.o" "dma-bucket") - ("dma-disasm.o" "dma-disasm") - ("pckernel-h.o" "pckernel-h") ;; added - ("pad.o" "pad") - ("gs.o" "gs") - ("display-h.o" "display-h") - ("vector.o" "vector") - ("file-io.o" "file-io") - ("loader-h.o" "loader-h") - ("texture-h.o" "texture-h") - ("level-h.o" "level-h") - ("math-camera-h.o" "math-camera-h") - ("math-camera.o" "math-camera") - ("font-h.o" "font-h") - ("decomp-h.o" "decomp-h") - ("display.o" "display") - ("connect.o" "connect") - ("text-h.o" "text-h") - ("settings-h.o" "settings-h") - ("capture.o" "capture") - ("memory-usage-h.o" "memory-usage-h") - ("texture.o" "texture") - ("main-h.o" "main-h") - ("mspace-h.o" "mspace-h") - ("drawable-h.o" "drawable-h") - ("drawable-group-h.o" "drawable-group-h") - ("drawable-inline-array-h.o" "drawable-inline-array-h") - ("draw-node-h.o" "draw-node-h") - ("drawable-tree-h.o" "drawable-tree-h") - ("drawable-actor-h.o" "drawable-actor-h") - ("drawable-ambient-h.o" "drawable-ambient-h") - ("game-task-h.o" "game-task-h") - ("hint-control-h.o" "hint-control-h") - ("generic-h.o" "generic-h") - ("lights-h.o" "lights-h") - ("ocean-h.o" "ocean-h") - ("ocean-trans-tables.o" "ocean-trans-tables") - ("ocean-tables.o" "ocean-tables") - ("ocean-frames.o" "ocean-frames") - ("sky-h.o" "sky-h") - ("mood-h.o" "mood-h") - ("time-of-day-h.o" "time-of-day-h") - ("art-h.o" "art-h") - ("generic-vu1-h.o" "generic-vu1-h") - ("merc-h.o" "merc-h") - ("generic-merc-h.o" "generic-merc-h") - ("generic-tie-h.o" "generic-tie-h") - ("generic-work-h.o" "generic-work-h") - ("shadow-cpu-h.o" "shadow-cpu-h") - ("shadow-vu1-h.o" "shadow-vu1-h") - ("memcard-h.o" "memcard-h") - ("game-info-h.o" "game-info-h") - ("wind-h.o" "wind-h") - ("prototype-h.o" "prototype-h") - ("joint-h.o" "joint-h") - ("bones-h.o" "bones-h") - ("engines.o" "engines") - ("res-h.o" "res-h") - ("res.o" "res") - ("lights.o" "lights") - ("dynamics-h.o" "dynamics-h") - ("surface-h.o" "surface-h") - ("pat-h.o" "pat-h") - ("fact-h.o" "fact-h") - ("aligner-h.o" "aligner-h") - ("game-h.o" "game-h") - ("generic-obs-h.o" "generic-obs-h") - ("pov-camera-h.o" "pov-camera-h") - ("sync-info-h.o" "sync-info-h") - ("smush-control-h.o" "smush-control-h") - ("trajectory-h.o" "trajectory-h") - ("debug-h.o" "debug-h") - ("joint-mod-h.o" "joint-mod-h") - ("collide-func-h.o" "collide-func-h") - ("collide-mesh-h.o" "collide-mesh-h") - ("collide-shape-h.o" "collide-shape-h") - ("collide-target-h.o" "collide-target-h") - ("collide-touch-h.o" "collide-touch-h") - ("collide-edge-grab-h.o" "collide-edge-grab-h") - ("process-drawable-h.o" "process-drawable-h") - ("effect-control-h.o" "effect-control-h") - ("collide-frag-h.o" "collide-frag-h") - ("projectiles-h.o" "projectiles-h") - ("target-h.o" "target-h") - ("depth-cue-h.o" "depth-cue-h") - ("stats-h.o" "stats-h") - ("bsp-h.o" "bsp-h") - ("collide-cache-h.o" "collide-cache-h") - ("collide-h.o" "collide-h") - ("shrubbery-h.o" "shrubbery-h") - ("tie-h.o" "tie-h") - ("tfrag-h.o" "tfrag-h") - ("background-h.o" "background-h") - ("subdivide-h.o" "subdivide-h") - ("entity-h.o" "entity-h") - ("sprite-h.o" "sprite-h") - ("shadow-h.o" "shadow-h") - ("eye-h.o" "eye-h") - ("sparticle-launcher-h.o" "sparticle-launcher-h") - ("sparticle-h.o" "sparticle-h") - ("actor-link-h.o" "actor-link-h") - ("camera-h.o" "camera-h") - ("cam-debug-h.o" "cam-debug-h") - ("cam-interface-h.o" "cam-interface-h") - ("cam-update-h.o" "cam-update-h") - ("assert-h.o" "assert-h") - ("hud-h.o" "hud-h") - ("progress-h.o" "progress-h") - ("rpc-h.o" "rpc-h") - ("path-h.o" "path-h") - ("navigate-h.o" "navigate-h") - ("load-dgo.o" "load-dgo") - ("ramdisk.o" "ramdisk") - ("gsound.o" "gsound") - ("transformq.o" "transformq") - ("collide-func.o" "collide-func") - ("joint.o" "joint") - ("cylinder.o" "cylinder") - ("wind.o" "wind") - ("bsp.o" "bsp") - ("subdivide.o" "subdivide") - ("sprite.o" "sprite") - ("sprite-distort.o" "sprite-distort") - ("debug-sphere.o" "debug-sphere") - ("debug.o" "debug") - ("merc-vu1.o" "merc-vu1") - ("merc-blend-shape.o" "merc-blend-shape") - ("merc.o" "merc") - ("ripple.o" "ripple") - ("bones.o" "bones") - ("generic-vu0.o" "generic-vu0") - ("generic.o" "generic") - ("generic-vu1.o" "generic-vu1") - ("generic-effect.o" "generic-effect") - ("generic-merc.o" "generic-merc") - ("generic-tie.o" "generic-tie") - ("shadow-cpu.o" "shadow-cpu") - ("shadow-vu1.o" "shadow-vu1") - ("depth-cue.o" "depth-cue") - ("font.o" "font") - ("decomp.o" "decomp") - ("background.o" "background") - ("draw-node.o" "draw-node") - ("shrubbery.o" "shrubbery") - ("shrub-work.o" "shrub-work") - ("tfrag-near.o" "tfrag-near") - ("tfrag.o" "tfrag") - ("tfrag-methods.o" "tfrag-methods") - ("tfrag-work.o" "tfrag-work") - ("tie.o" "tie") - ("tie-near.o" "tie-near") - ("tie-work.o" "tie-work") - ("tie-methods.o" "tie-methods") - ("sync-info.o" "sync-info") - ("trajectory.o" "trajectory") - ("sparticle-launcher.o" "sparticle-launcher") - ("sparticle.o" "sparticle") - ("entity-table.o" "entity-table") - ("loader.o" "loader") - ("task-control-h.o" "task-control-h") - ("game-info.o" "game-info") - ("game-save.o" "game-save") - ("settings.o" "settings") - ("pckernel.o" "pckernel") ;; added - ("mood-tables.o" "mood-tables") - ("mood.o" "mood") - ("weather-part.o" "weather-part") - ("time-of-day.o" "time-of-day") - ("sky-utils.o" "sky-utils") - ("sky.o" "sky") - ("sky-tng.o" "sky-tng") - ("load-boundary-h.o" "load-boundary-h") - ("load-boundary.o" "load-boundary") - ("load-boundary-data.o" "load-boundary-data") - ("level-info.o" "level-info") - ("level.o" "level") - ("text.o" "text") - ("subtitle.o" "subtitle") ;; added - ("collide-probe.o" "collide-probe") - ("collide-frag.o" "collide-frag") - ("collide-mesh.o" "collide-mesh") - ("collide-touch.o" "collide-touch") - ("collide-edge-grab.o" "collide-edge-grab") - ("collide-shape.o" "collide-shape") - ("collide-shape-rider.o" "collide-shape-rider") - ("collide.o" "collide") - ("collide-planes.o" "collide-planes") - ("merc-death.o" "merc-death") - ("water-h.o" "water-h") - ("camera.o" "camera") - ("cam-interface.o" "cam-interface") - ("cam-master.o" "cam-master") - ("cam-states.o" "cam-states") - ("cam-states-dbg.o" "cam-states-dbg") - ("cam-combiner.o" "cam-combiner") - ("cam-update.o" "cam-update") - ("vol-h.o" "vol-h") - ("cam-layout.o" "cam-layout") - ("cam-debug.o" "cam-debug") - ("cam-start.o" "cam-start") - ("process-drawable.o" "process-drawable") - ("hint-control.o" "hint-control") - ("ambient.o" "ambient") - ("assert.o" "assert") - ("generic-obs.o" "generic-obs") - ("target-util.o" "target-util") - ("target-part.o" "target-part") - ("collide-reaction-target.o" "collide-reaction-target") - ("logic-target.o" "logic-target") - ("sidekick.o" "sidekick") - ("voicebox.o" "voicebox") - ("target-handler.o" "target-handler") - ("target.o" "target") - ("target2.o" "target2") - ("target-death.o" "target-death") - ("menu.o" "menu") - ("drawable.o" "drawable") - ("drawable-group.o" "drawable-group") - ("drawable-inline-array.o" "drawable-inline-array") - ("drawable-tree.o" "drawable-tree") - ("prototype.o" "prototype") - ("main-collide.o" "main-collide") - ("video.o" "video") - ("main.o" "main") - ("collide-cache.o" "collide-cache") - ("relocate.o" "relocate") - ("memory-usage.o" "memory-usage") - ("entity.o" "entity") - ("path.o" "path") - ("vol.o" "vol") - ("navigate.o" "navigate") - ("aligner.o" "aligner") - ("effect-control.o" "effect-control") - ("water.o" "water") - ("collectables-part.o" "collectables-part") - ("collectables.o" "collectables") - ("task-control.o" "task-control") - ("process-taskable.o" "process-taskable") - ("pov-camera.o" "pov-camera") - ("powerups.o" "powerups") - ("crates.o" "crates") - ("hud.o" "hud") - ("hud-classes.o" "hud-classes") - ("progress-static.o" "progress-static") - ("progress-part.o" "progress-part") - ("progress-draw.o" "progress-draw") - ("progress.o" "progress") - ("credits.o" "credits") - ("projectiles.o" "projectiles") - ("ocean.o" "ocean") - ("ocean-vu0.o" "ocean-vu0") - ("ocean-texture.o" "ocean-texture") - ("ocean-mid.o" "ocean-mid") - ("ocean-transition.o" "ocean-transition") - ("ocean-near.o" "ocean-near") - ("shadow.o" "shadow") - ("eye.o" "eye") - ("glist-h.o" "glist-h") - ("glist.o" "glist") - ("anim-tester.o" "anim-tester") - ("viewer.o" "viewer") - ("part-tester.o" "part-tester") - ("default-menu.o" "default-menu") - ) - -("FIC.DGO" - ("target-racer-h.o" "target-racer-h") - ("racer-part.o" "racer-part") - ("racer.o" "racer") - ("target-racer.o" "target-racer") - ("racer-states.o" "racer-states") - ("collide-reaction-racer.o" "collide-reaction-racer") - ("eichar-racer+0-ag.go" "eichar-racer+0") - ("tpage-1119.go" "tpage-1119") - ("blocking-plane.o" "blocking-plane") - ("firecanyon-part.o" "firecanyon-part") - ("assistant-firecanyon.o" "assistant-firecanyon") - ("firecanyon-obs.o" "firecanyon-obs") - ("tpage-815.go" "tpage-815") - ("tpage-822.go" "tpage-822") - ("tpage-854.go" "tpage-854") - ("tpage-1123.go" "tpage-1123") - ("assistant-firecanyon-ag.go" "assistant-firecanyon") - ("babak-ag.go" "babak") - ("balloon-ag.go" "balloon") - ("crate-darkeco-cluster-ag.go" "crate-darkeco-cluster") - ("ecovalve-ag.go" "ecovalve") - ("ef-plane-ag.go" "ef-plane") - ("racer-ag.go" "racer") - ("spike-ag.go" "spike") - ("firecanyon-vis.go" "firecanyon-vis") - ) - -("FIN.DGO" - ("robotboss-h.o" "robotboss-h") - ("robotboss-part.o" "robotboss-part") - ("sage-finalboss-part.o" "sage-finalboss-part") - ("light-eco.o" "light-eco") - ("robotboss-weapon.o" "robotboss-weapon") - ("robotboss-misc.o" "robotboss-misc") - ("green-eco-lurker.o" "green-eco-lurker") - ("robotboss.o" "robotboss") - ("final-door.o" "final-door") - ("sage-finalboss.o" "sage-finalboss") - ("tpage-1419.go" "tpage-1419") - ("tpage-1420.go" "tpage-1420") - ("tpage-634.go" "tpage-634") - ("tpage-1418.go" "tpage-1418") - ("tpage-545.go" "tpage-545") - ("darkecobomb-ag.go" "darkecobomb") - ("ecoclaw-ag.go" "ecoclaw") - ("ecovalve-ag.go" "ecovalve") - ("finalbosscam-ag.go" "finalbosscam") - ("green-eco-lurker-ag.go" "green-eco-lurker") - ("green-sagecage-ag.go" "green-sagecage") - ("greenshot-ag.go" "greenshot") - ("jak-white-ag.go" "jak-white") - ("light-eco-ag.go" "light-eco") - ("plat-eco-finalboss-ag.go" "plat-eco-finalboss") - ("power-left-ag.go" "power-left") - ("power-right-ag.go" "power-right") - ("powercellalt-ag.go" "powercellalt") - ("redring-ag.go" "redring") - ("robotboss-ag.go" "robotboss") - ("robotboss-blueeco-ag.go" "robotboss-blueeco") - ("robotboss-cinematic-ag.go" "robotboss-cinematic") - ("robotboss-redeco-ag.go" "robotboss-redeco") - ("robotboss-yelloweco-ag.go" "robotboss-yelloweco") - ("silodoor-ag.go" "silodoor") - ("water-anim-finalboss-ag.go" "water-anim-finalboss") - ("finalboss-vis.go" "finalboss-vis") - ) - -("GAME.CGO" - ("types-h.o" "types-h") - ("vu1-macros.o" "vu1-macros") - ("math.o" "math") - ("vector-h.o" "vector-h") - ("gravity-h.o" "gravity-h") - ("bounding-box-h.o" "bounding-box-h") - ("matrix-h.o" "matrix-h") - ("quaternion-h.o" "quaternion-h") - ("euler-h.o" "euler-h") - ("transform-h.o" "transform-h") - ("geometry-h.o" "geometry-h") - ("trigonometry-h.o" "trigonometry-h") - ("transformq-h.o" "transformq-h") - ("bounding-box.o" "bounding-box") - ("matrix.o" "matrix") - ("transform.o" "transform") - ("quaternion.o" "quaternion") - ("euler.o" "euler") - ("geometry.o" "geometry") - ("trigonometry.o" "trigonometry") - ("gsound-h.o" "gsound-h") - ("timer-h.o" "timer-h") - ("timer.o" "timer") - ("vif-h.o" "vif-h") - ("dma-h.o" "dma-h") - ("video-h.o" "video-h") - ("vu1-user-h.o" "vu1-user-h") - ("dma.o" "dma") - ("dma-buffer.o" "dma-buffer") - ("dma-bucket.o" "dma-bucket") - ("dma-disasm.o" "dma-disasm") - ("pckernel-h.o" "pckernel-h") ;; added - ("pad.o" "pad") - ("gs.o" "gs") - ("display-h.o" "display-h") - ("vector.o" "vector") - ("file-io.o" "file-io") - ("loader-h.o" "loader-h") - ("texture-h.o" "texture-h") - ("level-h.o" "level-h") - ("math-camera-h.o" "math-camera-h") - ("math-camera.o" "math-camera") - ("font-h.o" "font-h") - ("decomp-h.o" "decomp-h") - ("display.o" "display") - ("connect.o" "connect") - ("text-h.o" "text-h") - ("settings-h.o" "settings-h") - ("capture.o" "capture") - ("memory-usage-h.o" "memory-usage-h") - ("texture.o" "texture") - ("main-h.o" "main-h") - ("mspace-h.o" "mspace-h") - ("drawable-h.o" "drawable-h") - ("drawable-group-h.o" "drawable-group-h") - ("drawable-inline-array-h.o" "drawable-inline-array-h") - ("draw-node-h.o" "draw-node-h") - ("drawable-tree-h.o" "drawable-tree-h") - ("drawable-actor-h.o" "drawable-actor-h") - ("drawable-ambient-h.o" "drawable-ambient-h") - ("game-task-h.o" "game-task-h") - ("hint-control-h.o" "hint-control-h") - ("generic-h.o" "generic-h") - ("lights-h.o" "lights-h") - ("ocean-h.o" "ocean-h") - ("ocean-trans-tables.o" "ocean-trans-tables") - ("ocean-tables.o" "ocean-tables") - ("ocean-frames.o" "ocean-frames") - ("sky-h.o" "sky-h") - ("mood-h.o" "mood-h") - ("time-of-day-h.o" "time-of-day-h") - ("art-h.o" "art-h") - ("generic-vu1-h.o" "generic-vu1-h") - ("merc-h.o" "merc-h") - ("generic-merc-h.o" "generic-merc-h") - ("generic-tie-h.o" "generic-tie-h") - ("generic-work-h.o" "generic-work-h") - ("shadow-cpu-h.o" "shadow-cpu-h") - ("shadow-vu1-h.o" "shadow-vu1-h") - ("memcard-h.o" "memcard-h") - ("game-info-h.o" "game-info-h") - ("wind-h.o" "wind-h") - ("prototype-h.o" "prototype-h") - ("joint-h.o" "joint-h") - ("bones-h.o" "bones-h") - ("engines.o" "engines") - ("res-h.o" "res-h") - ("res.o" "res") - ("lights.o" "lights") - ("dynamics-h.o" "dynamics-h") - ("surface-h.o" "surface-h") - ("pat-h.o" "pat-h") - ("fact-h.o" "fact-h") - ("aligner-h.o" "aligner-h") - ("game-h.o" "game-h") - ("generic-obs-h.o" "generic-obs-h") - ("pov-camera-h.o" "pov-camera-h") - ("sync-info-h.o" "sync-info-h") - ("smush-control-h.o" "smush-control-h") - ("trajectory-h.o" "trajectory-h") - ("debug-h.o" "debug-h") - ("joint-mod-h.o" "joint-mod-h") - ("collide-func-h.o" "collide-func-h") - ("collide-mesh-h.o" "collide-mesh-h") - ("collide-shape-h.o" "collide-shape-h") - ("collide-target-h.o" "collide-target-h") - ("collide-touch-h.o" "collide-touch-h") - ("collide-edge-grab-h.o" "collide-edge-grab-h") - ("process-drawable-h.o" "process-drawable-h") - ("effect-control-h.o" "effect-control-h") - ("collide-frag-h.o" "collide-frag-h") - ("projectiles-h.o" "projectiles-h") - ("target-h.o" "target-h") - ("depth-cue-h.o" "depth-cue-h") - ("stats-h.o" "stats-h") - ("bsp-h.o" "bsp-h") - ("collide-cache-h.o" "collide-cache-h") - ("collide-h.o" "collide-h") - ("shrubbery-h.o" "shrubbery-h") - ("tie-h.o" "tie-h") - ("tfrag-h.o" "tfrag-h") - ("background-h.o" "background-h") - ("subdivide-h.o" "subdivide-h") - ("entity-h.o" "entity-h") - ("sprite-h.o" "sprite-h") - ("shadow-h.o" "shadow-h") - ("eye-h.o" "eye-h") - ("sparticle-launcher-h.o" "sparticle-launcher-h") - ("sparticle-h.o" "sparticle-h") - ("actor-link-h.o" "actor-link-h") - ("camera-h.o" "camera-h") - ("cam-debug-h.o" "cam-debug-h") - ("cam-interface-h.o" "cam-interface-h") - ("cam-update-h.o" "cam-update-h") - ("assert-h.o" "assert-h") - ("hud-h.o" "hud-h") - ("progress-h.o" "progress-h") - ("rpc-h.o" "rpc-h") - ("path-h.o" "path-h") - ("navigate-h.o" "navigate-h") - ("load-dgo.o" "load-dgo") - ("ramdisk.o" "ramdisk") - ("gsound.o" "gsound") - ("transformq.o" "transformq") - ("collide-func.o" "collide-func") - ("joint.o" "joint") - ("cylinder.o" "cylinder") - ("wind.o" "wind") - ("bsp.o" "bsp") - ("subdivide.o" "subdivide") - ("sprite.o" "sprite") - ("sprite-distort.o" "sprite-distort") - ("debug-sphere.o" "debug-sphere") - ("debug.o" "debug") - ("merc-vu1.o" "merc-vu1") - ("merc-blend-shape.o" "merc-blend-shape") - ("merc.o" "merc") - ("ripple.o" "ripple") - ("bones.o" "bones") - ("generic-vu0.o" "generic-vu0") - ("generic.o" "generic") - ("generic-vu1.o" "generic-vu1") - ("generic-effect.o" "generic-effect") - ("generic-merc.o" "generic-merc") - ("generic-tie.o" "generic-tie") - ("shadow-cpu.o" "shadow-cpu") - ("shadow-vu1.o" "shadow-vu1") - ("depth-cue.o" "depth-cue") - ("font.o" "font") - ("decomp.o" "decomp") - ("background.o" "background") - ("draw-node.o" "draw-node") - ("shrubbery.o" "shrubbery") - ("shrub-work.o" "shrub-work") - ("tfrag-near.o" "tfrag-near") - ("tfrag.o" "tfrag") - ("tfrag-methods.o" "tfrag-methods") - ("tfrag-work.o" "tfrag-work") - ("tie.o" "tie") - ("tie-near.o" "tie-near") - ("tie-work.o" "tie-work") - ("tie-methods.o" "tie-methods") - ("sync-info.o" "sync-info") - ("trajectory.o" "trajectory") - ("sparticle-launcher.o" "sparticle-launcher") - ("sparticle.o" "sparticle") - ("entity-table.o" "entity-table") - ("loader.o" "loader") - ("task-control-h.o" "task-control-h") - ("game-info.o" "game-info") - ("game-save.o" "game-save") - ("settings.o" "settings") - ("pckernel.o" "pckernel") ;; added - ("mood-tables.o" "mood-tables") - ("mood.o" "mood") - ("weather-part.o" "weather-part") - ("time-of-day.o" "time-of-day") - ("sky-utils.o" "sky-utils") - ("sky.o" "sky") - ("sky-tng.o" "sky-tng") - ("load-boundary-h.o" "load-boundary-h") - ("load-boundary.o" "load-boundary") - ("load-boundary-data.o" "load-boundary-data") - ("level-info.o" "level-info") - ("level.o" "level") - ("text.o" "text") - ("collide-probe.o" "collide-probe") - ("collide-frag.o" "collide-frag") - ("collide-mesh.o" "collide-mesh") - ("collide-touch.o" "collide-touch") - ("collide-edge-grab.o" "collide-edge-grab") - ("collide-shape.o" "collide-shape") - ("collide-shape-rider.o" "collide-shape-rider") - ("collide.o" "collide") - ("collide-planes.o" "collide-planes") - ("merc-death.o" "merc-death") - ("water-h.o" "water-h") - ("camera.o" "camera") - ("cam-interface.o" "cam-interface") - ("cam-master.o" "cam-master") - ("cam-states.o" "cam-states") - ("cam-states-dbg.o" "cam-states-dbg") - ("cam-combiner.o" "cam-combiner") - ("cam-update.o" "cam-update") - ("vol-h.o" "vol-h") - ("cam-layout.o" "cam-layout") - ("cam-debug.o" "cam-debug") - ("cam-start.o" "cam-start") - ("process-drawable.o" "process-drawable") - ("hint-control.o" "hint-control") - ("ambient.o" "ambient") - ("assert.o" "assert") - ("generic-obs.o" "generic-obs") - ("target-util.o" "target-util") - ("target-part.o" "target-part") - ("collide-reaction-target.o" "collide-reaction-target") - ("logic-target.o" "logic-target") - ("sidekick.o" "sidekick") - ("voicebox.o" "voicebox") - ("target-handler.o" "target-handler") - ("target.o" "target") - ("target2.o" "target2") - ("target-death.o" "target-death") - ("menu.o" "menu") - ("drawable.o" "drawable") - ("drawable-group.o" "drawable-group") - ("drawable-inline-array.o" "drawable-inline-array") - ("drawable-tree.o" "drawable-tree") - ("prototype.o" "prototype") - ("main-collide.o" "main-collide") - ("video.o" "video") - ("main.o" "main") - ("collide-cache.o" "collide-cache") - ("relocate.o" "relocate") - ("memory-usage.o" "memory-usage") - ("entity.o" "entity") - ("path.o" "path") - ("vol.o" "vol") - ("navigate.o" "navigate") - ("aligner.o" "aligner") - ("effect-control.o" "effect-control") - ("water.o" "water") - ("collectables-part.o" "collectables-part") - ("collectables.o" "collectables") - ("task-control.o" "task-control") - ("process-taskable.o" "process-taskable") - ("pov-camera.o" "pov-camera") - ("powerups.o" "powerups") - ("crates.o" "crates") - ("hud.o" "hud") - ("hud-classes.o" "hud-classes") - ("progress-static.o" "progress-static") - ("progress-part.o" "progress-part") - ("progress-draw.o" "progress-draw") - ("progress.o" "progress") - ("credits.o" "credits") - ("projectiles.o" "projectiles") - ("ocean.o" "ocean") - ("ocean-vu0.o" "ocean-vu0") - ("ocean-texture.o" "ocean-texture") - ("ocean-mid.o" "ocean-mid") - ("ocean-transition.o" "ocean-transition") - ("ocean-near.o" "ocean-near") - ("shadow.o" "shadow") - ("eye.o" "eye") - ("glist-h.o" "glist-h") - ("glist.o" "glist") - ("anim-tester.o" "anim-tester") - ("viewer.o" "viewer") - ("part-tester.o" "part-tester") - ("default-menu.o" "default-menu") - ("dir-tpages.go" "dir-tpages") - ("tpage-463.go" "tpage-463") - ("tpage-2.go" "tpage-2") - ("tpage-880.go" "tpage-880") - ("tpage-256.go" "tpage-256") - ("tpage-1278.go" "tpage-1278") - ("texture-upload.o" "texture-upload") - ("tpage-1032.go" "tpage-1032") - ("tpage-62.go" "tpage-62") - ("tpage-1532.go" "tpage-1532") - ("fuel-cell-ag.go" "fuel-cell") - ("money-ag.go" "money") - ("buzzer-ag.go" "buzzer") - ("ecovalve-ag.go" "ecovalve") - ("crate-ag.go" "crate") - ("speaker-ag.go" "speaker") - ("fuelcell-naked-ag.go" "fuelcell-naked") - ("eichar-ag.go" "eichar") - ("sidekick-ag.go" "sidekick") - ("deathcam-ag.go" "deathcam") - ("game-cnt.go" "game-cnt") - ("rigid-body-h.o" "rigid-body-h") - ("water-anim.o" "water-anim") - ("dark-eco-pool.o" "dark-eco-pool") - ("rigid-body.o" "rigid-body") - ("nav-enemy-h.o" "nav-enemy-h") - ("nav-enemy.o" "nav-enemy") - ("baseplat.o" "baseplat") - ("basebutton.o" "basebutton") - ("tippy.o" "tippy") - ("joint-exploder.o" "joint-exploder") - ("babak.o" "babak") - ("sharkey.o" "sharkey") - ("orb-cache.o" "orb-cache") - ("plat.o" "plat") - ("plat-button.o" "plat-button") - ("plat-eco.o" "plat-eco") - ("ropebridge.o" "ropebridge") - ("ticky.o" "ticky") - ) - -("INT.DGO" - ("evilbro.o" "evilbro") - ("tpage-1455.go" "tpage-1455") - ("tpage-1457.go" "tpage-1457") - ("tpage-1456.go" "tpage-1456") - ("tpage-1454.go" "tpage-1454") - ("evilbro-ag.go" "evilbro") - ("evilsis-ag.go" "evilsis") - ("intro-vis.go" "intro-vis") - ) - -("JUB.DGO" - ("jungleb-obs.o" "jungleb-obs") - ("plat-flip.o" "plat-flip") - ("plant-boss-main+0-ag.go" "plant-boss-main+0") - ("aphid.o" "aphid") - ("plant-boss.o" "plant-boss") - ("tpage-485.go" "tpage-485") - ("tpage-510.go" "tpage-510") - ("tpage-507.go" "tpage-507") - ("tpage-966.go" "tpage-966") - ("aphid-lurker-ag.go" "aphid-lurker") - ("darkvine-ag.go" "darkvine") - ("ecovalve-ag.go" "ecovalve") - ("eggtop-ag.go" "eggtop") - ("jng-iris-door-ag.go" "jng-iris-door") - ("plant-boss-ag.go" "plant-boss") - ("plat-flip-ag.go" "plat-flip") - ("plat-jungleb-ag.go" "plat-jungleb") - ("jungleb-vis.go" "jungleb-vis") - ) - -("JUN.DGO" - ("eichar-fish+0-ag.go" "eichar-fish+0") - ("jungle-elevator.o" "jungle-elevator") - ("bouncer.o" "bouncer") - ("hopper.o" "hopper") - ("junglesnake.o" "junglesnake") - ("darkvine.o" "darkvine") - ("jungle-obs.o" "jungle-obs") - ("jungle-mirrors.o" "jungle-mirrors") - ("junglefish.o" "junglefish") - ("fisher.o" "fisher") - ("jungle-part.o" "jungle-part") - ("launcherdoor.o" "launcherdoor") - ("tpage-385.go" "tpage-385") - ("tpage-531.go" "tpage-531") - ("tpage-386.go" "tpage-386") - ("tpage-388.go" "tpage-388") - ("tpage-765.go" "tpage-765") - ("accordian-ag.go" "accordian") - ("babak-ag.go" "babak") - ("bounceytarp-ag.go" "bounceytarp") - ("catch-fisha-ag.go" "catch-fisha") - ("catch-fishb-ag.go" "catch-fishb") - ("catch-fishc-ag.go" "catch-fishc") - ("darkvine-ag.go" "darkvine") - ("ecovalve-ag.go" "ecovalve") - ("fish-net-ag.go" "fish-net") - ("fisher-ag.go" "fisher") - ("hopper-ag.go" "hopper") - ("junglecam-ag.go" "junglecam") - ("junglefish-ag.go" "junglefish") - ("junglesnake-ag.go" "junglesnake") - ("launcherdoor-ag.go" "launcherdoor") - ("logtrap-ag.go" "logtrap") - ("lurkerm-piston-ag.go" "lurkerm-piston") - ("lurkerm-tall-sail-ag.go" "lurkerm-tall-sail") - ("maindoor-ag.go" "maindoor") - ("medres-firecanyon-ag.go" "medres-firecanyon") - ("orb-cache-top-ag.go" "orb-cache-top") - ("periscope-ag.go" "periscope") - ("plat-button-ag.go" "plat-button") - ("plat-eco-ag.go" "plat-eco") - ("precurbridge-ag.go" "precurbridge") - ("reflector-mirror-ag.go" "reflector-mirror") - ("ropebridge-52-ag.go" "ropebridge-52") - ("ropebridge-70-ag.go" "ropebridge-70") - ("sharkey-ag.go" "sharkey") - ("sidedoor-ag.go" "sidedoor") - ("towertop-ag.go" "towertop") - ("water-anim-jungle-ag.go" "water-anim-jungle") - ("jungle-vis.go" "jungle-vis") - ) - -("JUNGLE.CGO" - ("eichar-fish+0-ag.go" "eichar-fish+0") - ("jungle-elevator.o" "jungle-elevator") - ("bouncer.o" "bouncer") - ("hopper.o" "hopper") - ("junglesnake.o" "junglesnake") - ("darkvine.o" "darkvine") - ("jungle-obs.o" "jungle-obs") - ("jungle-mirrors.o" "jungle-mirrors") - ("junglefish.o" "junglefish") - ("fisher-OLD.o" "fisher") - ("jungle-part.o" "jungle-part") - ("launcherdoor.o" "launcherdoor") - ) - -("L1.CGO" - ("rigid-body-h.o" "rigid-body-h") - ("water-anim.o" "water-anim") - ("dark-eco-pool.o" "dark-eco-pool") - ("rigid-body.o" "rigid-body") - ("nav-enemy-h.o" "nav-enemy-h") - ("nav-enemy.o" "nav-enemy") - ("baseplat.o" "baseplat") - ("basebutton.o" "basebutton") - ("tippy.o" "tippy") - ("joint-exploder.o" "joint-exploder") - ("babak.o" "babak") - ("sharkey.o" "sharkey") - ("orb-cache.o" "orb-cache") - ("plat.o" "plat") - ("plat-button.o" "plat-button") - ("plat-eco.o" "plat-eco") - ("ropebridge.o" "ropebridge") - ("ticky.o" "ticky") - ("villagep-obs.o" "villagep-obs") - ("oracle.o" "oracle") - ("target-racer-h-OLD.o" "target-racer-h") - ("racer-part.o" "racer-part") - ("racer.o" "racer") - ("target-racer-OLD.o" "target-racer") - ("racer-states-OLD.o" "racer-states") - ("collide-reaction-racer.o" "collide-reaction-racer") - ("eichar-racer+0-ag.go" "eichar-racer+0") - ("tpage-1119.go" "tpage-1119") - ("battlecontroller.o" "battlecontroller") - ("mistycannon.o" "mistycannon") - ("babak-with-cannon.o" "babak-with-cannon") - ("blocking-plane.o" "blocking-plane") - ("flut-part.o" "flut-part") - ("flutflut.o" "flutflut") - ("target-flut.o" "target-flut") - ("eichar-flut+0-ag.go" "eichar-flut+0") - ("farmer.o" "farmer") - ("explorer.o" "explorer") - ("assistant.o" "assistant") - ("sage.o" "sage") - ("yakow.o" "yakow") - ("village-obs-OLD.o" "village-obs") - ("fishermans-boat.o" "fishermans-boat") - ("village1-part.o" "village1-part") - ("village1-part2.o" "village1-part2") - ("sequence-a-village1.o" "sequence-a-village1") - ("training-obs.o" "training-obs") - ("training-part.o" "training-part") - ("air-h.o" "air-h") - ("air.o" "air") - ("wobbler.o" "wobbler") - ("twister.o" "twister") - ("beach-obs.o" "beach-obs") - ("bird-lady.o" "bird-lady") - ("bird-lady-beach.o" "bird-lady-beach") - ("mayor.o" "mayor") - ("sculptor.o" "sculptor") - ("pelican.o" "pelican") - ("lurkerworm.o" "lurkerworm") - ("lurkercrab.o" "lurkercrab") - ("lurkerpuppy.o" "lurkerpuppy") - ("beach-rocks.o" "beach-rocks") - ("seagull.o" "seagull") - ("beach-part.o" "beach-part") - ("eichar-fish+0-ag.go" "eichar-fish+0") - ("jungle-elevator.o" "jungle-elevator") - ("bouncer.o" "bouncer") - ("hopper.o" "hopper") - ("junglesnake.o" "junglesnake") - ("darkvine.o" "darkvine") - ("jungle-obs.o" "jungle-obs") - ("jungle-mirrors.o" "jungle-mirrors") - ("junglefish.o" "junglefish") - ("fisher-OLD.o" "fisher") - ("jungle-part.o" "jungle-part") - ("jungleb-obs.o" "jungleb-obs") - ("plat-flip.o" "plat-flip") - ("plant-boss-main+0-ag.go" "plant-boss-main+0") - ("aphid.o" "aphid") - ("plant-boss.o" "plant-boss") - ("misty-obs.o" "misty-obs") - ("misty-warehouse.o" "misty-warehouse") - ("misty-conveyor.o" "misty-conveyor") - ("mud.o" "mud") - ("muse.o" "muse") - ("bonelurker.o" "bonelurker") - ("quicksandlurker.o" "quicksandlurker") - ("misty-teetertotter.o" "misty-teetertotter") - ("balloonlurker.o" "balloonlurker") - ("misty-part.o" "misty-part") - ("sidekick-human.o" "sidekick-human") - ("firecanyon-part.o" "firecanyon-part") - ("assistant-firecanyon.o" "assistant-firecanyon") - ("village2-part.o" "village2-part") - ("village2-obs.o" "village2-obs") - ("village2-part2.o" "village2-part2") - ("gambler.o" "gambler") - ("warrior.o" "warrior") - ("geologist.o" "geologist") - ("swamp-blimp.o" "swamp-blimp") - ("sage-bluehut.o" "sage-bluehut") - ("flutflut-bluehut.o" "flutflut-bluehut") - ("assistant-village2.o" "assistant-village2") - ("sunken-elevator.o" "sunken-elevator") - ("swamp-obs.o" "swamp-obs") - ("swamp-bat.o" "swamp-bat") - ("swamp-rat.o" "swamp-rat") - ("swamp-rat-nest.o" "swamp-rat-nest") - ("kermit.o" "kermit") - ("swamp-part.o" "swamp-part") - ("billy.o" "billy") - ("cavecrystal-light.o" "cavecrystal-light") - ("maincave-obs.o" "maincave-obs") - ("maincave-part.o" "maincave-part") - ("spiderwebs.o" "spiderwebs") - ("dark-crystal.o" "dark-crystal") - ("baby-spider.o" "baby-spider") - ("mother-spider-h.o" "mother-spider-h") - ("mother-spider-egg.o" "mother-spider-egg") - ("mother-spider-proj.o" "mother-spider-proj") - ("mother-spider.o" "mother-spider") - ("gnawer.o" "gnawer") - ("driller-lurker.o" "driller-lurker") - ("robotboss-h.o" "robotboss-h") - ("robotboss-part.o" "robotboss-part") - ("sage-finalboss-part.o" "sage-finalboss-part") - ("light-eco.o" "light-eco") - ("robotboss-weapon.o" "robotboss-weapon") - ("robotboss-misc.o" "robotboss-misc") - ("green-eco-lurker.o" "green-eco-lurker") - ("robotboss.o" "robotboss") - ("final-door.o" "final-door") - ("sage-finalboss-OLD.o" "sage-finalboss") - ("sunken-part.o" "sunken-part") - ("sunken-part2.o" "sunken-part2") - ("sunken-part3.o" "sunken-part3") - ("sunken-part4.o" "sunken-part4") - ("sunken-part5.o" "sunken-part5") - ("target-tube.o" "target-tube") - ("eichar-tube+0-ag.go" "eichar-tube+0") - ("sunken-obs.o" "sunken-obs") - ("shover.o" "shover") - ("launcherdoor.o" "launcherdoor") - ("square-platform.o" "square-platform") - ("sun-iris-door.o" "sun-iris-door") - ("orbit-plat.o" "orbit-plat") - ("wedge-plats.o" "wedge-plats") - ("wall-plat.o" "wall-plat") - ("qbert-plat.o" "qbert-plat") - ("steam-cap.o" "steam-cap") - ("sun-exit-chamber.o" "sun-exit-chamber") - ("floating-launcher.o" "floating-launcher") - ("sunken-water.o" "sunken-water") - ("whirlpool.o" "whirlpool") - ("sunken-pipegame.o" "sunken-pipegame") - ("bully.o" "bully") - ("double-lurker.o" "double-lurker") - ("helix-water.o" "helix-water") - ("puffer.o" "puffer") - ("sunken-fish.o" "sunken-fish") - ("rolling-obs.o" "rolling-obs") - ("rolling-lightning-mole.o" "rolling-lightning-mole") - ("rolling-robber.o" "rolling-robber") - ("rolling-race-ring.o" "rolling-race-ring") - ("firecanyon-obs.o" "firecanyon-obs") - ("ogre-part.o" "ogre-part") - ("ogreboss.o" "ogreboss") - ("ogre-obs.o" "ogre-obs") - ("flying-lurker.o" "flying-lurker") - ("village3-part.o" "village3-part") - ("village3-obs.o" "village3-obs") - ("minecart.o" "minecart") - ("miners.o" "miners") - ("assistant-village3.o" "assistant-village3") - ("sage-village3.o" "sage-village3") - ("darkcave-obs.o" "darkcave-obs") - ("cave-trap.o" "cave-trap") - ("spider-egg.o" "spider-egg") - ("robocave-part.o" "robocave-part") - ("target-snowball.o" "target-snowball") - ("target-ice.o" "target-ice") - ("ice-cube.o" "ice-cube") - ("snow-ball.o" "snow-ball") - ("snow-obs.o" "snow-obs") - ("snow-flutflut-obs.o" "snow-flutflut-obs") - ("snow-bumper.o" "snow-bumper") - ("snow-ram-h.o" "snow-ram-h") - ("snow-ram-boss.o" "snow-ram-boss") - ("snow-ram.o" "snow-ram") - ("snow-part.o" "snow-part") - ("yeti.o" "yeti") - ("eichar-pole+0-ag.go" "eichar-pole+0") - ("eichar-ice+0-ag.go" "eichar-ice+0") - ("lavatube-obs.o" "lavatube-obs") - ("lavatube-energy.o" "lavatube-energy") - ("lavatube-part.o" "lavatube-part") - ("assistant-lavatube.o" "assistant-lavatube") - ("citadel-part.o" "citadel-part") - ("citadel-obs.o" "citadel-obs") - ("citb-plat.o" "citb-plat") - ("citadel-sages.o" "citadel-sages") - ("snow-bunny.o" "snow-bunny") - ("citb-bunny.o" "citb-bunny") - ("citb-drop-plat-OLD.o" "citb-drop-plat") - ("assistant-citadel.o" "assistant-citadel") - ("demo-obs.o" "demo-obs") - ("tpage-1485.go" "tpage-1485") - ("tpage-1486.go" "tpage-1486") - ("tpage-1487.go" "tpage-1487") - ("tpage-1599.go" "tpage-1599") - ("tpage-1600.go" "tpage-1600") - ("tpage-1601.go" "tpage-1601") - ("tpage-1602.go" "tpage-1602") - ("tpage-1603.go" "tpage-1603") - ("tpage-1604.go" "tpage-1604") - ("tpage-1605.go" "tpage-1605") - ("tpage-1606.go" "tpage-1606") - ("tpage-1607.go" "tpage-1607") - ("static-screen.o" "static-screen") - ("evilbro.o" "evilbro") - ) - -("LAV.DGO" - ("target-racer-h.o" "target-racer-h") - ("racer-part.o" "racer-part") - ("racer.o" "racer") - ("target-racer.o" "target-racer") - ("racer-states.o" "racer-states") - ("collide-reaction-racer.o" "collide-reaction-racer") - ("eichar-racer+0-ag.go" "eichar-racer+0") - ("tpage-1119.go" "tpage-1119") - ("blocking-plane.o" "blocking-plane") - ("lavatube-obs.o" "lavatube-obs") - ("lavatube-energy.o" "lavatube-energy") - ("lavatube-part.o" "lavatube-part") - ("assistant-lavatube.o" "assistant-lavatube") - ("tpage-1338.go" "tpage-1338") - ("tpage-1340.go" "tpage-1340") - ("tpage-1339.go" "tpage-1339") - ("tpage-1337.go" "tpage-1337") - ("assistant-lavatube-start-ag.go" "assistant-lavatube-start") - ("chainmine-ag.go" "chainmine") - ("darkecobarrel-ag.go" "darkecobarrel") - ("ecovalve-ag.go" "ecovalve") - ("ef-plane-ag.go" "ef-plane") - ("energyarm-ag.go" "energyarm") - ("energyball-ag.go" "energyball") - ("energybase-ag.go" "energybase") - ("energydoor-ag.go" "energydoor") - ("energyhub-ag.go" "energyhub") - ("lavaballoon-ag.go" "lavaballoon") - ("lavabase-ag.go" "lavabase") - ("lavafall-ag.go" "lavafall") - ("lavafallsewera-ag.go" "lavafallsewera") - ("lavafallsewerb-ag.go" "lavafallsewerb") - ("lavashortcut-ag.go" "lavashortcut") - ("lavayellowtarp-ag.go" "lavayellowtarp") - ("racer-ag.go" "racer") - ("water-anim-lavatube-ag.go" "water-anim-lavatube") - ("lavatube-vis.go" "lavatube-vis") - ) - -("MAI.DGO" - ("cavecrystal-light.o" "cavecrystal-light") - ("maincave-obs.o" "maincave-obs") - ("maincave-part.o" "maincave-part") - ("spiderwebs.o" "spiderwebs") - ("dark-crystal.o" "dark-crystal") - ("baby-spider.o" "baby-spider") - ("mother-spider-h.o" "mother-spider-h") - ("mother-spider-egg.o" "mother-spider-egg") - ("mother-spider-proj.o" "mother-spider-proj") - ("mother-spider.o" "mother-spider") - ("gnawer.o" "gnawer") - ("driller-lurker.o" "driller-lurker") - ("launcherdoor.o" "launcherdoor") - ("tpage-1313.go" "tpage-1313") - ("tpage-1315.go" "tpage-1315") - ("tpage-1314.go" "tpage-1314") - ("tpage-1312.go" "tpage-1312") - ("tpage-767.go" "tpage-767") - ("baby-spider-ag.go" "baby-spider") - ("cavetrapdoor-ag.go" "cavetrapdoor") - ("dark-crystal-ag.go" "dark-crystal") - ("driller-lurker-ag.go" "driller-lurker") - ("ecovalve-ag.go" "ecovalve") - ("gnawer-ag.go" "gnawer") - ("launcherdoor-maincave-ag.go" "launcherdoor-maincave") - ("maincavecam-ag.go" "maincavecam") - ("mother-spider-ag.go" "mother-spider") - ("plat-ag.go" "plat") - ("spider-egg-ag.go" "spider-egg") - ("spiderwebs-ag.go" "spiderwebs") - ("water-anim-maincave-ag.go" "water-anim-maincave") - ("water-anim-maincave-water-ag.go" "water-anim-maincave-water") - ("maincave-vis.go" "maincave-vis") - ) - -("MAINCAVE.CGO" - ("cavecrystal-light.o" "cavecrystal-light") - ("maincave-obs.o" "maincave-obs") - ("maincave-part.o" "maincave-part") - ("spiderwebs.o" "spiderwebs") - ("dark-crystal.o" "dark-crystal") - ("baby-spider.o" "baby-spider") - ("mother-spider-h.o" "mother-spider-h") - ("mother-spider-egg.o" "mother-spider-egg") - ("mother-spider-proj.o" "mother-spider-proj") - ("mother-spider.o" "mother-spider") - ("gnawer.o" "gnawer") - ("driller-lurker.o" "driller-lurker") - ("launcherdoor.o" "launcherdoor") - ) - -("MIS.DGO" - ("target-racer-h.o" "target-racer-h") - ("racer-part.o" "racer-part") - ("racer.o" "racer") - ("target-racer.o" "target-racer") - ("racer-states.o" "racer-states") - ("collide-reaction-racer.o" "collide-reaction-racer") - ("eichar-racer+0-ag.go" "eichar-racer+0") - ("tpage-1119.go" "tpage-1119") - ("battlecontroller.o" "battlecontroller") - ("mistycannon.o" "mistycannon") - ("babak-with-cannon.o" "babak-with-cannon") - ("blocking-plane.o" "blocking-plane") - ("misty-obs.o" "misty-obs") - ("misty-warehouse.o" "misty-warehouse") - ("misty-conveyor.o" "misty-conveyor") - ("mud.o" "mud") - ("muse.o" "muse") - ("bonelurker.o" "bonelurker") - ("quicksandlurker.o" "quicksandlurker") - ("misty-teetertotter.o" "misty-teetertotter") - ("balloonlurker.o" "balloonlurker") - ("misty-part.o" "misty-part") - ("sidekick-human.o" "sidekick-human") - ("tpage-516.go" "tpage-516") - ("tpage-521.go" "tpage-521") - ("tpage-518.go" "tpage-518") - ("tpage-520.go" "tpage-520") - ("babak-ag.go" "babak") - ("balloonlurker-ag.go" "balloonlurker") - ("boatpaddle-ag.go" "boatpaddle") - ("bonelurker-ag.go" "bonelurker") - ("breakaway-left-ag.go" "breakaway-left") - ("breakaway-mid-ag.go" "breakaway-mid") - ("breakaway-right-ag.go" "breakaway-right") - ("darkecocan-ag.go" "darkecocan") - ("ef-plane-ag.go" "ef-plane") - ("keg-ag.go" "keg") - ("keg-conveyor-ag.go" "keg-conveyor") - ("keg-conveyor-paddle-ag.go" "keg-conveyor-paddle") - ("mis-bone-bridge-ag.go" "mis-bone-bridge") - ("mis-bone-platform-ag.go" "mis-bone-platform") - ("mistycam-ag.go" "mistycam") - ("mistycannon-ag.go" "mistycannon") - ("muse-ag.go" "muse") - ("orb-cache-top-ag.go" "orb-cache-top") - ("plat-eco-ag.go" "plat-eco") - ("quicksandlurker-ag.go" "quicksandlurker") - ("racer-ag.go" "racer") - ("ropebridge-36-ag.go" "ropebridge-36") - ("rounddoor-ag.go" "rounddoor") - ("sack-ag.go" "sack") - ("sharkey-ag.go" "sharkey") - ("sidekick-human-ag.go" "sidekick-human") - ("silostep-ag.go" "silostep") - ("teetertotter-ag.go" "teetertotter") - ("water-anim-misty-ag.go" "water-anim-misty") - ("wheel-ag.go" "wheel") - ("windturbine-ag.go" "windturbine") - ("misty-vis.go" "misty-vis") - ) - -("OGR.DGO" - ("target-racer-h.o" "target-racer-h") - ("racer-part.o" "racer-part") - ("racer.o" "racer") - ("target-racer.o" "target-racer") - ("racer-states.o" "racer-states") - ("collide-reaction-racer.o" "collide-reaction-racer") - ("eichar-racer+0-ag.go" "eichar-racer+0") - ("tpage-1119.go" "tpage-1119") - ("blocking-plane.o" "blocking-plane") - ("firecanyon-obs.o" "firecanyon-obs") - ("ogre-part.o" "ogre-part") - ("ogreboss.o" "ogreboss") - ("ogre-obs.o" "ogre-obs") - ("flying-lurker.o" "flying-lurker") - ("tpage-875.go" "tpage-875") - ("tpage-967.go" "tpage-967") - ("tpage-884.go" "tpage-884") - ("tpage-1117.go" "tpage-1117") - ("crate-darkeco-cluster-ag.go" "crate-darkeco-cluster") - ("ecovalve-ag.go" "ecovalve") - ("ef-plane-ag.go" "ef-plane") - ("flying-lurker-ag.go" "flying-lurker") - ("medres-snow-ag.go" "medres-snow") - ("ogre-bridge-ag.go" "ogre-bridge") - ("ogre-bridgeend-ag.go" "ogre-bridgeend") - ("ogre-isle-ag.go" "ogre-isle") - ("ogre-step-ag.go" "ogre-step") - ("ogreboss-ag.go" "ogreboss") - ("ogrecam-ag.go" "ogrecam") - ("plunger-lurker-ag.go" "plunger-lurker") - ("racer-ag.go" "racer") - ("shortcut-boulder-ag.go" "shortcut-boulder") - ("tntbarrel-ag.go" "tntbarrel") - ("water-anim-ogre-ag.go" "water-anim-ogre") - ("ogre-vis.go" "ogre-vis") - ) - -("RACERP.CGO" - ("target-racer-h-OLD.o" "target-racer-h") - ("racer-part.o" "racer-part") - ("racer.o" "racer") - ("target-racer-OLD.o" "target-racer") - ("racer-states-OLD.o" "racer-states") - ("collide-reaction-racer.o" "collide-reaction-racer") - ("eichar-racer+0-ag.go" "eichar-racer+0") - ("tpage-1119.go" "tpage-1119") - ("blocking-plane.o" "blocking-plane") - ) - -("ROB.DGO" - ("cave-trap.o" "cave-trap") - ("spider-egg.o" "spider-egg") - ("robocave-part.o" "robocave-part") - ("eichar-pole+0-ag.go" "eichar-pole+0") - ("tpage-1318.go" "tpage-1318") - ("tpage-1319.go" "tpage-1319") - ("tpage-1317.go" "tpage-1317") - ("tpage-1316.go" "tpage-1316") - ("babak-ag.go" "babak") - ("baby-spider-ag.go" "baby-spider") - ("cavecrusher-ag.go" "cavecrusher") - ("caveelevator-ag.go" "caveelevator") - ("cavespatulatwo-ag.go" "cavespatulatwo") - ("cavetrapdoor-ag.go" "cavetrapdoor") - ("driller-lurker-ag.go" "driller-lurker") - ("ecovalve-ag.go" "ecovalve") - ("plat-ag.go" "plat") - ("plat-eco-ag.go" "plat-eco") - ("spider-egg-ag.go" "spider-egg") - ("spiderwebs-ag.go" "spiderwebs") - ("water-anim-robocave-ag.go" "water-anim-robocave") - ("robocave-vis.go" "robocave-vis") - ) - -("ROL.DGO" - ("target-racer-h.o" "target-racer-h") - ("racer-part.o" "racer-part") - ("racer.o" "racer") - ("target-racer.o" "target-racer") - ("racer-states.o" "racer-states") - ("collide-reaction-racer.o" "collide-reaction-racer") - ("eichar-racer+0-ag.go" "eichar-racer+0") - ("tpage-1119.go" "tpage-1119") - ("blocking-plane.o" "blocking-plane") - ("rolling-obs.o" "rolling-obs") - ("rolling-lightning-mole.o" "rolling-lightning-mole") - ("rolling-robber.o" "rolling-robber") - ("rolling-race-ring.o" "rolling-race-ring") - ("tpage-923.go" "tpage-923") - ("tpage-926.go" "tpage-926") - ("tpage-924.go" "tpage-924") - ("tpage-925.go" "tpage-925") - ("tpage-1353.go" "tpage-1353") - ("babak-ag.go" "babak") - ("dark-plant-ag.go" "dark-plant") - ("ecovalve-ag.go" "ecovalve") - ("ef-plane-ag.go" "ef-plane") - ("happy-plant-ag.go" "happy-plant") - ("lightning-mole-ag.go" "lightning-mole") - ("pusher-ag.go" "pusher") - ("race-ring-ag.go" "race-ring") - ("racer-ag.go" "racer") - ("robber-ag.go" "robber") - ("rolling-start-ag.go" "rolling-start") - ("rollingcam-ag.go" "rollingcam") - ("water-anim-rolling-ag.go" "water-anim-rolling") - ("rolling-vis.go" "rolling-vis") - ) - -("SNO.DGO" - ("blocking-plane.o" "blocking-plane") - ("flut-part.o" "flut-part") - ("flutflut.o" "flutflut") - ("target-flut.o" "target-flut") - ("eichar-flut+0-ag.go" "eichar-flut+0") - ("target-snowball.o" "target-snowball") - ("target-ice.o" "target-ice") - ("ice-cube.o" "ice-cube") - ("snow-ball.o" "snow-ball") - ("snow-obs.o" "snow-obs") - ("snow-flutflut-obs.o" "snow-flutflut-obs") - ("snow-bumper.o" "snow-bumper") - ("snow-ram-h.o" "snow-ram-h") - ("snow-ram-boss.o" "snow-ram-boss") - ("snow-ram.o" "snow-ram") - ("snow-part.o" "snow-part") - ("yeti.o" "yeti") - ("eichar-pole+0-ag.go" "eichar-pole+0") - ("eichar-ice+0-ag.go" "eichar-ice+0") - ("snow-bunny.o" "snow-bunny") - ("tpage-710.go" "tpage-710") - ("tpage-842.go" "tpage-842") - ("tpage-711.go" "tpage-711") - ("tpage-712.go" "tpage-712") - ("babak-ag.go" "babak") - ("ecovalve-ag.go" "ecovalve") - ("ef-plane-ag.go" "ef-plane") - ("flut-saddle-ag.go" "flut-saddle") - ("flutflut-plat-large-ag.go" "flutflut-plat-large") - ("flutflut-plat-med-ag.go" "flutflut-plat-med") - ("flutflut-plat-small-ag.go" "flutflut-plat-small") - ("ice-cube-ag.go" "ice-cube") - ("ice-cube-break-ag.go" "ice-cube-break") - ("orb-cache-top-ag.go" "orb-cache-top") - ("ram-ag.go" "ram") - ("ram-boss-ag.go" "ram-boss") - ("snow-ball-ag.go" "snow-ball") - ("snow-bridge-36-ag.go" "snow-bridge-36") - ("snow-bumper-ag.go" "snow-bumper") - ("snow-bunny-ag.go" "snow-bunny") - ("snow-button-ag.go" "snow-button") - ("snow-eggtop-ag.go" "snow-eggtop") - ("snow-fort-gate-ag.go" "snow-fort-gate") - ("snow-gears-ag.go" "snow-gears") - ("snow-log-ag.go" "snow-log") - ("snow-spatula-ag.go" "snow-spatula") - ("snow-switch-ag.go" "snow-switch") - ("snowcam-ag.go" "snowcam") - ("snowpusher-ag.go" "snowpusher") - ("yeti-ag.go" "yeti") - ("snow-vis.go" "snow-vis") - ) - -("SUB.DGO" - ("tpage-163.go" "tpage-163") - ("tpage-164.go" "tpage-164") - ("tpage-166.go" "tpage-166") - ("tpage-162.go" "tpage-162") - ("tpage-764.go" "tpage-764") - ("babak-ag.go" "babak") - ("blue-eco-charger-ag.go" "blue-eco-charger") - ("blue-eco-charger-orb-ag.go" "blue-eco-charger-orb") - ("bully-ag.go" "bully") - ("ecovalve-ag.go" "ecovalve") - ("floating-launcher-ag.go" "floating-launcher") - ("helix-button-ag.go" "helix-button") - ("helix-slide-door-ag.go" "helix-slide-door") - ("shover-ag.go" "shover") - ("steam-cap-ag.go" "steam-cap") - ("sunkencam-ag.go" "sunkencam") - ("sunkenfisha-ag.go" "sunkenfisha") - ("wall-plat-ag.go" "wall-plat") - ("water-anim-sunken-ag.go" "water-anim-sunken") - ("water-anim-sunken-dark-eco-ag.go" "water-anim-sunken-dark-eco") - ("sunkenb-vis.go" "sunkenb-vis") - ) - -("SUN.DGO" - ("sunken-part.o" "sunken-part") - ("sunken-part2.o" "sunken-part2") - ("sunken-part3.o" "sunken-part3") - ("sunken-part4.o" "sunken-part4") - ("sunken-part5.o" "sunken-part5") - ("target-tube.o" "target-tube") - ("eichar-tube+0-ag.go" "eichar-tube+0") - ("sunken-obs.o" "sunken-obs") - ("shover.o" "shover") - ("launcherdoor.o" "launcherdoor") - ("square-platform.o" "square-platform") - ("sun-iris-door.o" "sun-iris-door") - ("orbit-plat.o" "orbit-plat") - ("wedge-plats.o" "wedge-plats") - ("wall-plat.o" "wall-plat") - ("qbert-plat.o" "qbert-plat") - ("steam-cap.o" "steam-cap") - ("sun-exit-chamber.o" "sun-exit-chamber") - ("floating-launcher.o" "floating-launcher") - ("sunken-water.o" "sunken-water") - ("whirlpool.o" "whirlpool") - ("sunken-pipegame.o" "sunken-pipegame") - ("bully.o" "bully") - ("double-lurker.o" "double-lurker") - ("helix-water.o" "helix-water") - ("puffer.o" "puffer") - ("sunken-fish.o" "sunken-fish") - ("tpage-661.go" "tpage-661") - ("tpage-663.go" "tpage-663") - ("tpage-714.go" "tpage-714") - ("tpage-662.go" "tpage-662") - ("tpage-766.go" "tpage-766") - ("babak-ag.go" "babak") - ("bully-ag.go" "bully") - ("double-lurker-ag.go" "double-lurker") - ("double-lurker-top-ag.go" "double-lurker-top") - ("exit-chamber-ag.go" "exit-chamber") - ("generic-button-ag.go" "generic-button") - ("launcherdoor-ag.go" "launcherdoor") - ("orb-cache-top-ag.go" "orb-cache-top") - ("orbit-plat-ag.go" "orbit-plat") - ("orbit-plat-bottom-ag.go" "orbit-plat-bottom") - ("plat-sunken-ag.go" "plat-sunken") - ("puffer-ag.go" "puffer") - ("qbert-plat-ag.go" "qbert-plat") - ("qbert-plat-on-ag.go" "qbert-plat-on") - ("seaweed-ag.go" "seaweed") - ("shover-ag.go" "shover") - ("side-to-side-plat-ag.go" "side-to-side-plat") - ("square-platform-ag.go" "square-platform") - ("steam-cap-ag.go" "steam-cap") - ("sun-iris-door-ag.go" "sun-iris-door") - ("sunkencam-ag.go" "sunkencam") - ("sunkenfisha-ag.go" "sunkenfisha") - ("wall-plat-ag.go" "wall-plat") - ("water-anim-sunken-ag.go" "water-anim-sunken") - ("water-anim-sunken-dark-eco-ag.go" "water-anim-sunken-dark-eco") - ("wedge-plat-ag.go" "wedge-plat") - ("wedge-plat-outer-ag.go" "wedge-plat-outer") - ("whirlpool-ag.go" "whirlpool") - ("sunken-vis.go" "sunken-vis") - ) - -("SUNKEN.CGO" - ("sunken-part.o" "sunken-part") - ("sunken-part2.o" "sunken-part2") - ("sunken-part3.o" "sunken-part3") - ("sunken-part4.o" "sunken-part4") - ("sunken-part5.o" "sunken-part5") - ("target-tube.o" "target-tube") - ("eichar-tube+0-ag.go" "eichar-tube+0") - ("sunken-obs.o" "sunken-obs") - ("shover.o" "shover") - ("launcherdoor.o" "launcherdoor") - ("square-platform.o" "square-platform") - ("sun-iris-door.o" "sun-iris-door") - ("orbit-plat.o" "orbit-plat") - ("wedge-plats.o" "wedge-plats") - ("wall-plat.o" "wall-plat") - ("qbert-plat.o" "qbert-plat") - ("steam-cap.o" "steam-cap") - ("sun-exit-chamber.o" "sun-exit-chamber") - ("floating-launcher.o" "floating-launcher") - ("sunken-water.o" "sunken-water") - ("whirlpool.o" "whirlpool") - ("sunken-pipegame.o" "sunken-pipegame") - ("bully.o" "bully") - ("double-lurker.o" "double-lurker") - ("helix-water.o" "helix-water") - ("puffer.o" "puffer") - ("sunken-fish.o" "sunken-fish") - ) - -("SWA.DGO" - ("battlecontroller.o" "battlecontroller") - ("blocking-plane.o" "blocking-plane") - ("flut-part.o" "flut-part") - ("flutflut.o" "flutflut") - ("target-flut.o" "target-flut") - ("eichar-flut+0-ag.go" "eichar-flut+0") - ("swamp-obs.o" "swamp-obs") - ("swamp-bat.o" "swamp-bat") - ("swamp-rat.o" "swamp-rat") - ("swamp-rat-nest.o" "swamp-rat-nest") - ("kermit.o" "kermit") - ("swamp-part.o" "swamp-part") - ("billy.o" "billy") - ("eichar-pole+0-ag.go" "eichar-pole+0") - ("tpage-358.go" "tpage-358") - ("tpage-659.go" "tpage-659") - ("tpage-629.go" "tpage-629") - ("tpage-630.go" "tpage-630") - ("babak-ag.go" "babak") - ("balance-plat-ag.go" "balance-plat") - ("billy-ag.go" "billy") - ("billy-sidekick-ag.go" "billy-sidekick") - ("ecovalve-ag.go" "ecovalve") - ("ef-plane-ag.go" "ef-plane") - ("farthy-snack-ag.go" "farthy-snack") - ("flut-saddle-ag.go" "flut-saddle") - ("kermit-ag.go" "kermit") - ("sharkey-ag.go" "sharkey") - ("swamp-bat-ag.go" "swamp-bat") - ("swamp-rat-ag.go" "swamp-rat") - ("swamp-rat-nest-ag.go" "swamp-rat-nest") - ("swamp-rock-ag.go" "swamp-rock") - ("swamp-spike-ag.go" "swamp-spike") - ("swampcam-ag.go" "swampcam") - ("tar-plat-ag.go" "tar-plat") - ("swamp-vis.go" "swamp-vis") - ) - -("TIT.DGO" - ("static-screen.o" "static-screen") - ("title-obs.o" "title-obs") - ("tpage-1609.go" "tpage-1609") - ("tpage-416.go" "tpage-416") - ("tpage-415.go" "tpage-415") - ("tpage-397.go" "tpage-397") - ("tpage-1499.go" "tpage-1499") - ("logo-ag.go" "logo") - ("logo-black-ag.go" "logo-black") - ("logo-cam-ag.go" "logo-cam") - ("logo-volumes-ag.go" "logo-volumes") - ("ndi-ag.go" "ndi") - ("ndi-cam-ag.go" "ndi-cam") - ("ndi-volumes-ag.go" "ndi-volumes") - ("title-vis.go" "title-vis") - ) - -("TRA.DGO" - ("training-obs.o" "training-obs") - ("training-part.o" "training-part") - ("tpage-1309.go" "tpage-1309") - ("tpage-1311.go" "tpage-1311") - ("tpage-1310.go" "tpage-1310") - ("tpage-1308.go" "tpage-1308") - ("tpage-775.go" "tpage-775") - ("ecovalve-ag.go" "ecovalve") - ("jng-iris-door-ag.go" "jng-iris-door") - ("plat-eco-ag.go" "plat-eco") - ("pontoonfive-ag.go" "pontoonfive") - ("scarecrow-a-ag.go" "scarecrow-a") - ("scarecrow-b-ag.go" "scarecrow-b") - ("sharkey-ag.go" "sharkey") - ("trainingcam-ag.go" "trainingcam") - ("warp-gate-switch-ag.go" "warp-gate-switch") - ("warpgate-ag.go" "warpgate") - ("water-anim-training-ag.go" "water-anim-training") - ("training-vis.go" "training-vis") - ) - -("VI1.DGO" - ("villagep-obs.o" "villagep-obs") - ("oracle.o" "oracle") - ("farmer.o" "farmer") - ("explorer.o" "explorer") - ("assistant.o" "assistant") - ("sage.o" "sage") - ("yakow.o" "yakow") - ("village-obs.o" "village-obs") - ("fishermans-boat.o" "fishermans-boat") - ("village1-part.o" "village1-part") - ("village1-part2.o" "village1-part2") - ("sequence-a-village1.o" "sequence-a-village1") - ("tpage-398.go" "tpage-398") - ("tpage-400.go" "tpage-400") - ("tpage-399.go" "tpage-399") - ("tpage-401.go" "tpage-401") - ("tpage-1470.go" "tpage-1470") - ("assistant-ag.go" "assistant") - ("evilplant-ag.go" "evilplant") - ("explorer-ag.go" "explorer") - ("farmer-ag.go" "farmer") - ("fishermans-boat-ag.go" "fishermans-boat") - ("hutlamp-ag.go" "hutlamp") - ("mayorgears-ag.go" "mayorgears") - ("medres-beach-ag.go" "medres-beach") - ("medres-beach1-ag.go" "medres-beach1") - ("medres-beach2-ag.go" "medres-beach2") - ("medres-beach3-ag.go" "medres-beach3") - ("medres-jungle-ag.go" "medres-jungle") - ("medres-jungle1-ag.go" "medres-jungle1") - ("medres-jungle2-ag.go" "medres-jungle2") - ("medres-misty-ag.go" "medres-misty") - ("medres-training-ag.go" "medres-training") - ("medres-village11-ag.go" "medres-village11") - ("medres-village12-ag.go" "medres-village12") - ("medres-village13-ag.go" "medres-village13") - ("oracle-ag.go" "oracle") - ("orb-cache-top-ag.go" "orb-cache-top") - ("reflector-middle-ag.go" "reflector-middle") - ("revcycle-ag.go" "revcycle") - ("revcycleprop-ag.go" "revcycleprop") - ("ropebridge-32-ag.go" "ropebridge-32") - ("sage-ag.go" "sage") - ("sagesail-ag.go" "sagesail") - ("sharkey-ag.go" "sharkey") - ("villa-starfish-ag.go" "villa-starfish") - ("village-cam-ag.go" "village-cam") - ("village1cam-ag.go" "village1cam") - ("warp-gate-switch-ag.go" "warp-gate-switch") - ("warpgate-ag.go" "warpgate") - ("water-anim-village1-ag.go" "water-anim-village1") - ("windmill-sail-ag.go" "windmill-sail") - ("windspinner-ag.go" "windspinner") - ("yakow-ag.go" "yakow") - ("village1-vis.go" "village1-vis") - ) - -("VI2.DGO" - ("villagep-obs.o" "villagep-obs") - ("oracle.o" "oracle") - ("village2-part.o" "village2-part") - ("village2-obs.o" "village2-obs") - ("village2-part2.o" "village2-part2") - ("gambler.o" "gambler") - ("warrior.o" "warrior") - ("geologist.o" "geologist") - ("swamp-blimp.o" "swamp-blimp") - ("sage-bluehut.o" "sage-bluehut") - ("flutflut-bluehut.o" "flutflut-bluehut") - ("assistant-village2.o" "assistant-village2") - ("sunken-elevator.o" "sunken-elevator") - ("tpage-919.go" "tpage-919") - ("tpage-922.go" "tpage-922") - ("tpage-920.go" "tpage-920") - ("tpage-921.go" "tpage-921") - ("tpage-1476.go" "tpage-1476") - ("allpontoons-ag.go" "allpontoons") - ("assistant-village2-ag.go" "assistant-village2") - ("barrel-ag.go" "barrel") - ("ceilingflag-ag.go" "ceilingflag") - ("exit-chamber-dummy-ag.go" "exit-chamber-dummy") - ("fireboulder-ag.go" "fireboulder") - ("flutflut-bluehut-ag.go" "flutflut-bluehut") - ("gambler-ag.go" "gambler") - ("geologist-ag.go" "geologist") - ("jaws-ag.go" "jaws") - ("medres-rolling-ag.go" "medres-rolling") - ("medres-rolling1-ag.go" "medres-rolling1") - ("medres-village2-ag.go" "medres-village2") - ("ogreboss-village2-ag.go" "ogreboss-village2") - ("oracle-ag.go" "oracle") - ("orb-cache-top-ag.go" "orb-cache-top") - ("pontoonfive-ag.go" "pontoonfive") - ("pontoonten-ag.go" "pontoonten") - ("precursor-arm-ag.go" "precursor-arm") - ("sage-bluehut-ag.go" "sage-bluehut") - ("sharkey-ag.go" "sharkey") - ("sunken-elevator-ag.go" "sunken-elevator") - ("swamp-blimp-ag.go" "swamp-blimp") - ("swamp-rope-ag.go" "swamp-rope") - ("swamp-tetherrock-ag.go" "swamp-tetherrock") - ("swamp-tetherrock-explode-ag.go" "swamp-tetherrock-explode") - ("swampcam-ag.go" "swampcam") - ("village-cam-ag.go" "village-cam") - ("village2cam-ag.go" "village2cam") - ("warp-gate-switch-ag.go" "warp-gate-switch") - ("warpgate-ag.go" "warpgate") - ("warrior-ag.go" "warrior") - ("water-anim-village2-ag.go" "water-anim-village2") - ("village2-vis.go" "village2-vis") - ) - -("VI3.DGO" - ("villagep-obs.o" "villagep-obs") - ("oracle.o" "oracle") - ("village3-part.o" "village3-part") - ("village3-obs.o" "village3-obs") - ("minecart.o" "minecart") - ("miners.o" "miners") - ("assistant-village3.o" "assistant-village3") - ("sage-village3.o" "sage-village3") - ("tpage-1208.go" "tpage-1208") - ("tpage-1210.go" "tpage-1210") - ("tpage-1209.go" "tpage-1209") - ("tpage-1194.go" "tpage-1194") - ("assistant-village3-ag.go" "assistant-village3") - ("cavegem-ag.go" "cavegem") - ("evilbro-village3-ag.go" "evilbro-village3") - ("evilsis-village3-ag.go" "evilsis-village3") - ("gondola-ag.go" "gondola") - ("gondolacables-ag.go" "gondolacables") - ("lavaspoutdrip-ag.go" "lavaspoutdrip") - ("medres-finalboss-ag.go" "medres-finalboss") - ("medres-ogre-ag.go" "medres-ogre") - ("medres-ogre2-ag.go" "medres-ogre2") - ("medres-ogre3-ag.go" "medres-ogre3") - ("minecartsteel-ag.go" "minecartsteel") - ("minershort-ag.go" "minershort") - ("minertall-ag.go" "minertall") - ("oracle-ag.go" "oracle") - ("pistons-ag.go" "pistons") - ("sage-village3-ag.go" "sage-village3") - ("vil3-bridge-36-ag.go" "vil3-bridge-36") - ("village-cam-ag.go" "village-cam") - ("warp-gate-switch-ag.go" "warp-gate-switch") - ("warpgate-ag.go" "warpgate") - ("water-anim-village3-ag.go" "water-anim-village3") - ("village3-vis.go" "village3-vis") - ) - -("VILLAGEP.CGO" - ("villagep-obs.o" "villagep-obs") - ("oracle.o" "oracle") - ) - -("WATER-AN.CGO" - ("water-anim.o" "water-anim") - ("lava.o" "lava") - ) - diff --git a/goal_src/build/kernel_dgos.gc b/goal_src/build/kernel_dgos.gc deleted file mode 100644 index 4df9a0e142..0000000000 --- a/goal_src/build/kernel_dgos.gc +++ /dev/null @@ -1,10 +0,0 @@ -("KERNEL.CGO" - ("gcommon.o" "gcommon") - ("gstring-h.o" "gstring-h") - ("gkernel-h.o" "gkernel-h") - ("gkernel.o" "gkernel") - ("pskernel.o" "pskernel") - ("gstring.o" "gstring") - ("dgo-h.o" "dgo-h") - ("gstate.o" "gstate") - ) \ No newline at end of file diff --git a/goal_src/dgos/engine.gd b/goal_src/dgos/engine.gd index 7abbc3cad0..976de2883a 100644 --- a/goal_src/dgos/engine.gd +++ b/goal_src/dgos/engine.gd @@ -209,7 +209,6 @@ ("level-info.o" "level-info") ("level.o" "level") ("text.o" "text") - ("subtitle.o" "subtitle") ;; added ("collide-probe.o" "collide-probe") ("collide-frag.o" "collide-frag") ("collide-mesh.o" "collide-mesh") @@ -279,6 +278,7 @@ ("progress-part.o" "progress-part") ("progress-draw.o" "progress-draw") ("progress.o" "progress") + ("progress-pc.o" "progress-pc") ;; added ("credits.o" "credits") ("projectiles.o" "projectiles") ("ocean.o" "ocean") @@ -294,6 +294,8 @@ ("anim-tester.o" "anim-tester") ("viewer.o" "viewer") ("part-tester.o" "part-tester") + ("anim-tester-x.o" "anim-tester-x") ;; added ("default-menu.o" "default-menu") + ("subtitle.o" "subtitle") ;; added ) diff --git a/goal_src/dgos/game.gd b/goal_src/dgos/game.gd index 7b3573d782..36f2ef82c0 100644 --- a/goal_src/dgos/game.gd +++ b/goal_src/dgos/game.gd @@ -205,7 +205,6 @@ ("level-info.o" "level-info") ("level.o" "level") ("text.o" "text") - ("subtitle.o" "subtitle") ;; added ("collide-probe.o" "collide-probe") ("collide-frag.o" "collide-frag") ("collide-mesh.o" "collide-mesh") @@ -275,6 +274,7 @@ ("progress-part.o" "progress-part") ("progress-draw.o" "progress-draw") ("progress.o" "progress") + ("progress-pc.o" "progress-pc") ;; added ("credits.o" "credits") ("projectiles.o" "projectiles") ("ocean.o" "ocean") @@ -290,7 +290,9 @@ ("anim-tester.o" "anim-tester") ("viewer.o" "viewer") ("part-tester.o" "part-tester") + ("anim-tester-x.o" "anim-tester-x") ;; added ("default-menu.o" "default-menu") + ("subtitle.o" "subtitle") ;; added ("dir-tpages.go" "dir-tpages") ("tpage-463.go" "tpage-463") ("tpage-2.go" "tpage-2") @@ -330,4 +332,5 @@ ("plat-eco.o" "plat-eco") ("ropebridge.o" "ropebridge") ("ticky.o" "ticky") + ("hud-classes-pc.o" "hud-classes-pc") ;; added ) diff --git a/goal_src/engine/ambient/ambient.gc b/goal_src/engine/ambient/ambient.gc index 1ebb0e8fe3..bbbfec5f62 100644 --- a/goal_src/engine/ambient/ambient.gc +++ b/goal_src/engine/ambient/ambient.gc @@ -229,7 +229,7 @@ ) (and *target* (!= (-> *target* next-state name) 'target-look-around) - (zero? (logand (-> *target* state-flags) #x8008)) + (zero? (logand (-> *target* state-flags) (state-flags being-attacked dying))) (= *master-mode* 'game) ) ) @@ -259,15 +259,7 @@ (let ((s3-1 (level-hint-task-process arg2 (the-as uint128 arg0) arg1))) (when (!= s3-1 -1) (kill-current-level-hint '() '() 'exit) - (let ((s2-0 (get-process *default-dead-pool* level-hint #x4000))) - (when s2-0 - (let ((t9-4 (method-of-type level-hint activate))) - (t9-4 (the-as level-hint s2-0) arg3 'level-hint (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 level-hint-init-by-other s3-1 arg1 arg2) - (-> s2-0 ppointer) - ) - ) + (process-spawn level-hint s3-1 arg1 arg2 :to arg3) ) ) 0 @@ -281,15 +273,7 @@ ) ) (the-as object (and (not *hint-semaphore*) - (let ((s2-0 (get-process *default-dead-pool* level-hint #x4000))) - (when s2-0 - (let ((t9-2 (method-of-type level-hint activate))) - (t9-2 (the-as level-hint s2-0) arg2 'level-hint (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 ambient-hint-init-by-other arg0 arg1 arg3) - (-> s2-0 ppointer) - ) - ) + (process-spawn level-hint :init ambient-hint-init-by-other arg0 arg1 arg3 :to arg2) ) ) ) @@ -308,6 +292,7 @@ (none) ) +(#when PC_PORT (define *level-hint-spool-name* (the string #f))) (defbehavior level-hint-init-by-other level-hint ((arg0 game-text-id) (arg1 string) (arg2 entity)) (mark-text-as-seen *game-info* arg0) (set! (-> self text-id-to-display) arg0) @@ -316,7 +301,7 @@ (set! (-> self total-off-time) 0) (set! (-> self last-time) (-> *display* base-frame-counter)) (set! *hint-semaphore* (the-as (pointer level-hint) (process->ppointer self))) - (push-setting! *setting-control* self 'hint (process->ppointer self) 0.0 0) + (add-setting! 'hint (process->ppointer self) 0.0 0) (set! (-> self voicebox) (the-as handle #f)) (let ((s5-1 (res-lump-struct arg2 'play-mode structure)) (a0-6 (the-as string ((method-of-type res-lump get-property-struct) @@ -357,12 +342,12 @@ (set! (-> self last-time) (-> *display* base-frame-counter)) (set! (-> self trans) arg1) (set! *hint-semaphore* (the-as (pointer level-hint) (process->ppointer self))) - (push-setting! *setting-control* self 'hint (process->ppointer self) 0.0 0) + (add-setting! 'hint (process->ppointer self) 0.0 0) (set! (-> self mode) arg2) (if (or (= arg2 'camera) (= arg2 'ambient) (= arg2 'stinger)) - (push-setting! *setting-control* self 'ambient (process->ppointer self) 0.0 0) + (add-setting! 'ambient (process->ppointer self) 0.0 0) ) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (set! (-> self event-hook) (lambda :behavior level-hint ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) @@ -406,8 +391,7 @@ ) (defstate level-hint-normal (level-hint) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'exit) @@ -420,15 +404,13 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (if (= (ppointer->process *hint-semaphore*) self) (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) (none) ) - :code - (behavior () + :code (behavior () (cond ((= (-> self text-id-to-display) (game-text-id zero)) (if *debug-segment* @@ -468,8 +450,7 @@ ) (defstate level-hint-sidekick (level-hint) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'exit) @@ -487,22 +468,22 @@ ) ) ) - :exit - (behavior () + :exit (behavior () + (#when PC_PORT (set! *level-hint-spool-name* #f)) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) - (clear-pending-settings-from-process *setting-control* self 'dialog-volume) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'dialog-volume) (if (= (ppointer->process *hint-semaphore*) self) (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) (send-event (handle->process (-> self voicebox)) 'die) (none) ) - :code - (behavior ((arg0 string)) + :code (behavior ((arg0 string)) + (#when PC_PORT (set! *level-hint-spool-name* arg0)) (when (and (-> *setting-control* current play-hints) (< 0.0 (-> *setting-control* current dialog-volume))) (case (-> self mode) (('voicebox) @@ -521,7 +502,7 @@ (s4-1 string->sound-name) ) (format (clear *temp-string*) "spool-~S" arg0) - (let ((s5-2 (s5-1 (s4-1 *temp-string*) (new-sound-id) 1024 0 0 1 #t))) + (let ((s5-2 (s5-1 (s4-1 *temp-string*) (new-sound-id) 1024 0 0 (sound-group sfx) #t))) (set! (-> self sound-id) s5-2) (let ((s4-3 (-> *display* base-frame-counter))) (while (and (!= (current-str-id) s5-2) (< (- (-> *display* base-frame-counter) s4-3) (seconds 5))) @@ -530,11 +511,33 @@ ) (cond ((= (current-str-id) s5-2) - (push-setting! *setting-control* self 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) - (push-setting! *setting-control* self 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) - (push-setting! *setting-control* self 'dialog-volume 'rel (-> *setting-control* current dialog-volume-hint) 0) - (while (= (current-str-id) s5-2) - (suspend) + (add-setting! 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) + (add-setting! 'dialog-volume 'rel (-> *setting-control* current dialog-volume-hint) 0) + ;; PAL patch here + (let ((s5-1 -1) + (s3-1 (-> *display* base-frame-counter)) + (s4-4 (-> *display* base-frame-counter)) + ) + (label cfg-27) + (let ((v1-36 (current-str-pos s5-2))) + (when (< s5-1 v1-36) + (if (> v1-36 0) + (set! s5-1 v1-36) + ) + (set! s3-1 (-> *display* base-frame-counter)) + ) + (when (not (and (or (< v1-36 0) + (>= (- (-> *display* base-frame-counter) s3-1) (seconds 3)) + (>= (- (-> *display* base-frame-counter) s4-4) (seconds 60)) + ) + *sound-player-enable* + ) + ) + (suspend) + (goto cfg-27) + ) + ) ) ) (else @@ -550,22 +553,19 @@ ) (defstate level-hint-ambient-sound (level-hint) - :event - (-> level-hint-sidekick event) - :exit - (behavior () + :event (-> level-hint-sidekick event) + :exit (behavior () (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) (if (= (ppointer->process *hint-semaphore*) self) (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) (none) ) - :code - (behavior ((arg0 string)) + :code (behavior ((arg0 string)) (while (not *sound-player-enable*) (suspend) ) @@ -576,7 +576,7 @@ ) (format (clear *temp-string*) "spool-~S" arg0) (set! (-> self sound-id) - (s5-0 (s4-0 *temp-string*) (new-sound-id) 1024 1 0 1 (the-as symbol (-> self trans))) + (s5-0 (s4-0 *temp-string*) (new-sound-id) 1024 1 0 (sound-group sfx) (the-as symbol (-> self trans))) ) ) ) @@ -585,7 +585,7 @@ (s4-2 string->sound-name) ) (format (clear *temp-string*) "spool-~S" arg0) - (set! (-> self sound-id) (s5-1 (s4-2 *temp-string*) (new-sound-id) 1024 0 0 1 #t)) + (set! (-> self sound-id) (s5-1 (s4-2 *temp-string*) (new-sound-id) 1024 0 0 (sound-group sfx) #t)) ) ) ) @@ -597,11 +597,33 @@ (cond ((= (current-str-id) (-> self sound-id)) (when (or (= (-> self mode) 'stinger) (= (-> self mode) 'camera)) - (push-setting! *setting-control* self 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) - (push-setting! *setting-control* self 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) + (add-setting! 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) ) - (while (= (current-str-id) (-> self sound-id)) - (suspend) + ;; PAL patch here + (let ((gp-1 -1) + (s4-4 (-> *display* base-frame-counter)) + (s5-4 (-> *display* base-frame-counter)) + ) + (label cfg-19) + (let ((v1-24 (current-str-pos (-> self sound-id)))) + (when (< gp-1 v1-24) + (if (> v1-24 0) + (set! gp-1 v1-24) + ) + (set! s4-4 (-> *display* base-frame-counter)) + ) + (when (not (and (or (< v1-24 0) + (>= (- (-> *display* base-frame-counter) s4-4) (seconds 3)) + (>= (- (-> *display* base-frame-counter) s5-4) (seconds 60)) + ) + *sound-player-enable* + ) + ) + (suspend) + (goto cfg-19) + ) + ) ) ) (else @@ -614,11 +636,9 @@ ) (defstate level-hint-error (level-hint) - :event - (-> level-hint-normal event) - :code - (behavior ((arg0 string) (arg1 string)) - (clear-pending-settings-from-process *setting-control* self 'hint) + :event (-> level-hint-normal event) + :code (behavior ((arg0 string) (arg1 string)) + (remove-setting! 'hint) (let ((s4-0 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) s4-0) (seconds 1)) (when (and *debug-segment* (not (paused?)) (not (str-is-playing?)) (bottom-hud-hidden?)) @@ -648,8 +668,7 @@ ) (defstate level-hint-exit (level-hint) - :code - (behavior () + :code (behavior () (if (= (ppointer->process *hint-semaphore*) self) (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) @@ -671,7 +690,7 @@ *temp-string* (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) *temp-string* (-> arg0 bsphere) (font-color orange-red) @@ -710,15 +729,7 @@ ) ((!= s5-0 -1) (kill-current-level-hint '() '() 'exit) - (let ((s4-0 (get-process *default-dead-pool* level-hint #x4000))) - (when s4-0 - (let ((t9-8 (method-of-type level-hint activate))) - (t9-8 (the-as level-hint s4-0) pp 'level-hint (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 level-hint-init-by-other s5-0 #f (-> arg0 ambient)) - (-> s4-0 ppointer) - ) - ) + (process-spawn level-hint s5-0 #f (-> arg0 ambient) :to pp) ) ) ) @@ -747,9 +758,9 @@ (set! sv-16 (symbol->string (res-lump-struct s5-0 'effect-name symbol :time f30-0))) (let ((s4-2 (new 'stack 'sound-spec))) (set! (-> s4-2 sound-name) (string->sound-name sv-16)) - (logior! (-> s4-2 mask) 1) + (logior! (-> s4-2 mask) (sound-mask volume)) (set! (-> s4-2 volume) 1024) - (logior! (-> s4-2 mask) 4) + (logior! (-> s4-2 mask) (sound-mask bend)) (set! (-> s4-2 bend) (the int (* 327.66998 (rand-vu-float-range -100.0 100.0)))) (set! sv-112 (new 'static 'res-tag)) (let ((a1-7 ((method-of-type res-lump get-property-data) @@ -799,7 +810,7 @@ (s4-0 (new 'stack 'sound-spec)) ) (set! (-> s4-0 sound-name) (string->sound-name s2-0)) - (logior! (-> s4-0 mask) 1) + (logior! (-> s4-0 mask) (sound-mask volume)) (set! (-> s4-0 volume) 1024) (when (the-as (pointer res-tag) s3-0) (let ((t9-2 effect-param->sound-spec) @@ -1119,7 +1130,7 @@ (when *display-ambient-sound-marks* (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string (res-lump-struct obj 'effect-name symbol :time 0.0)) gp-0 (font-color white) @@ -1147,7 +1158,7 @@ (when (and (nonzero? a1-7) *common-text*) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (lookup-text! *common-text* (the-as game-text-id a1-7) #f) gp-0 (font-color white) @@ -1213,7 +1224,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (res-lump-struct obj 'name string) gp-0 (font-color white) @@ -1221,7 +1232,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string s5-0) gp-0 (font-color white) diff --git a/goal_src/engine/ambient/mood-tables.gc b/goal_src/engine/ambient/mood-tables.gc index 8405405aa8..d616bf641b 100644 --- a/goal_src/engine/ambient/mood-tables.gc +++ b/goal_src/engine/ambient/mood-tables.gc @@ -305,11 +305,9 @@ (none) ) -(define - *default-interp-table* +(define *default-interp-table* (new 'static 'sky-color-day - :hour - (new 'static 'inline-array sky-color-hour 24 + :hour (new 'static 'inline-array sky-color-hour 24 (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.2 :morph-end 0.4) (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.4 :morph-end 0.6) (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.6 :morph-end 0.8) @@ -338,11 +336,9 @@ ) ) -(define - *village1-palette-interp-table* +(define *village1-palette-interp-table* (new 'static 'sky-color-day - :hour - (new 'static 'inline-array sky-color-hour 24 + :hour (new 'static 'inline-array sky-color-hour 24 (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.2 :morph-end 0.4) (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.4 :morph-end 0.6) (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.6 :morph-end 0.8) @@ -371,11 +367,9 @@ ) ) -(define - *misty-palette-interp-table* +(define *misty-palette-interp-table* (new 'static 'sky-color-day - :hour - (new 'static 'inline-array sky-color-hour 24 + :hour (new 'static 'inline-array sky-color-hour 24 (new 'static 'sky-color-hour :snapshot1 1 :morph-start 0.04 :morph-end 0.08) (new 'static 'sky-color-hour :snapshot1 1 :morph-start 0.08 :morph-end 0.12) (new 'static 'sky-color-hour :snapshot1 1 :morph-start 0.12 :morph-end 0.16) @@ -404,11 +398,9 @@ ) ) -(define - *firecanyon-palette-interp-table* +(define *firecanyon-palette-interp-table* (new 'static 'sky-color-day - :hour - (new 'static 'inline-array sky-color-hour 24 + :hour (new 'static 'inline-array sky-color-hour 24 (new 'static 'sky-color-hour :snapshot1 3 :morph-end 0.08) (new 'static 'sky-color-hour :snapshot1 3 :morph-start 0.08 :morph-end 0.12) (new 'static 'sky-color-hour :snapshot1 3 :morph-start 0.12 :morph-end 0.16) @@ -437,11 +429,9 @@ ) ) -(define - *rolling-palette-interp-table* +(define *rolling-palette-interp-table* (new 'static 'sky-color-day - :hour - (new 'static 'inline-array sky-color-hour 24 + :hour (new 'static 'inline-array sky-color-hour 24 (new 'static 'sky-color-hour :snapshot1 2 :snapshot2 3 :morph-start 0.2 :morph-end 0.4) (new 'static 'sky-color-hour :snapshot1 2 :snapshot2 3 :morph-start 0.4 :morph-end 0.6) (new 'static 'sky-color-hour :snapshot1 2 :snapshot2 3 :morph-start 0.6 :morph-end 0.8) @@ -470,11 +460,9 @@ ) ) -(define - *village2-sky-texture-table* +(define *village2-sky-texture-table* (new 'static 'sky-color-day - :hour - (new 'static 'inline-array sky-color-hour 24 + :hour (new 'static 'inline-array sky-color-hour 24 (new 'static 'sky-color-hour :snapshot1 1 :snapshot2 4 :morph-start 0.2 :morph-end 0.4) (new 'static 'sky-color-hour :snapshot1 1 :snapshot2 4 :morph-start 0.4 :morph-end 0.6) (new 'static 'sky-color-hour :snapshot1 1 :snapshot2 4 :morph-start 0.6 :morph-end 0.8) @@ -503,11 +491,9 @@ ) ) -(define - *finalboss-interp-table* +(define *finalboss-interp-table* (new 'static 'sky-color-day - :hour - (new 'static 'inline-array sky-color-hour 24 + :hour (new 'static 'inline-array sky-color-hour 24 (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.2 :morph-end 0.4) (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.4 :morph-end 0.6) (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.6 :morph-end 0.8) @@ -536,157 +522,109 @@ ) ) -(define - *village1-mood-fog-table* +(define *village1-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog :fog-color (new 'static 'vector :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 4984832.0 :z 255.0 :w 51.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 4984832.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 80.0 :z 64.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 80.0 :z 64.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) ) ) ) -(define - *village1-mood-lights-table* +(define *village1-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.066987306 :y 0.25000003 :z 0.9659258) - :lgt-color - (new 'static 'vector :x 1.558 :y 1.454 :z 0.228 :w 1.0) + :direction (new 'static 'vector :x -0.066987306 :y 0.25000003 :z 0.9659258) + :lgt-color (new 'static 'vector :x 1.558 :y 1.454 :z 0.228 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.4 :y 0.266 :z 0.6 :w 1.0) - :shadow - (new 'static 'vector :x -0.066987306 :y 0.25000003 :z 0.9659258) + :amb-color (new 'static 'vector :x 0.4 :y 0.266 :z 0.6 :w 1.0) + :shadow (new 'static 'vector :x -0.066987306 :y 0.25000003 :z 0.9659258) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) - :lgt-color - (new 'static 'vector :x 1.632 :y 1.586 :z 1.428 :w 1.0) + :direction (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) + :lgt-color (new 'static 'vector :x 1.632 :y 1.586 :z 1.428 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.387 :y 0.387 :z 0.475 :w 1.0) - :shadow - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) + :amb-color (new 'static 'vector :x 0.387 :y 0.387 :z 0.475 :w 1.0) + :shadow (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.25881904 :y 0.9659258) - :lgt-color - (new 'static 'vector :x 1.644 :y 1.598 :z 1.438 :w 1.0) + :direction (new 'static 'vector :x -0.25881904 :y 0.9659258) + :lgt-color (new 'static 'vector :x 1.644 :y 1.598 :z 1.438 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.362 :y 0.362 :z 0.425 :w 1.0) - :shadow - (new 'static 'vector :x -0.25881904 :y 0.9659258) + :amb-color (new 'static 'vector :x 0.362 :y 0.362 :z 0.425 :w 1.0) + :shadow (new 'static 'vector :x -0.25881904 :y 0.9659258) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z -0.70710677) - :lgt-color - (new 'static 'vector :x 1.632 :y 1.586 :z 1.428 :w 1.0) + :direction (new 'static 'vector :x -0.1830127 :y 0.6830127 :z -0.70710677) + :lgt-color (new 'static 'vector :x 1.632 :y 1.586 :z 1.428 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.387 :y 0.387 :z 0.475 :w 1.0) - :shadow - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z -0.70710677) + :amb-color (new 'static 'vector :x 0.387 :y 0.387 :z 0.475 :w 1.0) + :shadow (new 'static 'vector :x -0.1830127 :y 0.6830127 :z -0.70710677) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.066987306 :y 0.25000003 :z -0.9659258) - :lgt-color - (new 'static 'vector :x 1.646 :y 1.118 :w 1.0) + :direction (new 'static 'vector :x -0.066987306 :y 0.25000003 :z -0.9659258) + :lgt-color (new 'static 'vector :x 1.646 :y 1.118 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.32 :y 0.35 :z 0.6 :w 1.0) - :shadow - (new 'static 'vector :x -0.066987306 :y 0.25000003 :z -0.9659258) + :amb-color (new 'static 'vector :x 0.32 :y 0.35 :z 0.6 :w 1.0) + :shadow (new 'static 'vector :x -0.066987306 :y 0.25000003 :z -0.9659258) ) (new 'static 'mood-lights :direction (new 'static 'vector :y 1.0) - :lgt-color - (new 'static 'vector :x 0.25 :y 0.5 :z 1.0 :w 1.0) + :lgt-color (new 'static 'vector :x 0.25 :y 0.5 :z 1.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.31 :y 0.29 :z 0.35 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) + :amb-color (new 'static 'vector :x 0.31 :y 0.29 :z 0.35 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) - :lgt-color - (new 'static 'vector :x 0.192 :y 0.256 :z 0.961 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) + :lgt-color (new 'static 'vector :x 0.192 :y 0.256 :z 0.961 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.383 :y 0.439 :z 0.7 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) + :amb-color (new 'static 'vector :x 0.383 :y 0.439 :z 0.7 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.354 :y 0.866 :z 0.354) - :lgt-color - (new 'static 'vector :x 0.0495 :y 0.62075 :z 0.326 :w 1.0) + :direction (new 'static 'vector :x 0.354 :y 0.866 :z 0.354) + :lgt-color (new 'static 'vector :x 0.0495 :y 0.62075 :z 0.326 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.25 :y 0.439 :z 0.7 :w 1.0) - :shadow - (new 'static 'vector :x 0.5393 :y 0.7652 :z -0.3514) + :amb-color (new 'static 'vector :x 0.25 :y 0.439 :z 0.7 :w 1.0) + :shadow (new 'static 'vector :x 0.5393 :y 0.7652 :z -0.3514) ) ) ) @@ -708,231 +646,165 @@ (update-mood-shadow-direction (-> *village1-mood-lights-table* data 7)) -(define - *village1-mood-sun-table* +(define *village1-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 196.0 :z 64.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 196.0 :z 64.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 96.0 :y 96.0 :z 196.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 96.0 :y 96.0 :z 196.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 64.0 :y 150.0 :z 196.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 64.0 :y 150.0 :z 196.0 :w 255.0) ) ) ) ) -(define - *training-mood-fog-table* +(define *training-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog :fog-color (new 'static 'vector :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 51.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 80.0 :z 64.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 80.0 :z 64.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) ) ) ) -(define - *snow-mood-fog-table* +(define *snow-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 210.0 :y 183.0 :z 160.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 210.0 :y 183.0 :z 160.0 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 190.25 :y 198.0 :z 195.25 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 190.25 :y 198.0 :z 195.25 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 180.5 :y 203.0 :z 220.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 180.5 :y 203.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 192.75 :y 190.5 :z 197.75 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 192.75 :y 190.5 :z 197.75 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 205.0 :y 178.0 :z 175.5 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 205.0 :y 178.0 :z 175.5 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 48.0 :y 44.0 :z 64.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 48.0 :y 44.0 :z 64.0 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 8.0 :y 16.0 :z 32.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 8.0 :y 16.0 :z 32.0 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 16.0 :y 64.0 :z 60.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 16.0 :y 64.0 :z 60.0 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) ) ) ) -(define - *snow-mood-lights-table* +(define *snow-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.067 :y 0.25 :z 0.966) - :lgt-color - (new 'static 'vector :x 0.943 :y 0.88 :z 0.137 :w 1.0) + :direction (new 'static 'vector :x -0.067 :y 0.25 :z 0.966) + :lgt-color (new 'static 'vector :x 0.943 :y 0.88 :z 0.137 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.449 :y 0.35 :z 0.599 :w 1.0) - :shadow - (new 'static 'vector :x -0.066987306 :y 0.25000003 :z 0.9659258) + :amb-color (new 'static 'vector :x 0.449 :y 0.35 :z 0.599 :w 1.0) + :shadow (new 'static 'vector :x -0.066987306 :y 0.25000003 :z 0.9659258) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.259 :y 0.966) - :lgt-color - (new 'static 'vector :x 0.66 :y 0.436 :z 0.291 :w 1.0) + :direction (new 'static 'vector :x -0.259 :y 0.966) + :lgt-color (new 'static 'vector :x 0.66 :y 0.436 :z 0.291 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.358 :y 0.575 :z 0.716 :w 1.0) - :shadow - (new 'static 'vector :x -0.25881904 :y 0.9659258) + :amb-color (new 'static 'vector :x 0.358 :y 0.575 :z 0.716 :w 1.0) + :shadow (new 'static 'vector :x -0.25881904 :y 0.9659258) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.067 :y 0.25 :z -0.966) - :lgt-color - (new 'static 'vector :x 1.056 :y 0.747 :w 1.0) + :direction (new 'static 'vector :x -0.067 :y 0.25 :z -0.966) + :lgt-color (new 'static 'vector :x 1.056 :y 0.747 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.383 :y 0.366 :z 0.599 :w 1.0) - :shadow - (new 'static 'vector :x -0.066987306 :y 0.25000003 :z -0.9659258) + :amb-color (new 'static 'vector :x 0.383 :y 0.366 :z 0.599 :w 1.0) + :shadow (new 'static 'vector :x -0.066987306 :y 0.25000003 :z -0.9659258) ) (new 'static 'mood-lights :direction (new 'static 'vector :x 0.866 :y 0.5) - :lgt-color - (new 'static 'vector :x 0.067 :y 0.089 :z 0.333 :w 1.0) + :lgt-color (new 'static 'vector :x 0.067 :y 0.089 :z 0.333 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.304 :y 0.409 :z 0.76 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) + :amb-color (new 'static 'vector :x 0.304 :y 0.409 :z 0.76 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -1041,62 +913,49 @@ 0.41 ) -(define - *snow-mood-sun-table* +(define *snow-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 192.0 :y 176.5 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 192.0 :y 176.5 :z 96.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 176.0 :z 192.0 :w 255.0) + :env-color (new 'static 'vector :x 128.0 :y 176.0 :z 192.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 180.0 :z 194.0 :w 255.0) + :env-color (new 'static 'vector :x 128.0 :y 180.0 :z 194.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 176.0 :z 192.0 :w 255.0) + :env-color (new 'static 'vector :x 128.0 :y 176.0 :z 192.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 192.0 :y 176.5 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 192.0 :y 176.5 :z 96.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :w 128.0) - :env-color - (new 'static 'vector :x 80.0 :y 80.0 :z 173.0 :w 255.0) + :env-color (new 'static 'vector :x 80.0 :y 80.0 :z 173.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :w 128.0) - :env-color - (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) + :env-color (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :w 128.0) - :env-color - (new 'static 'vector :x 64.0 :y 107.0 :z 173.0 :w 255.0) + :env-color (new 'static 'vector :x 64.0 :y 107.0 :z 173.0 :w 255.0) ) ) ) ) -(define - *jungleb-mood-fog-table* +(define *jungleb-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog :fog-color (new 'static 'vector :w 128.0) - :fog-dists - (new 'static 'vector :x 98304.0 :y 3072000.0 :z 255.0 :w 150.0) + :fog-dists (new 'static 'vector :x 98304.0 :y 3072000.0 :z 255.0 :w 150.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog) @@ -1110,16 +969,13 @@ ) ) -(define - *jungleb-mood-lights-table* +(define *jungleb-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights :direction (new 'static 'vector :y 1.0) - :lgt-color - (new 'static 'vector :x 0.287 :y 0.283 :z 0.4 :w 1.0) + :lgt-color (new 'static 'vector :x 0.287 :y 0.283 :z 0.4 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.14125 :y 0.1875 :z 0.375 :w 1.0) + :amb-color (new 'static 'vector :x 0.14125 :y 0.1875 :z 0.375 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights) @@ -1133,14 +989,11 @@ ) ) -(define - *jungleb-mood-sun-table* +(define *jungleb-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 48.0 :y 60.0 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 48.0 :y 60.0 :z 96.0 :w 255.0) ) (new 'static 'mood-sun) (new 'static 'mood-sun) @@ -1153,14 +1006,11 @@ ) ) -(define - *maincave-mood-fog-table* +(define *maincave-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 96.0 :z 96.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 434176.0 :y 1048576.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :y 96.0 :z 96.0 :w 128.0) + :fog-dists (new 'static 'vector :x 434176.0 :y 1048576.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog) @@ -1174,16 +1024,13 @@ ) ) -(define - *maincave-mood-lights-table* +(define *maincave-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights :direction (new 'static 'vector :y 1.0) - :lgt-color - (new 'static 'vector :x 0.25 :y 0.6 :z 0.75 :w 1.0) + :lgt-color (new 'static 'vector :x 0.25 :y 0.6 :z 0.75 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.15 :y 0.2 :z 0.25 :w 1.0) + :amb-color (new 'static 'vector :x 0.15 :y 0.2 :z 0.25 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights) @@ -1197,14 +1044,11 @@ ) ) -(define - *maincave-mood-sun-table* +(define *maincave-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 255.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 128.0 :y 255.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun) (new 'static 'mood-sun) @@ -1217,13 +1061,11 @@ ) ) -(define - *robocave-mood-fog-table* +(define *robocave-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog :fog-color (new 'static 'vector :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2048000.0 :z 255.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2048000.0 :z 255.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog) @@ -1237,13 +1079,11 @@ ) ) -(define - *darkcave-mood-fog-table* +(define *darkcave-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog :fog-color (new 'static 'vector :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1024000.0 :z 255.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1024000.0 :z 255.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog) @@ -1257,16 +1097,13 @@ ) ) -(define - *darkcave-mood-lights-table* +(define *darkcave-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 0.3 :y 0.4 :z 0.5 :w 1.0) + :lgt-color (new 'static 'vector :x 0.3 :y 0.4 :z 0.5 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.3 :y 0.4 :z 0.5 :w 1.0) + :amb-color (new 'static 'vector :x 0.3 :y 0.4 :z 0.5 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights) @@ -1280,14 +1117,11 @@ ) ) -(define - *darkcave-mood-sun-table* +(define *darkcave-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 127.5 :y 255.0 :z 127.5 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 127.5 :y 255.0 :z 127.5 :w 255.0) ) (new 'static 'mood-sun) (new 'static 'mood-sun) @@ -1300,93 +1134,67 @@ ) ) -(define - *misty-mood-fog-table* +(define *misty-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 132.0 :y 140.0 :z 227.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :x 132.0 :y 140.0 :z 227.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 132.0 :y 140.0 :z 243.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :x 132.0 :y 140.0 :z 243.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 132.0 :y 140.0 :z 241.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :x 132.0 :y 140.0 :z 241.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 64.0 :z 152.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :y 64.0 :z 152.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 32.0 :z 96.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :y 32.0 :z 96.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 17.0 :y 119.0 :z 143.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :x 17.0 :y 119.0 :z 143.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) ) ) ) -(define - *misty-mood-lights-table* +(define *misty-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.877 :y 0.877 :z 0.877 :w 1.0) + :direction (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.877 :y 0.877 :z 0.877 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.374 :y 0.374 :z 0.375 :w 1.0) - :shadow - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.374 :y 0.374 :z 0.375 :w 1.0) + :shadow (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.334 :y 0.348 :z 0.64 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.334 :y 0.348 :z 0.64 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.428 :y 0.44 :z 0.55 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.428 :y 0.44 :z 0.55 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -1402,168 +1210,119 @@ (update-mood-shadow-direction (-> *misty-mood-lights-table* data 1)) -(define - *misty-mood-sun-table* +(define *misty-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 132.0 :y 140.0 :z 227.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 132.0 :y 140.0 :z 227.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 132.0 :y 140.0 :z 243.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 132.0 :y 140.0 :z 243.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 132.0 :y 140.0 :z 241.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 132.0 :y 140.0 :z 241.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 32.0 :y 48.0 :z 160.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 32.0 :y 48.0 :z 160.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 32.0 :y 48.0 :z 150.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 32.0 :y 48.0 :z 150.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 32.0 :y 100.0 :z 160.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 32.0 :y 100.0 :z 160.0 :w 255.0) ) ) ) ) -(define - *village2-mood-fog-table* +(define *village2-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 75.0 :y 82.0 :z 96.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 75.0 :y 82.0 :z 96.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 100.0 :y 102.0 :z 116.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 102.0) + :fog-color (new 'static 'vector :x 100.0 :y 102.0 :z 116.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 102.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 112.0 :y 114.0 :z 132.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 112.0 :y 114.0 :z 132.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 100.0 :y 102.0 :z 116.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 100.0 :y 102.0 :z 116.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 75.0 :y 82.0 :z 96.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 75.0 :y 82.0 :z 96.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 27.5 :y 40.0 :z 52.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 27.5 :y 40.0 :z 52.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 10.0 :y 23.0 :z 28.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 10.0 :y 23.0 :z 28.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 5.0 :y 35.0 :z 35.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 5.0 :y 35.0 :z 35.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) ) ) ) -(define - *village2-mood-lights-table* +(define *village2-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.793 :y 0.793 :z 0.793 :w 1.0) + :direction (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.793 :y 0.793 :z 0.793 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) - :shadow - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) + :shadow (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.173 :y 0.259 :z 0.432 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.173 :y 0.259 :z 0.432 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) + :shadow (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) + :shadow (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -1581,160 +1340,114 @@ (update-mood-shadow-direction (-> *village2-mood-lights-table* data 3)) -(define - *village2-mood-sun-table* +(define *village2-mood-sun-table* (new 'static 'mood-sun-table - :data - (new 'static 'inline-array mood-sun 8 + :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 133.0 :z 194.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 128.0 :y 133.0 :z 194.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :y 32.0 :z 76.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :y 32.0 :z 76.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0)) (new 'static 'mood-sun :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0)) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 17.0 :y 76.0 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 17.0 :y 76.0 :z 96.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 132.0 :y 131.0 :z 160.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 132.0 :y 131.0 :z 160.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 126.0 :z 192.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 128.0 :y 126.0 :z 192.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 153.0 :y 141.0 :z 192.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 153.0 :y 141.0 :z 192.0 :w 255.0) ) ) ) ) -(define - *swamp-mood-fog-table* +(define *swamp-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 22.0 :y 89.0 :z 101.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 22.0 :y 89.0 :z 101.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 32.0 :y 105.0 :z 116.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 32.0 :y 105.0 :z 116.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 36.0 :y 118.0 :z 130.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 36.0 :y 118.0 :z 130.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 32.0 :y 105.0 :z 116.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 32.0 :y 105.0 :z 116.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 22.0 :y 89.0 :z 101.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 22.0 :y 89.0 :z 101.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 20.0 :y 60.0 :z 70.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 20.0 :y 60.0 :z 70.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 12.0 :y 42.0 :z 60.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 12.0 :y 42.0 :z 60.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 17.0 :y 76.0 :z 86.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 17.0 :y 76.0 :z 86.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) ) ) ) -(define - *swamp-mood-lights-table* +(define *swamp-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.825 :y 0.825 :z 0.825 :w 1.0) + :direction (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.825 :y 0.825 :z 0.825 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) - :shadow - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) + :shadow (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.173 :y 0.259 :z 0.519 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.173 :y 0.259 :z 0.519 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.412 :y 0.463 :z 0.55 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.412 :y 0.463 :z 0.55 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.7094065 :y 0.57357645 :z -0.40957603) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x 0.7094065 :y 0.57357645 :z -0.40957603) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x 0.7094065 :y 0.57357645 :z -0.40957603) + :shadow (new 'static 'vector :x 0.7094065 :y 0.57357645 :z -0.40957603) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.7094065 :y 0.57357645 :z 0.40957603) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x -0.7094065 :y 0.57357645 :z 0.40957603) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x -0.7094065 :y 0.57357645 :z 0.40957603) + :shadow (new 'static 'vector :x -0.7094065 :y 0.57357645 :z 0.40957603) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -1752,71 +1465,50 @@ (update-mood-shadow-direction (-> *swamp-mood-lights-table* data 3)) -(define - *swamp-mood-sun-table* +(define *swamp-mood-sun-table* (new 'static 'mood-sun-table - :data - (new 'static 'inline-array mood-sun 8 + :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 24.0 :y 133.0 :z 243.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 24.0 :y 133.0 :z 243.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :y 32.0 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :y 32.0 :z 96.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0)) (new 'static 'mood-sun :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0)) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 17.0 :y 119.0 :z 143.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 17.0 :y 119.0 :z 143.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 132.0 :y 131.0 :z 200.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 132.0 :y 131.0 :z 200.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 87.0 :y 126.0 :z 227.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 87.0 :y 126.0 :z 227.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 153.0 :y 141.0 :z 240.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 153.0 :y 141.0 :z 240.0 :w 255.0) ) ) ) ) -(define - *sunken-mood-fog-table* +(define *sunken-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 16.512 :y 26.112 :z 54.912 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1351680.0 :z 255.0) - :erase-color - (new 'static 'vector :x 16.512 :y 26.112 :z 54.912 :w 128.0) + :fog-color (new 'static 'vector :x 16.512 :y 26.112 :z 54.912 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1351680.0 :z 255.0) + :erase-color (new 'static 'vector :x 16.512 :y 26.112 :z 54.912 :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 4.096 :y 15.744 :z 54.912 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1351680.0 :z 255.0) - :erase-color - (new 'static 'vector :x 4.096 :y 15.744 :z 54.912 :w 128.0) + :fog-color (new 'static 'vector :x 4.096 :y 15.744 :z 54.912 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1351680.0 :z 255.0) + :erase-color (new 'static 'vector :x 4.096 :y 15.744 :z 54.912 :w 128.0) ) (new 'static 'mood-fog) (new 'static 'mood-fog) @@ -1828,25 +1520,20 @@ ) ) -(define - *sunken-mood-lights-table* +(define *sunken-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights :direction (new 'static 'vector :y 1.0) - :lgt-color - (new 'static 'vector :x 0.265 :y 0.387 :z 0.509 :w 1.0) + :lgt-color (new 'static 'vector :x 0.265 :y 0.387 :z 0.509 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) + :amb-color (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y 1.0) - :lgt-color - (new 'static 'vector :x 0.172 :y 0.185 :z 0.298 :w 1.0) + :lgt-color (new 'static 'vector :x 0.172 :y 0.185 :z 0.298 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) + :amb-color (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights) @@ -1863,20 +1550,15 @@ (update-mood-shadow-direction (-> *sunken-mood-lights-table* data 1)) -(define - *sunken-mood-sun-table* +(define *sunken-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 127.5 :y 191.25 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 127.5 :y 191.25 :z 255.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 76.5 :y 102.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 76.5 :y 102.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun) (new 'static 'mood-sun) @@ -1888,115 +1570,81 @@ ) ) -(define - *rolling-mood-fog-table* +(define *rolling-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 42.0 :y 50.0 :z 68.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 42.0 :y 50.0 :z 68.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 94.0 :y 106.0 :z 126.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 94.0 :y 106.0 :z 126.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 104.0 :y 116.0 :z 136.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 104.0 :y 116.0 :z 136.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 94.0 :y 106.0 :z 126.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 94.0 :y 106.0 :z 126.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 42.0 :y 50.0 :z 68.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 42.0 :y 50.0 :z 68.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 17.0 :y 26.0 :z 43.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 17.0 :y 26.0 :z 43.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) ) ) ) -(define - *rolling-mood-lights-table* +(define *rolling-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) - :lgt-color - (new 'static 'vector :x 0.922 :y 0.905 :z 0.873 :w 1.0) + :direction (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) + :lgt-color (new 'static 'vector :x 0.922 :y 0.905 :z 0.873 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) - :shadow - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) + :amb-color (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) + :shadow (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) - :lgt-color - (new 'static 'vector :x 0.914 :y 0.898 :z 0.866 :w 1.0) + :direction (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) + :lgt-color (new 'static 'vector :x 0.914 :y 0.898 :z 0.866 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) - :shadow - (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) + :amb-color (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) + :shadow (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.09 :y 0.135 :z 0.225 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.09 :y 0.135 :z 0.225 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) - :lgt-color - (new 'static 'vector :x 0.0464 :y 0.1344 :z 0.1254 :w 1.0) + :direction (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) + :lgt-color (new 'static 'vector :x 0.0464 :y 0.1344 :z 0.1254 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) - :shadow - (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) + :amb-color (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) + :shadow (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -2014,167 +1662,118 @@ (update-mood-shadow-direction (-> *rolling-mood-lights-table* data 3)) -(define - *rolling-mood-sun-table* +(define *rolling-mood-sun-table* (new 'static 'mood-sun-table - :data - (new 'static 'inline-array mood-sun 8 + :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 133.0 :z 194.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 128.0 :y 133.0 :z 194.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :y 32.0 :z 76.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :y 32.0 :z 76.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0)) (new 'static 'mood-sun :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0)) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 17.0 :y 76.0 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 17.0 :y 76.0 :z 96.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 132.0 :y 131.0 :z 160.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 132.0 :y 131.0 :z 160.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 126.0 :z 192.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 128.0 :y 126.0 :z 192.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 153.0 :y 141.0 :z 192.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 153.0 :y 141.0 :z 192.0 :w 255.0) ) ) ) ) -(define - *firecanyon-mood-fog-table* +(define *firecanyon-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 140.0 :y 64.5 :z 60.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 140.0 :y 64.5 :z 60.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 128.0 :y 44.0 :z 40.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 128.0 :y 44.0 :z 40.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 140.0 :y 50.0 :z 60.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 140.0 :y 50.0 :z 60.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) ) ) ) -(define - *firecanyon-mood-lights-table* +(define *firecanyon-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.0278 :y 0.6578 :z 0.7526) - :lgt-color - (new 'static 'vector :x 1.0979 :y 1.0567 :z 0.4653 :w 1.0) + :direction (new 'static 'vector :x -0.0278 :y 0.6578 :z 0.7526) + :lgt-color (new 'static 'vector :x 1.0979 :y 1.0567 :z 0.4653 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.574 :y 0.32 :z 0.487 :w 1.0) - :shadow - (new 'static 'vector :x -0.0278 :y 0.6578 :z 0.7526) + :amb-color (new 'static 'vector :x 0.574 :y 0.32 :z 0.487 :w 1.0) + :shadow (new 'static 'vector :x -0.0278 :y 0.6578 :z 0.7526) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.25881904 :y 0.9659258) - :lgt-color - (new 'static 'vector :x 1.644 :y 1.598 :z 1.438 :w 128.0) + :direction (new 'static 'vector :x -0.25881904 :y 0.9659258) + :lgt-color (new 'static 'vector :x 1.644 :y 1.598 :z 1.438 :w 128.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.368 :y 0.368 :z 0.4 :w 1.0) - :shadow - (new 'static 'vector :x -0.25881904 :y 0.9659258) + :amb-color (new 'static 'vector :x 0.368 :y 0.368 :z 0.4 :w 1.0) + :shadow (new 'static 'vector :x -0.25881904 :y 0.9659258) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.0353 :y 0.8338 :z -0.5508 :w 1.0) - :lgt-color - (new 'static 'vector :x 1.1419 :y 0.8887 :z 0.3513 :w 1.0) + :direction (new 'static 'vector :x -0.0353 :y 0.8338 :z -0.5508 :w 1.0) + :lgt-color (new 'static 'vector :x 1.1419 :y 0.8887 :z 0.3513 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.347 :y 0.362 :z 0.487 :w 1.0) - :shadow - (new 'static 'vector :x -0.0353 :y 0.8338 :z -0.5508 :w 1.0) + :amb-color (new 'static 'vector :x 0.347 :y 0.362 :z 0.487 :w 1.0) + :shadow (new 'static 'vector :x -0.0353 :y 0.8338 :z -0.5508 :w 1.0) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365 :y 0.4829 :z 0.2588) - :lgt-color - (new 'static 'vector :x 0.1824 :y 0.2574 :z 0.6964 :w 1.0) + :direction (new 'static 'vector :x 0.8365 :y 0.4829 :z 0.2588) + :lgt-color (new 'static 'vector :x 0.1824 :y 0.2574 :z 0.6964 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.434 :y 0.423 :z 0.625 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365 :y 0.4829 :z 0.2588) + :amb-color (new 'static 'vector :x 0.434 :y 0.423 :z 0.625 :w 1.0) + :shadow (new 'static 'vector :x 0.8365 :y 0.4829 :z 0.2588) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) @@ -2193,190 +1792,133 @@ (update-mood-shadow-direction (-> *firecanyon-mood-lights-table* data 3)) -(define - *firecanyon-mood-sun-table* +(define *firecanyon-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 200.0 :y 200.0 :z 128.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 200.0 :y 200.0 :z 128.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 200.0 :y 200.0 :z 200.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 200.0 :y 200.0 :z 200.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 200.0 :y 200.0 :z 200.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 200.0 :y 200.0 :z 200.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 196.0 :z 64.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 196.0 :z 64.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 96.0 :y 96.0 :z 150.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 96.0 :y 96.0 :z 150.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 96.0 :y 200.0 :z 150.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 96.0 :y 200.0 :z 150.0 :w 255.0) ) ) ) ) -(define - *ogre-mood-fog-table* +(define *ogre-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 18.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 18.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) ) ) ) -(define - *ogre-mood-lights-table* +(define *ogre-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) - :lgt-color - (new 'static 'vector :x 1.154 :y 1.132 :z 1.093 :w 1.0) + :direction (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) + :lgt-color (new 'static 'vector :x 1.154 :y 1.132 :z 1.093 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) - :shadow - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) + :amb-color (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) + :shadow (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) - :lgt-color - (new 'static 'vector :x 1.144 :y 1.124 :z 0.939 :w 1.0) + :direction (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) + :lgt-color (new 'static 'vector :x 1.144 :y 1.124 :z 0.939 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) - :shadow - (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) + :amb-color (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) + :shadow (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.113 :y 0.169 :z 0.282 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.113 :y 0.169 :z 0.282 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) - :lgt-color - (new 'static 'vector :x 0.058 :y 0.168 :z 0.157 :w 1.0) + :direction (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) + :lgt-color (new 'static 'vector :x 0.058 :y 0.168 :z 0.157 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) - :shadow - (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) + :amb-color (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) + :shadow (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) + :shadow (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) + :shadow (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -2396,72 +1938,49 @@ (update-mood-shadow-direction (-> *ogre-mood-lights-table* data 5)) -(define - *ogre2-mood-lights-table* +(define *ogre2-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.793 :y 0.793 :z 0.793 :w 1.0) + :direction (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.793 :y 0.793 :z 0.793 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) - :shadow - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) + :shadow (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.793 :y 0.793 :z 0.793 :w 1.0) + :direction (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.793 :y 0.793 :z 0.793 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) - :shadow - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) + :shadow (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.173 :y 0.259 :z 0.432 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.173 :y 0.259 :z 0.432 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.173 :y 0.259 :z 0.432 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.173 :y 0.259 :z 0.432 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) + :shadow (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) + :shadow (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -2481,14 +2000,11 @@ (update-mood-shadow-direction (-> *ogre2-mood-lights-table* data 5)) -(define - *ogre3-mood-fog-table* +(define *ogre3-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 255.0 :y 96.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 393216.0 :y 7458816.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 255.0 :y 96.0 :w 128.0) + :fog-dists (new 'static 'vector :x 393216.0 :y 7458816.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog) @@ -2502,18 +2018,14 @@ ) ) -(define - *ogre3-mood-lights-table* +(define *ogre3-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights :direction (new 'static 'vector :y 0.666 :z 0.745) - :lgt-color - (new 'static 'vector :x 0.6 :y 0.51 :z 0.51 :w 1.0) + :lgt-color (new 'static 'vector :x 0.6 :y 0.51 :z 0.51 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.313 :y 0.375 :z 0.375 :w 1.0) - :shadow - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.313 :y 0.375 :z 0.375 :w 1.0) + :shadow (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -2528,108 +2040,80 @@ (update-mood-shadow-direction (the-as mood-lights (-> *ogre3-mood-lights-table* data))) -(define - *village3-mood-fog-table* +(define *village3-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 18.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 18.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) ) ) ) -(define - *village3-mood-lights-table* +(define *village3-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.067 :y 0.25 :z 0.966) + :direction (new 'static 'vector :x -0.067 :y 0.25 :z 0.966) :lgt-color (new 'static 'vector :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.449 :y 0.35 :z 0.599 :w 1.0) + :amb-color (new 'static 'vector :x 0.449 :y 0.35 :z 0.599 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.259 :y 0.966) - :lgt-color - (new 'static 'vector :x 0.66 :y 0.436 :z 0.291 :w 1.0) + :direction (new 'static 'vector :x -0.259 :y 0.966) + :lgt-color (new 'static 'vector :x 0.66 :y 0.436 :z 0.291 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.358 :y 0.575 :z 0.716 :w 1.0) + :amb-color (new 'static 'vector :x 0.358 :y 0.575 :z 0.716 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.067 :y 0.25 :z -0.966) - :lgt-color - (new 'static 'vector :x 1.056 :y 0.747 :w 1.0) + :direction (new 'static 'vector :x -0.067 :y 0.25 :z -0.966) + :lgt-color (new 'static 'vector :x 1.056 :y 0.747 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.383 :y 0.366 :z 0.599 :w 1.0) + :amb-color (new 'static 'vector :x 0.383 :y 0.366 :z 0.599 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :x 0.866 :y 0.5) - :lgt-color - (new 'static 'vector :x 0.067 :y 0.089 :z 0.333 :w 1.0) + :lgt-color (new 'static 'vector :x 0.067 :y 0.089 :z 0.333 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.304 :y 0.409 :z 0.76 :w 1.0) + :amb-color (new 'static 'vector :x 0.304 :y 0.409 :z 0.76 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights) @@ -2640,14 +2124,11 @@ ) ) -(define - *lavatube-mood-fog-table* +(define *lavatube-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 255.0 :y 96.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1851392.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 255.0 :y 96.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1851392.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog) @@ -2661,64 +2142,54 @@ ) ) -(define - *lavatube-mood-lights-table* +(define *lavatube-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights :direction (new 'static 'vector :y 1.0) - :lgt-color - (new 'static 'vector :x 0.19 :y 0.128 :z 0.128 :w 1.0) + :lgt-color (new 'static 'vector :x 0.19 :y 0.128 :z 0.128 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.31 :y 0.372 :z 0.372 :w 1.0) + :amb-color (new 'static 'vector :x 0.31 :y 0.372 :z 0.372 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) @@ -2728,14 +2199,11 @@ (update-mood-shadow-direction (the-as mood-lights (-> *lavatube-mood-lights-table* data))) -(define - *lavatube-mood-sun-table* +(define *lavatube-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 175.0 :z 128.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 175.0 :z 128.0 :w 255.0) ) (new 'static 'mood-sun) (new 'static 'mood-sun) @@ -2748,117 +2216,84 @@ ) ) -(define - *finalboss-mood-sun-table* +(define *finalboss-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 109.0 :y 64.0 :z 160.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 109.0 :y 64.0 :z 160.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 196.0 :z 64.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 196.0 :z 64.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 96.0 :y 96.0 :z 196.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 96.0 :y 96.0 :z 196.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 64.0 :y 150.0 :z 196.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 64.0 :y 150.0 :z 196.0 :w 255.0) ) ) ) ) -(define - *finalboss-mood-fog-table* +(define *finalboss-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 45.0 :z 96.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 909312.0 :y 1912832.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 45.0 :z 96.0 :w 128.0) + :fog-dists (new 'static 'vector :x 909312.0 :y 1912832.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog :fog-color (new 'static 'vector :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 51.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 80.0 :z 64.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 80.0 :z 64.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) ) @@ -2945,13 +2380,11 @@ 0.41 ) -(define - *citadel-mood-fog-table* +(define *citadel-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog :fog-color (new 'static 'vector :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2252800.0 :z 255.0 :w 25.5) + :fog-dists (new 'static 'vector :x 262144.0 :y 2252800.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog) @@ -2965,16 +2398,13 @@ ) ) -(define - *citadel-mood-lights-table* +(define *citadel-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights :direction (new 'static 'vector :y 1.0) - :lgt-color - (new 'static 'vector :x 0.75 :y 0.725 :z 0.5 :w 1.0) + :lgt-color (new 'static 'vector :x 0.75 :y 0.725 :z 0.5 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.3 :y 0.3 :z 0.3 :w 1.0) + :amb-color (new 'static 'vector :x 0.3 :y 0.3 :z 0.3 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights) @@ -2988,13 +2418,11 @@ ) ) -(define - *citadel-mood-sun-table* +(define *citadel-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun :sun-color (new 'static 'vector :w 128.0) - :env-color - (new 'static 'vector :x 96.0 :y 96.0 :z 96.0 :w 255.0) + :env-color (new 'static 'vector :x 96.0 :y 96.0 :z 96.0 :w 255.0) ) (new 'static 'mood-sun) (new 'static 'mood-sun) diff --git a/goal_src/engine/ambient/mood.gc b/goal_src/engine/ambient/mood.gc index 84ecdafee7..b0ac11e4dc 100644 --- a/goal_src/engine/ambient/mood.gc +++ b/goal_src/engine/ambient/mood.gc @@ -4,6 +4,7 @@ ;; name: mood.gc ;; name in dgo: mood ;; dgos: GAME, ENGINE +;; note: modified for high fps ;; DECOMP BEGINS @@ -494,170 +495,62 @@ (none) ) -(define *flash0* (the-as (array float) (new - 'static - 'boxed-array - :type float :length 13 :allocated-length 13 - 1.0 - 0.0 - 0.5 - 1.0 - 0.5 - 0.0 - 0.5 - 0.35 - 0.4 - 0.35 - 0.25 - 0.1 - 0.04 - ) - ) - ) - -(define - *flash1* - (the-as (array float) - (new 'static 'boxed-array :type float :length 9 :allocated-length 9 1.0 0.8 0.0 1.0 0.5 1.0 0.4 0.2 0.1) - ) +(define *flash0* + (new 'static 'boxed-array :type float 1.0 0.0 0.5 1.0 0.5 0.0 0.5 0.35 0.4 0.35 0.25 0.1 0.04) ) -(define - *flash2* - (the-as (array float) - (new 'static 'boxed-array :type float :length 10 :allocated-length 10 1.0 0.9 0.8 0.7 0.0 0.0 1.0 0.0 1.0 0.5) - ) +(define *flash1* (new 'static 'boxed-array :type float 1.0 0.8 0.0 1.0 0.5 1.0 0.4 0.2 0.1)) + +(define *flash2* (new 'static 'boxed-array :type float 1.0 0.9 0.8 0.7 0.0 0.0 1.0 0.0 1.0 0.5)) + +(define *flash3* (new 'static 'boxed-array :type float 0.5 0.0 1.0 0.9 1.0 0.8 0.3 0.0 0.0 0.5 0.1 0.5 0.35)) + +(define *flash4* + (new 'static 'boxed-array :type float 1.0 0.0 1.0 0.0 1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.5 0.4 0.3 0.2 0.1) ) -(define *flash3* (the-as (array float) (new - 'static - 'boxed-array - :type float :length 13 :allocated-length 13 - 0.5 - 0.0 - 1.0 - 0.9 - 1.0 - 0.8 - 0.3 - 0.0 - 0.0 - 0.5 - 0.1 - 0.5 - 0.35 - ) - ) +(define *flash5* (new 'static 'boxed-array :type float + 1.0 + 0.0 + 1.0 + 0.0 + 1.0 + 0.95 + 0.9 + 0.85 + 0.8 + 0.75 + 0.7 + 0.65 + 0.6 + 0.55 + 0.5 + 0.45 + 0.4 + 0.35 + 0.3 + 0.25 + 0.2 + 0.5 + 0.45 + 0.4 + 0.35 + 0.3 + 0.25 + 0.2 + 0.15 + 0.1 + 0.05 + ) ) -(define *flash4* (the-as (array float) (new - 'static - 'boxed-array - :type float :length 18 :allocated-length 18 - 1.0 - 0.0 - 1.0 - 0.0 - 1.0 - 0.9 - 0.8 - 0.7 - 0.6 - 0.5 - 0.4 - 0.3 - 0.2 - 0.5 - 0.4 - 0.3 - 0.2 - 0.1 - ) - ) - ) +(define *flash6* + (new 'static 'boxed-array :type float 1.0 0.0 1.0 0.0 0.5 0.0 0.5 0.35 0.0 0.0 1.0 0.0 0.2 0.1) + ) -(define *flash5* (the-as (array float) (new - 'static - 'boxed-array - :type float :length 31 :allocated-length 31 - 1.0 - 0.0 - 1.0 - 0.0 - 1.0 - 0.95 - 0.9 - 0.85 - 0.8 - 0.75 - 0.7 - 0.65 - 0.6 - 0.55 - 0.5 - 0.45 - 0.4 - 0.35 - 0.3 - 0.25 - 0.2 - 0.5 - 0.45 - 0.4 - 0.35 - 0.3 - 0.25 - 0.2 - 0.15 - 0.1 - 0.05 - ) - ) - ) - -(define *flash6* (the-as (array float) (new - 'static - 'boxed-array - :type float :length 14 :allocated-length 14 - 1.0 - 0.0 - 1.0 - 0.0 - 0.5 - 0.0 - 0.5 - 0.35 - 0.0 - 0.0 - 1.0 - 0.0 - 0.2 - 0.1 - ) - ) - ) - -(define *flash7* (the-as (array float) (new - 'static - 'boxed-array - :type float :length 14 :allocated-length 14 - 1.0 - 0.8 - 0.3 - 0.0 - 0.6 - 0.5 - 0.4 - 0.3 - 0.2 - 0.5 - 0.4 - 0.3 - 0.2 - 0.1 - ) - ) - ) +(define *flash7* + (new 'static 'boxed-array :type float 1.0 0.8 0.3 0.0 0.6 0.5 0.4 0.3 0.2 0.5 0.4 0.3 0.2 0.1) + ) (define *lightning-index* 0) @@ -785,23 +678,17 @@ ) (when (>= (-> *math-camera* trans y) -81920.0) (if arg6 - (sound-play-by-name - (static-sound-name "thunder") - *thunder-id* - (the int (* 10.24 (rand-vu-float-range 25.0 75.0))) - (the int (* 1524.0 (rand-vu-float-range -1.0 1.0))) - 0 - 1 - #t + (sound-play + "thunder" + :id *thunder-id* + :vol (rand-vu-float-range 25.0 75.0) + :pitch (rand-vu-float-range -1.0 1.0) ) - (sound-play-by-name - (static-sound-name "thunder") - *thunder-id* - (the int (* 10.24 (rand-vu-float-range 200.0 400.0))) - (the int (* 1524.0 (rand-vu-float-range -1.0 1.0))) - 0 - 1 - #t + (sound-play + "thunder" + :id *thunder-id* + :vol (rand-vu-float-range 200.0 400.0) + :pitch (rand-vu-float-range -1.0 1.0) ) ) ) @@ -825,7 +712,7 @@ ) (sound-trans-convert (-> gp-3 parms trans) a1-23) ) - (set! (-> gp-3 parms mask) (the-as uint 32)) + (set! (-> gp-3 parms mask) (sound-mask trans)) (-> gp-3 id) ) (let ((gp-4 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) @@ -842,7 +729,7 @@ ) (sound-trans-convert (-> gp-4 parms trans) a1-25) ) - (set! (-> gp-4 parms mask) (the-as uint 32)) + (set! (-> gp-4 parms mask) (sound-mask trans)) (-> gp-4 id) ) (let ((gp-5 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) @@ -859,7 +746,7 @@ ) (sound-trans-convert (-> gp-5 parms trans) a1-27) ) - (set! (-> gp-5 parms mask) (the-as uint 32)) + (set! (-> gp-5 parms mask) (sound-mask trans)) (-> gp-5 id) ) ) @@ -1022,11 +909,11 @@ ) -(defun update-mood-misty ((arg0 mood-context) (arg1 float) (arg2 float)) +(defun update-mood-misty ((arg0 mood-context) (arg1 float) (arg2 int)) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) (clear-mood-times arg0) - (update-mood-palette arg0 arg1 (the-as int arg2)) + (update-mood-palette arg0 arg1 arg2) (when *time-of-day-effects* (update-mood-flames arg0 2 4 0 0.333 0.001953125 1.0) (let* ((s4-1 (get-task-control (game-task misty-warehouse))) @@ -1651,9 +1538,9 @@ (let ((s3-2 (new 'stack-no-clear 'vector)) (s4-3 (new 'stack-no-clear 'vector)) (f26-3 (+ 0.75 - (* 0.0625 (cos (the float (* 4000 (-> *display* integral-frame-counter))))) - (* 0.0625 (cos (the float (shl (-> *display* integral-frame-counter) 11)))) - (* 0.125 (cos (the float (* 1500 (-> *display* integral-frame-counter))))) + (* 0.0625 (cos (the float (* 4000 (-> *display* time-adjust-ratio) (-> *display* integral-frame-counter))))) ;; changed for high fps + (* 0.0625 (cos (the float (shl (the int (* (-> *display* time-adjust-ratio) (-> *display* integral-frame-counter))) 11)))) ;; changed for high fps + (* 0.125 (cos (the float (* 1500 (-> *display* time-adjust-ratio) (-> *display* integral-frame-counter))))) ;; changed for high fps ) ) ) @@ -1721,19 +1608,16 @@ ) ) -(define - *rolling-spheres-light2* +(define *rolling-spheres-light2* (new 'static 'light-ellipse - :matrix - (new 'static 'matrix :vector (new 'static 'inline-array vector 4 + :matrix (new 'static 'matrix :vector (new 'static 'inline-array vector 4 (new 'static 'vector :x -581632.0 :y 114688.0 :z -6479872.0 :w 24576.0) (new 'static 'vector :x -737280.0 :y 110592.0 :z -7159808.0 :w 24576.0) (new 'static 'vector :x -733184.0 :y 110592.0 :z -7266304.0 :w 24576.0) (new 'static 'vector :x -1363968.0 :y 110592.0 :z -6578176.0 :w 24576.0) ) ) - :color - (new 'static 'rgbaf :x -1404928.0 :y 110592.0 :z -6541312.0 :w 24576.0) + :color (new 'static 'rgbaf :x -1404928.0 :y 110592.0 :z -6541312.0 :w 24576.0) ) ) @@ -2557,8 +2441,8 @@ (cond ((or (logtest? (get-reminder (get-task-control (game-task finalboss-movies)) 0) 1) (not *time-of-day-effects*)) (when (and *target* (= (-> *target* next-state name) 'target-continue)) - (set! (-> s4-0 start-time) (+ (-> *display* base-frame-counter) (seconds -33.333332))) - (set! (-> s4-0 secret-time) (+ (-> *display* base-frame-counter) (seconds -33.333332))) + (set! (-> s4-0 start-time) (+ (-> *display* base-frame-counter) (seconds -33.335))) + (set! (-> s4-0 secret-time) (+ (-> *display* base-frame-counter) (seconds -33.335))) ) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) @@ -2812,9 +2696,9 @@ (let* ((f2-5 (* 0.000012207031 (+ -409600.0 f0-41))) (f30-2 (- 1.0 (fmax 0.0 (fmin 1.0 f2-5)))) (f28-4 (+ 0.5 - (* 0.125 (cos (the float (* 4000 (-> *display* integral-frame-counter))))) - (* 0.125 (cos (the float (shl (-> *display* integral-frame-counter) 11)))) - (* 0.25 (cos (the float (* 1500 (-> *display* integral-frame-counter))))) + (* 0.125 (cos (the float (* 4000 (-> *display* time-adjust-ratio) (-> *display* integral-frame-counter))))) ;; changed for high fps + (* 0.125 (cos (the float (shl (the int (* (-> *display* time-adjust-ratio) (-> *display* integral-frame-counter))) 11)))) ;; changed for high fps + (* 0.25 (cos (the float (* 1500 (-> *display* time-adjust-ratio) (-> *display* integral-frame-counter))))) ;; changed for high fps ) ) (s3-1 (new 'stack-no-clear 'vector)) diff --git a/goal_src/engine/ambient/weather-part.gc b/goal_src/engine/ambient/weather-part.gc index f0093f91d5..c934004a65 100644 --- a/goal_src/engine/ambient/weather-part.gc +++ b/goal_src/engine/ambient/weather-part.gc @@ -11,8 +11,7 @@ :id 188 :flags (screen-space) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 18 :binding 19) + :parts ((sp-item 18 :binding 19) (sp-item 19 :flags (start-dead launch-asap) :binding 20) (sp-item 19 :flags (start-dead launch-asap) :binding 20) (sp-item 19 :flags (start-dead launch-asap) :binding 20) @@ -84,8 +83,7 @@ (define group-rain-screend-drop (-> *part-group-id-table* 188)) (defpart 21 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -4.5) (meters 9) 1.0) (sp-rnd-flt spt-y (meters -3) (meters 6) 1.0) @@ -105,8 +103,7 @@ ) (defpart 22 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.5)) (sp-copy-from-other spt-scale-y -4) @@ -126,16 +123,14 @@ ) (defpart 24 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.004166667)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.004166667)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.06666667) ) ) (defpart 23 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-int spt-rot-x 12) (sp-flt spt-r 4096.0) (sp-flt spt-g 3276.8) @@ -152,13 +147,11 @@ ) (defpart 25 - :init-specs - ((sp-flt spt-fade-g -5.1200004)) + :init-specs ((sp-flt spt-fade-g -5.1200004)) ) (defpart 18 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -4.5) (meters 9) 1.0) (sp-rnd-flt spt-y (meters -3) (meters 6) 1.0) @@ -178,8 +171,7 @@ ) (defpart 19 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2.6)) (sp-copy-from-other spt-scale-y -4) @@ -199,16 +191,14 @@ ) (defpart 26 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.008333334)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.008333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.06666667) ) ) (defpart 20 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-int spt-rot-x 24) (sp-flt spt-r 12288.0) (sp-flt spt-g 6553.6) @@ -225,21 +215,18 @@ ) (defpart 27 - :init-specs - ((sp-flt spt-fade-g -10.240001)) + :init-specs ((sp-flt spt-fade-g -10.240001)) ) (defpartgroup group-stars :id 34 :flags (always-draw) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 28) (sp-item 29) (sp-item 30)) + :parts ((sp-item 28) (sp-item 29) (sp-item 30)) ) (defpart 28 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 40) (meters 40) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -260,18 +247,15 @@ ) (defpart 31 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 29999700) (sp-launcher-by-id spt-next-launcher 32)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 29999700) (sp-launcher-by-id spt-next-launcher 32)) ) (defpart 32 - :init-specs - ((sp-flt spt-fade-a -0.42666668)) + :init-specs ((sp-flt spt-fade-a -0.42666668)) ) (defpart 29 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 40) (meters 40) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -292,8 +276,7 @@ ) (defpart 30 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 40) (meters 40) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -314,8 +297,7 @@ ) (defpart 33 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters 10) (meters 10) 1.0) (sp-rnd-flt spt-y (meters 2) (meters 14) 1.0) @@ -339,8 +321,7 @@ ) (defpart 34 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.0) (sp-rnd-flt spt-x (meters 0) (meters 20) 1.0) (sp-flt spt-y (meters 16)) @@ -364,17 +345,15 @@ ) (defpart 35 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 1200) (sp-launcher-by-id spt-next-launcher 36)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 1200) (sp-launcher-by-id spt-next-launcher 36)) ) (defpart 36 - :init-specs - ((sp-flt spt-fade-a -0.85333335)) + :init-specs ((sp-flt spt-fade-a -0.85333335)) ) (defun update-snow ((arg0 target)) - (let ((gp-0 (-> arg0 control trans))) + (let ((target-position (-> arg0 control trans))) (let ((f0-0 (lerp-scale 0.0 1.0 (vector-length (-> arg0 control transv)) 2048.0 40960.0))) (set! (-> *part-id-table* 34 init-specs 1 initial-valuef) (- 1.0 f0-0)) (set! (-> *part-id-table* 33 init-specs 1 initial-valuef) (* 4.0 f0-0)) @@ -382,30 +361,15 @@ (set! (-> *part-id-table* 33 init-specs 19 initial-valuef) (+ 32768.0 (vector-y-angle (-> arg0 control transv))) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 34) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 33) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 34) target-position) + (launch-particles (-> *part-id-table* 33) target-position) ) 0 (none) ) (defpart 37 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters 0) (meters 20) 1.0) (sp-flt spt-y (meters 16)) @@ -425,8 +389,7 @@ ) (defpart 38 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 4.5) (sp-rnd-flt spt-x (meters 0) (meters 20) 1.0) (sp-flt spt-y (meters 16)) @@ -444,8 +407,7 @@ ) (defpart 39 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-int spt-num 0 1 2.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -464,8 +426,7 @@ ) (defpart 40 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.02)) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -489,22 +450,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 39) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 40) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 39) gp-0) + (launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 40) gp-0) ) ) (none) @@ -537,22 +484,8 @@ (set! (-> *part-id-table* 38 init-specs 5 initial-valuef) f30-0) (set! (-> *part-id-table* 38 init-specs 5 random-rangef) f30-0) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 37) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 38) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 37) gp-0) + (launch-particles (-> *part-id-table* 38) gp-0) ) ) 0 @@ -608,13 +541,11 @@ :id 35 :flags (always-draw) :bounds (static-bspherem 0 0 0 70) - :parts - ((sp-item 1950) (sp-item 1951) (sp-item 1952)) + :parts ((sp-item 1950) (sp-item 1951) (sp-item 1952)) ) (defpart 1950 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1200)) (sp-copy-from-other spt-scale-y -4) @@ -630,8 +561,7 @@ ) (defpart 1951 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2800)) (sp-flt spt-rot-z (degrees 0.0)) @@ -649,8 +579,7 @@ ) (defpart 1952 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2200)) (sp-flt spt-rot-z (degrees 0.0)) @@ -671,13 +600,11 @@ :id 36 :flags (always-draw) :bounds (static-bspherem 0 0 0 70) - :parts - ((sp-item 1974) (sp-item 1975) (sp-item 1976)) + :parts ((sp-item 1974) (sp-item 1975) (sp-item 1976)) ) (defpart 1974 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 600)) (sp-copy-from-other spt-scale-y -4) @@ -693,8 +620,7 @@ ) (defpart 1975 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1400)) (sp-flt spt-rot-z (degrees 0.0)) @@ -712,8 +638,7 @@ ) (defpart 1976 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1100)) (sp-flt spt-rot-z (degrees 0.0)) diff --git a/goal_src/engine/anim/aligner-h.gc b/goal_src/engine/anim/aligner-h.gc index b2df7e45b1..b04f0a5ffa 100644 --- a/goal_src/engine/anim/aligner-h.gc +++ b/goal_src/engine/anim/aligner-h.gc @@ -5,9 +5,32 @@ ;; name in dgo: aligner-h ;; dgos: GAME, ENGINE -;; The align control is responsible for aligning an animation to a moving character. +(defenum align-flags + :bitfield #t + :type uint32 + (disabled) ;; set by aligner if it determined it shouldn't perform alignment. + ) + +(defenum align-opts + :bitfield #t + :type uint32 + (adjust-x-vel) ;; adjust x + (adjust-y-vel) ;; adjust y + (adjust-xz-vel) ;; adjust both x and z. (don't set this with adjust-x) + (keep-other-velocities) ;; if set, keep xz plane velocities if their alignment isn't requested + (adjust-quat) ;; adjust the orientation + (alop0) + (alop1) + (alop2) + (alop3) + (alop4) + (alop5) + (no-gravity) ;; do not apply any gravity + (ignore-y-if-zero) ;; if set and the alignment velocity is 0 in y, don't apply it. + ) + (deftype align-control (basic) - ((flags uint32 :offset-assert 4) + ((flags align-flags :offset-assert 4) (process process-drawable :offset-assert 8) (frame-group art-joint-anim :offset-assert 12) (frame-num float :offset-assert 16) @@ -22,9 +45,9 @@ :flag-assert #xe00000134 (:methods (new (symbol type process) _type_ :behavior process-drawable 0) - (TODO-RENAME-9 (_type_) transformq 9) - (TODO-RENAME-10 (_type_ int float float float) trsqv 10) - (TODO-RENAME-11 (_type_ int vector int float float) none 11) ;; 3rd arg is unused + (compute-alignment! (_type_) transformq 9) + (align! (_type_ align-opts float float float) trsqv 10) + (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv 11) ;; 3rd arg is unused (first-transform (_type_) transform 12) (snd-transform (_type_) transform 13) ) @@ -38,10 +61,12 @@ (go process-drawable-art-error "memory") (return (the align-control 0)) ) - + (set! (-> obj process) (the-as process-drawable proc)) obj ) ) + + diff --git a/goal_src/engine/anim/aligner.gc b/goal_src/engine/anim/aligner.gc index 1f06cc5244..60a5b4f60c 100644 --- a/goal_src/engine/anim/aligner.gc +++ b/goal_src/engine/anim/aligner.gc @@ -5,11 +5,11 @@ ;; name in dgo: aligner ;; dgos: GAME, ENGINE -;; definition for method 9 of type align-control +;; DECOMP BEGINS + ;; WARN: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; WARN: Unsupported inline assembly instruction kind - [jr ra] -;; Used lq/sq -(defmethod TODO-RENAME-9 align-control ((obj align-control)) +(defmethod compute-alignment! align-control ((obj align-control)) (local-vars (a0-9 symbol) (s7-0 none) (ra-0 int)) (with-pp (let ((s5-0 (-> obj process skel active-channels))) @@ -21,11 +21,7 @@ (a2-0 (= a0-4 a1-0)) ) (cond - ((or a2-0 (begin - (set! a1-0 'stack1) - (= a0-4 a1-0) - ) - ) + ((or a2-0 (begin (set! a1-0 'stack1) (= a0-4 a1-0))) ) (else ; TODO - support decompiling the return-from-thread @@ -62,37 +58,30 @@ (set! a0-9 (< (* (-> a0-8 param 0) (- f0-0 (-> obj frame-num))) 0.0)) ) (else - (set! a0-9 (= f0-0 0.0)) - ) + (set! a0-9 (= f0-0 0.0)) + ) ) (if a0-9 - (logior! (-> obj flags) 1) - (set! (-> obj flags) (logand -2 (the-as int (-> obj flags)))) + (logior! (-> obj flags) (align-flags disabled)) + (logclear! (-> obj flags) (align-flags disabled)) ) (set! (-> obj frame-group) v1-16) (set! (-> obj frame-num) f0-0) ) - (mem-copy! - (the-as pointer (-> obj transform 1)) - (the-as pointer (-> obj transform)) - 48 - ) - (quaternion-copy! - (the-as quaternion (-> obj transform 1 rot)) - (-> obj align quat) - ) + (mem-copy! (the-as pointer (-> obj transform 1)) (the-as pointer (-> obj transform)) 48) + (quaternion-copy! (the-as quaternion (-> obj transform 1 rot)) (-> obj align quat)) (set! (-> obj transform 1 scale quad) (-> obj align scale quad)) - (let* ((a2-5 (-> obj matrix 1)) + (let* ((a2-5 (-> obj matrix 1 vector)) (a3-0 (-> obj matrix)) (v1-19 (-> a3-0 0 vector 0 quad)) (a0-18 (-> a3-0 0 vector 1 quad)) (a1-12 (-> a3-0 0 vector 2 quad)) (a3-1 (-> a3-0 0 vector 3 quad)) ) - (set! (-> a2-5 vector 0 quad) v1-19) - (set! (-> a2-5 vector 1 quad) a0-18) - (set! (-> a2-5 vector 2 quad) a1-12) - (set! (-> a2-5 vector 3 quad) a3-1) + (set! (-> a2-5 0 quad) v1-19) + (set! (-> a2-5 1 quad) a0-18) + (set! (-> a2-5 2 quad) a1-12) + (set! (-> a2-5 3 quad) a3-1) ) (let ((s5-1 (-> obj process node-list data 1))) (cspace<-matrix-no-push-joint! s5-1 (-> obj process skel)) @@ -108,71 +97,43 @@ (set! (-> v1-23 0 vector 2 quad) a2-6) (set! (-> v1-23 0 vector 3 quad) a3-3) ) - (vector*! - (the-as vector (-> obj transform)) - (-> s5-1 bone position) - (-> obj process root scale) - ) + (vector*! (the-as vector (-> obj transform)) (-> s5-1 bone transform vector 3) (-> obj process root scale)) ) (vector-! - (the-as vector (-> obj delta)) - (the-as vector (-> obj transform)) - (the-as vector (-> obj transform 1)) - ) + (the-as vector (-> obj delta)) + (the-as vector (-> obj transform)) + (the-as vector (-> obj transform 1)) + ) (set-vector! - (-> obj align scale) - (vector-length (the-as vector (-> obj matrix))) - (vector-length (-> obj matrix 0 vector 1)) - (vector-length (-> obj matrix 0 vector 2)) - 1.0 - ) - (vector-! - (-> obj delta scale) - (-> obj align scale) - (-> obj transform 1 scale) - ) - (let - ((a2-8 - (matrix-inv-scale! (new 'stack-no-clear 'matrix) (-> obj align scale)) - ) - ) - (quaternion-normalize! - (matrix->quaternion - (-> obj align quat) - (matrix*! a2-8 (the-as matrix (-> obj matrix)) a2-8) - ) - ) + (-> obj align scale) + (vector-length (the-as vector (-> obj matrix))) + (vector-length (-> obj matrix 0 vector 1)) + (vector-length (-> obj matrix 0 vector 2)) + 1.0 ) - (let - ((a1-24 - (quaternion-inverse! - (new 'stack-no-clear 'quaternion) - (the-as quaternion (-> obj transform 1 rot)) - ) - ) - ) + (vector-! (-> obj delta scale) (-> obj align scale) (-> obj transform 1 scale)) + (let ((a2-8 (matrix-inv-scale! (new 'stack-no-clear 'matrix) (-> obj align scale)))) (quaternion-normalize! - (quaternion*! (-> obj delta quat) a1-24 (-> obj align quat)) - ) + (matrix->quaternion (-> obj align quat) (matrix*! a2-8 (the-as matrix (-> obj matrix)) a2-8)) + ) + ) + (let ((a1-24 (quaternion-inverse! (new 'stack-no-clear 'quaternion) (the-as quaternion (-> obj transform 1 rot))))) + (quaternion-normalize! (quaternion*! (-> obj delta quat) a1-24 (-> obj align quat))) ) (-> obj delta) ) ) -;; definition for method 12 of type align-control -;; INFO: Return type mismatch (inline-array transform) vs transform. (defmethod first-transform align-control ((obj align-control)) (the-as transform (-> obj transform)) ) -;; definition for method 13 of type align-control (defmethod snd-transform align-control ((obj align-control)) (-> obj transform 1) ) -;; definition for method 10 of type align-control -(defmethod TODO-RENAME-10 align-control ((obj align-control) (arg0 int) (arg1 float) (arg2 float) (arg3 float)) - (when (zero? (logand (-> obj flags) 1)) +(defmethod align! align-control ((obj align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float)) + (when (zero? (logand (-> obj flags) (align-flags disabled))) (let* ((a0-1 (-> obj process)) (t9-0 (method-of-object a0-1 apply-alignment)) (v1-4 (-> obj delta)) @@ -188,83 +149,47 @@ (-> obj process root) ) -;; definition for method 26 of type trsqv -(defmethod - TODO-RENAME-26 - trsqv - ((obj trsqv) (arg0 int) (arg1 vector) (arg2 float)) +(defmethod set-and-limit-velocity trsqv ((obj trsqv) (arg0 int) (arg1 vector) (arg2 float)) (let ((gp-0 (-> obj transv))) - (when (nonzero? (logand arg0 4)) - (set! (-> gp-0 x) (-> arg1 x)) - (set! (-> gp-0 z) (-> arg1 z)) - (let - ((f0-4 - (fmin (* (vector-xz-length arg1) (-> *display* frames-per-second)) arg2) - ) + (when (logtest? arg0 4) + (set! (-> gp-0 x) (-> arg1 x)) + (set! (-> gp-0 z) (-> arg1 z)) + (let ((f0-4 (fmin (* (vector-xz-length arg1) (-> *display* frames-per-second)) arg2))) + (vector-xz-normalize! gp-0 f0-4) + ) ) - (vector-xz-normalize! gp-0 f0-4) - ) ) - ) obj ) -;; definition for method 11 of type align-control -;; INFO: Return type mismatch trsqv vs none. -(defmethod - TODO-RENAME-11 - align-control - ((obj align-control) - (arg0 int) - (arg1 vector) - (arg2 int) - (arg3 float) - (arg4 float) - ) - (when (zero? (logand (-> obj flags) 1)) - (let ((s5-0 (-> obj delta))) - (let ((s3-0 (-> obj process root transv))) - (if (nonzero? (logand arg0 2)) - (set! - (-> s3-0 y) - (* (* (-> s5-0 trans y) arg3) (-> *display* frames-per-second)) - ) - ) - (when (nonzero? (logand arg0 4)) - (set! (-> s3-0 x) (-> arg1 x)) - (set! (-> s3-0 z) (-> arg1 z)) - (let - ((f0-8 - (* - (fmin - (vector-xz-length arg1) - (* (vector-xz-length (-> s5-0 trans)) arg4) - ) - (-> *display* frames-per-second) +(defmethod align-vel-and-quat-only! align-control ((obj align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) + (when (zero? (logand (-> obj flags) (align-flags disabled))) + (let ((s5-0 (-> obj delta))) + (let ((s3-0 (-> obj process root transv))) + (if (logtest? arg0 (align-opts adjust-y-vel)) + (set! (-> s3-0 y) (* (-> s5-0 trans y) arg3 (-> *display* frames-per-second))) + ) + (when (logtest? arg0 (align-opts adjust-xz-vel)) + (set! (-> s3-0 x) (-> arg1 x)) + (set! (-> s3-0 z) (-> arg1 z)) + (let ((f0-8 (* (fmin (vector-xz-length arg1) (* (vector-xz-length (-> s5-0 trans)) arg4)) + (-> *display* frames-per-second) + ) + ) + (t9-2 vector-xz-normalize!) + ) + (set! (-> obj last-speed) f0-8) + (t9-2 s3-0 f0-8) + ) ) - ) - (t9-2 vector-xz-normalize!) ) - (set! (-> obj last-speed) f0-8) - (t9-2 s3-0 f0-8) - ) + (if (logtest? arg0 (align-opts adjust-quat)) + (quaternion-normalize! (quaternion*! (-> obj process root quat) (-> obj process root quat) (-> s5-0 quat))) + ) ) - ) - (if (nonzero? (logand arg0 16)) - (quaternion-normalize! - (quaternion*! - (-> obj process root quat) - (-> obj process root quat) - (-> s5-0 quat) - ) - ) - ) ) - ) (-> obj process root) - (none) ) - diff --git a/goal_src/engine/anim/bones-h.gc b/goal_src/engine/anim/bones-h.gc index 56f2b059da..d0a6b7052c 100644 --- a/goal_src/engine/anim/bones-h.gc +++ b/goal_src/engine/anim/bones-h.gc @@ -5,6 +5,10 @@ ;; name in dgo: bones-h ;; dgos: GAME, ENGINE +;; The "bone" system computes bone matrices from joint animations. +;; It looks like it also expanded to do most of the DMA generation +;; for the foreground renderers. + (deftype bone-buffer (structure) ((joint joint-anim-compressed-hdr 16 :inline :offset-assert 0) (bone bone 16 :inline :offset-assert 1024) diff --git a/goal_src/engine/anim/bones.gc b/goal_src/engine/anim/bones.gc index 8418441690..9d2b766580 100644 --- a/goal_src/engine/anim/bones.gc +++ b/goal_src/engine/anim/bones.gc @@ -4,6 +4,7 @@ ;; name: bones.gc ;; name in dgo: bones ;; dgos: GAME, ENGINE +;; note: changed for high fps ;; Bones. ;; There are 4 main functions used by the outside world: @@ -15,7 +16,7 @@ ;; It's more than just bones in here - submitting to merc is done from here. -(defglobalconstant USE_GENERIC #t) +(defglobalconstant BACKWARD_COMPAT_MERC_CLIP #f) ;;;;;;;;;;;;;;;;;; ;; calc list @@ -114,7 +115,7 @@ (a1-1 (the-as mei-texture-scroll (+ (the-as uint a1-0) (* (-> a1-0 texture-scroll-offset) 16)))) ) (when (< v1-1 32) - (let* ((a3-1 (-> *display* integral-frame-counter)) + (let* ((a3-1 (the int (* (-> *display* time-adjust-ratio) (-> *display* integral-frame-counter)))) ;; changed for high fps (a2-3 (-> a1-1 time-factor)) (t0-2 (+ (ash 1 a2-3) -1)) ) @@ -330,7 +331,7 @@ (let ((a2-1 (the-as bone-memory (+ 16 (scratchpad-object int)))) (v1-2 (the-as bone-memory (+ 16 (scratchpad-object int)))) ) - + ;; layout joints, bones, and outputs (set! (-> a2-1 work layout joint 0) (the-as joint (+ 256 (scratchpad-object int)))) (set! (-> a2-1 work layout joint 1) (the-as joint (+ 4864 (scratchpad-object int)))) @@ -338,7 +339,7 @@ (set! (-> a2-1 work layout bone 1) (the-as bone (+ 5888 (scratchpad-object int)))) (set! (-> a2-1 work layout output 0) (the-as uint (+ 2816 (scratchpad-object int)))) (set! (-> a2-1 work layout output 1) (the-as uint (+ 7424 (scratchpad-object int)))) - + ;; set up work (set! (-> v1-2 work next-tag dma) (new 'static 'dma-tag :id (dma-tag-id next))) (set! (-> v1-2 work next-tag vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) @@ -347,13 +348,13 @@ (set! (-> v1-2 work sink-group) arg1) (set! (-> v1-2 work next-merc) (the-as dma-packet 0)) ) - + ;; reset globals (let ((v1-3 *merc-globals*)) (set! (-> v1-3 first) (the-as uint 0)) (set! (-> v1-3 next) (the-as (pointer uint32) 0)) ) - + ;; upload bones program. (#unless PC_PORT (let ((gp-0 *vu0-dma-list*)) @@ -373,7 +374,7 @@ (dma-buffer-send-chain (the-as dma-bank-source #x10008000) gp-0) ) ) - + ;; we will use "run" in the shadow queue. Reset that (but don't increment yet, just in case we don't draw shadows) (let ((gp-1 *shadow-queue*)) (if (>= (-> gp-1 cur-run) (the-as uint 15)) @@ -476,11 +477,11 @@ (.lvf vf25 (&-> v1-13 vector 0 quad)) (.lvf vf26 (&-> v1-13 vector 1 quad)) (.lvf vf27 (&-> v1-13 vector 2 quad)) - + (.mov v1-14 vf27) ;; hack?? - - + + (bones-mtx-calc (the-as int (-> s4-0 matrix-area)) (the-as pointer (-> s4-0 joints)) @@ -685,13 +686,13 @@ (t6-0 (-> t5-2 flags)) ) (-> arg0 cur-lod) - (when (zero? (logand t6-0 2)) + (when (zero? (logand t6-0 (shadow-flags disable-fade))) (if (< (-> t5-2 fade-dist) t4-0) - (set! t6-0 (logior t6-0 32)) + (set! t6-0 (logior t6-0 (shadow-flags disable-draw))) ) ) (cond - ((zero? (logand t6-0 32)) + ((zero? (logand t6-0 (shadow-flags disable-draw))) (let ((t2-1 (* t2-0 8)) (t4-4 (-> t1-0 total-size)) ) @@ -889,7 +890,7 @@ ; (let ((vec (the vector (+ (the-as int a3-2) 16)))) ; (format 0 "#x~X #x~X mat ~D: ~f ~f ~f~%" a0-55 a3-2 a1-17 (-> vec x) (-> vec y) (-> vec z)) ; ) - + ) (set! (-> (the-as dma-packet a0-55) vif0) (new 'static 'vif-tag)) (set! (-> (the-as dma-packet a0-55) vif1) (new 'static 'vif-tag)) @@ -936,6 +937,35 @@ `(set! (-> (the-as (pointer uint32) ,addr)) ,val) ) +(defun pc-draw-bones ((dc draw-control) (dma-buf pointer)) + "Add a dma packet to tell the PC renderer which model we are renderering." + (let ((packet (the-as dma-packet dma-buf))) + ;; merc draw asm will check this. + (when (zero? (-> (scratchpad-object terrain-context) work foreground bone-mem work next-merc)) + (set! (-> (scratchpad-object terrain-context) work foreground bone-mem work next-merc) packet) + ) + (set! (-> packet dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc 10)) + (set! (-> packet vif0) (new 'static 'vif-tag)) + (set! (-> packet vif1) (new 'static 'vif-tag :cmd (vif-cmd pc-port))) + (set! dma-buf (the pointer (&+ packet 16))) + ) + + (let ((data-ptr (the-as (pointer uint128) dma-buf))) + (charp<-string (the (pointer uint8) (&-> data-ptr 0)) (-> dc mgeo name)) + ) + (&+! dma-buf (* 16 10)) + + ;; merc linking needs this. + (let ((packet (the-as dma-packet dma-buf))) + (set! (-> packet dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc 0)) + (set! (-> packet vif0) (new 'static 'vif-tag)) + (set! (-> packet vif1) (new 'static 'vif-tag)) + (set! dma-buf (the pointer (&+ packet 16))) + ) + + dma-buf + ) + (defun draw-bones ((arg0 draw-control) (dma-buf dma-buffer) (arg2 float)) "Main draw function for all bone-related renderers. Will set up merc, generic and shadow. and also add the bones to the calculation list." @@ -943,7 +973,7 @@ (used-merc int) (used-mercneric int) (effect-idx int) (sv-144 ripple-control)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) (vf7 :class vf) (vf8 :class vf) (vf9 :class vf) (acc :class vf)) - + ;; compute the number of bones. I believe this num-joints doesn't count align/prejoint/main, so each needs a bone (let* ((num-bones (+ (-> arg0 mgeo num-joints) 3)) ;; we'll use 128-bytes/bone. @@ -951,11 +981,11 @@ ;; temp work (spr-work (scratchpad-object terrain-context)) ) - + ;;;;;;;;;;;;;;;;;;;;;;;;; ;; BONE CALC SETUP ;;;;;;;;;;;;;;;;;;;;;;;;; - + ;; next, grab some DMA data. ;; we'll also use this for storing bone calculation entries. (let* ((dma-data-start (-> dma-buf base)) @@ -965,14 +995,14 @@ ;; we won't calculate them now, but instead we'll tell the *bone-calculation-list* to put them here later. (matrix-data (the-as object (&+ dma-data-start 64))) ) - + ;; align the matrix data to 64 bytes (we know it is at least 16 byte aligned) (let ((a2-1 (logand (the-as int matrix-data) 48))) (b! (zero? a2-1) cfg-2 :delay (nop!)) (set! matrix-data (&- (&+ (the-as pointer matrix-data) 64) (the-as uint a2-1))) ) (label cfg-2) - + ;; start recording perf stats. ;; this just counts the stats for adding the calculation to the linked list. ;; which is really fast and not worth profiling. @@ -989,7 +1019,7 @@ (set! (-> a2-6 bone-ptr) (-> arg0 skeleton bones)) (set! (-> a2-6 num-bones) (the-as uint num-bones)) ) - + ;; Add the bone calculation to the list, to be done later. ;; this will write to both the "matrix data" and the bones array. (let ((t0-2 matrix-data) @@ -1021,7 +1051,7 @@ (&+ bone-calc-entry 48) ;; end stat collection (read! (-> *perf-stats* data (perf-stat-bucket bones))) - + ;; set up the dma buffer (let ((s2-0 (the-as object (+ (the-as uint matrix-data) bone-data-size)))) (let ((a0-2 (shl (the-as int s2-0) 32))) @@ -1030,15 +1060,25 @@ ) ;; NOTE: does this work correctly for the upper 64 bits?? ) - + ;; only data-format 1 is supported. (when (= (-> arg0 data-format) 1) + + ;; we'll be filling out the *merc-bucket-info*, then calling the draw asm functions + ;; the asm functions read *merc-bucket-info* and generate DMA data as needed. + + ;;;;;;;;;;;;;;;;;;;;;;;;; + ;; LIGHT SETUP + ;;;;;;;;;;;;;;;;;;;;;;;;; + ;; lights should be converted to a single vu-lights already, by the drawing code. ;; it stashes lights on the scratchpad. We'll load these here and transform them. - ;; the result goes in the merc-bucke-info. + ;; the result goes in the merc-bucket-info. (let ((v1-6 (the-as vu-lights (+ 64 (scratchpad-object int)))) (a0-7 (-> *merc-bucket-info* light)) ) + ;; merc does drawing in a camera rotated frame, so multiply by inv-rot to have the right directions + ;; relative to the camera. (let ((a1-8 (-> *math-camera* inv-camera-rot))) (.lvf vf4 (&-> a1-8 vector 0 quad)) (.lvf vf5 (&-> a1-8 vector 1 quad)) @@ -1047,30 +1087,29 @@ (.lvf vf1 (&-> v1-6 direction 0 quad)) (.lvf vf2 (&-> v1-6 direction 1 quad)) (.lvf vf3 (&-> v1-6 direction 2 quad)) - ;;(.vcallms 54) - ;; TODO! - - ;mulax.xyzw ACC, vf01, vf04 - (.mul.x.vf acc vf1 vf4) - ;madday.xyzw ACC, vf02, vf04 - (.add.mul.y.vf acc vf2 vf4 acc) - ;maddz.xyzw vf07, vf03, vf04 - (.add.mul.z.vf vf7 vf3 vf4 acc) - - ;mulax.xyzw ACC, vf01, vf05 - (.mul.x.vf acc vf1 vf5) - ;madday.xyzw ACC, vf02, vf05 - (.add.mul.y.vf acc vf2 vf5 acc) - ;maddz.xyzw vf08, vf03, vf05 - (.add.mul.z.vf vf8 vf3 vf5 acc) - - ;mulax.xyzw ACC, vf01, vf06 - (.mul.x.vf acc vf1 vf6) - ;madday.xyzw ACC, vf02, vf06 :e - (.add.mul.y.vf acc vf2 vf6 acc) - ;maddz.xyzw vf09, vf03, vf06 - (.add.mul.z.vf vf9 vf3 vf6 acc) - + ;;(.vcallms 54) ;; manually ported to goal here. + + ;mulax.xyzw ACC, vf01, vf04 + (.mul.x.vf acc vf1 vf4) + ;madday.xyzw ACC, vf02, vf04 + (.add.mul.y.vf acc vf2 vf4 acc) + ;maddz.xyzw vf07, vf03, vf04 + (.add.mul.z.vf vf7 vf3 vf4 acc) + + ;mulax.xyzw ACC, vf01, vf05 + (.mul.x.vf acc vf1 vf5) + ;madday.xyzw ACC, vf02, vf05 + (.add.mul.y.vf acc vf2 vf5 acc) + ;maddz.xyzw vf08, vf03, vf05 + (.add.mul.z.vf vf8 vf3 vf5 acc) + + ;mulax.xyzw ACC, vf01, vf06 + (.mul.x.vf acc vf1 vf6) + ;madday.xyzw ACC, vf02, vf06 :e + (.add.mul.y.vf acc vf2 vf6 acc) + ;maddz.xyzw vf09, vf03, vf06 + (.add.mul.z.vf vf9 vf3 vf6 acc) + (let ((a1-9 (-> v1-6 color 0 quad))) (let ((a2-14 (-> v1-6 color 1 quad))) (let ((a3-11 (-> v1-6 color 2 quad))) @@ -1088,62 +1127,85 @@ (.svf (&-> a0-7 direction 2 quad) vf9) (set! (-> a0-7 direction 1 w) (the-as float 0)) ) - + ;; the drawable system's culling already knows if we need clipping or not, - ;; we just trust it. - (set! (-> *merc-bucket-info* needs-clip) + ;; we just trust it. Anything needing clip will have this set. It might set it for + ;; meshes that actually don't need clipping. + (set! (-> *merc-bucket-info* needs-clip) (if (logtest? (-> arg0 status) (draw-status needs-clip)) 1 0 ) ) - + ;; Now, we need to decide on merc settings. Default to nothing. (set! used-merc 0) (set! used-mercneric 0) + ;; clipping is really slow because merc vertex interpolation is slow + ;; so we have an option to just let the GS scissor, called mercprime. + ;; it requires a special codepath in merc called mercprime. (set! (-> *merc-bucket-info* need-mercprime-if-merc) 0) + ;; if we're really out of bounds, mercprime will fail, and we need to fall back to mercneric + ;; in order to do clipping. (set! (-> *merc-bucket-info* must-use-mercneric-for-clip) 0) - - (when (logtest? (-> arg0 status) (draw-status needs-clip)) - ;; we can either clip with "mercprime" (part of merc), or fall back to generic. - ;; the generic approach always works, but is slower, so we try to use mercprime. - ;; the user must provide a longest edge length, and we must pass an edge check (fails if close to camera) - (cond - ((nonzero? (-> arg0 longest-edge)) - ;; TODO this makes close up things bad... - (if (draw-bones-check-longest-edge-asm arg0 arg2) - (set! (-> *merc-bucket-info* need-mercprime-if-merc) 1) ;; clip with mercprime! - (set! (-> *merc-bucket-info* must-use-mercneric-for-clip) 1) ;; failed, use generic + + ;;;;;;;;;;;;;;;;;;; + ;; CLIPPING TEST + ;; in the PC port merc2 renderer, we handle clipping perfectly without any special flags, and it's the fastest. + ;; so we only need to worry about mercneric/mercprime if we want to maintain backward compatibility with original merc + (#when BACKWARD_COMPAT_MERC_CLIP + (when (logtest? (-> arg0 status) (draw-status needs-clip)) + ;; we can either clip with "mercprime" (part of merc), or fall back to generic. + ;; the generic approach always works, but is slower, so we try to use mercprime. + ;; the user must provide a longest edge length, and we must pass an edge check (fails if close to camera) + (cond + ((nonzero? (-> arg0 longest-edge)) + ;; check to see if the edge will be too long: + (if (draw-bones-check-longest-edge-asm arg0 arg2) + (set! (-> *merc-bucket-info* need-mercprime-if-merc) 1) ;; use mercprime! + (set! (-> *merc-bucket-info* must-use-mercneric-for-clip) 1) ;; failed, use generic and actually scissor + ) + ) + (else + ;; in cases where no longest edge is set, fall back to mercneric for clipping always + (set! (-> *merc-bucket-info* must-use-mercneric-for-clip) 1) + ) + ) + ) ) - ) - (else - (set! (-> *merc-bucket-info* must-use-mercneric-for-clip) 1) ;; no longest edge info, use generic. - ) - ) - ) - + ;; grab the geometry at the appropriate level of detail. - (let ((geom (-> arg0 lod-set lod (-> arg0 cur-lod) geo))) + (let ((geom (-> arg0 lod-set lod (-> arg0 cur-lod) geo)) + ;; merc2 can't handle all cases of the original merc, so we add this fallback on PC. + (pc-force-mercneric #f) + ) ;; loop over effects, and set them up/pick renderers. (set! effect-idx 0) (while (< effect-idx (the-as int (-> geom header effect-count))) - - ;; try texture scroll + + ;; check if this "effect" uses texture scrolling (when (logtest? (-> geom effect effect-idx effect-bits) 1) + ;; grab the extra info for it: (let* ((v1-35 (-> geom effect effect-idx extra-info)) (v1-36 (the-as mei-texture-scroll (+ (the-as uint v1-35) (* (-> v1-35 texture-scroll-offset) 16)))) ) - (if (< arg2 (-> v1-36 max-dist)) - ;; just add to texscroll list. + (when (< arg2 (-> v1-36 max-dist)) ;; in range to draw? + ;; do scrolling. in PC, always use generic here because merc2 can't update texture coordinates + (#when PC_PORT + (set! pc-force-mercneric #t) + ) (texscroll-make-request (-> geom effect effect-idx)) ) ) ) - - ;; try ripple + + ;; check if this effect uses "ripple" (when (logtest? (-> geom effect effect-idx effect-bits) 4) - ;; TODO. (when (-> arg0 ripple) + ;; merc2 can't handle ripple, even if it's off. + (#when PC_PORT + (set! pc-force-mercneric #t) + ) (set! sv-144 (-> arg0 ripple)) (let* ((f1-4 (/ (- (-> sv-144 far-fade-dist) arg2) (- (-> sv-144 far-fade-dist) (-> sv-144 close-fade-dist)))) (f1-6 (fmax 0.0 (fmin 1.0 f1-4))) @@ -1182,17 +1244,45 @@ ) ) ) - - + + ;; additional check on PC to force mercneric for blend shapes + (#when PC_PORT + (let* ((pd (the process-drawable (-> arg0 process))) + (jc (-> pd skel))) + (when (nonzero? jc) + (when (logtest? (-> jc status) (janim-status blerc)) + (set! pc-force-mercneric #t) + ) + ) + ) + ) + + + ;; final mercneric checks (cond - ((nonzero? (-> arg0 death-timer)) - ;; if using hte death effect, use mercneric always! + ((nonzero? (-> arg0 death-timer)) ;; death effect? + ;; use mercneric always! (set! (-> *merc-bucket-info* effect effect-idx use-mercneric) (the-as uint 1)) (set! used-mercneric 1) used-mercneric ) ((nonzero? (-> geom effect effect-idx envmap-usage)) ;; if we need envmap, set it up. + + ;; hack: + ;; the game switches from mercneric to merc after the envmap is faded out. + ;; this would normally be fine in the PC port too, but we want the eyes to remain + ;; using mercneric (dynamic texture updates) in PC. + ;; so we force mercneric on models with envmap and very few tris. + ;; it seems to work so far... + (#when PC_PORT + (when (and + (< (-> geom effect effect-idx tri-count) 100) + (-> geom header eye-ctrl) + ) + (set! pc-force-mercneric #t) + ) + ) (let* ((v1-83 (-> geom effect effect-idx extra-info)) ;; pointer to envmap tint data (v1-84 (the-as structure (+ (the-as uint v1-83) (* (-> v1-83 envmap-tint-offset) 16)))) @@ -1208,10 +1298,11 @@ (if (< f0-9 0.0) (set! f0-9 0.0) ) - + (cond ;; do envmap stuff if we are using generic anyway, or our strength is > 0. - ((or (nonzero? (-> *merc-bucket-info* must-use-mercneric-for-clip)) (< 0.0 f0-9)) + ((or (nonzero? (-> *merc-bucket-info* must-use-mercneric-for-clip)) (< 0.0 f0-9) pc-force-mercneric) + ;; multiply colors by sun tint. (let ((v1-85 (&-> (the-as merc-extra-info v1-84) dummy 4)) (a0-36 (the-as object (-> *merc-bucket-info* effect effect-idx))) @@ -1249,8 +1340,7 @@ ) ) ;; final two cases are for all other effects that don't matter generic/normal - ;; here is a good place to force mercneric. - ((nonzero? (-> *merc-bucket-info* must-use-mercneric-for-clip)) + ((or (nonzero? (-> *merc-bucket-info* must-use-mercneric-for-clip)) pc-force-mercneric) (set! (-> *merc-bucket-info* effect effect-idx use-mercneric) (the-as uint 1)) (set! used-mercneric 1) used-mercneric @@ -1262,54 +1352,34 @@ used-merc ) ) - - ;; HACK just use merc if we aren't using generic. - (#unless USE_GENERIC - (when (logtest? *vu1-enable-user* (vu1-renderer-mask generic)) - (unless (logtest? (-> arg0 status) (draw-status needs-clip)) - ;; no clip, but wants generic. Just use merc for now. - (set! (-> *merc-bucket-info* effect effect-idx use-mercneric) (the-as uint 0)) - (set! used-merc 1) - ) - (when (and (logtest? (-> arg0 status) (draw-status needs-clip)) ;; we need to clip - ;;(nonzero? (-> arg0 longest-edge)) ;; we known the longest edge - ;;(draw-bones-check-longest-edge-asm arg0 arg2) ;; it's ok to use percprime. - ) - ;; wants clip. in all cases, give to merc. this might give it to merc even if it fails the - ;; long edge check, but it does ok - (set! (-> *merc-bucket-info* effect effect-idx use-mercneric) (the-as uint 0)) - (set! (-> *merc-bucket-info* need-mercprime-if-merc) 1) - (set! used-merc 1) - ) - ) - ) - + + ;; final force to mercneric for ps + (when pc-force-mercneric + (set! (-> *merc-bucket-info* effect effect-idx use-mercneric) (the-as uint 1)) + (set! used-mercneric 1) + ) + (set! effect-idx (+ effect-idx 1)) ) ;; end effect loop - + ;; draw generic! - ;; note: this doesn't do the fully draw, there's some other stuff in process-drawable.gc to actually execute. - (#when USE_GENERIC - (when (nonzero? used-mercneric) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask generic)) - (set! (-> dma-buf base) (draw-bones-generic-merc arg0 (the pointer matrix-data) (the pointer s2-0) 0)) - (set! s2-0 (-> dma-buf base)) - ) + ;; note: this doesn't do the fully draw, there's some other stuff in process-drawable.gc to actually execute. + (when (nonzero? used-mercneric) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask generic)) + (set! (-> dma-buf base) (draw-bones-generic-merc arg0 (the pointer matrix-data) (the pointer s2-0) 0)) + (set! s2-0 (-> dma-buf base)) ) ) - + ;; draw shadow! - ;; TODO (when (-> arg0 shadow) (when #t (set! s2-0 (draw-bones-shadow arg0 (the pointer matrix-data) (the pointer s2-0))) (set! (-> dma-buf base) (the-as pointer s2-0)) ) ) - + ;; draw merc! - - ;; (when (nonzero? used-merc) (when (logtest? *vu1-enable-user* (vu1-renderer-mask merc)) (when (= (-> arg0 cur-lod) (-> arg0 lod-set max-lod)) @@ -1328,6 +1398,7 @@ ) ) ) + (set! s2-0 (pc-draw-bones arg0 (the pointer s2-0))) (if (nonzero? (-> *merc-bucket-info* need-mercprime-if-merc)) (set! (-> dma-buf base) (draw-bones-merc arg0 matrix-data s2-0 32 17)) (set! (-> dma-buf base) (draw-bones-merc arg0 matrix-data s2-0 35 20)) @@ -1336,7 +1407,7 @@ ) ) ) ;; end geom processing - + ;; advance death timer. (when (nonzero? (-> arg0 death-timer)) (when (not (paused?)) diff --git a/goal_src/engine/anim/joint-h.gc b/goal_src/engine/anim/joint-h.gc index 20e5035b10..0df4bbda56 100644 --- a/goal_src/engine/anim/joint-h.gc +++ b/goal_src/engine/anim/joint-h.gc @@ -81,7 +81,7 @@ :flag-assert #xb000000c0 (:methods (new (symbol type int) _type_ 0) - (dummy-9 (_type_) float 9) + (current-cycle-distance (_type_) float 9) (debug-print-channels (_type_ symbol) int 10) ) ) diff --git a/goal_src/engine/anim/joint.gc b/goal_src/engine/anim/joint.gc index 941b5b21f9..dc1503cd51 100644 --- a/goal_src/engine/anim/joint.gc +++ b/goal_src/engine/anim/joint.gc @@ -188,7 +188,7 @@ (-> obj channel s4-0 frame-group) ) ) - + ) (format arg0 @@ -572,19 +572,17 @@ (defun joint-control-channel-eval ((arg0 joint-control-channel)) "Run the joint control num-func callback, remember the current time" - (let ((f0-2 ((-> arg0 num-func) arg0 (-> arg0 param 0) (-> arg0 param 1)))) - (set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter))) - f0-2 - ) + ((-> arg0 num-func) arg0 (-> arg0 param 0) (-> arg0 param 1)) + (set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter))) + (none) ) (defun joint-control-channel-eval! ((arg0 joint-control-channel) (arg1 (function joint-control-channel float float float))) "Set the joint control num-func, and evaluate it." (set! (-> arg0 num-func) arg1) - (let ((f0-2 (arg1 arg0 (-> arg0 param 0) (-> arg0 param 1)))) - (set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter))) - f0-2 - ) + (arg1 arg0 (-> arg0 param 0) (-> arg0 param 1)) + (set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter))) + (none) ) (defun joint-control-channel-group-eval! ((arg0 joint-control-channel) (arg1 art-joint-anim) (arg2 (function joint-control-channel float float float))) @@ -619,7 +617,7 @@ (defun joint-control-copy! ((arg0 joint-control) (arg1 joint-control)) "Copy one joint control to another." - + ;; set fields (set! (-> arg0 blend-index) (-> arg1 blend-index)) (set! (-> arg0 active-channels) (-> arg1 active-channels)) @@ -638,7 +636,7 @@ (the-as pointer (-> arg1 channel)) (* 48 (-> arg0 allocated-length)) ) - + ;; set parents of channels to point to the dest. (dotimes (v1-7 (-> arg0 allocated-length)) (set! (-> arg0 channel v1-7 parent) arg0) @@ -726,9 +724,9 @@ (v1-0 0) ;; offset in spad (a1-0 (-> (scratchpad-object terrain-context) work foreground joint-work flattened)) ;; start of data. ) - + ;; loop over active channels. - ;; + ;; (dotimes (a0-1 nb-channels) (let ((a2-3 (-> arg0 channel a0-1))) (case (-> a2-3 command) @@ -1031,7 +1029,7 @@ (the-as matrix (-> arg0 data)) ) -(defmethod dummy-9 cspace ((obj cspace) (arg0 basic)) +(defmethod reset-and-assign-geo! cspace ((obj cspace) (arg0 basic)) (set! (-> obj parent) #f) (set! (-> obj joint) #f) (set! (-> obj geo) arg0) @@ -1046,7 +1044,7 @@ (v1-1 type-to-make) ) (-> type-to-make size) - ((method-of-type cspace dummy-9) (the-as cspace (t9-0 allocation v1-1)) arg0) + ((method-of-type cspace reset-and-assign-geo!) (the-as cspace (t9-0 allocation v1-1)) arg0) ) ) @@ -1194,7 +1192,7 @@ ; (vf12 :class vf) ;; temp ; (vf13 :class vf) ;; temp ; (vf14 :class vf) ;; temp - + ; (vf16 :class vf) ;; temp ; (t1 :class vf) ; (t2 :class vf) @@ -1233,20 +1231,20 @@ ; (.add.w.vf vf2 vf2 vf0 :mask #b0001) ; (.add.w.vf vf3 vf3 vf0 :mask #b0010) ; (.add.w.vf vf4 vf4 vf0 :mask #b0100) - + ; ;; things for cond blocks ; (.lvf vf7 (-> t0 transform vector 0)) ; (.lvf vf8 (-> t0 transform vector 1)) ; (.lvf vf9 (-> t0 transform vector 2)) ; (.lvf vf10 (-> t0 transform vector 3)) ; (.lvf vf1 (-> a2 scale)) - + ; (cond ; ((zero? (-> t0 scale w)) ; (.mul.x.vf vf2 vf2 vf1) ; (.mul.y.vf vf3 vf3 vf1) ; (.mul.z.vf vf4 vf4 vf1) - + ; ;; the same ; (.matrix*! acc (vf11 vf12 vf13 vf14) (vf2 vf3 vf4 (vf15 vf15 vf15 vf0)) (vf7 vf8 vf9 vf10)) ; (.svf (-> a2 transform vector 0) vf11) @@ -1258,7 +1256,7 @@ ; (.mul.x.vf vf2 vf2 vf1) ; (.mul.y.vf vf3 vf3 vf1) ; (.mul.z.vf vf4 vf4 vf1) - + ; (.mov t1 (/ 1.0 (-> t0 scale x))) ; (.mov t2 (/ 1.0 (-> t0 scale y))) ; (.mov t3 (/ 1.0 (-> t0 scale z))) @@ -1268,7 +1266,7 @@ ; (.mul.vf vf2 vf2 vf16) ; (.mul.vf vf3 vf3 vf16) ; (.mul.vf vf4 vf4 vf16) - + ; ;; the same ; (.matrix*! acc (vf11 vf12 vf13 vf14) (vf2 vf3 vf4 (vf15 vf15 vf15 vf0)) (vf7 vf8 vf9 vf10)) ; (.svf (-> a2 transform vector 0) vf11) @@ -1307,7 +1305,7 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. - + (defun make-joint-jump-tables () #| #x3ee6b6f9, // = 9 ^ 1055307504 @@ -1375,8 +1373,8 @@ (set! (-> (scratchpad-object terrain-context) work foreground joint-work fix-jmp-table 15) (the-as (function none) (+ 0 #x3ee6b6f6)) ) - - + + (let ((arr (new 'static 'array uint32 16 #x7b2191b ;; = 6 ^ 129112349 #x7b21914 ;; = 9 ^ 129112349 @@ -1401,7 +1399,7 @@ ) ) ) - + (let ((arr (new 'static 'array uint32 16 #x4d7666df ;; = 6 ^ 1299605209 #x4d7666d0 ;; = 9 ^ 1299605209 @@ -1444,11 +1442,11 @@ ; (s6 :reg r13) ; ) ; ;(.sub sp -16) - + ; (let ((joint-num arg1)) - + ; ) - + ; ;(.add sp 16) ; ) ; ) diff --git a/goal_src/engine/anim/mspace-h.gc b/goal_src/engine/anim/mspace-h.gc index 9cd473c6bd..c9251ee67e 100644 --- a/goal_src/engine/anim/mspace-h.gc +++ b/goal_src/engine/anim/mspace-h.gc @@ -6,13 +6,13 @@ ;; dgos: GAME, ENGINE ;; this file contains types for the skeletal animation system. -;; the "bones" are the actual things with positions/orientations/scales in the game world. -;; the "joints" define how the bones are connected. +;; the "bones" are the actual matrix data consumed by the renderers. +;; the "joints" describe how bones are connected. ;; a "cspace" links together a bone, joint, and a way to control the joint (and bone) ;; There's three main container types: ;; - The cspace-array. This contains references to the bones and the joints. (called node-list) -;; - The skeleton: This contains the bones. (called skeleton) +;; - The skeleton: This is an inline array of bones. (called skeleton) ;; - The joint-control (not in this file): this has the logic for running joint animations. (called skel) @@ -21,7 +21,7 @@ ((name basic :offset-assert 4) ;; the joint's name (neckA, neckB, Rtoes, etc) (number int32 :offset-assert 8) ;; the joint's number in the cspace-array (parent joint :offset-assert 12) ;; the parent joint (ex, Lshould has parent of chest) - (bind-pose matrix :inline :offset-assert 16) ;; the bind pose, as a matrix. Unknown if used. + (bind-pose matrix :inline :offset-assert 16) ;; the bind pose, as a matrix. ) :method-count-assert 9 :size-assert #x50 @@ -65,7 +65,7 @@ ;; The "cspace" seems to be a system for linking bones and joints. ;; The tree structure matches the tree of joints. -;; For example: (-> *target* node-list data 14 parent joint) is the same as +;; For example: (-> *target* node-list data 14 parent joint) is the same as ;; (-> *target* node-list data 14 joint parent) ;; But, we appear to use bone indices here. ;; So the joint index is always 1 less than the node index. @@ -91,7 +91,7 @@ ;; params are loaded with signed loads. (:methods (new (symbol type basic) _type_ 0) - (dummy-9 (_type_ basic) _type_ 9) + (reset-and-assign-geo! (_type_ basic) _type_ 9) ) ) diff --git a/goal_src/engine/camera/cam-combiner.gc b/goal_src/engine/camera/cam-combiner.gc index adcd4c3dab..5b9506a66e 100644 --- a/goal_src/engine/camera/cam-combiner.gc +++ b/goal_src/engine/camera/cam-combiner.gc @@ -8,8 +8,7 @@ ;; DECOMP BEGINS (defstate cam-combiner-active (camera-combiner) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -175,10 +174,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (local-vars (sv-160 cam-rotation-tracker)) - (while #t + (loop (when (and (zero? (logand (-> *camera* master-options) 2)) (!= (-> self tracking-status) 0)) (set! (-> self tracking-status) (the-as uint 0)) 0 @@ -318,7 +316,7 @@ ) ) ((and (< 16384.0 f28-1) (< (vector-dot (-> self flip-control-axis) s4-1) 0.0)) - (set! (-> *camera* master-options) (logxor (-> *camera* master-options) 16)) + (logxor! (-> *camera* master-options) 16) ) ) (set! (-> self flip-control-axis quad) (-> s4-1 quad)) diff --git a/goal_src/engine/camera/cam-debug.gc b/goal_src/engine/camera/cam-debug.gc index 16d12c697e..7a84f68619 100644 --- a/goal_src/engine/camera/cam-debug.gc +++ b/goal_src/engine/camera/cam-debug.gc @@ -249,7 +249,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) a2-0 (the-as (pointer dma-tag) a3-16) ) @@ -1229,7 +1229,7 @@ (set! (-> a0-3 w) 1.0) (vector+! a1-2 v1-4 a0-3) ) - (add-debug-line #t (bucket-id debug-draw1) gp-0 s5-0 (new 'static 'rgba :r #xff :a #x80) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) gp-0 s5-0 (new 'static 'rgba :r #xff :a #x80) #f (the-as rgba -1)) (let ((a1-5 s5-0) (v1-5 gp-0) (a0-5 s5-0) @@ -1240,7 +1240,7 @@ (set! (-> a0-5 w) 1.0) (vector+! a1-5 v1-5 a0-5) ) - (add-debug-line #t (bucket-id debug-draw1) gp-0 s5-0 (new 'static 'rgba :g #xff :a #x80) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) gp-0 s5-0 (new 'static 'rgba :g #xff :a #x80) #f (the-as rgba -1)) (let ((a1-8 s5-0) (v1-6 gp-0) (a0-7 s5-0) @@ -1251,14 +1251,14 @@ (set! (-> a0-7 w) 1.0) (vector+! a1-8 v1-6 a0-7) ) - (add-debug-line #t (bucket-id debug-draw1) gp-0 s5-0 (new 'static 'rgba :b #xff :a #x80) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) gp-0 s5-0 (new 'static 'rgba :b #xff :a #x80) #f (the-as rgba -1)) (when arg0 (set! (-> s5-0 quad) (-> arg0 quad)) (vector-normalize! s5-0 4096.0) (vector+! s5-0 gp-0 s5-0) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-0 s5-0 (new 'static 'rgba :r #x7f :g #x7f :a #x80) @@ -1458,7 +1458,7 @@ (collide-kind background) (the-as process #f) s3-1 - 2 + (new 'static 'pat-surface :nocamera #x1) ) ) (s2-1 (new 'stack-no-clear 'vector)) @@ -1591,31 +1591,6 @@ arg0 ) -;; definition for function external-cam-reset! -;; INFO: Return type mismatch int vs none. -;; Used lq/sq -(defun external-cam-reset! () - (vector-reset! (-> *math-camera* trans)) - (matrix-identity! (-> *math-camera* inv-camera-rot)) - (when *camera-combiner* - (let* ((v1-6 (-> *math-camera* inv-camera-rot)) - (a3-0 (-> *camera-combiner* inv-camera-rot)) - (a0-2 (-> a3-0 vector 0 quad)) - (a1-0 (-> a3-0 vector 1 quad)) - (a2-0 (-> a3-0 vector 2 quad)) - (a3-1 (-> a3-0 vector 3 quad)) - ) - (set! (-> v1-6 vector 0 quad) a0-2) - (set! (-> v1-6 vector 1 quad) a1-0) - (set! (-> v1-6 vector 2 quad) a2-0) - (set! (-> v1-6 vector 3 quad) a3-1) - ) - (set! (-> *math-camera* trans quad) (-> *camera-combiner* trans quad)) - ) - 0 - (none) - ) - ) diff --git a/goal_src/engine/camera/cam-layout.gc b/goal_src/engine/camera/cam-layout.gc index 56a04a5a99..22a08d8617 100644 --- a/goal_src/engine/camera/cam-layout.gc +++ b/goal_src/engine/camera/cam-layout.gc @@ -168,7 +168,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-4) ) @@ -215,7 +215,7 @@ (sv-288 int) ) (let ((s4-0 0)) - (while #t + (loop (set! sv-16 (new 'static 'res-tag)) (let ((s3-0 (the-as (inline-array vector) ((method-of-type res-lump get-property-data) arg0 @@ -263,9 +263,9 @@ (when (!= s1-0 sv-272) (vector-float*! sv-192 (-> s3-0 sv-272) (-> s3-0 sv-272 w)) (vector-cross! sv-208 (-> s3-0 sv-272) (-> s3-0 s1-0)) - (vector-normalize! sv-208 (-> (new 'static 'array float 1 1.0) 0)) + (vector-normalize! sv-208 (the-as float 1.0)) (vector-cross! sv-224 sv-208 (-> s3-0 sv-272)) - (vector-normalize! sv-224 (-> (new 'static 'array float 1 1.0) 0)) + (vector-normalize! sv-224 (the-as float 1.0)) (let ((f0-6 (cam-layout-intersect-dist (-> s3-0 s1-0) sv-192 sv-224))) (when (!= f0-6 409600000.0) (vector+float*! sv-240 sv-192 sv-224 f0-6) @@ -317,7 +317,7 @@ (else (dotimes (v1-87 (the-as int (-> sv-16 elt-count))) (when (and (!= v1-87 s1-0) (!= v1-87 sv-272)) - (if (< (-> (new 'static 'array float 1 4096.0) 0) (- (vector-dot sv-160 (-> s3-0 v1-87)) (-> s3-0 v1-87 w))) + (if (< 4096.0 (- (vector-dot sv-160 (-> s3-0 v1-87)) (-> s3-0 v1-87 w))) (goto cfg-47) ) ) @@ -347,7 +347,7 @@ (set! sv-272 (+ sv-272 1)) ) (when (nonzero? sv-256) - (vector-float*! s0-0 s0-0 (/ (-> (new 'static 'array float 1 1.0) 0) (the float sv-256))) + (vector-float*! s0-0 s0-0 (/ 1.0 (the float sv-256))) (cond ((>= *volume-normal-current* 599) (format 0 "ERROR : camera editing out of volume normals~%") @@ -433,20 +433,20 @@ 0.0 0.0 (cond - ((< (-> (new 'static 'array float 1 1.0) 0) arg3) - (set! arg3 (-> (the-as (pointer float) (new 'static 'array float 1 1.0)) 0)) + ((< 1.0 arg3) + (set! arg3 (the-as float 1.0)) ) ((< arg3 0.0) - (set! arg3 (-> (the-as (pointer float) (new 'static 'array float 1 0.0)) 0)) + (set! arg3 (the-as float 0.0)) ) ) - (vector-normalize-copy! s2-0 arg1 (-> (new 'static 'array float 1 1.0) 0)) - (vector-normalize-copy! s1-0 arg2 (-> (new 'static 'array float 1 1.0) 0)) + (vector-normalize-copy! s2-0 arg1 (the-as float 1.0)) + (vector-normalize-copy! s1-0 arg2 (the-as float 1.0)) (vector-cross! s0-0 s2-0 s1-0) (let* ((f30-0 (vector-length s0-0)) (f28-0 (asin f30-0)) ) - (vector-float*! arg0 arg1 (/ (sin (* (- (-> (new 'static 'array float 1 1.0) 0) arg3) f28-0)) f30-0)) + (vector-float*! arg0 arg1 (/ (sin (* (- 1.0 arg3) f28-0)) f30-0)) (vector+float*! arg0 arg0 arg2 (/ (sin (* arg3 f28-0)) f30-0)) ) ) @@ -470,36 +470,15 @@ (let ((s3-0 (new-stack-vector0)) (gp-0 (new-stack-vector0)) ) - (arg0 - s3-0 - (-> arg1 from) - (-> arg1 to) - (-> (new 'static 'array float 1 0.0) 0) - (-> arg1 axis) - (-> (new 'static 'array float 1 65536.0) 0) - ) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) (the-as float 0.0) (-> arg1 axis) (the-as float 65536.0)) (vector+! s3-0 s3-0 (-> arg1 origin)) (dotimes (s2-0 10) (set! (-> gp-0 quad) (-> s3-0 quad)) - (arg0 - s3-0 - (-> arg1 from) - (-> arg1 to) - (* 0.1 (+ (-> (new 'static 'array float 1 1.0) 0) (the float s2-0))) - (-> arg1 axis) - (-> (new 'static 'array float 1 65536.0) 0) - ) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) (* 0.1 (+ 1.0 (the float s2-0))) (-> arg1 axis) (the-as float 65536.0)) (vector+! s3-0 s3-0 (-> arg1 origin)) (camera-line s3-0 gp-0 (-> arg1 color)) ) - (arg0 - gp-0 - (-> arg1 from) - (-> arg1 to) - (-> *CAM_LAYOUT-bank* debug-t) - (-> arg1 axis) - (-> (new 'static 'array float 1 65536.0) 0) - ) + (arg0 gp-0 (-> arg1 from) (-> arg1 to) (-> *CAM_LAYOUT-bank* debug-t) (-> arg1 axis) (the-as float 65536.0)) (format *stdcon* "~S ~f~%" (-> arg1 disp) (vector-length gp-0)) (vector+! gp-0 gp-0 (-> arg1 origin)) (camera-line (-> arg1 origin) gp-0 (-> arg1 color)) @@ -508,7 +487,7 @@ (new 'static 'vector :z 1024.0) gp-0 (-> arg1 color) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) @@ -517,17 +496,11 @@ (let ((s3-0 (new-stack-vector0)) (gp-0 (new-stack-vector0)) ) - (arg0 s3-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) (-> (new 'static 'array float 1 0.0) 0)) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) (the-as float 0.0)) (vector+! s3-0 s3-0 (-> arg1 origin)) (dotimes (s2-0 10) (set! (-> gp-0 quad) (-> s3-0 quad)) - (arg0 - s3-0 - (-> arg1 from) - (-> arg1 to) - (-> arg1 axis) - (* 182.04445 (* 18.0 (+ (-> (new 'static 'array float 1 1.0) 0) (the float s2-0)))) - ) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) (* 182.04445 (* 18.0 (+ 1.0 (the float s2-0))))) (vector+! s3-0 s3-0 (-> arg1 origin)) (camera-line s3-0 gp-0 (-> arg1 color)) ) @@ -540,7 +513,7 @@ (new 'static 'vector :z 1024.0) gp-0 (-> arg1 color) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) @@ -560,8 +533,8 @@ s5-0 s4-0 (* 0.5 (cam-slave-get-fov arg0)) - (-> (new 'static 'array float 1 0.75) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 0.75) + (the-as float 1.0) (new 'static 'vector4w :z #xff :w #x80) ) ) @@ -575,7 +548,7 @@ (new 'static 'vector :z 1024.0) s5-1 (new 'static 'vector4w :x #x80 :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) @@ -588,7 +561,7 @@ (new 'static 'vector :z 1024.0) s5-2 (new 'static 'vector4w :y #x80 :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) @@ -601,7 +574,7 @@ (new 'static 'vector :z 1024.0) s5-3 (new 'static 'vector4w :x #x80 :z #x80 :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) @@ -615,7 +588,7 @@ ) (cond ((cam-slave-get-vector-with-offset arg0 s4-1 'pivot) - (curve-get-pos! s5-4 (-> (new 'static 'array float 1 0.0) 0) s3-1) + (curve-get-pos! s5-4 (the-as float 0.0) s3-1) (vector-! s4-1 s4-1 s5-4) ) (else @@ -637,11 +610,11 @@ ) ) ) - (curve-get-pos! s5-4 (-> (new 'static 'array float 1 0.0) 0) s3-1) + (curve-get-pos! s5-4 (the-as float 0.0) s3-1) (vector+! s5-4 s5-4 s4-1) (dotimes (s1-1 8) (set! (-> s2-0 quad) (-> s5-4 quad)) - (curve-get-pos! s5-4 (* (-> (new 'static 'array float 1 0.125) 0) (the float (+ s1-1 1))) s3-1) + (curve-get-pos! s5-4 (* 0.125 (the float (+ s1-1 1))) s3-1) (vector+! s5-4 s5-4 s4-1) (camera-line s2-0 s5-4 (new 'static 'vector4w :x #xff :y #xff :w #x80)) ) @@ -652,7 +625,7 @@ (new 'static 'vector :z 1024.0) s5-4 (new 'static 'vector4w :x #xff :y #xff :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) @@ -667,24 +640,24 @@ ) (cond ((cam-slave-get-vector-with-offset arg0 s4-2 'pivot) - (curve-get-pos! s5-5 (-> (new 'static 'array float 1 1.0) 0) s3-2) + (curve-get-pos! s5-5 (the-as float 1.0) s3-2) (vector-! s4-2 s4-2 s5-5) ) ((get-curve-data! arg0 s1-2 'campath 'campath-k (the-as float -1000000000.0)) - (curve-get-pos! s4-2 (-> (new 'static 'array float 1 0.0) 0) s1-2) - (curve-get-pos! s5-5 (-> (new 'static 'array float 1 1.0) 0) s3-2) + (curve-get-pos! s4-2 (the-as float 0.0) s1-2) + (curve-get-pos! s5-5 (the-as float 1.0) s3-2) (vector-! s4-2 s4-2 s5-5) ) ((cam-slave-get-vector-with-offset arg0 s4-2 'trans) - (curve-get-pos! s5-5 (-> (new 'static 'array float 1 1.0) 0) s3-2) + (curve-get-pos! s5-5 (the-as float 1.0) s3-2) (vector-! s4-2 s4-2 s5-5) ) ) - (curve-get-pos! s5-5 (-> (new 'static 'array float 1 0.0) 0) s3-2) + (curve-get-pos! s5-5 (the-as float 0.0) s3-2) (vector+! s5-5 s5-5 s4-2) (dotimes (s1-3 8) (set! (-> s2-1 quad) (-> s5-5 quad)) - (curve-get-pos! s5-5 (* (-> (new 'static 'array float 1 0.125) 0) (the float (+ s1-3 1))) s3-2) + (curve-get-pos! s5-5 (* 0.125 (the float (+ s1-3 1))) s3-2) (vector+! s5-5 s5-5 s4-2) (camera-line s2-1 s5-5 (new 'static 'vector4w :z #xff :w #x80)) ) @@ -695,20 +668,20 @@ (new 'static 'vector :z 1024.0) s5-5 (new 'static 'vector4w :z #xff :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) - (curve-get-pos! s5-5 (cam-slave-get-float arg0 'intro-exitValue (-> (new 'static 'array float 1 0.0) 0)) s3-2) + (curve-get-pos! s5-5 (cam-slave-get-float arg0 'intro-exitValue (the-as float 0.0)) s3-2) (vector+! s5-5 s5-5 s4-2) (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-5 (new 'static 'vector4w :z #xff :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) - (let ((s2-3 (res-lump-data arg0 'campoints pointer :time (-> (new 'static 'array float 1 1.0) 0))) + (let ((s2-3 (res-lump-data arg0 'campoints pointer :time (the-as float 1.0))) (v1-95 (res-lump-struct arg0 'campoints-offset structure :time (the-as float -1000000000.0))) (s4-3 (new 'stack-no-clear 'vector)) (s3-3 (new 'stack-no-clear 'vector)) @@ -732,11 +705,11 @@ (new 'static 'vector :z 1024.0) s5-6 (new 'static 'vector4w :x #xff :y #xff :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) - (let ((s4-4 (res-lump-data arg0 'focalpull pointer :time (-> (new 'static 'array float 1 1.0) 0))) + (let ((s4-4 (res-lump-data arg0 'focalpull pointer :time (the-as float 1.0))) (s5-7 (new 'static 'vector)) ) (when (and s4-4 (or (!= *camera-layout-blink* 'focalpull) (logtest? (-> *display* real-actual-frame-counter) 8))) @@ -756,7 +729,7 @@ (new 'static 'vector :z 1024.0) s5-7 (new 'static 'vector4w :y #xff :z #xff :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) @@ -772,12 +745,12 @@ (vector-! (-> s5-8 from) (-> s5-8 from) (-> s5-8 origin)) (vector-! (-> s5-8 to) (-> s5-8 to) (-> s5-8 origin)) (vector-cross! s4-5 (-> s5-8 from) (-> s5-8 to)) - (vector-normalize! s4-5 (-> (new 'static 'array float 1 8192.0) 0)) + (vector-normalize! s4-5 (the-as float 8192.0)) (vector+! s4-5 s4-5 (-> s5-8 origin)) (camera-line (-> s5-8 origin) s4-5 (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80)) (when (not (paused?)) (+! (-> *CAM_LAYOUT-bank* debug-t) (-> *CAM_LAYOUT-bank* debug-step)) - (if (< (-> (new 'static 'array float 1 1.0) 0) (-> *CAM_LAYOUT-bank* debug-t)) + (if (< 1.0 (-> *CAM_LAYOUT-bank* debug-t)) (set! (-> *CAM_LAYOUT-bank* debug-t) 0.0) ) ) @@ -833,10 +806,10 @@ ((cpad-hold? arg2 l3) (set! (-> arg0 z) (- (-> arg0 z) (analog-input (the-as int (-> *cpad-list* cpads arg2 rightx)) - (-> (new 'static 'array float 1 128.0) 0) - (-> (new 'static 'array float 1 48.0) 0) - (-> (new 'static 'array float 1 110.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 128.0) + (the-as float 48.0) + (the-as float 110.0) + (the-as float 1.0) ) ) ) @@ -844,27 +817,27 @@ (else (set! (-> arg0 y) (- (-> arg0 y) (analog-input (the-as int (-> *cpad-list* cpads arg2 rightx)) - (-> (new 'static 'array float 1 128.0) 0) - (-> (new 'static 'array float 1 48.0) 0) - (-> (new 'static 'array float 1 110.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 128.0) + (the-as float 48.0) + (the-as float 110.0) + (the-as float 1.0) ) ) ) (+! (-> arg0 x) (analog-input (the-as int (-> *cpad-list* cpads arg2 righty)) - (-> (new 'static 'array float 1 128.0) 0) - (-> (new 'static 'array float 1 48.0) 0) - (-> (new 'static 'array float 1 110.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 128.0) + (the-as float 48.0) + (the-as float 110.0) + (the-as float 1.0) ) ) (set! (-> arg1 x) (- (-> arg1 x) (analog-input (the-as int (-> *cpad-list* cpads arg2 leftx)) - (-> (new 'static 'array float 1 128.0) 0) - (-> (new 'static 'array float 1 48.0) 0) - (-> (new 'static 'array float 1 110.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 128.0) + (the-as float 48.0) + (the-as float 110.0) + (the-as float 1.0) ) ) ) @@ -873,9 +846,9 @@ (set! (-> arg1 y) (+ 0.5 (analog-input (the-as int (-> *cpad-list* cpads arg2 abutton 9)) - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 32.0) 0) - (-> (new 'static 'array float 1 230.0) 0) + (the-as float 0.0) + (the-as float 32.0) + (the-as float 230.0) (the-as float 0.5) ) (-> arg1 y) @@ -887,9 +860,9 @@ (if (cpad-hold? arg2 l1) (set! (-> arg1 y) (- (-> arg1 y) (+ 0.5 (analog-input (the-as int (-> *cpad-list* cpads arg2 abutton 8)) - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 32.0) 0) - (-> (new 'static 'array float 1 230.0) 0) + (the-as float 0.0) + (the-as float 32.0) + (the-as float 230.0) (the-as float 0.5) ) ) @@ -899,10 +872,10 @@ ) (set! (-> arg1 z) (- (-> arg1 z) (analog-input (the-as int (-> *cpad-list* cpads arg2 lefty)) - (-> (new 'static 'array float 1 128.0) 0) - (-> (new 'static 'array float 1 48.0) 0) - (-> (new 'static 'array float 1 110.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 128.0) + (the-as float 48.0) + (the-as float 110.0) + (the-as float 1.0) ) ) ) @@ -1162,10 +1135,11 @@ ) (defun fov->maya ((arg0 float)) - (if (= arg0 0.0) - (-> (new 'static 'array float 1 0.0) 0) - (/ 12.700255 (tan (* 0.5 arg0))) - ) + (the-as float (if (= arg0 0.0) + 0.0 + (/ 12.700255 (tan (* 0.5 arg0))) + ) + ) ) (defun cam-layout-save-cam-rot ((arg0 symbol) (arg1 string) (arg2 entity-actor)) @@ -1390,7 +1364,7 @@ 'fov 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1404,7 +1378,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1441,7 +1415,7 @@ 'focalPull 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1455,7 +1429,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1651,7 +1625,7 @@ 'intro-time 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1665,7 +1639,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1676,7 +1650,7 @@ (if arg0 (format #t "setup intro-time 0.0 (defaults to 1 sec)~%") ) - (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) + (set! f30-0 1.0) ) (arg0 (format #t "setup intro-time ~f~%" f30-0) @@ -1702,7 +1676,7 @@ 'intro-exitValue 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1716,7 +1690,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1748,7 +1722,7 @@ 'interpTime 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1762,7 +1736,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1826,7 +1800,7 @@ 'spline-follow-dist-offset 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1867,7 +1841,7 @@ 'tiltAdjust 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1881,7 +1855,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1910,7 +1884,7 @@ 'stringMinLength 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1924,7 +1898,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1953,7 +1927,7 @@ 'stringMaxLength 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1967,7 +1941,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1996,7 +1970,7 @@ 'stringMinHeight 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2010,7 +1984,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2039,7 +2013,7 @@ 'stringMaxHeight 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2053,7 +2027,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2082,7 +2056,7 @@ 'stringCliffHeight 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2096,7 +2070,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2125,7 +2099,7 @@ 'maxAngle 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2138,7 +2112,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2474,7 +2448,7 @@ arg0 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2482,15 +2456,15 @@ (f0-0 (-> arg1 0)) ) (if (= f0-0 0.0) - (set! f0-0 (-> (new 'static 'array float 1 1.0) 0)) + (set! f0-0 1.0) ) (let ((f0-2 (+ f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) - (-> (new 'static 'array float 1 128.0) 0) - (-> (new 'static 'array float 1 48.0) 0) - (-> (new 'static 'array float 1 110.0) 0) + (the-as float 128.0) + (the-as float 48.0) + (the-as float 110.0) f0-0 ) ) @@ -2508,7 +2482,7 @@ ) (defbehavior clmf-cam-meters cam-layout ((arg0 meters) (arg1 symbol)) - (let ((f0-0 (cam-slave-get-float (-> self cam-entity) arg1 (-> (new 'static 'array float 1 0.0) 0)))) + (let ((f0-0 (cam-slave-get-float (-> self cam-entity) arg1 (the-as float 0.0)))) (format arg0 ": ~M" f0-0) ) #t @@ -2520,7 +2494,7 @@ ) (defbehavior clmf-cam-deg cam-layout ((arg0 degrees) (arg1 symbol)) - (format arg0 ": ~R" (cam-slave-get-float (-> self cam-entity) arg1 (-> (new 'static 'array float 1 0.0) 0))) + (format arg0 ": ~R" (cam-slave-get-float (-> self cam-entity) arg1 (the-as float 0.0))) #t ) @@ -2538,7 +2512,7 @@ ) (defbehavior clmf-cam-float cam-layout ((arg0 float) (arg1 symbol)) - (format arg0 ": ~f" (cam-slave-get-float (-> self cam-entity) arg1 (-> (new 'static 'array float 1 0.0) 0))) + (format arg0 ": ~f" (cam-slave-get-float (-> self cam-entity) arg1 (the-as float 0.0))) #t ) @@ -2557,45 +2531,30 @@ #t ) -(define - *clm-focalpull-attr* +(define *clm-focalpull-attr* (new 'static 'clm :title "---focalpull attributes--" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " ok" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) ) (new 'static 'clm-item :description "adjust" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :func #f) + :action (new 'static 'clm-item-action :button #x4000 :func #f) ) (new 'static 'clm-list :tracker #f - :items - (new - 'static - 'boxed-array - :type clm-list-item :length 2 :allocated-length 2 + :items (new 'static 'boxed-array :type clm-list-item (new 'static 'clm-list-item :description "radial " :track-val #f :val-func 'clmf-cam-flag :val-parm0 16 :val-parm1-basic 'focalpull-flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -2611,15 +2570,14 @@ :val-func 'clmf-cam-flag :val-parm0 8 :val-parm1-basic 'focalpull-flags - :actions - (new 'static 'boxed-array :type clm-item-action :length 1 :allocated-length 1 (new 'static 'clm-item-action - :button #x4000 - :options #x1 - :func 'clmf-cam-flag-toggle - :parm0 8 - :parm1-basic 'focalpull-flags - ) - ) + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 8 + :parm1-basic 'focalpull-flags + ) + ) ) ) ) @@ -2627,45 +2585,30 @@ ) ) -(define - *clm-index-attr* +(define *clm-index-attr* (new 'static 'clm :title "---index attributes--" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " ok" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) ) (new 'static 'clm-item :description "adjust" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :func #f) + :action (new 'static 'clm-item-action :button #x4000 :func #f) ) (new 'static 'clm-list :tracker #f - :items - (new - 'static - 'boxed-array - :type clm-list-item :length 2 :allocated-length 2 + :items (new 'static 'boxed-array :type clm-list-item (new 'static 'clm-list-item :description "radial " :track-val #f :val-func 'clmf-cam-flag :val-parm0 16 :val-parm1-basic 'campoints-flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -2681,15 +2624,14 @@ :val-func 'clmf-cam-flag :val-parm0 8 :val-parm1-basic 'campoints-flags - :actions - (new 'static 'boxed-array :type clm-item-action :length 1 :allocated-length 1 (new 'static 'clm-item-action - :button #x4000 - :options #x1 - :func 'clmf-cam-flag-toggle - :parm0 8 - :parm1-basic 'campoints-flags - ) - ) + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 8 + :parm1-basic 'campoints-flags + ) + ) ) ) ) @@ -2697,165 +2639,123 @@ ) ) -(define - *clm-intro-attr* +(define *clm-intro-attr* (new 'static 'clm :title "---intro attributes--" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " ok" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) ) (new 'static 'clm-item :description "adjust" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :func #f) - ) - (new 'static 'clm-list :tracker #f :items (new - 'static - 'boxed-array - :type clm-list-item :length 2 :allocated-length 2 - (new 'static 'clm-list-item - :description "time " - :track-val #f - :val-func 'clmf-cam-intro-time - :val-parm0-basic 'intro-time - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 - (new 'static 'clm-item-action - :button #x4000 - :func 'clmf-cam-float-adjust - :parm0-basic 'intro-time-offset - :parm1-basic (new 'static 'bfloat :data 0.01) - ) - ) - ) - (new 'static 'clm-list-item - :description "exitValue" - :track-val #f - :val-func 'clmf-cam-float - :val-parm0-basic 'intro-exitValue - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 - (new 'static 'clm-item-action - :button #x4000 - :func 'clmf-cam-float-adjust - :parm0-basic 'intro-exitValue-offset - :parm1-basic (new 'static 'bfloat :data 0.001) - ) - ) - ) - ) - ) - ) - ) - ) - -(define - *clm-spline-attr* - (new 'static 'clm - :title "---spline attributes--" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 - (new 'static 'clm-item - :description " ok" - :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) - ) - (new 'static 'clm-item - :description "adjust" - :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :func #f) - ) - (new 'static 'clm-list :tracker #f :items (new - 'static - 'boxed-array - :type clm-list-item :length 1 :allocated-length 1 - (new 'static 'clm-list-item - :description "followDist" - :track-val #f - :val-func 'clmf-cam-meters - :val-parm0-basic 'spline-follow-dist - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 - (new 'static 'clm-item-action - :button #x4000 - :func 'clmf-cam-float-adjust - :parm0-basic 'spline-follow-dist-offset - :parm1-basic (new 'static 'bfloat :data 409.6) - ) - ) - ) - ) - ) - ) - ) - ) - -(define - *clm-vol-attr* - (new 'static 'clm - :title "---volume attributes--" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 - (new 'static 'clm-item - :description " ok" - :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) - ) - (new 'static 'clm-item - :description "adjust" - :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :func #f) + :action (new 'static 'clm-item-action :button #x4000 :func #f) ) (new 'static 'clm-list :tracker #f - :items - (new - 'static - 'boxed-array - :type clm-list-item :length 1 :allocated-length 1 + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "time " + :track-val #f + :val-func 'clmf-cam-intro-time + :val-parm0-basic 'intro-time + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-basic 'intro-time-offset + :parm1-basic (new 'static 'bfloat :data 0.01) + ) + ) + ) + (new 'static 'clm-list-item + :description "exitValue" + :track-val #f + :val-func 'clmf-cam-float + :val-parm0-basic 'intro-exitValue + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-basic 'intro-exitValue-offset + :parm1-basic (new 'static 'bfloat :data 0.001) + ) + ) + ) + ) + ) + ) + ) + ) + +(define *clm-spline-attr* + (new 'static 'clm + :title "---spline attributes--" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + ) + (new 'static 'clm-item + :description "adjust" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "followDist" + :track-val #f + :val-func 'clmf-cam-meters + :val-parm0-basic 'spline-follow-dist + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-basic 'spline-follow-dist-offset + :parm1-basic (new 'static 'bfloat :data 409.6) + ) + ) + ) + ) + ) + ) + ) + ) + +(define *clm-vol-attr* + (new 'static 'clm + :title "---volume attributes--" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + ) + (new 'static 'clm-item + :description "adjust" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item (new 'static 'clm-list-item :description "airSwitch" :track-val #f :val-func 'clmf-cam-flag :val-parm0 8 :val-parm1-basic 'vol-flags - :actions - (new 'static 'boxed-array :type clm-item-action :length 1 :allocated-length 1 (new 'static 'clm-item-action - :button #x4000 - :options #x1 - :func 'clmf-cam-flag-toggle - :parm0 8 - :parm1-basic 'vol-flags - ) - ) + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 8 + :parm1-basic 'vol-flags + ) + ) ) ) ) @@ -2863,45 +2763,30 @@ ) ) -(define - *clm-cam-attr* +(define *clm-cam-attr* (new 'static 'clm :title "---camera attributes--" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " ok" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) ) (new 'static 'clm-item :description "adjust" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :func #f) + :action (new 'static 'clm-item-action :button #x4000 :func #f) ) (new 'static 'clm-list :tracker #f - :items - (new - 'static - 'boxed-array - :type clm-list-item :length 18 :allocated-length 18 + :items (new 'static 'boxed-array :type clm-list-item (new 'static 'clm-list-item :description "drag " :track-val #f :val-func 'clmf-cam-flag :val-parm0 #x400 :val-parm1-basic 'flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -2916,11 +2801,7 @@ :track-val #f :val-func 'clmf-cam-fov :val-parm0-basic 'fov - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -2934,11 +2815,7 @@ :track-val #f :val-func 'clmf-cam-deg :val-parm0-basic 'focalPull - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -2952,11 +2829,7 @@ :track-val #f :val-func 'clmf-cam-interp-time :val-parm0-basic 'interpTime - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -2971,11 +2844,7 @@ :val-func 'clmf-cam-flag :val-parm0 16 :val-parm1-basic 'flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -2991,11 +2860,7 @@ :val-func 'clmf-cam-flag :val-parm0 32 :val-parm1-basic 'flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -3010,11 +2875,7 @@ :track-val #f :val-func 'clmf-cam-meters :val-parm0-basic 'stringMinLength - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3028,11 +2889,7 @@ :track-val #f :val-func 'clmf-cam-meters :val-parm0-basic 'stringMaxLength - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3046,11 +2903,7 @@ :track-val #f :val-func 'clmf-cam-meters :val-parm0-basic 'stringMinHeight - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3064,11 +2917,7 @@ :track-val #f :val-func 'clmf-cam-meters :val-parm0-basic 'stringMaxHeight - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3082,11 +2931,7 @@ :track-val #f :val-func 'clmf-cam-meters :val-parm0-basic 'stringCliffHeight - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3100,19 +2945,14 @@ :track-val #f :val-func 'clmf-cam-string :val-parm0-basic 'alternates - :actions - (new 'static 'boxed-array :type clm-item-action :length 0 :allocated-length 0) + :actions (new 'static 'boxed-array :type clm-item-action) ) (new 'static 'clm-list-item :description "maxAngle " :track-val #f :val-func 'clmf-cam-deg :val-parm0-basic 'maxAngle - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3127,11 +2967,7 @@ :val-func 'clmf-cam-flag :val-parm0 #x4000 :val-parm1-basic 'flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -3147,11 +2983,7 @@ :val-func 'clmf-cam-flag :val-parm0 #x40000 :val-parm1-basic 'flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -3166,11 +2998,7 @@ :track-val #f :val-func 'clmf-cam-deg :val-parm0-basic 'tiltAdjust - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3185,11 +3013,7 @@ :val-func 'clmf-cam-flag :val-parm0 #x80000 :val-parm1-basic 'flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -3205,15 +3029,14 @@ :val-func 'clmf-cam-flag :val-parm0 #x100000 :val-parm1-basic 'flags - :actions - (new 'static 'boxed-array :type clm-item-action :length 1 :allocated-length 1 (new 'static 'clm-item-action - :button #x4000 - :options #x1 - :func 'clmf-cam-flag-toggle - :parm0 #x100000 - :parm1-basic 'flags - ) - ) + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x100000 + :parm1-basic 'flags + ) + ) ) ) ) @@ -3221,32 +3044,24 @@ ) ) -(define - *clm-cam-lookthrough* +(define *clm-cam-lookthrough* (new 'static 'clm :title "---cam-lookthrough---" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 5 :allocated-length 5 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " " :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :options #x4 :func 'clmf-look-through) + :action (new 'static 'clm-item-action :button #x4000 :options #x4 :func 'clmf-look-through) ) (new 'static 'clm-item :description " ok" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-to-edit) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-to-edit) ) (new 'static 'clm-item :description "pos/rot" :button-symbol 'x - :action - (new 'static 'clm-item-action + :action (new 'static 'clm-item-action :button #x4000 :options #x8 :func 'clmf-pos-rot @@ -3257,92 +3072,67 @@ (new 'static 'clm-item :description " adjust" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :func #f) + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "fov" + :track-val #f + :val-func 'clmf-cam-fov + :val-parm0-basic 'fov + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-basic 'fov-offset + :parm1-basic (new 'static 'bfloat :data 91.022224) + ) + ) + ) + ) ) - (new 'static 'clm-list :tracker #f :items (new - 'static - 'boxed-array - :type clm-list-item :length 1 :allocated-length 1 - (new 'static 'clm-list-item - :description "fov" - :track-val #f - :val-func 'clmf-cam-fov - :val-parm0-basic 'fov - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 - (new 'static 'clm-item-action - :button #x4000 - :func 'clmf-cam-float-adjust - :parm0-basic 'fov-offset - :parm1-basic (new 'static 'bfloat :data 91.022224) - ) - ) - ) - ) - ) ) ) ) -(define - *clm-edit* +(define *clm-edit* (new 'static 'clm :title "---edit---" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 6 :allocated-length 6 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " ok" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-to-select) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-to-select) ) (new 'static 'clm-item :description "attributes" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :options #x1 :func #f) + :action (new 'static 'clm-item-action :button #x4000 :options #x1 :func #f) ) (new 'static 'clm-item :description " edit part" :button-symbol 'circle - :action - (new 'static 'clm-item-action :button #x2000 :options #x1 :func #f) + :action (new 'static 'clm-item-action :button #x2000 :options #x1 :func #f) ) (new 'static 'clm-item :description "scale/next" :button-symbol 'r2 - :action - (new 'static 'clm-item-action :button #x200 :func #f) + :action (new 'static 'clm-item-action :button #x200 :func #f) ) (new 'static 'clm-item :description " pos/rot" :button-symbol 'l2 - :action - (new 'static 'clm-item-action :button #x100 :func #f) + :action (new 'static 'clm-item-action :button #x100 :func #f) ) (new 'static 'clm-list :tracker '*camera-layout-blink* - :items - (new - 'static - 'boxed-array - :type clm-list-item :length 9 :allocated-length 9 + :items (new 'static 'boxed-array :type clm-list-item (new 'static 'clm-list-item :description "camera " :track-val 'camera :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 :func '*clm-cam-attr*) (new 'static 'clm-item-action :button #x2000 :func '*clm-cam-lookthrough*) (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) @@ -3358,11 +3148,7 @@ :description "volume " :track-val 'volume :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-vol-attr) (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) (new 'static 'clm-item-action :button #x200 :func 'clmf-next-vol-dpad) @@ -3373,11 +3159,7 @@ :description "align " :track-val 'align :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-bna) (new 'static 'clm-item-action :button #x2000 :func 'clmf-bna) (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) @@ -3388,11 +3170,7 @@ :description "pivot " :track-val 'pivot :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-bna) (new 'static 'clm-item-action :button #x2000 :func 'clmf-bna) (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) @@ -3403,11 +3181,7 @@ :description "interesting" :track-val 'interesting :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-bna) (new 'static 'clm-item-action :button #x2000 :func 'clmf-bna) (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) @@ -3423,11 +3197,7 @@ :description "spline " :track-val 'spline :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-to-spline-attr) (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) @@ -3438,11 +3208,7 @@ :description "intro " :track-val 'intro :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-intro-attr) (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) @@ -3453,11 +3219,7 @@ :description "index " :track-val 'index :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-index-attr) (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) @@ -3468,11 +3230,7 @@ :description "focalpull" :track-val 'focalpull :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-focalpull-attr) (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) @@ -3485,112 +3243,85 @@ ) ) -(define - *clm-save-all* +(define *clm-save-all* (new 'static 'clm :title "---save all?---" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " save all" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-save-all :parm0 16) + :action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-save-all :parm0 16) ) (new 'static 'clm-item :description "print all" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-save-all :parm0 8) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-save-all :parm0 8) ) (new 'static 'clm-item :description " done" :button-symbol 'triangle - :action - (new 'static 'clm-item-action :button #x1000 :options #x1 :func 'clmf-to-select) + :action (new 'static 'clm-item-action :button #x1000 :options #x1 :func 'clmf-to-select) ) ) ) ) -(define - *clm-save-one* +(define *clm-save-one* (new 'static 'clm :title "---single save?---" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " single save" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-save-one :parm0 16) + :action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-save-one :parm0 16) ) (new 'static 'clm-item :description "single print" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-save-one :parm0 8) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-save-one :parm0 8) ) (new 'static 'clm-item :description " done" :button-symbol 'triangle - :action - (new 'static 'clm-item-action :button #x1000 :options #x1 :func 'clmf-to-select) + :action (new 'static 'clm-item-action :button #x1000 :options #x1 :func 'clmf-to-select) ) ) ) ) -(define - *clm-select* +(define *clm-select* (new 'static 'clm :title "---camera---" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 6 :allocated-length 6 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " edit" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :options #x3 :func 'clmf-to-edit-cam) + :action (new 'static 'clm-item-action :button #x4000 :options #x3 :func 'clmf-to-edit-cam) ) (new 'static 'clm-item :description "save one" :button-symbol 'triangle - :action - (new 'static 'clm-item-action :button #x1000 :options #x3 :func '*clm-save-one*) + :action (new 'static 'clm-item-action :button #x1000 :options #x3 :func '*clm-save-one*) ) (new 'static 'clm-item :description " next" :button-symbol 'down - :action - (new 'static 'clm-item-action :button #x40 :options #x3 :func 'clmf-next-entity :parm0 8) + :action (new 'static 'clm-item-action :button #x40 :options #x3 :func 'clmf-next-entity :parm0 8) ) (new 'static 'clm-item :description " prev" :button-symbol 'up - :action - (new 'static 'clm-item-action :button #x10 :options #x3 :func 'clmf-next-entity :parm0 -8) + :action (new 'static 'clm-item-action :button #x10 :options #x3 :func 'clmf-next-entity :parm0 -8) ) (new 'static 'clm-item :description " next 5" :button-symbol 'right - :action - (new 'static 'clm-item-action :button #x20 :options #x3 :func 'clmf-next-entity :parm0 40) + :action (new 'static 'clm-item-action :button #x20 :options #x3 :func 'clmf-next-entity :parm0 40) ) (new 'static 'clm-item :description " prev 5" :button-symbol 'left - :action - (new 'static 'clm-item-action :button #x80 :options #x3 :func 'clmf-next-entity :parm0 -40) + :action (new 'static 'clm-item-action :button #x80 :options #x3 :func 'clmf-next-entity :parm0 -40) ) ) ) @@ -3796,9 +3527,8 @@ ) (defstate cam-layout-active (cam-layout) - :code - (behavior () - (while #t + :code (behavior () + (loop (cam-layout-entity-info (the-as entity-actor (-> self cam-entity))) (cam-layout-entity-volume-info) (cam-layout-do-menu *clm*) @@ -3841,16 +3571,7 @@ ) (cond ((not *cam-layout*) - (let* ((gp-0 (get-process *camera-dead-pool* cam-layout #x4000)) - (v1-4 (when gp-0 - (let ((t9-3 (method-of-type cam-layout activate))) - (t9-3 (the-as cam-layout gp-0) *default-pool* 'cam-layout (the-as pointer #x70004000)) - ) - (run-next-time-in-process gp-0 cam-layout-init) - (-> gp-0 ppointer) - ) - ) - ) + (let ((v1-4 (process-spawn-function cam-layout cam-layout-init :from *camera-dead-pool*))) (cond (v1-4 (logclear! (-> v1-4 0 mask) (process-mask pause menu)) diff --git a/goal_src/engine/camera/cam-master.gc b/goal_src/engine/camera/cam-master.gc index 62f671a792..0375e5bdab 100644 --- a/goal_src/engine/camera/cam-master.gc +++ b/goal_src/engine/camera/cam-master.gc @@ -65,10 +65,11 @@ (set! (-> self foot-offset) (-> *CAMERA_MASTER-bank* onscreen-foot-height)) (set! (-> self head-offset) (-> *CAMERA_MASTER-bank* onscreen-head-height)) (set! (-> self target-height) (-> *CAMERA_MASTER-bank* target-height)) - (set! (-> self on-ground) (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) + (set! (-> self on-ground) + (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + ) + ) ) (set! (-> self on-pole) #f) (set! (-> self ease-t) 1.0) @@ -99,7 +100,9 @@ ) ) (cond - ((and (logtest? (-> *target* water flags) 4096) (zero? (logand (-> *target* water flags) 16))) + ((and (logtest? (-> *target* water flags) (water-flags wt12)) + (zero? (logand (-> *target* water flags) (water-flags wt04))) + ) (set! (-> self under-water) 2) ) (else @@ -322,7 +325,9 @@ ) ) (cond - ((and (logtest? (-> *target* water flags) 4096) (zero? (logand (-> *target* water flags) 16))) + ((and (logtest? (-> *target* water flags) (water-flags wt12)) + (zero? (logand (-> *target* water flags) (water-flags wt04))) + ) (set! (-> self under-water) 2) ) ((> (-> self under-water) 0) @@ -372,17 +377,18 @@ (vector--float*! s5-2 (-> self tpos-curr) (-> self local-down) (-> self target-height)) (vector-float*! gp-5 (-> self tgt-rot-mat vector 2) 4915.2) (vector-! s5-2 s5-2 gp-5) - (let ((f0-20 (fill-and-probe-using-line-sphere - *collide-cache* - s5-2 - gp-5 - 4300.8 - (collide-kind background) - (the-as process #f) - s4-2 - 4098 - ) - ) + (let ((f0-20 + (fill-and-probe-using-line-sphere + *collide-cache* + s5-2 + gp-5 + 4300.8 + (collide-kind background) + (the-as process #f) + s4-2 + (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1) + ) + ) ) (if (and (< 0.0 f0-20) (< f0-20 1.0)) (vector+float*! (-> self tpos-curr) (-> self tpos-curr) gp-5 (+ -1.0 f0-20)) @@ -390,16 +396,17 @@ ) ) ) - (set! (-> self on-ground) (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) + (set! (-> self on-ground) + (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + ) + ) ) (let ((gp-6 (new-stack-vector0))) 0.0 (cond - ((and (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + ((and (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) (!= (-> *target* control unknown-surface00 name) 'launch-jump) ) @@ -445,7 +452,7 @@ (vector-! gp-6 (-> self tpos-curr) (-> self tpos-old)) (let ((f0-38 (vector-dot gp-6 (-> self local-down)))) (cond - ((logtest? (-> *target* water flags) 512) + ((logtest? (-> *target* water flags) (water-flags wt09)) (set! (-> self upspeed) 0.0) ) ((< 0.0 f0-38) @@ -474,7 +481,7 @@ (reset-follow) ) (let ((v1-196 (-> *target* water flags))) - (when (and (logtest? v1-196 512) (logtest? v1-196 6144)) + (when (and (logtest? v1-196 (water-flags wt09)) (logtest? v1-196 (water-flags wt11 wt12))) (let ((f0-45 (- (-> *target* water base-height) (-> self target-height)))) (if (< (-> self tpos-curr-adj y) f0-45) (set! (-> self tpos-curr-adj y) f0-45) @@ -519,7 +526,7 @@ (defun in-cam-entity-volume? ((arg0 vector) (arg1 entity) (arg2 float) (arg3 symbol)) (local-vars (sv-16 res-tag)) (let ((s2-0 0)) - (while #t + (loop (set! sv-16 (new 'static 'res-tag)) (let ((v1-1 (the-as object ((method-of-type res-lump get-property-data) arg1 @@ -568,15 +575,9 @@ (set! (-> self stringCliffHeight) 163840.0) (send-event *camera* 'point-of-interest #f) (set! (-> *camera-combiner* tracking point-of-interest-blend target) 0.0) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'query-state) - (set! (-> a1-1 param 0) (the-as uint *camera-base-mode*)) - (if (not (send-event-function *camera* a1-1)) - (send-event *camera* 'change-state *camera-base-mode* 450) - ) - ) + (if (not (send-event *camera* 'query-state *camera-base-mode*)) + (send-event *camera* 'change-state *camera-base-mode* (seconds 1.5)) + ) (set! (-> *camera-combiner* tracking tilt-adjust target) (-> *CAMERA-bank* default-tilt-adjust)) (send-event *camera* 'clear-slave-option #x10000) ) @@ -605,15 +606,9 @@ (set! (-> self stringMaxLength) (-> *CAMERA-bank* default-string-max-z)) ) (set! (-> self stringCliffHeight) (cam-slave-get-float arg0 'stringCliffHeight 163840.0)) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 1) - (set! (-> a1-7 message) 'query-state) - (set! (-> a1-7 param 0) (the-as uint *camera-base-mode*)) - (if (not (send-event-function *camera* a1-7)) - (send-event *camera* 'change-state *camera-base-mode* 450) - ) - ) + (if (not (send-event *camera* 'query-state *camera-base-mode*)) + (send-event *camera* 'change-state *camera-base-mode* (seconds 1.5)) + ) (if (logtest? #x10000 (cam-slave-get-flags (-> self cam-entity) 'flags)) (send-event *camera* 'set-slave-option #x10000) ) @@ -774,83 +769,76 @@ ) (defbehavior master-check-regions camera-master () - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'query-state) - (set! (-> a1-0 param 0) (the-as uint cam-eye)) - (cond - ((send-event-function *camera* a1-0) - #f - ) - ((or (not *target*) (logtest? (-> self master-options) 1)) - (master-unset-region) - ) - ((and (logtest? (-> self master-options) 4) - (not (-> self on-ground)) - (or (not (-> self cam-entity)) (zero? (logand #x20000 (cam-slave-get-flags (-> self cam-entity) 'flags)))) - ) - #f - ) - ((and (-> self cam-entity) - (not (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 0.0 'cutoutvol)) - (or (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 1024.0 'pvol) - (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 1024.0 'vol) - (and (not ((method-of-type res-lump get-property-data) - (-> self cam-entity) - 'pvol - 'exact - 0.0 - (the-as pointer #f) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - (not ((method-of-type res-lump get-property-data) - (-> self cam-entity) - 'vol - 'exact - 0.0 - (the-as pointer #f) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - ) - ) - ) - #f - ) - (else - (let ((v1-17 (-> *camera-engine* alive-list next0))) - *camera-engine* - (let ((gp-5 (-> v1-17 next0))) - (while (!= v1-17 (-> *camera-engine* alive-list-end)) - (let ((s5-1 (-> (the-as connection v1-17) param1))) - (when (and (not (in-cam-entity-volume? (target-pos 0) (the-as entity s5-1) 1024.0 'cutoutvol)) - (in-cam-entity-volume? (target-pos 0) (the-as entity s5-1) 0.0 'vol) - ) - (if (master-switch-to-entity (the-as entity s5-1)) - (return #t) - ) - ) - ) - (set! v1-17 gp-5) - *camera-engine* - (set! gp-5 (-> gp-5 next0)) + (cond + ((send-event *camera* 'query-state cam-eye) + #f + ) + ((or (not *target*) (logtest? (-> self master-options) 1)) + (master-unset-region) + ) + ((and (logtest? (-> self master-options) 4) + (not (-> self on-ground)) + (or (not (-> self cam-entity)) (zero? (logand #x20000 (cam-slave-get-flags (-> self cam-entity) 'flags)))) + ) + #f + ) + ((and (-> self cam-entity) + (not (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 0.0 'cutoutvol)) + (or (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 1024.0 'pvol) + (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 1024.0 'vol) + (and (not ((method-of-type res-lump get-property-data) + (-> self cam-entity) + 'pvol + 'exact + 0.0 + (the-as pointer #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + (not ((method-of-type res-lump get-property-data) + (-> self cam-entity) + 'vol + 'exact + 0.0 + (the-as pointer #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) ) + ) + #f + ) + (else + (let ((v1-17 (-> *camera-engine* alive-list next0))) + *camera-engine* + (let ((gp-5 (-> v1-17 next0))) + (while (!= v1-17 (-> *camera-engine* alive-list-end)) + (let ((s5-1 (-> (the-as connection v1-17) param1))) + (when (and (not (in-cam-entity-volume? (target-pos 0) (the-as entity s5-1) 1024.0 'cutoutvol)) + (in-cam-entity-volume? (target-pos 0) (the-as entity s5-1) 0.0 'vol) + ) + (if (master-switch-to-entity (the-as entity s5-1)) + (return #t) + ) + ) + ) + (set! v1-17 gp-5) + *camera-engine* + (set! gp-5 (-> gp-5 next0)) ) ) - (master-unset-region) ) + (master-unset-region) ) ) ) (defstate cam-master-active (camera-master) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (local-vars (v0-0 object));; todo + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((v1-0 arg2)) @@ -1460,12 +1448,12 @@ ) ) ((= v1-0 'toggle-slave-option) - (set! (-> self slave-options) (logxor (-> self slave-options) (-> arg3 param 0))) + (logxor! (-> self slave-options) (-> arg3 param 0)) (let ((a0-193 (-> self slave 0)) (v1-360 (-> self slave 1)) ) (if a0-193 - (set! (-> a0-193 0 options) (logxor (-> a0-193 0 options) (-> arg3 param 0))) + (logxor! (-> a0-193 0 options) (-> arg3 param 0)) ) (set! v0-0 (the-as object (when v1-360 (set! v0-0 (logxor (-> v1-360 0 options) (-> arg3 param 0))) @@ -1594,15 +1582,13 @@ (the-as object v0-0) ) ) - :enter - (behavior () + :enter (behavior () (if (and (nonzero? camera-master-debug) *debug-segment*) (add-connection *debug-engine* self camera-master-debug self #f #f) ) (none) ) - :trans - (behavior () + :trans (behavior () (when (not (paused?)) (vector-negate! (-> self local-down) @@ -1612,9 +1598,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (and *dproc* *debug-segment*) (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) @@ -1630,15 +1615,9 @@ (master-track-target) (set! (-> last-try-to-look-at-data horz) 0.0) (set! (-> last-try-to-look-at-data vert) 0.0) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'slave-option?) - (set! (-> a1-1 param 0) (the-as uint #x4000)) - (when (send-event-function *camera* a1-1) - (set! (-> self string-min target y) 18432.0) - (set! (-> self string-max target y) 18432.041) - ) + (when (send-event *camera* 'slave-option? #x4000) + (set! (-> self string-min target y) 18432.0) + (set! (-> self string-max target y) 18432.041) ) (when (not (paused?)) (update! (-> self string-min) (the-as vector #f)) @@ -1677,9 +1656,8 @@ (defstate list-keeper-active (camera-master) - :code - (behavior () - (while #t + :code (behavior () + (loop (change-to-last-brother self) (suspend) ) @@ -1730,34 +1708,18 @@ ) (set! (-> self pov-handle) (the-as handle #f)) (set! (-> self pov-bone) 0) - (let ((gp-1 (get-process *camera-dead-pool* list-keeper #x4000))) - (cond - ((when gp-1 - (let ((t9-5 (method-of-type list-keeper activate))) - (t9-5 (the-as list-keeper gp-1) self 'list-keeper (the-as pointer #x70004000)) - ) - (run-next-time-in-process gp-1 list-keeper-init) - (-> gp-1 ppointer) - ) - ) - (else - (format 0 "ERROR : master camera list keeper failed to activate~%") - ) + (cond + ((process-spawn-function list-keeper list-keeper-init :from *camera-dead-pool* :to self) + ) + (else + (format 0 "ERROR : master camera list keeper failed to activate~%") ) ) - (let ((gp-2 (get-process *camera-dead-pool* camera-slave #x4000))) - (cond - ((when gp-2 - (let ((t9-9 (method-of-type camera-slave activate))) - (t9-9 (the-as camera-slave gp-2) self 'camera-slave (the-as pointer #x70004000)) - ) - (run-next-time-in-process gp-2 cam-slave-init cam-free-floating #f) - (-> gp-2 ppointer) - ) - ) - (else - (format 0 "ERROR : first slave failed to activate~%") - ) + (cond + ((process-spawn-function camera-slave cam-slave-init cam-free-floating #f :from *camera-dead-pool* :to self) + ) + (else + (format 0 "ERROR : first slave failed to activate~%") ) ) (set! (-> self water-drip) (create-launch-control group-rain-screend-drop self)) diff --git a/goal_src/engine/camera/cam-start.gc b/goal_src/engine/camera/cam-start.gc index 52a9b6acd5..68ca0cc810 100644 --- a/goal_src/engine/camera/cam-start.gc +++ b/goal_src/engine/camera/cam-start.gc @@ -5,8 +5,8 @@ ;; name in dgo: cam-start ;; dgos: GAME, ENGINE -;; definition for function cam-stop -;; INFO: Return type mismatch (state camera-slave) vs state. +;; DECOMP BEGINS + (defun cam-stop () (kill-by-name 'camera-master *active-pool*) (kill-by-name 'camera-slave *active-pool*) @@ -17,17 +17,25 @@ (none) ) -;; definition for function cam-start -;; INFO: Return type mismatch int vs none. (defun cam-start ((arg0 symbol)) (cam-stop) - (make-init-process camera-combiner cam-combiner-init :from *camera-dead-pool* :to *camera-pool* :stack *scratch-memory-top*) - (set! *camera* (the-as camera-master (ppointer->process (make-init-process camera-master cam-master-init :from *camera-master-dead-pool* :to *camera-pool* :stack *scratch-memory-top*)))) + (process-spawn camera-combiner :init cam-combiner-init :from *camera-dead-pool* :to *camera-pool*) + (set! *camera* + (the-as camera-master + (ppointer->process + (process-spawn-function camera-master cam-master-init :from *camera-master-dead-pool* :to *camera-pool*) + ) + ) + ) (if arg0 (reset-cameras) ) + 0 (none) ) -;; failed to figure out what this is: (cam-start #f) + + + + diff --git a/goal_src/engine/camera/cam-states-dbg.gc b/goal_src/engine/camera/cam-states-dbg.gc index 813bf2daa9..2d343cee56 100644 --- a/goal_src/engine/camera/cam-states-dbg.gc +++ b/goal_src/engine/camera/cam-states-dbg.gc @@ -20,8 +20,7 @@ (define *CAM_POINT_WATCH-bank* (new 'static 'cam-point-watch-bank :speed 1600.0 :rot-speed (degrees 0.6))) (defstate cam-point-watch (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -31,8 +30,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self pivot-rad) 40960.0) (set! (-> self blend-from-type) (the-as uint 1)) @@ -40,9 +38,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((s5-0 (new-stack-vector0)) (gp-0 (new-stack-vector0)) ) @@ -295,8 +292,8 @@ (when *camera-read-analog* (let ((f28-14 (analog-input (the-as int (-> *cpad-list* cpads arg3 leftx)) 128.0 48.0 110.0 -1.0)) (f30-14 (analog-input (the-as int (-> *cpad-list* cpads arg3 lefty)) 128.0 48.0 110.0 -1.0)) - (f24-0 (analog-input (the-as int (-> *cpad-list* cpads arg3 rightx)) 128.0 48.0 110.0 -1.0)) - (f26-0 (analog-input (the-as int (-> *cpad-list* cpads arg3 righty)) 128.0 48.0 110.0 -1.0)) + (f24-0 (analog-input-horizontal-first (the-as int (-> *cpad-list* cpads arg3 rightx)) 128.0 48.0 110.0 -1.0)) ;; changed for pc port + (f26-0 (analog-input-vertical-first (the-as int (-> *cpad-list* cpads arg3 righty)) 128.0 48.0 110.0 -1.0)) ;; changed for pc port ) (when *display-load-boundaries* (when (and (!= arg3 1) @@ -393,8 +390,7 @@ ) (defstate cam-free-floating (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -404,8 +400,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) @@ -413,9 +408,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((a2-0 (-> *camera* local-down))) (if (logtest? (-> self options) 8) (set! a2-0 (the-as vector #f)) @@ -475,8 +469,7 @@ (set! (-> *camera-orbit-info* orbit-off y) 4096.0) (defstate cam-orbit (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -486,8 +479,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (if (not *camera-orbit-target*) (cam-slave-go cam-free-floating) @@ -501,14 +493,12 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () '() (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (not *camera-orbit-target*) (cam-slave-go cam-free-floating) ) diff --git a/goal_src/engine/camera/cam-states.gc b/goal_src/engine/camera/cam-states.gc index 3edcfdd070..a9838de381 100644 --- a/goal_src/engine/camera/cam-states.gc +++ b/goal_src/engine/camera/cam-states.gc @@ -4,13 +4,13 @@ ;; name: cam-states.gc ;; name in dgo: cam-states ;; dgos: GAME, ENGINE +;; note: changed for high fps ;; DECOMP BEGINS (defstate cam-fixed (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -20,8 +20,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self saved-pt quad) (-> self trans quad)) (set! (-> self blend-from-type) (the-as uint 1)) @@ -30,9 +29,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (paused?)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> self trans quad) (-> self saved-pt quad)) @@ -50,8 +48,7 @@ ) (defstate cam-fixed-read-entity (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -61,8 +58,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (cond ((-> self enter-has-run) ) @@ -85,9 +81,8 @@ (go cam-fixed) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (format *stdcon* "ERROR : stayed in cam-fixed-read-entity~%") (suspend) ) @@ -96,8 +91,7 @@ ) (defstate cam-pov (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -107,25 +101,22 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) (none) ) - :trans - (behavior () + :trans (behavior () (when (not (handle->process (-> *camera* pov-handle))) (set! (-> self blend-from-type) (the-as uint 0)) (cam-slave-go cam-fixed) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (paused?)) (vector<-cspace! (-> self trans) @@ -159,8 +150,7 @@ ) (defstate cam-pov180 (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -170,24 +160,21 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) (none) ) - :trans - (behavior () + :trans (behavior () (when (not (handle->process (-> *camera* pov-handle))) (set! (-> self blend-from-type) (the-as uint 0)) (cam-slave-go cam-fixed) ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) (s4-0 #t) @@ -207,7 +194,7 @@ ) (vector-normalize-copy! s5-0 (-> v1-11 vector 2) (the-as float 1.0)) ) - (while #t + (loop (when (not (paused?)) (let ((s0-0 (-> (the-as pov-camera (-> *camera* pov-handle process 0)) @@ -262,10 +249,8 @@ ) (defstate cam-pov-track (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (the-as uint 2)) @@ -277,16 +262,14 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (or (not (handle->process (-> *camera* pov-handle))) (zero? (logand (-> *camera* master-options) 2))) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (not (paused?)) (vector<-cspace! (-> self trans) @@ -307,8 +290,7 @@ ) (defstate cam-standoff (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('set-standoff-dist) (vector-normalize! (-> self pivot-pt) (the-as float (-> arg3 param 0))) @@ -329,8 +311,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (vector-! (-> self pivot-pt) (-> self trans) (-> *camera* tpos-curr-adj)) (cond @@ -348,16 +329,14 @@ (cam-calc-follow! (-> self tracking) (-> self trans) #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (paused?)) (cam-calc-follow! (-> self tracking) (-> self trans) #t) (cam-standoff-calc-trans) @@ -369,10 +348,8 @@ ) (defstate cam-standoff-read-entity (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (cond ((-> self enter-has-run) ) @@ -407,9 +384,8 @@ (go cam-standoff) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (format *stdcon* "ERROR : stayed in cam-standoff-read-entity~%") (suspend) ) @@ -429,14 +405,14 @@ ) -(define - *CAM_EYE-bank* +(define *CAM_EYE-bank* (new 'static 'cam-eye-bank :rot-speed 364.0889 :max-degrees 12743.111 :max-fov 11650.845 :min-fov 6189.511) ) +;; main first-person camera +;; note: modified for high fps (defstate cam-eye (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -446,8 +422,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (let ((v1-3 (vector-float*! (new-stack-vector0) (-> *camera* local-down) (+ 1024.0 (-> *camera* target-height))))) (vector-! (-> self trans) (-> *camera* tpos-curr) v1-3) @@ -459,30 +434,30 @@ (set! (-> self fov) 11650.845) (none) ) - :exit - (behavior () - (if (and *target* (logtest? (-> *camera* master-options) 2) (logtest? (-> *target* state-flags) 512)) + :exit (behavior () + (if (and *target* + (logtest? (-> *camera* master-options) 2) + (logtest? (-> *target* state-flags) (state-flags first-person-mode)) + ) (send-event *target* 'end-mode) ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (go cam-free-floating) ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (-> *display* base-frame-counter))) - (while #t + (loop (when (not (paused?)) (let ((s4-0 (vector-reset! (new-stack-vector0))) (s5-0 (new-stack-matrix0)) ) (when *camera-read-analog* - (let ((f30-0 (analog-input + (let ((f30-0 (analog-input-horizontal-first ;; changed for pc port (the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx))) (the-as float 0.0) (the-as float 48.0) @@ -490,7 +465,7 @@ (the-as float -1.0) ) ) - (f0-0 (analog-input + (f0-0 (analog-input-vertical-first ;; changed for pc port (the-as int (+ (-> *cpad-list* cpads 0 righty) -256 (-> *cpad-list* cpads 0 lefty))) (the-as float 0.0) (the-as float 48.0) @@ -499,24 +474,24 @@ ) ) ) - (set! (-> s4-0 y) (- (-> s4-0 y) (* (- f30-0) (-> *CAM_EYE-bank* rot-speed)))) - (set! (-> s4-0 x) (- (-> s4-0 x) (* (- f0-0) (-> *CAM_EYE-bank* rot-speed)))) + (set! (-> s4-0 y) (- (-> s4-0 y) (* (- f30-0) (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed))))) ;; changed for high fps + (set! (-> s4-0 x) (- (-> s4-0 x) (* (- f0-0) (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed))))) ;; changed for high fps ) ) (cond - ((< (-> *CAM_EYE-bank* rot-speed) (-> s4-0 x)) - (set! (-> s4-0 x) (-> *CAM_EYE-bank* rot-speed)) + ((< (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)) (-> s4-0 x)) ;; changed for high fps + (set! (-> s4-0 x) (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed))) ;; changed for high fps ) - ((< (-> s4-0 x) (- (-> *CAM_EYE-bank* rot-speed))) - (set! (-> s4-0 x) (- (-> *CAM_EYE-bank* rot-speed))) + ((< (-> s4-0 x) (- (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)))) ;; changed for high fps + (set! (-> s4-0 x) (- (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)))) ;; changed for high fps ) ) (cond - ((< (-> *CAM_EYE-bank* rot-speed) (-> s4-0 y)) - (set! (-> s4-0 y) (-> *CAM_EYE-bank* rot-speed)) + ((< (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)) (-> s4-0 y)) ;; changed for high fps + (set! (-> s4-0 y) (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed))) ;; changed for high fps ) - ((< (-> s4-0 y) (- (-> *CAM_EYE-bank* rot-speed))) - (set! (-> s4-0 y) (- (-> *CAM_EYE-bank* rot-speed))) + ((< (-> s4-0 y) (- (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)))) ;; changed for high fps + (set! (-> s4-0 y) (- (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)))) ;; changed for high fps ) ) (cond @@ -605,9 +580,9 @@ (define *CAM_BILLY-bank* (new 'static 'cam-billy-bank :rot-speed 364.0889 :tilt-degrees -1820.4445)) +;; first person camera for rat game (defstate cam-billy (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -617,8 +592,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (let ((v1-3 (vector-float*! (new-stack-vector0) (-> *camera* local-down) (-> *camera* target-height)))) (vector-! (-> self trans) (-> *camera* tpos-curr) v1-3) @@ -631,21 +605,18 @@ (matrix-rotate-y! (the-as matrix (-> self tracking)) (the-as float -32768.0)) (none) ) - :exit - (behavior () + :exit (behavior () '() (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (paused?)) (let ((s5-0 (vector-reset! (new-stack-vector0))) (s4-0 (vector-reset! (new-stack-vector0))) @@ -656,7 +627,7 @@ 0.0 (when *camera-read-analog* (let ((f1-0 - (analog-input + (analog-input-horizontal-first ;; changed for pc port (the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx))) (the-as float 0.0) (the-as float 48.0) @@ -727,10 +698,8 @@ ) (defstate cam-spline (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (cond ((-> self enter-has-run) ) @@ -809,16 +778,14 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (paused?)) (cam-calc-follow! (-> self tracking) (-> self trans) #t) (new 'stack 'curve) @@ -832,8 +799,7 @@ ) (defstate cam-decel (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -843,16 +809,14 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (if (not (-> self enter-has-run)) (set! (-> self saved-pt quad) (-> self trans quad)) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (paused?)) (let ((s5-0 (new-stack-vector0)) (gp-0 (new-stack-vector0)) @@ -887,8 +851,7 @@ ) (defstate cam-endlessfall (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -898,16 +861,14 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (the-as uint 2)) ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'cam-vector-seeker)) (f30-0 (-> self velocity y)) ) @@ -921,7 +882,7 @@ (init! gp-0 s4-0 (the-as float 81.92) (fmax 819.2 (vector-length s5-0)) (the-as float 0.75)) (set! (-> gp-0 vel quad) (-> s5-0 quad)) ) - (while #t + (loop (when (not (paused?)) (set! (-> gp-0 target x) (-> (target-pos 0) x)) (set! (-> gp-0 target z) (-> (target-pos 0) z)) @@ -944,6 +905,7 @@ ) ) +;; third person cam used to focus on various entities (defbehavior cam-circular-position-into-max-angle camera-slave ((arg0 vector) (arg1 vector) (arg2 float)) (let* ((f30-0 (vector-normalize-ret-len! arg0 (the-as float 1.0))) (f26-0 (vector-normalize-ret-len! arg1 (the-as float 1.0))) @@ -952,7 +914,7 @@ (s3-0 (new 'stack-no-clear 'matrix)) ) (when *camera-read-analog* - (let ((f24-0 (analog-input + (let ((f24-0 (analog-input-horizontal-third ;; changed for pc port (the-as int (-> *cpad-list* cpads 0 rightx)) (the-as float 128.0) (the-as float 32.0) @@ -960,7 +922,7 @@ (* 8192.0 (-> *display* seconds-per-frame)) ) ) - (f1-2 (analog-input + (f1-2 (analog-input-vertical-third ;; changed for pc port (the-as int (-> *cpad-list* cpads 0 righty)) (the-as float 128.0) (the-as float 32.0) @@ -1123,8 +1085,7 @@ ) (defstate cam-circular (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -1138,8 +1099,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (cond ((-> self enter-has-run) ) @@ -1210,16 +1170,14 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (not (paused?)) (cam-circular-code) ) @@ -1230,26 +1188,22 @@ ) (defstate cam-lookat (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (the-as uint 2)) ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) @@ -1281,7 +1235,7 @@ ) (vector--float*! s5-0 s5-0 (-> *camera* local-down) (-> *CAMERA-bank* default-string-min-y)) (set! (-> arg0 quad) (-> s5-0 quad)) - (while #t + (loop (vector--float*! s4-0 arg0 (-> *camera* local-down) (-> *camera* target-height)) (if (< (fill-and-probe-using-line-sphere *collide-cache* @@ -1291,7 +1245,7 @@ (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process #f) s3-0 - 2 + (new 'static 'pat-surface :nocamera #x1) ) 0.0 ) @@ -1342,7 +1296,7 @@ (let ((t1-0 #x40000080)) (add-debug-flat-triangle #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> gp-0 0)) (-> gp-0 0 vertex 1) (-> gp-0 0 vertex 2) @@ -1602,7 +1556,7 @@ ) ) -(defun cam-los-spline-collide ((arg0 vector) (arg1 vector) (arg2 vector)) +(defun cam-los-spline-collide ((arg0 vector) (arg1 vector) (arg2 pat-surface)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 *collide-cache*) (f30-0 2.0) @@ -1616,7 +1570,7 @@ (-> *CAM_STRING-bank* los-coll-rad2) (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process-drawable #f) - (the-as int arg2) + arg2 ) (let* ((f0-2 (vector-length s5-0)) (f28-0 @@ -1818,7 +1772,7 @@ ;; WARN: Unsupported inline assembly instruction kind - [mula.s f2, f5] ;; WARN: Unsupported inline assembly instruction kind - [madda.s f3, f6] ;; WARN: Unsupported inline assembly instruction kind - [madd.s f2, f4, f7] -(defbehavior cam-los-collide camera-slave ((arg0 vector) (arg1 vector) (arg2 clip-travel-vector-to-mesh-return-info) (arg3 int)) +(defbehavior cam-los-collide camera-slave ((arg0 vector) (arg1 vector) (arg2 clip-travel-vector-to-mesh-return-info) (arg3 pat-surface)) (local-vars (s1-3 int) (s2-2 int) (f2-1 float) (sv-224 vector) (sv-240 vector)) (dist-info-init (the-as collide-los-dist-info (-> arg2 intersection))) (dist-info-init (the-as collide-los-dist-info (-> arg2 next-normal))) @@ -1972,7 +1926,7 @@ (cam-los-spline-collide (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 (-> *camera* target-spline end-point)))) arg0 - (the-as vector 4098) + (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1) ) ) ) @@ -2005,7 +1959,7 @@ (cam-los-spline-collide (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 s2-2))) arg0 - (the-as vector 4098) + (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1) ) ) (< f30-1 0.0) @@ -2272,7 +2226,7 @@ (let ((f30-0 (vector-length (-> self view-flat)))) (vector--float*! s5-0 (-> *camera* tpos-curr) (-> *camera* local-down) (-> *camera* target-height)) (vector-! s5-0 s5-0 (-> self string-trans)) - (cam-los-collide (-> self string-trans) s5-0 gp-0 4098) + (cam-los-collide (-> self string-trans) s5-0 gp-0 (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1)) (when (-> gp-0 vert-next y) (when (or (= (-> self los-state) (slave-los-state ccw)) (= (-> self los-state) (slave-los-state cw))) (let ((a0-6 (new 'stack-no-clear 'vector))) @@ -2322,11 +2276,16 @@ ((< 160 arg0) (set! f0-0 (fmin arg1 (* 0.0125 (+ -160.0 (the float arg0)) arg1))) ) - ) - f0-0 + ) + ;; changed for pc port, only used for Third-Person Vertical camera + (#if PC_PORT + (* (if (-> *pc-settings* third-camera-v-inverted?) 1.0 -1.0) f0-0) + f0-0 ) ) +) +;; main third-person camera (defbehavior cam-string-joystick camera-slave () (set! (-> self options) (logand -257 (-> self options))) (let ((f28-0 (cam-dist-analog-input (the-as int (-> *cpad-list* cpads 0 righty)) (the-as float 0.05))) @@ -2417,7 +2376,7 @@ ) ) (when *camera-read-analog* - (let ((f0-29 (analog-input + (let ((f0-29 (analog-input-horizontal-third ;; changed for pc port (the-as int (-> *cpad-list* cpads 0 rightx)) (the-as float 128.0) (the-as float 32.0) @@ -2501,7 +2460,7 @@ (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process #f) s4-0 - 2 + (new 'static 'pat-surface :nocamera #x1) ) 0.0 ) @@ -2604,7 +2563,7 @@ (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process #f) s4-2 - 2 + (new 'static 'pat-surface :nocamera #x1) ) -100000000.0 ) @@ -2766,8 +2725,7 @@ ) (defstate cam-string (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) (let ((gp-0 (new-stack-vector0))) @@ -2810,8 +2768,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (set-string-parms) (set! *camera-base-mode* cam-string) @@ -2904,7 +2861,7 @@ (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process #f) s4-0 - 4098 + (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1) ) ) ) @@ -2960,16 +2917,14 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (paused?)) (set-string-parms) (cam-string-code) @@ -2994,8 +2949,7 @@ ) -(define - *CAM_STICK-bank* +(define *CAM_STICK-bank* (new 'static 'cam-stick-bank :max-z (meters 30) :min-z (meters 5) :max-y (meters 15) :min-y (meters 2)) ) @@ -3040,7 +2994,7 @@ (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process #f) s3-0 - 2 + (new 'static 'pat-surface :nocamera #x1) ) -100000000.0 ) @@ -3097,11 +3051,10 @@ (none) ) +;; third person camera (in debug menu, and fishermans-boat-player-control w/o autopilot?) (defstate cam-stick (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self view-off-param) (-> *camera* view-off-param-save)) (set! (-> self view-off x) 0.0) @@ -3125,15 +3078,14 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (when (not (paused?)) (when *camera-read-analog* (let ((f0-0 - (analog-input + (analog-input-vertical-third ;; changed for pc port (the-as int (-> *cpad-list* cpads 0 righty)) (the-as float 128.0) (the-as float 32.0) @@ -3162,7 +3114,7 @@ (lerp (-> *CAM_STICK-bank* min-z) (-> *CAM_STICK-bank* max-z) (-> self view-off-param)) ) (when *camera-read-analog* - (let ((f0-16 (analog-input + (let ((f0-16 (analog-input-horizontal-third ;; changed for pc port (the-as int (-> *cpad-list* cpads 0 rightx)) (the-as float 128.0) (the-as float 32.0) @@ -3203,9 +3155,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (not (paused?)) (cam-stick-code) ) @@ -3227,8 +3178,7 @@ ) -(define - *CAM_BIKE-bank* +(define *CAM_BIKE-bank* (new 'static 'cam-bike-bank :max-z (meters 6) :min-z (meters 10) :max-y (meters 3) :min-y (meters 5)) ) @@ -3309,7 +3259,7 @@ (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process #f) s4-3 - 2 + (new 'static 'pat-surface :nocamera #x1) ) -100000000.0 ) @@ -3340,10 +3290,8 @@ ) (defstate cam-bike (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> *camera* foot-offset) 4096.0) (set! (-> *camera* head-offset) 16384.0) @@ -3364,16 +3312,14 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (not (paused?)) (cam-bike-code) ) diff --git a/goal_src/engine/camera/cam-update.gc b/goal_src/engine/camera/cam-update.gc index 436eba96d3..4e1e00d0ec 100644 --- a/goal_src/engine/camera/cam-update.gc +++ b/goal_src/engine/camera/cam-update.gc @@ -276,6 +276,29 @@ arg0 ) +;; PAL patch here (moved from cam-debug) +(defun external-cam-reset! () + (vector-reset! (-> *math-camera* trans)) + (matrix-identity! (-> *math-camera* inv-camera-rot)) + (when *camera-combiner* + (let* ((v1-6 (-> *math-camera* inv-camera-rot)) + (a3-0 (-> *camera-combiner* inv-camera-rot)) + (a0-2 (-> a3-0 vector 0 quad)) + (a1-0 (-> a3-0 vector 1 quad)) + (a2-0 (-> a3-0 vector 2 quad)) + (a3-1 (-> a3-0 vector 3 quad)) + ) + (set! (-> v1-6 vector 0 quad) a0-2) + (set! (-> v1-6 vector 1 quad) a1-0) + (set! (-> v1-6 vector 2 quad) a2-0) + (set! (-> v1-6 vector 3 quad) a3-1) + ) + (set! (-> *math-camera* trans quad) (-> *camera-combiner* trans quad)) + ) + 0 + (none) + ) + (define *start-timer* (the-as int #f)) (define *timer-value* 0) @@ -328,7 +351,7 @@ (when *display-level-spheres* (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s5-1 info bsphere) (-> s5-1 info bsphere w) (new 'static 'rgba :r #xff :a #x80) diff --git a/goal_src/engine/camera/camera.gc b/goal_src/engine/camera/camera.gc index 404cd4c2e1..649ec9889c 100644 --- a/goal_src/engine/camera/camera.gc +++ b/goal_src/engine/camera/camera.gc @@ -10,8 +10,6 @@ (define *cam-res-string* (new 'global 'string 64 (the-as string #f))) -;; definition for function cam-slave-get-vector-with-offset -;; Used lq/sq (defun cam-slave-get-vector-with-offset ((arg0 entity-actor) (arg1 vector) (arg2 symbol)) (local-vars (s3-0 structure)) (cond @@ -55,7 +53,6 @@ ) ) -;; definition for function cam-slave-get-flags (defun cam-slave-get-flags ((arg0 entity) (arg1 symbol)) (let ((gp-0 (res-lump-value arg0 arg1 uint128)) (s3-0 (method-of-type res-lump get-property-value)) @@ -92,7 +89,6 @@ ) ) -;; definition for function cam-slave-get-float (defun cam-slave-get-float ((arg0 entity) (arg1 symbol) (arg2 float)) (let ((f30-0 (res-lump-float arg0 arg1 :default arg2)) (s4-0 (method-of-type res-lump get-property-value-float)) @@ -111,7 +107,6 @@ ) ) -;; definition for function cam-slave-get-fov (defun cam-slave-get-fov ((arg0 entity)) (let ((f30-0 (res-lump-float arg0 'fov)) (s5-0 (method-of-type res-lump get-property-value-float)) @@ -136,7 +131,6 @@ ) ) -;; definition for function cam-slave-get-intro-step (defun cam-slave-get-intro-step ((arg0 entity)) (let ((f30-0 (res-lump-float arg0 'intro-time)) (s5-0 (method-of-type res-lump get-property-value-float)) @@ -162,7 +156,6 @@ ) ) -;; definition for function cam-slave-get-interp-time (defun cam-slave-get-interp-time ((arg0 entity)) (let ((f30-0 (res-lump-float arg0 'interpTime)) (s5-0 (method-of-type res-lump get-property-value-float)) @@ -188,7 +181,6 @@ ) ) -;; definition for function cam-slave-get-rot (defun cam-slave-get-rot ((arg0 entity-actor) (arg1 matrix)) (let ((s4-0 (method-of-type res-lump get-property-struct)) (s3-0 arg0) @@ -222,8 +214,6 @@ arg1 ) -;; definition for function cam-state-from-entity -;; INFO: Return type mismatch (state camera-slave) vs state. (defun cam-state-from-entity ((arg0 entity)) (let ((s5-0 (new 'stack 'curve))) (the-as state (cond @@ -250,12 +240,10 @@ ) ) -;; definition for function parameter-ease-none (defun parameter-ease-none ((arg0 object)) arg0 ) -;; definition for function parameter-ease-clamp (defun parameter-ease-clamp ((arg0 float)) (cond ((>= arg0 1.0) @@ -268,7 +256,6 @@ arg0 ) -;; definition for function parameter-ease-lerp-clamp (defun parameter-ease-lerp-clamp ((arg0 float)) (cond ((>= arg0 1.0) @@ -289,7 +276,6 @@ ) ) -;; definition for function parameter-ease-sqrt-clamp (defun parameter-ease-sqrt-clamp ((arg0 float)) (cond ((>= arg0 1.0) @@ -307,19 +293,16 @@ ) ) -;; definition for function fourth-power (defun fourth-power ((arg0 float)) (let ((f0-2 (* arg0 arg0))) (* f0-2 f0-2) ) ) -;; definition for function third-power (defun third-power ((arg0 float)) (* arg0 arg0 arg0) ) -;; definition for function parameter-ease-sqr-clamp (defun parameter-ease-sqr-clamp ((arg0 float)) (cond ((>= arg0 1.0) @@ -346,7 +329,6 @@ ) ) -;; definition for function parameter-ease-sin-clamp (defun parameter-ease-sin-clamp ((arg0 float)) (cond ((>= arg0 1.0) @@ -361,8 +343,6 @@ ) ) -;; definition for method 9 of type cam-index -;; Used lq/sq (defmethod dummy-9 cam-index ((obj cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) (local-vars (sv-32 (function _varargs_ object))) (format (clear *cam-res-string*) "~S-flags" arg0) @@ -402,10 +382,8 @@ ) ) (arg3 - (set! (-> obj vec 0 quad) (-> (the-as (pointer uint128) (&+ (-> arg3 cverts) 0)))) - (set! (-> obj vec 1 quad) - (-> (the-as (pointer uint128) (&+ (-> arg3 cverts) (* (+ (-> arg3 num-cverts) -1) 16)))) - ) + (set! (-> obj vec 0 quad) (-> arg3 cverts 0 quad)) + (set! (-> obj vec 1 quad) (-> arg3 cverts (+ (-> arg3 num-cverts) -1) quad)) ) (else (return #f) @@ -441,8 +419,6 @@ #t ) -;; definition for method 10 of type cam-index -;; Used lq/sq (defmethod dummy-10 cam-index ((obj cam-index) (arg0 vector)) (let ((s5-0 (new-stack-vector0))) 0.0 @@ -462,9 +438,6 @@ ) ) -;; definition for method 10 of type tracking-spline -;; INFO: Return type mismatch int vs none. -;; Used lq/sq (defmethod TODO-RENAME-10 tracking-spline ((obj tracking-spline) (arg0 vector)) (set! (-> obj point 0 position quad) (-> arg0 quad)) (set! (-> obj point 0 next) -134250495) @@ -489,8 +462,6 @@ (none) ) -;; definition for method 13 of type tracking-spline -;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-13 tracking-spline ((obj tracking-spline) (arg0 int)) (let ((v1-3 (-> obj point arg0 next))) (cond @@ -524,8 +495,6 @@ (none) ) -;; definition for method 14 of type tracking-spline -;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-14 tracking-spline ((obj tracking-spline) (arg0 tracking-spline-sampler)) (let ((v1-0 (-> obj used-point))) (set! (-> obj partial-point) (-> arg0 partial-pt)) @@ -563,8 +532,6 @@ (none) ) -;; definition for method 15 of type tracking-spline -;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-15 tracking-spline ((obj tracking-spline)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'tracking-point))) @@ -611,8 +578,6 @@ (none) ) -;; definition for method 16 of type tracking-spline -;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-16 tracking-spline ((obj tracking-spline) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) @@ -651,8 +616,6 @@ (none) ) -;; definition for method 17 of type tracking-spline -;; Used lq/sq (defmethod TODO-RENAME-17 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) (let ((s3-0 (-> obj free-point)) (s2-0 (-> obj end-point)) @@ -694,7 +657,6 @@ 0 ) -;; definition for method 18 of type tracking-spline (defmethod TODO-RENAME-18 tracking-spline ((obj tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (local-vars (f0-4 float)) (when (not arg2) @@ -703,7 +665,7 @@ (set! (-> arg2 partial-pt) (-> obj partial-point)) ) 0.0 - (while #t + (loop (cond ((= (-> arg2 cur-pt) (-> obj end-point)) (set! (-> arg2 partial-pt) 0.0) @@ -737,15 +699,12 @@ (the-as vector #f) ) -;; definition for method 19 of type tracking-spline (defmethod TODO-RENAME-19 tracking-spline ((obj tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (vector-reset! arg1) (TODO-RENAME-18 obj arg0 arg1 arg2) arg1 ) -;; definition for method 20 of type tracking-spline -;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-20 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 int)) (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-! @@ -834,8 +793,6 @@ (none) ) -;; definition for method 21 of type tracking-spline -;; Used lq/sq (defmethod TODO-RENAME-21 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 float) (arg2 float)) (let ((v1-0 (-> obj used-point)) (f0-0 (-> obj partial-point)) @@ -884,8 +841,6 @@ arg0 ) -;; definition for method 22 of type tracking-spline -;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-22 tracking-spline ((obj tracking-spline) (arg0 float)) (when (< arg0 (-> obj summed-len)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) @@ -901,8 +856,6 @@ (none) ) -;; definition for method 9 of type tracking-spline -;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-9 tracking-spline ((obj tracking-spline)) (let ((v1-0 (-> obj used-point)) (s4-0 0) @@ -945,8 +898,6 @@ (none) ) -;; definition for function cam-slave-init-vars -;; Used lq/sq (defbehavior cam-slave-init-vars camera-slave () (cond (*camera* @@ -1022,8 +973,6 @@ (none) ) -;; definition for function cam-slave-go -;; INFO: Return type mismatch int vs none. (defun cam-slave-go ((arg0 state)) (with-pp (cam-slave-init-vars) @@ -1036,8 +985,6 @@ ) ) -;; definition for function cam-slave-init -;; INFO: Return type mismatch int vs none. (defbehavior cam-slave-init camera-slave ((arg0 state) (arg1 entity)) (stack-size-set! (-> self main-thread) 512) (change-to-last-brother self) @@ -1083,13 +1030,10 @@ (none) ) -;; definition for function cam-standard-event-handler -;; INFO: Return type mismatch none vs object. ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 7] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 31] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 45] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 50] -;; Used lq/sq (defbehavior cam-standard-event-handler camera-slave ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as @@ -1149,8 +1093,6 @@ ) ) -;; definition for function cam-curve-pos -;; Used lq/sq (defbehavior cam-curve-pos camera-slave ((arg0 vector) (arg1 vector) (arg2 curve) (arg3 symbol)) (let ((s5-0 (new-stack-vector0))) 0.0 @@ -1219,8 +1161,6 @@ arg0 ) -;; definition for function cam-curve-setup -;; INFO: Return type mismatch int vs none. (defbehavior cam-curve-setup camera-slave ((arg0 vector)) (when (get-curve-data! (-> self cam-entity) (-> self spline-curve) 'campath 'campath-k -1000000000.0) (curve-get-pos! (-> self spline-offset) 0.0 (-> self spline-curve)) @@ -1251,130 +1191,118 @@ (none) ) -;; definition for function cam-calc-follow! -;; Used lq/sq (defun cam-calc-follow! ((arg0 cam-rotation-tracker) (arg1 vector) (arg2 symbol)) - (with-pp - (cond - (arg2 - (update! (-> arg0 tilt-adjust) 0.0) - (update! (-> arg0 point-of-interest-blend) 0.0) - (update! (-> arg0 underwater-blend) 0.0) - ) - (else - (jump-to-target! (-> arg0 tilt-adjust) 0.0) - (jump-to-target! (-> arg0 point-of-interest-blend) 0.0) - (jump-to-target! (-> arg0 underwater-blend) 0.0) - ) + (cond + (arg2 + (update! (-> arg0 tilt-adjust) 0.0) + (update! (-> arg0 point-of-interest-blend) 0.0) + (update! (-> arg0 underwater-blend) 0.0) ) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) pp) - (set! (-> a1-7 num-params) 1) - (set! (-> a1-7 message) 'slave-option?) - (set! (-> a1-7 param 0) (the-as uint #x4000)) - (cond - ((send-event-function *camera* a1-7) - (let ((s3-0 (new 'stack-no-clear 'vector)) - (s2-0 (new 'stack-no-clear 'vector)) - (f30-0 (vector-vector-distance (-> *camera* tpos-curr-adj) (-> *camera* tpos-old-adj))) - (s5-1 (new 'stack-no-clear 'vector)) - ) - (vector-flatten! s3-0 (-> *camera* tgt-face-mat vector 2) (-> *camera* local-down)) - (vector-normalize! s3-0 1.0) - (vector-! s2-0 (-> *camera* tpos-curr-adj) arg1) - (vector-flatten! s2-0 s2-0 (-> *camera* local-down)) - (vector-normalize! s2-0 1.0) - (vector-float*! s5-1 (-> *camera* tgt-face-mat vector 2) 32768.0) - (let* ((f30-1 (lerp-clamp 0.7 0.4 (parameter-ease-sin-clamp (* 0.00081380206 (+ -409.6 f30-0))))) - (f0-4 (acos (vector-dot s2-0 s3-0))) - (f28-0 (fmax 1820.4445 f0-4)) - ) - (if (< f28-0 8192.0) - (vector-float*! - s5-1 - s5-1 - (+ f30-1 - (* (/ (- 1.0 f30-1) (- 1.0 (cos 32768.0))) (+ (- (cos 32768.0)) (cos (* 5.142857 (- 8192.0 f28-0))))) - ) - ) - ) - ) - (cond - ((< (-> *camera* ease-t) 1.0) - ) - ((< (-> arg0 follow-blend) 1.0) - (let* ((f0-18 (-> arg0 follow-blend)) - (f0-19 (* f0-18 f0-18)) - (f0-20 (* f0-19 f0-19)) - ) - (vector-! s5-1 s5-1 (-> arg0 follow-off)) - (vector-float*! s5-1 s5-1 f0-20) - ) - (+! (-> arg0 follow-blend) (* 0.016666668 (-> *display* time-adjust-ratio))) - (vector+! (-> arg0 follow-off) (-> arg0 follow-off) s5-1) - ) - (else - (set! (-> arg0 follow-off quad) (-> s5-1 quad)) - ) - ) + (else + (jump-to-target! (-> arg0 tilt-adjust) 0.0) + (jump-to-target! (-> arg0 point-of-interest-blend) 0.0) + (jump-to-target! (-> arg0 underwater-blend) 0.0) + ) + ) + (cond + ((send-event *camera* 'slave-option? #x4000) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (f30-0 (vector-vector-distance (-> *camera* tpos-curr-adj) (-> *camera* tpos-old-adj))) + (s5-1 (new 'stack-no-clear 'vector)) ) - (vector+! (-> arg0 follow-pt) (-> *camera* tpos-curr-adj) (-> arg0 follow-off)) - (vector--float*! - (-> arg0 follow-pt) - (-> arg0 follow-pt) - (-> *camera* local-down) - (+ 12288.0 (-> *camera* target-height)) + (vector-flatten! s3-0 (-> *camera* tgt-face-mat vector 2) (-> *camera* local-down)) + (vector-normalize! s3-0 1.0) + (vector-! s2-0 (-> *camera* tpos-curr-adj) arg1) + (vector-flatten! s2-0 s2-0 (-> *camera* local-down)) + (vector-normalize! s2-0 1.0) + (vector-float*! s5-1 (-> *camera* tgt-face-mat vector 2) 32768.0) + (let* ((f30-1 (lerp-clamp 0.7 0.4 (parameter-ease-sin-clamp (* 0.00081380206 (+ -409.6 f30-0))))) + (f0-4 (acos (vector-dot s2-0 s3-0))) + (f28-0 (fmax 1820.4445 f0-4)) + ) + (if (< f28-0 8192.0) + (vector-float*! + s5-1 + s5-1 + (+ f30-1 + (* (/ (- 1.0 f30-1) (- 1.0 (cos 32768.0))) (+ (- (cos 32768.0)) (cos (* 5.142857 (- 8192.0 f28-0))))) + ) + ) + ) + ) + (cond + ((< (-> *camera* ease-t) 1.0) + ) + ((< (-> arg0 follow-blend) 1.0) + (let* ((f0-18 (-> arg0 follow-blend)) + (f0-19 (* f0-18 f0-18)) + (f0-20 (* f0-19 f0-19)) + ) + (vector-! s5-1 s5-1 (-> arg0 follow-off)) + (vector-float*! s5-1 s5-1 f0-20) + ) + (+! (-> arg0 follow-blend) (* 0.016666668 (-> *display* time-adjust-ratio))) + (vector+! (-> arg0 follow-off) (-> arg0 follow-off) s5-1) + ) + (else + (set! (-> arg0 follow-off quad) (-> s5-1 quad)) ) ) - (else - 0.0 - (let ((s3-2 (new-stack-vector0))) - (set! (-> arg0 follow-blend) 0.0) - (cond - ((-> arg0 no-follow) - (vector-reset! s3-2) - ) - (else - (vector-! s3-2 (-> *camera* tpos-curr-adj) arg1) - (vector-normalize! s3-2 1.0) - (let* ((f0-28 (vector-dot (-> *camera* tgt-rot-mat vector 2) s3-2)) - (f30-2 (cond - ((< f0-28 0.0) - 1.0 - ) - (else - (let* ((f0-29 (* f0-28 f0-28)) (f0-30 (- 1.0 f0-29))) (* f0-30 (* f0-30 f0-30))) - ) - ) + ) + (vector+! (-> arg0 follow-pt) (-> *camera* tpos-curr-adj) (-> arg0 follow-off)) + (vector--float*! + (-> arg0 follow-pt) + (-> arg0 follow-pt) + (-> *camera* local-down) + (+ 12288.0 (-> *camera* target-height)) + ) + ) + (else + 0.0 + (let ((s3-2 (new-stack-vector0))) + (set! (-> arg0 follow-blend) 0.0) + (cond + ((-> arg0 no-follow) + (vector-reset! s3-2) + ) + (else + (vector-! s3-2 (-> *camera* tpos-curr-adj) arg1) + (vector-normalize! s3-2 1.0) + (let* ((f0-28 (vector-dot (-> *camera* tgt-rot-mat vector 2) s3-2)) + (f30-2 (cond + ((< f0-28 0.0) + 1.0 + ) + (else + (let* ((f0-29 (* f0-28 f0-28)) (f0-30 (- 1.0 f0-29))) (* f0-30 (* f0-30 f0-30))) ) - ) - (vector-! s3-2 arg1 (-> *camera* tpos-curr-adj)) - (vector-flatten! s3-2 s3-2 (-> *camera* local-down)) - (let* ((f0-33 (* 0.000022194603 (+ -20480.0 (vector-length s3-2)))) - (f0-34 (fmin 1.0 f0-33)) - (f0-35 (fmax 0.0 f0-34)) - ) - (vector-float*! s3-2 (-> *camera* tgt-rot-mat vector 2) (* (lerp 2048.0 8192.0 f0-35) f30-2)) - ) - ) + ) + ) + ) + (vector-! s3-2 arg1 (-> *camera* tpos-curr-adj)) + (vector-flatten! s3-2 s3-2 (-> *camera* local-down)) + (let* ((f0-33 (* 0.000022194603 (+ -20480.0 (vector-length s3-2)))) + (f0-34 (fmin 1.0 f0-33)) + (f0-35 (fmax 0.0 f0-34)) + ) + (vector-float*! s3-2 (-> *camera* tgt-rot-mat vector 2) (* (lerp 2048.0 8192.0 f0-35) f30-2)) ) ) - (if arg2 - (vector-seek-3d-smooth! (-> arg0 follow-off) s3-2 (* 20480.0 (-> *display* seconds-per-frame)) 0.05) - (set! (-> arg0 follow-off quad) (-> s3-2 quad)) - ) ) - (vector+! (-> arg0 follow-pt) (-> *camera* tpos-curr-adj) (-> arg0 follow-off)) - (vector--float*! (-> arg0 follow-pt) (-> arg0 follow-pt) (-> *camera* local-down) (-> *camera* target-height)) ) + (if arg2 + (vector-seek-3d-smooth! (-> arg0 follow-off) s3-2 (* 20480.0 (-> *display* seconds-per-frame)) 0.05) + (set! (-> arg0 follow-off quad) (-> s3-2 quad)) + ) ) + (vector+! (-> arg0 follow-pt) (-> *camera* tpos-curr-adj) (-> arg0 follow-off)) + (vector--float*! (-> arg0 follow-pt) (-> arg0 follow-pt) (-> *camera* local-down) (-> *camera* target-height)) ) - (-> arg0 follow-pt) ) + (-> arg0 follow-pt) ) -;; definition for function mat-remove-z-rot -;; Used lq/sq (defun mat-remove-z-rot ((arg0 matrix) (arg1 vector)) (let ((s4-0 (new-stack-vector0))) 0.0 @@ -1400,8 +1328,6 @@ arg0 ) -;; definition for function slave-matrix-blend-2 -;; Used lq/sq (defun slave-matrix-blend-2 ((arg0 matrix) (arg1 float) (arg2 vector) (arg3 matrix)) (let ((s1-0 (new-stack-vector0)) (s4-0 (new-stack-quaternion0)) @@ -1462,8 +1388,6 @@ ) ) -;; definition for function vector-into-frustum-nosmooth! -;; Used lq/sq (defun vector-into-frustum-nosmooth! ((arg0 matrix) (arg1 vector) (arg2 float)) (local-vars (sv-112 (inline-array vector)) (sv-128 vector) (sv-144 vector) (sv-160 vector) (sv-176 vector)) (rlet ((vf0 :class vf) @@ -1580,154 +1504,134 @@ ) ) -;; TODO - fix me! ;; WARN: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; WARN: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; WARN: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defun - slave-set-rotation! - ((arg0 cam-rotation-tracker) - (arg1 vector) - (arg2 float) - (arg3 float) - (arg4 symbol) - ) +(defun slave-set-rotation! ((arg0 cam-rotation-tracker) (arg1 vector) (arg2 float) (arg3 float) (arg4 symbol)) (local-vars - (f0-8 float) - (sv-192 vector) - (sv-208 vector) - (sv-224 matrix) - (sv-240 (function matrix vector float vector)) - (sv-256 matrix) - ) + (f0-8 float) + (sv-192 vector) + (sv-208 vector) + (sv-224 matrix) + (sv-240 (function matrix vector float vector)) + (sv-256 matrix) + ) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) ) - (init-vf0-vector) - (let ((s1-0 (new-stack-vector0)) - (s5-0 (new-stack-matrix0)) - ) - (let ((f30-0 (-> arg0 tilt-adjust value))) - (cond - ((< 0.0001 (-> arg0 point-of-interest-blend value)) - (set! sv-192 (new 'stack-no-clear 'vector)) - 0.0 - (vector-! s1-0 (-> arg0 follow-pt) arg1) - (let ((f28-0 (vector-length s1-0))) - (vector-! sv-192 (-> arg0 point-of-interest) arg1) - (vector-normalize! - sv-192 - (* f28-0 (-> arg0 point-of-interest-blend value)) - ) - (let ((v1-3 s1-0)) - (let ((a0-5 s1-0)) - (.mov.vf vf6 vf0 :mask #b1000) - (.lvf vf4 (&-> a0-5 quad)) + (init-vf0-vector) + (let ((s1-0 (new-stack-vector0)) + (s5-0 (new-stack-matrix0)) ) - (.lvf vf5 (&-> sv-192 quad)) - (.add.vf vf6 vf4 vf5 :mask #b111) - (.svf (&-> v1-3 quad) vf6) - ) - (vector-normalize! s1-0 f28-0) - ) - ) - (else - (vector-! s1-0 (-> arg0 follow-pt) arg1) - ) - ) - (forward-down->inv-matrix s5-0 s1-0 (-> *camera* local-down)) - (when (!= f30-0 0.0) - 0.0 - 0.0 - (set! sv-224 (new 'stack-no-clear 'matrix)) - (set! sv-208 (new 'stack-no-clear 'vector)) - (vector-normalize-copy! sv-208 s1-0 1.0) - (let* ((v1-11 (-> *camera* local-down)) - (f0-7 (-> sv-208 x)) - (f1-1 (-> sv-208 y)) - (f2-0 (-> sv-208 z)) - (f3-0 (-> v1-11 x)) - (f4-0 (-> v1-11 y)) - (f5-0 (-> v1-11 z)) + (let ((f30-0 (-> arg0 tilt-adjust value))) + (cond + ((< 0.0001 (-> arg0 point-of-interest-blend value)) + (set! sv-192 (new 'stack-no-clear 'vector)) + 0.0 + (vector-! s1-0 (-> arg0 follow-pt) arg1) + (let ((f28-0 (vector-length s1-0))) + (vector-! sv-192 (-> arg0 point-of-interest) arg1) + (vector-normalize! sv-192 (* f28-0 (-> arg0 point-of-interest-blend value))) + (let ((v1-3 s1-0)) + (let ((a0-5 s1-0)) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> a0-5 quad)) + ) + (.lvf vf5 (&-> sv-192 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-3 quad) vf6) + ) + (vector-normalize! s1-0 f28-0) ) - ; (.mula.s f0-7 f3-0) - ; (.madda.s f1-1 f4-0) - ; (.madd.s f0-8 f2-0 f5-0) - (set! f0-8 (+ (* f0-7 f3-0) (* f1-1 f4-0) (* f2-0 f5-0))) - ) - (let* ((f28-1 f0-8) - (f0-10 (acos (fabs f28-1))) - ) - (cond - ((< 0.0 f30-0) - (set! f30-0 (if (< 0.0 f28-1) - (fmin f30-0 (fmax 0.0 (+ -2730.6667 f0-10))) - (fmin f30-0 (fmax 0.0 (- 32768.0 (+ 2730.6667 f0-10)))) - ) - ) - ) - ((< f30-0 0.0) - (set! f30-0 (if (< 0.0 f28-1) - (fmax - f30-0 - (- (fmax 0.0 (- 32768.0 (+ 2730.6667 f0-10)))) - ) - (fmax f30-0 (- (fmax 0.0 (+ -2730.6667 f0-10)))) - ) - ) - ) - ) - ) - (matrix-rotate-x! sv-224 f30-0) - (let ((t9-7 matrix*!) - (a0-16 s5-0) - (a2-3 s5-0) + ) + (else + (vector-! s1-0 (-> arg0 follow-pt) arg1) ) - (t9-7 a0-16 sv-224 a2-3) - ) + ) + (forward-down->inv-matrix s5-0 s1-0 (-> *camera* local-down)) + (when (!= f30-0 0.0) + 0.0 + 0.0 + (set! sv-224 (new 'stack-no-clear 'matrix)) + (set! sv-208 (new 'stack-no-clear 'vector)) + (vector-normalize-copy! sv-208 s1-0 1.0) + (let* ((v1-11 (-> *camera* local-down)) + (f0-7 (-> sv-208 x)) + (f1-1 (-> sv-208 y)) + (f2-0 (-> sv-208 z)) + (f3-0 (-> v1-11 x)) + (f4-0 (-> v1-11 y)) + (f5-0 (-> v1-11 z)) + ) + ; (.mula.s f0-7 f3-0) + ; (.madda.s f1-1 f4-0) + ; (.madd.s f0-8 f2-0 f5-0) + (set! f0-8 (+ (* f0-7 f3-0) (* f1-1 f4-0) (* f2-0 f5-0))) + ) + (let* ((f28-1 f0-8) + (f0-10 (acos (fabs f28-1))) + ) + (cond + ((< 0.0 f30-0) + (set! f30-0 (if (< 0.0 f28-1) + (fmin f30-0 (fmax 0.0 (+ -2730.6667 f0-10))) + (fmin f30-0 (fmax 0.0 (- 32768.0 (+ 2730.6667 f0-10)))) + ) + ) + ) + ((< f30-0 0.0) + (set! f30-0 (if (< 0.0 f28-1) + (fmax f30-0 (- (fmax 0.0 (- 32768.0 (+ 2730.6667 f0-10))))) + (fmax f30-0 (- (fmax 0.0 (+ -2730.6667 f0-10)))) + ) + ) + ) + ) + ) + (matrix-rotate-x! sv-224 f30-0) + (let ((t9-7 matrix*!) + (a0-16 s5-0) + (a2-3 s5-0) + ) + (t9-7 a0-16 sv-224 a2-3) + ) + ) + ) + (if (and (= (-> *camera* under-water) 2) *target* (!= (-> *target* next-state name) 'target-swim-up)) + (set! (-> arg0 underwater-blend target) 1.0) + (set! (-> arg0 underwater-blend target) 0.0) + ) + (set! sv-240 vector-into-frustum-nosmooth!) + (set! sv-256 s5-0) + (let ((a2-5 (lerp-clamp arg3 (* 0.25 arg3) (-> arg0 underwater-blend value)))) + (sv-240 sv-256 arg1 a2-5) + ) + (cond + (arg4 + (slave-matrix-blend-2 (-> arg0 inv-mat) arg2 s1-0 s5-0) + ) + (else + (let* ((v1-31 (-> arg0 inv-mat)) + (a3-2 s5-0) + (a0-22 (-> a3-2 vector 0 quad)) + (a1-16 (-> a3-2 vector 1 quad)) + (a2-7 (-> a3-2 vector 2 quad)) + (a3-3 (-> a3-2 vector 3 quad)) + ) + (set! (-> v1-31 vector 0 quad) a0-22) + (set! (-> v1-31 vector 1 quad) a1-16) + (set! (-> v1-31 vector 2 quad) a2-7) + (set! (-> v1-31 vector 3 quad) a3-3) + ) + ) + ) ) - ) - (if - (and - (= (-> *camera* under-water) 2) - *target* - (!= (-> *target* next-state name) 'target-swim-up) - ) - (set! (-> arg0 underwater-blend target) 1.0) - (set! (-> arg0 underwater-blend target) 0.0) - ) - (set! sv-240 vector-into-frustum-nosmooth!) - (set! sv-256 s5-0) - (let - ((a2-5 (lerp-clamp arg3 (* 0.25 arg3) (-> arg0 underwater-blend value)))) - (sv-240 sv-256 arg1 a2-5) - ) - (cond - (arg4 - (slave-matrix-blend-2 (-> arg0 inv-mat) arg2 s1-0 s5-0) - ) - (else - (let* ((v1-31 (-> arg0 inv-mat)) - (a3-2 s5-0) - (a0-22 (-> a3-2 vector 0 quad)) - (a1-16 (-> a3-2 vector 1 quad)) - (a2-7 (-> a3-2 vector 2 quad)) - (a3-3 (-> a3-2 vector 3 quad)) - ) - (set! (-> v1-31 vector 0 quad) a0-22) - (set! (-> v1-31 vector 1 quad) a1-16) - (set! (-> v1-31 vector 2 quad) a2-7) - (set! (-> v1-31 vector 3 quad) a3-3) - ) - ) - ) + (mat-remove-z-rot (-> arg0 inv-mat) (-> *camera* local-down)) + 0 + (none) ) - (mat-remove-z-rot (-> arg0 inv-mat) (-> *camera* local-down)) - 0 - (none) - ) ) ;; WARN: Stack slot offset 144 signed mismatch @@ -1735,118 +1639,105 @@ ;; WARN: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; WARN: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; WARN: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defun - v-slrp2! - ((arg0 vector) - (arg1 vector) - (arg2 vector) - (arg3 float) - (arg4 vector) - (arg5 float) - ) +(defun v-slrp2! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector) (arg5 float)) (local-vars - (f0-10 float) - (f28-0 float) - (f30-0 float) - (sv-144 float) - (sv-160 vector) - (sv-176 matrix) - (sv-192 vector) - ) + (f0-10 float) + (f28-0 float) + (f30-0 float) + (sv-144 float) + (sv-160 vector) + (sv-176 matrix) + (sv-192 vector) + ) (set! sv-144 arg5) (let ((s0-0 (new-stack-vector0))) - (set! sv-160 (new 'stack-no-clear 'vector)) - (set! (-> sv-160 quad) (the-as uint128 0)) - 1.0 - 1.0 - (let ((s3-0 (new-stack-vector0))) - 0.0 + (set! sv-160 (new 'stack-no-clear 'vector)) + (set! (-> sv-160 quad) (the-as uint128 0)) 1.0 - (set! sv-176 (new 'stack-no-clear 'matrix)) - (set! (-> sv-176 vector 0 quad) (the-as uint128 0)) - (set! (-> sv-176 vector 1 quad) (the-as uint128 0)) - (set! (-> sv-176 vector 2 quad) (the-as uint128 0)) - (set! (-> sv-176 vector 3 quad) (the-as uint128 0)) - (cond - ((< 1.0 arg3) - (set! arg3 1.0) - ) - ((< arg3 0.0) - (set! arg3 0.0) - ) - ) - (cond - (arg4 - (vector-flatten! s0-0 arg1 arg4) - (vector-flatten! sv-160 arg2 arg4) - (set! f30-0 (vector-normalize-ret-len! s0-0 1.0)) - (set! f28-0 (vector-normalize-ret-len! sv-160 1.0)) - (vector-normalize! (vector-cross! s3-0 sv-160 s0-0) 1.0) - (let ((f26-0 (vector-dot arg4 s3-0))) - (vector-normalize-copy! s3-0 arg4 1.0) - (if (< f26-0 0.0) - (vector-negate! s3-0 s3-0) + 1.0 + (let ((s3-0 (new-stack-vector0))) + 0.0 + 1.0 + (set! sv-176 (new 'stack-no-clear 'matrix)) + (set! (-> sv-176 vector 0 quad) (the-as uint128 0)) + (set! (-> sv-176 vector 1 quad) (the-as uint128 0)) + (set! (-> sv-176 vector 2 quad) (the-as uint128 0)) + (set! (-> sv-176 vector 3 quad) (the-as uint128 0)) + (cond + ((< 1.0 arg3) + (set! arg3 1.0) + ) + ((< arg3 0.0) + (set! arg3 0.0) + ) ) - ) - ) - (else - (set! (-> s0-0 quad) (-> arg1 quad)) - (set! (-> sv-160 quad) (-> arg2 quad)) - (set! f30-0 (vector-normalize-ret-len! s0-0 1.0)) - (set! f28-0 (vector-normalize-ret-len! sv-160 1.0)) - (vector-normalize! (vector-cross! s3-0 arg2 arg1) 1.0) - ) - ) - (let ((t9-10 acos)) - (let* ((v1-18 s0-0) - (f0-9 (-> v1-18 x)) - (f1-2 (-> v1-18 y)) - (f2-0 (-> v1-18 z)) - (f3-0 (-> sv-160 x)) - (f4-0 (-> sv-160 y)) - (f5-0 (-> sv-160 z)) + (cond + (arg4 + (vector-flatten! s0-0 arg1 arg4) + (vector-flatten! sv-160 arg2 arg4) + (set! f30-0 (vector-normalize-ret-len! s0-0 1.0)) + (set! f28-0 (vector-normalize-ret-len! sv-160 1.0)) + (vector-normalize! (vector-cross! s3-0 sv-160 s0-0) 1.0) + (let ((f26-0 (vector-dot arg4 s3-0))) + (vector-normalize-copy! s3-0 arg4 1.0) + (if (< f26-0 0.0) + (vector-negate! s3-0 s3-0) + ) ) - (set! f0-10 (+ (* f2-0 f5-0) (* f1-2 f4-0) (* f0-9 f3-0))) - ; (.mula.s f0-9 f3-0) - ; (.madda.s f1-2 f4-0) - ; (.madd.s f0-10 f2-0 f5-0) - ) - (let* ((f1-3 (t9-10 f0-10)) - (f0-12 (* arg3 f1-3)) + ) + (else + (set! (-> s0-0 quad) (-> arg1 quad)) + (set! (-> sv-160 quad) (-> arg2 quad)) + (set! f30-0 (vector-normalize-ret-len! s0-0 1.0)) + (set! f28-0 (vector-normalize-ret-len! sv-160 1.0)) + (vector-normalize! (vector-cross! s3-0 arg2 arg1) 1.0) + ) + ) + (let ((t9-10 acos)) + (let* ((v1-18 s0-0) + (f0-9 (-> v1-18 x)) + (f1-2 (-> v1-18 y)) + (f2-0 (-> v1-18 z)) + (f3-0 (-> sv-160 x)) + (f4-0 (-> sv-160 y)) + (f5-0 (-> sv-160 z)) + ) + ; (.mula.s f0-9 f3-0) + ; (.madda.s f1-2 f4-0) + ; (.madd.s f0-10 f2-0 f5-0) + (set! f0-10 (+ (* f2-0 f5-0) (* f1-2 f4-0) (* f0-9 f3-0))) + ) + (let* ((f1-3 (t9-10 f0-10)) + (f0-12 (* arg3 f1-3)) + ) + (when (< sv-144 f0-12) + (set! f0-12 sv-144) + (set! arg3 (/ sv-144 f1-3)) ) - (when (< sv-144 f0-12) - (set! f0-12 sv-144) - (set! arg3 (/ sv-144 f1-3)) - ) - (let* ((f0-13 (cos f0-12)) - (t9-12 matrix-axis-sin-cos!) - (a0-20 sv-176) - (a1-13 s3-0) - (f1-5 1.0) - (f2-3 f0-13) - ) - (t9-12 a0-20 a1-13 (sqrtf (- f1-5 (* f2-3 f2-3))) f0-13) - ) + (let* ((f0-13 (cos f0-12)) + (t9-12 matrix-axis-sin-cos!) + (a0-20 sv-176) + (a1-13 s3-0) + (f1-5 1.0) + (f2-3 f0-13) + ) + (t9-12 a0-20 a1-13 (sqrtf (- f1-5 (* f2-3 f2-3))) f0-13) + ) + ) + ) + (vector-matrix*! arg0 s0-0 sv-176) + (let ((s0-1 vector-normalize!)) + (set! sv-192 arg0) + (let ((a1-16 (lerp f30-0 f28-0 arg3))) + (s0-1 sv-192 a1-16) + ) + ) + (when arg4 + (vector+float*! arg0 arg0 s3-0 (vector-dot arg1 s3-0)) + (vector+float*! arg0 arg0 s3-0 (* arg3 (vector-dot (vector-! (new-stack-vector0) arg2 arg1) s3-0))) + ) ) - ) - (vector-matrix*! arg0 s0-0 sv-176) - (let ((s0-1 vector-normalize!)) - (set! sv-192 arg0) - (let ((a1-16 (lerp f30-0 f28-0 arg3))) - (s0-1 sv-192 a1-16) - ) - ) - (when arg4 - (vector+float*! arg0 arg0 s3-0 (vector-dot arg1 s3-0)) - (vector+float*! - arg0 - arg0 - s3-0 - (* arg3 (vector-dot (vector-! (new-stack-vector0) arg2 arg1) s3-0)) - ) - ) ) - ) arg0 ) @@ -1855,93 +1746,80 @@ ;; WARN: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; WARN: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; WARN: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defun - v-slrp3! - ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) - (local-vars - (f0-7 float) - (f26-0 float) - (f28-0 float) - (sv-144 float) - (sv-160 vector) - ) +(defun v-slrp3! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) + (local-vars (f0-7 float) (f26-0 float) (f28-0 float) (sv-144 float) (sv-160 vector)) (set! sv-144 arg4) (let ((s1-0 (new-stack-vector0))) - (set! sv-160 (new 'stack-no-clear 'vector)) - (set! (-> sv-160 quad) (the-as uint128 0)) - 0.0 - 0.0 - (let ((s3-0 (new-stack-vector0)) - (f30-0 1.0) - ) + (set! sv-160 (new 'stack-no-clear 'vector)) + (set! (-> sv-160 quad) (the-as uint128 0)) 0.0 - (let ((s0-0 (new-stack-matrix0))) - (cond - (arg3 - (vector-flatten! s1-0 arg1 arg3) - (vector-flatten! sv-160 arg2 arg3) - (set! f28-0 (vector-normalize-ret-len! s1-0 1.0)) - (set! f26-0 (vector-normalize-ret-len! sv-160 1.0)) - (vector-normalize! (vector-cross! s3-0 sv-160 s1-0) 1.0) - (let ((f24-0 (vector-dot arg3 s3-0))) - (vector-normalize-copy! s3-0 arg3 1.0) - (if (< f24-0 0.0) - (vector-negate! s3-0 s3-0) - ) - ) - ) - (else - (set! (-> s1-0 quad) (-> arg1 quad)) - (set! (-> sv-160 quad) (-> arg2 quad)) - (set! f28-0 (vector-normalize-ret-len! s1-0 1.0)) - (set! f26-0 (vector-normalize-ret-len! sv-160 1.0)) - (vector-normalize! (vector-cross! s3-0 arg2 arg1) 1.0) - ) - ) - (let ((t9-10 acos)) - (let* ((v1-9 s1-0) - (f0-6 (-> v1-9 x)) - (f1-0 (-> v1-9 y)) - (f2-0 (-> v1-9 z)) - (f3-0 (-> sv-160 x)) - (f4-0 (-> sv-160 y)) - (f5-0 (-> sv-160 z)) - ) - ; (.mula.s f0-6 f3-0) - ; (.madda.s f1-0 f4-0) - ; (.madd.s f0-7 f2-0 f5-0) - (set! f0-7 (+ (* f0-6 f3-0) (* f1-0 f4-0) (* f2-0 f5-0))) - ) - (let ((f0-8 (t9-10 f0-7))) - (when (< sv-144 f0-8) - (set! f30-0 (/ sv-144 f0-8)) - (set! f0-8 sv-144) - ) - (let* ((f0-9 (cos f0-8)) - (t9-12 matrix-axis-sin-cos!) - (a0-20 s0-0) - (a1-13 s3-0) - (f1-3 1.0) - (f2-1 f0-9) + 0.0 + (let ((s3-0 (new-stack-vector0)) + (f30-0 1.0) + ) + 0.0 + (let ((s0-0 (new-stack-matrix0))) + (cond + (arg3 + (vector-flatten! s1-0 arg1 arg3) + (vector-flatten! sv-160 arg2 arg3) + (set! f28-0 (vector-normalize-ret-len! s1-0 1.0)) + (set! f26-0 (vector-normalize-ret-len! sv-160 1.0)) + (vector-normalize! (vector-cross! s3-0 sv-160 s1-0) 1.0) + (let ((f24-0 (vector-dot arg3 s3-0))) + (vector-normalize-copy! s3-0 arg3 1.0) + (if (< f24-0 0.0) + (vector-negate! s3-0 s3-0) + ) ) - (t9-12 a0-20 a1-13 (sqrtf (- f1-3 (* f2-1 f2-1))) f0-9) + ) + (else + (set! (-> s1-0 quad) (-> arg1 quad)) + (set! (-> sv-160 quad) (-> arg2 quad)) + (set! f28-0 (vector-normalize-ret-len! s1-0 1.0)) + (set! f26-0 (vector-normalize-ret-len! sv-160 1.0)) + (vector-normalize! (vector-cross! s3-0 arg2 arg1) 1.0) + ) + ) + (let ((t9-10 acos)) + (let* ((v1-9 s1-0) + (f0-6 (-> v1-9 x)) + (f1-0 (-> v1-9 y)) + (f2-0 (-> v1-9 z)) + (f3-0 (-> sv-160 x)) + (f4-0 (-> sv-160 y)) + (f5-0 (-> sv-160 z)) + ) + ; (.mula.s f0-6 f3-0) + ; (.madda.s f1-0 f4-0) + ; (.madd.s f0-7 f2-0 f5-0) + (set! f0-7 (+ (* f0-6 f3-0) (* f1-0 f4-0) (* f2-0 f5-0))) + ) + (let ((f0-8 (t9-10 f0-7))) + (when (< sv-144 f0-8) + (set! f30-0 (/ sv-144 f0-8)) + (set! f0-8 sv-144) + ) + (let* ((f0-9 (cos f0-8)) + (t9-12 matrix-axis-sin-cos!) + (a0-20 s0-0) + (a1-13 s3-0) + (f1-3 1.0) + (f2-1 f0-9) + ) + (t9-12 a0-20 a1-13 (sqrtf (- f1-3 (* f2-1 f2-1))) f0-9) + ) + ) + ) + (vector-matrix*! arg0 s1-0 s0-0) + ) + (vector-normalize! arg0 (lerp f28-0 f26-0 f30-0)) + (when arg3 + (vector+float*! arg0 arg0 s3-0 (vector-dot arg1 s3-0)) + (vector+float*! arg0 arg0 s3-0 (* f30-0 (vector-dot (vector-! (new-stack-vector0) arg2 arg1) s3-0))) ) - ) ) - (vector-matrix*! arg0 s1-0 s0-0) - ) - (vector-normalize! arg0 (lerp f28-0 f26-0 f30-0)) - (when arg3 - (vector+float*! arg0 arg0 s3-0 (vector-dot arg1 s3-0)) - (vector+float*! - arg0 - arg0 - s3-0 - (* f30-0 (vector-dot (vector-! (new-stack-vector0) arg2 arg1) s3-0)) - ) - ) ) - ) arg0 ) diff --git a/goal_src/engine/camera/math-camera-h.gc b/goal_src/engine/camera/math-camera-h.gc index 1aa3b6719f..73809008ac 100644 --- a/goal_src/engine/camera/math-camera-h.gc +++ b/goal_src/engine/camera/math-camera-h.gc @@ -5,11 +5,9 @@ ;; name in dgo: math-camera-h ;; dgos: GAME, ENGINE - -;; The math-camera is a global that contains camera projection and culling matrices. -;; Note that it doesn't take into account the position/rotation of the game camera, but -;; just computes the projection matrix/culling stuff and the camera stuff will have to -;; rotate and translate it as needed. +;; The "math-camera" is responsible for computing the projection matrix used in the renderer +;; from the position of the in-game camera. It also computes some other common camera info. +;; See cam-update.gc for how the game camera updates the math-camera. ;; It also contains some GIF stuff, but these seem to be wrong/unused. ;; Some of the code here may be extremely old and unused, but this does compute the camera projection diff --git a/goal_src/engine/camera/math-camera.gc b/goal_src/engine/camera/math-camera.gc index 19226ad012..b7728d28be 100644 --- a/goal_src/engine/camera/math-camera.gc +++ b/goal_src/engine/camera/math-camera.gc @@ -5,8 +5,34 @@ ;; name in dgo: math-camera ;; dgos: GAME, ENGINE -;; The fog-corrector stores a fog-end fog-start value that is somehow -;; corrected for the field of view. + +;;;;;;;;;;;;;;;;;;;;;; +;; math camera basics +;;;;;;;;;;;;;;;;;;;;;; + +;; the math camera computes the perspective matrix, hvdf offset, and hmge scale. + +;; multiplying a point by the perspective matrix, doing the persepctive divide, then adding hvdf offset gives you: +;; H : horizontal position (in GS coordinates) +;; V : vertical position (in GS coordinates) +;; D : depth (as a 24-bit integer for the z buffer) +;; F : fog + +;; Multiplying by hmge then checking the clipping flags can be used to see if a point is outside the view frustum. + +;; The "camera-temp" matrix is the perspective matrix multplied by the camera tranformation and is used +;; renderers that want a single matrix. + +;;;;;;;;;;;;;;;;;;; +;; fog correction +;;;;;;;;;;;;;;;;;;; + +;; The math-camera matrices are used to compute fogging values, which are a per-vertex uint8 that +;; tells the GS how "foggy" the color should be. This should be proportional to how far away the vertex +;; is. There is a scaling factor applied so the fog intensity isn't affected by the field of view angle. + +;; The fog-corrector stores a fog-end fog-start value that is corrected for the field of view. +;; the actual correction factor is computed in cam-update.gc (deftype fog-corrector (structure) ((fog-end float :offset-assert 0) (fog-start float :offset-assert 4) @@ -23,8 +49,6 @@ (none) ) -;; create the single global fog corrector -;; it appears to be unused. (define *math-camera-fog-correction* (new 'global 'fog-corrector)) (define-extern sprite-distorter-generate-tables (function none)) @@ -139,7 +163,7 @@ (max-depth 16760631.0) ;; almost 2^24. ) (let ((f0-21 16777115.0))) ;; unused. this is actually float closest to 2^24 - + ;; next, compute the fog slope d(8bit_integer_fog_value)/d(game_world_distance). ;; the final fog values we want are an 8-bit integer. ;; note that this is the fog at the near plane too. @@ -157,7 +181,7 @@ (let ((half-depth-buffer-slope (/ depth-buffer-half-range (* (-> math-cam d) (- (-> math-cam f) (-> math-cam d))))) (cam-fov-mult (-> math-cam fov-correction-factor)) ) - + ;; finally, build the actual matrix. ;; x/y are just the usual scaling (set! (-> math-cam perspective vector 0 x) (* cam-fov-mult (- (/ (-> math-cam x-pix) (* (-> math-cam x-ratio) (-> math-cam d)))))) @@ -166,7 +190,7 @@ (set! (-> math-cam perspective vector 2 z) (* cam-fov-mult (+ (-> math-cam f) (-> math-cam d)) half-depth-buffer-slope)) ;; depth to fog (set! (-> math-cam perspective vector 2 w) (* (/ cam-fov-mult (-> math-cam d)) fog-slope)) - + (set! (-> math-cam perspective vector 3 z) (* -2.0 half-depth-buffer-slope (-> math-cam f) (-> math-cam d) cam-fov-mult)) ) @@ -211,7 +235,7 @@ ;; #x4b002032 -> #x4b002031 (set! (-> math-cam isometric vector 3 z) (the-as float (- (the-as int (-> math-cam isometric vector 3 z)) 1))) ) - + ) (set! (-> math-cam isometric vector 3 w) fog-slope) @@ -327,7 +351,9 @@ ) (defun move-target-from-pad ((trans transform) (pad-idx int)) - "Unused function to adjust trans based on inputs from the pad." + "Unused function to adjust trans based on inputs from the pad. + This function must be extremely old because it takes a non-quaternion transform, + and all target stuff uses quaternions." ;; local-trans is the translation in the camera frame. (let ((local-trans (new-stack-vector0))) @@ -474,7 +500,7 @@ (init-vf0-vector) (let ((v1-0 0)) ) - + ;; this camera matrix has both the projection and camera translation/rotation (.lvf vf24 (&-> *math-camera* camera-temp vector 0 quad)) (.lvf vf25 (&-> *math-camera* camera-temp vector 1 quad)) @@ -489,21 +515,21 @@ ;; input point (.lvf vf28 (&-> arg1 quad)) - + ;; matrix multiply, result in vf28 (.mul.x.vf acc vf24 vf28) (.add.mul.y.vf acc vf25 vf28 acc) (.add.mul.z.vf acc vf26 vf28 acc) (.add.mul.w.vf vf28 vf27 vf0 acc) - + (.add.w.vf vf23 vf0 vf0) ;; set w = 1.0 ;; apply hmge scaling. the result of this multiply sets clipping flags appropriately (.mul.vf vf31 vf28 vf29) ;; scale. ;;(TODO.VCLIP vf31 vf31) (let ((clip (vu-clip vf31 0))) ;; clip! - + ;; perspective divide (.div.vf Q vf0 vf31 :fsf #b11 :ftf #b11) (.wait.vf) diff --git a/goal_src/engine/camera/pov-camera-h.gc b/goal_src/engine/camera/pov-camera-h.gc index 6b70f5aa5b..19bcdbf7f5 100644 --- a/goal_src/engine/camera/pov-camera-h.gc +++ b/goal_src/engine/camera/pov-camera-h.gc @@ -22,15 +22,15 @@ ;; for example, the introduction to orbs in geyser, or the camera that shows you where the steps to fire canyon ;; are. (deftype pov-camera (process-drawable) - ((cspace-array cspace-array :offset 112) - (flags pov-camera-flag :offset-assert 176) - (debounce-start-time time-frame :offset-assert 184) - (notify-handle handle :offset-assert 192) - (anim-name string :offset-assert 200) - (command-list pair :offset-assert 204) - (mask-to-clear uint32 :offset-assert 208) - (music-volume-movie float :offset-assert 212) - (sfx-volume-movie float :offset-assert 216) + ((cspace-array cspace-array :offset 112) + (flags pov-camera-flag :offset-assert 176) + (debounce-start-time time-frame :offset-assert 184) + (notify-handle handle :offset-assert 192) + (anim-name string :offset-assert 200) + (command-list pair :offset-assert 204) + (mask-to-clear process-mask :offset-assert 208) + (music-volume-movie float :offset-assert 212) + (sfx-volume-movie float :offset-assert 216) ) :heap-base #x70 :method-count-assert 30 diff --git a/goal_src/engine/camera/pov-camera.gc b/goal_src/engine/camera/pov-camera.gc index 21b79fc919..c641328d40 100644 --- a/goal_src/engine/camera/pov-camera.gc +++ b/goal_src/engine/camera/pov-camera.gc @@ -32,8 +32,7 @@ (defstate pov-camera-startup (pov-camera) :virtual #t - :code - (behavior () + :code (behavior () (go-virtual pov-camera-start-playing) (none) ) @@ -41,8 +40,7 @@ (defstate pov-camera-start-playing (pov-camera) :virtual #t - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (while (not (target-grabbed? self)) (suspend) @@ -53,16 +51,7 @@ (set! gp-0 (+ (-> v1-7 number) 1)) ) ) - (let* ((s5-0 (get-process *default-dead-pool* othercam #x4000)) - (v1-10 (when s5-0 - (let ((t9-3 (method-of-type othercam activate))) - (t9-3 (the-as othercam s5-0) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 othercam-init-by-other self gp-0 #t #t) - (-> s5-0 ppointer) - ) - ) - ) + (let ((v1-10 (process-spawn othercam self gp-0 #t #t :to self))) (send-event (ppointer->process v1-10) 'mask (-> self mask-to-clear)) ) ) @@ -73,40 +62,16 @@ (defbehavior pov-camera-play-and-reposition pov-camera ((arg0 art-joint-anim) (arg1 vector) (arg2 float)) (let ((s4-0 #f)) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) arg0) - (set! (-> v1-2 param 0) (the float (+ (-> arg0 data 0 length) -1))) - (set! (-> v1-2 param 1) arg2) - (set! (-> v1-2 frame-num) 0.0) - (joint-control-channel-group! v1-2 arg0 num-func-seek!) - ) + (ja-no-eval :group! arg0 :num! (seek! max arg2) :frame-num 0.0) (until (ja-done? 0) - (let ((v1-4 (and (not s4-0) (< (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -4 - ) - ) - (ja-frame-num 0) - ) - ) - ) - ) + (let ((v1-4 (and (not s4-0) (< (the float (+ (-> (ja-group) data 0 length) -4)) (ja-frame-num 0))))) (when v1-4 (set! s4-0 #t) (send-event *camera* 'teleport-to-vector-start-string arg1) ) ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) arg2) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max arg2)) ) ) 0 @@ -115,8 +80,7 @@ (defstate pov-camera-playing (pov-camera) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('abort) (when (logtest? (-> self flags) (pov-camera-flag notify-of-abort)) @@ -128,63 +92,31 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self debounce-start-time) (-> *display* base-frame-counter)) (if (= (-> self anim-name type) string) (backup-load-state-and-set-cmds *load-state* (-> self command-list)) ) (none) ) - :exit - (behavior () + :exit (behavior () (if (= (-> self anim-name type) string) (restore-load-state-and-cleanup *load-state*) ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) (none) ) - :code - (behavior () - (push-setting! *setting-control* self 'music-volume 'rel (-> self music-volume-movie) 0) - (push-setting! *setting-control* self 'sfx-volume 'rel (-> self sfx-volume-movie) 0) + :code (behavior () + (add-setting! 'music-volume 'rel (-> self music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> self sfx-volume-movie) 0) (cond ((= (-> self anim-name type) string) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! - a0-4 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (check-for-abort self) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((= (-> self anim-name type) spool-anim) @@ -199,8 +131,7 @@ (go-virtual pov-camera-done-playing) (none) ) - :post - (behavior () + :post (behavior () (if (= (-> self anim-name type) string) (execute-commands-up-to *load-state* (ja-aframe-num 0)) ) @@ -211,14 +142,12 @@ (defstate pov-camera-abort (pov-camera) :virtual #t - :enter - (behavior () + :enter (behavior () (logior! (-> self flags) (pov-camera-flag allow-abort)) (none) ) - :code - (behavior () - (set-blackout-frames (seconds 0.033333335)) + :code (behavior () + (set-blackout-frames (seconds 0.035)) (suspend) (suspend) (go-virtual pov-camera-done-playing) @@ -228,8 +157,7 @@ (defstate pov-camera-done-playing (pov-camera) :virtual #t - :code - (behavior () + :code (behavior () (while (begin self (not ((method-of-object self target-released?)))) (suspend) ) @@ -293,14 +221,14 @@ ((= (-> arg2 type) spool-anim) ) ) - (set! (-> self mask-to-clear) (the-as uint #x4a0800)) + (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) (set! (-> self event-hook) (lambda :behavior pov-camera ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'mask) (let ((v0-0 (the-as number (-> arg3 param 0)))) - (set! (-> self mask-to-clear) (the-as uint v0-0)) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) v0-0 ) ) diff --git a/goal_src/engine/collide/collide-cache-h.gc b/goal_src/engine/collide/collide-cache-h.gc index 992b7ce9f6..25cfb10174 100644 --- a/goal_src/engine/collide/collide-cache-h.gc +++ b/goal_src/engine/collide/collide-cache-h.gc @@ -20,7 +20,7 @@ (num-spheres uint32 :offset-assert 4) (collide-with collide-kind :offset-assert 8) (proc process-drawable :offset-assert 16) - (ignore-pat uint32 :offset-assert 20) + (ignore-pat pat-surface :offset-assert 20) (solid-only basic :offset-assert 24) ) :method-count-assert 9 @@ -131,17 +131,17 @@ :flag-assert #x2100008670 (:methods (debug-draw (_type_) none 9) - (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result int) float 10) + (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result pat-surface) float 10) (fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol 11) - (fill-and-probe-using-y-probe (_type_ vector float collide-kind process collide-tri-result uint) float 12) + (fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float 12) (fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none 13) - (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable int) none 14) + (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable pat-surface) none 14) (fill-using-spheres (_type_ collide-using-spheres-params) none 15) - (fill-using-y-probe (_type_ vector float collide-kind process-drawable uint) none 16) + (fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none 16) (initialize (_type_) none 17) - (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result int) float 18) + (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float 18) (probe-using-spheres (_type_ collide-using-spheres-params) symbol 19) - (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result uint) float 20) + (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20) (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none 21) ;; second functiom is method 28 (fill-from-foreground-using-box (_type_) none 22) (fill-from-foreground-using-line-sphere (_type_) none 23) diff --git a/goal_src/engine/collide/collide-cache.gc b/goal_src/engine/collide/collide-cache.gc index 93ec127b5c..800af98612 100644 --- a/goal_src/engine/collide/collide-cache.gc +++ b/goal_src/engine/collide/collide-cache.gc @@ -12,14 +12,14 @@ (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> gp-0 pat mode) color) a 64))) (add-debug-flat-triangle #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> gp-0 vertex)) (-> gp-0 vertex 1) (-> gp-0 vertex 2) t1-0 ) (#when PC_PORT - (add-debug-outline-triangle #t (bucket-id debug-draw1) (-> gp-0 vertex 0) (-> gp-0 vertex 1) (-> gp-0 vertex 2) + (add-debug-outline-triangle #t (bucket-id debug-no-zbuf) (-> gp-0 vertex 0) (-> gp-0 vertex 1) (-> gp-0 vertex 2) (static-rgba 0 0 0 64) ) ) @@ -40,7 +40,7 @@ ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> gp-1 prim-core)) (-> gp-1 prim-core world-sphere w) t0-1 @@ -102,16 +102,16 @@ (import-mesh-func (function collide-cache object none)) ) "This terrible function fills the collide cache with background tris from a bounding box." - + (local-vars (a0-4 int) (a0-6 int)) - + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Step 1: Build Collide List ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - + ;; this is a list of fragments that we will look at. - - + + (set! (-> *collide-list* num-items) 0) (cond ((= bsp-find-mesh-func (method-of-type bsp-header collide-ray)) @@ -137,14 +137,14 @@ ) ) ) - - + + (when (> (-> *collide-list* num-items) 0) - + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Step 2: Upload to VU0 Data ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - + ;; in classic ND style, this is double buffered. ;; we'll undo this. (dotimes (i (-> *collide-list* num-items)) @@ -157,14 +157,14 @@ (import-mesh-func obj (-> frag mesh)) ) ) - + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Fake it as a prim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - + ;; The old system can actually read out lists of prims. ;; Note that this assumes the cache has been emptied and we're the first to fill it here. - + (let ((a0-28 (-> obj num-tris))) (when (> a0-28 0) (let ((v1-55 (-> obj prims)) @@ -180,7 +180,7 @@ ) ) ) - + ) 0 (none) @@ -384,6 +384,8 @@ (set! (-> v1-5 mesh) (-> obj mesh)) (set! (-> v1-5 inst) #f) ) + ; (add-debug-sphere #t (bucket-id debug) (-> obj bsphere) (-> obj bsphere w) (new 'static 'rgba :g #x80 :a #x80)) + ; (format 0 "~f~%" (-> obj bsphere w)) (+! (-> arg1 num-items) 1) ) (&+! obj 32) @@ -427,7 +429,7 @@ ;; Y PROBE ;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod fill-using-y-probe collide-cache ((obj collide-cache) (arg0 vector) (arg1 float) (arg2 collide-kind) (arg3 process-drawable) (arg4 uint)) +(defmethod fill-using-y-probe collide-cache ((obj collide-cache) (arg0 vector) (arg1 float) (arg2 collide-kind) (arg3 process-drawable) (arg4 pat-surface)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -602,7 +604,7 @@ (arg2 float) (arg3 collide-kind) (arg4 process-drawable) - (arg5 int) + (arg5 pat-surface) ) (local-vars (zero uint128) @@ -652,7 +654,7 @@ (.mul.vf vf8 vf3 vf3) (let ((v1-1 *collide-work*)) (.add.vf vf2 vf1 vf3) - (set! (-> obj ignore-mask) (the-as pat-surface arg5)) + (set! (-> obj ignore-mask) arg5) (.mov t0-1 vf21) (nop!) (pabsw-hack t0-2 t0-1) ;; t0-2 is the line, absolute value @@ -663,7 +665,7 @@ ) (let ((s2-0 (new 'stack-no-clear 'bounding-box))) (set-from-point-offset-pad! s2-0 (the-as vector3s arg0) (the-as vector3s arg1) arg2) - (fill-using-bounding-box obj s2-0 arg3 arg4 (the-as pat-surface arg5)) + (fill-using-bounding-box obj s2-0 arg3 arg4 arg5) ) (b! #t cfg-13 :delay (nop!)) (set! v1-1 (the-as collide-work 0)) @@ -899,7 +901,7 @@ to the given collide-list. Note: collide-probe is the faster implementation of this." *collide-work* - + ;; just iterate over all and check their bsphere. (dotimes (s3-0 arg0) (when (collide-cache-using-line-sphere-test (-> obj bsphere)) @@ -921,7 +923,7 @@ If the bsphere of the mesh is in the non-aligned bounding box, the mesh will be added to the given collide-list. Note: collide-probe is the faster implementation of this." - + ;; loop over instance-ties (dotimes (s3-0 arg0) ;; first check the instance-tie's bsphere @@ -2214,15 +2216,15 @@ (arg0 vector) (arg1 float) (arg2 collide-kind) - (arg3 process) + (arg3 process-drawable) (arg4 collide-tri-result) - (arg5 uint) + (arg5 pat-surface) ) - (fill-using-y-probe obj arg0 arg1 arg2 (the-as process-drawable arg3) arg5) + (fill-using-y-probe obj arg0 arg1 arg2 arg3 arg5) (probe-using-y-probe obj arg0 arg1 arg2 arg4 arg5) ) -(defmethod probe-using-y-probe collide-cache ((obj collide-cache) (arg0 vector) (arg1 float) (arg2 collide-kind) (arg3 collide-tri-result) (arg4 uint)) +(defmethod probe-using-y-probe collide-cache ((obj collide-cache) (arg0 vector) (arg1 float) (arg2 collide-kind) (arg3 collide-tri-result) (arg4 pat-surface)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf3 :class vf) @@ -2232,7 +2234,7 @@ (.mov vf3 arg1) (.lvf vf1 (&-> arg0 quad)) (set! (-> gp-0 best-u) 2.0) - (set! (-> gp-0 ignore-pat) (the-as pat-surface arg4)) + (set! (-> gp-0 ignore-pat) arg4) (set! (-> gp-0 tri-out) arg3) (.sub.x.vf vf3 vf0 vf3 :mask #b10) (.svf (&-> gp-0 start-pos quad) vf1) @@ -2248,10 +2250,7 @@ (puyp-mesh obj gp-0 (the-as collide-cache-prim s2-0)) ) (else - (if (zero? (logand (the-as pat-surface arg4) - (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s2-0) prim)) pat) - ) - ) + (if (zero? (logand arg4 (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s2-0) prim)) pat))) (puyp-sphere obj gp-0 (the-as collide-cache-prim s2-0)) ) ) @@ -2310,14 +2309,14 @@ (arg3 collide-kind) (arg4 process) (arg5 collide-tri-result) - (arg6 int) + (arg6 pat-surface) ) (fill-using-line-sphere obj arg0 arg1 arg2 arg3 (the-as process-drawable arg4) arg6) (probe-using-line-sphere obj arg0 arg1 arg2 arg3 arg5 arg6) ) (deftype collide-puls-work (structure) - ((ignore-pat uint32 :offset-assert 0) + ((ignore-pat pat-surface :offset-assert 0) (tri-out collide-tri-result :offset-assert 4) (bsphere sphere :inline :offset-assert 16) (move-dist vector :inline :offset-assert 32) @@ -2326,15 +2325,15 @@ :size-assert #x30 :flag-assert #x900000030 ) - - + + (defmethod probe-using-line-sphere collide-cache ((obj collide-cache) (arg0 vector) (arg1 vector) (arg2 float) (arg3 collide-kind) (arg4 collide-tri-result) - (arg5 int) + (arg5 pat-surface) ) (rlet ((vf0 :class vf) (vf2 :class vf) @@ -2346,7 +2345,7 @@ (.mov vf4 arg2) (.lvf vf3 (&-> arg0 quad)) (.lvf vf2 (&-> arg1 quad)) - (set! (-> s4-0 ignore-pat) (the-as uint arg5)) + (set! (-> s4-0 ignore-pat) arg5) (.mul.x.vf vf3 vf0 vf4 :mask #b1000) (set! (-> s4-0 tri-out) arg4) (.svf (&-> s4-0 move-dist quad) vf2) @@ -2376,7 +2375,7 @@ ) ) (else - (when (zero? (logand (the-as pat-surface arg5) + (when (zero? (logand arg5 (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s3-0) prim)) pat) ) ) @@ -2509,7 +2508,7 @@ ) (when v1-12 ;; uncomment to view the point that blocks you from exiting duck. - ;;(add-debug-point #t (bucket-id debug-draw1) (-> s5-0 closest-pt)) + ;;(add-debug-point #t (bucket-id debug-no-zbuf) (-> s5-0 closest-pt)) (return #t) ) ) diff --git a/goal_src/engine/collide/collide-edge-grab.gc b/goal_src/engine/collide/collide-edge-grab.gc index f3a0729204..bb5c41ce80 100644 --- a/goal_src/engine/collide/collide-edge-grab.gc +++ b/goal_src/engine/collide/collide-edge-grab.gc @@ -21,7 +21,7 @@ (set! (-> gp-0 num-verts) (the-as uint 0)) (set! (-> gp-0 num-edges) (the-as uint 0)) (set! (-> gp-0 num-tris) (the-as uint 0)) - + (let ((v1-0 (-> obj control))) (set! (-> gp-0 ccache) arg0) (.lvf vf1 (&-> gp-0 local-cache-fill-box min quad)) @@ -46,7 +46,7 @@ (.svf (&-> gp-0 within-reach-box max quad) vf5) (.svf (&-> gp-0 within-reach-box4w min quad) vf6) (.svf (&-> gp-0 within-reach-box4w max quad) vf7) - + ;; Fill the collide cache! (fill-using-bounding-box arg0 @@ -55,14 +55,14 @@ obj (new 'static 'pat-surface :skip #x1 :noentity #x1) ) - + ;; Filter out tris that can't be grabbed (find-grabbable-tris! gp-0) (when (nonzero? (-> gp-0 num-tris)) ;; Find edges that we might be able to grab (find-grabbable-edges! gp-0) (when (nonzero? (-> gp-0 num-edges)) - ;; + ;; (set! (-> gp-0 search-pt quad) (-> *target* control unknown-vector90 quad)) ;; for the search, we either use the direction of the stick, or the heading of target. (when (!= (-> *cpad-list* cpads (-> *target* control unknown-cpad-info00 number) stick0-speed) 0.0) @@ -195,7 +195,7 @@ (set! (-> a1-13 num-spheres) (the-as uint 12)) (set! (-> a1-13 collide-with) (-> obj cshape root-prim collide-with)) (set! (-> a1-13 proc) #f) - (set! (-> a1-13 ignore-pat) (the-as uint 1)) + (set! (-> a1-13 ignore-pat) (new 'static 'pat-surface :noentity #x1)) (set! (-> a1-13 solid-only) #t) (if (probe-using-spheres (-> obj ccache) a1-13) (return #f) @@ -331,7 +331,7 @@ (set! (-> a1-14 num-spheres) (the-as uint 6)) (set! (-> a1-14 collide-with) (-> v1-22 cshape root-prim collide-with)) (set! (-> a1-14 proc) #f) - (set! (-> a1-14 ignore-pat) (the-as uint 1)) + (set! (-> a1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1)) (set! (-> a1-14 solid-only) #t) (b! #t cfg-21 :delay (nop!)) (label cfg-20) @@ -339,7 +339,7 @@ (set! (-> a1-14 num-spheres) (the-as uint 6)) (set! (-> a1-14 collide-with) (-> v1-22 cshape root-prim collide-with)) (set! (-> a1-14 proc) #f) - (set! (-> a1-14 ignore-pat) (the-as uint 1)) + (set! (-> a1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1)) (set! (-> a1-14 solid-only) #t) (label cfg-21) (b! (not (fill-and-probe-using-spheres *collide-cache* a1-14)) cfg-24) @@ -551,7 +551,7 @@ (defmethod debug-draw edge-grab-info ((obj edge-grab-info)) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> obj world-vertex)) (-> obj world-vertex 1) (new 'static 'rgba :r #xff :a #x60) @@ -560,28 +560,28 @@ ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj center-hold) 204.8 (new 'static 'rgba :r #xff :g #xff :a #x80) ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj left-hand-hold) 204.8 (new 'static 'rgba :r #xff :g #xff :a #x60) ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj right-hand-hold) 204.8 (new 'static 'rgba :r #xff :g #xff :a #x60) ) (add-debug-outline-triangle #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> obj tri-vertex)) (-> obj world-vertex 4) (-> obj world-vertex 5) @@ -615,7 +615,7 @@ ((-> s3-0 ignore) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) a2-0 a3-0 (new 'static 'rgba :r #x7f :g #x7f :b #x7f :a #x50) @@ -627,7 +627,7 @@ (else (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) a2-0 a3-0 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x60) @@ -636,7 +636,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s2-0 (-> s3-0 outward) (meters 0.3) @@ -654,7 +654,7 @@ (defmethod debug-draw-sphere collide-edge-work ((obj collide-edge-work)) (dotimes (s5-0 (the-as int (-> obj num-verts))) (let ((a2-0 (-> obj verts s5-0))) - (add-debug-sphere #t (bucket-id debug-draw1) a2-0 819.2 (new 'static 'rgba :r #xff :g #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) a2-0 819.2 (new 'static 'rgba :r #xff :g #xff :a #x80)) ) ) #f @@ -671,28 +671,28 @@ (while s4-0 (+! s5-0 1) (set! (-> s3-0 y) (-> s4-0 center-pt y)) - (add-debug-sphere #t (bucket-id debug-draw1) s3-0 409.6 (new 'static 'rgba :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s3-0 409.6 (new 'static 'rgba :a #x80)) (cond (s2-0 (set! s2-0 #f) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s4-0 center-pt) 614.4 (new 'static 'rgba :r #xff :g #xff :a #x80) ) - (add-debug-sphere #t (bucket-id debug-draw1) (-> s4-0 outward-pt) 409.6 (new 'static 'rgba :r #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) (-> s4-0 outward-pt) 409.6 (new 'static 'rgba :r #xff :a #x80)) ) (else (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s4-0 center-pt) 614.4 (new 'static 'rgba :r #x7f :g #x7f :a #x40) ) - (add-debug-sphere #t (bucket-id debug-draw1) (-> s4-0 outward-pt) 409.6 (new 'static 'rgba :r #x7f :a #x40)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) (-> s4-0 outward-pt) 409.6 (new 'static 'rgba :r #x7f :a #x40)) ) ) (set! s4-0 (-> s4-0 next)) @@ -703,7 +703,7 @@ (dotimes (s5-1 (the-as int (-> obj num-attempts))) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> obj attempts s5-1)) 409.6 (new 'static 'rgba :a #x40) @@ -719,7 +719,7 @@ ) (add-debug-outline-triangle #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> v1-3 vertex)) (-> v1-3 vertex 1) (-> v1-3 vertex 2) diff --git a/goal_src/engine/collide/collide-frag.gc b/goal_src/engine/collide/collide-frag.gc index a9703339dc..7246ac2ab7 100644 --- a/goal_src/engine/collide/collide-frag.gc +++ b/goal_src/engine/collide/collide-frag.gc @@ -83,6 +83,19 @@ (defmethod draw collide-fragment ((obj collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) ;; if we wanted to draw collide-fragment's we'd do it here. + ; (when (< (-> obj bsphere w) (meters 22.)) + ; (format 0 "sp: ~m : ~D~%" (-> obj bsphere w) (-> obj mesh poly-count)) + ; (let ((mins (vector-copy! (new-stack-vector0) (-> obj bsphere))) + ; (maxs (vector-copy! (new-stack-vector0) (-> obj bsphere)))) + ; (dotimes (i 3) + ; (-! (-> mins data i) (-> obj bsphere w)) + ; (+! (-> maxs data i) (-> obj bsphere w)) + ; ) + ; (add-debug-box #t (bucket-id debug) mins maxs (new 'static 'rgba :r #x80 :a #x80) + ; ) + ; ;(add-debug-sphere #t (bucket-id debug) (-> obj bsphere) (-> obj bsphere w) (new 'static 'rgba :r #x80 :a #x80)) + ; ) + ;; (add-debug-point #t (bucket-id debug) (-> obj bsphere)) (none) ) diff --git a/goal_src/engine/collide/collide-mesh-h.gc b/goal_src/engine/collide/collide-mesh-h.gc index 6df3dd1e62..5ff16b2220 100644 --- a/goal_src/engine/collide/collide-mesh-h.gc +++ b/goal_src/engine/collide/collide-mesh-h.gc @@ -73,7 +73,9 @@ ;; this is not the main collide cache, but instead a smaller cache for unpacking and ;; transforming foreground meshes. It's not useful when filling/probing the real collide-cache, -;; but is useful for the "loop through all the things that aren't me and see if I collide" +;; but is useful for repeated "loop through all the things that aren't me and see if I collide" +;; If you do multiple collision queries against the same object, it will only have to transform the +;; collision mesh once. (defconstant COLLIDE_MESH_CACHE_SIZE #xa000) @@ -101,7 +103,7 @@ ;; sw r0, 0(a0) (set! (-> obj used-size) 0) ;; daddiu v0, v1, 1 - (let ((v0 (+ v1 1))) + (let ((v0 (+ v1 1))) ;; beql v0, r0, L3 ;; addiu v0, r0, 1 (only taken if v0 = 0) (if (= v0 0) diff --git a/goal_src/engine/collide/collide-mesh.gc b/goal_src/engine/collide/collide-mesh.gc index 04e87f675f..910882460c 100644 --- a/goal_src/engine/collide/collide-mesh.gc +++ b/goal_src/engine/collide/collide-mesh.gc @@ -73,7 +73,7 @@ (.svf (&-> a2-1 quad) vf1) (.svf (&-> a3-0 quad) vf2) (.svf (&-> t0-0 quad) vf3) - (add-debug-flat-triangle #t (bucket-id debug-draw1) a2-1 a3-0 t0-0 t1-0) + (add-debug-flat-triangle #t (bucket-id debug-no-zbuf) a2-1 a3-0 t0-0 t1-0) ) ) (set! s5-0 (-> (the-as (inline-array collide-mesh-tri) s5-0) 1)) diff --git a/goal_src/engine/collide/collide-reaction-target.gc b/goal_src/engine/collide/collide-reaction-target.gc index b2639497ca..58a00786f9 100644 --- a/goal_src/engine/collide/collide-reaction-target.gc +++ b/goal_src/engine/collide/collide-reaction-target.gc @@ -5,6 +5,8 @@ ;; name in dgo: collide-reaction-target ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (defun collide-shape-moving-angle-set! ((arg0 collide-shape-moving) (arg1 vector) (arg2 vector)) (set! (-> arg0 surface-normal quad) (-> arg1 quad)) (set! (-> arg0 surface-angle) (vector-dot arg1 (-> arg0 dynam gravity-normal))) @@ -72,7 +74,7 @@ (set! sv-208 (vector+float*! (new 'stack-no-clear 'vector) (-> arg1 best-tri intersect) sv-160 2867.2)) (set! sv-212 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 dynam gravity-normal) -20480.0)) (vector+float*! sv-212 sv-212 sv-160 4096.0) - (when (>= (probe-using-line-sphere *collide-cache* sv-208 sv-212 409.6 (-> arg1 best-from-prim collide-with) sv-164 1) + (when (>= (probe-using-line-sphere *collide-cache* sv-208 sv-212 409.6 (-> arg1 best-from-prim collide-with) sv-164 (new 'static 'pat-surface :noentity #x1)) 0.0 ) (set! (-> arg0 unknown-float-coverage-0) @@ -95,7 +97,7 @@ (set! sv-276 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 dynam gravity-normal) -20480.0)) (vector+float*! sv-272 sv-272 sv-160 -819.2) (vector+float*! sv-276 sv-276 sv-160 -4096.0) - (when (>= (probe-using-line-sphere *collide-cache* sv-272 sv-276 409.6 (-> arg1 best-from-prim collide-with) sv-164 1) + (when (>= (probe-using-line-sphere *collide-cache* sv-272 sv-276 409.6 (-> arg1 best-from-prim collide-with) sv-164 (new 'static 'pat-surface :noentity #x1)) 0.0 ) (set! (-> arg0 unknown-float-coverage-2) (vector-vector-distance sv-272 (-> sv-164 intersect))) @@ -113,7 +115,7 @@ ) ) (set! sv-32 (logior sv-32 128)) - (set! (-> arg0 unknown-dword-coverage) (-> *display* base-frame-counter)) + (set! (-> arg0 unknown-dword-coverage) (the-as int (-> *display* base-frame-counter))) (set! sv-40 (logior sv-40 128)) (set! (-> arg0 unknown-dword21) (-> *display* base-frame-counter)) (let ((f30-0 (vector-dot sv-52 (-> arg0 unknown-vector22))) @@ -201,7 +203,7 @@ (if (= (-> arg0 poly-pat mode) (pat-mode wall)) (set! sv-104 (logior sv-104 1)) ) - (if (logtest? (-> arg0 unknown-surface00 flags) 2048) + (if (logtest? (-> arg0 unknown-surface00 flags) (surface-flags jump)) (set! sv-104 (logior sv-104 32)) ) (let ((v1-23 (new 'stack-no-clear 'vector))) @@ -249,7 +251,7 @@ (& sv-160) ) ) - (when (zero? (logand (-> arg0 prev-status) 1)) + (when (zero? (logand (-> arg0 prev-status) (cshape-moving-flags onsurf))) (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) (set! sv-96 (logior sv-96 2048)) (when (not sv-160) @@ -299,11 +301,11 @@ (set! (-> arg0 unknown-vector70 quad) (-> arg1 best-tri intersect quad)) (set! (-> arg0 unknown-vector71 quad) (-> arg0 poly-normal quad)) (set! (-> arg0 unknown-vector121 quad) (-> sv-84 quad)) - (set! (-> arg0 unknown-int60) (the-as uint (-> arg1 best-tri pat))) + (set! (-> arg0 wall-pat) (-> arg1 best-tri pat)) (-> arg0 history-data (logand (+ (-> arg0 unknown-halfword00) 127) 127)) (cond (#f - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! sv-104 (logior sv-104 8192)) (vector-reflect-flat-above! arg2 (the-as vector (-> sv-88 vector)) sv-84) ) @@ -312,19 +314,18 @@ ) ) (cond - ((not - (and (>= (-> arg1 best-from-prim local-sphere w) - (vector-dot - (-> arg0 ground-poly-normal) - (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-tri intersect) (-> arg0 ground-touch-point)) - ) - ) - (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) - (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) 90) - (zero? (logand sv-104 32)) - ) - ) - ) + ((not (and (>= (-> arg1 best-from-prim local-sphere w) + (vector-dot + (-> arg0 ground-poly-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-tri intersect) (-> arg0 ground-touch-point)) + ) + ) + (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) + (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) (seconds 0.3)) + (zero? (logand sv-104 32)) + ) + ) + ) ) (else (set! sv-104 (logior sv-104 256)) @@ -363,7 +364,7 @@ ) ) (logior! (-> arg0 status) sv-96) - (set! (-> arg0 reaction-flag) (the-as uint sv-104)) + (set! (-> arg0 reaction-flag) (the-as cshape-reaction-flags sv-104)) (update! (-> arg0 history-data (-> arg0 unknown-halfword00)) arg0 @@ -372,20 +373,22 @@ arg2 ) (set! (-> arg0 unknown-halfword00) (logand (+ (-> arg0 unknown-halfword00) 1) 127)) - (the-as uint sv-96) + (the-as cshape-moving-flags sv-96) ) -;; definition for function target-collision-no-reaction -;; INFO: Return type mismatch int vs none. (defun target-collision-no-reaction ((arg0 control-info) (arg1 collide-shape-intersect) (arg2 vector) (arg3 vector)) (if (= (-> arg0 unknown-surface00 mode) 'air) - (logior! (-> arg0 reaction-flag) 32) + (logior! (-> arg0 reaction-flag) (cshape-reaction-flags csrf05)) ) (let ((s5-0 (-> arg0 history-data (-> arg0 unknown-halfword00)))) (update! s5-0 arg0 (-> arg0 trans) arg3 arg2) - (logior! (-> s5-0 status) 256) + (logior! (-> s5-0 status) (cshape-moving-flags csmf08)) ) (set! (-> arg0 unknown-halfword00) (logand (+ (-> arg0 unknown-halfword00) 1) 127)) 0 (none) - ) \ No newline at end of file + ) + + + + diff --git a/goal_src/engine/collide/collide-shape-h.gc b/goal_src/engine/collide/collide-shape-h.gc index f52ba9e9cb..f7b4ff7cba 100644 --- a/goal_src/engine/collide/collide-shape-h.gc +++ b/goal_src/engine/collide/collide-shape-h.gc @@ -38,11 +38,12 @@ ;; The "new" system: ;; - is the only way to collide with the background/water ;; - uses "collide-cache" -;; - generally dumps stuff into the collide-cache, then uses collide-cache functions (not decompiled yet) +;; - generally dumps stuff into the collide-cache, then uses collide-cache functions ;; - does not support a few of the weirder collision checks ;; There is some duplicate implemenations because both the new and old system collide -;; foreground meshes. +;; foreground meshes. The new system can just import foreground collision meshes +;; into its collide cache. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -59,7 +60,7 @@ ;; Collide Resolve. (made up name) ;; Some objects (like Jak) do not move on fixed paths, and will be stopped by walls or other obstacles. -;; This works on background and foreground objects, and uses the new system. +;; This works on background and foreground objects, and uses the new system (it must, to handle background). ;; The fill-cache-integrate-and-collide! function should be called, which will fill the collide cache ;; and then do an iterative collision algorithm. ;; This will call the reaction function. The default "default-collision-reaction" function is in collide-shape.gc @@ -229,7 +230,7 @@ ;; Collision Primitive Base ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; These are the settings that can be set per primtive. +;; These are the settings that can be set per primitive. (defenum collide-kind @@ -367,7 +368,7 @@ (prim-core collide-prim-core :inline :offset-assert 16) ;; core data (local-sphere vector :inline :offset-assert 48) ;; sphere, pre transform (collide-with collide-kind :offset-assert 64) ;; things we can collide with - + ;; overlays of core. (world-sphere vector :inline :offset 16) (collide-as collide-kind :offset 32) @@ -389,7 +390,7 @@ (add-fg-prim-using-y-probe (_type_ collide-cache) none 14) (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 15) (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 16) - (dummy-17 () none 17) + (unused-17 () none 17) (collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none 18) (collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none 19) (add-to-bounding-box (_type_ collide-kind) symbol 20) @@ -476,15 +477,28 @@ (declare-type collide-work structure) (declare-type touching-shapes-entry structure) +(defenum nav-flags + :bitfield #t + :type uint8 + (navf0 0) + (navf1 1) + (navf2 2) + (navf3 3) + (navf4 4) + (navf5 5) + (navf6 6) + (navf7 7) + ) + ;; we're a child of trsqv, so we store a full transform + derivative. (deftype collide-shape (trsqv) ((process process-drawable :offset-assert 140) (max-iteration-count uint8 :offset-assert 144) - (nav-flags uint8 :offset-assert 145) + (nav-flags nav-flags :offset-assert 145) (pad-byte uint8 2 :offset-assert 146) (pat-ignore-mask pat-surface :offset-assert 148) - (event-self basic :offset-assert 152) - (event-other basic :offset-assert 156) + (event-self symbol :offset-assert 152) + (event-other symbol :offset-assert 156) (root-prim collide-shape-prim :offset-assert 160) (riders collide-sticky-rider-group :offset-assert 164) (backup-collide-as collide-kind :offset-assert 168) @@ -526,7 +540,79 @@ ) ) -;; More complicated collide-shape? +(defenum cshape-moving-flags + :bitfield #t + :type uint64 + (onsurf) + (onground) + (tsurf) + (twall) + (t-ciel) + (t-act) + (csmf06) + (csmf07) + (csmf08) + (csmf09) + (on-water) + (csmf11) + (csmf12) + (csmf13) + (csmf14) + (csmf15) + (csmf16) + (csmf17) + (csmf18) + (csmf19) + (csmf20) + (csmf21) + (csmf22) + (csmf23) + (csmf24) + (csmf25) + (csmf26) + (csmf27) + (csmf28) + (csmf29) + ) + +(defenum cshape-reaction-flags + :bitfield #t + :type uint32 + (csrf00) + (csrf01) + (csrf02) + (csrf03) + (csrf04) + (csrf05) + (csrf06) + (csrf07) + (csrf08) + (csrf09) + (csrf10) + (csrf11) + (csrf12) + (csrf13) + (csrf14) + (csrf15) + (csrf16) + (csrf17) + (csrf18) + (csrf19) + (csrf20) + (csrf21) + (csrf22) + (csrf23) + (csrf24) + (csrf25) + (csrf26) + (csrf27) + (csrf28) + (csrf29) + (csrf30) + (csrf31) + ) + +;; A collide-shape for independently moving objects (deftype collide-shape-moving (collide-shape) ((rider-time time-frame :offset-assert 184) (rider-last-move vector :inline :offset-assert 192) @@ -534,11 +620,11 @@ (poly-pat pat-surface :offset-assert 256) (cur-pat pat-surface :offset-assert 260) (ground-pat pat-surface :offset-assert 264) - (status uint64 :offset-assert 272) - (old-status uint64 :offset-assert 280) - (prev-status uint64 :offset-assert 288) - (reaction-flag uint32 :offset-assert 296) - (reaction (function collide-shape-moving collide-shape-intersect vector vector uint) :offset-assert 300) + (status cshape-moving-flags :offset-assert 272) + (old-status cshape-moving-flags :offset-assert 280) + (prev-status cshape-moving-flags :offset-assert 288) + (reaction-flag cshape-reaction-flags :offset-assert 296) + (reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags) :offset-assert 300) (no-reaction (function collide-shape-moving collide-shape-intersect vector vector none) :offset-assert 304) (local-normal vector :inline :offset-assert 320) (surface-normal vector :inline :offset-assert 336) @@ -551,8 +637,8 @@ (poly-angle float :offset-assert 424) (touch-angle float :offset-assert 428) (coverage float :offset-assert 432) - (dynam dynamics :offset-assert 436) - (surf surface :offset-assert 440) + (dynam dynamics :offset-assert 436) + (surf surface :offset-assert 440) ) :method-count-assert 65 :size-assert #x1bc @@ -647,7 +733,7 @@ (let ((obj (object-new allocation type-to-make (the int (-> type-to-make size))))) (set! (-> obj process) proc) (set! (-> obj max-iteration-count) 1) - (set! (-> obj nav-flags) #x1) + (set! (-> obj nav-flags) (nav-flags navf0)) (set! (-> obj event-self) #f) (set! (-> obj event-other) #f) (set! (-> obj riders) #f) @@ -712,9 +798,9 @@ ;; These aren't real meshes, but are returned when you collide with the background or water. ;; Background and water collision work differently, but this allows these systems to pretend to be -;; part of the foreground collision system. +;; part of the old collision system. -(define *collide-shape-prim-backgnd* +(define *collide-shape-prim-backgnd* (new 'static 'collide-shape-prim-mesh :cshape #f :prim-core @@ -730,7 +816,7 @@ ) ) -(define *collide-shape-prim-water* +(define *collide-shape-prim-water* (new 'static 'collide-shape-prim-mesh :cshape #f :prim-core diff --git a/goal_src/engine/collide/collide-shape.gc b/goal_src/engine/collide/collide-shape.gc index ced2559cf9..10a19b3715 100644 --- a/goal_src/engine/collide/collide-shape.gc +++ b/goal_src/engine/collide/collide-shape.gc @@ -23,7 +23,7 @@ "Find the overlap between two collide shapes. This is the main entry point for the overlap algorithm. The result is returned in arg1. The obj is collided _with_ arg0 (meaning obj uses its collide-with, arg0 uses colide-as). The best-dist is only valid if the result is #t (it should be negative then)" - + ;; this method begins the recursive traversal through the tree of collide-shape-prims, starting with the ;; root of each shape. (local-vars (v1-3 collide-action) (v1-4 float) (a2-2 collide-action) (a3-2 collide-action)) @@ -36,7 +36,7 @@ (vf5 :class vf) ) (init-vf0-vector) - + ;; reset the overlap result (let ((v1-0 arg1)) (set! (-> v1-0 best-dist) 0.0) @@ -62,11 +62,11 @@ ) ;; reject if non-solid (b! (zero? v1-3) cfg-8 :delay (nop!)) - + ;; if we're here, our collision types allow us to collide (.lvf vf1 (&-> a0-1 prim-core world-sphere quad)) (.lvf vf2 (&-> a1-1 prim-core world-sphere quad)) - + ;; see if bsphere's overlap (.sub.vf vf3 vf1 vf2) (.add.w.vf vf4 vf1 vf2 :mask #b1000) @@ -81,12 +81,12 @@ (.mov v1-4 vf5) (b! (<= f0-1 v1-4) cfg-8) ;; they don't, fail! ) - + ;; our bsphere's overlap. We need a more detailed test to know for sure ;; this will dispatch a more specific method for a0-1. (should-push-away-test a0-1 a1-1 arg1) ) - + ;; return the result of the more detailed test. (let ((v0-1 (< (-> arg1 best-dist) 0.0))) (b! #t cfg-9 :delay (nop!)) @@ -234,7 +234,7 @@ (defmethod should-push-away-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result)) "Collide a prim with a mesh. The prim must be a sphere or group of spheres" - + ;; first, check the prim type (let ((v1-0 (-> arg0 prim-core prim-type))) (b! (nonzero? v1-0) cfg-2 :delay (nop!)) @@ -248,7 +248,7 @@ (let ((s3-0 (-> obj mesh))) ;; if we don't have a mesh, then abort. (b! (not s3-0) cfg-11 :delay (nop!)) ;; empty-form - + ;; we must put the mesh in the cache before we can collide. ;; NOTE: this is not the full collide-cache, but instead a smaller, simpler collide-mesh-cche. (let ((s2-0 *collide-mesh-cache*)) @@ -265,7 +265,7 @@ ;; and remember the cache has this (set! (-> obj mesh-cache-id) (-> s2-0 id)) ) - + ;; load this mesh into the cache. ;; strangely, they transform the entire mesh. (populate-cache! @@ -367,7 +367,7 @@ ) ) ) - + ;; make up a triangle. (let ((s4-1 (-> arg1 best-from-tri normal)) (s3-0 (-> arg1 best-from-tri intersect)) @@ -391,7 +391,7 @@ ) ) (b! #t cfg-13 :delay (nop!)) - + ;; Mesh. this is the same as the above function. start with populating the cache. (label cfg-5) (let ((s3-1 (-> (the-as collide-shape-prim-mesh arg0) mesh))) @@ -916,7 +916,7 @@ "Find somewhere safe to land. This is used to find where to bounce back the player if you jump on fire canyon. It's a nice example function for the collision system." (local-vars (direction-idx int) (sv-192 int)) - + ;; first, let's find our heading (let ((current-heading (if (< 819.2 (vector-xz-length (-> target-ctrl transv))) ;; if we're moving in the xz plane (vector-y-angle (-> target-ctrl transv)) ;; use the direction we're moving @@ -928,7 +928,7 @@ (probe-dir (new 'stack-no-clear 'vector)) (result-tri (new 'stack-no-clear 'collide-tri-result)) ) - + ;; create a bounding box, centered around our current location. (let ((bbox (new 'stack-no-clear 'bounding-box))) (set! (-> ground-result w) 0.0) @@ -940,17 +940,17 @@ ;; except for in y (height). Look 10m down, and 5m up. (set! (-> bbox min y) (+ -40960.0 (-> current-pos y))) (set! (-> bbox max y) (+ 20480.0 (-> current-pos y))) - + ;; fill the collide cache will all the triangles in bounding box. (fill-using-bounding-box *collide-cache* bbox (-> target-ctrl root-prim collide-with) (-> target-ctrl process) - (new 'static 'pat-surface :skip #x1 :noentity #x1) + (new 'static 'pat-surface :noentity #x1) ) ) - + ;; loop over 8 directions to check. (set! direction-idx 0) (while (< direction-idx 8) @@ -963,19 +963,19 @@ ) ) ) - + ;; this will count the number of hits we have in this direction. (set! sv-192 0) - + ;; we don't know anything, so assume we can go the maximum length in this direction (let ((max-len-this-dir max-len)) ;; but, if we did max-len bounce in this direction, we might hit some wall mid-bounce. - + ;; start with a probe of max len, pointing straight forward. (set-vector! probe-dir 0.0 0.0 max-len 1.0) ;; rotate to point along our heading (vector-rotate-y! probe-dir probe-dir probe-heading) - + ;; see how far we can go, 10m above the current target. ;; this is likely checking to see if we'll hit a wall mid-bounce (if (>= (probe-using-line-sphere @@ -985,20 +985,20 @@ 2048.0 (-> target-ctrl root-prim collide-with) result-tri - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) (set! max-len-this-dir (+ -6144.0 (vector-vector-xz-distance current-pos (-> result-tri intersect)))) ) - + ;; now, let's search between start-len and max-len-this-dir to see if there's somewhere safe to bounce. (let ((current-len start-len)) (while (>= max-len-this-dir current-len) ;; probe heading (set-vector! probe-dir 0.0 0.0 current-len 1.0) (vector-rotate-y! probe-dir probe-dir probe-heading) - + ;; put probe dir at the end of the probe (vector+! probe-dir current-pos probe-dir) ;; start 10m above the curren pos. @@ -1011,7 +1011,7 @@ 10240.0 (-> target-ctrl root-prim collide-with) result-tri - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -1049,188 +1049,131 @@ (defun target-attack-up ((arg0 target) (arg1 symbol) (arg2 symbol)) "Handle an attack up. This launches the player in the air, forcing them back to a safe location." - (with-pp - ;; attempt to find a safe ground. - (let ((s4-0 (find-ground-point (-> arg0 control) (new 'stack-no-clear 'vector) 8192.0 40960.0))) - (set! s4-0 (cond - (s4-0 ;; if we found it, use that - s4-0 - ) - (else - ;; failed to find it. Use the last known safe ground point instaed. - (-> arg0 control last-known-safe-ground) - ) + ;; attempt to find a safe ground. + (let ((s4-0 (find-ground-point (-> arg0 control) (new 'stack-no-clear 'vector) (meters 2) (meters 10)))) + (set! s4-0 (cond + (s4-0 ;; if we found it, use that + s4-0 ) - ) - (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) s4-0 (-> arg0 control trans))) ;; jump direction - (f30-1 (fmax 8192.0 (fmin 40960.0 (vector-xz-length s2-1)))) ;; distance we should jump (limited) - ) - ;; note: the above limit is the same as the limit passed into find-ground-point. So the limiting should only kick in - ;; if we use last safe ground. - (cond - ((< (fabs (vector-dot - (-> arg0 control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) s4-0 (-> arg0 control trans)) - ) + (else + ;; failed to find it. Use the last known safe ground point instaed. + (-> arg0 control last-known-safe-ground) + ) + ) + ) + (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) s4-0 (-> arg0 control trans))) ;; jump direction + (f30-1 (fmax (meters 2) (fmin (meters 10) (vector-xz-length s2-1)))) ;; distance we should jump (limited) + ) + ;; note: the above limit is the same as the limit passed into find-ground-point. So the limiting should only kick in + ;; if we use last safe ground. + (cond + ((< (fabs (vector-dot + (-> arg0 control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) s4-0 (-> arg0 control trans)) ) - 40960.0 + ) + (meters 10) + ) + ;; if we reach here, we have to jump up or down less than 10m. + ;; reduce our jump direction to within reasonable distance + (vector-xz-normalize! s2-1 f30-1) + ;; send an attack + ;; the shove is proportional to how high we jump (and has a min, so we at least get off the ground) + (send-event + arg0 + arg1 + #f + (static-attack-info + ((mode arg2) + (vector s2-1) + (shove-up + (+ (lerp-scale (meters 1) (meters 4) f30-1 (meters 1) (meters 10)) (fmax 0.0 (- (-> s4-0 y) (-> arg0 control trans y)))) + ) + (angle 'up) ) - ;; if we reach here, we have to jump up or down less than 10m. - ;; reduce our jump direction to within reasonable distance - (vector-xz-normalize! s2-1 f30-1) - ;; send an attack - (let ((s1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> s1-0 from) pp) - (set! (-> s1-0 num-params) 2) - (set! (-> s1-0 message) arg1) - (set! (-> s1-0 param 0) (the-as uint #f)) - (let ((s3-1 (new 'static 'attack-info :mask #x8a2))) - (set! (-> s3-1 mode) arg2) - ;; go in the direction we determined. - (set! (-> s3-1 vector quad) (-> s2-1 quad)) - ;; the shove is proportional to how high we jump (and has a min, so we at least get off the ground) - (set! (-> s3-1 shove-up) - (+ (lerp-scale 4096.0 16384.0 f30-1 4096.0 40960.0) (fmax 0.0 (- (-> s4-0 y) (-> arg0 control trans y)))) - ) - (set! (-> s3-1 angle) 'up) - (set! (-> s1-0 param 1) (the-as uint s3-1)) - ) - ;; shove! - (send-event-function arg0 s1-0) ) ) - (else - ;; the last safest place we jumped is too high. just launch jak in the air and hope for the best. - ;; fire canyon skip jumps - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) pp) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) arg1) - (set! (-> a1-6 param 0) (the-as uint #f)) - (let ((v1-12 (new 'static 'attack-info :mask #xca2))) - (set! (-> v1-12 mode) arg2) - (set! (-> v1-12 vector quad) (-> (new 'static 'vector :y 40960.0 :w 1.0) quad)) - (set! (-> v1-12 shove-up) 40960.0) - (set! (-> v1-12 angle) 'up) - (set! (-> v1-12 control) 1.0) - (set! (-> a1-6 param 1) (the-as uint v1-12)) - ) - (send-event-function arg0 a1-6) - ) - ) + ) + (else + ;; the last safest place we jumped is too high. just launch jak in the air and hope for the best. + ;; fire canyon skip jumps + (send-event arg0 arg1 #f (static-attack-info ((mode arg2) + (vector (new 'static 'vector :y (meters 10) :w 1.0)) + (shove-up (meters 10)) + (angle 'up) + (control 1.0) + ) + ) + ) ) ) ) - (none) ) + (none) ) (defmethod set-and-handle-pat! collide-shape-moving ((obj collide-shape-moving) (arg0 pat-surface)) "Handle landing on the given pat-surface. This is likely target-specific." - (with-pp - ;; set our pat - (set! (-> obj cur-pat) arg0) - (set! (-> obj poly-pat) arg0) - ;; set our surface - (case (-> arg0 material) - (((pat-material ice)) - (set! (-> obj surf) *ice-surface*) - ) - (((pat-material quicksand)) - (set! (-> obj surf) *quicksand-surface*) - ) - (((pat-material tube)) - (set! (-> obj surf) *no-walk-surface*) - ) - (((pat-material rotate)) - (set! (-> obj surf) *rotate-surface*) - ) - (else - (set! (-> obj surf) *standard-ground-surface*) - ) + ;; set our pat + (set! (-> obj cur-pat) arg0) + (set! (-> obj poly-pat) arg0) + ;; set our surface + (case (-> arg0 material) + (((pat-material ice)) + (set! (-> obj surf) *ice-surface*) + ) + (((pat-material quicksand)) + (set! (-> obj surf) *quicksand-surface*) + ) + (((pat-material tube)) + (set! (-> obj surf) *no-walk-surface*) + ) + (((pat-material rotate)) + (set! (-> obj surf) *rotate-surface*) + ) + (else + (set! (-> obj surf) *standard-ground-surface*) ) - - ;; ca-9 gets set whenever you get on the zoomer. If we are on the zoomer, just go to "race-track" - (if (logtest? (-> obj root-prim prim-core action) (collide-action ca-9)) - (set! (-> obj surf) *race-track-surface*) - ) - - (when (nonzero? (-> arg0 event)) - (case (-> arg0 event) - (((pat-event deadly)) - ;; deadly. Send a deadly event - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (the-as uint #f)) - (let ((v1-19 (new 'static 'attack-info :mask #xa0))) - (set! (-> v1-19 mode) 'deadly) - (set! (-> v1-19 shove-up) 12288.0) - (set! (-> a1-3 param 1) (the-as uint v1-19)) - ) - (send-event-function (-> obj process) a1-3) - ) - ) - (((pat-event burn)) - ;; burn. Send a burn event - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) pp) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'attack) - (set! (-> a1-6 param 0) (the-as uint #f)) - (let ((v1-23 (new 'static 'attack-info :mask #xa0))) - (set! (-> v1-23 mode) 'burn) - (set! (-> v1-23 shove-up) 12288.0) - (set! (-> a1-6 param 1) (the-as uint v1-23)) - ) - (send-event-function (-> obj process) a1-6) - ) - ) - (((pat-event deadlyup)) - ;; deadlyup. Launch! - (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'deadlyup) - ) - (((pat-event burnup)) - ;; burnup (like fire canyon lava). - ;; only send if we don't have ca-9 (on zoomer) - (if (zero? (logand (-> (the-as target (-> obj process)) control root-prim prim-core action) (collide-action ca-9))) - (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'burnup) - ) - ) - (((pat-event melt)) - ;; just send melt - (let ((a1-15 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-15 from) pp) - (set! (-> a1-15 num-params) 2) - (set! (-> a1-15 message) 'attack-invinc) - (set! (-> a1-15 param 0) (the-as uint #f)) - (let ((a2-8 (new 'static 'attack-info :mask #x20))) - (set! (-> a2-8 mode) 'melt) - (set! (-> a1-15 param 1) (the-as uint a2-8)) - ) - (send-event-function (-> obj process) a1-15) - ) - ) - (((pat-event endlessfall)) - ;; endless pit death plane. - (let ((a1-17 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-17 from) pp) - (set! (-> a1-17 num-params) 2) - (set! (-> a1-17 message) 'attack-invinc) - (set! (-> a1-17 param 0) (the-as uint #f)) - (let ((a2-9 (new 'static 'attack-info :mask #x20))) - (set! (-> a2-9 mode) 'endlessfall) - (set! (-> a1-17 param 1) (the-as uint a2-9)) - ) - (send-event-function (-> obj process) a1-17) - ) - ) - ) - ) - 0 - (none) ) + + ;; ca-9 gets set whenever you get on the zoomer. If we are on the zoomer, just go to "race-track" + (if (logtest? (-> obj root-prim prim-core action) (collide-action ca-9)) + (set! (-> obj surf) *race-track-surface*) + ) + + (when (nonzero? (-> arg0 event)) + (case (-> arg0 event) + (((pat-event deadly)) + ;; deadly. Send a deadly event + (send-event (-> obj process) 'attack #f (static-attack-info ((mode 'deadly) (shove-up (meters 3))))) + ) + (((pat-event burn)) + ;; burn. Send a burn event + (send-event (-> obj process) 'attack #f (static-attack-info ((mode 'burn) (shove-up (meters 3))))) + ) + (((pat-event deadlyup)) + ;; deadlyup. Launch! + (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'deadlyup) + ) + (((pat-event burnup)) + ;; burnup (like fire canyon lava). + ;; only send if we don't have ca-9 (on zoomer) + (if (zero? (logand (-> (the-as target (-> obj process)) control root-prim prim-core action) (collide-action ca-9))) + (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'burnup) + ) + ) + (((pat-event melt)) + ;; just send melt + (send-event (-> obj process) 'attack-invinc #f (static-attack-info ((mode 'melt)))) + ) + (((pat-event endlessfall)) + ;; endless pit death plane. + (send-event (-> obj process) 'attack-invinc #f (static-attack-info ((mode 'endlessfall)))) + ) + ) + ) + 0 + (none) ) (defun default-collision-reaction ((arg0 collide-shape-moving) (arg1 collide-shape-intersect) (arg2 vector) (arg3 vector)) @@ -1241,14 +1184,14 @@ (set! sv-72 (new 'stack-no-clear 'vector)) (set! sv-80 0) (set! (-> sv-72 quad) (-> arg3 quad)) - + ;; move along the vector by the best move-vec ;; this will hit the best-tri (let ((a1-1 (new 'stack-no-clear 'vector))) (vector-float*! a1-1 (-> arg1 move-vec) (-> arg1 best-u)) (move-by-vector! arg0 a1-1) ) - + ;; so handle hitting that tri (set-and-handle-pat! arg0 (-> arg1 best-tri pat)) (vector-! sv-64 (the-as vector (-> arg1 best-from-prim prim-core)) (-> arg1 best-tri intersect)) @@ -1262,8 +1205,8 @@ (if (= (-> arg1 best-u) 0.0) (move-by-vector! arg0 sv-68) ) - - ;; + + ;; (set! (-> arg0 surface-normal quad) (-> sv-68 quad)) (set! (-> arg0 poly-normal quad) (-> arg1 best-tri normal quad)) (set! (-> arg0 surface-angle) (vector-dot sv-68 (-> arg0 dynam gravity-normal))) @@ -1328,7 +1271,7 @@ ) ) (logior! (-> arg0 status) sv-80) - (the-as uint sv-80) + (the-as cshape-moving-flags sv-80) ) (defun simple-collision-reaction ((arg0 collide-shape-moving) (arg1 collide-shape-intersect) (arg2 vector) (arg3 vector)) @@ -1348,7 +1291,7 @@ ) (let ((v0-1 (logior s5-0 7))) (logior! (-> arg0 status) v0-1) - (the-as uint v0-1) + (the-as cshape-moving-flags v0-1) ) ) ) @@ -1356,19 +1299,19 @@ (defmethod step-collison! collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float)) "Take 1 step in the collision. Attempt to move at velocity of arg1, for arg2 of a step. The resulting velocity is stored in arg0. The amount of a step actually taken is returned." - + (local-vars (sv-192 int)) (let ((s5-0 (new 'stack 'collide-shape-intersect)) (s2-0 (new 'stack-no-clear 'vector)) ) - + ;; integrate our velocity, get the "move vector" ;; which is what we'd move if we hit nothing. (vector-float*! s2-0 arg1 (* arg2 (-> *display* seconds-per-frame))) - + ;; initialize the collision data. (init! s5-0 s2-0) - + ;; only if we have something in the collide cache, I guess. (let* ((s1-1 (-> obj root-prim)) (v1-4 *collide-cache*) @@ -1388,27 +1331,27 @@ (set! s0-0 (-> (the-as (inline-array collide-cache-prim) s0-0) 1)) ) ) - + ;; now we've collided with everything. If we have a best-u of > 0, it means we can't do the full move. (let ((f30-0 (-> s5-0 best-u))) (cond ((>= f30-0 0.0) (let ((s2-1 (new 'stack-no-clear 'vector))) - + ;; if debugging, remember our input velocity. (if *display-collision-marks* (set! (-> s2-1 quad) (-> arg1 quad)) ) - + ;; do the collision reaction! this function should move the collide shape. - (set! (-> obj prev-status) (the-as uint ((-> obj reaction) obj s5-0 arg0 arg1))) - + (set! (-> obj prev-status) (the-as cshape-moving-flags ((-> obj reaction) obj s5-0 arg0 arg1))) + ;; debug draw collision marks. (when *display-collision-marks* (let ((t1-0 (-> *pat-mode-info* (-> s5-0 best-tri pat mode) hilite-color))) (add-debug-outline-triangle #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> s5-0 best-tri)) (-> s5-0 best-tri vertex 1) (-> s5-0 best-tri vertex 2) @@ -1417,7 +1360,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s5-0 best-tri intersect) s2-1 (meters 0.00007324219) @@ -1425,7 +1368,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s5-0 best-tri intersect) arg0 (meters 0.00007324219) @@ -1434,7 +1377,7 @@ (if (= (-> obj process type) target) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s5-0 best-tri intersect) (-> obj surface-normal) (meters 0.5) @@ -1443,15 +1386,15 @@ ) ) ) - + ;; and return the step size we could take. (return f30-0) ) (else ;; didn't hit anything! call the no-reaction function. - (set! (-> obj reaction-flag) (the-as uint 0)) + (set! (-> obj reaction-flag) (cshape-reaction-flags)) ((-> obj no-reaction) obj s5-0 arg0 arg1) - (set! (-> obj prev-status) (the-as uint 0)) + (set! (-> obj prev-status) (cshape-moving-flags)) ;; and do the move ourself (move-by-vector! obj s2-0) ;; velocity is unchanged @@ -1496,24 +1439,39 @@ It will process updates from hitting triangles with pat-surfaces It will update the touching list. It will update the current surface and surface flags." - + ;; update the world-spheres for us and our children. (update-transforms! obj) - + ;; remember our history (set! (-> obj trans-old 2 quad) (-> obj trans-old 1 quad)) (set! (-> obj trans-old 1 quad) (-> obj trans-old 0 quad)) (set! (-> obj trans-old 0 quad) (-> obj trans quad)) (set! (-> obj prev-status) (-> obj status)) - + ;; setup - (set! (-> obj status) (logand -16128 (-> obj status))) + (logclear! (-> obj status) (cshape-moving-flags + onsurf + onground + tsurf + twall + t-ciel + t-act + csmf06 + csmf07 + csmf09 + on-water + csmf11 + csmf12 + csmf13 + ) + ) (set! (-> obj local-normal quad) (-> obj dynam gravity-normal quad)) (set! (-> obj surface-normal quad) (-> obj dynam gravity-normal quad)) (set! (-> obj poly-normal quad) (-> obj dynam gravity-normal quad)) (set! (-> obj coverage) 0.0) (set! (-> obj touch-angle) 0.0) - + ;; we want to take a step of 1.0 (let ((f30-0 1.0) (s4-0 0) ;; iterations @@ -1523,7 +1481,7 @@ (not (and (= (-> arg0 x) 0.0) (= (-> arg0 y) 0.0) (= (-> arg0 z) 0.0))) ;; nonzero velocity ) ) - + ;; note that in between step-collision! and update-from-step-szie, the touching list is in an invalid state. (let ((f28-0 (step-collison! obj arg0 arg0 f30-0))) ;; step forward! (update-from-step-size *touching-list* f28-0) ;; update touching list. @@ -1540,13 +1498,13 @@ "Specialization of integrate and collide for the target" ;; time it (stopwatch-start (-> *collide-stats* total-target)) - + ;; check and correct massive velocity. (when (< 1638400.0 (vector-length arg0)) (format 0 "WARNING: target vel is ~M m/s, reseting to zero.~%" (vector-length arg0)) (vector-reset! arg0) ) - + ;; ??? (set! (-> obj unknown-vector15 quad) (-> obj unknown-vector14 quad)) (vector-matrix*! (-> obj unknown-vector14) (-> obj unknown-vector13) (-> obj unknown-matrix02)) @@ -1558,7 +1516,7 @@ (s4-1 (new 'stack-no-clear 'vector)) ) (set! (-> s4-1 quad) (-> arg0 quad)) - + ;; call the normal integrate. (let ((t9-7 (method-of-type collide-shape-moving integrate-and-collide!))) (t9-7 obj s3-1) @@ -1686,7 +1644,22 @@ (set! (-> obj trans-old 1 quad) (-> obj trans-old 0 quad)) (set! (-> obj trans-old 0 quad) (-> obj trans quad)) (set! (-> obj prev-status) (-> obj status)) - (set! (-> obj status) (logand -16128 (-> obj status))) + (logclear! (-> obj status) (cshape-moving-flags + onsurf + onground + tsurf + twall + t-ciel + t-act + csmf06 + csmf07 + csmf09 + on-water + csmf11 + csmf12 + csmf13 + ) + ) (set! (-> obj local-normal quad) (-> obj dynam gravity-normal quad)) (set! (-> obj surface-normal quad) (-> obj dynam gravity-normal quad)) (set! (-> obj poly-normal quad) (-> obj dynam gravity-normal quad)) @@ -1793,7 +1766,7 @@ arg1 (-> obj process) sv-144 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -1822,7 +1795,7 @@ ) ) ) - + ;; if we need to collide with things. (when (logtest? (-> obj root-prim collide-with) (collide-kind cak-1 cak-2 cak-3 target)) (let ((a1-7 (new 'stack-no-clear 'overlaps-others-params))) @@ -1866,7 +1839,7 @@ (+! (-> s4-0 y) arg0) 0.0 ;; find the ground - (let ((f0-4 (fill-and-probe-using-y-probe *collide-cache* s4-0 f30-0 arg3 (-> obj process) s3-0 (the-as uint 1)))) + (let ((f0-4 (fill-and-probe-using-y-probe *collide-cache* s4-0 f30-0 arg3 (-> obj process) s3-0 (new 'static 'pat-surface :noentity #x1)))) (when (< f0-4 0.0) (if arg2 (format 0 "WARNING: move-to-ground: (~f ~f) failed to locate ground [~S type ~S]~%" @@ -1927,7 +1900,7 @@ (vf2 :class vf) ) (init-vf0-vector) - + ;; scale the velocity, to see how far we can go, at max. (let ((a0-1 (new 'stack-no-clear 'vector))) (let ((v1-0 a0-1)) @@ -1940,9 +1913,9 @@ (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> v1-0 quad) vf1) ) - + ;; add a bonus size if we are target. - (let ((f0-2 (+ (vector-length a0-1) + (let ((f0-2 (+ (vector-length a0-1) (if (= (-> obj process type) target) 4096.0 0.0 @@ -1971,7 +1944,7 @@ (when (and *display-collide-cache* (= (-> obj process type) target)) (debug-draw *collide-cache*) ;; NOTE: added - (add-debug-box #t (bucket-id debug-draw0) (-> s5-0 min) (-> s5-0 max) (new 'static 'rgba :a #x80 :b #x70 :g #x70)) + (add-debug-box #t (bucket-id debug) (-> s5-0 min) (-> s5-0 max) (new 'static 'rgba :a #x80 :b #x70 :g #x70)) ) ) (else @@ -2255,7 +2228,7 @@ "Draw collision debug." (add-debug-sphere (or *display-collision-marks* *display-target-marks*) - (bucket-id debug-draw0) + (bucket-id debug) (target-pos 0) 819.2 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) @@ -2664,7 +2637,7 @@ "Draw our sphere" (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (the-as vector (-> obj prim-core)) (-> obj local-sphere w) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40) @@ -2675,7 +2648,7 @@ "Draw our sphere" (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (the-as vector (-> obj prim-core)) (-> obj local-sphere w) (the-as rgba (cond @@ -2697,7 +2670,7 @@ "Draw our sphere" (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (the-as vector (-> obj prim-core)) (-> obj local-sphere w) (new 'static 'rgba :b #xff :a #x40) @@ -2708,7 +2681,7 @@ "Draw our sphere" (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (the-as vector (-> obj prim-core)) (-> obj local-sphere w) (new 'static 'rgba :g #xff :a #x10) @@ -2726,10 +2699,10 @@ (at-1 int) (at-2 int) (at-3 int) - (v1-20 float) - (v1-53 float) - (v1-85 float) - (v1-116 float) + (v1-20 int) + (v1-53 int) + (v1-85 int) + (v1-116 int) ) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -2739,7 +2712,7 @@ (vf5 :class vf) ) (init-vf0-vector) - + ;; kill the mesh cache (let* ((v1-0 *collide-mesh-cache*) (a0-1 (-> v1-0 id)) @@ -2751,10 +2724,10 @@ (set! (-> v1-0 id) (the-as uint a0-2)) ) ) - + ;; loop over everything! (let ((s5-0 (-> obj root-prim collide-with))) - + ;; we collide with target, so check the player list. (when (logtest? s5-0 (collide-kind target)) (let ((v1-5 (-> *collide-player-list* alive-list next0))) @@ -2776,7 +2749,7 @@ (let ((s1-0 (new 'stack-no-clear 'vector))) (let ((v1-19 (new 'stack-no-clear 'vector))) (set! (-> v1-19 quad) (-> s3-0 trans quad)) - + ;; this is... a bit of a hack. ;; this adjusts our collision to be within 0.7 - 1.4m of our base. ;; (note, this only applies for intermediate iterations of this loop) @@ -2840,10 +2813,10 @@ ) ) ) - - + + (when (logtest? s5-0 (collide-kind cak-1 cak-2 cak-3)) - + (when (logtest? s5-0 (collide-kind cak-1)) (let ((v1-38 (-> *collide-hit-by-player-list* alive-list next0))) *collide-hit-by-player-list* @@ -2919,8 +2892,8 @@ ) ) ) - - + + (when (logtest? s5-0 (collide-kind cak-2)) (let ((v1-70 (-> *collide-usually-hit-by-player-list* alive-list next0))) *collide-usually-hit-by-player-list* diff --git a/goal_src/engine/collide/collide-target-h.gc b/goal_src/engine/collide/collide-target-h.gc index ab5f7ab856..41a699660e 100644 --- a/goal_src/engine/collide/collide-target-h.gc +++ b/goal_src/engine/collide/collide-target-h.gc @@ -15,9 +15,9 @@ (local-normal vector :inline :offset-assert 64) (surface-normal vector :inline :offset-assert 80) (time time-frame :offset-assert 96) - (status uint64 :offset-assert 104) + (status cshape-moving-flags :offset-assert 104) (pat pat-surface :offset-assert 112) - (reaction-flag uint32 :offset-assert 116) + (reaction-flag cshape-reaction-flags :offset-assert 116) ) :method-count-assert 10 :size-assert #x78 @@ -30,168 +30,170 @@ ;; This is the collide shape for target (Jak). ;; It is complicated. (deftype control-info (collide-shape-moving) - ( - (unknown-vector00 vector :inline :offset 448) ;; from - logic-target::build-conversions - (unknown-vector01 vector :inline :offset 464) ;; from - logic-target::turn-to-vector - (unknown-vector02 vector :inline :offset 480) ;; from - logic-target::do-rotations2 - (unknown-quaternion00 quaternion :inline :offset 496) ;; from - target-util::(method 27 control-info) - (unknown-quaternion01 quaternion :inline :offset 512) ;; from - logic-target::do-rotations2 - (unknown-float00 float :offset 528) ;; from - logic-target::do-rotations2 - (unknown-float01 float :offset 532) - (unknown-float02 float :offset 536) ;; from - logic-target::add-thrust - (unknown-vector10 vector :inline :offset 544) ;; from - logic-target::flat-setup - (unknown-vector11 vector :inline :offset 560) ;; from - logic-target::target-no-move-post - (unknown-vector12 vector :inline :offset 576) - (unknown-vector13 vector :inline :offset 592) ;; from - collide-shape::method-37 | target::mod-var-jump - (unknown-vector14 vector :inline :offset 608) ;; from - logic-target::target-no-move-post - (unknown-vector15 vector :inline :offset 624) ;; from - collide-shape::method-37 | target-handler::target-exit - (unknown-vector16 vector :inline :offset 640) ;; from - collide-shape::method-37 - (unknown-dynamics00 dynamics :offset 656) ;; from - logic-target::bend-gravity - (unknown-surface00 surface :offset 660) - (unknown-surface01 surface :offset 664) ;; not a symbol - target-util::target-align-vel-z-adjust - (unknown-cpad-info00 cpad-info :offset 668) ;; not a symbol - target-util::move-legs? - (unknown-float10 float :offset 672) ;; from - logic-target::turn-to-vector - (unknown-float11 float :offset 676) ;; from - logic-target::turn-to-vector - (unknown-float12 float :offset 680) ;; from - logic-target::turn-to-vector - (unknown-float13 float :offset 684) ;; from - logic-target::turn-to-vector - (unknown-vector20 vector :inline :offset 688) ;; from - logic-target::turn-to-vector - (unknown-vector21 vector :inline :offset 704) ;; from - logic-target::turn-to-vector - (unknown-vector22 vector :inline :offset 720) ;; from - logic-target::turn-to-vector - (unknown-vector23 vector :inline :offset 736) ;; from - logic-target::turn-to-vector - ; (unknown-dword-temp-01 uint64 :offset 776) ;; from - logic-target::read-pad - (unknown-vector-array00 vector 7 :inline :offset 752) ;; from - logic-target::turn-to-vector - (unknown-vector30 vector :inline :offset 880) ;; from - logic-target::read-pad - (unknown-vector31 vector :inline :offset 896) ;; from - logic-target::read-pad - (unknown-float20 float :offset 912) ;; from - logic-target::read-pad - (unknown-float21 float :offset 916) ;; from - logic-target::read-pad - (unknown-dword00 uint64 :offset 920) ;; from - logic-target::read-pad - (unknown-matrix00 matrix :inline :offset 928) ;; from - target-util::(method 16 target) - (unknown-matrix01 matrix :inline :offset 992) ;; from - target-util::(method 16 target) - (unknown-matrix02 matrix :inline :offset 1056) ;; from - logic-target::joint-points - (unknown-qword00 uint128 :offset 1136) - (unknown-float30 float :offset 1140) ;; from - logic-target::target-calc-camera-pos - (unknown-vector40 vector :inline :offset 1152) ;; from - logic-target::target-real-post - (unknown-float40 float :offset 1172) ;; from - target-death::lambda-1 - (unknown-float41 float :offset 1176) ;; from - logic-target::do-rotations2 - (unknown-int00 int32 :offset 1180) ;; from - logic-target::joint-points - (unknown-float50 float :offset 1168) ;; from - logic-target::target-real-post - (unknown-vector50 vector :inline :offset 1184) ;; from - logic-target::build-conversions - (unknown-vector51 vector :inline :offset 1200) ;; from - logic-target::build-conversions - (unknown-vector52 vector :inline :offset 1216) - (unknown-vector53 vector :inline :offset 1232) - (last-known-safe-ground vector :inline :offset 1248) - (unknown-vector55 vector :inline :offset 1264) - (unknown-dword10 time-frame :offset 1280) ;; from - collide-reaction-target::target-collision-reaction - (unknown-dword11 time-frame :offset 1288) ;; from - target-util::can-jump? - (unknown-float60 float :offset 1300) ;; from - target-util::can-duck? - (unknown-float61 float :offset 1304) ;; from - target-util::target-align-vel-z-adjust - (unknown-float62 float :offset 1308) ;; from - target-util::target-print-stats - (unknown-float63 float :offset 1312) ;; from - logic-target::target-compute-slopes - (unknown-float64 float :offset 1316) ;; from - logic-target::target-compute-slopes - (unknown-dword20 time-frame :offset 1320) ;; from target-util::turn-around? - TODO - (unknown-dword21 time-frame :offset 1328) ;; from target-util::turn-around? - TODO - (unknown-dword-coverage int64 :offset 1336) - (unknown-float-coverage-0 float :offset 1344) - (unknown-float-coverage-1 float :offset 1348) - (unknown-float-coverage-2 float :offset 1352) - (unknown-u32-coverage-0 uint32 :offset 1356) - (unknown-vector-coverage-0 vector :inline :offset 1376) - (unknown-vector-coverage-1 vector :inline :offset 1392) - (unknown-vector-coverage-2 vector :inline :offset 1440) - (unknown-vector-coverage-3 vector :inline :offset 1472) - (unknown-vector60 vector :inline :offset 1456) ;; from - logic-target::add-thrust - (unknown-vector61 vector :inline :offset 1504) ;; from - logic-target::add-thrust - (unknown-float70 float :offset 1520) ;; from - logic-target::add-thrust - (unknown-float71 float :offset 1524) ;; from - collide-shape::method-37 - (unknown-vector70 vector :inline :offset 1536) ;; from - logic-target::add-thrust - (unknown-vector71 vector :inline :offset 1552) ;; from - target-tube::tube-thrust - (unknown-vector72 vector :inline :offset 1568) ;; from - collide-reaction-racer::racer-collision-reaction - (unknown-vector73 vector :inline :offset 1584) ;; from - collide-reaction-racer::racer-collision-reaction - (unknown-handle00 handle :offset 1600) ;; from logic-target::reset-target-state - (unknown-sphere-array00 collide-shape-prim-sphere 3 :offset 1608) ;; from target-util::target-collide-set! and from target-util::target-danger-set! - (unknown-sphere00 collide-shape-prim-sphere :offset 1632) ;; from target-util::target-danger-set! - (unknown-sphere01 collide-shape-prim-sphere :offset 1636) ;; from target-util::target-danger-set! - (unknown-sphere02 collide-shape-prim-sphere :offset 1640) ;; from target-util::target-danger-set! - (unknown-int50 int32 :offset 1656) ;; from target::(enter target-wheel) - (unknown-dword30 time-frame :offset 1664) ;; from target::(trans target-walk) - (unknown-dword31 time-frame :offset 1672) ;; from target-util::can-hands? - (unknown-dword32 time-frame :offset 1680) ;; from target-util::can-hands? - (unknown-dword33 time-frame :offset 1688) ;; from target-util::can-feet? - (unknown-dword34 time-frame :offset 1696) ;; from target-util::can-feet? - (unknown-dword35 time-frame :offset 1704) ;; from target::(exit target-slide-down) - (unknown-dword36 time-frame :offset 1712) ;; from target::(trans target-jump) - (unknown-float80 float :offset 1724) ;; from logic-target::bend-gravity - (unknown-float81 float :offset 1728) ;; from logic-target::bend-gravity - (unknown-float82 float :offset 1732) ;; from logic-target::bend-gravity - (unknown-vector80 vector :inline :offset 1744) ;; from logic-target::joint-points - (unknown-cspace00 cspace :inline :offset 1760) ;; from logic-target::joint-points - (unknown-vector90 vector :score 100 :inline :offset 1776) ;; from logic-target::target-compute-edge - (unknown-vector91 vector :inline :offset 1792) ;; from logic-target::target-compute-edge - (unknown-vector92 vector :inline :offset 1824) ;; from logic-target::joint-points - (unknown-cspace10 cspace :inline :offset 1808) ;; from logic-target::joint-points - (unknown-symbol00 symbol :offset 1840) ;; from target-util::target-danger-set! - (unknown-float90 float :offset 1844) ;; from target-util::target-danger-set! - (unknown-float91 float :offset 1848) ;; from target-util::target-collide-set! - (unknown-vector-array10 vector 16 :inline :offset 1856) ;; from target-util::turn-around? - (unknown-float100 float :offset 2112) ;; from target-util::turn-around? - (unknown-int10 int32 :offset 2116) ;; from target-util::turn-around? - (unknown-float110 float :offset 2120) ;; from logic-target::target-compute-edge - (unknown-vector100 vector :inline :offset 2128) ;; from logic-target::target-compute-edge - (unknown-vector101 vector :inline :offset 2144) ;; from logic-target::target-compute-edge - (unknown-dword40 time-frame :offset 2160) ;; from logic-target::target-compute-edge - (unknown-dword41 time-frame :offset 2168) ;; from logic-target::target-compute-edge - (unknown-handle10 handle :offset 2176) ;; from logic-target::target-compute-pole - probably a swingpole - (unknown-uint20 uint32 :offset 2184) ;; from target::(trans target-running-attack) - (unknown-spoolanim00 spool-anim :offset 2184) ;; from target2::(trans target-stance-ambient) - (unknown-int20 int32 :offset 2184) ;; from (anon-function 1 basebutton) - (unknown-symbol20 symbol :offset 2184) ;; from (anon-function 1 basebutton) - (unknown-float120 float :offset 2184) ;; from target::mod-var-jump - (unknown-int21 int32 :offset 2188) ;; from logic-target::target-compute-pole - (unknown-uint30 uint32 :offset 2188) ;; from target::(code target-running-attack) - (unknown-float121 float :offset 2188) ;; from target::mod-var-jump - (unknown-uint31 uint32 :offset 2192) ;; from target::(trans target-running-attack) - (unknown-float122 float :offset 2196) ;; from target::(trans target-jump) - (unknown-float123 float :offset 2200) ;; from target::mod-var-jump - (unknown-float124 float :offset 2204) ;; from target::init-var-jump - (unknown-vector102 vector :inline :offset 2224) ;; from (anon-function 3 basebutton) - (unknown-vector103 vector :inline :offset 2240) ;; from (anon-function 3 basebutton) - (unknown-quaternion02 quaternion :inline :offset 2256) ;; from racer-states::(code target-racing-get-on) - (unknown-quaternion03 quaternion :inline :offset 2272) ;; from racer-states::(code target-racing-get-on) - (unknown-smush00 smush-control :inline :offset 2288) ;; from (event target-fishing) - (unknown-vector110 vector :inline :offset 2320) ;; from logic-target::flag-setup - (unknown-vector111 vector :inline :offset 2336) ;; from logic-target::flag-setup - (unknown-symbol30 symbol :offset 2384) ;; from target-util::target-danger-set! - (unknown-int31 uint32 :offset 2384) ;; from target:: (event target-running-attack) - (unknown-dword50 int64 :offset 2392) ;; from target-util::target-start-attack - (unknown-dword51 int64 :offset 2400) ;; from target-util::target-start-attack - (unknown-pointer00 pointer :offset 2416) ;; from target-handler::target-standard-event-handler - (unknown-symbol40 symbol :offset 2428) ;; from logic-target::post-flag-setup - (unknown-dword60 int64 :offset 2432) ;; from target::(enter target-jump) - (unknown-dword61 int64 :offset 2440) ;; from target::(enter target-jump) - (unknown-dword62 int64 :offset 2448) ;; from target::(enter target-jump) - probably some sort of object64 that's used as a vector? - (unknown-dword63 int64 :offset 2456) ;; from target::(enter target-jump) - (unknown-halfword00 int16 :offset 2488) ;; from logic-target::target-move-dist - ;; these were determined from racer-collision-reaction. - (history-length int16 :offset 2490) - (history-data collide-history 128 :inline :offset-assert 2496) - (unknown-float140 float :offset 18944) - (unknown-dword70 time-frame :offset 18952) ;; from logic-target::add-thrust - (unknown-int40 int32 :offset 18880) ;; from logic-target::flag-setup - (unknown-dword80 time-frame :offset 18888) ;; from logic-target::post-flag-setup - (unknown-dword81 time-frame :offset 18896) ;; from logic-target::post-flag-setup - (unknown-float130 float :offset 18904) ;; from target2::target-swim-tilt - (unknown-float131 float :offset 18908) ;; from target2::target-swim-tilt - (unknown-dword82 time-frame :offset 18912) ;; from logic-target::reset-target-state - (unknown-vector120 vector :inline :offset 18928) ;; from target::(code target-running-attack) - (unknown-float150 float :offset 18944) ;; from target::(code target-wheel-flip) - (unknown-vector121 vector :inline :offset 18960) ;; from target collide response - (unknown-int60 uint32 :offset 18976) ;; from logic-target::print-target-stats - (unknown-soundid00 sound-id :offset 18980) ;; from powerups::target-powerup-process - (unknown-float141 float :offset 18984) ;; from powerups::target-powerup-process + ((unknown-vector00 vector :inline :offset 448) + (unknown-vector01 vector :inline :offset 464) + (unknown-vector02 vector :inline :offset 480) + (unknown-quaternion00 quaternion :inline :offset 496) + (unknown-quaternion01 quaternion :inline :offset 512) + (unknown-float00 float :offset 528) + (unknown-float01 float :offset 532) + (unknown-float02 float :offset 536) + (unknown-vector10 vector :inline :offset 544) + (unknown-vector11 vector :inline :offset 560) + (unknown-vector12 vector :inline :offset 576) + (unknown-vector13 vector :inline :offset 592) + (unknown-vector14 vector :inline :offset 608) + (unknown-vector15 vector :inline :offset 624) + (unknown-vector16 vector :inline :offset 640) + (unknown-dynamics00 dynamics :offset 656) + (unknown-surface00 surface :offset 660) + (unknown-surface01 surface :offset 664) + (unknown-cpad-info00 cpad-info :offset 668) + (unknown-float10 float :offset 672) + (unknown-float11 float :offset 676) + (unknown-float12 float :offset 680) + (unknown-float13 float :offset 684) + (unknown-vector20 vector :inline :offset 688) + (unknown-vector21 vector :inline :offset 704) + (unknown-vector22 vector :inline :offset 720) + (unknown-vector23 vector :inline :offset 736) + (unknown-vector-array00 vector 7 :inline :offset 752) + (unknown-vector30 vector :inline :offset 880) + (unknown-vector31 vector :inline :offset 896) + (unknown-float20 float :offset 912) + (unknown-float21 float :offset 916) + (unknown-dword00 uint64 :offset 920) + (unknown-matrix00 matrix :inline :offset 928) + (unknown-matrix01 matrix :inline :offset 992) + (unknown-matrix02 matrix :inline :offset 1056) + (unknown-qword00 uint128 :offset 1136) + (unknown-float30 float :offset 1140) + (unknown-vector40 vector :inline :offset 1152) + (unknown-float40 float :offset 1172) + (unknown-float41 float :offset 1176) + (unknown-int00 int32 :offset 1180) + (unknown-float50 float :offset 1168) + (unknown-vector50 vector :inline :offset 1184) + (unknown-vector51 vector :inline :offset 1200) + (unknown-vector52 vector :inline :offset 1216) + (unknown-vector53 vector :inline :offset 1232) + (last-known-safe-ground vector :inline :offset 1248) + (unknown-vector55 vector :inline :offset 1264) + (unknown-dword10 time-frame :offset 1280) + (unknown-dword11 time-frame :offset 1288) + (unknown-float60 float :offset 1300) + (unknown-float61 float :offset 1304) + (unknown-float62 float :offset 1308) + (unknown-float63 float :offset 1312) + (unknown-float64 float :offset 1316) + (unknown-dword20 time-frame :offset 1320) + (unknown-dword21 time-frame :offset 1328) + (unknown-dword-coverage int64 :offset 1336) + (unknown-float-coverage-0 float :offset 1344) + (unknown-float-coverage-1 float :offset 1348) + (unknown-float-coverage-2 float :offset 1352) + (unknown-u32-coverage-0 uint32 :offset 1356) + (unknown-vector-coverage-0 vector :inline :offset 1376) + (unknown-vector-coverage-1 vector :inline :offset 1392) + (unknown-vector-coverage-2 vector :inline :offset 1440) + (unknown-vector-coverage-3 vector :inline :offset 1472) + (unknown-vector60 vector :inline :offset 1456) + (unknown-vector61 vector :inline :offset 1504) + (unknown-float70 float :offset 1520) + (unknown-float71 float :offset 1524) + (unknown-vector70 vector :inline :offset 1536) + (unknown-vector71 vector :inline :offset 1552) + (unknown-vector72 vector :inline :offset 1568) + (unknown-vector73 vector :inline :offset 1584) + (unknown-handle00 handle :offset 1600) + (unknown-sphere-array00 collide-shape-prim-sphere 3 :offset 1608) + (unknown-sphere00 collide-shape-prim-sphere :offset 1632) + (unknown-sphere01 collide-shape-prim-sphere :offset 1636) + (unknown-sphere02 collide-shape-prim-sphere :offset 1640) + (unknown-int50 int32 :offset 1656) + (unknown-dword30 time-frame :offset 1664) + (unknown-dword31 time-frame :offset 1672) + (unknown-dword32 time-frame :offset 1680) + (unknown-dword33 time-frame :offset 1688) + (unknown-dword34 time-frame :offset 1696) + (unknown-dword35 time-frame :offset 1704) + (unknown-dword36 time-frame :offset 1712) + (unknown-float80 float :offset 1724) + (unknown-float81 float :offset 1728) + (unknown-float82 float :offset 1732) + (unknown-vector80 vector :inline :offset 1744) + (unknown-cspace00 cspace :inline :offset 1760) + (unknown-vector90 vector :inline :offset 1776) + (unknown-vector91 vector :inline :offset 1792) + (unknown-vector92 vector :inline :offset 1824) + (unknown-cspace10 cspace :inline :offset 1808) + (unknown-symbol00 symbol :offset 1840) + (unknown-float90 float :offset 1844) + (unknown-float91 float :offset 1848) + (unknown-vector-array10 vector 16 :inline :offset 1856) + (unknown-float100 float :offset 2112) + (unknown-int10 int32 :offset 2116) + (unknown-float110 float :offset 2120) + (unknown-vector100 vector :inline :offset 2128) + (unknown-vector101 vector :inline :offset 2144) + (unknown-dword40 time-frame :offset 2160) + (unknown-dword41 time-frame :offset 2168) + (unknown-handle10 handle :offset 2176) + (unknown-uint20 uint32 :offset 2184) + (unknown-spoolanim00 spool-anim :offset 2184) + (unknown-int20 int32 :offset 2184) + (unknown-symbol20 symbol :offset 2184) + (unknown-float120 float :offset 2184) + (unknown-int21 int32 :offset 2188) + (unknown-uint30 uint32 :offset 2188) + (unknown-float121 float :offset 2188) + (unknown-uint31 uint32 :offset 2192) + (unknown-int37 int32 :offset 2192) + (unknown-float122 float :offset 2196) + (unknown-float123 float :offset 2200) + (unknown-float124 float :offset 2204) + (unknown-vector102 vector :inline :offset 2224) + (unknown-vector103 vector :inline :offset 2240) + (unknown-quaternion02 quaternion :inline :offset 2256) + (unknown-quaternion03 quaternion :inline :offset 2272) + (unknown-smush00 smush-control :inline :offset 2288) + (unknown-vector110 vector :inline :offset 2320) + (unknown-vector111 vector :inline :offset 2336) + (unknown-symbol30 symbol :offset 2384) + (unknown-int31 uint32 :offset 2384) + (unknown-dword50 int64 :offset 2392) + (unknown-dword51 int64 :offset 2400) + (unknown-pointer00 pointer :offset 2416) + (unknown-symbol40 symbol :offset 2428) + (unknown-dword60 int64 :offset 2432) + (unknown-dword61 int64 :offset 2440) + (unknown-dword62 int64 :offset 2448) + (unknown-dword63 int64 :offset 2456) + (unknown-halfword00 int16 :offset 2488) + (history-length int16 :offset 2490) + (history-data collide-history 128 :inline :offset-assert 2496) + (unknown-float140 float :offset 18944) + (unknown-dword70 time-frame :offset 18952) + (unknown-int40 int32 :offset 18880) + (unknown-dword80 time-frame :offset 18888) + (unknown-dword81 time-frame :offset 18896) + (unknown-float130 float :offset 18904) + (unknown-float131 float :offset 18908) + (unknown-dword82 time-frame :offset 18912) + (unknown-vector120 vector :inline :offset 18928) + (unknown-float150 float :offset 18944) + (unknown-vector121 vector :inline :offset 18960) + (wall-pat pat-surface :offset 18976) + (unknown-soundid00 sound-id :offset 18980) + (unknown-float141 float :offset 18984) + (unknown-soundid01 sound-id :offset 18988) + (unknown-int34 int32 :offset 18992) + (unknown-int35 int32 :offset 18996) + (unknown-int36 int32 :offset 19000) ) - :size-assert #x4a2c :method-count-assert 65 - :flag-assert #x4100004a2c + :size-assert #x4a3c + :flag-assert #x4100004a3c ) (defmethod update! collide-history ((obj collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector)) diff --git a/goal_src/engine/collide/collide-touch-h.gc b/goal_src/engine/collide/collide-touch-h.gc index 1e8dcbc572..6a87e4e155 100644 --- a/goal_src/engine/collide/collide-touch-h.gc +++ b/goal_src/engine/collide/collide-touch-h.gc @@ -13,6 +13,9 @@ ;; As the collision is resolved, shapes are added and removed from the touching list. ;; Once collision is done solving, you can send events or inspect what you touched! + +(defconstant TOUCHING_LIST_LENGTH 32) + ;; A record of a primitive which is touching another, possibly including the triangle that is involved. (deftype touching-prim (structure) ((cprim collide-shape-prim :offset-assert 0) @@ -123,11 +126,11 @@ ) ) -;; A list of (up to) 32 pairs of colliding shapes +;; A list of (up to) TOUCHING_LIST_LENGTH pairs of colliding shapes (deftype touching-list (structure) ((num-touching-shapes int32 :offset-assert 0) (resolve-u int8 :offset-assert 4) - (touching-shapes touching-shapes-entry 32 :inline :offset-assert 8) + (touching-shapes touching-shapes-entry TOUCHING_LIST_LENGTH :inline :offset-assert 8) ) :method-count-assert 15 :size-assert #x208 @@ -171,6 +174,6 @@ ;; We have a pool of prim pairs that can be used in any shape pair (define-perm *touching-prims-entry-pool* touching-prims-entry-pool (new 'global 'touching-prims-entry-pool)) -;; and a list of up to 32 shape pairs +;; and a list of up to TOUCHING_LIST_LENGTH shape pairs (define-perm *touching-list* touching-list (new 'global 'touching-list)) diff --git a/goal_src/engine/collide/collide-touch.gc b/goal_src/engine/collide/collide-touch.gc index 783f1cdbcc..371fe58ee2 100644 --- a/goal_src/engine/collide/collide-touch.gc +++ b/goal_src/engine/collide/collide-touch.gc @@ -71,9 +71,8 @@ (set! (-> arg0 next) v1-1) (set! (-> arg0 prev) #f) (set! (-> obj head) arg0) - (when v1-1 + (if v1-1 (set! (-> v1-1 prev) arg0) - arg0 ) ) ) @@ -111,7 +110,7 @@ ;; Touching List ;;;;;;;;;;;;;;;;;;;;;; -;; A touching list is a list up to 32 pairs of colliding collide-shapes. +;; A touching list is a list up to TOUCHING_LIST_LENGTH pairs of colliding collide-shapes. (defmethod free-all-prim-nodes touching-list ((obj touching-list)) "Free all prim nodes used by all touching shapes in this touching-list." @@ -163,7 +162,7 @@ ) (else ;; need to add a new one - (when (>= (-> obj num-touching-shapes) 32) + (when (>= (-> obj num-touching-shapes) TOUCHING_LIST_LENGTH) ;; but there's no room! (format 0 "ERROR: touching-list::get-shapes-entry() failed!~%") (return (the-as touching-shapes-entry #f)) @@ -429,72 +428,84 @@ "Send all events for touching shapes. Note that the order of event sending is basically random. (this could explain lava walks's unreliable behavior)" - (let ((gp-0 (the-as object (-> obj touching-shapes)))) - (countdown (s5-0 (-> obj num-touching-shapes)) - (let ((s4-0 (-> (the-as touching-shapes-entry gp-0) cshape1))) - (when s4-0 - (let ((s3-0 (-> (the-as touching-shapes-entry gp-0) cshape2))) + + ;; PC port note : there is a fatal bug here where the processes are NOT SAFE to use without a handle. + ;; this can lead to crashes if for example target hits 2 things at once, and one of those things kills the other. + ;; e.g.: target hits eco1 and eco2. eco1 gets processed first and kills eco2 as a result. eco2 is now dead, but + ;; the touching list will run its logic on it regardless. + ;; this is fixed here by creating a really large list of 2 handles per collide shape and storing all collided + ;; process handles there. (process->handle) is then safe to use. + + ; (* 2 TOUCHING_LIST_LENGTH) -> 64 + (let ((handles (new 'stack-no-clear 'array 'handle 64))) + + (let ((entry (the-as touching-shapes-entry (-> obj touching-shapes)))) + (countdown (i (-> obj num-touching-shapes)) + (let ((c1 (-> entry cshape1))) + (when c1 + (let ((c2 (-> entry cshape2))) ;; not quite sure why, but we make it look like cshape1 (s4) is target always. ;; I guess this makes it so the target/enemy events are always sent in the same order. - (when (= (-> s3-0 process type) target) - (let ((v1-2 s4-0)) - (set! s4-0 s3-0) - (set! s3-0 v1-2) - ) + (when (= (-> c2 process type) target) + (swap! c1 c2) + ) + + (set! (-> handles (+ 0 (* 2 i))) (process->handle (-> c1 process))) + (set! (-> handles (+ 1 (* 2 i))) (process->handle (-> c2 process))) + ) + ) + ) + (set! entry (-> (the-as (inline-array touching-shapes-entry) entry) 1)) + ) + ) + + (let ((entry (the-as touching-shapes-entry (-> obj touching-shapes)))) + (countdown (i (-> obj num-touching-shapes)) + (let ((c1 (-> entry cshape1))) + (when c1 + (let ((c2 (-> entry cshape2))) + + ;; not quite sure why, but we make it look like cshape1 (s4) is target always. + ;; I guess this makes it so the target/enemy events are always sent in the same order. + (when (= (-> c2 process type) target) + (swap! c1 c2) ) ;; send events! - (let ((v1-4 (-> s4-0 event-self))) - (when v1-4 - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) (-> s3-0 process)) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) (the-as symbol v1-4)) - (set! (-> a1-0 param 0) (the-as uint gp-0)) - (send-event-function (-> s4-0 process) a1-0) + (let ( + (c1-proc (handle->process (-> handles (+ 0 (* 2 i))))) + (c2-proc (handle->process (-> handles (+ 1 (* 2 i))))) ) + (let ((v1-4 (-> c1 event-self))) + (if v1-4 + (send-event c1-proc v1-4 :from c2-proc entry) + ) ) - ) - (let ((v1-5 (-> s4-0 event-other))) - (when v1-5 - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) (-> s4-0 process)) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) (the-as symbol v1-5)) - (set! (-> a1-1 param 0) (the-as uint gp-0)) - (send-event-function (-> s3-0 process) a1-1) - ) + (let ((v1-5 (-> c1 event-other))) + (if v1-5 + (send-event c2-proc v1-5 :from c1-proc entry) + ) ) - ) - (let ((v1-6 (-> s3-0 event-self))) - (when v1-6 - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) (-> s4-0 process)) - (set! (-> a1-2 num-params) 1) - (set! (-> a1-2 message) (the-as symbol v1-6)) - (set! (-> a1-2 param 0) (the-as uint gp-0)) - (send-event-function (-> s3-0 process) a1-2) - ) + (let ((v1-6 (-> c2 event-self))) + (if v1-6 + (send-event c2-proc v1-6 :from c1-proc entry) + ) ) - ) - (let ((v1-7 (-> s3-0 event-other))) - (when v1-7 - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) (-> s3-0 process)) - (set! (-> a1-3 num-params) 1) - (set! (-> a1-3 message) (the-as symbol v1-7)) - (set! (-> a1-3 param 0) (the-as uint gp-0)) - (send-event-function (-> s4-0 process) a1-3) - ) + (let ((v1-7 (-> c2 event-other))) + (if v1-7 + (send-event c1-proc v1-7 :from c2-proc entry) + ) ) ) ) ) ) - (set! gp-0 (&+ (the-as touching-shapes-entry gp-0) 16)) + (set! entry (-> (the-as (inline-array touching-shapes-entry) entry) 1)) ) ) + + ) 0 (none) ) diff --git a/goal_src/engine/collide/collide.gc b/goal_src/engine/collide/collide.gc index f41db06a5e..9689eda268 100644 --- a/goal_src/engine/collide/collide.gc +++ b/goal_src/engine/collide/collide.gc @@ -7,28 +7,22 @@ ;; DECOMP BEGINS -(define - *collide-vif0-init* - (the-as (array uint32) - (new - 'static - 'boxed-array - :type uint32 :length 12 :allocated-length 12 - #x30000000 - #x4d000000 - #x4d000000 - #x4d000000 - #x3f800000 - #x5000001 - #x20000000 - #x40404040 - #x1000404 - #x0 - #x0 - #x0 - ) - ) - ) +(define *collide-vif0-init* (the-as (array uint32) (new 'static 'boxed-array :type uint32 + #x30000000 + #x4d000000 + #x4d000000 + #x4d000000 + #x3f800000 + #x5000001 + #x20000000 + #x40404040 + #x1000404 + #x0 + #x0 + #x0 + ) + ) + ) diff --git a/goal_src/engine/collide/main-collide.gc b/goal_src/engine/collide/main-collide.gc index 24f28032d6..f677d2955e 100644 --- a/goal_src/engine/collide/main-collide.gc +++ b/goal_src/engine/collide/main-collide.gc @@ -209,7 +209,7 @@ (.svf (&-> a2-0 quad) vf9) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) a2-0 a3-0 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) diff --git a/goal_src/engine/data/art-h.gc b/goal_src/engine/data/art-h.gc index 2794501746..33e43320b9 100644 --- a/goal_src/engine/data/art-h.gc +++ b/goal_src/engine/data/art-h.gc @@ -143,6 +143,7 @@ ;; "art" is an overly general parent class of all art data. ;; it can be either a container of arts (art-group) or a single art (art-element) +(declare-type res-lump basic) (deftype art (basic) ((name string :offset 8) (length int32 :offset-assert 12) @@ -185,13 +186,13 @@ (artist-step float :offset 28) (master-art-group-name string :offset 32) (master-art-group-index int32 :offset 36) - + ;; facial animation (blerc-data (pointer uint8) :offset 40) ;; todo, this is probably something else - + ;; compressed animation data (frames joint-anim-compressed-control :offset 44) - + ;; per-joint info for each joint in the animation. (data joint-anim-compressed :dynamic) ) @@ -238,7 +239,7 @@ ;; the "skeleton group" is defined in code and tells the engine ;; how to actually use the art from the level data for this object. (deftype skeleton-group (basic) - ((art-group-name basic :offset-assert 4) + ((art-group-name string :offset-assert 4) (jgeo int32 :offset-assert 8) (janim int32 :offset-assert 12) (bounds vector :inline :offset-assert 16) @@ -384,11 +385,27 @@ (-> obj skeleton bones 0 position) ) +;; look up the index of an art element in an art group. +(desfun art-elt->index (ag-name elt-name) + (if (number? elt-name) + elt-name + (let ((ag-info (hash-table-try-ref *art-info* (symbol->string ag-name)))) + (if (not (car ag-info)) + -1 + (let ((elt-info (hash-table-try-ref (cdr ag-info) (symbol->string elt-name)))) + (if (not (car elt-info)) + -1 + (cadr (cdr elt-info))) + ) + ) + ) + ) + ) (defmacro defskelgroup (name art-name joint-geom joint-anim lods &key (shadow 0) &key bounds - &key longest-edge + &key (longest-edge 0.0) &key (texture-level 0) &key (sort 0) &key (version 6) ;; do NOT use this! @@ -402,18 +419,18 @@ :longest-edge ,longest-edge :version ,version :max-lod ,(- (length lods) 1) - :shadow ,shadow + :shadow ,(art-elt->index (string->symbol-format "{}-ag" art-name) shadow) :texture-level ,texture-level :sort ,sort ))) ;; set joint geometry and joint bones - (set! (-> skel jgeo) ,joint-geom) - (set! (-> skel janim) ,joint-anim) - + (set! (-> skel jgeo) ,(art-elt->index (string->symbol-format "{}-ag" art-name) joint-geom)) + (set! (-> skel janim) ,(art-elt->index (string->symbol-format "{}-ag" art-name) joint-anim)) + ;; set lods ,@(apply-i (lambda (x i) `(begin - (set! (-> skel mgeo ,i) ,(car x)) + (set! (-> skel mgeo ,i) ,(art-elt->index (string->symbol-format "{}-ag" art-name) (car x))) (set! (-> skel lod-dist ,i) ,(cadr x)) ) ) lods) diff --git a/goal_src/engine/debug/anim-tester.gc b/goal_src/engine/debug/anim-tester.gc index 1734d48e80..64ba798212 100644 --- a/goal_src/engine/debug/anim-tester.gc +++ b/goal_src/engine/debug/anim-tester.gc @@ -216,7 +216,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-3 (the-as (pointer dma-tag) a3-6) ) @@ -235,7 +235,7 @@ (let ((v1-88 (-> arg0 the-node))) "is this node the start of the list. #t = start" (when (not (not (-> v1-88 prev))) - (while #t + (loop (let ((v1-92 (-> arg0 the-node))) "return the previous node in the list" (let ((v1-93 (-> v1-92 prev))) @@ -272,7 +272,7 @@ (let ((v1-107 (-> arg0 the-node))) "is this node the end of the list. #t = end" (when (not (not (-> v1-107 next))) - (while #t + (loop (let ((v1-111 (-> arg0 the-node))) "return the next node in the list" (let ((v1-112 (-> v1-111 next))) @@ -345,7 +345,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-6 (the-as (pointer dma-tag) a3-12) ) @@ -429,10 +429,10 @@ (defun anim-tester-num-print ((arg0 basic) (arg1 float)) (cond - ((= arg1 (-> (new 'static 'array float 1 -2.0) 0)) + ((= arg1 -2.0) (format arg0 "max") ) - ((= arg1 (-> (new 'static 'array float 1 -1.0) 0)) + ((= arg1 -1.0) (format arg0 "min") ) (else @@ -565,8 +565,8 @@ (set! (-> (the-as anim-test-seq-item v0-0) privname) arg1) (set! (-> (the-as anim-test-seq-item v0-0) speed) 100) (set! (-> (the-as anim-test-seq-item v0-0) blend) 0) - (set! (-> (the-as anim-test-seq-item v0-0) first-frame) (-> (new 'static 'array float 1 -1.0) 0)) - (set! (-> (the-as anim-test-seq-item v0-0) last-frame) (-> (new 'static 'array float 1 -2.0) 0)) + (set! (-> (the-as anim-test-seq-item v0-0) first-frame) -1.0) + (set! (-> (the-as anim-test-seq-item v0-0) last-frame) -2.0) (the-as anim-test-seq-item v0-0) ) ) @@ -722,10 +722,8 @@ (defbehavior anim-tester-update-anim-info anim-tester ((arg0 anim-test-seq-item)) (set! (-> self anim-first) (-> arg0 first-frame)) (set! (-> self anim-last) (-> arg0 last-frame)) - (set! (-> self anim-gspeed) (* (-> (new 'static 'array float 1 0.01) 0) (the float (-> self speed)))) - (set! (-> self anim-speed) - (* (-> (new 'static 'array float 1 0.01) 0) (-> self anim-gspeed) (the float (-> arg0 speed))) - ) + (set! (-> self anim-gspeed) (* 0.01 (the float (-> self speed)))) + (set! (-> self anim-speed) (* 0.01 (-> self anim-gspeed) (the float (-> arg0 speed)))) (when (< (-> self anim-speed) 0.0) (set! (-> self anim-first) (-> arg0 last-frame)) (set! (-> self anim-last) (-> arg0 first-frame)) @@ -771,11 +769,11 @@ (set! (-> self draw art-group) (-> v1-1 obj-art-group)) (set! (-> self draw cur-lod) -1) (set! (-> self draw jgeo) a0-15) - (set! (-> self draw sink-group) (-> *level* level-default foreground-sink-group 1)) + (set! (-> self draw sink-group) (-> *level* level-default pris-tex-foreground-sink-group)) (set! (-> self draw lod-set lod 0 geo) a1-4) ) - (set! (-> self draw lod-set lod 0 dist) (-> (new 'static 'array float 1 4095996000.0) 0)) - (set! (-> self draw bounds w) (-> (new 'static 'array float 1 40960.0) 0)) + (set! (-> self draw lod-set lod 0 dist) 4095996000.0) + (set! (-> self draw bounds w) 40960.0) (set! (-> self draw data-format) (the-as uint 1)) (let ((v1-16 (-> (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) quad))) (set! (-> self draw color-mult quad) v1-16) @@ -812,13 +810,13 @@ (gp-0 (-> s3-0 base)) ) (cond - ((= arg1 (-> (new 'static 'array float 1 -1.0) 0)) + ((= arg1 -1.0) (let ((s2-1 draw-string-adv)) (format (clear *temp-string*) "~Smin" arg0) (s2-1 *temp-string* s3-0 arg3) ) ) - ((= arg1 (-> (new 'static 'array float 1 -2.0) 0)) + ((= arg1 -2.0) (let ((s2-2 draw-string-adv)) (format (clear *temp-string*) "~Smax" arg0) (s2-2 *temp-string* s3-0 arg3) @@ -847,7 +845,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-2) ) @@ -942,7 +940,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-2) ) @@ -1017,7 +1015,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-2 (the-as (pointer dma-tag) a3-4) ) @@ -1070,7 +1068,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-2) ) @@ -1087,7 +1085,7 @@ "is the list empty, #t = empty" (when (not (= (-> v1-15 tailpred) v1-15)) (let ((v1-17 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index)))) - (while #t + (loop "return the previous node in the list" (set! v1-17 (-> (the-as anim-test-obj v1-17) prev)) (let ((a0-23 (the-as anim-test-obj v1-17))) @@ -1111,7 +1109,7 @@ "is the list empty, #t = empty" (when (not (= (-> v1-21 tailpred) v1-21)) (let ((v1-23 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index)))) - (while #t + (loop "return the next node in the list" (set! v1-23 (-> (the-as anim-test-obj v1-23) next)) (let ((a0-40 (the-as anim-test-obj v1-23))) @@ -1189,7 +1187,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-1 (the-as (pointer dma-tag) a3-4) ) @@ -1246,7 +1244,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-2) ) @@ -1263,7 +1261,7 @@ "is the list empty, #t = empty" (when (not (= (-> v1-17 tailpred) v1-17)) (let ((v1-19 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index)))) - (while #t + (loop "return the previous node in the list" (set! v1-19 (-> (the-as anim-test-sequence v1-19) prev)) (let ((a0-24 (the-as anim-test-sequence v1-19))) @@ -1287,7 +1285,7 @@ "is the list empty, #t = empty" (when (not (= (-> v1-23 tailpred) v1-23)) (let ((v1-25 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index)))) - (while #t + (loop "return the next node in the list" (set! v1-25 (-> (the-as anim-test-sequence v1-25) next)) (let ((a0-42 (the-as anim-test-sequence v1-25))) @@ -1360,7 +1358,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-1 (the-as (pointer dma-tag) a3-4) ) @@ -1392,32 +1390,32 @@ (cond ((cpad-hold? 0 down) (cond - ((= arg0 (-> (new 'static 'array float 1 -2.0) 0)) - (set! arg0 (+ (-> (new 'static 'array float 1 -1.0) 0) arg1)) + ((= arg0 -2.0) + (set! arg0 (+ -1.0 arg1)) ) - ((!= arg0 (-> (new 'static 'array float 1 -1.0) 0)) - (set! arg0 (+ (-> (new 'static 'array float 1 -1.0) 0) arg0)) + ((!= arg0 -1.0) + (set! arg0 (+ -1.0 arg0)) (if (< arg0 0.0) - (set! arg0 (-> (new 'static 'array float 1 -1.0) 0)) + (set! arg0 (the-as float -1.0)) ) ) ) ) ((cpad-hold? 0 up) (cond - ((= arg0 (-> (new 'static 'array float 1 -1.0) 0)) - (set! arg0 (-> (new 'static 'array float 1 0.0) 0)) + ((= arg0 -1.0) + (set! arg0 (the-as float 0.0)) ) - ((!= arg0 (-> (new 'static 'array float 1 -2.0) 0)) - (set! arg0 (+ (-> (new 'static 'array float 1 1.0) 0) arg0)) + ((!= arg0 -2.0) + (set! arg0 (+ 1.0 arg0)) (if (>= arg0 arg1) - (set! arg0 (-> (new 'static 'array float 1 -2.0) 0)) + (set! arg0 (the-as float -2.0)) ) ) ) ) ) - arg0 + (the-as float arg0) ) (defun anim-tester-pick-item-setup ((arg0 anim-test-seq-item) (arg1 anim-test-sequence)) @@ -1483,7 +1481,7 @@ ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 1045] (defun anim-test-edit-sequence-list-handler ((arg0 int) (arg1 list-control)) (local-vars - (sv-192 (function string dma-buffer int int font-color font-flags none)) + (sv-192 (function string dma-buffer int int font-color font-flags float)) (sv-208 (function _varargs_ object)) ) (let ((gp-0 (-> arg1 the-node)) @@ -1501,7 +1499,7 @@ *font-default-matrix* (-> arg1 xpos) (-> arg1 ypos) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as font-color (if (= (-> arg1 the-index) (-> arg1 current-index)) 15 12 @@ -1535,7 +1533,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s1-0 (the-as (pointer dma-tag) a3-4) ) @@ -1586,7 +1584,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s1-1 (the-as (pointer dma-tag) a3-8) ) @@ -1680,7 +1678,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) (the-as pointer s4-1) (the-as (pointer dma-tag) a3-15) ) @@ -1977,7 +1975,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-2 (the-as (pointer dma-tag) a3-17) ) @@ -2008,7 +2006,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-3 (the-as (pointer dma-tag) a3-21) ) @@ -2066,7 +2064,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-1 (the-as (pointer dma-tag) a3-1) ) @@ -2108,7 +2106,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-3 (the-as (pointer dma-tag) a3-3) ) @@ -2151,7 +2149,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-4 (the-as (pointer dma-tag) a3-5) ) @@ -2182,7 +2180,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-5 (the-as (pointer dma-tag) a3-7) ) @@ -2209,7 +2207,7 @@ (s4-0 (-> arg0 playing-item)) ) (when (logtest? (-> v0-0 flags) 5) - (while #t + (loop (+! s4-0 1) (if (>= s4-0 (glst-num-elements (-> arg0 item-list))) (set! s4-0 0) @@ -2229,15 +2227,12 @@ ) (defstate anim-tester-process (anim-tester) - :event - anim-tester-standard-event-handler - :enter - (behavior () + :event anim-tester-standard-event-handler + :enter (behavior () (logior! (-> self flags) (anim-tester-flags fanimt1)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (zero? (logand (-> self flags) (anim-tester-flags fanimt1))) (= *master-mode* 'menu)) (anim-tester-interface) ) @@ -2246,17 +2241,16 @@ (debug-print-channels (-> self skel) (the-as symbol *stdcon*)) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self root trans) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (s4-0 glst-node) (s5-1 anim-test-seq-item) (gp-2 anim-test-sequence)) - (while #t + (loop (logclear! (-> self flags) (anim-tester-flags fanimt0)) (let ((v1-2 (-> self obj-list))) "is the list empty, #t = empty" @@ -2334,39 +2328,30 @@ (s4-1 (logior! (-> self flags) (anim-tester-flags fanimt0)) (if (nonzero? (-> s5-1 blend)) - (ja-channel-push! 1 (the int (* (the float (-> s5-1 blend)) (-> self anim-gspeed)))) + (ja-channel-push! 1 (the-as time-frame (the int (* (the float (-> s5-1 blend)) (-> self anim-gspeed))))) (ja-channel-set! 1) ) (cond - ((= (-> self anim-first) (-> (new 'static 'array float 1 -1.0) 0)) - (let ((s3-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! s3-0 s4-1 num-func-identity) - (set! (-> s3-0 frame-num) 0.0) - ) + ((= (-> self anim-first) -1.0) + (ja :group! s4-1 :num! min) ) - ((= (-> self anim-first) (-> (new 'static 'array float 1 -2.0) 0)) - (let ((s3-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! s3-1 s4-1 num-func-identity) - (set! (-> s3-1 frame-num) (the float (+ (-> s4-1 data 0 length) -1))) - ) + ((= (-> self anim-first) -2.0) + (ja :group! s4-1 :num! max) ) (else - (let ((s3-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! s3-2 s4-1 num-func-identity) - (set! (-> s3-2 frame-num) (-> self anim-first)) - ) + (ja :group! s4-1 :num! (identity (-> self anim-first))) ) ) (when (nonzero? (-> s5-1 blend)) (while (and (!= (-> self skel root-channel 0) (-> self skel channel)) (logtest? (-> s5-1 flags) 2)) (when (logtest? (-> self flags) (anim-tester-flags fanimt5)) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 + (compute-alignment! (-> self align)) + (align! (-> self align) - 31 - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel keep-other-velocities adjust-quat) + (the-as float 1.0) + (the-as float 1.0) + (the-as float 1.0) ) ) (suspend) @@ -2374,50 +2359,30 @@ ) (until (ja-done? 0) (when (logtest? (-> self flags) (anim-tester-flags fanimt5)) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 + (compute-alignment! (-> self align)) + (align! (-> self align) - 31 - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel keep-other-velocities adjust-quat) + (the-as float 1.0) + (the-as float 1.0) + (the-as float 1.0) ) ) (suspend) (anim-tester-update-anim-info s5-1) - (let ((v1-73 (= (-> self anim-last) (-> (new 'static 'array float 1 -2.0) 0)))) + (let ((v1-73 (= (-> self anim-last) -2.0))) (cond ((or v1-73 (>= (-> self anim-last) (-> self anim-first))) - (cond - ((= (-> self anim-last) (-> (new 'static 'array float 1 -2.0) 0)) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 param 0) (the float (+ (-> a0-42 frame-group data 0 length) -1))) - (set! (-> a0-42 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-42 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (else - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) (-> self anim-last)) - (set! (-> a0-43 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) - ) + (if (= (-> self anim-last) -2.0) + (ja :num! (seek! max (-> self anim-speed))) + (ja :num! (seek! (-> self anim-last) (-> self anim-speed))) ) - ) ) - ((= (-> self anim-last) (-> (new 'static 'array float 1 -1.0) 0)) - (let ((a0-44 (-> self skel root-channel 0))) - (set! (-> a0-44 param 0) 0.0) - (set! (-> a0-44 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-44 (the-as art-joint-anim #f) num-func-seek!) - ) + ((= (-> self anim-last) -1.0) + (ja :num! (seek! 0.0 (-> self anim-speed))) ) (else - (let ((a0-45 (-> self skel root-channel 0))) - (set! (-> a0-45 param 0) (-> self anim-last)) - (set! (-> a0-45 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-45 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (-> self anim-last) (-> self anim-speed))) ) ) ) @@ -2442,8 +2407,7 @@ ) (none) ) - :post - anim-tester-post + :post anim-tester-post ) (defbehavior initialize-anim-tester anim-tester () @@ -2463,11 +2427,7 @@ (set! (-> self list-con list-owner) (the-as uint self)) (quaternion-identity! (-> self root quat)) (vector-identity! (-> self root scale)) - (position-in-front-of-camera! - (-> self root trans) - (-> (new 'static 'array float 1 40960.0) 0) - (-> (new 'static 'array float 1 4096.0) 0) - ) + (position-in-front-of-camera! (-> self root trans) (the-as float 40960.0) (the-as float 4096.0)) (set! (-> self event-hook) anim-tester-standard-event-handler) (anim-tester-reset) (go anim-tester-process) @@ -2695,19 +2655,7 @@ (defun anim-tester-start () (anim-tester-stop) - (let ((gp-0 (get-process *16k-dead-pool* anim-tester #x4000))) - (set! *anim-tester* - (the-as (pointer anim-tester) - (when gp-0 - (let ((t9-2 (method-of-type anim-tester activate))) - (t9-2 (the-as anim-tester gp-0) *default-pool* 'anim-tester (the-as pointer #x70004000)) - ) - ((the-as (function process function none) run-function-in-process) gp-0 initialize-anim-tester) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! *anim-tester* (process-spawn anim-tester :init initialize-anim-tester :from *16k-dead-pool*)) (set! *camera-orbit-target* *anim-tester*) (send-event *camera* 'change-state cam-orbit 0) #f diff --git a/goal_src/engine/debug/debug.gc b/goal_src/engine/debug/debug.gc index 5e1275b053..0defb07bf4 100644 --- a/goal_src/engine/debug/debug.gc +++ b/goal_src/engine/debug/debug.gc @@ -894,7 +894,7 @@ (set! (-> gp-0 0 x) (* (sin (-> arg0 stick0-dir)) (-> arg0 stick0-speed))) (set! (-> gp-0 0 y) (* (cos (-> arg0 stick0-dir)) (-> arg0 stick0-speed))) (dotimes (s5-1 32) - (with-dma-buffer-add-bucket ((s3-0 (-> (current-frame) debug-buf)) (bucket-id debug-draw0)) + (with-dma-buffer-add-bucket ((s3-0 (-> (current-frame) debug-buf)) (bucket-id debug)) (draw-sprite2d-xy s3-0 (the int (* 120.0 (-> gp-0 s5-1 x))) (the int (* 144.0 (-> gp-0 s5-1 y))) @@ -907,31 +907,20 @@ (defun-debug add-debug-light ((arg0 symbol) (arg1 bucket-id) (arg2 light) (arg3 vector) (arg4 string)) (if (not arg0) - (return #f) - ) + (return #f) + ) (when (!= (-> arg2 levels x) 0.0) - (add-debug-vector arg0 arg1 - arg3 - (-> arg2 direction) - (meters 3) - (static-rgba #xff #xff #xff #x80) + (add-debug-vector arg0 arg1 arg3 (-> arg2 direction) (meters 3) (static-rgba #xff #xff #xff #x80)) + (let ((light-vec-end (vector+*! (new-stack-vector0) arg3 (-> arg2 direction) (* (meters 3) (-> arg2 levels x)))) + ;; the original code here uses w for alpha but that looks terrible + (light-rgba (new 'static 'rgba :r (the int (* 128.0 (-> arg2 color x))) + :g (the int (* 128.0 (-> arg2 color y))) + :b (the int (* 128.0 (-> arg2 color z))) + :a 128 + ))) + (add-debug-text-sphere arg0 arg1 light-vec-end (* (meters 0.5) (-> arg2 levels x)) (string-format "~S ~,,2f" arg4 (-> arg2 levels x)) light-rgba) + ) ) - ;; this might be wrong - (let ((light-vec-end (vector+*! (new-stack-vector0) arg3 (-> arg2 direction) (* (meters 3) (-> arg2 levels x)))) - (light-rgba (new 'static 'rgba :r (the int (* 128.0 (-> arg2 color x))) - :g (the int (* 128.0 (-> arg2 color y))) - :b (the int (* 128.0 (-> arg2 color z))) - :a (the int (* 128.0 (-> arg2 color w))) - )) - ) - (add-debug-text-sphere arg0 arg1 - light-vec-end - (* (meters 0.5) (-> arg2 levels x)) - (string-format "~S ~,,2f" arg4 (-> arg2 levels x)) - light-rgba - ) - ) - ) #f ) @@ -1010,7 +999,7 @@ (when arg1 (dotimes (s5-1 (1- (-> arg0 num-points))) (if (!= (+ s5-1 1) (-> arg0 h-first)) - (add-debug-line #t (bucket-id debug-draw1) + (add-debug-line #t (bucket-id debug-no-zbuf) (-> arg0 points s5-1) (-> arg0 points (1+ s5-1)) (static-rgba #x80 #xc0 #x80 #x80) #f (the-as rgba -1)) diff --git a/goal_src/engine/debug/default-menu.gc b/goal_src/engine/debug/default-menu.gc index 2624755135..48abac677d 100644 --- a/goal_src/engine/debug/default-menu.gc +++ b/goal_src/engine/debug/default-menu.gc @@ -60,10 +60,10 @@ (send-event *camera* 'reset-root) ) ((= arg0 9) - (set! (-> *camera* master-options) (logxor (-> *camera* master-options) 1)) + (logxor! (-> *camera* master-options) 1) ) ((= arg0 10) - (set! (-> *camera* master-options) (logxor (-> *camera* master-options) 4)) + (logxor! (-> *camera* master-options) 4) ) ((= arg0 11) (send-event *camera* 'toggle-slave-option 32) @@ -183,60 +183,53 @@ ) (defun dm-cam-render-float ((arg0 int) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (with-pp - (when (= arg1 (debug-menu-msg press)) - (cond - ((zero? (/ arg0 8)) - (when *math-camera* - (set! (-> *math-camera* fov) (* 182.04445 arg2)) - (update-math-camera - *math-camera* - (-> *setting-control* current video-mode) - (-> *setting-control* current aspect-ratio) - ) - ) - ) - ((= (/ arg0 8) 1) - (if *camera* - (send-event *camera* 'set-fov (* 182.04445 arg2)) - ) - ) - ) - ) + (when (= arg1 (debug-menu-msg press)) (cond ((zero? (/ arg0 8)) - (cond - (*math-camera* - (* 0.005493164 (-> *math-camera* fov)) - ) - (else - (empty) - arg3 + (when *math-camera* + (set! (-> *math-camera* fov) (* 182.04445 arg2)) + (update-math-camera + *math-camera* + (-> *setting-control* current video-mode) + (-> *setting-control* current aspect-ratio) ) ) ) ((= (/ arg0 8) 1) - (cond - (*camera* - (let ((f30-0 0.005493164) - (a1-3 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 0) - (set! (-> a1-3 message) 'query-fov) - (* f30-0 (the-as float (send-event-function *camera* a1-3))) - ) - ) - (else - (empty) - arg3 + (if *camera* + (send-event *camera* 'set-fov (* 182.04445 arg2)) ) + ) + ) + ) + (cond + ((zero? (/ arg0 8)) + (cond + (*math-camera* + (* 0.005493164 (-> *math-camera* fov)) + ) + (else + (empty) + arg3 ) ) - (else - (empty) - arg3 - ) + ) + ((= (/ arg0 8) 1) + (cond + (*camera* + (let ((f30-0 0.005493164)) + (* f30-0 (the-as float (send-event *camera* 'query-fov))) + ) + ) + (else + (empty) + arg3 + ) + ) + ) + (else + (empty) + arg3 ) ) ) @@ -473,7 +466,7 @@ (let ((v1-0 (find-instance-by-name *edit-instance*))) (when v1-0 (if (= arg1 (debug-menu-msg press)) - (set! (-> v1-0 flags) (logxor (-> v1-0 flags) (the-as uint arg0))) + (logxor! (-> v1-0 flags) (the-as uint arg0)) ) (logtest? (-> v1-0 flags) arg0) ) @@ -570,7 +563,7 @@ (cond (v1-0 (if (= arg1 (debug-menu-msg press)) - (set! (-> v1-0 flags) (logxor (-> v1-0 flags) 1)) + (logxor! (-> v1-0 flags) 1) ) (zero? (logand (-> v1-0 flags) 1)) ) @@ -624,7 +617,7 @@ (new 'debug 'debug-menu-item-flag - (the-as string (-> s3-1 array-data s2-1 name)) + (-> s3-1 array-data s2-1 name) (-> s3-1 array-data s2-1 name) dm-instance-pick-func ) @@ -636,7 +629,7 @@ (new 'debug 'debug-menu-item-flag - (the-as string (-> s3-1 array-data s2-1 name)) + (-> s3-1 array-data s2-1 name) (-> s3-1 array-data s2-1 name) dm-enable-instance-func ) @@ -3090,19 +3083,10 @@ ) (defun dm-task-get-money ((arg0 int) (arg1 debug-menu-msg)) - (with-pp - (if (= arg1 (debug-menu-msg press)) - (send-event *target* 'get-pickup 5 (-> *GAME-bank* money-task-inc)) - ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) pp) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'pickup)) - (set! (-> a1-2 param 1) (the-as uint 5)) - (>= (the-as float (send-event-function *target* a1-2)) (-> *GAME-bank* money-task-inc)) + (if (= arg1 (debug-menu-msg press)) + (send-event *target* 'get-pickup 5 (-> *GAME-bank* money-task-inc)) ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) (defun dm-give-all-cells ((arg0 int) (arg1 debug-menu-msg)) @@ -3285,13 +3269,13 @@ (case arg0 (('at-apply-align) (if (= arg1 (debug-menu-msg press)) - (set! (-> *anim-tester* 0 flags) (logxor (-> *anim-tester* 0 flags) (anim-tester-flags fanimt5))) + (logxor! (-> *anim-tester* 0 flags) (anim-tester-flags fanimt5)) ) (return (logtest? (-> *anim-tester* 0 flags) (anim-tester-flags fanimt5))) ) (('at-show-joint-info) (if (= arg1 (debug-menu-msg press)) - (set! (-> *anim-tester* 0 flags) (logxor (-> *anim-tester* 0 flags) (anim-tester-flags fanimt4))) + (logxor! (-> *anim-tester* 0 flags) (anim-tester-flags fanimt4)) ) (return (logtest? (-> *anim-tester* 0 flags) (anim-tester-flags fanimt4))) ) @@ -3757,15 +3741,18 @@ (function "Play" #f (lambda () (play #t #t))) (function "Start" #f (lambda () (the-as int (start 'debug (get-or-create-continue! *game-info*))))) (function "Stop" #f (lambda () (stop 'debug))) - (flag "Invulnerable" #f (lambda ((arg0 int) (arg1 debug-menu-msg)) - (when (= arg1 (debug-menu-msg press)) - (if *target* - (set! (-> *target* state-flags) (logxor (-> *target* state-flags) 16)) - ) - ) - (the-as symbol (and *target* (logtest? (-> *target* state-flags) 16))) - ) + (flag + "Invulnerable" + #f + (lambda ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (logxor! (-> *target* state-flags) (state-flags invulnerable)) + ) ) + (the-as symbol (and *target* (logtest? (-> *target* state-flags) (state-flags invulnerable)))) + ) + ) (function "Reset Trans" #f @@ -3974,6 +3961,11 @@ (defmacro new-dm-submenu (text menu) `(new 'debug 'debug-menu-item-submenu ,text ,menu) ) +(defmacro new-dm-var-float (text var func inc min max) + `(debug-menu-item-var-make-float (new 'debug 'debug-menu-item-var ,text ,var (* 8 20)) + (the-as (function int debug-menu-msg float float float) ,func) + ,inc #t ,min ,max 1) + ) (defun dm-want-level-toggle-pick-func ((arg0 pair) (arg1 debug-menu-msg)) (let* ((levname (the-as symbol (car arg0))) @@ -4052,7 +4044,7 @@ (new-dm-func (symbol->string (the-as symbol (car iter))) (-> (the-as symbol (car iter)) value) (lambda ((info level-load-info)) - (let ((tf (new 'stack 'transformq))) + (let ((tf (new 'stack-no-clear 'transformq))) (set! (-> tf trans x) (-> info bsphere x)) (set! (-> tf trans y) (-> info bsphere y)) (set! (-> tf trans z) (-> info bsphere z)) @@ -4240,6 +4232,19 @@ )) ) +(defmacro dm-lambda-float-var (val) + "helper macro for making float buttons" + `(lambda (arg (msg debug-menu-msg) (newval float)) + (cond + ((= msg (debug-menu-msg press)) + (set! ,val newval) + ) + (else + ,val + ) + )) + ) + (defmacro dm-lambda-meters-var (val) "helper macro for making meters buttons" `(lambda (arg (msg debug-menu-msg) (newval float)) @@ -4253,6 +4258,99 @@ )) ) +(defun dm-toggle-collision-pick-func ((arg symbol) (msg debug-menu-msg)) + (when (= msg (debug-menu-msg press)) + (cond + ((-> arg value) + (false! (-> arg value)) + (logior! *vu1-enable-user-menu* (vu1-renderer-mask tfrag trans-tfrag tie tie-near)) + (true! *generic-tie*) + ) + (else + (true! (-> arg value)) + (logclear! *vu1-enable-user-menu* (vu1-renderer-mask tfrag trans-tfrag tie tie-near)) + (false! *generic-tie*) + ) + ) + ) + (-> arg value) + ) + +(defun dm-collision-mode-pick-func ((arg pc-collision-mode) (msg debug-menu-msg)) + (when (= msg (debug-menu-msg press)) + (set! *collision-mode* arg) + ) + (= *collision-mode* arg) + ) + +(defun dm-collision-filter-mode-pick-func ((arg int) (msg debug-menu-msg)) + (when (= msg (debug-menu-msg press)) + (pc-set-collision-mask (pc-collision-mode mode) arg (not (pc-get-collision-mask (pc-collision-mode mode) arg))) + ) + (pc-get-collision-mask (pc-collision-mode mode) arg) + ) + +(defun dm-collision-filter-event-pick-func ((arg int) (msg debug-menu-msg)) + (when (= msg (debug-menu-msg press)) + (pc-set-collision-mask (pc-collision-mode event) arg (not (pc-get-collision-mask (pc-collision-mode event) arg))) + ) + (pc-get-collision-mask (pc-collision-mode event) arg) + ) + +(defun dm-collision-filter-material-pick-func ((arg int) (msg debug-menu-msg)) + (when (= msg (debug-menu-msg press)) + (pc-set-collision-mask (pc-collision-mode material) arg (not (pc-get-collision-mask (pc-collision-mode material) arg))) + ) + (pc-get-collision-mask (pc-collision-mode material) arg) + ) + +(defun dm-collision-filter-skip-pick-func ((arg int) (msg debug-menu-msg)) + (when (= msg (debug-menu-msg press)) + (pc-set-collision-mask (pc-collision-mode skip) arg (not (pc-get-collision-mask (pc-collision-mode skip) arg))) + ) + (pc-get-collision-mask (pc-collision-mode skip) arg) + ) + +(defun debug-menu-make-collision-renderer-menu ((ctx debug-menu-context)) + (let ((menu (new 'debug 'debug-menu ctx "Collision renderer menu"))) + ;; master toggle + (debug-menu-append-item menu (new-dm-bool "Enable" *collision-renderer* dm-toggle-collision-pick-func)) + (debug-menu-append-item menu (new-dm-bool "Wireframe" *collision-wireframe* dm-boolean-toggle-pick-func)) + (debug-menu-append-item menu (new-dm-submenu "Mode" + (let ((mode-menu (new 'debug 'debug-menu ctx "Collision renderer mode menu"))) + (doenum (name val pc-collision-mode) + (debug-menu-append-item mode-menu (new-dm-flag name val dm-collision-mode-pick-func)) + ) + mode-menu))) + (debug-menu-append-item menu (new-dm-submenu "Filter mode" + (let ((filter-menu (new 'debug 'debug-menu ctx "Collision renderer filter mode menu"))) + (doenum (name val pat-mode) + (debug-menu-append-item filter-menu (new-dm-flag name val dm-collision-filter-mode-pick-func)) + ) + filter-menu))) + (debug-menu-append-item menu (new-dm-submenu "Filter event" + (let ((filter-menu (new 'debug 'debug-menu ctx "Collision renderer filter event menu"))) + (doenum (name val pat-event) + (debug-menu-append-item filter-menu (new-dm-flag name val dm-collision-filter-event-pick-func)) + ) + filter-menu))) + (debug-menu-append-item menu (new-dm-submenu "Filter material" + (let ((filter-menu (new 'debug 'debug-menu ctx "Collision renderer filter material menu"))) + (doenum (name val pat-material) + (debug-menu-append-item filter-menu (new-dm-flag name val dm-collision-filter-material-pick-func)) + ) + filter-menu))) + (debug-menu-append-item menu (new-dm-submenu "Filter skip" + (let ((filter-menu (new 'debug 'debug-menu ctx "Collision renderer filter skip menu"))) + (doenum (name val pc-pat-skip-hack) + (debug-menu-append-item filter-menu (new-dm-flag name val dm-collision-filter-skip-pick-func)) + ) + filter-menu))) + + (new-dm-submenu "Collision renderer" menu) + ) + ) + (defun dm-lod-int ((arg0 int) (arg1 debug-menu-msg) (arg2 int) (arg3 int)) (when (= arg1 (debug-menu-msg press)) (case (/ arg0 8) @@ -4288,17 +4386,17 @@ (defun dm-mood-override-palette-pick-func ((bpal int) (msg debug-menu-msg)) (let* ((pal (/ bpal 8)) (cur-val (-> *pc-settings* mood-overrides pal))) - + (when (= msg (debug-menu-msg press)) (set! (-> *pc-settings* mood-overrides pal) (if (= cur-val 0.0) 1.0 0.0)) - + (when (not (= 'mult (-> *pc-settings* mood-override?))) (set! (-> *pc-settings* mood-override?) #f) (dotimes (i 8) (if (!= (-> *pc-settings* mood-overrides i) 0.0) (set! (-> *pc-settings* mood-override?) 'copy))) )) - + (= (-> *pc-settings* mood-overrides pal) 1.0) ) ) @@ -4317,6 +4415,71 @@ (-> *pc-settings* mood-overrides (/ pal 8)) ) +(defun dm-anim-tester-x-flag-func ((action symbol) (msg debug-menu-msg)) + (case action + (('at-show-joint-info) + (if (= msg (debug-menu-msg press)) + (logxor! (-> *ATX-settings* flags) (atx-flags show-joints))) + (return (logtest? (-> *ATX-settings* flags) (atx-flags show-joints))) + ) + ) + #f) + +(defun dm-anim-tester-x-func ((action symbol)) + (unless *atx* + (atx-start)) + + (case action + (('pick-art-group) + (set! (-> *atx* 0 edit-mode) (atx-edit-mode art-group)) + (false! *camera-read-buttons*) + ) + (('at-pick-joint-anim) + (when (-> *atx* 0 cur-art-group) + (set! (-> *atx* 0 edit-mode) (atx-edit-mode anim)) + (false! *camera-read-buttons*) + ) + ) + (('pick-mesh-geo) + (when (-> *atx* 0 cur-art-group) + (set! (-> *atx* 0 edit-mode) (atx-edit-mode mgeo)) + (false! *camera-read-buttons*) + ) + ) + (('pick-joint-geo) + (when (-> *atx* 0 cur-art-group) + (set! (-> *atx* 0 edit-mode) (atx-edit-mode jgeo)) + (false! *camera-read-buttons*) + ) + ) + (('at-cam-free-floating) + (send-event *camera* 'change-state cam-free-floating 0) + ) + (('at-cam-orbit) + (send-event *camera* 'change-state cam-orbit 0) + ) + ) + 0) + +(defun debug-menu-make-anim-tester-x-menu ((ctx debug-menu-context)) + (let ((menu (new 'debug 'debug-menu ctx "Anim Tester X menu"))) + ;; master toggle + (debug-menu-append-item menu (new-dm-func "Start" #f atx-start)) + (debug-menu-append-item menu (new-dm-func "Stop" #f atx-stop)) + (debug-menu-append-item menu (new-dm-var-float "Speed" (the int #f) (dm-lambda-float-var (-> *ATX-settings* speed)) 0.01 -10.0 10.0)) + (debug-menu-append-item menu (new-dm-var-float "Frame Num" (the int #f) (dm-lambda-float-var (-> *ATX-settings* frame-num)) 0.1 0.0 99999.0)) + (debug-menu-append-item menu (new-dm-func "Pick Art Group" 'pick-art-group dm-anim-tester-x-func)) + (debug-menu-append-item menu (new-dm-func "Pick Anim" 'at-pick-joint-anim dm-anim-tester-x-func)) + (debug-menu-append-item menu (new-dm-func "Pick Mesh" 'pick-mesh-geo dm-anim-tester-x-func)) + (debug-menu-append-item menu (new-dm-func "Pick Skeleton" 'pick-joint-geo dm-anim-tester-x-func)) + (debug-menu-append-item menu (new-dm-flag "Show Joint Info" 'at-show-joint-info dm-anim-tester-x-flag-func)) + (debug-menu-append-item menu (new-dm-func "Free Floating cam" 'at-cam-free-floating dm-anim-tester-x-func)) + (debug-menu-append-item menu (new-dm-func "Orbit cam" 'at-cam-orbit dm-anim-tester-x-func)) + + (new-dm-submenu "Anim Tester X" menu) + ) + ) + (when (-> *debug-menu-context* root-menu) (debug-menu-append-item (-> *debug-menu-context* root-menu) (debug-menu-make-load-menu *debug-menu-context*)) (debug-menu-append-item (-> *debug-menu-context* root-menu) (debug-menu-make-part-menu *debug-menu-context*)) @@ -4324,7 +4487,7 @@ ;; Music menu TODO ;; Secrets menu TODO ;; Scene menu TODO - + (debug-menu-append-item (-> *debug-menu-context* root-menu) (debug-menu-make-from-template *debug-menu-context* '(menu "PC Settings" @@ -4396,16 +4559,6 @@ (flag "uk-english" 6 dm-subtitle-language) ) (flag "Discord RPC" #t ,(dm-lambda-boolean-flag (-> *pc-settings* discord-rpc?))) - (menu "Game fixes" - (flag "sagecage crash" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes crash-sagecage))) - ;(flag "memory crash" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes crash-dma))) - ;(flag "light eco crash" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes crash-light-eco))) - ;(flag "softlock pelican" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes lockout-pelican))) - ;(flag "softlock pipegame" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes lockout-pipegame))) - ;(flag "softlock gambler" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes lockout-gambler))) - ;(flag "fix movies" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes fix-movies))) - ;(flag "fix credits" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes fix-credits))) - ) (menu "PS2 settings" ;(flag "PS2 Load speed" #f ,(dm-lambda-boolean-flag (-> *pc-settings* ps2-read-speed?))) (flag "PS2 Particles" #f ,(dm-lambda-boolean-flag (-> *pc-settings* ps2-parts?))) @@ -4433,9 +4586,13 @@ ;(flag "Alt load boundaries" #f ,(dm-lambda-boolean-flag (-> *pc-settings* new-lb?))) (flag "All actors" #f ,(dm-lambda-boolean-flag (-> *pc-settings* force-actors?))) (flag "Display actor counts" #f ,(dm-lambda-boolean-flag (-> *pc-settings* display-actor-counts))) + (flag "Display git commit" #f ,(dm-lambda-boolean-flag (-> *pc-settings* display-sha))) + (flag "Extra hud elements" #f ,(dm-lambda-boolean-flag (-> *pc-settings* extra-hud?))) + (flag "Music fadein" #f ,(dm-lambda-boolean-flag (-> *pc-settings* music-fadein?))) + (flag "Music fadeout" #f ,(dm-lambda-boolean-flag (-> *pc-settings* music-fadeout?))) (function "Reset" #f (lambda () (reset *pc-settings*))) - (function "Save" #f (lambda () (write-to-file *pc-settings* PC_SETTINGS_FILE_NAME))) - (function "Load" #f (lambda () (read-from-file *pc-settings* PC_SETTINGS_FILE_NAME))) + (function "Save" #f (lambda () (commit-to-file *pc-settings*))) + (function "Load" #f (lambda () (load-settings *pc-settings*))) ) ) ) @@ -4449,10 +4606,11 @@ (flag "Update vis outside bsp" *update-leaf-when-outside-bsp* dm-boolean-toggle-pick-func) (flag "Pad display" #f ,(dm-lambda-boolean-flag (-> *pc-settings* debug-pad-display))) (flag "Display actor bank" #f ,(dm-lambda-boolean-flag (-> *pc-settings* display-actor-bank))) - (float-var "Actor birth dist" #f ,(dm-lambda-meters-var (-> *ACTOR-bank* birth-dist)) 20 1 #t 0 10000 1) - (float-var "Actor pause dist" #f ,(dm-lambda-meters-var (-> *ACTOR-bank* pause-dist)) 20 1 #t 0 10000 1) (flag "Heap status" #f ,(dm-lambda-boolean-flag (-> *pc-settings* display-heap-status))) (flag "Bug report" #f ,(dm-lambda-boolean-flag (-> *pc-settings* display-bug-report))) + (flag "Text boxes" #f ,(dm-lambda-boolean-flag (-> *pc-settings* display-text-box))) + (float-var "Actor birth dist" #f ,(dm-lambda-meters-var (-> *ACTOR-bank* birth-dist)) 20 1 #t 0 10000 1) + (float-var "Actor pause dist" #f ,(dm-lambda-meters-var (-> *ACTOR-bank* pause-dist)) 20 1 #t 0 10000 1) (menu "Mood override" (function "-- SIMPLE OVERRIDE" #f nothing) (flag "Palette 0" 0 dm-mood-override-palette-pick-func) @@ -4476,7 +4634,6 @@ (float-fixed-var "Palette 7 Amt" 7 dm-mood-palette-float 0 10 #t 0 1000 3) ) ) - (flag "Force progress" #f ,(dm-lambda-boolean-flag (-> *pc-settings* progress-force?))) ) )) (other-menu (-> (the-as debug-menu-item-submenu other-menu-node) submenu)) @@ -4485,41 +4642,7 @@ (debug-menu-append-item prog-menu (new-dm-func (new 'debug 'string 0 (enum->string progress-screen i)) i (lambda ((val progress-screen)) - (cond - ((-> *pc-settings* progress-force?) - (cond - ((not *progress-process*) - (make-levels-with-tasks-available-to-progress) - (disable-level-text-file-loading) - (set! (-> *progress-state* starting-state) val) - (set! *progress-process* (make-init-process progress progress-init-by-other - :to *dproc* - :stack *progress-stack-top*)) - (let ((s5-1 *progress-process*)) - (set! (-> s5-1 0 completion-percentage) (calculate-completion (-> s5-1 0))) - (set! *master-mode* 'progress) - (set! (-> s5-1 0 display-level-index) 0) ;; geyser rock - (set! (-> s5-1 0 next-level-index) (-> s5-1 0 display-level-index)) - (set! (-> s5-1 0 display-state) (progress-screen invalid)) - (set-transition-progress! (-> s5-1 0) 512) - (set! (-> s5-1 0 task-index) (get-next-task-up -1 (-> s5-1 0 display-level-index))) - ) - (when *progress-process* - (enter! (-> *progress-process* 0) val 0) - (set! (-> *progress-process* 0 card-info) #f) - ) - ) - (else - (push! (-> *progress-process* 0)) - (set! (-> *progress-process* 0 next-display-state) val) - (set! (-> *progress-process* 0 card-info) #f) - ) - ) - ) - (else - (activate-progress *dproc* val) - ) - ) + (activate-progress *dproc* val) (set-master-mode 'progress) ) )) @@ -4528,6 +4651,13 @@ (debug-menu-append-item (-> *debug-menu-context* root-menu) other-menu-node) ) + + (debug-menu-append-item (-> (the debug-menu-item-submenu (ref (-> *debug-menu-context* root-menu items) 4)) submenu) + (debug-menu-make-collision-renderer-menu *debug-menu-context*)) + + (debug-menu-append-item (-> (the debug-menu-item-submenu (car (-> *debug-menu-context* root-menu items))) submenu) + (debug-menu-make-anim-tester-x-menu *debug-menu-context*)) + ) ) diff --git a/goal_src/engine/debug/memory-usage-h.gc b/goal_src/engine/debug/memory-usage-h.gc index 10f0967aa9..969f0fc0b8 100644 --- a/goal_src/engine/debug/memory-usage-h.gc +++ b/goal_src/engine/debug/memory-usage-h.gc @@ -29,7 +29,7 @@ (deftype memory-usage-block (basic) ((work-bsp basic :offset-assert 4) (length int32 :offset-assert 8) - (data memory-usage-info 109 :inline :offset-assert 16) ;; guess + (data memory-usage-info 109 :inline :offset-assert 16) ) :method-count-assert 12 :size-assert #x6e0 @@ -58,14 +58,13 @@ ;; bit 3 : count tie colors 2 (geom 2) ;; bit 4 : ?? (geom 3) - ;; Memory usage stats are organized by the type of object. ;; This enum allows you to go from type to the index in the memory-usage-block's data array. (defenum mem-usage-id :bitfield #f :type uint32 (drawable-group 0) - (tfragment-unknown 1) ;; made up name + (tfragment 1) (tfragment-base 2) (tfragment-common 3) (tfragment-level0 4) @@ -75,11 +74,11 @@ (tfragment-pal 8) (tie-fragment 9) (tie-gif 10) - (tie-point 11) + (tie-points 11) (tie-colors 12) (tie-draw-points 13) (tie-debug 14) - ;; 15?? + (tie-near 15) (tie-pal 16) (tie-generic 17) (instance-tie 18) @@ -87,7 +86,7 @@ (instance-tie-colors1 20) (instance-tie-colors2 21) (instance-tie-colors3 22) - (instance-tie-colors 23) + (instance-tie-colors* 23) (prototype-bucket-shrub 24) (generic-shrub 25) (generic-shrub-data 26) @@ -98,7 +97,9 @@ (shrubbery-stq 31) (shrubbery-pal 32) (billboard 33) - ;; ??? + (instance-shrubbery 34) + (pris-fragment 35) + ;; ?? (entity 43) (camera 44) (nav-mesh 45) @@ -138,10 +139,10 @@ (string 80) (array 81) (sprite 82) - ;; + (depth-cue 83) (debug-dma 84) ;; maybe (sky-dma 85) ;; maybe - ;; + (pris-generic) (4k-dead-pool 87) (8k-dead-pool 88) (16k-dead-pool 89) diff --git a/goal_src/engine/debug/menu.gc b/goal_src/engine/debug/menu.gc index 15b66ef2e3..12b6baa00c 100644 --- a/goal_src/engine/debug/menu.gc +++ b/goal_src/engine/debug/menu.gc @@ -760,7 +760,7 @@ (else (font-color dim-gray)) ;; a parent, but not selected )) (with-dma-buffer-add-bucket ((s3-0 (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) ;; NOTE: the draw-string-adv advances too far on widescreen. ;; NOTE 2: should be fixed? (draw-string-adv (-> item name) s3-0 s5-0) @@ -797,7 +797,7 @@ ) ) (with-dma-buffer-add-bucket ((s4-0 (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string (-> item name) s4-0 v1-2) ) ) @@ -828,7 +828,7 @@ ) ) (with-dma-buffer-add-bucket ((s4-0 (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string (-> item name) s4-0 v1-2) ) ) @@ -856,7 +856,7 @@ ) ) (with-dma-buffer-add-bucket ((s1-0 (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string-adv (-> item name) s1-0 s5-0) (draw-string-adv ":" s1-0 s5-0) (cond @@ -940,7 +940,7 @@ ) ) (with-dma-buffer-add-bucket ((s0-0 (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) ;; PC PORT : fixed for widescreen (draw-sprite2d-xy s0-0 (correct-x-int x-pos) y-pos (correct-x-int (-> menu pix-width)) (-> menu pix-height) (static-rgba #x00 #x00 #x00 #x40)) ) @@ -964,7 +964,7 @@ ) (set-origin! (-> menu context font) s3-1 s2-1) (with-dma-buffer-add-bucket ((sv-16 (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string ">" sv-16 (-> menu context font)) ) ) @@ -984,16 +984,16 @@ (defun debug-menu-context-render ((arg0 debug-menu-context)) "Render all menus" - (let ((y-pos 6)) + (let ((x-pos 6)) ;; loop down the stack of menus (dotimes (stack-idx (-> arg0 sel-length)) ;; the menu being drawn at this depth (let ((menu (-> arg0 sel-menu stack-idx))) ;; the thing that's selected at this depth. (let ((selection (-> menu selected-item))) - (debug-menu-render menu y-pos 28 selection (+ (- -1 stack-idx) (-> arg0 sel-length))) + (debug-menu-render menu x-pos 28 selection (+ (- -1 stack-idx) (-> arg0 sel-length))) ) - (set! y-pos (+ y-pos 3 (-> menu pix-width))) + (set! x-pos (+ x-pos 3 (-> menu pix-width))) ) ) ) diff --git a/goal_src/engine/debug/part-tester.gc b/goal_src/engine/debug/part-tester.gc index bd64b27b71..ee53b6a5e1 100644 --- a/goal_src/engine/debug/part-tester.gc +++ b/goal_src/engine/debug/part-tester.gc @@ -39,9 +39,8 @@ ) (defstate part-tester-idle (part-tester) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((gp-0 (entity-by-name *part-tester-name*))) (when gp-0 (let ((s5-0 (-> gp-0 extra process))) @@ -54,7 +53,7 @@ ) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self root trans) (the-as rgba (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) ) @@ -110,18 +109,13 @@ (defun start-part () (kill-by-type part-tester *active-pool*) - (let ((gp-0 (get-process *debug-part-dead-pool* part-tester #x4000))) - (when gp-0 - (let ((t9-2 (method-of-type part-tester activate))) - (t9-2 (the-as part-tester gp-0) *default-pool* 'part-tester (the-as pointer #x70004000)) + (process-spawn + part-tester + (if *anim-tester* + (-> *anim-tester* 0 root trans) + (target-pos 0) ) - (run-now-in-process gp-0 part-tester-init-by-other (if *anim-tester* - (-> *anim-tester* 0 root trans) - (target-pos 0) - ) - ) - (-> gp-0 ppointer) - ) + :from *debug-part-dead-pool* ) (none) ) diff --git a/goal_src/engine/debug/viewer.gc b/goal_src/engine/debug/viewer.gc index 3a3678cf2c..183479a028 100644 --- a/goal_src/engine/debug/viewer.gc +++ b/goal_src/engine/debug/viewer.gc @@ -9,8 +9,7 @@ (define *viewer-sg* (new 'static 'skeleton-group :bounds (new 'static 'vector :w 16384.0) - :lod-dist - (new 'static 'array float 4 4095996000.0 0.0 0.0 0.0) + :lod-dist (new 'static 'array float 4 4095996000.0 0.0 0.0 0.0) ) ) @@ -29,31 +28,28 @@ (define-extern *viewer* viewer) (defstate viewer-process (viewer) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (-> self janim)) - (set! (-> a0-0 param 0) (the float (+ (-> self janim data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (-> self janim) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! (-> self janim) + :num! (seek! (the float (+ (-> self janim data 0 length) -1))) + :frame-num 0.0 + ) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 31 1.0 1.0 1.0) - (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) + (compute-alignment! (-> self align)) + (align! + (-> self align) + (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel keep-other-velocities adjust-quat) + 1.0 + 1.0 + 1.0 ) + (suspend) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior viewer) ja-post) + :post (the-as (function none :behavior viewer) ja-post) ) (define viewer-string (new 'global 'string 64 (the-as string #f))) @@ -226,7 +222,7 @@ #f ) -(defun birth-viewer ((arg0 process) (arg1 entity)) +(defun birth-viewer ((arg0 process) (arg1 entity-actor)) (set! (-> arg0 type) viewer) (let ((t9-0 init-entity)) viewer diff --git a/goal_src/engine/dma/dma-bucket.gc b/goal_src/engine/dma/dma-bucket.gc index 3e51532885..da04622044 100644 --- a/goal_src/engine/dma/dma-bucket.gc +++ b/goal_src/engine/dma/dma-bucket.gc @@ -34,7 +34,7 @@ "Add count buckets. Each bucket is initialized as empty and won't transfer anything." (let* ((initial-bucket (the-as dma-bucket (-> dma-buf base))) (current-bucket initial-bucket)) - + ;;(let ((current-bucket (the-as dma-bucket (-> dma-buf base)))) (dotimes (i count) ;; set the DMA tag to next, with a qwc of zero. diff --git a/goal_src/engine/dma/dma-buffer.gc b/goal_src/engine/dma/dma-buffer.gc index 972f7afd53..54884fca5c 100644 --- a/goal_src/engine/dma/dma-buffer.gc +++ b/goal_src/engine/dma/dma-buffer.gc @@ -463,7 +463,7 @@ (defmacro with-dma-buffer-add-bucket (bindings &key (bucket-group (-> (current-frame) bucket-group)) &rest body) "Bind a dma-buffer to a variable and use it on a block to allow adding things to a new bucket. usage: (with-dma-buffer-add-bucket ((buffer-name buffer) bucket-id) &rest body) - example: (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) (bucket-id debug-draw1)) ...)" + example: (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) (bucket-id debug-no-zbuf)) ...)" `(let ((,(caar bindings) ,(cadar bindings))) (with-dma-bucket (,(caar bindings) ,bucket-group ,(cadr bindings)) diff --git a/goal_src/engine/dma/dma-disasm.gc b/goal_src/engine/dma/dma-disasm.gc index 1b5d06e2ad..81d3bb1655 100644 --- a/goal_src/engine/dma/dma-disasm.gc +++ b/goal_src/engine/dma/dma-disasm.gc @@ -56,7 +56,7 @@ (new 'static 'vif-disasm-element :mask #x6f :tag #x6e :val #x4 :print #x7 :string1 "unpack-v4-8") (new 'static 'vif-disasm-element :mask #x6f :tag #x6f :val #x2 :print #x7 :string1 "unpack-v4-5") (new 'static 'vif-disasm-element :print #x8))) - + (defun disasm-vif-details ((stream symbol) (data (pointer uint8)) (kind vif-cmd) (count int)) diff --git a/goal_src/engine/dma/dma-h.gc b/goal_src/engine/dma/dma-h.gc index 1fea2597fd..bb6a0782b6 100644 --- a/goal_src/engine/dma/dma-h.gc +++ b/goal_src/engine/dma/dma-h.gc @@ -183,7 +183,7 @@ (next 2) ;; addr=after tag, next-tag=ADDR (ref 3) ;; addr=ADDR, next-tag=after tag (refs 4) ;; ref, but stall controled - (call 5) ;; + (call 5) ;; (ret 6) ;; (end 7) ;; next, but ends. ) @@ -206,99 +206,103 @@ ;; DMA data is divided into buckets. -;; At the end of a frame, the buckets are all connected together and sent. -;; the buckets are organized by renderer. +;; At the end of a frame, the buckets are all connected together in order and sent. +;; The order of these buckets should match the C++ buckets.h file, and determines the +;; order that textures are uploaded and things are drawn. +;; there is typically a texture upload bucket followed by renderer-specific draw buckets. +(defconstant BUCKET_COUNT (#if PC_PORT 70 69)) (defenum bucket-id :type int32 :bitfield #f - - (bucket-0 0) ;; ? - (bucket-1 1) ;; ? - (bucket-2 2) ;; ? + + ;; 0 + ;; 1 + ;; 2 (sky-draw 3) ;; actual sky and cloud framebuffer draws (ocean-mid-and-far 4) ;; actual ocean framebuffer draws for mid/transition/far - (tfrag-tex0 5) ;; tfrag texture upload, level 0 - (tfrag-0 6) ;; tfrag draw, level 0 - (tfrag-near-0 7) ;; tfrag near draw, level 0 - (tie-near-0 8) ;; tie near draw, level 0 - (tie-0 9) ;; tie draw, level 0 - (merc-tfrag-tex0 10) ;; merc, with tfrag textures, level 0 - (gmerc-tfrag-tex 11) ;; generic merc, with tfrag textures, level 0 + (tfrag-tex0 5) ;; tfrag texture upload, level 0 + (tfrag-0 6) ;; tfrag draw, level 0 + (tfrag-near-0 7) ;; tfrag near draw, level 0 + (tie-near-0 8) ;; tie near draw, level 0 + (tie-0 9) ;; tie draw, level 0 + (merc-tfrag-tex0 10) ;; merc, with tfrag textures, level 0 + (generic-tfrag-tex0 11) ;; generic merc, with tfrag textures, level 0 - (tfrag-tex1 12) ;; tfrag texture upload, level 1 - (tfrag-1 13) ;; tfrag draw, level 1 - (tfrag-near-1 14) ;; tfrag near draw, level 1 - (tie-near-1 15) ;; tie near draw, level 1 - (tie-1 16) ;; tie draw, level 1 - (merc-tfrag-tex1 17) ;; merc, with tfrag textures, level 1 - (gmerc-tfrag-tex1 18) ;; generic merc, with tfrag textures, level 1 - (shrub-tex0 19) - (shrub0 20) - - - (shrub-tex1 25) - (shrub1 26) - + (tfrag-tex1 12) ;; tfrag texture upload, level 1 + (tfrag-1 13) ;; tfrag draw, level 1 + (tfrag-near-1 14) ;; tfrag near draw, level 1 + (tie-near-1 15) ;; tie near draw, level 1 + (tie-1 16) ;; tie draw, level 1 + (merc-tfrag-tex1 17) ;; merc, with tfrag textures, level 1 + (generic-tfrag-tex1 18) ;; generic merc, with tfrag textures, level 1 - (generic-foreground 30) ;; ? - (alpha-tex0 31) - (tfrag-trans-0 32) ;; also sky blend + (shrub-tex0 19) + (shrub0 20) + ;; 21 (likely shrub near) + (shrub-billboard0 22) + (shrub-trans0 23) + (shrub-generic0 24) ;; note: all shrub seems to go in shrub-generic1 + + (shrub-tex1 25) + (shrub1 26) + ;; 27 (likely shrub near) + (shrub-billboard1 28) + (shrub-trans1 29) + (shrub-generic1 30) + + (alpha-tex0 31) + (tfrag-trans-0 32) ;; also sky blend (tfrag-trans-near-0 33) - (tfrag-dirt-0 34) - (tfrag-dirt-near-0 35) - (tfrag-ice-0 36) - (tfrag-ice-near-0 37) + (tfrag-dirt-0 34) + (tfrag-dirt-near-0 35) + (tfrag-ice-0 36) + (tfrag-ice-near-0 37) - (alpha-tex1 38) - (tfrag-trans-1 39) ;; also sky blend + (alpha-tex1 38) + (tfrag-trans-1 39) ;; also sky blend (tfrag-trans-near-1 40) - (tfrag-dirt-1 41) - (tfrag-dirt-near-1 42) - (tfrag-ice-1 43) - (tfrag-ice-near-1 44) - + (tfrag-dirt-1 41) + (tfrag-dirt-near-1 42) + (tfrag-ice-1 43) + (tfrag-ice-near-1 44) + + (merc-alpha-tex 45) + (generic-alpha-tex 46) - (bucket-45 45) ;; merc - (bucket-46 46) - (shadow 47) - (pris-tex0 48) - (bucket-49 49) ;; merc - (bucket-50 50) - ;; merc0 49 - ;; generic0 50 + (pris-tex0 48) + (merc-pris0 49) + (generic-pris0 50) - (pris-tex1 51) - (bucket-52 52) ;; merc - (bucket-53 53) - (merc-eyes 54) ;; eye::update-eyes - ;; merc1 52 - ;; generic1 53 + (pris-tex1 51) + (merc-pris1 52) + (generic-pris1 53) + + (eyes 54) + + (merc-pris-common 55) + (generic-pris-common 56) - (bucket-55 55) ;; merc - (bucket-56 56) (water-tex0 57) - (bucket-58 58) ;; merc - (bucket-59 59) - ;; merc0 58 (+ default) - ;; generic0 59 (+ default) + (merc-water0 58) + (generic-water0 59) (water-tex1 60) - (bucket-61 61) ;; merc - (bucket-62 62) - (bucket-63 63) ; ocean - ;; merc1 61 - ;; generic1 62 + (merc-water1 61) + (generic-water1 62) + + (ocean-near 63) ; ocean (depth-cue 64) - (pre-sprite-textures 65) ;; common + (common-page-tex 65) (sprite 66) - ;; debug spheres? 67 - (debug-draw0 67) - ;; debug text 68 - (debug-draw1 68) + (debug 67) + (debug-no-zbuf 68) + + ;; extra buckets for pc port + (subtitle 69) ) ;; A DMA bucket is a way of sorting data within a dma buffer. diff --git a/goal_src/engine/dma/dma.gc b/goal_src/engine/dma/dma.gc index ac0fbea082..6a122eb69a 100644 --- a/goal_src/engine/dma/dma.gc +++ b/goal_src/engine/dma/dma.gc @@ -133,7 +133,7 @@ ) (defun dma-send-chain-no-flush ((arg0 dma-bank-source) (arg1 uint)) - "Send DMA chain! But don't flush the cache, so be careful here. TTE enable." + "Send DMA chain! But don't flush the cache, so be careful here. TTE enable." (local-vars (v0-1 int)) (dma-sync (the-as pointer arg0) 0 0) (.sync.l) @@ -226,7 +226,7 @@ (#when PC_PORT (return 0) ) - + (set! (-> (the-as vif-bank #x10003800) err me0) 1) (set! (-> (the-as vif-bank #x10003c00) err me0) 1) (none) diff --git a/goal_src/engine/draw/draw-node-h.gc b/goal_src/engine/draw/draw-node-h.gc index 7fef4ef929..e94ad51523 100644 --- a/goal_src/engine/draw/draw-node-h.gc +++ b/goal_src/engine/draw/draw-node-h.gc @@ -13,7 +13,8 @@ ;; - all leaves are stored at the same depth ;; - all nodes and leaves have visibility IDs -;; shrub does not have these properties +;; shrub does not have these properties - it supports arbitrary children counts, leaves +;; may occur at any depth, and nothing has visibility ids. (deftype draw-node (drawable) ((child-count uint8 :offset 6) ;; if our child requires a count @@ -24,7 +25,7 @@ :method-count-assert 18 :size-assert #x20 :flag-assert #x1200000020 - ;; field distance is a float printed as hex? + ;; field distance is a float printed as hex? ) diff --git a/goal_src/engine/draw/drawable-ambient-h.gc b/goal_src/engine/draw/drawable-ambient-h.gc index b9c915d389..82c5333119 100644 --- a/goal_src/engine/draw/drawable-ambient-h.gc +++ b/goal_src/engine/draw/drawable-ambient-h.gc @@ -60,9 +60,9 @@ (trans vector :offset-assert 120) (sound-id sound-id :offset-assert 124) (mode symbol :offset-assert 128) - (total-time time-frame :offset-assert 136) - (total-off-time time-frame :offset-assert 144) - (last-time time-frame :offset-assert 152) + (total-time time-frame :offset-assert 136) + (total-off-time time-frame :offset-assert 144) + (last-time time-frame :offset-assert 152) (voicebox handle :offset-assert 160) ) :heap-base #x40 diff --git a/goal_src/engine/draw/drawable-h.gc b/goal_src/engine/draw/drawable-h.gc index c434710d67..97ed034a64 100644 --- a/goal_src/engine/draw/drawable-h.gc +++ b/goal_src/engine/draw/drawable-h.gc @@ -13,7 +13,7 @@ ;; and that certain methods should only be called at certain times, and may require coordination ;; with having certain VU0 or scratchpad data present. ;; In many cases, "draw" simply adds data to a buffer that must later be converted to dma in finish-background -;; or similar. +;; or similar. Or just does nothing. (declare-type drawable-error drawable) (deftype drawable (basic) @@ -45,10 +45,10 @@ ;; different for different types, but usually does nothing. (debug-draw (_type_ drawable display-frame) none 15) - + ;; given VIS data (uncompressed), compute the visiblity bit string. (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8) 16) - + ;; find "ambients" inside the given sphere and add to list. (collect-ambients (_type_ sphere int ambient-list) none 17) ) diff --git a/goal_src/engine/draw/drawable-inline-array-h.gc b/goal_src/engine/draw/drawable-inline-array-h.gc index f30a81257b..4a203a5d28 100644 --- a/goal_src/engine/draw/drawable-inline-array-h.gc +++ b/goal_src/engine/draw/drawable-inline-array-h.gc @@ -10,6 +10,7 @@ ;; it's used over drawable-group when there are a lot of drawables to iterate over because it is faster. ;; a drawable-inline-array itself has no idea what it stores so you almost always need a more specific type. +;; without a more specific type, the stride of the elements is unknown. (deftype drawable-inline-array (drawable) ((length int16 :offset 6) diff --git a/goal_src/engine/draw/drawable.gc b/goal_src/engine/draw/drawable.gc index 2da7fe1cb1..b50bb2e9b3 100644 --- a/goal_src/engine/draw/drawable.gc +++ b/goal_src/engine/draw/drawable.gc @@ -116,7 +116,7 @@ "Is this thing visible? By draw-node id." ;; todo #t - + #| (let* ((addr (scratchpad-ptr int8 :offset (+ #x3b80 (/ id 8)))) ;; address of the vis data (vis-byte (-> addr 0)) ;; vis byte @@ -134,12 +134,12 @@ (when (sphere-cull (-> arg0 bsphere)) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (-> arg0 bsphere) (-> arg0 bsphere w) (new 'static 'rgba :r #x80 :a #x80) ) - (add-debug-text-3d #t (bucket-id debug-draw1) arg1 (-> arg0 bsphere) (font-color white) (the-as vector2h #f)) + (add-debug-text-3d #t (bucket-id debug-no-zbuf) arg1 (-> arg0 bsphere) (font-color white) (the-as vector2h #f)) ) ) ) @@ -521,8 +521,8 @@ (logclear! (-> arg1 status) (draw-status was-drawn)) (when (zero? (logand (-> arg1 status) (draw-status hidden no-anim no-skeleton-update))) (let ((s4-0 (the-as vector (+ 48 (the-as int (scratchpad-object int))))) - (s2-0 (the-as vu-lights (+ 64 (the-as int (scratchpad-object int))))) - (s3-0 *time-of-day-context*) + (vu-lgt (the-as vu-lights (+ 64 (the-as int (scratchpad-object int))))) + (tod *time-of-day-context*) ) (.lvf vf16 (&-> arg1 origin quad)) (.lvf vf17 (&-> arg1 bounds quad)) @@ -534,135 +534,130 @@ (when (sphere-in-view-frustum? (the-as sphere s4-0)) (case (-> arg1 global-effect) (((draw-effect title)) - (when (not (-> s3-0 title-updated)) - (set! (-> s3-0 title-updated) #t) + (when (not (-> tod title-updated)) + (set! (-> tod title-updated) #t) (let ((s0-0 (-> *math-camera* inv-camera-rot)) (a1-1 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) ) (set-vector! a1-1 0.612 0.5 -0.612 0.0) (set-vector! s1-0 -0.696 0.174 0.696 0.0) - (vector-matrix*! (the-as vector (-> s3-0 title-light-group)) a1-1 s0-0) - (vector-matrix*! (the-as vector (-> s3-0 title-light-group dir1)) s1-0 s0-0) + (vector-matrix*! (the-as vector (-> tod title-light-group)) a1-1 s0-0) + (vector-matrix*! (the-as vector (-> tod title-light-group dir1)) s1-0 s0-0) ) (set-vector! (-> *time-of-day-context* current-shadow) 0.612 -0.5 -0.612 1.0) ) - (vu-lights<-light-group! s2-0 (-> s3-0 title-light-group)) + (vu-lights<-light-group! vu-lgt (-> tod title-light-group)) ) (else - (let ((f28-0 (-> arg1 secondary-interp)) - (f30-0 (-> arg1 current-secondary-interp)) - (v1-17 (-> arg1 shadow-mask)) - (a0-10 (-> arg1 level-index)) - (s0-1 (-> s3-0 light-group (-> *target* draw light-index))) - (s1-1 (new 'stack-no-clear 'light-group)) + (let ((interp (-> arg1 secondary-interp)) + (cur-interp (-> arg1 current-secondary-interp)) + (shadow-msk (-> arg1 shadow-mask)) + (lev-idx (-> arg1 level-index)) + (lgt (-> tod light-group (-> *target* draw light-index))) + (cur-lgt (new 'stack-no-clear 'light-group)) ) (cond ((= (-> arg1 light-index) 255) ) - ((= a0-10 2) - (set! s0-1 (-> s3-0 light-group (-> arg1 light-index))) + ((= lev-idx 2) + (set! lgt (-> tod light-group (-> arg1 light-index))) ) (else - (set! s0-1 (-> s3-0 moods a0-10 light-group (-> arg1 light-index))) + (set! lgt (-> tod moods lev-idx light-group (-> arg1 light-index))) ) ) - (when (not (or (= a0-10 2) (zero? v1-17))) - (let* ((a1-22 (-> s3-0 light-masks-0 a0-10)) - (a2-14 (-> s3-0 light-masks-1 a0-10)) - (f26-0 (-> s3-0 light-interp a0-10)) - (a0-13 (logand a1-22 v1-17)) - (v1-18 (logand a2-14 v1-17)) + (when (not (or (= lev-idx 2) (zero? shadow-msk))) + (let* ((lgt-msk-0 (-> tod light-masks-0 lev-idx)) + (lgt-msk-1 (-> tod light-masks-1 lev-idx)) + (lgt-interp (-> tod light-interp lev-idx)) + (a0-13 (logand lgt-msk-0 shadow-msk)) + (v1-18 (logand lgt-msk-1 shadow-msk)) ) (cond ((and (zero? a0-13) (zero? v1-18)) ) (else - (set! f28-0 (cond - ((and (nonzero? a0-13) (nonzero? v1-18)) - 1.0 - ) - ((zero? a0-13) - (quad-copy! (the-as pointer s1-1) (the-as pointer s0-1) 12) - (set! s0-1 s1-1) - (set! (-> s0-1 dir1 levels x) 0.0) - f26-0 - ) - (else - (quad-copy! (the-as pointer s1-1) (the-as pointer s0-1) 12) - (set! s0-1 s1-1) - (set! (-> s0-1 dir0 levels x) 0.0) - (- 1.0 f26-0) + (set! interp (cond + ((and (nonzero? a0-13) (nonzero? v1-18)) + 1.0 ) - ) + ((zero? a0-13) + (quad-copy! (the-as pointer cur-lgt) (the-as pointer lgt) 12) + (set! lgt cur-lgt) + (set! (-> lgt dir1 levels x) 0.0) + lgt-interp + ) + (else + (quad-copy! (the-as pointer cur-lgt) (the-as pointer lgt) 12) + (set! lgt cur-lgt) + (set! (-> lgt dir0 levels x) 0.0) + (- 1.0 lgt-interp) + ) + ) ) ) ) ) ) (if *teleport* - (set! f30-0 f28-0) + (set! cur-interp interp) ) - (when (not (or (paused?) (= f28-0 f30-0))) - (let ((f0-15 (- f30-0 f28-0))) - (set! f30-0 (cond - ((< (fabs f0-15) 0.2) - f28-0 - ) - ((< f0-15 0.0) - (+ 0.2 f30-0) - ) - (else - (+ -0.2 f30-0) - ) - ) + (when (not (or (paused?) (= interp cur-interp))) + (let ((f0-15 (- cur-interp interp))) + (set! cur-interp (cond + ((< (fabs f0-15) 0.2) + interp + ) + ((< f0-15 0.0) + (+ 0.2 cur-interp) + ) + (else + (+ -0.2 cur-interp) + ) + ) ) ) - (set! (-> arg1 current-secondary-interp) f30-0) + (set! (-> arg1 current-secondary-interp) cur-interp) ) (cond - ((= f30-0 0.0) - (vu-lights<-light-group! s2-0 s0-1) + ((= cur-interp 0.0) + (vu-lights<-light-group! vu-lgt lgt) ) (else - (if (!= s0-1 s1-1) - (quad-copy! (the-as pointer s1-1) (the-as pointer s0-1) 12) + (if (!= lgt cur-lgt) + (quad-copy! (the-as pointer cur-lgt) (the-as pointer lgt) 12) ) - (let ((f0-20 (- 1.0 f30-0))) - (set! (-> s1-1 dir0 levels x) (* (-> s1-1 dir0 levels x) f0-20)) - (set! (-> s1-1 dir0 levels y) (* (-> s1-1 dir0 levels y) f0-20)) - (set! (-> s1-1 dir1 levels x) (* (-> s1-1 dir1 levels x) f0-20)) - (set! (-> s1-1 dir1 levels y) (* (-> s1-1 dir1 levels y) f0-20)) - (set! (-> s1-1 dir2 levels x) (* (-> s1-1 dir2 levels x) f0-20)) - (set! (-> s1-1 dir2 levels y) (* (-> s1-1 dir2 levels y) f0-20)) + (let ((f0-20 (- 1.0 cur-interp))) + (set! (-> cur-lgt dir0 levels x) (* (-> cur-lgt dir0 levels x) f0-20)) + (set! (-> cur-lgt dir0 levels y) (* (-> cur-lgt dir0 levels y) f0-20)) + (set! (-> cur-lgt dir1 levels x) (* (-> cur-lgt dir1 levels x) f0-20)) + (set! (-> cur-lgt dir1 levels y) (* (-> cur-lgt dir1 levels y) f0-20)) + (set! (-> cur-lgt dir2 levels x) (* (-> cur-lgt dir2 levels x) f0-20)) + (set! (-> cur-lgt dir2 levels y) (* (-> cur-lgt dir2 levels y) f0-20)) ) - (vu-lights<-light-group! s2-0 s1-1) + (vu-lights<-light-group! vu-lgt cur-lgt) ) ) ) - (.lvf vf2 (&-> s2-0 color 0 quad)) - (.lvf vf3 (&-> s2-0 color 1 quad)) - (.lvf vf4 (&-> s2-0 color 2 quad)) - (.lvf vf5 (&-> s2-0 ambient quad)) + (.lvf vf2 (&-> vu-lgt color 0 quad)) + (.lvf vf3 (&-> vu-lgt color 1 quad)) + (.lvf vf4 (&-> vu-lgt color 2 quad)) + (.lvf vf5 (&-> vu-lgt ambient quad)) (.mul.vf vf5 vf5 vf28) (.mul.vf vf2 vf2 vf28) (.mul.vf vf3 vf3 vf28) (.mul.vf vf4 vf4 vf28) (.add.vf vf5 vf5 vf29) - (.svf (&-> s2-0 color 0 quad) vf2) - (.svf (&-> s2-0 color 1 quad) vf3) - (.svf (&-> s2-0 color 2 quad) vf4) - (.svf (&-> s2-0 ambient quad) vf5) + (.svf (&-> vu-lgt color 0 quad) vf2) + (.svf (&-> vu-lgt color 1 quad) vf3) + (.svf (&-> vu-lgt color 2 quad) vf4) + (.svf (&-> vu-lgt ambient quad) vf5) (.mov v1-37 vf5) ) ) (if *display-lights* - (add-debug-lights - #t - (bucket-id debug-draw0) - (the-as (inline-array light) (-> s3-0 light-group)) - (-> arg1 origin) - ) + (add-debug-lights #t (bucket-id debug) (the-as (inline-array light) (-> tod light-group)) (-> arg1 origin)) ) (let ((at-0 *math-camera*)) (.lvf vf16 (&-> at-0 plane 0 quad)) @@ -899,7 +894,6 @@ (none) ) -;; definition for symbol *debug-hook*, type (function none) (define *debug-hook* main-debug-hook) (define *add-sphere* #f) @@ -908,9 +902,9 @@ (defun real-main-draw-hook () "The main drawing function. This dispatches all renderers and is called directly from the display-loop - in main.gc." + in main.gc" (when *slow-frame-rate* - (dotimes (v1-2 40000000) ;; was 50000 + (dotimes (v1-2 50000000) ;; was 50000 (nop!) (nop!) (nop!) @@ -919,12 +913,12 @@ (nop!) ) ) - "Function to be executed to set up for engine dma" - + "Function to be executed to set up for engine dma" ;; accidental docstring from the original game + ;; update render enables from the debug menu (set! *vu1-enable-user* *vu1-enable-user-menu*) (set! *texture-enable-user* *texture-enable-user-menu*) - + ;; reset and display dma memory stats. (when *debug-segment* (when (or *stats-memory* *stats-memory-short*) @@ -938,138 +932,141 @@ ) (reset! *dma-mem-usage*) ) - + ;; todo shrub matrix - + ;; initialize dma buckets that are generic sinks. ;; other renderers may output to these, so do them first. (generic-init-buffers) - + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; texture uploads ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - + ;; next we use the texture system to build DMA commands to load texture. ;; internally, add-tex-to-dma! has special logic to avoid loading textures ;; that won't be used. (though it's pretty basic, it doesn't actually track per-texture usage) - + ;; level tfrag's upload if the level is running. - (when (logtest? *texture-enable-user* 1) - (dotimes (gp-1 (-> *level* length)) - (let ((a1-2 (-> *level* level gp-1))) - (if (= (-> a1-2 status) 'active) - (add-tex-to-dma! *texture-pool* a1-2 0) + (with-profiler "texture-upload" + (when (logtest? *texture-enable-user* 1) + (dotimes (gp-1 (-> *level* length)) + (let ((a1-2 (-> *level* level gp-1))) + (if (= (-> a1-2 status) 'active) + (add-tex-to-dma! *texture-pool* a1-2 0) + ) + ) + ) + ) + ;; level pris's upload if the level is running. + (when (logtest? *texture-enable-user* 2) + (dotimes (gp-2 (-> *level* length)) + (let ((a1-3 (-> *level* level gp-2))) + (if (= (-> a1-3 status) 'active) + (add-tex-to-dma! *texture-pool* a1-3 1) + ) + ) + ) + ) + + ;; level shrubs upload if the level is loading. + (when (logtest? *texture-enable-user* 4) + (dotimes (gp-3 (-> *level* length)) + (let ((a1-4 (-> *level* level gp-3))) + (if (= (-> a1-4 status) 'active) + (add-tex-to-dma! *texture-pool* a1-4 2) + ) + ) + ) + ) + + ;; alpha and common. + (when (logtest? *texture-enable-user* 8) + (let ((uploaded-common #f)) + (dotimes (gp-4 (-> *level* length)) + (let ((a1-5 (-> *level* level gp-4))) + (when (= (-> a1-5 status) 'active) + (add-tex-to-dma! *texture-pool* a1-5 3) + (when (not uploaded-common) + (upload-one-common! *texture-pool* (-> *level* level0)) + (set! uploaded-common #t) + ) + ) ) + ) + (when (not uploaded-common) + (upload-one-common! *texture-pool* (-> *level* level0)) + #t + ) + ) + ) + + ;; water. + (when (logtest? *texture-enable-user* 16) + (dotimes (gp-5 (-> *level* length)) + (let ((a1-8 (-> *level* level gp-5))) + (if (= (-> a1-8 status) 'active) + (add-tex-to-dma! *texture-pool* a1-8 4) + ) + ) ) ) ) - ;; level pris's upload if the level is running. - (when (logtest? *texture-enable-user* 2) - (dotimes (gp-2 (-> *level* length)) - (let ((a1-3 (-> *level* level gp-2))) - (if (= (-> a1-3 status) 'active) - (add-tex-to-dma! *texture-pool* a1-3 1) - ) + + ;;;;;;;;;;;;; + ;; sky + ;;;;;;;;;;;;; + (with-profiler "sky" + (when (zero? (logand *vu1-enable-user* (vu1-renderer-mask sky))) + ;; the sky is disabled. Just draw a solid gradient on the whole screen. + (with-dma-buffer-add-bucket ((dma-buf (-> (current-frame) global-buf)) (bucket-id sky-draw)) + (dma-buffer-add-gs-set dma-buf + (zbuf-1 (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24))) + (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) + (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) + ) + (screen-gradient + dma-buf + (-> *display* bg-clear-color 0) + (-> *display* bg-clear-color 1) + (-> *display* bg-clear-color 2) + (-> *display* bg-clear-color 3) + ) ) ) - ) - - ;; level shrubs upload if the level is loading. - (when (logtest? *texture-enable-user* 4) - (dotimes (gp-3 (-> *level* length)) - (let ((a1-4 (-> *level* level gp-3))) - (if (= (-> a1-4 status) 'active) - (add-tex-to-dma! *texture-pool* a1-4 2) - ) - ) - ) - ) - - ;; alpha and common. - (when (logtest? *texture-enable-user* 8) - (let ((uploaded-common #f)) - (dotimes (gp-4 (-> *level* length)) - (let ((a1-5 (-> *level* level gp-4))) - (when (= (-> a1-5 status) 'active) - (add-tex-to-dma! *texture-pool* a1-5 3) - (when (not uploaded-common) - (upload-one-common! *texture-pool* (-> *level* level0)) - (set! uploaded-common #t) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask sky)) + ;; check if we want the sky, and if we actually have textures ready. + ;; we generate sky textures on the previous frame and they sit in vram (8160) until the next frame. + ;; on the first frame after we request sky, we draw the textures, but they aren't ready until the next frame. + (cond + ((and (-> *time-of-day-context* sky) *sky-drawn*) + (render-sky-tng *time-of-day-context*) + ) + (else + ;; todo + (with-dma-buffer-add-bucket ((dma-buf (-> (current-frame) global-buf)) (bucket-id sky-draw)) + (dma-buffer-add-gs-set dma-buf + (zbuf-1 (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24))) + (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) + (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) + ) + (screen-gradient + dma-buf + (-> *time-of-day-context* erase-color) + (-> *time-of-day-context* erase-color) + (-> *time-of-day-context* erase-color) + (-> *time-of-day-context* erase-color) ) ) ) ) - (when (not uploaded-common) - (upload-one-common! *texture-pool* (-> *level* level0)) - #t - ) ) ) - - ;; water. - (when (logtest? *texture-enable-user* 16) - (dotimes (gp-5 (-> *level* length)) - (let ((a1-8 (-> *level* level gp-5))) - (if (= (-> a1-8 status) 'active) - (add-tex-to-dma! *texture-pool* a1-8 4) - ) - ) - ) - ) - - ;;;;;;;;;;;;; - ;; sky - ;;;;;;;;;;;;; - - (when (zero? (logand *vu1-enable-user* (vu1-renderer-mask sky))) - ;; the sky is disabled. Just draw a solid gradient on the whole screen. - (with-dma-buffer-add-bucket ((dma-buf (-> (current-frame) global-buf)) (bucket-id sky-draw)) - (dma-buffer-add-gs-set dma-buf - (zbuf-1 (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24))) - (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) - (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) - ) - (screen-gradient - dma-buf - (-> *display* bg-clear-color 0) - (-> *display* bg-clear-color 1) - (-> *display* bg-clear-color 2) - (-> *display* bg-clear-color 3) - ) - ) - ) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask sky)) - ;; check if we want the sky, and if we actually have textures ready. - ;; we generate sky textures on the previous frame and they sit in vram (8160) until the next frame. - ;; on the first frame after we request sky, we draw the textures, but they aren't ready until the next frame. - (cond - ((and (-> *time-of-day-context* sky) *sky-drawn*) - (render-sky-tng *time-of-day-context*) - ) - (else - ;; todo - (with-dma-buffer-add-bucket ((dma-buf (-> (current-frame) global-buf)) (bucket-id sky-draw)) - (dma-buffer-add-gs-set dma-buf - (zbuf-1 (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24))) - (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) - (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) - ) - (screen-gradient - dma-buf - (-> *time-of-day-context* erase-color) - (-> *time-of-day-context* erase-color) - (-> *time-of-day-context* erase-color) - (-> *time-of-day-context* erase-color) - ) - ) - ) - ) - ) - - + + ;; update mood lighting, draw sky textures. - (update-time-of-day *time-of-day-context*) - + (with-profiler "time-of-day" (update-time-of-day *time-of-day-context*)) + ;; reset the closest object and desired texture masks for all levels. ; (dotimes (v1-150 (-> *level* length)) ; (let ((a0-59 (-> *level* level v1-150))) @@ -1084,87 +1081,106 @@ (add-ee-profile-frame 'draw :r #x40 :b #x40 :a #x80) ;;;;;;; OCEAN - (update-ocean) ;; ocean map update - (draw-ocean) ;; far, mid, near, transition, and texture. + (with-profiler "ocean" + (update-ocean) ;; ocean map update + (draw-ocean) ;; far, mid, near, transition, and texture. + ) (add-ee-profile-frame 'draw :b #xff :a #x80) ;; reset MERC - (set! (-> *merc-global-array* count) (the-as uint 0)) - (set! *merc-globals* (the-as merc-globals (-> *merc-global-array* globals))) - (set! (-> *shadow-queue* cur-run) (the-as uint 0)) + (with-profiler "merc" + (set! (-> *merc-global-array* count) (the-as uint 0)) + (set! *merc-globals* (the-as merc-globals (-> *merc-global-array* globals))) + (set! (-> *shadow-queue* cur-run) (the-as uint 0)) + ) ;; draw the background! - (init-background) - (execute-connections *background-draw-engine* (-> *display* frames (-> *display* on-screen) frame)) + (with-profiler "background" + (init-background) + (execute-connections *background-draw-engine* (-> *display* frames (-> *display* on-screen) frame)) - ;; finish bg (most of the work is here) - (reset! (-> *perf-stats* data 3)) - (finish-background) - (read! (-> *perf-stats* data 3)) - (update-wait-stats (-> *perf-stats* data 3) (-> *background-work* wait-to-vu0) (the-as uint 0) (the-as uint 0)) - - ;; perf stats are printed and restarted here, for some reason. - (end-perf-stat-collection) - (when (not (paused?)) - (when *stats-poly* - (dotimes (gp-8 (-> *level* length)) - (let ((v1-193 (-> *level* level gp-8))) - (if (= (-> v1-193 status) 'active) - (collect-stats (-> v1-193 bsp)) - ) - ) - ) - (print-terrain-stats) - ) - (if *display-perf-stats* - (print-perf-stats) - ) + ;; finish bg (most of the work is here) + (reset! (-> *perf-stats* data 3)) + (finish-background) + (read! (-> *perf-stats* data 3)) + (update-wait-stats (-> *perf-stats* data 3) (-> *background-work* wait-to-vu0) (the-as uint 0) (the-as uint 0)) + ) + + ;; perf stats are printed and restarted here, for some reason. + (with-profiler "stats" + (end-perf-stat-collection) + (when (not (paused?)) + (when *stats-poly* + (dotimes (gp-8 (-> *level* length)) + (let ((v1-193 (-> *level* level gp-8))) + (if (= (-> v1-193 status) 'active) + (collect-stats (-> v1-193 bsp)) + ) + ) + ) + (print-terrain-stats) + ) + (if *display-perf-stats* + (print-perf-stats) + ) + ) + (start-perf-stat-collection) ) - (start-perf-stat-collection) ;; draw the foreground engines. - (foreground-engine-execute - (-> *level* level-default foreground-draw-engine 0) - (-> *display* frames (-> *display* on-screen) frame) - 2 - 0 + (with-profiler "foreground-engines" + (foreground-engine-execute + (-> *level* level-default foreground-draw-engine 0) + (-> *display* frames (-> *display* on-screen) frame) + 2 + 0 + ) + (foreground-engine-execute + (-> *level* level-default foreground-draw-engine 1) + (-> *display* frames (-> *display* on-screen) frame) + 2 + 1 + ) ) - (foreground-engine-execute - (-> *level* level-default foreground-draw-engine 1) - (-> *display* frames (-> *display* on-screen) frame) - 2 - 1 - ) - + ;; handle extra processing for foreground + (let ((gp-9 (-> *display* frames (-> *display* on-screen) frame global-buf))) - (bones-mtx-calc-execute) ;; skinning matrix calculation - (generic-merc-execute-all gp-9) ;; mercneric conversion. - (shadow-execute-all gp-9 *shadow-queue*) - (update-eyes) + (with-profiler "bones" (bones-mtx-calc-execute)) ;; skinning matrix calculation + (with-profiler "gmerc" (generic-merc-execute-all gp-9)) ;; mercneric conversion. + (with-profiler "shadow" (shadow-execute-all gp-9 *shadow-queue*)) + (with-profiler "eyes" (update-eyes)) ) ;; sprite draw (when (logtest? (vu1-renderer-mask sprite) *vu1-enable-user*) - (swap-fake-shadow-buffers) - (sprite-draw *display*) + (with-profiler "sprite" + (swap-fake-shadow-buffers) + (sprite-draw *display*) + ) ) ;; debug drawing - (when *debug-segment* - (debug-draw-actors *level* *display-actor-marks*) - (collide-shape-draw-debug-marks) + (with-profiler "debug-draw" + (when *debug-segment* + (debug-draw-actors *level* *display-actor-marks*) + (collide-shape-draw-debug-marks) + ) + (render-boundaries) ) - (render-boundaries) - + ;; for some reason we clear the touching list here... - (send-events-for-touching-shapes *touching-list*) - (free-all-prim-nodes *touching-list*) - + (with-profiler "touching" + (send-events-for-touching-shapes *touching-list*) + (free-all-prim-nodes *touching-list*) + ) + (add-ee-profile-frame 'draw :r #x40 :b #x40 :a #x80) ;; spawn actors, compact heaps, etc. - (actors-update *level*) + (with-profiler "actors-update" + (actors-update *level*) + ) (add-ee-profile-frame 'draw :r #x80 :a #x80) - + (when (not (paused?)) (if *stats-collide* (print-collide-stats) @@ -1311,7 +1327,7 @@ ;; get the increment in seconds unit. (let ((scaled-seconds (* (the int time-ratio) (the int (-> disp time-factor))))) ;; tell the sparticle system - (set-particle-frame-time (min 12 scaled-seconds)) + (set-particle-frame-time (min (seconds 0.04) scaled-seconds)) ;; the "not real" frame counters only count when unpaused (when (not (paused?)) @@ -1411,15 +1427,14 @@ ) ;; add the buckets - (set! (-> new-frame bucket-group)(dma-buffer-add-buckets (-> new-frame calc-buf) 69)) + (set! (-> new-frame bucket-group) (dma-buffer-add-buckets (-> new-frame calc-buf) BUCKET_COUNT)) ) ;; initialize the debug bucket - (debug-init-buffer - (bucket-id debug-draw1) - (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24) :zmsk #x1) - (new 'static 'gs-test :zte #x1 :ztst (gs-ztest always)) - ) + (debug-init-buffer (bucket-id debug-no-zbuf) + (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24) :zmsk #x1) + (new 'static 'gs-test :zte #x1 :ztst (gs-ztest always)) + ) ;; setup our drawing offset for even/odd offset (set-draw-env-offset (-> disp frames new-frame-idx draw) 2048 2048 odd-even) @@ -1443,7 +1458,7 @@ (*post-draw-hook* (-> disp frames (-> disp on-screen) frame calc-buf)) ;; iterate through all buckets and append a final GS state reset. - (dotimes (bucket-idx 69) + (dotimes (bucket-idx BUCKET_COUNT) (let* ((this-global-buf (-> this-frame global-buf)) (a2-0 (-> this-global-buf base)) ) @@ -1495,7 +1510,7 @@ (set! (-> v1-14 base) (&+ (the-as pointer a0-10) 16)) ) ;; patch the buckets. Now sending the calc buf will send everything! - (dma-buffer-patch-buckets (-> this-frame bucket-group) 69) + (dma-buffer-patch-buckets (-> this-frame bucket-group) BUCKET_COUNT) ;; append the final END. (let* ((v1-15 this-calc-buf) (a0-13 (the-as object (-> v1-15 base))) @@ -1544,7 +1559,7 @@ ) (toggle-pause) ) - (when (or (not *progress-process*) (dummy-32 (-> *progress-process* 0))) + (when (or (not *progress-process*) (can-go-back? (-> *progress-process* 0))) (if (or (logtest? (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons select r3 start)) ;; push pause (and ;; controller lost (logtest? (-> *cpad-list* cpads 0 valid) 128) @@ -1552,7 +1567,7 @@ (>= (the-as int (-> *display* base-frame-counter)) (the-as int (-> *game-info* blackout-time))) ;; this is a hack. this is initialized to #x493e0. It prevents controller-loss pause from ;; triggering in the first few seconds of gameplay. - (< #x49764 (the-as int (-> *display* real-frame-counter))) + (< (seconds 1003) (-> *display* real-frame-counter)) ) (and (logtest? (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons r2)) ;; debug press (paused?) @@ -1625,7 +1640,7 @@ ;; need to call reset-graph with some magic number ;; also stash this parameter so that if things go really wrong and our DMA transfer ;; times out, we can reset-graph to the appropriate video mode - (if (= (-> *setting-control* current video-mode) 'ntsc) + (if (or (= (-> *setting-control* current video-mode) 'ntsc) (= (-> *setting-control* current video-mode) '150fps) (= (-> *setting-control* current video-mode) '100fps)) (set! *video-reset-parm* 2) (set! *video-reset-parm* 3) ) diff --git a/goal_src/engine/draw/process-drawable-h.gc b/goal_src/engine/draw/process-drawable-h.gc index dca21307da..1eabf45db9 100644 --- a/goal_src/engine/draw/process-drawable-h.gc +++ b/goal_src/engine/draw/process-drawable-h.gc @@ -49,12 +49,7 @@ (defun num-func-+! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) "Increment the frame number, taking into account the animation speed and current game rate." - (let ((f0-1 - (+ (-> arg0 frame-num) - (* arg1 (* (-> arg0 frame-group speed) (-> *display* time-adjust-ratio))) - ) - ) - ) + (let ((f0-1 (+ (-> arg0 frame-num) (* arg1 (* (-> arg0 frame-group speed) (-> *display* time-adjust-ratio)))))) (set! (-> arg0 frame-num) f0-1) f0-1 ) @@ -62,12 +57,7 @@ (defun num-func--! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) "Decrement the frame number, taking into account the animation speed and current game rate." - (let ((f0-1 - (- (-> arg0 frame-num) - (* arg1 (* (-> arg0 frame-group speed) (-> *display* time-adjust-ratio))) - ) - ) - ) + (let ((f0-1 (- (-> arg0 frame-num) (* arg1 (* (-> arg0 frame-group speed) (-> *display* time-adjust-ratio)))))) (set! (-> arg0 frame-num) f0-1) f0-1 ) @@ -79,25 +69,21 @@ ;; get the duration from the joint-animation-compressed. (let* ((duration (the float (+ (-> chan frame-group data 0 length) -1))) ;; increment (also add a full duration to it, I guess to avoid issues if inc is negative and we're near the start.) - (after-inc (+ (+ (-> chan frame-num) duration) - (* inc (* (-> chan frame-group speed) (-> *display* time-adjust-ratio))) - ) + (after-inc + (+ (-> chan frame-num) duration (* inc (* (-> chan frame-group speed) (-> *display* time-adjust-ratio)))) ) ;; wrap. (wrapped (- after-inc (* (the float (the int (/ after-inc duration))) duration))) ) - (set! (-> chan frame-num) wrapped) - wrapped - ) + (set! (-> chan frame-num) wrapped) + wrapped + ) ) (defun num-func-seek! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) "Seek toward arg1 by at most arg2 (taking into account speed etc)" - (let ((f0-3 (seek - (-> arg0 frame-num) - arg1 - (* arg2 (* (-> arg0 frame-group speed) (-> *display* time-adjust-ratio))) - ) + (let ((f0-3 + (seek (-> arg0 frame-num) arg1 (* arg2 (* (-> arg0 frame-group speed) (-> *display* time-adjust-ratio)))) ) ) ;; set it twice, just to make sure. @@ -109,9 +95,7 @@ (defun num-func-blend-in! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) "Seek frame-interp toward 1. Once its there, do a joint-control-reset." - (let* ((v0-0 (seek (-> arg0 frame-interp) 1.0 (* arg1 (-> *display* time-adjust-ratio)))) - (f30-0 (the-as float v0-0)) - ) + (let ((f30-0 (seek (-> arg0 frame-interp) 1.0 (* arg1 (-> *display* time-adjust-ratio))))) (set! (-> arg0 frame-interp) f30-0) (set! (-> arg0 frame-interp) f30-0) (if (= f30-0 1.0) @@ -164,4 +148,137 @@ (bit-10 10) ) -(define-extern process-entity-status! (function process entity-perm-status symbol int)) \ No newline at end of file +(define-extern process-entity-status! (function process entity-perm-status symbol int)) + +(defmacro ja-group (&key (chan 0)) + "get the frame group for self. default channel is 0, the base channel. returns #f if no frame group." + `(if (> (-> self skel active-channels) ,chan) + (-> self skel root-channel ,chan frame-group)) + ) + +(defmacro ja-group? (group &key (chan 0)) + "is self in this frame group on this channel? default is channel 0, which is the base channel." + `(= (ja-group) ,group) + ) + +(defmacro ja (&key (chan 0) + &key (group! #f) + &key (num! #f) + &key (param0 #f) + &key (param1 #f) + &key (num-func #f) + &key (frame-num #f) + &key (frame-interp #f) + &key (dist #f) + &key (eval? #t) + ) + "set various joint anim parameters for self and eval them. + you can use this for playing animations! + + chan = the channel to modify. defaults to 0 (base channel). this is usually what you want. + group! = when not #f, set this as the new frame-group. defaults to #f + num! = set the frame playback function. this is what determines what frame an animation is at. funcs below. + #f = no func will be set, and there wont be a frame eval. + num-func = sets the num-func field for the channel. this lets you change the function with eval'ing. + param0 = 1st parameter for the playback function. ONLY USE THESE WITH num-func !! + param1 = 2nd parameter for the playback function. ONLY USE THESE WITH num-func !! + frame-num = set the frame-num field. + frame-interp = set the frame-interp field. + dist = set the dist field. + + available num! functions: + - (+!) = advance anim. + - (-!) = reverse anim. + - (identity num) = play 'num' frame. + - (seek! target speed) = animate towards frame target at a speed. + speed is optional and defaults to 1.0 when not provided. + target is optional and defaults to the last frame of the animation. + if you want to set the speed, you therefore must also set the target. + target can be max (no quote), which is just the same as the default value. + - (loop! speed) = loop animation at a speed. default speed is 1.0 when not provided. + - (chan channel) = copy frame from another channel. + - min = the start of the animation. + - max = the end of the animation. + " + + (let* ((num-args (if (pair? num!) (cdr num!) '())) + (num! (if (pair? num!) (car num!) num!)) + (nf (cond + ((or (eq? num! 'identity) + (eq? num! 'min) + (eq? num! 'max) + ) + 'num-func-identity) + ((eq? num! 'none) 'num-func-none) + ((eq? num! '+!) 'num-func-+!) + ((eq? num! '-!) 'num-func--!) + ((eq? num! 'seek!) 'num-func-seek!) + ((eq? num! 'loop!) 'num-func-loop!) + ((eq? num! 'blend-in!) 'num-func-blend-in!) + ((eq? num! 'chan) 'num-func-chan) + )) + (p0 (if param0 param0 + (cond + ((eq? num! 'chan) `(the float ,(car num-args))) + ((eq? num! '+!) (if (null? num-args) 1.0 (car num-args))) + ((eq? num! '-!) (if (null? num-args) 1.0 (car num-args))) + ((eq? num! 'loop!) (if (null? num-args) 1.0 (if (eq? 'max (car num-args)) + (if group! + `(the float (1- (-> (the art-joint-anim ,group!) data 0 length))) + `(the float (1- (-> ja-ch frame-group data 0 length))) + ) + (car num-args)))) + ((eq? num! 'seek!) (if (or (null? num-args) (eq? (car num-args) 'max)) + (if group! + `(the float (1- (-> (the art-joint-anim ,group!) data 0 length))) + `(the float (1- (-> ja-ch frame-group data 0 length))) + ) + (car num-args))) + ))) + (p1 (if param1 param1 + (cond + ((eq? num! 'seek!) (if (or (null? num-args) (null? (cdr num-args))) 1.0 (cadr num-args))) + ))) + (frame-num (if (eq? 'max frame-num) (if group! + `(the float (1- (-> (the art-joint-anim ,group!) data 0 length))) + `(the float (1- (-> ja-ch frame-group data 0 length))) + ) + frame-num)) + (frame-group (if (or p0 p1 frame-num (not nf)) group! #f)) + ) + `(let ((ja-ch (-> self skel root-channel ,chan))) + ,(if frame-interp `(set! (-> ja-ch frame-interp) ,frame-interp) `(none)) + ,(if dist `(set! (-> ja-ch dist) ,dist) `(none)) + ,(if frame-group `(set! (-> ja-ch frame-group) (the art-joint-anim ,frame-group)) `(none)) + ,(if p0 `(set! (-> ja-ch param 0) ,p0) `(none)) + ,(if p1 `(set! (-> ja-ch param 1) ,p1) `(none)) + ,(if num-func `(set! (-> ja-ch num-func) ,num-func) `(none)) + ,(if frame-num `(set! (-> ja-ch frame-num) ,frame-num) `(none)) + ,(if nf + `(,(if eval? 'joint-control-channel-group-eval! 'joint-control-channel-group!) + ja-ch (the art-joint-anim ,group!) ,nf) + `(none)) + ,(cond + ((eq? num! 'min) `(set! (-> ja-ch frame-num) 0.0)) + ((eq? num! 'max) (if group! + `(set! (-> ja-ch frame-num) (the float (1- (-> (the art-joint-anim ,group!) data 0 length)))) + `(set! (-> ja-ch frame-num) (the float (1- (-> ja-ch frame-group data 0 length)))) + )) + ((eq? num! 'identity) `(set! (-> ja-ch frame-num) ,(car num-args))) + (#t `(none)) + ) + )) + ) + +(defmacro ja-no-eval (&key (chan 0) + &key (group! #f) + &key (num! #f) + &key (param0 #f) + &key (param1 #f) + &key (num-func #f) + &key (frame-num #f) + &key (frame-interp #f) + &key (dist #f) + ) + `(ja :eval? #f :chan ,chan :group! ,group! :num! ,num! :param0 ,param0 :param1 ,param1 :num-func ,num-func :frame-num ,frame-num :frame-interp ,frame-interp :dist ,dist) + ) diff --git a/goal_src/engine/draw/process-drawable.gc b/goal_src/engine/draw/process-drawable.gc index 30d37cc3ef..e7edd79d9c 100644 --- a/goal_src/engine/draw/process-drawable.gc +++ b/goal_src/engine/draw/process-drawable.gc @@ -5,6 +5,8 @@ ;; name in dgo: process-drawable ;; dgos: GAME, ENGINE +;; TODO: there are some missing functions here... + ;; DECOMP BEGINS (defun cspace-by-name ((arg0 process-drawable) (arg1 string)) @@ -170,7 +172,7 @@ (set! gp-0 (the-as cspace-array #f)) (goto cfg-16) ) - (let ((v1-10 ((method-of-type cspace dummy-9) (the-as cspace (-> gp-0 data)) #f))) + (let ((v1-10 ((method-of-type cspace reset-and-assign-geo!) (the-as cspace (-> gp-0 data)) #f))) (set! (-> v1-10 bone) (the-as bone (-> s4-1 bones))) (let ((a0-6 (-> gp-0 data))) (set! (-> a0-6 0 param0) cspace<-transformq!) @@ -179,13 +181,13 @@ (set! (-> v1-10 bone cache bone-matrix) (the-as uint 0)) ) 0 - (let ((v1-14 (dummy-9 (-> gp-0 data 1) #f))) + (let ((v1-14 (reset-and-assign-geo! (-> gp-0 data 1) #f))) (set! (-> v1-14 joint) (-> arg0 data 0)) (set! (-> v1-14 bone) (-> s4-1 bones 1)) (set! (-> v1-14 parent) (the-as cspace (-> gp-0 data))) (set! (-> v1-14 bone cache bone-matrix) (the-as uint 128)) ) - (let ((v1-17 (dummy-9 (-> gp-0 data 2) #f))) + (let ((v1-17 (reset-and-assign-geo! (-> gp-0 data 2) #f))) (set! (-> v1-17 joint) (-> arg0 data 1)) (set! (-> v1-17 bone) (-> s4-1 bones 2)) (set! (-> v1-17 parent) (the-as cspace (-> gp-0 data))) @@ -203,7 +205,7 @@ 0 ) ) - (v1-29 (dummy-9 (-> gp-0 data s3-0) #f)) + (v1-29 (reset-and-assign-geo! (-> gp-0 data s3-0) #f)) ) (set! (-> v1-29 joint) s1-0) (set! (-> v1-29 bone) (-> s4-1 bones s3-0)) @@ -270,8 +272,8 @@ (defun execute-math-engine () (#when PC_PORT - (with-dma-buffer-add-bucket ((debug-buf (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (with-dma-buffer-add-bucket ((debug-buf (-> (current-frame) global-buf)) + (bucket-id debug-no-zbuf)) (when (-> *pc-settings* display-actor-counts) (draw-string-xy (string-format "M: ~D/~D A: ~D" (-> *matrix-engine* length) MATRIX_ENGINE_AMOUNT (process-count *active-pool*)) debug-buf 8 (- 224 18) (font-color default) (font-flags shadow kerning)) ) @@ -300,7 +302,7 @@ (when (and parent (nonzero? parent) (-> parent joint) (-> parent parent)) (let ((child (vector<-cspace! (new-stack-vector0) (-> obj node-list data i))) ) - (add-debug-line #t (bucket-id debug-draw0) child (vector<-cspace! (new-stack-vector0) parent) (new 'static 'rgba :g #xff :a #x40) #f (the rgba -1)) + (add-debug-line #t (bucket-id debug) child (vector<-cspace! (new-stack-vector0) parent) (new 'static 'rgba :g #xff :a #x40) #f (the rgba -1)) ) ) ) @@ -383,7 +385,7 @@ ) ; (draw-bone-lines obj) ;; (draw-joint-spheres obj) - + 0 (none) ) @@ -402,8 +404,8 @@ (defun draw-joint-spheres ((arg0 process-drawable)) (dotimes (s5-0 (-> arg0 node-list length)) (let ((a2-0 (vector<-cspace! (new-stack-vector0) (-> arg0 node-list data s5-0)))) - (add-debug-sphere #t (bucket-id debug-draw0) a2-0 819.2 (new 'static 'rgba :g #xff :a #x40)) - ;;(add-debug-text-sphere #t (bucket-id debug-draw0) a2-0 819.2 (the string (-> arg0 node-list data s5-0 joint name)) (new 'static 'rgba :g #xff :a #x40)) + (add-debug-sphere #t (bucket-id debug) a2-0 819.2 (new 'static 'rgba :g #xff :a #x40)) + ;;(add-debug-text-sphere #t (bucket-id debug) a2-0 819.2 (the string (-> arg0 node-list data s5-0 joint name)) (new 'static 'rgba :g #xff :a #x40)) ) ) #f @@ -421,10 +423,9 @@ ) (defstate process-drawable-art-error (process-drawable) - :code - (behavior ((arg0 string)) + :code (behavior ((arg0 string)) (logior! (-> self entity extra perm status) (entity-perm-status bit-1)) - (while #t + (loop (when *display-entity-errors* (let ((s5-0 add-debug-text-3d) (s4-0 #t) @@ -450,10 +451,8 @@ (define-extern ja-post (function none :behavior process-drawable)) (define-extern anim-loop (function none :behavior process-drawable)) (defstate process-drawable-idle (process-drawable) - :code - anim-loop - :post - ja-post + :code anim-loop + :post ja-post ) ;; WARN: Stack slot offset 20 signed mismatch @@ -474,15 +473,7 @@ ) ) ) - (let ((s4-0 (load-to-heap-by-name - (-> s1-0 art-group) - (the-as string (-> arg0 art-group-name)) - #f - global - (-> arg0 version) - ) - ) - ) + (let ((s4-0 (load-to-heap-by-name (-> s1-0 art-group) (-> arg0 art-group-name) #f global (-> arg0 version)))) (when (or (zero? s4-0) (or (not s4-0) (!= (-> s4-0 type) art-group))) (go process-drawable-art-error "art-group") (set! s3-0 (the-as draw-control #f)) @@ -631,49 +622,52 @@ obj ) -(defmethod apply-alignment process-drawable ((obj process-drawable) (arg0 int) (arg1 transformq) (arg2 vector)) - (when (logtest? arg0 7) +(defmethod apply-alignment process-drawable ((obj process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector)) + (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) (let* ((body-T-world (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj root quat))) (world-T-body (matrix-transpose! (new 'stack-no-clear 'matrix) body-T-world)) (grav-rt-body (vector-matrix*! (new 'stack-no-clear 'vector) (-> *standard-dynamics* gravity) world-T-body)) (vel-rt-body (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj root transv) world-T-body)) ) - (if (logtest? arg0 2048) + (if (logtest? arg0 (align-opts no-gravity)) (set-vector! grav-rt-body 0.0 0.0 0.0 1.0) ) - (when (logtest? arg0 1) + (when (logtest? arg0 (align-opts adjust-x-vel)) (set! (-> vel-rt-body x) (+ (* (-> arg1 trans x) (-> arg2 x) (-> *display* frames-per-second)) (* (-> grav-rt-body x) (-> *display* seconds-per-frame)) ) ) - (if (zero? (logand arg0 12)) + (if (zero? (logand arg0 (align-opts adjust-xz-vel keep-other-velocities))) (set! (-> vel-rt-body z) 0.0) ) ) - (if (and (logtest? arg0 2) (not (and (logtest? arg0 4096) (= (-> arg1 trans y) 0.0)))) + (if (and (logtest? arg0 (align-opts adjust-y-vel)) + (not (and (logtest? arg0 (align-opts ignore-y-if-zero)) (= (-> arg1 trans y) 0.0))) + ) (set! (-> vel-rt-body y) (+ (* (-> arg1 trans y) (-> arg2 y) (-> *display* frames-per-second)) (* (-> grav-rt-body y) (-> *display* seconds-per-frame)) ) ) ) - (when (logtest? arg0 4) + (when (logtest? arg0 (align-opts adjust-xz-vel)) (set! (-> vel-rt-body z) (+ (* (-> arg1 trans z) (-> arg2 z) (-> *display* frames-per-second)) (* (-> grav-rt-body z) (-> *display* seconds-per-frame)) ) ) - (if (zero? (logand arg0 9)) + (if (zero? (logand arg0 (align-opts adjust-x-vel keep-other-velocities))) (set! (-> vel-rt-body x) 0.0) ) ) (vector-matrix*! (-> obj root transv) vel-rt-body body-T-world) ) ) - (if (logtest? arg0 16) + (if (logtest? arg0 (align-opts adjust-quat)) (quaternion-normalize! (quaternion*! (-> obj root quat) (-> obj root quat) (-> arg1 quat))) ) (the-as collide-shape (-> obj root)) ) + (defbehavior ja-done? process-drawable ((arg0 int)) (let ((v1-2 (-> self skel root-channel arg0))) (cond @@ -765,7 +759,7 @@ arg0 ) -(defbehavior ja-channel-push! process-drawable ((arg0 int) (arg1 int)) +(defbehavior ja-channel-push! process-drawable ((arg0 int) (arg1 time-frame)) (cond ((or (zero? (-> self skel active-channels)) (zero? arg1) @@ -1013,7 +1007,7 @@ (none) ) -(defmethod dummy-9 joint-control ((obj joint-control)) +(defmethod current-cycle-distance joint-control ((obj joint-control)) (cond ((< (the-as int (-> obj root-channel)) (the-as int (-> obj channel (-> obj active-channels)))) (let ((s5-0 (-> obj root-channel (-> obj root-channel 0 group-size))) @@ -1047,7 +1041,7 @@ (defbehavior anim-loop process-drawable () (logior! (-> self mask) (process-mask sleep-code)) - (while #t + (loop (nop!) (suspend) ) @@ -1086,8 +1080,8 @@ (defbehavior process-drawable-delay-player process-drawable ((arg0 time-frame)) (while (and *target* - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) (suspend) ) @@ -1140,7 +1134,7 @@ ) (set! (-> s4-0 options) (fact-options)) (if arg2 - (set! (-> s4-0 options) (fact-options fop6)) + (set! (-> s4-0 options) (fact-options instant-collect)) ) (when (and (nonzero? s5-0) (not (task-complete? *game-info* s5-0))) (label cfg-12) @@ -1198,11 +1192,10 @@ (else (set! s5-0 (cond ((valid? (-> s2-0 frame-group) art-joint-anim "joint-control frame-group" #t *valid-con*) - (when (not - (and (>= (the int (-> s2-0 frame-num)) 0) - (< (the int (-> s2-0 frame-num)) (-> s2-0 frame-group data 0 length)) - ) - ) + (when (not (and (>= (the int (-> s2-0 frame-num)) 0) + (< (the int (-> s2-0 frame-num)) (-> s2-0 frame-group data 0 length)) + ) + ) (format *valid-con* "ERROR: ~`joint-control-channel`P #~D has an invalid frame-num ~F/~D [0-~D]~%" diff --git a/goal_src/engine/engine/connect.gc b/goal_src/engine/engine/connect.gc index b0d9fc23d4..589f2a97ea 100644 --- a/goal_src/engine/engine/connect.gc +++ b/goal_src/engine/engine/connect.gc @@ -14,7 +14,7 @@ ;; Some example uses: ;; - a "foreground-engine" has connections to all foreground objects that need to be drawn on each frame. ;; - when a process wants to change a game setting, it opens a connection to the settings engine to request a change. -;; when the process is killed, the setting change is reverted. +;; when the process is killed (or it stops requesting the change), the setting change is reverted. ;; A "connection" is really just a function that gets called when the engine runs, or a set of parameters that the engine can iterate through. @@ -53,9 +53,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; this is the actual data for the connection. -;; it may be used in multiple ways, but it appears like -;; the first param0 is a function that receives -;; the three other params as arguments, plus the engine it is connect to as a 4th. +;; it may be used in multiple ways, but the most common is to use param0 as a function +;; it receives param1, param2, param3, and the engine as the arugmetns. ;; in some cases, the return value is checked for 'dead. (declare-type engine basic) diff --git a/goal_src/engine/entity/actor-link-h.gc b/goal_src/engine/entity/actor-link-h.gc index f7a66c5654..d9cf247bb8 100644 --- a/goal_src/engine/entity/actor-link-h.gc +++ b/goal_src/engine/entity/actor-link-h.gc @@ -6,13 +6,13 @@ ;; dgos: GAME, ENGINE ;; The exact details of actor-link-h are not yet understood, but this system caches lookups for entities/process. -;; Each entity has a res-lump. Some entities may reference other entities. This is done with an element in a res-lump -;; than contains named lists (possibly of size 1) of other entities. These lists may store entities by a name, or by an +;; Some entities may reference other entities. This is done with an element in a res-lump/entity that contains +;; named lists (possibly of size 1) of other entities. These lists may store entities by a name, or by an ;; actor id (AID). -;; This process is slow: it involves going from a process, to its entity, to doing a res-lump, deciding if you have an AID/string, +;; This process is slow: it involves going from a process, to its entity, to doing a lookup, deciding if you have an AID/string, ;; then looking up the other actor by name, or AID. Lookup by name is extremely slow, as it involves checking each actor's name -;; a res lookup per every actor in every level. Lookup by aid isn't bad, but is still a binary search through all actors. +;; per every actor in every level. Lookup by aid isn't bad, but is still a binary search through all actors. ;; The next-actor and prev-actor res build a linked list of actors. @@ -95,12 +95,14 @@ (defmethod next-actor entity-actor ((obj entity-actor)) "Utility function to look up the next actor in the list, assuming we don't have actor-link-info yet." + (declare (inline)) ;; look up reference to next-actor - this is slow. (entity-actor-lookup obj 'next-actor 0) ) (defmethod prev-actor entity-actor ((obj entity-actor)) "Look up previous actor in the list" + (declare (inline)) (entity-actor-lookup obj 'prev-actor 0) ) @@ -110,15 +112,9 @@ (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (set! (-> obj process) proc) - ;; set next (likely next-actor inlined) - (let ((ent (-> proc entity))) - (set! (-> obj next) (entity-actor-lookup (the-as res-lump ent) 'next-actor 0)) - ) - - ;; set prev (likely prev-actor inlined) - (let ((a0-2 (-> proc entity))) - (set! (-> obj prev) (entity-actor-lookup (the-as res-lump a0-2) 'prev-actor 0)) - ) + ;; set next and prev + (set! (-> obj next) (next-actor (-> proc entity))) + (set! (-> obj prev) (prev-actor (-> proc entity))) obj ) ) @@ -139,30 +135,18 @@ (defmethod get-next-process actor-link-info ((obj actor-link-info)) "Get the process for the next, if it exists." ;; we can't easily get to the actor-link-info of the next, so we have to grab it from entity-links. - (the-as process - (and (-> obj next) (-> (the-as entity-links (-> obj next extra)) process)) - ) + (the-as process (and (-> obj next) (-> obj next extra process))) ) (defmethod get-prev-process actor-link-info ((obj actor-link-info)) "Get the process for the prev, if it exists" - (the-as process - (and (-> obj prev) (-> (the-as entity-links (-> obj prev extra)) process)) - ) + (the-as process (and (-> obj prev) (-> obj prev extra process))) ) (defmethod link-to-next-and-prev-actor actor-link-info ((obj actor-link-info)) "Redo the linking in the constructor by looking up the next/prev actor." - (let ((a0-1 (-> obj process entity))) - (set! (-> obj next) - (entity-actor-lookup (the-as res-lump a0-1) 'next-actor 0) - ) - ) - (let ((a0-2 (-> obj process entity))) - (set! (-> obj prev) - (entity-actor-lookup (the-as res-lump a0-2) 'prev-actor 0) - ) - ) + (set! (-> obj next) (next-actor (-> obj process entity))) + (set! (-> obj prev) (prev-actor (-> obj process entity))) (-> obj next) ) @@ -176,7 +160,7 @@ (if (arg0 s3-0 arg1) (return (the-as int #f)) ) - (set! s3-0 (entity-actor-lookup s3-0 'next-actor 0)) + (set! s3-0 (next-actor s3-0)) ) ) 0 @@ -191,33 +175,28 @@ (if (arg0 s3-0 arg1) (return (the-as int #f)) ) - (set! s3-0 (entity-actor-lookup s3-0 'prev-actor 0)) + (set! s3-0 (prev-actor s3-0)) ) ) 0 ) -(defmethod apply-all actor-link-info - ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) +(defmethod apply-all actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) "Apply to all entities. Starts at the back and hits everyone, including this object." ;; start at us (next may give us #f here, so can't do that.) (let ((s4-0 (-> obj process entity))) ;; while there is a prev... - (while (let ((a0-2 s4-0)) - (entity-actor-lookup (the-as res-lump a0-2) 'prev-actor 0) - ) + (while (prev-actor s4-0) ;; set prev (this is stupid, they do the slow lookup twice!) - (set! s4-0 (entity-actor-lookup (the-as res-lump s4-0) 'prev-actor 0)) + (set! s4-0 (prev-actor s4-0)) ) ;; now iterate forward. (while s4-0 - (if (arg0 (the-as entity-actor s4-0) arg1) + (if (arg0 s4-0 arg1) (return (the-as int #f)) ) - (let ((a0-4 s4-0)) - (set! s4-0 (entity-actor-lookup (the-as res-lump a0-4) 'next-actor 0)) - ) + (set! s4-0 (next-actor s4-0)) ) ) 0 @@ -229,11 +208,11 @@ (let ((iter (-> obj next)) (result (the object #f))) (while iter - (let ((proc (-> (the entity-links (-> iter extra)) process))) + (let ((proc (-> iter extra process))) (when proc (set! result (or (send-event proc message) result)) ) - (set! iter (entity-actor-lookup iter 'next-actor 0)) + (set! iter (next-actor iter)) ) ) result @@ -246,11 +225,11 @@ (let ((iter (-> obj prev)) (result (the object #f))) (while iter - (let ((proc (-> (the entity-links (-> iter extra)) process))) + (let ((proc (-> iter extra process))) (when proc (set! result (or (send-event proc message) result)) ) - (set! iter (entity-actor-lookup iter 'prev-actor 0)) + (set! iter (prev-actor iter)) ) ) result @@ -264,7 +243,7 @@ ;; do we have a next? (when a0-1 ;; get the actual process - (let ((a0-2 (-> (the-as entity-links (-> a0-1 extra)) process))) + (let ((a0-2 (-> a0-1 extra process))) ;; do we have a process? (when a0-2 (send-event a0-2 message) @@ -280,7 +259,7 @@ (let ((a0-1 (-> obj prev))) (when a0-1 - (let ((a0-2 (-> (the-as entity-links (-> a0-1 extra)) process))) + (let ((a0-2 (-> a0-1 extra process))) (when a0-2 (send-event a0-2 message) ) @@ -310,17 +289,13 @@ (count 0) ) ;; get back to the beginning. - (while (let ((a0-2 actor)) - (entity-actor-lookup (the-as res-lump a0-2) 'prev-actor 0) - ) - (set! actor (entity-actor-lookup (the-as res-lump actor) 'prev-actor 0)) + (while (prev-actor actor) + (set! actor (prev-actor actor)) ) ;; iterate and set the count (while actor (+! count 1) - (let ((a0-3 actor)) - (set! actor (entity-actor-lookup (the-as res-lump a0-3) 'next-actor 0)) - ) + (set! actor (next-actor actor)) ) count ) @@ -335,8 +310,8 @@ (let ((current-bit 1)) ;; seek to beginning - (while (let ((a0-2 actor)) (entity-actor-lookup a0-2 'prev-actor 0)) - (set! actor (entity-actor-lookup actor 'prev-actor 0)) + (while (prev-actor actor) + (set! actor (prev-actor actor)) ) ;; loop over actors @@ -346,11 +321,9 @@ (set! mask (logior mask current-bit)) ) ;; next - (let ((a0-3 actor)) - (set! actor (entity-actor-lookup a0-3 'next-actor 0)) - ) + (set! actor (next-actor actor)) ;; next bit - (set! current-bit (* current-bit 2)) + (set! current-bit (ash current-bit 1)) ) ) mask @@ -364,17 +337,13 @@ (count 0) ) ;; go to beginning (why not count here???) - (while (let ((a0-2 actor)) - (entity-actor-lookup (the-as res-lump a0-2) 'prev-actor 0) - ) - (set! actor (entity-actor-lookup (the-as res-lump actor) 'prev-actor 0)) + (while (prev-actor actor) + (set! actor (prev-actor actor)) ) ;; go forward, until we hit this actor (while (!= actor this-actor) (+! count 1) - (let ((a0-3 actor)) - (set! actor (entity-actor-lookup (the-as res-lump a0-3) 'next-actor 0)) - ) + (set! actor (next-actor actor)) ) count ) @@ -383,7 +352,7 @@ (defun actor-link-subtask-complete-hook ((arg0 entity-actor) (arg1 (pointer symbol))) "Sets arg1 if the thing is complete. Does not continue the apply if the complete perm is set." (cond - ((logtest? (-> (the-as entity-links (-> arg0 extra)) perm status) (entity-perm-status complete)) + ((logtest? (-> arg0 extra perm status) (entity-perm-status complete)) (set! (-> arg1 0) #t) #f ) @@ -397,7 +366,7 @@ (defun actor-link-dead-hook ((arg0 entity-actor) (arg1 (pointer symbol))) "Sets arg1 is the thing is dead. Does not continue the apply if the dead perm is set." (cond - ((logtest? (-> (the-as entity-links (-> arg0 extra)) perm status) (entity-perm-status dead)) + ((logtest? (-> arg0 extra perm status) (entity-perm-status dead)) (set! (-> arg1 0) #t) #f ) @@ -419,7 +388,7 @@ ;; look up the alt actor (let ((a0-3 (entity-actor-lookup (the-as res-lump (-> arg0 entity)) 'alt-actor alt-actor-idx))) (if (or (not a0-3) - (zero? (logand (-> (the-as entity-links (-> a0-3 extra)) perm status) (entity-perm-status complete))) + (zero? (logand (-> a0-3 extra perm status) (entity-perm-status complete))) ) (+! incomplete-count 1) ) diff --git a/goal_src/engine/entity/entity.gc b/goal_src/engine/entity/entity.gc index cfcf3d4a06..361362f261 100644 --- a/goal_src/engine/entity/entity.gc +++ b/goal_src/engine/entity/entity.gc @@ -167,9 +167,7 @@ (when (nonzero? s4-0) (dotimes (s3-0 (-> s4-0 length)) (let ((s2-0 (-> s4-0 data s3-0 actor))) - (if (and (type-type? (-> s2-0 type) entity-actor) - (= (-> s2-0 etype) arg0) - ) + (if (and (type-type? (-> s2-0 type) entity-actor) (= (-> s2-0 etype) arg0)) (return s2-0) ) ) @@ -232,11 +230,10 @@ (let* ((t1-3 (-> a3-5 data t0-4 actor)) (t2-1 (-> t1-3 extra trans)) ) - (if (and - (= (the float (the int (-> t2-1 x))) arg0) - (= (the float (the int (-> t2-1 y))) arg1) - (= (the float (the int (-> t2-1 z))) arg2) - ) + (if (and (= (the float (the int (-> t2-1 x))) arg0) + (= (the float (the int (-> t2-1 y))) arg1) + (= (the float (the int (-> t2-1 z))) arg2) + ) (return t1-3) ) ) @@ -347,10 +344,9 @@ The second is a d, if we draw (only if we are process-drawable) The third is the LOD of the drawing. (also only for process-drawable)" (let* ((s5-0 arg0) - (proc-draw (the-as process-drawable - (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) process-drawable)) - s5-0 - ) + (proc-draw (the-as process-drawable (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) process-drawable)) + (the-as process-drawable s5-0) + ) ) ) ) @@ -458,8 +454,8 @@ ) (if (-> obj extra process) (* (- (-> obj extra process allocated-length) - (&- (-> obj extra process heap-top) (the-as uint (-> obj extra process heap-cur))) - ) + (&- (-> obj extra process heap-top) (the-as uint (-> obj extra process heap-cur))) + ) 8 ) "" @@ -862,7 +858,7 @@ (let ((s1-1 (the-as process-drawable (-> s0-0 extra process)))) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s1-1 root trans) (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) ) @@ -878,7 +874,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string (-> s1-1 state name)) (-> s1-1 root trans) (font-color white) @@ -910,7 +906,7 @@ (if (and (the-as structure v0-10) (= (-> v0-10 type) symbol)) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string v0-10) (-> s1-1 root trans) (font-color white) @@ -921,11 +917,11 @@ ) ) ((or (= arg0 'full) (-> s0-0 extra process)) - (add-debug-x #t (bucket-id debug-draw1) s1-0 (the-as rgba (if (-> s0-0 extra process) - (the-as uint #x8080ff80) - (the-as uint #x800000ff) - ) - ) + (add-debug-x #t (bucket-id debug-no-zbuf) s1-0 (the-as rgba (if (-> s0-0 extra process) + (the-as uint #x8080ff80) + (the-as uint #x800000ff) + ) + ) ) (set! sv-192 add-debug-text-3d) (set! sv-208 #t) @@ -982,13 +978,13 @@ (when (and (type-type? (-> s0-3 type) process-drawable) (nonzero? (-> (the-as process-drawable s0-3) draw))) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> (the-as process-drawable s0-3) root trans) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (vector+! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s0-3) draw origin) @@ -1022,15 +1018,15 @@ (s4-2 (-> (the-as process-drawable s5-2) root trans)) ) (when s3-2 - (add-debug-x #t (bucket-id debug-draw1) s4-2 (the-as rgba (if (-> s3-2 extra process) - (the-as uint #x8080ff80) - (the-as uint #x800000ff) - ) - ) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-2 (the-as rgba (if (-> s3-2 extra process) + (the-as uint #x8080ff80) + (the-as uint #x800000ff) + ) + ) ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (res-lump-struct s3-2 'name string) s4-2 (the-as font-color (if (logtest? (-> s3-2 extra perm status) (entity-perm-status bit-0 bit-1)) @@ -1042,7 +1038,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string (-> (the-as process-drawable s5-2) state name)) s4-2 (font-color white) @@ -1063,15 +1059,14 @@ (dummy-9 (-> (the-as process-drawable s5-2) vol)) ) ) - (if (and - (the-as process-drawable s5-2) - (type-type? (-> (the-as process-drawable s5-2) type) process-drawable) - (nonzero? (-> (the-as process-drawable s5-2) draw)) - *display-actor-vis* - ) + (if (and (the-as process-drawable s5-2) + (type-type? (-> (the-as process-drawable s5-2) type) process-drawable) + (nonzero? (-> (the-as process-drawable s5-2) draw)) + *display-actor-vis* + ) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (vector+! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s5-2) draw origin) @@ -1083,7 +1078,7 @@ ) ) (when (and *display-actor-vis* *display-actor-anim*) - (let ((s5-3 (entity-by-name (the-as string *display-actor-anim*)))) + (let ((s5-3 (entity-by-name *display-actor-anim*))) (when s5-3 (let ((v0-35 (res-lump-data s5-3 'visvol pointer)) (a1-31 (-> s5-3 extra vis-id)) @@ -1091,7 +1086,7 @@ (if v0-35 (add-debug-box #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (&+ v0-35 0)) (the-as vector (&+ v0-35 16)) (the-as rgba (if (is-object-visible? (-> s5-3 extra level) a1-31) @@ -1106,10 +1101,9 @@ ) ) ) - (if (and - (or *display-nav-marks* *display-path-marks* *display-vol-marks*) - (not (or *display-actor-anim* *display-process-anim*)) - ) + (if (and (or *display-nav-marks* *display-path-marks* *display-vol-marks*) + (not (or *display-actor-anim* *display-process-anim*)) + ) (iterate-process-tree *active-pool* (the-as (function object object) (lambda ((arg0 process-drawable)) @@ -1155,7 +1149,7 @@ (countdown (s2-4 (-> s3-4 length)) (add-debug-box #t - (bucket-id debug-draw0) + (bucket-id debug) (the-as vector (-> s3-4 data s2-4)) (the-as vector (+ (the-as uint (-> s3-4 data 0 max)) (* s2-4 32))) (the-as rgba (if (zero? (-> s4-4 index)) @@ -1171,17 +1165,16 @@ ) ) ) - (when (or - *display-ambient-hint-marks* - *display-ambient-sound-marks* - *display-ambient-poi-marks* - *display-ambient-light-marks* - *display-ambient-dark-marks* - *display-ambient-weather-off-marks* - *display-ambient-ocean-off-marks* - *display-ambient-ocean-near-off-marks* - *display-ambient-music-marks* - ) + (when (or *display-ambient-hint-marks* + *display-ambient-sound-marks* + *display-ambient-poi-marks* + *display-ambient-light-marks* + *display-ambient-dark-marks* + *display-ambient-weather-off-marks* + *display-ambient-ocean-off-marks* + *display-ambient-ocean-near-off-marks* + *display-ambient-music-marks* + ) (dotimes (s5-5 (-> obj length)) (let ((v1-214 (-> obj level s5-5))) (when (= (-> v1-214 status) 'active) @@ -1225,7 +1218,7 @@ ;;`(empty) ) -(defun init-entity ((proc process) (ent entity)) +(defun init-entity ((proc process) (ent entity-actor)) "This function starts up an entity! The process should not be activated yet." @@ -1248,27 +1241,12 @@ ;; TODO -(define-extern birth-viewer (function process entity object)) +(define-extern birth-viewer (function process entity-actor object)) (defmacro obj-etype? (&rest types) `(or ,@(apply (lambda (x) `(begin (define-extern ,x type) (type-type? (-> obj etype) ,x))) types)) ) -(defmacro heap-size-hack (info entity-type) - ; `(cond - ; ((type-type? ,entity-type collectable) - ; #x1000 - ; ) - ; (else - `(if ,info - (-> ,info heap-size) - #x4000 - ) - ; ) - ; ) - ; #x8000 - ) - (defmethod birth! entity-actor ((obj entity-actor)) "Create a process for this entity and start it." @@ -1288,7 +1266,10 @@ (let* ((entity-type (-> obj etype)) (info (entity-info-lookup entity-type)) - (entity-process (get-process *default-dead-pool* entity-type (heap-size-hack info entity-type) ;; hack, modified this. + (entity-process (get-process *default-dead-pool* entity-type (if info + (-> info heap-size) + #x4000 + ) ) ) ) @@ -1306,7 +1287,6 @@ (init-entity entity-process obj) ) (else - (birth-log "could not birth ~A because there was an issue.~%" obj) (when (not (birth-viewer entity-process obj)) (format 0 "ERROR: no proper process type named ~A exists in the code, could not start ~A~%" entity-type obj) (logior! (-> obj extra perm status) (entity-perm-status bit-0)) @@ -1317,7 +1297,7 @@ obj ) -(defun entity-deactivate-handler ((arg0 process) (arg1 entity)) +(defun entity-deactivate-handler ((arg0 process) (arg1 entity-actor)) "Handle a deactivation in the entity. The entity directly stores a process so it should remove that after deactivating." (when (= arg0 (-> arg1 extra process)) @@ -1372,12 +1352,10 @@ ;; NOTE: we don't actually birth the actors. It is too slow. ;; so it gets spread over multiple frames later. (when (nonzero? (-> obj actors)) - ;;(birth-log "add-to-level! for ~D actors for ~A~%" (-> obj actors length) obj) (dotimes (birth-idx (-> obj actors length)) (let* ((idx-to-birth (-> obj actor-birth-order birth-idx)) (actor-to-birth (-> obj actors data (logand idx-to-birth #xffff) actor)) ) - ;;(birth-log "now adding to level: ~D ~D ~A~%" birth-idx idx-to-birth actor-to-birth) (add-to-level! actor-to-birth *level* (-> obj level) (the-as actor-id (-> actor-to-birth aid))) ) ) @@ -1423,7 +1401,6 @@ (let ((cams (-> obj cameras))) (when (nonzero? cams) (dotimes (s3-1 (-> cams length)) - ;;(birth-log "birth cam: ~A~%" (-> cams s3-1)) (birth! (-> cams s3-1)) ) ) @@ -1471,11 +1448,10 @@ ) ((= (-> s2-0 type) part-tracker) (let ((v1-28 (the-as part-tracker s2-0))) - (if (and - (nonzero? (-> v1-28 part)) - (>= (the-as int (-> v1-28 part group)) (the-as int s4-2)) - (< (the-as int (-> v1-28 part group)) (the-as int s3-1)) - ) + (if (and (nonzero? (-> v1-28 part)) + (>= (the-as int (-> v1-28 part group)) (the-as int s4-2)) + (< (the-as int (-> v1-28 part group)) (the-as int s3-1)) + ) (deactivate s2-0) ) ) @@ -1489,11 +1465,10 @@ ) (when v1-34 (cond - ((and - (nonzero? (-> (the-as process-drawable v1-34) part)) - (>= (the-as int (-> (the-as process-drawable v1-34) part group)) (the-as int s4-2)) - (< (the-as int (-> (the-as process-drawable v1-34) part group)) (the-as int s3-1)) - ) + ((and (nonzero? (-> (the-as process-drawable v1-34) part)) + (>= (the-as int (-> (the-as process-drawable v1-34) part group)) (the-as int s4-2)) + (< (the-as int (-> (the-as process-drawable v1-34) part group)) (the-as int s3-1)) + ) (format #t "NOTICE: rogue null level entity (using part ~A) ~A~% still alive~%" @@ -1502,11 +1477,10 @@ ) (deactivate s2-0) ) - ((and - (nonzero? (-> (the-as process-drawable v1-34) draw)) - (>= (the-as int (-> (the-as process-drawable v1-34) draw art-group)) (the-as int s4-2)) - (< (the-as int (-> (the-as process-drawable v1-34) draw art-group)) (the-as int s3-1)) - ) + ((and (nonzero? (-> (the-as process-drawable v1-34) draw)) + (>= (the-as int (-> (the-as process-drawable v1-34) draw art-group)) (the-as int s4-2)) + (< (the-as int (-> (the-as process-drawable v1-34) draw art-group)) (the-as int s3-1)) + ) (format #t "NOTICE: rogue null level entity (using art ~A) ~A~% still alive~%" @@ -1540,13 +1514,12 @@ (logclear! (-> obj status) arg1) ) ((nonzero? (-> obj task)) - (logclear! (-> obj status) (logior - (if (logtest? (-> obj status) (entity-perm-status bit-4)) - 524 - 0 - ) - 515 - ) + (logclear! (-> obj status) (logior (if (logtest? (-> obj status) (entity-perm-status bit-4)) + 524 + 0 + ) + 515 + ) ) ) (else @@ -1644,23 +1617,20 @@ ) (defmethod run-logic? process-drawable ((obj process-drawable)) - (or - (zero? (logand (-> obj mask) (process-mask actor-pause))) - (or - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root trans) (math-camera-pos)) + (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) + (vector-vector-distance (-> obj root trans) (math-camera-pos)) + ) + (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) + (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) ) - ) ) (defmethod birth? entity-links ((obj entity-links) (arg0 vector)) - (and - (zero? (logand (-> obj perm status) (entity-perm-status bit-0 dead))) - (< (vector-vector-distance (-> obj trans) arg0) (-> *ACTOR-bank* birth-dist)) - ) + (and (zero? (logand (-> obj perm status) (entity-perm-status bit-0 dead))) + (< (vector-vector-distance (-> obj trans) arg0) (-> *ACTOR-bank* birth-dist)) + ) ) (defmethod actors-update level-group ((obj level-group)) @@ -1680,14 +1650,12 @@ ) ) (when (not (paused?)) - (let ((s5-1 (-> *display* frames (-> *display* last-screen) frame run-time))) - (let ((f0-5 - (fmax - 327680.0 - (fmin (+ 327680.0 (* 204.8 (the float (- 7000 (the-as int s5-1))))) (-> *ACTOR-bank* birth-dist)) - ) - ) - ) + ;; NOTE : get rid of lag compensation in PC port, it's not helpful + (let ((s5-1 (#if PC_PORT + 0 + (-> *display* frames (-> *display* last-screen) frame run-time) + ))) + (let ((f0-5 (fmax (meters 80) (fmin (+ (meters 80) (* (meters 0.05) (the float (- 7000 s5-1)))) (-> *ACTOR-bank* birth-dist))))) (seek! (-> *ACTOR-bank* pause-dist) f0-5 (* 81920.0 (-> *display* seconds-per-frame))) ) (seekl! (-> *ACTOR-bank* birth-max) (the int (lerp-scale 25.0 1.0 (the float s5-1) 2000.0 7000.0)) 10) @@ -1789,10 +1757,9 @@ (dotimes (s2-3 s3-4) (let ((s1-1 (-> s4-5 data s2-3))) (cond - ((and - (< (vector-vector-distance (-> s1-1 trans) sv-16) (-> *ACTOR-bank* birth-dist)) - (zero? (logand (-> s1-1 perm status) (entity-perm-status bit-9 bit-10))) - ) + ((and (< (vector-vector-distance (-> s1-1 trans) sv-16) (-> *ACTOR-bank* birth-dist)) + (zero? (logand (-> s1-1 perm status) (entity-perm-status bit-9 bit-10))) + ) (when (not (or (-> s1-1 process) (logtest? (-> s1-1 perm status) (entity-perm-status bit-0 dead)))) (birth! (-> s1-1 entity)) (set! sv-24 (+ sv-24 1)) @@ -1820,10 +1787,12 @@ (dotimes (s1-2 s2-4) (set! sv-32 (-> s3-5 data s1-2)) (cond - ((and - (is-object-visible? s4-2 (-> sv-32 vis-id)) - (zero? (logand (-> sv-32 perm status) (entity-perm-status bit-9 bit-10))) - ) + ((and (#if PC_PORT + (or (with-pc (-> *pc-settings* force-actors?)) (is-object-visible? s4-2 (-> sv-32 vis-id))) + (is-object-visible? s4-2 (-> sv-32 vis-id)) + ) + (zero? (logand (-> sv-32 perm status) (entity-perm-status bit-9 bit-10))) + ) (when (not (or (-> sv-32 process) (logtest? (-> sv-32 perm status) (entity-perm-status bit-0 dead)) s0-1)) (birth! (-> sv-32 entity)) (set! sv-24 (+ sv-24 1)) @@ -1936,14 +1905,14 @@ (let* ((e (-> inspect-info entity)) (name (res-lump-struct e 'name string))) (set! *display-actor-anim* (the string (and (-> inspect-info show-actor-info) name))) ;; draw trans - (add-debug-x #t (bucket-id debug-draw1) (-> e trans) (static-rgba 255 255 0 128)) + (add-debug-x #t (bucket-id debug-no-zbuf) (-> e trans) (static-rgba 255 255 0 128)) (if (or (not (-> inspect-info show-actor-info)) (!= (-> e type) entity-actor) (and (= (-> e type) entity-actor) (not (-> (the entity-actor e) extra process)))) - (add-debug-text-3d #t (bucket-id debug-draw1) name (-> e trans) (font-color red) (new 'static 'vector2h :y 8))) + (add-debug-text-3d #t (bucket-id debug-no-zbuf) name (-> e trans) (font-color red) (new 'static 'vector2h :y 8))) ;; start writing text (let* ((begin-y (- 16 (* (-> inspect-info scroll-y) 8))) (cur-y begin-y) (y-adv 8)) (with-dma-buffer-add-bucket ((debug-buf (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) ;; basic info, actor id, etc (draw-string-xy (string-format "~3L~A~0L ~A~%tags: ~D size: ~D aid: #x~x~%R1/L1 scroll L3 toggle display-actor-info~%--------------------" (-> e type) name (length e) (asize-of e) (-> e aid)) @@ -1972,11 +1941,21 @@ (cond ;; some water-height info ((and (= (-> e tag i name) 'water-height) (= (-> e tag i elt-count) 4) (= (-> e tag i elt-type) float)) - (format *debug-temp-string* " ~mm ~mm ~mm ~f" + (format *debug-temp-string* " ~mm ~mm ~mm #x~X" (-> (the (pointer float) data) 0) (-> (the (pointer float) data) 1) (-> (the (pointer float) data) 2) - (-> (the (pointer float) data) 3) + (-> (the (pointer uint32) data) 3) + ) + ) + ;; some water-height info but with 5 elts + ((and (= (-> e tag i name) 'water-height) (= (-> e tag i elt-count) 4) (= (-> e tag i elt-type) float)) + (format *debug-temp-string* " ~mm ~mm ~mm #x~X ~mm" + (-> (the (pointer float) data) 0) + (-> (the (pointer float) data) 1) + (-> (the (pointer float) data) 2) + (-> (the (pointer uint32) data) 3) + (-> (the (pointer float) data) 4) ) ) ;; music flava (music ambients) diff --git a/goal_src/engine/game/collectables-part.gc b/goal_src/engine/game/collectables-part.gc index d58a812a54..cd7c76030b 100644 --- a/goal_src/engine/game/collectables-part.gc +++ b/goal_src/engine/game/collectables-part.gc @@ -13,7 +13,8 @@ ;; DECOMP BEGINS (defun eco-fadeout ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) - (if (zero? (logand (-> (the-as process-drawable (-> arg1 key proc)) state-flags) 1)) + (if (zero? (logand (-> (the-as process-drawable (-> arg1 key proc)) state-flags) (state-flags fade-out-particles)) + ) (set! (-> arg1 next-time) (the-as uint (* (-> *sp-frame-time* x) 2))) ) 0 @@ -27,7 +28,7 @@ (set! (-> arg2 y) (-> a0-3 world-sphere y)) (set! (-> arg2 z) (-> a0-3 world-sphere z)) ) - (if (zero? (logand (-> v1-1 state-flags) 1)) + (if (zero? (logand (-> v1-1 state-flags) (state-flags fade-out-particles))) (set! (-> arg1 next-time) (the-as uint (* (-> *sp-frame-time* x) 2))) ) ) @@ -80,8 +81,7 @@ (defpartgroup group-eco-blue :id 42 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2 :flags (launch-asap) :binding 3) + :parts ((sp-item 2 :flags (launch-asap) :binding 3) (sp-item 3 :fade-after (meters 40) :flags (start-dead launch-asap) :binding 5) (sp-item 3 :fade-after (meters 60) :flags (start-dead launch-asap) :binding 5) (sp-item 3 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 5) @@ -105,8 +105,7 @@ ) (defpart 2 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4)) (sp-flt spt-scale-x (meters 0.01)) @@ -118,8 +117,7 @@ ) (defpart 3 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.3) (meters 0.15) 1.0) @@ -144,13 +142,11 @@ ) (defpart 4 - :init-specs - ((sp-flt spt-fade-a -0.21333334) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.21333334) (sp-int spt-timer 150)) ) (defpart 5 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.2) (meters 0.1) 1.0) @@ -175,13 +171,11 @@ ) (defpart 6 - :init-specs - ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) ) (defpart 7 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -200,8 +194,7 @@ ) (defpart 8 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -220,8 +213,7 @@ ) (defpart 9 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -240,8 +232,7 @@ ) (defpart 10 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.2 0.2 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -259,8 +250,7 @@ :duration 150 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 11 :flags (launch-asap) :binding 12) + :parts ((sp-item 11 :flags (launch-asap) :binding 12) (sp-item 12 :flags (start-dead launch-asap) :binding 13) (sp-item 12 :flags (start-dead launch-asap) :binding 14) (sp-item 12 :flags (start-dead launch-asap) :binding 13) @@ -282,8 +272,7 @@ ) (defpart 11 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -302,8 +291,7 @@ ) (defpart 12 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) (sp-flt spt-z (meters 0.08)) @@ -324,8 +312,7 @@ ) (defpart 13 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -344,8 +331,7 @@ ) (defpart 14 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -364,8 +350,7 @@ ) (defpart 147 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -386,8 +371,7 @@ (defpartgroup group-part-vent-blue-active :id 44 :bounds (static-bspherem 0 5 0 5) - :parts - ((sp-item 149 :fade-after (meters 140) :falloff-to (meters 140) :binding 156) + :parts ((sp-item 149 :fade-after (meters 140) :falloff-to (meters 140) :binding 156) (sp-item 149 :fade-after (meters 140) :falloff-to (meters 140) :binding 155) (sp-item 149 :fade-after (meters 140) :falloff-to (meters 140) :binding 154) (sp-item 150) @@ -408,13 +392,11 @@ (defpartgroup group-part-vent-blue-inactive :id 45 :bounds (static-bspherem 0 5 0 5) - :parts - ((sp-item 149 :fade-after (meters 100)) (sp-item 150)) + :parts ((sp-item 149 :fade-after (meters 100)) (sp-item 150)) ) (defpart 150 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -433,8 +415,7 @@ ) (defpart 149 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.05 0.1 1.0) (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -452,8 +433,7 @@ ) (defpart 156 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) @@ -472,8 +452,7 @@ ) (defpart 155 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) @@ -492,8 +471,7 @@ ) (defpart 154 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) @@ -512,8 +490,7 @@ ) (defpart 151 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.1 0.5 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -535,8 +512,7 @@ ) (defpart 152 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.2 0.4 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -558,8 +534,7 @@ ) (defpart 153 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-rnd-flt spt-num 0.3 0.1 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -581,8 +556,7 @@ ) (defpart 146 - :init-specs - ((sp-flt spt-r 64.0) + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) (sp-flt spt-fade-r -1.0) (sp-flt spt-fade-g -1.0) @@ -593,8 +567,7 @@ (defpartgroup group-eco-red :id 48 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 160 :flags (launch-asap) :binding 161) + :parts ((sp-item 160 :flags (launch-asap) :binding 161) (sp-item 161 :flags (start-dead launch-asap) :binding 162) (sp-item 161 :flags (start-dead launch-asap) :binding 162) (sp-item 161 :flags (start-dead launch-asap) :binding 162) @@ -614,8 +587,7 @@ ) (defpart 160 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4)) (sp-flt spt-scale-x (meters 0.01)) @@ -627,8 +599,7 @@ ) (defpart 161 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.15) (meters 0.2) 1.0) @@ -653,13 +624,11 @@ ) (defpart 165 - :init-specs - ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) ) (defpart 162 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.25) (meters 0.1) 1.0) @@ -681,13 +650,11 @@ ) (defpart 166 - :init-specs - ((sp-flt spt-fade-a -0.21333334) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.21333334) (sp-int spt-timer 150)) ) (defpart 163 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -707,8 +674,7 @@ ) (defpart 164 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -731,8 +697,7 @@ ) (defpart 167 - :init-specs - ((sp-flt spt-fade-g 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0)) ) (defpartgroup group-eco-red-collect @@ -741,8 +706,7 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 168 :flags (launch-asap) :binding 169) + :parts ((sp-item 168 :flags (launch-asap) :binding 169) (sp-item 169 :flags (start-dead launch-asap) :binding 170) (sp-item 169 :flags (start-dead launch-asap) :binding 170) (sp-item 169 :flags (start-dead launch-asap) :binding 170) @@ -757,8 +721,7 @@ ) (defpart 168 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -777,8 +740,7 @@ ) (defpart 169 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) (sp-flt spt-z (meters 0.08)) @@ -799,8 +761,7 @@ ) (defpart 170 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -826,8 +787,7 @@ (defpartgroup group-part-vent-red-active :id 50 :bounds (static-bspherem 0 3 0 5) - :parts - ((sp-item 172 :fade-after (meters 30) :period 330 :length 5 :binding 173) + :parts ((sp-item 172 :fade-after (meters 30) :period 330 :length 5 :binding 173) (sp-item 172 :fade-after (meters 60) :period 736 :length 5 :binding 173) (sp-item 172 :fade-after (meters 90) :period 936 :length 5 :binding 173) (sp-item 172 :fade-after (meters 130) :period 528 :length 5 :binding 173) @@ -864,13 +824,11 @@ (defpartgroup group-part-vent-red-inactive :id 51 :bounds (static-bspherem 0 3 0 5) - :parts - ((sp-item 176 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 177)) + :parts ((sp-item 176 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 177)) ) (defpart 177 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.6 0.6 1.0) (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -891,8 +849,7 @@ ) (defpart 176 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.1 0.3 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -913,8 +870,7 @@ ) (defpart 172 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 1.5) 1.0) (sp-flt spt-scale-x (meters 0.01)) @@ -929,8 +885,7 @@ ) (defpart 173 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 0.5)) @@ -953,8 +908,7 @@ ) (defpart 174 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.25) (meters 0.1) 1.0) @@ -973,8 +927,7 @@ ) (defpart 175 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -998,15 +951,13 @@ ) (defpart 171 - :init-specs - ((sp-flt spt-fade-g 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0)) ) (defpartgroup group-part-vent-yellow-active :id 52 :bounds (static-bspherem 0 3 0 5) - :parts - ((sp-item 178 :fade-after (meters 40) :period 330 :length 5 :binding 179) + :parts ((sp-item 178 :fade-after (meters 40) :period 330 :length 5 :binding 179) (sp-item 178 :fade-after (meters 60) :period 736 :length 5 :binding 179) (sp-item 178 :fade-after (meters 80) :period 936 :length 5 :binding 179) (sp-item 178 :fade-after (meters 100) :period 528 :length 5 :binding 179) @@ -1043,13 +994,11 @@ (defpartgroup group-part-vent-yellow-inactive :id 53 :bounds (static-bspherem 0 3 0 5) - :parts - ((sp-item 182 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 183)) + :parts ((sp-item 182 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 183)) ) (defpart 183 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.6 0.6 1.0) (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1070,8 +1019,7 @@ ) (defpart 182 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.1 0.3 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1092,8 +1040,7 @@ ) (defpart 178 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 1.5) 1.0) (sp-flt spt-scale-x (meters 0.01)) @@ -1108,8 +1055,7 @@ ) (defpart 179 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-flt spt-y (meters 0)) @@ -1129,8 +1075,7 @@ ) (defpart 180 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1150,8 +1095,7 @@ ) (defpart 181 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.5 2.0 1.0) (sp-flt spt-y (meters -0.05)) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.1) 1.0) @@ -1178,15 +1122,13 @@ ) (defpart 190 - :init-specs - ((sp-flt spt-fade-r 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0)) ) (defpartgroup group-eco-yellow :id 56 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 191 :flags (launch-asap) :binding 192) + :parts ((sp-item 191 :flags (launch-asap) :binding 192) (sp-item 192 :flags (start-dead launch-asap) :binding 193) (sp-item 192 :flags (start-dead launch-asap) :binding 193) (sp-item 192 :flags (start-dead launch-asap) :binding 193) @@ -1209,8 +1151,7 @@ ) (defpart 191 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4)) (sp-flt spt-scale-x (meters 0.01)) @@ -1222,8 +1163,7 @@ ) (defpart 192 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.15) (meters 0.2) 1.0) @@ -1248,13 +1188,11 @@ ) (defpart 196 - :init-specs - ((sp-flt spt-fade-a -0.10666667) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.10666667) (sp-int spt-timer 150)) ) (defpart 193 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.75) (meters 0.1) 1.0) @@ -1276,13 +1214,11 @@ ) (defpart 197 - :init-specs - ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) ) (defpart 194 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1302,8 +1238,7 @@ ) (defpart 195 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1324,8 +1259,7 @@ ) (defpart 198 - :init-specs - ((sp-flt spt-fade-g 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0)) ) (defpartgroup group-eco-yellow-collect @@ -1333,8 +1267,7 @@ :duration 150 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 199 :flags (launch-asap) :binding 200) + :parts ((sp-item 199 :flags (launch-asap) :binding 200) (sp-item 200 :flags (start-dead launch-asap) :binding 201) (sp-item 200 :flags (start-dead launch-asap) :binding 201) (sp-item 200 :flags (start-dead launch-asap) :binding 201) @@ -1349,8 +1282,7 @@ ) (defpart 199 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1369,8 +1301,7 @@ ) (defpart 200 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) (sp-flt spt-z (meters 0.08)) @@ -1391,8 +1322,7 @@ ) (defpart 201 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1415,8 +1345,7 @@ (defpartgroup group-eco-green :id 58 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 202 :flags (launch-asap) :binding 203) + :parts ((sp-item 202 :flags (launch-asap) :binding 203) (sp-item 203 :flags (start-dead launch-asap) :binding 204) (sp-item 203 :flags (start-dead launch-asap) :binding 204) (sp-item 203 :flags (start-dead launch-asap) :binding 204) @@ -1438,8 +1367,7 @@ ) (defpart 202 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4)) (sp-flt spt-scale-x (meters 0.01)) @@ -1454,8 +1382,7 @@ ) (defpart 203 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.3) (meters 0.25) 1.0) @@ -1479,13 +1406,11 @@ ) (defpart 206 - :init-specs - ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) ) (defpart 204 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 0.3)) @@ -1507,13 +1432,11 @@ ) (defpart 207 - :init-specs - ((sp-flt spt-fade-a -0.42666668) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.42666668) (sp-int spt-timer 150)) ) (defpart 205 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-y (meters -0.05)) (sp-flt spt-scale-x (meters 0.3)) @@ -1534,15 +1457,13 @@ ) (defpart 208 - :init-specs - ((sp-flt spt-fade-r 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0)) ) (defpartgroup group-eco-green-pill :id 59 :bounds (static-bspherem 0 0 0 0.4) - :parts - ((sp-item 209 :flags (launch-asap) :binding 210) + :parts ((sp-item 209 :flags (launch-asap) :binding 210) (sp-item 210 :flags (start-dead launch-asap) :binding 211) (sp-item 211 :flags (start-dead launch-asap) :binding 212) (sp-item 212 :flags (start-dead launch-asap) :binding 213) @@ -1554,8 +1475,7 @@ ) (defpart 209 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.01)) (sp-copy-from-other spt-scale-y -4) @@ -1569,8 +1489,7 @@ ) (defpart 210 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.2) (meters 0.1) 1.0) @@ -1594,13 +1513,11 @@ ) (defpart 214 - :init-specs - ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) ) (defpart 211 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0) (meters 0.2) 1.0) @@ -1624,8 +1541,7 @@ ) (defpart 212 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 0.08)) @@ -1647,13 +1563,11 @@ ) (defpart 215 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-a -0.8466667) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-a -0.8466667) (sp-int spt-timer 150)) ) (defpart 213 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-y (meters -0.05)) (sp-flt spt-scale-x (meters 0.15)) @@ -1678,8 +1592,7 @@ :duration 150 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 216 :flags (launch-asap) :binding 217) + :parts ((sp-item 216 :flags (launch-asap) :binding 217) (sp-item 217 :flags (start-dead launch-asap) :binding 218) (sp-item 217 :flags (start-dead launch-asap) :binding 218) (sp-item 217 :flags (start-dead launch-asap) :binding 218) @@ -1698,8 +1611,7 @@ :duration 150 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 216 :flags (launch-asap) :binding 219) + :parts ((sp-item 216 :flags (launch-asap) :binding 219) (sp-item 219 :flags (start-dead launch-asap) :binding 218) (sp-item 219 :flags (start-dead launch-asap) :binding 218) (sp-item 219 :flags (start-dead launch-asap) :binding 218) @@ -1714,8 +1626,7 @@ ) (defpart 216 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1733,8 +1644,7 @@ ) (defpart 148 - :init-specs - ((sp-flt spt-scale-x (meters 0.1)) + :init-specs ((sp-flt spt-scale-x (meters 0.1)) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-a 0.0) (sp-flt spt-fade-a 0.0) @@ -1742,8 +1652,7 @@ ) (defpart 219 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) (sp-flt spt-z (meters 0.08)) @@ -1763,8 +1672,7 @@ ) (defpart 217 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) (sp-flt spt-z (meters 0.08)) @@ -1784,8 +1692,7 @@ ) (defpart 220 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -0.05)) (sp-flt spt-scale-x (meters 0.3)) @@ -1806,8 +1713,7 @@ ) (defpart 218 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -0.05)) (sp-flt spt-scale-x (meters 0.2)) @@ -1830,8 +1736,7 @@ (defpartgroup group-part-vent-green-active :id 62 :bounds (static-bspherem 0 5 0 5) - :parts - ((sp-item 222 :fade-after (meters 80) :falloff-to (meters 80) :period 48 :length 5 :binding 223) + :parts ((sp-item 222 :fade-after (meters 80) :falloff-to (meters 80) :period 48 :length 5 :binding 223) (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) @@ -1868,8 +1773,7 @@ ) (defpart 226 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.6 0.6 1.0) (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1890,8 +1794,7 @@ ) (defpart 225 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.1 0.3 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1912,8 +1815,7 @@ ) (defpart 222 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-scale-x (meters 0.01)) @@ -1926,8 +1828,7 @@ ) (defpart 223 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.2) (meters 0.6) 1.0) @@ -1950,13 +1851,11 @@ ) (defpart 227 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-a -0.8466667) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-a -0.8466667) (sp-int spt-timer 150)) ) (defpart 224 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.2)) (sp-copy-from-other spt-scale-y -4) @@ -1978,8 +1877,7 @@ (defpartgroup group-fuel-cell-starburst :id 63 :bounds (static-bspherem 0 0.5 0 1.5) - :parts - ((sp-item 228 :fade-after (meters 35)) + :parts ((sp-item 228 :fade-after (meters 35)) (sp-item 229 :fade-after (meters 20)) (sp-item 230 :flags (bit1 launch-asap)) (sp-item 231 :flags (bit1 launch-asap)) @@ -1987,8 +1885,7 @@ ) (defpart 228 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-int spt-rot-x 4) @@ -2011,13 +1908,11 @@ ) (defpart 232 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) (defpart 229 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-int spt-rot-x 4) @@ -2039,8 +1934,7 @@ ) (defpart 230 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3.5)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2057,8 +1951,7 @@ ) (defpart 231 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 4)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2089,8 +1982,7 @@ ) (defpart 233 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-int spt-rot-x 4) @@ -2112,13 +2004,11 @@ ) (defpart 234 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) (defpart 235 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-int spt-rot-x 4) @@ -2139,8 +2029,7 @@ ) (defpart 236 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2.5)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2157,8 +2046,7 @@ ) (defpart 237 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2196,13 +2084,11 @@ (defpartgroup group-buzzer-effect :id 65 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 239 :flags (is-3d)) (sp-item 240 :flags (is-3d))) + :parts ((sp-item 239 :flags (is-3d)) (sp-item 240 :flags (is-3d))) ) (defpart 239 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1a :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-scale-x (meters 1.3) (meters 0.2) 1.0) (sp-rnd-flt spt-rot-x 0.0 12743.111 1.0) @@ -2221,8 +2107,7 @@ ) (defpart 240 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1a :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-scale-x (meters 1.3) (meters 0.2) 1.0) (sp-rnd-flt spt-rot-x 20024.889 12743.111 1.0) @@ -2246,13 +2131,11 @@ :linger-duration 1200 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 241) (sp-item 242) (sp-item 243)) + :parts ((sp-item 241) (sp-item 242) (sp-item 243)) ) (defpart 241 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -2275,8 +2158,7 @@ ) (defpart 242 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 2) 1.0) (sp-int spt-rot-x 4) @@ -2298,8 +2180,7 @@ ) (defpart 243 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 6)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2326,13 +2207,11 @@ :linger-duration 1200 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 246) (sp-item 247) (sp-item 248)) + :parts ((sp-item 246) (sp-item 247) (sp-item 248)) ) (defpart 246 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -2355,8 +2234,7 @@ ) (defpart 247 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 2) 1.0) (sp-int spt-rot-x 4) @@ -2378,8 +2256,7 @@ ) (defpart 248 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 6)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2406,13 +2283,11 @@ :linger-duration 1200 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 249) (sp-item 250) (sp-item 251)) + :parts ((sp-item 249) (sp-item 250) (sp-item 251)) ) (defpart 249 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -2435,13 +2310,11 @@ ) (defpart 244 - :init-specs - ((sp-flt spt-fade-a -0.15238096)) + :init-specs ((sp-flt spt-fade-a -0.15238096)) ) (defpart 250 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 2) 1.0) (sp-int spt-rot-x 4) @@ -2463,8 +2336,7 @@ ) (defpart 251 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 6)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2486,8 +2358,7 @@ ) (defpart 245 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.025)) (sp-copy-from-other spt-scalevel-y -4)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.025)) (sp-copy-from-other spt-scalevel-y -4)) ) (defpartgroup group-red-collect @@ -2496,13 +2367,11 @@ :linger-duration 1200 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 252) (sp-item 253) (sp-item 254)) + :parts ((sp-item 252) (sp-item 253) (sp-item 254)) ) (defpart 252 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -2525,8 +2394,7 @@ ) (defpart 253 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 2) 1.0) (sp-int spt-rot-x 4) @@ -2548,8 +2416,7 @@ ) (defpart 254 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 6)) (sp-flt spt-rot-z (degrees 0.0)) diff --git a/goal_src/engine/game/collectables.gc b/goal_src/engine/game/collectables.gc index fde83563a7..84baaf4b26 100644 --- a/goal_src/engine/game/collectables.gc +++ b/goal_src/engine/game/collectables.gc @@ -22,6 +22,11 @@ ;; DECOMP BEGINS +(import "goal_src/import/buzzer-ag.gc") +(import "goal_src/import/ecovalve-ag.gc") +(import "goal_src/import/money-ag.gc") +(import "goal_src/import/fuel-cell-ag.gc") + (define *eco-pill-count* 0) (deftype collectable (process-drawable) @@ -50,9 +55,6 @@ (initialize (_type_) _type_ 20) (initialize-params (_type_ time-frame float) none 21) ) - (:states - (hud-collecting handle) - ) ) @@ -68,7 +70,7 @@ ) (cond ((or (= (vector-length (-> obj root-override transv)) 0.0) - (logtest? (-> obj fact options) (fact-options fop6)) + (logtest? (-> obj fact options) (fact-options instant-collect)) ) (vector-reset! (-> obj root-override transv)) ) @@ -172,60 +174,28 @@ (set! (-> obj collect-effect) (-> *part-group-id-table* 68)) (set! (-> obj collect-effect2) (-> *part-group-id-table* 57)) (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "yel-eco-idle") - :volume #x400 - :fo-max 15 - ) - ) + (set! (-> obj sound-name) (static-sound-spec "yel-eco-idle" :fo-max 15)) ) (((pickup-type eco-red)) (set! (-> obj eco-effect) (-> *part-group-id-table* 48)) (set! (-> obj collect-effect) (-> *part-group-id-table* 69)) (set! (-> obj collect-effect2) (-> *part-group-id-table* 49)) (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "red-eco-idle") - :volume #x400 - :fo-max 15 - ) - ) + (set! (-> obj sound-name) (static-sound-spec "red-eco-idle" :fo-max 15)) ) (((pickup-type eco-blue)) (set! (-> obj eco-effect) (-> *part-group-id-table* 42)) (set! (-> obj collect-effect) (-> *part-group-id-table* 67)) (set! (-> obj collect-effect2) (-> *part-group-id-table* 43)) (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "blue-eco-idle") - :volume #x400 - :fo-max 15 - ) - ) + (set! (-> obj sound-name) (static-sound-spec "blue-eco-idle" :fo-max 15)) ) (((pickup-type eco-green)) (set! (-> obj eco-effect) (-> *part-group-id-table* 58)) (set! (-> obj collect-effect) (-> *part-group-id-table* 66)) (set! (-> obj collect-effect2) (-> *part-group-id-table* 61)) (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "green-eco-idle") - :volume #x400 - :fo-max 15 - ) - ) + (set! (-> obj sound-name) (static-sound-spec "green-eco-idle" :fo-max 15)) ) (((pickup-type eco-pill)) (set! (-> obj eco-effect) (-> *part-group-id-table* 59)) @@ -234,9 +204,9 @@ ) ) (set! (-> obj part) (create-launch-control (-> obj eco-effect) obj)) - (when (-> obj sound-name) - (set! (-> obj sound) (new 'process 'ambient-sound (-> obj sound-name) (-> obj root-override trans))) - ) + (if (-> obj sound-name) + (set! (-> obj sound) (new 'process 'ambient-sound (-> obj sound-name) (-> obj root-override trans))) + ) (none) ) @@ -421,23 +391,20 @@ (defstate blocked (eco-collectable) :virtual #t - :trans - (behavior () + :trans (behavior () (if (task-complete? *game-info* (-> self entity extra perm task)) (go-virtual wait) ) (none) ) - :code - (the-as (function none :behavior eco-collectable) anim-loop) + :code (the-as (function none :behavior eco-collectable) anim-loop) ) (defstate jump (eco-collectable) :virtual #t - :code - (behavior () + :code (behavior () (if (type-type? (-> self type) fuel-cell) - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") ) (logclear! (-> self mask) (process-mask actor-pause)) (let ((gp-1 (new 'stack 'trajectory))) @@ -457,12 +424,9 @@ (transform-post) (animate self) (suspend) - (when (nonzero? (-> self skel)) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) 0.5) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) + (if (nonzero? (-> self skel)) + (ja :num! (loop! 0.5)) ) - ) ) ) (set! (-> self root-override trans quad) (-> self jump-pos quad)) @@ -481,8 +445,7 @@ (defstate wait (eco-collectable) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-3 none)) (when (and (or (= arg2 'touch) (= arg2 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) @@ -561,9 +524,8 @@ ) ) ) - :enter - (behavior () - (if (and (logtest? (-> self fact options) (fact-options fop6 can-collect)) + :enter (behavior () + (if (and (logtest? (-> self fact options) (fact-options instant-collect can-collect)) (logtest? (-> self flags) (collectable-flags can-collect)) (!= (-> self next-state name) 'pickup) (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) @@ -572,8 +534,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (cond ((logtest? (-> self flags) (collectable-flags trans)) (vector-v++! @@ -600,7 +561,7 @@ ) (go-virtual notice-blue (process->handle *target*)) ) - (if (and (logtest? (-> self fact options) (fact-options fop6 can-collect)) + (if (and (logtest? (-> self fact options) (fact-options instant-collect can-collect)) (!= (-> self next-state name) 'pickup) (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) ) @@ -617,9 +578,8 @@ (update-transforms! (-> self root-override)) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((gp-0 (-> self part)) (s5-0 (-> self root-override root-prim prim-core)) ) @@ -639,7 +599,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self actor-pause) #f) (logior! (-> self flags) (collectable-flags fading)) - (logior! (-> self state-flags) 1) + (logior! (-> self state-flags) (state-flags fade-out-particles)) (set! (-> gp-0 fade) (* 0.0033333334 (the float v1-10))) ) ) @@ -658,8 +618,7 @@ (defstate notice-blue (eco-collectable) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (and (or (= arg2 'touch) (= arg2 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) @@ -671,8 +630,7 @@ (go-virtual pickup #f (process->handle arg0)) ) ) - :enter - (behavior ((arg0 handle)) + :enter (behavior ((arg0 handle)) (set! (-> self target) arg0) (set! (-> self speed quad) (the-as uint128 0)) (set! (-> self speed z) (the-as float (if (rand-vu-percent? (the-as float 0.5)) @@ -685,15 +643,13 @@ (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) (set! (-> a1-0 num-params) 2) @@ -706,9 +662,8 @@ ) (none) ) - :code - (behavior ((arg0 handle)) - (while #t + :code (behavior ((arg0 handle)) + (loop (set! (-> self root-override trans quad) (-> self base quad)) (add-blue-motion #t #f #t #f) (update-transforms! (-> self root-override)) @@ -733,8 +688,7 @@ (defstate pickup (eco-collectable) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -773,8 +727,7 @@ ) ) ) - :enter - (behavior ((arg0 object) (arg1 handle)) + :enter (behavior ((arg0 object) (arg1 handle)) (set! (-> self pickup-handle) arg1) (when (-> self notify-parent) (let ((gp-0 (new 'stack-no-clear 'event-message-block))) @@ -797,8 +750,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :code - (behavior ((arg0 object) (arg1 handle)) + :code (behavior ((arg0 object) (arg1 handle)) (clear-collide-with-as (-> self root-override)) (if (not (or (= (-> self fact pickup-type) (pickup-type eco-pill)) (logtest? (-> self fact options) (fact-options powerup)) @@ -811,13 +763,13 @@ ) (case (-> self fact pickup-type) (((pickup-type eco-yellow)) - (sound-play-by-name (static-sound-name "y-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "y-eco-pickup") ) (((pickup-type eco-red)) - (sound-play-by-name (static-sound-name "r-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "r-eco-pickup") ) (((pickup-type eco-blue)) - (sound-play-by-name (static-sound-name "b-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "b-eco-pickup") (case (-> (level-get-target-inside *level*) name) (('training) (level-hint-spawn @@ -831,85 +783,71 @@ ) ) (((pickup-type eco-green)) - (sound-play-by-name (static-sound-name "g-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "g-eco-pickup") ) (((pickup-type eco-green) (pickup-type eco-pill)) - (sound-play-by-name (static-sound-name "pill-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "pill-pickup") ) ) (if (nonzero? (-> self part)) (kill-and-free-particles (-> self part)) ) (let ((gp-6 (handle->process (-> self pickup-handle)))) - (when (nonzero? (-> self collect-effect)) - (let ((s5-5 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-5 - (let ((t9-17 (method-of-type part-tracker activate))) - (t9-17 (the-as part-tracker s5-5) gp-6 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-5 - part-tracker-init - (-> self collect-effect) - -1 - part-tracker-track-target - #f - #f - (-> self root-override root-prim prim-core) - ) - (-> s5-5 ppointer) + (if (nonzero? (-> self collect-effect)) + (process-spawn + part-tracker + :init part-tracker-init + (-> self collect-effect) + -1 + part-tracker-track-target + #f + #f + (-> self root-override root-prim prim-core) + :to gp-6 ) ) - ) ) - (when (nonzero? (-> self collect-effect2)) - (let ((gp-7 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-7 - (let ((t9-20 (method-of-type part-tracker activate))) - (t9-20 (the-as part-tracker gp-7) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-7 - part-tracker-init - (-> self collect-effect2) - -1 - (lambda ((arg0 part-tracker)) - (let ((s5-0 (handle->process (-> arg0 userdata)))) - (when s5-0 - (let* ((v1-4 (handle->process (-> (the-as eco-collectable s5-0) pickup-handle))) - (a2-0 (cond - ((not v1-4) - (-> arg0 root trans) - ) - ((= (-> v1-4 type) target) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as target v1-4) node-list data 5)) - ) - (else - (-> (the-as target v1-4) control trans) - ) + (if (nonzero? (-> self collect-effect2)) + (process-spawn + part-tracker + :init part-tracker-init + (-> self collect-effect2) + -1 + (lambda ((arg0 part-tracker)) + (let ((s5-0 (handle->process (-> arg0 userdata)))) + (when s5-0 + (let* ((v1-4 (handle->process (-> (the-as eco-collectable s5-0) pickup-handle))) + (a2-0 (cond + ((not v1-4) + (-> arg0 root trans) + ) + ((= (-> v1-4 type) target) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as target v1-4) node-list data 5)) + ) + (else + (-> (the-as target v1-4) control trans) ) ) - ) - (vector-lerp! - (-> arg0 root trans) - (-> arg0 offset) - a2-0 - (/ (the float (- (-> *display* base-frame-counter) (-> arg0 start-time))) - (the float (-> (the-as eco-collectable s5-0) collect-effect-time)) - ) - ) + ) + ) + (vector-lerp! + (-> arg0 root trans) + (-> arg0 offset) + a2-0 + (/ (the float (- (-> *display* base-frame-counter) (-> arg0 start-time))) + (the float (-> (the-as eco-collectable s5-0) collect-effect-time)) + ) ) ) ) ) - (process->handle self) - #f - (-> self root-override root-prim prim-core) ) - (-> gp-7 ppointer) + (process->handle self) + #f + (-> self root-override root-prim prim-core) + :to self ) ) - ) (while (-> self child) (suspend) ) @@ -920,8 +858,7 @@ (defstate die (eco-collectable) :virtual #t - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status dead) #t) (none) ) @@ -951,8 +888,7 @@ (defstate die (eco) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'fade) @@ -966,19 +902,17 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) (none) ) - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) (logclear! (-> self mask) (process-mask actor-pause)) - (logclear! (-> self fact options) (fact-options fop6 can-collect)) + (logclear! (-> self fact options) (fact-options instant-collect can-collect)) (if (nonzero? (-> self part)) (kill-and-free-particles (-> self part)) ) @@ -991,15 +925,8 @@ ) ) (else - (while (let ((f30-0 0.0) - (a1-1 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'pickup)) - (set! (-> a1-1 param 1) (the-as uint (-> self fact pickup-type))) - (< f30-0 (the-as float (send-event-function *target* a1-1))) + (while (let ((f30-0 0.0)) + (< f30-0 (the-as float (send-event *target* 'query 'pickup (-> self fact pickup-type)))) ) (suspend) ) @@ -1141,23 +1068,17 @@ obj ) -(defskelgroup *money-sg* money - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 0.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *money-sg* money money-lod0-jg money-idle-ja + ((money-lod0-mg (meters 20)) (money-lod1-mg (meters 40)) (money-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.6) + :texture-level 2 + ) -(defskelgroup *fuel-cell-sg* fuel-cell - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *fuel-cell-sg* fuel-cell fuel-cell-lod0-jg fuel-cell-idle-ja + ((fuel-cell-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) (deftype money (eco-collectable) () @@ -1195,9 +1116,8 @@ (defstate wait (money) :virtual #t - :code - (behavior () - (while #t + :code (behavior () + (loop (quaternion-rotate-y! (-> self root-override quat) (-> self root-override quat) @@ -1233,9 +1153,8 @@ (defstate notice-blue (money) :virtual #t - :code - (behavior ((arg0 handle)) - (while #t + :code (behavior ((arg0 handle)) + (loop (quaternion-rotate-y! (-> self root-override quat) (-> self root-override quat) @@ -1272,8 +1191,7 @@ (defstate pickup (money) :virtual #t - :code - (behavior ((arg0 object) (arg1 handle)) + :code (behavior ((arg0 object) (arg1 handle)) (if (nonzero? (-> self part)) (kill-and-free-particles (-> self part)) ) @@ -1331,14 +1249,14 @@ (defmethod init-from-entity! money ((obj money) (arg0 entity-actor)) (initialize obj) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (initialize-params obj 0 (the-as float 1024.0)) (update-transforms! (-> obj root-override)) (go (method-of-object obj wait)) (none) ) -(defbehavior money-init-by-other money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity)) +(defbehavior money-init-by-other money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) (let ((s3-0 (-> arg2 pickup-type)) (f30-0 (-> arg2 pickup-spawn-amount)) ) @@ -1362,7 +1280,7 @@ (none) ) -(defbehavior money-init-by-other-no-bob money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 float) (arg4 entity)) +(defbehavior money-init-by-other-no-bob money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 float) (arg4 entity-actor)) (set! (-> self entity) arg4) (set! (-> self pickup-type) (the-as pickup-type arg2)) (set! (-> self pickup-amount) arg3) @@ -1515,8 +1433,7 @@ (defstate wait (fuel-cell) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-3 none)) (when (and (or (= arg2 'touch) (= arg2 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) @@ -1525,12 +1442,12 @@ (not *progress-process*) (!= (-> self next-state name) 'pickup) *target* - (zero? (logand (-> *target* state-flags) #x8100)) + (zero? (logand (-> *target* state-flags) (state-flags grabbed dying))) ) ) ) - (push-setting! *setting-control* self 'allow-progress #f 0.0 0) - (copy-settings-from-target! *setting-control*) + (add-setting! 'allow-progress #f 0.0 0) + (apply-settings *setting-control*) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual pickup #f (process->handle arg0)) ) @@ -1576,14 +1493,11 @@ ) ) ) - :code - (behavior () + :code (behavior () 0.5 (let ((f28-0 0.0)) - (let ((v1-3 (-> self skel root-channel 0))) - (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - ) - (while #t + (ja :group! (-> self draw art-group data 2)) + (loop (let ((f30-0 (vector-vector-distance (-> self base) (target-pos 0)))) (set! f28-0 (if (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (zero? (logand (-> self flags) (collectable-flags anim)))) @@ -1599,10 +1513,7 @@ (transform-post) (fuel-cell-animate) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) f30-1) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-1)) ) ) ) @@ -1613,8 +1524,7 @@ (defstate pickup (fuel-cell) :virtual #t - :enter - (behavior ((arg0 object) (arg1 handle)) + :enter (behavior ((arg0 object) (arg1 handle)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self state-object) #t) (let ((t9-1 (-> (the-as (state eco-collectable) (find-parent-method fuel-cell 23)) enter))) @@ -1624,8 +1534,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (the-as float (cond ((string= (-> self victory-anim name) "fuel-cell-victory") 97.0 @@ -1670,23 +1579,21 @@ (set! (-> self state-object) #f) (kill-and-free-particles (-> self part)) (logior! (-> self draw status) (draw-status skip-bones)) - (if (not - (or (logtest? (the-as int (res-lump-value (-> self entity) 'options uint128 :time (the-as float -1000000000.0))) - 4096 - ) - (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9))) - ) - ) + (if (not (or (logtest? (res-lump-value (-> self entity) 'options fact-options :time (the-as float -1000000000.0)) + (fact-options powerup) + ) + (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9))) + ) + ) (send-event *camera* 'teleport-to-other-start-string) ) ) ) (none) ) - :code - (behavior ((arg0 object) (arg1 handle)) + :code (behavior ((arg0 object) (arg1 handle)) (local-vars (sv-96 res-tag)) - (sound-play-by-name (static-sound-name "pu-powercell") (new-sound-id) 1024 0 0 1 #t) + (sound-play "pu-powercell") (clear-collide-with-as (-> self root-override)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) @@ -1703,13 +1610,7 @@ (spool-push *art-control* (-> self victory-anim name) 0 self (the-as float -99.0)) (suspend) ) - (while (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) self) - (set! (-> a1-8 num-params) 1) - (set! (-> a1-8 message) 'clone-anim) - (set! (-> a1-8 param 0) (the-as uint self)) - (not (send-event-function *target* a1-8)) - ) + (while (not (send-event *target* 'clone-anim self)) (spool-push *art-control* (-> self victory-anim name) 0 self (the-as float -99.0)) (format #t "WARNING: fuel-cell stall on not cloning.~%") (suspend) @@ -1720,10 +1621,8 @@ (-> self entity) 'movie-pos (inline-array vector) - :tag-ptr - (& sv-96) - :time - (the-as float -1000000000.0) + :tag-ptr (& sv-96) + :time (the-as float -1000000000.0) ) ) (gp-1 (if (and v1-34 (< (-> self movie-pos-index) (the-as int (-> sv-96 elt-count)))) @@ -1761,25 +1660,10 @@ (set! (-> self draw bounds w) 32768.0) (logior! (-> self skel status) (janim-status inited)) (send-event *target* 'blend-shape #t) - (push-setting! *setting-control* self 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) - (push-setting! *setting-control* self 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) - (push-setting! - *setting-control* - self - 'ambient-volume - 'rel - (-> *setting-control* current ambient-volume-movie) - 0 - ) - (let ((gp-3 (get-process *default-dead-pool* othercam #x4000))) - (when gp-3 - (let ((t9-26 (method-of-type othercam activate))) - (t9-26 (the-as othercam gp-3) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-3 othercam-init-by-other self 10 #f #t) - (-> gp-3 ppointer) - ) - ) + (add-setting! 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) + (add-setting! 'ambient-volume 'rel (-> *setting-control* current ambient-volume-movie) 0) + (process-spawn othercam self 10 #f #t :to self) (auto-save-command 'auto-save 0 0 *default-pool*) (ja-play-spooled-anim (-> self victory-anim) @@ -1787,9 +1671,9 @@ (the-as art-joint-anim #f) (the-as (function process-drawable symbol) false-func) ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) - (clear-pending-settings-from-process *setting-control* self 'ambient-volume) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) (send-event *target* 'blend-shape #f) (send-event *target* 'end-mode) (send-event *camera* 'no-intro) @@ -1797,264 +1681,257 @@ (ja-channel-set! 0) (suspend) (suspend) - (let ((gp-4 (get-process *default-dead-pool* process #x4000))) - (when gp-4 - (let ((t9-39 (method-of-type process activate))) - (t9-39 gp-4 self 'process (the-as pointer #x70004000)) + (process-spawn-function + process + (lambda :behavior collectable + ((arg0 game-task)) + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current movie) + (-> *setting-control* current hint) + (str-is-playing?) + ) + (suspend) ) - (run-next-time-in-process - gp-4 - (lambda :behavior collectable - ((arg0 game-task)) - (while (or (-> *setting-control* current ambient) - (-> *setting-control* current movie) - (-> *setting-control* current hint) - (str-is-playing?) - ) - (suspend) - ) - (cond - ((= arg0 (game-task training-buzzer)) - (level-hint-spawn - (game-text-id training-assistant-found-scout-fly-cell) - "asstvb45" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task training-door)) - (level-hint-spawn - (game-text-id training-eco-opened-door) - "sagevb25" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task beach-ecorocks)) - (level-hint-spawn - (game-text-id beach-collectors-unblocked) - "sagevb01" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task misty-cannon)) - (level-hint-spawn - (game-text-id misty-stopped-lurkers-at-silo) - "sagevb02" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task misty-bike)) - (level-hint-spawn - (game-text-id misty-stopped-balloon-lurkers) - "asstvb03" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task firecanyon-end)) - (level-hint-spawn - (game-text-id fire-canyon-we-made-it) - "sksp0095" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task rolling-robbers)) - (level-hint-spawn - (game-text-id rolling-beat-lurkers) - "asstvb20" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task rolling-plants)) - (level-hint-spawn - (game-text-id sage-golfclap-i-have-low-expectations) - "sagevb03" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task swamp-flutflut)) - (level-hint-spawn - (game-text-id swamp-finished-with-flutflut) - "asstvb21" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task ogre-boss)) - (level-hint-spawn - (game-text-id ogre-boss-killed) - "asstvb23" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task ogre-end)) - (level-hint-spawn - (game-text-id assistant-finished-mountain-pass-race) - "asstvb25" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task beach-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task jungle-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task misty-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task firecanyon-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task rolling-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task sunken-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task swamp-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task ogre-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task cave-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task snow-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task lavatube-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task citadel-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task village1-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task village2-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task village3-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ) - (none) - ) - (the int (-> self fact pickup-amount)) + (cond + ((= arg0 (game-task training-buzzer)) + (level-hint-spawn + (game-text-id training-assistant-found-scout-fly-cell) + "asstvb45" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task training-door)) + (level-hint-spawn + (game-text-id training-eco-opened-door) + "sagevb25" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task beach-ecorocks)) + (level-hint-spawn + (game-text-id beach-collectors-unblocked) + "sagevb01" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task misty-cannon)) + (level-hint-spawn + (game-text-id misty-stopped-lurkers-at-silo) + "sagevb02" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task misty-bike)) + (level-hint-spawn + (game-text-id misty-stopped-balloon-lurkers) + "asstvb03" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task firecanyon-end)) + (level-hint-spawn + (game-text-id fire-canyon-we-made-it) + "sksp0095" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task rolling-robbers)) + (level-hint-spawn + (game-text-id rolling-beat-lurkers) + "asstvb20" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task rolling-plants)) + (level-hint-spawn + (game-text-id sage-golfclap-i-have-low-expectations) + "sagevb03" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task swamp-flutflut)) + (level-hint-spawn + (game-text-id swamp-finished-with-flutflut) + "asstvb21" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task ogre-boss)) + (level-hint-spawn + (game-text-id ogre-boss-killed) + "asstvb23" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task ogre-end)) + (level-hint-spawn + (game-text-id assistant-finished-mountain-pass-race) + "asstvb25" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task beach-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task jungle-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task misty-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task firecanyon-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task rolling-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task sunken-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task swamp-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task ogre-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task cave-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task snow-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task lavatube-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task citadel-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task village1-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task village2-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task village3-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) ) - (-> gp-4 ppointer) + (none) ) + (the int (-> self fact pickup-amount)) + :to self ) (case (the int (-> self fact pickup-amount)) (((game-task citadel-sage-blue)) @@ -2078,8 +1955,7 @@ (convert-to-hud-object self (the-as hud (ppointer->process (-> *hud-parts* fuel-cell)))) (none) ) - :post - (behavior () + :post (behavior () (transform-post) (if (-> self state-object) (spawn (-> self part) (the-as vector (-> self root-override root-prim prim-core))) @@ -2115,19 +1991,8 @@ (set! (-> obj base quad) (-> obj root-override trans quad)) (set! (-> obj old-base quad) (-> obj root-override trans quad)) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 63) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "powercell-idle") - :volume #x400 - :fo-max 40 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "powercell-idle" :fo-max 40) (-> obj root-override trans)) ) (set! (-> obj victory-anim) (fuel-cell-pick-anim obj)) obj @@ -2135,7 +2000,7 @@ (defmethod init-from-entity! fuel-cell ((obj fuel-cell) (arg0 entity-actor)) (initialize obj) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (initialize-params obj 0 (the-as float 1024.0)) (logclear! (-> obj fact options) (fact-options can-collect)) (update-transforms! (-> obj root-override)) @@ -2143,7 +2008,7 @@ (none) ) -(defbehavior fuel-cell-init-by-other fuel-cell ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity)) +(defbehavior fuel-cell-init-by-other fuel-cell ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) (let ((s3-0 (-> arg2 pickup-type)) (f30-0 (-> arg2 pickup-spawn-amount)) ) @@ -2171,12 +2036,11 @@ (go-virtual jump) ) ((and gp-1 - (zero? - (logand (the-as int (res-lump-value (-> self entity) 'options uint128 :time (the-as float -1000000000.0))) - 128 - ) - ) - (zero? (logand (-> self fact options) (fact-options fop7))) + (zero? (logand (res-lump-value (-> self entity) 'options fact-options :time (the-as float -1000000000.0)) + (fact-options skip-jump-anim) + ) + ) + (zero? (logand (-> self fact options) (fact-options skip-jump-anim))) ) (set! (-> self jump-pos quad) (-> (the-as vector gp-1) quad)) (set! (-> self jump-pos y) (+ 4096.0 (-> self jump-pos y))) @@ -2190,8 +2054,7 @@ ) (defstate fuel-cell-clone-anim (fuel-cell) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('pickup) (when (!= (-> self next-state name) 'pickup) @@ -2211,33 +2074,28 @@ (set! (-> self root-override trans quad) (-> self draw origin quad)) (set! (-> self base quad) (-> self root-override trans quad)) (ja-channel-set! 1) - (let ((v1-20 (-> self skel root-channel 0))) - (set! (-> v1-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - ) + (ja :group! (-> self draw art-group data 2)) (logclear! (-> self draw status) (draw-status hidden)) (vector-reset! (-> self draw origin)) (go-virtual wait) ) ) ) - :exit - (behavior () + :exit (behavior () (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) (logclear! (-> self skel status) (janim-status spool)) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (logclear! (-> self mask) (process-mask actor-pause)) (clone-anim arg0 3 #t "") (format #t "ERROR: clone-anim returned in fuel-cell~%") (deactivate self) (none) ) - :post - (behavior () + :post (behavior () (update-transforms! (-> self root-override)) (animate self) (none) @@ -2251,19 +2109,16 @@ (initialize-params self 0 (the-as float 1024.0)) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self actor-pause) #f) - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") (go fuel-cell-clone-anim arg0) (none) ) -(defskelgroup *buzzer-sg* buzzer - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *buzzer-sg* buzzer buzzer-lod0-jg buzzer-idle-ja + ((buzzer-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) (deftype buzzer (eco-collectable) ((victory-anim spool-anim :offset-assert 404) @@ -2302,14 +2157,13 @@ (defstate wait (buzzer) :virtual #t - :code - (behavior () + :code (behavior () (case (get-reminder (get-task-control (the-as game-task (logand (the int (-> self fact pickup-amount)) #xffff))) 0) ((127) (go-virtual pickup #t (the-as handle #f)) ) ) - (while #t + (loop (transform-post) (animate self) (suspend) @@ -2320,8 +2174,7 @@ (defstate pickup (buzzer) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'notify) (process-entity-status! self (entity-perm-status dead) #t) @@ -2329,17 +2182,15 @@ ) ) ) - :enter - (behavior ((arg0 object) (arg1 handle)) + :enter (behavior ((arg0 object) (arg1 handle)) (set! (-> self pickup-handle) arg1) (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :code - (behavior ((arg0 object) (arg1 handle)) + :code (behavior ((arg0 object) (arg1 handle)) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status complete) #t) - (sound-play-by-name (static-sound-name "buzzer-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "buzzer-pickup") (case (-> (level-get-target-inside *level*) name) (('training) (level-hint-spawn @@ -2375,16 +2226,7 @@ (stop! (-> self sound)) ) (when (not arg0) - (let* ((s5-1 (get-process *default-dead-pool* manipy #x4000)) - (v1-18 (when s5-1 - (let ((t9-11 (method-of-type manipy activate))) - (t9-11 (the-as manipy s5-1) *entity-pool* 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> self root-override trans) #f *buzzer-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) + (let ((v1-18 (manipy-spawn (-> self root-override trans) #f *buzzer-sg* #f :to *entity-pool*))) (send-event (ppointer->process v1-18) 'become-hud-object (ppointer->process (-> *hud-parts* buzzers))) ) ) @@ -2401,7 +2243,7 @@ (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9 ca-12 ca-13 ca-14)) (not arg0) ) - (logior! (-> self fact options) (fact-options fop6 fop7)) + (logior! (-> self fact options) (fact-options instant-collect skip-jump-anim)) ) (let ((v1-47 (birth-pickup-at-point @@ -2471,19 +2313,8 @@ (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type buzzer) (the-as float 0.0))) (initialize-skeleton obj *buzzer-sg* '()) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 65) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "buzzer") - :volume #x400 - :fo-max 40 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "buzzer" :fo-max 40) (-> obj root-override trans)) ) (set! (-> obj victory-anim) (fuel-cell-pick-anim obj)) obj @@ -2491,7 +2322,7 @@ (defmethod init-from-entity! buzzer ((obj buzzer) (arg0 entity-actor)) (initialize obj) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (initialize-params obj 0 (the-as float 1024.0)) (set! (-> obj collect-timeout) (seconds 2)) (update-transforms! (-> obj root-override)) @@ -2503,7 +2334,7 @@ (none) ) -(defbehavior buzzer-init-by-other buzzer ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity)) +(defbehavior buzzer-init-by-other buzzer ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) (let ((s3-0 (-> arg2 pickup-type)) (f30-0 (-> arg2 pickup-spawn-amount)) ) @@ -2828,9 +2659,9 @@ s2-1 (the-as float 81920.0) (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) s1-1 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -2841,7 +2672,7 @@ (if (= (the-as int s3-0) 6) (set! (-> s2-1 y) (+ 6144.0 (-> s2-1 y))) ) - (birth-pickup-at-point s2-1 (the-as pickup-type s3-0) f30-0 arg0 (the-as process-drawable arg1) obj) + (birth-pickup-at-point s2-1 (the-as pickup-type s3-0) f30-0 arg0 arg1 obj) ) ) ) @@ -2862,22 +2693,18 @@ ) -(defskelgroup *ecovalve-sg* ecovalve - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *ecovalve-sg* ecovalve ecovalve-geo-jg ecovalve-idle-ja + ((ecovalve-geo-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) (defstate ecovalve-idle (ecovalve) - :code - (behavior () + :code (behavior () (transform-post) (suspend) (transform-post) - (while #t + (loop (if (not ((-> self block-func) (the-as vent (ppointer->process (-> self parent))))) (set-vector! (-> self offset-target) 0.0 0.0 0.0 1.0) ) @@ -3036,15 +2863,7 @@ ) ) ) - (let ((s5-1 (get-process *pickup-dead-pool* ecovalve #x4000))) - (when s5-1 - (let ((t9-17 (method-of-type ecovalve activate))) - (t9-17 (the-as ecovalve s5-1) obj 'ecovalve (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 ecovalve-init-by-other (-> obj block-func)) - (-> s5-1 ppointer) - ) - ) + (process-spawn ecovalve (-> obj block-func) :from *pickup-dead-pool* :to obj) ) (if ((-> obj block-func) obj) (go vent-blocked) @@ -3070,8 +2889,7 @@ ) (defstate vent-wait-for-touch (vent) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (or (= arg2 'touch) (= arg2 'attack)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) @@ -3088,9 +2906,8 @@ ) (vent-standard-event-handler arg0 arg1 arg2 arg3) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((a0-0 (-> self part)) (a1-0 (-> self root-override trans)) (gp-0 (-> self sound)) @@ -3109,17 +2926,15 @@ ) (defstate vent-blocked (vent) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('show) (go vent-wait-for-touch) ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (not ((-> self block-func) self)) (go vent-wait-for-touch) ) @@ -3130,10 +2945,8 @@ ) (defstate vent-pickup (vent) - :event - vent-standard-event-handler - :code - (behavior ((arg0 handle)) + :event vent-standard-event-handler + :code (behavior ((arg0 handle)) (when (-> self show-particles) (when (nonzero? (-> self collect-effect)) (let* ((s5-0 (handle->process arg0)) @@ -3150,41 +2963,27 @@ ) ) (when s5-1 - (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-1 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker s4-1) gp-0 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-1 - part-tracker-init - (-> self collect-effect) - -1 - part-tracker-track-target - #f - #f - (-> (the-as collide-shape s5-1) root-prim prim-core) - ) - (-> s4-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> self collect-effect) + -1 + part-tracker-track-target + #f + #f + (-> (the-as collide-shape s5-1) root-prim prim-core) + :to gp-0 ) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker gp-1) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> self collect-effect2) - -1 - part-tracker-move-to-target - #f - #f - (-> self root-override root-prim prim-core) - ) - (-> gp-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> self collect-effect2) + -1 + part-tracker-move-to-target + #f + #f + (-> self root-override root-prim prim-core) + :to self ) ) ) diff --git a/goal_src/engine/game/crates.gc b/goal_src/engine/game/crates.gc index eb4b3ba9ff..7401a6f019 100644 --- a/goal_src/engine/game/crates.gc +++ b/goal_src/engine/game/crates.gc @@ -10,59 +10,46 @@ ;; DECOMP BEGINS -(defskelgroup *crate-barrel-sg* crate - 17 - 21 - ((18 (meters 20)) (19 (meters 40)) (20 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(import "goal_src/import/crate-ag.gc") -(defskelgroup *crate-bucket-sg* crate - 22 - 24 - ((23 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *crate-barrel-sg* crate crate-barrel-lod0-jg crate-barrel-idle-ja + ((crate-barrel-lod0-mg (meters 20)) (crate-barrel-lod1-mg (meters 40)) (crate-barrel-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) -(defskelgroup *crate-wood-sg* crate - 0 - 16 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *crate-bucket-sg* crate crate-bucket-lod0-jg crate-bucket-idle-ja + ((crate-bucket-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :texture-level 2 + ) -(defskelgroup *crate-iron-sg* crate - 4 - 16 - ((5 (meters 20)) (6 (meters 40)) (7 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *crate-wood-sg* crate crate-wood-lod0-jg crate-idle-ja + ((crate-wood-lod0-mg (meters 20)) (crate-wood-lod1-mg (meters 40)) (crate-wood-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) -(defskelgroup *crate-steel-sg* crate - 8 - 16 - ((9 (meters 20)) (10 (meters 40)) (11 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *crate-iron-sg* crate crate-iron-lod0-jg crate-idle-ja + ((crate-iron-lod0-mg (meters 20)) (crate-iron-lod1-mg (meters 40)) (crate-iron-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) -(defskelgroup *crate-darkeco-sg* crate - 12 - 16 - ((13 (meters 20)) (14 (meters 40)) (15 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *crate-steel-sg* crate crate-steel-lod0-jg crate-idle-ja + ((crate-steel-lod0-mg (meters 20)) (crate-steel-lod1-mg (meters 40)) (crate-steel-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) + +(defskelgroup *crate-darkeco-sg* crate crate-darkeco-lod0-jg crate-idle-ja + ((crate-darkeco-lod0-mg (meters 20)) + (crate-darkeco-lod1-mg (meters 40)) + (crate-darkeco-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) (deftype crate-bank (basic) ((COLLIDE_YOFF float :offset-assert 4) @@ -75,8 +62,7 @@ ) -(define - *CRATE-bank* +(define *CRATE-bank* (new 'static 'crate-bank :COLLIDE_YOFF 4096.0 :COLLIDE_RADIUS 4915.2 :DARKECO_EXPLODE_RADIUS 16384.0) ) @@ -119,8 +105,7 @@ ) (defpart 281 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) @@ -143,13 +128,11 @@ ) (defpart 282 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) (defpart 283 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 0.75)) (sp-flt spt-scale-x (meters 6)) @@ -173,13 +156,11 @@ ) (defpart 284 - :init-specs - ((sp-flt spt-fade-a -2.1333334)) + :init-specs ((sp-flt spt-fade-a -2.1333334)) ) (defpart 285 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 8)) @@ -195,8 +176,7 @@ ) (defpart 286 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) @@ -224,16 +204,14 @@ ) (defpart 287 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0033333334)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0033333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -3.4) ) ) (defpart 288 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) (sp-flt spt-num 4.5) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) @@ -265,8 +243,7 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 281) (sp-item 283) (sp-item 285) (sp-item 286) (sp-item 288)) + :parts ((sp-item 281) (sp-item 283) (sp-item 285) (sp-item 286) (sp-item 288)) ) (defpartgroup group-crate-steel-explode @@ -274,8 +251,7 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 281) (sp-item 283) (sp-item 285) (sp-item 288) (sp-item 288) (sp-item 288)) + :parts ((sp-item 281) (sp-item 283) (sp-item 285) (sp-item 288) (sp-item 288) (sp-item 288)) ) (defpartgroup group-dark-eco-box-explosion @@ -283,8 +259,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) + :parts ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) (sp-item 296 :flags (start-dead launch-asap) :binding 297) (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) (sp-item 296 :flags (start-dead launch-asap) :binding 297) @@ -326,8 +301,7 @@ ) (defpart 2096 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -351,13 +325,11 @@ ) (defpart 2099 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) ) (defpart 2098 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-scale-x (meters 0.2)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) @@ -374,8 +346,7 @@ ) (defpart 2095 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 16)) (sp-copy-from-other spt-scale-y -4) @@ -390,8 +361,7 @@ ) (defpart 2097 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -415,8 +385,7 @@ ) (defpart 295 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 0.1)) @@ -433,8 +402,7 @@ ) (defpart 296 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.3) (meters 0.3) 1.0) @@ -458,8 +426,7 @@ ) (defpart 297 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -479,8 +446,7 @@ ) (defpart 292 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) @@ -508,8 +474,7 @@ ) (defpart 301 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0033333334)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0033333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -3.4) ) @@ -525,7 +490,7 @@ (('iron) (case (-> arg3 param 1) (('flop 'uppercut 'explode 'darkeco 'eco-yellow 'bonk 'racer 'tube 'flut-bonk 'flut-attack) - (if (and (logtest? (-> self fact options) (fact-options fop11)) + (if (and (logtest? (-> self fact options) (fact-options require-zoomer)) *target* (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-9))) ) @@ -538,9 +503,8 @@ ) (else (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root-override trans y) (-> self base y))) - (if (not - (and (!= *kernel-boot-message* 'play) (= (-> *setting-control* current language) (language-enum japanese))) - ) + (if (not (and (!= *kernel-boot-message* 'play) (= (-> *setting-control* current language) (language-enum japanese))) + ) (level-hint-spawn (game-text-id sage-voicebox-hint-crate-iron) "sagevb36" @@ -565,7 +529,7 @@ ) (set! (-> self incomming-attack-id) s4-0) (if (not (!= (-> self smush amp) 0.0)) - (sound-play-by-name (static-sound-name "icrate-nobreak") (new-sound-id) 1024 0 0 1 #t) + (sound-play "icrate-nobreak") ) (activate! (-> self smush) 0.1 90 150 1.0 1.0) (go-virtual bounce-on) @@ -608,7 +572,7 @@ ) (set! (-> self incomming-attack-id) s4-0) (if (not (!= (-> self smush amp) 0.0)) - (sound-play-by-name (static-sound-name "scrate-nobreak") (new-sound-id) 1024 0 0 1 #t) + (sound-play "scrate-nobreak") ) (activate! (-> self smush) 0.1 90 150 1.0 1.0) (go-virtual bounce-on) @@ -618,17 +582,7 @@ ) ) (('darkeco) - (let ((a1-32 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-32 from) self) - (set! (-> a1-32 num-params) 2) - (set! (-> a1-32 message) 'attack) - (set! (-> a1-32 param 0) (-> arg3 param 0)) - (let ((a0-57 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-57 mode) 'darkeco) - (set! (-> a1-32 param 1) (the-as uint a0-57)) - ) - (send-event-function arg0 a1-32) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'darkeco)))) (when (= (-> arg0 type) target) (level-hint-spawn (game-text-id sidekick-speech-hint-crate-darkeco2) @@ -684,17 +638,7 @@ (('touch) (case (-> self defense) (('darkeco) - (let ((a1-41 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-41 from) self) - (set! (-> a1-41 num-params) 2) - (set! (-> a1-41 message) 'attack) - (set! (-> a1-41 param 0) (-> arg3 param 0)) - (let ((a0-75 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-75 mode) 'darkeco) - (set! (-> a1-41 param 1) (the-as uint a0-75)) - ) - (send-event-function arg0 a1-41) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'darkeco)))) (go-virtual die #f 0) ) ) @@ -725,68 +669,52 @@ (defstate wait (crate) :virtual #t - :event - crate-standard-event-handler - :code - (behavior () + :event crate-standard-event-handler + :code (behavior () (suspend) (update-transforms! (-> self root-override)) (logior! (-> self mask) (process-mask sleep)) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior crate) ja-post) + :post (the-as (function none :behavior crate) ja-post) ) (defstate bounce-on (crate) :virtual #t - :event - crate-standard-event-handler - :code - (behavior () + :event crate-standard-event-handler + :code (behavior () (while (!= (-> self smush amp) 0.0) (suspend) ) (go-virtual wait) (none) ) - :post - (the-as (function none :behavior crate) crate-post) + :post (the-as (function none :behavior crate) crate-post) ) (defstate notice-blue (crate) :virtual #t - :event - crate-standard-event-handler - :trans - (behavior () - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'powerup)) - (set! (-> a1-0 param 1) (the-as uint 3)) - (cond - ((not (send-event-function *target* a1-0)) - (logior! (-> self mask) (process-mask sleep-code)) - (if (not (!= (-> self smush amp) 0.0)) - (go-virtual wait) - ) - ) - (else - (logclear! (-> self mask) (process-mask sleep-code)) - ) + :event crate-standard-event-handler + :trans (behavior () + (cond + ((not (send-event *target* 'query 'powerup (pickup-type eco-blue))) + (logior! (-> self mask) (process-mask sleep-code)) + (if (not (!= (-> self smush amp) 0.0)) + (go-virtual wait) + ) + ) + (else + (logclear! (-> self mask) (process-mask sleep-code)) ) ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (set! (-> self target) arg0) - (while #t + (loop (let* ((gp-0 (handle->process (-> self target))) (v1-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) gp-0 @@ -841,31 +769,19 @@ ) (none) ) - :post - (the-as (function none :behavior crate) crate-post) + :post (the-as (function none :behavior crate) crate-post) ) (defstate die (crate) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touched) (case (-> self defense) (('darkeco) (cond ((= (-> arg0 type) target) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'attack) - (set! (-> a1-4 param 0) (-> arg3 param 0)) - (let ((a2-1 (new 'static 'attack-info :mask #x20))) - (set! (-> a2-1 mode) 'darkeco) - (set! (-> a1-4 param 1) (the-as uint a2-1)) - ) - (send-event-function arg0 a1-4) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'darkeco)))) ) (else (let ((a1-5 (new 'stack-no-clear 'event-message-block))) @@ -888,8 +804,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (case (-> self type) ((crate-buzzer) (if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0)) @@ -899,8 +814,7 @@ ) (none) ) - :code - (behavior ((arg0 symbol) (arg1 int)) + :code (behavior ((arg0 symbol) (arg1 int)) (clear-collide-with-as (-> self root-override)) (if (nonzero? (-> self sound)) (stop! (-> self sound)) @@ -911,7 +825,7 @@ (not arg0) ) ) - (logior! (-> self fact options) (fact-options fop6)) + (logior! (-> self fact options) (fact-options instant-collect)) ) (when (not arg0) (let ((s5-1 (-> *display* base-frame-counter))) @@ -922,16 +836,16 @@ (logior! (-> self draw status) (draw-status hidden)) (case (-> self look) (('iron) - (sound-play-by-name (static-sound-name "icrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "icrate-break") ) (('steel) - (sound-play-by-name (static-sound-name "scrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "scrate-break") ) (('darkeco) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") ) (else - (sound-play-by-name (static-sound-name "wcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "wcrate-break") ) ) (case (-> self defense) @@ -942,82 +856,54 @@ ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 f0-0)) (seconds 0.3)) ) - (let ((s5-7 (get-process *default-dead-pool* touch-tracker #x4000))) - (when s5-7 - (let ((t9-15 (method-of-type touch-tracker activate))) - (t9-15 (the-as touch-tracker s5-7) self 'touch-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-7 - touch-tracker-init - (-> self root-override trans) - (-> *CRATE-bank* DARKECO_EXPLODE_RADIUS) - 30 - ) - (-> s5-7 ppointer) - ) + (process-spawn + touch-tracker + :init touch-tracker-init + (-> self root-override trans) + (-> *CRATE-bank* DARKECO_EXPLODE_RADIUS) + 30 + :to self ) ) ) (case (-> self look) (('darkeco) - (let ((s5-8 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-8 - (let ((t9-18 (method-of-type part-tracker activate))) - (t9-18 (the-as part-tracker s5-8) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-8 - part-tracker-init - (-> *part-group-id-table* 73) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> s5-8 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 73) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) ) (('steel 'iron) - (let ((s5-9 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-9 - (let ((t9-21 (method-of-type part-tracker activate))) - (t9-21 (the-as part-tracker s5-9) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-9 - part-tracker-init - (-> *part-group-id-table* 72) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> s5-9 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 72) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) ) (else - (let ((s5-10 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-10 - (let ((t9-24 (method-of-type part-tracker activate))) - (t9-24 (the-as part-tracker s5-10) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-10 - part-tracker-init - (-> *part-group-id-table* 71) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> s5-10 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 71) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) ) ) @@ -1047,8 +933,7 @@ (defstate special-contents-die (crate) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'notify) (case (-> arg3 param 0) @@ -1076,10 +961,8 @@ ) ) ) - :trans - (-> (method-of-type crate die) trans) - :code - (behavior () + :trans (-> (method-of-type crate die) trans) + :code (behavior () (when (or (= (-> self fact pickup-type) (pickup-type money)) (= (-> self defense) 'iron) (= (-> self defense) 'steel) @@ -1330,13 +1213,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 302)) + :parts ((sp-item 302)) ) (defpart 302 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1376,15 +1257,7 @@ (set! (-> obj sound) (new 'process 'ambient-sound - (new 'static 'sound-spec - :mask #x82 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "buzzer") - :volume #x400 - :pitch-mod -762 - :fo-max 40 - ) + (static-sound-spec "buzzer" :pitch-mod -762 :fo-max 40) (-> obj root-override trans) ) ) @@ -1394,8 +1267,7 @@ (defstate wait (crate-buzzer) :virtual #t - :trans - (behavior () + :trans (behavior () (when (and (and *target* (>= 327680.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -1414,18 +1286,17 @@ ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (suspend) (update-transforms! (-> self root-override)) - (while #t + (loop (set! (-> self state-time) (-> *display* base-frame-counter)) (ja-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) (let ((f30-0 57001.605)) - (sound-play-by-name (static-sound-name "crate-jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "crate-jump") (while (or (!= (-> self smush amp) 0.0) (!= f30-0 0.0)) (+! f30-0 (* -245760.0 (-> *display* seconds-per-frame))) (+! (-> self root-override trans y) (* f30-0 (-> *display* seconds-per-frame))) @@ -1445,14 +1316,12 @@ ) (none) ) - :post - (the-as (function none :behavior crate-buzzer) #f) + :post (the-as (function none :behavior crate-buzzer) #f) ) (defstate bounce-on (crate-buzzer) :virtual #t - :code - (behavior () + :code (behavior () (while (!= (-> self smush amp) 0.0) (spawn (-> self part) (-> self root-override trans)) (suspend) @@ -1492,9 +1361,8 @@ (defstate wait (pickup-spawner) :virtual #t - :code - (behavior () - (while #t + :code (behavior () + (loop (if (or (not (-> self blocker)) (logtest? (-> self blocker extra perm status) (entity-perm-status complete))) (go-virtual die #t 0) ) diff --git a/goal_src/engine/game/effect-control.gc b/goal_src/engine/game/effect-control.gc index 535905d644..687d7c6add 100644 --- a/goal_src/engine/game/effect-control.gc +++ b/goal_src/engine/game/effect-control.gc @@ -84,39 +84,39 @@ (while (> arg2 0) (case (the int (-> arg1 0)) ((3) - (logior! (-> arg0 mask) 1) + (logior! (-> arg0 mask) (sound-mask volume)) (set! (-> arg0 volume) (the int (* 10.24 (-> arg1 1)))) ) ((4) - (logior! (-> arg0 mask) 1) + (logior! (-> arg0 mask) (sound-mask volume)) (+! (-> arg0 volume) (the int (* 10.24 (* (-> arg1 1) (rand-vu))))) ) ((5) - (logior! (-> arg0 mask) 2) + (logior! (-> arg0 mask) (sound-mask pitch)) (set! (-> arg0 pitch-mod) (the int (* 1524.0 (-> arg1 1)))) ) ((6) - (logior! (-> arg0 mask) 2) + (logior! (-> arg0 mask) (sound-mask pitch)) (+! (-> arg0 pitch-mod) (the int (* 1524.0 (* (-> arg1 1) (rand-vu))))) ) ((9) - (logior! (-> arg0 mask) 4) + (logior! (-> arg0 mask) (sound-mask bend)) (set! (-> arg0 bend) (the int (* 327.66998 (-> arg1 1)))) ) ((10) - (logior! (-> arg0 mask) 4) + (logior! (-> arg0 mask) (sound-mask bend)) (+! (-> arg0 bend) (the int (* 327.66998 (* (-> arg1 1) (rand-vu))))) ) ((11) - (logior! (-> arg0 mask) 64) + (logior! (-> arg0 mask) (sound-mask fo-min)) (set! (-> arg0 fo-min) (the int (-> arg1 1))) ) ((12) - (logior! (-> arg0 mask) 128) + (logior! (-> arg0 mask) (sound-mask fo-max)) (set! (-> arg0 fo-max) (the int (-> arg1 1))) ) ((13) - (logior! (-> arg0 mask) 256) + (logior! (-> arg0 mask) (sound-mask fo-curve)) (set! (-> arg0 fo-curve) (the int (-> arg1 1))) ) ((19) @@ -280,167 +280,87 @@ (sv-272 symbol) (sv-288 res-lump) ) - (with-pp - (let ((s3-0 (-> arg0 value)) - (s5-0 (cond - ((< arg2 0) - (let ((v0-0 (get-property-value (-> obj res) 'effect-joint 'exact arg1 (the-as uint128 0) (the-as (pointer res-tag) #f) *res-static-buf*) + (let ((s3-0 (-> arg0 value)) + (s5-0 (cond + ((< arg2 0) + (let ((v0-0 (get-property-value + (-> obj res) + 'effect-joint + 'exact + arg1 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* ) - ) - (if (zero? v0-0) - 0 - (the-as int (+ v0-0 1)) - ) - ) - ) - (else - (empty) - arg2 - ) - ) - ) - ) - (when (logtest? (-> obj flags) 1) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) pp) - (set! (-> a1-2 num-params) 3) - (set! (-> a1-2 message) 'effect) - (set! (-> a1-2 param 0) (the-as uint arg0)) - (set! (-> a1-2 param 1) (the-as uint arg1)) - (set! (-> a1-2 param 2) (the-as uint s5-0)) - (if (send-event-function (-> obj process) a1-2) - (return (the-as object 0)) - ) - ) - ) - (let ((v1-10 (symbol->string arg0))) - (cond - ((and (= (-> v1-10 data 0) 101) - (= (-> v1-10 data 1) 102) - (= (-> v1-10 data 2) 102) - (= (-> v1-10 data 3) 101) - (= (-> v1-10 data 4) 99) - (= (-> v1-10 data 5) 116) - (= (-> v1-10 data 6) 45) - ) - (let* ((s3-1 (-> obj process root)) - (v1-14 (if (and (nonzero? s3-1) (type-type? (-> s3-1 type) collide-shape-moving)) - s3-1 ) - ) - (t1-1 (if v1-14 - (the-as int (-> (the-as collide-shape-moving v1-14) ground-pat)) - *footstep-surface* - ) - ) - ) - (dummy-11 obj arg0 arg1 s5-0 (-> obj res) (the-as pat-surface t1-1)) - ) - ) - ((let ((v1-18 (symbol->string arg0))) - (and (= (-> v1-18 data 0) 103) - (= (-> v1-18 data 1) 114) - (= (-> v1-18 data 2) 111) - (= (-> v1-18 data 3) 117) - (= (-> v1-18 data 4) 112) - (= (-> v1-18 data 5) 45) - ) - ) - (set! s3-0 (cond - ((zero? s3-0) - (let ((v0-5 (lookup-part-group-pointer-by-name (symbol->string arg0)))) - (when v0-5 - (set! (-> arg0 value) v0-5) - (set! s3-0 (-> v0-5 0)) - ) - ) - (the-as (pointer sparticle-launch-group) s3-0) - ) - (else - (-> (the-as (pointer sparticle-launch-group) s3-0) 0) - ) - ) - ) - (when (and (nonzero? s3-0) (= (-> (the-as sparticle-launch-group s3-0) type) sparticle-launch-group)) - (if *debug-effect-control* - (format - #t - "(~5D) effect group ~A ~A frame ~F joint ~D~%" - (-> *display* base-frame-counter) - (-> obj process name) - arg0 - arg1 - s5-0 - ) - ) - (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-1 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker s4-1) (-> obj process) 'part-tracker (the-as pointer #x70004000)) - ) - (let ((s2-1 run-function-in-process) - (s1-0 s4-1) - (s0-0 part-tracker-init) ) - (set! sv-160 -1) - (set! sv-176 (the-as symbol #f)) - (set! sv-192 (the-as symbol #f)) - (set! sv-208 (the-as symbol #f)) - (let ((t3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)))) - ((the-as (function object object object object object object object object none) s2-1) - s1-0 - s0-0 - (the-as sparticle-launch-group s3-0) - sv-160 - sv-176 - sv-192 - sv-208 - t3-0 - ) - ) + (if (zero? v0-0) + 0 + (the-as int (+ v0-0 1)) + ) ) - (-> s4-1 ppointer) ) + (else + (empty) + arg2 + ) + ) + ) + ) + (when (logtest? (-> obj flags) 1) + (if (send-event (-> obj process) 'effect arg0 arg1 s5-0) + (return (the-as object 0)) + ) + ) + (let ((v1-10 (symbol->string arg0))) + (cond + ((and (= (-> v1-10 data 0) 101) + (= (-> v1-10 data 1) 102) + (= (-> v1-10 data 2) 102) + (= (-> v1-10 data 3) 101) + (= (-> v1-10 data 4) 99) + (= (-> v1-10 data 5) 116) + (= (-> v1-10 data 6) 45) + ) + (let* ((s3-1 (-> obj process root)) + (v1-14 (if (and (nonzero? s3-1) (type-type? (-> s3-1 type) collide-shape-moving)) + s3-1 + ) + ) + (t1-1 (if v1-14 + (the-as int (-> (the-as collide-shape-moving v1-14) ground-pat)) + *footstep-surface* + ) + ) + ) + (dummy-11 obj arg0 arg1 s5-0 (-> obj res) (the-as pat-surface t1-1)) + ) + ) + ((let ((v1-18 (symbol->string arg0))) + (and (= (-> v1-18 data 0) 103) + (= (-> v1-18 data 1) 114) + (= (-> v1-18 data 2) 111) + (= (-> v1-18 data 3) 117) + (= (-> v1-18 data 4) 112) + (= (-> v1-18 data 5) 45) + ) + ) + (set! s3-0 (cond + ((zero? s3-0) + (let ((v0-5 (lookup-part-group-pointer-by-name (symbol->string arg0)))) + (when v0-5 + (set! (-> arg0 value) v0-5) + (set! s3-0 (-> v0-5 0)) + ) + ) + (the-as (pointer sparticle-launch-group) s3-0) + ) + (else + (-> (the-as (pointer sparticle-launch-group) s3-0) 0) + ) + ) ) - ) - ) - ((= arg0 'camera-shake) - (activate! *camera-smush-control* 819.2 37 600 1.0 0.995) - ) - ((zero? s3-0) - (dummy-12 obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) - ) - ((= (-> (the-as basic s3-0) type) sparticle-launcher) - (if *debug-effect-control* - (format - #t - "(~5D) effect part ~A ~A frame ~F joint ~D~%" - (-> *display* base-frame-counter) - (-> obj process name) - arg0 - arg1 - s5-0 - ) - ) - (format - #t - "-----> (~5D) effect part ~A ~A frame ~F joint ~D~%" - (-> *display* base-frame-counter) - (-> obj process name) - arg0 - arg1 - s5-0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (the-as sparticle-launcher s3-0) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - ) - ((= (-> (the-as basic s3-0) type) sparticle-launch-group) + (when (and (nonzero? s3-0) (= (-> (the-as sparticle-launch-group s3-0) type) sparticle-launch-group)) (if *debug-effect-control* (format #t @@ -452,96 +372,170 @@ s5-0 ) ) - (let ((s4-3 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-3 - (let ((t9-19 (method-of-type part-tracker activate))) - (t9-19 (the-as part-tracker s4-3) (-> obj process) 'part-tracker (the-as pointer #x70004000)) + (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when s4-1 + (let ((t9-7 (method-of-type part-tracker activate))) + (t9-7 (the-as part-tracker s4-1) (-> obj process) 'part-tracker (the-as pointer #x70004000)) ) - (let ((s2-3 run-function-in-process) - (s1-2 s4-3) - (s0-2 part-tracker-init) + (let ((s2-1 run-function-in-process) + (s1-0 s4-1) + (s0-0 part-tracker-init) ) - (set! sv-224 -1) - (set! sv-240 (the-as symbol #f)) - (set! sv-256 (the-as symbol #f)) - (set! sv-272 (the-as symbol #f)) - (let ((t3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)))) - ((the-as (function object object object object object object object object none) s2-3) - s1-2 - s0-2 - s3-0 - sv-224 - sv-240 - sv-256 - sv-272 - t3-1 + (set! sv-160 -1) + (set! sv-176 (the-as symbol #f)) + (set! sv-192 (the-as symbol #f)) + (set! sv-208 (the-as symbol #f)) + (let ((t3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)))) + ((the-as (function object object object object object object object object none) s2-1) + s1-0 + s0-0 + (the-as sparticle-launch-group s3-0) + sv-160 + sv-176 + sv-192 + sv-208 + t3-0 ) ) ) - (-> s4-3 ppointer) + (-> s4-1 ppointer) ) ) ) - ((= (-> (the-as basic s3-0) type) sound-spec) - (sound-play-by-spec - (the-as sound-spec s3-0) - (new-sound-id) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) + ) + ((= arg0 'camera-shake) + (activate! *camera-smush-control* 819.2 37 600 1.0 0.995) + ) + ((zero? s3-0) + (dummy-12 obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) + ) + ((= (-> (the-as basic s3-0) type) sparticle-launcher) + (if *debug-effect-control* + (format + #t + "(~5D) effect part ~A ~A frame ~F joint ~D~%" + (-> *display* base-frame-counter) + (-> obj process name) + arg0 + arg1 + s5-0 + ) + ) + (format + #t + "-----> (~5D) effect part ~A ~A frame ~F joint ~D~%" + (-> *display* base-frame-counter) + (-> obj process name) + arg0 + arg1 + s5-0 + ) + (launch-particles :rate 1.0 + (the-as sparticle-launcher s3-0) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) + ) + ) + ((= (-> (the-as basic s3-0) type) sparticle-launch-group) + (if *debug-effect-control* + (format + #t + "(~5D) effect group ~A ~A frame ~F joint ~D~%" + (-> *display* base-frame-counter) + (-> obj process name) + arg0 + arg1 + s5-0 + ) + ) + (let ((s4-3 (get-process *default-dead-pool* part-tracker #x4000))) + (when s4-3 + (let ((t9-19 (method-of-type part-tracker activate))) + (t9-19 (the-as part-tracker s4-3) (-> obj process) 'part-tracker (the-as pointer #x70004000)) + ) + (let ((s2-3 run-function-in-process) + (s1-2 s4-3) + (s0-2 part-tracker-init) + ) + (set! sv-224 -1) + (set! sv-240 (the-as symbol #f)) + (set! sv-256 (the-as symbol #f)) + (set! sv-272 (the-as symbol #f)) + (let ((t3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)))) + ((the-as (function object object object object object object object object none) s2-3) + s1-2 + s0-2 + s3-0 + sv-224 + sv-240 + sv-256 + sv-272 + t3-1 + ) + ) + ) + (-> s4-3 ppointer) ) ) - ((= (-> (the-as basic s3-0) type) death-info) - (let ((v1-67 (-> obj process draw))) - (let ((a1-42 (-> (the-as death-info s3-0) vertex-skip)) - (a0-55 - (max - 2 - (the-as int (/ (-> (the-as death-info s3-0) timer) (the-as uint (the int (-> *display* time-factor))))) - ) + ) + ((= (-> (the-as basic s3-0) type) sound-spec) + (sound-play-by-spec + (the-as sound-spec s3-0) + (new-sound-id) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) + ) + ) + ((= (-> (the-as basic s3-0) type) death-info) + (let ((v1-67 (-> obj process draw))) + (let ((a1-42 (-> (the-as death-info s3-0) vertex-skip)) + (a0-55 + (max + 2 + (the-as int (/ (-> (the-as death-info s3-0) timer) (the-as uint (the int (-> *display* time-factor))))) ) ) - (when (= (-> *setting-control* current video-mode) 'pal) - (if (< (the-as uint 1) a1-42) - (set! a1-42 (/ (the-as uint (* (the-as uint 50) a1-42)) (the-as uint 60))) - ) ) - (let ((a2-29 (-> *display* frames (-> *display* last-screen) frame run-time))) - (cond - ((< 9000 (the-as int a2-29)) - (set! a1-42 (* a1-42 4)) - ) - ((< 7000 (the-as int a2-29)) - (set! a1-42 (* a1-42 2)) - ) + (when (= (-> *setting-control* current video-mode) 'pal) + (if (< (the-as uint 1) a1-42) + (set! a1-42 (/ (the-as uint (* (the-as uint 50) a1-42)) (the-as uint 60))) ) - ) - (set! (-> v1-67 death-vertex-skip) a1-42) - (set! (-> v1-67 death-effect) (-> (the-as death-info s3-0) effect)) - (set! (-> v1-67 death-timer) (+ a0-55 1)) ) - (set! (-> v1-67 death-timer-org) (-> v1-67 death-timer)) - (set! (-> v1-67 death-draw-overlap) (-> (the-as death-info s3-0) overlap)) - ) - (when (-> (the-as death-info s3-0) sound) - (let* ((s2-5 obj) - (s1-3 (method-of-object s2-5 dummy-12)) - (s0-3 (-> (the-as death-info s3-0) sound)) - ) - (set! sv-288 (-> obj res)) - (let ((t1-11 (string->sound-name (symbol->string (-> (the-as death-info s3-0) sound))))) - (s1-3 s2-5 s0-3 arg1 s5-0 sv-288 t1-11) + (let ((a2-29 (-> *display* frames (-> *display* last-screen) frame run-time))) + (cond + ((< 9000 a2-29) + (set! a1-42 (* a1-42 4)) + ) + ((< 7000 a2-29) + (set! a1-42 (* a1-42 2)) + ) ) ) + (set! (-> v1-67 death-vertex-skip) a1-42) + (set! (-> v1-67 death-effect) (-> (the-as death-info s3-0) effect)) + (set! (-> v1-67 death-timer) (+ a0-55 1)) ) - (send-event (-> obj process) 'death-start (the-as death-info s3-0)) + (set! (-> v1-67 death-timer-org) (-> v1-67 death-timer)) + (set! (-> v1-67 death-draw-overlap) (-> (the-as death-info s3-0) overlap)) ) - (else - (dummy-12 obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) - ) + (when (-> (the-as death-info s3-0) sound) + (let* ((s2-5 obj) + (s1-3 (method-of-object s2-5 dummy-12)) + (s0-3 (-> (the-as death-info s3-0) sound)) + ) + (set! sv-288 (-> obj res)) + (let ((t1-11 (string->sound-name (symbol->string (-> (the-as death-info s3-0) sound))))) + (s1-3 s2-5 s0-3 arg1 s5-0 sv-288 t1-11) + ) + ) + ) + (send-event (-> obj process) 'death-start (the-as death-info s3-0)) + ) + (else + (dummy-12 obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) ) ) ) - 0 ) + 0 ) (defmethod dummy-11 effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) @@ -583,7 +577,7 @@ (set! s1-0 (sound-name-with-material 'flut-land arg4 "")) ) (('effect-land-poof) - (when (< (the-as int a0-4) 9000) + (when (< a0-4 9000) (let* ((a0-13 obj) (t9-8 (method-of-object a0-13 dummy-10)) (v1-15 (-> arg4 material)) @@ -650,7 +644,7 @@ ) ) (('effect-run-poof) - (when (< (the-as int a0-4) 9000) + (when (< a0-4 9000) (let* ((a0-14 obj) (t9-9 (method-of-object a0-14 dummy-10)) (v1-20 (-> arg4 material)) @@ -782,7 +776,7 @@ ) ) (('effect-just-poof) - (when (< (the-as int a0-4) 9000) + (when (< a0-4 9000) (let* ((a0-16 obj) (t9-11 (method-of-object a0-16 dummy-10)) (v1-29 (-> arg4 material)) @@ -1064,14 +1058,7 @@ ) (defmethod dummy-12 effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) - (local-vars - (r0-0 uint128) - (v1-10 uint128) - (sv-112 int) - (sv-128 sound-name) - (sv-144 basic) - (sv-160 (function vector vector float)) - ) + (local-vars (sv-112 res-tag) (sv-128 sound-name) (sv-144 basic) (sv-160 (function vector vector float))) (set! sv-144 arg3) (let ((s0-0 arg4) (gp-0 (new 'stack 'sound-spec)) @@ -1082,32 +1069,23 @@ ) ) (set! (-> gp-0 sound-name) s0-0) - (logior! (-> gp-0 mask) 1) + (logior! (-> gp-0 mask) (sound-mask volume)) (set! (-> gp-0 volume) 1024) - (logior! (-> gp-0 mask) 4) + (logior! (-> gp-0 mask) (sound-mask bend)) (set! (-> gp-0 bend) (the int (* 327.66998 (rand-vu-float-range -100.0 100.0)))) - (set! sv-112 0) + (set! sv-112 (new 'static 'res-tag)) (let* ((t9-3 (method-of-type res-lump get-property-data)) (a1-6 'effect-param) (a2-1 'exact) (a3-1 arg1) (t0-1 #f) - (t1-1 (the-as (pointer int) (& sv-112))) + (t1-1 (the-as (pointer res-tag) (& sv-112))) (t2-0 *res-static-buf*) - (a1-7 - (t9-3 (the-as res-lump sv-144) a1-6 a2-1 a3-1 (the-as pointer t0-1) (the-as (pointer res-tag) t1-1) t2-0) - ) + (a1-7 (t9-3 (the-as res-lump sv-144) a1-6 a2-1 a3-1 (the-as pointer t0-1) t1-1 t2-0)) ) - (when a1-7 - (let ((t9-4 effect-param->sound-spec) - (a0-5 gp-0) - ) - (let ((v1-9 (the-as uint128 sv-112))) - (.pcpyud v1-10 v1-9 r0-0) - ) - (t9-4 a0-5 (the-as (pointer float) a1-7) (shr (* (the-as int v1-10) 2) 49)) + (if a1-7 + (effect-param->sound-spec gp-0 (the-as (pointer float) a1-7) (the-as int (-> sv-112 elt-count))) ) - ) ) (if (and (nonzero? (-> gp-0 fo-max)) (let ((f30-1 (* 4096.0 (the float (-> gp-0 fo-max))))) (set! sv-160 vector-vector-distance) @@ -1160,11 +1138,11 @@ ) 0 0 - 1 + (sound-group sfx) #t ) ) - ((logtest? (-> self water flags) 512) + ((logtest? (-> self water flags) (water-flags wt09)) (dummy-10 (-> self skel effect) 'effect-land-water -1.0 -1) ) (else diff --git a/goal_src/engine/game/fact-h.gc b/goal_src/engine/game/fact-h.gc index 3c51e0a467..3656a68483 100644 --- a/goal_src/engine/game/fact-h.gc +++ b/goal_src/engine/game/fact-h.gc @@ -73,21 +73,20 @@ (vent-valve 2) (wrap-phase 3) ;; phase should wrap from 1 to 0 instead of mirroring. (fop4 4) ;; unused? - (fop5 5) ;; wait-for-cue after death? - (fop6 6) - (fop7 7) + (fop5 5) ;; wait-for-cue after death? nothing sets this. + (instant-collect 6) ;; set on balloon lurker, puffer + (skip-jump-anim 7) ;; skips fuel cell "jump" animation (can-collect 8) (fade 9) (large 10) - (fop11 11) + (require-zoomer 11) ;; iron, but need to be riding zoomer to break it. only used in demo? (powerup 12) ;; strengths (touch 13) (normal-attack 14) (strong-attack 15) (indestructible 16) - - (fop17 17) ;; unused + (fop17 17) ;; engine doesn't check it, set on babak near jungleb exit and in robot room. (eco-blocked 18) (respawn 19) ) diff --git a/goal_src/engine/game/game-h.gc b/goal_src/engine/game/game-h.gc index 0a6c12fc6b..24c495f755 100644 --- a/goal_src/engine/game/game-h.gc +++ b/goal_src/engine/game/game-h.gc @@ -17,6 +17,55 @@ (declare-type water-control basic) (declare-type collide-shape basic) +;; These flags are a bit of a hack and are mostly only meaningful on *target* +;; except for "fade-out-particles" which is meaninful for eco only. +(defenum state-flags + :bitfield #t + :type uint32 + (fade-out-particles) ;; set so particle callbacks can fade out before death + (dangerous) ;; set on jak if he is "dangerous" (currently attacking) + (sf02) ;; never sent, blocks tripping + (being-attacked) ;; set when attacked + (invulnerable) ;; set from the debug menu + (timed-invulnerable) ;; after being attacked + (invuln-powerup) ;; unused invulnerable mode from powerup + (do-not-notice) ;; enemies etc shouldn't notice jak + (grabbed) ;; something else has "grabbed" control of jak + (first-person-mode) ;; triangle, billy game + (use-alt-cam-pos) ;; target-cam-pos should use an alternate position (jumping in warp gate, on to flutflut...) + (prevent-jump) ;; target cannot do any jumps + (prevent-attack) ;; target cannot do attacks + (prevent-duck) ;; can't duck or roll + (remove-prevents) ;; when set, removes the previous 3 prevents on the next frame. + (dying) ;; set during death anim + (sf16) ;; unused + (has-saved-position) ;; is there a saved position? + (looking-at-enemy) ;; neck mod active to look at enemy + (falling-into-pool-of-bad) ;; falling into lava, dark eco, or melt + (flop-hit-ground) ;; set when ground pound hit ground + ) + +(defmacro static-attack-info (&key (mask ()) &rest args) + (when (!= (length args) 1) + (error "static-attack-info can only have 1 arg")) + (let ((mask-actual mask) + (arg (car args)) + ) + (when (not (null? (assoc 'shove-up arg))) (cons! mask-actual 'shove-up)) + (when (not (null? (assoc 'shove-back arg))) (cons! mask-actual 'shove-back)) + (when (not (null? (assoc 'mode arg))) (cons! mask-actual 'mode)) + (when (not (null? (assoc 'vector arg))) (cons! mask-actual 'vector)) + (when (not (null? (assoc 'angle arg))) (cons! mask-actual 'angle)) + (when (not (null? (assoc 'control arg))) (cons! mask-actual 'control)) + `(let ((atk (new 'static 'attack-info :mask (attack-mask ,@mask-actual)))) + ,@(apply (lambda (x) (if (eq? (car x) 'vector) + `(vector-copy! (-> atk ,(car x)) ,(cadr x)) + `(set! (-> atk ,(car x)) ,(cadr x)) + )) arg) + atk) + ) + ) + ;; DECOMP BEGINS @@ -59,12 +108,12 @@ ;; state related to entering and being in water (water water-control :offset-assert 156) - + ;; any sound that we're playing (sound ambient-sound :offset-assert 160) ;; seems to only be used in target? - (state-flags uint32 :offset-assert 164) + (state-flags state-flags :offset-assert 164) ;; the time when we last did something. Used for different things in different objects (state-time time-frame :offset-assert 168) @@ -76,7 +125,7 @@ (:methods (initialize-skeleton (_type_ skeleton-group pair) none 14) (initialize-skeleton-by-name (_type_ string object) _type_ 15) - (apply-alignment (_type_ int transformq vector) collide-shape 16) + (apply-alignment (_type_ align-opts transformq vector) collide-shape 16) (do-joint-math! (_type_) none 17) (cleanup-for-death (_type_) none 18) (evaluate-joint-control (_type_) none 19) @@ -142,6 +191,26 @@ ) ) + +(defenum attack-mask + :bitfield #t + :type uint32 + (trans) + (vector) + (intersection) + (attacker) + (invinc-time) + (mode) + (shove-back) + (shove-up) + (speed) + (dist) + (control) + (angle) + (rotate-to) + (atki13) + ) + ;; The attack-info is generated by attackers and sent to target. (deftype attack-info (structure) ((trans vector :inline :offset-assert 0) @@ -149,7 +218,7 @@ (intersection vector :inline :offset-assert 32) (attacker handle :offset-assert 48) (invinc-time time-frame :offset-assert 56) - (mask uint32 :offset-assert 64) ;; todo enum here. + (mask attack-mask :offset-assert 64) (mode symbol :offset-assert 68) (shove-back meters :offset-assert 72) (shove-up meters :offset-assert 76) diff --git a/goal_src/engine/game/game-info-h.gc b/goal_src/engine/game/game-info-h.gc index 7d4b67abd7..964b15b42e 100644 --- a/goal_src/engine/game/game-info-h.gc +++ b/goal_src/engine/game/game-info-h.gc @@ -1,9 +1,9 @@ -; ;;-*-Lisp-*- -; (in-package goal) +;;-*-Lisp-*- +(in-package goal) -; ;; name: game-info-h.gc -; ;; name in dgo: game-info-h -; ;; dgos: GAME, ENGINE +;; name: game-info-h.gc +;; name in dgo: game-info-h +;; dgos: GAME, ENGINE ;; This file contains types for: ;; - the full game state (game-info) @@ -38,12 +38,19 @@ :flag-assert #x900000004 ) -;; the possible state for a level. +;;;;;;;;;;;;;;; +;; Load State +;;;;;;;;;;;;;;; + +;; The load state system lets gameplay code control the loading state of the game. +;; It is the interface to the code inside of level.gc that actually manages loads. + +;; the possible load state for a level. (deftype level-buffer-state (structure) - ((name symbol :offset-assert 0) ;; level name - (display? symbol :offset-assert 4) ;; should it be drawn? - (force-vis? symbol :offset-assert 8) ;; ? should it have its vis loaded? - (force-inside? symbol :offset-assert 12) ;; ? + ((name symbol :offset-assert 0) ;; level name + (display? symbol :offset-assert 4) ;; should it be drawn? + (force-vis? symbol :offset-assert 8) ;; force everything to be visible. + (force-inside? symbol :offset-assert 12) ;; force player to be considered inside. ) :pack-me :method-count-assert 9 @@ -51,11 +58,13 @@ :flag-assert #x900000010 ) +;; This includes more state than just "loading" - it also has a list of commands to execute and +;; other random state. (deftype load-state (basic) - ((want level-buffer-state 2 :inline :offset-assert 4) - (vis-nick symbol :offset-assert 36) - (command-list pair :offset-assert 40) - (object-name symbol 256 :offset-assert 44) + ((want level-buffer-state 2 :inline :offset-assert 4) ;; the two levels we want loaded + (vis-nick symbol :offset-assert 36) ;; the vis file we have loaded + (command-list pair :offset-assert 40) ;; list of additional commands + (object-name symbol 256 :offset-assert 44) ;; state of various in-game objects (object-status basic 256 :offset-assert 1068) ) :method-count-assert 21 @@ -86,11 +95,33 @@ (define-extern *load-state* load-state) -;; a game checkpoint + +;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Game Info +;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defenum continue-flags + :type uint32 + :bitfield #t + (contf00) + (contf01) + (warp) + (demo) + (intro) + (sage-intro) + (sage-demo-convo) + (title) + (contf08) + (contf09) + (game-start) + (sage-ecorocks) + ) + +;; static data for a continue point (deftype continue-point (basic) ((name string :offset-assert 4) (level symbol :offset-assert 8) - (flags uint32 :offset-assert 12) + (flags continue-flags :offset-assert 12) (trans vector :inline :offset-assert 16) (quat quaternion :inline :offset-assert 32) (camera-trans vector :inline :offset-assert 48) @@ -133,22 +164,22 @@ (text-ids-seen bit-array :offset-assert 112) (level-opened uint8 32 :offset-assert 116) (hint-control (array level-hint-control) :offset-assert 148) - (task-hint-control (array task-hint-control-group) :offset-assert 152) + (task-hint-control (array task-hint-control-group) :offset-assert 152) (total-deaths int32 :offset-assert 156) (continue-deaths int32 :offset-assert 160) (fuel-cell-deaths int32 :offset-assert 164) - (game-start-time time-frame :offset-assert 168) - (continue-time time-frame :offset-assert 176) - (death-time time-frame :offset-assert 184) - (hit-time time-frame :offset-assert 192) - (fuel-cell-pickup-time time-frame :offset-assert 200) - (fuel-cell-time (array time-frame) :offset-assert 208) - (enter-level-time (array time-frame) :offset-assert 212) - (in-level-time (array time-frame) :offset-assert 216) - (blackout-time time-frame :offset-assert 224) - (letterbox-time time-frame :offset-assert 232) ;; time to turn off letterboxing, base-frame - (hint-play-time time-frame :offset-assert 240) - (display-text-time time-frame :offset-assert 248) + (game-start-time time-frame :offset-assert 168) + (continue-time time-frame :offset-assert 176) + (death-time time-frame :offset-assert 184) + (hit-time time-frame :offset-assert 192) + (fuel-cell-pickup-time time-frame :offset-assert 200) + (fuel-cell-time (array time-frame) :offset-assert 208) + (enter-level-time (array time-frame) :offset-assert 212) + (in-level-time (array time-frame) :offset-assert 216) + (blackout-time time-frame :offset-assert 224) + (letterbox-time time-frame :offset-assert 232) ;; time to turn off letterboxing, base-frame + (hint-play-time time-frame :offset-assert 240) + (display-text-time time-frame :offset-assert 248) (display-text-handle handle :offset-assert 256) (death-movie-tick int32 :offset-assert 264) (want-auto-save symbol :offset-assert 268) diff --git a/goal_src/engine/game/game-info.gc b/goal_src/engine/game/game-info.gc index 51b8f42a0a..38676a284b 100644 --- a/goal_src/engine/game/game-info.gc +++ b/goal_src/engine/game/game-info.gc @@ -20,17 +20,17 @@ (defmethod debug-draw! border-plane ((obj border-plane)) "Debug draw a border plane with a vector and text." (let* ((v1-0 (-> obj action)) - ;; pick color based on action + ;; pick color based on action (s5-0 (if (= v1-0 'load) (new 'static 'rgba :g #xff :a #x80) (new 'static 'rgba :r #xff :a #x80) ) - ) + ) ) ;; add text and vector - (add-debug-text-sphere #t (bucket-id debug-draw1) (-> obj trans) 819.2 (symbol->string (-> obj name)) s5-0) - (add-debug-vector #t (bucket-id debug-draw1) (-> obj trans) (-> obj normal) 8192.0 s5-0) + (add-debug-text-sphere #t (bucket-id debug-no-zbuf) (-> obj trans) 819.2 (symbol->string (-> obj name)) s5-0) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> obj trans) (-> obj normal) (meters 2.0) s5-0) ) 0 (none) @@ -39,10 +39,7 @@ (defmethod point-past-plane? border-plane ((obj border-plane) (arg0 vector)) "Which side of the plane is the given point on? #t = on the plane, or on the side the normal points toward." - (>= (vector-dot - (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) - (-> obj normal)) - 0.0) + (>= (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) (-> obj normal)) 0.0) ) (defmethod task-complete? game-info ((obj game-info) (arg0 game-task)) @@ -51,21 +48,20 @@ ) ;; set up a static continue point that can be used as a temporary continue point. -(define *default-continue* - (new 'static 'continue-point - :name "default" - :level #f - :trans (new 'static 'vector :w 1.0) - :quat (new 'static 'quaternion :w 1.0) - :camera-trans (new 'static 'vector :w 1.0) - :load-commands '() - :vis-nick #f - :lev0 #f - :disp0 #f - :lev1 #f - :disp1 #f - ) - ) +(define *default-continue* (new 'static 'continue-point + :name "default" + :level #f + :trans (new 'static 'vector :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + :camera-trans (new 'static 'vector :w 1.0) + :load-commands '() + :vis-nick #f + :lev0 #f + :disp0 #f + :lev1 #f + :disp1 #f + ) + ) (defmethod get-or-create-continue! game-info ((obj game-info)) "Attempt to get a continue point, if it doesn't exist set the @@ -100,9 +96,9 @@ ;; loop over continues in the level (while (not (null? s4-0)) (let ((s3-0 (car s4-0))) - (if (string= arg0 (the-as string (-> (the-as continue-point s3-0) name))) + (if (string= arg0 (-> (the-as continue-point s3-0) name)) ;; match! - (return (the continue-point s3-0)) + (return (the-as continue-point s3-0)) ) ) (set! s4-0 (cdr s4-0)) @@ -115,7 +111,7 @@ ) (defmethod set-continue! game-info ((obj game-info) (arg0 basic)) - "Set the current continue to to arg0. + "Set the current continue point to to arg0. arg0 can be: '() or #f, in which case it does nothing. a string, in which case it looks up by name @@ -130,34 +126,28 @@ (if (null? arg0) (set! arg0 #f) ) - (let ((v1-3 (-> arg0 type))) - (cond - ((= v1-3 string) - (let ((v1-5 (get-continue-by-name obj (the-as string arg0)))) - (if v1-5 - (set! (-> obj current-continue) v1-5) - ) - ) - ) - (else - (cond - ((= v1-3 continue-point) - (set! (-> obj current-continue) (the-as continue-point arg0)) - ) - (else - (let ((s4-3 *default-continue*)) - (position-in-front-of-camera! (-> s4-3 trans) 40960.0 4096.0) - (quaternion-identity! (-> s4-3 quat)) - (set! (-> s4-3 vis-nick) (-> *load-state* vis-nick)) - (set! (-> s4-3 lev0) (-> *load-state* want 0 name)) - (set! (-> s4-3 disp0) (-> *load-state* want 0 display?)) - (set! (-> s4-3 lev1) (-> *load-state* want 1 name)) - (set! (-> s4-3 disp1) (-> *load-state* want 1 display?)) - (set! (-> obj current-continue) s4-3) - ) - ) - ) + (case (-> arg0 type) + ((string) + (let ((v1-5 (get-continue-by-name obj (the-as string arg0)))) + (if v1-5 + (set! (-> obj current-continue) v1-5) + ) ) + ) + ((continue-point) + (set! (-> obj current-continue) (the-as continue-point arg0)) + ) + (else + (let ((s4-3 *default-continue*)) + (position-in-front-of-camera! (-> s4-3 trans) 40960.0 4096.0) + (quaternion-identity! (-> s4-3 quat)) + (set! (-> s4-3 vis-nick) (-> *load-state* vis-nick)) + (set! (-> s4-3 lev0) (-> *load-state* want 0 name)) + (set! (-> s4-3 disp0) (-> *load-state* want 0 display?)) + (set! (-> s4-3 lev1) (-> *load-state* want 1 name)) + (set! (-> s4-3 disp1) (-> *load-state* want 1 display?)) + (set! (-> obj current-continue) s4-3) + ) ) ) (when (!= s5-0 (-> obj current-continue)) @@ -174,125 +164,114 @@ ) (defmethod initialize! game-info ((obj game-info) (cause symbol) (save-to-load game-save) (continue-point-override string)) - "Initialize the game-info. + "Initialize the game-info. The cause can be 'dead if you die, or 'game to reset everything. If save-to-load is not #f will load data from that. If continue-point-override is not #f, will use that." - + (local-vars (v0-0 int) (sv-96 symbol)) - (let ((selected-cause cause)) - (when (= selected-cause 'dead) - ;; reload game-info because we died. Increase death counts - (set! (-> obj total-deaths) (+ (-> obj total-deaths) 1)) - (set! (-> obj continue-deaths) (+ (-> obj continue-deaths) 1)) - (set! (-> obj fuel-cell-deaths) (+ (-> obj fuel-cell-deaths) 1)) - (when *target* - (let ((lev-info (-> *target* current-level info))) - (when (>= (-> *level-task-data-remap* length) (-> lev-info index)) - ;; update death per level. - (set! v0-0 - (seekl - (the-as int (-> obj deaths-per-level (-> *level-task-data-remap* (+ (-> lev-info index) -1)))) - 255 - 1 - ) - ) - (set! (-> obj deaths-per-level (-> *level-task-data-remap* (+ (-> lev-info index) -1))) (the-as uint v0-0)) - ) - ) - ) - - (let ((v1-27 (-> obj mode))) - (cond - ((= v1-27 'play) - ;; now pick between life/try depending on if we ran out of lives or not. - (if (< 0.0 (-> obj life)) - (set! cause 'life) - (set! cause 'try) - ) - ) - (else - ;; not in play mode, we're done. - (begin - (set! obj obj) - (goto cfg-50) - ) - ) - ) - ) - ) - ) - - ;; ? - (kill-current-level-hint '() '() 'die) - - (let ((v1-31 cause)) - (when (= v1-31 'game) - ;; we are doing a full restart. - ;; reset everything! - (reset-all-hint-controls) - (set-continue! obj - (cond - (continue-point-override - continue-point-override - ) - ((!= *kernel-boot-message* 'play) - "demo-start" - ) - (*debug-segment* - "village1-hut" - ) - (else - "title-start" - ) + (case cause + (('dead) + ;; reload game-info because we died. Increase death counts + (+! (-> obj total-deaths) 1) + (+! (-> obj continue-deaths) 1) + (+! (-> obj fuel-cell-deaths) 1) + (when *target* + (let ((lev-info (-> *target* current-level info))) + (set! v0-0 + (when (>= (-> *level-task-data-remap* length) (-> lev-info index)) + ;; update death per level. + (set! v0-0 + (seekl (the-as int (-> obj deaths-per-level (-> *level-task-data-remap* (+ (-> lev-info index) -1)))) 255 1) ) - ) - (set! (-> obj auto-save-count) 0) - (set! (-> *setting-control* default auto-save) #f) - (set! (-> obj money) 0.0) - (set! (-> obj fuel) 0.0) - (set! (-> obj money-total) 0.0) - (set! (-> obj buzzer-total) 0.0) - (set! (-> obj perm-list length) 0) - (clear-all! (-> obj text-ids-seen)) - (set! (-> obj death-movie-tick) (rand-vu-int-count 10)) - (set! (-> obj total-deaths) 0) - (set! (-> obj continue-deaths) 0) - (set! (-> obj fuel-cell-deaths) 0) - (set! (-> obj death-pos length) 0) - (set! (-> obj game-start-time) (-> *display* base-frame-counter)) - (set! (-> obj fuel-cell-pickup-time) (-> *display* base-frame-counter)) - (set! (-> obj continue-time) (-> *display* base-frame-counter)) - (set! (-> obj death-time) (-> *display* base-frame-counter)) - (set! (-> obj hit-time) (-> *display* base-frame-counter)) - (dotimes (v1-50 116) - (set! (-> obj fuel-cell-time 0) 0) - (nop!) + (set! (-> obj deaths-per-level (-> *level-task-data-remap* (+ (-> lev-info index) -1))) (the-as uint v0-0)) + v0-0 + ) + ) + ) + ) + (case (-> obj mode) + (('play) + ;; now pick between life/try depending on if we ran out of lives or not. (this isnt really used) + (if (< 0.0 (-> obj life)) + (set! cause 'life) + (set! cause 'try) + ) ) - (dotimes (v1-53 32) - (set! (-> obj money-per-level v1-53) 0) - (set! (-> obj deaths-per-level v1-53) 0) - (set! (-> obj enter-level-time v1-53) 0) - (set! (-> obj in-level-time v1-53) 0) - (set! (-> obj level-opened v1-53) 0) - (nop!) - ) - ) + (else + ;; not in play mode, we're done. + (set! obj obj) + (goto cfg-50) + ) + ) + ) ) - - (let ((v1-56 cause)) - (when (or (= v1-56 'game) (= v1-56 'try)) - ;; full restart, or ran out of lives - (let ((v1-59 (-> obj mode))) - (when (= v1-59 'play) - (set! *display-profile* #f) - (set! *display-entity-errors* #f) - ) + (kill-current-level-hint '() '() 'die) + (case cause + (('game) + ;; we are doing a full restart. + ;; reset everything! + (reset-all-hint-controls) + (set-continue! obj (cond + (continue-point-override + (empty) + continue-point-override + ) + ((!= *kernel-boot-message* 'play) + "demo-start" + ) + (*debug-segment* + "village1-hut" + ) + (else + "title-start" + ) + ) + ) + (set! (-> obj auto-save-count) 0) + (set! (-> *setting-control* default auto-save) #f) + (set! (-> obj money) 0.0) + (set! (-> obj fuel) 0.0) + (set! (-> obj money-total) 0.0) + (set! (-> obj buzzer-total) 0.0) + (set! (-> obj perm-list length) 0) + (clear-all! (-> obj text-ids-seen)) + (set! (-> obj death-movie-tick) (rand-vu-int-count 10)) + (set! (-> obj total-deaths) 0) + (set! (-> obj continue-deaths) 0) + (set! (-> obj fuel-cell-deaths) 0) + (set! (-> obj death-pos length) 0) + (set! (-> obj game-start-time) (-> *display* base-frame-counter)) + (set! (-> obj fuel-cell-pickup-time) (-> *display* base-frame-counter)) + (set! (-> obj continue-time) (-> *display* base-frame-counter)) + (set! (-> obj death-time) (-> *display* base-frame-counter)) + (set! (-> obj hit-time) (-> *display* base-frame-counter)) + (dotimes (v1-50 116) + (set! (-> obj fuel-cell-time 0) 0) + (nop!) + ) + (dotimes (v1-53 32) + (set! (-> obj money-per-level v1-53) (the-as uint 0)) + (set! (-> obj deaths-per-level v1-53) (the-as uint 0)) + (set! (-> obj enter-level-time v1-53) 0) + (set! (-> obj in-level-time v1-53) 0) + (set! (-> obj level-opened v1-53) (the-as uint 0)) + (nop!) + ) + ) + ) + (case cause + (('game 'try) + ;; full restart, or ran out of lives + (case (-> obj mode) + (('play) + (set! *display-profile* #f) + (set! *display-entity-errors* #f) ) - ;; reset lives to default. - (set! (-> obj life-max) (-> *GAME-bank* life-max-default)) - (set! (-> obj life) (-> *GAME-bank* life-start-default)) - ) + ) + (set! (-> obj life-max) (-> *GAME-bank* life-max-default)) + (set! (-> obj life) (-> *GAME-bank* life-start-default)) + ) ) (let ((v1-65 (-> obj mode))) @@ -307,9 +286,9 @@ ((= v1-65 'play) ;; don't allow pausing/start menu (when *target* - (set-setting! *setting-control* *target* 'allow-pause #f 0.0 0) - (set-setting! *setting-control* *target* 'allow-progress #f 0.0 0) - (copy-settings-from-target! *setting-control*) + (set-setting *setting-control* *target* 'allow-pause #f 0.0 0) + (set-setting *setting-control* *target* 'allow-progress #f 0.0 0) + (apply-settings *setting-control*) ) ;; send the auto-save process a 'die message @@ -319,35 +298,26 @@ (set! (-> *level* border?) #f) (set! (-> *setting-control* default border-mode) #f) (set! *spawn-actors* #f) - (set-blackout-frames 30) + (set-blackout-frames (seconds 0.1)) ;; send target a 'reset message. (send-event *target* 'reset) - ;; start a temporary process to restart things - (let ((proc (get-process *4k-dead-pool* process #x4000))) - (when proc - (activate proc *default-pool* 'process *scratch-memory-top*) - (run-next-time-in-process - proc - (lambda ((stop-arg symbol) (reset-arg symbol) (c continue-point) (load game-save)) - (stop stop-arg) - (reset-actors reset-arg) - (set-continue! *game-info* c) - (when load - (load-game! *game-info* load) - (set! c (get-or-create-continue! *game-info*)) - ) - (suspend) - (start stop-arg c) - ) - (-> obj mode) ;; play, debug - cause - (get-or-create-continue! obj) - save-to-load - ) - ) - ) + (process-spawn-function process (lambda ((arg0 symbol) (arg1 symbol) (arg2 continue-point) (arg3 game-save)) + (stop arg0) + (reset-actors arg1) + (set-continue! *game-info* arg2) + (when arg3 + (load-game! *game-info* arg3) + (set! arg2 (get-or-create-continue! *game-info*)) + ) + (suspend) + (start arg0 arg2) + (none) + ) + (-> obj mode) cause (get-or-create-continue! obj) save-to-load + :from *4k-dead-pool* + ) (set-master-mode 'game) ) ) @@ -359,126 +329,119 @@ (defmethod adjust game-info ((obj game-info) (item symbol) (amount float) (source handle)) "Adjust the number of items by amount." - (let ((v1-0 item)) - (cond - ((= v1-0 'life) - ;; get/lose a life, just modify the life field - (if (>= amount 0.0) - (set! (-> obj life) (seek (-> obj life) (-> obj life-max) amount)) - (set! (-> obj life) (seek (-> obj life) 0.0 (- amount))) - ) - (-> obj life) - ) - - ((= v1-0 'money) - (if (and (< 0.0 amount) (= (+ (-> obj money) amount) (-> *GAME-bank* money-task-inc))) - ;; got enough orbs to trade, display a hint - (level-hint-spawn (game-text-id MISSING-orb-hint) "sksp0014" (the entity #f) *entity-pool* (game-task none)) - ) - - ;; need to update the various orb counters - (when (< 0.0 amount) - (let ((proc (handle->process source))) - (when (and proc (-> proc entity)) - ;; we have task data for this level! - (when (>= (-> *level-task-data-remap* length) (-> proc entity extra level info index)) - ;; get the level index - (let ((level-idx (-> *level-task-data-remap* (+ (-> proc entity extra level info index) -1)))) - ;; increment the level money count - (set! (-> obj money-per-level level-idx) (+ (-> obj money-per-level level-idx) (the-as uint (the int amount)))) - ;; increment our total money in the game (out of the 2000 max orbs) - (set! (-> obj money-total) (+ (-> obj money-total) amount)) - ;; if we have all the money in our level, display the all orbs graphic - (if (= (-> obj money-per-level level-idx) (-> (get-game-count level-idx) money-count)) - (activate-orb-all level-idx) - ) - ) - ) - ) + (case item + (('life) + ;; get/lose a life, just modify the life field + (if (>= amount 0.0) + (seek! (-> obj life) (-> obj life-max) amount) + (seek! (-> obj life) 0.0 (- amount)) + ) + (-> obj life) + ) + (('money) + (if (and (< 0.0 amount) (= (+ (-> obj money) amount) (-> *GAME-bank* money-task-inc))) + ;; got enough orbs to trade, display a hint + (level-hint-spawn + (game-text-id MISSING-orb-hint) + "sksp0014" + (the-as entity #f) + *entity-pool* + (game-task none) ) ) - ;; increment our current money count - (let ((f0-18 (+ (-> obj money) amount))) - (set! (-> obj money) f0-18) - f0-18 - ) - ) - - ((= v1-0 'fuel-cell) - ;; got a power cell! - ;; in this case, the amount is actually the index of the power cell's task - (let ((s5-1 (the int amount))) - (when (not (or (task-complete? obj (the-as game-task s5-1)) - (>= (the-as uint 1) (the-as uint s5-1)) - ) - ) - ;; the cell corresponds to a valid and previously incomplete task. - ;; update our stats - (set! (-> obj fuel-cell-deaths) 0) - (set! (-> obj fuel-cell-pickup-time) (-> *display* base-frame-counter)) - (set! (-> obj fuel-cell-time s5-1) (-> *display* base-frame-counter)) - ;; increment power cells! - (set! (-> obj fuel) (+ 1.0 (-> obj fuel))) - ;; mark as completed - (logior! (-> obj task-perm-list data s5-1 status) (entity-perm-status real-complete)) - ;; unused. - (get-task-control (the game-task s5-1)) - ;; close the task! - (close-specific-task! (the-as game-task s5-1) (task-status need-resolution)) - ) - ) - (-> obj fuel) - ) - - ((= v1-0 'buzzer) - ;; got a scout fly. In this case, the amount is actually two 16 bit numbers - ;; the lower 16 bits are the task, and the upper is why fly - (let ((buzz-task (logand (the int amount) #xffff)) - (buzz-index (sar (the int amount) 16)) - (buzz-count 0.0) - ) - (when (> (the-as uint buzz-task) 0) - ;; valid task - (let* ((ctrl (get-task-control (the game-task buzz-task))) - (buzz-bits (get-reminder ctrl 0)) ;; the currently collected flies - ) - (when (and (>= buzz-index 0) - (< buzz-index (the int (-> *FACT-bank* buzzer-max-default))) - ) - ;; valid fly index - - ;; increment total if we haven't collected it before - (if (zero? (logand buzz-bits (ash 1 buzz-index))) - (set! (-> obj buzzer-total) (+ 1.0 (-> obj buzzer-total))) - ) - - ;; set the updated bits - (let ((t9-10 (method-of-object ctrl save-reminder))) - (set! buzz-bits (logior buzz-bits (ash 1 buzz-index))) - (t9-10 ctrl buzz-bits 0) - ) - ) - - ;; recompute the total count - (countdown (v1-58 (the int (-> *FACT-bank* buzzer-max-default))) - (if (nonzero? (logand buzz-bits (ash 1 v1-58))) - (set! buzz-count (+ 1.0 buzz-count)) + ;; need to update the various orb counters + (when (< 0.0 amount) + (let ((proc (handle->process source))) + (when (and proc (-> proc entity)) + ;; we have task data for this level! + (when (>= (-> *level-task-data-remap* length) (-> proc entity extra level info index)) + ;; get the level index + (let ((level-idx (-> *level-task-data-remap* (+ (-> proc entity extra level info index) -1)))) + ;; increment the level money count + (+! (-> obj money-per-level level-idx) (the int amount)) + ;; increment our total money in the game (out of the 2000 max orbs) + (+! (-> obj money-total) amount) + ;; if we have all the money in our level, display the all orbs graphic + (if (= (-> obj money-per-level level-idx) (-> (get-game-count level-idx) money-count)) + (activate-orb-all level-idx) ) ) ) ) - buzz-count ) ) - ) + + ;; increment our current money count + (+! (-> obj money) amount) + ) + (('fuel-cell) + ;; got a power cell! + ;; in this case, the amount is actually the index of the power cell's task + (let ((s5-1 (the int amount))) + (when (not (or (task-complete? obj (the-as game-task s5-1)) (>= (the-as uint 1) (the-as uint s5-1)))) + ;; the cell corresponds to a valid and previously incomplete task. + ;; update our stats + (set! (-> obj fuel-cell-deaths) 0) + (set! (-> obj fuel-cell-pickup-time) (-> *display* base-frame-counter)) + (set! (-> obj fuel-cell-time s5-1) (-> *display* base-frame-counter)) + ;; increment power cells! + (set! (-> obj fuel) (+ 1.0 (-> obj fuel))) + ;; mark as completed + (logior! (-> obj task-perm-list data s5-1 status) (entity-perm-status real-complete)) + ;; unused. + (get-task-control (the-as game-task s5-1)) + ;; close the task! + (close-specific-task! (the-as game-task s5-1) (task-status need-resolution)) + ) + ) + (-> obj fuel) + ) + (('buzzer) + ;; got a scout fly. In this case, the amount is actually two 16 bit numbers + ;; the lower 16 bits are the task, and the upper is which buzzer + (let ((buzz-task (logand (the int amount) #xffff)) + (buzz-index (sar (the int amount) 16)) + (buzz-count 0.0) + ) + (when (> (the-as uint buzz-task) 0) + ;; valid task + (let* ((ctrl (get-task-control (the-as game-task buzz-task))) + (buzz-bits (get-reminder ctrl 0)) ;; the currently collected flies + ) + (when (and (>= buzz-index 0) (< buzz-index (the int (-> *FACT-bank* buzzer-max-default)))) + ;; valid fly index + + ;; increment total if we haven't collected it before + (if (zero? (logand buzz-bits (ash 1 buzz-index))) + (set! (-> obj buzzer-total) (+ 1.0 (-> obj buzzer-total))) + ) + + ;; set the updated bits + (let ((t9-10 (method-of-object ctrl save-reminder))) + (set! buzz-bits (logior buzz-bits (ash 1 buzz-index))) + (t9-10 ctrl buzz-bits 0) + ) + ) + + ;; recompute the total count + (countdown (v1-58 (the int (-> *FACT-bank* buzzer-max-default))) + (if (logtest? buzz-bits (ash 1 v1-58)) + (set! buzz-count (+ 1.0 buzz-count)) + ) + ) + ) + ) + buzz-count + ) + ) ) ) (defmethod got-buzzer? game-info ((obj game-info) (arg0 game-task) (arg1 int)) "Do we have the arg1-th buzzer for the given buzzer task?" ;; buzzers mis-use their reminder bits as a bitfield of which ones have been collected - (nonzero? (logand (get-reminder (get-task-control arg0) 0) (ash 1 arg1))) + (logtest? (get-reminder (get-task-control arg0) 0) (ash 1 arg1)) ) (defmethod buzzer-count game-info ((obj game-info) (arg0 game-task)) @@ -487,7 +450,7 @@ (v0-2 0) ;; count ) (countdown (a0-4 (the int (-> *FACT-bank* buzzer-max-default))) - (if (nonzero? (logand v1-1 (ash 1 a0-4))) + (if (logtest? v1-1 (ash 1 a0-4)) (+! v0-2 1) ) ) @@ -505,37 +468,39 @@ (defmethod mark-text-as-seen game-info ((obj game-info) (arg0 game-text-id)) "Mark the game text as seen. This only works if the text id < 4096, and ignores otherwise" (if (and (< (the-as uint arg0) (the-as uint 4095)) (> (the-as uint arg0) 0)) - (set-bit (-> obj text-ids-seen) (the-as int arg0)) - ) + (set-bit (-> obj text-ids-seen) (the-as int arg0)) + ) + 0 (none) ) (defmethod clear-text-seen! game-info ((obj game-info) (arg0 game-text-id)) "Mark text as unseen. MUST be a valid text id" (clear-bit (-> obj text-ids-seen) (the-as int arg0)) + 0 (none) ) (defmethod reset! fact-info-target ((obj fact-info-target) (arg0 symbol)) "Reset the facts for a given thing" (when (or (not arg0) (= arg0 'eco)) - (set! (-> obj eco-timeout) 0) - (set! (-> obj eco-level) 0.0) - (set! (-> obj eco-pickup-time) (-> *display* game-frame-counter)) - ) + (set! (-> obj eco-timeout) 0) + (set! (-> obj eco-level) 0.0) + (set! (-> obj eco-pickup-time) (-> *display* game-frame-counter)) + ) (when (or (not arg0) (= arg0 'health)) - (set! (-> obj health-max) (-> *FACT-bank* health-max-default)) - (set! (-> obj health) (-> obj health-max)) - (set! (-> obj health-pickup-time) (seconds -100)) - ) + (set! (-> obj health-max) (-> *FACT-bank* health-max-default)) + (set! (-> obj health) (-> obj health-max)) + (set! (-> obj health-pickup-time) (seconds -100)) + ) (when (or (not arg0) (= arg0 'buzzer)) - (set! (-> obj buzzer-max) (-> *FACT-bank* buzzer-max-default)) - (set! (-> obj buzzer) 0.0) - ) + (set! (-> obj buzzer-max) (-> *FACT-bank* buzzer-max-default)) + (set! (-> obj buzzer) 0.0) + ) (when (or (not arg0) (= arg0 'eco-pill)) - (set! (-> obj eco-pill-max) (-> *FACT-bank* eco-pill-max-default)) - (set! (-> obj eco-pill) 0.0) - ) + (set! (-> obj eco-pill-max) (-> *FACT-bank* eco-pill-max-default)) + (set! (-> obj eco-pill) 0.0) + ) (none) ) @@ -543,317 +508,272 @@ (defmethod pickup-collectable! fact-info-target ((obj fact-info-target) (kind pickup-type) (amount float) (source-handle handle)) "Pickup a thing!" - (with-pp - (case kind - (((pickup-type eco-green)) - ;; big green eco. This counts toward the health (up to 3), and if that's full, maxes out the little green ecos to 50. - (cond - ((>= amount 0.0) - ;; got a positive or 0 amount. - (when (< 0.0 amount) - ;; when we get a different source, OR we it's been more than 0.5 seconds since we last got eco - ;; from this source. - (if (or (!= (handle->process source-handle) (handle->process (-> obj eco-source))) - (>= (- (-> *display* base-frame-counter) (-> obj eco-source-time)) (seconds 0.5)) - ) - - ;; play the sound! - (sound-play-by-name (static-sound-name "get-green-eco") - (new-sound-id) - 1024 - 0 - 0 - 1 - #t - ) - ) - - ;; remember the source. - (when (handle->process source-handle) - (set! (-> obj eco-source) source-handle) - (set! (-> obj eco-source-time) (-> *display* base-frame-counter)) + (case kind + (((pickup-type eco-green)) + ;; big green eco. This counts toward the health (up to 3), and if that's full, maxes out the little green ecos to 50. + (cond + ((>= amount 0.0) + ;; got a positive or 0 amount. + (when (< 0.0 amount) + ;; when we get a different source, OR we it's been more than 0.5 seconds since we last got eco + ;; from this source. + (if (or (!= (handle->process source-handle) (handle->process (-> obj eco-source))) + (>= (- (-> *display* base-frame-counter) (-> obj eco-source-time)) (seconds 0.5)) ) - ) - - ;; if we are at max health (3), and collect additional an additional big green eco, - ;; then max out the little green ecos. - (if (= (-> obj health) (-> obj health-max)) - (pickup-collectable! - obj - (pickup-type eco-pill) - (-> *FACT-bank* eco-pill-max-default) - (process->handle (-> obj process)) - ) - ) - - ;; remember when - (set! (-> obj health-pickup-time) (-> *display* base-frame-counter)) - ;; increase the health! - (set! (-> obj health) (seek (-> obj health) (-> obj health-max) amount)) + + ;; play the sound! + (sound-play "get-green-eco") ) - (else - ;; negative health. Subtract. - (set! (-> obj health) (seek (-> obj health) 0.0 (- amount))) - - ;; not sure why we do this. But this will set the eco pill collection time. - (if (>= amount -10.0) - (pickup-collectable! obj (pickup-type eco-pill) 0.0 source-handle) - ) - - ;; subtract lives. - (if (= (-> obj health) 0.0) - (adjust - (-> (the-as target (-> obj process)) game) - 'life - (- (-> *GAME-bank* life-single-inc)) - source-handle - ) - ) - ) - ) - - ;; some sort of hack for eco vents. - (b! (and (logtest? (-> (the-as collide-shape (-> obj process root)) root-prim prim-core action) 512) - (type-type? (-> (handle->process source-handle) type) vent) - ) - cfg-80) - (-> obj health) - ) - - (((pickup-type eco-pill)) - ;; collect small green eco - (when (>= amount 0.0) - ;; update small eco count - (set! (-> obj eco-pill-pickup-time) (-> *display* base-frame-counter)) - (set! (-> obj eco-pill) (seek (-> obj eco-pill) (-> obj eco-pill-max) amount)) - - ;; increment big health if needed - (when (and (>= (-> obj eco-pill) (-> *FACT-bank* eco-pill-max-default)) ;; have enough smalls - (< (-> obj health) (-> obj health-max)) ;; and enough room for another health - ) - ;; decrease eco pills - (set! (-> obj eco-pill) - (- (-> obj eco-pill) (-> *FACT-bank* eco-pill-max-default)) - ) - ;; get a big health. - (pickup-collectable! - obj - (pickup-type eco-green) - (-> *FACT-bank* health-small-inc) - (process->handle (-> obj process)) - ) - ) - ) - (-> obj eco-pill) - ) - - (((pickup-type money)) - ;; get money. - (when (< 0.0 amount) - ;; play sound. - (if (>= (- (-> *display* base-frame-counter) (-> obj money-pickup-time)) (seconds 0.05)) - (sound-play-by-name (static-sound-name "money-pickup") - (new-sound-id) - 1024 - 0 - 0 - 1 - #t - ) - ) - (set! (-> obj money-pickup-time) (-> *display* base-frame-counter)) - ) - (adjust (-> (the-as target (-> obj process)) game) - 'money - amount - source-handle - ) - ) - (((pickup-type fuel-cell)) - ;; the amount is actually the index of the task. - (let ((s4-2 (the int amount))) - (if (not (or (task-complete? (-> (the-as target (-> obj process)) game) (the-as game-task s4-2) ) - (>= (the-as uint 1) (the-as uint s4-2)) - ) - ) - (set! (-> obj fuel-cell-pickup-time) (-> *display* base-frame-counter)) - ) - ) - (adjust - (-> (the-as target (-> obj process)) game) - 'fuel-cell - amount - source-handle - ) - ) - (((pickup-type buzzer)) - ;; scout fly. - (let ((buzz-count (adjust - (-> (the-as target (-> obj process)) game) - 'buzzer - amount - source-handle - ) - ) - ) - (if (!= buzz-count (-> obj buzzer)) - (set! (-> obj buzzer-pickup-time) (-> *display* base-frame-counter)) - ) - (set! (-> obj buzzer) buzz-count) - ) - (-> obj buzzer) - ) - (((pickup-type eco-red) (pickup-type eco-blue) (pickup-type eco-yellow)) - ;; the green vent jumps here. - (label cfg-80) - - ;; if the amount is zero, we just want to know how much eco there is. - (if (= amount 0.0) - (return (if (= (-> obj eco-type) kind) - (-> obj eco-level) - 0.0 ;; we don't have this kind of eco. - ) - ) - ) - - ;; new type of eco. Reset and use the new type. - (when (!= (-> obj eco-type) kind) - ;; as far as I can tell, the eco-level isn't really used other than just 1 or 0. - (set! (-> obj eco-level) 0.0) - (set! (-> obj eco-timeout) 0) - 0 - ) - (set! (-> obj eco-type) kind) - - - (let ((eco-lev (-> obj eco-level))) - (set! (-> obj eco-level) 1.0) ;; just set to 1. - - ;; this check now doesn't make much sense... - (when (and (= eco-lev 0.0) (< 0.0 (-> obj eco-level))) - ;; didn't have eco and now we do, remember when - (set! (-> obj eco-pickup-time) (-> *display* game-frame-counter)) - - ;; send a reset-collide message. Not sure why we do this. - (send-event (-> obj process) 'reset-collide) - ) - - ;; this logic prevents eco from respawning before you are out. - ;; the time until respawn is min(full_eco_time, old_time + single_timeout) - (set! (-> obj eco-timeout) - (the-as seconds - (min (the-as int (+ (-> obj eco-timeout) (* (the-as int (-> *FACT-bank* eco-single-timeout)) (the int amount)))) - (the-as int (+ (-> *FACT-bank* eco-full-timeout) (- (-> *display* game-frame-counter) (-> obj eco-pickup-time)))) - ) - ) - ) - - ;; if you max out the eco, this should trigger - (if (>= (the-as int (- (-> obj eco-timeout) (the-as uint (- (-> *display* game-frame-counter) (-> obj eco-pickup-time))))) - (the-as int (-> *FACT-bank* eco-full-timeout)) - ) - (set! (-> obj eco-level) 2.0) - ) - - - ;; sound and controller vibration. - (when (not (and (= (handle->process source-handle) (handle->process (-> obj eco-source))) - (< (- (-> *display* base-frame-counter) (-> obj eco-source-time)) (seconds 0.5)) - ) - ) - (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 127 (seconds 0.2)) - (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 17 (seconds 0.2)) - (case kind - (((pickup-type eco-blue)) - (sound-play-by-name (static-sound-name "get-blue-eco") (new-sound-id) 1024 0 0 1 #t) - ) - (((pickup-type eco-green)) - (sound-play-by-name (static-sound-name "get-green-eco") (new-sound-id) 1024 0 0 1 #t) - ) - (((pickup-type eco-yellow)) - (sound-play-by-name (static-sound-name "get-yellow-eco") (new-sound-id) 1024 0 0 1 #t) - ) - (((pickup-type eco-red)) - (sound-play-by-name (static-sound-name "get-red-eco") (new-sound-id) 1024 0 0 1 #t) - ) - ) - ) - - (set! (-> obj eco-source) source-handle) - (set! (-> obj eco-source-time) (-> *display* base-frame-counter)) - - ;; special case for blue eco magnet effect - (when (= kind (pickup-type eco-blue)) - (when (= eco-lev 0.0) - (let ((s5-1 (-> obj process))) - (let* ((s3-5 (get-process *default-dead-pool* touch-tracker #x4000)) - (s4-3 - (when s3-5 - (let ((t9-28 (method-of-type touch-tracker activate))) - (t9-28 (the-as touch-tracker s3-5) s5-1 'touch-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s3-5 touch-tracker-init (-> s5-1 root trans) (-> *FACT-bank* suck-bounce-dist) 300) - (-> s3-5 ppointer) - ) - ) - ) - (send-event (ppointer->process s4-3) 'target s5-1) - (send-event (ppointer->process s4-3) 'event 'eco-blue) - (send-event (ppointer->process s4-3) 'exit (lambda () (send-event *target* 'query 'powerup 3))) - (send-event - (ppointer->process s4-3) - 'eval - (lambda :behavior process-drawable - () - (set! (-> (the-as collide-shape (-> self root)) root-prim collide-with) - (collide-kind cak-1 cak-2 cak-3 blue-eco-suck) - ) - (none) - ) - ) - ) - (let ((s4-4 (get-process *4k-dead-pool* process #x4000))) - (when s4-4 - (let ((t9-35 (method-of-type process activate))) - (t9-35 s4-4 s5-1 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process - s4-4 - (lambda ((arg0 process-drawable)) - (let ((s5-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-0) (seconds 0.6)) - (send-event arg0 'effect 'eco-blue) - (suspend) - ) - ) - (none) - ) - s5-1 - ) - (-> s4-4 ppointer) - ) - ) - ) - ) - ) - ) - (-> obj eco-level) - ) - (else - ((method-of-type fact-info pickup-collectable!) obj kind amount source-handle) + + ;; remember the source. + (when (handle->process source-handle) + (set! (-> obj eco-source) source-handle) + (set! (-> obj eco-source-time) (-> *display* base-frame-counter)) ) ) + + ;; if we are at max health (3), and collect additional an additional big green eco, + ;; then max out the little green ecos. + (if (= (-> obj health) (-> obj health-max)) + (pickup-collectable! + obj + (pickup-type eco-pill) + (-> *FACT-bank* eco-pill-max-default) + (process->handle (-> obj process)) + ) + ) + + ;; remember when + (set! (-> obj health-pickup-time) (-> *display* base-frame-counter)) + ;; increase the health! + (seek! (-> obj health) (-> obj health-max) amount) + ) + (else + ;; negative health. Subtract. + (seek! (-> obj health) 0.0 (- amount)) + + ;; not sure why we do this. But this will set the eco pill collection time. + (if (>= amount -10.0) + (pickup-collectable! obj (pickup-type eco-pill) 0.0 source-handle) + ) + + ;; subtract lives. + (if (= (-> obj health) 0.0) + (adjust (-> (the-as target (-> obj process)) game) 'life (- (-> *GAME-bank* life-single-inc)) source-handle) + ) + ) + ) + + ;; some sort of hack for eco vents. + (b! + (and (logtest? (-> (the-as collide-shape (-> obj process root)) root-prim prim-core action) (collide-action ca-9)) + (type-type? (-> (handle->process source-handle) type) vent) + ) + cfg-80 + :delay (nop!) + ) + (-> obj health) + ) + + (((pickup-type eco-pill)) + ;; collect small green eco + (when (>= amount 0.0) + ;; update small eco count + (set! (-> obj eco-pill-pickup-time) (-> *display* base-frame-counter)) + (seek! (-> obj eco-pill) (-> obj eco-pill-max) amount) + + ;; increment big health if needed + (when (and (>= (-> obj eco-pill) (-> *FACT-bank* eco-pill-max-default)) (< (-> obj health) (-> obj health-max))) + ;; decrease eco pills + (set! (-> obj eco-pill) (- (-> obj eco-pill) (-> *FACT-bank* eco-pill-max-default))) + ;; get a big health. + (pickup-collectable! + obj + (pickup-type eco-green) + (-> *FACT-bank* health-small-inc) + (process->handle (-> obj process)) + ) + ) + ) + (-> obj eco-pill) + ) + + (((pickup-type money)) + ;; get money. + (when (< 0.0 amount) + ;; play sound. + (if (>= (- (-> *display* base-frame-counter) (-> obj money-pickup-time)) (seconds 0.05)) + (sound-play "money-pickup") + ) + (set! (-> obj money-pickup-time) (-> *display* base-frame-counter)) + ) + (adjust (-> (the-as target (-> obj process)) game) 'money amount source-handle) + ) + (((pickup-type fuel-cell)) + ;; the amount is actually the index of the task. + (let ((s4-2 (the int amount))) + (if (not (or (task-complete? (-> (the-as target (-> obj process)) game) (the-as game-task s4-2)) + (>= (the-as uint 1) (the-as uint s4-2)) + ) + ) + (set! (-> obj fuel-cell-pickup-time) (-> *display* base-frame-counter)) + ) + ) + (adjust (-> (the-as target (-> obj process)) game) 'fuel-cell amount source-handle) + ) + (((pickup-type buzzer)) + ;; buzzer + (let ((buzz-count (adjust (-> (the-as target (-> obj process)) game) 'buzzer amount source-handle))) + (if (!= buzz-count (-> obj buzzer)) + (set! (-> obj buzzer-pickup-time) (-> *display* base-frame-counter)) + ) + (set! (-> obj buzzer) buzz-count) + ) + (-> obj buzzer) + ) + (((pickup-type eco-red) (pickup-type eco-blue) (pickup-type eco-yellow)) + ;; the green vent jumps here. + (label cfg-80) + + ;; if the amount is zero, we just want to know how much eco there is. + (if (= amount 0.0) + (return (if (= (-> obj eco-type) kind) + (-> obj eco-level) + 0.0 ;; we don't have this kind of eco. + ) + ) + ) + + ;; new type of eco. Reset and use the new type. + (when (!= (-> obj eco-type) kind) + ;; as far as I can tell, the eco-level isn't really used other than just 1 or 0. + (set! (-> obj eco-level) 0.0) + (set! (-> obj eco-timeout) 0) + ) + (set! (-> obj eco-type) kind) + + + (let ((eco-lev (-> obj eco-level))) + (set! (-> obj eco-level) 1.0) ;; just set to 1. + + ;; this check now doesn't make much sense... + (when (and (= eco-lev 0.0) (< 0.0 (-> obj eco-level))) + ;; didn't have eco and now we do, remember when + (set! (-> obj eco-pickup-time) (-> *display* game-frame-counter)) + + ;; send a reset-collide message. Not sure why we do this. + (send-event (-> obj process) 'reset-collide) + ) + + ;; this logic prevents eco from respawning before you are out. + ;; the time until respawn is min(full_eco_time, old_time + single_timeout) + (set! (-> obj eco-timeout) + (the-as seconds + (min (the-as int (+ (-> obj eco-timeout) (* (the-as int (-> *FACT-bank* eco-single-timeout)) (the int amount)))) + (the-as int (+ (-> *FACT-bank* eco-full-timeout) (- (-> *display* game-frame-counter) (-> obj eco-pickup-time)))) + ) + ) + ) + + ;; if you max out the eco, this should trigger + (if (>= (the-as int (- (-> obj eco-timeout) (the-as uint (- (-> *display* game-frame-counter) (-> obj eco-pickup-time))))) + (the-as int (-> *FACT-bank* eco-full-timeout)) + ) + (set! (-> obj eco-level) 2.0) + ) + + + ;; sound and controller vibration. + (when (not (and (= (handle->process source-handle) (handle->process (-> obj eco-source))) + (< (- (-> *display* base-frame-counter) (-> obj eco-source-time)) (seconds 0.5)) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 127 (seconds 0.2)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 17 (seconds 0.2)) + (case kind + (((pickup-type eco-blue)) + (sound-play "get-blue-eco") + ) + (((pickup-type eco-green)) + (sound-play "get-green-eco") + ) + (((pickup-type eco-yellow)) + (sound-play "get-yellow-eco") + ) + (((pickup-type eco-red)) + (sound-play "get-red-eco") + ) + ) + ) + + (set! (-> obj eco-source) source-handle) + (set! (-> obj eco-source-time) (-> *display* base-frame-counter)) + + ;; special case for blue eco magnet effect + (when (= kind (pickup-type eco-blue)) + (when (= eco-lev 0.0) + (let ((s5-1 (-> obj process))) + (let ((s4-3 + (process-spawn + touch-tracker + :init touch-tracker-init + (-> s5-1 root trans) + (-> *FACT-bank* suck-bounce-dist) + (seconds 1) + :to s5-1 + ) + ) + ) + (send-event (ppointer->process s4-3) 'target s5-1) + (send-event (ppointer->process s4-3) 'event 'eco-blue) + (send-event (ppointer->process s4-3) 'exit (lambda () (send-event *target* 'query 'powerup (pickup-type eco-blue)))) + (send-event + (ppointer->process s4-3) + 'eval + (lambda :behavior process-drawable + () + (set! (-> (the-as collide-shape (-> self root)) root-prim collide-with) + (collide-kind cak-1 cak-2 cak-3 blue-eco-suck) + ) + (none) + ) + ) + ) + (process-spawn-function + process + (lambda ((arg0 process-drawable)) + (let ((s5-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) s5-0) (seconds 0.6)) + (send-event arg0 'effect 'eco-blue) + (suspend) + ) + ) + (none) + ) + s5-1 + :from *4k-dead-pool* + :to s5-1 + ) + ) + ) + ) + ) + (-> obj eco-level) + ) + (else + ((method-of-type fact-info pickup-collectable!) obj kind amount source-handle) + ) ) ) (defmethod lookup-entity-perm-by-aid game-info ((obj game-info) (aid actor-id)) (let ((v1-0 (-> obj perm-list))) - (countdown (a0-1 (-> v1-0 length)) - (if (= aid (-> v1-0 data a0-1 aid)) - (return (-> v1-0 data a0-1)) - ) + (countdown (a0-1 (-> v1-0 length)) + (if (= aid (-> v1-0 data a0-1 aid)) + (return (-> v1-0 data a0-1)) + ) + ) ) - ) (the-as entity-perm #f) ) @@ -872,13 +792,13 @@ (let ((info-entity-perm (lookup-entity-perm-by-aid obj (-> lev-entity-perm aid)))) (cond (info-entity-perm - ;; it exists, set it to the value from the level - (set! (-> info-entity-perm quad) (-> lev-entity-perm quad)) - ) + ;; it exists, set it to the value from the level + (set! (-> info-entity-perm quad) (-> lev-entity-perm quad)) + ) ((< (-> perms length) (-> perms allocated-length)) ;; nope, doesn't exist, but we have room for another, so add it to the back (set! (-> perms data (-> perms length) quad) (-> lev-entity-perm quad)) - (set! (-> perms length) (+ (-> perms length) 1)) + (+! (-> perms length) 1) ) ) ) @@ -901,17 +821,11 @@ ;; found the level entity in game-info, copy (set! (-> lev-entity-perm quad) (-> info-entity-perm quad)) ;; and also do this thing, not sure exactly what, but updates the status bits - (update-perm! lev-entity-perm 'try - (entity-perm-status - bit-0 - bit-1 - dead - bit-3 - user-set-from-cstage - complete - bit-9 + (update-perm! + lev-entity-perm + 'try + (entity-perm-status bit-0 bit-1 dead bit-3 user-set-from-cstage complete bit-9) ) - ) ) ) ) @@ -928,27 +842,24 @@ (defmethod debug-draw! continue-point ((obj continue-point)) "Draw a continue point." - (add-debug-x #t - (bucket-id debug-draw1) - (-> obj trans) - (new 'static 'rgba :r #xff :a #x80) - ) - (add-debug-text-3d #t - (bucket-id debug-draw1) - (-> obj name) - (-> obj trans) - (font-color white) - (new 'static 'vector2h :data (new 'static 'array int16 2 0 8)) - ) + (add-debug-x #t (bucket-id debug-no-zbuf) (-> obj trans) (new 'static 'rgba :r #xff :a #x80)) + (add-debug-text-3d + #t + (bucket-id debug-no-zbuf) + (-> obj name) + (-> obj trans) + (font-color white) + (new 'static 'vector2h :y 8) + ) (let ((a3-2 (vector-z-quaternion! (new-stack-vector0) (-> obj quat)))) (add-debug-vector - #t - (bucket-id debug-draw1) - (-> obj trans) - a3-2 - 8192.0 - (new 'static 'rgba :r #xff :g #x80 :a #x80) - ) + #t + (bucket-id debug-no-zbuf) + (-> obj trans) + a3-2 + (meters 2.0) + (new 'static 'rgba :r #xff :g #x80 :a #x80) + ) ) 0 (none) @@ -957,46 +868,41 @@ (defun-debug trsq->continue-point ((arg0 trsq)) "Print out a continue point." (let ((a2-0 (level-get-target-inside *level*))) - (format #t "~%(static-continue-point ~A ()~%" - (symbol->string (-> a2-0 name)) - ) + (format #t "~%(static-continue-point ~A ()~%" (symbol->string (-> a2-0 name))) ) - (format #t " (target ~m ~m ~m " - (-> arg0 trans x) - (-> arg0 trans y) - (-> arg0 trans z) - ) - (format #t "~f ~f ~f ~f)~%" - (-> arg0 quat x) - (-> arg0 quat y) - (-> arg0 quat z) - (-> arg0 quat w) - ) + (format #t " (target ~m ~m ~m " (-> arg0 trans x) (-> arg0 trans y) (-> arg0 trans z)) + (format #t "~f ~f ~f ~f)~%" (-> arg0 quat x) (-> arg0 quat y) (-> arg0 quat z) (-> arg0 quat w)) (let ((gp-1 *math-camera*)) - (format #t " (camera ~m ~m ~m ~f ~f ~f " - (-> gp-1 trans x) - (-> gp-1 trans y) - (-> gp-1 trans z) - (-> gp-1 inv-camera-rot vector 0 x) - (-> gp-1 inv-camera-rot vector 0 y) - (-> gp-1 inv-camera-rot vector 0 z) - ) - (format #t "~f ~f ~f ~f ~f ~f)~%" - (-> gp-1 inv-camera-rot vector 1 x) - (-> gp-1 inv-camera-rot vector 1 y) - (-> gp-1 inv-camera-rot vector 1 z) - (-> gp-1 inv-camera-rot vector 2 x) - (-> gp-1 inv-camera-rot vector 2 y) - (-> gp-1 inv-camera-rot vector 2 z) - ) + (format + #t + " (camera ~m ~m ~m ~f ~f ~f " + (-> gp-1 trans x) + (-> gp-1 trans y) + (-> gp-1 trans z) + (-> gp-1 inv-camera-rot vector 0 x) + (-> gp-1 inv-camera-rot vector 0 y) + (-> gp-1 inv-camera-rot vector 0 z) + ) + (format + #t + "~f ~f ~f ~f ~f ~f)~%" + (-> gp-1 inv-camera-rot vector 1 x) + (-> gp-1 inv-camera-rot vector 1 y) + (-> gp-1 inv-camera-rot vector 1 z) + (-> gp-1 inv-camera-rot vector 2 x) + (-> gp-1 inv-camera-rot vector 2 y) + (-> gp-1 inv-camera-rot vector 2 z) + ) + ) + (format + #t + " (load '~A '~A '~A '~A '~A)~%" + (-> *load-state* vis-nick) + (-> *load-state* want 0 name) + (-> *load-state* want 0 display?) + (-> *load-state* want 1 name) + (-> *load-state* want 1 display?) ) - (format #t " (load '~A '~A '~A '~A '~A)~%" - (-> *load-state* vis-nick) - (-> *load-state* want 0 name) - (-> *load-state* want 0 display?) - (-> *load-state* want 1 name) - (-> *load-state* want 1 display?) - ) (format #t " )~%") 0 (none) @@ -1043,10 +949,7 @@ (dotimes (a0-24 (-> v1-15 length)) (set! (-> v1-15 data a0-24 task) (the-as game-task a0-24)) ) - (set! - (-> v1-15 data 1 status) - (logior (-> v1-15 data 1 status) (entity-perm-status real-complete)) - ) + (logior! (-> v1-15 data 1 status) (entity-perm-status real-complete)) ) ) @@ -1080,17 +983,13 @@ (defmethod get-death-count game-info ((obj game-info) (arg0 symbol)) (let ((v1-13 - (if (and arg0 - *target* - (>= (-> *level-task-data-remap* length) (-> *target* current-level info index)) - ) - (the-as int - (-> obj deaths-per-level - (-> *level-task-data-remap* (+ (-> *target* current-level info index) -1)) - ) - ) - (-> obj fuel-cell-deaths) - ) + (if (and arg0 *target* (>= (-> *level-task-data-remap* length) (-> *target* current-level info index))) + (the-as + int + (-> obj deaths-per-level (-> *level-task-data-remap* (+ (-> *target* current-level info index) -1))) + ) + (-> obj fuel-cell-deaths) + ) ) ) 0 @@ -1101,3 +1000,7 @@ (defmethod get-health-percent-lost game-info ((obj game-info) (arg0 symbol)) (* 0.25 (the float (get-death-count obj #f))) ) + + + + diff --git a/goal_src/engine/game/game-save.gc b/goal_src/engine/game/game-save.gc index 11998b6dd5..2622a9de25 100644 --- a/goal_src/engine/game/game-save.gc +++ b/goal_src/engine/game/game-save.gc @@ -57,7 +57,7 @@ (life 201) (money 202) (money-total 203) - (moeny-per-level 204) + (money-per-level 204) (buzzer-total 205) (fuel-cell 206) (death-movie-tick 207) @@ -227,7 +227,7 @@ (when detail (let ((v1-4 (-> tag elt-type))) (cond - ((or (= v1-4 (game-save-elt moeny-per-level)) (= v1-4 (game-save-elt deaths-per-level))) + ((or (= v1-4 (game-save-elt money-per-level)) (= v1-4 (game-save-elt deaths-per-level))) ;; per level u8's (dotimes (prog-lev-idx (-> tag elt-count)) (let ((lev-name (progress-level-index->string prog-lev-idx))) @@ -421,7 +421,7 @@ ) (let ((v1-56 (&+ v1-55 16))) (let ((a0-30 (the-as game-save-tag (&+ v1-56 0)))) - (set! (-> a0-30 elt-type) (game-save-elt moeny-per-level)) + (set! (-> a0-30 elt-type) (game-save-elt money-per-level)) (set! (-> a0-30 elt-count) 32) (set! (-> a0-30 elt-size) (the-as uint 1)) ) @@ -861,7 +861,7 @@ (((game-save-elt money-total)) (set! (-> obj money-total) (-> data user-float0)) ) - (((game-save-elt moeny-per-level)) + (((game-save-elt money-per-level)) (let ((v1-34 (min 32 (-> data elt-count)))) (dotimes (a0-76 v1-34) (set! (-> obj money-per-level a0-76) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-76)) @@ -1631,13 +1631,13 @@ (go-virtual error (mc-status-code bad-version)) ) ) - (set-setting! *setting-control* self 'music-volume 'abs 0.0 0) - (set-setting! *setting-control* self 'sfx-volume 'abs 0.0 0) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (-> self save) (the-as string #f)) (set-master-mode 'game) - (push-setting! *setting-control* self 'process-mask 'set 0.0 16) - (copy-settings-from-target! *setting-control*) + (add-setting! 'process-mask 'set 0.0 16) + (apply-settings *setting-control*) (dotimes (gp-1 15) (suspend) ) @@ -1735,7 +1735,7 @@ ) (defun auto-save-command ((arg0 symbol) (arg1 int) (arg2 int) (arg3 process-tree)) - (make-init-process auto-save auto-save-init-by-other arg0 arg3 arg1 arg2) + (process-spawn auto-save arg0 arg3 arg1 arg2) (none) ) diff --git a/goal_src/engine/game/generic-obs-h.gc b/goal_src/engine/game/generic-obs-h.gc index b3ae76c9a0..987ff2ee9a 100644 --- a/goal_src/engine/game/generic-obs-h.gc +++ b/goal_src/engine/game/generic-obs-h.gc @@ -48,7 +48,7 @@ (joint joint-mod 4 :offset-assert 240) (new-post-hook (function none) :offset-assert 256) (cur-post-hook (function none) :offset-assert 260) - (clone-copy-trans basic :offset-assert 264) + (clone-copy-trans symbol :offset-assert 264) (shadow-backup basic :offset-assert 268) (draw? symbol :offset-assert 272) ) @@ -108,13 +108,12 @@ ;; a camera-tracker can control the camera. (deftype camera-tracker (process) - ((entity-override entity-actor :offset 52) - (grab-target handle :offset 120) + ((grab-target handle :offset 120) (grab-event symbol :offset-assert 128) (release-event symbol :offset-assert 132) - (old-global-mask uint32 :offset-assert 136) - (old-self-mask uint32 :offset-assert 140) - (old-parent-mask uint32 :offset-assert 144) + (old-global-mask process-mask :offset-assert 136) + (old-self-mask process-mask :offset-assert 140) + (old-parent-mask process-mask :offset-assert 144) (look-at-target handle :offset-assert 152) (pov-target handle :offset-assert 160) (work-process handle :offset-assert 168) @@ -124,7 +123,7 @@ (userdata basic :offset-assert 196) (message basic :offset-assert 200) (border-value basic :offset-assert 204) - (mask-to-clear uint32 :offset-assert 208) + (mask-to-clear process-mask :offset-assert 208) (script pair :offset-assert 212) (script-line pair :offset-assert 216) (script-func (function none) :offset-assert 220) @@ -199,17 +198,17 @@ ;; control the camera from something else (an animation) (deftype othercam (process) - ((hand handle :offset-assert 112) - (old-global-mask uint32 :offset-assert 120) - (mask-to-clear uint32 :offset-assert 124) - (cam-joint-index int32 :offset-assert 128) - (old-pos vector :inline :offset-assert 144) - (old-mat-z vector :inline :offset-assert 160) - (had-valid-frame basic :offset-assert 176) - (border-value basic :offset-assert 180) - (die? symbol :offset-assert 184) - (survive-anim-end? symbol :offset-assert 188) - (spooling? symbol :offset-assert 192) + ((hand handle :offset-assert 112) + (old-global-mask process-mask :offset-assert 120) + (mask-to-clear process-mask :offset-assert 124) + (cam-joint-index int32 :offset-assert 128) + (old-pos vector :inline :offset-assert 144) + (old-mat-z vector :inline :offset-assert 160) + (had-valid-frame basic :offset-assert 176) + (border-value basic :offset-assert 180) + (die? symbol :offset-assert 184) + (survive-anim-end? symbol :offset-assert 188) + (spooling? symbol :offset-assert 192) ) :heap-base #x60 :method-count-assert 14 diff --git a/goal_src/engine/game/generic-obs.gc b/goal_src/engine/game/generic-obs.gc index d490ce7032..7468eb63d3 100644 --- a/goal_src/engine/game/generic-obs.gc +++ b/goal_src/engine/game/generic-obs.gc @@ -5,7 +5,7 @@ ;; name in dgo: generic-obs ;; dgos: GAME, ENGINE -(define-extern convert-to-hud-object (function process-drawable hud none :behavior hud)) +(define-extern convert-to-hud-object (function process-drawable hud none :behavior process-drawable)) ;; TODO - temporary @@ -15,6 +15,10 @@ (define-extern beach-part-grotto-1 (state beach-part)) +(defmacro manipy-spawn (trans entity skel arg &key (from *default-dead-pool*) &key (to *default-pool*) &key (name #f) &key (stack-size #x4000) &key (stack *scratch-memory-top*)) + `(process-spawn manipy :init manipy-init ,trans ,entity ,skel ,arg :from ,from :to ,to :name ,name :stack-size ,stack-size :stack ,stack) + ) + ;; DECOMP BEGINS (defbehavior clone-anim-once process-drawable ((arg0 handle) (arg1 int) (arg2 symbol) (arg3 string)) @@ -102,23 +106,16 @@ ) (defstate swingpole-stance (swingpole) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (and *target* (< (vector-vector-distance (-> self root trans) (-> *target* control unknown-vector90)) (-> self range)) (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-6)) (< (-> *target* control unknown-vector90 y) (+ (-> self root trans y) (* 0.5 (-> self range)))) ) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'pole-grab) - (set! (-> a1-1 param 0) (the-as uint self)) - (if (send-event-function *target* a1-1) - (go swingpole-active) - ) - ) + (if (send-event *target* 'pole-grab self) + (go swingpole-active) + ) ) (suspend) ) @@ -127,8 +124,7 @@ ) (defstate swingpole-active (swingpole) - :code - (behavior () + :code (behavior () (suspend) (while (and *target* (= (handle->process (-> *target* control unknown-handle10)) self)) (suspend) @@ -162,8 +158,7 @@ (defstate die (process-hidden) :virtual #t - :code - (the-as (function none :behavior process-hidden) nothing) + :code (the-as (function none :behavior process-hidden) nothing) ) (defmethod init-from-entity! process-hidden ((obj process-hidden) (arg0 entity-actor)) @@ -190,8 +185,7 @@ (defstate manipy-idle (manipy) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 none)) (let ((v1-0 arg2)) (the-as @@ -324,7 +318,7 @@ ) ((= v1-0 'clone-copy-trans) (set! v0-0 (the-as none (-> arg3 param 0))) - (set! (-> self clone-copy-trans) (the-as basic v0-0)) + (set! (-> self clone-copy-trans) (the-as symbol v0-0)) v0-0 ) ((= v1-0 'release) @@ -369,17 +363,7 @@ (('done) (case (-> self anim-mode) (('play1 'play) - (>= (ja-frame-num 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -2 - ) - ) - ) + (>= (ja-frame-num 0) (the float (+ (-> (ja-group) data 0 length) -2))) ) ) ) @@ -403,8 +387,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (!= (-> self cur-trans-hook) (-> self new-trans-hook)) (set! (-> self cur-trans-hook) (-> self new-trans-hook)) ) @@ -413,19 +396,10 @@ ) (when (and (-> self new-joint-anim) (nonzero? (-> self skel)) - (and (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self new-joint-anim) - ) - (!= (-> self anim-mode) 'clone-anim) - ) + (and (!= (ja-group) (-> self new-joint-anim)) (!= (-> self anim-mode) 'clone-anim)) ) - (ja-channel-push! 1 (the-as int (-> self new-joint-anim-blend))) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! gp-0 (-> self new-joint-anim) num-func-identity) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja-channel-push! 1 (the-as time-frame (-> self new-joint-anim-blend))) + (ja :group! (-> self new-joint-anim) :num! min) ) (let ((v1-20 (handle->process (-> self cur-grab-handle)))) (when v1-20 @@ -448,10 +422,9 @@ ((-> self cur-trans-hook)) (none) ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask heap-shrunk)) - (while #t + (loop ((-> self cur-post-hook)) (if (!= (-> self anim-mode) 'clone-anim) (ja-post) @@ -459,25 +432,15 @@ (suspend) (case (-> self anim-mode) (('loop) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (('play) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (('copy-parent) - (let ((v1-18 (-> self skel root-channel 0))) - (set! (-> v1-18 num-func) num-func-identity) - (set! (-> v1-18 frame-num) - (-> (the-as process-drawable (ppointer->process (-> self parent))) skel root-channel 0 frame-num) - ) - ) + (ja :num-func num-func-identity + :frame-num (-> (the-as process-drawable (ppointer->process (-> self parent))) skel root-channel 0 frame-num) + ) ) (('clone-parent) (let ((gp-0 (ppointer->process (-> self parent)))) @@ -502,18 +465,14 @@ ) ) (the-as int (-> self draw origin-joint-index)) - (the-as symbol (-> self clone-copy-trans)) + (-> self clone-copy-trans) "" ) ) (('still) ) (('play1) - (let ((a0-33 (-> self skel root-channel 0))) - (set! (-> a0-33 param 0) (the float (+ (-> a0-33 frame-group data 0 length) -1))) - (set! (-> a0-33 param 1) 1.0) - (joint-control-channel-group-eval! a0-33 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (if (ja-done? 0) (deactivate self) ) @@ -524,7 +483,7 @@ ) ) -(defbehavior manipy-init manipy ((arg0 vector) (arg1 entity) (arg2 skeleton-group) (arg3 vector)) +(defbehavior manipy-init manipy ((arg0 vector) (arg1 entity-actor) (arg2 skeleton-group) (arg3 vector)) (stack-size-set! (-> self main-thread) 256) ;; from 128 (logior! (-> self mask) (process-mask heap-shrunk)) (set! (-> self entity) arg1) @@ -579,10 +538,7 @@ (set! (-> self draw?) #t) (cond ((nonzero? (-> self skel)) - (set! (-> self new-joint-anim) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) + (set! (-> self new-joint-anim) (ja-group)) (set! (-> self anim-mode) 'loop) ) (else @@ -622,8 +578,7 @@ ) (defstate part-tracker-process (part-tracker) - :code - (behavior () + :code (behavior () (set! (-> self start-time) (-> *display* base-frame-counter)) (while (< (- (-> *display* base-frame-counter) (-> self start-time)) (-> self duration)) (let ((gp-0 (handle->process (-> self target)))) @@ -833,16 +788,7 @@ (defbehavior process-release? process ((arg0 process)) (let ((gp-0 (command-get-process arg0 *target*))) - (the-as symbol (if (and gp-0 - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'mode)) - (send-event-function gp-0 a1-1) - ) - 'target-grab - ) + (the-as symbol (if (and gp-0 (send-event gp-0 'query 'mode) 'target-grab) (send-event gp-0 'end-mode) #t ) @@ -1132,8 +1078,7 @@ ) (defstate camera-tracker-process (camera-tracker) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 uint)) (let ((v1-0 arg2)) (the-as object (cond @@ -1144,7 +1089,7 @@ ) ((= v1-0 'mask) (set! v0-0 (-> arg3 param 0)) - (set! (-> self mask-to-clear) v0-0) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) v0-0 ) ((= v1-0 'border) @@ -1156,29 +1101,26 @@ ) ) ) - :enter - (behavior () - (if (-> self entity-override) - (dummy-30 (-> self entity-override) (entity-perm-status bit-3) #t) + :enter (behavior () + (if (-> self entity) + (dummy-30 (-> self entity) (entity-perm-status bit-3) #t) ) (if (not (-> self border-value)) - (push-setting! *setting-control* self 'border-mode (-> self border-value) 0.0 0) + (add-setting! 'border-mode (-> self border-value) 0.0 0) ) - (push-setting! *setting-control* self 'process-mask 'set 0.0 (-> self mask-to-clear)) - (push-setting! *setting-control* self 'movie (process->ppointer self) 0.0 0) + (add-setting! 'process-mask 'set 0.0 (-> self mask-to-clear)) + (add-setting! 'movie (process->ppointer self) 0.0 0) (hide-hud-quick) (none) ) - :exit - (behavior () - (if (-> self entity-override) - (dummy-30 (-> self entity-override) (entity-perm-status bit-3) #f) + :exit (behavior () + (if (-> self entity) + (dummy-30 (-> self entity) (entity-perm-status bit-3) #f) ) (send-event *camera* 'clear-entity) (none) ) - :code - (behavior () + :code (behavior () (cond ((-> self script-func) ((-> self script-func)) @@ -1190,7 +1132,7 @@ ) ) ) - (clear-pending-settings-from-process *setting-control* self 'process-mask) + (remove-setting! 'process-mask) (send-event *camera* 'clear-entity) (suspend) (suspend) @@ -1203,7 +1145,7 @@ (defbehavior camera-tracker-init camera-tracker ((arg0 object)) (stack-size-set! (-> self main-thread) 512) (logclear! (-> self mask) (process-mask actor-pause movie enemy platform projectile)) - (set! (-> self mask-to-clear) (the-as uint #x4a0800)) + (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) (set! (-> self grab-target) (the-as handle #f)) (set! (-> self grab-event) 'grab) (set! (-> self release-event) 'end-mode) @@ -1236,7 +1178,7 @@ ) ) (if v1-17 - (set! (-> self entity-override) (the-as entity-actor (-> (the-as process v1-17) entity))) + (set! (-> self entity) (-> (the-as process v1-17) entity)) ) ) (set! (-> self event-hook) (-> camera-tracker-process event)) @@ -1259,27 +1201,23 @@ (defstate med-res-level-idle (med-res-level) - :code - (behavior () + :code (behavior () (local-vars (v1-37 float)) (rlet ((vf0 :class vf) (vf16 :class vf) (vf17 :class vf) ) (init-vf0-vector) - (while #t + (loop (let ((a0-1 (level-get *level* (-> self level))) (v1-3 (-> *game-info* current-continue level)) ) (cond ((and a0-1 (or (= (-> a0-1 display?) 'special) (= (-> a0-1 display?) 'special-vis))) (logclear! (-> self draw status) (draw-status hidden)) - (when (nonzero? (-> self skel)) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-loop!) + (if (nonzero? (-> self skel)) + (ja :num! (loop!)) ) - ) ) ((or (and a0-1 (= (-> a0-1 status) 'active)) (= v1-3 'firecanyon)) (logior! (-> self draw status) (draw-status hidden)) @@ -1292,12 +1230,9 @@ (if (nonzero? (-> self part)) (spawn (-> self part) (-> self root trans)) ) - (when (nonzero? (-> self skel)) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-loop!) + (if (nonzero? (-> self skel)) + (ja :num! (loop!)) ) - ) ) ) ) @@ -1318,8 +1253,7 @@ (none) ) ) - :post - (the-as (function none :behavior med-res-level) ja-post) + :post (the-as (function none :behavior med-res-level) ja-post) ) (define *lev-string* (new 'global 'string 64 (the-as string #f))) @@ -1394,8 +1328,7 @@ ) (defstate part-spawner-active (part-spawner) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('stop) (process-entity-status! self (entity-perm-status complete) #t) @@ -1415,9 +1348,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (-> self enable) (spawn (-> self part) (-> self root trans)) (if (nonzero? (-> self sound)) @@ -1464,7 +1396,7 @@ ) ) ((= (-> s2-0 -1) symbol) - (set! s4-0 (-> (&+ s2-0 #xff38) 0)) + (set! s4-0 (symbol->string (the-as symbol s2-0))) (set! s3-0 (lookup-part-group-pointer-by-name (the-as string s4-0))) (if s3-0 (set! (-> s5-1 0) s3-0) @@ -1514,8 +1446,7 @@ (defpartgroup group-beach-launcher :id 37 :bounds (static-bspherem 0 3 0 5) - :parts - ((sp-item 45 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 45 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 46 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) (sp-item 47 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) (sp-item 48 :fade-after (meters 50) :falloff-to (meters 80)) @@ -1524,8 +1455,7 @@ ) (defpart 45 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-flt spt-x (meters 1.5)) (sp-flt spt-y (meters -0.5)) (sp-int spt-rot-x 5) @@ -1542,13 +1472,11 @@ ) (defpart 50 - :init-specs - ((sp-flt spt-fade-b -4.551111)) + :init-specs ((sp-flt spt-fade-b -4.551111)) ) (defpart 46 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 1.8) 1.0) (sp-flt spt-scale-x (meters 0.2)) @@ -1568,8 +1496,7 @@ ) (defpart 47 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 1.8) (meters 1) 1.0) (sp-flt spt-scale-x (meters 0.2)) @@ -1589,8 +1516,7 @@ ) (defpart 48 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters 2.9) (meters 2.5) 1.0) (sp-flt spt-y (meters -0.5)) @@ -1614,8 +1540,7 @@ ) (defpart 49 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 2.9) (meters 2.5) 1.0) (sp-flt spt-y (meters -0.5)) @@ -1641,15 +1566,13 @@ ) (defpart 51 - :init-specs - ((sp-flt spt-fade-a -0.18)) + :init-specs ((sp-flt spt-fade-a -0.18)) ) (defpartgroup group-jungle-launcher :id 38 :bounds (static-bspherem 0 3 0 5) - :parts - ((sp-item 45 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 45 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 52 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) (sp-item 53 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) (sp-item 54 :fade-after (meters 70) :falloff-to (meters 100)) @@ -1657,8 +1580,7 @@ ) (defpart 52 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 1.4) 1.0) (sp-flt spt-scale-x (meters 0.2)) @@ -1678,8 +1600,7 @@ ) (defpart 53 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 1.4) (meters 0.9) 1.0) (sp-flt spt-scale-x (meters 0.2)) @@ -1699,8 +1620,7 @@ ) (defpart 54 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 2.9) (meters 2.5) 1.0) (sp-flt spt-y (meters -0.5)) @@ -1728,8 +1648,7 @@ (defpartgroup group-swamp-launcher :id 39 :bounds (static-bspherem 0 3 0 5) - :parts - ((sp-item 45 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 45 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 46 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) (sp-item 47 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) (sp-item 55 :fade-after (meters 70) :falloff-to (meters 100)) @@ -1737,8 +1656,7 @@ ) (defpart 55 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 2.9) (meters 2.5) 1.0) (sp-flt spt-y (meters -0.5)) @@ -1763,12 +1681,13 @@ ) ) +;; unused blue eco(?) launcher cam (defbehavior cam-launcher-joystick camera-slave () (when *camera-read-analog* (let ((s5-0 (new-stack-matrix0)) (gp-0 (vector-reset! (new 'stack-no-clear 'vector))) ) - (let* ((f0-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) + (let* ((f0-0 (analog-input-horizontal-third (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) ;; changed for pc port (f1-1 (* -546.13336 f0-0)) (f0-2 (fmin 546.13336 (fmax -546.13336 f1-1))) ) @@ -1782,8 +1701,7 @@ ) (defstate cam-launcher-shortfall (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -1793,8 +1711,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) @@ -1815,22 +1732,20 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (-> *display* base-frame-counter))) - (while #t + (loop (when (not (paused?)) (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) (send-event *camera* 'teleport) (if (and (-> *camera* on-ground) (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1))) - (send-event *camera* 'change-state *camera-base-mode* 150) + (send-event *camera* 'change-state *camera-base-mode* (seconds 0.5)) ) ) (suspend) @@ -1840,10 +1755,11 @@ ) ) +;; blue eco launcher cam (not used for enclosed launchers like in jungle temple) (defbehavior cam-launcher-long-joystick camera-slave () (when *camera-read-analog* (let ((gp-0 (new-stack-matrix0))) - (let* ((f0-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) + (let* ((f0-0 (analog-input-horizontal-third (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) ;; changed for pc port (f1-1 (* -546.13336 f0-0)) (f0-2 (fmin 546.13336 (fmax -546.13336 f1-1))) ) @@ -1856,8 +1772,7 @@ ) (defstate cam-launcher-longfall (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -1867,8 +1782,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (new 'stack-no-clear 'vector) (vector-negate! (-> self view-flat) (-> self tracking inv-mat vector 2)) @@ -1882,18 +1796,16 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (cam-launcher-long-joystick) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (-> *display* base-frame-counter))) - (while #t + (loop (when (not (paused?)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) @@ -1935,7 +1847,7 @@ (set! (-> self trans z) (-> *camera* tpos-curr z)) (vector+! (-> self trans) (-> self trans) (-> self view-flat)) (if (and (-> *camera* on-ground) (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1))) - (send-event *camera* 'change-state *camera-base-mode* 150) + (send-event *camera* 'change-state *camera-base-mode* (seconds 0.5)) ) ) (vector-reset! (-> self tracking follow-off)) @@ -1955,8 +1867,7 @@ ) (defstate launcher-idle (launcher) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('instant-death) (go launcher-deactivated) @@ -1967,46 +1878,25 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (and *target* (>= (-> self active-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) ) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'powerup)) - (set! (-> a1-1 param 1) (the-as uint 3)) - (cond - ((send-event-function *target* a1-1) - (go launcher-active) - ) - (else - (let ((gp-0 'target-launch) - (a1-2 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 1) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'mode)) - (if (= (send-event-function *target* a1-2) gp-0) - (send-event *target* 'end-mode) - ) - ) + (cond + ((send-event *target* 'query 'powerup (pickup-type eco-blue)) + (go launcher-active) + ) + (else + (let ((gp-0 'target-launch)) + (if (= (send-event *target* 'query 'mode) gp-0) + (send-event *target* 'end-mode) + ) ) ) ) (if (and (and *target* (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 2) - (set! (-> a1-5 message) 'query) - (set! (-> a1-5 param 0) (the-as uint 'powerup)) - (set! (-> a1-5 param 1) (the-as uint 3)) - (not (send-event-function *target* a1-5)) - ) + (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (level-hint-spawn (game-text-id daxter-launcher-no-eco) @@ -2019,13 +1909,11 @@ ) (none) ) - :code - (the-as (function none :behavior launcher) anim-loop) + :code (the-as (function none :behavior launcher) anim-loop) ) (defstate launcher-active (launcher) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (or (= arg2 'touch) (= arg2 'attack)) (set! (-> self state-time) (-> *display* base-frame-counter)) (send-event arg0 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) @@ -2040,38 +1928,29 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-param)) (set! (-> v1-0 id) (-> self sound-id)) (set! (-> v1-0 parms volume) -4) (set! (-> v1-0 auto-time) 120) (set! (-> v1-0 auto-from) 2) - (set! (-> v1-0 parms mask) (the-as uint 17)) + (set! (-> v1-0 parms mask) (sound-mask volume time)) (-> v1-0 id) ) (none) ) - :trans - (behavior () + :trans (behavior () (if (or (or (not *target*) (< (-> self active-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) ) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'powerup)) - (set! (-> a1-1 param 1) (the-as uint 3)) - (not (send-event-function *target* a1-1)) - ) + (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (go launcher-idle) ) (spawn (-> self part) (-> self root-override trans)) - (sound-play-by-name (static-sound-name "launch-idle") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "launch-idle" :id (-> self sound-id)) (if (and (and *target* (>= (+ 2867.2 (-> self root-override root-prim prim-core world-sphere w)) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -2082,17 +1961,15 @@ ) (none) ) - :code - (behavior () - (sound-play-by-name (static-sound-name "launch-start") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (sound-play "launch-start") (anim-loop) (none) ) ) (defstate launcher-deactivated (launcher) - :code - (the-as (function none :behavior launcher) anim-loop) + :code (the-as (function none :behavior launcher) anim-loop) ) (defmethod init-from-entity! launcher ((obj launcher) (arg0 entity-actor)) @@ -2215,8 +2092,7 @@ ) (defstate touch-tracker-idle (touch-tracker) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 none)) (let ((v1-0 arg2)) (the-as object (cond @@ -2227,28 +2103,23 @@ ((= (-> self event) 'attack) (cond ((= (-> arg0 type) target) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) (the-as process v1-1)) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) (-> self event)) - (set! (-> a1-2 param 0) (the-as uint #f)) - (let ((a2-2 (new 'static 'attack-info :mask #x20))) - (set! (-> a2-2 mode) (the-as symbol (-> self event-mode))) - (set! (-> a1-2 param 1) (the-as uint a2-2)) - ) - (send-event-function arg0 a1-2) + (send-event + arg0 + (-> self event) + :from (the-as process v1-1) + #f + (static-attack-info ((mode (the-as symbol (-> self event-mode))))) ) ) ((= (-> v1-1 type) target) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) (the-as process v1-1)) - (set! (-> a1-4 num-params) 4) - (set! (-> a1-4 message) (-> self event)) - (set! (-> a1-4 param 0) (the-as uint #f)) - (set! (-> a1-4 param 1) (the-as uint (-> self event-mode))) - (set! (-> a1-4 param 2) (the-as uint (-> *target* control unknown-dword50))) - (set! (-> a1-4 param 3) (the-as uint (-> *target* control unknown-dword51))) - (send-event-function arg0 a1-4) + (send-event + arg0 + (-> self event) + :from (the-as process v1-1) + #f + (-> self event-mode) + (-> *target* control unknown-dword50) + (-> *target* control unknown-dword51) ) ) (else @@ -2269,12 +2140,7 @@ ) ) ((-> self event) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) (the-as process v1-1)) - (set! (-> a1-6 num-params) 0) - (set! (-> a1-6 message) (-> self event)) - (send-event-function arg0 a1-6) - ) + (send-event arg0 (-> self event) :from (the-as process v1-1)) ) (else (let ((t0-5 (new 'stack-no-clear 'event-message-block))) @@ -2323,8 +2189,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (while ((-> self run-function)) (let* ((gp-0 (handle->process (-> self target))) @@ -2471,8 +2336,7 @@ ) (defpart 2528 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xc :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc :page #x2)) (sp-func spt-birth-func 'birth-func-set-quat) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) @@ -2500,14 +2364,7 @@ (dotimes (s4-1 3) (quaternion-rotate-local-z! s5-0 s5-0 10922.667) (quaternion-copy! *particle-quat* s5-0) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2528) - gp-1 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2528) gp-1) ) ) ) diff --git a/goal_src/engine/game/main-h.gc b/goal_src/engine/game/main-h.gc index 419b02bd3a..b97d5eee8c 100644 --- a/goal_src/engine/game/main-h.gc +++ b/goal_src/engine/game/main-h.gc @@ -119,7 +119,7 @@ ;; function to call in the main loop to run the debug menu (declare-type debug-menu-context basic) -(define-extern *menu-hook* (function debug-menu-context)) +(define *menu-hook* (the (function debug-menu-context) nothing)) ;; function to call in the main loop to run the progress menu (define *progress-hook* nothing) diff --git a/goal_src/engine/game/main.gc b/goal_src/engine/game/main.gc index b955de8788..cd63cba389 100644 --- a/goal_src/engine/game/main.gc +++ b/goal_src/engine/game/main.gc @@ -18,7 +18,7 @@ (defun letterbox () "Draw the letterbox black rectangles" (with-dma-buffer-add-bucket ((dma-buf (-> (current-frame) global-buf)) - (bucket-id debug-draw1)) ;; debug-draw1 is one of the last buckets + (bucket-id debug-no-zbuf)) ;; debug-no-zbuf is one of the last buckets ;; draw the two sprites (#cond ((not PC_PORT) @@ -75,7 +75,7 @@ (defun blackout () "Draw the blackout rectangle, convering the entire screen in darkness." (with-dma-buffer-add-bucket ((dma-buf (-> (current-frame) global-buf)) - (bucket-id debug-draw1)) ;; debug-draw1 is one of the last buckets + (bucket-id debug-no-zbuf)) ;; debug-no-zbuf is one of the last buckets (draw-sprite2d-xy dma-buf 0 0 512 224 (new 'static 'rgba :a #x80)) ) (none) @@ -104,55 +104,60 @@ (defun set-master-mode ((new-mode symbol)) "Update pause masks for the given mode, and set *master-mode*" - (set! *master-mode* new-mode) - (if *debug-segment* - (menu-respond-to-pause) - ) - (case *master-mode* - (('pause) + ;; PAL patch here + (let ((gp-0 *master-mode*)) + (set! *master-mode* new-mode) + (if *debug-segment* + (menu-respond-to-pause) + ) + (case *master-mode* + (('pause) - ;; request the pause mask to be set in prevent-from-run. - ;; this will block any process with pause from running, pausing most game objects. - (if (not *debug-pause*) - (logior! (-> *setting-control* default process-mask) (process-mask pause)) - ) - - ;; allow the menu to run. - (logclear! (-> *setting-control* default process-mask) (process-mask menu)) - - ;; ?? - (set! *pause-lock* #f) - (sound-group-pause (the-as uint 255)) - (hide-progress-screen) - ) - (('menu) - ;; I believe these masks are just to make the progress go away work. - (logior! (-> *setting-control* default process-mask) (process-mask menu)) - (logclear! (-> *setting-control* default process-mask) (process-mask pause progress)) - (set! *pause-lock* #f) - (hide-progress-screen) - ) - (('progress) - ;; allow menu to run while in progress. - (logclear! (-> *setting-control* default process-mask) (process-mask menu)) - - ;; activate the progress menu. - (when (not *progress-process*) - (activate-progress *dproc* (progress-screen fuel-cell)) - (if (not *progress-process*) ;; if it doesn't want to activate, back to game. - (set-master-mode 'game) + ;; request the pause mask to be set in prevent-from-run. + ;; this will block any process with pause from running, pausing most game objects. + (if (not *debug-pause*) + (logior! (-> *setting-control* default process-mask) (process-mask pause)) ) + + ;; allow the menu to run. + (logclear! (-> *setting-control* default process-mask) (process-mask menu)) + + ;; ?? + (set! *pause-lock* #f) + (sound-group-pause (sound-group sfx music dialog sog3 ambient sog5 sog6 sog7)) + (hide-progress-screen) ) - ) - (('game) - ;; allow pausable/menu to run. - (logclear! (-> *setting-control* default process-mask) (process-mask pause menu)) - ;; (sound-group-continue (the-as uint 255)) TODO (we need to flush sound commands) - (hide-progress-screen) - ) + (('menu) + ;; I believe these masks are just to make the progress go away work. + (logior! (-> *setting-control* default process-mask) (process-mask menu)) + (logclear! (-> *setting-control* default process-mask) (process-mask pause progress)) + (set! *pause-lock* #f) + (hide-progress-screen) + ) + (('progress) + ;; allow menu to run while in progress. + (logclear! (-> *setting-control* default process-mask) (process-mask menu)) + + ;; activate the progress menu. + (when (not *progress-process*) + (activate-progress *dproc* (progress-screen fuel-cell)) + (if (not *progress-process*) + (set-master-mode 'game) + ) + ) + ) + (('game) + ;; allow pausable/menu to run. + (logclear! (-> *setting-control* default process-mask) (process-mask pause menu)) + (if (!= gp-0 *master-mode*) + (sound-group-continue (sound-group sfx music dialog sog3 ambient sog5 sog6 sog7)) + ) + (hide-progress-screen) + ) + ) ) ;; apply settings now. - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) 0 (none) ) @@ -330,12 +335,23 @@ ) (defmethod draw screen-filter ((obj screen-filter)) - (with-dma-buffer-add-bucket ((buf (-> (current-frame) global-buf)) (bucket-id debug-draw1)) + (with-dma-buffer-add-bucket ((buf (-> (current-frame) global-buf)) (bucket-id debug-no-zbuf)) (draw-sprite2d-xy buf -256 (- (-> *video-parms* screen-hy)) 512 (-> *video-parms* screen-sy) (-> obj color)) ) (none) ) +;;;;;;;;;;;;;;;;;;;;;; +;; opengoal territory override +;;;;;;;;;;;;;;;;;;;;;; + +(defun scf-get-territory () + "this overrides the kernel version." + (if (and *jak1-full-game* (= (language-enum japanese) (-> *setting-control* default language))) + GAME_TERRITORY_SCEI + GAME_TERRITORY_SCEA) + ) + ;;;;;;;;;;;;;;;;;;;;;; ;; Cheat Codes ;;;;;;;;;;;;;;;;;;;;;; @@ -356,7 +372,7 @@ ;; cheat mode (check-cheat-code (-> *cheat-temp* 0) 0 (up up down down left right left right x x square circle square circle) - (cpad-clear-buttons! 0 r1) + (cpad-clear! 0 r1) ;; toggle! (not! *cheat-mode*) (cheats-sound-play *cheat-mode*) @@ -366,7 +382,7 @@ (when *cheat-mode* (check-cheat-code (-> *cheat-temp* 1) 0 (circle square circle square x x right left right left down down up up) - (cpad-clear-buttons! 0 r1) + (cpad-clear! 0 r1) ;; toggle between #t and debug. (set! *cheat-mode* (if (= *cheat-mode* 'debug) #t @@ -382,7 +398,7 @@ ((GAME_TERRITORY_SCEI) (check-cheat-code (-> *cheat-temp* 2) 0 (l1 r1 l1 r1 triangle circle x square) - (cpad-clear-buttons! 0 r1) + (cpad-clear! 0 r1) (set! *progress-cheat* (if *progress-cheat* #f 'language @@ -397,7 +413,7 @@ (when *debug-segment* (check-cheat-code (-> *cheat-temp* 3) 0 (x square triangle circle x square triangle circle) - (cpad-clear-buttons! 0 r1) + (cpad-clear! 0 r1) (set! *progress-cheat* (if *progress-cheat* #f 'pal @@ -408,7 +424,7 @@ ;; added in PAL (check-cheat-code (-> *cheat-temp* 4) 0 ;; they erroneously used (-> *cheat-temp* 5) here! (triangle x circle square triangle x circle square) - (cpad-clear-buttons! 0 r1) + (cpad-clear! 0 r1) (set! *cheat-mode* (if (= *cheat-mode* 'camera) #f 'camera @@ -419,11 +435,11 @@ (external-cam-reset!) ) (set! *external-cam-mode* 'pad-1) - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-menu") ) (else (set! *external-cam-mode* #f) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") ) ) ) @@ -467,7 +483,7 @@ (-> (current-frame) debug-buf) (-> (current-frame) global-buf) )) - (bucket-id debug-draw0)) + (bucket-id debug)) (show-iop-memory dma-buff) ) ) @@ -503,12 +519,12 @@ ) ;; spawn a process that blacks out the screen, turns things off, and kills the game. - (if (make-function-process process :stack *scratch-memory-top* + (if (process-spawn-function process :stack *scratch-memory-top* (lambda :behavior process () (set-blackout-frames (seconds 100)) (set! (-> *setting-control* default allow-pause) #f) (set! (-> *setting-control* default allow-progress) #f) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (set! (-> *setting-control* default sfx-volume) 0.0) (set! (-> *setting-control* default music-volume) 0.0) (set! (-> *setting-control* default dialog-volume) 0.0) @@ -583,11 +599,11 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Pre loop initialization ;;;;;;;;;;;;;;;;;;;;;;;;;;;; - + ;; the size is 0, so this doesn't actually do anything. ;; (dma-send-to-spr (the-as uint #x70000000) (the-as uint *terrain-context*) (the-as uint 0) #t) (set! *teleport* #t) - (update-per-frame-settings! *setting-control*) + (update *setting-control*) (init-time-of-day-context *time-of-day-context*) (display-sync disp) (swap-display disp) @@ -595,100 +611,113 @@ (blerc-init) ;; collide dma (suspend) - - + + (while *run* ;; start immediately after all process updates finish. - + (profiler-instant-event "display-loop-top") + ;; drawing effects to be used in foreground drawing. - (blerc-execute) - (blerc-init) - (texscroll-execute) - (ripple-execute) - + (with-profiler "foreground-effects" + (blerc-execute) + (blerc-init) + (texscroll-execute) + (ripple-execute) + ) + ;;;;;;;;;;;;;;;;;;;; ;; AMBIENT ;;;;;;;;;;;;;;;;;;;; - + ;; set defaults for weather/music/flava. - (set! *weather-off* #f) - (let ((v1-13 (-> *game-info* current-continue level))) - (dotimes (a0-8 (-> *level* length)) - (let ((a1-6 (-> *level* level a0-8))) - (when (= (-> a1-6 status) 'active) - (if (and (= (-> a1-6 name) v1-13) (-> *level* play?)) - (set! (-> *setting-control* default music) (-> a1-6 info music-bank)) - ) + (with-profiler "ambients" + (set! *weather-off* #f) + (let ((v1-13 (-> *game-info* current-continue level))) + (dotimes (a0-8 (-> *level* length)) + (let ((a1-6 (-> *level* level a0-8))) + (when (= (-> a1-6 status) 'active) + (if (and (= (-> a1-6 name) v1-13) (-> *level* play?)) + (set! (-> *setting-control* default music) (-> a1-6 info music-bank)) + ) + ) ) ) ) - ) - - (set! (-> *setting-control* default sound-flava) (the-as uint 49)) - (set! (-> *setting-control* default sound-flava-priority) 0.0) - - ;; find any ambients, and execute them. - (when (and *execute-ambients* (not (paused?))) - (if *target* - (set! (-> *target* draw secondary-interp) 0.0) - ) - (let ((s5-1 (sphere<-vector+r! (new 'stack 'sphere) (ear-trans) 0.0))) - (let ((v1-28 (scratchpad-object terrain-context))) - (set! (-> v1-28 work ambient ambient-list num-items) 0) - ) - (dotimes (s4-1 (-> *level* length)) - (let ((v1-32 (-> *level* level s4-1))) - (when (= (-> v1-32 status) 'active) - (collect-ambients (-> v1-32 bsp) s5-1 0 (-> (scratchpad-object terrain-context) work ambient ambient-list)) - ) + + (set! (-> *setting-control* default sound-flava) (the-as uint 49)) + (set! (-> *setting-control* default sound-flava-priority) 0.0) + + ;; find any ambients, and execute them. + (when (and *execute-ambients* (not (paused?))) + (if *target* + (set! (-> *target* draw secondary-interp) 0.0) + ) + (let ((s5-1 (sphere<-vector+r! (new 'stack 'sphere) (ear-trans) 0.0))) + (let ((v1-28 (scratchpad-object terrain-context))) + (set! (-> v1-28 work ambient ambient-list num-items) 0) + ) + (dotimes (s4-1 (-> *level* length)) + (let ((v1-32 (-> *level* level s4-1))) + (when (= (-> v1-32 status) 'active) + (collect-ambients (-> v1-32 bsp) s5-1 0 (-> (scratchpad-object terrain-context) work ambient ambient-list)) + ) + ) + ) + + (countdown (s4-2 (-> (scratchpad-object terrain-context) work ambient ambient-list num-items)) + (execute-ambient (-> (scratchpad-object terrain-context) work ambient ambient-list items s4-2) s5-1) ) - ) - - (countdown (s4-2 (-> (scratchpad-object terrain-context) work ambient ambient-list num-items)) - (execute-ambient (-> (scratchpad-object terrain-context) work ambient ambient-list items s4-2) s5-1) ) ) ) (add-ee-profile-frame 'draw :r #x40 :b #x40) ;; actor update - + ;; do math, before drawing - (execute-math-engine) + (with-profiler "math-engine" (execute-math-engine)) ;; DEBUG PROF (add-ee-profile-frame 'draw :r #x80) (add-ee-profile-frame 'draw :r #x40 :b #x40) ;; debug hook - (*debug-hook*) - (main-cheats) + (with-profiler "debug" (*debug-hook*) (main-cheats)) (add-ee-profile-frame 'draw :r #x20 :g #x20) - (update-camera) + (with-profiler "camera" (update-camera)) (add-ee-profile-frame 'draw :r #x40 :b #x40) - (*draw-hook*) + (with-profiler "draw-hook" (*draw-hook*)) (add-ee-profile-frame 'draw :g #x80) - (*menu-hook*) - (add-ee-profile-frame 'draw :g #x40) + (with-profiler "menu" + (with-pc + (if (and (-> *pc-settings* display-sha) *debug-segment*) + (draw-build-revision))) - ;; finally, update hints/text - (make-current-level-available-to-progress) - (update-task-hints) - (load-level-text-files -1) + (*menu-hook*) + (add-ee-profile-frame 'draw :g #x40) - (add-ee-profile-frame 'unknown-cpu-time) - ;; collect perf stats - (read! (-> *perf-stats* data (perf-stat-bucket all-code))) + ;; finally, update hints/text + (make-current-level-available-to-progress) + (update-task-hints) + (load-level-text-files -1) - (when (nonzero? (sync-path 0 0)) - (*dma-timeout-hook*) - (reset-vif1-path) - (if *debug-segment* - (format 0 "profile bar at ~D.~%" (-> (current-frame) profile-bar 1 profile-frame-count)) - ) + (add-ee-profile-frame 'unknown-cpu-time) + ;; collect perf stats + (read! (-> *perf-stats* data (perf-stat-bucket all-code))) + ) + + (with-profiler "dma-sync" + (when (nonzero? (sync-path 0 0)) + (*dma-timeout-hook*) + (reset-vif1-path) + (if *debug-segment* + (format 0 "profile bar at ~D.~%" (-> (current-frame) profile-bar 1 profile-frame-count)) + ) + ) + (reset! (-> *perf-stats* data (perf-stat-bucket all-code))) ) - (reset! (-> *perf-stats* data (perf-stat-bucket all-code))) ;; depth cue ;; screen filter + (with-profiler "post-sync-draw" ;; add letterbox effect (when (or (movie?) (< (-> *display* base-frame-counter) (-> *game-info* letterbox-time))) (if (< (-> *game-info* letterbox-time) (-> *display* base-frame-counter)) @@ -736,7 +765,7 @@ ;; debug dma (with-dma-buffer-add-bucket ((debug-buf (-> disp frames (-> disp on-screen) frame debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (when *display-profile* (dma-buffer-add-gs-set debug-buf (alpha-1 (new 'static 'gs-alpha :b 1 :d 1)) @@ -774,14 +803,13 @@ (draw-string-xy (string-format "Actor Bank: ~,,1m/~,,1m (~D)" (-> *ACTOR-bank* pause-dist) (-> *ACTOR-bank* birth-dist) (-> *ACTOR-bank* birth-max)) debug-buf 512 (- 224 8) (font-color default) (font-flags shadow kerning right)) ) (when (-> *pc-settings* display-bug-report) - (format *stdcon* "bug-report ~A~%" *user*) + (format *stdcon* "~0kbug-report ~A~%" *user*) (format *stdcon* "nick ~A continue ~S~%" (-> *load-state* vis-nick) (-> *game-info* current-continue name)) (dotimes (i LEVEL_COUNT) (format *stdcon* "level ~D ~12A ~A~%" i (-> *level* level i name) (-> *level* level i display?)) ) - (format *stdcon* "music ~A (f: ~D/~S) sound ~A ~A~%" - (-> *setting-control* current music) (-> *setting-control* current sound-flava) (enum->string music-flava (-> *setting-control* default sound-flava)) - *sound-bank-1* *sound-bank-2*) + (format *stdcon* "music ~A (f: ~D/~S)~%" (-> *setting-control* current music) (-> *setting-control* current sound-flava) (enum->string music-flava (-> *setting-control* default sound-flava))) + (format *stdcon* "sound ~A ~A~%" *sound-bank-1* *sound-bank-2*) (let ((pos (target-pos 0))) (format *stdcon* "target ~m ~m ~m~%" (-> pos x) (-> pos y) (-> pos z)) ) @@ -792,6 +820,7 @@ (matrix->quaternion rot (-> *math-camera* camera-rot)) (format *stdcon* "cam-rot ~f ~f ~f ~f~%" (-> rot x) (-> rot y) (-> rot z) (-> rot w)) ) + (format *stdcon* "~1k") ) (when (-> *pc-settings* display-heap-status) (draw-memory-bar-kheap debug-buf global :idx 0 :color (static-rgba 32 32 255 64)) @@ -837,7 +866,7 @@ (-> disp frames (-> disp on-screen) frame debug-buf) (-> disp frames (-> disp on-screen) frame global-buf) )) - (bucket-id debug-draw0)) + (bucket-id debug)) (if (and (= *master-mode* 'pause) (!= *cheat-mode* 'camera)) (draw-string-xy (lookup-text! *common-text* (game-text-id pause) #f) s3-1 256 160 (font-color orange-red) (font-flags shadow kerning middle large)) @@ -878,12 +907,13 @@ ;; console buffers (set! *stdcon* (clear *stdcon0*)) + ) ;; <--------------------------- SWAP DISPLAY! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - (swap-display disp) + (with-profiler "swap-display" (swap-display disp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - + (set! (-> *time-of-day-context* title-updated) #f) (set! *teleport* #f) (when (nonzero? *teleport-count*) @@ -893,21 +923,26 @@ ;; perf stats - (process-particles) - + (with-profiler "process-particles" (process-particles)) ;; vif0 collide ;; swap sound ;; str play - (swap-sound-buffers (ear-trans) (camera-pos) (camera-angle)) - (str-play-kick) - (level-update *level*) ;; also updates settings. - (mc-run) - (auto-save-check) + (with-profiler "sound-update" + (swap-sound-buffers (ear-trans) (camera-pos) (camera-angle)) + (str-play-kick) + ) + + (with-profiler "level-and-save" + (level-update *level*) ;; also updates settings. + (mc-run) + (auto-save-check) + + (#when PC_PORT + (update *pc-settings*) + ) + ) - (#when PC_PORT - (update *pc-settings*) - ) ;; suspend (suspend) @@ -928,8 +963,8 @@ ) ) (set! *run* #t) - (let ((new-dproc (make-function-process process display-loop :name 'display - :from *4k-dead-pool* :to *display-pool*))) + (let ((new-dproc (process-spawn-function process display-loop :name 'display + :from *4k-dead-pool* :to *display-pool*))) (set! *dproc* (the process (ppointer->process new-dproc))) ) (cond diff --git a/goal_src/engine/game/powerups.gc b/goal_src/engine/game/powerups.gc index 1a05e3a145..dd985f9b6d 100644 --- a/goal_src/engine/game/powerups.gc +++ b/goal_src/engine/game/powerups.gc @@ -46,7 +46,7 @@ ) (cond ((zero? arg5) - (while #t + (loop (suspend) ) ) @@ -66,8 +66,7 @@ ) (defpart 255 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -85,8 +84,7 @@ ) (defpart 256 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -104,8 +102,7 @@ ) (defpart 257 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 1.0 3.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) @@ -124,8 +121,7 @@ ) (defpart 259 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.0 3.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) @@ -144,8 +140,7 @@ ) (defpart 258 - :init-specs - ((sp-flt spt-r 64.0) + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) (sp-flt spt-fade-r -1.0) (sp-flt spt-fade-g -0.4) @@ -154,8 +149,7 @@ ) (defpart 260 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -177,13 +171,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 261) (sp-item 262) (sp-item 263 :flags (is-3d)) (sp-item 264) (sp-item 265 :flags (is-3d))) + :parts ((sp-item 261) (sp-item 262) (sp-item 263 :flags (is-3d)) (sp-item 264) (sp-item 265 :flags (is-3d))) ) (defpart 264 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 32.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-scale-x (meters 1) (meters 3) 1.0) @@ -206,8 +198,7 @@ ) (defpart 266 - :init-specs - ((sp-flt spt-r 0.0) + :init-specs ((sp-flt spt-r 0.0) (sp-rnd-flt spt-g 32.0 32.0 1.0) (sp-rnd-flt spt-b 192.0 63.0 1.0) (sp-rnd-int spt-a 0 63 1.0) @@ -217,8 +208,7 @@ ) (defpart 265 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.5)) (sp-flt spt-scale-x (meters 0)) @@ -237,13 +227,11 @@ ) (defpart 267 - :init-specs - ((sp-flt spt-fade-a -2.1333334)) + :init-specs ((sp-flt spt-fade-a -2.1333334)) ) (defpart 263 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.5)) (sp-flt spt-scale-x (meters 0)) @@ -263,13 +251,11 @@ ) (defpart 268 - :init-specs - ((sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-a -1.4222223)) ) (defpart 261 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -293,8 +279,7 @@ ) (defpart 262 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -318,8 +303,7 @@ ) (defpart 269 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -337,8 +321,7 @@ ) (defpart 270 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -356,8 +339,7 @@ ) (defpart 271 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.5 2.0 1.0) (sp-flt spt-y (meters -0.05)) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) @@ -384,13 +366,11 @@ ) (defpart 272 - :init-specs - ((sp-flt spt-fade-r 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0)) ) (defpart 273 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -408,8 +388,7 @@ ) (defpart 274 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -427,8 +406,7 @@ ) (defpart 275 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.5 2.0 1.0) (sp-flt spt-y (meters -0.05)) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) @@ -455,13 +433,11 @@ ) (defpart 276 - :init-specs - ((sp-flt spt-fade-r 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0)) ) (defpart 277 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -479,8 +455,7 @@ ) (defpart 278 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -498,8 +473,7 @@ ) (defpart 279 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.5 2.0 1.0) (sp-flt spt-y (meters -0.05)) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) @@ -526,28 +500,13 @@ ) (defpart 280 - :init-specs - ((sp-flt spt-fade-g 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0)) ) -(defun eco-blue-glow ((arg0 vector)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 255) - arg0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) +(defun eco-blue-glow ((origin vector)) + (launch-particles (-> *part-id-table* 255) origin) (if (rand-vu-percent? 0.5) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 257) - arg0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 257) origin) ) 0 (none) @@ -582,14 +541,7 @@ ) (rand-vu-percent? 0.5) ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2391) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2391) gp-0) ) ) (let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 70)))) @@ -603,40 +555,25 @@ ) (rand-vu-percent? 0.5) ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2391) - gp-1 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2391) gp-1) ) ) - (let ((f0-8 (lerp-scale 60.0 90.0 (-> self control unknown-float01) 0.0 81920.0))) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 104) - ) - ) - (set! f0-8 (* 0.75 f0-8)) + ;; PAL patch here + (let ((f0-8 (lerp-scale 80.0 100.0 (-> self control unknown-float01) 0.0 81920.0))) + (if (not (ja-group? (-> self draw art-group data 104))) + (set! f0-8 (* 0.8 f0-8)) ) - (set! (-> self control unknown-float141) - (seek (-> self control unknown-float141) f0-8 (* 100.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self control unknown-float141) f0-8 (* 100.0 (-> *display* seconds-per-frame))) ) (let ((f30-0 (-> self control unknown-float141)) (f0-13 (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 81920.0)) ) - (sound-play-by-name - (static-sound-name "ice-loop") - (-> self control unknown-soundid00) - (the int (* 10.24 f30-0)) - (the int (* 1524.0 f0-13)) - 0 - 1 - (the-as symbol (-> self control trans)) + (sound-play + "ice-loop" + :id (-> self control unknown-soundid00) + :vol f30-0 + :pitch f0-13 + :position (the-as symbol (-> self control trans)) ) ) ) @@ -648,7 +585,7 @@ (set! (-> v1-64 parms volume) -4) (set! (-> v1-64 auto-time) 48) (set! (-> v1-64 auto-from) 2) - (set! (-> v1-64 parms mask) (the-as uint 17)) + (set! (-> v1-64 parms mask) (sound-mask volume time)) (-> v1-64 id) ) ) @@ -667,12 +604,12 @@ ) (set! (-> self fact-info-target eco-level) 0.0) (set! (-> self fact-info-target eco-timeout) 0) - (set! (-> self state-flags) (logand -65 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags invuln-powerup)) (send-event self 'reset-collide) (stop! (-> self sound)) ) (when (and (< 0.0 (-> self fact-info-target eco-level)) - (zero? (logand (-> self state-flags) 512)) + (zero? (logand (-> self state-flags) (state-flags first-person-mode))) (zero? (logand (-> self draw status) (draw-status hidden no-anim))) (not (movie?)) (rand-vu-percent? @@ -692,29 +629,15 @@ (((pickup-type eco-yellow)) (change-sound! (-> self sound) (static-sound-name "yel-eco-jak")) (let ((s4-0 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* (if (rand-vu-percent? 0.5) - 269 - 270 - ) - ) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-0)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* (if (rand-vu-percent? 0.5) 269 270)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-0)) + ) ) (dotimes (gp-4 2) (let ((v1-111 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 271) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-111)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 271) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-111)) + ) ) ) ) @@ -730,29 +653,15 @@ (update-transforms! (-> self control)) (change-sound! (-> self sound) (static-sound-name "red-eco-jak")) (let ((s4-2 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* (if (rand-vu-percent? 0.5) - 273 - 274 - ) - ) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-2)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* (if (rand-vu-percent? 0.5) 273 274)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-2)) + ) ) (dotimes (gp-6 2) (let ((v1-139 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 275) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-139)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 275) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-139)) + ) ) ) ) @@ -760,7 +669,9 @@ (change-sound! (-> self sound) (static-sound-name "blue-eco-jak")) (let ((v1-150 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) (cond - ((and (logtest? (-> self control unknown-surface00 flags) 2048) (zero? (logand (-> self control status) 1))) + ((and (logtest? (-> self control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + ) (set! (-> *part-id-table* 259 init-specs 4 initial-valuef) 0.0) (set! (-> *part-id-table* 259 init-specs 4 random-rangef) 65536.0) ) @@ -769,77 +680,35 @@ (set! (-> *part-id-table* 259 init-specs 4 random-rangef) 16384.0) ) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 259) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-150)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 259) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-150)) +) ) (let ((gp-8 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* (if (rand-vu-percent? 0.5) - 255 - 256 - ) - ) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* (if (rand-vu-percent? 0.5) 255 256)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8)) + ) (if (rand-vu-percent? 0.5) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 257) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 257) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8)) + ) ) ) (let ((v1-168 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 260) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-168)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 260) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-168)) + ) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 1 (seconds 0.1)) ) (((pickup-type eco-green)) (change-sound! (-> self sound) (static-sound-name "green-eco-jak")) (let ((s4-8 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* (if (rand-vu-percent? 0.5) - 277 - 278 - ) - ) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-8)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* (if (rand-vu-percent? 0.5) 277 278)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-8))) ) (dotimes (gp-11 2) (let ((v1-188 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 279) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-188)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 279) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-188))) ) ) ) diff --git a/goal_src/engine/game/projectiles-h.gc b/goal_src/engine/game/projectiles-h.gc index 5c6644faae..63f8bac978 100644 --- a/goal_src/engine/game/projectiles-h.gc +++ b/goal_src/engine/game/projectiles-h.gc @@ -6,7 +6,7 @@ ;; dgos: GAME, ENGINE (declare-type projectile process-drawable) -(define-extern projectile-init-by-other (function entity vector vector uint handle none :behavior projectile)) ;; 4th arg is `options`, 5th is `last-target` +(define-extern projectile-init-by-other (function entity-actor vector vector uint handle none :behavior projectile)) ;; 4th arg is `options`, 5th is `last-target` ;; DECOMP BEGINS diff --git a/goal_src/engine/game/projectiles.gc b/goal_src/engine/game/projectiles.gc index 04f8047adb..2b02743888 100644 --- a/goal_src/engine/game/projectiles.gc +++ b/goal_src/engine/game/projectiles.gc @@ -4,6 +4,7 @@ ;; name: projectiles.gc ;; name in dgo: projectiles ;; dgos: GAME, ENGINE +;; note: changed for high fps ;; DECOMP BEGINS @@ -142,7 +143,7 @@ (set! sv-80 (logior sv-80 16)) ) (set! sv-224 (< (fabs (-> arg0 surface-angle)) (-> *pat-mode-info* (-> arg0 cur-pat mode) wall-angle))) - (if (zero? (logand (-> arg0 prev-status) 1)) + (if (zero? (logand (-> arg0 prev-status) (cshape-moving-flags onsurf))) (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) ) (set! sv-80 (logior sv-80 4)) @@ -170,15 +171,14 @@ ) ) (logior! (-> arg0 status) sv-80) - (the-as uint sv-80) + (the-as cshape-moving-flags sv-80) ) (defpartgroup group-yellow-eco-fireball :id 102 :duration 300 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 349 :flags (launch-asap) :binding 350) + :parts ((sp-item 349 :flags (launch-asap) :binding 350) (sp-item 350 :flags (start-dead launch-asap) :binding 351) (sp-item 351 :flags (start-dead launch-asap) :binding 352) (sp-item 352 :flags (start-dead) :binding 353) @@ -216,8 +216,7 @@ ) (defpart 349 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.01)) (sp-copy-from-other spt-scale-y -4) @@ -229,8 +228,7 @@ ) (defpart 350 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 16) 1.0) @@ -249,8 +247,7 @@ ) (defpart 351 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 0)) @@ -269,8 +266,7 @@ ) (defpart 352 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -288,8 +284,7 @@ ) (defpart 353 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-y (meters -0.05)) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) @@ -316,16 +311,14 @@ ) (defpart 354 - :init-specs - ((sp-flt spt-fade-r 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0)) ) (defpartgroup group-part-yellow-eco-fireball-launcher :id 103 :duration 600 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 355 :flags (launch-asap)) + :parts ((sp-item 355 :flags (launch-asap)) (sp-item 356 :flags (bit1) :period 630 :length 15) (sp-item 357 :flags (launch-asap)) (sp-item 358 :flags (launch-asap) :binding 359) @@ -349,8 +342,7 @@ ) (defpart 355 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 8)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -368,8 +360,7 @@ ) (defpart 357 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-x (meters -0.6) (meters 1.2) 1.0) (sp-rnd-flt spt-y (meters -0.6) (meters 1.2) 1.0) @@ -393,8 +384,7 @@ ) (defpart 356 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -417,8 +407,7 @@ ) (defpart 360 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 24.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -441,8 +430,7 @@ ) (defpart 358 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-scale-x (meters 0.1)) (sp-copy-from-other spt-scale-y -4) @@ -458,8 +446,7 @@ ) (defpart 361 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 32.0) (sp-flt spt-scale-x (meters 0.1)) (sp-copy-from-other spt-scale-y -4) @@ -475,8 +462,7 @@ ) (defpart 359 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.1) (meters 0.2) 1.0) @@ -504,8 +490,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 2059 :period 600 :length 5) + :parts ((sp-item 2059 :period 600 :length 5) (sp-item 2060 :fade-after (meters 80) :falloff-to (meters 80) :period 600 :length 40) (sp-item 2061 :period 600 :length 20) (sp-item 2062 :fade-after (meters 120) :falloff-to (meters 120) :period 600 :length 20) @@ -513,8 +498,7 @@ ) (defpart 2060 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -538,13 +522,11 @@ ) (defpart 2063 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) ) (defpart 2062 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-scale-x (meters 0.2)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) @@ -561,8 +543,7 @@ ) (defpart 2059 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 16)) (sp-copy-from-other spt-scale-y -4) @@ -577,8 +558,7 @@ ) (defpart 2061 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -604,8 +584,7 @@ ) (defpart 2064 - :init-specs - ((sp-flt spt-fade-r -0.53333336) + :init-specs ((sp-flt spt-fade-r -0.53333336) (sp-flt spt-fade-g -0.53333336) (sp-flt spt-fade-b -1.0666667) (sp-flt spt-fade-a -0.53333336) @@ -625,24 +604,13 @@ (defstate projectile-moving (projectile) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touched) (when (-> self attack-mode) (when (cond ((= (-> arg0 type) target) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'attack) - (set! (-> a1-1 param 0) (-> arg3 param 0)) - (let ((a0-4 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-4 mode) (-> self attack-mode)) - (set! (-> a1-1 param 1) (the-as uint a0-4)) - ) - (send-event-function arg0 a1-1) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode (-> self attack-mode))))) ) (else (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -677,13 +645,11 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 #f)) (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (-> self timeout)) (let ((s5-0 (the int (-> *display* time-ratio)))) @@ -695,14 +661,14 @@ (dummy-28 self) ((-> self update-velocity) self) (when (logtest? (-> self options) 2) - (set! (-> self tween) (seek (-> self tween) 1.0 (* 0.5 (-> *display* seconds-per-frame)))) + (seek! (-> self tween) 1.0 (* 0.5 (-> *display* seconds-per-frame))) (let ((f0-6 (vector-vector-distance (-> self root-override trans) (-> self target)))) (cond ((< f0-6 20480.0) - (set! (-> self tween) (seek (-> self tween) 1.0 (* 3.0 (-> *display* seconds-per-frame)))) + (seek! (-> self tween) 1.0 (* 3.0 (-> *display* seconds-per-frame))) ) ((< f0-6 40960.0) - (set! (-> self tween) (seek (-> self tween) 1.0 (-> *display* seconds-per-frame))) + (seek! (-> self tween) 1.0 (-> *display* seconds-per-frame)) ) ) ) @@ -723,7 +689,10 @@ (countdown (v1-35 16) (+! f0-16 (-> self old-dist v1-35)) ) - (if (or (and (logtest? (-> self root-override status) 8) (< f0-16 2048.0)) (< f0-16 204.8)) + ;; changed for high fps. This fixes projectile collision issues + (if (or (and (logtest? (-> self root-override status) (cshape-moving-flags twall)) (< f0-16 (* (-> *display* time-adjust-ratio) 2048.0))) + (< f0-16 (* (-> *display* time-adjust-ratio) 204.8)) + ) (set! gp-0 #t) ) ) @@ -745,7 +714,7 @@ (s3-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0)) (f30-0 (vector-length (-> arg0 root-override transv))) ) - (if (logtest? (-> arg0 root-override status) 4) + (if (logtest? (-> arg0 root-override status) (cshape-moving-flags tsurf)) (vector-flatten! s5-1 s5-1 (-> arg0 root-override local-normal)) ) (vector-normalize-copy! s4-0 s5-1 1.0) @@ -777,30 +746,22 @@ (defstate projectile-impact (projectile) :virtual #t - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 104) - -1 - #f - #f - #f - (-> self root-override root-prim prim-core) - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 104) + -1 + #f + #f + #f + (-> self root-override root-prim prim-core) + :to *entity-pool* ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "yellow-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "yellow-explode") (suspend) (go-virtual projectile-die) (none) @@ -809,30 +770,22 @@ (defstate projectile-dissipate (projectile) :virtual #t - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 104) - -1 - #f - #f - #f - (-> self root-override root-prim prim-core) - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 104) + -1 + #f + #f + #f + (-> self root-override root-prim prim-core) + :to *entity-pool* ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "yellow-fizzle") (new-sound-id) 1024 0 0 1 #t) + (sound-play "yellow-fizzle") (suspend) (go-virtual projectile-die) (none) @@ -877,8 +830,7 @@ (defstate projectile-die (projectile) :virtual #t - :code - (behavior () + :code (behavior () (let ((v1-0 (-> self notify-handle))) (if (handle->process v1-0) (send-event (-> v1-0 process 0) 'notify 'die) @@ -897,7 +849,7 @@ (none) ) -(defbehavior projectile-init-by-other projectile ((arg0 entity) (arg1 vector) (arg2 vector) (arg3 uint) (arg4 handle)) +(defbehavior projectile-init-by-other projectile ((arg0 entity-actor) (arg1 vector) (arg2 vector) (arg3 uint) (arg4 handle)) (stack-size-set! (-> self main-thread) 512) (set! (-> self entity) arg0) (set! (-> self attack-mode) #f) @@ -968,19 +920,11 @@ (set! (-> *part-id-table* 358 init-specs 11 initial-valuef) (the float (sar (shl (the int (+ -16384.0 f30-0)) 48) 48)) ) - (sound-play-by-name (static-sound-name "yellow-fire") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj sound-id) (sound-play-by-name (static-sound-name "yellow-buzz") (new-sound-id) 1024 0 0 1 #t)) - (when (zero? (logand (-> obj options) 416)) - (let ((s4-2 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-2 - (let ((t9-10 (method-of-type part-tracker activate))) - (t9-10 (the-as part-tracker s4-2) obj 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s4-2 part-tracker-init (-> *part-group-id-table* 103) -1 #f #f #f s5-0) - (-> s4-2 ppointer) - ) + (sound-play "yellow-fire") + (set! (-> obj sound-id) (sound-play "yellow-buzz")) + (if (zero? (logand (-> obj options) 416)) + (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 103) -1 #f #f #f s5-0 :to obj) ) - ) (set! (-> *part-id-table* 350 init-specs 2 initial-valuef) f30-0) ) ) @@ -989,7 +933,7 @@ (case (-> *target* current-level name) (('swamp) (set! (-> obj water) (new 'process 'water-control obj 0 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (the-as uint 146)) + (set! (-> obj water flags) (water-flags wt01 wt04 wt07)) (set! (-> obj water height) (if (logtest? (-> obj options) 64) 8192.0 10240.0 @@ -1000,7 +944,7 @@ (('ogre) (when (zero? (logand (-> obj options) 128)) (set! (-> obj water) (new 'process 'water-control obj 0 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (the-as uint 146)) + (set! (-> obj water flags) (water-flags wt01 wt04 wt07)) (set! (-> obj water height) 129024.0) (logior! (-> obj root-override root-prim collide-with) (collide-kind water)) ) @@ -1008,7 +952,7 @@ (('finalboss) (set! (-> obj root-override trans y) (+ 4096.0 (-> obj root-override trans y))) (set! (-> obj water) (new 'process 'water-control obj 0 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (the-as uint 146)) + (set! (-> obj water flags) (water-flags wt01 wt04 wt07)) (set! (-> obj water height) 1977958.4) (logior! (-> obj root-override root-prim collide-with) (collide-kind water)) ) @@ -1033,7 +977,7 @@ (-> obj root-override shadow-pos) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 12288.0 81920.0 ) @@ -1072,7 +1016,7 @@ ) (sound-trans-convert (-> s5-0 parms trans) a1-3) ) - (set! (-> s5-0 parms mask) (the-as uint 32)) + (set! (-> s5-0 parms mask) (sound-mask trans)) (-> s5-0 id) ) 0 @@ -1161,7 +1105,7 @@ (defmethod dummy-27 projectile-blue ((obj projectile-blue)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) - (sound-play-by-name (static-sound-name "blue-eco-on") (new-sound-id) 1024 0 0 1 #t) + (sound-play "blue-eco-on") (set! (-> obj mode) 2) (set! (-> obj max-speed) (-> *TARGET-bank* yellow-projectile-speed)) (set! (-> obj update-velocity) projectile-update-velocity-space-wars) @@ -1211,7 +1155,7 @@ ) (defun spawn-projectile-blue ((arg0 target)) - (local-vars (sv-48 entity)) + (local-vars (sv-48 entity-actor)) (with-pp (when arg0 (let ((s3-0 (rand-vu-int-range 3 (+ (-> arg0 node-list length) -1))) @@ -1287,8 +1231,7 @@ (defstate projectile-impact (projectile-blue) :virtual #t - :code - (behavior () + :code (behavior () (cleanup-for-death self) (none) ) @@ -1296,8 +1239,7 @@ (defstate projectile-dissipate (projectile-blue) :virtual #t - :code - (behavior () + :code (behavior () (go-virtual projectile-die) (none) ) diff --git a/goal_src/engine/game/settings-h.gc b/goal_src/engine/game/settings-h.gc index 140b21d440..a6a8005ff1 100644 --- a/goal_src/engine/game/settings-h.gc +++ b/goal_src/engine/game/settings-h.gc @@ -121,22 +121,99 @@ :flag-assert #xe00000278 (:methods (new (symbol type int) _type_ 0) - (push-setting! (_type_ process symbol object object object) none 9) - (set-setting! (_type_ process symbol symbol float int) none 10) - (clear-pending-settings-from-process (_type_ process symbol) none 11) - (copy-settings-from-target! (_type_) setting-data 12) - (update-per-frame-settings! (_type_) setting-data 13) + (add-setting (_type_ process symbol object object object) none 9) + (set-setting (_type_ process symbol object object object) none 10) + (remove-setting (_type_ process symbol) none 11) + (apply-settings (_type_) setting-data 12) + (update (_type_) setting-data 13) ) ) (defmethod new setting-control ((allocation symbol) (type-to-make type) (max-connections int)) "Allocate a new setting-control and its engine" - (local-vars (s4-0 setting-control)) - (set! s4-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))) - (set! (-> s4-0 engine) - ((method-of-type engine new) allocation engine 'setting-control max-connections) + (let ((s4-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s4-0 engine) ((method-of-type engine new) allocation engine 'setting-control max-connections)) + s4-0 + ) + ) + +(defmacro setting-control-func! (func s &rest args) + (let ((argb #f) + (argi 0) + (argf 0.0) + (setting (car s))) + (cond + ; ((or (eq? setting 'border-mode) + ; (eq? setting 'allow-look-around) + ; (eq? setting 'ocean-off) + ; (eq? setting 'music) + ; (eq? setting 'vibration) + ; (eq? setting 'auto-save) + ; (eq? setting 'allow-pause) + ; (eq? setting 'allow-progress) + ; (eq? setting 'play-hints) + ; (eq? setting 'movie) + ; (eq? setting 'talking) + ; (eq? setting 'spooling) + ; (eq? setting 'hint) + ; (eq? setting 'ambient) + ; ) + ; (set! argb (car args)) + ; ) + ; ((or (eq? setting 'bg-r) + ; (eq? setting 'bg-g) + ; (eq? setting 'bg-b) + ; (eq? setting 'bg-a) + ; (eq? setting 'bg-a-speed) + ; (eq? setting 'bg-a-force) + ; ) + ; (set! argf (car args)) + ; ) + ; ((or (eq? setting 'language) + ; ) + ; (set! argi (car args)) + ; ) + ; ((or (eq? setting 'sound-flava) + ; ) + ; (set! argi (car args)) + ; (set! argf (cadr args)) + ; ) + ; ((or (eq? setting 'process-mask) + ; (eq? setting 'common-page) + ; ) + ; (set! argb (car args)) + ; (set! argi (cadr args)) + ; ) + ; ((or (eq? setting 'sfx-volume) + ; (eq? setting 'music-volume) + ; (eq? setting 'ambient-volume) + ; (eq? setting 'dialog-volume) + ; (eq? setting 'sfx-volume-movie) + ; (eq? setting 'music-volume-movie) + ; (eq? setting 'ambient-volume-movie) + ; (eq? setting 'dialog-volume-hint) + ; ) + ; (set! argb (car args)) + ; (set! argf (cadr args)) + ; ) + (#t + (set! argb (car args)) + (set! argf (cadr args)) + (set! argi (caddr args)) ) - s4-0 + ) + `(,func *setting-control* (with-pp pp) ,s ,argb ,argf ,argi) + ) + ) + +(defmacro add-setting! (s &rest args) + `(setting-control-func! add-setting ,s ,@args) + ) +(defmacro set-setting! (s &rest args) + `(setting-control-func! set-setting ,s ,@args) + ) +(defmacro remove-setting! (s) + `(remove-setting *setting-control* (with-pp pp) ,s) ) ;; used for memory card time information diff --git a/goal_src/engine/game/settings.gc b/goal_src/engine/game/settings.gc index 46d7ef6e9a..ca2f48ac79 100644 --- a/goal_src/engine/game/settings.gc +++ b/goal_src/engine/game/settings.gc @@ -5,6 +5,9 @@ ;; name in dgo: settings ;; dgos: GAME, ENGINE +(#when PC_PORT + (define *progress-flava* -1) + ) (defmethod update-from-engine setting-data ((obj setting-data) (arg0 engine)) "this goes through the list of desired setting changes in @@ -27,15 +30,15 @@ (set! (-> obj music) (the-as symbol (-> conn param1))) ) (('process-mask) - (case (-> conn param1) + (case (the-as object (-> conn param1)) (('set) - (logior! (-> obj process-mask) (the-as process-mask (-> conn param3))) + (logior! (-> obj process-mask) (the-as int (-> conn param3))) ) (('clear) - (logclear! (-> obj process-mask) (the-as process-mask (-> conn param3))) + (logclear! (-> obj process-mask) (the-as uint (-> conn param3))) ) (('abs) - (set! (-> obj process-mask) (the-as process-mask (-> conn param3))) + (set! (-> obj process-mask) (the-as process-mask (the-as int (-> conn param3)))) ) ) ) @@ -43,90 +46,84 @@ (when (or (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask progress))) (= (get-process conn) (ppointer->process *progress-process*)) ) - (let ((v1-20 (the-as symbol (-> conn param1)))) - (if (= v1-20 'rel) - (set! (-> obj sfx-volume) - (* (* 0.01 (the-as float (-> conn param2))) (-> obj sfx-volume)) - ) - (set! (-> obj sfx-volume) (the-as float (-> conn param2))) - ) + (case (the-as symbol (-> conn param1)) + (('rel) + (set! (-> obj sfx-volume) (* 0.01 (the-as float (-> conn param2)) (-> obj sfx-volume))) + ) + (else + (set! (-> obj sfx-volume) (the-as float (-> conn param2))) + ) ) ) ) (('music-volume) - (let ((v1-25 (the-as symbol (-> conn param1)))) - (if (= v1-25 'rel) - (set! (-> obj music-volume) - (* (* 0.01 (the-as float (-> conn param2))) (-> obj music-volume)) - ) - (set! (-> obj music-volume) (the-as float (-> conn param2))) - ) + (case (the-as symbol (-> conn param1)) + (('rel) + (set! (-> obj music-volume) (* 0.01 (the-as float (-> conn param2)) (-> obj music-volume))) + ) + (else + (set! (-> obj music-volume) (the-as float (-> conn param2))) + ) ) ) (('ambient-volume) - (let ((v1-30 (the-as symbol (-> conn param1)))) - (if (= v1-30 'rel) - (set! (-> obj ambient-volume) - (* (* 0.01 (the-as float (-> conn param2))) (-> obj ambient-volume)) - ) - (set! (-> obj ambient-volume) (the-as float (-> conn param2))) - ) + (case (the-as symbol (-> conn param1)) + (('rel) + (set! (-> obj ambient-volume) (* 0.01 (the-as float (-> conn param2)) (-> obj ambient-volume))) + ) + (else + (set! (-> obj ambient-volume) (the-as float (-> conn param2))) + ) ) ) (('dialog-volume) - (let ((v1-35 (the-as symbol (-> conn param1)))) - (if (= v1-35 'rel) - (set! (-> obj dialog-volume) - (* (* 0.01 (the-as float (-> conn param2))) (-> obj dialog-volume)) - ) - (set! (-> obj dialog-volume) (the-as float (-> conn param2))) - ) + (case (the-as symbol (-> conn param1)) + (('rel) + (set! (-> obj dialog-volume) (* 0.01 (the-as float (-> conn param2)) (-> obj dialog-volume))) + ) + (else + (set! (-> obj dialog-volume) (the-as float (-> conn param2))) + ) ) ) (('sfx-volume-movie) - (let ((v1-40 (the-as symbol (-> conn param1)))) - (if (= v1-40 'rel) - (set! (-> obj sfx-volume-movie) - (* (* 0.01 (the-as float (-> conn param2))) (-> obj sfx-volume-movie)) - ) - (set! (-> obj sfx-volume-movie) (the-as float (-> conn param2))) - ) + (case (the-as symbol (-> conn param1)) + (('rel) + (set! (-> obj sfx-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> obj sfx-volume-movie))) + ) + (else + (set! (-> obj sfx-volume-movie) (the-as float (-> conn param2))) + ) ) ) (('music-volume-movie) - (let ((v1-45 (the-as symbol (-> conn param1)))) - (if (= v1-45 'rel) - (set! (-> obj music-volume-movie) - (* (* 0.01 (the-as float (-> conn param2))) - (-> obj music-volume-movie) - ) - ) - (set! (-> obj music-volume-movie) (the-as float (-> conn param2))) - ) + (case (the-as symbol (-> conn param1)) + (('rel) + (set! (-> obj music-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> obj music-volume-movie))) + ) + (else + (set! (-> obj music-volume-movie) (the-as float (-> conn param2))) + ) ) ) (('ambient-volume-movie) - (let ((v1-50 (the-as symbol (-> conn param1)))) - (if (= v1-50 'rel) - (set! (-> obj ambient-volume-movie) - (* (* 0.01 (the-as float (-> conn param2))) - (-> obj ambient-volume-movie) - ) - ) - (set! (-> obj ambient-volume-movie) (the-as float (-> conn param2))) - ) + (case (the-as symbol (-> conn param1)) + (('rel) + (set! (-> obj ambient-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> obj ambient-volume-movie))) + ) + (else + (set! (-> obj ambient-volume-movie) (the-as float (-> conn param2))) + ) ) ) (('dialog-volume-hint) - (let ((v1-55 (the-as symbol (-> conn param1)))) - (if (= v1-55 'rel) - (set! (-> obj dialog-volume-hint) - (* (* 0.01 (the-as float (-> conn param2))) - (-> obj dialog-volume-hint) - ) - ) - (set! (-> obj dialog-volume-hint) (the-as float (-> conn param2))) - ) + (case (the-as symbol (-> conn param1)) + (('rel) + (set! (-> obj dialog-volume-hint) (* 0.01 (the-as float (-> conn param2)) (-> obj dialog-volume-hint))) + ) + (else + (set! (-> obj dialog-volume-hint) (the-as float (-> conn param2))) + ) ) ) (('sound-flava) @@ -154,7 +151,7 @@ (set! (-> obj bg-a-force) (the-as float (-> conn param2))) ) (('language) - (set! (-> obj language) (the-as language-enum (-> conn param3))) + (set! (-> obj language) (the-as language-enum (the-as int (-> conn param3)))) ) (('vibration) (set! (-> obj vibration) (the-as symbol (-> conn param1))) @@ -187,12 +184,12 @@ (set! (-> obj ambient) (the-as (pointer progress) (-> conn param1))) ) (('common-page) - (case (-> conn param1) + (case (the-as object (-> conn param1)) (('set) (logior! (-> obj common-page) (the-as int (-> conn param3))) ) (('clear) - (logclear! (-> obj common-page) (the-as int (-> conn param3))) + (logclear! (-> obj common-page) (the-as uint (-> conn param3))) ) ) ) @@ -204,48 +201,44 @@ obj ) -(defmethod push-setting! setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) - "Set the setting. The set is linked to this process and will be reverted if the process dies" +(defmethod add-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) + "add a setting for the process." (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) 0 (none) ) -(defmethod set-setting! setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 symbol) (arg3 float) (arg4 int)) - "Replace all settings from this process with this one." - (clear-pending-settings-from-process obj arg0 arg1) +(defmethod set-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) + "(re-)sets a setting for the process." + (remove-setting obj arg0 arg1) (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) 0 (none) ) -(defmethod clear-pending-settings-from-process setting-control ((obj setting-control) (arg0 process) (arg1 symbol)) - "Remove requests to change settings from the given process." +(defmethod remove-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol)) + "remove a setting from the specified process. + if arg1 = #t then remove ALL settings for that process" (when arg0 - (let ((s5-0 (-> obj engine)) - (s4-0 (-> arg0 connection-list next1)) - ) - (while s4-0 - (if - (and - ((method-of-type connection belongs-to-engine?) - (the-as connection s4-0) - s5-0 + (let ((s5-0 (-> obj engine)) + (s4-0 (-> arg0 connection-list next1)) + ) + (while s4-0 + (if (and (belongs-to-engine? (the-as connection s4-0) s5-0) + (or (= arg1 #t) (= arg1 (-> (the-as connection s4-0) param0))) + ) + (move-to-dead (the-as connection s4-0)) + ) + (set! s4-0 (-> s4-0 next1)) ) - (or (= arg1 #t) (= arg1 (-> (the-as connection s4-0) param0))) - ) - ((method-of-type connection move-to-dead) (the-as connection s4-0)) ) - (set! s4-0 (-> s4-0 next1)) - ) ) - ) 0 (none) ) -(defmethod copy-settings-from-target! setting-control ((obj setting-control)) +(defmethod apply-settings setting-control ((obj setting-control)) "Update the current settings. This only updates settings that are 'safe' to do multiple times per frame." (let ((gp-0 (-> obj current))) (let ((s5-0 (-> obj target))) @@ -284,10 +277,10 @@ ) -(defmethod update-per-frame-settings! setting-control ((obj setting-control)) +(defmethod update setting-control ((obj setting-control)) "Do a per-frame update of all settings" ;; compute all settings - (copy-settings-from-target! obj) + (apply-settings obj) ;; now handle the special ones. (let ((gp-0 (-> obj current))) @@ -296,23 +289,38 @@ (when *sound-player-enable* (when (!= (-> gp-0 sfx-volume) (-> s5-1 sfx-volume)) (seek! (-> gp-0 sfx-volume) (-> s5-1 sfx-volume) (* 100.0 (-> *display* seconds-per-frame))) - (sound-set-volume (the-as uint 1) (-> gp-0 sfx-volume)) + (sound-set-volume (sound-group sfx) (-> gp-0 sfx-volume)) ) (when (!= (-> gp-0 music-volume) (-> s5-1 music-volume)) (seek! (-> gp-0 music-volume) (-> s5-1 music-volume) (* 100.0 (-> *display* seconds-per-frame))) - (sound-set-volume (the-as uint 2) (-> gp-0 music-volume)) + (sound-set-volume (sound-group music) (-> gp-0 music-volume)) ) (when (!= (-> gp-0 dialog-volume) (-> s5-1 dialog-volume)) (seek! (-> gp-0 dialog-volume) (-> s5-1 dialog-volume) (* 100.0 (-> *display* seconds-per-frame))) - (sound-set-volume (the-as uint 4) (-> gp-0 dialog-volume)) + (sound-set-volume (sound-group dialog) (-> gp-0 dialog-volume)) ) (when (!= (-> gp-0 ambient-volume) (-> s5-1 ambient-volume)) (seek! (-> gp-0 ambient-volume) (-> s5-1 ambient-volume) (* 100.0 (-> *display* seconds-per-frame))) - (sound-set-volume (the-as uint 16) (-> gp-0 ambient-volume)) + (sound-set-volume (sound-group ambient) (-> gp-0 ambient-volume)) ) ) ;; send language change to the IOP. (when (!= (-> gp-0 language) (-> s5-1 language)) + ;; NOTE : pc port added this + (#when PC_PORT + (cond + ((not *jak1-full-game*) + ) + ((= (language-enum japanese) (-> s5-1 language)) ;; old lang wasnt japanese + (sound-bank-unload (static-sound-name "common")) + (sound-bank-load (static-sound-name "commonj")) + ) + ((= (language-enum japanese) (-> gp-0 language)) ;; old lang was japanese + (sound-bank-unload (static-sound-name "commonj")) + (sound-bank-load (static-sound-name "common")) + ) + ) + ) (set! (-> gp-0 language) (-> s5-1 language)) (set-language (-> gp-0 language)) ) @@ -342,7 +350,10 @@ (set! (-> s5-1 sound-flava) (the-as uint (flava-lookup (-> gp-0 music) (the-as music-flava (-> s5-1 sound-flava))))) (set! (-> gp-0 sound-flava) (-> s5-1 sound-flava)) (if *sound-player-enable* - (sound-set-flava (-> gp-0 sound-flava)) + (#if PC_PORT + (sound-set-flava (if (>= *progress-flava* 0) (the uint *progress-flava*) (-> gp-0 sound-flava))) + (sound-set-flava (-> gp-0 sound-flava)) + ) ) ;; update display settings @@ -449,10 +460,20 @@ (set! (-> gp-0 aspect-ratio) 'aspect4x3) ) ) - (if (zero? *boot-video-mode*) - (set! (-> gp-0 video-mode) 'ntsc) - (set! (-> gp-0 video-mode) 'pal) - ) + (case *boot-video-mode* + ((0) + (set! (-> gp-0 video-mode) 'ntsc) + ) + ((1) + (set! (-> gp-0 video-mode) 'pal) + ) + ((2) + (set! (-> gp-0 video-mode) '100fps) + ) + ((3) + (set! (-> gp-0 video-mode) '150fps) + ) + ) (set! (-> s5-0 sfx-volume) (+ -1.0 (-> gp-0 sfx-volume))) (set! (-> s5-0 music-volume) (+ -1.0 (-> gp-0 music-volume))) (set! (-> s5-0 dialog-volume) (+ -1.0 (-> gp-0 dialog-volume))) diff --git a/goal_src/engine/game/task/hint-control-h.gc b/goal_src/engine/game/task/hint-control-h.gc index 17f595f963..725cdde68a 100644 --- a/goal_src/engine/game/task/hint-control-h.gc +++ b/goal_src/engine/game/task/hint-control-h.gc @@ -5,6 +5,10 @@ ;; name in dgo: hint-control-h ;; dgos: GAME, ENGINE +;; The "hint" system is used to give the player hints if they appear to be stuck +;; Hints can belong to either a level or a task. The hint-control types have +;; parameters about how often the hints should come, and what they are tied to. + (defenum hint-command (if-unknown 0) (if-known 1) @@ -22,21 +26,23 @@ (if-at-most-need-reminder-a 13) ) +;; information about an in-level hint. These aren't tied to a specific object or task. (deftype level-hint-control (structure) - ((delay-before-playing time-frame :offset-assert 0) + ((delay-before-playing time-frame :offset-assert 0) (id game-text-id :offset-assert 8) - (num-attempts-before-playing int8 :offset-assert 12) - (num-success-before-killing int8 :offset-assert 13) - (num-attempts int8 :offset-assert 14) - (num-success int8 :offset-assert 15) - (start-time time-frame :offset-assert 16) - (last-time-called time-frame :offset-assert 24) + (num-attempts-before-playing int8 :offset-assert 12) + (num-success-before-killing int8 :offset-assert 13) + (num-attempts int8 :offset-assert 14) + (num-success int8 :offset-assert 15) + (start-time time-frame :offset-assert 16) + (last-time-called time-frame :offset-assert 24) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) +;; a "task hint" is explicitly tied to an in-game task. (deftype task-hint-control (structure) ((task game-task :offset-assert 0) (delay time-frame :offset-assert 8) diff --git a/goal_src/engine/game/task/hint-control.gc b/goal_src/engine/game/task/hint-control.gc index e24e7d4a9d..d40c3f51e9 100644 --- a/goal_src/engine/game/task/hint-control.gc +++ b/goal_src/engine/game/task/hint-control.gc @@ -5,575 +5,395 @@ ;; name in dgo: hint-control ;; dgos: GAME, ENGINE -;; failed to figure out what this is: -(set! - (-> *game-info* hint-control) - (the-as - (array level-hint-control) - (new - 'static - 'boxed-array - :type level-hint-control :length 25 :allocated-length 25 - (new 'static 'level-hint-control - :id #x917 - :num-attempts-before-playing 1 - :num-success-before-killing 3 - ) - (new 'static 'level-hint-control - :id #x90a - :num-attempts-before-playing 3 - :num-success-before-killing -1 - ) - (new 'static 'level-hint-control - :id #x284 - :num-attempts-before-playing 3 - :num-success-before-killing 3 - ) - (new 'static 'level-hint-control - :id #x285 - :num-attempts-before-playing 1 - :num-success-before-killing 1 - ) - (new 'static 'level-hint-control - :id #x251 - :num-attempts-before-playing 1 - :num-success-before-killing 1 - ) - (new 'static 'level-hint-control - :id #x2af - :num-attempts-before-playing 1 - :num-success-before-killing 1 - ) - (new 'static 'level-hint-control - :delay-before-playing #x384 - :id #x239 - :num-attempts-before-playing 1 - :num-success-before-killing 1 - ) - (new 'static 'level-hint-control - :delay-before-playing #x5dc - :id #x29d - :num-attempts-before-playing 1 - :num-success-before-killing -1 - ) - (new 'static 'level-hint-control - :delay-before-playing #x384 - :id #x25b - :num-attempts-before-playing 1 - :num-success-before-killing -1 - ) - (new 'static 'level-hint-control - :id #x2a4 - :num-attempts-before-playing 3 - :num-success-before-killing 1 - ) - (new 'static 'level-hint-control - :delay-before-playing #x384 - :id #x2aa - :num-attempts-before-playing 1 - :num-success-before-killing 1 - ) - (new 'static 'level-hint-control - :delay-before-playing #x5dc - :id #x33a - :num-attempts-before-playing 1 - :num-success-before-killing 1 - ) - (new 'static 'level-hint-control - :delay-before-playing #x1194 - :id #x34b - :num-attempts-before-playing 3 - :num-success-before-killing 2 - ) - (new 'static 'level-hint-control - :delay-before-playing #x4650 - :id #x34a - :num-attempts-before-playing 3 - :num-success-before-killing -1 - ) - (new 'static 'level-hint-control - :id #x34d - :num-attempts-before-playing 3 - :num-success-before-killing -1 - ) - (new 'static 'level-hint-control - :id #x345 - :num-attempts-before-playing 3 - :num-success-before-killing 2 - ) - (new 'static 'level-hint-control - :id #x352 - :num-attempts-before-playing 1 - :num-success-before-killing 1 - ) - (new 'static 'level-hint-control - :delay-before-playing #x2328 - :id #x347 - :num-attempts-before-playing 3 - :num-success-before-killing 1 - ) - (new 'static 'level-hint-control - :id #x34e - :num-attempts-before-playing 3 - :num-success-before-killing -1 - ) - (new 'static 'level-hint-control - :id #x444 - :num-attempts-before-playing 5 - :num-success-before-killing -1 - ) - (new 'static 'level-hint-control - :delay-before-playing #x384 - :id #x438 - :num-attempts-before-playing 1 - :num-success-before-killing -1 - ) - (new 'static 'level-hint-control - :id #x433 - :num-attempts-before-playing 4 - :num-success-before-killing -1 - ) - (new 'static 'level-hint-control - :id #x70d - :num-attempts-before-playing 1 - :num-success-before-killing 2 - ) - (new 'static 'level-hint-control - :delay-before-playing #x5dc - :id #x806 - :num-attempts-before-playing 1 - :num-success-before-killing 1 - ) - (new 'static 'level-hint-control - :delay-before-playing #x5dc - :id #x809 - :num-attempts-before-playing 1 - :num-success-before-killing 1 - ) - ) - ) - ) +;; DECOMP BEGINS -;; failed to figure out what this is: -(set! - (-> *game-info* task-hint-control) - (new - 'static - 'boxed-array - :type task-hint-control-group :length 16 :allocated-length 16 - (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 3 :allocated-length 3 - (new 'static 'task-hint-control - :task (game-task training-gimmie) - :delay #x2bf20 +(set! (-> *game-info* hint-control) (new 'static 'boxed-array :type level-hint-control + (new 'static 'level-hint-control + :id (game-text-id sage-voicebox-hint-crate-iron) + :num-attempts-before-playing 1 + :num-success-before-killing 3 + ) + (new 'static 'level-hint-control + :id (game-text-id training-more-eco-more-time) + :num-attempts-before-playing 3 + :num-success-before-killing -1 + ) + (new 'static 'level-hint-control + :id (game-text-id sidekick-speech-hint-crate-iron) + :num-attempts-before-playing 3 + :num-success-before-killing 3 + ) + (new 'static 'level-hint-control + :id (game-text-id sidekick-speech-hint-crate-steel) + :num-attempts-before-playing 1 + :num-success-before-killing 1 + ) + (new 'static 'level-hint-control + :id (game-text-id sidekick-hint-orb-cache-top) + :num-attempts-before-playing 1 + :num-success-before-killing 1 + ) + (new 'static 'level-hint-control + :id (game-text-id beach-grottopole-increment) + :num-attempts-before-playing 1 + :num-success-before-killing 1 + ) + (new 'static 'level-hint-control + :delay-before-playing (seconds 3) + :id (game-text-id beach-eco-rock-increment) + :num-attempts-before-playing 1 + :num-success-before-killing 1 + ) + (new 'static 'level-hint-control + :delay-before-playing (seconds 5) + :id (game-text-id jungle-mirrors-break-the-mirror-jak) + :num-attempts-before-playing 1 + :num-success-before-killing -1 + ) + (new 'static 'level-hint-control + :delay-before-playing (seconds 3) + :id (game-text-id jungle-precursorbridge-hint) + :num-attempts-before-playing 1 + :num-success-before-killing -1 + ) + (new 'static 'level-hint-control + :id (game-text-id misty-teetertotter-bonk-dax-tutorial) + :num-attempts-before-playing 3 + :num-success-before-killing 1 + ) + (new 'static 'level-hint-control + :delay-before-playing (seconds 3) + :id (game-text-id misty-bone-bridge-hint) + :num-attempts-before-playing 1 + :num-success-before-killing 1 + ) + (new 'static 'level-hint-control + :delay-before-playing (seconds 5) + :id (game-text-id rolling-dark-plants-hint) + :num-attempts-before-playing 1 + :num-success-before-killing 1 + ) + (new 'static 'level-hint-control + :delay-before-playing (seconds 15) + :id (game-text-id sunken-bully-dive-hint) + :num-attempts-before-playing 3 + :num-success-before-killing 2 + ) + (new 'static 'level-hint-control + :delay-before-playing (seconds 60) + :id (game-text-id sunken-qbert-plat-hint) + :num-attempts-before-playing 3 + :num-success-before-killing -1 + ) + (new 'static 'level-hint-control + :id (game-text-id sunken-blue-eco-charger-all-hint) + :num-attempts-before-playing 3 + :num-success-before-killing -1 + ) + (new 'static 'level-hint-control + :id (game-text-id sunken-blue-eco-charger-hint) + :num-attempts-before-playing 3 + :num-success-before-killing 2 + ) + (new 'static 'level-hint-control + :id (game-text-id swamp-tethers-advice-hint) + :num-attempts-before-playing 1 + :num-success-before-killing 1 + ) + (new 'static 'level-hint-control + :delay-before-playing (seconds 30) + :id (game-text-id sunken-double-lurker-hint) + :num-attempts-before-playing 3 + :num-success-before-killing 1 + ) + (new 'static 'level-hint-control + :id (game-text-id sunken-take-it-easy-hot-pipes) + :num-attempts-before-playing 3 + :num-success-before-killing -1 + ) + (new 'static 'level-hint-control + :id (game-text-id ram-boss-red-eco-hint) + :num-attempts-before-playing 5 + :num-success-before-killing -1 + ) + (new 'static 'level-hint-control + :delay-before-playing (seconds 3) + :id (game-text-id darkcave-light-crystal-hint) + :num-attempts-before-playing 1 + :num-success-before-killing -1 + ) + (new 'static 'level-hint-control + :id (game-text-id daxter-maybe-you-can-shoot-better-goggles) + :num-attempts-before-playing 4 + :num-success-before-killing -1 + ) + (new 'static 'level-hint-control + :id (game-text-id lavatube-shoot-the-spheres) + :num-attempts-before-playing 1 + :num-success-before-killing 2 + ) + (new 'static 'level-hint-control + :delay-before-playing (seconds 5) + :id (game-text-id citadel-break-generator-hint) + :num-attempts-before-playing 1 + :num-success-before-killing 1 + ) + (new 'static 'level-hint-control + :delay-before-playing (seconds 5) + :id (game-text-id citadel-break-generators-reminder) + :num-attempts-before-playing 1 + :num-success-before-killing 1 + ) + ) + ) + +(set! (-> *game-info* task-hint-control) + (new 'static 'boxed-array :type task-hint-control-group + (new 'static 'task-hint-control-group + :tasks (new 'static 'boxed-array :type task-hint-control + (new 'static 'task-hint-control :task (game-task training-gimmie) :delay (seconds 600)) + (new 'static 'task-hint-control :task (game-task training-door) :delay (seconds 1200)) + (new 'static 'task-hint-control :task (game-task training-climb) :delay (seconds 1800)) + ) + ) + (new 'static 'task-hint-control-group) + (new 'static 'task-hint-control-group + :tasks (new 'static 'boxed-array :type task-hint-control + (new 'static 'task-hint-control :task (game-task beach-gimmie) :delay (seconds 900)) + (new 'static 'task-hint-control :task (game-task beach-sentinel) :delay (seconds 1800)) + (new 'static 'task-hint-control :task (game-task beach-cannon) :delay (seconds 2700)) + ) + ) + (new 'static 'task-hint-control-group + :tasks (new 'static 'boxed-array :type task-hint-control + (new 'static 'task-hint-control :task (game-task jungle-plant) :delay (seconds 1200)) + (new 'static 'task-hint-control :task (game-task jungle-canyon-end) :delay (seconds 2400)) + ) + ) + (new 'static 'task-hint-control-group + :tasks (new 'static 'boxed-array :type task-hint-control + (new 'static 'task-hint-control :task (game-task misty-boat) :delay (seconds 1200)) + (new 'static 'task-hint-control :task (game-task misty-warehouse) :delay (seconds 1800)) + (new 'static 'task-hint-control :task (game-task misty-bike-jump) :delay (seconds 2400)) + (new 'static 'task-hint-control :task (game-task misty-eco-challenge) :delay (seconds 3000)) + ) + ) + (new 'static 'task-hint-control-group) + (new 'static 'task-hint-control-group) + (new 'static 'task-hint-control-group + :tasks (new 'static 'boxed-array :type task-hint-control + (new 'static 'task-hint-control :task (game-task sunken-spinning-room) :delay (seconds 1200)) + (new 'static 'task-hint-control :task (game-task sunken-sharks) :delay (seconds 1800)) + (new 'static 'task-hint-control :task (game-task sunken-slide) :delay (seconds 2400)) + ) + ) + (new 'static 'task-hint-control-group + :tasks (new 'static 'boxed-array :type task-hint-control + (new 'static 'task-hint-control :task (game-task swamp-battle) :delay (seconds 2400)) + ) + ) + (new 'static 'task-hint-control-group + :tasks (new 'static 'boxed-array :type task-hint-control + (new 'static 'task-hint-control :task (game-task rolling-lake) :delay (seconds 2400)) + ) + ) + (new 'static 'task-hint-control-group + :tasks (new 'static 'boxed-array :type task-hint-control + (new 'static 'task-hint-control :task (game-task ogre-secret) :delay (seconds 3600)) + ) + ) + (new 'static 'task-hint-control-group + :tasks (new 'static 'boxed-array :type task-hint-control + (new 'static 'task-hint-control :task (game-task village3-extra1) :delay (seconds 3600)) + ) + ) + (new 'static 'task-hint-control-group + :tasks (new 'static 'boxed-array :type task-hint-control + (new 'static 'task-hint-control :task (game-task snow-bumpers) :delay (seconds 1200)) + (new 'static 'task-hint-control :task (game-task snow-cage) :delay (seconds 1800)) + (new 'static 'task-hint-control :task (game-task snow-ball) :delay (seconds 2400)) + (new 'static 'task-hint-control :task (game-task snow-bunnies) :delay (seconds 3000)) + ) + ) + (new 'static 'task-hint-control-group + :tasks (new 'static 'boxed-array :type task-hint-control + (new 'static 'task-hint-control :task (game-task cave-dark-climb) :delay (seconds 1200)) + (new 'static 'task-hint-control :task (game-task cave-robot-climb) :delay (seconds 1800)) + (new 'static 'task-hint-control :task (game-task cave-swing-poles) :delay (seconds 2400)) + (new 'static 'task-hint-control :task (game-task cave-platforms) :delay (seconds 3000)) + ) + ) + (new 'static 'task-hint-control-group) + (new 'static 'task-hint-control-group) + ) ) - (new 'static 'task-hint-control - :task (game-task training-door) - :delay #x57e40 - ) - (new 'static 'task-hint-control - :task (game-task training-climb) - :delay #x83d60 - ) - ) - ) - (new 'static 'task-hint-control-group) - (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 3 :allocated-length 3 - (new 'static 'task-hint-control - :task (game-task beach-gimmie) - :delay #x41eb0 - ) - (new 'static 'task-hint-control - :task (game-task beach-sentinel) - :delay #x83d60 - ) - (new 'static 'task-hint-control - :task (game-task beach-cannon) - :delay #xc5c10 - ) - ) - ) - (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 2 :allocated-length 2 - (new 'static 'task-hint-control - :task (game-task jungle-plant) - :delay #x57e40 - ) - (new 'static 'task-hint-control - :task (game-task jungle-canyon-end) - :delay #xafc80 - ) - ) - ) - (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 4 :allocated-length 4 - (new 'static 'task-hint-control - :task (game-task misty-boat) - :delay #x57e40 - ) - (new 'static 'task-hint-control - :task (game-task misty-warehouse) - :delay #x83d60 - ) - (new 'static 'task-hint-control - :task (game-task misty-bike-jump) - :delay #xafc80 - ) - (new 'static 'task-hint-control - :task (game-task misty-eco-challenge) - :delay #xdbba0 - ) - ) - ) - (new 'static 'task-hint-control-group) - (new 'static 'task-hint-control-group) - (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 3 :allocated-length 3 - (new 'static 'task-hint-control - :task (game-task sunken-spinning-room) - :delay #x57e40 - ) - (new 'static 'task-hint-control - :task (game-task sunken-sharks) - :delay #x83d60 - ) - (new 'static 'task-hint-control - :task (game-task sunken-slide) - :delay #xafc80 - ) - ) - ) - (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 1 :allocated-length 1 - (new 'static 'task-hint-control - :task (game-task swamp-battle) - :delay #xafc80 - ) - ) - ) - (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 1 :allocated-length 1 - (new 'static 'task-hint-control - :task (game-task rolling-lake) - :delay #xafc80 - ) - ) - ) - (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 1 :allocated-length 1 - (new 'static 'task-hint-control - :task (game-task ogre-secret) - :delay #x107ac0 - ) - ) - ) - (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 1 :allocated-length 1 - (new 'static 'task-hint-control - :task (game-task village3-extra1) - :delay #x107ac0 - ) - ) - ) - (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 4 :allocated-length 4 - (new 'static 'task-hint-control - :task (game-task snow-bumpers) - :delay #x57e40 - ) - (new 'static 'task-hint-control :task (game-task snow-cage) :delay #x83d60) - (new 'static 'task-hint-control :task (game-task snow-ball) :delay #xafc80) - (new 'static 'task-hint-control - :task (game-task snow-bunnies) - :delay #xdbba0 - ) - ) - ) - (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 4 :allocated-length 4 - (new 'static 'task-hint-control - :task (game-task cave-dark-climb) - :delay #x57e40 - ) - (new 'static 'task-hint-control - :task (game-task cave-robot-climb) - :delay #x83d60 - ) - (new 'static 'task-hint-control - :task (game-task cave-swing-poles) - :delay #xafc80 - ) - (new 'static 'task-hint-control - :task (game-task cave-platforms) - :delay #xdbba0 - ) - ) - ) - (new 'static 'task-hint-control-group) - (new 'static 'task-hint-control-group) - ) - ) -;; definition for function find-hint-control-index (defun find-hint-control-index ((arg0 game-text-id)) (let ((gp-0 -1)) - (let ((v1-2 (length (-> *game-info* hint-control)))) - (dotimes (a0-2 v1-2) - (when (= (-> *game-info* hint-control a0-2 id) arg0) - (set! gp-0 a0-2) - (set! a0-2 v1-2) + (let ((v1-2 (length (-> *game-info* hint-control)))) + (dotimes (a0-2 v1-2) + (when (= (-> *game-info* hint-control a0-2 id) arg0) + (set! gp-0 a0-2) + (set! a0-2 v1-2) + ) + ) ) - ) + gp-0 ) - gp-0 - ) ) -;; definition for function start-hint-timer -;; INFO: Return type mismatch int vs none. (defun start-hint-timer ((arg0 game-text-id)) (let ((v1-0 (find-hint-control-index arg0))) - (when - (and - (>= v1-0 0) - (zero? (-> *game-info* hint-control v1-0 start-time)) - (!= (-> *game-info* hint-control v1-0 num-attempts-before-playing) 1) - ) - (set! - (-> *game-info* hint-control v1-0 start-time) - (-> *display* base-frame-counter) - ) - 0 + (when (and (>= v1-0 0) + (zero? (-> *game-info* hint-control v1-0 start-time)) + (!= (-> *game-info* hint-control v1-0 num-attempts-before-playing) 1) + ) + (set! (-> *game-info* hint-control v1-0 start-time) (-> *display* base-frame-counter)) + 0 + ) ) - ) 0 (none) ) -;; definition for function increment-success-for-hint -;; INFO: Return type mismatch int vs none. (defun increment-success-for-hint ((arg0 game-text-id)) (let ((gp-0 (find-hint-control-index arg0))) - (when (>= gp-0 0) - (set! - (-> *game-info* hint-control gp-0 num-success) - (seekl (-> *game-info* hint-control gp-0 num-success) 127 1) - ) - 0 + (when (>= gp-0 0) + (seekl! (-> *game-info* hint-control gp-0 num-success) 127 1) + 0 + ) ) - ) 0 (none) ) -;; definition for function can-hint-be-played? ;; WARN: disable def twice: 139. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defun can-hint-be-played? ((arg0 game-text-id) (arg1 entity) (arg2 string)) (let ((v1-0 (not (str-is-playing?)))) - (if (and v1-0 (nonzero? arg0)) - (set! v1-0 (not (seen-text? *game-info* arg0))) - ) - (when v1-0 - (when *hint-semaphore* - (set! - v1-0 - (appeared-for-long-enough? (the-as level-hint (ppointer->process *hint-semaphore*))) - ) - 0 - ) - (when - (and - v1-0 - (< - (- (-> *display* base-frame-counter) (-> *game-info* hint-play-time)) - 30 - ) - ) - (set! v1-0 #f) - 0 - ) - (set! - v1-0 - (and - v1-0 - (not (-> *setting-control* current talking)) - (not (-> *setting-control* current spooling)) - (not (-> *setting-control* current hint)) - (not (-> *setting-control* current ambient)) - (>= (-> *display* base-frame-counter) (-> *game-info* blackout-time)) - ) - ) - 0 - ) - (cond - (v1-0 - (let ((v1-16 (find-hint-control-index arg0))) - (cond - ((< v1-16 0) - #t + (if (and v1-0 (nonzero? arg0)) + (set! v1-0 (not (seen-text? *game-info* arg0))) ) - (else - (let ((gp-1 (-> *game-info* hint-control v1-16)) - (a0-24 - (- - (-> *display* base-frame-counter) - (-> *game-info* hint-control v1-16 last-time-called) - ) - ) - (v1-21 #t) - ) - (if (and (= (-> gp-1 num-attempts-before-playing) 1) (< a0-24 30)) - (+! (-> gp-1 start-time) a0-24) - ) - (cond - ((and - (!= (-> gp-1 num-attempts-before-playing) 1) - (nonzero? (-> gp-1 last-time-called)) - (< - (- (-> *display* base-frame-counter) (-> gp-1 last-time-called)) - 150 - ) + (when v1-0 + (when *hint-semaphore* + (set! v1-0 (appeared-for-long-enough? (the-as level-hint (ppointer->process *hint-semaphore*)))) + 0 + ) + (when (and v1-0 (< (- (-> *display* base-frame-counter) (-> *game-info* hint-play-time)) (seconds 0.1))) + (set! v1-0 #f) + 0 + ) + (set! v1-0 (and v1-0 + (not (-> *setting-control* current talking)) + (not (-> *setting-control* current spooling)) + (not (-> *setting-control* current hint)) + (not (-> *setting-control* current ambient)) + (>= (-> *display* base-frame-counter) (-> *game-info* blackout-time)) + ) ) - (set! (-> gp-1 last-time-called) (-> *display* base-frame-counter)) - #f - ) - (else - (set! (-> gp-1 last-time-called) (-> *display* base-frame-counter)) - (when (nonzero? (-> gp-1 delay-before-playing)) - (if - (< - (-> gp-1 start-time) - (the-as int (-> gp-1 delay-before-playing)) - ) - (set! v1-21 #f) - ) - 0 - ) - (cond - (v1-21 - (set! (-> gp-1 num-attempts) (seekl (-> gp-1 num-attempts) 127 1)) - (and - (>= (-> gp-1 num-attempts) (-> gp-1 num-attempts-before-playing)) - (or - (= (-> gp-1 num-success-before-killing) -1) - (< (-> gp-1 num-success) (-> gp-1 num-success-before-killing)) - ) - ) + 0 + ) + (cond + (v1-0 + (let ((v1-16 (find-hint-control-index arg0))) + (cond + ((< v1-16 0) + #t ) (else - #f - ) - ) - ) - ) - ) - ) - ) - ) - ) - (else - #f - ) - ) - ) - ) - -;; definition for function reset-all-hint-controls -;; INFO: Return type mismatch int vs none. -(defun reset-all-hint-controls () - (let ((v1-2 (length (-> *game-info* hint-control)))) - (dotimes (a0-1 v1-2) - (let ((a1-2 (-> *game-info* hint-control a0-1))) - (set! (-> a1-2 start-time) 0) - (set! (-> a1-2 last-time-called) 0) - (set! (-> a1-2 num-attempts) 0) - (set! (-> a1-2 num-success) 0) - ) - 0 - ) - ) - 0 - (none) - ) - -;; definition for function update-task-hints -;; INFO: Return type mismatch int vs none. -(defun update-task-hints () - (when *target* - (let ((a0-0 (+ (-> *target* current-level info index) -1)) - (v1-7 (-> *game-info* task-hint-control)) - ) - (when (and (>= a0-0 0) (< a0-0 (-> *level-task-data-remap* length))) - (let ((a0-3 (-> *level-task-data-remap* a0-0))) - (when (< a0-3 (-> v1-7 length)) - (let ((gp-0 (-> v1-7 a0-3 tasks))) - (when (and (!= gp-0 0) (nonzero? (-> gp-0 length))) - (let ((s5-0 (-> *game-info* in-level-time a0-3))) - (dotimes (s4-0 (-> gp-0 length)) - (case (get-task-status (-> gp-0 s4-0 task)) - (((task-status need-hint) (task-status unknown)) - (if (< (the-as uint (-> gp-0 s4-0 delay)) (the-as uint s5-0)) - (close-specific-task! - (-> gp-0 s4-0 task) - (task-status need-hint) + (let ((gp-1 (-> *game-info* hint-control v1-16)) + (a0-24 (- (-> *display* base-frame-counter) (-> *game-info* hint-control v1-16 last-time-called))) + (v1-21 #t) + ) + (if (and (= (-> gp-1 num-attempts-before-playing) 1) (< a0-24 (seconds 0.1))) + (+! (-> gp-1 start-time) a0-24) + ) + (cond + ((and (!= (-> gp-1 num-attempts-before-playing) 1) + (nonzero? (-> gp-1 last-time-called)) + (< (- (-> *display* base-frame-counter) (-> gp-1 last-time-called)) (seconds 0.5)) + ) + (set! (-> gp-1 last-time-called) (-> *display* base-frame-counter)) + #f + ) + (else + (set! (-> gp-1 last-time-called) (-> *display* base-frame-counter)) + (when (nonzero? (-> gp-1 delay-before-playing)) + (if (< (-> gp-1 start-time) (-> gp-1 delay-before-playing)) + (set! v1-21 #f) + ) + 0 + ) + (cond + (v1-21 + (seekl! (-> gp-1 num-attempts) 127 1) + (and (>= (-> gp-1 num-attempts) (-> gp-1 num-attempts-before-playing)) + (or (= (-> gp-1 num-success-before-killing) -1) + (< (-> gp-1 num-success) (-> gp-1 num-success-before-killing)) + ) + ) + ) + (else + #f + ) + ) + ) + ) + ) + ) + ) + ) + ) + (else + #f + ) + ) + ) + ) + +(defun reset-all-hint-controls () + (let ((v1-2 (length (-> *game-info* hint-control)))) + (dotimes (a0-1 v1-2) + (let ((a1-2 (-> *game-info* hint-control a0-1))) + (set! (-> a1-2 start-time) 0) + (set! (-> a1-2 last-time-called) 0) + (set! (-> a1-2 num-attempts) 0) + (set! (-> a1-2 num-success) 0) + ) + 0 + ) + ) + 0 + (none) + ) + +(defun update-task-hints () + (when *target* + (let ((a0-0 (+ (-> *target* current-level info index) -1)) + (v1-7 (-> *game-info* task-hint-control)) + ) + (when (and (>= a0-0 0) (< a0-0 (-> *level-task-data-remap* length))) + (let ((a0-3 (-> *level-task-data-remap* a0-0))) + (when (< a0-3 (-> v1-7 length)) + (let ((gp-0 (-> v1-7 a0-3 tasks))) + (when (and (!= gp-0 0) (nonzero? (-> gp-0 length))) + (let ((s5-0 (-> *game-info* in-level-time a0-3))) + (dotimes (s4-0 (-> gp-0 length)) + (case (get-task-status (-> gp-0 s4-0 task)) + (((task-status need-hint) (task-status unknown)) + (if (< (the-as uint (-> gp-0 s4-0 delay)) (the-as uint s5-0)) + (close-specific-task! (-> gp-0 s4-0 task) (task-status need-hint)) + ) + ) + ) + ) + ) ) - ) ) ) - ) ) - ) ) - ) ) - ) ) - ) 0 (none) ) diff --git a/goal_src/engine/game/task/process-taskable.gc b/goal_src/engine/game/task/process-taskable.gc index 3bab3a3c36..2d7f8bff9d 100644 --- a/goal_src/engine/game/task/process-taskable.gc +++ b/goal_src/engine/game/task/process-taskable.gc @@ -5,6 +5,17 @@ ;; name in dgo: process-taskable ;; dgos: GAME, ENGINE +(defmacro is-nan-hack (flt) + `(and (< 0.0 ,flt) (< ,flt 0.0)) + ) + +(defmacro less-than-hack (a b) + `(if (is-nan-hack ,a) + #f + (< ,a ,b) + ) + ) + ;; DECOMP BEGINS (defmethod dummy-52 process-taskable ((obj process-taskable)) @@ -64,65 +75,56 @@ (print-game-text (-> obj message) a1-2 #f 128 22) ) ) + ;; PAL patch here (cond ((-> obj only-allow-cancel) (when (-> obj no-msg) (clear *temp-string*) (format *temp-string* "; = ~S" (-> obj no-msg)) - (let* ((s4-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (s5-0 (-> s4-0 base)) - ) - (draw-string-xy - *temp-string* - s4-0 - (-> obj x-position) - (+ (-> obj y-position) 5 (-> obj message-space)) - (font-color default) - (font-flags shadow kerning large) - ) - (let ((a3-4 (-> s4-0 base))) - (let ((v1-17 (the-as object (-> s4-0 base)))) - (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> (the-as dma-packet v1-17) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-17) vif1) (new 'static 'vif-tag)) - (set! (-> s4-0 base) (&+ (the-as pointer v1-17) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - s5-0 - (the-as (pointer dma-tag) a3-4) + (let ((a1-5 (new + 'stack + 'font-context + *font-default-matrix* + (-> obj x-position) + (+ (-> obj y-position) 5 (-> obj message-space)) + 0.0 + (font-color default) + (font-flags shadow kerning) + ) + ) ) + (let ((v1-15 a1-5)) + (set! (-> v1-15 width) (the float 400)) ) + (let ((v1-16 a1-5)) + (set! (-> v1-16 height) (the float 100)) + ) + (set! (-> a1-5 flags) (font-flags shadow kerning large)) + (print-game-text *temp-string* a1-5 #f 128 22) ) ) ) (else - (let* ((s4-1 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (s5-1 (-> s4-1 base)) - ) - (draw-string-xy - (lookup-text! *common-text* (game-text-id confirm) #f) - s4-1 - (-> obj x-position) - (+ (-> obj y-position) 5 (-> obj message-space)) - (font-color default) - (font-flags shadow kerning large) - ) - (let ((a3-7 (-> s4-1 base))) - (let ((v1-29 (the-as object (-> s4-1 base)))) - (set! (-> (the-as dma-packet v1-29) dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> (the-as dma-packet v1-29) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-29) vif1) (new 'static 'vif-tag)) - (set! (-> s4-1 base) (&+ (the-as pointer v1-29) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - s5-1 - (the-as (pointer dma-tag) a3-7) + (let ((s5-0 (new + 'stack + 'font-context + *font-default-matrix* + (-> obj x-position) + (+ (-> obj y-position) 5 (-> obj message-space)) + 0.0 + (font-color default) + (font-flags shadow kerning) + ) + ) ) + (let ((v1-22 s5-0)) + (set! (-> v1-22 width) (the float 400)) ) + (let ((v1-23 s5-0)) + (set! (-> v1-23 height) (the float 100)) + ) + (set! (-> s5-0 flags) (font-flags shadow kerning large)) + (print-game-text (lookup-text! *common-text* (game-text-id confirm) #f) s5-0 #f 128 22) ) ) ) @@ -149,56 +151,55 @@ ) (defmethod dummy-46 process-taskable ((obj process-taskable)) - (with-pp - (when (nonzero? (-> obj sound-flava)) - (let ((s5-1 (vector-! - (new 'stack-no-clear 'vector) - (target-pos 0) - (the-as vector (-> obj root-override root-prim prim-core)) - ) + (when (nonzero? (-> obj sound-flava)) + (let ((s5-1 (vector-! + (new 'stack-no-clear 'vector) + (target-pos 0) + (the-as vector (-> obj root-override root-prim prim-core)) ) - ) - (set! (-> s5-1 y) (* 4.0 (-> s5-1 y))) - (cond - ((< (vector-length s5-1) 102400.0) - (when (not (-> obj have-flava)) - (set! (-> obj have-flava) #t) - (set-setting! *setting-control* pp 'sound-flava #f 20.0 (the-as int (-> obj sound-flava))) - ) - ) - ((-> obj have-flava) - (clear-pending-settings-from-process *setting-control* pp 'sound-flava) - (set! (-> obj have-flava) #f) - ) + ) ) + (set! (-> s5-1 y) (* 4.0 (-> s5-1 y))) + (cond + ;; s5-1 can be nan on the first frame after something spawns + ((less-than-hack (vector-length s5-1) 102400.0) + (when (not (-> obj have-flava)) + (set! (-> obj have-flava) #t) + (set-setting! 'sound-flava #f 20.0 (-> obj sound-flava)) + ) + ) + ((-> obj have-flava) + (remove-setting! 'sound-flava) + (set! (-> obj have-flava) #f) + ) ) ) - (when (-> obj music) - (let ((s5-3 (vector-! - (new 'stack-no-clear 'vector) - (target-pos 0) - (the-as vector (-> obj root-override root-prim prim-core)) - ) - ) - ) - (set! (-> s5-3 y) (* 4.0 (-> s5-3 y))) - (cond - ((< (vector-length s5-3) 102400.0) - (when (not (-> obj have-music)) - (set! (-> obj have-music) #t) - (set-setting! *setting-control* pp 'music (-> obj music) 0.0 0) - ) - ) - ((-> obj have-music) - (clear-pending-settings-from-process *setting-control* pp 'music) - (set! (-> obj have-music) #f) - ) - ) - ) - ) - 0 - (none) ) + (when (-> obj music) + (let ((s5-3 (vector-! + (new 'stack-no-clear 'vector) + (target-pos 0) + (the-as vector (-> obj root-override root-prim prim-core)) + ) + ) + ) + (set! (-> s5-3 y) (* 4.0 (-> s5-3 y))) + (cond + ((< (vector-length s5-3) 102400.0) + (when (not (-> obj have-music)) + (set! (-> obj have-music) #t) + (set-setting! 'music (-> obj music) 0.0 0) + ) + ) + ((-> obj have-music) + (remove-setting! 'music) + (set! (-> obj have-music) #f) + ) + ) + ) + ) + 0 + (none) ) (defmethod get-art-elem process-taskable ((obj process-taskable)) @@ -272,22 +273,13 @@ ) (defbehavior process-taskable-anim-loop process-taskable () - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) - ) + (when (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (get-art-elem self)) ) - (while #t + (loop (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (if (= (-> self next-state name) 'idle) (TODO-RENAME-43 self) ) @@ -298,8 +290,7 @@ (defstate release (process-taskable) :virtual #t - :trans - (behavior () + :trans (behavior () (when (process-release? *target*) (send-event *target* 'trans 'restore (-> self old-target-pos)) (if (should-display? self) @@ -311,16 +302,13 @@ ((-> self cur-trans-hook)) (none) ) - :code - process-taskable-anim-loop - :post - (the-as (function none :behavior process-taskable) ja-post) + :code process-taskable-anim-loop + :post (the-as (function none :behavior process-taskable) ja-post) ) (defstate give-cell (process-taskable) :virtual #t - :trans - (behavior () + :trans (behavior () (cond ((nonzero? (-> self cell-for-task)) (let ((gp-0 (handle->process (-> self cell-x)))) @@ -347,21 +335,17 @@ ((-> self cur-trans-hook)) (none) ) - :code - process-taskable-anim-loop - :post - (the-as (function none :behavior process-taskable) ja-post) + :code process-taskable-anim-loop + :post (the-as (function none :behavior process-taskable) ja-post) ) (defstate lose (process-taskable) :virtual #t - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 5)) (or (not *target*) (< 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) @@ -372,35 +356,22 @@ ((-> self cur-trans-hook)) (none) ) - :code - process-taskable-anim-loop - :post - (the-as (function none :behavior process-taskable) ja-post) + :code process-taskable-anim-loop + :post (the-as (function none :behavior process-taskable) ja-post) ) (defstate enter-playing (process-taskable) :virtual #t - :code - process-taskable-anim-loop - :post - (the-as (function none :behavior process-taskable) ja-post) + :code process-taskable-anim-loop + :post (the-as (function none :behavior process-taskable) ja-post) ) (defbehavior process-taskable-play-anim-enter process-taskable () (init! (-> self query) (the-as string #f) 40 150 25 #t (the-as string #f)) (logior! (-> self skel status) (janim-status blerc)) - (let ((gp-0 (get-process *default-dead-pool* othercam #x4000))) - (set! (-> self camera) - (ppointer->handle (when gp-0 - (let ((t9-2 (method-of-type othercam activate))) - (t9-2 (the-as othercam gp-0) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 othercam-init-by-other self (-> self cam-joint-index) #f #t) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self camera) + (ppointer->handle (process-spawn othercam self (-> self cam-joint-index) #f #t :to self)) + ) (set! (-> self cell-for-task) (game-task none)) (set! (-> self skippable) #f) (set! (-> self blend-on-exit) #f) @@ -424,44 +395,30 @@ (if (nonzero? *camera-look-through-other*) (set! *camera-look-through-other* 2) ) - (set-letterbox-frames (seconds 0.016666668)) + (set-letterbox-frames (seconds 0.017)) (draw-npc-shadow self) (none) ) (defbehavior process-taskable-play-anim-code process-taskable ((arg0 art-joint-anim) (arg1 basic)) (when (nonzero? (-> self cell-for-task)) - (cond - ((name= (-> self state name) "play-anim") - (let ((s4-0 (get-process *default-dead-pool* fuel-cell #x4000))) - (set! (-> self cell-x) - (ppointer->handle - (when s4-0 - (let ((t9-2 (method-of-type fuel-cell activate))) - (t9-2 (the-as fuel-cell s4-0) self 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 fuel-cell-init-as-clone (process->handle self) (-> self cell-for-task)) - (-> s4-0 ppointer) - ) - ) - ) - ) - ) - (else + (if (name= (-> self state name) "play-anim") + (set! (-> self cell-x) (ppointer->handle (process-spawn + fuel-cell + :init fuel-cell-init-as-clone + (process->handle self) + (-> self cell-for-task) + :to self + ) + ) + ) (format #t "ERROR: ~S ~S trying to give cell on release~%" (-> self name) (-> self state name)) ) - ) ) (cond ((and arg1 (type-type? (-> arg1 type) spool-anim)) (when *target* - (while (let ((a1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-9 from) self) - (set! (-> a1-9 num-params) 1) - (set! (-> a1-9 message) 'clone-anim) - (set! (-> a1-9 param 0) (the-as uint self)) - (not (send-event-function *target* a1-9)) - ) + (while (not (send-event *target* 'clone-anim self)) (spool-push *art-control* (-> (the-as spool-anim arg1) name) 0 self -99.0) (format #t "WARNING: ~A stall on not cloning.~%" (-> self name)) (suspend) @@ -469,16 +426,9 @@ (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) (send-event *target* 'blend-shape #t) ) - (push-setting! *setting-control* self 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) - (push-setting! *setting-control* self 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) - (push-setting! - *setting-control* - self - 'ambient-volume - 'rel - (-> *setting-control* current ambient-volume-movie) - 0 - ) + (add-setting! 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) + (add-setting! 'ambient-volume 'rel (-> *setting-control* current ambient-volume-movie) 0) (if (-> self blend-on-exit) (set! (-> self blend-on-exit) arg0) ) @@ -496,18 +446,15 @@ (the-as (function process-drawable symbol) false-func) ) ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) - (clear-pending-settings-from-process *setting-control* self 'ambient-volume) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) (send-event *target* 'blend-shape #f) ) (else (when (not arg1) (format #t "ERROR: ~S ~S got #f from anim picker~%" (-> self name) (-> self state name)) - (set! arg1 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) + (set! arg1 (ja-group)) ) (when (not (type-type? (-> arg1 type) art-joint-anim)) (format @@ -516,58 +463,23 @@ (-> self name) (-> self state name) ) - (set! arg1 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) + (set! arg1 (ja-group)) ) (format #t "~S ~S anim ~S~%" (-> self name) (-> self state name) (-> (the-as art-joint-anim arg1) name)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim arg1)) (when (< (ja-num-frames 0) 3) (suspend) (suspend) 0 ) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-30 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-30 param 1) 1.0) - (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! - a0-30 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (when (and *debug-segment* (= (get-response (-> self query)) 'no)) - (let ((v1-106 (-> self skel root-channel 0))) - (set! (-> v1-106 num-func) num-func-identity) - (set! (-> v1-106 frame-num) (the float (+ (-> v1-106 frame-group data 0 length) -1))) + (if (and *debug-segment* (= (get-response (-> self query)) 'no)) + (ja :num-func num-func-identity :frame-num max) ) - ) (suspend) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 param 0) (the float (+ (-> a0-38 frame-group data 0 length) -1))) - (set! (-> a0-38 param 1) 1.0) - (joint-control-channel-group-eval! a0-38 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) @@ -576,18 +488,14 @@ (defstate play-accept (process-taskable) :virtual #t - :enter - (the-as (function none :behavior process-taskable) process-taskable-play-anim-enter) - :exit - process-taskable-play-anim-exit - :trans - (behavior () + :enter (the-as (function none :behavior process-taskable) process-taskable-play-anim-enter) + :exit process-taskable-play-anim-exit + :trans (behavior () (process-taskable-play-anim-trans) ((-> self cur-trans-hook)) (none) ) - :code - (behavior () + :code (behavior () (process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (get-accept-anim self #t)) (while (not (process-release? *target*)) (suspend) @@ -595,36 +503,29 @@ (go-virtual enter-playing) (none) ) - :post - (the-as (function none :behavior process-taskable) ja-post) + :post (the-as (function none :behavior process-taskable) ja-post) ) (defstate play-reject (process-taskable) :virtual #t - :enter - (the-as (function none :behavior process-taskable) process-taskable-play-anim-enter) - :exit - process-taskable-play-anim-exit - :trans - (behavior () + :enter (the-as (function none :behavior process-taskable) process-taskable-play-anim-enter) + :exit process-taskable-play-anim-exit + :trans (behavior () (process-taskable-play-anim-trans) ((-> self cur-trans-hook)) (none) ) - :code - (behavior () + :code (behavior () (process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (get-reject-anim self #t)) (go-virtual release) (none) ) - :post - (the-as (function none :behavior process-taskable) ja-post) + :post (the-as (function none :behavior process-taskable) ja-post) ) (defstate query (process-taskable) :virtual #t - :enter - (behavior () + :enter (behavior () (init! (-> self query) (lookup-text! *common-text* (game-text-id confirm-play) #f) @@ -636,10 +537,8 @@ ) (none) ) - :exit - process-taskable-play-anim-exit - :trans - (behavior () + :exit process-taskable-play-anim-exit + :trans (behavior () (case (current-status (-> self tasks)) (((task-status need-reminder-a)) (case (get-response (-> self query)) @@ -670,16 +569,13 @@ ((-> self cur-trans-hook)) (none) ) - :code - process-taskable-anim-loop - :post - (the-as (function none :behavior process-taskable) ja-post) + :code process-taskable-anim-loop + :post (the-as (function none :behavior process-taskable) ja-post) ) (defstate play-anim (process-taskable) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('shadow) (cond @@ -707,12 +603,9 @@ ) ) ) - :enter - (the-as (function none :behavior process-taskable) process-taskable-play-anim-enter) - :exit - process-taskable-play-anim-exit - :trans - (behavior () + :enter (the-as (function none :behavior process-taskable) process-taskable-play-anim-enter) + :exit process-taskable-play-anim-exit + :trans (behavior () (process-taskable-play-anim-trans) (let ((a3-0 (handle->process (-> self cell-x)))) (if a3-0 @@ -722,21 +615,19 @@ ((-> self cur-trans-hook)) (none) ) - :code - (behavior () + :code (behavior () (process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (play-anim! self #t)) (dummy-38 self) (none) ) - :post - (the-as (function none :behavior process-taskable) ja-post) + :post (the-as (function none :behavior process-taskable) ja-post) ) (defbehavior process-taskable-clean-up-after-talking process-taskable () (logclear! (-> self draw status) (draw-status hidden)) (logclear! (-> self skel status) (janim-status inited)) - (clear-pending-settings-from-process *setting-control* self 'border-mode) - (clear-pending-settings-from-process *setting-control* self 'talking) + (remove-setting! 'border-mode) + (remove-setting! 'talking) (none) ) @@ -764,7 +655,7 @@ (defbehavior process-taskable-hide-enter process-taskable () (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((v1-3 (-> self draw shadow-ctrl))) - (logior! (-> v1-3 settings flags) 32) + (logior! (-> v1-3 settings flags) (shadow-flags disable-draw)) ) 0 (process-taskable-clean-up-after-talking) @@ -780,13 +671,11 @@ ) (else (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) - ) + (ja :group! (get-art-elem self)) (restore-collide-with-as (-> self root-override)) (process-entity-status! self (entity-perm-status bit-3) #t) (let ((v1-7 (-> self draw shadow-ctrl))) - (set! (-> v1-7 settings flags) (logand -33 (-> v1-7 settings flags))) + (logclear! (-> v1-7 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -796,20 +685,16 @@ (defstate hidden (process-taskable) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior process-taskable) process-taskable-hide-handler ) - :enter - (the-as (function none :behavior process-taskable) process-taskable-hide-enter) - :exit - (behavior () + :enter (the-as (function none :behavior process-taskable) process-taskable-hide-enter) + :exit (behavior () (process-taskable-hide-exit (= (-> self next-state name) 'hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (process-entity-status! self (entity-perm-status bit-3) #f) ) @@ -818,8 +703,7 @@ ) (none) ) - :code - (the-as (function none :behavior process-taskable) anim-loop) + :code (the-as (function none :behavior process-taskable) anim-loop) ) ;; WARN: disable def twice: 4. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. @@ -836,20 +720,16 @@ (defstate hidden-other (process-taskable) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior process-taskable) process-taskable-hide-handler ) - :enter - (the-as (function none :behavior process-taskable) process-taskable-hide-enter) - :exit - (behavior () + :enter (the-as (function none :behavior process-taskable) process-taskable-hide-enter) + :exit (behavior () (process-taskable-hide-exit (= (-> self next-state name) 'hidden-other)) (none) ) - :trans - (behavior () + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (process-entity-status! self (entity-perm-status bit-3) #f) ) @@ -866,14 +746,12 @@ ) (none) ) - :code - (the-as (function none :behavior process-taskable) anim-loop) + :code (the-as (function none :behavior process-taskable) anim-loop) ) (defstate be-clone (process-taskable) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as shadow-geo (cond ((= v1-0 'shadow) @@ -912,15 +790,13 @@ ) ) ) - :enter - (behavior ((arg0 handle)) + :enter (behavior ((arg0 handle)) (logior! (-> self skel status) (janim-status blerc)) (logclear! (-> self mask) (process-mask actor-pause)) (set-vector! (-> self draw bounds) 0.0 (-> self draw-bounds-y-offset) 0.0 (-> self draw bounds w)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self skel status) (janim-status blerc spool)) (logior! (-> self mask) (process-mask actor-pause)) (let ((v1-6 (-> self entity extra trans))) @@ -931,14 +807,12 @@ (ja-channel-set! 0) (none) ) - :trans - (behavior () + :trans (behavior () (draw-npc-shadow self) ((-> self cur-trans-hook)) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (clone-anim arg0 (-> self center-joint-index) #t "") (format #t "ERROR: handle invalid while ~S is cloning~%" (-> self name)) (go-virtual hidden) @@ -950,76 +824,58 @@ #t ) -(defmacro is-nan-hack (flt) - `(and (< 0.0 ,flt) (< ,flt 0.0)) - ) - -(defmacro less-than-hack (a b) - `(if (is-nan-hack ,a) - #f - (< ,a ,b) - ) - ) - (defstate idle (process-taskable) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'attack) - (the-as symbol (when (-> self bounce-away) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'shove) - (set! (-> a1-3 param 0) (the-as uint #f)) - (let ((v1-4 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-4 shove-back) 12288.0) - (set! (-> v1-4 shove-up) 4096.0) - (set! (-> a1-3 param 1) (the-as uint v1-4)) - ) - (the-as symbol (send-event-function arg0 a1-3)) - ) - ) - ) - ) - ((= v1-0 'touch) - (the-as symbol (send-shove-back - (-> self root-override) - arg0 - (the-as touching-shapes-entry (-> arg3 param 0)) - 0.7 - 6144.0 - 16384.0 - ) - ) - ) - ((= v1-0 'clone) - (the-as symbol (go-virtual be-clone (the-as handle (-> arg3 param 0)))) - ) - ((= v1-0 'play-anim) - (logclear! (-> self mask) (process-mask actor-pause)) - (let ((v0-0 #t)) - (set! (-> self been-kicked) v0-0) - v0-0 - ) - ) - ((= v1-0 'hidden-other) - (the-as symbol (go-virtual hidden-other)) - ) - ) - ) + (the-as + object + (cond + ((= v1-0 'attack) + (the-as + symbol + (if (-> self bounce-away) + (the-as + symbol + (send-event arg0 'shove #f (static-attack-info ((shove-back (meters 3)) (shove-up (meters 1))))) + ) + ) + ) + ) + ((= v1-0 'touch) + (the-as symbol (send-shove-back + (-> self root-override) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + 0.7 + 6144.0 + 16384.0 + ) + ) + ) + ((= v1-0 'clone) + (the-as symbol (go-virtual be-clone (the-as handle (-> arg3 param 0)))) + ) + ((= v1-0 'play-anim) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((v0-0 #t)) + (set! (-> self been-kicked) v0-0) + v0-0 + ) + ) + ((= v1-0 'hidden-other) + (the-as symbol (go-virtual hidden-other)) + ) + ) + ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (process-taskable-clean-up-after-talking) (none) ) - :exit - (behavior () + :exit (behavior () (cond ((or (= (-> self next-state name) 'dead-state) (= (-> self next-state name) 'idle)) (process-entity-status! self (entity-perm-status bit-3) #f) @@ -1029,15 +885,14 @@ (logior! (-> self skel status) (janim-status inited)) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) - (set-setting! *setting-control* self 'border-mode #f 0.0 0) - (set-setting! *setting-control* self 'talking (the-as symbol (process->ppointer self)) 0.0 0) - (copy-settings-from-target! *setting-control*) + (set-setting! 'border-mode #f 0.0 0) + (set-setting! 'talking (process->ppointer self) 0.0 0) + (apply-settings *setting-control*) ) ) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) @@ -1052,11 +907,10 @@ ) ((begin (dummy-46 self) - (and (not - (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) + (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + ) + ) (< (-> (target-pos 0) y) (+ 8192.0 (-> self root-override root-prim prim-core world-sphere y))) (less-than-hack (vector-vector-distance (target-pos 0) (the-as vector (-> self root-override root-prim prim-core))) 32768.0 @@ -1126,10 +980,8 @@ ((-> self cur-trans-hook)) (none) ) - :code - process-taskable-anim-loop - :post - (behavior () + :code process-taskable-anim-loop + :post (behavior () (when *target* (when (!= (-> self neck-joint-index) -1) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -1265,8 +1117,7 @@ ) (defstate othercam-running (othercam) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('die) @@ -1304,22 +1155,21 @@ ) (('mask) (set! v0-0 (-> arg3 param 0)) - (set! (-> self mask-to-clear) (the-as uint v0-0)) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) v0-0 ) ) ) - :enter - (behavior () + :enter (behavior () (hide-hud-quick) (case (-> self spooling?) (('logo) ) (else - (push-setting! *setting-control* self 'process-mask 'set 0.0 (-> self mask-to-clear)) - (push-setting! *setting-control* self 'movie (process->ppointer self) 0.0 0) + (add-setting! 'process-mask 'set 0.0 (-> self mask-to-clear)) + (add-setting! 'movie (process->ppointer self) 0.0 0) (if (not (-> self border-value)) - (push-setting! *setting-control* self 'border-mode (-> self border-value) 0.0 0) + (add-setting! 'border-mode (-> self border-value) 0.0 0) ) ) ) @@ -1333,18 +1183,16 @@ (vector-normalize-copy! (-> self old-mat-z) (-> v1-19 vector 2) -1.0) ) ) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (none) ) - :exit - (behavior () - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (copy-settings-from-target! *setting-control*) + :exit (behavior () + (remove-setting! 'process-mask) + (apply-settings *setting-control*) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((s2-0 (-> self hand process 0))) (when (not s2-0) (format #t "ERROR: othercam parent invalid~%") @@ -1424,7 +1272,7 @@ (set! (-> self border-value) #f) (set! (-> self die?) #f) (set! (-> self survive-anim-end?) arg2) - (set! (-> self mask-to-clear) (the-as uint #x4a0800)) + (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) (set! (-> self event-hook) (-> othercam-running event)) (go othercam-running) 0 @@ -1434,13 +1282,16 @@ (defmethod draw-npc-shadow process-taskable ((obj process-taskable)) (let ((gp-0 (-> obj draw shadow-ctrl))) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (collide-to-find-planes gp-0 (-> obj draw origin) -4096.0 4096.0 32768.0) (update-direction-from-time-of-day gp-0) ) (else (let ((v1-10 gp-0)) - (logior! (-> v1-10 settings flags) 32) + (logior! (-> v1-10 settings flags) (shadow-flags disable-draw)) ) 0 ) diff --git a/goal_src/engine/game/task/task-control.gc b/goal_src/engine/game/task/task-control.gc index 87722a3045..0f22d6ff69 100644 --- a/goal_src/engine/game/task/task-control.gc +++ b/goal_src/engine/game/task/task-control.gc @@ -295,49 +295,33 @@ ;; tasks for assistant (note: keira) -(define - *assistant-tasks* +(define *assistant-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 12 :allocated-length 12 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-eggtop) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-eggtop) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) (or (closed? arg0 (game-task jungle-eggtop) (task-status need-reminder)) (and (closed? arg0 (game-task jungle-eggtop) (task-status need-introduction)) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'pickup)) - (set! (-> a1-2 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-2)) (+ (get-reminder arg0 1) 3)) - ) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) + ) ) ) ) @@ -345,21 +329,14 @@ (new 'static 'task-cstage :game-task (game-task misty-bike) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) (or (closed? arg0 (game-task jungle-eggtop) (task-status need-reminder)) (and (closed? arg0 (game-task jungle-eggtop) (task-status need-introduction)) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'pickup)) - (set! (-> a1-2 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-2)) (+ (get-reminder arg0 1) 3)) - ) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) + ) ) ) ) @@ -368,34 +345,29 @@ :game-task (game-task jungle-eggtop) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike) :status (task-status need-reminder-a) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :status (task-status unknown) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (task-closed? (game-task village4-button) (task-status need-reward-speech)) ) @@ -403,241 +375,165 @@ (new 'static 'task-cstage :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-eggtop) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) -(define - *assistant-village2-tasks* +(define *assistant-village2-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 22 :allocated-length 22 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village2-levitator) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-levitator) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-levitator) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-levitator) :status (task-status need-reminder-a) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-levitator) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-0)) 45) - ) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 45) ) ) (new 'static 'task-cstage :game-task (game-task sunken-room) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-room) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-flutflut) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (and (task-closed? (game-task beach-flutflut) (task-status need-reminder)) - (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) - (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) pp) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'query) - (set! (-> a1-4 param 0) (the-as uint 'pickup)) - (set! (-> a1-4 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (and (task-closed? (game-task beach-flutflut) (task-status need-reminder)) + (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) + (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) - ) + ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task swamp-flutflut) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (and (task-closed? (game-task beach-flutflut) (task-status need-reminder)) - (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) - (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) pp) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'query) - (set! (-> a1-4 param 0) (the-as uint 'pickup)) - (set! (-> a1-4 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (and (task-closed? (game-task beach-flutflut) (task-status need-reminder)) + (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) + (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) - ) + ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task rolling-robbers) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (if (task-closed? (game-task beach-flutflut) (task-status need-reminder)) - (or (closed? arg0 (game-task swamp-flutflut) (task-status need-reminder)) - (and (closed? arg0 (game-task swamp-flutflut) (task-status need-introduction)) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) pp) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'query) - (set! (-> a1-4 param 0) (the-as uint 'pickup)) - (set! (-> a1-4 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (if (task-closed? (game-task beach-flutflut) (task-status need-reminder)) + (or (closed? arg0 (game-task swamp-flutflut) (task-status need-reminder)) + (and (closed? arg0 (game-task swamp-flutflut) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) - (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) pp) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'query) - (set! (-> a1-8 param 0) (the-as uint 'pickup)) - (set! (-> a1-8 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-8)) (+ (get-reminder arg0 1) 3)) + ) + ) + (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) + (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) - ) + ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task rolling-robbers) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (if (task-closed? (game-task beach-flutflut) (task-status need-reminder)) - (or (closed? arg0 (game-task swamp-flutflut) (task-status need-reminder)) - (and (closed? arg0 (game-task swamp-flutflut) (task-status need-introduction)) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) pp) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'query) - (set! (-> a1-4 param 0) (the-as uint 'pickup)) - (set! (-> a1-4 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (if (task-closed? (game-task beach-flutflut) (task-status need-reminder)) + (or (closed? arg0 (game-task swamp-flutflut) (task-status need-reminder)) + (and (closed? arg0 (game-task swamp-flutflut) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) - (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) pp) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'query) - (set! (-> a1-8 param 0) (the-as uint 'pickup)) - (set! (-> a1-8 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-8)) (+ (get-reminder arg0 1) 3)) + ) + ) + (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) + (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) - ) + ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task sunken-room) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-room) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-flutflut) :status (task-status unknown) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (task-closed? (game-task beach-flutflut) (task-status need-reminder)) ) @@ -646,8 +542,7 @@ :game-task (game-task swamp-flutflut) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (task-closed? (game-task beach-flutflut) (task-status need-reminder)) ) @@ -655,100 +550,79 @@ (new 'static 'task-cstage :game-task (game-task rolling-robbers) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-robbers) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-room) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-robbers) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-flutflut) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-levitator) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) -(define - *gambler-tasks* +(define *gambler-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 10 :allocated-length 10 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task rolling-race) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-race) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-gambler-money) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-gambler-money) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-race) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-race) (task-status need-reward-speech)) ) ) @@ -756,8 +630,7 @@ :game-task (game-task village2-gambler-money) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task village2-gambler-money) (task-status need-reward-speech)) ) ) @@ -765,8 +638,7 @@ :game-task (game-task rolling-race) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-race) (task-status need-reminder)) ) ) @@ -774,22 +646,12 @@ :game-task (game-task village2-gambler-money) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -798,16 +660,14 @@ :game-task (game-task rolling-race) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-race) (task-status need-introduction)) ) ) (new 'static 'task-cstage :game-task (game-task village2-gambler-money) :status (task-status need-reminder) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-race) (task-status need-introduction)) ) ) @@ -815,53 +675,39 @@ ) ) -(define - *geologist-tasks* +(define *geologist-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 10 :allocated-length 10 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task rolling-moles) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-moles) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-geologist-money) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-geologist-money) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-moles) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-moles) (task-status need-reward-speech)) ) ) @@ -869,8 +715,7 @@ :game-task (game-task village2-geologist-money) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task village2-geologist-money) (task-status need-reward-speech)) ) ) @@ -878,8 +723,7 @@ :game-task (game-task rolling-moles) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-moles) (task-status need-reminder)) ) ) @@ -887,22 +731,12 @@ :game-task (game-task village2-geologist-money) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -911,16 +745,14 @@ :game-task (game-task rolling-moles) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-moles) (task-status need-introduction)) ) ) (new 'static 'task-cstage :game-task (game-task village2-geologist-money) :status (task-status need-reminder) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-moles) (task-status need-introduction)) ) ) @@ -928,53 +760,39 @@ ) ) -(define - *mayor-tasks* +(define *mayor-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 11 :allocated-length 11 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-lurkerm) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-lurkerm) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-mayor-money) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-mayor-money) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-lurkerm) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task jungle-lurkerm) (task-status need-reward-speech)) ) ) @@ -982,8 +800,7 @@ :game-task (game-task village1-mayor-money) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task village1-mayor-money) (task-status need-reward-speech)) ) ) @@ -991,8 +808,7 @@ :game-task (game-task jungle-lurkerm) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task jungle-lurkerm) (task-status need-reminder)) ) ) @@ -1000,22 +816,12 @@ :game-task (game-task village1-mayor-money) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -1024,8 +830,7 @@ :game-task (game-task jungle-lurkerm) :status (task-status need-reminder-a) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task jungle-lurkerm) (task-status need-introduction)) ) ) @@ -1033,16 +838,14 @@ :game-task (game-task jungle-lurkerm) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task jungle-lurkerm) (task-status need-introduction)) ) ) (new 'static 'task-cstage :game-task (game-task village1-mayor-money) :status (task-status need-reminder) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task jungle-lurkerm) (task-status need-introduction)) ) ) @@ -1050,123 +853,89 @@ ) ) -(define - *sage-tasks* +(define *sage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 14 :allocated-length 14 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task intro) :status (task-status need-introduction) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task intro) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task intro) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-ecorocks) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-ecorocks) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-cannon) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task beach-ecorocks) (task-status need-reminder)) - (and (closed? arg0 (game-task beach-ecorocks) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task beach-ecorocks) (task-status need-reminder)) + (and (closed? arg0 (game-task beach-ecorocks) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task misty-cannon) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task beach-ecorocks) (task-status need-reminder)) - (and (closed? arg0 (game-task beach-ecorocks) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task beach-ecorocks) (task-status need-reminder)) + (and (closed? arg0 (game-task beach-ecorocks) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task beach-ecorocks) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-cannon) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-cannon) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :status (task-status unknown) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (task-closed? (game-task village4-button) (task-status need-reward-speech)) ) @@ -1174,202 +943,143 @@ (new 'static 'task-cstage :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-ecorocks) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-cannon) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) -(define - *sage-bluehut-tasks* +(define *sage-bluehut-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 10 :allocated-length 10 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task rolling-plants) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-plants) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-arm) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task rolling-plants) (task-status need-reminder)) - (and (closed? arg0 (game-task rolling-plants) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task rolling-plants) (task-status need-reminder)) + (and (closed? arg0 (game-task rolling-plants) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task swamp-arm) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task rolling-plants) (task-status need-reminder)) - (and (closed? arg0 (game-task rolling-plants) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task rolling-plants) (task-status need-reminder)) + (and (closed? arg0 (game-task rolling-plants) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task rolling-plants) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-arm) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-arm) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-plants) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-arm) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) -(define - *oracle-village1-tasks* +(define *oracle-village1-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 10 :allocated-length 10 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village1-oracle-money1) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-oracle-money1) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-oracle-money2) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-oracle-money2) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-oracle-money1) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-oracle-inc)) ) ) ) @@ -1377,36 +1087,24 @@ (new 'static 'task-cstage :game-task (game-task village1-oracle-money1) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-oracle-money1) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-oracle-money2) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-oracle-inc)) ) ) ) @@ -1414,81 +1112,56 @@ (new 'static 'task-cstage :game-task (game-task village1-oracle-money2) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-oracle-money2) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) -(define - *oracle-village2-tasks* +(define *oracle-village2-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 10 :allocated-length 10 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village2-oracle-money1) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-oracle-money1) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-oracle-money2) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-oracle-money2) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-oracle-money1) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-oracle-inc)) ) ) ) @@ -1496,36 +1169,24 @@ (new 'static 'task-cstage :game-task (game-task village2-oracle-money1) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-oracle-money1) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-oracle-money2) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-oracle-inc)) ) ) ) @@ -1533,81 +1194,56 @@ (new 'static 'task-cstage :game-task (game-task village2-oracle-money2) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-oracle-money2) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) -(define - *oracle-village3-tasks* +(define *oracle-village3-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 10 :allocated-length 10 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village3-oracle-money1) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-oracle-money1) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-oracle-money2) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-oracle-money2) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-oracle-money1) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-oracle-inc)) ) ) ) @@ -1615,36 +1251,24 @@ (new 'static 'task-cstage :game-task (game-task village3-oracle-money1) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-oracle-money1) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-oracle-money2) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-oracle-inc)) ) ) ) @@ -1652,113 +1276,80 @@ (new 'static 'task-cstage :game-task (game-task village3-oracle-money2) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-oracle-money2) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) -(define - *miners-tasks* +(define *miners-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 35 :allocated-length 35 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village3-miner-money1) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money1) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money2) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money2) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money3) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money3) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money4) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money4) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money1) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -1767,22 +1358,12 @@ :game-task (game-task village3-miner-money2) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -1791,22 +1372,12 @@ :game-task (game-task village3-miner-money3) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -1815,22 +1386,12 @@ :game-task (game-task village3-miner-money4) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -1838,362 +1399,268 @@ (new 'static 'task-cstage :game-task (game-task cave-gnawers) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task village3-miner-money4) (task-status need-reminder)) - (and (closed? arg0 (game-task village3-miner-money4) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task village3-miner-money4) (task-status need-reminder)) + (and (closed? arg0 (game-task village3-miner-money4) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task cave-gnawers) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task village3-miner-money4) (task-status need-reminder)) - (and (closed? arg0 (game-task village3-miner-money4) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task village3-miner-money4) (task-status need-reminder)) + (and (closed? arg0 (game-task village3-miner-money4) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task snow-eggtop) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task cave-gnawers) (task-status need-reminder)) - (and (closed? arg0 (game-task cave-gnawers) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task cave-gnawers) (task-status need-reminder)) + (and (closed? arg0 (game-task cave-gnawers) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task snow-eggtop) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task cave-gnawers) (task-status need-reminder)) - (and (closed? arg0 (game-task cave-gnawers) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task cave-gnawers) (task-status need-reminder)) + (and (closed? arg0 (game-task cave-gnawers) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money1) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money1) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money2) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money2) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money3) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money3) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money4) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money4) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-gnawers) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-gnawers) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-eggtop) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-eggtop) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money1) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money2) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money3) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money4) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-gnawers) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-eggtop) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) -(define - *sage-villagec-tasks* +(define *sage-villagec-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 14 :allocated-length 14 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village3-button) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-button) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-button) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-dark-crystals) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-dark-crystals) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ram) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task cave-dark-crystals) (task-status need-reminder)) - (and (closed? arg0 (game-task cave-dark-crystals) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task cave-dark-crystals) (task-status need-reminder)) + (and (closed? arg0 (game-task cave-dark-crystals) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task snow-ram) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task cave-dark-crystals) (task-status need-reminder)) - (and (closed? arg0 (game-task cave-dark-crystals) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task cave-dark-crystals) (task-status need-reminder)) + (and (closed? arg0 (game-task cave-dark-crystals) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task cave-dark-crystals) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ram) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ram) :status (task-status need-reminder-a) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ram) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-dark-crystals) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ram) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -2201,25 +1668,18 @@ (define *citb-greensage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task citadel-sage-green) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task citadel-sage-green) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -2227,25 +1687,18 @@ (define *citb-bluesage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task citadel-sage-blue) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task citadel-sage-blue) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -2253,25 +1706,18 @@ (define *citb-redsage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task citadel-sage-red) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task citadel-sage-red) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -2279,385 +1725,281 @@ (define *citb-yellowsage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task citadel-sage-yellow) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task citadel-sage-yellow) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) -(define - *task-controls* +(define *task-controls* (the-as (array task-control) - (new - 'static - 'boxed-array - :type basic :length 116 :allocated-length 116 + (new 'static 'boxed-array :type basic '*null-task-control* '*null-task-control* '*assistant-tasks* '*mayor-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-tower) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-tower) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-tower) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-tower) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 7 :allocated-length 7 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-fishgame) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-fishgame) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-fishgame) :status (task-status need-reminder-a) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-fishgame) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-fishgame) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-fishgame) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-plant) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-plant) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-plant) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-plant) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-canyon-end) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-canyon-end) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-canyon-end) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-canyon-end) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-temple-door) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-temple-door) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-temple-door) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-temple-door) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 5 :allocated-length 5 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village1-yakow) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-yakow) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-yakow) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-yakow) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-yakow) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) '*mayor-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 5 :allocated-length 5 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village1-uncle-money) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-uncle-money) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-uncle-money) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -2665,15 +2007,13 @@ (new 'static 'task-cstage :game-task (game-task village1-uncle-money) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-uncle-money) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -2682,405 +2022,303 @@ '*sage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task beach-pelican) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-pelican) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-pelican) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-pelican) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 5 :allocated-length 5 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task beach-flutflut) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-flutflut) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-flutflut) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-flutflut) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-flutflut) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task beach-seagull) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-seagull) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-seagull) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-seagull) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task beach-cannon) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-cannon) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-cannon) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-cannon) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task beach-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task beach-gimmie) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-gimmie) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-gimmie) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-gimmie) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task beach-sentinel) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-sentinel) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-sentinel) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-sentinel) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 5 :allocated-length 5 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task misty-muse) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-muse) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-muse) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-muse) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-muse) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task misty-boat) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-boat) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-boat) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-boat) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task misty-warehouse) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-warehouse) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-warehouse) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-warehouse) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -3088,118 +2326,88 @@ '*assistant-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task misty-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task misty-bike-jump) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike-jump) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike-jump) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike-jump) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task misty-eco-challenge) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-eco-challenge) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-eco-challenge) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-eco-challenge) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -3207,18 +2415,12 @@ '*geologist-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 5 :allocated-length 5 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village2-warrior-money) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) (and (not (task-closed? (game-task ogre-boss) (task-status need-reminder))) (not (task-closed? (game-task village2-levitator) (task-status need-reward-speech))) @@ -3228,10 +2430,8 @@ (new 'static 'task-cstage :game-task (game-task village2-warrior-money) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) (and (not (task-closed? (game-task ogre-boss) (task-status need-reminder))) (not (task-closed? (game-task village2-levitator) (task-status need-reward-speech))) @@ -3242,22 +2442,12 @@ :game-task (game-task village2-warrior-money) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -3265,15 +2455,13 @@ (new 'static 'task-cstage :game-task (game-task village2-warrior-money) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-warrior-money) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -3281,564 +2469,421 @@ '*oracle-village2-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 6 :allocated-length 6 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task swamp-billy) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-billy) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-billy) :status (task-status need-reminder-a) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-billy) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-billy) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-billy) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) '*assistant-village2-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task swamp-battle) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-battle) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-battle) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-battle) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task swamp-tether-1) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-1) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-1) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-1) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task swamp-tether-2) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-2) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-2) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-2) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task swamp-tether-3) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-3) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-3) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-3) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task swamp-tether-4) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-4) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-4) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-4) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task swamp-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task sunken-platforms) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-platforms) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-platforms) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-platforms) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task sunken-pipe) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-pipe) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-pipe) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-pipe) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task sunken-slide) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-slide) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-slide) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-slide) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) '*assistant-village2-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task sunken-sharks) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-sharks) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-sharks) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-sharks) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task sunken-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task sunken-top-of-helix) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-top-of-helix) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-top-of-helix) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-top-of-helix) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task sunken-spinning-room) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-spinning-room) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-spinning-room) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-spinning-room) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -3848,157 +2893,117 @@ '*sage-bluehut-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task rolling-lake) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-lake) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-lake) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-lake) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task rolling-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-1) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-1) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-1) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-1) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-2) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-2) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-2) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-2) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -4006,313 +3011,233 @@ '*sage-villagec-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task snow-fort) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-fort) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-fort) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-fort) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task snow-ball) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ball) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ball) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ball) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task snow-bunnies) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-bunnies) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-bunnies) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-bunnies) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task snow-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task snow-bumpers) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-bumpers) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-bumpers) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-bumpers) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task snow-cage) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-cage) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-cage) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-cage) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task firecanyon-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task firecanyon-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task firecanyon-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task firecanyon-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task firecanyon-end) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task firecanyon-end) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task firecanyon-end) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task firecanyon-end) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -4322,157 +3247,117 @@ '*citb-yellowsage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village3-extra1) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-extra1) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-extra1) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-extra1) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village1-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village2-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village3-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -4480,625 +3365,465 @@ '*sage-villagec-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task cave-dark-climb) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-dark-climb) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-dark-climb) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-dark-climb) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task cave-robot-climb) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-robot-climb) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-robot-climb) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-robot-climb) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task cave-swing-poles) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-swing-poles) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-swing-poles) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-swing-poles) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task cave-spider-tunnel) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-spider-tunnel) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-spider-tunnel) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-spider-tunnel) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task cave-platforms) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-platforms) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-platforms) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-platforms) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task cave-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task ogre-boss) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-boss) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-boss) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-boss) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task ogre-end) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-end) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-end) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-end) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task ogre-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task lavatube-end) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-end) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-end) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-end) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task lavatube-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task citadel-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task citadel-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task citadel-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task citadel-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task training-gimmie) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-gimmie) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-gimmie) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-gimmie) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task training-door) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-door) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-door) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-door) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task training-climb) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-climb) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-climb) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-climb) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task training-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -5110,33 +3835,20 @@ '*oracle-village3-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task firecanyon-assistant) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-0)) 20) - ) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 20) ) ) (new 'static 'task-cstage :game-task (game-task firecanyon-assistant) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -5145,290 +3857,209 @@ '*sage-villagec-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task red-eggtop) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task red-eggtop) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task red-eggtop) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task red-eggtop) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task lavatube-balls) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-balls) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-balls) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-balls) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task lavatube-start) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-0)) 72) - ) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 72) ) ) (new 'static 'task-cstage :game-task (game-task lavatube-start) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) '*sage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task ogre-secret) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-secret) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-secret) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-secret) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 3 :allocated-length 3 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village4-button) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village4-button) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village4-button) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 5 :allocated-length 5 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task finalboss-movies) :status (task-status unknown) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task finalboss-movies) :status (task-status need-introduction) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task finalboss-movies) :status (task-status need-reminder-a) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task finalboss-movies) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task finalboss-movies) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task plunger-lurker-hit) :status (task-status unknown) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task plunger-lurker-hit) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task leaving-misty) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task leaving-misty) :status (task-status need-reminder) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :status (task-status unknown) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (task-closed? (game-task village4-button) (task-status need-reward-speech)) ) @@ -5436,8 +4067,7 @@ (new 'static 'task-cstage :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) diff --git a/goal_src/engine/game/video.gc b/goal_src/engine/game/video.gc index 88ea7b7434..971c3419ee 100644 --- a/goal_src/engine/game/video.gc +++ b/goal_src/engine/game/video.gc @@ -33,6 +33,30 @@ (set! (-> *math-camera* y-clip) 512.0) (set! (-> *shadow-data* texoffset y) 128.5) ) + (('100fps) + (set! (-> *video-parms* screen-sy) 224) + (set! (-> *setting-control* default screenx) 0) + (set! (-> *setting-control* default screeny) 8) + (set! (-> *video-parms* screen-pages-high) 7) + (set! (-> *video-parms* relative-y-scale) 1.0) + (set! *ticks-per-frame* 5859) + (set! (-> *math-camera* isometric vector 1 y) 0.5) + (set! (-> *math-camera* y-pix) 112.0) + (set! (-> *math-camera* y-clip) 448.0) + (set! (-> *shadow-data* texoffset y) 112.5) + ) + (('150fps) + (set! (-> *video-parms* screen-sy) 224) + (set! (-> *setting-control* default screenx) 0) + (set! (-> *setting-control* default screeny) 8) + (set! (-> *video-parms* screen-pages-high) 7) + (set! (-> *video-parms* relative-y-scale) 1.0) + (set! *ticks-per-frame* 3906) + (set! (-> *math-camera* isometric vector 1 y) 0.5) + (set! (-> *math-camera* y-pix) 112.0) + (set! (-> *math-camera* y-clip) 448.0) + (set! (-> *shadow-data* texoffset y) 112.5) + ) ) (set-time-ratios *display* (-> *display* time-ratio)) (set! (-> *video-parms* reset-video-mode) #t) diff --git a/goal_src/engine/game/voicebox.gc b/goal_src/engine/game/voicebox.gc index 709200745f..4d700bed41 100644 --- a/goal_src/engine/game/voicebox.gc +++ b/goal_src/engine/game/voicebox.gc @@ -5,11 +5,10 @@ ;; name in dgo: voicebox ;; dgos: GAME, ENGINE -(define-extern *voicebox-sg* skeleton-group) - - ;; DECOMP BEGINS +(import "goal_src/import/speaker-ag.gc") + (deftype camera-voicebox (camera-slave) () :heap-base #x9a0 @@ -43,17 +42,13 @@ (defstate empty-state (process) - :code - (the-as (function none :behavior process) nothing) + :code (the-as (function none :behavior process) nothing) ) -(defskelgroup *voicebox-sg* speaker - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *voicebox-sg* speaker speaker-lod0-jg speaker-idle-ja + ((speaker-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defbehavior voicebox-track voicebox () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -87,8 +82,8 @@ ) ) (if (< 0.0 f0-8) - (set! (-> self twist) (seek (-> self twist) -0.4 (* 0.3 (-> *display* seconds-per-frame)))) - (set! (-> self twist) (seek (-> self twist) 0.4 (* 0.3 (-> *display* seconds-per-frame)))) + (seek! (-> self twist) -0.4 (* 0.3 (-> *display* seconds-per-frame))) + (seek! (-> self twist) 0.4 (* 0.3 (-> *display* seconds-per-frame))) ) ) (let ((a1-9 (new 'stack-no-clear 'event-message-block))) @@ -118,25 +113,22 @@ (defstate enter (voicebox) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('die) (go-virtual exit) ) ) ) - :trans - (behavior () + :trans (behavior () (voicebox-track) (if (< 0.1 (-> self blend)) (point-toward-point-clear-roll-pitch! (-> self root) (target-pos 0)) ) (none) ) - :code - (behavior () - (set-setting! *setting-control* self 'sound-flava #f 20.0 6) + :code (behavior () + (set-setting! 'sound-flava #f 20.0 (music-flava assistant)) (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9))) (send-event (ppointer->process (-> self parent-override)) @@ -162,38 +154,28 @@ (go-virtual idle) (none) ) - :post - (the-as (function none :behavior voicebox) ja-post) + :post (the-as (function none :behavior voicebox) ja-post) ) (defstate idle (voicebox) :virtual #t - :event - (-> (method-of-type voicebox enter) event) - :trans - voicebox-track - :code - (behavior () - (while #t + :event (-> (method-of-type voicebox enter) event) + :trans voicebox-track + :code (behavior () + (loop (suspend) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior voicebox) ja-post) + :post (the-as (function none :behavior voicebox) ja-post) ) (defstate exit (voicebox) :virtual #t - :trans - voicebox-track - :code - (behavior () - (clear-pending-settings-from-process *setting-control* self 'sound-flava) + :trans voicebox-track + :code (behavior () + (remove-setting! 'sound-flava) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self seeker target) 1.0) (while (and (< (-> self blend) 0.9999) @@ -213,8 +195,7 @@ 0 (none) ) - :post - (the-as (function none :behavior voicebox) ja-post) + :post (the-as (function none :behavior voicebox) ja-post) ) (defbehavior voicebox-init-by-other voicebox ((arg0 vector) (arg1 handle)) @@ -229,44 +210,24 @@ ) (defstate cam-voicebox (camera-voicebox) - :event - (-> cam-string event) - :enter - (-> cam-string enter) - :trans - (behavior () + :event (-> cam-string event) + :enter (-> cam-string enter) + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (deactivate self) ) (none) ) - :code - (-> cam-string code) + :code (-> cam-string code) ) (defun voicebox-spawn ((arg0 process) (arg1 vector)) (with-pp - (let* ((s3-0 (get-process *camera-dead-pool* camera-voicebox #x4000)) - (s4-0 (when s3-0 - (let ((t9-1 (method-of-type camera-voicebox activate))) - (t9-1 (the-as camera-voicebox s3-0) arg0 'camera-voicebox (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 cam-slave-init cam-voicebox #f) - (-> s3-0 ppointer) - ) - ) - ) - (when s4-0 - (let ((s5-1 (get-process *default-dead-pool* voicebox #x4000))) - (when s5-1 - (let ((t9-4 (method-of-type voicebox activate))) - (t9-4 (the-as voicebox s5-1) (ppointer->process s4-0) 'voicebox (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 voicebox-init-by-other arg1 (process->handle pp)) - (-> s5-1 ppointer) - ) + (let ((s4-0 (process-spawn camera-voicebox :init cam-slave-init cam-voicebox #f :from *camera-dead-pool* :to arg0)) + ) + (if s4-0 + (process-spawn voicebox arg1 (process->handle pp) :to (ppointer->process s4-0)) ) - ) ) ) ) diff --git a/goal_src/engine/geometry/bounding-box.gc b/goal_src/engine/geometry/bounding-box.gc index fd2ca6cbe7..5a54f4aef0 100644 --- a/goal_src/engine/geometry/bounding-box.gc +++ b/goal_src/engine/geometry/bounding-box.gc @@ -201,7 +201,7 @@ ) ) ) - + (.svf (-> obj min) current-min) (.svf (-> obj max) current-max) ) diff --git a/goal_src/engine/geometry/geometry.gc b/goal_src/engine/geometry/geometry.gc index 85bff478e1..70325702c9 100644 --- a/goal_src/engine/geometry/geometry.gc +++ b/goal_src/engine/geometry/geometry.gc @@ -1105,7 +1105,7 @@ ;; loop setup (label cfg-4) - (let ((a1-1 arg1) ;; current + (let ((a1-1 arg1) ;; current (a0-1 (+ arg0 1)) ;; next ) diff --git a/goal_src/engine/geometry/vol-h.gc b/goal_src/engine/geometry/vol-h.gc index 33581fe4f6..74d6a4513f 100644 --- a/goal_src/engine/geometry/vol-h.gc +++ b/goal_src/engine/geometry/vol-h.gc @@ -59,7 +59,7 @@ ) (set! (-> (the-as vol-control gp-0) process) arg0) (let* ((s5-1 (the-as res-lump (-> (the-as vol-control gp-0) process entity))) - (s4-0 (-> ((method-of-type res-lump lookup-tag-idx) (the-as entity s5-1) 'vol 'exact 0.0) lo)) + (s4-0 (-> ((method-of-type res-lump lookup-tag-idx) (the-as entity-actor s5-1) 'vol 'exact 0.0) lo)) ) (when (>= (the-as int s4-0) 0) (let ((s3-0 (the-as int s4-0)) @@ -81,7 +81,7 @@ ) ) (let* ((s5-2 (the-as res-lump (-> (the-as vol-control gp-0) process entity))) - (s4-1 (-> ((method-of-type res-lump lookup-tag-idx) (the-as entity s5-2) 'cutoutvol 'exact 0.0) lo)) + (s4-1 (-> ((method-of-type res-lump lookup-tag-idx) (the-as entity-actor s5-2) 'cutoutvol 'exact 0.0) lo)) ) (when (>= (the-as int s4-1) 0) (let ((s3-1 (the-as int s4-1)) diff --git a/goal_src/engine/geometry/vol.gc b/goal_src/engine/geometry/vol.gc index 6e47a897eb..fd8863216a 100644 --- a/goal_src/engine/geometry/vol.gc +++ b/goal_src/engine/geometry/vol.gc @@ -192,7 +192,7 @@ (dotimes (s3-0 (/ (-> obj point-count) 2)) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector s4-0) (the-as vector (&-> s4-0 4)) (the-as rgba s5-0) diff --git a/goal_src/engine/gfx/background.gc b/goal_src/engine/gfx/background.gc index 1123f746c4..e6637e4b5c 100644 --- a/goal_src/engine/gfx/background.gc +++ b/goal_src/engine/gfx/background.gc @@ -13,15 +13,15 @@ (defun background-upload-vu0 () "Set up VU0 for background." - + ;; We set up VU0 with some code and data. ;; It looks like the intended use is to be able to do something like ;; vcallms , and then some point stored in a vf register will be transformed. - ;; But I honestly - + ;; But I honestly + ;; would upload to vu0 program memory ;; (upload-vu-program background-vu0-block (&-> *background-work* wait-to-vu0)) - + ;; set up math-camera registers: (let ((at-0 *math-camera*)) (with-vf (vf16 vf17 vf18 vf19 vf20 vf21 vf22 vf23 vf24 vf25 vf26 vf27 vf28 vf29 vf30 vf31) @@ -44,9 +44,9 @@ (.lvf vf31 (&-> at-0 camera-temp vector 3 quad)) ) ) - + ;; here there would be a loop that waits for VIF0 DMA to be complete. - + ;; now a vcallms 0. TODO: this will store all of the above data. But camera-rot premultiplies all values by z's. ;; It's used in shrubbery (at least). ;; I suspect it will be easier to modify specific renderers than to try to implement this in a general way. @@ -86,7 +86,7 @@ ;;(spad-vis (the-as (pointer uint128) (+ #x38b0 #x70000000))) (spad-vis (scratchpad-ptr uint128 :offset VISIBLE_LIST_SCRATCHPAD)) ) - + (b! (not *artist-flip-visible*) cfg-5 :delay (nop!)) (nop!) (nop!) @@ -158,8 +158,8 @@ (&+! (-> dma-buf base) (* 16 1)) ) ) - - + + (let ((a3-3 (-> dma-buf base))) (let ((v1-38 (the-as object (-> dma-buf base)))) (set! (-> (the-as dma-packet v1-38) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -171,12 +171,12 @@ (bucket-id tfrag-0) - + dma-start (the-as (pointer dma-tag) a3-3) ) ) - + ) ) ) @@ -185,20 +185,20 @@ "Complete the background drawing. This function should run after the background engine has executed. " - + ;; set up common VU0 stuff for background. (background-upload-vu0) - + (#when PC_PORT (add-pc-port-background-data (-> *display* frames (-> *display* on-screen) frame global-buf) ) ) - + ;;;;;;;;;;;;;;;; ;; shrubbery ;;;;;;;;;;;;;;;; - + (set! (-> *instance-shrub-work* paused) (paused?)) (when (nonzero? (-> *background-work* shrub-tree-count)) @@ -238,8 +238,8 @@ ) ) - - + + (let ((gp-1 (the-as level #f))) (when (or (nonzero? (-> *background-work* tfrag-tree-count)) (nonzero? (-> *background-work* trans-tfrag-tree-count)) @@ -271,11 +271,11 @@ (.lvf vf31 (&-> v1-48 camera-temp vector 3 quad)) ) ) - + ;; TFRAG (let* ((v1-52 (max (-> *background-work* tfrag-tree-count) (-> *background-work* trans-tfrag-tree-count))) (s4-1 (the-as time-of-day-palette #f)) - (s5-2 (max (max v1-52 + (s5-2 (max (max v1-52 (-> *background-work* lowres-tfrag-tree-count)) (-> *background-work* lowres-trans-tfrag-tree-count) ) @@ -290,7 +290,7 @@ ) ;; loop over all tfrag trees (dotimes (s3-0 s5-2) - + ;;;;;;;;;;;;;; Normal TFRAG (let ((s2-0 (-> *background-work* tfrag-trees s3-0))) (when s2-0 @@ -310,7 +310,7 @@ ) ;; set the level. (set! (-> (scratchpad-object terrain-context) bsp lev-index) (-> s1-0 index)) - + (set! (-> *tfrag-work* min-dist z) 4095996000.0) ;; draw! (draw-drawable-tree-tfrag s2-0 s1-0) @@ -321,7 +321,7 @@ ) ) ) - + ;;;;;;;;;;;;;; Trans TFRAG (let ((s2-1 (-> *background-work* trans-tfrag-trees s3-0))) (when s2-1 @@ -337,7 +337,7 @@ ) ) (set! (-> (scratchpad-object terrain-context) bsp lev-index) (-> s1-1 index)) - + (set! (-> *tfrag-work* min-dist z) 4095996000.0) (draw-drawable-tree-trans-tfrag s2-1 s1-1) ) @@ -346,8 +346,8 @@ ) ) ) - - + + ;;;;;;;;;;;;;; DIRT TFRAG (let ((s2-2 (-> *background-work* dirt-tfrag-trees s3-0))) (when s2-2 @@ -363,7 +363,7 @@ ) ) (set! (-> (scratchpad-object terrain-context) bsp lev-index) (-> s1-2 index)) - + (set! (-> *tfrag-work* min-dist z) 4095996000.0) (draw-drawable-tree-dirt-tfrag s2-2 s1-2) ) @@ -374,8 +374,8 @@ ) ) ) - - + + ;;;;;;;;;;;;;; ICE TFRAG (let ((s2-3 (-> *background-work* ice-tfrag-trees s3-0))) (when s2-3 @@ -391,7 +391,7 @@ ) ) (set! (-> (scratchpad-object terrain-context) bsp lev-index) (-> s1-3 index)) - + (set! (-> *tfrag-work* min-dist z) 4095996000.0) (draw-drawable-tree-ice-tfrag s2-3 s1-3) ) @@ -402,9 +402,9 @@ ) ) ) - - - + + + ;;;;;;;;;;;;;; LOWRES TFRAG (let ((s2-4 (-> *background-work* lowres-tfrag-trees s3-0))) (when s2-4 @@ -420,13 +420,13 @@ ) ) (set! (-> (scratchpad-object terrain-context) bsp lev-index) (-> s1-4 index)) - + ;;(format 0 "draw ~A~%" s2-4) (draw-drawable-tree-tfrag s2-4 s1-4) ) ) ) - + ;;;;;;;;;;;;;; LOWRES TRANS TFRAG (let ((s2-5 (-> *background-work* lowres-trans-tfrag-trees s3-0))) (when s2-5 @@ -442,7 +442,7 @@ ) ) (set! (-> (scratchpad-object terrain-context) bsp lev-index) (-> s1-5 index)) - + (set! (-> *tfrag-work* min-dist z) 4095996000.0) (draw-drawable-tree-trans-tfrag s2-5 s1-5) ) @@ -463,8 +463,8 @@ ) ) ) - - + + ;;;;;;;;;; TIE (TFRAG Instance Engine) ;; common setup @@ -480,7 +480,7 @@ (new 'static 'rgba :r #x40 :b #x40 :a #x80) ) ) - + ;;;;;;;;;; Normal TIE (dotimes (s5-3 (-> *background-work* tie-tree-count)) (let ((s4-2 (-> *background-work* tie-levels s5-3))) @@ -507,11 +507,12 @@ (new 'static 'rgba :r #x80 :g #x20 :b #x60 :a #x80) ) ) - #| + ;; TIE Generic (dotimes (gp-2 (-> *background-work* tie-tree-count)) (when (nonzero? (-> *background-work* tie-generic gp-2)) - (let* ((s5-4 (-> *background-work* tie-levels gp-2 foreground-sink-group 0 generic-sink)) + ;; send to the generic foreground with tfrag textures bucket for this level + (let* ((s5-4 (-> *background-work* tie-levels gp-2 tfrag-tex-foreground-sink-group generic-sink)) (s3-1 (-> *display* frames (-> *display* on-screen) frame global-buf)) (s4-3 (-> s3-1 base)) ) @@ -533,9 +534,8 @@ ) ) ) - |# ) - + ) 0 (none) diff --git a/goal_src/engine/gfx/depth-cue.gc b/goal_src/engine/gfx/depth-cue.gc index 9e171d4b0d..0625dfecc4 100644 --- a/goal_src/engine/gfx/depth-cue.gc +++ b/goal_src/engine/gfx/depth-cue.gc @@ -7,53 +7,33 @@ ;; DECOMP BEGINS -(define - *depth-cue-work* +(define *depth-cue-work* (new 'static 'depth-cue-work - :texture-strip-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + :texture-strip-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x50ab400000008001 #x43431) + :gif (new 'static 'array uint64 2 #x50ab400000008001 #x43431) ) - :temp-strip-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + :temp-strip-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x508b400000008001 #x43431) + :gif (new 'static 'array uint64 2 #x508b400000008001 #x43431) ) - :stencil-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x17 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x17 :cmd (vif-cmd direct) :msk #x1) + :stencil-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x17 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x17 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #xb003400000008002 #x44444444441) + :gif (new 'static 'array uint64 2 #xb003400000008002 #x44444444441) ) - :set-color - (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) - :draw-color - (new 'static 'vector4w :x #x84 :y #x84 :z #x84 :w #x80) - :depth - (new 'static 'depth-cue-data :data (new 'static 'vector :x 1.0 :z 163840.0)) - :front - (new 'static 'depth-cue-data :data (new 'static 'vector :x 0.999 :y 0.4 :z 4096.0 :w 1.0)) + :set-color (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) + :draw-color (new 'static 'vector4w :x #x84 :y #x84 :z #x84 :w #x80) + :depth (new 'static 'depth-cue-data :data (new 'static 'vector :x 1.0 :z 163840.0)) + :front (new 'static 'depth-cue-data :data (new 'static 'vector :x 0.999 :y 0.4 :z 4096.0 :w 1.0)) ) ) diff --git a/goal_src/engine/gfx/eye-h.gc b/goal_src/engine/gfx/eye-h.gc index 408211d829..c7a3bfb7a7 100644 --- a/goal_src/engine/gfx/eye-h.gc +++ b/goal_src/engine/gfx/eye-h.gc @@ -12,13 +12,13 @@ ;; DECOMP BEGINS (deftype eye (structure) - ((data vector 2 :inline :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (lid float :offset 8) - (iris-scale float :offset 16) - (pupil-scale float :offset 20) - (lid-scale float :offset 24) + ((data vector 2 :inline :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + (lid float :offset 8) + (iris-scale float :offset 16) + (pupil-scale float :offset 20) + (lid-scale float :offset 24) ) :method-count-assert 9 :size-assert #x20 diff --git a/goal_src/engine/gfx/eye.gc b/goal_src/engine/gfx/eye.gc index e5f39fe7d7..2446d6216f 100644 --- a/goal_src/engine/gfx/eye.gc +++ b/goal_src/engine/gfx/eye.gc @@ -4,67 +4,40 @@ ;; name: eye.gc ;; name in dgo: eye ;; dgos: GAME, ENGINE +;; note: changed for high fps ;; DECOMP BEGINS -(define *eye-work* - (new 'static 'eye-work - :sprite-tmpl - (new 'static 'dma-gif-packet - :dma-vif (new 'static 'dma-packet - :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) - ) - :gif0 (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :fst #x1) - :nreg #x5 - ) - :gif1 (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id uv) - :regs2 (gif-reg-id xyz2) - :regs3 (gif-reg-id uv) - :regs4 (gif-reg-id xyz2) - ) - ) - :sprite-tmpl2 - (new 'static 'dma-gif-packet - :dma-vif (new 'static 'dma-packet - :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) - ) - :gif0 (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1 :fst #x1) - :nreg #x5 - ) - :gif1 (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id uv) - :regs2 (gif-reg-id xyz2) - :regs3 (gif-reg-id uv) - :regs4 (gif-reg-id xyz2) - ) - ) - :adgif-tmpl - (new 'static 'dma-gif-packet - :dma-vif (new 'static 'dma-packet - :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) - ) - :gif0 (new 'static 'gif-tag64 :nloop #x5 :eop #x1 :nreg #x1) - :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)) - ) - :blink-table - (new 'static 'array float 10 0.0 0.667 0.9 1.0 1.0 1.0 1.0 0.333 0.1 0.0) - ) +(define *eye-work* (new 'static 'eye-work + :sprite-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x508b400000008001 #x53531) + ) + :sprite-tmpl2 (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x50ab400000008001 #x53531) + ) + :adgif-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x1000000000008005 #xe) + ) + :blink-table (new 'static 'array float 10 0.0 0.667 0.9 1.0 1.0 1.0 1.0 0.333 0.1 0.0) + ) ) +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch (defun render-eyes ((arg0 dma-buffer) (arg1 eye-control) (arg2 int)) (local-vars (sv-16 float)) (let ((s4-0 32) @@ -201,7 +174,6 @@ (a3-9 (the int (+ f28-0 f0-6))) (t1-0 (the int (+ f26-0 f0-6))) ) - ;; (format 0 "eye: ~f ~f~%" f28-0 f26-0) (set! (-> a1-25 0 quad) (-> *eye-work* sprite-tmpl dma-vif quad)) (set! (-> a1-25 1 quad) (-> *eye-work* sprite-tmpl quad 1)) (set-vector! (-> a1-25 2) 128 128 128 128) @@ -717,7 +689,7 @@ ) ) ) - + ;; Setup GS for level 1 eyes (let* ((s5-1 (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-1 (-> s5-1 base)) @@ -780,7 +752,7 @@ ) ) ) - + ;; Setup GS for common eyes (let* ((s5-2 (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-2 (-> s5-2 base)) @@ -837,16 +809,16 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id merc-eyes) + (bucket-id eyes) gp-2 (the-as (pointer dma-tag) a3-5) ) ) ) - + ;; rendering of eyes. (dotimes (gp-3 11) - + ;; grab the eye and the process (let* ((s5-3 (-> *eye-control-array* data gp-3)) (v1-40 (handle->process (-> s5-3 process))) @@ -861,7 +833,8 @@ (when (not (paused?)) (cond ((and (>= (-> s5-3 left lid) 0.0) (>= (-> s5-3 right lid) 0.0)) - (set! (-> s5-3 random-time) (the-as uint 60)) + (set! (-> s5-3 random-time) (the int (* (/ 1.0 (-> *display* time-adjust-ratio)) ;; changed for high fps + (the-as uint 60)))) (set! (-> s5-3 blink) 0.0) ) (else @@ -870,7 +843,12 @@ (when (< v1-54 (the-as uint 10)) (set! (-> s5-3 blink) (-> *eye-work* blink-table v1-54)) (if (zero? v1-54) - (set! (-> s5-3 random-time) (the-as uint (the int (rand-vu-float-range 60.0 240.0)))) + (set! (-> s5-3 random-time) (the-as uint (the int (* (if (or (= (-> *setting-control* current video-mode) '150fps) + (= (-> *setting-control* current video-mode) '100fps)) + (if (= (-> *setting-control* current video-mode) '150fps) + 2.5 + 1.6667) + 1.0) (rand-vu-float-range 60.0 240.0))))) ) ) ) @@ -919,7 +897,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id merc-eyes) + (bucket-id eyes) s4-1 (the-as (pointer dma-tag) a3-7) ) @@ -1105,7 +1083,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id merc-eyes) + (bucket-id eyes) gp-6 (the-as (pointer dma-tag) a3-10) ) @@ -1115,7 +1093,6 @@ (none) ) -;; definition for function get-eye-block (defun get-eye-block ((arg0 int) (arg1 int)) (#when PC_PORT ;; hack to make this easier to figure out on the PC side. @@ -1128,7 +1105,6 @@ ) ) -;; definition for function convert-eye-data (defun convert-eye-data ((arg0 eye) (arg1 uint)) (local-vars (v0-0 float) @@ -1159,9 +1135,7 @@ ) ) -;; definition for function merc-eye-anim -;; INFO: Return type mismatch int vs none. -(defun merc-eye-anim ((arg0 manipy)) +(defun merc-eye-anim ((arg0 process-drawable)) (let* ((s5-0 (-> arg0 draw mgeo header eye-ctrl)) (a0-1 (-> arg0 skel root-channel 0)) (s4-0 (-> a0-1 frame-group)) diff --git a/goal_src/engine/gfx/font-h.gc b/goal_src/engine/gfx/font-h.gc index dd126384a8..fe9333159e 100644 --- a/goal_src/engine/gfx/font-h.gc +++ b/goal_src/engine/gfx/font-h.gc @@ -45,7 +45,7 @@ (light-yellow 32) (red-orange 33) (another-orange-red 34) - + (red 3) (red2 4) (yellow 5) @@ -766,4 +766,4 @@ (define-extern draw-string (function string dma-buffer font-context float)) -(define-extern draw-string-xy (function string dma-buffer int int font-color font-flags none)) \ No newline at end of file +(define-extern draw-string-xy (function string dma-buffer int int font-color font-flags float)) \ No newline at end of file diff --git a/goal_src/engine/gfx/font.gc b/goal_src/engine/gfx/font.gc index 62076f2fa7..15018341f1 100644 --- a/goal_src/engine/gfx/font.gc +++ b/goal_src/engine/gfx/font.gc @@ -637,7 +637,7 @@ (t7-40 uint) (t7-41 uint) (t7-42 uint) (t7-43 uint) (t7-44 uint) (t7-45 uint) (t7-46 uint) (t7-47 uint) (t7-48 uint) (t7-49 uint) (t7-50 uint) (t7-51 uint) (t7-52 uint) (t7-53 uint) (t8-0 uint) (t8-1 int) (t8-2 uint) (t8-3 int) (t8-4 uint) (t8-5 int)) - + (set! r0 (the-as uint128 0)) (rlet ((acc :class vf) (Q :class vf) @@ -676,8 +676,19 @@ (.lvf vf26 (&-> v1-0 hvdf-off quad)) (.lvf vf27 (&-> v1-0 hvdf-off quad)) ) - (.add.w.vf vf26 vf26 vf0 :mask #b11) - (.add.w.vf vf26 vf26 vf0 :mask #b1) + ;; PC port modification: adjust shadow x to account for widescreen + (let ((shadow-x 2.) + (shadow-y 1.) + (correction (-> *video-parms* relative-x-scale)) + (temp-vec (new-stack-vector0))) + (set! (-> temp-vec quad) (-> *math-camera* hvdf-off quad)) + (+! (-> temp-vec x) (* correction shadow-x)) + (+! (-> temp-vec y) shadow-y) + (.lvf vf26 (&-> temp-vec quad)) + ) + ;; original version + ; (.add.w.vf vf26 vf26 vf0 :mask #b11) + ; (.add.w.vf vf26 vf26 vf0 :mask #b1) (let ((v1-1 (-> arg2 mat))) (.lvf vf25 (&-> arg2 context-vec quad)) (.lvf vf23 (&-> arg2 origin quad)) @@ -1815,17 +1826,7 @@ (defun draw-string-xy ((str string) (buf dma-buffer) (x int) (y int) (color font-color) (flags font-flags)) "Draw a string at the given xy location." - (let ((context (new 'stack 'font-context - *font-default-matrix* - x - y - 0.0 - color - flags - ) - ) - ) + (let ((context (new 'stack 'font-context *font-default-matrix* x y 0.0 color flags))) (draw-string str buf context) ) - (none) ) diff --git a/goal_src/engine/gfx/generic/generic-effect.gc b/goal_src/engine/gfx/generic/generic-effect.gc index e2698781c5..d660c9e78c 100644 --- a/goal_src/engine/gfx/generic/generic-effect.gc +++ b/goal_src/engine/gfx/generic/generic-effect.gc @@ -104,6 +104,14 @@ ) (defun upload-vu0-program ((func vu-function) (wait-ptr pointer)) + "Upload and block until done. + Generating the DMA is highly optimized." + (none) + ) + +(defun generic-upload-vu0 () + "Start upload, but don't sync yet. + Generating the DMA chain is not as optimized." (none) ) @@ -137,11 +145,35 @@ (none) ) +(defun generic-initialize ((arg0 generic-dma-foreground-sink) (arg1 matrix) (arg2 vu-lights)) + (generic-work-init arg0) + (generic-upload-vu0) + ;;(let ((a2-1 (+ #x2e20 (the-as int #x70000000))) + (let ((a2-1 (-> (scratchpad-object terrain-context) work foreground generic-work fx-buf work consts matrix)) + (v1-1 (-> arg1 vector 0 quad)) + (a0-2 (-> arg1 vector 1 quad)) + (a1-1 (-> arg1 vector 2 quad)) + (a3-0 (-> arg1 vector 3 quad)) + ) + (set! (-> a2-1 vector 0 quad) v1-1) + (set! (-> a2-1 vector 1 quad) a0-2) + (set! (-> a2-1 vector 2 quad) a1-1) + (set! (-> a2-1 vector 3 quad) a3-0) + ) + (if arg2 + (quad-copy! (the-as pointer (-> (scratchpad-object terrain-context) work foreground generic-work fx-buf work lights)) (the-as pointer arg2) 7) + ) + 0 + (none) + ) + +(defun generic-wrapup ((arg0 generic-dma-foreground-sink)) + (set! (-> arg0 state gifbuf-adr) (-> (scratchpad-object terrain-context) work foreground generic-work saves gifbuf-adr)) + (set! (-> arg0 state inbuf-adr) (-> (scratchpad-object terrain-context) work foreground generic-work saves inbuf-adr)) + (none) + ) + (def-mips2c generic-prepare-dma-single function) - - (def-mips2c generic-prepare-dma-double function) - (def-mips2c generic-light-proc function) - (def-mips2c generic-envmap-proc function) \ No newline at end of file diff --git a/goal_src/engine/gfx/generic/generic-h.gc b/goal_src/engine/gfx/generic/generic-h.gc index dae6f0510a..efb986982b 100644 --- a/goal_src/engine/gfx/generic/generic-h.gc +++ b/goal_src/engine/gfx/generic/generic-h.gc @@ -10,6 +10,21 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; The generic renderer is the slow but general renderer. +;; On the EE side, it supports effects like lighting, environment mapping, +;; level of detail, and skeletal animation. + +;; On the VU side, it has no effects, other than scissoring. + +;; It is slow for many reasons: +;; - no EE side scissoring detection - each triangle is checked on the VU. +;; - EE side effects waste lots of time packing to the upload format +;; - no instancing support +;; - no vertex duplication support + +;; There are three paths to using generic: +;; - merc will use generic for scissoring or envmap (called mercneric) +;; - shrub will use generic for scissoring +;; - tie will use generic for envmap ;; gsf, what does it stand for? @@ -166,7 +181,7 @@ (gifbuf-adr uint32 :offset-assert 68) (inbuf-adr uint32 :offset-assert 72) (fade-val uint32 :offset-assert 76) - (time-of-day-color uint32 :offset-assert 80) + (time-of-day-color rgba :offset-assert 80) (to-vu0-waits uint32 :offset-assert 84) (to-spr-waits uint32 :offset-assert 88) (from-spr-waits uint32 :offset-assert 92) diff --git a/goal_src/engine/gfx/generic/generic-tie.gc b/goal_src/engine/gfx/generic/generic-tie.gc index a8360fff2f..71f3023a42 100644 --- a/goal_src/engine/gfx/generic/generic-tie.gc +++ b/goal_src/engine/gfx/generic/generic-tie.gc @@ -5,3 +5,109 @@ ;; name in dgo: generic-tie ;; dgos: GAME, ENGINE +(define *generic-tie* #t) + +(def-mips2c generic-tie-dma-to-spad-sync (function object object none)) +(def-mips2c generic-envmap-dproc function) +(def-mips2c generic-interp-dproc function) +(def-mips2c generic-no-light-dproc function) +(def-mips2c generic-tie-convert (function none)) + + +(defun generic-tie-execute ((arg0 generic-dma-foreground-sink) (arg1 dma-buffer) (arg2 basic)) + ;; (local-vars (v1-28 uint128) (v1-29 uint128) (v1-30 uint128) (a0-33 int) (a0-35 int)) + ;; (rlet ((vf1 :class vf)) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask generic)) + (when *generic-tie* + (if *debug-segment* + (add-frame + (-> *display* frames (-> *display* on-screen) frame profile-bar 0) + 'draw + (new 'static 'rgba :r #x40 :b #x40 :a #x80) + ) + ) + (reset! (-> *perf-stats* data 2)) + + (when (nonzero? arg2) + (let ((s4-0 (-> arg1 base))) + (set! (-> (scratchpad-object terrain-context) work foreground generic-work saves basep) (the-as uint (-> arg1 base))) + (generic-initialize arg0 (-> *math-camera* perspective) *default-lights*) + (generic-tie-dma-to-spad-sync arg2 (-> (scratchpad-object terrain-context) work foreground generic-work in-buf tie input-a)) + ; (let ((v1-24 (+ 716 (the-as int #x70000000)))) + + ;; set up tie memory layout. + (let ((v1-24 (-> (scratchpad-object terrain-context) work foreground generic-work in-buf tie shadow))) + (set! (-> v1-24 end-of-chain) (the-as uint 0)) + (set! (-> v1-24 tie-type) 0) + (set! (-> v1-24 out-buf) *gsf-buffer*) + (set! (-> v1-24 ptr-buf) (the-as uint (+ 768 (scratchpad-object int)))) + (set! (-> v1-24 ptr-inst) (the-as uint (+ 3648 (scratchpad-object int)))) + (set! (-> v1-24 inst-xor) 4640) + (set! (-> v1-24 write-limit) (the-as uint (&+ (-> arg1 end) -65536))) + ) + ;;(let ((v1-26 (+ 748 (the-as int #x70000000)))) + (let ((v1-26 (-> (scratchpad-object terrain-context) work foreground generic-work in-buf tie shadow calls))) + (set! (-> v1-26 generic-prepare-dma-double) generic-prepare-dma-double) + (set! (-> v1-26 generic-envmap-dproc) generic-envmap-dproc) ;; todo + (set! (-> v1-26 generic-interp-dproc) generic-interp-dproc) ;; todo + (set! (-> v1-26 generic-no-light-dproc) generic-no-light-dproc) ;; todo + ) + + (set! (-> (scratchpad-object terrain-context) work foreground generic-work saves time-of-day-color r) + (the int (-> *time-of-day-context* current-sun env-color x))) + (set! (-> (scratchpad-object terrain-context) work foreground generic-work saves time-of-day-color g) + (the int (-> *time-of-day-context* current-sun env-color y))) + (set! (-> (scratchpad-object terrain-context) work foreground generic-work saves time-of-day-color b) + (the int (-> *time-of-day-context* current-sun env-color z))) + (set! (-> (scratchpad-object terrain-context) work foreground generic-work saves time-of-day-color a) + (the int (-> *time-of-day-context* current-sun env-color w))) + + ; (let ((v1-27 *time-of-day-context*)) + ; (let ((a0-26 (+ 16 (the-as int #x70000000)))) + ; (.lvf vf1 (&-> v1-27 current-sun env-color quad)) + ; (.ftoi.vf vf1 vf1) + ; (.mov v1-28 vf1) + ; (.ppach v1-29 (the-as uint128 0) v1-28) + ; (.ppacb v1-30 r0 (the-as int v1-29)) + ; (set! (-> a0-26 foreground generic-work saves time-of-day-color) (the-as uint v1-30)) + ; ) + ; ) + (generic-tie-convert) + (set! (-> arg1 base) + (the-as pointer (-> (scratchpad-object terrain-context) work foreground generic-work saves basep)) + ) + (generic-wrapup arg0) + (set! (-> (scratchpad-object terrain-context) work foreground generic-work fx-buf work consts mscal-tag) + (logior (logand (-> (scratchpad-object terrain-context) work foreground generic-work fx-buf work consts mscal-tag) + -65536 + ) + 6 + ) + ) + ; (dma-sync (the-as pointer #x1000d000) 0 0) + (let ((v1-37 *dma-mem-usage*)) + (when (nonzero? v1-37) + (set! (-> v1-37 length) (max 18 (-> v1-37 length))) + (set! (-> v1-37 data 17 name) "tie-generic") + (+! (-> v1-37 data 17 count) 1) + (+! (-> v1-37 data 17 used) (&- (-> arg1 base) (the-as uint s4-0))) + (set! (-> v1-37 data 17 total) (-> v1-37 data 17 used)) + ) + ) + ) + ) + (read! (-> *perf-stats* data 2)) + (if *debug-segment* + (add-frame + (-> *display* frames (-> *display* on-screen) frame profile-bar 0) + 'draw + (new 'static 'rgba :r #xd2 :g #xd2 :b #x50 :a #x80) + ) + ) + ) + 0 + ) + 0 + (none) + ;) + ) \ No newline at end of file diff --git a/goal_src/engine/gfx/generic/generic-vu1-h.gc b/goal_src/engine/gfx/generic/generic-vu1-h.gc index ee79fc0b46..2226e74de6 100644 --- a/goal_src/engine/gfx/generic/generic-vu1-h.gc +++ b/goal_src/engine/gfx/generic/generic-vu1-h.gc @@ -5,19 +5,20 @@ ;; name in dgo: generic-vu1-h ;; dgos: GAME, ENGINE - +;; "pris" refers to foreground drawing, with normals. (deftype pris-mtx (structure) ((data float 32 :offset 0) (vector vector 8 :inline :offset 0) - (t-mtx matrix :inline :offset 0) - (n-mtx matrix3 :inline :offset 64) - (scale vector :inline :offset 112) + (t-mtx matrix :inline :offset 0) ;; transformation matrix (including perspective) + (n-mtx matrix3 :inline :offset 64) ;; rotation matrix for the normals + (scale vector :inline :offset 112) ;; not sure this is used... merc doesn't do it this way. ) :method-count-assert 9 :size-assert #x80 :flag-assert #x900000080 ) +;; ?? (deftype generic-pris-mtx-save (structure) ((loc-mtx pris-mtx :inline :offset-assert 0) (par-mtx pris-mtx :inline :offset-assert 128) @@ -28,6 +29,7 @@ :flag-assert #x900000180 ) +;; VU1 constants for the generic renderer. (deftype generic-constants (structure) ((fog vector :inline :offset-assert 0) (adgif gs-gif-tag :inline :offset-assert 16) ;; was qword diff --git a/goal_src/engine/gfx/generic/generic-work-h.gc b/goal_src/engine/gfx/generic/generic-work-h.gc index a4a4109a89..619366b20d 100644 --- a/goal_src/engine/gfx/generic/generic-work-h.gc +++ b/goal_src/engine/gfx/generic/generic-work-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: generic-work-h ;; dgos: GAME, ENGINE +;; common types for internal generic work. + (deftype generic-input-buffer (structure) ((merc generic-merc-work :inline :offset 0) (tie generic-tie-work :inline :offset 0) diff --git a/goal_src/engine/gfx/generic/generic.gc b/goal_src/engine/gfx/generic/generic.gc index b174041586..3304ea7f39 100644 --- a/goal_src/engine/gfx/generic/generic.gc +++ b/goal_src/engine/gfx/generic/generic.gc @@ -8,15 +8,15 @@ (define *generic-foreground-sinks* (new 'static 'boxed-array :type generic-dma-foreground-sink :length 0 :allocated-length 9)) -(set! (-> *generic-foreground-sinks* 0) (-> *level* level0 foreground-sink-group 0 generic-sink)) -(set! (-> *generic-foreground-sinks* 1) (-> *level* level0 foreground-sink-group 1 generic-sink)) -(set! (-> *generic-foreground-sinks* 2) (-> *level* level1 foreground-sink-group 0 generic-sink)) -(set! (-> *generic-foreground-sinks* 3) (-> *level* level1 foreground-sink-group 1 generic-sink)) -(set! (-> *generic-foreground-sinks* 4) (-> *level* level-default foreground-sink-group 0 generic-sink)) -(set! (-> *generic-foreground-sinks* 5) (-> *level* level-default foreground-sink-group 1 generic-sink)) -(set! (-> *generic-foreground-sinks* 6) (new 'static 'generic-dma-foreground-sink :bucket (bucket-id generic-foreground))) -(set! (-> *generic-foreground-sinks* 7) (-> *level* level0 foreground-sink-group 2 generic-sink)) -(set! (-> *generic-foreground-sinks* 8) (-> *level* level1 foreground-sink-group 2 generic-sink)) +(set! (-> *generic-foreground-sinks* 0) (-> *level* level0 tfrag-tex-foreground-sink-group generic-sink)) +(set! (-> *generic-foreground-sinks* 1) (-> *level* level0 pris-tex-foreground-sink-group generic-sink)) +(set! (-> *generic-foreground-sinks* 2) (-> *level* level1 tfrag-tex-foreground-sink-group generic-sink)) +(set! (-> *generic-foreground-sinks* 3) (-> *level* level1 pris-tex-foreground-sink-group generic-sink)) +(set! (-> *generic-foreground-sinks* 4) (-> *level* level-default tfrag-tex-foreground-sink-group generic-sink)) +(set! (-> *generic-foreground-sinks* 5) (-> *level* level-default pris-tex-foreground-sink-group generic-sink)) +(set! (-> *generic-foreground-sinks* 6) (new 'static 'generic-dma-foreground-sink :bucket (bucket-id shrub-generic1))) +(set! (-> *generic-foreground-sinks* 7) (-> *level* level0 water-tex-foreground-sink-group generic-sink)) +(set! (-> *generic-foreground-sinks* 8) (-> *level* level1 water-tex-foreground-sink-group generic-sink)) (defun generic-dma-foreground-sink-init ((arg0 generic-dma-foreground-sink)) (set! (-> arg0 state gifbuf-adr) (the-as uint 837)) diff --git a/goal_src/engine/gfx/hw/display-h.gc b/goal_src/engine/gfx/hw/display-h.gc index 89734b4563..deaff89224 100644 --- a/goal_src/engine/gfx/hw/display-h.gc +++ b/goal_src/engine/gfx/hw/display-h.gc @@ -110,7 +110,7 @@ (draw draw-env :offset-assert 12) (frame display-frame :offset-assert 16) ) - + :allow-misaligned :method-count-assert 9 :size-assert #x14 diff --git a/goal_src/engine/gfx/hw/display.gc b/goal_src/engine/gfx/hw/display.gc index ade8e01ef3..1f066495b3 100644 --- a/goal_src/engine/gfx/hw/display.gc +++ b/goal_src/engine/gfx/hw/display.gc @@ -17,7 +17,7 @@ (defun get-current-time () "Get the in game time. This advances when the game is unpaused. - This increase at the same rate for PAL/NTSC and if the game is lagging." + This increases at the same rate for PAL/NTSC and if the game is lagging." (-> *display* base-frame-counter) ) @@ -32,12 +32,12 @@ (defmethod set-time-ratios display ((obj display) (slowdown float)) "Set the time ratios for the current game speed. For example, set slowdown = 1.0 if the game is running at full speed or slowdown = 2.0 if the game is running at half speed." - + ;; don't allow slowdowns of more than 4x. This prevents the dt's in the physics ;; calculations from getting huge. (let ((ratio (fmin 4.0 slowdown))) (set! (-> obj time-ratio) ratio) - (case (get-video-mode) + (case (get-video-mode) (('pal) (set! (-> obj time-adjust-ratio) (* 1.2 ratio)) (set! (-> obj seconds-per-frame) (* 0.02 ratio)) @@ -45,13 +45,30 @@ ;; 6 "ticks" per frame * 50 fps = 300 ticks per second. (set! (-> obj time-factor) 6.0) ) - (else + (('ntsc) (set! (-> obj time-adjust-ratio) ratio) (set! (-> obj seconds-per-frame) (* 0.016666668 ratio)) (set! (-> obj frames-per-second) (* 60.0 (/ 1.0 ratio))) ;; 5 "ticks" per frame * 60 fps = 300 ticks per second. (set! (-> obj time-factor) 5.0) ) + (('100fps) + (set! (-> obj time-adjust-ratio) (* 0.6 ratio)) + (set! (-> obj seconds-per-frame) (* 0.01 ratio)) + (set! (-> obj frames-per-second) (* 100.0 (/ 1.0 ratio))) + ;; 3 "ticks" per frame * 100 fps = 300 ticks per second. + (set! (-> obj time-factor) 3.0) + ) + (('150fps) + (set! (-> obj time-adjust-ratio) (* 0.4 ratio)) + (set! (-> obj seconds-per-frame) (* (1/ 150.0) ratio)) + (set! (-> obj frames-per-second) (* 150.0 (/ 1.0 ratio))) + ;; 2 "ticks" per frame * 150 fps = 300 ticks per second. + (set! (-> obj time-factor) 2.0) + ) + (else + (format #t "Warning: Tried to set unsupported video-mode") + ) ) ) (-> obj time-ratio) @@ -76,7 +93,7 @@ fpb: the framebuffer." ;; these will eventually be consumed by a sony function. I think it just sets GS registers. - + ;; set these to the mode that makes the GS actually work. Basically every game uses exactly this. (set! (-> env pmode) (new 'static 'gs-pmode :en1 #x1 :mmod #x1 :slbg #x1 :alp #xff) @@ -243,7 +260,8 @@ (set! (-> disp integral-frame-counter) (seconds 1000)) (set! (-> disp real-integral-frame-counter) (seconds 1000)) - ;; and the "old" version, which I think was their value on the last... frame? + ;; and fake the "old" versions. These are normally set to the value on the previous frame + ;; (which may jump due to saving/loading or lag) (set! (-> disp old-base-frame-counter) (+ (-> disp base-frame-counter) -1)) (set! (-> disp old-game-frame-counter) (+ (-> disp game-frame-counter) -1)) (set! (-> disp old-real-frame-counter) (+ (-> disp real-frame-counter) -1)) @@ -458,7 +476,7 @@ (defun draw-sprite2d-xy ((buf dma-buffer) (x int) (y int) (w int) (h int) (color rgba)) "Draw a sprite primitive with the given color and dimensions." - + ;; create context and clip dimensions. (let* ((context (new 'stack 'draw-context x y w h color)) (draw-x (max 1792 (min 2304 (+ (-> context orgx) 1792)))) @@ -473,14 +491,14 @@ ;; remember the address of the first dma-tag ) (with-cnt-vif-block (buf) - + (dma-buffer-add-gif-tag buf (new 'static 'gif-tag64 :nloop 1 :eop 1 :flg (gif-flag reg-list) :nreg 4) (gs-reg-list prim rgbaq xyzf2 xyzf2) ) (dma-buffer-add-uint64 buf (new 'static 'gs-prim :prim (gs-prim-type sprite) :abe 1) (-> context color 0) (new 'static 'gs-xyzf :x (* draw-x 16) :y (* draw-y 16) :z #x3fffff) - (new 'static 'gs-xyzf :x (* (minmax (+ draw-x draw-w) 1792 2304) 16) + (new 'static 'gs-xyzf :x (* (minmax (+ draw-x draw-w) 1792 2304) 16) :y (* (minmax (+ draw-y draw-h) (-> *video-parms* screen-miny) (-> *video-parms* screen-maxy)) 16) :z #x3fffff) ) ) diff --git a/goal_src/engine/gfx/hw/gs.gc b/goal_src/engine/gfx/hw/gs.gc index e09afc33f7..c2e3a02655 100644 --- a/goal_src/engine/gfx/hw/gs.gc +++ b/goal_src/engine/gfx/hw/gs.gc @@ -704,7 +704,7 @@ ;; we unfortunately kind of need this (defmacro gif-tag->static-array (tag regs) "Allocates a new static array of two uint64's making up the gif-tag and the tag registers" - + `(new 'static 'array uint64 2 ,tag ,regs) ) @@ -714,7 +714,7 @@ (defmacro gs-reg-list (&rest reg-ids) "Generate a giftag register descriptor list from reg-ids." - + (let ((reg-count (length reg-ids))) (when (> (length reg-ids) 16) (ferror "too many regs passed to gs-reg-list") @@ -722,14 +722,14 @@ (let ((list-to-splice '()) (cur-lst reg-ids) (i -1)) - + ;; this is questionable. (while (and (not (null? cur-lst)) (< i 15)) (push! list-to-splice (cons 'gif-reg-id (cons (car cur-lst) '()))) (push! list-to-splice (string->symbol-format ":regs{}" (inc! i))) (pop! cur-lst) ) - + `(new 'static 'gif-tag-regs ,@list-to-splice ) diff --git a/goal_src/engine/gfx/hw/vu1-user-h.gc b/goal_src/engine/gfx/hw/vu1-user-h.gc index de2cb3736e..f67ab3467f 100644 --- a/goal_src/engine/gfx/hw/vu1-user-h.gc +++ b/goal_src/engine/gfx/hw/vu1-user-h.gc @@ -23,7 +23,7 @@ (shrub-near 12) (billboard 13) (trans-shrubbery 14) - (trans-frag 15) + (trans-tfrag 15) (sprite 16) (shadow 17) (depth-cue 18) @@ -45,7 +45,7 @@ shrub-near billboard trans-shrubbery - trans-frag + trans-tfrag sprite shadow depth-cue @@ -61,9 +61,9 @@ ;; a dma "sink" is somewhere where a renderer can put stuff. (deftype dma-foreground-sink (basic) ((bucket bucket-id :offset-assert 4) ;; the DMA bucket - (foreground-texture-page int8 :offset-assert 8) ;; the tpage we need (in the level) - (foreground-texture-level int8 :offset-assert 9) ;; the level we belong to - (foreground-output-bucket int8 :offset-assert 10) ;; ? + (foreground-texture-page int8 :offset-assert 8) ;; the tpage we need (in the level) + (foreground-texture-level int8 :offset-assert 9) ;; the level we belong to + (foreground-output-bucket int8 :offset-assert 10) ;; ? ) :method-count-assert 9 :size-assert #xb diff --git a/goal_src/engine/gfx/lights-h.gc b/goal_src/engine/gfx/lights-h.gc index c593ccf073..4cac1c0b3c 100644 --- a/goal_src/engine/gfx/lights-h.gc +++ b/goal_src/engine/gfx/lights-h.gc @@ -10,6 +10,8 @@ ;; this type represents the lights that can be sent to the VU for merc (and maybe generic?) rendering. ;; it contains 3 directional lights and an ambient light. +;; Note that the data is transposed to be faster for use in the VU code. +;; the w components are unused for lighting information - you can put whatever you want in them... (deftype vu-lights (structure) ((direction vector 3 :inline :offset-assert 0) (color vector 3 :inline :offset-assert 48) diff --git a/goal_src/engine/gfx/merc/generic-merc-h.gc b/goal_src/engine/gfx/merc/generic-merc-h.gc index a0a8c9f7cf..36126859de 100644 --- a/goal_src/engine/gfx/merc/generic-merc-h.gc +++ b/goal_src/engine/gfx/merc/generic-merc-h.gc @@ -5,6 +5,9 @@ ;; name in dgo: generic-merc-h ;; dgos: GAME, ENGINE +;; The "generic merc" renderer converts merc data to be used by generic. +;; It is used for environment mapping and scissoring in the original game. + (deftype merc-matrix (structure) ((quad uint128 8 :offset-assert 0) (vector vector 8 :inline :offset 0) diff --git a/goal_src/engine/gfx/merc/merc-death.gc b/goal_src/engine/gfx/merc/merc-death.gc index e1373ce820..4d9a809f5b 100644 --- a/goal_src/engine/gfx/merc/merc-death.gc +++ b/goal_src/engine/gfx/merc/merc-death.gc @@ -27,34 +27,28 @@ (none) ) -(define - death-beach-puppy +(define death-beach-puppy (new 'static 'death-info :vertex-skip #x82 :timer #x4b :overlap #x4 :effect #x29 :sound 'temp-enemy-die) ) -(define - death-jungle-snake +(define death-jungle-snake (new 'static 'death-info :vertex-skip #xa :timer #x4b :overlap #x4 :effect #x29 :sound 'temp-enemy-die) ) -(define - death-default +(define death-default (new 'static 'death-info :vertex-skip #x50 :timer #x4b :overlap #x4 :effect #x29 :sound 'temp-enemy-die) ) -(define - death-warp-in +(define death-warp-in (new 'static 'death-info :vertex-skip #x96 :timer #x4b :effect #x29 :sound 'warpgate-tele) ) -(define - death-warp-out +(define death-warp-out (new 'static 'death-info :vertex-skip #x96 :timer #x96 :effect #x29 :sound 'warpgate-tele) ) (defpart 41 - :init-specs - ((sp-flt spt-scale-x (meters 0.5)) + :init-specs ((sp-flt spt-scale-x (meters 0.5)) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 64.0 32.0 1.0) (sp-rnd-flt spt-g 16.0 32.0 1.0) @@ -72,8 +66,7 @@ ) (defpart 42 - :init-specs - ((sp-flt spt-fade-a -1.4222223) + :init-specs ((sp-flt spt-fade-a -1.4222223) (sp-int spt-timer 45) (sp-int spt-next-time 42) (sp-launcher-by-id spt-next-launcher 43) @@ -81,8 +74,7 @@ ) (defpart 43 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) (sp-flt spt-fade-a -0.21333334) (sp-int-plain-rnd spt-timer 0 296 1)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-flt spt-fade-a -0.21333334) (sp-int-plain-rnd spt-timer 0 296 1)) ) (defun merc-death-spawn ((arg0 int) (arg1 vector) (arg2 vector)) diff --git a/goal_src/engine/gfx/merc/merc-h.gc b/goal_src/engine/gfx/merc/merc-h.gc index bbb98a7af3..6e59fcfe60 100644 --- a/goal_src/engine/gfx/merc/merc-h.gc +++ b/goal_src/engine/gfx/merc/merc-h.gc @@ -5,6 +5,12 @@ ;; name in dgo: merc-h ;; dgos: GAME, ENGINE +;; The "merc" renderer is the main foreground renderer. +;; All foreground objects are stored in merc format. +;; See bones.gc for where it's actually used and the pc port changes. + +;; The "ripple" system can apply a ripple effect (for waves or similar) to merc data. +;; This defines which vertices should be rippled. (deftype ripple-merc-query (inline-array-class) ((start-vertex int32 :offset-assert 16) (vertex-skip int32 :offset-assert 20) @@ -16,37 +22,38 @@ :size-assert #x20 :flag-assert #x900000020 ) - (set! (-> ripple-merc-query heap-base) 16) ;; header to fragments uploaded to VU. +;; This gets upacked with v4_8 mode. +;; for a more detailed description of the various formats, see extract_merc.cpp +;; Note that a fragment may rely on vertices, GS state, and matrices from a previous +;; fragment in the same merc "effect". (deftype merc-byte-header (structure) - ((srcdest-off uint8 :offset-assert 0) - (rgba-off uint8 :offset-assert 1) - (lump-off uint8 :offset-assert 2) - (fp-off uint8 :offset-assert 3) - (mat1-cnt uint8 :offset-assert 4) - (mat2-cnt uint8 :offset-assert 5) - (mat3-cnt uint8 :offset-assert 6) - (samecopy-cnt uint8 :offset-assert 7) - (crosscopy-cnt uint8 :offset-assert 8) - (strip-len uint8 :offset-assert 9) - (mm-quadword-fp-off uint8 :offset-assert 10) - (mm-quadword-size uint8 :offset-assert 11) - (perc-off uint8 :offset-assert 12) - (mat-slot uint8 10 :offset-assert 13) + ;; these offsets are after unpacking/upload to VU. + ((srcdest-off uint8 :offset-assert 0) ;; location of srcdst table for vertex copying + (rgba-off uint8 :offset-assert 1) ;; location of rgba data + (lump-off uint8 :offset-assert 2) ;; location of "lump" packed vertex data + (fp-off uint8 :offset-assert 3) ;; location of "fp" data (adgif shader, some floats) + + (mat1-cnt uint8 :offset-assert 4) ;; number of vertices influenced by one bone + (mat2-cnt uint8 :offset-assert 5) ;; two bone + (mat3-cnt uint8 :offset-assert 6) ;; three bone + + (samecopy-cnt uint8 :offset-assert 7) ;; number of vertices to copy from this fragment + (crosscopy-cnt uint8 :offset-assert 8) ;; copy vertices from previous fragment count + (strip-len uint8 :offset-assert 9) ;; how long is the initial strip before a shader (may be 0, if starts with shader) + (mm-quadword-fp-off uint8 :offset-assert 10) ;; main memory offset of fp data + (mm-quadword-size uint8 :offset-assert 11) ;; main memory size of whole fragment + (perc-off uint8 :offset-assert 12) ;; bone weight table offset + (mat-slot uint8 10 :offset-assert 13) ;; which matrices to upload where for this fragment ) :method-count-assert 9 :size-assert #x17 :flag-assert #x900000017 ) -;; merc VU fragment. -;; The mm-quadword-size includes the header. -;; The data itself is split into two parts: -;; - ?? -;; - fp data, containing a merc-fp-data then "fp" data. -;; the merc-fragment-fp-data function will get a pointer to fp data. +;; merc VU fragment: contains the header and data. (deftype merc-fragment (structure) ((header merc-byte-header :inline :offset-assert 0) (rest uint8 1 :offset-assert 23) @@ -59,16 +66,19 @@ ) ) +;; packed merc vertex, before unpack by VIF +;; the meaning of flags is situation dependent in the renderer, see extract_merc.cpp +;; for the details. (deftype merc-vtx (structure) - ((mat-0 uint8 :offset-assert 0) - (mat-1 uint8 :offset-assert 1) - (nrm-x uint8 :offset-assert 2) - (pos-x uint8 :offset-assert 3) - (dst-0 uint8 :offset-assert 4) - (dst-1 uint8 :offset-assert 5) - (nrm-y uint8 :offset-assert 6) - (pos-y uint8 :offset-assert 7) - (tex-s uint8 :offset-assert 8) + ((mat-0 uint8 :offset-assert 0) ;; matrix number for first bone (and flags) + (mat-1 uint8 :offset-assert 1) ;; matrix number for second bone (and flags) + (nrm-x uint8 :offset-assert 2) ;; x component of normal + (pos-x uint8 :offset-assert 3) ;; x component of position + (dst-0 uint8 :offset-assert 4) ;; location to place vertex (and flags) + (dst-1 uint8 :offset-assert 5) ;; location to place vertex 2 (and flags) + (nrm-y uint8 :offset-assert 6) ;; normal + (pos-y uint8 :offset-assert 7) ;; pos + (tex-s uint8 :offset-assert 8) ;; texture coordinate (tex-t uint8 :offset-assert 9) (nrm-z uint8 :offset-assert 10) (pos-z uint8 :offset-assert 11) @@ -99,9 +109,10 @@ (the merc-fp-header (&+ arg0 (the-as uint (shl (-> arg0 header mm-quadword-fp-off) 4)))) ) +;; a description of a matrix upload to merc (deftype merc-mat-dest (structure) - ((matrix-number uint8 :offset-assert 0) - (matrix-dest uint8 :offset-assert 1) + ((matrix-number uint8 :offset-assert 0) ;; the matrix in the skeleton + (matrix-dest uint8 :offset-assert 1) ;; the slot in the shader (only a small number available) ) :pack-me :method-count-assert 9 @@ -111,6 +122,7 @@ ;; some info about a merc fragment that will stay on the EE. ;; the merc-effect contains a ref to one of these +;; this is all the information needed to generate merc upload dma (counts/sizes) (deftype merc-fragment-control (structure) ((unsigned-four-count uint8 :offset-assert 0) (lump-four-count uint8 :offset-assert 1) @@ -123,11 +135,13 @@ :flag-assert #x900000004 ) +;; packed blend shape data (deftype merc-blend-data (structure) ;; was unknown! ((int8-data int8 :dynamic :offset-assert 0) ) ) +;; info needed to set up blend shapes (deftype merc-blend-ctrl (structure) ((blend-vtx-count uint8 :offset-assert 0) (nonzero-index-count uint8 :offset-assert 1) @@ -138,10 +152,11 @@ :flag-assert #x900000002 ) +;; info for environment map "extra" (deftype mei-envmap-tint (structure) - ((fade0 float :offset-assert 0) - (fade1 float :offset-assert 4) - (tint uint32 :offset-assert 8) + ((fade0 float :offset-assert 0) ;; start fade + (fade1 float :offset-assert 4) ;; end fade + (tint uint32 :offset-assert 8) ;; envmap color (dummy int32 :offset-assert 12) ) :method-count-assert 9 @@ -149,6 +164,7 @@ :flag-assert #x900000010 ) +;; info for texture scrolling "extra" (deftype mei-texture-scroll (structure) ((max-dist float :offset-assert 0) (st-int-scale uint8 :offset-assert 4) @@ -163,6 +179,7 @@ :flag-assert #x900000010 ) +;; info for ripple effect "extra" (deftype mei-ripple (structure) ((x-base float :offset-assert 0) (z-base float :offset-assert 4) @@ -174,6 +191,7 @@ :flag-assert #x900000010 ) +;; locations of the "extra"s. (deftype merc-extra-info (structure) ((envmap-tint-offset uint8 :offset-assert 0) (shader-offset uint8 :offset-assert 1) @@ -186,6 +204,8 @@ :flag-assert #x900000010 ) +;; a collection of fragments that must be sent all together. +;; and their extra effects. (deftype merc-effect (structure) ((frag-geo merc-fragment :offset-assert 0) (frag-ctrl merc-fragment-control :offset-assert 4) @@ -200,7 +220,7 @@ (dummy1 uint8 :offset-assert 26) (envmap-usage uint8 :offset-assert 27) (extra-info merc-extra-info :offset-assert 28) - + ;; added (data uint64 4 :offset 0) ) @@ -212,10 +232,15 @@ ) ) +;; eye info (for a single eye) +;; there's a pupil, iris, and lid. The pupil and iris can move around (together), +;; The pupil/iris can be scaled (independtenly) +;; the eyelid goes up and down (deftype merc-eye-ctrl (structure) - ((eye-slot int8 :offset-assert 0) - (shader-offset int8 :offset-assert 1) + ((eye-slot int8 :offset-assert 0) ;; slot in anim data + (shader-offset int8 :offset-assert 1) ;; offset in merc data (shader-count int8 :offset-assert 2) + ;; copies of the shader. (iris-shader adgif-shader :inline :offset-assert 16) (pupil-shader adgif-shader :inline :offset-assert 96) (lid-shader adgif-shader :inline :offset-assert 176) @@ -226,6 +251,7 @@ :flag-assert #x900000100 ) +;; single frame for eye animation (deftype merc-eye-anim-frame (structure) ((pupil-trans-x int8 :offset-assert 0) (pupil-trans-y int8 :offset-assert 1) @@ -241,6 +267,7 @@ :flag-assert #x900000008 ) +;; just an array of eye anim frames. (deftype merc-eye-anim-block (structure) ((max-frame int16 :offset-assert 0) (data merc-eye-anim-frame :inline :dynamic :offset 8) @@ -251,7 +278,8 @@ ) -;; metadata for merc art +;; metadata for merc art for a single model +;; mostly just stats and parameters used in dma/rendering. (deftype merc-ctrl-header (structure) ((xyz-scale float :offset-assert 0) (st-magic uint32 :offset-assert 4) @@ -297,10 +325,10 @@ :method-count-assert 9 :size-assert #x50 :flag-assert #x900000050 - ;; field xyz-scale is a float printed as hex? + ;; field xyz-scale is a float printed as hex? ) -;; the actual merc art object. +;; the actual merc art object: a header and list of effects (deftype merc-ctrl (art-element) ((num-joints int32 :offset 20) (header merc-ctrl-header :inline :offset-assert 32) @@ -311,6 +339,7 @@ :flag-assert #xd00000070 ) +;; low memory upload to vu1 for merc (which merc later writes over) (deftype merc-vu1-low-mem (structure) ((tri-strip-gif gs-gif-tag :inline :offset-assert 0) ;; was qword (ad-gif gs-gif-tag :inline :offset-assert 16) ;; was qword diff --git a/goal_src/engine/gfx/merc/merc.gc b/goal_src/engine/gfx/merc/merc.gc index 746f37ae67..4bb726cd16 100644 --- a/goal_src/engine/gfx/merc/merc.gc +++ b/goal_src/engine/gfx/merc/merc.gc @@ -114,7 +114,7 @@ (defmethod login-adgifs merc-effect ((obj merc-effect)) "Login everything for this merc-effect." - + ;; login adgifs, if we have them. (let ((data (-> obj extra-info))) (when (nonzero? data) @@ -136,7 +136,7 @@ ) ) ) - + ;; login fragment geometry and control. ctrls don't need logins (let ((ctrl (-> obj frag-ctrl)) (geo (-> obj frag-geo)) @@ -170,12 +170,12 @@ (defmethod mem-usage merc-ctrl ((obj merc-ctrl) (arg0 memory-usage-block) (arg1 int)) "Compute memory usage stats for a merc-ctrl" - + ;; do extra (if (-> obj extra) (mem-usage (-> obj extra) arg0 arg1) ) - + ;; do merc ctrls in each effect: (let ((ctrl-mem (+ 32 80 (* (-> obj header effect-count) 32)))) (dotimes (effect-idx (the-as int (-> obj header effect-count))) @@ -198,7 +198,7 @@ (+! (-> arg0 data 75 used) ctrl-mem) (+! (-> arg0 data 75 total) (logand -16 (+ ctrl-mem 15))) ) - + ;; do effect blend shapes (let ((effect-mem 0)) (dotimes (effect-idx2 (the-as int (-> obj header effect-count))) @@ -227,7 +227,7 @@ (+! (-> arg0 data 77 total) (logand -16 (+ effect-mem 15))) ) ) - + ;; do eyes. (when (nonzero? (-> obj header eye-ctrl)) (let ((a0-28 (-> obj header eye-ctrl))) @@ -245,20 +245,20 @@ (defmethod login merc-ctrl ((obj merc-ctrl)) "Log in a merc-ctrl." - + ;; so we can find it (set! *merc-ctrl-header* (-> obj header)) - + ;; clear masks. logging in will set these for textures we need. (dotimes (v1-1 3) (set! (-> *merc-ctrl-header* masks v1-1) (the-as uint 0)) ) - + ;; login the effects (dotimes (effect-idx (the-as int (-> obj header effect-count))) (login-adgifs (-> obj effect effect-idx)) ) - + ;; some weird hack to swap two effects. (let ((idx-with-bit1 -1) (a1-1 (-> obj header effect-count)) @@ -282,7 +282,7 @@ ) ) ) - + ;; login eye. (cond ((zero? (logand -65536 (the-as int (-> obj header eye-ctrl)))) @@ -352,7 +352,7 @@ (defun-debug merc-stats () "Iterate through all merc-ctrls and print." - + (dotimes (gp-0 3) ;; levels (let ((s5-0 (-> *level* level gp-0 art-group))) (when (nonzero? s5-0) @@ -457,10 +457,10 @@ (set! (-> (the-as (pointer vif-tag) gp-0) 4) (new 'static 'vif-tag :imm #x1ba :cmd (vif-cmd base))) (set! (-> (the-as (pointer vif-tag) gp-0) 5) (new 'static 'vif-tag :imm #xfe46 :cmd (vif-cmd offset))) (set! (-> (the-as (pointer vif-tag) gp-0) 6) (new 'static 'vif-tag)) - + ;; upload VU low memory (set! (-> (the-as (pointer vif-tag) gp-0) 7) (new 'static 'vif-tag :num #x8 :cmd (vif-cmd unpack-v4-32))) - + ;; template: (let ((s5-0 (the-as merc-vu1-low-mem (&+ (the-as dma-gif-packet gp-0) 32)))) (set! (-> s5-0 tri-strip-gif tag) @@ -481,11 +481,11 @@ (set! (-> s5-0 tri-strip-gif word 3) (shr (make-u128 0 (shl #x303e4000 32)) 32) ) - + (set! (-> s5-0 ad-gif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) (set! (-> s5-0 ad-gif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) (set! (-> s5-0 hvdf-offset quad) (-> *math-camera* hvdf-off quad)) - + (quad-copy! (-> s5-0 perspective) (the-as pointer (-> *math-camera* perspective)) 4) (set-vector! (-> s5-0 fog) @@ -508,12 +508,12 @@ (defun merc-vu1-init-buffer ((dma-bucket bucket-id) (test gs-test) (arg2 int)) "Setup merc DMA buffer." - + ;; This function works differently from most and splices to the beginning of the bucket, as ;; drawing has already put stuff in buckets. ;; The advantage of this is that we can check if nothing was drawn, then skip this. ;; NOTE: This runs as part of display-frame-finish, so after previous DMA is synced. - + ;; grab out bucket directly. (let ((bucket (-> *display* frames (-> *display* on-screen) frame bucket-group dma-bucket))) ;; only if we draw anything. @@ -569,7 +569,7 @@ (set! (-> (the-as (pointer gs-reg64) a0-10) 1) (gs-reg64 test-1)) (set! (-> v1-10 base) (&+ a0-10 16)) ) - + ;; terminate as normal (let ((v1-11 (the-as object (-> dma-buf base)))) (set! (-> (the-as dma-packet v1-11) dma) @@ -579,7 +579,7 @@ (set! (-> (the-as dma-packet v1-11) vif1) (new 'static 'vif-tag)) (set! (-> dma-buf base) (&+ (the-as pointer v1-11) 16)) ) - + ;; but splice the existing chain. (set! (-> bucket next) (the-as uint draw-data-start)) ) @@ -604,7 +604,7 @@ 0 ) (merc-vu1-init-buffer - (bucket-id bucket-49) + (bucket-id merc-pris0) (new 'static 'gs-test :ate #x1 :atst (gs-atest greater-equal) @@ -626,7 +626,7 @@ 0 ) (merc-vu1-init-buffer - (bucket-id bucket-52) + (bucket-id merc-pris1) (new 'static 'gs-test :ate #x1 :atst (gs-atest greater-equal) @@ -637,7 +637,7 @@ 0 ) (merc-vu1-init-buffer - (bucket-id bucket-45) + (bucket-id merc-alpha-tex) (new 'static 'gs-test :ate #x1 :atst (gs-atest greater-equal) @@ -648,7 +648,7 @@ 0 ) (merc-vu1-init-buffer - (bucket-id bucket-55) + (bucket-id merc-pris-common) (new 'static 'gs-test :ate #x1 :atst (gs-atest greater-equal) @@ -659,7 +659,7 @@ 0 ) (merc-vu1-init-buffer - (bucket-id bucket-58) + (bucket-id merc-water0) (new 'static 'gs-test :ate #x1 :atst (gs-atest greater-equal) @@ -671,7 +671,7 @@ 0 ) (merc-vu1-init-buffer - (bucket-id bucket-61) + (bucket-id merc-water1) (new 'static 'gs-test :ate #x1 :atst (gs-atest greater-equal) diff --git a/goal_src/engine/gfx/mood-h.gc b/goal_src/engine/gfx/mood-h.gc index 67491702c4..7284fafcf8 100644 --- a/goal_src/engine/gfx/mood-h.gc +++ b/goal_src/engine/gfx/mood-h.gc @@ -6,7 +6,8 @@ ;; dgos: GAME, ENGINE ;; the "mood" system sets the fog, lights, and sun to smoothly blend between two levels. -;; each level has 8 "moods". +;; each level has 8 "moods" corresponding to the 8 times of day. +;; the mood system blends together moods to create smooth transitions between levels and times of day. ;; set of fog parameters (deftype mood-fog (structure) @@ -90,6 +91,7 @@ ;; these "times" are the time-of-day weights. the w is the weight, the rest is just 1. (times vector 8 :inline :offset-assert 1696) (sky-times float 8 :offset-assert 1824) + ;; times as integers. For use in rendering code. (itimes vector4w 4 :inline :offset-assert 1856) (state uint8 16 :offset-assert 1920) (num-stars float :offset-assert 1936) diff --git a/goal_src/engine/gfx/ocean/ocean-mid.gc b/goal_src/engine/gfx/ocean/ocean-mid.gc index 296d4eb98a..d34b1a7a27 100644 --- a/goal_src/engine/gfx/ocean/ocean-mid.gc +++ b/goal_src/engine/gfx/ocean/ocean-mid.gc @@ -1122,15 +1122,15 @@ (+! (-> p3 x) (+ x0 3145728.0)) (+! (-> p3 z) (+ y0 3145728.0)) - (add-debug-flat-triangle #t (bucket-id debug-draw1) p0 p1s p2s color0) - ;; (add-debug-flat-triangle #t (bucket-id debug-draw1) p3 p1 p2 color0) - (add-debug-outline-triangle #t (bucket-id debug-draw1) p0 p1 p2 color1) - (add-debug-outline-triangle #t (bucket-id debug-draw1) p3 p1 p2 color1) + (add-debug-flat-triangle #t (bucket-id debug-no-zbuf) p0 p1s p2s color0) + ;; (add-debug-flat-triangle #t (bucket-id debug-no-zbuf) p3 p1 p2 color0) + (add-debug-outline-triangle #t (bucket-id debug-no-zbuf) p0 p1 p2 color1) + (add-debug-outline-triangle #t (bucket-id debug-no-zbuf) p3 p1 p2 color1) (format (clear *temp-string*) "o: ~d ~d ~d ~b" x y (+ (* 6 y) x) masks) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) *temp-string* p0 (font-color orange-red) diff --git a/goal_src/engine/gfx/ocean/ocean.gc b/goal_src/engine/gfx/ocean/ocean.gc index 6fab96f5d3..c4d21ded5a 100644 --- a/goal_src/engine/gfx/ocean/ocean.gc +++ b/goal_src/engine/gfx/ocean/ocean.gc @@ -4,6 +4,7 @@ ;; name: ocean.gc ;; name in dgo: ocean ;; dgos: GAME, ENGINE +;; note: changed for high fps ;; TODO - for ocean-transition (define-extern *ocean-map* ocean-map) @@ -615,7 +616,7 @@ (set! *ocean-verts* (the-as (inline-array vector) #f)) (let ((gp-0 (-> *display* frames (-> *display* on-screen) frame global-buf))) (set! *ocean-heights* (the-as ocean-wave-info (-> gp-0 base))) - (ocean-interp-wave *ocean-heights* (the-as uint (-> *display* integral-frame-counter))) + (ocean-interp-wave *ocean-heights* (the uint (* (/ (-> *display* time-factor) 5.0) (-> *display* integral-frame-counter)))) ;; changed for high fps (&+! (-> gp-0 base) 4096) (set! *ocean-verts* (the-as (inline-array vector) (-> gp-0 base))) (ocean-generate-verts *ocean-verts* *ocean-heights*) @@ -683,7 +684,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id bucket-63) + (bucket-id ocean-near) gp-2 (the-as (pointer dma-tag) a3-1) ) @@ -747,4 +748,4 @@ ) 0 (none) - ) \ No newline at end of file + ) diff --git a/goal_src/engine/gfx/ripple.gc b/goal_src/engine/gfx/ripple.gc index 4ccebbae04..251666ee76 100644 --- a/goal_src/engine/gfx/ripple.gc +++ b/goal_src/engine/gfx/ripple.gc @@ -122,7 +122,7 @@ (vector+! s5-0 s5-0 (-> arg0 root trans)) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) s5-0 2048.0 (new 'static 'rgba :r #xff :g #xff :a #x80) diff --git a/goal_src/engine/gfx/shadow/shadow-cpu-h.gc b/goal_src/engine/gfx/shadow/shadow-cpu-h.gc index 07a797cfab..66c3879376 100644 --- a/goal_src/engine/gfx/shadow/shadow-cpu-h.gc +++ b/goal_src/engine/gfx/shadow/shadow-cpu-h.gc @@ -5,15 +5,33 @@ ;; name in dgo: shadow-cpu-h ;; dgos: GAME, ENGINE +;; The shadow renderer is partially on the EE and on VU1. +;; This "shadow-cpu" portion is what runs on the EE. + +;; The renderer generates a shadow volume and uses some bits in the alpha plane like a stencil buffer. +;; It reuses the bones of the merc renderer, but uses a simplified mesh and at most 2 bones per vertex. + +(defenum shadow-flags + :bitfield #t + :type int32 + (shdf00) + (disable-fade) ;; ignore max distance settings + (shdf02) + (shdf03) + (shdf04) + (disable-draw) ;; disable completely. + ) + +;; settings computed by the user, consumed by the shadow renderer (deftype shadow-settings (structure) - ((center vector :inline :offset-assert 0) - (flags int32 :offset 12) + ((center vector :inline :offset-assert 0) ;; unused? + (flags shadow-flags :offset 12) ;; used to disable, most other flags do nothing? (shadow-dir vector :inline :offset-assert 16) (dist-to-locus float :offset 28) - (bot-plane plane :inline :offset-assert 32) + (bot-plane plane :inline :offset-assert 32) ;; volume clip plane (top-plane plane :inline :offset-assert 48) - (fade-dist float :offset-assert 64) - (fade-start float :offset-assert 68) + (fade-dist float :offset-assert 64) ;; if past this, stop drawing shadow + (fade-start float :offset-assert 68) ;; distance where fadeout starts (dummy-2 int32 :offset-assert 72) (dummy-3 int32 :offset-assert 76) (fade-vec vector :inline :offset 64) ;; added @@ -35,7 +53,7 @@ (set-offset-bit (shadow-control) int 10) (set-top-plane-offset (shadow-control float) int 11) (set-bottom-plane-offset (shadow-control float) int 12) - (dummy-13 (_type_) none 13) + (unused-13 (_type_) none 13) (update-direction-from-time-of-day (_type_) none 14) (collide-to-find-planes (_type_ vector float float float) none 15) ) diff --git a/goal_src/engine/gfx/shadow/shadow-cpu.gc b/goal_src/engine/gfx/shadow/shadow-cpu.gc index a229fbc39e..21b921fd1d 100644 --- a/goal_src/engine/gfx/shadow/shadow-cpu.gc +++ b/goal_src/engine/gfx/shadow/shadow-cpu.gc @@ -5,6 +5,8 @@ ;; name in dgo: shadow-cpu ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (defmethod asize-of shadow-geo ((obj shadow-geo)) (the-as int (-> obj total-size)) ) @@ -22,26 +24,18 @@ (define *shadow-data* (new 'static 'shadow-data :texoffset (new 'static 'vector :x 256.5 :y 112.5) - :texscale - (new 'static 'vector :x 0.001953125 :y 0.00390625) - :clrs - (new 'static 'inline-array vector 2 + :texscale (new 'static 'vector :x 0.001953125 :y 0.00390625) + :clrs (new 'static 'inline-array vector 2 (new 'static 'vector :x (the-as float #x80) :w (the-as float #x82)) (new 'static 'vector :y (the-as float #x80) :w (the-as float #x7f)) ) - :dma-unpack-template - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1) - :vif1 - (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32)) + :dma-unpack-template (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1) + :vif1 (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32)) ) - :dma-cnt - (new 'static 'dma-tag :id (dma-tag-id cnt)) - :vif-unpack-v4-8 - (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-8)) + :dma-cnt (new 'static 'dma-tag :id (dma-tag-id cnt)) + :vif-unpack-v4-8 (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-8)) ) ) @@ -443,6 +437,7 @@ :flag-assert #x900000010 ) + (deftype shadow-dcache (structure) ((vtx-table uint32 :offset-assert 0) (single-edge-table uint32 :offset-assert 4) @@ -595,11 +590,11 @@ (set! (-> v1-0 y) (+ 4096.0 (-> v1-0 y))) (set-vector! a2-1 0.0 (- arg3) 0.0 1.0) (cond - ((>= (fill-and-probe-using-line-sphere *collide-cache* v1-0 a2-1 8192.0 (collide-kind background) pp s4-0 1) + ((>= (fill-and-probe-using-line-sphere *collide-cache* v1-0 a2-1 8192.0 (collide-kind background) pp s4-0 (new 'static 'pat-surface :noentity #x1)) 0.0 ) (let ((v1-2 obj)) - (set! (-> v1-2 settings flags) (logand -33 (-> v1-2 settings flags))) + (logclear! (-> v1-2 settings flags) (shadow-flags disable-draw)) ) 0 (let ((v1-4 obj)) @@ -611,7 +606,7 @@ ) (else (let ((v1-7 obj)) - (logior! (-> v1-7 settings flags) 32) + (logior! (-> v1-7 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -620,4 +615,8 @@ 0 (none) ) - ) \ No newline at end of file + ) + + + + diff --git a/goal_src/engine/gfx/shadow/shadow-h.gc b/goal_src/engine/gfx/shadow/shadow-h.gc index 4a7fd20945..904cb49c30 100644 --- a/goal_src/engine/gfx/shadow/shadow-h.gc +++ b/goal_src/engine/gfx/shadow/shadow-h.gc @@ -5,10 +5,7 @@ ;; name in dgo: shadow-h ;; dgos: GAME, ENGINE -;; forward def - projectiles -(define-extern find-ground-and-draw-shadow (function vector vector float collide-kind process float float none)) -;; definition of type fake-shadow (deftype fake-shadow (structure) ((px float :offset-assert 0) (py float :offset-assert 4) @@ -25,7 +22,6 @@ :flag-assert #x900000020 ) -;; definition of type fake-shadow-buffer (deftype fake-shadow-buffer (basic) ((num-shadows int32 :offset-assert 4) (data fake-shadow 32 :inline :offset-assert 8) @@ -35,13 +31,10 @@ :flag-assert #x900000408 ) -;; definition for symbol *fake-shadow-buffer-1*, type fake-shadow-buffer (define *fake-shadow-buffer-1* (new 'global 'fake-shadow-buffer)) - -;; definition for symbol *fake-shadow-buffer-2*, type fake-shadow-buffer (define *fake-shadow-buffer-2* (new 'global 'fake-shadow-buffer)) - -;; definition for symbol *fake-shadow-buffer*, type fake-shadow-buffer (define *fake-shadow-buffer* *fake-shadow-buffer-1*) -(define-extern swap-fake-shadow-buffers (function none)) \ No newline at end of file +(define-extern swap-fake-shadow-buffers (function none)) + +(define-extern find-ground-and-draw-shadow (function vector vector float collide-kind process-drawable float float none)) \ No newline at end of file diff --git a/goal_src/engine/gfx/shadow/shadow.gc b/goal_src/engine/gfx/shadow/shadow.gc index 15f19eb4fb..f0ae0abeaa 100644 --- a/goal_src/engine/gfx/shadow/shadow.gc +++ b/goal_src/engine/gfx/shadow/shadow.gc @@ -109,14 +109,31 @@ ) ) -(defun find-ground-and-draw-shadow ((arg0 vector) (arg1 vector) (arg2 float) (arg3 collide-kind) (arg4 process) (arg5 float) (arg6 float)) +(defun find-ground-and-draw-shadow ((arg0 vector) + (arg1 vector) + (arg2 float) + (arg3 collide-kind) + (arg4 process-drawable) + (arg5 float) + (arg6 float) + ) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> arg0 quad)) (new 'stack-no-clear 'vector) (+! (-> s2-0 y) arg5) (let ((s4-0 (new 'stack-no-clear 'collide-tri-result))) (cond - ((>= (fill-and-probe-using-y-probe *collide-cache* s2-0 arg6 arg3 arg4 s4-0 (the-as uint 1)) 0.0) + ((>= (fill-and-probe-using-y-probe + *collide-cache* + s2-0 + arg6 + arg3 + arg4 + s4-0 + (new 'static 'pat-surface :noentity #x1) + ) + 0.0 + ) (if (!= arg2 0.0) (compute-and-draw-shadow s2-0 (-> s4-0 intersect) (-> s4-0 normal) (the-as vector arg2) arg6 (the-as float 0)) ) @@ -137,7 +154,7 @@ ) (defbehavior do-target-shadow target () - (if (and (logtest? (-> self control status) 1) + (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (!= (-> self control unknown-surface00 mode) 'swim) (!= (-> self control unknown-surface00 mode) 'dive) (!= (-> self next-state name) 'target-flop) @@ -159,8 +176,7 @@ ) (defpart 362 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-scale-x (meters 0.3)) (sp-rnd-flt spt-rot-z (degrees -180.0) (degrees 360.0) 1.0) diff --git a/goal_src/engine/gfx/shrub/shrub-work.gc b/goal_src/engine/gfx/shrub/shrub-work.gc index e005b882a3..17e7b593dd 100644 --- a/goal_src/engine/gfx/shrub/shrub-work.gc +++ b/goal_src/engine/gfx/shrub/shrub-work.gc @@ -7,12 +7,9 @@ ;; DECOMP BEGINS -;; definition for symbol *instance-shrub-work*, type instance-shrub-work -(define - *instance-shrub-work* +(define *instance-shrub-work* (new 'static 'instance-shrub-work - :matrix-tmpl - (new 'static 'inline-array qword 20 + :matrix-tmpl (new 'static 'inline-array qword 20 (new 'static 'qword :data (new 'static 'array uint32 4 #x10000005 #x0 #x0 #x6c050143)) (new 'static 'qword :data (new 'static 'array uint32 4 #x20000005 #x0 #x0 #x6c050148)) (new 'static 'qword :data (new 'static 'array uint32 4 #x20000005 #x0 #x0 #x6c05014d)) @@ -34,8 +31,7 @@ (new 'static 'qword :data (new 'static 'array uint32 4 #x20000005 #x0 #x0 #x6c05019e)) (new 'static 'qword :data (new 'static 'array uint32 4 #x10000005 #x0 #x0 #x6c0501a3)) ) - :count-tmpl - (new 'static 'inline-array vector4w 20 + :count-tmpl (new 'static 'inline-array vector4w 20 (new 'static 'vector4w :x #x20000000 :z #x60010175 :w 10) (new 'static 'vector4w :x #x20000000 :z #x60010142 :w 1) (new 'static 'vector4w :x #x20000000 :z #x60010142 :w 2) @@ -57,435 +53,253 @@ (new 'static 'vector4w :x #x20000000 :z #x60010175 :w 8) (new 'static 'vector4w :x #x20000000 :z #x60010175 :w 9) ) - :mscalf-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1) + :mscalf-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1) ) - :mscalf-ret-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ret)) - :vif0 - (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1) + :mscalf-ret-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ret)) + :vif0 (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1) ) - :adgif-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id next)) - :vif1 - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + :adgif-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id next)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x1000000000008005 #xe) + :gif (new 'static 'array uint64 2 #x1000000000008005 #xe) ) - :billboard-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #xd :id (dma-tag-id next)) - :vif1 - (new 'static 'vif-tag :imm #xd :cmd (vif-cmd direct) :msk #x1) + :billboard-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xd :id (dma-tag-id next)) + :vif1 (new 'static 'vif-tag :imm #xd :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x303e400000008004 #x412) + :gif (new 'static 'array uint64 2 #x303e400000008004 #x412) ) - :shrub-near-packets - (new 'static 'inline-array shrub-near-packet 6 + :shrub-near-packets (new 'static 'inline-array shrub-near-packet 6 (new 'static 'shrub-near-packet - :matrix-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x345 :num #x6 :cmd (vif-cmd unpack-v4-32)) + :matrix-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x345 :num #x6 :cmd (vif-cmd unpack-v4-32)) ) - :header-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x34c :cmd (vif-cmd unpack-v4-32)) + :header-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x34c :cmd (vif-cmd unpack-v4-32)) ) - :stq-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x9 :cmd (vif-cmd unpack-v2-16)) + :stq-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x9 :cmd (vif-cmd unpack-v2-16)) ) - :color-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x400a :cmd (vif-cmd unpack-v3-8)) + :color-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x400a :cmd (vif-cmd unpack-v3-8)) ) - :vertex-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #xb :cmd (vif-cmd unpack-v3-16)) + :vertex-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #xb :cmd (vif-cmd unpack-v3-16)) ) - :mscal-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) + :mscal-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) ) - :init-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) + :init-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) ) - :init-data - (new 'static 'array uint32 8 #x0 #x0 #x345 #x117 #x0 #x0 #x0 #x1500000c) + :init-data (new 'static 'array uint32 8 #x0 #x0 #x345 #x117 #x0 #x0 #x0 #x1500000c) ) (new 'static 'shrub-near-packet - :matrix-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x363 :num #x6 :cmd (vif-cmd unpack-v4-32)) + :matrix-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x363 :num #x6 :cmd (vif-cmd unpack-v4-32)) ) - :header-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x36a :cmd (vif-cmd unpack-v4-32)) + :header-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x36a :cmd (vif-cmd unpack-v4-32)) ) - :stq-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x120 :cmd (vif-cmd unpack-v2-16)) + :stq-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x120 :cmd (vif-cmd unpack-v2-16)) ) - :color-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x4121 :cmd (vif-cmd unpack-v3-8)) + :color-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x4121 :cmd (vif-cmd unpack-v3-8)) ) - :vertex-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x122 :cmd (vif-cmd unpack-v3-16)) + :vertex-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x122 :cmd (vif-cmd unpack-v3-16)) ) - :mscal-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) + :mscal-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) ) - :init-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) + :init-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) ) - :init-data - (new 'static 'array uint32 8 #x0 #x0 #x363 #x22e #x0 #x0 #x0 #x1500000c) + :init-data (new 'static 'array uint32 8 #x0 #x0 #x363 #x22e #x0 #x0 #x0 #x1500000c) ) (new 'static 'shrub-near-packet - :matrix-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x345 :num #x6 :cmd (vif-cmd unpack-v4-32)) + :matrix-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x345 :num #x6 :cmd (vif-cmd unpack-v4-32)) ) - :header-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x34c :cmd (vif-cmd unpack-v4-32)) + :header-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x34c :cmd (vif-cmd unpack-v4-32)) ) - :stq-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x237 :cmd (vif-cmd unpack-v2-16)) + :stq-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x237 :cmd (vif-cmd unpack-v2-16)) ) - :color-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x4238 :cmd (vif-cmd unpack-v3-8)) + :color-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x4238 :cmd (vif-cmd unpack-v3-8)) ) - :vertex-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x239 :cmd (vif-cmd unpack-v3-16)) + :vertex-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x239 :cmd (vif-cmd unpack-v3-16)) ) - :mscal-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) + :mscal-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) ) - :init-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) + :init-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) ) - :init-data - (new 'static 'array uint32 8 #x0 #x0 #x345 #x0 #x0 #x0 #x0 #x1500000c) + :init-data (new 'static 'array uint32 8 #x0 #x0 #x345 #x0 #x0 #x0 #x0 #x1500000c) ) (new 'static 'shrub-near-packet - :matrix-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x363 :num #x6 :cmd (vif-cmd unpack-v4-32)) + :matrix-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x363 :num #x6 :cmd (vif-cmd unpack-v4-32)) ) - :header-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x36a :cmd (vif-cmd unpack-v4-32)) + :header-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x36a :cmd (vif-cmd unpack-v4-32)) ) - :stq-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x9 :cmd (vif-cmd unpack-v2-16)) + :stq-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x9 :cmd (vif-cmd unpack-v2-16)) ) - :color-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x400a :cmd (vif-cmd unpack-v3-8)) + :color-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x400a :cmd (vif-cmd unpack-v3-8)) ) - :vertex-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #xb :cmd (vif-cmd unpack-v3-16)) + :vertex-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #xb :cmd (vif-cmd unpack-v3-16)) ) - :mscal-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) + :mscal-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) ) - :init-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) + :init-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) ) - :init-data - (new 'static 'array uint32 8 #x0 #x0 #x363 #x117 #x0 #x0 #x0 #x1500000c) + :init-data (new 'static 'array uint32 8 #x0 #x0 #x363 #x117 #x0 #x0 #x0 #x1500000c) ) (new 'static 'shrub-near-packet - :matrix-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x345 :num #x6 :cmd (vif-cmd unpack-v4-32)) + :matrix-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x345 :num #x6 :cmd (vif-cmd unpack-v4-32)) ) - :header-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x34c :cmd (vif-cmd unpack-v4-32)) + :header-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x34c :cmd (vif-cmd unpack-v4-32)) ) - :stq-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x120 :cmd (vif-cmd unpack-v2-16)) + :stq-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x120 :cmd (vif-cmd unpack-v2-16)) ) - :color-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x4121 :cmd (vif-cmd unpack-v3-8)) + :color-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x4121 :cmd (vif-cmd unpack-v3-8)) ) - :vertex-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x122 :cmd (vif-cmd unpack-v3-16)) + :vertex-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x122 :cmd (vif-cmd unpack-v3-16)) ) - :mscal-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) + :mscal-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) ) - :init-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) + :init-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) ) - :init-data - (new 'static 'array uint32 8 #x0 #x0 #x345 #x22e #x0 #x0 #x0 #x1500000c) + :init-data (new 'static 'array uint32 8 #x0 #x0 #x345 #x22e #x0 #x0 #x0 #x1500000c) ) (new 'static 'shrub-near-packet - :matrix-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x363 :num #x6 :cmd (vif-cmd unpack-v4-32)) + :matrix-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x363 :num #x6 :cmd (vif-cmd unpack-v4-32)) ) - :header-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x36a :cmd (vif-cmd unpack-v4-32)) + :header-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x36a :cmd (vif-cmd unpack-v4-32)) ) - :stq-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x237 :cmd (vif-cmd unpack-v2-16)) + :stq-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x237 :cmd (vif-cmd unpack-v2-16)) ) - :color-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x4238 :cmd (vif-cmd unpack-v3-8)) + :color-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x4238 :cmd (vif-cmd unpack-v3-8)) ) - :vertex-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x239 :cmd (vif-cmd unpack-v3-16)) + :vertex-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x239 :cmd (vif-cmd unpack-v3-16)) ) - :mscal-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) + :mscal-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) ) - :init-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) + :init-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) ) - :init-data - (new 'static 'array uint32 8 #x0 #x0 #x363 #x0 #x0 #x0 #x0 #x1500000c) + :init-data (new 'static 'array uint32 8 #x0 #x0 #x363 #x0 #x0 #x0 #x0 #x1500000c) ) ) - :dma-ref - (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref))) - :dma-end - (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id end))) - :wind-const - (new 'static 'vector :x 0.5 :y 100.0 :z 0.0166 :w -1.0) + :dma-ref (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref))) + :dma-end (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id end))) + :wind-const (new 'static 'vector :x 0.5 :y 100.0 :z 0.0166 :w -1.0) :constants (new 'static 'vector :x 128.0 :y 1.0) - :color-constant - (new 'static 'vector4w :x #x47000000 :y #x47000000 :z #x47000000) - :start-bank - (new 'static 'array uint8 20 #x0 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :color-constant (new 'static 'vector4w :x #x47000000 :y #x47000000 :z #x47000000) + :start-bank (new 'static 'array uint8 20 #x0 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) ) -;; failed to figure out what this is: (set! (-> *instance-shrub-work* mscalf-tmpl vif0 imm) 103) -;; failed to figure out what this is: (set! (-> *instance-shrub-work* mscalf-ret-tmpl vif0 imm) 103) -;; definition for function upload-generic-shrub -;; Used lq/sq (defun upload-generic-shrub ((arg0 dma-buffer) (arg1 generic-shrub-fragment) (arg2 int) (arg3 int)) (let* ((v1-0 arg0) (t0-0 (the-as object (-> v1-0 base))) diff --git a/goal_src/engine/gfx/sky/sky-tng.gc b/goal_src/engine/gfx/sky/sky-tng.gc index b0bac528af..69910fb11c 100644 --- a/goal_src/engine/gfx/sky/sky-tng.gc +++ b/goal_src/engine/gfx/sky/sky-tng.gc @@ -168,15 +168,31 @@ (sky-make-sun-data *sky-parms* 1 arg0) (sky-make-moon-data *sky-parms* arg0) (let ((v1-0 *sky-tng-data*)) - (+! (-> v1-0 off-s-0) 16) - (+! (-> v1-0 off-t-0) 32) - (+! (-> v1-0 off-s-1) -21) - (+! (-> v1-0 off-t-1) 42) - (set! (-> v1-0 time) arg0) + (case (-> *setting-control* current video-mode) + (('150fps) + (+! (-> v1-0 off-s-0) 6.4) + (+! (-> v1-0 off-t-0) 12.8) + (+! (-> v1-0 off-s-1) -8.4) + (+! (-> v1-0 off-t-1) 16.8) + ) + (('100fps) + (+! (-> v1-0 off-s-0) 9.6) + (+! (-> v1-0 off-t-0) 19.2) + (+! (-> v1-0 off-s-1) -12.6) + (+! (-> v1-0 off-t-1) 25.2) + ) + (else + (+! (-> v1-0 off-s-0) 16) + (+! (-> v1-0 off-t-0) 32) + (+! (-> v1-0 off-s-1) -21) + (+! (-> v1-0 off-t-1) 42) + ) + ) + (set! (-> v1-0 time) arg0) ) 0 (none) - ) +) #| (defun init-sky-regs () diff --git a/goal_src/engine/gfx/sprite/sprite-h.gc b/goal_src/engine/gfx/sprite/sprite-h.gc index 541d0f05f6..166151ea51 100644 --- a/goal_src/engine/gfx/sprite/sprite-h.gc +++ b/goal_src/engine/gfx/sprite/sprite-h.gc @@ -5,7 +5,12 @@ ;; name in dgo: sprite-h ;; dgos: GAME, ENGINE -;; definition of type sprite-vec-data-2d + +(#if PC_BIG_MEMORY + (defconstant SPRITE_MAX_AMOUNT_MULT 8) + (none)) + + (deftype sprite-vec-data-2d (structure) ((x-y-z-sx vector :inline :offset-assert 0) (flag-rot-sy vector :inline :offset-assert 16) diff --git a/goal_src/engine/gfx/sprite/sprite.gc b/goal_src/engine/gfx/sprite/sprite.gc index 11efc89472..c34a7afbb6 100644 --- a/goal_src/engine/gfx/sprite/sprite.gc +++ b/goal_src/engine/gfx/sprite/sprite.gc @@ -394,10 +394,8 @@ (defmethod new sprite-array-2d ((allocation symbol) (type-to-make type) (group-0-size int) (group-1-size int)) "Allocate a sprite-array for 2d sprites. There are two groups, each can contain the given number." (#when PC_BIG_MEMORY - (when (not (-> *pc-settings* ps2-parts?)) - (*! group-0-size 16) ;; 16x more particles! - (*! group-1-size 16) ;; 16x more particles! - ) + (*! group-0-size SPRITE_MAX_AMOUNT_MULT) + (*! group-1-size SPRITE_MAX_AMOUNT_MULT) ) (let* ((sprite-count (+ group-0-size group-1-size)) (vec-data-size (* 3 sprite-count)) ;; 3 quadwords of vec-data per sprite @@ -423,10 +421,8 @@ "Allocate a sprite-array for 3d sprites. There are two groups, each can contain the given number of sprites. Group 1 size is zero in practice for 3d." (#when PC_BIG_MEMORY - (when (and *pc-settings* (not (-> *pc-settings* ps2-parts?))) - (*! group-0-size 16) ;; 16x more particles! - (*! group-1-size 16) ;; 16x more particles! - ) + (*! group-0-size SPRITE_MAX_AMOUNT_MULT) + (*! group-1-size SPRITE_MAX_AMOUNT_MULT) ) (let* ((sprite-count (+ group-0-size group-1-size)) (vec-data-size (* 3 sprite-count)) diff --git a/goal_src/engine/gfx/texture-h.gc b/goal_src/engine/gfx/texture-h.gc index 70057ad3bb..1e6a635079 100644 --- a/goal_src/engine/gfx/texture-h.gc +++ b/goal_src/engine/gfx/texture-h.gc @@ -72,7 +72,7 @@ ;; the location of the color look-up table for font texture (vram word idx) (font-palette int32 :offset-assert 16) - + ;; these were reordered ;; we have 4 segments, but only the near and common are used. (segment-near texture-pool-segment :inline :offset-assert 20) @@ -99,9 +99,9 @@ (add-tex-to-dma! (_type_ level int) none 14) (allocate-vram-words! (_type_ int) int 15) (allocate-segment! (_type_ texture-pool-segment int) texture-pool-segment 16) - (dummy-17 () none 17) - (dummy-18 () none 18) - (dummy-19 () none 19) + (unused-17 () none 17) + (unused-18 () none 18) + (unused-19 () none 19) (unload! (_type_ texture-page) int 20) (upload-one-common! (_type_ level) symbol 21) (lookup-boot-common-id (_type_ int) int 22) @@ -171,7 +171,7 @@ (size uint32 :offset-assert 24) ;; VRAM words (segment texture-page-segment 3 :inline :offset-assert 28) (pad uint32 16 :offset-assert 64) - + ;; array of texture descriptions. (data texture :dynamic :offset-assert 128) ) @@ -182,7 +182,7 @@ (relocate (_type_ kheap (pointer uint8)) none :replace 7) (remove-from-heap (_type_ kheap) _type_ 9) (get-leftover-block-count (_type_ int int) int 10) - (dummy-11 () none 11) + (unused-11 () none 11) (relocate-dests! (_type_ int int) none 12) (add-to-dma-buffer (_type_ dma-buffer int) int 13) (upload-now! (_type_ int) none 14) @@ -284,7 +284,7 @@ :type uint32 :bitfield #t ;; note that we start at bit 8 because [0-7] are in use. - + (needs-log-in 8) ;; set if we should attempt to log in, cleared on log-in (bit-9 9) ;; cleared on log-in ) @@ -344,7 +344,7 @@ ;; Fixed VRAM ;;;;;;;;;;;;;;;;;;;;;;;; -;; These are pre-allocated and always in VRAM. +;; These are pre-allocated and always in VRAM. (define *sky-base-vram-word* 0) (define *sky-base-block* 0) diff --git a/goal_src/engine/gfx/texture.gc b/goal_src/engine/gfx/texture.gc index 7d04d4a7ce..b7be88434b 100644 --- a/goal_src/engine/gfx/texture.gc +++ b/goal_src/engine/gfx/texture.gc @@ -37,8 +37,6 @@ ;; During a level load, the first texture-page loaded is TFRAG, which contains both "near" and "common" data. ;; TFRAG is the only known thing to use "near" -;; Note: there is something weird going on with the zoomer hud texture. - ;; On the DVD, textures are stored in "tpage files". Each file contains: ;; - a texture-page object, describing the file ;; - a texture object per texture, describing each texture (possibly multiple textures, mipmapped textures are considered 1 "texture") @@ -65,13 +63,13 @@ ;; the first 0x24000 words are for level 0, and the last 0x24000 words are for level 1. ;; the stuff in the middle is shared and lazily loaded as needed. -;; there are 5 texture uploads per frame: +;; there are 5 texture uploads per frame per level: ;; - TFRAG ;; - PRIS ;; - SHRUB ;; - ALPHA ;; - WATER -;; it is unknown how this works when drawing two levels. +;; And also a single "common" texture upload for textures like HUD. ;; Generally, "dest" refers to a location in vram, specified in 32-bit words. ;; block-data is a pointer to EE memory containing texture data. @@ -134,9 +132,7 @@ (+ (-> arg0 data (mem-usage-id texture) count) (-> obj length))) ;; We subtract off the size of the textures. This makes the memory usage negative! - ;; I don't understand why this happens, but - ;; - it matches the game (texture size shows up as negative in the debug menu) - ;; - the game sizes seem correct. + ;; I don't see why this is correct. (let ((v1-7 (- (asize-of obj) (the-as int (shl (-> obj size) 2))))) ;; add 64-bytes for each entry, the size of texture. (dotimes (a0-6 (-> obj length)) @@ -161,7 +157,7 @@ (defun texture-bpp ((arg0 gs-psm)) "Get the number of bits per pixel for the given texture format" - (case arg0 + (case arg0 (((gs-psm mt8)) 8 ) @@ -337,7 +333,7 @@ ) (defun gs-page-width ((arg0 gs-psm)) - (case arg0 + (case arg0 (((gs-psm ct32) (gs-psm ct24) (gs-psm ct16) (gs-psm ct16s)) 64 ) @@ -352,7 +348,7 @@ ) (defun gs-page-height ((arg0 gs-psm)) - (case arg0 + (case arg0 (((gs-psm ct32) (gs-psm ct24)) 32 ) @@ -373,7 +369,7 @@ ) (defun gs-block-width ((arg0 gs-psm)) - (case arg0 + (case arg0 (((gs-psm ct32) (gs-psm ct24)) 8 ) @@ -391,7 +387,7 @@ ) (defun gs-block-height ((arg0 gs-psm)) - (case arg0 + (case arg0 (((gs-psm ct32) (gs-psm ct24) (gs-psm ct16) (gs-psm ct16s)) 8 ) @@ -410,12 +406,8 @@ (let* ((block-width (gs-block-width tex-format)) (block-height (gs-block-height tex-format)) ;; round up to neaest block. - (real-width - (* (/ (+ (+ block-width -1) tex-width) block-width) block-width) - ) - (real-height - (* (/ (+ (+ block-height -1) tex-height) block-height) block-height) - ) + (real-width (* (/ (+ (+ block-width -1) tex-width) block-width) block-width)) + (real-height (* (/ (+ (+ block-height -1) tex-height) block-height) block-height)) ;; and now convert to actual blocks (width-blocks (/ real-width block-width)) (height-blocks (/ real-height block-height)) @@ -436,12 +428,8 @@ "This function doesn't make much sense... It's unused so maybe it's just wrong?" (let* ((page-width (gs-page-width tex-format)) (page-height (gs-page-height tex-format)) - (real-width - (* (/ (+ (+ page-width -1) tex-width) page-width) page-width) - ) - (real-height - (* (/ (+ (+ page-height -1) tex-height) page-height) page-height) - ) + (real-width (* (/ (+ (+ page-width -1) tex-width) page-width) page-width)) + (real-height (* (/ (+ (+ page-height -1) tex-height) page-height) page-height)) (width-blocks (/ real-width page-width)) (height-blocks (/ real-height page-height)) ;; past here, it doesn't make much sense to me. @@ -570,7 +558,7 @@ (allocate-defaults! obj) (set! (-> obj font-palette) (allocate-vram-words! obj 64)) - ;; clear out common pages. + ;; mark the common page area as not-uploaded. (dotimes (v1-6 32) (set! (-> obj common-page v1-6) (the-as texture-page 0)) ) @@ -716,7 +704,7 @@ (tex-dbg " boot allocator got known common-page ~D~%" tex-id) ;; let the common allocator deal with it. (texture-page-common-allocate pool page heap tpage-id) - + ;; textures that: ;; - are in the common page (uploaded before use, shared VRAM) ;; - are in common memory (not level-specific) @@ -799,8 +787,8 @@ (first-chunk-idx-to-upload int) (tex-id uint) ) - - + + (let ((total-upload-size 0)) (with-dma-buffer-add-bucket ((dma-buf (-> (current-frame) global-buf)) ;; the global DMA buffer bucket-idx) @@ -869,7 +857,7 @@ (shl chunks-to-upload-count 5) ) ) - + (+! total-upload-size chunks-to-upload-count) ;; reset (set! chunks-to-upload-count 0) @@ -883,7 +871,7 @@ ) ) ) - + ;; if we finished with a run of "needs upload", set up the upload. (when (nonzero? chunks-to-upload-count) (#when (not PC_PORT) @@ -905,7 +893,7 @@ (texflush 1) ;; texflush ) ) - + ;; in PC PORT we just skip all that stuff and just send a pointer to the texture page and the mode. (#when PC_PORT (dma-buffer-add-cnt-vif2 dma-buf 1 (new 'static 'vif-tag :cmd (vif-cmd pc-port)) (the-as vif-tag 3)) @@ -926,7 +914,7 @@ ;; this is clearly copy-pasta from upload-vram-pages, and there are some weird leftovers. (let ((v1-0 (-> page segment 0 block-data))) ) - + (let ((dest-block (shr (-> page segment 0 dest) 12)) ;; where we're loading to (sz (-> page segment 0 size)) (modified-chunk-count 0) @@ -987,6 +975,8 @@ (defun upload-vram-pages-pris ((pool texture-pool) (segment texture-pool-segment) (page texture-page) (bucket-idx bucket-id) (needed-mask int)) "Upload the entire texture page. If the needed-mask is not set, it will not upload those chunks. + Unlike other pages, it's pretty easy to determine a mask of needed textures - if you draw no cows, don't bother + uploading cow textures. Upload will be added to the given bucket for on-screen. The nth bit of the mask determines if the nth 16-kB chunk is needed in this upload. A 64-bit mask is enough to address the entire common segment, which is the only destination for PRIS textures." @@ -1071,7 +1061,7 @@ (dma-buffer-add-uint64 dma-buf page) (dma-buffer-add-uint64 dma-buf -1) ) - + ) (shl total-upload-size 14) ) @@ -1117,13 +1107,11 @@ ) ;; upload near data, and update the upload cache stuff. - ;; Doesn't this upload more than is needed, and also the shared texture memory? - ;; How does this avoid overwriting the TFRAG textures that might be in use by the - ;; currently rendering frame? + ;; I think this relies on "mode 2" uploads only being in the private area. (upload-now! page 2) (update-vram-pages pool (-> pool segment-near) page 2) - ;; our strategy is to remove the private memory from RAM. + ;; our strategy is to remove the private memory from RAM to save memory, now that it's in VRAM. ;; to avoid leaving an unused hole, we copy the shared data backward. ;; unfortunately, it would be too slow to do it now. ;; this function runs during level loading, during the login of the linked tpage file. @@ -1132,7 +1120,7 @@ ;; and we've already used some time in the upload-now!, so we will delay the actual ;; copy until the next frame. ;; The level loader know about this, and all we have to do is set up *texture-reloate-later* - + (let ((page-seg-2-size (logand -4096 (the-as int (+ (-> page segment 2 size) 4095))))) (cond ((< (the-as uint NEAR_PRIVATE_WORDS) page-seg-2-size) @@ -1212,11 +1200,11 @@ (upload-now! page 2) ;; and remember it in the cache. (update-vram-pages pool (-> pool segment-near) page 2) - + (cond ((< (the-as uint NEAR_PRIVATE_WORDS) seg2-size) ;; we use the shared part. Kick out only the non-shared texture. - ;; it's on th end this time, so no mempcy like in near-allocate-0 + ;; it's on the end this time, so no mempcy like in near-allocate-0 (set! (-> page segment 2 size) (+ -147456 (the-as int seg2-size))) (set! (-> heap current) (&+ (-> page segment 2 block-data) (shl (-> page segment 2 size) 2)) @@ -1383,9 +1371,15 @@ (dotimes (page-idx 9) (set! (-> level texture-page page-idx) #f) ) - + (#when PC_PORT + (when (zero? id-array) + (format #t "ERROR: texture id array is 0, skipping texture login!~%") + (return #f) + ) + ) (if (>= max-page-kind 0) ;; tfrag. - ;; login with near allocator. + ;; login the texture. If the texture isn't there, it will try to load it + ;; and allocate with the given allocation function. (let ((tfrag-dir-entry (texture-page-login (-> id-array 0) (if (= (-> level index) 1) @@ -1401,7 +1395,7 @@ ) ) ) - + (if (>= max-page-kind 1) ;; pris. ;; login with common. (let ((pris-dir-entry (texture-page-login (-> id-array 1) texture-page-common-allocate loading-level))) @@ -1449,7 +1443,7 @@ (defmethod add-tex-to-dma! texture-pool ((obj texture-pool) (level level) (tex-page-kind int)) "For the given tpage-kind, upload as needed for the level" (when (= tex-page-kind (tpage-kind tfrag)) ;; TFRAG (0) - ;; get the texture page, bucket to add to, and an effective distance from the closest thing. + ;; get the texture page, bucket to add to, and an effective distance from the closest thing. (let ((tfrag-page (-> level texture-page 0)) (tfrag-bucket (if (zero? (-> level index)) (bucket-id tfrag-tex0) (bucket-id tfrag-tex1))) ;; not really sure how this is calculated, but it's a distance. @@ -1501,7 +1495,7 @@ ) ) ) - + (if (= tex-page-kind (tpage-kind pris)) ;; PRIS (1) (let ((pris-page (-> level texture-page 1))) (if (and pris-page (nonzero? pris-page)) @@ -1515,7 +1509,7 @@ ) ) ) - + (if (= tex-page-kind (tpage-kind shrub)) ;; SHRUB (2) (let ((shrub-page (-> level texture-page 2)) (shrub-closest (-> level closest-object 2)) ;; I guess this is the shrub closest. @@ -1545,7 +1539,7 @@ ) ) ) - + (if (= tex-page-kind (tpage-kind alpha)) ;; ALPHA (3) (let ((alpha-page (-> level texture-page 3)) (alpha-closest (-> level closest-object 3)) @@ -1580,7 +1574,7 @@ ) ) ) - + (if (= tex-page-kind (tpage-kind water)) ;; WATER (4) (let ((water-page (-> level texture-page 4))) (if (and water-page (nonzero? water-page)) @@ -1604,7 +1598,7 @@ (and (nonzero? a2-0) (logtest? (-> obj common-page-mask) (ash 1 v1-0))) ;; in the mask. ) ;; upload it! - (upload-vram-pages obj (-> obj segment-common) a2-0 -2 (bucket-id pre-sprite-textures)) + (upload-vram-pages obj (-> obj segment-common) a2-0 -2 (bucket-id common-page-tex)) (return #f) ) ) @@ -1910,7 +1904,7 @@ ) ;; if we have the font texture after log-in, then set our heap marker to before it. - ;; resetting the heap to here would kick + ;; resetting the heap to here would kick (if (and main-font-tx (-> main-font-tx page)) (set! heap-before-font-tex (the-as int (-> main-font-tx page segment 0 dest)) @@ -1929,13 +1923,7 @@ (font-tx-1-fmt (gs-psm mt4hl)) ;; 4-bit, using 4 of the 8 free bits of z24 ) ;; do the relocation! - (texture-relocate - dma-buff - font-tx-1 - font-tx-1-dest - font-tx-1-fmt - font-clut - ) + (texture-relocate dma-buff font-tx-1 font-tx-1-dest font-tx-1-fmt font-clut) ;; tell the font system that we put the texture here. (font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* small-font-lo-tmpl)) @@ -1949,13 +1937,7 @@ (font-tx-0-dest #xe0000) (font-tx-0-fmt (gs-psm mt4hh)) ) - (texture-relocate - dma-buff - font-tx-0 - font-tx-0-dest - font-tx-0-fmt - font-clut - ) + (texture-relocate dma-buff font-tx-0 font-tx-0-dest font-tx-0-fmt font-clut) (font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* small-font-hi-tmpl)) font-tx-0 @@ -1968,13 +1950,7 @@ (font-tx-3-dest #xe6000) (font-tx-3-fmt (gs-psm mt4hl)) ) - (texture-relocate - dma-buff - font-tx-3 - font-tx-3-dest - font-tx-3-fmt - font-clut - ) + (texture-relocate dma-buff font-tx-3 font-tx-3-dest font-tx-3-fmt font-clut) (font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* large-font-lo-tmpl)) font-tx-3 @@ -1982,23 +1958,19 @@ (the-as uint font-tx-3-fmt) (the-as uint clut-dest-addr) ) - (set! font-tx-3 (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x4fe))) - (set! font-tx-3-dest #xe6000) - (set! font-tx-3-fmt (gs-psm mt4hh)) - (texture-relocate - dma-buff - font-tx-3 - font-tx-3-dest - font-tx-3-fmt - font-clut - ) + ) + (let ((font-tx-2 (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x4fe))) + (font-tx-2-dest #xe6000) + (font-tx-2-fmt (gs-psm mt4hh)) + ) + (texture-relocate dma-buff font-tx-2 font-tx-2-dest (the-as gs-psm font-tx-2-fmt) font-clut) (font-set-tex0 - (the-as (pointer gs-tex0) (-> *font-work* large-font-hi-tmpl)) - font-tx-3 - (the-as uint font-tx-3-dest) - (the-as uint font-tx-3-fmt) - (the-as uint clut-dest-addr) - ) + (the-as (pointer gs-tex0) (-> *font-work* large-font-hi-tmpl)) + font-tx-2 + (the-as uint font-tx-2-dest) + (the-as uint font-tx-2-fmt) + (the-as uint clut-dest-addr) + ) ) ;; texflush @@ -2098,7 +2070,8 @@ ) (defmethod relocate texture-page ((obj texture-page) (arg0 kheap) (arg1 (pointer uint8))) - "Add to VRAM and allocate links" + "Add to VRAM and allocate links. + This method is called by the GOAL linker when it loads a texture page." (tex-dbg "loaded tpage ~A~%" obj ;;(-> obj info file-name) ;;(-> obj info maya-file-name) @@ -2118,9 +2091,7 @@ (tex-dbg " tpage is with level ~A~%" v1-2) (when v1-2 ;; add us to the loading level's tpages - (set! (-> v1-2 loaded-texture-page (-> v1-2 loaded-texture-page-count)) - obj - ) + (set! (-> v1-2 loaded-texture-page (-> v1-2 loaded-texture-page-count)) obj) (+! (-> v1-2 loaded-texture-page-count) 1) ) ) @@ -2134,12 +2105,7 @@ (set! (-> *texture-relocate-later* memcpy) #f) ;; allocate! - ((-> *texture-pool* allocate-func) - *texture-pool* - obj - arg0 - (the-as int a3-0) - ) + ((-> *texture-pool* allocate-func) *texture-pool* obj arg0 (the-as int a3-0)) ) ;; the actual condition (not (-> *texture-relocate-later* memcpy)) @@ -2148,11 +2114,8 @@ (set! (-> s4-0 page) obj) (if (not (-> s4-0 link)) (set! (-> s4-0 link) - (the-as - texture-link - (malloc 'loading-level (* (max (-> s4-0 length) (-> obj length)) 4)) - ) - ) + (the-as texture-link (malloc 'loading-level (* (max (-> s4-0 length) (-> obj length)) 4))) + ) ) ) (else @@ -2174,19 +2137,12 @@ (s4-0 (-> gp-0 page)) ) ;; do this first, before allocating - (ultimate-memcpy - (the-as pointer (-> gp-0 dest)) - (the-as pointer (-> gp-0 source)) - (-> gp-0 move) - ) + (ultimate-memcpy (the-as pointer (-> gp-0 dest)) (the-as pointer (-> gp-0 source)) (-> gp-0 move)) (set! (-> s5-0 page) s4-0) ;; now safe to allocate links! (if (not (-> s5-0 link)) (set! (-> s5-0 link) - (the-as - texture-link - (malloc 'loading-level (* (max (-> s5-0 length) (-> s4-0 length)) 4)) - ) + (the-as texture-link (malloc 'loading-level (* (max (-> s5-0 length) (-> s4-0 length)) 4))) ) ) ) @@ -2196,7 +2152,7 @@ ) (defun texture-page-login ((id texture-id) (alloc-func (function texture-pool texture-page kheap int texture-page)) (heap kheap)) - "Return the tpage-dir entry for the given texture. + "Return the tpage-dir entry for the given texture. Load if from the debug network if its not loaded. Return #f if it doesn't work" ;; make sure its a valid entry @@ -2218,7 +2174,7 @@ #f ) ) - ;; and load it! The loado links but doesn't execute + ;; and load it! The loado links but doesn't execute the relocate method. (s2-0 (the-as texture-page (loado file-name heap))) ) ;; if we loaded, relocate! @@ -2271,7 +2227,7 @@ ;; debug menu shader stuff (define *shader-list* '()) -(define *edit-shader* (the-as texture-id 0)) +(define *edit-shader* (new 'static 'texture-id)) (defun link-texture-by-id ((arg0 texture-id) (arg1 adgif-shader)) "Link the given adgif shader to the texture with the given ID" @@ -2485,12 +2441,8 @@ (-> dir-entry link) ) ;; push - (set! (-> shader next shader) - (-> dir-entry link next (-> tex-id index) shader) - ) - (set! (-> dir-entry link next (-> tex-id index) shader) - (shr (the-as uint shader) 4) - ) + (set! (-> shader next shader) (-> dir-entry link next (-> tex-id index) shader)) + (set! (-> dir-entry link next (-> tex-id index) shader) (shr (the-as uint shader) 4)) ) (when (and (-> dir-entry page) (< (-> tex-id index) (the-as uint (-> dir-entry page length))) @@ -2522,9 +2474,7 @@ (let ((a1-7 (-> *texture-page-dir* entries (the-as uint (-> v1-4 page))))) (when (and (< (-> v1-4 index) (the-as uint (-> a1-7 length))) (-> a1-7 link)) (set! (-> arg0 next shader) (-> a1-7 link next (-> v1-4 index) shader)) - (set! (-> a1-7 link next (-> v1-4 index) shader) - (shr (the-as uint arg0) 4) - ) + (set! (-> a1-7 link next (-> v1-4 index) shader) (shr (the-as uint arg0) 4)) ) (when (and (-> a1-7 page) (< (-> v1-4 index) (the-as uint (-> a1-7 page length))) @@ -2580,96 +2530,94 @@ (defun-debug texture-page-dir-inspect ((dir texture-page-dir) (mode symbol)) (format #t "[~8x] ~A~%" dir (-> dir type)) (let ((pool *texture-pool*)) - (format - #t - "~Ttexture pool (~DK used, ~DK free)~%" - (/ (- (-> pool cur) (-> pool top)) 256) - (/ (- #xa0000 (-> pool cur)) 256) + (format #t "~Ttexture pool (~DK used, ~DK free)~%" + (/ (- (-> pool cur) (-> pool top)) 256) + (/ (- #xa0000 (-> pool cur)) 256) + ) ) - ) (dotimes (level-idx (-> *level* length)) - (let ((lev (-> *level* level level-idx))) - (if (= (-> lev status) 'active) - (texture-page-size-check *texture-pool* lev #f) - ) + (let ((lev (-> *level* level level-idx))) + (if (= (-> lev status) 'active) + (texture-page-size-check *texture-pool* lev #f) + ) + ) ) - ) (format #t "~Tlength: ~D~%" (-> dir length)) (format #t "~Tdata[~D]: @ #x~X~%" (-> dir length) (-> dir entries)) (dotimes (entry-idx (-> dir length)) - (let ((entry-page (-> dir entries entry-idx page)) - (entry-link (-> dir entries entry-idx link)) - ) - (cond - (entry-page - (format #t "~T [~3D] loaded ~S ~A~%" entry-idx (if entry-link - " linked" - "unlinked" - ) - entry-page - ) - ) - (else - (if (= mode 'full) - (format - #t - "~T [~3D] unloaded ~S #~%" - entry-idx - (if entry-link - " linked" - "unlinked" - ) - (-> dir entries entry-idx length) - ) - ) - ) - ) - (when (and (or entry-page entry-link) mode) - (dotimes (entry-list-length (-> dir entries entry-idx length)) - (cond - ((not entry-link) - (format #t "~T [~3D] unlinked" entry-list-length) - ) - ((zero? (-> entry-link next entry-list-length shader)) - (format #t "~T [~3D] UNUSED " entry-list-length) - ) - (else - (let ((t9-9 format) - (a0-12 #t) - (a1-10 "~T [~3D] ~3D links ") - (a2-11 entry-list-length) - (a3-7 0) - ) - (let - ((v1-40 - (the-as object (* (-> entry-link next entry-list-length shader) 16)) - ) - ) - (while (nonzero? (the-as int v1-40)) - (nop!) - (+! a3-7 1) - (set! v1-40 (* (-> (the-as adgif-shader v1-40) next shader) 16)) - ) + (let ((entry-page (-> dir entries entry-idx page)) + (entry-link (-> dir entries entry-idx link)) ) - (t9-9 a0-12 a1-10 a2-11 a3-7) - ) - ) - ) (cond - ((not entry-page) - (format #t " unloaded~%") + (entry-page + (format + #t + "~T [~3D] loaded ~S ~A~%" + entry-idx + (if entry-link + " linked" + "unlinked" + ) + entry-page + ) + ) + (else + (if (= mode 'full) + (format + #t + "~T [~3D] unloaded ~S #~%" + entry-idx + (if entry-link + " linked" + "unlinked" + ) + (-> dir entries entry-idx length) + ) + ) + ) ) - ((not (-> entry-page data entry-list-length)) - (format #t " empty~%") + (when (and (or entry-page entry-link) mode) + (dotimes (entry-list-length (-> dir entries entry-idx length)) + (cond + ((not entry-link) + (format #t "~T [~3D] unlinked" entry-list-length) + ) + ((zero? (-> entry-link next entry-list-length shader)) + (format #t "~T [~3D] UNUSED " entry-list-length) + ) + (else + (let ((t9-9 format) + (a0-12 #t) + (a1-10 "~T [~3D] ~3D links ") + (a2-11 entry-list-length) + (a3-7 0) + ) + (let ((v1-40 (the-as object (* (-> entry-link next entry-list-length shader) 16)))) + (while (nonzero? (the-as uint v1-40)) + (nop!) + (+! a3-7 1) + (set! v1-40 (* (-> (the-as adgif-shader v1-40) next shader) 16)) + ) + ) + (t9-9 a0-12 a1-10 a2-11 a3-7) + ) + ) + ) + (cond + ((not entry-page) + (format #t " unloaded~%") + ) + ((not (-> entry-page data entry-list-length)) + (format #t " empty~%") + ) + (else + (format #t " ~A~%" (-> entry-page data entry-list-length)) + ) + ) + ) ) - (else - (format #t " ~A~%" (-> entry-page data entry-list-length)) - ) - ) ) - ) ) - ) (none) ) diff --git a/goal_src/engine/gfx/tfrag/tfrag-methods.gc b/goal_src/engine/gfx/tfrag/tfrag-methods.gc index ab05075890..c3d4b1f2ed 100644 --- a/goal_src/engine/gfx/tfrag/tfrag-methods.gc +++ b/goal_src/engine/gfx/tfrag/tfrag-methods.gc @@ -17,7 +17,7 @@ (dotimes (s3-0 (/ (-> s4-0 length) 2)) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s4-0 data (* s3-0 2)) (-> s4-0 data (+ (* s3-0 2) 1)) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) @@ -207,7 +207,7 @@ (a0-37 int) (sv-16 (pointer uint8)) ) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (let ((s5-0 (+ (-> arg0 length) -1))) #| TODO (when (nonzero? s5-0) @@ -375,7 +375,7 @@ (a0-37 int) (sv-16 (pointer uint8)) ) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (let ((s5-0 (+ (-> arg0 length) -1))) #| TODO (when (nonzero? s5-0) @@ -550,7 +550,7 @@ (a0-37 int) (sv-16 (pointer uint8)) ) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (let ((s5-0 (+ (-> arg0 length) -1))) #| TODO (when (nonzero? s5-0) @@ -850,9 +850,9 @@ ;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none. ;; Used lq/sq (defmethod collect-stats drawable-tree-trans-tfrag ((obj drawable-tree-trans-tfrag)) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) - (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag)))) - (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag)))) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) + (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) + (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) (set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* trans-tfrag)) (set! (-> *tfrag-work* tr-stat-tfrag-near) (-> *terrain-stats* trans-tfrag-near)) (let ((v1-12 (-> *tfrag-work* frag-dists quad))) @@ -869,9 +869,9 @@ ;; INFO: Return type mismatch drawable-tree-lowres-trans-tfrag vs none. ;; Used lq/sq (defmethod collect-stats drawable-tree-lowres-trans-tfrag ((obj drawable-tree-lowres-trans-tfrag)) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) - (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag)))) - (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag)))) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) + (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) + (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) (set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* trans-tfrag)) (set! (-> *tfrag-work* tr-stat-tfrag-near) (-> *terrain-stats* trans-tfrag-near)) (let ((v1-12 (-> *tfrag-work* frag-dists quad))) @@ -888,9 +888,9 @@ ;; INFO: Return type mismatch drawable-tree-dirt-tfrag vs none. ;; Used lq/sq (defmethod collect-stats drawable-tree-dirt-tfrag ((obj drawable-tree-dirt-tfrag)) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) - (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag)))) - (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag)))) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) + (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) + (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) (set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* trans-tfrag)) (set! (-> *tfrag-work* tr-stat-tfrag-near) (-> *terrain-stats* trans-tfrag-near)) (let ((v1-12 (-> *tfrag-work* frag-dists quad))) @@ -907,9 +907,9 @@ ;; INFO: Return type mismatch drawable-tree-ice-tfrag vs none. ;; Used lq/sq (defmethod collect-stats drawable-tree-ice-tfrag ((obj drawable-tree-ice-tfrag)) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) - (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag)))) - (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag)))) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) + (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) + (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) (set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* trans-tfrag)) (set! (-> *tfrag-work* tr-stat-tfrag-near) (-> *terrain-stats* trans-tfrag-near)) (let ((v1-12 (-> *tfrag-work* frag-dists quad))) @@ -940,7 +940,7 @@ ;; definition for method 14 of type drawable-inline-array-trans-tfrag ;; INFO: Return type mismatch drawable-inline-array-trans-tfrag vs none. (defmethod collect-stats drawable-inline-array-trans-tfrag ((obj drawable-inline-array-trans-tfrag)) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (dotimes (s5-0 (-> obj length)) (let ((s4-0 (-> obj data s5-0))) (if (vis-cull (-> s4-0 id)) @@ -999,8 +999,8 @@ (-> arg1 global-buf) (edge-debug-lines (-> obj debug-data debug-lines)) - (add-debug-sphere #t (bucket-id debug-draw0) (-> obj bsphere) (-> obj bsphere w) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) - ;;(add-debug-x #t (bucket-id debug-draw0) (-> obj bsphere) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug) (-> obj bsphere) (-> obj bsphere w) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + ;;(add-debug-x #t (bucket-id debug) (-> obj bsphere) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) (none) ) diff --git a/goal_src/engine/gfx/tfrag/tfrag.gc b/goal_src/engine/gfx/tfrag/tfrag.gc index 901602761d..e44fbdea95 100644 --- a/goal_src/engine/gfx/tfrag/tfrag.gc +++ b/goal_src/engine/gfx/tfrag/tfrag.gc @@ -322,7 +322,7 @@ (defun add-pc-tfrag3-data ((dma-buf dma-buffer) (lev level)) "Add PC-port specific tfrag data" (let ((packet (the-as dma-packet (-> dma-buf base)))) - (set! (-> packet dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc 15)) + (set! (-> packet dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc 16)) (set! (-> packet vif0) (new 'static 'vif-tag)) (set! (-> packet vif1) (new 'static 'vif-tag :cmd (vif-cmd pc-port))) (set! (-> dma-buf base) (the pointer (&+ packet 16))) @@ -348,9 +348,10 @@ (set! (-> vec y) (-> *math-camera* fog-min)) (set! (-> vec z) (-> *math-camera* fog-max)) ) - (charp<-string (the (pointer uint8) (&-> data-ptr 14)) (symbol->string (-> lev nickname))) + (set! (-> data-ptr 14) (-> (math-camera-pos) quad)) + (charp<-string (the (pointer uint8) (&-> data-ptr 15)) (symbol->string (-> lev nickname))) ) - (&+! (-> dma-buf base) (* 16 15)) + (&+! (-> dma-buf base) (* 16 16)) ) ;;;;;;;;;;;;;;;;;;;;; diff --git a/goal_src/engine/gfx/tie/generic-tie-h.gc b/goal_src/engine/gfx/tie/generic-tie-h.gc index a1ae992681..7b132b63b2 100644 --- a/goal_src/engine/gfx/tie/generic-tie-h.gc +++ b/goal_src/engine/gfx/tie/generic-tie-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: generic-tie-h ;; dgos: GAME, ENGINE +;; Generic tie converts tie data to generic and supports environment mapping. + (deftype generic-tie-instance (structure) ((matrix-tag dma-packet :inline :offset-assert 0) (matrix-data vector 6 :inline :offset-assert 16) diff --git a/goal_src/engine/gfx/tie/prototype-h.gc b/goal_src/engine/gfx/tie/prototype-h.gc index 0f82cf5a52..d0a210e652 100644 --- a/goal_src/engine/gfx/tie/prototype-h.gc +++ b/goal_src/engine/gfx/tie/prototype-h.gc @@ -7,8 +7,8 @@ ;; The "prototype" system is used for instanced background rendering (shrub and tie). -;; The first type is the bucket. There's one bucket per prototype. Each prototype can have up to -;; 4 geometries (level of details). Lower numbers are higher detail. +;; The first type is the bucket. There's one bucket per prototype which collects instances. +;; Each prototype can have up to 4 geometries (level of details). Lower numbers are higher detail. ;; During drawing, the engine will build linked lists of instance data. Each instance will pick ;; a geom, based on distance from the camera (or other settings) and will add itself to the list ;; for that geom. @@ -22,7 +22,7 @@ (rdists vector :inline :offset-assert 48) ;; lod settings (next uint32 4 :offset-assert 64) ;; linked list of instances of each geom. (count uint16 4 :offset-assert 80) ;; number of each instance with each geom. - + ;; overlays (near-plane meters :offset 32) (near-stiff meters :offset 36) @@ -128,7 +128,7 @@ ) ;; all tie prototypes and pointer to level's wind data. -;; in practice, they are shared with all tie/shrub trees in the level +;; in practice, they are shared with all tie/shrub trees in the level (deftype proxy-prototype-array-tie (basic) ((prototype-array-tie prototype-array-tie :offset-assert 4) (wind-vectors uint32 :offset-assert 8) diff --git a/goal_src/engine/gfx/tie/tie-methods.gc b/goal_src/engine/gfx/tie/tie-methods.gc index cb9cf0fe55..57581d93e5 100644 --- a/goal_src/engine/gfx/tie/tie-methods.gc +++ b/goal_src/engine/gfx/tie/tie-methods.gc @@ -5,6 +5,9 @@ ;; name in dgo: tie-methods ;; dgos: GAME, ENGINE +(def-mips2c draw-inline-array-instance-tie (function pointer (inline-array instance-tie) int dma-buffer none)) +(def-mips2c draw-inline-array-prototype-tie-generic-asm (function dma-buffer int prototype-array-tie none)) + (defun tie-init-buffers ((arg0 dma-buffer)) "Initialize the TIE buckets. Note: the buffer passed in here is _not_ used. @@ -296,7 +299,11 @@ ;; (let ((s4-0 (+ (-> arg0 length) -1))) ;; number of arrays of draw-nodes (depth of the BVH tree, not counting instance leaves) - ;; perform draw node culling. TODO + ;; perform draw node culling. + ;; Note: It's okay to skip this. The visible list right now will just be the occlusion string + ;; The PC renderer won't see this (and has its own version of culling that's plenty fast) + ;; The instance drawing will end up looking at too many instances, but this is fine - it + ;; should reject those, and it plenty fast. #| (when (nonzero? s4-0) (dotimes (s3-0 s4-0) @@ -363,7 +370,10 @@ (reset! (-> *perf-stats* data 9)) ;; DRAW! - ;;(draw-inline-array-instance-tie s0-0 s1-0 sv-16 s3-1) + ;; note: this is a bit wasteful because we only care about generic ties. + ;; non-generics are drawn fully in C++, but we're computing unused stuff here. + ;; This ends up being so fast it's probably not worth worrying about yet. + (with-profiler "tie-instance" (draw-inline-array-instance-tie s0-0 s1-0 sv-16 s3-1)) ;; finish perf stats (read! (-> *perf-stats* data 9)) (update-wait-stats (-> *perf-stats* data 9) (the-as uint 0) @@ -398,8 +408,10 @@ (set! (-> *prototype-tie-work* generic-wait-from-spr) (the-as uint 0)) (set! (-> *instance-tie-work* first-generic-prototype) (the-as uint (-> s3-1 base))) + ;; hack, I expect this to overwrite this. + (set! (-> (the (pointer uint64) (-> s3-1 base))) #xdeadbeefdeadbeef) (reset! (-> *perf-stats* data 10)) - ;;(draw-inline-array-prototype-tie-generic-asm s3-1 s5-1 s4-1) + (with-profiler "tie-generic-protos" (draw-inline-array-prototype-tie-generic-asm s3-1 s5-1 s4-1)) (read! (-> *perf-stats* data 10)) (update-wait-stats (-> *perf-stats* data 10) (the-as uint 0) (-> *prototype-tie-work* generic-wait-to-spr) diff --git a/goal_src/engine/gfx/time-of-day.gc b/goal_src/engine/gfx/time-of-day.gc index 5a663d6224..41ee1bc6e9 100644 --- a/goal_src/engine/gfx/time-of-day.gc +++ b/goal_src/engine/gfx/time-of-day.gc @@ -21,21 +21,21 @@ (defbehavior time-of-day-update time-of-day-proc () "Update the particles and sky tng renderer for time-of-day effects" (time-of-day-effect) - + ;; spawn or kill stars, if needed. (cond ;; should have stars in the sky ((and (or (>= (-> self hour) 19) (>= 5 (-> self hour))) ;; night time (and (< 45.0 (-> *time-of-day-context* num-stars)) (-> *time-of-day-context* sky)) ;; sky + stars desired ) - + ;; see if we need more (when (and *dproc* (< (-> self star-count) (the int (-> *time-of-day-context* num-stars)))) (spawn (-> self stars) (math-camera-pos)) (+! (-> self star-count) 1) ) ) - + ;; have stars, but don't want them ((> (-> self star-count) 0) ;; kill all stars. @@ -55,7 +55,7 @@ 0 ) ) - + ;; spawn or kill sun, if needed (cond ((and (>= (-> self time-of-day) 6.25) @@ -73,7 +73,7 @@ 0 ) ) - + ;; spawn or kill green sun, if needed (cond ((and (or (>= (-> self time-of-day) 21.75) (>= 10.25 (-> self time-of-day))) @@ -90,7 +90,7 @@ 0 ) ) - + ;; update the sky renderer. (update-sky-tng-data (-> self time-of-day)) 0 @@ -105,7 +105,7 @@ (while #t ;; tick! (+! (-> self frame) (the int (* (-> self time-ratio) (-> *display* time-adjust-ratio)))) - + ;; now update time... (when (>= (-> self frame) 300) ;; 300 ticks/second @@ -156,7 +156,7 @@ ) ) ) - + ;; set the time of day float. This is in hours (0-24) (let* ((f0-4 (the float (-> self frame))) (f0-6 (+ (* 0.0033333334 f0-4) (the float (-> self second)))) @@ -200,24 +200,12 @@ (defun start-time-of-day () "Start up the time of day process. Kill any existing ones" (kill-by-name 'time-of-day-proc *active-pool*) - (let ((gp-0 (get-process *default-dead-pool* time-of-day-proc #x4000))) - (set! *time-of-day-proc* - (the-as (pointer time-of-day-proc) - (when gp-0 - (let ((t9-2 (method-of-type time-of-day-proc activate))) - (t9-2 (the-as time-of-day-proc gp-0) *default-pool* 'time-of-day-proc (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 init-time-of-day) - (-> gp-0 ppointer ) - ) - ) - ) - ) + (set! *time-of-day-proc* (process-spawn time-of-day-proc :init init-time-of-day)) (none) ) (defun time-of-day-setup ((arg0 symbol)) - "This function is weird. Returns if time of day will tick forward or not. + "This function is weird. Returns if time of day will tick forward or not. If you set arg0 it will toggle on/off time of day. Otherwise, calling the function has no side effects." (when arg0 @@ -279,19 +267,19 @@ (defun update-time-of-day ((arg0 time-of-day-context)) "Update the time of day context" - + ;; set defaults (set! (-> arg0 sky) #f) (set! (-> arg0 target-interp) 0.0) - + (when *target* (set! (-> *target* draw light-index) (the-as uint 0)) (when (-> *target* sidekick) (set! (-> *target* sidekick 0 draw light-index) (the-as uint 0)) ) ) - - + + ;; see if either level gives us a sky. (dotimes (v1-12 (-> *level* length)) (let ((a0-4 (-> *level* level v1-12))) @@ -302,19 +290,19 @@ ) ) ) - + ;; level distances (let ((s4-0 (new 'stack-no-clear 'array 'float 2))) ;; was a boxed array, but the GOAL implementation seems buggy. (set! (-> s4-0 0) 0.0) (set! (-> s4-0 1) 0.0) 0.0 - + (let ((s5-0 0) (f30-0 (-> arg0 current-interp)) ) (set! *lightning-frame-done* #f) (set! *lightning-realtime-done* #f) - + ;; loop over levels and figure out which to use. (dotimes (s3-0 2) (let ((s2-0 (-> *level* level s3-0))) @@ -339,7 +327,7 @@ ) ) ) - + ;; now pick desired interpolation weights (let* ((f0-6 (-> s4-0 0)) (f1-0 (-> s4-0 1)) @@ -359,15 +347,15 @@ ;; this is a hack to pick the mood of village2 when we're closer to sunken, as long as ;; the camera is above 0. ((and (< 0.0 (-> *math-camera* trans y)) - (= (-> *level* level0 name) 'village2) - (= (-> *level* level1 name) 'sunken) - ) + (= (-> *level* level0 name) 'village2) + (= (-> *level* level1 name) 'sunken) + ) 0.0 ;; picks 0 = village2 ) ((and (< 0.0 (-> *math-camera* trans y)) - (= (-> *level* level0 name) 'sunken) - (= (-> *level* level1 name) 'village2) - ) + (= (-> *level* level0 name) 'sunken) + (= (-> *level* level1 name) 'village2) + ) 1.0 ;; picks 1 = village 2 ) (else @@ -377,13 +365,13 @@ ) ) ) - + ;; normally we will slowly ramp the interpolation weights. ;; but if we've just teleported, immediately snap to the new value. (if *teleport* (set! f30-0 f28-0) ) - + ;; ramp interpolation weights. (when (not (or (paused?) (= f28-0 f30-0))) (let ((f0-7 (- f30-0 f28-0))) @@ -420,13 +408,13 @@ ) ) ) - + ;; number of active skys (set! (-> arg0 active-count) (the-as uint s5-0)) ;; interpolation value between the two level moods. (set! (-> arg0 interp) f28-0) ) - + ;; Do the interpolation (set! (-> arg0 current-interp) f30-0) (set! *sky-drawn* #f) @@ -493,8 +481,8 @@ (dotimes (s4-4 8) (dotimes (s3-2 3) (let ((s2-1 (+ (+ (* 48 s3-2) 156 (* 192 s4-4)) (the-as int arg0)))) - (let ((s1-0 (+ (+ (* 48 s3-2) 156 (* 192 s4-4)) (the-as int (-> arg0 moods 0))) ) - (s0-0 (+ (+ (* 48 s3-2) 156 (* 192 s4-4)) (the-as int (-> arg0 moods 1))) ) + (let ((s1-0 (+ (+ (* 48 s3-2) 156 (* 192 s4-4)) (the-as int (-> arg0 moods 0)))) + (s0-0 (+ (+ (* 48 s3-2) 156 (* 192 s4-4)) (the-as int (-> arg0 moods 1)))) ) (vector4-lerp! (the-as vector (+ s2-1 0)) (the-as vector (+ s1-0 0)) (the-as vector (+ s0-0 0)) f30-0) (vector4-lerp! (the-as vector (+ s2-1 16)) (the-as vector (+ s1-0 16)) (the-as vector (+ s0-0 16)) f30-0) @@ -518,7 +506,7 @@ ) ) ) - + ;; setup sky stuff (dotimes (s4-5 2) (make-sky-textures arg0 s4-5) @@ -542,14 +530,13 @@ (set! (-> arg0 current-sun env-color y) (* 0.5019608 (-> arg0 current-sun env-color y))) (set! (-> arg0 current-sun env-color z) (* 0.5019608 (-> arg0 current-sun env-color z))) (set! (-> arg0 current-sun env-color w) (* 0.5019608 (-> arg0 current-sun env-color w))) - + (let ((v1-179 (-> arg0 current-fog))) - (set! *fog-color* - (new 'static 'rgba - :r (the int (-> v1-179 fog-color x)) - :g (the int (-> v1-179 fog-color y)) - :b (the int (-> v1-179 fog-color z)) - ) + (set! *fog-color* (new 'static 'rgba + :r (the int (-> v1-179 fog-color x)) + :g (the int (-> v1-179 fog-color y)) + :b (the int (-> v1-179 fog-color z)) + ) ) ) (let ((v1-184 (-> arg0 current-fog erase-color))) @@ -566,73 +553,68 @@ (set! (-> *math-camera* fog-end) (-> arg0 current-fog fog-dists y)) (set! (-> *math-camera* fog-max) (-> arg0 current-fog fog-dists z)) (set! (-> *math-camera* fog-min) (-> arg0 current-fog fog-dists w)) - + ;; interp target lights. (note: added check here.) (let* ((v1-195 (if *target* (-> *target* draw light-index) 0)) (f30-1 (-> arg0 target-interp)) (s4-6 (-> arg0 light-group)) (s5-2 (-> arg0 light-group v1-195)) ) - + (when (nonzero? v1-195) + (cond + ((= f30-1 1.0) + ) + ((= f30-1 0.0) + (quad-copy! (the-as pointer (-> arg0 light-group v1-195)) (the-as pointer (-> arg0 light-group)) 12) + ) + (else + (dotimes (s3-4 4) + (vector4-lerp! + (the-as vector (+ (the-as uint (-> s5-2 dir0)) (* 48 s3-4))) + (the-as vector (+ (the-as uint (-> s4-6 0)) (* 48 s3-4))) + (the-as vector (+ (the-as uint (-> s5-2 dir0)) (* 48 s3-4))) + f30-1 + ) + (vector4-lerp! + (the-as vector (+ (the-as uint (-> s5-2 dir0 color)) (* 48 s3-4))) + (the-as vector (+ (the-as uint (-> s4-6 0 dir0 color)) (* 48 s3-4))) + (the-as vector (+ (the-as uint (-> s5-2 dir0 color)) (* 48 s3-4))) + f30-1 + ) + (vector4-lerp! + (the-as vector (+ (the-as uint (-> s5-2 dir0 levels)) (* 48 s3-4))) + (the-as vector (+ (the-as uint (-> s4-6 0 dir0 levels)) (* 48 s3-4))) + (the-as vector (+ (the-as uint (-> s5-2 dir0 levels)) (* 48 s3-4))) + f30-1 + ) + (vector-normalize! (the-as vector (+ (the-as uint (-> s5-2 dir0)) (* 48 s3-4))) 1.0) + ) + ) + ) - (when (nonzero? v1-195) - (cond - ((= f30-1 1.0) - ) - ((= f30-1 0.0) - (quad-copy! (the-as pointer (-> arg0 light-group v1-195)) (the-as pointer (-> arg0 light-group)) 12) - ) - (else - (dotimes (s3-4 4) - (vector4-lerp! - (the-as vector (+ (the-as uint (-> s5-2 dir0)) (* 48 s3-4))) - (the-as vector (+ (the-as uint (-> s4-6 0)) (* 48 s3-4))) - (the-as vector (+ (the-as uint (-> s5-2 dir0)) (* 48 s3-4))) - f30-1 + ;; some shadow thing. + (let ((a2-30 (new 'stack-no-clear 'vector))) + (set! (-> a2-30 x) (- (-> s5-2 dir0 direction x))) + (set! (-> a2-30 y) (- (-> s5-2 dir0 direction y))) + (set! (-> a2-30 z) (- (-> s5-2 dir0 direction z))) + (when (< (-> s5-2 dir0 direction y) 0.9063) + (let* ((f0-56 0.4226) + (f1-17 (-> a2-30 x)) + (f1-19 (* f1-17 f1-17)) + (f2-7 (-> a2-30 z)) + (f0-57 (/ f0-56 (sqrtf (+ f1-19 (* f2-7 f2-7))))) + ) + (set! (-> a2-30 x) (* (-> a2-30 x) f0-57)) + (set! (-> a2-30 y) -0.9063) + (set! (-> a2-30 z) (* (-> a2-30 z) f0-57)) + ) + ) + (vector4-lerp! (-> arg0 current-shadow) (-> arg0 current-shadow) a2-30 f30-1) ) - (vector4-lerp! - (the-as vector (+ (the-as uint (-> s5-2 dir0 color)) (* 48 s3-4))) - (the-as vector (+ (the-as uint (-> s4-6 0 dir0 color)) (* 48 s3-4))) - (the-as vector (+ (the-as uint (-> s5-2 dir0 color)) (* 48 s3-4))) - f30-1 - ) - (vector4-lerp! - (the-as vector (+ (the-as uint (-> s5-2 dir0 levels)) (* 48 s3-4))) - (the-as vector (+ (the-as uint (-> s4-6 0 dir0 levels)) (* 48 s3-4))) - (the-as vector (+ (the-as uint (-> s5-2 dir0 levels)) (* 48 s3-4))) - f30-1 - ) - (vector-normalize! - (the-as vector (+ (the-as uint (-> s5-2 dir0)) (* 48 s3-4))) - 1.0 - ) - ) + (vector-normalize! (-> arg0 current-shadow) 1.0) ) - ) - - ;; some shadow thing. - (let ((a2-30 (new 'stack-no-clear 'vector))) - (set! (-> a2-30 x) (- (-> s5-2 dir0 direction x))) - (set! (-> a2-30 y) (- (-> s5-2 dir0 direction y))) - (set! (-> a2-30 z) (- (-> s5-2 dir0 direction z))) - (when (< (-> s5-2 dir0 direction y) 0.9063) - (let* ((f0-56 0.4226) - (f1-17 (-> a2-30 x)) - (f1-19 (* f1-17 f1-17)) - (f2-7 (-> a2-30 z)) - (f0-57 (/ f0-56 (sqrtf (+ f1-19 (* f2-7 f2-7))))) - ) - (set! (-> a2-30 x) (* (-> a2-30 x) f0-57)) - (set! (-> a2-30 y) -0.9063) - (set! (-> a2-30 z) (* (-> a2-30 z) f0-57)) - ) - ) - (vector4-lerp! (-> arg0 current-shadow) (-> arg0 current-shadow) a2-30 f30-1) - ) - (vector-normalize! (-> arg0 current-shadow) 1.0) ) - ) - + (reset! *palette-fade-controls*) 0 (none) diff --git a/goal_src/engine/gfx/vis/bsp-h.gc b/goal_src/engine/gfx/vis/bsp-h.gc index 6455c77871..d01e411815 100644 --- a/goal_src/engine/gfx/vis/bsp-h.gc +++ b/goal_src/engine/gfx/vis/bsp-h.gc @@ -115,7 +115,21 @@ (format #t "~Tdrawable-trees: ~A~%" (-> obj drawable-trees)) (format #t "~Tpat: #x~X~%" (-> obj pat)) (format #t "~Tpat-length: ~D~%" (-> obj pat-length)) - (inspect-bsp-tree obj (the-as bsp-node (-> obj nodes))) + ;; putting this stuff here for debugging! + (format #t "~Ttexture-remap-table-len: ~D~%" (-> obj texture-remap-table-len)) + (dotimes (i (-> obj texture-remap-table-len)) + (let* ((tex-id-array (the (pointer texture-id) (&-> obj texture-remap-table i))) + (tex-id-from (-> tex-id-array 0)) + (tex-id-to (-> tex-id-array 1)) + ) + (format #t "~T~Ttex-remap[~D]: # --> #~%" + i + (-> tex-id-from page) (-> tex-id-from index) + (-> tex-id-to page) (-> tex-id-to index) + ) + ) + ) + ;;(inspect-bsp-tree obj (the-as bsp-node (-> obj nodes))) obj ) diff --git a/goal_src/engine/gfx/vis/bsp.gc b/goal_src/engine/gfx/vis/bsp.gc index 3568cee6f2..bb7fc7038f 100644 --- a/goal_src/engine/gfx/vis/bsp.gc +++ b/goal_src/engine/gfx/vis/bsp.gc @@ -609,19 +609,19 @@ (let ((bsp-hdr (-> *level* log-in-level-bsp))) (when bsp-hdr (let* ((table-size (-> bsp-hdr texture-remap-table-len)) ;; in 64-bit entries - (table-data-start (-> bsp-hdr texture-remap-table)) - (table-data-ptr table-data-start) + (table-data-ptr (-> bsp-hdr texture-remap-table)) + (table-data-start table-data-ptr) (mask1 (the-as uint #xfffffff8)) ;; mask for table entry addresses (masked-tex-id (logand (the-as uint #xffffff00) tex-id)) ;; bits of tex-id we care about - (table-data-end (&+ table-data-ptr (* table-size 8))) + (table-data-end (&+ table-data-start (* table-size 8))) ) ;; top of binary search (label cfg-2) ;; if we didn't find anything, quit - (b! (= table-data-start table-data-end) cfg-8) + (b! (= table-data-ptr table-data-end) cfg-8) ;; find the middle entry. - (let ((midpoint (logand (/ (+ (the-as int table-data-start) (the-as int table-data-end)) 2) + (let ((midpoint (logand (/ (+ (the-as int table-data-ptr) (the-as int table-data-end)) 2) mask1 ) ) @@ -641,7 +641,7 @@ (label cfg-6) (b! #t cfg-2 :delay - (set! table-data-start (the-as (pointer uint64) (+ (the-as int midpoint) 8))) + (set! table-data-ptr (the-as (pointer uint64) (+ (the-as int midpoint) 8))) ) ;; exact match diff --git a/goal_src/engine/gfx/water/water-h.gc b/goal_src/engine/gfx/water/water-h.gc index d07ce9e2e1..638494a32d 100644 --- a/goal_src/engine/gfx/water/water-h.gc +++ b/goal_src/engine/gfx/water/water-h.gc @@ -5,59 +5,47 @@ ;; name in dgo: water-h ;; dgos: GAME, ENGINE -(define-extern *water-anim-sunken-dark-eco-qbert-sg* skeleton-group) -(define-extern *water-anim-sunken-dark-eco-platform-room-sg* skeleton-group) -(define-extern *water-anim-sunken-dark-eco-helix-room-sg* skeleton-group) -(define-extern *water-anim-sunken-big-room-sg* skeleton-group) -(define-extern *water-anim-sunken-first-room-from-entrance-sg* skeleton-group) -(define-extern *water-anim-sunken-qbert-room-sg* skeleton-group) -(define-extern *water-anim-sunken-first-right-branch-sg* skeleton-group) -(define-extern *water-anim-sunken-circular-with-bullys-sg* skeleton-group) -(define-extern *water-anim-sunken-hall-with-one-whirlpool-sg* skeleton-group) -(define-extern *water-anim-sunken-hall-with-three-whirlpools-sg* skeleton-group) -(define-extern *water-anim-sunken-start-of-helix-slide-sg* skeleton-group) -(define-extern *water-anim-sunken-room-above-exit-chamber-sg* skeleton-group) -(define-extern *water-anim-sunken-hall-before-big-room-sg* skeleton-group) -(define-extern *water-anim-sunken-short-piece-sg* skeleton-group) -(define-extern *water-anim-sunken-big-room-upper-water-sg* skeleton-group) -(define-extern *water-anim-maincave-center-pool-sg* skeleton-group) -(define-extern *water-anim-maincave-lower-right-pool-sg* skeleton-group) -(define-extern *water-anim-maincave-mid-right-pool-sg* skeleton-group) -(define-extern *water-anim-maincave-lower-left-pool-sg* skeleton-group) -(define-extern *water-anim-maincave-mid-left-pool-sg* skeleton-group) -(define-extern *water-anim-maincave-water-with-crystal-sg* skeleton-group) -(define-extern *water-anim-robocave-main-pool-sg* skeleton-group) -(define-extern *water-anim-misty-mud-by-arena-sg* skeleton-group) -(define-extern *water-anim-misty-mud-above-skeleton-sg* skeleton-group) -(define-extern *water-anim-misty-mud-behind-skeleton-sg* skeleton-group) -(define-extern *water-anim-misty-mud-above-skull-back-sg* skeleton-group) -(define-extern *water-anim-misty-mud-above-skull-front-sg* skeleton-group) -(define-extern *water-anim-misty-mud-other-near-skull-sg* skeleton-group) -(define-extern *water-anim-misty-mud-near-skull-sg* skeleton-group) -(define-extern *water-anim-misty-mud-under-spine-sg* skeleton-group) -(define-extern *water-anim-misty-mud-by-dock-sg* skeleton-group) -(define-extern *water-anim-misty-mud-island-near-dock-sg* skeleton-group) -(define-extern *water-anim-misty-mud-lonely-island-sg* skeleton-group) -(define-extern *water-anim-misty-dark-eco-pool-sg* skeleton-group) -(define-extern *water-anim-ogre-lava-sg* skeleton-group) -(define-extern *water-anim-jungle-river-sg* skeleton-group) -(define-extern *water-anim-village3-lava-sg* skeleton-group) -(define-extern *water-anim-training-lake-sg* skeleton-group) -(define-extern *water-anim-darkcave-water-with-crystal-sg* skeleton-group) -(define-extern *water-anim-rolling-water-back-sg* skeleton-group) -(define-extern *water-anim-rolling-water-front-sg* skeleton-group) -(define-extern *water-anim-finalboss-dark-eco-pool-sg* skeleton-group) -(define-extern *water-anim-lavatube-energy-lava-sg* skeleton-group) -(define-extern *water-anim-village1-rice-paddy-sg* skeleton-group) -(define-extern *water-anim-village1-fountain-sg* skeleton-group) -(define-extern *water-anim-village1-rice-paddy-mid-sg* skeleton-group) -(define-extern *water-anim-village1-rice-paddy-top-sg* skeleton-group) -(define-extern *water-anim-village2-bucket-sg* skeleton-group) +(defenum water-flags + :bitfield #t + :type uint32 + (wt00) + (wt01) + (wt02) + (wt03) + (wt04) + (wt05) + (wt06) + (wt07) + (wt08) + (wt09) + (wt10) + (wt11) + (wt12) + (wt13) + (wt14) + (wt15) + (wt16) + (wt17) + (wt18) + (wt19) + (wt20) + (wt21) + (wt22) + (wt23) + (wt24) + (wt25) + (wt26) + (wt27) + (wt28) + (wt29) + (wt30) + (wt31) + ) ;; DECOMP BEGINS (deftype water-control (basic) - ((flags uint32 :offset-assert 4) + ((flags water-flags :offset-assert 4) (process process-drawable :offset-assert 8) (joint-index int32 :offset-assert 12) (top-y-offset float :offset-assert 16) @@ -110,7 +98,7 @@ (defmethod display-water-marks? water-control ((obj water-control)) - (and *display-water-marks* (logtest? (-> obj flags) 1)) + (and *display-water-marks* (logtest? (-> obj flags) (water-flags wt00))) ) (defmethod new water-control ((allocation symbol) (type-to-make type) (arg0 process) (arg1 int) (arg2 float) (arg3 float) (arg4 float)) @@ -133,13 +121,13 @@ ) (deftype water-vol (process-drawable) - ((water-height meters :offset-assert 176) - (wade-height meters :offset-assert 180) - (swim-height meters :offset-assert 184) - (bottom-height meters :offset-assert 188) - (attack-event symbol :offset-assert 192) - (target handle :offset-assert 200) - (flags uint32 :offset-assert 208) + ((water-height meters :offset-assert 176) + (wade-height meters :offset-assert 180) + (swim-height meters :offset-assert 184) + (bottom-height meters :offset-assert 188) + (attack-event symbol :offset-assert 192) + (target handle :offset-assert 200) + (flags water-flags :offset-assert 208) ) :heap-base #x70 :method-count-assert 30 @@ -151,11 +139,11 @@ (TODO-RENAME-22 (_type_) none 22) (reset-root! (_type_) none 23) (set-stack-size! (_type_) none 24) - (TODO-RENAME-25 (_type_) object 25) + (TODO-RENAME-25 (_type_) none 25) (TODO-RENAME-26 (_type_) none 26) (dummy-27 (_type_) none 27) (get-ripple-height (_type_ vector) float 28) - (TODO-RENAME-29 (_type_) uint 29) + (TODO-RENAME-29 (_type_) none 29) ) ) diff --git a/goal_src/engine/gfx/water/water.gc b/goal_src/engine/gfx/water/water.gc index 362de5170f..d77d7998d0 100644 --- a/goal_src/engine/gfx/water/water.gc +++ b/goal_src/engine/gfx/water/water.gc @@ -8,8 +8,7 @@ ;; DECOMP BEGINS (defpart 108 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 360.0) 1.0) @@ -28,8 +27,7 @@ ) (defpart 109 - :init-specs - ((sp-flt spt-fade-a -0.2)) + :init-specs ((sp-flt spt-fade-a -0.2)) ) (defun birth-func-y->userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) @@ -49,15 +47,8 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! s5-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 (the-as symbol s5-0)) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 108) - s5-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (sound-play "water-drop" :position (the-as symbol s5-0)) + (launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 108) s5-0) ) ) 0 @@ -79,8 +70,7 @@ ) (defpart 110 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.05) (meters 0.1) 1.0) @@ -104,8 +94,7 @@ ) (defpart 111 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-flt spt-y (meters 0.15)) @@ -129,8 +118,7 @@ ) (defpart 112 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) @@ -152,18 +140,15 @@ ) (defpart 113 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 114)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 114)) ) (defpart 114 - :init-specs - ((sp-flt spt-fade-a -0.7111111)) + :init-specs ((sp-flt spt-fade-a -0.7111111)) ) (defpart 115 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-rnd-flt spt-num 0.04 0.03 1.0) (sp-rnd-flt spt-x (meters -0.2) (meters 0.4) 1.0) (sp-rnd-flt spt-z (meters -0.2) (meters 0.4) 1.0) @@ -185,8 +170,7 @@ ) (defpart 116 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.006666667)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.006666667)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a 0.0) (sp-int spt-next-time 150) @@ -195,13 +179,11 @@ ) (defpart 117 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.005)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.32)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.005)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.32)) ) (defpart 118 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-x (meters 10)) (sp-rnd-flt spt-scale-x (meters 0.75) (meters 1.5) 1.0) @@ -225,18 +207,15 @@ ) (defpart 119 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 90 119 1) (sp-launcher-by-id spt-next-launcher 120)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 90 119 1) (sp-launcher-by-id spt-next-launcher 120)) ) (defpart 120 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) (defpart 121 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-rnd-flt spt-num 0.05 0.4 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-z (meters 0.5) (meters 1.5) 1.0) @@ -259,13 +238,11 @@ ) (defpart 122 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 123)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 123)) ) (defpart 123 - :init-specs - ((sp-flt spt-fade-a -0.7111111)) + :init-specs ((sp-flt spt-fade-a -0.7111111)) ) (defpartgroup group-part-water-splash @@ -273,8 +250,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 124 :flags (is-3d) :period 900 :length 63) + :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) (sp-item 125 :period 900 :length 15) (sp-item 126 :flags (is-3d) :period 900 :length 15) (sp-item 127 :flags (is-3d) :period 900 :length 15) @@ -312,8 +288,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 124 :flags (is-3d) :period 900 :length 63) + :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) (sp-item 125 :period 900 :length 15) (sp-item 126 :flags (is-3d) :period 900 :length 15) (sp-item 127 :flags (is-3d) :period 900 :length 15) @@ -333,8 +308,7 @@ ) (defpart 129 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.2) (meters 0.4) 1.0) (sp-rnd-flt spt-y (meters -0.2) (meters 0.4) 1.0) @@ -355,8 +329,7 @@ ) (defpart 133 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.2) (meters 0.4) 1.0) (sp-rnd-flt spt-y (meters -0.2) (meters 0.4) 1.0) @@ -377,8 +350,7 @@ ) (defpart 131 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.3) (sp-rnd-flt spt-scale-x (meters 0.080000006) (meters 0.32000002) 1.0) (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 360.0) 1.0) @@ -398,8 +370,7 @@ ) (defpart 132 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 3.2) (sp-rnd-flt spt-x (meters -0.2) (meters 0.4) 1.0) (sp-rnd-flt spt-y (meters -0.2) (meters 0.4) 1.0) @@ -425,8 +396,7 @@ ) (defpart 130 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x10 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x10 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.24000001) (meters 0.71999997) 1.0) (sp-flt spt-rot-x 16384.0) @@ -446,16 +416,14 @@ ) (defpart 136 - :init-specs - ((sp-flt spt-scalevel-y (meters 0.026666667)) + :init-specs ((sp-flt spt-scalevel-y (meters 0.026666667)) (sp-int spt-next-time 20) (sp-launcher-by-id spt-next-launcher 137) ) ) (defpart 137 - :init-specs - ((sp-flt spt-scalevel-y (meters 0)) + :init-specs ((sp-flt spt-scalevel-y (meters 0)) (sp-flt spt-fade-a -0.64) (sp-int spt-next-time 20) (sp-launcher-by-id spt-next-launcher 138) @@ -463,8 +431,7 @@ ) (defpart 138 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.0016666667)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.0016666667)) (sp-flt spt-scalevel-y (meters -0.026666667)) (sp-int spt-next-time 20) (sp-launcher-by-id spt-next-launcher 139) @@ -472,13 +439,11 @@ ) (defpart 139 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.0033333334)) (sp-flt spt-scalevel-y (meters -0.053333335))) + :init-specs ((sp-flt spt-scalevel-x (meters 0.0033333334)) (sp-flt spt-scalevel-y (meters -0.053333335))) ) (defpart 126 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2.4) (meters 1.6) 1.0) (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 360.0) 1.0) @@ -498,18 +463,15 @@ ) (defpart 134 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 140)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 140)) ) (defpart 140 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) (defpart 127 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.4) (meters 0.8) 1.0) @@ -531,8 +493,7 @@ ) (defpart 128 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 3.2) (sp-flt spt-x (meters 0.96000004)) (sp-rnd-flt spt-scale-x (meters 0.35) (meters 0.075) 1.0) @@ -557,13 +518,11 @@ ) (defpart 135 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4)) ) (defpart 125 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-x (meters 0.8)) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.05) 1.0) @@ -586,8 +545,7 @@ ) (defpart 124 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x10 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x10 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters 0.96000004) (meters 0.16000001) 1.0) (sp-rnd-flt spt-scale-x (meters 0.32000002) (meters 0.96000004) 1.0) @@ -612,8 +570,7 @@ ) (defpart 141 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-flt spt-rotvel-x (degrees 0.16666667)) (sp-flt spt-scalevel-y (meters 0.016666668)) (sp-int spt-next-time 20) @@ -622,8 +579,7 @@ ) (defpart 142 - :init-specs - ((sp-flt spt-rotvel-x (degrees 0.13333334)) + :init-specs ((sp-flt spt-rotvel-x (degrees 0.13333334)) (sp-flt spt-scalevel-y (meters 0)) (sp-flt spt-fade-a -0.64) (sp-int spt-next-time 20) @@ -632,8 +588,7 @@ ) (defpart 143 - :init-specs - ((sp-flt spt-rotvel-x (degrees 0.1)) + :init-specs ((sp-flt spt-rotvel-x (degrees 0.1)) (sp-flt spt-scalevel-y (meters -0.016666668)) (sp-int spt-next-time 20) (sp-launcher-by-id spt-next-launcher 144) @@ -641,13 +596,11 @@ ) (defpart 144 - :init-specs - ((sp-flt spt-rotvel-x (degrees 0.06666667)) (sp-flt spt-scalevel-y (meters -0.033333335))) + :init-specs ((sp-flt spt-rotvel-x (degrees 0.06666667)) (sp-flt spt-scalevel-y (meters -0.033333335))) ) (defpart 145 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.05) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -679,11 +632,13 @@ (with-pp (let ((s5-0 (-> obj flags))) (cond - ((zero? (logand (-> obj flags) 2)) - (set! (-> obj flags) (logand -97793 (-> obj flags))) + ((zero? (logand (-> obj flags) (water-flags wt01))) + (logclear! (-> obj flags) (water-flags wt09 wt10 wt11 wt12 wt13 wt14 wt16)) ) - ((and (logtest? #x200000 (-> obj flags)) (logtest? (-> obj process state-flags) 256)) - (set! (-> obj flags) (logior #x10000 (-> obj flags))) + ((and (logtest? (water-flags wt21) (-> obj flags)) + (logtest? (-> obj process state-flags) (state-flags grabbed)) + ) + (set! (-> obj flags) (logior (water-flags wt16) (-> obj flags))) ) ((begin (set! (-> obj top 1 quad) (-> obj top 0 quad)) @@ -691,28 +646,27 @@ (+! (-> obj top 0 y) (-> obj top-y-offset)) (set! (-> obj bottom 1 quad) (-> obj bottom 0 quad)) (set! (-> obj bottom 0 quad) (-> obj process root trans quad)) - (set! (-> obj flags) (logand -31745 (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt10 wt11 wt12 wt13 wt14)) (set! (-> obj bob-offset) (update! (-> obj bob))) (cond - ((and (logtest? (-> obj flags) 256) - (zero? - (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) - (collide-action ca-9) - ) - ) + ((and (logtest? (-> obj flags) (water-flags wt08)) + (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) + (collide-action ca-9) + ) + ) ) (set! (-> obj real-ocean-offset) (- (ocean-get-height (the-as vector (-> obj bottom))) (-> obj base-height))) - (if (zero? (logand (-> obj flags) 512)) + (if (zero? (logand (-> obj flags) (water-flags wt09))) (set! (-> obj ocean-offset) (-> obj real-ocean-offset)) (set! (-> obj ocean-offset) (lerp (-> obj ocean-offset) (-> obj real-ocean-offset) 0.2)) ) ) - ((logtest? #x100000 (-> obj flags)) + ((logtest? (water-flags wt20) (-> obj flags)) (let* ((a0-26 (-> obj volume process 0)) (f30-0 (ripple-find-height (the-as process-drawable a0-26) 0 (the-as vector (-> obj bottom)))) ) (set! (-> obj real-ocean-offset) (- f30-0 (-> obj base-height))) - (if (zero? (logand (-> obj flags) 512)) + (if (zero? (logand (-> obj flags) (water-flags wt09))) (set! (-> obj ocean-offset) (-> obj real-ocean-offset)) (set! (-> obj ocean-offset) (lerp (-> obj ocean-offset) (-> obj real-ocean-offset) 0.2)) ) @@ -739,13 +693,13 @@ (set! (-> obj swim-depth) (fmax 0.0 (- (- (-> obj surface-height) (-> obj swim-height)) (-> obj bottom 0 y)))) (>= (-> obj height) (-> obj bottom 0 y)) ) - (if (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 1024) + (if (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags on-water)) (set! (-> obj on-water-time) (-> *display* base-frame-counter)) ) (set! (-> obj drip-wetness) 1.0) (set! (-> obj drip-height) (fmax (- (-> obj surface-height) (-> obj bottom 0 y)) (-> obj drip-height))) (set! (-> obj drip-speed) 15.0) - (if (zero? (logand (-> obj flags) 512)) + (if (zero? (logand (-> obj flags) (water-flags wt09))) (TODO-RENAME-15 obj) ) (cond @@ -756,8 +710,8 @@ (set! (-> s4-0 y) (-> obj surface-height)) (when (and (logtest? (-> obj process draw status) (draw-status was-drawn)) (zero? (-> obj process draw cur-lod)) - (logtest? #x400000 (-> obj flags)) - (logtest? #x800000 (-> obj flags)) + (logtest? (water-flags wt22) (-> obj flags)) + (logtest? (water-flags wt23) (-> obj flags)) ) (let ((f30-1 (y-angle (-> obj process root))) (f28-0 (vector-xz-length (-> obj process root transv))) @@ -767,42 +721,14 @@ (set! (-> *part-id-table* 118 init-specs 1 initial-valuef) (* 0.0000036621095 f28-0)) (set! (-> *part-id-table* 118 init-specs 2 initial-valuef) (* 0.1 f28-0)) (set! (-> *part-id-table* 118 init-specs 13 initial-valuef) 0.7111111) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 118) - s4-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 118) s4-0) (set! (-> *part-id-table* 121 init-specs 1 initial-valuef) (* 0.000004150391 f28-0)) (set! (-> *part-id-table* 121 init-specs 18 initial-valuef) f30-1) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 121) - s4-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 121) s4-0) (when (< f28-0 4096.0) (set! (-> *part-id-table* 112 init-specs 4 random-rangef) (-> obj ripple-size)) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 112) - s4-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 115) - s4-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 112) s4-0) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 115) s4-0) ) ) ) @@ -812,10 +738,10 @@ ) ) (else - (logior! (-> obj flags) 8192) + (logior! (-> obj flags) (water-flags wt13)) ) ) - (when (and (logtest? (-> obj flags) 32) (logtest? #x800000 (-> obj flags))) + (when (and (logtest? (-> obj flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> obj flags))) (let* ((v1-124 (rand-vu-int-range 3 (+ (-> obj process node-list length) -1))) (s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data v1-124))) ) @@ -825,23 +751,9 @@ (* 0.00012207031 (vector-xz-length (-> obj process root transv))) ) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 110) - s4-1 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 110) s4-1) (set! (-> *part-id-table* 111 init-specs 16 initial-valuef) (-> obj surface-height)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 111) - s4-1 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 111) s4-1) ) ) (let ((f30-3 (- (+ (-> obj base-height) (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)) @@ -860,22 +772,25 @@ ) ) ) - (if (and (logtest? (-> obj flags) 16) - (and s4-3 (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) 1024))) + (if (and (logtest? (-> obj flags) (water-flags wt04)) + (and s4-3 + (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags on-water)) + ) + ) ) (set! (-> obj bob amp) (* 0.8 (-> obj bob amp))) ) (cond - ((and (logtest? (-> obj flags) 8) - (or (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 1024) + ((and (logtest? (-> obj flags) (water-flags wt03)) + (or (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags on-water)) (>= f30-3 (-> obj bottom 0 y)) - (and (logtest? s5-0 2048) - (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 4) - (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) 1)) + (and (logtest? s5-0 (water-flags wt11)) + (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags tsurf)) + (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags onsurf))) (>= (+ 204.8 f30-3) (-> obj bottom 0 y)) ) ) - (or (logtest? s5-0 2048) + (or (logtest? s5-0 (water-flags wt11)) (< 12288.0 (vector-xz-length (-> obj process root transv))) (< (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> obj enter-water-time)) (>= (+ (- 204.8 (fmin 6144.0 (+ (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)))) f30-3) @@ -885,39 +800,39 @@ ) (set! (-> obj swim-time) (-> *display* base-frame-counter)) (send-event (-> obj process) 'swim) - (logior! (-> obj flags) 2048) - (if (zero? (logand s5-0 2048)) + (logior! (-> obj flags) (water-flags wt11)) + (if (zero? (logand s5-0 (water-flags wt11))) (set! (-> obj enter-swim-time) (-> *display* base-frame-counter)) ) (cond - ((and (logtest? (-> obj flags) 16) - (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 4) - (zero? (logand #x10000 (-> obj flags))) + ((and (logtest? (-> obj flags) (water-flags wt04)) + (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags tsurf)) + (zero? (logand (water-flags wt16) (-> obj flags))) ) (let ((v1-200 (new 'stack-no-clear 'vector))) (set! (-> v1-200 quad) (-> obj bottom 0 quad)) (set! (-> v1-200 y) (- (-> obj height) (-> obj swim-height))) (let ((s4-4 (-> obj process root))) - (when (and (zero? (logand (-> (the-as collide-shape-moving s4-4) status) 4096)) - (logtest? (-> obj flags) 2048) + (when (and (zero? (logand (-> (the-as collide-shape-moving s4-4) status) (cshape-moving-flags csmf12))) + (logtest? (-> obj flags) (water-flags wt11)) (zero? (logand (-> (the-as collide-shape-moving s4-4) root-prim prim-core action) (collide-action ca-9))) ) (let ((a1-27 (vector-! (new 'stack-no-clear 'vector) v1-200 (-> s4-4 trans)))) (vector-float*! a1-27 a1-27 (-> *display* frames-per-second)) (integrate-and-collide! (the-as collide-shape-moving s4-4) a1-27) ) - (logior! (-> (the-as collide-shape-moving s4-4) status) 1031) + (logior! (-> (the-as collide-shape-moving s4-4) status) (cshape-moving-flags onsurf onground tsurf on-water)) ) ) ) ) - ((and (< (-> obj bottom 0 y) f30-3) (zero? (logand #x10000 (-> obj flags)))) - (logior! (-> obj flags) 4096) + ((and (< (-> obj bottom 0 y) f30-3) (zero? (logand (water-flags wt16) (-> obj flags)))) + (logior! (-> obj flags) (water-flags wt12)) ) ) ) ((begin - (set! s4-3 (and (logtest? (-> obj flags) 4) + (set! s4-3 (and (logtest? (-> obj flags) (water-flags wt02)) (or (not (!= (-> obj bob amp) 0.0)) (>= (- (-> *display* base-frame-counter) (-> obj swim-time)) (seconds 0.05)) ) @@ -928,15 +843,15 @@ ) (set! (-> obj wade-time) (-> *display* base-frame-counter)) (send-event (-> obj process) 'wade) - (logior! (-> obj flags) 1024) + (logior! (-> obj flags) (water-flags wt10)) ) ) ) - (when (and (logtest? (-> obj flags) 8) + (when (and (logtest? (-> obj flags) (water-flags wt03)) (< (-> obj bottom 1 y) f30-3) - (and (< f30-3 (-> obj bottom 0 y)) (logtest? s5-0 4096)) + (and (< f30-3 (-> obj bottom 0 y)) (logtest? s5-0 (water-flags wt12))) ) - (logior! (-> obj flags) 2048) + (logior! (-> obj flags) (water-flags wt11)) (let ((a1-30 (new 'stack-no-clear 'vector))) (set! (-> a1-30 quad) (-> obj bottom 0 quad)) (let ((s5-1 (-> obj process root))) @@ -944,7 +859,7 @@ (when (zero? (logand (-> (the-as collide-shape-moving s5-1) root-prim prim-core action) (collide-action ca-9))) (let ((f30-4 (-> (the-as collide-shape-moving s5-1) ground-impact-vel))) (move-to-ground-point! (the-as collide-shape-moving s5-1) a1-30 (-> s5-1 transv) *up-vector*) - (logior! (-> (the-as collide-shape-moving s5-1) status) 1024) + (logior! (-> (the-as collide-shape-moving s5-1) status) (cshape-moving-flags on-water)) (set! (-> (the-as collide-shape-moving s5-1) ground-impact-vel) f30-4) ) ) @@ -952,33 +867,28 @@ ) ) ) - (when (and (logtest? #x20000 (-> obj flags)) (= (-> obj process type) target)) - (when (and (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 1025) + (when (and (logtest? (water-flags wt17) (-> obj flags)) (= (-> obj process type) target)) + (when (and (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) + (cshape-moving-flags onsurf on-water) + ) (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) (collide-action ca-9) ) ) ) (when (< (-> obj process root trans y) -409.6) - (send-event (-> obj process) 'no-look-around 450) + (send-event (-> obj process) 'no-look-around (seconds 1.5)) (when (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) (collide-action ca-14) ) ) (cond ((= (-> obj process type) target) - (let ((a1-32 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-32 from) pp) - (set! (-> a1-32 num-params) 2) - (set! (-> a1-32 message) 'attack) - (set! (-> a1-32 param 0) (the-as uint #f)) - (let ((v1-275 (new 'static 'attack-info :mask #xe0))) - (set! (-> v1-275 shove-up) 2048.0) - (set! (-> v1-275 shove-back) 0.0) - (set! (-> v1-275 mode) 'tar) - (set! (-> a1-32 param 1) (the-as uint v1-275)) - ) - (send-event-function (-> obj process) a1-32) + (send-event + (-> obj process) + 'attack + #f + (static-attack-info ((shove-up (meters 0.5)) (shove-back (meters 0)) (mode 'tar))) ) ) (else @@ -1008,17 +918,19 @@ ) ) (else - (if (logtest? (-> obj flags) 512) + (if (logtest? (-> obj flags) (water-flags wt09)) (TODO-RENAME-16 obj) ) ) ) ) - (when (not - (or (zero? (logand (-> obj flags) 64)) (zero? (logand #x800000 (-> obj flags))) (= (-> obj drip-wetness) 0.0)) - ) + (when (not (or (zero? (logand (-> obj flags) (water-flags wt06))) + (zero? (logand (water-flags wt23) (-> obj flags))) + (= (-> obj drip-wetness) 0.0) + ) + ) (cond - ((logtest? (-> obj flags) #x8000) + ((logtest? (-> obj flags) (water-flags wt15)) (let ((a2-15 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data (-> obj drip-joint-index))) ) @@ -1029,18 +941,11 @@ (set! (-> *part-id-table* 145 init-specs 8 initial-valuef) (* 0.05 (- (-> a2-15 x) (-> obj drip-old-pos x)))) (set! (-> *part-id-table* 145 init-specs 9 initial-valuef) (* 0.05 (- (-> a2-15 y) (-> obj drip-old-pos y)))) (set! (-> *part-id-table* 145 init-specs 10 initial-valuef) (* 0.05 (- (-> a2-15 z) (-> obj drip-old-pos z)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 145) - a2-15 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 145) a2-15) ) (set! (-> obj drip-time) (-> *display* base-frame-counter)) - (set! (-> obj flags) (logand -32769 (-> obj flags))) - (set! (-> obj drip-wetness) (seek (-> obj drip-wetness) 0.0 (* 0.001 (-> obj drip-speed)))) + (logclear! (-> obj flags) (water-flags wt15)) + (seek! (-> obj drip-wetness) 0.0 (* 0.001 (-> obj drip-speed))) (set! (-> obj drip-speed) (* 1.05 (-> obj drip-speed))) (if (= (-> obj drip-wetness) 0.0) (set! (-> obj drip-height) 0.0) @@ -1059,7 +964,7 @@ ) (set! (-> obj drip-joint-index) s5-2) (set! (-> obj drip-old-pos quad) (-> v1-328 quad)) - (logior! (-> obj flags) #x8000) + (logior! (-> obj flags) (water-flags wt15)) ) ) ) @@ -1169,11 +1074,11 @@ (defmethod TODO-RENAME-15 water-control ((obj water-control)) (with-pp - (logior! (-> obj flags) 512) - (set! (-> obj flags) (logand -65537 (-> obj flags))) + (logior! (-> obj flags) (water-flags wt09)) + (logclear! (-> obj flags) (water-flags wt16)) (set! (-> obj enter-water-time) (-> *display* base-frame-counter)) (set-vector! (-> obj enter-water-pos) (-> obj bottom 0 x) (-> obj surface-height) (-> obj bottom 0 z) 1.0) - (when (and (logtest? (-> obj flags) 32) (logtest? #x800000 (-> obj flags))) + (when (and (logtest? (-> obj flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> obj flags))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) pp) (set! (-> a1-1 num-params) 1) @@ -1189,7 +1094,7 @@ ) ) ) - (if (logtest? #x20000 (-> obj flags)) + (if (logtest? (water-flags wt17) (-> obj flags)) (set! (-> obj swim-height) 2867.2) ) 0 @@ -1198,9 +1103,9 @@ ) (defmethod TODO-RENAME-16 water-control ((obj water-control)) - (set! (-> obj flags) (logand -513 (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt09)) (set-zero! (-> obj bob)) - (if (logtest? #x20000 (-> obj flags)) + (if (logtest? (water-flags wt17) (-> obj flags)) (set! (-> obj swim-height) 2867.2) ) 0 @@ -1208,33 +1113,26 @@ ) (defun splash-spawn ((arg0 basic) (arg1 basic) (arg2 int)) - (let ((s4-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker s4-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) + (process-spawn + part-tracker + :init part-tracker-init + (if (zero? arg2) + (-> *part-group-id-table* 41) + (-> *part-group-id-table* 40) ) - (run-now-in-process - s4-0 - part-tracker-init - (if (zero? arg2) - (-> *part-group-id-table* 41) - (-> *part-group-id-table* 40) - ) - -1 - part-water-splash-callback - arg0 - #f - arg1 - ) - (-> s4-0 ppointer) - ) + -1 + part-water-splash-callback + arg0 + #f + arg1 + :to *entity-pool* ) 0 (none) ) (defmethod dummy-13 water-control ((obj water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector)) - (when (and (logtest? (-> obj flags) 32) (logtest? #x800000 (-> obj flags))) + (when (and (logtest? (-> obj flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> obj flags))) (let ((a1-3 (vector+float*! (new 'stack-no-clear 'vector) arg1 arg3 0.05))) (set! (-> a1-3 y) (-> obj surface-height)) (splash-spawn (the-as basic arg0) (the-as basic a1-3) arg2) @@ -1247,7 +1145,7 @@ (defmethod dummy-27 water-vol ((obj water-vol)) (when (handle->process (-> obj target)) (let ((v1-7 (-> (the-as target (-> obj target process 0)) water))) - (set! (-> v1-7 flags) (logand -129892623 (-> v1-7 flags))) + (logclear! (-> v1-7 flags) (water-flags wt01 wt02 wt03 wt08 wt17 wt18 wt19 wt20 wt21 wt23 wt24 wt25 wt26)) (set! (-> v1-7 volume) (the-as handle #f)) ) (set! (-> obj target) (the-as handle #f)) @@ -1268,56 +1166,34 @@ ) (defmethod TODO-RENAME-26 water-vol ((obj water-vol)) - (with-pp - (cond - ((handle->process (-> obj target)) - (cond - ((not (dummy-10 (-> obj vol) (-> (the-as target (-> obj target process 0)) control trans))) - (dummy-27 obj) - ) - (else - (let ((v1-15 (-> (the-as target (-> obj target process 0)) water))) - (when (and (logtest? #x80000 (-> obj flags)) - (logtest? (-> v1-15 flags) 512) - (>= (-> v1-15 surface-height) (-> v1-15 bottom 0 y)) - ) - (let ((v1-18 (-> obj attack-event))) - (case v1-18 - ((#f) - ) - (('heat) - (send-event (handle->process (-> obj target)) 'heat (* 10.0 (-> *display* seconds-per-frame))) - ) - (('drown-death 'lava 'dark-eco-pool) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) pp) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'attack-invinc) - (set! (-> a1-8 param 0) (the-as uint #f)) - (let ((a0-19 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-19 mode) v1-18) - (set! (-> a1-8 param 1) (the-as uint a0-19)) - ) - (if (send-event-function (handle->process (-> obj target)) a1-8) - (send-event obj 'notify 'attack) - ) + (cond + ((handle->process (-> obj target)) + (cond + ((not (dummy-10 (-> obj vol) (-> (the-as target (-> obj target process 0)) control trans))) + (dummy-27 obj) + ) + (else + (let ((v1-15 (-> (the-as target (-> obj target process 0)) water))) + (when (and (logtest? (water-flags wt19) (-> obj flags)) + (logtest? (-> v1-15 flags) (water-flags wt09)) + (>= (-> v1-15 surface-height) (-> v1-15 bottom 0 y)) ) - ) - (else - (let ((a1-10 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-10 from) pp) - (set! (-> a1-10 num-params) 2) - (set! (-> a1-10 message) 'attack) - (set! (-> a1-10 param 0) (the-as uint #f)) - (let ((a0-27 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-27 mode) v1-18) - (set! (-> a1-10 param 1) (the-as uint a0-27)) - ) - (if (send-event-function (handle->process (-> obj target)) a1-10) - (send-event obj 'notify 'attack) - ) + (let ((v1-18 (-> obj attack-event))) + (case v1-18 + ((#f) + ) + (('heat) + (send-event (handle->process (-> obj target)) 'heat (* 10.0 (-> *display* seconds-per-frame))) + ) + (('drown-death 'lava 'dark-eco-pool) + (if (send-event (handle->process (-> obj target)) 'attack-invinc #f (static-attack-info ((mode v1-18)))) + (send-event obj 'notify 'attack) + ) + ) + (else + (if (send-event (handle->process (-> obj target)) 'attack #f (static-attack-info ((mode v1-18)))) + (send-event obj 'notify 'attack) ) - ) ) ) ) @@ -1325,39 +1201,38 @@ ) ) ) - ((and *target* - (and (not (handle->process (-> *target* water volume))) (dummy-10 (-> obj vol) (-> *target* control trans))) - ) - (let ((s5-0 (-> *target* water))) - (process-entity-status! obj (entity-perm-status bit-3) #t) - (set! (-> s5-0 volume) (process->handle obj)) - (set! (-> obj target) (process->handle *target*)) - (logior! (-> s5-0 flags) 2) - (set! (-> s5-0 base-height) (-> obj water-height)) - (set! (-> s5-0 ocean-offset) 0.0) - (logior! (-> s5-0 flags) (-> obj flags)) - (if (< 0.0 (-> obj wade-height)) - (set! (-> s5-0 wade-height) (-> obj wade-height)) - ) - (if (< 0.0 (-> obj swim-height)) - (set! (-> s5-0 swim-height) (-> obj swim-height)) - ) - (if (< 0.0 (-> obj bottom-height)) - (set! (-> s5-0 bottom-height) (-> obj bottom-height)) - ) - (set-zero! (-> s5-0 bob)) - ) + ) + ((and *target* + (and (not (handle->process (-> *target* water volume))) (dummy-10 (-> obj vol) (-> *target* control trans))) + ) + (let ((s5-0 (-> *target* water))) + (process-entity-status! obj (entity-perm-status bit-3) #t) + (set! (-> s5-0 volume) (process->handle obj)) + (set! (-> obj target) (process->handle *target*)) + (logior! (-> s5-0 flags) (water-flags wt01)) + (set! (-> s5-0 base-height) (-> obj water-height)) + (set! (-> s5-0 ocean-offset) 0.0) + (logior! (-> s5-0 flags) (-> obj flags)) + (if (< 0.0 (-> obj wade-height)) + (set! (-> s5-0 wade-height) (-> obj wade-height)) + ) + (if (< 0.0 (-> obj swim-height)) + (set! (-> s5-0 swim-height) (-> obj swim-height)) + ) + (if (< 0.0 (-> obj bottom-height)) + (set! (-> s5-0 bottom-height) (-> obj bottom-height)) + ) + (set-zero! (-> s5-0 bob)) ) - ) - 0 - (none) + ) ) + 0 + (none) ) (defstate water-vol-startup (water-vol) :virtual #t - :code - (behavior () + :code (behavior () (go-virtual water-vol-idle) (none) ) @@ -1365,8 +1240,7 @@ (defstate water-vol-idle (water-vol) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'update) (TODO-RENAME-26 self) @@ -1374,18 +1248,15 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (dummy-27 self) (none) ) - :trans - (behavior () + :trans (behavior () (TODO-RENAME-26 self) (none) ) - :code - (the-as (function none :behavior water-vol) anim-loop) + :code (the-as (function none :behavior water-vol) anim-loop) ) (defmethod set-stack-size! water-vol ((obj water-vol)) @@ -1399,10 +1270,10 @@ ) (defmethod TODO-RENAME-25 water-vol ((obj water-vol)) - (the-as object 0) + 0 + (none) ) -;; WARN: disable def twice: 85. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod TODO-RENAME-29 water-vol ((obj water-vol)) (local-vars (sv-16 res-tag)) (set! (-> obj attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) @@ -1416,7 +1287,7 @@ ) ) ) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (logclear! (-> obj mask) (process-mask actor-pause)) (set! (-> obj vol) (new 'process 'vol-control obj)) (logior! (-> obj vol flags) 3) @@ -1440,30 +1311,27 @@ (set! (-> obj wade-height) (-> v1-8 1)) (set! (-> obj swim-height) (-> v1-8 2)) (if (>= (-> sv-16 elt-count) (the-as uint 4)) - (set! (-> obj flags) (the-as uint (the int (-> v1-8 3)))) + (set! (-> obj flags) (the-as water-flags (the int (-> v1-8 3)))) ) (if (>= (-> sv-16 elt-count) (the-as uint 5)) (set! (-> obj bottom-height) (-> v1-8 4)) ) ) ) - (set! (-> obj flags) (logior #x800000 (-> obj flags))) + (set! (-> obj flags) (logior (water-flags wt23) (-> obj flags))) (cond ((zero? (-> obj flags)) (if (< 0.0 (-> obj wade-height)) - (logior! (-> obj flags) 4) + (logior! (-> obj flags) (water-flags wt02)) ) - (when (< 0.0 (-> obj swim-height)) - (let ((v0-4 (logior (-> obj flags) 8))) - (set! (-> obj flags) v0-4) - v0-4 + (if (< 0.0 (-> obj swim-height)) + (logior! (-> obj flags) (water-flags wt03)) ) - ) ) (else - (the-as uint #f) ) ) + (none) ) (defmethod TODO-RENAME-22 water-vol ((obj water-vol)) @@ -1471,7 +1339,7 @@ (none) ) -(defbehavior water-vol-init-by-other water-vol ((arg0 entity)) +(defbehavior water-vol-init-by-other water-vol ((arg0 entity-actor)) (set! (-> self entity) arg0) (set-stack-size! self) (reset-root! self) diff --git a/goal_src/engine/gfx/wind-h.gc b/goal_src/engine/gfx/wind-h.gc index 51ad5d39e8..aa66bbc04b 100644 --- a/goal_src/engine/gfx/wind-h.gc +++ b/goal_src/engine/gfx/wind-h.gc @@ -5,7 +5,8 @@ ;; name in dgo: wind-h ;; dgos: GAME, ENGINE -;; These "wind" types are used in the tie/shrub renderers. +;; These "wind" types are used in the tie/shrub renderers to make things sway in the breeze. +;; It generates vectors that are applied as shear to the instance matrices. (deftype wind-vector (structure) ((wind-pos vector2w :inline :offset-assert 0) diff --git a/goal_src/engine/gfx/wind.gc b/goal_src/engine/gfx/wind.gc index 0ee8bfc63c..bf9be4d966 100644 --- a/goal_src/engine/gfx/wind.gc +++ b/goal_src/engine/gfx/wind.gc @@ -4,6 +4,7 @@ ;; name: wind.gc ;; name in dgo: wind ;; dgos: GAME, ENGINE +;; note: modified for high fps ;; definition for symbol *wind-work*, type wind-work (define *wind-work* (new 'global 'wind-work)) @@ -19,11 +20,11 @@ (set! (-> arg0 wind-normal z) (sin f30-1)) ) (set! (-> arg0 wind-time) (+ (-> arg0 wind-time) 1)) - (let* ((s4-0 (logand (-> arg0 wind-time) 63)) + (let* ((s4-0 (logand (the int (* (-> *display* time-adjust-ratio) (-> arg0 wind-time))) 63)) ;; changed for high fps (f0-4 (rand-vu-float-range 0.0 100.0)) - (v1-5 (/ (-> arg0 wind-time) (the-as uint 120))) + (v1-5 (/ (* (-> *display* time-adjust-ratio) (-> arg0 wind-time)) (the-as uint 120))) ;; changed for high fps (f1-6 (* 0.008333334 - (the float (mod (-> arg0 wind-time) (the-as uint 120))) + (the float (mod (the uint (* (-> *display* time-adjust-ratio) (-> arg0 wind-time))) (the-as uint 120))) ;; changed for high fps ) ) (f2-4 (* 0.0625 @@ -44,8 +45,8 @@ ) ) ) - (set! (-> *wind-work* wind-force s4-0) f0-5) - (vector-float*! (-> *wind-work* wind-array s4-0) (-> arg0 wind-normal) f0-5) + (set! (-> *wind-work* wind-force s4-0) (* (-> *display* time-adjust-ratio) f0-5)) ;; changed for high fps + (vector-float*! (-> *wind-work* wind-array s4-0) (-> arg0 wind-normal) (* (-> *display* time-adjust-ratio) f0-5)) ;; changed for high fps ) 0 (none) diff --git a/goal_src/engine/level/level-h.gc b/goal_src/engine/level/level-h.gc index 6abbf035bf..834bcca88b 100644 --- a/goal_src/engine/level/level-h.gc +++ b/goal_src/engine/level/level-h.gc @@ -55,7 +55,7 @@ ;; compressed visibility string for a given bsp leaf. ;; Each level may have multiple level-vis-infos. -;; One level-vis-info (the first) is always for the +;; One level-vis-info (the first) is always for the ;; actual level (stored in .VIS file), and there is typically one for each neighboring level. ;; The final level-vis-info (7) should always be empty (set to 0 in the bsp-header) @@ -112,13 +112,13 @@ (priority int32 :offset-assert 64) ;; either 100 or 200 (load-commands pair :offset-assert 68) ;; ?? (alt-load-commands pair :offset-assert 72) ;; ?? - (bsp-mask uint64 :offset-assert 80) ;; ?? + (bsp-mask uint64 :offset-assert 80) ;; ?? unused (bsphere sphere :offset-assert 88) ;; boundings sphere of level? (buzzer int32 :offset-assert 92) ;; which task is the scout fly? (bottom-height meters :offset-assert 96) (run-packages pair :offset-assert 100) ;; possibly unused? - (prev-level basic :offset-assert 104) - (next-level basic :offset-assert 108) + (prev-level basic :offset-assert 104) ;; unused + (next-level basic :offset-assert 108) ;; unused (wait-for-load symbol :offset-assert 112) ) :method-count-assert 9 @@ -140,51 +140,67 @@ ) ;; The actual "level". This manages loading and running a game level. +;; These are allocated by the engine and aren't in static level data. (deftype level (basic) - ((name symbol :offset-assert 4) - (load-name symbol :offset-assert 8) - (nickname symbol :offset-assert 12) - (index int32 :offset-assert 16) - (status symbol :offset-assert 20) - (other level :offset-assert 24) ;; the other level object - (heap kheap :inline :offset-assert 32) ;; level's ~10 MB heap - (bsp bsp-header :offset-assert 48) ;; the main level object in the DGO - (art-group load-dir-art-group :offset-assert 52) ;; the art (foreground models/anims) for the level - (info level-load-info :offset-assert 56) - (texture-page texture-page 9 :offset-assert 60) - (loaded-texture-page texture-page 16 :offset-assert 96) - (loaded-texture-page-count int32 :offset-assert 160) - ; (foreground-sink-group-0 dma-foreground-sink-group :inline :offset-assert 176) - ; (foreground-sink-group-1 dma-foreground-sink-group :inline :offset-assert 208) - ; (foreground-sink-group-2 dma-foreground-sink-group :inline :offset-assert 240) - ; (array-pad uint8 12) - (foreground-sink-group dma-foreground-sink-group 3 :inline :offset-assert 176) ;; inline basic + ((name symbol :offset-assert 4) + (load-name symbol :offset-assert 8) + (nickname symbol :offset-assert 12) + (index int32 :offset-assert 16) + (status symbol :offset-assert 20) + (other level :offset-assert 24) ;; the other level object + (heap kheap :inline :offset-assert 32) ;; level's ~10 MB heap + (bsp bsp-header :offset-assert 48) ;; the main level object in the DGO + (art-group load-dir-art-group :offset-assert 52) ;; the art (foreground models/anims) for the level + (info level-load-info :offset-assert 56) ;; the load-info for this level, + (texture-page texture-page 9 :offset-assert 60) ;; logged-in texture pages (tfrag, pris, shrub, alpha, water) + (loaded-texture-page texture-page 16 :offset-assert 96) ;; texture pages that are loaded (and will need unloading) + (loaded-texture-page-count int32 :offset-assert 160) + + ;; dma "sinks" for foreground level things to render to (plus water and generic tie) + (tfrag-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 176) + (pris-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 208) + (water-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 240) + (foreground-sink-group dma-foreground-sink-group 3 :inline :offset 176) ;; overlay of previous 3. + + ;; engines for each of the three sinks (foreground-draw-engine engine 3 :offset-assert 272) + + ;; linked entities/ambients (entity entity-links-array :offset-assert 284) - (ambient entity-ambient-data-array :offset-assert 288) + (ambient entity-ambient-data-array :offset-assert 288) + + ;; closest objects, used for texture upload decisions. indexed by tpage (only first 5 used) (closest-object float 9 :offset-assert 292) + + ;; texture upload size, bytes. indexed by tpage (only first 5 used) (upload-size int32 9 :offset-assert 328) - (level-distance meters :offset-assert 364) - (inside-sphere? symbol :offset-assert 368) - (inside-boxes? symbol :offset-assert 372) - (display? symbol :offset-assert 376) - (meta-inside? symbol :offset-assert 380) - (mood mood-context :offset-assert 384) - (mood-func (function mood-context float int none) :offset-assert 388) - (vis-bits pointer :offset-assert 392) - (all-visible? symbol :offset-assert 396) - (force-all-visible? symbol :offset-assert 400) - (linking basic :offset-assert 404) - (vis-info level-vis-info 8 :offset-assert 408) ;; note: #f when doesn't exist. - (vis-self-index int32 :offset-assert 440) - (vis-adj-index int32 :offset-assert 444) - (vis-buffer uint8 2048 :offset-assert 448) - (mem-usage-block memory-usage-block :offset-assert 2496) - (mem-usage int32 :offset-assert 2500) - (code-memory-start pointer :offset-assert 2504) - (code-memory-end pointer :offset-assert 2508) - (texture-mask uint32 9 :offset-assert 2512) - (force-inside? symbol :offset-assert 2548) + + ;; info about jak/camera position, relative to the level + (level-distance meters :offset-assert 364) ;; camera distance from level bsphere origin + (inside-sphere? symbol :offset-assert 368) ;; camera inside bsphere? + (inside-boxes? symbol :offset-assert 372) ;; inside the level box list? + (display? symbol :offset-assert 376) ;; level being displayed? + (meta-inside? symbol :offset-assert 380) ;; inside, but stays true until you go inside another level. + + ;; mood + (mood mood-context :offset-assert 384) ;; current state + (mood-func (function mood-context float int none) :offset-assert 388) ;; function to call to update mood + + ;; vis + (vis-bits pointer :offset-assert 392) ;; visibility string buffer + (all-visible? symbol :offset-assert 396) ;; set if visibility system has no info + (force-all-visible? symbol :offset-assert 400) ;; set to disable visibiltiy system and display all + (linking basic :offset-assert 404) ;; is linking in progress? + (vis-info level-vis-info 8 :offset-assert 408) ;; note: #f when doesn't exist. + (vis-self-index int32 :offset-assert 440) ;; vis-info index for this level + (vis-adj-index int32 :offset-assert 444) ;; vis-info index for the other level + (vis-buffer uint8 2048 :offset-assert 448) ;; buffer for vis decompression + (mem-usage-block memory-usage-block :offset-assert 2496) ;; level data memory usage stats + (mem-usage int32 :offset-assert 2500) ;; total use + (code-memory-start pointer :offset-assert 2504) ;; address of start of code + (code-memory-end pointer :offset-assert 2508) ;; address of end of code + (texture-mask uint32 9 :offset-assert 2512) ;; mask of textures we need, per tpage. + (force-inside? symbol :offset-assert 2548) ;; fake being inside? (pad uint8 56) ) :method-count-assert 29 @@ -203,7 +219,7 @@ (load-begin (_type_) _type_ 18) (login-begin (_type_) _type_ 19) (vis-load (_type_) uint 20) - (dummy-21 (_type_) none 21) + (unused-21 (_type_) none 21) (birth (_type_) _type_ 22) (level-status-set! (_type_ symbol) _type_ 23) (load-required-packages (_type_) _type_ 24) @@ -217,7 +233,7 @@ ;; Main *level* object. ;; There are actually three levels. level0 and level1 correspond to the actual buffered levels -;; The level-default seems to be a fake level that can possibly be used by renderers that +;; The level-default is to be a fake level that can possibly be used by renderers that ;; don't belong to any level, for example to render Jak. (deftype level-group (basic) ((length int32 :offset-assert 4) @@ -270,6 +286,7 @@ (defun-extern level-update-after-load level login-state level) ;; Initialize the level structure. This assigns DMA buckets to each level. +;; there are 3 foreground sinks per texture bucket: merc, generic, and an unused one. ;; TODO: figure out exactly which buckets are used for what. (define-extern *level* level-group) (if (zero? *level*) @@ -287,39 +304,38 @@ (new 'static 'level :name #f :status 'inactive - :foreground-sink-group - (new 'static 'inline-array dma-foreground-sink-group 3 - (new 'static 'dma-foreground-sink-group - :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink :bucket 10) - (new 'static 'generic-dma-foreground-sink - :bucket 11 :foreground-output-bucket 1 - ) - ) + :tfrag-tex-foreground-sink-group + (new 'static 'dma-foreground-sink-group + :sink + (new 'static 'array dma-foreground-sink 3 + ;; merc + tfrag texture + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-tfrag-tex0)) + ;; generic + tfrag texture + (new 'static 'generic-dma-foreground-sink :bucket (bucket-id generic-tfrag-tex0) :foreground-output-bucket 1) ) - (new 'static 'dma-foreground-sink-group - :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket 49 - :foreground-texture-page 1 - ) - (new 'static 'generic-dma-foreground-sink - :bucket 50 :foreground-texture-page 1 - :foreground-output-bucket 1) - ) + ) + :pris-tex-foreground-sink-group + (new 'static 'dma-foreground-sink-group + :sink + (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-pris0) :foreground-texture-page 1) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-pris0) + :foreground-texture-page 1 + :foreground-output-bucket 1 + ) ) - (new 'static 'dma-foreground-sink-group - :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket 58 - :foreground-texture-page 2 - ) - (new 'static 'generic-dma-foreground-sink - :bucket 59 - :foreground-texture-page 2 - :foreground-output-bucket 1 - ) - ) + ) + :water-tex-foreground-sink-group + (new 'static 'dma-foreground-sink-group + :sink + (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-water0) :foreground-texture-page 2) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-water0) + :foreground-texture-page 2 + :foreground-output-bucket 1 + ) ) ) :inside-sphere? #f @@ -331,53 +347,48 @@ :name #f :index 1 :status 'inactive - :foreground-sink-group - (new 'static 'inline-array dma-foreground-sink-group 3 - (new 'static 'dma-foreground-sink-group - :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket 17 - :foreground-texture-level 1 - ) - (new 'static 'generic-dma-foreground-sink - :bucket 18 - :foreground-texture-level 1 - :foreground-output-bucket 1 - ) - ) - ) - (new 'static 'dma-foreground-sink-group - :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket 52 - :foreground-texture-page 1 - :foreground-texture-level 1 - ) - (new 'static 'generic-dma-foreground-sink - :bucket 53 - :foreground-texture-page 1 - :foreground-texture-level 1 - :foreground-output-bucket 1 - ) - - ) - ) - (new 'static 'dma-foreground-sink-group - :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket 61 - :foreground-texture-page 2 - :foreground-texture-level 1 - ) - (new 'static 'generic-dma-foreground-sink - :bucket 62 - :foreground-texture-page 2 - :foreground-texture-level 1 - :foreground-output-bucket 1 - ) - ) + :tfrag-tex-foreground-sink-group + (new 'static 'dma-foreground-sink-group + :sink + (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-tfrag-tex1) :foreground-texture-level 1) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-tfrag-tex1) + :foreground-texture-level 1 + :foreground-output-bucket 1 + ) ) ) + :pris-tex-foreground-sink-group + (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink + :bucket (bucket-id merc-pris1) + :foreground-texture-page 1 + :foreground-texture-level 1 + ) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-pris1) + :foreground-texture-page 1 + :foreground-texture-level 1 + :foreground-output-bucket 1 + ) + ) + ) + :water-tex-foreground-sink-group + (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink + :bucket (bucket-id merc-water1) + :foreground-texture-page 2 + :foreground-texture-level 1 + ) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-water1) + :foreground-texture-page 2 + :foreground-texture-level 1 + :foreground-output-bucket 1 + ) + ) + ) :inside-sphere? #f :inside-boxes? #f :force-inside? #f @@ -387,53 +398,51 @@ :name 'default :index 2 :status 'reserved - :foreground-sink-group - (new 'static 'inline-array dma-foreground-sink-group 3 - (new 'static 'dma-foreground-sink-group - :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket 45 - :foreground-texture-level 2 - ) - (new 'static 'generic-dma-foreground-sink - :bucket 46 - :foreground-texture-level 2 - :foreground-output-bucket 1 - ) - ) - ) - (new 'static 'dma-foreground-sink-group - :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket 55 - :foreground-texture-page 1 - :foreground-texture-level 2 - ) - (new 'static 'generic-dma-foreground-sink - :bucket 56 - :foreground-texture-page 1 - :foreground-texture-level 2 - :foreground-output-bucket 1 - ) - ) - ) - (new 'static 'dma-foreground-sink-group - :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket 58 - :foreground-texture-page 2 - :foreground-texture-level 2 - ) - (new 'static 'generic-dma-foreground-sink - :bucket 59 - :foreground-texture-page 2 - :foreground-texture-level 2 - :foreground-output-bucket 1 - ) - - ) + :tfrag-tex-foreground-sink-group + ;; the tfrag texture sink group for the common level uses alpha + (new 'static 'dma-foreground-sink-group + :sink + (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-alpha-tex) :foreground-texture-level 2) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-alpha-tex) + :foreground-texture-level 2 + :foreground-output-bucket 1 + ) ) ) + :pris-tex-foreground-sink-group + ;; pris uses the separate pris common area + (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink + :bucket (bucket-id merc-pris-common) + :foreground-texture-page 1 + :foreground-texture-level 2 + ) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-pris-common) + :foreground-texture-page 1 + :foreground-texture-level 2 + :foreground-output-bucket 1 + ) + ) + ) + :water-tex-foreground-sink-group + ;; water just goes to level 0's buckets + (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink + :bucket (bucket-id merc-water0) + :foreground-texture-page 2 + :foreground-texture-level 2 + ) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-water0) + :foreground-texture-page 2 + :foreground-texture-level 2 + :foreground-output-bucket 1 + ) + ) + ) :inside-sphere? #f :inside-boxes? #f :force-inside? #f @@ -442,5 +451,8 @@ ) ) + + + (define-extern *level-load-list* pair) (define-extern lookup-level-info (function symbol level-load-info)) \ No newline at end of file diff --git a/goal_src/engine/level/level-info.gc b/goal_src/engine/level/level-info.gc index 2fea2e14d0..5864764e72 100644 --- a/goal_src/engine/level/level-info.gc +++ b/goal_src/engine/level/level-info.gc @@ -5,2058 +5,2011 @@ ;; name in dgo: level-info ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (define training - (new 'static 'level-load-info - :name 'training - :visname 'training-vis - :nickname 'tra - :index 1 - :packages '(training) - :sound-banks '(training) - :music-bank 'village1 - :ambient-sounds '() - :mood '*training-mood* - :mood-func 'update-mood-training - :ocean '*ocean-map-village1* - :sky #t - :sun-fade 1.0 - :continues - '( - (new 'static 'continue-point - :name "training-start" - :level 'training - :trans (new 'static 'vector :x -5393626.5 :y 28072.346 :z 4332472.5 :w 1.0) - :quat (new 'static 'quaternion :y 0.9995 :w 0.0297) - :camera-trans (new 'static 'vector :x -5426915.0 :y 45930.906 :z 4353156.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.5571 0.0 -0.8304 0.1264 0.9883 -0.0848 0.8207 -0.1522 -0.5506) - :load-commands '((special "med-res-level-1" #t) - (special "med-res-level-2" #t) - (special "med-res-level-4" #t) - (special "med-res-level-6" #t) - (special "med-res-level-7" #t) - (special "med-res-level-8" #t) - (special "med-res-level-9" #t) - (special "med-res-level-14" #t) - (special "med-res-level-22" #t) - (special "med-res-level-23" #t) - ) - :vis-nick 'tra - :lev0 'training - :disp0 'display - :lev1 'village1 - :disp1 'special - ) - (new 'static 'continue-point - :name "training-warp" - :level 'training - :flags #x4 - :trans (new 'static 'vector :x -5383524.0 :y 28019.098 :z 4360302.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.084 :w 0.9964) - :camera-trans - (new 'static 'vector :x -5366765.0 :y 45646.234 :z 4325889.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.9057 0.0 0.4238 -0.0666 0.9875 0.1424 -0.4186 -0.1572 0.8944) - :load-commands '((special "med-res-level-1" #t) - (special "med-res-level-2" #t) - (special "med-res-level-4" #t) - (special "med-res-level-6" #t) - (special "med-res-level-7" #t) - (special "med-res-level-8" #t) - (special "med-res-level-9" #t) - (special "med-res-level-14" #t) - (special "med-res-level-22" #t) - (special "med-res-level-23" #t) - ) - :vis-nick 'tra - :lev0 'training - :disp0 'display - :lev1 'village1 - :disp1 'special - ) - (new 'static 'continue-point - :name "game-start" - :level 'training - :flags #x404 - :trans (new 'static 'vector :x -5393740.5 :y 28259.533 :z 4360945.5 :w 1.0) - :quat (new 'static 'quaternion :y 0.9993 :w 0.0359) - :camera-trans (new 'static 'vector :x -5434444.5 :y 47050.344 :z 4372832.5 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.3536 0.0 -0.9353 0.1315 0.99 -0.0497 0.926 -0.1406 -0.35) - :load-commands - '((special "med-res-level-1" #t) - (special "med-res-level-2" #t) - (special "med-res-level-4" #t) - (special "med-res-level-6" #t) - (special "med-res-level-7" #t) - (special "med-res-level-8" #t) - (special "med-res-level-9" #t) - (special "med-res-level-14" #t) - (special "med-res-level-22" #t) - (special "med-res-level-23" #t) - ) - :vis-nick 'tra - :lev0 'training - :disp0 'display - :lev1 'village1 - :disp1 'special - ) - ) - :tasks '((the binteger 92) (the binteger 93) (the binteger 94) (the binteger 95)) - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x -5079040.0 :z 4055040.0 :w 1024000.0) - :buzzer 95 - :bottom-height (meters -114.0) - :run-packages '("common" "villagep") - :wait-for-load #f - ) + (new 'static 'level-load-info + :index 1 + :name 'training + :visname 'training-vis + :nickname 'tra + :packages '(training) + :sound-banks '(training) + :music-bank 'village1 + :ambient-sounds '() + :mood '*training-mood* + :mood-func 'update-mood-training + :ocean '*ocean-map-village1* + :sky #t + :sun-fade 1.0 + :continues '((new 'static 'continue-point + :name "training-start" + :level 'training + :trans (new 'static 'vector :x -5393626.5 :y 28072.346 :z 4332472.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.9995 :w 0.0297) + :camera-trans (new 'static 'vector :x -5426915.0 :y 45930.906 :z 4353156.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.5571 0.0 -0.8304 0.1264 0.9883 -0.0848 0.8207 -0.1522 -0.5506) + :load-commands '((special "med-res-level-1" #t) + (special "med-res-level-2" #t) + (special "med-res-level-4" #t) + (special "med-res-level-6" #t) + (special "med-res-level-7" #t) + (special "med-res-level-8" #t) + (special "med-res-level-9" #t) + (special "med-res-level-14" #t) + (special "med-res-level-22" #t) + (special "med-res-level-23" #t) + ) + :vis-nick 'tra + :lev0 'training + :disp0 'display + :lev1 'village1 + :disp1 'special + ) + (new 'static 'continue-point + :name "training-warp" + :level 'training + :flags (continue-flags warp) + :trans (new 'static 'vector :x -5383524.0 :y 28019.098 :z 4360302.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.084 :w 0.9964) + :camera-trans (new 'static 'vector :x -5366765.0 :y 45646.234 :z 4325889.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9057 0.0 0.4238 -0.0666 0.9875 0.1424 -0.4186 -0.1572 0.8944) + :load-commands '((special "med-res-level-1" #t) + (special "med-res-level-2" #t) + (special "med-res-level-4" #t) + (special "med-res-level-6" #t) + (special "med-res-level-7" #t) + (special "med-res-level-8" #t) + (special "med-res-level-9" #t) + (special "med-res-level-14" #t) + (special "med-res-level-22" #t) + (special "med-res-level-23" #t) + ) + :vis-nick 'tra + :lev0 'training + :disp0 'display + :lev1 'village1 + :disp1 'special + ) + (new 'static 'continue-point + :name "game-start" + :level 'training + :flags (continue-flags warp game-start) + :trans (new 'static 'vector :x -5393740.5 :y 28259.533 :z 4360945.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.9993 :w 0.0359) + :camera-trans (new 'static 'vector :x -5434444.5 :y 47050.344 :z 4372832.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.3536 0.0 -0.9353 0.1315 0.99 -0.0497 0.926 -0.1406 -0.35) + :load-commands '((special "med-res-level-1" #t) + (special "med-res-level-2" #t) + (special "med-res-level-4" #t) + (special "med-res-level-6" #t) + (special "med-res-level-7" #t) + (special "med-res-level-8" #t) + (special "med-res-level-9" #t) + (special "med-res-level-14" #t) + (special "med-res-level-22" #t) + (special "med-res-level-23" #t) + ) + :vis-nick 'tra + :lev0 'training + :disp0 'display + :lev1 'village1 + :disp1 'special + ) + ) + :tasks '(92 93 94 95) + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x -5079040.0 :z 4055040.0 :w 1024000.0) + :buzzer 95 + :bottom-height (meters -114) + :run-packages '("common" "villagep") + :wait-for-load #f + ) ) -;; definition for symbol village1, type level-load-info (define village1 (new 'static 'level-load-info - :name 'village1 - :visname 'village1-vis - :nickname 'vi1 - :index 2 - :packages '(village1) - :sound-banks '(village1) - :music-bank 'village1 - :ambient-sounds '() - :mood '*village1-mood* - :mood-func 'update-mood-village1 - :ocean '*ocean-map-village1* - :sky #t - :sun-fade 1.0 - :continues - '((new 'static 'continue-point - :name "village1-hut" - :level 'village1 - :trans (new 'static 'vector :x -638860.06 :y 139319.7 :z 769990.6 :w 1.0) - :quat (new 'static 'quaternion :y -0.9889 :w -0.148) - :camera-trans (new 'static 'vector :x -668114.1 :y 164536.31 :z 828633.06 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.8947 0.0 -0.4464 0.1082 0.9701 -0.2169 0.4331 -0.2424 -0.868) - :load-commands '() - :vis-nick 'vi1 - :lev0 'village1 - :disp0 'display - :lev1 'beach - :disp1 #f - ) - (new 'static 'continue-point - :name "village1-intro" - :level 'village1 - :flags #x24 - :trans (new 'static 'vector :x -518468.8 :y 189424.03 :z 868568.7 :w 1.0) - :quat (new 'static 'quaternion :y 0.591 :w 0.8066) - :camera-trans (new 'static 'vector :x -559109.3 :y 200461.92 :z 826073.06 :w 1.0) - :camera-rot (new 'static 'array float 9 0.7221 0.0 -0.6917 -0.0517 0.9972 -0.054 0.6897 0.0747 0.7201) - :load-commands '() - :vis-nick 'vi1 - :lev0 'village1 - :disp0 'display - :lev1 #f - :disp1 #f - ) - (new 'static 'continue-point - :name "village1-warp" - :level 'village1 - :flags #x804 - :trans (new 'static 'vector :x -518468.8 :y 189424.03 :z 868568.7 :w 1.0) - :quat (new 'static 'quaternion :y 0.591 :w 0.8066) - :camera-trans (new 'static 'vector :x -559109.3 :y 200461.92 :z 826073.06 :w 1.0) - :camera-rot (new 'static 'array float 9 0.7221 0.0 -0.6917 -0.0517 0.9972 -0.054 0.6897 0.0747 0.7201) - :load-commands '() - :vis-nick 'vi1 - :lev0 'village1 - :disp0 'display - :lev1 'beach - :disp1 #f - ) - (new 'static 'continue-point - :name "village1-demo-convo" - :level 'village1 - :flags #x40 - :trans (new 'static 'vector :x -542529.1 :y 189424.03 :z 847101.94 :w 1.0) - :quat (new 'static 'quaternion :y -0.1717 :w -0.9851) - :camera-trans (new 'static 'vector :x -559085.2 :y 202996.53 :z 826054.25 :w 1.0) - :camera-rot (new 'static 'array float 9 0.7868 0.0 -0.6171 0.0775 0.992 0.0989 0.6122 -0.1257 0.7806) - :load-commands '() - :vis-nick 'vi1 - :lev0 'village1 - :disp0 'display - :lev1 'misty - :disp1 #f - ) - (new 'static 'continue-point - :name "intro-start" - :level 'village1 - :flags #x10 - :trans (new 'static 'vector :x 164316.78 :y 15128.576 :z 3390588.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.2339 :w 0.9722) - :camera-trans (new 'static 'vector :x 204089.34 :y 36257.793 :z 3358341.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.6381 0.0 0.7699 -0.0938 0.9925 0.0777 -0.7642 -0.1218 0.6333) - :load-commands - '((special "med-res-level-1" #t) - (special "med-res-level-2" #t) - (special "med-res-level-4" #t) - (special "med-res-level-6" #t) - (special "med-res-level-7" #t) - (special "med-res-level-8" #t) - (special "med-res-level-9" #t) - (special "med-res-level-11" #t) - (special "med-res-level-14" #t) - (special "med-res-level-22" #t) - (special "med-res-level-23" #t) - (special "fishermans-boat-2" #t) + :index 2 + :name 'village1 + :visname 'village1-vis + :nickname 'vi1 + :packages '(village1) + :sound-banks '(village1) + :music-bank 'village1 + :ambient-sounds '() + :mood '*village1-mood* + :mood-func 'update-mood-village1 + :ocean '*ocean-map-village1* + :sky #t + :sun-fade 1.0 + :continues '((new 'static 'continue-point + :name "village1-hut" + :level 'village1 + :trans (new 'static 'vector :x -638860.06 :y 139319.7 :z 769990.6 :w 1.0) + :quat (new 'static 'quaternion :y -0.9889 :w -0.148) + :camera-trans (new 'static 'vector :x -668114.1 :y 164536.31 :z 828633.06 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.8947 0.0 -0.4464 0.1082 0.9701 -0.2169 0.4331 -0.2424 -0.868) + :load-commands '() + :vis-nick 'vi1 + :lev0 'village1 + :disp0 'display + :lev1 'beach + :disp1 #f + ) + (new 'static 'continue-point + :name "village1-intro" + :level 'village1 + :flags (continue-flags warp sage-intro) + :trans (new 'static 'vector :x -518468.8 :y 189424.03 :z 868568.7 :w 1.0) + :quat (new 'static 'quaternion :y 0.591 :w 0.8066) + :camera-trans (new 'static 'vector :x -559109.3 :y 200461.92 :z 826073.06 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7221 0.0 -0.6917 -0.0517 0.9972 -0.054 0.6897 0.0747 0.7201) + :load-commands '() + :vis-nick 'vi1 + :lev0 'village1 + :disp0 'display + :lev1 #f + :disp1 #f + ) + (new 'static 'continue-point + :name "village1-warp" + :level 'village1 + :flags (continue-flags warp sage-ecorocks) + :trans (new 'static 'vector :x -518468.8 :y 189424.03 :z 868568.7 :w 1.0) + :quat (new 'static 'quaternion :y 0.591 :w 0.8066) + :camera-trans (new 'static 'vector :x -559109.3 :y 200461.92 :z 826073.06 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7221 0.0 -0.6917 -0.0517 0.9972 -0.054 0.6897 0.0747 0.7201) + :load-commands '() + :vis-nick 'vi1 + :lev0 'village1 + :disp0 'display + :lev1 'beach + :disp1 #f + ) + (new 'static 'continue-point + :name "village1-demo-convo" + :level 'village1 + :flags (continue-flags sage-demo-convo) + :trans (new 'static 'vector :x -542529.1 :y 189424.03 :z 847101.94 :w 1.0) + :quat (new 'static 'quaternion :y -0.1717 :w -0.9851) + :camera-trans (new 'static 'vector :x -559085.2 :y 202996.53 :z 826054.25 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7868 0.0 -0.6171 0.0775 0.992 0.0989 0.6122 -0.1257 0.7806) + :load-commands '() + :vis-nick 'vi1 + :lev0 'village1 + :disp0 'display + :lev1 'misty + :disp1 #f + ) + (new 'static 'continue-point + :name "intro-start" + :level 'village1 + :flags (continue-flags intro) + :trans (new 'static 'vector :x 164316.78 :y 15128.576 :z 3390588.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.2339 :w 0.9722) + :camera-trans (new 'static 'vector :x 204089.34 :y 36257.793 :z 3358341.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.6381 0.0 0.7699 -0.0938 0.9925 0.0777 -0.7642 -0.1218 0.6333) + :load-commands '((special "med-res-level-1" #t) + (special "med-res-level-2" #t) + (special "med-res-level-4" #t) + (special "med-res-level-6" #t) + (special "med-res-level-7" #t) + (special "med-res-level-8" #t) + (special "med-res-level-9" #t) + (special "med-res-level-11" #t) + (special "med-res-level-14" #t) + (special "med-res-level-22" #t) + (special "med-res-level-23" #t) + (special "fishermans-boat-2" #t) + ) + :vis-nick 'vi1 + :lev0 'village1 + :disp0 'display + :lev1 'misty + :disp1 #f ) - :vis-nick 'vi1 - :lev0 'village1 - :disp0 'display - :lev1 'misty - :disp1 #f ) - ) - :tasks '((the binteger 10) (the binteger 11) (the binteger 12) (the binteger 13) (the binteger 14) (the binteger 75)) - :priority #xc8 - :load-commands '() - :alt-load-commands - '(((display village1) (load misty)) - ((special village1) (display misty)) ((display village1) (load beach)) - ) - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x -444416.0 :y 133120.0 :z 360448.0 :w 843776.0) - :buzzer 75 - :bottom-height (meters -20.0) - :run-packages '("common") - :wait-for-load #t - ) + :tasks '(10 11 12 13 14 75) + :priority #xc8 + :load-commands '() + :alt-load-commands '(((display village1) (load misty)) ((special village1) (display misty)) ((display village1) (load beach))) + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x -444416.0 :y 133120.0 :z 360448.0 :w 843776.0) + :buzzer 75 + :bottom-height (meters -20) + :run-packages '("common") + :wait-for-load #t + ) ) -;; definition for symbol beach, type level-load-info (define beach (new 'static 'level-load-info - :name 'beach - :visname 'beach-vis - :nickname 'bea - :index 3 - :packages '(beach) - :sound-banks '(beach) - :music-bank 'beach - :ambient-sounds '() - :mood '*beach-mood* - :mood-func 'update-mood-village1 - :ocean '*ocean-map-village1* - :sky #t - :sun-fade 1.0 - :continues - '((new 'static 'continue-point - :name "beach-start" - :level 'beach - :trans (new 'static 'vector :x -504960.22 :y 9477.325 :z -223513.81 :w 1.0) - :quat (new 'static 'quaternion :y 0.9486 :w -0.3163) - :camera-trans (new 'static 'vector :x -487550.16 :y 28354.15 :z -184211.05 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.9139 0.0 0.4058 -0.0551 0.9907 -0.1241 -0.4021 -0.1358 -0.9054) - :load-commands '() - :vis-nick 'bea - :lev0 'beach - :disp0 'display - :lev1 'village1 - :disp1 'display - ) - ) - :tasks '((the binteger 15) (the binteger 16) (the binteger 17) (the binteger 18) (the binteger 19) (the binteger 20) (the binteger 21) (the binteger 22)) - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x -819200.0 :z -1556480.0 :w 1474560.0) - :buzzer 20 - :bottom-height (meters -20.0) - :run-packages '("common") - :wait-for-load #t - ) + :index 3 + :name 'beach + :visname 'beach-vis + :nickname 'bea + :packages '(beach) + :sound-banks '(beach) + :music-bank 'beach + :ambient-sounds '() + :mood '*beach-mood* + :mood-func 'update-mood-village1 + :ocean '*ocean-map-village1* + :sky #t + :sun-fade 1.0 + :continues '((new 'static 'continue-point + :name "beach-start" + :level 'beach + :trans (new 'static 'vector :x -504960.22 :y 9477.325 :z -223513.81 :w 1.0) + :quat (new 'static 'quaternion :y 0.9486 :w -0.3163) + :camera-trans (new 'static 'vector :x -487550.16 :y 28354.15 :z -184211.05 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9139 0.0 0.4058 -0.0551 0.9907 -0.1241 -0.4021 -0.1358 -0.9054) + :load-commands '() + :vis-nick 'bea + :lev0 'beach + :disp0 'display + :lev1 'village1 + :disp1 'display + ) + ) + :tasks '(15 16 17 18 19 20 21 22) + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x -819200.0 :z -1556480.0 :w 1474560.0) + :buzzer 20 + :bottom-height (meters -20) + :run-packages '("common") + :wait-for-load #t + ) ) -;; definition for symbol jungle, type level-load-info (define jungle (new 'static 'level-load-info - :name 'jungle - :visname 'jungle-vis - :nickname 'jun - :index 4 - :packages '(jungle) - :sound-banks '(jungle) - :music-bank 'jungle - :ambient-sounds '() - :mood '*jungle-mood* - :mood-func 'update-mood-jungle - :ocean '*ocean-map-village1* - :sky #t - :sun-fade 1.0 - :continues - '((new 'static 'continue-point - :name "jungle-start" - :level 'jungle - :trans (new 'static 'vector :x 1057631.9 :y 86404.305 :z -647140.56 :w 1.0) - :quat (new 'static 'quaternion :y -0.9009 :w -0.4339) - :camera-trans (new 'static 'vector :x 1004424.8 :y 111181.82 :z -611527.9 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.5568 0.0 -0.8306 0.201 0.9702 -0.1347 0.8059 -0.2419 -0.5402) - :load-commands '() - :vis-nick 'jun - :lev0 'jungle - :disp0 'display - :lev1 'village1 - :disp1 'display - ) - ) - :tasks '((the binteger 2) (the binteger 3) (the binteger 4) (the binteger 5) (the binteger 7) (the binteger 8) (the binteger 9)) - :priority 100 - :load-commands '() - :alt-load-commands '(((display jungle) (display jungleb)) ((display jungle) (display village1))) - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x 1474560.0 :y 2519040.0 :z -983040.0 :w 2457600.0) - :buzzer 7 - :bottom-height (meters -20.0) - :run-packages '("common") - :wait-for-load #t - ) + :index 4 + :name 'jungle + :visname 'jungle-vis + :nickname 'jun + :packages '(jungle) + :sound-banks '(jungle) + :music-bank 'jungle + :ambient-sounds '() + :mood '*jungle-mood* + :mood-func 'update-mood-jungle + :ocean '*ocean-map-village1* + :sky #t + :sun-fade 1.0 + :continues '((new 'static 'continue-point + :name "jungle-start" + :level 'jungle + :trans (new 'static 'vector :x 1057631.9 :y 86404.305 :z -647140.56 :w 1.0) + :quat (new 'static 'quaternion :y -0.9009 :w -0.4339) + :camera-trans (new 'static 'vector :x 1004424.8 :y 111181.82 :z -611527.9 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.5568 0.0 -0.8306 0.201 0.9702 -0.1347 0.8059 -0.2419 -0.5402) + :load-commands '() + :vis-nick 'jun + :lev0 'jungle + :disp0 'display + :lev1 'village1 + :disp1 'display + ) + ) + :tasks '(2 3 4 5 7 8 9) + :priority 100 + :load-commands '() + :alt-load-commands '(((display jungle) (display jungleb)) ((display jungle) (display village1))) + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 1474560.0 :y 2519040.0 :z -983040.0 :w 2457600.0) + :buzzer 7 + :bottom-height (meters -20) + :run-packages '("common") + :wait-for-load #t + ) ) -;; definition for symbol jungleb, type level-load-info (define jungleb (new 'static 'level-load-info - :name 'jungleb - :visname 'jungleb-vis - :nickname 'jub - :index 5 - :packages '(jungleb) - :sound-banks '(jungleb) - :music-bank 'jungleb - :ambient-sounds '() - :mood '*jungleb-mood* - :mood-func 'update-mood-jungleb - :ocean 'none - :sky #f - :continues - '((new 'static 'continue-point - :name "jungle-tower" - :level 'jungleb - :trans (new 'static 'vector :x 1469510.0 :y -204745.52 :z -959058.3 :w 1.0) - :quat (new 'static 'quaternion :y -0.6194 :w -0.785) - :camera-trans (new 'static 'vector :x 1485298.5 :y -189972.08 :z -936548.75 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.8614 0.0 0.5078 -0.1177 0.9727 -0.1997 -0.4939 -0.2318 -0.8379) - :load-commands '() - :vis-nick 'jub - :lev0 'jungle - :disp0 'display - :lev1 'jungleb - :disp1 'display - ) - ) - :tasks '() - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsphere (new 'static 'sphere :x 1486848.0 :y -1269760.0 :z -1064960.0 :w 1228800.0) - :buzzer 7 - :bottom-height (meters -80.0) - :run-packages '("common" "jungle") - :wait-for-load #f - ) + :index 5 + :name 'jungleb + :visname 'jungleb-vis + :nickname 'jub + :packages '(jungleb) + :sound-banks '(jungleb) + :music-bank 'jungleb + :ambient-sounds '() + :mood '*jungleb-mood* + :mood-func 'update-mood-jungleb + :ocean 'none + :sky #f + :continues '((new 'static 'continue-point + :name "jungle-tower" + :level 'jungleb + :trans (new 'static 'vector :x 1469510.0 :y -204745.52 :z -959058.3 :w 1.0) + :quat (new 'static 'quaternion :y -0.6194 :w -0.785) + :camera-trans (new 'static 'vector :x 1485298.5 :y -189972.08 :z -936548.75 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.8614 0.0 0.5078 -0.1177 0.9727 -0.1997 -0.4939 -0.2318 -0.8379) + :load-commands '() + :vis-nick 'jub + :lev0 'jungle + :disp0 'display + :lev1 'jungleb + :disp1 'display + ) + ) + :tasks '() + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsphere (new 'static 'sphere :x 1486848.0 :y -1269760.0 :z -1064960.0 :w 1228800.0) + :buzzer 7 + :bottom-height (meters -80) + :run-packages '("common" "jungle") + :wait-for-load #f + ) ) -;; definition for symbol misty, type level-load-info (define misty - (new 'static 'level-load-info - :name 'misty - :visname 'misty-vis - :nickname 'mis - :index 6 - :packages '(misty) - :sound-banks '(misty) - :music-bank 'misty - :ambient-sounds '() - :mood '*misty-mood* - :mood-func 'update-mood-misty - :ocean '*ocean-map-village1* - :sky #t - :sun-fade 0.25 - :continues - '((new 'static 'continue-point - :name "misty-start" - :level 'misty - :trans (new 'static 'vector :x 164316.78 :y 15128.576 :z 3390588.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.2339 :w 0.9722) - :camera-trans (new 'static 'vector :x 204089.34 :y 36257.793 :z 3358341.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.6381 0.0 0.7699 -0.0938 0.9925 0.0777 -0.7642 -0.1218 0.6333) - :load-commands - '((special "med-res-level-1" #t) - (special "med-res-level-2" #t) - (special "med-res-level-4" #t) - (special "med-res-level-6" #t) - (special "med-res-level-7" #t) - (special "med-res-level-8" #t) - (special "med-res-level-9" #t) - (special "med-res-level-11" #t) - (special "med-res-level-14" #t) - (special "med-res-level-22" #t) - (special "med-res-level-23" #t) - (special "fishermans-boat-2" #t) - ) - :vis-nick 'mis - :lev0 'misty - :disp0 'display - :lev1 'village1 - :disp1 'special - ) - (new 'static 'continue-point - :name "misty-silo" - :level 'misty - :trans (new 'static 'vector :x -672503.0 :y 82131.35 :z 3651465.8 :w 1.0) - :quat (new 'static 'quaternion :y 0.0878 :w 0.9961) - :camera-trans (new 'static 'vector :x -675754.0 :y 102028.91 :z 3604800.8 :w 1.0) - :camera-rot (new 'static 'array float 9 0.9975 0.0 -0.0704 0.0086 0.9924 0.1223 0.0698 -0.1226 0.9899) - :load-commands - '((special "med-res-level-1" #t) - (special "med-res-level-2" #t) - (special "med-res-level-4" #t) - (special "med-res-level-6" #t) - (special "med-res-level-7" #t) - (special "med-res-level-8" #t) - (special "med-res-level-9" #t) - (special "med-res-level-11" #t) - (special "med-res-level-14" #t) - (special "med-res-level-22" #t) - (special "med-res-level-23" #t) - (special "fishermans-boat-2" #t) - ) - :vis-nick 'mis - :lev0 'misty - :disp0 'display - :lev1 'village1 - :disp1 'special - ) - (new 'static 'continue-point - :name "misty-bike" - :level 'misty - :trans (new 'static 'vector :x 302533.44 :y 35901.848 :z 4138967.8 :w 1.0) - :quat (new 'static 'quaternion :y -0.2809 :w 0.9597) - :camera-trans (new 'static 'vector :x 338476.25 :y 55700.684 :z 4109729.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.6308 0.0 0.7759 -0.096 0.9923 0.078 -0.7699 -0.1237 0.6259) - :load-commands - '((special "med-res-level-1" #t) - (special "med-res-level-2" #t) - (special "med-res-level-4" #t) - (special "med-res-level-6" #t) - (special "med-res-level-7" #t) - (special "med-res-level-8" #t) - (special "med-res-level-9" #t) - (special "med-res-level-11" #t) - (special "med-res-level-14" #t) - (special "med-res-level-22" #t) - (special "med-res-level-23" #t) - (special "fishermans-boat-2" #t) - ) - :vis-nick 'mis - :lev0 'misty - :disp0 'display - :lev1 'village1 - :disp1 'special - ) - (new 'static 'continue-point - :name "misty-backside" - :level 'misty - :trans (new 'static 'vector :x -304192.72 :y 33270.99 :z 4646525.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.8443 :w -0.5357) - :camera-trans (new 'static 'vector :x -346989.78 :y 54377.676 :z 4674685.5 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.5497 0.0 -0.8353 0.1009 0.9926 -0.0664 0.8291 -0.1208 -0.5457) - :load-commands - '((special "med-res-level-1" #t) - (special "med-res-level-2" #t) - (special "med-res-level-4" #t) - (special "med-res-level-6" #t) - (special "med-res-level-7" #t) - (special "med-res-level-8" #t) - (special "med-res-level-9" #t) - (special "med-res-level-11" #t) - (special "med-res-level-14" #t) - (special "med-res-level-22" #t) - (special "med-res-level-23" #t) - (special "fishermans-boat-2" #t) - ) - :vis-nick 'mis - :lev0 'misty - :disp0 'display - :lev1 'village1 - :disp1 'special - ) - (new 'static 'continue-point - :name "misty-silo2" - :level 'misty - :trans (new 'static 'vector :x -898000.06 :y 98038.17 :z 4162091.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.1102 :w 0.9938) - :camera-trans (new 'static 'vector :x -931459.9 :y 118198.68 :z 4196081.0 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.6605 0.0 -0.7508 0.1086 0.9894 -0.0955 0.7429 -0.1447 -0.6535) - :load-commands - '((special "med-res-level-1" #t) - (special "med-res-level-2" #t) - (special "med-res-level-4" #t) - (special "med-res-level-6" #t) - (special "med-res-level-7" #t) - (special "med-res-level-8" #t) - (special "med-res-level-9" #t) - (special "med-res-level-11" #t) - (special "med-res-level-14" #t) - (special "med-res-level-22" #t) - (special "med-res-level-23" #t) - (special "fishermans-boat-2" #t) - ) - :vis-nick 'mis - :lev0 'misty - :disp0 'display - :lev1 'village1 - :disp1 'special - ) - ) - :tasks '((the binteger 23) (the binteger 24) (the binteger 25) (the binteger 26) (the binteger 27) (the binteger 28) (the binteger 29) (the binteger 30)) - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :z 4096000.0 :w 1269760.0) - :buzzer 28 - :bottom-height (meters -20.0) - :run-packages '("common") - :wait-for-load #f - ) + (new 'static 'level-load-info + :index 6 + :name 'misty + :visname 'misty-vis + :nickname 'mis + :packages '(misty) + :sound-banks '(misty) + :music-bank 'misty + :ambient-sounds '() + :mood '*misty-mood* + :mood-func 'update-mood-misty + :ocean '*ocean-map-village1* + :sky #t + :sun-fade 0.25 + :continues '((new 'static 'continue-point + :name "misty-start" + :level 'misty + :trans (new 'static 'vector :x 164316.78 :y 15128.576 :z 3390588.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.2339 :w 0.9722) + :camera-trans (new 'static 'vector :x 204089.34 :y 36257.793 :z 3358341.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.6381 0.0 0.7699 -0.0938 0.9925 0.0777 -0.7642 -0.1218 0.6333) + :load-commands '((special "med-res-level-1" #t) + (special "med-res-level-2" #t) + (special "med-res-level-4" #t) + (special "med-res-level-6" #t) + (special "med-res-level-7" #t) + (special "med-res-level-8" #t) + (special "med-res-level-9" #t) + (special "med-res-level-11" #t) + (special "med-res-level-14" #t) + (special "med-res-level-22" #t) + (special "med-res-level-23" #t) + (special "fishermans-boat-2" #t) + ) + :vis-nick 'mis + :lev0 'misty + :disp0 'display + :lev1 'village1 + :disp1 'special + ) + (new 'static 'continue-point + :name "misty-silo" + :level 'misty + :trans (new 'static 'vector :x -672503.0 :y 82131.35 :z 3651465.8 :w 1.0) + :quat (new 'static 'quaternion :y 0.0878 :w 0.9961) + :camera-trans (new 'static 'vector :x -675754.0 :y 102028.91 :z 3604800.8 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9975 0.0 -0.0704 0.0086 0.9924 0.1223 0.0698 -0.1226 0.9899) + :load-commands '((special "med-res-level-1" #t) + (special "med-res-level-2" #t) + (special "med-res-level-4" #t) + (special "med-res-level-6" #t) + (special "med-res-level-7" #t) + (special "med-res-level-8" #t) + (special "med-res-level-9" #t) + (special "med-res-level-11" #t) + (special "med-res-level-14" #t) + (special "med-res-level-22" #t) + (special "med-res-level-23" #t) + (special "fishermans-boat-2" #t) + ) + :vis-nick 'mis + :lev0 'misty + :disp0 'display + :lev1 'village1 + :disp1 'special + ) + (new 'static 'continue-point + :name "misty-bike" + :level 'misty + :trans (new 'static 'vector :x 302533.44 :y 35901.848 :z 4138967.8 :w 1.0) + :quat (new 'static 'quaternion :y -0.2809 :w 0.9597) + :camera-trans (new 'static 'vector :x 338476.25 :y 55700.684 :z 4109729.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.6308 0.0 0.7759 -0.096 0.9923 0.078 -0.7699 -0.1237 0.6259) + :load-commands '((special "med-res-level-1" #t) + (special "med-res-level-2" #t) + (special "med-res-level-4" #t) + (special "med-res-level-6" #t) + (special "med-res-level-7" #t) + (special "med-res-level-8" #t) + (special "med-res-level-9" #t) + (special "med-res-level-11" #t) + (special "med-res-level-14" #t) + (special "med-res-level-22" #t) + (special "med-res-level-23" #t) + (special "fishermans-boat-2" #t) + ) + :vis-nick 'mis + :lev0 'misty + :disp0 'display + :lev1 'village1 + :disp1 'special + ) + (new 'static 'continue-point + :name "misty-backside" + :level 'misty + :trans (new 'static 'vector :x -304192.72 :y 33270.99 :z 4646525.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.8443 :w -0.5357) + :camera-trans (new 'static 'vector :x -346989.78 :y 54377.676 :z 4674685.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.5497 0.0 -0.8353 0.1009 0.9926 -0.0664 0.8291 -0.1208 -0.5457) + :load-commands '((special "med-res-level-1" #t) + (special "med-res-level-2" #t) + (special "med-res-level-4" #t) + (special "med-res-level-6" #t) + (special "med-res-level-7" #t) + (special "med-res-level-8" #t) + (special "med-res-level-9" #t) + (special "med-res-level-11" #t) + (special "med-res-level-14" #t) + (special "med-res-level-22" #t) + (special "med-res-level-23" #t) + (special "fishermans-boat-2" #t) + ) + :vis-nick 'mis + :lev0 'misty + :disp0 'display + :lev1 'village1 + :disp1 'special + ) + (new 'static 'continue-point + :name "misty-silo2" + :level 'misty + :trans (new 'static 'vector :x -898000.06 :y 98038.17 :z 4162091.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.1102 :w 0.9938) + :camera-trans (new 'static 'vector :x -931459.9 :y 118198.68 :z 4196081.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.6605 0.0 -0.7508 0.1086 0.9894 -0.0955 0.7429 -0.1447 -0.6535) + :load-commands '((special "med-res-level-1" #t) + (special "med-res-level-2" #t) + (special "med-res-level-4" #t) + (special "med-res-level-6" #t) + (special "med-res-level-7" #t) + (special "med-res-level-8" #t) + (special "med-res-level-9" #t) + (special "med-res-level-11" #t) + (special "med-res-level-14" #t) + (special "med-res-level-22" #t) + (special "med-res-level-23" #t) + (special "fishermans-boat-2" #t) + ) + :vis-nick 'mis + :lev0 'misty + :disp0 'display + :lev1 'village1 + :disp1 'special + ) + ) + :tasks '(23 24 25 26 27 28 29 30) + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :z 4096000.0 :w 1269760.0) + :buzzer 28 + :bottom-height (meters -20) + :run-packages '("common") + :wait-for-load #f + ) ) -;; definition for symbol firecanyon, type level-load-info (define firecanyon (new 'static 'level-load-info - :name 'firecanyon - :visname 'firecanyon-vis - :nickname 'fic - :index 7 - :packages '(firecanyon) - :sound-banks '(firecanyon) - :music-bank 'firecanyon - :ambient-sounds '() - :mood '*firecanyon-mood* - :mood-func 'update-mood-firecanyon - :ocean 'none - :sky #t - :continues - '((new 'static 'continue-point - :name "firecanyon-start" - :level 'firecanyon - :trans (new 'static 'vector :x -87377.1 :y 126444.75 :z -681697.25 :w 1.0) - :quat (new 'static 'quaternion :y 0.9921 :w -0.1246) - :camera-trans (new 'static 'vector :x -84559.055 :y 144685.47 :z -641194.0 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.9976 0.0 0.0688 -0.01 0.9893 -0.1452 -0.068 -0.1456 -0.9869) - :load-commands '() - :vis-nick 'fic - :lev0 'firecanyon - :disp0 'display - :lev1 'village1 - :disp1 'display - ) - (new 'static 'continue-point - :name "firecanyon-end" - :level 'firecanyon - :trans (new 'static 'vector :x 1360576.1 :y 126976.0 :z -5839533.5 :w 1.0) - :quat (new 'static 'quaternion :y 0.1666 :w 0.986) - :camera-trans (new 'static 'vector :x 1378912.6 :y 144452.81 :z -5872527.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.8847 0.0 0.466 -0.0744 0.9871 0.1414 -0.46 -0.1598 0.8733) - :load-commands '() - :vis-nick 'fic - :lev0 'village2 - :disp0 'display - :lev1 'firecanyon - :disp1 'display + :index 7 + :name 'firecanyon + :visname 'firecanyon-vis + :nickname 'fic + :packages '(firecanyon) + :sound-banks '(firecanyon) + :music-bank 'firecanyon + :ambient-sounds '() + :mood '*firecanyon-mood* + :mood-func 'update-mood-firecanyon + :ocean 'none + :sky #t + :continues '((new 'static 'continue-point + :name "firecanyon-start" + :level 'firecanyon + :trans (new 'static 'vector :x -87377.1 :y 126444.75 :z -681697.25 :w 1.0) + :quat (new 'static 'quaternion :y 0.9921 :w -0.1246) + :camera-trans (new 'static 'vector :x -84559.055 :y 144685.47 :z -641194.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9976 0.0 0.0688 -0.01 0.9893 -0.1452 -0.068 -0.1456 -0.9869) + :load-commands '() + :vis-nick 'fic + :lev0 'firecanyon + :disp0 'display + :lev1 'village1 + :disp1 'display + ) + (new 'static 'continue-point + :name "firecanyon-end" + :level 'firecanyon + :trans (new 'static 'vector :x 1360576.1 :y 126976.0 :z -5839533.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.1666 :w 0.986) + :camera-trans (new 'static 'vector :x 1378912.6 :y 144452.81 :z -5872527.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8847 0.0 0.466 -0.0744 0.9871 0.1414 -0.46 -0.1598 0.8733) + :load-commands '() + :vis-nick 'fic + :lev0 'village2 + :disp0 'display + :lev1 'firecanyon + :disp1 'display + ) ) - ) - :tasks '((the binteger 68) (the binteger 69)) - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x 419840.0 :y 151552.0 :z -3006464.0 :w 2048000.0) - :buzzer 68 - :bottom-height (meters -20.0) - :run-packages '("common") - :wait-for-load #t - ) + :tasks '(68 69) + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 419840.0 :y 151552.0 :z -3006464.0 :w 2048000.0) + :buzzer 68 + :bottom-height (meters -20) + :run-packages '("common") + :wait-for-load #t + ) ) -;; definition for symbol village2, type level-load-info (define village2 (new 'static 'level-load-info - :name 'village2 - :visname 'village2-vis - :nickname 'vi2 - :index 8 - :packages '(village2) - :sound-banks '(village2) - :music-bank 'village2 - :ambient-sounds '() - :mood '*village2-mood* - :mood-func 'update-mood-village2 - :ocean '*ocean-map-village2* - :sky #t - :continues - '((new 'static 'continue-point - :name "village2-start" - :level 'village2 - :trans (new 'static 'vector :x 1460961.2 :y 108562.02 :z -6161391.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.9917 :w 0.1278) - :camera-trans (new 'static 'vector :x 1468018.8 :y 133790.92 :z -6096227.0 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.9941 0.0 0.1076 -0.0261 0.9699 -0.2418 -0.1044 -0.2432 -0.9643) - :load-commands '() - :vis-nick 'vi2 - :lev0 'village2 - :disp0 'display - :lev1 'firecanyon - :disp1 #f - ) - (new 'static 'continue-point - :name "village2-warp" - :level 'village2 - :flags #x4 - :trans (new 'static 'vector :x 1592492.9 :y 91648.0 :z -6328677.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.7469 :w 0.6648) - :camera-trans (new 'static 'vector :x 1555766.1 :y 103759.46 :z -6318964.5 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.2562 0.0 -0.9666 -0.0253 0.9996 0.0067 0.9662 0.0262 -0.2561) - :load-commands '() - :vis-nick 'vi2 - :lev0 'village2 - :disp0 'display - :lev1 'firecanyon - :disp1 #f + :index 8 + :name 'village2 + :visname 'village2-vis + :nickname 'vi2 + :packages '(village2) + :sound-banks '(village2) + :music-bank 'village2 + :ambient-sounds '() + :mood '*village2-mood* + :mood-func 'update-mood-village2 + :ocean '*ocean-map-village2* + :sky #t + :continues '((new 'static 'continue-point + :name "village2-start" + :level 'village2 + :trans (new 'static 'vector :x 1460961.2 :y 108562.02 :z -6161391.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9917 :w 0.1278) + :camera-trans (new 'static 'vector :x 1468018.8 :y 133790.92 :z -6096227.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9941 0.0 0.1076 -0.0261 0.9699 -0.2418 -0.1044 -0.2432 -0.9643) + :load-commands '() + :vis-nick 'vi2 + :lev0 'village2 + :disp0 'display + :lev1 'firecanyon + :disp1 #f + ) + (new 'static 'continue-point + :name "village2-warp" + :level 'village2 + :flags (continue-flags warp) + :trans (new 'static 'vector :x 1592492.9 :y 91648.0 :z -6328677.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7469 :w 0.6648) + :camera-trans (new 'static 'vector :x 1555766.1 :y 103759.46 :z -6318964.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.2562 0.0 -0.9666 -0.0253 0.9996 0.0067 0.9662 0.0262 -0.2561) + :load-commands '() + :vis-nick 'vi2 + :lev0 'village2 + :disp0 'display + :lev1 'firecanyon + :disp1 #f + ) + (new 'static 'continue-point + :name "village2-dock" + :level 'village2 + :trans (new 'static 'vector :x 1264346.8 :y 19451.494 :z -6833563.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.0258 :w 0.9996) + :camera-trans (new 'static 'vector :x 1265547.2 :y 34647.656 :z -6862636.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9991 0.0 0.0411 -0.0088 0.9764 0.2155 -0.0401 -0.2156 0.9756) + :load-commands '() + :vis-nick 'vi2 + :lev0 'village2 + :disp0 'display + :lev1 'rolling + :disp1 #f + ) ) - (new 'static 'continue-point - :name "village2-dock" - :level 'village2 - :trans (new 'static 'vector :x 1264346.8 :y 19451.494 :z -6833563.5 :w 1.0) - :quat (new 'static 'quaternion :y 0.0258 :w 0.9996) - :camera-trans (new 'static 'vector :x 1265547.2 :y 34647.656 :z -6862636.5 :w 1.0) - :camera-rot (new 'static 'array float 9 0.9991 0.0 0.0411 -0.0088 0.9764 0.2155 -0.0401 -0.2156 0.9756) - :load-commands '() - :vis-nick 'vi2 - :lev0 'village2 - :disp0 'display - :lev1 'rolling - :disp1 #f - ) - ) - :tasks '((the binteger 31) (the binteger 32) (the binteger 34) (the binteger 35) (the binteger 76)) - :priority #xc8 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x 1392640.0 :y 81920.0 :z -6770688.0 :w 696320.0) - :buzzer 76 - :bottom-height (meters -20.0) - :run-packages '("common") - :wait-for-load #t - ) + :tasks '(31 32 34 35 76) + :priority #xc8 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 1392640.0 :y 81920.0 :z -6770688.0 :w 696320.0) + :buzzer 76 + :bottom-height (meters -20) + :run-packages '("common") + :wait-for-load #t + ) ) -;; definition for symbol sunken, type level-load-info (define sunken (new 'static 'level-load-info - :name 'sunken - :visname 'sunken-vis - :nickname 'sun - :index 9 - :packages '(sunken) - :sound-banks '(sunken) - :music-bank 'sunken - :ambient-sounds '() - :mood '*sunken-mood* - :mood-func 'update-mood-sunken - :ocean '*ocean-map-sunken* - :sky #f - :continues - '((new 'static 'continue-point - :name "sunken-start" - :level 'sunken - :trans (new 'static 'vector :x 2172095.2 :y -591749.94 :z -6721553.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.5083 :w 0.8611) - :camera-trans (new 'static 'vector :x 2138871.5 :y -572296.4 :z -6751967.5 :w 1.0) - :camera-rot (new 'static 'array float 9 0.7575 0.0 -0.6527 0.0858 0.9913 0.0995 0.647 -0.1314 0.7509) - :load-commands '() - :vis-nick 'sun - :lev0 'sunken - :disp0 'display - :lev1 'village2 - :disp1 'display - ) - (new 'static 'continue-point - :name "sunken1" - :level 'sunken - :trans (new 'static 'vector :x 3062988.5 :y -536575.56 :z -6527484.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.5304 :w 0.8477) - :camera-trans (new 'static 'vector :x 3015461.2 :y -515480.38 :z -6546573.5 :w 1.0) - :camera-rot (new 'static 'array float 9 0.3725 0.0 -0.928 0.1121 0.9926 0.045 0.9212 -0.1208 0.3697) - :load-commands '() - :vis-nick 'sun - :lev0 'sunken - :disp0 'display - :lev1 'sunkenb - :disp1 #f + :index 9 + :name 'sunken + :visname 'sunken-vis + :nickname 'sun + :packages '(sunken) + :sound-banks '(sunken) + :music-bank 'sunken + :ambient-sounds '() + :mood '*sunken-mood* + :mood-func 'update-mood-sunken + :ocean '*ocean-map-sunken* + :sky #f + :continues '((new 'static 'continue-point + :name "sunken-start" + :level 'sunken + :trans (new 'static 'vector :x 2172095.2 :y -591749.94 :z -6721553.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.5083 :w 0.8611) + :camera-trans (new 'static 'vector :x 2138871.5 :y -572296.4 :z -6751967.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7575 0.0 -0.6527 0.0858 0.9913 0.0995 0.647 -0.1314 0.7509) + :load-commands '() + :vis-nick 'sun + :lev0 'sunken + :disp0 'display + :lev1 'village2 + :disp1 'display + ) + (new 'static 'continue-point + :name "sunken1" + :level 'sunken + :trans (new 'static 'vector :x 3062988.5 :y -536575.56 :z -6527484.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.5304 :w 0.8477) + :camera-trans (new 'static 'vector :x 3015461.2 :y -515480.38 :z -6546573.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.3725 0.0 -0.928 0.1121 0.9926 0.045 0.9212 -0.1208 0.3697) + :load-commands '() + :vis-nick 'sun + :lev0 'sunken + :disp0 'display + :lev1 'sunkenb + :disp1 #f + ) + (new 'static 'continue-point + :name "sunken2" + :level 'sunken + :trans (new 'static 'vector :x 3133625.5 :y -569343.56 :z -6909587.5 :w 1.0) + :quat (new 'static 'quaternion :y -0.9512 :w 0.3083) + :camera-trans (new 'static 'vector :x 3170833.2 :y -548244.25 :z -6874378.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.6872 0.0 0.7263 -0.0878 0.9926 -0.0831 -0.721 -0.1209 -0.6822) + :load-commands '() + :vis-nick 'sun + :lev0 'sunken + :disp0 'display + :lev1 'sunkenb + :disp1 #f + ) + (new 'static 'continue-point + :name "sunken-tube1" + :level 'sunken + :trans (new 'static 'vector :x 2649601.8 :y -569343.56 :z -7132970.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9936 :w 0.1124) + :camera-trans (new 'static 'vector :x 2636150.2 :y -555656.4 :z -7114732.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.8024 0.0 -0.5967 0.1721 0.9574 -0.2315 0.5713 -0.2885 -0.7683) + :load-commands '() + :vis-nick 'sun + :lev0 'sunken + :disp0 'display + :lev1 'sunkenb + :disp1 #f + ) ) - (new 'static 'continue-point - :name "sunken2" - :level 'sunken - :trans (new 'static 'vector :x 3133625.5 :y -569343.56 :z -6909587.5 :w 1.0) - :quat (new 'static 'quaternion :y -0.9512 :w 0.3083) - :camera-trans (new 'static 'vector :x 3170833.2 :y -548244.25 :z -6874378.0 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.6872 0.0 0.7263 -0.0878 0.9926 -0.0831 -0.721 -0.1209 -0.6822) - :load-commands '() - :vis-nick 'sun - :lev0 'sunken - :disp0 'display - :lev1 'sunkenb - :disp1 #f - ) - (new 'static 'continue-point - :name "sunken-tube1" - :level 'sunken - :trans (new 'static 'vector :x 2649601.8 :y -569343.56 :z -7132970.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.9936 :w 0.1124) - :camera-trans (new 'static 'vector :x 2636150.2 :y -555656.4 :z -7114732.5 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.8024 0.0 -0.5967 0.1721 0.9574 -0.2315 0.5713 -0.2885 -0.7683) - :load-commands '() - :vis-nick 'sun - :lev0 'sunken - :disp0 'display - :lev1 'sunkenb - :disp1 #f - ) - ) - :tasks '() - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x 2867200.0 :y -2048000.0 :z -6553600.0 :w 2048000.0) - :buzzer 49 - :bottom-height (meters -500.0) - :run-packages '("common") - :wait-for-load #f - ) + :tasks '() + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 2867200.0 :y -2048000.0 :z -6553600.0 :w 2048000.0) + :buzzer 49 + :bottom-height (meters -500) + :run-packages '("common") + :wait-for-load #f + ) ) -;; definition for symbol sunkenb, type level-load-info (define sunkenb (new 'static 'level-load-info - :name 'sunkenb - :visname 'sunkenb-vis - :nickname 'sub - :index 10 - :packages '() - :sound-banks '(sunken) - :music-bank 'sunken - :ambient-sounds '() - :mood '*sunkenb-mood* - :mood-func 'update-mood-sunken - :ocean '*ocean-map-sunken* - :sky #t - :continues - '((new 'static 'continue-point - :name "sunkenb-start" - :level 'sunkenb - :trans (new 'static 'vector :x 2229231.2 :y -1019912.2 :z -6788748.5 :w 1.0) - :quat (new 'static 'quaternion :y 0.895 :w 0.446) - :camera-trans (new 'static 'vector :x 2187840.0 :y -998915.7 :z -6759328.0 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.5786 0.0 -0.8155 0.0992 0.9925 -0.0704 0.8094 -0.1217 -0.5743) - :load-commands '((alive "exit-chamber-1")) - :vis-nick 'sub - :lev0 'sunken - :disp0 'display - :lev1 'sunkenb - :disp1 'display - ) - (new 'static 'continue-point - :name "sunkenb-helix" - :level 'sunkenb - :trans (new 'static 'vector :x 2466572.8 :y -1838989.2 :z -7299582.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.8841 :w 0.4672) - :camera-trans (new 'static 'vector :x 2515616.2 :y -1817888.4 :z -7284843.5 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.2889 0.0 0.9573 -0.1163 0.9925 -0.0351 -0.9502 -0.1214 -0.2867) - :load-commands '() - :vis-nick 'sub - :lev0 'sunken - :disp0 'display - :lev1 'sunkenb - :disp1 'display + :index 10 + :name 'sunkenb + :visname 'sunkenb-vis + :nickname 'sub + :packages '() + :sound-banks '(sunken) + :music-bank 'sunken + :ambient-sounds '() + :mood '*sunkenb-mood* + :mood-func 'update-mood-sunken + :ocean '*ocean-map-sunken* + :sky #t + :continues '((new 'static 'continue-point + :name "sunkenb-start" + :level 'sunkenb + :trans (new 'static 'vector :x 2229231.2 :y -1019912.2 :z -6788748.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.895 :w 0.446) + :camera-trans (new 'static 'vector :x 2187840.0 :y -998915.7 :z -6759328.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.5786 0.0 -0.8155 0.0992 0.9925 -0.0704 0.8094 -0.1217 -0.5743) + :load-commands '((alive "exit-chamber-1")) + :vis-nick 'sub + :lev0 'sunken + :disp0 'display + :lev1 'sunkenb + :disp1 'display + ) + (new 'static 'continue-point + :name "sunkenb-helix" + :level 'sunkenb + :trans (new 'static 'vector :x 2466572.8 :y -1838989.2 :z -7299582.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.8841 :w 0.4672) + :camera-trans (new 'static 'vector :x 2515616.2 :y -1817888.4 :z -7284843.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.2889 0.0 0.9573 -0.1163 0.9925 -0.0351 -0.9502 -0.1214 -0.2867) + :load-commands '() + :vis-nick 'sub + :lev0 'sunken + :disp0 'display + :lev1 'sunkenb + :disp1 'display + ) ) - ) - :tasks '() - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x 2867200.0 :y -2048000.0 :z -6553600.0 :w 2048000.0) - :buzzer 49 - :bottom-height (meters -500.0) - :run-packages '("common" "sunken") - :wait-for-load #f - ) + :tasks '() + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 2867200.0 :y -2048000.0 :z -6553600.0 :w 2048000.0) + :buzzer 49 + :bottom-height (meters -500) + :run-packages '("common" "sunken") + :wait-for-load #f + ) ) -;; definition for symbol swamp, type level-load-info (define swamp (new 'static 'level-load-info - :name 'swamp - :visname 'swamp-vis - :nickname 'swa - :index 11 - :packages '(swamp) - :sound-banks '(swamp) - :music-bank 'swamp - :ambient-sounds '() - :mood '*swamp-mood* - :mood-func 'update-mood-swamp - :ocean '*ocean-map-village2* - :sky #t - :continues - '((new 'static 'continue-point - :name "swamp-start" - :level 'swamp - :trans (new 'static 'vector :x 1842537.2 :y 21027.227 :z -7333297.5 :w 1.0) - :quat (new 'static 'quaternion :y -0.9933 :w 0.1153) - :camera-trans (new 'static 'vector :x 1862529.9 :y 44371.56 :z -7277995.5 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.9403 0.0 0.3402 -0.0814 0.9708 -0.2252 -0.3303 -0.2394 -0.9129) - :load-commands - '((special "swamp-blimp-3" #t) - (special "precursor-arm-3" #t) - (special "swamp-tetherrock-13" #t) - (special "swamp-tetherrock-14" #t) - (special "swamp-tetherrock-15" #t) - (special "swamp-tetherrock-16" #t) - ) - :vis-nick 'swa - :lev0 'swamp - :disp0 'display - :lev1 'village2 - :disp1 'display - ) - (new 'static 'continue-point - :name "swamp-dock1" - :level 'swamp - :trans (new 'static 'vector :x 1360386.9 :y 5823.693 :z -8218890.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.585 :w -0.811) - :camera-trans (new 'static 'vector :x 1314475.6 :y 26164.838 :z -8234152.5 :w 1.0) - :camera-rot (new 'static 'array float 9 0.3154 0.0 -0.9489 0.1134 0.9928 0.0376 0.9421 -0.1195 0.3131) - :load-commands - '((special "swamp-blimp-3" #t) - (special "precursor-arm-3" #t) - (special "swamp-tetherrock-13" #t) - (special "swamp-tetherrock-14" #t) - (special "swamp-tetherrock-15" #t) - (special "swamp-tetherrock-16" #t) + :index 11 + :name 'swamp + :visname 'swamp-vis + :nickname 'swa + :packages '(swamp) + :sound-banks '(swamp) + :music-bank 'swamp + :ambient-sounds '() + :mood '*swamp-mood* + :mood-func 'update-mood-swamp + :ocean '*ocean-map-village2* + :sky #t + :continues '((new 'static 'continue-point + :name "swamp-start" + :level 'swamp + :trans (new 'static 'vector :x 1842537.2 :y 21027.227 :z -7333297.5 :w 1.0) + :quat (new 'static 'quaternion :y -0.9933 :w 0.1153) + :camera-trans (new 'static 'vector :x 1862529.9 :y 44371.56 :z -7277995.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9403 0.0 0.3402 -0.0814 0.9708 -0.2252 -0.3303 -0.2394 -0.9129) + :load-commands '((special "swamp-blimp-3" #t) + (special "precursor-arm-3" #t) + (special "swamp-tetherrock-13" #t) + (special "swamp-tetherrock-14" #t) + (special "swamp-tetherrock-15" #t) + (special "swamp-tetherrock-16" #t) + ) + :vis-nick 'swa + :lev0 'swamp + :disp0 'display + :lev1 'village2 + :disp1 'display ) - :vis-nick 'swa - :lev0 'swamp - :disp0 'display - :lev1 'village2 - :disp1 'special-vis - ) - (new 'static 'continue-point - :name "swamp-cave1" - :level 'swamp - :trans (new 'static 'vector :x 1553700.5 :y 1835.4176 :z -8258429.5 :w 1.0) - :quat (new 'static 'quaternion :y -0.9871 :w -0.1599) - :camera-trans (new 'static 'vector :x 1556873.2 :y 22715.598 :z -8208106.0 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.9982 0.0 0.0596 -0.0072 0.9926 -0.1209 -0.0592 -0.1211 -0.9908) - :load-commands - '((special "swamp-blimp-3" #t) - (special "precursor-arm-3" #t) - (special "swamp-tetherrock-13" #t) - (special "swamp-tetherrock-14" #t) - (special "swamp-tetherrock-15" #t) - (special "swamp-tetherrock-16" #t) + (new 'static 'continue-point + :name "swamp-dock1" + :level 'swamp + :trans (new 'static 'vector :x 1360386.9 :y 5823.693 :z -8218890.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.585 :w -0.811) + :camera-trans (new 'static 'vector :x 1314475.6 :y 26164.838 :z -8234152.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.3154 0.0 -0.9489 0.1134 0.9928 0.0376 0.9421 -0.1195 0.3131) + :load-commands '((special "swamp-blimp-3" #t) + (special "precursor-arm-3" #t) + (special "swamp-tetherrock-13" #t) + (special "swamp-tetherrock-14" #t) + (special "swamp-tetherrock-15" #t) + (special "swamp-tetherrock-16" #t) + ) + :vis-nick 'swa + :lev0 'swamp + :disp0 'display + :lev1 'village2 + :disp1 'special-vis ) - :vis-nick 'swa - :lev0 'swamp - :disp0 'display - :lev1 'village2 - :disp1 'special-vis - ) - (new 'static 'continue-point - :name "swamp-dock2" - :level 'swamp - :trans (new 'static 'vector :x 1645872.4 :y 36495.77 :z -8427323.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.8294 :w -0.5586) - :camera-trans (new 'static 'vector :x 1599338.9 :y 57590.168 :z -8405954.0 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.418 0.0 -0.9084 0.1106 0.9925 -0.0509 0.9016 -0.1218 -0.4149) - :load-commands - '((special "swamp-blimp-3" #t) - (special "precursor-arm-3" #t) - (special "swamp-tetherrock-13" #t) - (special "swamp-tetherrock-14" #t) - (special "swamp-tetherrock-15" #t) - (special "swamp-tetherrock-16" #t) + (new 'static 'continue-point + :name "swamp-cave1" + :level 'swamp + :trans (new 'static 'vector :x 1553700.5 :y 1835.4176 :z -8258429.5 :w 1.0) + :quat (new 'static 'quaternion :y -0.9871 :w -0.1599) + :camera-trans (new 'static 'vector :x 1556873.2 :y 22715.598 :z -8208106.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9982 0.0 0.0596 -0.0072 0.9926 -0.1209 -0.0592 -0.1211 -0.9908) + :load-commands '((special "swamp-blimp-3" #t) + (special "precursor-arm-3" #t) + (special "swamp-tetherrock-13" #t) + (special "swamp-tetherrock-14" #t) + (special "swamp-tetherrock-15" #t) + (special "swamp-tetherrock-16" #t) + ) + :vis-nick 'swa + :lev0 'swamp + :disp0 'display + :lev1 'village2 + :disp1 'special-vis ) - :vis-nick 'swa - :lev0 'swamp - :disp0 'display - :lev1 'village2 - :disp1 'special-vis - ) - (new 'static 'continue-point - :name "swamp-cave2" - :level 'swamp - :trans (new 'static 'vector :x 2037539.2 :y 1103.872 :z -8560013.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.0559 :w 0.9984) - :camera-trans (new 'static 'vector :x 1995208.2 :y 21832.908 :z -8586304.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.5516 0.0 -0.834 0.097 0.9932 0.0641 0.8283 -0.1163 0.5479) - :load-commands - '((special "swamp-blimp-3" #t) - (special "precursor-arm-3" #t) - (special "swamp-tetherrock-13" #t) - (special "swamp-tetherrock-14" #t) - (special "swamp-tetherrock-15" #t) - (special "swamp-tetherrock-16" #t) + (new 'static 'continue-point + :name "swamp-dock2" + :level 'swamp + :trans (new 'static 'vector :x 1645872.4 :y 36495.77 :z -8427323.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.8294 :w -0.5586) + :camera-trans (new 'static 'vector :x 1599338.9 :y 57590.168 :z -8405954.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.418 0.0 -0.9084 0.1106 0.9925 -0.0509 0.9016 -0.1218 -0.4149) + :load-commands '((special "swamp-blimp-3" #t) + (special "precursor-arm-3" #t) + (special "swamp-tetherrock-13" #t) + (special "swamp-tetherrock-14" #t) + (special "swamp-tetherrock-15" #t) + (special "swamp-tetherrock-16" #t) + ) + :vis-nick 'swa + :lev0 'swamp + :disp0 'display + :lev1 'village2 + :disp1 'special-vis ) - :vis-nick 'swa - :lev0 'swamp - :disp0 'display - :lev1 'village2 - :disp1 'special-vis - ) - (new 'static 'continue-point - :name "swamp-game" - :level 'swamp - :trans (new 'static 'vector :x 2612289.2 :y -2047.5905 :z -8315907.5 :w 1.0) - :quat (new 'static 'quaternion :y -0.6975 :w 0.7165) - :camera-trans (new 'static 'vector :x 2661940.5 :y 20693.81 :z -8317980.5 :w 1.0) - :camera-rot (new 'static 'array float 9 0.0406 0.0 0.9991 -0.1452 0.9893 0.0059 -0.9885 -0.1453 0.0402) - :load-commands - '((special "swamp-blimp-3" #t) - (special "precursor-arm-3" #t) - (special "swamp-tetherrock-13" #t) - (special "swamp-tetherrock-14" #t) - (special "swamp-tetherrock-15" #t) - (special "swamp-tetherrock-16" #t) + (new 'static 'continue-point + :name "swamp-cave2" + :level 'swamp + :trans (new 'static 'vector :x 2037539.2 :y 1103.872 :z -8560013.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.0559 :w 0.9984) + :camera-trans (new 'static 'vector :x 1995208.2 :y 21832.908 :z -8586304.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.5516 0.0 -0.834 0.097 0.9932 0.0641 0.8283 -0.1163 0.5479) + :load-commands '((special "swamp-blimp-3" #t) + (special "precursor-arm-3" #t) + (special "swamp-tetherrock-13" #t) + (special "swamp-tetherrock-14" #t) + (special "swamp-tetherrock-15" #t) + (special "swamp-tetherrock-16" #t) + ) + :vis-nick 'swa + :lev0 'swamp + :disp0 'display + :lev1 'village2 + :disp1 'special-vis ) - :vis-nick 'swa - :lev0 'swamp - :disp0 'display - :lev1 'village2 - :disp1 'special-vis - ) - (new 'static 'continue-point - :name "swamp-cave3" - :level 'swamp - :trans (new 'static 'vector :x 2011811.4 :y 3711.7952 :z -7923027.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.5269 :w 0.8499) - :camera-trans (new 'static 'vector :x 2053120.4 :y 22242.51 :z -7927784.5 :w 1.0) - :camera-rot (new 'static 'array float 9 0.1145 0.0 0.9934 -0.1412 0.9898 0.0162 -0.9833 -0.1422 0.1134) - :load-commands - '((special "swamp-blimp-3" #t) - (special "precursor-arm-3" #t) - (special "swamp-tetherrock-13" #t) - (special "swamp-tetherrock-14" #t) - (special "swamp-tetherrock-15" #t) - (special "swamp-tetherrock-16" #t) + (new 'static 'continue-point + :name "swamp-game" + :level 'swamp + :trans (new 'static 'vector :x 2612289.2 :y -2047.5905 :z -8315907.5 :w 1.0) + :quat (new 'static 'quaternion :y -0.6975 :w 0.7165) + :camera-trans (new 'static 'vector :x 2661940.5 :y 20693.81 :z -8317980.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.0406 0.0 0.9991 -0.1452 0.9893 0.0059 -0.9885 -0.1453 0.0402) + :load-commands '((special "swamp-blimp-3" #t) + (special "precursor-arm-3" #t) + (special "swamp-tetherrock-13" #t) + (special "swamp-tetherrock-14" #t) + (special "swamp-tetherrock-15" #t) + (special "swamp-tetherrock-16" #t) + ) + :vis-nick 'swa + :lev0 'swamp + :disp0 'display + :lev1 'village2 + :disp1 'special-vis + ) + (new 'static 'continue-point + :name "swamp-cave3" + :level 'swamp + :trans (new 'static 'vector :x 2011811.4 :y 3711.7952 :z -7923027.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.5269 :w 0.8499) + :camera-trans (new 'static 'vector :x 2053120.4 :y 22242.51 :z -7927784.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.1145 0.0 0.9934 -0.1412 0.9898 0.0162 -0.9833 -0.1422 0.1134) + :load-commands '((special "swamp-blimp-3" #t) + (special "precursor-arm-3" #t) + (special "swamp-tetherrock-13" #t) + (special "swamp-tetherrock-14" #t) + (special "swamp-tetherrock-15" #t) + (special "swamp-tetherrock-16" #t) + ) + :vis-nick 'swa + :lev0 'swamp + :disp0 'display + :lev1 'village2 + :disp1 'special-vis ) - :vis-nick 'swa - :lev0 'swamp - :disp0 'display - :lev1 'village2 - :disp1 'special-vis ) - ) - :tasks '((the binteger 36) (the binteger 37) (the binteger 38) (the binteger 39) (the binteger 40) (the binteger 41) (the binteger 42) (the binteger 43)) - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x 1986560.0 :z -8417280.0 :w 1003520.0) - :buzzer 43 - :bottom-height (meters -20.0) - :run-packages '("common") - :wait-for-load #t - ) + :tasks '(36 37 38 39 40 41 42 43) + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 1986560.0 :z -8417280.0 :w 1003520.0) + :buzzer 43 + :bottom-height (meters -20) + :run-packages '("common") + :wait-for-load #t + ) ) -;; definition for symbol rolling, type level-load-info (define rolling - (new 'static 'level-load-info - :name 'rolling - :visname 'rolling-vis - :nickname 'rol - :index 12 - :packages '(rolling) - :sound-banks '(rolling) - :music-bank 'rolling - :ambient-sounds '() - :mood '*rolling-mood* - :mood-func 'update-mood-rolling - :ocean 'none - :sky #t - :continues - '((new 'static 'continue-point - :name "rolling-start" - :level 'rolling - :trans (new 'static 'vector :x 432272.6 :y 42821.633 :z -6737529.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.545 :w 0.8383) - :camera-trans (new 'static 'vector :x 494105.8 :y 67237.48 :z -6748524.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.1759 0.0 0.9843 -0.2371 0.9705 0.0423 -0.9553 -0.2409 0.1707) - :load-commands '() - :vis-nick 'rol - :lev0 'rolling - :disp0 'display - :lev1 'village2 - :disp1 'display - ) - ) - :tasks '((the binteger 52) (the binteger 53) (the binteger 54) (the binteger 55) (the binteger 56) (the binteger 57) (the binteger 58) (the binteger 59)) - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x -753664.0 :y 131072.0 :z -6569984.0 :w 974848.0) - :buzzer 57 - :bottom-height (meters -20.0) - :run-packages '("common") - :wait-for-load #t - ) + (new 'static 'level-load-info + :index 12 + :name 'rolling + :visname 'rolling-vis + :nickname 'rol + :packages '(rolling) + :sound-banks '(rolling) + :music-bank 'rolling + :ambient-sounds '() + :mood '*rolling-mood* + :mood-func 'update-mood-rolling + :ocean 'none + :sky #t + :continues '((new 'static 'continue-point + :name "rolling-start" + :level 'rolling + :trans (new 'static 'vector :x 432272.6 :y 42821.633 :z -6737529.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.545 :w 0.8383) + :camera-trans (new 'static 'vector :x 494105.8 :y 67237.48 :z -6748524.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.1759 0.0 0.9843 -0.2371 0.9705 0.0423 -0.9553 -0.2409 0.1707) + :load-commands '() + :vis-nick 'rol + :lev0 'rolling + :disp0 'display + :lev1 'village2 + :disp1 'display + ) + ) + :tasks '(52 53 54 55 56 57 58 59) + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x -753664.0 :y 131072.0 :z -6569984.0 :w 974848.0) + :buzzer 57 + :bottom-height (meters -20) + :run-packages '("common") + :wait-for-load #t + ) ) -;; definition for symbol ogre, type level-load-info (define ogre (new 'static 'level-load-info - :name 'ogre - :visname 'ogre-vis - :nickname 'ogr - :index 13 - :packages '(ogre) - :sound-banks '(ogre) - :music-bank 'ogre - :ambient-sounds '() - :mood '*ogre-mood* - :mood-func 'update-mood-ogre - :ocean 'none - :sky #t - :continues - '((new 'static 'continue-point - :name "ogre-start" - :level 'ogre - :trans (new 'static 'vector :x 849775.8 :y 163962.88 :z -7301166.5 :w 1.0) - :quat (new 'static 'quaternion :y -0.9931 :w 0.1166) - :camera-trans (new 'static 'vector :x 848906.25 :y 185056.88 :z -7249962.0 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.9998 0.0 -0.0159 0.0019 0.9925 -0.1215 0.0158 -0.1215 -0.9924) - :load-commands '() - :vis-nick 'ogr - :lev0 'ogre - :disp0 'display - :lev1 'village2 - :disp1 'display - ) - (new 'static 'continue-point - :name "ogre-race" - :level 'ogre - :trans (new 'static 'vector :x 841424.9 :y 163801.1 :z -8205419.5 :w 1.0) - :quat (new 'static 'quaternion :y -0.9857 :w 0.168) - :camera-trans (new 'static 'vector :x 860479.9 :y 183815.38 :z -8162368.0 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.9145 0.0 0.4045 -0.0497 0.9924 -0.1125 -0.4015 -0.123 -0.9075) - :load-commands '() - :vis-nick 'ogr - :lev0 'ogre - :disp0 'display - :lev1 'village2 - :disp1 #f + :index 13 + :name 'ogre + :visname 'ogre-vis + :nickname 'ogr + :packages '(ogre) + :sound-banks '(ogre) + :music-bank 'ogre + :ambient-sounds '() + :mood '*ogre-mood* + :mood-func 'update-mood-ogre + :ocean 'none + :sky #t + :continues '((new 'static 'continue-point + :name "ogre-start" + :level 'ogre + :trans (new 'static 'vector :x 849775.8 :y 163962.88 :z -7301166.5 :w 1.0) + :quat (new 'static 'quaternion :y -0.9931 :w 0.1166) + :camera-trans (new 'static 'vector :x 848906.25 :y 185056.88 :z -7249962.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9998 0.0 -0.0159 0.0019 0.9925 -0.1215 0.0158 -0.1215 -0.9924) + :load-commands '() + :vis-nick 'ogr + :lev0 'ogre + :disp0 'display + :lev1 'village2 + :disp1 'display + ) + (new 'static 'continue-point + :name "ogre-race" + :level 'ogre + :trans (new 'static 'vector :x 841424.9 :y 163801.1 :z -8205419.5 :w 1.0) + :quat (new 'static 'quaternion :y -0.9857 :w 0.168) + :camera-trans (new 'static 'vector :x 860479.9 :y 183815.38 :z -8162368.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9145 0.0 0.4045 -0.0497 0.9924 -0.1125 -0.4015 -0.123 -0.9075) + :load-commands '() + :vis-nick 'ogr + :lev0 'ogre + :disp0 'display + :lev1 'village2 + :disp1 #f + ) + (new 'static 'continue-point + :name "ogre-end" + :level 'ogre + :trans (new 'static 'vector :x 3971233.5 :y 141227.62 :z -13935735.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.8721 :w 0.4892) + :camera-trans (new 'static 'vector :x 3997892.2 :y 159604.73 :z -13904449.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.7611 0.0 0.6485 -0.0932 0.9896 -0.1094 -0.6417 -0.1438 -0.7532) + :load-commands '() + :vis-nick 'ogr + :lev0 'village3 + :disp0 'display + :lev1 'ogre + :disp1 'display + ) ) - (new 'static 'continue-point - :name "ogre-end" - :level 'ogre - :trans (new 'static 'vector :x 3971233.5 :y 141227.62 :z -13935735.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.8721 :w 0.4892) - :camera-trans (new 'static 'vector :x 3997892.2 :y 159604.73 :z -13904449.0 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.7611 0.0 0.6485 -0.0932 0.9896 -0.1094 -0.6417 -0.1438 -0.7532) - :load-commands '() - :vis-nick 'ogr - :lev0 'village3 - :disp0 'display - :lev1 'ogre - :disp1 'display - ) - ) - :tasks '((the binteger 86) (the binteger 87) (the binteger 110) (the binteger 88)) - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x 2334720.0 :y 180224.0 :z -10653696.0 :w 3653632.0) - :buzzer 88 - :bottom-height (meters -20.0) - :run-packages '("common") - :wait-for-load #t - ) + :tasks '(86 87 110 88) + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 2334720.0 :y 180224.0 :z -10653696.0 :w 3653632.0) + :buzzer 88 + :bottom-height (meters -20) + :run-packages '("common") + :wait-for-load #t + ) ) -;; definition for symbol village3, type level-load-info (define village3 (new 'static 'level-load-info - :name 'village3 - :visname 'village3-vis - :nickname 'vi3 - :index 14 - :packages '(village3) - :sound-banks '(village3) - :music-bank 'village3 - :ambient-sounds '() - :mood '*village3-mood* - :mood-func 'update-mood-village3 - :ocean #f - :sky #t - :continues - '((new 'static 'continue-point - :name "village3-start" - :level 'village3 - :trans (new 'static 'vector :x 4468021.5 :y 186608.03 :z -14054268.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.9999 :w 0.005) - :camera-trans (new 'static 'vector :x 4469439.5 :y 207701.2 :z -14003077.0 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.9996 0.0 0.0268 -0.0032 0.9925 -0.1216 -0.0266 -0.1216 -0.9922) - :load-commands '() - :vis-nick 'vi3 - :lev0 'village3 - :disp0 'display - :lev1 'ogre - :disp1 #f - ) - (new 'static 'continue-point - :name "village3-warp" - :level 'village3 - :flags #x4 - :trans (new 'static 'vector :x 4549776.0 :y 215375.88 :z -14285922.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.681 :w 0.7322) - :camera-trans (new 'static 'vector :x 4543255.0 :y 226776.67 :z -14313317.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.8563 0.0 -0.2763 0.0456 0.8875 0.1413 0.2725 -0.1485 0.8446) - :load-commands '() - :vis-nick 'vi3 - :lev0 'village3 - :disp0 'display - :lev1 'ogre - :disp1 #f + :index 14 + :name 'village3 + :visname 'village3-vis + :nickname 'vi3 + :packages '(village3) + :sound-banks '(village3) + :music-bank 'village3 + :ambient-sounds '() + :mood '*village3-mood* + :mood-func 'update-mood-village3 + :ocean #f + :sky #t + :continues '((new 'static 'continue-point + :name "village3-start" + :level 'village3 + :trans (new 'static 'vector :x 4468021.5 :y 186608.03 :z -14054268.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9999 :w 0.005) + :camera-trans (new 'static 'vector :x 4469439.5 :y 207701.2 :z -14003077.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9996 0.0 0.0268 -0.0032 0.9925 -0.1216 -0.0266 -0.1216 -0.9922) + :load-commands '() + :vis-nick 'vi3 + :lev0 'village3 + :disp0 'display + :lev1 'ogre + :disp1 #f + ) + (new 'static 'continue-point + :name "village3-warp" + :level 'village3 + :flags (continue-flags warp) + :trans (new 'static 'vector :x 4549776.0 :y 215375.88 :z -14285922.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.681 :w 0.7322) + :camera-trans (new 'static 'vector :x 4543255.0 :y 226776.67 :z -14313317.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8563 0.0 -0.2763 0.0456 0.8875 0.1413 0.2725 -0.1485 0.8446) + :load-commands '() + :vis-nick 'vi3 + :lev0 'village3 + :disp0 'display + :lev1 'ogre + :disp1 #f + ) + (new 'static 'continue-point + :name "village3-farside" + :level 'village3 + :trans (new 'static 'vector :x 4423744.0 :y 198723.58 :z -14530641.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.6611 :w 0.7502) + :camera-trans (new 'static 'vector :x 4381844.0 :y 218599.83 :z -14551361.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.442 0.0 -0.8969 0.1099 0.9924 0.0541 0.8902 -0.1225 0.4387) + :load-commands '() + :vis-nick 'vi3 + :lev0 'village3 + :disp0 'display + :lev1 'snow + :disp1 #f + ) ) - (new 'static 'continue-point - :name "village3-farside" - :level 'village3 - :trans (new 'static 'vector :x 4423744.0 :y 198723.58 :z -14530641.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.6611 :w 0.7502) - :camera-trans (new 'static 'vector :x 4381844.0 :y 218599.83 :z -14551361.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.442 0.0 -0.8969 0.1099 0.9924 0.0541 0.8902 -0.1225 0.4387) - :load-commands '() - :vis-nick 'vi3 - :lev0 'village3 - :disp0 'display - :lev1 'snow - :disp1 #f - ) - ) - :tasks '((the binteger 96) (the binteger 97) (the binteger 98) (the binteger 99) (the binteger 100) (the binteger 101) (the binteger 74) (the binteger 77)) - :priority #xc8 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 4571136.0 :y 389120.0 :z -14323712.0 :w 409600.0) - :buzzer 77 - :bottom-height (meters -20.0) - :run-packages '("common") - :wait-for-load #f - ) + :tasks '(96 97 98 99 100 101 74 77) + :priority #xc8 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 4571136.0 :y 389120.0 :z -14323712.0 :w 409600.0) + :buzzer 77 + :bottom-height (meters -20) + :run-packages '("common") + :wait-for-load #f + ) ) -;; definition for symbol snow, type level-load-info (define snow (new 'static 'level-load-info - :name 'snow - :visname 'snow-vis - :nickname 'sno - :index 15 - :packages '(snow) - :sound-banks '(snow) - :music-bank 'snow - :ambient-sounds '() - :mood '*snow-mood* - :mood-func 'update-mood-snow - :ocean #f - :sky #t - :sun-fade 0.5 - :continues - '((new 'static 'continue-point - :name "snow-start" - :level 'snow - :trans (new 'static 'vector :x 4256260.0 :y 983713.8 :z -14182752.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.7906 :w -0.6122) - :camera-trans (new 'static 'vector :x 4303859.5 :y 1012363.7 :z -14156672.0 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.4804 0.0 0.877 -0.2049 0.9723 -0.1122 -0.8527 -0.2336 -0.4671) - :load-commands '() - :vis-nick 'sno - :lev0 'snow - :disp0 'display - :lev1 'village3 - :disp1 'display - ) - (new 'static 'continue-point - :name "snow-fort" - :level 'snow - :trans (new 'static 'vector :x 3430875.2 :y 897149.3 :z -13397581.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.0968 :w 0.9952) - :camera-trans (new 'static 'vector :x 3428789.8 :y 918241.25 :z -13448724.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.9991 0.0 -0.0419 0.0051 0.9925 0.1216 0.0415 -0.1217 0.9916) - :load-commands '() - :vis-nick 'sno - :lev0 'snow - :disp0 'display - :lev1 'village3 - :disp1 'display + :index 15 + :name 'snow + :visname 'snow-vis + :nickname 'sno + :packages '(snow) + :sound-banks '(snow) + :music-bank 'snow + :ambient-sounds '() + :mood '*snow-mood* + :mood-func 'update-mood-snow + :ocean #f + :sky #t + :sun-fade 0.5 + :continues '((new 'static 'continue-point + :name "snow-start" + :level 'snow + :trans (new 'static 'vector :x 4256260.0 :y 983713.8 :z -14182752.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7906 :w -0.6122) + :camera-trans (new 'static 'vector :x 4303859.5 :y 1012363.7 :z -14156672.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.4804 0.0 0.877 -0.2049 0.9723 -0.1122 -0.8527 -0.2336 -0.4671) + :load-commands '() + :vis-nick 'sno + :lev0 'snow + :disp0 'display + :lev1 'village3 + :disp1 'display + ) + (new 'static 'continue-point + :name "snow-fort" + :level 'snow + :trans (new 'static 'vector :x 3430875.2 :y 897149.3 :z -13397581.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.0968 :w 0.9952) + :camera-trans (new 'static 'vector :x 3428789.8 :y 918241.25 :z -13448724.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9991 0.0 -0.0419 0.0051 0.9925 0.1216 0.0415 -0.1217 0.9916) + :load-commands '() + :vis-nick 'sno + :lev0 'snow + :disp0 'display + :lev1 'village3 + :disp1 'display + ) + (new 'static 'continue-point + :name "snow-flut-flut" + :level 'snow + :trans (new 'static 'vector :x 2481850.0 :y 1054709.4 :z -13922438.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.8628 :w -0.5055) + :camera-trans (new 'static 'vector :x 2497063.0 :y 1069339.9 :z -13900353.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.8224 0.0 0.5688 -0.135 0.9713 -0.1953 -0.5525 -0.2374 -0.7989) + :load-commands '() + :vis-nick 'sno + :lev0 'snow + :disp0 'display + :lev1 'village3 + :disp1 'display + ) + (new 'static 'continue-point + :name "snow-pass-to-fort" + :level 'snow + :trans (new 'static 'vector :x 3751044.8 :y 917612.1 :z -13828696.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.3387 :w -0.9408) + :camera-trans (new 'static 'vector :x 3779776.0 :y 933972.8 :z -13845825.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.6061 0.0 0.7953 -0.1493 0.9822 0.1138 -0.7812 -0.1878 0.5953) + :load-commands '() + :vis-nick 'sno + :lev0 'snow + :disp0 'display + :lev1 'village3 + :disp1 'display + ) + (new 'static 'continue-point + :name "snow-by-ice-lake" + :level 'snow + :trans (new 'static 'vector :x 3151164.5 :y 1049638.1 :z -14246464.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.6226 :w 0.7824) + :camera-trans (new 'static 'vector :x 3203905.2 :y 1080037.8 :z -14270850.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.4189 0.0 0.9079 -0.2169 0.971 0.1001 -0.8816 -0.2389 0.4068) + :load-commands '() + :vis-nick 'sno + :lev0 'snow + :disp0 'display + :lev1 'village3 + :disp1 'display + ) + (new 'static 'continue-point + :name "snow-by-ice-lake-alt" + :level 'snow + :trans (new 'static 'vector :x 3053335.0 :y 1048927.9 :z -14058945.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9997 :w 0.022) + :camera-trans (new 'static 'vector :x 3045845.5 :y 1068868.0 :z -14012568.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.987 0.0 -0.1601 0.0195 0.9924 -0.1207 0.1589 -0.1223 -0.9796) + :load-commands '() + :vis-nick 'sno + :lev0 'snow + :disp0 'display + :lev1 'village3 + :disp1 'display + ) + (new 'static 'continue-point + :name "snow-outside-fort" + :level 'snow + :trans (new 'static 'vector :x 3431014.0 :y 901474.7 :z -13600187.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.0954 :w -0.9954) + :camera-trans (new 'static 'vector :x 3429969.0 :y 922565.44 :z -13651353.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9998 0.0 -0.0196 0.0023 0.9926 0.1213 0.0195 -0.1213 0.9924) + :load-commands '() + :vis-nick 'sno + :lev0 'snow + :disp0 'display + :lev1 'village3 + :disp1 'display + ) + (new 'static 'continue-point + :name "snow-outside-cave" + :level 'snow + :trans (new 'static 'vector :x 3200864.2 :y 907400.4 :z -13676660.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.5867 :w -0.8097) + :camera-trans (new 'static 'vector :x 3247600.8 :y 928464.06 :z -13697606.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.4062 0.0 0.9137 -0.1107 0.9926 0.0492 -0.907 -0.1211 0.4032) + :load-commands '() + :vis-nick 'sno + :lev0 'snow + :disp0 'display + :lev1 'village3 + :disp1 'display + ) + (new 'static 'continue-point + :name "snow-across-from-flut" + :level 'snow + :trans (new 'static 'vector :x 2721898.5 :y 1049845.0 :z -13743428.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.7688 :w -0.6394) + :camera-trans (new 'static 'vector :x 2712702.5 :y 1070288.5 :z -13791593.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9554 0.0 -0.2951 0.0343 0.9932 0.1111 0.2931 -0.1163 0.9489) + :load-commands '() + :vis-nick 'sno + :lev0 'snow + :disp0 'display + :lev1 'village3 + :disp1 'display + ) ) - (new 'static 'continue-point - :name "snow-flut-flut" - :level 'snow - :trans (new 'static 'vector :x 2481850.0 :y 1054709.4 :z -13922438.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.8628 :w -0.5055) - :camera-trans (new 'static 'vector :x 2497063.0 :y 1069339.9 :z -13900353.0 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.8224 0.0 0.5688 -0.135 0.9713 -0.1953 -0.5525 -0.2374 -0.7989) - :load-commands '() - :vis-nick 'sno - :lev0 'snow - :disp0 'display - :lev1 'village3 - :disp1 'display - ) - (new 'static 'continue-point - :name "snow-pass-to-fort" - :level 'snow - :trans (new 'static 'vector :x 3751044.8 :y 917612.1 :z -13828696.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.3387 :w -0.9408) - :camera-trans (new 'static 'vector :x 3779776.0 :y 933972.8 :z -13845825.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.6061 0.0 0.7953 -0.1493 0.9822 0.1138 -0.7812 -0.1878 0.5953) - :load-commands '() - :vis-nick 'sno - :lev0 'snow - :disp0 'display - :lev1 'village3 - :disp1 'display - ) - (new 'static 'continue-point - :name "snow-by-ice-lake" - :level 'snow - :trans (new 'static 'vector :x 3151164.5 :y 1049638.1 :z -14246464.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.6226 :w 0.7824) - :camera-trans (new 'static 'vector :x 3203905.2 :y 1080037.8 :z -14270850.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.4189 0.0 0.9079 -0.2169 0.971 0.1001 -0.8816 -0.2389 0.4068) - :load-commands '() - :vis-nick 'sno - :lev0 'snow - :disp0 'display - :lev1 'village3 - :disp1 'display - ) - (new 'static 'continue-point - :name "snow-by-ice-lake-alt" - :level 'snow - :trans (new 'static 'vector :x 3053335.0 :y 1048927.9 :z -14058945.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.9997 :w 0.022) - :camera-trans (new 'static 'vector :x 3045845.5 :y 1068868.0 :z -14012568.0 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.987 0.0 -0.1601 0.0195 0.9924 -0.1207 0.1589 -0.1223 -0.9796) - :load-commands '() - :vis-nick 'sno - :lev0 'snow - :disp0 'display - :lev1 'village3 - :disp1 'display - ) - (new 'static 'continue-point - :name "snow-outside-fort" - :level 'snow - :trans (new 'static 'vector :x 3431014.0 :y 901474.7 :z -13600187.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.0954 :w -0.9954) - :camera-trans (new 'static 'vector :x 3429969.0 :y 922565.44 :z -13651353.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.9998 0.0 -0.0196 0.0023 0.9926 0.1213 0.0195 -0.1213 0.9924) - :load-commands '() - :vis-nick 'sno - :lev0 'snow - :disp0 'display - :lev1 'village3 - :disp1 'display - ) - (new 'static 'continue-point - :name "snow-outside-cave" - :level 'snow - :trans (new 'static 'vector :x 3200864.2 :y 907400.4 :z -13676660.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.5867 :w -0.8097) - :camera-trans (new 'static 'vector :x 3247600.8 :y 928464.06 :z -13697606.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.4062 0.0 0.9137 -0.1107 0.9926 0.0492 -0.907 -0.1211 0.4032) - :load-commands '() - :vis-nick 'sno - :lev0 'snow - :disp0 'display - :lev1 'village3 - :disp1 'display - ) - (new 'static 'continue-point - :name "snow-across-from-flut" - :level 'snow - :trans (new 'static 'vector :x 2721898.5 :y 1049845.0 :z -13743428.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.7688 :w -0.6394) - :camera-trans (new 'static 'vector :x 2712702.5 :y 1070288.5 :z -13791593.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.9554 0.0 -0.2951 0.0343 0.9932 0.1111 0.2931 -0.1163 0.9489) - :load-commands '() - :vis-nick 'sno - :lev0 'snow - :disp0 'display - :lev1 'village3 - :disp1 'display - ) - ) - :tasks '((the binteger 60) (the binteger 61) (the binteger 62) (the binteger 63) (the binteger 64) (the binteger 66) (the binteger 67) (the binteger 65)) - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x 3072000.0 :y 1142784.0 :z -14028800.0 :w 1290240.0) - :buzzer 65 - :bottom-height (meters 128.0) - :run-packages '("common") - :wait-for-load #f - ) + :tasks '(60 61 62 63 64 66 67 65) + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 3072000.0 :y 1142784.0 :z -14028800.0 :w 1290240.0) + :buzzer 65 + :bottom-height (meters 128) + :run-packages '("common") + :wait-for-load #f + ) ) -;; definition for symbol maincave, type level-load-info (define maincave (new 'static 'level-load-info - :name 'maincave - :visname 'maincave-vis - :nickname 'mai - :index 16 - :packages '(maincave) - :sound-banks '(maincave) - :music-bank 'maincave - :ambient-sounds '() - :mood '*maincave-mood* - :mood-func 'update-mood-maincave - :ocean #f - :sky #f - :continues - '((new 'static 'continue-point - :name "maincave-start" - :level 'maincave - :trans (new 'static 'vector :x 4420967.0 :y 33006.387 :z -13154230.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.0174 :w -0.9998) - :camera-trans (new 'static 'vector :x 4428164.5 :y 54074.164 :z -13204933.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.99 0.0 0.1405 -0.0169 0.9927 0.1192 -0.1395 -0.1204 0.9828) - :load-commands '() - :vis-nick 'mai - :lev0 'maincave - :disp0 'display - :lev1 'village3 - :disp1 'display - ) - (new 'static 'continue-point - :name "maincave-to-darkcave" - :level 'maincave - :trans (new 'static 'vector :x 4172175.8 :y 154223.83 :z -12445165.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.2093 :w 0.9778) - :camera-trans (new 'static 'vector :x 4193893.2 :y 175317.81 :z -12491520.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.9052 0.0 0.4248 -0.0514 0.9926 0.1096 -0.4217 -0.1211 0.8986) - :load-commands '() - :vis-nick 'mai - :lev0 'maincave - :disp0 'display - :lev1 'darkcave - :disp1 #f + :index 16 + :name 'maincave + :visname 'maincave-vis + :nickname 'mai + :packages '(maincave) + :sound-banks '(maincave) + :music-bank 'maincave + :ambient-sounds '() + :mood '*maincave-mood* + :mood-func 'update-mood-maincave + :ocean #f + :sky #f + :continues '((new 'static 'continue-point + :name "maincave-start" + :level 'maincave + :trans (new 'static 'vector :x 4420967.0 :y 33006.387 :z -13154230.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.0174 :w -0.9998) + :camera-trans (new 'static 'vector :x 4428164.5 :y 54074.164 :z -13204933.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.99 0.0 0.1405 -0.0169 0.9927 0.1192 -0.1395 -0.1204 0.9828) + :load-commands '() + :vis-nick 'mai + :lev0 'maincave + :disp0 'display + :lev1 'village3 + :disp1 'display + ) + (new 'static 'continue-point + :name "maincave-to-darkcave" + :level 'maincave + :trans (new 'static 'vector :x 4172175.8 :y 154223.83 :z -12445165.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.2093 :w 0.9778) + :camera-trans (new 'static 'vector :x 4193893.2 :y 175317.81 :z -12491520.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9052 0.0 0.4248 -0.0514 0.9926 0.1096 -0.4217 -0.1211 0.8986) + :load-commands '() + :vis-nick 'mai + :lev0 'maincave + :disp0 'display + :lev1 'darkcave + :disp1 #f + ) + (new 'static 'continue-point + :name "maincave-to-robocave" + :level 'maincave + :trans (new 'static 'vector :x 4760896.5 :y 44221.234 :z -12409880.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.548 :w 0.8364) + :camera-trans (new 'static 'vector :x 4745230.0 :y 57869.926 :z -12426885.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7343 0.0 -0.6788 0.1872 0.9611 0.2026 0.6524 -0.2759 0.7058) + :load-commands '() + :vis-nick 'mai + :lev0 'maincave + :disp0 'display + :lev1 'robocave + :disp1 #f + ) ) - (new 'static 'continue-point - :name "maincave-to-robocave" - :level 'maincave - :trans (new 'static 'vector :x 4760896.5 :y 44221.234 :z -12409880.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.548 :w 0.8364) - :camera-trans (new 'static 'vector :x 4745230.0 :y 57869.926 :z -12426885.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.7343 0.0 -0.6788 0.1872 0.9611 0.2026 0.6524 -0.2759 0.7058) - :load-commands '() - :vis-nick 'mai - :lev0 'maincave - :disp0 'display - :lev1 'robocave - :disp1 #f - ) - ) - :tasks '((the binteger 78) (the binteger 79) (the binteger 80) (the binteger 81) (the binteger 82) (the binteger 83) (the binteger 84) (the binteger 85)) - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x 4517888.0 :y 114688.0 :z -12484608.0 :w 655360.0) - :buzzer 85 - :bottom-height (meters -60.0) - :run-packages '("common") - :wait-for-load #f - ) + :tasks '(78 79 80 81 82 83 84 85) + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 4517888.0 :y 114688.0 :z -12484608.0 :w 655360.0) + :buzzer 85 + :bottom-height (meters -60) + :run-packages '("common") + :wait-for-load #f + ) ) -;; definition for symbol darkcave, type level-load-info (define darkcave - (new 'static 'level-load-info - :name 'darkcave - :visname 'darkcave-vis - :nickname 'dar - :index 17 - :packages '(darkcave) - :sound-banks '(darkcave) - :music-bank 'maincave - :ambient-sounds '() - :mood '*darkcave-mood* - :mood-func 'update-mood-darkcave - :ocean #f - :sky #f - :continues - '((new 'static 'continue-point - :name "darkcave-start" - :level 'darkcave - :trans (new 'static 'vector :x 3813246.2 :y 129487.664 :z -12114304.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.1439 :w 0.9895) - :camera-trans (new 'static 'vector :x 3793301.0 :y 145573.48 :z -12139847.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.7892 0.0 -0.614 0.1178 0.9813 0.1515 0.6026 -0.1919 0.7745) - :load-commands '() - :vis-nick 'dar - :lev0 'maincave - :disp0 'display - :lev1 'darkcave - :disp1 'display - ) - ) - :tasks '() - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x 3620864.0 :y 266240.0 :z -11935744.0 :w 368640.0) - :buzzer 85 - :bottom-height (meters -60.0) - :run-packages '("common" "maincave") - :wait-for-load #t - ) - ) - -;; definition for symbol robocave, type level-load-info -(define robocave - (new 'static 'level-load-info - :name-list - (new 'static 'array symbol 3 'robocave 'robocave-vis 'rob) - :index 18 - :packages '(robocave) - :sound-banks '(robocave) - :music-bank 'maincave - :ambient-sounds '() - :mood '*robocave-mood* - :mood-func 'update-mood-robocave - :ocean #f - :sky #f - :continues - '((new 'static 'continue-point - :name "robocave-start" - :level 'robocave - :trans (new 'static 'vector :x 5208223.5 :y 69697.945 :z -11781496.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.3654 :w -0.9308) - :camera-trans (new 'static 'vector :x 5171715.0 :y 90796.85 :z -11817413.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.7006 0.0 -0.7134 0.0864 0.9926 0.0849 0.7082 -0.1212 0.6954) - :load-commands '() - :vis-nick 'rob - :lev0 'maincave - :disp0 'display - :lev1 'robocave - :disp1 'display - ) - (new 'static 'continue-point - :name "robocave-bottom" - :level 'robocave - :trans (new 'static 'vector :x 5435461.5 :y -97111.24 :z -11588379.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.1086 :w 0.994) - :camera-trans (new 'static 'vector :x 5409966.5 :y -76017.664 :z -11632764.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.8662 0.0 -0.4996 0.0605 0.9926 0.105 0.4959 -0.1212 0.8598) - :load-commands '() - :vis-nick 'rob - :lev0 'maincave - :disp0 'display - :lev1 'robocave - :disp1 'display - ) - ) - :tasks '() - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x 5529600.0 :y 81920.0 :z -11468800.0 :w 512000.0) - :buzzer 85 - :bottom-height (meters -60.0) - :run-packages '("common" "maincave") - :wait-for-load #t - ) - ) - -;; definition for symbol lavatube, type level-load-info -(define lavatube - (new 'static 'level-load-info - :name 'lavatube - :visname 'lavatube-vis - :nickname 'lav - :index 19 - :packages '(lavatube) - :sound-banks '(lavatube) - :music-bank 'lavatube - :ambient-sounds '() - :mood '*lavatube-mood* - :mood-func 'update-mood-lavatube - :ocean #f - :sky #f - :continues - '((new 'static 'continue-point - :name "lavatube-start" - :level 'lavatube - :trans (new 'static 'vector :x 5511317.0 :y 159871.8 :z -14621239.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.3753 :w -0.9268) - :camera-trans (new 'static 'vector :x 5510636.5 :y 197720.06 :z -14663128.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.9992 0.0 -0.0386 0.0178 0.8875 0.4603 0.0343 -0.4606 0.8868) - :load-commands '() - :vis-nick 'lav - :lev0 'lavatube - :disp0 'display - :lev1 'village3 - :disp1 'display - ) - (new 'static 'continue-point - :name "lavatube-middle" - :level 'lavatube - :trans (new 'static 'vector :x 9081441.0 :y -3935.8464 :z -14056285.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.7002 :w -0.7139) - :camera-trans (new 'static 'vector :x 9055362.0 :y 10606.592 :z -14050822.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.205 0.0 -0.9787 0.2321 0.9714 -0.0486 0.9508 -0.2371 -0.1991) - :load-commands '() - :vis-nick 'lav - :lev0 'lavatube - :disp0 'display - :lev1 'village3 - :disp1 #f - ) - (new 'static 'continue-point - :name "lavatube-after-ribbon" - :level 'lavatube - :trans (new 'static 'vector :x 9954895.0 :y 390513.06 :z -16548614.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.7485 :w -0.663) - :camera-trans (new 'static 'vector :x 9923721.0 :y 406466.16 :z -16541633.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.2191 0.0 -0.9756 0.1906 0.9807 -0.0428 0.9568 -0.1953 -0.2149) - :load-commands '() - :vis-nick 'lav - :lev0 'lavatube - :disp0 'display - :lev1 'citadel - :disp1 #f - ) - (new 'static 'continue-point - :name "lavatube-end" - :level 'lavatube - :trans (new 'static 'vector :x 11479892.0 :y -163656.5 :z -18266490.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.9589 :w -0.2836) - :camera-trans (new 'static 'vector :x 11526721.0 :y -143482.47 :z -18257412.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.3027 0.0 0.953 -0.1235 0.9915 -0.0392 -0.945 -0.1296 -0.3001) - :load-commands '() - :vis-nick 'lav - :lev0 'lavatube - :disp0 'display - :lev1 'citadel - :disp1 'display - ) - ) - :tasks '((the binteger 89) (the binteger 90)) - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x 8806400.0 :y 131072.0 :z -15564800.0 :w 3174400.0) - :buzzer 90 - :bottom-height (meters -70.0) - :run-packages '("common") - :wait-for-load #t - ) - ) - -;; definition for symbol citadel, type level-load-info -(define citadel - (new 'static 'level-load-info - :name 'citadel - :visname 'citadel-vis - :nickname 'cit - :index 20 - :packages '(citadel) - :sound-banks '(citadel) - :music-bank 'citadel - :ambient-sounds '() - :mood '*citadel-mood* - :mood-func 'update-mood-citadel - :ocean #f - :sky #f - :continues - '((new 'static 'continue-point - :name "citadel-start" - :level 'citadel - :trans (new 'static 'vector :x 11442706.0 :y -142755.84 :z -18869044.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.9992 :w 0.0392) - :camera-trans (new 'static 'vector :x 11441183.0 :y -122509.31 :z -18820882.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9991 0.0 -0.0411 0.005 0.9925 -0.122 0.0408 -0.1221 -0.9916) - :load-commands '() - :vis-nick 'cit - :lev0 'citadel - :disp0 'display - :lev1 'lavatube - :disp1 #f - ) - (new 'static 'continue-point - :name "citadel-entrance" - :level 'citadel - :trans (new 'static 'vector :x 11443969.0 :y -154216.03 :z -18472782.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.9728 :w 0.2314) - :camera-trans (new 'static 'vector :x 11436929.0 :y -134244.36 :z -18426254.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9898 0.0 -0.1424 0.0173 0.9925 -0.1207 0.1413 -0.1219 -0.9824) - :load-commands '() - :vis-nick 'cit - :lev0 'citadel - :disp0 'display - :lev1 'lavatube - :disp1 'display - ) - (new 'static 'continue-point - :name "citadel-warp" - :level 'citadel - :flags #x4 - :trans (new 'static 'vector :x 11454895.0 :y -161791.6 :z -18204690.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.7511 :w 0.6601) - :camera-trans (new 'static 'vector :x 11406872.0 :y -141278.0 :z -18194638.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.1989 0.0 -0.98 0.1179 0.9927 -0.0239 0.9728 -0.1203 -0.1974) - :load-commands '() - :vis-nick 'cit - :lev0 'citadel - :disp0 'display - :lev1 'lavatube - :disp1 'display - ) - (new 'static 'continue-point - :name "citadel-launch-start" - :level 'citadel - :trans (new 'static 'vector :x 10827551.0 :y -94047.02 :z -18946718.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.8377 :w -0.546) - :camera-trans (new 'static 'vector :x 10862150.0 :y -75343.875 :z -18922316.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.5766 0.0 0.8169 -0.1125 0.9904 -0.0794 -0.8091 -0.1378 -0.5711) - :load-commands '() - :vis-nick 'cit - :lev0 'citadel - :disp0 'display - :lev1 'lavatube - :disp1 #f - ) - (new 'static 'continue-point - :name "citadel-launch-end" - :level 'citadel - :trans (new 'static 'vector :x 11047507.0 :y -81514.086 :z -19495960.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.0292 :w 0.9995) - :camera-trans (new 'static 'vector :x 11033498.0 :y -63027.2 :z -19534916.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.9413 0.0 -0.3373 0.0481 0.9897 0.1343 0.3339 -0.1427 0.9317) - :load-commands '() - :vis-nick 'cit - :lev0 'citadel - :disp0 'display - :lev1 'finalboss - :disp1 #f - ) - (new 'static 'continue-point - :name "citadel-plat-start" - :level 'citadel - :trans (new 'static 'vector :x 11443470.0 :y -120194.664 :z -19845628.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.9907 :w -0.1355) - :camera-trans (new 'static 'vector :x 11443545.0 :y -99100.266 :z -19794374.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9999 0.0 0.0016 -0.0001 0.9926 -0.1207 -0.0015 -0.1207 -0.9926) - :load-commands '() - :vis-nick 'cit - :lev0 'citadel - :disp0 'display - :lev1 'finalboss - :disp1 #f - ) - (new 'static 'continue-point - :name "citadel-plat-end" - :level 'citadel - :trans (new 'static 'vector :x 11269726.0 :y -12132.352 :z -19614712.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.0419 :w 0.9991) - :camera-trans (new 'static 'vector :x 11264449.0 :y 7920.8447 :z -19661710.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.9938 0.0 -0.1103 0.0134 0.9924 0.1215 0.1095 -0.1223 0.9864) - :load-commands '() - :vis-nick 'cit - :lev0 'citadel - :disp0 'display - :lev1 'finalboss - :disp1 #f - ) - (new 'static 'continue-point - :name "citadel-generator-start" - :level 'citadel - :trans (new 'static 'vector :x 12138031.0 :y -36900.863 :z -18933304.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.7487 :w 0.6628) - :camera-trans (new 'static 'vector :x 12101831.0 :y -19811.123 :z -18933632.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.0093 0.0 -0.9999 0.1678 0.9858 0.0015 0.9857 -0.1678 0.0092) - :load-commands '() - :vis-nick 'cit - :lev0 'citadel - :disp0 'display - :lev1 'finalboss - :disp1 #f - ) - (new 'static 'continue-point - :name "citadel-generator-end" - :level 'citadel - :trans (new 'static 'vector :x 11837483.0 :y -20177.715 :z -19506848.0 :w 1.0) - :quat (new 'static 'quaternion :y -0.3564 :w 0.9342) - :camera-trans (new 'static 'vector :x 11872697.0 :y 887.6032 :z -19544198.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.7296 0.0 0.6838 -0.0851 0.9922 0.0908 -0.6785 -0.1245 0.7239) - :load-commands '() - :vis-nick #f - :lev0 'citadel - :disp0 'display - :lev1 #f - :disp1 #f - ) - (new 'static 'continue-point - :name "citadel-elevator" - :level 'citadel - :trans (new 'static 'vector :x 11447961.0 :y 234055.27 :z -19169000.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.2351 :w 0.9719) - :camera-trans (new 'static 'vector :x 11454465.0 :y 252947.66 :z -19126656.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9932 0.0 0.1161 -0.017 0.9892 -0.1454 -0.1148 -0.1464 -0.9825) - :load-commands '() - :vis-nick 'cit - :lev0 'citadel - :disp0 'display - :lev1 'finalboss - :disp1 #f - ) - ) - :tasks '((the binteger 70) (the binteger 71) (the binteger 72) (the binteger 73) (the binteger 91)) - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x 11436032.0 :y -462848.0 :z -19750912.0 :w 1228800.0) - :buzzer 91 - :bottom-height (meters -114.0) - :run-packages '("common") - :wait-for-load #t - ) - ) - -;; definition for symbol finalboss, type level-load-info -(define finalboss - (new 'static 'level-load-info - :name 'finalboss - :visname 'finalboss-vis - :nickname 'fin - :index 21 - :packages '(finalboss) - :sound-banks '(finalboss) - :music-bank 'finalboss - :ambient-sounds '() - :mood '*finalboss-mood* - :mood-func 'update-mood-finalboss - :ocean #f - :sky #t - :sun-fade 1.0 - :continues - '((new 'static 'continue-point - :name "finalboss-start" - :level 'finalboss - :trans (new 'static 'vector :x 11548456.0 :y 2215872.0 :z -19409498.0 :w 1.0) - :quat (new 'static 'quaternion :y 0.7325 :w 0.6807) - :camera-trans (new 'static 'vector :x 11513311.0 :y 2234999.5 :z -19435708.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.5883 0.0 -0.8085 0.1074 0.9911 0.0781 0.8014 -0.1328 0.5831) - :load-commands '((special "citb-exit-plat-4" #t)) - :vis-nick 'fin - :lev0 'finalboss - :disp0 'display - :lev1 'citadel - :disp1 'special - ) - (new 'static 'continue-point - :name "finalboss-fight" - :level 'finalboss - :trans - (new 'static 'vector :x 12288335.0 :y 1970461.9 :z -19848522.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.5359 :w -0.8442) - :camera-trans - (new 'static 'vector :x 12265366.0 :y 1984228.5 :z -19842574.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.243 0.0 -0.97 0.2594 0.9635 -0.065 0.9346 -0.2675 -0.2341) - :load-commands '((special "citb-exit-plat-4" #t)) - :vis-nick 'fin - :lev0 'finalboss - :disp0 'display - :lev1 'citadel - :disp1 'special - ) - ) - :tasks '() - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x 11837440.0 :y 2129920.0 :z -19578880.0 :w 778240.0) - :buzzer 91 - :bottom-height (meters -114.0) - :run-packages '("common") - :wait-for-load #f - ) - ) - -;; definition for symbol intro, type level-load-info -(define intro - (new 'static 'level-load-info - :name 'intro - :visname 'intro-vis - :nickname 'int - :index 22 - :packages '(intro) - :sound-banks '() - :music-bank #f - :ambient-sounds '() - :mood '*default-mood* - :mood-func 'update-mood-default - :ocean #f - :sky #f - :continues '() - :tasks '() - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere) - :bottom-height (meters -10000000.0) - :run-packages '("common") - :wait-for-load #f - ) - ) - -;; definition for symbol demo, type level-load-info -(define demo - (new 'static 'level-load-info - :name 'demo - :visname 'demo-vis - :nickname 'dem - :index 23 - :packages '() - :sound-banks '(village1) - :music-bank 'village1 - :ambient-sounds '() - :mood '*default-mood* - :mood-func 'update-mood-default - :ocean #f - :sky #f - :continues - '((new 'static 'continue-point - :name "demo-start" - :level 'demo - :flags #x8 - :trans (new 'static 'vector :x 66396.16 :y 29782.016 :z -919973.5 :w 1.0) - :quat (new 'static 'quaternion :w 1.0) - :camera-trans (new 'static 'vector :x 76871.68 :y 55061.707 :z -938752.0 :w 1.0) - :camera-rot (new 'static 'array float 9 0.8743 0.0 0.4852 -0.2117 0.8997 0.3816 -0.4365 -0.4364 0.7866) - :load-commands '() - :vis-nick 'dem - :lev0 'demo - :disp0 'special - :lev1 #f - :disp1 #f - ) - ) - :tasks '() - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere) - :bottom-height (meters -10000000.0) - :run-packages '("common") - :wait-for-load #f - ) - ) - -;; definition for symbol title, type level-load-info -(define title - (new 'static 'level-load-info - :name 'title - :visname 'title-vis - :nickname 'tit - :index 24 - :packages '() - :sound-banks '() - :music-bank 'village1 - :ambient-sounds '() - :mood '*village1-mood* - :mood-func 'update-mood-village1 - :ocean #f - :sky #f - :continues - '((new 'static 'continue-point - :name "title-start" - :level 'title - :flags #x80 - :trans (new 'static 'vector :x -635598.9 :y 222551.66 :z 710496.25 :w 1.0) - :quat (new 'static 'quaternion :y -0.3323 :w -0.9431) - :camera-trans (new 'static 'vector :x -665644.25 :y 250803.0 :z 668470.9 :w 1.0) - :camera-rot (new 'static 'array float 9 0.8129 0.0 -0.5823 0.0958 0.9863 0.1337 0.5744 -0.1645 0.8018) - :load-commands '() - :vis-nick 'tit - :lev0 'title - :disp0 'special - :lev1 'village1 - :disp1 #f - ) - ) - :tasks '() - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :x -40960.0 :z 40960.0 :w 1126400.0) - :bottom-height (meters -10000000.0) - :run-packages '("common") - :wait-for-load #f - ) - ) - -;; definition for symbol halfpipe, type level-load-info -(define halfpipe - (new 'static 'level-load-info - :name-list - (new 'static 'array symbol 3 'halfpipe 'halfpipe-vis 'none) - :index 25 - :packages '() - :sound-banks '() - :music-bank #f - :ambient-sounds '() - :mood '*default-mood* - :mood-func 'update-mood-default - :ocean #f - :sky #t - :sun-fade 1.0 - :continues - '((new 'static 'continue-point - :name "halfpipe" - :level 'halfpipe - :trans (new 'static 'vector :x -1048.9856 :y -172047.97 :z -212555.78 :w 1.0) - :quat (new 'static 'quaternion :y 0.061 :w 0.9981) - :camera-trans (new 'static 'vector :x -9941.401 :y -150049.17 :z -159587.94 :w 1.0) - :camera-rot (new 'static 'array float 9 -0.979 0.0 -0.2037 0.0545 0.9634 -0.2622 0.1963 -0.2678 -0.9432) - :load-commands '() - :vis-nick #f - :lev0 'halfpipe - :disp0 'display - :lev1 #f - :disp1 #f - ) - ) - :tasks '() - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :w 167772160000.0) - :bottom-height (meters -10000000.0) - :run-packages '() - :wait-for-load #t - ) - ) - -;; definition for symbol default-level, type level-load-info -(define default-level - (new 'static 'level-load-info - :name 'default-level - :visname 'default-level-vis - :nickname 'none - :index 26 - :packages '() - :sound-banks '() - :music-bank #f - :ambient-sounds '() - :mood '*default-mood* - :mood-func 'update-mood-default - :ocean #f - :sky #t - :continues '() - :tasks '() - :priority 100 - :load-commands '() - :alt-load-commands '() - :bsp-mask #xffffffffffffffff - :bsphere (new 'static 'sphere :w 167772160000.0) - :bottom-height (meters -20.0) - :run-packages '() - :wait-for-load #t - ) - ) - -;; definition for symbol *level-load-list*, type pair -(define *level-load-list* - '(training - village1 - beach - jungle - jungleb - misty - firecanyon - village2 - sunken - sunkenb - swamp - rolling - ogre - village3 - snow - maincave - darkcave - robocave - lavatube - citadel - finalboss - intro - demo - title - halfpipe - default-level + (new 'static 'level-load-info + :index 17 + :name 'darkcave + :visname 'darkcave-vis + :nickname 'dar + :packages '(darkcave) + :sound-banks '(darkcave) + :music-bank 'maincave + :ambient-sounds '() + :mood '*darkcave-mood* + :mood-func 'update-mood-darkcave + :ocean #f + :sky #f + :continues '((new 'static 'continue-point + :name "darkcave-start" + :level 'darkcave + :trans (new 'static 'vector :x 3813246.2 :y 129487.664 :z -12114304.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.1439 :w 0.9895) + :camera-trans (new 'static 'vector :x 3793301.0 :y 145573.48 :z -12139847.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7892 0.0 -0.614 0.1178 0.9813 0.1515 0.6026 -0.1919 0.7745) + :load-commands '() + :vis-nick 'dar + :lev0 'maincave + :disp0 'display + :lev1 'darkcave + :disp1 'display + ) ) + :tasks '() + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 3620864.0 :y 266240.0 :z -11935744.0 :w 368640.0) + :buzzer 85 + :bottom-height (meters -60) + :run-packages '("common" "maincave") + :wait-for-load #t + ) ) + +(define robocave + (new 'static 'level-load-info + :index 18 + :name 'robocave + :visname 'robocave-vis + :nickname 'rob + :packages '(robocave) + :sound-banks '(robocave) + :music-bank 'maincave + :ambient-sounds '() + :mood '*robocave-mood* + :mood-func 'update-mood-robocave + :ocean #f + :sky #f + :continues '((new 'static 'continue-point + :name "robocave-start" + :level 'robocave + :trans (new 'static 'vector :x 5208223.5 :y 69697.945 :z -11781496.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.3654 :w -0.9308) + :camera-trans (new 'static 'vector :x 5171715.0 :y 90796.85 :z -11817413.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7006 0.0 -0.7134 0.0864 0.9926 0.0849 0.7082 -0.1212 0.6954) + :load-commands '() + :vis-nick 'rob + :lev0 'maincave + :disp0 'display + :lev1 'robocave + :disp1 'display + ) + (new 'static 'continue-point + :name "robocave-bottom" + :level 'robocave + :trans (new 'static 'vector :x 5435461.5 :y -97111.24 :z -11588379.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.1086 :w 0.994) + :camera-trans (new 'static 'vector :x 5409966.5 :y -76017.664 :z -11632764.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8662 0.0 -0.4996 0.0605 0.9926 0.105 0.4959 -0.1212 0.8598) + :load-commands '() + :vis-nick 'rob + :lev0 'maincave + :disp0 'display + :lev1 'robocave + :disp1 'display + ) + ) + :tasks '() + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 5529600.0 :y 81920.0 :z -11468800.0 :w 512000.0) + :buzzer 85 + :bottom-height (meters -60) + :run-packages '("common" "maincave") + :wait-for-load #t + ) + ) + +(define lavatube + (new 'static 'level-load-info + :index 19 + :name 'lavatube + :visname 'lavatube-vis + :nickname 'lav + :packages '(lavatube) + :sound-banks '(lavatube) + :music-bank 'lavatube + :ambient-sounds '() + :mood '*lavatube-mood* + :mood-func 'update-mood-lavatube + :ocean #f + :sky #f + :continues '((new 'static 'continue-point + :name "lavatube-start" + :level 'lavatube + :trans (new 'static 'vector :x 5511317.0 :y 159871.8 :z -14621239.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.3753 :w -0.9268) + :camera-trans (new 'static 'vector :x 5510636.5 :y 197720.06 :z -14663128.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9992 0.0 -0.0386 0.0178 0.8875 0.4603 0.0343 -0.4606 0.8868) + :load-commands '() + :vis-nick 'lav + :lev0 'lavatube + :disp0 'display + :lev1 'village3 + :disp1 'display + ) + (new 'static 'continue-point + :name "lavatube-middle" + :level 'lavatube + :trans (new 'static 'vector :x 9081441.0 :y -3935.8464 :z -14056285.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.7002 :w -0.7139) + :camera-trans (new 'static 'vector :x 9055362.0 :y 10606.592 :z -14050822.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.205 0.0 -0.9787 0.2321 0.9714 -0.0486 0.9508 -0.2371 -0.1991) + :load-commands '() + :vis-nick 'lav + :lev0 'lavatube + :disp0 'display + :lev1 'village3 + :disp1 #f + ) + (new 'static 'continue-point + :name "lavatube-after-ribbon" + :level 'lavatube + :trans (new 'static 'vector :x 9954895.0 :y 390513.06 :z -16548614.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.7485 :w -0.663) + :camera-trans (new 'static 'vector :x 9923721.0 :y 406466.16 :z -16541633.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.2191 0.0 -0.9756 0.1906 0.9807 -0.0428 0.9568 -0.1953 -0.2149) + :load-commands '() + :vis-nick 'lav + :lev0 'lavatube + :disp0 'display + :lev1 'citadel + :disp1 #f + ) + (new 'static 'continue-point + :name "lavatube-end" + :level 'lavatube + :trans (new 'static 'vector :x 11479892.0 :y -163656.5 :z -18266490.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9589 :w -0.2836) + :camera-trans (new 'static 'vector :x 11526721.0 :y -143482.47 :z -18257412.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.3027 0.0 0.953 -0.1235 0.9915 -0.0392 -0.945 -0.1296 -0.3001) + :load-commands '() + :vis-nick 'lav + :lev0 'lavatube + :disp0 'display + :lev1 'citadel + :disp1 'display + ) + ) + :tasks '(89 90) + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 8806400.0 :y 131072.0 :z -15564800.0 :w 3174400.0) + :buzzer 90 + :bottom-height (meters -70) + :run-packages '("common") + :wait-for-load #t + ) + ) + +(define citadel + (new 'static 'level-load-info + :index 20 + :name 'citadel + :visname 'citadel-vis + :nickname 'cit + :packages '(citadel) + :sound-banks '(citadel) + :music-bank 'citadel + :ambient-sounds '() + :mood '*citadel-mood* + :mood-func 'update-mood-citadel + :ocean #f + :sky #f + :continues '((new 'static 'continue-point + :name "citadel-start" + :level 'citadel + :trans (new 'static 'vector :x 11442706.0 :y -142755.84 :z -18869044.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9992 :w 0.0392) + :camera-trans (new 'static 'vector :x 11441183.0 :y -122509.31 :z -18820882.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9991 0.0 -0.0411 0.005 0.9925 -0.122 0.0408 -0.1221 -0.9916) + :load-commands '() + :vis-nick 'cit + :lev0 'citadel + :disp0 'display + :lev1 'lavatube + :disp1 #f + ) + (new 'static 'continue-point + :name "citadel-entrance" + :level 'citadel + :trans (new 'static 'vector :x 11443969.0 :y -154216.03 :z -18472782.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9728 :w 0.2314) + :camera-trans (new 'static 'vector :x 11436929.0 :y -134244.36 :z -18426254.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9898 0.0 -0.1424 0.0173 0.9925 -0.1207 0.1413 -0.1219 -0.9824) + :load-commands '() + :vis-nick 'cit + :lev0 'citadel + :disp0 'display + :lev1 'lavatube + :disp1 'display + ) + (new 'static 'continue-point + :name "citadel-warp" + :level 'citadel + :flags (continue-flags warp) + :trans (new 'static 'vector :x 11454895.0 :y -161791.6 :z -18204690.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7511 :w 0.6601) + :camera-trans (new 'static 'vector :x 11406872.0 :y -141278.0 :z -18194638.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.1989 0.0 -0.98 0.1179 0.9927 -0.0239 0.9728 -0.1203 -0.1974) + :load-commands '() + :vis-nick 'cit + :lev0 'citadel + :disp0 'display + :lev1 'lavatube + :disp1 'display + ) + (new 'static 'continue-point + :name "citadel-launch-start" + :level 'citadel + :trans (new 'static 'vector :x 10827551.0 :y -94047.02 :z -18946718.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.8377 :w -0.546) + :camera-trans (new 'static 'vector :x 10862150.0 :y -75343.875 :z -18922316.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.5766 0.0 0.8169 -0.1125 0.9904 -0.0794 -0.8091 -0.1378 -0.5711) + :load-commands '() + :vis-nick 'cit + :lev0 'citadel + :disp0 'display + :lev1 'lavatube + :disp1 #f + ) + (new 'static 'continue-point + :name "citadel-launch-end" + :level 'citadel + :trans (new 'static 'vector :x 11047507.0 :y -81514.086 :z -19495960.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.0292 :w 0.9995) + :camera-trans (new 'static 'vector :x 11033498.0 :y -63027.2 :z -19534916.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9413 0.0 -0.3373 0.0481 0.9897 0.1343 0.3339 -0.1427 0.9317) + :load-commands '() + :vis-nick 'cit + :lev0 'citadel + :disp0 'display + :lev1 'finalboss + :disp1 #f + ) + (new 'static 'continue-point + :name "citadel-plat-start" + :level 'citadel + :trans (new 'static 'vector :x 11443470.0 :y -120194.664 :z -19845628.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9907 :w -0.1355) + :camera-trans (new 'static 'vector :x 11443545.0 :y -99100.266 :z -19794374.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9999 0.0 0.0016 -0.0001 0.9926 -0.1207 -0.0015 -0.1207 -0.9926) + :load-commands '() + :vis-nick 'cit + :lev0 'citadel + :disp0 'display + :lev1 'finalboss + :disp1 #f + ) + (new 'static 'continue-point + :name "citadel-plat-end" + :level 'citadel + :trans (new 'static 'vector :x 11269726.0 :y -12132.352 :z -19614712.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.0419 :w 0.9991) + :camera-trans (new 'static 'vector :x 11264449.0 :y 7920.8447 :z -19661710.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9938 0.0 -0.1103 0.0134 0.9924 0.1215 0.1095 -0.1223 0.9864) + :load-commands '() + :vis-nick 'cit + :lev0 'citadel + :disp0 'display + :lev1 'finalboss + :disp1 #f + ) + (new 'static 'continue-point + :name "citadel-generator-start" + :level 'citadel + :trans (new 'static 'vector :x 12138031.0 :y -36900.863 :z -18933304.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7487 :w 0.6628) + :camera-trans (new 'static 'vector :x 12101831.0 :y -19811.123 :z -18933632.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.0093 0.0 -0.9999 0.1678 0.9858 0.0015 0.9857 -0.1678 0.0092) + :load-commands '() + :vis-nick 'cit + :lev0 'citadel + :disp0 'display + :lev1 'finalboss + :disp1 #f + ) + (new 'static 'continue-point + :name "citadel-generator-end" + :level 'citadel + :trans (new 'static 'vector :x 11837483.0 :y -20177.715 :z -19506848.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.3564 :w 0.9342) + :camera-trans (new 'static 'vector :x 11872697.0 :y 887.6032 :z -19544198.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7296 0.0 0.6838 -0.0851 0.9922 0.0908 -0.6785 -0.1245 0.7239) + :load-commands '() + :vis-nick #f + :lev0 'citadel + :disp0 'display + :lev1 #f + :disp1 #f + ) + (new 'static 'continue-point + :name "citadel-elevator" + :level 'citadel + :trans (new 'static 'vector :x 11447961.0 :y 234055.27 :z -19169000.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.2351 :w 0.9719) + :camera-trans (new 'static 'vector :x 11454465.0 :y 252947.66 :z -19126656.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9932 0.0 0.1161 -0.017 0.9892 -0.1454 -0.1148 -0.1464 -0.9825) + :load-commands '() + :vis-nick 'cit + :lev0 'citadel + :disp0 'display + :lev1 'finalboss + :disp1 #f + ) + ) + :tasks '(70 71 72 73 91) + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 11436032.0 :y -462848.0 :z -19750912.0 :w 1228800.0) + :buzzer 91 + :bottom-height (meters -114) + :run-packages '("common") + :wait-for-load #t + ) + ) + +(define finalboss + (new 'static 'level-load-info + :index 21 + :name 'finalboss + :visname 'finalboss-vis + :nickname 'fin + :packages '(finalboss) + :sound-banks '(finalboss) + :music-bank 'finalboss + :ambient-sounds '() + :mood '*finalboss-mood* + :mood-func 'update-mood-finalboss + :ocean #f + :sky #t + :sun-fade 1.0 + :continues '((new 'static 'continue-point + :name "finalboss-start" + :level 'finalboss + :trans (new 'static 'vector :x 11548456.0 :y 2215872.0 :z -19409498.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7325 :w 0.6807) + :camera-trans (new 'static 'vector :x 11513311.0 :y 2234999.5 :z -19435708.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.5883 0.0 -0.8085 0.1074 0.9911 0.0781 0.8014 -0.1328 0.5831) + :load-commands '((special "citb-exit-plat-4" #t)) + :vis-nick 'fin + :lev0 'finalboss + :disp0 'display + :lev1 'citadel + :disp1 'special + ) + (new 'static 'continue-point + :name "finalboss-fight" + :level 'finalboss + :trans (new 'static 'vector :x 12288335.0 :y 1970461.9 :z -19848522.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.5359 :w -0.8442) + :camera-trans (new 'static 'vector :x 12265366.0 :y 1984228.5 :z -19842574.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.243 0.0 -0.97 0.2594 0.9635 -0.065 0.9346 -0.2675 -0.2341) + :load-commands '((special "citb-exit-plat-4" #t)) + :vis-nick 'fin + :lev0 'finalboss + :disp0 'display + :lev1 'citadel + :disp1 'special + ) + ) + :tasks '() + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x 11837440.0 :y 2129920.0 :z -19578880.0 :w 778240.0) + :buzzer 91 + :bottom-height (meters -114) + :run-packages '("common") + :wait-for-load #f + ) + ) + +(define intro (new 'static 'level-load-info + :index 22 + :name 'intro + :visname 'intro-vis + :nickname 'int + :packages '(intro) + :sound-banks '() + :music-bank #f + :ambient-sounds '() + :mood '*default-mood* + :mood-func 'update-mood-default + :ocean #f + :sky #f + :continues '() + :tasks '() + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere) + :bottom-height (meters -10000000) + :run-packages '("common") + :wait-for-load #f + ) + ) + +(define demo + (new 'static 'level-load-info + :index 23 + :name 'demo + :visname 'demo-vis + :nickname 'dem + :packages '() + :sound-banks '(village1) + :music-bank 'village1 + :ambient-sounds '() + :mood '*default-mood* + :mood-func 'update-mood-default + :ocean #f + :sky #f + :continues '((new 'static 'continue-point + :name "demo-start" + :level 'demo + :flags (continue-flags demo) + :trans (new 'static 'vector :x 66396.16 :y 29782.016 :z -919973.5 :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + :camera-trans (new 'static 'vector :x 76871.68 :y 55061.707 :z -938752.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8743 0.0 0.4852 -0.2117 0.8997 0.3816 -0.4365 -0.4364 0.7866) + :load-commands '() + :vis-nick 'dem + :lev0 'demo + :disp0 'special + :lev1 #f + :disp1 #f + ) + ) + :tasks '() + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere) + :bottom-height (meters -10000000) + :run-packages '("common") + :wait-for-load #f + ) + ) + +(define title + (new 'static 'level-load-info + :index 24 + :name 'title + :visname 'title-vis + :nickname 'tit + :packages '() + :sound-banks '() + :music-bank 'village1 + :ambient-sounds '() + :mood '*village1-mood* + :mood-func 'update-mood-village1 + :ocean #f + :sky #f + :continues '((new 'static 'continue-point + :name "title-start" + :level 'title + :flags (continue-flags title) + :trans (new 'static 'vector :x -635598.9 :y 222551.66 :z 710496.25 :w 1.0) + :quat (new 'static 'quaternion :y -0.3323 :w -0.9431) + :camera-trans (new 'static 'vector :x -665644.25 :y 250803.0 :z 668470.9 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8129 0.0 -0.5823 0.0958 0.9863 0.1337 0.5744 -0.1645 0.8018) + :load-commands '() + :vis-nick 'tit + :lev0 'title + :disp0 'special + :lev1 'village1 + :disp1 #f + ) + ) + :tasks '() + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :x -40960.0 :z 40960.0 :w 1126400.0) + :bottom-height (meters -10000000) + :run-packages '("common") + :wait-for-load #f + ) + ) + +(define halfpipe + (new 'static 'level-load-info + :index 25 + :name 'halfpipe + :visname 'halfpipe-vis + :nickname 'none + :packages '() + :sound-banks '() + :music-bank #f + :ambient-sounds '() + :mood '*default-mood* + :mood-func 'update-mood-default + :ocean #f + :sky #t + :sun-fade 1.0 + :continues '((new 'static 'continue-point + :name "halfpipe" + :level 'halfpipe + :trans (new 'static 'vector :x -1048.9856 :y -172047.97 :z -212555.78 :w 1.0) + :quat (new 'static 'quaternion :y 0.061 :w 0.9981) + :camera-trans (new 'static 'vector :x -9941.401 :y -150049.17 :z -159587.94 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.979 0.0 -0.2037 0.0545 0.9634 -0.2622 0.1963 -0.2678 -0.9432) + :load-commands '() + :vis-nick #f + :lev0 'halfpipe + :disp0 'display + :lev1 #f + :disp1 #f + ) + ) + :tasks '() + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :w 167772160000.0) + :bottom-height (meters -10000000) + :run-packages '() + :wait-for-load #t + ) + ) + +(define default-level (new 'static 'level-load-info + :index 26 + :name 'default-level + :visname 'default-level-vis + :nickname 'none + :packages '() + :sound-banks '() + :music-bank #f + :ambient-sounds '() + :mood '*default-mood* + :mood-func 'update-mood-default + :ocean #f + :sky #t + :continues '() + :tasks '() + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :w 167772160000.0) + :bottom-height (meters -20) + :run-packages '() + :wait-for-load #t + ) + ) + +(define *level-load-list* '(training + village1 + beach + jungle + jungleb + misty + firecanyon + village2 + sunken + sunkenb + swamp + rolling + ogre + village3 + snow + maincave + darkcave + robocave + lavatube + citadel + finalboss + intro + demo + title + halfpipe + default-level + ) + ) + + + + +;;;;;;;;; CUSTOM LEVELS +(define test-zone (new 'static 'level-load-info + :index 26 + :name 'test-zone + :visname 'test-zone-vis ;; name + -vis + :nickname 'tsz ;; nickname + :packages '() + :sound-banks '() + :music-bank #f + :ambient-sounds '() + :mood '*default-mood* + :mood-func 'update-mood-default + :ocean #f + :sky #t + :continues '((new 'static 'continue-point + :name "test-zone-start" + :level 'test-zone + :trans (new 'static 'vector :x 0.0 :y (meters 10.) :z (meters 10.) :w 1.0) + :quat (new 'static 'quaternion :w 1.0) + :camera-trans (new 'static 'vector :x 0.0 :y 4096.0 :z 0.0 :w 1.0) + :camera-rot (new 'static 'array float 9 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0) + :load-commands '() + :vis-nick 'none + :lev0 'test-zone + :disp0 'display + :lev1 'village1 + :disp1 'display + )) + :tasks '() + :priority 100 + :load-commands '() + :alt-load-commands '() + :bsp-mask #xffffffffffffffff + :bsphere (new 'static 'sphere :w 167772160000.0) + :bottom-height (meters -20) + :run-packages '() + :wait-for-load #t + ) + ) + +(cons! *level-load-list* 'test-zone) \ No newline at end of file diff --git a/goal_src/engine/level/level.gc b/goal_src/engine/level/level.gc index 8347779cfb..371e0fcf8a 100644 --- a/goal_src/engine/level/level.gc +++ b/goal_src/engine/level/level.gc @@ -93,13 +93,13 @@ "Draw a level!" ;; do the draw (draw arg0 arg0 arg3) - + (if (nonzero? *display-strip-lines*) (debug-draw arg0 arg0 arg3) ) (none) ) - + (defmethod print level ((obj level)) "print a level." @@ -115,7 +115,7 @@ (defmethod relocate bsp-header ((obj bsp-header) (dest-heap kheap) (name (pointer uint8))) "Handle a bsp file load." - + ;; we expect that we'll have a loading-level set when we link/login a bsp-header (let ((s5-0 (-> *level* loading-level))) (if s5-0 @@ -175,7 +175,7 @@ (defmethod vis-clear level ((obj level)) "Clear the visibility info for when the level is loading." - + ;; clear vis-infos, so we can't try to look up a vis string. (countdown (v1-0 8) (nop!) ;; the usual. @@ -194,11 +194,11 @@ (defmethod vis-load level ((obj level)) "Start the initial load of a VIS file to the IOP VIS buffer. After this is done, we can use ramdisk-load to load chunks." - - ;; check to see if we have a buffer for loaded vis data. + + ;; check to see if we have a buffer for loaded vis data. (when (zero? (-> obj vis-info (-> obj vis-self-index) ramdisk)) ;; nope, we have no vis data buffer, we need to set it up. - + ;; first, we should see if the other level has loaded vis. if so, kill it. (let ((vis (-> obj other vis-info (-> obj other vis-self-index)))) (when (and vis (nonzero? (-> vis ramdisk))) @@ -207,7 +207,7 @@ 0 ) ) - + ;; set up a ramdisk rpc (fill command, actually load the file from DVD to IOP buffer) (let ((visname (make-file-name (file-kind vis) (the-as string (-> obj nickname)) 0 #f)) (cmd (the-as ramdisk-rpc-fill (add-element *ramdisk-rpc*))) @@ -222,7 +222,7 @@ (set! (-> obj vis-info (-> obj vis-self-index) ramdisk) s5-0) ) ) - + ;; return the ramdisk ID. (-> obj vis-info (-> obj vis-self-index) ramdisk) ) @@ -278,7 +278,7 @@ ) ) ) - + ;; check for up to 6 neighbor level vis info. The last one is always left as null. (dotimes (s5-1 6) (let* ((s3-0 (+ s5-1 1)) @@ -314,9 +314,9 @@ (let* ((level-info (lookup-level-info name)) (level-name (remap-level-name level-info)) ) - (swhen (level-get obj level-name) - (level-status-set! bc want-status) - (return bc) + (awhen (level-get obj level-name) + (level-status-set! it want-status) + (return it) ) (let ((a0-7 (level-get-most-disposable obj))) (set! s5-1 (if a0-7 (level-status-set! a0-7 'inactive) @@ -425,7 +425,7 @@ (('alive) (when (and *dproc* (= want-status 'active)) ;; only if we want to do alive -> active - + ;; will set the level to be drawn. (remove-by-param1 *background-draw-engine* (-> obj bsp)) (add-connection *background-draw-engine* *dproc* (the (function object object object object object) add-bsp-drawable) (-> obj bsp) obj #f) @@ -539,10 +539,10 @@ ;; set the level heap. level code logins called from linker may allocate here (set! loading-level (-> obj heap)) - + ;; relocate method of the bsp will look for this (set! (-> *level* loading-level) obj) - + ;; clear out old stuff (set! (-> *level* log-in-level-bsp) #f) (set! (-> obj nickname) #f) @@ -551,12 +551,12 @@ (set! (-> obj ambient) #f) (set! (-> obj linking) #f) (vis-clear obj) - + (set! (-> obj status) 'loading) - + ;; incoming textures should use the level allocator (set! (-> *texture-pool* allocate-func) texture-page-level-allocate) - + ;; build name (if (= (-> obj load-name) (-> obj info visname)) (format (clear *temp-string*) "~S" (-> obj info nickname)) @@ -564,19 +564,19 @@ ) (set! (-> *temp-string* data 8) (the-as uint 0)) (format *temp-string* ".DGO") - + ;; reset temporary allocations on level heap (set! (-> obj heap top) (-> obj heap top-base)) - + ;; allocate DGO loading buffers (let ((s4-0 (kmalloc (-> obj heap) (* 2 1024 1024) (kmalloc-flags align-64 top) "dgo-level-buf-2")) (s5-2 (kmalloc (-> obj heap) (* 2 1024 1024) (kmalloc-flags align-64 top) "dgo-level-buf-2")) ) (load-dbg " DGO buffers at #x~X #x~X~%" s4-0 s5-2) - + ;; we expect to load code first, remember where the heap is now. (set! (-> obj code-memory-start) (-> obj heap current)) - + (format 0 "-----------> begin load ~A [~S]~%" (-> obj load-name) *temp-string*) ;; kick off the load! (dgo-load-begin *temp-string* s5-2 s4-0 (the pointer (align64 (-> obj heap current)))) @@ -586,10 +586,10 @@ (defmethod login-begin level ((obj level)) "Start the login. This is spread over multiple frames." - + ;; done with load, reset the texture page allocator (set! (-> *texture-pool* allocate-func) texture-page-default-allocate) - + (cond ((-> obj bsp) (set! (-> *level* log-in-level-bsp) (-> obj bsp)) @@ -605,7 +605,7 @@ ) ) ) - + ;; set the login state machine at the beginning. (set! (-> *login-state* state) -1) (set! (-> *login-state* pos) (the-as uint 0)) @@ -633,16 +633,16 @@ (sv-16 prototype-bucket-tie) (sv-32 int) ) - + ;; there is some logic for not doing the whole login all at once... ;; for now, we will somewhat ignore that. - - + + (let ((level-drawable-trees (-> loaded-level bsp drawable-trees))) ;;(.mfc0 initial-timer Count) (label cfg-1) ;;(.mfc0 current-timer Count) - + ;; this would quit the login function after some amount of time elapsed. #| (let ((elapsed-timer (- current-timer initial-timer))) @@ -652,16 +652,16 @@ ) ) |# - + (let ((current-login-pos (the-as int (-> level-login-state pos)))) - + ;; Login state -1. ;; in this state, we log in drawables/art-groups that are in referenced in the bsp directly ;; the current-login-pos in the index of the drawable/art to login. - + (when (= (-> level-login-state state) -1) ;;(load-dbg "login state -1~%") - + ;; login some drawables. (when (< current-login-pos (-> level-drawable-trees length)) (let ((current-drawable (-> level-drawable-trees trees (the-as uint current-login-pos)))) @@ -699,7 +699,7 @@ (+! (-> level-login-state pos) 1) (goto cfg-1) ) - + ;; this makes the art groups go at the end. (let ((v1-39 (- (the-as uint current-login-pos) (the-as uint (-> level-drawable-trees length))))) (when (< (the-as int v1-39) (-> loaded-level art-group art-group-array length)) @@ -713,14 +713,14 @@ (goto cfg-1) ) ) - + ;; if we got here, we're done with state -1! (set! (-> level-login-state pos) (the-as uint 0)) (set! (-> level-login-state state) 0) (goto cfg-1) ) - - + + ;; login state 0. ;; we log in children of the drawables from state -1. (when (< (-> level-login-state state) (the-as int (-> level-login-state elts))) @@ -755,6 +755,15 @@ (when (< current-login-pos (-> s1-2 length)) (set! sv-16 (-> s1-2 array-data (the-as uint current-login-pos))) (set! sv-32 0) + + (#when PC_PORT + ;; if a TIE uses environment mapping, disable the fade out so it always renderers with + ;; the generic renderer. In the port, we just make envmapped things always envmap. + (when (!= (-> sv-16 envmap-fade-far) 0.0) + (*! (-> sv-16 envmap-fade-far) 10000.) + ) + ) + (while (< sv-32 4) (let ((a0-28 (-> sv-16 geometry sv-32))) ;;(load-dbg " login geom: ~A~%" a0-28) @@ -801,8 +810,8 @@ ) (goto cfg-1) ) - - + + (when (= (-> level-login-state state) (-> level-login-state elts)) (let ((v1-115 (-> loaded-level bsp))) (cond @@ -828,8 +837,7 @@ ) ) ) - - + ;; done! (set! (-> loaded-level nickname) (-> loaded-level bsp nickname)) (if (nonzero? (-> loaded-level bsp nodes)) @@ -848,7 +856,7 @@ (set! (-> *subdivide-settings* close 3) f0-0) (set! (-> *subdivide-settings* far 3) f1-0) ) - + (load-dbg "init-vis~%") (init-vis loaded-level) (load-dbg "package load~%") @@ -896,31 +904,31 @@ (case (-> obj status) (('active 'alive) (format 0 "----------- kill ~A (status ~A)~%" obj (-> obj status)) - + ;; copy data from the level to the game-info storage. This will remember permanent level stuff, like ;; what you collected/completed. (copy-perms-from-level! *game-info* obj) (send-event *camera* 'level-deactivate (-> obj name)) (send-event *target* 'level-deactivate (-> obj name)) - + ;; remove this BSP from the engine. This will stop us from being drawn. (remove-by-param1 *background-draw-engine* (-> obj bsp)) - + ;; track down all the entities and kill them (deactivate-entities (-> obj bsp)) - + ;; kill any remaining particles not associated with a part-tracker (kill-all-particles-in-level obj) - + ;; clean up our level (set! (-> obj inside-sphere?) #f) (set! (-> obj inside-boxes?) #f) (set! (-> obj meta-inside?) #f) (set! (-> obj force-inside?) #f) - + ;; we're still loaded. (set! (-> obj status) 'loaded) - + (set! (-> obj all-visible?) 'loading) ;; clear vis buffers (dotimes (v1-19 128) @@ -946,10 +954,10 @@ (defmethod unload! level ((obj level)) "Unloads the level. This does not free the heap. The level will be made inactive and ready to be loaded some other time." - + (deactivate obj) (when (!= (-> obj status) 'inactive) - + ;; if we linked art group, unlink it. (when (or (= (-> obj status) 'loaded) (= (-> obj status) 'alive) @@ -964,7 +972,7 @@ ) ) ) - + ;; turn some things off (set! (-> obj bsp) #f) (set! (-> obj entity) #f) @@ -972,7 +980,7 @@ (set! (-> obj status) 'inactive) (set! (-> obj art-group string-array length) 0) (set! (-> obj art-group art-group-array length) 0) - + ;; unload texture pages (countdown (s5-1 (-> obj loaded-texture-page-count)) (dotimes (v1-27 32) @@ -984,10 +992,10 @@ ) (set! (-> obj loaded-texture-page-count) 0) (unlink-textures-in-heap! *texture-page-dir* (-> obj heap)) - + ;; unload particle groups that were defined in the level data (unlink-part-group-by-heap (-> obj heap)) - + ;; if there are any in-progress art loads for this level, kill them. (dotimes (s5-2 2) (let ((v1-41 (-> *art-control* buffer s5-2 pending-load-file))) @@ -1010,7 +1018,7 @@ (a0-29 (car s5-3)) ) (while (not (null? s5-3)) - (case (rtype-of a0-29) + (case (rtype-of a0-29) ((symbol) (unload (symbol->string (the-as symbol a0-29))) ) @@ -1024,7 +1032,7 @@ ) (vis-clear obj) - + ;; reset the level heap! (let ((v1-64 (-> obj heap))) (set! (-> v1-64 current) (-> v1-64 base)) @@ -1047,18 +1055,15 @@ "Is arg0 visible? Note that this will return #f if the visibility data is not loaded." ;; note : pc port added option to show every actor regardless - (#when PC_PORT - (cond - ((actor-force-visible? *pc-settings*) #t) - (else - + (with-pc (if (-> *pc-settings* force-actors?) (return #t))) + ;; check the vis bits! - (let* (;; lwu v1, 388(a0) + (let* (;; lwu v1, 388(a0) (vis-data (-> obj vis-bits)) ;; sra a0, a1, 3 (byte-idx (sar arg0 3)) ;; daddu v1, a0, v1 - ;; lb v1, 0(v1) + ;; lb v1, 0(v1) (vis-byte (-> (the (pointer int8) vis-data) byte-idx)) ;; andi a0, a1, 7 (bit-idx (logand arg0 #b111)) @@ -1072,10 +1077,6 @@ ;; movz v0, s7, v1 if (csw >= 0) result = false ;;(format 0 "vis check ~D ~X ~X ~A~%" arg0 vis-byte check-sign-word (>= check-sign-word 0)) (< check-sign-word 0) - ) - - ) - ) ) ) @@ -1115,7 +1116,7 @@ (defmethod debug-print-splitbox level ((obj level) (arg0 vector) (arg1 string)) "Print the current splitbox, if we're in one." (cond - ((or (not (-> obj bsp)) (zero? (-> obj bsp boxes)) (zero? (-> obj bsp split-box-indices))) + ((or (not (-> obj bsp)) (zero? (-> obj bsp boxes)) (zero? (-> obj bsp split-box-indices))) ;; do nothing! ) (else @@ -1429,6 +1430,11 @@ ) (defun bg ((level-name symbol)) + "Begin game in a given level. + The level name can be the full name (village3), the nickname (vi3), or visname (village3-vis) + If the visname is used (and its a recognized level in level-info), it will use vis mode. + Otherwise, it will use the non-vis DGO name (like VILLAGE3.DGO) which will usually fail. + " (set! *cheat-mode* (if *debug-segment* 'debug #f @@ -1494,6 +1500,62 @@ 0 ) +(defun bg-custom ((level-name symbol)) + "Modified version of bg for the PC Port custom levels." + + ;; lookup info + (format 0 "(bg-custom ~A)%" level-name) + (let ((lev-info (lookup-level-info level-name))) + (when (= lev-info default-level) + (format 0 "Unable to (bg-custom ~A), the level was not found in *level-load-list*~%" level-name) + (return #f) + ) + + ;; kill jak (rip) + (format 0 "doing stop~%") + (stop 'play) + + ;; enable visiblity. the custom level won't use it, but we want it on so other levels can be loaded. + (set! (-> *level* vis?) #t) + + ;; disable border and play mode to prevent loading levels + (set! (-> *level* border?) #f) + (set! (-> *setting-control* default border-mode) #f) + (set! (-> *level* play?) #f) + + (format 0 "doing level load~%") + ;; allocate level. This may start the loading process, but won't finish it. + (let ((lev (level-get-for-use *level* level-name 'active))) + (when (not lev) + (format 0 "Unable to load level, could not level-get-for-use~%") + (return #f) + ) + (format 0 "about to start load loop, game will freeze and hopefully come back soon~%") + + ;; spin in a loop and load it. This will cause the game to freeze during the load, + ;; but this is good enough for now. + (while (or (= (-> lev status) 'loading) + (= (-> lev status) 'loading-bt) + (= (-> lev status) 'login) + ) + (load-continue lev) + ) + + (when (not (-> lev info continues)) + (format 0 "level info has no continues, can't load it.~%") + ) + + (let ((cont (car (-> lev info continues)))) + (start 'play (the continue-point cont)) + ) + + (vis-load lev) + (set! (-> lev all-visible?) #f) + (set! (-> lev force-all-visible?) #t) + ) + ) + ) + (defun play ((use-vis symbol) (init-game symbol)) "The entry point to the actual game! This allocates the level heaps, loads some data, sets some default parameters and sets the startup level." @@ -1815,11 +1877,11 @@ ) ) ) - + ;; load vis info. ;; The load-state's vis-nick is the level we want vis data for. ;; Note that we won't load vis until we are inside the level's boxes. - + ;; this will be the level that is currently being used. (let ((s5-3 #f)) (dotimes (v1-121 (-> *level* length)) @@ -1831,7 +1893,7 @@ ) ) ) - + ;; if we have the wrong vis (when (and (!= s5-3 (-> obj vis-nick)) (-> *level* vis?)) ;; and we want a vis @@ -1857,23 +1919,23 @@ ;; method 16 level-group (debug text stuff) (defmethod level-update level-group ((obj level-group)) - + ;; this does nothing... (camera-pos) (new 'static 'boxed-array :type symbol :length 0 :allocated-length 2) - + ;; compute the settings for this frame - (update-per-frame-settings! *setting-control*) - + (update *setting-control*) + ;; run the art loading system (update *art-control* #t) (clear-rec *art-control*) - + ;; run level loading! (dotimes (s5-0 2) (load-continue (-> obj level s5-0)) ) - + ;; compute inside for each level (dotimes (s5-1 (-> obj length)) (let ((s4-0 (-> obj level s5-1))) @@ -1887,10 +1949,9 @@ ) ) ) - + ;; update load state machine (the level-border one) (update! *load-state*) - ;; checkpoint assignment (dotimes (s5-2 (-> obj length)) (let ((s4-1 (-> obj level s5-2))) @@ -1925,7 +1986,7 @@ ) ) ) - + ;; determine vis info idx for each level (dotimes (v1-67 (-> obj length)) (let ((a0-26 (-> obj level v1-67))) @@ -1948,7 +2009,7 @@ ) ) ) - + ;; display level vis info (when *display-level-border* (dotimes (s5-3 (-> obj length)) @@ -1976,7 +2037,7 @@ ) ) ) - + ;; if we have vis for level A, but we aren't "in" it, display an error and ;; force us out of the other level. Ideally the boxes and the load boundary system ;; will be consistent and there is no way to set a vis to a level that we aren't in. @@ -2000,7 +2061,6 @@ ) ) ) - ;; if we are outside of the boxes, we consider ourselves "outside of bsp" ;; if we are outside of both levels boxes, then we don't really know what to do ;; for vis, and we can display the classic "outside of bsp" error. @@ -2039,7 +2099,7 @@ ) ) ) - + ;; now, handle setting bit 31 (maybe single vis mode?) (cond ;; special display self mode. @@ -2072,7 +2132,6 @@ ) ) ) - (when (or *display-level-border* *display-texture-download* *display-split-box-info*) (when *display-level-border* (format *stdcon* " want: ~A ~A/~A ~A ~A/~A~%" @@ -2142,13 +2201,13 @@ ) ) ) - + ;; tell PC port about our levels - (__pc-set-levels + (__pc-set-levels (if (= (-> obj level0 status) 'inactive) "none" (symbol->string (-> obj level0 nickname))) (if (= (-> obj level1 status) 'inactive) "none" (symbol->string (-> obj level1 nickname))) ) - + 0 ) diff --git a/goal_src/engine/level/load-boundary.gc b/goal_src/engine/level/load-boundary.gc index cb5fd9c4bd..c40c4d251f 100644 --- a/goal_src/engine/level/load-boundary.gc +++ b/goal_src/engine/level/load-boundary.gc @@ -382,7 +382,7 @@ (logtest? (-> *display* real-actual-frame-counter) 4) ) )) - (with-dma-buffer-add-bucket ((s5-0 (-> (current-frame) global-buf)) (bucket-id debug-draw0)) + (with-dma-buffer-add-bucket ((s5-0 (-> (current-frame) global-buf)) (bucket-id debug)) (dma-buffer-add-gs-set-flusha s5-0 (zbuf-1 (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24))) (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest greater-equal) :aref #x26 :zte #x1 :ztst (gs-ztest greater-equal))) @@ -501,7 +501,7 @@ (set! (-> s2-0 y) (-> s5-0 top-plane)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s2-0 8192.0 (new 'static 'rgba :a #x80) @@ -510,7 +510,7 @@ (set! (-> s2-0 y) (-> s5-0 bot-plane)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s2-0 8192.0 (new 'static 'rgba :a #x80) @@ -2130,21 +2130,14 @@ ) ) ((= v1-4 'setting-reset) - (set-setting! - *setting-control* - pp - (the-as symbol (command-get-param (car gp-0) #f)) - (the-as symbol (command-get-param (car (cdr gp-0)) #f)) - 0.0 - 0 - ) + (set-setting! (the-as symbol (command-get-param (car gp-0) #f)) (command-get-param (car (cdr gp-0)) #f) 0.0 0) ) ((= v1-4 'setting-unset) - (clear-pending-settings-from-process - *setting-control* - pp - (the-as symbol (command-get-param (car gp-0) #f)) - ) + (remove-setting! (the-as symbol (command-get-param (car gp-0) #f))) + ) + ;; PAL patch here + ((= v1-4 'sfx-volume) + (set-setting! 'sfx-volume (command-get-param (car gp-0) #f) (command-get-float (car (cdr gp-0)) 0.0) 0) ) ((= v1-4 'blackout) (set-blackout-frames diff --git a/goal_src/engine/load/file-io.gc b/goal_src/engine/load/file-io.gc index 38692b708a..eba11c84d5 100644 --- a/goal_src/engine/load/file-io.gc +++ b/goal_src/engine/load/file-io.gc @@ -85,9 +85,9 @@ (defmethod print file-info ((obj file-info)) "Print information about a file" - (format #t "#<~A ~A :version ~D.~D @ #x~X>" + (format #t "#<~A ~A :version ~D.~D @ #x~X>" (-> obj type) (-> obj file-name) (-> obj major-version) (-> obj minor-version) obj) - obj + obj ) ;; allocate a temporary string @@ -181,7 +181,7 @@ (let* ((expected-version (cond ((zero? version-override) - (case kind + (case kind (((file-kind tpage) (file-kind dir-tpage)) 7 ) diff --git a/goal_src/engine/load/load-dgo.gc b/goal_src/engine/load/load-dgo.gc index 87adffbcb0..7a3f5387a4 100644 --- a/goal_src/engine/load/load-dgo.gc +++ b/goal_src/engine/load/load-dgo.gc @@ -320,9 +320,9 @@ struct DgoHeader { ;; note that this does not include linking/setup of the ;; final object in the level which may take a significant amount of time (if (= (-> response result) (load-msg-result done)) - ;; this assumes 60 fps! + ;; this assumes it was stable at the target fps! (format 0 "Elapsed time for level = ~Fs~%" - (* 0.016666668 (the float (- (-> *display* real-integral-frame-counter) *dgo-time*))) + (* (-> *display* seconds-per-frame) (the float (- (-> *display* real-integral-frame-counter) *dgo-time*))) ) ) ) diff --git a/goal_src/engine/load/loader-h.gc b/goal_src/engine/load/loader-h.gc index 8f1ee82643..1a148292d1 100644 --- a/goal_src/engine/load/loader-h.gc +++ b/goal_src/engine/load/loader-h.gc @@ -16,10 +16,10 @@ ;; A load-dir is a collection of references to loaded art. -;; This type didn't have an inspect method, so these field names are made up. +;; This type didn't have a nomral inspect method, so these field names are made up. (declare-type art-group basic) (deftype load-dir (basic) - ((unknown basic :offset-assert 4) + ((lev level :offset-assert 4) (string-array (array string) :offset-assert 8) ;; these are the names (data-array (array basic) :offset-assert 12) ;; this is the file data. ) @@ -27,7 +27,7 @@ :size-assert #x10 :flag-assert #xb00000010 (:methods - (new (symbol type int basic) _type_ 0) + (new (symbol type int level) _type_ 0) (load-to-heap-by-name (_type_ string symbol kheap int) art-group 9) (set-loaded-art (_type_ art-group) art-group 10) ) @@ -41,15 +41,15 @@ :size-assert #x10 :flag-assert #xb00000010 (:methods - (new (symbol type int basic) _type_ 0) + (new (symbol type int level) _type_ 0) ) ) -(defmethod new load-dir ((allocation symbol) (type-to-make type) (length int) (unk basic)) +(defmethod new load-dir ((allocation symbol) (type-to-make type) (length int) (lev level)) "Allocate a new load-dir with room for length entries" (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj unknown) unk) + (set! (-> obj lev) lev) ;; create the name array (set! (-> obj string-array) (the-as (array string) @@ -67,10 +67,10 @@ ) ) -(defmethod new load-dir-art-group ((allocation symbol) (type-to-make type) (length int) (unk basic)) +(defmethod new load-dir-art-group ((allocation symbol) (type-to-make type) (length int) (lev level)) "Allocate a new load-dir with room for length art-groups" ;; call parent ctor. - (let ((obj ((method-of-type load-dir new) allocation type-to-make length unk))) + (let ((obj ((method-of-type load-dir new) allocation type-to-make length lev))) ;; override the content type (set! (-> obj data-array content-type) art-group) ;; and cast to child. diff --git a/goal_src/engine/load/loader.gc b/goal_src/engine/load/loader.gc index 41cfa76e61..62ffa223b8 100644 --- a/goal_src/engine/load/loader.gc +++ b/goal_src/engine/load/loader.gc @@ -4,12 +4,13 @@ ;; name: loader.gc ;; name in dgo: loader ;; dgos: GAME, ENGINE +;; note: changed for high fps (defmethod inspect load-dir ((obj load-dir)) "Print all the stuff in a load-dir" (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlevel: ~A~%" (-> obj unknown)) + (format #t "~Tlevel: ~A~%" (-> obj lev)) (format #t "~Tallocated-length: ~D~%" (-> obj string-array allocated-length)) (format #t "~Tlength: ~D~%" (-> obj string-array length)) (dotimes (i (-> obj string-array length)) @@ -62,7 +63,7 @@ "Load the art with the given name to the heap and return the art. Won't load a thing if it's already loaded, unless you set do-reload. This is intended for debug only." - + ;; see if we already have it. (let ((s5-0 (-> obj string-array))) (dotimes (s3-0 (-> s5-0 length)) @@ -78,7 +79,7 @@ (return (-> obj art-group-array s3-0)) ) ) - + ;; nope, we don't have it,add it to the list. (let ((v0-2 (art-group-load-check art-name heap version))) (when v0-2 @@ -381,7 +382,7 @@ ) (else ;; we have officially chosen to load this file - + (set! (-> obj load-file) (-> obj pending-load-file)) (set! (-> obj load-file-part) (-> obj pending-load-file-part)) (set! (-> obj load-file-owner) (-> obj pending-load-file-owner)) @@ -389,13 +390,13 @@ ) ) ) - - + + (label cfg-18) (cond ((-> obj load-file) ;; something is being worked on - (case (-> obj status) + (case (-> obj status) (('active 'reserved) ;; file is loaded and usable (or reserved) ) @@ -440,7 +441,7 @@ ) (('loading) ;; loading... - (case (str-load-status (&-> obj len)) + (case (str-load-status (&-> obj len)) (('error) ;; something went wrong. oh well. (set! (-> obj status) 'error) @@ -500,7 +501,7 @@ ) (else ;; we want to get rid of the file! - (case (-> obj status) + (case (-> obj status) (('initialize) ;; this was done earlier ) @@ -553,8 +554,8 @@ "Get the status of a file in this art control. #f = file not found" (dotimes (i 2) - (swhen (file-status (-> obj buffer i) name part) - (return bc) + (awhen (file-status (-> obj buffer i) name part) + (return it) ) ) #f @@ -571,17 +572,17 @@ -0.5) ) ) - + ;; frame-lock will get set to #t if something is assigned to this buffer in this update. (dotimes (v1-5 2) - (set! (-> obj buffer v1-5 frame-lock) #f) + (set! (-> obj buffer v1-5 frame-lock) #f) ) - + ;; buffers assigned from this call to update (dotimes (v1-8 3) (set! (-> obj rec v1-8 buf2) #f) ) - + ;; update existing buffers from their recs (dotimes (s4-0 2) (let ((s3-0 (-> obj rec s4-0))) @@ -831,7 +832,7 @@ (set! (-> obj rec 2 owner) (the-as handle #f)) ) ) - + ;; if it's top 3 priority, push this spool-anim to the rec list (cond ((< priority (-> obj rec 0 priority)) @@ -863,15 +864,12 @@ ) (defun-extern level-hint-surpress! none) ;; ? TODO -(define-extern ja-channel-push! (function int int int :behavior process-drawable)) +(define-extern ja-channel-push! (function int time-frame int :behavior process-drawable)) (define-extern ja-channel-set! (function int int :behavior process-drawable)) (define-extern joint-control-channel-group-eval! (function joint-control-channel art-joint-anim (function joint-control-channel float float float) int)) (define-extern joint-control-channel-group! (function joint-control-channel art-joint-anim (function joint-control-channel float float float) int)) (define-extern ja-aframe-num (function int float :behavior process-drawable)) -;; this function is modified to work without sound. -(define *str-pos-hack* 0) -(define *str-play-speed* 17) (define-extern ja-abort-spooled-anim (function spool-anim art-joint-anim int int :behavior process-drawable)) (defbehavior ja-play-spooled-anim process-drawable ((arg0 spool-anim) (arg1 art-joint-anim) (arg2 art-joint-anim) (arg3 (function process-drawable symbol))) (local-vars @@ -886,7 +884,6 @@ (spool-sound sound-id) (sv-72 int) ) - (set! *str-pos-hack* 0) (set! spool-part 0) (set! sv-24 -17.0) (set! old-skel-status (-> self skel status)) @@ -896,24 +893,17 @@ (set! sv-56 0) (set! spool-sound (new-sound-id)) (backup-load-state-and-set-cmds *load-state* (-> arg0 command-list)) - (set-setting! *setting-control* self 'spooling (the-as symbol (process->ppointer self)) 0.0 0) + (set-setting! 'spooling (process->ppointer self) 0.0 0) (logior! (-> self skel status) (janim-status inited drawn done)) (kill-current-level-hint '() '() 'die) (level-hint-surpress!) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (when (or (handle->process (-> *art-control* spool-lock)) (!= *master-mode* 'game)) (cond (arg1 - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - arg1 - ) - (ja-channel-push! 1 15) - (let ((s2-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! s2-0 arg1 num-func-identity) - (set! (-> s2-0 frame-num) 0.0) - ) + (when (!= (ja-group) arg1) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! arg1 :num! min) ) ) (else @@ -927,12 +917,9 @@ ) (spool-push *art-control* (-> arg0 name) spool-part self -9.0) (suspend) - (when arg1 - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-loop!) + (if arg1 + (ja :num! (loop!)) ) - ) ) ) (let ((v1-46 (process->ppointer self))) @@ -940,7 +927,7 @@ (new 'static 'handle :process v1-46 :pid (-> (the-as process (-> v1-46 0)) pid)) ) ) - (set! sv-48 (-> *display* base-frame-counter)) + (set! sv-48 (the-as int (-> *display* base-frame-counter))) (while (< spool-part (-> arg0 parts)) (spool-push *art-control* (-> arg0 name) spool-part self -20.0) (update *art-control* #f) @@ -948,16 +935,9 @@ (when (!= (file-status *art-control* (-> arg0 name) spool-part) 'active) (cond (arg1 - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - arg1 - ) + (when (!= (ja-group) arg1) (ja-channel-set! 1) - (let ((s2-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! s2-2 arg1 num-func-identity) - (set! (-> s2-2 frame-num) 0.0) - ) + (ja :group! arg1 :num! min) ) ) (else @@ -971,12 +951,9 @@ (spool-push *art-control* (-> arg0 name) spool-part self -20.0) (format #t "WARNING: ---------------------> loader stall on art ~S ~D~%" (-> arg0 name) spool-part) (suspend) - (when arg1 - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 param 0) 1.0) - (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-loop!) + (if arg1 + (ja :num! (loop!)) ) - ) ) ) (spool-push *art-control* (-> arg0 name) spool-part self -20.0) @@ -984,35 +961,22 @@ (cond (s2-4 (ja-channel-set! 1) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 frame-group) s2-4) - (set! (-> a0-42 param 0) (the float (+ (-> s2-4 data 0 length) -1))) - (set! (-> a0-42 param 1) 1.0) - (set! (-> a0-42 frame-num) 0.0) - (joint-control-channel-group! a0-42 s2-4 num-func-seek!) - ) + (ja-no-eval :group! s2-4 :num! (seek!) :frame-num 0.0) (when (zero? spool-part) (str-play-async (-> arg0 name) spool-sound) - ;; hack! - ;;(set! *str-pos-hack* 0) - ;; (set! (-> *art-control* active-stream) (-> arg0 name)) ) (let* ((f30-0 (* 0.05859375 (-> s2-4 speed))) (f28-0 (+ sv-24 (/ (the float (+ (-> s2-4 data 0 length) -1)) f30-0))) ) - ;;(set! sv-72 (current-str-pos spool-sound)) - (set! sv-72 *str-pos-hack*) - - - (set! sv-40 (-> *display* base-frame-counter)) + (set! sv-72 (current-str-pos spool-sound)) + (set! sv-40 (the-as int (-> *display* base-frame-counter))) (until (>= (the float v0-39) f28-0) - (+! *str-pos-hack* *str-play-speed*) (if (= (-> self skel root-channel 0) (-> self skel channel)) (logior! (-> self skel status) (janim-status spool)) ) (if (or (arg3 self) - (and (<= sv-72 0) (>= (- (-> *display* base-frame-counter) sv-40) 1200)) + (and (<= sv-72 0) (>= (- (-> *display* base-frame-counter) sv-40) (seconds 4))) (and (< 300 sv-56) (<= sv-72 0)) ) (goto cfg-88) @@ -1024,26 +988,21 @@ ) (execute-commands-up-to *load-state* (ja-aframe-num 0)) (cond - ((and (< sv-32 sv-72) #|(= (current-str-id) spool-sound)|#) + ((and (< sv-32 sv-72) (= (current-str-id) spool-sound)) (set! sv-56 (+ sv-56 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)))) - (set! sv-40 (-> *display* base-frame-counter)) + (set! sv-40 (the-as int (-> *display* base-frame-counter))) ) (else 0 ) ) (set! sv-32 sv-72) - (set! sv-48 (-> *display* base-frame-counter)) + (set! sv-48 (the-as int (-> *display* base-frame-counter))) (suspend) - (let ((f0-14 (* (- (the float *str-pos-hack* #|(current-str-pos spool-sound)|#) sv-24) f30-0)) - (a0-69 (-> self skel root-channel 0)) - ) - (set! (-> a0-69 param 0) (the float (+ (-> a0-69 frame-group data 0 length) -1))) - (set! (-> a0-69 param 1) 1.0) - (set! (-> a0-69 frame-num) f0-14) - (joint-control-channel-group! a0-69 (the-as art-joint-anim #f) num-func-seek!) + (let ((f0-14 (* (- (the float (current-str-pos spool-sound)) sv-24) f30-0))) + (ja-no-eval :num! (seek!) :frame-num f0-14) ) - (set! v0-39 *str-pos-hack* #|(current-str-pos spool-sound)|#) + (set! v0-39 (current-str-pos spool-sound)) (set! sv-72 v0-39) ) (set! sv-24 f28-0) @@ -1066,34 +1025,28 @@ (defbehavior ja-abort-spooled-anim process-drawable ((arg0 spool-anim) (arg1 art-joint-anim) (arg2 int)) "Abort a spooled animation." - (restore-load-state-and-cleanup *load-state*) (str-play-stop (-> arg0 name)) (set! (-> *art-control* active-stream) #f) (logclear! (-> self skel status) (janim-status drawn done)) (if (zero? (logand (-> self skel status) (janim-status inited))) - (logclear! (-> self skel status) (janim-status inited)) - ) - (clear-pending-settings-from-process *setting-control* self 'spooling) + (logclear! (-> self skel status) (janim-status inited)) + ) + (remove-setting! 'spooling) (cond - ((and arg1 (>= arg2 0)) - (ja-channel-push! 1 30) - (set! (-> self skel root-channel 0 frame-group) arg1) - (while (!= (-> self skel root-channel 0) (-> self skel channel)) - (spool-push *art-control* (-> arg0 name) arg2 self -20.0) - (suspend) - ;; TODO macro - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) + ((and arg1 (>= arg2 0)) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) arg1) + (while (!= (-> self skel root-channel 0) (-> self skel channel)) + (spool-push *art-control* (-> arg0 name) arg2 self -20.0) + (suspend) + (ja :num! (seek!)) ) + ) + (else + (ja-channel-set! 0) ) ) - (else - (ja-channel-set! 0) - ) - ) (set! (-> *art-control* spool-lock) (the-as handle #f)) 0 ) diff --git a/goal_src/engine/math/math.gc b/goal_src/engine/math/math.gc index 5c23886234..0ab9ef0a25 100644 --- a/goal_src/engine/math/math.gc +++ b/goal_src/engine/math/math.gc @@ -91,7 +91,7 @@ (- x diff) ) ) - ) + ) ) (defun lerp ((minimum float) (maximum float) (amount float)) @@ -99,7 +99,7 @@ (+ minimum (* amount (- maximum minimum))) ) -(defun lerp-scale ((min-out float) (max-out float) +(defun lerp-scale ((min-out float) (max-out float) (in float) (min-in float) (max-in float)) "Interpolate from [min-in, max-in] to [min-out, max-out]. If the output is out of range, it will be clamped. @@ -192,7 +192,7 @@ ;; (.vsqrty Q vf1) ;; (.vaddq.x vf2 vf0 Q) ;; you're not allowed to do this! ;; (.vrxorw vf2) - + ;; and advance ;; (.vrnext.xyzw vf1) (let ((x (logand 1 (shr current-random 4))) @@ -203,7 +203,7 @@ (set! *_vu-reg-R_* (logior #x3f800000 (logand current-random #x7fffff))) ) ) - + ;; (.vsubw.xyzw vf1 vf1 vf0) ;; (.qmfc2.i v0 vf1) (- (the-as float *_vu-reg-R_*) 1.0) @@ -235,7 +235,7 @@ (defun rand-vu-int-range ((first int) (second int)) "Get an integer the given range. Inclusive of both? It looks like they actually did this right??" - + (local-vars (float-in-range float)) ;; increment the larger of the range, so it is inclusive @@ -244,7 +244,7 @@ (set! second (+ second 1)) (set! first (+ first 1)) ) - + ;; get a float in the range (set! float-in-range (rand-vu-float-range (the float first) (the float second)) @@ -279,7 +279,7 @@ (define *random-generator* (new 'global 'random-generator)) ;; I wonder who wrote this code. -(set! (-> *random-generator* seed) #x666EDD1E) +(set! (-> *random-generator* seed) #x666edd1e) (defmacro sext32-64 (x) "Sign extend a 32-bit value to 64-bits" @@ -311,3 +311,9 @@ (the uint result) ) ) + +(defmacro rand-float-gen (&key (gen *random-generator*)) + "Generate a float from [0, 1)" + `(+ -1.0 (the-as float (logior #x3f800000 (/ (rand-uint31-gen ,gen) 256)))) + ) + diff --git a/goal_src/engine/math/matrix.gc b/goal_src/engine/math/matrix.gc index 058a419467..f0908102a5 100644 --- a/goal_src/engine/math/matrix.gc +++ b/goal_src/engine/math/matrix.gc @@ -498,7 +498,7 @@ (.xor.vf vf18 vf18 vf18) (.xor.vf vf23 vf23 vf23) (.xor.vf vf19 vf19 vf19) - + (init-vf0-vector) (.lvf vf23 (&-> src vector 0 quad)) (.lvf vf24 (&-> src vector 1 quad)) @@ -899,22 +899,22 @@ ;; this a0 constant has ffff in the upper 16 bits to mask out w, later on. ;; dsll32 a0, a0, 16 (set! a0 (shl a0 48)) ;; a0 = ffff'0000'0000'0000 - + ;;mfc1 a1, f1 ;;qmtc2.i vf6, a1 (.mov vf6 c) ;; will set vf6.x to cosine. - + ;;pceqw a1, v1, r0 ;; compare for equality with zero. ;; this will set 32-bits for each component. - (.pceqw a1 v1 r0) - + (.pceqw a1 v1 r0) + ;; so we pack: [upper64, w0?16, z0?16, y0?16, x0?16] (.ppach a1 r0 a1) - + ;;qmtc2.i vf1, v1 (.mov vf1 v1) ;; should be quad move! - + ;;or v1, a1, a0 ;; make it seem like w is zero. If x,y,z = 0, but w != 0, we want ;; it to act like zero. @@ -922,14 +922,14 @@ ;;mfc1 a0, f0 ;;qmtc2.i vf5, a0 (.mov vf5 s) - + ;;daddiu v1, v1, 1 ;; if all is zero, this will overflow and give us 0. (+! xyz-zero 1) - + ;;vsubx.w vf5, vf0, vf6 (.sub.x.vf vf5 vf0 vf6 :mask #b1000) - + ;;beq v1, r0, L15 ;;vaddx.y vf5, vf0, vf6 (.add.x.vf vf5 vf0 vf6 :mask #b0010) @@ -944,58 +944,58 @@ (.xor.vf vf2 vf2 vf2) (.xor.vf vf3 vf3 vf3) (.xor.vf vf4 vf4 vf4) - + ;;vmulx.xyz vf11, vf1, vf5 (.mul.x.vf vf11 vf1 vf5 :mask #b0111) - + ;;vaddy.x vf7, vf0, vf5 (.add.y.vf vf7 vf0 vf5 :mask #b0001) - + ;;vaddy.y vf8, vf0, vf5 (.add.y.vf vf8 vf0 vf5 :mask #b0010) - + ;;vaddy.z vf9, vf0, vf5 (.add.y.vf vf9 vf0 vf5 :mask #b0100) - + ;;vmulw.xyz vf10, vf1, vf5 (.mul.w.vf vf10 vf1 vf5 :mask #b0111) - + ;;vsubz.y vf7, vf0, vf11 (.sub.z.vf vf7 vf0 vf11 :mask #b0010) - + ;;vaddy.z vf7, vf0, vf11 (.add.y.vf vf7 vf0 vf11 :mask #b0100) - + ;;vaddz.x vf8, vf0, vf11 (.add.z.vf vf8 vf0 vf11 :mask #b0001) - + ;;vsubx.z vf8, vf0, vf11 (.sub.x.vf vf8 vf0 vf11 :mask #b0100) - + ;;vmulx.xyz vf2, vf10, vf1 (.mul.x.vf vf2 vf10 vf1 :mask #b0111) - + ;;vmuly.xyz vf3, vf10, vf1 (.mul.y.vf vf3 vf10 vf1 :mask #b0111) - + ;;vmulz.xyz vf4, vf10, vf1 (.mul.z.vf vf4 vf10 vf1 :mask #b0111) - + ;;vsuby.x vf9, vf0, vf11 (.sub.y.vf vf9 vf0 vf11 :mask #b0001) - + ;;vaddx.y vf9, vf0, vf11 (.add.x.vf vf9 vf0 vf11 :mask #b0010) - + ;;vadd.xyz vf2, vf2, vf7 (.add.vf vf2 vf2 vf7 :mask #b0111) - + ;;vadd.xyz vf3, vf3, vf8 (.add.vf vf3 vf3 vf8 :mask #b0111) - + ;;vadd.xyz vf4, vf4, vf9 (.add.vf vf4 vf4 vf9 :mask #b0111) - + ;;sqc2 vf2, 0(v0) ;;sqc2 vf3, 16(v0) ;;sqc2 vf0, 48(v0) @@ -1676,72 +1676,72 @@ (v1 :type int) ) (init-vf0-vector) - + ;; blez a3, L3 (when-goto (<= count 0) end) - + ;; lqc2 vf1, 0(a0) (.lvf vf1 (-> obj vector 0)) ;; lqc2 vf2, 16(a0) (.lvf vf2 (-> obj vector 1)) - + ;; lqc2 vf3, 32(a0) (.lvf vf3 (-> obj vector 2)) - + ;; lqc2 vf4, 48(a0) (.lvf vf4 (-> obj vector 3)) - + ;; lqc2 vf5, 0(a2) (.lvf vf5 (-> src 0)) - + ;; lqc2 vf6, 16(a2) (.lvf vf6 (-> src 1)) - + (label loop-top) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;vmulaw.xyzw acc, vf4, vf0 (.mul.w.vf acc vf4 vf0) - + ;; lqc2 vf7, 32(a2) (.lvf vf7 (-> src 2)) - + ;;vmaddax.xyzw acc, vf1, vf5 (.add.mul.x.vf acc vf1 vf5 acc) - + ;;lqc2 vf8, 48(a2) (.lvf vf8 (-> src 3)) - + ;;vmadday.xyzw acc, vf2, vf5 (.add.mul.y.vf acc vf2 vf5 acc) - + ;;daddiu a2, a2, 64 ;;(&+! src 64) (set! src (the (inline-array vector) (+ 64 (the int src)))) - + ;;vmaddz.xyz vf5, vf3, vf5 (.add.mul.z.vf vf5 vf3 vf5 acc :mask #b0111) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - + ;;daddiu v1, a3, -1 (set! v1 (- count 1)) - + ;;vmulaw.xyzw acc, vf4, vf0 (.mul.w.vf acc vf4 vf0) - + ;;vmaddax.xyzw acc, vf1, vf6 (.add.mul.x.vf acc vf1 vf6 acc) - + ;; vmadday.xyzw acc, vf2, vf6 (.add.mul.y.vf acc vf2 vf6 acc) - + ;; vmaddz.xyz vf6, vf3, vf6 (.add.mul.z.vf vf6 vf3 vf6 acc :mask #b0111) - + ;;sqc2 vf5, 0(a1) (.svf (-> dst 0) vf5) - + ;;beq v1, r0, L3 ;;vmulaw.xyzw acc, vf4, vf0 (.mul.w.vf acc vf4 vf0) @@ -1760,7 +1760,7 @@ (.add.mul.z.vf vf7 vf3 vf7 acc :mask #b0111) ;;sqc2 vf6, 16(a1) (.svf (-> dst 1) vf6) - + ;;beq v1, r0, L3 ;;vmulaw.xyzw acc, vf4, vf0 (.mul.w.vf acc vf4 vf0) @@ -1779,7 +1779,7 @@ (.add.mul.z.vf vf8 vf3 vf8 acc :mask #b0111) ;;sqc2 vf7, 32(a1) (.svf (-> dst 2) vf7) - + ;;beq v1, r0, L3 ;;daddiu a1, a1, 64 ;;(&!+ dst 64) diff --git a/goal_src/engine/math/quaternion.gc b/goal_src/engine/math/quaternion.gc index f4eecf81b5..b178405049 100644 --- a/goal_src/engine/math/quaternion.gc +++ b/goal_src/engine/math/quaternion.gc @@ -347,7 +347,7 @@ ) (defun quaternion-right-mult-matrix! ((arg0 matrix) (arg1 quaternion)) - "Place quaternion coefficients into a matrix. + "Place quaternion coefficients into a matrix. You can convert a quaternion to a matrix by taking the product of this right-mult and left-mult matrix, but this method is not used. Instead, quaternion->matrix is a more efficient implementation." diff --git a/goal_src/engine/math/transform-h.gc b/goal_src/engine/math/transform-h.gc index 13fd0b4e0b..01fc49be3c 100644 --- a/goal_src/engine/math/transform-h.gc +++ b/goal_src/engine/math/transform-h.gc @@ -18,7 +18,6 @@ :flag-assert #x900000030 ) - ;; Like transform, but it's a basic. ;; some in-game objects have trs as their parent type to represent their location in the game world. (deftype trs (basic) diff --git a/goal_src/engine/math/transformq-h.gc b/goal_src/engine/math/transformq-h.gc index c418b470fd..2c4c49d0b5 100644 --- a/goal_src/engine/math/transformq-h.gc +++ b/goal_src/engine/math/transformq-h.gc @@ -38,11 +38,11 @@ (transv vector :inline :offset-assert 64) ;; velocity (meters/second) (rotv vector :inline :offset-assert 80) ;; angular velocity (deg/second) (scalev vector :inline :offset-assert 96) ;; scale velocity (unused?) - + ;; there's a hacky ~first-order orientation yaw control with hysteresis ;; it makes the yaw change smoothly and attempts to cancel out oscillations from the collision system (dir-targ quaternion :inline :offset-assert 112) ;; direction target - (angle-change-time time-frame :offset-assert 128) ;; the time when we change rotation directions + (angle-change-time time-frame :offset-assert 128) ;; the time when we change rotation directions (old-y-angle-diff float :offset-assert 136) ;; the amount we moved last time ) :method-count-assert 28 @@ -66,8 +66,8 @@ (global-y-angle-to-point (_type_ vector) float 23) (relative-y-angle-to-point (_type_ vector) float 24) (roll-relative-to-gravity (_type_) float 25) - (TODO-RENAME-26 (_type_ int vector float) trsqv 26) - + (set-and-limit-velocity (_type_ int vector float) trsqv 26) + ;; note: child classes can override this method to use a different quaternion ;; to represent the "current" orientation for the above methods. (get-quaternion (_type_) quaternion 27) @@ -75,7 +75,7 @@ ) (defmethod global-y-angle-to-point trsqv ((obj trsqv) (arg0 vector)) - "Get the angle in the xy plane from the position of this trsqv to the point arg0." + "Get the angle in the xz plane from the position of this trsqv to the point arg0." (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans))) ) diff --git a/goal_src/engine/math/trigonometry.gc b/goal_src/engine/math/trigonometry.gc index 22fc7325cf..dc29cd8497 100644 --- a/goal_src/engine/math/trigonometry.gc +++ b/goal_src/engine/math/trigonometry.gc @@ -264,7 +264,7 @@ ;;(.madda.s f2-0 f8-0) (set! acc (+ acc (* f2-0 f8-0))) ;;(.madda.s f4-0 f9-0) - (set! acc (+ acc (* f4-0 f9-0))) + (set! acc (+ acc (* f4-0 f9-0))) ;;(.madda.s f5-0 f10-0) (set! acc (+ acc (* f5-0 f10-0))) ;;(.madd.s f12-0 f6-0 f11-0) @@ -280,7 +280,7 @@ ) ) -;; +;; (define *sin-poly-vec2* (new 'static 'vector :x (the-as float #x3f7fffde) :y 0.0 @@ -369,7 +369,7 @@ ;;(.mula.s f7-0 f7-0) (set! acc (* f7-0 f7-0)) ;;(.madda.s f8-0 f1-0) - (set! acc (+ acc (* f8-0 f1-0))) + (set! acc (+ acc (* f8-0 f1-0))) ;;(.madda.s f9-0 f3-0) (set! acc (+ acc (* f9-0 f3-0))) ;;(.madda.s f10-0 f4-0) @@ -394,7 +394,7 @@ Radians, with no wrapping. Uses taylor series with 4 coefficients." (rlet ((vf0 :class vf) ;; 0,0,0,1 (vf1 :class vf) ;; src - (vf2 :class vf) ;; + (vf2 :class vf) ;; (vf3 :class vf) ;; src^2's (vf4 :class vf) (vf5 :class vf) @@ -701,7 +701,7 @@ (.mov temp (the-as float #x3f000000)) ;; 0.5 ;;(.vmulx.xyzw vf1 vf1 vf2) (.mul.x.vf vf1 vf1 temp) - + ;;(.vftoi0.xyzw vf1 vf1) (.ftoi.vf vf1 vf1) ;;(.qmtc2.i vf2 v1-0) @@ -775,7 +775,7 @@ (f18 :class fpr :type float) (acc :class fpr :type float) ) - + ;;mtc1 f20, a1 (set! f20 arg1) ;;mtc1 f21, a0 @@ -828,22 +828,22 @@ (set! acc (+ f1 f19)) ;;madda.s f3, f12 (set! acc (+ acc (* f3 f12))) - + ;;madda.s f5, f13 (set! acc (+ acc (* f5 f13))) - + ;;madda.s f6, f14 (set! acc (+ acc (* f6 f14))) - + ;;madda.s f7, f15 (set! acc (+ acc (* f7 f15))) - + ;;madda.s f8, f16 (set! acc (+ acc (* f8 f16))) - + ;;madda.s f9, f17 (set! acc (+ acc (* f9 f17))) - + ;;madd.s f19, f10, f18 ;;mfc1 v0, f19 (+ acc (* f10 f18)) @@ -981,9 +981,9 @@ ) ;; magic numbers for exp. -(define exp-slead +(define exp-slead (new 'static 'array float 32 - (the-as float #x3f800000) + (the-as float #x3f800000) (the-as float #x3f82cd80) (the-as float #x3f85aac0) (the-as float #x3f889800) @@ -1020,7 +1020,7 @@ (define exp-strail (new 'static 'array float 32 - (the-as float #x0) + (the-as float #x0) (the-as float #x35531585) (the-as float #x34d9f312) (the-as float #x35e8092e) @@ -1090,36 +1090,36 @@ (set! f1 (the-as float #x435c6bba)) ;;(b! (>=.s f1 f0) L44 (nop!)) (when-goto (>= f1 f0) L44) - + (set! f0 0.0) (set! f1 arg) ;;(b! (>=.s f0 f1) L42 (nop!)) (when-goto (>= f0 f1) L42) - + (set! v0 (the-as float #x7f7fffff)) ;;(b! #t L43 (nop!)) (goto L43) - + (label L42) (set! v0 (the-as float #x0)) - + (label L43) ;;(b! #t L49 (nop!)) (goto L49) - + (label L44) (set! f1 (the-as float #x33000000)) ;;(b! (>=.s f0 f1) L45 (nop!)) (when-goto (>= f0 f1) L45) - + (set! f0 (the-as float #x3f800000)) (set! f1 arg) (set! f0 (+ f0 f1)) (set! v0 f0) ;;(b! #t L49 (nop!)) (goto L49) - + (label L45) (set! f16 (the-as float #x4238aa3b)) (set! f12 (the-as float #x3cb17200)) @@ -1138,7 +1138,7 @@ ;;(bl! (<0.si t0) L46 (no-delay!)) ;;(set! t0 (- t0)) (set! t0 (abs t0)) - + ;;(label L46) ;;(b! (>=.si a3 t0) L47 (nop!)) (when-goto (>= a3 t0) L47) @@ -1155,7 +1155,7 @@ ;;(b! #t L48 (set! f2 (-.s f17 f18))) (set! f2 (- f17 f18)) (goto L48) - + (label L47) ;;(set! f17 (gpr->fpr a2)) ;;(set! f17 (i2f f17)) @@ -1163,7 +1163,7 @@ (set! f17 (* f17 f12)) (set! f0 arg) (set! f2 (- f0 f17)) - + (label L48) (set! a0-2 (- a2)) ;;(set! f17 (gpr->fpr a0)) diff --git a/goal_src/engine/math/vector-h.gc b/goal_src/engine/math/vector-h.gc index d8aef8d0d1..3e503c7f51 100644 --- a/goal_src/engine/math/vector-h.gc +++ b/goal_src/engine/math/vector-h.gc @@ -57,7 +57,7 @@ ) (defmethod asize-of bit-array ((obj bit-array)) - "Get the size in memory. + "Get the size in memory. It is wrong and says its one byte longer, which is safe." (the-as int (+ (-> obj type size) @@ -624,27 +624,27 @@ (.lvf vf1 a) ;; (.lqc2 vf2 0 arg1) (.lvf vf2 b) - + ;; (.vmul.xyzw vf1 vf1 vf2) ;; set vf1 to element-wise products (.mul.vf vf1 vf1 vf2) - + ;; (.vaddw.x vf3 vf0 vf0) ;; set vf3x to 1 (.xor.vf vf3 vf3 vf3) (.add.w.vf vf3 vf0 vf0 :mask #b1) - + ;; (.vmulax.x acc vf3 vf1) ;; acc.x is now (xa * xb) (.mul.x.vf acc vf3 vf1 :mask #b1) - + ;; (.vmadday.x acc vf3 vf1) ;; acc += thing (.add.mul.y.vf acc vf3 vf1 acc :mask #b1) - + ;; (.vmaddaz.x acc vf3 vf1) (.add.mul.z.vf acc vf3 vf1 acc :mask #b1) - + ;; (.vmaddw.x vf1 vf3 vf1) (.add.mul.w.vf vf1 vf3 vf1 acc :mask #b1) ;; (.qmfc2.i v0-0 vf1) diff --git a/goal_src/engine/math/vector.gc b/goal_src/engine/math/vector.gc index 474ab0c8b5..82ae6ddb0d 100644 --- a/goal_src/engine/math/vector.gc +++ b/goal_src/engine/math/vector.gc @@ -99,7 +99,7 @@ ) (defun vector/! ((arg0 vector) (arg1 vector) (arg2 vector)) - "Set arg0 = arg1 / arg2. The w component will be set to 1. + "Set arg0 = arg1 / arg2. The w component will be set to 1. The implementation is kind of crazy." (rlet ((Q :class vf) (vf0 :class vf) @@ -119,7 +119,7 @@ ;; use FPU to divide x while VU0 is dividing y. (let ((v1-0 (/ (-> arg1 data 0) (-> arg2 data 0)))) (.wait.vf) - + (.mul.vf vf6 vf4 Q :mask #b10) (.nop.vf) (.nop.vf) @@ -274,7 +274,7 @@ (defun vector= ((arg0 vector) (arg1 vector)) "Are the two vectors equal? Does not compare the w component. The implementation is cool." - + ;; (label L91) ;; (set! v0-0 #t) ;; (set! v1-0 #xffff) @@ -299,12 +299,12 @@ (set! v1-1 (+ v1-1 1)) (zero? v1-1) ) - + ;; (b! (zero? v1-3) L92 (nop!)) ;; (set! v0-0 #f) ;; (label L92) ;; (ret-value v0-0) - + ) (defun vector-delta ((arg0 vector) (arg1 vector)) @@ -383,7 +383,7 @@ (+! (-> vec data 2) z-step) ) (else - ;; not in range. + ;; not in range. (let ((f2-6 (/ max-step step-len))) (+! (-> vec data 0) (* f2-6 x-step)) (+! (-> vec data 2) (* f2-6 z-step)) @@ -797,7 +797,7 @@ ) f0-0 ) - + ; (local-vars (v1-1 float)) ; (rlet ((acc :class vf) ; (Q :class vf) diff --git a/goal_src/engine/nav/navigate-h.gc b/goal_src/engine/nav/navigate-h.gc index 809114854a..2d4b55035b 100644 --- a/goal_src/engine/nav/navigate-h.gc +++ b/goal_src/engine/nav/navigate-h.gc @@ -13,24 +13,24 @@ :bitfield #t :type uint32 (display-marks 0) - (bit1 1) ;; TODO - nav-control::9 - (bit2 2) ;; TODO - nav-control::9 - (bit3 3) ;; TODO - nav-enemy::45 | nav-control::9 - (bit4 4) ;; TODO - nav-control::9 - (bit5 5) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 - (bit6 6) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 - (bit7 7) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 - (bit8 8) - (bit9 9) ;; TODO - nav-control::14 | 11 - (bit10 10) ;; TODO - nav-enemy::nav-enemy-patrol-post - (bit11 11) ;; TODO - nav-control::28 - (bit12 12) ;; TODO - rolling-lightning-mole::(enter nav-enemy-chase fleeing-nav-enemy) - (bit13 13) - (bit17 17) ;; TODO - nav-control::11 - (bit18 18) ;; TODO - nav-control::11 - (bit19 19) ;; TODO - nav-control::11 | 17 - (bit20 20) ;; TODO - nav-mesh::28 - (bit21 21) ;; TODO - nav-control::19 + (navcf1 1) ;; TODO - nav-control::9 + (navcf2 2) ;; TODO - nav-control::9 + (navcf3 3) ;; TODO - nav-enemy::45 | nav-control::9 + (navcf4 4) ;; TODO - nav-control::9 + (navcf5 5) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 + (navcf6 6) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 + (navcf7 7) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 + (navcf8 8) + (navcf9 9) ;; TODO - nav-control::14 | 11 + (navcf10 10) ;; TODO - nav-enemy::nav-enemy-patrol-post + (navcf11 11) ;; TODO - nav-control::28 + (navcf12 12) ;; TODO - rolling-lightning-mole::(enter nav-enemy-chase fleeing-nav-enemy) + (navcf13 13) + (navcf17 17) ;; TODO - nav-control::11 + (navcf18 18) ;; TODO - nav-control::11 + (navcf19 19) ;; TODO - nav-control::11 | 17 + (navcf20 20) ;; TODO - nav-mesh::28 + (navcf21 21) ;; TODO - nav-control::19 ) (deftype nav-poly (structure) @@ -291,74 +291,65 @@ ) ) -(defun nav-mesh-connect ((proc process) (trans trsqv) (nav-cont nav-control)) - (with-pp - ;; try to find an entity with a nav-mesh, first from the given process - (let ((ent (-> proc entity))) - (when (zero? (-> (the-as entity-actor ent) nav-mesh)) - ;; and if that doesn't have one already, lookup from the res-lump - (let ((lookup-entity (entity-actor-lookup (the-as res-lump ent) 'nav-mesh-actor 0))) - (if lookup-entity - (set! ent lookup-entity) - ) - ) +(defbehavior nav-mesh-connect process ((proc process) (trans trsqv) (nav-cont nav-control)) + ;; try to find an entity with a nav-mesh, first from the given process + (let ((ent (-> proc entity))) + (when (zero? (-> ent nav-mesh)) + ;; and if that doesn't have one already, lookup from the res-lump + (let ((lookup-entity (entity-actor-lookup ent 'nav-mesh-actor 0))) + (if lookup-entity + (set! ent lookup-entity) + ) ) + ) - ;; now, look at the nav-mesh from the entity - (let ((entity-nav-mesh (-> (the-as entity-actor ent) nav-mesh))) - (cond - ((nonzero? entity-nav-mesh) - ;; we have a nav mesh mesh already - (when (zero? (-> entity-nav-mesh user-list)) - ;; but, no engine, maybe because this is the first time we're doing this for the level. + ;; now, look at the nav-mesh from the entity + (let ((entity-nav-mesh (-> ent nav-mesh))) + (cond + ((nonzero? entity-nav-mesh) + ;; we have a nav mesh mesh already + (when (zero? (-> entity-nav-mesh user-list)) + ;; but, no engine, maybe because this is the first time we're doing this for the level. - ;; this seems like a bit of a hack. We'd like to allocate the engine on a level heap. - ;; but I guess we can't assume that process-level-heap is set correctly here. - ;; so we grab the entity-links from the current pp's entity, and look at that level. - ;; I'm not sure why we do this on the current pp instead of the proc we were given... - (set! process-level-heap - (-> (the-as entity-links (-> (the-as entity (-> pp entity)) extra)) level heap) - ) + ;; this seems like a bit of a hack. We'd like to allocate the engine on a level heap. + ;; but I guess we can't assume that process-level-heap is set correctly here. + ;; so we grab the entity-links from the current pp's entity, and look at that level. + ;; I'm not sure why we do this on the current pp instead of the proc we were given... + (set! process-level-heap (-> self entity extra level heap)) - ;; now construct the engine, looking up the size from the res-lump. - (set! (-> entity-nav-mesh user-list) - (new 'process-level-heap 'engine 'nav-engine - (res-lump-value ent 'nav-max-users int :default (the-as uint128 32)) - ) - ) + ;; now construct the engine, looking up the size from the res-lump. + (set! (-> entity-nav-mesh user-list) + (new 'process-level-heap 'engine 'nav-engine + (res-lump-value ent 'nav-max-users int :default (the-as uint128 32)) + ) + ) - ;; do some setup - (initialize-mesh! entity-nav-mesh) - (update-route-table entity-nav-mesh) + ;; do some setup + (initialize-mesh! entity-nav-mesh) + (update-route-table entity-nav-mesh) + ) + + ;; in all cases, do the connection + ;; connect the nav-mesh engine: + (add-connection (-> entity-nav-mesh user-list) + proc ;; to the given process + nothing ;; no function + ;; and some weird parameters. + proc + nav-cont + trans + ) + ) + (else + ;; we couldn't find a nav-mesh. Set a bit. + (if (and nav-cont (-> proc entity)) + (logior! (-> proc entity extra perm status) (entity-perm-status bit-1)) ) - - ;; in all cases, do the connection - ;; connect the nav-mesh engine: - (add-connection (-> entity-nav-mesh user-list) - proc ;; to the given process - nothing ;; no function - ;; and some weird parameters. - proc - nav-cont - trans - ) - ) - (else - ;; we couldn't find a nav-mesh. Set a bit. - (if (and nav-cont (-> proc entity)) - (logior! (-> (the-as entity-links (-> (the-as entity (-> proc entity)) extra)) - perm - status - ) - (entity-perm-status bit-1) - ) - ) - ;; no nav-mesh, so give us a default-nav-mesh. - (set! entity-nav-mesh *default-nav-mesh*) - ) - ) - entity-nav-mesh + ;; no nav-mesh, so give us a default-nav-mesh. + (set! entity-nav-mesh *default-nav-mesh*) + ) ) + entity-nav-mesh ) ) ) @@ -371,7 +362,7 @@ (goto cfg-4) ) (set! (-> obj max-spheres) sphere-count) - (set! (-> obj flags) (nav-control-flags bit8 bit13)) + (set! (-> obj flags) (nav-control-flags navcf8 navcf13)) (set! (-> obj mesh) (nav-mesh-connect (-> shape process) shape obj)) (let ((ent (-> shape process entity))) (set! (-> obj nearest-y-threshold) diff --git a/goal_src/engine/nav/navigate.gc b/goal_src/engine/nav/navigate.gc index 679f9e3e0b..e8c34bc228 100644 --- a/goal_src/engine/nav/navigate.gc +++ b/goal_src/engine/nav/navigate.gc @@ -5,6 +5,13 @@ ;; name in dgo: navigate ;; dgos: GAME, ENGINE +;; note: added this to avoid a bug where enemies with NaN positions end up inside the nav mesh. +;; it's not clear yet why the enemies have NaN positions, but nothing else seems to go wrong if we +;; ignore them here. It's possible this happens as enemies are spawned/despawned by the visibility system. +(defmacro is-nan? (flt) + `(and (< 0.0 ,flt) (< ,flt 0.0)) + ) + ;; DECOMP BEGINS (define *nav-timer* (new 'global 'stopwatch)) @@ -133,37 +140,28 @@ ) (define *default-nav-mesh* (new 'static 'nav-mesh - :bounds - (new 'static 'sphere :x 12288.0 :y -200704.0 :z 12288.0 :w 20480.0) - :origin - (new 'static 'vector :y -200704.0 :w 1.0) + :bounds (new 'static 'sphere :x 12288.0 :y -200704.0 :z 12288.0 :w 20480.0) + :origin (new 'static 'vector :y -200704.0 :w 1.0) :vertex-count 4 - :vertex - (new 'static 'inline-array nav-vertex 4 + :vertex (new 'static 'inline-array nav-vertex 4 (new 'static 'nav-vertex :z 16384.0 :w 1.0) (new 'static 'nav-vertex :z 8192.0 :w 1.0) (new 'static 'nav-vertex :x 8192.0 :z 8192.0 :w 1.0) (new 'static 'nav-vertex :x 8192.0 :w 1.0) ) :poly-count 2 - :poly - (new 'static 'inline-array nav-poly 2 + :poly (new 'static 'inline-array nav-poly 2 (new 'static 'nav-poly - :vertex - (new 'static 'array uint8 3 #x0 #x2 #x1) - :adj-poly - (new 'static 'array uint8 3 #xff #x1 #xff) + :vertex (new 'static 'array uint8 3 #x0 #x2 #x1) + :adj-poly (new 'static 'array uint8 3 #xff #x1 #xff) ) (new 'static 'nav-poly :id #x1 - :vertex - (new 'static 'array uint8 3 #x1 #x2 #x3) - :adj-poly - (new 'static 'array uint8 3 #x0 #xff #xff) + :vertex (new 'static 'array uint8 3 #x1 #x2 #x3) + :adj-poly (new 'static 'array uint8 3 #x0 #xff #xff) ) ) - :route - (new 'static 'inline-array vector4ub 4 + :route (new 'static 'inline-array vector4ub 4 (new 'static 'vector4ub :data (new 'static 'array uint8 4 #xcb #x0 #x0 #x0)) (new 'static 'vector4ub) (new 'static 'vector4ub) @@ -190,7 +188,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! gp-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 0)))) (vector+! s4-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 1)))) arg1 @@ -199,7 +197,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! gp-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 1)))) (vector+! s4-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 2)))) arg1 @@ -208,7 +206,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! gp-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 2)))) (vector+! s4-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 0)))) arg1 @@ -236,20 +234,11 @@ (vector+! arg1 arg1 (-> obj origin)) ) -(define - *edge-vert0-table* - (the-as (array int8) (new 'static 'boxed-array :type int8 :length 3 :allocated-length 3 1 2 0)) - ) +(define *edge-vert0-table* (the-as (array int8) (new 'static 'boxed-array :type int8 1 2 0))) -(define - *edge-vert1-table* - (the-as (array int8) (new 'static 'boxed-array :type int8 :length 3 :allocated-length 3 2 0 1)) - ) +(define *edge-vert1-table* (the-as (array int8) (new 'static 'boxed-array :type int8 2 0 1))) -(define - *edge-mask-table* - (the-as (array int8) (new 'static 'boxed-array :type int8 :length 3 :allocated-length 3 1 2 4)) - ) +(define *edge-mask-table* (the-as (array int8) (new 'static 'boxed-array :type int8 1 2 4))) (defun inc-mod3 ((arg0 int)) (local-vars (v0-1 int) (v1-1 int)) @@ -1177,14 +1166,14 @@ (let ((v1-1 (find-poly-fast obj arg0 arg1))) (when v1-1 (if arg2 - (set! (-> arg2 0) (logior (nav-control-flags bit20) (-> arg2 0))) + (set! (-> arg2 0) (logior (nav-control-flags navcf20) (-> arg2 0))) ) (set! s3-1 v1-1) (goto cfg-14) ) ) (if arg2 - (logclear! (-> arg2 0) (nav-control-flags bit20)) + (logclear! (-> arg2 0) (nav-control-flags navcf20)) ) (let ((s2-0 (new 'stack-no-clear 'inline-array 'nav-vertex 3))) (set! s3-1 (the-as nav-poly #f)) @@ -1632,19 +1621,19 @@ (when #t (set! (-> s5-0 debug-time) (the-as uint (-> *display* actual-frame-counter))) (add-debug-sphere - (logtest? (-> obj flags) (nav-control-flags bit1)) - (bucket-id debug-draw0) + (logtest? (-> obj flags) (nav-control-flags navcf1)) + (bucket-id debug) (-> s5-0 bounds) (-> s5-0 bounds w) (new 'static 'rgba :r #xff :g #xff :a #x20) ) - (add-debug-vector #t (bucket-id debug-draw1) (-> s5-0 origin) *x-vector* (meters 1.0) *color-red*) - (add-debug-vector #t (bucket-id debug-draw1) (-> s5-0 origin) *z-vector* (meters 1.0) *color-blue*) - (when (logtest? (-> obj flags) (nav-control-flags bit2)) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *x-vector* (meters 1.0) *color-red*) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *z-vector* (meters 1.0) *color-blue*) + (when (logtest? (-> obj flags) (nav-control-flags navcf2)) (dotimes (s3-0 (-> s5-0 vertex-count)) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! s4-0 (-> s5-0 origin) (the-as vector (-> s5-0 vertex s3-0))) *color-green* ) @@ -1680,9 +1669,9 @@ (set! (-> s0-0 x) (- (-> a0-15 x) (-> v1-20 x))) (set! (-> s0-0 y) (+ (-> a0-15 y) (-> v1-20 y))) (set! (-> s0-0 z) (+ (-> a0-15 z) (-> v1-20 z))) - (add-debug-line #t (bucket-id debug-draw1) sv-192 s2-0 (the-as rgba sv-208) #f (the-as rgba -1)) - (add-debug-line #t (bucket-id debug-draw1) s2-0 s1-0 (the-as rgba sv-208) #f (the-as rgba -1)) - (add-debug-line #t (bucket-id debug-draw1) s1-0 s0-0 (the-as rgba sv-208) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) sv-192 s2-0 (the-as rgba sv-208) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) s2-0 s1-0 (the-as rgba sv-208) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) s1-0 s0-0 (the-as rgba sv-208) #f (the-as rgba -1)) (let ((t9-7 add-debug-line) (a0-19 #t) (a1-13 68) @@ -1695,7 +1684,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit3)) + (when (logtest? (-> obj flags) (nav-control-flags navcf3)) (dotimes (s3-2 (-> s5-0 poly-count)) (let ((s2-1 (-> s5-0 poly s3-2))) (debug-draw-poly s5-0 s2-1 (the-as rgba (cond @@ -1720,7 +1709,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit4)) + (when (logtest? (-> obj flags) (nav-control-flags navcf4)) (let ((s1-1 add-debug-text-3d) (s0-1 #t) ) @@ -1744,7 +1733,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit5)) + (when (logtest? (-> obj flags) (nav-control-flags navcf5)) (if (-> obj next-poly) (debug-draw-poly s5-0 (-> obj next-poly) *color-cyan*) ) @@ -1755,10 +1744,10 @@ (debug-draw-poly s5-0 (-> obj current-poly) *color-red*) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit7)) + (when (logtest? (-> obj flags) (nav-control-flags navcf7)) (dotimes (s3-3 (the-as int (-> s5-0 static-sphere-count))) (let ((s2-2 (-> s5-0 static-sphere s3-3))) - (add-debug-sphere #t (bucket-id debug-draw0) (the-as vector s2-2) (-> s2-2 trans w) *color-blue*) + (add-debug-sphere #t (bucket-id debug) (the-as vector s2-2) (-> s2-2 trans w) *color-blue*) (let ((s1-2 add-debug-text-3d) (s0-2 #t) ) @@ -1788,7 +1777,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit6)) + (when (logtest? (-> obj flags) (nav-control-flags navcf6)) (when (and (-> obj portal 0) (-> obj portal 1)) (let ((v1-80 (-> s5-0 origin)) (a2-22 (new 'stack-no-clear 'vector)) @@ -1796,7 +1785,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! a2-22 v1-80 (the-as vector (-> obj portal 0))) (vector+! a3-13 v1-80 (the-as vector (-> obj portal 1))) (new 'static 'rgba :r #xff :g #x80 :b #x40 :a #x80) @@ -1807,7 +1796,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj shape trans) (-> obj travel) (meters 0.00024414062) @@ -1815,7 +1804,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! (new 'stack-no-clear 'vector) (-> obj shape trans) (new 'static 'vector :y 4096.0 :w 1.0)) (-> obj old-travel) (meters 0.00024414062) @@ -1823,15 +1812,15 @@ ) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! (new 'stack-no-clear 'vector) (-> obj shape trans) (-> obj travel)) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit7)) + (when (logtest? (-> obj flags) (nav-control-flags navcf7)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> obj shape root-prim prim-core)) (-> obj shape nav-radius) (new 'static 'rgba :g #xff :b #xff :a #x20) @@ -1841,7 +1830,7 @@ (vector+! s4-0 (-> s5-0 origin) (the-as vector (&-> v1-95 x))) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 (- (-> v1-95 w) (-> obj shape nav-radius)) (new 'static 'rgba :g #xff :b #xff :a #x20) @@ -1890,7 +1879,7 @@ (defmethod set-current-poly! nav-control ((obj nav-control) (arg0 nav-poly)) (set! (-> obj current-poly) arg0) - (logior! (-> obj flags) (nav-control-flags bit9)) + (logior! (-> obj flags) (nav-control-flags navcf9)) 0 (none) ) @@ -1937,7 +1926,7 @@ ) (defun add-collide-shape-spheres ((arg0 nav-control) (arg1 collide-shape) (arg2 vector)) - (when (logtest? (-> arg1 nav-flags) 1) + (when (logtest? (-> arg1 nav-flags) (nav-flags navf0)) (set! (-> arg2 quad) (-> arg1 root-prim prim-core world-sphere quad)) (set! (-> arg2 w) (-> arg1 nav-radius)) (let ((s4-0 arg0) @@ -1959,7 +1948,7 @@ ) 0 ) - (when (logtest? (-> arg1 nav-flags) 2) + (when (logtest? (-> arg1 nav-flags) (nav-flags navf1)) (let ((s5-1 (-> arg1 process nav extra-nav-sphere))) (when (< (-> arg0 num-spheres) (-> arg0 max-spheres)) (let* ((s4-1 (-> arg0 sphere (-> arg0 num-spheres))) @@ -1995,13 +1984,15 @@ (s3-0 (new 'stack-no-clear 'vector)) ) (when (and *target* - (or (logtest? (-> obj flags) (nav-control-flags bit11)) (logtest? (-> *target* state-flags) #x80f8)) + (or (logtest? (-> obj flags) (nav-control-flags navcf11)) + (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying)) + ) ) (let ((s2-0 obj) (s1-0 (-> *target* control)) ) (let ((s0-0 s3-0)) - (when (logtest? (-> s1-0 nav-flags) 1) + (when (logtest? (-> s1-0 nav-flags) (nav-flags navf0)) (set! (-> s0-0 quad) (-> s1-0 root-prim prim-core world-sphere quad)) (set! (-> s0-0 w) (-> s1-0 nav-radius)) (set! sv-32 s2-0) @@ -2021,7 +2012,7 @@ 0 ) ) - (when (logtest? (-> s1-0 nav-flags) 2) + (when (logtest? (-> s1-0 nav-flags) (nav-flags navf1)) (let ((s1-1 (-> s1-0 process nav extra-nav-sphere))) (when (< (-> s2-0 num-spheres) (-> s2-0 max-spheres)) (let* ((s0-1 (-> s2-0 sphere (-> s2-0 num-spheres))) @@ -2041,7 +2032,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit13)) + (when (logtest? (-> obj flags) (nav-control-flags navcf13)) (countdown (s2-1 (-> obj mesh static-sphere-count)) (let ((s1-2 obj) (s0-2 (-> obj mesh static-sphere s2-1)) @@ -2071,7 +2062,7 @@ (when (not (or (= s0-3 (-> obj shape)) (zero? (logand arg0 (-> s0-3 root-prim prim-core collide-as))))) (let ((s1-3 obj)) (set! sv-112 s3-0) - (when (logtest? (-> s0-3 nav-flags) 1) + (when (logtest? (-> s0-3 nav-flags) (nav-flags navf0)) (set! (-> sv-112 quad) (-> s0-3 root-prim prim-core world-sphere quad)) (set! (-> sv-112 w) (-> s0-3 nav-radius)) (set! sv-80 s1-3) @@ -2081,7 +2072,9 @@ (f0-9 (+ (-> sv-112 w) (-> sv-80 shape nav-radius))) (f2-17 (+ 40960.0 f0-9)) ) - (when (< f1-3 (* f2-17 f2-17)) + ;; HACK: added a NaN check here. it seems like some enemies have bogus positions (maybe on their first frame?) + ;; and in these cases we shouldn't bother including them in the mesh. + (when (and (< f1-3 (* f2-17 f2-17)) (not (is-nan? (-> sv-112 x)))) (let ((v1-94 sv-96) (a0-47 (-> sv-80 mesh origin)) ) @@ -2094,7 +2087,7 @@ ) 0 ) - (when (logtest? (-> s0-3 nav-flags) 2) + (when (logtest? (-> s0-3 nav-flags) (nav-flags navf1)) (let ((s0-4 (-> s0-3 process nav extra-nav-sphere))) (when (< (-> s1-3 num-spheres) (-> s1-3 max-spheres)) (set! sv-128 (-> s1-3 sphere (-> s1-3 num-spheres))) @@ -2466,7 +2459,7 @@ (set! (-> obj blocked-travel quad) (-> obj travel quad)) (let ((f0-0 (vector-xz-length (-> obj travel)))) (when (and (>= f30-0 f0-0) (< f0-0 204.8)) - (set! (-> obj flags) (logior (nav-control-flags bit17) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf17) (-> obj flags))) (set! (-> obj block-time) (-> *display* base-frame-counter)) (set! (-> obj block-count) (+ 1.0 (-> obj block-count))) (if (-> obj block-event) @@ -2504,21 +2497,21 @@ ) (cond ((or (vector= arg2 (-> obj target-pos)) (< (fabs f28-0) 364.0889)) - (set! (-> obj flags) (logior (nav-control-flags bit21) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf21) (-> obj flags))) (set! (-> arg0 quad) (-> arg2 quad)) ) (else (let ((s2-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg1 quat)))) (vector-rotate-y! s2-1 s2-1 (fmax (fmin f28-0 f30-0) (- f30-0))) (vector-normalize! s2-1 819.2) - (logclear! (-> obj flags) (nav-control-flags bit21)) + (logclear! (-> obj flags) (nav-control-flags navcf21)) (vector+! arg0 (-> arg1 trans) s2-1) ) (when (or (not (dummy-16 obj arg0)) - (logtest? (nav-control-flags bit17) (-> obj flags)) - (zero? (logand (-> obj flags) (nav-control-flags bit10))) + (logtest? (nav-control-flags navcf17) (-> obj flags)) + (zero? (logand (-> obj flags) (nav-control-flags navcf10))) ) - (set! (-> obj flags) (logior (nav-control-flags bit21) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf21) (-> obj flags))) (vector-! (-> obj travel) arg2 (-> arg1 trans)) (set! (-> arg0 quad) (-> arg2 quad)) ) @@ -2718,7 +2711,7 @@ v1-0 (-> obj current-poly) (-> obj travel) - (zero? (logand (-> obj flags) (nav-control-flags bit12))) + (zero? (logand (-> obj flags) (nav-control-flags navcf12))) arg0 arg1 ) @@ -2925,7 +2918,7 @@ sv-84 sv-88 (-> obj travel) - (zero? (logand (-> obj flags) (nav-control-flags bit12))) + (zero? (logand (-> obj flags) (nav-control-flags navcf12))) 204.8 s5-1 ) @@ -2965,10 +2958,10 @@ (defmethod dummy-11 nav-control ((obj nav-control) (arg0 vector)) (set! (-> obj old-travel quad) (-> obj travel quad)) (-> obj block-count) - (set! (-> obj block-count) (seek (-> obj block-count) 0.0 0.016666668)) - (logclear! (-> obj flags) (nav-control-flags bit9 bit17 bit18 bit19)) + (seek! (-> obj block-count) 0.0 0.016666668) + (logclear! (-> obj flags) (nav-control-flags navcf9 navcf17 navcf18 navcf19)) (TODO-RENAME-27 obj) - (if (logtest? (-> obj flags) (nav-control-flags bit8)) + (if (logtest? (-> obj flags) (nav-control-flags navcf8)) (TODO-RENAME-28 obj (collide-kind background cak-1 @@ -3043,7 +3036,7 @@ (let ((s5-1 (new 'stack-no-clear 'nav-gap-info))) (when (< (vector-xz-length (-> obj travel)) 204.8) (cond - ((logtest? (nav-control-flags bit17) (-> obj flags)) + ((logtest? (nav-control-flags navcf17) (-> obj flags)) ) ((-> obj next-poly) (cond @@ -3061,7 +3054,7 @@ ) ) (else - (set! (-> obj flags) (logior (nav-control-flags bit19) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf19) (-> obj flags))) ) ) ) diff --git a/goal_src/engine/nav/path.gc b/goal_src/engine/nav/path.gc index 18fd5902e9..5fa8a5a60f 100644 --- a/goal_src/engine/nav/path.gc +++ b/goal_src/engine/nav/path.gc @@ -35,7 +35,7 @@ (if (and (logtest? (-> obj flags) (path-control-flag draw-line)) (< s5-1 (+ (-> obj curve num-cverts) -1))) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-1 (-> obj cverts (+ s5-1 1)) (new 'static 'rgba :r #xff :g #x80 :a #x80) @@ -44,7 +44,7 @@ ) ) (if (logtest? (-> obj flags) (path-control-flag draw-point)) - (add-debug-x #t (bucket-id debug-draw1) s4-1 (new 'static 'rgba :r #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-1 (new 'static 'rgba :r #xff :a #x80)) ) (when (logtest? (-> obj flags) (path-control-flag draw-text)) (let ((s3-1 add-debug-text-3d) @@ -292,7 +292,7 @@ (if (and (logtest? (-> obj flags) (path-control-flag draw-line)) (> (-> obj curve num-cverts) 0)) (add-debug-curve2 #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as curve (&-> obj cverts)) (new 'static 'rgba :r #xff :g #x80 :a #x80) #f @@ -301,7 +301,7 @@ (dotimes (s5-1 (-> obj curve num-cverts)) (let ((s4-1 (-> obj cverts s5-1))) (if (logtest? (-> obj flags) (path-control-flag draw-point)) - (add-debug-x #t (bucket-id debug-draw1) s4-1 (new 'static 'rgba :r #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-1 (new 'static 'rgba :r #xff :a #x80)) ) (when (logtest? (-> obj flags) (path-control-flag draw-text)) (let ((s3-1 add-debug-text-3d) diff --git a/goal_src/engine/physics/trajectory.gc b/goal_src/engine/physics/trajectory.gc index 7258b10455..7af595444d 100644 --- a/goal_src/engine/physics/trajectory.gc +++ b/goal_src/engine/physics/trajectory.gc @@ -97,7 +97,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) prev-pos pos (new 'static 'rgba :r #xff :a #x80) diff --git a/goal_src/engine/ps2/pad.gc b/goal_src/engine/ps2/pad.gc index 245c8294b4..90032db363 100644 --- a/goal_src/engine/ps2/pad.gc +++ b/goal_src/engine/ps2/pad.gc @@ -63,7 +63,7 @@ ;; DUALSHOCK 2 data ;; status = 0x70 | (data length / 2) (abutton uint8 12 :offset-assert 12) ;; pressure sensitivity information - + ;; pad buffer needs to be 32 bytes large. (dummy uint8 12 :offset-assert 24) ) @@ -200,6 +200,42 @@ ) ) +(defmacro analog-input-horizontal-first (in offset center-val max-val out-range) + "Same as analog-input but respects First-Person Horizontal camera control setting." + `(#if PC_PORT ;; first-person horizontal is NOT inverted in original game + (* (if (-> *pc-settings* first-camera-h-inverted?) -1.0 1.0) + (analog-input ,in ,offset ,center-val ,max-val ,out-range)) + (analog-input ,in ,offset ,center-val ,max-val ,out-range) + ) + ) + +(defmacro analog-input-vertical-first (in offset center-val max-val out-range) + "Same as analog-input but respects First-Person Vertical camera control setting." + `(#if PC_PORT ;; first-person vertical is already inverted in original game + (* (if (-> *pc-settings* first-camera-v-inverted?) 1.0 -1.0) + (analog-input ,in ,offset ,center-val ,max-val ,out-range)) + (analog-input ,in ,offset ,center-val ,max-val ,out-range) + ) + ) + +(defmacro analog-input-horizontal-third (in offset center-val max-val out-range) + "Same as analog-input but respects Third-Person Horizontal camera control setting." + `(#if PC_PORT ;; third-person horizontal is already inverted in original game + (* (if (-> *pc-settings* third-camera-h-inverted?) 1.0 -1.0) + (analog-input ,in ,offset ,center-val ,max-val ,out-range)) + (analog-input ,in ,offset ,center-val ,max-val ,out-range) + ) + ) + +(defmacro analog-input-vertical-third (in offset center-val max-val out-range) + "Same as analog-input but respects Third-Person Vertical camera control setting." + `(#if PC_PORT ;; third-person vertical is already inverted in original game + (* (if (-> *pc-settings* third-camera-v-inverted?) 1.0 -1.0) + (analog-input ,in ,offset ,center-val ,max-val ,out-range)) + (analog-input ,in ,offset ,center-val ,max-val ,out-range) + ) + ) + (defun cpad-set-buzz! ((pad cpad-info) (buzz-idx int) (buzz-amount int) (duration time-frame)) "Turn on vibration motor 'buzz-idx' for duration, at magnitude buzz-amount." (cond @@ -359,7 +395,7 @@ `(logtest? (cpad-hold ,pad-idx) (pad-buttons ,@buttons)) ) -(defmacro cpad-clear-buttons! (pad-idx &rest buttons) +(defmacro cpad-clear! (pad-idx &rest buttons) `(begin (logclear! (cpad-pressed ,pad-idx) (pad-buttons ,@buttons)) (logclear! (cpad-hold ,pad-idx) (pad-buttons ,@buttons)) @@ -381,10 +417,10 @@ (if (cpad-pressed? ,pad-idx ,x) ,(if (< i (- (length buttons) 1)) `(1+! ,cheat-var) - + `(begin ,@body (set! ,cheat-var 0)) ) - + (set! ,cheat-var 0) ) ) @@ -398,8 +434,8 @@ "play the appropriate sound for inputting a cheat code" `(if ,cheat? - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-menu") + (sound-play "cursor-options") ) ) diff --git a/goal_src/engine/ps2/timer-h.gc b/goal_src/engine/ps2/timer-h.gc index 97e17a81c5..40606dfd72 100644 --- a/goal_src/engine/ps2/timer-h.gc +++ b/goal_src/engine/ps2/timer-h.gc @@ -120,7 +120,7 @@ ;; needs PS2 TIMER porting (#unless PC_PORT (timer-init (the-as timer-bank TIMER1_BANK) (new 'static 'timer-mode :clks (timer-clock-selection busclk/16) :cue 1)) - ) + ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Profiler @@ -181,7 +181,6 @@ ) ) ) - ;; tentative name (defmethod get-last-frame-time-stamp profile-bar ((obj profile-bar)) diff --git a/goal_src/engine/ps2/vif-h.gc b/goal_src/engine/ps2/vif-h.gc index bcb4885316..b810a62c76 100644 --- a/goal_src/engine/ps2/vif-h.gc +++ b/goal_src/engine/ps2/vif-h.gc @@ -25,7 +25,7 @@ (er1 uint8 :offset 13 :size 1) (fqc uint8 :offset 24 :size 4) ) - + :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 diff --git a/goal_src/engine/ps2/vu1-macros.gc b/goal_src/engine/ps2/vu1-macros.gc index 51633b016f..ed3f79f119 100644 --- a/goal_src/engine/ps2/vu1-macros.gc +++ b/goal_src/engine/ps2/vu1-macros.gc @@ -147,7 +147,8 @@ ;; In the original game, init-for-transform stashed a bunch of stuff in registers, to be used by other functions. ;; In OpenGOAL, this seems risky so we're going to back up this manually. -;; This does mean this file now has code, but it's not a big deal: +;; This does mean this file now has code, but it's not a big deal. +;; This seems like it is very old GOAL code and is really only used for debug and a few weird leftovers. (deftype transform-regs (structure) ;; Eventually we might want to actually name some of these fields to be more comprehensible? (;; vf0 not included! diff --git a/goal_src/engine/sound/gsound-h.gc b/goal_src/engine/sound/gsound-h.gc index 12358035b3..b8510b91a7 100644 --- a/goal_src/engine/sound/gsound-h.gc +++ b/goal_src/engine/sound/gsound-h.gc @@ -10,10 +10,23 @@ ;; The EE sends commands using the IOP RPC system to the OVERLORD IOP driver telling it to load and play sounds. ;; There is also some sort of per-frame status update, that is not included here. +(defenum sound-group + :bitfield #t + :type uint8 + (sfx) + (music) + (dialog) + (sog3) + (ambient) + (sog5) + (sog6) + (sog7) + ) + (deftype sound-id (uint32) () (:methods - (dummy-9 () none 9) + (unused-9 () none 9) ;; unused ) :flag-assert #xa00000004 ) @@ -137,6 +150,20 @@ (default 49) ) +(defenum sound-mask + :bitfield #t + :type uint16 + (volume) + (pitch) + (bend) + (unused) + (time) + (trans) + (fo-min) + (fo-max) + (fo-curve) + ) + ;; like should match the sound type in OVERLORD ;; This is shared between all sound RPCs and acts like the header for the sound messages (deftype sound-rpc-cmd (structure) @@ -148,8 +175,9 @@ :flag-assert #x900000004 ) +;; playback parameters sent to the IOP. (deftype sound-play-parms (structure) - ((mask uint16 :offset-assert 0) + ((mask sound-mask :offset-assert 0) (pitch-mod int16 :offset-assert 2) (bend int16 :offset-assert 4) (fo-min int16 :offset-assert 6) @@ -158,7 +186,7 @@ (priority int8 :offset-assert 11) (volume int32 :offset-assert 12) (trans vector3w :inline :offset-assert 16) - (group uint8 :offset-assert 28) + (group sound-group :offset-assert 28) ) :pack-me :method-count-assert 9 @@ -183,7 +211,7 @@ ) (deftype sound-rpc-group-cmd (sound-rpc-cmd) - ((group uint8 :offset-assert 4) + ((group sound-group :offset-assert 4) ) :method-count-assert 9 :size-assert #x5 @@ -416,13 +444,14 @@ :flag-assert #x900000050 ) +;; GOAL-side sound specification. (deftype sound-spec (basic) - ((mask uint16 :offset-assert 4) + ((mask sound-mask :offset-assert 4) (num float :offset-assert 8) - (group uint8 :offset-assert 12) - (sound-name sound-name :score 20 :offset 16) - (sound-name-char uint8 16 :offset 16) ;; moved to after sound-name - (trans float 4 :offset-assert 32) ;; guess + (group sound-group :offset-assert 12) + (sound-name-char uint8 16 :offset 16) + (sound-name sound-name :score 20 :offset 16) + (trans float 4 :offset-assert 32) ;; guess (volume int32 :offset-assert 48) (pitch-mod int32 :offset-assert 52) (bend int32 :offset-assert 56) @@ -438,10 +467,42 @@ :flag-assert #x90000004c ) +(defmacro sound-vol (vol) + "convert to sound volume units" + (if (number? vol) + (* 1 (/ (* vol 1024) 100)) + `(the int (/ (* ,vol 1024) 100)) + ) + ) + +(defmacro static-sound-spec (name &key (num 1.0) &key (group 1) + &key (volume #f) + &key (pitch-mod 0) + &key (fo-min 0) &key (fo-max 0) + &key (mask ())) + (let ((snd-mask mask) + (snd-volume 100.0)) + (when (nonzero? fo-max) (cons! snd-mask 'fo-max)) + (when (nonzero? fo-min) (cons! snd-mask 'fo-min)) + (when (nonzero? pitch-mod) (cons! snd-mask 'pitch)) + (when volume (cons! snd-mask 'volume) (set! snd-volume volume)) + `(new 'static 'sound-spec + :sound-name (static-sound-name ,name) + :num ,num + :group ,group + :volume (sound-vol ,snd-volume) + :pitch-mod ,pitch-mod + :fo-min ,fo-min + :fo-max ,fo-max + :mask (sound-mask ,@snd-mask) + )) + ) + ;; each sound command gets a unique ID. (define *current-sound-id* (the sound-id #x10000)) ;; a in-game background sound. +(declare-type entity basic) (deftype ambient-sound (basic) ((spec sound-spec :offset-assert 4) (playing-id sound-id :offset-assert 8) @@ -455,7 +516,7 @@ (falloff-near int32 :offset-assert 80) (falloff-far int32 :offset-assert 84) (falloff-mode int32 :offset-assert 88) - (params (pointer float) :offset-assert 92) + (params (pointer float) :offset-assert 92) (param-count int32 :offset-assert 96) (entity entity :offset-assert 100) (sound-count int32 :offset-assert 104) diff --git a/goal_src/engine/sound/gsound.gc b/goal_src/engine/sound/gsound.gc index b716839840..eae737b55a 100644 --- a/goal_src/engine/sound/gsound.gc +++ b/goal_src/engine/sound/gsound.gc @@ -150,7 +150,14 @@ 0 ) -(sound-bank-load (static-sound-name "common")) +(case (scf-get-territory) + ((2) + (sound-bank-load (static-sound-name "commonj")) + ) + (else + (sound-bank-load (static-sound-name "common")) + ) + ) (sound-bank-load (static-sound-name "empty1")) (sound-bank-load (static-sound-name "empty2")) @@ -301,7 +308,7 @@ ) ) -(defun sound-set-volume ((group uint) (volume float)) +(defun sound-set-volume ((group sound-group) (volume float)) (let ((cmd (the sound-rpc-set-master-volume (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command set-master-volume)) @@ -337,59 +344,49 @@ `(with-pp (let ((proc (the process-drawable pp))) - ;(format 0 "get proc~%") (when (= ,sound-trans #t) - ;(format 0 "trans #t~%") (if (and proc (type-type? (-> proc type) process-drawable) (nonzero? (-> proc root))) (set! ,sound-trans (-> proc root trans)) (set! ,sound-trans (the vector #f)) ) - ;(format 0 "trans is ~A~%" ,sound-trans) ) ) - ;(format 0 "convert~%" ,sound-trans) (sound-trans-convert (-> ,cmd parms trans) ,sound-trans) ) ) -(defun sound-play-by-name ((name sound-name) (id sound-id) (vol int) (pitch int) (bend int) (group int) (trans symbol)) +(defmacro sound-play (name &key (id (new-sound-id)) + &key (vol 100.0) &key (pitch 0) &key (bend 0) + &key (group sfx) + &key (position #t)) + `(sound-play-by-name (static-sound-name ,name) ,id (the int (* (/ 1024.0 100.0) ,vol)) (the int (* 1524.0 ,pitch)) ,bend (sound-group ,group) ,position) + ) + +(defun sound-play-by-name ((name sound-name) (id sound-id) (vol int) (pitch int) (bend int) (group sound-group) (trans symbol)) "Play a sound called name with the specified params" - (local-vars (sv-16 int)) - (with-pp - (set! sv-16 group) - (let ((sound-trans (the-as structure trans))) + (local-vars (sv-16 sound-group)) + (set! sv-16 group) + (let ((sound-trans (the-as vector trans))) (when *sound-player-enable* - (let ((cmd (the-as sound-rpc-play (get-sound-buffer-entry)))) - (set! (-> cmd command) (sound-command play)) - (set! (-> cmd id) id) - (set! (-> cmd name) name) - (set! (-> cmd parms mask) (the-as uint 0)) - (set! (-> cmd parms group) (the-as uint sv-16)) - (set! (-> cmd parms volume) vol) - (set! (-> cmd parms pitch-mod) pitch) - (set! (-> cmd parms bend) bend) - (let ((proc (the-as process-drawable pp))) - (when (= (the-as symbol sound-trans) #t) - (if - (and - proc - (type-type? (-> proc type) process-drawable) - (nonzero? (-> proc root)) - ) - (set! sound-trans (-> proc root trans)) - (set! sound-trans #f) - ) + (let ((cmd (the-as sound-rpc-play (get-sound-buffer-entry)))) + + (set! (-> cmd command) (sound-command play)) + (set! (-> cmd id) id) + (set! (-> cmd name) name) + (set! (-> cmd parms mask) (sound-mask)) + (set! (-> cmd parms group) sv-16) + (set! (-> cmd parms volume) vol) + (set! (-> cmd parms pitch-mod) pitch) + (set! (-> cmd parms bend) bend) + + (sound-trans-from-process cmd sound-trans) ) - ) - (sound-trans-convert (-> cmd parms trans) (the-as vector sound-trans)) ) - ) ) - ) id ) @@ -445,7 +442,7 @@ 0 ) -(defun sound-group-pause ((group uint)) +(defun sound-group-pause ((group sound-group)) (let ((cmd (the sound-rpc-pause-group (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command pause-group)) @@ -454,7 +451,7 @@ 0 ) -(defun sound-group-stop ((group uint)) +(defun sound-group-stop ((group sound-group)) (let ((cmd (the sound-rpc-stop-group (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command stop-group)) @@ -463,7 +460,7 @@ 0 ) -(defun sound-group-continue ((group uint)) +(defun sound-group-continue ((group sound-group)) (let ((cmd (the sound-rpc-continue-group (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command continue-group)) @@ -504,11 +501,11 @@ 0 ) -(defun sound-set-fps ((arg0 uint)) +(defun sound-set-fps ((arg0 int)) (let ((cmd (the-as sound-rpc-set-fps (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command set-fps)) - (set! (-> cmd fps) arg0) + (set! (-> cmd fps) (the-as uint arg0)) ) 0 ) @@ -516,11 +513,9 @@ (defun sound-volume-off () "Set all sound volume to zero" - (with-pp - (set-setting! *setting-control* pp 'music-volume 'abs 0.0 0) - (set-setting! *setting-control* pp 'sfx-volume 'abs 0.0 0) - (set-setting! *setting-control* pp 'ambient-volume 'abs 0.0 0) - ) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) 0 ) @@ -544,13 +539,13 @@ ) (case (-> src type) ((entity-actor entity-ambient) - (swhen (res-lump-struct-exact (the entity src) 'effect-name symbol) - (set! name (string->sound-name (symbol->string bc))) + (awhen (res-lump-struct-exact (the entity src) 'effect-name symbol) + (set! name (string->sound-name (symbol->string it))) (set! sound-times (res-lump-data (the entity src) 'cycle-speed (pointer float))) (set! spec *ambient-spec*) (let ((tag (new 'static 'res-tag))) - (swhen (res-lump-data-exact (the entity src) 'effect-param sound-play-parms :tag-ptr (& tag)) - (set! params bc) + (awhen (res-lump-data-exact (the entity src) 'effect-param sound-play-parms :tag-ptr (& tag)) + (set! params it) (set! param-count (the int (-> tag elt-count))) ) ) @@ -583,9 +578,9 @@ (set! (-> obj volume) 1024) (set! (-> obj pitch) 0) (when (and spec (!= spec *ambient-spec*)) - (if (nonzero? (logand (-> spec mask) 1)) + (if (logtest? (-> spec mask) (sound-mask volume)) (set! (-> obj volume) (-> spec volume))) - (if (nonzero? (logand (-> spec mask) 2)) + (if (logtest? (-> spec mask) (sound-mask pitch)) (set! (-> obj pitch) (-> spec pitch-mod))) ) (cond @@ -635,13 +630,9 @@ (set! (-> spec bend) 0) (set! (-> spec sound-name) (-> obj name)) (set! (-> spec fo-max) (-> obj falloff-far)) - (set! (-> spec mask) (the-as uint 0)) + (set! (-> spec mask) (sound-mask)) (if (-> obj params) - (effect-param->sound-spec - spec - (the-as (pointer float) (-> obj params)) - (-> obj param-count) - ) + (effect-param->sound-spec spec (-> obj params) (-> obj param-count)) ) ) (if (and (nonzero? (-> spec fo-max)) @@ -677,7 +668,7 @@ (-> obj volume) (-> obj pitch) 0 - 1 + (sound-group sfx) (the-as symbol (-> obj trans)))) ) (else @@ -688,7 +679,7 @@ (-> obj volume) (-> obj pitch) 0 - 1 + (sound-group sfx) (the-as symbol (-> obj trans)))) (set! (-> obj play-time) (+ (-> *display* base-frame-counter) (-> obj time-base) @@ -720,7 +711,7 @@ (sound-trans-from-process cmd sound-trans) - (set! (-> cmd parms mask) (the-as uint #x20)) + (set! (-> cmd parms mask) (sound-mask trans)) (-> cmd id) ) ) @@ -735,7 +726,7 @@ (set! (-> cmd command) (sound-command set-param)) (set! (-> cmd id) (-> obj playing-id)) (set! (-> cmd parms volume) (the int (* 10.24 (the float arg0)))) - (set! (-> cmd parms mask) (the-as uint 1)) + (set! (-> cmd parms mask) (sound-mask volume)) (-> cmd id) ) ) diff --git a/goal_src/engine/sparticle/sparticle-launcher-h.gc b/goal_src/engine/sparticle/sparticle-launcher-h.gc index 7c702a773b..6003b00c7a 100644 --- a/goal_src/engine/sparticle/sparticle-launcher-h.gc +++ b/goal_src/engine/sparticle/sparticle-launcher-h.gc @@ -146,7 +146,7 @@ (random-mult int32 :offset 12) (sym symbol :offset 4) ;; moved (func symbol :offset 4) - (tex uint32 :offset 4) + (tex texture-id :offset 4) (pntr pointer :offset 4) ;; sym used to be here (sound sound-spec :offset 4) diff --git a/goal_src/engine/sparticle/sparticle-launcher.gc b/goal_src/engine/sparticle/sparticle-launcher.gc index 6435ed20d2..5799419850 100644 --- a/goal_src/engine/sparticle/sparticle-launcher.gc +++ b/goal_src/engine/sparticle/sparticle-launcher.gc @@ -925,7 +925,7 @@ ) (add-debug-sphere *display-actor-vis* - (bucket-id debug-draw0) + (bucket-id debug) gp-1 (-> gp-1 w) (new 'static 'rgba :g #xff :a #x80) @@ -935,10 +935,11 @@ ;; can we see it? (#if (not PC_PORT) (sphere-in-view-frustum? (the-as sphere gp-1)) - (if (and (not (-> *pc-settings* ps2-parts?)) (not (-> *pc-settings* use-vis?)) (> (-> *sprite-array-2d* num-sprites 0) 1920)) - ;; pc port : launchers have larger bsphere if you have pc rendering on and ps2 parts off - (sphere-in-view-frustum? (the-as sphere (let ((bsph (new-stack-vector0))) (vector-copy! bsph gp-1) (*! (-> bsph w) 4.0) bsph))) - (sphere-in-view-frustum? (the-as sphere gp-1))) + (if (-> *pc-settings* ps2-parts?) + ;; pc port : launchers have larger bsphere if you have ps2 parts off + (sphere-in-view-frustum? (the-as sphere gp-1)) + (sphere-in-view-frustum? (the-as sphere (begin (*! (-> gp-1 w) 8.0) gp-1))) + ) ) ) ) @@ -990,10 +991,10 @@ (set! f30-0 0.0) ) - ;; pc hack for more particles. + ;; if we have ps2 particles off, say we're at the camera (with-pc - (if (and (> (-> *sprite-array-2d* num-sprites 0) 1920) (not (-> *pc-settings* ps2-parts?))) - (/! f30-0 256.0))) + (if (not (-> *pc-settings* ps2-parts?)) + (set! f30-0 0.0))) ;; loop over particles in the group. (let ((s2-1 (-> obj length))) @@ -1021,12 +1022,15 @@ (b! (!= (-> a1-4 type) a0-26) cfg-78 :delay (nop!)) ) + ;; PAL patch here ;; ?? - (b! (zero? (logand (-> v1-29 flags) (sp-group-item-flag launch-asap))) + (b! (zero? (logand (-> v1-29 flags) (sp-group-item-flag launch-asap bit6))) cfg-36 :delay (nop!) ) - (when (zero? (logand (-> a3-0 flags) (sp-launch-state-flags particles-active))) + (when (or (zero? (logand (-> a3-0 flags) (sp-launch-state-flags particles-active))) + (logtest? (-> v1-29 flags) (sp-group-item-flag bit6)) + ) ;; particles are not active, lets activate them. (set! (-> a3-0 spawn-time) (the-as uint s4-0)) (logior! (-> a3-0 flags) (sp-launch-state-flags particles-active)) diff --git a/goal_src/engine/sparticle/sparticle.gc b/goal_src/engine/sparticle/sparticle.gc index 78e6e84eb3..3f936a2dc9 100644 --- a/goal_src/engine/sparticle/sparticle.gc +++ b/goal_src/engine/sparticle/sparticle.gc @@ -63,10 +63,8 @@ arg3: pointer to sprite allocations arg4: pointer to adgif allocation" (#when PC_BIG_MEMORY - (when (not (-> *pc-settings* ps2-parts?)) - (*! arg0 16) ;; 16x more particles! - (*! arg1 16) ;; 16x more particles! - ) + (*! arg0 SPRITE_MAX_AMOUNT_MULT) + (*! arg1 SPRITE_MAX_AMOUNT_MULT) ) (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (let* ((v1-3 (/ (+ arg0 63) 64)) ;; num blocks @@ -129,6 +127,12 @@ (new 'global 'sparticle-system 256 0 #t (-> *sprite-array-3d* vec-data) (-> *sprite-array-3d* adgif-data)) ) +(defmacro launch-particles (&key (system *sp-particle-system-2d*) particle origin &key (launch-state (the-as sparticle-launch-state #f)) &key (launch-control (the-as sparticle-launch-control #f)) + &key (rate (if (= (-> *setting-control* current video-mode) '150fps) + (if (= (-> *setting-control* current video-mode) '100fps) 0.6 0.4) + 1.0))) + `(sp-launch-particles-var ,system ,particle ,origin ,launch-state ,launch-control ,rate) + ) ;;;;;;;;;;;;;;;;;;;; @@ -678,46 +682,9 @@ (none) ) -(defun set-particle-frame-time ((arg0 int)) - (cond - ((= arg0 5) - (set-vector! - *sp-frame-time* - 0.00000000000000000000000000000000000001175495 - 5.0 - 1.0 - 1.0 - ) - ) - ((= arg0 6) - (set-vector! - *sp-frame-time* - 0.000000000000000000000000000000000000011754952 - 6.0 - 1.2 - 1.2 - ) - ) - ((= arg0 10) - (set-vector! - *sp-frame-time* - 0.000000000000000000000000000000000000011754958 - 10.0 - 2.0 - 2.0 - ) - ) - ((= arg0 12) - (set-vector! - *sp-frame-time* - 0.00000000000000000000000000000000000001175496 - 12.0 - 2.4 - 2.4 - ) - ) - ) - 0 +(defun set-particle-frame-time ((scaled-seconds int)) + "Adjusts particle frame time based on the frame-rate (scaled-seconds). Note: This used to be a case statement and has been rewritten as a more generic formula" + (set-vector! *sp-frame-time* (the-as float (logior #x800000 scaled-seconds)) (the float scaled-seconds) (* 0.2 scaled-seconds) (* 0.2 scaled-seconds)) (none) ) diff --git a/goal_src/engine/target/joint-mod-h.gc b/goal_src/engine/target/joint-mod-h.gc index 8e8bceb5d5..bf53db9d33 100644 --- a/goal_src/engine/target/joint-mod-h.gc +++ b/goal_src/engine/target/joint-mod-h.gc @@ -70,7 +70,7 @@ (defun-debug joint-mod-debug-draw ((mod joint-mod)) "Draw a frame at the bone." ;; I believe this draws a set of coordinate axes that represent the transformation matrix. - (add-debug-matrix #t (bucket-id debug-draw1) (-> mod joint bone transform)) + (add-debug-matrix #t (bucket-id debug-no-zbuf) (-> mod joint bone transform)) (none) ) @@ -425,7 +425,7 @@ (if (and (= (-> gp-0 process type) target) (!= (-> gp-0 blend) 0.0)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 target) 819.2 "look" @@ -559,7 +559,7 @@ (if (and (= (-> gp-0 process type) target) (!= (-> gp-0 blend) 0.0)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 target) 819.2 "look" diff --git a/goal_src/engine/target/logic-target.gc b/goal_src/engine/target/logic-target.gc index 29cdbdf4e8..5ef27dc951 100644 --- a/goal_src/engine/target/logic-target.gc +++ b/goal_src/engine/target/logic-target.gc @@ -4,6 +4,9 @@ ;; name: logic-target.gc ;; name in dgo: logic-target ;; dgos: GAME, ENGINE +;; note: changed for high fps + +;; target-start is modified due to changing the size of the stack in gkernel.gc ;; DECOMP BEGINS @@ -23,7 +26,7 @@ ) (let ((s5-0 (new-stack-vector0))) (vector-z-quaternion! s5-0 (-> self control unknown-quaternion00)) - (when (logtest? (-> self control unknown-surface00 flags) 2) + (when (logtest? (-> self control unknown-surface00 flags) (surface-flags dive)) (vector-flatten! s5-0 s5-0 (-> self control dynam gravity-normal)) (vector-normalize! s5-0 1.0) ) @@ -54,10 +57,8 @@ (defbehavior reverse-conversions target ((arg0 vector)) (set! (-> self control unknown-float01) (vector-xz-length (-> self control unknown-vector00))) (vector-matrix*! arg0 (-> self control unknown-vector00) (-> self control unknown-matrix01)) - (let ((v0-2 (-> self control status))) - (set! (-> self control old-status) v0-2) - v0-2 - ) + (set! (-> self control old-status) (-> self control status)) + (none) ) (defun-debug draw-history ((arg0 control-info)) @@ -93,7 +94,7 @@ (let ((s2-0 (-> arg0 history-data (logand (+ (-> arg0 unknown-halfword00) s4-0) 127)))) (add-debug-line (logtest? s5-0 2) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> v1-19 trans) (-> s2-0 trans) (the-as rgba (+ #xffff00 (shl s4-0 24))) @@ -102,16 +103,16 @@ ) (add-debug-vector (logtest? s5-0 4) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 trans) (-> s2-0 transv) (meters 0.000024414063) (the-as rgba (+ #x408040 (shl s4-0 24))) ) - (when (zero? (logand (-> s2-0 status) 256)) + (when (zero? (logand (-> s2-0 status) (cshape-moving-flags csmf08))) (add-debug-line (logtest? s5-0 1) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s1-0 intersect) (-> s2-0 intersect) (the-as rgba (+ #xffffff (shl s4-0 24))) @@ -124,7 +125,7 @@ ) (add-debug-vector (logtest? s5-0 32) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 intersect) (-> s2-0 surface-normal) (meters 1.0) @@ -132,7 +133,7 @@ ) (add-debug-vector (logtest? s5-0 16) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 intersect) (-> s2-0 local-normal) (meters 1.0) @@ -141,7 +142,7 @@ ) (add-debug-vector (logtest? s5-0 8) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 trans) (-> s2-0 transv-out) (meters 0.000024414063) @@ -166,7 +167,7 @@ #t "~6D ~8S #x~8X " (-> s4-0 time) - (if (logtest? (-> s4-0 status) 256) + (if (logtest? (-> s4-0 status) (cshape-moving-flags csmf08)) "air" (-> *pat-mode-info* (-> s4-0 pat mode) name) ) @@ -175,19 +176,19 @@ (format #t "~C~C~C~C~C~C" - (if (zero? (logand s3-0 1)) + (if (zero? (logand s3-0 (cshape-reaction-flags csrf00))) 103 87 ) - (if (zero? (logand s3-0 2)) + (if (zero? (logand s3-0 (cshape-reaction-flags csrf01))) 103 87 ) (cond - ((logtest? s3-0 2048) + ((logtest? s3-0 (cshape-reaction-flags csrf11)) 71 ) - ((zero? (logand s3-0 4)) + ((zero? (logand s3-0 (cshape-reaction-flags csrf02))) 103 ) (else @@ -195,21 +196,21 @@ ) ) (cond - ((logtest? s3-0 512) + ((logtest? s3-0 (cshape-reaction-flags csrf09)) 66 ) - ((logtest? s3-0 8) + ((logtest? s3-0 (cshape-reaction-flags csrf03)) 76 ) (else 99 ) ) - (if (zero? (logand s3-0 16)) + (if (zero? (logand s3-0 (cshape-reaction-flags csrf04))) 110 66 ) - (if (zero? (logand s3-0 32)) + (if (zero? (logand s3-0 (cshape-reaction-flags csrf05))) 103 65 ) @@ -217,18 +218,18 @@ (format #t "~C~C " - (if (logtest? s3-0 64) + (if (logtest? s3-0 (cshape-reaction-flags csrf06)) 78 95 ) (cond - ((logtest? s3-0 1024) + ((logtest? s3-0 (cshape-reaction-flags csrf10)) 76 ) - ((logtest? s3-0 256) + ((logtest? s3-0 (cshape-reaction-flags csrf08)) 67 ) - ((logtest? s3-0 128) + ((logtest? s3-0 (cshape-reaction-flags csrf07)) 108 ) (else @@ -302,11 +303,11 @@ (let ((s4-2 format) (s3-2 arg1) (s2-2 "~0kwall:~6X mode:~-8S material:~-10S event:~S~%") - (s1-2 (-> arg0 control unknown-int60)) - (s0-2 (pat-mode->string (the-as pat-surface (-> arg0 control unknown-int60)))) + (s1-2 (-> arg0 control wall-pat)) + (s0-2 (pat-mode->string (-> arg0 control wall-pat))) ) - (set! sv-96 (pat-material->string (the-as pat-surface (-> arg0 control unknown-int60)))) - (let ((t1-2 (pat-event->string (the-as pat-surface (-> arg0 control unknown-int60))))) + (set! sv-96 (pat-material->string (-> arg0 control wall-pat))) + (let ((t1-2 (pat-event->string (-> arg0 control wall-pat)))) (s4-2 s3-2 s2-2 s1-2 s0-2 sv-96 t1-2) ) ) @@ -325,31 +326,31 @@ (format arg1 "~0k~9S ~9S ~9S ~9S ~9S ~9S~%" - (if (logtest? (-> arg0 control status) 1) + (if (logtest? (-> arg0 control status) (cshape-moving-flags onsurf)) "on-surface" "" ) - (if (logtest? (-> arg0 control status) 2) + (if (logtest? (-> arg0 control status) (cshape-moving-flags onground)) "on-ground" "" ) - (if (logtest? (-> arg0 control status) 4) + (if (logtest? (-> arg0 control status) (cshape-moving-flags tsurf)) "t-surface" "" ) - (if (logtest? (-> arg0 control status) 8) + (if (logtest? (-> arg0 control status) (cshape-moving-flags twall)) "t-wall" "" ) - (if (logtest? (-> arg0 control status) 32) + (if (logtest? (-> arg0 control status) (cshape-moving-flags t-act)) "t-act" "" ) (cond - ((logtest? (-> arg0 control status) 16) + ((logtest? (-> arg0 control status) (cshape-moving-flags t-ciel)) "t-ceil" ) - ((logtest? (-> arg0 control status) 1024) + ((logtest? (-> arg0 control status) (cshape-moving-flags on-water)) "on-water" ) (else @@ -364,24 +365,24 @@ "in water ~A at ~M ~5S ~5S ~5S ~5S " (-> v1-49 name) (-> arg0 water height) - (if (logtest? (-> arg0 water flags) 512) + (if (logtest? (-> arg0 water flags) (water-flags wt09)) "water" "" ) - (if (logtest? (-> arg0 water flags) 1024) + (if (logtest? (-> arg0 water flags) (water-flags wt10)) "wade" "" ) - (if (logtest? (-> arg0 water flags) 2048) + (if (logtest? (-> arg0 water flags) (water-flags wt11)) "swim" "" ) - (if (logtest? (-> arg0 water flags) 4096) + (if (logtest? (-> arg0 water flags) (water-flags wt12)) "under" "" ) ) - (format arg1 "~2S~%" (if (logtest? (-> arg0 water flags) 16) + (format arg1 "~2S~%" (if (logtest? (-> arg0 water flags) (water-flags wt04)) "sg" "" ) @@ -555,7 +556,7 @@ (let ((f1-1 (* 0.0625 f1-0))) (set! (-> self control unknown-int10) a0-3) (set! (-> self control unknown-float100) f1-1) - (if (logtest? (-> self control unknown-surface01 flags) 8) + (if (logtest? (-> self control unknown-surface01 flags) (surface-flags no-turn-around)) (set! (-> v1-6 0) (the-as uint (-> *display* base-frame-counter))) ) (and (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> v1-6 0)))) (the-as uint 300)) @@ -564,7 +565,7 @@ (< 0.7 (-> self control unknown-float20)) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword20)) (seconds 0.3)) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword21)) (seconds 0.3)) - (logtest? (-> self control status) 1) + (logtest? (-> self control status) (cshape-moving-flags onsurf)) (and (< 0.7 (-> self control surface-angle)) #t) ) ) @@ -633,7 +634,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "target" @@ -750,7 +751,9 @@ ) (vector-matrix*! s2-3 s3-3 (-> self control unknown-matrix01)) (let ((f28-2 (vector-vector-xz-distance s3-3 s4-0))) - (when (and (zero? (logand (-> self control status) 4)) (< (vector-xz-length gp-0) (vector-xz-length s3-3))) + (when (and (zero? (logand (-> self control status) (cshape-moving-flags tsurf))) + (< (vector-xz-length gp-0) (vector-xz-length s3-3)) + ) (let ((f0-50 (lerp-scale 163840.0 0.0 f28-2 0.0 20480.0))) (if (and (< f28-2 20480.0) (< (-> s4-0 z) 0.0)) (set! f0-50 (* 2.0 f0-50)) @@ -760,9 +763,9 @@ ) ) ) - (if (and (zero? (logand (-> self control status) 8)) - (logtest? (-> self control old-status) 8) - (logtest? (-> self control unknown-surface00 flags) 2048) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags twall))) + (logtest? (-> self control old-status) (cshape-moving-flags twall)) + (logtest? (-> self control unknown-surface00 flags) (surface-flags jump)) (< 0.0 (-> gp-0 y)) (< 0.0 (vector-dot (-> self control dynam gravity-normal) @@ -779,9 +782,9 @@ (if (< (- (-> *display* base-frame-counter) (-> self control unknown-dword70)) (seconds 0.2)) (set! f30-4 (+ 204800.0 f30-4)) ) - (if (and (zero? (logand (-> self control status) 8)) - (and (logtest? (-> self control old-status) 8) - (logtest? (-> self control unknown-surface00 flags) 2048) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags twall))) + (and (logtest? (-> self control old-status) (cshape-moving-flags twall)) + (logtest? (-> self control unknown-surface00 flags) (surface-flags jump)) (< 0.0 (-> gp-0 y)) (< (-> gp-0 z) 0.0) ) @@ -809,7 +812,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "ltransv" @@ -820,7 +823,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "btransv" @@ -898,15 +901,16 @@ (defbehavior do-rotations2 target () (let ((gp-0 (vector-z-quaternion! (new-stack-vector0) (-> self control dir-targ))) (s5-0 - (if (and (or (zero? (logand (logior (-> self control status) (-> self control old-status)) 5)) + (if (and (or (zero? (logand (logior (-> self control status) (-> self control old-status)) (cshape-moving-flags onsurf tsurf)) + ) (< (- (-> *display* base-frame-counter) (-> self control unknown-dword20)) (seconds 0.5)) (!= (-> self next-state name) 'target-walk) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) (< (- (-> *display* base-frame-counter) (-> self control unknown-dword21)) (seconds 0.5)) - (logtest? (-> self control unknown-surface01 flags) 16) + (logtest? (-> self control unknown-surface01 flags) (surface-flags no-rotate-toward-transv)) (!= (-> self control unknown-float41) 0.0) ) - (zero? (logand (-> self control unknown-surface01 flags) 32)) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags always-rotate-toward-transv))) ) (-> self control unknown-vector20) (-> self control transv) @@ -934,7 +938,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) gp-0 (meters 2.0) @@ -942,7 +946,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s5-0 (meters 2.0) @@ -951,7 +955,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control unknown-matrix01 vector 2) (meters 2.0) @@ -993,12 +997,12 @@ (set! (-> self control unknown-vector10 quad) (-> self control transv quad)) ((-> self control unknown-surface01 active-hook)) (cond - ((logtest? (-> self control status) 1) + ((logtest? (-> self control status) (cshape-moving-flags onsurf)) (set! (-> self control unknown-dword11) (-> *display* base-frame-counter)) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) (if (and (>= (-> self control coverage) 1.0) - (zero? (logand (-> self control status) 1056)) - (logtest? (-> self control status) 2) + (zero? (logand (-> self control status) (cshape-moving-flags t-act on-water))) + (logtest? (-> self control status) (cshape-moving-flags onground)) ) (set! (-> self control last-known-safe-ground quad) (-> self control trans quad)) ) @@ -1006,7 +1010,7 @@ ) (else (let ((v1-25 (-> self control trans))) - (when (logtest? (-> self control old-status) 1) + (when (logtest? (-> self control old-status) (cshape-moving-flags onsurf)) (set! (-> self control unknown-vector110 quad) (-> self control unknown-vector52 quad)) (set! (-> self control unknown-vector111 quad) (-> self control unknown-vector52 quad)) ) @@ -1028,10 +1032,9 @@ (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie))) ) (if (and (= (-> self cam-user-mode) 'normal) - (logtest? (-> self control unknown-surface00 flags) 1) - (zero? - (logand (-> self control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) - ) + (logtest? (-> self control unknown-surface00 flags) (surface-flags allow-look-around)) + (zero? (logand (-> self control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) + ) (-> *setting-control* current allow-look-around) (>= (- (-> *display* base-frame-counter) (-> self no-look-around-wait)) (seconds 0.05)) (not (and (= (-> self control ground-pat material) (pat-material ice)) @@ -1045,7 +1048,7 @@ (when (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2) (not *pause-lock*) - (zero? (logand (-> self state-flags) 768)) + (zero? (logand (-> self state-flags) (state-flags grabbed first-person-mode))) ) (if (!= (-> self next-state name) 'target-falling) (send-event self 'change-mode 'falling) @@ -1090,8 +1093,10 @@ (set! (-> self control surf) *standard-ground-surface*) ) (let ((f0-17 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - (if (and (or (logtest? (-> self control unknown-surface01 flags) 1024) - (and (= (-> self next-state name) 'target-walk) (zero? (logand (-> self control status) 1))) + (if (and (or (logtest? (-> self control unknown-surface01 flags) (surface-flags allow-edge-grab)) + (and (= (-> self next-state name) 'target-walk) + (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + ) ) (< f0-17 0.0) (or (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) @@ -1112,35 +1117,26 @@ ) ) (let ((v1-146 (-> self current-level))) - (when (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 2)) - (and v1-146 - (< (-> self control trans y) (-> v1-146 info bottom-height)) - (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) - ) - ) - (let ((a1-32 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-32 from) self) - (set! (-> a1-32 num-params) 2) - (set! (-> a1-32 message) 'attack-invinc) - (set! (-> a1-32 param 0) (the-as uint #f)) - (let ((a0-102 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-102 mode) 'endlessfall) - (set! (-> a1-32 param 1) (the-as uint a0-102)) - ) - (send-event-function self a1-32) + (if (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 2)) + (and v1-146 + (< (-> self control trans y) (-> v1-146 info bottom-height)) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) + ) + ) + (send-event self 'attack-invinc #f (static-attack-info ((mode 'endlessfall)))) ) - ) ) 0 (none) ) (defbehavior post-flag-setup target () - (if (logtest? (-> self control status) 40) + (if (logtest? (-> self control status) (cshape-moving-flags twall t-act)) (set! (-> self control unknown-dword20) (-> *display* base-frame-counter)) ) - (when (logtest? (-> self state-flags) 32) - (if (< (logand (- (-> *display* base-frame-counter) (-> self control unknown-dword80)) 3) 1) + (when (logtest? (-> self state-flags) (state-flags timed-invulnerable)) + ;; changed for high fps. This fixes the flicker speed when damaged + (if (< (logand (- (-> *display* base-frame-counter) (-> self control unknown-dword80)) 3) (/ 1.0 (-> *display* time-adjust-ratio))) (logior! (-> self draw status) (draw-status hidden)) (logclear! (-> self draw status) (draw-status hidden)) ) @@ -1154,24 +1150,25 @@ ) (defbehavior bend-gravity target () - (set! (-> self control unknown-float82) (if (logtest? (-> self control status) 1) + (set! (-> self control unknown-float82) (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) 32.0 2.0 ) ) - (let ((f0-2 (if (and (logtest? (-> self control status) 8) (zero? (logand (-> self control status) 1))) - 0.0 - (-> self control unknown-float81) - ) + (let ((f0-2 + (if (and (logtest? (-> self control status) (cshape-moving-flags twall)) + (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + ) + 0.0 + (-> self control unknown-float81) ) - ) - (set! (-> self control unknown-float80) - (seek - (-> self control unknown-float80) - f0-2 - (* (-> self control unknown-float82) (-> *display* seconds-per-frame)) - ) ) + ) + (seek! + (-> self control unknown-float80) + f0-2 + (* (-> self control unknown-float82) (-> *display* seconds-per-frame)) + ) ) (vector-deg-slerp (-> self control dynam gravity-normal) @@ -1198,7 +1195,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control ground-poly-normal) (meters 2.0) @@ -1206,7 +1203,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control local-normal) (meters 2.0) @@ -1214,7 +1211,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control unknown-dynamics00 gravity-normal) (meters 2.5) @@ -1222,7 +1219,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control dynam gravity-normal) (meters 3.0) @@ -1346,7 +1343,7 @@ (when *display-edge-collision-marks* (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> (the-as swingpole s4-0) root trans) (the-as vector (&-> s4-0 stack 16)) (meters 3.0) @@ -1354,21 +1351,21 @@ ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> (the-as swingpole s4-0) root trans) (-> (the-as swingpole s4-0) range) (new 'static 'rgba :r #xff :g #xff :a #x80) ) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (-> self control unknown-vector90) 819.2 (new 'static 'rgba :r #xff :a #x80) ) - (add-debug-sphere #t (bucket-id debug-draw1) s3-0 819.2 (new 'static 'rgba :g #xff :a #x80)) - (add-debug-sphere #t (bucket-id debug-draw1) s2-0 819.2 (new 'static 'rgba :g #xff :b #x40 :a #x80)) - (add-debug-sphere #t (bucket-id debug-draw1) s5-0 819.2 (new 'static 'rgba :b #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s3-0 819.2 (new 'static 'rgba :g #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s2-0 819.2 (new 'static 'rgba :g #xff :b #x40 :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s5-0 819.2 (new 'static 'rgba :b #xff :a #x80)) ) ) (let ((s4-2 (vector-! (new-stack-vector0) s5-0 (-> self control unknown-vector90)))) @@ -1418,17 +1415,20 @@ (else (let ((v1-11 (-> self water flags))) (cond - ((and (logtest? v1-11 512) (logtest? v1-11 6144)) + ((and (logtest? v1-11 (water-flags wt09)) (logtest? v1-11 (water-flags wt11 wt12))) (vector<-cspace! (the-as vector (&-> (-> self control) unknown-qword00)) (the-as cspace (-> self node-list data)) ) - (if (not (and (logtest? (-> self water flags) 4096) (zero? (logand (-> self water flags) 16)))) + (if (not (and (logtest? (-> self water flags) (water-flags wt12)) + (zero? (logand (-> self water flags) (water-flags wt04))) + ) + ) (set! (-> self control unknown-float30) (- (-> self water base-height) (-> self water swim-height))) ) (&-> (-> self control) unknown-qword00) ) - ((and (logtest? (-> self water flags) 512) (logtest? #x40000 (-> self water flags))) + ((and (logtest? (-> self water flags) (water-flags wt09)) (logtest? (water-flags wt18) (-> self water flags))) (vector<-cspace! (the-as vector (&-> (-> self control) unknown-qword00)) (the-as cspace (-> self node-list data)) @@ -1466,7 +1466,7 @@ (cond ((logtest? (-> self control root-prim prim-core action) (collide-action ca-9 ca-13)) ) - ((logtest? (-> self water flags) 1024) + ((logtest? (-> self water flags) (water-flags wt10)) (let ((f30-0 (- (- (-> self control trans y) (- (-> self water height) (-> self water wade-height)))))) (set! (-> *wade-surface* alignv) (lerp-scale 1.0 0.5 f30-0 0.0 (- (-> self water swim-height) (-> self water wade-height))) @@ -1479,10 +1479,10 @@ ) (set! (-> self control surf) *wade-surface*) ) - ((logtest? (-> self water flags) 2048) + ((logtest? (-> self water flags) (water-flags wt11)) (set! (-> self control surf) *swim-surface*) ) - ((and (logtest? (-> self water flags) 512) (logtest? #x40000 (-> self water flags))) + ((and (logtest? (-> self water flags) (water-flags wt09)) (logtest? (water-flags wt18) (-> self water flags))) (set! (-> self control surf) *quicksand-surface*) ) ) @@ -1510,8 +1510,8 @@ ) ) (target-calc-camera-pos) - (when (logtest? (-> self state-flags) #x4000) - (set! (-> self state-flags) (logand -28673 (-> self state-flags))) + (when (logtest? (-> self state-flags) (state-flags remove-prevents)) + (logclear! (-> self state-flags) (state-flags prevent-attack prevent-duck remove-prevents)) (set! (-> self control unknown-float41) 0.0) ) (set! (-> self control unknown-int00) 0) @@ -1622,7 +1622,7 @@ (none) ) -(defun target-post () +(defbehavior target-post target () (target-real-post) (debug-draw-find-ground-point @@ -1914,7 +1914,7 @@ ) (target-exit) (target-timed-invulnerable-off self) - (set! (-> self control status) (the-as uint 0)) + (set! (-> self control status) (cshape-moving-flags)) (set! (-> self control unknown-dynamics00) *standard-dynamics*) (set! (-> self control surf) *standard-ground-surface*) (set! (-> self control unknown-vector02 quad) (-> self control unknown-dynamics00 gravity-normal quad)) @@ -1932,9 +1932,9 @@ ) (defbehavior init-target target ((arg0 continue-point)) - (set-setting! *setting-control* self 'allow-pause #f 0.0 0) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) - (copy-settings-from-target! *setting-control*) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (apply-settings *setting-control*) (if (not arg0) (set! arg0 (get-or-create-continue! *game-info*)) ) @@ -2037,24 +2037,15 @@ ) (activate-hud self) (set! (-> self fp-hud) (the-as handle #f)) + ;; PAL patch here + (set! (-> self burn-proc) (the-as handle #f)) (set! (-> self water) (new 'process 'water-control self 9 0.0 8192.0 2048.0)) - (set! (-> self water flags) (the-as uint #x4000f0)) + (set! (-> self water flags) (water-flags wt04 wt05 wt06 wt07 wt22)) (reset-target-state #t) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) (set! (-> self control unknown-vector52 y) (+ -819200.0 (-> self control unknown-vector52 y))) (set! (-> self align) (new 'process 'align-control self)) - (let ((s5-1 (get-process *16k-dead-pool* sidekick #x4000))) - (set! (-> self sidekick) - (the-as (pointer sidekick) (when s5-1 - (let ((t9-37 (method-of-type sidekick activate))) - (t9-37 (the-as sidekick s5-1) self 'sidekick (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 init-sidekick) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> self sidekick) (process-spawn sidekick :init init-sidekick :from *16k-dead-pool* :to self)) (set! (-> self manipy) (the-as (pointer manipy) #f)) (set! (-> self event-hook) target-generic-event-handler) (set! (-> self current-level) #f) @@ -2082,16 +2073,16 @@ (set! (-> *level* border?) #f) (set! (-> *setting-control* default border-mode) #f) (stop arg0) - (let* ((s5-0 (get-process *target-dead-pool* target #x4000)) - (v1-3 (when s5-0 - (let ((t9-2 (method-of-type target activate))) - (t9-2 (the-as target s5-0) *target-pool* 'target (&-> *dram-stack* DPROCESS_STACK_SIZE)) - ) - (run-now-in-process s5-0 init-target arg1) - (-> s5-0 ppointer) - ) - ) - ) + (let ((v1-3 (process-spawn + target + :init init-target + arg1 + :from *target-dead-pool* + :to *target-pool* + :stack *kernel-dram-stack* + ) + ) + ) (if v1-3 (set! *target* (the-as target (-> v1-3 0 self))) (set! *target* #f) diff --git a/goal_src/engine/target/pat-h.gc b/goal_src/engine/target/pat-h.gc index 41fd516ac7..726264d848 100644 --- a/goal_src/engine/target/pat-h.gc +++ b/goal_src/engine/target/pat-h.gc @@ -54,16 +54,18 @@ ) (deftype pat-surface (uint32) - ((skip uint8 :offset 0 :size 3) - (mode pat-mode :offset 3 :size 3) - (material pat-material :offset 6 :size 6) - (camera uint8 :offset 12 :size 2) - (event pat-event :offset 14 :size 6) - (noentity uint8 :offset 0 :size 1) - (nocamera uint8 :offset 1 :size 1) - (noedge uint8 :offset 2 :size 1) - (nolineofsight uint8 :offset 12 :size 1) - (unknown-bit uint8 :offset 15 :size 1) + ((skip uint8 :offset 0 :size 3) ;; overlay the "no" fields later on + (mode pat-mode :offset 3 :size 3) ;; ground/wall/obstacle for collision system + (material pat-material :offset 6 :size 6) ;; material for effects (sound, particles, surfaces...) + (camera uint8 :offset 12 :size 2) ;; 2 bits for camera (used later) + (event pat-event :offset 14 :size 6) ;; what happens if we hit this? + (noentity uint8 :offset 0 :size 1) ;; collisions for actors/jak/etc ignore this + (nocamera uint8 :offset 1 :size 1) ;; collisions for camera ignore this + (noedge uint8 :offset 2 :size 1) ;; seems unused? maybe no edge grab? + (nolineofsight uint8 :offset 12 :size 1) ;; camera don't worry about this object blocking line-of-sight to jak. + ;; 13 belongs to "camera", but seems unsed. + ;; 14 is unused? + (unknown-bit uint8 :offset 15 :size 1) ;; maybe death plane? ) :method-count-assert 9 :size-assert #x4 @@ -82,6 +84,7 @@ (enum->string pat-event (-> pat event)) ) +;; for debug drawing pat's by mode. (deftype pat-mode-info (structure) ((name string :offset-assert 0) (wall-angle float :offset-assert 4) diff --git a/goal_src/engine/target/sidekick.gc b/goal_src/engine/target/sidekick.gc index 173056acd9..5d1344be3b 100644 --- a/goal_src/engine/target/sidekick.gc +++ b/goal_src/engine/target/sidekick.gc @@ -5,10 +5,12 @@ ;; name in dgo: sidekick ;; dgos: GAME, ENGINE -(define-extern *sidekick-sg* skeleton-group) +(load-art-import sidekick) ;; DECOMP BEGINS +(import "goal_src/import/sidekick-ag.gc") + (define *sidekick-remap* '(("run-to-stance-left" "run-to-stance") ("run-to-stance-loop-left" "run-to-stance-loop") ("stance-loop-left" "stance-loop") @@ -64,8 +66,7 @@ ) (defstate sidekick-clone (sidekick) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('matrix) @@ -121,10 +122,8 @@ ) ) ) - :code - (the-as (function none :behavior sidekick) looping-code) - :post - (behavior () + :code (the-as (function none :behavior sidekick) looping-code) + :post (behavior () (let ((v1-0 'process-drawable-art-error) (a0-0 (-> self parent-override)) ) @@ -182,28 +181,28 @@ (debug-print-channels (-> self skel) (the-as symbol *stdcon*)) (add-debug-sphere *display-sidekick-stats* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self parent-override 0 control unknown-cspace10 parent bone transform vector 3) 409.6 (new 'static 'rgba :g #xff :a #x80) ) (add-debug-sphere *display-sidekick-stats* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self node-list data 3 bone transform vector 3) 409.6 (new 'static 'rgba :r #xff :g #xff :a #x80) ) (add-debug-sphere *display-sidekick-stats* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self draw origin) 409.6 (new 'static 'rgba :r #xff :g #x80 :a #x80) ) ) (set! (-> self draw shadow) (the-as shadow-geo (if (and (movie?) (-> self shadow-in-movie?)) - (-> self draw art-group data 2) + sidekick-shadow-mg ) ) ) @@ -222,16 +221,14 @@ ) ) -(defskelgroup *sidekick-sg* sidekick - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 1) - :shadow 2 - :texture-level 2 - :sort 1 - ) +(defskelgroup *sidekick-sg* sidekick sidekick-lod0-jg -1 + ((sidekick-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :longest-edge (meters 1) + :shadow sidekick-shadow-mg + :texture-level 2 + :sort 1 + ) (defbehavior init-sidekick sidekick () (logior! (-> self mask) (process-mask sidekick)) @@ -243,6 +240,14 @@ (set! (-> self draw shadow-joint-index) (the-as uint 6)) (set! (-> self draw shadow-ctrl) *target-shadow-control*) (logior! (-> self skel status) (janim-status eye)) + + (#when PC_PORT + ;; daxter can be killed mid-blerc, leaving blerc modifications in the merc data. + ;; once sidekick is restarted, the blerc-done flag will be lost, so the modifications will + ;; to work around this, just set blerc-done on spawn. it will run blerc with 0's on the + ;; first frame when daxter is drawn, clearing blerc data. + (logior! (-> self skel status) (janim-status blerc-done)) + ) (let ((v1-14 (-> self node-list data))) (set! (-> v1-14 0 param0) cspace<-cspace+quaternion!) (set! (-> v1-14 0 param1) (the-as basic (-> self parent-override 0 control unknown-cspace10 parent))) diff --git a/goal_src/engine/target/surface-h.gc b/goal_src/engine/target/surface-h.gc index 8cb0cd8044..1f600eb1e1 100644 --- a/goal_src/engine/target/surface-h.gc +++ b/goal_src/engine/target/surface-h.gc @@ -5,88 +5,120 @@ ;; name in dgo: surface-h ;; dgos: GAME, ENGINE +;; A "surface" contains parameters for how Jak will behave. +;; It can be used for different in-game surfaces (ice is slippery, grass isn't) +;; but is also used for most other changes to Jak's control +;; For example, when jumping, there's a separate "surface" for jumping that makes +;; Jak less responsive to changing directions. +;; Surfaces have flags and parameters that can be combined with other surfaces + +(defenum surface-flags + :bitfield #t + :type uint32 + (allow-look-around) ;; allows entering first person with triangle + (dive) ;; set on all diving (dive, dive-bottom) surfaces + (surf02) ;; unused + (no-turn-around) ;; prevent "changed direction" animation from happening + + ;; when jak is on a surface with this flag, the case where jak + ;; is forced to rotate in the direction he's traveling is + ;; never taken. It's used on ice (though it is not needed, the turn toward transv + ;; is disabled by not being in target-walk ever) and also used to prevent + ;; jak from spinning around when he shouldn't (like if he's knocked back) + (no-rotate-toward-transv) + ;; if jak should always be forced to rotate in the direction he's travelling. + ;; used for the slides and also the warp gate jump + (always-rotate-toward-transv) + + ;; never set, but prevents jak from jumping (both normal and roll) + (prevent-jump) + + ;; target is launch jumping (from a blue eco pad) + (prevent-attacks-during-launch-jump) + (surf08) ;; never set, prevents various attacks from being possible + (surf09) ;; another attack prevent + (allow-edge-grab) ;; if set, and jak is falling, turn on the ledge grab search. + (jump) ;; set on all jumps, used to prevent "on-grounds" in places + (attacking) ;; set on all attacks, but not actually used anywhere + (ducking) ;; set on all ducks, but not actually used anywhere + (moving-ground) ;; unused, but would make sense if jak was on something moving + ) + ;; The "surface" defines how jak moves on the ground. It includes things like how fast he can go, ;; how slippery it is, and what functions should run when he hits it. ;; Note that "surface" can apply to weird things, like riding the zoomer or swimming as well. (deftype surface (basic) - ((name symbol :offset-assert 4) + ((name symbol :offset-assert 4) ;; data went here - (turnv float :offset-assert 8) - (turnvv float :offset-assert 12) - (tiltv float :offset-assert 16) - (tiltvv float :offset-assert 20) - (transv-max float :offset-assert 24) - (target-speed float :offset-assert 28) - (seek0 float :offset-assert 32) - (seek90 float :offset-assert 36) - (seek180 float :offset-assert 40) - (fric float :offset-assert 44) - (nonlin-fric-dist float :offset-assert 48) - (slip-factor float :offset-assert 52) - (slide-factor float :offset-assert 56) - (slope-up-factor float :offset-assert 60) - (slope-down-factor float :offset-assert 64) - (slope-slip-angle float :offset-assert 68) - (impact-fric float :offset-assert 72) - (bend-factor float :offset-assert 76) - (bend-speed float :offset-assert 80) - (alignv float :offset-assert 84) - (slope-up-traction float :offset-assert 88) - (align-speed float :offset-assert 92) + (turnv float :offset-assert 8) + (turnvv float :offset-assert 12) + (tiltv float :offset-assert 16) + (tiltvv float :offset-assert 20) + (transv-max float :offset-assert 24) + (target-speed float :offset-assert 28) + (seek0 float :offset-assert 32) + (seek90 float :offset-assert 36) + (seek180 float :offset-assert 40) + (fric float :offset-assert 44) + (nonlin-fric-dist float :offset-assert 48) + (slip-factor float :offset-assert 52) + (slide-factor float :offset-assert 56) + (slope-up-factor float :offset-assert 60) + (slope-down-factor float :offset-assert 64) + (slope-slip-angle float :offset-assert 68) + (impact-fric float :offset-assert 72) + (bend-factor float :offset-assert 76) + (bend-speed float :offset-assert 80) + (alignv float :offset-assert 84) + (slope-up-traction float :offset-assert 88) + (align-speed float :offset-assert 92) ;; hook went here - (active-hook (function none) :offset 128) ;; from logic-target::flag-setup not 100% sure but seems to pass no args - (touch-hook (function none) :offset-assert 132) ;; from logic-target::flag-setup not 100% sure but seems to pass no args - (impact-hook function :offset-assert 136) - (mult-hook (function surface surface surface int none) :offset-assert 140) + (active-hook (function none) :offset 128) + (touch-hook (function none) :offset-assert 132) + (impact-hook function :offset-assert 136) + (mult-hook (function surface surface surface int none) :offset-assert 140) ;; dataw went here (mode symbol :offset-assert 144) - (flags uint32 :offset-assert 148) - (data float 30 :offset 8) - (hook function 4 :offset 128) - (dataw uint32 2 :offset 144) + (flags surface-flags :offset-assert 148) + (data float 30 :offset 8) + (hook function 4 :offset 128) + (dataw uint32 2 :offset 144) ) :method-count-assert 9 :size-assert #x98 :flag-assert #x900000098 ) +;; these calc-terminal functions are unused. (defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float)) - (- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) - arg1) + (- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1) ) (defun calc-terminal2-vel ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) (let ((f0-4 (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))) - (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4)))) - ) + (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4)))) + ) ) (defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float)) (let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2))))) - (- f0-5 (+ arg1 (* arg2 (* (* (* f0-5 f0-5) f0-5) f0-5)))) - ) + (- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5)))) + ) ) (defmethod print surface ((obj surface)) - ;; seems like an off-by-one bug in the format string here. + ;; seems this format string is wrong. (format - #t - "# obj turnv) - (-> obj turnvv) - (-> obj tiltv) - (-> obj tiltvv) - (-> obj transv-max) - 0 ;; seems to be a bug here - ) - (format - #t - " tm:~m rv:~R rvv:~R @ #x~X>" - (-> obj target-speed) - (-> obj seek0) - (-> obj seek90) - obj - ) + #t + "# obj turnv) + (-> obj turnvv) + (-> obj tiltv) + (-> obj tiltvv) + (-> obj transv-max) + 0 + ) + (format #t " tm:~m rv:~R rvv:~R @ #x~X>" (-> obj target-speed) (-> obj seek0) (-> obj seek90) obj) obj ) @@ -96,31 +128,23 @@ ;; iterate through surface data (dotimes (v1-0 30) ;; interpolate between the two - (set! (-> dst data v1-0) - (+ (* (-> src1 data v1-0) amount) - (* (-> src0 data v1-0) (- 1.0 amount))) - ) + (set! (-> dst data v1-0) (+ (* (-> src1 data v1-0) amount) (* (-> src0 data v1-0) (- 1.0 amount)))) ) ;; iterate through hooks. Check src1, then src0 for a nonzero and non-nothing hook. ;; if there is no good hook, set it to nothing. (dotimes (v1-3 4) - (set! (-> dst hook v1-3) - (cond - ((and (nonzero? (-> src1 hook v1-3)) - (!= (-> src1 hook v1-3) nothing) - ) - (-> src1 hook v1-3) - ) - ((and (nonzero? (-> src0 hook v1-3)) - (!= (-> src0 hook v1-3) nothing) - ) - (-> src0 hook v1-3) - ) - (else - nothing - ) - ) + (set! (-> dst hook v1-3) (cond + ((and (nonzero? (-> src1 hook v1-3)) (!= (-> src1 hook v1-3) nothing)) + (-> src1 hook v1-3) + ) + ((and (nonzero? (-> src0 hook v1-3)) (!= (-> src0 hook v1-3) nothing)) + (-> src0 hook v1-3) + ) + (else + nothing + ) + ) ) ) @@ -139,14 +163,17 @@ (set! (-> dst data v1-0) (* (-> src1 data v1-0) (-> src0 data v1-0))) ) (dotimes (v1-3 4) - (set! (-> dst hook v1-3) - (if (and (nonzero? (-> src1 hook v1-3)) (!= (-> src1 hook v1-3) nothing)) - (-> src1 hook v1-3) - (if (and (nonzero? (-> src0 hook v1-3)) (!= (-> src0 hook v1-3) nothing)) - (-> src0 hook v1-3) - nothing - ) - ) + (set! (-> dst hook v1-3) (cond + ((and (nonzero? (-> src1 hook v1-3)) (!= (-> src1 hook v1-3) nothing)) + (-> src1 hook v1-3) + ) + ((and (nonzero? (-> src0 hook v1-3)) (!= (-> src0 hook v1-3) nothing)) + (-> src0 hook v1-3) + ) + (else + nothing + ) + ) ) ) (dotimes (v1-6 2) @@ -168,1104 +195,1045 @@ (none) ) -(define *walk-mods* - (new 'static 'surface - :name 'run - :turnv 131072.0 - :turnvv 524288.0 - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :flags #x1 - ) - ) +;; The common surfaces: -(define *walk-no-turn-mods* - (new 'static 'surface - :name 'run - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - ) - ) +(define *walk-mods* (new 'static 'surface + :name 'run + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :flags (surface-flags allow-look-around) + ) + ) -(define *turn-around-mods* - (new 'static 'surface - :name 'run - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :fric 0.1 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - ) - ) +(define *walk-no-turn-mods* (new 'static 'surface + :name 'run + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + ) + ) -(let ((a0-3 - (new 'static 'surface - :name 'duck - :turnv 131072.0 - :turnvv 524288.0 - :tiltv 65536.0 - :tiltvv 291271.12 - :transv-max 16384.0 - :target-speed 16384.0 - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :flags #x2000 +(define *turn-around-mods* (new 'static 'surface + :name 'run + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :fric 0.1 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + ) + ) + +(let ((a0-3 (new 'static 'surface + :name 'duck + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 291271.12 + :transv-max 16384.0 + :target-speed 16384.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :flags (surface-flags ducking) + ) ) - )) + ) (set! (-> a0-3 mult-hook) surface-clamp-speed) (define *duck-mods* a0-3) ) -(define *duck-attack-mods* - (new 'static 'surface - :name 'duck - :tiltv 65536.0 - :tiltvv 291271.12 - :transv-max 16384.0 - :target-speed 16384.0 - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'attack - :flags #x3000 - ) - ) +(define *duck-attack-mods* (new 'static 'surface + :name 'duck + :tiltv 65536.0 + :tiltvv 291271.12 + :transv-max 16384.0 + :target-speed 16384.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags (surface-flags attacking ducking) + ) + ) -(define *jump-mods* - (new 'static 'surface - :name 'jump - :turnv 131072.0 - :turnvv 18204.445 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 0.3 - :seek90 0.3 - :seek180 0.3 - :fric 0.2 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags #xc00 - ) - ) +(define *jump-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flags allow-edge-grab jump) + ) + ) -(define *double-jump-mods* - (new 'static 'surface - :name 'jump-double - :turnv 131072.0 - :turnvv 18204.445 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 32768.0 - :target-speed 32768.0 - :seek0 0.3 - :seek90 0.3 - :seek180 0.3 - :fric 0.2 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags #xc00 - ) - ) +(define *double-jump-mods* (new 'static 'surface + :name 'jump-double + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 32768.0 + :target-speed 32768.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flags allow-edge-grab jump) + ) + ) -(define *smack-jump-mods* - (new 'static 'surface - :name 'jump - :turnv 131072.0 - :turnvv 18204.445 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 0.3 - :seek90 0.3 - :seek180 0.3 - :fric 0.05 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags #xc00 - ) - ) +(define *smack-jump-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flags allow-edge-grab jump) + ) + ) -(define *high-jump-mods* - (new 'static 'surface - :name 'high-jump - :turnv 131072.0 - :turnvv 65536.0 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 26624.0 - :target-speed 26624.0 - :seek0 0.9 - :seek90 0.9 - :seek180 0.9 - :fric 0.3 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags #xc00 - ) - ) +(define *high-jump-mods* (new 'static 'surface + :name 'high-jump + :turnv 131072.0 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 26624.0 + :target-speed 26624.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flags allow-edge-grab jump) + ) + ) -(define *launch-jump-mods* - (new 'static 'surface - :name 'launch-jump - :turnv 18204.445 - :turnvv 65536.0 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 61440.0 - :target-speed 61440.0 - :seek0 0.9 - :seek90 0.9 - :seek180 0.9 - :fric 0.3 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags #xc80 - ) - ) +(define *launch-jump-mods* (new 'static 'surface + :name 'launch-jump + :turnv 18204.445 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 61440.0 + :target-speed 61440.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flags prevent-attacks-during-launch-jump allow-edge-grab jump) + ) + ) -(define *forward-high-jump-mods* - (new 'static 'surface - :name 'high-jump - :turnv 131072.0 - :turnvv 65536.0 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 45056.0 - :target-speed 45056.0 - :seek0 0.9 - :seek90 0.9 - :seek180 0.9 - :fric 0.3 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags #xc00 - ) - ) +(define *forward-high-jump-mods* (new 'static 'surface + :name 'high-jump + :turnv 131072.0 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 45056.0 + :target-speed 45056.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flags allow-edge-grab jump) + ) + ) -(define *flip-jump-mods* - (new 'static 'surface - :name 'high-jump - :turnv 131072.0 - :turnvv 65536.0 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 80281.6 - :target-speed 51200.0 - :seek0 0.9 - :seek90 0.9 - :seek180 0.9 - :fric 0.3 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags #xc00 - ) - ) +(define *flip-jump-mods* (new 'static 'surface + :name 'high-jump + :turnv 131072.0 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 80281.6 + :target-speed 51200.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flags allow-edge-grab jump) + ) + ) -(define *forward-jump-mods* - (new 'static 'surface - :name 'jump - :turnv 131072.0 - :turnvv 18204.445 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 65536.0 - :target-speed 65536.0 - :seek0 0.3 - :seek90 0.3 - :seek180 0.3 - :fric 0.05 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags #xc00 - ) - ) +(define *forward-jump-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 65536.0 + :target-speed 65536.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flags allow-edge-grab jump) + ) + ) -(define *forward-pole-jump-mods* - (new 'static 'surface - :name 'jump - :turnv 131072.0 - :turnvv 18204.445 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 53248.0 - :target-speed 53248.0 - :seek0 0.3 - :seek90 0.3 - :seek180 0.3 - :fric 0.05 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags #xc00 - ) - ) +(define *forward-pole-jump-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 53248.0 + :target-speed 53248.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flags allow-edge-grab jump) + ) + ) -(define *attack-mods* - (new 'static 'surface - :name 'attack - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'attack - :flags #x1000 - ) - ) +(define *attack-mods* (new 'static 'surface + :name 'attack + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags (surface-flags attacking) + ) + ) -(define *jump-attack-mods* - (new 'static 'surface - :name 'attack - :turnvv 18204.445 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 24576.0 - :target-speed 24576.0 - :seek0 0.9 - :seek90 0.9 - :seek180 0.9 - :fric 0.2 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags #x1c00 - ) - ) +(define *jump-attack-mods* (new 'static 'surface + :name 'attack + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 24576.0 + :target-speed 24576.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flags allow-edge-grab jump attacking) + ) + ) -(let ((a0-4 - (new 'static 'surface - :name 'uppercut - :turnvv 18204.445 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 32768.0 - :target-speed 32768.0 - :seek0 0.3 - :seek90 0.3 - :seek180 0.3 - :fric 0.2 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags #x1c00 +(let ((a0-4 (new 'static 'surface + :name 'uppercut + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 32768.0 + :target-speed 32768.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flags allow-edge-grab jump attacking) + ) ) - )) + ) (set! (-> a0-4 mult-hook) surface-clamp-speed) (define *uppercut-jump-mods* a0-4) ) -(define *run-attack-mods* - (new 'static 'surface - :name 'wheel-flip - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 91750.4 - :target-speed 122880.0 - :seek90 0.5 - :seek180 0.15 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 0.25 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'attack - :flags #x1018 - ) - ) +(define *run-attack-mods* (new 'static 'surface + :name 'wheel-flip + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 91750.4 + :target-speed 122880.0 + :seek90 0.5 + :seek180 0.15 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + ;; no-rotate-toward-transv prevents jak from spinning around + ;; if you punch over bumpy terrain + :flags (surface-flags no-turn-around no-rotate-toward-transv attacking) + ) + ) -(define *wheel-mods* - (new 'static 'surface - :name 'wheel - :turnv 131072.0 - :turnvv 5461.3335 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 91750.4 - :target-speed 11468.8 - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 0.25 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'attack - :flags #x1000 - ) - ) +(define *wheel-mods* (new 'static 'surface + :name 'wheel + :turnv 131072.0 + :turnvv 5461.3335 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 91750.4 + :target-speed 11468.8 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags (surface-flags attacking) + ) + ) -(define *wheel-flip-mods* - (new 'static 'surface - :name 'wheel-flip - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 91750.4 - :target-speed 103219.195 - :seek90 0.5 - :seek180 0.15 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 0.25 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'attack - :flags #x1c00 - ) - ) +(define *wheel-flip-mods* (new 'static 'surface + :name 'wheel-flip + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 91750.4 + :target-speed 103219.195 + :seek90 0.5 + :seek180 0.15 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags (surface-flags allow-edge-grab jump attacking) + ) + ) -(define *flop-mods* - (new 'static 'surface - :name 'flop - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 1.0 - :seek90 0.3 - :seek180 1.5 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 0.25 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'attack - :flags #x1800 - ) - ) +(define *flop-mods* (new 'static 'surface + :name 'flop + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 0.3 + :seek180 1.5 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags (surface-flags jump attacking) + ) + ) -(let ((a0-5 - (new 'static 'surface - :name 'flop - :turnv 9102.223 - :turnvv 9102.223 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 0.3 - :seek90 0.1 - :seek180 0.15 - :fric 0.2 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 0.25 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags #x800 +(let ((a0-5 (new 'static 'surface + :name 'flop + :turnv 9102.223 + :turnvv 9102.223 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.1 + :seek180 0.15 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flags jump) + ) ) - )) + ) (set! (-> a0-5 mult-hook) surface-clamp-speed) (define *flop-land-mods* a0-5) ) -(define *wade-mods* - (new 'static 'surface - :name 'wade - :turnv 131072.0 - :turnvv 524288.0 - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 1.0 - :seek90 0.5 - :seek180 0.5 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'wade - :flags #x1 - ) - ) +(define *wade-mods* (new 'static 'surface + :name 'wade + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 0.5 + :seek180 0.5 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'wade + :flags (surface-flags allow-look-around) + ) + ) -(define *swim-mods* - (new 'static 'surface - :name 'swim - :turnv 49152.0 - :turnvv 524288.0 - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 28672.0 - :target-speed 28672.0 - :seek0 0.75 - :seek90 0.2 - :seek180 0.2 - :fric 0.05 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'swim - ) - ) +(define *swim-mods* (new 'static 'surface + :name 'swim + :turnv 49152.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 28672.0 + :target-speed 28672.0 + :seek0 0.75 + :seek90 0.2 + :seek180 0.2 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'swim + ) + ) -(define *dive-mods* - (new 'static 'surface - :name 'swim - :turnv 21845.334 - :turnvv 32768.0 - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 20480.0 - :target-speed 20480.0 - :seek0 0.05 - :seek90 0.05 - :seek180 0.05 - :fric 1.0 - :nonlin-fric-dist 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :align-speed 1.0 - :mode 'dive - :flags #x2 - ) - ) +(define *dive-mods* (new 'static 'surface + :name 'swim + :turnv 21845.334 + :turnvv 32768.0 + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 20480.0 + :target-speed 20480.0 + :seek0 0.05 + :seek90 0.05 + :seek180 0.05 + :fric 1.0 + :nonlin-fric-dist 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :align-speed 1.0 + :mode 'dive + :flags (surface-flags dive) + ) + ) -(define *dive-bottom-mods* - (new 'static 'surface - :name 'swim-bottom - :turnv 21845.334 - :turnvv 32768.0 - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 20480.0 - :target-speed 20480.0 - :seek0 0.1 - :seek90 0.05 - :seek180 0.05 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'dive - :flags #x2 - ) - ) +(define *dive-bottom-mods* (new 'static 'surface + :name 'swim-bottom + :turnv 21845.334 + :turnvv 32768.0 + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 20480.0 + :target-speed 20480.0 + :seek0 0.1 + :seek90 0.05 + :seek180 0.05 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'dive + :flags (surface-flags dive) + ) + ) (let ((a0-7 (copy *walk-mods* 'global))) (set! (-> a0-7 name) 'pole) - (set! (-> a0-7 flags) 0) + (set! (-> a0-7 flags) (surface-flags)) (define *pole-mods* a0-7) ) (let ((a0-9 (copy *walk-mods* 'global))) (set! (-> a0-9 name) 'grab) - (set! (-> a0-9 flags) 0) + (set! (-> a0-9 flags) (surface-flags)) (define *grab-mods* a0-9) ) (let ((a0-11 (copy *walk-mods* 'global))) (set! (-> a0-11 name) 'edge-grab) - (set! (-> a0-11 flags) 0) + (set! (-> a0-11 flags) (surface-flags)) (define *edge-grab-mods* a0-11) ) -(define *empty-mods* - (new 'static 'surface - :name 'empty - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :fric 1.0 - ) - ) +(define *empty-mods* (new 'static 'surface :name 'empty :seek0 1.0 :seek90 1.0 :seek180 1.0 :fric 1.0)) -(define *neutral-mods* - (new 'static 'surface - :name 'walk - :turnv 131072.0 - :turnvv 524288.0 - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - ) - ) - -(let ((v1-41 - (new 'static 'surface - :name '*stone-surface* - :turnv 1.0 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 1.0 - :target-speed 1.0 - :seek0 153600.0 - :seek90 153600.0 - :seek180 256000.0 - :fric 153600.0 - :nonlin-fric-dist 5120.0 - :slip-factor 1.0 - :slope-down-factor 10240.0 - :slope-slip-angle 8192.0 - :impact-fric 1.0 - :bend-factor 0.8 - :bend-speed 4.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - ) - )) - (define *stone-surface* v1-41) - (set! - (-> v1-41 mult-hook) - (the-as (function surface surface surface int none) nothing) - ) - (set! (-> v1-41 touch-hook) nothing) - (set! (-> v1-41 active-hook) (the-as (function none) nothing)) - ) - -(let ((v1-42 - (new 'static 'surface - :name '*edge-surface* - :turnv 1.0 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 1.0 - :target-speed 1.0 - :seek0 153600.0 - :seek90 153600.0 - :seek180 256000.0 - :fric 30720.0 - :nonlin-fric-dist 5120.0 - :slip-factor 1.0 - :slope-down-factor 18432.0 - :slope-slip-angle 8192.0 - :bend-factor 0.8 - :bend-speed 4.0 - :alignv 1.0 - :align-speed 1.0 - ) - )) - (define *edge-surface* v1-42) - (set! - (-> v1-42 mult-hook) - (the-as (function surface surface surface int none) nothing) - ) - (set! (-> v1-42 touch-hook) nothing) - (set! (-> v1-42 active-hook) (the-as (function none) nothing)) - ) - -(let ((v1-43 - (new 'static 'surface - :name '*wade-surface* - :turnv 1.0 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 0.7 - :target-speed 0.7 - :seek0 153600.0 - :seek90 153600.0 - :seek180 256000.0 - :fric 153600.0 - :nonlin-fric-dist 5120.0 - :slip-factor 1.0 - :slope-down-factor 10240.0 - :slope-slip-angle 8192.0 - :impact-fric 1.0 - :bend-factor 0.8 - :bend-speed 4.0 - :alignv 0.6 - :slope-up-traction 1.0 - :align-speed 0.6 - ) - )) - (define *wade-surface* v1-43) - (set! - (-> v1-43 mult-hook) - (the-as (function surface surface surface int none) nothing) - ) - (set! (-> v1-43 touch-hook) nothing) - (set! (-> v1-43 active-hook) (the-as (function none) nothing)) - ) - -(let ((v1-44 - (new 'static 'surface - :name '*slope-surface* - :turnv 1.0 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 1.0 - :target-speed 1.0 - :seek0 122880.0 - :seek90 245760.0 - :seek180 409600.0 - :fric 122880.0 - :nonlin-fric-dist 4096.0 - :slip-factor 1.0 - :slope-up-factor 40960.0 - :slope-down-factor 8192.0 - :slope-slip-angle 8192.0 - :impact-fric 1.0 - :bend-factor 0.8 - :bend-speed 4.0 - :alignv 1.0 - :align-speed 1.0 - ) +(define *neutral-mods* (new 'static 'surface + :name 'walk + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + ) ) + +(let ((v1-41 (new 'static 'surface + :name '*stone-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 153600.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + ) + ) + ) + (define *stone-surface* v1-41) + (set! (-> v1-41 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-41 touch-hook) nothing) + (set! (-> v1-41 active-hook) nothing) + ) + +(let ((v1-42 (new 'static 'surface + :name '*edge-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 30720.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 18432.0 + :slope-slip-angle 8192.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :align-speed 1.0 + ) + ) + ) + (define *edge-surface* v1-42) + (set! (-> v1-42 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-42 touch-hook) nothing) + (set! (-> v1-42 active-hook) nothing) + ) + +(let ((v1-43 (new 'static 'surface + :name '*wade-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 0.7 + :target-speed 0.7 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 153600.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 0.6 + :slope-up-traction 1.0 + :align-speed 0.6 + ) + ) + ) + (define *wade-surface* v1-43) + (set! (-> v1-43 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-43 touch-hook) nothing) + (set! (-> v1-43 active-hook) nothing) + ) + +(let ((v1-44 (new 'static 'surface + :name '*slope-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 122880.0 + :seek90 245760.0 + :seek180 409600.0 + :fric 122880.0 + :nonlin-fric-dist 4096.0 + :slip-factor 1.0 + :slope-up-factor 40960.0 + :slope-down-factor 8192.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :align-speed 1.0 + ) + ) ) (define *slope-surface* v1-44) - (set! - (-> v1-44 mult-hook) - (the-as (function surface surface surface int none) nothing) - ) + (set! (-> v1-44 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-44 touch-hook) nothing) - (set! (-> v1-44 active-hook) (the-as (function none) nothing)) + (set! (-> v1-44 active-hook) nothing) ) -(let ((v1-45 - (new 'static 'surface - :name '*quicksand-surface* - :turnv 0.25 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 0.5 - :target-speed 0.5 - :seek0 81920.0 - :seek90 83968.0 - :seek180 165888.0 - :fric 329728.0 - :nonlin-fric-dist 5120.0 - :slip-factor 1.0 - :slope-down-factor 10240.0 - :slope-slip-angle 8192.0 - :impact-fric 1.0 - :bend-factor 0.8 - :bend-speed 4.0 - :alignv 0.5 - :slope-up-traction 1.0 - :align-speed 0.5 - ) - ) +(let ((v1-45 (new 'static 'surface + :name '*quicksand-surface* + :turnv 0.25 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 0.5 + :target-speed 0.5 + :seek0 81920.0 + :seek90 83968.0 + :seek180 165888.0 + :fric 329728.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 0.5 + :slope-up-traction 1.0 + :align-speed 0.5 + ) + ) ) (define *quicksand-surface* v1-45) - (set! - (-> v1-45 mult-hook) - (the-as (function surface surface surface int none) nothing) - ) + (set! (-> v1-45 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-45 touch-hook) nothing) - (set! (-> v1-45 active-hook) (the-as (function none) nothing)) + (set! (-> v1-45 active-hook) nothing) ) -(let ((v1-46 - (new 'static 'surface - :name '*tar-surface* - :turnv 0.25 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 0.4 - :target-speed 0.4 - :seek0 81920.0 - :seek90 83968.0 - :seek180 165888.0 - :fric 329728.0 - :nonlin-fric-dist 5120.0 - :slip-factor 1.0 - :slope-down-factor 10240.0 - :slope-slip-angle 8192.0 - :impact-fric 1.0 - :bend-factor 0.8 - :bend-speed 4.0 - :alignv 0.5 - :slope-up-traction 1.0 - :align-speed 0.5 - ) - ) +(let ((v1-46 (new 'static 'surface + :name '*tar-surface* + :turnv 0.25 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 0.4 + :target-speed 0.4 + :seek0 81920.0 + :seek90 83968.0 + :seek180 165888.0 + :fric 329728.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 0.5 + :slope-up-traction 1.0 + :align-speed 0.5 + ) + ) ) (define *tar-surface* v1-46) - (set! - (-> v1-46 mult-hook) - (the-as (function surface surface surface int none) nothing) - ) + (set! (-> v1-46 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-46 touch-hook) nothing) - (set! (-> v1-46 active-hook) (the-as (function none) nothing)) + (set! (-> v1-46 active-hook) nothing) ) -(let ((v1-47 - (new 'static 'surface - :name '*grass-surface* - :turnv 1.0 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 1.0 - :target-speed 1.0 - :seek0 122880.0 - :seek90 122880.0 - :seek180 409600.0 - :fric 122880.0 - :nonlin-fric-dist 4096.0 - :slip-factor 1.0 - :slope-slip-angle 16384.0 - :impact-fric 0.5 - :bend-speed 4.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - ) - )) +(let ((v1-47 (new 'static 'surface + :name '*grass-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 122880.0 + :seek90 122880.0 + :seek180 409600.0 + :fric 122880.0 + :nonlin-fric-dist 4096.0 + :slip-factor 1.0 + :slope-slip-angle 16384.0 + :impact-fric 0.5 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + ) + ) + ) (define *grass-surface* v1-47) - (set! - (-> v1-47 mult-hook) - (the-as (function surface surface surface int none) nothing) - ) + (set! (-> v1-47 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-47 touch-hook) nothing) - (set! (-> v1-47 active-hook) (the-as (function none) nothing)) + (set! (-> v1-47 active-hook) nothing) ) -(let ((v1-48 - (new 'static 'surface - :name '*ice-surface* - :turnv 0.5 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 1.5 - :target-speed 1.5 - :seek0 24576.0 - :seek90 24576.0 - :seek180 24576.0 - :fric 23756.8 - :nonlin-fric-dist 4091904.0 - :slip-factor 0.7 - :slope-slip-angle 16384.0 - :bend-speed 4.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :flags #x18 - ) - )) +(let ((v1-48 (new 'static 'surface + :name '*ice-surface* + :turnv 0.5 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.5 + :target-speed 1.5 + :seek0 24576.0 + :seek90 24576.0 + :seek180 24576.0 + :fric 23756.8 + :nonlin-fric-dist 4091904.0 + :slip-factor 0.7 + :slope-slip-angle 16384.0 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :flags (surface-flags no-turn-around no-rotate-toward-transv) + ) + ) + ) (define *ice-surface* v1-48) - (set! - (-> v1-48 mult-hook) - (the-as (function surface surface surface int none) nothing) - ) + (set! (-> v1-48 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-48 touch-hook) nothing) - (set! (-> v1-48 active-hook) (the-as (function none) nothing)) + (set! (-> v1-48 active-hook) nothing) ) -(let ((v1-49 - (new 'static 'surface - :name '*tread-surface* - :turnv 1.0 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 1.0 - :target-speed 1.0 - :seek0 122880.0 - :seek90 245760.0 - :seek180 409600.0 - :fric 122880.0 - :nonlin-fric-dist 4096.0 - :slip-factor 1.0 - :slope-up-factor 8192.0 - :slope-down-factor 8192.0 - :impact-fric 1.0 - :bend-speed 4.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - ) - ) +(let ((v1-49 (new 'static 'surface + :name '*tread-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 122880.0 + :seek90 245760.0 + :seek180 409600.0 + :fric 122880.0 + :nonlin-fric-dist 4096.0 + :slip-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 8192.0 + :impact-fric 1.0 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + ) + ) ) (define *tread-surface* v1-49) - (set! - (-> v1-49 mult-hook) - (the-as (function surface surface surface int none) nothing) - ) + (set! (-> v1-49 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-49 touch-hook) nothing) - (set! (-> v1-49 active-hook) (the-as (function none) nothing)) + (set! (-> v1-49 active-hook) nothing) ) (define *standard-ground-surface* *stone-surface*) diff --git a/goal_src/engine/target/target-death.gc b/goal_src/engine/target/target-death.gc index 486cebaf97..837d1cb9a2 100644 --- a/goal_src/engine/target/target-death.gc +++ b/goal_src/engine/target/target-death.gc @@ -7,14 +7,13 @@ ;; DECOMP BEGINS -(defskelgroup *deathcam-sg* deathcam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :texture-level 2 - ) +(import "goal_src/import/deathcam-ag.gc") + +(defskelgroup *deathcam-sg* deathcam deathcam-lod0-jg deathcam-idle-ja + ((deathcam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :texture-level 2 + ) (define *auto-continue* #f) @@ -41,41 +40,38 @@ ) (defstate target-continue (target) - :event - target-generic-event-handler - :exit - (behavior () + :event target-generic-event-handler + :exit (behavior () (set! (-> *load-boundary-target* 0 quad) (-> (camera-pos) quad)) (set! (-> *load-boundary-target* 1 quad) (-> (target-pos 0) quad)) (set! (-> *load-boundary-target* 2 quad) (-> *load-boundary-target* 0 quad)) (set! (-> *load-boundary-target* 3 quad) (-> *load-boundary-target* 1 quad)) - (when (zero? (logand (-> *game-info* current-continue flags) 176)) + (when (zero? (logand (-> *game-info* current-continue flags) (continue-flags intro sage-intro title))) (set! (-> *level* border?) (-> *level* play?)) (set! (-> *setting-control* default border-mode) (-> *level* play?)) ) - (clear-pending-settings-from-process *setting-control* self 'allow-pause) - (clear-pending-settings-from-process *setting-control* self 'allow-progress) - (clear-pending-settings-from-process *setting-control* self 'bg-a) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) - (clear-pending-settings-from-process *setting-control* self 'ambient-volume) - (clear-pending-settings-from-process *setting-control* self 'music) + (remove-setting! 'allow-pause) + (remove-setting! 'allow-progress) + (remove-setting! 'bg-a) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) + (remove-setting! 'music) (none) ) - :code - (behavior ((arg0 continue-point)) + :code (behavior ((arg0 continue-point)) (set! (-> self state-time) (-> *display* base-frame-counter)) (if (-> *art-control* reserve-buffer) (reserve-free *art-control* (-> *art-control* reserve-buffer heap)) ) - (push-setting! *setting-control* self 'bg-a 'abs 1.0 0) + (add-setting! 'bg-a 'abs 1.0 0) (set! (-> *setting-control* current bg-a) 1.0) - (set-setting! *setting-control* self 'sfx-volume 'abs (the-as float 0.0) 0) - (set-setting! *setting-control* self 'ambient-volume 'abs (the-as float 0.0) 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) (let ((v1-20 (lookup-level-info (-> arg0 level)))) (when v1-20 - (set-setting! *setting-control* self 'music (-> v1-20 music-bank) (the-as float 0.0) 0) - (set-setting! *setting-control* self 'music-volume 'abs (the-as float 0.0) 0) + (set-setting! 'music (-> v1-20 music-bank) 0.0 0) + (set-setting! 'music-volume 'abs 0.0 0) ) ) (set! (-> *level* border?) #f) @@ -111,17 +107,16 @@ (set! (-> *load-state* want 1 force-vis?) #f) (set! (-> *load-state* want 1 force-inside?) #f) (when (not (string= (-> arg0 name) "default")) - (while (not - (and (or (not (-> arg0 lev0)) (not (-> arg0 disp0)) (= (level-status *level* (-> arg0 lev0)) 'active)) - (or (not (-> arg0 lev1)) (not (-> arg0 disp1)) (= (level-status *level* (-> arg0 lev1)) 'active)) - ) - ) + (while (not (and (or (not (-> arg0 lev0)) (not (-> arg0 disp0)) (= (level-status *level* (-> arg0 lev0)) 'active)) + (or (not (-> arg0 lev1)) (not (-> arg0 disp1)) (= (level-status *level* (-> arg0 lev1)) 'active)) + ) + ) (let ((v1-52 (lookup-level-info (-> arg0 level)))) (if (and v1-52 (= (-> *setting-control* current music) (-> v1-52 music-bank)) - (zero? (logand (-> arg0 flags) 160)) + (zero? (logand (-> arg0 flags) (continue-flags sage-intro title))) ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) + (remove-setting! 'music-volume) ) ) (suspend) @@ -185,9 +180,11 @@ ) ) (let ((s5-2 (level-get *level* (-> arg0 level)))) - (when s5-2 + + ;; vis info check added for PC, don't bother waiting for vis if the level doesn't have it. + (when (and s5-2 (-> s5-2 vis-info 0)) (while (and (= (-> s5-2 all-visible?) 'loading) (-> *level* vis?)) - (suspend) + (suspend) ) ) ) @@ -196,13 +193,13 @@ (set! (-> *ACTOR-bank* birth-max) 1000) (set-blackout-frames (seconds 0.1)) (cond - ((logtest? (-> arg0 flags) 128) + ((logtest? (-> arg0 flags) (continue-flags title)) (go target-title) ) - ((logtest? (-> arg0 flags) 16) + ((logtest? (-> arg0 flags) (continue-flags intro)) (start-sequence-a) ) - ((logtest? (-> arg0 flags) 32) + ((logtest? (-> arg0 flags) (continue-flags sage-intro)) (let ((s5-3 (entity-by-name "sage-23"))) (when s5-3 (set-blackout-frames (seconds 100)) @@ -217,7 +214,7 @@ ) ) ) - ((and (logtest? (-> arg0 flags) 2048) + ((and (logtest? (-> arg0 flags) (continue-flags sage-ecorocks)) (or (= (get-task-status (game-task beach-ecorocks)) (task-status need-hint)) (= (get-task-status (game-task beach-ecorocks)) (task-status need-introduction)) ) @@ -237,53 +234,45 @@ ) ) ) - ((logtest? (-> arg0 flags) 8) + ((logtest? (-> arg0 flags) (continue-flags demo)) (go target-demo) ) - ((logtest? (-> arg0 flags) 64) + ((logtest? (-> arg0 flags) (continue-flags sage-demo-convo)) (set-blackout-frames (seconds 1)) - (let ((s5-5 (get-process *default-dead-pool* process #x4000))) - (when s5-5 - (let ((t9-60 (method-of-type process activate))) - (t9-60 s5-5 *default-pool* 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process - s5-5 - (lambda () - (local-vars (v1-10 basic)) - (let ((gp-0 (entity-by-name "sage-23"))) - (when gp-0 - (set-blackout-frames (seconds 100)) - (entity-birth-no-kill gp-0) - (suspend) - (suspend) - (send-event - (if gp-0 - (-> gp-0 extra process) - ) - 'play-anim + (process-spawn-function + process + (lambda () + (local-vars (v1-10 basic)) + (let ((gp-0 (entity-by-name "sage-23"))) + (when gp-0 + (set-blackout-frames (seconds 100)) + (entity-birth-no-kill gp-0) + (suspend) + (suspend) + (send-event + (if gp-0 + (-> gp-0 extra process) ) - ) + 'play-anim ) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 2)) - (suspend) - ) - ) - (until (not v1-10) - (suspend) - (set! v1-10 (and *target* (logtest? (-> *target* state-flags) 256))) - ) - (set! (-> *cpad-list* cpads 0 change-time) (-> *display* base-frame-counter)) - (reset-actors 'dead) - (start 'play (get-continue-by-name *game-info* "misty-start")) ) ) - (-> s5-5 ppointer) + (let ((gp-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 2)) + (suspend) + ) + ) + (until (not v1-10) + (suspend) + (set! v1-10 (and *target* (logtest? (-> *target* state-flags) (state-flags grabbed)))) + ) + (set! (-> *cpad-list* cpads 0 change-time) (-> *display* base-frame-counter)) + (reset-actors 'dead) + (start 'play (get-continue-by-name *game-info* "misty-start")) ) ) ) - ((logtest? (-> arg0 flags) 4) + ((logtest? (-> arg0 flags) (continue-flags warp)) (let ((s5-6 (new 'static 'vector))) (cond ((string= (-> arg0 name) "village1-warp") @@ -322,7 +311,7 @@ (set-continue! *game-info* "village1-hut") ) ((or (string= (-> arg0 name) "training-warp") (string= (-> arg0 name) "game-start")) - (if (logtest? (-> arg0 flags) 1024) + (if (logtest? (-> arg0 flags) (continue-flags game-start)) (close-specific-task! (game-task intro) (task-status need-resolution)) ) (set! (-> s5-6 quad) (-> (entity-by-name "training-part-1") extra trans quad)) @@ -457,29 +446,18 @@ (when (and s5-8 (not (null? (-> s5-8 continues)))) (format 0 "~A ~A ~A~%" (-> arg0 level) (-> s5-8 name) (car (-> s5-8 continues))) (inspect global) - (let ((gp-1 (get-process *default-dead-pool* process #x4000))) - (when gp-1 - (let ((t9-104 (method-of-type process activate))) - (t9-104 gp-1 *default-pool* 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process gp-1 (lambda ((arg0 continue-point)) (start 'play arg0)) (car (-> s5-8 continues))) - (-> gp-1 ppointer) - ) - ) + (process-spawn-function process (lambda ((arg0 continue-point)) (start 'play arg0)) (car (-> s5-8 continues))) ) ) ) (ja-channel-set! 1) - (let ((v1-264 (-> self skel root-channel 0))) - (set! (-> v1-264 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) + (ja :group! eichar-stance-loop-ja) (suspend) - (logior! (-> self control status) 7) + (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (go target-stance) (none) ) - :post - target-no-move-post + :post target-no-move-post ) (define *smack-mods* (new 'static 'surface @@ -504,8 +482,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :mult-hook - (lambda :behavior target + :mult-hook (lambda :behavior target ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) (when (= arg3 1) (let ((f30-0 (-> self control unknown-float40)) @@ -521,12 +498,11 @@ (none) ) :mode 'air - :flags #x800 + :flags (surface-flags jump) ) ) -(define - *smack-up-mods* +(define *smack-up-mods* (new 'static 'surface :name 'jump :turnv 131072.0 @@ -551,8 +527,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :mult-hook - (lambda :behavior target + :mult-hook (lambda :behavior target ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) (when (= arg3 1) (let ((f30-0 (-> self control unknown-float40)) @@ -568,7 +543,7 @@ (none) ) :mode 'air - :flags #x818 + :flags (surface-flags no-turn-around no-rotate-toward-transv jump) ) ) @@ -587,26 +562,19 @@ ) (defbehavior target-hit-effect target ((arg0 attack-info)) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker s5-0) self 'part-tracker (the-as pointer #x70004000)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1) + -1 + #f + #f + #f + (if (logtest? (-> arg0 mask) (attack-mask intersection)) + (-> arg0 intersection) + (-> self control root-prim prim-core) ) - (run-now-in-process - s5-0 - part-tracker-init - (-> *part-group-id-table* 1) - -1 - #f - #f - #f - (if (logtest? (-> arg0 mask) 4) - (-> arg0 intersection) - (-> self control root-prim prim-core) - ) - ) - (-> s5-0 ppointer) - ) + :to self ) (let ((v1-9 (-> arg0 mode))) (cond @@ -619,27 +587,19 @@ (= v1-13 'up) ) ) - (sound-play-by-name (static-sound-name "hit-up") (new-sound-id) 1024 0 0 1 #t) + (sound-play "hit-up") ) (else - (sound-play-by-name (static-sound-name "oof") (new-sound-id) 1024 0 0 1 #t) + (sound-play "oof") ) ) ) (case (-> arg0 mode) (('burn 'burnup) - (let ((gp-1 (get-process *default-dead-pool* process #x4000))) - (when gp-1 - (let ((t9-10 (method-of-type process activate))) - (t9-10 gp-1 self 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process gp-1 process-drawable-burn-effect 1200) - (-> gp-1 ppointer) - ) - ) + (process-spawn-function process process-drawable-burn-effect 1200 :to self) ) (('tar) - (sound-play-by-name (static-sound-name "get-burned") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-burned") ) ) 0 @@ -661,8 +621,9 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) + (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -688,7 +649,7 @@ ) #t ) - (logior! (-> self control status) 1) + (logior! (-> self control status) (cshape-moving-flags onsurf)) (return (the-as object 'stuck)) ) (let ((s1-0 (new-stack-vector0))) @@ -713,7 +674,7 @@ (let ((s5-0 #f)) (if (and (!= (-> arg0 angle) 'front) (!= (-> arg0 angle) 'shove) - (logtest? (-> arg0 mask) 2) + (logtest? (-> arg0 mask) (attack-mask vector)) (!= (-> arg0 shove-back) 0.0) ) (forward-up-nopitch->quaternion (-> self control dir-targ) arg1 (-> self control dynam gravity-normal)) @@ -726,7 +687,7 @@ (set! (-> self control unknown-surface00) *smack-up-mods*) ) (('front) - (if (and (logtest? (-> arg0 mask) 2) (!= (-> arg0 shove-back) 0.0)) + (if (and (logtest? (-> arg0 mask) (attack-mask vector)) (!= (-> arg0 shove-back) 0.0)) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-negate! (new 'stack-no-clear 'vector) arg1) @@ -747,19 +708,10 @@ (defbehavior target-hit-setup-anim target ((arg0 attack-info)) (case (-> arg0 angle) (('back) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 74) - ) - ) - (ja-channel-push! 1 22) + (when (not (ja-group? eichar-hit-from-back-ja)) + (ja-channel-push! 1 (seconds 0.075)) (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 74)) - num-func-identity - ) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim eichar-hit-from-back-ja) num-func-identity) (let ((f0-0 0.0)) (set! (-> gp-1 frame-num) f0-0) f0-0 @@ -768,19 +720,10 @@ ) ) (('up 'up-forward) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 75) - ) - ) - (ja-channel-push! 1 22) + (when (not (ja-group? eichar-hit-up-ja)) + (ja-channel-push! 1 (seconds 0.075)) (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 75)) - num-func-identity - ) + (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim eichar-hit-up-ja) num-func-identity) (let ((f0-1 0.0)) (set! (-> gp-2 frame-num) f0-1) f0-1 @@ -789,49 +732,24 @@ ) ) (('air 'jump) - (ja-channel-push! 1 15) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) - (set! (-> a0-21 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1)) - ) - (set! (-> a0-21 param 1) 1.0) - (set! (-> a0-21 frame-num) 0.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! eichar-jump-ja :num! (seek!) :frame-num 0.0) (when (= (-> arg0 angle) 'air) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + (sound-play "smack-surface") (dummy-10 (-> self skel effect) 'group-smack-surface (the-as float 0.0) 5) (dummy-10 (-> self skel effect) 'group-smack-surface-dizzy (the-as float 0.0) 8) ) ) (('shove) - (ja-channel-push! 1 15) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> self draw art-group data 78))) - (set! (-> a0-30 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 78)) data 0 length) -1)) - ) - (set! (-> a0-30 param 1) 1.0) - (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> self draw art-group data 78)) num-func-seek!) - ) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! eichar-smack-surface-ja :num! (seek!) :frame-num 0.0) + (sound-play "smack-surface") ) (else - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 73) - ) - ) - (ja-channel-push! 1 22) + (when (not (ja-group? eichar-hit-from-front-ja)) + (ja-channel-push! 1 (seconds 0.075)) (let ((gp-5 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-5 - (the-as art-joint-anim (-> self draw art-group data 73)) - num-func-identity - ) + (joint-control-channel-group-eval! gp-5 (the-as art-joint-anim eichar-hit-from-front-ja) num-func-identity) (let ((f0-10 0.0)) (set! (-> gp-5 frame-num) f0-10) f0-10 @@ -868,39 +786,20 @@ ) (set-quaternion! (-> self control) (-> self control dir-targ)) #t - (let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - (ja-step 0) - ) - ) - ) - ) - ) + (let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (ja-group) data 0 length) -1)) (ja-step 0)))))) (until v1-40 (+! f30-1 (* (-> arg0 shove-back) f28-1 (-> *display* seconds-per-frame))) (set! s2-1 (target-hit-push s3-1 s1-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) - (set! v1-40 (or (ja-done? 0) (and arg1 (logtest? (-> self control status) 1)))) + (ja :num! (seek!)) + (set! v1-40 (or (ja-done? 0) (and arg1 (logtest? (-> self control status) (cshape-moving-flags onsurf))))) ) - (while (and (or (zero? (logand (-> self control status) 1)) s2-1) (!= s2-1 'stuck)) + (while (and (or (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) s2-1) (!= s2-1 'stuck)) (arg2) (+! f30-1 (* (-> arg0 shove-back) f28-1 (-> *display* seconds-per-frame))) (set! s2-1 (target-hit-push s3-1 s1-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) (if (not s2-1) - (set! (-> self state-flags) (logand -9 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags being-attacked)) ) (suspend) ) @@ -912,10 +811,8 @@ ) (defstate target-hit (target) - :event - target-standard-event-handler - :exit - (behavior () + :event target-standard-event-handler + :exit (behavior () (let ((gp-0 (new-stack-vector0)) (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) @@ -935,13 +832,12 @@ ) ) (if (!= (-> self next-state name) 'target-death) - (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags being-attacked dying)) ) (target-exit) (none) ) - :trans - (behavior () + :trans (behavior () (when (= *cheat-mode* 'debug) (when (and (not *pause-lock*) (cpad-hold? (-> self control unknown-cpad-info00 number) r2)) (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) @@ -950,9 +846,8 @@ ) (none) ) - :code - (behavior ((arg0 symbol) (arg1 attack-info)) - (set! (-> self water flags) (logand -65537 (-> self water flags))) + :code (behavior ((arg0 symbol) (arg1 attack-info)) + (logclear! (-> self water flags) (water-flags wt16)) (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 (-> self attack-info))) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -976,7 +871,7 @@ ) ) (combine! gp-0 arg1) - (when (zero? (logand (-> gp-0 mask) 2)) + (when (zero? (logand (-> gp-0 mask) (attack-mask vector))) (vector-z-quaternion! (-> gp-0 vector) (-> self control unknown-quaternion00)) (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) (set! (-> gp-0 vector y) (-> gp-0 shove-up)) @@ -996,78 +891,87 @@ ) ) ) - (when (= arg0 'attack) - (logior! (-> self state-flags) 8) - (set! (-> self game hit-time) (-> *display* base-frame-counter)) - (case (-> gp-0 mode) - (('endlessfall) - (cond - ((= (-> self game mode) 'debug) - (let ((s4-1 (new-stack-vector0))) - (set! (-> s4-1 quad) (-> self control last-known-safe-ground quad)) - (ja-channel-set! 0) - (let ((s3-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s3-1) (seconds 1)) - (suspend) - ) - ) - (move-to-point! (-> self control) s4-1) - ) - (set! (-> (&-> (-> self control) unknown-qword00) 0) (-> self control trans quad)) - (send-event *camera* 'teleport) - (go target-stance) - ) - (else - (pickup-collectable! - (-> self fact-info-target) - (pickup-type eco-green) - (the-as float -1000.0) - (the-as handle #f) + (cond + ((= arg0 'attack) + (logior! (-> self state-flags) (state-flags being-attacked)) + (set! (-> self game hit-time) (-> *display* base-frame-counter)) + (case (-> gp-0 mode) + (('endlessfall) + (cond + ((= (-> self game mode) 'debug) + (let ((s4-1 (new-stack-vector0))) + (set! (-> s4-1 quad) (-> self control last-known-safe-ground quad)) + (ja-channel-set! 0) + (let ((s3-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) s3-1) (seconds 1)) + (suspend) + ) + ) + (move-to-point! (-> self control) s4-1) ) - (go target-death (-> gp-0 mode)) + (set! (-> (&-> (-> self control) unknown-qword00) 0) (-> self control trans quad)) + (send-event *camera* 'teleport) + (go target-stance) ) - ) - ) - (('drown-death 'sharkey 'lava 'dark-eco-pool 'ogreboss-super-boulder 'melt 'instant-death) - (pickup-collectable! - (-> self fact-info-target) - (pickup-type eco-green) - (the-as float -1000.0) - (the-as handle #f) - ) - (if (= (-> self game mode) 'play) - (go target-death (-> gp-0 mode)) - ) - ) - (('death) - (pickup-collectable! - (-> self fact-info-target) - (pickup-type eco-green) - (the-as float -1000.0) - (the-as handle #f) - ) - ) - (('plant-boss) - (pickup-collectable! - (-> self fact-info-target) - (pickup-type eco-green) - (- (-> *FACT-bank* health-single-inc)) - (the-as handle #f) - ) - (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) - (go target-death (-> gp-0 mode)) - ) - ) - (else + (else + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + (go target-death (-> gp-0 mode)) + ) + ) + ) + (('drown-death 'sharkey 'lava 'dark-eco-pool 'ogreboss-super-boulder 'melt 'instant-death) + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + (if (= (-> self game mode) 'play) + (go target-death (-> gp-0 mode)) + ) + ) + (('death) + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + ) + (('plant-boss) (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (go target-death (-> gp-0 mode)) + ) + ) + (else + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (- (-> *FACT-bank* health-single-inc)) + (the-as handle #f) + ) + ) + ) + (target-hit-effect gp-0) + ) + (else + (case (-> gp-0 mode) + (('burn 'burnup) + (sound-play "get-burned") + ) ) ) - (target-hit-effect gp-0) ) (set! (-> self control unknown-surface00) *smack-mods*) (target-hit-setup-anim gp-0) @@ -1080,17 +984,12 @@ (go target-hit-ground #f) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) -(define - *death-spool-array* +(define *death-spool-array* (the-as (array spool-anim) - (new - 'static - 'boxed-array - :type spool-anim :length 11 :allocated-length 11 + (new 'static 'boxed-array :type spool-anim (new 'static 'spool-anim :name "death-0181" :index 3 :parts 1 :command-list '()) (new 'static 'spool-anim :name "death-0182" :index 4 :parts 1 :command-list '()) (new 'static 'spool-anim :name "death-0184" :index 5 :parts 1 :command-list '()) @@ -1124,42 +1023,29 @@ (defbehavior target-death-anim target ((arg0 spool-anim)) (set! (-> self control unknown-surface00) *neutral-mods*) - (ja-channel-push! 1 30) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 76))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 76)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 76)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! eichar-deatha-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if arg0 (spool-push *art-control* (-> arg0 name) 0 self (the-as float -99.0)) ) (send-event *camera* 'joystick 0.0 -1.0) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (when (zero? (logand (-> self align flags) 1)) + (when (zero? (logand (-> self align flags) (align-flags disabled))) (vector-matrix*! s5-0 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (vector-float*! (-> self control transv) s5-0 (-> *display* frames-per-second)) ) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) 0 (none) ) (defstate target-death (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'end-mode) @@ -1195,43 +1081,45 @@ ) ) ) - :exit - (behavior () - (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags being-attacked dying)) (target-exit) - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (clear-pending-settings-from-process *setting-control* self 'allow-progress) + (remove-setting! 'process-mask) + (remove-setting! 'allow-progress) (restore-collide-with-as (-> self control)) - (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (none) ) - :trans - (-> target-hit trans) - :code - (behavior ((arg0 symbol)) + :trans (-> target-hit trans) + :code (behavior ((arg0 symbol)) (set! (-> self control unknown-uint20) (the-as uint #f)) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'target) - (set! (-> a1-0 param 0) (the-as uint 'die)) - (set! (-> a1-0 param 1) (the-as uint arg0)) - (set! (-> self control unknown-int21) - (the-as int (send-event-function (handle->process (-> self attack-info attacker)) a1-0)) - ) - ) + (set! (-> self control unknown-int21) + (the-as int (send-event (handle->process (-> self attack-info attacker)) 'target 'die arg0)) + ) (set! (-> self neck flex-blend) 0.0) (target-timed-invulnerable-off self) - (set-setting! *setting-control* self 'process-mask 'set (the-as float 0.0) #x14a0000) - (copy-settings-from-target! *setting-control*) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) + (apply-settings *setting-control*) (set! (-> self control transv quad) (the-as uint128 0)) - (logior! (-> self state-flags) #x8000) + (logior! (-> self state-flags) (state-flags dying)) (case arg0 (('none 'instant-death) ) (('ogreboss-super-boulder) + ;; PAL patch here + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 32) + -1 + #f + #f + #f + (-> self control trans) + :to *entity-pool* + ) (set! (-> self post-hook) target-no-ja-move-post) (-> self attack-info attacker) (ja-channel-set! 0) @@ -1243,22 +1131,22 @@ ) ) (('drown 'drown-death) - (sound-play-by-name (static-sound-name "death-drown") (new-sound-id) 1024 0 0 1 #t) - (set! (-> self water flags) (logand -17 (-> self water flags))) + (sound-play "death-drown") + (logclear! (-> self water flags) (water-flags wt04)) (clear-collide-with-as (-> self control)) (set! (-> self control unknown-surface00) *dive-mods*) (set! (-> self control dynam gravity-max) 6144.0) (set! (-> self control dynam gravity-length) 6144.0) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (let ((f30-0 0.7) (gp-3 (-> self skel root-channel 0)) ) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 93))) + (set! (-> gp-3 frame-group) (the-as art-joint-anim eichar-swim-walk-to-down-ja)) (set! (-> gp-3 param 0) (ja-aframe (the-as float 73.0) 0)) (let ((f30-1 (seek f30-0 (the-as float 0.05) (* 1.5 (-> *display* seconds-per-frame))))) (set! (-> gp-3 param 1) f30-1) (set! (-> gp-3 frame-num) 0.0) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 93)) num-func-seek!) + (joint-control-channel-group! gp-3 (the-as art-joint-anim eichar-swim-walk-to-down-ja) num-func-seek!) (until (ja-done? 0) (suspend) (let ((gp-4 (-> self skel root-channel 0))) @@ -1276,33 +1164,37 @@ (when (if (and (nonzero? s5-1) (type-type? (-> s5-1 type) water-vol)) s5-1 ) - (set! (-> self state-flags) (logior #x80000 (-> self state-flags))) + (set! (-> self state-flags) (logior (state-flags falling-into-pool-of-bad) (-> self state-flags))) (set! (-> self alt-cam-pos y) (+ 4096.0 (-> self water height))) ) ) (cond ((= arg0 'dark-eco-pool) - (sound-play-by-name (static-sound-name "death-darkeco") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-6 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-6 - (let ((t9-21 (method-of-type part-tracker activate))) - (t9-21 (the-as part-tracker gp-6) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-6 part-tracker-init (-> *part-group-id-table* 31) -1 #f #f #f (-> self control trans)) - (-> gp-6 ppointer) - ) + (sound-play "death-darkeco") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 31) + -1 + #f + #f + #f + (-> self control trans) + :to *entity-pool* ) ) ((or (= arg0 'lava) (= arg0 'melt)) - (sound-play-by-name (static-sound-name "death-melt") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-8 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-8 - (let ((t9-26 (method-of-type part-tracker activate))) - (t9-26 (the-as part-tracker gp-8) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-8 part-tracker-init (-> *part-group-id-table* 32) -1 #f #f #f (-> self control trans)) - (-> gp-8 ppointer) - ) + (sound-play "death-melt") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 32) + -1 + #f + #f + #f + (-> self control trans) + :to *entity-pool* ) ) ) @@ -1317,10 +1209,10 @@ ) ) (('endlessfall) - (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-fall") (camera-change-to (the-as string cam-endlessfall) 30 #f) (set! (-> self control pat-ignore-mask unknown-bit) 1) - (set! (-> self water flags) (logand -17 (-> self water flags))) + (logclear! (-> self water flags) (water-flags wt04)) (let ((f30-2 (fmin -4096.0 (- (-> self control ground-impact-vel))))) (set! (-> self control unknown-uint20) (the-as uint f30-2)) (let ((gp-11 (new-stack-vector0))) @@ -1369,25 +1261,12 @@ (none) ) ) - (target-falling-anim (seconds 0.1) 99) - (ja-channel-push! 1 90) - (let ((a0-75 (-> self skel root-channel 0))) - (set! (-> a0-75 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) - (set! (-> a0-75 param 0) 0.5) - (set! (-> a0-75 frame-num) 0.0) - (joint-control-channel-group! a0-75 (the-as art-joint-anim (-> self draw art-group data 43)) num-func-loop!) - ) + (target-falling-anim (seconds 0.1) (seconds 0.33)) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! eichar-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) (let ((gp-12 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-12) (seconds 0.8)) - (let ((a0-76 (-> self skel root-channel 0))) - (set! (-> a0-76 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) - (set! (-> a0-76 param 0) 0.5) - (joint-control-channel-group-eval! - a0-76 - (the-as art-joint-anim (-> self draw art-group data 43)) - num-func-loop! - ) - ) + (ja :group! eichar-launch-jump-loop-ja :num! (loop! 0.5)) (suspend) ) ) @@ -1395,23 +1274,11 @@ ) (('target-hit-ground-hard) (set! (-> self control unknown-surface00) *neutral-mods*) - (ja-channel-push! 1 30) - (let ((a0-81 (-> self skel root-channel 0))) - (set! (-> a0-81 frame-group) (the-as art-joint-anim (-> self draw art-group data 77))) - (set! (-> a0-81 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 77)) data 0 length) -1)) - ) - (set! (-> a0-81 param 1) 1.0) - (set! (-> a0-81 frame-num) 0.0) - (joint-control-channel-group! a0-81 (the-as art-joint-anim (-> self draw art-group data 77)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! eichar-death-painful-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-82 (-> self skel root-channel 0))) - (set! (-> a0-82 param 0) (the float (+ (-> a0-82 frame-group data 0 length) -1))) - (set! (-> a0-82 param 1) 1.0) - (joint-control-channel-group-eval! a0-82 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (('sharkey) @@ -1463,30 +1330,23 @@ ) ) (('burn 'burnup) - (let ((gp-15 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-15 - (let ((t9-52 (method-of-type part-tracker activate))) - (t9-52 (the-as part-tracker gp-15) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-15 - part-tracker-init - (-> *part-group-id-table* 708) - -1 - #f - #f - #f - (-> self control trans) - ) - (-> gp-15 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 708) + -1 + #f + #f + #f + (-> self control trans) + :to *entity-pool* ) (target-death-anim (the-as spool-anim #f)) ) (else (case arg0 (('tar) - (sound-play-by-name (static-sound-name "death-drown") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-drown") ) ) (+! (-> *game-info* death-movie-tick) 1) @@ -1499,10 +1359,10 @@ (-> *death-spool-array* (death-movie-remap (-> *game-info* death-movie-tick) (-> *death-spool-array* length))) ) ) - (set-setting! *setting-control* self 'allow-progress #f (the-as float 0.0) 0) + (set-setting! 'allow-progress #f 0.0 0) (target-death-anim gp-18) (when (and (< (rand-vu-int-count (-> *game-info* death-movie-tick)) (* (-> *death-spool-array* length) 2)) - (zero? (logand (-> self water flags) 512)) + (zero? (logand (-> self water flags) (water-flags wt09))) (!= (-> self control ground-pat material) 9) (!= (-> self control ground-pat material) 10) ) @@ -1527,19 +1387,11 @@ (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (send-event (ppointer->process (-> self sidekick)) 'shadow #f) (send-event self 'blend-shape #t) - (let* ((s5-7 (get-process *default-dead-pool* pov-camera #x4000)) - (s5-8 - (ppointer->handle - (when s5-7 - (let ((t9-68 (method-of-type pov-camera activate))) - (t9-68 (the-as pov-camera s5-7) *target-pool* 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process s5-7 pov-camera-init-by-other (-> self control trans) *deathcam-sg* gp-18 4 self '()) - (-> s5-7 ppointer) - ) - ) - ) - ) + (let ((s5-8 (ppointer->handle + (process-spawn pov-camera (-> self control trans) *deathcam-sg* gp-18 4 self '() :to *target-pool*) + ) + ) + ) (send-event (handle->process s5-8) 'music-movie-volume 0.0) (send-event (handle->process s5-8) 'sfx-movie-volume 50.0) (set! (-> self post-hook) target-no-ja-move-post) @@ -1567,8 +1419,7 @@ (anim-loop) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) diff --git a/goal_src/engine/target/target-h.gc b/goal_src/engine/target/target-h.gc index 9c652801ec..ef1e15c231 100644 --- a/goal_src/engine/target/target-h.gc +++ b/goal_src/engine/target/target-h.gc @@ -5,47 +5,12 @@ ;; name in dgo: target-h ;; dgos: GAME, ENGINE -;; TODO - for cam-master -(define-extern target-cam-pos (function vector)) -(defun-extern stop symbol int) -(defun-extern start symbol continue-point target) -;; TODO - for mood -(define-extern target-joint-pos (function vector)) ;; TODO - unconfirmed -;; TODO - for logic-target - defined in shadow -(define-extern do-target-shadow (function none :behavior target)) -;; TODO - for logic-target - defined in powerups -(define-extern target-powerup-process (function none :behavior target)) -;; TODO - for logic-target - defined in target-handler -(define-extern target-exit (function none :behavior target)) -(define-extern target-generic-event-handler (function process int symbol event-message-block object :behavior target)) -;; TODO - for logic-target - defined in sidekick -(declare-type sidekick process-drawable) -(define-extern init-sidekick (function none :behavior sidekick)) -;; TODO - for logic-target - defined in target-death -(define-extern mod-var-jump (function symbol symbol symbol vector vector :behavior target)) -(define-extern init-var-jump (function float float vector vector vector vector :behavior target)) ;; 1st and 2nd vectors may be symbols instead? -;; TODO - for target-util -;; TODO - for target-tube -(define-extern target-attacked (function symbol attack-info process process (state handle attack-info target) object :behavior target)) ;; unconfirmed, target-tube::(event target-tube-start) -;; TODO - for racer-states -(define-extern racer-collision-reaction (function control-info collide-shape-intersect vector vector uint)) -;; TODO -for target2 -(define-extern target-falling-anim-trans (function none :behavior target)) ;; unconfirmed - -(declare-type collide-cache basic) (declare-type snowball-info basic) (declare-type tube-info basic) (declare-type racer-info basic) (declare-type flut-info basic) -(declare-type target process-drawable) -(defun-extern start symbol continue-point target) - -;; NOTE - for logic-target - defined in sidekick (declare-type sidekick process-drawable) -;; NOTE - for target-death -(define-extern start-sequence-a (function none)) ;; not confirmed - ;; DECOMP BEGINS (deftype target (process-drawable) @@ -75,11 +40,12 @@ (fp-hud handle :offset-assert 560) (no-load-wait time-frame :offset-assert 568) (no-look-around-wait time-frame :offset-assert 576) + (burn-proc handle :offset-assert 584) ) :heap-base #x1e0 :method-count-assert 21 - :size-assert #x248 - :flag-assert #x1501e00248 + :size-assert #x250 + :flag-assert #x1501e00250 (:methods (find-edge-grabs! (_type_ collide-cache) object 20) ) @@ -177,7 +143,7 @@ target-title-wait target-tube (target-tube-death symbol) - (target-tube-hit handle attack-info) + (target-tube-hit symbol attack-info) (target-tube-jump float float) (target-tube-start handle) target-turn-around @@ -214,7 +180,18 @@ (define-perm *sidekick* sidekick #f) -0 + +(defun-extern start symbol continue-point target) +(defun-extern stop symbol int) +(define-extern do-target-shadow (function none :behavior target)) +(define-extern target-joint-pos (function vector)) +(define-extern target-cam-pos (function vector)) +(define-extern target-powerup-process (function none :behavior target)) +(define-extern target-exit (function none :behavior target)) +(define-extern target-generic-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern init-sidekick (function none :behavior sidekick)) +(define-extern racer-collision-reaction (function control-info collide-shape-intersect vector vector cshape-moving-flags)) +(define-extern start-sequence-a (function none)) diff --git a/goal_src/engine/target/target-handler.gc b/goal_src/engine/target/target-handler.gc index b2005cf05e..8470d5962b 100644 --- a/goal_src/engine/target/target-handler.gc +++ b/goal_src/engine/target/target-handler.gc @@ -40,14 +40,14 @@ object (cond ((= v1-0 'get-pickup) - (when (zero? (logand (-> self state-flags) #x8000)) + (when (zero? (logand (-> self state-flags) (state-flags dying))) (let ((s4-0 (-> arg3 param 0)) (f28-0 (the-as float (-> arg3 param 1))) ) (if (!= (pickup-collectable! (-> self fact-info-target) (the-as pickup-type s4-0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as handle #f) ) (pickup-collectable! (-> self fact-info-target) (the-as pickup-type s4-0) f28-0 (process->handle arg0)) @@ -120,7 +120,7 @@ (pickup-collectable! (-> self fact-info-target) (the-as pickup-type (-> arg3 param 1)) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as handle #f) ) ) @@ -133,24 +133,24 @@ (case (-> arg3 param 0) (('save) (set! (-> self alt-cam-pos quad) (-> self control trans quad)) - (set! (-> self state-flags) (logior #x20000 (-> self state-flags))) + (set! (-> self state-flags) (logior (state-flags has-saved-position) (-> self state-flags))) (mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48) ) (('restore) - (set! (-> self state-flags) (logand -131073 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags has-saved-position)) (let ((gp-1 (-> arg3 param 1))) (move-to-point! (-> self control) (the-as vector (+ gp-1 0))) (quaternion-copy! (-> self control quat) (the-as quaternion (+ gp-1 16))) ) (rot->dir-targ! (-> self control)) - (logior! (-> self control status) 7) + (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! v0-0 (the-as object (-> *display* base-frame-counter))) - (set! (-> self control unknown-dword11) (the-as int v0-0)) + (set! (-> self control unknown-dword11) (the-as time-frame v0-0)) v0-0 ) (('reset) - (set! v0-0 (the-as object (logand -131073 (-> self state-flags)))) - (set! (-> self state-flags) (the-as uint v0-0)) + (set! v0-0 (the-as object (logclear (-> self state-flags) (state-flags has-saved-position)))) + (set! (-> self state-flags) (the-as state-flags v0-0)) v0-0 ) ) @@ -173,13 +173,13 @@ (set! (-> self neck flex-blend) (the-as float (-> arg3 param 0))) (cond ((-> arg3 param 1) - (set! (-> self state-flags) (logior #x40000 (-> self state-flags))) + (set! (-> self state-flags) (logior (state-flags looking-at-enemy) (-> self state-flags))) (set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) (look-at-enemy! (-> self neck) (-> self alt-neck-pos) 'force arg0) ) (else - (set! v0-0 (the-as object (logand -262145 (-> self state-flags)))) - (set! (-> self state-flags) (the-as uint v0-0)) + (set! v0-0 (the-as object (logclear (-> self state-flags) (state-flags looking-at-enemy)))) + (set! (-> self state-flags) (the-as state-flags v0-0)) v0-0 ) ) @@ -230,13 +230,13 @@ (cond ((-> arg3 param 0) (let ((v1-108 (-> self draw shadow-ctrl))) - (set! (-> v1-108 settings flags) (logand -33 (-> v1-108 settings flags))) + (logclear! (-> v1-108 settings flags) (shadow-flags disable-draw)) ) 0 ) (else (let ((v1-110 (-> self draw shadow-ctrl))) - (logior! (-> v1-110 settings flags) 32) + (logior! (-> v1-110 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -298,7 +298,13 @@ ) ) ((= v1-0 'change-state) - (go (the-as (state object object object object target) (-> arg3 param 0)) (-> arg3 param 1) (-> arg3 param 2) (-> arg3 param 3) (-> arg3 param 4)) + (go + (the-as (state object object object object target) (-> arg3 param 0)) + (-> arg3 param 1) + (-> arg3 param 2) + (-> arg3 param 3) + (-> arg3 param 4) + ) ) ) ) @@ -310,12 +316,13 @@ (set! (-> s5-0 attacker) (process->handle arg2)) (set! (-> s5-0 shove-back) arg0) (set! (-> s5-0 shove-up) arg1) - (set! (-> s5-0 angle) (if (zero? (logand (logior (-> self control status) (-> self control old-status)) 1)) - 'air - 'shove - ) + (set! (-> s5-0 angle) + (if (zero? (logand (logior (-> self control status) (-> self control old-status)) (cshape-moving-flags onsurf))) + 'air + 'shove + ) ) - (set! (-> s5-0 mask) (the-as uint 2248)) + (set! (-> s5-0 mask) (attack-mask attacker shove-back shove-up angle)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) (go arg3 'shove s5-0) ) @@ -331,16 +338,16 @@ arg0 ) -(defbehavior target-attacked target ((arg0 symbol) (arg1 attack-info) (arg2 process) (arg3 process) (arg4 (state handle attack-info target))) - (when (zero? (logand (-> self state-flags) 8)) +(defbehavior target-attacked target ((arg0 symbol) (arg1 attack-info) (arg2 process) (arg3 process) (arg4 (state symbol attack-info target))) + (when (zero? (logand (-> self state-flags) (state-flags being-attacked))) (cond - ((or (logtest? (-> self state-flags) 112) - (and (logtest? (-> arg1 mask) 32) + ((or (logtest? (-> self state-flags) (state-flags invulnerable timed-invulnerable invuln-powerup)) + (and (logtest? (-> arg1 mask) (attack-mask mode)) (= (-> arg1 mode) 'darkeco) (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) (>= (-> self fact-info-target eco-level) 1.0) ) - (logtest? #x100002 (-> self state-flags)) + (logtest? (state-flags dangerous flop-hit-ground) (-> self state-flags)) ) ) ) @@ -374,18 +381,18 @@ ) (when a1-2 (get-intersect-point (-> self attack-info-rec intersection) a1-2 (-> self control) arg3) - (logior! (-> self attack-info-rec mask) 4) + (logior! (-> self attack-info-rec mask) (attack-mask intersection)) ) ) ) (set! (-> self attack-info-rec prev-state) (-> self state)) - (logior! (-> self attack-info-rec mask) 8192) - (when (zero? (logand (-> self attack-info-rec mask) 8)) + (logior! (-> self attack-info-rec mask) (attack-mask atki13)) + (when (zero? (logand (-> self attack-info-rec mask) (attack-mask attacker))) (set! (-> self attack-info-rec attacker) (process->handle arg2)) - (logior! (-> self attack-info-rec mask) 8) + (logior! (-> self attack-info-rec mask) (attack-mask attacker)) ) (cond - ((and (logtest? (-> self attack-info-rec mask) 32) + ((and (logtest? (-> self attack-info-rec mask) (attack-mask mode)) (and (= (-> self attack-info-rec mode) 'damage) (not (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact-info-target health)))) ) @@ -396,44 +403,37 @@ (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) ) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker gp-1) self 'part-tracker (the-as pointer #x70004000)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1) + -1 + #f + #f + #f + (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection)) + (-> self attack-info-rec intersection) + (-> self control root-prim prim-core) ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 1) - -1 - #f - #f - #f - (if (logtest? (-> self attack-info-rec mask) 4) - (-> self attack-info-rec intersection) - (-> self control root-prim prim-core) - ) - ) - (-> gp-1 ppointer) - ) + :to self ) (target-timed-invulnerable - (if (logtest? (-> self attack-info-rec mask) 16) + (if (logtest? (-> self attack-info-rec mask) (attack-mask invinc-time)) (-> self attack-info-rec invinc-time) (-> *TARGET-bank* hit-invulnerable-timeout) ) self ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.5)) - (sound-play-by-name (static-sound-name "oof") (new-sound-id) 1024 0 0 1 #t) + (sound-play "oof") #t ) (else - (logior! (-> self state-flags) 8) + (logior! (-> self state-flags) (state-flags being-attacked)) (if (and (= (-> self game mode) 'play) (and (>= 1.0 (-> self fact-info-target health)) (= arg0 'attack))) - (logior! (-> self state-flags) #x8000) + (logior! (-> self state-flags) (state-flags dying)) ) - (go arg4 (the-as handle arg0) (-> self attack-info-rec)) + (go arg4 arg0 (-> self attack-info-rec)) ) ) ) @@ -765,8 +765,8 @@ ) (defbehavior target-apply-tongue target ((arg0 vector)) - (when (zero? (logand (-> self state-flags) 8)) - (logior! (-> self state-flags) #x7000) + (when (zero? (logand (-> self state-flags) (state-flags being-attacked))) + (logior! (-> self state-flags) (state-flags prevent-attack prevent-duck remove-prevents)) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> self control trans)))) (set! (-> self control unknown-float41) (lerp-scale (-> *TARGET-bank* tongue-pull-speed-min) @@ -797,15 +797,15 @@ (the-as attack-info (-> arg3 param 1)) arg0 (the-as process (-> arg3 param 0)) - (the-as (state handle attack-info target) target-hit) + target-hit ) ) (('shove) (when (!= (-> self next-state name) 'target-hit) (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 104) - (when (zero? (logand (-> self attack-info-rec mask) 8)) + (when (zero? (logand (-> self attack-info-rec mask) (attack-mask attacker))) (set! (-> self attack-info-rec attacker) (process->handle arg0)) - (logior! (-> self attack-info-rec mask) 8) + (logior! (-> self attack-info-rec mask) (attack-mask attacker)) ) (go target-hit 'shove (-> self attack-info-rec)) ) @@ -823,15 +823,16 @@ ) ) (('loading) - (if (not - (or (and (logtest? (-> self control unknown-surface00 flags) 2048) (zero? (logand (-> self control status) 1))) - (or (logtest? (-> self water flags) 512) - (logtest? (-> self state-flags) #x830e) - (logtest? (-> self control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) - (>= (-> self no-load-wait) (-> *display* base-frame-counter)) - ) - ) - ) + (if (not (or (and (logtest? (-> self control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + ) + (or (logtest? (-> self water flags) (water-flags wt09)) + (logtest? (-> self state-flags) (state-flags dangerous sf02 being-attacked grabbed first-person-mode dying)) + (logtest? (-> self control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) + (>= (-> self no-load-wait) (-> *display* base-frame-counter)) + ) + ) + ) (go target-load-wait) ) ) @@ -859,12 +860,14 @@ (go target-snowball-start (process->handle (the-as process (-> arg3 param 1)))) ) (('tube) - (if (and (logtest? (-> self control status) 1) (zero? (logand (-> self water flags) 512))) + (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) + (zero? (logand (-> self water flags) (water-flags wt09))) + ) (go target-tube-start (process->handle (the-as process (-> arg3 param 1)))) ) ) (('periscope) - (if (logtest? (-> self control status) 1) + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-periscope (process->handle (the-as process (-> arg3 param 1)))) ) ) @@ -898,7 +901,7 @@ (if (not (or (= (-> self control unknown-surface00 mode) 'swim) (= (-> self control unknown-surface00 mode) 'dive) (= (-> self next-state name) 'target-hit) - (logtest? (-> self state-flags) 8) + (logtest? (-> self state-flags) (state-flags being-attacked)) ) ) (go target-swim-stance) @@ -947,7 +950,7 @@ (the-as attack-info (-> arg3 param 1)) arg0 (the-as process (-> arg3 param 0)) - (the-as (state handle attack-info target) target-hit) + target-hit ) ) (else @@ -1008,7 +1011,7 @@ (-> self control unknown-dword50) (-> self control unknown-dword51) ) - (zero? (logand (-> self state-flags) #x8008)) + (zero? (logand (-> self state-flags) (state-flags being-attacked dying))) ) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) (target-timed-invulnerable (seconds 0.1) self) @@ -1019,7 +1022,7 @@ #f ) ((= arg2 'jump) - (sound-play-by-name (static-sound-name "jump-long") (new-sound-id) 1024 0 0 1 #t) + (sound-play "jump-long") (go target-jump (the-as float (-> arg3 param 0)) @@ -1074,16 +1077,26 @@ target-standard-event-handler (set! (-> self control unknown-vector11 quad) (the-as uint128 0)) (set! (-> self control unknown-float41) 0.0) (set! (-> self control unknown-float81) 0.0) - (set! (-> self state-flags) (logand -1835917 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags + sf02 + being-attacked + do-not-notice + grabbed + first-person-mode + looking-at-enemy + falling-into-pool-of-bad + flop-hit-ground + ) + ) (target-danger-set! 'harmless #f) - (logior! (-> self water flags) 16) - (set! (-> self water flags) (logand -65537 (-> self water flags))) + (logior! (-> self water flags) (water-flags wt04)) + (logclear! (-> self water flags) (water-flags wt16)) (set! (-> self water drip-mult) 1.0) (set! (-> self neck flex-blend) 1.0) (set! (-> self control unknown-float91) 0.0) (logclear! (-> self draw status) (draw-status hidden)) (logclear! (-> self skel status) (janim-status spool)) - (set! (-> self control status) (logand -16385 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags csmf14)) 0 (none) ) diff --git a/goal_src/engine/target/target-part.gc b/goal_src/engine/target/target-part.gc index c5126df955..e658c3d855 100644 --- a/goal_src/engine/target/target-part.gc +++ b/goal_src/engine/target/target-part.gc @@ -36,17 +36,18 @@ (s5-0 *target*) ) (set! (-> a1-1 y) (+ 4096.0 (-> a1-1 y))) - (when (>= (fill-and-probe-using-y-probe - *collide-cache* - a1-1 - (the-as float 20480.0) - (collide-kind background cak-1 cak-2 cak-3 water powerup crate enemy wall-object ground-object mother-spider) - s5-0 - s3-0 - (the-as uint 1) - ) - 0.0 - ) + ;; NOTE : added *target* check here. + (when (and s5-0 (>= (fill-and-probe-using-y-probe + *collide-cache* + a1-1 + (the-as float 20480.0) + (collide-kind background cak-1 cak-2 cak-3 water powerup crate enemy wall-object ground-object mother-spider) + s5-0 + s3-0 + (new 'static 'pat-surface :noentity #x1) + ) + 0.0 + )) (let ((s2-0 (new 'stack-no-clear 'vector)) (s4-1 (new 'stack-no-clear 'quaternion)) ) @@ -92,6 +93,8 @@ ) (init-vf0-vector) (set! sv-16 *target*) + ;; NOTE : added check here + (if (not sv-16) (return #f)) (let ((s3-0 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) (let ((s5-0 (new 'stack-no-clear 'quaternion))) @@ -173,6 +176,8 @@ ) (defun part-tracker-track-target-joint ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + ;; NOTE : added this check + (if (not *target*) (return #f)) (let* ((v1-0 *target*) (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-0 node-list data (the int (-> arg1 user-float))))) ) @@ -189,13 +194,11 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 56) (sp-item 57)) + :parts ((sp-item 56) (sp-item 57)) ) (defpart 56 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -216,13 +219,11 @@ ) (defpart 58 - :init-specs - ((sp-flt spt-fade-a -0.64)) + :init-specs ((sp-flt spt-fade-a -0.64)) ) (defpart 57 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 12)) (sp-flt spt-rot-z (degrees 0.0)) @@ -243,13 +244,11 @@ :duration 10 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 59) (sp-item 60)) + :parts ((sp-item 59) (sp-item 60)) ) (defpart 59 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 24.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -277,8 +276,7 @@ ) (defpart 60 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) @@ -306,13 +304,11 @@ :duration 10 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 62) (sp-item 63) (sp-item 64)) + :parts ((sp-item 62) (sp-item 63) (sp-item 64)) ) (defpart 62 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -338,13 +334,11 @@ ) (defpart 61 - :init-specs - ((sp-flt spt-fade-r -0.7111111) (sp-flt spt-fade-g 0.7111111) (sp-flt spt-fade-b 0.35555556)) + :init-specs ((sp-flt spt-fade-r -0.7111111) (sp-flt spt-fade-g 0.7111111) (sp-flt spt-fade-b 0.35555556)) ) (defpart 63 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.66) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -366,8 +360,7 @@ ) (defpart 64 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -387,8 +380,7 @@ :duration 10 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 65) (sp-item 66)) + :parts ((sp-item 65) (sp-item 66)) ) (defpartgroup group-punch-hit @@ -396,13 +388,11 @@ :duration 10 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 65) (sp-item 66)) + :parts ((sp-item 65) (sp-item 66)) ) (defpart 65 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 0.75)) (sp-flt spt-scale-x (meters 3)) @@ -426,13 +416,11 @@ ) (defpart 67 - :init-specs - ((sp-flt spt-fade-a -2.1333334)) + :init-specs ((sp-flt spt-fade-a -2.1333334)) ) (defpart 66 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 3)) @@ -452,8 +440,7 @@ :duration 10 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 68) + :parts ((sp-item 68) (sp-item 69) (sp-item 72 :binding 71) (sp-item 71 :flags (start-dead launch-asap)) @@ -480,8 +467,7 @@ ) (defpart 68 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-func spt-birth-func 'birth-func-copy-target-y-rot) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) @@ -506,8 +492,7 @@ ) (defpart 69 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-func spt-birth-func 'birth-func-copy-target-y-rot) (sp-flt spt-num 8.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) @@ -532,8 +517,7 @@ ) (defpart 72 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 12.0 8.0 1.0) (sp-flt spt-scale-x (meters 1)) (sp-copy-from-other spt-scale-y -4) @@ -547,8 +531,7 @@ ) (defpart 71 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-rnd-flt spt-y (meters -1.3333334) (meters 2.6666667) 1.0) @@ -574,13 +557,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 73) (sp-item 74) (sp-item 75)) + :parts ((sp-item 73) (sp-item 74) (sp-item 75)) ) (defpart 73 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -604,8 +585,7 @@ ) (defpart 74 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -629,8 +609,7 @@ ) (defpart 75 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -657,13 +636,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2371) (sp-item 2372) (sp-item 2370)) + :parts ((sp-item 2371) (sp-item 2372) (sp-item 2370)) ) (defpart 2371 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -687,8 +664,7 @@ ) (defpart 2372 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -712,8 +688,7 @@ ) (defpart 2370 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -740,13 +715,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 76) (sp-item 77) (sp-item 78)) + :parts ((sp-item 76) (sp-item 77) (sp-item 78)) ) (defpart 76 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -770,8 +743,7 @@ ) (defpart 77 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -795,8 +767,7 @@ ) (defpart 78 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -823,8 +794,7 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 76) (sp-item 77) (sp-item 78)) + :parts ((sp-item 76) (sp-item 77) (sp-item 78)) ) (defpartgroup group-land-poof-grass @@ -832,13 +802,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 79) (sp-item 80) (sp-item 81)) + :parts ((sp-item 79) (sp-item 80) (sp-item 81)) ) (defpart 79 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -862,8 +830,7 @@ ) (defpart 80 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -887,8 +854,7 @@ ) (defpart 81 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -916,13 +882,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 82) (sp-item 83)) + :parts ((sp-item 82) (sp-item 83)) ) (defpart 82 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -946,8 +910,7 @@ ) (defpart 83 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -975,8 +938,7 @@ :duration 5 :linger-duration 750 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 82) (sp-item 83) (sp-item 84) (sp-item 84)) + :parts ((sp-item 82) (sp-item 83) (sp-item 84) (sp-item 84)) ) (defpartgroup group-land-poof-stone @@ -984,13 +946,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 85) (sp-item 86)) + :parts ((sp-item 85) (sp-item 86)) ) (defpart 85 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1014,8 +974,7 @@ ) (defpart 86 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1043,13 +1002,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2373) (sp-item 2374)) + :parts ((sp-item 2373) (sp-item 2374)) ) (defpart 2373 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1071,8 +1028,7 @@ ) (defpart 2374 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1100,8 +1056,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 87)) + :parts ((sp-item 87)) ) (defpartgroup group-just-poof-stone @@ -1109,13 +1064,11 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 87)) + :parts ((sp-item 87)) ) (defpart 87 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1138,8 +1091,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2375) (sp-item 2376 :flags (is-3d))) + :parts ((sp-item 2375) (sp-item 2376 :flags (is-3d))) ) (defpartgroup group-just-poof-snow @@ -1147,8 +1099,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2375)) + :parts ((sp-item 2375)) ) (defpartgroup group-just-footprint-snow @@ -1156,13 +1107,11 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2376 :flags (is-3d))) + :parts ((sp-item 2376 :flags (is-3d))) ) (defpart 2376 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) (sp-func spt-birth-func 'birth-func-target-orient) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.25)) @@ -1179,8 +1128,7 @@ ) (defpart 2375 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1203,8 +1151,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2375)) + :parts ((sp-item 2375)) ) (defpartgroup group-just-poof-ice @@ -1212,8 +1159,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2375)) + :parts ((sp-item 2375)) ) (defpartgroup group-run-poof-crwood @@ -1221,8 +1167,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 89) (sp-item 89) (sp-item 84)) + :parts ((sp-item 89) (sp-item 89) (sp-item 84)) ) (defpartgroup group-just-poof-crwood @@ -1230,13 +1175,11 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 88)) + :parts ((sp-item 88)) ) (defpart 84 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-flt spt-y (meters -1)) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) @@ -1261,13 +1204,11 @@ ) (defpart 90 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 150 149 1) (sp-launcher-by-id spt-next-launcher 91)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 150 149 1) (sp-launcher-by-id spt-next-launcher 91)) ) (defpart 91 - :init-specs - ((sp-flt spt-fade-a -0.08)) + :init-specs ((sp-flt spt-fade-a -0.08)) ) (defpartgroup group-run-poof-wood @@ -1275,8 +1216,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 89)) + :parts ((sp-item 89)) ) (defpartgroup group-just-poof-wood @@ -1284,13 +1224,11 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 89)) + :parts ((sp-item 89)) ) (defpart 89 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1313,8 +1251,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2377)) + :parts ((sp-item 2377)) ) (defpartgroup group-just-poof-pcmetal @@ -1322,13 +1259,11 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2377)) + :parts ((sp-item 2377)) ) (defpart 2377 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1351,8 +1286,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 92) (sp-item 93 :flags (is-3d))) + :parts ((sp-item 92) (sp-item 93 :flags (is-3d))) ) (defpartgroup group-just-poof-grass @@ -1360,8 +1294,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 92)) + :parts ((sp-item 92)) ) (defpartgroup group-just-footprint-grass @@ -1369,13 +1302,11 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 93 :flags (is-3d))) + :parts ((sp-item 93 :flags (is-3d))) ) (defpart 92 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1394,8 +1325,7 @@ ) (defpart 93 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) (sp-func spt-birth-func 'birth-func-target-orient) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.25)) @@ -1416,8 +1346,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 88) (sp-item 94 :flags (is-3d))) + :parts ((sp-item 88) (sp-item 94 :flags (is-3d))) ) (defpartgroup group-just-poof-sand @@ -1425,8 +1354,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 88)) + :parts ((sp-item 88)) ) (defpartgroup group-just-footprint-sand @@ -1434,13 +1362,11 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 94 :flags (is-3d))) + :parts ((sp-item 94 :flags (is-3d))) ) (defpart 88 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1459,8 +1385,7 @@ ) (defpart 94 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) (sp-func spt-birth-func 'birth-func-target-orient) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.25)) @@ -1481,8 +1406,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2378)) + :parts ((sp-item 2378)) ) (defpartgroup group-just-poof-dirt @@ -1490,8 +1414,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2378)) + :parts ((sp-item 2378)) ) (defpartgroup group-just-footprint-dirt @@ -1499,13 +1422,11 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2379 :flags (is-3d))) + :parts ((sp-item 2379 :flags (is-3d))) ) (defpart 2378 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1524,8 +1445,7 @@ ) (defpart 2379 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) (sp-func spt-birth-func 'birth-func-target-orient) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.25)) @@ -1542,8 +1462,7 @@ ) (defpart 95 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 6.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1565,8 +1484,7 @@ ) (defpart 2253 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 6.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1588,8 +1506,7 @@ ) (defpart 96 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 0.0 2.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1612,8 +1529,7 @@ ) (defpart 2250 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 6.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1648,13 +1564,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 100) (sp-item 101)) + :parts ((sp-item 100) (sp-item 101)) ) (defpart 100 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 6.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1678,8 +1592,7 @@ ) (defpart 101 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1706,13 +1619,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2380) (sp-item 2381)) + :parts ((sp-item 2380) (sp-item 2381)) ) (defpart 2380 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 6.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1736,8 +1647,7 @@ ) (defpart 2381 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1764,13 +1674,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 102) (sp-item 103)) + :parts ((sp-item 102) (sp-item 103)) ) (defpart 102 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 6.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1794,8 +1702,7 @@ ) (defpart 103 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 0.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1823,13 +1730,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 104)) + :parts ((sp-item 104)) ) (defpart 104 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 6.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1857,13 +1762,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2382)) + :parts ((sp-item 2382)) ) (defpart 2382 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 6.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1891,13 +1794,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2383)) + :parts ((sp-item 2383)) ) (defpart 2383 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 6.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1925,8 +1826,7 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2383)) + :parts ((sp-item 2383)) ) (defpartgroup group-slide-poof-wood @@ -1934,13 +1834,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 105)) + :parts ((sp-item 105)) ) (defpart 105 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 6.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1968,13 +1866,11 @@ :duration 5 :linger-duration 750 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 105)) + :parts ((sp-item 105)) ) (defpart 106 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1993,8 +1889,7 @@ ) (defpart 2265 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -2013,8 +1908,7 @@ ) (defpart 2262 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -2033,8 +1927,7 @@ ) (defpart 107 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 0.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -2058,8 +1951,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) + :parts ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) (sp-item 296 :flags (start-dead launch-asap) :binding 297) (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) (sp-item 296 :flags (start-dead launch-asap) :binding 297) @@ -2103,8 +1995,7 @@ :duration 75 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2003) (sp-item 2004) (sp-item 2005) (sp-item 2006)) + :parts ((sp-item 2003) (sp-item 2004) (sp-item 2005) (sp-item 2006)) ) (defpartgroup group-burn-death @@ -2112,13 +2003,11 @@ :duration 150 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2003)) + :parts ((sp-item 2003)) ) (defpart 2006 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -2138,8 +2027,7 @@ ) (defpart 2003 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-x (meters 0) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 3) 1.0) @@ -2165,8 +2053,7 @@ ) (defpart 2004 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters 0.5) (meters 2) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 0.5) 1.0) @@ -2192,8 +2079,7 @@ ) (defpart 2005 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 3) 1.0) @@ -2224,13 +2110,11 @@ ) (defpart 2007 - :init-specs - ((sp-flt spt-fade-a -0.08)) + :init-specs ((sp-flt spt-fade-a -0.08)) ) (defpart 2002 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -2253,12 +2137,11 @@ ) (defpart 2008 - :init-specs - ((sp-flt spt-fade-a -0.28444445)) + :init-specs ((sp-flt spt-fade-a -0.28444445)) ) (defbehavior process-drawable-burn-effect target ((arg0 time-frame)) - (sound-play-by-name (static-sound-name "get-burned") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-burned") (let ((s5-1 (new 'stack 'rgbaf)) (s3-0 (-> *display* base-frame-counter)) (s4-1 (-> self parent)) @@ -2289,14 +2172,7 @@ ) ) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2002) - a2-3 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) + (launch-particles (-> *part-id-table* 2002) a2-3) ) (suspend) 0 @@ -2310,8 +2186,7 @@ ) (defpart 2391 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) (sp-func spt-birth-func 'birth-func-target-orient) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.02)) @@ -2334,29 +2209,25 @@ :id 611 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2474 :flags (launch-asap))) + :parts ((sp-item 2474 :flags (launch-asap))) ) (defpartgroup group-part-first-person-hud-right :id 612 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2475 :flags (launch-asap))) + :parts ((sp-item 2475 :flags (launch-asap))) ) (defpartgroup group-part-first-person-hud-selector :id 613 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2476 :flags (launch-asap))) + :parts ((sp-item 2476 :flags (launch-asap))) ) (defpart 2474 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3.5)) (sp-flt spt-scale-y (meters 13)) @@ -2371,8 +2242,7 @@ ) (defpart 2475 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3.5)) (sp-flt spt-rot-z (degrees 180.0)) @@ -2388,8 +2258,7 @@ ) (defpart 2476 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-copy-from-other spt-scale-y -4) diff --git a/goal_src/engine/target/target-util.gc b/goal_src/engine/target/target-util.gc index bba79ef3ad..9ce84022e8 100644 --- a/goal_src/engine/target/target-util.gc +++ b/goal_src/engine/target/target-util.gc @@ -7,29 +7,23 @@ (define-extern target-collide-set! (function symbol float int :behavior target)) -;; note: this file has a modification to let us run with an incompletely constructed target. -;; if you update the decompilation, you will need to restore this hack. - ;; DECOMP BEGINS -(defskelgroup *jchar-sg* eichar - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 3) - :longest-edge (meters 1) - :shadow 2 - :texture-level 2 - :sort 1 - ) +(import "goal_src/import/eichar-ag.gc") -(define - *target-shadow-control* +(defskelgroup *jchar-sg* eichar eichar-lod0-jg -1 + ((eichar-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3) + :longest-edge (meters 1) + :shadow eichar-shadow-mg + :texture-level 2 + :sort 1 + ) + +(define *target-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #x2)) - :shadow-dir - (new 'static 'vector :x -0.4226 :y -0.9063 :w 409600.0) + :flags (shadow-flags disable-fade) + :shadow-dir (new 'static 'vector :x -0.4226 :y -0.9063 :w 409600.0) :bot-plane (new 'static 'plane :y 1.0 :w 37683.2) :top-plane (new 'static 'plane :y 1.0 :w 4096.0) ) @@ -185,8 +179,7 @@ :root-offset (new 'static 'vector :y 4915.2 :w 1.0) :body-radius (meters 0.7) :edge-radius (meters 0.35) - :edge-offset - (new 'static 'vector :y 4915.2 :z 4096.0 :w 1.0) + :edge-offset (new 'static 'vector :y 4915.2 :z 4096.0 :w 1.0) :head-radius (meters 0.7) :head-height (meters 1.4) :head-offset (new 'static 'vector :y 4915.2 :w 1.0) @@ -237,7 +230,7 @@ (-> *TARGET-bank* root-radius) ) (set! (-> self control unknown-symbol30) arg0) - (set! (-> self state-flags) (logand -3 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 transform-index) -2) (set! (-> s4-0 prim-core collide-as) (collide-kind)) (set! (-> s4-0 collide-with) (collide-kind)) @@ -264,7 +257,7 @@ (new 'static 'vector :y 6553.6 :w 1.0) 9830.4 ) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -281,7 +274,7 @@ (new 'static 'vector :y 6553.6 :w 1.0) 10649.6 ) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -299,7 +292,7 @@ (set! (-> s5-0 transform-index) 32) ) (('duck-slide) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -317,7 +310,7 @@ (set! (-> s5-0 transform-index) 28) ) (('wheel-solid) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -339,7 +332,7 @@ (set! (-> self control unknown-symbol30) 'roll) ) (('flip) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -366,7 +359,7 @@ (new 'static 'vector :y 6553.6 :w 1.0) 11878.4 ) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -389,7 +382,7 @@ (new 'static 'vector :y 6553.6 :w 1.0) 11878.4 ) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -416,7 +409,7 @@ ) ) (('flop) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -433,7 +426,7 @@ (set! (-> self control unknown-symbol30) 'flop) ) (('flop-down) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -466,7 +459,7 @@ (new 'static 'vector :y 6553.6 :w 1.0) 12288.0 ) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -663,40 +656,42 @@ ) ) -(defmethod apply-alignment target ((obj target) (arg0 int) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment target ((obj target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> arg2 quad)) (set! (-> s2-0 z) (target-align-vel-z-adjust (-> s2-0 z))) - (when (logtest? arg0 7) + (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) (let* ((s3-0 (-> obj control unknown-matrix01)) (s0-0 (-> obj control unknown-matrix00)) (s1-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj control dynam gravity) s0-0)) (a1-3 (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj control transv) s0-0)) ) - (if (logtest? arg0 2048) + (if (logtest? arg0 (align-opts no-gravity)) (set-vector! s1-0 0.0 0.0 0.0 1.0) ) - (when (logtest? arg0 1) + (when (logtest? arg0 (align-opts adjust-x-vel)) (set! (-> a1-3 x) (+ (* (-> arg1 trans x) (-> s2-0 x) (-> *display* frames-per-second)) (* (-> s1-0 x) (-> *display* seconds-per-frame)) ) ) - (if (zero? (logand arg0 12)) + (if (zero? (logand arg0 (align-opts adjust-xz-vel keep-other-velocities))) (set! (-> a1-3 z) 0.0) ) ) - (if (and (logtest? arg0 2) (not (and (logtest? arg0 4096) (= (-> arg1 trans y) 0.0)))) + (if (and (logtest? arg0 (align-opts adjust-y-vel)) + (not (and (logtest? arg0 (align-opts ignore-y-if-zero)) (= (-> arg1 trans y) 0.0))) + ) (set! (-> a1-3 y) (+ (* (-> arg1 trans y) (-> s2-0 y) (-> *display* frames-per-second)) (* (-> s1-0 y) (-> *display* seconds-per-frame)) ) ) ) - (when (logtest? arg0 4) + (when (logtest? arg0 (align-opts adjust-xz-vel)) (set! (-> a1-3 z) (+ (* (-> arg1 trans z) (-> s2-0 z) (-> *display* frames-per-second)) (* (-> s1-0 z) (-> *display* seconds-per-frame)) ) ) - (if (zero? (logand arg0 9)) + (if (zero? (logand arg0 (align-opts adjust-x-vel keep-other-velocities))) (set! (-> a1-3 x) 0.0) ) ) @@ -704,7 +699,7 @@ ) ) ) - (if (logtest? arg0 16) + (if (logtest? arg0 (align-opts adjust-quat)) (quaternion-normalize! (quaternion*! (-> obj control unknown-quaternion00) (-> obj control unknown-quaternion00) (-> arg1 quat)) ) @@ -712,7 +707,6 @@ (the-as collide-shape (-> obj control)) ) - (defun average-turn-angle ((arg0 target)) (let ((f30-0 0.0)) (dotimes (s5-0 8) @@ -735,18 +729,20 @@ (not (-> *setting-control* current spooling)) (not (-> *setting-control* current movie)) (not (-> *setting-control* current hint)) - (zero? (logand (-> self control status) 32)) - (zero? (logand (-> self water flags) 512)) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + (zero? (logand (-> self water flags) (water-flags wt09))) ) ) (defbehavior can-jump? target ((arg0 symbol)) - (and (or (logtest? (-> self control status) 1) + (and (or (logtest? (-> self control status) (cshape-moving-flags onsurf)) (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) - (and (logtest? (-> self control status) 1) (< 0.866 (-> self control surface-angle))) + (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) + (< 0.866 (-> self control surface-angle)) + ) ) - (and (zero? (logand (-> self control unknown-surface01 flags) 64)) - (zero? (logand (-> self state-flags) 2048)) + (and (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-jump))) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) (case arg0 (('target-wheel-flip) (>= 0.5 (-> self control unknown-float61)) @@ -768,14 +764,10 @@ ) (defbehavior fall-test target () - (when (and (zero? (logand (-> self control status) 1)) + (when (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-15 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-15 (ja-group))) (or (not (or (= v1-15 (-> self draw art-group data 59)) (= v1-15 (-> self draw art-group data 60)) (= v1-15 (-> self draw art-group data 61)) @@ -786,7 +778,7 @@ ) ) (when (and (< (- (-> *display* base-frame-counter) (-> self control rider-time)) (-> *TARGET-bank* ground-timeout)) - (logtest? (-> self control unknown-surface01 flags) #x4000) + (logtest? (-> self control unknown-surface01 flags) (surface-flags moving-ground)) ) (+! (-> self control transv x) (-> self control rider-last-move x)) (+! (-> self control transv z) (-> self control rider-last-move z)) @@ -797,9 +789,9 @@ ) (defbehavior slide-down-test target () - (if (and (zero? (logand (-> self control status) 129)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf csmf07))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) - (logtest? (-> self control status) 4) + (logtest? (-> self control status) (cshape-moving-flags tsurf)) (< 0.5 (-> self control surface-angle)) ) (go target-slide-down) @@ -808,26 +800,31 @@ ) (defbehavior smack-surface? target ((arg0 symbol)) - (and (< 0.7 (-> self control touch-angle)) (and (< (-> self control surface-angle) 0.3) - (logtest? (-> self control status) 8) - (or arg0 (zero? (logand (-> self control status) 32))) - ) + (and (< 0.7 (-> self control touch-angle)) + (and (< (-> self control surface-angle) 0.3) + (logtest? (-> self control status) (cshape-moving-flags twall)) + (or arg0 (zero? (logand (-> self control status) (cshape-moving-flags t-act)))) + ) ) ) (defbehavior can-wheel? target () - (and (logtest? (-> self control status) 1) - (or (zero? (logand (-> self control status) 8)) (>= 0.7 (-> self control touch-angle))) - (and (< (-> self control unknown-float61) 0.7) (zero? (logand (-> self state-flags) 8192))) + (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) + (or (zero? (logand (-> self control status) (cshape-moving-flags twall))) + (>= 0.7 (-> self control touch-angle)) + ) + (and (< (-> self control unknown-float61) 0.7) + (zero? (logand (-> self state-flags) (state-flags prevent-duck))) + ) ) ) (defbehavior can-duck? target () - (and (logtest? (-> self control status) 1) + (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (>= (-> self control unknown-float60) 0.7) - (zero? (logand (-> self water flags) 6144)) - (zero? (logand (-> self state-flags) 8192)) - (or (zero? (logand (-> self water flags) 1024)) + (zero? (logand (-> self water flags) (water-flags wt11 wt12))) + (zero? (logand (-> self state-flags) (state-flags prevent-duck))) + (or (zero? (logand (-> self water flags) (water-flags wt10))) (< (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) ) ) @@ -850,7 +847,7 @@ (set! (-> gp-0 num-spheres) (the-as uint 2)) (set! (-> gp-0 collide-with) (-> self control root-prim collide-with)) (set! (-> gp-0 proc) #f) - (set! (-> gp-0 ignore-pat) (the-as uint 1)) + (set! (-> gp-0 ignore-pat) (new 'static 'pat-surface :noentity #x1)) (set! (-> gp-0 solid-only) #t) (if (fill-and-probe-using-spheres *collide-cache* gp-0) #f @@ -865,15 +862,15 @@ (pad-buttons square) ) ) - (or (and (logtest? (-> self state-flags) 4096) - (or (zero? (logand (-> self state-flags) #x4000)) + (or (and (logtest? (-> self state-flags) (state-flags prevent-attack)) + (or (zero? (logand (-> self state-flags) (state-flags remove-prevents))) (not (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) (>= (-> self fact-info-target eco-level) 1.0) ) ) ) ) - (logtest? (-> self control unknown-surface01 flags) 384) + (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) ) #f @@ -905,7 +902,9 @@ (defbehavior can-feet? target () (cond - ((or (logtest? (-> self state-flags) 4096) (logtest? (-> self control unknown-surface01 flags) 640)) + ((or (logtest? (-> self state-flags) (state-flags prevent-attack)) + (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf09)) + ) #f ) ((>= (- (-> *display* base-frame-counter) (-> *TARGET-bank* attack-timeout)) (-> self control unknown-dword33)) @@ -980,7 +979,7 @@ ) (defun target-timed-invulnerable ((arg0 time-frame) (arg1 target)) - (logior! (-> arg1 state-flags) 32) + (logior! (-> arg1 state-flags) (state-flags timed-invulnerable)) (set! (-> arg1 control unknown-dword80) (-> *display* base-frame-counter)) (set! (-> arg1 control unknown-dword81) arg0) (set-collide-kinds (-> arg1 control) 2 (collide-kind target-attack) (collide-kind)) @@ -990,7 +989,7 @@ (defun target-timed-invulnerable-off ((arg0 target)) (logclear! (-> arg0 draw status) (draw-status hidden)) - (set! (-> arg0 state-flags) (logand -33 (-> arg0 state-flags))) + (logclear! (-> arg0 state-flags) (state-flags timed-invulnerable)) (set-collide-kinds (-> arg0 control) 2 (collide-kind) (collide-kind target-attack)) 0 (none) @@ -1000,41 +999,41 @@ (with-pp (let ((s4-0 (-> arg0 mask))) (set! (-> obj mask) (-> arg0 mask)) - (if (logtest? s4-0 8) + (if (logtest? s4-0 (attack-mask attacker)) (set! (-> obj attacker) (-> arg0 attacker)) ) - (if (logtest? s4-0 32) + (if (logtest? s4-0 (attack-mask mode)) (set! (-> obj mode) (-> arg0 mode)) ) - (if (logtest? s4-0 2048) + (if (logtest? s4-0 (attack-mask angle)) (set! (-> obj angle) (-> arg0 angle)) ) - (if (logtest? s4-0 512) + (if (logtest? s4-0 (attack-mask dist)) (set! (-> obj dist) (-> arg0 dist)) ) - (if (logtest? s4-0 1024) + (if (logtest? s4-0 (attack-mask control)) (set! (-> obj control) (-> arg0 control)) ) - (if (logtest? s4-0 256) + (if (logtest? s4-0 (attack-mask speed)) (set! (-> obj speed) (-> arg0 speed)) ) - (if (logtest? s4-0 64) + (if (logtest? s4-0 (attack-mask shove-back)) (set! (-> obj shove-back) (-> arg0 shove-back)) ) - (if (logtest? s4-0 128) + (if (logtest? s4-0 (attack-mask shove-up)) (set! (-> obj shove-up) (-> arg0 shove-up)) ) - (if (logtest? s4-0 16) + (if (logtest? s4-0 (attack-mask invinc-time)) (set! (-> obj invinc-time) (-> arg0 invinc-time)) ) - (if (logtest? s4-0 4096) + (if (logtest? s4-0 (attack-mask rotate-to)) (set! (-> obj rotate-to) (-> arg0 rotate-to)) ) - (if (logtest? s4-0 4) + (if (logtest? s4-0 (attack-mask intersection)) (set! (-> obj intersection quad) (-> arg0 intersection quad)) ) (cond - ((zero? (logand s4-0 2)) + ((zero? (logand s4-0 (attack-mask vector))) (let* ((s3-0 pp) (s2-0 (handle->process (-> obj attacker))) (v1-39 (if (and (nonzero? s2-0) (type-type? (-> s2-0 type) process-drawable)) @@ -1049,7 +1048,7 @@ (-> (the-as process-drawable s3-0) root trans) (-> (the-as process-drawable v1-39) root trans) ) - (logior! (-> obj mask) 2) + (logior! (-> obj mask) (attack-mask vector)) ) ) ) @@ -1065,18 +1064,18 @@ ) ) (set! (-> obj vector quad) (-> arg0 vector quad)) - (if (zero? (logand s4-0 64)) + (if (zero? (logand s4-0 (attack-mask shove-back))) (set! (-> obj shove-back) (vector-xz-length (-> obj vector))) ) - (if (zero? (logand s4-0 128)) + (if (zero? (logand s4-0 (attack-mask shove-up))) (set! (-> obj shove-up) (-> obj vector y)) ) ) ) - (if (zero? (logand (-> obj mask) 512)) + (if (zero? (logand (-> obj mask) (attack-mask dist))) (set! (-> obj dist) (fabs (-> obj shove-back))) ) - (if (logtest? s4-0 1) + (if (logtest? s4-0 (attack-mask trans)) (set! (-> obj trans quad) (-> arg0 trans quad)) ) ) @@ -1092,11 +1091,7 @@ (set! (-> arg0 group 4) arg6) (dotimes (s3-0 3) (set! (-> arg0 chan s3-0) (+ arg1 s3-0)) - (let ((s2-0 (-> self skel root-channel (-> arg0 chan s3-0)))) - (set! (-> s2-0 frame-interp) (fabs (-> arg0 blend s3-0))) - (joint-control-channel-group-eval! s2-0 (the-as art-joint-anim arg2) num-func-identity) - (set! (-> s2-0 frame-num) 0.0) - ) + (ja :chan (-> arg0 chan s3-0) :group! arg2 :num! min :frame-interp (fabs (-> arg0 blend s3-0))) ) arg0 ) @@ -1112,34 +1107,14 @@ (set! (-> arg0 blend 2) (seek (the-as float (-> arg0 blend 2)) f30-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-7))))) ) ) - (cond - ((>= (-> arg0 blend 1) 0.0) - (let ((v1-4 (-> self skel root-channel (-> arg0 chan 1)))) - (set! (-> v1-4 frame-interp) (fabs (-> arg0 blend 1))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> arg0 group 1))) - ) - ) - (else - (let ((v1-7 (-> self skel root-channel (-> arg0 chan 1)))) - (set! (-> v1-7 frame-interp) (fabs (-> arg0 blend 1))) - (set! (-> v1-7 frame-group) (the-as art-joint-anim (-> arg0 group 2))) - ) + (if (>= (-> arg0 blend 1) 0.0) + (ja :chan (-> arg0 chan 1) :group! (-> arg0 group 1) :frame-interp (fabs (-> arg0 blend 1))) + (ja :chan (-> arg0 chan 1) :group! (-> arg0 group 2) :frame-interp (fabs (-> arg0 blend 1))) ) - ) - (cond - ((>= (-> arg0 blend 2) 0.0) - (let ((v1-10 (-> self skel root-channel (-> arg0 chan 2)))) - (set! (-> v1-10 frame-interp) (fabs (-> arg0 blend 2))) - (set! (-> v1-10 frame-group) (the-as art-joint-anim (-> arg0 group 4))) - ) - ) - (else - (let ((v1-13 (-> self skel root-channel (-> arg0 chan 2)))) - (set! (-> v1-13 frame-interp) (fabs (-> arg0 blend 2))) - (set! (-> v1-13 frame-group) (the-as art-joint-anim (-> arg0 group 3))) - ) + (if (>= (-> arg0 blend 2) 0.0) + (ja :chan (-> arg0 chan 2) :group! (-> arg0 group 4) :frame-interp (fabs (-> arg0 blend 2))) + (ja :chan (-> arg0 chan 2) :group! (-> arg0 group 3) :frame-interp (fabs (-> arg0 blend 2))) ) - ) 0 (none) ) @@ -1168,33 +1143,33 @@ ((not gp-0) (camera-pos) ) - ((logtest? (-> gp-0 state-flags) 1024) + ((logtest? (-> gp-0 state-flags) (state-flags use-alt-cam-pos)) (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 alt-cam-pos) 819.2 (new 'static 'rgba :r #xff :a #x80) ) (-> gp-0 alt-cam-pos) ) - ((logtest? #x20000 (-> gp-0 state-flags)) + ((logtest? (state-flags has-saved-position) (-> gp-0 state-flags)) (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 alt-cam-pos) 819.2 (new 'static 'rgba :r #xff :a #x80) ) (-> gp-0 alt-cam-pos) ) - ((logtest? #x80000 (-> gp-0 state-flags)) + ((logtest? (state-flags falling-into-pool-of-bad) (-> gp-0 state-flags)) (let ((s5-0 (the-as object (new 'static 'vector)))) (set! (-> (the-as vector s5-0) quad) (-> (&-> (-> gp-0 control) unknown-qword00) 0)) (set! (-> (the-as vector s5-0) y) (fmax (-> (the-as vector s5-0) y) (-> gp-0 alt-cam-pos y))) (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector s5-0) 819.2 (new 'static 'rgba :r #xff :a #x80) @@ -1205,7 +1180,7 @@ (else (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (&-> (-> gp-0 control) unknown-qword00)) 819.2 (new 'static 'rgba :r #xff :a #x80) diff --git a/goal_src/engine/target/target.gc b/goal_src/engine/target/target.gc index ad82066048..3d5ff6934f 100644 --- a/goal_src/engine/target/target.gc +++ b/goal_src/engine/target/target.gc @@ -4,12 +4,13 @@ ;; name: target.gc ;; name in dgo: target ;; dgos: GAME, ENGINE +;; note: changed for high fps ;; TODO - almost all of these are in target-handler or target2, temporary (define-extern target-state-hook-exit (function none :behavior target)) (define-extern target-effect-exit (function none :behavior target)) -(define-extern target-post (function none)) +(define-extern target-post (function none :behavior target)) (define-extern target-walk-event-handler (function process int symbol event-message-block object :behavior target)) (define-extern target-land-effect (function none :behavior target)) (define-extern target-dangerous-event-handler (function process int symbol event-message-block object :behavior target)) @@ -21,164 +22,73 @@ ;; DECOMP BEGINS -(defbehavior target-falling-anim target ((arg0 time-frame) (arg1 int)) - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) +(defbehavior target-falling-anim target ((arg0 time-frame) (arg1 time-frame)) + (let ((v1-2 (ja-group))) (cond - ((or (= v1-2 (-> self draw art-group data 38)) (= v1-2 (-> self draw art-group data 62))) + ((or (= v1-2 eichar-jump-loop-ja) (= v1-2 eichar-attack-uppercut-ja)) ) - ((let ((v1-8 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-8 (-> self draw art-group data 44)) (= v1-8 (-> self draw art-group data 45))) - ) - (ja-channel-push! 1 45) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 50))) - (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 50)) data 0 length) -1)) - ) - (set! (-> a0-16 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 50)) num-func-seek!) + ((let ((v1-8 (ja-group))) + (or (= v1-8 eichar-edge-grab-stance0-ja) (= v1-8 eichar-edge-grab-stance1-ja)) ) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! eichar-edge-grab-off-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 50) - ) + ((ja-group? eichar-edge-grab-off-ja) (until (ja-done? 0) (suspend) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 86) - ) - (ja-channel-push! 1 45) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) - (set! (-> s5-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1)) - ) - (set! (-> s5-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> s5-0 frame-num) (ja-aframe (the-as float 20.0) 0)) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-seek!) - ) + ((ja-group? eichar-yellow-jumping-blast-ja) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! eichar-jump-ja :num! (seek!) :frame-num (ja-aframe (the-as float 20.0) 0)) (until (ja-done? 0) - (let ((a0-33 (-> self skel root-channel 0))) - (set! (-> a0-33 param 0) (the float (+ (-> a0-33 frame-group data 0 length) -1))) - (set! (-> a0-33 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-33 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (suspend) ) ) (else (ja-channel-push! 1 arg1) - (let ((v1-82 (-> self skel root-channel 0))) - (set! (-> v1-82 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - ) + (ja :group! eichar-jump-loop-ja) (while (!= (-> self skel root-channel 0) (-> self skel channel)) (suspend) ) ) ) ) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-42 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-42 frame-num) 0.0) - (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-loop!) - ) + (ja-no-eval :group! eichar-jump-loop-ja :num! (loop!) :frame-num 0.0) (let ((s5-1 (-> *display* base-frame-counter))) (while (or (= arg0 -1) (< (- (-> *display* base-frame-counter) s5-1) arg0)) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-43 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! - a0-43 - (the-as art-joint-anim (-> self draw art-group data 38)) - num-func-loop! - ) - ) + (ja :group! eichar-jump-loop-ja :num! (loop!)) ) ) #f ) (defbehavior target-falling-anim-trans target () - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (b! - (or (= v1-2 (-> self draw art-group data 38)) (= v1-2 (-> self draw art-group data 35))) - cfg-7 - ) - ) - (ja-channel-push! 1 99) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) + (let ((v1-2 (ja-group))) + (b! (or (= v1-2 eichar-jump-loop-ja) (= v1-2 eichar-jump-land-ja)) cfg-7 :delay (empty-form)) ) + (ja-channel-push! 1 (seconds 0.33)) + (ja :group! eichar-jump-loop-ja) (b! #t cfg-23 :delay (nop!)) (label cfg-7) (cond - ((and (logtest? (-> self control status) 1) (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) - ) - ) - (ja-channel-push! 1 6) - (let ((v1-21 (-> self skel root-channel 0))) - (set! (-> v1-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - ) + ((and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (not (ja-group? eichar-jump-land-ja))) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! eichar-jump-land-ja) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-loop!) - ) + ((ja-group? eichar-jump-loop-ja) + (ja :num! (loop!)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? eichar-jump-land-ja) + (ja :num! (seek!)) ) ) (label cfg-23) @@ -198,14 +108,14 @@ ) (pad-buttons x) ) - (zero? (logand (-> self water flags) 512)) + (zero? (logand (-> self water flags) (water-flags wt09))) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) - (zero? (logand (-> self state-flags) 2048)) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) ) - (if (logtest? (-> self control status) 1) + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-hit-ground #f) ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) @@ -215,7 +125,7 @@ ) #t ) - (logior! (-> self control status) 1) + (logior! (-> self control status) (cshape-moving-flags onsurf)) (go target-hit-ground 'stuck) ) (if (!= (-> self state-time) (-> *display* base-frame-counter)) @@ -226,38 +136,35 @@ ) (defbehavior target-hit-ground-anim target ((arg0 symbol)) - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-2 (ja-group))) (cond - ((or (= v1-2 (-> self draw art-group data 63)) - (= v1-2 (-> self draw art-group data 64)) - (= v1-2 (-> self draw art-group data 66)) - (= v1-2 (-> self draw art-group data 67)) + ((or (= v1-2 eichar-flop-down-ja) + (= v1-2 eichar-flop-down-loop-ja) + (= v1-2 eichar-moving-flop-down-ja) + (= v1-2 eichar-moving-flop-down-loop-ja) ) (let ((gp-0 (or (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (< (-> self control unknown-float01) (-> (new 'static 'array float 1 61440.0) 0)) + (< (-> self control unknown-float01) 61440.0) ) ) - (f30-0 (if (= arg0 'swim) - (-> (new 'static 'array float 1 0.4) 0) - (-> (new 'static 'array float 1 1.0) 0) - ) + (f30-0 (the-as float (if (= arg0 'swim) + 0.4 + 1.0 + ) + ) ) ) (ja-channel-set! 1) (let ((s5-0 (-> self skel root-channel 0))) (set! (-> s5-0 frame-group) (the-as art-joint-anim (if gp-0 - (-> self draw art-group data 65) - (-> self draw art-group data 68) + eichar-flop-down-land-ja + eichar-moving-flop-down-land-ja ) ) ) (set! (-> s5-0 param 0) (the float (+ (-> (the-as art-joint-anim (if gp-0 - (-> self draw art-group data 65) - (-> self draw art-group data 68) + eichar-flop-down-land-ja + eichar-moving-flop-down-land-ja ) ) data @@ -268,30 +175,30 @@ ) ) ) - (let ((f30-1 (seek f30-0 (-> (new 'static 'array float 1 1.0) 0) (* 0.5 (-> *display* seconds-per-frame))))) + (let ((f30-1 (seek f30-0 (the-as float 1.0) (* 0.5 (-> *display* seconds-per-frame))))) (set! (-> s5-0 param 1) f30-1) (set! (-> s5-0 frame-num) 0.0) (joint-control-channel-group! s5-0 (the-as art-joint-anim (if gp-0 - (-> self draw art-group data 65) - (-> self draw art-group data 68) + eichar-flop-down-land-ja + eichar-moving-flop-down-land-ja ) ) num-func-seek! ) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 - (-> self align) - (if gp-0 - 2 - 6 - ) - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (the-as float 1.5) - ) + (compute-alignment! (-> self align)) + (align! (-> self align) + (the-as align-opts (if gp-0 + 2 + 6 + ) + ) + (the-as float 1.0) + (the-as float 1.0) + (the-as float 1.5) + ) (when (and (>= 25.0 (ja-aframe-num 0)) (and (>= (ja-aframe-num 0) 21.0) (= (-> self next-state name) 'target-flop-hit-ground) (!= (-> self control unknown-spoolanim00) 'stuck) @@ -314,7 +221,7 @@ (suspend) (let ((s5-1 (-> self skel root-channel 0))) (set! (-> s5-1 param 0) (the float (+ (-> s5-1 frame-group data 0 length) -1))) - (set! f30-1 (seek f30-1 (-> (new 'static 'array float 1 1.0) 0) (* 0.5 (-> *display* seconds-per-frame)))) + (set! f30-1 (seek f30-1 (the-as float 1.0) (* 0.5 (-> *display* seconds-per-frame)))) (set! (-> s5-1 param 1) f30-1) (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) ) @@ -329,232 +236,94 @@ ) #f ) - ((let ((v1-95 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (or (= v1-95 (-> self draw art-group data 38)) - (= v1-95 (-> self draw art-group data 42)) - (= v1-95 (-> self draw art-group data 43)) - ) - (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - (>= (ja-aframe-num 0) 38.0) - ) + ((let ((v1-95 (ja-group))) + (or (or (= v1-95 eichar-jump-loop-ja) (= v1-95 eichar-launch-jump-ja) (= v1-95 eichar-launch-jump-loop-ja)) + (and (ja-group? eichar-jump-ja) (>= (ja-aframe-num 0) 38.0)) ) ) - (ja-channel-push! 1 6) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> a0-35 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) - ) - (set! (-> a0-35 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-35 frame-num) 0.0) - (joint-control-channel-group! a0-35 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.02)) + (ja-no-eval :group! eichar-jump-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1))) - (set! (-> a0-36 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) - ((and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - (>= (ja-aframe-num 0) 35.0) - ) + ((and (ja-group? eichar-jump-ja) (>= (ja-aframe-num 0) 35.0)) (ja-channel-set! 1) - (let ((a0-44 (-> self skel root-channel 0))) - (set! (-> a0-44 frame-group) (the-as art-joint-anim (-> self draw art-group data 39))) - (set! (-> a0-44 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 39)) data 0 length) -1)) - ) - (set! (-> a0-44 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-44 frame-num) 0.0) - (joint-control-channel-group! a0-44 (the-as art-joint-anim (-> self draw art-group data 39)) num-func-seek!) - ) + (ja-no-eval :group! eichar-jump-short-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-45 (-> self skel root-channel 0))) - (set! (-> a0-45 param 0) (the float (+ (-> a0-45 frame-group data 0 length) -1))) - (set! (-> a0-45 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-45 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> gp-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) - ) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-1 frame-num) (ja-aframe (the-as float 50.0) 0)) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! eichar-jump-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 50.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-49 (-> self skel root-channel 0))) - (set! (-> a0-49 param 0) (the float (+ (-> a0-49 frame-group data 0 length) -1))) - (set! (-> a0-49 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-49 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) - ((let ((v1-187 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-187 (-> self draw art-group data 34)) (= v1-187 (-> self draw art-group data 41))) + ((let ((v1-187 (ja-group))) + (or (= v1-187 eichar-jump-ja) (= v1-187 eichar-duck-high-jump-ja)) ) (ja-channel-set! 1) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 39))) - (set! (-> gp-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 39)) data 0 length) -1)) - ) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-2 frame-num) (ja-aframe (the-as float 38.0) 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 39)) num-func-seek!) - ) + (ja-no-eval :group! eichar-jump-short-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 38.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-61 (-> self skel root-channel 0))) - (set! (-> a0-61 param 0) (the float (+ (-> a0-61 frame-group data 0 length) -1))) - (set! (-> a0-61 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-61 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> gp-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) - ) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-3 frame-num) (ja-aframe (the-as float 50.0) 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! eichar-jump-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 50.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-65 (-> self skel root-channel 0))) - (set! (-> a0-65 param 0) (the float (+ (-> a0-65 frame-group data 0 length) -1))) - (set! (-> a0-65 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-65 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) - ((let ((v1-242 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-242 (-> self draw art-group data 73)) (= v1-242 (-> self draw art-group data 74))) + ((let ((v1-242 (ja-group))) + (or (= v1-242 eichar-hit-from-front-ja) (= v1-242 eichar-hit-from-back-ja)) ) - (let ((f30-2 (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 74) - ) - (-> (new 'static 'array float 1 24576.0) 0) - (-> (new 'static 'array float 1 -24576.0) 0) - ) + (let ((f30-2 (the-as float (if (ja-group? eichar-hit-from-back-ja) + 24576.0 + -24576.0 + ) + ) ) ) - (ja-channel-push! 1 12) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 39))) - (set! (-> gp-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 39)) data 0 length) -1)) - ) - (set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-4 frame-num) (ja-aframe (the-as float 38.0) 0)) - (joint-control-channel-group! gp-4 (the-as art-joint-anim (-> self draw art-group data 39)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! eichar-jump-short-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 38.0) 0)) (until (ja-done? 0) (set-forward-vel f30-2) (suspend) - (let ((a0-82 (-> self skel root-channel 0))) - (set! (-> a0-82 param 0) (the float (+ (-> a0-82 frame-group data 0 length) -1))) - (set! (-> a0-82 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-82 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> gp-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) - ) - (set! (-> gp-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-5 frame-num) (ja-aframe (the-as float 50.0) 0)) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) - ) + (ja-no-eval :group! eichar-jump-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 50.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-86 (-> self skel root-channel 0))) - (set! (-> a0-86 param 0) (the float (+ (-> a0-86 frame-group data 0 length) -1))) - (set! (-> a0-86 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-86 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) - ((let ((v1-305 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-305 (-> self draw art-group data 34)) - (= v1-305 (-> self draw art-group data 56)) - (= v1-305 (-> self draw art-group data 57)) - (= v1-305 (-> self draw art-group data 58)) - (= v1-305 (-> self draw art-group data 68)) - (= v1-305 (-> self draw art-group data 65)) - (= v1-305 (-> self draw art-group data 62)) + ((let ((v1-305 (ja-group))) + (or (= v1-305 eichar-jump-ja) + (= v1-305 eichar-attack-from-jump-ja) + (= v1-305 eichar-attack-from-jump-loop-ja) + (= v1-305 eichar-attack-from-jump-end-ja) + (= v1-305 eichar-moving-flop-down-land-ja) + (= v1-305 eichar-flop-down-land-ja) + (= v1-305 eichar-attack-uppercut-ja) ) ) - (ja-channel-push! 1 12) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> gp-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) - ) - (set! (-> gp-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-6 frame-num) (ja-aframe (the-as float 42.0) 0)) - (joint-control-channel-group! gp-6 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! eichar-jump-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 42.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-113 (-> self skel root-channel 0))) - (set! (-> a0-113 param 0) (the float (+ (-> a0-113 frame-group data 0 length) -1))) - (set! (-> a0-113 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-113 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) - (let ((a0-119 (-> self skel root-channel 0))) - (set! (-> a0-119 param 0) (the float (+ (-> a0-119 frame-group data 0 length) -1))) - (set! (-> a0-119 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-119 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? eichar-jump-land-ja) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) @@ -566,38 +335,31 @@ ) (defstate target-startup (target) - :event - target-standard-event-handler - :code - (behavior () + :event target-standard-event-handler + :code (behavior () (suspend) (suspend) (go target-stance) (none) ) - :post - target-no-move-post + :post target-no-move-post ) (defstate target-stance (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () (set! (-> self control unknown-surface00) *walk-mods*) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control unknown-float81) 0.0) (target-state-hook-exit) (none) ) - :trans - (behavior () + :trans (behavior () ((-> self state-hook)) - (if (logtest? (-> self water flags) 1024) + (if (logtest? (-> self water flags) (water-flags wt10)) (go target-wade-stance) ) (when (= (-> self control ground-pat material) (pat-material ice)) @@ -644,375 +406,172 @@ (fall-test) (none) ) - :code - (behavior () + :code (behavior () (let ((s5-0 22) (gp-0 (new 'stack 'ground-tween-info)) ) - (let ((v1-3 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-3 (ja-group))) (cond - ((or (= v1-3 (-> self draw art-group data 89)) (= v1-3 (-> self draw art-group data 90))) + ((or (= v1-3 eichar-wade-shallow-walk-ja) (= v1-3 eichar-wade-deep-walk-ja)) (set! s5-0 45) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 71) - ) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 72))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 72)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 72)) num-func-seek!) - ) + ((ja-group? eichar-wheel-flip-ja) + (ja-no-eval :group! eichar-wheel-flip-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 51) - ) + ((ja-group? eichar-attack-from-stance-ja) (cond ((rand-vu-percent? (the-as float 0.3)) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 53))) - (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 53)) data 0 length) -1)) - ) - (set! (-> a0-20 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> self draw art-group data 53)) num-func-seek!) - ) + (ja-no-eval :group! eichar-attack-from-stance-alt-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 52))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 52)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 52)) num-func-seek!) - ) + (ja-no-eval :group! eichar-attack-from-stance-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 78) - ) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> self draw art-group data 79))) - (set! (-> a0-30 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 79)) data 0 length) -1)) - ) - (set! (-> a0-30 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> self draw art-group data 79)) num-func-seek!) - ) + ((ja-group? eichar-smack-surface-ja) + (ja-no-eval :group! eichar-smack-surface-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 param 0) (the float (+ (-> a0-31 frame-group data 0 length) -1))) - (set! (-> a0-31 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-31 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 84) - ) - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> self draw art-group data 85))) - (set! (-> a0-37 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 85)) data 0 length) -1)) - ) - (set! (-> a0-37 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-37 frame-num) 0.0) - (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> self draw art-group data 85)) num-func-seek!) - ) + ((ja-group? eichar-yellow-running-blast-ja) + (ja-no-eval :group! eichar-yellow-running-blast-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 param 0) (the float (+ (-> a0-38 frame-group data 0 length) -1))) - (set! (-> a0-38 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-38 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! s5-0 0) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 59) - ) + ((ja-group? eichar-attack-punch-ja) (set! (-> self control unknown-float81) (-> self control unknown-float80)) (set! (-> self control unknown-surface00) *walk-no-turn-mods*) - (let ((s4-0 (-> self skel root-channel 0))) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (if (rand-vu-percent? (the-as float 0.3)) - (-> self draw art-group data 61) - (-> self draw art-group data 60) - ) - ) - ) - (set! (-> s4-0 param 0) (the float (+ (-> (the-as art-joint-anim (if (rand-vu-percent? (the-as float 0.3)) - (-> self draw art-group data 61) - (-> self draw art-group data 60) - ) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> s4-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> s4-0 frame-num) 0.0) - (joint-control-channel-group! - s4-0 - (the-as art-joint-anim (if (rand-vu-percent? (the-as float 0.3)) - (-> self draw art-group data 61) - (-> self draw art-group data 60) - ) + (ja-no-eval :group! (if (rand-vu-percent? (the-as float 0.3)) + eichar-attack-punch-alt-end-ja + eichar-attack-punch-end-ja + ) + :num! (seek!) + :frame-num 0.0 ) - num-func-seek! - ) - ) (until (ja-done? 0) - (set! (-> self control unknown-float81) - (seek - (-> self control unknown-float81) - (-> (new 'static 'array float 1 0.0) 0) - (-> *display* seconds-per-frame) - ) - ) + (seek! (-> self control unknown-float81) (the-as float 0.0) (-> *display* seconds-per-frame)) (suspend) - (let ((a0-50 (-> self skel root-channel 0))) - (set! (-> a0-50 param 0) (the float (+ (-> a0-50 frame-group data 0 length) -1))) - (set! (-> a0-50 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-50 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self control unknown-surface00) *walk-mods*) (set! (-> self control unknown-float81) 0.0) (rot->dir-targ! (-> self control)) ) - ((let ((v1-206 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-206 (-> self draw art-group data 31)) (= v1-206 (-> self draw art-group data 32))) - ) - (ja-channel-push! 1 12) - (let ((a0-62 (-> self skel root-channel 0))) - (set! (-> a0-62 frame-group) (the-as art-joint-anim (-> self draw art-group data 30))) - (set! (-> a0-62 param 0) 0.0) - (set! (-> a0-62 param 1) 1.2) - (set! (-> a0-62 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-62 (the-as art-joint-anim (-> self draw art-group data 30)) num-func-seek!) + ((let ((v1-206 (ja-group))) + (or (= v1-206 eichar-duck-stance-ja) (= v1-206 eichar-duck-walk-ja)) ) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! eichar-stance-to-duck-ja :num! (seek! 0.0 1.2) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-63 (-> self skel root-channel 0))) - (set! (-> a0-63 param 0) 0.0) - (set! (-> a0-63 param 1) 1.2) - (joint-control-channel-group-eval! a0-63 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0 1.2)) ) (set! s5-0 12) ) - ((or (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) - (begin (set! s5-0 45) (< 0.5 (-> self skel root-channel 6 frame-interp))) - ) - (let ((v1-243 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-243 (-> self draw art-group data 28)) - (= v1-243 (-> self draw art-group data 29)) - (= v1-243 (-> self draw art-group data 54)) - (= v1-243 (-> self draw art-group data 55)) + ((or (and (ja-group? eichar-walk-ja) (begin (set! s5-0 45) (< 0.5 (-> self skel root-channel 6 frame-interp)))) + (let ((v1-243 (ja-group))) + (or (= v1-243 eichar-run-squash-ja) + (= v1-243 eichar-run-squash-weak-ja) + (= v1-243 eichar-attack-from-stance-run-end-ja) + (= v1-243 eichar-attack-from-stance-run-alt-end-ja) ) ) ) - (let ((f30-1 (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) - (let ((f0-57 (+ 50.0 (* 0.8333333 (+ -25.0 (ja-aframe-num 0)))))) - (- f0-57 (* (the float (the int (/ f0-57 50.0))) 50.0)) - ) - ) - (else - (-> (new 'static 'array float 1 0.0) 0) - ) - ) + (let ((f30-1 (the-as float (cond + ((ja-group? eichar-walk-ja) + (let ((f0-57 (+ 50.0 (* 0.8333333 (+ -25.0 (ja-aframe-num 0)))))) + (- f0-57 (* (the float (the int (/ f0-57 50.0))) 50.0)) + ) + ) + (else + 0.0 + ) + ) + ) ) ) (set! s5-0 45) - (ja-channel-push! 3 s5-0) + (ja-channel-push! 3 (the-as time-frame s5-0)) (ground-tween-initialize gp-0 (the-as uint 0) - (the-as uint (-> self draw art-group data 4)) - (the-as uint (-> self draw art-group data 13)) - (the-as uint (-> self draw art-group data 16)) - (the-as uint (-> self draw art-group data 7)) - (the-as uint (-> self draw art-group data 10)) - ) - (let ((s4-1 (-> self skel root-channel 0))) - (set! (-> s4-1 num-func) num-func-identity) - (set! (-> s4-1 frame-num) (ja-aframe f30-1 0)) + (the-as uint eichar-run-to-stance-loop-ja) + (the-as uint eichar-run-to-stance-loop-up-ja) + (the-as uint eichar-run-to-stance-loop-down-ja) + (the-as uint eichar-run-to-stance-loop-left-ja) + (the-as uint eichar-run-to-stance-loop-right-ja) ) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-1 0)) ) - (let ((a0-89 (-> self skel root-channel 1))) - (set! (-> a0-89 param 0) 0.0) - (joint-control-channel-group-eval! a0-89 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-90 (-> self skel root-channel 2))) - (set! (-> a0-90 param 0) 0.0) - (joint-control-channel-group-eval! a0-90 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) (dotimes (s4-2 3) (until (ja-done? 0) (ground-tween-update gp-0 (-> self control unknown-float61) (-> self control unknown-float62)) (suspend) - (let ((a0-92 (-> self skel root-channel 0))) - (set! (-> a0-92 param 0) (the float (+ (-> a0-92 frame-group data 0 length) -1))) - (set! (-> a0-92 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-92 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((a0-93 (-> self skel root-channel 1))) - (set! (-> a0-93 param 0) 0.0) - (joint-control-channel-group-eval! a0-93 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-94 (-> self skel root-channel 2))) - (set! (-> a0-94 param 0) 0.0) - (joint-control-channel-group-eval! a0-94 (the-as art-joint-anim #f) num-func-chan) - ) - ) - (let ((v1-298 (-> self skel root-channel 0))) - (set! (-> v1-298 num-func) num-func-identity) - (set! (-> v1-298 frame-num) 0.0) + (ja :num! (seek!)) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) ) + (ja :num-func num-func-identity :frame-num 0.0) ) (ground-tween-initialize gp-0 (the-as uint 0) - (the-as uint (-> self draw art-group data 3)) - (the-as uint (-> self draw art-group data 12)) - (the-as uint (-> self draw art-group data 15)) - (the-as uint (-> self draw art-group data 6)) - (the-as uint (-> self draw art-group data 9)) + (the-as uint eichar-run-to-stance-ja) + (the-as uint eichar-run-to-stance-up-ja) + (the-as uint eichar-run-to-stance-down-ja) + (the-as uint eichar-run-to-stance-left-ja) + (the-as uint eichar-run-to-stance-right-ja) ) (until (ja-done? 0) (ground-tween-update gp-0 (-> self control unknown-float61) (-> self control unknown-float62)) (suspend) - (let ((a0-99 (-> self skel root-channel 0))) - (set! (-> a0-99 param 0) (the float (+ (-> a0-99 frame-group data 0 length) -1))) - (set! (-> a0-99 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-99 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((a0-100 (-> self skel root-channel 1))) - (set! (-> a0-100 param 0) 0.0) - (joint-control-channel-group-eval! a0-100 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-101 (-> self skel root-channel 2))) - (set! (-> a0-101 param 0) 0.0) - (joint-control-channel-group-eval! a0-101 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (seek!)) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) ) ) - ((and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) - (>= (-> self control unknown-float01) 5734.4) - ) + ((and (ja-group? eichar-walk-ja) (>= (-> self control unknown-float01) 5734.4)) (set! s5-0 45) ) ) ) - (if (not (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (= (ja-group-size) 3) - ) - ) - (ja-channel-push! 3 s5-0) + (if (not (and (ja-group? eichar-stance-loop-ja) (= (ja-group-size) 3))) + (ja-channel-push! 3 (the-as time-frame s5-0)) ) (ground-tween-initialize gp-0 (the-as uint 0) - (the-as uint (-> self draw art-group data 5)) - (the-as uint (-> self draw art-group data 14)) - (the-as uint (-> self draw art-group data 17)) - (the-as uint (-> self draw art-group data 8)) - (the-as uint (-> self draw art-group data 11)) + (the-as uint eichar-stance-loop-ja) + (the-as uint eichar-stance-loop-up-ja) + (the-as uint eichar-stance-loop-down-ja) + (the-as uint eichar-stance-loop-left-ja) + (the-as uint eichar-stance-loop-right-ja) ) - (while #t + (loop (ground-tween-update gp-0 (-> self control unknown-float61) (-> self control unknown-float62)) (suspend) - (let ((a0-115 (-> self skel root-channel 0))) - (set! (-> a0-115 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-115 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((a0-116 (-> self skel root-channel 1))) - (set! (-> a0-116 param 0) 0.0) - (joint-control-channel-group-eval! a0-116 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-117 (-> self skel root-channel 2))) - (set! (-> a0-117 param 0) 0.0) - (joint-control-channel-group-eval! a0-117 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (loop!)) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) (if (can-play-stance-amibent?) (go target-stance-ambient) ) @@ -1020,27 +579,22 @@ ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-walk (target) - :event - target-walk-event-handler - :enter - (behavior () + :event target-walk-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *walk-mods*) (none) ) - :exit - (behavior () + :exit (behavior () (target-effect-exit) (target-state-hook-exit) (none) ) - :trans - (behavior () + :trans (behavior () ((-> self state-hook)) (when (= (-> self control ground-pat material) (pat-material ice)) (target-effect-exit) @@ -1099,309 +653,187 @@ (set! (-> self control transv quad) (-> self control unknown-vector-array10 (-> self control unknown-int10) quad) ) - (set! (-> self control transv w) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> self control transv w) 1.0) (go target-turn-around) ) (slide-down-test) (fall-test) (none) ) - :code - (behavior () + :code (behavior () (let ((f28-0 0.0) - (f30-0 (fmax 0.0 (fmin - (-> (new 'static 'array float 1 1.0) 0) - (* 0.000048828126 (+ -16384.0 (-> self control unknown-float01))) - ) - ) - ) + (f30-0 (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control unknown-float01)))))) (gp-0 #f) ) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 33) - ) - (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) - (ja-channel-push! 7 15) + ((ja-group? eichar-turn-around-ja) + (set! f30-0 1.0) + (ja-channel-push! 7 (seconds 0.05)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 69) - ) - (ja-channel-push! 7 22) - (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) + ((ja-group? eichar-duck-roll-ja) + (ja-channel-push! 7 (seconds 0.075)) + (set! f30-0 1.0) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 51) - ) - (let ((f30-1 - (fmax 0.8 (fmin (-> (new 'static 'array float 1 1.0) 0) (* 0.000048828126 (-> self control unknown-float01)))) - ) - ) + ((ja-group? eichar-attack-from-stance-ja) + (let ((f30-1 (fmax 0.8 (fmin 1.0 (* 0.000048828126 (-> self control unknown-float01)))))) (cond ((and (rand-vu-percent? (the-as float 0.3)) (< 20480.0 (-> self control unknown-float01))) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 53))) - (set! (-> s5-0 param 0) (ja-aframe (the-as float 29.0) 0)) - (set! (-> s5-0 param 1) f30-1) - (set! (-> s5-0 frame-num) 0.0) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 53)) num-func-seek!) - ) + (ja-no-eval :group! eichar-attack-from-stance-alt-end-ja + :num! (seek! (ja-aframe (the-as float 29.0) 0) f30-1) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 param 0) (ja-aframe (the-as float 29.0) 0)) - (set! (-> s5-1 param 1) f30-1) - (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 55))) - (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 55)) data 0 length) -1)) - ) - (set! (-> a0-20 param 1) f30-1) - (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> self draw art-group data 55)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 29.0) 0) f30-1)) ) + (ja-no-eval :group! eichar-attack-from-stance-run-alt-end-ja :num! (seek! max f30-1) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) f30-1) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-1)) ) ) (else - (let ((s5-2 (-> self skel root-channel 0))) - (set! (-> s5-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 52))) - (set! (-> s5-2 param 0) (ja-aframe (the-as float 29.0) 0)) - (set! (-> s5-2 param 1) f30-1) - (set! (-> s5-2 frame-num) 0.0) - (joint-control-channel-group! s5-2 (the-as art-joint-anim (-> self draw art-group data 52)) num-func-seek!) - ) + (ja-no-eval :group! eichar-attack-from-stance-end-ja + :num! (seek! (ja-aframe (the-as float 29.0) 0) f30-1) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((s5-3 (-> self skel root-channel 0))) - (set! (-> s5-3 param 0) (ja-aframe (the-as float 29.0) 0)) - (set! (-> s5-3 param 1) f30-1) - (joint-control-channel-group-eval! s5-3 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 54))) - (set! (-> a0-28 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 54)) data 0 length) -1)) - ) - (set! (-> a0-28 param 1) f30-1) - (set! (-> a0-28 frame-num) 0.0) - (joint-control-channel-group! a0-28 (the-as art-joint-anim (-> self draw art-group data 54)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 29.0) 0) f30-1)) ) + (ja-no-eval :group! eichar-attack-from-stance-run-end-ja :num! (seek! max f30-1) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1))) - (set! (-> a0-29 param 1) f30-1) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-1)) ) ) ) ) - (ja-channel-push! 7 15) - (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) + (ja-channel-push! 7 (seconds 0.05)) + (set! f30-0 1.0) (set! f28-0 30.0) ) (else - (let ((v1-108 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-108 (ja-group))) (cond - ((or (= v1-108 (-> self draw art-group data 59)) (= v1-108 (-> self draw art-group data 60))) - (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) + ((or (= v1-108 eichar-attack-punch-ja) (= v1-108 eichar-attack-punch-end-ja)) + (set! f30-0 1.0) (set! f28-0 30.0) - (ja-channel-push! 7 45) + (ja-channel-push! 7 (seconds 0.15)) ) - ((let ((v1-116 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-116 (-> self draw art-group data 84)) (= v1-116 (-> self draw art-group data 85))) + ((let ((v1-116 (ja-group))) + (or (= v1-116 eichar-yellow-running-blast-ja) (= v1-116 eichar-yellow-running-blast-end-ja)) ) - (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) + (set! f30-0 1.0) (set! f28-0 26.0) - (ja-channel-push! 7 30) + (ja-channel-push! 7 (seconds 0.1)) ) - ((and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) + ((and (ja-group? eichar-walk-ja) (= (-> self skel root-channel 0) (-> self skel channel))) (set! f28-0 (ja-aframe-num 0)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 102) - ) + ((ja-group? (-> self draw art-group data 102)) (set! f28-0 (ja-aframe-num 0)) - (ja-channel-push! 7 30) + (ja-channel-push! 7 (seconds 0.1)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 89) - ) + ((ja-group? eichar-wade-shallow-walk-ja) (set! f28-0 (ja-aframe-num 0)) - (ja-channel-push! 7 15) + (ja-channel-push! 7 (seconds 0.05)) ) - ((let ((v1-146 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (and (or (or (= v1-146 (-> self draw art-group data 38)) - (= v1-146 (-> self draw art-group data 71)) - (= v1-146 (-> self draw art-group data 58)) - (= v1-146 (-> self draw art-group data 62)) - (= v1-146 (-> self draw art-group data 65)) - (= v1-146 (-> self draw art-group data 68)) + ((let ((v1-146 (ja-group))) + (and (or (or (= v1-146 eichar-jump-loop-ja) + (= v1-146 eichar-wheel-flip-ja) + (= v1-146 eichar-attack-from-jump-end-ja) + (= v1-146 eichar-attack-uppercut-ja) + (= v1-146 eichar-flop-down-land-ja) + (= v1-146 eichar-moving-flop-down-land-ja) ) - (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - (< 30.0 (ja-aframe-num 0)) - ) + (and (ja-group? eichar-jump-ja) (< 30.0 (ja-aframe-num 0))) ) (< 12288.0 (-> self control unknown-float01)) ) ) - (let ((s5-4 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) + (let ((s5-4 (ja-group)) (f30-2 (-> self control ground-impact-vel)) ) - (case (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (((-> self draw art-group data 71) (-> self draw art-group data 58)) - (ja-channel-push! 1 15) + (case (ja-group) + ((eichar-wheel-flip-ja eichar-attack-from-jump-end-ja) + (ja-channel-push! 1 (seconds 0.05)) ) (else (ja-channel-set! 1) ) ) (cond - ((< (if (= s5-4 (-> self draw art-group data 34)) - (-> (new 'static 'array float 1 77824.0) 0) - (-> (new 'static 'array float 1 102400.0) 0) - ) + ((< (the-as float (if (= s5-4 eichar-jump-ja) + 77824.0 + 102400.0 + ) + ) f30-2 ) - (let ((s5-5 (-> self skel root-channel 0))) - (set! (-> s5-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 28))) - (set! (-> s5-5 param 0) (ja-aframe (-> (new 'static 'array float 1 3.0) 0) 0)) - (set! (-> s5-5 param 1) 1.00001) - (set! (-> s5-5 frame-num) 0.0) - (joint-control-channel-group! s5-5 (the-as art-joint-anim (-> self draw art-group data 28)) num-func-seek!) - ) + (ja-no-eval :group! eichar-run-squash-ja + :num! (seek! (ja-aframe (the-as float 3.0) 0) 1.00001) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((s5-6 (-> self skel root-channel 0))) - (set! (-> s5-6 param 0) (ja-aframe (-> (new 'static 'array float 1 3.0) 0) 0)) - (set! (-> s5-6 param 1) 1.00001) - (joint-control-channel-group-eval! s5-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 3.0) 0) 1.00001)) ) ) - ((< (if (= s5-4 (-> self draw art-group data 34)) - (-> (new 'static 'array float 1 61440.0) 0) - (-> (new 'static 'array float 1 102400.0) 0) - ) + ((< (the-as float (if (= s5-4 eichar-jump-ja) + 61440.0 + 102400.0 + ) + ) f30-2 ) - (let ((s5-7 (-> self skel root-channel 0))) - (set! (-> s5-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 28))) - (set! (-> s5-7 param 0) (ja-aframe (-> (new 'static 'array float 1 3.0) 0) 0)) - (set! (-> s5-7 param 1) 1.00001) - (set! (-> s5-7 frame-num) (ja-aframe (-> (new 'static 'array float 1 -1.0) 0) 0)) - (joint-control-channel-group! s5-7 (the-as art-joint-anim (-> self draw art-group data 28)) num-func-seek!) - ) + (ja-no-eval :group! eichar-run-squash-ja + :num! (seek! (ja-aframe (the-as float 3.0) 0) 1.00001) + :frame-num (ja-aframe (the-as float -1.0) 0) + ) (until (ja-done? 0) (suspend) - (let ((s5-8 (-> self skel root-channel 0))) - (set! (-> s5-8 param 0) (ja-aframe (-> (new 'static 'array float 1 3.0) 0) 0)) - (set! (-> s5-8 param 1) 1.00001) - (joint-control-channel-group-eval! s5-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 3.0) 0) 1.00001)) ) ) (else - (let ((s5-9 (-> self skel root-channel 0))) - (set! (-> s5-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 29))) - (set! (-> s5-9 param 0) (ja-aframe (the-as float 4.0) 0)) - (set! (-> s5-9 param 1) 1.00001) - (set! (-> s5-9 frame-num) 0.0) - (joint-control-channel-group! s5-9 (the-as art-joint-anim (-> self draw art-group data 29)) num-func-seek!) - ) + (ja-no-eval :group! eichar-run-squash-weak-ja + :num! (seek! (ja-aframe (the-as float 4.0) 0) 1.00001) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((s5-10 (-> self skel root-channel 0))) - (set! (-> s5-10 param 0) (ja-aframe (the-as float 4.0) 0)) - (set! (-> s5-10 param 1) 1.00001) - (joint-control-channel-group-eval! s5-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 4.0) 0) 1.00001)) ) ) ) ) (until (ja-done? 0) (suspend) - (let ((a0-116 (-> self skel root-channel 0))) - (set! (-> a0-116 param 0) (the float (+ (-> a0-116 frame-group data 0 length) -1))) - (set! (-> a0-116 param 1) - (/ (* (fmax 20480.0 (-> self control unknown-float01)) (-> *display* seconds-per-frame)) - (/ (-> *TARGET-bank* run-up-cycle-dist) (-> *TARGET-bank* run-cycle-length)) - ) - ) - (joint-control-channel-group-eval! a0-116 (the-as art-joint-anim #f) num-func-seek!) - ) + ;; This controls the slow walk animation that occurs after landing from a jump. > 60fps was broken here so I think should not be tied to seconds-per-frame + ;; unknown-float01 is the magnitude of xz velocity + (ja :num! (seek! max (/ (* (fmax 20480.0 (-> self control unknown-float01)) (if (or (= (-> *setting-control* current video-mode) '150fps) + (= (-> *setting-control* current video-mode) '100fps)) + 0.016666668 + (-> *display* seconds-per-frame))) + (/ (-> *TARGET-bank* run-up-cycle-dist) (-> *TARGET-bank* run-cycle-length)) + ) + ) + ) ) (set! f28-0 30.0) - (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) + (set! f30-0 1.0) (ja-channel-set! 7) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - (ja-channel-push! 7 15) + ((ja-group? eichar-jump-ja) + (ja-channel-push! 7 (seconds 0.05)) (set! gp-0 #t) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 78) - ) - (ja-channel-push! 7 45) + ((ja-group? eichar-smack-surface-ja) + (ja-channel-push! 7 (seconds 0.15)) ) (else - (ja-channel-push! 7 15) + (ja-channel-push! 7 (seconds 0.05)) ) ) ) @@ -1409,93 +841,50 @@ ) (set! (-> self skel root-channel 3 command) 'push) (set! (-> self skel root-channel 6 command) 'stack) - (let ((v1-265 (-> self skel root-channel 0))) - (set! (-> v1-265 frame-group) (the-as art-joint-anim (-> self draw art-group data 23))) - ) + (ja :group! eichar-walk-ja) (let ((f28-1 (ja-aframe f28-0 0))) - (let ((s5-11 (-> self skel root-channel 0))) - (set! (-> s5-11 frame-interp) 0.0) - (set! (-> s5-11 dist) (-> *TARGET-bank* walk-cycle-dist)) - (joint-control-channel-group-eval! - s5-11 - (the-as art-joint-anim (-> self draw art-group data 23)) - num-func-identity + (ja :group! eichar-walk-ja :num! (identity f28-1) :frame-interp 0.0 :dist (-> *TARGET-bank* walk-cycle-dist)) + (ja :chan 1 + :group! eichar-walk-down-ja + :num! (identity f28-1) + :frame-interp 0.0 + :dist (-> *TARGET-bank* walk-down-cycle-dist) ) - (set! (-> s5-11 frame-num) f28-1) - ) - (let ((s5-12 (-> self skel root-channel 1))) - (set! (-> s5-12 frame-interp) 0.0) - (set! (-> s5-12 dist) (-> *TARGET-bank* walk-down-cycle-dist)) - (joint-control-channel-group-eval! - s5-12 - (the-as art-joint-anim (-> self draw art-group data 25)) - num-func-identity + (ja :chan 2 + :group! eichar-walk-left-ja + :num! (identity f28-1) + :frame-interp 0.0 + :dist (-> *TARGET-bank* walk-side-cycle-dist) ) - (set! (-> s5-12 frame-num) f28-1) - ) - (let ((s5-13 (-> self skel root-channel 2))) - (set! (-> s5-13 frame-interp) 0.0) - (set! (-> s5-13 dist) (-> *TARGET-bank* walk-side-cycle-dist)) - (joint-control-channel-group-eval! - s5-13 - (the-as art-joint-anim (-> self draw art-group data 27)) - num-func-identity + (ja :chan 4 + :group! eichar-run-down-ja + :num! (identity f28-1) + :frame-interp 0.0 + :dist (-> *TARGET-bank* run-down-cycle-dist) ) - (set! (-> s5-13 frame-num) f28-1) - ) - (let ((s5-14 (-> self skel root-channel 4))) - (set! (-> s5-14 frame-interp) 0.0) - (set! (-> s5-14 dist) (-> *TARGET-bank* run-down-cycle-dist)) - (joint-control-channel-group-eval! - s5-14 - (the-as art-joint-anim (-> self draw art-group data 20)) - num-func-identity + (ja :chan 5 + :group! eichar-run-left-ja + :num! (identity f28-1) + :frame-interp 0.0 + :dist (-> *TARGET-bank* run-side-cycle-dist) ) - (set! (-> s5-14 frame-num) f28-1) - ) - (let ((s5-15 (-> self skel root-channel 5))) - (set! (-> s5-15 frame-interp) 0.0) - (set! (-> s5-15 dist) (-> *TARGET-bank* run-side-cycle-dist)) - (joint-control-channel-group-eval! - s5-15 - (the-as art-joint-anim (-> self draw art-group data 22)) - num-func-identity + (ja :chan 3 + :group! eichar-run-ja + :num! (identity f28-1) + :frame-interp 0.0 + :dist (-> *TARGET-bank* run-cycle-dist) ) - (set! (-> s5-15 frame-num) f28-1) - ) - (let ((s5-16 (-> self skel root-channel 3))) - (set! (-> s5-16 frame-interp) 0.0) - (set! (-> s5-16 dist) (-> *TARGET-bank* run-cycle-dist)) - (joint-control-channel-group-eval! - s5-16 - (the-as art-joint-anim (-> self draw art-group data 18)) - num-func-identity - ) - (set! (-> s5-16 frame-num) f28-1) - ) ) (let ((f28-2 0.0) (f26-1 0.0) ) - (while #t - (let ((f22-0 (fmax - (-> (new 'static 'array float 1 -1.0) 0) - (fmin (-> (new 'static 'array float 1 1.0) 0) (* 2.0 (-> self control unknown-float61))) - ) - ) - (f24-0 (fmax - (-> (new 'static 'array float 1 -1.0) 0) - (fmin (-> (new 'static 'array float 1 1.0) 0) (* 1.6 (-> self control unknown-float62))) - ) - ) + (loop + (let ((f22-0 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control unknown-float61))))) + (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control unknown-float62))))) ) (set! f30-0 (seek f30-0 - (fmax 0.0 (fmin - (-> (new 'static 'array float 1 1.0) 0) - (* 0.000048828126 (+ -16384.0 (-> self control unknown-float01))) - ) - ) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control unknown-float01))))) (* 2.0 (-> *display* seconds-per-frame)) ) ) @@ -1516,84 +905,59 @@ ) (cond ((>= f28-2 0.0) - (let ((v1-329 (-> self skel root-channel 1))) - (set! (-> v1-329 frame-interp) (fabs f28-2)) - (set! (-> v1-329 dist) (-> *TARGET-bank* walk-up-cycle-dist)) - (set! (-> v1-329 frame-group) (the-as art-joint-anim (-> self draw art-group data 24))) - ) - (let ((v1-332 (-> self skel root-channel 4))) - (set! (-> v1-332 frame-interp) (fabs f28-2)) - (set! (-> v1-332 dist) (-> *TARGET-bank* run-up-cycle-dist)) - (set! (-> v1-332 frame-group) (the-as art-joint-anim (-> self draw art-group data 19))) - ) + (ja :chan 1 :group! eichar-walk-up-ja :frame-interp (fabs f28-2) :dist (-> *TARGET-bank* walk-up-cycle-dist)) + (ja :chan 4 :group! eichar-run-up-ja :frame-interp (fabs f28-2) :dist (-> *TARGET-bank* run-up-cycle-dist)) ) (else - (let ((v1-335 (-> self skel root-channel 1))) - (set! (-> v1-335 frame-interp) (fabs f28-2)) - (set! (-> v1-335 dist) (-> *TARGET-bank* walk-down-cycle-dist)) - (set! (-> v1-335 frame-group) (the-as art-joint-anim (-> self draw art-group data 25))) - ) - (let ((v1-338 (-> self skel root-channel 4))) - (set! (-> v1-338 frame-interp) (fabs f28-2)) - (set! (-> v1-338 dist) (-> *TARGET-bank* run-down-cycle-dist)) - (set! (-> v1-338 frame-group) (the-as art-joint-anim (-> self draw art-group data 20))) - ) + (ja :chan 1 + :group! eichar-walk-down-ja + :frame-interp (fabs f28-2) + :dist (-> *TARGET-bank* walk-down-cycle-dist) + ) + (ja :chan 4 + :group! eichar-run-down-ja + :frame-interp (fabs f28-2) + :dist (-> *TARGET-bank* run-down-cycle-dist) + ) ) ) (cond ((>= f26-1 0.0) - (let ((v1-341 (-> self skel root-channel 2))) - (set! (-> v1-341 frame-interp) (fabs f26-1)) - (set! (-> v1-341 dist) (-> *TARGET-bank* walk-side-cycle-dist)) - (set! (-> v1-341 frame-group) (the-as art-joint-anim (-> self draw art-group data 26))) - ) - (let ((v1-344 (-> self skel root-channel 5))) - (set! (-> v1-344 frame-interp) (fabs f26-1)) - (set! (-> v1-344 dist) (-> *TARGET-bank* run-side-cycle-dist)) - (set! (-> v1-344 frame-group) (the-as art-joint-anim (-> self draw art-group data 21))) - ) + (ja :chan 2 + :group! eichar-walk-right-ja + :frame-interp (fabs f26-1) + :dist (-> *TARGET-bank* walk-side-cycle-dist) + ) + (ja :chan 5 + :group! eichar-run-right-ja + :frame-interp (fabs f26-1) + :dist (-> *TARGET-bank* run-side-cycle-dist) + ) ) (else - (let ((v1-347 (-> self skel root-channel 2))) - (set! (-> v1-347 frame-interp) (fabs f26-1)) - (set! (-> v1-347 dist) (-> *TARGET-bank* walk-side-cycle-dist)) - (set! (-> v1-347 frame-group) (the-as art-joint-anim (-> self draw art-group data 27))) - ) - (let ((v1-350 (-> self skel root-channel 5))) - (set! (-> v1-350 frame-interp) (fabs f26-1)) - (set! (-> v1-350 dist) (-> *TARGET-bank* run-side-cycle-dist)) - (set! (-> v1-350 frame-group) (the-as art-joint-anim (-> self draw art-group data 22))) - ) + (ja :chan 2 + :group! eichar-walk-left-ja + :frame-interp (fabs f26-1) + :dist (-> *TARGET-bank* walk-side-cycle-dist) + ) + (ja :chan 5 + :group! eichar-run-left-ja + :frame-interp (fabs f26-1) + :dist (-> *TARGET-bank* run-side-cycle-dist) + ) ) ) (set! (-> self skel root-channel 6 frame-interp) f30-0) - (let* ((f1-19 (dummy-9 (-> self skel))) + (let* ((f1-19 (current-cycle-distance (-> self skel))) (f0-92 (/ (-> self control unknown-float01) (* 60.0 (/ f1-19 (-> *TARGET-bank* run-cycle-length))))) - (a0-182 (-> self skel root-channel 0)) ) - (set! (-> a0-182 param 0) f0-92) - (joint-control-channel-group-eval! a0-182 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((a0-183 (-> self skel root-channel 1))) - (set! (-> a0-183 param 0) 0.0) - (joint-control-channel-group-eval! a0-183 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-184 (-> self skel root-channel 2))) - (set! (-> a0-184 param 0) 0.0) - (joint-control-channel-group-eval! a0-184 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-185 (-> self skel root-channel 3))) - (set! (-> a0-185 param 0) 0.0) - (joint-control-channel-group-eval! a0-185 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-186 (-> self skel root-channel 4))) - (set! (-> a0-186 param 0) 0.0) - (joint-control-channel-group-eval! a0-186 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-187 (-> self skel root-channel 5))) - (set! (-> a0-187 param 0) 0.0) - (joint-control-channel-group-eval! a0-187 (the-as art-joint-anim #f) num-func-chan) + (ja :num! (loop! f0-92)) ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + (ja :chan 3 :num! (chan 0)) + (ja :chan 4 :num! (chan 0)) + (ja :chan 5 :num! (chan 0)) (if (and gp-0 (!= (-> self skel root-channel 0) (-> self skel channel))) (ja-blend-eval) ) @@ -1603,31 +967,26 @@ ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-turn-around (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () (vector-turn-to (-> self control transv)) (set! (-> self control unknown-surface00) *turn-around-mods*) - (set! (-> self control unknown-float81) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> self control unknown-float81) 1.0) (none) ) - :exit - (behavior () + :exit (behavior () (target-state-hook-exit) - (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + (set-forward-vel (the-as float 0.0)) (set! (-> self control unknown-float01) 0.0) (set-quaternion! (-> self control) (-> self control dir-targ)) (set! (-> self control unknown-float81) 0.0) (none) ) - :trans - (behavior () + :trans (behavior () ((-> self state-hook)) (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) @@ -1646,7 +1005,7 @@ (if (can-hands? #t) (go target-running-attack) ) - (if (and (zero? (logand (-> self control status) 1)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.08)) ) (go target-falling #f) @@ -1654,34 +1013,16 @@ (slide-down-test) (none) ) - :code - (behavior () - (ja-channel-push! 1 12) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 33)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! eichar-turn-around-ja :num! min) (quaternion-rotate-y! (-> self control dir-targ) (-> self control dir-targ) (the-as float 32768.0)) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 2.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 - (-> self align) - 16 - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - ) + (ja :num! (seek! max 2.0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) ) (remove-exit) (set! (-> self control unknown-float81) 0.0) @@ -1691,72 +1032,48 @@ (go target-walk) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) (defstate target-slide-down (target) - :event - target-walk-event-handler - :enter - (behavior () + :event target-walk-event-handler + :enter (behavior () (set! (-> self control unknown-surface00) *jump-mods*) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control unknown-dword35) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () - (when (or (logtest? (-> self control status) 1) + :trans (behavior () + (when (or (logtest? (-> self control status) (cshape-moving-flags onsurf)) (if (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) #t ) ) - (logior! (-> self control status) 1) + (logior! (-> self control status) (cshape-moving-flags onsurf)) (go target-duck-stance) ) (none) ) - :code - (behavior () - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 31) - ) - ) - (ja-channel-push! 1 30) - ) - (while #t - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 31))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 31)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 31)) num-func-seek!) + :code (behavior () + (if (not (ja-group? eichar-duck-stance-ja)) + (ja-channel-push! 1 (seconds 0.1)) ) + (loop + (ja-no-eval :group! eichar-duck-stance-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defbehavior init-var-jump target ((arg0 float) (arg1 float) (arg2 vector) (arg3 vector) (arg4 vector)) - (set! (-> self control status) (logand -16385 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags csmf14)) (delete-back-vel) (when (< (- (-> *display* base-frame-counter) (-> self control rider-time)) (seconds 0.05)) (let ((f0-1 @@ -1769,7 +1086,7 @@ (set! arg0 (+ arg0 f0-1)) (set! arg1 (+ arg1 f0-1)) ) - (when (or (logtest? (-> self control unknown-surface01 flags) #x4000) + (when (or (logtest? (-> self control unknown-surface01 flags) (surface-flags moving-ground)) (= (-> self control poly-pat material) (pat-material rotate)) ) (+! (-> self control transv x) (-> self control rider-last-move x)) @@ -1822,8 +1139,8 @@ (local-vars (v0-2 vector)) (let ((f30-0 (* 0.033333335 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) (cond - ((or (< (-> (new 'static 'array float 1 1.0) 0) f30-0) (< (-> self control unknown-float123) 0.0) (not arg2)) - (set! (-> self control unknown-float123) (-> (new 'static 'array float 1 -1.0) 0)) + ((or (< 1.0 f30-0) (< (-> self control unknown-float123) 0.0) (not arg2)) + (set! (-> self control unknown-float123) -1.0) ) (else (set! (-> self control unknown-float123) f30-0) @@ -1846,8 +1163,8 @@ (the-as float (-> self control unknown-uint20)) (the-as float (-> self control unknown-uint30)) f30-0 - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 0.0) + (the-as float 1.0) ) (vector-dot (-> self control dynam gravity-normal) s3-1) ) @@ -1869,31 +1186,8 @@ ) ) 0 - (when (and arg1 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (and (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - extra - ) - #t - ) - ) - (let ((v1-57 (res-lump-struct - (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - extra - ) - 'collide-offset - vector - :time - (ja-frame-num 0) - ) - ) - ) + (when (and arg1 (ja-group) (and (-> (ja-group) extra) #t)) + (let ((v1-57 (res-lump-struct (-> (ja-group) extra) 'collide-offset vector :time (ja-frame-num 0)))) (cond (v1-57 (set! v0-2 (-> self control unknown-vector13)) @@ -1910,17 +1204,14 @@ ) (defstate target-duck-stance (target) - :event - target-standard-event-handler - :enter - (behavior () - (set! (-> self control unknown-float81) (-> (new 'static 'array float 1 1.0) 0)) + :event target-standard-event-handler + :enter (behavior () + (set! (-> self control unknown-float81) 1.0) (set! (-> self control unknown-surface00) *duck-mods*) - (target-collide-set! 'duck (-> (new 'static 'array float 1 1.0) 0)) + (target-collide-set! 'duck (the-as float 1.0)) (none) ) - :exit - (behavior () + :exit (behavior () (if (not (or (= (-> self next-state name) 'target-duck-walk) (= (-> self next-state name) 'target-duck-stance) (= (-> self next-state name) 'target-walk) @@ -1931,25 +1222,17 @@ (target-state-hook-exit) ) (target-exit) - (target-collide-set! 'normal (-> (new 'static 'array float 1 0.0) 0)) + (target-collide-set! 'normal (the-as float 0.0)) (none) ) - :trans - (behavior () + :trans (behavior () ((-> self state-hook)) - (if (and (or (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) - (logtest? (-> self state-flags) 8192) + (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) + ) + (logtest? (-> self state-flags) (state-flags prevent-duck)) ) - (let ((v1-13 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (and (not (or (= v1-13 (-> self draw art-group data 70)) (= v1-13 (-> self draw art-group data 69)))) - (can-exit-duck?) - ) + (let ((v1-13 (ja-group))) + (and (not (or (= v1-13 eichar-duck-roll-end-ja) (= v1-13 eichar-duck-roll-ja))) (can-exit-duck?)) ) ) (go target-stance) @@ -1982,120 +1265,58 @@ (slide-down-test) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 69) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 70))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 70)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 70)) num-func-seek!) - ) + ((ja-group? eichar-duck-roll-ja) + (ja-no-eval :group! eichar-duck-roll-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 31) - ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) + ((and (ja-group? eichar-duck-stance-ja) (= (-> self skel root-channel 0) (-> self skel channel))) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 32) - ) - (ja-channel-push! 1 30) + ((ja-group? eichar-duck-walk-ja) + (ja-channel-push! 1 (seconds 0.1)) ) (else - (ja-channel-push! 1 12) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 30))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 30)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! eichar-stance-to-duck-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (while #t - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 31))) - (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 31)) data 0 length) -1)) - ) - (set! (-> a0-22 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 31)) num-func-seek!) - ) + (loop + (ja-no-eval :group! eichar-duck-stance-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-duck-walk (target) - :event - target-standard-event-handler - :enter - (behavior () - (set! (-> self control unknown-float81) (-> (new 'static 'array float 1 1.0) 0)) - (target-collide-set! 'duck (-> (new 'static 'array float 1 1.0) 0)) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 69) - ) - ) + :event target-standard-event-handler + :enter (behavior () + (set! (-> self control unknown-float81) 1.0) + (target-collide-set! 'duck (the-as float 1.0)) + (if (not (ja-group? eichar-duck-roll-ja)) (set! (-> self control unknown-surface00) *duck-mods*) ) (none) ) - :exit - (-> target-duck-stance exit) - :trans - (behavior () + :exit (-> target-duck-stance exit) + :trans (behavior () ((-> self state-hook)) - (if (and (or (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) - (logtest? (-> self state-flags) 8192) - (and (logtest? (-> self water flags) 1024) + (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) + ) + (logtest? (-> self state-flags) (state-flags prevent-duck)) + (and (logtest? (-> self water flags) (water-flags wt10)) (>= (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) ) ) @@ -2131,72 +1352,39 @@ (slide-down-test) (none) ) - :code - (behavior () + :code (behavior () (cond - ((and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 32) - ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) + ((and (ja-group? eichar-duck-walk-ja) (= (-> self skel root-channel 0) (-> self skel channel))) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 31) - ) - (ja-channel-push! 1 135) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 32)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + ((ja-group? eichar-duck-stance-ja) + (ja-channel-push! 1 (seconds 0.45)) + (ja :group! eichar-duck-walk-ja :num! min) ) (else - (ja-channel-push! 1 30) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 32)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! eichar-duck-walk-ja :num! min) ) ) - (while #t + (loop (if (= (-> self skel root-channel 0) (-> self skel channel)) (set! (-> self control unknown-surface00) *duck-mods*) ) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) - (fmin - (-> (new 'static 'array float 1 1.0) 0) - (/ (-> self control unknown-float01) - (* 60.0 (/ (-> *TARGET-bank* duck-walk-cycle-dist) (-> *TARGET-bank* run-cycle-length))) - ) - ) - ) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! (fmin 1.0 (/ (-> self control unknown-float01) + (* 60.0 (/ (-> *TARGET-bank* duck-walk-cycle-dist) (-> *TARGET-bank* run-cycle-length))) + ) + ) + ) + ) (suspend) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-jump (target) - :event - target-jump-event-handler - :enter - (behavior ((arg0 float) (arg1 float) (arg2 surface)) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 surface)) (when (= (-> self control unknown-symbol40) 'launch) (level-hint-spawn (game-text-id daxter-screaming-jump) @@ -2240,9 +1428,9 @@ ) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 716 0 0 1 #t) + (sound-play "jump" :vol 70) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! arg2 (cond (arg2 (empty) @@ -2255,38 +1443,22 @@ ) (set! (-> self control unknown-surface00) arg2) (set! (-> self control unknown-float123) - (fmax - 0.0 - (fmin - (-> (new 'static 'array float 1 1.0) 0) - (* 0.00004359654 (+ -11468.8 (-> self control unknown-float01))) - ) - ) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float01))))) ) (set! (-> self control unknown-float122) - (fmax 0.0 (fmin - (-> (new 'static 'array float 1 1.0) 0) - (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))) - ) - ) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) ) (none) ) - :exit - target-exit - :trans - (behavior () + :exit target-exit + :trans (behavior () (set! (-> self control unknown-float123) (fmax (-> self control unknown-float123) (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) ) ) - (target-falling-trans #f (the-as time-frame (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) + (target-falling-trans #f (the-as time-frame (if (ja-group? eichar-jump-loop-ja) 15 -1 ) @@ -2295,8 +1467,8 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 12288.0) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (zero? (logand (-> self water flags) 512)) - (zero? (logand (-> self state-flags) 2048)) + (zero? (logand (-> self water flags) (water-flags wt09))) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) ) ) (go target-double-jump (-> *TARGET-bank* double-jump-height-min) (-> *TARGET-bank* double-jump-height-max)) @@ -2307,8 +1479,9 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) + (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -2316,7 +1489,7 @@ (the-as float 65502.96) (the-as float -163840.0) (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (-> (new 'static 'array float 1 0.0) 0) + 0.0 68812.8 ) ) @@ -2324,56 +1497,20 @@ ) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) (slide-down-test) - (set! (-> self control unknown-float122) - (seek - (-> self control unknown-float122) - (fmax 0.0 (fmin - (-> (new 'static 'array float 1 1.0) 0) - (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))) - ) - ) - (-> *display* seconds-per-frame) - ) - ) + (seek! + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) (none) ) - :code - (behavior ((arg0 float) (arg1 float) (arg2 surface)) - (ja-channel-push! 2 15) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 34)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-3 (-> self skel root-channel 1))) - (set! (-> a0-3 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 40))) - (set! (-> a0-3 param 0) 0.0) - (joint-control-channel-group-eval! - a0-3 - (the-as art-joint-anim (-> self draw art-group data 40)) - num-func-chan - ) - ) + :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) + (ja-channel-push! 2 (seconds 0.05)) + (ja :group! eichar-jump-ja :num! min) + (ja :chan 1 :group! eichar-jump-forward-ja :num! (chan 0) :frame-interp (-> self control unknown-float122)) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) - (set! (-> a0-4 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-+!) - ) - (let ((a0-5 (-> self skel root-channel 1))) - (set! (-> a0-5 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 40))) - (set! (-> a0-5 param 0) 0.0) - (joint-control-channel-group-eval! - a0-5 - (the-as art-joint-anim (-> self draw art-group data 40)) - num-func-chan - ) - ) + (ja :group! eichar-jump-ja :num! (+!)) + (ja :chan 1 :group! eichar-jump-forward-ja :num! (chan 0) :frame-interp (-> self control unknown-float122)) (suspend) (until (ja-done? 0) (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -2382,94 +1519,57 @@ ) (set! (-> gp-1 param 0) (the float (+ (-> gp-1 frame-group data 0 length) -1))) (let ((v1-45 (and (< 0.0 f30-0) (< 0.0 f0-8)))) - (set! (-> gp-1 param 1) (if v1-45 - (fmin - (fmin (-> (new 'static 'array float 1 3.0) 0) f0-8) - (/ (* 5.0 f0-8) (the float (time-to-apex f30-0 (the-as float -245760.0)))) - ) - (-> (new 'static 'array float 1 1.0) 0) - ) + (set! (-> gp-1 param 1) + (the-as + float + (if v1-45 + (fmin (fmin 3.0 f0-8) (/ (* 5.0 f0-8) (the float (time-to-apex f30-0 (the-as float -245760.0))))) + 1.0 + ) + ) ) ) (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) ) - (let ((a0-10 (-> self skel root-channel 1))) - (set! (-> a0-10 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-10 param 0) 0.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) (suspend) ) - (target-falling-anim -1 60) + (target-falling-anim -1 (seconds 0.2)) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-jump-forward (target) - :event - target-jump-event-handler - :enter - (behavior ((arg0 float) (arg1 float)) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float)) ((-> target-jump enter) arg0 arg1 (the-as surface #f)) (set! (-> self control unknown-surface00) *forward-jump-mods*) (none) ) - :exit - target-exit - :trans - (-> target-jump trans) - :code - (behavior ((arg0 float) (arg1 float)) + :exit target-exit + :trans (-> target-jump trans) + :code (behavior ((arg0 float) (arg1 float)) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) (ja-aframe (-> (new 'static 'array float 1 3.0) 0) 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-seek!) - ) + (ja-no-eval :group! eichar-jump-ja :num! (seek!) :frame-num (ja-aframe (the-as float 3.0) 0)) (until (ja-done? 0) (set! (-> self control unknown-dword70) 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-6 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-loop!) - ) - (while #t + (ja-no-eval :group! eichar-jump-loop-ja :num! (loop!) :frame-num 0.0) + (loop (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-7 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! - a0-7 - (the-as art-joint-anim (-> self draw art-group data 38)) - num-func-loop! - ) - ) + (ja :group! eichar-jump-loop-ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-double-jump (target) - :event - target-jump-event-handler - :enter - (behavior ((arg0 float) (arg1 float)) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float)) (when (= (-> self control unknown-symbol40) 'launch) enter-state (let ((a0-3 (-> self control unknown-dword60)) @@ -2482,19 +1582,13 @@ ) (set! (-> self state-time) (-> *display* base-frame-counter)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *double-jump-mods*) (none) ) - :exit - target-exit - :trans - (behavior () - (target-falling-trans #f (the-as time-frame (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) + :exit target-exit + :trans (behavior () + (target-falling-trans #f (the-as time-frame (if (ja-group? eichar-jump-loop-ja) 15 -1 ) @@ -2506,8 +1600,9 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) + (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -2515,7 +1610,7 @@ (the-as float 33775.48) (the-as float -122880.0) (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (-> (new 'static 'array float 1 0.0) 0) + 0.0 68812.8 ) ) @@ -2524,66 +1619,32 @@ (if (!= (-> self state-time) (-> *display* base-frame-counter)) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) ) - (set! (-> self control unknown-float122) - (seek - (-> self control unknown-float122) - (fmax 0.0 (fmin - (-> (new 'static 'array float 1 1.0) 0) - (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))) - ) - ) - (-> *display* seconds-per-frame) - ) - ) + (seek! + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (ja-channel-push! 2 15) - (dummy-10 (-> self skel effect) 'jump-double (-> (new 'static 'array float 1 -1.0) 0) -1) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) (ja-aframe (the-as float 5.0) 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-seek!) - ) - (let ((a0-5 (-> self skel root-channel 1))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 40))) - (set! (-> a0-5 param 0) 0.0) - (joint-control-channel-group-eval! - a0-5 - (the-as art-joint-anim (-> self draw art-group data 40)) - num-func-chan - ) - ) + :code (behavior ((arg0 float) (arg1 float)) + (ja-channel-push! 2 (seconds 0.05)) + (dummy-10 (-> self skel effect) 'jump-double (the-as float -1.0) -1) + (ja-no-eval :group! eichar-jump-ja :num! (seek!) :frame-num (ja-aframe (the-as float 5.0) 0)) + (ja :chan 1 :group! eichar-jump-forward-ja :num! (chan 0)) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((a0-7 (-> self skel root-channel 1))) - (set! (-> a0-7 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-7 param 0) 0.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (seek!)) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) ) - (target-falling-anim -1 60) + (target-falling-anim -1 (seconds 0.2)) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-high-jump (target) - :event - target-jump-event-handler - :enter - (behavior ((arg0 float) (arg1 float) (arg2 basic)) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 basic)) (when (and (= (-> self control unknown-symbol40) 'launch) (!= arg2 'launch)) enter-state (let ((a0-3 (-> self control unknown-dword60)) @@ -2599,8 +1660,8 @@ (go target-duck-high-jump arg0 arg1 (the-as symbol arg2)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self control status) (logand -8 (-> self control status))) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 457 0 1 #t) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) + (sound-play "jump" :pitch 0.3) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (set! (-> self control unknown-surface00) (cond ((= arg2 'flip) @@ -2619,15 +1680,9 @@ ) (none) ) - :exit - target-exit - :trans - (behavior () - (target-falling-trans #f (the-as time-frame (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) + :exit target-exit + :trans (behavior () + (target-falling-trans #f (the-as time-frame (if (ja-group? eichar-jump-loop-ja) 15 -1 ) @@ -2645,8 +1700,9 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) + (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -2654,107 +1710,85 @@ (the-as float 33775.48) (the-as float -122880.0) (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (-> (new 'static 'array float 1 0.0) 0) + 0.0 68812.8 ) ) ) ) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) - (set! (-> self control unknown-float122) - (seek - (-> self control unknown-float122) - (fmax - 0.0 - (fmin (-> (new 'static 'array float 1 1.0) 0) (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01)))) - ) - (-> *display* seconds-per-frame) - ) - ) + (seek! + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) (none) ) - :code - (-> target-jump code) - :post - (the-as (function none :behavior target) target-post) + :code (-> target-jump code) + :post target-post ) (defstate target-duck-high-jump (target) - :event - target-standard-event-handler - :enter - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + :event target-standard-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *turn-around-mods*) (none) ) - :exit - target-exit - :code - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) - (if (not (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 31) - ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) - ) - (ja-channel-push! 1 12) + :exit target-exit + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (if (not (and (ja-group? eichar-duck-stance-ja) (= (-> self skel root-channel 0) (-> self skel channel)))) + (ja-channel-push! 1 (seconds 0.04)) ) (case arg2 (('launch) - (let ((s3-0 (-> self skel root-channel 0))) - (set! (-> s3-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 42))) - (set! (-> s3-0 param 0) (ja-aframe (the-as float 16.0) 0)) - (set! (-> s3-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> s3-0 frame-num) 0.0) - (joint-control-channel-group! s3-0 (the-as art-joint-anim (-> self draw art-group data 42)) num-func-seek!) - ) + ;; PAL patch here + (set! (-> self control unknown-soundid01) (sound-play "launch-fire")) + (ja-no-eval :group! eichar-launch-jump-ja :num! (seek! (ja-aframe (the-as float 16.0) 0)) :frame-num 0.0) (until (ja-done? 0) - (suspend) - (let ((s3-1 (-> self skel root-channel 0))) - (set! (-> s3-1 param 0) (ja-aframe (the-as float 16.0) 0)) - (set! (-> s3-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! s3-1 (the-as art-joint-anim #f) num-func-seek!) + (let ((s3-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> s3-2 command) (sound-command set-param)) + (set! (-> s3-2 id) (-> self control unknown-soundid01)) + (let ((a1-5 (ear-trans))) + (let ((s2-1 self)) + (when (= a1-5 #t) + (if (and s2-1 (type-type? (-> s2-1 type) process-drawable) (nonzero? (-> s2-1 control))) + (set! a1-5 (-> s2-1 control trans)) + (set! a1-5 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (-> s3-2 parms trans) a1-5) + ) + (set! (-> s3-2 parms mask) (sound-mask trans)) + (-> s3-2 id) ) + (suspend) + (ja :num! (seek! (ja-aframe (the-as float 16.0) 0))) ) ) (else - (let ((s3-2 (-> self skel root-channel 0))) - (set! (-> s3-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> s3-2 param 0) (ja-aframe (the-as float 16.0) 0)) - (set! (-> s3-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> s3-2 frame-num) 0.0) - (joint-control-channel-group! s3-2 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) - ) + (ja-no-eval :group! eichar-duck-high-jump-ja :num! (seek! (ja-aframe (the-as float 16.0) 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((s3-3 (-> self skel root-channel 0))) - (set! (-> s3-3 param 0) (ja-aframe (the-as float 16.0) 0)) - (set! (-> s3-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! s3-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 16.0) 0))) ) ) ) (go target-duck-high-jump-jump arg0 arg1 arg2) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-duck-high-jump-jump (target) - :event - target-jump-event-handler - :enter - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 819 -609 0 1 #t) + (sound-play "jump" :vol 80 :pitch -0.4) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (cond ((= arg2 'launch) (set! (-> self neck flex-blend) 0.0) @@ -2766,28 +1800,46 @@ ) (none) ) - :exit - target-exit - :trans - (-> target-high-jump trans) - :code - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + :exit target-exit + ;; PAL patch here + :trans (behavior () + ((-> target-high-jump trans)) + (case (-> self control unknown-int37) + (('launch) + (let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> gp-0 command) (sound-command set-param)) + (set! (-> gp-0 id) (-> self control unknown-soundid01)) + (let ((a1-0 (ear-trans))) + (let ((s5-0 self)) + (when (= a1-0 #t) + (if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> s5-0 control))) + (set! a1-0 (-> s5-0 control trans)) + (set! a1-0 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (-> gp-0 parms trans) a1-0) + ) + (set! (-> gp-0 parms mask) (sound-mask trans)) + (-> gp-0 id) + ) + ) + ) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((f30-0 (the-as float (if (= arg2 'launch) 110.0 35.0 ) ) ) - (f28-0 (-> (new 'static 'array float 1 1.0) 0)) + (f28-0 1.0) ) (until (ja-done? 0) (let* ((f24-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (f26-0 (- f30-0 (ja-aframe-num 0))) - (f22-1 (fmin - (fmin (-> (new 'static 'array float 1 3.0) 0) f26-0) - (/ (* 5.0 f26-0) (the float (time-to-apex f24-0 (the-as float -245760.0)))) - ) - ) + (f22-1 (fmin (fmin 3.0 f26-0) (/ (* 5.0 f26-0) (the float (time-to-apex f24-0 (the-as float -245760.0)))))) (s5-0 (-> self skel root-channel 0)) ) (set! (-> s5-0 param 0) (the float (+ (-> s5-0 frame-group data 0 length) -1))) @@ -2812,43 +1864,17 @@ ) (cond ((= arg2 'launch) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) - (set! (-> a0-7 param 0) f28-0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 43)) num-func-loop!) - ) - (while #t + (ja-no-eval :group! eichar-launch-jump-loop-ja :num! (loop! f28-0) :frame-num 0.0) + (loop (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) - (set! (-> a0-8 param 0) f28-0) - (joint-control-channel-group-eval! - a0-8 - (the-as art-joint-anim (-> self draw art-group data 43)) - num-func-loop! - ) - ) + (ja :group! eichar-launch-jump-loop-ja :num! (loop! f28-0)) ) ) (else - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-9 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-loop!) - ) - (while #t + (ja-no-eval :group! eichar-jump-loop-ja :num! (loop!) :frame-num 0.0) + (loop (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-10 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! - a0-10 - (the-as art-joint-anim (-> self draw art-group data 38)) - num-func-loop! - ) - ) + (ja :group! eichar-jump-loop-ja :num! (loop!)) ) ) ) @@ -2856,22 +1882,18 @@ (the-as none 0) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-falling (target) - :event - target-jump-event-handler - :enter - (behavior ((arg0 symbol)) + :event target-jump-event-handler + :enter (behavior ((arg0 symbol)) (set! (-> self control unknown-surface00) *jump-mods*) (set! (-> self control unknown-uint20) (the-as uint arg0)) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (target-falling-trans (-> self control unknown-spoolanim00) (the-as time-frame (if (= (-> self control unknown-spoolanim00) #f) @@ -2882,31 +1904,23 @@ ) (none) ) - :code - (behavior ((arg0 symbol)) - (target-falling-anim -1 99) + :code (behavior ((arg0 symbol)) + (target-falling-anim -1 (seconds 0.33)) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-hit-ground (target) - :event - target-walk-event-handler - :enter - (behavior ((arg0 symbol)) + :event target-walk-event-handler + :enter (behavior ((arg0 symbol)) (cond ((= arg0 'stuck) ) - ((let ((v1-4 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-4 (-> self draw art-group data 42)) (= v1-4 (-> self draw art-group data 43))) + ((let ((v1-4 (ja-group))) + (or (= v1-4 eichar-launch-jump-ja) (= v1-4 eichar-launch-jump-loop-ja)) ) - (dummy-10 (-> self skel effect) 'group-blue-hit-ground-effect (-> (new 'static 'array float 1 0.0) 0) -1) + (dummy-10 (-> self skel effect) 'group-blue-hit-ground-effect (the-as float 0.0) -1) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) ) (else @@ -2916,7 +1930,9 @@ ) ) ) - (if (and (< (-> *TARGET-bank* fall-far) f0-1) (zero? (logand (-> self control status) 1024))) + (if (and (< (-> *TARGET-bank* fall-far) f0-1) + (zero? (logand (-> self control status) (cshape-moving-flags on-water))) + ) (go target-hit-ground-hard f0-1) ) ) @@ -2932,7 +1948,7 @@ (set! (-> self control unknown-dword31) 0) (set! (-> self control unknown-dword33) 0) (if (>= (-> self control ground-impact-vel) (-> *TARGET-bank* fall-stumble-threshold)) - (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + (set-forward-vel (the-as float 0.0)) ) (if (!= (-> self control ground-pat material) (pat-material ice)) (delete-back-vel) @@ -2941,19 +1957,18 @@ (start-bobbing! (-> self water) (lerp-scale - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as float 4096.0) (-> self control ground-impact-vel) (the-as float 40960.0) - (-> (new 'static 'array float 1 102400.0) 0) + (the-as float 102400.0) ) 600 1500 ) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) ) @@ -2969,7 +1984,7 @@ (go target-duck-stance) ) (when (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (if (logtest? (-> self water flags) 1024) + (if (logtest? (-> self water flags) (water-flags wt10)) (go target-wade-walk) (go target-walk) ) @@ -2987,21 +2002,17 @@ (slide-down-test) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (target-hit-ground-anim #f) (go target-stance) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-attack (target) - :event - target-dangerous-event-handler - :enter - (behavior () + :event target-dangerous-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (target-start-attack) (target-danger-set! 'spin #f) @@ -3010,27 +2021,20 @@ (set! (-> self neck flex-blend) 0.0) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control unknown-dword33) (-> *display* base-frame-counter)) (target-exit) (none) ) - :code - (behavior () - (ja-channel-push! 1 15) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 51))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 51)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) (-> self control unknown-surface01 align-speed)) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 51)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! eichar-attack-from-stance-ja + :num! (seek! max (-> self control unknown-surface01 align-speed)) + :frame-num 0.0 + ) (until (ja-done? 0) (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (dummy-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 74) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) @@ -3054,22 +2058,16 @@ (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) (-> self control unknown-surface01 align-speed)) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self control unknown-surface01 align-speed))) ) (go target-stance) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-running-attack (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touched) (cond @@ -3129,10 +2127,9 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (if (or (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (< (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 1.5)) ) @@ -3148,12 +2145,11 @@ (target-start-attack) (target-danger-set! 'punch #f) (if (or (< (fabs (-> self control unknown-float62)) 0.3) (< 0.3 (fabs (-> self control unknown-float61)))) - (set! (-> self control unknown-float81) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> self control unknown-float81) 1.0) ) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> *run-attack-mods* turnv) 0.0) @@ -3162,11 +2158,12 @@ (target-exit) (none) ) - :trans - (behavior () + :trans (behavior () (when (!= (-> self state-time) (-> *display* base-frame-counter)) (if (and (or (smack-surface? #t) - (and (>= (-> self control unknown-float63) 0.7) (zero? (logand (-> self control status) 32))) + (and (>= (-> self control unknown-float63) 0.7) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + ) ) (begin (set! (-> self control unknown-int21) (the-as int (-> *display* base-frame-counter))) @@ -3206,14 +2203,13 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (and (< 4096.0 (-> self control unknown-float01)) (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons square) - ) - ) + (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons square) + ) + ) ) - (zero? (logand (-> self state-flags) 6144)) - (zero? (logand (-> self control unknown-surface01 flags) 128)) + (zero? (logand (-> self state-flags) (state-flags prevent-jump prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump))) ) ) (go @@ -3222,7 +2218,7 @@ (-> *TARGET-bank* attack-jump-height-max) ) ) - (if (and (logtest? (-> self water flags) 512) + (if (and (logtest? (-> self water flags) (water-flags wt09)) (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) ) (dummy-13 @@ -3234,7 +2230,7 @@ ) ) (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (dummy-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 23) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) @@ -3249,45 +2245,32 @@ ) (none) ) - :code - (behavior () - (if (logtest? (-> self water flags) 512) - (sound-play-by-name (static-sound-name "swim-stroke") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (if (logtest? (-> self water flags) (water-flags wt09)) + (sound-play "swim-stroke") ) - (ja-channel-push! 1 6) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 59)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! eichar-attack-punch-ja :num! min) (set! (-> self control dynam gravity-max) 368640.0) (set! (-> self control dynam gravity-length) 368640.0) (let ((f28-0 0.0) - (f30-0 (-> (new 'static 'array float 1 1.0) 0)) + (f30-0 1.0) (gp-2 0) ) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (when (not (ja-min? 0)) (cond ((and (>= (ja-aframe-num 0) 20.0) - (and (and (zero? (logand (-> self control status) 1)) + (and (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-39 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (not - (or (= v1-39 (-> self draw art-group data 59)) - (= v1-39 (-> self draw art-group data 60)) - (= v1-39 (-> self draw art-group data 61)) - ) - ) + (let ((v1-39 (ja-group))) + (or (not (or (= v1-39 eichar-attack-punch-ja) + (= v1-39 eichar-attack-punch-end-ja) + (= v1-39 eichar-attack-punch-alt-end-ja) + ) + ) (< 4096.0 (target-height-above-ground)) ) ) @@ -3304,7 +2287,7 @@ (the-as uint 12) ) ) - (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + (set-forward-vel (the-as float 0.0)) ) ((and (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons square) @@ -3334,31 +2317,23 @@ (vector-matrix*! (-> self control unknown-vector120) s5-1 (-> self control unknown-matrix01)) ) (suspend) - (let ((a0-44 (-> self skel root-channel 0))) - (set! (-> a0-44 param 0) (the float (+ (-> a0-44 frame-group data 0 length) -1))) - (set! (-> a0-44 param 1) (-> self control unknown-surface01 align-speed)) - (joint-control-channel-group-eval! a0-44 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self control unknown-surface01 align-speed))) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (set! (-> *run-attack-mods* turnvv) 0.0) ) (if (< 2 gp-2) - (set! f30-0 (* f30-0 (fmin (-> (new 'static 'array float 1 1.0) 0) (-> self control unknown-float140)))) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float140)))) ) (+! gp-2 1) ) ) - (if (and (zero? (logand (-> self control status) 1)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-121 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (not (or (= v1-121 (-> self draw art-group data 59)) - (= v1-121 (-> self draw art-group data 60)) - (= v1-121 (-> self draw art-group data 61)) + (let ((v1-121 (ja-group))) + (or (not (or (= v1-121 eichar-attack-punch-ja) + (= v1-121 eichar-attack-punch-end-ja) + (= v1-121 eichar-attack-punch-alt-end-ja) ) ) (< 4096.0 (target-height-above-ground)) @@ -3370,13 +2345,11 @@ (go target-stance) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-attack-air (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v0-0 (target-bonk-event-handler arg0 arg1 arg2 arg3))) (cond (v0-0 @@ -3389,10 +2362,9 @@ ) ) ) - :enter - (behavior ((arg0 symbol)) + :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (target-start-attack) (target-danger-set! 'spin-air #f) (set! (-> self control unknown-surface00) *jump-attack-mods*) @@ -3420,11 +2392,7 @@ (let* ((f1-5 (/ f0-1 (* (-> self control dynam gravity-length) (-> *display* seconds-per-frame)))) (f30-0 (* 0.5 f1-5 (-> *display* seconds-per-frame) f0-1)) ) - (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 62) - ) + (if (ja-group? eichar-attack-uppercut-ja) (set! f30-0 (fmax 0.0 @@ -3461,26 +2429,29 @@ (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) ((-> target-attack exit)) (none) ) - :trans - (behavior () - (when (logtest? (-> self control status) 1) + :trans (behavior () + (when (logtest? (-> self control status) (cshape-moving-flags onsurf)) (set-quaternion! (-> self control) (-> self control dir-targ)) (go target-hit-ground #f) ) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (set! (-> self control dynam gravity-length) (seek - (-> self control dynam gravity-length) - (-> self control unknown-dynamics00 gravity-length) - (* 245760.0 (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self control dynam gravity-length) + (-> self control unknown-dynamics00 gravity-length) + (* 245760.0 (if (or (= (-> *setting-control* current video-mode) '150fps) + (= (-> *setting-control* current video-mode) '100fps) + ) + 0.016666668 + (-> *display* seconds-per-frame) + ) + ) + ) ) (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) (< (vector-dot (-> self control dynam gravity-normal) (-> self control unknown-vector10)) @@ -3491,7 +2462,7 @@ (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) ) (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (dummy-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 70) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) @@ -3505,74 +2476,36 @@ ) (none) ) - :code - (behavior ((arg0 symbol)) - (ja-channel-push! 1 22) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 56))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 56)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 56)) num-func-seek!) - ) + :code (behavior ((arg0 symbol)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! eichar-attack-from-jump-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 - (-> self align) - 16 - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - ) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 57)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) + (ja :num! (seek!)) ) + (ja :group! eichar-attack-from-jump-loop-ja :num! min) (let ((f30-0 393216.0)) (let ((f0-8 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (while (not - (or (and (< (fabs (/ f0-8 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.7)) - ) - ) + (while (not (or (and (< (fabs (/ f0-8 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.7)) + ) + ) (quaternion-rotate-y! (-> self control unknown-quaternion00) (-> self control unknown-quaternion00) (* f30-0 (-> *display* seconds-per-frame)) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (set! f0-8 (target-height-above-ground)) (set! f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) ) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 58))) - (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 58)) data 0 length) -1)) - ) - (set! (-> a0-13 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> self draw art-group data 58)) num-func-seek!) - ) + (ja-no-eval :group! eichar-attack-from-jump-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (cond ((< (ja-aframe-num 0) 32.0) @@ -3599,73 +2532,49 @@ ) ) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (go target-falling #f) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-attack-uppercut (target) - :event - target-dangerous-event-handler - :enter - (behavior ((arg0 float) (arg1 float)) + :event target-dangerous-event-handler + :enter (behavior ((arg0 float) (arg1 float)) (set! (-> self state-time) (-> *display* base-frame-counter)) (target-start-attack) (target-danger-set! 'uppercut #f) (set! (-> self control unknown-surface00) *turn-around-mods*) (none) ) - :exit - target-exit - :code - (behavior ((arg0 float) (arg1 float)) - (let ((s3-0 (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 31) - ) - ) - (s4-0 (-> self skel root-channel 0)) - ) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 62))) - (set! (-> s4-0 param 0) (ja-aframe (the-as float 7.0) 0)) - (set! (-> s4-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> s4-0 frame-num) (if s3-0 + :exit target-exit + :code (behavior ((arg0 float) (arg1 float)) + (let ((s3-0 (ja-group? eichar-duck-stance-ja))) + (ja-no-eval :group! eichar-attack-uppercut-ja + :num! (seek! (ja-aframe (the-as float 7.0) 0)) + :frame-num (the-as float (if s3-0 (ja-aframe (the-as float 5.0) 0) - (-> (new 'static 'array float 1 0.0) 0) + 0.0 ) - ) - (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> self draw art-group data 62)) num-func-seek!) + ) + ) ) (until (ja-done? 0) (suspend) - (let ((s4-1 (-> self skel root-channel 0))) - (set! (-> s4-1 param 0) (ja-aframe (the-as float 7.0) 0)) - (set! (-> s4-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 7.0) 0))) ) (go target-attack-uppercut-jump arg0 arg1) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-attack-uppercut-jump (target) - :event - target-dangerous-event-handler - :enter - (behavior ((arg0 float) (arg1 float)) + :event target-dangerous-event-handler + :enter (behavior ((arg0 float) (arg1 float)) (if (and (= (-> self control ground-pat material) (pat-material ice)) (< 32768.0 (-> self control unknown-float01)) ) @@ -3673,17 +2582,15 @@ ) (set! (-> self state-time) (-> *display* base-frame-counter)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *uppercut-jump-mods*) (target-start-attack) (target-danger-set! 'uppercut #f) (none) ) - :exit - target-exit - :trans - (behavior () - (if (logtest? (-> self control status) 1) + :exit target-exit + :trans (behavior () + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-hit-ground #f) ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) @@ -3692,8 +2599,9 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) + (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (set-quaternion! (-> self control) (-> self control dir-targ)) @@ -3703,7 +2611,7 @@ (the-as float 65502.96) (the-as float -163840.0) (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (-> (new 'static 'array float 1 0.0) 0) + 0.0 68812.8 ) ) @@ -3711,18 +2619,14 @@ ) (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 62) - ) + (ja-group? eichar-attack-uppercut-ja) (>= (ja-aframe-num 0) 12.0) ) (go target-attack-air 'uppercut) ) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (dummy-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 23) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) @@ -3735,19 +2639,14 @@ (slide-down-test) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (TODO-RENAME-9 (-> self align)) + :code (behavior ((arg0 float) (arg1 float)) + (compute-alignment! (-> self align)) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 0.9) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) - (TODO-RENAME-9 (-> self align)) + (ja :num! (seek! max 0.9)) + (compute-alignment! (-> self align)) (let* ((gp-0 (-> self align)) - (s5-0 (method-of-object gp-0 TODO-RENAME-10)) + (s5-0 (method-of-object gp-0 align!)) (a1-2 (cond ((>= 30.0 (ja-aframe-num 0)) 18 @@ -3762,25 +2661,17 @@ ) ) ) - (s5-0 - gp-0 - a1-2 - (-> (new 'static 'array float 1 1.0) 0) - (the-as float 0.95) - (-> (new 'static 'array float 1 1.0) 0) - ) + (s5-0 gp-0 (the-as align-opts a1-2) (the-as float 1.0) (the-as float 0.95) (the-as float 1.0)) ) ) (go target-falling #f) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-flop (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v0-0 (target-bonk-event-handler arg0 arg1 arg2 arg3))) (cond (v0-0 @@ -3792,7 +2683,7 @@ ) (cond ((< 6144.0 (target-height-above-ground)) - (dummy-10 (-> self skel effect) 'swim-flop (-> (new 'static 'array float 1 -1.0) 0) -1) + (dummy-10 (-> self skel effect) 'swim-flop (the-as float -1.0) -1) (let ((t9-3 enter-state)) (set! (-> self next-state) target-swim-down) ((the-as (function object :behavior target) t9-3)) @@ -3814,10 +2705,9 @@ ) ) ) - :enter - (behavior ((arg0 float) (arg1 float) (arg2 float)) + :enter (behavior ((arg0 float) (arg1 float) (arg2 float)) (if (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (go target-yellow-jump-blast) ) @@ -3826,7 +2716,7 @@ (set-forward-vel (-> self control unknown-float01)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flop-mods*) (set! (-> self control unknown-uint20) (the-as uint 0)) (set! (-> self control dynam gravity-max) 245760.0) @@ -3849,30 +2739,27 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (target-danger-set! 'harmless #f) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) (none) ) - :trans - (behavior () + :trans (behavior () (delete-back-vel) - (let ((gp-1 (logtest? (-> self control status) 1))) - (when (and (not gp-1) (let ((v1-6 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-6 (-> self draw art-group data 64)) (= v1-6 (-> self draw art-group data 66))) + (let ((gp-1 (logtest? (-> self control status) (cshape-moving-flags onsurf)))) + (when (and (not gp-1) (let ((v1-6 (ja-group))) + (or (= v1-6 eichar-flop-down-loop-ja) (= v1-6 eichar-moving-flop-down-ja)) ) ) - (when (and (or (< (target-move-dist (seconds 0.1)) 1638.4) - (and (logtest? (-> self control status) 8) (< 0.7 (-> self control poly-angle))) - ) - (zero? (logand (-> self control status) 32)) + ;; changed for high fps. This fixes the invisible wall when flopping + (when (and (or (< (target-move-dist (the time-frame (* (-> *display* time-adjust-ratio) (seconds 0.1)))) + (* (-> *display* time-adjust-ratio) 1638.4) + ) + (and (logtest? (-> self control status) (cshape-moving-flags twall)) (< 0.7 (-> self control poly-angle))) + ) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) (>= (-> self control unknown-uint20) (the-as uint 2)) ) (set! (-> self control unknown-dword36) (-> *display* base-frame-counter)) @@ -3880,22 +2767,13 @@ ) ) (when gp-1 - (logior! (-> self control status) 1) + (logior! (-> self control status) (cshape-moving-flags onsurf)) (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) (dummy-10 (-> self skel effect) 'group-red-eco-strike-ground (ja-frame-num 0) 0) - (let* ((s4-1 (get-process *default-dead-pool* touch-tracker #x4000)) - (s5-1 (when s4-1 - (let ((t9-6 (method-of-type touch-tracker activate))) - (t9-6 (the-as touch-tracker s4-1) self 'touch-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 touch-tracker-init (-> self control trans) 4096.0 30) - (-> s4-1 ppointer) - ) - ) - ) + (let ((s5-1 (process-spawn touch-tracker :init touch-tracker-init (-> self control trans) 4096.0 30 :to self))) (send-event (ppointer->process s5-1) 'event 'attack 'flop) (send-event (ppointer->process s5-1) @@ -3903,9 +2781,15 @@ (lambda ((arg0 target)) (let ((f0-3 (seek (-> arg0 control root-prim local-sphere w) (the-as float 28672.0) - (* 286720.0 (-> *display* seconds-per-frame)) + (* 286720.0 0 (if (or (= (-> *setting-control* current video-mode) '150fps) + (= (-> *setting-control* current video-mode) '100fps) + ) + 0.016666668 + (-> *display* seconds-per-frame) + ) + ) ) - ) + ) ) (set! (-> arg0 control root-prim local-sphere w) f0-3) f0-3 @@ -3918,7 +2802,7 @@ ) ) (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (dummy-10 (-> self skel effect) @@ -3931,82 +2815,34 @@ ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) ) - (when (and (not (-> self control unknown-symbol30)) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 63) - ) - (>= (ja-aframe-num 0) 8.0) - ) + (when (and (not (-> self control unknown-symbol30)) (ja-group? eichar-flop-down-ja) (>= (ja-aframe-num 0) 8.0)) (target-start-attack) (target-danger-set! 'flop #f) ) (none) ) - :code - (behavior ((arg0 float) (arg1 float) (arg2 float)) + :code (behavior ((arg0 float) (arg1 float) (arg2 float)) (ja-channel-set! 2) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 63))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 63)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 63)) num-func-seek!) - ) - (let ((a0-3 (-> self skel root-channel 1))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 66))) - (set! (-> a0-3 param 0) 0.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group-eval! - a0-3 - (the-as art-joint-anim (-> self draw art-group data 66)) - num-func-chan - ) - ) + (ja-no-eval :group! eichar-flop-down-ja :num! (seek!) :frame-num 0.0) + (ja :chan 1 :group! eichar-moving-flop-down-ja :num! (chan 0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((gp-0 (-> self skel root-channel 1))) - (set! (-> gp-0 frame-interp) (lerp-scale - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (-> self control unknown-float01) - (-> (new 'static 'array float 1 0.0) 0) - (the-as float 40960.0) - ) - ) - (set! (-> gp-0 param 0) (the float (+ (-> gp-0 frame-group data 0 length) -1))) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) + (ja :chan 1 :num! (seek!) :frame-interp (lerp-scale + (the-as float 0.0) + (the-as float 1.0) + (-> self control unknown-float01) + (the-as float 0.0) + (the-as float 40960.0) + ) + ) ) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) (target-danger-set! 'flop-down #f) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 64)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) - (let ((gp-2 (-> self skel root-channel 1))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 67)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) - (let ((f30-0 (-> (new 'static 'array float 1 1.0) 0))) + (ja :group! eichar-flop-down-loop-ja :num! min) + (ja :chan 1 :group! eichar-moving-flop-down-loop-ja :num! min) + (let ((f30-0 1.0)) (let ((gp-3 (new-stack-vector0))) (let ((f0-18 (vector-dot (-> self control dynam gravity-normal) (-> self control unknown-vector120)))) 0.0 @@ -4044,25 +2880,18 @@ ) ) (suspend) - (while #t + (loop (+! (-> self control unknown-uint20) 1) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-+!) - ) - (let ((gp-5 (-> self skel root-channel 1))) - (set! (-> gp-5 frame-interp) (lerp-scale - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (-> self control unknown-float01) - (-> (new 'static 'array float 1 0.0) 0) - (the-as float 40960.0) - ) - ) - (set! (-> gp-5 param 0) 0.0) - (joint-control-channel-group-eval! gp-5 (the-as art-joint-anim #f) num-func-chan) - ) - (set! f30-0 (* f30-0 (fmin (-> (new 'static 'array float 1 1.0) 0) (-> self control unknown-float140)))) + (ja :num! (+!)) + (ja :chan 1 :num! (chan 0) :frame-interp (lerp-scale + (the-as float 0.0) + (the-as float 1.0) + (-> self control unknown-float01) + (the-as float 0.0) + (the-as float 40960.0) + ) + ) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float140)))) (let ((gp-6 (new-stack-vector0)) (f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) @@ -4092,13 +2921,11 @@ ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-flop-hit-ground (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('swim) #f @@ -4108,8 +2935,7 @@ ) ) ) - :enter - (behavior ((arg0 symbol)) + :enter (behavior ((arg0 symbol)) (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector111) (-> self control trans)) @@ -4124,23 +2950,21 @@ (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-uint20) (the-as uint arg0)) - (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + (set-forward-vel (the-as float 0.0)) (set! (-> self control unknown-surface00) *flop-land-mods*) - (set! (-> *flop-land-mods* flags) (logand -1025 (-> *flop-land-mods* flags))) - (set! (-> self state-flags) (logior #x100000 (-> self state-flags))) + (logclear! (-> *flop-land-mods* flags) (surface-flags allow-edge-grab)) + (set! (-> self state-flags) (logior (state-flags flop-hit-ground) (-> self state-flags))) (none) ) - :exit - target-exit - :trans - (behavior () + :exit target-exit + :trans (behavior () (when (!= (-> self control unknown-spoolanim00) 'stuck) (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) (go target-attack-air 'flop) ) ) (when (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) ) @@ -4155,40 +2979,32 @@ ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) ) - (let ((v1-33 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (if (and (or (= v1-33 (-> self draw art-group data 65)) (= v1-33 (-> self draw art-group data 68))) + (let ((v1-33 (ja-group))) + (if (and (or (= v1-33 eichar-flop-down-land-ja) (= v1-33 eichar-moving-flop-down-land-ja)) (>= (ja-aframe-num 0) 28.0) ) - (logior! (-> *flop-land-mods* flags) 1024) + (logior! (-> *flop-land-mods* flags) (surface-flags allow-edge-grab)) ) ) (slide-down-test) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (target-hit-ground-anim arg0) (go target-falling #f) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-wheel (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (= arg2 'touched) (send-event arg0 'roll) ) (target-standard-event-handler arg0 arg1 arg2 arg3) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *wheel-mods*) (+! (-> self control unknown-int50) 1) @@ -4198,15 +3014,14 @@ ) ) (if (or (< (fabs (-> self control unknown-float62)) 0.3) (< 0.3 (fabs (-> self control unknown-float61)))) - (set! (-> self control unknown-float81) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> self control unknown-float81) 1.0) ) (set! (-> self control unknown-uint20) (the-as uint 0)) (set! (-> self control unknown-int21) 0) 0 (none) ) - :exit - (behavior () + :exit (behavior () (when (!= (-> self next-state name) 'target-wheel) (set! (-> self control unknown-int50) 0) (set! (-> self control unknown-dword30) (-> *display* base-frame-counter)) @@ -4214,22 +3029,14 @@ (target-exit) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 0)) 0 (let ((s5-0 0) - (f30-0 (-> (new 'static 'array float 1 1.0) 0)) + (f30-0 1.0) ) - (ja-channel-push! 1 12) - (let ((s4-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-0 - (the-as art-joint-anim (-> self draw art-group data 69)) - num-func-identity - ) - (set! (-> s4-0 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! eichar-duck-roll-ja :num! min) (until (ja-done? 0) (if (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (set! gp-0 (the-as int (-> *display* base-frame-counter))) @@ -4255,18 +3062,12 @@ (if (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (-> *display* base-frame-counter) ) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (cond ((nonzero? s5-0) ) (else - (TODO-RENAME-10 - (-> self align) - 4 - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - f30-0 - ) + (align! (-> self align) (align-opts adjust-xz-vel) (the-as float 1.0) (the-as float 1.0) f30-0) (let ((s4-1 (new-stack-vector0))) (vector-matrix*! s4-1 (-> self control transv) (-> self control unknown-matrix00)) (set! (-> s4-1 y) 0.0) @@ -4275,12 +3076,8 @@ ) ) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) - (set! f30-0 (* f30-0 (fmin (-> (new 'static 'array float 1 1.0) 0) (-> self control unknown-float140)))) + (ja :num! (seek!)) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float140)))) ) ) (if (and (or (< (- (-> *display* base-frame-counter) (the-as time-frame gp-0)) (-> *TARGET-bank* wheel-jump-pre-window)) @@ -4319,22 +3116,17 @@ (go target-duck-stance) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-wheel-flip (target) - :event - target-standard-event-handler - :enter - (behavior ((arg0 float) (arg1 float)) + :event target-standard-event-handler + :enter (behavior ((arg0 float) (arg1 float)) (set! (-> self control unknown-surface00) *wheel-flip-mods*) (none) ) - :exit - target-exit - :trans - (behavior () + :exit target-exit + :trans (behavior () (if (and (or (smack-surface? #f) (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) ) @@ -4349,50 +3141,38 @@ ) (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?) - (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) + (and (ja-group? eichar-jump-loop-ja) (= (-> self skel root-channel 0) (-> self skel channel))) ) (go target-attack-air #f) ) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (ja-channel-push! 1 12) - (let ((s4-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-0 - (the-as art-joint-anim (-> self draw art-group data 71)) - num-func-identity - ) - (set! (-> s4-0 frame-num) 0.0) - ) - (let ((f30-0 (-> (new 'static 'array float 1 1.0) 0))) - (until (or (ja-max? 0) (and (>= (ja-aframe-num 0) 4.0) (logtest? (-> self control status) 1))) - (when (and (>= (ja-aframe-num 0) (-> (new 'static 'array float 1 3.0) 0)) (not (-> self control unknown-symbol30))) + :code (behavior ((arg0 float) (arg1 float)) + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! eichar-wheel-flip-ja :num! min) + (let ((f30-0 1.0)) + (until (or (ja-max? 0) + (and (>= (ja-aframe-num 0) 4.0) (logtest? (-> self control status) (cshape-moving-flags onsurf))) + ) + (when (and (>= (ja-aframe-num 0) 3.0) (not (-> self control unknown-symbol30))) (set! (-> self event-hook) target-dangerous-event-handler) (target-start-attack) (target-danger-set! 'flip #f) ) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (if (not (ja-max? 0)) - (TODO-RENAME-10 + (align! (-> self align) - 6 - (-> (new 'static 'array float 1 1.0) 0) + (align-opts adjust-y-vel adjust-xz-vel) + (the-as float 1.0) (/ arg0 (-> *TARGET-bank* wheel-flip-art-height)) (* f30-0 (/ arg1 (-> *TARGET-bank* wheel-flip-art-dist))) ) - (TODO-RENAME-10 + (align! (-> self align) - 4 - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (align-opts adjust-xz-vel) + (the-as float 1.0) + (the-as float 1.0) (* f30-0 (/ arg1 (-> *TARGET-bank* wheel-flip-art-dist))) ) ) @@ -4402,32 +3182,16 @@ (vector-matrix*! (-> self control unknown-vector120) s4-1 (-> self control unknown-matrix01)) ) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) - (set! f30-0 (* f30-0 (fmin (-> (new 'static 'array float 1 1.0) 0) (-> self control unknown-float140)))) + (ja :num! (seek!)) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float140)))) ) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while (zero? (logand (-> self control status) 1)) + (while (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.01)) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) - ) - (ja-channel-push! 1 30) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 38)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (when (not (ja-group? eichar-jump-loop-ja)) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! eichar-jump-loop-ja :num! min) ) ) (let ((gp-2 (new-stack-vector0)) @@ -4447,24 +3211,10 @@ ) ) (suspend) - (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-35 (the-as art-joint-anim #f) num-func-loop!) - ) - ) - (else - (let ((v1-85 (-> self skel root-channel 0))) - (set! (-> v1-85 num-func) num-func-identity) - (set! (-> v1-85 frame-num) (the float (+ (-> v1-85 frame-group data 0 length) -1))) - ) + (if (ja-group? eichar-jump-loop-ja) + (ja :num! (loop!)) + (ja :num-func num-func-identity :frame-num max) ) - ) ) (target-land-effect) (set! (-> self state-hook-time) (-> *display* base-frame-counter)) @@ -4492,18 +3242,13 @@ (none) ) ) - (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) + (if (ja-group? eichar-jump-loop-ja) (go target-hit-ground #f) (go target-stance) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) diff --git a/goal_src/engine/target/target2.gc b/goal_src/engine/target/target2.gc index 3bd2d72a56..23fc4175f8 100644 --- a/goal_src/engine/target/target2.gc +++ b/goal_src/engine/target/target2.gc @@ -12,8 +12,7 @@ ;; DECOMP BEGINS (defstate target-load-wait (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('loading) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -24,91 +23,47 @@ ) ) ) - :exit - target-exit - :code - (behavior () + :exit target-exit + :code (behavior () (set! (-> self control unknown-surface00) *walk-no-turn-mods*) (set! (-> self state-time) (-> *display* base-frame-counter)) (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) - (ja-channel-push! 1 30) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 112))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 112)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 112)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! eichar-trip-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) - (send-event *camera* 'joystick (-> (new 'static 'array int32 1 0) 0) (-> (new 'static 'array int32 1 0) 0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-xz-vel) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (send-event *camera* 'joystick 0.0 0.0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-0 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.3)) (suspend) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 param 0) (ja-aframe (the-as float 19.0) 0)) - (set! (-> s5-0 param 1) 0.05) - (joint-control-channel-group-eval! s5-0 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 19.0) 0) 0.05)) (suspend) ) ) - (ja-channel-push! 1 90) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 36))) - (set! (-> gp-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 36)) data 0 length) -1)) - ) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) (ja-aframe (the-as float 40.0) 0)) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 36)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! eichar-painful-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 40.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 37))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 37)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 37)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! eichar-painful-land-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (go target-stance) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) (defstate target-stance-ambient (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('movie) (go target-stance) @@ -118,8 +73,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self neck flex-blend) 0.0) ((-> target-stance enter)) (let ((v1-2 (rand-vu-int-count 4))) @@ -149,28 +103,19 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-0 (-> self control unknown-spoolanim00))) (when a0-0 (ja-abort-spooled-anim a0-0 (the-as art-joint-anim #f) -1) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! eichar-stance-loop-ja :num! min) ) ) ((-> target-stance exit)) (target-exit) (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* (-> self control unknown-spoolanim00 name) 0 self (the-as float -99.0)) (if (or (cpad-hold? (-> self control unknown-cpad-info00 number) start l1 r1 triangle circle x square) *progress-process* @@ -179,37 +124,26 @@ ) (none) ) - :code - (behavior () + :code (behavior () (while (let ((v1-13 (file-status *art-control* (-> self control unknown-spoolanim00 name) 0))) (not (or (= v1-13 'locked) (= v1-13 'active))) ) (suspend) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((a0-1 (-> self skel root-channel 1))) - (set! (-> a0-1 param 0) 0.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-2 (-> self skel root-channel 2))) - (set! (-> a0-2 param 0) 0.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (loop!)) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) ) (ja-play-spooled-anim (-> self control unknown-spoolanim00) - (the-as art-joint-anim (-> self draw art-group data 5)) - (the-as art-joint-anim (-> self draw art-group data 5)) + (the-as art-joint-anim eichar-stance-loop-ja) + (the-as art-joint-anim eichar-stance-loop-ja) (the-as (function process-drawable symbol) (lambda () (!= (-> *cpad-list* cpads 0 stick0-speed) 0.0))) ) (set! (-> self control unknown-uint20) (the-as uint #f)) (go target-stance) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (deftype first-person-hud (process) @@ -290,7 +224,7 @@ ) (case (get-aspect-ratio) (('aspect4x3) - (set! (-> self sides-x-scale) 3.5) + (set! (-> self sides-x-scale) (if (= (-> *pc-settings* aspect-custom-x) 16) 5.0 3.5)) (set! (-> self sides-y-scale) 13.0) (set! (-> self x-offset) 0) 0 @@ -343,28 +277,25 @@ ) (defstate hud-waiting (first-person-hud) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('go-away) (go hud-going-out) ) ) ) - :enter - (behavior () + :enter (behavior () (disable-hud (the-as int (-> *hud-parts* power))) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (dotimes (gp-0 (-> self nb-of-particles)) (if (= (-> self particles gp-0 part matrix) -1) (set! (-> self particles gp-0 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set-setting! *setting-control* self 'common-page 'set (the-as float (-> (new 'static 'array int32 1 0) 0)) 1) + (set-setting! 'common-page 'set 0.0 1) (suspend) (go hud-coming-in) (suspend) @@ -374,14 +305,10 @@ ) (defstate hud-coming-in (first-person-hud) - :event - (-> hud-waiting event) - :code - (behavior () - (while #t - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 0 (the int (* 350.0 (-> *display* time-adjust-ratio)))) - ) + :event (-> hud-waiting event) + :code (behavior () + (loop + (seekl! (-> self in-out-position) 0 (the int (* 350.0 (-> *display* time-adjust-ratio)))) (if (zero? (-> self in-out-position)) (go hud-normal) ) @@ -389,29 +316,22 @@ ) (none) ) - :post - (behavior () + :post (behavior () (dumb-15 self) (none) ) ) (defstate hud-normal (first-person-hud) - :event - (-> hud-waiting event) - :code - (behavior () - (while #t + :event (-> hud-waiting event) + :code (behavior () + (loop (if (or (not *progress-process*) (= (-> *progress-process* 0 next-state name) 'progress-going-out) (= (-> *progress-process* 0 next-state name) 'progress-gone) ) - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 0 (the int (* 150.0 (-> *display* time-adjust-ratio)))) - ) - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 4096 (the int (* 200.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self in-out-position) 0 (the int (* 150.0 (-> *display* time-adjust-ratio)))) + (seekl! (-> self in-out-position) 4096 (the int (* 200.0 (-> *display* time-adjust-ratio)))) ) (suspend) ) @@ -420,12 +340,9 @@ ) (defstate hud-going-out (first-person-hud) - :code - (behavior () - (while #t - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 4096 (the int (* 350.0 (-> *display* time-adjust-ratio)))) - ) + :code (behavior () + (loop + (seekl! (-> self in-out-position) 4096 (the int (* 350.0 (-> *display* time-adjust-ratio)))) (if (= (-> self in-out-position) 4096) (deactivate self) ) @@ -433,8 +350,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (dumb-15 self) (none) ) @@ -508,22 +424,17 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. (defstate target-stance-look-around (target) - :event - target-standard-event-handler - :enter - (-> target-stance enter) - :exit - (-> target-stance exit) - :trans - (-> target-stance trans) - :code - (behavior () + :event target-standard-event-handler + :enter (-> target-stance enter) + :exit (-> target-stance exit) + :trans (-> target-stance trans) + :code (behavior () (while (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'dist-from-interp-src) (and (< (send-event-function *camera* a1-0) 4915.2) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (the-as time-frame 21)) + (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.07)) (zero? (ja-group-size)) ) ) @@ -536,13 +447,11 @@ ((the-as (function none :behavior target) (-> target-stance code))) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-look-around (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) (-> self state name) @@ -560,11 +469,10 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self cam-user-mode) 'look-around) (set! (-> self control unknown-surface00) *duck-mods*) - (logior! (-> self state-flags) 512) + (logior! (-> self state-flags) (state-flags first-person-mode)) (send-event *camera* 'blend-from-as-fixed) (send-event *camera* 'no-intro) (camera-change-to (the-as string 'cam-eye) 60 #f) @@ -573,23 +481,12 @@ (deactivate a0-5) ) ) - (let ((gp-0 (get-process *default-dead-pool* first-person-hud #x4000))) - (set! (-> self fp-hud) - (ppointer->handle - (when gp-0 - (let ((t9-5 (method-of-type first-person-hud activate))) - (t9-5 (the-as first-person-hud gp-0) *dproc* 'first-person-hud (&+ *fp-hud-stack* #x3800)) - ) - (run-now-in-process gp-0 first-person-hud-init-by-other) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self fp-hud) + (ppointer->handle (process-spawn first-person-hud :to *dproc* :stack (&+ *fp-hud-stack* #x3800))) + ) (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self fp-hud)))) (if a0-1 (send-event a0-1 'go-away) @@ -597,22 +494,15 @@ ) (set! (-> self cam-user-mode) 'normal) (target-exit) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 1) - (set! (-> a1-2 message) 'query-state) - (set! (-> a1-2 param 0) (the-as uint cam-eye)) - (when (send-event-function *camera* a1-2) - (send-event *camera* 'no-intro) - (send-event *camera* 'force-blend 60) - (send-event *camera* 'clear-entity) - (camera-change-to (the-as string 'base) 60 #f) - ) + (when (send-event *camera* 'query-state cam-eye) + (send-event *camera* 'no-intro) + (send-event *camera* 'force-blend (seconds 0.2)) + (send-event *camera* 'clear-entity) + (camera-change-to (the-as string 'base) 60 #f) ) (none) ) - :trans - (behavior () + :trans (behavior () (local-vars (sv-48 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -698,15 +588,9 @@ (none) ) ) - :code - (behavior () - (while (let ((f30-0 8192.0) - (a1-0 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 0) - (set! (-> a1-0 message) 'dist-from-interp-dest) - (< f30-0 (send-event-function *camera* a1-0)) + :code (behavior () + (while (let ((f30-0 8192.0)) + (< f30-0 (send-event *camera* 'dist-from-interp-dest)) ) (if (!= (-> self cam-user-mode) 'look-around) (go target-stance) @@ -715,7 +599,7 @@ ) (ja-channel-set! 0) (set! (-> self control transv quad) (the-as uint128 0)) - (while #t + (loop (if (!= (-> self cam-user-mode) 'look-around) (go target-stance-look-around) ) @@ -723,13 +607,11 @@ ) (none) ) - :post - target-no-move-post + :post target-no-move-post ) (defstate target-billy-game (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) (-> self state name) @@ -744,11 +626,10 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self neck flex-blend) 0.0) (set! (-> self control unknown-surface00) *duck-mods*) - (logior! (-> self state-flags) 512) + (logior! (-> self state-flags) (state-flags first-person-mode)) (send-event *camera* 'blend-from-as-fixed) (send-event *camera* 'clear-entity) (send-event *camera* 'no-intro) @@ -758,44 +639,26 @@ (deactivate a0-6) ) ) - (let ((gp-0 (get-process *default-dead-pool* first-person-hud #x4000))) - (set! (-> self fp-hud) - (ppointer->handle - (when gp-0 - (let ((t9-6 (method-of-type first-person-hud activate))) - (t9-6 (the-as first-person-hud gp-0) *dproc* 'first-person-hud (&+ *fp-hud-stack* #x3800)) - ) - (run-now-in-process gp-0 first-person-hud-init-by-other) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self fp-hud) + (ppointer->handle (process-spawn first-person-hud :to *dproc* :stack (&+ *fp-hud-stack* #x3800))) + ) (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self fp-hud)))) (if a0-1 (send-event a0-1 'go-away) ) ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 1) - (set! (-> a1-2 message) 'query-state) - (set! (-> a1-2 param 0) (the-as uint cam-billy)) - (when (send-event-function *camera* a1-2) - (send-event *camera* 'no-intro) - (send-event *camera* 'force-blend 0) - (camera-change-to (the-as string 'base) 0 #f) - ) + (when (send-event *camera* 'query-state cam-billy) + (send-event *camera* 'no-intro) + (send-event *camera* 'force-blend 0) + (camera-change-to (the-as string 'base) 0 #f) ) (target-exit) (none) ) - :trans - (behavior () + :trans (behavior () (local-vars (sv-48 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -870,20 +733,17 @@ (none) ) ) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (set! (-> self control transv quad) (the-as uint128 0)) (anim-loop) (none) ) - :post - target-no-move-post + :post target-no-move-post ) (defstate target-grab (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) (-> self state name) @@ -920,39 +780,32 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self control unknown-surface00) *grab-mods*) (set! (-> self neck flex-blend) 0.0) - (logior! (-> self state-flags) 272) + (logior! (-> self state-flags) (state-flags invulnerable grabbed)) (set! (-> self control unknown-uint20) (the-as uint 'stance)) (none) ) - :exit - (behavior () - (set! (-> self state-flags) (logand -17 (-> self state-flags))) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags invulnerable)) (target-exit) (none) ) - :code - (behavior () - (set-forward-vel (the-as float (-> (new 'static 'array int32 1 0) 0))) + :code (behavior () + (set-forward-vel (the-as float 0.0)) (let ((gp-0 0)) - (while (zero? (logand (-> self control status) 1)) + (while (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (target-falling-anim-trans) (+! gp-0 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) (suspend) ) - (if (or (> gp-0 0) (let ((v1-11 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-11 (-> self draw art-group data 34)) - (= v1-11 (-> self draw art-group data 38)) - (= v1-11 (-> self draw art-group data 42)) - (= v1-11 (-> self draw art-group data 43)) - (= v1-11 (-> self draw art-group data 41)) + (if (or (> gp-0 0) (let ((v1-11 (ja-group))) + (or (= v1-11 eichar-jump-ja) + (= v1-11 eichar-jump-loop-ja) + (= v1-11 eichar-launch-jump-ja) + (= v1-11 eichar-launch-jump-loop-ja) + (= v1-11 eichar-duck-high-jump-ja) ) ) ) @@ -960,142 +813,69 @@ ) ) (-> self control unknown-spoolanim00) - (while #t + (loop (let ((gp-1 (-> self control unknown-spoolanim00))) (case gp-1 (('stance) (cond - ((or (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) - (< 0.5 (-> self skel root-channel 6 frame-interp)) - ) - (let ((v1-32 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-32 (-> self draw art-group data 28)) - (= v1-32 (-> self draw art-group data 29)) - (= v1-32 (-> self draw art-group data 54)) - (= v1-32 (-> self draw art-group data 55)) + ((or (and (ja-group? eichar-walk-ja) (< 0.5 (-> self skel root-channel 6 frame-interp))) + (let ((v1-32 (ja-group))) + (or (= v1-32 eichar-run-squash-ja) + (= v1-32 eichar-run-squash-weak-ja) + (= v1-32 eichar-attack-from-stance-run-end-ja) + (= v1-32 eichar-attack-from-stance-run-alt-end-ja) ) ) ) - (ja-channel-push! 1 45) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-39 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-39 param 1) 1.0) - (set! (-> a0-39 frame-num) 0.0) - (joint-control-channel-group! a0-39 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! eichar-run-to-stance-loop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) (the float (+ (-> a0-40 frame-group data 0 length) -1))) - (set! (-> a0-40 param 1) 1.0) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-42 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-42 param 1) 1.0) - (set! (-> a0-42 frame-num) 0.0) - (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! eichar-run-to-stance-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) (the float (+ (-> a0-43 frame-group data 0 length) -1))) - (set! (-> a0-43 param 1) 1.0) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) ) - ((let ((v1-87 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (and (or (= v1-87 (-> self draw art-group data 39)) (= v1-87 (-> self draw art-group data 35))) - (not (ja-max? 0)) - ) - ) - (let ((a0-54 (-> self skel root-channel 0))) - (set! (-> a0-54 param 0) (the float (+ (-> a0-54 frame-group data 0 length) -1))) - (set! (-> a0-54 param 1) 1.0) - (joint-control-channel-group! a0-54 (the-as art-joint-anim #f) num-func-seek!) + ((let ((v1-87 (ja-group))) + (and (or (= v1-87 eichar-jump-short-land-ja) (= v1-87 eichar-jump-land-ja)) (not (ja-max? 0))) ) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) ) - ((not (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (= (ja-group-size) 1) - ) - ) - (ja-channel-push! 1 22) + ((not (and (ja-group? eichar-stance-loop-ja) (= (ja-group-size) 1))) + (ja-channel-push! 1 (seconds 0.075)) ) ) - (while #t - (let ((a0-63 (-> self skel root-channel 0))) - (set! (-> a0-63 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-63 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-63 param 1) 1.0) - (set! (-> a0-63 frame-num) 0.0) - (joint-control-channel-group! a0-63 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (loop + (ja-no-eval :group! eichar-stance-loop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94) ) (suspend) - (let ((a0-64 (-> self skel root-channel 0))) - (set! (-> a0-64 param 0) (the float (+ (-> a0-64 frame-group data 0 length) -1))) - (set! (-> a0-64 param 1) 1.0) - (joint-control-channel-group-eval! a0-64 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (('shock-in) - (ja-channel-push! 1 60) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 88))) - (set! (-> s5-0 param 0) (ja-aframe (the-as float 18.0) 0)) - (set! (-> s5-0 param 1) 1.0) - (set! (-> s5-0 frame-num) 0.0) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 88)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! eichar-shocked-ja :num! (seek! (ja-aframe (the-as float 18.0) 0)) :frame-num 0.0) (until (ja-done? 0) (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94) ) (suspend) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 param 0) (ja-aframe (the-as float 18.0) 0)) - (set! (-> s5-1 param 1) 1.0) - (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 18.0) 0))) ) - (while #t + (loop (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94) ) @@ -1103,33 +883,16 @@ ) ) (('shock-out) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 88) - ) - ) - (ja-channel-push! 1 60) + (if (not (ja-group? eichar-shocked-ja)) + (ja-channel-push! 1 (seconds 0.2)) ) - (let ((s5-2 (-> self skel root-channel 0))) - (set! (-> s5-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 88))) - (set! (-> s5-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 88)) data 0 length) -1)) - ) - (set! (-> s5-2 param 1) 1.0) - (set! (-> s5-2 frame-num) (ja-aframe (the-as float 18.0) 0)) - (joint-control-channel-group! s5-2 (the-as art-joint-anim (-> self draw art-group data 88)) num-func-seek!) - ) + (ja-no-eval :group! eichar-shocked-ja :num! (seek!) :frame-num (ja-aframe (the-as float 18.0) 0)) (until (ja-done? 0) (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94) ) (suspend) - (let ((a0-82 (-> self skel root-channel 0))) - (set! (-> a0-82 param 0) (the float (+ (-> a0-82 frame-group data 0 length) -1))) - (set! (-> a0-82 param 1) 1.0) - (joint-control-channel-group-eval! a0-82 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self control unknown-uint20) (the-as uint 'stance)) ) @@ -1139,9 +902,8 @@ ) (none) ) - :post - (behavior () - (if (logtest? (-> self control status) 1) + :post (behavior () + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (set! (-> self control transv quad) (the-as uint128 0)) ) (target-no-stick-post) @@ -1150,35 +912,31 @@ ) (defstate target-pole-cycle (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (= arg2 'query) (= (-> arg3 param 0) 'mode)) (-> self state name) (target-standard-event-handler arg0 arg1 arg2 arg3) ) ) - :enter - (behavior ((arg0 handle)) + :enter (behavior ((arg0 handle)) (set! (-> self control unknown-handle10) arg0) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *pole-mods*) (logior! (-> self control root-prim prim-core action) (collide-action ca-8)) - (target-collide-set! 'pole (the-as float (-> (new 'static 'array int32 1 0) 0))) + (target-collide-set! 'pole (the-as float 0.0)) (set! (-> self control unknown-vector102 quad) (-> self control transv quad)) (set! (-> self control transv quad) (the-as uint128 0)) (send-event *camera* 'ease-in) (set! (-> self control unknown-int21) (the-as int #f)) (none) ) - :exit - (behavior () - (target-collide-set! 'normal (the-as float (-> (new 'static 'array int32 1 0) 0))) + :exit (behavior () + (target-collide-set! 'normal (the-as float 0.0)) (logclear! (-> self control root-prim prim-core action) (collide-action ca-8)) (set! (-> self control unknown-handle10) (the-as handle #f)) (none) ) - :trans - (behavior () + :trans (behavior () (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) ) @@ -1186,7 +944,7 @@ ) (pad-buttons x) ) - (zero? (logand (-> self state-flags) 2048)) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) ) (set! (-> self control transv quad) (the-as uint128 0)) @@ -1209,7 +967,7 @@ ) ) ) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (go target-falling 'target-pole-cycle) ) ((>= (ja-aframe-num 0) 14.0) @@ -1224,8 +982,7 @@ ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (target-compute-pole) (set! (-> self control unknown-uint20) (the-as uint (vector-dot @@ -1235,243 +992,143 @@ ) ) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 83) - ) + ((ja-group? (-> self draw art-group data 83)) (while (not (-> self control unknown-int21)) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (suspend) ) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 num-func) num-func-identity) - (set! (-> gp-1 frame-num) (ja-aframe (the-as float 37.0) 0)) - ) + (ja :num-func num-func-identity :frame-num (ja-aframe (the-as float 37.0) 0)) ) (else (while (not (-> self control unknown-int21)) (suspend) ) (suspend) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) ) ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 80))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 80)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 80)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 80) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (set! (-> self anim-seed) (the-as uint (if (rand-vu-percent? (the-as float 0.1)) 0 1 ) ) ) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 80))) - (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 80)) data 0 length) -1)) - ) - (set! (-> a0-13 param 1) 1.0) - (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> self draw art-group data 80)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 80) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - target-no-move-post + :post target-no-move-post ) (defstate target-pole-flip-up (target) - :event - target-standard-event-handler - :exit - (-> target-pole-cycle exit) - :code - (behavior ((arg0 object) (arg1 object) (arg2 float)) - (let ((s3-0 (-> self skel root-channel 0))) - (set! (-> s3-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 81))) - (set! (-> s3-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 81)) data 0 length) -1)) - ) - (set! (-> s3-0 param 1) 1.0) - (set! (-> s3-0 frame-num) (ja-aframe (+ 1.0 (fmin 17.0 (ja-aframe-num 0))) 0)) - (joint-control-channel-group! s3-0 (the-as art-joint-anim (-> self draw art-group data 81)) num-func-seek!) - ) + :event target-standard-event-handler + :exit (-> target-pole-cycle exit) + :code (behavior ((arg0 object) (arg1 object) (arg2 float)) + (ja-no-eval :group! (-> self draw art-group data 81) + :num! (seek!) + :frame-num (ja-aframe (+ 1.0 (fmin 17.0 (ja-aframe-num 0))) 0) + ) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set-forward-vel arg2) (go target-pole-flip-up-jump (the-as float arg0) (the-as float arg1)) (none) ) - :post - target-no-move-post + :post target-no-move-post ) (defstate target-pole-flip-up-jump (target) - :event - target-standard-event-handler - :enter - (-> target-jump-forward enter) - :exit - target-exit - :trans - (behavior () + :event target-standard-event-handler + :enter (-> target-jump-forward enter) + :exit target-exit + :trans (behavior () ((-> target-jump-forward trans)) (vector-flatten! (-> self control transv) (-> self control transv) (-> self control unknown-vector100)) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 0 0 1 #t) + :code (behavior ((arg0 float) (arg1 float)) + (sound-play "jump") (send-event *camera* 'damp-up) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 83)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 83) :num! min) (let ((f0-1 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) (while (not (and (< (fabs (/ f0-1 (* 0.0033333334 f1-1))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (set! f0-1 (target-height-above-ground)) (set! f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) ) - (ja-channel-push! 1 75) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-9 param 0) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-loop!) - ) - (while #t + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! eichar-jump-loop-ja :num! (loop!) :frame-num 0.0) + (loop (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-10 param 0) 1.0) - (joint-control-channel-group-eval! - a0-10 - (the-as art-joint-anim (-> self draw art-group data 38)) - num-func-loop! - ) - ) + (ja :group! eichar-jump-loop-ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-pole-flip-forward (target) - :event - target-standard-event-handler - :exit - (-> target-pole-cycle exit) - :code - (behavior ((arg0 float) (arg1 float) (arg2 float)) - (let ((s3-0 (-> self skel root-channel 0))) - (set! (-> s3-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 82))) - (set! (-> s3-0 param 0) (ja-aframe (the-as float 16.0) 0)) - (set! (-> s3-0 param 1) 1.0) - (set! (-> s3-0 frame-num) (ja-aframe (+ 1.0 (ja-aframe-num 0)) 0)) - (joint-control-channel-group! s3-0 (the-as art-joint-anim (-> self draw art-group data 82)) num-func-seek!) - ) + :event target-standard-event-handler + :exit (-> target-pole-cycle exit) + :code (behavior ((arg0 float) (arg1 float) (arg2 float)) + (ja-no-eval :group! (-> self draw art-group data 82) + :num! (seek! (ja-aframe (the-as float 16.0) 0)) + :frame-num (ja-aframe (+ 1.0 (ja-aframe-num 0)) 0) + ) (until (ja-done? 0) (suspend) - (let ((s3-1 (-> self skel root-channel 0))) - (set! (-> s3-1 param 0) (ja-aframe (the-as float 16.0) 0)) - (set! (-> s3-1 param 1) 1.0) - (joint-control-channel-group-eval! s3-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 16.0) 0))) ) (set-forward-vel arg2) (go target-pole-flip-forward-jump arg0 arg1) (none) ) - :post - target-no-move-post + :post target-no-move-post ) (defstate target-pole-flip-forward-jump (target) - :event - target-standard-event-handler - :enter - (behavior ((arg0 float) (arg1 float)) + :event target-standard-event-handler + :enter (behavior ((arg0 float) (arg1 float)) ((-> target-jump enter) arg0 arg1 (the-as surface #f)) (set! (-> self control unknown-surface00) *forward-pole-jump-mods*) (none) ) - :exit - target-exit - :trans - (behavior () + :exit target-exit + :trans (behavior () ((-> target-jump-forward trans)) (vector-flatten! (-> self control transv) (-> self control transv) (-> self control unknown-vector100)) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 0 0 1 #t) + :code (behavior ((arg0 float) (arg1 float)) + (sound-play "jump") (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ((the-as (function none :behavior target) (-> target-pole-flip-up-jump code))) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-edge-grab (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('end-mode) (go target-falling 'target-edge-grab) @@ -1481,8 +1138,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *edge-grab-mods*) (set! (-> self control unknown-dword41) (-> *display* base-frame-counter)) @@ -1492,16 +1148,14 @@ (send-event *camera* 'ease-in) (none) ) - :exit - (behavior () + :exit (behavior () (when (logtest? (-> self control root-prim prim-core action) (collide-action ca-7)) (logclear! (-> self control root-prim prim-core action) (collide-action ca-3 ca-7)) (send-event *camera* 'damp-up) ) (none) ) - :trans - (behavior () + :trans (behavior () (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) @@ -1510,7 +1164,7 @@ ) (pad-buttons x) ) - (zero? (logand (-> self state-flags) 2048)) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) ) (cond ((or (< -0.2 (local-pad-angle)) @@ -1521,7 +1175,7 @@ (set! (-> a1-2 num-spheres) (the-as uint 6)) (set! (-> a1-2 collide-with) (-> self control root-prim collide-with)) (set! (-> a1-2 proc) #f) - (set! (-> a1-2 ignore-pat) (the-as uint 1)) + (set! (-> a1-2 ignore-pat) (new 'static 'pat-surface :noentity #x1)) (set! (-> a1-2 solid-only) #t) (when (not (fill-and-probe-using-spheres *collide-cache* a1-2)) (remove-exit) @@ -1541,8 +1195,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (target-compute-edge) (set! (-> self control unknown-uint20) (the-as uint (vector-dot @@ -1552,112 +1205,49 @@ ) ) (while (< 0.0 (-> self control unknown-float110)) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) - ) - (ja-channel-push! 1 45) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 38)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (when (not (ja-group? eichar-jump-loop-ja)) + (ja-channel-push! 1 (seconds 0.15)) + (ja :group! eichar-jump-loop-ja :num! min) ) (suspend) ) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) (cond ((< (the-as float (-> self control unknown-uint20)) -0.3) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 48)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) + (ja :group! eichar-edge-grab-swing-right-ja :num! min) ) ((< 0.3 (the-as float (-> self control unknown-uint20))) - (let ((gp-3 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-3 - (the-as art-joint-anim (-> self draw art-group data 47)) - num-func-identity - ) - (set! (-> gp-3 frame-num) 0.0) - ) + (ja :group! eichar-edge-grab-swing-left-ja :num! min) ) (else - (let ((gp-4 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-4 - (the-as art-joint-anim (-> self draw art-group data 46)) - num-func-identity - ) - (set! (-> gp-4 frame-num) 0.0) - ) + (ja :group! eichar-falling-to-edge-grab-ja :num! min) ) ) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (ja-channel-set! 1) - (while #t - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 44))) - (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 44)) data 0 length) -1)) - ) - (set! (-> a0-14 param 1) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!) - ) + (loop + (ja-no-eval :group! eichar-edge-grab-stance0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) 1.0) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (+! (-> self anim-seed) 1) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 45))) - (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 45)) data 0 length) -1)) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 45)) num-func-seek!) - ) + (ja-no-eval :group! eichar-edge-grab-stance1-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - target-no-move-post + :post target-no-move-post ) (defstate target-edge-grab-jump (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('end-mode) (go target-falling 'target-edge-grab) @@ -1667,37 +1257,23 @@ ) ) ) - :exit - (-> target-edge-grab exit) - :code - (behavior ((arg0 float) (arg1 float)) + :exit (-> target-edge-grab exit) + :code (behavior ((arg0 float) (arg1 float)) (ja-channel-set! 1) (set-quaternion! (-> self control) (-> self control dir-targ)) (logclear! (-> self control root-prim prim-core action) (collide-action ca-3 ca-7)) (set! (-> self control transv quad) (the-as uint128 0)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 49))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 49)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 49)) num-func-seek!) - ) + (ja-no-eval :group! eichar-edge-grab-to-jump-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (target-compute-edge-rider) - (TODO-RENAME-9 (-> self align)) - (when (zero? (logand (-> self align flags) 1)) + (compute-alignment! (-> self align)) + (when (zero? (logand (-> self align flags) (align-flags disabled))) (vector-matrix*! s4-0 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (move-by-vector! (-> self control) s4-0) ) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (set! (-> self control transv quad) (the-as uint128 0)) @@ -1707,47 +1283,33 @@ (go target-jump-forward arg0 arg1) (none) ) - :post - target-no-move-post + :post target-no-move-post ) (defstate target-edge-grab-off (target) - :event - target-standard-event-handler - :exit - (-> target-edge-grab exit) - :code - (behavior () + :event target-standard-event-handler + :exit (-> target-edge-grab exit) + :code (behavior () (ja-channel-set! 1) (set-quaternion! (-> self control) (-> self control dir-targ)) (send-event *camera* 'damp-up) (let ((gp-0 (new 'stack-no-clear 'vector))) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 50))) - (set! (-> s5-0 param 0) (ja-aframe (the-as float 191.0) 0)) - (set! (-> s5-0 param 1) 1.0) - (set! (-> s5-0 frame-num) 0.0) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 50)) num-func-seek!) - ) + (ja-no-eval :group! eichar-edge-grab-off-ja :num! (seek! (ja-aframe (the-as float 191.0) 0)) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (when (zero? (logand (-> self align flags) 1)) + (compute-alignment! (-> self align)) + (when (zero? (logand (-> self align flags) (align-flags disabled))) (vector-matrix*! gp-0 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (move-by-vector! (-> self control) gp-0) ) (suspend) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 param 0) (ja-aframe (the-as float 191.0) 0)) - (set! (-> s5-1 param 1) 1.0) - (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 191.0) 0))) ) ) (set! (-> self control transv quad) (the-as uint128 0)) (logclear! (-> self control root-prim prim-core action) (collide-action ca-3 ca-7)) (vector-float*! (-> self control transv) (-> self control unknown-vector101) -40960.0) (when (and (< (- (-> *display* base-frame-counter) (-> self control rider-time)) (seconds 0.2)) - (or (logtest? (-> self control unknown-surface01 flags) #x4000) + (or (logtest? (-> self control unknown-surface01 flags) (surface-flags moving-ground)) (= (-> self control poly-pat material) (pat-material rotate)) ) ) @@ -1757,15 +1319,12 @@ (go target-falling 'target-edge-grab) (none) ) - :post - target-no-move-post + :post target-no-move-post ) (defstate target-yellow-blast (target) - :event - (-> target-running-attack event) - :enter - (behavior () + :event (-> target-running-attack event) + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *run-attack-mods*) (set! (-> *run-attack-mods* turnv) 655360.0) @@ -1795,18 +1354,16 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> *run-attack-mods* turnv) 0.0) (set! (-> *run-attack-mods* turnvv) 0.0) (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) (target-exit) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (the-as handle #f))) - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) (level-hint-spawn (game-text-id daxter-you-can-shoot-with-yellow-eco) "sksp0145" @@ -1825,23 +1382,16 @@ ) ) ) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 84))) - (set! (-> s5-0 param 0) (ja-aframe (the-as float 9.0) 0)) - (set! (-> s5-0 param 1) 1.0) - (set! (-> s5-0 frame-num) 0.0) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 84)) num-func-seek!) - ) + (ja-no-eval :group! eichar-yellow-running-blast-ja + :num! (seek! (ja-aframe (the-as float 9.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (set! (-> *run-attack-mods* turnvv) 0.0) ) (suspend) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 param 0) (ja-aframe (the-as float 9.0) 0)) - (set! (-> s5-1 param 1) 1.0) - (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 9.0) 0))) ) (let ((s5-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)))) (set! (-> s5-2 y) 0.0) @@ -1875,15 +1425,7 @@ (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) ) ) - (let ((s5-3 (-> self skel root-channel 0))) - (set! (-> s5-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 84))) - (set! (-> s5-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 84)) data 0 length) -1)) - ) - (set! (-> s5-3 param 1) 1.0) - (set! (-> s5-3 frame-num) (ja-aframe (the-as float 9.0) 0)) - (joint-control-channel-group! s5-3 (the-as art-joint-anim (-> self draw art-group data 84)) num-func-seek!) - ) + (ja-no-eval :group! eichar-yellow-running-blast-ja :num! (seek!) :frame-num (ja-aframe (the-as float 9.0) 0)) (until (ja-done? 0) (if (or (< (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) (the-as uint 30) @@ -1893,21 +1435,16 @@ (send-event (handle->process gp-0) 'die) ) (suspend) - (let ((a0-32 (-> self skel root-channel 0))) - (set! (-> a0-32 param 0) (the float (+ (-> a0-32 frame-group data 0 length) -1))) - (set! (-> a0-32 param 1) 1.0) - (joint-control-channel-group-eval! a0-32 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (if (logtest? (-> self control status) 1) + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-stance) (go target-falling #f) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (define *yellow-jump-mods* (new 'static 'surface @@ -1930,15 +1467,13 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x800 + :flags (surface-flags jump) ) ) (defstate target-yellow-jump-blast (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () (set! (-> self control unknown-surface00) *yellow-jump-mods*) (let ((gp-0 (new-stack-vector0))) (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) @@ -1958,30 +1493,21 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (rot->dir-targ! (-> self control)) (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) (target-exit) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 86))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 15.0) 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 86)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! eichar-yellow-jumping-blast-ja + :num! (seek! (ja-aframe (the-as float 15.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 15.0) 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 15.0) 0))) ) (suspend) (let ((gp-2 (new-stack-vector0))) @@ -2000,34 +1526,23 @@ ) ) ) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((gp-3 (get-process *default-dead-pool* projectile-yellow #x4000))) - (when gp-3 - (let ((t9-9 (method-of-type projectile-yellow activate))) - (t9-9 (the-as projectile-yellow gp-3) self 'projectile-yellow (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-3 - projectile-init-by-other - (-> self entity) - (-> self control unknown-vector90) - (vector-float*! - (new 'stack-no-clear 'vector) - (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) - (the-as float (-> *TARGET-bank* yellow-projectile-speed)) - ) - (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) - 16 - 0 - ) - #f - ) - (-> gp-3 ppointer) + (ja :num! (seek!)) + (process-spawn + projectile-yellow + :init projectile-init-by-other + (-> self entity) + (-> self control unknown-vector90) + (vector-float*! + (new 'stack-no-clear 'vector) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) + (the-as float (-> *TARGET-bank* yellow-projectile-speed)) ) + (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + 16 + 0 + ) + #f + :to self ) (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) (let ((gp-4 (-> *display* base-frame-counter))) @@ -2035,74 +1550,51 @@ (suspend) ) ) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 86))) - (set! (-> gp-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 86)) data 0 length) -1)) - ) - (set! (-> gp-5 param 1) 1.0) - (set! (-> gp-5 frame-num) (ja-frame-num 0)) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 86)) num-func-seek!) - ) + (ja-no-eval :group! eichar-yellow-jumping-blast-ja :num! (seek!) :frame-num (ja-frame-num 0)) (until (ja-done? 0) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) (the float (+ (-> a0-22 frame-group data 0 length) -1))) - (set! (-> a0-22 param 1) 1.0) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (if (logtest? (-> self control status) 1) + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-stance) (go target-falling #f) ) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) (defstate target-eco-powerup (target) - :event - target-standard-event-handler - :exit - target-exit - :trans - (behavior () + :event target-standard-event-handler + :exit target-exit + :trans (behavior () (slide-down-test) (none) ) - :code - (behavior ((arg0 object) (arg1 float)) + :code (behavior ((arg0 object) (arg1 float)) (set! (-> self neck flex-blend) 0.0) (set! (-> self state-time) (-> *display* base-frame-counter)) (if (= arg1 (-> *FACT-bank* eco-full-inc)) (set! (-> self control unknown-surface00) *double-jump-mods*) (set! (-> self control unknown-surface00) *walk-mods*) ) - (ja-channel-push! 1 15) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 87))) - (set! (-> s5-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 87)) data 0 length) -1)) - ) - (set! (-> s5-0 param 1) (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) - 2.0 - 3.0 - ) - ) - ) - (set! (-> s5-0 frame-num) (ja-aframe - (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) - (-> (new 'static 'array int32 1 0) 0) - 6.0 - ) - ) - 0 - ) - ) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 87)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! eichar-powerup-ja + :num! (seek! max (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) + 2.0 + 3.0 + ) + ) + ) + :frame-num (ja-aframe + (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) + 0.0 + 6.0 + ) + ) + 0 + ) + ) (until (ja-done? 0) (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) @@ -2111,8 +1603,8 @@ ) (pad-buttons x) ) - (zero? (logand (-> self water flags) 512)) - (zero? (logand (-> self state-flags) 2048)) + (zero? (logand (-> self water flags) (water-flags wt09))) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) @@ -2127,10 +1619,10 @@ (go target-running-attack) ) ) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 + (compute-alignment! (-> self align)) + (align! (-> self align) - 2 + (align-opts adjust-y-vel) (the-as float 1.0) (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) 2.0 @@ -2140,36 +1632,29 @@ (the-as float 1.0) ) (suspend) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 param 0) (the float (+ (-> a0-30 frame-group data 0 length) -1))) - (set! (-> a0-30 param 1) (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) - 2.0 - 3.0 - ) - ) - ) - (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) + 2.0 + 3.0 + ) + ) + ) + ) ) (go target-falling 'target-eco-powerup) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-wade-stance (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *wade-mods*) (set-zero! (-> self water bob)) (none) ) - :exit - (behavior () + :exit (behavior () (target-state-hook-exit) (target-exit) (let ((v1-1 (-> self skel effect))) @@ -2178,13 +1663,12 @@ 0 (none) ) - :trans - (behavior () + :trans (behavior () ((-> self state-hook)) - (when (and (zero? (logand (-> self water flags) 1024)) + (when (and (zero? (logand (-> self water flags) (water-flags wt10))) (>= (- (-> *display* base-frame-counter) (-> self water wade-time)) (seconds 0.05)) ) - (if (logtest? (-> self water flags) 2048) + (if (logtest? (-> self water flags) (water-flags wt11)) (go target-swim-stance) (go target-stance) ) @@ -2207,7 +1691,7 @@ (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) - (sound-play-by-name (static-sound-name "swim-stroke") (new-sound-id) 1024 0 0 1 #t) + (sound-play "swim-stroke") (dummy-13 (-> self water) (the-as float 1.4) (-> self control trans) 0 (-> self control transv)) (go target-attack) ) @@ -2216,26 +1700,20 @@ ) (none) ) - :code - (-> target-stance code) - :post - (the-as (function none :behavior target) target-post) + :code (-> target-stance code) + :post target-post ) (defstate target-wade-walk (target) - :event - target-standard-event-handler - :enter - (-> target-wade-stance enter) - :exit - (-> target-wade-stance exit) - :trans - (behavior () + :event target-standard-event-handler + :enter (-> target-wade-stance enter) + :exit (-> target-wade-stance exit) + :trans (behavior () ((-> self state-hook)) - (when (and (zero? (logand (-> self water flags) 1024)) + (when (and (zero? (logand (-> self water flags) (water-flags wt10))) (>= (- (-> *display* base-frame-counter) (-> self water wade-time)) (seconds 0.1)) ) - (if (logtest? (-> self water flags) 2048) + (if (logtest? (-> self water flags) (water-flags wt11)) (go target-swim-stance) (go target-stance) ) @@ -2258,7 +1736,7 @@ (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) - (sound-play-by-name (static-sound-name "swim-stroke") (new-sound-id) 1024 0 0 1 #t) + (sound-play "swim-stroke") (dummy-13 (-> self water) (the-as float 1.4) (-> self control trans) 0 (-> self control transv)) (go target-attack) ) @@ -2267,97 +1745,58 @@ ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 105) (f30-0 0.0) ) - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-2 (ja-group))) (cond - ((or (= v1-2 (-> self draw art-group data 23)) (= v1-2 (-> self draw art-group data 18))) + ((or (= v1-2 eichar-walk-ja) (= v1-2 eichar-run-ja)) (set! gp-0 15) (set! f30-0 (ja-frame-num 0)) ) - ((let ((v1-9 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-9 (-> self draw art-group data 34)) (= v1-9 (-> self draw art-group data 38))) + ((let ((v1-9 (ja-group))) + (or (= v1-9 eichar-jump-ja) (= v1-9 eichar-jump-loop-ja)) ) (set! gp-0 30) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 92) - ) + ((ja-group? eichar-swim-walk-ja) (set! gp-0 120) ) ) ) (cond - ((and (= (ja-group-size) 6) (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 89) - ) - ) + ((and (= (ja-group-size) 6) (ja-group? eichar-wade-shallow-walk-ja)) ) (else - (ja-channel-push! 6 gp-0) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 dist) (-> *TARGET-bank* wade-shallow-walk-cycle-dist)) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 89)) - num-func-identity + (ja-channel-push! 6 (the-as time-frame gp-0)) + (ja :group! eichar-wade-shallow-walk-ja + :num! (identity f30-0) + :dist (-> *TARGET-bank* wade-shallow-walk-cycle-dist) ) - (set! (-> gp-1 frame-num) f30-0) - ) - (let ((gp-2 (-> self skel root-channel 1))) - (set! (-> gp-2 dist) (-> *TARGET-bank* wade-deep-walk-cycle-dist)) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 90)) - num-func-identity + (ja :chan 1 + :group! eichar-wade-deep-walk-ja + :num! (identity f30-0) + :dist (-> *TARGET-bank* wade-deep-walk-cycle-dist) ) - (set! (-> gp-2 frame-num) f30-0) - ) - (let ((gp-3 (-> self skel root-channel 2))) - (set! (-> gp-3 frame-interp) 0.0) - (set! (-> gp-3 dist) (-> *TARGET-bank* walk-cycle-dist)) - (joint-control-channel-group-eval! - gp-3 - (the-as art-joint-anim (-> self draw art-group data 23)) - num-func-identity + (ja :chan 2 + :group! eichar-walk-ja + :num! (identity f30-0) + :frame-interp 0.0 + :dist (-> *TARGET-bank* walk-cycle-dist) ) - (set! (-> gp-3 frame-num) f30-0) - ) - (let ((gp-4 (-> self skel root-channel 3))) - (set! (-> gp-4 frame-interp) 0.0) - (set! (-> gp-4 dist) (-> *TARGET-bank* walk-down-cycle-dist)) - (joint-control-channel-group-eval! - gp-4 - (the-as art-joint-anim (-> self draw art-group data 25)) - num-func-identity + (ja :chan 3 + :group! eichar-walk-down-ja + :num! (identity f30-0) + :frame-interp 0.0 + :dist (-> *TARGET-bank* walk-down-cycle-dist) ) - (set! (-> gp-4 frame-num) f30-0) - ) - (let ((gp-5 (-> self skel root-channel 4))) - (set! (-> gp-5 frame-interp) 0.0) - (set! (-> gp-5 dist) (-> *TARGET-bank* walk-side-cycle-dist)) - (joint-control-channel-group-eval! - gp-5 - (the-as art-joint-anim (-> self draw art-group data 27)) - num-func-identity + (ja :chan 4 + :group! eichar-walk-left-ja + :num! (identity f30-0) + :frame-interp 0.0 + :dist (-> *TARGET-bank* walk-side-cycle-dist) ) - (set! (-> gp-5 frame-num) f30-0) - ) ) ) ) @@ -2367,7 +1806,7 @@ (f28-0 0.0) (f26-0 (lerp-scale (the-as float 1.0) - (the-as float (-> (new 'static 'array int32 1 0) 0)) + (the-as float 0.0) (-> self control unknown-float01) (the-as float 16384.0) (the-as float 32768.0) @@ -2375,7 +1814,7 @@ ) (gp-6 0) ) - (while #t + (loop (let ((f0-10 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control unknown-float61))))) (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control unknown-float62))))) ) @@ -2386,45 +1825,30 @@ (set! f28-0 (seek f28-0 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-14))))) ) ) - (let ((v1-84 (-> self skel root-channel 3))) - (set! (-> v1-84 dist) (-> *TARGET-bank* walk-down-cycle-dist)) - (set! (-> v1-84 frame-group) (the-as art-joint-anim (-> self draw art-group data 25))) - ) - (cond - ((>= f30-1 0.0) - (let ((v1-87 (-> self skel root-channel 3))) - (set! (-> v1-87 frame-interp) (fabs f30-1)) - (set! (-> v1-87 dist) (-> *TARGET-bank* walk-up-cycle-dist)) - (set! (-> v1-87 frame-group) (the-as art-joint-anim (-> self draw art-group data 24))) - ) - ) - (else - (let ((v1-90 (-> self skel root-channel 3))) - (set! (-> v1-90 frame-interp) (fabs f30-1)) - (set! (-> v1-90 dist) (-> *TARGET-bank* walk-down-cycle-dist)) - (set! (-> v1-90 frame-group) (the-as art-joint-anim (-> self draw art-group data 25))) - ) + (ja :chan 3 :group! eichar-walk-down-ja :dist (-> *TARGET-bank* walk-down-cycle-dist)) + (if (>= f30-1 0.0) + (ja :chan 3 :group! eichar-walk-up-ja :frame-interp (fabs f30-1) :dist (-> *TARGET-bank* walk-up-cycle-dist)) + (ja :chan 3 + :group! eichar-walk-down-ja + :frame-interp (fabs f30-1) + :dist (-> *TARGET-bank* walk-down-cycle-dist) + ) ) - ) - (cond - ((>= f28-0 0.0) - (let ((v1-93 (-> self skel root-channel 4))) - (set! (-> v1-93 frame-interp) (fabs f28-0)) - (set! (-> v1-93 dist) (-> *TARGET-bank* walk-side-cycle-dist)) - (set! (-> v1-93 frame-group) (the-as art-joint-anim (-> self draw art-group data 26))) - ) - ) - (else - (let ((v1-96 (-> self skel root-channel 4))) - (set! (-> v1-96 frame-interp) (fabs f28-0)) - (set! (-> v1-96 dist) (-> *TARGET-bank* walk-side-cycle-dist)) - (set! (-> v1-96 frame-group) (the-as art-joint-anim (-> self draw art-group data 27))) - ) + (if (>= f28-0 0.0) + (ja :chan 4 + :group! eichar-walk-right-ja + :frame-interp (fabs f28-0) + :dist (-> *TARGET-bank* walk-side-cycle-dist) + ) + (ja :chan 4 + :group! eichar-walk-left-ja + :frame-interp (fabs f28-0) + :dist (-> *TARGET-bank* walk-side-cycle-dist) + ) ) - ) (let* ((f0-30 (- (-> self water height) (-> self control trans y))) (f24-1 (lerp-scale - (the-as float (-> (new 'static 'array int32 1 0) 0)) + (the-as float 0.0) (the-as float 1.0) f0-30 (lerp (-> self water wade-height) (-> self water swim-height) (the-as float 0.25)) @@ -2444,7 +1868,7 @@ f26-0 (lerp-scale (the-as float 1.0) - (the-as float (-> (new 'static 'array int32 1 0) 0)) + (the-as float 0.0) (-> self control unknown-float01) (the-as float 16384.0) (the-as float 32768.0) @@ -2453,33 +1877,17 @@ ) ) (set! (-> self skel root-channel 1 frame-interp) f24-1) - (let ((s5-2 (-> self skel root-channel 0))) - (set! (-> s5-2 param 0) (/ (-> self control unknown-float01) - (* 60.0 (/ (dummy-9 (-> self skel)) (-> *TARGET-bank* run-cycle-length))) - ) - ) - (joint-control-channel-group-eval! s5-2 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((s5-3 (-> self skel root-channel 5))) - (set! (-> s5-3 frame-interp) (lerp f26-0 (the-as float (-> (new 'static 'array int32 1 0) 0)) f24-1)) - ) - ) - (let ((a0-66 (-> self skel root-channel 1))) - (set! (-> a0-66 param 0) 0.0) - (joint-control-channel-group-eval! a0-66 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-67 (-> self skel root-channel 2))) - (set! (-> a0-67 param 0) 0.0) - (joint-control-channel-group-eval! a0-67 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-68 (-> self skel root-channel 3))) - (set! (-> a0-68 param 0) 0.0) - (joint-control-channel-group-eval! a0-68 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-69 (-> self skel root-channel 4))) - (set! (-> a0-69 param 0) 0.0) - (joint-control-channel-group-eval! a0-69 (the-as art-joint-anim #f) num-func-chan) + (ja :num! (loop! (/ (-> self control unknown-float01) + (* 60.0 (/ (current-cycle-distance (-> self skel)) (-> *TARGET-bank* run-cycle-length))) + ) + ) + ) + (ja :chan 5 :frame-interp (lerp f26-0 (the-as float 0.0) f24-1)) ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + (ja :chan 3 :num! (chan 0)) + (ja :chan 4 :num! (chan 0)) (when (and (>= (- (-> *display* base-frame-counter) (the-as time-frame gp-6)) (seconds 0.2)) (< (- (-> self water height) (-> self control trans y)) 4096.0) ) @@ -2511,8 +1919,7 @@ ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defbehavior target-swim-tilt target ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) @@ -2522,13 +1929,11 @@ (fmin 1.0 (* arg0 (/ (-> self control unknown-float01) (-> self control unknown-surface01 target-speed)))) ) ) - (set! (-> self control unknown-float130) - (seek - (-> self control unknown-float130) - (fmax (fmin (* (+ f0-1 arg2) (fmax 0.5 (+ 0.5 (vector-dot gp-0 v1-2)))) arg3) (- arg3)) - (* arg1 (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self control unknown-float130) + (fmax (fmin (* (+ f0-1 arg2) (fmax 0.5 (+ 0.5 (vector-dot gp-0 v1-2)))) arg3) (- arg3)) + (* arg1 (-> *display* seconds-per-frame)) + ) ) (let ((a2-2 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)))) (forward-up-nopitch->quaternion (-> self control unknown-quaternion01) gp-0 a2-2) @@ -2545,15 +1950,8 @@ ) (set! (-> self control unknown-float00) (fabs (-> self control unknown-float130))) (if (= (-> self next-state name) 'target-swim-down) - (set! (-> self control unknown-float131) - (seek (-> self control unknown-float131) (the-as float -6144.0) (* 4096.0 (-> *display* seconds-per-frame))) - ) - (set! (-> self control unknown-float131) (seek - (-> self control unknown-float131) - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (* 2048.0 (-> *display* seconds-per-frame)) - ) - ) + (seek! (-> self control unknown-float131) (the-as float -6144.0) (* 4096.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-float131) (the-as float 0.0) (* 2048.0 (-> *display* seconds-per-frame))) ) (let ((f0-20 (-> self control unknown-float131))) (set! (-> self control unknown-vector11 y) f0-20) @@ -2562,17 +1960,14 @@ ) (defstate target-swim-stance (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *swim-mods*) - (logior! (-> self water flags) 16) + (logior! (-> self water flags) (water-flags wt04)) (none) ) - :exit - (behavior () + :exit (behavior () (target-state-hook-exit) (set! (-> self control unknown-surface00 target-speed) 28672.0) (target-exit) @@ -2587,16 +1982,17 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () ((-> self state-hook)) - (if (and (logtest? (-> self control status) 1) (zero? (logand (-> self control status) 1024))) + (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) + (zero? (logand (-> self control status) (cshape-moving-flags on-water))) + ) (set-zero! (-> self water bob)) ) - (when (and (zero? (logand (-> self water flags) 2048)) + (when (and (zero? (logand (-> self water flags) (water-flags wt11))) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) ) - (if (logtest? (-> self water flags) 1024) + (if (logtest? (-> self water flags) (water-flags wt10)) (go target-wade-stance) (go target-stance) ) @@ -2625,13 +2021,9 @@ (go target-swim-down) ) (if (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (let ((gp-0 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((gp-0 (ja-group))) (ja-aframe-num 0) - (if (or (and (= gp-0 (-> self draw art-group data 96)) #t) (and (= gp-0 (-> self draw art-group data 95)) #t)) + (if (or (and (= gp-0 eichar-swim-up-ja) #t) (and (= gp-0 eichar-swim-down-to-up-ja) #t)) #f #t ) @@ -2639,39 +2031,25 @@ ) (go target-swim-walk) ) - (target-swim-tilt - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (the-as float 2.0) - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (the-as float 1.0) - ) + (target-swim-tilt (the-as float 0.0) (the-as float 2.0) (the-as float 0.0) (the-as float 1.0)) (none) ) - :code - (behavior () - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + :code (behavior () + (let ((v1-2 (ja-group))) (cond - ((or (= v1-2 (-> self draw art-group data 96)) (= v1-2 (-> self draw art-group data 95))) - (ja-channel-push! 1 22) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 97))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 97)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) - (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - 1.0 - 2.0 - ) - ) - ) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 97)) num-func-seek!) - ) + ((or (= v1-2 eichar-swim-up-ja) (= v1-2 eichar-swim-down-to-up-ja)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! eichar-swim-up-to-stance-ja + :num! (seek! + max + (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + 1.0 + 2.0 + ) + ) + ) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) (let ((a0-9 (-> self skel root-channel 0))) @@ -2688,66 +2066,48 @@ ) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 92) - ) - (ja-channel-push! 1 249) + ((ja-group? eichar-swim-walk-ja) + (ja-channel-push! 1 (seconds 0.83)) ) (else - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) ) ) ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 91)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (loop + (ja :group! eichar-swim-stance-ja :num! min) (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) (suspend) - (when (= (-> self skel root-channel 0) (-> self skel channel)) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) ) - ) ) ) (none) ) - :post - target-swim-post + :post target-swim-post ) (defstate target-swim-walk (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () ((-> target-swim-stance enter)) (die-on-next-update! (-> self water bob)) (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) (none) ) - :exit - (-> target-swim-stance exit) - :trans - (behavior () + :exit (-> target-swim-stance exit) + :trans (behavior () ((-> self state-hook)) - (if (and (logtest? (-> self control status) 1) (zero? (logand (-> self control status) 1024))) + (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) + (zero? (logand (-> self control status) (cshape-moving-flags on-water))) + ) (set-zero! (-> self water bob)) ) - (when (and (zero? (logand (-> self water flags) 2048)) + (when (and (zero? (logand (-> self water flags) (water-flags wt11))) (>= (- (-> *display* base-frame-counter) (-> self water swim-time)) (seconds 0.1)) ) - (if (logtest? (-> self water flags) 1024) + (if (logtest? (-> self water flags) (water-flags wt10)) (go target-wade-stance) (go target-stance) ) @@ -2787,106 +2147,63 @@ (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) ) ) - (target-swim-tilt - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (the-as float 2.0) - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (the-as float 1.0) - ) + (target-swim-tilt (the-as float 0.0) (the-as float 2.0) (the-as float 0.0) (the-as float 1.0)) (none) ) - :code - (behavior () - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + :code (behavior () + (let ((v1-2 (ja-group))) (cond - ((or (= v1-2 (-> self draw art-group data 96)) - (= v1-2 (-> self draw art-group data 95)) - (= v1-2 (-> self draw art-group data 97)) - ) - (ja-channel-push! 1 90) + ((or (= v1-2 eichar-swim-up-ja) (= v1-2 eichar-swim-down-to-up-ja) (= v1-2 eichar-swim-up-to-stance-ja)) + (ja-channel-push! 1 (seconds 0.3)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 97) - ) - (ja-channel-push! 1 45) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 92))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 92)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe (the-as float 19.0) 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 92)) num-func-seek!) - ) + ((ja-group? eichar-swim-up-to-stance-ja) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! eichar-swim-walk-ja :num! (seek!) :frame-num (ja-aframe (the-as float 19.0) 0)) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (if (zero? (logand (-> self align flags) 1)) + (compute-alignment! (-> self align)) + (if (zero? (logand (-> self align flags) (align-flags disabled))) (set! (-> self control unknown-surface00 target-speed) (* (-> self align delta trans z) (-> self control unknown-surface01 alignv) (-> *display* frames-per-second)) ) ) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) ) ) ) - (while #t - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 92))) - (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 92)) data 0 length) -1)) - ) - (set! (-> a0-22 param 1) 1.0) - (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 92)) num-func-seek!) - ) + (loop + (ja-no-eval :group! eichar-swim-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (if (zero? (logand (-> self align flags) 1)) + (compute-alignment! (-> self align)) + (if (zero? (logand (-> self align flags) (align-flags disabled))) (set! (-> self control unknown-surface00 target-speed) (* (-> self align delta trans z) (-> self control unknown-surface01 alignv) (-> *display* frames-per-second)) ) ) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) 1.0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - target-swim-post + :post target-swim-post ) (defstate target-swim-down (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack 'attack-invinc) (let ((v1-2 (the-as attack-info (-> arg3 param 1)))) - (when (or (zero? (logand (-> v1-2 mask) 32)) (= (-> v1-2 mode) 'generic) (= (-> v1-2 mode) 'drown)) + (when (or (zero? (logand (-> v1-2 mask) (attack-mask mode))) (= (-> v1-2 mode) 'generic) (= (-> v1-2 mode) 'drown)) (set! (-> v1-2 mode) 'damage) (if (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact-info-target health))) (set! (-> v1-2 mode) 'drown-death) ) - (logior! (-> v1-2 mask) 32) + (logior! (-> v1-2 mask) (attack-mask mode)) (set! (-> self control unknown-uint20) (the-as uint #t)) ) ) @@ -2894,10 +2211,9 @@ ) (target-standard-event-handler arg0 arg1 arg2 arg3) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self water flags) (logand -17 (-> self water flags))) + (logclear! (-> self water flags) (water-flags wt04)) (set! (-> self control unknown-surface00) *dive-mods*) (set! (-> self control dynam gravity-max) 16384.0) (set! (-> self control dynam gravity-length) 16384.0) @@ -2908,8 +2224,7 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (target-exit) @@ -2924,8 +2239,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self water swim-time)) (seconds 0.5)) (go target-stance) ) @@ -2933,111 +2247,63 @@ ((>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.1)) (set! (-> self control unknown-surface00) *dive-mods*) (if (= (-> self next-state name) 'target-swim-down) - (target-swim-tilt - (the-as float -0.9) - (the-as float 1.0) - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (the-as float 0.5) - ) + (target-swim-tilt (the-as float -0.9) (the-as float 1.0) (the-as float 0.0) (the-as float 0.5)) ) ) (else (set! (-> self control unknown-surface00) *dive-bottom-mods*) (if (or (= (-> self next-state name) 'target-swim-down) (= (-> self next-state name) 'target-swim-stance)) - (target-swim-tilt - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (the-as float 2.0) - (the-as float -1.0) - (the-as float 1.0) - ) + (target-swim-tilt (the-as float 0.0) (the-as float 2.0) (the-as float -1.0) (the-as float 1.0)) ) ) ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 60) (s5-0 3000) (f30-0 0.0) ) - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-2 (ja-group))) (set! f30-0 (cond - ((or (= v1-2 (-> self draw art-group data 91)) - (= v1-2 (-> self draw art-group data 92)) - (= v1-2 (-> self draw art-group data 97)) - (= v1-2 (-> self draw art-group data 96)) - (= v1-2 (-> self draw art-group data 95)) + ((or (= v1-2 eichar-swim-stance-ja) + (= v1-2 eichar-swim-walk-ja) + (= v1-2 eichar-swim-up-to-stance-ja) + (= v1-2 eichar-swim-up-ja) + (= v1-2 eichar-swim-down-to-up-ja) ) - (ja-channel-push! 1 22) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 93))) - (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 93)) data 0 length) -1)) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 93)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! eichar-swim-walk-to-down-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 6 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (compute-alignment! (-> self align)) + (align! + (-> self align) + (align-opts adjust-y-vel adjust-xz-vel) + (the-as float 1.0) + (the-as float 1.0) + (the-as float 1.0) + ) (if (= (ja-aframe-num 0) 73.0) (dummy-13 (-> self water) (the-as float 0.7) (-> self control trans) 1 *null-vector*) ) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) (the float (+ (-> a0-22 frame-group data 0 length) -1))) - (set! (-> a0-22 param 1) 1.0) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((s4-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-0 - (the-as art-joint-anim (-> self draw art-group data 94)) - num-func-identity - ) - (set! (-> s4-0 frame-num) 0.0) + (ja :num! (seek!)) ) + (ja :group! eichar-swim-down-ja :num! min) f30-0 ) (else - (case (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (((-> self draw art-group data 63) - (-> self draw art-group data 66) - (-> self draw art-group data 64) - (-> self draw art-group data 67) - ) - (ja-channel-push! 1 22) + (case (ja-group) + ((eichar-flop-down-ja eichar-moving-flop-down-ja eichar-flop-down-loop-ja eichar-moving-flop-down-loop-ja) + (ja-channel-push! 1 (seconds 0.075)) (set! gp-0 120) - (let ((s4-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-1 - (the-as art-joint-anim (-> self draw art-group data 94)) - num-func-identity - ) - (set! (-> s4-1 frame-num) (ja-aframe (the-as float 124.0) 0)) - ) + (ja :group! eichar-swim-down-ja :num! (identity (ja-aframe (the-as float 124.0) 0))) -16384.0 ) (else - (ja-channel-push! 1 22) - (let ((s4-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-2 - (the-as art-joint-anim (-> self draw art-group data 94)) - num-func-identity - ) - (set! (-> s4-2 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! eichar-swim-down-ja :num! min) f30-0 ) ) @@ -3045,7 +2311,7 @@ ) ) ) - (while #t + (loop (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons square) ) @@ -3057,7 +2323,7 @@ (go target-swim-up) ) (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) s5-0) - (and (logtest? (-> self control status) 1) + (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (and (< (-> self water swim-depth) 8192.0) (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) ) @@ -3074,9 +2340,7 @@ (f26-0 f28-0) (f24-1 (+ f24-0 f30-0)) ) - (set! f30-0 - (seek f30-0 (the-as float (-> (new 'static 'array int32 1 0) 0)) (* 32768.0 (-> *display* seconds-per-frame))) - ) + (set! f30-0 (seek f30-0 (the-as float 0.0) (* 32768.0 (-> *display* seconds-per-frame)))) (vector+! (-> self control transv) (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f24-1) @@ -3085,37 +2349,30 @@ ) ) (suspend) - (let ((s4-4 (-> self skel root-channel 0))) - (set! (-> s4-4 param 0) (lerp-scale - (the-as float 0.4) - (the-as float 1.0) - (vector-length (-> self control transv)) - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (the-as float 16384.0) - ) - ) - (joint-control-channel-group-eval! s4-4 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! (lerp-scale + (the-as float 0.4) + (the-as float 1.0) + (vector-length (-> self control transv)) + (the-as float 0.0) + (the-as float 16384.0) + ) + ) + ) ) ) (none) ) - :post - target-swim-post + :post target-swim-post ) (defstate target-swim-up (target) - :event - (-> target-swim-down event) - :enter - (-> target-swim-down enter) - :exit - (-> target-swim-down exit) - :trans - (behavior () + :event (-> target-swim-down event) + :enter (-> target-swim-down enter) + :exit (-> target-swim-down exit) + :trans (behavior () (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) - (zero? (logand (-> self state-flags) 2048)) - (zero? (logand (-> self water flags) #x6000)) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (zero? (logand (-> self water flags) (water-flags wt13 wt14))) ) (go target-swim-jump-jump @@ -3124,50 +2381,31 @@ (the-as surface #f) ) ) - (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 10)) - (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) - ) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'attack) - (set! (-> a1-1 param 0) (the-as uint #f)) - (let ((a0-8 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-8 mode) 'drown-death) - (set! (-> a1-1 param 1) (the-as uint a0-8)) - ) - (send-event-function self a1-1) + (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 10)) + (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + ) + (send-event self 'attack #f (static-attack-info ((mode 'drown-death)))) ) - ) ((-> target-swim-down trans)) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) (let ((f30-0 1.0)) (let ((gp-0 #t)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 95))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 95)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 95)) num-func-seek!) - ) + (ja-no-eval :group! eichar-swim-down-to-up-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (target-swim-tilt (the-as float (if (< 8192.0 (-> self water swim-depth)) 0.5 - (-> (new 'static 'array int32 1 0) 0) + 0.0 ) ) (the-as float 1.0) - (the-as float (-> (new 'static 'array int32 1 0) 0)) + (the-as float 0.0) (the-as float 0.1) ) - (if (and (zero? (logand (-> self water flags) 4096)) + (if (and (zero? (logand (-> self water flags) (water-flags wt12))) (or (>= (ja-aframe-num 0) 222.0) (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (>= (ja-aframe-num 0) 200.0) @@ -3176,85 +2414,66 @@ ) (goto cfg-37) ) - (TODO-RENAME-9 (-> self align)) - (when (zero? (logand (-> self water flags) 4096)) - (logior! (-> self water flags) 16) + (compute-alignment! (-> self align)) + (when (zero? (logand (-> self water flags) (water-flags wt12))) + (logior! (-> self water flags) (water-flags wt04)) (set! gp-0 #f) ) (if gp-0 - (TODO-RENAME-10 (-> self align) 2 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (align! (-> self align) (align-opts adjust-y-vel) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 96)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) - (while #t + (ja :group! eichar-swim-up-ja :num! min) + (loop (target-swim-tilt (the-as float (if (< 8192.0 (-> self water swim-depth)) 0.3 - (-> (new 'static 'array int32 1 0) 0) + 0.0 ) ) (the-as float 1.0) - (the-as float (-> (new 'static 'array int32 1 0) 0)) + (the-as float 0.0) (the-as float 0.1) ) - (if (zero? (logand (-> self water flags) 4096)) + (if (zero? (logand (-> self water flags) (water-flags wt12))) (goto cfg-37) ) (if (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (set! f30-0 2.0) ) - (TODO-RENAME-9 (-> self align)) - (when (logtest? (-> self water flags) 4096) - (TODO-RENAME-10 (-> self align) 2 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (compute-alignment! (-> self align)) + (when (logtest? (-> self water flags) (water-flags wt12)) + (align! (-> self align) (align-opts adjust-y-vel) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) (set! (-> self control transv y) (+ 8192.0 (* 8192.0 f30-0))) ) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) f30-0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) (set! f30-0 (seek f30-0 (the-as float 1.0) (-> *display* seconds-per-frame))) ) ) (label cfg-37) - (logior! (-> self water flags) 16) + (logior! (-> self water flags) (water-flags wt04)) (set! (-> self water swim-time) (-> *display* base-frame-counter)) (start-bobbing! (-> self water) (the-as float -4096.0) 600 1500) (set! (-> self water bob start-time) (+ (-> *display* base-frame-counter) (seconds -0.05))) (go target-swim-stance) (none) ) - :post - target-swim-post + :post target-swim-post ) (defstate target-swim-jump-jump (target) - :event - (-> target-jump event) - :enter - (-> target-jump enter) - :exit - target-exit - :trans - (behavior () + :event (-> target-jump event) + :enter (-> target-jump enter) + :exit target-exit + :trans (behavior () (cond ((< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (set! (-> self water flags) (logior #x10000 (-> self water flags))) - (set! (-> self control status) (logand -8 (-> self control status))) + (set! (-> self water flags) (logior (water-flags wt16) (-> self water flags))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) ) (else (set! (-> self trans-hook) (-> target-jump trans)) @@ -3263,50 +2482,33 @@ ((-> target-jump trans)) (none) ) - :code - (-> target-jump code) - :post - (the-as (function none :behavior target) target-post) + :code (-> target-jump code) + :post target-post ) (defstate target-swim-jump (target) - :event - target-standard-event-handler - :enter - (-> target-swim-stance enter) - :exit - (behavior () + :event target-standard-event-handler + :enter (-> target-swim-stance enter) + :exit (behavior () ((-> target-swim-stance exit)) (die-on-next-update! (-> self water bob)) (set! (-> self water align-offset) 0.0) - (set! (-> self water flags) (logior #x10000 (-> self water flags))) + (set! (-> self water flags) (logior (water-flags wt16) (-> self water flags))) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) + :code (behavior ((arg0 float) (arg1 float)) (die-on-next-update! (-> self water bob)) - (ja-channel-push! 1 15) - (let ((s4-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-0 - (the-as art-joint-anim (-> self draw art-group data 98)) - num-func-identity - ) - (set! (-> s4-0 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! eichar-swim-jump-ja :num! min) (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) - (TODO-RENAME-9 (-> self align)) - (if (zero? (logand (-> self align flags) 1)) + (compute-alignment! (-> self align)) + (if (zero? (logand (-> self align flags) (align-flags disabled))) (+! (-> self water align-offset) (* 0.6 (-> self align delta trans y))) ) (suspend) - (when (= (-> self skel root-channel 0) (-> self skel channel)) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 2.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek! max 2.0)) ) - ) ) (let ((f30-0 (fmax 0.0 (- (-> self water bob-offset))))) (let ((s4-1 (new-stack-vector0))) @@ -3329,23 +2531,19 @@ ) (none) ) - :post - target-swim-post + :post target-swim-post ) (defstate target-hit-ground-hard (target) - :event - target-standard-event-handler - :enter - (behavior ((arg0 float)) + :event target-standard-event-handler + :enter (behavior ((arg0 float)) (set! (-> self control unknown-dword31) 0) (set! (-> self control unknown-dword33) 0) - (set-forward-vel (the-as float (-> (new 'static 'array int32 1 0) 0))) + (set-forward-vel (the-as float 0.0)) (set! (-> self control unknown-surface00) *walk-mods*) (none) ) - :code - (behavior ((arg0 float)) + :code (behavior ((arg0 float)) (when (!= arg0 0.0) (let ((f0-5 (the float (the int (+ 1.0 (/ (- arg0 (-> *TARGET-bank* fall-far)) (-> *TARGET-bank* fall-far-inc)))))) ) @@ -3368,173 +2566,126 @@ (else (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) (ja-channel-push! 1 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 36)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! eichar-painful-land-ja :num! min) (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) (suspend) - (when (= (-> self skel root-channel 0) (-> self skel channel)) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) ) - ) - ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 37)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) ) + (ja :group! eichar-painful-land-end-ja :num! min) (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) (suspend) - (when (= (-> self skel root-channel 0) (-> self skel channel)) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) ) - ) ) (go target-stance) ) ) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) (defstate target-launch (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (= arg2 'query) (= (-> arg3 param 0) 'mode)) 'target-launch (target-standard-event-handler arg0 arg1 arg2 arg3) ) ) - :code - (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) + :code (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *turn-around-mods*) - (ja-channel-push! 1 45) - (set-forward-vel (the-as float (-> (new 'static 'array int32 1 0) 0))) - (let ((s2-0 (-> self skel root-channel 0))) - (set! (-> s2-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 31))) - (set! (-> s2-0 param 0) (ja-aframe (the-as float 15.0) 0)) - (set! (-> s2-0 param 1) 3.0) - (set! (-> s2-0 frame-num) 0.0) - (joint-control-channel-group! s2-0 (the-as art-joint-anim (-> self draw art-group data 31)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.15)) + (set-forward-vel (the-as float 0.0)) + (ja-no-eval :group! eichar-duck-stance-ja :num! (seek! (ja-aframe (the-as float 15.0) 0) 3.0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((s2-1 (-> self skel root-channel 0))) - (set! (-> s2-1 param 0) (ja-aframe (the-as float 15.0) 0)) - (set! (-> s2-1 param 1) 3.0) - (joint-control-channel-group-eval! s2-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 15.0) 0) 3.0)) ) (if arg1 - (send-event *camera* 'change-state arg1 180) + (send-event *camera* 'change-state arg1 (seconds 0.6)) ) - (when (nonzero? arg3) - (let ((s3-1 (get-process *default-dead-pool* process #x4000))) - (when s3-1 - (let ((t9-9 (method-of-type process activate))) - (t9-9 s3-1 self 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process - s3-1 - (lambda :behavior target - ((arg0 vector) (arg1 time-frame) (arg2 float)) - (local-vars (sv-32 time-frame) (sv-40 vector) (sv-44 symbol)) - (set! sv-32 (-> *display* base-frame-counter)) - (let ((v1-2 (new-stack-vector0))) - (set! (-> v1-2 quad) (-> arg0 quad)) - (set! sv-40 v1-2) - ) - (set! sv-44 #t) - (until (>= (- (-> *display* base-frame-counter) sv-32) arg1) - (let ((s4-0 (ppointer->process (-> self parent)))) - (cond - ((and sv-44 - (< (- (-> (the-as target s4-0) control trans y) (-> (the-as target s4-0) control unknown-vector52 y)) arg2) - ) - (vector-xz-normalize! - (-> (the-as target s4-0) control transv) - (the-as float (-> (new 'static 'array int32 1 0) 0)) - ) - (case (-> (the-as target s4-0) current-level name) - (('jungleb) - (let ((v1-16 (vector-! (new-stack-vector0) (-> (the-as target s4-0) control trans) sv-40))) - (set! (-> (the-as target s4-0) control trans x) (+ (-> sv-40 x) (fmax -4096.0 (fmin 4096.0 (-> v1-16 x))))) - (set! (-> (the-as target s4-0) control trans z) (+ (-> sv-40 z) (fmax -4096.0 (fmin 4096.0 (-> v1-16 z))))) - ) + (if (nonzero? arg3) + (process-spawn-function + process + (lambda :behavior process + ((arg0 vector) (arg1 time-frame) (arg2 float)) + (local-vars (sv-32 time-frame) (sv-40 vector) (sv-44 symbol)) + (set! sv-32 (-> *display* base-frame-counter)) + (let ((v1-2 (new-stack-vector0))) + (set! (-> v1-2 quad) (-> arg0 quad)) + (set! sv-40 v1-2) + ) + (set! sv-44 #t) + (until (>= (- (-> *display* base-frame-counter) sv-32) arg1) + (let ((s4-0 (ppointer->process (-> self parent)))) + (cond + ((and sv-44 + (< (- (-> (the-as target s4-0) control trans y) (-> (the-as target s4-0) control unknown-vector52 y)) arg2) ) + (vector-xz-normalize! (-> (the-as target s4-0) control transv) (the-as float 0.0)) + ;; PAL patch here + (when (< (vector-vector-xz-distance (-> (the-as target s4-0) control trans) sv-40) 20480.0) + (let ((v1-16 (vector-! (new-stack-vector0) (-> (the-as target s4-0) control trans) sv-40))) + (set! (-> (the-as target s4-0) control trans x) (+ (-> sv-40 x) (fmax -2867.2 (fmin 2867.2 (-> v1-16 x))))) + (set! (-> (the-as target s4-0) control trans z) (+ (-> sv-40 z) (fmax -2867.2 (fmin 2867.2 (-> v1-16 z))))) ) ) - (else - (if sv-44 - (set! sv-32 (-> *display* base-frame-counter)) - ) - (set! sv-44 (the-as symbol #f)) - (when (or (= (-> (the-as target s4-0) next-state name) 'target-duck-high-jump-jump) - (= (-> (the-as target s4-0) next-state name) 'target-falling) - ) - (let ((v1-30 (-> (the-as target s4-0) control trans)) - (s3-0 (-> (the-as target s4-0) control transv)) + ) + (else + (if sv-44 + (set! sv-32 (-> *display* base-frame-counter)) + ) + (set! sv-44 (the-as symbol #f)) + (when (or (= (-> (the-as target s4-0) next-state name) 'target-duck-high-jump-jump) + (= (-> (the-as target s4-0) next-state name) 'target-falling) ) - (set! (-> s3-0 x) (- (-> sv-40 x) (-> v1-30 x))) - (set! (-> s3-0 z) (- (-> sv-40 z) (-> v1-30 z))) - (let ((f30-0 (vector-xz-length s3-0))) - (if (< 122880.0 f30-0) - (vector-xz-normalize! s3-0 (the-as float 122880.0)) - ) - (if (< 4096.0 f30-0) - (forward-up-nopitch->quaternion - (-> (the-as target s4-0) control dir-targ) - (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 (the-as float 1.0)) - (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> (the-as target s4-0) control quat)) - ) - ) + (let ((v1-30 (-> (the-as target s4-0) control trans)) + (s3-0 (-> (the-as target s4-0) control transv)) ) + (set! (-> s3-0 x) (- (-> sv-40 x) (-> v1-30 x))) + (set! (-> s3-0 z) (- (-> sv-40 z) (-> v1-30 z))) + (let ((f30-0 (vector-xz-length s3-0))) + (if (< 122880.0 f30-0) + (vector-xz-normalize! s3-0 (the-as float 122880.0)) + ) + (if (< 4096.0 f30-0) + (forward-up-nopitch->quaternion + (-> (the-as target s4-0) control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 (the-as float 1.0)) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> (the-as target s4-0) control quat)) + ) + ) ) ) ) ) ) - (suspend) - 0 ) - #f + (suspend) + 0 ) - arg2 - arg3 - (-> (new 'static 'array float 1 143360.0) 0) + #f ) - (-> s3-1 ppointer) + arg2 + arg3 + 143360.0 + :to self ) ) - ) - (sound-play-by-name (static-sound-name "launch-fire") (new-sound-id) 1024 0 0 1 #t) + ;; PAL patch (sound plays elsewhere) + ;(sound-play "launch-fire") (go target-high-jump arg0 arg0 'launch) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) (defstate target-periscope (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('change-mode) #f @@ -3550,19 +2701,17 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (target-exit) (set! (-> self cam-user-mode) 'normal) - (logior! (-> self state-flags) 256) - (set! (-> self state-flags) (logand -17 (-> self state-flags))) + ;; PAL patch here + (logclear! (-> self state-flags) (state-flags invulnerable grabbed)) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (set! (-> self neck flex-blend) 0.0) (target-exit) - (logior! (-> self state-flags) 144) + (logior! (-> self state-flags) (state-flags invulnerable do-not-notice)) (let ((v1-4 (handle->process arg0))) (if v1-4 (quaterion<-rotate-y-vector (-> self control dir-targ) (vector-! @@ -3574,57 +2723,30 @@ ) ) (set! (-> self control unknown-uint20) (the-as uint #t)) - (ja-channel-push! 1 30) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 101))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 101)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 101)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! eichar-periscope-grab-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event (handle->process arg0) 'change-mode) (while (-> self control unknown-spoolanim00) (suspend) ) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 101))) - (set! (-> a0-16 param 0) 0.0) - (set! (-> a0-16 param 1) 2.0) - (set! (-> a0-16 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 101)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 101)) num-func-seek!) - ) + (ja-no-eval :group! eichar-periscope-grab-ja :num! (seek! 0.0 2.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) 0.0) - (set! (-> a0-17 param 1) 2.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0 2.0)) ) (go target-stance) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) (defstate target-play-anim (target) - :event - target-generic-event-handler - :enter - (behavior ((arg0 string) (arg1 handle)) + :event target-generic-event-handler + :enter (behavior ((arg0 string) (arg1 handle)) (set! (-> self control unknown-handle10) arg1) (move-to-ground (-> self control) @@ -3633,36 +2755,24 @@ #f (-> self control root-prim collide-with) ) - (logior! (-> self state-flags) 256) + (logior! (-> self state-flags) (state-flags grabbed)) (set! (-> self neck flex-blend) 0.0) (none) ) - :exit - (behavior () + :exit (behavior () (send-event (handle->process (-> self control unknown-handle10)) 'end-mode) (target-exit) (none) ) - :code - (behavior ((arg0 string) (arg1 handle)) + :code (behavior ((arg0 string) (arg1 handle)) (let ((gp-0 (the-as art-joint-anim (lookup-art (-> self draw art-group) arg0 art-joint-anim)))) (when gp-0 (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (ja-channel-set! 1) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) gp-0) - (set! (-> a0-4 param 0) (the float (+ (-> gp-0 data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 gp-0 num-func-seek!) - ) + (ja-no-eval :group! gp-0 :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) ) @@ -3670,32 +2780,28 @@ (go target-stance) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) (defstate target-clone-anim (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (= arg2 'trans) (= (-> arg3 param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) ((-> target-grab event) arg0 arg1 arg2 arg3) ) - :enter - (behavior ((arg0 handle)) + :enter (behavior ((arg0 handle)) (set! (-> self control unknown-handle10) arg0) (set! (-> self control unknown-vector102 quad) (-> self control trans quad)) (set! (-> self control unknown-uint20) (the-as uint #t)) (quaternion-copy! (the-as quaternion (-> self control unknown-vector103)) (-> self control quat)) - (logior! (-> self state-flags) 256) + (logior! (-> self state-flags) (state-flags grabbed)) (vector-reset! (-> self control transv)) (set! (-> self neck flex-blend) 0.0) (send-event (ppointer->process (-> self sidekick)) 'shadow #t) (none) ) - :exit - (behavior () + :exit (behavior () (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) (send-event (ppointer->process (-> self sidekick)) 'shadow #t) (let ((gp-0 (-> self node-list data 3)) @@ -3715,7 +2821,7 @@ #t (-> self control root-prim collide-with) ) - (when (logtest? (-> self control status) 1024) + (when (logtest? (-> self control status) (cshape-moving-flags on-water)) (let ((a1-6 (new-stack-vector0))) (set! (-> a1-6 x) (-> self control trans x)) (set! (-> a1-6 y) (-> self water height)) @@ -3733,21 +2839,19 @@ ) ) (rot->dir-targ! (-> self control)) - (logior! (-> self control status) 7) + (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-dword11) (-> *display* base-frame-counter)) (ja-channel-set! 0) (ja-post) (target-exit) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (clone-anim arg0 (the-as int (-> self draw origin-joint-index)) #t "") (go target-stance) (none) ) - :post - target-no-ja-move-post + :post target-no-ja-move-post ) diff --git a/goal_src/engine/ui/credits.gc b/goal_src/engine/ui/credits.gc index 8e2b7711e0..7433eef742 100644 --- a/goal_src/engine/ui/credits.gc +++ b/goal_src/engine/ui/credits.gc @@ -5,63 +5,45 @@ ;; name in dgo: credits ;; dgos: GAME, ENGINE -;; definition for function set-credits-font-color -;; INFO: Return type mismatch int vs none. +;; DECOMP BEGINS + (defun set-credits-font-color ((arg0 float)) - (let ((f0-0 255.0)) - ) + 255.0 (dotimes (v1-0 4) - (let ((f0-2 (* 64.0 arg0))) - (if (< 128.0 f0-2) - (set! f0-2 128.0) - ) - (set! (-> *font-work* color-table 32 color v1-0 r) (the int f0-2)) + (let ((f0-2 (* 64.0 arg0))) + (if (< 128.0 f0-2) + (set! f0-2 128.0) + ) + (set! (-> *font-work* color-table 32 color v1-0 r) (the int f0-2)) + ) + (let ((f0-5 (* 64.0 arg0))) + (if (< 128.0 f0-5) + (set! f0-5 128.0) + ) + (set! (-> *font-work* color-table 32 color v1-0 g) (the int f0-5)) + ) + (let ((f0-8 (* 64.0 arg0))) + (if (< 128.0 f0-8) + (set! f0-8 128.0) + ) + (set! (-> *font-work* color-table 32 color v1-0 b) (the int f0-8)) + ) ) - (let ((f0-5 (* 64.0 arg0))) - (if (< 128.0 f0-5) - (set! f0-5 128.0) - ) - (set! (-> *font-work* color-table 32 color v1-0 g) (the int f0-5)) - ) - (let ((f0-8 (* 64.0 arg0))) - (if (< 128.0 f0-8) - (set! f0-8 128.0) - ) - (set! (-> *font-work* color-table 32 color v1-0 b) (the int f0-8)) - ) - ) + 0 (none) ) -;; definition for symbol *title-credits-scale*, type (array float) -(define *title-credits-scale* - (the-as (array float) - (new 'static 'boxed-array :type float :length 8 - 0.9 0.9 0.6 0.6 1.0 0.9 1.1 0.9) - ) - ) +(define *title-credits-scale* (new 'static 'boxed-array :type float 0.9 0.9 0.6 0.6 1.0 0.9 1.1 0.9)) -;; definition for symbol *title-credits-spacing*, type (array int32) -(define *title-credits-spacing* - (the-as (array int32) - (new 'static 'boxed-array :type int32 :length 8 - 15 20 15 15 20 15 20 15) - ) - ) +(define *title-credits-spacing* (new 'static 'boxed-array :type int32 15 20 15 15 20 15 20 15)) (defun draw-title-credits ((arg0 float)) (when (>= 1.0 arg0) (let* ((s4-0 11) (f30-0 (* arg0 (the float (+ s4-0 -2)))) (s5-0 (the int f30-0)) - (gp-0 (new 'stack 'font-context - *font-default-matrix* - 0 - 0 - 0.0 - (font-color default) - (font-flags shadow kerning) - ) + (gp-0 + (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) ) ) 1.0 @@ -87,19 +69,19 @@ 128.0 ) (else - (* 128.0 (- 1.0 (* 1.25 (+ -2.2 f0-10)))) - ) + (* 128.0 (- 1.0 (* 1.25 (+ -2.2 f0-10)))) + ) ) - ) + ) ) (set! (-> gp-0 origin x) -44.0) (set! (-> gp-0 origin y) 90.0) (dotimes (s4-1 3) - (let* ((s2-0 (+ (+ s4-1 3840) s5-1)) + (let* ((s2-0 (+ s4-1 3840 s5-1)) (s3-0 (lookup-text! *common-text* (the-as game-text-id s2-0) #t)) ) (when (= s2-0 3841) - (case (scf-get-territory) + (case (scf-get-territory) ((1) (set! s3-0 (lookup-text! *common-text* (game-text-id europe) #t)) ) @@ -115,11 +97,7 @@ (print-game-text s3-0 gp-0 #f (the int f30-1) 22) ) ) - (set! (-> gp-0 origin y) - (+ (-> gp-0 origin y) - (the float (-> *title-credits-spacing* (+ s5-1 s4-1))) - ) - ) + (+! (-> gp-0 origin y) (the float (-> *title-credits-spacing* (+ s5-1 s4-1)))) ) ) ) @@ -130,55 +108,59 @@ (none) ) -;; definition for function draw-end-credits (defun draw-end-credits ((arg0 int)) (local-vars (v1-13 int)) (let ((s4-0 (+ (- arg0) (the int (* 1.5 (the float (-> *video-parms* screen-sy)))))) - (gp-0 2815) - (s3-0 0) - (s2-0 #t) - (s5-0 (new 'stack 'font-context *font-default-matrix* 31 0 0.0 (font-color default) (font-flags shadow kerning))) - ) - (let ((v1-2 s5-0)) - (set! (-> v1-2 width) (the float 450)) - ) - (let ((v1-3 s5-0)) - (set! (-> v1-3 height) (the float 10)) - ) - (let ((v1-4 s5-0)) - (set! (-> v1-4 scale) 1.0) - ) - (set! (-> s5-0 flags) (font-flags shadow kerning middle large)) - (while (or s2-0 (and (< s4-0 (- s3-0)) (< (the-as uint gp-0) (the-as uint 3249)))) - (+! s4-0 s3-0) - (+! gp-0 1) - (let ((a0-8 (lookup-text! *common-text* (the-as game-text-id gp-0) #t))) - (if a0-8 - (set! s3-0 (the int (+ 5.0 (print-game-text a0-8 s5-0 #t 128 20)))) - (set! s3-0 25) - ) - ) - (set! s2-0 #f) - ) - (cond - ((>= (the-as uint gp-0) (the-as uint 3249)) - #t - ) - (else - (set! (-> s5-0 origin y) (the float s4-0)) - (while (< (-> s5-0 origin y) (the float (-> *video-parms* screen-sy))) - (let ((a0-11 (lookup-text! *common-text* (the-as game-text-id gp-0) #t))) - (if a0-11 - (set! v1-13 (the int (+ 5.0 (print-game-text a0-11 s5-0 #f 128 20)))) - (set! v1-13 25) + (gp-0 2815) + (s3-0 0) + (s2-0 #t) + (s5-0 + (new 'stack 'font-context *font-default-matrix* 31 0 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (let ((v1-2 s5-0)) + (set! (-> v1-2 width) (the float 450)) + ) + (let ((v1-3 s5-0)) + (set! (-> v1-3 height) (the float 10)) + ) + (let ((v1-4 s5-0)) + (set! (-> v1-4 scale) 1.0) + ) + (set! (-> s5-0 flags) (font-flags shadow kerning middle large)) + (while (or s2-0 (and (< s4-0 (- s3-0)) (< (the-as uint gp-0) (the-as uint 3262)))) + (+! s4-0 s3-0) + (+! gp-0 1) + (let ((a0-8 (lookup-text! *common-text* (the-as game-text-id gp-0) #t))) + (if a0-8 + (set! s3-0 (the int (+ 5.0 (print-game-text a0-8 s5-0 #t 128 20)))) + (set! s3-0 25) + ) + ) + (set! s2-0 #f) + ) + (cond + ((>= (the-as uint gp-0) (the-as uint 3262)) + #t + ) + (else + (set! (-> s5-0 origin y) (the float s4-0)) + (while (< (-> s5-0 origin y) (the float (-> *video-parms* screen-sy))) + (let ((a0-11 (lookup-text! *common-text* (the-as game-text-id gp-0) #t))) + (if a0-11 + (set! v1-13 (the int (+ 5.0 (print-game-text a0-11 s5-0 #f 128 20)))) + (set! v1-13 25) + ) + ) + (+! (-> s5-0 origin y) (the float v1-13)) + (+! gp-0 1) + ) + #f ) - ) - (set! (-> s5-0 origin y) (+ (-> s5-0 origin y) (the float v1-13))) - (+! gp-0 1) ) - #f - ) ) - ) ) + + + diff --git a/goal_src/engine/ui/hud-classes.gc b/goal_src/engine/ui/hud-classes.gc index 66eb5ae1c2..5cde804efa 100644 --- a/goal_src/engine/ui/hud-classes.gc +++ b/goal_src/engine/ui/hud-classes.gc @@ -7,12 +7,13 @@ ;; DECOMP BEGINS +(import "goal_src/import/fuelcell-naked-ag.gc") + (defpartgroup group-part-hud-pickup :id 75 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 303 :flags (launch-asap) :binding 304) + :parts ((sp-item 303 :flags (launch-asap) :binding 304) (sp-item 304 :flags (start-dead launch-asap) :binding 305) (sp-item 305 :flags (start-dead launch-asap) :binding 306) (sp-item 306 :flags (start-dead launch-asap) :binding 307) @@ -27,8 +28,7 @@ ) (defpart 303 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-copy-from-other spt-scale-y -4) @@ -41,8 +41,7 @@ ) (defpart 304 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 0.03)) @@ -63,8 +62,7 @@ ) (defpart 305 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 0.065)) @@ -85,8 +83,7 @@ ) (defpart 306 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 0.12)) @@ -105,8 +102,7 @@ ) (defpart 307 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-scale-x (meters 0.35)) (sp-copy-from-other spt-scale-y -4) @@ -126,8 +122,7 @@ ) (defpart 308 - :init-specs - ((sp-flt spt-fade-r 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0)) ) (deftype hud-pickups (hud) @@ -139,8 +134,8 @@ ) -(defmethod dummy-15 hud-pickups ((obj hud-pickups)) - (let ((t9-0 (method-of-type hud dummy-15))) +(defmethod draw-hud hud-pickups ((obj hud-pickups)) + (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 obj) ) (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) @@ -170,7 +165,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) @@ -180,9 +175,9 @@ (none) ) -(defmethod TODO-RENAME-19 hud-pickups ((obj hud-pickups)) +(defmethod hud-update hud-pickups ((obj hud-pickups)) (if *target* - (TODO-RENAME-16 obj (the int (+ 0.5 (-> *target* fact-info-target eco-pill))) 0) + (tally-value obj (the int (+ 0.5 (-> *target* fact-info-target eco-pill))) 0) ) 0 (none) @@ -218,29 +213,25 @@ :id 76 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 309 :flags (launch-asap))) + :parts ((sp-item 309 :flags (launch-asap))) ) (defpartgroup group-part-hud-health-2 :id 77 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 310 :flags (launch-asap))) + :parts ((sp-item 310 :flags (launch-asap))) ) (defpartgroup group-part-hud-health-3 :id 78 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 311 :flags (launch-asap))) + :parts ((sp-item 311 :flags (launch-asap))) ) (defpart 309 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2d :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.7)) (sp-copy-from-other spt-scale-y -4) @@ -255,8 +246,7 @@ ) (defpart 310 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.7)) (sp-copy-from-other spt-scale-y -4) @@ -271,8 +261,7 @@ ) (defpart 311 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2f :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.7)) (sp-copy-from-other spt-scale-y -4) @@ -353,15 +342,15 @@ (none) ) -(defmethod dummy-15 hud-health ((obj hud-health)) - ((method-of-type hud dummy-15) obj) +(defmethod draw-hud hud-health ((obj hud-health)) + ((method-of-type hud draw-hud) obj) 0 (none) ) -(defmethod TODO-RENAME-19 hud-health ((obj hud-health)) +(defmethod hud-update hud-health ((obj hud-health)) (if *target* - (TODO-RENAME-16 + (tally-value obj (the int (-> *target* fact-info-target health)) (the-as int (-> *target* fact-info-target health-pickup-time)) @@ -410,7 +399,7 @@ (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) ) ) - (animate! obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) (set! (-> obj x-sgn) -1) (set! (-> obj y-sgn) -1) (set! (-> obj friend) 0) @@ -418,7 +407,7 @@ (none) ) -(defmethod animate! hud-health ((obj hud-health) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-health ((obj hud-health) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> obj particles 0 init-pos x) 65.0) @@ -455,13 +444,11 @@ :id 705 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 2964 :flags (launch-asap))) + :parts ((sp-item 2964 :flags (launch-asap))) ) (defpart 2964 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2.4)) (sp-copy-from-other spt-scale-y -4) @@ -489,8 +476,8 @@ ) -(defmethod dummy-15 hud-money-all ((obj hud-money-all)) - (let ((t9-0 (method-of-type hud dummy-15))) +(defmethod draw-hud hud-money-all ((obj hud-money-all)) + (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 obj) ) 0 @@ -565,7 +552,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-1 (the-as (pointer dma-tag) a3-12) ) @@ -576,7 +563,7 @@ (none) ) -(defmethod TODO-RENAME-19 hud-money-all ((obj hud-money-all)) +(defmethod hud-update hud-money-all ((obj hud-money-all)) (when *target* (hide-bottom-hud) (when (!= *master-mode* 'pause) @@ -594,7 +581,7 @@ ) (if (>= (+ (-> *display* base-frame-counter) (seconds -5)) (-> obj start-time)) (set! (-> obj deactivate-when-hidden) #t) - (TODO-RENAME-16 obj (the-as int (-> *display* base-frame-counter)) 0) + (tally-value obj (the-as int (-> *display* base-frame-counter)) 0) ) ) 0 @@ -605,16 +592,7 @@ (when (< (-> obj nb-of-icons) 6) (let ((s4-0 (-> obj nb-of-icons))) (set! (-> obj icons s4-0) (new 'static 'hud-icon)) - (let* ((s2-0 (get-process *default-dead-pool* manipy #x4000)) - (s3-0 (when s2-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy s2-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 manipy-init (new 'static 'vector :w 1.0) #f *money-sg* #f) - (-> s2-0 ppointer) - ) - ) - ) + (let ((s3-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *money-sg* #f :to obj))) (when s3-0 (set! (-> (the-as process-drawable (-> s3-0 0)) draw dma-add-func) dma-add-process-drawable-hud) (set-vector! (-> (the-as process-drawable (-> s3-0 0)) root trans) 0.0 0.0 0.0 1.0) @@ -649,7 +627,7 @@ ) (+! (-> obj nb-of-particles) 1) ) - (animate! obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) (dotimes (s4-3 (-> obj nb-of-particles)) (if (= (-> obj particles s4-3 part matrix) -1) (set! (-> obj particles s4-3 part matrix) (sprite-allocate-user-hvdf)) @@ -692,12 +670,12 @@ ) ) (set! (-> obj start-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "get-all-orbs") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-all-orbs") 0 (none) ) -(defmethod animate! hud-money-all ((obj hud-money-all) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-money-all ((obj hud-money-all) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> obj x-scale) 0.01845) @@ -727,13 +705,11 @@ :id 79 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 312 :flags (launch-asap))) + :parts ((sp-item 312 :flags (launch-asap))) ) (defpart 312 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.6)) (sp-copy-from-other spt-scale-y -4) @@ -758,8 +734,8 @@ ) -(defmethod dummy-15 hud-money ((obj hud-money)) - (let ((t9-0 (method-of-type hud dummy-15))) +(defmethod draw-hud hud-money ((obj hud-money)) + (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 obj) ) (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) @@ -789,7 +765,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) @@ -799,7 +775,7 @@ (none) ) -(defmethod TODO-RENAME-19 hud-money ((obj hud-money)) +(defmethod hud-update hud-money ((obj hud-money)) (when *target* (when (!= *master-mode* 'pause) (when (and (!= (-> obj icons 0) 0) (-> obj icons 0 icon)) @@ -814,7 +790,7 @@ ) ) ) - (TODO-RENAME-16 obj (the int (+ 0.5 (-> *target* game money))) 0) + (tally-value obj (the int (+ 0.5 (-> *target* game money))) 0) ) 0 (none) @@ -824,16 +800,7 @@ (when (< (-> obj nb-of-icons) 6) (let ((s5-0 (-> obj nb-of-icons))) (set! (-> obj icons s5-0) (new 'static 'hud-icon)) - (let* ((s3-0 (get-process *default-dead-pool* manipy #x4000)) - (s4-0 (when s3-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy s3-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 manipy-init (new 'static 'vector :w 1.0) #f *money-sg* #f) - (-> s3-0 ppointer) - ) - ) - ) + (let ((s4-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *money-sg* #f :to obj))) (when s4-0 (set! (-> (the-as process-drawable (-> s4-0 0)) draw dma-add-func) dma-add-process-drawable-hud) (set-vector! (-> (the-as process-drawable (-> s4-0 0)) root trans) 0.0 0.0 0.0 1.0) @@ -868,7 +835,7 @@ ) (+! (-> obj nb-of-particles) 1) ) - (animate! obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) (dotimes (s5-3 (-> obj nb-of-particles)) (if (= (-> obj particles s5-3 part matrix) -1) (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) @@ -883,7 +850,7 @@ (none) ) -(defmethod animate! hud-money ((obj hud-money) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-money ((obj hud-money) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> obj x-scale) 0.0123) @@ -911,34 +878,30 @@ (none) ) -(defmethod first-icon-x hud-money ((obj hud-money)) +(defmethod get-icon-pos-x hud-money ((obj hud-money)) (-> obj icons 0 icon-x) ) -(defmethod first-icon-y hud-money ((obj hud-money)) +(defmethod get-icon-pos-y hud-money ((obj hud-money)) (-> obj icons 0 icon-y) ) -(defmethod inc-value hud-money ((obj hud-money)) +(defmethod get-icon-scale-x hud-money ((obj hud-money)) 0.01 ) -(defmethod dec-value hud-money ((obj hud-money)) +(defmethod get-icon-scale-y hud-money ((obj hud-money)) -0.011 ) -(defskelgroup *fuelcell-naked-sg* fuelcell-naked - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *fuelcell-naked-sg* fuelcell-naked fuelcell-naked-lod0-jg fuelcell-naked-idle-ja + ((fuelcell-naked-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) (defpart 313 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.4)) (sp-copy-from-other spt-scale-y -4) @@ -954,8 +917,7 @@ ) (defpart 314 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.4)) (sp-copy-from-other spt-scale-y -4) @@ -971,8 +933,7 @@ ) (defpart 315 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.4)) (sp-copy-from-other spt-scale-y -4) @@ -988,8 +949,7 @@ ) (defpart 316 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.4)) (sp-copy-from-other spt-scale-y -4) @@ -1005,8 +965,7 @@ ) (defpart 317 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.2)) (sp-copy-from-other spt-scale-y -4) @@ -1022,8 +981,7 @@ ) (defpart 318 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x30 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x30 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.8)) (sp-copy-from-other spt-scale-y -4) @@ -1041,8 +999,7 @@ :id 80 :flags (use-local-clock screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 318 :flags (launch-asap)) + :parts ((sp-item 318 :flags (launch-asap)) (sp-item 319 :fade-after (meters 35)) (sp-item 320 :fade-after (meters 20)) (sp-item 321 :flags (launch-asap) :period 3600 :length 5) @@ -1056,13 +1013,11 @@ ) (defpart 323 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) (defpart 319 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-z (meters 22.5)) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.5) 1.0) @@ -1085,8 +1040,7 @@ ) (defpart 320 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-z (meters 22.5)) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.5) 1.0) @@ -1108,8 +1062,7 @@ ) (defpart 321 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters 22.5)) (sp-flt spt-scale-x (meters 3.3)) @@ -1127,8 +1080,7 @@ ) (defpart 322 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters 22.5)) (sp-flt spt-scale-x (meters 3.8)) @@ -1161,8 +1113,8 @@ ) -(defmethod dummy-15 hud-fuel-cell ((obj hud-fuel-cell)) - (let ((t9-0 (method-of-type hud dummy-15))) +(defmethod draw-hud hud-fuel-cell ((obj hud-fuel-cell)) + (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 obj) ) (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) @@ -1192,7 +1144,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) @@ -1246,7 +1198,7 @@ (none) ) -(defmethod TODO-RENAME-19 hud-fuel-cell ((obj hud-fuel-cell)) +(defmethod hud-update hud-fuel-cell ((obj hud-fuel-cell)) (when *target* (when (!= *master-mode* 'pause) (let ((a0-2 (-> obj icons 0 icon 0 root))) @@ -1257,7 +1209,7 @@ ) ) (set! (-> obj icons 0 icon-y) (-> obj icon-pos-y)) - (TODO-RENAME-16 obj (the int (+ 0.5 (-> *target* game fuel))) 0) + (tally-value obj (the int (+ 0.5 (-> *target* game fuel))) 0) (let ((s5-1 (new 'stack-no-clear 'vector))) (vector<-cspace! s5-1 (-> obj icons 0 icon 0 node-list data 3)) (set! (-> obj particles 0 pos x) (-> s5-1 x)) @@ -1289,16 +1241,7 @@ (when (< (-> obj nb-of-icons) 6) (let ((s5-2 (-> obj nb-of-icons))) (set! (-> obj icons s5-2) (new 'static 'hud-icon)) - (let* ((s3-0 (get-process *default-dead-pool* manipy #x4000)) - (s4-0 (when s3-0 - (let ((t9-3 (method-of-type manipy activate))) - (t9-3 (the-as manipy s3-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 manipy-init (new 'static 'vector :w 1.0) #f *fuelcell-naked-sg* #f) - (-> s3-0 ppointer) - ) - ) - ) + (let ((s4-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *fuelcell-naked-sg* #f :to obj))) (when s4-0 (set! (-> (the-as process-drawable (-> s4-0 0)) draw dma-add-func) dma-add-process-drawable-hud) (set-vector! (-> (the-as process-drawable (-> s4-0 0)) root trans) 0.0 0.0 0.0 1.0) @@ -1328,7 +1271,7 @@ (set! (-> obj y-sgn) -1) (set! (-> obj increment-on-event) #t) (set! (-> obj skip-particle) -2) - (animate! obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) (let ((s5-4 (new 'stack-no-clear 'quaternion))) (quaternion-axis-angle! s5-4 0.0 1.0 0.0 16384.0) (quaternion*! (-> obj icons 0 icon 0 root quat) s5-4 (-> obj icons 0 icon 0 root quat)) @@ -1337,7 +1280,7 @@ (none) ) -(defmethod animate! hud-fuel-cell ((obj hud-fuel-cell) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-fuel-cell ((obj hud-fuel-cell) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> obj scale-starburst-3-x) 10240.0) @@ -1375,13 +1318,11 @@ :id 81 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 324 :flags (launch-asap) :binding 325) (sp-item 325 :flags (start-dead launch-asap))) + :parts ((sp-item 324 :flags (launch-asap) :binding 325) (sp-item 325 :flags (start-dead launch-asap))) ) (defpart 324 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2.2)) (sp-copy-from-other spt-scale-y -4) @@ -1395,8 +1336,7 @@ ) (defpart 325 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 1.3333334)) @@ -1435,8 +1375,8 @@ (none) ) -(defmethod dummy-15 hud-buzzers ((obj hud-buzzers)) - (let ((t9-0 (method-of-type hud dummy-15))) +(defmethod draw-hud hud-buzzers ((obj hud-buzzers)) + (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 obj) ) (set! (-> obj text-y) (+ (if (nonzero? (-> obj next-y-offset)) @@ -1473,7 +1413,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) @@ -1483,9 +1423,9 @@ (none) ) -(defmethod TODO-RENAME-19 hud-buzzers ((obj hud-buzzers)) +(defmethod hud-update hud-buzzers ((obj hud-buzzers)) (if *target* - (TODO-RENAME-16 obj (the int (+ 0.5 (-> *target* fact-info-target buzzer))) 0) + (tally-value obj (the int (+ 0.5 (-> *target* fact-info-target buzzer))) 0) ) 0 (none) @@ -1508,7 +1448,7 @@ (set! (-> obj particles s5-1 part matrix) (sprite-allocate-user-hvdf)) ) ) - (animate! obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) (set! (-> obj text-x) 85) (set! (-> obj text-y) 362) (set! (-> obj x-sgn) -1) @@ -1519,11 +1459,11 @@ (none) ) -(defmethod first-icon-x hud-buzzers ((obj hud-buzzers)) +(defmethod get-icon-pos-x hud-buzzers ((obj hud-buzzers)) (-> obj text-x) ) -(defmethod first-icon-y hud-buzzers ((obj hud-buzzers)) +(defmethod get-icon-pos-y hud-buzzers ((obj hud-buzzers)) (+ (if (= (-> *setting-control* current video-mode) 'pal) (+ (-> obj text-y) 120) (+ (-> obj text-y) 50) @@ -1532,15 +1472,15 @@ ) ) -(defmethod inc-value hud-buzzers ((obj hud-buzzers)) +(defmethod get-icon-scale-x hud-buzzers ((obj hud-buzzers)) 0.008 ) -(defmethod dec-value hud-buzzers ((obj hud-buzzers)) +(defmethod get-icon-scale-y hud-buzzers ((obj hud-buzzers)) -0.008 ) -(defmethod animate! hud-buzzers ((obj hud-buzzers) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-buzzers ((obj hud-buzzers) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> obj scale) 6553.6) @@ -1560,21 +1500,18 @@ :id 82 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 327 :flags (launch-asap))) + :parts ((sp-item 327 :flags (launch-asap))) ) (defpartgroup group-part-hud-eco-timer-backing :id 83 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 328 :flags (launch-asap))) + :parts ((sp-item 328 :flags (launch-asap))) ) (defpart 327 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3.2)) (sp-copy-from-other spt-scale-y -4) @@ -1589,8 +1526,7 @@ ) (defpart 328 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2.5)) (sp-copy-from-other spt-scale-y -4) @@ -1608,13 +1544,11 @@ :id 84 :flags (use-local-clock screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 329 :flags (launch-asap)) (sp-item 330 :flags (launch-asap)) (sp-item 331 :flags (launch-asap))) + :parts ((sp-item 329 :flags (launch-asap)) (sp-item 330 :flags (launch-asap)) (sp-item 331 :flags (launch-asap))) ) (defpart 329 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-copy-from-other spt-scale-y -4) @@ -1629,8 +1563,7 @@ ) (defpart 330 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-copy-from-other spt-scale-y -4) @@ -1645,8 +1578,7 @@ ) (defpart 331 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-copy-from-other spt-scale-y -4) @@ -1862,9 +1794,9 @@ (none) ) -(defmethod TODO-RENAME-19 hud-power ((obj hud-power)) +(defmethod hud-update hud-power ((obj hud-power)) (if *target* - (TODO-RENAME-16 + (tally-value obj (max 0 @@ -1924,14 +1856,14 @@ (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) ) ) - (animate! obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) (set! (-> obj x-sgn) 1) (set! (-> obj y-sgn) 1) 0 (none) ) -(defmethod animate! hud-power ((obj hud-power) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-power ((obj hud-power) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> obj scale-blue) 7168.0) @@ -1965,86 +1897,12 @@ ) (defun activate-hud ((arg0 process)) - (let ((s5-0 (get-process *default-dead-pool* hud-pickups #x4000))) - (set! (-> *hud-parts* pickups) - (the-as - (pointer hud-pickups) - (when s5-0 - (let ((t9-1 (method-of-type hud-pickups activate))) - (t9-1 (the-as hud-pickups s5-0) arg0 'hud-pickups (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 hud-init-by-other 0) - (-> s5-0 ppointer) - ) - ) - ) - ) - (let ((s5-1 (get-process *default-dead-pool* hud-money #x4000))) - (set! (-> *hud-parts* money) - (the-as (pointer hud-money) (when s5-1 - (let ((t9-4 (method-of-type hud-money activate))) - (t9-4 (the-as hud-money s5-1) arg0 'hud-money (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 hud-init-by-other 0) - (-> s5-1 ppointer) - ) - ) - ) - ) - (let ((s5-2 (get-process *default-dead-pool* hud-fuel-cell #x4000))) - (set! (-> *hud-parts* fuel-cell) - (the-as - (pointer hud-fuel-cell) - (when s5-2 - (let ((t9-7 (method-of-type hud-fuel-cell activate))) - (t9-7 (the-as hud-fuel-cell s5-2) arg0 'hud-fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 hud-init-by-other 0) - (-> s5-2 ppointer) - ) - ) - ) - ) - (let ((s5-3 (get-process *default-dead-pool* hud-health #x4000))) - (set! (-> *hud-parts* health) - (the-as - (pointer hud-health) - (when s5-3 - (let ((t9-10 (method-of-type hud-health activate))) - (t9-10 (the-as hud-health s5-3) arg0 'hud-health (the-as pointer #x70004000)) - ) - (run-now-in-process s5-3 hud-init-by-other 0) - (-> s5-3 ppointer) - ) - ) - ) - ) - (let ((s5-4 (get-process *default-dead-pool* hud-buzzers #x4000))) - (set! (-> *hud-parts* buzzers) - (the-as - (pointer hud-buzzers) - (when s5-4 - (let ((t9-13 (method-of-type hud-buzzers activate))) - (t9-13 (the-as hud-buzzers s5-4) arg0 'hud-buzzers (the-as pointer #x70004000)) - ) - (run-now-in-process s5-4 hud-init-by-other 0) - (-> s5-4 ppointer) - ) - ) - ) - ) - (let ((s5-5 (get-process *default-dead-pool* hud-power #x4000))) - (set! (-> *hud-parts* power) - (the-as (pointer hud-power) (when s5-5 - (let ((t9-16 (method-of-type hud-power activate))) - (t9-16 (the-as hud-power s5-5) arg0 'hud-power (the-as pointer #x70004000)) - ) - (run-now-in-process s5-5 hud-init-by-other 0) - (-> s5-5 ppointer) - ) - ) - ) - ) + (set! (-> *hud-parts* pickups) (process-spawn hud-pickups :init hud-init-by-other 0 :to arg0)) + (set! (-> *hud-parts* money) (process-spawn hud-money :init hud-init-by-other 0 :to arg0)) + (set! (-> *hud-parts* fuel-cell) (process-spawn hud-fuel-cell :init hud-init-by-other 0 :to arg0)) + (set! (-> *hud-parts* health) (process-spawn hud-health :init hud-init-by-other 0 :to arg0)) + (set! (-> *hud-parts* buzzers) (process-spawn hud-buzzers :init hud-init-by-other 0 :to arg0)) + (set! (-> *hud-parts* power) (process-spawn hud-power :init hud-init-by-other 0 :to arg0)) (set! (-> *hud-parts* bike-speed) (the-as (pointer hud-bike-speed) #f)) (set! (-> *hud-parts* bike-heat) (the-as (pointer hud-bike-heat) #f)) (set! (-> *hud-parts* money-all) (the-as (pointer hud-money-all) #f)) @@ -2138,7 +1996,7 @@ (when *target* (dotimes (s4-0 9) (if (-> *hud-parts* parts s4-0) - (animate! (-> (the-as (pointer hud) (-> *hud-parts* parts s4-0)) 0) gp-0 s5-0) + (set-pos-and-scale (-> (the-as (pointer hud) (-> *hud-parts* parts s4-0)) 0) gp-0 s5-0) ) ) ) @@ -2154,7 +2012,7 @@ (set! gp-0 #t) (dotimes (s5-0 9) (when (-> *hud-parts* parts s5-0) - (if (not (dummy-14 (-> (the-as (pointer hud) (-> *hud-parts* parts s5-0)) 0))) + (if (not (hidden? (-> (the-as (pointer hud) (-> *hud-parts* parts s5-0)) 0))) (set! gp-0 #f) ) ) @@ -2174,7 +2032,7 @@ (set! gp-0 #t) (dotimes (s5-0 4) (when (-> *hud-parts* parts (+ s5-0 4)) - (if (not (dummy-14 (-> (the-as (pointer hud) (-> *hud-parts* parts (+ s5-0 4))) 0))) + (if (not (hidden? (-> (the-as (pointer hud) (-> *hud-parts* parts (+ s5-0 4))) 0))) (set! gp-0 #f) ) ) @@ -2188,26 +2046,13 @@ ) (defun activate-orb-all ((arg0 int)) - (when (not (-> *hud-parts* money-all)) - (let ((s5-0 (get-process *default-dead-pool* hud-money-all #x4000))) - (set! (-> *hud-parts* money-all) - (the-as - (pointer hud-money-all) - (when s5-0 - (let ((t9-1 (method-of-type hud-money-all activate))) - (t9-1 (the-as hud-money-all s5-0) *target* 'hud-money-all (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 hud-init-by-other arg0) - (-> s5-0 ppointer) - ) - ) - ) + (if (not (-> *hud-parts* money-all)) + (set! (-> *hud-parts* money-all) (process-spawn hud-money-all :init hud-init-by-other arg0 :to *target*)) ) - ) 0 ) -(defbehavior convert-to-hud-object hud ((arg0 process-drawable) (arg1 hud)) +(defbehavior convert-to-hud-object process-drawable ((arg0 process-drawable) (arg1 hud)) (when arg1 (logclear! (-> arg0 mask) (process-mask actor-pause)) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -2217,7 +2062,7 @@ ) (set! (-> arg0 root trans z) 9999999.0) (set! (-> arg0 root trans w) 1.0) - (set-vector! (-> arg0 root scale) (inc-value arg1) (dec-value arg1) (inc-value arg1) 1.0) + (set-vector! (-> arg0 root scale) (get-icon-scale-x arg1) (get-icon-scale-y arg1) (get-icon-scale-x arg1) 1.0) (set! (-> arg0 draw dma-add-func) dma-add-process-drawable-hud) (go hud-collecting (process->handle arg1)) ) diff --git a/goal_src/engine/ui/hud-h.gc b/goal_src/engine/ui/hud-h.gc index cc3e73dfca..49a777bdd4 100644 --- a/goal_src/engine/ui/hud-h.gc +++ b/goal_src/engine/ui/hud-h.gc @@ -5,17 +5,15 @@ ;; name in dgo: hud-h ;; dgos: GAME, ENGINE -;; TODO - for assistant-firecanyon | process-taskable -(define-extern hide-hud (function none)) -;; TODO - for static-screen -(define-extern hide-hud-quick (function none)) -;; TODO - for process-taskable -(define-extern hud-hidden? (function symbol)) - (define-extern activate-hud (function process none)) (define-extern activate-orb-all (function int int)) +(define-extern hide-hud (function none)) +(define-extern hide-hud-quick (function none)) (define-extern hide-bottom-hud (function none)) +(define-extern hud-hidden? (function symbol)) (define-extern bottom-hud-hidden? (function symbol)) +(define-extern enable-hud (function none)) +(define-extern disable-hud (function int none)) (declare-type hud process) (declare-type hud-pickups hud) @@ -28,10 +26,6 @@ (declare-type hud-bike-heat hud) (declare-type hud-money-all hud) -;; TODO - for target2 -(define-extern enable-hud (function none)) -(define-extern disable-hud (function int none)) - ;; DECOMP BEGINS (deftype hud-icon (basic) @@ -93,19 +87,19 @@ :size-assert #x118 :flag-assert #x1b00b00118 (:methods - (dummy-14 (_type_) symbol 14) - (dummy-15 (_type_) none 15) - (TODO-RENAME-16 (_type_ int int) none 16) - (dummy-17 (_type_) none 17) - (dummy-18 (_type_) none 18) - (TODO-RENAME-19 (_type_) none 19) + (hidden? (_type_) symbol 14) + (draw-hud (_type_) none 15) + (tally-value (_type_ int int) none 16) + (draw-icons (_type_) none 17) + (draw-particles (_type_) none 18) + (hud-update (_type_) none 19) (init-particles! (_type_ int) none 20) - (first-icon-x (_type_) int 21) - (first-icon-y (_type_) int 22) - (dummy-23 (_type_) none 23) - (animate! (_type_ symbol symbol) none 24) - (inc-value (_type_) float 25) - (dec-value (_type_) float 26) + (get-icon-pos-x (_type_) int 21) + (get-icon-pos-y (_type_) int 22) + (dummy-23 (_type_) none 23) ;; unused + (set-pos-and-scale (_type_ symbol symbol) none 24) + (get-icon-scale-x (_type_) float 25) + (get-icon-scale-y (_type_) float 26) ) (:states hud-arriving @@ -126,7 +120,7 @@ (bike-speed (pointer hud-bike-speed) :offset-assert 24) (bike-heat (pointer hud-bike-heat) :offset-assert 28) (money-all (pointer hud-money-all) :offset-assert 32) - (parts (pointer process) 9 :offset 0) + (parts (pointer hud) 9 :offset 0) ) :method-count-assert 9 :size-assert #x24 diff --git a/goal_src/engine/ui/hud.gc b/goal_src/engine/ui/hud.gc index 25338706f4..5822000d4f 100644 --- a/goal_src/engine/ui/hud.gc +++ b/goal_src/engine/ui/hud.gc @@ -19,7 +19,7 @@ (defmethod deactivate hud ((obj hud)) (dotimes (v1-0 9) (if (and (-> *hud-parts* parts v1-0) (= (ppointer->process (-> *hud-parts* parts v1-0)) obj)) - (set! (-> *hud-parts* parts v1-0) (the-as (pointer process) #f)) + (set! (-> *hud-parts* parts v1-0) (the-as (pointer hud) #f)) ) ) (dotimes (s5-0 (-> obj nb-of-particles)) @@ -30,8 +30,8 @@ (none) ) -(defmethod dummy-15 hud ((obj hud)) - (when (and (not (dummy-14 obj)) (not (paused?))) +(defmethod draw-hud hud ((obj hud)) + (when (and (not (hidden? obj)) (not (paused?))) (dotimes (s5-0 (-> obj nb-of-particles)) (when (!= s5-0 (-> obj skip-particle)) (if (or (!= (-> obj particles 0 pos x) 0.0) (!= (-> obj particles 0 pos y) 0.0)) @@ -44,7 +44,7 @@ (none) ) -(defmethod TODO-RENAME-16 hud ((obj hud) (arg0 int) (arg1 int)) +(defmethod tally-value hud ((obj hud) (arg0 int) (arg1 int)) (if (= arg0 (-> obj target-value)) (set! (-> obj last-target-equal-time) (-> *display* base-frame-counter)) ) @@ -53,7 +53,7 @@ (not (movie?)) (>= (- (-> *display* base-frame-counter) (-> *game-info* letterbox-time)) (seconds 0.1)) (>= (- (-> *display* base-frame-counter) (-> *game-info* blackout-time)) (seconds 0.1)) - (not (and *target* (logtest? (-> *target* state-flags) 256))) + (not (and *target* (logtest? (-> *target* state-flags) (state-flags grabbed)))) ) ) (when (or (!= (-> obj value) arg0) @@ -73,7 +73,7 @@ (when (and (!= (-> obj value) (-> obj target-value)) (>= (- (-> *display* base-frame-counter) (-> obj last-increment-time)) (seconds 0.1)) ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (+! (-> obj value) 1) (set! (-> obj last-increment-time) (-> *display* base-frame-counter)) ) @@ -104,7 +104,7 @@ (none) ) -(defmethod dummy-17 hud ((obj hud)) +(defmethod draw-icons hud ((obj hud)) (dotimes (v1-0 (-> obj nb-of-icons)) (set-vector! (-> obj icons v1-0 icon 0 root scale) @@ -133,7 +133,7 @@ (none) ) -(defmethod dummy-18 hud ((obj hud)) +(defmethod draw-particles hud ((obj hud)) (dotimes (s5-0 (-> obj nb-of-particles)) (when (!= (-> obj skip-particle) -2) (set! (-> obj particles s5-0 pos x) @@ -174,7 +174,7 @@ (none) ) -(defmethod TODO-RENAME-19 hud ((obj hud)) +(defmethod hud-update hud ((obj hud)) 0 (none) ) @@ -184,34 +184,33 @@ (none) ) -(defmethod first-icon-x hud ((obj hud)) +(defmethod get-icon-pos-x hud ((obj hud)) 0 ) -(defmethod first-icon-y hud ((obj hud)) +(defmethod get-icon-pos-y hud ((obj hud)) 0 ) -(defmethod inc-value hud ((obj hud)) +(defmethod get-icon-scale-x hud ((obj hud)) 0.0 ) -(defmethod dec-value hud ((obj hud)) +(defmethod get-icon-scale-y hud ((obj hud)) 0.0 ) -(defmethod animate! hud ((obj hud) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud ((obj hud) (arg0 symbol) (arg1 symbol)) 0 (none) ) -(defmethod dummy-14 hud ((obj hud)) +(defmethod hidden? hud ((obj hud)) (= (-> obj next-state name) 'hud-hidden) ) (defstate hud-hidden (hud) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('show) @@ -250,11 +249,10 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self offset) 128) - (dummy-17 self) - (dummy-18 self) + (draw-icons self) + (draw-particles self) (let ((gp-0 (-> self child))) (while gp-0 (send-event (ppointer->process gp-0) 'draw #f) @@ -267,41 +265,37 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self y-offset) (-> self next-y-offset)) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) - (while #t + (loop (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (if (-> self deactivate-when-hidden) (deactivate self) ) - (TODO-RENAME-19 self) + (hud-update self) (none) ) ) (defstate hud-arriving (hud) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-3 object)) (case arg2 (('hide-quick) (set! (-> self last-hide-time) (-> *display* base-frame-counter)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) - (dummy-18 self) - (dummy-17 self) - (TODO-RENAME-19 self) + (draw-particles self) + (draw-icons self) + (hud-update self) (go hud-hidden) ) (('hide) @@ -335,8 +329,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (let ((gp-0 (-> self child))) (while gp-0 (send-event (ppointer->process gp-0) 'draw #t) @@ -350,13 +343,12 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (not (paused?)) - (set! (-> self offset) (seekl (-> self offset) 0 (the int (* 15.0 (-> *display* time-adjust-ratio))))) + (seekl! (-> self offset) 0 (the int (* 15.0 (-> *display* time-adjust-ratio)))) ) - (dummy-17 self) + (draw-icons self) (if (<= (-> self offset) 0) (go hud-in) ) @@ -364,70 +356,62 @@ (set! (-> self last-hide-time) (-> *display* base-frame-counter)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) - (dummy-18 self) - (dummy-17 self) - (TODO-RENAME-19 self) + (draw-particles self) + (draw-icons self) + (hud-update self) (go hud-hidden) ) (suspend) ) (none) ) - :post - (behavior () - (TODO-RENAME-19 self) - (dummy-18 self) - (dummy-15 self) + :post (behavior () + (hud-update self) + (draw-particles self) + (draw-hud self) (none) ) ) (defstate hud-in (hud) - :event - (-> hud-arriving event) - :code - (behavior () + :event (-> hud-arriving event) + :code (behavior () (set! (-> self trigger-time) (-> *display* base-frame-counter)) (while (and (< (- (-> *display* base-frame-counter) (-> self trigger-time)) (seconds 2)) (not (movie?))) (set! (-> self offset) 0) - (dummy-17 self) + (draw-icons self) (suspend) ) (when (movie?) (set! (-> self last-hide-time) (-> *display* base-frame-counter)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) - (dummy-18 self) - (dummy-17 self) - (TODO-RENAME-19 self) + (draw-particles self) + (draw-icons self) + (hud-update self) (go hud-hidden) ) (go hud-leaving 5) (none) ) - :post - (-> hud-arriving post) + :post (-> hud-arriving post) ) (defstate hud-leaving (hud) - :event - (-> hud-arriving event) - :code - (behavior ((arg0 int)) - (while #t + :event (-> hud-arriving event) + :code (behavior ((arg0 int)) + (loop (if (not (paused?)) - (set! (-> self offset) - (seekl (-> self offset) 128 (the int (* (the float arg0) (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self offset) 128 (the int (* (the float arg0) (-> *display* time-adjust-ratio)))) ) - (dummy-17 self) + (draw-icons self) (when (movie?) (set! (-> self last-hide-time) (-> *display* base-frame-counter)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) - (dummy-18 self) - (dummy-17 self) - (TODO-RENAME-19 self) + (draw-particles self) + (draw-icons self) + (hud-update self) (go hud-hidden) ) (if (>= (-> self offset) 128) @@ -437,8 +421,7 @@ ) (none) ) - :post - (-> hud-arriving post) + :post (-> hud-arriving post) ) (defbehavior hud-init-by-other hud ((arg0 int)) @@ -460,8 +443,8 @@ (logior! (-> self mask) (process-mask menu)) (logclear! (-> self mask) (process-mask pause progress)) (init-particles! self arg0) - (dummy-17 self) - (dummy-18 self) + (draw-icons self) + (draw-particles self) (go hud-hidden) (none) ) @@ -472,9 +455,8 @@ ) ) -(defstate hud-collecting (collectable) - :trans - (behavior () +(defstate hud-collecting (process-drawable) + :trans (behavior () (case (-> self type) ((fuel-cell) (fuel-cell-animate) @@ -482,23 +464,21 @@ ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (handle->process arg0))) - (set! (-> s5-0 x) (- (the float (+ (first-icon-x (the-as hud s4-0)) -256)) (-> self root-override trans x))) - (set! (-> s5-0 y) (- (the float (- (first-icon-y (the-as hud s4-0)) (-> *video-parms* screen-sy))) - (-> self root-override trans y) - ) + (set! (-> s5-0 x) (- (the float (+ (get-icon-pos-x (the-as hud s4-0)) -256)) (-> self root trans x))) + (set! (-> s5-0 y) + (- (the float (- (get-icon-pos-y (the-as hud s4-0)) (-> *video-parms* screen-sy))) (-> self root trans y)) ) ) (let ((f30-0 4.0) (f26-0 0.0) - (f28-0 (-> self root-override scale x)) - (f24-0 (-> self root-override scale y)) - (f22-0 (-> self root-override scale z)) + (f28-0 (-> self root scale x)) + (f24-0 (-> self root scale y)) + (f22-0 (-> self root scale z)) ) - (while #t + (loop (let ((f0-7 (* f30-0 (-> *display* seconds-per-frame)))) (+! f26-0 f0-7) (when (< 1.0 f26-0) @@ -507,17 +487,17 @@ ) (set! f26-0 1.0) ) - (+! (-> self root-override trans x) (* f0-7 (-> s5-0 x))) - (+! (-> self root-override trans y) (* f0-7 (-> s5-0 y))) + (+! (-> self root trans x) (* f0-7 (-> s5-0 x))) + (+! (-> self root trans y) (* f0-7 (-> s5-0 y))) ) (set-vector! - (-> self root-override scale) + (-> self root scale) (* f28-0 (-> *video-parms* relative-x-scale)) (* f24-0 (-> *video-parms* relative-y-scale) (-> *video-parms* relative-y-scale)) (* f22-0 (-> *video-parms* relative-x-scale)) 1.0 ) - (let ((a0-12 (-> self root-override))) + (let ((a0-12 (-> self root))) (set-yaw-angle-clear-roll-pitch! a0-12 (- (y-angle a0-12) (* 182.04445 (* 8.0 (-> *display* time-adjust-ratio)))) @@ -533,8 +513,7 @@ ) (none) ) - :post - (the-as (function none :behavior collectable) ja-post) + :post ja-post ) diff --git a/goal_src/engine/ui/progress-h.gc b/goal_src/engine/ui/progress-h.gc index 555baa45cb..d16e803fa4 100644 --- a/goal_src/engine/ui/progress-h.gc +++ b/goal_src/engine/ui/progress-h.gc @@ -5,68 +5,167 @@ ;; name in dgo: progress-h ;; dgos: GAME, ENGINE +;; PC port adds new menus and option types +(#cond + ((not PC_PORT) + (defenum progress-screen + :type int64 + (invalid -1) + (fuel-cell 0) + (money 1) + (buzzer 2) + (settings 3) + (game-settings 4) + (graphic-settings 5) + (sound-settings 6) + (memcard-no-space 7) + (memcard-not-inserted 8) + (memcard-not-formatted 9) + (memcard-format 10) + (memcard-data-exists 11) + (memcard-loading 12) + (memcard-saving 13) + (memcard-formatting 14) + (memcard-creating 15) + (load-game 16) + (save-game 17) + (save-game-title 18) + (memcard-insert 19) + (memcard-error-loading 20) + (memcard-error-saving 21) + (memcard-removed 22) + (memcard-no-data 23) + (memcard-error-formatting 24) + (memcard-error-creating 25) + (memcard-auto-save-error 26) + (title 27) + (settings-title 28) + (auto-save 29) + (pal-change-to-60hz 30) + (pal-now-60hz 31) + (no-disc 32) + (bad-disc 33) + (quit 34) + (max 35) + ) -(defenum progress-screen - :type int64 - (invalid -1) - (fuel-cell 0) - (money 1) - (buzzer 2) - (settings 3) - (game-settings 4) - (graphic-settings 5) - (sound-settings 6) - (memcard-no-space 7) - (memcard-not-inserted 8) - (memcard-not-formatted 9) - (memcard-format 10) - (memcard-data-exists 11) - (memcard-loading 12) - (memcard-saving 13) - (memcard-formatting 14) - (memcard-creating 15) - (load-game 16) - (save-game 17) - (save-game-title 18) - (memcard-insert 19) - (memcard-error-loading 20) - (memcard-error-saving 21) - (memcard-removed 22) - (memcard-no-data 23) - (memcard-error-formatting 24) - (memcard-error-creating 25) - (memcard-auto-save-error 26) - (title 27) - (settings-title 28) - (auto-save 29) - (pal-change-to-60hz 30) - (pal-now-60hz 31) - (no-disc 32) - (bad-disc 33) - (quit 34) + (defenum game-option-type + :type uint64 + (slider 0) + (language 1) + (on-off 2) + (center-screen 3) + (aspect-ratio 4) + (video-mode 5) + (menu 6) + (yes-no 7) + (button 8) + ) + ) + (#t + (defenum progress-screen + :type int64 + (invalid -1) + (fuel-cell 0) + (money 1) + (buzzer 2) + (settings 3) + (game-settings 4) + (graphic-settings 5) + (sound-settings 6) + (memcard-no-space 7) + (memcard-not-inserted 8) + (memcard-not-formatted 9) + (memcard-format 10) + (memcard-data-exists 11) + (memcard-loading 12) + (memcard-saving 13) + (memcard-formatting 14) + (memcard-creating 15) + (load-game 16) + (save-game 17) + (save-game-title 18) + (memcard-insert 19) + (memcard-error-loading 20) + (memcard-error-saving 21) + (memcard-removed 22) + (memcard-no-data 23) + (memcard-error-formatting 24) + (memcard-error-creating 25) + (memcard-auto-save-error 26) + (title 27) + (settings-title 28) + (auto-save 29) + (pal-change-to-60hz 30) + (pal-now-60hz 31) + (no-disc 32) + (bad-disc 33) + (quit 34) + + ;; extra screens for pc port + (camera-options) + (accessibility-options) + (game-ps2-options) + (misc-options) + (resolution) + (aspect-msg) + (aspect-ratio) + (gfx-ps2-options) + (secrets) + (hint-log) + (cheats) + (scrapbook) + (music-player) + (scene-player) + (credits) + (quit-title) + (flava-player) + + ;; the last one! + (max) + ) + + (defenum game-option-type + :type uint64 + (slider 0) + (language 1) + (on-off 2) + (center-screen 3) + (aspect-ratio 4) + (video-mode 5) + (menu 6) + (yes-no 7) + (button 8) + + ;; extra types for pc port + (normal-inverted) + (display-mode) + (msaa) + (frame-rate) + (lod-bg) + (lod-fg) + (resolution) + (aspect-new) + (language-subtitles) + (speaker) + (aspect-native) + (button-music) + (button-flava) + ) + ) ) +(defenum game-option-menu + :type int32 + :copy-entries progress-screen) + (defun-extern activate-progress process progress-screen none) (defun-extern hide-progress-screen none) (defun-extern hide-progress-icons none) -(declare-type level-tasks-info basic) - -(define-extern *level-task-data* (array level-tasks-info)) -(define-extern *level-task-data-remap* (array int32)) - -(declare-type count-info structure) - -(defun-extern get-game-count int count-info) (defun-extern progress-allowed? symbol) (defun-extern pause-allowed? symbol) -(declare-type progress process) - -(defun-extern deactivate-progress none) -(defun-extern calculate-completion progress float) -(defun-extern make-current-level-available-to-progress none) - ;; DECOMP BEGINS (deftype count-info (structure) @@ -115,13 +214,13 @@ (deftype game-option (basic) - ((option-type uint64 :offset-assert 8) - (name game-text-id :offset-assert 16) - (scale basic :offset-assert 20) - (param1 float :offset-assert 24) - (param2 float :offset-assert 28) - (param3 int32 :offset-assert 32) - (value-to-modify pointer :offset-assert 36) + ((option-type game-option-type :offset-assert 8) + (name game-text-id :offset-assert 16) + (scale symbol :offset-assert 20) + (param1 float :offset-assert 24) + (param2 float :offset-assert 28) + (param3 game-option-menu :offset-assert 32) + (value-to-modify pointer :offset-assert 36) ) :method-count-assert 9 :size-assert #x28 @@ -148,8 +247,8 @@ (force-transition basic :offset-assert 180) (stat-transition basic :offset-assert 184) (level-transition int32 :offset-assert 188) - (language-selection uint64 :offset-assert 192) - (language-direction basic :offset-assert 200) + (language-selection language-enum :offset-assert 192) + (language-direction symbol :offset-assert 200) (language-transition basic :offset-assert 204) (language-x-offset int32 :offset-assert 208) (sides-x-scale float :offset-assert 212) @@ -190,12 +289,12 @@ :size-assert #x2dc :flag-assert #x3b027002dc (:methods - (dummy-14 (_type_) none 14) - (dummy-15 (_type_) none 15) - (dummy-16 (_type_) none 16) + (progress-dummy-14 (_type_) none 14) ;; unused + (progress-dummy-15 (_type_) none 15) ;; unused + (progress-dummy-16 (_type_) none 16) ;; unused (draw-progress (_type_) none 17) - (dummy-18 () none 18) - (dummy-19 (_type_) symbol 19) + (progress-dummy-18 () none 18) ;; unused + (visible? (_type_) symbol 19) (hidden? (_type_) symbol 20) (adjust-sprites (_type_) none 21) (adjust-icons (_type_) none 22) @@ -205,10 +304,10 @@ (draw-buzzer-screen (_type_ int) none 26) (draw-notice-screen (_type_) none 27) (draw-options (_type_ int int float) none 28) - (dummy-29 (_type_) none 29) + (respond-common (_type_) none 29) (respond-progress (_type_) none 30) - (dummy-31 (_type_) none 31) - (dummy-32 (_type_) symbol 32) + (respond-memcard (_type_) none 31) + (can-go-back? (_type_) symbol 32) (initialize-icons (_type_) none 33) (initialize-particles (_type_) none 34) (draw-memcard-storage-error (_type_ font-context) none 35) @@ -220,16 +319,16 @@ (draw-memcard-auto-save-error (_type_ font-context) none 41) (draw-memcard-removed (_type_ font-context) none 42) (draw-memcard-error (_type_ font-context) none 43) - (dummy-44 (_type_) none 44) + (progress-dummy-44 (_type_) none 44) ;; unused (push! (_type_) none 45) (pop! (_type_) none 46) - (dummy-47 (_type_) none 47) + (progress-dummy-47 (_type_) none 47) ;; unused (enter! (_type_ progress-screen int) none 48) (draw-memcard-format (_type_ font-context) none 49) (draw-auto-save (_type_ font-context) none 50) (set-transition-progress! (_type_ int) none 51) (set-transition-speed! (_type_) none 52) - (dummy-53 (_type_ progress-screen) progress-screen 53) + (set-memcard-screen (_type_ progress-screen) progress-screen 53) (draw-pal-change-to-60hz (_type_ font-context) none 54) (draw-pal-now-60hz (_type_ font-context) none 55) (draw-no-disc (_type_ font-context) none 56) @@ -251,7 +350,15 @@ (define *progress-last-task-index* 0) -0 + +(defun-extern get-game-count int count-info) + +(define-extern *level-task-data* (array level-tasks-info)) +(define-extern *level-task-data-remap* (array int32)) + +(defun-extern deactivate-progress none) +(defun-extern calculate-completion progress float) +(defun-extern make-current-level-available-to-progress none) diff --git a/goal_src/engine/ui/progress/progress-draw.gc b/goal_src/engine/ui/progress/progress-draw.gc index 8235f15f56..43867915f3 100644 --- a/goal_src/engine/ui/progress/progress-draw.gc +++ b/goal_src/engine/ui/progress/progress-draw.gc @@ -598,16 +598,27 @@ (let ((v1-5 arg0)) (set! (-> v1-5 height) (the float 110)) ) - (let ((s4-0 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id insert-memcard) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + ;; PAL patch here + (let ((v1-6 (-> obj card-info))) + (when (and (= (-> *setting-control* default language) (language-enum japanese)) v1-6 (zero? (-> v1-6 handle))) + (set! (-> arg0 origin y) -15.0) + (let ((s4-0 print-game-text-scaled)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id memcard-not-inserted) #f) 1) + (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + ) + (set! (-> arg0 origin y) 53.0) + ) ) - (let ((v1-7 arg0)) - (set! (-> v1-7 scale) 0.65) + (let ((s4-1 print-game-text-scaled)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id insert-memcard) #f) 1) + (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) + ) + (let ((v1-12 arg0)) + (set! (-> v1-12 scale) 0.65) ) (set! (-> arg0 origin y) 130.0) - (let ((v1-8 arg0)) - (set! (-> v1-8 height) (the float 60)) + (let ((v1-13 arg0)) + (set! (-> v1-13 height) (the float 60)) ) (print-game-text-scaled (lookup-text! *common-text* (game-text-id back?) #f) @@ -1462,26 +1473,11 @@ (none) ) -(defun draw-percent-bar ((arg0 int) (arg1 int) (arg2 float) (arg3 int)) - (let* ((s2-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (gp-0 (-> s2-0 base)) - ) +(defun draw-percent-bar ((arg0 int) (arg1 int) (arg2 float) (arg3 rgba)) + (with-dma-buffer-add-bucket ((s2-0 (-> (current-frame) global-buf)) + (bucket-id sprite)) (draw-sprite2d-xy s2-0 arg0 arg1 255 14 (new 'static 'rgba :a #x60)) - (draw-sprite2d-xy s2-0 arg0 (+ arg1 2) (the int (* 255.0 arg2)) 10 (the-as rgba arg3)) - (let ((a3-3 (-> s2-0 base))) - (let ((v1-3 (the-as dma-packet (-> s2-0 base)))) - (set! (-> v1-3 dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> v1-3 vif0) (new 'static 'vif-tag)) - (set! (-> v1-3 vif1) (new 'static 'vif-tag)) - (set! (-> s2-0 base) (&+ (the-as pointer v1-3) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id sprite) - gp-0 - (the-as (pointer dma-tag) a3-3) - ) - ) + (draw-sprite2d-xy s2-0 arg0 (+ arg1 2) (the int (* 255.0 arg2)) 10 arg3) ) 0 (none) @@ -1510,432 +1506,206 @@ ) (defmethod draw-options progress ((obj progress) (arg0 int) (arg1 int) (arg2 float)) - (local-vars - (sv-112 font-context) - (sv-128 int) - (sv-144 int) - (sv-160 (function _varargs_ object)) - (sv-176 string) - (sv-192 string) - (sv-208 string) - (sv-224 (function _varargs_ object)) - (sv-240 string) - (sv-256 string) - (sv-272 string) - (sv-288 (function string font-context symbol int int float)) - (sv-304 (function _varargs_ object)) - (sv-320 (function _varargs_ object)) - (sv-336 string) - (sv-352 string) - (sv-368 string) - (sv-384 (function _varargs_ object)) - (sv-400 string) - (sv-416 string) - (sv-432 string) - (sv-448 uint) - (sv-464 int) - (sv-480 int) - (sv-496 int) - (sv-512 uint) - (sv-528 (function _varargs_ object)) - (sv-544 string) - (sv-560 string) - (sv-576 string) - (sv-592 (function _varargs_ object)) - (sv-608 string) - (sv-624 string) - (sv-640 string) - (sv-656 (function _varargs_ object)) - (sv-672 string) - (sv-688 string) - (sv-704 string) - (sv-720 (function _varargs_ object)) - (sv-736 string) - (sv-752 string) - (sv-768 string) - (sv-784 (function _varargs_ object)) - (sv-800 string) - (sv-816 string) - (sv-832 string) - (sv-848 (function _varargs_ object)) - (sv-864 string) - (sv-880 string) - (sv-896 string) - (sv-912 string) - ) (let ((s3-0 (-> *options-remap* (-> obj display-state)))) (when s3-0 (let ((s2-1 (- arg0 (/ (* arg1 (length s3-0)) 2))) (s1-0 0) + (unkx 27) + (unk2 0) + (font (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning))) ) - 27 - 0 - (set! sv-112 - (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) - ) - (let ((v1-11 sv-112)) - (set! (-> v1-11 width) (the float 350)) - ) - (let ((v1-12 sv-112)) - (set! (-> v1-12 height) (the float 25)) - ) - (set! (-> sv-112 flags) (font-flags shadow kerning middle left large)) + (set-width! font 350) + (set-height! font 25) + (set! (-> font flags) (font-flags shadow kerning middle left large)) (dotimes (s0-0 (length s3-0)) - (set! sv-912 (the-as string #f)) - (set! sv-128 27) - (set! sv-144 s2-1) + (let ((option-str (the string #f)) + (x-off 27) + (y-off s2-1) + ) (let ((v1-18 (-> s3-0 s0-0 option-type))) (cond - ((= v1-18 7) - (cond - ((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (set! sv-160 format) - (set! sv-176 (clear *temp-string*)) - (set! sv-192 "~30L~S~0L ~S") - (set! sv-208 (lookup-text! *common-text* (game-text-id yes) #f)) - (let ((a3-2 (lookup-text! *common-text* (game-text-id no) #f))) - (sv-160 sv-176 sv-192 sv-208 a3-2) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-224 format) - (set! sv-240 (clear *temp-string*)) - (set! sv-256 "~0L~S ~30L~S~1L") - (set! sv-272 (lookup-text! *common-text* (game-text-id yes) #f)) - (let ((a3-3 (lookup-text! *common-text* (game-text-id no) #f))) - (sv-224 sv-240 sv-256 sv-272 a3-3) - ) - (set! sv-912 *temp-string*) - sv-912 + ((= v1-18 (game-option-type yes-no)) + (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) + (set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id yes) #f) (lookup-text! *common-text* (game-text-id no) #f))) + (set! option-str (string-format "~0L~S ~30L~S~1L" (lookup-text! *common-text* (game-text-id yes) #f) (lookup-text! *common-text* (game-text-id no) #f))) ) - ) ) - ((or (= v1-18 6) (= v1-18 8)) + ((or (= v1-18 (game-option-type menu)) (= v1-18 (game-option-type button))) (cond ((nonzero? (-> s3-0 s0-0 name)) - (set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - sv-912 + (set! option-str (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) ) (else - (set! sv-912 (the-as string #f)) - (the-as symbol sv-912) + (set! option-str (the-as string #f)) ) ) ) ((and (-> obj selected-option) (= (-> obj option-index) s0-0)) - (let ((a0-19 sv-112)) - (set! (-> a0-19 color) (font-color default)) - ) - (set! (-> sv-112 origin x) (the float (- sv-128 (-> obj left-x-offset)))) + (set-color! font (font-color default)) + (set! (-> font origin x) (the float (- x-off (-> obj left-x-offset)))) (case (-> s3-0 s0-0 option-type) - ((3) - (set! (-> sv-112 origin y) (the float (+ s2-1 -20))) + (((game-option-type center-screen)) + (set! (-> font origin y) (the float (+ s2-1 -20))) ) (else - (set! (-> sv-112 origin y) (the float (+ s2-1 -8))) + (set! (-> font origin y) (the float (+ s2-1 -8))) ) ) - (let ((v1-64 sv-112)) - (set! (-> v1-64 scale) 0.6) - ) - (set! sv-288 print-game-text) - (let ((a0-23 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - (a1-11 sv-112) - (a2-10 #f) - (a3-4 128) - (t0-1 22) - ) - (sv-288 a0-23 a1-11 a2-10 a3-4 t0-1) - ) + (set-scale! font 0.6) + (print-game-text (lookup-text! *common-text* (-> s3-0 s0-0 name) #f) font #f 128 22) (case (-> s3-0 s0-0 option-type) - ((3) - (set! sv-144 (+ s2-1 3)) - sv-144 + (((game-option-type center-screen)) + (set! y-off (+ s2-1 3)) ) (else - (set! sv-144 (+ s2-1 7)) - sv-144 + (set! y-off (+ s2-1 7)) ) ) - (let ((v1-81 (-> s3-0 s0-0 option-type))) - (cond - ((zero? v1-81) - (let* ((v1-82 (the-as uint #x8000ffff)) - (f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) - (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) - (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) - ) - (draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as int a3-5)) - ) - (set! sv-304 format) - (let ((a0-42 (clear *temp-string*)) - (a1-13 "~D") - (a2-12 (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) - ) - (sv-304 a0-42 a1-13 a2-12) - ) - (set! sv-912 *temp-string*) - (set! sv-128 (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100)) - sv-128 - ) - ((= v1-81 2) - (cond - ((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (set! sv-320 format) - (set! sv-336 (clear *temp-string*)) - (set! sv-352 "~30L~S~0L ~S") - (set! sv-368 (lookup-text! *common-text* (game-text-id on) #f)) - (let ((a3-6 (lookup-text! *common-text* (game-text-id off) #f))) - (sv-320 sv-336 sv-352 sv-368 a3-6) + (case (-> s3-0 s0-0 option-type) + (((game-option-type slider)) + (let* ((v1-82 (the-as uint #x8000ffff)) + (f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) + (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) + (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-384 format) - (set! sv-400 (clear *temp-string*)) - (set! sv-416 "~0L~S ~30L~S~1L") - (set! sv-432 (lookup-text! *common-text* (game-text-id on) #f)) - (let ((a3-7 (lookup-text! *common-text* (game-text-id off) #f))) - (sv-384 sv-400 sv-416 sv-432 a3-7) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - ) + (draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as rgba a3-5)) ) - ((= v1-81 1) - (set! sv-512 (-> obj language-selection)) - (set! sv-448 (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) - (if (and (zero? (scf-get-territory)) - (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) - ) - (set! sv-464 5) - (set! sv-464 6) - ) - (if (-> obj language-transition) - (set! (-> obj language-x-offset) - (seekl (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio)))) - ) - ) - (when (>= (-> obj language-x-offset) 100) - (set! (-> obj language-selection) sv-448) - (set! sv-512 sv-448) - (set! (-> obj language-transition) #f) - (set! (-> obj language-x-offset) 0) - 0 + (set! option-str (string-format "~D" (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify)))))) + (set! x-off (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100)) + x-off + ) + (((game-option-type on-off)) + (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) + (set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id on) #f) (lookup-text! *common-text* (game-text-id off) #f))) + (set! option-str (string-format "~0L~S ~30L~S~1L" (lookup-text! *common-text* (game-text-id on) #f) (lookup-text! *common-text* (game-text-id off) #f))) ) - (set! (-> sv-112 origin y) (the float (+ s2-1 3))) - (let ((a0-62 sv-112)) - (set! (-> a0-62 color) (font-color lighter-lighter-blue)) - ) - 0 - (set! sv-480 (mod (the-as int (+ sv-512 1)) sv-464)) - (let ((a0-66 (mod (+ sv-464 -1 sv-512) sv-464)) - (v1-153 (mod (the-as int (+ sv-512 2)) sv-464)) - ) - (set! sv-496 (mod (+ sv-464 -2 sv-512) sv-464)) - (cond - ((-> obj language-direction) - (let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100)))) - (print-language-name a0-66 sv-112 a2-22 #f) - ) - (let ((a2-23 (+ (-> obj language-x-offset) 100))) - (cond - ((< a2-23 150) - (let ((t9-27 print-language-name) - (a1-30 sv-112) - (a3-9 #t) - ) - (t9-27 sv-480 a1-30 a2-23 a3-9) - ) - ) - (else - (let ((a2-24 (- 200 (-> obj language-x-offset))) - (t9-28 print-language-name) - (a1-31 sv-112) - (a3-10 #f) - ) - (t9-28 sv-496 a1-31 a2-24 a3-10) - ) + ) + (((game-option-type language)) + (let ((old-lang (-> obj language-selection)) + (new-lang (-> (the-as (pointer language-enum) (-> s3-0 s0-0 value-to-modify)))) + (max-lang (if (and (= (scf-get-territory) GAME_TERRITORY_SCEA) + (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))) + 5 + 6 + )) + ) + (if (-> obj language-transition) + (seekl! (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio))))) + (when (>= (-> obj language-x-offset) 100) + (set! (-> obj language-selection) new-lang) + (set! old-lang new-lang) + (set! (-> obj language-transition) #f) + (set! (-> obj language-x-offset) 0) + ) + (set! (-> font origin y) (the float (+ s2-1 3))) + (set-color! font (font-color lighter-lighter-blue)) + 0 + (let ((next-lang (mod (+ old-lang 1) max-lang)) + (a0-66 (mod (+ max-lang -1 old-lang) max-lang)) + (v1-153 (mod (+ old-lang 2) max-lang)) + (prev-lang (mod (+ max-lang -2 old-lang) max-lang)) + ) + (cond + ((-> obj language-direction) + (let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100)))) + (print-language-name a0-66 font a2-22 #f) + ) + (let ((a2-23 (+ (-> obj language-x-offset) 100))) + (cond + ((< a2-23 150) + (print-language-name (the int next-lang) font a2-23 #t) + ) + (else + (let ((a2-24 (- 200 (-> obj language-x-offset)))) + (print-language-name prev-lang font a2-24 #f) ) ) ) ) - (else - (let ((a2-25 (+ (-> obj language-x-offset) 100))) - (cond - ((< a2-25 150) - (print-language-name a0-66 sv-112 a2-25 #f) - ) - (else - (let ((a2-26 (- 200 (-> obj language-x-offset)))) - (print-language-name v1-153 sv-112 a2-26 #t) - ) + ) + (else + (let ((a2-25 (+ (-> obj language-x-offset) 100))) + (cond + ((< a2-25 150) + (print-language-name a0-66 font a2-25 #f) + ) + (else + (let ((a2-26 (- 200 (-> obj language-x-offset)))) + (print-language-name (the int v1-153) font a2-26 #t) ) ) ) - (let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100)))) - (print-language-name sv-480 sv-112 a2-27 #t) - ) + ) + (let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100)))) + (print-language-name (the int next-lang) font a2-27 #t) ) ) ) - (when (not (-> obj language-transition)) - (let ((a0-75 sv-112)) - (set! (-> a0-75 color) (font-color yellow-green-2)) - ) - ) - (let ((t9-32 print-language-name) - (a1-37 sv-112) - (a2-28 (-> obj language-x-offset)) - (a3-14 (-> obj language-direction)) - ) - (t9-32 (the-as int sv-512) a1-37 a2-28 (the-as symbol a3-14)) - ) ) - ((= v1-81 3) - (set! sv-912 (lookup-text! *common-text* (game-text-id move-dpad) #f)) - sv-912 - ) - ((= v1-81 4) - (cond - ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'aspect4x3) - (set! sv-528 format) - (set! sv-544 (clear *temp-string*)) - (set! sv-560 "~30L~S~0L ~S") - (set! sv-576 (lookup-text! *common-text* (game-text-id 4x3) #f)) - (let ((a3-15 (lookup-text! *common-text* (game-text-id 16x9) #f))) - (sv-528 sv-544 sv-560 sv-576 a3-15) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-592 format) - (set! sv-608 (clear *temp-string*)) - (set! sv-624 "~0L~S ~30L~S~1L") - (set! sv-640 (lookup-text! *common-text* (game-text-id 4x3) #f)) - (let ((a3-16 (lookup-text! *common-text* (game-text-id 16x9) #f))) - (sv-592 sv-608 sv-624 sv-640 a3-16) - ) - (set! sv-912 *temp-string*) - sv-912 - ) + (if (not (-> obj language-transition)) + (set-color! font (font-color yellow-green-2))) + (print-language-name (the-as int old-lang) font (-> obj language-x-offset) (-> obj language-direction)) + )) + (((game-option-type center-screen)) + (set! option-str (lookup-text! *common-text* (game-text-id move-dpad) #f)) + ) + (((game-option-type aspect-ratio)) + (if (= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'aspect4x3) + (set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id 4x3) #f) (lookup-text! *common-text* (game-text-id 16x9) #f))) + (set! option-str (string-format "~0L~S ~30L~S~1L" (lookup-text! *common-text* (game-text-id 4x3) #f) (lookup-text! *common-text* (game-text-id 16x9) #f))) ) - ) - ((= v1-81 5) - (cond - ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'ntsc) - (set! sv-656 format) - (set! sv-672 (clear *temp-string*)) - (set! sv-688 "~0L~S ~30L~S~1L") - (set! sv-704 (lookup-text! *common-text* (game-text-id 50hz) #f)) - (let ((a3-17 (lookup-text! *common-text* (game-text-id 60hz) #f))) - (sv-656 sv-672 sv-688 sv-704 a3-17) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-720 format) - (set! sv-736 (clear *temp-string*)) - (set! sv-752 "~30L~S~0L ~S") - (set! sv-768 (lookup-text! *common-text* (game-text-id 50hz) #f)) - (let ((a3-18 (lookup-text! *common-text* (game-text-id 60hz) #f))) - (sv-720 sv-736 sv-752 sv-768 a3-18) - ) - (set! sv-912 *temp-string*) - sv-912 - ) + ) + (((game-option-type video-mode)) + (if (= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'ntsc) + (set! option-str (string-format "~0L~S ~30L~S~1L" (lookup-text! *common-text* (game-text-id 50hz) #f) (lookup-text! *common-text* (game-text-id 60hz) #f))) + (set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id 50hz) #f) (lookup-text! *common-text* (game-text-id 60hz) #f))) ) - ) - ) + ) ) ) (else - (let ((v1-195 (-> s3-0 s0-0 option-type))) - (cond - ((or (zero? v1-195) (= v1-195 3) (= v1-195 4) (= v1-195 5)) - (set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - sv-912 - ) - ((= v1-195 2) - (set! sv-784 format) - (set! sv-800 (clear *temp-string*)) - (set! sv-816 "~S: ~S") - (set! sv-832 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - (let ((a3-19 (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (lookup-text! *common-text* (game-text-id on) #f) - (lookup-text! *common-text* (game-text-id off) #f) - ) - ) - ) - (sv-784 sv-800 sv-816 sv-832 a3-19) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - ((= v1-195 1) - (set! sv-848 format) - (set! sv-864 (clear *temp-string*)) - (set! sv-880 "~S: ~S") - (set! sv-896 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - (let ((a3-20 (lookup-text! - *common-text* - (-> *language-name-remap* (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) - #f - ) - ) - ) - (sv-848 sv-864 sv-880 sv-896 a3-20) - ) - (set! sv-912 *temp-string*) - sv-912 - ) + (case (-> s3-0 s0-0 option-type) + (((game-option-type slider) + (game-option-type center-screen) + (game-option-type aspect-ratio) + (game-option-type video-mode) ) + (set! option-str (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) + ) + (((game-option-type on-off)) + (set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> s3-0 s0-0 name) #f) + (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) + (lookup-text! *common-text* (game-text-id on) #f) + (lookup-text! *common-text* (game-text-id off) #f) + ))) + ) + (((game-option-type language)) + (set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> s3-0 s0-0 name) #f) + (lookup-text! *common-text* (-> *language-name-remap* (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) #f))) + ) ) ) ) ) - (when sv-912 + (when option-str (let ((f0-23 (-> obj transition-percentage-invert))) - (let ((v1-235 sv-112)) - (set! (-> v1-235 color) - (the-as font-color (if (and (= s0-0 (-> obj option-index)) (not (-> obj in-transition))) - 30 - 0 - ) - ) + (set-color! font (if (and (= s0-0 (-> obj option-index)) (not (-> obj in-transition))) + (font-color yellow-green-2) + (font-color default) + ) ) - ) - (set! (-> sv-112 origin x) (the float (- sv-128 (-> obj left-x-offset)))) - (set! (-> sv-112 origin y) (the float (the int (* (the float sv-144) (if (-> s3-0 s0-0 scale) + (set! (-> font origin x) (the float (- x-off (-> obj left-x-offset)))) + (set! (-> font origin y) (the float (the int (* (the float y-off) (if (-> s3-0 s0-0 scale) f0-23 1.0 - ) - ) - ) - ) - ) - (let ((v1-246 sv-112)) - (set! (-> v1-246 scale) (* arg2 f0-23)) - ) - (let ((t9-60 print-game-text) - (a1-64 sv-112) - (a2-50 #f) - (a3-21 (the int (* 128.0 f0-23))) - (t0-2 22) - ) - (t9-60 sv-912 a1-64 a2-50 a3-21 t0-2) - ) + ))))) + (set-scale! font (* arg2 f0-23)) + (print-game-text option-str font #f (the int (* 128.0 f0-23)) 22) ) ) (+! s2-1 arg1) (+! s1-0 1) - ) + )) ) ) ) @@ -2002,7 +1772,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-4) ) @@ -2111,7 +1881,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-4 (the-as (pointer dma-tag) a3-9) ) @@ -2156,3 +1926,4 @@ + diff --git a/goal_src/engine/ui/progress/progress-part.gc b/goal_src/engine/ui/progress/progress-part.gc index 90168e6b6d..386f847779 100644 --- a/goal_src/engine/ui/progress/progress-part.gc +++ b/goal_src/engine/ui/progress/progress-part.gc @@ -206,133 +206,116 @@ :id 85 :flags (use-local-clock screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 332 :flags (launch-asap))) + :parts ((sp-item 332 :flags (launch-asap))) ) (defpartgroup group-part-progress-hud-next :id 86 :flags (use-local-clock screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 333 :flags (launch-asap))) + :parts ((sp-item 333 :flags (launch-asap))) ) (defpartgroup group-part-progress-hud-selector :id 87 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 334 :flags (launch-asap))) + :parts ((sp-item 334 :flags (launch-asap))) ) (defpartgroup group-part-progress-hud-left :id 88 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 335 :flags (launch-asap))) + :parts ((sp-item 335 :flags (launch-asap))) ) (defpartgroup group-part-progress-hud-right :id 89 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 336 :flags (launch-asap))) + :parts ((sp-item 336 :flags (launch-asap))) ) (defpartgroup group-part-progress-hud-tint :id 90 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 337 :flags (launch-asap))) + :parts ((sp-item 337 :flags (launch-asap))) ) (defpartgroup group-part-progress-card-cell :id 91 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2190 :flags (launch-asap)) (sp-item 2191 :flags (launch-asap)) (sp-item 2192 :flags (launch-asap))) + :parts ((sp-item 2190 :flags (launch-asap)) (sp-item 2191 :flags (launch-asap)) (sp-item 2192 :flags (launch-asap))) ) (defpartgroup group-part-progress-button-x :id 570 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2336 :flags (launch-asap))) + :parts ((sp-item 2336 :flags (launch-asap))) ) (defpartgroup group-part-progress-button-square :id 571 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2337 :flags (launch-asap))) + :parts ((sp-item 2337 :flags (launch-asap))) ) (defpartgroup group-part-progress-button-triangle :id 572 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2338 :flags (launch-asap))) + :parts ((sp-item 2338 :flags (launch-asap))) ) (defpartgroup group-part-progress-button-circle :id 573 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2339 :flags (launch-asap))) + :parts ((sp-item 2339 :flags (launch-asap))) ) (defpartgroup group-part-progress-card-slot-01 :id 92 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2142 :flags (launch-asap))) + :parts ((sp-item 2142 :flags (launch-asap))) ) (defpartgroup group-part-progress-card-slot-02 :id 93 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2143 :flags (launch-asap))) + :parts ((sp-item 2143 :flags (launch-asap))) ) (defpartgroup group-part-progress-card-slot-03 :id 94 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2144 :flags (launch-asap))) + :parts ((sp-item 2144 :flags (launch-asap))) ) (defpartgroup group-part-progress-card-slot-04 :id 95 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2145 :flags (launch-asap))) + :parts ((sp-item 2145 :flags (launch-asap))) ) (defpartgroup group-part-progress-hud-power-cell-center :id 96 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 338 :flags (launch-asap))) + :parts ((sp-item 338 :flags (launch-asap))) ) (defpart 337 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 15)) (sp-flt spt-scale-y (meters 11.5)) @@ -347,8 +330,7 @@ ) (defpart 2190 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6e :page #x1cf)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6e :page #x1cf)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.8)) (sp-copy-from-other spt-scale-y -4) @@ -363,8 +345,7 @@ ) (defpart 2191 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6d :page #x1cf)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6d :page #x1cf)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 1.05)) (sp-flt spt-scale-x (meters 0.8)) @@ -380,8 +361,7 @@ ) (defpart 2192 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6c :page #x1cf)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6c :page #x1cf)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2.3)) (sp-flt spt-scale-x (meters 0.8)) @@ -397,8 +377,7 @@ ) (defpart 2336 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.6)) (sp-copy-from-other spt-scale-y -4) @@ -413,8 +392,7 @@ ) (defpart 2337 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.6)) (sp-copy-from-other spt-scale-y -4) @@ -429,8 +407,7 @@ ) (defpart 2338 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x7 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.6)) (sp-copy-from-other spt-scale-y -4) @@ -445,8 +422,7 @@ ) (defpart 2339 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.6)) (sp-copy-from-other spt-scale-y -4) @@ -461,8 +437,7 @@ ) (defpart 2142 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 9.2)) (sp-flt spt-scale-y (meters 2)) @@ -477,8 +452,7 @@ ) (defpart 2143 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 9.2)) (sp-flt spt-scale-y (meters 2)) @@ -493,8 +467,7 @@ ) (defpart 2144 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 9.2)) (sp-flt spt-scale-y (meters 2)) @@ -509,8 +482,7 @@ ) (defpart 2145 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 9.2)) (sp-flt spt-scale-y (meters 2)) @@ -525,8 +497,7 @@ ) (defpart 332 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.2)) (sp-copy-from-other spt-scale-y -4) @@ -540,8 +511,7 @@ ) (defpart 333 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.2)) (sp-copy-from-other spt-scale-y -4) @@ -555,8 +525,7 @@ ) (defpart 334 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.8)) (sp-copy-from-other spt-scale-y -4) @@ -570,8 +539,7 @@ ) (defpart 335 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3.5)) (sp-flt spt-scale-y (meters 13)) @@ -586,8 +554,7 @@ ) (defpart 336 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 6)) (sp-flt spt-scale-y (meters 13)) @@ -602,8 +569,7 @@ ) (defpart 339 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.3)) (sp-copy-from-other spt-scale-y -4) @@ -619,8 +585,7 @@ ) (defpart 340 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.3)) (sp-copy-from-other spt-scale-y -4) @@ -636,8 +601,7 @@ ) (defpart 341 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.3)) (sp-copy-from-other spt-scale-y -4) @@ -653,8 +617,7 @@ ) (defpart 342 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.3)) (sp-copy-from-other spt-scale-y -4) @@ -670,8 +633,7 @@ ) (defpart 343 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.2)) (sp-copy-from-other spt-scale-y -4) @@ -687,8 +649,7 @@ ) (defpart 338 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x30 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x30 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.2)) (sp-copy-from-other spt-scale-y -4) @@ -704,13 +665,11 @@ ) (defpart 344 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) (defpart 345 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-z (meters 0.52734375)) (sp-flt spt-scale-x (meters 0.25)) @@ -735,8 +694,7 @@ ) (defpart 346 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-z (meters 0.52734375)) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.25) 1.0) @@ -760,8 +718,7 @@ ) (defpart 347 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters 0.52734375)) (sp-flt spt-scale-x (meters 2)) @@ -780,8 +737,7 @@ ) (defpart 348 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters 0.52734375)) (sp-flt spt-scale-x (meters 2.4)) @@ -803,8 +759,7 @@ :id 97 :flags (use-local-clock screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 338 :flags (launch-asap)) + :parts ((sp-item 338 :flags (launch-asap)) (sp-item 347 :flags (launch-asap) :period 3600 :length 5) (sp-item 348 :flags (launch-asap) :period 3600 :length 5) (sp-item 343 :flags (launch-asap)) @@ -819,13 +774,11 @@ :id 98 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 1982 :flags (launch-asap) :binding 1981) (sp-item 1981 :flags (start-dead launch-asap))) + :parts ((sp-item 1982 :flags (launch-asap) :binding 1981) (sp-item 1981 :flags (start-dead launch-asap))) ) (defpart 1982 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2.2)) (sp-copy-from-other spt-scale-y -4) @@ -839,8 +792,7 @@ ) (defpart 1981 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 1.3333334)) @@ -863,13 +815,11 @@ :id 99 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 1983 :flags (launch-asap))) + :parts ((sp-item 1983 :flags (launch-asap))) ) (defpart 1983 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2.2)) (sp-copy-from-other spt-scale-y -4) @@ -886,13 +836,11 @@ :id 100 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 1985 :flags (launch-asap) :binding 1984) (sp-item 1984 :flags (start-dead launch-asap))) + :parts ((sp-item 1985 :flags (launch-asap) :binding 1984) (sp-item 1984 :flags (start-dead launch-asap))) ) (defpart 1985 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-copy-from-other spt-scale-y -4) @@ -906,8 +854,7 @@ ) (defpart 1984 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 1.3333334)) @@ -931,13 +878,11 @@ :id 101 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 1986 :flags (launch-asap))) + :parts ((sp-item 1986 :flags (launch-asap))) ) (defpart 1986 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.3)) (sp-copy-from-other spt-scale-y -4) @@ -955,13 +900,11 @@ :id 615 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 2478 :flags (launch-asap))) + :parts ((sp-item 2478 :flags (launch-asap))) ) (defpart 2478 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6b :page #x1cf)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6b :page #x1cf)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.8)) (sp-copy-from-other spt-scale-y -4) @@ -993,8 +936,8 @@ (progress-new-particle :part 90 :x 256.0 :y 224.0 :z 16.0) ;; tint (progress-new-particle :part 88 :x -42.0 :y (#if PC_PORT 256.0 254.0) :z 5.0) ;; left (progress-new-particle :part 89 :x 610.0 :y (#if PC_PORT 256.0 254.0) :z 5.0) ;; right - (progress-new-particle :part 85 :x -320.0 :y 40.0 :z 14.0) - (progress-new-particle :part 86 :x -320.0 :y 400.0 :z 14.0) + (progress-new-particle :part 85 :x -320.0 :y 40.0 :z 14.0) ;; prev + (progress-new-particle :part 86 :x -320.0 :y 400.0 :z 14.0) ;; next (progress-new-particle :part 87 :x -320.0 :y 194.0 :z 15.0) (progress-new-particle :part 97 :x -320.0 :y 194.0 :z 14.0) (progress-new-particle :part 97 :x -320.0 :y 194.0 :z 14.0) @@ -1022,6 +965,10 @@ (progress-new-particle :part 572 :x -320.0 :y 338.0 :z 4.0) (progress-new-particle :part 573 :x -320.0 :y 338.0 :z 4.0) (progress-new-particle :part 615 :x -320.0 :y 180.0 :z 4.0) + (#when PC_PORT + (progress-new-particle :part 85 :x -320.0 :y 32.0 :z 14.0) ;; prev + (progress-new-particle :part 86 :x -320.0 :y 412.0 :z 14.0) ;; next + ) 0 (none) ) diff --git a/goal_src/engine/ui/progress/progress-static.gc b/goal_src/engine/ui/progress/progress-static.gc index 122b5ec991..aa455e7b3c 100644 --- a/goal_src/engine/ui/progress/progress-static.gc +++ b/goal_src/engine/ui/progress/progress-static.gc @@ -9,159 +9,154 @@ ;; options in the start menu options (define *main-options* - (new 'static 'boxed-array :type game-option :length 7 :allocated-length 7 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x6 :name (game-text-id load-game) :scale #t :param3 16) - (new 'static 'game-option :option-type #x6 :name (game-text-id save-game) :scale #t :param3 17) - (new 'static 'game-option :option-type #x6 :name (game-text-id quit-game) :scale #t :param3 34) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id game-options) :scale #t :param3 (game-option-menu game-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id graphic-options) :scale #t :param3 (game-option-menu graphic-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id sound-options) :scale #t :param3 (game-option-menu sound-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id load-game) :scale #t :param3 (game-option-menu load-game)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id save-game) :scale #t :param3 (game-option-menu save-game)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id quit-game) :scale #t :param3 (game-option-menu quit)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *title* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id new-game) :scale #t :param3 18) - (new 'static 'game-option :option-type #x6 :name (game-text-id load-game) :scale #t :param3 16) - (new 'static 'game-option :option-type #x6 :name (game-text-id options) :scale #t :param3 28) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id new-game) :scale #t :param3 (game-option-menu save-game-title)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id load-game) :scale #t :param3 (game-option-menu load-game)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id options) :scale #t :param3 (game-option-menu settings-title)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *options* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id game-options) :scale #t :param3 (game-option-menu game-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id graphic-options) :scale #t :param3 (game-option-menu graphic-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id sound-options) :scale #t :param3 (game-option-menu sound-settings)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *main-options-demo* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id game-options) :scale #t :param3 (game-option-menu game-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id graphic-options) :scale #t :param3 (game-option-menu graphic-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id sound-options) :scale #t :param3 (game-option-menu sound-settings)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *main-options-demo-shared* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id exit-demo) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id game-options) :scale #t :param3 (game-option-menu game-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id graphic-options) :scale #t :param3 (game-option-menu graphic-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id sound-options) :scale #t :param3 (game-option-menu sound-settings)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id exit-demo) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *game-options* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x1 :name (game-text-id language) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) + (new 'static 'game-option :option-type (game-option-type language) :name (game-text-id language) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *game-options-japan* - (new 'static 'boxed-array :type game-option :length 3 :allocated-length 3 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *game-options-demo* - (new 'static 'boxed-array :type game-option :length 3 :allocated-length 3 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *graphic-options* - (new 'static 'boxed-array :type game-option :length 3 :allocated-length 3 - (new 'static 'game-option :option-type #x3 :name (game-text-id center-screen) :scale #t) - (new 'static 'game-option :option-type #x4 :name (game-text-id aspect-ratio) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type center-screen) :name (game-text-id center-screen) :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-ratio) :name (game-text-id aspect-ratio) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *graphic-title-options-pal* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x3 :name (game-text-id center-screen) :scale #t) - (new 'static 'game-option :option-type #x5 :name (game-text-id video-mode) :scale #t) - (new 'static 'game-option :option-type #x4 :name (game-text-id aspect-ratio) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type center-screen) :name (game-text-id center-screen) :scale #t) + (new 'static 'game-option :option-type (game-option-type video-mode) :name (game-text-id video-mode) :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-ratio) :name (game-text-id aspect-ratio) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *sound-options* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :name (game-text-id sfx-volume) :scale #t :param2 100.0) - (new 'static 'game-option :name (game-text-id music-volume) :scale #t :param2 100.0) - (new 'static 'game-option :name (game-text-id speech-volume) :scale #t :param2 100.0) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :name (game-text-id sfx-volume) :scale #t :param2 100.0) + (new 'static 'game-option :name (game-text-id music-volume) :scale #t :param2 100.0) + (new 'static 'game-option :name (game-text-id speech-volume) :scale #t :param2 100.0) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) -(define *yes-no-options* - (new 'static 'boxed-array :type game-option :length 1 :allocated-length 1 - (new 'static 'game-option :option-type #x7 :scale #f) - ) - ) +(define *yes-no-options* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type yes-no) :scale #f) + ) + ) (define *ok-options* - (new 'static 'boxed-array :type game-option :length 1 :allocated-length 1 - (new 'static 'game-option :option-type #x8 :name (game-text-id ok) :scale #f) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id ok) :scale #f) + ) ) (define *load-options* - (new 'static 'boxed-array - :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #f) + ) ) (define *save-options* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #f) + ) ) (define *save-options-title* - (new 'static 'boxed-array - :type game-option :length 6 :allocated-length 6 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id continue-without-saving) :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id continue-without-saving) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #f) + ) ) ;; maps options to a progress screen -(define *options-remap* - (new 'static 'boxed-array :type (array game-option) :length 0 :allocated-length 35) - ) +(define *options-remap* (new 'static 'boxed-array :type (array game-option) :length 0 :allocated-length (#if (not PC_PORT) 35 50))) ;; TODO probably an enum. -;; maps "levels" to the appropriate offset in *level-task-data* +;; maps level-info indices to the appropriate offset in *level-task-data* (define *level-task-data-remap* - (new 'static 'boxed-array :type int32 :length 23 :allocated-length 23 + (new 'static 'boxed-array :type int32 0 1 2 @@ -190,7 +185,7 @@ ;; maps goal language ID to its name string ID (define *language-name-remap* - (new 'static 'boxed-array :type game-text-id :length 6 :allocated-length 6 + (new 'static 'boxed-array :type game-text-id (game-text-id english) (game-text-id french) (game-text-id german) @@ -202,7 +197,7 @@ ;; all level tasks (define *level-task-data* - (new 'static 'boxed-array :type level-tasks-info :length 16 :allocated-length 16 + (new 'static 'boxed-array :type level-tasks-info (new 'static 'level-tasks-info :level-name-id (game-text-id training-level-name) :text-group-index 1 @@ -1364,7 +1359,7 @@ ;; goes down by 24 or 23 every time (define *task-egg-starting-x* - (new 'static 'boxed-array :type int32 :length 9 :allocated-length 9 + (new 'static 'boxed-array :type int32 218 194 171 diff --git a/goal_src/engine/ui/progress/progress.gc b/goal_src/engine/ui/progress/progress.gc index ef35fb5f50..04daef188a 100644 --- a/goal_src/engine/ui/progress/progress.gc +++ b/goal_src/engine/ui/progress/progress.gc @@ -15,7 +15,7 @@ (starting-state progress-screen :offset-assert 24) (last-slot-saved int32 :offset-assert 32) (slider-backup float :offset-assert 36) - (language-backup int64 :offset-assert 40) + (language-backup language-enum :offset-assert 40) (on-off-backup symbol :offset-assert 48) (center-x-backup int32 :offset-assert 52) (center-y-backup int32 :offset-assert 56) @@ -27,14 +27,8 @@ :flag-assert #x900000048 ) -(define *progress-state* - (new 'static 'progress-global-state - :yes-no-choice #f - :which -1 - :last-slot-saved -1 - ) - ) +(define *progress-state* (new 'static 'progress-global-state :yes-no-choice #f :which -1 :last-slot-saved -1)) (defun get-game-count ((arg0 int)) (-> *game-counts* data arg0) @@ -55,6 +49,7 @@ (not (send-event (handle->process (-> *game-info* auto-save-proc)) 'progress-allowed?)) ) (not *target*) + (= *cheat-mode* 'camera) ) ) ) @@ -75,12 +70,12 @@ "Set the options for all of the menus." ;; start off by making them all invalid - (dotimes (i 35) + (dotimes (i (progress-screen max)) (set! (-> *options-remap* i) #f) ) ;; main menu - (set! (-> *options-remap* 3) + (set! (-> *options-remap* (progress-screen settings)) (case *kernel-boot-message* (('demo) ;; game demo @@ -96,7 +91,7 @@ ) ) ) - (set! (-> *options-remap* 4) + (set! (-> *options-remap* (progress-screen game-settings)) (cond ((!= *kernel-boot-message* 'play) (if (= (scf-get-territory) GAME_TERRITORY_SCEE) @@ -106,7 +101,7 @@ ) ((and (= (scf-get-territory) GAME_TERRITORY_SCEI) (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))) - ;; if ntsc-j and we're not using language cheat (needs l2+r2) + ;; if ntsc-j and we're not using language cheat (and holding l2+r2) *game-options-japan* ) (else @@ -114,45 +109,40 @@ ) ) ) - (set! (-> *options-remap* 5) - (if (and (= (-> *progress-state* starting-state) 27) + (set! (-> *options-remap* (progress-screen graphic-settings)) + (if (and (= (-> *progress-state* starting-state) (progress-screen title)) (or (= (scf-get-territory) GAME_TERRITORY_SCEE) - (and (= *progress-cheat* 'pal) - (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l2)) - (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons r2)) - ) - ) - ) - ;; (only if we came from title) if PAL or we're using the PAL cheat (needs l2+r2) + (and (= *progress-cheat* 'pal) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))) + ;; (only if we came from title) if PAL or we're using the PAL cheat (and holding l2+r2) *graphic-title-options-pal* *graphic-options* ) ) - (set! (-> *options-remap* 6) *sound-options*) - (set! (-> *options-remap* 7) *ok-options*) - (set! (-> *options-remap* 8) *ok-options*) - (set! (-> *options-remap* 9) *ok-options*) - (set! (-> *options-remap* 10) *yes-no-options*) - (set! (-> *options-remap* 11) *yes-no-options*) - (set! (-> *options-remap* 19) *ok-options*) - (set! (-> *options-remap* 16) *load-options*) - (set! (-> *options-remap* 17) *save-options*) - (set! (-> *options-remap* 18) *save-options-title*) - (set! (-> *options-remap* 20) *ok-options*) - (set! (-> *options-remap* 21) *ok-options*) - (set! (-> *options-remap* 24) *ok-options*) - (set! (-> *options-remap* 25) *ok-options*) - (set! (-> *options-remap* 26) *ok-options*) - (set! (-> *options-remap* 22) *ok-options*) - (set! (-> *options-remap* 23) *yes-no-options*) - (set! (-> *options-remap* 27) *title*) - (set! (-> *options-remap* 28) *options*) - (set! (-> *options-remap* 29) *ok-options*) - (set! (-> *options-remap* 30) *yes-no-options*) - (set! (-> *options-remap* 31) *yes-no-options*) - (set! (-> *options-remap* 32) *ok-options*) - (set! (-> *options-remap* 33) *ok-options*) - (set! (-> *options-remap* 34) *yes-no-options*) + (set! (-> *options-remap* (progress-screen sound-settings)) *sound-options*) + (set! (-> *options-remap* (progress-screen memcard-no-space)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-not-inserted)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-not-formatted)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-format)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen memcard-data-exists)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen memcard-insert)) *ok-options*) + (set! (-> *options-remap* (progress-screen load-game)) *load-options*) + (set! (-> *options-remap* (progress-screen save-game)) *save-options*) + (set! (-> *options-remap* (progress-screen save-game-title)) *save-options-title*) + (set! (-> *options-remap* (progress-screen memcard-error-loading)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-error-saving)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-error-formatting)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-error-creating)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-auto-save-error)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-removed)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-no-data)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen title)) *title*) + (set! (-> *options-remap* (progress-screen settings-title)) *options*) + (set! (-> *options-remap* (progress-screen auto-save)) *ok-options*) + (set! (-> *options-remap* (progress-screen pal-change-to-60hz)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen pal-now-60hz)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen no-disc)) *ok-options*) + (set! (-> *options-remap* (progress-screen bad-disc)) *ok-options*) + (set! (-> *options-remap* (progress-screen quit)) *yes-no-options*) (set! (-> *progress-state* aspect-ratio-choice) (get-aspect-ratio)) (set! (-> *progress-state* video-mode-choice) (get-video-mode)) (set! (-> *progress-state* yes-no-choice) #f) @@ -299,56 +289,48 @@ Buzzers are tallied 10% Orbs are tallied 10%" - (local-vars - (current-cells int) - (current-buzzers int) - (current-orbs int) - (total-cells int) - (total-buzzers int) - (total-orbs int) - ) - (set! current-cells 0) - (set! current-buzzers 0) - (set! current-orbs 0) - (set! total-cells 0) - (set! total-buzzers 0) - (set! total-orbs 0) - (dotimes (s5-0 (length *level-task-data*)) - (let ((s4-0 (-> *level-task-data* s5-0))) - (when (!= s4-0 #f) - (when (or (= *kernel-boot-message* 'play) (= (-> s4-0 level-name-id) (game-text-id misty-level-name))) - (dotimes (s3-0 (-> s4-0 nb-of-tasks)) - (if (= (get-task-status (-> s4-0 task-info s3-0 task-id)) (task-status invalid)) - (set! current-cells (+ current-cells 1)) + (let ((current-cells 0) + (current-buzzers 0) + (current-orbs 0) + (total-cells 0) + (total-buzzers 0) + (total-orbs 0)) + (dotimes (s5-0 (length *level-task-data*)) + (let ((s4-0 (-> *level-task-data* s5-0))) + (when (!= s4-0 #f) + (when (or (= *kernel-boot-message* 'play) (= (-> s4-0 level-name-id) (game-text-id misty-level-name))) + (dotimes (s3-0 (-> s4-0 nb-of-tasks)) + (if (= (get-task-status (-> s4-0 task-info s3-0 task-id)) (task-status invalid)) + (1+! current-cells) + ) + ) + (set! total-cells (+ total-cells (-> s4-0 nb-of-tasks))) + (set! current-orbs (+ current-orbs (-> *game-info* money-per-level s5-0))) + (set! total-orbs (+ total-orbs (-> *game-counts* data s5-0 money-count))) + (let ((v1-20 (-> s4-0 buzzer-task-index))) + (when (!= v1-20 -1) + (set! current-buzzers (+ current-buzzers (buzzer-count *game-info* (-> s4-0 task-info v1-20 task-id)))) + (set! total-buzzers (+ total-buzzers (-> *game-counts* data s5-0 buzzer-count))) ) - ) - (set! total-cells (+ total-cells (-> s4-0 nb-of-tasks))) - (set! current-orbs (+ current-orbs (-> *game-info* money-per-level s5-0))) - (set! total-orbs (+ total-orbs (-> *game-counts* data s5-0 money-count))) - (let ((v1-20 (-> s4-0 buzzer-task-index))) - (when (!= v1-20 -1) - (set! current-buzzers (+ current-buzzers (buzzer-count *game-info* (-> s4-0 task-info v1-20 task-id)))) - (set! total-buzzers (+ total-buzzers (-> *game-counts* data s5-0 buzzer-count))) ) ) ) ) ) - ) - (when the-progress - (set! (-> the-progress total-nb-of-power-cells) total-cells) - (set! (-> the-progress total-nb-of-buzzers) total-buzzers) - (set! (-> the-progress total-nb-of-orbs) total-orbs) - ) - (+ (/ (* 80.0 (the float current-cells)) (the float total-cells)) - (/ (* 10.0 (the float current-orbs)) (the float total-orbs)) - (/ (* 10.0 (the float current-buzzers)) (the float total-buzzers)) - ) + (when the-progress + (set! (-> the-progress total-nb-of-power-cells) total-cells) + (set! (-> the-progress total-nb-of-buzzers) total-buzzers) + (set! (-> the-progress total-nb-of-orbs) total-orbs) + ) + (+ (/ (* 80.0 (the float current-cells)) (the float total-cells)) + (/ (* 10.0 (the float current-orbs)) (the float total-orbs)) + (/ (* 10.0 (the float current-buzzers)) (the float total-buzzers)) + )) ) (define *progress-save-info* (new 'global 'mc-slot-info)) -(defmacro progress-make-manipy-icon (obj &key skel +(defmacro progress-make-icon (obj &key skel &key x &key y &key z @@ -358,7 +340,7 @@ `(when (< (-> ,obj nb-of-icons) 6) (let ((icon-idx (-> ,obj nb-of-icons))) (set! (-> ,obj icons icon-idx) (new 'static 'hud-icon)) - (let ((new-manipy (make-init-process manipy manipy-init (new 'static 'vector :w 1.0) #f ,skel #f + (let ((new-manipy (manipy-spawn (new 'static 'vector :w 1.0) #f ,skel #f :to ,obj :stack *scratch-memory-top* ))) @@ -388,48 +370,24 @@ ) (defmethod initialize-icons progress ((obj progress)) - (progress-make-manipy-icon obj :skel *fuelcell-naked-sg* - :x 256 - :y 77 - :z (meters 0.5) - :scale-x 0.006 - :scale-y 0.006 - ) - (progress-make-manipy-icon obj :skel *fuelcell-naked-sg* - :x 256 - :y 77 - :z (meters 0.5) - :scale-x 0.006 - :scale-y 0.006 - ) - (progress-make-manipy-icon obj :skel *fuelcell-naked-sg* - :x 256 - :y 77 - :z (meters 0.5) - :scale-x 0.006 - :scale-y 0.006 - ) - (progress-make-manipy-icon obj :skel *fuelcell-naked-sg* - :x 256 - :y 77 - :z (meters 0.5) - :scale-x 0.006 - :scale-y 0.006 - ) - (progress-make-manipy-icon obj :skel *money-sg* - :x -320 - :y 253 - :z (meters 17) - :scale-x 0.013 - :scale-y -0.015 - ) - (progress-make-manipy-icon obj :skel *money-sg* - :x -320 - :y 253 - :z (meters 0.25) - :scale-x 0.008 - :scale-y -0.009 - ) + (progress-make-icon obj :skel *fuelcell-naked-sg* + :x 256 :y 77 :z (meters 0.5) + :scale-x 0.006 :scale-y 0.006) + (progress-make-icon obj :skel *fuelcell-naked-sg* + :x 256 :y 77 :z (meters 0.5) + :scale-x 0.006 :scale-y 0.006) + (progress-make-icon obj :skel *fuelcell-naked-sg* + :x 256 :y 77 :z (meters 0.5) + :scale-x 0.006 :scale-y 0.006) + (progress-make-icon obj :skel *fuelcell-naked-sg* + :x 256 :y 77 :z (meters 0.5) + :scale-x 0.006 :scale-y 0.006) + (progress-make-icon obj :skel *money-sg* + :x -320 :y 253 :z (meters 17) + :scale-x 0.013 :scale-y -0.015) + (progress-make-icon obj :skel *money-sg* + :x -320 :y 253 :z (meters 0.25) + :scale-x 0.008 :scale-y -0.009) (send-event (ppointer->process (-> obj icons 1 icon)) 'set-frame-num 2.5) (send-event (ppointer->process (-> obj icons 2 icon)) 'set-frame-num 10.0) (send-event (ppointer->process (-> obj icons 3 icon)) 'set-frame-num 15.5) @@ -467,7 +425,6 @@ ) (((progress-screen memcard-removed)) (set! (-> *progress-state* last-slot-saved) 0) - 0 ) ) ) @@ -513,7 +470,7 @@ (defmethod set-transition-progress! progress ((obj progress) (arg0 int)) (set! (-> obj transition-offset) arg0) (set! (-> obj transition-offset-invert) (- 512 arg0)) - (set! (-> obj transition-percentage) (* 0.001953125 (the float arg0))) + (set! (-> obj transition-percentage) (* (1/ 512) (the float arg0))) (set! (-> obj transition-percentage-invert) (- 1.0 (-> obj transition-percentage))) 0 (none) @@ -628,18 +585,7 @@ (make-levels-with-tasks-available-to-progress) (disable-level-text-file-loading) (set! (-> *progress-state* starting-state) screen) - (let ((s4-0 (get-process *default-dead-pool* progress #x4000))) - (set! *progress-process* - (the-as (pointer progress) (when s4-0 - (let ((t9-5 (method-of-type progress activate))) - (t9-5 (the-as progress s4-0) creator 'progress (&-> *progress-stack* 14336)) - ) - (run-now-in-process s4-0 progress-init-by-other) - (-> s4-0 ppointer) - ) - ) - ) - ) + (set! *progress-process* (process-spawn progress :to creator :stack *progress-stack-top*)) (let ((s5-1 *progress-process*)) (set! (-> s5-1 0 completion-percentage) (calculate-completion (-> s5-1 0))) (set! *master-mode* 'progress) @@ -681,7 +627,7 @@ (defun deactivate-progress () (when (and *progress-process* (= (-> *progress-process* 0 next-state name) 'progress-gone)) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (dotimes (gp-0 (-> *progress-process* 0 nb-of-particles)) (kill-and-free-particles (-> *progress-process* 0 particles gp-0 part)) (set! (-> *progress-process* 0 particles gp-0 part matrix) -1) @@ -755,9 +701,9 @@ (let ((f0-1 (* (1/ METER_LENGTH) (the float (-> obj in-out-position))))) (set! (-> obj particles 2 init-pos x) (the float (+ (-> obj right-x-offset) 409 (the int (* 301.5 f0-1))))) (set! (-> obj particles 1 init-pos x) (the float (+ (-> obj left-x-offset) 59))) - (set! (-> obj left-side-x-scale) (meters (+ (/ 3.5 (-> obj sides-x-scale)) (* 10.0 f0-1)))) + (set! (-> obj left-side-x-scale) (meters (+ (/ (if (= (-> *pc-settings* aspect-custom-x) 16) 5.0 3.5) (-> obj sides-x-scale)) (* 10.0 f0-1)))) (set! (-> obj left-side-y-scale) (meters (+ (-> obj sides-y-scale) (* 10.0 f0-1)))) - (set! (-> obj right-side-x-scale) (meters (+ (/ 6.0 (-> obj sides-x-scale)) (* 4.0 f0-1)))) + (set! (-> obj right-side-x-scale) (meters (+ (/ (if (= (-> *pc-settings* aspect-custom-x) 16) 8.5 6.0) (-> obj sides-x-scale)) (* 4.0 f0-1)))) (set! (-> obj right-side-y-scale) (meters (+ (-> obj sides-y-scale) (* 4.0 f0-1)))) ) (dotimes (s5-0 (-> obj nb-of-particles)) @@ -857,7 +803,7 @@ (none) ) -(defmethod dummy-32 progress ((obj progress)) +(defmethod can-go-back? progress ((obj progress)) (let ((v1-2 (-> *progress-process* 0 display-state)) (a1-1 (-> *progress-state* starting-state)) ) @@ -872,20 +818,38 @@ (= a1-1 (progress-screen buzzer)) (= a1-1 (progress-screen title)) ) - (or (= v1-2 (progress-screen settings)) - (= v1-2 (progress-screen game-settings)) - (= v1-2 (progress-screen graphic-settings)) - (= v1-2 (progress-screen sound-settings)) - (= v1-2 (progress-screen title)) - (= v1-2 (progress-screen settings-title)) - ) + (#if (not PC_PORT) + (or (= v1-2 (progress-screen settings)) + (= v1-2 (progress-screen game-settings)) + (= v1-2 (progress-screen graphic-settings)) + (= v1-2 (progress-screen sound-settings)) + (= v1-2 (progress-screen title)) + (= v1-2 (progress-screen settings-title))) + (or (= v1-2 (progress-screen settings)) + (= v1-2 (progress-screen game-settings)) + (= v1-2 (progress-screen graphic-settings)) + (= v1-2 (progress-screen sound-settings)) + (= v1-2 (progress-screen title)) + (= v1-2 (progress-screen settings-title)) + (= v1-2 (progress-screen camera-options)) + (= v1-2 (progress-screen accessibility-options)) + (= v1-2 (progress-screen misc-options)) + (= v1-2 (progress-screen game-ps2-options)) + (= v1-2 (progress-screen gfx-ps2-options)) + (= v1-2 (progress-screen resolution)) + (= v1-2 (progress-screen aspect-ratio)) + (= v1-2 (progress-screen secrets)) + (= v1-2 (progress-screen music-player)) + (= v1-2 (progress-screen flava-player)) + ) + ) ) ) ) ) ) -(defmethod dummy-19 progress ((obj progress)) +(defmethod visible? progress ((obj progress)) (the-as symbol (and *progress-process* (zero? (-> *progress-process* 0 in-out-position)))) ) @@ -911,7 +875,7 @@ (set! (-> self particles gp-0 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set-setting! *setting-control* self 'common-page 'set 0.0 1) + (set-setting! 'common-page 'set 0.0 1) (suspend) (go progress-coming-in) ) @@ -924,8 +888,8 @@ (defstate progress-gone (progress) :code (behavior () - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (copy-settings-from-target! *setting-control*) + (remove-setting! 'process-mask) + (apply-settings *setting-control*) (logior! (-> self mask) (process-mask sleep)) (suspend) 0 @@ -933,7 +897,7 @@ ) ) -(defmethod dummy-53 progress ((obj progress) (arg0 progress-screen)) +(defmethod set-memcard-screen progress ((obj progress) (arg0 progress-screen)) (let ((s4-0 (-> obj card-info)) (gp-0 arg0) ) @@ -1034,26 +998,24 @@ ) ) -(defmethod dummy-31 progress ((obj progress)) +(defmethod respond-memcard progress ((obj progress)) (let ((s5-0 (-> obj card-info))) (when (and s5-0 (not (-> obj in-transition))) (when (or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) + (cpad-clear! 0 x) + (cpad-clear! 0 circle) (case (-> obj display-state) (((progress-screen load-game)) (cond ((< (-> obj option-index) 4) (when (nonzero? (-> s5-0 file (-> obj option-index) present)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *progress-state* which) (-> obj option-index)) (set! (-> obj next-display-state) (progress-screen memcard-loading)) ) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1061,7 +1023,7 @@ (((progress-screen save-game) (progress-screen save-game-title)) (cond ((< (-> obj option-index) 4) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *progress-state* which) (-> obj option-index)) (if (zero? (-> s5-0 file (-> obj option-index) present)) (set! (-> obj next-display-state) (progress-screen memcard-saving)) @@ -1069,51 +1031,54 @@ ) ) ((and (= (-> obj display-state) (progress-screen save-game-title)) (= (-> obj option-index) 4)) - (sound-play-by-name (static-sound-name "starts-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "starts-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) ) (((progress-screen memcard-insert)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen memcard-data-exists)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-saving)) ) - ((begin - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (= (-> obj display-state-stack 0) (progress-screen title)) - ) - (set! (-> obj next-display-state) (progress-screen save-game-title)) - ) (else - (set! (-> obj next-display-state) (progress-screen save-game)) + (sound-play "cursor-options") + (if (= (-> obj display-state-stack 0) (progress-screen title)) + (set! (-> obj next-display-state) (progress-screen save-game-title)) + (set! (-> obj next-display-state) (progress-screen save-game)) + ) ) ) ) (((progress-screen memcard-no-data)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-creating)) ) + ;; PAL & NTSC-J patch here + ((= (-> obj display-state-stack 0) (progress-screen title)) + (sound-play "cursor-options") + (sound-volume-off) + (set! (-> *game-info* mode) 'play) + (initialize! *game-info* 'game (the-as game-save #f) "intro-start") + (set-master-mode 'game) + ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "intro-start") - (set-master-mode 'game) + (sound-play "cursor-options") + (set! (-> obj next-display-state) (progress-screen invalid)) ) ) ) @@ -1123,18 +1088,18 @@ ) (cond ((= (-> obj display-state-stack 0) (progress-screen title)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) ((nonzero? (-> obj display-state-stack 0)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1147,19 +1112,19 @@ (progress-screen memcard-removed) (progress-screen auto-save) ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen pal-change-to-60hz)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) (set! (-> obj video-mode-timeout) (-> *display* real-frame-counter)) (set! (-> obj next-display-state) (progress-screen pal-now-60hz)) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> *progress-state* video-mode-choice) 'pal) (set! (-> obj next-display-state) (progress-screen invalid)) ) @@ -1170,30 +1135,30 @@ ((not (-> *progress-state* yes-no-choice)) (set! (-> *progress-state* video-mode-choice) 'pal) (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") ) (else - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") ) ) (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen no-disc) (progress-screen bad-disc)) (when (is-cd-in?) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) (((progress-screen quit)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "title-start") ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1201,18 +1166,19 @@ (((progress-screen memcard-format)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-formatting)) ) + ;; NTSC-J patch here ((= (-> obj display-state-stack 0) (progress-screen title)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1225,7 +1191,7 @@ (none) ) -(defmethod dummy-29 progress ((obj progress)) +(defmethod respond-common progress ((obj progress)) (mc-get-slot-info 0 *progress-save-info*) (set! (-> obj card-info) *progress-save-info*) (let ((s5-0 (-> *options-remap* (-> obj display-state)))) @@ -1236,7 +1202,7 @@ ((cpad-pressed? 0 up) (when (not (-> obj selected-option)) (if (!= (length s5-0) 1) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") ) (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) (if (> (-> obj option-index) 0) @@ -1249,7 +1215,7 @@ (when (-> obj selected-option) (let ((v1-34 #f)) (case (-> s5-0 (-> obj option-index) option-type) - ((3) + (((game-option-type center-screen)) (when (< -48 (-> *setting-control* current screeny)) (set! v1-34 #t) (+! (-> *setting-control* default screeny) -1) @@ -1259,7 +1225,7 @@ (when v1-34 (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) 1024 0 0 1 #t) + (sound-play "slider2001") ) ) ) @@ -1272,7 +1238,7 @@ ((cpad-pressed? 0 down) (when (not (-> obj selected-option)) (if (!= (length s5-0) 1) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") ) (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) (cond @@ -1290,7 +1256,7 @@ (when (-> obj selected-option) (let ((v1-69 #f)) (case (-> s5-0 (-> obj option-index) option-type) - ((3) + (((game-option-type center-screen)) (when (< (-> *setting-control* current screeny) 48) (set! v1-69 #t) (+! (-> *setting-control* default screeny) 1) @@ -1300,7 +1266,7 @@ (when v1-69 (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) 1024 0 0 1 #t) + (sound-play "slider2001") ) ) ) @@ -1311,11 +1277,11 @@ ((cpad-hold? 0 left) (cond ((cpad-pressed? 0 left) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) 7)) + (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no))) (let ((s4-5 #f)) (case (-> s5-0 (-> obj option-index) option-type) - ((2 7) - (when (not (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)))) + (((game-option-type on-off) (game-option-type yes-no)) + (when (not (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) (set! s4-5 #t) (if (= (-> s5-0 (-> obj option-index) value-to-modify) (&-> *setting-control* current vibration)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) @@ -1323,15 +1289,15 @@ ) (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #t) ) - ((4) - (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect16x9)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect4x3) + (((game-option-type aspect-ratio)) + (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect16x9)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect4x3) ) - ((5) - (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'ntsc)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'pal) + (((game-option-type video-mode)) + (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'pal) ) - ((1) + (((game-option-type language)) (if (> (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) 0) (+! (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify))) -1) (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) @@ -1349,7 +1315,7 @@ ) ) (if s4-5 - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -1357,35 +1323,33 @@ (else (when (-> obj selected-option) (let ((v1-157 #f)) - (let ((a0-101 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? a0-101) - (cond - ((>= (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ 1.0 (-> s5-0 (-> obj option-index) param1)) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (cond + ((>= (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (+ 1.0 (-> s5-0 (-> obj option-index) param1)) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (+ -1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ -1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - (set! v1-157 #t) - ) - ((< (-> s5-0 (-> obj option-index) param1) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param1) - ) - (set! v1-157 #t) - ) - ) + (set! v1-157 #t) + ) + ((< (-> s5-0 (-> obj option-index) param1) + (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> s5-0 (-> obj option-index) param1) + ) + (set! v1-157 #t) + ) ) - ((= a0-101 3) - (when (< -96 (-> *setting-control* default screenx)) - (set! v1-157 #t) - (+! (-> *setting-control* default screenx) -1) - ) + ) + (((game-option-type center-screen)) + (when (< -96 (-> *setting-control* default screenx)) + (set! v1-157 #t) + (+! (-> *setting-control* default screenx) -1) ) - ) + ) ) (when v1-157 (let ((f30-0 100.0)) @@ -1396,7 +1360,7 @@ ) (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 f30-0)) 0 0 1 #t) + (sound-play "slider2001" :vol f30-0) ) ) ) @@ -1408,22 +1372,22 @@ ((cpad-hold? 0 right) (cond ((cpad-pressed? 0 right) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) 7)) + (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no))) (let ((v1-217 (the-as object #f))) (case (-> s5-0 (-> obj option-index) option-type) - ((2 7) - (set! v1-217 (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)))) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #f) + (((game-option-type on-off) (game-option-type yes-no)) + (set! v1-217 (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) #f) ) - ((4) - (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect4x3)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect16x9) + (((game-option-type aspect-ratio)) + (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect4x3)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect16x9) ) - ((5) - (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'pal)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'ntsc) + (((game-option-type video-mode)) + (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'pal)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc) ) - ((1) + (((game-option-type language)) (let ((v1-243 (if (and (zero? (scf-get-territory)) (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) ) @@ -1448,7 +1412,7 @@ ) ) (if v1-217 - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -1456,35 +1420,33 @@ (else (when (-> obj selected-option) (let ((v1-263 #f)) - (let ((a0-177 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? a0-177) - (cond - ((>= (+ -1.0 (-> s5-0 (-> obj option-index) param2)) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (cond + ((>= (+ -1.0 (-> s5-0 (-> obj option-index) param2)) + (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (+ 1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ 1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - (set! v1-263 #t) - ) - ((< (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) - ) - (set! v1-263 #t) - ) - ) + (set! v1-263 #t) + ) + ((< (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> s5-0 (-> obj option-index) param2) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> s5-0 (-> obj option-index) param2) + ) + (set! v1-263 #t) + ) ) - ((= a0-177 3) - (when (< (-> *setting-control* default screenx) 96) - (set! v1-263 #t) - (+! (-> *setting-control* default screenx) 1) - ) + ) + (((game-option-type center-screen)) + (when (< (-> *setting-control* default screenx) 96) + (set! v1-263 #t) + (+! (-> *setting-control* default screenx) 1) ) - ) + ) ) (when v1-263 (let ((f30-1 100.0)) @@ -1495,7 +1457,7 @@ ) (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 f30-1)) 0 0 1 #t) + (sound-play "slider2001" :vol f30-1) ) ) ) @@ -1507,38 +1469,36 @@ ((or (cpad-pressed? 0 square) (cpad-pressed? 0 triangle)) (cond ((-> obj selected-option) - (let ((v1-319 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? v1-319) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* slider-backup) - ) - ) - ((= v1-319 1) - (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* language-backup) - ) - ) - ((= v1-319 2) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* on-off-backup) - ) - ) - ((= v1-319 3) - (set! (-> *setting-control* default screenx) (-> *progress-state* center-x-backup)) - (set! (-> *setting-control* default screeny) (-> *progress-state* center-y-backup)) - ) - ((or (= v1-319 4) (= v1-319 5)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* aspect-ratio-backup) - ) - ) - ) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> *progress-state* slider-backup) + ) + ) + (((game-option-type language)) + (set! (-> (the-as (pointer language-enum) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> *progress-state* language-backup) + ) + ) + (((game-option-type on-off)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (-> *progress-state* on-off-backup) + ) + ) + (((game-option-type center-screen)) + (set! (-> *setting-control* default screenx) (-> *progress-state* center-x-backup)) + (set! (-> *setting-control* default screeny) (-> *progress-state* center-y-backup)) + ) + (((game-option-type aspect-ratio) (game-option-type video-mode)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (-> *progress-state* aspect-ratio-backup) + ) + ) ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj selected-option) #f) ) - ((or (dummy-32 obj) + ((or (can-go-back? obj) (= (-> obj display-state) (progress-screen load-game)) (= (-> obj display-state) (progress-screen save-game)) (= (-> obj display-state) (progress-screen save-game-title)) @@ -1548,8 +1508,8 @@ (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) (if (= (-> obj display-state) (progress-screen settings)) - (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "menu-stats") + (sound-play "cursor-options") ) (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) (set! (-> obj next-display-state) (progress-screen invalid)) @@ -1560,21 +1520,21 @@ (cond ((not (-> obj selected-option)) (cond - ((= (-> s5-0 (-> obj option-index) option-type) 6) + ((= (-> s5-0 (-> obj option-index) option-type) (game-option-type menu)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) (push! obj) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (the-as progress-screen (-> s5-0 (-> obj option-index) param3))) (case (-> obj next-display-state) (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) - (set! (-> obj next-display-state) (dummy-53 obj (-> obj next-display-state))) + (set! (-> obj next-display-state) (set-memcard-screen obj (-> obj next-display-state))) ) ) ) - ((= (-> s5-0 (-> obj option-index) option-type) 8) + ((= (-> s5-0 (-> obj option-index) option-type) (game-option-type button)) (cond ((= (-> s5-0 (-> obj option-index) name) (game-text-id exit-demo)) (set! *master-exit* 'force) @@ -1582,51 +1542,49 @@ ) ((= (-> s5-0 (-> obj option-index) name) (game-text-id back)) (if (= (-> obj display-state) (progress-screen settings)) - (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "menu-stats") + (sound-play "cursor-options") ) (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) (set! (-> obj next-display-state) (progress-screen invalid)) ) ) ) - ((!= (-> s5-0 (-> obj option-index) option-type) 7) - (let ((v1-427 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? v1-427) - (set! (-> *progress-state* slider-backup) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - ) - ) - ((= v1-427 1) - (set! (-> *progress-state* language-backup) - (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ((= v1-427 2) - (set! (-> *progress-state* on-off-backup) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ((= v1-427 3) - (set! (-> *progress-state* center-x-backup) (-> *setting-control* default screenx)) - (set! (-> *progress-state* center-y-backup) (-> *setting-control* default screeny)) - ) - ((or (= v1-427 4) (= v1-427 5)) - (set! (-> *progress-state* aspect-ratio-backup) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ) + ((!= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no)) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (set! (-> *progress-state* slider-backup) + (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ) + ) + (((game-option-type language)) + (set! (-> *progress-state* language-backup) + (-> (the-as (pointer language-enum) (-> s5-0 (-> obj option-index) value-to-modify))) + ) + ) + (((game-option-type on-off)) + (set! (-> *progress-state* on-off-backup) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + ) + ) + (((game-option-type center-screen)) + (set! (-> *progress-state* center-x-backup) (-> *setting-control* default screenx)) + (set! (-> *progress-state* center-y-backup) (-> *setting-control* default screeny)) + ) + (((game-option-type aspect-ratio) (game-option-type video-mode)) + (set! (-> *progress-state* aspect-ratio-backup) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + ) + ) ) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) (set! (-> obj selected-option) #t) - (when (= (-> s5-0 (-> obj option-index) option-type) 1) - (set! (-> obj language-selection) (the-as uint (-> *setting-control* current language))) + (when (= (-> s5-0 (-> obj option-index) option-type) (game-option-type language)) + (set! (-> obj language-selection) (-> *setting-control* current language)) (set! (-> obj language-direction) #t) (set! (-> obj language-transition) #f) (set! (-> obj language-x-offset) 0) @@ -1636,15 +1594,15 @@ ) ) (else - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj selected-option) #f) (case (-> s5-0 (-> obj option-index) option-type) - ((4) + (((game-option-type aspect-ratio)) (set! (-> *setting-control* default aspect-ratio) (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) ) ) - ((5) + (((game-option-type video-mode)) (case (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))) (('pal) (set! (-> *setting-control* default video-mode) @@ -1657,7 +1615,7 @@ ) ) ) - ((1) + (((game-option-type language)) (if (not (-> obj language-transition)) (load-level-text-files (-> obj display-level-index)) ) @@ -1680,7 +1638,7 @@ (let ((s5-0 (-> obj display-level-index))) (set! (-> obj next-level-index) (get-next-level-down s5-0)) (when (!= s5-0 (-> obj next-level-index)) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! (-> obj level-transition) 2) ) ) @@ -1689,28 +1647,28 @@ (let ((s5-2 (-> obj next-level-index))) (set! (-> obj next-level-index) (get-next-level-up s5-2)) (when (!= s5-2 (-> obj next-level-index)) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! (-> obj level-transition) 1) ) ) ) ((cpad-pressed? 0 square) (when (nonzero? (-> obj display-state)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (progress-screen fuel-cell)) (set! (-> obj stat-transition) #t) ) ) ((cpad-pressed? 0 x) (when (!= (-> obj display-state) (progress-screen money)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (progress-screen money)) (set! (-> obj stat-transition) #t) ) ) ((cpad-pressed? 0 triangle) (when (!= (-> obj display-state) (progress-screen buzzer)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (progress-screen buzzer)) (set! (-> obj stat-transition) #t) ) @@ -1718,7 +1676,7 @@ ((cpad-pressed? 0 circle) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (push! obj) (set! (-> obj next-display-state) (progress-screen settings)) ) @@ -1728,7 +1686,7 @@ (let ((s5-8 (-> obj task-index))) (set! (-> obj task-index) (get-next-task-down (-> obj task-index) (-> obj display-level-index))) (if (!= s5-8 (-> obj task-index)) - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -1736,7 +1694,7 @@ (let ((s5-10 (-> obj task-index))) (set! (-> obj task-index) (get-next-task-up (-> obj task-index) (-> obj display-level-index))) (if (!= s5-10 (-> obj task-index)) - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -1925,30 +1883,26 @@ (if (and (= (-> self display-state) (-> self next-display-state)) (= (-> self display-level-index) (-> self next-level-index)) ) - (set! (-> self transition-offset) - (seekl - (-> self transition-offset) - 0 - (* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - (if (or (-> self stat-transition) (nonzero? (-> self level-transition))) - 2 - 1 - ) - ) - ) - ) - (set! (-> self transition-offset) - (seekl - (-> self transition-offset) - 512 - (* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - (if (or (-> self stat-transition) (nonzero? (-> self level-transition))) - 2 - 1 - ) - ) - ) - ) + (seekl! + (-> self transition-offset) + 0 + (* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) + (if (or (-> self stat-transition) (nonzero? (-> self level-transition))) + 2 + 1 + ) + ) + ) + (seekl! + (-> self transition-offset) + 512 + (* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) + (if (or (-> self stat-transition) (nonzero? (-> self level-transition))) + 2 + 1 + ) + ) + ) ) (set-transition-progress! self (-> self transition-offset)) (set! (-> self in-transition) (or (-> self force-transition) (nonzero? (-> self transition-offset)))) @@ -1992,7 +1946,7 @@ (case (-> self display-state) (((progress-screen fuel-cell) (progress-screen money) (progress-screen buzzer)) (let ((s5-0 (-> self display-level-index))) - (when (and (< (mod (-> *display* real-frame-counter) 60) 30) + (when (and (< (mod (-> *display* real-frame-counter) (seconds 0.2)) (seconds 0.1)) (zero? (-> *progress-process* 0 in-out-position)) (not (-> self in-transition)) (zero? (-> self transition-offset)) @@ -2017,8 +1971,8 @@ ) ) ) - (dummy-29 self) - (set! (-> self next-display-state) (dummy-53 self (-> self next-display-state))) + (respond-common self) + (set! (-> self next-display-state) (set-memcard-screen self (-> self next-display-state))) (let ((v1-74 (-> self display-state))) (cond ((or (= v1-74 (progress-screen fuel-cell)) @@ -2049,7 +2003,7 @@ (= v1-74 (progress-screen bad-disc)) (= v1-74 (progress-screen quit)) ) - (dummy-31 self) + (respond-memcard self) ) ) ) @@ -2061,158 +2015,157 @@ (behavior () (let* ((a1-0 (-> self display-level-index)) (gp-0 (-> *level-task-data* a1-0)) + (unk #t) + (s5-0 #f) ) - #t - (let ((s5-0 #f)) - (case (-> self display-state) - (((progress-screen fuel-cell)) - (set! s5-0 #t) - (draw-fuel-cell-screen self a1-0) - ) - (((progress-screen money)) - (set! s5-0 #t) - (draw-money-screen self a1-0) - ) - (((progress-screen buzzer)) - (set! s5-0 #t) - (draw-buzzer-screen self a1-0) - ) - (((progress-screen game-settings) (progress-screen settings)) - (hide-progress-icons) - (draw-options self 115 30 0.82) - ) - (((progress-screen graphic-settings) - (progress-screen sound-settings) - (progress-screen settings-title) - (progress-screen title) - ) - (hide-progress-icons) - (draw-options self 115 30 0.82) - ) - (((progress-screen memcard-removed) (progress-screen memcard-auto-save-error)) - (draw-notice-screen self) - (draw-options self 192 0 0.82) - ) - (((progress-screen memcard-no-data)) - (draw-notice-screen self) - (draw-options self 165 0 0.82) - ) - (((progress-screen memcard-format)) - (draw-notice-screen self) - (draw-options self 172 0 0.82) - ) - (((progress-screen memcard-no-space) - (progress-screen memcard-not-inserted) - (progress-screen memcard-not-formatted) - ) - (draw-notice-screen self) - (draw-options self 195 0 0.82) - ) - (((progress-screen memcard-error-loading) - (progress-screen memcard-error-saving) - (progress-screen memcard-error-formatting) - (progress-screen memcard-error-creating) - (progress-screen memcard-auto-save-error) - ) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen pal-change-to-60hz)) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen pal-now-60hz)) - (when (< (seconds 10) (- (-> *display* real-frame-counter) (-> self video-mode-timeout))) - (set! (-> *progress-state* video-mode-choice) 'pal) - (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (set! (-> self next-display-state) (progress-screen invalid)) - ) - (draw-notice-screen self) - (draw-options self 140 0 0.82) - ) - (((progress-screen no-disc) (progress-screen bad-disc)) - (draw-notice-screen self) - (if (is-cd-in?) - (draw-options self 170 0 0.82) - ) - ) - (((progress-screen quit)) - (draw-notice-screen self) - (draw-options self 110 0 0.82) - ) - (((progress-screen auto-save)) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen memcard-insert)) - (draw-notice-screen self) - (draw-options self 165 0 0.82) - ) - (((progress-screen memcard-data-exists)) - (draw-notice-screen self) - (draw-options self 168 0 0.82) - ) - (((progress-screen memcard-loading) - (progress-screen memcard-saving) - (progress-screen memcard-formatting) - (progress-screen memcard-creating) - ) - (draw-notice-screen self) - ) - (((progress-screen load-game) (progress-screen save-game)) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen save-game-title)) - (draw-notice-screen self) - (draw-options self 169 15 0.6) - ) + (case (-> self display-state) + (((progress-screen fuel-cell)) + (set! s5-0 #t) + (draw-fuel-cell-screen self a1-0) + ) + (((progress-screen money)) + (set! s5-0 #t) + (draw-money-screen self a1-0) + ) + (((progress-screen buzzer)) + (set! s5-0 #t) + (draw-buzzer-screen self a1-0) + ) + (((progress-screen game-settings) (progress-screen settings)) + (hide-progress-icons) + (draw-options self 115 30 0.82) + ) + (((progress-screen graphic-settings) + (progress-screen sound-settings) + (progress-screen settings-title) + (progress-screen title) ) - (when s5-0 - (let* ((v1-98 (cond - ((-> self stat-transition) - 0 - ) - ((= (-> self level-transition) 1) - (- (-> self transition-offset)) - ) - (else - (-> self transition-offset) - ) + (hide-progress-icons) + (draw-options self 115 30 0.82) + ) + (((progress-screen memcard-removed) (progress-screen memcard-auto-save-error)) + (draw-notice-screen self) + (draw-options self 192 0 0.82) + ) + (((progress-screen memcard-no-data)) + (draw-notice-screen self) + (draw-options self 165 0 0.82) + ) + (((progress-screen memcard-format)) + (draw-notice-screen self) + (draw-options self 172 0 0.82) + ) + (((progress-screen memcard-no-space) + (progress-screen memcard-not-inserted) + (progress-screen memcard-not-formatted) + ) + (draw-notice-screen self) + (draw-options self 195 0 0.82) + ) + (((progress-screen memcard-error-loading) + (progress-screen memcard-error-saving) + (progress-screen memcard-error-formatting) + (progress-screen memcard-error-creating) + (progress-screen memcard-auto-save-error) + ) + (draw-notice-screen self) + (draw-options self 190 0 0.82) + ) + (((progress-screen pal-change-to-60hz)) + (draw-notice-screen self) + (draw-options self 190 0 0.82) + ) + (((progress-screen pal-now-60hz)) + (when (< (seconds 10) (- (-> *display* real-frame-counter) (-> self video-mode-timeout))) + (set! (-> *progress-state* video-mode-choice) 'pal) + (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) + (set! (-> self next-display-state) (progress-screen invalid)) + ) + (draw-notice-screen self) + (draw-options self 140 0 0.82) + ) + (((progress-screen no-disc) (progress-screen bad-disc)) + (draw-notice-screen self) + (if (is-cd-in?) + (draw-options self 170 0 0.82) + ) + ) + (((progress-screen quit)) + (draw-notice-screen self) + (draw-options self 110 0 0.82) + ) + (((progress-screen auto-save)) + (draw-notice-screen self) + (draw-options self 190 0 0.82) + ) + (((progress-screen memcard-insert)) + (draw-notice-screen self) + (draw-options self 165 0 0.82) + ) + (((progress-screen memcard-data-exists)) + (draw-notice-screen self) + (draw-options self 168 0 0.82) + ) + (((progress-screen memcard-loading) + (progress-screen memcard-saving) + (progress-screen memcard-formatting) + (progress-screen memcard-creating) + ) + (draw-notice-screen self) + ) + (((progress-screen load-game) (progress-screen save-game)) + (draw-notice-screen self) + (draw-options self 190 0 0.82) + ) + (((progress-screen save-game-title)) + (draw-notice-screen self) + (draw-options self 169 15 0.6) + ) + ) + (when s5-0 + (let* ((v1-98 (cond + ((-> self stat-transition) + 0 + ) + ((= (-> self level-transition) 1) + (- (-> self transition-offset)) + ) + (else + (-> self transition-offset) ) ) - (f30-0 (the-as float (if (-> self stat-transition) - 1.0 - (-> self transition-percentage-invert) - ) - ) - ) - (s5-1 - (new - 'stack - 'font-context - *font-default-matrix* - (- 32 (-> self left-x-offset)) - (the int (* (+ 42.0 (the float (/ v1-98 2))) f30-0)) - 8325000.0 - (font-color lighter-lighter-blue) - (font-flags shadow kerning) - ) + ) + (f30-0 (the-as float (if (-> self stat-transition) + 1.0 + (-> self transition-percentage-invert) + ) + ) + ) + (s5-1 + (new + 'stack + 'font-context + *font-default-matrix* + (- 32 (-> self left-x-offset)) + (the int (* (+ 42.0 (the float (/ v1-98 2))) f30-0)) + 8325000.0 + (font-color lighter-lighter-blue) + (font-flags shadow kerning) ) ) - (let ((v1-103 s5-1)) - (set! (-> v1-103 width) (the float 328)) - ) - (let ((v1-104 s5-1)) - (set! (-> v1-104 height) (the float 45)) - ) - (set! (-> s5-1 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (-> gp-0 level-name-id) #f) - f30-0 - s5-1 - (the int (* 128.0 f30-0)) - ) + ) + (let ((v1-103 s5-1)) + (set! (-> v1-103 width) (the float 328)) + ) + (let ((v1-104 s5-1)) + (set! (-> v1-104 height) (the float 45)) + ) + (set! (-> s5-1 flags) (font-flags shadow kerning middle left large)) + (print-game-text-scaled + (lookup-text! *common-text* (-> gp-0 level-name-id) #f) + f30-0 + s5-1 + (the int (* 128.0 f30-0)) ) ) ) @@ -2233,11 +2186,11 @@ (-> progress-waiting event) :enter (behavior () - (sound-group-pause (the-as uint 255)) + (sound-group-pause (sound-group sfx music dialog sog3 ambient sog5 sog6 sog7)) (logclear! (-> *setting-control* default process-mask) (process-mask pause menu)) - (push-setting! *setting-control* self 'process-mask 'set 0.0 16) - (copy-settings-from-target! *setting-control*) - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) + (add-setting! 'process-mask 'set 0.0 16) + (apply-settings *setting-control*) + (sound-play "select-menu") (set-blackout-frames 0) (set! *pause-lock* #f) (none) @@ -2245,16 +2198,13 @@ :code (behavior () (loop - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 0 (the int (* 170.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self in-out-position) 0 (the int (* 170.0 (-> *display* time-adjust-ratio)))) (when (< (-> self in-out-position) 2867) - (set! (-> self transition-offset) (seekl - (-> self transition-offset) - 0 - (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - ) - ) + (seekl! + (-> self transition-offset) + 0 + (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) + ) (set-transition-progress! self (-> self transition-offset)) ) (if (zero? (-> self in-out-position)) @@ -2271,7 +2221,7 @@ (defstate progress-going-out (progress) :enter (behavior () - (sound-play-by-name (static-sound-name "menu-close") (new-sound-id) 1024 0 0 1 #t) + (sound-play "menu-close") (hide-progress-icons) (set! (-> self particles 3 init-pos x) -320.0) (set! (-> self particles 4 init-pos x) -320.0) @@ -2285,17 +2235,14 @@ :code (behavior () (loop - (set! (-> self transition-offset) (seekl - (-> self transition-offset) - 512 - (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - ) - ) + (seekl! + (-> self transition-offset) + 512 + (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) + ) (set-transition-progress! self (-> self transition-offset)) (when (< 153 (-> self transition-offset)) - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 4096 (the int (* 170.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self in-out-position) 4096 (the int (* 170.0 (-> *display* time-adjust-ratio)))) (if (= (-> self in-out-position) 4096) (go progress-gone) ) @@ -2420,7 +2367,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-4) ) @@ -2442,7 +2389,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-1 (the-as (pointer dma-tag) a3-6) ) @@ -2464,7 +2411,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-2 (the-as (pointer dma-tag) a3-8) ) @@ -2486,7 +2433,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-3 (the-as (pointer dma-tag) a3-10) ) diff --git a/goal_src/engine/ui/text-h.gc b/goal_src/engine/ui/text-h.gc index 62252845c5..1a5a42b801 100644 --- a/goal_src/engine/ui/text-h.gc +++ b/goal_src/engine/ui/text-h.gc @@ -147,6 +147,8 @@ (jungle-level-name #x222) (misty-level-name #x223) + (jungleb-level-name #x225) + (beach-seagull-get #x22e) (jungle-lurkerm-unblock #x22f) @@ -191,13 +193,16 @@ (misty-daxter-hit-lurkers-not-mines #x27f) (sidekick-speech-hint-crate-darkeco1 #x281) + (sidekick-speech-crate-steel-break1 #x283) (sidekick-speech-hint-crate-iron #x284) (sidekick-speech-hint-crate-steel #x285) + (beach-collectors-unblocked #x288) + (jungleb-eco-vents-opened #x289) (misty-stopped-lurkers-at-silo #x28a) (misty-stopped-balloon-lurkers #x28b) - (jungleb-eco-vents-opened #x289) + (sidekick-speech-crate-steel-break2 #x28e) (sidekick-speech-hint-crate-darkeco2 #x28f) @@ -216,13 +221,10 @@ (misty-teetertotter-bonk-dax-tutorial #x2a4) (sidekick-hint-misty-get-red-eco #x2a5) - (red-eco-tutorial #x2a6) - (daxter-blue-eco-plat-tutorial #x2a7) (fish? #x2a9) - (misty-bone-bridge-hint #x2aa) (beach-grottopole-increment #x2af) @@ -455,11 +457,149 @@ (inc #xf10) (europe #xf11) + + ;; extra IDs for pc port + (camera-options #x1000) + (normal #x1001) + (inverted #x1002) + (camera-controls-first-horz #x1003) + (camera-controls-first-vert #x1004) + (camera-controls-third-horz #x1005) + (camera-controls-third-vert #x1006) + (restore-defaults #x1007) + (misc-options #x100f) + (accessibility-options #x1010) + (money-starburst #x1011) + (ps2-options #x1020) + (ps2-load-speed #x1021) + (ps2-parts #x1022) + (music-fadeout #x1023) + (music-fadein #x1024) + (discord-rpc #x1030) + (display-mode #x1031) + (windowed #x1032) + (borderless #x1033) + (fullscreen #x1034) + (game-resolution #x1035) + (resolution-fmt #x1036) + (ps2-aspect-ratio #x1037) + (ps2-aspect-ratio-msg #x1038) + (aspect-ratio-ps2 #x1039) + (fit-to-screen #x103a) + (vsync #x103b) + (msaa #x1050) + (x-times-fmt #x1051) + (2-times #x1052) + (4-times #x1053) + (8-times #x1054) + (16-times #x1055) + (frame-rate #x1060) + (60fps #x1061) + (100fps #x1062) + (150fps #x1063) + (lod-bg #x1070) + (lod-fg #x1071) + (lod-highest #x1072) + (lod-high #x1073) + (lod-mid #x1074) + (lod-low #x1075) + (lod-lowest #x1076) + (lod-ps2 #x1077) + (subtitles #x1078) + (hinttitles #x1079) + (subtitles-language #x107a) + (subtitles-speaker #x107b) + (speaker-always #x107c) + (speaker-never #x107d) + (speaker-auto #x107e) + (hint-log #x107f) + (cheats #x1080) + (secrets #x1081) + (select-level #x1082) + (select-flava #x1083) + (finalboss-level-name #x1084) + (credits #x1085) + (locked #x1086) + (ogreboss #x1087) + (fishgame #x1088) + (danger-mus #x1089) + (flava-player-controls #x108a) + (cheat-eco-blue #x1090) + (cheat-eco-red #x1091) + (cheat-eco-green #x1092) + (cheat-eco-yellow #x1093) + (cheat-sidekick-alt #x1094) + (cheat-invinc #x1095) + (cheat-tunes #x1096) + (music-player #x10c0) + (scene-player #x10c1) + (play-credits #x10c2) + (scrapbook #x10c3) + (default #x10d0) + (flava-vi1-unused0 #x10d1) + (flava-sage #x10d2) + (flava-sage-hut #x10d3) + (flava-birdlady #x10d4) + (flava-farmer #x10d5) + (flava-assistant #x10d6) + (flava-mayor #x10d7) + (flava-sculptor #x10d8) + (flava-explorer #x10d9) + (flava-dock #x10da) + (flava-jun-temple-exit #x10db) + (flava-jun-lurkerm #x10dc) + (flava-jun-temple-top #x10dd) + (flava-jub-eggtop #x10de) + (flava-jub-plant-boss #x10df) + (flava-bea-sentinel #x10e0) + (flava-bea-cannon #x10e1) + (flava-bea-grotto #x10e2) + (flava-mis-battle #x10e3) + (flava-mis-boat #x10e4) + (flava-mis-unused0 #x10e5) + (flava-racer #x10e6) + (flava-flutflut #x10e7) + (flava-fic-unused0 #x10e8) + (flava-warrior #x10e9) + (flava-geologist #x10ea) + (flava-gambler #x10eb) + (flava-levitator #x10ec) + (flava-swa-game #x10ed) + (flava-swa-launcher #x10ee) + (flava-swa-battle #x10ef) + (flava-rol-gorge #x10f0) + (flava-ogr-middle #x10f1) + (flava-ogr-end #x10f2) + (flava-vi3-mai #x10f3) + (flava-vi3-sno #x10f4) + (flava-vi3-miners #x10f5) + (flava-mai-rob #x10f6) + (flava-mai-rob-top #x10f7) + (flava-mai-mai #x10f8) + (flava-mai-dar #x10f9) + (flava-sno-battle #x10fa) + (flava-sno-cave #x10fb) + (flava-sno-fort #x10fc) + (flava-sno-balls #x10fd) + (flava-lav-middle #x10fe) + (flava-lav-end #x10ff) + (flava-cit-yellowsage #x1100) + (flava-cit-redsage #x1101) + (flava-cit-bluesage #x1102) + (flava-cit-hub #x1103) + (flava-fin-middle #x1104) + (flava-fin-end #x1105) + (flava-credits-middle #x1106) + (flava-credits-end #x1107) + (scene-0 #x1200) + (scene-255 #x12ff) + (hint-0 #x1300) + (hint-511 #x14ff) ;; GAME-TEXT-ID ENUM ENDS ) -;; an individual string. +;; an individual string. (deftype game-text (structure) ((id game-text-id :offset-assert 0) (text string :offset-assert 4) diff --git a/goal_src/engine/ui/text.gc b/goal_src/engine/ui/text.gc index 77749e9a16..4bfe2cd031 100644 --- a/goal_src/engine/ui/text.gc +++ b/goal_src/engine/ui/text.gc @@ -233,9 +233,10 @@ ) (defun load-level-text-files ((arg0 int)) - "If needed, load text" + "Load the text files needed for level idx. + This function made more sense back when text files were split up, but in the end they put everything + in a single text group and file." - ;; just load common. These flags are not yet understood. (if (or *level-text-file-load-flag* (>= arg0 0)) (load-game-text-info "common" '*common-text* *common-text-heap*) ) @@ -323,28 +324,28 @@ (set-vector! s5-0 128 128 128 128) (add-debug-line2d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> gp-0 vector)) (-> gp-0 vector 1) (the-as vector s5-0) ) (add-debug-line2d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 vector 1) (-> gp-0 vector 2) (the-as vector s5-0) ) (add-debug-line2d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 vector 2) (-> gp-0 vector 3) (the-as vector s5-0) ) (add-debug-line2d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 vector 3) (the-as vector (-> gp-0 vector)) (the-as vector s5-0) @@ -399,7 +400,7 @@ (none) ) -(defun print-game-text ((str string) (font-ctxt font-context) (alpha symbol) (offset-thing int) (arg4 int)) +(defun print-game-text ((str string) (font-ctxt font-context) (opaque symbol) (alpha int) (line-height int)) "Print text. Not worth commenting until we get stack variables in lets, I think" (local-vars (sv-112 float) @@ -424,235 +425,193 @@ (sv-208 symbol) (sv-212 symbol) ) - (let - ((gp-0 - (new - 'stack - 'font-context - *font-default-matrix* - (the int (-> font-ctxt origin x)) - (the int (-> font-ctxt origin y)) - 0.0 - (font-color default) - (font-flags shadow kerning) - ) - ) - ) - (when (< 0.1 (-> font-ctxt scale)) - (set! sv-112 (-> font-ctxt mat vector 0 x)) - (set! sv-116 (-> font-ctxt mat vector 1 y)) - (set! sv-120 (-> *video-parms* relative-x-scale)) - (set! sv-124 (-> *video-parms* relative-y-scale)) - (set! sv-128 (-> *video-parms* relative-x-scale-reciprical)) - (set! sv-132 (-> *video-parms* relative-y-scale-reciprical)) - (set! sv-136 (-> font-ctxt scale)) - (set! (-> gp-0 origin z) (-> font-ctxt origin z)) - (set! (-> gp-0 flags) (-> font-ctxt flags)) - (set! (-> gp-0 color) (-> font-ctxt color)) - (set! (-> gp-0 scale) sv-136) - (when (logtest? (-> gp-0 flags) (font-flags left)) - (logclear! (-> gp-0 flags) (font-flags left)) - (let ((f30-0 (-> gp-0 width)) - (f28-0 (-> gp-0 height)) - ) - (set! (-> gp-0 width) (-> font-ctxt width)) - (set! (-> gp-0 height) (-> font-ctxt height)) - (+! - (-> gp-0 origin y) - (the - float - (the - int - (* 0.5 (- (-> gp-0 height) (print-game-text str gp-0 #t 128 22))) - ) - ) - ) - (set! (-> gp-0 width) f30-0) - (set! (-> gp-0 height) f28-0) - ) - ) - (set! (-> gp-0 mat vector 0 x) (* (-> gp-0 mat vector 0 x) sv-136)) - (set! (-> gp-0 mat vector 1 y) (* (-> gp-0 mat vector 1 y) sv-136)) - (set! - (-> *video-parms* relative-x-scale) - (* (-> *video-parms* relative-x-scale) sv-136) - ) - (set! - (-> *video-parms* relative-y-scale) - (* (-> *video-parms* relative-y-scale) sv-136) - ) - (set! - (-> *video-parms* relative-x-scale-reciprical) - (/ 1.0 (-> *video-parms* relative-x-scale)) - ) - (set! (-> *video-parms* relative-y-scale-reciprical) (/ 1.0 sv-136)) - (set! sv-140 (-> str data)) - (set! sv-144 (-> gp-0 origin x)) - (set! sv-148 (-> gp-0 origin x)) - (set! sv-152 (+ (-> gp-0 origin x) (-> font-ctxt width))) - (set! sv-156 (+ (-> gp-0 origin y) (-> font-ctxt height))) - (set! - sv-160 - (* (get-string-length " " gp-0) (-> *video-parms* relative-x-scale)) - ) - (set! sv-164 (* (if (logtest? (-> gp-0 flags) 32) - (the float arg4) - 14.0 - ) - sv-136 - ) - ) - (set! sv-168 0) - (if (logtest? (-> gp-0 flags) 4) - (+! (-> gp-0 origin x) (* 0.5 (-> font-ctxt width))) - ) - (set! sv-176 (the-as int (-> sv-140 0))) ;; char - (set! sv-184 0) - (set! sv-192 0) - (set! sv-200 0) - (set! sv-208 (the-as symbol #f)) - (set! sv-212 (the-as symbol #f)) - (set! (-> *game-text-line* data 0) (the-as uint 0)) - (while - (or (not (and (zero? sv-176) (zero? sv-184) (zero? sv-192))) - (>= sv-156 (-> gp-0 origin y)) - ) - (cond - ((= sv-176 32) - (set! (-> *game-text-word* data sv-184) (the-as uint sv-176)) - (set! sv-184 (+ sv-184 1)) - (set! sv-208 #t) - ) - ((zero? sv-176) - (if (zero? sv-184) - (set! sv-212 #t) - (set! sv-208 #t) - ) - ) - (else - (if (= sv-176 95) - (set! sv-176 32) - ) - (set! (-> *game-text-word* data sv-184) (the-as uint sv-176)) - (set! sv-184 (+ sv-184 1)) - ) - ) - (when (= sv-208 #t) - (set! (-> *game-text-word* data sv-184) (the-as uint 0)) - (let* ((f30-1 sv-144) - (f0-49 - (* - (get-string-length *game-text-word* gp-0) - (-> *video-parms* relative-x-scale) - ) + (let ((gp-0 (new + 'stack + 'font-context + *font-default-matrix* + (the int (-> font-ctxt origin x)) + (the int (-> font-ctxt origin y)) + 0.0 + (font-color default) + (font-flags shadow kerning) + ) ) - (f1-14 (+ f30-1 f0-49)) - ) - (if (= (-> *game-text-word* data (+ sv-184 -1)) 32) - (set! f1-14 (- f1-14 sv-160)) ) - (cond - ((< sv-152 f1-14) - (set! sv-144 (+ sv-148 f0-49)) - (set! sv-212 #t) - ) - (else - (set! sv-144 (+ sv-144 f0-49)) - ) + (when (< 0.1 (-> font-ctxt scale)) + (set! sv-112 (-> font-ctxt mat vector 0 x)) + (set! sv-116 (-> font-ctxt mat vector 1 y)) + (set! sv-120 (-> *video-parms* relative-x-scale)) + (set! sv-124 (-> *video-parms* relative-y-scale)) + (set! sv-128 (-> *video-parms* relative-x-scale-reciprical)) + (set! sv-132 (-> *video-parms* relative-y-scale-reciprical)) + (set! sv-136 (-> font-ctxt scale)) + (set! (-> gp-0 origin z) (-> font-ctxt origin z)) + (set! (-> gp-0 flags) (-> font-ctxt flags)) + (set! (-> gp-0 color) (-> font-ctxt color)) + (set! (-> gp-0 scale) sv-136) + (when (logtest? (-> gp-0 flags) (font-flags left)) + (logclear! (-> gp-0 flags) (font-flags left)) + (let ((f30-0 (-> gp-0 width)) + (f28-0 (-> gp-0 height)) + ) + (set! (-> gp-0 width) (-> font-ctxt width)) + (set! (-> gp-0 height) (-> font-ctxt height)) + (+! (-> gp-0 origin y) + (the float (the int (* 0.5 (- (-> gp-0 height) (print-game-text str gp-0 #t 128 22))))) + ) + (set! (-> gp-0 width) f30-0) + (set! (-> gp-0 height) f28-0) + ) ) - ) - ) - (when (= sv-212 #t) - (when (>= sv-200 (the-as int (-> gp-0 start-line))) - (let ((f30-2 (+ (-> gp-0 origin y) sv-164))) - (when (>= sv-156 f30-2) - (when (= (-> *game-text-line* data (+ sv-192 -1)) 32) - (set! (-> *game-text-line* data (+ sv-192 -1)) (the-as uint 0)) - (when - (and - (= (-> *game-text-line* data (+ sv-192 -5)) 126) - (= (-> *game-text-line* data (+ sv-192 -2)) 72) + (set! (-> gp-0 mat vector 0 x) (* (-> gp-0 mat vector 0 x) sv-136)) + (set! (-> gp-0 mat vector 1 y) (* (-> gp-0 mat vector 1 y) sv-136)) + (set! (-> *video-parms* relative-x-scale) (* (-> *video-parms* relative-x-scale) sv-136)) + (set! (-> *video-parms* relative-y-scale) (* (-> *video-parms* relative-y-scale) sv-136)) + (set! (-> *video-parms* relative-x-scale-reciprical) (/ 1.0 (-> *video-parms* relative-x-scale))) + (set! (-> *video-parms* relative-y-scale-reciprical) (/ 1.0 sv-136)) + (set! sv-140 (-> str data)) + (set! sv-144 (-> gp-0 origin x)) + (set! sv-148 (-> gp-0 origin x)) + (set! sv-152 (+ (-> gp-0 origin x) (-> font-ctxt width))) + (set! sv-156 (+ (-> gp-0 origin y) (-> font-ctxt height))) + (set! sv-160 (* (get-string-length " " gp-0) (-> *video-parms* relative-x-scale))) + (set! sv-164 (* (if (logtest? (-> gp-0 flags) (font-flags large)) + (the float line-height) + 14.0 + ) + sv-136 + ) ) - (set! (-> *game-text-line* data (+ sv-192 -5)) (the-as uint 0)) - 0 - ) + (set! sv-168 0) + (if (logtest? (-> gp-0 flags) (font-flags middle)) + (+! (-> gp-0 origin x) (* 0.5 (-> font-ctxt width))) ) - ) - (when - (and - (= (-> *game-text-line* data (+ sv-192 -4)) 126) - (= (-> *game-text-line* data (+ sv-192 -1)) 72) - ) - (set! (-> *game-text-line* data (+ sv-192 -4)) (the-as uint 0)) - 0 - ) - (if (nonzero? (-> *game-text-line* data 0)) - (set! sv-168 (+ sv-168 1)) - ) - (when (not alpha) - (let* - ((s1-1 - (-> *display* frames (-> *display* on-screen) frame global-buf) - ) - (s2-1 (-> s1-1 base)) - ) - (set-font-color-alpha (-> font-ctxt color) offset-thing) - (draw-string *game-text-line* s1-1 gp-0) - (set-font-color-alpha (-> font-ctxt color) 128) - (set! (-> gp-0 color) (-> *font-work* last-color)) - (let ((a3-3 (-> s1-1 base))) - (let ((v1-127 (the-as object (-> s1-1 base)))) - (set! - (-> (the-as dma-packet v1-127) dma) - (new 'static 'dma-tag :id (dma-tag-id next)) - ) - (set! (-> (the-as dma-packet v1-127) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-127) vif1) (new 'static 'vif-tag)) - (set! (-> s1-1 base) (&+ (the-as pointer v1-127) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - s2-1 - (the-as (pointer dma-tag) a3-3) - ) - ) - ) - ) - (set! (-> gp-0 origin y) f30-2) - ) - ) - (set! sv-200 (+ sv-200 1)) - (set! (-> *game-text-line* data 0) (the-as uint 0)) - (set! sv-192 0) - (set! sv-212 (the-as symbol #f)) - ) - (when (= sv-208 #t) - (copy-charp<-charp - (&-> *game-text-line* data sv-192) - (-> *game-text-word* data) - ) - (set! sv-192 (+ sv-192 sv-184)) - (set! sv-184 0) - (set! sv-208 (the-as symbol #f)) - ) - (when (nonzero? sv-176) - (set! sv-140 (&-> sv-140 1)) (set! sv-176 (the-as int (-> sv-140 0))) + (set! sv-184 0) + (set! sv-192 0) + (set! sv-200 0) + (set! sv-208 (the-as symbol #f)) + (set! sv-212 (the-as symbol #f)) + (set! (-> *game-text-line* data 0) (the-as uint 0)) + (while (or (not (and (zero? sv-176) (zero? sv-184) (zero? sv-192))) (>= sv-156 (-> gp-0 origin y))) + (cond + ((= sv-176 32) + (set! (-> *game-text-word* data sv-184) (the-as uint sv-176)) + (set! sv-184 (+ sv-184 1)) + (set! sv-208 #t) + ) + ((zero? sv-176) + (if (zero? sv-184) + (set! sv-212 #t) + (set! sv-208 #t) + ) + ) + (else + ;; PAL patch here + (if (= sv-176 3) + (set! sv-176 32) + ) + (set! (-> *game-text-word* data sv-184) (the-as uint sv-176)) + (set! sv-184 (+ sv-184 1)) + ) + ) + (when (= sv-208 #t) + (set! (-> *game-text-word* data sv-184) (the-as uint 0)) + (let* ((f30-1 sv-144) + (f0-49 (* (get-string-length *game-text-word* gp-0) (-> *video-parms* relative-x-scale))) + (f1-14 (+ f30-1 f0-49)) + ) + (if (= (-> *game-text-word* data (+ sv-184 -1)) 32) + (set! f1-14 (- f1-14 sv-160)) + ) + (cond + ((< sv-152 f1-14) + (set! sv-144 (+ sv-148 f0-49)) + (set! sv-212 #t) + ) + (else + (set! sv-144 (+ sv-144 f0-49)) + ) + ) + ) + ) + (when (= sv-212 #t) + (when (>= sv-200 (the-as int (-> gp-0 start-line))) + (let ((f30-2 (+ (-> gp-0 origin y) sv-164))) + (when (>= sv-156 f30-2) + (when (= (-> *game-text-line* data (+ sv-192 -1)) 32) + (set! (-> *game-text-line* data (+ sv-192 -1)) (the-as uint 0)) + (when (and (= (-> *game-text-line* data (+ sv-192 -5)) 126) (= (-> *game-text-line* data (+ sv-192 -2)) 72)) + (set! (-> *game-text-line* data (+ sv-192 -5)) (the-as uint 0)) + 0 + ) + ) + ) + (when (and (= (-> *game-text-line* data (+ sv-192 -4)) 126) (= (-> *game-text-line* data (+ sv-192 -1)) 72)) + (set! (-> *game-text-line* data (+ sv-192 -4)) (the-as uint 0)) + 0 + ) + (if (nonzero? (-> *game-text-line* data 0)) + (set! sv-168 (+ sv-168 1)) + ) + (when (not opaque) + (let* ((s1-1 (-> *display* frames (-> *display* on-screen) frame global-buf)) + (s2-1 (-> s1-1 base)) + ) + (set-font-color-alpha (-> font-ctxt color) alpha) + (draw-string *game-text-line* s1-1 gp-0) + (set-font-color-alpha (-> font-ctxt color) 128) + (set! (-> gp-0 color) (-> *font-work* last-color)) + (let ((a3-3 (-> s1-1 base))) + (let ((v1-127 (the-as object (-> s1-1 base)))) + (set! (-> (the-as dma-packet v1-127) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-127) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-127) vif1) (new 'static 'vif-tag)) + (set! (-> s1-1 base) (&+ (the-as pointer v1-127) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) frame bucket-group) + (bucket-id debug) + s2-1 + (the-as (pointer dma-tag) a3-3) + ) + ) + ) + ) + (set! (-> gp-0 origin y) f30-2) + ) + ) + (set! sv-200 (+ sv-200 1)) + (set! (-> *game-text-line* data 0) (the-as uint 0)) + (set! sv-192 0) + (set! sv-212 (the-as symbol #f)) + ) + (when (= sv-208 #t) + (copy-charp<-charp (&-> *game-text-line* data sv-192) (-> *game-text-word* data)) + (set! sv-192 (+ sv-192 sv-184)) + (set! sv-184 0) + (set! sv-208 (the-as symbol #f)) + ) + (when (nonzero? sv-176) + (set! sv-140 (&-> sv-140 1)) + (set! sv-176 (the-as int (-> sv-140 0))) + ) + ) + (set! (-> gp-0 mat vector 0 x) sv-112) + (set! (-> gp-0 mat vector 1 y) sv-116) + (set! (-> *video-parms* relative-x-scale) sv-120) + (set! (-> *video-parms* relative-y-scale) sv-124) + (set! (-> *video-parms* relative-x-scale-reciprical) sv-128) + (set! (-> *video-parms* relative-y-scale-reciprical) sv-132) + (with-pc + (if (and *debug-segment* (-> *pc-settings* display-text-box)) + (draw-debug-text-box font-ctxt))) + (if (> sv-168 0) + (* sv-164 (the float sv-168)) + 0.0 + ) ) - ) - (set! (-> gp-0 mat vector 0 x) sv-112) - (set! (-> gp-0 mat vector 1 y) sv-116) - (set! (-> *video-parms* relative-x-scale) sv-120) - (set! (-> *video-parms* relative-y-scale) sv-124) - (set! (-> *video-parms* relative-x-scale-reciprical) sv-128) - (set! (-> *video-parms* relative-y-scale-reciprical) sv-132) - (if (> sv-168 0) - (* sv-164 (the float sv-168)) - 0.0 - ) ) - ) ) (defun disable-level-text-file-loading () diff --git a/goal_src/examples/debug-draw-example.gc b/goal_src/examples/debug-draw-example.gc index 029907d5e9..5ef1ef25e0 100644 --- a/goal_src/examples/debug-draw-example.gc +++ b/goal_src/examples/debug-draw-example.gc @@ -102,23 +102,9 @@ ) (dotimes (i 10) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 37) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 + (launch-particles (-> *part-id-table* 37) gp-0) + (launch-particles (-> *part-id-table* 38) gp-0) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 38) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - ) ) ) 0 @@ -355,7 +341,7 @@ (defun load-slot-1 ((lev symbol)) (load-state-want-levels (-> *load-state* want 0 name) lev) (set! *debug-load-level* lev) - (make-function-process + (process-new-function process (lambda () (suspend) @@ -368,4 +354,4 @@ (load-state-want-display-level *debug-load-level* #t) ) ) - ) \ No newline at end of file + ) diff --git a/goal_src/examples/display-all-colors.gc b/goal_src/examples/display-all-colors.gc new file mode 100644 index 0000000000..3a068c8a43 --- /dev/null +++ b/goal_src/examples/display-all-colors.gc @@ -0,0 +1,61 @@ +;;-*-Lisp-*- +(in-package goal) + +;; This script creates a simple process that draws text demonstrating +;; all of GOAL's color constants to the on-screen debug output. + +;; Create somewhere for the handle to the process to live. See https://open-goal.github.io/docs/reference/process_and_state +;; as well as kernel/gstate.gc +(define *color-display-handle* (new 'static 'handle)) +(set! *color-display-handle* (the handle #f)) + + +(defun-debug start-display-text-colors () + "Spawn an onscreen string displaying all possible colors" + (if (not (handle->process *color-display-handle*)) + (let ((disp-proc + (process-spawn-function process :name 'display-proc + (lambda :behavior process () + (stack-size-set! (-> self main-thread) 256) + (loop + ;; These constants live in engine/gfx/font-h.gc + (format *stdcon* "~0k~%~% +~0L 0 default ~1L 1 white +~2L 2 gray ~3L 3 orange-red +~4L 4 bright-orange-red ~5L 5 bright-orange-red +~6L 6 bright-green ~7L 7 dark-blue +~8L 8 light-blue ~9L 9 dark-pink +~10L10 lighter-blue ~11L11 dark-light-blue +~12L12 dim-white ~13L13 dim-gray +~14L14 orange-red-2 ~15L15 yellow-green +~16L16 dark-green ~17L17 another-gray +~18L18 dark-dark-green ~19L19 flat-dark-purple +~20L20 flat-yellow ~21L21 blue-white +~22L22 pad-back ~23L23 pad-shine +~24L24 pad-square ~25L25 pad-circle +~26L26 pad-triangle ~27L27 pad-x +~28L28 lighter-lighter-blue ~29L29 yellow-orange +~30L30 yellow-green-2 ~31L31 another-light-blue +~32L32 light-yellow ~33L33 red-orange +~34L34 another-orange-red~0L~% + alternate names + ~3L3 red ~4L4 red2 ~5L5 yellow ~6L6 green ~7L7 blue + ~10L10 cyan ~33L33 red-reverse ~34L34 red-obverse~0L" + ) + (suspend) + ) + ) + ) + )) + (set! *color-display-handle* (ppointer->handle disp-proc)) + ) + ;; else + (format #t "Colors are already being displayed") + ) + ) + + +(defun-debug stop-display-text-colors () + "Kill the example text color display" + (kill-by-name 'display-proc *active-pool*) + ) diff --git a/goal_src/game.gp b/goal_src/game.gp index f8ccbc94bc..434554a9a3 100644 --- a/goal_src/game.gp +++ b/goal_src/game.gp @@ -25,6 +25,18 @@ ;; It is an error to not provide a step to make a required file. ;; It is an error to have a circular dependency and this will crash the compiler due to stack overflow. +;;;;;;;;;;;;;;;;;;;;;;; +;; Build Groups +;;;;;;;;;;;;;;;;;;;;;;; +(define *all-cgos* '()) +(define *all-str* '()) +(define *all-vis* '()) +(define *all-mus* '()) +(define *all-sbk* '()) +(define *all-vag* '()) +(define *all-gc* '()) + + ;;;;;;;;;;;;;;;;;;;;;;; ;; Build system macros ;;;;;;;;;;;;;;;;;;;;;;; @@ -40,24 +52,29 @@ (defmacro goal-src (src-file &rest deps) "Add a GOAL source file with the given dependencies" - `(defstep :in ,(string-append "goal_src/" src-file) + `(let ((output-file ,(gc-file->o-file src-file))) + (set! *all-gc* (cons output-file *all-gc*)) + (defstep :in ,(string-append "goal_src/" src-file) ;; use goal compiler :tool 'goalc ;; will output the obj file - :out '(,(gc-file->o-file src-file)) + :out (list output-file) ;; dependencies are the obj files :dep '(,@(apply gc-file->o-file deps)) ) + ) ) (defun make-src-sequence-elt (current previous prefix) "Helper for goal-src-sequence" - `(defstep :in ,(string-append "goal_src/" prefix current) + `(let ((output-file ,(gc-file->o-file current))) + (set! *all-gc* (cons output-file *all-gc*)) + (defstep :in ,(string-append "goal_src/" prefix current) :tool 'goalc - :out '(,(gc-file->o-file current)) - :dep '(#|"iso/KERNEL.CGO"|# - ,(gc-file->o-file previous)) + :out (list output-file) + :dep '(,(gc-file->o-file previous)) ) + ) ) (defmacro goal-src-sequence (prefix &key (deps '()) &rest sequence) @@ -86,7 +103,17 @@ ) ) -(define *all-cgos* '()) +(defun custom-level-cgo (output-name desc-file-name) + "Add a CGO with the given output name (in out/iso) and input name (in custom_levels/)" + (let ((out-name (string-append "out/iso/" output-name))) + (defstep :in (string-append "custom_levels/" desc-file-name) + :tool 'dgo + :out `(,out-name) + ) + (set! *all-cgos* (cons out-name *all-cgos*)) + ) + ) + (defun cgo (output-name desc-file-name) "Add a CGO with the given output name (in out/iso) and input name (in goal_src/dgos)" (let ((out-name (string-append "out/iso/" output-name))) @@ -105,6 +132,8 @@ (define *game-directory* (get-environment-variable "OPENGOAL_DECOMP_DIR" :default "jak1/")) +(when (user? dass) + (set! *game-directory* "jak1_us2/")) (defmacro copy-texture (tpage-id) "Copy a texture from the game, using the given tpage ID" @@ -131,35 +160,44 @@ ) ) +(defmacro build-custom-level (name) + (let* ((path (string-append "custom_levels/" name "/" name ".jsonc"))) + `(defstep :in ,path + :tool 'build-level + :out '(,(string-append "out/obj/" name ".go"))))) + +(defun get-iso-data-path () + (if *use-iso-data-path* + (string-append *iso-data* "/") + (string-append "iso_data/" *game-directory* "/") + ) + ) + (defun copy-iso-file (name subdir ext) - (let* ((path (string-append "iso_data/" *game-directory* subdir name ext)) + (let* ((path (string-append (get-iso-data-path) subdir name ext)) (out-name (string-append "out/iso/" name ext))) (defstep :in path :tool 'copy :out `(,out-name)) out-name)) -(define *all-str* '()) (defmacro copy-strs (&rest strs) `(begin ,@(apply (lambda (x) `(set! *all-str* (cons (copy-iso-file ,x "STR/" ".STR") *all-str*))) strs))) -(define *all-vis* '()) (defmacro copy-vis-files (&rest files) `(begin ,@(apply (lambda (x) `(set! *all-vis* (cons (copy-iso-file ,x "VIS/" ".VIS") *all-vis*))) files))) ;; Files not yet added in here: ;; - TESTTONE.SBK -(define *all-sbk* '()) (defmacro copy-sbk-files (&rest files) `(begin ,@(apply (lambda (x) `(set! *all-sbk* (cons (copy-iso-file ,x "SBK/" ".SBK") *all-sbk*))) files))) -;; Files not yet added in here: -;; - DANGER.MUS -;; - TWEAKVAL.MUS -(define *all-mus* '()) (defmacro copy-mus-files (&rest files) `(begin ,@(apply (lambda (x) `(set! *all-mus* (cons (copy-iso-file ,x "MUS/" ".MUS") *all-mus*))) files))) +(defmacro copy-vag-files (&rest files) + `(begin ,@(apply (lambda (x) `(set! *all-vag* (cons (copy-iso-file "VAGWAD" "VAG/" (string-append "." ,x)) *all-vag*))) files))) + (defmacro group (name &rest stuff) `(defstep :in "" :tool 'group @@ -222,22 +260,22 @@ ) ;; the TWEAKVAL file -(defstep :in (string-append "iso_data/" *game-directory* "MUS/TWEAKVAL.MUS") +(defstep :in (string-append (get-iso-data-path) "MUS/TWEAKVAL.MUS") :tool 'copy :out '("out/iso/TWEAKVAL.MUS")) ;; the VAGDIR file -(defstep :in (string-append "iso_data/" *game-directory* "VAG/VAGDIR.AYB") +(defstep :in (string-append (get-iso-data-path) "VAG/VAGDIR.AYB") :tool 'copy :out '("out/iso/VAGDIR.AYB")) ;; the save icon file -(defstep :in (string-append "iso_data/" *game-directory* "DRIVERS/SAVEGAME.ICO") +(defstep :in (string-append (get-iso-data-path) "DRIVERS/SAVEGAME.ICO") :tool 'copy :out '("out/iso/SAVEGAME.ICO")) ;; the loading screen file -(defstep :in (string-append "iso_data/" *game-directory* "DRIVERS/SCREEN1.USA") +(defstep :in (string-append (get-iso-data-path) "DRIVERS/SCREEN1.USA") :tool 'copy :out '("out/iso/SCREEN1.USA")) @@ -280,14 +318,7 @@ "DE0197" "DE0199" "DE0202" - ;; jak other - "EIFISH" - "EIICE" - "EIFLUT" - "EIPOLE" - "EIRACER" - "EITUBE" - + ;; intro camera "NDINTRO" "LOINTRO" @@ -317,7 +348,7 @@ ;; Text ;;;;;;;;;;;;;;;;;;;;; -(defstep :in "assets/game_text.txt" +(defstep :in "game/assets/game_text.gp" :tool 'text :out '("out/iso/0COMMON.TXT" "out/iso/1COMMON.TXT" @@ -328,7 +359,7 @@ "out/iso/6COMMON.TXT") ) -(defstep :in "game/assets/game_subtitle.txt" +(defstep :in "game/assets/game_subtitle.gp" :tool 'subtitle :out '("out/iso/0SUBTIT.TXT" "out/iso/3SUBTIT.TXT" @@ -349,32 +380,17 @@ "out/iso/GAME.CGO" ) - -;;;;;;;;;;;;;;;;;;;;; -;; hub1 Group -;;;;;;;;;;;;;;;;;;;;; -;; the hub1 group is a group of files required to play the first hub (village1, jungle, beach, misty, training, firecanyon) - -(group "hub1" - "out/iso/0COMMON.TXT" - "out/iso/0SUBTIT.TXT" - "out/iso/KERNEL.CGO" - "out/iso/GAME.CGO" - "out/iso/VI1.DGO" - "out/iso/TRA.DGO" - "out/iso/FIC.DGO" - "out/iso/JUN.DGO" - "out/iso/BEA.DGO" - "out/iso/MIS.DGO" - ) - ;;;;;;;;;;;;;;;;;;;;;;;; ;; Common Level Objects ;;;;;;;;;;;;;;;;;;;;;;;; ;; as we find objects that exist in multiple levels, put them here -(copy-sbk-files "COMMON" "EMPTY1" "EMPTY2") +;; early versions of the game - including the black label release - do not have all files. +(if *jak1-full-game* + (copy-sbk-files "COMMON" "COMMONJ" "EMPTY1" "EMPTY2") + (copy-sbk-files "COMMON" "EMPTY1" "EMPTY2") + ) (copy-gos "sharkey-ag" @@ -642,7 +658,7 @@ ;; oracle (copy-strs "ORI1" "ORLE1" "ORRE1" "ORR1") ;; assistant -(copy-strs "ASIBESWI" "ASR1BESW") +(copy-strs "ASIBESWI" "ASR1BESW" "ASIRBIKE" "ASR1RBIK" "ASR1GENE") ;; sage (copy-strs "SAISA" "SAISD1" "SAISD2" "SAISE" "SAR1ECOR" "SAIMCANN" "SAR1MCAN" "SAR1GENE" "SAR2GENE") ;; fishermans-boat @@ -1560,6 +1576,17 @@ "ndi-volumes-ag" "title-vis") +;;;;;;;;;;;;;;;;;;;;;;;;; +;; Example Custom Level +;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Set up the build system to build the level geometry +;; this path is relative to the custom_levels/ folder +;; it should point to the .jsonc file that specifies the level. +(build-custom-level "test-zone") +;; the DGO file +(custom-level-cgo "TESTZONE.DGO" "test-zone/testzone.gd") + ;;;;;;;;;;;;;;;;;;;;; ;; Game Engine Code ;;;;;;;;;;;;;;;;;;;;; @@ -1611,7 +1638,17 @@ "dma/dma-buffer.gc" "dma/dma-bucket.gc" "dma/dma-disasm.gc" - "ps2/pad.gc" + ) + + +(goal-src "engine/ps2/pad.gc" "pckernel-h") + +(goal-src-sequence + ;; prefix + "engine/" + + :deps + ("out/ps2/pad.o") "gfx/hw/gs.gc" "gfx/hw/display-h.gc" "math/vector.gc" @@ -1625,6 +1662,7 @@ "gfx/decomp-h.gc" "gfx/hw/display.gc" "engine/connect.gc" + "ui/text-h.gc" "game/settings-h.gc" "gfx/capture.gc" "debug/memory-usage-h.gc" @@ -1714,6 +1752,7 @@ "camera/cam-update-h.gc" "debug/assert-h.gc" "ui/hud-h.gc" + "ui/progress-h.gc" "ps2/rpc-h.gc" "nav/path-h.gc" "nav/navigate-h.gc" @@ -1827,7 +1866,17 @@ "gfx/tie/prototype.gc" "collide/main-collide.gc" "game/video.gc" - "game/main.gc" + ) + +(goal-src "engine/game/main.gc" "pckernel" "video") + +(goal-src-sequence + ;; prefix + "engine/" + + :deps + ("out/main.o") + "collide/collide-cache.gc" "entity/relocate.gc" "debug/memory-usage.gc" @@ -1847,7 +1896,10 @@ "game/crates.gc" "ui/hud.gc" "ui/hud-classes.gc" + "ui/progress/progress-static.gc" "ui/progress/progress-part.gc" + "ui/progress/progress-draw.gc" + "ui/progress/progress.gc" "ui/credits.gc" "game/projectiles.gc" "gfx/ocean/ocean.gc" @@ -1863,7 +1915,6 @@ "debug/anim-tester.gc" "debug/viewer.gc" "debug/part-tester.gc" - "debug/default-menu.gc" ) (goal-src-sequence @@ -1890,6 +1941,9 @@ "ticky.gc" ) +(copy-mus-files "DANGER") + +(copy-vag-files "ENG" "FRE" "GER" "ITA" "SPA" "JAP") ;;;;;;;;;;;;;;;;;;;;; ;; ISO Group @@ -1900,34 +1954,38 @@ `("out/iso/0COMMON.TXT" "out/iso/0SUBTIT.TXT" "out/iso/TWEAKVAL.MUS" - ,@(reverse *all-cgos*) + "out/iso/VAGDIR.AYB" ,@(reverse *all-vis*) ,@(reverse *all-str*) ,@(reverse *all-sbk*) - ,@(reverse *all-mus*)) + ,@(reverse *all-mus*) + ,@(reverse *all-vag*) + ,@(reverse *all-cgos*)) ) -(group-list "spools" - `(,@(reverse *all-str*)) - ) +;;(fmt #t "found {} spools\n" (count *all-str*)) +(group-list "spools" *all-str*) + (group-list "text" - `( - "out/iso/0COMMON.TXT" + `("out/iso/0COMMON.TXT" "out/iso/0SUBTIT.TXT" ) ) - ;; Custom or Modified Code (goal-src "pc/pckernel-h.gc" "dma-disasm") -(goal-src "pc/pckernel.gc" "settings") -(goal-src "pc/subtitle.gc" "text") +(goal-src "pc/pckernel.gc" "settings" "video") +(goal-src "pc/subtitle.gc" "text" "pckernel" "hint-control" "loader-h" "gsound" "ambient") +(goal-src "pc/progress-pc.gc" "progress" "pckernel") +(goal-src "pc/anim-tester-x.gc" "pckernel" "gstring" "joint" "process-drawable" "art-h" "effect-control") +(goal-src "pc/hud-classes-pc.gc" "pckernel" "hud" "battlecontroller" "generic-obs") -(goal-src "pc/engine/ui/text-h.gc" "connect") -(goal-src "pc/engine/ui/progress-h.gc" "hud-h") -(goal-src "pc/engine/ui/progress/progress-static.gc" "hud-classes") -(goal-src "pc/engine/ui/progress/progress-draw.gc" "progress-part") -(goal-src "pc/engine/ui/progress/progress.gc" "progress-draw") +;; the debug menu is modified to include PC specific options: +(goal-src "engine/debug/default-menu.gc" "anim-tester-x" "part-tester") + +(group-list "all-code" + `(,@(reverse *all-gc*)) + ) diff --git a/goal_src/goal-lib.gc b/goal_src/goal-lib.gc index cdd1020c30..0ec598c8e1 100644 --- a/goal_src/goal-lib.gc +++ b/goal_src/goal-lib.gc @@ -5,9 +5,6 @@ ;; OTHER STUFF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; get list of all goal files -(asm-file "goal_src/build/all_files.gc") - ;; tell compiler about stuff defined/implemented in the runtime. (asm-file "goal_src/kernel-defs.gc") @@ -37,31 +34,28 @@ `(asm-file ,file :color :write) ) +(desfun run-frontend-command (file) + `(asm-file ,file :no-code) + ) + + +(defmacro load-art-import (name) + `(asm-file ,(string-append "goal_src/import/" (symbol->string name) "-ag.gc") :no-code :no-throw)) + +(defmacro load-imports () + `(begin + ,@(apply run-frontend-command all-import-files) + ) + ) (defmacro build-kernel () "Build kernel and create the KERNEL CGO" - `(begin - ,@(apply make-build-command all-kernel-goal-files) - (build-dgos "goal_src/build/kernel_dgos.gc") - ) + `(make-cgo "KERNEL") ) (defmacro build-game () "Build all game code and all game CGOs" - `(begin - (build-kernel) - ,@(apply make-build-command all-goal-files) - (build-dgos "goal_src/build/game_dgos.gc") - ) - ) - -(defmacro build-data () - "Build all game data" - `(begin - (asm-data-file game-text "assets/game_text.txt") - (asm-data-file game-count "assets/game_count.txt") - (asm-data-file dir-tpages "assets/tpage-dir.txt") - ) + `(make-group "all-code") ) (defmacro blg () @@ -69,7 +63,7 @@ Uses the blocking dgo-load." `(begin (build-game) - (dgo-load "kernel" global #xf #x200000) + (dgo-load "kernel" global (link-flag output-load-msg output-load-true-msg execute-login print-login) #x200000) (load-package "game" global) ) ) @@ -97,6 +91,10 @@ ) ) +(defmacro import (file-name) + `(asm-file ,file-name :no-code) + ) + ;; enum for text file encoding versions (defenum game-text-version (jak1-v1 10) @@ -251,10 +249,9 @@ ;; Define a new function (defmacro defun (name bindings &rest body) - (if (and - (> (length body) 1) ;; more than one thing in function - (string? (first body)) ;; first thing is a string - ) + (if (and (> (length body) 1) ;; more than one thing in function + (string? (first body)) ;; first thing is a string + ) ;; then it's a docstring and we ignore it. `(define ,name (lambda :name ,name ,bindings ,@(cdr body))) ;; otherwise don't ignore it. @@ -438,16 +435,23 @@ ) ) -(defmacro swhen (condition &rest body) - "Same as when, but saves the branch condition onto a variable named bc" +(defmacro aif (condition true &rest false) + "Anaphoric if, similar to Common Lisp" - `(let ((bc ,condition)) - (if bc - (begin ,@body) + `(let ((it ,condition)) + (if it + ,true + ,@false ) ) ) +(defmacro awhen (condition &rest body) + "Anaphoric when" + + `(aif ,condition (begin ,@body) #f) + ) + (defmacro return (val) `(return-from #f ,val) ) @@ -460,7 +464,8 @@ (defmacro case (switch &key (comp =) &rest cases) "A switch-case construct. switch is saved onto a local variable and compared against each case, sequentially. - else can be used like the 'default' case, but it must be the last one." + else can be used like the 'default' case, but it must be the last one. + comp is the function to use when evaluating the clauses. It can be any valid head of a form (operator or call)." (with-gensyms (sw) ;; save the switch to a variable (only evaluated once) @@ -519,11 +524,11 @@ ) (defmacro 1+! (place) - `(set! ,place (+ 1 ,place)) + `(+! ,place 1) ) (defmacro 1- (var) - `(- ,var 1) + `(+ ,var -1) ) (defmacro dec (val) @@ -535,7 +540,7 @@ ) (defmacro 1-! (place) - `(set! ,place (- 1 ,place)) + `(-! ,place 1) ) (defmacro *! (place amount) @@ -656,7 +661,7 @@ ) (defmacro mod-0-guard (a b) - "same as divide but returns the remainder when divisor is zero (EE-like)." + "same as modulo but returns the dividend when divisor is zero (EE-like)." `(let ((divisor ,b)) (if (zero? divisor) ,a @@ -664,6 +669,11 @@ ) ) +(defmacro float->int (a) + "forcefully casts something as a float to int. be careful." + `(the int (the float ,a)) + ) + ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Bit Macros ;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -768,6 +778,18 @@ `(new 'debug 'pair ,a ,b) ) +(defmacro cons! (lst val) + `(set! ,lst (cons ,val ,lst)) + ) + +(defmacro swap! (a b) + "macro for swapping 2 variables" + `(let ((temp ,a)) + (set! ,a ,b) + (set! ,b temp) + ) + ) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ARRAYS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -799,8 +821,8 @@ (defmacro object-new (allocation type-to-make &rest sz) (if (null? sz) - `(the ,(current-method-type) ((method-of-type object new) ,allocation ,type-to-make (the int (-> ,type-to-make size)))) - `(the ,(current-method-type) ((method-of-type object new) ,allocation ,type-to-make ,@sz)) + `(the (current-method-type) ((method-of-type object new) ,allocation ,type-to-make (the int (-> ,type-to-make size)))) + `(the (current-method-type) ((method-of-type object new) ,allocation ,type-to-make ,@sz)) ) ) @@ -893,10 +915,11 @@ `(make-group "engine") ) -(defmacro mh1 () - "Make hub1" - `(make-group "hub1") +(defmacro make-text () + "Make Text" + `(make-group "text") ) + ;;;;;;;;;;;;;;;;;;; ;; enum stuff ;;;;;;;;;;;;;;;;;;; @@ -928,6 +951,22 @@ ) ) +(defmacro doenum (bindings &rest body) + "run body while iterating through an enum. + WARNING: enums are NOT A RUNTIME TYPE! There is an UNWOUND loop with body in it!! Use with caution." + ;; (doenum (name-var val-var enum &rest result) &rest body) + + `(begin ,@(apply (lambda (x) + ;; (fmt #t "{}\n" x) + `(let ( + (,(first bindings) ,(symbol->string (car x))) ;; name + (,(second bindings) ,(cdr x)) ;; value + ) + ,@body + )) (get-enum-vals (third bindings)))) + + ) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; float macros ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -948,9 +987,6 @@ `(sqrtf-no-fabs (fabs ,x)) ) -;; load the default project -(load-project "goal_src/game.gp") - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; user stuf @@ -962,6 +998,60 @@ (defconstant *user* (__get-user)) +(defmacro user? (&rest users) + (cond + ((null? users) #f) + ((eq? *user* (car users)) #t) + (#t `(user? ,@(cdr users))) + ) + ) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; art stuff +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defmacro def-art-elt (group name idx) + "define a new art element. adds it to a global map stored in goos." + + ;; grab data about the art group + (let* ((group-string (symbol->string group)) + (name-string (symbol->string name)) + (ag-info-lookup (hash-table-try-ref *art-info* group-string)) + (ag-info-exists (car ag-info-lookup)) + (ag-info (cdr ag-info-lookup)) + ) + ;; no art group was found, make a new one and add it. + (when (not ag-info-exists) + (set! ag-info (make-string-hash-table)) + (hash-table-set! *art-info* group-string ag-info) + ) + ;; lookup art element in our art group + (let* ((elt-info-lookup (hash-table-try-ref ag-info name-string)) + (elt-info-exists (car elt-info-lookup)) + (elt-new (list name idx))) ;; this is the format of the individual entries + ;; found, check if valid + (if (and elt-info-exists (not (eq? (cdr elt-info-lookup) elt-new))) + (fmt #t "error redefining art element. data mismatch: {}" elt-info elt-new) + #f) + ;; not found. add to the art-group. + (when (not elt-info-exists) + (hash-table-set! ag-info name-string elt-new) + ) + ) + ) + ;; define a constant for it! + `(defconstant ,name (-> self draw art-group data ,idx)) + ) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; build system stuff +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; hack to get a goos variable in goal +(defmacro __get_jak1_full_game () *jak1-full-game*) +(defconstant *jak1-full-game* (__get_jak1_full_game)) + +;; load the default project +(load-project "goal_src/game.gp") diff --git a/goal_src/goos-lib.gs b/goal_src/goos-lib.gs index 8a29a18b0b..5370c6707a 100644 --- a/goal_src/goos-lib.gs +++ b/goal_src/goos-lib.gs @@ -35,6 +35,17 @@ `(if (not ,clause) (begin ,@body) #f) ) +(defsmacro aif (condition true false) + "Anaphoric if, similar to Common Lisp" + + `(let ((it ,condition)) + (if it + ,true + ,false + ) + ) + ) + (desfun factorial (x) (if (= x 1) 1 @@ -97,6 +108,12 @@ `(set! ,lst (cdr ,lst)) ) +(desfun count (lst) + (if (null? lst) + 0 + (+ 1 (count (cdr lst)))) + ) + (desfun apply (fun x) (if (null? x) '() @@ -229,6 +246,7 @@ ) ) +(defsmacro cons! (lst obj) `(set! ,lst (cons ,obj ,lst))) (desfun append! (lst obj) "adds obj to the end of lst. only edits inplace if lst is not null." @@ -285,6 +303,16 @@ `(type? 'integer ,x) ) +(defsmacro number? (x) + `(or (float? ,x) (integer? ,x)) + ) + +(defsmacro neq? (a b) `(not (eq? ,a ,b))) + +(defsmacro != (a b) `(not (= ,a ,b))) +(defsmacro zero? (x) `(= ,x 0)) +(defsmacro nonzero? (x) `(!= ,x 0)) + (defsmacro pair? (x) `(type? 'pair ,x) ) @@ -377,7 +405,7 @@ (desfun enum-max (enum) "get the highest value in an enum" - (let ((max-val -999999999)) + (let ((max-val -999999999999)) (doenum (name val enum) (when (> val max-val) (set! max-val val)) @@ -416,3 +444,17 @@ ) +;;;;;;;;;;;;;;;;;;;;;;;; +;; GAME STUFF!!! ;; +;;;;;;;;;;;;;;;;;;;;;;;; + +;; a map for art definitions used by art loading code. +(define *art-info* (make-string-hash-table)) + + +;;;;;;;;;;;;;;;;;;;;;;;; +;; build system ;; +;;;;;;;;;;;;;;;;;;;;;;;; + +(define *jak1-full-game* (if (user? dass) #t #f)) + diff --git a/goal_src/import/accordian-ag.gc b/goal_src/import/accordian-ag.gc new file mode 100644 index 0000000000..8016fbe5ca --- /dev/null +++ b/goal_src/import/accordian-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; accordian-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt accordian-ag accordian-lod0-jg 0) +(def-art-elt accordian-ag accordian-lod0-mg 1) +(def-art-elt accordian-ag accordian-lod1-mg 2) +(def-art-elt accordian-ag accordian-idle-ja 3) + + diff --git a/goal_src/import/allpontoons-ag.gc b/goal_src/import/allpontoons-ag.gc new file mode 100644 index 0000000000..a016158d94 --- /dev/null +++ b/goal_src/import/allpontoons-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; allpontoons-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt allpontoons-ag allpontoons-lod0-jg 0) +(def-art-elt allpontoons-ag allpontoons-lod0-mg 1) +(def-art-elt allpontoons-ag allpontoons-idle-ja 2) + + diff --git a/goal_src/import/aphid-lurker-ag.gc b/goal_src/import/aphid-lurker-ag.gc new file mode 100644 index 0000000000..547a723a6d --- /dev/null +++ b/goal_src/import/aphid-lurker-ag.gc @@ -0,0 +1,20 @@ +;;-*-Lisp-*- +(in-package goal) + +;; aphid-lurker-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt aphid-lurker-ag aphid-lurker-lod0-jg 0) +(def-art-elt aphid-lurker-ag aphid-lurker-lod0-mg 1) +(def-art-elt aphid-lurker-ag aphid-lurker-shadow-mg 2) +(def-art-elt aphid-lurker-ag aphid-lurker-idle-ja 3) +(def-art-elt aphid-lurker-ag aphid-lurker-walk-ja 4) +(def-art-elt aphid-lurker-ag aphid-lurker-walk-deadly-ja 5) +(def-art-elt aphid-lurker-ag aphid-lurker-spike-out-ja 6) +(def-art-elt aphid-lurker-ag aphid-lurker-give-up-ja 7) +(def-art-elt aphid-lurker-ag aphid-lurker-give-up-hop-ja 8) +(def-art-elt aphid-lurker-ag aphid-lurker-turn-ja 9) +(def-art-elt aphid-lurker-ag aphid-lurker-win-ja 10) +(def-art-elt aphid-lurker-ag aphid-lurker-die-ja 11) + + diff --git a/goal_src/import/assistant-ag.gc b/goal_src/import/assistant-ag.gc new file mode 100644 index 0000000000..d82b9d584f --- /dev/null +++ b/goal_src/import/assistant-ag.gc @@ -0,0 +1,18 @@ +;;-*-Lisp-*- +(in-package goal) + +;; assistant-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt assistant-ag assistant-lod0-jg 0) +(def-art-elt assistant-ag assistant-lod0-mg 1) +(def-art-elt assistant-ag assistant-shadow-mg 2) +(def-art-elt assistant-ag assistant-idle-leaning-right-ja 3) +(def-art-elt assistant-ag assistant-idle-transition-right-to-left-ja 4) +(def-art-elt assistant-ag assistant-idle-leaning-left-ja 5) +(def-art-elt assistant-ag assistant-idle-transition-left-to-right-ja 6) +(def-art-elt assistant-ag assistant-idle-wiping-brow-ja 7) +(def-art-elt assistant-ag assistant-idle-transition-to-welding-ja 8) +(def-art-elt assistant-ag assistant-idle-welding-ja 9) + + diff --git a/goal_src/import/assistant-firecanyon-ag.gc b/goal_src/import/assistant-firecanyon-ag.gc new file mode 100644 index 0000000000..42700304c0 --- /dev/null +++ b/goal_src/import/assistant-firecanyon-ag.gc @@ -0,0 +1,21 @@ +;;-*-Lisp-*- +(in-package goal) + +;; assistant-firecanyon-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt assistant-firecanyon-ag assistant-firecanyon-lod0-jg 0) +(def-art-elt assistant-firecanyon-ag assistant-firecanyon-lod0-mg 1) +(def-art-elt assistant-firecanyon-ag assistant-firecanyon-shadow-mg 2) +(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-twist-ja 3) +(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-down-ja 4) +(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-examine-ja 5) +(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-up-ja 6) +(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-fiddle-ja 7) +(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-a-ja 8) +(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-to-b-ja 9) +(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-b-ja 10) +(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-to-a-ja 11) +(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-wipe-brow-ja 12) + + diff --git a/goal_src/import/assistant-lavatube-end-ag.gc b/goal_src/import/assistant-lavatube-end-ag.gc new file mode 100644 index 0000000000..f3ce89a8f2 --- /dev/null +++ b/goal_src/import/assistant-lavatube-end-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; assistant-lavatube-end-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt assistant-lavatube-end-ag assistant-lavatube-end-lod0-jg 0) +(def-art-elt assistant-lavatube-end-ag assistant-lavatube-end-lod0-mg 1) +(def-art-elt assistant-lavatube-end-ag assistant-lavatube-end-shadow-mg 2) +(def-art-elt assistant-lavatube-end-ag assistant-lavatube-end-idle-ja 3) + + diff --git a/goal_src/import/assistant-lavatube-start-ag.gc b/goal_src/import/assistant-lavatube-start-ag.gc new file mode 100644 index 0000000000..1ecc3f1307 --- /dev/null +++ b/goal_src/import/assistant-lavatube-start-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; assistant-lavatube-start-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt assistant-lavatube-start-ag assistant-lavatube-start-lod0-jg 0) +(def-art-elt assistant-lavatube-start-ag assistant-lavatube-start-lod0-mg 1) +(def-art-elt assistant-lavatube-start-ag assistant-lavatube-start-shadow-mg 2) +(def-art-elt assistant-lavatube-start-ag assistant-lavatube-start-idle-ja 3) +(def-art-elt assistant-lavatube-start-ag assistant-lavatube-start-idle-b-ja 4) + + diff --git a/goal_src/import/assistant-village2-ag.gc b/goal_src/import/assistant-village2-ag.gc new file mode 100644 index 0000000000..eb53f4a7d6 --- /dev/null +++ b/goal_src/import/assistant-village2-ag.gc @@ -0,0 +1,23 @@ +;;-*-Lisp-*- +(in-package goal) + +;; assistant-village2-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt assistant-village2-ag assistant-village2-lod0-jg 0) +(def-art-elt assistant-village2-ag assistant-village2-lod0-mg 1) +(def-art-elt assistant-village2-ag assistant-village2-lod1-mg 2) +(def-art-elt assistant-village2-ag assistant-village2-lod2-mg 3) +(def-art-elt assistant-village2-ag assistant-village2-shadow-mg 4) +(def-art-elt assistant-village2-ag assistant-village2-idle-a-ja 5) +(def-art-elt assistant-village2-ag assistant-village2-idle-to-b-ja 6) +(def-art-elt assistant-village2-ag assistant-village2-idle-b-ja 7) +(def-art-elt assistant-village2-ag assistant-village2-idle-to-a-ja 8) +(def-art-elt assistant-village2-ag assistant-village2-idle-after-ja 9) +(def-art-elt assistant-village2-ag assistant-village2-idle-hut-breath-ja 10) +(def-art-elt assistant-village2-ag assistant-village2-idle-hut-look-right-ja 11) +(def-art-elt assistant-village2-ag assistant-village2-idle-hut-start-welding-ja 12) +(def-art-elt assistant-village2-ag assistant-village2-idle-hut-welding-ja 13) +(def-art-elt assistant-village2-ag assistant-village2-idle-hut-stop-welding-ja 14) + + diff --git a/goal_src/import/assistant-village3-ag.gc b/goal_src/import/assistant-village3-ag.gc new file mode 100644 index 0000000000..2cb24ea6e8 --- /dev/null +++ b/goal_src/import/assistant-village3-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; assistant-village3-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt assistant-village3-ag assistant-village3-lod0-jg 0) +(def-art-elt assistant-village3-ag assistant-village3-lod0-mg 1) +(def-art-elt assistant-village3-ag assistant-village3-shadow-mg 2) +(def-art-elt assistant-village3-ag assistant-village3-idle-ja 3) + + diff --git a/goal_src/import/babak-ag.gc b/goal_src/import/babak-ag.gc new file mode 100644 index 0000000000..1d0f1b78c9 --- /dev/null +++ b/goal_src/import/babak-ag.gc @@ -0,0 +1,27 @@ +;;-*-Lisp-*- +(in-package goal) + +;; babak-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt babak-ag babak-lod0-jg 0) +(def-art-elt babak-ag babak-lod0-mg 1) +(def-art-elt babak-ag babak-lod1-mg 2) +(def-art-elt babak-ag babak-lod2-mg 3) +(def-art-elt babak-ag babak-shadow-mg 4) +(def-art-elt babak-ag babak-idle-ja 5) +(def-art-elt babak-ag babak-walk-ja 6) +(def-art-elt babak-ag babak-spot-ja 7) +(def-art-elt babak-ag babak-charge-ja 8) +(def-art-elt babak-ag babak-give-up-ja 9) +(def-art-elt babak-ag babak-give-up-hop-ja 10) +(def-art-elt babak-ag babak-win-ja 11) +(def-art-elt babak-ag babak-death-ja 12) +(def-art-elt babak-ag babak-jump-ja 13) +(def-art-elt babak-ag babak-jump-land-ja 14) +(def-art-elt babak-ag babak-taunt-ja 15) +(def-art-elt babak-ag babak-turn-ja 16) +(def-art-elt babak-ag babak-look-ja 17) +(def-art-elt babak-ag babak-stop-look-ja 18) + + diff --git a/goal_src/import/baby-spider-ag.gc b/goal_src/import/baby-spider-ag.gc new file mode 100644 index 0000000000..513a2bd30d --- /dev/null +++ b/goal_src/import/baby-spider-ag.gc @@ -0,0 +1,22 @@ +;;-*-Lisp-*- +(in-package goal) + +;; baby-spider-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt baby-spider-ag baby-spider-lod0-jg 0) +(def-art-elt baby-spider-ag baby-spider-lod0-mg 1) +(def-art-elt baby-spider-ag baby-spider-lod1-mg 2) +(def-art-elt baby-spider-ag baby-spider-lod2-mg 3) +(def-art-elt baby-spider-ag baby-spider-shadow-mg 4) +(def-art-elt baby-spider-ag baby-spider-birth-ja 5) +(def-art-elt baby-spider-ag baby-spider-idle-ja 6) +(def-art-elt baby-spider-ag baby-spider-run-ja 7) +(def-art-elt baby-spider-ag baby-spider-walk-ja 8) +(def-art-elt baby-spider-ag baby-spider-jump-up-ja 9) +(def-art-elt baby-spider-ag baby-spider-jump-land-ja 10) +(def-art-elt baby-spider-ag baby-spider-notice-ja 11) +(def-art-elt baby-spider-ag baby-spider-celebrate-ja 12) +(def-art-elt baby-spider-ag baby-spider-die-ja 13) + + diff --git a/goal_src/import/balance-plat-ag.gc b/goal_src/import/balance-plat-ag.gc new file mode 100644 index 0000000000..8053d5a291 --- /dev/null +++ b/goal_src/import/balance-plat-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; balance-plat-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt balance-plat-ag balance-plat-lod0-jg 0) +(def-art-elt balance-plat-ag balance-plat-lod0-mg 1) +(def-art-elt balance-plat-ag balance-plat-lod1-mg 2) +(def-art-elt balance-plat-ag balance-plat-lod2-mg 3) +(def-art-elt balance-plat-ag balance-plat-idle-ja 4) + + diff --git a/goal_src/import/balloon-ag.gc b/goal_src/import/balloon-ag.gc new file mode 100644 index 0000000000..030be281e3 --- /dev/null +++ b/goal_src/import/balloon-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; balloon-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt balloon-ag balloon-lod0-jg 0) +(def-art-elt balloon-ag balloon-lod0-mg 1) +(def-art-elt balloon-ag balloon-lod1-mg 2) +(def-art-elt balloon-ag balloon-idle-ja 3) + + diff --git a/goal_src/import/balloonlurker-ag.gc b/goal_src/import/balloonlurker-ag.gc new file mode 100644 index 0000000000..1d469288bf --- /dev/null +++ b/goal_src/import/balloonlurker-ag.gc @@ -0,0 +1,20 @@ +;;-*-Lisp-*- +(in-package goal) + +;; balloonlurker-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt balloonlurker-ag balloonlurker-lod0-jg 0) +(def-art-elt balloonlurker-ag balloonlurker-lod0-mg 1) +(def-art-elt balloonlurker-ag balloonlurker-lod1-mg 2) +(def-art-elt balloonlurker-ag balloonlurker-lod2-mg 3) +(def-art-elt balloonlurker-ag balloonlurker-idle-ja 4) +(def-art-elt balloonlurker-ag balloonlurker-death-ja 5) +(def-art-elt balloonlurker-ag balloonlurker-pilot-lod0-jg 6) +(def-art-elt balloonlurker-ag balloonlurker-pilot-lod0-mg 7) +(def-art-elt balloonlurker-ag balloonlurker-pilot-lod1-mg 8) +(def-art-elt balloonlurker-ag balloonlurker-pilot-lod2-mg 9) +(def-art-elt balloonlurker-ag balloonlurker-pilot-idle-ja 10) +(def-art-elt balloonlurker-ag balloonlurker-pilot-death-ja 11) + + diff --git a/goal_src/import/barrel-ag.gc b/goal_src/import/barrel-ag.gc new file mode 100644 index 0000000000..17812e2c96 --- /dev/null +++ b/goal_src/import/barrel-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; barrel-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt barrel-ag barrel-lod0-jg 0) +(def-art-elt barrel-ag barrel-lod0-mg 1) +(def-art-elt barrel-ag barrel-idle-ja 2) + + diff --git a/goal_src/import/beachcam-ag.gc b/goal_src/import/beachcam-ag.gc new file mode 100644 index 0000000000..b4bd5e1f53 --- /dev/null +++ b/goal_src/import/beachcam-ag.gc @@ -0,0 +1,16 @@ +;;-*-Lisp-*- +(in-package goal) + +;; beachcam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt beachcam-ag beachcam-lod0-jg 0) +(def-art-elt beachcam-ag beachcam-ecoventrock-7-ja 8) +(def-art-elt beachcam-ag beachcam-lod0-mg 1) +(def-art-elt beachcam-ag beachcam-anim-ja 2) +(def-art-elt beachcam-ag beachcam-ecoventrock-4-ja 4) +(def-art-elt beachcam-ag beachcam-ecoventrock-5-ja 5) +(def-art-elt beachcam-ag beachcam-ecoventrock-6-ja 6) +(def-art-elt beachcam-ag beachcam-ecoventrock-3-ja 7) + + diff --git a/goal_src/import/billy-ag.gc b/goal_src/import/billy-ag.gc new file mode 100644 index 0000000000..e82d1eec6e --- /dev/null +++ b/goal_src/import/billy-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; billy-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt billy-ag billy-lod0-jg 0) +(def-art-elt billy-ag billy-lod0-mg 1) +(def-art-elt billy-ag billy-shadow-mg 2) +(def-art-elt billy-ag billy-billy-after-ja 10) +(def-art-elt billy-ag billy-idle-breath-ja 3) +(def-art-elt billy-ag billy-idle-shoo-ja 4) + + diff --git a/goal_src/import/billy-sidekick-ag.gc b/goal_src/import/billy-sidekick-ag.gc new file mode 100644 index 0000000000..8c96d74718 --- /dev/null +++ b/goal_src/import/billy-sidekick-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; billy-sidekick-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt billy-sidekick-ag billy-sidekick-lod0-jg 0) +(def-art-elt billy-sidekick-ag billy-sidekick-lod0-mg 1) +(def-art-elt billy-sidekick-ag billy-sidekick-idle-ja 2) +(def-art-elt billy-sidekick-ag billy-sidekick-billy-after-ja 3) + + diff --git a/goal_src/import/bird-lady-ag.gc b/goal_src/import/bird-lady-ag.gc new file mode 100644 index 0000000000..3681c83908 --- /dev/null +++ b/goal_src/import/bird-lady-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; bird-lady-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt bird-lady-ag bird-lady-lod0-jg 0) +(def-art-elt bird-lady-ag bird-lady-lod0-mg 1) +(def-art-elt bird-lady-ag bird-lady-shadow-mg 2) +(def-art-elt bird-lady-ag bird-lady-idle-ja 3) + + diff --git a/goal_src/import/bird-lady-beach-ag.gc b/goal_src/import/bird-lady-beach-ag.gc new file mode 100644 index 0000000000..cd4240d747 --- /dev/null +++ b/goal_src/import/bird-lady-beach-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; bird-lady-beach-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt bird-lady-beach-ag bird-lady-beach-lod0-jg 0) +(def-art-elt bird-lady-beach-ag bird-lady-beach-lod0-mg 1) +(def-art-elt bird-lady-beach-ag bird-lady-beach-shadow-mg 2) +(def-art-elt bird-lady-beach-ag bird-lady-beach-idle-ja 3) + + diff --git a/goal_src/import/bladeassm-ag.gc b/goal_src/import/bladeassm-ag.gc new file mode 100644 index 0000000000..6bec4c68c1 --- /dev/null +++ b/goal_src/import/bladeassm-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; bladeassm-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt bladeassm-ag bladeassm-lod0-jg 0) +(def-art-elt bladeassm-ag bladeassm-lod0-mg 1) +(def-art-elt bladeassm-ag bladeassm-lod1-mg 2) +(def-art-elt bladeassm-ag bladeassm-lod2-mg 3) +(def-art-elt bladeassm-ag bladeassm-idle-ja 4) + + diff --git a/goal_src/import/blue-eco-charger-ag.gc b/goal_src/import/blue-eco-charger-ag.gc new file mode 100644 index 0000000000..1f5d61da6e --- /dev/null +++ b/goal_src/import/blue-eco-charger-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; blue-eco-charger-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt blue-eco-charger-ag blue-eco-charger-lod0-jg 0) +(def-art-elt blue-eco-charger-ag blue-eco-charger-lod0-mg 1) +(def-art-elt blue-eco-charger-ag blue-eco-charger-open-ja 2) + + diff --git a/goal_src/import/blue-eco-charger-orb-ag.gc b/goal_src/import/blue-eco-charger-orb-ag.gc new file mode 100644 index 0000000000..ee156005ad --- /dev/null +++ b/goal_src/import/blue-eco-charger-orb-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; blue-eco-charger-orb-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt blue-eco-charger-orb-ag blue-eco-charger-orb-lod0-jg 0) +(def-art-elt blue-eco-charger-orb-ag blue-eco-charger-orb-lod0-mg 1) +(def-art-elt blue-eco-charger-orb-ag blue-eco-charger-orb-idle-ja 2) + + diff --git a/goal_src/import/bluesage-ag.gc b/goal_src/import/bluesage-ag.gc new file mode 100644 index 0000000000..555b3f64ca --- /dev/null +++ b/goal_src/import/bluesage-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; bluesage-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt bluesage-ag bluesage-lod0-jg 0) +(def-art-elt bluesage-ag bluesage-lod0-mg 1) +(def-art-elt bluesage-ag bluesage-lod1-mg 2) +(def-art-elt bluesage-ag bluesage-shadow-mg 3) +(def-art-elt bluesage-ag bluesage-bluesage-idle-ja 4) +(def-art-elt bluesage-ag bluesage-bluesage-attack-start-ja 5) +(def-art-elt bluesage-ag bluesage-bluesage-attack-loop-ja 6) + + diff --git a/goal_src/import/boatpaddle-ag.gc b/goal_src/import/boatpaddle-ag.gc new file mode 100644 index 0000000000..3dad650c0a --- /dev/null +++ b/goal_src/import/boatpaddle-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; boatpaddle-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt boatpaddle-ag boatpaddle-lod0-jg 0) +(def-art-elt boatpaddle-ag boatpaddle-lod0-mg 1) +(def-art-elt boatpaddle-ag boatpaddle-lod1-mg 2) +(def-art-elt boatpaddle-ag boatpaddle-idle-ja 3) + + diff --git a/goal_src/import/bonelurker-ag.gc b/goal_src/import/bonelurker-ag.gc new file mode 100644 index 0000000000..ed37b67ac2 --- /dev/null +++ b/goal_src/import/bonelurker-ag.gc @@ -0,0 +1,27 @@ +;;-*-Lisp-*- +(in-package goal) + +;; bonelurker-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt bonelurker-ag bonelurker-lod0-jg 0) +(def-art-elt bonelurker-ag bonelurker-lod0-mg 1) +(def-art-elt bonelurker-ag bonelurker-lod1-mg 2) +(def-art-elt bonelurker-ag bonelurker-lod2-mg 3) +(def-art-elt bonelurker-ag bonelurker-shadow-mg 4) +(def-art-elt bonelurker-ag bonelurker-idle-ja 5) +(def-art-elt bonelurker-ag bonelurker-walk-ja 6) +(def-art-elt bonelurker-ag bonelurker-spot-ja 7) +(def-art-elt bonelurker-ag bonelurker-charge-ja 8) +(def-art-elt bonelurker-ag bonelurker-charge-left-ja 9) +(def-art-elt bonelurker-ag bonelurker-charge-right-ja 10) +(def-art-elt bonelurker-ag bonelurker-give-up-ja 11) +(def-art-elt bonelurker-ag bonelurker-give-up-hop-ja 12) +(def-art-elt bonelurker-ag bonelurker-win-ja 13) +(def-art-elt bonelurker-ag bonelurker-death-ja 14) +(def-art-elt bonelurker-ag bonelurker-stun-ja 15) +(def-art-elt bonelurker-ag bonelurker-turn-ja 16) +(def-art-elt bonelurker-ag bonelurker-jump-ja 17) +(def-art-elt bonelurker-ag bonelurker-jump-land-ja 18) + + diff --git a/goal_src/import/bounceytarp-ag.gc b/goal_src/import/bounceytarp-ag.gc new file mode 100644 index 0000000000..26241c7c65 --- /dev/null +++ b/goal_src/import/bounceytarp-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; bounceytarp-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt bounceytarp-ag bounceytarp-lod0-jg 0) +(def-art-elt bounceytarp-ag bounceytarp-lod0-mg 1) +(def-art-elt bounceytarp-ag bounceytarp-idle-ja 2) + + diff --git a/goal_src/import/breakaway-left-ag.gc b/goal_src/import/breakaway-left-ag.gc new file mode 100644 index 0000000000..e934f3934e --- /dev/null +++ b/goal_src/import/breakaway-left-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; breakaway-left-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt breakaway-left-ag breakaway-left-lod0-jg 0) +(def-art-elt breakaway-left-ag breakaway-left-lod0-mg 1) +(def-art-elt breakaway-left-ag breakaway-left-idle-ja 2) + + diff --git a/goal_src/import/breakaway-mid-ag.gc b/goal_src/import/breakaway-mid-ag.gc new file mode 100644 index 0000000000..9fe8b63071 --- /dev/null +++ b/goal_src/import/breakaway-mid-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; breakaway-mid-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt breakaway-mid-ag breakaway-mid-lod0-jg 0) +(def-art-elt breakaway-mid-ag breakaway-mid-lod0-mg 1) +(def-art-elt breakaway-mid-ag breakaway-mid-idle-ja 2) + + diff --git a/goal_src/import/breakaway-right-ag.gc b/goal_src/import/breakaway-right-ag.gc new file mode 100644 index 0000000000..a1d77dd321 --- /dev/null +++ b/goal_src/import/breakaway-right-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; breakaway-right-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt breakaway-right-ag breakaway-right-lod0-jg 0) +(def-art-elt breakaway-right-ag breakaway-right-lod0-mg 1) +(def-art-elt breakaway-right-ag breakaway-right-idle-ja 2) + + diff --git a/goal_src/import/bully-ag.gc b/goal_src/import/bully-ag.gc new file mode 100644 index 0000000000..eb0c7cc59d --- /dev/null +++ b/goal_src/import/bully-ag.gc @@ -0,0 +1,25 @@ +;;-*-Lisp-*- +(in-package goal) + +;; bully-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt bully-ag bully-lod0-jg 0) +(def-art-elt bully-ag bully-lod0-mg 1) +(def-art-elt bully-ag bully-lod1-mg 2) +(def-art-elt bully-ag bully-lod2-mg 3) +(def-art-elt bully-ag bully-shadow-mg 4) +(def-art-elt bully-ag bully-idle-ja 5) +(def-art-elt bully-ag bully-notice-jump-up-ja 6) +(def-art-elt bully-ag bully-notice-land-ja 7) +(def-art-elt bully-ag bully-start-spin-ja 8) +(def-art-elt bully-ag bully-spin-ja 9) +(def-art-elt bully-ag bully-die-ja 10) +(def-art-elt bully-ag bully-idle-bounced-ja 11) +(def-art-elt bully-ag bully-spin-bounced-ja 12) +(def-art-elt bully-ag bully-dizzy-ja 13) +(def-art-elt bully-ag bully-broken-cage-lod0-jg 14) +(def-art-elt bully-ag bully-broken-cage-lod0-mg 15) +(def-art-elt bully-ag bully-broken-cage-explode-ja 16) + + diff --git a/goal_src/import/buzzer-ag.gc b/goal_src/import/buzzer-ag.gc new file mode 100644 index 0000000000..e41b85107b --- /dev/null +++ b/goal_src/import/buzzer-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; buzzer-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt buzzer-ag buzzer-lod0-jg 0) +(def-art-elt buzzer-ag buzzer-lod0-mg 1) +(def-art-elt buzzer-ag buzzer-idle-ja 2) + + diff --git a/goal_src/import/catch-fisha-ag.gc b/goal_src/import/catch-fisha-ag.gc new file mode 100644 index 0000000000..32571c3909 --- /dev/null +++ b/goal_src/import/catch-fisha-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; catch-fisha-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt catch-fisha-ag catch-fisha-lod0-jg 0) +(def-art-elt catch-fisha-ag catch-fisha-lod0-mg 1) +(def-art-elt catch-fisha-ag catch-fisha-idle-ja 2) + + diff --git a/goal_src/import/catch-fishb-ag.gc b/goal_src/import/catch-fishb-ag.gc new file mode 100644 index 0000000000..f7ecd87eb1 --- /dev/null +++ b/goal_src/import/catch-fishb-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; catch-fishb-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt catch-fishb-ag catch-fishb-lod0-jg 0) +(def-art-elt catch-fishb-ag catch-fishb-lod0-mg 1) +(def-art-elt catch-fishb-ag catch-fishb-idle-ja 2) + + diff --git a/goal_src/import/catch-fishc-ag.gc b/goal_src/import/catch-fishc-ag.gc new file mode 100644 index 0000000000..267c52369b --- /dev/null +++ b/goal_src/import/catch-fishc-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; catch-fishc-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt catch-fishc-ag catch-fishc-lod0-jg 0) +(def-art-elt catch-fishc-ag catch-fishc-lod0-mg 1) +(def-art-elt catch-fishc-ag catch-fishc-idle-ja 2) + + diff --git a/goal_src/import/cavecrusher-ag.gc b/goal_src/import/cavecrusher-ag.gc new file mode 100644 index 0000000000..fde0eea08b --- /dev/null +++ b/goal_src/import/cavecrusher-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; cavecrusher-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt cavecrusher-ag cavecrusher-lod0-jg 0) +(def-art-elt cavecrusher-ag cavecrusher-lod0-mg 1) +(def-art-elt cavecrusher-ag cavecrusher-lod1-mg 2) +(def-art-elt cavecrusher-ag cavecrusher-lod2-mg 3) +(def-art-elt cavecrusher-ag cavecrusher-idle-ja 4) + + diff --git a/goal_src/import/cavecrystal-ag.gc b/goal_src/import/cavecrystal-ag.gc new file mode 100644 index 0000000000..bfec6d2088 --- /dev/null +++ b/goal_src/import/cavecrystal-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; cavecrystal-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt cavecrystal-ag cavecrystal-lod0-jg 0) +(def-art-elt cavecrystal-ag cavecrystal-lod0-mg 1) +(def-art-elt cavecrystal-ag cavecrystal-lod1-mg 2) +(def-art-elt cavecrystal-ag cavecrystal-idle-ja 3) + + diff --git a/goal_src/import/caveelevator-ag.gc b/goal_src/import/caveelevator-ag.gc new file mode 100644 index 0000000000..e86431f4d2 --- /dev/null +++ b/goal_src/import/caveelevator-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; caveelevator-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt caveelevator-ag caveelevator-lod0-jg 0) +(def-art-elt caveelevator-ag caveelevator-lod0-mg 1) +(def-art-elt caveelevator-ag caveelevator-cycle-12m-ja 2) +(def-art-elt caveelevator-ag caveelevator-one-way-58m-ja 3) +(def-art-elt caveelevator-ag caveelevator-one-way-58m-reverse-ja 4) +(def-art-elt caveelevator-ag caveelevator-cycle-3-floors-36m-ja 5) + + diff --git a/goal_src/import/cavegem-ag.gc b/goal_src/import/cavegem-ag.gc new file mode 100644 index 0000000000..849e6349e3 --- /dev/null +++ b/goal_src/import/cavegem-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; cavegem-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt cavegem-ag cavegem-lod0-jg 0) +(def-art-elt cavegem-ag cavegem-lod0-mg 1) +(def-art-elt cavegem-ag cavegem-idle-ja 2) + + diff --git a/goal_src/import/cavespatula-darkcave-ag.gc b/goal_src/import/cavespatula-darkcave-ag.gc new file mode 100644 index 0000000000..b12a5b39f6 --- /dev/null +++ b/goal_src/import/cavespatula-darkcave-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; cavespatula-darkcave-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt cavespatula-darkcave-ag cavespatula-darkcave-lod0-jg 0) +(def-art-elt cavespatula-darkcave-ag cavespatula-darkcave-lod0-mg 1) +(def-art-elt cavespatula-darkcave-ag cavespatula-darkcave-lod1-mg 2) +(def-art-elt cavespatula-darkcave-ag cavespatula-darkcave-idle-ja 3) + + diff --git a/goal_src/import/cavespatulatwo-ag.gc b/goal_src/import/cavespatulatwo-ag.gc new file mode 100644 index 0000000000..970f9162df --- /dev/null +++ b/goal_src/import/cavespatulatwo-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; cavespatulatwo-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt cavespatulatwo-ag cavespatulatwo-lod0-jg 0) +(def-art-elt cavespatulatwo-ag cavespatulatwo-lod0-mg 1) +(def-art-elt cavespatulatwo-ag cavespatulatwo-lod1-mg 2) +(def-art-elt cavespatulatwo-ag cavespatulatwo-idle-ja 3) + + diff --git a/goal_src/import/cavetrapdoor-ag.gc b/goal_src/import/cavetrapdoor-ag.gc new file mode 100644 index 0000000000..eac98bd46a --- /dev/null +++ b/goal_src/import/cavetrapdoor-ag.gc @@ -0,0 +1,17 @@ +;;-*-Lisp-*- +(in-package goal) + +;; cavetrapdoor-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt cavetrapdoor-ag cavetrapdoor-lod0-jg 0) +(def-art-elt cavetrapdoor-ag cavetrapdoor-lod0-mg 1) +(def-art-elt cavetrapdoor-ag cavetrapdoor-lod1-mg 2) +(def-art-elt cavetrapdoor-ag cavetrapdoor-lod2-mg 3) +(def-art-elt cavetrapdoor-ag cavetrapdoor-idle-ja 4) +(def-art-elt cavetrapdoor-ag cavetrapdoor-bob-ja 5) +(def-art-elt cavetrapdoor-ag cavetrapdoor-swing-ja 6) +(def-art-elt cavetrapdoor-ag cavetrapdoor-idle-down-ja 7) +(def-art-elt cavetrapdoor-ag cavetrapdoor-reset-ja 8) + + diff --git a/goal_src/import/ceilingflag-ag.gc b/goal_src/import/ceilingflag-ag.gc new file mode 100644 index 0000000000..76330a6d3e --- /dev/null +++ b/goal_src/import/ceilingflag-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ceilingflag-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ceilingflag-ag ceilingflag-geo-jg 0) +(def-art-elt ceilingflag-ag ceilingflag-geo-mg 1) +(def-art-elt ceilingflag-ag ceilingflag-idle-ja 2) + + diff --git a/goal_src/import/chainmine-ag.gc b/goal_src/import/chainmine-ag.gc new file mode 100644 index 0000000000..17e71d0cdf --- /dev/null +++ b/goal_src/import/chainmine-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; chainmine-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt chainmine-ag chainmine-lod0-jg 0) +(def-art-elt chainmine-ag chainmine-lod0-mg 1) +(def-art-elt chainmine-ag chainmine-idle-ja 2) + + diff --git a/goal_src/import/citadelcam-ag.gc b/goal_src/import/citadelcam-ag.gc new file mode 100644 index 0000000000..048ef8e111 --- /dev/null +++ b/goal_src/import/citadelcam-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citadelcam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citadelcam-ag citadelcam-lod0-jg 0) +(def-art-elt citadelcam-ag citadelcam-lod0-mg 1) +(def-art-elt citadelcam-ag citadelcam-idle-ja 2) +(def-art-elt citadelcam-ag citadelcam-stair-plats-ja 3) +(def-art-elt citadelcam-ag citadelcam-citadel-bunnies-ja 4) + + diff --git a/goal_src/import/citb-arm-ag.gc b/goal_src/import/citb-arm-ag.gc new file mode 100644 index 0000000000..1fcf2e337b --- /dev/null +++ b/goal_src/import/citb-arm-ag.gc @@ -0,0 +1,24 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-arm-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-arm-ag citb-arm-a-lod0-jg 0) +(def-art-elt citb-arm-ag citb-arm-a-lod0-mg 1) +(def-art-elt citb-arm-ag citb-arm-a-lod1-mg 2) +(def-art-elt citb-arm-ag citb-arm-a-idle-ja 3) +(def-art-elt citb-arm-ag citb-arm-b-lod0-jg 4) +(def-art-elt citb-arm-ag citb-arm-b-lod0-mg 5) +(def-art-elt citb-arm-ag citb-arm-b-lod1-mg 6) +(def-art-elt citb-arm-ag citb-arm-b-idle-ja 7) +(def-art-elt citb-arm-ag citb-arm-c-lod0-jg 8) +(def-art-elt citb-arm-ag citb-arm-c-lod0-mg 9) +(def-art-elt citb-arm-ag citb-arm-c-lod1-mg 10) +(def-art-elt citb-arm-ag citb-arm-c-idle-ja 11) +(def-art-elt citb-arm-ag citb-arm-d-lod0-jg 12) +(def-art-elt citb-arm-ag citb-arm-d-lod0-mg 13) +(def-art-elt citb-arm-ag citb-arm-d-lod1-mg 14) +(def-art-elt citb-arm-ag citb-arm-d-idle-ja 15) + + diff --git a/goal_src/import/citb-arm-shoulder-ag.gc b/goal_src/import/citb-arm-shoulder-ag.gc new file mode 100644 index 0000000000..db1bdcf566 --- /dev/null +++ b/goal_src/import/citb-arm-shoulder-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-arm-shoulder-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-arm-shoulder-ag citb-arm-shoulder-a-lod0-jg 0) +(def-art-elt citb-arm-shoulder-ag citb-arm-shoulder-a-lod0-mg 1) +(def-art-elt citb-arm-shoulder-ag citb-arm-shoulder-a-idle-ja 2) +(def-art-elt citb-arm-shoulder-ag citb-arm-shoulder-b-lod0-jg 3) +(def-art-elt citb-arm-shoulder-ag citb-arm-shoulder-b-lod0-mg 4) +(def-art-elt citb-arm-shoulder-ag citb-arm-shoulder-b-idle-ja 5) + + diff --git a/goal_src/import/citb-bunny-ag.gc b/goal_src/import/citb-bunny-ag.gc new file mode 100644 index 0000000000..20c7b2853e --- /dev/null +++ b/goal_src/import/citb-bunny-ag.gc @@ -0,0 +1,18 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-bunny-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-bunny-ag citb-bunny-lod0-jg 0) +(def-art-elt citb-bunny-ag citb-bunny-lod0-mg 1) +(def-art-elt citb-bunny-ag citb-bunny-shadow-mg 2) +(def-art-elt citb-bunny-ag citb-bunny-idle-ja 3) +(def-art-elt citb-bunny-ag citb-bunny-attack-ja 4) +(def-art-elt citb-bunny-ag citb-bunny-big-hop-ja 5) +(def-art-elt citb-bunny-ag citb-bunny-small-hop-ja 6) +(def-art-elt citb-bunny-ag citb-bunny-sees-player-ja 7) +(def-art-elt citb-bunny-ag citb-bunny-sees-player-land-ja 8) +(def-art-elt citb-bunny-ag citb-bunny-die-ja 9) + + diff --git a/goal_src/import/citb-button-ag.gc b/goal_src/import/citb-button-ag.gc new file mode 100644 index 0000000000..f91f164e32 --- /dev/null +++ b/goal_src/import/citb-button-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-button-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-button-ag citb-button-lod0-jg 0) +(def-art-elt citb-button-ag citb-button-lod0-mg 1) +(def-art-elt citb-button-ag citb-button-idle-ja 2) + + diff --git a/goal_src/import/citb-chain-plat-ag.gc b/goal_src/import/citb-chain-plat-ag.gc new file mode 100644 index 0000000000..e6edcc6b56 --- /dev/null +++ b/goal_src/import/citb-chain-plat-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-chain-plat-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-chain-plat-ag citb-chain-plat-lod0-jg 0) +(def-art-elt citb-chain-plat-ag citb-chain-plat-lod0-mg 1) +(def-art-elt citb-chain-plat-ag citb-chain-plat-lod1-mg 2) +(def-art-elt citb-chain-plat-ag citb-chain-plat-idle-ja 3) + + diff --git a/goal_src/import/citb-chains-ag.gc b/goal_src/import/citb-chains-ag.gc new file mode 100644 index 0000000000..66cc35be5b --- /dev/null +++ b/goal_src/import/citb-chains-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-chains-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-chains-ag citb-chains-lod0-jg 0) +(def-art-elt citb-chains-ag citb-chains-lod0-mg 1) +(def-art-elt citb-chains-ag citb-chains-lod1-mg 2) +(def-art-elt citb-chains-ag citb-chains-lod2-mg 3) +(def-art-elt citb-chains-ag citb-chains-idle-ja 4) + + diff --git a/goal_src/import/citb-coil-ag.gc b/goal_src/import/citb-coil-ag.gc new file mode 100644 index 0000000000..6b5969455a --- /dev/null +++ b/goal_src/import/citb-coil-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-coil-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-coil-ag citb-coil-lod0-jg 0) +(def-art-elt citb-coil-ag citb-coil-lod0-mg 1) +(def-art-elt citb-coil-ag citb-coil-lod1-mg 2) +(def-art-elt citb-coil-ag citb-coil-idle-ja 3) +(def-art-elt citb-coil-ag citb-coil-die-ja 4) +(def-art-elt citb-coil-ag citb-coil-dead-ja 5) + + diff --git a/goal_src/import/citb-disc-ag.gc b/goal_src/import/citb-disc-ag.gc new file mode 100644 index 0000000000..3fbb22fbf1 --- /dev/null +++ b/goal_src/import/citb-disc-ag.gc @@ -0,0 +1,28 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-disc-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-disc-ag citb-disc-a-lod0-jg 0) +(def-art-elt citb-disc-ag citb-disc-a-lod0-mg 1) +(def-art-elt citb-disc-ag citb-disc-a-lod1-mg 2) +(def-art-elt citb-disc-ag citb-disc-a-lod2-mg 3) +(def-art-elt citb-disc-ag citb-disc-a-idle-ja 4) +(def-art-elt citb-disc-ag citb-disc-b-lod0-jg 5) +(def-art-elt citb-disc-ag citb-disc-b-lod0-mg 6) +(def-art-elt citb-disc-ag citb-disc-b-lod1-mg 7) +(def-art-elt citb-disc-ag citb-disc-b-lod2-mg 8) +(def-art-elt citb-disc-ag citb-disc-b-idle-ja 9) +(def-art-elt citb-disc-ag citb-disc-c-lod0-jg 10) +(def-art-elt citb-disc-ag citb-disc-c-lod0-mg 11) +(def-art-elt citb-disc-ag citb-disc-c-lod1-mg 12) +(def-art-elt citb-disc-ag citb-disc-c-lod2-mg 13) +(def-art-elt citb-disc-ag citb-disc-c-idle-ja 14) +(def-art-elt citb-disc-ag citb-disc-d-lod0-jg 15) +(def-art-elt citb-disc-ag citb-disc-d-lod0-mg 16) +(def-art-elt citb-disc-ag citb-disc-d-lod1-mg 17) +(def-art-elt citb-disc-ag citb-disc-d-lod2-mg 18) +(def-art-elt citb-disc-ag citb-disc-d-idle-ja 19) + + diff --git a/goal_src/import/citb-donut-ag.gc b/goal_src/import/citb-donut-ag.gc new file mode 100644 index 0000000000..44fd49b2f8 --- /dev/null +++ b/goal_src/import/citb-donut-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-donut-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-donut-ag citb-donut-lod0-jg 0) +(def-art-elt citb-donut-ag citb-donut-lod0-mg 1) +(def-art-elt citb-donut-ag citb-donut-lod1-mg 2) +(def-art-elt citb-donut-ag citb-donut-idle-ja 3) + + diff --git a/goal_src/import/citb-drop-plat-ag.gc b/goal_src/import/citb-drop-plat-ag.gc new file mode 100644 index 0000000000..29a1a9c655 --- /dev/null +++ b/goal_src/import/citb-drop-plat-ag.gc @@ -0,0 +1,28 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-drop-plat-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-drop-plat-ag citb-drop-plat-lod0-jg 0) +(def-art-elt citb-drop-plat-ag citb-drop-plat-lod0-mg 1) +(def-art-elt citb-drop-plat-ag citb-drop-plat-lod1-mg 2) +(def-art-elt citb-drop-plat-ag citb-drop-plat-idle-ja 3) +(def-art-elt citb-drop-plat-ag citb-drop-plat-red-lod0-jg 4) +(def-art-elt citb-drop-plat-ag citb-drop-plat-red-lod0-mg 5) +(def-art-elt citb-drop-plat-ag citb-drop-plat-red-lod1-mg 6) +(def-art-elt citb-drop-plat-ag citb-drop-plat-red-idle-ja 7) +(def-art-elt citb-drop-plat-ag citb-drop-plat-green-lod0-jg 8) +(def-art-elt citb-drop-plat-ag citb-drop-plat-green-lod0-mg 9) +(def-art-elt citb-drop-plat-ag citb-drop-plat-green-lod1-mg 10) +(def-art-elt citb-drop-plat-ag citb-drop-plat-green-idle-ja 11) +(def-art-elt citb-drop-plat-ag citb-drop-plat-blue-lod0-jg 12) +(def-art-elt citb-drop-plat-ag citb-drop-plat-blue-lod0-mg 13) +(def-art-elt citb-drop-plat-ag citb-drop-plat-blue-lod1-mg 14) +(def-art-elt citb-drop-plat-ag citb-drop-plat-blue-idle-ja 15) +(def-art-elt citb-drop-plat-ag citb-drop-plat-yellow-lod0-jg 16) +(def-art-elt citb-drop-plat-ag citb-drop-plat-yellow-lod0-mg 17) +(def-art-elt citb-drop-plat-ag citb-drop-plat-yellow-lod1-mg 18) +(def-art-elt citb-drop-plat-ag citb-drop-plat-yellow-idle-ja 19) + + diff --git a/goal_src/import/citb-exit-plat-ag.gc b/goal_src/import/citb-exit-plat-ag.gc new file mode 100644 index 0000000000..aedf016725 --- /dev/null +++ b/goal_src/import/citb-exit-plat-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-exit-plat-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-exit-plat-ag citb-exit-plat-lod0-jg 0) +(def-art-elt citb-exit-plat-ag citb-exit-plat-lod0-mg 1) +(def-art-elt citb-exit-plat-ag citb-exit-plat-idle-ja 2) + + diff --git a/goal_src/import/citb-firehose-ag.gc b/goal_src/import/citb-firehose-ag.gc new file mode 100644 index 0000000000..22e2393057 --- /dev/null +++ b/goal_src/import/citb-firehose-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-firehose-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-firehose-ag citb-firehose-lod0-jg 0) +(def-art-elt citb-firehose-ag citb-firehose-lod0-mg 1) +(def-art-elt citb-firehose-ag citb-firehose-idle-ja 2) +(def-art-elt citb-firehose-ag citb-firehose-start-ja 3) +(def-art-elt citb-firehose-ag citb-firehose-loopflame-ja 4) +(def-art-elt citb-firehose-ag citb-firehose-end-ja 5) + + diff --git a/goal_src/import/citb-generator-ag.gc b/goal_src/import/citb-generator-ag.gc new file mode 100644 index 0000000000..e2aeed03c7 --- /dev/null +++ b/goal_src/import/citb-generator-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-generator-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-generator-ag citb-generator-lod0-jg 0) +(def-art-elt citb-generator-ag citb-generator-lod0-mg 1) +(def-art-elt citb-generator-ag citb-generator-broken-lod0-jg 2) +(def-art-elt citb-generator-ag citb-generator-broken-lod0-mg 3) +(def-art-elt citb-generator-ag citb-generator-idle-ja 4) + + diff --git a/goal_src/import/citb-hose-ag.gc b/goal_src/import/citb-hose-ag.gc new file mode 100644 index 0000000000..0a9d0dcf8b --- /dev/null +++ b/goal_src/import/citb-hose-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-hose-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-hose-ag citb-hose-lod0-jg 0) +(def-art-elt citb-hose-ag citb-hose-lod0-mg 1) +(def-art-elt citb-hose-ag citb-hose-lod1-mg 2) +(def-art-elt citb-hose-ag citb-hose-idle-ja 3) +(def-art-elt citb-hose-ag citb-hose-spit-ja 4) +(def-art-elt citb-hose-ag citb-hose-die-ja 5) + + diff --git a/goal_src/import/citb-iris-door-ag.gc b/goal_src/import/citb-iris-door-ag.gc new file mode 100644 index 0000000000..9cbfab6aec --- /dev/null +++ b/goal_src/import/citb-iris-door-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-iris-door-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-iris-door-ag citb-iris-door-lod0-jg 0) +(def-art-elt citb-iris-door-ag citb-iris-door-lod0-mg 1) +(def-art-elt citb-iris-door-ag citb-iris-door-lod1-mg 2) +(def-art-elt citb-iris-door-ag citb-iris-door-idle-ja 3) + + diff --git a/goal_src/import/citb-launcher-ag.gc b/goal_src/import/citb-launcher-ag.gc new file mode 100644 index 0000000000..7511f3f451 --- /dev/null +++ b/goal_src/import/citb-launcher-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-launcher-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-launcher-ag citb-launcher-lod0-jg 0) +(def-art-elt citb-launcher-ag citb-launcher-lod0-mg 1) +(def-art-elt citb-launcher-ag citb-launcher-idle-ja 2) + + diff --git a/goal_src/import/citb-robotboss-ag.gc b/goal_src/import/citb-robotboss-ag.gc new file mode 100644 index 0000000000..3a84c00311 --- /dev/null +++ b/goal_src/import/citb-robotboss-ag.gc @@ -0,0 +1,35 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-robotboss-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-robotboss-ag citb-robotboss-lod0-jg 0) +(def-art-elt citb-robotboss-ag citb-robotboss-lod0-mg 1) +(def-art-elt citb-robotboss-ag citb-robotboss-idle-ja 2) +(def-art-elt citb-robotboss-ag citb-robotboss-nose-lod0-jg 3) +(def-art-elt citb-robotboss-ag citb-robotboss-nose-lod0-mg 4) +(def-art-elt citb-robotboss-ag citb-robotboss-nose-idle-ja 5) +(def-art-elt citb-robotboss-ag citb-robotboss-head-lod0-jg 6) +(def-art-elt citb-robotboss-ag citb-robotboss-head-lod0-mg 7) +(def-art-elt citb-robotboss-ag citb-robotboss-head-idle-ja 8) +(def-art-elt citb-robotboss-ag citb-robotboss-gun-lod0-jg 9) +(def-art-elt citb-robotboss-ag citb-robotboss-gun-lod0-mg 10) +(def-art-elt citb-robotboss-ag citb-robotboss-gun-idle-ja 11) +(def-art-elt citb-robotboss-ag citb-robotboss-leftshoulder-lod0-jg 12) +(def-art-elt citb-robotboss-ag citb-robotboss-leftshoulder-lod0-mg 13) +(def-art-elt citb-robotboss-ag citb-robotboss-leftshoulder-idle-ja 14) +(def-art-elt citb-robotboss-ag citb-robotboss-rightshoulder-lod0-jg 15) +(def-art-elt citb-robotboss-ag citb-robotboss-rightshoulder-lod0-mg 16) +(def-art-elt citb-robotboss-ag citb-robotboss-rightshoulder-idle-ja 17) +(def-art-elt citb-robotboss-ag citb-robotboss-leftarm-lod0-jg 18) +(def-art-elt citb-robotboss-ag citb-robotboss-leftarm-lod0-mg 19) +(def-art-elt citb-robotboss-ag citb-robotboss-leftarm-idle-ja 20) +(def-art-elt citb-robotboss-ag citb-robotboss-rightarm-lod0-jg 21) +(def-art-elt citb-robotboss-ag citb-robotboss-rightarm-lod0-mg 22) +(def-art-elt citb-robotboss-ag citb-robotboss-rightarm-idle-ja 23) +(def-art-elt citb-robotboss-ag citb-robotboss-belly-lod0-jg 24) +(def-art-elt citb-robotboss-ag citb-robotboss-belly-lod0-mg 25) +(def-art-elt citb-robotboss-ag citb-robotboss-belly-idle-ja 26) + + diff --git a/goal_src/import/citb-rotatebox-ag.gc b/goal_src/import/citb-rotatebox-ag.gc new file mode 100644 index 0000000000..fddf6d842a --- /dev/null +++ b/goal_src/import/citb-rotatebox-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-rotatebox-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-rotatebox-ag citb-rotatebox-lod0-jg 0) +(def-art-elt citb-rotatebox-ag citb-rotatebox-lod0-mg 1) +(def-art-elt citb-rotatebox-ag citb-rotatebox-idle-ja 2) + + diff --git a/goal_src/import/citb-sagecage-ag.gc b/goal_src/import/citb-sagecage-ag.gc new file mode 100644 index 0000000000..bb9d85221b --- /dev/null +++ b/goal_src/import/citb-sagecage-ag.gc @@ -0,0 +1,22 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-sagecage-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-sagecage-ag citb-sagecage-bluesage-idle-ja 8) +(def-art-elt citb-sagecage-ag citb-sagecage-lod0-jg 0) +(def-art-elt citb-sagecage-ag citb-sagecage-lod0-mg 1) +(def-art-elt citb-sagecage-ag citb-sagecage-lod1-mg 2) +(def-art-elt citb-sagecage-ag citb-sagecage-idle-ja 3) +(def-art-elt citb-sagecage-ag citb-sagecage-redsage-idle-ja 4) +(def-art-elt citb-sagecage-ag citb-sagecage-redsage-attack-start-ja 5) +(def-art-elt citb-sagecage-ag citb-sagecage-redsage-attack-loop-ja 6) +(def-art-elt citb-sagecage-ag citb-sagecage-bluesage-attack-start-ja 9) +(def-art-elt citb-sagecage-ag citb-sagecage-bluesage-attack-loop-ja 10) +(def-art-elt citb-sagecage-ag citb-sagecage-yellowsage-idle-ja 12) +(def-art-elt citb-sagecage-ag citb-sagecage-yellowsage-attack-start-ja 13) +(def-art-elt citb-sagecage-ag citb-sagecage-yellowsage-attack-loop-ja 14) +(def-art-elt citb-sagecage-ag citb-sagecage-green-sagecage-idle-ja 16) + + diff --git a/goal_src/import/citb-stopbox-ag.gc b/goal_src/import/citb-stopbox-ag.gc new file mode 100644 index 0000000000..8b1c8ff800 --- /dev/null +++ b/goal_src/import/citb-stopbox-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; citb-stopbox-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt citb-stopbox-ag citb-stopbox-lod0-jg 0) +(def-art-elt citb-stopbox-ag citb-stopbox-lod0-mg 1) +(def-art-elt citb-stopbox-ag citb-stopbox-lod1-mg 2) +(def-art-elt citb-stopbox-ag citb-stopbox-idle-ja 3) + + diff --git a/goal_src/import/crate-ag.gc b/goal_src/import/crate-ag.gc new file mode 100644 index 0000000000..861b0b17c4 --- /dev/null +++ b/goal_src/import/crate-ag.gc @@ -0,0 +1,33 @@ +;;-*-Lisp-*- +(in-package goal) + +;; crate-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt crate-ag crate-wood-lod0-jg 0) +(def-art-elt crate-ag crate-wood-lod0-mg 1) +(def-art-elt crate-ag crate-wood-lod1-mg 2) +(def-art-elt crate-ag crate-wood-lod2-mg 3) +(def-art-elt crate-ag crate-iron-lod0-jg 4) +(def-art-elt crate-ag crate-iron-lod0-mg 5) +(def-art-elt crate-ag crate-iron-lod1-mg 6) +(def-art-elt crate-ag crate-iron-lod2-mg 7) +(def-art-elt crate-ag crate-steel-lod0-jg 8) +(def-art-elt crate-ag crate-steel-lod0-mg 9) +(def-art-elt crate-ag crate-steel-lod1-mg 10) +(def-art-elt crate-ag crate-steel-lod2-mg 11) +(def-art-elt crate-ag crate-darkeco-lod0-jg 12) +(def-art-elt crate-ag crate-darkeco-lod0-mg 13) +(def-art-elt crate-ag crate-darkeco-lod1-mg 14) +(def-art-elt crate-ag crate-darkeco-lod2-mg 15) +(def-art-elt crate-ag crate-idle-ja 16) +(def-art-elt crate-ag crate-barrel-lod0-jg 17) +(def-art-elt crate-ag crate-barrel-lod0-mg 18) +(def-art-elt crate-ag crate-barrel-lod1-mg 19) +(def-art-elt crate-ag crate-barrel-lod2-mg 20) +(def-art-elt crate-ag crate-barrel-idle-ja 21) +(def-art-elt crate-ag crate-bucket-lod0-jg 22) +(def-art-elt crate-ag crate-bucket-lod0-mg 23) +(def-art-elt crate-ag crate-bucket-idle-ja 24) + + diff --git a/goal_src/import/crate-darkeco-cluster-ag.gc b/goal_src/import/crate-darkeco-cluster-ag.gc new file mode 100644 index 0000000000..b5fc610de2 --- /dev/null +++ b/goal_src/import/crate-darkeco-cluster-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; crate-darkeco-cluster-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt crate-darkeco-cluster-ag crate-darkeco-cluster-lod0-jg 0) +(def-art-elt crate-darkeco-cluster-ag crate-darkeco-cluster-lod0-mg 1) +(def-art-elt crate-darkeco-cluster-ag crate-darkeco-cluster-lod1-mg 2) +(def-art-elt crate-darkeco-cluster-ag crate-darkeco-cluster-idle-ja 3) + + diff --git a/goal_src/import/dark-crystal-ag.gc b/goal_src/import/dark-crystal-ag.gc new file mode 100644 index 0000000000..4fc82fd53a --- /dev/null +++ b/goal_src/import/dark-crystal-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; dark-crystal-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt dark-crystal-ag dark-crystal-lod0-jg 0) +(def-art-elt dark-crystal-ag dark-crystal-lod0-mg 1) +(def-art-elt dark-crystal-ag dark-crystal-idle-ja 2) +(def-art-elt dark-crystal-ag dark-crystal-explode-lod0-jg 3) +(def-art-elt dark-crystal-ag dark-crystal-explode-lod0-mg 4) +(def-art-elt dark-crystal-ag dark-crystal-explode-idle-ja 5) + + diff --git a/goal_src/import/dark-plant-ag.gc b/goal_src/import/dark-plant-ag.gc new file mode 100644 index 0000000000..70b9b6e55a --- /dev/null +++ b/goal_src/import/dark-plant-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; dark-plant-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt dark-plant-ag dark-plant-lod0-jg 0) +(def-art-elt dark-plant-ag dark-plant-lod0-mg 1) +(def-art-elt dark-plant-ag dark-plant-idle-ja 2) +(def-art-elt dark-plant-ag dark-plant-death-ja 3) +(def-art-elt dark-plant-ag dark-plant-sprout-ja 4) + + diff --git a/goal_src/import/darkecobarrel-ag.gc b/goal_src/import/darkecobarrel-ag.gc new file mode 100644 index 0000000000..6e0c863c09 --- /dev/null +++ b/goal_src/import/darkecobarrel-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; darkecobarrel-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt darkecobarrel-ag darkecobarrel-lod0-jg 0) +(def-art-elt darkecobarrel-ag darkecobarrel-lod0-mg 1) +(def-art-elt darkecobarrel-ag darkecobarrel-idle-ja 2) + + diff --git a/goal_src/import/darkecobomb-ag.gc b/goal_src/import/darkecobomb-ag.gc new file mode 100644 index 0000000000..9131f21c35 --- /dev/null +++ b/goal_src/import/darkecobomb-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; darkecobomb-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt darkecobomb-ag darkecobomb-lod0-jg 0) +(def-art-elt darkecobomb-ag darkecobomb-lod0-mg 1) +(def-art-elt darkecobomb-ag darkecobomb-idle-ja 2) +(def-art-elt darkecobomb-ag darkecobomb-blast-ja 3) +(def-art-elt darkecobomb-ag darkecobomb-open-ja 4) +(def-art-elt darkecobomb-ag darkecobomb-spin-cycle-ja 5) + + diff --git a/goal_src/import/darkecocan-ag.gc b/goal_src/import/darkecocan-ag.gc new file mode 100644 index 0000000000..cb0d901c52 --- /dev/null +++ b/goal_src/import/darkecocan-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; darkecocan-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt darkecocan-ag darkecocan-lod0-jg 0) +(def-art-elt darkecocan-ag darkecocan-lod0-mg 1) +(def-art-elt darkecocan-ag darkecocan-glow-lod0-jg 2) +(def-art-elt darkecocan-ag darkecocan-glow-lod0-mg 3) +(def-art-elt darkecocan-ag darkecocan-idle-ja 4) + + diff --git a/goal_src/import/darkvine-ag.gc b/goal_src/import/darkvine-ag.gc new file mode 100644 index 0000000000..4990f08417 --- /dev/null +++ b/goal_src/import/darkvine-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; darkvine-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt darkvine-ag darkvine-lod0-jg 0) +(def-art-elt darkvine-ag darkvine-lod0-mg 1) +(def-art-elt darkvine-ag darkvine-lod1-mg 2) +(def-art-elt darkvine-ag darkvine-idle-ja 3) +(def-art-elt darkvine-ag darkvine-retreat-ja 4) +(def-art-elt darkvine-ag darkvine-pushup-ja 5) +(def-art-elt darkvine-ag darkvine-dead-ja 6) + + diff --git a/goal_src/import/deathcam-ag.gc b/goal_src/import/deathcam-ag.gc new file mode 100644 index 0000000000..1ce4c05ac7 --- /dev/null +++ b/goal_src/import/deathcam-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; deathcam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt deathcam-ag deathcam-lod0-jg 0) +(def-art-elt deathcam-ag deathcam-lod0-mg 1) +(def-art-elt deathcam-ag deathcam-idle-ja 2) + + diff --git a/goal_src/import/double-lurker-ag.gc b/goal_src/import/double-lurker-ag.gc new file mode 100644 index 0000000000..a1430c9959 --- /dev/null +++ b/goal_src/import/double-lurker-ag.gc @@ -0,0 +1,27 @@ +;;-*-Lisp-*- +(in-package goal) + +;; double-lurker-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt double-lurker-ag double-lurker-lod0-jg 0) +(def-art-elt double-lurker-ag double-lurker-lod0-mg 1) +(def-art-elt double-lurker-ag double-lurker-lod1-mg 2) +(def-art-elt double-lurker-ag double-lurker-lod2-mg 3) +(def-art-elt double-lurker-ag double-lurker-shadow-mg 4) +(def-art-elt double-lurker-ag double-lurker-both-idle-ja 5) +(def-art-elt double-lurker-ag double-lurker-both-patrol-ja 6) +(def-art-elt double-lurker-ag double-lurker-both-spot-ja 7) +(def-art-elt double-lurker-ag double-lurker-both-charge-ja 8) +(def-art-elt double-lurker-ag double-lurker-both-celebrate-ja 9) +(def-art-elt double-lurker-ag double-lurker-both-break-apart-ja 10) +(def-art-elt double-lurker-ag double-lurker-both-take-hit-ja 11) +(def-art-elt double-lurker-ag double-lurker-idle-ja 12) +(def-art-elt double-lurker-ag double-lurker-patrol-ja 13) +(def-art-elt double-lurker-ag double-lurker-spot-ja 14) +(def-art-elt double-lurker-ag double-lurker-charge-ja 15) +(def-art-elt double-lurker-ag double-lurker-celebrate-ja 16) +(def-art-elt double-lurker-ag double-lurker-die-ja 17) +(def-art-elt double-lurker-ag double-lurker-bottom-take-hit-ja 18) + + diff --git a/goal_src/import/double-lurker-top-ag.gc b/goal_src/import/double-lurker-top-ag.gc new file mode 100644 index 0000000000..8509ca4c00 --- /dev/null +++ b/goal_src/import/double-lurker-top-ag.gc @@ -0,0 +1,27 @@ +;;-*-Lisp-*- +(in-package goal) + +;; double-lurker-top-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt double-lurker-top-ag double-lurker-top-lod0-jg 0) +(def-art-elt double-lurker-top-ag double-lurker-top-lod0-mg 1) +(def-art-elt double-lurker-top-ag double-lurker-top-lod1-mg 2) +(def-art-elt double-lurker-top-ag double-lurker-top-lod2-mg 3) +(def-art-elt double-lurker-top-ag double-lurker-top-shadow-mg 4) +(def-art-elt double-lurker-top-ag double-lurker-top-both-idle-ja 5) +(def-art-elt double-lurker-top-ag double-lurker-top-both-patrol-ja 6) +(def-art-elt double-lurker-top-ag double-lurker-top-both-spot-ja 7) +(def-art-elt double-lurker-top-ag double-lurker-top-both-charge-ja 8) +(def-art-elt double-lurker-top-ag double-lurker-top-both-celebrate-ja 9) +(def-art-elt double-lurker-top-ag double-lurker-top-both-break-apart-ja 10) +(def-art-elt double-lurker-top-ag double-lurker-top-both-take-hit-ja 11) +(def-art-elt double-lurker-top-ag double-lurker-top-idle-ja 12) +(def-art-elt double-lurker-top-ag double-lurker-top-patrol-ja 13) +(def-art-elt double-lurker-top-ag double-lurker-top-spot-ja 14) +(def-art-elt double-lurker-top-ag double-lurker-top-charge-ja 15) +(def-art-elt double-lurker-top-ag double-lurker-top-celebrate-ja 16) +(def-art-elt double-lurker-top-ag double-lurker-top-die-ja 17) +(def-art-elt double-lurker-top-ag double-lurker-top-on-shoulders-die-ja 18) + + diff --git a/goal_src/import/driller-lurker-ag.gc b/goal_src/import/driller-lurker-ag.gc new file mode 100644 index 0000000000..ee9b6c0757 --- /dev/null +++ b/goal_src/import/driller-lurker-ag.gc @@ -0,0 +1,25 @@ +;;-*-Lisp-*- +(in-package goal) + +;; driller-lurker-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt driller-lurker-ag driller-lurker-lod0-jg 0) +(def-art-elt driller-lurker-ag driller-lurker-lod0-mg 1) +(def-art-elt driller-lurker-ag driller-lurker-lod1-mg 2) +(def-art-elt driller-lurker-ag driller-lurker-lod2-mg 3) +(def-art-elt driller-lurker-ag driller-lurker-shadow-mg 4) +(def-art-elt driller-lurker-ag driller-lurker-idle-ja 5) +(def-art-elt driller-lurker-ag driller-lurker-idle-look-left-ja 6) +(def-art-elt driller-lurker-ag driller-lurker-idle-look-right-ja 7) +(def-art-elt driller-lurker-ag driller-lurker-walk-ja 8) +(def-art-elt driller-lurker-ag driller-lurker-walk-up-ja 9) +(def-art-elt driller-lurker-ag driller-lurker-drill-jams-ja 10) +(def-art-elt driller-lurker-ag driller-lurker-run-ja 11) +(def-art-elt driller-lurker-ag driller-lurker-run-up-ja 12) +(def-art-elt driller-lurker-ag driller-lurker-attack-ja 13) +(def-art-elt driller-lurker-ag driller-lurker-attack-up-ja 14) +(def-art-elt driller-lurker-ag driller-lurker-idle-drilling-ja 15) +(def-art-elt driller-lurker-ag driller-lurker-die-ja 16) + + diff --git a/goal_src/import/ecoclaw-ag.gc b/goal_src/import/ecoclaw-ag.gc new file mode 100644 index 0000000000..90e6a87381 --- /dev/null +++ b/goal_src/import/ecoclaw-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ecoclaw-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ecoclaw-ag ecoclaw-lod0-jg 0) +(def-art-elt ecoclaw-ag ecoclaw-lod0-mg 1) +(def-art-elt ecoclaw-ag ecoclaw-idle-ja 2) + + diff --git a/goal_src/import/ecovalve-ag.gc b/goal_src/import/ecovalve-ag.gc new file mode 100644 index 0000000000..d69cac5452 --- /dev/null +++ b/goal_src/import/ecovalve-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ecovalve-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ecovalve-ag ecovalve-geo-jg 0) +(def-art-elt ecovalve-ag ecovalve-geo-mg 1) +(def-art-elt ecovalve-ag ecovalve-idle-ja 2) + + diff --git a/goal_src/import/ecoventrock-ag.gc b/goal_src/import/ecoventrock-ag.gc new file mode 100644 index 0000000000..eef17178b9 --- /dev/null +++ b/goal_src/import/ecoventrock-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ecoventrock-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ecoventrock-ag ecoventrock-lod0-jg 0) +(def-art-elt ecoventrock-ag ecoventrock-lod0-mg 1) +(def-art-elt ecoventrock-ag ecoventrock-lod1-mg 2) +(def-art-elt ecoventrock-ag ecoventrock-idle-ja 3) + + diff --git a/goal_src/import/ef-plane-ag.gc b/goal_src/import/ef-plane-ag.gc new file mode 100644 index 0000000000..328c24356d --- /dev/null +++ b/goal_src/import/ef-plane-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ef-plane-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ef-plane-ag ef-plane-lod0-jg 0) +(def-art-elt ef-plane-ag ef-plane-lod0-mg 1) +(def-art-elt ef-plane-ag ef-plane-idle-ja 2) + + diff --git a/goal_src/import/eggtop-ag.gc b/goal_src/import/eggtop-ag.gc new file mode 100644 index 0000000000..ab93e16ada --- /dev/null +++ b/goal_src/import/eggtop-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; eggtop-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt eggtop-ag eggtop-lod0-jg 0) +(def-art-elt eggtop-ag eggtop-lod0-mg 1) +(def-art-elt eggtop-ag eggtop-idle-ja 2) + + diff --git a/goal_src/import/eichar-ag.gc b/goal_src/import/eichar-ag.gc new file mode 100644 index 0000000000..3013311c71 --- /dev/null +++ b/goal_src/import/eichar-ag.gc @@ -0,0 +1,106 @@ +;;-*-Lisp-*- +(in-package goal) + +;; eichar-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt eichar-ag eichar-lod0-jg 0) +(def-art-elt eichar-ag eichar-lod0-mg 1) +(def-art-elt eichar-ag eichar-shadow-mg 2) +(def-art-elt eichar-ag eichar-run-to-stance-ja 3) +(def-art-elt eichar-ag eichar-run-to-stance-loop-ja 4) +(def-art-elt eichar-ag eichar-stance-loop-ja 5) +(def-art-elt eichar-ag eichar-run-to-stance-left-ja 6) +(def-art-elt eichar-ag eichar-run-to-stance-loop-left-ja 7) +(def-art-elt eichar-ag eichar-stance-loop-left-ja 8) +(def-art-elt eichar-ag eichar-run-to-stance-right-ja 9) +(def-art-elt eichar-ag eichar-run-to-stance-loop-right-ja 10) +(def-art-elt eichar-ag eichar-stance-loop-right-ja 11) +(def-art-elt eichar-ag eichar-run-to-stance-up-ja 12) +(def-art-elt eichar-ag eichar-run-to-stance-loop-up-ja 13) +(def-art-elt eichar-ag eichar-stance-loop-up-ja 14) +(def-art-elt eichar-ag eichar-run-to-stance-down-ja 15) +(def-art-elt eichar-ag eichar-run-to-stance-loop-down-ja 16) +(def-art-elt eichar-ag eichar-stance-loop-down-ja 17) +(def-art-elt eichar-ag eichar-run-ja 18) +(def-art-elt eichar-ag eichar-run-up-ja 19) +(def-art-elt eichar-ag eichar-run-down-ja 20) +(def-art-elt eichar-ag eichar-run-right-ja 21) +(def-art-elt eichar-ag eichar-run-left-ja 22) +(def-art-elt eichar-ag eichar-walk-ja 23) +(def-art-elt eichar-ag eichar-walk-up-ja 24) +(def-art-elt eichar-ag eichar-walk-down-ja 25) +(def-art-elt eichar-ag eichar-walk-right-ja 26) +(def-art-elt eichar-ag eichar-walk-left-ja 27) +(def-art-elt eichar-ag eichar-run-squash-ja 28) +(def-art-elt eichar-ag eichar-run-squash-weak-ja 29) +(def-art-elt eichar-ag eichar-stance-to-duck-ja 30) +(def-art-elt eichar-ag eichar-duck-stance-ja 31) +(def-art-elt eichar-ag eichar-duck-walk-ja 32) +(def-art-elt eichar-ag eichar-turn-around-ja 33) +(def-art-elt eichar-ag eichar-jump-ja 34) +(def-art-elt eichar-ag eichar-jump-land-ja 35) +(def-art-elt eichar-ag eichar-painful-land-ja 36) +(def-art-elt eichar-ag eichar-painful-land-end-ja 37) +(def-art-elt eichar-ag eichar-jump-loop-ja 38) +(def-art-elt eichar-ag eichar-jump-short-land-ja 39) +(def-art-elt eichar-ag eichar-jump-forward-ja 40) +(def-art-elt eichar-ag eichar-duck-high-jump-ja 41) +(def-art-elt eichar-ag eichar-launch-jump-ja 42) +(def-art-elt eichar-ag eichar-launch-jump-loop-ja 43) +(def-art-elt eichar-ag eichar-edge-grab-stance0-ja 44) +(def-art-elt eichar-ag eichar-edge-grab-stance1-ja 45) +(def-art-elt eichar-ag eichar-falling-to-edge-grab-ja 46) +(def-art-elt eichar-ag eichar-edge-grab-swing-left-ja 47) +(def-art-elt eichar-ag eichar-edge-grab-swing-right-ja 48) +(def-art-elt eichar-ag eichar-edge-grab-to-jump-ja 49) +(def-art-elt eichar-ag eichar-edge-grab-off-ja 50) +(def-art-elt eichar-ag eichar-attack-from-stance-ja 51) +(def-art-elt eichar-ag eichar-attack-from-stance-end-ja 52) +(def-art-elt eichar-ag eichar-attack-from-stance-alt-end-ja 53) +(def-art-elt eichar-ag eichar-attack-from-stance-run-end-ja 54) +(def-art-elt eichar-ag eichar-attack-from-stance-run-alt-end-ja 55) +(def-art-elt eichar-ag eichar-attack-from-jump-ja 56) +(def-art-elt eichar-ag eichar-attack-from-jump-loop-ja 57) +(def-art-elt eichar-ag eichar-attack-from-jump-end-ja 58) +(def-art-elt eichar-ag eichar-attack-punch-ja 59) +(def-art-elt eichar-ag eichar-attack-punch-end-ja 60) +(def-art-elt eichar-ag eichar-attack-punch-alt-end-ja 61) +(def-art-elt eichar-ag eichar-attack-uppercut-ja 62) +(def-art-elt eichar-ag eichar-flop-down-ja 63) +(def-art-elt eichar-ag eichar-flop-down-loop-ja 64) +(def-art-elt eichar-ag eichar-flop-down-land-ja 65) +(def-art-elt eichar-ag eichar-moving-flop-down-ja 66) +(def-art-elt eichar-ag eichar-moving-flop-down-loop-ja 67) +(def-art-elt eichar-ag eichar-moving-flop-down-land-ja 68) +(def-art-elt eichar-ag eichar-duck-roll-ja 69) +(def-art-elt eichar-ag eichar-duck-roll-end-ja 70) +(def-art-elt eichar-ag eichar-wheel-flip-ja 71) +(def-art-elt eichar-ag eichar-wheel-flip-land-ja 72) +(def-art-elt eichar-ag eichar-hit-from-front-ja 73) +(def-art-elt eichar-ag eichar-hit-from-back-ja 74) +(def-art-elt eichar-ag eichar-hit-up-ja 75) +(def-art-elt eichar-ag eichar-deatha-ja 76) +(def-art-elt eichar-ag eichar-death-painful-land-ja 77) +(def-art-elt eichar-ag eichar-smack-surface-ja 78) +(def-art-elt eichar-ag eichar-smack-surface-end-ja 79) +(def-art-elt eichar-ag eichar-yellow-running-blast-ja 84) +(def-art-elt eichar-ag eichar-yellow-running-blast-end-ja 85) +(def-art-elt eichar-ag eichar-yellow-jumping-blast-ja 86) +(def-art-elt eichar-ag eichar-powerup-ja 87) +(def-art-elt eichar-ag eichar-shocked-ja 88) +(def-art-elt eichar-ag eichar-wade-shallow-walk-ja 89) +(def-art-elt eichar-ag eichar-wade-deep-walk-ja 90) +(def-art-elt eichar-ag eichar-swim-stance-ja 91) +(def-art-elt eichar-ag eichar-swim-walk-ja 92) +(def-art-elt eichar-ag eichar-swim-walk-to-down-ja 93) +(def-art-elt eichar-ag eichar-swim-down-ja 94) +(def-art-elt eichar-ag eichar-swim-down-to-up-ja 95) +(def-art-elt eichar-ag eichar-swim-up-ja 96) +(def-art-elt eichar-ag eichar-swim-up-to-stance-ja 97) +(def-art-elt eichar-ag eichar-swim-jump-ja 98) +(def-art-elt eichar-ag eichar-periscope-grab-ja 101) +(def-art-elt eichar-ag eichar-trip-ja 112) +(def-art-elt eichar-ag eichar-fuel-cell-victory-9-ja 121) + + diff --git a/goal_src/import/eichar-fish+0-ag.gc b/goal_src/import/eichar-fish+0-ag.gc new file mode 100644 index 0000000000..c96f83f034 --- /dev/null +++ b/goal_src/import/eichar-fish+0-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; eichar-fish+0-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt eichar-fish+0-ag eichar-fishing-ja 0) +(def-art-elt eichar-fish+0-ag eichar-fishing-lose-ja 1) +(def-art-elt eichar-fish+0-ag sidekick-fishing-ja 2) +(def-art-elt eichar-fish+0-ag sidekick-fishing-lose-ja 3) + + diff --git a/goal_src/import/eichar-flut+0-ag.gc b/goal_src/import/eichar-flut+0-ag.gc new file mode 100644 index 0000000000..91a9b015af --- /dev/null +++ b/goal_src/import/eichar-flut+0-ag.gc @@ -0,0 +1,74 @@ +;;-*-Lisp-*- +(in-package goal) + +;; eichar-flut+0-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt eichar-flut+0-ag eichar-flut-idle-ja 0) +(def-art-elt eichar-flut+0-ag eichar-flut-walk-ja 1) +(def-art-elt eichar-flut+0-ag eichar-flut-run-ja 2) +(def-art-elt eichar-flut+0-ag eichar-flut-jump-ja 3) +(def-art-elt eichar-flut+0-ag eichar-flut-jump-loop-ja 4) +(def-art-elt eichar-flut+0-ag eichar-flut-jump-land-ja 5) +(def-art-elt eichar-flut+0-ag eichar-flut-jump-forward-ja 6) +(def-art-elt eichar-flut+0-ag eichar-flut-jump-forward-loop-ja 7) +(def-art-elt eichar-flut+0-ag eichar-flut-jump-forward-land-ja 8) +(def-art-elt eichar-flut+0-ag eichar-flut-double-jump-ja 9) +(def-art-elt eichar-flut+0-ag eichar-flut-running-attack-ja 10) +(def-art-elt eichar-flut+0-ag eichar-flut-running-attack-end-ja 11) +(def-art-elt eichar-flut+0-ag eichar-flut-air-attack-ja 12) +(def-art-elt eichar-flut+0-ag eichar-flut-air-attack-loop-ja 13) +(def-art-elt eichar-flut+0-ag eichar-flut-air-attack-land-ja 14) +(def-art-elt eichar-flut+0-ag eichar-flut-get-on-ja 15) +(def-art-elt eichar-flut+0-ag eichar-flut-get-off-ja 16) +(def-art-elt eichar-flut+0-ag eichar-flut-hit-back-ja 17) +(def-art-elt eichar-flut+0-ag eichar-flut-smack-surface-ja 18) +(def-art-elt eichar-flut+0-ag eichar-flut-smack-surface-end-ja 19) +(def-art-elt eichar-flut+0-ag eichar-flut-deatha-ja 20) +(def-art-elt eichar-flut+0-ag eichar-flut-squash-run-ja 21) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-idle-ja 22) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-walk-ja 23) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-run-ja 24) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-jump-ja 25) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-jump-loop-ja 26) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-jump-land-ja 27) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-jump-forward-ja 28) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-jump-forward-loop-ja 29) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-jump-forward-land-ja 30) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-double-jump-ja 31) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-running-attack-ja 32) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-running-attack-end-ja 33) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-air-attack-ja 34) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-air-attack-loop-ja 35) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-air-attack-land-ja 36) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-get-on-ja 37) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-get-off-ja 38) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-hit-back-ja 39) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-smack-surface-ja 40) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-smack-surface-end-ja 41) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-deatha-ja 42) +(def-art-elt eichar-flut+0-ag flut-saddle-flut-squash-run-ja 43) +(def-art-elt eichar-flut+0-ag sidekick-flut-idle-ja 44) +(def-art-elt eichar-flut+0-ag sidekick-flut-walk-ja 45) +(def-art-elt eichar-flut+0-ag sidekick-flut-run-ja 46) +(def-art-elt eichar-flut+0-ag sidekick-flut-jump-ja 47) +(def-art-elt eichar-flut+0-ag sidekick-flut-jump-loop-ja 48) +(def-art-elt eichar-flut+0-ag sidekick-flut-jump-land-ja 49) +(def-art-elt eichar-flut+0-ag sidekick-flut-jump-forward-ja 50) +(def-art-elt eichar-flut+0-ag sidekick-flut-jump-forward-loop-ja 51) +(def-art-elt eichar-flut+0-ag sidekick-flut-jump-forward-land-ja 52) +(def-art-elt eichar-flut+0-ag sidekick-flut-double-jump-ja 53) +(def-art-elt eichar-flut+0-ag sidekick-flut-running-attack-ja 54) +(def-art-elt eichar-flut+0-ag sidekick-flut-running-attack-end-ja 55) +(def-art-elt eichar-flut+0-ag sidekick-flut-air-attack-ja 56) +(def-art-elt eichar-flut+0-ag sidekick-flut-air-attack-loop-ja 57) +(def-art-elt eichar-flut+0-ag sidekick-flut-air-attack-land-ja 58) +(def-art-elt eichar-flut+0-ag sidekick-flut-get-on-ja 59) +(def-art-elt eichar-flut+0-ag sidekick-flut-get-off-ja 60) +(def-art-elt eichar-flut+0-ag sidekick-flut-hit-back-ja 61) +(def-art-elt eichar-flut+0-ag sidekick-flut-smack-surface-ja 62) +(def-art-elt eichar-flut+0-ag sidekick-flut-smack-surface-end-ja 63) +(def-art-elt eichar-flut+0-ag sidekick-flut-deatha-ja 64) +(def-art-elt eichar-flut+0-ag sidekick-flut-squash-run-ja 65) + + diff --git a/goal_src/import/eichar-ice+0-ag.gc b/goal_src/import/eichar-ice+0-ag.gc new file mode 100644 index 0000000000..07d80ab639 --- /dev/null +++ b/goal_src/import/eichar-ice+0-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; eichar-ice+0-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt eichar-ice+0-ag eichar-ice-skate-ja 0) +(def-art-elt eichar-ice+0-ag eichar-ice-slide-ja 1) +(def-art-elt eichar-ice+0-ag eichar-ice-stance-ja 2) +(def-art-elt eichar-ice+0-ag sidekick-ice-skate-ja 3) +(def-art-elt eichar-ice+0-ag sidekick-ice-slide-ja 4) +(def-art-elt eichar-ice+0-ag sidekick-ice-stance-ja 5) + + diff --git a/goal_src/import/eichar-pole+0-ag.gc b/goal_src/import/eichar-pole+0-ag.gc new file mode 100644 index 0000000000..25dadefaa7 --- /dev/null +++ b/goal_src/import/eichar-pole+0-ag.gc @@ -0,0 +1,17 @@ +;;-*-Lisp-*- +(in-package goal) + +;; eichar-pole+0-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt eichar-pole+0-ag eichar-pole-cycle-ja 0) +(def-art-elt eichar-pole+0-ag eichar-pole-flip-up-ja 1) +(def-art-elt eichar-pole+0-ag eichar-pole-flip-forward-ja 2) +(def-art-elt eichar-pole+0-ag eichar-pole-jump-loop-ja 3) +(def-art-elt eichar-pole+0-ag sidekick-pole-cycle-ja 4) +(def-art-elt eichar-pole+0-ag sidekick-pole-cycle2-ja 5) +(def-art-elt eichar-pole+0-ag sidekick-pole-flip-up-ja 6) +(def-art-elt eichar-pole+0-ag sidekick-pole-flip-forward-ja 7) +(def-art-elt eichar-pole+0-ag sidekick-pole-jump-loop-ja 8) + + diff --git a/goal_src/import/eichar-racer+0-ag.gc b/goal_src/import/eichar-racer+0-ag.gc new file mode 100644 index 0000000000..4d7492c606 --- /dev/null +++ b/goal_src/import/eichar-racer+0-ag.gc @@ -0,0 +1,62 @@ +;;-*-Lisp-*- +(in-package goal) + +;; eichar-racer+0-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt eichar-racer+0-ag eichar-racer-idle-ja 0) +(def-art-elt eichar-racer+0-ag eichar-racer-turn-ja 1) +(def-art-elt eichar-racer+0-ag eichar-racer-turn2-ja 2) +(def-art-elt eichar-racer+0-ag eichar-racer-dig-ja 3) +(def-art-elt eichar-racer+0-ag eichar-racer-dig2-ja 4) +(def-art-elt eichar-racer+0-ag eichar-racer-jump-ja 5) +(def-art-elt eichar-racer+0-ag eichar-racer-jump-loop-ja 6) +(def-art-elt eichar-racer+0-ag eichar-racer-jump-land-ja 7) +(def-art-elt eichar-racer+0-ag eichar-racer-jump-small-ja 8) +(def-art-elt eichar-racer+0-ag eichar-racer-jump-small-loop-ja 9) +(def-art-elt eichar-racer+0-ag eichar-racer-jump-small-land-ja 10) +(def-art-elt eichar-racer+0-ag eichar-racer-stance-ja 11) +(def-art-elt eichar-racer+0-ag eichar-racer-jump-high-loop-ja 12) +(def-art-elt eichar-racer+0-ag eichar-racer-jump-high-land-ja 13) +(def-art-elt eichar-racer+0-ag eichar-racer-smack-ja 14) +(def-art-elt eichar-racer+0-ag eichar-racer-get-off-ja 15) +(def-art-elt eichar-racer+0-ag eichar-racer-get-on-ja 16) +(def-art-elt eichar-racer+0-ag eichar-racer-death-explode-ja 17) +(def-art-elt eichar-racer+0-ag racer-racer-idle-ja 18) +(def-art-elt eichar-racer+0-ag racer-racer-turn-ja 19) +(def-art-elt eichar-racer+0-ag racer-racer-turn2-ja 20) +(def-art-elt eichar-racer+0-ag racer-racer-dig-ja 21) +(def-art-elt eichar-racer+0-ag racer-racer-dig2-ja 22) +(def-art-elt eichar-racer+0-ag racer-racer-jump-ja 23) +(def-art-elt eichar-racer+0-ag racer-racer-jump-loop-ja 24) +(def-art-elt eichar-racer+0-ag racer-racer-jump-land-ja 25) +(def-art-elt eichar-racer+0-ag racer-racer-jump-small-ja 26) +(def-art-elt eichar-racer+0-ag racer-racer-jump-small-loop-ja 27) +(def-art-elt eichar-racer+0-ag racer-racer-jump-small-land-ja 28) +(def-art-elt eichar-racer+0-ag racer-racer-stance-ja 29) +(def-art-elt eichar-racer+0-ag racer-racer-jump-high-loop-ja 30) +(def-art-elt eichar-racer+0-ag racer-racer-jump-high-land-ja 31) +(def-art-elt eichar-racer+0-ag racer-racer-smack-ja 32) +(def-art-elt eichar-racer+0-ag racer-racer-get-off-ja 33) +(def-art-elt eichar-racer+0-ag racer-racer-get-on-ja 34) +(def-art-elt eichar-racer+0-ag racer-racer-death-explode-ja 35) +(def-art-elt eichar-racer+0-ag sidekick-racer-idle-ja 36) +(def-art-elt eichar-racer+0-ag sidekick-racer-turn-ja 37) +(def-art-elt eichar-racer+0-ag sidekick-racer-turn2-ja 38) +(def-art-elt eichar-racer+0-ag sidekick-racer-dig-ja 39) +(def-art-elt eichar-racer+0-ag sidekick-racer-dig2-ja 40) +(def-art-elt eichar-racer+0-ag sidekick-racer-jump-ja 41) +(def-art-elt eichar-racer+0-ag sidekick-racer-jump-loop-ja 42) +(def-art-elt eichar-racer+0-ag sidekick-racer-jump-land-ja 43) +(def-art-elt eichar-racer+0-ag sidekick-racer-jump-small-ja 44) +(def-art-elt eichar-racer+0-ag sidekick-racer-jump-small-loop-ja 45) +(def-art-elt eichar-racer+0-ag sidekick-racer-jump-small-land-ja 46) +(def-art-elt eichar-racer+0-ag sidekick-racer-stance-ja 47) +(def-art-elt eichar-racer+0-ag sidekick-racer-jump-high-loop-ja 48) +(def-art-elt eichar-racer+0-ag sidekick-racer-jump-high-land-ja 49) +(def-art-elt eichar-racer+0-ag sidekick-racer-smack-ja 50) +(def-art-elt eichar-racer+0-ag sidekick-racer-get-off-ja 51) +(def-art-elt eichar-racer+0-ag sidekick-racer-get-on-ja 52) +(def-art-elt eichar-racer+0-ag sidekick-racer-death-explode-ja 53) + + diff --git a/goal_src/import/eichar-tube+0-ag.gc b/goal_src/import/eichar-tube+0-ag.gc new file mode 100644 index 0000000000..28f952689a --- /dev/null +++ b/goal_src/import/eichar-tube+0-ag.gc @@ -0,0 +1,22 @@ +;;-*-Lisp-*- +(in-package goal) + +;; eichar-tube+0-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt eichar-tube+0-ag eichar-tube-turn-ja 0) +(def-art-elt eichar-tube+0-ag eichar-tube-jump-land-ja 1) +(def-art-elt eichar-tube+0-ag eichar-tube-dummy2-ja 2) +(def-art-elt eichar-tube+0-ag eichar-tube-dummy3-ja 3) +(def-art-elt eichar-tube+0-ag eichar-tube-dummy4-ja 4) +(def-art-elt eichar-tube+0-ag eichar-tube-dummy5-ja 5) +(def-art-elt eichar-tube+0-ag eichar-tube-dummy6-ja 6) +(def-art-elt eichar-tube+0-ag sidekick-tube-turn-ja 7) +(def-art-elt eichar-tube+0-ag sidekick-tube-jump-land-ja 8) +(def-art-elt eichar-tube+0-ag sidekick-tube-dummy2-ja 9) +(def-art-elt eichar-tube+0-ag sidekick-tube-dummy3-ja 10) +(def-art-elt eichar-tube+0-ag sidekick-tube-dummy4-ja 11) +(def-art-elt eichar-tube+0-ag sidekick-tube-dummy5-ja 12) +(def-art-elt eichar-tube+0-ag sidekick-tube-dummy6-ja 13) + + diff --git a/goal_src/import/energyarm-ag.gc b/goal_src/import/energyarm-ag.gc new file mode 100644 index 0000000000..b8c1d29d7b --- /dev/null +++ b/goal_src/import/energyarm-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; energyarm-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt energyarm-ag energyarm-lod0-jg 0) +(def-art-elt energyarm-ag energyarm-lod0-mg 1) +(def-art-elt energyarm-ag energyarm-lod1-mg 2) +(def-art-elt energyarm-ag energyarm-idle-ja 3) + + diff --git a/goal_src/import/energyball-ag.gc b/goal_src/import/energyball-ag.gc new file mode 100644 index 0000000000..3392602bac --- /dev/null +++ b/goal_src/import/energyball-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; energyball-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt energyball-ag energyball-lod0-jg 0) +(def-art-elt energyball-ag energyball-lod0-mg 1) +(def-art-elt energyball-ag energyball-idle-ja 2) + + diff --git a/goal_src/import/energybase-ag.gc b/goal_src/import/energybase-ag.gc new file mode 100644 index 0000000000..67b038a7ff --- /dev/null +++ b/goal_src/import/energybase-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; energybase-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt energybase-ag energybase-lod0-jg 0) +(def-art-elt energybase-ag energybase-lod0-mg 1) +(def-art-elt energybase-ag energybase-idle-ja 2) + + diff --git a/goal_src/import/energydoor-ag.gc b/goal_src/import/energydoor-ag.gc new file mode 100644 index 0000000000..7aee5239fa --- /dev/null +++ b/goal_src/import/energydoor-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; energydoor-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt energydoor-ag energydoor-lod0-jg 0) +(def-art-elt energydoor-ag energydoor-lod0-mg 1) +(def-art-elt energydoor-ag energydoor-idle-ja 2) + + diff --git a/goal_src/import/energyhub-ag.gc b/goal_src/import/energyhub-ag.gc new file mode 100644 index 0000000000..16708185d3 --- /dev/null +++ b/goal_src/import/energyhub-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; energyhub-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt energyhub-ag energyhub-lod0-jg 0) +(def-art-elt energyhub-ag energyhub-lod0-mg 1) +(def-art-elt energyhub-ag energyhub-idle-ja 2) + + diff --git a/goal_src/import/evilbro-ag.gc b/goal_src/import/evilbro-ag.gc new file mode 100644 index 0000000000..e0a4a54170 --- /dev/null +++ b/goal_src/import/evilbro-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; evilbro-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt evilbro-ag evilbro-lod0-jg 0) +(def-art-elt evilbro-ag evilbro-lod0-mg 1) +(def-art-elt evilbro-ag evilbro-shadow-mg 2) +(def-art-elt evilbro-ag evilbro-idle-ja 3) + + diff --git a/goal_src/import/evilbro-citadel-ag.gc b/goal_src/import/evilbro-citadel-ag.gc new file mode 100644 index 0000000000..615de3fa58 --- /dev/null +++ b/goal_src/import/evilbro-citadel-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; evilbro-citadel-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt evilbro-citadel-ag evilbro-citadel-lod0-jg 0) +(def-art-elt evilbro-citadel-ag evilbro-citadel-lod0-mg 1) +(def-art-elt evilbro-citadel-ag evilbro-citadel-shadow-mg 2) +(def-art-elt evilbro-citadel-ag evilbro-citadel-idle-ja 3) + + diff --git a/goal_src/import/evilbro-village3-ag.gc b/goal_src/import/evilbro-village3-ag.gc new file mode 100644 index 0000000000..31f998f61c --- /dev/null +++ b/goal_src/import/evilbro-village3-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; evilbro-village3-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt evilbro-village3-ag evilbro-village3-lod0-jg 0) +(def-art-elt evilbro-village3-ag evilbro-village3-lod0-mg 1) +(def-art-elt evilbro-village3-ag evilbro-village3-shadow-mg 2) +(def-art-elt evilbro-village3-ag evilbro-village3-idle-ja 3) + + diff --git a/goal_src/import/evilplant-ag.gc b/goal_src/import/evilplant-ag.gc new file mode 100644 index 0000000000..eb6bebfce3 --- /dev/null +++ b/goal_src/import/evilplant-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; evilplant-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt evilplant-ag evilplant-lod0-jg 0) +(def-art-elt evilplant-ag evilplant-lod0-mg 1) +(def-art-elt evilplant-ag evilplant-idle-ja 2) + + diff --git a/goal_src/import/evilsis-ag.gc b/goal_src/import/evilsis-ag.gc new file mode 100644 index 0000000000..d3a3700943 --- /dev/null +++ b/goal_src/import/evilsis-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; evilsis-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt evilsis-ag evilsis-lod0-jg 0) +(def-art-elt evilsis-ag evilsis-lod0-mg 1) +(def-art-elt evilsis-ag evilsis-shadow-mg 2) +(def-art-elt evilsis-ag evilsis-idle-ja 3) + + diff --git a/goal_src/import/evilsis-citadel-ag.gc b/goal_src/import/evilsis-citadel-ag.gc new file mode 100644 index 0000000000..be905d8651 --- /dev/null +++ b/goal_src/import/evilsis-citadel-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; evilsis-citadel-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt evilsis-citadel-ag evilsis-citadel-lod0-jg 0) +(def-art-elt evilsis-citadel-ag evilsis-citadel-lod0-mg 1) +(def-art-elt evilsis-citadel-ag evilsis-citadel-shadow-mg 2) +(def-art-elt evilsis-citadel-ag evilsis-citadel-idle-ja 3) + + diff --git a/goal_src/import/evilsis-village3-ag.gc b/goal_src/import/evilsis-village3-ag.gc new file mode 100644 index 0000000000..cbd4cfcc5c --- /dev/null +++ b/goal_src/import/evilsis-village3-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; evilsis-village3-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt evilsis-village3-ag evilsis-village3-lod0-jg 0) +(def-art-elt evilsis-village3-ag evilsis-village3-lod0-mg 1) +(def-art-elt evilsis-village3-ag evilsis-village3-shadow-mg 2) +(def-art-elt evilsis-village3-ag evilsis-village3-idle-ja 3) + + diff --git a/goal_src/import/exit-chamber-ag.gc b/goal_src/import/exit-chamber-ag.gc new file mode 100644 index 0000000000..c12a77ef97 --- /dev/null +++ b/goal_src/import/exit-chamber-ag.gc @@ -0,0 +1,18 @@ +;;-*-Lisp-*- +(in-package goal) + +;; exit-chamber-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt exit-chamber-ag exit-chamber-lod0-jg 0) +(def-art-elt exit-chamber-ag exit-chamber-lod0-mg 1) +(def-art-elt exit-chamber-ag exit-chamber-idle-ja 2) +(def-art-elt exit-chamber-ag exit-chamber-start-door-shut-ja 3) +(def-art-elt exit-chamber-ag exit-chamber-start-in-room-ja 4) +(def-art-elt exit-chamber-ag exit-chamber-middle-in-water-ja 5) +(def-art-elt exit-chamber-ag exit-chamber-end-out-of-water-ja 6) +(def-art-elt exit-chamber-ag exit-chamber-dive-start-ja 7) +(def-art-elt exit-chamber-ag exit-chamber-dive-middle-ja 8) +(def-art-elt exit-chamber-ag exit-chamber-dive-end-ja 9) + + diff --git a/goal_src/import/exit-chamber-dummy-ag.gc b/goal_src/import/exit-chamber-dummy-ag.gc new file mode 100644 index 0000000000..241e782407 --- /dev/null +++ b/goal_src/import/exit-chamber-dummy-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; exit-chamber-dummy-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt exit-chamber-dummy-ag exit-chamber-dummy-lod0-jg 0) +(def-art-elt exit-chamber-dummy-ag exit-chamber-dummy-lod0-mg 1) +(def-art-elt exit-chamber-dummy-ag exit-chamber-dummy-idle-ja 2) + + diff --git a/goal_src/import/explorer-ag.gc b/goal_src/import/explorer-ag.gc new file mode 100644 index 0000000000..308e0c16d1 --- /dev/null +++ b/goal_src/import/explorer-ag.gc @@ -0,0 +1,17 @@ +;;-*-Lisp-*- +(in-package goal) + +;; explorer-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt explorer-ag explorer-lod0-jg 0) +(def-art-elt explorer-ag explorer-lod0-mg 1) +(def-art-elt explorer-ag explorer-shadow-mg 2) +(def-art-elt explorer-ag explorer-idle-ja 3) +(def-art-elt explorer-ag explorer-idle2-look-at-map-ja 4) +(def-art-elt explorer-ag explorer-idle2-look-right-map-ja 5) +(def-art-elt explorer-ag explorer-idle3-step-right-ja 6) +(def-art-elt explorer-ag explorer-idle3-looking-ja 7) +(def-art-elt explorer-ag explorer-idle3-step-left-ja 8) + + diff --git a/goal_src/import/farmer-ag.gc b/goal_src/import/farmer-ag.gc new file mode 100644 index 0000000000..aecdde60b1 --- /dev/null +++ b/goal_src/import/farmer-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; farmer-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt farmer-ag farmer-lod0-jg 0) +(def-art-elt farmer-ag farmer-lod0-mg 1) +(def-art-elt farmer-ag farmer-lod1-mg 2) +(def-art-elt farmer-ag farmer-shadow-mg 3) +(def-art-elt farmer-ag farmer-sitting-cycle-ja 4) +(def-art-elt farmer-ag farmer-standing-cycle-ja 5) + + diff --git a/goal_src/import/farthy-snack-ag.gc b/goal_src/import/farthy-snack-ag.gc new file mode 100644 index 0000000000..0bf658b9bd --- /dev/null +++ b/goal_src/import/farthy-snack-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; farthy-snack-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt farthy-snack-ag farthy-snack-lod0-jg 0) +(def-art-elt farthy-snack-ag farthy-snack-lod0-mg 1) +(def-art-elt farthy-snack-ag farthy-snack-idle-ja 2) +(def-art-elt farthy-snack-ag farthy-snack-eat-ja 3) + + diff --git a/goal_src/import/finalbosscam-ag.gc b/goal_src/import/finalbosscam-ag.gc new file mode 100644 index 0000000000..0da0d480d7 --- /dev/null +++ b/goal_src/import/finalbosscam-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; finalbosscam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt finalbosscam-ag finalbosscam-lod0-jg 0) +(def-art-elt finalbosscam-ag finalbosscam-lod0-mg 1) +(def-art-elt finalbosscam-ag finalbosscam-idle-ja 2) + + diff --git a/goal_src/import/fireboulder-ag.gc b/goal_src/import/fireboulder-ag.gc new file mode 100644 index 0000000000..626d908aa2 --- /dev/null +++ b/goal_src/import/fireboulder-ag.gc @@ -0,0 +1,18 @@ +;;-*-Lisp-*- +(in-package goal) + +;; fireboulder-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt fireboulder-ag fireboulder-lod0-jg 0) +(def-art-elt fireboulder-ag fireboulder-lod0-mg 1) +(def-art-elt fireboulder-ag fireboulder-idle-ja 2) +(def-art-elt fireboulder-ag fireboulder-hover-ja 3) +(def-art-elt fireboulder-ag fireboulder-boulder1-ja 4) +(def-art-elt fireboulder-ag fireboulder-boulder2-ja 5) +(def-art-elt fireboulder-ag fireboulder-boulder3-ja 6) +(def-art-elt fireboulder-ag fireboulder-boulder3b-ja 7) +(def-art-elt fireboulder-ag fireboulder-boulder4-ja 8) +(def-art-elt fireboulder-ag fireboulder-pre-throw-ja 10) + + diff --git a/goal_src/import/fish-net-ag.gc b/goal_src/import/fish-net-ag.gc new file mode 100644 index 0000000000..78a0964b8e --- /dev/null +++ b/goal_src/import/fish-net-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; fish-net-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt fish-net-ag fish-net-lod0-jg 0) +(def-art-elt fish-net-ag fish-net-lod0-mg 1) +(def-art-elt fish-net-ag fish-net-fishing-ja 2) + + diff --git a/goal_src/import/fisher-ag.gc b/goal_src/import/fisher-ag.gc new file mode 100644 index 0000000000..341b9e9b6a --- /dev/null +++ b/goal_src/import/fisher-ag.gc @@ -0,0 +1,16 @@ +;;-*-Lisp-*- +(in-package goal) + +;; fisher-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt fisher-ag fisher-lod0-jg 0) +(def-art-elt fisher-ag fisher-lod0-mg 1) +(def-art-elt fisher-ag fisher-lod1-mg 2) +(def-art-elt fisher-ag fisher-lod2-mg 3) +(def-art-elt fisher-ag fisher-shadow-mg 4) +(def-art-elt fisher-ag fisher-idle-less-often-ja 5) +(def-art-elt fisher-ag fisher-idle-more-often-ja 6) +(def-art-elt fisher-ag fisher-idle-win-ja 7) + + diff --git a/goal_src/import/fishermans-boat-ag.gc b/goal_src/import/fishermans-boat-ag.gc new file mode 100644 index 0000000000..086788adb4 --- /dev/null +++ b/goal_src/import/fishermans-boat-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; fishermans-boat-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt fishermans-boat-ag fishermans-boat-lod0-jg 0) +(def-art-elt fishermans-boat-ag fishermans-boat-lod0-mg 1) +(def-art-elt fishermans-boat-ag fishermans-boat-lod1-mg 2) +(def-art-elt fishermans-boat-ag fishermans-boat-idle-ja 3) + + diff --git a/goal_src/import/floating-launcher-ag.gc b/goal_src/import/floating-launcher-ag.gc new file mode 100644 index 0000000000..e789d2d899 --- /dev/null +++ b/goal_src/import/floating-launcher-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; floating-launcher-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt floating-launcher-ag floating-launcher-lod0-jg 0) +(def-art-elt floating-launcher-ag floating-launcher-lod0-mg 1) +(def-art-elt floating-launcher-ag floating-launcher-idle-ja 2) + + diff --git a/goal_src/import/flut-saddle-ag.gc b/goal_src/import/flut-saddle-ag.gc new file mode 100644 index 0000000000..5820aa9a27 --- /dev/null +++ b/goal_src/import/flut-saddle-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; flut-saddle-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt flut-saddle-ag flut-saddle-lod0-jg 0) +(def-art-elt flut-saddle-ag flut-saddle-lod0-mg 1) +(def-art-elt flut-saddle-ag flut-saddle-shadow-mg 2) + + diff --git a/goal_src/import/flutflut-ag.gc b/goal_src/import/flutflut-ag.gc new file mode 100644 index 0000000000..06bb73ade8 --- /dev/null +++ b/goal_src/import/flutflut-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; flutflut-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt flutflut-ag flutflut-lod0-jg 0) +(def-art-elt flutflut-ag flutflut-lod0-mg 1) +(def-art-elt flutflut-ag flutflut-flutflut-idle-ja 2) + + diff --git a/goal_src/import/flutflut-bluehut-ag.gc b/goal_src/import/flutflut-bluehut-ag.gc new file mode 100644 index 0000000000..0a04bd89dc --- /dev/null +++ b/goal_src/import/flutflut-bluehut-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; flutflut-bluehut-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt flutflut-bluehut-ag flutflut-bluehut-lod0-jg 0) +(def-art-elt flutflut-bluehut-ag flutflut-bluehut-lod0-mg 1) +(def-art-elt flutflut-bluehut-ag flutflut-bluehut-idle-breathe-ja 2) +(def-art-elt flutflut-bluehut-ag flutflut-bluehut-idle-start-scratch-ja 3) +(def-art-elt flutflut-bluehut-ag flutflut-bluehut-idle-scratch-ja 4) + + diff --git a/goal_src/import/flutflut-plat-large-ag.gc b/goal_src/import/flutflut-plat-large-ag.gc new file mode 100644 index 0000000000..ebd9c5ce37 --- /dev/null +++ b/goal_src/import/flutflut-plat-large-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; flutflut-plat-large-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt flutflut-plat-large-ag flutflut-plat-large-lod0-jg 0) +(def-art-elt flutflut-plat-large-ag flutflut-plat-large-lod0-mg 1) +(def-art-elt flutflut-plat-large-ag flutflut-plat-large-idle-ja 2) + + diff --git a/goal_src/import/flutflut-plat-med-ag.gc b/goal_src/import/flutflut-plat-med-ag.gc new file mode 100644 index 0000000000..5409098bd7 --- /dev/null +++ b/goal_src/import/flutflut-plat-med-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; flutflut-plat-med-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt flutflut-plat-med-ag flutflut-plat-med-lod0-jg 0) +(def-art-elt flutflut-plat-med-ag flutflut-plat-med-lod0-mg 1) +(def-art-elt flutflut-plat-med-ag flutflut-plat-med-idle-ja 2) + + diff --git a/goal_src/import/flutflut-plat-small-ag.gc b/goal_src/import/flutflut-plat-small-ag.gc new file mode 100644 index 0000000000..3d929564cb --- /dev/null +++ b/goal_src/import/flutflut-plat-small-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; flutflut-plat-small-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt flutflut-plat-small-ag flutflut-plat-small-lod0-jg 0) +(def-art-elt flutflut-plat-small-ag flutflut-plat-small-lod0-mg 1) +(def-art-elt flutflut-plat-small-ag flutflut-plat-small-idle-ja 2) + + diff --git a/goal_src/import/flutflutegg-ag.gc b/goal_src/import/flutflutegg-ag.gc new file mode 100644 index 0000000000..3f50948717 --- /dev/null +++ b/goal_src/import/flutflutegg-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; flutflutegg-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt flutflutegg-ag flutflutegg-lod0-jg 0) +(def-art-elt flutflutegg-ag flutflutegg-lod0-mg 1) +(def-art-elt flutflutegg-ag flutflutegg-lod1-mg 2) +(def-art-elt flutflutegg-ag flutflutegg-lod2-mg 3) +(def-art-elt flutflutegg-ag flutflutegg-idle-ja 4) +(def-art-elt flutflutegg-ag flutflutegg-crack-ja 5) +(def-art-elt flutflutegg-ag flutflutegg-broke-ja 6) + + diff --git a/goal_src/import/flying-lurker-ag.gc b/goal_src/import/flying-lurker-ag.gc new file mode 100644 index 0000000000..ff1ec8a8fa --- /dev/null +++ b/goal_src/import/flying-lurker-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; flying-lurker-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt flying-lurker-ag flying-lurker-lod0-jg 0) +(def-art-elt flying-lurker-ag flying-lurker-lod0-mg 1) +(def-art-elt flying-lurker-ag flying-lurker-lod1-mg 2) +(def-art-elt flying-lurker-ag flying-lurker-lod2-mg 3) +(def-art-elt flying-lurker-ag flying-lurker-shadow-mg 4) +(def-art-elt flying-lurker-ag flying-lurker-fly-ja 5) +(def-art-elt flying-lurker-ag flying-lurker-look-ja 6) + + diff --git a/goal_src/import/fuel-cell-ag.gc b/goal_src/import/fuel-cell-ag.gc new file mode 100644 index 0000000000..6ba8fe3fd4 --- /dev/null +++ b/goal_src/import/fuel-cell-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; fuel-cell-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt fuel-cell-ag fuel-cell-lod0-jg 0) +(def-art-elt fuel-cell-ag fuel-cell-lod0-mg 1) +(def-art-elt fuel-cell-ag fuel-cell-idle-ja 2) +(def-art-elt fuel-cell-ag fuel-cell-fuel-cell-victory-9-ja 11) + + diff --git a/goal_src/import/fuelcell-naked-ag.gc b/goal_src/import/fuelcell-naked-ag.gc new file mode 100644 index 0000000000..9d47569ac8 --- /dev/null +++ b/goal_src/import/fuelcell-naked-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; fuelcell-naked-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt fuelcell-naked-ag fuelcell-naked-lod0-jg 0) +(def-art-elt fuelcell-naked-ag fuelcell-naked-lod0-mg 1) +(def-art-elt fuelcell-naked-ag fuelcell-naked-idle-ja 2) + + diff --git a/goal_src/import/gambler-ag.gc b/goal_src/import/gambler-ag.gc new file mode 100644 index 0000000000..b0379d8f50 --- /dev/null +++ b/goal_src/import/gambler-ag.gc @@ -0,0 +1,19 @@ +;;-*-Lisp-*- +(in-package goal) + +;; gambler-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt gambler-ag gambler-lod0-jg 0) +(def-art-elt gambler-ag gambler-lod0-mg 1) +(def-art-elt gambler-ag gambler-lod1-mg 2) +(def-art-elt gambler-ag gambler-lod2-mg 3) +(def-art-elt gambler-ag gambler-shadow-mg 4) +(def-art-elt gambler-ag gambler-idle-tiptoe-ja 5) +(def-art-elt gambler-ag gambler-idle-look-1-ja 6) +(def-art-elt gambler-ag gambler-idle-fidget-ja 7) +(def-art-elt gambler-ag gambler-idle-scratch-1-ja 8) +(def-art-elt gambler-ag gambler-idle-look-2-ja 9) +(def-art-elt gambler-ag gambler-idle-scratch-2-ja 10) + + diff --git a/goal_src/import/generic-button-ag.gc b/goal_src/import/generic-button-ag.gc new file mode 100644 index 0000000000..20aa0a5b35 --- /dev/null +++ b/goal_src/import/generic-button-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; generic-button-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt generic-button-ag generic-button-lod0-jg 0) +(def-art-elt generic-button-ag generic-button-lod0-mg 1) +(def-art-elt generic-button-ag generic-button-idle-ja 2) + + diff --git a/goal_src/import/geologist-ag.gc b/goal_src/import/geologist-ag.gc new file mode 100644 index 0000000000..d73866551c --- /dev/null +++ b/goal_src/import/geologist-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; geologist-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt geologist-ag geologist-lod0-jg 0) +(def-art-elt geologist-ag geologist-lod0-mg 1) +(def-art-elt geologist-ag geologist-lod1-mg 2) +(def-art-elt geologist-ag geologist-lod2-mg 3) +(def-art-elt geologist-ag geologist-shadow-mg 4) +(def-art-elt geologist-ag geologist-idle-ja 5) + + diff --git a/goal_src/import/gnawer-ag.gc b/goal_src/import/gnawer-ag.gc new file mode 100644 index 0000000000..eabaa263fd --- /dev/null +++ b/goal_src/import/gnawer-ag.gc @@ -0,0 +1,26 @@ +;;-*-Lisp-*- +(in-package goal) + +;; gnawer-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt gnawer-ag gnawer-lod0-jg 0) +(def-art-elt gnawer-ag gnawer-lod0-mg 1) +(def-art-elt gnawer-ag gnawer-lod1-mg 2) +(def-art-elt gnawer-ag gnawer-lod2-mg 3) +(def-art-elt gnawer-ag gnawer-idle-ja 4) +(def-art-elt gnawer-ag gnawer-run-ja 5) +(def-art-elt gnawer-ag gnawer-takes-hit-ja 6) +(def-art-elt gnawer-ag gnawer-die-ja 7) +(def-art-elt gnawer-ag gnawer-tear-side-to-side-ja 8) +(def-art-elt gnawer-ag gnawer-tug-ja 9) +(def-art-elt gnawer-ag gnawer-up-to-chew-ja 10) +(def-art-elt gnawer-ag gnawer-chew-ja 11) +(def-art-elt gnawer-ag gnawer-notice-ja 12) +(def-art-elt gnawer-ag gnawer-down-from-chew-ja 13) +(def-art-elt gnawer-ag gnawer-segment-lod0-jg 14) +(def-art-elt gnawer-ag gnawer-segment-lod0-mg 15) +(def-art-elt gnawer-ag gnawer-segment-idle-ja 16) +(def-art-elt gnawer-ag gnawer-segment-die-ja 17) + + diff --git a/goal_src/import/gondola-ag.gc b/goal_src/import/gondola-ag.gc new file mode 100644 index 0000000000..24cc256e19 --- /dev/null +++ b/goal_src/import/gondola-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; gondola-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt gondola-ag gondola-lod0-jg 0) +(def-art-elt gondola-ag gondola-lod0-mg 1) +(def-art-elt gondola-ag gondola-shadow-mg 2) +(def-art-elt gondola-ag gondola-idle-down-ja 3) +(def-art-elt gondola-ag gondola-idle-up-ja 4) + + diff --git a/goal_src/import/gondolacables-ag.gc b/goal_src/import/gondolacables-ag.gc new file mode 100644 index 0000000000..663ef782a6 --- /dev/null +++ b/goal_src/import/gondolacables-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; gondolacables-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt gondolacables-ag gondolacables-lod0-jg 0) +(def-art-elt gondolacables-ag gondolacables-lod0-mg 1) +(def-art-elt gondolacables-ag gondolacables-idle-ja 2) + + diff --git a/goal_src/import/green-eco-lurker-ag.gc b/goal_src/import/green-eco-lurker-ag.gc new file mode 100644 index 0000000000..9f14522c83 --- /dev/null +++ b/goal_src/import/green-eco-lurker-ag.gc @@ -0,0 +1,20 @@ +;;-*-Lisp-*- +(in-package goal) + +;; green-eco-lurker-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt green-eco-lurker-ag green-eco-lurker-lod0-jg 0) +(def-art-elt green-eco-lurker-ag green-eco-lurker-lod0-mg 1) +(def-art-elt green-eco-lurker-ag green-eco-lurker-shadow-mg 2) +(def-art-elt green-eco-lurker-ag green-eco-lurker-idle-ja 3) +(def-art-elt green-eco-lurker-ag green-eco-lurker-charge-ja 4) +(def-art-elt green-eco-lurker-ag green-eco-lurker-win-ja 5) +(def-art-elt green-eco-lurker-ag green-eco-lurker-death-ja 6) +(def-art-elt green-eco-lurker-ag green-eco-lurker-jump-ja 7) +(def-art-elt green-eco-lurker-ag green-eco-lurker-jump-land-ja 8) +(def-art-elt green-eco-lurker-ag green-eco-lurker-spot-ja 9) +(def-art-elt green-eco-lurker-ag green-eco-lurker-turn-ja 10) +(def-art-elt green-eco-lurker-ag green-eco-lurker-jump-with-flip-ja 11) + + diff --git a/goal_src/import/green-sagecage-ag.gc b/goal_src/import/green-sagecage-ag.gc new file mode 100644 index 0000000000..f68d2d396c --- /dev/null +++ b/goal_src/import/green-sagecage-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; green-sagecage-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt green-sagecage-ag green-sagecage-lod0-jg 0) +(def-art-elt green-sagecage-ag green-sagecage-lod0-mg 1) +(def-art-elt green-sagecage-ag green-sagecage-lod1-mg 2) +(def-art-elt green-sagecage-ag green-sagecage-shadow-mg 3) +(def-art-elt green-sagecage-ag green-sagecage-green-sagecage-idle-ja 4) + + diff --git a/goal_src/import/greenshot-ag.gc b/goal_src/import/greenshot-ag.gc new file mode 100644 index 0000000000..30f6b37ca7 --- /dev/null +++ b/goal_src/import/greenshot-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; greenshot-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt greenshot-ag greenshot-lod0-jg 0) +(def-art-elt greenshot-ag greenshot-lod0-mg 1) +(def-art-elt greenshot-ag greenshot-idle-ja 2) + + diff --git a/goal_src/import/grottopole-ag.gc b/goal_src/import/grottopole-ag.gc new file mode 100644 index 0000000000..6d9f0fa6e3 --- /dev/null +++ b/goal_src/import/grottopole-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; grottopole-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt grottopole-ag grottopole-lod0-jg 0) +(def-art-elt grottopole-ag grottopole-lod0-mg 1) +(def-art-elt grottopole-ag grottopole-lod1-mg 2) +(def-art-elt grottopole-ag grottopole-idle-ja 3) + + diff --git a/goal_src/import/happy-plant-ag.gc b/goal_src/import/happy-plant-ag.gc new file mode 100644 index 0000000000..60983de695 --- /dev/null +++ b/goal_src/import/happy-plant-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; happy-plant-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt happy-plant-ag happy-plant-lod0-jg 0) +(def-art-elt happy-plant-ag happy-plant-lod0-mg 1) +(def-art-elt happy-plant-ag happy-plant-lod1-mg 2) +(def-art-elt happy-plant-ag happy-plant-init-ja 3) +(def-art-elt happy-plant-ag happy-plant-idle-ja 4) + + diff --git a/goal_src/import/harvester-ag.gc b/goal_src/import/harvester-ag.gc new file mode 100644 index 0000000000..fb0919ab48 --- /dev/null +++ b/goal_src/import/harvester-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; harvester-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt harvester-ag harvester-lod0-jg 0) +(def-art-elt harvester-ag harvester-lod0-mg 1) +(def-art-elt harvester-ag harvester-lod1-mg 2) +(def-art-elt harvester-ag harvester-lod2-mg 3) +(def-art-elt harvester-ag harvester-idle-ja 4) +(def-art-elt harvester-ag harvester-inflate-ja 5) + + diff --git a/goal_src/import/helix-button-ag.gc b/goal_src/import/helix-button-ag.gc new file mode 100644 index 0000000000..6a2a1b2bd1 --- /dev/null +++ b/goal_src/import/helix-button-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; helix-button-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt helix-button-ag helix-button-lod0-jg 0) +(def-art-elt helix-button-ag helix-button-lod0-mg 1) +(def-art-elt helix-button-ag helix-button-idle-ja 2) + + diff --git a/goal_src/import/helix-slide-door-ag.gc b/goal_src/import/helix-slide-door-ag.gc new file mode 100644 index 0000000000..774315feba --- /dev/null +++ b/goal_src/import/helix-slide-door-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; helix-slide-door-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt helix-slide-door-ag helix-slide-door-lod0-jg 0) +(def-art-elt helix-slide-door-ag helix-slide-door-lod0-mg 1) +(def-art-elt helix-slide-door-ag helix-slide-door-idle-ja 2) + + diff --git a/goal_src/import/hopper-ag.gc b/goal_src/import/hopper-ag.gc new file mode 100644 index 0000000000..422d13c1f4 --- /dev/null +++ b/goal_src/import/hopper-ag.gc @@ -0,0 +1,20 @@ +;;-*-Lisp-*- +(in-package goal) + +;; hopper-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt hopper-ag hopper-lod0-jg 0) +(def-art-elt hopper-ag hopper-lod0-mg 1) +(def-art-elt hopper-ag hopper-lod1-mg 2) +(def-art-elt hopper-ag hopper-lod2-mg 3) +(def-art-elt hopper-ag hopper-shadow-mg 4) +(def-art-elt hopper-ag hopper-idle-ja 5) +(def-art-elt hopper-ag hopper-burp-ja 6) +(def-art-elt hopper-ag hopper-jump-long-ja 7) +(def-art-elt hopper-ag hopper-jump-long-land-ja 8) +(def-art-elt hopper-ag hopper-jump-short-ja 9) +(def-art-elt hopper-ag hopper-jump-short-land-ja 10) +(def-art-elt hopper-ag hopper-death-ja 11) + + diff --git a/goal_src/import/hutlamp-ag.gc b/goal_src/import/hutlamp-ag.gc new file mode 100644 index 0000000000..3b912f2346 --- /dev/null +++ b/goal_src/import/hutlamp-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; hutlamp-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt hutlamp-ag hutlamp-lod0-jg 0) +(def-art-elt hutlamp-ag hutlamp-lod0-mg 1) +(def-art-elt hutlamp-ag hutlamp-idle-ja 2) + + diff --git a/goal_src/import/ice-cube-ag.gc b/goal_src/import/ice-cube-ag.gc new file mode 100644 index 0000000000..79b1967209 --- /dev/null +++ b/goal_src/import/ice-cube-ag.gc @@ -0,0 +1,26 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ice-cube-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ice-cube-ag ice-cube-lod0-jg 0) +(def-art-elt ice-cube-ag ice-cube-lod0-mg 1) +(def-art-elt ice-cube-ag ice-cube-lod1-mg 2) +(def-art-elt ice-cube-ag ice-cube-lod2-mg 3) +(def-art-elt ice-cube-ag ice-cube-shadow-mg 4) +(def-art-elt ice-cube-ag ice-cube-vuln-idle-ja 5) +(def-art-elt ice-cube-ag ice-cube-vuln-walk-ja 6) +(def-art-elt ice-cube-ag ice-cube-appear-jump-up-ja 7) +(def-art-elt ice-cube-ag ice-cube-appear-land-ja 8) +(def-art-elt ice-cube-ag ice-cube-extend-spikes-ja 9) +(def-art-elt ice-cube-ag ice-cube-turn-on-player-ja 10) +(def-art-elt ice-cube-ag ice-cube-turn-on-player-land-ja 11) +(def-art-elt ice-cube-ag ice-cube-invuln-run-ja 12) +(def-art-elt ice-cube-ag ice-cube-invuln-stopping-ja 13) +(def-art-elt ice-cube-ag ice-cube-retract-spikes-ja 14) +(def-art-elt ice-cube-ag ice-cube-breathing-ja 15) +(def-art-elt ice-cube-ag ice-cube-head-wipe-ja 16) +(def-art-elt ice-cube-ag ice-cube-invuln-stopping-upright-ja 17) + + diff --git a/goal_src/import/ice-cube-break-ag.gc b/goal_src/import/ice-cube-break-ag.gc new file mode 100644 index 0000000000..6a33c610c1 --- /dev/null +++ b/goal_src/import/ice-cube-break-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ice-cube-break-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ice-cube-break-ag ice-cube-break-lod0-jg 0) +(def-art-elt ice-cube-break-ag ice-cube-break-lod0-mg 1) +(def-art-elt ice-cube-break-ag ice-cube-break-idle-ja 2) + + diff --git a/goal_src/import/jak-white-ag.gc b/goal_src/import/jak-white-ag.gc new file mode 100644 index 0000000000..011725c0d3 --- /dev/null +++ b/goal_src/import/jak-white-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; jak-white-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt jak-white-ag jak-white-lod0-jg 0) +(def-art-elt jak-white-ag jak-white-lod0-mg 1) +(def-art-elt jak-white-ag jak-white-idle-ja 2) + + diff --git a/goal_src/import/jaws-ag.gc b/goal_src/import/jaws-ag.gc new file mode 100644 index 0000000000..4ab7596ffd --- /dev/null +++ b/goal_src/import/jaws-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; jaws-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt jaws-ag jaws-lod0-jg 0) +(def-art-elt jaws-ag jaws-lod0-mg 1) +(def-art-elt jaws-ag jaws-idle-ja 2) + + diff --git a/goal_src/import/jng-iris-door-ag.gc b/goal_src/import/jng-iris-door-ag.gc new file mode 100644 index 0000000000..7a02140deb --- /dev/null +++ b/goal_src/import/jng-iris-door-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; jng-iris-door-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt jng-iris-door-ag jng-iris-door-lod0-jg 0) +(def-art-elt jng-iris-door-ag jng-iris-door-lod0-mg 1) +(def-art-elt jng-iris-door-ag jng-iris-door-lod1-mg 2) +(def-art-elt jng-iris-door-ag jng-iris-door-idle-ja 3) + + diff --git a/goal_src/import/junglecam-ag.gc b/goal_src/import/junglecam-ag.gc new file mode 100644 index 0000000000..73624b005e --- /dev/null +++ b/goal_src/import/junglecam-ag.gc @@ -0,0 +1,17 @@ +;;-*-Lisp-*- +(in-package goal) + +;; junglecam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt junglecam-ag junglecam-lod0-jg 0) +(def-art-elt junglecam-ag junglecam-lod0-mg 1) +(def-art-elt junglecam-ag junglecam-beamcam-ja 2) +(def-art-elt junglecam-ag junglecam-tower1-ja 3) +(def-art-elt junglecam-ag junglecam-tower2-ja 4) +(def-art-elt junglecam-ag junglecam-tower3-ja 5) +(def-art-elt junglecam-ag junglecam-tower4-ja 6) +(def-art-elt junglecam-ag junglecam-tower5-ja 7) +(def-art-elt junglecam-ag junglecam-precurbridgecam-ja 8) + + diff --git a/goal_src/import/junglefish-ag.gc b/goal_src/import/junglefish-ag.gc new file mode 100644 index 0000000000..32fda5a53a --- /dev/null +++ b/goal_src/import/junglefish-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; junglefish-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt junglefish-ag junglefish-lod0-jg 0) +(def-art-elt junglefish-ag junglefish-lod0-mg 1) +(def-art-elt junglefish-ag junglefish-lod1-mg 2) +(def-art-elt junglefish-ag junglefish-lod2-mg 3) +(def-art-elt junglefish-ag junglefish-swim-ja 4) +(def-art-elt junglefish-ag junglefish-chomp-ja 5) +(def-art-elt junglefish-ag junglefish-death-ja 6) + + diff --git a/goal_src/import/junglesnake-ag.gc b/goal_src/import/junglesnake-ag.gc new file mode 100644 index 0000000000..c4014d4538 --- /dev/null +++ b/goal_src/import/junglesnake-ag.gc @@ -0,0 +1,16 @@ +;;-*-Lisp-*- +(in-package goal) + +;; junglesnake-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt junglesnake-ag junglesnake-lod0-jg 0) +(def-art-elt junglesnake-ag junglesnake-lod0-mg 1) +(def-art-elt junglesnake-ag junglesnake-idle-ja 2) +(def-art-elt junglesnake-ag junglesnake-strike-close-ja 3) +(def-art-elt junglesnake-ag junglesnake-strike-far-ja 4) +(def-art-elt junglesnake-ag junglesnake-drop-down-ja 5) +(def-art-elt junglesnake-ag junglesnake-death-ja 6) +(def-art-elt junglesnake-ag junglesnake-give-up-ja 7) + + diff --git a/goal_src/import/keg-ag.gc b/goal_src/import/keg-ag.gc new file mode 100644 index 0000000000..a87dfbf555 --- /dev/null +++ b/goal_src/import/keg-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; keg-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt keg-ag keg-lod0-jg 0) +(def-art-elt keg-ag keg-lod0-mg 1) +(def-art-elt keg-ag keg-lod1-mg 2) +(def-art-elt keg-ag keg-lod2-mg 3) +(def-art-elt keg-ag keg-shadow-mg 4) +(def-art-elt keg-ag keg-idle-ja 5) + + diff --git a/goal_src/import/keg-conveyor-ag.gc b/goal_src/import/keg-conveyor-ag.gc new file mode 100644 index 0000000000..39bda0722e --- /dev/null +++ b/goal_src/import/keg-conveyor-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; keg-conveyor-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt keg-conveyor-ag keg-conveyor-lod0-jg 0) +(def-art-elt keg-conveyor-ag keg-conveyor-lod0-mg 1) +(def-art-elt keg-conveyor-ag keg-conveyor-idle-ja 2) + + diff --git a/goal_src/import/keg-conveyor-paddle-ag.gc b/goal_src/import/keg-conveyor-paddle-ag.gc new file mode 100644 index 0000000000..c23607d2d9 --- /dev/null +++ b/goal_src/import/keg-conveyor-paddle-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; keg-conveyor-paddle-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt keg-conveyor-paddle-ag keg-conveyor-paddle-lod0-jg 0) +(def-art-elt keg-conveyor-paddle-ag keg-conveyor-paddle-lod0-mg 1) +(def-art-elt keg-conveyor-paddle-ag keg-conveyor-paddle-idle-ja 2) + + diff --git a/goal_src/import/kermit-ag.gc b/goal_src/import/kermit-ag.gc new file mode 100644 index 0000000000..ab40c16edc --- /dev/null +++ b/goal_src/import/kermit-ag.gc @@ -0,0 +1,20 @@ +;;-*-Lisp-*- +(in-package goal) + +;; kermit-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt kermit-ag kermit-lod0-jg 0) +(def-art-elt kermit-ag kermit-lod0-mg 1) +(def-art-elt kermit-ag kermit-lod1-mg 2) +(def-art-elt kermit-ag kermit-lod2-mg 3) +(def-art-elt kermit-ag kermit-idle-ja 4) +(def-art-elt kermit-ag kermit-hop-ja 5) +(def-art-elt kermit-ag kermit-longhop-ja 6) +(def-art-elt kermit-ag kermit-lash-ja 7) +(def-art-elt kermit-ag kermit-miss-ja 8) +(def-art-elt kermit-ag kermit-pull-ja 9) +(def-art-elt kermit-ag kermit-turn-ja 10) +(def-art-elt kermit-ag kermit-die-ja 11) + + diff --git a/goal_src/import/kickrock-ag.gc b/goal_src/import/kickrock-ag.gc new file mode 100644 index 0000000000..b0d930566a --- /dev/null +++ b/goal_src/import/kickrock-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; kickrock-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt kickrock-ag kickrock-lod0-jg 0) +(def-art-elt kickrock-ag kickrock-lod0-mg 1) +(def-art-elt kickrock-ag kickrock-idle-ja 2) + + diff --git a/goal_src/import/launcherdoor-ag.gc b/goal_src/import/launcherdoor-ag.gc new file mode 100644 index 0000000000..7aa33defc2 --- /dev/null +++ b/goal_src/import/launcherdoor-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; launcherdoor-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt launcherdoor-ag launcherdoor-geo-jg 0) +(def-art-elt launcherdoor-ag launcherdoor-geo-mg 1) +(def-art-elt launcherdoor-ag launcherdoor-lod1-mg 2) +(def-art-elt launcherdoor-ag launcherdoor-idle-ja 3) + + diff --git a/goal_src/import/launcherdoor-maincave-ag.gc b/goal_src/import/launcherdoor-maincave-ag.gc new file mode 100644 index 0000000000..ca182c73a1 --- /dev/null +++ b/goal_src/import/launcherdoor-maincave-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; launcherdoor-maincave-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt launcherdoor-maincave-ag launcherdoor-maincave-geo-jg 0) +(def-art-elt launcherdoor-maincave-ag launcherdoor-maincave-geo-mg 1) +(def-art-elt launcherdoor-maincave-ag launcherdoor-maincave-lod1-mg 2) +(def-art-elt launcherdoor-maincave-ag launcherdoor-maincave-idle-ja 3) + + diff --git a/goal_src/import/lavaballoon-ag.gc b/goal_src/import/lavaballoon-ag.gc new file mode 100644 index 0000000000..2e3465d184 --- /dev/null +++ b/goal_src/import/lavaballoon-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lavaballoon-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lavaballoon-ag lavaballoon-lod0-jg 0) +(def-art-elt lavaballoon-ag lavaballoon-lod0-mg 1) +(def-art-elt lavaballoon-ag lavaballoon-lod1-mg 2) +(def-art-elt lavaballoon-ag lavaballoon-idle-ja 3) + + diff --git a/goal_src/import/lavabase-ag.gc b/goal_src/import/lavabase-ag.gc new file mode 100644 index 0000000000..bed9ced92a --- /dev/null +++ b/goal_src/import/lavabase-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lavabase-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lavabase-ag lavabase-lod0-jg 0) +(def-art-elt lavabase-ag lavabase-lod0-mg 1) +(def-art-elt lavabase-ag lavabase-idle-ja 2) + + diff --git a/goal_src/import/lavafall-ag.gc b/goal_src/import/lavafall-ag.gc new file mode 100644 index 0000000000..c02c7a1406 --- /dev/null +++ b/goal_src/import/lavafall-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lavafall-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lavafall-ag lavafall-lod0-jg 0) +(def-art-elt lavafall-ag lavafall-lod0-mg 1) +(def-art-elt lavafall-ag lavafall-idle-ja 2) + + diff --git a/goal_src/import/lavafallsewera-ag.gc b/goal_src/import/lavafallsewera-ag.gc new file mode 100644 index 0000000000..3de1a61e17 --- /dev/null +++ b/goal_src/import/lavafallsewera-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lavafallsewera-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lavafallsewera-ag lavafallsewera-lod0-jg 0) +(def-art-elt lavafallsewera-ag lavafallsewera-lod0-mg 1) +(def-art-elt lavafallsewera-ag lavafallsewera-idle-ja 2) + + diff --git a/goal_src/import/lavafallsewerb-ag.gc b/goal_src/import/lavafallsewerb-ag.gc new file mode 100644 index 0000000000..53c7ede518 --- /dev/null +++ b/goal_src/import/lavafallsewerb-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lavafallsewerb-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lavafallsewerb-ag lavafallsewerb-lod0-jg 0) +(def-art-elt lavafallsewerb-ag lavafallsewerb-lod0-mg 1) +(def-art-elt lavafallsewerb-ag lavafallsewerb-idle-ja 2) + + diff --git a/goal_src/import/lavashortcut-ag.gc b/goal_src/import/lavashortcut-ag.gc new file mode 100644 index 0000000000..a06461267e --- /dev/null +++ b/goal_src/import/lavashortcut-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lavashortcut-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lavashortcut-ag lavashortcut-lod0-jg 0) +(def-art-elt lavashortcut-ag lavashortcut-lod0-mg 1) +(def-art-elt lavashortcut-ag lavashortcut-idle-ja 2) + + diff --git a/goal_src/import/lavaspoutdrip-ag.gc b/goal_src/import/lavaspoutdrip-ag.gc new file mode 100644 index 0000000000..d3f4a09a1f --- /dev/null +++ b/goal_src/import/lavaspoutdrip-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lavaspoutdrip-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lavaspoutdrip-ag lavaspoutdrip-lod0-jg 0) +(def-art-elt lavaspoutdrip-ag lavaspoutdrip-lod0-mg 1) +(def-art-elt lavaspoutdrip-ag lavaspoutdrip-idle-ja 2) + + diff --git a/goal_src/import/lavayellowtarp-ag.gc b/goal_src/import/lavayellowtarp-ag.gc new file mode 100644 index 0000000000..7b153c7229 --- /dev/null +++ b/goal_src/import/lavayellowtarp-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lavayellowtarp-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lavayellowtarp-ag lavayellowtarp-lod0-jg 0) +(def-art-elt lavayellowtarp-ag lavayellowtarp-lod0-mg 1) +(def-art-elt lavayellowtarp-ag lavayellowtarp-idle-ja 2) + + diff --git a/goal_src/import/light-eco-ag.gc b/goal_src/import/light-eco-ag.gc new file mode 100644 index 0000000000..ec643d0128 --- /dev/null +++ b/goal_src/import/light-eco-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; light-eco-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt light-eco-ag light-eco-big-lod0-jg 0) +(def-art-elt light-eco-ag light-eco-big-lod0-mg 1) +(def-art-elt light-eco-ag light-eco-big-idle-ja 2) +(def-art-elt light-eco-ag light-eco-small-lod0-jg 3) +(def-art-elt light-eco-ag light-eco-small-lod0-mg 4) +(def-art-elt light-eco-ag light-eco-small-idle-ja 5) + + diff --git a/goal_src/import/lightning-mole-ag.gc b/goal_src/import/lightning-mole-ag.gc new file mode 100644 index 0000000000..cfb8515ac7 --- /dev/null +++ b/goal_src/import/lightning-mole-ag.gc @@ -0,0 +1,22 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lightning-mole-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lightning-mole-ag lightning-mole-lod0-jg 0) +(def-art-elt lightning-mole-ag lightning-mole-lod0-mg 1) +(def-art-elt lightning-mole-ag lightning-mole-lod1-mg 2) +(def-art-elt lightning-mole-ag lightning-mole-lod2-mg 3) +(def-art-elt lightning-mole-ag lightning-mole-shadow-mg 4) +(def-art-elt lightning-mole-ag lightning-mole-idle-ja 5) +(def-art-elt lightning-mole-ag lightning-mole-spots-ja 6) +(def-art-elt lightning-mole-ag lightning-mole-run-ja 7) +(def-art-elt lightning-mole-ag lightning-mole-run-right-ja 8) +(def-art-elt lightning-mole-ag lightning-mole-run-left-ja 9) +(def-art-elt lightning-mole-ag lightning-mole-yelp-ja 10) +(def-art-elt lightning-mole-ag lightning-mole-run-to-idle-ja 11) +(def-art-elt lightning-mole-ag lightning-mole-dive-ja 12) +(def-art-elt lightning-mole-ag lightning-mole-peep-ja 13) + + diff --git a/goal_src/import/logo-ag.gc b/goal_src/import/logo-ag.gc new file mode 100644 index 0000000000..52575b35df --- /dev/null +++ b/goal_src/import/logo-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; logo-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt logo-ag logo-english-lod0-jg 0) +(def-art-elt logo-ag logo-logo-loop-pre-ja 8) +(def-art-elt logo-ag logo-english-lod0-mg 1) +(def-art-elt logo-ag logo-japan-lod0-jg 2) +(def-art-elt logo-ag logo-japan-lod0-mg 3) +(def-art-elt logo-ag logo-idle-ja 4) +(def-art-elt logo-ag logo-logo-intro-2-pre-ja 6) + + diff --git a/goal_src/import/logo-black-ag.gc b/goal_src/import/logo-black-ag.gc new file mode 100644 index 0000000000..ff469681ad --- /dev/null +++ b/goal_src/import/logo-black-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; logo-black-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt logo-black-ag logo-black-lod0-jg 0) +(def-art-elt logo-black-ag logo-black-lod0-mg 1) +(def-art-elt logo-black-ag logo-black-idle-ja 2) + + diff --git a/goal_src/import/logo-cam-ag.gc b/goal_src/import/logo-cam-ag.gc new file mode 100644 index 0000000000..6ecbd25013 --- /dev/null +++ b/goal_src/import/logo-cam-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; logo-cam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt logo-cam-ag logo-cam-lod0-jg 0) +(def-art-elt logo-cam-ag logo-cam-lod0-mg 1) +(def-art-elt logo-cam-ag logo-cam-idle-ja 2) +(def-art-elt logo-cam-ag logo-cam-logo-intro-2-pre-ja 4) +(def-art-elt logo-cam-ag logo-cam-logo-loop-pre-ja 6) + + diff --git a/goal_src/import/logo-volumes-ag.gc b/goal_src/import/logo-volumes-ag.gc new file mode 100644 index 0000000000..046e4b25e1 --- /dev/null +++ b/goal_src/import/logo-volumes-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; logo-volumes-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt logo-volumes-ag logo-volumes-english-lod0-jg 0) +(def-art-elt logo-volumes-ag logo-volumes-english-lod0-mg 1) +(def-art-elt logo-volumes-ag logo-volumes-japan-lod0-jg 2) +(def-art-elt logo-volumes-ag logo-volumes-japan-lod0-mg 3) +(def-art-elt logo-volumes-ag logo-volumes-idle-ja 4) + + diff --git a/goal_src/import/logtrap-ag.gc b/goal_src/import/logtrap-ag.gc new file mode 100644 index 0000000000..a7476e6f7a --- /dev/null +++ b/goal_src/import/logtrap-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; logtrap-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt logtrap-ag logtrap-lod0-jg 0) +(def-art-elt logtrap-ag logtrap-lod0-mg 1) +(def-art-elt logtrap-ag logtrap-lod1-mg 2) +(def-art-elt logtrap-ag logtrap-shadow-mg 3) +(def-art-elt logtrap-ag logtrap-idle-ja 4) + + diff --git a/goal_src/import/lrocklrg-ag.gc b/goal_src/import/lrocklrg-ag.gc new file mode 100644 index 0000000000..1a676d4ea0 --- /dev/null +++ b/goal_src/import/lrocklrg-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lrocklrg-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lrocklrg-ag lrocklrg-lod0-jg 0) +(def-art-elt lrocklrg-ag lrocklrg-lod0-mg 1) +(def-art-elt lrocklrg-ag lrocklrg-idle-ja 2) +(def-art-elt lrocklrg-ag lrocklrg-fallen-ja 3) + + diff --git a/goal_src/import/lurkercrab-ag.gc b/goal_src/import/lurkercrab-ag.gc new file mode 100644 index 0000000000..8be7f662f8 --- /dev/null +++ b/goal_src/import/lurkercrab-ag.gc @@ -0,0 +1,20 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lurkercrab-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lurkercrab-ag lurkercrab-lod0-jg 0) +(def-art-elt lurkercrab-ag lurkercrab-lod0-mg 1) +(def-art-elt lurkercrab-ag lurkercrab-lod1-mg 2) +(def-art-elt lurkercrab-ag lurkercrab-lod2-mg 3) +(def-art-elt lurkercrab-ag lurkercrab-idle-ja 4) +(def-art-elt lurkercrab-ag lurkercrab-idle-to-walk-ja 5) +(def-art-elt lurkercrab-ag lurkercrab-walk-ja 6) +(def-art-elt lurkercrab-ag lurkercrab-peek-ja 7) +(def-art-elt lurkercrab-ag lurkercrab-peek-to-walk-ja 8) +(def-art-elt lurkercrab-ag lurkercrab-snip-ja 9) +(def-art-elt lurkercrab-ag lurkercrab-kickback-ja 10) +(def-art-elt lurkercrab-ag lurkercrab-die-ja 11) + + diff --git a/goal_src/import/lurkerm-piston-ag.gc b/goal_src/import/lurkerm-piston-ag.gc new file mode 100644 index 0000000000..66cbcdba4c --- /dev/null +++ b/goal_src/import/lurkerm-piston-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lurkerm-piston-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lurkerm-piston-ag lurkerm-piston-geo-jg 0) +(def-art-elt lurkerm-piston-ag lurkerm-piston-geo-mg 1) +(def-art-elt lurkerm-piston-ag lurkerm-piston-idle-ja 2) + + diff --git a/goal_src/import/lurkerm-tall-sail-ag.gc b/goal_src/import/lurkerm-tall-sail-ag.gc new file mode 100644 index 0000000000..b3e16248ab --- /dev/null +++ b/goal_src/import/lurkerm-tall-sail-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lurkerm-tall-sail-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lurkerm-tall-sail-ag lurkerm-tall-sail-lod0-jg 0) +(def-art-elt lurkerm-tall-sail-ag lurkerm-tall-sail-lod0-mg 1) +(def-art-elt lurkerm-tall-sail-ag lurkerm-tall-sail-lod1-mg 2) +(def-art-elt lurkerm-tall-sail-ag lurkerm-tall-sail-lod2-mg 3) +(def-art-elt lurkerm-tall-sail-ag lurkerm-tall-sail-idle-ja 4) + + diff --git a/goal_src/import/lurkerpuppy-ag.gc b/goal_src/import/lurkerpuppy-ag.gc new file mode 100644 index 0000000000..66cbec472b --- /dev/null +++ b/goal_src/import/lurkerpuppy-ag.gc @@ -0,0 +1,20 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lurkerpuppy-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lurkerpuppy-ag lurkerpuppy-lod0-jg 0) +(def-art-elt lurkerpuppy-ag lurkerpuppy-lod0-mg 1) +(def-art-elt lurkerpuppy-ag lurkerpuppy-lod1-mg 2) +(def-art-elt lurkerpuppy-ag lurkerpuppy-lod2-mg 3) +(def-art-elt lurkerpuppy-ag lurkerpuppy-shadow-mg 4) +(def-art-elt lurkerpuppy-ag lurkerpuppy-idle-ja 5) +(def-art-elt lurkerpuppy-ag lurkerpuppy-walk-ja 6) +(def-art-elt lurkerpuppy-ag lurkerpuppy-run-ja 7) +(def-art-elt lurkerpuppy-ag lurkerpuppy-celebrate-ja 8) +(def-art-elt lurkerpuppy-ag lurkerpuppy-jump-ja 9) +(def-art-elt lurkerpuppy-ag lurkerpuppy-jump-land-ja 10) +(def-art-elt lurkerpuppy-ag lurkerpuppy-die-ja 11) + + diff --git a/goal_src/import/lurkerworm-ag.gc b/goal_src/import/lurkerworm-ag.gc new file mode 100644 index 0000000000..9b3b958e98 --- /dev/null +++ b/goal_src/import/lurkerworm-ag.gc @@ -0,0 +1,16 @@ +;;-*-Lisp-*- +(in-package goal) + +;; lurkerworm-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt lurkerworm-ag lurkerworm-lod0-jg 0) +(def-art-elt lurkerworm-ag lurkerworm-lod0-mg 1) +(def-art-elt lurkerworm-ag lurkerworm-lod1-mg 2) +(def-art-elt lurkerworm-ag lurkerworm-idle-ja 3) +(def-art-elt lurkerworm-ag lurkerworm-rise-ja 4) +(def-art-elt lurkerworm-ag lurkerworm-sink-ja 5) +(def-art-elt lurkerworm-ag lurkerworm-chomp-ja 6) +(def-art-elt lurkerworm-ag lurkerworm-die-ja 7) + + diff --git a/goal_src/import/maincavecam-ag.gc b/goal_src/import/maincavecam-ag.gc new file mode 100644 index 0000000000..3c70feedcd --- /dev/null +++ b/goal_src/import/maincavecam-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; maincavecam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt maincavecam-ag maincavecam-lod0-jg 0) +(def-art-elt maincavecam-ag maincavecam-lod0-mg 1) +(def-art-elt maincavecam-ag maincavecam-dummy-ja 2) + + diff --git a/goal_src/import/maindoor-ag.gc b/goal_src/import/maindoor-ag.gc new file mode 100644 index 0000000000..83d90afa2a --- /dev/null +++ b/goal_src/import/maindoor-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; maindoor-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt maindoor-ag maindoor-lod0-jg 0) +(def-art-elt maindoor-ag maindoor-lod0-mg 1) +(def-art-elt maindoor-ag maindoor-lod1-mg 2) +(def-art-elt maindoor-ag maindoor-idle-ja 3) + + diff --git a/goal_src/import/mayor-ag.gc b/goal_src/import/mayor-ag.gc new file mode 100644 index 0000000000..429eadb66b --- /dev/null +++ b/goal_src/import/mayor-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; mayor-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt mayor-ag mayor-lod0-jg 0) +(def-art-elt mayor-ag mayor-lod0-mg 1) +(def-art-elt mayor-ag mayor-shadow-mg 2) +(def-art-elt mayor-ag mayor-idle-ja 3) + + diff --git a/goal_src/import/mayorgears-ag.gc b/goal_src/import/mayorgears-ag.gc new file mode 100644 index 0000000000..c9ee21c264 --- /dev/null +++ b/goal_src/import/mayorgears-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; mayorgears-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt mayorgears-ag mayorgears-geo-jg 0) +(def-art-elt mayorgears-ag mayorgears-geo-mg 1) +(def-art-elt mayorgears-ag mayorgears-idle-ja 2) + + diff --git a/goal_src/import/medres-beach-ag.gc b/goal_src/import/medres-beach-ag.gc new file mode 100644 index 0000000000..8e146753da --- /dev/null +++ b/goal_src/import/medres-beach-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-beach-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-beach-ag medres-beach-lod0-jg 0) +(def-art-elt medres-beach-ag medres-beach-lod0-mg 1) +(def-art-elt medres-beach-ag medres-beach-idle-ja 2) + + diff --git a/goal_src/import/medres-beach1-ag.gc b/goal_src/import/medres-beach1-ag.gc new file mode 100644 index 0000000000..db5810a2b7 --- /dev/null +++ b/goal_src/import/medres-beach1-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-beach1-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-beach1-ag medres-beach1-lod0-jg 0) +(def-art-elt medres-beach1-ag medres-beach1-lod0-mg 1) +(def-art-elt medres-beach1-ag medres-beach1-idle-ja 2) + + diff --git a/goal_src/import/medres-beach2-ag.gc b/goal_src/import/medres-beach2-ag.gc new file mode 100644 index 0000000000..ea2c3a3c82 --- /dev/null +++ b/goal_src/import/medres-beach2-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-beach2-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-beach2-ag medres-beach2-lod0-jg 0) +(def-art-elt medres-beach2-ag medres-beach2-lod0-mg 1) +(def-art-elt medres-beach2-ag medres-beach2-idle-ja 2) + + diff --git a/goal_src/import/medres-beach3-ag.gc b/goal_src/import/medres-beach3-ag.gc new file mode 100644 index 0000000000..762ad91baf --- /dev/null +++ b/goal_src/import/medres-beach3-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-beach3-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-beach3-ag medres-beach3-lod0-jg 0) +(def-art-elt medres-beach3-ag medres-beach3-lod0-mg 1) +(def-art-elt medres-beach3-ag medres-beach3-idle-ja 2) + + diff --git a/goal_src/import/medres-finalboss-ag.gc b/goal_src/import/medres-finalboss-ag.gc new file mode 100644 index 0000000000..706f234adb --- /dev/null +++ b/goal_src/import/medres-finalboss-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-finalboss-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-finalboss-ag medres-finalboss-lod0-jg 0) +(def-art-elt medres-finalboss-ag medres-finalboss-lod0-mg 1) +(def-art-elt medres-finalboss-ag medres-finalboss-idle-ja 2) + + diff --git a/goal_src/import/medres-firecanyon-ag.gc b/goal_src/import/medres-firecanyon-ag.gc new file mode 100644 index 0000000000..8a5c60fccc --- /dev/null +++ b/goal_src/import/medres-firecanyon-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-firecanyon-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-firecanyon-ag medres-firecanyon-lod0-jg 0) +(def-art-elt medres-firecanyon-ag medres-firecanyon-lod0-mg 1) +(def-art-elt medres-firecanyon-ag medres-firecanyon-idle-ja 2) + + diff --git a/goal_src/import/medres-jungle-ag.gc b/goal_src/import/medres-jungle-ag.gc new file mode 100644 index 0000000000..f431c8e117 --- /dev/null +++ b/goal_src/import/medres-jungle-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-jungle-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-jungle-ag medres-jungle-lod0-jg 0) +(def-art-elt medres-jungle-ag medres-jungle-lod0-mg 1) +(def-art-elt medres-jungle-ag medres-jungle-idle-ja 2) + + diff --git a/goal_src/import/medres-jungle1-ag.gc b/goal_src/import/medres-jungle1-ag.gc new file mode 100644 index 0000000000..4726bf8d56 --- /dev/null +++ b/goal_src/import/medres-jungle1-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-jungle1-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-jungle1-ag medres-jungle1-lod0-jg 0) +(def-art-elt medres-jungle1-ag medres-jungle1-lod0-mg 1) +(def-art-elt medres-jungle1-ag medres-jungle1-idle-ja 2) + + diff --git a/goal_src/import/medres-jungle2-ag.gc b/goal_src/import/medres-jungle2-ag.gc new file mode 100644 index 0000000000..2989aaee07 --- /dev/null +++ b/goal_src/import/medres-jungle2-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-jungle2-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-jungle2-ag medres-jungle2-lod0-jg 0) +(def-art-elt medres-jungle2-ag medres-jungle2-lod0-mg 1) +(def-art-elt medres-jungle2-ag medres-jungle2-idle-ja 2) + + diff --git a/goal_src/import/medres-misty-ag.gc b/goal_src/import/medres-misty-ag.gc new file mode 100644 index 0000000000..be8e20ef64 --- /dev/null +++ b/goal_src/import/medres-misty-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-misty-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-misty-ag medres-misty-lod0-jg 0) +(def-art-elt medres-misty-ag medres-misty-lod0-mg 1) +(def-art-elt medres-misty-ag medres-misty-idle-ja 2) + + diff --git a/goal_src/import/medres-ogre-ag.gc b/goal_src/import/medres-ogre-ag.gc new file mode 100644 index 0000000000..91e3ad5918 --- /dev/null +++ b/goal_src/import/medres-ogre-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-ogre-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-ogre-ag medres-ogre-lod0-jg 0) +(def-art-elt medres-ogre-ag medres-ogre-lod0-mg 1) +(def-art-elt medres-ogre-ag medres-ogre-idle-ja 2) + + diff --git a/goal_src/import/medres-ogre2-ag.gc b/goal_src/import/medres-ogre2-ag.gc new file mode 100644 index 0000000000..c666d6852d --- /dev/null +++ b/goal_src/import/medres-ogre2-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-ogre2-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-ogre2-ag medres-ogre2-lod0-jg 0) +(def-art-elt medres-ogre2-ag medres-ogre2-lod0-mg 1) +(def-art-elt medres-ogre2-ag medres-ogre2-idle-ja 2) + + diff --git a/goal_src/import/medres-ogre3-ag.gc b/goal_src/import/medres-ogre3-ag.gc new file mode 100644 index 0000000000..78b27c2a7f --- /dev/null +++ b/goal_src/import/medres-ogre3-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-ogre3-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-ogre3-ag medres-ogre3-lod0-jg 0) +(def-art-elt medres-ogre3-ag medres-ogre3-lod0-mg 1) +(def-art-elt medres-ogre3-ag medres-ogre3-idle-ja 2) + + diff --git a/goal_src/import/medres-rolling-ag.gc b/goal_src/import/medres-rolling-ag.gc new file mode 100644 index 0000000000..1627bc0f1d --- /dev/null +++ b/goal_src/import/medres-rolling-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-rolling-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-rolling-ag medres-rolling-lod0-jg 0) +(def-art-elt medres-rolling-ag medres-rolling-lod0-mg 1) +(def-art-elt medres-rolling-ag medres-rolling-idle-ja 2) + + diff --git a/goal_src/import/medres-rolling1-ag.gc b/goal_src/import/medres-rolling1-ag.gc new file mode 100644 index 0000000000..19f95f3135 --- /dev/null +++ b/goal_src/import/medres-rolling1-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-rolling1-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-rolling1-ag medres-rolling1-lod0-jg 0) +(def-art-elt medres-rolling1-ag medres-rolling1-lod0-mg 1) +(def-art-elt medres-rolling1-ag medres-rolling1-idle-ja 2) + + diff --git a/goal_src/import/medres-snow-ag.gc b/goal_src/import/medres-snow-ag.gc new file mode 100644 index 0000000000..96c115e6ae --- /dev/null +++ b/goal_src/import/medres-snow-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-snow-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-snow-ag medres-snow-lod0-jg 0) +(def-art-elt medres-snow-ag medres-snow-lod0-mg 1) +(def-art-elt medres-snow-ag medres-snow-idle-ja 2) + + diff --git a/goal_src/import/medres-training-ag.gc b/goal_src/import/medres-training-ag.gc new file mode 100644 index 0000000000..7141e66a79 --- /dev/null +++ b/goal_src/import/medres-training-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-training-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-training-ag medres-training-lod0-jg 0) +(def-art-elt medres-training-ag medres-training-lod0-mg 1) +(def-art-elt medres-training-ag medres-training-idle-ja 2) + + diff --git a/goal_src/import/medres-village11-ag.gc b/goal_src/import/medres-village11-ag.gc new file mode 100644 index 0000000000..7beae277dc --- /dev/null +++ b/goal_src/import/medres-village11-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-village11-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-village11-ag medres-village11-lod0-jg 0) +(def-art-elt medres-village11-ag medres-village11-lod0-mg 1) +(def-art-elt medres-village11-ag medres-village11-idle-ja 2) + + diff --git a/goal_src/import/medres-village12-ag.gc b/goal_src/import/medres-village12-ag.gc new file mode 100644 index 0000000000..f58ab4c022 --- /dev/null +++ b/goal_src/import/medres-village12-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-village12-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-village12-ag medres-village12-lod0-jg 0) +(def-art-elt medres-village12-ag medres-village12-lod0-mg 1) +(def-art-elt medres-village12-ag medres-village12-idle-ja 2) + + diff --git a/goal_src/import/medres-village13-ag.gc b/goal_src/import/medres-village13-ag.gc new file mode 100644 index 0000000000..4a538e900a --- /dev/null +++ b/goal_src/import/medres-village13-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-village13-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-village13-ag medres-village13-lod0-jg 0) +(def-art-elt medres-village13-ag medres-village13-lod0-mg 1) +(def-art-elt medres-village13-ag medres-village13-idle-ja 2) + + diff --git a/goal_src/import/medres-village2-ag.gc b/goal_src/import/medres-village2-ag.gc new file mode 100644 index 0000000000..9eba39af75 --- /dev/null +++ b/goal_src/import/medres-village2-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; medres-village2-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt medres-village2-ag medres-village2-lod0-jg 0) +(def-art-elt medres-village2-ag medres-village2-lod0-mg 1) +(def-art-elt medres-village2-ag medres-village2-idle-ja 2) + + diff --git a/goal_src/import/minecartsteel-ag.gc b/goal_src/import/minecartsteel-ag.gc new file mode 100644 index 0000000000..7901c4e7ef --- /dev/null +++ b/goal_src/import/minecartsteel-ag.gc @@ -0,0 +1,16 @@ +;;-*-Lisp-*- +(in-package goal) + +;; minecartsteel-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt minecartsteel-ag minecartsteel-lod0-jg 0) +(def-art-elt minecartsteel-ag minecartsteel-lod0-mg 1) +(def-art-elt minecartsteel-ag minecartsteel-lod1-mg 2) +(def-art-elt minecartsteel-ag minecartsteel-lod2-mg 3) +(def-art-elt minecartsteel-ag minecartsteel-idle-ja 4) +(def-art-elt minecartsteel-ag minecartsteel-rail0-ja 5) +(def-art-elt minecartsteel-ag minecartsteel-rail1-ja 6) +(def-art-elt minecartsteel-ag minecartsteel-rail2-ja 7) + + diff --git a/goal_src/import/minershort-ag.gc b/goal_src/import/minershort-ag.gc new file mode 100644 index 0000000000..0571b7a145 --- /dev/null +++ b/goal_src/import/minershort-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; minershort-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt minershort-ag minershort-lod0-jg 0) +(def-art-elt minershort-ag minershort-lod0-mg 1) +(def-art-elt minershort-ag minershort-shadow-mg 2) +(def-art-elt minershort-ag minershort-idle-ja 3) + + diff --git a/goal_src/import/minertall-ag.gc b/goal_src/import/minertall-ag.gc new file mode 100644 index 0000000000..94cd466831 --- /dev/null +++ b/goal_src/import/minertall-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; minertall-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt minertall-ag minertall-lod0-jg 0) +(def-art-elt minertall-ag minertall-lod0-mg 1) +(def-art-elt minertall-ag minertall-shadow-mg 2) +(def-art-elt minertall-ag minertall-idle-ja 3) + + diff --git a/goal_src/import/mis-bone-bridge-ag.gc b/goal_src/import/mis-bone-bridge-ag.gc new file mode 100644 index 0000000000..73281787cb --- /dev/null +++ b/goal_src/import/mis-bone-bridge-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; mis-bone-bridge-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt mis-bone-bridge-ag mis-bone-bridge-lod0-jg 0) +(def-art-elt mis-bone-bridge-ag mis-bone-bridge-lod0-mg 1) +(def-art-elt mis-bone-bridge-ag mis-bone-bridge-idle-ja 2) +(def-art-elt mis-bone-bridge-ag mis-bone-bridge-idle2-ja 3) +(def-art-elt mis-bone-bridge-ag mis-bone-bridge-idle7-ja 4) +(def-art-elt mis-bone-bridge-ag mis-bone-bridge-kicked-ja 5) +(def-art-elt mis-bone-bridge-ag mis-bone-bridge-bumped-ja 6) + + diff --git a/goal_src/import/mis-bone-platform-ag.gc b/goal_src/import/mis-bone-platform-ag.gc new file mode 100644 index 0000000000..3f33ba3077 --- /dev/null +++ b/goal_src/import/mis-bone-platform-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; mis-bone-platform-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt mis-bone-platform-ag mis-bone-platform-lod0-jg 0) +(def-art-elt mis-bone-platform-ag mis-bone-platform-lod0-mg 1) +(def-art-elt mis-bone-platform-ag mis-bone-platform-idle-ja 2) + + diff --git a/goal_src/import/mistycam-ag.gc b/goal_src/import/mistycam-ag.gc new file mode 100644 index 0000000000..1c07410dbb --- /dev/null +++ b/goal_src/import/mistycam-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; mistycam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt mistycam-ag mistycam-lod0-jg 0) +(def-art-elt mistycam-ag mistycam-lod0-mg 1) +(def-art-elt mistycam-ag mistycam-anim-ja 2) +(def-art-elt mistycam-ag mistycam-lurkerattack-ja 3) +(def-art-elt mistycam-ag mistycam-balloon-fuel-cell-ja 4) +(def-art-elt mistycam-ag mistycam-cannon-fuel-cell-ja 6) + + diff --git a/goal_src/import/mistycannon-ag.gc b/goal_src/import/mistycannon-ag.gc new file mode 100644 index 0000000000..4c8d7176f5 --- /dev/null +++ b/goal_src/import/mistycannon-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; mistycannon-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt mistycannon-ag mistycannon-lod0-jg 0) +(def-art-elt mistycannon-ag mistycannon-lod0-mg 1) +(def-art-elt mistycannon-ag mistycannon-lod1-mg 2) +(def-art-elt mistycannon-ag mistycannon-idle-ja 3) + + diff --git a/goal_src/import/money-ag.gc b/goal_src/import/money-ag.gc new file mode 100644 index 0000000000..5b390ed1f8 --- /dev/null +++ b/goal_src/import/money-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; money-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt money-ag money-lod0-jg 0) +(def-art-elt money-ag money-lod0-mg 1) +(def-art-elt money-ag money-lod1-mg 2) +(def-art-elt money-ag money-lod2-mg 3) +(def-art-elt money-ag money-idle-ja 4) + + diff --git a/goal_src/import/mother-spider-ag.gc b/goal_src/import/mother-spider-ag.gc new file mode 100644 index 0000000000..4c9f512f94 --- /dev/null +++ b/goal_src/import/mother-spider-ag.gc @@ -0,0 +1,25 @@ +;;-*-Lisp-*- +(in-package goal) + +;; mother-spider-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt mother-spider-ag mother-spider-lod0-jg 0) +(def-art-elt mother-spider-ag mother-spider-lod0-mg 1) +(def-art-elt mother-spider-ag mother-spider-lod1-mg 2) +(def-art-elt mother-spider-ag mother-spider-lod2-mg 3) +(def-art-elt mother-spider-ag mother-spider-shadow-mg 4) +(def-art-elt mother-spider-ag mother-spider-idle-ja 5) +(def-art-elt mother-spider-ag mother-spider-birth-ja 6) +(def-art-elt mother-spider-ag mother-spider-lowering-ja 7) +(def-art-elt mother-spider-ag mother-spider-stopped-lowering-ja 8) +(def-art-elt mother-spider-ag mother-spider-takes-hit-ja 9) +(def-art-elt mother-spider-ag mother-spider-spit-ja 10) +(def-art-elt mother-spider-ag mother-spider-die-ja 11) +(def-art-elt mother-spider-ag mother-spider-die-from-uppercut-ja 12) +(def-art-elt mother-spider-ag mother-spider-leg-lod0-jg 13) +(def-art-elt mother-spider-ag mother-spider-leg-lod0-mg 14) +(def-art-elt mother-spider-ag mother-spider-leg-twitching-ja 15) +(def-art-elt mother-spider-ag mother-spider-leg-die-ja 16) + + diff --git a/goal_src/import/muse-ag.gc b/goal_src/import/muse-ag.gc new file mode 100644 index 0000000000..14e4da3d1b --- /dev/null +++ b/goal_src/import/muse-ag.gc @@ -0,0 +1,17 @@ +;;-*-Lisp-*- +(in-package goal) + +;; muse-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt muse-ag muse-lod0-jg 0) +(def-art-elt muse-ag muse-lod0-mg 1) +(def-art-elt muse-ag muse-shadow-mg 2) +(def-art-elt muse-ag muse-idle-ja 3) +(def-art-elt muse-ag muse-run-ja 4) +(def-art-elt muse-ag muse-idle-to-run-ja 5) +(def-art-elt muse-ag muse-run-to-idle-ja 6) +(def-art-elt muse-ag muse-jump-ja 7) +(def-art-elt muse-ag muse-jump-land-ja 8) + + diff --git a/goal_src/import/ndi-ag.gc b/goal_src/import/ndi-ag.gc new file mode 100644 index 0000000000..5b6935be69 --- /dev/null +++ b/goal_src/import/ndi-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ndi-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ndi-ag ndi-lod0-jg 0) +(def-art-elt ndi-ag ndi-lod0-mg 1) +(def-art-elt ndi-ag ndi-idle-ja 2) + + diff --git a/goal_src/import/ndi-cam-ag.gc b/goal_src/import/ndi-cam-ag.gc new file mode 100644 index 0000000000..3c4a15654a --- /dev/null +++ b/goal_src/import/ndi-cam-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ndi-cam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ndi-cam-ag ndi-cam-lod0-jg 0) +(def-art-elt ndi-cam-ag ndi-cam-lod0-mg 1) +(def-art-elt ndi-cam-ag ndi-cam-idle-ja 2) + + diff --git a/goal_src/import/ndi-volumes-ag.gc b/goal_src/import/ndi-volumes-ag.gc new file mode 100644 index 0000000000..14e6ef3068 --- /dev/null +++ b/goal_src/import/ndi-volumes-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ndi-volumes-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ndi-volumes-ag ndi-volumes-lod0-jg 0) +(def-art-elt ndi-volumes-ag ndi-volumes-lod0-mg 1) +(def-art-elt ndi-volumes-ag ndi-volumes-idle-ja 2) + + diff --git a/goal_src/import/ogre-bridge-ag.gc b/goal_src/import/ogre-bridge-ag.gc new file mode 100644 index 0000000000..b85d7f7e67 --- /dev/null +++ b/goal_src/import/ogre-bridge-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ogre-bridge-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ogre-bridge-ag ogre-bridge-lod0-jg 0) +(def-art-elt ogre-bridge-ag ogre-bridge-lod0-mg 1) +(def-art-elt ogre-bridge-ag ogre-bridge-idle-ja 2) +(def-art-elt ogre-bridge-ag ogre-bridge-assemble-ja 3) +(def-art-elt ogre-bridge-ag ogre-bridge-break-ja 4) + + diff --git a/goal_src/import/ogre-bridgeend-ag.gc b/goal_src/import/ogre-bridgeend-ag.gc new file mode 100644 index 0000000000..68c440ee18 --- /dev/null +++ b/goal_src/import/ogre-bridgeend-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ogre-bridgeend-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ogre-bridgeend-ag ogre-bridgeend-lod0-jg 0) +(def-art-elt ogre-bridgeend-ag ogre-bridgeend-lod0-mg 1) +(def-art-elt ogre-bridgeend-ag ogre-bridgeend-idle-ja 2) + + diff --git a/goal_src/import/ogre-isle-ag.gc b/goal_src/import/ogre-isle-ag.gc new file mode 100644 index 0000000000..b7dca081bb --- /dev/null +++ b/goal_src/import/ogre-isle-ag.gc @@ -0,0 +1,20 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ogre-isle-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ogre-isle-ag ogre-isle-a-lod0-jg 0) +(def-art-elt ogre-isle-ag ogre-isle-a-lod0-mg 1) +(def-art-elt ogre-isle-ag ogre-isle-a-idle-ja 2) +(def-art-elt ogre-isle-ag ogre-isle-b-lod0-jg 3) +(def-art-elt ogre-isle-ag ogre-isle-b-lod0-mg 4) +(def-art-elt ogre-isle-ag ogre-isle-b-idle-ja 5) +(def-art-elt ogre-isle-ag ogre-isle-c-lod0-jg 6) +(def-art-elt ogre-isle-ag ogre-isle-c-lod0-mg 7) +(def-art-elt ogre-isle-ag ogre-isle-c-idle-ja 8) +(def-art-elt ogre-isle-ag ogre-isle-d-lod0-jg 9) +(def-art-elt ogre-isle-ag ogre-isle-d-lod0-mg 10) +(def-art-elt ogre-isle-ag ogre-isle-d-idle-ja 11) + + diff --git a/goal_src/import/ogre-step-ag.gc b/goal_src/import/ogre-step-ag.gc new file mode 100644 index 0000000000..47bb549fbf --- /dev/null +++ b/goal_src/import/ogre-step-ag.gc @@ -0,0 +1,20 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ogre-step-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ogre-step-ag ogre-step-a-lod0-jg 0) +(def-art-elt ogre-step-ag ogre-step-a-lod0-mg 1) +(def-art-elt ogre-step-ag ogre-step-a-idle-ja 2) +(def-art-elt ogre-step-ag ogre-step-b-lod0-jg 3) +(def-art-elt ogre-step-ag ogre-step-b-lod0-mg 4) +(def-art-elt ogre-step-ag ogre-step-b-idle-ja 5) +(def-art-elt ogre-step-ag ogre-step-c-lod0-jg 6) +(def-art-elt ogre-step-ag ogre-step-c-lod0-mg 7) +(def-art-elt ogre-step-ag ogre-step-c-idle-ja 8) +(def-art-elt ogre-step-ag ogre-step-d-lod0-jg 9) +(def-art-elt ogre-step-ag ogre-step-d-lod0-mg 10) +(def-art-elt ogre-step-ag ogre-step-d-idle-ja 11) + + diff --git a/goal_src/import/ogreboss-ag.gc b/goal_src/import/ogreboss-ag.gc new file mode 100644 index 0000000000..bfba0a71b7 --- /dev/null +++ b/goal_src/import/ogreboss-ag.gc @@ -0,0 +1,57 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ogreboss-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ogreboss-ag ogreboss-lod0-jg 0) +(def-art-elt ogreboss-ag ogreboss-lod0-mg 1) +(def-art-elt ogreboss-ag ogreboss-idle-ja 2) +(def-art-elt ogreboss-ag ogreboss-idle-bored-ja 3) +(def-art-elt ogreboss-ag ogreboss-idle-alt-ja 4) +(def-art-elt ogreboss-ag ogreboss-roar-ja 5) +(def-art-elt ogreboss-ag ogreboss-attack2-start-ja 6) +(def-art-elt ogreboss-ag ogreboss-attack2-loop-ja 7) +(def-art-elt ogreboss-ag ogreboss-attack2-last-ja 8) +(def-art-elt ogreboss-ag ogreboss-attack3-throw-ja 9) +(def-art-elt ogreboss-ag ogreboss-hit-chest-ja 10) +(def-art-elt ogreboss-ag ogreboss-hit-crotch-ja 11) +(def-art-elt ogreboss-ag ogreboss-hit-ja 12) +(def-art-elt ogreboss-ag ogreboss-dive-ja 13) +(def-art-elt ogreboss-ag ogreboss-rise-ja 14) +(def-art-elt ogreboss-ag ogreboss-recover-ja 15) +(def-art-elt ogreboss-ag ogreboss-victory-ja 16) +(def-art-elt ogreboss-ag ogreboss-shuffle-prepare-ja 17) +(def-art-elt ogreboss-ag ogreboss-shuffle-right-start-ja 18) +(def-art-elt ogreboss-ag ogreboss-shuffle-right-loop-ja 19) +(def-art-elt ogreboss-ag ogreboss-shuffle-right-stop-ja 20) +(def-art-elt ogreboss-ag ogreboss-shuffle-left-start-ja 21) +(def-art-elt ogreboss-ag ogreboss-shuffle-left-loop-ja 22) +(def-art-elt ogreboss-ag ogreboss-shuffle-left-stop-ja 23) +(def-art-elt ogreboss-ag ogreboss-intro-ja 24) +(def-art-elt ogreboss-ag ogreboss-cam-lod0-jg 25) +(def-art-elt ogreboss-ag ogreboss-cam-lod0-mg 26) +(def-art-elt ogreboss-ag ogreboss-cam-idle-ja 27) +(def-art-elt ogreboss-ag ogreboss-cam-intro-ja 28) +(def-art-elt ogreboss-ag ogreboss-shoot-boulder-lod0-jg 29) +(def-art-elt ogreboss-ag ogreboss-shoot-boulder-lod0-mg 30) +(def-art-elt ogreboss-ag ogreboss-shoot-boulder-shadow-mg 31) +(def-art-elt ogreboss-ag ogreboss-shoot-boulder-idle-ja 32) +(def-art-elt ogreboss-ag ogreboss-shoot-boulder-break-lod0-jg 33) +(def-art-elt ogreboss-ag ogreboss-shoot-boulder-break-lod0-mg 34) +(def-art-elt ogreboss-ag ogreboss-shoot-boulder-break-idle-ja 35) +(def-art-elt ogreboss-ag ogreboss-bounce-boulder-lod0-jg 36) +(def-art-elt ogreboss-ag ogreboss-bounce-boulder-lod0-mg 37) +(def-art-elt ogreboss-ag ogreboss-bounce-boulder-idle-ja 38) +(def-art-elt ogreboss-ag ogreboss-super-boulder-lod0-jg 39) +(def-art-elt ogreboss-ag ogreboss-super-boulder-lod0-mg 40) +(def-art-elt ogreboss-ag ogreboss-super-boulder-idle-ja 41) +(def-art-elt ogreboss-ag ogreboss-super-boulder-throw-ja 42) +(def-art-elt ogreboss-ag ogreboss-super-boulder-hit-ja 43) +(def-art-elt ogreboss-ag ogreboss-super-boulder-roll-ja 44) +(def-art-elt ogreboss-ag ogreboss-column-lod0-jg 45) +(def-art-elt ogreboss-ag ogreboss-column-lod0-mg 46) +(def-art-elt ogreboss-ag ogreboss-column-idle-ja 47) +(def-art-elt ogreboss-ag ogreboss-column-intro-ja 48) + + diff --git a/goal_src/import/ogreboss-village2-ag.gc b/goal_src/import/ogreboss-village2-ag.gc new file mode 100644 index 0000000000..b013381fb3 --- /dev/null +++ b/goal_src/import/ogreboss-village2-ag.gc @@ -0,0 +1,16 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ogreboss-village2-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ogreboss-village2-ag ogreboss-village2-lod0-jg 0) +(def-art-elt ogreboss-village2-ag ogreboss-village2-lod0-mg 1) +(def-art-elt ogreboss-village2-ag ogreboss-village2-idle-ja 2) +(def-art-elt ogreboss-village2-ag ogreboss-village2-idle-bored-ja 3) +(def-art-elt ogreboss-village2-ag ogreboss-village2-idle-alt-ja 4) +(def-art-elt ogreboss-village2-ag ogreboss-village2-throw-ja 5) +(def-art-elt ogreboss-village2-ag ogreboss-village2-victory-ja 6) +(def-art-elt ogreboss-village2-ag ogreboss-village2-pre-throw-ja 7) + + diff --git a/goal_src/import/ogrecam-ag.gc b/goal_src/import/ogrecam-ag.gc new file mode 100644 index 0000000000..42465d41e0 --- /dev/null +++ b/goal_src/import/ogrecam-ag.gc @@ -0,0 +1,10 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ogrecam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ogrecam-ag ogrecam-lod0-jg 0) +(def-art-elt ogrecam-ag ogrecam-lod0-mg 1) + + diff --git a/goal_src/import/oracle-ag.gc b/goal_src/import/oracle-ag.gc new file mode 100644 index 0000000000..0da86acae9 --- /dev/null +++ b/goal_src/import/oracle-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; oracle-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt oracle-ag oracle-lod0-jg 0) +(def-art-elt oracle-ag oracle-lod0-mg 1) +(def-art-elt oracle-ag oracle-idle-ja 2) + + diff --git a/goal_src/import/orb-cache-top-ag.gc b/goal_src/import/orb-cache-top-ag.gc new file mode 100644 index 0000000000..225c43e023 --- /dev/null +++ b/goal_src/import/orb-cache-top-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; orb-cache-top-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt orb-cache-top-ag orb-cache-top-lod0-jg 0) +(def-art-elt orb-cache-top-ag orb-cache-top-lod0-mg 1) +(def-art-elt orb-cache-top-ag orb-cache-top-lod1-mg 2) +(def-art-elt orb-cache-top-ag orb-cache-top-idle-ja 3) + + diff --git a/goal_src/import/orbit-plat-ag.gc b/goal_src/import/orbit-plat-ag.gc new file mode 100644 index 0000000000..fb458afab8 --- /dev/null +++ b/goal_src/import/orbit-plat-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; orbit-plat-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt orbit-plat-ag orbit-plat-lod0-jg 0) +(def-art-elt orbit-plat-ag orbit-plat-lod0-mg 1) +(def-art-elt orbit-plat-ag orbit-plat-idle-ja 2) + + diff --git a/goal_src/import/orbit-plat-bottom-ag.gc b/goal_src/import/orbit-plat-bottom-ag.gc new file mode 100644 index 0000000000..e0d4ac04db --- /dev/null +++ b/goal_src/import/orbit-plat-bottom-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; orbit-plat-bottom-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt orbit-plat-bottom-ag orbit-plat-bottom-lod0-jg 0) +(def-art-elt orbit-plat-bottom-ag orbit-plat-bottom-lod0-mg 1) +(def-art-elt orbit-plat-bottom-ag orbit-plat-bottom-idle-ja 2) + + diff --git a/goal_src/import/pelican-ag.gc b/goal_src/import/pelican-ag.gc new file mode 100644 index 0000000000..28fa1d9592 --- /dev/null +++ b/goal_src/import/pelican-ag.gc @@ -0,0 +1,19 @@ +;;-*-Lisp-*- +(in-package goal) + +;; pelican-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt pelican-ag pelican-lod0-jg 0) +(def-art-elt pelican-ag pelican-lod0-mg 1) +(def-art-elt pelican-ag pelican-lod1-mg 2) +(def-art-elt pelican-ag pelican-lod2-mg 3) +(def-art-elt pelican-ag pelican-shadow-mg 4) +(def-art-elt pelican-ag pelican-fly-ja 5) +(def-art-elt pelican-ag pelican-glide-ja 6) +(def-art-elt pelican-ag pelican-swoop-ja 7) +(def-art-elt pelican-ag pelican-fly-down-ja 8) +(def-art-elt pelican-ag pelican-land-ja 9) +(def-art-elt pelican-ag pelican-sleep-ja 10) + + diff --git a/goal_src/import/periscope-ag.gc b/goal_src/import/periscope-ag.gc new file mode 100644 index 0000000000..b957cc18ab --- /dev/null +++ b/goal_src/import/periscope-ag.gc @@ -0,0 +1,16 @@ +;;-*-Lisp-*- +(in-package goal) + +;; periscope-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt periscope-ag periscope-base-lod0-jg 0) +(def-art-elt periscope-ag periscope-base-lod0-mg 1) +(def-art-elt periscope-ag periscope-base-lod1-mg 2) +(def-art-elt periscope-ag periscope-base-idle-ja 3) +(def-art-elt periscope-ag periscope-mirror-lod0-jg 4) +(def-art-elt periscope-ag periscope-mirror-lod0-mg 5) +(def-art-elt periscope-ag periscope-mirror-lod1-mg 6) +(def-art-elt periscope-ag periscope-mirror-idle-ja 7) + + diff --git a/goal_src/import/pistons-ag.gc b/goal_src/import/pistons-ag.gc new file mode 100644 index 0000000000..97b0d61317 --- /dev/null +++ b/goal_src/import/pistons-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; pistons-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt pistons-ag pistons-lod0-jg 0) +(def-art-elt pistons-ag pistons-lod0-mg 1) +(def-art-elt pistons-ag pistons-idle-ja 2) + + diff --git a/goal_src/import/plant-boss-ag.gc b/goal_src/import/plant-boss-ag.gc new file mode 100644 index 0000000000..863de122dc --- /dev/null +++ b/goal_src/import/plant-boss-ag.gc @@ -0,0 +1,62 @@ +;;-*-Lisp-*- +(in-package goal) + +;; plant-boss-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt plant-boss-ag plant-boss-main-lod0-jg 0) +(def-art-elt plant-boss-ag plant-boss-main-lod0-mg 1) +(def-art-elt plant-boss-ag plant-boss-main-shadow-mg 2) +(def-art-elt plant-boss-ag plant-boss-main-idle-ja 3) +(def-art-elt plant-boss-ag plant-boss-main-idle-alt-ja 4) +(def-art-elt plant-boss-ag plant-boss-main-attack-ja 5) +(def-art-elt plant-boss-ag plant-boss-main-attack-close-ja 6) +(def-art-elt plant-boss-ag plant-boss-main-reset-ja 7) +(def-art-elt plant-boss-ag plant-boss-main-eat-ja 8) +(def-art-elt plant-boss-ag plant-boss-main-initial-ja 9) +(def-art-elt plant-boss-ag plant-boss-main-intro-ja 10) +(def-art-elt plant-boss-ag plant-boss-main-idle2vulnerable-ja 11) +(def-art-elt plant-boss-ag plant-boss-main-vulnerable-ja 12) +(def-art-elt plant-boss-ag plant-boss-main-vulnerable2idle-ja 13) +(def-art-elt plant-boss-ag plant-boss-main-hit-ja 14) +(def-art-elt plant-boss-ag plant-boss-main-hit-kick-ja 15) +(def-art-elt plant-boss-ag plant-boss-main-hit-jumpkick-ja 16) +(def-art-elt plant-boss-ag plant-boss-main-die-ja 17) +(def-art-elt plant-boss-ag plant-boss-main-swallow-ja 20) +(def-art-elt plant-boss-ag plant-boss-main-bounce-ja 21) +(def-art-elt plant-boss-ag plant-boss-arms-lod0-jg 22) +(def-art-elt plant-boss-ag plant-boss-arms-lod0-mg 23) +(def-art-elt plant-boss-ag plant-boss-arms-shadow-mg 24) +(def-art-elt plant-boss-ag plant-boss-arms-idle-ja 25) +(def-art-elt plant-boss-ag plant-boss-arms-still-ja 26) +(def-art-elt plant-boss-ag plant-boss-arms-die-ja 27) +(def-art-elt plant-boss-ag plant-boss-arms-die-right-ja 28) +(def-art-elt plant-boss-ag plant-boss-arms-hit-ja 29) +(def-art-elt plant-boss-ag plant-boss-back-arms-lod0-jg 30) +(def-art-elt plant-boss-ag plant-boss-back-arms-lod0-mg 31) +(def-art-elt plant-boss-ag plant-boss-back-arms-shadow-mg 32) +(def-art-elt plant-boss-ag plant-boss-back-arms-idle-ja 33) +(def-art-elt plant-boss-ag plant-boss-back-arms-die-ja 34) +(def-art-elt plant-boss-ag plant-boss-back-arms-hit-ja 35) +(def-art-elt plant-boss-ag plant-boss-back-arms-hit-kick-ja 36) +(def-art-elt plant-boss-ag plant-boss-leaf-lod0-jg 37) +(def-art-elt plant-boss-ag plant-boss-leaf-lod0-mg 38) +(def-art-elt plant-boss-ag plant-boss-leaf-shadow-mg 39) +(def-art-elt plant-boss-ag plant-boss-leaf-stubby-left-ja 40) +(def-art-elt plant-boss-ag plant-boss-leaf-grow-left-ja 41) +(def-art-elt plant-boss-ag plant-boss-leaf-idle-left-ja 42) +(def-art-elt plant-boss-ag plant-boss-leaf-stubby-right-ja 43) +(def-art-elt plant-boss-ag plant-boss-leaf-grow-right-ja 44) +(def-art-elt plant-boss-ag plant-boss-leaf-idle-right-ja 45) +(def-art-elt plant-boss-ag plant-boss-leaf-left-bounce-ja 46) +(def-art-elt plant-boss-ag plant-boss-leaf-right-bounce-ja 47) +(def-art-elt plant-boss-ag plant-boss-vine-lod0-jg 48) +(def-art-elt plant-boss-ag plant-boss-vine-lod0-mg 49) +(def-art-elt plant-boss-ag plant-boss-vine-idle-ja 50) +(def-art-elt plant-boss-ag plant-boss-vine-die-ja 51) +(def-art-elt plant-boss-ag plant-boss-vine-hit-ja 52) +(def-art-elt plant-boss-ag plant-boss-root-lod0-jg 53) +(def-art-elt plant-boss-ag plant-boss-root-lod0-mg 54) +(def-art-elt plant-boss-ag plant-boss-root-idle-ja 55) + + diff --git a/goal_src/import/plant-boss-main+0-ag.gc b/goal_src/import/plant-boss-main+0-ag.gc new file mode 100644 index 0000000000..a12eb95a90 --- /dev/null +++ b/goal_src/import/plant-boss-main+0-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; plant-boss-main+0-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt plant-boss-main+0-ag eichar-main-plant-boss-kill-ja 0) +(def-art-elt plant-boss-main+0-ag eichar-main-plant-boss-kill-close-ja 1) +(def-art-elt plant-boss-main+0-ag plant-boss-main-plant-boss-kill-ja 2) +(def-art-elt plant-boss-main+0-ag plant-boss-main-plant-boss-kill-close-ja 3) +(def-art-elt plant-boss-main+0-ag sidekick-main-plant-boss-kill-ja 4) +(def-art-elt plant-boss-main+0-ag sidekick-main-plant-boss-kill-close-ja 5) + + diff --git a/goal_src/import/plat-ag.gc b/goal_src/import/plat-ag.gc new file mode 100644 index 0000000000..61e41e2c1d --- /dev/null +++ b/goal_src/import/plat-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; plat-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt plat-ag plat-lod0-jg 0) +(def-art-elt plat-ag plat-lod0-mg 1) +(def-art-elt plat-ag plat-lod1-mg 2) +(def-art-elt plat-ag plat-lod2-mg 3) +(def-art-elt plat-ag plat-idle-ja 4) + + diff --git a/goal_src/import/plat-button-ag.gc b/goal_src/import/plat-button-ag.gc new file mode 100644 index 0000000000..262d31dc50 --- /dev/null +++ b/goal_src/import/plat-button-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; plat-button-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt plat-button-ag plat-button-geo-jg 0) +(def-art-elt plat-button-ag plat-button-geo-mg 1) +(def-art-elt plat-button-ag plat-button-pressed-ja 2) + + diff --git a/goal_src/import/plat-citb-ag.gc b/goal_src/import/plat-citb-ag.gc new file mode 100644 index 0000000000..aaae6ee1f7 --- /dev/null +++ b/goal_src/import/plat-citb-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; plat-citb-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt plat-citb-ag plat-citb-lod0-jg 0) +(def-art-elt plat-citb-ag plat-citb-lod0-mg 1) +(def-art-elt plat-citb-ag plat-citb-lod1-mg 2) +(def-art-elt plat-citb-ag plat-citb-idle-ja 3) + + diff --git a/goal_src/import/plat-eco-ag.gc b/goal_src/import/plat-eco-ag.gc new file mode 100644 index 0000000000..ff991d1b43 --- /dev/null +++ b/goal_src/import/plat-eco-ag.gc @@ -0,0 +1,17 @@ +;;-*-Lisp-*- +(in-package goal) + +;; plat-eco-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt plat-eco-ag plat-eco-lod0-jg 0) +(def-art-elt plat-eco-ag plat-eco-lod0-mg 1) +(def-art-elt plat-eco-ag plat-eco-lod1-mg 2) +(def-art-elt plat-eco-ag plat-eco-lod2-mg 3) +(def-art-elt plat-eco-ag plat-eco-lit-lod0-jg 4) +(def-art-elt plat-eco-ag plat-eco-lit-lod0-mg 5) +(def-art-elt plat-eco-ag plat-eco-lit-lod1-mg 6) +(def-art-elt plat-eco-ag plat-eco-lit-lod2-mg 7) +(def-art-elt plat-eco-ag plat-eco-idle-ja 8) + + diff --git a/goal_src/import/plat-eco-citb-ag.gc b/goal_src/import/plat-eco-citb-ag.gc new file mode 100644 index 0000000000..54f9f6dae7 --- /dev/null +++ b/goal_src/import/plat-eco-citb-ag.gc @@ -0,0 +1,17 @@ +;;-*-Lisp-*- +(in-package goal) + +;; plat-eco-citb-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt plat-eco-citb-ag plat-eco-citb-lod0-jg 0) +(def-art-elt plat-eco-citb-ag plat-eco-citb-lod0-mg 1) +(def-art-elt plat-eco-citb-ag plat-eco-citb-lod1-mg 2) +(def-art-elt plat-eco-citb-ag plat-eco-citb-lod2-mg 3) +(def-art-elt plat-eco-citb-ag plat-eco-citb-lit-lod0-jg 4) +(def-art-elt plat-eco-citb-ag plat-eco-citb-lit-lod0-mg 5) +(def-art-elt plat-eco-citb-ag plat-eco-citb-lit-lod1-mg 6) +(def-art-elt plat-eco-citb-ag plat-eco-citb-lit-lod2-mg 7) +(def-art-elt plat-eco-citb-ag plat-eco-citb-idle-ja 8) + + diff --git a/goal_src/import/plat-eco-finalboss-ag.gc b/goal_src/import/plat-eco-finalboss-ag.gc new file mode 100644 index 0000000000..21633d0179 --- /dev/null +++ b/goal_src/import/plat-eco-finalboss-ag.gc @@ -0,0 +1,17 @@ +;;-*-Lisp-*- +(in-package goal) + +;; plat-eco-finalboss-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt plat-eco-finalboss-ag plat-eco-finalboss-lod0-jg 0) +(def-art-elt plat-eco-finalboss-ag plat-eco-finalboss-lod0-mg 1) +(def-art-elt plat-eco-finalboss-ag plat-eco-finalboss-lod1-mg 2) +(def-art-elt plat-eco-finalboss-ag plat-eco-finalboss-lod2-mg 3) +(def-art-elt plat-eco-finalboss-ag plat-eco-finalboss-lit-lod0-jg 4) +(def-art-elt plat-eco-finalboss-ag plat-eco-finalboss-lit-lod0-mg 5) +(def-art-elt plat-eco-finalboss-ag plat-eco-finalboss-lit-lod1-mg 6) +(def-art-elt plat-eco-finalboss-ag plat-eco-finalboss-lit-lod2-mg 7) +(def-art-elt plat-eco-finalboss-ag plat-eco-finalboss-idle-ja 8) + + diff --git a/goal_src/import/plat-flip-ag.gc b/goal_src/import/plat-flip-ag.gc new file mode 100644 index 0000000000..d052fa1fdb --- /dev/null +++ b/goal_src/import/plat-flip-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; plat-flip-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt plat-flip-ag plat-flip-geo-jg 0) +(def-art-elt plat-flip-ag plat-flip-geo-mg 1) +(def-art-elt plat-flip-ag plat-flip-turn-down-ja 2) +(def-art-elt plat-flip-ag plat-flip-turn-up-ja 3) + + diff --git a/goal_src/import/plat-jungleb-ag.gc b/goal_src/import/plat-jungleb-ag.gc new file mode 100644 index 0000000000..1b1f053d6f --- /dev/null +++ b/goal_src/import/plat-jungleb-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; plat-jungleb-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt plat-jungleb-ag plat-jungleb-lod0-jg 0) +(def-art-elt plat-jungleb-ag plat-jungleb-lod0-mg 1) +(def-art-elt plat-jungleb-ag plat-jungleb-lod1-mg 2) +(def-art-elt plat-jungleb-ag plat-jungleb-lod2-mg 3) +(def-art-elt plat-jungleb-ag plat-jungleb-idle-ja 4) + + diff --git a/goal_src/import/plat-sunken-ag.gc b/goal_src/import/plat-sunken-ag.gc new file mode 100644 index 0000000000..5dc05fffa1 --- /dev/null +++ b/goal_src/import/plat-sunken-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; plat-sunken-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt plat-sunken-ag plat-sunken-lod0-jg 0) +(def-art-elt plat-sunken-ag plat-sunken-lod0-mg 1) +(def-art-elt plat-sunken-ag plat-sunken-lod1-mg 2) +(def-art-elt plat-sunken-ag plat-sunken-lod2-mg 3) +(def-art-elt plat-sunken-ag plat-sunken-idle-ja 4) + + diff --git a/goal_src/import/plunger-lurker-ag.gc b/goal_src/import/plunger-lurker-ag.gc new file mode 100644 index 0000000000..eb53d40706 --- /dev/null +++ b/goal_src/import/plunger-lurker-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; plunger-lurker-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt plunger-lurker-ag plunger-lurker-lod0-jg 0) +(def-art-elt plunger-lurker-ag plunger-lurker-lod0-mg 1) +(def-art-elt plunger-lurker-ag plunger-lurker-lod1-mg 2) +(def-art-elt plunger-lurker-ag plunger-lurker-lod2-mg 3) +(def-art-elt plunger-lurker-ag plunger-lurker-idle-ja 4) +(def-art-elt plunger-lurker-ag plunger-lurker-notice-ja 5) +(def-art-elt plunger-lurker-ag plunger-lurker-death-ja 6) + + diff --git a/goal_src/import/pontoonfive-ag.gc b/goal_src/import/pontoonfive-ag.gc new file mode 100644 index 0000000000..b71cf3f51d --- /dev/null +++ b/goal_src/import/pontoonfive-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; pontoonfive-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt pontoonfive-ag pontoonfive-lod0-jg 0) +(def-art-elt pontoonfive-ag pontoonfive-lod0-mg 1) +(def-art-elt pontoonfive-ag pontoonfive-lod1-mg 2) +(def-art-elt pontoonfive-ag pontoonfive-lod2-mg 3) +(def-art-elt pontoonfive-ag pontoonfive-idle-ja 4) + + diff --git a/goal_src/import/pontoonten-ag.gc b/goal_src/import/pontoonten-ag.gc new file mode 100644 index 0000000000..364fbdf1a2 --- /dev/null +++ b/goal_src/import/pontoonten-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; pontoonten-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt pontoonten-ag pontoonten-lod0-jg 0) +(def-art-elt pontoonten-ag pontoonten-lod0-mg 1) +(def-art-elt pontoonten-ag pontoonten-lod1-mg 2) +(def-art-elt pontoonten-ag pontoonten-lod2-mg 3) +(def-art-elt pontoonten-ag pontoonten-idle-ja 4) + + diff --git a/goal_src/import/power-left-ag.gc b/goal_src/import/power-left-ag.gc new file mode 100644 index 0000000000..8c8ef05cda --- /dev/null +++ b/goal_src/import/power-left-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; power-left-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt power-left-ag power-left-lod0-jg 0) +(def-art-elt power-left-ag power-left-lod0-mg 1) +(def-art-elt power-left-ag power-left-idle-ja 2) + + diff --git a/goal_src/import/power-right-ag.gc b/goal_src/import/power-right-ag.gc new file mode 100644 index 0000000000..a692030d24 --- /dev/null +++ b/goal_src/import/power-right-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; power-right-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt power-right-ag power-right-lod0-jg 0) +(def-art-elt power-right-ag power-right-lod0-mg 1) +(def-art-elt power-right-ag power-right-idle-ja 2) + + diff --git a/goal_src/import/powercellalt-ag.gc b/goal_src/import/powercellalt-ag.gc new file mode 100644 index 0000000000..951b89d29a --- /dev/null +++ b/goal_src/import/powercellalt-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; powercellalt-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt powercellalt-ag powercellalt-lod0-jg 0) +(def-art-elt powercellalt-ag powercellalt-lod0-mg 1) +(def-art-elt powercellalt-ag powercellalt-idle-ja 2) + + diff --git a/goal_src/import/precurbridge-ag.gc b/goal_src/import/precurbridge-ag.gc new file mode 100644 index 0000000000..b54319f471 --- /dev/null +++ b/goal_src/import/precurbridge-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; precurbridge-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt precurbridge-ag precurbridge-geo-jg 0) +(def-art-elt precurbridge-ag precurbridge-geo-mg 1) +(def-art-elt precurbridge-ag precurbridge-lod1-mg 2) +(def-art-elt precurbridge-ag precurbridge-idle-ja 3) +(def-art-elt precurbridge-ag precurbridge-float-ja 4) +(def-art-elt precurbridge-ag precurbridge-static-ja 5) + + diff --git a/goal_src/import/precursor-arm-ag.gc b/goal_src/import/precursor-arm-ag.gc new file mode 100644 index 0000000000..3e2e152ea6 --- /dev/null +++ b/goal_src/import/precursor-arm-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; precursor-arm-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt precursor-arm-ag precursor-arm-lod0-jg 0) +(def-art-elt precursor-arm-ag precursor-arm-lod0-mg 1) +(def-art-elt precursor-arm-ag precursor-arm-idle-ja 2) + + diff --git a/goal_src/import/puffer-ag.gc b/goal_src/import/puffer-ag.gc new file mode 100644 index 0000000000..3b8d3ec53f --- /dev/null +++ b/goal_src/import/puffer-ag.gc @@ -0,0 +1,24 @@ +;;-*-Lisp-*- +(in-package goal) + +;; puffer-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt puffer-ag puffer-main-lod0-jg 0) +(def-art-elt puffer-ag puffer-main-lod0-mg 1) +(def-art-elt puffer-ag puffer-main-lod1-mg 2) +(def-art-elt puffer-ag puffer-main-lod2-mg 3) +(def-art-elt puffer-ag puffer-main-shadow-mg 4) +(def-art-elt puffer-ag puffer-mean-lod0-jg 5) +(def-art-elt puffer-ag puffer-mean-lod0-mg 6) +(def-art-elt puffer-ag puffer-mean-lod1-mg 7) +(def-art-elt puffer-ag puffer-mean-lod2-mg 8) +(def-art-elt puffer-ag puffer-hover-unpuffed-ja 9) +(def-art-elt puffer-ag puffer-hover-puffed-ja 10) +(def-art-elt puffer-ag puffer-fly-unpuffed-ja 11) +(def-art-elt puffer-ag puffer-fly-puffed-ja 12) +(def-art-elt puffer-ag puffer-puff-up-ja 13) +(def-art-elt puffer-ag puffer-puff-down-ja 14) +(def-art-elt puffer-ag puffer-die-ja 15) + + diff --git a/goal_src/import/pusher-ag.gc b/goal_src/import/pusher-ag.gc new file mode 100644 index 0000000000..595081062c --- /dev/null +++ b/goal_src/import/pusher-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; pusher-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt pusher-ag pusher-lod0-jg 0) +(def-art-elt pusher-ag pusher-lod0-mg 1) +(def-art-elt pusher-ag pusher-idle-ja 2) + + diff --git a/goal_src/import/qbert-plat-ag.gc b/goal_src/import/qbert-plat-ag.gc new file mode 100644 index 0000000000..e3b510c0c4 --- /dev/null +++ b/goal_src/import/qbert-plat-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; qbert-plat-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt qbert-plat-ag qbert-plat-lod0-jg 0) +(def-art-elt qbert-plat-ag qbert-plat-lod0-mg 1) +(def-art-elt qbert-plat-ag qbert-plat-idle-ja 2) + + diff --git a/goal_src/import/qbert-plat-on-ag.gc b/goal_src/import/qbert-plat-on-ag.gc new file mode 100644 index 0000000000..a5107f379b --- /dev/null +++ b/goal_src/import/qbert-plat-on-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; qbert-plat-on-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt qbert-plat-on-ag qbert-plat-on-lod0-jg 0) +(def-art-elt qbert-plat-on-ag qbert-plat-on-lod0-mg 1) +(def-art-elt qbert-plat-on-ag qbert-plat-on-idle-ja 2) + + diff --git a/goal_src/import/quicksandlurker-ag.gc b/goal_src/import/quicksandlurker-ag.gc new file mode 100644 index 0000000000..7af4ad6833 --- /dev/null +++ b/goal_src/import/quicksandlurker-ag.gc @@ -0,0 +1,18 @@ +;;-*-Lisp-*- +(in-package goal) + +;; quicksandlurker-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt quicksandlurker-ag quicksandlurker-lod0-jg 0) +(def-art-elt quicksandlurker-ag quicksandlurker-lod0-mg 1) +(def-art-elt quicksandlurker-ag quicksandlurker-idle-ja 2) +(def-art-elt quicksandlurker-ag quicksandlurker-yawn-ja 3) +(def-art-elt quicksandlurker-ag quicksandlurker-spit-ja 4) +(def-art-elt quicksandlurker-ag quicksandlurker-hide-ja 5) +(def-art-elt quicksandlurker-ag quicksandlurker-victory-ja 6) +(def-art-elt quicksandlurker-ag quicksandlurker-victory2-ja 7) +(def-art-elt quicksandlurker-ag quicksandlurker-popup-ja 8) +(def-art-elt quicksandlurker-ag quicksandlurker-die-ja 9) + + diff --git a/goal_src/import/race-ring-ag.gc b/goal_src/import/race-ring-ag.gc new file mode 100644 index 0000000000..489fad286a --- /dev/null +++ b/goal_src/import/race-ring-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; race-ring-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt race-ring-ag race-ring-lod0-jg 0) +(def-art-elt race-ring-ag race-ring-lod0-mg 1) +(def-art-elt race-ring-ag race-ring-race-ring-idle-ja 2) + + diff --git a/goal_src/import/racer-ag.gc b/goal_src/import/racer-ag.gc new file mode 100644 index 0000000000..f059a558ae --- /dev/null +++ b/goal_src/import/racer-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; racer-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt racer-ag racer-geo-jg 0) +(def-art-elt racer-ag racer-explode-idle-ja 24) +(def-art-elt racer-ag racer-geo-mg 1) +(def-art-elt racer-ag racer-shadow-mg 2) +(def-art-elt racer-ag racer-explode-lod0-jg 22) +(def-art-elt racer-ag racer-explode-lod0-mg 23) + + diff --git a/goal_src/import/ram-ag.gc b/goal_src/import/ram-ag.gc new file mode 100644 index 0000000000..bb9d121039 --- /dev/null +++ b/goal_src/import/ram-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ram-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ram-ag ram-lod0-jg 0) +(def-art-elt ram-ag ram-lod0-mg 1) +(def-art-elt ram-ag ram-lod1-mg 2) +(def-art-elt ram-ag ram-lod2-mg 3) +(def-art-elt ram-ag ram-cock-ja 4) +(def-art-elt ram-ag ram-release-ja 5) +(def-art-elt ram-ag ram-idle-ja 6) + + diff --git a/goal_src/import/ram-boss-ag.gc b/goal_src/import/ram-boss-ag.gc new file mode 100644 index 0000000000..5ce82a9414 --- /dev/null +++ b/goal_src/import/ram-boss-ag.gc @@ -0,0 +1,33 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ram-boss-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ram-boss-ag ram-boss-lod0-jg 0) +(def-art-elt ram-boss-ag ram-boss-lod0-mg 1) +(def-art-elt ram-boss-ag ram-boss-lod1-mg 2) +(def-art-elt ram-boss-ag ram-boss-lod2-mg 3) +(def-art-elt ram-boss-ag ram-boss-cock-ja 4) +(def-art-elt ram-boss-ag ram-boss-release-ja 5) +(def-art-elt ram-boss-ag ram-boss-forward-defend-ja 6) +(def-art-elt ram-boss-ag ram-boss-forward-defend-tracking-ja 7) +(def-art-elt ram-boss-ag ram-boss-forward-defend-block-ja 8) +(def-art-elt ram-boss-ag ram-boss-up-defend-block-ja 9) +(def-art-elt ram-boss-ag ram-boss-throw-ja 10) +(def-art-elt ram-boss-ag ram-boss-run-ja 11) +(def-art-elt ram-boss-ag ram-boss-run-no-shield-ja 12) +(def-art-elt ram-boss-ag ram-boss-far-idle-ja 13) +(def-art-elt ram-boss-ag ram-boss-celebrate-ja 14) +(def-art-elt ram-boss-ag ram-boss-die-ja 15) +(def-art-elt ram-boss-ag ram-boss-dismount-start-ja 16) +(def-art-elt ram-boss-ag ram-boss-dismount-hit-ground-ja 17) +(def-art-elt ram-boss-ag ram-boss-lose-shield-ja 18) +(def-art-elt ram-boss-ag ram-boss-sees-player-ja 19) +(def-art-elt ram-boss-ag ram-boss-forward-defend-tracking-no-shield-ja 20) +(def-art-elt ram-boss-ag ram-boss-up-defend-ja 21) +(def-art-elt ram-boss-ag ram-boss-up-defend-tracking-ja 22) +(def-art-elt ram-boss-ag ram-boss-throw-no-shield-ja 23) +(def-art-elt ram-boss-ag ram-boss-forward-defend-no-shield-ja 24) + + diff --git a/goal_src/import/redring-ag.gc b/goal_src/import/redring-ag.gc new file mode 100644 index 0000000000..5e323d33ca --- /dev/null +++ b/goal_src/import/redring-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; redring-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt redring-ag redring-lod0-jg 0) +(def-art-elt redring-ag redring-lod0-mg 1) +(def-art-elt redring-ag redring-idle-ja 2) + + diff --git a/goal_src/import/redsage-ag.gc b/goal_src/import/redsage-ag.gc new file mode 100644 index 0000000000..6a805b841d --- /dev/null +++ b/goal_src/import/redsage-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; redsage-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt redsage-ag redsage-lod0-jg 0) +(def-art-elt redsage-ag redsage-lod0-mg 1) +(def-art-elt redsage-ag redsage-lod1-mg 2) +(def-art-elt redsage-ag redsage-shadow-mg 3) +(def-art-elt redsage-ag redsage-redsage-idle-ja 4) +(def-art-elt redsage-ag redsage-redsage-attack-start-ja 5) +(def-art-elt redsage-ag redsage-redsage-attack-loop-ja 6) + + diff --git a/goal_src/import/reflector-middle-ag.gc b/goal_src/import/reflector-middle-ag.gc new file mode 100644 index 0000000000..b72a9b152a --- /dev/null +++ b/goal_src/import/reflector-middle-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; reflector-middle-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt reflector-middle-ag reflector-middle-geo-jg 0) +(def-art-elt reflector-middle-ag reflector-middle-geo-mg 1) +(def-art-elt reflector-middle-ag reflector-middle-idle-ja 2) + + diff --git a/goal_src/import/reflector-mirror-ag.gc b/goal_src/import/reflector-mirror-ag.gc new file mode 100644 index 0000000000..0ae9b60d88 --- /dev/null +++ b/goal_src/import/reflector-mirror-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; reflector-mirror-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt reflector-mirror-ag reflector-mirror-lod0-jg 0) +(def-art-elt reflector-mirror-ag reflector-mirror-lod0-mg 1) +(def-art-elt reflector-mirror-ag reflector-mirror-lod1-mg 2) +(def-art-elt reflector-mirror-ag reflector-mirror-idle-ja 3) +(def-art-elt reflector-mirror-ag reflector-mirror-break-lod0-jg 4) +(def-art-elt reflector-mirror-ag reflector-mirror-break-lod0-mg 5) +(def-art-elt reflector-mirror-ag reflector-mirror-break-break-ja 6) + + diff --git a/goal_src/import/revcycle-ag.gc b/goal_src/import/revcycle-ag.gc new file mode 100644 index 0000000000..20f4c342d4 --- /dev/null +++ b/goal_src/import/revcycle-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; revcycle-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt revcycle-ag revcycle-geo-jg 0) +(def-art-elt revcycle-ag revcycle-geo-mg 1) +(def-art-elt revcycle-ag revcycle-idle-ja 2) + + diff --git a/goal_src/import/revcycleprop-ag.gc b/goal_src/import/revcycleprop-ag.gc new file mode 100644 index 0000000000..ab96ff1f23 --- /dev/null +++ b/goal_src/import/revcycleprop-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; revcycleprop-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt revcycleprop-ag revcycleprop-lod0-jg 0) +(def-art-elt revcycleprop-ag revcycleprop-lod0-mg 1) +(def-art-elt revcycleprop-ag revcycleprop-idle-ja 2) + + diff --git a/goal_src/import/robber-ag.gc b/goal_src/import/robber-ag.gc new file mode 100644 index 0000000000..ac081622fb --- /dev/null +++ b/goal_src/import/robber-ag.gc @@ -0,0 +1,20 @@ +;;-*-Lisp-*- +(in-package goal) + +;; robber-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt robber-ag robber-lod0-jg 0) +(def-art-elt robber-ag robber-lod0-mg 1) +(def-art-elt robber-ag robber-lod1-mg 2) +(def-art-elt robber-ag robber-lod2-mg 3) +(def-art-elt robber-ag robber-shadow-mg 4) +(def-art-elt robber-ag robber-idle-ja 5) +(def-art-elt robber-ag robber-spots-ja 6) +(def-art-elt robber-ag robber-fly-ja 7) +(def-art-elt robber-ag robber-death-ja 8) +(def-art-elt robber-ag robber-taunt-ja 9) +(def-art-elt robber-ag robber-idle-hover-ja 10) +(def-art-elt robber-ag robber-ambient-look-ja 11) + + diff --git a/goal_src/import/robotboss-ag.gc b/goal_src/import/robotboss-ag.gc new file mode 100644 index 0000000000..cd4d795be7 --- /dev/null +++ b/goal_src/import/robotboss-ag.gc @@ -0,0 +1,44 @@ +;;-*-Lisp-*- +(in-package goal) + +;; robotboss-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt robotboss-ag robotboss-basic-lod0-jg 0) +(def-art-elt robotboss-ag robotboss-basic-lod0-mg 1) +(def-art-elt robotboss-ag robotboss-idle-ja 2) +(def-art-elt robotboss-ag robotboss-idle-blue-ja 3) +(def-art-elt robotboss-ag robotboss-blue-hit-ja 4) +(def-art-elt robotboss-ag robotboss-blue-roar-ja 5) +(def-art-elt robotboss-ag robotboss-idle-hover-no-blue-ja 6) +(def-art-elt robotboss-ag robotboss-idle-hover-lookup-no-blue-ja 7) +(def-art-elt robotboss-ag robotboss-dark-reveal-ja 8) +(def-art-elt robotboss-ag robotboss-dark-shoot-ja 9) +(def-art-elt robotboss-ag robotboss-dark-return-ja 10) +(def-art-elt robotboss-ag robotboss-green-spawn-ja 11) +(def-art-elt robotboss-ag robotboss-green-idle-ja 12) +(def-art-elt robotboss-ag robotboss-green-roar-ja 13) +(def-art-elt robotboss-ag robotboss-dark-reveal-green-ja 14) +(def-art-elt robotboss-ag robotboss-dark-return-after-green-ja 15) +(def-art-elt robotboss-ag robotboss-red-idle-ja 16) +(def-art-elt robotboss-ag robotboss-red-charge-ja 17) +(def-art-elt robotboss-ag robotboss-red-blast-ja 18) +(def-art-elt robotboss-ag robotboss-red-hit-ja 19) +(def-art-elt robotboss-ag robotboss-red-roar-ja 20) +(def-art-elt robotboss-ag robotboss-idle-hover-no-red-ja 21) +(def-art-elt robotboss-ag robotboss-dark-reveal-no-red-ja 22) +(def-art-elt robotboss-ag robotboss-idle-hover-lookup-no-red-ja 23) +(def-art-elt robotboss-ag robotboss-dark-shoot-no-red-ja 24) +(def-art-elt robotboss-ag robotboss-dark-return-after-red-ja 25) +(def-art-elt robotboss-ag robotboss-yellow-idle-ja 26) +(def-art-elt robotboss-ag robotboss-yellow-blast-ja 27) +(def-art-elt robotboss-ag robotboss-yellow-hit-ja 28) +(def-art-elt robotboss-ag robotboss-yellow-roar-ja 29) +(def-art-elt robotboss-ag robotboss-idle-hover-no-yellow-ja 30) +(def-art-elt robotboss-ag robotboss-dark-reveal-no-yellow-ja 31) +(def-art-elt robotboss-ag robotboss-dark-shoot-no-yellow-ja 32) +(def-art-elt robotboss-ag robotboss-blue-last-hit-ja 33) +(def-art-elt robotboss-ag robotboss-red-last-hit-ja 34) +(def-art-elt robotboss-ag robotboss-yellow-last-hit-ja 35) + + diff --git a/goal_src/import/robotboss-blueeco-ag.gc b/goal_src/import/robotboss-blueeco-ag.gc new file mode 100644 index 0000000000..01e31e3b4d --- /dev/null +++ b/goal_src/import/robotboss-blueeco-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; robotboss-blueeco-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt robotboss-blueeco-ag robotboss-blueeco-lod0-jg 0) +(def-art-elt robotboss-blueeco-ag robotboss-blueeco-lod0-mg 1) +(def-art-elt robotboss-blueeco-ag robotboss-blueeco-idle-ja 2) +(def-art-elt robotboss-blueeco-ag robotboss-blueeco-blue-last-hit-ja 3) + + diff --git a/goal_src/import/robotboss-cinematic-ag.gc b/goal_src/import/robotboss-cinematic-ag.gc new file mode 100644 index 0000000000..70ab6e3260 --- /dev/null +++ b/goal_src/import/robotboss-cinematic-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; robotboss-cinematic-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt robotboss-cinematic-ag robotboss-cinematic-lod0-jg 0) +(def-art-elt robotboss-cinematic-ag robotboss-cinematic-lod0-mg 1) +(def-art-elt robotboss-cinematic-ag robotboss-cinematic-idle-ja 2) + + diff --git a/goal_src/import/robotboss-redeco-ag.gc b/goal_src/import/robotboss-redeco-ag.gc new file mode 100644 index 0000000000..feead18832 --- /dev/null +++ b/goal_src/import/robotboss-redeco-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; robotboss-redeco-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt robotboss-redeco-ag robotboss-redeco-lod0-jg 0) +(def-art-elt robotboss-redeco-ag robotboss-redeco-lod0-mg 1) +(def-art-elt robotboss-redeco-ag robotboss-redeco-idle-ja 2) +(def-art-elt robotboss-redeco-ag robotboss-redeco-red-last-hit-ja 3) + + diff --git a/goal_src/import/robotboss-yelloweco-ag.gc b/goal_src/import/robotboss-yelloweco-ag.gc new file mode 100644 index 0000000000..75a5bd7f0d --- /dev/null +++ b/goal_src/import/robotboss-yelloweco-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; robotboss-yelloweco-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt robotboss-yelloweco-ag robotboss-yelloweco-lod0-jg 0) +(def-art-elt robotboss-yelloweco-ag robotboss-yelloweco-lod0-mg 1) +(def-art-elt robotboss-yelloweco-ag robotboss-yelloweco-idle-ja 2) +(def-art-elt robotboss-yelloweco-ag robotboss-yelloweco-yellow-last-hit-ja 3) + + diff --git a/goal_src/import/rolling-start-ag.gc b/goal_src/import/rolling-start-ag.gc new file mode 100644 index 0000000000..45d5d81d67 --- /dev/null +++ b/goal_src/import/rolling-start-ag.gc @@ -0,0 +1,16 @@ +;;-*-Lisp-*- +(in-package goal) + +;; rolling-start-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt rolling-start-ag rolling-start-whole-lod0-jg 0) +(def-art-elt rolling-start-ag rolling-start-whole-lod0-mg 1) +(def-art-elt rolling-start-ag rolling-start-broken-lod0-jg 2) +(def-art-elt rolling-start-ag rolling-start-broken-lod0-mg 3) +(def-art-elt rolling-start-ag rolling-start-idle-ja 4) +(def-art-elt rolling-start-ag rolling-start-break-whole-ja 5) +(def-art-elt rolling-start-ag rolling-start-break-broken-ja 6) +(def-art-elt rolling-start-ag rolling-start-broken-ja 7) + + diff --git a/goal_src/import/rollingcam-ag.gc b/goal_src/import/rollingcam-ag.gc new file mode 100644 index 0000000000..423484556f --- /dev/null +++ b/goal_src/import/rollingcam-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; rollingcam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt rollingcam-ag rollingcam-lod0-jg 0) +(def-art-elt rollingcam-ag rollingcam-lod0-mg 1) +(def-art-elt rollingcam-ag rollingcam-anim-ja 2) + + diff --git a/goal_src/import/ropebridge-32-ag.gc b/goal_src/import/ropebridge-32-ag.gc new file mode 100644 index 0000000000..b4973d2820 --- /dev/null +++ b/goal_src/import/ropebridge-32-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ropebridge-32-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ropebridge-32-ag ropebridge-32-lod0-jg 0) +(def-art-elt ropebridge-32-ag ropebridge-32-lod0-mg 1) +(def-art-elt ropebridge-32-ag ropebridge-32-lod1-mg 2) +(def-art-elt ropebridge-32-ag ropebridge-32-idle-ja 3) + + diff --git a/goal_src/import/ropebridge-36-ag.gc b/goal_src/import/ropebridge-36-ag.gc new file mode 100644 index 0000000000..4e3daac715 --- /dev/null +++ b/goal_src/import/ropebridge-36-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ropebridge-36-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ropebridge-36-ag ropebridge-36-lod0-jg 0) +(def-art-elt ropebridge-36-ag ropebridge-36-lod0-mg 1) +(def-art-elt ropebridge-36-ag ropebridge-36-lod1-mg 2) +(def-art-elt ropebridge-36-ag ropebridge-36-idle-ja 3) + + diff --git a/goal_src/import/ropebridge-52-ag.gc b/goal_src/import/ropebridge-52-ag.gc new file mode 100644 index 0000000000..f6ccc364b2 --- /dev/null +++ b/goal_src/import/ropebridge-52-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ropebridge-52-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ropebridge-52-ag ropebridge-52-lod0-jg 0) +(def-art-elt ropebridge-52-ag ropebridge-52-lod0-mg 1) +(def-art-elt ropebridge-52-ag ropebridge-52-lod1-mg 2) +(def-art-elt ropebridge-52-ag ropebridge-52-idle-ja 3) + + diff --git a/goal_src/import/ropebridge-70-ag.gc b/goal_src/import/ropebridge-70-ag.gc new file mode 100644 index 0000000000..f4a6e48535 --- /dev/null +++ b/goal_src/import/ropebridge-70-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; ropebridge-70-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt ropebridge-70-ag ropebridge-70-lod0-jg 0) +(def-art-elt ropebridge-70-ag ropebridge-70-lod0-mg 1) +(def-art-elt ropebridge-70-ag ropebridge-70-lod1-mg 2) +(def-art-elt ropebridge-70-ag ropebridge-70-idle-ja 3) + + diff --git a/goal_src/import/rounddoor-ag.gc b/goal_src/import/rounddoor-ag.gc new file mode 100644 index 0000000000..566eb205f1 --- /dev/null +++ b/goal_src/import/rounddoor-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; rounddoor-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt rounddoor-ag rounddoor-lod0-jg 0) +(def-art-elt rounddoor-ag rounddoor-lod0-mg 1) +(def-art-elt rounddoor-ag rounddoor-lod1-mg 2) +(def-art-elt rounddoor-ag rounddoor-idle-ja 3) + + diff --git a/goal_src/import/sack-ag.gc b/goal_src/import/sack-ag.gc new file mode 100644 index 0000000000..202d1e66ef --- /dev/null +++ b/goal_src/import/sack-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sack-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sack-ag sack-lod0-jg 0) +(def-art-elt sack-ag sack-lod0-mg 1) +(def-art-elt sack-ag sack-idle-ja 2) +(def-art-elt sack-ag sack-hit-ja 3) +(def-art-elt sack-ag sack-fuse-ja 4) + + diff --git a/goal_src/import/sage-ag.gc b/goal_src/import/sage-ag.gc new file mode 100644 index 0000000000..1ea1b83e1c --- /dev/null +++ b/goal_src/import/sage-ag.gc @@ -0,0 +1,16 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sage-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sage-ag sage-lod0-jg 0) +(def-art-elt sage-ag sage-lod0-mg 1) +(def-art-elt sage-ag sage-shadow-mg 2) +(def-art-elt sage-ag sage-idle-cannon-ja 3) +(def-art-elt sage-ag sage-idle-ecorocks-breathe-ja 4) +(def-art-elt sage-ag sage-idle-ecorocks-peer-ja 5) +(def-art-elt sage-ag sage-idle-levitate-ja 6) +(def-art-elt sage-ag sage-idle-levitate-backward-ja 7) + + diff --git a/goal_src/import/sage-bluehut-ag.gc b/goal_src/import/sage-bluehut-ag.gc new file mode 100644 index 0000000000..2294675134 --- /dev/null +++ b/goal_src/import/sage-bluehut-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sage-bluehut-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sage-bluehut-ag sage-bluehut-lod0-jg 0) +(def-art-elt sage-bluehut-ag sage-bluehut-lod0-mg 1) +(def-art-elt sage-bluehut-ag sage-bluehut-shadow-mg 2) +(def-art-elt sage-bluehut-ag sage-bluehut-idle-ja 3) +(def-art-elt sage-bluehut-ag sage-bluehut-idle-stand-ja 4) +(def-art-elt sage-bluehut-ag sage-bluehut-idle-prec-arm-ja 5) + + diff --git a/goal_src/import/sage-village3-ag.gc b/goal_src/import/sage-village3-ag.gc new file mode 100644 index 0000000000..f49a52f512 --- /dev/null +++ b/goal_src/import/sage-village3-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sage-village3-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sage-village3-ag sage-village3-lod0-jg 0) +(def-art-elt sage-village3-ag sage-village3-lod0-mg 1) +(def-art-elt sage-village3-ag sage-village3-shadow-mg 2) +(def-art-elt sage-village3-ag sage-village3-idle-ja 3) + + diff --git a/goal_src/import/sagesail-ag.gc b/goal_src/import/sagesail-ag.gc new file mode 100644 index 0000000000..10e167b1d8 --- /dev/null +++ b/goal_src/import/sagesail-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sagesail-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sagesail-ag sagesail-lod0-jg 0) +(def-art-elt sagesail-ag sagesail-lod0-mg 1) +(def-art-elt sagesail-ag sagesail-lod1-mg 2) +(def-art-elt sagesail-ag sagesail-lod2-mg 3) +(def-art-elt sagesail-ag sagesail-idle-ja 4) + + diff --git a/goal_src/import/scarecrow-a-ag.gc b/goal_src/import/scarecrow-a-ag.gc new file mode 100644 index 0000000000..d617724a80 --- /dev/null +++ b/goal_src/import/scarecrow-a-ag.gc @@ -0,0 +1,17 @@ +;;-*-Lisp-*- +(in-package goal) + +;; scarecrow-a-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt scarecrow-a-ag scarecrow-a-lod0-jg 0) +(def-art-elt scarecrow-a-ag scarecrow-a-lod0-mg 1) +(def-art-elt scarecrow-a-ag scarecrow-a-lod1-mg 2) +(def-art-elt scarecrow-a-ag scarecrow-a-lod2-mg 3) +(def-art-elt scarecrow-a-ag scarecrow-a-break-lod0-mg 4) +(def-art-elt scarecrow-a-ag scarecrow-a-idle-ja 5) +(def-art-elt scarecrow-a-ag scarecrow-a-hit-left-ja 6) +(def-art-elt scarecrow-a-ag scarecrow-a-hit-right-ja 7) +(def-art-elt scarecrow-a-ag scarecrow-a-hit-front-ja 8) + + diff --git a/goal_src/import/scarecrow-b-ag.gc b/goal_src/import/scarecrow-b-ag.gc new file mode 100644 index 0000000000..f3b675750c --- /dev/null +++ b/goal_src/import/scarecrow-b-ag.gc @@ -0,0 +1,17 @@ +;;-*-Lisp-*- +(in-package goal) + +;; scarecrow-b-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt scarecrow-b-ag scarecrow-b-lod0-jg 0) +(def-art-elt scarecrow-b-ag scarecrow-b-lod0-mg 1) +(def-art-elt scarecrow-b-ag scarecrow-b-lod1-mg 2) +(def-art-elt scarecrow-b-ag scarecrow-b-lod2-mg 3) +(def-art-elt scarecrow-b-ag scarecrow-b-break-lod0-mg 4) +(def-art-elt scarecrow-b-ag scarecrow-b-idle-ja 5) +(def-art-elt scarecrow-b-ag scarecrow-b-hit-left-ja 6) +(def-art-elt scarecrow-b-ag scarecrow-b-hit-right-ja 7) +(def-art-elt scarecrow-b-ag scarecrow-b-hit-front-ja 8) + + diff --git a/goal_src/import/sculptor-ag.gc b/goal_src/import/sculptor-ag.gc new file mode 100644 index 0000000000..0bd3abf282 --- /dev/null +++ b/goal_src/import/sculptor-ag.gc @@ -0,0 +1,24 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sculptor-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sculptor-ag sculptor-lod0-jg 0) +(def-art-elt sculptor-ag sculptor-lod0-mg 1) +(def-art-elt sculptor-ag sculptor-shadow-mg 2) +(def-art-elt sculptor-ag sculptor-idle-ja 3) +(def-art-elt sculptor-ag sculptor-sigh-ja 4) +(def-art-elt sculptor-ag sculptor-strikestart-ja 5) +(def-art-elt sculptor-ag sculptor-strikemiddle-ja 6) +(def-art-elt sculptor-ag sculptor-strikeend-ja 7) +(def-art-elt sculptor-ag sculptor-to-small-ja 8) +(def-art-elt sculptor-ag sculptor-small-ja 9) +(def-art-elt sculptor-ag sculptor-small-to-looking-ja 10) +(def-art-elt sculptor-ag sculptor-looking-ja 11) +(def-art-elt sculptor-ag sculptor-from-looking-ja 12) +(def-art-elt sculptor-ag sculptor-to-huge-ja 13) +(def-art-elt sculptor-ag sculptor-huge-ja 14) +(def-art-elt sculptor-ag sculptor-huge-to-looking-ja 15) + + diff --git a/goal_src/import/sculptor-muse-ag.gc b/goal_src/import/sculptor-muse-ag.gc new file mode 100644 index 0000000000..7b89873c0a --- /dev/null +++ b/goal_src/import/sculptor-muse-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sculptor-muse-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sculptor-muse-ag sculptor-muse-lod0-jg 0) +(def-art-elt sculptor-muse-ag sculptor-muse-lod0-mg 1) +(def-art-elt sculptor-muse-ag sculptor-muse-idle-ja 2) + + diff --git a/goal_src/import/seagull-ag.gc b/goal_src/import/seagull-ag.gc new file mode 100644 index 0000000000..d0b3d1f52a --- /dev/null +++ b/goal_src/import/seagull-ag.gc @@ -0,0 +1,18 @@ +;;-*-Lisp-*- +(in-package goal) + +;; seagull-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt seagull-ag seagull-lod0-jg 0) +(def-art-elt seagull-ag seagull-lod0-mg 1) +(def-art-elt seagull-ag seagull-idle-ja 2) +(def-art-elt seagull-ag seagull-peck-ja 3) +(def-art-elt seagull-ag seagull-fly-ja 4) +(def-art-elt seagull-ag seagull-slowfly-ja 5) +(def-art-elt seagull-ag seagull-land-ja 6) +(def-art-elt seagull-ag seagull-stop-ja 7) +(def-art-elt seagull-ag seagull-walk-ja 8) +(def-art-elt seagull-ag seagull-takeoff-ja 9) + + diff --git a/goal_src/import/seaweed-ag.gc b/goal_src/import/seaweed-ag.gc new file mode 100644 index 0000000000..262383526b --- /dev/null +++ b/goal_src/import/seaweed-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; seaweed-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt seaweed-ag seaweed-lod0-jg 0) +(def-art-elt seaweed-ag seaweed-lod0-mg 1) +(def-art-elt seaweed-ag seaweed-idle-ja 2) + + diff --git a/goal_src/import/sharkey-ag.gc b/goal_src/import/sharkey-ag.gc new file mode 100644 index 0000000000..2c4ace3fcf --- /dev/null +++ b/goal_src/import/sharkey-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sharkey-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sharkey-ag sharkey-lod0-jg 0) +(def-art-elt sharkey-ag sharkey-lod0-mg 1) +(def-art-elt sharkey-ag sharkey-idle-ja 2) +(def-art-elt sharkey-ag sharkey-chomp-ja 3) + + diff --git a/goal_src/import/shortcut-boulder-ag.gc b/goal_src/import/shortcut-boulder-ag.gc new file mode 100644 index 0000000000..859e446030 --- /dev/null +++ b/goal_src/import/shortcut-boulder-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; shortcut-boulder-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt shortcut-boulder-ag shortcut-boulder-whole-lod0-jg 0) +(def-art-elt shortcut-boulder-ag shortcut-boulder-whole-lod0-mg 1) +(def-art-elt shortcut-boulder-ag shortcut-boulder-broken-lod0-jg 2) +(def-art-elt shortcut-boulder-ag shortcut-boulder-broken-lod0-mg 3) +(def-art-elt shortcut-boulder-ag shortcut-boulder-idle-ja 4) + + diff --git a/goal_src/import/shover-ag.gc b/goal_src/import/shover-ag.gc new file mode 100644 index 0000000000..d137851de2 --- /dev/null +++ b/goal_src/import/shover-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; shover-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt shover-ag shover-lod0-jg 0) +(def-art-elt shover-ag shover-lod0-mg 1) +(def-art-elt shover-ag shover-idle-ja 2) + + diff --git a/goal_src/import/side-to-side-plat-ag.gc b/goal_src/import/side-to-side-plat-ag.gc new file mode 100644 index 0000000000..7c1fadb951 --- /dev/null +++ b/goal_src/import/side-to-side-plat-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; side-to-side-plat-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt side-to-side-plat-ag side-to-side-plat-lod0-jg 0) +(def-art-elt side-to-side-plat-ag side-to-side-plat-lod0-mg 1) +(def-art-elt side-to-side-plat-ag side-to-side-plat-lod1-mg 2) +(def-art-elt side-to-side-plat-ag side-to-side-plat-idle-ja 3) + + diff --git a/goal_src/import/sidedoor-ag.gc b/goal_src/import/sidedoor-ag.gc new file mode 100644 index 0000000000..979c3fdea8 --- /dev/null +++ b/goal_src/import/sidedoor-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sidedoor-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sidedoor-ag sidedoor-geo-jg 0) +(def-art-elt sidedoor-ag sidedoor-geo-mg 1) +(def-art-elt sidedoor-ag sidedoor-lod1-mg 2) +(def-art-elt sidedoor-ag sidedoor-idle-ja 3) + + diff --git a/goal_src/import/sidekick-ag.gc b/goal_src/import/sidekick-ag.gc new file mode 100644 index 0000000000..3b80391566 --- /dev/null +++ b/goal_src/import/sidekick-ag.gc @@ -0,0 +1,91 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sidekick-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sidekick-ag sidekick-lod0-jg 0) +(def-art-elt sidekick-ag sidekick-lod0-mg 1) +(def-art-elt sidekick-ag sidekick-shadow-mg 2) +(def-art-elt sidekick-ag sidekick-run-to-stance-ja 3) +(def-art-elt sidekick-ag sidekick-yellow-running-blast-ja 68) +(def-art-elt sidekick-ag sidekick-run-to-stance-loop-ja 4) +(def-art-elt sidekick-ag sidekick-stance-loop-ja 5) +(def-art-elt sidekick-ag sidekick-run-ja 6) +(def-art-elt sidekick-ag sidekick-run-up-ja 7) +(def-art-elt sidekick-ag sidekick-run-down-ja 8) +(def-art-elt sidekick-ag sidekick-walk-ja 9) +(def-art-elt sidekick-ag sidekick-walk-up-ja 10) +(def-art-elt sidekick-ag sidekick-walk-down-ja 11) +(def-art-elt sidekick-ag sidekick-run-squash-ja 12) +(def-art-elt sidekick-ag sidekick-run-squash-weak-ja 13) +(def-art-elt sidekick-ag sidekick-stance-to-duck-ja 14) +(def-art-elt sidekick-ag sidekick-duck-stance-ja 15) +(def-art-elt sidekick-ag sidekick-duck-walk-ja 16) +(def-art-elt sidekick-ag sidekick-turn-around-ja 17) +(def-art-elt sidekick-ag sidekick-jump-ja 18) +(def-art-elt sidekick-ag sidekick-jump-land-ja 19) +(def-art-elt sidekick-ag sidekick-painful-land-ja 20) +(def-art-elt sidekick-ag sidekick-painful-land-end-ja 21) +(def-art-elt sidekick-ag sidekick-jump-loop-ja 22) +(def-art-elt sidekick-ag sidekick-jump-short-land-ja 23) +(def-art-elt sidekick-ag sidekick-jump-forward-ja 24) +(def-art-elt sidekick-ag sidekick-duck-high-jump-ja 25) +(def-art-elt sidekick-ag sidekick-launch-jump-ja 26) +(def-art-elt sidekick-ag sidekick-launch-jump-loop-ja 27) +(def-art-elt sidekick-ag sidekick-edge-grab-stance0-ja 28) +(def-art-elt sidekick-ag sidekick-edge-grab-stance1-ja 29) +(def-art-elt sidekick-ag sidekick-edge-grab-stance1-alt-ja 30) +(def-art-elt sidekick-ag sidekick-falling-to-edge-grab-ja 31) +(def-art-elt sidekick-ag sidekick-edge-grab-swing-left-ja 32) +(def-art-elt sidekick-ag sidekick-edge-grab-swing-right-ja 33) +(def-art-elt sidekick-ag sidekick-edge-grab-to-jump-ja 34) +(def-art-elt sidekick-ag sidekick-edge-grab-off-ja 35) +(def-art-elt sidekick-ag sidekick-attack-from-stance-ja 36) +(def-art-elt sidekick-ag sidekick-attack-from-stance-end-ja 37) +(def-art-elt sidekick-ag sidekick-attack-from-stance-alt-end-ja 38) +(def-art-elt sidekick-ag sidekick-attack-from-stance-run-end-ja 39) +(def-art-elt sidekick-ag sidekick-attack-from-stance-run-alt-end-ja 40) +(def-art-elt sidekick-ag sidekick-attack-from-jump-ja 41) +(def-art-elt sidekick-ag sidekick-attack-from-jump-loop-ja 42) +(def-art-elt sidekick-ag sidekick-free-run-ja 171) +(def-art-elt sidekick-ag sidekick-attack-from-jump-end-ja 43) +(def-art-elt sidekick-ag sidekick-free-jog-ja 172) +(def-art-elt sidekick-ag sidekick-attack-punch-ja 44) +(def-art-elt sidekick-ag sidekick-free-walk-ja 173) +(def-art-elt sidekick-ag sidekick-attack-punch-end-ja 45) +(def-art-elt sidekick-ag sidekick-attack-punch-alt-end-ja 46) +(def-art-elt sidekick-ag sidekick-attack-uppercut-ja 47) +(def-art-elt sidekick-ag sidekick-flop-down-ja 48) +(def-art-elt sidekick-ag sidekick-flop-down-loop-ja 49) +(def-art-elt sidekick-ag sidekick-flop-down-land-ja 50) +(def-art-elt sidekick-ag sidekick-moving-flop-down-ja 51) +(def-art-elt sidekick-ag sidekick-moving-flop-down-loop-ja 52) +(def-art-elt sidekick-ag sidekick-moving-flop-down-land-ja 53) +(def-art-elt sidekick-ag sidekick-duck-roll-ja 54) +(def-art-elt sidekick-ag sidekick-duck-roll-end-ja 55) +(def-art-elt sidekick-ag sidekick-wheel-flip-ja 56) +(def-art-elt sidekick-ag sidekick-wheel-flip-land-ja 57) +(def-art-elt sidekick-ag sidekick-hit-from-front-ja 58) +(def-art-elt sidekick-ag sidekick-hit-from-back-ja 59) +(def-art-elt sidekick-ag sidekick-hit-up-ja 60) +(def-art-elt sidekick-ag sidekick-deatha-ja 61) +(def-art-elt sidekick-ag sidekick-death-painful-land-ja 62) +(def-art-elt sidekick-ag sidekick-yellow-running-blast-end-ja 69) +(def-art-elt sidekick-ag sidekick-yellow-jumping-blast-ja 70) +(def-art-elt sidekick-ag sidekick-powerup-ja 71) +(def-art-elt sidekick-ag sidekick-shocked-ja 72) +(def-art-elt sidekick-ag sidekick-wade-shallow-walk-ja 73) +(def-art-elt sidekick-ag sidekick-wade-deep-walk-ja 74) +(def-art-elt sidekick-ag sidekick-swim-stance-ja 75) +(def-art-elt sidekick-ag sidekick-swim-walk-ja 76) +(def-art-elt sidekick-ag sidekick-swim-walk-to-down-ja 77) +(def-art-elt sidekick-ag sidekick-swim-down-ja 78) +(def-art-elt sidekick-ag sidekick-swim-down-to-up-ja 79) +(def-art-elt sidekick-ag sidekick-swim-up-ja 80) +(def-art-elt sidekick-ag sidekick-swim-up-to-stance-ja 81) +(def-art-elt sidekick-ag sidekick-swim-jump-ja 82) +(def-art-elt sidekick-ag sidekick-trip-ja 95) +(def-art-elt sidekick-ag sidekick-fuel-cell-victory-9-ja 122) + + diff --git a/goal_src/import/sidekick-human-ag.gc b/goal_src/import/sidekick-human-ag.gc new file mode 100644 index 0000000000..7654a86aaf --- /dev/null +++ b/goal_src/import/sidekick-human-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sidekick-human-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sidekick-human-ag sidekick-human-lod0-jg 0) +(def-art-elt sidekick-human-ag sidekick-human-lod0-mg 1) +(def-art-elt sidekick-human-ag sidekick-human-shadow-mg 2) +(def-art-elt sidekick-human-ag sidekick-human-idle-ja 3) + + diff --git a/goal_src/import/silodoor-ag.gc b/goal_src/import/silodoor-ag.gc new file mode 100644 index 0000000000..0a24d4879c --- /dev/null +++ b/goal_src/import/silodoor-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; silodoor-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt silodoor-ag silodoor-lod0-jg 0) +(def-art-elt silodoor-ag silodoor-lod0-mg 1) +(def-art-elt silodoor-ag silodoor-idle-ja 2) + + diff --git a/goal_src/import/silostep-ag.gc b/goal_src/import/silostep-ag.gc new file mode 100644 index 0000000000..7fd10c89a6 --- /dev/null +++ b/goal_src/import/silostep-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; silostep-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt silostep-ag silostep-lod0-jg 0) +(def-art-elt silostep-ag silostep-lod0-mg 1) +(def-art-elt silostep-ag silostep-idle-ja 2) + + diff --git a/goal_src/import/snow-ball-ag.gc b/goal_src/import/snow-ball-ag.gc new file mode 100644 index 0000000000..3b31948392 --- /dev/null +++ b/goal_src/import/snow-ball-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; snow-ball-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt snow-ball-ag snow-ball-lod0-jg 0) +(def-art-elt snow-ball-ag snow-ball-lod0-mg 1) +(def-art-elt snow-ball-ag snow-ball-idle-ja 2) +(def-art-elt snow-ball-ag snow-ball-shadow-lod0-jg 3) +(def-art-elt snow-ball-ag snow-ball-shadow-lod0-mg 4) +(def-art-elt snow-ball-ag snow-ball-shadow-shadow-mg 5) +(def-art-elt snow-ball-ag snow-ball-shadow-idle-ja 6) + + diff --git a/goal_src/import/snow-bridge-36-ag.gc b/goal_src/import/snow-bridge-36-ag.gc new file mode 100644 index 0000000000..0518e1d4ba --- /dev/null +++ b/goal_src/import/snow-bridge-36-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; snow-bridge-36-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt snow-bridge-36-ag snow-bridge-36-lod0-jg 0) +(def-art-elt snow-bridge-36-ag snow-bridge-36-lod0-mg 1) +(def-art-elt snow-bridge-36-ag snow-bridge-36-lod1-mg 2) +(def-art-elt snow-bridge-36-ag snow-bridge-36-idle-ja 3) + + diff --git a/goal_src/import/snow-bumper-ag.gc b/goal_src/import/snow-bumper-ag.gc new file mode 100644 index 0000000000..de19726581 --- /dev/null +++ b/goal_src/import/snow-bumper-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; snow-bumper-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt snow-bumper-ag snow-bumper-lod0-jg 0) +(def-art-elt snow-bumper-ag snow-bumper-lod0-mg 1) +(def-art-elt snow-bumper-ag snow-bumper-lod1-mg 2) +(def-art-elt snow-bumper-ag snow-bumper-idle-ja 3) +(def-art-elt snow-bumper-ag snow-bumper-button-ja 4) +(def-art-elt snow-bumper-ag snow-bumper-collapse-ja 5) + + diff --git a/goal_src/import/snow-bunny-ag.gc b/goal_src/import/snow-bunny-ag.gc new file mode 100644 index 0000000000..b4e422a8c5 --- /dev/null +++ b/goal_src/import/snow-bunny-ag.gc @@ -0,0 +1,20 @@ +;;-*-Lisp-*- +(in-package goal) + +;; snow-bunny-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt snow-bunny-ag snow-bunny-lod0-jg 0) +(def-art-elt snow-bunny-ag snow-bunny-lod0-mg 1) +(def-art-elt snow-bunny-ag snow-bunny-lod1-mg 2) +(def-art-elt snow-bunny-ag snow-bunny-lod2-mg 3) +(def-art-elt snow-bunny-ag snow-bunny-shadow-mg 4) +(def-art-elt snow-bunny-ag snow-bunny-idle-ja 5) +(def-art-elt snow-bunny-ag snow-bunny-attack-ja 6) +(def-art-elt snow-bunny-ag snow-bunny-big-hop-ja 7) +(def-art-elt snow-bunny-ag snow-bunny-small-hop-ja 8) +(def-art-elt snow-bunny-ag snow-bunny-sees-player-ja 9) +(def-art-elt snow-bunny-ag snow-bunny-sees-player-land-ja 10) +(def-art-elt snow-bunny-ag snow-bunny-die-ja 11) + + diff --git a/goal_src/import/snow-button-ag.gc b/goal_src/import/snow-button-ag.gc new file mode 100644 index 0000000000..b76cc612c1 --- /dev/null +++ b/goal_src/import/snow-button-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; snow-button-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt snow-button-ag snow-button-lod0-jg 0) +(def-art-elt snow-button-ag snow-button-lod0-mg 1) +(def-art-elt snow-button-ag snow-button-going-down-ja 2) +(def-art-elt snow-button-ag snow-button-going-up-ja 3) + + diff --git a/goal_src/import/snow-eggtop-ag.gc b/goal_src/import/snow-eggtop-ag.gc new file mode 100644 index 0000000000..60428d6ea8 --- /dev/null +++ b/goal_src/import/snow-eggtop-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; snow-eggtop-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt snow-eggtop-ag snow-eggtop-lod0-jg 0) +(def-art-elt snow-eggtop-ag snow-eggtop-lod0-mg 1) +(def-art-elt snow-eggtop-ag snow-eggtop-idle-ja 2) + + diff --git a/goal_src/import/snow-fort-gate-ag.gc b/goal_src/import/snow-fort-gate-ag.gc new file mode 100644 index 0000000000..07e23bed07 --- /dev/null +++ b/goal_src/import/snow-fort-gate-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; snow-fort-gate-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt snow-fort-gate-ag snow-fort-gate-lod0-jg 0) +(def-art-elt snow-fort-gate-ag snow-fort-gate-lod0-mg 1) +(def-art-elt snow-fort-gate-ag snow-fort-gate-idle-ja 2) + + diff --git a/goal_src/import/snow-gears-ag.gc b/goal_src/import/snow-gears-ag.gc new file mode 100644 index 0000000000..da04b34fa1 --- /dev/null +++ b/goal_src/import/snow-gears-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; snow-gears-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt snow-gears-ag snow-gears-lod0-jg 0) +(def-art-elt snow-gears-ag snow-gears-lod0-mg 1) +(def-art-elt snow-gears-ag snow-gears-idle-ja 2) +(def-art-elt snow-gears-ag snow-gears-start-ja 3) +(def-art-elt snow-gears-ag snow-gears-loop-ja 4) +(def-art-elt snow-gears-ag snow-gears-stop-ja 5) + + diff --git a/goal_src/import/snow-log-ag.gc b/goal_src/import/snow-log-ag.gc new file mode 100644 index 0000000000..8beeac508c --- /dev/null +++ b/goal_src/import/snow-log-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; snow-log-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt snow-log-ag snow-log-lod0-jg 0) +(def-art-elt snow-log-ag snow-log-lod0-mg 1) +(def-art-elt snow-log-ag snow-log-activate-ja 2) +(def-art-elt snow-log-ag snow-log-active-loop-ja 3) + + diff --git a/goal_src/import/snow-spatula-ag.gc b/goal_src/import/snow-spatula-ag.gc new file mode 100644 index 0000000000..358e5f3fd1 --- /dev/null +++ b/goal_src/import/snow-spatula-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; snow-spatula-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt snow-spatula-ag snow-spatula-lod0-jg 0) +(def-art-elt snow-spatula-ag snow-spatula-lod0-mg 1) +(def-art-elt snow-spatula-ag snow-spatula-idle-ja 2) + + diff --git a/goal_src/import/snow-switch-ag.gc b/goal_src/import/snow-switch-ag.gc new file mode 100644 index 0000000000..7a9673c28e --- /dev/null +++ b/goal_src/import/snow-switch-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; snow-switch-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt snow-switch-ag snow-switch-lod0-jg 0) +(def-art-elt snow-switch-ag snow-switch-lod0-mg 1) +(def-art-elt snow-switch-ag snow-switch-idle-ja 2) + + diff --git a/goal_src/import/snowcam-ag.gc b/goal_src/import/snowcam-ag.gc new file mode 100644 index 0000000000..8304c3cd68 --- /dev/null +++ b/goal_src/import/snowcam-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; snowcam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt snowcam-ag snowcam-lod0-jg 0) +(def-art-elt snowcam-ag snowcam-lod0-mg 1) +(def-art-elt snowcam-ag snowcam-gearstart-ja 2) +(def-art-elt snowcam-ag snowcam-gate-ja 3) +(def-art-elt snowcam-ag snowcam-gearend-ja 4) +(def-art-elt snowcam-ag snowcam-eggtop-activating-ja 5) +(def-art-elt snowcam-ag snowcam-ecovent-activating-ja 6) + + diff --git a/goal_src/import/snowpusher-ag.gc b/goal_src/import/snowpusher-ag.gc new file mode 100644 index 0000000000..af0d6860e6 --- /dev/null +++ b/goal_src/import/snowpusher-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; snowpusher-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt snowpusher-ag snowpusher-lod0-jg 0) +(def-art-elt snowpusher-ag snowpusher-lod0-mg 1) +(def-art-elt snowpusher-ag snowpusher-idle-ja 2) + + diff --git a/goal_src/import/speaker-ag.gc b/goal_src/import/speaker-ag.gc new file mode 100644 index 0000000000..d22349ec71 --- /dev/null +++ b/goal_src/import/speaker-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; speaker-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt speaker-ag speaker-lod0-jg 0) +(def-art-elt speaker-ag speaker-lod0-mg 1) +(def-art-elt speaker-ag speaker-idle-ja 2) + + diff --git a/goal_src/import/spider-egg-ag.gc b/goal_src/import/spider-egg-ag.gc new file mode 100644 index 0000000000..0b97af933b --- /dev/null +++ b/goal_src/import/spider-egg-ag.gc @@ -0,0 +1,22 @@ +;;-*-Lisp-*- +(in-package goal) + +;; spider-egg-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt spider-egg-ag spider-egg-unbroken-lod0-jg 0) +(def-art-elt spider-egg-ag spider-egg-unbroken-lod0-mg 1) +(def-art-elt spider-egg-ag spider-egg-unbroken-lod1-mg 2) +(def-art-elt spider-egg-ag spider-egg-unbroken-lod2-mg 3) +(def-art-elt spider-egg-ag spider-egg-unbroken-shadow-mg 4) +(def-art-elt spider-egg-ag spider-egg-broken-lod0-jg 5) +(def-art-elt spider-egg-ag spider-egg-broken-lod0-mg 6) +(def-art-elt spider-egg-ag spider-egg-broken-lod1-mg 7) +(def-art-elt spider-egg-ag spider-egg-broken-lod2-mg 8) +(def-art-elt spider-egg-ag spider-egg-idle-ja 9) +(def-art-elt spider-egg-ag spider-egg-crack-ja 10) +(def-art-elt spider-egg-ag spider-egg-bounce-ja 11) +(def-art-elt spider-egg-ag spider-egg-die-ja 12) +(def-art-elt spider-egg-ag spider-egg-twitch-ja 13) + + diff --git a/goal_src/import/spiderwebs-ag.gc b/goal_src/import/spiderwebs-ag.gc new file mode 100644 index 0000000000..a6e95e15ea --- /dev/null +++ b/goal_src/import/spiderwebs-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; spiderwebs-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt spiderwebs-ag spiderwebs-good-lod0-jg 0) +(def-art-elt spiderwebs-ag spiderwebs-good-lod0-mg 1) +(def-art-elt spiderwebs-ag spiderwebs-bounce-ja 2) + + diff --git a/goal_src/import/spike-ag.gc b/goal_src/import/spike-ag.gc new file mode 100644 index 0000000000..c11e9f1294 --- /dev/null +++ b/goal_src/import/spike-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; spike-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt spike-ag spike-lod0-jg 0) +(def-art-elt spike-ag spike-lod0-mg 1) +(def-art-elt spike-ag spike-lod1-mg 2) +(def-art-elt spike-ag spike-idle-ja 3) + + diff --git a/goal_src/import/square-platform-ag.gc b/goal_src/import/square-platform-ag.gc new file mode 100644 index 0000000000..aa1a1da6f3 --- /dev/null +++ b/goal_src/import/square-platform-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; square-platform-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt square-platform-ag square-platform-lod0-jg 0) +(def-art-elt square-platform-ag square-platform-lod0-mg 1) +(def-art-elt square-platform-ag square-platform-lod1-mg 2) +(def-art-elt square-platform-ag square-platform-idle-ja 3) + + diff --git a/goal_src/import/steam-cap-ag.gc b/goal_src/import/steam-cap-ag.gc new file mode 100644 index 0000000000..926777ad51 --- /dev/null +++ b/goal_src/import/steam-cap-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; steam-cap-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt steam-cap-ag steam-cap-lod0-jg 0) +(def-art-elt steam-cap-ag steam-cap-lod0-mg 1) +(def-art-elt steam-cap-ag steam-cap-idle-ja 2) + + diff --git a/goal_src/import/sun-iris-door-ag.gc b/goal_src/import/sun-iris-door-ag.gc new file mode 100644 index 0000000000..c8cb6e563c --- /dev/null +++ b/goal_src/import/sun-iris-door-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sun-iris-door-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sun-iris-door-ag sun-iris-door-lod0-jg 0) +(def-art-elt sun-iris-door-ag sun-iris-door-lod0-mg 1) +(def-art-elt sun-iris-door-ag sun-iris-door-lod1-mg 2) +(def-art-elt sun-iris-door-ag sun-iris-door-idle-ja 3) + + diff --git a/goal_src/import/sunken-elevator-ag.gc b/goal_src/import/sunken-elevator-ag.gc new file mode 100644 index 0000000000..a53a9ff197 --- /dev/null +++ b/goal_src/import/sunken-elevator-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sunken-elevator-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sunken-elevator-ag sunken-elevator-lod0-jg 0) +(def-art-elt sunken-elevator-ag sunken-elevator-lod0-mg 1) +(def-art-elt sunken-elevator-ag sunken-elevator-pressed-ja 2) + + diff --git a/goal_src/import/sunkencam-ag.gc b/goal_src/import/sunkencam-ag.gc new file mode 100644 index 0000000000..256d2cb708 --- /dev/null +++ b/goal_src/import/sunkencam-ag.gc @@ -0,0 +1,30 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sunkencam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sunkencam-ag sunkencam-lod0-jg 0) +(def-art-elt sunkencam-ag sunkencam-lod0-mg 1) +(def-art-elt sunkencam-ag sunkencam-qbert-show-door-open-ja 2) +(def-art-elt sunkencam-ag sunkencam-qbert-show-door-close-ja 3) +(def-art-elt sunkencam-ag sunkencam-exit-chamber-door-open-ja 4) +(def-art-elt sunkencam-ag sunkencam-start-door-shut-ja 5) +(def-art-elt sunkencam-ag sunkencam-start-in-room-ja 6) +(def-art-elt sunkencam-ag sunkencam-middle-in-water-ja 7) +(def-art-elt sunkencam-ag sunkencam-end-out-of-water-ja 8) +(def-art-elt sunkencam-ag sunkencam-dive-start-ja 9) +(def-art-elt sunkencam-ag sunkencam-dive-middle-ja 10) +(def-art-elt sunkencam-ag sunkencam-dive-end-ja 11) +(def-art-elt sunkencam-ag sunkencam-square-platform-setup1-rise1-ja 12) +(def-art-elt sunkencam-ag sunkencam-square-platform-setup1-rise2-ja 13) +(def-art-elt sunkencam-ag sunkencam-square-platform-setup2-rise1-ja 14) +(def-art-elt sunkencam-ag sunkencam-square-platform-setup2-rise2-ja 15) +(def-art-elt sunkencam-ag sunkencam-helix-hit-switch-ja 16) +(def-art-elt sunkencam-ag sunkencam-helix-door-shuts-ja 17) +(def-art-elt sunkencam-ag sunkencam-helix-show-rising-water-ja 18) +(def-art-elt sunkencam-ag sunkencam-pipegame-left-ja 19) +(def-art-elt sunkencam-ag sunkencam-pipegame-middle-ja 20) +(def-art-elt sunkencam-ag sunkencam-pipegame-right-ja 21) + + diff --git a/goal_src/import/sunkenfisha-ag.gc b/goal_src/import/sunkenfisha-ag.gc new file mode 100644 index 0000000000..7e94adc289 --- /dev/null +++ b/goal_src/import/sunkenfisha-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; sunkenfisha-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt sunkenfisha-ag sunkenfisha-red-yellow-lod0-jg 0) +(def-art-elt sunkenfisha-ag sunkenfisha-red-yellow-lod0-mg 1) +(def-art-elt sunkenfisha-ag sunkenfisha-yellow-blue-lod0-jg 2) +(def-art-elt sunkenfisha-ag sunkenfisha-yellow-blue-lod0-mg 3) +(def-art-elt sunkenfisha-ag sunkenfisha-yellow-eye-lod0-jg 4) +(def-art-elt sunkenfisha-ag sunkenfisha-yellow-eye-lod0-mg 5) +(def-art-elt sunkenfisha-ag sunkenfisha-idle-ja 6) + + diff --git a/goal_src/import/swamp-bat-ag.gc b/goal_src/import/swamp-bat-ag.gc new file mode 100644 index 0000000000..1e822a6df0 --- /dev/null +++ b/goal_src/import/swamp-bat-ag.gc @@ -0,0 +1,18 @@ +;;-*-Lisp-*- +(in-package goal) + +;; swamp-bat-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt swamp-bat-ag swamp-bat-lod0-jg 0) +(def-art-elt swamp-bat-ag swamp-bat-lod0-mg 1) +(def-art-elt swamp-bat-ag swamp-bat-lod1-mg 2) +(def-art-elt swamp-bat-ag swamp-bat-lod2-mg 3) +(def-art-elt swamp-bat-ag swamp-bat-idle-ja 4) +(def-art-elt swamp-bat-ag swamp-bat-notice-ja 5) +(def-art-elt swamp-bat-ag swamp-bat-swoop-ja 6) +(def-art-elt swamp-bat-ag swamp-bat-strafe-ja 7) +(def-art-elt swamp-bat-ag swamp-bat-die-ja 8) +(def-art-elt swamp-bat-ag swamp-bat-strafe-to-idle-ja 9) + + diff --git a/goal_src/import/swamp-blimp-ag.gc b/goal_src/import/swamp-blimp-ag.gc new file mode 100644 index 0000000000..46eee11a90 --- /dev/null +++ b/goal_src/import/swamp-blimp-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; swamp-blimp-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt swamp-blimp-ag swamp-blimp-lod0-jg 0) +(def-art-elt swamp-blimp-ag swamp-blimp-lod0-mg 1) +(def-art-elt swamp-blimp-ag swamp-blimp-lod1-mg 2) +(def-art-elt swamp-blimp-ag swamp-blimp-idle-ja 3) + + diff --git a/goal_src/import/swamp-rat-ag.gc b/goal_src/import/swamp-rat-ag.gc new file mode 100644 index 0000000000..fec5d0fd8e --- /dev/null +++ b/goal_src/import/swamp-rat-ag.gc @@ -0,0 +1,21 @@ +;;-*-Lisp-*- +(in-package goal) + +;; swamp-rat-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt swamp-rat-ag swamp-rat-lod0-jg 0) +(def-art-elt swamp-rat-ag swamp-rat-lod0-mg 1) +(def-art-elt swamp-rat-ag swamp-rat-lod1-mg 2) +(def-art-elt swamp-rat-ag swamp-rat-lod2-mg 3) +(def-art-elt swamp-rat-ag swamp-rat-idle-ja 4) +(def-art-elt swamp-rat-ag swamp-rat-fall-ja 5) +(def-art-elt swamp-rat-ag swamp-rat-bounce-ja 6) +(def-art-elt swamp-rat-ag swamp-rat-walk-ja 7) +(def-art-elt swamp-rat-ag swamp-rat-notice-ja 8) +(def-art-elt swamp-rat-ag swamp-rat-run-ja 9) +(def-art-elt swamp-rat-ag swamp-rat-celebrate-ja 10) +(def-art-elt swamp-rat-ag swamp-rat-die-ja 11) +(def-art-elt swamp-rat-ag swamp-rat-eat-ja 12) + + diff --git a/goal_src/import/swamp-rat-nest-ag.gc b/goal_src/import/swamp-rat-nest-ag.gc new file mode 100644 index 0000000000..a42d2f84fa --- /dev/null +++ b/goal_src/import/swamp-rat-nest-ag.gc @@ -0,0 +1,20 @@ +;;-*-Lisp-*- +(in-package goal) + +;; swamp-rat-nest-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt swamp-rat-nest-ag swamp-rat-nest-a-lod0-jg 0) +(def-art-elt swamp-rat-nest-ag swamp-rat-nest-a-lod0-mg 1) +(def-art-elt swamp-rat-nest-ag swamp-rat-nest-a-lod1-mg 2) +(def-art-elt swamp-rat-nest-ag swamp-rat-nest-a-idle-ja 3) +(def-art-elt swamp-rat-nest-ag swamp-rat-nest-b-lod0-jg 4) +(def-art-elt swamp-rat-nest-ag swamp-rat-nest-b-lod0-mg 5) +(def-art-elt swamp-rat-nest-ag swamp-rat-nest-b-lod1-mg 6) +(def-art-elt swamp-rat-nest-ag swamp-rat-nest-b-idle-ja 7) +(def-art-elt swamp-rat-nest-ag swamp-rat-nest-c-lod0-jg 8) +(def-art-elt swamp-rat-nest-ag swamp-rat-nest-c-lod0-mg 9) +(def-art-elt swamp-rat-nest-ag swamp-rat-nest-c-lod1-mg 10) +(def-art-elt swamp-rat-nest-ag swamp-rat-nest-c-idle-ja 11) + + diff --git a/goal_src/import/swamp-rock-ag.gc b/goal_src/import/swamp-rock-ag.gc new file mode 100644 index 0000000000..87b92c1d14 --- /dev/null +++ b/goal_src/import/swamp-rock-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; swamp-rock-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt swamp-rock-ag swamp-rock-lod0-jg 0) +(def-art-elt swamp-rock-ag swamp-rock-lod0-mg 1) +(def-art-elt swamp-rock-ag swamp-rock-idle-ja 2) + + diff --git a/goal_src/import/swamp-rope-ag.gc b/goal_src/import/swamp-rope-ag.gc new file mode 100644 index 0000000000..0781443122 --- /dev/null +++ b/goal_src/import/swamp-rope-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; swamp-rope-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt swamp-rope-ag swamp-rope-lod0-jg 0) +(def-art-elt swamp-rope-ag swamp-rope-lod0-mg 1) +(def-art-elt swamp-rope-ag swamp-rope-idle-ja 2) +(def-art-elt swamp-rope-ag swamp-rope-slack-ja 3) +(def-art-elt swamp-rope-ag swamp-rope-swing-ja 4) + + diff --git a/goal_src/import/swamp-spike-ag.gc b/goal_src/import/swamp-spike-ag.gc new file mode 100644 index 0000000000..753b1f2815 --- /dev/null +++ b/goal_src/import/swamp-spike-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; swamp-spike-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt swamp-spike-ag swamp-spike-lod0-jg 0) +(def-art-elt swamp-spike-ag swamp-spike-lod0-mg 1) +(def-art-elt swamp-spike-ag swamp-spike-lod1-mg 2) +(def-art-elt swamp-spike-ag swamp-spike-up-ja 3) +(def-art-elt swamp-spike-ag swamp-spike-down-ja 4) +(def-art-elt swamp-spike-ag swamp-spike-shake-ja 5) + + diff --git a/goal_src/import/swamp-tetherrock-ag.gc b/goal_src/import/swamp-tetherrock-ag.gc new file mode 100644 index 0000000000..bfb46306b6 --- /dev/null +++ b/goal_src/import/swamp-tetherrock-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; swamp-tetherrock-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt swamp-tetherrock-ag swamp-tetherrock-lod0-jg 0) +(def-art-elt swamp-tetherrock-ag swamp-tetherrock-lod0-mg 1) +(def-art-elt swamp-tetherrock-ag swamp-tetherrock-idle-ja 2) + + diff --git a/goal_src/import/swamp-tetherrock-explode-ag.gc b/goal_src/import/swamp-tetherrock-explode-ag.gc new file mode 100644 index 0000000000..449a6b5b58 --- /dev/null +++ b/goal_src/import/swamp-tetherrock-explode-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; swamp-tetherrock-explode-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt swamp-tetherrock-explode-ag swamp-tetherrock-explode-lod0-jg 0) +(def-art-elt swamp-tetherrock-explode-ag swamp-tetherrock-explode-lod0-mg 1) +(def-art-elt swamp-tetherrock-explode-ag swamp-tetherrock-explode-idle-ja 2) +(def-art-elt swamp-tetherrock-explode-ag swamp-tetherrock-explode-explode-ja 3) + + diff --git a/goal_src/import/swampcam-ag.gc b/goal_src/import/swampcam-ag.gc new file mode 100644 index 0000000000..bbe03a7478 --- /dev/null +++ b/goal_src/import/swampcam-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; swampcam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt swampcam-ag swampcam-lod0-jg 0) +(def-art-elt swampcam-ag swampcam-lod0-mg 1) +(def-art-elt swampcam-ag swampcam-anim-ja 2) +(def-art-elt swampcam-ag swampcam-swamp-ambush-ja 3) + + diff --git a/goal_src/import/tar-plat-ag.gc b/goal_src/import/tar-plat-ag.gc new file mode 100644 index 0000000000..aca83877ac --- /dev/null +++ b/goal_src/import/tar-plat-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; tar-plat-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt tar-plat-ag tar-plat-lod0-jg 0) +(def-art-elt tar-plat-ag tar-plat-lod0-mg 1) +(def-art-elt tar-plat-ag tar-plat-lod1-mg 2) +(def-art-elt tar-plat-ag tar-plat-idle-ja 3) + + diff --git a/goal_src/import/teetertotter-ag.gc b/goal_src/import/teetertotter-ag.gc new file mode 100644 index 0000000000..2483720f95 --- /dev/null +++ b/goal_src/import/teetertotter-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; teetertotter-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt teetertotter-ag teetertotter-lod0-jg 0) +(def-art-elt teetertotter-ag teetertotter-lod0-mg 1) +(def-art-elt teetertotter-ag teetertotter-lod1-mg 2) +(def-art-elt teetertotter-ag teetertotter-lod2-mg 3) +(def-art-elt teetertotter-ag teetertotter-idle-ja 4) +(def-art-elt teetertotter-ag teetertotter-landing-ja 5) + + diff --git a/goal_src/import/tntbarrel-ag.gc b/goal_src/import/tntbarrel-ag.gc new file mode 100644 index 0000000000..82923921a7 --- /dev/null +++ b/goal_src/import/tntbarrel-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; tntbarrel-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt tntbarrel-ag tntbarrel-lod0-jg 0) +(def-art-elt tntbarrel-ag tntbarrel-lod0-mg 1) +(def-art-elt tntbarrel-ag tntbarrel-idle-ja 2) + + diff --git a/goal_src/import/towertop-ag.gc b/goal_src/import/towertop-ag.gc new file mode 100644 index 0000000000..5169fd2aa6 --- /dev/null +++ b/goal_src/import/towertop-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; towertop-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt towertop-ag towertop-lod0-jg 0) +(def-art-elt towertop-ag towertop-lod0-mg 1) +(def-art-elt towertop-ag towertop-lod1-mg 2) +(def-art-elt towertop-ag towertop-lod2-mg 3) +(def-art-elt towertop-ag towertop-idle-ja 4) + + diff --git a/goal_src/import/trainingcam-ag.gc b/goal_src/import/trainingcam-ag.gc new file mode 100644 index 0000000000..e860cbc05e --- /dev/null +++ b/goal_src/import/trainingcam-ag.gc @@ -0,0 +1,16 @@ +;;-*-Lisp-*- +(in-package goal) + +;; trainingcam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt trainingcam-ag trainingcam-lod0-jg 0) +(def-art-elt trainingcam-ag trainingcam-lod0-mg 1) +(def-art-elt trainingcam-ag trainingcam-orbcam-ja 2) +(def-art-elt trainingcam-ag trainingcam-fuelcellcam-ja 3) +(def-art-elt trainingcam-ag trainingcam-ecocam-ja 4) +(def-art-elt trainingcam-ag trainingcam-greenecocam-ja 5) +(def-art-elt trainingcam-ag trainingcam-precursordoorcam-ja 6) +(def-art-elt trainingcam-ag trainingcam-ecoventcam-ja 7) + + diff --git a/goal_src/import/vil3-bridge-36-ag.gc b/goal_src/import/vil3-bridge-36-ag.gc new file mode 100644 index 0000000000..b61656d9de --- /dev/null +++ b/goal_src/import/vil3-bridge-36-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; vil3-bridge-36-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt vil3-bridge-36-ag vil3-bridge-36-lod0-jg 0) +(def-art-elt vil3-bridge-36-ag vil3-bridge-36-lod0-mg 1) +(def-art-elt vil3-bridge-36-ag vil3-bridge-36-idle-ja 2) + + diff --git a/goal_src/import/villa-starfish-ag.gc b/goal_src/import/villa-starfish-ag.gc new file mode 100644 index 0000000000..3de9839055 --- /dev/null +++ b/goal_src/import/villa-starfish-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; villa-starfish-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt villa-starfish-ag villa-starfish-lod0-jg 0) +(def-art-elt villa-starfish-ag villa-starfish-lod0-mg 1) +(def-art-elt villa-starfish-ag villa-starfish-idle-ja 2) + + diff --git a/goal_src/import/village-cam-ag.gc b/goal_src/import/village-cam-ag.gc new file mode 100644 index 0000000000..8de20b61f2 --- /dev/null +++ b/goal_src/import/village-cam-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; village-cam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt village-cam-ag village-cam-lod0-jg 0) +(def-art-elt village-cam-ag village-cam-lod0-mg 1) +(def-art-elt village-cam-ag village-cam-firecanyon-cam-ja 2) +(def-art-elt village-cam-ag village-cam-firecanyon-alt-cam-ja 3) +(def-art-elt village-cam-ag village-cam-vi2-button-cam-ja 4) +(def-art-elt village-cam-ag village-cam-vi3-button-cam-ja 5) + + diff --git a/goal_src/import/village1cam-ag.gc b/goal_src/import/village1cam-ag.gc new file mode 100644 index 0000000000..c22cce4d34 --- /dev/null +++ b/goal_src/import/village1cam-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; village1cam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt village1cam-ag village1cam-lod0-jg 0) +(def-art-elt village1cam-ag village1cam-lod0-mg 1) +(def-art-elt village1cam-ag village1cam-anim-ja 2) + + diff --git a/goal_src/import/village2cam-ag.gc b/goal_src/import/village2cam-ag.gc new file mode 100644 index 0000000000..a5d1026fa6 --- /dev/null +++ b/goal_src/import/village2cam-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; village2cam-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt village2cam-ag village2cam-lod0-jg 0) +(def-art-elt village2cam-ag village2cam-lod0-mg 1) +(def-art-elt village2cam-ag village2cam-elevator-at-top-going-down-ja 2) +(def-art-elt village2cam-ag village2cam-elevator-at-bottom-going-up-ja 3) +(def-art-elt village2cam-ag village2cam-elevator-at-top-going-up-ja 4) + + diff --git a/goal_src/import/wall-plat-ag.gc b/goal_src/import/wall-plat-ag.gc new file mode 100644 index 0000000000..67dede7b8c --- /dev/null +++ b/goal_src/import/wall-plat-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; wall-plat-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt wall-plat-ag wall-plat-lod0-jg 0) +(def-art-elt wall-plat-ag wall-plat-lod0-mg 1) +(def-art-elt wall-plat-ag wall-plat-idle-ja 2) + + diff --git a/goal_src/import/warp-gate-switch-ag.gc b/goal_src/import/warp-gate-switch-ag.gc new file mode 100644 index 0000000000..ac3b1d758b --- /dev/null +++ b/goal_src/import/warp-gate-switch-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; warp-gate-switch-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt warp-gate-switch-ag warp-gate-switch-lod0-jg 0) +(def-art-elt warp-gate-switch-ag warp-gate-switch-lod0-mg 1) +(def-art-elt warp-gate-switch-ag warp-gate-switch-down-ja 2) + + diff --git a/goal_src/import/warpgate-ag.gc b/goal_src/import/warpgate-ag.gc new file mode 100644 index 0000000000..ebbc16c9bc --- /dev/null +++ b/goal_src/import/warpgate-ag.gc @@ -0,0 +1,10 @@ +;;-*-Lisp-*- +(in-package goal) + +;; warpgate-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt warpgate-ag warpgate-lod0-jg 0) +(def-art-elt warpgate-ag warpgate-lod0-mg 1) + + diff --git a/goal_src/import/warrior-ag.gc b/goal_src/import/warrior-ag.gc new file mode 100644 index 0000000000..301ab1901b --- /dev/null +++ b/goal_src/import/warrior-ag.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; warrior-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt warrior-ag warrior-lod0-jg 0) +(def-art-elt warrior-ag warrior-lod0-mg 1) +(def-art-elt warrior-ag warrior-lod1-mg 2) +(def-art-elt warrior-ag warrior-lod2-mg 3) +(def-art-elt warrior-ag warrior-shadow-mg 4) +(def-art-elt warrior-ag warrior-idle-ja 5) + + diff --git a/goal_src/import/water-anim-darkcave-ag.gc b/goal_src/import/water-anim-darkcave-ag.gc new file mode 100644 index 0000000000..b51898f821 --- /dev/null +++ b/goal_src/import/water-anim-darkcave-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-darkcave-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-darkcave-ag water-anim-darkcave-water-with-crystal-lod0-jg 0) +(def-art-elt water-anim-darkcave-ag water-anim-darkcave-water-with-crystal-lod0-mg 1) +(def-art-elt water-anim-darkcave-ag water-anim-darkcave-idle-ja 2) + + diff --git a/goal_src/import/water-anim-finalboss-ag.gc b/goal_src/import/water-anim-finalboss-ag.gc new file mode 100644 index 0000000000..f5d3c96500 --- /dev/null +++ b/goal_src/import/water-anim-finalboss-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-finalboss-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-finalboss-ag water-anim-finalboss-dark-eco-pool-lod0-jg 0) +(def-art-elt water-anim-finalboss-ag water-anim-finalboss-dark-eco-pool-lod0-mg 1) +(def-art-elt water-anim-finalboss-ag water-anim-finalboss-idle-ja 2) + + diff --git a/goal_src/import/water-anim-jungle-ag.gc b/goal_src/import/water-anim-jungle-ag.gc new file mode 100644 index 0000000000..a85b4f40a8 --- /dev/null +++ b/goal_src/import/water-anim-jungle-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-jungle-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-jungle-ag water-anim-jungle-river-lod0-jg 0) +(def-art-elt water-anim-jungle-ag water-anim-jungle-river-lod0-mg 1) +(def-art-elt water-anim-jungle-ag water-anim-jungle-river-lod1-mg 2) +(def-art-elt water-anim-jungle-ag water-anim-jungle-idle-ja 3) + + diff --git a/goal_src/import/water-anim-lavatube-ag.gc b/goal_src/import/water-anim-lavatube-ag.gc new file mode 100644 index 0000000000..5ca28dc603 --- /dev/null +++ b/goal_src/import/water-anim-lavatube-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-lavatube-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-lavatube-ag water-anim-lavatube-energy-lava-lod0-jg 0) +(def-art-elt water-anim-lavatube-ag water-anim-lavatube-energy-lava-lod0-mg 1) +(def-art-elt water-anim-lavatube-ag water-anim-lavatube-idle-ja 2) + + diff --git a/goal_src/import/water-anim-maincave-ag.gc b/goal_src/import/water-anim-maincave-ag.gc new file mode 100644 index 0000000000..de7648f789 --- /dev/null +++ b/goal_src/import/water-anim-maincave-ag.gc @@ -0,0 +1,19 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-maincave-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-maincave-ag water-anim-maincave-center-pool-lod0-jg 0) +(def-art-elt water-anim-maincave-ag water-anim-maincave-center-pool-lod0-mg 1) +(def-art-elt water-anim-maincave-ag water-anim-maincave-lower-right-pool-lod0-jg 2) +(def-art-elt water-anim-maincave-ag water-anim-maincave-lower-right-pool-lod0-mg 3) +(def-art-elt water-anim-maincave-ag water-anim-maincave-mid-right-pool-lod0-jg 4) +(def-art-elt water-anim-maincave-ag water-anim-maincave-mid-right-pool-lod0-mg 5) +(def-art-elt water-anim-maincave-ag water-anim-maincave-lower-left-pool-lod0-jg 6) +(def-art-elt water-anim-maincave-ag water-anim-maincave-lower-left-pool-lod0-mg 7) +(def-art-elt water-anim-maincave-ag water-anim-maincave-mid-left-pool-lod0-jg 8) +(def-art-elt water-anim-maincave-ag water-anim-maincave-mid-left-pool-lod0-mg 9) +(def-art-elt water-anim-maincave-ag water-anim-maincave-idle-ja 10) + + diff --git a/goal_src/import/water-anim-maincave-water-ag.gc b/goal_src/import/water-anim-maincave-water-ag.gc new file mode 100644 index 0000000000..cf6753ef83 --- /dev/null +++ b/goal_src/import/water-anim-maincave-water-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-maincave-water-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-maincave-water-ag water-anim-maincave-water-with-crystal-lod0-jg 0) +(def-art-elt water-anim-maincave-water-ag water-anim-maincave-water-with-crystal-lod0-mg 1) +(def-art-elt water-anim-maincave-water-ag water-anim-maincave-water-idle-ja 2) + + diff --git a/goal_src/import/water-anim-misty-ag.gc b/goal_src/import/water-anim-misty-ag.gc new file mode 100644 index 0000000000..4c6eb16a7f --- /dev/null +++ b/goal_src/import/water-anim-misty-ag.gc @@ -0,0 +1,33 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-misty-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-misty-ag water-anim-misty-mud-by-arena-lod0-jg 0) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-by-arena-lod0-mg 1) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-above-skeleton-lod0-jg 2) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-above-skeleton-lod0-mg 3) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-behind-skeleton-lod0-jg 4) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-behind-skeleton-lod0-mg 5) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-above-skull-back-lod0-jg 6) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-above-skull-back-lod0-mg 7) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-above-skull-front-lod0-jg 8) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-above-skull-front-lod0-mg 9) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-other-near-skull-lod0-jg 10) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-other-near-skull-lod0-mg 11) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-near-skull-lod0-jg 12) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-near-skull-lod0-mg 13) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-under-spine-lod0-jg 14) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-under-spine-lod0-mg 15) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-by-dock-lod0-jg 16) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-by-dock-lod0-mg 17) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-island-near-dock-lod0-jg 18) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-island-near-dock-lod0-mg 19) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-lonely-island-lod0-jg 20) +(def-art-elt water-anim-misty-ag water-anim-misty-mud-lonely-island-lod0-mg 21) +(def-art-elt water-anim-misty-ag water-anim-misty-dark-eco-pool-lod0-jg 22) +(def-art-elt water-anim-misty-ag water-anim-misty-dark-eco-pool-lod0-mg 23) +(def-art-elt water-anim-misty-ag water-anim-misty-idle-ja 24) + + diff --git a/goal_src/import/water-anim-ogre-ag.gc b/goal_src/import/water-anim-ogre-ag.gc new file mode 100644 index 0000000000..cac77f8114 --- /dev/null +++ b/goal_src/import/water-anim-ogre-ag.gc @@ -0,0 +1,16 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-ogre-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-ogre-ag water-anim-ogre-lava-lod0-jg 0) +(def-art-elt water-anim-ogre-ag water-anim-ogre-lava-lod0-mg 1) +(def-art-elt water-anim-ogre-ag water-anim-ogre-idle-ja 2) +(def-art-elt water-anim-ogre-ag water-anim-ogre-submerge1-ja 3) +(def-art-elt water-anim-ogre-ag water-anim-ogre-emerge1-ja 4) +(def-art-elt water-anim-ogre-ag water-anim-ogre-submerge2-ja 5) +(def-art-elt water-anim-ogre-ag water-anim-ogre-emerge2-ja 6) +(def-art-elt water-anim-ogre-ag water-anim-ogre-boulder-ja 7) + + diff --git a/goal_src/import/water-anim-robocave-ag.gc b/goal_src/import/water-anim-robocave-ag.gc new file mode 100644 index 0000000000..fee13135c0 --- /dev/null +++ b/goal_src/import/water-anim-robocave-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-robocave-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-robocave-ag water-anim-robocave-main-pool-lod0-jg 0) +(def-art-elt water-anim-robocave-ag water-anim-robocave-main-pool-lod0-mg 1) +(def-art-elt water-anim-robocave-ag water-anim-robocave-main-pool-lod1-mg 2) +(def-art-elt water-anim-robocave-ag water-anim-robocave-idle-ja 3) + + diff --git a/goal_src/import/water-anim-rolling-ag.gc b/goal_src/import/water-anim-rolling-ag.gc new file mode 100644 index 0000000000..56efe58295 --- /dev/null +++ b/goal_src/import/water-anim-rolling-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-rolling-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-rolling-ag water-anim-rolling-water-back-lod0-jg 0) +(def-art-elt water-anim-rolling-ag water-anim-rolling-water-back-lod0-mg 1) +(def-art-elt water-anim-rolling-ag water-anim-rolling-water-front-lod0-jg 2) +(def-art-elt water-anim-rolling-ag water-anim-rolling-water-front-lod0-mg 3) +(def-art-elt water-anim-rolling-ag water-anim-rolling-idle-ja 4) + + diff --git a/goal_src/import/water-anim-sunken-ag.gc b/goal_src/import/water-anim-sunken-ag.gc new file mode 100644 index 0000000000..5fee6e1b65 --- /dev/null +++ b/goal_src/import/water-anim-sunken-ag.gc @@ -0,0 +1,33 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-sunken-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-sunken-ag water-anim-sunken-big-room-lod0-jg 0) +(def-art-elt water-anim-sunken-ag water-anim-sunken-big-room-lod0-mg 1) +(def-art-elt water-anim-sunken-ag water-anim-sunken-first-room-from-entrance-lod0-jg 2) +(def-art-elt water-anim-sunken-ag water-anim-sunken-first-room-from-entrance-lod0-mg 3) +(def-art-elt water-anim-sunken-ag water-anim-sunken-qbert-room-lod0-jg 4) +(def-art-elt water-anim-sunken-ag water-anim-sunken-qbert-room-lod0-mg 5) +(def-art-elt water-anim-sunken-ag water-anim-sunken-first-right-branch-lod0-jg 6) +(def-art-elt water-anim-sunken-ag water-anim-sunken-first-right-branch-lod0-mg 7) +(def-art-elt water-anim-sunken-ag water-anim-sunken-circular-with-bullys-lod0-jg 8) +(def-art-elt water-anim-sunken-ag water-anim-sunken-circular-with-bullys-lod0-mg 9) +(def-art-elt water-anim-sunken-ag water-anim-sunken-hall-with-one-whirlpool-lod0-jg 10) +(def-art-elt water-anim-sunken-ag water-anim-sunken-hall-with-one-whirlpool-lod0-mg 11) +(def-art-elt water-anim-sunken-ag water-anim-sunken-hall-with-three-whirlpools-lod0-jg 12) +(def-art-elt water-anim-sunken-ag water-anim-sunken-hall-with-three-whirlpools-lod0-mg 13) +(def-art-elt water-anim-sunken-ag water-anim-sunken-start-of-helix-slide-lod0-jg 14) +(def-art-elt water-anim-sunken-ag water-anim-sunken-start-of-helix-slide-lod0-mg 15) +(def-art-elt water-anim-sunken-ag water-anim-sunken-room-above-exit-chamber-lod0-jg 16) +(def-art-elt water-anim-sunken-ag water-anim-sunken-room-above-exit-chamber-lod0-mg 17) +(def-art-elt water-anim-sunken-ag water-anim-sunken-hall-before-big-room-lod0-jg 18) +(def-art-elt water-anim-sunken-ag water-anim-sunken-hall-before-big-room-lod0-mg 19) +(def-art-elt water-anim-sunken-ag water-anim-sunken-short-piece-lod0-jg 20) +(def-art-elt water-anim-sunken-ag water-anim-sunken-short-piece-lod0-mg 21) +(def-art-elt water-anim-sunken-ag water-anim-sunken-big-room-upper-water-lod0-jg 22) +(def-art-elt water-anim-sunken-ag water-anim-sunken-big-room-upper-water-lod0-mg 23) +(def-art-elt water-anim-sunken-ag water-anim-sunken-idle-ja 24) + + diff --git a/goal_src/import/water-anim-sunken-dark-eco-ag.gc b/goal_src/import/water-anim-sunken-dark-eco-ag.gc new file mode 100644 index 0000000000..28a858c66a --- /dev/null +++ b/goal_src/import/water-anim-sunken-dark-eco-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-sunken-dark-eco-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-sunken-dark-eco-ag water-anim-sunken-dark-eco-qbert-lod0-jg 0) +(def-art-elt water-anim-sunken-dark-eco-ag water-anim-sunken-dark-eco-qbert-lod0-mg 1) +(def-art-elt water-anim-sunken-dark-eco-ag water-anim-sunken-dark-eco-platform-room-lod0-jg 2) +(def-art-elt water-anim-sunken-dark-eco-ag water-anim-sunken-dark-eco-platform-room-lod0-mg 3) +(def-art-elt water-anim-sunken-dark-eco-ag water-anim-sunken-dark-eco-helix-room-lod0-jg 4) +(def-art-elt water-anim-sunken-dark-eco-ag water-anim-sunken-dark-eco-helix-room-lod0-mg 5) +(def-art-elt water-anim-sunken-dark-eco-ag water-anim-sunken-dark-eco-idle-ja 6) + + diff --git a/goal_src/import/water-anim-training-ag.gc b/goal_src/import/water-anim-training-ag.gc new file mode 100644 index 0000000000..21aec87855 --- /dev/null +++ b/goal_src/import/water-anim-training-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-training-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-training-ag water-anim-training-lake-lod0-jg 0) +(def-art-elt water-anim-training-ag water-anim-training-lake-lod0-mg 1) +(def-art-elt water-anim-training-ag water-anim-training-idle-ja 2) + + diff --git a/goal_src/import/water-anim-village1-ag.gc b/goal_src/import/water-anim-village1-ag.gc new file mode 100644 index 0000000000..86ea6f5c7c --- /dev/null +++ b/goal_src/import/water-anim-village1-ag.gc @@ -0,0 +1,17 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-village1-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-village1-ag water-anim-village1-rice-paddy-lod0-jg 0) +(def-art-elt water-anim-village1-ag water-anim-village1-rice-paddy-lod0-mg 1) +(def-art-elt water-anim-village1-ag water-anim-village1-rice-paddy-mid-lod0-jg 2) +(def-art-elt water-anim-village1-ag water-anim-village1-rice-paddy-mid-lod0-mg 3) +(def-art-elt water-anim-village1-ag water-anim-village1-rice-paddy-top-lod0-jg 4) +(def-art-elt water-anim-village1-ag water-anim-village1-rice-paddy-top-lod0-mg 5) +(def-art-elt water-anim-village1-ag water-anim-village1-fountain-lod0-jg 6) +(def-art-elt water-anim-village1-ag water-anim-village1-fountain-lod0-mg 7) +(def-art-elt water-anim-village1-ag water-anim-village1-idle-ja 8) + + diff --git a/goal_src/import/water-anim-village2-ag.gc b/goal_src/import/water-anim-village2-ag.gc new file mode 100644 index 0000000000..030a3b3d04 --- /dev/null +++ b/goal_src/import/water-anim-village2-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-village2-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-village2-ag water-anim-village2-bucket-lod0-jg 0) +(def-art-elt water-anim-village2-ag water-anim-village2-bucket-lod0-mg 1) +(def-art-elt water-anim-village2-ag water-anim-village2-idle-ja 2) + + diff --git a/goal_src/import/water-anim-village3-ag.gc b/goal_src/import/water-anim-village3-ag.gc new file mode 100644 index 0000000000..5c02bd07f9 --- /dev/null +++ b/goal_src/import/water-anim-village3-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; water-anim-village3-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt water-anim-village3-ag water-anim-village3-lava-lod0-jg 0) +(def-art-elt water-anim-village3-ag water-anim-village3-lava-lod0-mg 1) +(def-art-elt water-anim-village3-ag water-anim-village3-lava-lod1-mg 2) +(def-art-elt water-anim-village3-ag water-anim-village3-idle-ja 3) + + diff --git a/goal_src/import/wedge-plat-ag.gc b/goal_src/import/wedge-plat-ag.gc new file mode 100644 index 0000000000..d9c9ace41e --- /dev/null +++ b/goal_src/import/wedge-plat-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; wedge-plat-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt wedge-plat-ag wedge-plat-lod0-jg 0) +(def-art-elt wedge-plat-ag wedge-plat-lod0-mg 1) +(def-art-elt wedge-plat-ag wedge-plat-idle-ja 2) +(def-art-elt wedge-plat-ag wedge-plat-tip-ja 3) + + diff --git a/goal_src/import/wedge-plat-outer-ag.gc b/goal_src/import/wedge-plat-outer-ag.gc new file mode 100644 index 0000000000..d3aff4ec49 --- /dev/null +++ b/goal_src/import/wedge-plat-outer-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; wedge-plat-outer-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt wedge-plat-outer-ag wedge-plat-outer-lod0-jg 0) +(def-art-elt wedge-plat-outer-ag wedge-plat-outer-lod0-mg 1) +(def-art-elt wedge-plat-outer-ag wedge-plat-outer-idle-ja 2) +(def-art-elt wedge-plat-outer-ag wedge-plat-outer-tip-ja 3) + + diff --git a/goal_src/import/wheel-ag.gc b/goal_src/import/wheel-ag.gc new file mode 100644 index 0000000000..b84a86fdaa --- /dev/null +++ b/goal_src/import/wheel-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; wheel-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt wheel-ag wheel-geo-jg 0) +(def-art-elt wheel-ag wheel-geo-mg 1) +(def-art-elt wheel-ag wheel-idle-ja 2) + + diff --git a/goal_src/import/whirlpool-ag.gc b/goal_src/import/whirlpool-ag.gc new file mode 100644 index 0000000000..0f4477055b --- /dev/null +++ b/goal_src/import/whirlpool-ag.gc @@ -0,0 +1,11 @@ +;;-*-Lisp-*- +(in-package goal) + +;; whirlpool-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt whirlpool-ag whirlpool-lod0-jg 0) +(def-art-elt whirlpool-ag whirlpool-lod0-mg 1) +(def-art-elt whirlpool-ag whirlpool-idle-ja 2) + + diff --git a/goal_src/import/windmill-one-ag.gc b/goal_src/import/windmill-one-ag.gc new file mode 100644 index 0000000000..b340324dfd --- /dev/null +++ b/goal_src/import/windmill-one-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; windmill-one-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt windmill-one-ag windmill-one-lod0-jg 0) +(def-art-elt windmill-one-ag windmill-one-lod0-mg 1) +(def-art-elt windmill-one-ag windmill-one-lod1-mg 2) +(def-art-elt windmill-one-ag windmill-one-lod2-mg 3) +(def-art-elt windmill-one-ag windmill-one-idle-ja 4) + + diff --git a/goal_src/import/windmill-sail-ag.gc b/goal_src/import/windmill-sail-ag.gc new file mode 100644 index 0000000000..66bcd182c4 --- /dev/null +++ b/goal_src/import/windmill-sail-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; windmill-sail-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt windmill-sail-ag windmill-sail-lod0-jg 0) +(def-art-elt windmill-sail-ag windmill-sail-lod0-mg 1) +(def-art-elt windmill-sail-ag windmill-sail-lod1-mg 2) +(def-art-elt windmill-sail-ag windmill-sail-lod2-mg 3) +(def-art-elt windmill-sail-ag windmill-sail-idle-ja 4) + + diff --git a/goal_src/import/windspinner-ag.gc b/goal_src/import/windspinner-ag.gc new file mode 100644 index 0000000000..2a9b53eea7 --- /dev/null +++ b/goal_src/import/windspinner-ag.gc @@ -0,0 +1,12 @@ +;;-*-Lisp-*- +(in-package goal) + +;; windspinner-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt windspinner-ag windspinner-lod0-jg 0) +(def-art-elt windspinner-ag windspinner-lod0-mg 1) +(def-art-elt windspinner-ag windspinner-lod1-mg 2) +(def-art-elt windspinner-ag windspinner-idle-ja 3) + + diff --git a/goal_src/import/windturbine-ag.gc b/goal_src/import/windturbine-ag.gc new file mode 100644 index 0000000000..ae65f03eaa --- /dev/null +++ b/goal_src/import/windturbine-ag.gc @@ -0,0 +1,13 @@ +;;-*-Lisp-*- +(in-package goal) + +;; windturbine-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt windturbine-ag windturbine-lod0-jg 0) +(def-art-elt windturbine-ag windturbine-lod0-mg 1) +(def-art-elt windturbine-ag windturbine-lod1-mg 2) +(def-art-elt windturbine-ag windturbine-lod2-mg 3) +(def-art-elt windturbine-ag windturbine-idle-ja 4) + + diff --git a/goal_src/import/yakow-ag.gc b/goal_src/import/yakow-ag.gc new file mode 100644 index 0000000000..ff824eebbb --- /dev/null +++ b/goal_src/import/yakow-ag.gc @@ -0,0 +1,20 @@ +;;-*-Lisp-*- +(in-package goal) + +;; yakow-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt yakow-ag yakow-lod0-jg 0) +(def-art-elt yakow-ag yakow-lod0-mg 1) +(def-art-elt yakow-ag yakow-lod1-mg 2) +(def-art-elt yakow-ag yakow-shadow-mg 3) +(def-art-elt yakow-ag yakow-idle-ja 4) +(def-art-elt yakow-ag yakow-graze-ja 5) +(def-art-elt yakow-ag yakow-walk-ja 6) +(def-art-elt yakow-ag yakow-run-ja 7) +(def-art-elt yakow-ag yakow-kicked-ja 8) +(def-art-elt yakow-ag yakow-walk-right-ja 9) +(def-art-elt yakow-ag yakow-walk-left-ja 10) +(def-art-elt yakow-ag yakow-kicked-in-place-ja 11) + + diff --git a/goal_src/import/yellowsage-ag.gc b/goal_src/import/yellowsage-ag.gc new file mode 100644 index 0000000000..a8c71eebe8 --- /dev/null +++ b/goal_src/import/yellowsage-ag.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; yellowsage-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt yellowsage-ag yellowsage-lod0-jg 0) +(def-art-elt yellowsage-ag yellowsage-lod0-mg 1) +(def-art-elt yellowsage-ag yellowsage-lod1-mg 2) +(def-art-elt yellowsage-ag yellowsage-shadow-mg 3) +(def-art-elt yellowsage-ag yellowsage-yellowsage-idle-ja 4) +(def-art-elt yellowsage-ag yellowsage-yellowsage-attack-start-ja 5) +(def-art-elt yellowsage-ag yellowsage-yellowsage-attack-loop-ja 6) + + diff --git a/goal_src/import/yeti-ag.gc b/goal_src/import/yeti-ag.gc new file mode 100644 index 0000000000..80154de82d --- /dev/null +++ b/goal_src/import/yeti-ag.gc @@ -0,0 +1,21 @@ +;;-*-Lisp-*- +(in-package goal) + +;; yeti-ag.gc - art group OpenGOAL import file +;; THIS FILE IS AUTOMATICALLY GENERATED! + +(def-art-elt yeti-ag yeti-lod0-jg 0) +(def-art-elt yeti-ag yeti-lod0-mg 1) +(def-art-elt yeti-ag yeti-idle-ja 2) +(def-art-elt yeti-ag yeti-walk-ja 3) +(def-art-elt yeti-ag yeti-spot-ja 4) +(def-art-elt yeti-ag yeti-charge-ja 5) +(def-art-elt yeti-ag yeti-give-up-ja 6) +(def-art-elt yeti-ag yeti-give-up-hop-ja 7) +(def-art-elt yeti-ag yeti-win-ja 8) +(def-art-elt yeti-ag yeti-death-ja 9) +(def-art-elt yeti-ag yeti-jump-ja 10) +(def-art-elt yeti-ag yeti-jump-land-ja 11) +(def-art-elt yeti-ag yeti-turn-ja 12) + + diff --git a/goal_src/kernel-defs.gc b/goal_src/kernel-defs.gc index 4ce936e1fd..e5b3e7e067 100644 --- a/goal_src/kernel-defs.gc +++ b/goal_src/kernel-defs.gc @@ -98,7 +98,7 @@ (define-extern new-dynamic-structure (function symbol type int structure)) (define-extern method-set! (function type int object none)) ;; may actually return function. (define-extern link (function pointer pointer int kheap int pointer)) -(define-extern dgo-load (function string kheap int int none)) +(define-extern dgo-load (function string kheap link-flag int none)) (define-extern link-begin (function pointer (pointer uint8) int kheap link-flag int)) (define-extern link-resume (function int)) @@ -276,7 +276,7 @@ (ppointer (pointer process) :offset-assert 24) (self process-tree :offset-assert 28) ) - + (:methods (new (symbol type basic) _type_ 0) (activate (_type_ process-tree basic pointer) process-tree 9) @@ -284,8 +284,8 @@ (init-from-entity! (_type_ entity-actor) none 11) (run-logic? (_type_) symbol 12) (dummy-method () none 13) - ) - + ) + :size-assert #x20 :method-count-assert 14 :no-runtime-type ;; already defined by kscheme. Don't do it again. @@ -296,7 +296,7 @@ ((name symbol :offset 4) (next stack-frame :offset 8) ;; which way does this point? ) - + :size-assert #xc :method-count-assert 9 :flag-assert #x90000000c @@ -312,6 +312,13 @@ (tie3 2) (invalid)) +(defenum pc-collision-mode + (none 0) + (mode 1) + (event 2) + (material 3) + (skip 4)) + (define-extern __read-ee-timer (function uint)) (define-extern __mem-move (function pointer pointer uint none)) (define-extern __send-gfx-dma-chain (function object object none)) @@ -326,21 +333,44 @@ (define-extern pc-pad-input-index-get (function int)) (define-extern pc-pad-input-map-save! (function none)) (define-extern pc-pad-get-mapped-button (function int int int)) +(define-extern pc-get-fullscreen (function symbol)) +(define-extern pc-get-screen-size (function int (pointer int32) (pointer int32) none)) +(define-extern pc-get-screen-rate (function int int)) +(define-extern pc-get-screen-vmode-count (function int)) (define-extern pc-get-os (function symbol)) (define-extern pc-get-window-size (function (pointer int32) (pointer int32) none)) (define-extern pc-get-window-scale (function (pointer float) (pointer float) none)) (define-extern pc-set-window-size (function int int none)) -(define-extern pc-set-letterbox (function int int none)) -(define-extern pc-set-fullscreen (function int int none)) +(define-extern pc-set-fullscreen (function symbol int none)) +(define-extern pc-set-frame-rate (function int none)) +(define-extern pc-set-vsync (function symbol none)) (define-extern pc-renderer-tree-set-lod (function pc-renderer-tree-type int none)) +(define-extern pc-set-letterbox (function int int none)) +(define-extern pc-set-collision (function symbol none)) +(define-extern pc-set-collision-wireframe (function symbol none)) +(define-extern pc-get-collision-mask (function pc-collision-mode int symbol)) +(define-extern pc-set-collision-mask (function pc-collision-mode int symbol none)) +(define-extern pc-set-collision-mode (function pc-collision-mode none)) (define-extern pc-discord-rpc-update (function discord-info none)) (define-extern pc-discord-rpc-set (function int none)) (define-extern pc-filepath-exists? (function string symbol)) (define-extern pc-mkdir-file-path (function string none)) +(define-extern pc-sound-set-flava-hack (function int none)) +(define-extern pc-sound-set-fade-hack (function int none)) +(define-extern pc-set-window-lock (function symbol none)) + +(defenum pc-prof-event + (begin 0) + (end 1) + (instant 2) + ) + +(define-extern pc-prof (function string pc-prof-event none)) ;; Constants generated within the C++ runtime (define-extern *pc-user-dir-base-path* string) (define-extern *pc-settings-folder* string) +(define-extern *pc-settings-built-sha* string) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; vm functions diff --git a/goal_src/kernel/gcommon.gc b/goal_src/kernel/gcommon.gc index 4bc63263d7..186e8a1c3a 100644 --- a/goal_src/kernel/gcommon.gc +++ b/goal_src/kernel/gcommon.gc @@ -24,6 +24,37 @@ ;; are monitored in the runtime for debugging. (defglobalconstant USE_VM #t) +;; enables the with-profiler statements, which send profiling data from +;; GOAL code to the frame profiler in C++. +(defglobalconstant PC_PROFILER_ENABLE #t) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GOAL language constants +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; distance from a symbol pointer to a (pointer string) +;; this relies on the memory layout of the symbol table +;; this must match SYM_INFO_OFFSET in goal_constants.h + offset of the str field in struct SymUpper. +(defconstant SYM_TO_STRING_OFFSET #x20000) ;; changed from #xff38 + +;; pointers larger than this are invalid by valid? +(defconstant END_OF_MEMORY #x8000000) + +;; GOAL boxed offsets use the lower three bits to indicate if they are +;; an integer (binteger), a pair, or a strucutre with type info (basic) +(defconstant BINTEGER_OFFSET 0) +(defconstant PAIR_OFFSET 2) +(defconstant BASIC_OFFSET 4) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Macros +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defmacro symbol->string (sym) + "Convert a symbol to a goal string." + `(-> (the-as (pointer string) (+ SYM_TO_STRING_OFFSET (the-as int ,sym)))) + ) + (defmacro get-vm-ptr (ptr) "Turn an EE register address into a valid PS2 VM address" `(#cond @@ -36,52 +67,13 @@ ) ) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; GOAL language constants -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; GOAL built-in method IDs -(defconstant NEW_METHOD_ID 0) -(defconstant DELETE_METHOD_ID 1) -(defconstant PRINT_METHOD_ID 2) -(defconstant INSPECT_METHOD_ID 3) -(defconstant LENGTH_METHOD_ID 4) -(defconstant ASIZE_METHOD_ID 5) -(defconstant COPY_METHOD_ID 6) -(defconstant RELOC_METHOD_ID 7) ;; or login? -(defconstant MEM_USAGE_METHOD_ID 8) - -;; distance from a symbol pointer to a (pointer string) -;; this relies on the memory layout of the symbol table -;; this must match SYM_INFO_OFFSET in goal_constants.h + offset of the str field in struct SymUpper. -(defconstant SYM_TO_STRING_OFFSET #xff38) - -;; pointers larger than this are invalid by valid? -(defconstant END_OF_MEMORY #x8000000) - -;; GOAL boxed offsets use the lower three bits to indicate if they are -;; an integer (binteger), a pair, or a strucutre with type info (basic) -(defconstant BINTEGER_OFFSET 0) -(defconstant PAIR_OFFSET 2) -(defconstant BASIC_OFFSET 4) - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; GOAL language macros -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defmacro symbol->string (sym) - "Convert a symbol to a goal string." - `(-> (the-as (pointer string) (+ SYM_TO_STRING_OFFSET (the-as int ,sym)))) - ) - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Function versions of built-in forms ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; basic operations like +, - are handled by the compiler. ;; these provide actual functions that wrap these common operations. +;; this allows you to use them as actual function objects (defun identity ((x object)) "Function which returns its input. The first function of the game! @@ -119,7 +111,7 @@ ) (defun ash ((value int) (shift-amount int)) - "Arithmetic shift value by shift-amount. + "Arithmetic shift value by shift-amount. A positive shift-amount will shift to the left and a negative will shift to the right. " ;; OpenGOAL does not support ash in the compiler, so we implement it here as an inline function. @@ -133,26 +125,24 @@ (defun mod ((a int) (b int)) "Compute mod. It does what you expect for positive numbers. For negative numbers, nobody knows what to expect. This is a 32-bit operation. It uses an idiv on x86 and gets the remainder." - + ;; The original implementation is div, mfhi - ;; todo - verify this is exactly the same as the PS2. (mod a b) ) (defun rem ((a int) (b int)) "Compute remainder (32-bit). It is identical to mod. It uses a idiv and gets the remainder" - + ;; The original implementation is div, mfhi - ;; todo - verify this is exactly the same as the PS2. (mod a b) ) (defun abs ((a int)) "Take the absolute value of an integer" - + (declare (inline)) - + ;; OpenGOAL doesn't support abs, so we implement it here. (if (> a 0) ;; condition is "a > 0" a ;; true case, return a @@ -162,7 +152,7 @@ (defun min ((a int) (b int)) "Compute minimum." - + ;; The original implementation was inline assembly, to take advantage of branch delay slots: ;; (or v0 a0 r0) ;; move first arg to output (case of second arg being min) ;; (or v1 a1 r0) ;; move second arg to v1 (likely strange coloring) @@ -287,6 +277,7 @@ (the-as uint result) ) ) + ;; A "boxed float" type. Simply a float with type information. (deftype bfloat (basic) ((data float :offset-assert 4)) @@ -307,7 +298,7 @@ (defmethod asize-of type ((obj type)) "Get the size in memory of a type" - ;; The 28 is 8 bytes too large. It's also strange that types have a 16-byte aligned size always, + ;; The 28 is 8 bytes too large. It's also strange that types have a 16-byte aligned size always, ;; but this matches what the runtime does as well. There's no reason that I can see for this, ;; as other basics don't require 16-byte aligned sizes. ;; - maybe the 16-byte aligned size was a requirement if types were stored in the symbol table? @@ -486,7 +477,7 @@ ) (defun nassoc ((item-name string) (alist object)) - "Is there an entry named item-name in the association list alist? + "Is there an entry named item-name in the association list alist? Checks name with nmember or name= so you can have multiple keys. Returns the ([key|(key..)] . value) pair." (while (not (or (null? alist) @@ -661,7 +652,7 @@ ;; This is used as base class for boxed inline arrays. ;; The heap-base of the _type_ object will be used to store the stride ;; This way, you don't pay the price of storing the stride in each object. -;; however, 250k lines in, we haven't seen anything actually use this... +;; however, as far as we've seen, nothing actually reads the stride. (deftype inline-array-class (basic) ((length int32 :offset-assert 4) @@ -670,9 +661,9 @@ ;; children of inline-array-class should define their own data which overlays this one. (_data uint8 :dynamic :offset 16) ) - + (:methods (new (symbol type int) _type_ 0)) - + :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 @@ -760,7 +751,7 @@ (format #t "#(") (cond ((type-type? (-> obj content-type) integer) - (case (-> obj content-type symbol) + (case (-> obj content-type symbol) (('int32) (dotimes (s5-0 (-> obj length)) (format #t (if (zero? s5-0) @@ -884,7 +875,6 @@ obj ) -;; definition for method of type array (defmethod inspect array ((obj array)) "Inspect an array" (format #t "[~8x] ~A~%" obj (-> obj type)) @@ -894,7 +884,7 @@ (format #t "~Tdata[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj data)) (cond ((type-type? (-> obj content-type) integer) - (case (-> obj content-type symbol) + (case (-> obj content-type symbol) (('int32) (dotimes (s5-0 (-> obj length)) (format #t "~T [~D] ~D~%" s5-0 (-> (the-as (array int32) obj) s5-0)) @@ -1100,7 +1090,10 @@ ) (defmacro printl (obj) - "Print out a boxed object and a newline" + "Print out a boxed object and a newline. + Note: we define both a macro and a function on purpose. + The compiler will use the macro over the function, which will + allow it to pick the correct print method for non-boxed objects" `(begin (print ,obj) (format #t "~%") @@ -1425,3 +1418,51 @@ (defmacro empty-form () `(none) ) + +;;;;;;;;;;;;;;;;;;;; +;; Profiler Macros +;;;;;;;;;;;;;;;;;;;; + + +(defmacro profiler-instant-event (name) + "Record an 'instant' event in the profile. + This can be used however you'd like, but there should be a + 'ROOT' event logged every now and then (like once per frame) + when no timed events are in progress, to allow the profiler + to correctly recover the event stack." + `(#when PC_PROFILER_ENABLE + (pc-prof ,name (pc-prof-event instant)) + ) + ) + +(defmacro profiler-start-event (name) + "Start a timed event with the given name." + `(#when PC_PROFILER_ENABLE + (pc-prof ,name (pc-prof-event begin)) + ) + ) + +(defmacro profiler-end-event () + "End the most recently started event that hasn't been stopped yet. + It is up to you to correctly balance the starts/ends, otherwise + the profiling data will be corrupted." + `(#when PC_PROFILER_ENABLE + (pc-prof "" (pc-prof-event end)) + ) + ) + +(defmacro with-profiler (name &rest body) + "Execute the body in a named profiler block. + Do not `return` or `go` from inside this block, + otherwise the end will be skipped." + `(#if PC_PROFILER_ENABLE + (begin + (pc-prof ,name (pc-prof-event begin)) + ,@body + (pc-prof ,name (pc-prof-event end)) + ) + (begin + ,@body + ) + ) + ) \ No newline at end of file diff --git a/goal_src/kernel/gkernel-h.gc b/goal_src/kernel/gkernel-h.gc index 2a4f604430..f4372ebfb9 100644 --- a/goal_src/kernel/gkernel-h.gc +++ b/goal_src/kernel/gkernel-h.gc @@ -5,19 +5,27 @@ ;; name in dgo: gkernel-h ;; dgos: KERNEL -;; Type definitions and constants for the GOAL Kernel and process pools. -;; The kernel is dispatched from a simple loop in C and runs all GOAL processes. +;; Type definitions and constants for the GOAL Kernel. The GOAL kernel is dipatched +;; from C++ through the *kernel-dispatcher* and is responsible for: +;; - running all GOAL code +;; - handling creation, destruction, and compaction of GOAL processes +;; - managing GOAL threads and the "suspend" keyword +;; - handling stack frames, nonlocal throws used by the state system +;; - process handles. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; CONSTANTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -hardware- - +;; if set, will attempt to detect memory corruption and stack overflow bugs +;; to some extent. (defglobalconstant KERNEL_DEBUG #t) -;; the end of the 16 kB fast "scratchpad" memory of the PS2. -;; this memory is mapped to 0x70000000 in the PS2. +;; -hardware + +;; processes can execute using the scratchpad as their stack to get better +;; performance. The scratchpad address is #x70000000 to #x70004000 on PS2. +;; On PC, we'll detect the use of the scratchpad within gkernel.gc and move it elsewhere. (defconstant *scratch-memory-top* (the pointer #x70004000)) ;; -versions- @@ -34,11 +42,15 @@ ;; -memory- -;; the size of the execution stack (14 kB) shared by all threads -;; OpenGOAL NOTE: increased to 32kB +;; in GOAL threads, to save memory, each thread owns a tiny stack to store +;; the stack when suspended, and copies it to and from a larger stack for execution. +;; Attempting to suspend a thread in a deep callstack will fail because the tiny stack won't have +;; enough room. But this strategy saves memory in the end. + +;; the size of the single large "DRAM" execution stack (14 kB increased to 32 kB in PC) (defconstant DPROCESS_STACK_SIZE #x8000) -;; another stack size used as a maximum for temporary threads +;; the size of the execution stack, if not using the big DRAM stack. ;; OpenGOAL NOTE: 7kB -> 24kB (defconstant PROCESS_STACK_SIZE (#if PC_PORT #x6000 #x1c00)) @@ -64,36 +76,40 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bitfield enum to indicate properties about a process-tree +;; Some of these bits are used by the kernel for book-keeping, but others +;; can be set by the user to prevent a process from running in certain conditions. + (defenum process-mask :bitfield #t :type uint32 - (execute 0) ;; 1 ?, prevents from running - (draw 1) ;; 2 ? - (pause 2) ;; 4 shouldn't run when game is paused - (menu 3) ;; 8 shouldn't run when debug menu open - (progress 4) ;; 16 shouldn't run when progress menu open - (actor-pause 5) ;; 32 ?, related to the actor system - (sleep 6) ;; 64 do not run this process at all - (sleep-code 7) ;; 128 do not run the code of this process (other stuff runs) - (process-tree 8) ;; 256 not an actual process, just a "tree node" for organization - (heap-shrunk 9) ;; 512 actor heap compactor has already shrunk the heap of this proc - (going 10) ;; 1024 there is a next state set that will be entered next time (pending enter-state) - (movie 11) ;; 2048 - (movie-subject 12) ;; 4096 - (target 13) ;; 8192 - (sidekick 14) ;; 16384 - (crate 15) ;; 32768 - (collectable 16) ;; 65536 - (enemy 17) ;; 131072 - (camera 18) ;; 262144 - (platform 19) ;; 524288 - (ambient 20) ;; 1048576 - (entity 21) ;; 2097152 - (projectile 22) ;; 4194304 - (attackable 23) ;; 8388608 - (death 24) ;; 16777216 + (execute 0) ;; when set, prevents a process from running, in every case. + (draw 1) ;; unused + (pause 2) ;; when set, the process won't run if the game is paused. + (menu 3) ;; when set, the process won't run if the debug menu system is open + (progress 4) ;; the process won't run if the start menu (progress menu) is open + (actor-pause 5) ;; when set, the entity system will try to pause it automatically if you are far away. + (sleep 6) ;; prevents the process from running, but can be woken up by state changes. + (sleep-code 7) ;; do not run the code (main thread) of this process (other stuff runs) + (process-tree 8) ;; not an actual process, just a "tree node" for organization + (heap-shrunk 9) ;; actor heap compactor has already shrunk the heap of this proc + (going 10) ;; there is a next state set that will be entered next time (pending enter-state) + (movie 11) ;; when set, don't run if we are in a movie + (movie-subject 12) ;; set on silostep, unused otherwise. + (target 13) ;; set on target + (sidekick 14) ;; set on sidekick + (crate 15) ;; set on all crates + (collectable 16) ;; set on all collectables + (enemy 17) ;; set on all enemies (inclues stuff like seagulls) + (camera 18) ;; set on all cameras + (platform 19) ;; set on all platforms + (ambient 20) ;; set on all ambients + (entity 21) ;; set on all processes spawned from entities + (projectile 22) ;; set on all projectiles + (attackable 23) ;; set on all "attackables" that can be targeted by projectiles or similar + (death 24) ;; set on misty-conveyor, appears unused. ) ;; -961 +;; these bits are cleared when inheriting the mask from a parent process. (defconstant PROCESS_CLEAR_MASK (lognot (process-mask sleep sleep-code process-tree heap-shrunk))) @@ -107,11 +123,9 @@ ) (defmacro msg-err (&rest args) - ;; "Print a message to stdout immediately. This won't appear in the compiler." - `(format 0 ,@args) - ) - -(defmacro msg-warn (&rest args) + "Print a message to stdout immediately. This won't appear in the compiler. + This is useful if the game is crashing before messages can be flushed + to compiler." `(format 0 ,@args) ) @@ -121,19 +135,19 @@ ;; this stores the current state of the kernel. (deftype kernel-context (basic) - ((prevent-from-run process-mask :offset-assert 4) - (require-for-run process-mask :offset-assert 8) ;; seems unused - (allow-to-run process-mask :offset-assert 12) ;; seems unused - (next-pid int32 :offset-assert 16) + ((prevent-from-run process-mask :offset-assert 4) ;; don't run processes with any of these bits set. + (require-for-run process-mask :offset-assert 8) ;; unused + (allow-to-run process-mask :offset-assert 12) ;; unused + (next-pid int32 :offset-assert 16) ;; next unused unique process ID (fast-stack-top pointer :offset-assert 20) - (current-process process :offset-assert 24) - (relocating-process basic :offset-assert 28) - (relocating-min int32 :offset-assert 32) - (relocating-max int32 :offset-assert 36) - (relocating-offset int32 :offset-assert 40) - (low-memory-message symbol :offset-assert 44) + (current-process process :offset-assert 24) ;; currently executing process + (relocating-process basic :offset-assert 28) ;; currently relocating process + (relocating-min int32 :offset-assert 32) ;; start of memory being relocated + (relocating-max int32 :offset-assert 36) ;; end of memory being relocated + (relocating-offset int32 :offset-assert 40) ;; how far the memory being relocated is moving + (low-memory-message symbol :offset-assert 44) ;; should we print warnings if low on memory? ) - + :size-assert #x30 :method-count-assert 9 :flag-assert #x900000030 @@ -164,13 +178,13 @@ (stack-top pointer :offset-assert 32) ;; top of the thread's stack (actual stack) (stack-size int32 :offset-assert 36) ;; size of the thread's stack (backup stack) ) - + (:methods (stack-size-set! (_type_ int) none 9) (thread-suspend (_type_) none 10) (thread-resume (_type_) none 11) ) - + :size-assert #x28 :method-count-assert 12 :flag-assert #xc00000028 @@ -183,48 +197,49 @@ ;; This is what GOAL did: ;; (rreg uint64 8 :offset-assert 40) ;; general purpose saved registers ;; (freg float 6 :offset-assert 104) ;; floating point registers - + ;; OpenGOAL has only 5 saved registers but 8 fregs, so we swap a rreg for 2 fregs. (rreg uint64 7 :offset-assert 40) (freg float 8) - + ;; This is the same between GOAL and OpenGOAL (stack uint8 :dynamic :offset-assert 128) ;; stack memory (dynamic array) ) - + (:methods (new (symbol type process symbol int pointer) _type_ 0) (thread-suspend (_type_) none 10) (thread-resume (_type_) none 11) ) - + :size-assert #x80 :method-count-assert 12 :flag-assert #xc00000080 ) +;; ppointer system: +;; a process may move in memory, but we need a way to keep track of a process. +;; this is where "ppointer" comes in. It is a GOAL (pointer process), like a C Process**. +;; Each process must contain a ppointer that can be used to find it. The process pointed to by +;; the ppointer must be a valid process or #f at all times. + ;; Parent type of all process tree nodes. -;; A process-tree is a left-child right-sibling binary tree +;; A process-tree is a left-child right-sibling binary tree ;; (except GOAL is old and it looks like they called them left-child right-brother trees back then) (declare-type entity-actor basic) (deftype process-tree (basic) - ((name basic :offset-assert 4) - (mask process-mask :offset-assert 8) + ((name basic :offset-assert 4) + (mask process-mask :offset-assert 8) ;; tree - (parent (pointer process-tree) :offset-assert 12) - (brother (pointer process-tree) :offset-assert 16) - (child (pointer process-tree) :offset-assert 20) - - ;; a process may move in memory. However, an active process must have a ppointer. The value of the ppointer never changes - ;; you can dereference this pointer at any time. - ;; you will either get: your original process, another process (with a different PID), or #f. - ;; NOTE: the ppointer is like a C++ Process**. - (ppointer (pointer process) :offset-assert 24) - + (parent (pointer process-tree) :offset-assert 12) + (brother (pointer process-tree) :offset-assert 16) + (child (pointer process-tree) :offset-assert 20) + (ppointer (pointer process) :offset-assert 24) + ;; in cases where the process never moves, the kernel will set ppointer to the address of the self field - (self process-tree :offset-assert 28) + (self process-tree :offset-assert 28) ) - + (:methods (new (symbol type basic) _type_ 0) (activate (_type_ process-tree basic pointer) process-tree 9) @@ -232,8 +247,8 @@ (init-from-entity! (_type_ entity-actor) none 11) (run-logic? (_type_) symbol 12) (dummy-method () none 13) - ) - + ) + :size-assert #x20 :method-count-assert 14 :no-runtime-type ;; already defined by kscheme. Don't do it again. @@ -241,15 +256,13 @@ ;; A GOAL process. A GOAL process contains memory and a suspendable main-thread. -(declare-type res-lump basic) -(declare-type entity res-lump) (deftype process (process-tree) ((pool dead-pool :offset-assert #x20) ;; the memory pool we came from, and should return to when we die (status basic :offset-assert #x24) - (pid int32 :offset-assert #x28) ;; unqiue process ID + (pid int32 :offset-assert #x28) ;; unqiue process ID (main-thread cpu-thread :offset-assert #x2c) ;; our suspendable main thread (top-thread thread :offset-assert #x30) ;; currently running thread - (entity entity :offset-assert #x34) ;; if we are a process spawned by an entity, our entity + (entity entity-actor :offset-assert #x34) ;; if we are a process spawned by an entity-actor, our entity (state state :offset-assert #x38) ;; if we use the state system, our current state (trans-hook function :offset-assert #x3c) ;; function to call for trans (post-hook function :offset-assert #x40) ;; function to call for post @@ -299,7 +312,7 @@ (prev dead-pool-heap-rec :offset-assert 4) ;; next rec in the linked list (next dead-pool-heap-rec :offset-assert 8) ;; prev. rec in the linked list ) - + :pack-me ; don't worry about aligning me to 16-bytes in arrays and types. :size-assert #xc :method-count-assert 9 @@ -311,19 +324,17 @@ ;; Alive processes in a dead-pool-heap can be relocated and compacted to reduce heap fragmentation. (deftype dead-pool-heap (dead-pool) ((allocated-length int32 :offset-assert #x20) ;; size of heap - (compact-time uint32 :offset-assert #x24) ;; ?? - (compact-count-targ uint32 :offset-assert #x28) ;; ?? - (compact-count uint32 :offset-assert #x2c) ;; ?? - (fill-percent float :offset-assert #x30) ;; ?? - (first-gap dead-pool-heap-rec :offset-assert #x34) ;; ?? - (first-shrink dead-pool-heap-rec :offset-assert #x38) ;; ?? - (heap kheap :inline :offset-assert 64) ;; ?? - (alive-list dead-pool-heap-rec :inline :offset-assert 80) ;; ?? + (compact-time uint32 :offset-assert #x24) ;; unused... + (compact-count-targ uint32 :offset-assert #x28) ;; number of compactions requested + (compact-count uint32 :offset-assert #x2c) ;; number of compactions perfomed + (fill-percent float :offset-assert #x30) ;; unused + (first-gap dead-pool-heap-rec :offset-assert #x34) ;; the lowest process with a gap in the heap + (first-shrink dead-pool-heap-rec :offset-assert #x38) ;; the lowest process that needs shrinking + (heap kheap :inline :offset-assert 64) ;; our shared heap for processes + (alive-list dead-pool-heap-rec :inline :offset-assert 80) ;; records for processes that are alive (last dead-pool-heap-rec :offset #x54 :offset-assert #x54) ;; overlay of (-> alive-list prev) - ;; note - the placement of dead-list at 92 here is used to determine the packing behavior. - ;; see TypeSystem::get_size_in_type(). - (dead-list dead-pool-heap-rec :inline :offset-assert 92) ;; ?? - (process-list dead-pool-heap-rec :inline :dynamic :offset-assert 104) + (dead-list dead-pool-heap-rec :inline :offset-assert 92) ;; unused records + (process-list dead-pool-heap-rec :inline :dynamic :offset-assert 104) ;; array of records ) (:methods (new (symbol type basic int int) _type_ 0) @@ -339,7 +350,7 @@ (memory-free (dead-pool-heap) int 25) (compact-time (dead-pool-heap) uint 26) ) - + :size-assert #x68 :method-count-assert #x1b :flag-assert #x1b00000068 @@ -352,7 +363,7 @@ ((name symbol :offset 4) (next stack-frame :offset 8) ;; follow this to get to the root frame, away from top. ) - + :size-assert #xc :method-count-assert 9 :flag-assert #x90000000c @@ -365,16 +376,16 @@ (deftype catch-frame (stack-frame) ((sp int32 :offset 12) ;; where to reset the stack when throwing. (ra int32 :offset 16) ;; where to jump when throwing - + ;; In GOAL ;; (freg float 6 :offset-assert 20) ;; saved floating point registers from "catch" statement ;; (rreg uint128 8 :offset-assert 48) ;; saved GPRs from "catch" statement (ugh they are 128s) - - ;; In OpenGOAL, we swap a rreg for 4 more fregs. + + ;; In OpenGOAL, we swap a rreg for 4 more fregs. (freg float 10 :offset-assert 20) ;; only use 8 (rreg uint128 7) ;; only use 5 ) - + (:methods (new (symbol type symbol function (pointer uint64)) object 0) ) @@ -386,7 +397,7 @@ ;; A protect frame is a frame which has a cleanup function called on exit. (deftype protect-frame (stack-frame) ((exit (function none) :offset-assert 12)) ;; function to call to clean up - + (:methods (new (symbol type (function none)) protect-frame) ) @@ -420,8 +431,7 @@ (defmacro handle->process (handle) - ;; the actual implementation is more clever than this. - ;; Checks PID. + "Convert a handle to a process. If the process no longer exists, returns #f." `(let ((the-handle (the-as handle ,handle))) (if (-> the-handle process) ;; if we don't point to a process, kernel sets this to #f (let ((proc (-> (-> the-handle process)))) @@ -434,7 +444,7 @@ ) (defmacro ppointer->process (ppointer) - ;; convert a (pointer process) to a process. + "convert a (pointer process) to a process." ;; this uses the self field, which seems to always just get set to the object. ;; perhaps when deleting a process you could have it set self to #f? ;; I don't see this happen anywhere though, so it's not clear. @@ -451,21 +461,22 @@ ) (defmacro ppointer->handle (pproc) + "convert a ppointer to a handle. assumes the ppointer is valid." `(let ((the-process (the-as (pointer process) ,pproc))) (new 'static 'handle :process the-process :pid (-> the-process 0 pid)) ) ) (defmacro process->handle (proc) + "convert a process to a handle. if proc is #f, returns a #f handle." `(ppointer->handle (process->ppointer ,proc)) ) (defmethod print handle ((obj handle)) - ;; the get-process-from-handle macro can't deal with - ;; a 0 in the process field, so we check it manually here. - (if (nonzero? (-> obj u64)) + "print a handle" + (if (nonzero? (-> obj u64)) ;; zero-initialized handles can't be derefenced safely. (format #t "#" - (handle->process obj) + (handle->process obj) ;; actually print the process stored (-> obj pid) ) (format #t "#") @@ -491,7 +502,7 @@ ) (:methods (new (symbol type symbol function - (function none) + (function none) function (function none) (function process int symbol event-message-block object)) _type_ 0) @@ -510,7 +521,7 @@ (message symbol :offset-assert 12) (param uint64 7 :offset-assert 16) ) - + :size-assert #x48 :method-count-assert 9 :flag-assert #x900000048 @@ -557,14 +568,11 @@ `(set! ,mask (logand ,mask (lognot (process-mask ,@enum-value)))) ) -;; set to true to get error prints on suspends out of stack. -(defglobalconstant DEBUG_PRINT_SUSPEND_FAIL #f) - (defmacro suspend () - ;; suspend the current process. - + "suspend the current process, to be resumed on the next frame." `(rlet ((pp :reg r13 :reset-here #t)) - (#when (or DEBUG_PRINT_SUSPEND_FAIL KERNEL_DEBUG) + ;; debug check for stack overflow here, where we can easily print the process name. + (#when (or KERNEL_DEBUG) (rlet ((sp :reg rsp :reset-here #t :type int) (off :reg r15 :type uint)) (let* ((sp-goal (- sp off)) @@ -582,23 +590,26 @@ (set! pp (-> (the process pp) top-thread)) ;; call the suspend hook (put nothing as the argument) ((-> (the cpu-thread pp) suspend-hook) (the cpu-thread 0)) - ;; the kernel will set pp (possibly to a new value) on resume. + ;; the kernel will set pp (possibly to a new value, if we've been relocated) on resume. ) ) (defmacro process-deactivate () - ;; deactivate the current process + "deactivate (kill) the current process" `(rlet ((pp :reg r13 :reset-here #t :type process)) (deactivate pp) ) ) (defmacro with-pp (&rest body) + "execute the body with pp bound to the current process register." `(rlet ((pp :reg r13 :reset-here #t :type process)) ,@body) ) (defmacro with-proc (bindings &rest body) + "execute the body with process register set to the given value and bound to pp. + it is recommended to use run-now-in-process over this" `(rlet ((pp :reg r13 :reset-here #t :type process)) (protect (pp) (set! pp ,(car bindings)) @@ -607,6 +618,8 @@ ) (defmacro defbehavior (name process-type bindings &rest body) + "define a new behavior. This is simply a function where self is bound to the process register, + which is assumed to have type process-type." (if (and (> (length body) 1) ;; more than one thing in function (string? (first body)) ;; first thing is a string @@ -618,6 +631,8 @@ ) ) +(defconstant INVALID_HANDLE (the handle #f)) + (defmacro handle->name (handle) "get the name of a process using a handle. #f is the result if the handle was invalid." @@ -630,6 +645,19 @@ ) ) +(defmacro with-children (bindings &rest body) + "run body for each child. not recursive. + bindings are: (child proc); proc = process we do this on; child = var name for the current child ptr." + `(let ((,(first bindings) (-> ,(second bindings) child))) + (while ,(first bindings) + + ,@body + + (set! ,(first bindings) (-> ,(first bindings) 0 brother)) + ) + ) + ) + (defmacro kheap-alloc (heap size) "allocate space for a kheap" `(let ((heap ,heap) (size ,size)) @@ -648,6 +676,7 @@ ) (defmacro with-sp (&rest body) + "execute the body with sp bound to the current stack pointer (be careful!)" `(rlet ((sp :reg rsp :reset-here #t :type pointer)) ,@body) ) @@ -663,8 +692,9 @@ ) +;; Some assembly functions in GOAL are ported to C++, then accessed from GOAL using these mips2c macros. (defmacro def-mips2c (name type) - "Define a mips2c object." + "Define a mips2c object (typically a function)." `(begin (define-extern ,name ,type) (set! ,name (the-as ,type (__pc-get-mips2c ,(symbol->string name)))) @@ -672,5 +702,6 @@ ) (defmacro defmethod-mips2c (name method-id method-type) + "Define a mips2c method." `(method-set! ,method-type ,method-id (__pc-get-mips2c ,name)) ) \ No newline at end of file diff --git a/goal_src/kernel/gkernel.gc b/goal_src/kernel/gkernel.gc index 45a1f4637e..720d7cd964 100644 --- a/goal_src/kernel/gkernel.gc +++ b/goal_src/kernel/gkernel.gc @@ -32,16 +32,16 @@ ;; Can be 'boot, 'listener, or 'debug-boot ;; set to 'boot when DiskBooting. -(define *kernel-boot-mode* 'listener) +(define *kernel-boot-mode* 'listener) ;; mostly unused. ;; DebugBootLevel in C Kernel -(define *kernel-boot-level* (the symbol #f)) +(define *kernel-boot-level* (the symbol #f)) ;; doesn't do anything. ;; The number of DECI messages received. ;; The C Kernel increments this. (define *deci-count* 0) -;; Some debug stats. Unused? +;; Some debug stats. Unused. (define *last-loado-length* 0) (define *last-loado-global-usage* 0) (define *last-loado-debug-usage* 0) @@ -72,8 +72,7 @@ (defun load-package ((package string) (allocation kheap)) "Load a Package from a CGO/DGO" (unless (nmember package *kernel-packages*) - ;; #xf = OUTPUT_LOAD, OUTPUT_TRUE, EXECUTE, PRINT_LOGIN - (dgo-load package allocation #xf #x200000) + (dgo-load package allocation (link-flag output-load-msg output-load-true-msg execute-login print-login) #x200000) (set! *kernel-packages* (cons package *kernel-packages*)) ) ) @@ -96,7 +95,7 @@ ;; The kernel context is a global which stores the state of the kernel. (define *kernel-context* (new 'static 'kernel-context :prevent-from-run (process-mask execute sleep) - :next-pid 2 + :next-pid 2 ;; 1 will be listener :current-process #f :relocating-process #f :low-memory-message #t @@ -117,23 +116,24 @@ ;; without executing anything, to find a process for instance. (define *null-kernel-context* (new 'static 'kernel-context)) -(#cond - (PC_PORT - - ;; make sure the scratchpad is 16kb aligned, and make it 32 kB so we can big stacks on it. - (let* ((mem (new 'global 'array 'uint8 (* (+ 16 32) 1024))) - ) - (define *fake-scratchpad-data* (the pointer (align-n mem (* 16 1024)))) - ) - - ;; We will move stacks on the scratchpad to here. - ;; it might be possible to also throw them on the *dram-stack*, but they might depend on these - ;; not overlapping. We can spare the 16k of memory. - (define *fake-scratchpad-stack* *fake-scratchpad-data*) - ;;(define *fake-scratchpad-stack* (new 'global 'array 'uint8 (* 16 1024))) - - (defmacro scratchpad-start() +;; scratchpad setup +(#cond + (PC_PORT + ;; we'll create a fake scratchpad: + ;; make sure the scratchpad is 64kb aligned, and make it 32 kB so we can big stacks on it. + ;; some (partially buggy) code in generic tie relies on 64 kB alignment. + (let* ((mem (new 'global 'array 'uint8 (* 128 1024))) + ) + (define *fake-scratchpad-data* (the pointer (align-n mem (* 64 1024)))) + ) + + ;; use the same memory for the scratchpad stacks. + ;; defining it as a separate thing so we can split them for debugging stack corruption easily. + (define *fake-scratchpad-stack* *fake-scratchpad-data*) + + (defmacro scratchpad-start () + "Get the start of the scratchpad. At least 64kB aligned." '*fake-scratchpad-data* ) ) @@ -145,16 +145,18 @@ ) (defmacro scratchpad-end () + "Get the end of the scratchpad memory" `(&+ (scratchpad-start) (* 16 1024)) ) (defmacro in-scratchpad? (x) - `(and + "Is the given address in the scratchpad?" + `(and (>= (the-as int ,x) (scratchpad-start)) (< (the-as int ,x) (scratchpad-end)) ) ) - + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -178,13 +180,13 @@ ;; Perhaps the thread was the public interface and cpu-thread is internal to the kernel? (defmethod delete thread ((obj thread)) - "Clean up a temporary thread after it is done being used. + "Clean up a temporary thread after it is done being used. This assumes it's the top-thread of the process and restores the previous top thread." (when (eq? obj (-> obj process main-thread)) ;; We have attempted to delete the main thread, which is bad. (break) ) - + ;; restore the old top-thread. (set! (-> obj process top-thread) (-> obj previous)) (none) @@ -197,8 +199,9 @@ (defmethod stack-size-set! thread ((this thread) (stack-size int)) "Set the backup stack size of a thread. This should only be done on the main-thread. - This should be done immediately after allocating the main-thread." - + This should be done immediately after allocating the main-thread. + Users can do this if they want a larger or smaller backup stack than the default." + (let ((proc (-> this process))) (cond ((neq? this (-> proc main-thread)) @@ -206,11 +209,11 @@ (msg-err "illegal attempt change stack size of ~A when the main-thread is not the top-thread.~%" proc) (break) ;; ADDED ) - + ((= (-> this stack-size) stack-size) ;; we already have this size. Don't do anything. ) - + ((eq? (-> proc heap-cur) (&+ this (-> this type size) (- *gtype-basic-offset*) (-> this stack-size))) ;; our heap cur point to right after us. So we can safely bump it forward to give us more space. (set! (-> proc heap-cur) (the pointer (&+ this (-> this type size) (- *gtype-basic-offset*) stack-size))) @@ -232,20 +235,20 @@ This is a special new method which ignores the allocation symbol. The stack-top is for the execution stack. The stack-size is for the backup stack (applicable for main thread only)" - + ;; first, let's see if we're doing the main or temp thread (let* ((obj (cond ((-> parent-process top-thread) ;; we're allocating a temporary thread, the main thread already exists. ;; we can stash the cpu-thread structure at the bottom of the stack. - ;; we use the smaller PROCESS_STACK_SIZE, which is only half the size of the real stack. + ;; we use the smaller PROCESS_STACK_SIZE, in case we're running on the scratchpad. (the cpu-thread (&+ stack-top (- PROCESS_STACK_SIZE) *gtype-basic-offset* )) ) (else - ;; the main thread. We need the main thread's cpu-thread to stick around, so we put it in the + ;; the main thread. We need the main thread's cpu-thread to stick around, so we put it in the ;; process heap. (let ((alloc (align16 (-> parent-process heap-cur)))) ;; start at heap cur, aligned ;; bump heap to include our thread + its stack @@ -254,10 +257,10 @@ ) ) ))) - + ;; set up the type manually, as we allocated the memory manually (set! (-> obj type) type-to-make) - + ;; set up thread (set! (-> obj name) name) (set! (-> obj process) parent-process) @@ -268,12 +271,12 @@ (set! (-> obj previous) (-> parent-process top-thread)) ;; and make us the top! (set! (-> parent-process top-thread) obj) - + ;; set up our suspend/resume hooks. By default just use the thread's methods. ;; but something else could install a different hook if needed. (set! (-> obj suspend-hook) (method-of-object obj thread-suspend)) (set! (-> obj resume-hook) (method-of-object obj thread-resume)) - + ;; remember how much space we have for the backup stack. (set! (-> obj stack-size) stack-size) obj @@ -292,7 +295,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defbehavior remove-exit process () - "Pops a single stack frame, if there is one." + "Pops a single stack frame, if there is one. + User code can call this before doing a 'go' to avoid running the exit for the current state." (when (-> self stack-frame-top) (set! (-> self stack-frame-top) (-> self stack-frame-top next)) ) @@ -312,9 +316,8 @@ arg1 ) -;; game state -(define *master-mode* 'game) -(define *pause-lock* #f) +(define *master-mode* 'game) ;; game, process, menu, pause +(define *pause-lock* #f) ;; set to #t when paused and doing a single frame advance with R2. (defmethod new process-tree ((allocation symbol) (type-to-make type) (name basic)) "Create a process-tree node" @@ -325,7 +328,7 @@ (set! (-> obj parent) #f) (set! (-> obj brother) #f) (set! (-> obj child) #f) - + (set! (-> obj self) obj) (set! (-> obj ppointer) (the (pointer process) (&-> obj self))) obj @@ -350,7 +353,7 @@ (let ((obj (if (eq? (-> allocation type) symbol) (object-new allocation type-to-make (the int (+ (-> process size) stack-size))) ;; symbol, allocate on heap (the process (&+ allocation *gtype-basic-offset*))))) ;; treat as address. - + ;; initialize (set! (-> obj name) name) (set! (-> obj status) 'dead) @@ -359,11 +362,11 @@ (set! (-> obj allocated-length) stack-size) (set! (-> obj top-thread) #f) (set! (-> obj main-thread) #f) - + ;; set up the heap to start at the stack (set! (-> obj heap-cur) (-> obj stack)) (set! (-> obj heap-base) (-> obj stack)) - + ;; and end at the end of the stack. (set! (-> obj heap-top) (&-> (-> obj stack) (-> obj allocated-length))) ;;;;;;;;;;;;;;;;;;;;;;;;; @@ -373,13 +376,13 @@ ;; but this overlaps with the stack-frame-top and did nothing. ;; this is likely because they added the concept of heap "top" to kheaps in ;; general, but not to process heaps. - + ;; setup state stuff (set! (-> obj stack-frame-top) #f) (set! (-> obj state) #f) (set! (-> obj next-state) #f) (set! (-> obj entity) #f) - + ;; setup handlers (set! (-> obj trans-hook) #f) (set! (-> obj post-hook) #f) @@ -389,12 +392,12 @@ (set! (-> obj parent) #f) (set! (-> obj brother) #f) (set! (-> obj child) #f) - + ;; setup reference stuff. (set! (-> obj self) obj) (set! (-> obj ppointer) (the (pointer process) (&-> obj self))) obj - ) + ) ) (defun inspect-process-heap ((obj process)) @@ -450,12 +453,12 @@ ) (defmethod print process ((obj process)) - (format #t "#<~A ~S ~A :state ~S " - (-> obj type) - (-> obj name) - (-> obj status) + (format #t "#<~A ~S ~A :state ~S " + (-> obj type) + (-> obj name) + (-> obj status) (when (-> obj state) (-> obj state name))) - + (format #t ":stack ~D/~D :heap ~D/~D @ #x~X>" (process-stack-used obj) (process-stack-size obj) @@ -501,7 +504,7 @@ (.load-sym :sext #f sp *kernel-sp*) ;; convert it back to a real pointer (.add sp off) - + ;; restore saved registers... ;; without coloring system because this is "cheating" and modifying saved registers without backing up. (.pop :color #f s4) @@ -530,14 +533,14 @@ (s3 :reg r11 :type uint) (s4 :reg r12 :type uint) ) - - ;; first call the deactivate method. (todo - is the stack properly aligned for this?) + + ;; first call the deactivate method. (deactivate pp) ;; get the kernel stack pointer as a GOAL pointer (.load-sym :sext #f sp *kernel-sp*) ;; convert it back to a real pointer (.add sp off) - + ;; restore saved registers... ;; without coloring system because this is "cheating". (.pop :color #f s4) @@ -557,9 +560,8 @@ NOTE: this should only be done from the kernel, running on the kernel's stack." (declare (asm-func object) - ;(print-asm) ) - + (rlet ((pp :reg r13 :type process) (sp :reg rsp :type uint) (off :reg r15 :type uint) @@ -570,29 +572,29 @@ (s4 :reg r12 :type uint) (temp :reg rax :type uint) ) - + ;; set up the process pointer (set! pp (-> obj process)) ;; mark the process as running and set its top thread (set! (-> pp status) 'running) (set! (-> pp top-thread) obj) - + ;; save the current kernel regs (.push :color #f s0) (.push :color #f s1) (.push :color #f s2) (.push :color #f s3) (.push :color #f s4) - + ;; make rsp a GOAL pointer (.sub sp off) ;; and store it (set! *kernel-sp* (the pointer sp)) ;; todo, asm form here? - + ;; setup the rsp for the new thread (set! sp (the uint (-> obj stack-top))) (.add sp off) - + ;; push the return trampoline to the stack for the user code to return to (set! temp (the uint return-from-thread)) (.add temp off) @@ -612,9 +614,9 @@ (defmethod thread-suspend cpu-thread ((unused cpu-thread)) "Suspend the thread and return to the kernel." - + (declare (asm-func none)) - + ;; we begin this function with the thread object in pp. ;; not sure why we do this, maybe at one point suspending didn't clobber ;; temp registers? @@ -627,7 +629,7 @@ (s2 :reg r10 :type uint) (s3 :reg r11 :type uint) (s4 :reg r12 :type uint) - + (xmm8 :reg xmm8 :class fpr) (xmm9 :reg xmm9 :class fpr) (xmm10 :reg xmm10 :class fpr) @@ -637,19 +639,19 @@ (xmm14 :reg xmm14 :class fpr) (xmm15 :reg xmm15 :class fpr) ) - + ;; get the return address pushed by "call" in the suspend. (.pop temp) ;; convert to a GOAL address (.sub temp off) ;; store return address in thread (set! (-> obj pc) (the pointer temp)) - + ;; convert our stack pointer to a GOAL address (.sub sp off) ;; store in thread. (set! (-> obj sp) (the pointer sp)) - + ;; back up registers (.mov :color #f temp s0) (set! (-> obj rreg 0) temp) @@ -661,7 +663,7 @@ (set! (-> obj rreg 3) temp) (.mov :color #f temp s4) (set! (-> obj rreg 4) temp) - + ;; back up fprs (.mov :color #f temp xmm8) (set! (-> obj freg 0) (the-as float temp)) @@ -680,8 +682,8 @@ (.mov :color #f temp xmm15) (set! (-> obj freg 7) (the-as float temp)) - - + + ;; get our process (let ((proc (-> obj process))) (when (> (process-stack-used proc) (-> obj stack-size)) @@ -689,7 +691,7 @@ ;; if you hit this, try with DEBUG_PRINT_SUSPEND_FAIL set to #t (see gkernel-h.gc) ;; it will print more info before reaching here. ) - + ;; mark the process as suspended and copy the stack (set! (-> proc status) 'suspended) (let ((cur (the (pointer uint64) (-> obj stack-top))) @@ -702,15 +704,15 @@ ) ) ) - + ;; actually setting pp to 0 (set! obj (the cpu-thread 0)) - + ;; get the kernel stack pointer as a GOAL pointer (.load-sym :sext #f sp *kernel-sp*) ;; convert it back to a real pointer (.add sp off) - + ;; restore saved registers... ;; without coloring system because this is "cheating". (.pop :color #f s4) @@ -732,7 +734,7 @@ (declare (asm-func none) ;;(print-asm) ) - + (rlet ((obj :reg r13 :type cpu-thread) (temp :reg rax :type uint) (off :reg r15 :type uint) @@ -754,26 +756,26 @@ (xmm13 :reg xmm13 :class fpr) (xmm14 :reg xmm14 :class fpr) (xmm15 :reg xmm15 :class fpr) - ) - + ) + ;; save the current kernel regs (.push :color #f s0) (.push :color #f s1) (.push :color #f s2) (.push :color #f s3) (.push :color #f s4) - + ;; make rsp a GOAL pointer (.sub sp off) ;; and store it (set! *kernel-sp* (the pointer sp)) ;; todo, asm form here? - + ;; temp, stash thread in process-pointer (set! obj thread-to-resume) - + ;; set stack pointer for the thread. leave it as a GOAL pointer for now.. (set! sp (the uint (-> obj sp))) - + ;; restore the stack (sp is a GOAL pointer) (let ((cur (the (pointer uint64) (-> obj stack-top))) (restore (&+ (the (pointer uint64) (-> obj stack)) (-> obj stack-size))) @@ -784,14 +786,14 @@ (set! (-> cur) (-> restore)) ) ) - + ;; offset sp after we're done using it as a GOAL pointer. (.add sp off) - + ;; setup process (set! (-> (-> obj process) top-thread) obj) (set! (-> (-> obj process) status) 'running) - + ;; restore reg (set! temp (-> obj rreg 0)) (.mov :color #f s0 temp) @@ -819,26 +821,26 @@ (.mov :color #f xmm14 temp-float) (set! temp-float (-> obj freg 7)) (.mov :color #f xmm15 temp-float) - + ;; hack for set-to-run-bootstrap. The set-to-run-bootstrap in MIPS ;; expects to receive 7 values from the cpu thread's rregs. ;; usually rreg holds saved registers, but on the first resume after ;; a set-to-run, they hold arguments, and set-to-run-bootstrap copies them. - + ;; We only have 5 saved regs, so we need to cheat and directly pass ;; two values in other registers ;; so we load the a4/a5 argument registers with rreg 5 and rreg 6 - ;; In the case where we are doing a normal resume, the + ;; In the case where we are doing a normal resume, the ;; compiler should assume that these registers are overwritten anyway. (set! temp (-> obj rreg 5)) (.mov a4 temp) (set! temp (-> obj rreg 6)) (.mov a5 temp) - + ;; get the resume address (set! temp (the uint (-> obj pc))) (.add temp off) - + ;; setup the process (set! obj (the cpu-thread (-> obj process))) ;; resume! @@ -854,7 +856,8 @@ ;; Process Dead Pool ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ; a dead-pool is a collection of processes of fixed size that you can get processes from. +;; a dead pool is just a collection of dead processes of a fixed size. + (define-extern *debug-dead-pool* dead-pool-heap) @@ -871,7 +874,7 @@ ;; setup ref (set! (-> obj self) obj) (set! (-> obj ppointer) (the (pointer process) (&-> obj self))) - + (dotimes (i count) ;; create each process (let ((old-bro (-> obj child)) @@ -887,9 +890,9 @@ ) (defmethod get-process dead-pool ((obj dead-pool) (type-to-make type) (stack-size int)) - "Get a process from this dead pool of the given type." + "Get a process from this dead pool of the given type." (let ((proc (-> obj child))) - + (when (and (not proc) *debug-segment* (neq? obj *debug-dead-pool*)) ;; we failed, but we're in debug mode and not looking at the debug pool ;; try again from the debug pool and warn if this works @@ -901,9 +904,9 @@ ;; there's a bug here. proc is a process here, but will be used as a process pointer. ;; let's just kill the program here. ;; this is likely a copy-paste bug from get-process dead-pool-heap. - (break) + (break) ) - + (cond (proc ;; success! set our type and return. @@ -952,10 +955,10 @@ (set! (-> obj parent) #f) (set! (-> obj brother) #f) (set! (-> obj child) #f) - + (set! (-> obj self) obj) (set! (-> obj ppointer) (the (pointer process) (&-> obj self))) - + ;; initialize each process handle ;; build them into a linked list of null-process (countdown (i allocated-length) @@ -964,19 +967,19 @@ (set! (-> rec next) (-> obj process-list (+ i 1))) ) ) - + ;; set up the dead-list (set! (-> obj dead-list next) (-> obj process-list 0)) (set! (-> obj alive-list process) #f) ;; likely typo here, should be dead-list (set! (-> obj process-list (- allocated-length 1) next) #f) - - ;; nothing is alive + + ;; nothing is alive (set! (-> obj last) (-> obj alive-list)) (set! (-> obj alive-list next) #f) (set! (-> obj alive-list process) #f) (set! (-> obj first-gap) (-> obj alive-list)) (set! (-> obj first-shrink) #f) - + ;; setup the heap. It just begins after the process records. (set! (-> obj heap base) (the pointer (align16 (-> obj process-list allocated-length)))) (set! (-> obj heap current) (-> obj heap base)) @@ -987,7 +990,7 @@ ) (defmethod gap-location dead-pool-heap ((obj dead-pool-heap) (rec dead-pool-heap-rec)) - "Get the gap after the given process. + "Get the gap after the given process. If root of the alive list is given, will give the first gap between the heap and the first process. If there is no gap, may point to the next process. Not 16-byte aligned." (cond @@ -1054,7 +1057,7 @@ (format #t "~Talive-list: #~%" (-> obj alive-list)) (format #t "~Tlast: #~%" (-> obj last)) (format #t "~Tdead-list: #~%" (-> obj dead-list)) - + ;; here we consider the free memory to be all of the stuff after the last process. ;; we don't consider random gaps to be "free". ;; this means you can do a single allocation of free bytes and it will always succeed. @@ -1065,7 +1068,7 @@ ) (format #t "~Tprocess-list[0] @ #x~X ~D/~D bytes used~%" (-> obj process-list) (- total free) total) ) - + (let ((rec (-> obj alive-list)) (i 0) ) @@ -1081,7 +1084,7 @@ (+! i 1) ) ) - + obj) (defmethod asize-of dead-pool-heap ((obj dead-pool-heap)) @@ -1134,11 +1137,14 @@ ) ) +;; this will be set to #t if we're using visibility data. +;; if we aren't, there will be many cases where we try to spawn too many actors, and we shouldn't +;; warn when this happens. (define-extern *vis-boot* basic) (defmethod get-process dead-pool-heap ((obj dead-pool-heap) (type-to-make type) (stack-size int)) "Allocate a process" - + ;; get a record for the new process (let ((rec (-> obj dead-list next)) ;; will eventually hold our new process @@ -1146,48 +1152,48 @@ ;; find the rec which has a big enough gap (insert (find-gap-by-size obj (+ (the int (-> process size)) stack-size))) ) - + (cond ;; check we got both a record and a gap ((and rec insert) - + ;; pop the record off of the list (set! (-> obj dead-list next) (-> rec next)) - + ;; splice it into the alive list in the right spot (let ((next (-> insert next))) ;; after the gap rec (set! (-> insert next) rec) ;; us to the process after the gap (set! (-> rec next) next) - + ;; link the proc after us back (when next (set! (-> next prev) rec) ) ;; and us back to the proc before the gap (set! (-> rec prev) insert) - + ;; if we are inserting after the last process, we should update the last. (when (eq? insert (-> obj last)) (set! (-> obj last) rec) ) - + ;; get the gap (set! proc (the process (gap-location obj insert))) ;; and allocate! The method new does the offset for us. (set! proc ((method-of-type process new) (the symbol proc) process 'process stack-size)) - + ;; update our rec to contain this process. (set! (-> rec process) proc) ;; and the ppointer should point to the rec, not the processs, so we can track the process if it moves. (set! (-> proc ppointer) (&-> rec process)) - + ;; if we used the first gap, update first gap (when (eq? (-> obj first-gap) insert) (set! (-> obj first-gap) (find-gap obj rec)) ) - + ;; we haven't shrunk yet. If we don't have a first-shrink, or we are before it, ;; mark us as first shrink. (when (or (not (-> obj first-shrink)) @@ -1195,13 +1201,13 @@ ) (set! (-> obj first-shrink) rec) ) - + ;; update tree stuff. (set! (-> proc parent) (-> obj ppointer)) (set! (-> proc pool) obj) (set! (-> obj child) (&-> rec process)) ) - + ) (else ;; allocation failed! try again on the debug heap if we're debugging. @@ -1210,10 +1216,10 @@ (when (and proc *vis-boot*) (format 0 "WARNING: ~A ~A had to be allocated from the debug pool, because ~A was empty.~%" type-to-make proc (-> obj name))) ) - + ) ) - + (cond (proc ;; success! set type and return. @@ -1224,44 +1230,44 @@ (format 0 "WARNING: ~A ~A could not be allocated, because ~A was empty.~%" type-to-make proc (-> obj name)) ) ) - + proc) ) (defmethod return-process dead-pool-heap ((obj dead-pool-heap) (proc process)) "Return a process to a dead pool heap" - + ;; check we are returning to the correct pool (unless (eq? obj (-> proc pool)) (format 0 "ERROR: process ~A does not belong to dead-pool-heap ~A.~%" proc obj) ) - + ;; reclaim us. (change-parent proc obj) - + ;; we don't maintain a real tree for a dead-pool-heap, so undo any change to child ;; done by change-parent (set! (-> obj child) #f) - + ;; we know our ppointer is really a rec for a dead-pool-heap process, so we can use ;; this trick to quickly find our rec. (let ((rec (the dead-pool-heap-rec (-> proc ppointer)))) - + ;; if we are at or below the first gap, update first gap. (when (or (eq? (-> obj first-gap) rec) (< (the int (gap-location obj rec)) (the int (gap-location obj (-> obj first-gap)))) ) (set! (-> obj first-gap) (-> rec prev)) ) - - + + ;; update the first-shrink. We aren't smart about this and just move it backward. (when (eq? (-> obj first-shrink) rec) (set! (-> obj first-shrink) (-> rec prev)) (when (not (-> obj first-shrink process)) (set! (-> obj first-shrink) #f)) ) - + ;; remove us from list (set! (-> rec prev next) (-> rec next)) (cond @@ -1274,18 +1280,18 @@ (set! (-> obj last) (-> rec prev)) ) ) - + ;; insert at the front of the dead list. (set! (-> rec next) (-> obj dead-list next)) (set! (-> obj dead-list next) rec) (set! (-> rec process) *null-process*) - + (none) ) ) (defmethod shrink-heap dead-pool-heap ((obj dead-pool-heap) (proc process)) - "Shrink the heap of a process. + "Shrink the heap of a process. This resizes the process heap to be the exact size it is currently using." (when proc ;; get our rec. @@ -1298,16 +1304,16 @@ ;; shrink! (set! (-> proc allocated-length) (the int (&- (-> proc heap-cur) (-> proc stack)))) (set! (-> proc heap-top) (&-> (-> proc stack) (-> proc allocated-length))) - + ;; update first gap (when (< (the int proc) (the int (gap-location obj (-> obj first-gap)))) (set! (-> obj first-gap) (find-gap obj rec)) ) - + ;; mark us as shrunk (process-mask-set! (-> proc mask) heap-shrunk) ) - + ;; update first shrink (when (eq? (-> obj first-shrink) rec) (set! (-> obj first-shrink) (-> rec next)) @@ -1320,7 +1326,7 @@ (defmethod compact dead-pool-heap ((obj dead-pool-heap) (count int)) "Do heap compaction. The count argument tells us how much work to do. If the heap is very full we will automatically do more work than requested." - + ;; first we see how much memory is in use. (let ((free (memory-free obj)) (total (memory-total obj)) @@ -1345,14 +1351,14 @@ ) ) ) - + ;; update stats (set! (-> obj compact-count-targ) count) (set! (-> obj compact-count) 0) - + ;; and do compaction! (countdown (ii count) - + ;; first try to shrink a heap. (let ((shrink (-> obj first-shrink))) (when (not shrink) @@ -1364,7 +1370,7 @@ (shrink-heap obj (-> shrink process)) ) ) - + ;; now find the first gap (let ((gap (-> obj first-gap))) ;; and the thing after it @@ -1377,7 +1383,7 @@ ;; bug! (break) ) - + ;; try shrinking before relocating. (shrink-heap obj proc) ;; relocate! @@ -1391,13 +1397,13 @@ ) ) ) - + (none) ) (defmethod churn dead-pool-heap ((obj dead-pool-heap) (count int)) "Mess with the heap" - + (countdown (ii count) (let ((rec (-> obj alive-list next))) (when rec @@ -1405,14 +1411,14 @@ (< (the int (gap-location obj rec)) (the int (gap-location obj (-> obj first-gap)))) ) (set! (-> obj first-gap) (-> rec prev))) - + (when (eq? (-> obj first-shrink) rec) (set! (-> obj first-shrink) (-> rec prev)) (when (not (-> obj first-shrink process)) (set! (-> obj first-shrink) #f)) ) - + (set! (-> rec prev next) (-> rec next)) (cond ((-> rec next) @@ -1422,25 +1428,25 @@ (set! (-> obj last) (-> rec prev)) ) ) - + (let* ((insert (-> obj last)) (next (-> insert next)) ) - + (set! (-> insert next) rec) (set! (-> rec next) next) (when next (set! (-> next prev) rec)) (set! (-> rec prev) insert) - + (set! (-> obj last) rec) - (set! (-> rec process) (relocate (-> rec process) (the int (&- (gap-location obj insert) + (set! (-> rec process) (relocate (-> rec process) (the int (&- (gap-location obj insert) (the int (&- (-> rec process) *gtype-basic-offset*)))))) ) ) ) ) - + (none) ) @@ -1473,7 +1479,7 @@ (defun process-count ((this process-tree)) "Count number of processes in the given tree using iterate-process-tree" (set! *global-search-count* 0) - (iterate-process-tree this + (iterate-process-tree this (lambda ((obj process)) (+! *global-search-count* 1) #t) @@ -1527,7 +1533,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod run-logic? process ((obj process)) - "Return if the process should be run or not." + "Return if the process should be run or not. + Children of process should override this with more interesting functions" #t) ;; the following three functions recursively iterate through process trees. @@ -1561,17 +1568,17 @@ (defun execute-process-tree ((obj process-tree) (func (function object object)) (context kernel-context)) "Like iterate, but also requires that prevent-from-run's mask doesn't block, and that run-logic? is true in order to call the function." - + ;; check mask for tree, mask for prevent, run-logic?, then run! (let ((ret (or (process-mask? (-> obj mask) process-tree) (not (and (or (zero? (logand (-> context prevent-from-run) (-> obj mask)))) (run-logic? obj))) (func obj) ))) - + ;; run on our children (cond - ((eq? ret 'dead) + ((eq? ret 'dead) ;; if dead, don't bother checking children. ) (else (let ((brother (-> obj child))) (while brother @@ -1588,7 +1595,7 @@ (defun search-process-tree ((obj process-tree) (func (function process-tree object))) "Find the first process which func return true on. Won't find process-tree's (by mask)" - + ;; reject process-tree (unless (process-mask? (-> obj mask) process-tree) ;; is this a match? @@ -1596,7 +1603,7 @@ (return-from #f obj) ) ) - + ;; not a match, check out children (let ((brother (-> obj child))) (while brother @@ -1617,51 +1624,80 @@ ;; Kernel Dispatcher ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defmacro process-name-as-string (proc) + `(let ((proc-type (-> ,proc name type))) + (cond + ((= proc-type string) + (the string (-> ,proc name)) + ) + ((= proc-type symbol) + (symbol->string (-> ,proc name)) + ) + (else + "??" + ) + ) + ) + ) + (define-extern *listener-process* process) (define-extern *active-pool* process-tree) (defun kernel-dispatcher () - "Run the kernel!" - + "Run the kernel! + This is the entry point from C++ to GOAL." + + ;; outside of all profiler events, set a ROOT event + (profiler-instant-event "ROOT") + + ;; execute the listener function, if we got one. (when *listener-function* - (let ((result (reset-and-call (-> *listener-process* main-thread) *listener-function*))) + (+! *enable-method-set* 1) ;; allow out-of-order method definitions (slower) + (let ((result (reset-and-call (-> *listener-process* main-thread) *listener-function*))) ;; run function! + ;; print result. (if *use-old-listener-print* (format #t "~D~%" result result result) (format #t "~D #x~X ~F ~A~%" result result result result) ) ) + ;; clear pending function (set! *listener-function* #f) (+! *enable-method-set* -1) ) - - - (execute-process-tree - *active-pool* + + ;; iterate over all processes, running this lambda: + (execute-process-tree + *active-pool* (lambda ((obj process)) - ;(format 0 "Call to dispatcher lambda!~%") (let ((context *kernel-context*)) (cond ((or (eq? (-> obj status) 'waiting-to-run) (eq? (-> obj status) 'suspended)) - - ;; we should run! + + ;; begin event in profiler. + (profiler-start-event (process-name-as-string obj)) + ;; set current process to us (set! (-> context current-process) obj) - - ;; update pause junk for this run + + ;; pause tricks to prevent debug text and drawings from disappearing when pausing: (cond ((process-mask? (-> obj mask) pause) - ;; we're paused. + ;; we are a pausable object, so we should put our *stdcon* to the one that isn't cleared during pause: (set! *stdcon* *stdcon1*) + ;; and we should do our debug drawing to a buffer that isn't cleared during pause: (set! *debug-draw-pauseable* #t) ) (else - (set! *stdcon* *stdcon0*) - (set! *debug-draw-pauseable* #f) - ) + ;; non-pausable, use the *stdcon* that's cleared each time + (set! *stdcon* *stdcon0*) + ;; and don't debug draw to a buffer + (set! *debug-draw-pauseable* #f) + ) ) - + ;; TRANS + ;; this function should run before resuming. (cond ((-> obj trans-hook) ;; we have a trans hook defined. let's create a thread and run it. we can reuse the stack of the main-thread @@ -1669,7 +1705,7 @@ (let ((trans (new 'process 'cpu-thread obj 'trans PROCESS_STACK_SAVE_SIZE (-> obj main-thread stack-top)))) ;; call the function in the thread. (reset-and-call trans (-> obj trans-hook)) - + (#when KERNEL_DEBUG (when (!= (-> trans type) cpu-thread) (format 0 "corrupted stack after trans for ~A~%" obj) @@ -1680,26 +1716,28 @@ ;; check for deadness (when (eq? (-> obj status) 'dead) (set! (-> context current-process) #f) - (return 'dead) + (profiler-end-event) + (return 'dead) ;; tells the execute-process-tree function to skip our children. ) ) ) ) - + ;; MAIN CODE (if (process-mask? (-> obj mask) sleep-code) ;; we're sleeping. Move us to suspended, in case we were in waiting to run. (set! (-> obj status) 'suspended) - ;; not sleeping. call resume hook + ;; not sleeping. call resume hook. This will return once the main thread suspends again. ((-> obj main-thread resume-hook) (-> obj main-thread)) - + ) ;; check for deadness (cond ((eq? (-> obj status) 'dead) ;; oops we died. return 'dead (set! (-> context current-process) #f) + (profiler-end-event) 'dead ) (else @@ -1707,12 +1745,15 @@ ;; POST CODE (cond ((-> obj post-hook) + ;; Note: use dram stack always. This will allow actors to use the scratchpad stack and get a speedup for trans/code + ;; but still be able to do joint-animation stuff that uses the scratchpad in post. (let ((post (new 'process 'cpu-thread obj 'post PROCESS_STACK_SAVE_SIZE *kernel-dram-stack*))) (reset-and-call post (-> obj post-hook)) (delete post) (when (eq? (-> obj status) 'dead) ;; oops we died. (set! (-> context current-process) #f) + (profiler-end-event) (return 'dead) ) (set! (-> obj status) 'suspended) @@ -1720,11 +1761,13 @@ ) ) (set! (-> context current-process) #f) + (profiler-end-event) #f ) ) + ) - + ((eq? (-> obj status) 'dead) 'dead) ) @@ -1738,7 +1781,7 @@ (defun inspect-process-tree ((obj process-tree) (level int) (mask int) (detail symbol)) "Debug print a pocess-tree" (print-tree-bitmask mask (+ 0 level)) - + ;; print us (cond (detail @@ -1754,7 +1797,7 @@ (format #t "~S~A~%" (if (zero? level) "" "+---") obj) ) ) - + ;; print our children (let ((child (-> obj child))) (while child @@ -1795,7 +1838,7 @@ (declare (asm-func object) (allow-saved-regs) ;; very dangerous! ) - + (rlet ((pp :reg r13 :type process) (temp :reg rax :type uint) (off :reg r15 :type uint) @@ -1814,8 +1857,8 @@ (xmm13 :reg xmm13 :class fpr) (xmm14 :reg xmm14 :class fpr) (xmm15 :reg xmm15 :class fpr) - ) - + ) + ;; we treat the allocation as an address. (let ((obj (the catch-frame (&+ allocation *gtype-basic-offset*)))) ;; setup catch frame @@ -1828,13 +1871,13 @@ (.sub temp off) ;; store it (set! (-> obj ra) (the int temp)) - + ;; todo, do we need a stack offset here? ;; remember the stack pointer (set! temp sp) (.sub temp off) (set! (-> obj sp) (the int temp)) - + ;; back up registers we care about (.mov :color #f temp s0) (set-u128-as-u64! (-> obj rreg 0) temp) @@ -1863,18 +1906,18 @@ (set! (-> obj freg 6) (the-as float temp)) (.mov :color #f temp xmm15) (set! (-> obj freg 7) (the-as float temp)) - + ;; push this stack frame (set! (-> obj next) (-> pp stack-frame-top)) (set! (-> pp stack-frame-top) obj) - + ;; help coloring, it isn't smart enough to realize it's "safe" to use these registers. (.push :color #f s3) (.push :color #f s2) (.push :color #f s2) (set! s3 (the uint func)) (set! s2 param-block) - + ;; todo - are we aligned correctly here? (let ((ret ((the-super-u64-fucntion s3) (-> s2 0) @@ -1901,7 +1944,7 @@ "Throw the given value to the catch frame. Only can throw a 64-bit value. The original could throw 128 bits." (declare (asm-func none)) - + (rlet ((pp :reg r13 :type process) (temp :reg rax :type uint) (off :reg r15 :type uint) @@ -1922,10 +1965,10 @@ (xmm14 :reg xmm14 :class fpr) (xmm15 :reg xmm15 :class fpr) ) - + ;; pop everything we threw past (set! (-> pp stack-frame-top) (-> obj next)) - + ;; restore regs we care about. (set-u64-from-u128! temp (-> obj rreg 0)) (.mov :color #f s0 temp) @@ -1954,17 +1997,17 @@ (.mov :color #f xmm14 temp-float) (set! temp-float (-> obj freg 7)) (.mov :color #f xmm15 temp-float) - + ;; set stack pointer (set! sp (the uint (-> obj sp))) (.add sp off) - + ;; overwrite our return address (.pop temp) (set! temp (the uint (-> obj ra))) (.add temp off) (.push temp) - + ;; load the return register (.mov temp value) (.ret) @@ -1978,10 +2021,10 @@ (while cur (when (and (eq? (-> cur name) name) (eq? (-> cur type) catch-frame)) ;; match! - + (throw-dispatch (the catch-frame cur) value) ) - + (if (eq? (-> cur type) protect-frame) ;; call the cleanup function ((-> (the protect-frame cur) exit)) @@ -1999,7 +2042,7 @@ (set! (-> obj type) type-to-make) (set! (-> obj name) 'protect-frame) (set! (-> obj exit) func) - + (rlet ((pp :reg r13 :type process)) (set! (-> obj next) (-> pp stack-frame-top)) (set! (-> pp stack-frame-top) obj) @@ -2040,7 +2083,7 @@ "Make obj a child of new-parent" (let ((parent (-> obj parent))) ;; parent is a ppointer. - + ;; need to remove obj from its current parent (when parent (let ((proc (-> (-> parent) child))) @@ -2058,7 +2101,7 @@ ) ) ) - + ;; add to new parent (set! (-> obj parent) (-> new-parent ppointer)) (set! (-> obj brother) (-> new-parent child)) @@ -2181,38 +2224,50 @@ (defmethod activate process ((obj process) (dest process-tree) (name basic) (stack-top pointer)) "Activate a process! Put it on the given active tree and set up the main thread." + + ;; if we got the scratchpad stack, move to the fake scratchpad. (#when PC_PORT (when (= stack-top *scratch-memory-top*) - ;; (format #t "Process ~A requested a stack on the scratchpad, moving to fake scratch~%") (set! stack-top (&+ *fake-scratchpad-stack* (* 32 1024))) ) ) - + ;; inherit mask (minus stuff like sleep) (set! (-> obj mask) (logand (-> dest mask) PROCESS_CLEAR_MASK)) (set! (-> obj status) 'ready) + + ;; get a unique pid. (let ((pid (-> *kernel-context* next-pid))) (set! (-> obj pid) pid) (set! (-> *kernel-context* next-pid) (+ 1 pid))) (set! (-> obj top-thread) #f) (set! (-> obj main-thread) #f) (set! (-> obj name) name) + + ;; set up our heap. Note that we apply an offset of heap-base to leave room for fields of the actual type. + ;; unclear why we can't just use the size of our type... but I guess this gives you the option + ;; to put some other stuff in between the fields and the heap. (set! (-> obj heap-base) (set! (-> obj heap-cur) (&+ (-> obj stack) (-> obj type heap-base)))) (set! (-> obj stack-frame-top) #f) + ;; heaps should be 0 initialized. (mem-set32! (-> obj stack) (the int (/ (-> obj type heap-base) 4)) 0) - + (set! (-> obj trans-hook) #f) (set! (-> obj post-hook) #f) (set! (-> obj event-hook) #f) (set! (-> obj state) #f) (set! (-> obj next-state) #f) + + ;; inherit entity if our parent is another process (if (process-mask? (-> dest mask) process-tree) (set! (-> obj entity) #f) (set! (-> obj entity) (-> (the process dest) entity)) ) - + + ;; reset all connections (set! (-> obj connection-list next1) #f) (set! (-> obj connection-list prev1) #f) - + + ;; allocate the main thread (sets everything up.) (let ((thread (new 'process 'cpu-thread obj 'code PROCESS_STACK_SAVE_SIZE stack-top))) (set! (-> obj main-thread) thread) ) @@ -2226,18 +2281,18 @@ this function will return. The idea is that you use this when you want to initialize a process NOW. This will then return the value of the function you called!" (rlet ((pp :reg r13 :type process)) - + (let ((param-array (new 'stack-no-clear 'array 'uint64 6)) ) ;; copy params to the stack. - + (set! (-> param-array 0) (the uint64 a0)) (set! (-> param-array 1) (the uint64 a1)) (set! (-> param-array 2) (the uint64 a2)) (set! (-> param-array 3) (the uint64 a3)) (set! (-> param-array 4) (the uint64 a4)) (set! (-> param-array 5) (the uint64 a5)) - + (let* ((old-pp pp) (func-val (begin ;; set the process @@ -2282,18 +2337,19 @@ To reset a thread to running a new function, we stash the arguments as saved registers. These are then restored by thread-resume on the next run of the kernel. This stub remaps these saved registers to argument registers. - It also creates a return trampoline to return-from-thread-dead" + It also creates a return trampoline to return-from-thread-dead, so if the main thread returns, the + process is properly cleaned up by deactivate." (declare (asm-func none) ;;(print-asm) ) - + (rlet ((s0 :reg rbx :type uint) (s1 :reg rbp :type uint) (s2 :reg r10 :type uint) (s3 :reg r11 :type uint) (s4 :reg r12 :type uint) (a0 :reg rdi :type uint) ; ok - (a1 :reg rsi :type uint) ; ok + (a1 :reg rsi :type uint) ; ok (a2 :reg rdx :type uint) ; ok (a3 :reg rcx :type uint) ; ok (off :reg r15 :type uint) @@ -2302,25 +2358,25 @@ (temp :reg rax) ) - + (.mov temp return-from-thread-dead) (.add temp off) (.push temp) - + ;; stack is 16 + 8 aligned now - + (.mov :color #f a0 s1) (.mov :color #f a1 s2) (.mov :color #f a2 s3) (.mov :color #f a3 s4) - + (.add :color #f s0 off) (.jr :color #f s0) (.add a4 a4) (.add a5 a5) ) - + ) @@ -2330,7 +2386,7 @@ Once the function returns, the process deactivates." (let ((proc (-> thread process))) (set! (-> proc status) 'waiting-to-run) - + ;; we store arguments and the function to call in saved registers (set! (-> thread rreg 0) (the uint func)) (set! (-> thread rreg 1) (the uint a0)) @@ -2339,9 +2395,9 @@ (set! (-> thread rreg 4) (the uint a3)) (set! (-> thread rreg 5) (the uint a4)) (set! (-> thread rreg 6) (the uint a5)) - + ;; and have the thread first call set-to-run-bootstrap, which will properly call - ;; the function with the arguments and install a return trampoline for + ;; the function with the arguments and install a return trampoline for ;; deactivating and returning to the kernel on return. (set! (-> thread pc) (the pointer set-to-run-bootstrap)) ;; reset sp. @@ -2354,13 +2410,14 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod deactivate process-tree ((obj process-tree)) + "Can't deactivate a process-tree" (none) ) ;; The defstate macro isn't defined yet, so we do it manually. -(define dead-state +(define dead-state (the (state process) (new 'static 'state - :name #f + :name 'dead-state :next #f :exit #f :code #f @@ -2373,8 +2430,7 @@ ;; this is not yet defined. -(define-extern entity-deactivate-handler (function process entity none)) -(define entity-deactivate-handler (the (function process entity none) nothing)) +(define entity-deactivate-handler (the (function process entity-actor none) nothing)) (define-extern process-disconnect (function process int)) @@ -2387,24 +2443,27 @@ All protects/states will be cleaned up, with pp set correctly for the process. But you might not have the stack of your main thread, so don't reference stack vars from within your exit handlers." - + ;; don't do anything if we already died. (unless (eq? (-> obj status) 'dead) + ;; set our state to a dead-state that does nothing. (set! (-> obj next-state) dead-state) - - ;; call entity handler + + ;; call entity handler if we're from an entity. (when (-> obj entity) (entity-deactivate-handler obj (-> obj entity)) ) - + ;; clean up stack frames the process is in. ;; first, set pp so the cleanup code thinks its running in the right process. + ;; we might be getting deactivated from another process. (rlet ((pp :reg r13 :type process)) (let ((old-pp pp)) (set! pp obj) (let ((cur (-> pp stack-frame-top))) + ;; loop over frames... (while cur - (case (-> cur type) + (case (-> cur type) ((protect-frame state) ;; we're a state or protect-frame, we can exit. ((-> (the-as protect-frame cur) exit)) @@ -2416,12 +2475,13 @@ (set! pp old-pp) ) ) - + + ;; remove our connections. ;; hack - if this isn't defined yet, don't try it. (if (!= 0 (the uint process-disconnect)) (process-disconnect obj) ) - + ;; kill our child and their brothers (let ((bro (-> obj child))) (while bro @@ -2431,14 +2491,14 @@ ) ) ) - + ;; return ourself to the pool (return-process (-> obj pool) obj) (set! (-> obj state) #f) (set! (-> obj next-state) #f) (set! (-> obj entity) #f) (set! (-> obj pid) 0) - + ;; deal with getting out of here. (cond ;; first case - we deactivated the running process @@ -2448,6 +2508,7 @@ ;; go straight to dead. (set! (-> obj status) 'dead) ;; and return (with no deactivate) + ;; TODO: replace with abandon. (let ((temp (the uint return-from-thread))) (rlet ((off :reg r15 :type uint)) (+! temp off) @@ -2458,13 +2519,8 @@ ) ;; second case - we deactivated while initializing. ((eq? (-> obj status) 'initialize) - ;; added this - - ; (if (!= pp obj) - ; (format 0 "ERROR: deactivated a non-current initializing process!") - ; (break) - ; ) (set! (-> obj status) 'dead) + ;; throw back to the place where we started initializing. (throw 'initialize #f) ) ) @@ -2478,14 +2534,20 @@ ;; Process Globals ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; the listener process is used to run functions from the REPL. (let ((obj (define *listener-process* (new 'global 'process 'listener 2048)))) (set! (-> obj status) 'ready) (set! (-> obj pid) 1) (set! (-> obj main-thread) (new 'process 'cpu-thread obj 'main 256 *kernel-dram-stack*)) ) -;; these are unknown +;; a dummy process for process records that don't have a process to point to. +;; it has a PID of 0, which matches nothing so the handle->process will return #f if the +;; ppointer points to this (define *null-process* (new 'global 'process 'listener 16)) + +;; do we have visibility data? level.gc will set this once we do, and once that happens, we expect +;; actors to fit in the non-debug heap. (define *vis-boot* #f) ;; a few pools of fixed size processes that are shared. @@ -2498,31 +2560,44 @@ (define *camera-dead-pool* (new 'global 'dead-pool 7 (* 4 1024) '*camera-dead-pool*)) (define *camera-master-dead-pool* (new 'global 'dead-pool 1 (* 8 1024) '*camera-master-dead-pool*)) +;; used if other pools run out of space in debug mode (if *debug-segment* (define *debug-dead-pool* (new 'debug 'dead-pool-heap '*debug-dead-pool* 768 (* 1024 1024))) ) +;; variable sized actor pool (most actors go here) (define *nk-dead-pool* (new 'global 'dead-pool-heap '*nk-dead-pool* (* PROCESS_HEAP_MULT 768) PROCESS_HEAP_SIZE)) + +;; use the nk-dead-pool in most places (define *default-dead-pool* (the dead-pool *nk-dead-pool*)) (define *pickup-dead-pool* (the dead-pool *nk-dead-pool*)) +;; list of all dead pools held by the kernel. (define *dead-pool-list* '(*4k-dead-pool* *8k-dead-pool* *16k-dead-pool* *nk-dead-pool* *target-dead-pool* *camera-dead-pool* *camera-master-dead-pool*)) -;; main active pool +;; main active pool. All active processes are under here. This is what the kernel-dispatcher looks at. (define *active-pool* (new 'global 'process-tree 'active-pool)) -;; other active pools +;; create pools within *active-pool* + +;; the *display-pool* will contain the display process which does rendering, vsync, and many per-frame updates. (change-parent (define *display-pool* (new 'global 'process-tree 'display-pool)) *active-pool*) +;; the *camera-pool* will contain all cameras (change-parent (define *camera-pool* (new 'global 'process-tree 'camera-pool)) *active-pool*) +;; all cameras should pause in menus (set! (-> *camera-pool* mask) (process-mask pause menu progress camera process-tree)) +;; the *target-pool* will contain jak (change-parent (define *target-pool* (new 'global 'process-tree 'target-pool)) *active-pool*) +;; pause in menus (set! (-> *target-pool* mask) (process-mask pause menu progress process-tree)) +;; the *entity-pool* contains all processes spawned from entities. (change-parent (define *entity-pool* (new 'global 'process-tree 'entity-pool)) *active-pool*) (set! (-> *entity-pool* mask) (process-mask pause menu progress entity process-tree)) +;; the *default-pool* is used for processes that don't fall into the others. (change-parent (define *default-pool* (new 'global 'process-tree 'default-pool)) *active-pool*) (set! (-> *default-pool* mask) (process-mask pause menu progress process-tree)) diff --git a/goal_src/kernel/gstate.gc b/goal_src/kernel/gstate.gc index 68adfe52f2..496d58e446 100644 --- a/goal_src/kernel/gstate.gc +++ b/goal_src/kernel/gstate.gc @@ -31,7 +31,7 @@ There are several ways to "go" Use the go-process macro to do this. - go from a non-main thread in the right process. You can do a go from a temporary thread, like trans or post. - If you do it from post, the go returns. If you do it from any other thread, the temporary thread + If you do it from post, the go returns and the rest of the post runs. If you do it from any other thread, the temporary thread is immediately abandonded. Like the previous two, it will defer the actual go until the next time the process runs. @@ -50,20 +50,22 @@ It type checks the arguments for the entry function. |# -;; cause the current process to change state (defmacro go (next-state &rest args) + "Change the state of the current process. + This will only return if this is called within the post thread. + Otherwise, execution stops here and the kernel will run the next state next time." `(with-pp (go-hook pp ,next-state ,@args) ) ) (defmacro go-virtual (state-name &key (proc self) &rest args) - "Change the current process to the virtual state of the given process." + "Same as go, but use a virtual state." `(go (method-of-object ,proc ,state-name) ,@args) ) -;; cause the given process to change state. (defmacro go-process (proc next-state &rest args) + "Make another process go." `(with-pp (protect (pp) (set! pp ,proc) @@ -79,6 +81,7 @@ It type checks the arguments for the entry function. ;; - you go ;; - you throw to 'initialize (defmacro run-now-in-process (proc func &rest args) + "Run a function in another process right now." `((the (function _varargs_ object) run-function-in-process) ,proc ,func ,@args ) @@ -87,12 +90,13 @@ It type checks the arguments for the entry function. ;; sets the main thread of the given process to run the given thing. ;; this resets the main thread stack back to the top (defmacro run-next-time-in-process (proc func &rest args) + "Set up a process to run a function the next time it is scheduled." `((the (function _varargs_ object) set-to-run) (-> ,proc main-thread) ,func ,@args ) ) -(defmacro make-function-process (proc-type func &key (from *default-dead-pool*) &key (to *default-pool*) &key (name #f) &key (stack-size #x4000) &key (stack *kernel-dram-stack*) &rest args) +(defmacro process-spawn-function (proc-type func &key (from *default-dead-pool*) &key (to *default-pool*) &key (name #f) &key (stack-size #x4000) &key (stack *scratch-memory-top*) &rest args) "Start a new process that runs a function on its main thread. Returns a pointer to the new process (or #f? on error)." @@ -107,7 +111,7 @@ It type checks the arguments for the entry function. ) ) -(defmacro make-init-process (proc-type func &key (from *default-dead-pool*) &key (to *default-pool*) &key (name #f) &key (stack-size #x4000) &key (stack *kernel-dram-stack*) &rest args) +(defmacro process-spawn (proc-type &key (init #f) &key (from *default-dead-pool*) &key (to *default-pool*) &key (name #f) &key (stack-size #x4000) &key (stack *scratch-memory-top*) &rest args) "Start a new process and run an init function on it. Returns a pointer to the new process, or #f (or is it 0?) if something goes wrong." @@ -115,7 +119,7 @@ It type checks the arguments for the entry function. `(let ((,new-proc (the-as ,proc-type (get-process ,from ,proc-type ,stack-size)))) (when ,new-proc ((method-of-type ,proc-type activate) ,new-proc ,to ,(if name name `(quote ,proc-type)) ,stack) - (run-now-in-process ,new-proc ,func ,@args) + (run-now-in-process ,new-proc ,(if init init (string->symbol (fmt #f "{}-init-by-other" proc-type))) ,@args) (the (pointer ,proc-type) (-> ,new-proc ppointer)) ) ) @@ -307,7 +311,6 @@ It type checks the arguments for the entry function. (define-extern enter-state (function object object object object object object object)) (defun enter-state (arg0 arg1 arg2 arg3 arg4 arg5) "Make the process stored in pp enter the state in pp next-state" - ;;(declare (print-asm)) (with-pp ;; unsleep us (process-mask-clear! (-> pp mask) sleep sleep-code) @@ -318,6 +321,7 @@ It type checks the arguments for the entry function. ;; did a go during initialize. ;; remove the old trans hook, if there was one (set! (-> pp trans-hook) #f) + ;; set us up to run enter-state again, the next time we're scheduled. (set-to-run (-> pp main-thread) enter-state arg0 arg1 arg2 arg3 arg4 arg5) ;; tell the kernel that we did a go during init (set! (-> pp status) 'initialize-go) @@ -339,10 +343,14 @@ It type checks the arguments for the entry function. ) ((= (-> pp main-thread) (-> pp top-thread)) ;; we are in the right process, and in the main thread! - ;; actually do a go! + ;; we will do a nonlocal control transfer to the new state's code. + ;; the new state can then suspend and get back to the kernel dispatcher lambda + ;; like normal. + + ;; change state! (set! (-> pp state) (-> pp next-state)) - ;; loop through current stack frames + ;; do exits (let ((frame (-> pp stack-frame-top))) (while frame (case (-> frame type) @@ -354,7 +362,7 @@ It type checks the arguments for the entry function. ) ) - ;; done with going! + ;; done with going, clear the mask (process-mask-clear! (-> pp mask) going) ;; now, update the process: @@ -369,19 +377,25 @@ It type checks the arguments for the entry function. ) (set! (-> pp post-hook) (-> new-state post)) (set! (-> pp trans-hook) (-> new-state trans)) - ;; now do the enter + + + ;; start up the new state. First run the enter function (let ((enter-func (-> new-state enter))) (if enter-func ((the (function _varargs_ none) enter-func) arg0 arg1 arg2 arg3 arg4 arg5) ) ) - ;; now do the trans + + ;; run the trans function before the code. (let ((trans-func (-> new-state trans))) (if trans-func (trans-func) ) ) ;; now we run the code, but in a tricky way. + ;; we need to: + ;; - make sure that when this code returns, we do a deactivate + ;; - reset the stack to the top, so we can't just call the code. (rlet ((temp) (func) (sp :reg rsp :type uint) @@ -405,7 +419,7 @@ It type checks the arguments for the entry function. (.mov sp (-> pp main-thread stack-top)) (.add sp off) ;; push the return trampoline for when code returns. - (.mov temp return-from-thread-dead) + (.mov temp return-from-thread-dead) ;; will deactivate (.add temp off) (.push temp) ;; and call! @@ -432,7 +446,7 @@ It type checks the arguments for the entry function. ;; temporary, but if this turns out to be false, we will need to change this. (rlet ((temp) (off :reg r15 :type uint :reset-here #t)) - (.mov temp return-from-thread) + (.mov temp return-from-thread) ;; could probably just call this... (.add temp off) (.push temp) (.ret) @@ -460,18 +474,16 @@ It type checks the arguments for the entry function. ) ) -(defmacro send-event (proc msg &rest params) +(defmacro send-event (proc msg &key (from (with-pp pp)) &rest params) "Send an event to a process. This should be used over send-event-function" - `(with-pp - (let ((event-data (new 'stack-no-clear 'event-message-block))) - (set! (-> event-data from) pp) + `(let ((event-data (new 'stack-no-clear 'event-message-block))) + (set! (-> event-data from) ,from) (set! (-> event-data num-params) ,(length params)) (set! (-> event-data message) ,msg) ,@(apply-i (lambda (x i) `(set! (-> event-data param ,i) (the-as uint ,x))) params) (send-event-function ,proc event-data) ) - ) ) (defun looping-code () diff --git a/goal_src/kernel/gstring.gc b/goal_src/kernel/gstring.gc index 77497873f8..f713c02020 100644 --- a/goal_src/kernel/gstring.gc +++ b/goal_src/kernel/gstring.gc @@ -700,13 +700,23 @@ ) ) -;; what is this? +;;;;;;;;;;;;;;;;;;;;; +;; Globals +;;;;;;;;;;;;;;;;;;;;; + +;; The *stdcon* buffer holds text to be printed to the screen for debugging. +;; Under the hood, there are actually two buffers: *stdcon1* and *stdcon0* + +;; The *stdcon0* buffer is the default and is cleared on each frame. +;; The *stdcon1* buffer is cleared only if the game is unpaused. This keeps text +;; on screen for game objects, even when the game is paused and their logic does not run. + +;; The kernel takes care of setting *stdcon* to one of these two buffers as needed. + (define *debug-draw-pauseable* #f) -;; console buffers. sometimes console 0 is backed up and the game switches to console 1. (define *stdcon0* (new 'global 'string 16384 (the string #f))) (define *stdcon1* (new 'global 'string 16384 (the string #f))) -;; the current onscreen console (define *stdcon* *stdcon0*) ;; shared temporary string. diff --git a/goal_src/levels/beach/air-h.gc b/goal_src/levels/beach/air-h.gc index 76da8e8d01..67f8ba65db 100644 --- a/goal_src/levels/beach/air-h.gc +++ b/goal_src/levels/beach/air-h.gc @@ -5,64 +5,58 @@ ;; name in dgo: air-h ;; dgos: BEA, L1 -;; definition of type air-box +;; DECOMP BEGINS + (deftype air-box (structure) - ((vecs vector 2 :inline :offset-assert 0) - (x-pos float :offset 0) - (height-level float :offset 4) - (z-pos float :offset 8) - (cos-angle float :offset 12) - (x-length float :offset 16) - (z-length float :offset 24) - (sin-angle float :offset 28) + ((vecs vector 2 :inline :offset-assert 0) + (x-pos float :offset 0) + (height-level float :offset 4) + (z-pos float :offset 8) + (cos-angle float :offset 12) + (x-length float :offset 16) + (z-length float :offset 24) + (sin-angle float :offset 28) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -;; definition for function point-in-air-box-area? + (defun point-in-air-box-area? ((arg0 float) (arg1 float) (arg2 air-box)) (let ((v0-0 #f)) - (let ((f0-2 (+ (* arg0 (-> arg2 vecs 0 w)) (* arg1 (-> arg2 vecs 1 w)))) - (f1-5 (- (* arg1 (-> arg2 vecs 0 w)) (* arg0 (-> arg2 vecs 1 w)))) - ) - (if - (and - (>= f0-2 0.0) - (>= f1-5 0.0) - (< f0-2 (-> arg2 vecs 1 x)) - (< f1-5 (-> arg2 vecs 1 z)) - ) - (set! v0-0 #t) - ) - ) - v0-0 - ) - ) - -;; definition for function point-in-air-box? -(defun point-in-air-box? ((arg0 vector) (arg1 air-box)) - (when (< (-> arg1 vecs 0 y) (-> arg0 y)) - (let ((f1-2 (- (-> arg0 x) (the-as float (-> arg1 vecs 0 x)))) - (f2-1 (- (-> arg0 z) (-> arg1 vecs 0 z))) - (v1-0 arg1) - (v0-0 #f) - ) - (let ((f0-5 (+ (* f1-2 (-> v1-0 vecs 0 w)) (* f2-1 (-> v1-0 vecs 1 w)))) - (f1-4 (- (* f2-1 (-> v1-0 vecs 0 w)) (* f1-2 (-> v1-0 vecs 1 w)))) + (let ((f0-2 (+ (* arg0 (-> arg2 cos-angle)) (* arg1 (-> arg2 sin-angle)))) + (f1-5 (- (* arg1 (-> arg2 cos-angle)) (* arg0 (-> arg2 sin-angle)))) + ) + (if (and (>= f0-2 0.0) (>= f1-5 0.0) (< f0-2 (-> arg2 x-length)) (< f1-5 (-> arg2 z-length))) + (set! v0-0 #t) ) - (if - (and - (>= f0-5 0.0) - (>= f1-4 0.0) - (< f0-5 (-> v1-0 vecs 1 x)) - (< f1-4 (-> v1-0 vecs 1 z)) - ) - (set! v0-0 #t) ) - ) v0-0 ) - ) ) + +(defun point-in-air-box? ((arg0 vector) (arg1 air-box)) + (when (< (-> arg1 height-level) (-> arg0 y)) + (let ((f1-2 (- (-> arg0 x) (the-as float (-> arg1 x-pos)))) + (f2-1 (- (-> arg0 z) (-> arg1 z-pos))) + (v1-0 arg1) + (v0-0 #f) + ) + (let ((f0-5 (+ (* f1-2 (-> v1-0 cos-angle)) (* f2-1 (-> v1-0 sin-angle)))) + (f1-4 (- (* f2-1 (-> v1-0 cos-angle)) (* f1-2 (-> v1-0 sin-angle)))) + ) + (if (and (>= f0-5 0.0) (>= f1-4 0.0) (< f0-5 (-> v1-0 x-length)) (< f1-4 (-> v1-0 z-length))) + (set! v0-0 #t) + ) + ) + v0-0 + ) + ) + ) + +0 + + + + diff --git a/goal_src/levels/beach/air.gc b/goal_src/levels/beach/air.gc index 88b56ca722..4154de00e5 100644 --- a/goal_src/levels/beach/air.gc +++ b/goal_src/levels/beach/air.gc @@ -5,210 +5,138 @@ ;; name in dgo: air ;; dgos: BEA, L1 -;; definition for function point-in-air? +;; DECOMP BEGINS + (defun point-in-air? ((arg0 vector) (arg1 (inline-array air-box)) (arg2 int)) (local-vars (t0-0 symbol)) (dotimes (v1-0 arg2) - (let ((t1-0 arg0) - (a3-1 (-> arg1 v1-0)) - ) - (set! t0-0 (when (< (-> a3-1 height-level) (-> t1-0 y)) - (let ((f0-2 (- (-> t1-0 x) (-> a3-1 x-pos))) - (f2-1 (- (-> t1-0 z) (-> a3-1 z-pos))) + (let ((t1-0 arg0) + (a3-1 (-> arg1 v1-0)) + ) + (set! t0-0 + (when (< (-> a3-1 height-level) (-> t1-0 y)) + (let ((f0-2 (- (-> t1-0 x) (-> a3-1 x-pos))) + (f2-1 (- (-> t1-0 z) (-> a3-1 z-pos))) + ) + (set! t0-0 #f) + (let ((f1-5 (+ (* f0-2 (-> a3-1 cos-angle)) (* f2-1 (-> a3-1 sin-angle)))) + (f0-4 (- (* f2-1 (-> a3-1 cos-angle)) (* f0-2 (-> a3-1 sin-angle)))) + ) + (if (and (>= f1-5 0.0) (>= f0-4 0.0) (< f1-5 (-> a3-1 x-length)) (< f0-4 (-> a3-1 z-length))) + (set! t0-0 #t) ) - (set! t0-0 #f) - (let - ((f1-5 - (+ - (* f0-2 (-> a3-1 cos-angle)) - (* f2-1 (-> a3-1 sin-angle)) - ) - ) - (f0-4 - (- - (* f2-1 (-> a3-1 cos-angle)) - (* f0-2 (-> a3-1 sin-angle)) - ) - ) - ) - (if - (and - (>= f1-5 0.0) - (>= f0-4 0.0) - (< f1-5 (-> a3-1 x-length)) - (< f0-4 (-> a3-1 z-length)) - ) - (set! t0-0 #t) - ) ) - ) - t0-0 ) - ) + t0-0 + ) + ) + ) + (if t0-0 + (return #t) + ) ) - (if t0-0 - (return #t) - ) - ) #f ) -;; definition for function points-in-air? -(defun - points-in-air? - ((arg0 vector) (arg1 vector) (arg2 (inline-array air-box)) (arg3 int)) +(defun points-in-air? ((arg0 vector) (arg1 vector) (arg2 (inline-array air-box)) (arg3 int)) (local-vars (t1-4 symbol)) (dotimes (v1-0 arg3) - (let* ((t0-1 (-> arg2 v1-0)) - (f0-0 (-> t0-1 height-level)) - ) - (when (and (< f0-0 (-> arg0 y)) (< f0-0 (-> arg1 y))) - (let ((f2-0 (- (-> arg0 x) (-> t0-1 x-pos))) - (f4-0 (- (-> arg0 z) (-> t0-1 z-pos))) - (f0-4 (- (-> arg1 x) (-> t0-1 x-pos))) - (f1-6 (- (-> arg1 z) (-> t0-1 z-pos))) - (t2-0 t0-1) - (t1-3 #f) + (let* ((t0-1 (-> arg2 v1-0)) + (f0-0 (-> t0-1 height-level)) ) - (let ((f3-3 (+ (* f2-0 (-> t2-0 cos-angle)) (* f4-0 (-> t2-0 sin-angle)))) - (f2-2 (- (* f4-0 (-> t2-0 cos-angle)) (* f2-0 (-> t2-0 sin-angle)))) + (when (and (< f0-0 (-> arg0 y)) (< f0-0 (-> arg1 y))) + (let ((f2-0 (- (-> arg0 x) (-> t0-1 x-pos))) + (f4-0 (- (-> arg0 z) (-> t0-1 z-pos))) + (f0-4 (- (-> arg1 x) (-> t0-1 x-pos))) + (f1-6 (- (-> arg1 z) (-> t0-1 z-pos))) + (t2-0 t0-1) + (t1-3 #f) + ) + (let ((f3-3 (+ (* f2-0 (-> t2-0 cos-angle)) (* f4-0 (-> t2-0 sin-angle)))) + (f2-2 (- (* f4-0 (-> t2-0 cos-angle)) (* f2-0 (-> t2-0 sin-angle)))) + ) + (if (and (>= f3-3 0.0) (>= f2-2 0.0) (< f3-3 (-> t2-0 x-length)) (< f2-2 (-> t2-0 z-length))) + (set! t1-3 #t) + ) ) - (if - (and - (>= f3-3 0.0) - (>= f2-2 0.0) - (< f3-3 (-> t2-0 x-length)) - (< f2-2 (-> t2-0 z-length)) - ) - (set! t1-3 #t) - ) - ) - (set! t1-4 (and t1-3 (begin + (set! t1-4 + (and t1-3 (begin (set! t1-4 #f) - (let - ((f2-5 - (+ - (* f0-4 (-> t0-1 cos-angle)) - (* f1-6 (-> t0-1 sin-angle)) - ) - ) - (f0-6 - (- - (* f1-6 (-> t0-1 cos-angle)) - (* f0-4 (-> t0-1 sin-angle)) - ) - ) + (let ((f2-5 (+ (* f0-4 (-> t0-1 cos-angle)) (* f1-6 (-> t0-1 sin-angle)))) + (f0-6 (- (* f1-6 (-> t0-1 cos-angle)) (* f0-4 (-> t0-1 sin-angle)))) + ) + (if (and (>= f2-5 0.0) (>= f0-6 0.0) (< f2-5 (-> t0-1 x-length)) (< f0-6 (-> t0-1 z-length))) + (set! t1-4 #t) + ) ) - (if - (and - (>= f2-5 0.0) - (>= f0-6 0.0) - (< f2-5 (-> t0-1 x-length)) - (< f0-6 (-> t0-1 z-length)) - ) - (set! t1-4 #t) - ) - ) t1-4 ) - ) - ) + ) + ) + ) + (if t1-4 + (return #t) + ) + ) ) - (if t1-4 - (return #t) - ) - ) ) - ) #f ) -;; definition (debug) for function add-debug-air-box -;; Used lq/sq (defun-debug add-debug-air-box ((arg0 bucket-id) (arg1 air-box)) (local-vars (a0-1 symbol)) (let ((a1-1 (camera-pos)) (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (-> arg1 cos-angle) - (-> arg1 sin-angle) - (let ((s2-0 (the-as uint #x800000ff))) - (let ((v1-0 arg1)) - (set! a0-1 (when (< (-> v1-0 height-level) (-> a1-1 y)) - (let ((f0-4 (- (-> a1-1 x) (-> v1-0 x-pos))) - (f2-1 (- (-> a1-1 z) (-> v1-0 z-pos))) - ) + (-> arg1 cos-angle) + (-> arg1 sin-angle) + (let ((s2-0 (the-as uint #x800000ff))) + (let ((v1-0 arg1)) + (set! a0-1 + (when (< (-> v1-0 height-level) (-> a1-1 y)) + (let ((f0-4 (- (-> a1-1 x) (-> v1-0 x-pos))) + (f2-1 (- (-> a1-1 z) (-> v1-0 z-pos))) + ) (set! a0-1 #f) - (let - ((f1-5 - (+ - (* f0-4 (-> v1-0 cos-angle)) - (* f2-1 (-> v1-0 sin-angle)) - ) - ) - (f0-6 - (- - (* f2-1 (-> v1-0 cos-angle)) - (* f0-4 (-> v1-0 sin-angle)) - ) - ) + (let ((f1-5 (+ (* f0-4 (-> v1-0 cos-angle)) (* f2-1 (-> v1-0 sin-angle)))) + (f0-6 (- (* f2-1 (-> v1-0 cos-angle)) (* f0-4 (-> v1-0 sin-angle)))) + ) + (if (and (>= f1-5 0.0) (>= f0-6 0.0) (< f1-5 (-> v1-0 x-length)) (< f0-6 (-> v1-0 z-length))) + (set! a0-1 #t) + ) ) - (if - (and - (>= f1-5 0.0) - (>= f0-6 0.0) - (< f1-5 (-> v1-0 x-length)) - (< f0-6 (-> v1-0 z-length)) - ) - (set! a0-1 #t) - ) - ) ) - a0-1 - ) + a0-1 + ) + ) + ) + (if a0-1 + (set! s2-0 (the-as uint #x8000ff00)) + ) + (set! (-> s5-0 y) (-> arg1 height-level)) + (set! (-> s4-0 y) (-> arg1 height-level)) + (set! (-> s5-0 w) 1.0) + (set! (-> s4-0 w) 1.0) + (set! (-> s5-0 x) (-> arg1 x-pos)) + (set! (-> s5-0 z) (-> arg1 z-pos)) + (set! (-> s4-0 x) (+ (-> arg1 x-pos) (* (-> arg1 cos-angle) (-> arg1 x-length)))) + (set! (-> s4-0 z) (+ (-> arg1 z-pos) (* (-> arg1 sin-angle) (-> arg1 x-length)))) + (add-debug-line #t arg0 s5-0 s4-0 (the-as rgba s2-0) #f (the-as rgba -1)) + (set! (-> s5-0 quad) (-> s4-0 quad)) + (set! (-> s4-0 x) (+ (-> s5-0 x) (* (- (-> arg1 sin-angle)) (-> arg1 z-length)))) + (set! (-> s4-0 z) (+ (-> s5-0 z) (* (-> arg1 cos-angle) (-> arg1 z-length)))) + (add-debug-line #t arg0 s5-0 s4-0 (the-as rgba s2-0) #f (the-as rgba -1)) + (set! (-> s5-0 x) (+ (-> arg1 x-pos) (* (- (-> arg1 sin-angle)) (-> arg1 z-length)))) + (set! (-> s5-0 z) (+ (-> arg1 z-pos) (* (-> arg1 cos-angle) (-> arg1 z-length)))) + (add-debug-line #t arg0 s5-0 s4-0 (the-as rgba s2-0) #f (the-as rgba -1)) + (set! (-> s4-0 x) (-> arg1 x-pos)) + (set! (-> s4-0 z) (-> arg1 z-pos)) + (add-debug-line #t arg0 s5-0 s4-0 (the-as rgba s2-0) #f (the-as rgba -1)) ) - ) - (if a0-1 - (set! s2-0 (the-as uint #x8000ff00)) - ) - (set! (-> s5-0 y) (-> arg1 height-level)) - (set! (-> s4-0 y) (-> arg1 height-level)) - (set! (-> s5-0 w) 1.0) - (set! (-> s4-0 w) 1.0) - (set! (-> s5-0 x) (-> arg1 x-pos)) - (set! (-> s5-0 z) (-> arg1 z-pos)) - (set! - (-> s4-0 x) - (+ (-> arg1 x-pos) (* (-> arg1 cos-angle) (-> arg1 x-length))) - ) - (set! - (-> s4-0 z) - (+ (-> arg1 z-pos) (* (-> arg1 sin-angle) (-> arg1 x-length))) - ) - (add-debug-line #t arg0 s5-0 s4-0 (the-as rgba s2-0) #f (the-as rgba -1)) - (set! (-> s5-0 quad) (-> s4-0 quad)) - (set! - (-> s4-0 x) - (+ (-> s5-0 x) (* (- (-> arg1 sin-angle)) (-> arg1 z-length))) - ) - (set! - (-> s4-0 z) - (+ (-> s5-0 z) (* (-> arg1 cos-angle) (-> arg1 z-length))) - ) - (add-debug-line #t arg0 s5-0 s4-0 (the-as rgba s2-0) #f (the-as rgba -1)) - (set! - (-> s5-0 x) - (+ (-> arg1 x-pos) (* (- (-> arg1 sin-angle)) (-> arg1 z-length))) - ) - (set! - (-> s5-0 z) - (+ (-> arg1 z-pos) (* (-> arg1 cos-angle) (-> arg1 z-length))) - ) - (add-debug-line #t arg0 s5-0 s4-0 (the-as rgba s2-0) #f (the-as rgba -1)) - (set! (-> s4-0 x) (-> arg1 x-pos)) - (set! (-> s4-0 z) (-> arg1 z-pos)) - (add-debug-line #t arg0 s5-0 s4-0 (the-as rgba s2-0) #f (the-as rgba -1)) ) - ) ) + + + + diff --git a/goal_src/levels/beach/beach-obs.gc b/goal_src/levels/beach/beach-obs.gc index a0f54073a3..a322d1fc6f 100644 --- a/goal_src/levels/beach/beach-obs.gc +++ b/goal_src/levels/beach/beach-obs.gc @@ -9,13 +9,20 @@ ;; DECOMP BEGINS -(defskelgroup *beachcam-sg* beachcam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 60) - :longest-edge (meters 0) - ) +(import "goal_src/import/ecoventrock-ag.gc") +(import "goal_src/import/beachcam-ag.gc") +(import "goal_src/import/windmill-one-ag.gc") +(import "goal_src/import/kickrock-ag.gc") +(import "goal_src/import/harvester-ag.gc") +(import "goal_src/import/flutflutegg-ag.gc") +(import "goal_src/import/grottopole-ag.gc") +(import "goal_src/import/flutflut-ag.gc") +(import "goal_src/import/bladeassm-ag.gc") + +(defskelgroup *beachcam-sg* beachcam beachcam-lod0-jg beachcam-anim-ja + ((beachcam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 60) + ) (deftype windmill-one (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -31,55 +38,37 @@ ) -(defskelgroup *windmill-one-sg* windmill-one - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem -12 -8 -1 16) - :longest-edge (meters 7.5) - ) +(defskelgroup *windmill-one-sg* windmill-one windmill-one-lod0-jg windmill-one-idle-ja + ((windmill-one-lod0-mg (meters 20)) (windmill-one-lod1-mg (meters 40)) (windmill-one-lod2-mg (meters 999999))) + :bounds (static-spherem -12 -8 -1 16) + :longest-edge (meters 7.5) + ) (defstate windmill-one-idle (windmill-one) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self sound-id)) (none) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (let ((t2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)))) (if (!= (+ (-> t2-0 x) (-> t2-0 y) (-> t2-0 z)) 0.0) - (sound-play-by-name (static-sound-name "gears-rumble") (-> self sound-id) 1024 0 0 1 (the-as symbol t2-0)) + (sound-play "gears-rumble" :id (-> self sound-id) :position (the-as symbol t2-0)) ) ) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 0.5) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max 0.5) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 0.5) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.5)) ) ) (none) ) - :post - (the-as (function none :behavior windmill-one) rider-post) + :post (the-as (function none :behavior windmill-one) rider-post) ) (defmethod init-from-entity! windmill-one ((obj windmill-one) (arg0 entity-actor)) @@ -135,8 +124,7 @@ :id 155 :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 539 :period 1500 :length 15) + :parts ((sp-item 539 :period 1500 :length 15) (sp-item 539 :period 1500 :length 30) (sp-item 539 :period 1500 :length 45) (sp-item 539 :period 1500 :length 75) @@ -147,8 +135,7 @@ ) (defpart 539 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -9) (meters 18) 1.0) (sp-flt spt-y (meters -6)) @@ -171,8 +158,7 @@ ) (defpart 540 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-flt spt-y (meters -7)) (sp-rnd-flt spt-scale-x (meters 3) (meters 4.5) 1.0) @@ -197,13 +183,11 @@ ) (defpart 541 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 450 239 1) (sp-launcher-by-id spt-next-launcher 542)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 450 239 1) (sp-launcher-by-id spt-next-launcher 542)) ) (defpart 542 - :init-specs - ((sp-flt spt-fade-a -0.14222223)) + :init-specs ((sp-flt spt-fade-a -0.14222223)) ) (deftype grottopole (process-drawable) @@ -226,17 +210,13 @@ ) -(defskelgroup *grottopole-sg* grottopole - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 -8 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *grottopole-sg* grottopole grottopole-lod0-jg grottopole-idle-ja + ((grottopole-lod0-mg (meters 20)) (grottopole-lod1-mg (meters 999999))) + :bounds (static-spherem 0 -8 0 9) + ) (defstate grottopole-idle (grottopole) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (= (-> arg0 type) target) (case arg2 (('attack) @@ -253,8 +233,8 @@ (the-as uint 2) ) ) - (sound-play-by-name (static-sound-name "grotto-pole-hit") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "dirt-crumble") (new-sound-id) 1024 0 0 1 #t) + (sound-play "grotto-pole-hit") + (sound-play "dirt-crumble") (increment-success-for-hint (game-text-id beach-grottopole-increment)) (go grottopole-moving-up) ) @@ -268,8 +248,8 @@ (the-as uint 1) ) ) - (sound-play-by-name (static-sound-name "grotto-pole-hit") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "dirt-crumble") (new-sound-id) 1024 0 0 1 #t) + (sound-play "grotto-pole-hit") + (sound-play "dirt-crumble") (go grottopole-moving-down) ) ) @@ -280,20 +260,12 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 3) :num! min) (transform-post) (suspend) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -340,8 +312,7 @@ ) (defstate grottopole-moving-up (grottopole) - :code - (behavior () + :code (behavior () (+! (-> self position) 1) (let ((v1-4 (-> self entity extra perm))) (logior! (-> v1-4 status) (entity-perm-status user-set-from-cstage)) @@ -351,13 +322,11 @@ (go grottopole-idle) (none) ) - :post - (the-as (function none :behavior grottopole) transform-post) + :post (the-as (function none :behavior grottopole) transform-post) ) (defstate grottopole-moving-down (grottopole) - :code - (behavior () + :code (behavior () (+! (-> self position) -1) (let ((v1-4 (-> self entity extra perm))) (logior! (-> v1-4 status) (entity-perm-status user-set-from-cstage)) @@ -367,8 +336,7 @@ (go grottopole-idle) (none) ) - :post - (the-as (function none :behavior grottopole) transform-post) + :post (the-as (function none :behavior grottopole) transform-post) ) (defmethod init-from-entity! grottopole ((obj grottopole) (arg0 entity-actor)) @@ -438,21 +406,17 @@ ) -(defskelgroup *ecoventrock-sg* ecoventrock - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 1 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *ecoventrock-sg* ecoventrock ecoventrock-lod0-jg ecoventrock-idle-ja + ((ecoventrock-lod0-mg (meters 20)) (ecoventrock-lod1-mg (meters 999999))) + :bounds (static-spherem 0 1 0 3) + ) (defpartgroup group-beach-harvester-rock-explosion :id 156 :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 543 :period 1500 :length 5) + :parts ((sp-item 543 :period 1500 :length 5) (sp-item 544 :period 1500 :length 5) (sp-item 545 :period 1500 :length 5) (sp-item 546 :period 1500 :length 5) @@ -462,8 +426,7 @@ ) (defpart 547 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 15)) (sp-copy-from-other spt-scale-y -4) @@ -478,8 +441,7 @@ ) (defpart 543 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 4.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -502,8 +464,7 @@ ) (defpart 544 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 4.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -526,8 +487,7 @@ ) (defpart 545 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 4.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -550,16 +510,14 @@ ) (defpart 549 - :init-specs - ((sp-flt spt-vel-y (meters 0.026666667)) + :init-specs ((sp-flt spt-vel-y (meters 0.026666667)) (sp-rnd-int-flt spt-rotvel-z (degrees -1.2) 1 436.90668) (sp-flt spt-fade-a -1.0666667) ) ) (defpart 548 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -583,25 +541,22 @@ ) (defpart 550 - :init-specs - ((sp-flt spt-fade-a -0.2)) + :init-specs ((sp-flt spt-fade-a -0.2)) ) (defstate ecoventrock-idle (ecoventrock) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) - (sound-play-by-name (static-sound-name "cannon-shot") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cannon-shot") (increment-success-for-hint (game-text-id beach-eco-rock-increment)) (go ecoventrock-break #f) ) ) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -610,18 +565,15 @@ ) (defstate ecoventrock-break (ecoventrock) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior ecoventrock) process-drawable-fuel-cell-handler ) - :enter - (behavior ((arg0 symbol)) + :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (local-vars (sv-128 symbol)) (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) @@ -636,23 +588,16 @@ ) ) (when (not arg0) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker s5-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - part-tracker-init - (-> *part-group-id-table* 156) - -1 - #f - #f - #f - (-> self root-override root-prim prim-core) - ) - (-> s5-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 156) + -1 + #f + #f + #f + (-> self root-override root-prim prim-core) + :to *entity-pool* ) (let* ((s5-1 (-> self root-override trans)) (v1-14 (target-pos 0)) @@ -712,24 +657,8 @@ ) (else (ambient-hint-spawn "gamcam10" (the-as vector #f) *entity-pool* 'camera) - (let ((gp-2 (get-process *default-dead-pool* pov-camera #x4000))) - (ppointer->handle (when gp-2 - (let ((t9-23 (method-of-type pov-camera activate))) - (t9-23 (the-as pov-camera gp-2) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - pov-camera-init-by-other - (-> self root-override trans) - *beachcam-sg* - (-> self name) - 0 - #f - '() - ) - (-> gp-2 ppointer) - ) - ) + (ppointer->handle + (process-spawn pov-camera (-> self root-override trans) *beachcam-sg* (-> self name) 0 #f '() :to self) ) ) ) @@ -794,29 +723,24 @@ ) -(defskelgroup *kickrock-sg* kickrock - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *kickrock-sg* kickrock kickrock-lod0-jg kickrock-idle-ja + ((kickrock-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) (defstate flying-rock-rolling (flying-rock) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 #f) (f30-0 0.99) (s5-0 0) ) (while (< s5-0 2) (cond - ((logtest? (-> self root-override status) 1) + ((logtest? (-> self root-override status) (cshape-moving-flags onsurf)) (when (not gp-0) (+! s5-0 1) (set! f30-0 0.8) @@ -850,7 +774,7 @@ ) (while (< 2048.0 (vector-length (-> self root-override transv))) (cond - ((logtest? (-> self root-override status) 1) + ((logtest? (-> self root-override status) (cshape-moving-flags onsurf)) (vector-float*! (-> self root-override transv) (-> self root-override transv) 0.8) ) (else @@ -883,8 +807,7 @@ (go flying-rock-idle) (none) ) - :post - (behavior () + :post (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) (go flying-rock-idle) ) @@ -894,8 +817,7 @@ ) (defstate flying-rock-idle (flying-rock) - :code - (behavior () + :code (behavior () (clear-collide-with-as (-> self root-override)) (while (or (logtest? (-> self draw status) (draw-status was-drawn)) (and *target* @@ -907,11 +829,10 @@ (deactivate self) (none) ) - :post - (the-as (function none :behavior flying-rock) ja-post) + :post (the-as (function none :behavior flying-rock) ja-post) ) -(defbehavior flying-rock-init-by-other flying-rock ((arg0 vector) (arg1 vector) (arg2 float) (arg3 entity)) +(defbehavior flying-rock-init-by-other flying-rock ((arg0 vector) (arg1 vector) (arg2 float) (arg3 entity-actor)) (set! (-> self entity) arg3) (let ((s3-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) (set! (-> s3-0 dynam) (copy *standard-dynamics* 'process)) @@ -953,15 +874,7 @@ ) (defun spawn-flying-rock ((arg0 vector) (arg1 vector) (arg2 float) (arg3 entity)) - (let ((s2-0 (get-process *default-dead-pool* flying-rock #x4000))) - (when s2-0 - (let ((t9-1 (method-of-type flying-rock activate))) - (t9-1 (the-as flying-rock s2-0) *entity-pool* 'flying-rock (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 flying-rock-init-by-other arg0 arg1 arg2 arg3) - (-> s2-0 ppointer) - ) - ) + (process-spawn flying-rock arg0 arg1 arg2 arg3 :to *entity-pool*) 0 (none) ) @@ -980,18 +893,15 @@ ) -(defskelgroup *bladeassm-sg* bladeassm - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 10) - ) +(defskelgroup *bladeassm-sg* bladeassm bladeassm-lod0-jg bladeassm-idle-ja + ((bladeassm-lod0-mg (meters 20)) (bladeassm-lod1-mg (meters 40)) (bladeassm-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :longest-edge (meters 10) + ) (defstate bladeassm-idle (bladeassm) - :code - (behavior () - (while #t + :code (behavior () + (loop (+! (-> self angle) (* 3640.889 (-> *display* seconds-per-frame))) (set! (-> self angle) (the float (sar (shl (the int (-> self angle)) 48) 48))) (pusher-post) @@ -1068,21 +978,15 @@ ) -(defskelgroup *flutflutegg-sg* flutflutegg - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 3.5 0 3.5) - :longest-edge (meters 0) - ) +(defskelgroup *flutflutegg-sg* flutflutegg flutflutegg-lod0-jg flutflutegg-idle-ja + ((flutflutegg-lod0-mg (meters 20)) (flutflutegg-lod1-mg (meters 40)) (flutflutegg-lod2-mg (meters 999999))) + :bounds (static-spherem 0 3.5 0 3.5) + ) -(defskelgroup *flutflut-naked-sg* flutflut - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *flutflut-naked-sg* flutflut flutflut-lod0-jg flutflut-flutflut-idle-ja + ((flutflut-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) (defmethod relocate flutflutegg ((obj flutflutegg) (arg0 int)) (if (nonzero? (-> obj wobbler)) @@ -1107,7 +1011,7 @@ ) (defbehavior flutflutegg-hit-sounds flutflutegg () - (sound-play-by-name (static-sound-name "egg-hit") (new-sound-id) 1024 0 0 1 #t) + (sound-play "egg-hit") (cond ((not (task-closed? (game-task beach-flutflut) (task-status need-introduction))) ) @@ -1126,8 +1030,7 @@ ) (defstate flutflutegg-idle (flutflutegg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (and (= arg2 'attack) (or (= (-> arg3 param 1) 'punch) (= (-> arg3 param 1) 'spin) (= (-> arg3 param 1) 'spin-air)) (!= (-> self incomming-attack-id) (-> arg3 param 2)) @@ -1152,8 +1055,7 @@ (go flutflutegg-physics) ) ) - :trans - (behavior () + :trans (behavior () (let* ((gp-0 (TODO-RENAME-10 (-> self ambient) (new 'stack-no-clear 'vector) (seconds 3) 368640.0 self)) (v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-3 (the-as number (logior #x3f800000 v1-2))) @@ -1211,10 +1113,9 @@ ) (none) ) - :code - (behavior () + :code (behavior () (ja-post) - (while #t + (loop (suspend) ) (none) @@ -1222,8 +1123,7 @@ ) (defstate flutflutegg-physics (flutflutegg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (the-as object (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) @@ -1251,12 +1151,12 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (+! (-> self pos) (* (-> self vel) (-> *display* seconds-per-frame))) - (set! (-> self vel) (* 0.95 (-> self vel))) + ;; PAL patch here + (set! (-> self vel) (* (-> self vel) (- 1.0 (* 0.05 (-> *display* time-adjust-ratio))))) (move! (-> self wobbler)) (let ((a1-0 (new 'stack-no-clear 'vector))) (vector-float*! a1-0 (-> self dir) (-> self pos)) @@ -1279,48 +1179,39 @@ ) (none) ) - :post - (the-as (function none :behavior flutflutegg) ja-post) + :post (the-as (function none :behavior flutflutegg) ja-post) ) (defstate flutflutegg-physics-fall (flutflutegg) - :code - (behavior () + :code (behavior () (local-vars (v1-25 symbol)) - (let ((gp-0 (get-process *default-dead-pool* camera-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type camera-tracker activate))) - (t9-1 (the-as camera-tracker gp-0) self 'camera-tracker (the-as pointer #x70004000)) + (process-spawn + camera-tracker + :init camera-tracker-init + (lambda :behavior camera-tracker + () + (while (not (process-grab? *target*)) + (suspend) ) - (run-now-in-process - gp-0 - camera-tracker-init - (lambda :behavior camera-tracker - () - (while (not (process-grab? *target*)) - (suspend) - ) - (camera-change-to "camera-135" 0 #f) - (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 9)) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 4)) - (suspend) - ) - ) - (while (not (process-release? (handle->process (-> self grab-target)))) - (suspend) - ) - (camera-look-at (the-as pair *target*) (the-as uint 0)) - (send-event *camera* 'blend-from-as-fixed) - (camera-change-to (the-as string 'base) 75 #f) - (none) + (camera-change-to "camera-135" 0 #f) + (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 9)) + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 4)) + (suspend) ) ) - (-> gp-0 ppointer) + (while (not (process-release? (handle->process (-> self grab-target)))) + (suspend) + ) + (camera-look-at (the-as pair *target*) (the-as uint 0)) + (send-event *camera* 'blend-from-as-fixed) + (camera-change-to (the-as string 'base) 75 #f) + (none) ) + :to self ) (close-specific-task! (game-task beach-flutflut) (task-status need-reminder)) - (while #t + (loop (vector-float*! (-> self root-override transv) (-> self dir) (-> self vel)) (set! (-> self state-time) (-> *display* base-frame-counter)) (until v1-25 @@ -1344,22 +1235,20 @@ ) (suspend) (set! v1-25 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (logtest? (-> self root-override status) 1) + (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) ) ) ) - (sound-play-by-name (static-sound-name "sack-land") (new-sound-id) 2048 0 0 1 #t) + (sound-play "sack-land" :vol 200) (go flutflutegg-break #f) ) (none) ) - :post - (the-as (function none :behavior flutflutegg) ja-post) + :post (the-as (function none :behavior flutflutegg) ja-post) ) (defstate flutflutegg-break (flutflutegg) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (when arg0 (set-vector! (-> self root-override trans) -231190.94 64559.105 -1164727.5 1.0) (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 -18204.445) @@ -1367,34 +1256,13 @@ (suspend) (update-transforms! (-> self root-override)) (when (not arg0) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - ) + (ja :group! (-> self draw art-group data 5) :num! max) (while (and (not (task-closed? (game-task beach-flutflut) (task-status need-reward-speech))) (zero? (logand (-> self ambients-played) 1024)) ) @@ -1424,24 +1292,14 @@ (ja-channel-set! 1) (set-vector! (-> self root-override trans) -231190.94 64559.105 -1164727.5 1.0) (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 0.0) - (let ((gp-3 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-3 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-3 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - ) - (while #t + (ja :group! (-> self draw art-group data 6) :num! max) + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) (none) ) - :post - (the-as (function none :behavior flutflutegg) ja-post) + :post (the-as (function none :behavior flutflutegg) ja-post) ) (defmethod init-from-entity! flutflutegg ((obj flutflutegg) (arg0 entity-actor)) @@ -1513,17 +1371,13 @@ ) -(defskelgroup *harvester-sg* harvester - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 7 0 11) - :longest-edge (meters 0) - ) +(defskelgroup *harvester-sg* harvester harvester-lod0-jg harvester-idle-ja + ((harvester-lod0-mg (meters 20)) (harvester-lod1-mg (meters 40)) (harvester-lod2-mg (meters 999999))) + :bounds (static-spherem 0 7 0 11) + ) (defstate harvester-idle (harvester) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('update) (if (and (-> self alt-actor) (logtest? (-> self alt-actor extra perm status) (entity-perm-status complete))) @@ -1532,21 +1386,13 @@ ) ) ) - :code - (behavior () + :code (behavior () (if (and (-> self alt-actor) (logtest? (-> self alt-actor extra perm status) (entity-perm-status complete))) (go harvester-inflate #t) ) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) (ja-aframe 1.0 0)) - ) + (ja :group! (-> self draw art-group data 5) :num! (identity (ja-aframe 1.0 0))) (ja-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -1555,50 +1401,24 @@ ) (defstate harvester-inflate (harvester) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (when (not arg0) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (while #t - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior harvester) ja-post) + :post (the-as (function none :behavior harvester) ja-post) ) (defmethod init-from-entity! harvester ((obj harvester) (arg0 entity-actor)) @@ -1680,38 +1500,23 @@ (with-pp (let ((gp-0 (entity-actor-lookup (-> pp entity) 'alt-actor 0))) (when gp-0 - (let* ((s5-0 (get-process *default-dead-pool* pov-camera #x4000)) - (gp-1 - (ppointer->handle - (when s5-0 - (let ((t9-2 (method-of-type pov-camera activate))) - (t9-2 (the-as pov-camera s5-0) pp 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> gp-0 extra trans) - *beachcam-sg* - (new 'static 'spool-anim :name "beachcam-cannon" :index 3 :parts 1 :command-list '()) - 0 - #f - '() - ) - (-> s5-0 ppointer) - ) - ) - ) - (s5-1 (get-process *default-dead-pool* fuel-cell #x4000)) - (s5-2 - (ppointer->handle (when s5-1 - (let ((t9-5 (method-of-type fuel-cell activate))) - (t9-5 (the-as fuel-cell s5-1) pp 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 fuel-cell-init-as-clone gp-1 (-> pp entity extra perm task)) - (-> s5-1 ppointer) + (let* ((gp-1 + (ppointer->handle (process-spawn + pov-camera + (-> gp-0 extra trans) + *beachcam-sg* + (new 'static 'spool-anim :name "beachcam-cannon" :index 3 :parts 1 :command-list '()) + 0 + #f + '() + :to pp ) ) ) + (s5-2 (ppointer->handle + (process-spawn fuel-cell :init fuel-cell-init-as-clone gp-1 (-> pp entity extra perm task) :to pp) + ) + ) ) (let ((v1-13 (handle->process gp-1))) (if v1-13 diff --git a/goal_src/levels/beach/beach-part.gc b/goal_src/levels/beach/beach-part.gc index fc086408e4..d199592f41 100644 --- a/goal_src/levels/beach/beach-part.gc +++ b/goal_src/levels/beach/beach-part.gc @@ -20,8 +20,7 @@ (defpart 666 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.01) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 15) (meters 5) 1.0) @@ -48,13 +47,11 @@ ) (defpart 667 - :init-specs - ((sp-flt spt-fade-a -0.02)) + :init-specs ((sp-flt spt-fade-a -0.02)) ) (defpart 668 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-flt spt-num 0.03 0.2 1.0) (sp-flt spt-y (meters -4)) (sp-flt spt-scale-x (meters 0.18)) @@ -76,8 +73,7 @@ ) (defpart 669 - :init-specs - ((sp-flt spt-scalevel-y (meters 0.0024414062)) + :init-specs ((sp-flt spt-scalevel-y (meters 0.0024414062)) (sp-flt spt-fade-a 0.0) (sp-flt spt-accel-y -8.192) (sp-int spt-next-time 210) @@ -86,37 +82,21 @@ ) (defpart 670 - :init-specs - ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150) (sp-func spt-func 'check-water-level-drop)) + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150) (sp-func spt-func 'check-water-level-drop)) ) (defstate beach-part-grotto-1 (beach-part) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (is-visible? self) (let* ((gp-0 (camera-pos)) (f0-0 (vector-vector-distance (-> self root trans) gp-0)) ) (if (or (< (-> gp-0 y) (-> self root trans y)) (< 122880.0 f0-0)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 666) - (-> self root trans) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 666) (-> self root trans)) ) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 668) - (-> self root trans) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 668) (-> self root trans)) ) (suspend) ) @@ -125,8 +105,7 @@ ) (defpart 671 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-flt spt-num 0.3 0.4 1.0) (sp-rnd-flt spt-x (meters -23) (meters 55) 1.0) (sp-flt spt-z (meters 0.5)) @@ -151,13 +130,11 @@ (defpartgroup group-beach-grotto-2 :id 161 :bounds (static-bspherem 0 -5 0 15) - :parts - ((sp-item 671 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 671 :fade-after (meters 80) :falloff-to (meters 80))) ) (defpart 672 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-x (meters -10) (meters 4) 1.0) (sp-flt spt-y (meters 103)) @@ -183,8 +160,7 @@ ) (defpart 673 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.8 0.8 1.0) (sp-rnd-flt spt-x (meters -9) (meters 3.5) 1.0) (sp-flt spt-y (meters 103)) @@ -211,8 +187,7 @@ ) (defpart 674 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.9) (sp-rnd-flt spt-x (meters -10) (meters 4) 1.0) (sp-flt spt-y (meters 103)) @@ -238,8 +213,7 @@ ) (defpart 675 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.04) (sp-rnd-flt spt-x (meters 6) (meters 6) 1.0) (sp-flt spt-y (meters 6.5)) @@ -269,13 +243,11 @@ ) (defpart 676 - :init-specs - ((sp-flt spt-fade-a -0.14222223)) + :init-specs ((sp-flt spt-fade-a -0.14222223)) ) (defpart 677 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters 2) (meters 10) 1.0) (sp-flt spt-y (meters 8)) @@ -306,8 +278,7 @@ :id 162 :flags (always-draw unknown-bit-01) :bounds (static-bspherem 0 55 0 55) - :parts - ((sp-item 677 :fade-after (meters 200) :falloff-to (meters 200)) + :parts ((sp-item 677 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 675) (sp-item 675 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 672) @@ -321,62 +292,53 @@ (defpartgroup group-beach-24 :id 163 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 678 :fade-after (meters 50) :period 2400 :length 1500 :offset 1200)) + :parts ((sp-item 678 :fade-after (meters 50) :period 2400 :length 1500 :offset 1200)) ) (defpartgroup group-beach-23 :id 164 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 679 :fade-after (meters 50) :period 2400 :length 1500 :offset 600)) + :parts ((sp-item 679 :fade-after (meters 50) :period 2400 :length 1500 :offset 600)) ) (defpartgroup group-beach-22 :id 165 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 680 :fade-after (meters 80) :period 2400 :length 1500)) + :parts ((sp-item 680 :fade-after (meters 80) :period 2400 :length 1500)) ) (defpartgroup group-beach-18 :id 166 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 681 :fade-after (meters 100) :period 2400 :length 1500 :offset 1200)) + :parts ((sp-item 681 :fade-after (meters 100) :period 2400 :length 1500 :offset 1200)) ) (defpartgroup group-beach-17 :id 167 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 682 :fade-after (meters 50) :period 2400 :length 1500 :offset 600)) + :parts ((sp-item 682 :fade-after (meters 50) :period 2400 :length 1500 :offset 600)) ) (defpartgroup group-beach-16 :id 168 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 683 :fade-after (meters 50) :period 2400 :length 1500)) + :parts ((sp-item 683 :fade-after (meters 50) :period 2400 :length 1500)) ) (defpartgroup group-beach-15 :id 169 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 684 :fade-after (meters 50) :period 2400 :length 1500 :offset 64936)) + :parts ((sp-item 684 :fade-after (meters 50) :period 2400 :length 1500 :offset 64936)) ) (defpartgroup group-beach-14 :id 170 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 685 :fade-after (meters 50) :period 2400 :length 1500 :offset 64336)) + :parts ((sp-item 685 :fade-after (meters 50) :period 2400 :length 1500 :offset 64336)) ) (defpart 678 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.01 0.01 1.0) (sp-rnd-flt spt-x (meters -85) (meters 60) 1.0) (sp-flt spt-y (meters 13)) @@ -400,13 +362,11 @@ ) (defpart 686 - :init-specs - ((sp-flt spt-fade-a -0.07111111)) + :init-specs ((sp-flt spt-fade-a -0.07111111)) ) (defpart 679 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.01 0.01 1.0) (sp-rnd-flt spt-x (meters -65) (meters 60) 1.0) (sp-flt spt-y (meters 8)) @@ -430,13 +390,11 @@ ) (defpart 687 - :init-specs - ((sp-flt spt-fade-a -0.07111111)) + :init-specs ((sp-flt spt-fade-a -0.07111111)) ) (defpart 680 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.01 0.01 1.0) (sp-rnd-flt spt-x (meters -50) (meters 20) 1.0) (sp-flt spt-y (meters 0)) @@ -461,13 +419,11 @@ ) (defpart 688 - :init-specs - ((sp-flt spt-fade-a -0.08533333)) + :init-specs ((sp-flt spt-fade-a -0.08533333)) ) (defpart 681 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.03 0.04 1.0) (sp-rnd-flt spt-x (meters -40) (meters 20) 1.0) (sp-flt spt-y (meters 1)) @@ -492,13 +448,11 @@ ) (defpart 689 - :init-specs - ((sp-flt spt-fade-a -0.07111111)) + :init-specs ((sp-flt spt-fade-a -0.07111111)) ) (defpart 682 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.015 0.02 1.0) (sp-flt spt-x (meters -10)) (sp-flt spt-y (meters 1)) @@ -522,13 +476,11 @@ ) (defpart 690 - :init-specs - ((sp-flt spt-fade-a -0.017777778)) + :init-specs ((sp-flt spt-fade-a -0.017777778)) ) (defpart 683 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.015 0.02 1.0) (sp-flt spt-x (meters -25)) (sp-flt spt-y (meters 1)) @@ -552,13 +504,11 @@ ) (defpart 691 - :init-specs - ((sp-flt spt-fade-a -0.013333334)) + :init-specs ((sp-flt spt-fade-a -0.013333334)) ) (defpart 684 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.015 0.015 1.0) (sp-flt spt-x (meters -35)) (sp-flt spt-y (meters 1)) @@ -582,13 +532,11 @@ ) (defpart 692 - :init-specs - ((sp-flt spt-fade-a -0.016410256)) + :init-specs ((sp-flt spt-fade-a -0.016410256)) ) (defpart 685 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.015 0.015 1.0) (sp-flt spt-x (meters -25)) (sp-flt spt-y (meters 14)) @@ -612,20 +560,15 @@ ) (defpart 693 - :init-specs - ((sp-flt spt-fade-a -0.014222222)) + :init-specs ((sp-flt spt-fade-a -0.014222222)) ) -(define - sound-beach-waterfall - (new 'static 'sound-spec :num 1.0 :group #x1 :sound-name (static-sound-name "waterfall") :volume #x400) - ) +(define sound-beach-waterfall (static-sound-spec "waterfall")) (defpartgroup group-beach-butterflies :id 171 :bounds (static-bspherem 0 0 0 30) - :parts - ((sp-item 696 :fade-after (meters 120) :period 4903 :length 5 :hour-mask #b111111100000000000111111 :binding 694) + :parts ((sp-item 696 :fade-after (meters 120) :period 4903 :length 5 :hour-mask #b111111100000000000111111 :binding 694) (sp-item 696 :fade-after (meters 120) :period 6637 :length 5 :hour-mask #b111111100000000000111111 :binding 694) (sp-item 696 :fade-after (meters 120) :period 9846 :length 5 :hour-mask #b111111100000000000111111 :binding 694) (sp-item 694 :flags (start-dead launch-asap) :binding 695) @@ -642,8 +585,7 @@ ) (defpart 696 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 7.5) 1.0) (sp-rnd-flt spt-y (meters 14) (meters 3) 1.0) @@ -662,21 +604,18 @@ ) (defpart 697 - :init-specs - ((sp-flt spt-accel-y 0.0) + :init-specs ((sp-flt spt-accel-y 0.0) (sp-int-plain-rnd spt-next-time 2700 1499 1) (sp-launcher-by-id spt-next-launcher 698) ) ) (defpart 698 - :init-specs - ((sp-flt spt-accel-y 1.3653333)) + :init-specs ((sp-flt spt-accel-y 1.3653333)) ) (defpart 694 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -699,8 +638,7 @@ ) (defpart 699 - :init-specs - ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) (sp-rnd-flt spt-vel-y (meters -0.0074074077) (meters 0.0148148155) 1.0) (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) (sp-int-plain-rnd spt-next-time 150 449 1) @@ -709,8 +647,7 @@ ) (defpart 695 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 0.9)) @@ -729,16 +666,14 @@ (defpartgroup group-beach-moth :id 172 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 702 :fade-after (meters 120) :flags (bit1) :period 18030 :length 5 :hour-mask #b1111111110000000 :binding 700) + :parts ((sp-item 702 :fade-after (meters 120) :flags (bit1) :period 18030 :length 5 :hour-mask #b1111111110000000 :binding 700) (sp-item 700 :flags (start-dead launch-asap) :binding 701) (sp-item 701 :flags (is-3d start-dead)) ) ) (defpart 702 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.1)) (sp-copy-from-other spt-scale-y -4) @@ -751,8 +686,7 @@ ) (defpart 700 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 1.5)) @@ -775,8 +709,7 @@ ) (defpart 703 - :init-specs - ((sp-rnd-flt spt-vel-x (meters -0.035555556) (meters 0.07111111) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters -0.035555556) (meters 0.07111111) 1.0) (sp-rnd-flt spt-vel-y (meters -0.0148148155) (meters 0.029629631) 1.0) (sp-rnd-flt spt-rotvel-z (degrees -0.4) (degrees 0.8) 1.0) (sp-int-plain-rnd spt-next-time 150 449 1) @@ -785,8 +718,7 @@ ) (defpart 701 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 0.4)) diff --git a/goal_src/levels/beach/beach-rocks.gc b/goal_src/levels/beach/beach-rocks.gc index 2771f07b38..6f2ab0b7d1 100644 --- a/goal_src/levels/beach/beach-rocks.gc +++ b/goal_src/levels/beach/beach-rocks.gc @@ -7,29 +7,27 @@ ;; DECOMP BEGINS -(defskelgroup *lrocklrg-sg* lrocklrg - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 11) - ) +(import "goal_src/import/lrocklrg-ag.gc") + +(defskelgroup *lrocklrg-sg* lrocklrg lrocklrg-lod0-jg lrocklrg-idle-ja + ((lrocklrg-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :longest-edge (meters 11) + ) (defpartgroup group-beach-rocks-start :id 553 :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2340 :period 75 :length 10) + :parts ((sp-item 2340 :period 75 :length 10) (sp-item 2341 :period 75 :length 10) (sp-item 2289 :period 75 :length 10) ) ) (defpart 2341 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 3.0 6.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters -4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.25) (meters 1) 1.0) @@ -54,8 +52,7 @@ ) (defpart 2340 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters -4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) @@ -81,8 +78,7 @@ ) (defpart 2289 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 3.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters -4) 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 2) 1.0) @@ -114,13 +110,11 @@ :id 554 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2290 :period 15 :length 5)) + :parts ((sp-item 2290 :period 15 :length 5)) ) (defpart 2290 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 3.0 3.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters -4) 1.0) (sp-rnd-flt spt-scale-x (meters 7) (meters 9) 1.0) @@ -153,16 +147,14 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2342 :period 900 :length 40) + :parts ((sp-item 2342 :period 900 :length 40) (sp-item 2343 :period 900 :length 40) (sp-item 2291 :period 900 :length 40) ) ) (defpart 2343 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-flt spt-y (meters -3)) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.3) 1.0) @@ -183,8 +175,7 @@ ) (defpart 2342 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 64.0 64.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters -4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) @@ -210,8 +201,7 @@ ) (defpart 2291 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 32.0 32.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters -4) 1.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 8) 1.0) @@ -283,8 +273,7 @@ (defstate idle (beach-rock) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (set! (-> self trigger) #t) @@ -295,14 +284,13 @@ ) ) ) - :code - (behavior () + :code (behavior () (if (-> self trigger) (go-virtual falling) ) (ja-channel-set! 0) (ja-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -312,11 +300,9 @@ (defstate loading (beach-rock) :virtual #t - :event - (-> (the-as state (method-of-type beach-rock idle)) event) - :code - (behavior () - (while #t + :event (-> (the-as state (method-of-type beach-rock idle)) event) + :code (behavior () + (loop (spool-push *art-control* "lrocklrg-falling" 0 self -1.0) (suspend) ) @@ -326,8 +312,7 @@ (defstate falling (beach-rock) :virtual #t - :trans - (behavior () + :trans (behavior () (set! (-> self draw bounds w) 819200.0) (let ((f30-0 (ja-aframe-num 0))) (when (and (< -50.0 f30-0) (< f30-0 158.0)) @@ -358,8 +343,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (v1-3 symbol) (v1-49 symbol)) (until v1-3 (spool-push *art-control* "lrocklrg-falling" 0 self -1.0) @@ -368,37 +352,18 @@ ) (logclear! (-> self draw status) (draw-status hidden)) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let* ((gp-1 (get-process *default-dead-pool* othercam #x4000)) - (gp-2 (ppointer->handle (when gp-1 - (let ((t9-5 (method-of-type othercam activate))) - (t9-5 (the-as othercam gp-1) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 othercam-init-by-other self 7 #f #t) - (-> gp-1 ppointer) - ) - ) - ) - (s5-0 (get-process *default-dead-pool* fuel-cell #x4000)) - (s5-1 - (ppointer->handle - (when s5-0 - (let ((t9-8 (method-of-type fuel-cell activate))) - (t9-8 (the-as fuel-cell s5-0) self 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 fuel-cell-init-as-clone (process->handle self) (-> self entity extra perm task)) - (-> s5-0 ppointer) - ) - ) - ) - ) + (ja :group! (-> self draw art-group data 2) :num! min) + (let ((gp-2 (ppointer->handle (process-spawn othercam self 7 #f #t :to self))) + (s5-1 (ppointer->handle (process-spawn + fuel-cell + :init fuel-cell-init-as-clone + (process->handle self) + (-> self entity extra perm task) + :to self + ) + ) + ) + ) (close-specific-task! (-> self entity extra perm task) (task-status need-reminder)) (set! (-> self movie-start) (-> *display* base-frame-counter)) (spool-push *art-control* "lrocklrg-falling" 0 self -1.0) @@ -407,8 +372,7 @@ :name "lrocklrg-falling" :index 4 :parts 4 - :command-list - '((-150 blackout 100) (-116 blackout 0)) + :command-list '((-150 blackout 100) (-116 blackout 0)) ) (the-as art-joint-anim (-> self draw art-group data 2)) (the-as art-joint-anim (-> self draw art-group data 3)) @@ -436,14 +400,12 @@ (go-virtual fallen) (none) ) - :post - (the-as (function none :behavior beach-rock) transform-post) + :post (the-as (function none :behavior beach-rock) transform-post) ) (defstate fallen (beach-rock) :virtual #t - :code - (behavior () + :code (behavior () (level-hint-spawn (game-text-id beach-seagulls-avalanche) "sksp0025" @@ -451,10 +413,8 @@ *entity-pool* (game-task none) ) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (TODO-RENAME-9 (-> self align)) + (ja :group! (-> self draw art-group data 3)) + (compute-alignment! (-> self align)) (let ((v1-6 (first-transform (-> self align)))) (set! (-> self root-override trans quad) (-> self entity extra trans quad)) (+! (-> self root-override trans y) (-> v1-6 trans y)) @@ -466,8 +426,7 @@ 0 (none) ) - :post - (the-as (function none :behavior beach-rock) ja-post) + :post (the-as (function none :behavior beach-rock) ja-post) ) (defmethod init-from-entity! beach-rock ((obj beach-rock) (arg0 entity-actor)) diff --git a/goal_src/levels/beach/bird-lady-beach.gc b/goal_src/levels/beach/bird-lady-beach.gc index 6f3200fa42..e0f388b267 100644 --- a/goal_src/levels/beach/bird-lady-beach.gc +++ b/goal_src/levels/beach/bird-lady-beach.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/bird-lady-beach-ag.gc") + (deftype bird-lady-beach (process-taskable) ((flutflut handle :offset-assert 384) (egg handle :offset-assert 392) @@ -18,19 +20,15 @@ ) -(defskelgroup *bird-lady-beach-sg* bird-lady-beach - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *bird-lady-beach-sg* bird-lady-beach bird-lady-beach-lod0-jg bird-lady-beach-idle-ja + ((bird-lady-beach-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow bird-lady-beach-shadow-mg + ) (defstate idle (bird-lady-beach) :virtual #t - :enter - (behavior () + :enter (behavior () (when (not (should-display? self)) (let ((a0-2 (handle->process (-> self flutflut)))) (if a0-2 @@ -55,42 +53,21 @@ (when arg0 (set! (-> obj cell-for-task) (current-task (-> obj tasks))) (close-current! (-> obj tasks)) - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj flutflut) - (ppointer->handle - (when s5-1 - (let ((t9-4 (method-of-type manipy activate))) - (t9-4 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *flutflut-naked-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> obj flutflut) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *flutflut-naked-sg* #f :to obj)) + ) (send-event (handle->process (-> obj flutflut)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj flutflut)) 'blend-shape #t) - (let ((s5-2 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj egg) - (ppointer->handle - (when s5-2 - (let ((t9-9 (method-of-type manipy activate))) - (t9-9 (the-as manipy s5-2) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 manipy-init (-> obj root-override trans) (-> obj entity) *flutflutegg-sg* #f) - (-> s5-2 ppointer) - ) - ) - ) - ) + (set! (-> obj egg) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *flutflutegg-sg* #f :to obj)) + ) (send-event (handle->process (-> obj egg)) 'anim-mode 'clone-anim) ) (new 'static 'spool-anim :name "bird-lady-beach-resolution" :index 4 :parts 10 - :command-list - '((141 joint "cameraB") (535 joint "camera") (696 joint "cameraB") (758 joint "camera") (813 joint "cameraB")) + :command-list '((141 joint "cameraB") (535 joint "camera") (696 joint "cameraB") (758 joint "camera") (813 joint "cameraB")) ) ) (else diff --git a/goal_src/levels/beach/bird-lady.gc b/goal_src/levels/beach/bird-lady.gc index 34cccae45c..0435e3c041 100644 --- a/goal_src/levels/beach/bird-lady.gc +++ b/goal_src/levels/beach/bird-lady.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/bird-lady-ag.gc") + (deftype bird-lady (process-taskable) () :heap-base #x110 @@ -16,14 +18,11 @@ ) -(defskelgroup *bird-lady-sg* bird-lady - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 1 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *bird-lady-sg* bird-lady bird-lady-lod0-jg bird-lady-idle-ja + ((bird-lady-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 2.5) + :shadow bird-lady-shadow-mg + ) (defmethod dummy-52 bird-lady ((obj bird-lady)) (let ((v1-1 (-> obj draw shadow-ctrl))) @@ -38,7 +37,7 @@ ) ) 0 - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) ) ) (none) @@ -47,16 +46,19 @@ (defmethod draw-npc-shadow bird-lady ((obj bird-lady)) (-> obj draw shadow-ctrl) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -74,8 +76,7 @@ :name "bird-lady-introduction" :index 4 :parts 11 - :command-list - '((0 want-levels village1 beach) + :command-list '((0 want-levels village1 beach) (49 joint "cameraB") (101 display-level beach special) (101 kill "yakow-8") @@ -135,10 +136,7 @@ (defmethod TODO-RENAME-43 bird-lady ((obj bird-lady)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.66 f0-2) (play-ambient (-> obj ambient) "BIR-LO02" #f (-> obj root-override trans)) diff --git a/goal_src/levels/beach/lurkercrab.gc b/goal_src/levels/beach/lurkercrab.gc index 15b0620348..53eb409c0d 100644 --- a/goal_src/levels/beach/lurkercrab.gc +++ b/goal_src/levels/beach/lurkercrab.gc @@ -7,18 +7,18 @@ ;; DECOMP BEGINS +(import "goal_src/import/lurkercrab-ag.gc") + (defpartgroup group-lurkercrab-slide :id 159 :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 663 :fade-after (meters 40) :falloff-to (meters 40)) + :parts ((sp-item 663 :fade-after (meters 40) :falloff-to (meters 40)) (sp-item 664 :fade-after (meters 40) :falloff-to (meters 40)) ) ) (defpart 663 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-flt spt-y (meters -2)) (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) @@ -37,8 +37,7 @@ ) (defpart 664 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-flt spt-y (meters -2)) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) @@ -71,16 +70,13 @@ ) -(defskelgroup *lurkercrab-sg* lurkercrab - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - ) +(defskelgroup *lurkercrab-sg* lurkercrab lurkercrab-lod0-jg lurkercrab-idle-ja + ((lurkercrab-lod0-mg (meters 20)) (lurkercrab-lod1-mg (meters 40)) (lurkercrab-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + ) (defmethod dummy-44 lurkercrab ((obj lurkercrab) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) 64) + (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) (-> obj collide-info) @@ -97,7 +93,7 @@ 6144.0 16384.0 ) - (the-as object (if (zero? (logand (-> obj nav-enemy-flags) 256)) + (the-as object (if (zero? (logand (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8))) (do-push-aways! (-> obj collide-info)) ) ) @@ -114,7 +110,7 @@ ) ((= v1-1 'punch) (cond - ((logtest? (-> obj nav-enemy-flags) 32) + ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) (logclear! (-> obj mask) (process-mask actor-pause)) (go (method-of-object obj nav-enemy-die)) ) @@ -136,7 +132,7 @@ ) ) ) - ((logtest? (-> obj nav-enemy-flags) 32) + ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) (logclear! (-> obj mask) (process-mask actor-pause)) (go (method-of-object obj nav-enemy-die)) ) @@ -164,7 +160,7 @@ nav-enemy-default-event-handler (defmethod TODO-RENAME-37 lurkercrab ((obj lurkercrab)) (when (-> obj orient) - (if (logtest? (nav-control-flags bit19) (-> obj nav flags)) + (if (logtest? (nav-control-flags navcf19) (-> obj nav flags)) (seek-to-point-toward-point! (-> obj collide-info) (-> obj nav target-pos) @@ -201,73 +197,40 @@ nav-enemy-default-event-handler (defstate nav-enemy-idle (lurkercrab) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :exit - (behavior () + :exit (behavior () (set! (-> self draw force-lod) -1) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self target-speed) 0.0) (set! (-> self draw force-lod) 2) - (ja-channel-push! 1 22) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> gp-0 frame-num) (ja-aframe 1.0 0)) - ) + (ja-channel-push! 1 (seconds 0.075)) + (loop + (ja :group! lurkercrab-idle-ja :num! (identity (ja-aframe 1.0 0))) (let ((gp-1 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 3)) (suspend) ) ) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> gp-2 param 0) (ja-aframe 19.0 0)) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) (ja-aframe 1.0 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! lurkercrab-idle-ja :num! (seek! (ja-aframe 19.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 19.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 num-func) num-func-identity) - (set! (-> gp-4 frame-num) (ja-aframe 19.0 0)) + (ja :num! (seek! (ja-aframe 19.0 0))) ) + (ja :num-func num-func-identity :frame-num (ja-aframe 19.0 0)) (let ((gp-5 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 1)) (suspend) ) ) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> gp-6 param 0) (ja-aframe 1.0 0)) - (set! (-> gp-6 param 1) 1.0) - (set! (-> gp-6 frame-num) (ja-aframe 19.0 0)) - (joint-control-channel-group! gp-6 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! lurkercrab-idle-ja :num! (seek! (ja-aframe 1.0 0)) :frame-num (ja-aframe 19.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-7 (-> self skel root-channel 0))) - (set! (-> gp-7 param 0) (ja-aframe 1.0 0)) - (set! (-> gp-7 param 1) 1.0) - (joint-control-channel-group-eval! gp-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 1.0 0))) ) ) (none) @@ -275,7 +238,7 @@ nav-enemy-default-event-handler ) (defbehavior lurkercrab-invulnerable lurkercrab () - (set! (-> self nav-enemy-flags) (logand -33 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (let ((v1-3 (find-prim-by-id (-> self collide-info) (the-as uint 2)))) (when v1-3 (let ((v0-1 4)) @@ -287,7 +250,7 @@ nav-enemy-default-event-handler ) (defbehavior lurkercrab-vulnerable lurkercrab () - (logior! (-> self nav-enemy-flags) 32) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (let ((v1-3 (find-prim-by-id (-> self collide-info) (the-as uint 2)))) (when v1-3 (let ((v0-1 1)) @@ -300,156 +263,73 @@ nav-enemy-default-event-handler (defstate nav-enemy-patrol (lurkercrab) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :exit - (behavior () + :exit (behavior () (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 8) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (none) ) - :code - (behavior () - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 4) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (when (ja-group? lurkercrab-idle-ja) + (ja-no-eval :group! lurkercrab-idle-to-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (ja-channel-push! 1 22) - (while #t + (ja-channel-push! 1 (seconds 0.075)) + (loop (dotimes (gp-0 6) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! lurkercrab-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (when (nav-enemy-rnd-go-idle? 0.2) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) 1.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 180) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (nav-enemy-rnd-int-range 2 6) (until (not (nav-enemy-rnd-go-idle? 0.2)) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> gp-1 frame-num) (ja-aframe 1.0 0)) - ) + (ja :group! lurkercrab-idle-ja :num! (identity (ja-aframe 1.0 0))) (let ((gp-2 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 2)) (suspend) ) ) ) - (logior! (-> self nav-enemy-flags) 8) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (ja-no-eval :group! lurkercrab-idle-to-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> gp-3 param 0) (ja-aframe 30.0 0)) - (set! (-> gp-3 param 1) 1.0) - (set! (-> gp-3 frame-num) (ja-aframe 1.0 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! lurkercrab-peek-ja :num! (seek! (ja-aframe 30.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 param 0) (ja-aframe 30.0 0)) - (set! (-> gp-4 param 1) 1.0) - (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 30.0 0))) ) (lurkercrab-vulnerable) - (logior! (-> self nav-enemy-flags) 64) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (dotimes (gp-5 2) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> s5-0 param 0) (ja-aframe 60.0 0)) - (set! (-> s5-0 param 1) 1.0) - (set! (-> s5-0 frame-num) (ja-aframe 30.0 0)) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! lurkercrab-peek-ja :num! (seek! (ja-aframe 60.0 0)) :frame-num (ja-aframe 30.0 0)) (until (ja-done? 0) (suspend) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 param 0) (ja-aframe 60.0 0)) - (set! (-> s5-1 param 1) 1.0) - (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 60.0 0))) ) ) (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> gp-6 param 0) (ja-aframe 90.0 0)) - (set! (-> gp-6 param 1) 1.0) - (set! (-> gp-6 frame-num) (ja-aframe 60.0 0)) - (joint-control-channel-group! gp-6 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) + (ja-no-eval :group! lurkercrab-peek-to-walk-ja :num! (seek! (ja-aframe 90.0 0)) :frame-num (ja-aframe 60.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-7 (-> self skel root-channel 0))) - (set! (-> gp-7 param 0) (ja-aframe 90.0 0)) - (set! (-> gp-7 param 1) 1.0) - (joint-control-channel-group-eval! gp-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 90.0 0))) ) ) (none) @@ -458,13 +338,11 @@ nav-enemy-default-event-handler (defstate nav-enemy-notice (lurkercrab) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-chase) (none) ) @@ -472,20 +350,19 @@ nav-enemy-default-event-handler (defstate nav-enemy-chase (lurkercrab) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :exit - (behavior () + :exit (behavior () (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (none) ) - :trans - (behavior () - (if (logtest? (-> *target* state-flags) #x80f8) + :trans (behavior () + (if (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) (go-virtual nav-enemy-victory) ) (if (< (ja-aframe-num 0) 2.0) @@ -493,140 +370,53 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (logior! (-> self nav-enemy-flags) 8) - (ja-channel-push! 1 22) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + :code (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (ja-channel-push! 1 (seconds 0.075)) + (loop + (ja-no-eval :group! lurkercrab-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (lurkercrab-vulnerable) - (logior! (-> self nav-enemy-flags) 64) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> gp-0 param 0) (ja-aframe 30.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 1.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) + (ja-no-eval :group! lurkercrab-peek-ja :num! (seek! (ja-aframe 30.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 30.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> gp-2 param 0) (ja-aframe 120.0 0)) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) (ja-aframe 30.0 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) + (ja :num! (seek! (ja-aframe 30.0 0))) ) + (ja-no-eval :group! lurkercrab-snip-ja :num! (seek! (ja-aframe 120.0 0)) :frame-num (ja-aframe 30.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 120.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> gp-4 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-4 param 1) 1.0) - (set! (-> gp-4 frame-num) (ja-aframe 30.0 0)) - (joint-control-channel-group! gp-4 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) + (ja :num! (seek! (ja-aframe 120.0 0))) ) + (ja-no-eval :group! lurkercrab-peek-ja :num! (seek! (ja-aframe 60.0 0)) :frame-num (ja-aframe 30.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-5 param 1) 1.0) - (joint-control-channel-group-eval! gp-5 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> gp-6 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-6 param 1) 1.0) - (set! (-> gp-6 frame-num) (ja-aframe 30.0 0)) - (joint-control-channel-group! gp-6 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) + (ja :num! (seek! (ja-aframe 60.0 0))) ) + (ja-no-eval :group! lurkercrab-peek-ja :num! (seek! (ja-aframe 60.0 0)) :frame-num (ja-aframe 30.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-7 (-> self skel root-channel 0))) - (set! (-> gp-7 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-7 param 1) 1.0) - (joint-control-channel-group-eval! gp-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 60.0 0))) ) (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) - (let ((gp-8 (-> self skel root-channel 0))) - (set! (-> gp-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> gp-8 param 0) (ja-aframe 90.0 0)) - (set! (-> gp-8 param 1) 1.0) - (set! (-> gp-8 frame-num) (ja-aframe 60.0 0)) - (joint-control-channel-group! gp-8 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) + (ja-no-eval :group! lurkercrab-peek-to-walk-ja :num! (seek! (ja-aframe 90.0 0)) :frame-num (ja-aframe 60.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-9 (-> self skel root-channel 0))) - (set! (-> gp-9 param 0) (ja-aframe 90.0 0)) - (set! (-> gp-9 param 1) 1.0) - (joint-control-channel-group-eval! gp-9 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-35 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-35 param 1) 1.0) - (set! (-> a0-35 frame-num) 0.0) - (joint-control-channel-group! a0-35 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) + (ja :num! (seek! (ja-aframe 90.0 0))) ) + (ja-no-eval :group! lurkercrab-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1))) - (set! (-> a0-36 param 1) 1.0) - (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-38 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-38 param 1) 1.0) - (set! (-> a0-38 frame-num) 0.0) - (joint-control-channel-group! a0-38 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! lurkercrab-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 param 0) (the float (+ (-> a0-39 frame-group data 0 length) -1))) - (set! (-> a0-39 param 1) 1.0) - (joint-control-channel-group-eval! a0-39 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) @@ -635,13 +425,11 @@ nav-enemy-default-event-handler (defstate nav-enemy-stop-chase (lurkercrab) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-patrol) (none) ) @@ -649,13 +437,11 @@ nav-enemy-default-event-handler (defstate nav-enemy-stare (lurkercrab) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-patrol) (none) ) @@ -663,25 +449,16 @@ nav-enemy-default-event-handler (defstate nav-enemy-victory (lurkercrab) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (ja-channel-push! 1 22) - (let ((v1-4 (-> self skel root-channel 0))) - (set! (-> v1-4 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - ) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! (-> self draw art-group data (-> self nav-info victory-anim))) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) - (let ((v1-7 (-> self skel root-channel 0))) - (set! (-> v1-7 num-func) num-func-identity) - (set! (-> v1-7 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) (go-virtual nav-enemy-patrol) @@ -690,35 +467,22 @@ nav-enemy-default-event-handler ) (defstate lurkercrab-pushed (lurkercrab) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :exit - (behavior () + :exit (behavior () (set! (-> self orient) #t) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self momentum-speed) 57344.0) (set! (-> self target-speed) 0.0) (set! (-> self orient) #f) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> gp-0 param 0) (ja-aframe 18.0 0)) - (set! (-> gp-0 param 1) 0.75) - (set! (-> gp-0 frame-num) (ja-aframe 1.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! lurkercrab-kickback-ja :num! (seek! (ja-aframe 18.0 0) 0.75) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 18.0 0)) - (set! (-> gp-1 param 1) 0.75) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 18.0 0) 0.75)) ) (let ((gp-2 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.25)) @@ -733,8 +497,7 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-chase) (none) ) - :post - (behavior () + :post (behavior () (let ((a0-0 (-> self part)) (a1-0 (-> self collide-info root-prim prim-core)) ) @@ -792,7 +555,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -845,7 +608,7 @@ nav-enemy-default-event-handler (TODO-RENAME-45 obj *lurkercrab-nav-enemy-info*) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 159) obj)) (set! (-> obj orient) #t) - (set! (-> obj nav-enemy-flags) (logand -97 (-> obj nav-enemy-flags))) + (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5 navenmf6)) (set! (-> obj target-speed) 0.0) (set! (-> obj momentum-speed) 0.0) (set! (-> obj draw force-lod) 2) diff --git a/goal_src/levels/beach/lurkerpuppy.gc b/goal_src/levels/beach/lurkerpuppy.gc index dfa78fa277..7b8460c1c1 100644 --- a/goal_src/levels/beach/lurkerpuppy.gc +++ b/goal_src/levels/beach/lurkerpuppy.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/lurkerpuppy-ag.gc") + (deftype lurkerpuppy (nav-enemy) () :heap-base #x120 @@ -16,48 +18,28 @@ ) -(defskelgroup *lurkerpuppy-sg* lurkerpuppy - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *lurkerpuppy-sg* lurkerpuppy lurkerpuppy-lod0-jg lurkerpuppy-idle-ja + ((lurkerpuppy-lod0-mg (meters 20)) (lurkerpuppy-lod1-mg (meters 40)) (lurkerpuppy-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :shadow lurkerpuppy-shadow-mg + ) nav-enemy-default-event-handler (defstate nav-enemy-notice (lurkerpuppy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkerpuppy) nav-enemy-default-event-handler ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 51) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.17)) + (ja-no-eval :group! lurkerpuppy-celebrate-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-chase) (none) @@ -66,66 +48,36 @@ nav-enemy-default-event-handler (defstate nav-enemy-chase (lurkerpuppy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkerpuppy) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 10) - ) - (ja-channel-push! 1 51) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 4.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + ((ja-group? lurkerpuppy-jump-land-ja) + (ja-channel-push! 1 (seconds 0.17)) + (ja-no-eval :group! lurkerpuppy-run-ja :num! (seek!) :frame-num (ja-aframe 4.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (ja-channel-push! 1 51) + (ja-channel-push! 1 (seconds 0.17)) ) ) (let ((f30-0 (rand-vu-float-range 0.9 1.1))) - (while #t + (loop (if (rand-vu-percent? 0.25) - (sound-play-by-name (static-sound-name "puppy-bark") (new-sound-id) 1024 0 0 1 #t) + (sound-play "puppy-bark") ) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-14 param 1) f30-0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! lurkerpuppy-run-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-attack) ) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) f30-0) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -135,62 +87,39 @@ nav-enemy-default-event-handler (defstate nav-enemy-stare (lurkerpuppy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkerpuppy) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 1456355.5) (set! (-> self turn-time) (seconds 0.1)) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) - (while #t - (logior! (-> self nav-enemy-flags) 16) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> gp-0 param 0) (ja-aframe 12.0 0)) - (set! (-> gp-0 param 1) f30-0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (loop + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! lurkerpuppy-celebrate-ja :num! (seek! (ja-aframe 12.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (let ((f0-3 (ja-aframe-num 0))) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (if (and (>= f0-3 2.5) (>= 7.5 f0-3)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) ) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 12.0 0)) - (set! (-> gp-1 param 1) f30-0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) 1.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 30) - (let ((v1-31 (-> self skel root-channel 0))) - (set! (-> v1-31 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) - (let ((v1-34 (-> self skel root-channel 0))) - (set! (-> v1-34 num-func) num-func-identity) - (set! (-> v1-34 frame-num) 0.0) + (ja :num! (seek! (ja-aframe 12.0 0) f30-0)) ) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! lurkerpuppy-idle-ja) + (ja :num-func num-func-identity :frame-num 0.0) (let ((gp-2 (rand-vu-int-range 750 900)) (s5-0 (-> *display* base-frame-counter)) ) (until (>= (- (-> *display* base-frame-counter) s5-0) gp-2) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (ja-blend-eval) (suspend) ) @@ -203,44 +132,22 @@ nav-enemy-default-event-handler (defstate nav-enemy-give-up (lurkerpuppy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkerpuppy) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 218453.33) (set! (-> self turn-time) (seconds 0.5)) - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! lurkerpuppy-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.4) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! lurkerpuppy-idle-ja :num! (seek! max 1.4) :frame-num 0.0) (until (ja-done? 0) (seek-to-point-toward-point! (-> self collide-info) @@ -249,11 +156,7 @@ nav-enemy-default-event-handler (-> self turn-time) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.4) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 1.4)) ) (go-virtual nav-enemy-patrol) (none) @@ -262,14 +165,12 @@ nav-enemy-default-event-handler (defstate nav-enemy-attack (lurkerpuppy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkerpuppy) nav-enemy-default-event-handler ) - :code - (behavior () - (sound-play-by-name (static-sound-name "head-butt") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (sound-play "head-butt") (go-virtual nav-enemy-victory) (none) ) @@ -277,50 +178,34 @@ nav-enemy-default-event-handler (defstate nav-enemy-victory (lurkerpuppy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkerpuppy) nav-enemy-default-event-handler ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 16) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (none) ) - :code - (behavior () - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) - (ja-channel-push! 1 22) + :code (behavior () + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-channel-push! 1 (seconds 0.075)) (dotimes (gp-0 4) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! lurkerpuppy-celebrate-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f0-4 (ja-aframe-num 0))) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (if (and (>= f0-4 2.5) (>= 7.5 f0-4)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) ) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (go-virtual nav-enemy-chase) (none) ) - :post - (the-as (function none :behavior lurkerpuppy) nav-enemy-face-player-post) + :post (the-as (function none :behavior lurkerpuppy) nav-enemy-face-player-post) ) (define *lurkerpuppy-nav-enemy-info* (new 'static 'nav-enemy-info @@ -371,7 +256,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/goal_src/levels/beach/lurkerworm.gc b/goal_src/levels/beach/lurkerworm.gc index 81ec92ed63..b7d16a2ff9 100644 --- a/goal_src/levels/beach/lurkerworm.gc +++ b/goal_src/levels/beach/lurkerworm.gc @@ -5,10 +5,10 @@ ;; name in dgo: lurkerworm ;; dgos: BEA, L1 -(define-extern *lurkerworm-sg* skeleton-group) - ;; DECOMP BEGINS +(import "goal_src/import/lurkerworm-ag.gc") + (deftype lurkerworm (process-drawable) ((root-override collide-shape-moving :offset 112) (twister twister :offset-assert 176) @@ -56,20 +56,17 @@ (none) ) -(defskelgroup *lurkerworm-sg* lurkerworm - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 6.5) - :longest-edge (meters 1.5) - ) +(defskelgroup *lurkerworm-sg* lurkerworm lurkerworm-lod0-jg lurkerworm-idle-ja + ((lurkerworm-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 6.5) + :longest-edge (meters 1.5) + ) (defpartgroup group-beach-sandworm :id 157 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 656 :fade-after (meters 90) :period 900 :length 300) + :parts ((sp-item 656 :fade-after (meters 90) :period 900 :length 300) (sp-item 657 :fade-after (meters 100) :period 900 :length 390) (sp-item 658 :fade-after (meters 150) :period 900 :length 420 :offset 120) (sp-item 659 :fade-after (meters 60) :period 900 :length 420 :offset 120) @@ -80,16 +77,14 @@ :id 158 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 656 :fade-after (meters 90) :period 900 :length 300) + :parts ((sp-item 656 :fade-after (meters 90) :period 900 :length 300) (sp-item 658 :fade-after (meters 150) :period 900 :length 420 :offset 120) (sp-item 659 :fade-after (meters 60) :period 900 :length 420 :offset 120) ) ) (defpart 656 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters 3) (meters 5) 1.0) (sp-flt spt-y (meters 1)) @@ -113,13 +108,11 @@ ) (defpart 660 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) (defpart 658 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) @@ -141,8 +134,7 @@ ) (defpart 659 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.6) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -164,8 +156,7 @@ ) (defpart 657 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.4) 1.0) @@ -186,8 +177,7 @@ ) (defpart 661 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) @@ -210,8 +200,7 @@ ) (defpart 662 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) (defmethod TODO-RENAME-20 lurkerworm ((obj lurkerworm)) @@ -222,7 +211,7 @@ (let* ((f0-5 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z))))) (f0-6 (atan (-> s5-0 y) f0-5)) ) - (set! (-> obj head-tilt) (seek (-> obj head-tilt) f0-6 (* 5461.3335 (-> *display* seconds-per-frame)))) + (seek! (-> obj head-tilt) f0-6 (* 5461.3335 (-> *display* seconds-per-frame))) ) ) (set! (-> obj head-tilt) (fmin 8192.0 (fmax -5461.3335 (-> obj head-tilt)))) @@ -230,10 +219,10 @@ (none) ) -(defbehavior lurkerworm-prebind-function lurkerworm ((arg0 process) (arg1 int) (arg2 lurkerworm)) +(defbehavior lurkerworm-prebind-function lurkerworm ((arg0 pointer) (arg1 int) (arg2 lurkerworm)) (let ((v1-0 arg2) (s5-0 (new 'stack-no-clear 'quaternion)) - (gp-0 (&-> arg0 stack 324)) + (gp-0 (&+ arg0 432)) ) (quaternion-axis-angle! s5-0 -1.0 0.0 0.0 (-> v1-0 head-tilt)) (quaternion*! (the-as quaternion gp-0) (the-as quaternion gp-0) s5-0) @@ -252,44 +241,16 @@ (defmethod particle-effect lurkerworm ((obj lurkerworm)) (let ((a2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 5)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 661) - a2-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 661) a2-0) ) (let ((a2-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 6)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 661) - a2-1 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 661) a2-1) ) (let ((a2-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 7)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 661) - a2-2 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 661) a2-2) ) (let ((a2-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 8)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 661) - a2-3 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 661) a2-3) ) 0 (none) @@ -325,17 +286,14 @@ lurkerworm-default-event-handler lurkerworm-default-post-behavior (defstate lurkerworm-idle (lurkerworm) - :event - lurkerworm-default-event-handler - :enter - (behavior () + :event lurkerworm-default-event-handler + :enter (behavior () (ja-channel-set! 0) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) *target* (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) @@ -346,23 +304,19 @@ lurkerworm-default-post-behavior ) (none) ) - :post - lurkerworm-default-post-behavior + :post lurkerworm-default-post-behavior ) (defstate lurkerworm-spot (lurkerworm) - :event - lurkerworm-default-event-handler - :enter - (behavior () + :event lurkerworm-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "worm-rise1") (new-sound-id) 1024 0 0 1 #t) + (sound-play "worm-rise1") (none) ) - :code - (behavior () + :code (behavior () (set! (-> self part local-clock) 0) - (while #t + (loop (spawn (-> self part) (-> self root-override trans)) (particle-effect self) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -375,64 +329,43 @@ lurkerworm-default-post-behavior ) (none) ) - :post - lurkerworm-default-post-behavior + :post lurkerworm-default-post-behavior ) (defstate lurkerworm-rise (lurkerworm) - :event - lurkerworm-default-event-handler - :enter - (behavior () + :event lurkerworm-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior () + :code (behavior () (ja-channel-set! 1) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! lurkerworm-rise-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (spawn (-> self part) (-> self root-override trans)) (particle-effect self) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self strike-count) 3) (go lurkerworm-rest) (none) ) - :post - lurkerworm-default-post-behavior + :post lurkerworm-default-post-behavior ) (defstate lurkerworm-rest (lurkerworm) - :event - lurkerworm-default-event-handler - :enter - (behavior () + :event lurkerworm-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self vulnerable) #t) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self vulnerable) #f) (none) ) - :code - (behavior () + :code (behavior () (let* ((f30-0 10.0) (f28-0 100.0) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -443,15 +376,7 @@ lurkerworm-default-post-behavior (if gp-1 (+! (-> self strike-count) -1) ) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! lurkerworm-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (particle-effect self) @@ -467,10 +392,8 @@ lurkerworm-default-post-behavior ) ) (f30-2 (* 0.2 f0-13)) - (v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-32 (the-as number (logior #x3f800000 v1-31))) ) - (if (< (+ -1.0 (the-as float v1-32)) f30-2) + (if (< (rand-float-gen) f30-2) (go lurkerworm-strike) ) ) @@ -483,11 +406,7 @@ lurkerworm-default-post-behavior ) ) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (if gp-1 (go lurkerworm-strike) @@ -496,122 +415,70 @@ lurkerworm-default-post-behavior ) (none) ) - :post - lurkerworm-default-post-behavior + :post lurkerworm-default-post-behavior ) (defstate lurkerworm-strike (lurkerworm) - :event - lurkerworm-default-event-handler - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 40) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> gp-0 param 0) (ja-aframe 13.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + :event lurkerworm-default-event-handler + :code (behavior () + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.135)) + (ja-no-eval :group! lurkerworm-chomp-ja :num! (seek! (ja-aframe 13.0 0)) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (particle-effect self) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 13.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 13.0 0))) ) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 40) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.135)) (go lurkerworm-rest) (none) ) - :post - lurkerworm-default-post-behavior + :post lurkerworm-default-post-behavior ) (defstate lurkerworm-sink (lurkerworm) - :event - lurkerworm-default-event-handler - :enter - (behavior () + :event lurkerworm-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! lurkerworm-sink-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (spawn (-> self part2) (-> self root-override trans)) (particle-effect self) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go lurkerworm-idle) (none) ) - :post - lurkerworm-default-post-behavior + :post lurkerworm-default-post-behavior ) (defstate lurkerworm-die (lurkerworm) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkerworm) process-drawable-death-event-handler ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (let ((v1-3 (-> self root-override root-prim))) (set! (-> v1-3 collide-with) (collide-kind)) (set! (-> v1-3 prim-core collide-as) (collide-kind)) ) 0 - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! lurkerworm-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (cleanup-for-death self) (none) ) - :post - lurkerworm-default-post-behavior + :post lurkerworm-default-post-behavior ) (defmethod init-from-entity! lurkerworm ((obj lurkerworm) (arg0 entity-actor)) @@ -698,9 +565,7 @@ lurkerworm-default-post-behavior (set! (-> obj twister) (new 'process 'twister 3 15 1092.2667 72.81778 0.25 0.001)) (TODO-RENAME-9 (-> obj twister) 3 9 910.2222) (set! (-> obj head-tilt) 0.0) - (set! (-> obj skel prebind-function) - (the-as (function pointer int process-drawable none) lurkerworm-prebind-function) - ) + (set! (-> obj skel prebind-function) lurkerworm-prebind-function) (set! (-> obj skel postbind-function) lurkerworm-joint-callback) (set! (-> obj root-override nav-radius) 12288.0) (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) diff --git a/goal_src/levels/beach/mayor.gc b/goal_src/levels/beach/mayor.gc index a17e51e04d..84c109de5a 100644 --- a/goal_src/levels/beach/mayor.gc +++ b/goal_src/levels/beach/mayor.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/mayor-ag.gc") + (deftype mayor (process-taskable) () :heap-base #x110 @@ -16,14 +18,11 @@ ) -(defskelgroup *mayor-sg* mayor - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *mayor-sg* mayor mayor-lod0-jg mayor-idle-ja + ((mayor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow mayor-shadow-mg + ) (defmethod dummy-52 mayor ((obj mayor)) (let ((v1-1 (-> obj draw shadow-ctrl))) @@ -44,16 +43,19 @@ (defmethod draw-npc-shadow mayor ((obj mayor)) (-> obj draw shadow-ctrl) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (set! (-> v1-14 settings flags) (logior (the-as int (-> v1-14 settings flags)) 32)) + (set! (-> v1-14 settings flags) (the-as shadow-flags (logior (the-as int (-> v1-14 settings flags)) 32))) ) 0 ) @@ -67,7 +69,13 @@ (close-specific-task! (game-task jungle-lurkerm) (task-status need-reward-speech)) (first-any (-> arg0 tasks) #t) ) - (new 'static 'spool-anim :name "mayor-resolution-beams" :index 7 :parts 6 :command-list '()) + ;; PAL patch here + (new 'static 'spool-anim + :name "mayor-resolution-beams" + :index 7 + :parts 6 + :command-list '((0 setting-unset ambient-volume)) + ) ) (defmethod play-anim! mayor ((obj mayor) (arg0 symbol)) @@ -88,8 +96,7 @@ :name "mayor-introduction" :index 4 :parts 16 - :command-list - '((0 kill "villagea-part-65") + :command-list '((0 kill "villagea-part-65") (0 kill "villagea-part-70") (0 kill "med-res-level-2") (0 kill "med-res-level-3") @@ -180,8 +187,7 @@ :name "mayor-reminder-donation" :index 6 :parts 3 - :command-list - '((0 kill "villagea-part-65") + :command-list '((0 kill "villagea-part-65") (0 kill "villagea-part-70") (0 kill "med-res-level-2") (0 kill "med-res-level-3") @@ -264,8 +270,7 @@ :name "mayor-reminder-beams" :index 5 :parts 3 - :command-list - '((0 kill "villagea-part-65") + :command-list '((0 kill "villagea-part-65") (0 kill "villagea-part-70") (0 kill "med-res-level-2") (0 kill "med-res-level-3") @@ -351,8 +356,7 @@ :name "mayor-reminder-beams" :index 5 :parts 3 - :command-list - '((0 kill "villagea-part-65") + :command-list '((0 kill "villagea-part-65") (0 kill "villagea-part-70") (0 kill "med-res-level-2") (0 kill "med-res-level-3") @@ -438,8 +442,7 @@ :name "mayor-reminder-donation" :index 6 :parts 3 - :command-list - '((0 kill "villagea-part-65") + :command-list '((0 kill "villagea-part-65") (0 kill "villagea-part-70") (0 kill "med-res-level-2") (0 kill "med-res-level-3") @@ -542,8 +545,7 @@ :name "mayor-resolution-donation" :index 8 :parts 5 - :command-list - '((0 kill "villagea-part-65") + :command-list '((0 kill "villagea-part-65") (0 kill "villagea-part-70") (0 kill "med-res-level-2") (0 kill "med-res-level-3") @@ -650,10 +652,7 @@ (defmethod TODO-RENAME-43 mayor ((obj mayor)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.8888889 f0-2) (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) @@ -701,16 +700,14 @@ (defstate idle (mayor) :virtual #t - :trans - (behavior () + :trans (behavior () (if (not (should-display? self)) (go-virtual hidden) ) ((-> (method-of-type process-taskable idle) trans)) (none) ) - :post - (behavior () + :post (behavior () (let ((t9-0 (-> (method-of-type process-taskable idle) post))) (if t9-0 ((the-as (function none) t9-0)) diff --git a/goal_src/levels/beach/pelican.gc b/goal_src/levels/beach/pelican.gc index b9e2bf1f10..702fea9c01 100644 --- a/goal_src/levels/beach/pelican.gc +++ b/goal_src/levels/beach/pelican.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/pelican-ag.gc") + (deftype pelican-bank (basic) ((circle-speed meters :offset-assert 4) (dive-time seconds :offset-assert 8) @@ -101,17 +103,14 @@ ) ) -(defskelgroup *pelican-sg* pelican - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 3 0 5) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *pelican-sg* pelican pelican-lod0-jg pelican-fly-ja + ((pelican-lod0-mg (meters 20)) (pelican-lod1-mg (meters 40)) (pelican-lod2-mg (meters 999999))) + :bounds (static-spherem 0 3 0 5) + :shadow pelican-shadow-mg + ) (defbehavior pelican-path-update pelican ((arg0 float) (arg1 int) (arg2 float) (arg3 float) (arg4 symbol)) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (let ((s3-0 (new 'stack-no-clear 'vector))) (let* ((f0-1 (+ (-> self path-pos) (* (-> self align align trans z) arg3))) (f1-2 (-> self path-max)) @@ -130,95 +129,47 @@ ) (defbehavior pelican-fly pelican ((arg0 (function pelican int)) (arg1 (function pelican int))) - (while #t + (loop (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? pelican-fly-ja) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) ) (else - (ja-channel-push! 1 75) + (ja-channel-push! 1 (seconds 0.25)) ) ) (let ((s4-0 (arg0 self))) (dotimes (s3-0 s4-0) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! pelican-fly-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (let ((s4-1 (arg1 self))) (when (> s4-1 0) - (let ((s3-1 (-> self skel root-channel 0))) - (set! (-> s3-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> s3-1 param 0) (ja-aframe 12.0 0)) - (set! (-> s3-1 param 1) 1.0) - (set! (-> s3-1 frame-num) 0.0) - (joint-control-channel-group! s3-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! pelican-fly-ja :num! (seek! (ja-aframe 12.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((s3-2 (-> self skel root-channel 0))) - (set! (-> s3-2 param 0) (ja-aframe 12.0 0)) - (set! (-> s3-2 param 1) 1.0) - (joint-control-channel-group-eval! s3-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 12.0 0))) ) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) 0.25) - (joint-control-channel-group! a0-18 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 300) + (ja-no-eval :num! (loop! 0.25)) + (ja-channel-push! 1 (seconds 1)) (dotimes (s3-3 s4-1) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-20 param 1) 1.0) - (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! pelican-glide-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) 1.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja-no-eval :num! (loop!)) ) ) ) @@ -231,8 +182,7 @@ ) (defstate pelican-circle (pelican) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -256,8 +206,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (while (-> self child) (deactivate (-> self child 0)) ) @@ -265,17 +214,7 @@ (let ((gp-0 (-> self path-vector))) (eval-path-curve-div! (-> self path-dive0) gp-0 4.5 'interp) (set! (-> gp-0 y) (+ -4505.6 (-> gp-0 y))) - (let* ((s5-0 (get-process *default-dead-pool* manipy #x4000)) - (v1-8 - (when s5-0 - (let ((t9-3 (method-of-type manipy activate))) - (t9-3 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init gp-0 (-> self entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2)) - (-> s5-0 ppointer) - ) - ) - ) + (let ((v1-8 (manipy-spawn gp-0 (-> self entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to self))) (set! (-> self fuel-cell) (ppointer->handle v1-8)) (if v1-8 (send-event @@ -299,8 +238,7 @@ (set-roll-to-grav-2! (-> self root-override) -2730.6667) (none) ) - :trans - (behavior () + :trans (behavior () (pelican-path-update 728177.75 30 1.0 (/ (-> self path-max) (path-distance (-> self path))) #f) (let ((f0-3 (+ (-> self path-pos) (* (-> self path-speed) (-> *display* seconds-per-frame)))) (f1-2 (-> self path-max)) @@ -310,60 +248,53 @@ (when (and (and *target* (>= 81920.0 (vector-vector-xz-distance (-> self path-vector) (-> *target* control trans)))) (not (handle->process (-> self cam-tracker))) ) - (let ((gp-1 (get-process *default-dead-pool* camera-tracker #x4000))) - (set! (-> self cam-tracker) - (ppointer->handle (when gp-1 - (let ((t9-4 (method-of-type camera-tracker activate))) - (t9-4 (the-as camera-tracker gp-1) self 'camera-tracker (the-as pointer #x70004000)) + (set! (-> self cam-tracker) + (ppointer->handle (process-spawn + camera-tracker + :init camera-tracker-init + (lambda :behavior camera-tracker + () + (local-vars + (a0-6 process-tree) + (a1-5 event-message-block) + (t9-6 (function process-tree event-message-block object)) ) - (run-now-in-process - gp-1 - camera-tracker-init - (lambda :behavior camera-tracker - () - (local-vars - (a0-6 process-tree) - (a1-5 event-message-block) - (t9-6 (function process-tree event-message-block object)) - ) - (while (not (process-grab? *target*)) - (suspend) - ) - (send-event (ppointer->process (-> self parent)) 'position 4.0) - (send-event (ppointer->process (-> self parent)) 'dive) - (suspend) - (suspend) - (send-event *camera* 'blend-from-as-fixed) - (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 0)) - (camera-change-to "camera-215" 0 #f) - (until (t9-6 a0-6 a1-5) - (suspend) - (set! a1-5 (new 'stack-no-clear 'event-message-block)) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 0) - (set! (-> a1-5 message) 'got-cell?) - (set! t9-6 send-event-function) - (set! a0-6 (ppointer->process (-> self parent))) - ) - (send-event *camera* 'point-of-interest #f) - (while (!= (-> self message) 'release) - (suspend) - ) - (set! (-> self message) #f) - (while (not (process-release? (handle->process (-> self grab-target)))) - (suspend) - ) - (send-event *camera* 'blend-from-as-fixed) - (camera-look-at (the-as pair *target*) (the-as uint 0)) - (camera-change-to (the-as string 'base) 150 #f) - (none) - ) + (while (not (process-grab? *target*)) + (suspend) ) - (-> gp-1 ppointer) + (send-event (ppointer->process (-> self parent)) 'position 4.0) + (send-event (ppointer->process (-> self parent)) 'dive) + (suspend) + (suspend) + (send-event *camera* 'blend-from-as-fixed) + (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 0)) + (camera-change-to "camera-215" 0 #f) + (until (t9-6 a0-6 a1-5) + (suspend) + (set! a1-5 (new 'stack-no-clear 'event-message-block)) + (set! (-> a1-5 from) self) + (set! (-> a1-5 num-params) 0) + (set! (-> a1-5 message) 'got-cell?) + (set! t9-6 send-event-function) + (set! a0-6 (ppointer->process (-> self parent))) + ) + (send-event *camera* 'point-of-interest #f) + (while (!= (-> self message) 'release) + (suspend) + ) + (set! (-> self message) #f) + (while (not (process-release? (handle->process (-> self grab-target)))) + (suspend) + ) + (send-event *camera* 'blend-from-as-fixed) + (camera-look-at (the-as pair *target*) (the-as uint 0)) + (camera-change-to (the-as string 'base) 150 #f) + (none) ) + :to self ) - ) - ) + ) + ) (set! (-> self draw force-lod) 0) 0 ) @@ -376,8 +307,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (suspend) (send-event (-> self fuel-cell process 0) 'trans-hook fuel-cell-animate) (pelican-fly @@ -386,13 +316,11 @@ ) (none) ) - :post - pelican-post + :post pelican-post ) (defstate pelican-dive (pelican) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'got-cell?) @@ -405,8 +333,7 @@ ) ) ) - :enter - (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame)) + :enter (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame)) (init! (-> self query) (the-as string #f) 40 150 25 #t (the-as string #f)) (set! (-> self state-object) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -434,46 +361,28 @@ 0 (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self draw force-lod) -1) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (handle->process (-> self fuel-cell))) (go pelican-fly-to-end (-> self path-to-nest2) (-> *PELICAN-bank* run-away-time)) ) (pelican-path-update 364088.88 30 0.0 0.0 #t) - (set! (-> self path-pos) - (seek (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-to-nest (-> self path-cache) (the-as int (-> self time-cache))) ) (none) ) - :code - (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame)) - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> gp-0 param 0) (ja-aframe 48.0 0)) - (set! (-> gp-0 param 1) 0.5) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + :code (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame)) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! pelican-swoop-ja :num! (seek! (ja-aframe 48.0 0) 0.5) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (let ((gp-1 (handle->process (-> self fuel-cell)))) - (when (and gp-1 (>= (-> self path-pos) 3.8) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 1) - (set! (-> a1-5 message) 'query) - (set! (-> a1-5 param 0) (the-as uint 'grab)) - (not (send-event-function gp-1 a1-5)) - ) - ) + (when (and gp-1 (>= (-> self path-pos) 3.8) (not (send-event gp-1 'query 'grab))) (level-hint-spawn (game-text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) (send-event gp-1 'grab self) (send-event gp-1 'draw #f) @@ -482,64 +391,38 @@ ) ) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe 48.0 0)) - (set! (-> gp-2 param 1) 0.5) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) 1.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 60) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) + (ja :num! (seek! (ja-aframe 48.0 0) 0.5)) ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! pelican-fly-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (anim-loop) (none) ) - :post - pelican-post + :post pelican-post ) (defstate pelican-to-nest (pelican) - :enter - (behavior ((arg0 path-control) (arg1 int)) + :enter (behavior ((arg0 path-control) (arg1 int)) (set! (-> self path) arg0) (set! (-> self path-pos) 0.0) (set! (-> self path-max) (the float (+ (-> self path curve num-cverts) -1))) (set! (-> self path-speed) (/ (* 300.0 (-> self path-max)) (the float arg1))) (none) ) - :trans - (behavior () + :trans (behavior () (pelican-path-update 546133.3 30 0.0 0.0 #f) - (set! (-> self path-pos) - (seek (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-wait-at-nest #f) ) (none) ) - :code - (behavior ((arg0 path-control) (arg1 int)) + :code (behavior ((arg0 path-control) (arg1 int)) (pelican-fly (the-as (function pelican int) (lambda () 1)) (lambda ((arg0 pelican)) (if (and (>= (-> arg0 path-pos) 4.0) (>= 6.0 (-> arg0 path-pos))) @@ -550,13 +433,11 @@ ) (none) ) - :post - pelican-post + :post pelican-post ) (defstate pelican-wait-at-nest (pelican) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -607,8 +488,7 @@ ) ) ) - :enter - (behavior ((arg0 symbol)) + :enter (behavior ((arg0 symbol)) (set! (-> self path) (-> self path-from-nest0)) (set! (-> self path-pos) 0.0) (set! (-> self path-max) (the float (+ (-> self path curve num-cverts) -1))) @@ -640,15 +520,13 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (if (nonzero? (-> self neck)) (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((a1-0 (-> self state-vector)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -661,94 +539,47 @@ (spool-push *art-control* "pelican-spit-ext" 0 self -99.0) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (cond (arg0 (ja-channel-set! 1) ) (else - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) 0.25) - (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 75) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :num! (loop! 0.25)) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! pelican-fly-down-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (until (vector= (-> self root-override trans) (-> self state-vector)) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-loop!) - ) - ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) 1.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim #f) num-func-loop!) + (ja :num! (loop!)) ) + (ja-no-eval :num! (loop!)) (set! (-> self state-float 0) (* 4.0 (-> self state-float 0))) - (ja-channel-push! 1 15) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! pelican-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 150) + (ja-channel-push! 1 (seconds 0.5)) ) ) (send-event (handle->process (-> self cam-tracker)) 'message 'release) - (while #t - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (loop + (ja-no-eval :group! pelican-sleep-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (behavior () + :post (behavior () (when *target* (if *target* (look-at-enemy! (-> *target* neck) (the-as vector (-> self root-override root-prim prim-core)) 'nothing self) @@ -763,24 +594,13 @@ ) (defstate pelican-spit (pelican) - :event - (-> pelican-circle event) - :code - (behavior () + :event (-> pelican-circle event) + :code (behavior () (local-vars (v1-21 symbol) (v1-31 symbol)) - (let* ((gp-0 (get-process *default-dead-pool* manipy #x4000)) - (gp-1 - (ppointer->handle - (when gp-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy gp-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 manipy-init (-> self entity extra trans) (-> self entity) *beachcam-sg* #f) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 + (ppointer->handle (manipy-spawn (-> self entity extra trans) (-> self entity) *beachcam-sg* #f :to self)) + ) + ) (let ((s5-0 (get-process *default-dead-pool* othercam #x4000))) (ppointer->handle (when s5-0 (let ((t9-4 (method-of-type othercam activate))) @@ -791,18 +611,11 @@ ) ) ) - (let* ((s5-1 (get-process *default-dead-pool* fuel-cell #x4000)) - (s4-0 (ppointer->handle (when s5-1 - (let ((t9-7 (method-of-type fuel-cell activate))) - (t9-7 (the-as fuel-cell s5-1) self 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 fuel-cell-init-as-clone (process->handle self) 0) - (-> s5-1 ppointer) - ) - ) - ) - (s5-2 (new 'stack-no-clear 'quaternion)) - ) + (let ((s4-0 + (ppointer->handle (process-spawn fuel-cell :init fuel-cell-init-as-clone (process->handle self) 0 :to self)) + ) + (s5-2 (new 'stack-no-clear 'quaternion)) + ) (quaternion-copy! s5-2 (-> self root-override quat)) (until v1-21 (suspend) @@ -814,10 +627,9 @@ :name "pelican-spit-ext" :index 11 :parts 2 - :command-list - '((10 send-event camera 'teleport-to-vector-start-string (static-vectorm -179 16 -421))) + :command-list '((10 send-event camera 'teleport-to-vector-start-string (static-vectorm -179 16 -421))) ) - (the-as art-joint-anim (-> self draw art-group data 10)) + (the-as art-joint-anim pelican-sleep-ja) (the-as art-joint-anim #f) (the-as (function process-drawable symbol) false-func) ) @@ -834,31 +646,26 @@ (quaternion-copy! (-> self root-override quat) s5-2) ) ) - (let ((gp-2 (get-process *default-dead-pool* process #x4000))) - (when gp-2 - (let ((t9-18 (method-of-type process activate))) - (t9-18 gp-2 self 'process (the-as pointer #x70004000)) + (process-spawn-function + process + (lambda :behavior pelican + () + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current movie) + (-> *setting-control* current hint) + ) + (suspend) ) - (run-next-time-in-process gp-2 (lambda :behavior pelican - () - (while (or (-> *setting-control* current ambient) - (-> *setting-control* current movie) - (-> *setting-control* current hint) - ) - (suspend) - ) - (level-hint-spawn - (game-text-id beach-pelican-quick-get-cell) - "sksp0027" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (none) - ) - ) - (-> gp-2 ppointer) + (level-hint-spawn + (game-text-id beach-pelican-quick-get-cell) + "sksp0027" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + (none) ) + :to self ) (let ((gp-3 (handle->process (-> self fuel-cell)))) (when gp-3 @@ -885,7 +692,7 @@ (pickup-type fuel-cell) (the float (-> self entity extra perm task)) #f - (the-as process-drawable *entity-pool*) + *entity-pool* (the-as fact-info #f) ) ) @@ -905,14 +712,8 @@ (go pelican-from-nest) (none) ) - :post - (behavior () - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 10) - ) - ) + :post (behavior () + (if (not (ja-group? pelican-sleep-ja)) (quaternion-identity! (-> self root-override quat)) ) (pelican-post) @@ -921,37 +722,30 @@ ) (defstate pelican-from-nest (pelican) - :enter - (behavior () + :enter (behavior () (set! (-> self path-pos) 1.5) (none) ) - :trans - (behavior () + :trans (behavior () (pelican-path-update 131072.0 150 0.0 0.0 #f) - (set! (-> self path-pos) - (seek (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-dive (-> self path-dive1) (-> self path-to-nest1) (-> *PELICAN-bank* to-nest1-time)) ) (none) ) - :code - (behavior () + :code (behavior () (pelican-fly (the-as (function pelican int) (lambda () (rand-vu-int-range 2 4))) (the-as (function pelican int) zero-func) ) (none) ) - :post - pelican-post + :post pelican-post ) (defstate pelican-fly-to-end (pelican) - :enter - (behavior ((arg0 path-control) (arg1 time-frame)) + :enter (behavior ((arg0 path-control) (arg1 time-frame)) (process-entity-status! self (entity-perm-status complete) #t) (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) @@ -970,12 +764,9 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (pelican-path-update 546133.3 30 0.0 0.0 #f) - (set! (-> self path-pos) - (seek (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-wait-at-end #f) ) @@ -992,8 +783,7 @@ ) (none) ) - :code - (behavior ((arg0 path-control) (arg1 time-frame)) + :code (behavior ((arg0 path-control) (arg1 time-frame)) (pelican-fly (the-as (function pelican int) (lambda () 1)) (lambda ((arg0 pelican)) (if (and (>= (-> arg0 path-pos) 4.0) (>= 6.0 (-> arg0 path-pos))) @@ -1004,44 +794,34 @@ ) (none) ) - :post - pelican-post + :post pelican-post ) (defstate pelican-wait-at-end (pelican) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (cleanup-for-death self) (none) ) ) (defstate pelican-explode (pelican) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-2 user-int8 0) 5) ) (when (not arg0) - (sound-play-by-name (static-sound-name "scrate-break") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 71) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (sound-play "scrate-break") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 71) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) ) (let ((gp-2 (new-stack-vector0))) @@ -1073,8 +853,7 @@ (anim-loop) (none) ) - :post - (the-as (function none :behavior pelican) ja-post) + :post (the-as (function none :behavior pelican) ja-post) ) (defmethod init-from-entity! pelican ((obj pelican) (arg0 entity-actor)) @@ -1127,23 +906,15 @@ (go pelican-wait-at-nest #t) ) ((2) - (let* ((s4-1 (get-process *default-dead-pool* manipy #x4000)) - (s5-2 (when s4-1 - (let ((t9-15 (method-of-type manipy activate))) - (t9-15 (the-as manipy s4-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-1 - manipy-init - (-> obj root-override trans) - (-> obj entity) - *fuel-cell-sg* - (new 'static 'vector :w 4915.2) - ) - (-> s4-1 ppointer) - ) - ) - ) + (let ((s5-2 (manipy-spawn + (-> obj root-override trans) + (-> obj entity) + *fuel-cell-sg* + (new 'static 'vector :w 4915.2) + :to obj + ) + ) + ) (set! (-> obj fuel-cell) (the-as handle (if s5-2 (ppointer->handle s5-2) (the-as int #f) diff --git a/goal_src/levels/beach/sculptor.gc b/goal_src/levels/beach/sculptor.gc index 63346e5474..3195db4c61 100644 --- a/goal_src/levels/beach/sculptor.gc +++ b/goal_src/levels/beach/sculptor.gc @@ -8,6 +8,9 @@ ;; DECOMP BEGINS +(import "goal_src/import/sculptor-muse-ag.gc") +(import "goal_src/import/sculptor-ag.gc") + (deftype sculptor (process-taskable) ((muse handle :offset-assert 384) ) @@ -18,22 +21,16 @@ ) -(defskelgroup *sculptor-muse-sg* sculptor-muse - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - ) +(defskelgroup *sculptor-muse-sg* sculptor-muse sculptor-muse-lod0-jg sculptor-muse-idle-ja + ((sculptor-muse-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + ) -(defskelgroup *sculptor-sg* sculptor - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *sculptor-sg* sculptor sculptor-lod0-jg sculptor-sigh-ja + ((sculptor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow sculptor-shadow-mg + ) (defmethod dummy-52 sculptor ((obj sculptor)) (let ((v1-1 (-> obj draw shadow-ctrl))) @@ -54,16 +51,19 @@ (defmethod draw-npc-shadow sculptor ((obj sculptor)) (-> obj draw shadow-ctrl) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -72,21 +72,11 @@ ) (defbehavior muse-to-idle sculptor ((arg0 muse)) - (when (not (handle->process (-> arg0 incomming-attack-id))) - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) + (if (not (handle->process (-> arg0 incomming-attack-id))) (set! (-> arg0 incomming-attack-id) - (ppointer->handle - (when s5-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy s5-0) arg0 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> arg0 collide-info trans) (-> arg0 entity) *sculptor-muse-sg* #f) - (-> s5-0 ppointer) - ) - ) + (ppointer->handle (manipy-spawn (-> arg0 collide-info trans) (-> arg0 entity) *sculptor-muse-sg* #f :to arg0)) ) ) - ) (let ((v1-11 (handle->process (-> arg0 incomming-attack-id)))) (if v1-11 (set! (-> (the-as muse v1-11) draw light-index) (the-as uint 3)) @@ -100,8 +90,7 @@ (defstate give-cell (sculptor) :virtual #t - :enter - (behavior () + :enter (behavior () (muse-to-idle (the-as muse self)) (none) ) @@ -117,8 +106,7 @@ :name "sculptor-introduction" :index 16 :parts 14 - :command-list - '((0 display-level beach special) + :command-list '((0 display-level beach special) (0 kill "med-res-level-2") (0 kill "med-res-level-4") (0 kill "med-res-level-6") @@ -146,19 +134,9 @@ (when arg0 (set! (-> obj cell-for-task) (current-task (-> obj tasks))) (close-current! (-> obj tasks)) - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj muse) - (ppointer->handle - (when s5-1 - (let ((t9-5 (method-of-type manipy activate))) - (t9-5 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *sculptor-muse-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> obj muse) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *sculptor-muse-sg* #f :to obj)) + ) (let ((v1-18 (handle->process (-> obj muse)))) (if v1-18 (set! (-> (the-as muse v1-18) draw light-index) (the-as uint 3)) @@ -171,8 +149,7 @@ :name "sculptor-resolution" :index 18 :parts 4 - :command-list - '((51 joint "cameraB") (87 joint "camera")) + :command-list '((51 joint "cameraB") (87 joint "camera")) ) ) (else @@ -202,10 +179,7 @@ (defmethod TODO-RENAME-43 sculptor ((obj sculptor)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) (play-ambient (-> obj ambient) "SCU-LO01" #f (-> obj root-override trans)) @@ -235,241 +209,95 @@ (defstate idle (sculptor) :virtual #t - :code - (behavior () - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) - ) - ) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim #f) num-func-seek!) + :code (behavior () + (when (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (get-art-elem self)) ) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) (case (current-status (-> self tasks)) (((task-status invalid) (task-status need-resolution)) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-from-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (muse-to-idle (the-as muse self)) ) ) - (while #t + (loop (let ((v1-43 (current-status (-> self tasks)))) (cond ((or (= v1-43 (task-status invalid)) (= v1-43 (task-status need-resolution))) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-to-small-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let* ((f30-0 4.0) (v1-68 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-69 (the-as number (logior #x3f800000 v1-68))) ) (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-69)))) 4)) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) 1.0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-small-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) 1.0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let* ((v1-97 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-98 (the-as number (logior #x3f800000 v1-97))) - (f30-1 (+ -1.0 (the-as float v1-98))) - ) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-28 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-28 param 1) 1.0) - (set! (-> a0-28 frame-num) 0.0) - (joint-control-channel-group! a0-28 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (let ((f30-1 (rand-float-gen))) + (ja-no-eval :group! sculptor-small-to-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1))) - (set! (-> a0-29 param 1) 1.0) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-31 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-31 param 1) 1.0) - (set! (-> a0-31 frame-num) 0.0) - (joint-control-channel-group! a0-31 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! sculptor-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-32 (-> self skel root-channel 0))) - (set! (-> a0-32 param 0) (the float (+ (-> a0-32 frame-group data 0 length) -1))) - (set! (-> a0-32 param 1) 1.0) - (joint-control-channel-group-eval! a0-32 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-34 (-> self skel root-channel 0))) - (set! (-> a0-34 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-34 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-34 param 1) 1.0) - (set! (-> a0-34 frame-num) 0.0) - (joint-control-channel-group! a0-34 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! sculptor-from-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 param 0) (the float (+ (-> a0-35 frame-group data 0 length) -1))) - (set! (-> a0-35 param 1) 1.0) - (joint-control-channel-group-eval! a0-35 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (when (< f30-1 0.5) - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> a0-37 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 13)) data 0 length) -1)) - ) - (set! (-> a0-37 param 1) 1.0) - (set! (-> a0-37 frame-num) 0.0) - (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-to-huge-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 param 0) (the float (+ (-> a0-38 frame-group data 0 length) -1))) - (set! (-> a0-38 param 1) 1.0) - (joint-control-channel-group-eval! a0-38 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let* ((f30-2 2.0) (v1-190 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-191 (the-as number (logior #x3f800000 v1-190))) ) (countdown (gp-2 (+ (the int (* f30-2 (+ -1.0 (the-as float v1-191)))) 2)) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> self draw art-group data 14))) - (set! (-> a0-42 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 14)) data 0 length) -1)) - ) - (set! (-> a0-42 param 1) 1.0) - (set! (-> a0-42 frame-num) 0.0) - (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> self draw art-group data 14)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-huge-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) (the float (+ (-> a0-43 frame-group data 0 length) -1))) - (set! (-> a0-43 param 1) 1.0) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let ((a0-45 (-> self skel root-channel 0))) - (set! (-> a0-45 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - (set! (-> a0-45 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 15)) data 0 length) -1)) - ) - (set! (-> a0-45 param 1) 1.0) - (set! (-> a0-45 frame-num) 0.0) - (joint-control-channel-group! a0-45 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-huge-to-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-46 (-> self skel root-channel 0))) - (set! (-> a0-46 param 0) (the float (+ (-> a0-46 frame-group data 0 length) -1))) - (set! (-> a0-46 param 1) 1.0) - (joint-control-channel-group-eval! a0-46 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-48 (-> self skel root-channel 0))) - (set! (-> a0-48 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-48 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-48 param 1) 1.0) - (set! (-> a0-48 frame-num) 0.0) - (joint-control-channel-group! a0-48 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! sculptor-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-49 (-> self skel root-channel 0))) - (set! (-> a0-49 param 0) (the float (+ (-> a0-49 frame-group data 0 length) -1))) - (set! (-> a0-49 param 1) 1.0) - (joint-control-channel-group-eval! a0-49 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-51 (-> self skel root-channel 0))) - (set! (-> a0-51 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-51 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-51 param 1) 1.0) - (set! (-> a0-51 frame-num) 0.0) - (joint-control-channel-group! a0-51 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! sculptor-from-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-52 (-> self skel root-channel 0))) - (set! (-> a0-52 param 0) (the float (+ (-> a0-52 frame-group data 0 length) -1))) - (set! (-> a0-52 param 1) 1.0) - (joint-control-channel-group-eval! a0-52 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -481,100 +309,36 @@ (v1-288 (the-as number (logior #x3f800000 v1-287))) ) (countdown (gp-3 (+ (the int (* f30-3 (+ -1.0 (the-as float v1-288)))) 4)) - (let ((a0-57 (-> self skel root-channel 0))) - (set! (-> a0-57 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-57 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-57 param 1) 1.0) - (set! (-> a0-57 frame-num) 0.0) - (joint-control-channel-group! a0-57 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-58 (-> self skel root-channel 0))) - (set! (-> a0-58 param 0) (the float (+ (-> a0-58 frame-group data 0 length) -1))) - (set! (-> a0-58 param 1) 1.0) - (joint-control-channel-group-eval! a0-58 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let* ((v1-316 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-317 (the-as number (logior #x3f800000 v1-316))) - ) - (< (+ -1.0 (the-as float v1-317)) 0.5) - ) - ) - (let ((a0-62 (-> self skel root-channel 0))) - (set! (-> a0-62 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-62 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-62 param 1) 1.0) - (set! (-> a0-62 frame-num) 0.0) - (joint-control-channel-group! a0-62 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + (< (rand-float-gen) 0.5) ) + (ja-no-eval :group! sculptor-sigh-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-63 (-> self skel root-channel 0))) - (set! (-> a0-63 param 0) (the float (+ (-> a0-63 frame-group data 0 length) -1))) - (set! (-> a0-63 param 1) 1.0) - (joint-control-channel-group-eval! a0-63 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-65 (-> self skel root-channel 0))) - (set! (-> a0-65 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-65 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-65 param 1) 1.0) - (set! (-> a0-65 frame-num) 0.0) - (joint-control-channel-group! a0-65 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-strikestart-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-66 (-> self skel root-channel 0))) - (set! (-> a0-66 param 0) (the float (+ (-> a0-66 frame-group data 0 length) -1))) - (set! (-> a0-66 param 1) 1.0) - (joint-control-channel-group-eval! a0-66 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-68 (-> self skel root-channel 0))) - (set! (-> a0-68 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-68 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-68 param 1) 1.0) - (set! (-> a0-68 frame-num) 0.0) - (joint-control-channel-group! a0-68 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! sculptor-strikemiddle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-69 (-> self skel root-channel 0))) - (set! (-> a0-69 param 0) (the float (+ (-> a0-69 frame-group data 0 length) -1))) - (set! (-> a0-69 param 1) 1.0) - (joint-control-channel-group-eval! a0-69 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-71 (-> self skel root-channel 0))) - (set! (-> a0-71 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-71 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-71 param 1) 1.0) - (set! (-> a0-71 frame-num) 0.0) - (joint-control-channel-group! a0-71 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! sculptor-strikeend-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-72 (-> self skel root-channel 0))) - (set! (-> a0-72 param 0) (the float (+ (-> a0-72 frame-group data 0 length) -1))) - (set! (-> a0-72 param 1) 1.0) - (joint-control-channel-group-eval! a0-72 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) diff --git a/goal_src/levels/beach/seagull.gc b/goal_src/levels/beach/seagull.gc index 92754e7b80..0ed5cb74a4 100644 --- a/goal_src/levels/beach/seagull.gc +++ b/goal_src/levels/beach/seagull.gc @@ -4,23 +4,22 @@ ;; name: seagull.gc ;; name in dgo: seagull ;; dgos: BEA, L1 - -(define-extern *seagull-sg* skeleton-group) +;; note: modified for high fps (declare-type seagullflock process) ;; DECOMP BEGINS +(import "goal_src/import/seagull-ag.gc") + (defpartgroup group-seagull-takeoff :id 160 :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 663 :fade-after (meters 20))) + :parts ((sp-item 663 :fade-after (meters 20))) ) (defpart 665 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -34,10 +33,7 @@ ) ) -(define - sound-seagull-squall - (new 'static 'sound-spec :num 1.0 :group #x1 :sound-name (static-sound-name "seagulls-2") :volume #x400) - ) +(define sound-seagull-squall (static-sound-spec "seagulls-2")) (deftype seagull (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -134,8 +130,7 @@ (none) ) -(define - *seagull-boxes* +(define *seagull-boxes* (new 'static 'inline-array air-box 10 (new 'static 'air-box :vecs (new 'static 'inline-array vector 2 (new 'static 'vector :x -1146880.0 :y 143360.0 :z -1638400.0 :w -0.6427) @@ -190,13 +185,10 @@ ) ) -(defskelgroup *seagull-sg* seagull - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *seagull-sg* seagull seagull-lod0-jg seagull-idle-ja + ((seagull-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) (defmethod dummy-25 seagull ((obj seagull) (arg0 float)) (let ((f1-1 (the float (sar (shl (the int (- arg0 (-> obj heading))) 48) 48))) @@ -315,7 +307,7 @@ ) (let ((f0-28 (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z))))) (set! (-> obj angletan) (/ (- (-> s5-0 y)) (sqrtf f0-28))) - (set! (-> obj target-dist) (sqrtf (+ f0-28 (* (-> s5-0 y) (-> s5-0 y))))) + (set! (-> obj target-dist) (* (-> *display* time-adjust-ratio) (sqrtf (+ f0-28 (* (-> s5-0 y) (-> s5-0 y)))))) ;; changed for high fps ) ) 0 @@ -336,8 +328,7 @@ ) (defstate seagull-idle (seagull) - :enter - (behavior () + :enter (behavior () (let* ((v1-0 (-> self flock)) (f30-0 (dummy-16 (if v1-0 @@ -348,17 +339,14 @@ ) (f28-0 21845.334) (f26-0 -0.5) - (v1-5 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-6 (the-as number (logior #x3f800000 v1-5))) ) (set! (-> self heading) - (the float (sar (shl (the int (+ f30-0 (* f28-0 (+ f26-0 (+ -1.0 (the-as float v1-6)))))) 48) 48)) + (the float (sar (shl (the int (+ f30-0 (* f28-0 (+ f26-0 (rand-float-gen))))) 48) 48)) ) ) (none) ) - :trans - (behavior () + :trans (behavior () (when (nonzero? (-> self scared)) (+! (-> self scared) -1) (when (zero? (-> self scared)) @@ -382,21 +370,13 @@ ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self root-override trans y) (+ 20480.0 (-> self root-override trans y))) (move-to-ground (-> self root-override) 40960.0 40960.0 #t (collide-kind background)) (update-transforms! (-> self root-override)) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) (ja-aframe 0.0 0)) - ) - (while #t + (ja :group! seagull-idle-ja :num! (identity (ja-aframe 0.0 0))) + (loop (let* ((f30-0 4.0) (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-15 (the-as number (logior #x3f800000 v1-14))) @@ -413,20 +393,10 @@ ) (cond ((zero? gp-1) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-2 param 0) (ja-aframe 4.0 0)) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) (ja-aframe 0.0 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! seagull-idle-ja :num! (seek! (ja-aframe 4.0 0)) :frame-num (ja-aframe 0.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 4.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 4.0 0))) ) (let* ((f30-2 60.0) (v1-37 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -437,20 +407,10 @@ (suspend) ) ) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-5 param 0) (ja-aframe 10.0 0)) - (set! (-> gp-5 param 1) 1.0) - (set! (-> gp-5 frame-num) (ja-aframe 4.0 0)) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! seagull-idle-ja :num! (seek! (ja-aframe 10.0 0)) :frame-num (ja-aframe 4.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 param 0) (ja-aframe 10.0 0)) - (set! (-> gp-6 param 1) 1.0) - (joint-control-channel-group-eval! gp-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 10.0 0))) ) (let* ((f30-3 60.0) (v1-55 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -461,71 +421,31 @@ (suspend) ) ) - (let ((gp-8 (-> self skel root-channel 0))) - (set! (-> gp-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-8 param 0) (ja-aframe 14.0 0)) - (set! (-> gp-8 param 1) 1.0) - (set! (-> gp-8 frame-num) (ja-aframe 10.0 0)) - (joint-control-channel-group! gp-8 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! seagull-idle-ja :num! (seek! (ja-aframe 14.0 0)) :frame-num (ja-aframe 10.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-9 (-> self skel root-channel 0))) - (set! (-> gp-9 param 0) (ja-aframe 14.0 0)) - (set! (-> gp-9 param 1) 1.0) - (joint-control-channel-group-eval! gp-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 14.0 0))) ) ) ((= gp-1 2) - (let ((gp-10 (-> self skel root-channel 0))) - (set! (-> gp-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-10 param 0) (ja-aframe 4.0 0)) - (set! (-> gp-10 param 1) 1.0) - (set! (-> gp-10 frame-num) (ja-aframe 0.0 0)) - (joint-control-channel-group! gp-10 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! seagull-peck-ja :num! (seek! (ja-aframe 4.0 0)) :frame-num (ja-aframe 0.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-11 (-> self skel root-channel 0))) - (set! (-> gp-11 param 0) (ja-aframe 4.0 0)) - (set! (-> gp-11 param 1) 1.0) - (joint-control-channel-group-eval! gp-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 4.0 0))) ) ) ((= gp-1 3) - (let ((gp-12 (-> self skel root-channel 0))) - (set! (-> gp-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-12 param 0) (ja-aframe 8.0 0)) - (set! (-> gp-12 param 1) 1.0) - (set! (-> gp-12 frame-num) (ja-aframe 4.0 0)) - (joint-control-channel-group! gp-12 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! seagull-peck-ja :num! (seek! (ja-aframe 8.0 0)) :frame-num (ja-aframe 4.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-13 (-> self skel root-channel 0))) - (set! (-> gp-13 param 0) (ja-aframe 8.0 0)) - (set! (-> gp-13 param 1) 1.0) - (joint-control-channel-group-eval! gp-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 8.0 0))) ) ) ((= gp-1 4) - (let ((gp-14 (-> self skel root-channel 0))) - (set! (-> gp-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-14 param 0) (ja-aframe 12.0 0)) - (set! (-> gp-14 param 1) 1.0) - (set! (-> gp-14 frame-num) (ja-aframe 8.0 0)) - (joint-control-channel-group! gp-14 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! seagull-peck-ja :num! (seek! (ja-aframe 12.0 0)) :frame-num (ja-aframe 8.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-15 (-> self skel root-channel 0))) - (set! (-> gp-15 param 0) (ja-aframe 12.0 0)) - (set! (-> gp-15 param 1) 1.0) - (joint-control-channel-group-eval! gp-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 12.0 0))) ) ) ) @@ -533,8 +453,7 @@ ) (none) ) - :post - seagull-post + :post seagull-post ) (defmethod move-vertically! seagull ((obj seagull) (arg0 symbol)) @@ -551,7 +470,7 @@ ) ) ) - (set! (-> obj root-override transv y) f0-0) + (set! (-> obj root-override transv y) (* (-> *display* time-adjust-ratio) f0-0)) ;; changed for high fps ) 0 (none) @@ -559,26 +478,20 @@ (defmethod dummy-26 seagull ((obj seagull)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (let* ((f30-0 -4096.0) - (f28-0 8192.0) - (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (set! (-> s5-0 x) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-2))) (-> obj flock 0 target x))) + (let ((f30-0 -4096.0) + (f28-0 8192.0) + ) + (set! (-> s5-0 x) (+ f30-0 (* f28-0 (rand-float-gen)) (-> obj flock 0 target x))) ) - (let* ((f30-1 -4096.0) - (f28-1 8192.0) - (v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-8 (the-as number (logior #x3f800000 v1-7))) - ) - (set! (-> s5-0 y) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-8))) (-> obj flock 0 target y))) + (let ((f30-1 -4096.0) + (f28-1 8192.0) + ) + (set! (-> s5-0 y) (+ f30-1 (* f28-1 (rand-float-gen)) (-> obj flock 0 target y))) ) - (let* ((f30-2 -4096.0) - (f28-2 8192.0) - (v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-14 (the-as number (logior #x3f800000 v1-13))) - ) - (set! (-> s5-0 z) (+ f30-2 (* f28-2 (+ -1.0 (the-as float v1-14))) (-> obj flock 0 target z))) + (let ((f30-2 -4096.0) + (f28-2 8192.0) + ) + (set! (-> s5-0 z) (+ f30-2 (* f28-2 (rand-float-gen)) (-> obj flock 0 target z))) ) (vector-! s5-0 s5-0 (-> obj root-override trans)) (vector-float*! s5-0 s5-0 0.9) @@ -592,8 +505,8 @@ (let ((f30-1 (* arg0 (sin (-> obj heading)))) (f0-4 (* arg0 (cos (-> obj heading)))) ) - (set! (-> obj root-override transv x) (+ (* 0.8 (-> obj root-override transv x)) (* 0.2 f30-1))) - (set! (-> obj root-override transv z) (+ (* 0.8 (-> obj root-override transv z)) (* 0.2 f0-4))) + (set! (-> obj root-override transv x) (* (-> *display* time-adjust-ratio) (+ (* 0.8 (-> obj root-override transv x)) (* 0.2 f30-1)))) ;; changed for high fps + (set! (-> obj root-override transv z) (* (-> *display* time-adjust-ratio) (+ (* 0.8 (-> obj root-override transv z)) (* 0.2 f0-4)))) ;; changed for high fps ) 0 (none) @@ -603,8 +516,8 @@ (let ((f30-1 (* arg0 (sin (-> obj heading)))) (f0-4 (* arg0 (cos (-> obj heading)))) ) - (set! (-> obj root-override transv x) f30-1) - (set! (-> obj root-override transv z) f0-4) + (set! (-> obj root-override transv x) (* (-> *display* time-adjust-ratio) f30-1)) ;; changed for high fps + (set! (-> obj root-override transv z) (* (-> *display* time-adjust-ratio) f0-4)) ;; changed for high fps ) 0 (none) @@ -649,24 +562,16 @@ ) (defstate seagull-takeoff (seagull) - :trans - (behavior () + :trans (behavior () (when (< (+ (-> *display* base-frame-counter) (seconds -2)) (-> self part-time)) (-> self part) (-> self root-override root-prim prim-core) ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self part-time) (-> *display* base-frame-counter)) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> gp-0 param 0) (ja-aframe 4.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 1.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! seagull-takeoff-ja :num! (seek! (ja-aframe 4.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (when (and (>= (ja-frame-num 0) (ja-aframe 2.0 0)) (>= (ja-aframe 3.0 0) (ja-frame-num 0))) (let* ((v1-13 self) @@ -685,7 +590,7 @@ ) ) ) - (set! (-> v1-13 root-override transv y) f0-5) + (set! (-> v1-13 root-override transv y) (* (-> *display* time-adjust-ratio) f0-5)) ;; changed for high fps ) 0 (let* ((gp-1 self) @@ -693,55 +598,36 @@ (f30-2 (* f28-0 (sin (-> gp-1 heading)))) (f0-10 (* f28-0 (cos (-> gp-1 heading)))) ) - (set! (-> gp-1 root-override transv x) (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-2))) - (set! (-> gp-1 root-override transv z) (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-10))) + (set! (-> gp-1 root-override transv x) (* (-> *display* time-adjust-ratio) (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-2)))) ;; changed for high fps + (set! (-> gp-1 root-override transv z) (* (-> *display* time-adjust-ratio) (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-10)))) ;; changed for high fps ) 0 ) (dummy-27 self) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe 4.0 0)) - (set! (-> gp-2 param 1) 1.0) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 4.0 0))) ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 20) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.067)) (go seagull-flying) (none) ) - :post - seagull-post + :post seagull-post ) (defstate seagull-flying (seagull) - :trans - (behavior () + :trans (behavior () (when (< (+ (-> *display* base-frame-counter) (seconds -2)) (-> self part-time)) (-> self part) (-> self root-override root-prim prim-core) ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self max-tilt) 1820.4445) (let ((gp-0 0)) - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (loop + (ja-no-eval :group! seagull-fly-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (when (-> self teleport) @@ -833,7 +719,7 @@ ) (let ((f0-33 (+ (* (-> s4-0 x) (-> s4-0 x)) (* (-> s4-0 z) (-> s4-0 z))))) (set! (-> s5-0 angletan) (/ (- (-> s4-0 y)) (sqrtf f0-33))) - (set! (-> s5-0 target-dist) (sqrtf (+ f0-33 (* (-> s4-0 y) (-> s4-0 y))))) + (set! (-> s5-0 target-dist) (* (-> *display* time-adjust-ratio) (sqrtf (+ f0-33 (* (-> s4-0 y) (-> s4-0 y)))))) ;; changed for high fps ) ) 0 @@ -856,7 +742,7 @@ ) ) ) - (set! (-> v1-44 root-override transv y) f0-38) + (set! (-> v1-44 root-override transv y) (* (-> *display* time-adjust-ratio) f0-38)) ;; changed for high fps ) 0 ) @@ -877,7 +763,7 @@ ) ) ) - (set! (-> v1-48 root-override transv y) f0-39) + (set! (-> v1-48 root-override transv y) (* (-> *display* time-adjust-ratio) f0-39)) ;; changed for high fps ) 0 ) @@ -894,11 +780,7 @@ 0 (dummy-27 self) (suspend) - (let ((a0-64 (-> self skel root-channel 0))) - (set! (-> a0-64 param 0) (the float (+ (-> a0-64 frame-group data 0 length) -1))) - (set! (-> a0-64 param 1) 1.0) - (joint-control-channel-group-eval! a0-64 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (+! gp-0 1) (when (>= gp-0 0) @@ -922,33 +804,22 @@ ) (none) ) - :post - seagull-post + :post seagull-post ) (defstate seagull-soaring (seagull) - :trans - (behavior () + :trans (behavior () (when (< (+ (-> *display* base-frame-counter) (seconds -2)) (-> self part-time)) (-> self part) (-> self root-override root-prim prim-core) ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self max-tilt) 4551.1113) - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (loop + (ja-no-eval :group! seagull-slowfly-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (when (-> self teleport) @@ -1040,7 +911,7 @@ ) (let ((f0-33 (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z))))) (set! (-> gp-0 angletan) (/ (- (-> s5-0 y)) (sqrtf f0-33))) - (set! (-> gp-0 target-dist) (sqrtf (+ f0-33 (* (-> s5-0 y) (-> s5-0 y))))) + (set! (-> gp-0 target-dist) (* (-> *display* time-adjust-ratio) (sqrtf (+ f0-33 (* (-> s5-0 y) (-> s5-0 y)))))) ;; changed for high fps ) ) 0 @@ -1053,8 +924,8 @@ (f30-0 (* f28-0 (sin (-> gp-1 heading)))) (f0-41 (* f28-0 (cos (-> gp-1 heading)))) ) - (set! (-> gp-1 root-override transv x) (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-0))) - (set! (-> gp-1 root-override transv z) (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-41))) + (set! (-> gp-1 root-override transv x) (* (-> *display* time-adjust-ratio) (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-0)))) ;; changed for high fps + (set! (-> gp-1 root-override transv z) (* (-> *display* time-adjust-ratio) (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-41)))) ;; changed for high fps ) 0 (dummy-27 self) @@ -1089,22 +960,16 @@ ) ) (suspend) - (let ((a0-54 (-> self skel root-channel 0))) - (set! (-> a0-54 param 0) (the float (+ (-> a0-54 frame-group data 0 length) -1))) - (set! (-> a0-54 param 1) 1.0) - (joint-control-channel-group-eval! a0-54 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - seagull-post + :post seagull-post ) (defstate seagull-landing (seagull) - :code - (behavior ((arg0 float)) + :code (behavior ((arg0 float)) (let ((s5-0 (new 'stack 'collide-tri-result))) 0.0 (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -1118,7 +983,7 @@ (collide-kind background) self s5-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -1168,27 +1033,12 @@ ) 0 ) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 40) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-1 frame-num) (ja-aframe 0.0 0)) - ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.135)) + (ja :group! seagull-land-ja :num! (identity (ja-aframe 0.0 0))) (while (< 0.0 f30-0) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1))) - (set! (-> a0-29 param 1) 1.0) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! f30-0 (- f30-0 (-> *display* seconds-per-frame))) (fill-cache-integrate-and-collide! (-> self root-override) @@ -1232,11 +1082,7 @@ ) (while (not (ja-done? 0)) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) (the float (+ (-> a0-43 frame-group data 0 length) -1))) - (set! (-> a0-43 param 1) 1.0) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (let* ((v1-59 self) (f1-23 (the float (sar (shl (the int (- (-> self heading) (-> v1-59 heading))) 48) 48))) (f0-47 (- (-> v1-59 tilt))) @@ -1272,8 +1118,7 @@ (go seagull-idle) (none) ) - :post - seagull-post + :post seagull-post ) (defun seagull-reaction ((arg0 collide-shape-moving) (arg1 collide-shape-intersect) (arg2 vector) (arg3 vector)) @@ -1293,11 +1138,11 @@ (s4-1 (-> arg0 process)) ) (set! (-> (the-as seagull s4-1) temp-heading) (atan (-> v1-7 x) (-> v1-7 z))) - (set! (-> (the-as seagull s4-1) temp-heading-time) 300) + (set! (-> (the-as seagull s4-1) temp-heading-time) (seconds 1)) ) (let ((v0-2 (logior s5-0 3))) - (set! (-> arg0 status) (the-as uint v0-2)) - (the-as uint v0-2) + (set! (-> arg0 status) (the-as cshape-moving-flags v0-2)) + (the-as cshape-moving-flags v0-2) ) ) ) @@ -1328,12 +1173,10 @@ (set! (-> self flock) (the-as (pointer seagullflock) (process->ppointer arg2))) (set! (-> self heading) 0.0) (set! (-> self tilt) 0.0) - (let* ((f30-0 51200.0) - (f28-0 20480.0) - (v1-23 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-24 (the-as number (logior #x3f800000 v1-23))) - ) - (set! (-> self thrust) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-24))))) + (let ((f30-0 51200.0) + (f28-0 20480.0) + ) + (set! (-> self thrust) (+ f30-0 (* f28-0 (rand-float-gen)))) ) (set! (-> self teleport) #f) (go seagull-idle) @@ -1415,7 +1258,7 @@ (if (>= (-> obj targetnum) 4) (set! (-> obj teleport-frames) 1500) ) - (sound-play-by-name (static-sound-name "seagull-takeoff") (new-sound-id) 1024 0 0 1 #t) + (sound-play "seagull-takeoff") (set! (-> obj alert-time) (-> *display* base-frame-counter)) ) (none) @@ -1430,8 +1273,7 @@ ) (defstate seagullflock-at-waterfall (seagullflock) - :code - (behavior () + :code (behavior () (local-vars (a0-2 process) (a1-0 event-message-block) @@ -1489,9 +1331,8 @@ ) (defstate seagullflock-idle (seagullflock) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (> (-> self teleport-frames) 0) (go seagullflock-at-waterfall) ) @@ -1552,16 +1393,7 @@ (if (= (-> obj birds) 64) (return (the-as (pointer process) #f)) ) - (let* ((s4-0 (get-process *default-dead-pool* seagull #x4000)) - (v0-0 (when s4-0 - (let ((t9-1 (method-of-type seagull activate))) - (t9-1 (the-as seagull s4-0) obj 'seagull (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 seagull-init-by-other arg0 (-> obj birds) obj) - (-> s4-0 ppointer) - ) - ) - ) + (let ((v0-0 (process-spawn seagull arg0 (-> obj birds) obj :to obj))) (set! (-> obj bird (-> obj birds)) (the-as (pointer seagull) v0-0)) (+! (-> obj birds) 1) v0-0 diff --git a/goal_src/levels/beach/wobbler.gc b/goal_src/levels/beach/wobbler.gc index 15a4152277..511d6fb90b 100644 --- a/goal_src/levels/beach/wobbler.gc +++ b/goal_src/levels/beach/wobbler.gc @@ -5,7 +5,8 @@ ;; name in dgo: wobbler ;; dgos: BEA, L1 -;; definition of type wobbler +;; DECOMP BEGINS + (deftype wobbler (basic) ((posx float :offset-assert 4) (posy float :offset-assert 8) @@ -26,8 +27,7 @@ ) ) -;; definition for method 9 of type wobbler -;; INFO: Return type mismatch int vs none. + (defmethod reset! wobbler ((obj wobbler) (arg0 float) (arg1 float) (arg2 float)) (set! (-> obj posx) 0.0) (set! (-> obj posy) 0.0) @@ -40,8 +40,6 @@ (none) ) -;; definition for method 10 of type wobbler -;; INFO: Return type mismatch int vs none. (defmethod inc-xy-vel! wobbler ((obj wobbler) (arg0 float) (arg1 float)) (+! (-> obj velx) arg0) (+! (-> obj vely) arg1) @@ -49,41 +47,33 @@ (none) ) -;; definition for method 11 of type wobbler -;; INFO: Return type mismatch int vs none. (defmethod move! wobbler ((obj wobbler)) (+! (-> obj posx) (* (-> obj velx) (-> *display* seconds-per-frame))) (+! (-> obj posy) (* (-> obj vely) (-> *display* seconds-per-frame))) (set! (-> obj velx) (* (-> obj velx) (-> obj damping))) (set! (-> obj vely) (* (-> obj vely) (-> obj damping))) - (+! (-> obj velx) (* (* -1.0 (-> obj posx)) (-> obj spring))) - (+! (-> obj vely) (* (* -1.0 (-> obj posy)) (-> obj spring))) + (+! (-> obj velx) (* -1.0 (-> obj posx) (-> obj spring))) + (+! (-> obj vely) (* -1.0 (-> obj posy) (-> obj spring))) 0 (none) ) -;; definition for method 12 of type wobbler -;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-12 wobbler ((obj wobbler) (arg0 quaternion)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 x) (-> obj posy)) - (set! (-> s5-0 y) 0.0) - (set! (-> s5-0 z) (- (-> obj posx))) - (vector-normalize! s5-0 1.0) - (let* - ((f0-8 - (/ - (sqrtf - (+ (* (-> obj posx) (-> obj posx)) (* (-> obj posy) (-> obj posy))) - ) - (-> obj height) - ) + (set! (-> s5-0 x) (-> obj posy)) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (- (-> obj posx))) + (vector-normalize! s5-0 1.0) + (let* ((f0-8 (/ (sqrtf (+ (* (-> obj posx) (-> obj posx)) (* (-> obj posy) (-> obj posy)))) (-> obj height))) + (f0-9 (atan f0-8 1.0)) + ) + (quaternion-vector-angle! arg0 s5-0 f0-9) ) - (f0-9 (atan f0-8 1.0)) - ) - (quaternion-vector-angle! arg0 s5-0 f0-9) ) - ) 0 (none) ) + + + + diff --git a/goal_src/levels/citadel/assistant-citadel.gc b/goal_src/levels/citadel/assistant-citadel.gc index 4b86dc08fd..70613240a6 100644 --- a/goal_src/levels/citadel/assistant-citadel.gc +++ b/goal_src/levels/citadel/assistant-citadel.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/assistant-lavatube-end-ag.gc") + (deftype assistant-lavatube-end (process-taskable) () :heap-base #x110 @@ -16,14 +18,11 @@ ) -(defskelgroup *assistant-lavatube-end-sg* assistant-lavatube-end - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *assistant-lavatube-end-sg* assistant-lavatube-end assistant-lavatube-end-lod0-jg assistant-lavatube-end-idle-ja + ((assistant-lavatube-end-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow assistant-lavatube-end-shadow-mg + ) (defmethod play-anim! assistant-lavatube-end ((obj assistant-lavatube-end) (arg0 symbol)) (case (current-status (-> obj tasks)) @@ -38,8 +37,7 @@ :name "assistant-lavatube-end-resolution" :index 4 :parts 11 - :command-list - '((61 joint "cameraB") + :command-list '((61 joint "cameraB") (151 joint "camera") (226 joint "cameraB") (273 joint "camera") @@ -75,8 +73,7 @@ (defstate hidden (assistant-lavatube-end) :virtual #t - :trans - (behavior () + :trans (behavior () (dummy-33 self) ((-> (method-of-type process-taskable hidden) trans)) (when (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) @@ -89,8 +86,7 @@ (defstate idle (assistant-lavatube-end) :virtual #t - :enter - (behavior () + :enter (behavior () ((-> (method-of-type process-taskable idle) enter)) (case (get-task-status (game-task village4-button)) (((task-status need-reward-speech)) @@ -99,52 +95,16 @@ ) (none) ) - :code - (behavior () - (while #t - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - ) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-10 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! - a0-10 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + :code (behavior () + (loop + (when (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 3)) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) diff --git a/goal_src/levels/citadel/citadel-obs.gc b/goal_src/levels/citadel/citadel-obs.gc index bec77d3412..d1c6ffd9b2 100644 --- a/goal_src/levels/citadel/citadel-obs.gc +++ b/goal_src/levels/citadel/citadel-obs.gc @@ -7,6 +7,18 @@ ;; DECOMP BEGINS +(import "goal_src/import/citb-generator-ag.gc") +(import "goal_src/import/citb-launcher-ag.gc") +(import "goal_src/import/citb-button-ag.gc") +(import "goal_src/import/citadelcam-ag.gc") +(import "goal_src/import/citb-hose-ag.gc") +(import "goal_src/import/citb-robotboss-ag.gc") +(import "goal_src/import/citb-coil-ag.gc") +(import "goal_src/import/citb-arm-shoulder-ag.gc") +(import "goal_src/import/citb-iris-door-ag.gc") +(import "goal_src/import/citb-disc-ag.gc") +(import "goal_src/import/citb-arm-ag.gc") + (deftype citb-arm-section (process-drawable) ((sync sync-info :inline :offset-assert 176) (cull-dir-local vector :inline :offset-assert 192) @@ -26,62 +38,49 @@ ) -(defskelgroup *citb-arm-a-sg* citb-arm - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 14) - :longest-edge (meters 9) - ) +(defskelgroup *citb-arm-a-sg* citb-arm citb-arm-a-lod0-jg citb-arm-a-idle-ja + ((citb-arm-a-lod0-mg (meters 20)) (citb-arm-a-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 14) + :longest-edge (meters 9) + ) -(defskelgroup *citb-arm-b-sg* citb-arm - 4 - 7 - ((5 (meters 20)) (6 (meters 999999))) - :bounds (static-spherem 0 0 0 20) - :longest-edge (meters 10) - ) +(defskelgroup *citb-arm-b-sg* citb-arm citb-arm-b-lod0-jg citb-arm-b-idle-ja + ((citb-arm-b-lod0-mg (meters 20)) (citb-arm-b-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + :longest-edge (meters 10) + ) -(defskelgroup *citb-arm-c-sg* citb-arm - 8 - 11 - ((9 (meters 20)) (10 (meters 999999))) - :bounds (static-spherem 0 0 0 25) - :longest-edge (meters 11) - ) +(defskelgroup *citb-arm-c-sg* citb-arm citb-arm-c-lod0-jg citb-arm-c-idle-ja + ((citb-arm-c-lod0-mg (meters 20)) (citb-arm-c-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + :longest-edge (meters 11) + ) -(defskelgroup *citb-arm-d-sg* citb-arm - 12 - 15 - ((13 (meters 20)) (14 (meters 999999))) - :bounds (static-spherem 0 0 0 29) - :longest-edge (meters 8) - ) +(defskelgroup *citb-arm-d-sg* citb-arm citb-arm-d-lod0-jg citb-arm-d-idle-ja + ((citb-arm-d-lod0-mg (meters 20)) (citb-arm-d-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 29) + :longest-edge (meters 8) + ) -(defskelgroup *citb-arm-shoulder-a-sg* citb-arm-shoulder - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 22) - :longest-edge (meters 10) - ) +(defskelgroup *citb-arm-shoulder-a-sg* citb-arm-shoulder citb-arm-shoulder-a-lod0-jg citb-arm-shoulder-a-idle-ja + ((citb-arm-shoulder-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 22) + :longest-edge (meters 10) + ) -(defskelgroup *citb-arm-shoulder-b-sg* citb-arm-shoulder - 3 - 5 - ((4 (meters 999999))) - :bounds (static-spherem 0 0 0 22) - :longest-edge (meters 10) - ) +(defskelgroup *citb-arm-shoulder-b-sg* citb-arm-shoulder citb-arm-shoulder-b-lod0-jg citb-arm-shoulder-b-idle-ja + ((citb-arm-shoulder-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 22) + :longest-edge (meters 10) + ) (defstate idle (citb-arm-section) :virtual #t - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (while #t + (loop (cond ((< (- (-> (target-pos 0) y) (-> self root trans y)) -122880.0) (set! (-> self draw force-lod) 1) @@ -108,8 +107,7 @@ ) (none) ) - :post - (the-as (function none :behavior citb-arm-section) ja-post) + :post (the-as (function none :behavior citb-arm-section) ja-post) ) (defmethod init-root! citb-arm-section ((obj citb-arm-section)) @@ -159,10 +157,8 @@ (defstate idle (citb-arm) :virtual #t - :trans - (the-as (function none :behavior citb-arm) rider-trans) - :post - (behavior () + :trans (the-as (function none :behavior citb-arm) rider-trans) + :post (behavior () (if (logtest? (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self root-override)) (restore-collide-with-as (-> self root-override)) @@ -324,37 +320,29 @@ (none) ) -(defskelgroup *citb-disc-a-sg* citb-disc - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 12) - :longest-edge (meters 7.5) - ) +(defskelgroup *citb-disc-a-sg* citb-disc citb-disc-a-lod0-jg citb-disc-a-idle-ja + ((citb-disc-a-lod0-mg (meters 20)) (citb-disc-a-lod1-mg (meters 40)) (citb-disc-a-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + :longest-edge (meters 7.5) + ) -(defskelgroup *citb-disc-b-sg* citb-disc - 5 - 9 - ((6 (meters 20)) (7 (meters 40)) (8 (meters 999999))) - :bounds (static-spherem 0 0 0 12) - :longest-edge (meters 7.5) - ) +(defskelgroup *citb-disc-b-sg* citb-disc citb-disc-b-lod0-jg citb-disc-b-idle-ja + ((citb-disc-b-lod0-mg (meters 20)) (citb-disc-b-lod1-mg (meters 40)) (citb-disc-b-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + :longest-edge (meters 7.5) + ) -(defskelgroup *citb-disc-c-sg* citb-disc - 10 - 14 - ((11 (meters 20)) (12 (meters 40)) (13 (meters 999999))) - :bounds (static-spherem 0 0 0 12) - :longest-edge (meters 11) - ) +(defskelgroup *citb-disc-c-sg* citb-disc citb-disc-c-lod0-jg citb-disc-c-idle-ja + ((citb-disc-c-lod0-mg (meters 20)) (citb-disc-c-lod1-mg (meters 40)) (citb-disc-c-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + :longest-edge (meters 11) + ) -(defskelgroup *citb-disc-d-sg* citb-disc - 15 - 19 - ((16 (meters 20)) (17 (meters 40)) (18 (meters 999999))) - :bounds (static-spherem 0 0 0 12) - :longest-edge (meters 8) - ) +(defskelgroup *citb-disc-d-sg* citb-disc citb-disc-d-lod0-jg citb-disc-d-idle-ja + ((citb-disc-d-lod0-mg (meters 20)) (citb-disc-d-lod1-mg (meters 40)) (citb-disc-d-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + :longest-edge (meters 8) + ) (deftype citb-disc (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -376,21 +364,18 @@ (defstate citb-disc-idle (citb-disc) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'touch) - (send-event arg0 'no-look-around 75) + (send-event arg0 'no-look-around (seconds 0.25)) #f ) ) ) ) - :trans - (the-as (function none :behavior citb-disc) rider-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior citb-disc) rider-trans) + :code (behavior () + (loop (update! (-> self sound)) (quaternion-axis-angle! (-> self root-override quat) @@ -403,8 +388,7 @@ ) (none) ) - :post - (the-as (function none :behavior citb-disc) rider-post) + :post (the-as (function none :behavior citb-disc) rider-post) ) (defmethod init! citb-disc ((obj citb-disc)) @@ -454,19 +438,8 @@ ) ) (dummy-21 obj) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "rotate-plat") - :volume #x400 - :fo-max 20 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> obj root-override trans)) ) (logior! (-> obj skel status) (janim-status inited)) (go citb-disc-idle) @@ -542,13 +515,10 @@ ) -(defskelgroup *citb-iris-door-sg* citb-iris-door - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *citb-iris-door-sg* citb-iris-door citb-iris-door-lod0-jg citb-iris-door-idle-ja + ((citb-iris-door-lod0-mg (meters 20)) (citb-iris-door-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) (defmethod TODO-RENAME-24 citb-iris-door ((obj citb-iris-door)) (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) @@ -580,13 +550,10 @@ (none) ) -(defskelgroup *citb-button-sg* citb-button - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *citb-button-sg* citb-button citb-button-lod0-jg citb-button-idle-ja + ((citb-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) (deftype citb-button (basebutton) () @@ -667,8 +634,7 @@ (defstate plat-path-active (citb-launcher) :virtual #t - :post - (behavior () + :post (behavior () (let ((t9-0 (-> (method-of-type plat plat-path-active) post))) (if t9-0 ((the-as (function none :behavior citb-launcher) t9-0)) @@ -679,13 +645,10 @@ ) ) -(defskelgroup *citb-launcher-sg* citb-launcher - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *citb-launcher-sg* citb-launcher citb-launcher-lod0-jg citb-launcher-idle-ja + ((citb-launcher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defmethod get-unlit-skel citb-launcher ((obj citb-launcher)) *citb-launcher-sg* @@ -694,20 +657,8 @@ (defmethod dummy-26 citb-launcher ((obj citb-launcher)) (let ((f30-0 (res-lump-float (-> obj entity) 'spring-height :default 163840.0)) (s5-0 (res-lump-value (-> obj entity) 'mode uint128)) - (s4-0 (get-process *default-dead-pool* launcher #x4000)) ) - (set! (-> obj launcher) - (the-as - (pointer launcher) - (when s4-0 - (let ((t9-3 (method-of-type launcher activate))) - (t9-3 (the-as launcher s4-0) obj 'launcher (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 launcher-init-by-other (-> obj root-override trans) f30-0 s5-0 81920.0) - (-> s4-0 ppointer) - ) - ) - ) + (set! (-> obj launcher) (process-spawn launcher (-> obj root-override trans) f30-0 s5-0 81920.0 :to obj)) ) (set! (-> obj root-override root-prim local-sphere w) 18432.0) (logclear! (-> obj mask) (process-mask actor-pause)) @@ -715,77 +666,58 @@ (none) ) -(defskelgroup *citb-robotboss-sg* citb-robotboss - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 17 0 18) - :longest-edge (meters 6) - ) +(defskelgroup *citb-robotboss-sg* citb-robotboss citb-robotboss-lod0-jg citb-robotboss-idle-ja + ((citb-robotboss-lod0-mg (meters 999999))) + :bounds (static-spherem 0 17 0 18) + :longest-edge (meters 6) + ) -(defskelgroup *citb-robotboss-head-sg* citb-robotboss - 6 - 8 - ((7 (meters 999999))) - :bounds (static-spherem 0 30 10 12) - :longest-edge (meters 2) - ) +(defskelgroup *citb-robotboss-head-sg* citb-robotboss citb-robotboss-head-lod0-jg citb-robotboss-head-idle-ja + ((citb-robotboss-head-lod0-mg (meters 999999))) + :bounds (static-spherem 0 30 10 12) + :longest-edge (meters 2) + ) -(defskelgroup *citb-robotboss-nose-sg* citb-robotboss - 3 - 5 - ((4 (meters 999999))) - :bounds (static-spherem 0 10 20 15) - :longest-edge (meters 0) - ) +(defskelgroup *citb-robotboss-nose-sg* citb-robotboss citb-robotboss-nose-lod0-jg citb-robotboss-nose-idle-ja + ((citb-robotboss-nose-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 20 15) + ) -(defskelgroup *citb-robotboss-gun-sg* citb-robotboss - 9 - 11 - ((10 (meters 999999))) - :bounds (static-spherem 0 28 -10 14) - :longest-edge (meters 5) - ) +(defskelgroup *citb-robotboss-gun-sg* citb-robotboss citb-robotboss-gun-lod0-jg citb-robotboss-gun-idle-ja + ((citb-robotboss-gun-lod0-mg (meters 999999))) + :bounds (static-spherem 0 28 -10 14) + :longest-edge (meters 5) + ) -(defskelgroup *citb-robotboss-leftshoulder-sg* citb-robotboss - 12 - 14 - ((13 (meters 999999))) - :bounds (static-spherem 17 27 0 14) - :longest-edge (meters 6) - ) +(defskelgroup *citb-robotboss-leftshoulder-sg* citb-robotboss citb-robotboss-leftshoulder-lod0-jg citb-robotboss-leftshoulder-idle-ja + ((citb-robotboss-leftshoulder-lod0-mg (meters 999999))) + :bounds (static-spherem 17 27 0 14) + :longest-edge (meters 6) + ) -(defskelgroup *citb-robotboss-rightshoulder-sg* citb-robotboss - 15 - 17 - ((16 (meters 999999))) - :bounds (static-spherem -17 27 0 14) - :longest-edge (meters 6) - ) +(defskelgroup *citb-robotboss-rightshoulder-sg* citb-robotboss citb-robotboss-rightshoulder-lod0-jg citb-robotboss-rightshoulder-idle-ja + ((citb-robotboss-rightshoulder-lod0-mg (meters 999999))) + :bounds (static-spherem -17 27 0 14) + :longest-edge (meters 6) + ) -(defskelgroup *citb-robotboss-leftarm-sg* citb-robotboss - 18 - 20 - ((19 (meters 999999))) - :bounds (static-spherem 15 5 -10 20) - :longest-edge (meters 9) - ) +(defskelgroup *citb-robotboss-leftarm-sg* citb-robotboss citb-robotboss-leftarm-lod0-jg citb-robotboss-leftarm-idle-ja + ((citb-robotboss-leftarm-lod0-mg (meters 999999))) + :bounds (static-spherem 15 5 -10 20) + :longest-edge (meters 9) + ) -(defskelgroup *citb-robotboss-rightarm-sg* citb-robotboss - 21 - 23 - ((22 (meters 999999))) - :bounds (static-spherem -15 0 -8 16) - :longest-edge (meters 3) - ) +(defskelgroup *citb-robotboss-rightarm-sg* citb-robotboss citb-robotboss-rightarm-lod0-jg citb-robotboss-rightarm-idle-ja + ((citb-robotboss-rightarm-lod0-mg (meters 999999))) + :bounds (static-spherem -15 0 -8 16) + :longest-edge (meters 3) + ) -(defskelgroup *citb-robotboss-belly-sg* citb-robotboss - 24 - 26 - ((25 (meters 999999))) - :bounds (static-spherem 0 -2 3 10) - :longest-edge (meters 3) - ) +(defskelgroup *citb-robotboss-belly-sg* citb-robotboss citb-robotboss-belly-lod0-jg citb-robotboss-belly-idle-ja + ((citb-robotboss-belly-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -2 3 10) + :longest-edge (meters 3) + ) (deftype citb-robotboss (process-drawable) ((root-override collide-shape :offset 112) @@ -803,229 +735,103 @@ (defstate citb-robotboss-idle (citb-robotboss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (sv-96 int) (sv-112 int)) - (the-as object (cond - ((= arg2 'shield-off) - (stop! (-> self sound)) - (if (-> self shield-on) - (sound-play-by-name (static-sound-name "robotcage-off") (new-sound-id) 1024 0 0 1 #t) - ) - (set! (-> self shield-on) #f) - #f - ) - ((= arg2 'shield-on) - (let ((v0-3 #t)) - (set! (-> self shield-on) v0-3) - v0-3 - ) - ) - ((= arg2 'die) - (cleanup-for-death self) - (the-as symbol (deactivate self)) - ) - ((or (= arg2 'touch) (= arg2 'attack)) - (let ((s4-0 sound-play-by-name) - (s3-0 (make-u128 #x7061 (the-as uint #x7a2d646c65696873))) - (s2-0 (new-sound-id)) - (s1-0 1024) - (s0-0 0) - ) - (set! sv-96 0) - (set! sv-112 1) - (let ((t2-1 (target-pos 0))) - (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-96 sv-112 (the-as symbol t2-1)) - ) - ) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'shove) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((v1-21 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-21 shove-up) 8192.0) - (set! (-> v1-21 shove-back) 12288.0) - (set! (-> a1-3 param 1) (the-as uint v1-21)) - ) - (the-as symbol (send-event-function arg0 a1-3)) - ) - ) - ) - ) - ) - :code - (behavior () - (let* ((s5-0 (get-process *default-dead-pool* manipy #x4000)) - (gp-0 (when s5-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-nose-sg* - #f - ) - (-> s5-0 ppointer) - ) - ) + (the-as + object + (cond + ((= arg2 'shield-off) + (stop! (-> self sound)) + (if (-> self shield-on) + (sound-play "robotcage-off") + ) + (set! (-> self shield-on) #f) + #f + ) + ((= arg2 'shield-on) + (let ((v0-3 #t)) + (set! (-> self shield-on) v0-3) + v0-3 ) + ) + ((= arg2 'die) + (cleanup-for-death self) + (the-as symbol (deactivate self)) + ) + ((or (= arg2 'touch) (= arg2 'attack)) + (let ((s4-0 sound-play-by-name) + (s3-0 (make-u128 #x7061 (the-as uint #x7a2d646c65696873))) + (s2-0 (new-sound-id)) + (s1-0 1024) + (s0-0 0) + ) + (set! sv-96 0) + (set! sv-112 1) + (let ((t2-1 (target-pos 0))) + (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-96 (the-as sound-group sv-112) (the-as symbol t2-1)) + ) + ) + (the-as symbol (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) + ) + ) + ) + ) + ) + ) + :code (behavior () + (let ((gp-0 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-nose-sg* #f :to self))) (send-event (ppointer->process gp-0) 'anim-mode 'loop) (send-event (ppointer->process gp-0) 'art-joint-anim "citb-robotboss-nose-idle" 0) (send-event (ppointer->process gp-0) 'draw #t) ) - (let* ((s5-1 (get-process *default-dead-pool* manipy #x4000)) - (gp-1 (when s5-1 - (let ((t9-7 (method-of-type manipy activate))) - (t9-7 (the-as manipy s5-1) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-head-sg* - #f - ) - (-> s5-1 ppointer) - ) - ) - ) + (let ((gp-1 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-head-sg* #f :to self))) (send-event (ppointer->process gp-1) 'anim-mode 'loop) (send-event (ppointer->process gp-1) 'art-joint-anim "citb-robotboss-head-idle" 0) (send-event (ppointer->process gp-1) 'draw #t) ) - (let* ((s5-2 (get-process *default-dead-pool* manipy #x4000)) - (gp-2 (when s5-2 - (let ((t9-13 (method-of-type manipy activate))) - (t9-13 (the-as manipy s5-2) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-2 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-gun-sg* - #f - ) - (-> s5-2 ppointer) - ) - ) - ) + (let ((gp-2 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-gun-sg* #f :to self))) (send-event (ppointer->process gp-2) 'anim-mode 'loop) (send-event (ppointer->process gp-2) 'art-joint-anim "citb-robotboss-gun-idle" 0) (send-event (ppointer->process gp-2) 'draw #t) ) - (let* ((s5-3 (get-process *default-dead-pool* manipy #x4000)) - (gp-3 (when s5-3 - (let ((t9-19 (method-of-type manipy activate))) - (t9-19 (the-as manipy s5-3) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-3 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-leftshoulder-sg* - #f - ) - (-> s5-3 ppointer) - ) - ) - ) + (let ((gp-3 + (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-leftshoulder-sg* #f :to self) + ) + ) (send-event (ppointer->process gp-3) 'anim-mode 'loop) (send-event (ppointer->process gp-3) 'art-joint-anim "citb-robotboss-leftshoulder-idle" 0) (send-event (ppointer->process gp-3) 'draw #t) ) - (let* ((s5-4 (get-process *default-dead-pool* manipy #x4000)) - (gp-4 (when s5-4 - (let ((t9-25 (method-of-type manipy activate))) - (t9-25 (the-as manipy s5-4) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-4 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-rightshoulder-sg* - #f - ) - (-> s5-4 ppointer) - ) - ) - ) + (let ((gp-4 + (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-rightshoulder-sg* #f :to self) + ) + ) (send-event (ppointer->process gp-4) 'anim-mode 'loop) (send-event (ppointer->process gp-4) 'art-joint-anim "citb-robotboss-rightshoulder-idle" 0) (send-event (ppointer->process gp-4) 'draw #t) ) - (let* ((s5-5 (get-process *default-dead-pool* manipy #x4000)) - (gp-5 (when s5-5 - (let ((t9-31 (method-of-type manipy activate))) - (t9-31 (the-as manipy s5-5) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-5 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-leftarm-sg* - #f - ) - (-> s5-5 ppointer) - ) - ) - ) + (let ((gp-5 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-leftarm-sg* #f :to self))) (send-event (ppointer->process gp-5) 'anim-mode 'loop) (send-event (ppointer->process gp-5) 'art-joint-anim "citb-robotboss-leftarm-idle" 0) (send-event (ppointer->process gp-5) 'draw #t) ) - (let* ((s5-6 (get-process *default-dead-pool* manipy #x4000)) - (gp-6 (when s5-6 - (let ((t9-37 (method-of-type manipy activate))) - (t9-37 (the-as manipy s5-6) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-6 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-rightarm-sg* - #f - ) - (-> s5-6 ppointer) - ) - ) - ) + (let ((gp-6 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-rightarm-sg* #f :to self)) + ) (send-event (ppointer->process gp-6) 'anim-mode 'loop) (send-event (ppointer->process gp-6) 'art-joint-anim "citb-robotboss-rightarm-idle" 0) (send-event (ppointer->process gp-6) 'draw #t) ) - (let* ((s5-7 (get-process *default-dead-pool* manipy #x4000)) - (gp-7 (when s5-7 - (let ((t9-43 (method-of-type manipy activate))) - (t9-43 (the-as manipy s5-7) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-7 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-belly-sg* - #f - ) - (-> s5-7 ppointer) - ) - ) - ) + (let ((gp-7 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-belly-sg* #f :to self))) (send-event (ppointer->process gp-7) 'anim-mode 'loop) (send-event (ppointer->process gp-7) 'art-joint-anim "citb-robotboss-belly-idle" 0) (send-event (ppointer->process gp-7) 'draw #t) ) (update-transforms! (-> self root-override)) - (while #t + (loop (when (-> self shield-on) (update! (-> self sound)) (spawn (-> self part) (-> self root-override trans)) @@ -1035,13 +841,11 @@ ) (none) ) - :post - (the-as (function none :behavior citb-robotboss) ja-post) + :post (the-as (function none :behavior citb-robotboss) ja-post) ) (defstate citb-robotboss-die (citb-robotboss) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (deactivate self) (none) @@ -1068,19 +872,8 @@ (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 601) obj)) (logclear! (-> obj mask) (process-mask actor-pause)) (set! (-> obj shield-on) #t) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "robotcage-lp") - :volume #x400 - :fo-max #x96 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "robotcage-lp" :fo-max 150) (-> obj root-override trans)) ) (if (= (get-task-status (-> obj entity extra perm task)) (task-status invalid)) (go citb-robotboss-die) @@ -1089,13 +882,10 @@ (none) ) -(defskelgroup *citb-coil-sg* citb-coil - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *citb-coil-sg* citb-coil citb-coil-lod0-jg citb-coil-idle-ja + ((citb-coil-lod0-mg (meters 20)) (citb-coil-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (deftype citb-coil (process-drawable) ((part-off sparticle-launch-control :offset-assert 176) @@ -1128,56 +918,24 @@ ) (defstate citb-coil-idle (citb-coil) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go citb-coil-break) ) ) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (behavior () + :post (behavior () (spawn (-> self part) (-> self root trans)) (ja-post) (none) @@ -1185,62 +943,34 @@ ) (defstate citb-coil-break (citb-coil) - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (ja-channel-push! 1 30) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go citb-coil-broken) (none) ) - :post - (the-as (function none :behavior citb-coil) ja-post) + :post (the-as (function none :behavior citb-coil) ja-post) ) (defstate citb-coil-broken (citb-coil) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (spawn (-> self part-off) (-> self root trans)) (suspend) ) (none) ) - :post - (the-as (function none :behavior citb-coil) ja-post) + :post (the-as (function none :behavior citb-coil) ja-post) ) (defmethod init-from-entity! citb-coil ((obj citb-coil) (arg0 entity-actor)) @@ -1249,8 +979,8 @@ (initialize-skeleton obj *citb-coil-sg* '()) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 596) obj)) (set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 602) obj)) - (let ((v1-9 (the-as entity (entity-actor-lookup (-> obj entity) 'state-actor 0)))) - (if (not (the-as entity-actor v1-9)) + (let ((v1-9 (entity-actor-lookup (-> obj entity) 'state-actor 0))) + (if (not v1-9) (set! v1-9 (-> obj entity)) ) (if (logtest? (-> v1-9 extra perm status) (entity-perm-status complete)) @@ -1261,13 +991,10 @@ (none) ) -(defskelgroup *citb-hose-sg* citb-hose - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *citb-hose-sg* citb-hose citb-hose-lod0-jg citb-hose-idle-ja + ((citb-hose-lod0-mg (meters 20)) (citb-hose-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) (deftype citb-hose (process-drawable) () @@ -1295,102 +1022,57 @@ ) (defstate citb-hose-idle (citb-hose) - :event - citb-hose-event-handler - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :event citb-hose-event-handler + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior citb-hose) ja-post) + :post (the-as (function none :behavior citb-hose) ja-post) ) (defstate citb-hose-spawn (citb-hose) - :event - citb-hose-event-handler - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :event citb-hose-event-handler + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go citb-hose-idle) (none) ) - :post - (the-as (function none :behavior citb-hose) ja-post) + :post (the-as (function none :behavior citb-hose) ja-post) ) (defstate citb-hose-die (citb-hose) - :event - citb-hose-event-handler - :code - (behavior () + :event citb-hose-event-handler + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (ja-channel-push! 1 30) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (anim-loop) (none) ) - :post - (the-as (function none :behavior citb-hose) ja-post) + :post (the-as (function none :behavior citb-hose) ja-post) ) (defmethod init-from-entity! citb-hose ((obj citb-hose) (arg0 entity-actor)) (set! (-> obj root) (new 'process 'trsqv)) (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *citb-hose-sg* '()) - (let ((v1-3 (the-as entity (entity-actor-lookup (-> obj entity) 'state-actor 0)))) - (if (not (the-as entity-actor v1-3)) + (let ((v1-3 (entity-actor-lookup (-> obj entity) 'state-actor 0))) + (if (not v1-3) (set! v1-3 (-> obj entity)) ) (if (logtest? (-> v1-3 extra perm status) (entity-perm-status complete)) @@ -1409,21 +1091,15 @@ ) -(defskelgroup *citb-generator-sg* citb-generator - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *citb-generator-sg* citb-generator citb-generator-lod0-jg citb-generator-idle-ja + ((citb-generator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) -(defskelgroup *citb-generator-broken-sg* citb-generator - 2 - 4 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *citb-generator-broken-sg* citb-generator citb-generator-broken-lod0-jg citb-generator-idle-ja + ((citb-generator-broken-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) (deftype citb-generator (process-drawable) ((root-override collide-shape :offset 112) @@ -1549,8 +1225,7 @@ ) (defstate citb-generator-idle (citb-generator) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (if (-> self mushroom) @@ -1564,16 +1239,14 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (none) ) - :code - (behavior () + :code (behavior () (lods-assign! (-> self draw) (-> self normal-look)) (update-transforms! (-> self root-override)) - (while #t + (loop (spawn (-> self part) (-> self root-override trans)) (update! (-> self sound)) (if (-> self mushroom) @@ -1604,13 +1277,11 @@ ) (none) ) - :post - (the-as (function none :behavior citb-generator) ja-post) + :post (the-as (function none :behavior citb-generator) ja-post) ) (defstate citb-generator-break (citb-generator) - :code - (behavior () + :code (behavior () (let ((gp-0 (entity-actor-count (-> self entity) 'open-actor))) (dotimes (s5-0 gp-0) (let ((s4-0 (entity-actor-lookup (-> self entity) 'open-actor s5-0)) @@ -1643,35 +1314,30 @@ ) ) (process-entity-status! self (entity-perm-status complete) #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 598) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 598) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) - (sound-play-by-name (static-sound-name "sagecage-open") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sagecage-open") + ;; NTSC-J patch here + ; (if (name= (-> self name) "citb-generator-1") + ; (set-continue! *game-info* "citadel-elevator") + ; ) (go citb-generator-broken) (none) ) - :post - (the-as (function none :behavior citb-generator) ja-post) + :post (the-as (function none :behavior citb-generator) ja-post) ) (defstate citb-generator-broken (citb-generator) - :code - (behavior () + :code (behavior () (lods-assign! (-> self draw) (-> self broken-look)) (update-transforms! (-> self root-override)) (cond @@ -1691,8 +1357,7 @@ (anim-loop) (none) ) - :post - (behavior () + :post (behavior () (spawn (-> self part-broken) (-> self root-override trans)) (ja-post) (none) @@ -1755,19 +1420,8 @@ (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 600) obj)) (set! (-> obj part-broken) (create-launch-control (-> *part-group-id-table* 597) obj)) (set! (-> obj part-mushroom) (create-launch-control (-> *part-group-id-table* 599) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "mushroom-gen") - :volume #x400 - :fo-max 20 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "mushroom-gen" :fo-max 20) (-> obj root-override trans)) ) 0 (none) @@ -1777,8 +1431,8 @@ (init! obj) (process-drawable-from-entity! obj arg0) (dummy-21 obj) - (let ((v1-4 (the-as entity (entity-actor-lookup (-> obj entity) 'state-actor 0)))) - (if (not (the-as entity-actor v1-4)) + (let ((v1-4 (entity-actor-lookup (-> obj entity) 'state-actor 0))) + (if (not v1-4) (set! v1-4 (-> obj entity)) ) (if (logtest? (-> v1-4 extra perm status) (entity-perm-status complete)) @@ -1789,13 +1443,10 @@ (none) ) -(defskelgroup *citadelcam-sg* citadelcam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 20) - :longest-edge (meters 0) - ) +(defskelgroup *citadelcam-sg* citadelcam citadelcam-lod0-jg citadelcam-idle-ja + ((citadelcam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) (deftype citadelcam (process-drawable) () @@ -1811,8 +1462,7 @@ (defstate citadelcam-idle (citadelcam) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (when (and (task-complete? *game-info* (game-task citadel-sage-blue)) @@ -1825,8 +1475,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask actor-pause)) (anim-loop) (none) @@ -1834,8 +1483,7 @@ ) (defstate citadelcam-stair-plats (citadelcam) - :code - (behavior () + :code (behavior () (let ((gp-0 (entity-actor-count (-> self entity) 'trigger-actor))) (dotimes (s5-0 gp-0) (let ((s4-0 (entity-actor-lookup (-> self entity) 'trigger-actor s5-0)) @@ -1867,28 +1515,12 @@ ) ) ) - (let* ((gp-1 (get-process *default-dead-pool* pov-camera #x4000)) - (gp-2 - (ppointer->handle - (when gp-1 - (let ((t9-6 (method-of-type pov-camera activate))) - (t9-6 (the-as pov-camera gp-1) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (-> self root trans) - *citadelcam-sg* - "citadelcam-stair-plats" - 0 - #f - '() - ) - (-> gp-1 ppointer) - ) - ) - ) - ) + (let ((gp-2 + (ppointer->handle + (process-spawn pov-camera (-> self root trans) *citadelcam-sg* "citadelcam-stair-plats" 0 #f '() :to self) + ) + ) + ) (while (handle->process (the-as handle gp-2)) (suspend) ) @@ -1924,8 +1556,7 @@ (defstate battlecontroller-play-intro-camera (citb-battlecontroller) :virtual #t - :code - (behavior () + :code (behavior () (level-hint-spawn (game-text-id citadel-lurker-bunny-alert) "sksp0383" @@ -1934,29 +1565,22 @@ (game-task none) ) (suspend) - (let* ((gp-0 (get-process *default-dead-pool* pov-camera #x4000)) - (gp-1 (ppointer->handle (when gp-0 - (let ((t9-2 (method-of-type pov-camera activate))) - (t9-2 (the-as pov-camera gp-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> (entity-by-name "citadelcam-1") extra trans) - *citadelcam-sg* - "citadel-bunnies" - 0 - #f - '() - ) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 (ppointer->handle (process-spawn + pov-camera + (-> (entity-by-name "citadelcam-1") extra trans) + *citadelcam-sg* + "citadel-bunnies" + 0 + #f + '() + :to self + ) + ) + ) + ) (send-event (handle->process (the-as handle gp-1)) 'mask 2048) (while (handle->process (the-as handle gp-1)) - (set! (-> *target* state-flags) (logand -17 (-> *target* state-flags))) + (logclear! (-> *target* state-flags) (state-flags invulnerable)) (suspend) ) ) @@ -1967,8 +1591,7 @@ (defstate battlecontroller-die (citb-battlecontroller) :virtual #t - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) (let ((t9-2 (-> (the-as (state battlecontroller) (find-parent-method citb-battlecontroller 26)) code))) (if t9-2 diff --git a/goal_src/levels/citadel/citadel-part.gc b/goal_src/levels/citadel/citadel-part.gc index 8159e7e84d..671cadf8f5 100644 --- a/goal_src/levels/citadel/citadel-part.gc +++ b/goal_src/levels/citadel/citadel-part.gc @@ -20,13 +20,11 @@ :id 685 :flags (use-local-clock) :bounds (static-bspherem 0 -8 0 8) - :parts - ((sp-item 2879) (sp-item 2880)) + :parts ((sp-item 2879) (sp-item 2880)) ) (defpart 2880 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 8.0 1.0) (sp-rnd-flt spt-x (meters 0) (meters 2.5) 1.0) (sp-flt spt-y (meters -13)) @@ -57,8 +55,7 @@ ) (defpart 2881 - :init-specs - ((sp-flt spt-userdata 409600.0)) + :init-specs ((sp-flt spt-userdata 409600.0)) ) (defun check-drop-level-firehose-pops ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) @@ -66,30 +63,15 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2882) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2883) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) + (launch-particles :rate 1.0 (-> *part-id-table* 2882) gp-0) + (launch-particles :rate 1.0 (-> *part-id-table* 2883) gp-0) ) ) (none) ) (defpart 2883 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -105,8 +87,7 @@ ) (defpart 2882 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 4.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -128,8 +109,7 @@ ) (defpart 2879 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters 0) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -2) (meters -1) 1.0) @@ -147,8 +127,7 @@ ) (defpart 2541 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-func spt-birth-func 'birth-func-set-quat) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -11)) @@ -168,8 +147,7 @@ :id 599 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12.5) - :parts - ((sp-item 2408 :fade-after (meters 200) :falloff-to (meters 200)) + :parts ((sp-item 2408 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 2409 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 2410 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 2411 :fade-after (meters 200) :falloff-to (meters 200) :binding 2407) @@ -199,8 +177,7 @@ :id 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12.5) - :parts - ((sp-item 2413 :fade-after (meters 300) :falloff-to (meters 300)) + :parts ((sp-item 2413 :fade-after (meters 300) :falloff-to (meters 300)) (sp-item 2414 :fade-after (meters 200) :falloff-to (meters 200) :binding 2412) (sp-item 2412 :flags (bit1 start-dead launch-asap)) (sp-item 2412 :flags (bit1 start-dead launch-asap)) @@ -232,8 +209,7 @@ ) (defpart 2411 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-y (meters 4.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 10.4) (meters 6) 1.0) @@ -249,8 +225,7 @@ ) (defpart 2407 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-flt spt-y (meters 0)) @@ -275,8 +250,7 @@ ) (defpart 2408 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-flt spt-y (meters 5)) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 6.5) 1.0) @@ -297,8 +271,7 @@ ) (defpart 2409 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-flt spt-y (meters 5)) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 5.5) 1.0) @@ -319,8 +292,7 @@ ) (defpart 2410 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-flt spt-y (meters 5)) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 4.5) 1.0) @@ -341,8 +313,7 @@ ) (defpart 2413 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.75)) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) @@ -359,8 +330,7 @@ ) (defpart 2414 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-y (meters 0.2) (meters 1.4) 1.0) (sp-flt spt-scale-x (meters 0.4)) @@ -373,8 +343,7 @@ ) (defpart 2412 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-flt spt-y (meters 0)) @@ -399,13 +368,11 @@ ) (defpart 2415 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 2416)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 2416)) ) (defpart 2416 - :init-specs - ((sp-flt spt-fade-a -0.8)) + :init-specs ((sp-flt spt-fade-a -0.8)) ) (defpartgroup group-citb-generator-break @@ -414,8 +381,7 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 2423 :period 600 :length 5) + :parts ((sp-item 2423 :period 600 :length 5) (sp-item 2424 :fade-after (meters 80) :falloff-to (meters 80) :period 600 :length 40) (sp-item 2425 :period 600 :length 20) (sp-item 2426 :fade-after (meters 120) :falloff-to (meters 120) :period 600 :length 20) @@ -423,8 +389,7 @@ ) (defpart 2424 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.4) 1.0) @@ -452,13 +417,11 @@ ) (defpart 2427 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) ) (defpart 2426 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 0.2)) @@ -479,8 +442,7 @@ ) (defpart 2423 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 16)) @@ -499,8 +461,7 @@ ) (defpart 2425 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -531,15 +492,13 @@ :id 597 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 2417 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 2417 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 2418 :fade-after (meters 60) :falloff-to (meters 60)) ) ) (defpart 2417 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters -0.5) (meters 1.1) 1.0) (sp-flt spt-y (meters 0.75)) @@ -567,8 +526,7 @@ ) (defpart 2418 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters 0.2)) (sp-flt spt-y (meters 1.75)) (sp-int spt-rot-x 8) @@ -587,8 +545,7 @@ ) (defpart 2419 - :init-specs - ((sp-flt spt-fade-b -1.3653333)) + :init-specs ((sp-flt spt-fade-b -1.3653333)) ) (defun birth-func-random-rot ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) @@ -653,13 +610,11 @@ :id 601 :flags (use-local-clock) :bounds (static-bspherem 0 23 0 34) - :parts - ((sp-item 2420 :fade-after (meters 220) :falloff-to (meters 250) :flags (is-3d))) + :parts ((sp-item 2420 :fade-after (meters 220) :falloff-to (meters 250) :flags (is-3d))) ) (defpart 2420 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xc :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc :page #x2)) (sp-func spt-birth-func 'birth-func-random-rot) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 23)) @@ -680,8 +635,7 @@ ) (defpart 2421 - :init-specs - ((sp-rnd-flt spt-g 32.0 32.0 1.0) + :init-specs ((sp-rnd-flt spt-g 32.0 32.0 1.0) (sp-flt spt-a 96.0) (sp-flt spt-fade-a 0.0) (sp-int spt-next-time 5) @@ -690,16 +644,14 @@ ) (defpart 2422 - :init-specs - ((sp-rnd-flt spt-g 0.0 32.0 1.0) (sp-flt spt-a 64.0) (sp-flt spt-fade-a -0.85333335)) + :init-specs ((sp-rnd-flt spt-g 0.0 32.0 1.0) (sp-flt spt-a 64.0) (sp-flt spt-fade-a -0.85333335)) ) (defpartgroup group-citb-coil-glow :id 596 :flags (use-local-clock) :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 2429 :fade-after (meters 100) :falloff-to (meters 100) :flags (is-3d)) + :parts ((sp-item 2429 :fade-after (meters 100) :falloff-to (meters 100) :flags (is-3d)) (sp-item 2430 :fade-after (meters 100) :falloff-to (meters 100) :flags (is-3d)) (sp-item 2431 :fade-after (meters 100) :falloff-to (meters 100) :flags (is-3d)) (sp-item 2432 :fade-after (meters 100) :falloff-to (meters 100) :flags (is-3d)) @@ -739,8 +691,7 @@ ) (defpart 2434 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.1)) (sp-flt spt-y (meters 1.0025)) @@ -760,8 +711,7 @@ ) (defpart 2433 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.1)) (sp-flt spt-y (meters 3.9)) @@ -781,8 +731,7 @@ ) (defpart 2432 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 3.2897)) @@ -802,8 +751,7 @@ ) (defpart 2431 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 0.8025)) @@ -823,8 +771,7 @@ ) (defpart 2430 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.2)) (sp-flt spt-y (meters 0.8025)) @@ -843,8 +790,7 @@ ) (defpart 2429 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.2)) (sp-flt spt-y (meters 3.7)) @@ -863,8 +809,7 @@ ) (defpart 2438 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-y (meters 0.5) (meters 4) 1.0) (sp-flt spt-scale-x (meters 0.4)) @@ -877,8 +822,7 @@ ) (defpart 2428 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-flt spt-y (meters 0)) @@ -903,18 +847,15 @@ ) (defpart 2439 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 2440)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 2440)) ) (defpart 2440 - :init-specs - ((sp-flt spt-fade-a -0.8)) + :init-specs ((sp-flt spt-fade-a -0.8)) ) (defpart 2437 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.2 0.5 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 4) 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 2.5) 1.0) @@ -933,8 +874,7 @@ ) (defpart 2435 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 4) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 0.5) 1.0) @@ -954,8 +894,7 @@ ) (defpart 2436 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 4) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 0.5) 1.0) @@ -978,15 +917,13 @@ :id 602 :flags (use-local-clock) :bounds (static-bspherem 0 6 0 8) - :parts - ((sp-item 2441 :fade-after (meters 120) :falloff-to (meters 120)) + :parts ((sp-item 2441 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 2442 :fade-after (meters 120) :falloff-to (meters 120)) ) ) (defpart 2442 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.06125) (sp-rnd-flt spt-x (meters 1.5) (meters 0.5) 1.0) (sp-flt spt-y (meters 4.5)) @@ -1018,8 +955,7 @@ ) (defpart 2443 - :init-specs - ((sp-flt spt-fade-r 0.0) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.035555556) @@ -1028,8 +964,7 @@ ) (defpart 2441 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 1.5) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 3) 1.0) @@ -1060,8 +995,7 @@ :id 603 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 34) - :parts - ((sp-item 2447 :fade-after (meters 140) :falloff-to (meters 140) :binding 2444) + :parts ((sp-item 2447 :fade-after (meters 140) :falloff-to (meters 140) :binding 2444) (sp-item 2444 :flags (bit1 start-dead launch-asap) :binding 2445) (sp-item 2444 :flags (bit1 start-dead launch-asap) :binding 2446) (sp-item 2444 :flags (bit1 start-dead launch-asap) :binding 2445) @@ -1093,13 +1027,11 @@ :id 607 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 2451 :flags (is-3d))) + :parts ((sp-item 2451 :flags (is-3d))) ) (defpart 2451 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) @@ -1117,8 +1049,7 @@ ) (defpart 2447 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.025) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1138,8 +1069,7 @@ ) (defpart 2444 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1161,8 +1091,7 @@ ) (defpart 2445 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1181,8 +1110,7 @@ ) (defpart 2446 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1201,8 +1129,7 @@ ) (defpart 2448 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-y (meters 0.6) (meters 0.8) 1.0) @@ -1222,8 +1149,7 @@ ) (defpart 2450 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1243,8 +1169,7 @@ ) (defpart 2449 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1263,8 +1188,7 @@ :id 604 :flags (use-local-clock) :bounds (static-bspherem 0 23 0 34) - :parts - ((sp-item 2454 :fade-after (meters 140) :falloff-to (meters 140) :binding 2452) + :parts ((sp-item 2454 :fade-after (meters 140) :falloff-to (meters 140) :binding 2452) (sp-item 2452 :flags (bit1 start-dead launch-asap) :binding 2453) (sp-item 2452 :flags (bit1 start-dead launch-asap) :binding 2453) (sp-item 2452 :flags (bit1 start-dead launch-asap) :binding 2453) @@ -1296,13 +1220,11 @@ :id 608 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 2458 :flags (is-3d))) + :parts ((sp-item 2458 :flags (is-3d))) ) (defpart 2458 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) @@ -1320,8 +1242,7 @@ ) (defpart 2454 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1340,8 +1261,7 @@ ) (defpart 2452 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1363,8 +1283,7 @@ ) (defpart 2453 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1388,8 +1307,7 @@ ) (defpart 2455 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-scale-y (meters 1.5) (meters 0.75) 1.0) @@ -1409,8 +1327,7 @@ ) (defpart 2457 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1429,8 +1346,7 @@ ) (defpart 2456 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1449,8 +1365,7 @@ :id 605 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 34) - :parts - ((sp-item 2461 :fade-after (meters 140) :falloff-to (meters 140) :binding 2459) + :parts ((sp-item 2461 :fade-after (meters 140) :falloff-to (meters 140) :binding 2459) (sp-item 2459 :flags (bit1 start-dead launch-asap) :binding 2460) (sp-item 2459 :flags (bit1 start-dead launch-asap) :binding 2460) (sp-item 2459 :flags (bit1 start-dead launch-asap) :binding 2460) @@ -1486,13 +1401,11 @@ :id 609 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 2465 :flags (is-3d))) + :parts ((sp-item 2465 :flags (is-3d))) ) (defpart 2465 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) @@ -1510,8 +1423,7 @@ ) (defpart 2461 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.025) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1531,8 +1443,7 @@ ) (defpart 2459 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1554,8 +1465,7 @@ ) (defpart 2460 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1574,8 +1484,7 @@ ) (defpart 2462 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-y (meters 0.6) (meters 0.8) 1.0) @@ -1595,8 +1504,7 @@ ) (defpart 2464 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1616,8 +1524,7 @@ ) (defpart 2463 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1636,8 +1543,7 @@ :id 606 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 34) - :parts - ((sp-item 2468 :binding 2466) + :parts ((sp-item 2468 :binding 2466) (sp-item 2466 :flags (bit1 start-dead launch-asap) :binding 2467) (sp-item 2466 :flags (bit1 start-dead launch-asap) :binding 2467) (sp-item 2466 :flags (bit1 start-dead launch-asap) :binding 2467) @@ -1673,13 +1579,11 @@ :id 610 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 2472 :flags (is-3d))) + :parts ((sp-item 2472 :flags (is-3d))) ) (defpart 2472 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) @@ -1697,8 +1601,7 @@ ) (defpart 2468 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.025) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1718,8 +1621,7 @@ ) (defpart 2466 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1741,8 +1643,7 @@ ) (defpart 2467 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1760,8 +1661,7 @@ ) (defpart 2469 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-y (meters 0.6) (meters 0.8) 1.0) @@ -1781,8 +1681,7 @@ ) (defpart 2471 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1802,8 +1701,7 @@ ) (defpart 2470 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1819,8 +1717,7 @@ ) (defpart 2473 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xc :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc :page #x2)) (sp-func spt-birth-func 'birth-func-set-quat) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.25) 1.0) @@ -1837,8 +1734,7 @@ (defpartgroup group-citadel-warpgate :id 662 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2689 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 2689 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 2690 :fade-after (meters 60) :falloff-to (meters 100) :binding 2687) (sp-item 2687 :flags (bit1 start-dead launch-asap)) (sp-item 2687 :flags (bit1 start-dead launch-asap)) @@ -2014,8 +1910,7 @@ ) (defpart 2692 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-x (meters 0)) (sp-flt spt-scale-x (meters 5)) @@ -2032,8 +1927,7 @@ ) (defpart 2691 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters -2)) (sp-flt spt-scale-x (meters 0.25)) @@ -2048,8 +1942,7 @@ ) (defpart 2688 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4.3555555)) (sp-flt spt-y (meters 4)) @@ -2072,8 +1965,7 @@ ) (defpart 2689 - :init-specs - ((sp-rnd-flt spt-num 3.0 3.0 1.0) + :init-specs ((sp-rnd-flt spt-num 3.0 3.0 1.0) (sp-flt spt-x (meters -0.5)) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) @@ -2090,8 +1982,7 @@ ) (defpart 2690 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.25)) (sp-copy-from-other spt-scale-y -4) @@ -2105,8 +1996,7 @@ ) (defpart 2687 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4.3555555)) (sp-flt spt-y (meters 4)) @@ -2132,8 +2022,7 @@ (defpartgroup group-part-citadel-torch :id 683 :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 2832 :fade-after (meters 180) :falloff-to (meters 200)) + :parts ((sp-item 2832 :fade-after (meters 180) :falloff-to (meters 200)) (sp-item 2833 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 2834 :fade-after (meters 50) :falloff-to (meters 50) :period 600 :length 90) (sp-item 2835 :fade-after (meters 50) :falloff-to (meters 50) :period 369 :length 69) @@ -2143,8 +2032,7 @@ ) (defpart 2837 - :init-specs - ((sp-flt spt-num 0.3) + :init-specs ((sp-flt spt-num 0.3) (sp-flt spt-x (meters 0.2)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-int spt-rot-x 5) @@ -2162,13 +2050,11 @@ ) (defpart 2838 - :init-specs - ((sp-flt spt-fade-b -6.826667)) + :init-specs ((sp-flt spt-fade-b -6.826667)) ) (defpart 2832 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1069547520 1 1.0) (sp-rnd-flt spt-x (meters -0.35) (meters 0.7) 1.0) (sp-rnd-flt spt-z (meters -0.35) (meters 0.7) 1.0) @@ -2190,13 +2076,11 @@ ) (defpart 2839 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) (defpart 2834 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters 1)) @@ -2219,8 +2103,7 @@ ) (defpart 2835 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.2) (meters 0.6) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2243,8 +2126,7 @@ ) (defpart 2836 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 0.2) 1.0) (sp-flt spt-y (meters 0.6)) @@ -2267,8 +2149,7 @@ ) (defpart 2833 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.3)) diff --git a/goal_src/levels/citadel/citadel-sages.gc b/goal_src/levels/citadel/citadel-sages.gc index 7234f0812c..e8e9215a92 100644 --- a/goal_src/levels/citadel/citadel-sages.gc +++ b/goal_src/levels/citadel/citadel-sages.gc @@ -5,19 +5,25 @@ ;; name in dgo: citadel-sages ;; dgos: CIT, L1 +;; TODO (define-extern *robotboss-sg* skeleton-group) (declare-type citb-sage process-taskable) ;; DECOMP BEGINS -(defskelgroup *citb-sagecage-sg* citb-sagecage - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 -6 0 7) - :longest-edge (meters 0) - ) +(import "goal_src/import/green-sagecage-ag.gc") +(import "goal_src/import/yellowsage-ag.gc") +(import "goal_src/import/redsage-ag.gc") +(import "goal_src/import/evilbro-citadel-ag.gc") +(import "goal_src/import/evilsis-citadel-ag.gc") +(import "goal_src/import/citb-sagecage-ag.gc") +(import "goal_src/import/bluesage-ag.gc") + +(defskelgroup *citb-sagecage-sg* citb-sagecage citb-sagecage-lod0-jg citb-sagecage-redsage-idle-ja + ((citb-sagecage-lod0-mg (meters 20)) (citb-sagecage-lod1-mg (meters 999999))) + :bounds (static-spherem 0 -6 0 7) + ) (deftype citb-sagecage (process-drawable) ((parent-override (pointer citb-sage) :offset 12) @@ -65,14 +71,7 @@ ) (dotimes (s2-2 12) (vector-matrix*! s5-0 (-> self bar-array s2-2) gp-0) - (sp-launch-particles-var - s3-1 - s4-1 - s5-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system s3-1 s4-1 s5-0) ) ) ) @@ -92,14 +91,13 @@ ) (defstate citb-sagecage-idle (citb-sagecage) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-3 none)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'disable-bars) (stop! (-> self sound)) - (sound-play-by-name (static-sound-name "sagecage-off") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sagecage-off") (set! (-> self bars-on) #f) (citb-sagecage-update-collision) ) @@ -124,11 +122,9 @@ ) ) ) - :trans - (the-as (function none :behavior citb-sagecage) rider-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior citb-sagecage) rider-trans) + :code (behavior () + (loop (cond ((-> self cloning) (let ((gp-0 (ppointer->process (-> self parent-override)))) @@ -146,18 +142,14 @@ ) ) (else - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) ) (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (rider-post) (when (-> self bars-on) (update! (-> self sound)) @@ -216,19 +208,8 @@ (set-vector! (-> obj bar-array 10) 0.0 f0-1 f1-0 1.0) (set-vector! (-> obj bar-array 11) f2-0 f0-1 f1-0 1.0) ) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "sagecage-gen") - :volume #x400 - :fo-max 20 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "sagecage-gen" :fo-max 20) (-> obj root-override trans)) ) (set! (-> obj bars-on) (not (task-complete? *game-info* (-> obj entity extra perm task)))) (citb-sagecage-update-collision) @@ -248,59 +229,41 @@ (none) ) -(defskelgroup *redsage-sg* redsage - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - :shadow 3 - ) +(defskelgroup *redsage-sg* redsage redsage-lod0-jg redsage-redsage-idle-ja + ((redsage-lod0-mg (meters 20)) (redsage-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow redsage-shadow-mg + ) -(defskelgroup *bluesage-sg* bluesage - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 3 - ) +(defskelgroup *bluesage-sg* bluesage bluesage-lod0-jg bluesage-bluesage-idle-ja + ((bluesage-lod0-mg (meters 20)) (bluesage-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow bluesage-shadow-mg + ) -(defskelgroup *yellowsage-sg* yellowsage - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - :shadow 3 - ) +(defskelgroup *yellowsage-sg* yellowsage yellowsage-lod0-jg yellowsage-yellowsage-idle-ja + ((yellowsage-lod0-mg (meters 20)) (yellowsage-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow yellowsage-shadow-mg + ) -(defskelgroup *green-sagecage-sg* green-sagecage - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 3 - ) +(defskelgroup *green-sagecage-sg* green-sagecage green-sagecage-lod0-jg green-sagecage-green-sagecage-idle-ja + ((green-sagecage-lod0-mg (meters 20)) (green-sagecage-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow green-sagecage-shadow-mg + ) -(defskelgroup *evilbro-citadel-sg* evilbro-citadel - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *evilbro-citadel-sg* evilbro-citadel evilbro-citadel-lod0-jg evilbro-citadel-idle-ja + ((evilbro-citadel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :shadow evilbro-citadel-shadow-mg + ) -(defskelgroup *evilsis-citadel-sg* evilsis-citadel - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *evilsis-citadel-sg* evilsis-citadel evilsis-citadel-lod0-jg evilsis-citadel-idle-ja + ((evilsis-citadel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :shadow evilsis-citadel-shadow-mg + ) (deftype citb-sage (process-taskable) ((spawn-pos vector :inline :offset-assert 384) @@ -345,18 +308,7 @@ (defmethod play-reminder citb-sage ((obj citb-sage)) (set! (-> obj root-override pause-adjust-distance) 409600.0) - (let ((s5-0 (get-process *default-dead-pool* citb-sagecage #x4000))) - (set! (-> obj cage) - (ppointer->handle (when s5-0 - (let ((t9-1 (method-of-type citb-sagecage activate))) - (t9-1 (the-as citb-sagecage s5-0) obj 'citb-sagecage (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 citb-sagecage-init-by-other obj) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> obj cage) (ppointer->handle (process-spawn citb-sagecage obj :to obj))) (set! (-> obj beam-on) #f) (set! (-> obj sound-id) (new-sound-id)) (if (zero? (-> obj sound-name)) @@ -422,8 +374,7 @@ (defstate hidden (citb-sage) :virtual #t - :enter - (behavior () + :enter (behavior () (send-event (handle->process (-> self cage)) 'disable-bars) (send-event (handle->process (-> self cage)) 'stop-cloning) ((-> (method-of-type process-taskable hidden) enter)) @@ -439,7 +390,7 @@ 1024 0 0 - 1 + (sound-group sfx) (the-as symbol (-> self spawn-pos)) ) ) @@ -454,8 +405,7 @@ (defstate play-anim (citb-sage) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('disable-bars) (send-event (handle->process (-> self cage)) 'disable-bars) @@ -469,8 +419,7 @@ (defstate idle (citb-sage) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('open) (send-event (handle->process (-> self cage)) 'disable-bars) @@ -480,11 +429,10 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (#if PC_PORT ;; fix infinite state recursion - (if (and (not (and (-> self been-kicked) (-> *pc-settings* fixes crash-sagecage))) (not (should-display? self))) + (if (and (not (-> self been-kicked)) (not (should-display? self))) (go-virtual hidden) ) ;; no fix @@ -495,8 +443,7 @@ ((-> (method-of-type process-taskable idle) trans)) (none) ) - :post - (behavior () + :post (behavior () ((the-as (function none :behavior citb-sage) (-> (method-of-type process-taskable idle) post))) (if (-> self beam-on) (citb-sage-draw-beam) @@ -525,7 +472,7 @@ (set! (-> a0-3 settings top-plane w) (- 4096.0)) ) 0 - (set! (-> v1-1 settings flags) (logand -13 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf02 shdf03)) ) ) (none) @@ -539,14 +486,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -575,8 +522,7 @@ :name "redsage-resolution" :index 7 :parts 9 - :command-list - '((15 send-event self disable-bars) + :command-list '((15 send-event self disable-bars) (45 joint "cameraB") (216 joint "camera") (435 joint "cameraB") @@ -594,10 +540,7 @@ (return #f) ) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-7 (the-as number (logior #x3f800000 v1-6))) - (f0-2 (+ -1.0 (the-as float v1-7))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) (play-ambient (-> obj ambient) "RED-AM01" #f (-> obj root-override trans)) @@ -642,7 +585,7 @@ (set! (-> a0-3 settings top-plane w) (- 4096.0)) ) 0 - (set! (-> v1-1 settings flags) (logand -13 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf02 shdf03)) ) ) (none) @@ -656,14 +599,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -692,8 +635,7 @@ :name "bluesage-resolution" :index 7 :parts 9 - :command-list - '((15 send-event self disable-bars) + :command-list '((15 send-event self disable-bars) (45 joint "cameraB") (74 shadow self #f) (185 joint "camera") @@ -716,10 +658,7 @@ (return #f) ) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-7 (the-as number (logior #x3f800000 v1-6))) - (f0-2 (+ -1.0 (the-as float v1-7))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) (play-ambient (-> obj ambient) "BLU-AM01" #f (-> obj root-override trans)) @@ -764,7 +703,7 @@ (set! (-> a0-3 settings top-plane w) (- 4096.0)) ) 0 - (set! (-> v1-1 settings flags) (logand -13 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf02 shdf03)) ) ) (none) @@ -778,14 +717,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -814,8 +753,7 @@ :name "yellowsage-resolution" :index 7 :parts 6 - :command-list - '((15 send-event self disable-bars) + :command-list '((15 send-event self disable-bars) (45 joint "cameraB") (256 joint "camera") (314 joint "cameraB") @@ -833,10 +771,7 @@ (return #f) ) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-7 (the-as number (logior #x3f800000 v1-6))) - (f0-2 (+ -1.0 (the-as float v1-7))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) (play-ambient (-> obj ambient) "YEL-AM01" #f (-> obj root-override trans)) @@ -896,8 +831,7 @@ :name "green-sagecage-resolution" :index 6 :parts 12 - :command-list - '((33 joint "cameraB") + :command-list '((33 joint "cameraB") (156 joint "camera") (405 joint "cameraB") (576 joint "camera") @@ -928,8 +862,7 @@ :name "green-sagecage-introduction" :index 5 :parts 12 - :command-list - '((71 joint "cameraB") + :command-list '((71 joint "cameraB") (207 joint "camera") (343 joint "cameraB") (574 joint "camera") @@ -950,35 +883,15 @@ (when arg0 (+! (-> obj which-movie) 1) (set! (-> obj draw bounds w) 40960.0) - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj evilbro) - (ppointer->handle - (when s5-1 - (let ((t9-8 (method-of-type manipy activate))) - (t9-8 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *evilbro-citadel-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> obj evilbro) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilbro-citadel-sg* #f :to obj)) + ) (send-event (handle->process (-> obj evilbro)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj evilbro)) 'blend-shape #t) (send-event (handle->process (-> obj evilbro)) 'center-joint 3) - (let ((s5-2 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj evilsis) - (ppointer->handle - (when s5-2 - (let ((t9-14 (method-of-type manipy activate))) - (t9-14 (the-as manipy s5-2) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 manipy-init (-> obj root-override trans) (-> obj entity) *evilsis-citadel-sg* #f) - (-> s5-2 ppointer) - ) - ) - ) - ) + (set! (-> obj evilsis) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilsis-citadel-sg* #f :to obj)) + ) (send-event (handle->process (-> obj evilsis)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj evilsis)) 'blend-shape #t) (send-event (handle->process (-> obj evilsis)) 'center-joint 3) @@ -990,8 +903,7 @@ :name "green-sagecage-outro-preboss" :index 7 :parts 22 - :command-list - '((0 blackout 0) + :command-list '((0 blackout 0) (0 want-levels citadel finalboss) (0 display-level finalboss special) (0 send-event "citb-robotboss-1" 'die) @@ -1087,26 +999,15 @@ (defstate play-anim (green-sagecage) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('spawn-robot) (let ((gp-0 (entity-by-name "robotboss-3"))) (format 0 "robotboss ent ~A~%" gp-0) (when gp-0 - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self robotboss) - (ppointer->handle - (when s5-0 - (let ((t9-3 (method-of-type manipy activate))) - (t9-3 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> self root-override trans) gp-0 *robotboss-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> self robotboss) + (ppointer->handle (manipy-spawn (-> self root-override trans) gp-0 *robotboss-sg* #f :to self)) + ) (send-event (handle->process (-> self robotboss)) 'anim-mode 'clone-anim) (send-event (handle->process (-> self robotboss)) 'center-joint 3) (send-event (handle->process (-> self robotboss)) 'origin-joint-index 3) @@ -1127,8 +1028,7 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self evilbro)))) (if a0-1 (deactivate a0-1) @@ -1178,8 +1078,7 @@ ((-> (method-of-type process-taskable play-anim) exit)) (none) ) - :trans - (behavior () + :trans (behavior () (case (-> self which-movie) ((1) (spool-push *art-control* "green-sagecage-outro-preboss" 0 self -1.0) @@ -1216,8 +1115,7 @@ (defstate idle (green-sagecage) :virtual #t - :trans - (behavior () + :trans (behavior () (cond ((and *target* (and (< (-> (target-pos 0) z) -18821530.0) (= (current-status (-> self tasks)) (task-status need-hint))) diff --git a/goal_src/levels/citadel/citb-bunny.gc b/goal_src/levels/citadel/citb-bunny.gc index c44db07cdb..fc9cde5c53 100644 --- a/goal_src/levels/citadel/citb-bunny.gc +++ b/goal_src/levels/citadel/citb-bunny.gc @@ -5,10 +5,10 @@ ;; name in dgo: citb-bunny ;; dgos: CIT, L1 -(define-extern *citb-bunny-sg* skeleton-group) - ;; DECOMP BEGINS +(import "goal_src/import/citb-bunny-ag.gc") + (deftype citb-bunny (snow-bunny) () :heap-base #x190 @@ -21,13 +21,10 @@ ) -(defskelgroup *citb-bunny-sg* citb-bunny - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0.25 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *citb-bunny-sg* citb-bunny citb-bunny-lod0-jg citb-bunny-idle-ja + ((citb-bunny-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0.25 0 2) + ) (define *citb-bunny-nav-enemy-info* (new 'static 'nav-enemy-info :idle-anim 3 @@ -75,7 +72,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -91,7 +88,7 @@ (defmethod TODO-RENAME-48 citb-bunny ((obj citb-bunny) (arg0 object)) (dummy-60 obj) (TODO-RENAME-45 obj *citb-bunny-nav-enemy-info*) - (set! (-> obj draw shadow-ctrl settings flags) (logand -9 (-> obj draw shadow-ctrl settings flags))) + (logclear! (-> obj draw shadow-ctrl settings flags) (shadow-flags shdf03)) (cond ((zero? (res-lump-value (-> obj entity) 'mode uint128)) (set! (-> obj defense) (the-as uint 1)) diff --git a/goal_src/levels/citadel/citb-drop-plat.gc b/goal_src/levels/citadel/citb-drop-plat.gc index f615a7b9f2..c731734620 100644 --- a/goal_src/levels/citadel/citb-drop-plat.gc +++ b/goal_src/levels/citadel/citb-drop-plat.gc @@ -7,45 +7,32 @@ ;; DECOMP BEGINS -(defskelgroup *citb-drop-plat-sg* citb-drop-plat - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(import "goal_src/import/citb-drop-plat-ag.gc") -(defskelgroup *citb-drop-plat-red-sg* citb-drop-plat - 4 - 7 - ((5 (meters 20)) (6 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *citb-drop-plat-sg* citb-drop-plat citb-drop-plat-lod0-jg citb-drop-plat-idle-ja + ((citb-drop-plat-lod0-mg (meters 20)) (citb-drop-plat-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) -(defskelgroup *citb-drop-plat-green-sg* citb-drop-plat - 8 - 11 - ((9 (meters 20)) (10 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *citb-drop-plat-red-sg* citb-drop-plat citb-drop-plat-red-lod0-jg citb-drop-plat-red-idle-ja + ((citb-drop-plat-red-lod0-mg (meters 20)) (citb-drop-plat-red-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) -(defskelgroup *citb-drop-plat-blue-sg* citb-drop-plat - 12 - 15 - ((13 (meters 20)) (14 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *citb-drop-plat-green-sg* citb-drop-plat citb-drop-plat-green-lod0-jg citb-drop-plat-green-idle-ja + ((citb-drop-plat-green-lod0-mg (meters 20)) (citb-drop-plat-green-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) -(defskelgroup *citb-drop-plat-yellow-sg* citb-drop-plat - 16 - 19 - ((17 (meters 20)) (18 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *citb-drop-plat-blue-sg* citb-drop-plat citb-drop-plat-blue-lod0-jg citb-drop-plat-blue-idle-ja + ((citb-drop-plat-blue-lod0-mg (meters 20)) (citb-drop-plat-blue-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) + +(defskelgroup *citb-drop-plat-yellow-sg* citb-drop-plat citb-drop-plat-yellow-lod0-jg citb-drop-plat-yellow-idle-ja + ((citb-drop-plat-yellow-lod0-mg (meters 20)) (citb-drop-plat-yellow-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) (deftype drop-plat (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -76,27 +63,25 @@ (defstate drop-plat-idle (drop-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('drop) (logclear! (-> self mask) (process-mask actor-pause)) (go drop-plat-drop) ) (('touch 'attack) - (send-event *target* 'no-look-around 300) + (send-event *target* 'no-look-around (seconds 1)) (send-event (ppointer->process (-> self parent)) 'player-stepped (-> self color)) #f ) ) ) - :code - (behavior () + :code (behavior () (suspend) (update-transforms! (-> self root-override)) (set! (-> self state-time) (-> *display* base-frame-counter)) (logior! (-> self mask) (process-mask actor-pause)) - (while #t + (loop (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self duration)) (go drop-plat-drop) ) @@ -104,8 +89,7 @@ ) (none) ) - :post - (the-as (function none :behavior drop-plat) ja-post) + :post (the-as (function none :behavior drop-plat) ja-post) ) (defbehavior drop-plat-set-fade drop-plat () @@ -124,23 +108,21 @@ ) (defstate drop-plat-spawn (drop-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('drop) (go drop-plat-die) ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self root-override trans y) (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y)) ) (logior! (-> self draw status) (draw-status hidden)) (ja-post) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay)) (let ((v1-14 (logclear (-> self draw status) (draw-status hidden))) (a0-5 (-> self draw)) @@ -156,16 +138,14 @@ ) (defstate drop-plat-rise (drop-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('drop) (go drop-plat-drop) ) ) ) - :code - (behavior ((arg0 draw-control)) + :code (behavior ((arg0 draw-control)) (set! (-> self interp) 1.0) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self spin-angle) 0.0) @@ -177,7 +157,7 @@ ) (set! (-> gp-0 quad) (-> self root-override trans quad)) (set! (-> gp-0 y) (-> (the-as process-drawable (-> self parent 0)) root trans y)) - (while #t + (loop (let ((f0-6 (fmax 0.0 (- 1.0 (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) ) @@ -189,7 +169,7 @@ ) (when (and (not s5-0) (< (-> self interp) 0.05)) (set! s5-0 #t) - (sound-play-by-name (static-sound-name "bridge-piece-up") (new-sound-id) 1024 0 0 1 (the-as symbol gp-0)) + (sound-play "bridge-piece-up" :position (the-as symbol gp-0)) ) (set! (-> self spin-angle) (* 10.0 (-> self spin-speed) (-> self interp))) (if (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) @@ -200,8 +180,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-vector-angle! gp-0 (-> self spin-axis) (-> self spin-angle)) (quaternion*! (-> self root-override quat) (-> (the-as process-drawable (-> self parent 0)) root quat) gp-0) @@ -213,11 +192,10 @@ ) (defstate drop-plat-drop (drop-plat) - :code - (behavior () + :code (behavior () (when (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "bridge-piece-dn") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bridge-piece-dn") (let ((gp-1 (the int (* 300.0 (rand-vu-float-range 0.2 0.3))))) (while (< (- (-> *display* base-frame-counter) (-> self state-time)) gp-1) (set! (-> self interp) @@ -228,7 +206,7 @@ ) ) ) - (while #t + (loop (vector-v++! (-> self root-override transv) (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0) @@ -244,8 +222,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-vector-angle! gp-0 (-> self spin-axis) (-> self spin-angle)) (quaternion*! (-> self root-override quat) (-> (the-as process-drawable (-> self parent 0)) root quat) gp-0) @@ -257,8 +234,7 @@ ) (defstate drop-plat-die (drop-plat) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (none) ) @@ -483,18 +459,16 @@ ) (defstate citb-drop-plat-idle (citb-drop-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go citb-drop-plat-active) ) ) ) - :code - (behavior () + :code (behavior () (citb-drop-plat-drop-all-children) - (while #t + (loop (suspend) ) (none) @@ -502,8 +476,7 @@ ) (defstate citb-drop-plat-active (citb-drop-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'player-stepped) @@ -519,11 +492,10 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (citb-drop-plat-spawn-children) - (while #t + (loop (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (+ (-> self duration) (seconds 2))) (or (not *target*) (< (-> self idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) diff --git a/goal_src/levels/citadel/citb-plat.gc b/goal_src/levels/citadel/citb-plat.gc index b67b1c9f8c..840e4a9cd1 100644 --- a/goal_src/levels/citadel/citb-plat.gc +++ b/goal_src/levels/citadel/citb-plat.gc @@ -5,55 +5,42 @@ ;; name in dgo: citb-plat ;; dgos: CIT, L1 -(define-extern *citb-exit-plat-sg* skeleton-group) -(define-extern *citb-firehose-sg* skeleton-group) -(define-extern *citb-stopbox-sg* skeleton-group) -(define-extern *citb-donut-sg* skeleton-group) -(define-extern *citb-rotatebox-sg* skeleton-group) -(define-extern *citb-chain-plat-sg* skeleton-group) -(define-extern *plat-citb-sg* skeleton-group) -(define-extern *plat-eco-citb-lit-sg* skeleton-group) -(define-extern *plat-eco-citb-unlit-sg* skeleton-group) - -(declare-type citb-exit-plat plat-button) -(declare-type citb-firehose process-drawable) -(declare-type citb-chain-plat rigid-body-platform) - - - ;; DECOMP BEGINS -(defskelgroup *plat-citb-sg* plat-citb - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(import "goal_src/import/citb-exit-plat-ag.gc") +(import "goal_src/import/plat-eco-citb-ag.gc") +(import "goal_src/import/plat-citb-ag.gc") +(import "goal_src/import/citb-stopbox-ag.gc") +(import "goal_src/import/citb-firehose-ag.gc") +(import "goal_src/import/citb-rotatebox-ag.gc") +(import "goal_src/import/citb-chain-plat-ag.gc") +(import "goal_src/import/citb-donut-ag.gc") -(defskelgroup *plat-eco-citb-unlit-sg* plat-eco-citb - 0 - 8 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *plat-citb-sg* plat-citb plat-citb-lod0-jg plat-citb-idle-ja + ((plat-citb-lod0-mg (meters 20)) (plat-citb-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) -(defskelgroup *plat-eco-citb-lit-sg* plat-eco-citb - 4 - 8 - ((5 (meters 20)) (6 (meters 40)) (7 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *plat-eco-citb-unlit-sg* plat-eco-citb plat-eco-citb-lod0-jg plat-eco-citb-idle-ja + ((plat-eco-citb-lod0-mg (meters 20)) + (plat-eco-citb-lod1-mg (meters 40)) + (plat-eco-citb-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 3) + ) -(defskelgroup *citb-chain-plat-sg* citb-chain-plat - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *plat-eco-citb-lit-sg* plat-eco-citb plat-eco-citb-lit-lod0-jg plat-eco-citb-idle-ja + ((plat-eco-citb-lit-lod0-mg (meters 20)) + (plat-eco-citb-lit-lod1-mg (meters 40)) + (plat-eco-citb-lit-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 3) + ) + +(defskelgroup *citb-chain-plat-sg* citb-chain-plat citb-chain-plat-lod0-jg citb-chain-plat-idle-ja + ((citb-chain-plat-lod0-mg (meters 20)) (citb-chain-plat-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) (deftype citb-base-plat (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -75,8 +62,7 @@ (defstate citb-base-plat-idle (citb-base-plat) :virtual #t - :trans - (behavior () + :trans (behavior () (if (and *target* (>= (-> self idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -85,16 +71,13 @@ ) (none) ) - :code - (the-as (function none :behavior citb-base-plat) anim-loop) - :post - (the-as (function none :behavior citb-base-plat) ja-post) + :code (the-as (function none :behavior citb-base-plat) anim-loop) + :post (the-as (function none :behavior citb-base-plat) ja-post) ) (defstate citb-base-plat-active (citb-base-plat) :virtual #t - :trans - (behavior () + :trans (behavior () (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -104,10 +87,8 @@ (rider-trans) (none) ) - :code - (the-as (function none :behavior citb-base-plat) anim-loop) - :post - (the-as (function none :behavior citb-base-plat) rider-post) + :code (the-as (function none :behavior citb-base-plat) anim-loop) + :post (the-as (function none :behavior citb-base-plat) rider-post) ) (defmethod dummy-21 citb-base-plat ((obj citb-base-plat)) @@ -217,8 +198,7 @@ (defstate plat-path-active (citb-plat) :virtual #t - :trans - (behavior () + :trans (behavior () (set! (-> self path-pos) (if (logtest? (-> self fact options) (fact-options wrap-phase)) (get-current-phase (-> self sync)) (get-current-phase-with-mirror (-> self sync)) @@ -227,15 +207,7 @@ (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (vector+! (-> self basetrans) (-> self basetrans) (-> self trans-offset)) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) (none) @@ -312,8 +284,7 @@ (defstate citb-base-plat-idle (citb-stair-plat) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'trigger) (logclear! (-> self mask) (process-mask actor-pause)) @@ -325,10 +296,8 @@ ) ) ) - :trans - (the-as (function none :behavior citb-stair-plat) #f) - :code - (behavior () + :trans (the-as (function none :behavior citb-stair-plat) #f) + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (while (not (-> self rise)) (suspend) @@ -341,7 +310,7 @@ (suspend) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (let ((f30-0 (- 1.0 (* 0.0011111111 (the float (- (-> *display* base-frame-counter) (-> self state-time))))))) (when (< f30-0 0.0) (set! (-> self root-override trans y) (-> self rise-height)) @@ -359,16 +328,13 @@ ) (none) ) - :post - (the-as (function none :behavior citb-stair-plat) #f) + :post (the-as (function none :behavior citb-stair-plat) #f) ) (defstate citb-base-plat-active (citb-stair-plat) :virtual #t - :trans - (the-as (function none :behavior citb-stair-plat) #f) - :code - (behavior () + :trans (the-as (function none :behavior citb-stair-plat) #f) + :code (behavior () (set! (-> self root-override trans y) (-> self rise-height)) (suspend) (update-transforms! (-> self root-override)) @@ -376,8 +342,7 @@ (anim-loop) (none) ) - :post - (the-as (function none :behavior citb-stair-plat) ja-post) + :post (the-as (function none :behavior citb-stair-plat) ja-post) ) (defmethod dummy-22 citb-stair-plat ((obj citb-stair-plat)) @@ -492,73 +457,61 @@ (defstate rigid-body-platform-idle (citb-chain-plat) :virtual #t - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (set! (-> self state-time) (-> *display* base-frame-counter)) (if (and (and *target* (>= (-> self info idle-distance) (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) ) ) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) (go-virtual rigid-body-platform-float) ) ) (none) ) - :code - (behavior () + :code (behavior () (anim-loop) (none) ) - :post - (the-as (function none :behavior citb-chain-plat) ja-post) + :post (the-as (function none :behavior citb-chain-plat) ja-post) ) (defstate rigid-body-platform-float (citb-chain-plat) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior citb-chain-plat) rigid-body-platform-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (none) ) - :trans - (behavior () + :trans (behavior () (cond - ((and (and *target* - (>= (-> self info idle-distance) - (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) - ) + ((and (and *target* (>= (-> self info idle-distance) + (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) + ) ) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) (when (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (if (rand-vu-percent? 0.05) (spawn-projectile-blue *target*) ) ) - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) (-> self float-offset) (* 8192.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) (-> self float-offset) (* 8192.0 (-> *display* seconds-per-frame))) (draw-eco-beam (-> self root-overlay trans) (-> self beam-end)) (update-trans! (-> self sound) (-> self root-overlay trans)) (update! (-> self sound)) ) (else - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) (-> self idle-offset) (* 16384.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) (-> self idle-offset) (* 16384.0 (-> *display* seconds-per-frame))) (stop! (-> self sound)) (if (= (-> self float-height-offset) (-> self idle-offset)) (go citb-chain-plat-settle) @@ -567,20 +520,16 @@ ) (none) ) - :code - (behavior () + :code (behavior () (anim-loop) (none) ) - :post - (the-as (function none :behavior citb-chain-plat) rigid-body-platform-post) + :post (the-as (function none :behavior citb-chain-plat) rigid-body-platform-post) ) (defstate citb-chain-plat-settle (citb-chain-plat) - :trans - (the-as (function none :behavior citb-chain-plat) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior citb-chain-plat) rider-trans) + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'quaternion)) ) @@ -608,8 +557,7 @@ (go-virtual rigid-body-platform-idle) (none) ) - :post - (the-as (function none :behavior citb-chain-plat) rider-post) + :post (the-as (function none :behavior citb-chain-plat) rider-post) ) (defmethod TODO-RENAME-30 citb-chain-plat ((obj citb-chain-plat)) @@ -647,19 +595,8 @@ (set! (-> obj idle-offset) 0.0) (set! (-> obj float-offset) (res-lump-float (-> obj entity) 'height-info :default 4096.0)) (set! (-> obj float-height-offset) (-> obj idle-offset)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "eco-plat-hover") - :volume #x400 - :fo-max 50 - ) - (-> obj root-overlay trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "eco-plat-hover" :fo-max 50) (-> obj root-overlay trans)) ) (let ((s5-0 (-> obj info control-point-count))) (dotimes (s4-0 s5-0) @@ -677,13 +614,10 @@ (none) ) -(defskelgroup *citb-rotatebox-sg* citb-rotatebox - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -5 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *citb-rotatebox-sg* citb-rotatebox citb-rotatebox-lod0-jg citb-rotatebox-idle-ja + ((citb-rotatebox-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -5 0 10) + ) (deftype citb-rotatebox (citb-base-plat) () @@ -696,44 +630,13 @@ (defstate citb-base-plat-active (citb-rotatebox) :virtual #t - :trans - (the-as (function none :behavior citb-rotatebox) rider-trans) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :trans (the-as (function none :behavior citb-rotatebox) rider-trans) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) @@ -777,13 +680,10 @@ (none) ) -(defskelgroup *citb-donut-sg* citb-donut - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *citb-donut-sg* citb-donut citb-donut-lod0-jg citb-donut-idle-ja + ((citb-donut-lod0-mg (meters 20)) (citb-donut-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) (deftype citb-donut (citb-base-plat) ((sync sync-info :inline :offset-assert 180) @@ -797,8 +697,7 @@ (defstate citb-base-plat-active (citb-donut) :virtual #t - :post - (behavior () + :post (behavior () (update! (-> self sound)) (quaternion-axis-angle! (-> self root-override quat) @@ -840,32 +739,18 @@ (defmethod dummy-22 citb-donut ((obj citb-donut)) (initialize-skeleton obj *citb-donut-sg* '()) (setup-params! (-> obj sync) (the-as uint 9000) 0.0 0.15 0.15) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "rotate-plat") - :volume #x400 - :fo-max 20 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> obj root-override trans)) ) (logclear! (-> obj mask) (process-mask actor-pause)) 0 (none) ) -(defskelgroup *citb-stopbox-sg* citb-stopbox - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 -2 0 5.5) - :longest-edge (meters 0) - ) +(defskelgroup *citb-stopbox-sg* citb-stopbox citb-stopbox-lod0-jg citb-stopbox-idle-ja + ((citb-stopbox-lod0-mg (meters 20)) (citb-stopbox-lod1-mg (meters 999999))) + :bounds (static-spherem 0 -2 0 5.5) + ) (deftype citb-stopbox (plat) () @@ -878,20 +763,11 @@ (defstate plat-path-active (citb-stopbox) :virtual #t - :trans - (behavior () + :trans (behavior () (set! (-> self path-pos) (get-current-phase (-> self sync))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) (none) @@ -953,17 +829,13 @@ ) -(defskelgroup *citb-firehose-sg* citb-firehose - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 3 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *citb-firehose-sg* citb-firehose citb-firehose-lod0-jg citb-firehose-idle-ja + ((citb-firehose-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3 0 15) + ) (defstate citb-firehose-idle (citb-firehose) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= (-> self idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -972,20 +844,17 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior citb-firehose) ja-post) + :post (the-as (function none :behavior citb-firehose) ja-post) ) (defstate citb-firehose-active (citb-firehose) - :trans - (behavior () + :trans (behavior () (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -1002,15 +871,13 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior citb-firehose) ja-post) + :post (the-as (function none :behavior citb-firehose) ja-post) ) (defbehavior citb-firehose-blast-particles citb-firehose () @@ -1020,115 +887,54 @@ (dotimes (s5-0 16) (quaternion-rotate-local-z! gp-0 gp-0 2048.0) (quaternion-copy! *particle-quat* gp-0) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2541) - (-> self blast-pos) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2541) (-> self blast-pos)) ) ) (spawn (-> self part) (-> self blast-pos)) ) (defstate citb-firehose-blast (citb-firehose) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (let ((v1-4 (new 'static 'attack-info :mask #xe0))) - (set! (-> v1-4 mode) 'damage) - (set! (-> v1-4 shove-back) 24576.0) - (set! (-> v1-4 shove-up) 12288.0) - (set! (-> a1-2 param 1) (the-as uint v1-4)) - ) - (send-event-function arg0 a1-2) + (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((mode 'damage) (shove-back (meters 6)) (shove-up (meters 3)))) ) ) ) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (restore-collide-with-as (-> self root-override)) - (sound-play-by-name - (static-sound-name "eco-torch") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self blast-pos)) - ) + (sound-play "eco-torch" :position (the-as symbol (-> self blast-pos))) (dotimes (gp-1 2) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (set! (-> self blast-pos quad) (-> self node-list data 5 bone transform vector 3 quad)) (citb-firehose-blast-particles) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (clear-collide-with-as (-> self root-override)) - (ja-channel-push! 1 30) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go citb-firehose-active) (none) ) - :post - (the-as (function none :behavior citb-firehose) transform-post) + :post (the-as (function none :behavior citb-firehose) transform-post) ) (defmethod init-from-entity! citb-firehose ((obj citb-firehose) (arg0 entity-actor)) @@ -1175,13 +981,10 @@ (none) ) -(defskelgroup *citb-exit-plat-sg* citb-exit-plat - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *citb-exit-plat-sg* citb-exit-plat citb-exit-plat-lod0-jg citb-exit-plat-idle-ja + ((citb-exit-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) (deftype citb-exit-plat (plat-button) ((idle-height float :offset-assert 240) @@ -1200,8 +1003,7 @@ (defstate citb-exit-plat-idle (citb-exit-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (let ((v1-3 (-> self entity extra perm))) @@ -1212,11 +1014,10 @@ ) ) ) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self root-override)) - (while #t + (loop (suspend) ) (none) @@ -1224,14 +1025,12 @@ ) (defstate citb-exit-plat-rise (citb-exit-plat) - :trans - (the-as (function none :behavior citb-exit-plat) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior citb-exit-plat) rider-trans) + :code (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self root-override)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (let ((f30-0 (- 1.0 (* 0.0016666667 (the float (- (-> *display* base-frame-counter) (-> self state-time))))))) (when (< f30-0 0.0) (set! (-> self root-override trans y) (-> self rise-height)) @@ -1243,8 +1042,7 @@ ) (none) ) - :post - (the-as (function none :behavior citb-exit-plat) rider-post) + :post (the-as (function none :behavior citb-exit-plat) rider-post) ) (defbehavior citb-exit-plat-move-player citb-exit-plat ((arg0 vector)) @@ -1269,8 +1067,7 @@ (defstate plat-button-move-downward (citb-exit-plat) :virtual #t - :trans - (behavior () + :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self root-override trans quad)) (let ((t9-1 (-> (the-as (state plat-button) (find-parent-method citb-exit-plat 23)) trans))) @@ -1282,14 +1079,12 @@ ) (none) ) - :post - (the-as (function none :behavior citb-exit-plat) transform-post) + :post (the-as (function none :behavior citb-exit-plat) transform-post) ) (defstate plat-button-move-upward (citb-exit-plat) :virtual #t - :trans - (behavior () + :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self root-override trans quad)) (let ((t9-1 (-> (the-as (state plat-button) (find-parent-method citb-exit-plat 24)) trans))) @@ -1301,8 +1096,7 @@ ) (none) ) - :post - (the-as (function none :behavior citb-exit-plat) transform-post) + :post (the-as (function none :behavior citb-exit-plat) transform-post) ) (defmethod can-activate? citb-exit-plat ((obj citb-exit-plat)) diff --git a/goal_src/levels/common/babak.gc b/goal_src/levels/common/babak.gc index 4a09e372f6..f44b2d06e7 100644 --- a/goal_src/levels/common/babak.gc +++ b/goal_src/levels/common/babak.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/babak-ag.gc") + (deftype babak (nav-enemy) () :heap-base #x120 @@ -19,46 +21,27 @@ ) -(defskelgroup *babak-sg* babak - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 2 0 3) - :longest-edge (meters 1) - :shadow 4 - ) +(defskelgroup *babak-sg* babak babak-lod0-jg -1 + ((babak-lod0-mg (meters 20)) (babak-lod1-mg (meters 40)) (babak-lod2-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3) + :longest-edge (meters 1) + :shadow babak-shadow-mg + ) (defstate nav-enemy-patrol (babak) :virtual #t - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 10) - ) - (ja-channel-push! 1 45) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 12.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + ((ja-group? babak-give-up-hop-ja) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! babak-walk-ja :num! (seek!) :frame-num (ja-aframe 12.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) ) ) ((the-as (function none) (-> (method-of-type nav-enemy nav-enemy-patrol) code))) @@ -68,65 +51,31 @@ (defstate nav-enemy-chase (babak) :virtual #t - :code - (behavior () + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 14) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 51) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim)))) - (set! (-> a0-7 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-7 param 1) f30-0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! - a0-7 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - num-func-seek! - ) - ) + ((ja-group? babak-jump-land-ja) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.17)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info run-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (else - (ja-channel-push! 1 60) - (let ((v1-42 (-> self skel root-channel 0))) - (set! (-> v1-42 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - ) - ) - (let ((v1-45 (-> self skel root-channel 0))) - (set! (-> v1-45 num-func) num-func-identity) - (set! (-> v1-45 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) ) ) - (while #t + (loop (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) f30-0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) @@ -135,96 +84,47 @@ (defstate nav-enemy-stare (babak) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self turn-time) (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or (logtest? (-> self nav-enemy-flags) 256) + (when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) ) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> gp-0 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-0 param 1) f30-0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! babak-win-ja :num! (seek! (ja-aframe 68.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-1 param 1) f30-0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 68.0 0) f30-0)) ) ) - (while #t + (loop (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) 1.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 60) - (let ((v1-25 (-> self skel root-channel 0))) - (set! (-> v1-25 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - ) - (let ((v1-28 (-> self skel root-channel 0))) - (set! (-> v1-28 num-func) num-func-identity) - (set! (-> v1-28 frame-num) 0.0) - ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! babak-turn-ja) + (ja :num-func num-func-identity :frame-num 0.0) (until (nav-enemy-facing-player? 1820.4445) (ja-blend-eval) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) 0.75) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! 0.75)) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - ) - (ja-channel-push! 1 60) + (if (not (ja-group? babak-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) f30-0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! babak-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) f30-0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (when (nav-enemy-rnd-percent? 0.3) - (ja-channel-push! 1 30) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> gp-2 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-2 param 1) f30-0) - (set! (-> gp-2 frame-num) 0.0) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! babak-win-ja :num! (seek! (ja-aframe 68.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-3 param 1) f30-0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 68.0 0) f30-0)) ) ) ) @@ -235,11 +135,10 @@ (defstate nav-enemy-give-up (babak) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 218453.33) (set! (-> self turn-time) (seconds 0.5)) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) (let ((s4-0 (-> self collide-info)) (s5-0 (target-pos 0)) ) @@ -248,36 +147,16 @@ ) 12743.111 ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! babak-give-up-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! babak-give-up-hop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek-to-point-toward-point! (-> self collide-info) @@ -286,11 +165,7 @@ (-> self turn-time) ) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) (none) @@ -299,35 +174,17 @@ (defstate nav-enemy-jump-land (babak) :virtual #t - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 22) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - ) - (set! (-> gp-0 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-0 param 1) 0.5) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info jump-land-anim)) + :num! (seek! (ja-aframe 32.0 0) 0.5) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-1 param 1) 0.5) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) ) (go-virtual nav-enemy-chase) (none) @@ -383,7 +240,7 @@ :use-proximity-notice #t :use-jump-blocked #t :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/goal_src/levels/common/basebutton.gc b/goal_src/levels/common/basebutton.gc index 8001174cf6..1be11bb3b4 100644 --- a/goal_src/levels/common/basebutton.gc +++ b/goal_src/levels/common/basebutton.gc @@ -8,6 +8,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/generic-button-ag.gc") + (deftype basebutton (process-drawable) ((root-override collide-shape-moving :offset 112) (down? symbol :offset-assert 176) @@ -45,13 +47,10 @@ ) -(defskelgroup *generic-button-sg* generic-button - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *generic-button-sg* generic-button generic-button-lod0-jg generic-button-idle-ja + ((generic-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) (defmethod move-to-vec-or-quat! basebutton ((obj basebutton) (arg0 vector) (arg1 quaternion)) (set! (-> obj move-to?) #t) @@ -67,8 +66,7 @@ (defstate basebutton-startup (basebutton) :virtual #t - :code - (behavior () + :code (behavior () (if (-> self down?) (go-virtual basebutton-down-idle) (go-virtual basebutton-up-idle) @@ -79,20 +77,19 @@ (defstate basebutton-up-idle (basebutton) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (case (-> arg3 param 1) (('flop) (TODO-RENAME-29 self (-> self event-going-down) (-> self notify-actor)) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-down) ) ) ) (('trigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-down) ) (('move-to) @@ -100,22 +97,18 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (press! self #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self move-to?) (rider-trans) ) (none) ) - :code - (the-as (function none :behavior basebutton) anim-loop) - :post - (behavior () + :code (the-as (function none :behavior basebutton) anim-loop) + :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) (set! (-> self root-override trans quad) (-> self move-to-pos quad)) @@ -128,11 +121,10 @@ (defstate basebutton-going-down (basebutton) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('untrigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-up) ) (('move-to) @@ -140,34 +132,22 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (press! self #t) (none) ) - :trans - (the-as (function none :behavior basebutton) rider-trans) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) (-> self anim-speed)) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :trans (the-as (function none :behavior basebutton) rider-trans) + :code (behavior () + (ja-no-eval :num! (seek! max (-> self anim-speed))) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) (TODO-RENAME-29 self (-> self event-down) (-> self notify-actor)) (go-virtual basebutton-down-idle) (none) ) - :post - (behavior () + :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) (set! (-> self root-override trans quad) (-> self move-to-pos quad)) @@ -180,11 +160,10 @@ (defstate basebutton-down-idle (basebutton) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('untrigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-up) ) (('move-to) @@ -192,20 +171,17 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (press! self #t) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self move-to?) (rider-trans) ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (cond ((= (-> self timeout) 0.0) @@ -216,14 +192,13 @@ (suspend) ) (TODO-RENAME-29 self (-> self event-going-up) (-> self notify-actor)) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-up) ) ) (none) ) - :post - (behavior () + :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) (set! (-> self root-override trans quad) (-> self move-to-pos quad)) @@ -236,46 +211,33 @@ (defstate basebutton-going-up (basebutton) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('move-to) (move-to-vec-or-quat! self (the-as vector (-> arg3 param 0)) (the-as quaternion (-> arg3 param 1))) ) (('trigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-down) ) ) ) - :enter - (behavior () + :enter (behavior () (press! self #f) (none) ) - :trans - (the-as (function none :behavior basebutton) rider-trans) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 0.0) - (set! (-> a0-0 param 1) (-> self anim-speed)) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :trans (the-as (function none :behavior basebutton) rider-trans) + :code (behavior () + (ja-no-eval :num! (seek! 0.0 (-> self anim-speed))) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 0.0) - (set! (-> a0-1 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0 (-> self anim-speed))) ) (TODO-RENAME-29 self (-> self event-up) (-> self notify-actor)) (go-virtual basebutton-up-idle) (none) ) - :post - (behavior () + :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) (set! (-> self root-override trans quad) (-> self move-to-pos quad)) @@ -463,7 +425,7 @@ (none) ) -(defbehavior basebutton-init-by-other basebutton ((arg0 basebutton) (arg1 vector) (arg2 quaternion) (arg3 entity-actor) (arg4 symbol) (arg5 float)) +(defbehavior basebutton-init-by-other basebutton ((arg0 entity-actor) (arg1 vector) (arg2 quaternion) (arg3 entity-actor) (arg4 symbol) (arg5 float)) (reset! self) (set! (-> self spawned-by-other?) #t) (set! (-> self button-id) -1) @@ -471,7 +433,7 @@ (set! (-> self notify-actor) arg3) (set! (-> self timeout) arg5) (if arg0 - (set! (-> self entity) (the-as entity arg0)) + (set! (-> self entity) arg0) ) (TODO-RENAME-27 self) (set! (-> self root-override trans quad) (-> arg1 quad)) @@ -483,10 +445,7 @@ (none) ) -(define *warp-info* (the-as (array string) (new - 'static - 'boxed-array - :type string :length 5 :allocated-length 5 +(define *warp-info* (the-as (array string) (new 'static 'boxed-array :type string "training-warp" "village1-warp" "village2-warp" @@ -517,13 +476,11 @@ (defstate use (warp-gate) :virtual #t - :trans - (behavior () + :trans (behavior () (send-event *camera* 'joystick 0.0 0.0) (none) ) - :code - (behavior ((arg0 int) (arg1 level)) + :code (behavior ((arg0 int) (arg1 level)) (set! (-> self state-time) (-> *display* base-frame-counter)) (when (not arg1) (process-release? *target*) @@ -550,7 +507,7 @@ ;; we add "training" to the list here so that the training warp gate waits until it's safe to ;; dispose the old code from memory. (case (-> self level) - (('citadel 'lavatube 'training) + (('citadel 'lavatube 'training) (while (and *target* (zero? (logand (-> *target* draw status) (draw-status hidden)))) (suspend) ) @@ -593,13 +550,12 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x20 + :flags (surface-flags always-rotate-toward-transv) ) ) (defstate target-warp-out (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('death-end) (let ((v0-0 (the-as object (logior (-> self draw status) (draw-status hidden))))) @@ -612,43 +568,30 @@ ) ) ) - :enter - (behavior ((arg0 vector) (arg1 vector)) + :enter (behavior ((arg0 vector) (arg1 vector)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *warp-jump-mods*) (set! (-> self control unknown-vector102 quad) (-> arg0 quad)) (set! (-> self control unknown-vector103 quad) (-> arg1 quad)) (set! (-> self control unknown-vector102 y) (+ -4096.0 (-> self control unknown-vector102 y))) (set! (-> self control unknown-uint20) (the-as uint #f)) (vector-reset! (-> self control transv)) - (logior! (-> self state-flags) 1024) + (logior! (-> self state-flags) (state-flags use-alt-cam-pos)) (set! (-> self alt-cam-pos quad) (-> arg1 quad)) (none) ) - :exit - (behavior () - (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) (none) ) - :code - (behavior ((arg0 vector) (arg1 vector)) + :code (behavior ((arg0 vector) (arg1 vector)) (send-event *camera* 'change-state cam-fixed 0) - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> gp-0 param 0) (ja-aframe 16.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! eichar-duck-high-jump-ja :num! (seek! (ja-aframe 16.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 16.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 16.0 0))) ) (vector-! (-> self control transv) (-> self control unknown-vector102) (-> self control trans)) (vector-xz-normalize! (-> self control transv) 32768.0) @@ -723,26 +666,15 @@ ) ) ) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> gp-3 param 0) (ja-aframe 40.0 0)) - (set! (-> gp-3 param 1) 1.0) - (set! (-> gp-3 frame-num) (ja-aframe 16.0 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) - ) + (ja-no-eval :group! eichar-duck-high-jump-ja :num! (seek! (ja-aframe 40.0 0)) :frame-num (ja-aframe 16.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 param 0) (ja-aframe 40.0 0)) - (set! (-> gp-4 param 1) 1.0) - (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 40.0 0))) ) (anim-loop) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) diff --git a/goal_src/levels/common/baseplat.gc b/goal_src/levels/common/baseplat.gc index 265230b336..e2fb8270e7 100644 --- a/goal_src/levels/common/baseplat.gc +++ b/goal_src/levels/common/baseplat.gc @@ -5,6 +5,43 @@ ;; name in dgo: baseplat ;; dgos: GAME, COMMON, L1 +(defenum eco-door-flags + :bitfield #t + :type int32 + (ecdf00) + (ecdf01) + (auto-close) + (one-way) + (ecdf04) + (ecdf05) + (ecdf06) + (ecdf07) + (ecdf08) + (ecdf09) + (ecdf10) + (ecdf11) + (ecdf12) + (ecdf13) + (ecdf14) + (ecdf15) + (ecdf16) + (ecdf17) + (ecdf18) + (ecdf19) + (ecdf20) + (ecdf21) + (ecdf22) + (ecdf23) + (ecdf24) + (ecdf25) + (ecdf26) + (ecdf27) + (ecdf28) + (ecdf29) + (ecdf30) + (ecdf31) + ) + ;; DECOMP BEGINS (deftype baseplat (process-drawable) @@ -51,7 +88,7 @@ (suspend) (transform-post) (suspend) - (while #t + (loop (when (not (-> self bouncing)) (logior! (-> self mask) (process-mask sleep)) (suspend) @@ -111,18 +148,18 @@ ) (deftype eco-door (process-drawable) - ((root-override collide-shape :offset 112) - (speed float :offset-assert 176) - (open-distance float :offset-assert 180) - (close-distance float :offset-assert 184) - (out-dir vector :inline :offset-assert 192) - (open-sound sound-name :offset-assert 208) - (close-sound sound-name :offset-assert 224) - (state-actor entity-actor :offset-assert 240) - (flags int32 :offset-assert 244) - (locked symbol :offset-assert 248) - (auto-close symbol :offset-assert 252) - (one-way symbol :offset-assert 256) + ((root-override collide-shape :offset 112) + (speed float :offset-assert 176) + (open-distance float :offset-assert 180) + (close-distance float :offset-assert 184) + (out-dir vector :inline :offset-assert 192) + (open-sound sound-name :offset-assert 208) + (close-sound sound-name :offset-assert 224) + (state-actor entity-actor :offset-assert 240) + (flags eco-door-flags :offset-assert 244) + (locked symbol :offset-assert 248) + (auto-close symbol :offset-assert 252) + (one-way symbol :offset-assert 256) ) :heap-base #xa0 :method-count-assert 27 @@ -147,11 +184,11 @@ (cond ((-> self locked) (if (= (-> self next-state name) 'door-closed) - (sound-play-by-name (static-sound-name "door-lock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "door-lock") ) ) (else - (sound-play-by-name (static-sound-name "door-unlock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "door-unlock") ) ) #t @@ -164,18 +201,13 @@ eco-door-event-handler (defstate door-closed (eco-door) :virtual #t - :event - eco-door-event-handler - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) 0.0) - ) + :event eco-door-event-handler + :code (behavior () + (ja :num-func num-func-identity :frame-num 0.0) (suspend) (update-transforms! (-> self root-override)) (ja-post) - (while #t + (loop (when (and *target* (>= (-> self open-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -183,14 +215,7 @@ eco-door-event-handler (dummy-26 self) (if (and (not (-> self locked)) (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'powerup)) - (set! (-> a1-1 param 1) (the-as uint 3)) - (send-event-function *target* a1-1) - ) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) (and (-> self one-way) (< (vector4-dot (-> self out-dir) (target-pos 0)) -8192.0)) ) ) @@ -206,35 +231,21 @@ eco-door-event-handler (defstate door-opening (eco-door) :virtual #t - :event - eco-door-event-handler - :code - (behavior () + :event eco-door-event-handler + :code (behavior () (let ((gp-0 (and (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) ) (if gp-0 - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) ) - (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) (clear-collide-with-as (-> self root-override)) (until (ja-done? 0) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) (-> self speed)) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self speed))) (if (and gp-0 (rand-vu-percent? 0.5)) (spawn-projectile-blue *target*) ) @@ -244,28 +255,22 @@ eco-door-event-handler (go-virtual door-open) (none) ) - :post - (the-as (function none :behavior eco-door) transform-post) + :post (the-as (function none :behavior eco-door) transform-post) ) (defstate door-open (eco-door) :virtual #t - :event - eco-door-event-handler - :code - (behavior () + :event eco-door-event-handler + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (process-entity-status! self (entity-perm-status complete) #t) (clear-collide-with-as (-> self root-override)) - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 num-func) num-func-identity) - (set! (-> v1-6 frame-num) (the float (+ (-> v1-6 frame-group data 0 length) -1))) - ) + (ja :num-func num-func-identity :frame-num max) (logior! (-> self draw status) (draw-status hidden)) (suspend) (update-transforms! (-> self root-override)) (ja-post) - (while #t + (loop (let ((f30-0 (vector4-dot (-> self out-dir) (target-pos 0))) (f28-0 (vector4-dot (-> self out-dir) (camera-pos))) ) @@ -288,10 +293,8 @@ eco-door-event-handler (defstate door-closing (eco-door) :virtual #t - :event - eco-door-event-handler - :code - (behavior () + :event eco-door-event-handler + :code (behavior () (restore-collide-with-as (-> self root-override)) (logclear! (-> self draw status) (draw-status hidden)) (let ((gp-0 (new 'stack 'overlaps-others-params))) @@ -301,30 +304,25 @@ eco-door-event-handler (suspend) ) ) - (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) (until (ja-done? 0) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) 0.0) - (set! (-> a0-7 param 1) (-> self speed)) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0 (-> self speed))) (suspend) ) (if (-> self locked) - (sound-play-by-name (static-sound-name "door-lock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "door-lock") ) (go-virtual door-closed) (none) ) - :post - (the-as (function none :behavior eco-door) transform-post) + :post (the-as (function none :behavior eco-door) transform-post) ) (defmethod dummy-26 eco-door ((obj eco-door)) (when (-> obj state-actor) (if (logtest? (-> obj state-actor extra perm status) (entity-perm-status complete)) - (set! (-> obj locked) (logtest? (-> obj flags) 2)) - (set! (-> obj locked) (logtest? (-> obj flags) 1)) + (set! (-> obj locked) (logtest? (-> obj flags) (eco-door-flags ecdf01))) + (set! (-> obj locked) (logtest? (-> obj flags) (eco-door-flags ecdf00))) ) ) 0 @@ -371,10 +369,10 @@ eco-door-event-handler ) ) (set! (-> obj locked) #f) - (set! (-> obj flags) (res-lump-value arg0 'flags int)) + (set! (-> obj flags) (res-lump-value arg0 'flags eco-door-flags)) (dummy-26 obj) - (set! (-> obj auto-close) (logtest? (-> obj flags) 4)) - (set! (-> obj one-way) (logtest? (-> obj flags) 8)) + (set! (-> obj auto-close) (logtest? (-> obj flags) (eco-door-flags auto-close))) + (set! (-> obj one-way) (logtest? (-> obj flags) (eco-door-flags one-way))) (vector-z-quaternion! (-> obj out-dir) (-> obj root-override quat)) (set! (-> obj out-dir w) (- (vector-dot (-> obj out-dir) (-> obj root-override trans)))) (update-transforms! (-> obj root-override)) diff --git a/goal_src/levels/common/battlecontroller.gc b/goal_src/levels/common/battlecontroller.gc index 13b9dcdb1c..a206c4afbe 100644 --- a/goal_src/levels/common/battlecontroller.gc +++ b/goal_src/levels/common/battlecontroller.gc @@ -150,7 +150,7 @@ battlecontroller-default-event-handler (let* ((s5-0 (-> self spawner-array gp-0)) (s4-0 (handle->process (-> s5-0 creature))) ) - (when (and s4-0 (logtest? (-> (the-as nav-enemy s4-0) nav-enemy-flags) 2048)) + (when (and s4-0 (logtest? (-> (the-as nav-enemy s4-0) nav-enemy-flags) (nav-enemy-flags navenmf11))) (cond ((< (-> s5-0 state) (-> s5-0 path curve num-cverts)) (when (or (-> self noticed-player) (= (-> s5-0 state) 1)) @@ -158,7 +158,7 @@ battlecontroller-default-event-handler (eval-path-curve-div! (-> s5-0 path) s3-0 (the float (-> s5-0 state)) 'interp) (send-event s4-0 'cue-jump-to-point s3-0) ) - (if (zero? (logand (-> (the-as nav-enemy s4-0) nav-enemy-flags) 2048)) + (if (zero? (logand (-> (the-as nav-enemy s4-0) nav-enemy-flags) (nav-enemy-flags navenmf11))) (+! (-> s5-0 state) 1) ) ) @@ -206,7 +206,7 @@ battlecontroller-default-event-handler (when (the-as (pointer nav-enemy) gp-0) (logclear! (-> (the-as (pointer nav-enemy) gp-0) 0 mask) (process-mask actor-pause)) (if (-> self misty-ambush-collision-hack) - (logior! (-> (the-as (pointer nav-enemy) gp-0) 0 nav-enemy-flags) #x8000) + (logior! (-> (the-as (pointer nav-enemy) gp-0) 0 nav-enemy-flags) (nav-enemy-flags navenmf15)) ) (+! (-> self spawn-count) 1) (-> self fact pickup-type) @@ -323,7 +323,7 @@ battlecontroller-default-event-handler ) (defbehavior battlecontroller-battle-begin battlecontroller () - (set-setting! *setting-control* self 'music 'danger 0.0 0) + (set-setting! 'music 'danger 0.0 0) (let ((gp-0 (entity-actor-count (-> self entity) 'kill-actor))) (dotimes (s5-0 gp-0) (let ((v1-2 (entity-actor-lookup (-> self entity) 'kill-actor s5-0))) @@ -358,7 +358,7 @@ battlecontroller-default-event-handler ) (defbehavior battlecontroller-off battlecontroller () - (clear-pending-settings-from-process *setting-control* self 'music) + (remove-setting! 'music) (let ((gp-0 (entity-actor-count (-> self entity) 'kill-actor))) (dotimes (s5-0 gp-0) (let ((v1-2 (entity-actor-lookup (-> self entity) 'kill-actor s5-0))) @@ -390,20 +390,17 @@ battlecontroller-default-event-handler (defstate battlecontroller-idle (battlecontroller) :virtual #t - :event - battlecontroller-default-event-handler - :trans - (behavior () + :event battlecontroller-default-event-handler + :trans (behavior () 0 (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (if (-> self prespawn) (battlecontroller-fill-all-spawners) ) - (while #t + (loop (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (set! (-> self state-time) (-> *display* base-frame-counter)) (when (and *target* @@ -423,26 +420,21 @@ battlecontroller-default-event-handler ) (none) ) - :post - (the-as (function none :behavior battlecontroller) #f) + :post (the-as (function none :behavior battlecontroller) #f) ) (defstate battlecontroller-play-intro-camera (battlecontroller) :virtual #t - :event - battlecontroller-default-event-handler - :enter - (behavior () + :event battlecontroller-default-event-handler + :enter (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) (none) ) - :exit - (behavior () + :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :code - (behavior () + :code (behavior () (go-virtual battlecontroller-active) (none) ) @@ -458,10 +450,8 @@ battlecontroller-default-event-handler (defstate battlecontroller-active (battlecontroller) :virtual #t - :event - battlecontroller-default-event-handler - :trans - (behavior () + :event battlecontroller-default-event-handler + :trans (behavior () (if (and *target* (>= (-> self activate-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) @@ -471,11 +461,10 @@ battlecontroller-default-event-handler (battlecontroller-update-spawners) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (battlecontroller-camera-on) - (while #t + (loop (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 0)) @@ -504,8 +493,7 @@ battlecontroller-default-event-handler ) (none) ) - :post - (the-as (function none :behavior battlecontroller) #f) + :post (the-as (function none :behavior battlecontroller) #f) ) (defbehavior battlecontroller-special-contents? battlecontroller () @@ -540,14 +528,12 @@ battlecontroller-default-event-handler (defstate battlecontroller-die (battlecontroller) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior battlecontroller) process-drawable-fuel-cell-handler ) - :code - (behavior () - (sound-play-by-name (static-sound-name "money-pickup") (new-sound-id) 1024 -2286 0 1 #f) + :code (behavior () + (sound-play "money-pickup" :pitch -1.5 :position #f) (battlecontroller-battle-end) (battlecontroller-camera-off) (battlecontroller-set-task-completed) @@ -610,8 +596,7 @@ battlecontroller-default-event-handler (process-entity-status! self (entity-perm-status dead) #t) (none) ) - :post - (the-as (function none :behavior battlecontroller) #f) + :post (the-as (function none :behavior battlecontroller) #f) ) (defmethod relocate battlecontroller ((obj battlecontroller) (arg0 int)) diff --git a/goal_src/levels/common/blocking-plane.gc b/goal_src/levels/common/blocking-plane.gc index 43f1d038ce..6bcda23265 100644 --- a/goal_src/levels/common/blocking-plane.gc +++ b/goal_src/levels/common/blocking-plane.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/ef-plane-ag.gc") + (deftype blocking-plane (process-drawable) () :heap-base #x40 @@ -19,19 +21,15 @@ ) -(defskelgroup *ef-plane-sg* ef-plane - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *ef-plane-sg* ef-plane ef-plane-lod0-jg ef-plane-idle-ja + ((ef-plane-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) (defstate blocking-plane-idle (blocking-plane) - :code - (behavior () + :code (behavior () (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -87,33 +85,23 @@ (none) ) -(defun blocking-plane-spawn ((arg0 curve-control)) - (with-pp - (cond - ((or (not arg0) (logtest? (-> arg0 flags) (path-control-flag not-found))) - ) - (else - (let ((s5-0 (the int (the float (+ (-> arg0 curve num-cverts) -1)))) - (s4-0 0) - ) - (while (< s4-0 s5-0) - (let ((s3-0 (get-process *default-dead-pool* blocking-plane #x4000))) - (when s3-0 - (let ((t9-1 (method-of-type blocking-plane activate))) - (t9-1 (the-as blocking-plane s3-0) pp 'blocking-plane (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 blocking-plane-init-by-other arg0 s4-0) - (-> s3-0 ppointer) - ) - ) - (+! s4-0 2) +(defbehavior blocking-plane-spawn process ((arg0 curve-control)) + (cond + ((or (not arg0) (logtest? (-> arg0 flags) (path-control-flag not-found))) + ) + (else + (let ((s5-0 (the int (the float (+ (-> arg0 curve num-cverts) -1)))) + (s4-0 0) ) + (while (< s4-0 s5-0) + (process-spawn blocking-plane arg0 s4-0 :to self) + (+! s4-0 2) ) ) ) - 0 - (none) ) + 0 + (none) ) (defun blocking-plane-destroy () diff --git a/goal_src/levels/common/dark-eco-pool.gc b/goal_src/levels/common/dark-eco-pool.gc index aa7fe52ddf..a2a420ea0b 100644 --- a/goal_src/levels/common/dark-eco-pool.gc +++ b/goal_src/levels/common/dark-eco-pool.gc @@ -20,8 +20,7 @@ :count 3 :converted #f :normal-scale 3.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 2 :speed 0.5) (new 'static 'ripple-wave :scale 15.0 :xdiv -2 :zdiv 2 :speed 2.0) (new 'static 'ripple-wave :scale 3.0 :xdiv 5 :zdiv 3 :speed 2.0) @@ -30,14 +29,12 @@ ) ) -(define - ripple-for-maincave-dark-eco-pool +(define ripple-for-maincave-dark-eco-pool (new 'static 'ripple-wave-set :count 3 :converted #f :normal-scale 8.57 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 14.0 :xdiv 1 :speed 1.0) (new 'static 'ripple-wave :scale 5.25 :xdiv -1 :zdiv 1 :speed 4.0) (new 'static 'ripple-wave :scale 0.7 :xdiv 5 :zdiv 3 :speed 2.0) @@ -46,14 +43,12 @@ ) ) -(define - ripple-for-finalboss-dark-eco-pool +(define ripple-for-finalboss-dark-eco-pool (new 'static 'ripple-wave-set :count 3 :converted #f :normal-scale 4.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 25.0 :xdiv 2 :speed -2.0) (new 'static 'ripple-wave :scale 15.0 :xdiv -2 :zdiv 2 :speed 3.0) (new 'static 'ripple-wave :scale 4.0 :xdiv 5 :zdiv 3 :speed 4.0) @@ -66,8 +61,7 @@ :count 3 :converted #f :normal-scale 3.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.0) (new 'static 'ripple-wave :scale 15.0 :xdiv -1 :zdiv 1 :speed 4.0) (new 'static 'ripple-wave :scale 2.0 :xdiv 5 :zdiv 3 :speed 2.0) @@ -76,14 +70,12 @@ ) ) -(define - ripple-for-sunken-dark-eco-helix-room +(define ripple-for-sunken-dark-eco-helix-room (new 'static 'ripple-wave-set :count 3 :converted #f :normal-scale 8.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 15.0 :xdiv 1 :speed 1.0) (new 'static 'ripple-wave :scale 5.625 :xdiv -1 :zdiv 1 :speed 4.0) (new 'static 'ripple-wave :scale 0.75 :xdiv 5 :zdiv 3 :speed 2.0) @@ -96,25 +88,24 @@ (let ((t9-0 (method-of-type water-anim TODO-RENAME-25))) (t9-0 obj) ) - (set! (-> obj flags) (logand -8388609 (-> obj flags))) - (set! (-> obj flags) (logior #x1000000 (-> obj flags))) - (let ((v0-1 ((the-as - (function res-lump symbol symbol float structure (pointer res-tag) pointer object) - (method-of-type res-lump get-property-struct) - ) - (-> obj entity) - 'attack-event - 'interp - -1000000000.0 - 'dark-eco-pool - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (logclear! (-> obj flags) (water-flags wt23)) + (set! (-> obj flags) (logior (water-flags wt24) (-> obj flags))) + (set! (-> obj attack-event) + (the-as symbol ((the-as + (function res-lump symbol symbol float structure (pointer res-tag) pointer object) + (method-of-type res-lump get-property-struct) + ) + (-> obj entity) + 'attack-event + 'interp + -1000000000.0 + 'dark-eco-pool + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) ) - (set! (-> obj attack-event) (the-as symbol v0-1)) - v0-1 - ) + (none) ) (defmethod TODO-RENAME-22 dark-eco-pool ((obj dark-eco-pool)) @@ -150,13 +141,11 @@ :id 444 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2020 :fade-after (meters 50))) + :parts ((sp-item 2020 :fade-after (meters 50))) ) (defpart 2020 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 1) (meters 4) 1.0) @@ -176,8 +165,7 @@ ) (defpart 2021 - :init-specs - ((sp-flt spt-r 255.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) (sp-flt spt-b 0.0) (sp-flt spt-fade-a -1.28)) + :init-specs ((sp-flt spt-r 255.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) (sp-flt spt-b 0.0) (sp-flt spt-fade-a -1.28)) ) (defpartgroup group-dark-eco-pool-nasty @@ -186,8 +174,7 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2056 :fade-after (meters 100) :period 600 :length 5) + :parts ((sp-item 2056 :fade-after (meters 100) :period 600 :length 5) (sp-item 2057 :fade-after (meters 100) :period 600 :length 5 :binding 2052) (sp-item 2052 :flags (start-dead launch-asap) :binding 2053) (sp-item 2053 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) @@ -210,8 +197,7 @@ ) (defpart 2056 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 8)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -227,8 +213,7 @@ ) (defpart 2057 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 6.0 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 0.1)) @@ -245,8 +230,7 @@ ) (defpart 2052 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.3) (meters 0.3) 1.0) @@ -270,8 +254,7 @@ ) (defpart 2053 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -291,8 +274,7 @@ ) (defpart 2058 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 6.0 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 0.1)) @@ -309,8 +291,7 @@ ) (defpart 2054 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.3) (meters 0.3) 1.0) @@ -334,8 +315,7 @@ ) (defpart 2055 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -356,8 +336,7 @@ (defstate water-vol-idle (dark-eco-pool) :virtual #t - :trans - (behavior () + :trans (behavior () (let ((t9-0 (-> (method-of-type water-anim water-vol-idle) trans))) (if t9-0 (t9-0) @@ -374,15 +353,17 @@ (set! (-> s5-0 vertex-skip) 256) (when (zero? (rand-vu-int-range 0 15)) (when (and (nonzero? (-> s5-0 vertex-count)) (< #x32000 (memory-free *nk-dead-pool*))) - (let ((s3-0 (rand-vu-int-range 0 (+ (-> s5-0 vertex-count) -1))) - (s4-1 (get-process *default-dead-pool* part-tracker #x4000)) - ) - (when s4-1 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker s4-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 part-tracker-init (-> *part-group-id-table* 445) -1 #f #f #f (-> s5-0 data s3-0)) - (-> s4-1 ppointer) + (let ((s3-0 (rand-vu-int-range 0 (+ (-> s5-0 vertex-count) -1)))) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 445) + -1 + #f + #f + #f + (-> s5-0 data s3-0) + :to *entity-pool* ) ) ) diff --git a/goal_src/levels/common/joint-exploder.gc b/goal_src/levels/common/joint-exploder.gc index feace80fbe..722811e80e 100644 --- a/goal_src/levels/common/joint-exploder.gc +++ b/goal_src/levels/common/joint-exploder.gc @@ -412,7 +412,7 @@ (-> arg0 bbox) (collide-kind background) obj - (new 'static 'pat-surface :skip #x1 :noentity #x1) + (new 'static 'pat-surface :noentity #x1) ) (let ((gp-1 (-> obj joints)) (v1-2 (-> arg0 head)) @@ -424,7 +424,7 @@ (s3-0 (new 'stack-no-clear 'collide-tri-result)) ) (vector-! a2-1 s4-0 (-> s5-1 prev-pos)) - (when (>= (probe-using-line-sphere *collide-cache* (-> s5-1 prev-pos) a2-1 40.96 (collide-kind background) s3-0 1) + (when (>= (probe-using-line-sphere *collide-cache* (-> s5-1 prev-pos) a2-1 40.96 (collide-kind background) s3-0 (new 'static 'pat-surface :noentity #x1)) 0.0 ) (set! (-> s4-0 quad) (-> s3-0 intersect quad)) @@ -449,13 +449,11 @@ ) (defstate joint-exploder-shatter (joint-exploder) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (let* ((f1-0 (the float (- (-> *display* base-frame-counter) (-> self state-time)))) (f0-2 (- 1.0 (/ f1-0 (the float (-> self tuning duration))))) (f1-2 (- 1.0 (/ f1-0 (* 0.75 (the float (-> self tuning duration)))))) @@ -512,20 +510,15 @@ 0 (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self tuning duration)) (suspend) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior joint-exploder) ja-post) + :post (the-as (function none :behavior joint-exploder) ja-post) ) (defmethod TODO-RENAME-23 joint-exploder ((obj joint-exploder)) @@ -652,10 +645,7 @@ (logior! (-> self skel status) (janim-status inited)) (set! (-> self anim) (the-as art-joint-anim (-> self draw art-group data arg1))) (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! gp-1 (-> self anim) num-func-identity) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! (-> self anim) :num! min) (ja-post) (TODO-RENAME-23 self) (set! (-> self die-if-below-y) (+ -102400.0 (-> self root trans y))) diff --git a/goal_src/levels/common/launcherdoor.gc b/goal_src/levels/common/launcherdoor.gc index f8f300912e..61b55a52ad 100644 --- a/goal_src/levels/common/launcherdoor.gc +++ b/goal_src/levels/common/launcherdoor.gc @@ -5,14 +5,12 @@ ;; name in dgo: launcherdoor ;; dgos: JUN, JUNGLE, L1, MAI, MAINCAVE, SUN, SUNKEN -(define-extern *launcherdoor-maincave-sg* skeleton-group) -(define-extern *launcherdoor-sg* skeleton-group) - -(declare-type launcherdoor process-drawable) - ;; DECOMP BEGINS +(import "goal_src/import/launcherdoor-maincave-ag.gc") +(import "goal_src/import/launcherdoor-ag.gc") + (deftype launcherdoor (process-drawable) ((root-override collide-shape :offset 112) (notify-player-passed-thru? symbol :offset-assert 176) @@ -32,61 +30,43 @@ ) -(defskelgroup *launcherdoor-sg* launcherdoor - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *launcherdoor-sg* launcherdoor launcherdoor-geo-jg -1 + ((launcherdoor-geo-mg (meters 20)) (launcherdoor-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) -(defskelgroup *launcherdoor-maincave-sg* launcherdoor-maincave - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *launcherdoor-maincave-sg* launcherdoor-maincave launcherdoor-maincave-geo-jg -1 + ((launcherdoor-maincave-geo-mg (meters 20)) (launcherdoor-maincave-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defstate launcherdoor-closed (launcherdoor) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (if (not arg0) - (sound-play-by-name (static-sound-name "ldoor-close") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ldoor-close") ) (when *target* (case (-> *target* current-level name) (('jungle 'jungleb) - (send-event *target* 'no-load-wait 6000) + (send-event *target* 'no-load-wait (seconds 20)) ) ) ) (restore-collide-with-as (-> self root-override)) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) 0.0) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek! 0.0)) (when arg0 - (let ((v1-22 (-> self skel root-channel 0))) - (set! (-> v1-22 num-func) num-func-identity) - (set! (-> v1-22 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (set! (-> self draw force-lod) 1) ) (suspend) - (while #t + (loop (if (and *target* (= (-> *target* control unknown-surface00 name) 'launch-jump) (< (-> *target* control trans y) (-> self thresh-y)) ) (go launcherdoor-open #f) ) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) 0.0) - (set! (-> a0-13 param 1) (-> self close-speed)) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0 (-> self close-speed))) (suspend) (when (ja-done? 0) (set! (-> self draw force-lod) 1) @@ -119,30 +99,21 @@ ) (none) ) - :post - (the-as (function none :behavior launcherdoor) ja-post) + :post (the-as (function none :behavior launcherdoor) ja-post) ) (defstate launcherdoor-open (launcherdoor) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (if (not arg0) - (sound-play-by-name (static-sound-name "ldoor-open") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ldoor-open") ) (set! (-> self draw force-lod) 0) (clear-collide-with-as (-> self root-override)) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) - (when arg0 - (let ((v1-16 (-> self skel root-channel 0))) - (set! (-> v1-16 num-func) num-func-identity) - (set! (-> v1-16 frame-num) (the float (+ (-> v1-16 frame-group data 0 length) -1))) + (ja-no-eval :num! (seek!)) + (if arg0 + (ja :num-func num-func-identity :frame-num max) ) - ) - (while #t + (loop (when (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump) (< (+ 4096.0 (-> self root-override trans y)) (-> *target* control trans y)) @@ -159,17 +130,12 @@ ) (go launcherdoor-closed #f) ) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) (-> self open-speed)) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self open-speed))) (suspend) ) (none) ) - :post - (the-as (function none :behavior launcherdoor) ja-post) + :post (the-as (function none :behavior launcherdoor) ja-post) ) (defmethod init-from-entity! launcherdoor ((obj launcherdoor) (arg0 entity-actor)) diff --git a/goal_src/levels/common/nav-enemy-h.gc b/goal_src/levels/common/nav-enemy-h.gc index f245297a34..6ed761ad0a 100644 --- a/goal_src/levels/common/nav-enemy-h.gc +++ b/goal_src/levels/common/nav-enemy-h.gc @@ -11,60 +11,97 @@ (define-extern nav-enemy-get-new-patrol-point (function int :behavior nav-enemy)) (define-extern nav-enemy-test-point-near-nav-mesh? (function vector symbol :behavior nav-enemy)) +(defenum nav-enemy-flags + :bitfield #t + :type uint32 + (navenmf0 0) + (navenmf1 1) + (navenmf2 2) + (enable-rotate 3) + (enable-travel 4) + (navenmf5 5) + (navenmf6 6) + (navenmf7 7) + (navenmf8 8) + (standing-jump 9) + (drop-jump 10) + (navenmf11 11) + (navenmf12 12) + (navenmf13 13) + (navenmf14 14) + (navenmf15 15) + (navenmf16 16) + (navenmf17 17) + (navenmf18 18) + (navenmf19 19) + (navenmf20 20) + (navenmf21 21) + (navenmf22 22) + (navenmf23 23) + (navenmf24 24) + (navenmf25 25) + (navenmf26 26) + (navenmf27 27) + (navenmf28 28) + (navenmf29 29) + (navenmf30 30) + (navenmf31 31) + ) + ;; DECOMP BEGINS (deftype nav-enemy-info (basic) - ((idle-anim int32 :offset-assert 4) - (walk-anim int32 :offset-assert 8) - (turn-anim int32 :offset-assert 12) - (notice-anim int32 :offset-assert 16) - (run-anim int32 :offset-assert 20) - (jump-anim int32 :offset-assert 24) - (jump-land-anim int32 :offset-assert 28) - (victory-anim int32 :offset-assert 32) - (taunt-anim int32 :offset-assert 36) - (die-anim int32 :offset-assert 40) - (neck-joint int32 :offset-assert 44) - (player-look-at-joint int32 :offset-assert 48) - (run-travel-speed meters :offset-assert 52) - (run-rotate-speed degrees :offset-assert 56) - (run-acceleration meters :offset-assert 60) - (run-turn-time seconds :offset-assert 64) - (walk-travel-speed meters :offset-assert 72) - (walk-rotate-speed degrees :offset-assert 76) - (walk-acceleration meters :offset-assert 80) - (walk-turn-time seconds :offset-assert 88) - (attack-shove-back meters :offset-assert 96) - (attack-shove-up meters :offset-assert 100) - (shadow-size meters :offset-assert 104) - (notice-nav-radius meters :offset-assert 108) - (nav-nearest-y-threshold meters :offset-assert 112) - (notice-distance meters :offset-assert 116) - (proximity-notice-distance meters :offset-assert 120) - (stop-chase-distance meters :offset-assert 124) - (frustration-distance meters :offset-assert 128) - (frustration-time time-frame :offset-assert 136) - (die-anim-hold-frame float :offset-assert 144) - (jump-anim-start-frame float :offset-assert 148) - (jump-land-anim-end-frame float :offset-assert 152) - (jump-height-min meters :offset-assert 156) - (jump-height-factor float :offset-assert 160) - (jump-start-anim-speed float :offset-assert 164) - (shadow-max-y meters :offset-assert 168) - (shadow-min-y meters :offset-assert 172) - (shadow-locus-dist meters :offset-assert 176) - (use-align symbol :offset-assert 180) - (draw-shadow symbol :offset-assert 184) - (move-to-ground symbol :offset-assert 188) - (hover-if-no-ground symbol :offset-assert 192) - (use-momentum symbol :offset-assert 196) - (use-flee symbol :offset-assert 200) - (use-proximity-notice symbol :offset-assert 204) - (use-jump-blocked symbol :offset-assert 208) - (use-jump-patrol symbol :offset-assert 212) - (gnd-collide-with uint64 :offset-assert 216) - (debug-draw-neck symbol :offset-assert 224) - (debug-draw-jump symbol :offset-assert 228) + ((idle-anim int32 :offset-assert 4) + (walk-anim int32 :offset-assert 8) + (turn-anim int32 :offset-assert 12) + (notice-anim int32 :offset-assert 16) + (run-anim int32 :offset-assert 20) + (jump-anim int32 :offset-assert 24) + (jump-land-anim int32 :offset-assert 28) + (victory-anim int32 :offset-assert 32) + (taunt-anim int32 :offset-assert 36) + (die-anim int32 :offset-assert 40) + (neck-joint int32 :offset-assert 44) + (player-look-at-joint int32 :offset-assert 48) + (run-travel-speed meters :offset-assert 52) + (run-rotate-speed degrees :offset-assert 56) + (run-acceleration meters :offset-assert 60) + (run-turn-time seconds :offset-assert 64) + (walk-travel-speed meters :offset-assert 72) + (walk-rotate-speed degrees :offset-assert 76) + (walk-acceleration meters :offset-assert 80) + (walk-turn-time seconds :offset-assert 88) + (attack-shove-back meters :offset-assert 96) + (attack-shove-up meters :offset-assert 100) + (shadow-size meters :offset-assert 104) + (notice-nav-radius meters :offset-assert 108) + (nav-nearest-y-threshold meters :offset-assert 112) + (notice-distance meters :offset-assert 116) + (proximity-notice-distance meters :offset-assert 120) + (stop-chase-distance meters :offset-assert 124) + (frustration-distance meters :offset-assert 128) + (frustration-time time-frame :offset-assert 136) + (die-anim-hold-frame float :offset-assert 144) + (jump-anim-start-frame float :offset-assert 148) + (jump-land-anim-end-frame float :offset-assert 152) + (jump-height-min meters :offset-assert 156) + (jump-height-factor float :offset-assert 160) + (jump-start-anim-speed float :offset-assert 164) + (shadow-max-y meters :offset-assert 168) + (shadow-min-y meters :offset-assert 172) + (shadow-locus-dist meters :offset-assert 176) + (use-align symbol :offset-assert 180) + (draw-shadow symbol :offset-assert 184) + (move-to-ground symbol :offset-assert 188) + (hover-if-no-ground symbol :offset-assert 192) + (use-momentum symbol :offset-assert 196) + (use-flee symbol :offset-assert 200) + (use-proximity-notice symbol :offset-assert 204) + (use-jump-blocked symbol :offset-assert 208) + (use-jump-patrol symbol :offset-assert 212) + (gnd-collide-with collide-kind :offset-assert 216) + (debug-draw-neck symbol :offset-assert 224) + (debug-draw-jump symbol :offset-assert 228) ) :method-count-assert 9 :size-assert #xe8 @@ -95,7 +132,7 @@ (state-timeout time-frame :offset-assert 352) (free-time time-frame :offset-assert 360) (touch-time time-frame :offset-assert 368) - (nav-enemy-flags uint32 :offset-assert 376) + (nav-enemy-flags nav-enemy-flags :offset-assert 376) (incomming-attack-id handle :offset-assert 384) (jump-return-state (state process) :offset-assert 392) (rand-gen random-generator :offset-assert 396) diff --git a/goal_src/levels/common/nav-enemy.gc b/goal_src/levels/common/nav-enemy.gc index ca28648a40..2cbe7e999d 100644 --- a/goal_src/levels/common/nav-enemy.gc +++ b/goal_src/levels/common/nav-enemy.gc @@ -74,14 +74,15 @@ ) (defmethod common-post nav-enemy ((obj nav-enemy)) - (when (and (logtest? (-> obj nav-enemy-flags) 256) - (or (not *target*) (and (zero? (logand (-> *target* state-flags) #x80f8)) - (>= (- (-> *display* base-frame-counter) (-> obj touch-time)) (seconds 0.05)) - ) + (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)) + (or (not *target*) + (and (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying))) + (>= (- (-> *display* base-frame-counter) (-> obj touch-time)) (seconds 0.05)) + ) ) ) (set-collide-offense (-> obj collide-info) 2 (collide-offense touch)) - (set! (-> obj nav-enemy-flags) (logand -257 (-> obj nav-enemy-flags))) + (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)) ) (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) (when *target* @@ -89,13 +90,13 @@ (look-at-enemy! (-> *target* neck) (the-as vector (-> obj collide-info root-prim prim-core)) - (if (logtest? (-> obj nav-enemy-flags) 4) + (if (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf2)) 'attacking ) obj ) ) - (if (and (nonzero? (-> obj neck)) (logtest? (-> obj nav-enemy-flags) #x4000)) + (if (and (nonzero? (-> obj neck)) (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf14))) (set-target! (-> obj neck) (target-pos (-> obj nav-info player-look-at-joint))) ) ) @@ -110,22 +111,24 @@ ) (defmethod dummy-44 nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) ) ) (defmethod nav-enemy-touch-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) ) @@ -140,7 +143,7 @@ (defmethod dummy-43 nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) (cond - ((logtest? (-> obj nav-enemy-flags) 32) + ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) (send-event arg0 'get-attack-count 1) (logclear! (-> obj mask) (process-mask actor-pause attackable)) (go (method-of-object obj nav-enemy-die)) @@ -152,23 +155,20 @@ ) (defbehavior nav-enemy-send-attack nav-enemy ((arg0 process) (arg1 touching-shapes-entry) (arg2 symbol)) - (let ((v1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-0 from) self) - (set! (-> v1-0 num-params) 2) - (set! (-> v1-0 message) 'attack) - (set! (-> v1-0 param 0) (the-as uint arg1)) - (let ((a1-1 (new 'static 'attack-info :mask #xe0))) - (set! (-> a1-1 shove-back) (-> self nav-info attack-shove-back)) - (set! (-> a1-1 shove-up) (-> self nav-info attack-shove-up)) - (set! (-> a1-1 mode) arg2) - (set! (-> v1-0 param 1) (the-as uint a1-1)) - ) - (the-as object (when (send-event-function arg0 v1-0) - (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) 256) - #t - ) + (the-as + object + (when (send-event + arg0 + 'attack + arg1 + (static-attack-info + ((shove-back (-> self nav-info attack-shove-back)) (shove-up (-> self nav-info attack-shove-up)) (mode arg2)) + ) ) + (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) + #t + ) ) ) @@ -200,9 +200,9 @@ ) ) (('cue-jump-to-point) - (when (logtest? (-> self nav-enemy-flags) 2048) + (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) (set! (-> self event-param-point quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> self nav-enemy-flags) (logand -2049 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) ) ) (('cue-chase) @@ -251,7 +251,7 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-simple-post nav-enemy () - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (nav-enemy-common-post) (update-transforms! (-> self collide-info)) 0 @@ -267,9 +267,9 @@ nav-enemy-default-event-handler (defmethod dummy-41 nav-enemy ((obj nav-enemy)) (cond ((-> obj nav-info use-align) - (TODO-RENAME-11 + (align-vel-and-quat-only! (-> obj align) - 4 + (align-opts adjust-xz-vel) (-> obj nav travel) (the-as int 1.0) 1.0 @@ -315,8 +315,10 @@ nav-enemy-default-event-handler ) (defmethod TODO-RENAME-37 nav-enemy ((obj nav-enemy)) - (when (logtest? (-> obj nav-enemy-flags) 16) - (if (or (logtest? (-> obj nav-enemy-flags) 128) (logtest? (nav-control-flags bit19) (-> obj nav flags))) + (when (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags enable-travel)) + (if (or (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf7)) + (logtest? (nav-control-flags navcf19) (-> obj nav flags)) + ) (seek-to-point-toward-point! (-> obj collide-info) (-> obj nav target-pos) @@ -335,11 +337,11 @@ nav-enemy-default-event-handler (integrate-for-enemy-with-move-to-ground! (-> obj collide-info) (-> obj collide-info transv) - (the-as collide-kind (-> obj nav-info gnd-collide-with)) + (-> obj nav-info gnd-collide-with) 8192.0 #f (-> obj nav-info hover-if-no-ground) - (logtest? (-> obj nav-enemy-flags) #x8000) + (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf15)) ) (dummy-58 (-> obj collide-info) (-> obj collide-info transv)) ) @@ -349,8 +351,8 @@ nav-enemy-default-event-handler (defbehavior nav-enemy-travel-post nav-enemy () (cond - ((logtest? (-> self nav-enemy-flags) 8) - (TODO-RENAME-9 (-> self align)) + ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (compute-alignment! (-> self align)) (dummy-40 self) (dummy-41 self) (TODO-RENAME-37 self) @@ -380,9 +382,9 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-patrol-post nav-enemy () - (when (or (logtest? (nav-control-flags bit19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) + (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) (set! (-> self nav block-count) 2.0) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (nav-enemy-get-new-patrol-point) ) (dummy-19 @@ -392,8 +394,8 @@ nav-enemy-default-event-handler (-> self nav destination-pos) (-> self rotate-speed) ) - (if (logtest? (nav-control-flags bit21) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit10)) + (if (logtest? (nav-control-flags navcf21) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (nav-enemy-travel-post) 0 @@ -424,7 +426,7 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-face-player-post nav-enemy () - (if (and *target* (logtest? (-> self nav-enemy-flags) 16)) + (if (and *target* (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))) (seek-to-point-toward-point! (-> self collide-info) (target-pos 0) (-> self rotate-speed) (-> self turn-time)) ) (nav-enemy-simple-post) @@ -459,7 +461,7 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-neck-control-look-at nav-enemy () - (logior! (-> self nav-enemy-flags) #x4000) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf14)) (if (nonzero? (-> self neck)) (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) ) @@ -468,8 +470,8 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-neck-control-inactive nav-enemy () - (when (and (nonzero? (-> self neck)) (logtest? (-> self nav-enemy-flags) #x4000)) - (set! (-> self nav-enemy-flags) (logand -16385 (-> self nav-enemy-flags))) + (when (and (nonzero? (-> self neck)) (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf14))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf14)) (shut-down! (-> self neck)) ) 0 @@ -477,13 +479,16 @@ nav-enemy-default-event-handler ) (defun nav-enemy-player-vulnerable? () - (the-as symbol (and *target* (zero? (logand (-> *target* state-flags) #x80f8)))) + (the-as + symbol + (and *target* (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying)))) + ) ) (defmethod TODO-RENAME-46 nav-enemy ((obj nav-enemy) (arg0 float)) (and *target* - (zero? (logand (-> *target* state-flags) #x80f8)) - (and (or (zero? (logand (-> obj nav-enemy-flags) 4096)) + (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying))) + (and (or (zero? (logand (-> obj nav-enemy-flags) (nav-enemy-flags navenmf12))) (< (vector-vector-distance (target-pos 0) (-> obj collide-info trans)) arg0) ) (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos)) @@ -494,10 +499,10 @@ nav-enemy-default-event-handler (defbehavior nav-enemy-notice-player? nav-enemy () (let ((gp-0 #f)) (cond - ((logtest? (-> self nav-enemy-flags) 1) + ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (when (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (-> self reaction-time)) (set! gp-0 #t) - (set! (-> self nav-enemy-flags) (logand -2 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) ) ) (else @@ -509,7 +514,7 @@ nav-enemy-default-event-handler ) ) ) - (logior! (-> self nav-enemy-flags) 1) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (set! (-> self notice-time) (-> *display* base-frame-counter)) ) ) @@ -642,19 +647,16 @@ nav-enemy-default-event-handler (vector-xz-normalize! (-> self hit-from-dir) 1.0) ) (set! (-> self collide-info transv y) 65502.96) - (let ((v1-14 (-> self skel root-channel 0))) - (set! (-> v1-14 num-func) num-func-identity) - (set! (-> v1-14 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self collide-info status) (logand -8 (-> self collide-info status))) + (logclear! (-> self collide-info status) (cshape-moving-flags onsurf onground tsurf)) (until (ja-done? 0) (cond ((nonzero? (-> self align)) (when (not s4-1) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 4098 1.0 arg1 1.0) - (when (zero? (logand (-> self align flags) 1)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel ignore-y-if-zero) 1.0 arg1 1.0) + (when (zero? (logand (-> self align flags) (align-flags disabled))) (let ((f0-6 (* (- (-> self align delta trans z)) (-> *display* frames-per-second)))) (set! (-> self collide-info transv x) (* (-> self hit-from-dir x) f0-6)) (set! (-> self collide-info transv z) (* (-> self hit-from-dir z) f0-6)) @@ -670,11 +672,7 @@ nav-enemy-default-event-handler ) ) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) arg2) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max arg2)) ) ) ) @@ -685,22 +683,12 @@ nav-enemy-default-event-handler (defbehavior nav-enemy-turn-to-face-dir nav-enemy ((arg0 vector) (arg1 float)) (local-vars (v1-16 symbol)) (let ((s4-0 (-> *display* base-frame-counter))) - (let ((v1-3 (-> self skel root-channel 0))) - (set! (-> v1-3 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info turn-anim))) - ) - ) - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 num-func) num-func-identity) - (set! (-> v1-6 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data (-> self nav-info turn-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (until v1-16 (seek-toward-heading-vec! (-> self collide-info) arg0 (-> self rotate-speed) (-> self turn-time)) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) 0.75) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! 0.75)) (set! v1-16 (or (>= (- (-> *display* base-frame-counter) s4-0) (seconds 10)) (nav-enemy-facing-direction? arg0 arg1)) ) @@ -740,30 +728,21 @@ nav-enemy-default-event-handler (defstate nav-enemy-idle (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (nav-enemy-neck-control-inactive) (set! (-> self state-time) (-> *display* base-frame-counter)) (if (-> self nav-info move-to-ground) - (move-to-ground - (-> self collide-info) - 40960.0 - 40960.0 - #t - (the-as collide-kind (-> self nav-info gnd-collide-with)) - ) + (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (-> self nav-info gnd-collide-with)) ) - (set! (-> self nav-enemy-flags) (logand -7 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1 navenmf2)) (set! (-> self state-timeout) (seconds 1)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (and *target* (>= (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) @@ -776,48 +755,34 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! (-> self draw art-group data (-> self nav-info idle-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (let ((f30-0 (nav-enemy-rnd-float-range 0.75 1.25))) - (while #t + (loop (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) ) - :post - (the-as (function none :behavior nav-enemy) ja-post) + :post (the-as (function none :behavior nav-enemy) ja-post) ) (defstate nav-enemy-patrol (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self nav flags) - (the-as nav-control-flags (the-as int (logior (nav-control-flags bit19) (-> self nav flags)))) + (the-as nav-control-flags (the-as int (logior (nav-control-flags navcf19) (-> self nav flags)))) ) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 8) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (set! (-> self state-timeout) (seconds 1)) (set! (-> self target-speed) (-> self nav-info walk-travel-speed)) (set! (-> self acceleration) (-> self nav-info walk-acceleration)) @@ -825,13 +790,11 @@ nav-enemy-default-event-handler (set! (-> self turn-time) (-> self nav-info walk-turn-time)) (none) ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 8) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status was-drawn))) @@ -851,14 +814,8 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (let ((gp-0 'racer) - (a1-2 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 1) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'mode)) - (= gp-0 (send-event-function *target* a1-2)) + (let ((gp-0 'racer)) + (= gp-0 (send-event *target* 'query 'mode)) ) ) ) @@ -870,151 +827,73 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-1 param 1) f30-0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) f30-0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (when (nav-enemy-rnd-go-idle? 0.2) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 180) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - (set! (-> a0-8 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-8 param 1) f30-0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! - a0-8 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-seek! - ) - ) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) f30-0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (until (not (nav-enemy-rnd-go-idle? 0.2)) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - (set! (-> a0-11 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-11 param 1) f30-0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! - a0-11 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) f30-0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - ) - (logior! (-> self nav-enemy-flags) 8) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) 1.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 180) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-17 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-17 param 1) f30-0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! - a0-17 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! + (ja :num! (seek! max f30-0)) ) ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) f30-0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) ) (none) ) - :post - nav-enemy-patrol-post + :post nav-enemy-patrol-post ) (defstate nav-enemy-notice (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () - (logior! (-> self nav-enemy-flags) 4) + :enter (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-neck-control-look-at) - (if (logtest? (-> self nav-enemy-flags) 2) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-chase) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (let ((gp-0 (-> self nav)) (v1-10 (target-pos 0)) ) @@ -1025,27 +904,13 @@ nav-enemy-default-event-handler (set! (-> self turn-time) (-> self nav-info run-turn-time)) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - ) - (set! (-> a0-2 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info notice-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (seek-toward-heading-vec! (-> self collide-info) @@ -1054,55 +919,37 @@ nav-enemy-default-event-handler (-> self turn-time) ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) f30-0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (go-virtual nav-enemy-chase) (none) ) - :post - nav-enemy-simple-post + :post nav-enemy-simple-post ) (defbehavior ja-group-index? nav-enemy ((arg0 int)) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data arg0) - ) + (ja-group? (-> self draw art-group data arg0)) ) (defstate nav-enemy-flee (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-time)) (if (or (or (not *target*) (< (-> self nav-info stop-chase-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (let ((gp-0 'racer) - (a1-1 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'mode)) - (!= gp-0 (send-event-function *target* a1-1)) + (let ((gp-0 'racer)) + (!= gp-0 (send-event *target* 'query 'mode)) ) ) (go-virtual nav-enemy-patrol) @@ -1110,72 +957,36 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (ja-channel-push! 1 60) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - ) - (set! (-> a0-2 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info notice-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) - (ja-channel-push! 1 60) - (while #t - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - (set! (-> a0-6 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-6 param 1) f30-0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.2)) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) f30-0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) (none) ) - :post - nav-enemy-face-player-post + :post nav-enemy-face-player-post ) (defbehavior nav-enemy-reset-frustration nav-enemy () - (set! (-> self nav-enemy-flags) (logand -8193 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) (if *target* (set! (-> self frustration-point quad) (-> *target* control shadow-pos quad)) ) @@ -1191,22 +1002,22 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-frustrated? nav-enemy () - (and (logtest? (-> self nav-enemy-flags) 8192) (nav-enemy-player-at-frustration-point?)) + (and (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) + (nav-enemy-player-at-frustration-point?) + ) ) (defstate nav-enemy-chase (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (nav-enemy-neck-control-look-at) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self free-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (set! (-> self target-speed) (-> self nav-info run-travel-speed)) (set! (-> self acceleration) (-> self nav-info run-acceleration)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) @@ -1214,12 +1025,11 @@ nav-enemy-default-event-handler (nav-enemy-reset-frustration) (none) ) - :trans - (behavior () - (if (logtest? (-> *target* state-flags) 128) + :trans (behavior () + (if (logtest? (-> *target* state-flags) (state-flags do-not-notice)) (go-virtual nav-enemy-patrol) ) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory) ) (if (or (not (nav-enemy-player-at-frustration-point?)) @@ -1233,15 +1043,15 @@ nav-enemy-default-event-handler (if (>= (- (-> *display* base-frame-counter) (-> self frustration-time)) (+ (-> self reaction-time) (-> self nav-info frustration-time)) ) - (logior! (-> self nav-enemy-flags) 8192) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) ) (if (or (not (TODO-RENAME-46 self (-> self nav-info stop-chase-distance))) - (logtest? (-> self nav-enemy-flags) 8192) + (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) ) (go-virtual nav-enemy-stop-chase) ) (cond - ((logtest? (nav-control-flags bit17) (-> self nav flags)) + ((logtest? (nav-control-flags navcf17) (-> self nav flags)) (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 1)) (go-virtual nav-enemy-patrol) ) @@ -1253,40 +1063,28 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim)))) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (while #t + (loop (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) ) - :post - nav-enemy-chase-post + :post nav-enemy-chase-post ) (defstate nav-enemy-stop-chase (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (let* ((f30-0 (vector-vector-distance (-> self collide-info trans) (target-pos 0))) (gp-1 (the int (+ (lerp-scale 600.0 1800.0 f30-0 32768.0 122880.0) (nav-enemy-rnd-float-range 0.0 30.0)))) @@ -1302,10 +1100,9 @@ nav-enemy-default-event-handler (set! (-> self turn-time) (-> self nav-info walk-turn-time)) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (if (logtest? (-> *target* state-flags) 128) + (if (logtest? (-> *target* state-flags) (state-flags do-not-notice)) (go-virtual nav-enemy-patrol) ) (if (and (TODO-RENAME-46 self (-> self nav-info notice-distance)) (not (nav-enemy-frustrated?))) @@ -1315,7 +1112,7 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (logtest? (nav-control-flags bit17) (-> self nav flags)) + (logtest? (nav-control-flags navcf17) (-> self nav flags)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) ) (go-virtual nav-enemy-stare) @@ -1323,44 +1120,30 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self nav-info walk-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (while #t + (loop (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) ) - :post - nav-enemy-chase-post + :post nav-enemy-chase-post ) (defstate nav-enemy-stare (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((f0-0 (vector-vector-distance (-> self collide-info trans) (target-pos 0)))) (set! (-> self state-timeout) (the-as @@ -1374,15 +1157,13 @@ nav-enemy-default-event-handler (set! (-> self collide-info transv quad) (-> *null-vector* quad)) (none) ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 16) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (if (logtest? (-> *target* state-flags) 128) + (if (logtest? (-> *target* state-flags) (state-flags do-not-notice)) (go-virtual nav-enemy-patrol) ) (cond @@ -1397,17 +1178,16 @@ nav-enemy-default-event-handler (set! (-> self notice-time) (-> *display* base-frame-counter)) ) ) - (when (not - (or (and *target* (>= 40960.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) - (and (-> self nav-info use-proximity-notice) - *target* - (>= (-> self nav-info proximity-notice-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) - ) - ) - ) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) + (when (not (or (and *target* (>= 40960.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) + (and (-> self nav-info use-proximity-notice) + *target* + (>= (-> self nav-info proximity-notice-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) + ) + ) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) (go-virtual nav-enemy-give-up) ) @@ -1416,38 +1196,33 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (logtest? (nav-control-flags bit17) (-> self nav flags)) + (logtest? (nav-control-flags navcf17) (-> self nav flags)) ) (go-virtual nav-enemy-give-up) ) ) (none) ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-give-up) (none) ) - :post - nav-enemy-face-player-post + :post nav-enemy-face-player-post ) (defstate nav-enemy-give-up (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (nav-enemy-neck-control-inactive) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (if (TODO-RENAME-46 self (-> self nav-info notice-distance)) (go-virtual nav-enemy-chase) @@ -1455,97 +1230,66 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-patrol) (none) ) - :post - nav-enemy-simple-post + :post nav-enemy-simple-post ) (defstate nav-enemy-attack (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-victory) (none) ) - :post - nav-enemy-simple-post + :post nav-enemy-simple-post ) (defstate nav-enemy-victory (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self collide-info transv quad) (-> *null-vector* quad)) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - ) - (set! (-> a0-2 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) data 0 length) - -1 - ) - ) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info victory-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (go-virtual nav-enemy-stare) (none) ) - :post - nav-enemy-simple-post + :post nav-enemy-simple-post ) (defstate nav-enemy-die (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) process-drawable-death-event-handler ) - :enter - (behavior () + :enter (behavior () (send-event (ppointer->process (-> self parent)) 'child-die) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (clear-collide-with-as (-> self collide-info)) (nav-enemy-fall-and-play-death-anim (the-as art-joint-anim (-> self draw art-group data (-> self nav-info die-anim))) @@ -1564,19 +1308,16 @@ nav-enemy-default-event-handler (cleanup-for-death self) (none) ) - :post - nav-enemy-death-post + :post nav-enemy-death-post ) (defstate nav-enemy-fuel-cell (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) process-drawable-fuel-cell-handler ) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self collide-info)) (ja-post) @@ -1605,7 +1346,7 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-jump-post nav-enemy () - (if (logtest? (-> self nav-enemy-flags) 16) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (seek-to-point-toward-point! (-> self collide-info) (-> self jump-dest) @@ -1613,7 +1354,7 @@ nav-enemy-default-event-handler (-> self turn-time) ) ) - (when (logtest? (-> self nav-enemy-flags) 8) + (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((f30-0 (the float (- (-> *display* base-frame-counter) (-> self jump-time))))) (let ((v1-12 (eval-position! (-> self jump-trajectory) f30-0 (new 'stack-no-clear 'vector)))) (set! (-> self collide-info trans quad) (-> v1-12 quad)) @@ -1641,24 +1382,24 @@ nav-enemy-default-event-handler (set! (-> s2-2 y) 0.0) (vector-xz-normalize! s1-1 1.0) (vector-xz-normalize! s2-2 1.0) - (set! (-> self nav-enemy-flags) (logand -1537 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump drop-jump)) (if (or (>= (* 0.5 (-> self nav-info run-travel-speed)) f24-0) (>= (cos 3640.889) (vector-dot s1-1 s2-2))) - (logior! (-> self nav-enemy-flags) 512) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) ) ) (if (or (and (< f26-0 0.0) (< f28-0 (fabs f26-0))) (and (< (fabs f26-0) 12288.0) (< f28-0 20480.0))) - (logior! (-> self nav-enemy-flags) 1024) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) ) ) - (when (and arg1 (logtest? (-> self nav-enemy-flags) 1024)) - (set! (-> self nav-enemy-flags) (logand -513 (-> self nav-enemy-flags))) + (when (and arg1 (logtest? (-> self nav-enemy-flags) (nav-enemy-flags drop-jump))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) (set! f30-0 2048.0) ) (setup-from-to-height! (-> self jump-trajectory) s4-0 arg0 f30-0 (* 0.000011111111 arg4)) ) (set! (-> self nav extra-nav-sphere quad) (-> arg0 quad)) (set! (-> self nav extra-nav-sphere w) (-> self collide-info nav-radius)) - (logior! (-> self collide-info nav-flags) 2) + (logior! (-> self collide-info nav-flags) (nav-flags navf1)) 0 (none) ) @@ -1676,87 +1417,48 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-execute-custom-jump nav-enemy ((arg0 int) (arg1 float) (arg2 float)) - (when (logtest? (-> self nav-enemy-flags) 512) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 1.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 30) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) - (let ((s3-0 (-> self skel root-channel 0))) - (set! (-> s3-0 frame-group) (the-as art-joint-anim (-> self draw art-group data arg0))) - (set! (-> s3-0 param 0) (ja-aframe arg1 0)) - (set! (-> s3-0 param 1) arg2) - (set! (-> s3-0 frame-num) 0.0) - (joint-control-channel-group! s3-0 (the-as art-joint-anim (-> self draw art-group data arg0)) num-func-seek!) - ) + (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.1)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (ja-no-eval :group! (-> self draw art-group data arg0) :num! (seek! (ja-aframe arg1 0) arg2) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((s3-1 (-> self skel root-channel 0))) - (set! (-> s3-1 param 0) (ja-aframe arg1 0)) - (set! (-> s3-1 param 1) arg2) - (joint-control-channel-group-eval! s3-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe arg1 0) arg2)) ) ) - (set! (-> self collide-info status) (logand -8 (-> self collide-info status))) + (logclear! (-> self collide-info status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self jump-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 8) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (cond - ((logtest? (-> self nav-enemy-flags) 1024) + ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data (-> self nav-info run-anim)) - ) + ((ja-group? (-> self draw art-group data (-> self nav-info run-anim))) ) (else - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) 1.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 30) - (let ((v1-39 (-> self skel root-channel 0))) - (set! (-> v1-39 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - ) - ) - (let ((v1-42 (-> self skel root-channel 0))) - (set! (-> v1-42 num-func) num-func-identity) - (set! (-> v1-42 frame-num) 0.0) - ) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) ) ) ) (else - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 param 0) 1.0) - (joint-control-channel-group! a0-30 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 30) - (let ((v1-49 (-> self skel root-channel 0))) - (set! (-> v1-49 frame-group) (the-as art-joint-anim (-> self draw art-group data arg0))) - ) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 num-func) num-func-identity) - (set! (-> s5-1 frame-num) (ja-aframe arg1 0)) - ) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data arg0)) + (ja :num-func num-func-identity :frame-num (ja-aframe arg1 0)) ) ) (while (< (the float (- (-> *display* base-frame-counter) (-> self jump-time))) (-> self jump-trajectory time)) (suspend) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1))) - (set! (-> a0-36 param 1) 1.0) - (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (ja-blend-eval) ) (set! (-> self collide-info trans quad) (-> self jump-dest quad)) (set! (-> self collide-info transv y) 0.0) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) 0 (none) ) @@ -1772,39 +1474,16 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-jump-land-anim nav-enemy () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 22) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - ) - (set! (-> a0-2 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) data 0 length) - -1 - ) - ) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - num-func-seek! - ) - ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info jump-land-anim)) + :num! (seek!) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) 0 (none) @@ -1812,10 +1491,8 @@ nav-enemy-default-event-handler (defstate nav-enemy-jump (nav-enemy) :virtual #t - :event - nav-enemy-jump-event-handler - :enter - (behavior () + :event nav-enemy-jump-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (if (and (-> self nav-info use-jump-blocked) (TODO-RENAME-50 self (-> self event-param-point))) (go-virtual nav-enemy-jump-blocked) @@ -1823,13 +1500,11 @@ nav-enemy-default-event-handler (nav-enemy-initialize-jump (-> self event-param-point)) (none) ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 24) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) - :code - (behavior () + :code (behavior () (nav-enemy-execute-jump) (let ((a1-0 (-> self nav user-poly))) (if (not a1-0) @@ -1842,14 +1517,13 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-jump-land) (none) ) - :post - nav-enemy-jump-post + :post nav-enemy-jump-post ) (defbehavior nav-enemy-jump-land-post nav-enemy () - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (dummy-11 (-> self nav) (-> self nav target-pos)) - (set! (-> self target-speed) (seek (-> self target-speed) (-> self nav-info run-travel-speed) 2048.0)) + (seek! (-> self target-speed) (-> self nav-info run-travel-speed) 2048.0) (set! (-> self momentum-speed) (-> self target-speed)) (let* ((f0-7 (fmin @@ -1862,7 +1536,9 @@ nav-enemy-default-event-handler (set! (-> self collide-info transv x) (-> v1-9 x)) (set! (-> self collide-info transv z) (-> v1-9 z)) ) - (if (or (logtest? (-> self nav-enemy-flags) 128) (logtest? (nav-control-flags bit19) (-> self nav flags))) + (if (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf7)) + (logtest? (nav-control-flags navcf19) (-> self nav flags)) + ) (seek-to-point-toward-point! (-> self collide-info) (-> self nav target-pos) @@ -1883,7 +1559,7 @@ nav-enemy-default-event-handler (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) - (the-as collide-kind (-> self nav-info gnd-collide-with)) + (-> self nav-info gnd-collide-with) 8192.0 #f (-> self nav-info hover-if-no-ground) @@ -1895,15 +1571,13 @@ nav-enemy-default-event-handler (defstate nav-enemy-jump-land (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logclear! (-> self nav flags) (nav-control-flags bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self collide-info transv quad)) (set! (-> gp-0 y) 0.0) @@ -1914,128 +1588,80 @@ nav-enemy-default-event-handler ) (none) ) - :trans - (behavior () + :trans (behavior () (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (logtest? (nav-control-flags bit19) (-> self nav flags)) + (logtest? (nav-control-flags navcf19) (-> self nav flags)) ) (go-virtual nav-enemy-chase) ) (none) ) - :code - (behavior () + :code (behavior () (nav-enemy-jump-land-anim) (go (-> self jump-return-state)) (none) ) - :post - nav-enemy-jump-land-post + :post nav-enemy-jump-land-post ) (defstate nav-enemy-jump-blocked (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) (go (-> self jump-return-state)) ) (none) ) - :code - (behavior () - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data (-> self nav-info idle-anim)) - ) - ) - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-identity + :code (behavior () + (when (not (ja-group? (-> self draw art-group data (-> self nav-info idle-anim)))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) ) - (set! (-> gp-0 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - ) ) (let ((f30-0 (nav-enemy-rnd-float-range 0.75 1.25))) - (while #t + (loop (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) f30-0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) ) - :post - nav-enemy-simple-post + :post nav-enemy-simple-post ) (defstate nav-enemy-wait-for-cue (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 2048) - (ja-channel-push! 1 30) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) + (ja-channel-push! 1 (seconds 0.1)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - ) - (let ((v1-9 (-> self skel root-channel 0))) - (set! (-> v1-9 num-func) num-func-identity) - (set! (-> v1-9 frame-num) 0.0) - ) - (while (logtest? (-> self nav-enemy-flags) 2048) + (ja :group! (-> self draw art-group data (-> self nav-info idle-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (while (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (nav-enemy-turn-to-face-point (-> self event-param-point) 910.2222) (let ((gp-0 (nav-enemy-rnd-int-range 0 150)) (s5-0 (-> *display* base-frame-counter)) ) (until (>= (- (-> *display* base-frame-counter) s5-0) gp-0) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) f30-0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) (suspend) ) ) @@ -2043,53 +1669,44 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-jump-to-point) (none) ) - :post - nav-enemy-simple-post + :post nav-enemy-simple-post ) (defstate nav-enemy-jump-to-point (nav-enemy) :virtual #t - :event - nav-enemy-jump-event-handler - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 24) + :event nav-enemy-jump-event-handler + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) - :trans - (behavior () + :trans (behavior () 0 (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (nav-enemy-initialize-jump (-> self event-param-point)) (nav-enemy-neck-control-look-at) - (logior! (-> self nav-enemy-flags) 16) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (when (not (nav-enemy-facing-point? (-> self jump-dest) 5461.3335)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (nav-enemy-jump-land-anim) (go-virtual nav-enemy-wait-for-cue) (none) ) - :post - nav-enemy-jump-post + :post nav-enemy-jump-post ) -(define - *nav-enemy-dummy-shadow-control* +(define *nav-enemy-dummy-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #x28)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 614400.0) + :flags (shadow-flags shdf03 disable-draw) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) :bot-plane (new 'static 'plane :y 1.0 :w 4096.0) :top-plane (new 'static 'plane :y 1.0 :w -4096.0) ) @@ -2117,7 +1734,7 @@ nav-enemy-default-event-handler ) (set! (-> obj align) (new 'process 'align-control obj)) (set! (-> obj nav) (new 'process 'nav-control (-> obj collide-info) 16 (-> arg0 nav-nearest-y-threshold))) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav gap-event) 'jump) (TODO-RENAME-26 (-> obj nav)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) @@ -2127,7 +1744,7 @@ nav-enemy-default-event-handler ) (set! (-> obj reaction-time) (nav-enemy-rnd-int-range (seconds 0.1) (seconds 0.8))) (set! (-> obj speed-scale) 1.0) - (logior! (-> obj nav-enemy-flags) 4216) + (logior! (-> obj nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel navenmf5 navenmf6 navenmf12)) 0 (none) ) @@ -2165,8 +1782,8 @@ nav-enemy-default-event-handler (vector-identity! (-> self collide-info scale)) (set! (-> self entity) (-> arg0 entity)) (TODO-RENAME-48 self) - (set! (-> self nav-enemy-flags) (logand -4097 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 2) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf12)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-wait-for-cue) (none) ) diff --git a/goal_src/levels/common/orb-cache.gc b/goal_src/levels/common/orb-cache.gc index e4d24929b5..3e4f734d55 100644 --- a/goal_src/levels/common/orb-cache.gc +++ b/goal_src/levels/common/orb-cache.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/orb-cache-top-ag.gc") + (deftype orb-cache-top (baseplat) ((active-distance float :offset-assert 228) (inactive-distance float :offset-assert 232) @@ -34,17 +36,13 @@ ) -(defskelgroup *orb-cache-top-sg* orb-cache-top - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *orb-cache-top-sg* orb-cache-top orb-cache-top-lod0-jg orb-cache-top-idle-ja + ((orb-cache-top-lod0-mg (meters 20)) (orb-cache-top-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defstate orb-cache-top-idle (orb-cache-top) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('eco-blue) (process-entity-status! self (entity-perm-status complete) #t) @@ -59,17 +57,9 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'powerup)) - (set! (-> a1-1 param 1) (the-as uint 3)) - (not (send-event-function *target* a1-1)) - ) + (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (level-hint-spawn (game-text-id sidekick-hint-orb-cache-top) @@ -81,10 +71,9 @@ ) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (if (and (not arg0) (-> self child)) - (sound-play-by-name (static-sound-name "close-orb-cash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "close-orb-cash") ) (dotimes (gp-1 (-> self money)) (let ((a0-4 (handle->process (-> self money-list gp-1)))) @@ -94,14 +83,7 @@ ) ) (process-entity-status! self (entity-perm-status complete) #f) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> gp-2 frame-num) (ja-aframe 0.0 0)) - ) + (ja :group! (-> self draw art-group data 3) :num! (identity (ja-aframe 0.0 0))) (transform-post) (anim-loop) (none) @@ -179,9 +161,7 @@ ) (set! s3-0 #f) ) - (set! (-> obj basetrans y) - (seek (-> obj basetrans y) (+ (-> obj root-pos) f30-0) (* 40960.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> obj basetrans y) (+ (-> obj root-pos) f30-0) (* 40960.0 (-> *display* seconds-per-frame))) (if (not (= (-> obj basetrans y) (+ (-> obj root-pos) f30-0))) (set! s5-1 #f) ) @@ -190,12 +170,11 @@ (set! (-> s4-1 quad) (-> (the-as process-drawable (handle->process (-> obj money-list s2-0))) root trans quad) ) - (set! (-> obj money-pos-actual s2-0) (seek - (-> obj money-pos-actual s2-0) - (-> obj money-pos-list s2-0) - (* 40960.0 (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> obj money-pos-actual s2-0) + (-> obj money-pos-list s2-0) + (* 40960.0 (-> *display* seconds-per-frame)) + ) (if (not (= (-> obj money-pos-actual s2-0) (-> obj money-pos-list s2-0))) (set! s5-1 #f) ) @@ -215,123 +194,96 @@ ) (defstate orb-cache-top-activate (orb-cache-top) - :event - (the-as (function process int symbol event-message-block object :behavior orb-cache-top) plat-event) - :exit - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior orb-cache-top) plat-event) + :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :trans - (the-as (function none :behavior orb-cache-top) plat-trans) - :code - (behavior ((arg0 symbol)) + :trans (the-as (function none :behavior orb-cache-top) plat-trans) + :code (behavior ((arg0 symbol)) (process-entity-status! self (entity-perm-status bit-3) #t) (calculate-pos self arg0) (if arg0 (set! (-> self basetrans y) (-> self platform-pos)) - (sound-play-by-name (static-sound-name "open-orb-cash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "open-orb-cash") ) (dotimes (s5-1 (-> self money)) (let ((s4-1 (new 'stack-no-clear 'vector))) (set! (-> s4-1 quad) (-> self basetrans quad)) (set! (-> s4-1 y) (-> self money-pos-list s5-1)) (set! (-> self money-pos-actual s5-1) (-> s4-1 y)) - (let ((s3-0 (get-process *default-dead-pool* money #x4000))) - (set! (-> self money-list s5-1) - (ppointer->handle - (when s3-0 - (let ((t9-5 (method-of-type money activate))) - (t9-5 (the-as money s3-0) self 'money (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 money-init-by-other-no-bob s4-1 *null-vector* 5 1.0 (-> self entity)) - (-> s3-0 ppointer) - ) - ) + (set! (-> self money-list s5-1) + (ppointer->handle + (process-spawn money :init money-init-by-other-no-bob s4-1 *null-vector* 5 1.0 (-> self entity) :to self) ) - ) + ) ) ) - (while #t + (loop (calculate-pos self #t) - (while (not - (or (not *target*) (< (-> self inactive-distance) - (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) - ) + (while (not (or (not *target*) (< (-> self inactive-distance) + (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + ) (pos-logic self #t) (suspend) ) (calculate-pos self #f) - (while (and (not - (and (and *target* (>= (-> self active-distance) - (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) - ) + (while (and (not (and (and *target* (>= (-> self active-distance) + (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + (let ((a1-11 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-11 from) self) + (set! (-> a1-11 num-params) 2) + (set! (-> a1-11 message) 'query) + (set! (-> a1-11 param 0) (the-as uint 'powerup)) + (set! (-> a1-11 param 1) (the-as uint 3)) + (or (send-event-function *target* a1-11) (-> self activated)) ) - (let ((a1-11 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-11 from) self) - (set! (-> a1-11 num-params) 2) - (set! (-> a1-11 message) 'query) - (set! (-> a1-11 param 0) (the-as uint 'powerup)) - (set! (-> a1-11 param 1) (the-as uint 3)) - (or (send-event-function *target* a1-11) (-> self activated)) - ) - ) - ) + ) + ) (not (pos-logic self #f)) ) (suspend) ) - (if (not - (and (and *target* (>= (-> self active-distance) - (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (not (and (and *target* (>= (-> self active-distance) + (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + (let ((a1-14 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-14 from) self) + (set! (-> a1-14 num-params) 2) + (set! (-> a1-14 message) 'query) + (set! (-> a1-14 param 0) (the-as uint 'powerup)) + (set! (-> a1-14 param 1) (the-as uint 3)) + (or (send-event-function *target* a1-14) (-> self activated)) ) - (let ((a1-14 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-14 from) self) - (set! (-> a1-14 num-params) 2) - (set! (-> a1-14 message) 'query) - (set! (-> a1-14 param 0) (the-as uint 'powerup)) - (set! (-> a1-14 param 1) (the-as uint 3)) - (or (send-event-function *target* a1-14) (-> self activated)) - ) - ) - ) + ) + ) (go orb-cache-top-idle arg0) ) ) (none) ) - :post - (the-as (function none :behavior orb-cache-top) plat-post) + :post (the-as (function none :behavior orb-cache-top) plat-post) ) (defstate orb-cache-top-complete (orb-cache-top) - :event - (the-as (function process int symbol event-message-block object :behavior orb-cache-top) plat-event) - :trans - (the-as (function none :behavior orb-cache-top) plat-trans) - :code - (behavior ((arg0 symbol)) + :event (the-as (function process int symbol event-message-block object :behavior orb-cache-top) plat-event) + :trans (the-as (function none :behavior orb-cache-top) plat-trans) + :code (behavior ((arg0 symbol)) (if (not arg0) - (sound-play-by-name (static-sound-name "close-orb-cash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "close-orb-cash") ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> gp-1 frame-num) (ja-aframe 0.0 0)) - ) + (ja :group! (-> self draw art-group data 3) :num! (identity (ja-aframe 0.0 0))) (new 'stack-no-clear 'vector) (set! (-> self basetrans y) (+ 2048.0 (-> self root-pos))) (anim-loop) (none) ) - :post - (the-as (function none :behavior orb-cache-top) plat-post) + :post (the-as (function none :behavior orb-cache-top) plat-post) ) (defmethod init-from-entity! orb-cache-top ((obj orb-cache-top) (arg0 entity-actor)) diff --git a/goal_src/levels/common/plat-button.gc b/goal_src/levels/common/plat-button.gc index 778f695923..181875850a 100644 --- a/goal_src/levels/common/plat-button.gc +++ b/goal_src/levels/common/plat-button.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/plat-button-ag.gc") + (deftype plat-button (process-drawable) ((root-override collide-shape-moving :offset 112) (go-back-if-lost-player? symbol :offset-assert 176) @@ -41,13 +43,10 @@ ) -(defskelgroup *plat-button-sg* plat-button - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -1 0 6.6) - :longest-edge (meters 0) - ) +(defskelgroup *plat-button-sg* plat-button plat-button-geo-jg plat-button-pressed-ja + ((plat-button-geo-mg (meters 999999))) + :bounds (static-spherem 0 -1 0 6.6) + ) (defmethod should-teleport? plat-button ((obj plat-button)) #f @@ -59,8 +58,7 @@ (defstate plat-button-idle (plat-button) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) (when (can-activate? self) @@ -81,67 +79,30 @@ ) ) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (can-activate? self))) - (cond - (gp-0 - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 0.0) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (if gp-0 + (ja-no-eval :num! (seek! 0.0)) + (ja-no-eval :num! (seek!)) ) - (else - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - ) - (while #t + (loop (if (should-teleport? self) (go-virtual plat-button-teleport-to-other-end) ) (let ((s5-0 (can-activate? self))) (when (!= s5-0 gp-0) (set! gp-0 s5-0) - (cond - (s5-0 - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 0.0) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (if s5-0 + (ja-no-eval :num! (seek! 0.0)) + (ja-no-eval :num! (seek!)) ) - (else - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - ) ) (when (not (ja-done? 0)) (rider-trans) - (cond - (s5-0 - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) 0.0) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (if s5-0 + (ja :num! (seek! 0.0)) + (ja :num! (seek!)) ) - (else - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - ) (rider-post) ) ) @@ -154,8 +115,7 @@ (defstate plat-button-teleport-to-other-end (plat-button) :virtual #t - :code - (behavior () + :code (behavior () (let ((f0-0 1.0)) (if (>= (-> self path-pos) 0.5) (set! f0-0 0.0) @@ -175,22 +135,12 @@ (defstate plat-button-pressed (plat-button) :virtual #t - :trans - (the-as (function none :behavior plat-button) rider-trans) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :trans (the-as (function none :behavior plat-button) rider-trans) + :code (behavior () + (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self go-back-if-lost-player?) #t) (process-entity-status! self (entity-perm-status complete) #t) @@ -200,8 +150,7 @@ ) (none) ) - :post - (the-as (function none :behavior plat-button) rider-post) + :post (the-as (function none :behavior plat-button) rider-post) ) (defbehavior plat-button-camera-on plat-button () @@ -222,41 +171,38 @@ (defstate plat-button-move-downward (plat-button) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (the-as object (when (or (= arg2 'touch) (= arg2 'attack)) (set! (-> self state-time) (-> *display* base-frame-counter)) #f ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (process-entity-status! self (entity-perm-status bit-3) #t) (plat-button-camera-on) - (set-setting! *setting-control* self 'allow-look-around #f 0.0 0) + (set-setting! 'allow-look-around #f 0.0 0) (none) ) - :exit - (behavior () + :exit (behavior () (plat-button-camera-off) - (clear-pending-settings-from-process *setting-control* self 'allow-look-around) + (remove-setting! 'allow-look-around) (none) ) - :trans - (behavior () + :trans (behavior () (if (= (-> self path-pos) 1.0) (go-virtual plat-button-at-end) ) (rider-trans) (when (-> self go-back-if-lost-player?) - (when (or (not *target*) (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) - (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) - ) + (when (or (not *target*) + (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) + (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + ) + ) + ) ) (set! (-> self go-back-if-lost-player?) #f) (go-virtual plat-button-move-upward) @@ -270,7 +216,7 @@ (move-to-point! (-> self root-override) gp-0) ) ) - (sound-play-by-name (static-sound-name "elev-loop") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "elev-loop" :id (-> self sound-id)) (let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-1 command) (sound-command set-param)) (set! (-> gp-1 id) (-> self sound-id)) @@ -285,7 +231,7 @@ ) (sound-trans-convert (-> gp-1 parms trans) a1-6) ) - (set! (-> gp-1 parms mask) (the-as uint 32)) + (set! (-> gp-1 parms mask) (sound-mask trans)) (-> gp-1 id) ) (if (and (-> self grab-player?) (< 0.2 (-> self path-pos))) @@ -293,49 +239,44 @@ ) (none) ) - :code - (the-as (function none :behavior plat-button) anim-loop) - :post - (the-as (function none :behavior plat-button) rider-post) + :code (the-as (function none :behavior plat-button) anim-loop) + :post (the-as (function none :behavior plat-button) rider-post) ) (defstate plat-button-move-upward (plat-button) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (the-as object (when (or (= arg2 'touch) (= arg2 'attack)) (set! (-> self state-time) (-> *display* base-frame-counter)) #f ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (process-entity-status! self (entity-perm-status bit-3) #t) (plat-button-camera-on) - (set-setting! *setting-control* self 'allow-look-around #f 0.0 0) + (set-setting! 'allow-look-around #f 0.0 0) (none) ) - :exit - (behavior () + :exit (behavior () (plat-button-camera-off) - (clear-pending-settings-from-process *setting-control* self 'allow-look-around) + (remove-setting! 'allow-look-around) (none) ) - :trans - (behavior () + :trans (behavior () (if (= (-> self path-pos) 0.0) (go-virtual plat-button-at-end) ) (rider-trans) (when (-> self go-back-if-lost-player?) - (when (or (not *target*) (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) - (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) - ) + (when (or (not *target*) + (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) + (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + ) + ) + ) ) (set! (-> self go-back-if-lost-player?) #f) (go-virtual plat-button-move-downward) @@ -349,7 +290,7 @@ (move-to-point! (-> self root-override) gp-0) ) ) - (sound-play-by-name (static-sound-name "elev-loop") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "elev-loop" :id (-> self sound-id)) (let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-1 command) (sound-command set-param)) (set! (-> gp-1 id) (-> self sound-id)) @@ -364,7 +305,7 @@ ) (sound-trans-convert (-> gp-1 parms trans) a1-6) ) - (set! (-> gp-1 parms mask) (the-as uint 32)) + (set! (-> gp-1 parms mask) (sound-mask trans)) (-> gp-1 id) ) (if (and (-> self grab-player?) (< (-> self path-pos) 0.8)) @@ -372,22 +313,19 @@ ) (none) ) - :code - (the-as (function none :behavior plat-button) anim-loop) - :post - (the-as (function none :behavior plat-button) rider-post) + :code (the-as (function none :behavior plat-button) anim-loop) + :post (the-as (function none :behavior plat-button) rider-post) ) (defstate plat-button-at-end (plat-button) :virtual #t - :code - (behavior () + :code (behavior () (if (-> self allow-auto-kill) (process-entity-status! self (entity-perm-status bit-3) #f) ) (sound-stop (-> self sound-id)) - (sound-play-by-name (static-sound-name "elev-land") (new-sound-id) 1024 0 0 1 #t) - (while #t + (sound-play "elev-land") + (loop (if (or (not *target*) (< 268435460.0 (vector-vector-xz-distance-squared (-> self root-override trans) (target-pos 0))) ) diff --git a/goal_src/levels/common/plat-eco.gc b/goal_src/levels/common/plat-eco.gc index 4fe53414d7..83304de0ef 100644 --- a/goal_src/levels/common/plat-eco.gc +++ b/goal_src/levels/common/plat-eco.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/plat-eco-ag.gc") + (deftype plat-eco (plat) ((notice-dist float :offset-assert 264) (sync-offset-dest float :offset-assert 268) @@ -26,26 +28,19 @@ ) -(defskelgroup *plat-eco-unlit-sg* plat-eco - 0 - 8 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *plat-eco-unlit-sg* plat-eco plat-eco-lod0-jg plat-eco-idle-ja + ((plat-eco-lod0-mg (meters 20)) (plat-eco-lod1-mg (meters 40)) (plat-eco-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) -(defskelgroup *plat-eco-lit-sg* plat-eco - 0 - 8 - ((5 (meters 20)) (6 (meters 40)) (7 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *plat-eco-lit-sg* plat-eco plat-eco-lod0-jg plat-eco-idle-ja + ((plat-eco-lit-lod0-mg (meters 20)) (plat-eco-lit-lod1-mg (meters 40)) (plat-eco-lit-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) (defstate plat-idle (plat-eco) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('wake) (go-virtual plat-path-active (the-as plat #f)) @@ -54,31 +49,22 @@ (go-virtual notice-blue (process->handle arg0)) ) (('ridden 'edge-grabbed) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'query) - (set! (-> a1-6 param 0) (the-as uint 'powerup)) - (set! (-> a1-6 param 1) (the-as uint 3)) - (when (send-event-function *target* a1-6) - (send-to-all (-> self link) 'wake) - (go-virtual plat-path-active (the-as plat #f)) - ) + (when (send-event *target* 'query 'powerup (pickup-type eco-blue)) + (send-to-all (-> self link) 'wake) + (go-virtual plat-path-active (the-as plat #f)) ) ) ) ) - :enter - (behavior () + :enter (behavior () (lods-assign! (-> self draw) (-> self unlit-look)) (none) ) - :trans - (behavior () + :trans (behavior () (when (and (and *target* (>= (-> self notice-dist) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) (send-to-all (-> self link) 'wake) (go-virtual plat-path-active (the-as plat #f)) @@ -96,51 +82,32 @@ ) (none) ) - :code - (behavior () + :code (behavior () (ja-post) (update-transforms! (-> self root-override)) (anim-loop) (none) ) - :post - (the-as (function none :behavior plat-eco) ja-post) + :post (the-as (function none :behavior plat-eco) ja-post) ) (defstate notice-blue (plat-eco) :virtual override - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('wake) - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) (go-virtual plat-path-active (the-as plat #f)) ) (('ridden 'edge-grabbed) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'powerup)) - (set! (-> a1-3 param 1) (the-as uint 3)) - (when (send-event-function *target* a1-3) - (send-to-all (-> self link) 'wake) - (go-virtual plat-path-active (the-as plat #f)) - ) + (when (send-event *target* 'query 'powerup (pickup-type eco-blue)) + (send-to-all (-> self link) 'wake) + (go-virtual plat-path-active (the-as plat #f)) ) ) ) ) - :trans - (behavior () + :trans (behavior () ((-> (method-of-object self plat-idle) trans)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) @@ -156,10 +123,9 @@ ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (set! (-> self target) arg0) - (while #t + (loop (let* ((gp-0 (handle->process (-> self target))) (v1-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) gp-0 @@ -211,8 +177,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (plat-trans) (plat-post) (none) @@ -221,8 +186,7 @@ (defstate plat-path-active (plat-eco) :virtual #t - :enter - (behavior ((arg0 plat)) + :enter (behavior ((arg0 plat)) (lods-assign! (-> self draw) (-> self lit-look)) (sync-now! (-> self sync) (-> self sync-linear-val)) (set! (-> self sync-offset-faux) (-> self sync offset)) @@ -252,12 +216,9 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (when (!= (-> self sync-offset-faux) (-> self sync-offset-dest)) - (set! (-> self sync-offset-faux) - (seek (-> self sync-offset-faux) (-> self sync-offset-dest) (* 12.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self sync-offset-faux) (-> self sync-offset-dest) (* 12.0 (-> *display* seconds-per-frame))) (let* ((f0-7 (the float (-> self sync period))) (f1-3 (+ (-> self sync-offset-faux) f0-7)) ) diff --git a/goal_src/levels/common/plat.gc b/goal_src/levels/common/plat.gc index 62be152f6b..0ee4403c3b 100644 --- a/goal_src/levels/common/plat.gc +++ b/goal_src/levels/common/plat.gc @@ -7,18 +7,20 @@ ;; DECOMP BEGINS +(import "goal_src/import/plat-sunken-ag.gc") +(import "goal_src/import/plat-ag.gc") +(import "goal_src/import/plat-jungleb-ag.gc") + (defpartgroup group-standard-plat :id 107 :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 363 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 363 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 364 :fade-after (meters 160) :falloff-to (meters 160)) ) ) (defpart 363 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-flt spt-y (meters 1)) (sp-int spt-rot-x 5) (sp-flt spt-r 5324.8) @@ -35,8 +37,7 @@ ) (defpart 364 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-y (meters 1.5)) (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) @@ -77,29 +78,20 @@ ) -(defskelgroup *plat-sg* plat - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 -0.5 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *plat-sg* plat plat-lod0-jg plat-idle-ja + ((plat-lod0-mg (meters 20)) (plat-lod1-mg (meters 40)) (plat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 -0.5 0 3) + ) -(defskelgroup *plat-jungleb-sg* plat-jungleb - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 -0.5 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *plat-jungleb-sg* plat-jungleb plat-jungleb-lod0-jg plat-jungleb-idle-ja + ((plat-jungleb-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -0.5 0 3) + ) -(defskelgroup *plat-sunken-sg* plat-sunken - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 -0.5 0 3.2) - :longest-edge (meters 0) - ) +(defskelgroup *plat-sunken-sg* plat-sunken plat-sunken-lod0-jg plat-sunken-idle-ja + ((plat-sunken-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -0.5 0 3.2) + ) (defmethod get-unlit-skel plat ((obj plat)) (cond @@ -187,8 +179,7 @@ (defstate plat-startup (plat) :virtual #t - :code - (behavior ((arg0 plat)) + :code (behavior ((arg0 plat)) (cond ((logtest? (-> self path flags) (path-control-flag not-found)) (go-virtual plat-idle) @@ -206,19 +197,16 @@ (defstate plat-idle (plat) :virtual #t - :event - (the-as (function process int symbol event-message-block object :behavior plat) plat-event) - :trans - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior plat) plat-event) + :trans (behavior () (dummy-20 self) (none) ) - :code - (behavior () + :code (behavior () (plat-trans) (rider-post) (suspend) - (while #t + (loop (when (not (-> self bouncing)) (plat-trans) (rider-post) @@ -238,15 +226,12 @@ (defstate plat-path-active (plat) :virtual #t - :event - (the-as (function process int symbol event-message-block object :behavior plat) plat-event) - :exit - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior plat) plat-event) + :exit (behavior () (sound-stop (-> self sound-id)) (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self path-pos) (if (logtest? (-> self fact options) (fact-options wrap-phase)) (get-current-phase (-> self sync)) (get-current-phase-with-mirror (-> self sync)) @@ -254,23 +239,13 @@ ) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) (none) ) - :code - (the-as (function plat none :behavior plat) anim-loop) - :post - (the-as (function none :behavior plat) plat-post) + :code (the-as (function plat none :behavior plat) anim-loop) + :post (the-as (function none :behavior plat) plat-post) ) (defmethod init-from-entity! plat ((obj plat) (arg0 entity-actor)) diff --git a/goal_src/levels/common/rigid-body-h.gc b/goal_src/levels/common/rigid-body-h.gc index 325ece7a2e..f177e2f3b6 100644 --- a/goal_src/levels/common/rigid-body-h.gc +++ b/goal_src/levels/common/rigid-body-h.gc @@ -5,14 +5,15 @@ ;; name in dgo: rigid-body-h ;; dgos: GAME, COMMON, L1 -;; definition of type rigid-body +;; DECOMP BEGINS + (deftype rigid-body (structure) - ((mass float :offset-assert 0) - (inv-mass float :offset-assert 4) - (lin-momentum-damping-factor float :offset-assert 8) - (ang-momentum-damping-factor float :offset-assert 12) - (inertial-tensor matrix :inline :offset-assert 16) - (inv-inertial-tensor matrix :inline :offset-assert 80) + ((mass float :offset-assert 0) + (inv-mass float :offset-assert 4) + (lin-momentum-damping-factor float :offset-assert 8) + (ang-momentum-damping-factor float :offset-assert 12) + (inertial-tensor matrix :inline :offset-assert 16) + (inv-inertial-tensor matrix :inline :offset-assert 80) (cm-offset-joint vector :inline :offset-assert 144) (position vector :inline :offset-assert 160) (rotation quaternion :inline :offset-assert 176) @@ -48,13 +49,20 @@ ) ) -;; definition of type rigid-body-control-point + (deftype rigid-body-control-point (structure) - ((local-pos vector :inline :offset-assert 0) - (world-pos vector :inline :offset-assert 16) - (velocity vector :inline :offset-assert 32) + ((local-pos vector :inline :offset-assert 0) + (world-pos vector :inline :offset-assert 16) + (velocity vector :inline :offset-assert 32) ) :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 ) + + +0 + + + + diff --git a/goal_src/levels/common/rigid-body.gc b/goal_src/levels/common/rigid-body.gc index 75025325b5..14cf8fda6d 100644 --- a/goal_src/levels/common/rigid-body.gc +++ b/goal_src/levels/common/rigid-body.gc @@ -592,7 +592,15 @@ (set! (-> self rbody lin-momentum-damping-factor) (-> self info linear-damping)) (set! (-> self rbody ang-momentum-damping-factor) (-> self info angular-damping)) (if (-> self player-impulse) - (sound-play-by-name (string->sound-name (-> self info sound-name)) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name + (string->sound-name (-> self info sound-name)) + (new-sound-id) + 1024 + 0 + 0 + (sound-group sfx) + #t + ) ) (TODO-RENAME-28 self) (quaternion-copy! (-> self root-overlay quat) (-> self rbody rotation)) @@ -605,8 +613,7 @@ (defstate rigid-body-platform-idle (rigid-body-platform) :virtual #t - :trans - (behavior () + :trans (behavior () (if (and *target* (>= (-> self info idle-distance) (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) ) @@ -615,23 +622,19 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior rigid-body-platform) ja-post) + :post (the-as (function none :behavior rigid-body-platform) ja-post) ) (defstate rigid-body-platform-float (rigid-body-platform) :virtual #t - :event - rigid-body-platform-event-handler - :trans - (behavior () + :event rigid-body-platform-event-handler + :trans (behavior () (if (or (not *target*) (< (-> self info idle-distance) (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) ) @@ -640,15 +643,13 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior rigid-body-platform) rigid-body-platform-post) + :post (the-as (function none :behavior rigid-body-platform) rigid-body-platform-post) ) (defmethod TODO-RENAME-29 rigid-body-platform ((obj rigid-body-platform) (arg0 rigid-body-platform-constants)) diff --git a/goal_src/levels/common/ropebridge.gc b/goal_src/levels/common/ropebridge.gc index fa88f088c6..12857d9f12 100644 --- a/goal_src/levels/common/ropebridge.gc +++ b/goal_src/levels/common/ropebridge.gc @@ -7,6 +7,13 @@ ;; DECOMP BEGINS +(import "goal_src/import/vil3-bridge-36-ag.gc") +(import "goal_src/import/ropebridge-36-ag.gc") +(import "goal_src/import/ropebridge-32-ag.gc") +(import "goal_src/import/ropebridge-52-ag.gc") +(import "goal_src/import/snow-bridge-36-ag.gc") +(import "goal_src/import/ropebridge-70-ag.gc") + (deftype ropebridge-tuning (structure) ((num-springs int32 :offset-assert 0) (num-spring-points int32 :offset-assert 4) @@ -145,14 +152,12 @@ ) ) -(define - *ropebridge-tunings* +(define *ropebridge-tunings* (new 'static 'inline-array ropebridge-tuning 6 (new 'static 'ropebridge-tuning :num-springs 16 :num-spring-points 17 - :col-mesh-indexes - (new 'static 'array uint8 16 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3) + :col-mesh-indexes (new 'static 'array uint8 16 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3) :view-frustum-radius 81920.0 :root-prim-radius 81920.0 :desired-spring-len 4096.0 @@ -173,11 +178,39 @@ (new 'static 'ropebridge-tuning :num-springs 18 :num-spring-points 19 - :col-mesh-indexes - (new 'static 'array uint8 32 - #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 - #x3 #x3 #x3 #x3 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 - #x0 #x0 #x0 #x0 + :col-mesh-indexes (new 'static 'array uint8 32 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 ) :view-frustum-radius 98304.0 :root-prim-radius 98304.0 @@ -199,11 +232,39 @@ (new 'static 'ropebridge-tuning :num-springs 26 :num-spring-points 27 - :col-mesh-indexes - (new 'static 'array uint8 32 - #x3 #x3 #x3 #x3 #x3 #x1 #x4 #x4 #x2 #x3 #x3 #x3 #x3 - #x3 #x3 #x3 #x3 #x3 #x1 #x4 #x4 #x4 #x2 #x3 #x3 #x3 - #x0 #x0 #x0 #x0 #x0 #x0 + :col-mesh-indexes (new 'static 'array uint8 32 + #x3 + #x3 + #x3 + #x3 + #x3 + #x1 + #x4 + #x4 + #x2 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x1 + #x4 + #x4 + #x4 + #x2 + #x3 + #x3 + #x3 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 ) :view-frustum-radius 122880.0 :root-prim-radius 122880.0 @@ -225,12 +286,55 @@ (new 'static 'ropebridge-tuning :num-springs 35 :num-spring-points 36 - :col-mesh-indexes - (new 'static 'array uint8 48 - #x3 #x3 #x3 #x3 #x3 #x1 #x4 #x4 #x2 #x7 #x4 #x4 #x2 #x3 #x3 - #x1 #x4 #x4 #x4 #x2 #x3 #x3 #x3 #x6 #x4 #x4 #x5 #x3 #x3 #x3 - #x3 #x3 #x3 #x3 #x3 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 - #x0 #x0 #x0 + :col-mesh-indexes (new 'static 'array uint8 48 + #x3 + #x3 + #x3 + #x3 + #x3 + #x1 + #x4 + #x4 + #x2 + #x7 + #x4 + #x4 + #x2 + #x3 + #x3 + #x1 + #x4 + #x4 + #x4 + #x2 + #x3 + #x3 + #x3 + #x6 + #x4 + #x4 + #x5 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x3 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 ) :view-frustum-radius 163840.0 :root-prim-radius 163840.0 @@ -252,11 +356,39 @@ (new 'static 'ropebridge-tuning :num-springs 18 :num-spring-points 19 - :col-mesh-indexes - (new 'static 'array uint8 32 - #x3 #x3 #x3 #x3 #x1 #x4 #x4 #x4 #x6 #x3 #x5 #x4 #x4 #x4 - #x2 #x3 #x3 #x3 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 - #x0 #x0 #x0 #x0 + :col-mesh-indexes (new 'static 'array uint8 32 + #x3 + #x3 + #x3 + #x3 + #x1 + #x4 + #x4 + #x4 + #x6 + #x3 + #x5 + #x4 + #x4 + #x4 + #x2 + #x3 + #x3 + #x3 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 ) :view-frustum-radius 98304.0 :root-prim-radius 98304.0 @@ -278,11 +410,39 @@ (new 'static 'ropebridge-tuning :num-springs 18 :num-spring-points 19 - :col-mesh-indexes - (new 'static 'array uint8 32 - #x3 #x3 #x3 #x3 #x1 #x4 #x4 #x2 #x1 #x4 #x4 #x2 #x3 #x1 #x4 - #x4 #x2 #x3 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 - #x0 #x0 + :col-mesh-indexes (new 'static 'array uint8 32 + #x3 + #x3 + #x3 + #x3 + #x1 + #x4 + #x4 + #x2 + #x1 + #x4 + #x4 + #x2 + #x3 + #x1 + #x4 + #x4 + #x2 + #x3 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 ) :view-frustum-radius 98304.0 :root-prim-radius 98304.0 @@ -353,57 +513,44 @@ ) -(defskelgroup *ropebridge-32-sg* ropebridge-32 - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 4) - ) +(defskelgroup *ropebridge-32-sg* ropebridge-32 ropebridge-32-lod0-jg ropebridge-32-idle-ja + ((ropebridge-32-lod0-mg (meters 20)) (ropebridge-32-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 4) + ) -(defskelgroup *snow-bridge-36-sg* snow-bridge-36 - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 3.8) - ) +(defskelgroup *snow-bridge-36-sg* snow-bridge-36 snow-bridge-36-lod0-jg snow-bridge-36-idle-ja + ((snow-bridge-36-lod0-mg (meters 20)) (snow-bridge-36-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 3.8) + ) -(defskelgroup *ropebridge-52-sg* ropebridge-52 - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 3.6) - ) +(defskelgroup *ropebridge-52-sg* ropebridge-52 ropebridge-52-lod0-jg ropebridge-52-idle-ja + ((ropebridge-52-lod0-mg (meters 20)) (ropebridge-52-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 3.6) + ) -(defskelgroup *ropebridge-70-sg* ropebridge-70 - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 3.6) - ) +(defskelgroup *ropebridge-70-sg* ropebridge-70 ropebridge-70-lod0-jg ropebridge-70-idle-ja + ((ropebridge-70-lod0-mg (meters 20)) (ropebridge-70-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 3.6) + ) -(defskelgroup *ropebridge-36-sg* ropebridge-36 - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 4) - ) +(defskelgroup *ropebridge-36-sg* ropebridge-36 ropebridge-36-lod0-jg ropebridge-36-idle-ja + ((ropebridge-36-lod0-mg (meters 20)) (ropebridge-36-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 4) + ) -(defskelgroup *vil3-bridge-36-sg* vil3-bridge-36 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 3.6) - ) +(defskelgroup *vil3-bridge-36-sg* vil3-bridge-36 vil3-bridge-36-lod0-jg vil3-bridge-36-idle-ja + ((vil3-bridge-36-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 3.6) + ) (defstate ropebridge-idle (ropebridge) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((f0-0 -1.0)) (cond ((= arg2 'bonk) @@ -454,9 +601,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) (detect-riders! (-> self root-override)) (when (-> self do-physics?) @@ -467,8 +613,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (let ((gp-0 (-> self root-override))) (update-transforms! gp-0) @@ -482,8 +627,9 @@ ) ) +;; WARN: Expression building failed: Function (method 20 ropebridge) has a return type of none, but the expression builder found a return statement. (defmethod set-vel-from-impact ropebridge ((obj ropebridge) (arg0 uint) (arg1 vector) (arg2 int) (arg3 float)) - (while #t + (loop (let ((f0-2 (fabs (- (-> arg1 z) (-> obj spring-point (the-as int arg0) local-pos z))))) (if (< (-> obj tuning max-bonk-influence-dist) f0-2) (return #f) @@ -548,8 +694,9 @@ (none) ) +;; WARN: Expression building failed: Function (method 22 ropebridge) has a return type of none, but the expression builder found a return statement. (defmethod set-vel-from-rider ropebridge ((obj ropebridge) (arg0 uint) (arg1 vector) (arg2 int)) - (while #t + (loop (let ((f0-0 (vector-vector-distance arg1 (the-as vector (-> obj spring-point (the-as int arg0)))))) (if (< (-> obj tuning max-influence-dist) f0-0) (return #f) @@ -699,7 +846,7 @@ ) (countdown (s3-0 (-> obj tuning num-spring-points)) (vector-matrix*! s4-0 (-> s5-0 local-pos) gp-0) - (add-debug-sphere #t (bucket-id debug-draw0) s4-0 2048.0 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40)) + (add-debug-sphere #t (bucket-id debug) s4-0 2048.0 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40)) (&+! s5-0 48) ) ) diff --git a/goal_src/levels/common/sharkey.gc b/goal_src/levels/common/sharkey.gc index d167bedd1f..7f779eb122 100644 --- a/goal_src/levels/common/sharkey.gc +++ b/goal_src/levels/common/sharkey.gc @@ -7,14 +7,15 @@ ;; DECOMP BEGINS +(import "goal_src/import/sharkey-ag.gc") + (defpartgroup group-sharkey-splash :id 106 :duration 120 :linger-duration 780 :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 124 :flags (is-3d) :period 900 :length 63) + :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) (sp-item 125 :period 900 :length 15) (sp-item 126 :flags (is-3d) :period 900 :length 15) (sp-item 127 :flags (is-3d) :period 900 :length 15) @@ -57,13 +58,10 @@ ) -(defskelgroup *sharkey-sg* sharkey - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *sharkey-sg* sharkey sharkey-lod0-jg sharkey-idle-ja + ((sharkey-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) (defmethod dummy-44 sharkey ((obj sharkey) (arg0 process) (arg1 event-message-block)) (the-as object #t) @@ -158,14 +156,8 @@ nav-enemy-default-event-handler (defbehavior sharkey-notice-player? sharkey () (if *target* (and (< (- (-> *target* control trans y) (-> self y-max)) 0.0) - (let ((gp-0 'racer) - (a1-0 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'mode)) - (!= gp-0 (send-event-function *target* a1-0)) + (let ((gp-0 'racer)) + (!= gp-0 (send-event *target* 'query 'mode)) ) (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos)) ) @@ -221,24 +213,20 @@ nav-enemy-default-event-handler (defstate nav-enemy-idle (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self nav-enemy-flags) (logand -2 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (cond ((-> self enable-patrol) (if (and (and *target* (>= (-> self enemy-info idle-distance) @@ -251,8 +239,8 @@ nav-enemy-default-event-handler ) ) ((sharkey-notice-player?) - (when (zero? (logand (-> self nav-enemy-flags) 1)) - (logior! (-> self nav-enemy-flags) 1) + (when (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf0))) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (set! (-> self notice-time) (-> *display* base-frame-counter)) ) (let ((a0-4 (dummy-16 (-> self nav) (-> *target* control trans)))) @@ -269,33 +257,20 @@ nav-enemy-default-event-handler ) (else (if (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (seconds 10)) - (set! (-> self nav-enemy-flags) (logand -2 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) ) ) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! (-> self draw art-group data (-> self nav-info idle-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (until (= (-> self collide-info trans y) (-> self y-min)) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-loop!) - ) - (set! (-> self anim-speed) (seek (-> self anim-speed) 1.0 0.05)) - (set! (-> self collide-info trans y) - (seek (-> self collide-info trans y) (-> self y-min) (* (-> self y-speed) (-> *display* seconds-per-frame))) - ) + (ja :num! (loop! (-> self anim-speed))) + (seek! (-> self anim-speed) 1.0 0.05) + (seek! (-> self collide-info trans y) (-> self y-min) (* (-> self y-speed) (-> *display* seconds-per-frame))) (dummy-10 (-> self water)) (ja-post) (suspend) @@ -304,53 +279,34 @@ nav-enemy-default-event-handler (anim-loop) (none) ) - :post - (the-as (function none :behavior sharkey) #f) + :post (the-as (function none :behavior sharkey) #f) ) (defstate nav-enemy-patrol (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :trans - (behavior () + :trans (behavior () (if (sharkey-notice-player?) (go-virtual nav-enemy-chase) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (set! (-> self nav target-pos quad) (-> self spawn-point quad)) - (while #t - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-3 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-3 param 1) (-> self anim-speed)) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! - a0-3 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max (-> self anim-speed)) + :frame-num 0.0 + ) (until (ja-done? 0) - (set! (-> self anim-speed) (seek (-> self anim-speed) 1.0 0.05)) + (seek! (-> self anim-speed) 1.0 0.05) (cond ((-> self enable-patrol) - (set! (-> self collide-info trans y) - (seek (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) ) (else (if (< (- (-> self collide-info trans y) (-> self y-min)) 409.6) @@ -359,17 +315,12 @@ nav-enemy-default-event-handler ) ) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (none) ) - :post - (behavior () + :post (behavior () (nav-enemy-travel-post) (none) ) @@ -377,18 +328,15 @@ nav-enemy-default-event-handler (defstate nav-enemy-notice (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (go-virtual nav-enemy-chase) (none) ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-chase) (none) ) @@ -405,108 +353,73 @@ nav-enemy-default-event-handler (defstate nav-enemy-attack (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) (-> *display* base-frame-counter) - (sound-play-by-name (static-sound-name "bigshark-bite") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bigshark-bite") (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> gp-0 quad) (-> self collide-info trans quad)) - (ja-channel-push! 1 30) - (let ((s4-1 (-> self skel root-channel 0))) - (set! (-> s4-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> s4-1 param 0) (ja-aframe 3.0 0)) - (set! (-> s4-1 param 1) 2.0) - (set! (-> s4-1 frame-num) 0.0) - (joint-control-channel-group! s4-1 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! sharkey-chomp-ja :num! (seek! (ja-aframe 3.0 0) 2.0) :frame-num 0.0) (until (ja-done? 0) (sharkey-get-player-position s5-0) (setup-from-to-duration! (-> self jump-trajectory) gp-0 s5-0 3.0 -291.27112) (set! (-> self attack-time) (ja-aframe-num 0)) (sharkey-follow-trajectory (-> self attack-time)) (suspend) - (let ((s4-2 (-> self skel root-channel 0))) - (set! (-> s4-2 param 0) (ja-aframe 3.0 0)) - (set! (-> s4-2 param 1) 2.0) - (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 3.0 0) 2.0)) ) ) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'attack-invinc) - (set! (-> a1-7 param 0) (the-as uint #f)) - (let ((a0-15 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-15 mode) 'sharkey) - (set! (-> a1-7 param 1) (the-as uint a0-15)) - ) - (when (send-event-function *target* a1-7) - (logclear! (-> self mask) (process-mask enemy)) - (vector-float*! (-> self collide-info transv) (-> self collide-info transv) 8.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((f30-0 -409600.0) - (f28-0 (-> self collide-info transv y)) - (f26-0 (-> self collide-info trans y)) + (when (send-event *target* 'attack-invinc #f (static-attack-info ((mode 'sharkey)))) + (logclear! (-> self mask) (process-mask enemy)) + (vector-float*! (-> self collide-info transv) (-> self collide-info transv) 8.0) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (let ((f30-0 -409600.0) + (f28-0 (-> self collide-info transv y)) + (f26-0 (-> self collide-info trans y)) + ) + (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (ja-no-eval :group! sharkey-chomp-ja :num! (seek!) :frame-num (ja-aframe 3.0 0)) + (until (ja-done? 0) + (+! f28-0 (* f30-0 (-> *display* seconds-per-frame))) + (+! f26-0 (* f28-0 (-> *display* seconds-per-frame))) + (set! (-> self collide-info transv y) f28-0) + (when (< (-> self collide-info trans y) (-> self water height)) + (set! f28-0 (* 0.9 f28-0)) + (vector-float*! (-> self collide-info transv) (-> self collide-info transv) 0.9) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) (ja-aframe 3.0 0)) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) - (until (ja-done? 0) - (+! f28-0 (* f30-0 (-> *display* seconds-per-frame))) - (+! f26-0 (* f28-0 (-> *display* seconds-per-frame))) - (set! (-> self collide-info transv y) f28-0) - (when (< (-> self collide-info trans y) (-> self water height)) - (set! f28-0 (* 0.9 f28-0)) - (vector-float*! (-> self collide-info transv) (-> self collide-info transv) 0.9) - ) - (vector-normalize-copy! (-> self dir) (-> self collide-info transv) 1.0) - (forward-up->quaternion (-> self collide-info quat) (-> self dir) *up-vector*) - (integrate-for-enemy-with-move-to-ground! - (-> self collide-info) - (-> self collide-info transv) - (collide-kind background) - 8192.0 - #t - #f - #f - ) - (set! (-> self collide-info trans y) f26-0) - (suspend) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1))) - (set! (-> a0-27 param 1) 1.0) - (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-seek!) - ) + (vector-normalize-copy! (-> self dir) (-> self collide-info transv) 1.0) + (forward-up->quaternion (-> self collide-info quat) (-> self dir) *up-vector*) + (integrate-for-enemy-with-move-to-ground! + (-> self collide-info) + (-> self collide-info transv) + (collide-kind background) + 8192.0 + #t + #f + #f ) + (set! (-> self collide-info trans y) f26-0) + (suspend) + (ja :num! (seek!)) ) ) - (send-event *target* 'end-mode) - (set! (-> self mask) (logior (process-mask enemy) (-> self mask))) ) + (send-event *target* 'end-mode) + (set! (-> self mask) (logior (process-mask enemy) (-> self mask))) ) (sharkey-reset-position) (logior! (-> self draw status) (draw-status hidden)) (go-virtual nav-enemy-idle) (none) ) - :post - (behavior () + :post (behavior () (nav-enemy-simple-post) (none) ) @@ -514,18 +427,15 @@ nav-enemy-default-event-handler (defstate nav-enemy-chase (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self sound-id)) (none) ) - :trans - (behavior () + :trans (behavior () (if (not *target*) (go-virtual nav-enemy-patrol) ) @@ -542,8 +452,8 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-patrol) ) ) - (when (logtest? (-> *target* control status) 2) - (set! (-> self player-in-water) (logtest? (-> *target* control status) 1024)) + (when (logtest? (-> *target* control status) (cshape-moving-flags onground)) + (set! (-> self player-in-water) (logtest? (-> *target* control status) (cshape-moving-flags on-water))) (if (-> self player-in-water) (set! (-> self player-water-time) (-> *display* base-frame-counter)) ) @@ -575,55 +485,35 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self player-water-time) (-> *display* base-frame-counter)) - (ja-channel-push! 1 51) - (sound-play-by-name (static-sound-name "bigshark-idle") (new-sound-id) 1024 0 0 1 #t) - (while #t - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim)))) - (set! (-> a0-3 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-3 param 1) (-> self anim-speed)) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! - a0-3 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.17)) + (sound-play "bigshark-idle") + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info run-anim)) + :num! (seek! max (-> self anim-speed)) + :frame-num 0.0 + ) (until (ja-done? 0) - (set! (-> self anim-speed) (seek (-> self anim-speed) 1.0 (* 3.0 (-> *display* seconds-per-frame)))) + (seek! (-> self anim-speed) 1.0 (* 3.0 (-> *display* seconds-per-frame))) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (none) ) - :post - (behavior () + :post (behavior () (sharkey-get-player-position (-> self nav target-pos)) (nav-enemy-travel-post) (let* ((f3-0 (vector-vector-distance (-> self collide-info trans) (-> self nav target-pos))) (f1-2 (fmax 0.0 (fmin 1.0 (- 1.0 (/ (+ -24576.0 f3-0) (+ -24576.0 (-> self spawn-distance))))))) (f0-2 (+ 0.5 (* 1.5 f1-2))) ) - (sound-play-by-name - (static-sound-name "bigshark-alert") - (-> self sound-id) - 1024 - (the int (* 1524.0 f0-2)) - 0 - 1 - (the-as symbol (-> self collide-info trans)) + (sound-play + "bigshark-alert" + :id (-> self sound-id) + :pitch f0-2 + :position (the-as symbol (-> self collide-info trans)) ) ) (none) @@ -632,43 +522,22 @@ nav-enemy-default-event-handler (defstate nav-enemy-stop-chase (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 51) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-1 param 1) (-> self anim-speed)) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.17)) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max (-> self anim-speed)) + :frame-num 0.0 + ) (until (ja-done? 0) - (set! (-> self anim-speed) (seek (-> self anim-speed) 1.0 0.05)) - (set! (-> self collide-info trans y) - (seek (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> self anim-speed) 1.0 0.05) + (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (none) @@ -677,13 +546,11 @@ nav-enemy-default-event-handler (defstate nav-enemy-stare (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :trans - (behavior () + :trans (behavior () (if (TODO-RENAME-46 self (-> self nav-info notice-distance)) (go-virtual nav-enemy-chase) ) @@ -692,27 +559,14 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 51) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) - (while #t - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-loop!) - ) - (set! (-> self anim-speed) (seek (-> self anim-speed) 1.0 0.05)) - (set! (-> self collide-info trans y) - (seek (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.17)) + (ja :group! (-> self draw art-group data (-> self nav-info idle-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (loop + (ja :num! (loop! (-> self anim-speed))) + (seek! (-> self anim-speed) 1.0 0.05) + (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) (suspend) ) (none) @@ -721,41 +575,20 @@ nav-enemy-default-event-handler (defstate nav-enemy-victory (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (dotimes (gp-0 3) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - ) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) data 0 length) - -1 - ) - ) - ) - (set! (-> a0-1 param 1) (-> self anim-speed)) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info victory-anim)) + :num! (seek! max (-> self anim-speed)) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (go-virtual nav-enemy-stare) @@ -810,7 +643,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -840,7 +673,7 @@ nav-enemy-default-event-handler (TODO-RENAME-45 obj *sharkey-nav-enemy-info*) (logclear! (-> obj mask) (process-mask actor-pause)) (set! (-> obj water) (new 'process 'water-control obj 3 12288.0 8192.0 2048.0)) - (set! (-> obj water flags) (the-as uint #xc00002)) + (set! (-> obj water flags) (water-flags wt01 wt22 wt23)) (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) (set! (-> obj water ripple-size) 20480.0) (set! (-> obj spawn-point quad) (-> obj collide-info trans quad)) diff --git a/goal_src/levels/common/ticky.gc b/goal_src/levels/common/ticky.gc index 5cefae4f81..bd899ac2ce 100644 --- a/goal_src/levels/common/ticky.gc +++ b/goal_src/levels/common/ticky.gc @@ -50,7 +50,7 @@ ) (when (>= (- (-> *display* base-frame-counter) (-> obj last-tick-time)) v1-7) (set! (-> obj last-tick-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "stopwatch") (new-sound-id) 1024 0 0 1 #t) + (sound-play "stopwatch") ) ) ) diff --git a/goal_src/levels/common/tippy.gc b/goal_src/levels/common/tippy.gc index f9c667c028..9a343edd29 100644 --- a/goal_src/levels/common/tippy.gc +++ b/goal_src/levels/common/tippy.gc @@ -5,7 +5,8 @@ ;; name in dgo: tippy ;; dgos: GAME, COMMON, L1 -;; definition of type tippy +;; DECOMP BEGINS + (deftype tippy (structure) ((axis vector :inline :offset-assert 0) (angle float :offset-assert 16) @@ -23,24 +24,8 @@ ) ) -;; definition for method 3 of type tippy -(defmethod inspect tippy ((obj tippy)) - (format #t "[~8x] ~A~%" obj 'tippy) - (format #t "~Taxis: #~%" (-> obj axis)) - (format #t "~Tangle: ~f~%" (-> obj angle)) - (format #t "~Torig: #~%" (-> obj orig)) - (format #t "~Tdist-ratio: ~f~%" (-> obj dist-ratio)) - (format #t "~Tdamping: ~f~%" (-> obj damping)) - (format #t "~T1-damping: ~f~%" (-> obj 1-damping)) - obj - ) -;; definition for method 9 of type tippy -;; INFO: Return type mismatch int vs none. -(defmethod - reset! - tippy - ((obj tippy) (arg0 process-drawable) (arg1 float) (arg2 float)) +(defmethod reset! tippy ((obj tippy) (arg0 process-drawable) (arg1 float) (arg2 float)) (set-vector! (-> obj axis) 0.0 0.0 0.0 1.0) (set! (-> obj angle) 0.0) (quaternion-copy! (-> obj orig) (-> arg0 root quat)) @@ -51,56 +36,41 @@ (none) ) -;; definition for method 10 of type tippy -(defmethod - TODO-RENAME-10 - tippy - ((obj tippy) (arg0 process-drawable) (arg1 vector)) +(defmethod TODO-RENAME-10 tippy ((obj tippy) (arg0 process-drawable) (arg1 vector)) (let ((s4-0 #t)) - (cond - (arg1 - (let ((s3-0 (new 'stack-no-clear 'vector))) - 0.0 - (set! (-> s3-0 x) (- (-> arg1 z) (-> arg0 root trans z))) - (set! (-> s3-0 y) 0.0) - (set! (-> s3-0 z) (- (-> arg0 root trans x) (-> arg1 x))) - (let ((f0-6 (vector-length s3-0))) - (vector-float*! s3-0 s3-0 (/ 1.0 f0-6)) - (let ((f30-0 (* f0-6 (-> obj dist-ratio)))) - (set! - (-> obj axis x) - (+ - (* (-> obj 1-damping) (-> obj axis x)) - (* (-> obj damping) (-> s3-0 x)) + (cond + (arg1 + (let ((s3-0 (new 'stack-no-clear 'vector))) + 0.0 + (set! (-> s3-0 x) (- (-> arg1 z) (-> arg0 root trans z))) + (set! (-> s3-0 y) 0.0) + (set! (-> s3-0 z) (- (-> arg0 root trans x) (-> arg1 x))) + (let ((f0-6 (vector-length s3-0))) + (vector-float*! s3-0 s3-0 (/ 1.0 f0-6)) + (let ((f30-0 (* f0-6 (-> obj dist-ratio)))) + (set! (-> obj axis x) (+ (* (-> obj 1-damping) (-> obj axis x)) (* (-> obj damping) (-> s3-0 x)))) + (set! (-> obj axis y) 0.0) + (set! (-> obj axis z) (+ (* (-> obj 1-damping) (-> obj axis z)) (* (-> obj damping) (-> s3-0 z)))) + (vector-normalize! (-> obj axis) 1.0) + (set! (-> obj angle) (+ (* (-> obj 1-damping) (-> obj angle)) (* (-> obj damping) f30-0))) + ) + ) + ) + ) + (else + (set! (-> obj angle) (* (-> obj 1-damping) (-> obj angle))) + (when (< (-> obj angle) 182.04445) + (set! (-> obj angle) 0.0) + (set! s4-0 #f) ) - ) - (set! (-> obj axis y) 0.0) - (set! - (-> obj axis z) - (+ - (* (-> obj 1-damping) (-> obj axis z)) - (* (-> obj damping) (-> s3-0 z)) - ) - ) - (vector-normalize! (-> obj axis) 1.0) - (set! - (-> obj angle) - (+ (* (-> obj 1-damping) (-> obj angle)) (* (-> obj damping) f30-0)) - ) ) - ) ) - ) - (else - (set! (-> obj angle) (* (-> obj 1-damping) (-> obj angle))) - (when (< (-> obj angle) 182.04445) - (set! (-> obj angle) 0.0) - (set! s4-0 #f) - ) - ) + (quaternion-vector-angle! (-> arg0 root quat) (-> obj axis) (-> obj angle)) + (quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> obj orig)) + s4-0 ) - (quaternion-vector-angle! (-> arg0 root quat) (-> obj axis) (-> obj angle)) - (quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> obj orig)) - s4-0 - ) ) + + + + diff --git a/goal_src/levels/common/water-anim.gc b/goal_src/levels/common/water-anim.gc index 3400e27ff7..1082bd9943 100644 --- a/goal_src/levels/common/water-anim.gc +++ b/goal_src/levels/common/water-anim.gc @@ -7,6 +7,23 @@ ;; DECOMP BEGINS +(import "goal_src/import/water-anim-maincave-ag.gc") +(import "goal_src/import/water-anim-village3-ag.gc") +(import "goal_src/import/water-anim-finalboss-ag.gc") +(import "goal_src/import/water-anim-maincave-water-ag.gc") +(import "goal_src/import/water-anim-sunken-ag.gc") +(import "goal_src/import/water-anim-lavatube-ag.gc") +(import "goal_src/import/water-anim-robocave-ag.gc") +(import "goal_src/import/water-anim-jungle-ag.gc") +(import "goal_src/import/water-anim-ogre-ag.gc") +(import "goal_src/import/water-anim-training-ag.gc") +(import "goal_src/import/water-anim-darkcave-ag.gc") +(import "goal_src/import/water-anim-village1-ag.gc") +(import "goal_src/import/water-anim-rolling-ag.gc") +(import "goal_src/import/water-anim-misty-ag.gc") +(import "goal_src/import/water-anim-sunken-dark-eco-ag.gc") +(import "goal_src/import/water-anim-village2-ag.gc") + (deftype water-anim (water-vol) ((ppointer-water-anim (pointer water-anim) :offset 24) (look int32 :offset-assert 212) @@ -19,389 +36,245 @@ ) -(defskelgroup *water-anim-sunken-dark-eco-qbert-sg* water-anim-sunken-dark-eco - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 40) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-dark-eco-qbert-sg* water-anim-sunken-dark-eco water-anim-sunken-dark-eco-qbert-lod0-jg -1 + ((water-anim-sunken-dark-eco-qbert-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 40) + ) -(defskelgroup *water-anim-sunken-dark-eco-platform-room-sg* water-anim-sunken-dark-eco - 2 - -1 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 22) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-dark-eco-platform-room-sg* water-anim-sunken-dark-eco water-anim-sunken-dark-eco-platform-room-lod0-jg -1 + ((water-anim-sunken-dark-eco-platform-room-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 22) + ) -(defskelgroup *water-anim-sunken-dark-eco-helix-room-sg* water-anim-sunken-dark-eco - 4 - -1 - ((5 (meters 999999))) - :bounds (static-spherem 0 0 0 21) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-dark-eco-helix-room-sg* water-anim-sunken-dark-eco water-anim-sunken-dark-eco-helix-room-lod0-jg -1 + ((water-anim-sunken-dark-eco-helix-room-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 21) + ) -(defskelgroup *water-anim-sunken-big-room-sg* water-anim-sunken - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 15 0 -36 70) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-big-room-sg* water-anim-sunken water-anim-sunken-big-room-lod0-jg -1 + ((water-anim-sunken-big-room-lod0-mg (meters 999999))) + :bounds (static-spherem 15 0 -36 70) + ) -(defskelgroup *water-anim-sunken-first-room-from-entrance-sg* water-anim-sunken - 2 - -1 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 50) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-first-room-from-entrance-sg* water-anim-sunken water-anim-sunken-first-room-from-entrance-lod0-jg -1 + ((water-anim-sunken-first-room-from-entrance-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + ) -(defskelgroup *water-anim-sunken-qbert-room-sg* water-anim-sunken - 4 - -1 - ((5 (meters 999999))) - :bounds (static-spherem 0 0 0 48) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-qbert-room-sg* water-anim-sunken water-anim-sunken-qbert-room-lod0-jg -1 + ((water-anim-sunken-qbert-room-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 48) + ) -(defskelgroup *water-anim-sunken-first-right-branch-sg* water-anim-sunken - 6 - -1 - ((7 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-first-right-branch-sg* water-anim-sunken water-anim-sunken-first-right-branch-lod0-jg -1 + ((water-anim-sunken-first-right-branch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) -(defskelgroup *water-anim-sunken-circular-with-bullys-sg* water-anim-sunken - 8 - -1 - ((9 (meters 999999))) - :bounds (static-spherem 0 0 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-circular-with-bullys-sg* water-anim-sunken water-anim-sunken-circular-with-bullys-lod0-jg -1 + ((water-anim-sunken-circular-with-bullys-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) -(defskelgroup *water-anim-sunken-hall-with-one-whirlpool-sg* water-anim-sunken - 10 - -1 - ((11 (meters 999999))) - :bounds (static-spherem 0 0 0 27) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-hall-with-one-whirlpool-sg* water-anim-sunken water-anim-sunken-hall-with-one-whirlpool-lod0-jg -1 + ((water-anim-sunken-hall-with-one-whirlpool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 27) + ) -(defskelgroup *water-anim-sunken-hall-with-three-whirlpools-sg* water-anim-sunken - 12 - -1 - ((13 (meters 999999))) - :bounds (static-spherem 0 0 0 26) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-hall-with-three-whirlpools-sg* water-anim-sunken water-anim-sunken-hall-with-three-whirlpools-lod0-jg -1 + ((water-anim-sunken-hall-with-three-whirlpools-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 26) + ) -(defskelgroup *water-anim-sunken-start-of-helix-slide-sg* water-anim-sunken - 14 - -1 - ((15 (meters 999999))) - :bounds (static-spherem 0 0 0 25) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-start-of-helix-slide-sg* water-anim-sunken water-anim-sunken-start-of-helix-slide-lod0-jg -1 + ((water-anim-sunken-start-of-helix-slide-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) -(defskelgroup *water-anim-sunken-room-above-exit-chamber-sg* water-anim-sunken - 16 - -1 - ((17 (meters 999999))) - :bounds (static-spherem 0 0 0 45) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-room-above-exit-chamber-sg* water-anim-sunken water-anim-sunken-room-above-exit-chamber-lod0-jg -1 + ((water-anim-sunken-room-above-exit-chamber-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 45) + ) -(defskelgroup *water-anim-sunken-hall-before-big-room-sg* water-anim-sunken - 18 - -1 - ((19 (meters 999999))) - :bounds (static-spherem 5 0 -3 24) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-hall-before-big-room-sg* water-anim-sunken water-anim-sunken-hall-before-big-room-lod0-jg -1 + ((water-anim-sunken-hall-before-big-room-lod0-mg (meters 999999))) + :bounds (static-spherem 5 0 -3 24) + ) -(defskelgroup *water-anim-sunken-short-piece-sg* water-anim-sunken - 20 - -1 - ((21 (meters 999999))) - :bounds (static-spherem 0 0 0 20) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-short-piece-sg* water-anim-sunken water-anim-sunken-short-piece-lod0-jg -1 + ((water-anim-sunken-short-piece-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) -(defskelgroup *water-anim-sunken-big-room-upper-water-sg* water-anim-sunken - 22 - -1 - ((23 (meters 999999))) - :bounds (static-spherem 0 0 0 27) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-big-room-upper-water-sg* water-anim-sunken water-anim-sunken-big-room-upper-water-lod0-jg -1 + ((water-anim-sunken-big-room-upper-water-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 27) + ) -(defskelgroup *water-anim-maincave-center-pool-sg* water-anim-maincave - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 70) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-maincave-center-pool-sg* water-anim-maincave water-anim-maincave-center-pool-lod0-jg -1 + ((water-anim-maincave-center-pool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 70) + ) -(defskelgroup *water-anim-maincave-lower-right-pool-sg* water-anim-maincave - 2 - -1 - ((3 (meters 999999))) - :bounds (static-spherem 6 0 5 61) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-maincave-lower-right-pool-sg* water-anim-maincave water-anim-maincave-lower-right-pool-lod0-jg -1 + ((water-anim-maincave-lower-right-pool-lod0-mg (meters 999999))) + :bounds (static-spherem 6 0 5 61) + ) -(defskelgroup *water-anim-maincave-mid-right-pool-sg* water-anim-maincave - 4 - -1 - ((5 (meters 999999))) - :bounds (static-spherem 0 0 0 37) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-maincave-mid-right-pool-sg* water-anim-maincave water-anim-maincave-mid-right-pool-lod0-jg -1 + ((water-anim-maincave-mid-right-pool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 37) + ) -(defskelgroup *water-anim-maincave-lower-left-pool-sg* water-anim-maincave - 6 - -1 - ((7 (meters 999999))) - :bounds (static-spherem -1 0 0 20) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-maincave-lower-left-pool-sg* water-anim-maincave water-anim-maincave-lower-left-pool-lod0-jg -1 + ((water-anim-maincave-lower-left-pool-lod0-mg (meters 999999))) + :bounds (static-spherem -1 0 0 20) + ) -(defskelgroup *water-anim-maincave-mid-left-pool-sg* water-anim-maincave - 8 - -1 - ((9 (meters 999999))) - :bounds (static-spherem 0 0 0 51) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-maincave-mid-left-pool-sg* water-anim-maincave water-anim-maincave-mid-left-pool-lod0-jg -1 + ((water-anim-maincave-mid-left-pool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 51) + ) -(defskelgroup *water-anim-maincave-water-with-crystal-sg* water-anim-maincave-water - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 -3 22) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-maincave-water-with-crystal-sg* water-anim-maincave-water water-anim-maincave-water-with-crystal-lod0-jg -1 + ((water-anim-maincave-water-with-crystal-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -3 22) + ) -(defskelgroup *water-anim-robocave-main-pool-sg* water-anim-robocave - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 54) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-robocave-main-pool-sg* water-anim-robocave water-anim-robocave-main-pool-lod0-jg -1 + ((water-anim-robocave-main-pool-lod0-mg (meters 20)) (water-anim-robocave-main-pool-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 54) + ) -(defskelgroup *water-anim-misty-mud-by-arena-sg* water-anim-misty - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 -2.5 19) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-by-arena-sg* water-anim-misty water-anim-misty-mud-by-arena-lod0-jg -1 + ((water-anim-misty-mud-by-arena-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -2.5 19) + ) -(defskelgroup *water-anim-misty-mud-above-skeleton-sg* water-anim-misty - 2 - -1 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 14) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-above-skeleton-sg* water-anim-misty water-anim-misty-mud-above-skeleton-lod0-jg -1 + ((water-anim-misty-mud-above-skeleton-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 14) + ) -(defskelgroup *water-anim-misty-mud-behind-skeleton-sg* water-anim-misty - 4 - -1 - ((5 (meters 999999))) - :bounds (static-spherem 0 0 4 25) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-behind-skeleton-sg* water-anim-misty water-anim-misty-mud-behind-skeleton-lod0-jg -1 + ((water-anim-misty-mud-behind-skeleton-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 4 25) + ) -(defskelgroup *water-anim-misty-mud-above-skull-back-sg* water-anim-misty - 6 - -1 - ((7 (meters 999999))) - :bounds (static-spherem 0 0 0 14) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-above-skull-back-sg* water-anim-misty water-anim-misty-mud-above-skull-back-lod0-jg -1 + ((water-anim-misty-mud-above-skull-back-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 14) + ) -(defskelgroup *water-anim-misty-mud-above-skull-front-sg* water-anim-misty - 8 - -1 - ((9 (meters 999999))) - :bounds (static-spherem 0 0 0 16) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-above-skull-front-sg* water-anim-misty water-anim-misty-mud-above-skull-front-lod0-jg -1 + ((water-anim-misty-mud-above-skull-front-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 16) + ) -(defskelgroup *water-anim-misty-mud-other-near-skull-sg* water-anim-misty - 10 - -1 - ((11 (meters 999999))) - :bounds (static-spherem 0 0 0 13) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-other-near-skull-sg* water-anim-misty water-anim-misty-mud-other-near-skull-lod0-jg -1 + ((water-anim-misty-mud-other-near-skull-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 13) + ) -(defskelgroup *water-anim-misty-mud-near-skull-sg* water-anim-misty - 12 - -1 - ((13 (meters 999999))) - :bounds (static-spherem 0 0 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-near-skull-sg* water-anim-misty water-anim-misty-mud-near-skull-lod0-jg -1 + ((water-anim-misty-mud-near-skull-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) -(defskelgroup *water-anim-misty-mud-under-spine-sg* water-anim-misty - 14 - -1 - ((15 (meters 999999))) - :bounds (static-spherem 0 0 0 16) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-under-spine-sg* water-anim-misty water-anim-misty-mud-under-spine-lod0-jg -1 + ((water-anim-misty-mud-under-spine-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 16) + ) -(defskelgroup *water-anim-misty-mud-by-dock-sg* water-anim-misty - 16 - -1 - ((17 (meters 999999))) - :bounds (static-spherem 0 0 0 21) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-by-dock-sg* water-anim-misty water-anim-misty-mud-by-dock-lod0-jg -1 + ((water-anim-misty-mud-by-dock-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 21) + ) -(defskelgroup *water-anim-misty-mud-island-near-dock-sg* water-anim-misty - 18 - -1 - ((19 (meters 999999))) - :bounds (static-spherem -1 0 -1 15) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-island-near-dock-sg* water-anim-misty water-anim-misty-mud-island-near-dock-lod0-jg -1 + ((water-anim-misty-mud-island-near-dock-lod0-mg (meters 999999))) + :bounds (static-spherem -1 0 -1 15) + ) -(defskelgroup *water-anim-misty-mud-lonely-island-sg* water-anim-misty - 20 - -1 - ((21 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-lonely-island-sg* water-anim-misty water-anim-misty-mud-lonely-island-lod0-jg -1 + ((water-anim-misty-mud-lonely-island-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) -(defskelgroup *water-anim-misty-dark-eco-pool-sg* water-anim-misty - 22 - -1 - ((23 (meters 999999))) - :bounds (static-spherem 0 0 0 17) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-dark-eco-pool-sg* water-anim-misty water-anim-misty-dark-eco-pool-lod0-jg -1 + ((water-anim-misty-dark-eco-pool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 17) + ) -(defskelgroup *water-anim-ogre-lava-sg* water-anim-ogre - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 112) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-ogre-lava-sg* water-anim-ogre water-anim-ogre-lava-lod0-jg -1 + ((water-anim-ogre-lava-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 112) + ) -(defskelgroup *water-anim-jungle-river-sg* water-anim-jungle - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 91) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-jungle-river-sg* water-anim-jungle water-anim-jungle-river-lod0-jg -1 + ((water-anim-jungle-river-lod0-mg (meters 20)) (water-anim-jungle-river-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 91) + ) -(defskelgroup *water-anim-village3-lava-sg* water-anim-village3 - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 15 0 10 163) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-village3-lava-sg* water-anim-village3 water-anim-village3-lava-lod0-jg -1 + ((water-anim-village3-lava-lod0-mg (meters 20)) (water-anim-village3-lava-lod1-mg (meters 999999))) + :bounds (static-spherem 15 0 10 163) + ) -(defskelgroup *water-anim-training-lake-sg* water-anim-training - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem -18 0 0 52) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-training-lake-sg* water-anim-training water-anim-training-lake-lod0-jg -1 + ((water-anim-training-lake-lod0-mg (meters 999999))) + :bounds (static-spherem -18 0 0 52) + ) -(defskelgroup *water-anim-darkcave-water-with-crystal-sg* water-anim-darkcave - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 19) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-darkcave-water-with-crystal-sg* water-anim-darkcave water-anim-darkcave-water-with-crystal-lod0-jg -1 + ((water-anim-darkcave-water-with-crystal-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 19) + ) -(defskelgroup *water-anim-rolling-water-back-sg* water-anim-rolling - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem -10 0 0 70) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-rolling-water-back-sg* water-anim-rolling water-anim-rolling-water-back-lod0-jg -1 + ((water-anim-rolling-water-back-lod0-mg (meters 999999))) + :bounds (static-spherem -10 0 0 70) + ) -(defskelgroup *water-anim-rolling-water-front-sg* water-anim-rolling - 2 - -1 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 70) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-rolling-water-front-sg* water-anim-rolling water-anim-rolling-water-front-lod0-jg -1 + ((water-anim-rolling-water-front-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 70) + ) -(defskelgroup *water-anim-finalboss-dark-eco-pool-sg* water-anim-finalboss - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 19) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-finalboss-dark-eco-pool-sg* water-anim-finalboss water-anim-finalboss-dark-eco-pool-lod0-jg -1 + ((water-anim-finalboss-dark-eco-pool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 19) + ) -(defskelgroup *water-anim-lavatube-energy-lava-sg* water-anim-lavatube - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 -7 0 25) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-lavatube-energy-lava-sg* water-anim-lavatube water-anim-lavatube-energy-lava-lod0-jg -1 + ((water-anim-lavatube-energy-lava-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -7 0 25) + ) -(defskelgroup *water-anim-village1-rice-paddy-sg* water-anim-village1 - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem -15 0 0 27) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-village1-rice-paddy-sg* water-anim-village1 water-anim-village1-rice-paddy-lod0-jg -1 + ((water-anim-village1-rice-paddy-lod0-mg (meters 999999))) + :bounds (static-spherem -15 0 0 27) + ) -(defskelgroup *water-anim-village1-fountain-sg* water-anim-village1 - 6 - -1 - ((7 (meters 999999))) - :bounds (static-spherem 0 0 0 4.5) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-village1-fountain-sg* water-anim-village1 water-anim-village1-fountain-lod0-jg -1 + ((water-anim-village1-fountain-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.5) + ) -(defskelgroup *water-anim-village1-rice-paddy-mid-sg* water-anim-village1 - 2 - -1 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 35) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-village1-rice-paddy-mid-sg* water-anim-village1 water-anim-village1-rice-paddy-mid-lod0-jg -1 + ((water-anim-village1-rice-paddy-mid-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 35) + ) -(defskelgroup *water-anim-village1-rice-paddy-top-sg* water-anim-village1 - 4 - -1 - ((5 (meters 999999))) - :bounds (static-spherem 6 0 -17 20) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-village1-rice-paddy-top-sg* water-anim-village1 water-anim-village1-rice-paddy-top-lod0-jg -1 + ((water-anim-village1-rice-paddy-top-lod0-mg (meters 999999))) + :bounds (static-spherem 6 0 -17 20) + ) -(defskelgroup *water-anim-village2-bucket-sg* water-anim-village2 - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 0.7) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-village2-bucket-sg* water-anim-village2 water-anim-village2-bucket-lod0-jg -1 + ((water-anim-village2-bucket-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.7) + ) (deftype water-anim-look (structure) ((skel-group symbol :offset-assert 0) @@ -414,340 +287,137 @@ ) -(define - *water-anim-look* +(define *water-anim-look* (the-as (array water-anim-look) - (new - 'static - 'boxed-array - :type water-anim-look :length 48 :allocated-length 48 + (new 'static 'boxed-array :type water-anim-look (new 'static 'water-anim-look :skel-group '*water-anim-sunken-big-room-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 70 - :fo-max 80 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 70 :fo-max 80) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-first-room-from-entrance-sg* + :skel-group '*water-anim-sunken-first-room-from-entrance-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 50 - :fo-max 60 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 50 :fo-max 60) ) (new 'static 'water-anim-look :skel-group '*water-anim-sunken-qbert-room-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 48 - :fo-max 58 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 48 :fo-max 58) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-first-right-branch-sg* + :skel-group '*water-anim-sunken-first-right-branch-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 30 - :fo-max 40 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 30 :fo-max 40) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-circular-with-bullys-sg* + :skel-group '*water-anim-sunken-circular-with-bullys-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 15 - :fo-max 25 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 15 :fo-max 25) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-hall-with-one-whirlpool-sg* + :skel-group '*water-anim-sunken-hall-with-one-whirlpool-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 27 - :fo-max 37 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 27 :fo-max 37) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-hall-with-three-whirlpools-sg* + :skel-group '*water-anim-sunken-hall-with-three-whirlpools-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 26 - :fo-max 36 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 26 :fo-max 36) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-start-of-helix-slide-sg* + :skel-group '*water-anim-sunken-start-of-helix-slide-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 25 - :fo-max 35 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 25 :fo-max 35) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-room-above-exit-chamber-sg* + :skel-group '*water-anim-sunken-room-above-exit-chamber-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 45 - :fo-max 55 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 45 :fo-max 55) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-hall-before-big-room-sg* + :skel-group '*water-anim-sunken-hall-before-big-room-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 20 - :fo-max 30 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 20 :fo-max 30) ) (new 'static 'water-anim-look :skel-group '*water-anim-sunken-dark-eco-qbert-sg* :anim 6 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 40 - :fo-max 50 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 40 :fo-max 50) ) (new 'static 'water-anim-look :skel-group '*water-anim-sunken-short-piece-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 20 - :fo-max 30 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 20 :fo-max 30) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-big-room-upper-water-sg* + :skel-group '*water-anim-sunken-big-room-upper-water-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 27 - :fo-max 37 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 27 :fo-max 37) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-dark-eco-platform-room-sg* + :skel-group '*water-anim-sunken-dark-eco-platform-room-sg* :anim 6 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 22 - :fo-max 32 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 22 :fo-max 32) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-maincave-water-with-crystal-sg* + :skel-group '*water-anim-maincave-water-with-crystal-sg* :anim 2 :ambient-sound-spec #f ) (new 'static 'water-anim-look :skel-group '*water-anim-maincave-center-pool-sg* :anim 10 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 70 - :fo-max 80 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 70 :fo-max 80) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-maincave-lower-right-pool-sg* + :skel-group '*water-anim-maincave-lower-right-pool-sg* :anim 10 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 40 - :fo-max 50 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 40 :fo-max 50) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-maincave-mid-right-pool-sg* + :skel-group '*water-anim-maincave-mid-right-pool-sg* :anim 10 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 37 - :fo-max 47 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 37 :fo-max 47) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-maincave-lower-left-pool-sg* + :skel-group '*water-anim-maincave-lower-left-pool-sg* :anim 10 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 20 - :fo-max 30 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 20 :fo-max 30) ) (new 'static 'water-anim-look :skel-group '*water-anim-maincave-mid-left-pool-sg* :anim 10 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 51 - :fo-max 61 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 51 :fo-max 61) ) (new 'static 'water-anim-look :skel-group '*water-anim-robocave-main-pool-sg* :anim 3 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 54 - :fo-max 64 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 54 :fo-max 64) ) (new 'static 'water-anim-look :skel-group '*water-anim-misty-mud-by-arena-sg* :anim 24 :ambient-sound-spec #f) (new 'static 'water-anim-look - :skel-group - '*water-anim-misty-mud-above-skeleton-sg* + :skel-group '*water-anim-misty-mud-above-skeleton-sg* :anim 24 :ambient-sound-spec #f ) (new 'static 'water-anim-look - :skel-group - '*water-anim-misty-mud-behind-skeleton-sg* + :skel-group '*water-anim-misty-mud-behind-skeleton-sg* :anim 24 :ambient-sound-spec #f ) (new 'static 'water-anim-look - :skel-group - '*water-anim-misty-mud-above-skull-back-sg* + :skel-group '*water-anim-misty-mud-above-skull-back-sg* :anim 24 :ambient-sound-spec #f ) (new 'static 'water-anim-look - :skel-group - '*water-anim-misty-mud-above-skull-front-sg* + :skel-group '*water-anim-misty-mud-above-skull-front-sg* :anim 24 :ambient-sound-spec #f ) (new 'static 'water-anim-look - :skel-group - '*water-anim-misty-mud-other-near-skull-sg* + :skel-group '*water-anim-misty-mud-other-near-skull-sg* :anim 24 :ambient-sound-spec #f ) @@ -763,72 +433,40 @@ ) (new 'static 'water-anim-look :skel-group '*water-anim-misty-mud-by-dock-sg* :anim 24 :ambient-sound-spec #f) (new 'static 'water-anim-look - :skel-group - '*water-anim-misty-mud-island-near-dock-sg* + :skel-group '*water-anim-misty-mud-island-near-dock-sg* :anim 24 :ambient-sound-spec #f ) (new 'static 'water-anim-look - :skel-group - '*water-anim-misty-mud-lonely-island-sg* + :skel-group '*water-anim-misty-mud-lonely-island-sg* :anim 24 :ambient-sound-spec #f ) (new 'static 'water-anim-look :skel-group '*water-anim-misty-dark-eco-pool-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 17 - :fo-max 27 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 17 :fo-max 27) ) (new 'static 'water-anim-look :skel-group '*water-anim-ogre-lava-sg* :anim 2 :ambient-sound-spec #f) (new 'static 'water-anim-look :skel-group '*water-anim-jungle-river-sg* :anim 3 :ambient-sound-spec #f) (new 'static 'water-anim-look :skel-group '*water-anim-village3-lava-sg* :anim 3 :ambient-sound-spec #f) (new 'static 'water-anim-look :skel-group '*water-anim-training-lake-sg* :anim 2 :ambient-sound-spec #f) (new 'static 'water-anim-look - :skel-group - '*water-anim-darkcave-water-with-crystal-sg* + :skel-group '*water-anim-darkcave-water-with-crystal-sg* :anim 2 :ambient-sound-spec #f ) (new 'static 'water-anim-look :skel-group '*water-anim-rolling-water-back-sg* :anim 4 :ambient-sound-spec #f) (new 'static 'water-anim-look :skel-group '*water-anim-rolling-water-front-sg* :anim 4 :ambient-sound-spec #f) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-dark-eco-helix-room-sg* + :skel-group '*water-anim-sunken-dark-eco-helix-room-sg* :anim 6 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "helix-dark-eco") - :volume #x400 - :fo-min #x78 - :fo-max #x82 - ) + :ambient-sound-spec (static-sound-spec "helix-dark-eco" :fo-min 120 :fo-max 130) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-finalboss-dark-eco-pool-sg* + :skel-group '*water-anim-finalboss-dark-eco-pool-sg* :anim 2 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 19 - :fo-max 29 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 19 :fo-max 29) ) (new 'static 'water-anim-look :skel-group '*water-anim-lavatube-energy-lava-sg* @@ -838,14 +476,12 @@ (new 'static 'water-anim-look :skel-group '*water-anim-village1-rice-paddy-sg* :anim 8 :ambient-sound-spec #f) (new 'static 'water-anim-look :skel-group '*water-anim-village1-fountain-sg* :anim 8 :ambient-sound-spec #f) (new 'static 'water-anim-look - :skel-group - '*water-anim-village1-rice-paddy-mid-sg* + :skel-group '*water-anim-village1-rice-paddy-mid-sg* :anim 8 :ambient-sound-spec #f ) (new 'static 'water-anim-look - :skel-group - '*water-anim-village1-rice-paddy-top-sg* + :skel-group '*water-anim-village1-rice-paddy-top-sg* :anim 8 :ambient-sound-spec #f ) @@ -856,8 +492,7 @@ (defstate water-vol-idle (water-anim) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'move-to) (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) @@ -873,8 +508,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (let ((t9-0 (-> (method-of-type water-vol water-vol-idle) trans))) (if t9-0 (t9-0) @@ -889,9 +523,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (ja-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -921,11 +554,11 @@ ) ) (let ((f0-6 (res-lump-float (-> obj entity) 'rotoffset))) - (the-as object (if (!= f0-6 0.0) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-6) - ) - ) + (if (!= f0-6 0.0) + (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-6) + ) ) + (none) ) (defmethod TODO-RENAME-22 water-anim ((obj water-anim)) diff --git a/goal_src/levels/darkcave/darkcave-obs.gc b/goal_src/levels/darkcave/darkcave-obs.gc index da1ff883a8..c91cc200cf 100644 --- a/goal_src/levels/darkcave/darkcave-obs.gc +++ b/goal_src/levels/darkcave/darkcave-obs.gc @@ -5,10 +5,10 @@ ;; name in dgo: darkcave-obs ;; dgos: DAR, L1 -; (define-extern *cavecrystal-sg* skeleton-group) - ;; DECOMP BEGINS +(import "goal_src/import/cavecrystal-ag.gc") + (deftype cavecrystal (process-drawable) ((root-override collide-shape :offset 112) (is-master? symbol :offset-assert 176) @@ -42,13 +42,10 @@ ) -(defskelgroup *cavecrystal-sg* cavecrystal - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 4.7 0 5.4) - :longest-edge (meters 0) - ) +(defskelgroup *cavecrystal-sg* cavecrystal cavecrystal-lod0-jg -1 + ((cavecrystal-lod0-mg (meters 20)) (cavecrystal-lod1-mg (meters 999999))) + :bounds (static-spherem 0 4.7 0 5.4) + ) (defmethod update-connected-crystals! cavecrystal ((obj cavecrystal)) (when (-> obj is-master?) @@ -73,13 +70,13 @@ (f30-1 (* 0.1 (cos (* 65536.0 f0-2)))) ) (cond - ((>= (seconds 0.06666667) gp-1) + ((>= (seconds 0.067) gp-1) (let ((v1-11 (* 0.05 (the float gp-1)))) (fmax 0.0 (fmin 2.0 (+ (* 2.0 v1-11) (* v1-11 f30-1)))) ) ) ((>= (seconds 0.6) gp-1) - (let ((a2-0 (* 0.00625 (the float (+ gp-1 (seconds -0.06666667)))))) + (let ((a2-0 (* 0.00625 (the float (+ gp-1 (seconds -0.067)))))) (fmin 2.0 (+ (lerp 2.0 1.0 a2-0) f30-1)) ) ) @@ -96,16 +93,14 @@ ) (defstate cavecrystal-idle (cavecrystal) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (go cavecrystal-active) ) ) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (level-hint-spawn (game-text-id darkcave-light-crystal-hint) @@ -118,8 +113,7 @@ (update-connected-crystals! self) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -128,8 +122,7 @@ ) (defstate cavecrystal-active (cavecrystal) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'attack) (let ((v1-1 (-> arg3 param 2))) @@ -148,23 +141,20 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self activated-time) (-> *display* game-frame-counter)) (set! (-> self prev-compute-glow-time) (-> *display* game-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (if (not (-> self is-master?)) (logior! (-> self mask) (process-mask actor-pause)) ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (compute-glow self))) (set! (-> self glow-u) f30-0) (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -203,8 +193,7 @@ (update! (-> self sound)) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -270,19 +259,8 @@ (ja-post) (update-transforms! (-> obj root-override)) (TODO-RENAME-9 *cavecrystal-light-control* (-> obj crystal-id) 0.0 obj) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "crystal-on") - :volume #x400 - :fo-max 80 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "crystal-on" :fo-max 80) (-> obj root-override trans)) ) (go cavecrystal-idle) (none) diff --git a/goal_src/levels/demo/demo-obs.gc b/goal_src/levels/demo/demo-obs.gc index f0beab9891..1b7dd64ae4 100644 --- a/goal_src/levels/demo/demo-obs.gc +++ b/goal_src/levels/demo/demo-obs.gc @@ -5,38 +5,69 @@ ;; name in dgo: demo-obs ;; dgos: DEM, L1 -(define-extern static-screen-spawn (function int int int int int symbol target (pointer process))) ;; target may differ +(define-extern static-screen-spawn (function int texture-id texture-id texture-id time-frame symbol process-tree (pointer static-screen))) ;; DECOMP BEGINS (defstate target-demo (target) - :event - target-generic-event-handler - :code - (behavior () + :event target-generic-event-handler + :code (behavior () (if *time-of-day-proc* (set! (-> *time-of-day-proc* 0 hour) 12) ) - (set-setting! *setting-control* self 'allow-pause #f 0.0 0) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) - (copy-settings-from-target! *setting-control*) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (apply-settings *setting-control*) (ja-channel-set! 0) (ja-post) (load-state-want-levels 'demo 'village1) (load-state-want-vis 'vi1) (case (scf-get-territory) ((2) - (let ((gp-0 (ppointer->handle (static-screen-spawn 6 #x27c00000 #x27c00100 #x27c00200 1500 #f self)))) + (let ((gp-0 (ppointer->handle (static-screen-spawn + 6 + (new 'static 'texture-id :page #x27c) + (new 'static 'texture-id :index #x1 :page #x27c) + (new 'static 'texture-id :index #x2 :page #x27c) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-0) (suspend) ) ) - (let ((gp-1 (ppointer->handle (static-screen-spawn 7 #x27d00000 #x27d00100 #x27d00200 1500 #f self)))) + (let ((gp-1 (ppointer->handle (static-screen-spawn + 7 + (new 'static 'texture-id :page #x27d) + (new 'static 'texture-id :index #x1 :page #x27d) + (new 'static 'texture-id :index #x2 :page #x27d) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-1) (suspend) ) ) - (let ((gp-2 (ppointer->handle (static-screen-spawn 8 #x2f000000 #x2f000100 #x2f000200 #x4650 #t self)))) + (let ((gp-2 (ppointer->handle (static-screen-spawn + 8 + (new 'static 'texture-id :page #x2f0) + (new 'static 'texture-id :index #x1 :page #x2f0) + (new 'static 'texture-id :index #x2 :page #x2f0) + (seconds 60) + #t + self + ) + ) + ) + ) (while (handle->process gp-2) (suspend) ) @@ -45,77 +76,198 @@ ((1) (case (-> *setting-control* current language) (((language-enum french)) - (let ((gp-3 (ppointer->handle (static-screen-spawn 10 #x63f00000 #x63f00100 #x63f00200 1500 #f self)))) + (let ((gp-3 (ppointer->handle (static-screen-spawn + 10 + (new 'static 'texture-id :page #x63f) + (new 'static 'texture-id :index #x1 :page #x63f) + (new 'static 'texture-id :index #x2 :page #x63f) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-3) (suspend) ) ) ) (((language-enum german)) - (let ((gp-4 (ppointer->handle (static-screen-spawn 11 #x64000000 #x64000100 #x64000200 1500 #f self)))) + (let ((gp-4 (ppointer->handle (static-screen-spawn + 11 + (new 'static 'texture-id :page #x640) + (new 'static 'texture-id :index #x1 :page #x640) + (new 'static 'texture-id :index #x2 :page #x640) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-4) (suspend) ) ) ) (((language-enum italian)) - (let ((gp-5 (ppointer->handle (static-screen-spawn 12 #x64100000 #x64100100 #x64100200 1500 #f self)))) + (let ((gp-5 (ppointer->handle (static-screen-spawn + 12 + (new 'static 'texture-id :page #x641) + (new 'static 'texture-id :index #x1 :page #x641) + (new 'static 'texture-id :index #x2 :page #x641) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-5) (suspend) ) ) ) (((language-enum spanish)) - (let ((gp-6 (ppointer->handle (static-screen-spawn 13 #x64200000 #x64200100 #x64200200 1500 #f self)))) + (let ((gp-6 (ppointer->handle (static-screen-spawn + 13 + (new 'static 'texture-id :page #x642) + (new 'static 'texture-id :index #x1 :page #x642) + (new 'static 'texture-id :index #x2 :page #x642) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-6) (suspend) ) ) ) (else - (let ((gp-7 (ppointer->handle (static-screen-spawn 2 #x5cd00000 #x5cd00100 #x5cd00200 1500 #f self)))) + (let ((gp-7 (ppointer->handle (static-screen-spawn + 2 + (new 'static 'texture-id :page #x5cd) + (new 'static 'texture-id :index #x1 :page #x5cd) + (new 'static 'texture-id :index #x2 :page #x5cd) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-7) (suspend) ) ) ) ) - (let ((gp-8 (ppointer->handle (static-screen-spawn 3 #x5ce00000 #x5ce00100 #x5ce00200 1500 #f self)))) + (let ((gp-8 (ppointer->handle (static-screen-spawn + 3 + (new 'static 'texture-id :page #x5ce) + (new 'static 'texture-id :index #x1 :page #x5ce) + (new 'static 'texture-id :index #x2 :page #x5ce) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-8) (suspend) ) ) (case (-> *setting-control* current language) (((language-enum french)) - (let ((gp-9 (ppointer->handle (static-screen-spawn 15 #x64400000 #x64400100 #x64400200 #x4650 #t self)))) + (let ((gp-9 (ppointer->handle (static-screen-spawn + 15 + (new 'static 'texture-id :page #x644) + (new 'static 'texture-id :index #x1 :page #x644) + (new 'static 'texture-id :index #x2 :page #x644) + (seconds 60) + #t + self + ) + ) + ) + ) (while (handle->process gp-9) (suspend) ) ) ) (((language-enum german)) - (let ((gp-10 (ppointer->handle (static-screen-spawn 16 #x64500000 #x64500100 #x64500200 #x4650 #t self)))) + (let ((gp-10 (ppointer->handle (static-screen-spawn + 16 + (new 'static 'texture-id :page #x645) + (new 'static 'texture-id :index #x1 :page #x645) + (new 'static 'texture-id :index #x2 :page #x645) + (seconds 60) + #t + self + ) + ) + ) + ) (while (handle->process gp-10) (suspend) ) ) ) (((language-enum italian)) - (let ((gp-11 (ppointer->handle (static-screen-spawn 17 #x64600000 #x64600100 #x64600200 #x4650 #t self)))) + (let ((gp-11 (ppointer->handle (static-screen-spawn + 17 + (new 'static 'texture-id :page #x646) + (new 'static 'texture-id :index #x1 :page #x646) + (new 'static 'texture-id :index #x2 :page #x646) + (seconds 60) + #t + self + ) + ) + ) + ) (while (handle->process gp-11) (suspend) ) ) ) (((language-enum spanish)) - (let ((gp-12 (ppointer->handle (static-screen-spawn 18 #x64700000 #x64700100 #x64700200 #x4650 #t self)))) + (let ((gp-12 (ppointer->handle (static-screen-spawn + 18 + (new 'static 'texture-id :page #x647) + (new 'static 'texture-id :index #x1 :page #x647) + (new 'static 'texture-id :index #x2 :page #x647) + (seconds 60) + #t + self + ) + ) + ) + ) (while (handle->process gp-12) (suspend) ) ) ) (else - (let ((gp-13 (ppointer->handle (static-screen-spawn 14 #x64300000 #x64300100 #x64300200 #x4650 #t self)))) + (let ((gp-13 (ppointer->handle (static-screen-spawn + 14 + (new 'static 'texture-id :page #x643) + (new 'static 'texture-id :index #x1 :page #x643) + (new 'static 'texture-id :index #x2 :page #x643) + (seconds 60) + #t + self + ) + ) + ) + ) (while (handle->process gp-13) (suspend) ) @@ -124,43 +276,67 @@ ) ) (else - (let ((gp-14 (ppointer->handle (static-screen-spawn 2 #x5cd00000 #x5cd00100 #x5cd00200 1500 #f self)))) + (let ((gp-14 (ppointer->handle (static-screen-spawn + 2 + (new 'static 'texture-id :page #x5cd) + (new 'static 'texture-id :index #x1 :page #x5cd) + (new 'static 'texture-id :index #x2 :page #x5cd) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-14) (suspend) ) ) - (let ((gp-15 (ppointer->handle (static-screen-spawn 3 #x5ce00000 #x5ce00100 #x5ce00200 1500 #f self)))) + (let ((gp-15 (ppointer->handle (static-screen-spawn + 3 + (new 'static 'texture-id :page #x5ce) + (new 'static 'texture-id :index #x1 :page #x5ce) + (new 'static 'texture-id :index #x2 :page #x5ce) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-15) (suspend) ) ) - (let ((gp-16 (ppointer->handle (static-screen-spawn 4 #x5cf00000 #x5cf00100 #x5cf00200 #x4650 #t self)))) + (let ((gp-16 (ppointer->handle (static-screen-spawn + 4 + (new 'static 'texture-id :page #x5cf) + (new 'static 'texture-id :index #x1 :page #x5cf) + (new 'static 'texture-id :index #x2 :page #x5cf) + (seconds 60) + #t + self + ) + ) + ) + ) (while (handle->process gp-16) (suspend) ) ) ) ) - (let ((gp-17 (get-process *default-dead-pool* process #x4000))) - (when gp-17 - (let ((t9-26 (method-of-type process activate))) - (t9-26 gp-17 *default-pool* 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process gp-17 (lambda () - (set! (-> *setting-control* default bg-a) 0.0) - (start 'play (get-continue-by-name *game-info* "village1-demo-convo")) - ) - ) - (-> gp-17 ppointer) - ) - ) - (while #t + (process-spawn-function process (lambda () + (set! (-> *setting-control* default bg-a) 0.0) + (start 'play (get-continue-by-name *game-info* "village1-demo-convo")) + ) + ) + (loop (suspend) ) (none) ) - :post - target-no-move-post + :post target-no-move-post ) diff --git a/goal_src/levels/demo/static-screen.gc b/goal_src/levels/demo/static-screen.gc index 6a9c4e341d..52112b91d4 100644 --- a/goal_src/levels/demo/static-screen.gc +++ b/goal_src/levels/demo/static-screen.gc @@ -49,8 +49,7 @@ ) (defpart 2966 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x5c6)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x5c6)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1.18)) (sp-flt spt-scale-x (meters 15)) @@ -65,8 +64,7 @@ ) (defpart 2967 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x5c6)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x5c6)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -1.264)) (sp-flt spt-scale-x (meters 15)) @@ -81,8 +79,7 @@ ) (defpart 2968 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x5c6)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x5c6)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -2.482)) (sp-flt spt-scale-x (meters 15)) @@ -100,28 +97,24 @@ :id 707 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2966 :flags (launch-asap)) (sp-item 2967 :flags (launch-asap)) (sp-item 2968 :flags (launch-asap))) + :parts ((sp-item 2966 :flags (launch-asap)) (sp-item 2967 :flags (launch-asap)) (sp-item 2968 :flags (launch-asap))) ) (defstate idle (static-screen) :virtual #t - :enter - (behavior ((arg0 int) (arg1 time-frame) (arg2 symbol)) + :enter (behavior ((arg0 int) (arg1 time-frame) (arg2 symbol)) (set! (-> *setting-control* current bg-a) 1.0) (set! (-> *setting-control* default bg-a) 0.0) - (push-setting! *setting-control* self 'common-page 'set 0.0 (ash 1 (+ arg0 1))) + (add-setting! 'common-page 'set 0.0 (ash 1 (+ arg0 1))) (none) ) - :trans - (behavior () + :trans (behavior () (hide-hud-quick) (spawn (-> self part 0) *zero-vector*) 0 (none) ) - :code - (behavior ((arg0 int) (arg1 time-frame) (arg2 symbol)) + :code (behavior ((arg0 int) (arg1 time-frame) (arg2 symbol)) (local-vars (v1-6 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (until v1-6 @@ -138,14 +131,14 @@ (while (!= (-> *setting-control* current bg-a) (-> *setting-control* default bg-a)) (suspend) ) - (clear-pending-settings-from-process *setting-control* self 'common-page) + (remove-setting! 'common-page) (suspend) 0 (none) ) ) -(defbehavior static-screen-init-by-other static-screen ((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 time-frame) (arg5 symbol)) +(defbehavior static-screen-init-by-other static-screen ((arg0 int) (arg1 texture-id) (arg2 texture-id) (arg3 texture-id) (arg4 time-frame) (arg5 symbol)) (let ((s3-0 (lookup-part-group-by-name "group-part-screen1"))) (when (and s3-0 (nonzero? s3-0) (type-type? (-> s3-0 type) sparticle-launch-group)) (set! (-> *part-id-table* 2966 init-specs 0 initial-valuef) (the-as float arg1)) @@ -159,16 +152,15 @@ (none) ) -(defun static-screen-spawn ((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 symbol) (arg6 target)) - (local-vars (sv-16 process)) - (set! sv-16 (get-process *default-dead-pool* static-screen #x4000)) - (when sv-16 - (let ((t9-1 (method-of-type static-screen activate))) - (t9-1 (the-as static-screen sv-16) arg6 'static-screen (the-as pointer #x70004000)) - ) - (run-now-in-process sv-16 static-screen-init-by-other arg0 arg1 arg2 arg3 arg4 arg5) - (-> sv-16 ppointer) - ) +(defun static-screen-spawn ((arg0 int) + (arg1 texture-id) + (arg2 texture-id) + (arg3 texture-id) + (arg4 time-frame) + (arg5 symbol) + (arg6 process-tree) + ) + (process-spawn static-screen arg0 arg1 arg2 arg3 arg4 arg5 :to arg6) ) diff --git a/goal_src/levels/finalboss/final-door.gc b/goal_src/levels/finalboss/final-door.gc index c98cb7bba8..571fd91d7b 100644 --- a/goal_src/levels/finalboss/final-door.gc +++ b/goal_src/levels/finalboss/final-door.gc @@ -9,6 +9,10 @@ ;; DECOMP BEGINS +(import "goal_src/import/power-left-ag.gc") +(import "goal_src/import/power-right-ag.gc") +(import "goal_src/import/powercellalt-ag.gc") + (deftype fin-door (process-hidden) () :method-count-assert 15 @@ -31,42 +35,31 @@ ) -(defskelgroup *power-left-sg* power-left - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 11 0 12) - :longest-edge (meters 0) - ) +(defskelgroup *power-left-sg* power-left power-left-lod0-jg power-left-idle-ja + ((power-left-lod0-mg (meters 999999))) + :bounds (static-spherem 0 11 0 12) + ) -(defskelgroup *power-right-sg* power-right - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 11 0 12) - :longest-edge (meters 0) - ) +(defskelgroup *power-right-sg* power-right power-right-lod0-jg power-right-idle-ja + ((power-right-lod0-mg (meters 999999))) + :bounds (static-spherem 0 11 0 12) + ) -(defskelgroup *powercellalt-sg* powercellalt - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *powercellalt-sg* powercellalt powercellalt-lod0-jg powercellalt-idle-ja + ((powercellalt-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) (defstate idle (final-door) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('open) (go-virtual open #f) ) ) ) - :code - (behavior () + :code (behavior () (transform-post) (logior! (-> self mask) (process-mask sleep)) (suspend) @@ -77,8 +70,7 @@ (defstate open (final-door) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'brightness) (let ((f0-0 (the-as float (-> arg3 param 0))) @@ -97,47 +89,22 @@ ) ) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (case (-> self type) ((power-left) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 0.353) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! max 0.353) :frame-num 0.0) (until (ja-done? 0) (transform-post) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 0.353) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.353)) ) ) (else - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 0.353) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! max 0.353) :frame-num 0.0) (until (ja-done? 0) (transform-post) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 0.353) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.353)) ) ) ) @@ -195,12 +162,11 @@ (defstate idle (power-left) :virtual #t - :code - (behavior () + :code (behavior () (ja-post) - (while #t + (loop (if (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (and (zero? (logand (-> *target* state-flags) 256)) + (and (zero? (logand (-> *target* state-flags) (state-flags grabbed))) (and (>= (-> *game-info* fuel) 100.0) (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (= (get-task-status (game-task finalboss-movies)) (task-status need-reward-speech)) @@ -254,9 +220,8 @@ (defstate jump (powercellalt) :virtual #t - :code - (behavior () - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (sound-play "cell-prize") (let ((gp-1 (new 'stack 'trajectory))) (set! (-> self base y) (-> self jump-pos y)) (setup-from-to-duration! gp-1 (-> self root-override trans) (-> self jump-pos) 300.0 -2.2755556) @@ -268,35 +233,25 @@ (transform-post) (spawn (-> self part) (the-as vector (-> self root-override root-prim prim-core))) (suspend) - (when (nonzero? (-> self skel)) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) 0.5) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-loop!) + (if (nonzero? (-> self skel)) + (ja :num! (loop! 0.5)) ) - ) ) ) (set! (-> self root-override trans quad) (-> self jump-pos quad)) (set! (-> self base quad) (-> self root-override trans quad)) (transform-post) - (sound-play-by-name (static-sound-name "land-pcmetal") (new-sound-id) 1024 3048 0 1 #t) - (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-3 - (let ((t9-12 (method-of-type part-tracker activate))) - (t9-12 (the-as part-tracker gp-3) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-3 - part-tracker-init - (-> *part-group-id-table* 4) - -1 - #f - #f - #f - (-> self root-override root-prim prim-core) - ) - (-> gp-3 ppointer) - ) + (sound-play "land-pcmetal" :pitch 2) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 4) + -1 + #f + #f + #f + (-> self root-override root-prim prim-core) + :to *entity-pool* ) (go-virtual idle) (none) @@ -305,9 +260,8 @@ (defstate idle (powercellalt) :virtual #t - :code - (behavior () - (while #t + :code (behavior () + (loop (vector<-cspace! (-> self root-override trans) (-> (the-as process-drawable (-> self parent 0)) node-list data (-> self index)) @@ -319,7 +273,7 @@ ) ) -(defbehavior powercellalt-init-by-other powercellalt ((arg0 entity) (arg1 vector) (arg2 vector) (arg3 int)) +(defbehavior powercellalt-init-by-other powercellalt ((arg0 entity-actor) (arg1 vector) (arg2 vector) (arg3 int)) (set! (-> self entity) arg0) (let ((s3-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) (set! (-> s3-0 dynam) (copy *standard-dynamics* 'process)) @@ -351,33 +305,28 @@ ) (defstate target-final-door (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) ((-> target-grab event) arg0 arg1 arg2 arg3) ) - :enter - (behavior ((arg0 basic) (arg1 handle)) + :enter (behavior ((arg0 basic) (arg1 handle)) (send-event *camera* 'change-to-entity-by-name "camera-403") (set! (-> self control unknown-surface00) *empty-mods*) - (logior! (-> self state-flags) 272) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) + (logior! (-> self state-flags) (state-flags invulnerable grabbed)) + (set-setting! 'allow-progress #f 0.0 0) (none) ) - :exit - (behavior () - (send-event *camera* 'change-state *camera-base-mode* 60) - (set! (-> self state-flags) (logand -273 (-> self state-flags))) + :exit (behavior () + (send-event *camera* 'change-state *camera-base-mode* (seconds 0.2)) + (logclear! (-> self state-flags) (state-flags invulnerable grabbed)) (target-exit) - (clear-pending-settings-from-process *setting-control* self 'allow-progress) + (remove-setting! 'allow-progress) (none) ) - :trans - (behavior () - (set-letterbox-frames (seconds 0.016666668)) + :trans (behavior () + (set-letterbox-frames (seconds 0.017)) (none) ) - :code - (behavior ((arg0 basic) (arg1 handle)) + :code (behavior ((arg0 basic) (arg1 handle)) (local-vars (sv-144 process) (sv-160 vector) (sv-176 process) (sv-192 vector)) (let ((a0-2 (get-task-control (game-task finalboss-movies)))) (save-reminder a0-2 (logior (get-reminder a0-2 0) 2) 0) @@ -386,21 +335,11 @@ (set-quaternion! (-> self control) (the-as quaternion (new 'static 'vector :y -0.8472 :w 0.5312))) (rot->dir-targ! (-> self control)) (transform-post) - (ja-channel-push! 1 60) - (let ((s4-1 (-> self skel root-channel 0))) - (set! (-> s4-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 88))) - (set! (-> s4-1 param 0) (ja-aframe 18.0 0)) - (set! (-> s4-1 param 1) 1.0) - (set! (-> s4-1 frame-num) 0.0) - (joint-control-channel-group! s4-1 (the-as art-joint-anim (-> self draw art-group data 88)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 88) :num! (seek! (ja-aframe 18.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((s4-2 (-> self skel root-channel 0))) - (set! (-> s4-2 param 0) (ja-aframe 18.0 0)) - (set! (-> s4-2 param 1) 1.0) - (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 18.0 0))) ) (let ((s4-3 (-> (handle->process (the-as handle arg0)) entity)) (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 7))) @@ -475,8 +414,7 @@ (go target-stance) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) diff --git a/goal_src/levels/finalboss/green-eco-lurker.gc b/goal_src/levels/finalboss/green-eco-lurker.gc index 724a858abb..c244180bc8 100644 --- a/goal_src/levels/finalboss/green-eco-lurker.gc +++ b/goal_src/levels/finalboss/green-eco-lurker.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/green-eco-lurker-ag.gc") + (deftype green-eco-lurker (nav-enemy) ((played-sound? symbol :offset-assert 400) (sound-delay int32 :offset-assert 404) @@ -44,14 +46,11 @@ ) -(defskelgroup *green-eco-lurker-sg* green-eco-lurker - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5.95) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *green-eco-lurker-sg* green-eco-lurker green-eco-lurker-lod0-jg -1 + ((green-eco-lurker-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.95) + :shadow green-eco-lurker-shadow-mg + ) (define *green-eco-lurker-nav-enemy-info* (new 'static 'nav-enemy-info :idle-anim 3 @@ -101,7 +100,7 @@ :use-proximity-notice #f :use-jump-blocked #t :use-jump-patrol #f - :gnd-collide-with #x805 + :gnd-collide-with (collide-kind background cak-2 ground-object) :debug-draw-neck #f :debug-draw-jump #f ) @@ -112,8 +111,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2585 :fade-after (meters 100) :period 600 :length 5 :binding 2583) + :parts ((sp-item 2585 :fade-after (meters 100) :period 600 :length 5 :binding 2583) (sp-item 2583 :flags (start-dead launch-asap) :binding 2584) (sp-item 2584 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) (sp-item 2583 :flags (start-dead launch-asap) :binding 2584) @@ -154,8 +152,7 @@ ) (defpart 2587 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -179,13 +176,11 @@ ) (defpart 2590 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) ) (defpart 2589 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-scale-x (meters 0.2)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) @@ -202,8 +197,7 @@ ) (defpart 2586 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 16)) (sp-copy-from-other spt-scale-y -4) @@ -218,8 +212,7 @@ ) (defpart 2588 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -243,8 +236,7 @@ ) (defpart 2585 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 0.1)) @@ -261,8 +253,7 @@ ) (defpart 2583 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.3) (meters 0.3) 1.0) @@ -286,8 +277,7 @@ ) (defpart 2584 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -336,11 +326,12 @@ ) (defmethod dummy-44 green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) - (when (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) @@ -349,11 +340,12 @@ ) (defmethod nav-enemy-touch-handler green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) - (when (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) @@ -395,43 +387,36 @@ ) (defstate green-eco-lurker-tune-spheres (green-eco-lurker) - :trans - (behavior () + :trans (behavior () 0 (none) ) - :code - (behavior () + :code (behavior () 0 (none) ) - :post - (the-as (function none :behavior green-eco-lurker) transform-post) + :post (the-as (function none :behavior green-eco-lurker) transform-post) ) (defstate green-eco-lurker-wait-to-appear (green-eco-lurker) - :enter - (behavior () + :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self collide-info)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self collide-info)) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-52 self (-> self appear-dest)) (go green-eco-lurker-appear) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -440,38 +425,38 @@ ) (defmethod dummy-53 green-eco-lurker ((obj green-eco-lurker)) - (the-as - symbol - (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) - (let ((f0-0 (-> obj appear-dest y)) - (v1-7 (-> obj draw shadow-ctrl)) - ) - (let ((a0-1 v1-7)) - (set! (-> a0-1 settings flags) (logand -33 (-> a0-1 settings flags))) - ) - 0 - (let ((a0-3 v1-7)) - (set! (-> a0-3 settings bot-plane w) (- (+ -6144.0 f0-0))) - ) - 0 - (set! (-> v1-7 settings top-plane w) (- (+ 6144.0 f0-0))) - ) - 0 - ) - (else - (let ((v1-9 (-> obj draw shadow-ctrl))) - (logior! (-> v1-9 settings flags) 32) + (the-as symbol (cond + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) + (let ((f0-0 (-> obj appear-dest y)) + (v1-7 (-> obj draw shadow-ctrl)) + ) + (let ((a0-1 v1-7)) + (logclear! (-> a0-1 settings flags) (shadow-flags disable-draw)) + ) + 0 + (let ((a0-3 v1-7)) + (set! (-> a0-3 settings bot-plane w) (- (+ -6144.0 f0-0))) + ) + 0 + (set! (-> v1-7 settings top-plane w) (- (+ 6144.0 f0-0))) + ) + 0 + ) + (else + (let ((v1-9 (-> obj draw shadow-ctrl))) + (logior! (-> v1-9 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) ) - 0 - ) - ) - ) ) (defstate green-eco-lurker-appear (green-eco-lurker) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self played-sound?) #f) (set! (-> self sound-delay) (nav-enemy-rnd-int-range 30 150)) @@ -480,21 +465,23 @@ (+ (-> (the-as green-eco-lurker-gen (-> self parent 0)) root trans x) (fmax -32768.0 (fmin 32768.0 f0-1))) ) ) - (logior! (-> self collide-info nav-flags) 2) + (logior! (-> self collide-info nav-flags) (nav-flags navf1)) (set! (-> self nav extra-nav-sphere quad) (-> self appear-dest quad)) (set! (-> self nav extra-nav-sphere w) 8192.0) (setup-from-to-duration! (-> self traj) (-> self collide-info trans) (-> self appear-dest) 225.0 -9.102222) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self collide-info trans quad)) (set! (-> gp-0 y) (+ 8192.0 (-> gp-0 y))) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker s5-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 part-tracker-init (-> *part-group-id-table* 643) -1 #f #f #f gp-0) - (-> s5-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 643) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (let ((gp-1 (new 'stack-no-clear 'vector))) @@ -505,13 +492,12 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (fmin (the float (- (-> *display* base-frame-counter) (-> self state-time))) (-> self traj time)))) (eval-position! (-> self traj) f30-0 (-> self collide-info trans)) (when (= f30-0 (-> self traj time)) - (logior! (-> self collide-info nav-flags) 1) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logior! (-> self collide-info nav-flags) (nav-flags navf0)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (go green-eco-lurker-appear-land) ) ) @@ -519,100 +505,48 @@ (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self sound-delay)) ) (set! (-> self played-sound?) #t) - (sound-play-by-name - (static-sound-name "blob-jump") - (new-sound-id) - 1024 - (the int (* 1524.0 (nav-enemy-rnd-float-range -0.5 0.5))) - 0 - 1 - #t - ) + (sound-play "blob-jump" :pitch (nav-enemy-rnd-float-range -0.5 0.5)) ) (dummy-53 self) 0 (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (sound-play-by-name - (static-sound-name "blob-out") - (new-sound-id) - 1024 - (the int (* 1524.0 (nav-enemy-rnd-float-range -1.0 1.0))) - 0 - 1 - #t - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (sound-play "blob-out" :pitch (nav-enemy-rnd-float-range -1.0 1.0)) (cond ((zero? (nav-enemy-rnd-int-count 2)) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! green-eco-lurker-jump-with-flip-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! green-eco-lurker-jump-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior green-eco-lurker) transform-post) + :post (the-as (function none :behavior green-eco-lurker) transform-post) ) (defstate green-eco-lurker-appear-land (green-eco-lurker) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior green-eco-lurker) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (activate! *camera-smush-control* 409.6 37 150 1.0 0.99) - (sound-play-by-name - (static-sound-name "blob-land") - (new-sound-id) - 1024 - (the int (* 1524.0 (nav-enemy-rnd-float-range -1.0 1.0))) - 0 - 1 - #t - ) + (sound-play "blob-land" :pitch (nav-enemy-rnd-float-range -1.0 1.0)) (let ((v1-4 (-> self draw shadow-ctrl))) (let ((a0-4 v1-4)) (set! (-> a0-4 settings bot-plane w) (- -7168.0)) @@ -622,42 +556,28 @@ (set! (-> a0-6 settings top-plane w) (- 2048.0)) ) 0 - (set! (-> v1-4 settings flags) (logand -9 (-> v1-4 settings flags))) - (set! (-> v1-4 settings flags) (logand -5 (-> v1-4 settings flags))) - (set! (-> v1-4 settings flags) (logand -33 (-> v1-4 settings flags))) + (logclear! (-> v1-4 settings flags) (shadow-flags shdf03)) + (logclear! (-> v1-4 settings flags) (shadow-flags shdf02)) + (logclear! (-> v1-4 settings flags) (shadow-flags disable-draw)) ) 0 - (ja-channel-push! 1 60) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! green-eco-lurker-jump-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-chase) (none) ) - :post - (the-as (function none :behavior green-eco-lurker) transform-post) + :post (the-as (function none :behavior green-eco-lurker) transform-post) ) (defstate nav-enemy-patrol (green-eco-lurker) :virtual #t - :code - (behavior () - (ja-channel-push! 1 60) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-patrol) code))) (if t9-1 ((the-as (function none) t9-1)) @@ -669,65 +589,31 @@ (defstate nav-enemy-chase (green-eco-lurker) :virtual #t - :code - (behavior () + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 8) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 60) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim)))) - (set! (-> a0-7 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-7 param 1) f30-0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! - a0-7 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - num-func-seek! - ) - ) + ((ja-group? green-eco-lurker-jump-land-ja) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info run-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (else - (ja-channel-push! 1 60) - (let ((v1-42 (-> self skel root-channel 0))) - (set! (-> v1-42 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - ) - ) - (let ((v1-45 (-> self skel root-channel 0))) - (set! (-> v1-45 num-func) num-func-identity) - (set! (-> v1-45 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) ) ) - (while #t + (loop (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) f30-0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) @@ -736,35 +622,17 @@ (defstate nav-enemy-jump-land (green-eco-lurker) :virtual #t - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 22) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - ) - (set! (-> gp-0 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-0 param 1) 0.5) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info jump-land-anim)) + :num! (seek! (ja-aframe 32.0 0) 0.5) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-1 param 1) 0.5) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) ) (go-virtual nav-enemy-chase) (none) @@ -773,31 +641,23 @@ (defstate nav-enemy-die (green-eco-lurker) :virtual #t - :enter - (behavior () + :enter (behavior () (send-event (ppointer->process (-> self parent)) 'blob-died) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-2 (method-of-type part-tracker activate))) - (t9-2 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 643) - -1 - #f - #f - #f - (-> self collide-info trans) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 643) + -1 + #f + #f + #f + (-> self collide-info trans) + :to *entity-pool* ) - (sound-play-by-name (static-sound-name "blob-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "blob-explode") (activate! *camera-smush-control* 409.6 37 150 1.0 0.99) (let ((v1-14 (-> self draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 (let ((t9-7 (-> (method-of-type nav-enemy nav-enemy-die) enter))) @@ -892,9 +752,9 @@ (defmethod TODO-RENAME-48 green-eco-lurker ((obj green-eco-lurker)) (initialize-skeleton obj *green-eco-lurker-sg* '()) (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (set! (-> obj collide-info nav-flags) (logand -2 (-> obj collide-info nav-flags))) + (logclear! (-> obj collide-info nav-flags) (nav-flags navf0)) (TODO-RENAME-45 obj *green-eco-lurker-nav-enemy-info*) - (logior! (-> obj draw shadow-ctrl settings flags) 4) + (logior! (-> obj draw shadow-ctrl settings flags) (shadow-flags shdf02)) (set! (-> obj neck up) (the-as uint 0)) (set! (-> obj neck nose) (the-as uint 1)) (set! (-> obj neck ear) (the-as uint 2)) @@ -902,7 +762,7 @@ (none) ) -(defbehavior green-eco-lurker-init-by-other green-eco-lurker ((arg0 entity) (arg1 green-eco-lurker-gen) (arg2 vector)) +(defbehavior green-eco-lurker-init-by-other green-eco-lurker ((arg0 entity-actor) (arg1 green-eco-lurker-gen) (arg2 vector)) (initialize-collision self) (set! (-> self collide-info trans quad) (-> arg2 quad)) (vector-identity! (-> self collide-info scale)) @@ -915,8 +775,7 @@ ) (defstate spawn-minions (green-eco-lurker-gen) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('blob-died) (set! (-> self num-alive) (max 0 (+ (-> self num-alive) -1))) @@ -927,8 +786,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (while (< (-> self num-spawned) (-> self num-to-spawn)) (when (< (-> self num-alive) 3) (when (nonzero? (-> self num-spawned)) @@ -940,15 +798,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self root trans quad)) (set! (-> gp-0 y) (+ -16384.0 (-> gp-0 y))) - (let ((s5-0 (get-process *default-dead-pool* green-eco-lurker #x4000))) - (when s5-0 - (let ((t9-1 (method-of-type green-eco-lurker activate))) - (t9-1 (the-as green-eco-lurker s5-0) self 'green-eco-lurker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 green-eco-lurker-init-by-other (-> self entity) self gp-0) - (-> s5-0 ppointer) - ) - ) + (process-spawn green-eco-lurker (-> self entity) self gp-0 :to self) ) (+! (-> self num-spawned) 1) (+! (-> self num-alive) 1) @@ -968,7 +818,7 @@ ) ) -(defbehavior green-eco-lurker-gen-init-by-other green-eco-lurker-gen ((arg0 entity) (arg1 vector) (arg2 int)) +(defbehavior green-eco-lurker-gen-init-by-other green-eco-lurker-gen ((arg0 entity-actor) (arg1 vector) (arg2 int)) (set! (-> self num-to-spawn) arg2) (set! (-> self num-spawned) 0) (set! (-> self num-alive) 0) diff --git a/goal_src/levels/finalboss/light-eco.gc b/goal_src/levels/finalboss/light-eco.gc index 30d8517887..2786515d1c 100644 --- a/goal_src/levels/finalboss/light-eco.gc +++ b/goal_src/levels/finalboss/light-eco.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/light-eco-ag.gc") + (deftype light-eco-child (process-drawable) ((root-override collide-shape :offset 112) (angle-bit int32 :offset-assert 176) @@ -58,33 +60,25 @@ ) -(defskelgroup *light-eco-big-sg* light-eco - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *light-eco-big-sg* light-eco light-eco-big-lod0-jg -1 + ((light-eco-big-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 9) + ) -(defskelgroup *light-eco-small-sg* light-eco - 3 - -1 - ((4 (meters 999999))) - :bounds (static-spherem 0 0 0 1.5) - :longest-edge (meters 0) - ) +(defskelgroup *light-eco-small-sg* light-eco light-eco-small-lod0-jg -1 + ((light-eco-small-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.5) + ) (defpartgroup group-light-eco-mother-growing :id 690 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 32) - :parts - ((sp-item 2902) (sp-item 2900) (sp-item 2897) (sp-item 2898)) + :parts ((sp-item 2902) (sp-item 2900) (sp-item 2897) (sp-item 2898)) ) (defpart 2897 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-scale-x (meters 10.5) (meters 4.5) 1.0) (sp-int spt-rot-x 4) @@ -106,13 +100,11 @@ ) (defpart 2899 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) (defpart 2898 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-scale-x (meters 20) (meters 4.5) 1.0) (sp-int spt-rot-x 4) @@ -133,8 +125,7 @@ ) (defpart 2900 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -0.001) (meters 0.002) 1.0) (sp-rnd-flt spt-y (meters -0.001) (meters 0.002) 1.0) @@ -159,13 +150,11 @@ ) (defpart 2901 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) (defpart 2902 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 8.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -191,8 +180,7 @@ ) (defpart 2903 - :init-specs - ((sp-flt spt-userdata 2252800.0)) + :init-specs ((sp-flt spt-userdata 2252800.0)) ) (defun check-drop-level-lighteco-big-pops ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) @@ -200,30 +188,15 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2904) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2905) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 2904) gp-0) + (launch-particles :rate 1.0 (-> *part-id-table* 2905) gp-0) ) ) (none) ) (defpart 2905 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -239,8 +212,7 @@ ) (defpart 2904 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 4.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -262,21 +234,18 @@ :id 691 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 32) - :parts - ((sp-item 2902) (sp-item 2900) (sp-item 2897) (sp-item 2898)) + :parts ((sp-item 2902) (sp-item 2900) (sp-item 2897) (sp-item 2898)) ) (defpartgroup group-light-eco-child :id 692 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 2906) (sp-item 2907)) + :parts ((sp-item 2906) (sp-item 2907)) ) (defpart 2907 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.025 0.025 1.0) (sp-rnd-flt spt-x (meters -0.001) (meters 0.002) 1.0) (sp-rnd-flt spt-y (meters -0.001) (meters 0.002) 1.0) @@ -301,13 +270,11 @@ ) (defpart 2908 - :init-specs - ((sp-flt spt-fade-a -0.85333335)) + :init-specs ((sp-flt spt-fade-a -0.85333335)) ) (defpart 2906 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -332,8 +299,7 @@ ) (defpart 2909 - :init-specs - ((sp-flt spt-userdata 2048000.0)) + :init-specs ((sp-flt spt-userdata 2048000.0)) ) (defun check-drop-level-lighteco-pops ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) @@ -341,30 +307,15 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2910) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2911) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 2910) gp-0) + (launch-particles :rate 1.0 (-> *part-id-table* 2911) gp-0) ) ) (none) ) (defpart 2911 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -380,8 +331,7 @@ ) (defpart 2910 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 4.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -431,15 +381,12 @@ ) (defstate light-eco-child-appear (light-eco-child) - :event - light-eco-child-default-event-handler - :enter - (behavior () + :event light-eco-child-default-event-handler + :enter (behavior () (set! (-> self falling-start-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (fmin (the float (- (-> *display* base-frame-counter) (-> self falling-start-time))) (-> self traj time)) ) @@ -452,31 +399,23 @@ (common-trans self) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior light-eco-child) transform-post) + :post (the-as (function none :behavior light-eco-child) transform-post) ) (defstate light-eco-child-hit-ground (light-eco-child) - :event - light-eco-child-default-event-handler - :enter - (behavior () + :event light-eco-child-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (+ (-> self root-override transv y) (* -544768.0 (-> *display* seconds-per-frame))))) (when (and (< f30-0 0.0) (>= (-> self ground-y) (-> self root-override trans y))) (if (>= 4096.0 (fabs f30-0)) @@ -509,55 +448,41 @@ (common-trans self) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior light-eco-child) transform-post) + :post (the-as (function none :behavior light-eco-child) transform-post) ) (defstate light-eco-child-idle (light-eco-child) - :event - light-eco-child-default-event-handler - :enter - (behavior () + :event light-eco-child-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) (go light-eco-child-die) ) (common-trans self) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior light-eco-child) transform-post) + :post (the-as (function none :behavior light-eco-child) transform-post) ) (defstate light-eco-child-die (light-eco-child) - :code - (behavior () + :code (behavior () (send-event (ppointer->process (-> self parent)) 'untrigger (-> self angle-bit)) (clear-collide-with-as (-> self root-override)) (logior! (-> self draw status) (draw-status hidden)) @@ -570,15 +495,14 @@ ) (defstate light-eco-child-grabbed (light-eco-child) - :code - (behavior () + :code (behavior () (suspend) 0 (none) ) ) -(defbehavior light-eco-child-init-by-other light-eco-child ((arg0 entity) (arg1 vector) (arg2 vector) (arg3 int)) +(defbehavior light-eco-child-init-by-other light-eco-child ((arg0 entity-actor) (arg1 vector) (arg2 vector) (arg3 int)) (set! (-> self entity) arg0) (set! (-> self angle-bit) arg3) (set! (-> self ground-y) (-> arg2 y)) @@ -622,19 +546,8 @@ (logclear! (-> self mask) (process-mask actor-pause)) (initialize-skeleton self *light-eco-small-sg* '()) (ja-channel-set! 1) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja-no-eval :num! (seek!)) + (ja :group! light-eco-small-idle-ja :num! min) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 692) self)) (transform-post) (go light-eco-child-appear) @@ -661,7 +574,7 @@ ) ) (cond - ((and *target* (logtest? (-> *target* state-flags) 256)) + ((and *target* (logtest? (-> *target* state-flags) (state-flags grabbed))) (set! (-> obj last-spawned-time) (-> *display* base-frame-counter)) (set! (-> obj delay-til-spawn) 2400) ) @@ -694,15 +607,7 @@ (set! (-> s4-0 y) 1974272.0) (when (or (not *target*) (>= (vector-vector-xz-distance s4-0 (target-pos 0)) 49152.0)) (logior! (-> obj angle-mask) (ash 1 gp-0)) - (let ((s3-1 (get-process *default-dead-pool* light-eco-child #x4000))) - (when s3-1 - (let ((t9-7 (method-of-type light-eco-child activate))) - (t9-7 (the-as light-eco-child s3-1) obj 'light-eco-child (the-as pointer #x70004000)) - ) - (run-now-in-process s3-1 light-eco-child-init-by-other (-> obj entity) (-> obj root trans) s4-0 gp-0) - (-> s3-1 ppointer) - ) - ) + (process-spawn light-eco-child (-> obj entity) (-> obj root trans) s4-0 gp-0 :to obj) (return #t) ) ) @@ -714,110 +619,87 @@ (defbehavior light-eco-mother-default-event-handler light-eco-mother ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) - (the-as int (cond - ((= v1-0 'untrigger) - (the-as int (when (= (-> arg0 type) light-eco-child) - (let* ((a1-3 (-> arg3 param 0)) - (v0-0 (logxor (-> self angle-mask) (ash 1 a1-3))) - ) - (set! (-> self angle-mask) v0-0) - v0-0 - ) - ) - ) - ) - ((= v1-0 'trigger) - (the-as int (when (not (-> self player-got-eco?)) - (set! (-> self player-got-eco?) #t) - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 0) - (set! (-> a1-5 message) 'white-eco-picked-up) - (the-as int (send-event-function (ppointer->process (-> self parent)) a1-5)) - ) - ) - ) - ) - ((= v1-0 'beam-off) - (the-as int (go light-eco-mother-discipate)) - ) - ) - ) + (the-as + int + (cond + ((= v1-0 'untrigger) + (the-as int (when (= (-> arg0 type) light-eco-child) + (let* ((a1-3 (-> arg3 param 0)) + (v0-0 (logxor (-> self angle-mask) (ash 1 a1-3))) + ) + (set! (-> self angle-mask) v0-0) + v0-0 + ) + ) + ) + ) + ((= v1-0 'trigger) + (the-as int (when (not (-> self player-got-eco?)) + (set! (-> self player-got-eco?) #t) + (the-as int (send-event (ppointer->process (-> self parent)) 'white-eco-picked-up)) + ) + ) + ) + ((= v1-0 'beam-off) + (the-as int (go light-eco-mother-discipate)) + ) + ) + ) ) ) (defstate light-eco-mother-appear (light-eco-mother) - :event - light-eco-mother-default-event-handler - :trans - (behavior () + :event light-eco-mother-default-event-handler + :trans (behavior () (common-trans self) (spawn (-> self part2) (-> self root trans)) (none) ) - :code - (behavior () + :code (behavior () (while (!= (-> self root scale x) 12.0) (let ((f0-3 (seek-with-smooth (-> self root scale x) 12.0 (* 6.0 (-> *display* seconds-per-frame)) 0.25 0.001))) (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) ) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (go light-eco-mother-active) (none) ) - :post - (the-as (function none :behavior light-eco-mother) ja-post) + :post (the-as (function none :behavior light-eco-mother) ja-post) ) (defstate light-eco-mother-active (light-eco-mother) - :event - light-eco-mother-default-event-handler - :trans - (behavior () + :event light-eco-mother-default-event-handler + :trans (behavior () (common-trans self) (spawn (-> self part) (-> self root trans)) 0 (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior light-eco-mother) ja-post) + :post (the-as (function none :behavior light-eco-mother) ja-post) ) (defstate light-eco-mother-discipate (light-eco-mother) - :event - light-eco-mother-default-event-handler - :trans - (behavior () + :event light-eco-mother-default-event-handler + :trans (behavior () (common-trans self) (none) ) - :code - (behavior () + :code (behavior () (while (!= (-> self root scale x) 0.0) (let ((f0-3 (seek-with-smooth (-> self root scale x) 0.0 (* 12.0 (-> *display* seconds-per-frame)) 0.5 0.001))) (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) ) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (logior! (-> self draw status) (draw-status hidden)) (until (not (-> self child)) @@ -825,8 +707,7 @@ ) (none) ) - :post - (the-as (function none :behavior light-eco-mother) ja-post) + :post (the-as (function none :behavior light-eco-mother) ja-post) ) (defmethod deactivate light-eco-mother ((obj light-eco-mother)) @@ -844,7 +725,7 @@ (the-as light-eco-mother ((method-of-type projectile relocate) (the-as projectile obj) arg0)) ) -(defbehavior light-eco-mother-init-by-other light-eco-mother ((arg0 entity) (arg1 vector)) +(defbehavior light-eco-mother-init-by-other light-eco-mother ((arg0 entity-actor) (arg1 vector)) (set! (-> self entity) arg0) (set! (-> self last-update-time) 0) (set! (-> self last-spawned-time) (-> *display* base-frame-counter)) @@ -858,35 +739,12 @@ (logclear! (-> self mask) (process-mask actor-pause)) (initialize-skeleton self *light-eco-big-sg* '()) (ja-channel-set! 1) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja-no-eval :num! (seek!)) + (ja :group! light-eco-big-idle-ja :num! min) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 691) self)) (set! (-> self part2) (create-launch-control (-> *part-group-id-table* 690) self)) - (set! (-> self sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "white-eco-lp") - :volume #x400 - :fo-min #x12c - :fo-max #x190 - ) - (-> self root trans) - ) + (set! (-> self sound) + (new 'process 'ambient-sound (static-sound-spec "white-eco-lp" :fo-min 300 :fo-max 400) (-> self root trans)) ) (ja-post) (let ((f0-4 0.0)) diff --git a/goal_src/levels/finalboss/robotboss-h.gc b/goal_src/levels/finalboss/robotboss-h.gc index 8a2599e09b..2aceed64a9 100644 --- a/goal_src/levels/finalboss/robotboss-h.gc +++ b/goal_src/levels/finalboss/robotboss-h.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/robotboss-ag.gc") + (deftype robotboss-dda (structure) ((blue-bomb-time float :offset-assert 0) (num-blobs int32 :offset-assert 4) @@ -124,28 +126,18 @@ (none) ) -(defun target-has-all-the-cells? () - (with-pp - (the-as symbol (and *target* (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 6)) - (>= (the int (the-as float (send-event-function *target* a1-0))) 100) - ) - ) - ) +(defbehavior target-has-all-the-cells? process () + (the-as + symbol + (and *target* (>= (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 100)) ) ) -(defskelgroup *robotboss-sg* robotboss - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -10 0 80) - :longest-edge (meters 19.9) - ) +(defskelgroup *robotboss-sg* robotboss robotboss-basic-lod0-jg robotboss-idle-ja + ((robotboss-basic-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10 0 80) + :longest-edge (meters 19.9) + ) diff --git a/goal_src/levels/finalboss/robotboss-misc.gc b/goal_src/levels/finalboss/robotboss-misc.gc index b9bc49b944..5c248d3f48 100644 --- a/goal_src/levels/finalboss/robotboss-misc.gc +++ b/goal_src/levels/finalboss/robotboss-misc.gc @@ -11,17 +11,18 @@ ;; DECOMP BEGINS -(defskelgroup *med-res-snow1-sg* medres-snowback - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -360 100 100 380) - :longest-edge (meters 0.01) - ) +(import "goal_src/import/silodoor-ag.gc") +(import "goal_src/import/ecoclaw-ag.gc") +(import "goal_src/import/finalbosscam-ag.gc") + +(defskelgroup *med-res-snow1-sg* medres-snowback 0 2 + ((1 (meters 999999))) + :bounds (static-spherem -360 100 100 380) + :longest-edge (meters 0.01) + ) (defstate cam-robotboss (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('set-pivot) (let ((v0-0 (the-as object (-> self pivot-pt)))) @@ -37,8 +38,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (cond ((-> self enter-has-run) ) @@ -52,17 +52,15 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (when (zero? (logand (-> *camera* master-options) 2)) (set! *camera-base-mode* cam-string) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when #t (let ((a2-0 (new-stack-vector0))) (vector-! a2-0 (-> *camera* tpos-curr-adj) (-> self pivot-pt)) @@ -119,13 +117,10 @@ ) -(defskelgroup *ecoclaw-sg* ecoclaw - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *ecoclaw-sg* ecoclaw ecoclaw-lod0-jg ecoclaw-idle-ja + ((ecoclaw-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 9) + ) (defun ecoclaw-beam-particle-callback ((arg0 part-tracker)) (let* ((a0-1 (the-as (pointer projectile) (-> arg0 userdata))) @@ -231,10 +226,8 @@ ) (defstate ecoclaw-activate (ecoclaw) - :event - ecoclaw-handler - :trans - (behavior () + :event ecoclaw-handler + :trans (behavior () (if (-> self particles 1 kind) (draw-eco-beam (the-as vector (&-> self stack 112)) (the-as vector (&-> self stack 144))) ) @@ -246,83 +239,42 @@ ) ) ((-> self particles gp-0 kind) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self particles gp-0 tracker) - (ppointer->handle (when s5-0 - (let ((t9-2 (method-of-type part-tracker activate))) - (t9-2 (the-as part-tracker s5-0) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - part-tracker-init - (-> self particles gp-0 kind) - -1 - ecoclaw-beam-particle-callback - (-> self ppointer) - #f - (&+ (&-> self stack 80) (* gp-0 32)) - ) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> self particles gp-0 tracker) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> self particles gp-0 kind) + -1 + ecoclaw-beam-particle-callback + (-> self ppointer) + #f + (&+ (&-> self stack 80) (* gp-0 32)) + :to self + ) + ) + ) ) ) ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior ecoclaw) ja-post) + :post (the-as (function none :behavior ecoclaw) ja-post) ) (defstate ecoclaw-idle (ecoclaw) - :event - ecoclaw-handler - :code - (behavior () - (while #t + :event ecoclaw-handler + :code (behavior () + (loop (if (-> self particles 0 kind) (go ecoclaw-activate) ) @@ -330,8 +282,7 @@ ) (none) ) - :post - (the-as (function none :behavior ecoclaw) ja-post) + :post (the-as (function none :behavior ecoclaw) ja-post) ) (defmethod init-from-entity! ecoclaw ((obj ecoclaw) (arg0 entity-actor)) @@ -361,18 +312,14 @@ ) -(defskelgroup *silodoor-sg* silodoor - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 25) - :longest-edge (meters 0) - ) +(defskelgroup *silodoor-sg* silodoor silodoor-lod0-jg silodoor-idle-ja + ((silodoor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) (defstate idle (silodoor) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('open) (let ((f0-0 (the-as float (-> arg3 param 0)))) @@ -385,17 +332,11 @@ ) ) ) - :trans - (the-as (function none :behavior silodoor) rider-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior silodoor) rider-trans) + :code (behavior () + (loop (when (not (movie?)) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 param 0) (* (-> self part-opened) (the float (ja-num-frames 0)))) - (set! (-> gp-0 param 1) 0.01) - (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (* (-> self part-opened) (the float (ja-num-frames 0))) 0.01)) (cond ((< 0.01 (fabs (- (* (-> self part-opened) (the float (ja-num-frames 0))) (ja-aframe-num 0)))) (if (nonzero? (-> self sound)) @@ -411,8 +352,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (if (and (< (vector-vector-xz-distance (target-pos 0) (-> self root trans)) 57344.0) (not (ja-min? 0))) (rider-post) (transform-post) @@ -423,8 +363,7 @@ (defstate hidden (silodoor) :virtual #t - :code - (behavior () + :code (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) @@ -434,10 +373,7 @@ (suspend) ) (logclear! (-> self draw status) (draw-status hidden)) - (let ((v1-12 (-> self skel root-channel 0))) - (set! (-> v1-12 num-func) num-func-identity) - (set! (-> v1-12 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (set! (-> self part-opened) 0.0) (go-virtual idle) (none) @@ -504,19 +440,8 @@ (initialize-skeleton obj *silodoor-sg* '()) (logior! (-> obj skel status) (janim-status inited)) (set! (-> obj root pause-adjust-distance) 1228800.0) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "silo-moves") - :volume #x400 - :fo-max 80 - ) - (-> obj root trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "silo-moves" :fo-max 80) (-> obj root trans)) ) (logclear! (-> obj mask) (process-mask actor-pause crate enemy attackable)) (set! (-> obj part-opened) 0.0) @@ -534,13 +459,10 @@ ) -(defskelgroup *finalbosscam-sg* finalbosscam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *finalbosscam-sg* finalbosscam finalbosscam-lod0-jg finalbosscam-idle-ja + ((finalbosscam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defbehavior robotboss-manipy-trans-hook robotboss () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -553,19 +475,9 @@ (defmethod play-anim! finalbosscam ((obj finalbosscam) (arg0 symbol)) (when arg0 - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj robotboss) - (ppointer->handle - (when s5-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy s5-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> obj root-override trans) (-> obj entity) *robotboss-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> obj robotboss) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *robotboss-sg* #f :to obj)) + ) (send-event (handle->process (-> obj robotboss)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj robotboss)) 'center-joint 3) (send-event (handle->process (-> obj robotboss)) 'origin-joint-index 3) @@ -598,8 +510,7 @@ (defstate play-anim (finalbosscam) :virtual #t - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self robotboss)))) (if a0-1 (deactivate a0-1) @@ -610,7 +521,7 @@ ) ) -(defbehavior finalbosscam-init-by-other finalbosscam ((arg0 entity)) +(defbehavior finalbosscam-init-by-other finalbosscam ((arg0 entity-actor)) (set! (-> self entity) arg0) (dummy-40 self arg0 *finalbosscam-sg* 4 4 (new 'static 'vector :w 4096.0) 4) (set! (-> self tasks) (get-task-control (game-task finalboss-movies))) diff --git a/goal_src/levels/finalboss/robotboss-part.gc b/goal_src/levels/finalboss/robotboss-part.gc index f36383bce4..3570d69840 100644 --- a/goal_src/levels/finalboss/robotboss-part.gc +++ b/goal_src/levels/finalboss/robotboss-part.gc @@ -5,18 +5,13 @@ ;; name in dgo: robotboss-part ;; dgos: FIN, L1 -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 636) - (new 'static 'sparticle-launch-group - :length 26 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-blue-beam" - :launcher - (new 'static 'inline-array sparticle-group-item 26 - (sp-item 2680) +;; DECOMP BEGINS + +(defpartgroup group-robotboss-blue-beam + :id 636 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 34) + :parts ((sp-item 2680) (sp-item 2545 :binding 2542) (sp-item 2542 :flags (bit1 start-dead launch-asap) :binding 2543) (sp-item 2542 :flags (bit1 start-dead launch-asap) :binding 2544) @@ -43,44 +38,28 @@ (sp-item 2548) (sp-item 2547) ) - :bounds (new 'static 'sphere :w 139264.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 637) - (new 'static 'sparticle-launch-group - :length 6 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-blue-beam-impact" - :launcher - (new 'static 'inline-array sparticle-group-item 6 - (sp-item 2681) +(defpartgroup group-robotboss-blue-beam-impact + :id 637 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 34) + :parts ((sp-item 2681) (sp-item 2682 :period 336 :length 5) (sp-item 2682 :period 140 :length 5) (sp-item 2682 :period 61 :length 5) (sp-item 2683) (sp-item 2549) ) - :bounds (new 'static 'sphere :w 139264.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2681) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 18 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2681 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 0.1 1.0) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) - (sp-rnd-flt spt-scale-y (meters 6.0) (meters 9.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 6) (meters 9) 1.0) (sp-flt spt-r 192.0) (sp-rnd-flt spt-g 192.0 64.0 1.0) (sp-rnd-flt spt-b 192.0 64.0 1.0) @@ -92,23 +71,16 @@ (sp-flt spt-fade-a -1.6) (sp-int spt-timer 60) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2683) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 30 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) +(defpart 2683 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) - (sp-rnd-flt spt-x (meters -0.5) (meters 1.0) 1.0) - (sp-rnd-flt spt-y (meters -2.5) (meters 1.0) 1.0) - (sp-rnd-flt spt-z -2048.0 4096.0 1.0) - (sp-rnd-flt spt-scale-x (meters 1.0) (meters 2.0) 1.0) + (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-y (meters -2.5) (meters 1) 1.0) + (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) @@ -132,32 +104,17 @@ (sp-launcher-by-id spt-next-launcher 2684) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 45.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2684) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 2 - (sp-flt spt-fade-a -0.07111111) - (sp-end) - ) - ) +(defpart 2684 + :init-specs ((sp-flt spt-fade-a -0.07111111)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2549) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2549 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.25) - (sp-rnd-flt spt-scale-x (meters 5.0) (meters 8.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 5) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-int spt-r 1124073472 1 128.0) @@ -167,20 +124,13 @@ (sp-flt spt-fade-a -5.12) (sp-int spt-timer 20) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2682) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 23 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2682 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 2.0 6.0 1.0) - (sp-flt spt-y (meters 0.0)) + (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 192.0 32.0 1.0) @@ -199,21 +149,14 @@ (sp-cpuinfo-flags bit0 bit2 bit14) (sp-rnd-flt spt-conerot-x (degrees -90.0) (degrees 180.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 2.0) (meters 4.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 2) (meters 4) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2545) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2545 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.025) - (sp-rnd-flt spt-scale-x (meters 3.0) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 0.0) (sp-flt spt-g 0.0) @@ -226,23 +169,16 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-flt spt-conerot-x (degrees 102.0)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-rnd-flt spt-conerot-radius (meters 1.0) (meters 0.5) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 1) (meters 0.5) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2542) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 19 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2542 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-x (meters 0.0) (meters 16.0) 1.0) - (sp-rnd-flt spt-y (meters 0.0) (meters 16.0) 1.0) - (sp-rnd-flt spt-z 4096.0 2048.0 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 2.2) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 0.0) @@ -251,23 +187,16 @@ (sp-flt spt-a 128.0) (sp-rnd-flt spt-omega 0.0 65536.0 1.0) (sp-rnd-int-flt spt-vel-x (meters -0.026666667) 1 218.45334) - (sp-rnd-flt spt-vel-y (meters 0.0) (meters 0.053333335) 1.0) - (sp-flt spt-vel-z (meters 0.0)) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.053333335) 1.0) + (sp-flt spt-vel-z (meters 0)) (sp-flt spt-accel-z 0.0) (sp-int spt-timer 450) (sp-cpuinfo-flags bit2 bit3 bit7 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2543) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) +(defpart 2543 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -282,18 +211,11 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int spt-next-time 10) (sp-launcher-by-id spt-next-launcher 146) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2544) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) +(defpart 2544 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -308,18 +230,11 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int spt-next-time 10) (sp-launcher-by-id spt-next-launcher 146) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2546) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2546 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-scale-y (meters 0.3) (meters 0.4) 1.0) @@ -334,22 +249,15 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-flt spt-conerot-x (degrees 102.0)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 1.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 1) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2548) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2548 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.25) - (sp-rnd-flt spt-scale-x (meters 6.0) (meters 3.0) 1.0) - (sp-rnd-flt spt-scale-y (meters 4.0) (meters 3.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) + (sp-rnd-flt spt-scale-y (meters 4) (meters 3) 1.0) (sp-flt spt-r 0.0) (sp-flt spt-g 0.0) (sp-rnd-flt spt-b 128.0 128.0 1.0) @@ -361,21 +269,14 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-flt spt-conerot-x (degrees 102.0)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 0.5) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2547) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2547 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 5.0) (meters 8.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 5) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 32.0 32.0 1.0) @@ -385,20 +286,13 @@ (sp-flt spt-fade-a -5.12) (sp-int spt-timer 10) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2680) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 12 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2680 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 2.0) (meters 4.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 32.0 1.0) @@ -407,40 +301,24 @@ (sp-flt spt-a 128.0) (sp-int spt-timer 25) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 644) - (new 'static 'sparticle-launch-group - :length 4 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-blue-blowup" - :launcher - (new 'static 'inline-array sparticle-group-item 4 - (sp-item 2591 :period 600 :length 5) +(defpartgroup group-robotboss-blue-blowup + :id 644 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2591 :period 600 :length 5) (sp-item 2592 :period 600 :length 40) (sp-item 2593 :period 600 :length 40) (sp-item 2594 :period 600 :length 40) ) - :bounds (new 'static 'sphere :w 32768.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2592) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 25 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2592 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) - (sp-flt spt-y (meters 0.0)) + (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.8) (meters 1.6) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 192.0 32.0 1.0) @@ -461,39 +339,21 @@ (sp-launcher-by-id spt-next-launcher 2595) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 2.0) (meters 4.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 2) (meters 4) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2595) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 5 - (sp-flt spt-fade-r 0.0) - (sp-flt spt-fade-g 0.0) - (sp-flt spt-fade-b 0.0) - (sp-flt spt-fade-a -1.0666667) - (sp-end) - ) - ) +(defpart 2595 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2594) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 18 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2594 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) - (sp-flt spt-y (meters 0.0)) + (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 0.8)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) - (sp-flt spt-scale-y (meters 32.0)) + (sp-flt spt-scale-y (meters 32)) (sp-rnd-flt spt-r 192.0 64.0 1.0) (sp-rnd-flt spt-g 192.0 64.0 1.0) (sp-flt spt-b 192.0) @@ -505,21 +365,14 @@ (sp-flt spt-fade-a -1.6) (sp-int spt-timer 60) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2591) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2591 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-y (meters 0.0)) - (sp-flt spt-scale-x (meters 64.0)) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 64)) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 128.0) (sp-rnd-flt spt-g 192.0 32.0 1.0) @@ -528,20 +381,13 @@ (sp-flt spt-fade-a -2.3272727) (sp-int spt-timer 54) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2593) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 24 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) +(defpart 2593 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) - (sp-rnd-flt spt-scale-x (meters 8.0) (meters 4.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 128.0) @@ -561,90 +407,50 @@ (sp-launcher-by-id spt-next-launcher 2596) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 6.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 6) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2596) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 6 - (sp-flt spt-fade-r -2.1333334) +(defpart 2596 + :init-specs ((sp-flt spt-fade-r -2.1333334) (sp-flt spt-fade-g -1.0666667) (sp-flt spt-fade-b 0.0) (sp-int spt-next-time 60) (sp-launcher-by-id spt-next-launcher 2597) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2597) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 7 - (sp-flt spt-fade-r 0.0) +(defpart 2597 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g -0.28444445) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.42666668) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2598) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2598) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 4 - (sp-flt spt-fade-r 0.0) - (sp-flt spt-fade-g 0.0) - (sp-flt spt-fade-b 0.0) - (sp-end) - ) - ) +(defpart 2598 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 645) - (new 'static 'sparticle-launch-group - :length 5 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-blue-smoke" - :launcher - (new 'static 'inline-array sparticle-group-item 5 - (sp-item 2685 :period 36 :length 5) +(defpartgroup group-robotboss-blue-smoke + :id 645 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2685 :period 36 :length 5) (sp-item 2685 :period 140 :length 5) (sp-item 2685 :period 61 :length 5) (sp-item 2599 :period 15 :length 5) (sp-item 2686) ) - :bounds (new 'static 'sphere :w 32768.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2686) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2686 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.25) - (sp-flt spt-y (meters 0.0)) - (sp-rnd-flt spt-scale-x (meters 4.0) (meters 16.0) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 4) (meters 16) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 128.0) (sp-rnd-flt spt-g 192.0 32.0 1.0) @@ -653,30 +459,23 @@ (sp-flt spt-fade-a -2.3272727) (sp-int spt-timer 54) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2599) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 23 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) +(defpart 2599 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-x (meters -0.5) (meters 1.0) 1.0) - (sp-rnd-flt spt-y (meters -0.5) (meters 1.0) 1.0) - (sp-rnd-flt spt-z -2048.0 4096.0 1.0) - (sp-rnd-flt spt-scale-x (meters 4.0) (meters 8.0) 1.0) + (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 4) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 128.0) (sp-rnd-flt spt-g 128.0 64.0 1.0) (sp-flt spt-b 255.0) (sp-rnd-flt spt-a 32.0 32.0 1.0) - (sp-flt spt-vel-y (meters 0.0)) + (sp-flt spt-vel-y (meters 0)) (sp-flt spt-scalevel-x (meters 0.013333334)) (sp-rnd-flt spt-rotvel-z (degrees -0.6) (degrees 1.2) 1.0) (sp-copy-from-other spt-scalevel-y -4) @@ -686,21 +485,14 @@ (sp-cpuinfo-flags bit2 bit14) (sp-int-plain-rnd spt-next-time 20 89 1) (sp-launcher-by-id spt-next-launcher 2596) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2685) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 25 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2685 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-int spt-num 0 1 8.0) - (sp-flt spt-y (meters 0.0)) - (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1.0) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 192.0 32.0 1.0) (sp-rnd-flt spt-g 192.0 32.0 1.0) @@ -720,40 +512,22 @@ (sp-launcher-by-id spt-next-launcher 2595) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 2.0) (meters 4.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 2) (meters 4) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 638) - (new 'static 'sparticle-launch-group - :length 2 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-darkecobomb-launch" - :launcher - (new 'static 'inline-array sparticle-group-item 2 - (sp-item 2600 :period 600 :length 5) - (sp-item 2602 :period 600 :length 40) - ) - :bounds (new 'static 'sphere :w 32768.0) - ) +(defpartgroup group-robotboss-darkecobomb-launch + :id 638 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2600 :period 600 :length 5) (sp-item 2602 :period 600 :length 40)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2600) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2600 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-y (meters 0.0)) - (sp-flt spt-scale-x (meters 64.0)) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 64)) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) (sp-flt spt-g 255.0) @@ -762,20 +536,13 @@ (sp-flt spt-fade-a -2.3272727) (sp-int spt-timer 55) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2602) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 22 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) +(defpart 2602 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 8.0 1.0) - (sp-rnd-flt spt-scale-x (meters 8.0) (meters 8.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) @@ -793,26 +560,18 @@ (sp-cpuinfo-flags bit2 bit14) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 2.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 2) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 639) - (new 'static 'sparticle-launch-group - :length 18 - :duration #x384 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-darkecobomb-glow" - :launcher - (new 'static 'inline-array sparticle-group-item 18 - (sp-item 2753) +(defpartgroup group-robotboss-darkecobomb-glow + :id 639 + :duration 900 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2753) (sp-item 2754) - (sp-item 2755 :fade-after (meters 120.0) :falloff-to (meters 140.0) :binding 2752) + (sp-item 2755 :fade-after (meters 120) :falloff-to (meters 140) :binding 2752) (sp-item 2752 :flags (bit1 start-dead launch-asap) :binding 2671) (sp-item 2752 :flags (bit1 start-dead launch-asap) :binding 2672) (sp-item 2752 :flags (bit1 start-dead launch-asap) :binding 2671) @@ -829,20 +588,13 @@ (sp-item 2752 :flags (bit1 start-dead launch-asap) :binding 2672) (sp-item 2752 :flags (bit1 start-dead launch-asap) :binding 2671) ) - :bounds (new 'static 'sphere :w 262144.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2755) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2755 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) - (sp-flt spt-y (meters 0.0)) - (sp-rnd-flt spt-scale-x (meters 3.0) (meters 1.5) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-b 128.0 128.0 1.0) (sp-rnd-flt spt-a 32.0 32.0 1.0) @@ -851,49 +603,35 @@ (sp-int spt-timer 900) (sp-cpuinfo-flags bit2 bit3 bit14) (sp-func spt-func 'sparticle-track-root-prim) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2752) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2752 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-z 9216.0) - (sp-rnd-flt spt-scale-x (meters 4.0) (meters 1.0) 1.0) - (sp-rnd-flt spt-scale-y (meters 2.0) (meters 0.2) 1.0) + (sp-flt spt-z (meters 2.25)) + (sp-rnd-flt spt-scale-x (meters 4) (meters 1) 1.0) + (sp-rnd-flt spt-scale-y (meters 2) (meters 0.2) 1.0) (sp-flt spt-r 0.0) (sp-rnd-flt spt-g 0.0 128.0 1.0) (sp-rnd-flt spt-b 128.0 128.0 1.0) (sp-flt spt-a 128.0) (sp-rnd-flt spt-omega 0.0 65536.0 1.0) (sp-rnd-int-flt spt-vel-x (meters -0.026666667) 1 218.45334) - (sp-flt spt-vel-z (meters 0.0)) + (sp-flt spt-vel-z (meters 0)) (sp-flt spt-accel-z 0.0) (sp-int spt-timer 900) (sp-cpuinfo-flags bit2 bit3 bit7 bit14) (sp-func spt-func 'sparticle-track-root-prim) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2753) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 14 - (sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) +(defpart 2753 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) - (sp-flt spt-y (meters 4.0)) - (sp-rnd-flt spt-scale-x (meters 2.0) (meters 2.0) 1.0) - (sp-rnd-flt spt-scale-y (meters 8.0) (meters 2.0) 1.0) + (sp-flt spt-y (meters 4)) + (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-scale-y (meters 8) (meters 2) 1.0) (sp-flt spt-r 0.0) (sp-rnd-flt spt-g 0.0 128.0 1.0) (sp-rnd-flt spt-b 128.0 128.0 1.0) @@ -902,23 +640,16 @@ (sp-int-plain-rnd spt-timer 20 29 1) (sp-cpuinfo-flags bit2 bit3) (sp-func spt-func 'sparticle-track-root-prim) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2754) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) +(defpart 2754 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) - (sp-flt spt-y (meters -3.0)) - (sp-rnd-flt spt-scale-x (meters 2.0) (meters 2.0) 1.0) + (sp-flt spt-y (meters -3)) + (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) (sp-flt spt-rot-z (degrees 180.0)) - (sp-rnd-flt spt-scale-y (meters 8.0) (meters 2.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 8) (meters 2) 1.0) (sp-flt spt-r 0.0) (sp-rnd-flt spt-g 0.0 128.0 1.0) (sp-rnd-flt spt-b 128.0 128.0 1.0) @@ -927,41 +658,22 @@ (sp-int-plain-rnd spt-timer 20 29 1) (sp-cpuinfo-flags bit2 bit3) (sp-func spt-func 'sparticle-track-root-prim) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 663) - (new 'static 'sparticle-launch-group - :length 4 - :duration #x384 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-darkecobomb-tick" - :launcher - (new 'static 'inline-array sparticle-group-item 4 - (sp-item 2756) - (sp-item 2757) - (sp-item 2758) - (sp-item 2759) - ) - :bounds (new 'static 'sphere :w 262144.0) - ) +(defpartgroup group-robotboss-darkecobomb-tick + :id 663 + :duration 900 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2756) (sp-item 2757) (sp-item 2758) (sp-item 2759)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2759) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 14 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2759 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.5) - (sp-flt spt-y (meters 0.0)) - (sp-rnd-flt spt-scale-x (meters 10.0) (meters 16.0) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 10) (meters 16) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-g 0.0 128.0 1.0) (sp-rnd-flt spt-b 128.0 128.0 1.0) @@ -971,21 +683,14 @@ (sp-flt spt-fade-a -2.1333334) (sp-int spt-timer 60) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2758) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) +(defpart 2758 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) - (sp-rnd-flt spt-y (meters 0.0) (meters 1.0) 1.0) - (sp-rnd-flt spt-scale-x (meters 16.0) (meters 6.0) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 16) (meters 6) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees -160.0) (degrees 140.0) 1.0) (sp-rnd-flt spt-scale-y (meters 0.6) (meters 0.3) 1.0) @@ -998,21 +703,14 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int spt-next-time 10) (sp-launcher-by-id spt-next-launcher 146) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2757) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) +(defpart 2757 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) - (sp-rnd-flt spt-y (meters 0.0) (meters 1.0) 1.0) - (sp-rnd-flt spt-scale-x (meters 16.0) (meters 6.0) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 16) (meters 6) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees -160.0) (degrees 140.0) 1.0) (sp-rnd-flt spt-scale-y (meters 0.6) (meters 0.3) 1.0) @@ -1025,21 +723,14 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int spt-next-time 10) (sp-launcher-by-id spt-next-launcher 146) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2756) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) +(defpart 2756 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) - (sp-rnd-flt spt-y (meters 0.0) (meters 1.0) 1.0) - (sp-rnd-flt spt-scale-x (meters 16.0) (meters 6.0) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 16) (meters 6) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees -160.0) (degrees 140.0) 1.0) (sp-rnd-flt spt-scale-y (meters 0.6) (meters 0.3) 1.0) @@ -1052,23 +743,14 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int spt-next-time 10) (sp-launcher-by-id spt-next-launcher 146) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 619) - (new 'static 'sparticle-launch-group - :length 22 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-final-boss-mine-explosion" - :launcher - (new 'static 'inline-array sparticle-group-item 22 - (sp-item 2500 :flags (is-3d) :period 900 :length 5) +(defpartgroup group-final-boss-mine-explosion + :id 619 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2500 :flags (is-3d) :period 900 :length 5) (sp-item 2501 :period 900 :length 5) (sp-item 2502 :period 900 :length 40) (sp-item 2503 :period 900 :length 20 :binding 2499) @@ -1091,20 +773,13 @@ (sp-item 2499 :flags (start-dead)) (sp-item 2505 :period 900 :length 20) ) - :bounds (new 'static 'sphere :w 262144.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2503) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 22 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) +(defpart 2503 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) - (sp-flt spt-y (meters 0.0)) - (sp-rnd-flt spt-scale-x (meters 4.0) (meters 2.0) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 0.0) @@ -1112,7 +787,7 @@ (sp-flt spt-b 0.0) (sp-rnd-flt spt-a 32.0 64.0 1.0) (sp-rnd-flt spt-vel-y (meters 0.64) (meters 0.85333335) 1.0) - (sp-flt spt-scalevel-x (meters 0.0)) + (sp-flt spt-scalevel-x (meters 0)) (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) (sp-copy-from-other spt-scalevel-y -4) (sp-rnd-flt spt-accel-y -29.354668 -56.661335 1.0) @@ -1121,21 +796,14 @@ (sp-cpuinfo-flags bit2 bit14) (sp-rnd-flt spt-conerot-x (degrees 35.0) (degrees 55.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 10.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 10) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2499) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 18 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) +(defpart 2499 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 2.0) (meters 4.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 64.0) @@ -1150,35 +818,18 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int spt-next-time 42) (sp-launcher-by-id spt-next-launcher 2506) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2506) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 4 - (sp-flt spt-fade-r -0.14222223) - (sp-flt spt-fade-g -0.14222223) - (sp-flt spt-fade-b -0.14222223) - (sp-end) - ) - ) +(defpart 2506 + :init-specs ((sp-flt spt-fade-r -0.14222223) (sp-flt spt-fade-g -0.14222223) (sp-flt spt-fade-b -0.14222223)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2502) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 25 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2502 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 64.0) - (sp-flt spt-y (meters 0.0)) - (sp-rnd-flt spt-scale-x (meters 2.6) (meters 2.0) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 2.6) (meters 2) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 196.0 64.0 1.0) (sp-rnd-flt spt-g 192.0 64.0 1.0) @@ -1197,66 +848,41 @@ (sp-launcher-by-id spt-next-launcher 2507) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 140.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 2.0) (meters 12.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 2) (meters 12) 1.0) (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2507) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 5 - (sp-flt spt-fade-r 0.0) - (sp-flt spt-fade-g 0.0) - (sp-flt spt-fade-b 0.0) - (sp-flt spt-fade-a -0.21333334) - (sp-end) - ) - ) +(defpart 2507 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2505) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 18 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2505 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) - (sp-flt spt-y (meters 0.0)) + (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) - (sp-flt spt-scale-y (meters 256.0)) + (sp-flt spt-scale-y (meters 256)) (sp-flt spt-r 255.0) (sp-flt spt-g 196.0) (sp-flt spt-b 64.0) (sp-rnd-flt spt-a 32.0 96.0 1.0) - (sp-flt spt-scalevel-y (meters 6.0)) + (sp-flt spt-scalevel-y (meters 6)) (sp-flt spt-fade-r -1.6) (sp-flt spt-fade-g -1.0666667) (sp-flt spt-fade-b 1.0666667) (sp-flt spt-fade-a -1.0666667) (sp-int spt-timer 120) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2501) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 14 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2501 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-y (meters 0.0)) - (sp-flt spt-scale-x (meters 160.0)) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 160)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 128.0) @@ -1266,21 +892,14 @@ (sp-flt spt-fade-a -1.7066667) (sp-int spt-timer 75) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2504) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 24 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) +(defpart 2504 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 32.0) - (sp-flt spt-y (meters 10.0)) - (sp-rnd-flt spt-scale-x (meters 20.0) (meters 16.0) 1.0) + (sp-flt spt-y (meters 10)) + (sp-rnd-flt spt-scale-x (meters 20) (meters 16) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 192.0) @@ -1299,69 +918,38 @@ (sp-launcher-by-id spt-next-launcher 2508) (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 40.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 20.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 20) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2508) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 6 - (sp-flt spt-fade-r -1.6) +(defpart 2508 + :init-specs ((sp-flt spt-fade-r -1.6) (sp-flt spt-fade-g -1.6) (sp-flt spt-fade-b -1.0666667) (sp-int spt-next-time 60) (sp-launcher-by-id spt-next-launcher 2509) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2509) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 7 - (sp-flt spt-fade-r -0.26666668) +(defpart 2509 + :init-specs ((sp-flt spt-fade-r -0.26666668) (sp-flt spt-fade-g -0.26666668) (sp-flt spt-fade-b -0.17777778) (sp-flt spt-fade-a -0.16) (sp-int spt-next-time 180) (sp-launcher-by-id spt-next-launcher 2510) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2510) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 4 - (sp-flt spt-fade-r -0.114285715) - (sp-flt spt-fade-g -0.114285715) - (sp-flt spt-fade-b 0.0) - (sp-end) - ) - ) +(defpart 2510 + :init-specs ((sp-flt spt-fade-r -0.114285715) (sp-flt spt-fade-g -0.114285715) (sp-flt spt-fade-b 0.0)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2500) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) +(defpart 2500 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 4.0) - (sp-flt spt-y (meters 10.0)) - (sp-flt spt-scale-x (meters 30.0)) + (sp-flt spt-y (meters 10)) + (sp-flt spt-scale-x (meters 30)) (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 64.0) @@ -1374,55 +962,31 @@ (sp-cpuinfo-flags bit2 bit3 bit12 bit14) (sp-int spt-next-time 60) (sp-launcher-by-id spt-next-launcher 2511) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2511) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 2 - (sp-flt spt-fade-a -1.4222223) - (sp-end) - ) - ) +(defpart 2511 + :init-specs ((sp-flt spt-fade-a -1.4222223)) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 640) - (new 'static 'sparticle-launch-group - :length 4 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-greenshot-launch" - :launcher - (new 'static 'inline-array sparticle-group-item 4 - (sp-item 2799 :period 600 :length 10) +(defpartgroup group-robotboss-greenshot-launch + :id 640 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2799 :period 600 :length 10) (sp-item 2800 :period 600 :length 10) (sp-item 2801 :period 600 :length 20) (sp-item 2802 :period 600 :length 10) ) - :bounds (new 'static 'sphere :w 32768.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2800) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 19 - (sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) +(defpart 2800 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) - (sp-rnd-flt spt-scale-x (meters 32.0) (meters 128.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 32) (meters 128) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-scale-y (meters 2.0) (meters 4.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-r 0.0 64.0 1.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) (sp-flt spt-b 0.0) @@ -1435,35 +999,20 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int-plain-rnd spt-next-time 5 19 1) (sp-launcher-by-id spt-next-launcher 2803) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2803) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 2 - (sp-flt spt-fade-a -1.6) - (sp-end) - ) - ) +(defpart 2803 + :init-specs ((sp-flt spt-fade-a -1.6)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2801) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 18 - (sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) +(defpart 2801 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) - (sp-rnd-flt spt-scale-x (meters 32.0) (meters 32.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 32) (meters 32) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-scale-y (meters 4.0)) + (sp-flt spt-scale-y (meters 4)) (sp-rnd-flt spt-r 0.0 64.0 1.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) (sp-flt spt-b 0.0) @@ -1475,20 +1024,13 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int-plain-rnd spt-next-time 5 19 1) (sp-launcher-by-id spt-next-launcher 2803) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2802) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2802 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-scale-x (meters 100.0)) + (sp-flt spt-scale-x (meters 100)) (sp-flt spt-rot-z (degrees 0.0)) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 0.0 64.0 1.0) @@ -1501,20 +1043,13 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int spt-next-time 40) (sp-launcher-by-id spt-next-launcher 2804) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2799) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2799 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-scale-x (meters 6.0)) + (sp-flt spt-scale-x (meters 6)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 0.0 64.0 1.0) @@ -1527,23 +1062,15 @@ (sp-flt spt-fade-a -1.7066667) (sp-int spt-timer 105) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 664) - (new 'static 'sparticle-launch-group - :length 49 - :duration #x384 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-greenshot" - :launcher - (new 'static 'inline-array sparticle-group-item 49 - (sp-item 2769 :binding 2766) +(defpartgroup group-robotboss-greenshot + :id 664 + :duration 900 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2769 :binding 2766) (sp-item 2766 :flags (bit1 start-dead launch-asap) :binding 2767) (sp-item 2767 :flags (start-dead) :binding 2768) (sp-item 2768 :flags (start-dead launch-asap)) @@ -1593,19 +1120,12 @@ (sp-item 2768 :flags (start-dead launch-asap)) (sp-item 2768 :flags (start-dead launch-asap)) ) - :bounds (new 'static 'sphere :w 262144.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2769) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 11 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2769 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) - (sp-flt spt-y (meters 0.0)) + (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 0.1)) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-b 0.0) @@ -1613,23 +1133,16 @@ (sp-int spt-timer 900) (sp-cpuinfo-flags bit2 bit3 bit14) (sp-func spt-func 'sparticle-track-root) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2766) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 20 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2766 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-x (meters 0.0) (meters 16.0) 1.0) - (sp-rnd-flt spt-y (meters 0.0) (meters 16.0) 1.0) - (sp-flt spt-z 9216.0) - (sp-flt spt-scale-x (meters 3.0)) + (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-flt spt-z (meters 2.25)) + (sp-flt spt-scale-x (meters 3)) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 128.0) (sp-flt spt-g 128.0) @@ -1637,24 +1150,17 @@ (sp-flt spt-a 128.0) (sp-rnd-flt spt-omega 0.0 65536.0 1.0) (sp-flt spt-vel-x (meters 0.10666667)) - (sp-flt spt-vel-z (meters 0.0)) + (sp-flt spt-vel-z (meters 0)) (sp-int spt-timer 1200) (sp-cpuinfo-flags bit3 bit7) (sp-func spt-func 'sparticle-track-root-prim) (sp-int spt-next-time 10) (sp-launcher-by-id spt-next-launcher 2770) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2770) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 9 - (sp-rnd-flt spt-scale-x (meters 3.0) (meters 2.0) 1.0) +(defpart 2770 + :init-specs ((sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) @@ -1662,20 +1168,13 @@ (sp-rnd-flt spt-b 128.0 128.0 1.0) (sp-int spt-next-time 10) (sp-launcher-by-id spt-next-launcher 2770) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2767) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 22 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2767 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-scale-x (meters 4.0)) + (sp-flt spt-scale-x (meters 4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 0.0 64.0 1.0) @@ -1694,34 +1193,17 @@ (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) (sp-flt spt-conerot-radius (meters 0.1)) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2771) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 4 - (sp-flt spt-fade-r 0.0) - (sp-flt spt-fade-g 0.0) - (sp-flt spt-fade-b 0.0) - (sp-end) - ) - ) +(defpart 2771 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2768) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 25 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2768 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 5.0 1.0) - (sp-rnd-flt spt-scale-x (meters 1.0) (meters 0.25) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 0.0 64.0 1.0) @@ -1742,42 +1224,24 @@ (sp-launcher-by-id spt-next-launcher 2771) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 1.0) (meters 1.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 1) (meters 1) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 646) - (new 'static 'sparticle-launch-group - :length 3 - :duration #x384 - :linger-duration #x5dc - :name "group-robotboss-redshot-charge" - :launcher - (new 'static 'inline-array sparticle-group-item 3 - (sp-item 2699) - (sp-item 2700) - (sp-item 2701) - ) - :bounds (new 'static 'sphere :w 262144.0) - ) +(defpartgroup group-robotboss-redshot-charge + :id 646 + :duration 900 + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2699) (sp-item 2700) (sp-item 2701)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2699) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 19 - (sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) +(defpart 2699 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 3.0) - (sp-rnd-flt spt-scale-x (meters 12.0) (meters 1.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 12) (meters 1) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-scale-y (meters 1.5) (meters 1.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1.5) (meters 1) 1.0) (sp-rnd-flt spt-r 128.0 128.0 1.0) (sp-rnd-flt spt-g 0.0 64.0 1.0) (sp-flt spt-b 0.0) @@ -1790,32 +1254,17 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int-plain-rnd spt-next-time 5 19 1) (sp-launcher-by-id spt-next-launcher 2703) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2703) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 2 - (sp-flt spt-fade-a -1.4222221) - (sp-end) - ) - ) +(defpart 2703 + :init-specs ((sp-flt spt-fade-a -1.4222221)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2700) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 18 - (sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) +(defpart 2700 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 8.0) (meters 32.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 32) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-flt spt-scale-y (meters 2.5)) @@ -1830,20 +1279,13 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int-plain-rnd spt-next-time 5 19 1) (sp-launcher-by-id spt-next-launcher 2703) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2701) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2701 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 6.0) (meters 2.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 6) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) @@ -1855,43 +1297,27 @@ (sp-copy-from-other spt-scalevel-y -4) (sp-int spt-timer 15) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 641) - (new 'static 'sparticle-launch-group - :length 4 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-redshot-launch" - :launcher - (new 'static 'inline-array sparticle-group-item 4 - (sp-item 2805 :period 600 :length 10) +(defpartgroup group-robotboss-redshot-launch + :id 641 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2805 :period 600 :length 10) (sp-item 2806 :period 600 :length 10) (sp-item 2807 :period 600 :length 20) (sp-item 2808 :period 600 :length 10) ) - :bounds (new 'static 'sphere :w 32768.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2806) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 19 - (sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) +(defpart 2806 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) - (sp-rnd-flt spt-scale-x (meters 32.0) (meters 128.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 32) (meters 128) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-scale-y (meters 2.0) (meters 4.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-r 128.0 128.0 1.0) (sp-rnd-flt spt-g 0.0 64.0 1.0) (sp-flt spt-b 0.0) @@ -1904,35 +1330,20 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int-plain-rnd spt-next-time 5 19 1) (sp-launcher-by-id spt-next-launcher 2809) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2809) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 2 - (sp-flt spt-fade-a -1.6) - (sp-end) - ) - ) +(defpart 2809 + :init-specs ((sp-flt spt-fade-a -1.6)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2807) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 18 - (sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) +(defpart 2807 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) - (sp-rnd-flt spt-scale-x (meters 32.0) (meters 32.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 32) (meters 32) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-scale-y (meters 4.0)) + (sp-flt spt-scale-y (meters 4)) (sp-rnd-flt spt-r 128.0 128.0 1.0) (sp-rnd-flt spt-g 0.0 64.0 1.0) (sp-flt spt-b 0.0) @@ -1944,20 +1355,13 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int-plain-rnd spt-next-time 5 19 1) (sp-launcher-by-id spt-next-launcher 2809) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2808) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2808 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-scale-x (meters 100.0)) + (sp-flt spt-scale-x (meters 100)) (sp-flt spt-rot-z (degrees 0.0)) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) @@ -1970,20 +1374,13 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int spt-next-time 40) (sp-launcher-by-id spt-next-launcher 2810) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2805) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2805 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-scale-x (meters 6.0)) + (sp-flt spt-scale-x (meters 6)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) @@ -1996,85 +1393,53 @@ (sp-flt spt-fade-a -1.7066667) (sp-int spt-timer 105) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 665) - (new 'static 'sparticle-launch-group - :length 3 - :duration #x384 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-redshot-body" - :launcher - (new 'static 'inline-array sparticle-group-item 3 - (sp-item 2709) - (sp-item 2710) - (sp-item 2711) - ) - :bounds (new 'static 'sphere :w 262144.0) - ) +(defpartgroup group-robotboss-redshot-body + :id 665 + :duration 900 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2709) (sp-item 2710) (sp-item 2711)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2710) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) +(defpart 2710 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-y (meters 1.0)) - (sp-rnd-flt spt-scale-x (meters 2.0) (meters 0.4) 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 2) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) (sp-rnd-flt spt-g 0.0 64.0 1.0) (sp-flt spt-b 0.0) (sp-flt spt-a 128.0) - (sp-flt spt-vel-y (meters 0.0)) + (sp-flt spt-vel-y (meters 0)) (sp-int spt-timer 5) (sp-cpuinfo-flags bit2) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2711) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2711 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-y (meters 1.0)) - (sp-rnd-flt spt-scale-x (meters 6.0) (meters 0.8) 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 6) (meters 0.8) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) (sp-rnd-flt spt-g 0.0 64.0 1.0) (sp-flt spt-b 0.0) (sp-flt spt-a 128.0) - (sp-flt spt-vel-y (meters 0.0)) + (sp-flt spt-vel-y (meters 0)) (sp-int spt-timer 5) (sp-cpuinfo-flags bit2) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2709) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 20 - (sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) +(defpart 2709 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 8.0) - (sp-flt spt-y (meters 1.0)) + (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 0.6)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -2082,7 +1447,7 @@ (sp-rnd-flt spt-g 64.0 64.0 1.0) (sp-flt spt-b 0.0) (sp-flt spt-a 128.0) - (sp-flt spt-vel-y (meters 0.0)) + (sp-flt spt-vel-y (meters 0)) (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) (sp-flt spt-fade-g -4.266667) (sp-flt spt-fade-a -0.42666668) @@ -2090,41 +1455,23 @@ (sp-cpuinfo-flags bit2) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 1440.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 1440.0) 1.0) - (sp-flt spt-conerot-radius (meters 1.0)) - (sp-end) + (sp-flt spt-conerot-radius (meters 1)) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 647) - (new 'static 'sparticle-launch-group - :length 3 - :duration #x384 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-redshot-warning" - :launcher - (new 'static 'inline-array sparticle-group-item 3 - (sp-item 2712) - (sp-item 2713) - (sp-item 2714 :period 45 :length 5) - ) - :bounds (new 'static 'sphere :w 262144.0) - ) +(defpartgroup group-robotboss-redshot-warning + :id 647 + :duration 900 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2712) (sp-item 2713) (sp-item 2714 :period 45 :length 5)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2714) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 19 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2714 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-y (meters 1.0)) - (sp-rnd-flt spt-scale-x (meters 10.0) (meters 5.0) 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 10) (meters 5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) @@ -2139,21 +1486,14 @@ (sp-int spt-timer 45) (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int spt-next-time 75) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2712) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 19 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2712 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 8.0 1.0) - (sp-flt spt-y (meters 1.0)) - (sp-rnd-flt spt-scale-x (meters 2.0) (meters 4.0) 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees -720.0) (degrees 1440.0) 1.0) (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) @@ -2168,20 +1508,13 @@ (sp-flt spt-fade-a -1.6) (sp-int spt-timer 60) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2713) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 21 - (sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) +(defpart 2713 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-rnd-flt spt-num 2.0 16.0 1.0) - (sp-flt spt-y (meters 1.0)) + (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) @@ -2198,38 +1531,21 @@ (sp-cpuinfo-flags bit0 bit2 bit14) (sp-rnd-flt spt-conerot-x (degrees -180.0) (degrees 720.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 1440.0) 1.0) - (sp-flt spt-conerot-radius (meters 1.0)) - (sp-end) + (sp-flt spt-conerot-radius (meters 1)) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 648) - (new 'static 'sparticle-launch-group - :length 1 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-redshot" - :launcher - (new 'static 'inline-array sparticle-group-item 1 - (sp-item 2626 :flags (is-3d)) - ) - :bounds (new 'static 'sphere :w 32768.0) - ) +(defpartgroup group-robotboss-redshot + :id 648 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2626 :flags (is-3d))) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2626) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) +(defpart 2626 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-scale-x (meters 10.0)) + (sp-flt spt-scale-x (meters 10)) (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-int spt-r 1124073472 1 127.0) @@ -2239,80 +1555,50 @@ (sp-flt spt-fade-a -8.533334) (sp-int spt-timer 10) (sp-cpuinfo-flags bit2 bit3) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 679) - (new 'static 'sparticle-launch-group - :length 1 - :duration #x384 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-redshot-test" - :launcher - (new 'static 'inline-array sparticle-group-item 1 (sp-item 2772)) - :bounds (new 'static 'sphere :w 262144.0) - ) +(defpartgroup group-robotboss-redshot-test + :id 679 + :duration 900 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2772)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2772) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2772 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 1.0) (meters 0.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-int spt-r 1124073472 1 127.0) (sp-flt spt-g 255.0) (sp-flt spt-b 0.0) (sp-flt spt-a 128.0) - (sp-flt spt-vel-y (meters 0.0)) + (sp-flt spt-vel-y (meters 0)) (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) (sp-flt spt-fade-a -2.8444443) (sp-int spt-timer 40) (sp-cpuinfo-flags bit2 bit3) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 649) - (new 'static 'sparticle-launch-group - :length 4 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-red-blowup" - :launcher - (new 'static 'inline-array sparticle-group-item 4 - (sp-item 2629 :period 600 :length 5) +(defpartgroup group-robotboss-red-blowup + :id 649 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2629 :period 600 :length 5) (sp-item 2630 :period 600 :length 40) (sp-item 2631 :period 600 :length 40) (sp-item 2632 :period 600 :length 40) ) - :bounds (new 'static 'sphere :w 32768.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2630) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 25 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2630 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) - (sp-flt spt-y (meters 0.0)) + (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.8) (meters 1.6) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 192.0) @@ -2333,39 +1619,21 @@ (sp-launcher-by-id spt-next-launcher 2633) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 2.0) (meters 4.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 2) (meters 4) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2633) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 5 - (sp-flt spt-fade-r 0.0) - (sp-flt spt-fade-g 0.0) - (sp-flt spt-fade-b 0.0) - (sp-flt spt-fade-a -1.0666667) - (sp-end) - ) - ) +(defpart 2633 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2632) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 18 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2632 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) - (sp-flt spt-y (meters 0.0)) + (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 0.8)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) - (sp-flt spt-scale-y (meters 32.0)) + (sp-flt spt-scale-y (meters 32)) (sp-flt spt-r 192.0) (sp-rnd-flt spt-g 192.0 64.0 1.0) (sp-rnd-flt spt-b 192.0 64.0 1.0) @@ -2377,21 +1645,14 @@ (sp-flt spt-fade-a -1.6) (sp-int spt-timer 60) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2629) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2629 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-y (meters 0.0)) - (sp-flt spt-scale-x (meters 64.0)) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 64)) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) (sp-rnd-flt spt-g 192.0 32.0 1.0) @@ -2400,20 +1661,13 @@ (sp-flt spt-fade-a -2.3272727) (sp-int spt-timer 54) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2631) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 24 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) +(defpart 2631 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) - (sp-rnd-flt spt-scale-x (meters 8.0) (meters 4.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) @@ -2433,90 +1687,50 @@ (sp-launcher-by-id spt-next-launcher 2634) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 6.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 6) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2634) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 6 - (sp-flt spt-fade-r 0.0) +(defpart 2634 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g -1.0666667) (sp-flt spt-fade-b -2.1333334) (sp-int spt-next-time 60) (sp-launcher-by-id spt-next-launcher 2635) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2635) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 7 - (sp-flt spt-fade-r 0.0) +(defpart 2635 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g -0.28444445) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.42666668) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2636) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2636) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 4 - (sp-flt spt-fade-r 0.0) - (sp-flt spt-fade-g 0.0) - (sp-flt spt-fade-b 0.0) - (sp-end) - ) - ) +(defpart 2636 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 650) - (new 'static 'sparticle-launch-group - :length 5 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-red-smoke" - :launcher - (new 'static 'inline-array sparticle-group-item 5 - (sp-item 2776 :period 36 :length 5) +(defpartgroup group-robotboss-red-smoke + :id 650 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2776 :period 36 :length 5) (sp-item 2776 :period 140 :length 5) (sp-item 2776 :period 61 :length 5) (sp-item 2637 :period 15 :length 5) (sp-item 2777) ) - :bounds (new 'static 'sphere :w 32768.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2777) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2777 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-y (meters 0.0)) - (sp-rnd-flt spt-scale-x (meters 0.0) (meters 4.0) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 0) (meters 4) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) (sp-rnd-flt spt-g 192.0 32.0 1.0) @@ -2525,27 +1739,20 @@ (sp-flt spt-fade-a -2.3272727) (sp-int spt-timer 54) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2637) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 20 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) +(defpart 2637 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 4.0) (meters 4.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 4) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) (sp-rnd-flt spt-g 128.0 64.0 1.0) (sp-flt spt-b 128.0) (sp-rnd-flt spt-a 16.0 16.0 1.0) - (sp-flt spt-vel-y (meters 0.0)) + (sp-flt spt-vel-y (meters 0)) (sp-flt spt-scalevel-x (meters 0.013333334)) (sp-rnd-flt spt-rotvel-z (degrees -0.6) (degrees 1.2) 1.0) (sp-copy-from-other spt-scalevel-y -4) @@ -2555,21 +1762,14 @@ (sp-cpuinfo-flags bit2 bit14) (sp-int-plain-rnd spt-next-time 20 89 1) (sp-launcher-by-id spt-next-launcher 2596) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2776) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 25 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2776 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-int spt-num 0 1 8.0) - (sp-flt spt-y (meters 0.0)) - (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1.0) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 192.0) (sp-rnd-flt spt-g 192.0 32.0 1.0) @@ -2589,44 +1789,28 @@ (sp-launcher-by-id spt-next-launcher 2595) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 2.0) (meters 4.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 2) (meters 4) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 642) - (new 'static 'sparticle-launch-group - :length 4 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-yellowshot-launch" - :launcher - (new 'static 'inline-array sparticle-group-item 4 - (sp-item 2778 :period 600 :length 10) +(defpartgroup group-robotboss-yellowshot-launch + :id 642 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2778 :period 600 :length 10) (sp-item 2779 :period 600 :length 10) (sp-item 2780 :period 600 :length 20) (sp-item 2781 :period 600 :length 10) ) - :bounds (new 'static 'sphere :w 32768.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2779) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 19 - (sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) +(defpart 2779 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) - (sp-rnd-flt spt-scale-x (meters 32.0) (meters 128.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 32) (meters 128) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-scale-y (meters 2.0) (meters 4.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-r 128.0 128.0 1.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) (sp-flt spt-b 0.0) @@ -2639,35 +1823,20 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int-plain-rnd spt-next-time 5 19 1) (sp-launcher-by-id spt-next-launcher 2782) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2782) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 2 - (sp-flt spt-fade-a -1.6) - (sp-end) - ) - ) +(defpart 2782 + :init-specs ((sp-flt spt-fade-a -1.6)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2780) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 18 - (sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) +(defpart 2780 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) - (sp-rnd-flt spt-scale-x (meters 32.0) (meters 32.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 32) (meters 32) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-scale-y (meters 4.0)) + (sp-flt spt-scale-y (meters 4)) (sp-rnd-flt spt-r 128.0 128.0 1.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) (sp-flt spt-b 0.0) @@ -2679,20 +1848,13 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int-plain-rnd spt-next-time 5 19 1) (sp-launcher-by-id spt-next-launcher 2782) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2781) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2781 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-scale-x (meters 100.0)) + (sp-flt spt-scale-x (meters 100)) (sp-flt spt-rot-z (degrees 0.0)) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) @@ -2705,20 +1867,13 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int spt-next-time 40) (sp-launcher-by-id spt-next-launcher 2783) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2778) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2778 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-scale-x (meters 6.0)) + (sp-flt spt-scale-x (meters 6)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) @@ -2731,42 +1886,24 @@ (sp-flt spt-fade-a -1.7066667) (sp-int spt-timer 105) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 651) - (new 'static 'sparticle-launch-group - :length 3 - :duration #x384 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-yellowshot-charge" - :launcher - (new 'static 'inline-array sparticle-group-item 3 - (sp-item 2811) - (sp-item 2812) - (sp-item 2813) - ) - :bounds (new 'static 'sphere :w 262144.0) - ) +(defpartgroup group-robotboss-yellowshot-charge + :id 651 + :duration 900 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2811) (sp-item 2812) (sp-item 2813)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2811) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 19 - (sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) +(defpart 2811 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 3.0) - (sp-rnd-flt spt-scale-x (meters 16.0) (meters 1.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 16) (meters 1) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-scale-y (meters 1.5) (meters 1.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1.5) (meters 1) 1.0) (sp-rnd-flt spt-r 128.0 128.0 1.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) (sp-flt spt-b 0.0) @@ -2779,32 +1916,17 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int-plain-rnd spt-next-time 5 19 1) (sp-launcher-by-id spt-next-launcher 2814) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2814) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 2 - (sp-flt spt-fade-a -1.4222221) - (sp-end) - ) - ) +(defpart 2814 + :init-specs ((sp-flt spt-fade-a -1.4222221)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2812) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 18 - (sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) +(defpart 2812 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 12.0) (meters 32.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 12) (meters 32) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-flt spt-scale-y (meters 2.5)) @@ -2819,20 +1941,13 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int-plain-rnd spt-next-time 5 19 1) (sp-launcher-by-id spt-next-launcher 2814) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2813) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2813 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 10.0) (meters 2.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 10) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) @@ -2844,39 +1959,19 @@ (sp-copy-from-other spt-scalevel-y -4) (sp-int spt-timer 15) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 652) - (new 'static 'sparticle-launch-group - :length 5 - :duration #x384 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-yellowshot" - :launcher - (new 'static 'inline-array sparticle-group-item 5 - (sp-item 2815) - (sp-item 2816) - (sp-item 2817) - (sp-item 2818) - (sp-item 2819) - ) - :bounds (new 'static 'sphere :w 262144.0) - ) +(defpartgroup group-robotboss-yellowshot + :id 652 + :duration 900 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2815) (sp-item 2816) (sp-item 2817) (sp-item 2818) (sp-item 2819)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2816) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 19 - (sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) +(defpart 2816 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -2885,7 +1980,7 @@ (sp-rnd-flt spt-g 96.0 64.0 1.0) (sp-flt spt-b 0.0) (sp-flt spt-a 128.0) - (sp-flt spt-vel-y (meters 0.0)) + (sp-flt spt-vel-y (meters 0)) (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) (sp-flt spt-fade-g -4.266667) (sp-flt spt-fade-a -0.42666668) @@ -2893,22 +1988,15 @@ (sp-cpuinfo-flags bit2) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 1440.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 1440.0) 1.0) - (sp-flt spt-conerot-radius (meters 2.0)) - (sp-end) + (sp-flt spt-conerot-radius (meters 2)) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2819) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 18 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2819 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 8.0 1.0) - (sp-flt spt-y (meters 1.0)) - (sp-rnd-flt spt-scale-x (meters 8.0) (meters 4.0) 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees -720.0) (degrees 1440.0) 1.0) (sp-rnd-flt spt-scale-y (meters 0.4) (meters 0.2) 1.0) (sp-rnd-flt spt-r 192.0 64.0 1.0) @@ -2922,20 +2010,13 @@ (sp-flt spt-fade-a -1.6) (sp-int spt-timer 60) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2815) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 22 - (sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) +(defpart 2815 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-rnd-flt spt-num 2.0 16.0 1.0) - (sp-flt spt-y (meters 1.0)) + (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) @@ -2953,90 +2034,60 @@ (sp-cpuinfo-flags bit0 bit2 bit14) (sp-rnd-flt spt-conerot-x (degrees -180.0) (degrees 720.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 1440.0) 1.0) - (sp-flt spt-conerot-radius (meters 1.0)) - (sp-end) + (sp-flt spt-conerot-radius (meters 1)) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2817) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) +(defpart 2817 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 5.0) (meters 0.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) (sp-flt spt-g 128.0) (sp-flt spt-b 0.0) (sp-flt spt-a 128.0) - (sp-flt spt-vel-y (meters 0.0)) + (sp-flt spt-vel-y (meters 0)) (sp-flt spt-scalevel-x (meters -0.10666667)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-g -1.7066667) (sp-flt spt-fade-a -1.7066667) (sp-int spt-timer 75) (sp-cpuinfo-flags bit2) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2818) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 12 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2818 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 10.0) (meters 1.6) 1.0) + (sp-rnd-flt spt-scale-x (meters 10) (meters 1.6) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) (sp-flt spt-g 128.0) (sp-flt spt-b 0.0) (sp-flt spt-a 128.0) - (sp-flt spt-vel-y (meters 0.0)) + (sp-flt spt-vel-y (meters 0)) (sp-int spt-timer 5) (sp-cpuinfo-flags bit2) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 653) - (new 'static 'sparticle-launch-group - :length 4 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-yellow-blowup" - :launcher - (new 'static 'inline-array sparticle-group-item 4 - (sp-item 2648 :period 600 :length 5) +(defpartgroup group-robotboss-yellow-blowup + :id 653 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2648 :period 600 :length 5) (sp-item 2649 :period 600 :length 40) (sp-item 2650 :period 600 :length 40) (sp-item 2651 :period 600 :length 40) ) - :bounds (new 'static 'sphere :w 32768.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2649) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 25 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2649 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) - (sp-flt spt-y (meters 0.0)) - (sp-rnd-flt spt-scale-x (meters 1.0) (meters 2.0) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 2) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 192.0 64.0 1.0) (sp-rnd-flt spt-g 128.0 64.0 1.0) @@ -3056,39 +2107,21 @@ (sp-launcher-by-id spt-next-launcher 2652) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 2.0) (meters 4.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 2) (meters 4) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2652) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 5 - (sp-flt spt-fade-r 0.0) - (sp-flt spt-fade-g 0.0) - (sp-flt spt-fade-b 0.0) - (sp-flt spt-fade-a -1.0666667) - (sp-end) - ) - ) +(defpart 2652 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2651) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 18 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2651 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) - (sp-flt spt-y (meters 0.0)) + (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 0.8)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) - (sp-flt spt-scale-y (meters 64.0)) + (sp-flt spt-scale-y (meters 64)) (sp-rnd-flt spt-r 192.0 64.0 1.0) (sp-rnd-flt spt-g 128.0 64.0 1.0) (sp-flt spt-b 0.0) @@ -3100,21 +2133,14 @@ (sp-flt spt-fade-a -1.6) (sp-int spt-timer 60) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2648) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2648 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-y (meters 0.0)) - (sp-flt spt-scale-x (meters 128.0)) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 128)) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 128.0) (sp-rnd-flt spt-g 192.0 64.0 1.0) @@ -3123,20 +2149,13 @@ (sp-flt spt-fade-a -2.3272727) (sp-int spt-timer 54) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2650) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 24 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) +(defpart 2650 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) - (sp-rnd-flt spt-scale-x (meters 16.0) (meters 8.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 16) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 192.0 64.0 1.0) @@ -3156,90 +2175,50 @@ (sp-launcher-by-id spt-next-launcher 2653) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 12.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 12) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2653) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 6 - (sp-flt spt-fade-r 0.0) +(defpart 2653 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g -1.0666667) (sp-flt spt-fade-b -2.1333334) (sp-int spt-next-time 60) (sp-launcher-by-id spt-next-launcher 2654) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2654) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 7 - (sp-flt spt-fade-r -0.28444445) +(defpart 2654 + :init-specs ((sp-flt spt-fade-r -0.28444445) (sp-flt spt-fade-g -0.28444445) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.42666668) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2655) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2655) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 4 - (sp-flt spt-fade-r 0.0) - (sp-flt spt-fade-g 0.0) - (sp-flt spt-fade-b 0.0) - (sp-end) - ) - ) +(defpart 2655 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 654) - (new 'static 'sparticle-launch-group - :length 5 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-yellow-smoke" - :launcher - (new 'static 'inline-array sparticle-group-item 5 - (sp-item 2820 :period 36 :length 5) +(defpartgroup group-robotboss-yellow-smoke + :id 654 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2820 :period 36 :length 5) (sp-item 2820 :period 140 :length 5) (sp-item 2820 :period 61 :length 5) (sp-item 2656 :period 15 :length 5) (sp-item 2821) ) - :bounds (new 'static 'sphere :w 32768.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2821) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2821 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-flt spt-y (meters 0.0)) - (sp-rnd-flt spt-scale-x (meters 0.0) (meters 4.0) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 0) (meters 4) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) (sp-rnd-flt spt-g 192.0 64.0 1.0) @@ -3248,27 +2227,20 @@ (sp-flt spt-fade-a -2.3272727) (sp-int spt-timer 54) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2656) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 20 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) +(defpart 2656 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 8.0) (meters 4.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) (sp-rnd-flt spt-g 192.0 64.0 1.0) (sp-flt spt-b 128.0) (sp-rnd-flt spt-a 16.0 16.0 1.0) - (sp-flt spt-vel-y (meters 0.0)) + (sp-flt spt-vel-y (meters 0)) (sp-flt spt-scalevel-x (meters 0.026666667)) (sp-rnd-flt spt-rotvel-z (degrees -0.6) (degrees 1.2) 1.0) (sp-copy-from-other spt-scalevel-y -4) @@ -3278,21 +2250,14 @@ (sp-cpuinfo-flags bit2 bit14) (sp-int-plain-rnd spt-next-time 20 89 1) (sp-launcher-by-id spt-next-launcher 2596) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2820) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 25 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2820 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-int spt-num 0 2 8.0) - (sp-flt spt-y (meters 0.0)) - (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1.0) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 192.0 64.0 1.0) (sp-flt spt-g 192.0) @@ -3312,34 +2277,14 @@ (sp-launcher-by-id spt-next-launcher 2595) (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-conerot-radius (meters 2.0) (meters 4.0) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 2) (meters 4) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 655) - (new 'static 'sparticle-launch-group - :length 1 - :duration #xbb8 - :linger-duration #x5dc - :name "group-white-eco" - :launcher - (new 'static 'inline-array sparticle-group-item 1 (sp-item 2852)) - :bounds - (new 'static 'sphere :y 2048.0 :w 6144.0) - ) - ) +(defpartgroup group-white-eco :id 655 :bounds (static-bspherem 0 0.5 0 1.5) :parts ((sp-item 2852))) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2852) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 12 - (sp-flt spt-num 1.0) +(defpart 2852 + :init-specs ((sp-flt spt-num 1.0) (sp-int spt-rot-x 16) (sp-flt spt-r 4096.0) (sp-flt spt-g 3276.8) @@ -3350,18 +2295,11 @@ (sp-rnd-flt spt-conerot-x (degrees -1440.0) (degrees 2880.0) 1.0) (sp-rnd-flt spt-conerot-y (degrees -1440.0) (degrees 2880.0) 1.0) (sp-flt spt-rotate-y (degrees 6.0000005)) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2657) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 20 - (sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) +(defpart 2657 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-int spt-rot-x 4) @@ -3380,32 +2318,17 @@ (sp-func spt-func 'sparticle-track-root) (sp-int spt-next-time 90) (sp-launcher-by-id spt-next-launcher 2661) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2661) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 2 - (sp-flt spt-fade-a -0.53333336) - (sp-end) - ) - ) +(defpart 2661 + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2658) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 19 - (sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) +(defpart 2658 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.0) - (sp-rnd-flt spt-scale-x (meters 2.0) (meters 0.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-flt spt-scale-y (meters 0.2)) @@ -3421,22 +2344,15 @@ (sp-func spt-func 'sparticle-track-root) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 2661) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2659) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 14 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2659 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.0) (sp-flt spt-scale-x (meters 3.5)) (sp-flt spt-rot-z (degrees 0.0)) - (sp-flt spt-scale-y (meters 3.0)) + (sp-flt spt-scale-y (meters 3)) (sp-flt spt-r 192.0) (sp-flt spt-g 192.0) (sp-rnd-flt spt-b 0.0 128.0 1.0) @@ -3445,20 +2361,13 @@ (sp-int spt-timer 5) (sp-cpuinfo-flags bit2 bit3 bit14) (sp-func spt-func 'sparticle-track-root) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2660) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 14 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2660 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.0) - (sp-flt spt-scale-x (meters 4.0)) + (sp-flt spt-scale-x (meters 4)) (sp-flt spt-rot-z (degrees 0.0)) (sp-flt spt-scale-y (meters 3.5)) (sp-flt spt-r 128.0) @@ -3469,23 +2378,14 @@ (sp-int spt-timer 5) (sp-cpuinfo-flags bit2 bit3 bit14) (sp-func spt-func 'sparticle-track-root) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 666) - (new 'static 'sparticle-launch-group - :length 14 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-finalboss-blue-claw-beam" - :launcher - (new 'static 'inline-array sparticle-group-item 14 - (sp-item 2719 :binding 2716) +(defpartgroup group-finalboss-blue-claw-beam + :id 666 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2719 :binding 2716) (sp-item 2716 :flags (bit1 start-dead launch-asap) :binding 2717) (sp-item 2716 :flags (bit1 start-dead launch-asap) :binding 2718) (sp-item 2716 :flags (bit1 start-dead launch-asap) :binding 2717) @@ -3500,36 +2400,19 @@ (sp-item 2721) (sp-item 2722) ) - :bounds (new 'static 'sphere :w 262144.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 667) - (new 'static 'sparticle-launch-group - :length 1 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-finalboss-blue-claw-beam-impact" - :launcher - (new 'static 'inline-array sparticle-group-item 1 - (sp-item 2723 :flags (is-3d)) - ) - :bounds (new 'static 'sphere :w 40960.0) - ) +(defpartgroup group-finalboss-blue-claw-beam-impact + :id 667 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2723 :flags (is-3d))) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2723) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2723 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 12.0) (meters 24.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) (sp-rnd-flt spt-rot-y (degrees 25.000002) (degrees 20.0) 1.0) (sp-flt spt-rot-z (degrees 180.0)) @@ -3541,20 +2424,13 @@ (sp-flt spt-fade-a -5.12) (sp-int spt-timer 20) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2719) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2719 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.01) - (sp-rnd-flt spt-scale-x (meters 3.0) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 0.0) (sp-flt spt-g 0.0) @@ -3567,23 +2443,16 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-flt spt-conerot-x (degrees 102.0)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 0.5) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2716) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 19 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2716 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-x (meters 0.0) (meters 16.0) 1.0) - (sp-rnd-flt spt-y (meters 0.0) (meters 16.0) 1.0) - (sp-rnd-flt spt-z 4096.0 2048.0 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 2.2) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 0.0) @@ -3592,23 +2461,16 @@ (sp-flt spt-a 128.0) (sp-rnd-flt spt-omega 0.0 65536.0 1.0) (sp-rnd-int-flt spt-vel-x (meters -0.026666667) 1 218.45334) - (sp-rnd-flt spt-vel-y (meters 0.0) (meters 0.053333335) 1.0) - (sp-flt spt-vel-z (meters 0.0)) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.053333335) 1.0) + (sp-flt spt-vel-z (meters 0)) (sp-flt spt-accel-z 0.0) (sp-int spt-timer 1800) (sp-cpuinfo-flags bit2 bit3 bit7 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2717) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) +(defpart 2717 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -3623,18 +2485,11 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int spt-next-time 10) (sp-launcher-by-id spt-next-launcher 146) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2718) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) +(defpart 2718 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -3649,18 +2504,11 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int spt-next-time 10) (sp-launcher-by-id spt-next-launcher 146) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2720) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2720 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.85) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-y (meters 2.5) (meters 1.5) 1.0) @@ -3675,21 +2523,14 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-flt spt-conerot-x (degrees 102.0)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 0.5) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2722) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2722 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 2.0) (meters 1.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 0.0) (sp-flt spt-g 0.0) @@ -3702,21 +2543,14 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-flt spt-conerot-x (degrees 102.0)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 0.5) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2721) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2721 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 4.0) (meters 8.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 4) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 0.0 128.0 1.0) @@ -3726,23 +2560,14 @@ (sp-flt spt-fade-a -5.12) (sp-int spt-timer 20) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 668) - (new 'static 'sparticle-launch-group - :length 13 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-finalboss-red-claw-beam" - :launcher - (new 'static 'inline-array sparticle-group-item 13 - (sp-item 2726 :binding 2724) +(defpartgroup group-finalboss-red-claw-beam + :id 668 + :flags (use-local-clock) + :bounds (static-bspherem 0 23 0 64) + :parts ((sp-item 2726 :binding 2724) (sp-item 2724 :flags (bit1 start-dead launch-asap) :binding 2725) (sp-item 2724 :flags (bit1 start-dead launch-asap) :binding 2725) (sp-item 2724 :flags (bit1 start-dead launch-asap) :binding 2725) @@ -3756,20 +2581,12 @@ (sp-item 2728) (sp-item 2729) ) - :bounds - (new 'static 'sphere :y 94208.0 :w 262144.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2730) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2730 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 12.0) (meters 24.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) (sp-rnd-flt spt-rot-y (degrees -20.0) (degrees 40.0) 1.0) (sp-flt spt-rot-z (degrees 68.0)) @@ -3781,20 +2598,13 @@ (sp-flt spt-fade-a -5.12) (sp-int spt-timer 20) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2726) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2726 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.02) - (sp-rnd-flt spt-scale-x (meters 6.0) (meters 3.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) (sp-rnd-flt spt-g 0.0 64.0 1.0) @@ -3807,22 +2617,15 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-flt spt-conerot-x (degrees 100.00001)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2724) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 19 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2724 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-x (meters 0.0) (meters 16.0) 1.0) - (sp-rnd-flt spt-y (meters 0.0) (meters 16.0) 1.0) - (sp-rnd-flt spt-z 5120.0 2048.0 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 1.25) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1.3) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) @@ -3831,25 +2634,18 @@ (sp-flt spt-a 127.0) (sp-rnd-flt spt-omega 0.0 65536.0 1.0) (sp-rnd-int-flt spt-vel-x (meters -0.026666667) 1 218.45334) - (sp-rnd-flt spt-vel-y (meters 0.0) (meters 0.053333335) 1.0) - (sp-flt spt-vel-z (meters 0.0)) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.053333335) 1.0) + (sp-flt spt-vel-z (meters 0)) (sp-flt spt-accel-z 0.0) (sp-int spt-timer 450) (sp-cpuinfo-flags bit2 bit3 bit7 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2725) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 21 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) +(defpart 2725 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 1.0) (meters 0.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 100.0 28.0 1.0) @@ -3867,18 +2663,11 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-int spt-next-time 240) (sp-launcher-by-id spt-next-launcher 171) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2727) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2727 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.85) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-y (meters 2.5) (meters 1.5) 1.0) @@ -3893,21 +2682,14 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-flt spt-conerot-x (degrees 100.00001)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 0.5) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2729) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2729 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.8) - (sp-rnd-flt spt-scale-x (meters 4.0) (meters 2.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) (sp-rnd-flt spt-g 0.0 64.0 1.0) @@ -3920,20 +2702,13 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-flt spt-conerot-x (degrees 100.00001)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2728) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2728 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 4.0) (meters 8.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 4) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) @@ -3943,23 +2718,14 @@ (sp-flt spt-fade-a -5.12) (sp-int spt-timer 20) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 670) - (new 'static 'sparticle-launch-group - :length 15 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-finalboss-yellow-claw-beam" - :launcher - (new 'static 'inline-array sparticle-group-item 15 - (sp-item 2733 :binding 2731) +(defpartgroup group-finalboss-yellow-claw-beam + :id 670 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2733 :binding 2731) (sp-item 2731 :flags (bit1 start-dead launch-asap) :binding 2732) (sp-item 2731 :flags (bit1 start-dead launch-asap) :binding 2732) (sp-item 2731 :flags (bit1 start-dead launch-asap) :binding 2732) @@ -3975,37 +2741,19 @@ (sp-item 2735) (sp-item 2736) ) - :bounds (new 'static 'sphere :w 262144.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 671) - (new 'static 'sparticle-launch-group - :length 1 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name - "group-finalboss-yellow-claw-beam-impact" - :launcher - (new 'static 'inline-array sparticle-group-item 1 - (sp-item 2737 :flags (is-3d)) - ) - :bounds (new 'static 'sphere :w 40960.0) - ) +(defpartgroup group-finalboss-yellow-claw-beam-impact + :id 671 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2737 :flags (is-3d))) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2737) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2737 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 12.0) (meters 24.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) (sp-rnd-flt spt-rot-y (degrees -20.0) (degrees 40.0) 1.0) (sp-flt spt-rot-z (degrees 115.0)) @@ -4017,20 +2765,13 @@ (sp-flt spt-fade-a -5.12) (sp-int spt-timer 20) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2733) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2733 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.025) - (sp-rnd-flt spt-scale-x (meters 3.0) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 100.0 28.0 1.0) (sp-rnd-flt spt-g 64.0 64.0 1.0) @@ -4043,23 +2784,16 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-flt spt-conerot-x (degrees 85.0)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 0.5) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2731) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 19 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2731 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-x (meters 0.0) (meters 16.0) 1.0) - (sp-rnd-flt spt-y (meters 0.0) (meters 16.0) 1.0) - (sp-rnd-flt spt-z 5120.0 2048.0 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 1.25) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1.2) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 100.0 28.0 1.0) @@ -4068,25 +2802,18 @@ (sp-flt spt-a 96.0) (sp-rnd-flt spt-omega 0.0 65536.0 1.0) (sp-rnd-int-flt spt-vel-x (meters -0.026666667) 1 218.45334) - (sp-rnd-flt spt-vel-y (meters 0.0) (meters 0.053333335) 1.0) - (sp-flt spt-vel-z (meters 0.0)) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.053333335) 1.0) + (sp-flt spt-vel-z (meters 0)) (sp-flt spt-accel-z 0.0) (sp-int spt-timer 600) (sp-cpuinfo-flags bit2 bit3 bit7 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2732) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2732 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) - (sp-rnd-flt spt-scale-x (meters 1.0) (meters 0.4) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 100.0 28.0 1.0) (sp-rnd-flt spt-g 64.0 64.0 1.0) @@ -4099,18 +2826,11 @@ (sp-rnd-flt spt-accel-y -0.40960002 -0.6144 1.0) (sp-int-plain-rnd spt-timer 30 299 1) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2734) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2734 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.85) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-y (meters 2.5) (meters 1.5) 1.0) @@ -4125,21 +2845,14 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-flt spt-conerot-x (degrees 85.0)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 0.5) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2736) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2736 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.7) - (sp-rnd-flt spt-scale-x (meters 3.0) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 100.0 28.0 1.0) (sp-rnd-flt spt-g 64.0 64.0 1.0) @@ -4152,21 +2865,14 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-flt spt-conerot-x (degrees 85.0)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 0.5) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2735) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2735 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.7) - (sp-rnd-flt spt-scale-x (meters 4.0) (meters 8.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 4) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 255.0) @@ -4176,23 +2882,14 @@ (sp-flt spt-fade-a -5.12) (sp-int spt-timer 20) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 672) - (new 'static 'sparticle-launch-group - :length 15 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-finalboss-green-claw-beam" - :launcher - (new 'static 'inline-array sparticle-group-item 15 - (sp-item 2740 :binding 2738) +(defpartgroup group-finalboss-green-claw-beam + :id 672 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2740 :binding 2738) (sp-item 2738 :flags (bit1 start-dead launch-asap) :binding 2739) (sp-item 2738 :flags (bit1 start-dead launch-asap) :binding 2739) (sp-item 2738 :flags (bit1 start-dead launch-asap) :binding 2739) @@ -4208,37 +2905,19 @@ (sp-item 2742) (sp-item 2743) ) - :bounds (new 'static 'sphere :w 262144.0) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 673) - (new 'static 'sparticle-launch-group - :length 1 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name - "group-finalboss-green-claw-beam-impact" - :launcher - (new 'static 'inline-array sparticle-group-item 1 - (sp-item 2744 :flags (is-3d)) - ) - :bounds (new 'static 'sphere :w 40960.0) - ) +(defpartgroup group-finalboss-green-claw-beam-impact + :id 673 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2744 :flags (is-3d))) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2744) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2744 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 12.0) (meters 24.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) (sp-rnd-flt spt-rot-y (degrees -20.0) (degrees 40.0) 1.0) (sp-flt spt-rot-z (degrees 180.0)) @@ -4250,20 +2929,13 @@ (sp-flt spt-fade-a -5.12) (sp-int spt-timer 20) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2740) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2740 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.025) - (sp-rnd-flt spt-scale-x (meters 3.0) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 0.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) @@ -4276,23 +2948,16 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-flt spt-conerot-x (degrees 100.00001)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 0.5) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2738) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 19 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2738 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-x (meters 0.0) (meters 16.0) 1.0) - (sp-rnd-flt spt-y (meters 0.0) (meters 16.0) 1.0) - (sp-rnd-flt spt-z 5120.0 2048.0 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 1.25) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1.2) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 0.0) @@ -4301,25 +2966,18 @@ (sp-flt spt-a 96.0) (sp-rnd-flt spt-omega 0.0 65536.0 1.0) (sp-rnd-int-flt spt-vel-x (meters -0.026666667) 1 218.45334) - (sp-rnd-flt spt-vel-y (meters 0.0) (meters 0.053333335) 1.0) - (sp-flt spt-vel-z (meters 0.0)) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.053333335) 1.0) + (sp-flt spt-vel-z (meters 0)) (sp-flt spt-accel-z 0.0) (sp-int spt-timer 600) (sp-cpuinfo-flags bit2 bit7 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2739) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2739 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) - (sp-rnd-flt spt-scale-x (meters 1.0) (meters 0.4) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 0.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) @@ -4331,18 +2989,11 @@ (sp-rnd-flt spt-accel-y -0.40960002 -0.6144 1.0) (sp-int-plain-rnd spt-timer 30 299 1) (sp-cpuinfo-flags bit2 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2741) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2741 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.85) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-y (meters 2.5) (meters 1.5) 1.0) @@ -4357,21 +3008,14 @@ (sp-cpuinfo-flags bit2 bit3 bit14) (sp-flt spt-conerot-x (degrees 100.00001)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 0.5) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2743) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) +(defpart 2743 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.75) - (sp-rnd-flt spt-scale-x (meters 4.0) (meters 1.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 4) (meters 1) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-r 0.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) @@ -4384,21 +3028,14 @@ (sp-cpuinfo-flags bit2 bit14) (sp-flt spt-conerot-x (degrees 100.00001)) (sp-flt spt-conerot-y (degrees -90.0)) - (sp-rnd-flt spt-conerot-radius (meters 0.0) (meters 0.5) 1.0) - (sp-end) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-id-table* 2742) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 13 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) +(defpart 2742 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 4.0) (meters 8.0) 1.0) + (sp-rnd-flt spt-scale-x (meters 4) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 0.0 192.0 1.0) @@ -4408,72 +3045,41 @@ (sp-flt spt-fade-a -5.12) (sp-int spt-timer 20) (sp-cpuinfo-flags bit2 bit3 bit14) - (sp-end) ) - ) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 674) - (new 'static 'sparticle-launch-group - :length 1 - :duration #x384 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-blue-claw-glow" - :launcher - (new 'static 'inline-array sparticle-group-item 1 (sp-item 2324)) - :bounds (new 'static 'sphere :w 262144.0) - ) +(defpartgroup group-robotboss-blue-claw-glow + :id 674 + :duration 900 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2324)) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 675) - (new 'static 'sparticle-launch-group - :length 1 - :duration #x384 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-green-claw-glow" - :launcher - (new 'static 'inline-array sparticle-group-item 1 (sp-item 2324)) - :bounds (new 'static 'sphere :w 262144.0) - ) +(defpartgroup group-robotboss-green-claw-glow + :id 675 + :duration 900 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2324)) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 676) - (new 'static 'sparticle-launch-group - :length 1 - :duration #x384 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-red-claw-glow" - :launcher - (new 'static 'inline-array sparticle-group-item 1 (sp-item 2324)) - :bounds (new 'static 'sphere :w 262144.0) - ) +(defpartgroup group-robotboss-red-claw-glow + :id 676 + :duration 900 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2324)) ) -;; failed to figure out what this is: -(set! - (-> *part-group-id-table* 677) - (new 'static 'sparticle-launch-group - :length 1 - :duration #x384 - :linger-duration #x5dc - :flags (sp-group-flag use-local-clock) - :name "group-robotboss-yellow-claw-glow" - :launcher - (new 'static 'inline-array sparticle-group-item 1 (sp-item 2324)) - :bounds (new 'static 'sphere :w 262144.0) - ) +(defpartgroup group-robotboss-yellow-claw-glow + :id 677 + :duration 900 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2324)) ) -;; failed to figure out what this is: 0 diff --git a/goal_src/levels/finalboss/robotboss-weapon.gc b/goal_src/levels/finalboss/robotboss-weapon.gc index 7544d70f79..302f44df2c 100644 --- a/goal_src/levels/finalboss/robotboss-weapon.gc +++ b/goal_src/levels/finalboss/robotboss-weapon.gc @@ -7,6 +7,10 @@ ;; DECOMP BEGINS +(import "goal_src/import/darkecobomb-ag.gc") +(import "goal_src/import/greenshot-ag.gc") +(import "goal_src/import/redring-ag.gc") + (deftype torus (structure) ((origin vector :inline :offset-assert 0) (axis vector :inline :offset-assert 16) @@ -209,15 +213,13 @@ ) (defstate arcing-shot-debug-trajectory (arcing-shot) - :trans - (behavior () + :trans (behavior () (arcing-shot-setup (camera-pos) (-> self entity extra trans) 40960.0) (arcing-shot-draw) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (format *stdcon* "debug trajectory~%") (suspend) ) @@ -244,38 +246,27 @@ ) -(defskelgroup *darkecobomb-sg* darkecobomb - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 3.5 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *darkecobomb-sg* darkecobomb darkecobomb-lod0-jg darkecobomb-idle-ja + ((darkecobomb-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3.5 0 6) + ) (defstate darkecobomb-explode (darkecobomb) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (send-event *target* 'reset-pickup 'eco) - (sound-play-by-name (static-sound-name "explod-bomb") (new-sound-id) 1024 0 0 1 #f) + (sound-play "explod-bomb" :position #f) (activate! *camera-smush-control* 819.2 37 600 1.0 0.995) (send-event (ppointer->process (-> self parent)) 'flash 255.0) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - part-tracker-init - (-> *part-group-id-table* 619) - 900 - #f - #f - #f - (-> self root-override trans) - ) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 619) + 900 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (logior! (-> self draw status) (draw-status hidden)) (cond @@ -295,17 +286,7 @@ (if *target* (logclear! (-> *target* mask) (process-mask sleep)) ) - (let ((a1-12 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-12 from) self) - (set! (-> a1-12 num-params) 2) - (set! (-> a1-12 message) 'attack-invinc) - (set! (-> a1-12 param 0) (the-as uint #f)) - (let ((a0-21 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-21 mode) 'instant-death) - (set! (-> a1-12 param 1) (the-as uint a0-21)) - ) - (send-event-function *target* a1-12) - ) + (send-event *target* 'attack-invinc #f (static-attack-info ((mode 'instant-death)))) ) (else (send-event (ppointer->process (-> self parent)) 'bomb-done) @@ -314,8 +295,7 @@ (deactivate self) (none) ) - :post - (the-as (function none :behavior darkecobomb) ja-post) + :post (the-as (function none :behavior darkecobomb) ja-post) ) (defbehavior darkecobomb-handler darkecobomb ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) @@ -334,21 +314,17 @@ ) (defstate darkecobomb-countdown (darkecobomb) - :event - darkecobomb-handler - :enter - (behavior () + :event darkecobomb-handler + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (set! (-> self next-tick) 0.9) (none) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (none) ) - :trans - (behavior () + :trans (behavior () (darkecobomb-explode-if-player-high-enough) (let ((f0-1 (fmax @@ -363,36 +339,25 @@ (set! (-> self anim-speed) (+ 1.0 f1-5)) ) (when (< (cos (* 16384.0 (- 1.0 f0-1))) (-> self next-tick)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 663) - 150 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 663) + 150 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (set! (-> self next-tick) (+ -0.06 (-> self next-tick))) - (sound-play-by-name (static-sound-name "robo-warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "robo-warning") ) ) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (the int (-> self countdown-time))) (go darkecobomb-explode #f) ) - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) + (when (ja-group? (-> self draw art-group data 5)) (let ((gp-2 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-2 (-> self node-list data 5)) (spawn (-> self part) gp-2) @@ -400,113 +365,64 @@ ) (none) ) - :code - (behavior () - (sound-play-by-name (static-sound-name "bomb-open") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (sound-play "bomb-open") + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) (-> self anim-speed)) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (update! (-> self sound)) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (none) ) - :post - (the-as (function none :behavior darkecobomb) transform-post) + :post (the-as (function none :behavior darkecobomb) transform-post) ) (defstate darkecobomb-land (darkecobomb) - :event - darkecobomb-handler - :enter - (behavior () + :event darkecobomb-handler + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) 0 (none) ) - :trans - (behavior () + :trans (behavior () (darkecobomb-explode-if-player-high-enough) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 0.5)) (go darkecobomb-countdown) ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (while #t - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior darkecobomb) transform-post) + :post (the-as (function none :behavior darkecobomb) transform-post) ) (defstate darkecobomb-idle (darkecobomb) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (arcing-shot-calculate (-> self root-override trans) (/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time))) @@ -516,48 +432,22 @@ ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior darkecobomb) transform-post) + :post (the-as (function none :behavior darkecobomb) transform-post) ) (defbehavior darkecobomb-init-by-other darkecobomb ((arg0 vector) (arg1 vector) (arg2 float) (arg3 time-frame) (arg4 float)) @@ -587,20 +477,7 @@ (arcing-shot-setup arg0 arg1 arg2) (set! (-> self countdown-time) arg4) (set! (-> self flight-time) arg3) - (set! (-> self sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "bomb-spin") - :volume #x400 - :fo-max 80 - ) - (-> self to) - ) - ) + (set! (-> self sound) (new 'process 'ambient-sound (static-sound-spec "bomb-spin" :fo-max 80) (-> self to))) (go darkecobomb-idle) (none) ) @@ -618,22 +495,17 @@ ) -(defskelgroup *greenshot-sg* greenshot - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *greenshot-sg* greenshot greenshot-lod0-jg greenshot-idle-ja + ((greenshot-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defstate greenshot-idle (greenshot) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (arcing-shot-calculate (-> self root-override trans) (/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time))) @@ -644,48 +516,17 @@ (spawn (-> self part) (-> self root-override trans)) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior greenshot) transform-post) + :post (the-as (function none :behavior greenshot) transform-post) ) (defbehavior greenshot-init-by-other greenshot ((arg0 vector) (arg1 vector) (arg2 float) (arg3 time-frame)) @@ -769,13 +610,10 @@ (none) ) -(defskelgroup *redring-sg* redring - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 40) - :longest-edge (meters 0) - ) +(defskelgroup *redring-sg* redring redring-lod0-jg redring-idle-ja + ((redring-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 40) + ) (defbehavior redshot-trans redshot ((arg0 time-frame)) (let ((s5-0 (new 'stack-no-clear 'matrix))) @@ -794,58 +632,38 @@ ) (defstate redshot-explode (redshot) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (sound-play-by-name (static-sound-name "red-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "red-explode") (logclear! (-> self draw status) (draw-status hidden)) (quaternion-identity! (-> self root-override quat)) (set! (-> self ring radius-secondary) 3072.0) (set! (-> self ring origin quad) (-> self root-override trans quad)) (+! (-> self ring origin y) (-> self ring radius-secondary)) (set-vector! (-> self ring axis) 0.0 1.0 0.0 1.0) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 648) - -1 - redshot-particle-callback - (-> self ppointer) - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) - ) - ) - ) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 648) + -1 + redshot-particle-callback + (-> self ppointer) + #f + (-> self root-override trans) + :to self + ) + ) + ) (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self ring radius-primary) (* 204.8 (the float (- (-> *display* game-frame-counter) (-> self state-time)))) ) (let ((gp-0 (new 'stack-no-clear 'vector))) (when (dummy-11 (-> self ring) gp-0) (vector-normalize! gp-0 16384.0) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack) - (set! (-> a1-2 param 0) (the-as uint #f)) - (let ((v1-8 (new 'static 'attack-info :mask #x2))) - (set! (-> v1-8 vector quad) (-> gp-0 quad)) - (set! (-> a1-2 param 1) (the-as uint v1-8)) - ) - (send-event-function *target* a1-2) - ) + (send-event *target* 'attack #f (static-attack-info ((vector gp-0)))) (send-event (ppointer->process (-> self parent)) 'hit-jak) ) ) @@ -870,19 +688,14 @@ ) (none) ) - :code - (behavior () - (while #t - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) (* 0.000016276043 (-> self ring radius-primary))) - ) + :code (behavior () + (loop + (ja :num-func num-func-identity :frame-num (* 0.000016276043 (-> self ring radius-primary))) (suspend) ) (none) ) - :post - (the-as (function none :behavior redshot) transform-post) + :post (the-as (function none :behavior redshot) transform-post) ) (defbehavior redshot-handler redshot ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) @@ -894,15 +707,12 @@ ) (defstate redshot-wait (redshot) - :event - redshot-handler - :enter - (behavior () + :event redshot-handler + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (redshot-trans (- (-> self stall-time) (- (-> *display* game-frame-counter) (-> self state-time)))) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self stall-time)) (go redshot-explode) @@ -910,27 +720,22 @@ (spawn (-> self shot-particle) (-> self root-override trans)) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior redshot) transform-post) + :post (the-as (function none :behavior redshot) transform-post) ) (defstate redshot-idle (redshot) - :event - redshot-handler - :enter - (behavior () + :event redshot-handler + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (redshot-trans (seconds 5)) (arcing-shot-calculate (-> self root-override trans) @@ -942,15 +747,13 @@ (spawn (-> self shot-particle) (-> self root-override trans)) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior redshot) transform-post) + :post (the-as (function none :behavior redshot) transform-post) ) (defbehavior redshot-init-by-other redshot ((arg0 vector) (arg1 vector) (arg2 float) (arg3 time-frame) (arg4 time-frame) (arg5 int)) @@ -984,19 +787,8 @@ (set! (-> self shot-particle) (create-launch-control (-> *part-group-id-table* 665) self)) (set! (-> self test-particle) (create-launch-control (-> *part-group-id-table* 679) self)) (logior! (-> self draw status) (draw-status hidden)) - (set! (-> self sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "red-fireball") - :volume #x400 - :fo-max 80 - ) - (-> self root-override trans) - ) + (set! (-> self sound) + (new 'process 'ambient-sound (static-sound-spec "red-fireball" :fo-max 80) (-> self root-override trans)) ) (go redshot-idle) (none) @@ -1016,34 +808,21 @@ (defstate yellowshot-idle (yellowshot) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (when (= (-> arg0 type) target) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((a0-2 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-2 mode) 'generic) - (set! (-> a1-3 param 1) (the-as uint a0-2)) - ) - (send-event-function *target* a1-3) - ) + (send-event *target* 'attack (-> arg3 param 0) (static-attack-info ((mode 'generic)))) (send-event (ppointer->process (-> self parent)) 'hit-jak) ) ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (arcing-shot-calculate (-> self root-override trans) (/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time))) @@ -1055,15 +834,13 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior yellowshot) transform-post) + :post (the-as (function none :behavior yellowshot) transform-post) ) (defbehavior yellowshot-init-by-other yellowshot ((arg0 vector) (arg1 vector) (arg2 float) (arg3 time-frame)) diff --git a/goal_src/levels/finalboss/robotboss.gc b/goal_src/levels/finalboss/robotboss.gc index 000e15186e..a9b74eb269 100644 --- a/goal_src/levels/finalboss/robotboss.gc +++ b/goal_src/levels/finalboss/robotboss.gc @@ -7,37 +7,32 @@ ;; DECOMP BEGINS +(import "goal_src/import/robotboss-redeco-ag.gc") +(import "goal_src/import/robotboss-blueeco-ag.gc") +(import "goal_src/import/robotboss-yelloweco-ag.gc") + (defmethod ease-loc-t robotboss ((obj robotboss)) (parameter-ease-sin-clamp (-> obj loc-t)) ) -(defskelgroup *robotboss-blueeco-sg* robotboss-blueeco - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 200) - :longest-edge (meters 0) - ) +(defskelgroup *robotboss-blueeco-sg* robotboss-blueeco robotboss-blueeco-lod0-jg robotboss-blueeco-idle-ja + ((robotboss-blueeco-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 200) + ) -(defskelgroup *robotboss-redeco-sg* robotboss-redeco - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 200) - :longest-edge (meters 0) - ) +(defskelgroup *robotboss-redeco-sg* robotboss-redeco robotboss-redeco-lod0-jg robotboss-redeco-idle-ja + ((robotboss-redeco-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 200) + ) -(defskelgroup *robotboss-yelloweco-sg* robotboss-yelloweco - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 200) - :longest-edge (meters 0) - ) +(defskelgroup *robotboss-yelloweco-sg* robotboss-yelloweco robotboss-yelloweco-lod0-jg robotboss-yelloweco-idle-ja + ((robotboss-yelloweco-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 200) + ) (defbehavior robotboss-cut-cam-exit robotboss () (set! (-> self valid-frames) 0) - (if (and *target* (logtest? (-> *target* state-flags) 256)) + (if (and *target* (logtest? (-> *target* state-flags) (state-flags grabbed))) (process-release? *target*) ) (logclear! (-> self skel status) (janim-status inited)) @@ -48,19 +43,11 @@ (defbehavior robotboss-cut-cam robotboss ((arg0 float) (arg1 float) (arg2 int)) (let ((f0-0 (ja-aframe-num 0))) (cond - ((or (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - arg2 - ) - ) - (< f0-0 arg0) - (< arg1 f0-0) - ) + ((or (not (ja-group? arg2)) (< f0-0 arg0) (< arg1 f0-0)) (robotboss-cut-cam-exit) ) - ((or (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + ((or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) (-> self skip-cut) ) @@ -93,7 +80,7 @@ (hide-hud-quick) (set! *camera-look-through-other* 2) (when (< (-> self valid-frames) 2) - (set-blackout-frames (seconds 0.033333335)) + (set-blackout-frames (seconds 0.035)) (+! (-> self valid-frames) 1) ) ) @@ -165,18 +152,16 @@ (b! #t cfg-66 :delay (nop!)) (label cfg-19) (b! - (not - (and (-> self des-cam-entity) - (or (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 188416.0) - (and *target* - (>= 290816.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) - ) - ) - ) + (not (and (-> self des-cam-entity) + (or (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 188416.0) + (and *target* + (>= 290816.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) + ) + ) + ) + ) cfg-37 - :delay - (empty-form) + :delay (empty-form) ) (if (or (not (-> *camera* cam-entity)) (not (string= @@ -190,26 +175,18 @@ (b! #t cfg-66 :delay (nop!)) (label cfg-37) (b! - (not - (or (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 73728.0) - (and *target* - (>= 290816.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) - ) - ) + (not (or (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 73728.0) + (and *target* + (>= 290816.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) + ) + ) + ) cfg-49 - :delay - (empty-form) + :delay (empty-form) ) - (let ((a1-18 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-18 from) self) - (set! (-> a1-18 num-params) 1) - (set! (-> a1-18 message) 'query-state) - (set! (-> a1-18 param 0) (the-as uint cam-robotboss)) - (when (not (send-event-function *camera* a1-18)) - (send-event *camera* 'change-state cam-robotboss 300) - (send-event *camera* 'clear-entity) - ) + (when (not (send-event *camera* 'query-state cam-robotboss)) + (send-event *camera* 'change-state cam-robotboss (seconds 1)) + (send-event *camera* 'clear-entity) ) (b! #t cfg-66 :delay (nop!)) (label cfg-49) @@ -220,39 +197,26 @@ ) ) ) - (let ((a1-24 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-24 from) self) - (set! (-> a1-24 num-params) 1) - (set! (-> a1-24 message) 'query-state) - (set! (-> a1-24 param 0) (the-as uint cam-string)) - (when (not (send-event-function *camera* a1-24)) - (send-event *camera* 'point-of-interest #f) - (send-event *camera* 'force-blend 300) - (send-event *camera* 'clear-entity) - (send-event *camera* 'change-state cam-string 300) - ) + (when (not (send-event *camera* 'query-state cam-string)) + (send-event *camera* 'point-of-interest #f) + (send-event *camera* 'force-blend (seconds 1)) + (send-event *camera* 'clear-entity) + (send-event *camera* 'change-state cam-string (seconds 1)) ) ) (label cfg-66) - (let ((a1-29 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-29 from) self) - (set! (-> a1-29 num-params) 1) - (set! (-> a1-29 message) 'query-state) - (set! (-> a1-29 param 0) (the-as uint cam-string)) - (cond - ((send-event-function *camera* a1-29) + (cond + ((send-event *camera* 'query-state cam-string) + ) + ((-> self use-interesting) + (let ((s5-10 (new 'stack-no-clear 'vector))) + (vector<-cspace! s5-10 (-> self node-list data 87)) + (send-event *camera* 'point-of-interest s5-10) ) - ((-> self use-interesting) - (let ((s5-10 (new 'stack-no-clear 'vector))) - (vector<-cspace! s5-10 (-> self node-list data 87)) - (send-event *camera* 'point-of-interest s5-10) - ) - ) - ) + ) ) (when (and arg0 *debug-segment* (cpad-pressed? 0 l3)) ;; NOTE : changed from (cpad-pressed? 1 x) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l3)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons l3)) + (cpad-clear! 0 l3) (go arg0) ) (none) @@ -272,25 +236,25 @@ (set! (-> self vulnerable) arg0) (let ((gp-0 (new 'stack 'sphere))) (set! (-> gp-0 w) 4096.0) - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self shot-attractor) - (ppointer->handle - (when s5-0 - (let ((t9-2 (method-of-type manipy activate))) - (t9-2 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> self root-override trans) (-> self entity) *redring-sg* gp-0) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> self shot-attractor) + (ppointer->handle (manipy-spawn (-> self root-override trans) (-> self entity) *redring-sg* gp-0 :to self)) + ) ) (send-event (handle->process (-> self shot-attractor)) 'attackable #t) (send-event (handle->process (-> self shot-attractor)) 'draw #f) ) + (defbehavior robotboss-yellow-eco-off robotboss () +;; These logclears are not present in the orignal game, this is to patch the one frame of ghost yellow eco bug that can +;; occcur under certain conditions when robot-boss-yellow-eco-off is called. + (#when PC_PORT + (logclear! (-> self alts 7 extra perm status) (entity-perm-status bit-3)) + (logclear! (-> self alts 8 extra perm status) (entity-perm-status bit-3)) + (logclear! (-> self alts 9 extra perm status) (entity-perm-status bit-3)) + (logclear! (-> self alts 10 extra perm status) (entity-perm-status bit-3)) + ) + (logior! (-> self alts 7 extra perm status) (entity-perm-status bit-9)) (logior! (-> self alts 8 extra perm status) (entity-perm-status bit-9)) (logior! (-> self alts 9 extra perm status) (entity-perm-status bit-9)) @@ -311,31 +275,14 @@ ) (defbehavior robotboss-anim-blend-loop robotboss ((arg0 art-joint-anim)) - (let ((s5-0 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((s5-0 (ja-group))) (ja-channel-push! 2 0) - (let ((s4-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! s4-0 arg0 num-func-identity) - (set! (-> s4-0 frame-num) 0.0) - ) - (let ((gp-1 (-> self skel root-channel 1))) - (joint-control-channel-group-eval! gp-1 s5-0 num-func-identity) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! arg0 :num! min) + (ja :chan 1 :group! s5-0 :num! min) ) - (while #t - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((gp-2 (-> self skel root-channel 1))) - (set! (-> gp-2 frame-interp) (- 1.0 (ease-loc-t self))) - (set! (-> gp-2 param 0) 0.0) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-chan) - ) + (loop + (ja :num! (loop!)) + (ja :chan 1 :num! (chan 0) :frame-interp (- 1.0 (ease-loc-t self))) (suspend) ) (none) @@ -396,24 +343,18 @@ (vector<-cspace! gp-0 (-> self node-list data 60)) (set! (-> s4-0 quad) (-> self entity extra trans quad)) (vector+! s4-0 s4-0 arg0) - (let ((s3-1 (get-process *default-dead-pool* darkecobomb #x4000))) - (when s3-1 - (let ((t9-2 (method-of-type darkecobomb activate))) - (t9-2 (the-as darkecobomb s3-1) self 'darkecobomb (the-as pointer #x70004000)) - ) - (run-now-in-process s3-1 darkecobomb-init-by-other gp-0 s4-0 61440.0 300 arg1) - (-> s3-1 ppointer) - ) - ) + (process-spawn darkecobomb gp-0 s4-0 61440.0 300 arg1 :to self) ) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 638) 300 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 638) + 300 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) ) @@ -496,8 +437,7 @@ ) (defstate robotboss-yellow-dark-bomb-wait (robotboss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'white-eco-picked-up) @@ -528,15 +468,13 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (set! (-> self children-spawned) 0) 0 (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self des-cam-entity) #f) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) @@ -601,178 +539,52 @@ (send-event (handle->process (-> self white-eco)) 'beam-off) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans (the-as (state robotboss) #f)) (spool-push *art-control* "green-sagecage-outro-beat-boss-a" 0 self (the-as float -1.0)) (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 30) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 32))) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-dark-shoot-no-yellow-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (>= (ja-frame-num 0) 15.0) (< (-> self children-spawned) 1)) (robotboss-darkecobomb (new 'static 'vector :y 40960.0 :z 81920.0) (-> self dda yellow-bomb-time)) (play-ambient (-> self ambient) "GOL-AM20" #t (the-as vector #f)) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (ja-channel-push! 1 30) - (let ((v1-52 (-> self skel root-channel 0))) - (set! (-> v1-52 frame-group) (the-as art-joint-anim (-> self draw art-group data 32))) - ) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-16 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! - a0-16 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (ja :num! (seek!)) ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-dark-shoot-no-yellow-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (and (>= (ja-frame-num 0) 15.0) (< (-> self children-spawned) 2)) (robotboss-darkecobomb (new 'static 'vector :y 40960.0 :z -81920.0) (+ -150.0 (-> self dda yellow-bomb-time))) ) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (ja-channel-push! 1 30) - (let ((v1-93 (-> self skel root-channel 0))) - (set! (-> v1-93 frame-group) (the-as art-joint-anim (-> self draw art-group data 32))) - ) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-25 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-25 param 1) 1.0) - (set! (-> a0-25 frame-num) 0.0) - (joint-control-channel-group! - a0-25 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (ja :num! (seek!)) ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-dark-shoot-no-yellow-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (and (>= (ja-frame-num 0) 15.0) (< (-> self children-spawned) 3)) (robotboss-darkecobomb (new 'static 'vector :x 81920.0 :y 40960.0) (+ -300.0 (-> self dda yellow-bomb-time))) ) (suspend) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (ja-channel-push! 1 30) - (let ((v1-134 (-> self skel root-channel 0))) - (set! (-> v1-134 frame-group) (the-as art-joint-anim (-> self draw art-group data 32))) - ) - (let ((a0-34 (-> self skel root-channel 0))) - (set! (-> a0-34 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-34 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-34 param 1) 1.0) - (set! (-> a0-34 frame-num) 0.0) - (joint-control-channel-group! - a0-34 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (ja :num! (seek!)) ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-dark-shoot-no-yellow-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (>= (ja-frame-num 0) 15.0) (< (-> self children-spawned) 4)) (robotboss-darkecobomb (new 'static 'vector :x -81920.0 :y 40960.0) (+ -450.0 (-> self dda yellow-bomb-time))) @@ -780,68 +592,26 @@ (set! (-> self des-cam-entity) "camera-365") ) (suspend) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 param 0) (the float (+ (-> a0-38 frame-group data 0 length) -1))) - (set! (-> a0-38 param 1) 1.0) - (joint-control-channel-group-eval! a0-38 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 30) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-183 (-> self skel root-channel 0))) - (set! (-> v1-183 frame-group) (the-as art-joint-anim (-> self draw art-group data 30))) - ) - ) - (let ((a0-48 (-> self skel root-channel 0))) - (set! (-> a0-48 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-48 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-48 param 1) 1.0) - (set! (-> a0-48 frame-num) 0.0) - (joint-control-channel-group! - a0-48 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (loop + (when (not (ja-group? robotboss-idle-hover-no-yellow-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-yellow-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-49 (-> self skel root-channel 0))) - (set! (-> a0-49 param 0) (the float (+ (-> a0-49 frame-group data 0 length) -1))) - (set! (-> a0-49 param 1) 1.0) - (joint-control-channel-group-eval! a0-49 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) (defstate robotboss-daxter-sacrifice-movie (robotboss) - :code - (behavior () + :code (behavior () (set-blackout-frames (seconds 100)) (entity-birth-no-kill (-> self alts 5)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -870,21 +640,18 @@ ) (defstate robotboss-white-eco-movie (robotboss) - :enter - (behavior () + :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (set! (-> self children-spawned) 0) (set! (-> self state-time) (-> *display* base-frame-counter)) (ja-post) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "green-sagecage-daxter-sacrifice" 0 self (the-as float -1.0)) (when (and (< (-> self children-spawned) 1) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.95)) @@ -893,25 +660,12 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self entity extra trans quad)) (set! (-> gp-0 y) (+ 81920.0 (-> gp-0 y))) - (let ((s5-0 (get-process *default-dead-pool* light-eco-mother #x4000))) - (set! (-> self white-eco) - (ppointer->handle - (when s5-0 - (let ((t9-2 (method-of-type light-eco-mother activate))) - (t9-2 (the-as light-eco-mother s5-0) self 'light-eco-mother (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 light-eco-mother-init-by-other (-> self entity) gp-0) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> self white-eco) (ppointer->handle (process-spawn light-eco-mother (-> self entity) gp-0 :to self))) ) ) (none) ) - :code - (behavior () + :code (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) (set! (-> a1-0 num-params) 1) @@ -1048,17 +802,7 @@ ) ) ) - (let* ((gp-0 (get-process *default-dead-pool* finalbosscam #x4000)) - (gp-1 (ppointer->handle (when gp-0 - (let ((t9-9 (method-of-type finalbosscam activate))) - (t9-9 (the-as finalbosscam gp-0) self 'finalbosscam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 finalbosscam-init-by-other (-> self entity)) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 (ppointer->handle (process-spawn finalbosscam (-> self entity) :to self)))) (send-event (handle->process gp-1) 'play-anim) (suspend) (while (movie?) @@ -1083,8 +827,7 @@ ) (defstate robotboss-yellow-dark-bomb (robotboss) - :enter - (behavior () + :enter (behavior () (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 16384.0 -81920.0 716800.0 1.0) (set! (-> self loc-t) 0.0) @@ -1094,8 +837,7 @@ (play-ambient (-> self ambient) "GOL-AM01" #t (the-as vector #f)) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans (the-as (state robotboss) #f)) (spool-push *art-control* "finalbosscam-white-eco" 0 self (the-as float -1.0)) (if (>= (-> self loc-t) 1.0) @@ -1104,97 +846,28 @@ (robotboss-position) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 31))) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! - a0-4 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-dark-reveal-no-yellow-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 30) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-41 (-> self skel root-channel 0))) - (set! (-> v1-41 frame-group) (the-as art-joint-anim (-> self draw art-group data 30))) - ) + (when (not (ja-group? robotboss-idle-hover-no-yellow-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-yellow-ja) ) - (while #t - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! - a0-15 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) (defbehavior robotboss-yellowshot robotboss () @@ -1211,43 +884,27 @@ (vector-! s5-0 s5-0 gp-0) (vector-normalize! s5-0 (the-as float 819200.0)) (vector+! s5-0 s5-0 gp-0) - (let ((s4-1 (get-process *default-dead-pool* yellowshot #x4000))) - (when s4-1 - (let ((t9-4 (method-of-type yellowshot activate))) - (t9-4 (the-as yellowshot s4-1) self 'yellowshot (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 yellowshot-init-by-other gp-0 s5-0 0.0 750) - (-> s4-1 ppointer) - ) - ) + (process-spawn yellowshot gp-0 s5-0 0.0 750 :to self) ) (send-event self 'flash 255.0) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-8 (method-of-type part-tracker activate))) - (t9-8 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 642) 300 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 642) + 300 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) - (sound-play-by-name (static-sound-name "bfg-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bfg-fire") (none) ) (defbehavior robotboss-is-yellow-hit robotboss () - (or (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 28) - ) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) - ) + (or (ja-group? robotboss-yellow-hit-ja) (ja-group? robotboss-yellow-last-hit-ja)) ) (defbehavior robotboss-time-to-shoot-yellow robotboss () @@ -1255,14 +912,10 @@ ) (defstate robotboss-yellow-wait (robotboss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hit-jak) - (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-3 (the-as number (logior #x3f800000 v1-2))) - (f0-2 (+ -1.0 (the-as float v1-3))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.75 f0-2) (play-ambient (-> self ambient) "GOL-AM10" #t (the-as vector #f)) @@ -1280,10 +933,7 @@ ) ) (('missed-jak) - (let* ((v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-14 (the-as number (logior #x3f800000 v1-13))) - (f0-5 (+ -1.0 (the-as float v1-14))) - ) + (let ((f0-5 (rand-float-gen))) (if (< 0.5 f0-5) (play-ambient (-> self ambient) "GOL-AM14" #t (the-as vector #f)) (play-ambient (-> self ambient) "MAI-AM02" #t (the-as vector #f)) @@ -1295,8 +945,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self hits-to-go) -1) (set! (-> self state-time) (-> *display* game-frame-counter)) (set! (-> self till-next-shot) 300) @@ -1304,8 +953,7 @@ (set! (-> self keep-charging) #f) (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) (if a0-1 (deactivate a0-1) @@ -1359,8 +1007,7 @@ (stop! (-> self looping-sound 3)) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-yellow-dark-bomb) (robotboss-shooting-trans 21) (cond @@ -1370,40 +1017,24 @@ (robotboss-yellow-eco-off) (set! (-> self took-hit) #f) (+! (-> self hits-to-go) -1) - (ja-channel-push! 1 30) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-yellow-last-hit-ja) (set! (-> self yellow-smoke) #t) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (-> self node-list data 27)) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker s5-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 part-tracker-init (-> *part-group-id-table* 653) 300 #f #f #f gp-0) - (-> s5-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 653) + 300 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) - (let* ((s5-1 (get-process *default-dead-pool* manipy #x4000)) - (gp-1 (when s5-1 - (let ((t9-10 (method-of-type manipy activate))) - (t9-10 (the-as manipy s5-1) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - manipy-init - (-> self root-override trans) - (-> self entity) - *robotboss-yelloweco-sg* - #f - ) - (-> s5-1 ppointer) - ) - ) - ) + (let ((gp-1 (manipy-spawn (-> self root-override trans) (-> self entity) *robotboss-yelloweco-sg* #f :to self))) (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-1) 'anim-mode 'play1) (send-event (ppointer->process gp-1) 'rot-quat (-> self root-override quat)) @@ -1415,14 +1046,12 @@ (play-ambient (-> self ambient) "MAI-AM06" #t (the-as vector #f)) ) (set! (-> self took-hit) #f) - (ja-channel-push! 1 30) - (let ((v1-54 (-> self skel root-channel 0))) - (set! (-> v1-54 frame-group) (the-as art-joint-anim (-> self draw art-group data 28))) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-yellow-hit-ja) ) ) (robotboss-position) - (robotboss-cut-cam (the-as float 5.0) (the-as float 50.0) (the-as int (-> self draw art-group data 29))) + (robotboss-cut-cam (the-as float 5.0) (the-as float 50.0) (the-as int robotboss-yellow-roar-ja)) (when (and (-> self keep-charging) (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) ) @@ -1434,13 +1063,8 @@ ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) @@ -1449,121 +1073,39 @@ (if (nonzero? (-> self yellow-gun)) (set-mode! (-> self yellow-gun) (joint-mod-handler-mode look-at)) ) - (while #t + (loop (when (not (robotboss-time-to-shoot-yellow)) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 26) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-23 (-> self skel root-channel 0))) - (set! (-> v1-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 26))) - ) + (when (not (ja-group? robotboss-yellow-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-yellow-idle-ja) ) - (when (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) - (let ((v1-30 (-> self skel root-channel 0))) - (set! (-> v1-30 num-func) num-func-identity) - (set! (-> v1-30 frame-num) 15.0) + (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) + (ja :num-func num-func-identity :frame-num 15.0) ) - ) (while (not (or (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) + (ja-group? robotboss-yellow-last-hit-ja) ) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 26) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-40 (-> self skel root-channel 0))) - (set! (-> v1-40 frame-group) (the-as art-joint-anim (-> self draw art-group data 26))) - ) - ) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-24 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! - a0-24 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (when (not (ja-group? robotboss-yellow-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-yellow-idle-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (robotboss-is-yellow-hit) (goto cfg-36) ) (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (label cfg-36) (when (not (robotboss-is-yellow-hit)) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 26) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-93 (-> self skel root-channel 0))) - (set! (-> v1-93 frame-group) (the-as art-joint-anim (-> self draw art-group data 26))) - ) - ) - (let ((a0-41 (-> self skel root-channel 0))) - (set! (-> a0-41 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-41 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-41 param 1) 1.0) - (set! (-> a0-41 frame-num) 0.0) - (joint-control-channel-group! - a0-41 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (when (not (ja-group? robotboss-yellow-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-yellow-idle-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (robotboss-is-yellow-hit) (goto cfg-55) @@ -1572,46 +1114,24 @@ (set! (-> self keep-charging) #t) ) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) (the float (+ (-> a0-43 frame-group data 0 length) -1))) - (set! (-> a0-43 param 1) 1.0) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (label cfg-55) - (when (and (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) - ) - (or (robotboss-time-to-shoot-yellow) (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 28) - ) - ) - ) + (when (and (not (ja-group? robotboss-yellow-last-hit-ja)) + (or (robotboss-time-to-shoot-yellow) (not (ja-group? robotboss-yellow-hit-ja))) ) (set! (-> self state-time) (-> *display* game-frame-counter)) - (let* ((f30-1 (-> self dda yellow-shot-time-min)) - (f28-0 (-> self dda yellow-shot-time-rnd)) - (v1-147 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-148 (the-as number (logior #x3f800000 v1-147))) - ) - (set! (-> self till-next-shot) - (the int (+ f30-1 (the float (the int (* f28-0 (+ -1.0 (the-as float v1-148))))))) - ) + (let ((f30-1 (-> self dda yellow-shot-time-min)) + (f28-0 (-> self dda yellow-shot-time-rnd)) + ) + (set! (-> self till-next-shot) (the int (+ f30-1 (the float (the int (* f28-0 (rand-float-gen))))))) ) (stop! (-> self looping-sound 3)) (robotboss-yellowshot) (robotboss-yellow-eco-on) - (let* ((v1-154 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-155 (the-as number (logior #x3f800000 v1-154))) - (f0-29 (+ -1.0 (the-as float v1-155))) - ) + (let ((f0-29 (rand-float-gen))) (cond ((< 0.8333333 f0-29) (play-ambient (-> self ambient) "GOL-AM04" #t (the-as vector #f)) @@ -1633,74 +1153,26 @@ ) ) ) - (ja-channel-push! 1 15) - (let ((v1-176 (-> self skel root-channel 0))) - (set! (-> v1-176 frame-group) (the-as art-joint-anim (-> self draw art-group data 27))) - ) - ) - (let ((a0-70 (-> self skel root-channel 0))) - (set! (-> a0-70 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-70 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-70 param 1) 1.0) - (set! (-> a0-70 frame-num) 0.0) - (joint-control-channel-group! - a0-70 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! robotboss-yellow-blast-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-71 (-> self skel root-channel 0))) - (set! (-> a0-71 param 0) (the float (+ (-> a0-71 frame-group data 0 length) -1))) - (set! (-> a0-71 param 1) 1.0) - (joint-control-channel-group-eval! a0-71 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) - (let ((a0-77 (-> self skel root-channel 0))) - (set! (-> a0-77 frame-group) (the-as art-joint-anim (-> self draw art-group data 29))) - (set! (-> a0-77 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 29)) data 0 length) -1)) - ) - (set! (-> a0-77 param 1) 1.0) - (set! (-> a0-77 frame-num) 0.0) - (joint-control-channel-group! a0-77 (the-as art-joint-anim (-> self draw art-group data 29)) num-func-seek!) - ) + (when (ja-group? robotboss-yellow-last-hit-ja) + (ja-no-eval :group! robotboss-yellow-roar-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-78 (-> self skel root-channel 0))) - (set! (-> a0-78 param 0) (the float (+ (-> a0-78 frame-group data 0 length) -1))) - (set! (-> a0-78 param 1) 1.0) - (joint-control-channel-group-eval! a0-78 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go robotboss-yellow-dark-bomb) ) ) (none) ) - :post - (behavior () + :post (behavior () (when *target* (if (nonzero? (-> self yellow-gun)) (set-target! (-> self yellow-gun) (target-pos 5)) @@ -1712,10 +1184,8 @@ ) (defstate robotboss-yellow (robotboss) - :event - robotboss-handler - :enter - (behavior () + :event robotboss-handler + :enter (behavior () (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 13653.333 77824.0 491520.0 1.0) (set! (-> self loc-t) 0.0) @@ -1724,8 +1194,7 @@ (set! (-> self desired-pool-y) -18432.0) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-yellow-wait) (if (>= (-> self loc-t) 1.0) (go robotboss-yellow-wait) @@ -1733,141 +1202,57 @@ (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 60) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 25))) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-dark-return-after-red-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (cond ((and *target* (< (+ 81920.0 (-> self entity extra trans y)) (-> (target-pos 0) y))) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) - ) - (ja-channel-push! 1 240) - (let ((v1-55 (-> self skel root-channel 0))) - (set! (-> v1-55 frame-group) (the-as art-joint-anim (-> self draw art-group data 23))) - ) + (when (not (ja-group? robotboss-idle-hover-lookup-no-red-ja)) + (ja-channel-push! 1 (seconds 0.8)) + (ja :group! robotboss-idle-hover-lookup-no-red-ja) ) ) - ((not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 21) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-64 (-> self skel root-channel 0))) - (set! (-> v1-64 frame-group) (the-as art-joint-anim (-> self draw art-group data 21))) - ) + ((not (ja-group? robotboss-idle-hover-no-red-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-red-ja) ) ) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-27 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-27 param 1) 1.0) - (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! - a0-27 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) (defstate robotboss-red-dark-bomb-wait (robotboss) - :event - robotboss-bomb-handler - :enter - (behavior () + :event robotboss-bomb-handler + :enter (behavior () (set! (-> self children-spawned) 0) (logior! (-> self alts 11 extra perm status) (entity-perm-status bit-3)) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self ignore-camera) #f) (set! (-> self des-cam-entity) #f) (logclear! (-> self alts 11 extra perm status) (entity-perm-status bit-3)) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-yellow) (if (and (< (-> self children-spawned) 0) (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump)) @@ -1877,115 +1262,41 @@ (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 30) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 24))) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-dark-shoot-no-red-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (>= (ja-frame-num 0) 15.0) (< (-> self children-spawned) 1)) (robotboss-darkecobomb (new 'static 'vector :y 32768.0) (-> self dda red-bomb-time)) (set! (-> self des-cam-entity) "camera-365") ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 21) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-57 (-> self skel root-channel 0))) - (set! (-> v1-57 frame-group) (the-as art-joint-anim (-> self draw art-group data 21))) - ) - ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-19 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! - a0-19 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (loop + (when (not (ja-group? robotboss-idle-hover-no-red-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-red-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) (defstate robotboss-red-dark-bomb (robotboss) - :enter - (behavior () + :enter (behavior () (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 0.0 -81920.0 716800.0 1.0) (set! (-> self loc-t) 0.0) @@ -1994,8 +1305,7 @@ (set! (-> self desired-pool-y) -20480.0) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-red-dark-bomb-wait) (robotboss-position) (if (>= (-> self loc-t) 1.0) @@ -2003,97 +1313,28 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 22))) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! - a0-4 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-dark-reveal-no-red-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 21) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-41 (-> self skel root-channel 0))) - (set! (-> v1-41 frame-group) (the-as art-joint-anim (-> self draw art-group data 21))) - ) + (when (not (ja-group? robotboss-idle-hover-no-red-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-red-ja) ) - (while #t - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! - a0-15 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) (deftype redshot-launch-info (structure) @@ -2124,20 +1365,16 @@ 0.0 (dotimes (s3-0 6) (let ((s1-0 (-> arg0 info s3-0))) - (let* ((f30-0 -40960.0) - (f28-0 81920.0) - (v1-4 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-5 (the-as number (logior #x3f800000 v1-4))) - ) - (set! (-> s1-0 dest x) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-5))))) + (let ((f30-0 -40960.0) + (f28-0 81920.0) + ) + (set! (-> s1-0 dest x) (+ f30-0 (* f28-0 (rand-float-gen)))) ) (set! (-> s1-0 dest y) 0.0) - (let* ((f30-1 -40960.0) - (f28-1 81920.0) - (v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-11 (the-as number (logior #x3f800000 v1-10))) - ) - (set! (-> s1-0 dest z) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-11))))) + (let ((f30-1 -40960.0) + (f28-1 81920.0) + ) + (set! (-> s1-0 dest z) (+ f30-1 (* f28-1 (rand-float-gen)))) ) (set! (-> s1-0 dest w) 1.0) ) @@ -2163,14 +1400,10 @@ (the-as time-frame (+ (the int (* f30-2 (+ -1.0 (the-as float v1-28)))) 180)) ) ) - (let* ((s1-3 (max 150 (- (the-as time-frame s2-0) (-> arg0 info s3-0 flight-time)))) - (f30-3 60.0) - (v1-38 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-39 (the-as number (logior #x3f800000 v1-38))) - ) - (set! (-> arg0 info s3-0 stall-time) - (the-as time-frame (+ (the int (* f30-3 (+ -1.0 (the-as float v1-39)))) 300 s1-3)) - ) + (let ((s1-3 (max 150 (- (the-as time-frame s2-0) (-> arg0 info s3-0 flight-time)))) + (f30-3 60.0) + ) + (set! (-> arg0 info s3-0 stall-time) (the-as time-frame (+ (the int (* f30-3 (rand-float-gen))) 300 s1-3))) ) (set! s2-0 (the-as int (+ (-> arg0 info s3-0 flight-time) (-> arg0 info s3-0 stall-time)))) ) @@ -2178,7 +1411,7 @@ (vector-! s5-0 (-> self entity extra trans) s5-0) (dotimes (v1-53 6) (vector+! (the-as vector (-> arg0 info v1-53)) (the-as vector (-> arg0 info v1-53)) s5-0) - (set! (-> arg0 info v1-53 dest y) (+ (-> (new 'static 'array float 1 2048.0) 0) (-> arg0 info v1-53 dest y))) + (set! (-> arg0 info v1-53 dest y) (+ 2048.0 (-> arg0 info v1-53 dest y))) ) ) (none) @@ -2203,12 +1436,10 @@ (s0-0 gp-0) ) (set! sv-48 (-> sv-32 dest)) - (let* ((f30-0 20480.0) - (f28-0 12288.0) - (v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-11 (the-as number (logior #x3f800000 v1-10))) - ) - (set! sv-64 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-11))))) + (let ((f30-0 20480.0) + (f28-0 12288.0) + ) + (set! sv-64 (+ f30-0 (* f28-0 (rand-float-gen)))) ) (set! sv-80 (-> sv-32 flight-time)) (set! sv-96 (-> sv-32 stall-time)) @@ -2233,44 +1464,32 @@ ) ) (when s5-0 - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 641) 300 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 641) + 300 + #f + #f + #f + gp-0 + :to *entity-pool* ) - (sound-play-by-name (static-sound-name "red-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "red-fire") ) ) ) ) (defbehavior robotboss-is-red-hit robotboss () - (or (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 19) - ) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - ) + (or (ja-group? robotboss-red-hit-ja) (ja-group? robotboss-red-last-hit-ja)) ) (defstate robotboss-red-wait (robotboss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hit-jak) - (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-3 (the-as number (logior #x3f800000 v1-2))) - (f0-2 (+ -1.0 (the-as float v1-3))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.75 f0-2) (play-ambient (-> self ambient) "GOL-AM10" #t (the-as vector #f)) @@ -2288,10 +1507,7 @@ ) ) (('missed-jak) - (let* ((v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-14 (the-as number (logior #x3f800000 v1-13))) - (f0-5 (+ -1.0 (the-as float v1-14))) - ) + (let ((f0-5 (rand-float-gen))) (if (< 0.5 f0-5) (play-ambient (-> self ambient) "GOL-AM14" #t (the-as vector #f)) (play-ambient (-> self ambient) "MAI-AM01" #t (the-as vector #f)) @@ -2303,8 +1519,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self hits-to-go) -1) (set! (-> self des-cam-entity) "camera-390") (set! (-> self use-interesting) #t) @@ -2313,8 +1528,7 @@ 0 (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) (if a0-1 (deactivate a0-1) @@ -2378,8 +1592,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-red-dark-bomb) (robotboss-shooting-trans 40) (cond @@ -2402,34 +1615,24 @@ ) (set! (-> self took-hit) #f) (+! (-> self hits-to-go) -1) - (ja-channel-push! 1 30) - (let ((v1-10 (-> self skel root-channel 0))) - (set! (-> v1-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-red-last-hit-ja) (set! (-> self red-smoke) #t) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (-> self node-list data 51)) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker s5-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 part-tracker-init (-> *part-group-id-table* 649) 300 #f #f #f gp-0) - (-> s5-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 649) + 300 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) - (let* ((s5-1 (get-process *default-dead-pool* manipy #x4000)) - (gp-1 - (when s5-1 - (let ((t9-10 (method-of-type manipy activate))) - (t9-10 (the-as manipy s5-1) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> self root-override trans) (-> self entity) *robotboss-redeco-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) + (let ((gp-1 (manipy-spawn (-> self root-override trans) (-> self entity) *robotboss-redeco-sg* #f :to self))) (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-1) 'anim-mode 'play1) (send-event (ppointer->process gp-1) 'rot-quat (-> self root-override quat)) @@ -2441,123 +1644,46 @@ (play-ambient (-> self ambient) "MAI-AM06" #t (the-as vector #f)) ) (set! (-> self took-hit) #f) - (ja-channel-push! 1 30) - (let ((v1-56 (-> self skel root-channel 0))) - (set! (-> v1-56 frame-group) (the-as art-joint-anim (-> self draw art-group data 19))) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-red-hit-ja) ) ) (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) (robotboss-setup-for-hits 1 5) - (while #t + (loop (until (or (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) + (ja-group? robotboss-red-last-hit-ja) ) - (ja-channel-push! 1 60) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - ) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-7 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! - a0-7 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-red-idle-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) + (if (ja-group? robotboss-red-last-hit-ja) (goto cfg-24) ) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (label cfg-24) (set! (-> self state-time) (-> *display* game-frame-counter)) - (let* ((f30-0 (-> self dda red-shot-time-min)) - (f28-0 (-> self dda red-shot-time-rnd)) - (v1-65 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-66 (the-as number (logior #x3f800000 v1-65))) - ) - (set! (-> self till-next-shot) - (the int (+ f30-0 (the float (the int (* f28-0 (+ -1.0 (the-as float v1-66))))))) - ) + (let ((f30-0 (-> self dda red-shot-time-min)) + (f28-0 (-> self dda red-shot-time-rnd)) + ) + (set! (-> self till-next-shot) (the int (+ f30-0 (the float (the int (* f28-0 (rand-float-gen))))))) ) (when (not (robotboss-is-red-hit)) - (ja-channel-push! 1 60) - (let ((v1-72 (-> self skel root-channel 0))) - (set! (-> v1-72 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - ) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-27 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-27 param 1) 1.0) - (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! - a0-27 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-red-charge-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (update! (-> self looping-sound 2)) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -2568,27 +1694,16 @@ (goto cfg-37) ) (suspend) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 param 0) (the float (+ (-> a0-31 frame-group data 0 length) -1))) - (set! (-> a0-31 param 1) 1.0) - (joint-control-channel-group-eval! a0-31 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (label cfg-37) (stop! (-> self looping-sound 2)) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - ) - (let* ((v1-120 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-121 (the-as number (logior #x3f800000 v1-120))) - (f30-1 (+ -1.0 (the-as float v1-121))) - (gp-1 (new 'stack-no-clear 'redshot-launch-array)) - (s5-0 (-> self dda red-shots-min)) - ) + (when (not (ja-group? robotboss-red-last-hit-ja)) + (let ((f30-1 (rand-float-gen)) + (gp-1 (new 'stack-no-clear 'redshot-launch-array)) + (s5-0 (-> self dda red-shots-min)) + ) (robotboss-yellow-eco-on) (robotboss-redshot-fill-array gp-1) (robotboss-redshot (the-as redshot-launch-info (-> gp-1 info)) #t) @@ -2602,10 +1717,7 @@ ) ) (when (not (robotboss-is-red-hit)) - (let* ((v1-135 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-136 (the-as number (logior #x3f800000 v1-135))) - (f0-33 (+ -1.0 (the-as float v1-136))) - ) + (let ((f0-33 (rand-float-gen))) (cond ((< 0.8333333 f0-33) (play-ambient (-> self ambient) "GOL-AM04" #t (the-as vector #f)) @@ -2627,91 +1739,40 @@ ) ) ) - (let ((v1-157 (-> self skel root-channel 0))) - (set! (-> v1-157 frame-group) (the-as art-joint-anim (-> self draw art-group data 18))) - ) - ) - (let ((a0-56 (-> self skel root-channel 0))) - (set! (-> a0-56 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-56 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-56 param 1) 1.0) - (set! (-> a0-56 frame-num) 0.0) - (joint-control-channel-group! - a0-56 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (ja :group! robotboss-red-blast-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-57 (-> self skel root-channel 0))) - (set! (-> a0-57 param 0) (the float (+ (-> a0-57 frame-group data 0 length) -1))) - (set! (-> a0-57 param 1) 1.0) - (joint-control-channel-group-eval! a0-57 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - (let ((a0-63 (-> self skel root-channel 0))) - (set! (-> a0-63 frame-group) (the-as art-joint-anim (-> self draw art-group data 20))) - (set! (-> a0-63 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 20)) data 0 length) -1)) - ) - (set! (-> a0-63 param 1) 1.0) - (set! (-> a0-63 frame-num) 0.0) - (joint-control-channel-group! a0-63 (the-as art-joint-anim (-> self draw art-group data 20)) num-func-seek!) - ) + (when (ja-group? robotboss-red-last-hit-ja) + (ja-no-eval :group! robotboss-red-roar-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-64 (-> self skel root-channel 0))) - (set! (-> a0-64 param 0) (the float (+ (-> a0-64 frame-group data 0 length) -1))) - (set! (-> a0-64 param 1) 1.0) - (joint-control-channel-group-eval! a0-64 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go robotboss-red-dark-bomb) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) (defstate robotboss-red (robotboss) - :event - robotboss-handler - :enter - (behavior () + :event robotboss-handler + :enter (behavior () (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 8192.0 -40960.0 327680.0 1.0) (set! (-> self loc-t) 0.0) (set! (-> self loc-t-start) (-> *display* game-frame-counter)) (set! (-> self loc-t-duration) (seconds 3)) (set! (-> self desired-pool-y) -22528.0) - (set-setting! *setting-control* self 'sound-flava #f (the-as float 40.0) 48) + (set-setting! 'sound-flava #f 40.0 (music-flava finalboss-end)) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-red-wait) (if (>= (-> self loc-t) 1.0) (go robotboss-red-wait) @@ -2719,125 +1780,48 @@ (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 60) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-dark-return-after-green-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-50 (-> self skel root-channel 0))) - (set! (-> v1-50 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) - ) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-17 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! - a0-17 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (loop + (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) (defstate robotboss-green-dark-bomb-wait (robotboss) - :event - robotboss-bomb-handler - :enter - (behavior () + :event robotboss-bomb-handler + :enter (behavior () (set! (-> self children-spawned) 0) 0 (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self ignore-camera) #f) (set! (-> self des-cam-entity) #f) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-red) (if (and (< (-> self children-spawned) 0) (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump)) @@ -2847,47 +1831,15 @@ (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 30) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-dark-shoot-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (>= (ja-frame-num 0) 15.0) (< (-> self children-spawned) 1)) (robotboss-darkecobomb (new 'static 'vector :y 32768.0) (-> self dda green-bomb-time)) @@ -2895,68 +1847,26 @@ (play-ambient (-> self ambient) "GOL-AM11" #t (the-as vector #f)) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-59 (-> self skel root-channel 0))) - (set! (-> v1-59 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) - ) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-20 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-20 param 1) 1.0) - (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! - a0-20 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (loop + (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) (defstate robotboss-green-dark-bomb (robotboss) - :enter - (behavior () + :enter (behavior () (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 16384.0 -81920.0 716800.0 1.0) (set! (-> self loc-t) 0.0) @@ -2966,8 +1876,7 @@ (play-ambient (-> self ambient) "MAI-AM01" #t (the-as vector #f)) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-green-dark-bomb-wait) (robotboss-position) (if (>= (-> self loc-t) 1.0) @@ -2975,97 +1884,28 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 14))) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! - a0-4 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-dark-reveal-green-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-41 (-> self skel root-channel 0))) - (set! (-> v1-41 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) + (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja) ) - (while #t - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! - a0-15 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) (defbehavior robotboss-greenshot robotboss ((arg0 vector) (arg1 float) (arg2 int) (arg3 symbol)) @@ -3076,41 +1916,32 @@ (set! (-> s2-0 quad) (-> self entity extra trans quad)) (set! (-> s2-0 y) (+ -40960.0 (-> s2-0 y))) (vector+! s2-0 s2-0 arg0) - (let ((s1-1 (get-process *default-dead-pool* greenshot #x4000))) - (when s1-1 - (let ((t9-2 (method-of-type greenshot activate))) - (t9-2 (the-as greenshot s1-1) self 'greenshot (the-as pointer #x70004000)) - ) - (run-now-in-process s1-1 greenshot-init-by-other gp-0 s2-0 arg1 arg2) - (-> s1-1 ppointer) - ) - ) + (process-spawn greenshot gp-0 s2-0 arg1 arg2 :to self) ) (when arg3 - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 640) 300 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 640) + 300 + #f + #f + #f + gp-0 + :to *entity-pool* ) - (sound-play-by-name (static-sound-name "green-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "green-fire") ) ) (none) ) (defstate robotboss-green-wait (robotboss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) - (ja-channel-push! 1 60) - (let ((v1-3 (-> self skel root-channel 0))) - (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-green-roar-ja) (robotboss-yellow-eco-off) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) self) @@ -3129,10 +1960,7 @@ ) ) (('hit-jak) - (let* ((v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-9 (the-as number (logior #x3f800000 v1-8))) - (f0-2 (+ -1.0 (the-as float v1-9))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.75 f0-2) (play-ambient (-> self ambient) "GOL-AM10" #t (the-as vector #f)) @@ -3150,10 +1978,7 @@ ) ) (('blob-died) - (let* ((v1-19 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-20 (the-as number (logior #x3f800000 v1-19))) - (f0-5 (+ -1.0 (the-as float v1-20))) - ) + (let ((f0-5 (rand-float-gen))) (cond ((< 0.75 f0-5) (play-ambient (-> self ambient) "MAI-AM02" #t (the-as vector #f)) @@ -3175,16 +2000,14 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (set! (-> self children-spawned) 0) (robotboss-setup-for-hits 2 5) (set! (-> self des-cam-entity) "camera-385") (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) (if a0-1 (deactivate a0-1) @@ -3247,28 +2070,23 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-green-dark-bomb) (cond ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 0.4)) (< (-> self children-spawned) 1) ) (robotboss-greenshot (new 'static 'vector) (the-as float 24576.0) 600 #t) - (ja-channel-push! 1 60) - (let ((v1-9 (-> self skel root-channel 0))) - (set! (-> v1-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-green-spawn-ja) ) ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 1.2)) (< (-> self children-spawned) 3) ) (robotboss-greenshot (new 'static 'vector :x 8192.0) (the-as float 16384.0) 600 #t) (robotboss-greenshot (new 'static 'vector :z 8192.0) (the-as float 32768.0) 660 #f) - (ja-channel-push! 1 60) - (let ((v1-20 (-> self skel root-channel 0))) - (set! (-> v1-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-green-spawn-ja) ) ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 2.6)) (< (-> self children-spawned) 6) @@ -3276,48 +2094,34 @@ (robotboss-greenshot (new 'static 'vector :z 12288.0) (the-as float 20480.0) 600 #t) (robotboss-greenshot (new 'static 'vector :x 8192.0) (the-as float 8192.0) 660 #f) (robotboss-greenshot (new 'static 'vector) (the-as float 36864.0) 720 #f) - (ja-channel-push! 1 60) - (let ((v1-32 (-> self skel root-channel 0))) - (set! (-> v1-32 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-green-spawn-ja) ) ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 4)) (< (-> self children-spawned) 7) ) (robotboss-greenshot (new 'static 'vector) (the-as float 24576.0) 600 #t) - (ja-channel-push! 1 60) - (let ((v1-42 (-> self skel root-channel 0))) - (set! (-> v1-42 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-green-spawn-ja) ) ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 5.5)) (< (-> self children-spawned) 9) ) (robotboss-greenshot (new 'static 'vector) (the-as float 12288.0) 600 #t) (robotboss-greenshot (new 'static 'vector :x 4096.0 :z 12288.0) (the-as float 32768.0) 600 #f) - (ja-channel-push! 1 60) - (let ((v1-53 (-> self skel root-channel 0))) - (set! (-> v1-53 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-green-spawn-ja) ) ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 8)) (< (-> self children-spawned) 10) ) (+! (-> self children-spawned) 1) - (let ((gp-0 (get-process *default-dead-pool* green-eco-lurker-gen #x4000))) - (when gp-0 - (let ((t9-16 (method-of-type green-eco-lurker-gen activate))) - (t9-16 (the-as green-eco-lurker-gen gp-0) self 'green-eco-lurker-gen (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - green-eco-lurker-gen-init-by-other - (-> self entity) - (-> self entity extra trans) - (-> self dda num-blobs) - ) - (-> gp-0 ppointer) - ) + (process-spawn + green-eco-lurker-gen + (-> self entity) + (-> self entity extra trans) + (-> self dda num-blobs) + :to self ) (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 24576.0 0.0 655360.0 1.0) @@ -3336,84 +2140,36 @@ (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (while #t + (loop (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 13) - ) + ((ja-group? robotboss-green-roar-ja) (go robotboss-green-dark-bomb) ) - ((not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-25 (-> self skel root-channel 0))) - (set! (-> v1-25 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) + ((not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja) ) ) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-14 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-14 param 1) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! - a0-14 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) 1.0) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) (defstate robotboss-green (robotboss) - :event - robotboss-handler - :enter - (behavior () + :event robotboss-handler + :enter (behavior () (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 24576.0 0.0 245760.0 1.0) (set! (-> self loc-t) 0.0) @@ -3421,11 +2177,10 @@ (set! (-> self loc-t-duration) (seconds 3)) (set! (-> self desired-pool-y) -26624.0) (play-ambient (-> self ambient) "GOL-AM01" #t (the-as vector #f)) - (set-setting! *setting-control* self 'sound-flava #f (the-as float 40.0) 47) + (set-setting! 'sound-flava #f 40.0 (music-flava finalboss-middle)) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-green-wait) (if (>= (-> self loc-t) 1.0) (go robotboss-green-wait) @@ -3433,125 +2188,48 @@ (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 60) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-dark-return-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-50 (-> self skel root-channel 0))) - (set! (-> v1-50 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) - ) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-17 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! - a0-17 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (loop + (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) (defstate robotboss-blue-dark-bomb-wait (robotboss) - :event - robotboss-bomb-handler - :enter - (behavior () + :event robotboss-bomb-handler + :enter (behavior () (set! (-> self children-spawned) 0) 0 (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self ignore-camera) #f) (set! (-> self des-cam-entity) #f) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-green) (if (and (< (-> self children-spawned) 0) (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump)) @@ -3561,47 +2239,15 @@ (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 30) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-dark-shoot-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (>= (ja-frame-num 0) 15.0) (< (-> self children-spawned) 1)) (robotboss-darkecobomb (new 'static 'vector :y 32768.0) (the-as float 3600.0)) @@ -3609,83 +2255,34 @@ (play-ambient (-> self ambient) "MAI-AM04" #t (the-as vector #f)) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (cond ((and *target* (< (+ 81920.0 (-> self entity extra trans y)) (-> (target-pos 0) y))) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - ) - (ja-channel-push! 1 240) - (let ((v1-64 (-> self skel root-channel 0))) - (set! (-> v1-64 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) + (when (not (ja-group? robotboss-idle-hover-lookup-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.8)) + (ja :group! robotboss-idle-hover-lookup-no-blue-ja) ) ) - ((not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-73 (-> self skel root-channel 0))) - (set! (-> v1-73 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) + ((not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja) ) ) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-30 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-30 param 1) 1.0) - (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! - a0-30 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 param 0) (the float (+ (-> a0-31 frame-group data 0 length) -1))) - (set! (-> a0-31 param 1) 1.0) - (joint-control-channel-group-eval! a0-31 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) (defstate robotboss-blue-dark-bomb (robotboss) - :enter - (behavior () + :enter (behavior () (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 16384.0 -118784.0 614400.0 1.0) (set! (-> self loc-t) 0.0) @@ -3694,8 +2291,7 @@ (set! (-> self desired-pool-y) -28672.0) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-blue-dark-bomb-wait) (robotboss-position) (if (>= (-> self loc-t) 1.0) @@ -3703,97 +2299,28 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! - a0-4 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-dark-reveal-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-41 (-> self skel root-channel 0))) - (set! (-> v1-41 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) + (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja) ) - (while #t - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! - a0-15 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) (defbehavior robotboss-blue-beam robotboss ((arg0 int) (arg1 symbol)) @@ -3817,45 +2344,35 @@ ) (cond ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 0.4)) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) - ) + (ja-group? robotboss-idle-blue-ja) ) (spawn (-> self particle 0) s4-0) (when (and arg1 (nonzero? (-> self looping-sound 0))) (update! (-> self looping-sound 0)) - (when (and *target* (zero? (logand (-> *target* state-flags) #x80f8))) + (when (and *target* + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + ) (let ((t2-0 (new 'stack-no-clear 'collide-tri-result)) (a2-0 (new 'stack-no-clear 'vector)) ) (vector-! a2-0 gp-0 s4-0) - (when (>= (fill-and-probe-using-line-sphere - *collide-cache* - s4-0 - a2-0 - (the-as float 4096.0) - (collide-kind target) - self - t2-0 - 1 - ) - 0.0 + (if (>= (fill-and-probe-using-line-sphere + *collide-cache* + s4-0 + a2-0 + (the-as float 4096.0) + (collide-kind target) + self + t2-0 + (new 'static 'pat-surface :noentity #x1) ) - (let ((a1-13 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-13 from) self) - (set! (-> a1-13 num-params) 2) - (set! (-> a1-13 message) 'attack) - (set! (-> a1-13 param 0) (the-as uint #f)) - (let ((v1-50 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-50 shove-up) 10240.0) - (set! (-> v1-50 shove-back) 30720.0) - (set! (-> a1-13 param 1) (the-as uint v1-50)) - ) - (send-event-function *target* a1-13) + 0.0 + ) + (send-event *target* 'attack #f (static-attack-info ((shove-up (meters 2.5)) (shove-back (meters 7.5))))) ) - ) ) ) ) @@ -3866,33 +2383,20 @@ ) (cond ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 1.4)) - (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - ) + (not (ja-group? robotboss-blue-roar-ja)) ) (spawn (-> self particle 1) gp-0) (when (and arg1 (nonzero? (-> self looping-sound 1))) (update! (-> self looping-sound 1)) - (when (and *target* - (zero? (logand (-> *target* state-flags) #x80f8)) - (>= 8192.0 (vector-vector-distance gp-0 (target-pos 0))) - ) - (let ((a1-16 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-16 from) self) - (set! (-> a1-16 num-params) 2) - (set! (-> a1-16 message) 'attack) - (set! (-> a1-16 param 0) (the-as uint #f)) - (let ((v1-80 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-80 shove-up) 10240.0) - (set! (-> v1-80 shove-back) 30720.0) - (set! (-> a1-16 param 1) (the-as uint v1-80)) - ) - (send-event-function *target* a1-16) + (if (and *target* + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + (>= 8192.0 (vector-vector-distance gp-0 (target-pos 0))) + ) + (send-event *target* 'attack #f (static-attack-info ((shove-up (meters 2.5)) (shove-back (meters 7.5))))) ) - ) ) ) ((nonzero? (-> self looping-sound 1)) @@ -3907,7 +2411,7 @@ 0 (let ((gp-0 (-> self entity extra perm))) (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) - (set! (-> gp-0 user-int8 0) (seekl (-> gp-0 user-int8 0) 255 1)) + (seekl! (-> gp-0 user-int8 0) 255 1) (let ((v1-5 (-> gp-0 user-int8 0))) (set! (-> self dda) (cond ((< 15 v1-5) @@ -3993,10 +2497,8 @@ ) (defstate robotboss-blue-wait (robotboss) - :event - robotboss-handler - :enter - (behavior () + :event robotboss-handler + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (robotboss-setup-for-hits 4 5) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -4019,8 +2521,7 @@ (robotboss-yellow-eco-on) (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) (if a0-1 (deactivate a0-1) @@ -4077,8 +2578,7 @@ (robotboss-cut-cam-exit) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-blue-dark-bomb) (robotboss-shooting-trans 9) (cond @@ -4087,35 +2587,25 @@ (robotboss-blue-done) (set! (-> self took-hit) #f) (+! (-> self hits-to-go) -1) - (ja-channel-push! 1 30) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 33))) - ) - (sound-play-by-name (static-sound-name "explod-eye") (new-sound-id) 1024 0 0 1 #t) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-blue-last-hit-ja) + (sound-play "explod-eye") (set! (-> self blue-smoke) #t) (let ((gp-1 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-1 (-> self node-list data 7)) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-9 (method-of-type part-tracker activate))) - (t9-9 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 644) 300 #f #f #f gp-1) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 644) + 300 + #f + #f + #f + gp-1 + :to *entity-pool* ) ) - (let* ((s5-2 (get-process *default-dead-pool* manipy #x4000)) - (gp-2 - (when s5-2 - (let ((t9-12 (method-of-type manipy activate))) - (t9-12 (the-as manipy s5-2) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 manipy-init (-> self root-override trans) (-> self entity) *robotboss-blueeco-sg* #f) - (-> s5-2 ppointer) - ) - ) - ) + (let ((gp-2 (manipy-spawn (-> self root-override trans) (-> self entity) *robotboss-blueeco-sg* #f :to self))) (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-2) 'anim-mode 'play1) (send-event (ppointer->process gp-2) 'rot-quat (-> self root-override quat)) @@ -4127,32 +2617,16 @@ (play-ambient (-> self ambient) "MAI-AM06" #t (the-as vector #f)) ) (set! (-> self took-hit) #f) - (ja-channel-push! 1 30) - (let ((v1-54 (-> self skel root-channel 0))) - (set! (-> v1-54 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-blue-hit-ja) ) ) - (when (not (or (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 33) - ) - ) - ) + (when (not (or (ja-group? robotboss-blue-roar-ja) (ja-group? robotboss-blue-last-hit-ja))) ) (robotboss-blue-beam 8 #t) (robotboss-blue-beam 9 #f) (when (TODO-RENAME-10 (-> self ambient) (new 'stack-no-clear 'vector) (seconds 10) (the-as float 327680.0) self) - (let* ((v1-73 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-74 (the-as number (logior #x3f800000 v1-73))) - (f0-2 (+ -1.0 (the-as float v1-74))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.8 f0-2) (play-ambient (-> self ambient) "GOL-AM02" #t (the-as vector #f)) @@ -4173,74 +2647,25 @@ ) ) (robotboss-position) - (robotboss-cut-cam (the-as float 5.0) (the-as float 50.0) (the-as int (-> self draw art-group data 5))) + (robotboss-cut-cam (the-as float 5.0) (the-as float 50.0) (the-as int robotboss-blue-roar-ja)) (none) ) - :code - (behavior () - (ja-channel-push! 1 120) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.4)) + (ja-no-eval :group! robotboss-idle-blue-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-32 (-> self skel root-channel 0))) - (set! (-> v1-32 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - ) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-12 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! - a0-12 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (loop + (when (not (ja-group? robotboss-idle-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-blue-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (when (<= (-> self hits-to-go) 0) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) @@ -4259,51 +2684,19 @@ ) ) ) - (ja-channel-push! 1 30) - (let ((v1-74 (-> self skel root-channel 0))) - (set! (-> v1-74 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-20 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-20 param 1) 1.0) - (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! - a0-20 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-blue-roar-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go robotboss-blue-dark-bomb) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) (defmethod init-from-entity! robotboss ((obj robotboss) (arg0 entity-actor)) @@ -4501,8 +2894,8 @@ (initialize-skeleton obj *robotboss-sg* '()) (aybabtu 2) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 (the-as float 40960.0))) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) - (set! (-> obj root-override nav-flags) (logand -2 (-> obj root-override nav-flags))) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) (set! (-> obj path) (new 'process 'path-control obj 'path (the-as float 0.0))) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (logclear! (-> obj mask) (process-mask actor-pause)) @@ -4533,61 +2926,17 @@ (set! (-> obj particle 4) (create-launch-control (-> *part-group-id-table* 654) obj)) (set! (-> obj particle 5) (create-launch-control (-> *part-group-id-table* 646) obj)) (set! (-> obj particle 6) (create-launch-control (-> *part-group-id-table* 651) obj)) - (set! (-> obj looping-sound 0) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "robo-blue-lp") - :volume #x400 - :fo-max 80 - ) - (-> obj root-override trans) - ) + (set! (-> obj looping-sound 0) + (new 'process 'ambient-sound (static-sound-spec "robo-blue-lp" :fo-max 80) (-> obj root-override trans)) ) - (set! (-> obj looping-sound 1) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "eco-torch") - :volume #x400 - :fo-max 80 - ) - (-> obj root-override trans) - ) + (set! (-> obj looping-sound 1) + (new 'process 'ambient-sound (static-sound-spec "eco-torch" :fo-max 80) (-> obj root-override trans)) ) - (set! (-> obj looping-sound 2) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "red-buzz") - :volume #x400 - :fo-max 80 - ) - (-> obj root-override trans) - ) + (set! (-> obj looping-sound 2) + (new 'process 'ambient-sound (static-sound-spec "red-buzz" :fo-max 80) (-> obj root-override trans)) ) - (set! (-> obj looping-sound 3) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "bfg-buzz") - :volume #x400 - :fo-max 80 - ) - (-> obj root-override trans) - ) + (set! (-> obj looping-sound 3) + (new 'process 'ambient-sound (static-sound-spec "bfg-buzz" :fo-max 80) (-> obj root-override trans)) ) (set! (-> obj blue-smoke) #f) (set! (-> obj red-smoke) #f) diff --git a/goal_src/levels/finalboss/sage-finalboss-part.gc b/goal_src/levels/finalboss/sage-finalboss-part.gc index ccd092334d..27308eb822 100644 --- a/goal_src/levels/finalboss/sage-finalboss-part.gc +++ b/goal_src/levels/finalboss/sage-finalboss-part.gc @@ -11,8 +11,7 @@ :id 682 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2825 :period 300 :length 5 :binding 2823) + :parts ((sp-item 2825 :period 300 :length 5 :binding 2823) (sp-item 2823 :flags (start-dead launch-asap) :binding 2824) (sp-item 2823 :flags (start-dead launch-asap) :binding 2824) (sp-item 2824 :flags (start-dead)) @@ -24,8 +23,7 @@ ) (defpart 2825 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2.5) (meters 5) 1.0) (sp-rnd-flt spt-y (meters -1.5) (meters 3) 1.0) @@ -41,8 +39,7 @@ ) (defpart 2823 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -65,8 +62,7 @@ ) (defpart 2824 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -85,8 +81,7 @@ ) (defpart 2827 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters -3.90625)) (sp-flt spt-scale-x (meters 15)) @@ -101,8 +96,7 @@ ) (defpart 2826 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.3) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters -3) (meters 6) 1.0) @@ -126,16 +120,14 @@ ) (defpart 2828 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 300 299 1) (sp-launcher-by-id spt-next-launcher 2829) ) ) (defpart 2829 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) (defpartgroup group-target-white-eco-ground @@ -143,8 +135,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2921) + :parts ((sp-item 2921) (sp-item 2922 :flags (is-3d)) (sp-item 2923 :flags (is-3d)) (sp-item 2924 :flags (is-3d)) @@ -154,8 +145,7 @@ ) (defpart 2921 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-flt spt-x (meters 2.5)) (sp-flt spt-y (meters -0.5)) (sp-int spt-rot-x 8) @@ -172,13 +162,11 @@ ) (defpart 2927 - :init-specs - ((sp-flt spt-fade-b -4.551111)) + :init-specs ((sp-flt spt-fade-b -4.551111)) ) (defpart 2924 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 2) 1.0) (sp-flt spt-y (meters 0.1)) @@ -198,8 +186,7 @@ ) (defpart 2922 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 2) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -220,8 +207,7 @@ ) (defpart 2923 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-x (meters 1.8) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) @@ -241,8 +227,7 @@ ) (defpart 2925 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 3.0 1.0) (sp-rnd-flt spt-x (meters 0) (meters 5.5) 1.0) (sp-flt spt-y (meters -0.5)) @@ -266,8 +251,7 @@ ) (defpart 2926 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 3.0 1.0) (sp-rnd-flt spt-x (meters 0) (meters 5) 1.0) (sp-flt spt-y (meters -0.5)) @@ -293,8 +277,7 @@ ) (defpart 2928 - :init-specs - ((sp-flt spt-fade-a -0.18)) + :init-specs ((sp-flt spt-fade-a -0.18)) ) (defpartgroup group-target-white-eco-joints @@ -302,13 +285,11 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2929) (sp-item 2930)) + :parts ((sp-item 2929) (sp-item 2930)) ) (defpart 2930 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.2 1.0) (sp-rnd-flt spt-x (meters -0.001) (meters 0.002) 1.0) (sp-rnd-flt spt-y (meters -0.001) (meters 0.002) 1.0) @@ -334,13 +315,11 @@ ) (defpart 2931 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) (defpart 2929 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 8.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -365,8 +344,7 @@ ) (defpart 2932 - :init-specs - ((sp-flt spt-userdata 2048000.0)) + :init-specs ((sp-flt spt-userdata 2048000.0)) ) (defun check-drop-level-eichar-lighteco-pops ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) @@ -374,30 +352,15 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2933) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2934) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 2933) gp-0) + (launch-particles :rate 1.0 (-> *part-id-table* 2934) gp-0) ) ) (none) ) (defpart 2934 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -413,8 +376,7 @@ ) (defpart 2933 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 4.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -437,13 +399,11 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2892)) + :parts ((sp-item 2892)) ) (defpart 2892 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 4.0 3.0 1.0) (sp-rnd-flt spt-x (meters -0.2) (meters -0.1) 1.0) (sp-rnd-flt spt-z (meters 0.2) (meters 0.1) 1.0) @@ -470,13 +430,11 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2893) (sp-item 2935)) + :parts ((sp-item 2893) (sp-item 2935)) ) (defpart 2935 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters -0.2) (meters -0.1) 1.0) (sp-rnd-flt spt-z (meters 0.2) (meters 0.1) 1.0) @@ -495,8 +453,7 @@ ) (defpart 2893 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.2) (meters -0.1) 1.0) (sp-rnd-flt spt-z (meters 0.2) (meters 0.1) 1.0) @@ -521,8 +478,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2936 :period 36 :length 5) + :parts ((sp-item 2936 :period 36 :length 5) (sp-item 2936 :period 140 :length 5) (sp-item 2936 :period 61 :length 5) (sp-item 2894 :period 15 :length 5) @@ -531,8 +487,7 @@ ) (defpart 2937 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 4) (meters 16) 1.0) @@ -548,8 +503,7 @@ ) (defpart 2894 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -575,8 +529,7 @@ ) (defpart 2936 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-int spt-num 0 1 8.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1) 1.0) @@ -608,8 +561,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2939 :period 1200 :length 20 :binding 2938) + :parts ((sp-item 2939 :period 1200 :length 20 :binding 2938) (sp-item 2940 :period 1200 :length 5) (sp-item 2941 :period 1200 :length 40) (sp-item 2942 :period 1200 :length 20) @@ -636,8 +588,7 @@ ) (defpart 2939 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) @@ -662,8 +613,7 @@ ) (defpart 2938 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 4) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -684,13 +634,11 @@ ) (defpart 2946 - :init-specs - ((sp-flt spt-fade-g -0.14222223) (sp-flt spt-fade-b -0.14222223)) + :init-specs ((sp-flt spt-fade-g -0.14222223) (sp-flt spt-fade-b -0.14222223)) ) (defpart 2945 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 10)) (sp-rnd-flt spt-scale-x (meters 8) (meters 60) 1.0) @@ -711,13 +659,11 @@ ) (defpart 2947 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) (defpart 2941 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 128.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 4) (meters 1) 1.0) @@ -740,13 +686,11 @@ ) (defpart 2948 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) (defpart 2944 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) @@ -764,8 +708,7 @@ ) (defpart 2940 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 256)) @@ -781,8 +724,7 @@ ) (defpart 2942 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters -8) (meters 16) 1.0) (sp-rnd-flt spt-scale-x (meters 20) (meters 40) 1.0) @@ -808,8 +750,7 @@ ) (defpart 2943 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 20.0) (sp-rnd-flt spt-y (meters -8) (meters 16) 1.0) (sp-rnd-flt spt-scale-x (meters 40) (meters 40) 1.0) @@ -839,13 +780,11 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2949) (sp-item 2950)) + :parts ((sp-item 2949) (sp-item 2950)) ) (defpart 2950 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 128.0) (sp-rnd-flt spt-x (meters 0) (meters 5) 1.0) (sp-flt spt-y (meters -8)) @@ -872,13 +811,11 @@ ) (defpart 2951 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334)) ) (defpart 2949 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-x (meters 0) (meters 10) 1.0) (sp-flt spt-y (meters -10)) @@ -904,8 +841,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2952 :flags (is-3d)) + :parts ((sp-item 2952 :flags (is-3d)) (sp-item 2953 :flags (is-3d)) (sp-item 2954 :flags (is-3d)) (sp-item 2955) @@ -916,8 +852,7 @@ ) (defpart 2952 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.1) (sp-flt spt-y (meters 10)) (sp-flt spt-z (meters 4)) @@ -939,13 +874,11 @@ ) (defpart 2959 - :init-specs - ((sp-flt spt-fade-a -0.16)) + :init-specs ((sp-flt spt-fade-a -0.16)) ) (defpart 2953 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.1) (sp-flt spt-y (meters 10)) (sp-flt spt-z (meters 4)) @@ -967,8 +900,7 @@ ) (defpart 2954 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.1) (sp-flt spt-y (meters 0.5)) (sp-flt spt-z (meters 4)) @@ -991,8 +923,7 @@ ) (defpart 2955 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-flt spt-y (meters 10)) (sp-flt spt-z (meters 8)) @@ -1016,8 +947,7 @@ ) (defpart 2956 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 10)) (sp-flt spt-z (meters 8)) @@ -1041,8 +971,7 @@ ) (defpart 2957 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters 10) (meters 40) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 20) 1.0) @@ -1063,13 +992,11 @@ ) (defpart 2960 - :init-specs - ((sp-flt spt-fade-a -0.85333335)) + :init-specs ((sp-flt spt-fade-a -0.85333335)) ) (defpart 2958 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 10) (meters 30) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 20) 1.0) @@ -1092,8 +1019,7 @@ ) (defpart 2961 - :init-specs - ((sp-flt spt-userdata 4096000.0)) + :init-specs ((sp-flt spt-userdata 4096000.0)) ) (defun check-drop-level-bigdoor-open-pops ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) @@ -1101,30 +1027,15 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2962) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2963) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 2962) gp-0) + (launch-particles :rate 1.0 (-> *part-id-table* 2963) gp-0) ) ) (none) ) (defpart 2963 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1140,8 +1051,7 @@ ) (defpart 2962 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 4.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1163,13 +1073,11 @@ :id 706 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2965)) + :parts ((sp-item 2965)) ) (defpart 2965 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters -3.90625)) (sp-flt spt-scale-x (meters 15)) diff --git a/goal_src/levels/finalboss/sage-finalboss.gc b/goal_src/levels/finalboss/sage-finalboss.gc index aec96556d0..126723dffe 100644 --- a/goal_src/levels/finalboss/sage-finalboss.gc +++ b/goal_src/levels/finalboss/sage-finalboss.gc @@ -4,40 +4,38 @@ ;; name: sage-finalboss-FIN.gc ;; name in dgo: sage-finalboss ;; dgos: FIN - ;; DECOMP BEGINS -(defskelgroup *robotboss-cinematic-sg* robotboss-cinematic - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -10 0 2000) - :longest-edge (meters 0) - ) +(import "goal_src/import/plat-eco-finalboss-ag.gc") +(import "goal_src/import/green-sagecage-ag.gc") +(import "goal_src/import/jak-white-ag.gc") +(import "goal_src/import/robotboss-cinematic-ag.gc") -(defskelgroup *jak-white-sg* jak-white - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *robotboss-cinematic-sg* robotboss-cinematic robotboss-cinematic-lod0-jg robotboss-cinematic-idle-ja + ((robotboss-cinematic-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10 0 2000) + ) -(defskelgroup *plat-eco-finalboss-unlit-sg* plat-eco-finalboss - 0 - 8 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *jak-white-sg* jak-white jak-white-lod0-jg jak-white-idle-ja + ((jak-white-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) -(defskelgroup *plat-eco-finalboss-lit-sg* plat-eco-finalboss - 4 - 8 - ((5 (meters 20)) (6 (meters 40)) (7 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *plat-eco-finalboss-unlit-sg* plat-eco-finalboss plat-eco-finalboss-lod0-jg plat-eco-finalboss-idle-ja + ((plat-eco-finalboss-lod0-mg (meters 20)) + (plat-eco-finalboss-lod1-mg (meters 40)) + (plat-eco-finalboss-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 3) + ) + +(defskelgroup *plat-eco-finalboss-lit-sg* plat-eco-finalboss plat-eco-finalboss-lit-lod0-jg plat-eco-finalboss-idle-ja + ((plat-eco-finalboss-lit-lod0-mg (meters 20)) + (plat-eco-finalboss-lit-lod1-mg (meters 40)) + (plat-eco-finalboss-lit-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 3) + ) (deftype plat-eco-finalboss (plat-eco) ((force-dest float :offset-assert 360) @@ -73,8 +71,7 @@ (defstate plat-path-active (plat-eco-finalboss) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('target) (process-entity-status! self (entity-perm-status complete) #t) @@ -107,8 +104,7 @@ ) ) ) - :enter - (behavior ((arg0 plat)) + :enter (behavior ((arg0 plat)) (set! (-> self state-time) (-> *display* base-frame-counter)) (lods-assign! (-> self draw) (-> self lit-look)) (process-entity-status! self (entity-perm-status complete) #t) @@ -123,8 +119,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((s5-0 (eval-path-curve! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp)) (gp-0 (eval-path-curve! (-> self path) (new 'stack-no-clear 'vector) 1.0 'interp)) ) @@ -151,32 +146,15 @@ (if (= (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self path-pos) (-> self dest)) ) - (set! (-> self path-pos) - (seek (-> self path-pos) (-> self dest) (* (-> self speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> self path-pos) (-> self dest) (* (-> self speed) (-> *display* seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) self) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'query) - (set! (-> a1-8 param 0) (the-as uint 'powerup)) - (set! (-> a1-8 param 1) (the-as uint 1)) - (when (send-event-function *target* a1-8) - (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> self force-dest) 0.0) - ) + (when (send-event *target* 'query 'powerup (pickup-type eco-yellow)) + (process-entity-status! self (entity-perm-status complete) #t) + (set! (-> self force-dest) 0.0) ) (none) ) @@ -249,30 +227,18 @@ (none) ) -(defskelgroup *sage-finalboss-sg* green-sagecage - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 3 - ) +(defskelgroup *sage-finalboss-sg* green-sagecage green-sagecage-lod0-jg green-sagecage-green-sagecage-idle-ja + ((green-sagecage-lod0-mg (meters 20)) (green-sagecage-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow green-sagecage-shadow-mg + ) (defmethod play-reminder sage-finalboss ((obj sage-finalboss)) (let ((s5-0 (entity-by-name "red-sagecage-1"))) (when s5-0 - (let ((s4-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj redsage) - (ppointer->handle (when s4-0 - (let ((t9-2 (method-of-type manipy activate))) - (t9-2 (the-as manipy s4-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 manipy-init (-> obj root-override trans) s5-0 *redsage-sg* #f) - (-> s4-0 ppointer) - ) - ) - ) - ) + (set! (-> obj redsage) + (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-0 *redsage-sg* #f :to obj)) + ) (send-event (handle->process (-> obj redsage)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj redsage)) 'blend-shape #t) (send-event (handle->process (-> obj redsage)) 'center-joint 3) @@ -281,18 +247,9 @@ ) (let ((s5-1 (entity-by-name "blue-sagecage-1"))) (when s5-1 - (let ((s4-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj bluesage) - (ppointer->handle (when s4-1 - (let ((t9-10 (method-of-type manipy activate))) - (t9-10 (the-as manipy s4-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 manipy-init (-> obj root-override trans) s5-1 *bluesage-sg* #f) - (-> s4-1 ppointer) - ) - ) - ) - ) + (set! (-> obj bluesage) + (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-1 *bluesage-sg* #f :to obj)) + ) (send-event (handle->process (-> obj bluesage)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj bluesage)) 'blend-shape #t) (send-event (handle->process (-> obj bluesage)) 'center-joint 3) @@ -303,19 +260,9 @@ (the-as symbol (when s5-2 - (let ((s4-2 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj yellowsage) - (ppointer->handle - (when s4-2 - (let ((t9-18 (method-of-type manipy activate))) - (t9-18 (the-as manipy s4-2) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s4-2 manipy-init (-> obj root-override trans) s5-2 *yellowsage-sg* #f) - (-> s4-2 ppointer) - ) - ) - ) - ) + (set! (-> obj yellowsage) + (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-2 *yellowsage-sg* #f :to obj)) + ) (send-event (handle->process (-> obj yellowsage)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj yellowsage)) 'blend-shape #t) (send-event (handle->process (-> obj yellowsage)) 'center-joint 3) @@ -330,19 +277,9 @@ (the-as symbol (when s5-0 - (let ((s4-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj assistant) - (ppointer->handle - (when s4-0 - (let ((t9-2 (method-of-type manipy activate))) - (t9-2 (the-as manipy s4-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 manipy-init (-> obj root-override trans) s5-0 *assistant-lavatube-end-sg* #f) - (-> s4-0 ppointer) - ) - ) - ) - ) + (set! (-> obj assistant) + (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-0 *assistant-lavatube-end-sg* #f :to obj)) + ) (let ((s5-1 (handle->process (-> obj assistant)))) (if (the-as manipy s5-1) (set! (-> (the-as manipy s5-1) draw level-index) (the-as uint (-> (level-get *level* 'finalboss) index))) @@ -358,294 +295,241 @@ ) (defmethod play-anim! sage-finalboss ((obj sage-finalboss) (arg0 symbol)) - (with-pp - (case (current-status (-> obj tasks)) - (((task-status unknown)) - (when arg0 - (close-current! (-> obj tasks)) - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) - ) - (new 'static 'spool-anim - :name "green-sagecage-daxter-sacrifice" - :index 8 - :parts 6 - :command-list - '((1 blackout 0) (236 joint "cameraB") (439 joint "camera")) - ) + (case (current-status (-> obj tasks)) + (((task-status unknown)) + (when arg0 + (close-current! (-> obj tasks)) + (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) ) - (((task-status need-introduction)) - (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) - (close-current! (-> obj tasks)) - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj jak-white) - (ppointer->handle - (when s5-1 - (let ((t9-6 (method-of-type manipy activate))) - (t9-6 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *jak-white-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) - (send-event - (handle->process (-> obj jak-white)) - 'eval - (lambda :behavior sage-finalboss () (set-vector! (-> self draw color-emissive) 0.5 0.5 0.5 0.0) (none)) - ) - (send-event (handle->process (-> obj jak-white)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj jak-white)) 'origin-joint-index 3) - (send-event (handle->process (-> obj jak-white)) 'blend-shape #t) - (let ((s5-2 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj robotboss) - (ppointer->handle - (when s5-2 - (let ((t9-13 (method-of-type manipy activate))) - (t9-13 (the-as manipy s5-2) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 manipy-init (-> obj root-override trans) (-> obj entity) *robotboss-cinematic-sg* #f) - (-> s5-2 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj robotboss)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj robotboss)) 'origin-joint-index 3) - (let ((v1-67 (handle->process (-> obj robotboss)))) - (if (the-as manipy v1-67) - (set! (-> (the-as manipy v1-67) draw bounds w) 2048000.0) - ) - ) - (let ((s5-3 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj silodoor) - (ppointer->handle - (when s5-3 - (let ((t9-18 (method-of-type manipy activate))) - (t9-18 (the-as manipy s5-3) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-3 manipy-init (-> obj root-override trans) (-> obj entity) *silodoor-sg* #f) - (-> s5-3 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj silodoor)) 'anim-mode 'clone-anim) - (let ((v1-84 (handle->process (-> obj silodoor)))) - (if (the-as manipy v1-84) - (set! (-> (the-as silodoor v1-84) draw bounds w) 2048000.0) - ) - ) - (send-event (process-by-name "silodoor-5" *active-pool*) 'hide) - (set-setting! *setting-control* pp 'music #f 0.0 0) - (set-setting! *setting-control* pp 'allow-progress #f 0.0 0) - ) - (new 'static 'spool-anim - :name "green-sagecage-outro-beat-boss-a" - :index 9 - :parts 8 - :command-list - '((0 send-event self activate-particle 0) - (0 send-event self activate-particle 1) - (0 send-event self activate-particle 7) - (1 blackout 0) - (61 joint "cameraB") - (71 send-event self activate-particle 2) - (156 joint "camera") - (216 joint "cameraB") - (259 send-event self deactivate-particle 2) - (259 send-event self activate-particle 3) - (268 send-event self activate-particle 4) - (270 send-event self deactivate-particle 3) - (270 send-event self deactivate-particle 0) - (270 send-event self deactivate-particle 1) - (271 joint "camera") - (269 send-event self activate-particle 5) - (272 send-event self flash) - (272 eval (lambda :behavior sage-finalboss - () - (let ((a0-1 (get-task-control (game-task finalboss-movies)))) - (save-reminder a0-1 (logior (get-reminder a0-1 0) 1) 0) - ) - (none) - ) - ) - (273 send-event self deactivate-particle 5) - (333 joint "cameraB") - (395 joint "camera") - (453 joint "cameraB") - (478 send-event self deactivate-particle 4) - (478 send-event self activate-particle 6) - (482 send-event self deactivate-particle 6) - (583 joint "camera") - (640 send-event self deactivate-particle 7) - ) - ) + (new 'static 'spool-anim + :name "green-sagecage-daxter-sacrifice" + :index 8 + :parts 6 + :command-list '((1 blackout 0) (236 joint "cameraB") (439 joint "camera")) ) - (((task-status need-reminder-a)) - (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) - (close-current! (-> obj tasks)) - (play-reminder obj) - (dummy-45 obj) - (set! (-> obj kick-the-credits) #t) - (let ((s5-5 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj robotplat) - (ppointer->handle - (when s5-5 - (let ((t9-30 (method-of-type manipy activate))) - (t9-30 (the-as manipy s5-5) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-5 - manipy-init - (-> obj root-override trans) - (-> obj entity) - *plat-eco-finalboss-lit-sg* - #f - ) - (-> s5-5 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj robotplat)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj robotplat)) 'origin-joint-index 3) - (set! (-> obj old-target-pos trans quad) - (-> (new 'static 'vector :x 11368946.0 :y 2215900.2 :z -19405602.0 :w 1.0) quad) + ) + (((task-status need-introduction)) + (when arg0 + (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) + (close-current! (-> obj tasks)) + (set! (-> obj jak-white) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *jak-white-sg* #f :to obj)) + ) + (send-event + (handle->process (-> obj jak-white)) + 'eval + (lambda :behavior sage-finalboss () (set-vector! (-> self draw color-emissive) 0.5 0.5 0.5 0.0) (none)) + ) + (send-event (handle->process (-> obj jak-white)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj jak-white)) 'origin-joint-index 3) + (send-event (handle->process (-> obj jak-white)) 'blend-shape #t) + (set! (-> obj robotboss) + (ppointer->handle + (manipy-spawn (-> obj root-override trans) (-> obj entity) *robotboss-cinematic-sg* #f :to obj) ) - (quaternion-copy! (-> obj old-target-pos quat) (new 'static 'quaternion :y -0.8472 :w 0.5312)) - (set-setting! *setting-control* pp 'music #f 0.0 0) - (set-setting! *setting-control* pp 'sfx-volume 'abs 0.0 0) - (set-setting! *setting-control* pp 'ambient-volume 'abs 0.0 0) - (set-setting! *setting-control* pp 'allow-progress #f 0.0 0) + ) + (send-event (handle->process (-> obj robotboss)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj robotboss)) 'origin-joint-index 3) + (let ((v1-67 (handle->process (-> obj robotboss)))) + (if (the-as manipy v1-67) + (set! (-> (the-as manipy v1-67) draw bounds w) 2048000.0) + ) ) - (new 'static 'spool-anim - :name "green-sagecage-outro-beat-boss-b" - :index 10 - :parts 27 - :command-list - '((0 kill "crate-3250") - (0 kill "crate-3251") - (0 kill "crate-3252") - (0 kill "crate-3253") - (0 kill "crate-3254") - (0 kill "crate-3255") - (0 kill "crate-3256") - (0 kill "crate-3257") - (0 kill "crate-3258") - (0 kill "crate-3259") - (0 kill "plat-eco-finalboss-1") - (1 blackout 0) - (61 joint "cameraB") - (136 joint "camera") - (510 joint "cameraB") - (641 joint "camera") - (751 joint "cameraB") - (1096 joint "camera") - (1321 joint "cameraB") - (1521 joint "camera") - (1636 joint "cameraB") - (1751 joint "camera") - (1916 joint "cameraB") - (1996 joint "camera") - (2256 joint "cameraB") - ) + (set! (-> obj silodoor) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *silodoor-sg* #f :to obj)) + ) + (send-event (handle->process (-> obj silodoor)) 'anim-mode 'clone-anim) + (let ((v1-84 (handle->process (-> obj silodoor)))) + (if (the-as manipy v1-84) + (set! (-> (the-as silodoor v1-84) draw bounds w) 2048000.0) + ) ) + (send-event (process-by-name "silodoor-5" *active-pool*) 'hide) + (set-setting! 'music #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) ) - (((task-status need-reminder)) - (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) -13116.667) - (close-current! (-> obj tasks)) - (dummy-45 obj) - (send-event *camera* 'teleport) - (set-setting! *setting-control* pp 'allow-progress #f 0.0 0) - ) - (cond - ((target-has-all-the-cells?) - (new 'static 'spool-anim - :name - "green-sagecage-outro-beat-boss-enough-cells" - :index 12 - :parts 6 - :command-list - '((0 send-event self fade) - (1 blackout 0) - (65 joint "cameraB") - (104 joint "camera") - (134 joint "cameraB") - (165 joint "camera") - (292 joint "cameraB") - (488 joint "camera") - (488 auto-save auto-save) + (new 'static 'spool-anim + :name "green-sagecage-outro-beat-boss-a" + :index 9 + :parts 8 + :command-list '((0 send-event self activate-particle 0) + (0 send-event self activate-particle 1) + (0 send-event self activate-particle 7) + (1 blackout 0) + (61 joint "cameraB") + (71 send-event self activate-particle 2) + (156 joint "camera") + (216 joint "cameraB") + (259 send-event self deactivate-particle 2) + (259 send-event self activate-particle 3) + (268 send-event self activate-particle 4) + (270 send-event self deactivate-particle 3) + (270 send-event self deactivate-particle 0) + (270 send-event self deactivate-particle 1) + (271 joint "camera") + (269 send-event self activate-particle 5) + (272 send-event self flash) + (272 eval (lambda :behavior sage-finalboss + () + (let ((a0-1 (get-task-control (game-task finalboss-movies)))) + (save-reminder a0-1 (logior (get-reminder a0-1 0) 1) 0) + ) + (none) + ) ) + (273 send-event self deactivate-particle 5) + (333 joint "cameraB") + (395 joint "camera") + (453 joint "cameraB") + (478 send-event self deactivate-particle 4) + (478 send-event self activate-particle 6) + (482 send-event self deactivate-particle 6) + (583 joint "camera") + (640 send-event self deactivate-particle 7) + ) + ) + ) + (((task-status need-reminder-a)) + (when arg0 + (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) + (close-current! (-> obj tasks)) + (play-reminder obj) + (dummy-45 obj) + (set! (-> obj kick-the-credits) #t) + (set! (-> obj robotplat) + (ppointer->handle + (manipy-spawn (-> obj root-override trans) (-> obj entity) *plat-eco-finalboss-lit-sg* #f :to obj) + ) + ) + (send-event (handle->process (-> obj robotplat)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj robotplat)) 'origin-joint-index 3) + (set! (-> obj old-target-pos trans quad) + (-> (new 'static 'vector :x 11368946.0 :y 2215900.2 :z -19405602.0 :w 1.0) quad) + ) + (quaternion-copy! (-> obj old-target-pos quat) (new 'static 'quaternion :y -0.8472 :w 0.5312)) + (set-setting! 'music #f 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + ) + (new 'static 'spool-anim + :name "green-sagecage-outro-beat-boss-b" + :index 10 + :parts 27 + :command-list '((0 kill "crate-3250") + (0 kill "crate-3251") + (0 kill "crate-3252") + (0 kill "crate-3253") + (0 kill "crate-3254") + (0 kill "crate-3255") + (0 kill "crate-3256") + (0 kill "crate-3257") + (0 kill "crate-3258") + (0 kill "crate-3259") + (0 kill "plat-eco-finalboss-1") + (1 blackout 0) + (61 joint "cameraB") + (136 joint "camera") + (510 joint "cameraB") + (641 joint "camera") + (751 joint "cameraB") + (1096 joint "camera") + (1321 joint "cameraB") + (1521 joint "camera") + (1636 joint "cameraB") + (1751 joint "camera") + (1916 joint "cameraB") + (1996 joint "camera") + (2256 joint "cameraB") + ) + ) + ) + (((task-status need-reminder)) + (when arg0 + (set-yaw-angle-clear-roll-pitch! (-> obj root-override) -13116.667) + (close-current! (-> obj tasks)) + (dummy-45 obj) + (send-event *camera* 'teleport) + (set-setting! 'allow-progress #f 0.0 0) + ) + (cond + ((target-has-all-the-cells?) + (new 'static 'spool-anim + :name "green-sagecage-outro-beat-boss-enough-cells" + :index 12 + :parts 6 + :command-list '((0 send-event self fade) + (1 blackout 0) + (65 joint "cameraB") + (104 joint "camera") + (134 joint "cameraB") + (165 joint "camera") + (292 joint "cameraB") + (488 joint "camera") + (488 auto-save auto-save) ) ) - (else - (if arg0 - (set-setting! *setting-control* pp 'allow-progress #f 0.0 0) - ) - (new 'static 'spool-anim - :name - "green-sagecage-outro-beat-boss-need-cells" - :index 11 - :parts 8 - :command-list - '((0 send-event self fade) - (1 blackout 0) - (65 joint "cameraB") - (104 joint "camera") - (134 joint "cameraB") - (165 joint "camera") - (292 joint "cameraB") - (488 joint "camera") - (488 auto-save auto-save) - ) + ) + (else + (if arg0 + (set-setting! 'allow-progress #f 0.0 0) + ) + (new 'static 'spool-anim + :name "green-sagecage-outro-beat-boss-need-cells" + :index 11 + :parts 8 + :command-list '((0 send-event self fade) + (1 blackout 0) + (65 joint "cameraB") + (104 joint "camera") + (134 joint "cameraB") + (165 joint "camera") + (292 joint "cameraB") + (488 joint "camera") + (488 auto-save auto-save) ) ) ) ) - (((task-status need-reward-speech)) - (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) -13116.667) - (close-current! (-> obj tasks)) - (dummy-45 obj) - (set! (-> obj left-door) (the-as entity-actor (entity-by-name "power-left-2"))) - (set! (-> obj right-door) (the-as entity-actor (entity-by-name "power-right-2"))) - (set-setting! *setting-control* pp 'allow-progress #f 0.0 0) - ) - (new 'static 'spool-anim - :name "green-sagecage-outro-big-finish" - :index 13 - :parts 7 - :command-list - '((1 blackout 0) - (61 joint "cameraB") - (102 joint "camera") - (145 joint "cameraB") - (220 send-event "power-left-2" open) - (220 send-event "power-right-2" open) - (235 joint "camera") - (243 send-event self activate-particle 8) - (322 joint "cameraB") - (428 joint "camera") - (519 joint "cameraB") - (602 joint "camera") - ) + ) + (((task-status need-reward-speech)) + (when arg0 + (set-yaw-angle-clear-roll-pitch! (-> obj root-override) -13116.667) + (close-current! (-> obj tasks)) + (dummy-45 obj) + (set! (-> obj left-door) (the-as entity-actor (entity-by-name "power-left-2"))) + (set! (-> obj right-door) (the-as entity-actor (entity-by-name "power-right-2"))) + (set-setting! 'allow-progress #f 0.0 0) + ) + (new 'static 'spool-anim + :name "green-sagecage-outro-big-finish" + :index 13 + :parts 7 + :command-list '((1 blackout 0) + (61 joint "cameraB") + (102 joint "camera") + (145 joint "cameraB") + (220 send-event "power-left-2" open) + (220 send-event "power-right-2" open) + (235 joint "camera") + (243 send-event self activate-particle 8) + (322 joint "cameraB") + (428 joint "camera") + (519 joint "cameraB") + (602 joint "camera") ) ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) ) - (-> obj draw art-group data 4) - ) + ) + (-> obj draw art-group data 4) ) ) ) @@ -684,8 +568,7 @@ (defstate play-anim (sage-finalboss) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('fade) (let ((f0-0 1.0)) @@ -711,14 +594,12 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self credit-fade) 0.0) ((-> (method-of-type process-taskable play-anim) enter)) (none) ) - :exit - (behavior () + :exit (behavior () (when (= (current-status (-> self tasks)) (task-status invalid)) (cond ((not (-> self credits-played)) @@ -829,8 +710,7 @@ ((-> (method-of-type process-taskable play-anim) exit)) (none) ) - :trans - (behavior () + :trans (behavior () (local-vars (f28-0 float)) (when (-> self left-door) (let ((f30-0 (ja-aframe-num 0))) @@ -1004,32 +884,30 @@ ) (defstate sage-finalboss-credits (sage-finalboss) - :exit - (behavior () + :exit (behavior () (when (= (current-status (-> self tasks)) (task-status invalid)) (set-blackout-frames 0) (initialize! *game-info* 'game (the-as game-save #f) "title-start") ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (s5-0 symbol)) (set! (-> self credits-played) #t) (set-blackout-frames 0) (set-blackout-frames (seconds 0.05)) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) - (clear-pending-settings-from-process *setting-control* self 'ambient-volume) - (set-setting! *setting-control* self 'allow-pause #f 0.0 0) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) - (set-setting! *setting-control* self 'music 'ogreboss 0.0 0) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'music 'ogreboss 0.0 0) (set! (-> self state-time) (-> *display* game-frame-counter)) (logior! (-> self draw status) (draw-status hidden)) (let ((gp-0 (-> self mask))) (load-state-want-display-level 'finalboss 'special) (logclear! (-> self mask) (process-mask pause progress)) - (push-setting! *setting-control* self 'process-mask 'set 0.0 8212) - (copy-settings-from-target! *setting-control*) + (add-setting! 'process-mask 'set 0.0 (process-mask pause progress target)) + (apply-settings *setting-control*) (let ((f30-0 0.0) (f28-0 0.5) ) @@ -1059,11 +937,11 @@ (set! (-> self mask) gp-0) ) (load-state-want-display-level 'finalboss 'display) - (clear-pending-settings-from-process *setting-control* self 'allow-pause) - (clear-pending-settings-from-process *setting-control* self 'allow-progress) - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (clear-pending-settings-from-process *setting-control* self 'music) - (copy-settings-from-target! *setting-control*) + (remove-setting! 'allow-pause) + (remove-setting! 'allow-progress) + (remove-setting! 'process-mask) + (remove-setting! 'music) + (apply-settings *setting-control*) (set-blackout-frames (seconds 0.05)) (let ((gp-1 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 0.05)) @@ -1112,15 +990,13 @@ (defstate hidden (sage-finalboss) :virtual #t - :enter - (behavior () + :enter (behavior () (sage-finalboss-extra-enter) ((-> (method-of-type process-taskable hidden) enter)) - (clear-pending-settings-from-process *setting-control* self 'allow-progress) + (remove-setting! 'allow-progress) (none) ) - :trans - (behavior () + :trans (behavior () (sage-finalboss-extra-trans) ((-> (method-of-type process-taskable hidden) trans)) (none) @@ -1129,14 +1005,12 @@ (defstate idle (sage-finalboss) :virtual #t - :enter - (behavior () + :enter (behavior () (sage-finalboss-extra-enter) ((-> (method-of-type process-taskable idle) enter)) (none) ) - :trans - (behavior () + :trans (behavior () (sage-finalboss-extra-trans) ((-> (method-of-type process-taskable idle) trans)) (none) diff --git a/goal_src/levels/firecanyon/assistant-firecanyon.gc b/goal_src/levels/firecanyon/assistant-firecanyon.gc index f51c2747c3..81dd8e9eeb 100644 --- a/goal_src/levels/firecanyon/assistant-firecanyon.gc +++ b/goal_src/levels/firecanyon/assistant-firecanyon.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/assistant-firecanyon-ag.gc") + (deftype assistant-firecanyon (process-taskable) () :heap-base #x110 @@ -16,14 +18,11 @@ ) -(defskelgroup *assistant-firecanyon-sg* assistant-firecanyon - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *assistant-firecanyon-sg* assistant-firecanyon assistant-firecanyon-lod0-jg assistant-firecanyon-idle-twist-ja + ((assistant-firecanyon-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow assistant-firecanyon-shadow-mg + ) (defmethod play-anim! assistant-firecanyon ((obj assistant-firecanyon) (arg0 symbol)) (case (current-status (-> obj tasks)) @@ -35,8 +34,7 @@ :name "assistant-firecanyon-resolution" :index 13 :parts 11 - :command-list - '((0 want-levels village1 firecanyon) + :command-list '((0 want-levels village1 firecanyon) (151 joint "cameraB") (346 joint "camera") (346 shadow self #f) @@ -75,8 +73,7 @@ (defstate hidden (assistant-firecanyon) :virtual #t - :trans - (behavior () + :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) (when (and (cond ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) @@ -132,382 +129,117 @@ (defstate idle (assistant-firecanyon) :virtual #t - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) ) - (while #t + (loop (let ((gp-0 #t)) (cond ((= (current-status (-> self tasks)) (task-status invalid)) - (let* ((v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-9 (the-as number (logior #x3f800000 v1-8))) - ) - (when (< (+ -1.0 (the-as float v1-9)) 0.5) - (let ((v1-14 (-> self skel root-channel 0))) - (set! (-> v1-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - ) - (let* ((f30-0 2.0) - (v1-16 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-17 (the-as number (logior #x3f800000 v1-16))) - ) - (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-17)))) 3)) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! - a0-15 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) - ) + (when (< (rand-float-gen) 0.5) + (ja :group! assistant-firecanyon-idle-a-ja) + (let* ((f30-0 2.0) + (v1-16 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-17 (the-as number (logior #x3f800000 v1-16))) + ) + (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-17)))) 3)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) ) ) - (set! gp-0 #f) ) + (set! gp-0 #f) ) - (when (or gp-0 (let* ((v1-53 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-54 (the-as number (logior #x3f800000 v1-53))) - ) - (< (+ -1.0 (the-as float v1-54)) 0.5) - ) - ) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-20 param 1) 1.0) - (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (when (or gp-0 (< (rand-float-gen) 0.5)) + (ja-no-eval :group! assistant-firecanyon-idle-to-b-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((v1-81 (-> self skel root-channel 0))) - (set! (-> v1-81 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) + (ja :num! (seek!)) ) + (ja :group! assistant-firecanyon-idle-b-ja) (let* ((f30-1 2.0) (v1-83 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-84 (the-as number (logior #x3f800000 v1-83))) ) (countdown (gp-2 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-84)))) 3)) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-28 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-28 param 1) 1.0) - (set! (-> a0-28 frame-num) 0.0) - (joint-control-channel-group! - a0-28 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1))) - (set! (-> a0-29 param 1) 1.0) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-31 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-31 param 1) 1.0) - (set! (-> a0-31 frame-num) 0.0) - (joint-control-channel-group! a0-31 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! assistant-firecanyon-idle-to-a-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-32 (-> self skel root-channel 0))) - (set! (-> a0-32 param 0) (the float (+ (-> a0-32 frame-group data 0 length) -1))) - (set! (-> a0-32 param 1) 1.0) - (joint-control-channel-group-eval! a0-32 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let* ((v1-140 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-141 (the-as number (logior #x3f800000 v1-140))) - ) - (when (< (+ -1.0 (the-as float v1-141)) 0.25) - (let ((v1-146 (-> self skel root-channel 0))) - (set! (-> v1-146 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - ) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-39 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-39 param 1) 1.0) - (set! (-> a0-39 frame-num) 0.0) - (joint-control-channel-group! - a0-39 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) (the float (+ (-> a0-40 frame-group data 0 length) -1))) - (set! (-> a0-40 param 1) 1.0) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) - ) + (when (< (rand-float-gen) 0.25) + (ja :group! assistant-firecanyon-idle-wipe-brow-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) ) ) ) (else - (let* ((v1-176 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-177 (the-as number (logior #x3f800000 v1-176))) - ) - (when (< (+ -1.0 (the-as float v1-177)) 0.8) - (let ((v1-182 (-> self skel root-channel 0))) - (set! (-> v1-182 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (let* ((f30-2 4.0) - (v1-184 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-185 (the-as number (logior #x3f800000 v1-184))) - ) - (countdown (gp-3 (+ (the int (* f30-2 (+ -1.0 (the-as float v1-185)))) 8)) - (let ((a0-49 (-> self skel root-channel 0))) - (set! (-> a0-49 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-49 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-49 param 1) 1.0) - (set! (-> a0-49 frame-num) 0.0) - (joint-control-channel-group! - a0-49 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-50 (-> self skel root-channel 0))) - (set! (-> a0-50 param 0) (the float (+ (-> a0-50 frame-group data 0 length) -1))) - (set! (-> a0-50 param 1) 1.0) - (joint-control-channel-group-eval! a0-50 (the-as art-joint-anim #f) num-func-seek!) - ) - ) + (when (< (rand-float-gen) 0.8) + (ja :group! assistant-firecanyon-idle-twist-ja) + (let* ((f30-2 4.0) + (v1-184 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-185 (the-as number (logior #x3f800000 v1-184))) + ) + (countdown (gp-3 (+ (the int (* f30-2 (+ -1.0 (the-as float v1-185)))) 8)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) ) ) - (set! gp-0 #f) ) + (set! gp-0 #f) ) - (when (or gp-0 (let* ((v1-221 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-222 (the-as number (logior #x3f800000 v1-221))) - ) - (< (+ -1.0 (the-as float v1-222)) 0.5) - ) - ) - (let ((a0-54 (-> self skel root-channel 0))) - (set! (-> a0-54 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-54 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-54 param 1) 1.0) - (set! (-> a0-54 frame-num) 0.0) - (joint-control-channel-group! a0-54 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (when (or gp-0 (< (rand-float-gen) 0.5)) + (ja-no-eval :group! assistant-firecanyon-idle-down-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-55 (-> self skel root-channel 0))) - (set! (-> a0-55 param 0) (the float (+ (-> a0-55 frame-group data 0 length) -1))) - (set! (-> a0-55 param 1) 1.0) - (joint-control-channel-group-eval! a0-55 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((v1-249 (-> self skel root-channel 0))) - (set! (-> v1-249 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) + (ja :num! (seek!)) ) + (ja :group! assistant-firecanyon-idle-examine-ja) (let* ((f30-3 2.0) (v1-251 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-252 (the-as number (logior #x3f800000 v1-251))) ) (countdown (gp-4 (+ (the int (* f30-3 (+ -1.0 (the-as float v1-252)))) 3)) - (let ((a0-62 (-> self skel root-channel 0))) - (set! (-> a0-62 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-62 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-62 param 1) 1.0) - (set! (-> a0-62 frame-num) 0.0) - (joint-control-channel-group! - a0-62 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-63 (-> self skel root-channel 0))) - (set! (-> a0-63 param 0) (the float (+ (-> a0-63 frame-group data 0 length) -1))) - (set! (-> a0-63 param 1) 1.0) - (joint-control-channel-group-eval! a0-63 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let ((a0-65 (-> self skel root-channel 0))) - (set! (-> a0-65 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-65 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-65 param 1) 1.0) - (set! (-> a0-65 frame-num) 0.0) - (joint-control-channel-group! a0-65 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! assistant-firecanyon-idle-up-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-66 (-> self skel root-channel 0))) - (set! (-> a0-66 param 0) (the float (+ (-> a0-66 frame-group data 0 length) -1))) - (set! (-> a0-66 param 1) 1.0) - (joint-control-channel-group-eval! a0-66 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let* ((v1-308 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-309 (the-as number (logior #x3f800000 v1-308))) - ) - (when (< (+ -1.0 (the-as float v1-309)) 0.5) - (let ((v1-314 (-> self skel root-channel 0))) - (set! (-> v1-314 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) - (let* ((f30-4 2.0) - (v1-316 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-317 (the-as number (logior #x3f800000 v1-316))) - ) - (countdown (gp-5 (+ (the int (* f30-4 (+ -1.0 (the-as float v1-317)))) 3)) - (let ((a0-75 (-> self skel root-channel 0))) - (set! (-> a0-75 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-75 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-75 param 1) 1.0) - (set! (-> a0-75 frame-num) 0.0) - (joint-control-channel-group! - a0-75 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-76 (-> self skel root-channel 0))) - (set! (-> a0-76 param 0) (the float (+ (-> a0-76 frame-group data 0 length) -1))) - (set! (-> a0-76 param 1) 1.0) - (joint-control-channel-group-eval! a0-76 (the-as art-joint-anim #f) num-func-seek!) - ) - ) + (when (< (rand-float-gen) 0.5) + (ja :group! assistant-firecanyon-idle-fiddle-ja) + (let* ((f30-4 2.0) + (v1-316 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-317 (the-as number (logior #x3f800000 v1-316))) + ) + (countdown (gp-5 (+ (the int (* f30-4 (+ -1.0 (the-as float v1-317)))) 3)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) ) ) ) diff --git a/goal_src/levels/firecanyon/firecanyon-obs.gc b/goal_src/levels/firecanyon/firecanyon-obs.gc index 4f14e47261..c17469ddad 100644 --- a/goal_src/levels/firecanyon/firecanyon-obs.gc +++ b/goal_src/levels/firecanyon/firecanyon-obs.gc @@ -5,16 +5,12 @@ ;; name in dgo: firecanyon-obs ;; dgos: L1, FIC, OGR -(define-extern *balloon-sg* skeleton-group) -(define-extern *crate-darkeco-cluster-sg* skeleton-group) -(define-extern *spike-sg* skeleton-group) - -(declare-type spike process-drawable) -(declare-type balloon process-drawable) - ;; DECOMP BEGINS +(import "goal_src/import/crate-darkeco-cluster-ag.gc") +(import "goal_src/import/spike-ag.gc") + (deftype balloon (process-drawable) ((root-override collide-shape :offset 112) ) @@ -33,13 +29,11 @@ :id 227 :duration 5 :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 1006) (sp-item 1007) (sp-item 1008)) + :parts ((sp-item 1006) (sp-item 1007) (sp-item 1008)) ) (defpart 1007 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 2) 1.0) @@ -59,8 +53,7 @@ ) (defpart 1008 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-y (meters 2)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) @@ -83,8 +76,7 @@ ) (defpart 1006 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 12)) @@ -101,29 +93,21 @@ ) (defstate balloon-popping (balloon) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "cool-balloon") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 227) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (sound-play "cool-balloon") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 227) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (suspend) (cleanup-for-death self) @@ -133,8 +117,7 @@ ) (defstate balloon-idle (balloon) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (send-event arg0 'heat -10.0) @@ -142,49 +125,18 @@ ) ) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior balloon) ja-post) + :post (the-as (function none :behavior balloon) ja-post) ) (defmethod init-from-entity! balloon ((obj balloon) (arg0 entity-actor)) @@ -223,17 +175,14 @@ ) -(defskelgroup *spike-sg* spike - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 8 0 10.2) - :longest-edge (meters 5) - ) +(defskelgroup *spike-sg* spike spike-lod0-jg spike-idle-ja + ((spike-lod0-mg (meters 20)) (spike-lod1-mg (meters 999999))) + :bounds (static-spherem 0 8 0 10.2) + :longest-edge (meters 5) + ) (defstate spike-up (spike) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'go-spike-up) #t @@ -241,26 +190,20 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (nonzero? (-> self num-alts)) (let ((s5-0 (/ (-> self num-alts) 2)) (gp-0 #t) ) (while (< s5-0 (+ (-> self num-alts) -1)) (let ((v1-2 (entity-actor-lookup (-> self entity) 'alt-actor s5-0))) - (if (and v1-2 (-> v1-2 extra process) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'go-spike-up) - (not (send-event-function - (if v1-2 - (-> v1-2 extra process) - ) - a1-1 - ) + (if (and v1-2 (-> v1-2 extra process) (not (send-event + (if v1-2 + (-> v1-2 extra process) + ) + 'go-spike-up ) - ) + ) ) (set! gp-0 #f) ) @@ -275,44 +218,14 @@ ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (transform-post) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (suspend) ) (none) @@ -320,8 +233,7 @@ ) (defstate spike-down (spike) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'go-spike-up) (go spike-up) @@ -330,26 +242,20 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (nonzero? (-> self num-alts)) (let ((s5-0 0) (gp-0 #t) ) (while (< s5-0 (/ (-> self num-alts) 2)) (let ((v1-1 (entity-actor-lookup (-> self entity) 'alt-actor s5-0))) - (if (and v1-1 (-> v1-1 extra process) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'go-spike-up) - (not (send-event-function - (if v1-1 - (-> v1-1 extra process) - ) - a1-1 - ) + (if (and v1-1 (-> v1-1 extra process) (not (send-event + (if v1-1 + (-> v1-1 extra process) + ) + 'go-spike-up ) - ) + ) ) (set! gp-0 #f) ) @@ -364,10 +270,9 @@ ) (none) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t + (loop (suspend) ) (none) @@ -375,30 +280,19 @@ ) (defstate spike-idle (spike) - :trans - (behavior () + :trans (behavior () (when (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'mode)) - (= (send-event-function *target* a1-0) 'racer) - ) + (= (send-event *target* 'query 'mode) 'racer) (< (vector-vector-distance (-> self root-override trans) (target-pos 0)) 225280.0) ) - (sound-play-by-name (static-sound-name "magma-rock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "magma-rock") (let ((v1-8 (entity-actor-count (-> self entity) 'alt-actor))) 0 (cond ((>= 1 v1-8) (go spike-up) ) - ((let* ((v1-11 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-12 (the-as number (logior #x3f800000 v1-11))) - ) - (< (+ -1.0 (the-as float v1-12)) 0.5) - ) + ((< (rand-float-gen) 0.5) (go spike-down) ) (else @@ -409,10 +303,9 @@ ) (none) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t + (loop (suspend) ) (none) @@ -481,13 +374,10 @@ (none) ) -(defskelgroup *crate-darkeco-cluster-sg* crate-darkeco-cluster - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 1.6 0 3.3) - :longest-edge (meters 0) - ) +(defskelgroup *crate-darkeco-cluster-sg* crate-darkeco-cluster crate-darkeco-cluster-lod0-jg crate-darkeco-cluster-idle-ja + ((crate-darkeco-cluster-lod0-mg (meters 20)) (crate-darkeco-cluster-lod1-mg (meters 999999))) + :bounds (static-spherem 0 1.6 0 3.3) + ) (deftype crate-darkeco-cluster (process-drawable) ((root-override collide-shape :offset 112) @@ -508,8 +398,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2100 :period 600 :length 5) + :parts ((sp-item 2100 :period 600 :length 5) (sp-item 2101 :period 600 :length 40) (sp-item 2102 :period 600 :length 20) (sp-item 2103 :period 600 :length 20) @@ -582,8 +471,7 @@ ) (defpart 2104 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 2) 1.0) @@ -602,8 +490,7 @@ ) (defpart 2101 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -628,13 +515,11 @@ ) (defpart 2105 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) (defpart 2103 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-flt spt-scale-x (meters 0.3)) @@ -652,8 +537,7 @@ ) (defpart 2100 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 24)) @@ -669,8 +553,7 @@ ) (defpart 2102 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -697,29 +580,21 @@ (defstate die (crate-darkeco-cluster) :virtual #t - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 228) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (sound-play "dcrate-break") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 228) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (suspend) (cleanup-for-death self) @@ -730,27 +605,15 @@ (defstate idle (crate-darkeco-cluster) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack 'touch) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((a2-2 (new 'static 'attack-info :mask #x20))) - (set! (-> a2-2 mode) 'darkeco) - (set! (-> a1-3 param 1) (the-as uint a2-2)) - ) - (send-event-function arg0 a1-3) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'darkeco)))) (go-virtual die) ) ) ) - :code - (behavior () + :code (behavior () (transform-post) (logior! (-> self mask) (process-mask sleep)) (suspend) diff --git a/goal_src/levels/firecanyon/firecanyon-part.gc b/goal_src/levels/firecanyon/firecanyon-part.gc index 15ca864954..a87ceab3b9 100644 --- a/goal_src/levels/firecanyon/firecanyon-part.gc +++ b/goal_src/levels/firecanyon/firecanyon-part.gc @@ -19,8 +19,7 @@ (defpartgroup group-firecanyon-lava-1 :id 229 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1011 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1011 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1012 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1013 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -35,8 +34,7 @@ ) (defpart 1012 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -9) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) @@ -61,8 +59,7 @@ ) (defpart 1014 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -8) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) @@ -82,8 +79,7 @@ ) (defpart 1013 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.03 0.03 1.0) (sp-rnd-flt spt-x (meters -8) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) @@ -105,8 +101,7 @@ ) (defpart 1011 - :init-specs - ((sp-flt spt-num 0.5) + :init-specs ((sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -9) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -7) (meters 6) 1.0) @@ -126,8 +121,7 @@ (defpartgroup group-firecanyon-lava-2 :id 230 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1017 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1017 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1018 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1019 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -142,8 +136,7 @@ ) (defpart 1018 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -10) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) @@ -168,8 +161,7 @@ ) (defpart 1020 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -9) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) @@ -189,8 +181,7 @@ ) (defpart 1019 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -9) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) @@ -212,8 +203,7 @@ ) (defpart 1017 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -5) (meters 12) 1.0) @@ -233,8 +223,7 @@ (defpartgroup group-firecanyon-lava-3 :id 231 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1021 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1021 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1022 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1023 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -249,8 +238,7 @@ ) (defpart 1022 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -10.5) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) @@ -275,8 +263,7 @@ ) (defpart 1024 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -9.5) (meters 18) 1.0) (sp-flt spt-y (meters 0.5)) @@ -296,8 +283,7 @@ ) (defpart 1023 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -9.5) (meters 18) 1.0) (sp-flt spt-y (meters 0.5)) @@ -319,8 +305,7 @@ ) (defpart 1021 - :init-specs - ((sp-flt spt-num 1.6) + :init-specs ((sp-flt spt-num 1.6) (sp-rnd-flt spt-x (meters -10.5) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -20) (meters 36) 1.0) @@ -340,8 +325,7 @@ (defpartgroup group-firecanyon-lava-5 :id 232 :bounds (static-bspherem -2 0 -2 14) - :parts - ((sp-item 1025 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1025 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1026 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1027 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -356,8 +340,7 @@ ) (defpart 1028 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -6) (meters 13) 1.0) (sp-flt spt-y (meters 0)) @@ -377,8 +360,7 @@ ) (defpart 1010 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -397,8 +379,7 @@ ) (defpart 1027 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -6) (meters 13) 1.0) (sp-flt spt-y (meters 0)) @@ -420,8 +401,7 @@ ) (defpart 1009 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -438,8 +418,7 @@ ) (defpart 1025 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -8) (meters 16) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -13) (meters 20) 1.0) @@ -457,13 +436,11 @@ ) (defpart 1016 - :init-specs - ((sp-flt spt-fade-b -6.826667)) + :init-specs ((sp-flt spt-fade-b -6.826667)) ) (defpart 1026 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -8) (meters 16) 1.0) (sp-flt spt-y (meters -0.5)) @@ -488,13 +465,11 @@ ) (defpart 1015 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 1029)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 1029)) ) (defpart 1029 - :init-specs - ((sp-flt spt-fade-r -0.8) + :init-specs ((sp-flt spt-fade-r -0.8) (sp-flt spt-fade-b 0.8) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 1030) @@ -502,15 +477,13 @@ ) (defpart 1030 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.14222223)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.14222223)) ) (defpartgroup group-firecanyon-lava-6 :id 233 :bounds (static-bspherem 2 0 2 14) - :parts - ((sp-item 1031 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1031 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1032 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1033 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -525,8 +498,7 @@ ) (defpart 1034 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -5) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) @@ -546,8 +518,7 @@ ) (defpart 1032 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -6) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) @@ -572,8 +543,7 @@ ) (defpart 1033 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -5) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) @@ -595,8 +565,7 @@ ) (defpart 1031 - :init-specs - ((sp-flt spt-num 1.3) + :init-specs ((sp-flt spt-num 1.3) (sp-rnd-flt spt-x (meters -6) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -6.5) (meters 15) 1.0) @@ -616,8 +585,7 @@ (defpartgroup group-firecanyon-lava-7 :id 234 :bounds (static-bspherem 0 0 0 14) - :parts - ((sp-item 1035 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1035 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1036 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1037 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -632,8 +600,7 @@ ) (defpart 1036 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -6.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) @@ -658,8 +625,7 @@ ) (defpart 1038 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -5.5) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -679,8 +645,7 @@ ) (defpart 1037 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -5.5) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -702,8 +667,7 @@ ) (defpart 1035 - :init-specs - ((sp-flt spt-num 1.1) + :init-specs ((sp-flt spt-num 1.1) (sp-rnd-flt spt-x (meters -6.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -1.5) (meters 15) 1.0) @@ -723,8 +687,7 @@ (defpartgroup group-firecanyon-lava-8 :id 235 :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 1039 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1039 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1040 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1041 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -739,8 +702,7 @@ ) (defpart 1040 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -9.5) (meters 14) 1.0) (sp-flt spt-y (meters 0.5)) @@ -765,8 +727,7 @@ ) (defpart 1042 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -8.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) @@ -786,8 +747,7 @@ ) (defpart 1041 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -8.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) @@ -809,8 +769,7 @@ ) (defpart 1039 - :init-specs - ((sp-flt spt-num 1.4) + :init-specs ((sp-flt spt-num 1.4) (sp-rnd-flt spt-x (meters -9.5) (meters 14) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -13) (meters 28) 1.0) @@ -830,8 +789,7 @@ (defpartgroup group-firecanyon-lava-9 :id 236 :bounds (static-bspherem 0 0 0 9) - :parts - ((sp-item 1043 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1043 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1044 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1045 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -846,8 +804,7 @@ ) (defpart 1044 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.08) (sp-rnd-flt spt-x (meters -3.5) (meters 7) 1.0) (sp-flt spt-y (meters 0.5)) @@ -872,8 +829,7 @@ ) (defpart 1046 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.6) (sp-rnd-flt spt-x (meters -2.5) (meters 5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -893,8 +849,7 @@ ) (defpart 1045 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.03 0.03 1.0) (sp-rnd-flt spt-x (meters -2.5) (meters 5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -916,8 +871,7 @@ ) (defpart 1043 - :init-specs - ((sp-flt spt-num 0.6) + :init-specs ((sp-flt spt-num 0.6) (sp-rnd-flt spt-x (meters -3.5) (meters 7) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -7) (meters 15) 1.0) @@ -937,8 +891,7 @@ (defpartgroup group-firecanyon-lava-10 :id 237 :bounds (static-bspherem -4 0 0 15) - :parts - ((sp-item 1047 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1047 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1048 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1049 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -953,8 +906,7 @@ ) (defpart 1048 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -13.5) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) @@ -979,8 +931,7 @@ ) (defpart 1050 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -12.5) (meters 18) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1000,8 +951,7 @@ ) (defpart 1049 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -12.5) (meters 18) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1023,8 +973,7 @@ ) (defpart 1047 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -13.5) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -14) (meters 22) 1.0) @@ -1044,8 +993,7 @@ (defpartgroup group-firecanyon-lava-11 :id 238 :bounds (static-bspherem -4 0 0 12) - :parts - ((sp-item 1051 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1051 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1052 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1053 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1060,8 +1008,7 @@ ) (defpart 1052 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -10.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1086,8 +1033,7 @@ ) (defpart 1054 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -9.5) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1107,8 +1053,7 @@ ) (defpart 1053 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -9.5) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1130,8 +1075,7 @@ ) (defpart 1051 - :init-specs - ((sp-flt spt-num 0.7) + :init-specs ((sp-flt spt-num 0.7) (sp-rnd-flt spt-x (meters -10.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -11) (meters 14) 1.0) @@ -1151,8 +1095,7 @@ (defpartgroup group-firecanyon-lava-14 :id 239 :bounds (static-bspherem -4 0 0 15) - :parts - ((sp-item 1055 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1055 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1056 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1057 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1167,8 +1110,7 @@ ) (defpart 1056 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -17.5) (meters 25) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1193,8 +1135,7 @@ ) (defpart 1058 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -16.5) (meters 23) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1214,8 +1155,7 @@ ) (defpart 1057 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -16.5) (meters 23) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1237,8 +1177,7 @@ ) (defpart 1055 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -17.5) (meters 25) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -12) (meters 24) 1.0) @@ -1258,8 +1197,7 @@ (defpartgroup group-firecanyon-lava-15 :id 240 :bounds (static-bspherem -4 0 0 12) - :parts - ((sp-item 1059 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1059 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1060 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1061 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1274,8 +1212,7 @@ ) (defpart 1060 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -10.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1300,8 +1237,7 @@ ) (defpart 1062 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -9.5) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1321,8 +1257,7 @@ ) (defpart 1061 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.04 0.04 1.0) (sp-rnd-flt spt-x (meters -9.5) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1344,8 +1279,7 @@ ) (defpart 1059 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -11) (meters 24) 1.0) @@ -1365,8 +1299,7 @@ (defpartgroup group-firecanyon-lava-16 :id 241 :bounds (static-bspherem 0 0 0 14) - :parts - ((sp-item 1063 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1063 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1064 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1065 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1381,8 +1314,7 @@ ) (defpart 1064 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -9.5) (meters 16) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1407,8 +1339,7 @@ ) (defpart 1066 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -8.5) (meters 14) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1428,8 +1359,7 @@ ) (defpart 1065 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -8.5) (meters 14) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1451,8 +1381,7 @@ ) (defpart 1063 - :init-specs - ((sp-flt spt-num 1.1) + :init-specs ((sp-flt spt-num 1.1) (sp-rnd-flt spt-x (meters -9.5) (meters 16) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -12) (meters 26) 1.0) @@ -1472,8 +1401,7 @@ (defpartgroup group-firecanyon-lava-18 :id 242 :bounds (static-bspherem -4 0 -4 26) - :parts - ((sp-item 1067 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1067 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1068 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1069 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1488,8 +1416,7 @@ ) (defpart 1068 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -11) (meters 24) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1514,8 +1441,7 @@ ) (defpart 1070 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -10) (meters 22) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1535,8 +1461,7 @@ ) (defpart 1069 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.07 0.07 1.0) (sp-rnd-flt spt-x (meters -10) (meters 22) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1558,8 +1483,7 @@ ) (defpart 1067 - :init-specs - ((sp-flt spt-num 1.9) + :init-specs ((sp-flt spt-num 1.9) (sp-rnd-flt spt-x (meters -11) (meters 24) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -28) (meters 42) 1.0) @@ -1579,8 +1503,7 @@ (defpartgroup group-firecanyon-lava-19 :id 243 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1071 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1071 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1072 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1073 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1595,8 +1518,7 @@ ) (defpart 1072 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.3) (sp-rnd-flt spt-x (meters -10) (meters 23) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1621,8 +1543,7 @@ ) (defpart 1074 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -9) (meters 21) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1642,8 +1563,7 @@ ) (defpart 1073 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -9) (meters 21) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1665,8 +1585,7 @@ ) (defpart 1071 - :init-specs - ((sp-flt spt-num 1.4) + :init-specs ((sp-flt spt-num 1.4) (sp-rnd-flt spt-x (meters -10) (meters 23) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -18) (meters 28) 1.0) @@ -1686,8 +1605,7 @@ (defpartgroup group-firecanyon-lava-21 :id 244 :bounds (static-bspherem -4 0 4 22) - :parts - ((sp-item 1075 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1075 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1076 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1077 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1702,8 +1620,7 @@ ) (defpart 1076 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.17) (sp-rnd-flt spt-x (meters -23) (meters 32) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1728,8 +1645,7 @@ ) (defpart 1078 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-x (meters -22) (meters 30) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1749,8 +1665,7 @@ ) (defpart 1077 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.03 0.03 1.0) (sp-rnd-flt spt-x (meters -22) (meters 30) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1772,8 +1687,7 @@ ) (defpart 1075 - :init-specs - ((sp-flt spt-num 0.7) + :init-specs ((sp-flt spt-num 0.7) (sp-rnd-flt spt-x (meters -23) (meters 32) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -5) (meters 4) 1.0) @@ -1793,8 +1707,7 @@ (defpartgroup group-firecanyon-lava-22 :id 245 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1079 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1079 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1080 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1081 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1809,8 +1722,7 @@ ) (defpart 1080 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -7) (meters 25) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1835,8 +1747,7 @@ ) (defpart 1082 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -6) (meters 23) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1856,8 +1767,7 @@ ) (defpart 1081 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -6) (meters 23) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1879,8 +1789,7 @@ ) (defpart 1079 - :init-specs - ((sp-flt spt-num 0.5) + :init-specs ((sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -7) (meters 25) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -4) (meters 6) 1.0) @@ -1900,8 +1809,7 @@ (defpartgroup group-firecanyon-lava-60 :id 246 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1083 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1083 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1084 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1085 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1916,8 +1824,7 @@ ) (defpart 1084 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -11) (meters 21) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1942,8 +1849,7 @@ ) (defpart 1086 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.3) (sp-rnd-flt spt-x (meters -10) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1963,8 +1869,7 @@ ) (defpart 1085 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -10) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1986,8 +1891,7 @@ ) (defpart 1083 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -11) (meters 21) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -17) (meters 30) 1.0) @@ -2007,8 +1911,7 @@ (defpartgroup group-firecanyon-lava-62 :id 247 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1087 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1087 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1088 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1089 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -2023,8 +1926,7 @@ ) (defpart 1088 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -9) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2049,8 +1951,7 @@ ) (defpart 1090 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -8) (meters 15) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2070,8 +1971,7 @@ ) (defpart 1089 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.04 0.04 1.0) (sp-rnd-flt spt-x (meters -8) (meters 15) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2093,8 +1993,7 @@ ) (defpart 1087 - :init-specs - ((sp-flt spt-num 0.7) + :init-specs ((sp-flt spt-num 0.7) (sp-rnd-flt spt-x (meters -9) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -8) (meters 14) 1.0) @@ -2114,8 +2013,7 @@ (defpartgroup group-firecanyon-lava-63 :id 248 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1091 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1091 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1092 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1093 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -2130,8 +2028,7 @@ ) (defpart 1092 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -8) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2156,8 +2053,7 @@ ) (defpart 1094 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -7) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2177,8 +2073,7 @@ ) (defpart 1093 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.04 0.04 1.0) (sp-rnd-flt spt-x (meters -7) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2200,8 +2095,7 @@ ) (defpart 1091 - :init-specs - ((sp-flt spt-num 0.7) + :init-specs ((sp-flt spt-num 0.7) (sp-rnd-flt spt-x (meters -8) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -10) (meters 16) 1.0) @@ -2221,8 +2115,7 @@ (defpartgroup group-firecanyon-lava-64 :id 249 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1095 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1095 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1096 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1097 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -2237,8 +2130,7 @@ ) (defpart 1096 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -3) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2263,8 +2155,7 @@ ) (defpart 1098 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.6) (sp-rnd-flt spt-x (meters -2) (meters 8) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2284,8 +2175,7 @@ ) (defpart 1097 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.02 0.02 1.0) (sp-rnd-flt spt-x (meters -2) (meters 8) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2307,8 +2197,7 @@ ) (defpart 1095 - :init-specs - ((sp-flt spt-num 0.4) + :init-specs ((sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -3) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -5) (meters 9) 1.0) @@ -2328,15 +2217,13 @@ (defpartgroup group-firecanyon-heat-44 :id 250 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1099 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1099 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1100 :fade-after (meters 150) :falloff-to (meters 150)) ) ) (defpart 1100 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters 0) (meters 14) 1.0) (sp-flt spt-y (meters -6)) @@ -2362,8 +2249,7 @@ ) (defpart 1099 - :init-specs - ((sp-flt spt-num 1.25) + :init-specs ((sp-flt spt-num 1.25) (sp-rnd-flt spt-x (meters 0) (meters 14) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -16) (meters 18) 1.0) @@ -2383,15 +2269,13 @@ (defpartgroup group-firecanyon-heat-45 :id 251 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1101 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1101 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1102 :fade-after (meters 150) :falloff-to (meters 150)) ) ) (defpart 1102 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters 0) (meters 12) 1.0) (sp-flt spt-y (meters -6)) @@ -2417,8 +2301,7 @@ ) (defpart 1101 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 12) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -4) (meters 16) 1.0) @@ -2438,15 +2321,13 @@ (defpartgroup group-firecanyon-heat-46 :id 252 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1103 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1103 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1104 :fade-after (meters 150) :falloff-to (meters 150)) ) ) (defpart 1104 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -3) (meters 5) 1.0) (sp-flt spt-y (meters -6)) @@ -2472,8 +2353,7 @@ ) (defpart 1103 - :init-specs - ((sp-flt spt-num 0.5) + :init-specs ((sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -3) (meters 5) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters 0) (meters 14) 1.0) @@ -2493,15 +2373,13 @@ (defpartgroup group-firecanyon-heat-47 :id 253 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1105 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1105 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1106 :fade-after (meters 150) :falloff-to (meters 150)) ) ) (defpart 1106 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.08) (sp-rnd-flt spt-x (meters 2) (meters 5) 1.0) (sp-flt spt-y (meters -6)) @@ -2527,8 +2405,7 @@ ) (defpart 1105 - :init-specs - ((sp-flt spt-num 0.4) + :init-specs ((sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters 2) (meters 5) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -12) (meters 14) 1.0) @@ -2548,15 +2425,13 @@ (defpartgroup group-firecanyon-heat-48 :id 254 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1107 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1107 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1108 :fade-after (meters 150) :falloff-to (meters 150)) ) ) (defpart 1108 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -13) (meters 17) 1.0) (sp-flt spt-y (meters -6)) @@ -2582,8 +2457,7 @@ ) (defpart 1107 - :init-specs - ((sp-flt spt-num 2.0) + :init-specs ((sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -13) (meters 17) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -19) (meters 23) 1.0) @@ -2603,15 +2477,13 @@ (defpartgroup group-firecanyon-heat-50 :id 255 :bounds (static-bspherem 0 0 0 14) - :parts - ((sp-item 1109 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1109 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1110 :fade-after (meters 150) :falloff-to (meters 150)) ) ) (defpart 1110 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -6) (meters 1) 1.0) (sp-flt spt-y (meters -6)) @@ -2637,8 +2509,7 @@ ) (defpart 1109 - :init-specs - ((sp-flt spt-num 0.7) + :init-specs ((sp-flt spt-num 0.7) (sp-rnd-flt spt-x (meters -6) (meters 1) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters 0) (meters 18) 1.0) @@ -2658,15 +2529,13 @@ (defpartgroup group-firecanyon-heat-52 :id 256 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1111 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1111 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1112 :fade-after (meters 150) :falloff-to (meters 150)) ) ) (defpart 1112 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -12) (meters 18) 1.0) (sp-flt spt-y (meters -6)) @@ -2692,8 +2561,7 @@ ) (defpart 1111 - :init-specs - ((sp-flt spt-num 0.75) + :init-specs ((sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters -12) (meters 18) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -12) (meters 16) 1.0) @@ -2713,15 +2581,13 @@ (defpartgroup group-firecanyon-heat-53 :id 257 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1113 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1113 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1114 :fade-after (meters 150) :falloff-to (meters 150)) ) ) (defpart 1114 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -10) (meters 18) 1.0) (sp-flt spt-y (meters -6)) @@ -2747,8 +2613,7 @@ ) (defpart 1113 - :init-specs - ((sp-flt spt-num 0.75) + :init-specs ((sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters -10) (meters 18) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -3) (meters 16) 1.0) @@ -2768,15 +2633,13 @@ (defpartgroup group-firecanyon-heat-54 :id 258 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1115 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1115 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1116 :fade-after (meters 150) :falloff-to (meters 150)) ) ) (defpart 1116 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.3) (sp-rnd-flt spt-x (meters -10) (meters 13) 1.0) (sp-flt spt-y (meters -6)) @@ -2802,8 +2665,7 @@ ) (defpart 1115 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -10) (meters 13) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -18) (meters 20) 1.0) @@ -2823,15 +2685,13 @@ (defpartgroup group-firecanyon-heat-55 :id 259 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1117 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1117 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1118 :fade-after (meters 150) :falloff-to (meters 150)) ) ) (defpart 1118 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.35) (sp-rnd-flt spt-x (meters -3) (meters 10) 1.0) (sp-flt spt-y (meters -6)) @@ -2857,8 +2717,7 @@ ) (defpart 1117 - :init-specs - ((sp-flt spt-num 1.9) + :init-specs ((sp-flt spt-num 1.9) (sp-rnd-flt spt-x (meters -3) (meters 10) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -3) (meters 32) 1.0) @@ -2878,15 +2737,13 @@ (defpartgroup group-firecanyon-heat-56 :id 260 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1119 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1119 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1120 :fade-after (meters 150) :falloff-to (meters 150)) ) ) (defpart 1120 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -7) (meters 16) 1.0) (sp-flt spt-y (meters -6)) @@ -2912,8 +2769,7 @@ ) (defpart 1119 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -7) (meters 16) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -8) (meters 15) 1.0) @@ -2933,15 +2789,13 @@ (defpartgroup group-firecanyon-heat-57 :id 261 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1121 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1121 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1122 :fade-after (meters 150) :falloff-to (meters 150)) ) ) (defpart 1122 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -6) (meters 8) 1.0) (sp-flt spt-y (meters -6)) @@ -2967,8 +2821,7 @@ ) (defpart 1121 - :init-specs - ((sp-flt spt-num 0.75) + :init-specs ((sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters -6) (meters 8) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -2) (meters 20) 1.0) @@ -2988,15 +2841,13 @@ (defpartgroup group-firecanyon-heat-58 :id 262 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1123 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1123 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1124 :fade-after (meters 150) :falloff-to (meters 150)) ) ) (defpart 1124 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -1) (meters 8) 1.0) (sp-flt spt-y (meters -6)) @@ -3022,8 +2873,7 @@ ) (defpart 1123 - :init-specs - ((sp-flt spt-num 0.75) + :init-specs ((sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters -1) (meters 8) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -18) (meters 20) 1.0) @@ -3043,15 +2893,13 @@ (defpartgroup group-firecanyon-heat-59 :id 263 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1125 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1125 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1126 :fade-after (meters 150) :falloff-to (meters 150)) ) ) (defpart 1126 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters -6)) @@ -3077,8 +2925,7 @@ ) (defpart 1125 - :init-specs - ((sp-flt spt-num 0.75) + :init-specs ((sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -4) (meters 20) 1.0) diff --git a/goal_src/levels/flut_common/flut-part.gc b/goal_src/levels/flut_common/flut-part.gc index ca09a60f5b..05fd4b2723 100644 --- a/goal_src/levels/flut_common/flut-part.gc +++ b/goal_src/levels/flut_common/flut-part.gc @@ -10,16 +10,14 @@ (defpartgroup group-flut-trans-pad :id 120 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 746 :fade-after (meters 160)) + :parts ((sp-item 746 :fade-after (meters 160)) (sp-item 747 :fade-after (meters 160)) (sp-item 748 :fade-after (meters 60) :falloff-to (meters 60) :flags (is-3d)) ) ) (defpart 746 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 7)) (sp-rnd-flt spt-scale-x (meters 14) (meters 1) 1.0) @@ -34,8 +32,7 @@ ) (defpart 747 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 4)) (sp-rnd-flt spt-scale-x (meters 7) (meters 1) 1.0) @@ -51,8 +48,7 @@ ) (defpart 748 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0.75) (meters 0.1) 1.0) (sp-flt spt-scale-x (meters 0)) @@ -79,13 +75,11 @@ :duration 10 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 749) (sp-item 750)) + :parts ((sp-item 749) (sp-item 750)) ) (defpart 749 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 24.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -113,8 +107,7 @@ ) (defpart 750 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) diff --git a/goal_src/levels/flut_common/flutflut.gc b/goal_src/levels/flut_common/flutflut.gc index e10b15349f..e36b0d8c45 100644 --- a/goal_src/levels/flut_common/flutflut.gc +++ b/goal_src/levels/flut_common/flutflut.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/flut-saddle-ag.gc") + (if (not (nmember "flutp" *kernel-packages*)) (set! *kernel-packages* (cons "flutp" *kernel-packages*)) ) @@ -46,28 +48,22 @@ (the-as flutflut ((method-of-type process-drawable relocate) obj arg0)) ) -(define - *flutflut-shadow-control* +(define *flutflut-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #xa)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 614400.0) + :flags (shadow-flags disable-fade shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) :bot-plane (new 'static 'plane :y 1.0 :w 81920.0) :top-plane (new 'static 'plane :y 1.0 :w -2867.2) ) ) ) -(defskelgroup *flutflut-sg* flut-saddle - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3.5) - :longest-edge (meters 0) - :shadow 2 - :sort 1 - ) +(defskelgroup *flutflut-sg* flut-saddle flut-saddle-lod0-jg -1 + ((flut-saddle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + :shadow flut-saddle-shadow-mg + :sort 1 + ) (defbehavior flutflut-effect flutflut () (spawn (-> self part) (-> self root-override trans)) @@ -78,8 +74,7 @@ (defstate wait-for-start (flutflut) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -101,16 +96,14 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (set! (-> self root-override root-prim prim-core action) (collide-action)) (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) 0 (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((v1-0 (-> self condition))) (cond ((or (zero? v1-0) (= v1-0 1)) @@ -183,25 +176,19 @@ (defstate idle (flutflut) :virtual #t - :event - (-> (method-of-type flutflut wait-for-start) event) - :enter - (behavior () + :event (-> (method-of-type flutflut wait-for-start) event) + :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (the-as curve-control (-> self path-target))) (none) ) - :exit - (-> (method-of-type flutflut wait-for-start) exit) - :code - (behavior () + :exit (-> (method-of-type flutflut wait-for-start) exit) + :code (behavior () (ja-channel-set! 1) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) (set! (-> self root-override root-prim prim-core action) (collide-action solid ca-11)) (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) - (while #t + (loop (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-14))) (go-virtual wait-for-return) ) @@ -245,27 +232,20 @@ ) (flutflut-effect) (suspend) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 param 0) 1.0) - (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior flutflut) ja-post) + :post (the-as (function none :behavior flutflut) ja-post) ) (defstate pickup (flutflut) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('draw) (ja-channel-set! 1) - (let ((v1-3 (-> self skel root-channel 0))) - (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) (set! (-> self root-override root-prim prim-core action) (collide-action solid ca-11)) (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) (transform-post) @@ -278,13 +258,11 @@ ) ) ) - :enter - (behavior ((arg0 (state flutflut))) + :enter (behavior ((arg0 (state flutflut))) ((-> arg0 enter)) (none) ) - :code - (behavior ((arg0 (state flutflut))) + :code (behavior ((arg0 (state flutflut))) (ja-channel-set! 0) (ja-post) (while (zero? (ja-group-size)) @@ -313,8 +291,7 @@ (defstate wait-for-return (flutflut) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (or (= arg2 'touch) (= arg2 'attack)) (send-event *target* 'end-mode)) (go-virtual pickup (method-of-object self idle)) ) @@ -325,17 +302,15 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (the-as curve-control (-> self path-flut))) (none) ) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (ja-post) - (while #t + (loop (if (not (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-14)))) (go-virtual idle) ) @@ -398,19 +373,8 @@ ) ) ) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "zoom-teleport") - :volume #x400 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> obj root-override trans)) ) (go (method-of-object obj wait-for-start)) (none) diff --git a/goal_src/levels/flut_common/target-flut.gc b/goal_src/levels/flut_common/target-flut.gc index cf68718658..1eee58adfc 100644 --- a/goal_src/levels/flut_common/target-flut.gc +++ b/goal_src/levels/flut_common/target-flut.gc @@ -8,12 +8,12 @@ ;; DECOMP BEGINS (deftype flut-info (basic) - ((entity basic :offset-assert 4) - (flut-trans vector :inline :offset-assert 16) - (flut-quat vector :inline :offset-assert 32) - (flut-scale vector :inline :offset-assert 48) - (stick-lock basic :offset-assert 64) - (flap-sound-id sound-id :offset-assert 68) + ((entity entity-actor :offset-assert 4) + (flut-trans vector :inline :offset-assert 16) + (flut-quat vector :inline :offset-assert 32) + (flut-scale vector :inline :offset-assert 48) + (stick-lock basic :offset-assert 64) + (flap-sound-id sound-id :offset-assert 68) ) :method-count-assert 9 :size-assert #x48 @@ -69,7 +69,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :flags #x8 + :flags (surface-flags no-turn-around) ) ) @@ -98,7 +98,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x800 + :flags (surface-flags jump) ) ) @@ -127,7 +127,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x800 + :flags (surface-flags jump) ) ) @@ -151,7 +151,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags #x1018 + :flags (surface-flags no-turn-around no-rotate-toward-transv attacking) ) ) @@ -176,7 +176,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags #x1800 + :flags (surface-flags jump attacking) ) ) @@ -199,57 +199,29 @@ ) (defbehavior target-flut-falling-anim-trans target () - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-2 (ja-group))) (b! (or (= v1-2 (-> self draw art-group data 144)) (= v1-2 (-> self draw art-group data 145))) cfg-7 - :delay - (empty-form) + :delay (empty-form) ) ) - (ja-channel-push! 1 99) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) - ) + (ja-channel-push! 1 (seconds 0.33)) + (ja :group! (-> self draw art-group data 144)) (b! #t cfg-23 :delay (nop!)) (label cfg-7) (cond - ((and (logtest? (-> self control status) 1) (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 145) - ) - ) + ((and (logtest? (-> self control status) (cshape-moving-flags onsurf)) + (not (ja-group? (-> self draw art-group data 145))) ) - (ja-channel-push! 1 6) - (let ((v1-21 (-> self skel root-channel 0))) - (set! (-> v1-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 145))) - ) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! (-> self draw art-group data 145)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 144) - ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) 1.0) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-loop!) - ) + ((ja-group? (-> self draw art-group data 144)) + (ja :num! (loop!)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 145) - ) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 145)) + (ja :num! (seek!)) ) ) (label cfg-23) @@ -259,105 +231,44 @@ (defbehavior target-flut-hit-ground-anim target () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 144) - ) + ((ja-group? (-> self draw art-group data 144)) (if (!= (-> self skel root-channel 0) (-> self skel channel)) - (ja-channel-push! 2 15) + (ja-channel-push! 2 (seconds 0.05)) (ja-channel-set! 2) ) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 145)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((gp-1 (-> self skel root-channel 1))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 148)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 145) :num! min) + (ja :chan 1 :group! (-> self draw art-group data 148) :num! min) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((a0-12 (-> self skel root-channel 1))) - (set! (-> a0-12 param 0) 0.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (seek!)) + (ja :chan 1 :num! (chan 0)) ) #f ) - ((let ((v1-33 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + ((let ((v1-33 (ja-group))) (or (= v1-33 (-> self draw art-group data 143)) (= v1-33 (-> self draw art-group data 145))) ) #f ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 149) - ) + ((ja-group? (-> self draw art-group data 149)) (ja-channel-set! 1) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> self draw art-group data 145))) - (set! (-> a0-26 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 145)) data 0 length) -1)) - ) - (set! (-> a0-26 param 1) 1.0) - (set! (-> a0-26 frame-num) 0.0) - (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> self draw art-group data 145)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 145) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1))) - (set! (-> a0-27 param 1) 1.0) - (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) - ((let ((v1-68 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + ((let ((v1-68 (ja-group))) (or (= v1-68 (-> self draw art-group data 152)) (= v1-68 (-> self draw art-group data 153))) ) (ja-channel-set! 1) - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> self draw art-group data 154))) - (set! (-> a0-37 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 154)) data 0 length) -1)) - ) - (set! (-> a0-37 param 1) 1.0) - (set! (-> a0-37 frame-num) 0.0) - (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> self draw art-group data 154)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 154) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-xz-vel) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) (the float (+ (-> a0-40 frame-group data 0 length) -1))) - (set! (-> a0-40 param 1) 1.0) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) @@ -380,15 +291,15 @@ (the-as attack-info (-> arg3 param 1)) arg0 (the-as process (-> arg3 param 0)) - (the-as (state handle attack-info target) target-flut-hit) + target-flut-hit ) ) (('shove) (when (!= (-> self next-state name) 'target-hit) (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 104) - (when (zero? (logand (-> self attack-info-rec mask) 8)) + (when (zero? (logand (-> self attack-info-rec mask) (attack-mask attacker))) (set! (-> self attack-info-rec attacker) (process->handle arg0)) - (logior! (-> self attack-info-rec mask) 8) + (logior! (-> self attack-info-rec mask) (attack-mask attacker)) ) (go target-flut-hit 'shove (-> self attack-info-rec)) ) @@ -401,30 +312,23 @@ (('swim) (let* ((gp-1 (-> self control last-known-safe-ground)) (s3-1 (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans))) - (f30-1 (fmax (-> (new 'static 'array float 1 8192.0) 0) (fmin 40960.0 (vector-xz-length s3-1)))) + (f30-1 (fmax 8192.0 (fmin 40960.0 (vector-xz-length s3-1)))) ) (vector-xz-normalize! s3-1 f30-1) - (let ((s5-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> s5-0 from) self) - (set! (-> s5-0 num-params) 2) - (set! (-> s5-0 message) 'shove) - (set! (-> s5-0 param 0) (the-as uint #f)) - (let ((s4-0 (new 'static 'attack-info :mask #x882))) - (set! (-> s4-0 vector quad) (-> s3-1 quad)) - (set! (-> s4-0 shove-up) (+ (lerp-scale - (the-as float 4096.0) - (-> (new 'static 'array float 1 16384.0) 0) - f30-1 - (the-as float 4096.0) - (the-as float 40960.0) - ) - (fmax 0.0 (- (-> gp-1 y) (-> self control trans y))) - ) + (send-event + self + 'shove + #f + (static-attack-info + ((vector s3-1) + (shove-up + (+ (lerp-scale (the-as float 4096.0) (the-as float 16384.0) f30-1 (the-as float 4096.0) (the-as float 40960.0)) + (fmax 0.0 (- (-> gp-1 y) (-> self control trans y))) ) - (set! (-> s4-0 angle) 'up) - (set! (-> s5-0 param 1) (the-as uint s4-0)) + ) + (angle 'up) + ) ) - (send-event-function self s5-0) ) ) ) @@ -470,7 +374,7 @@ (the-as attack-info (-> arg3 param 1)) arg0 (the-as process (-> arg3 param 0)) - (the-as (state handle attack-info target) target-flut-hit) + target-flut-hit ) ) (else @@ -480,10 +384,8 @@ ) (defstate target-flut-start (target) - :event - target-flut-standard-event-handler - :exit - (behavior () + :event target-flut-standard-event-handler + :exit (behavior () (when (not (or (= (-> self next-state name) 'target-flut-stance) (= (-> self next-state name) 'target-flut-walk) (= (-> self next-state name) 'target-flut-jump) @@ -510,23 +412,22 @@ ) (logclear! (-> self control root-prim prim-core action) (collide-action ca-14)) (set! (-> self control unknown-surface00) *walk-mods*) - (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) - (target-collide-set! 'normal (-> (new 'static 'array float 1 0.0) 0)) + (target-collide-set! 'normal (the-as float 0.0)) (set! (-> self control reaction) target-collision-reaction) (set! (-> self control unknown-vector12 quad) (the-as uint128 0)) - (clear-pending-settings-from-process *setting-control* self 'sound-flava) + (remove-setting! 'sound-flava) (target-exit) ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (target-exit) (set! *display-profile* #f) (set! *display-entity-errors* #f) - (set-setting! *setting-control* self 'sound-flava #f (the-as float 30.0) 2) + (set-setting! 'sound-flava #f 30.0 (music-flava flutflut)) (if (zero? (-> self flut)) (set! (-> self flut) (new 'process 'flut-info)) ) @@ -538,31 +439,15 @@ (set! (-> self flut entity) (-> v1-11 entity)) ) ) - (target-collide-set! 'flut (-> (new 'static 'array float 1 0.0) 0)) + (target-collide-set! 'flut (the-as float 0.0)) (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self control unknown-float01) 0.0) (logior! (-> self control root-prim prim-core action) (collide-action ca-14)) (let ((s5-0 (-> self entity))) - (set! (-> self entity) (the-as entity (-> self flut entity))) - (let ((s4-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self manipy) - (the-as (pointer manipy) (when s4-0 - (let ((t9-6 (method-of-type manipy activate))) - (t9-6 (the-as manipy s4-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-0 - manipy-init - (-> self control trans) - (-> self entity) - *flutflut-sg* - 'collide-shape-moving - ) - (-> s4-0 ppointer) - ) - ) - ) - ) + (set! (-> self entity) (-> self flut entity)) + (set! (-> self manipy) + (manipy-spawn (-> self control trans) (-> self entity) *flutflut-sg* 'collide-shape-moving :to self) + ) (set! (-> self entity) s5-0) ) (when (-> self manipy) @@ -598,12 +483,7 @@ ) ) (send-event (ppointer->process (-> self manipy)) 'anim-mode 'loop) - (send-event - (ppointer->process (-> self manipy)) - 'art-joint-anim - "flut-get-on" - (-> (new 'static 'array float 1 0.0) 0) - ) + (send-event (ppointer->process (-> self manipy)) 'art-joint-anim "flut-get-on" 0.0) (send-event (ppointer->process (-> self manipy)) 'blend-shape #t) (send-event (ppointer->process (-> self manipy)) @@ -625,22 +505,17 @@ (go target-flut-get-on arg0) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-flut-stance (target) - :event - target-flut-standard-event-handler - :enter - (behavior () + :event target-flut-standard-event-handler + :enter (behavior () (set! (-> self control unknown-surface00) *flut-walk-mods*) (none) ) - :exit - (-> target-flut-start exit) - :trans - (behavior () + :exit (-> target-flut-start exit) + :trans (behavior () (if (move-legs?) (go target-flut-walk) ) @@ -658,14 +533,10 @@ (if (can-hands? #t) (go target-flut-running-attack) ) - (if (and (zero? (logand (-> self control status) 1)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-37 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-37 (ja-group))) (or (not (or (= v1-37 (-> self draw art-group data 59)) (= v1-37 (-> self draw art-group data 60)) (= v1-37 (-> self draw art-group data 61)) @@ -680,126 +551,66 @@ ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 22)) - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-2 (ja-group))) (cond ((or (= v1-2 (-> self draw art-group data 141)) (= v1-2 (-> self draw art-group data 161))) (set! gp-0 60) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 155) - ) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 155)) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 158) - ) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 159))) - (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 159)) data 0 length) -1)) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 159)) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 158)) + (ja-no-eval :group! (-> self draw art-group data 159) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 150) - ) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 151))) - (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 151)) data 0 length) -1)) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 151)) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 150)) + (ja-no-eval :group! (-> self draw art-group data 151) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) ) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 140) - ) - ) - (ja-channel-push! 1 gp-0) + (if (not (ja-group? (-> self draw art-group data 140))) + (ja-channel-push! 1 (the-as time-frame gp-0)) ) ) - (let ((v1-91 (-> self skel root-channel 0))) - (set! (-> v1-91 frame-group) (the-as art-joint-anim (-> self draw art-group data 140))) - ) - (while #t + (ja :group! (-> self draw art-group data 140)) + (loop (suspend) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 param 0) 1.0) - (joint-control-channel-group-eval! a0-35 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - target-flut-post + :post target-flut-post ) (defstate target-flut-walk (target) - :event - target-flut-standard-event-handler - :enter - (behavior () + :event target-flut-standard-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *flut-walk-mods*) (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-surface00 turnv))) (set! (-> self control unknown-int21) (the-as int (-> self control unknown-surface00 target-speed))) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control unknown-surface00 turnv) (the-as float (-> self control unknown-uint20))) (set! (-> self control unknown-surface00 target-speed) (the-as float (-> self control unknown-uint30))) ((-> target-flut-start exit)) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (move-legs?)) (go target-flut-stance) ) @@ -817,14 +628,10 @@ (if (can-hands? #t) (go target-flut-running-attack) ) - (if (and (zero? (logand (-> self control status) 1)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-37 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-37 (ja-group))) (or (not (or (= v1-37 (-> self draw art-group data 59)) (= v1-37 (-> self draw art-group data 60)) (= v1-37 (-> self draw art-group data 61)) @@ -842,117 +649,76 @@ (the-as float (-> self control unknown-uint20)) (* 4.0 (the-as float (-> self control unknown-uint20))) f30-1 - (-> (new 'static 'array float 1 8192.0) 0) + (the-as float 8192.0) (the-as float 21845.334) ) ) - (if (and (= (-> self control surf name) '*tar-surface*) (< (-> (new 'static 'array float 1 8192.0) 0) f30-1)) - (set! (-> self control unknown-surface00 target-speed) (seek - (-> self control unknown-surface00 target-speed) - (the-as float 4096.0) - (* 245760.0 (-> *display* seconds-per-frame)) - ) - ) - (set! (-> self control unknown-surface00 target-speed) (seek - (-> self control unknown-surface00 target-speed) - (the-as float (-> self control unknown-uint30)) - (* 81920.0 (-> *display* seconds-per-frame)) - ) - ) + (if (and (= (-> self control surf name) '*tar-surface*) (< 8192.0 f30-1)) + (seek! + (-> self control unknown-surface00 target-speed) + (the-as float 4096.0) + (* 245760.0 (-> *display* seconds-per-frame)) + ) + (seek! + (-> self control unknown-surface00 target-speed) + (the-as float (-> self control unknown-uint30)) + (* 81920.0 (-> *display* seconds-per-frame)) + ) ) ) (none) ) - :code - (behavior () + :code (behavior () (let ((f28-0 0.0) (f30-0 0.0) ) (let ((gp-0 22)) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 140) - ) + ((ja-group? (-> self draw art-group data 140)) (set! gp-0 60) ) - ((let ((v1-9 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + ((let ((v1-9 (ja-group))) (or (= v1-9 (-> self draw art-group data 143)) (= v1-9 (-> self draw art-group data 144)) (= v1-9 (-> self draw art-group data 152)) (= v1-9 (-> self draw art-group data 154)) ) ) - (ja-channel-push! 1 24) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 161))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 161)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 161)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 161) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (set! f30-0 (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 161) - ) + ((ja-group? (-> self draw art-group data 161)) (ja-channel-set! 2) 1.0 ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 141) - ) + ((ja-group? (-> self draw art-group data 141)) (set! f28-0 (ja-frame-num 0)) (-> self skel root-channel 1 frame-interp) ) (else - (ja-channel-push! 2 gp-0) + (ja-channel-push! 2 (the-as time-frame gp-0)) f30-0 ) ) ) ) - (let ((a0-32 (-> self skel root-channel 0))) - (set! (-> a0-32 dist) 49152.0) - (set! (-> a0-32 frame-group) (the-as art-joint-anim (-> self draw art-group data 141))) - (set! (-> a0-32 param 0) 1.0) - (set! (-> a0-32 frame-num) f28-0) - (joint-control-channel-group! a0-32 (the-as art-joint-anim (-> self draw art-group data 141)) num-func-loop!) - ) - (let ((gp-1 (-> self skel root-channel 1))) - (set! (-> gp-1 frame-interp) f30-0) - (set! (-> gp-1 dist) 40960.0) - (joint-control-channel-group! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 142)) - num-func-identity - ) - (set! (-> gp-1 frame-num) (* 0.5 f28-0)) - ) - (while #t + (ja-no-eval :group! (-> self draw art-group data 141) :num! (loop!) :dist 49152.0 :frame-num f28-0) + (ja-no-eval :chan 1 + :group! (-> self draw art-group data 142) + :num! (identity (* 0.5 f28-0)) + :frame-interp f30-0 + :dist 40960.0 + ) + (loop (suspend) (let ((f0-13 (lerp-scale - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as float 1.0) (-> self control unknown-float01) (the-as float 49152.0) @@ -963,21 +729,15 @@ (set! f30-0 (seek f30-0 f0-13 (* 4.0 (-> *display* seconds-per-frame)))) ) (set! (-> self skel root-channel 1 frame-interp) f30-0) - (let* ((f0-16 (dummy-9 (-> self skel))) + (let* ((f0-16 (current-cycle-distance (-> self skel))) (f0-18 (/ (* 58.0 (-> self control unknown-float01)) (* 60.0 f0-16))) ) (if (= (-> self control surf name) '*tar-surface*) (set! f0-18 (* 0.4 (-> self control unknown-float12))) ) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) f0-18) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-loop!) - ) - ) - (let ((gp-2 (-> self skel root-channel 1))) - (set! (-> gp-2 num-func) num-func-identity) - (set! (-> gp-2 frame-num) (* 0.5 (ja-frame-num 0))) + (ja :num! (loop! f0-18)) ) + (ja :chan 1 :num-func num-func-identity :frame-num (* 0.5 (ja-frame-num 0))) (let ((f0-22 (ja-aframe-num 0))) (cond ((and (>= (-> self skel effect last-frame-num) 20.0) (< f0-22 20.0)) @@ -992,13 +752,11 @@ ) (none) ) - :post - target-flut-post + :post target-flut-post ) (defstate target-flut-jump (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (and (= arg2 'touched) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) @@ -1031,12 +789,11 @@ ) ) ) - :enter - (behavior ((arg0 float) (arg1 float)) + :enter (behavior ((arg0 float) (arg1 float)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 -762 0 1 #t) + (sound-play "jump" :pitch -0.5) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flut-jump-mods*) (set! (-> self control unknown-float123) (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float01))))) @@ -1046,27 +803,25 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (target-exit) ((-> target-flut-start exit)) (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self control unknown-float123) (fmax (-> self control unknown-float123) (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) ) ) - (if (logtest? (-> self control status) 1) + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-flut-hit-ground) ) (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 40960.0) - (and (zero? (logand (-> self water flags) 512)) - (zero? (logand (-> self state-flags) 2048)) + (and (zero? (logand (-> self water flags) (water-flags wt09))) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) (< 4096.0 (target-height-above-ground)) ) ) @@ -1078,8 +833,9 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) + (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) @@ -1091,58 +847,34 @@ ) #t ) - (logior! (-> self control status) 1) + (logior! (-> self control status) (cshape-moving-flags onsurf)) enter-state 'stuck (go target-flut-hit-ground) ) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) - (set! (-> self control unknown-float122) - (seek - (-> self control unknown-float122) - (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) - ) - ) + (seek! + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (ja-channel-push! 2 36) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 143)) - num-func-identity + :code (behavior ((arg0 float) (arg1 float)) + (ja-channel-push! 2 (seconds 0.12)) + (ja :group! (-> self draw art-group data 143) :num! min) + (ja :chan 1 + :group! (-> self draw art-group data 146) + :num! (chan 0) + :frame-interp (-> self control unknown-float122) ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-3 (-> self skel root-channel 1))) - (set! (-> a0-3 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 146))) - (set! (-> a0-3 param 0) 0.0) - (joint-control-channel-group-eval! - a0-3 - (the-as art-joint-anim (-> self draw art-group data 146)) - num-func-chan - ) - ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 143))) - (set! (-> a0-4 param 0) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim (-> self draw art-group data 143)) num-func-+!) - ) - (let ((a0-5 (-> self skel root-channel 1))) - (set! (-> a0-5 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 146))) - (set! (-> a0-5 param 0) 0.0) - (joint-control-channel-group-eval! - a0-5 - (the-as art-joint-anim (-> self draw art-group data 146)) - num-func-chan + (ja :group! (-> self draw art-group data 143) :num! (+!)) + (ja :chan 1 + :group! (-> self draw art-group data 146) + :num! (chan 0) + :frame-interp (-> self control unknown-float122) ) - ) (suspend) (until (ja-done? 0) (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -1163,81 +895,49 @@ ) (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) ) - (let ((a0-12 (-> self skel root-channel 1))) - (set! (-> a0-12 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-12 param 0) 0.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) (suspend) ) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) - (set! (-> a0-14 param 0) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 144)) num-func-loop!) - ) - (let ((a0-15 (-> self skel root-channel 1))) - (set! (-> a0-15 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 147))) - (set! (-> a0-15 param 0) 0.0) - (joint-control-channel-group-eval! - a0-15 - (the-as art-joint-anim (-> self draw art-group data 147)) - num-func-chan + (ja-no-eval :group! (-> self draw art-group data 144) :num! (loop!) :frame-num 0.0) + (ja :chan 1 + :group! (-> self draw art-group data 147) + :num! (chan 0) + :frame-interp (-> self control unknown-float122) ) - ) - (while #t + (loop (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) - (set! (-> a0-16 param 0) 1.0) - (joint-control-channel-group-eval! - a0-16 - (the-as art-joint-anim (-> self draw art-group data 144)) - num-func-loop! + (ja :group! (-> self draw art-group data 144) :num! (loop!)) + (ja :chan 1 + :group! (-> self draw art-group data 147) + :num! (chan 0) + :frame-interp (-> self control unknown-float122) ) - ) - (let ((a0-17 (-> self skel root-channel 1))) - (set! (-> a0-17 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 147))) - (set! (-> a0-17 param 0) 0.0) - (joint-control-channel-group-eval! - a0-17 - (the-as art-joint-anim (-> self draw art-group data 147)) - num-func-chan - ) - ) ) (none) ) - :post - target-flut-post + :post target-flut-post ) (defstate target-flut-double-jump (target) - :event - (-> target-flut-jump event) - :enter - (behavior ((arg0 float) (arg1 float)) + :event (-> target-flut-jump event) + :enter (behavior ((arg0 float) (arg1 float)) (set! (-> self state-time) (-> *display* base-frame-counter)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (set! (-> self control dynam gravity-max) 40960.0) (set! (-> self control dynam gravity-length) 245760.0) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flut-double-jump-mods*) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (target-exit) ((-> target-flut-start exit)) (none) ) - :trans - (behavior () - (if (logtest? (-> self control status) 1) + :trans (behavior () + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-flut-hit-ground) ) (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) @@ -1247,8 +947,9 @@ ) (pad-buttons square) ) - (and (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) + (and (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) @@ -1260,142 +961,85 @@ (if (!= (-> self state-time) (-> *display* base-frame-counter)) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) ) - (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 149) - ) - (sound-play-by-name (static-sound-name "flut-flap") (-> self flut flap-sound-id) 1024 0 0 1 #t) + (if (ja-group? (-> self draw art-group data 149)) + (sound-play "flut-flap" :id (-> self flut flap-sound-id)) ) - (set! (-> self control unknown-float122) - (seek - (-> self control unknown-float122) - (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) - ) - ) + (seek! + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (ja-channel-push! 1 15) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 149))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 149)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 149)) num-func-seek!) - ) + :code (behavior ((arg0 float) (arg1 float)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 149) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 3 (seconds 0.1)) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self control unknown-surface00) *flut-jump-mods*) (dotimes (gp-0 1) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 149))) - (set! (-> s5-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 149)) data 0 length) -1)) - ) - (set! (-> s5-0 param 1) 1.0) - (set! (-> s5-0 frame-num) (ja-aframe (the-as float 14.0) 0)) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 149)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 149) + :num! (seek!) + :frame-num (ja-aframe (the-as float 14.0) 0) + ) (until (ja-done? 0) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 3 (seconds 0.1)) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (while (< (-> (new 'static 'array float 1 8192.0) 0) (target-height-above-ground)) + (while (< 8192.0 (target-height-above-ground)) (suspend) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 3 (seconds 0.1)) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-loop!) - ) - (when (< (ja-aframe-num 0) 14.0) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 num-func) num-func-identity) - (set! (-> gp-1 frame-num) (ja-aframe (the-as float 14.0) 0)) + (ja :num! (loop!)) + (if (< (ja-aframe-num 0) 14.0) + (ja :num-func num-func-identity :frame-num (ja-aframe (the-as float 14.0) 0)) ) + (seek! + (-> self control dynam gravity-max) + (-> self control unknown-dynamics00 gravity-max) + (* 163840.0 (-> *display* seconds-per-frame)) + ) + (seek! + (-> self control dynam gravity-length) + (-> self control unknown-dynamics00 gravity-length) + (* 163840.0 (-> *display* seconds-per-frame)) ) - (set! (-> self control dynam gravity-max) (seek - (-> self control dynam gravity-max) - (-> self control unknown-dynamics00 gravity-max) - (* 163840.0 (-> *display* seconds-per-frame)) - ) - ) - (set! (-> self control dynam gravity-length) (seek - (-> self control dynam gravity-length) - (-> self control unknown-dynamics00 gravity-length) - (* 163840.0 (-> *display* seconds-per-frame)) - ) - ) ) (-> *display* base-frame-counter) - (ja-channel-push! 2 30) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) - (set! (-> a0-19 param 0) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 144)) num-func-loop!) - ) - (let ((gp-2 (-> self skel root-channel 1))) - (set! (-> gp-2 frame-interp) (-> self control unknown-float122)) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 147)) - num-func-identity + (ja-channel-push! 2 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 144) :num! (loop!) :frame-num 0.0) + (ja :chan 1 + :group! (-> self draw art-group data 147) + :num! min + :frame-interp (-> self control unknown-float122) ) - (set! (-> gp-2 frame-num) 0.0) - ) - (while #t + (loop (suspend) - (set! (-> self control dynam gravity-max) (seek - (-> self control dynam gravity-max) - (-> self control unknown-dynamics00 gravity-max) - (* 163840.0 (-> *display* seconds-per-frame)) - ) - ) - (set! (-> self control dynam gravity-length) (seek - (-> self control dynam gravity-length) - (-> self control unknown-dynamics00 gravity-length) - (* 163840.0 (-> *display* seconds-per-frame)) - ) - ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-loop!) + (seek! + (-> self control dynam gravity-max) + (-> self control unknown-dynamics00 gravity-max) + (* 163840.0 (-> *display* seconds-per-frame)) ) - (let ((a0-24 (-> self skel root-channel 1))) - (set! (-> a0-24 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-24 param 0) 0.0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-chan) + (seek! + (-> self control dynam gravity-length) + (-> self control unknown-dynamics00 gravity-length) + (* 163840.0 (-> *display* seconds-per-frame)) ) + (ja :num! (loop! max)) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) ) (none) ) - :post - target-flut-post + :post target-flut-post ) (defstate target-flut-hit-ground (target) - :event - target-flut-standard-event-handler - :enter - (behavior () + :event target-flut-standard-event-handler + :enter (behavior () (target-land-effect) (if (< 40960.0 (-> self control ground-impact-vel)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.2)) @@ -1405,10 +1049,8 @@ (set! (-> self control unknown-surface00) *flut-walk-mods*) (none) ) - :exit - (-> target-flut-start exit) - :trans - (behavior () + :exit (-> target-flut-start exit) + :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) ) @@ -1423,14 +1065,10 @@ (if (move-legs?) (go target-flut-walk) ) - (if (and (zero? (logand (-> self control status) 1)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-34 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-34 (ja-group))) (or (not (or (= v1-34 (-> self draw art-group data 59)) (= v1-34 (-> self draw art-group data 60)) (= v1-34 (-> self draw art-group data 61)) @@ -1445,32 +1083,26 @@ ) (none) ) - :code - (behavior () + :code (behavior () (let ((t9-0 target-flut-hit-ground-anim)) (t9-0) ) (go target-flut-stance) (none) ) - :post - target-flut-post + :post target-flut-post ) (defstate target-flut-falling (target) - :event - (-> target-flut-jump event) - :enter - (behavior ((arg0 symbol)) + :event (-> target-flut-jump event) + :enter (behavior ((arg0 symbol)) (set! (-> self control unknown-surface00) *flut-jump-mods*) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (-> target-flut-start exit) - :trans - (behavior () - (when (or (logtest? (-> self control status) 1) + :exit (-> target-flut-start exit) + :trans (behavior () + (when (or (logtest? (-> self control status) (cshape-moving-flags onsurf)) (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (/ (the-as int (-> *TARGET-bank* stuck-time)) 2) @@ -1481,74 +1113,45 @@ #t ) ) - (logior! (-> self control status) 1) + (logior! (-> self control status) (cshape-moving-flags onsurf)) (go target-flut-hit-ground) ) - (set! (-> self control unknown-float122) - (seek - (-> self control unknown-float122) - (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) - ) - ) + (seek! + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 144) - ) + ((ja-group? (-> self draw art-group data 144)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 149) - ) - (ja-channel-push! 2 60) + ((ja-group? (-> self draw art-group data 149)) + (ja-channel-push! 2 (seconds 0.2)) ) (else - (ja-channel-push! 2 150) + (ja-channel-push! 2 (seconds 0.5)) ) ) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) - (set! (-> a0-11 param 0) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 144)) num-func-loop!) - ) - (let ((gp-0 (-> self skel root-channel 1))) - (set! (-> gp-0 frame-interp) (-> self control unknown-float122)) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 147)) - num-func-identity + (ja-no-eval :group! (-> self draw art-group data 144) :num! (loop!) :frame-num 0.0) + (ja :chan 1 + :group! (-> self draw art-group data 147) + :num! min + :frame-interp (-> self control unknown-float122) ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (loop (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((a0-14 (-> self skel root-channel 1))) - (set! (-> a0-14 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-14 param 0) 0.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (loop! max)) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) ) (none) ) - :post - target-flut-post + :post target-flut-post ) (defstate target-flut-running-attack (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touched) (cond @@ -1609,8 +1212,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-uint20) (the-as uint 0)) (set! (-> self control unknown-int21) 0) @@ -1631,33 +1233,25 @@ (set! (-> gp-0 y) 0.0) (vector-normalize! gp-0 (+ 81920.0 (-> *TARGET-bank* yellow-projectile-speed))) (vector+! gp-0 gp-0 (-> self control transv)) - (let ((s4-0 (get-process *default-dead-pool* projectile-yellow #x4000))) - (when s4-0 - (let ((t9-6 (method-of-type projectile-yellow activate))) - (t9-6 (the-as projectile-yellow s4-0) self 'projectile-yellow (the-as pointer #x70004000)) + (process-spawn + projectile-yellow + :init projectile-init-by-other + (-> self entity) + s5-0 + gp-0 + (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + 281 + 265 ) - (run-now-in-process - s4-0 - projectile-init-by-other - (-> self entity) - s5-0 - gp-0 - (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) - 281 - 265 - ) - #f - ) - (-> s4-0 ppointer) - ) + #f + :to self ) ) (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) ) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> *run-attack-mods* turnv) 0.0) @@ -1666,11 +1260,12 @@ (target-exit) (none) ) - :trans - (behavior () + :trans (behavior () (when (!= (-> self state-time) (-> *display* base-frame-counter)) (if (and (or (smack-surface? #t) - (and (>= (-> self control unknown-float63) 0.7) (zero? (logand (-> self control status) 32))) + (and (>= (-> self control unknown-float63) 0.7) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + ) ) (begin (set! (-> self control unknown-int21) (the-as int (-> *display* base-frame-counter))) @@ -1700,14 +1295,9 @@ ) (!= (-> self control unknown-uint31) 1) ) - (target-shoved - (-> (new 'static 'array float 1 8192.0) 0) - (-> *TARGET-bank* smack-surface-height) - (the-as process #f) - target-flut-hit - ) + (target-shoved (meters 2.0) (-> *TARGET-bank* smack-surface-height) (the-as process #f) target-flut-hit) ) - (if (and (logtest? (-> self water flags) 512) + (if (and (logtest? (-> self water flags) (water-flags wt09)) (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) ) (dummy-13 @@ -1721,18 +1311,10 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 6) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 150)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.02)) + (sound-play "flut-hit") + (ja :group! (-> self draw art-group data 150) :num! min) (set! (-> self control dynam gravity-max) 368640.0) (set! (-> self control dynam gravity-length) 368640.0) (let ((f28-0 0.0) @@ -1744,24 +1326,19 @@ ) ) (until (or (ja-done? 0) (< f30-0 0.05)) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (when (not (ja-min? 0)) (cond ((and (>= (ja-aframe-num 0) 20.0) - (and (and (zero? (logand (-> self control status) 1)) + (and (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-39 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (not - (or (= v1-39 (-> self draw art-group data 59)) - (= v1-39 (-> self draw art-group data 60)) - (= v1-39 (-> self draw art-group data 61)) - ) - ) + (let ((v1-39 (ja-group))) + (or (not (or (= v1-39 (-> self draw art-group data 59)) + (= v1-39 (-> self draw art-group data 60)) + (= v1-39 (-> self draw art-group data 61)) + ) + ) (< 4096.0 (target-height-above-ground)) ) ) @@ -1778,7 +1355,7 @@ (the-as uint 12) ) ) - (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + (set-forward-vel (the-as float 0.0)) (set! f30-0 0.0) ) ((ja-done? 0) @@ -1798,11 +1375,7 @@ (vector-matrix*! (-> self control unknown-vector120) gp-2 (-> self control unknown-matrix01)) ) (suspend) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1))) - (set! (-> a0-36 param 1) (-> self control unknown-surface01 align-speed)) - (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self control unknown-surface01 align-speed))) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (set! (-> *flut-run-attack-mods* turnvv) 0.0) ) @@ -1810,14 +1383,10 @@ (set! f30-0 (* f30-0 (the-as float (fmin 1.0 (the-as float (-> self control unknown-float140)))))) ) ) - (if (and (zero? (logand (-> self control status) 1)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-105 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-105 (ja-group))) (or (not (or (= v1-105 (-> self draw art-group data 59)) (= v1-105 (-> self draw art-group data 60)) (= v1-105 (-> self draw art-group data 61)) @@ -1832,39 +1401,25 @@ (when (!= f30-0 0.0) (set! (-> self trans-hook) (-> target-flut-hit-ground trans)) (if (not (ja-done? 0)) - (ja-channel-push! 1 15) + (ja-channel-push! 1 (seconds 0.05)) ) - (let ((a0-59 (-> self skel root-channel 0))) - (set! (-> a0-59 frame-group) (the-as art-joint-anim (-> self draw art-group data 151))) - (set! (-> a0-59 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 151)) data 0 length) -1)) - ) - (set! (-> a0-59 param 1) 1.0) - (set! (-> a0-59 frame-num) 0.0) - (joint-control-channel-group! a0-59 (the-as art-joint-anim (-> self draw art-group data 151)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 151) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) f30-0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-xz-vel) (the-as float 1.0) (the-as float 1.0) f30-0) (suspend) - (let ((a0-62 (-> self skel root-channel 0))) - (set! (-> a0-62 param 0) (the float (+ (-> a0-62 frame-group data 0 length) -1))) - (set! (-> a0-62 param 1) 1.0) - (joint-control-channel-group-eval! a0-62 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go target-flut-stance) (none) ) - :post - target-flut-post + :post target-flut-post ) (defstate target-flut-air-attack (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (= arg2 'touched) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) @@ -1889,11 +1444,10 @@ ) ) ) - :enter - (behavior ((arg0 float)) + :enter (behavior ((arg0 float)) (set-forward-vel arg0) (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flut-air-attack-mods*) (target-start-attack) (target-danger-set! 'flut-attack #f) @@ -1915,16 +1469,14 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (target-danger-set! 'harmless #f) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) (none) ) - :trans - (behavior () + :trans (behavior () (let ((s5-0 (new-stack-vector0))) (vector-z-quaternion! s5-0 (-> self control unknown-quaternion00)) (let ((gp-0 (new-stack-vector0)) @@ -1946,8 +1498,8 @@ ) ) ) - (when (logtest? (-> self control status) 1) - (logior! (-> self control status) 1) + (when (logtest? (-> self control status) (cshape-moving-flags onsurf)) + (logior! (-> self control status) (cshape-moving-flags onsurf)) (remove-exit) (go target-flut-air-attack-hit-ground) ) @@ -1958,174 +1510,123 @@ ) #t ) - (logior! (-> self control status) 1) + (logior! (-> self control status) (cshape-moving-flags onsurf)) (go target-flut-hit-ground) ) (none) ) - :code - (behavior ((arg0 float)) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 -762 0 1 #t) - (ja-channel-push! 1 15) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 152))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 8.0) 0)) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) 0.0) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 152)) num-func-seek!) - ) + :code (behavior ((arg0 float)) + (sound-play "flut-hit" :pitch -0.5) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 152) + :num! (seek! (ja-aframe (the-as float 8.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 6 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) - (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe (the-as float 8.0) 0)) - (set! (-> gp-2 param 1) 1.0) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) + (compute-alignment! (-> self align)) + (align! + (-> self align) + (align-opts adjust-y-vel adjust-xz-vel) + (the-as float 1.0) + (the-as float 1.0) + (the-as float 1.0) ) + (suspend) + (ja :num! (seek! (ja-aframe (the-as float 8.0) 0))) ) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 152))) - (set! (-> gp-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 152)) data 0 length) -1)) - ) - (set! (-> gp-3 param 1) 1.0) - (set! (-> gp-3 frame-num) (ja-aframe (the-as float 8.0) 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 152)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 152) + :num! (seek!) + :frame-num (ja-aframe (the-as float 8.0) 0) + ) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 6 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (compute-alignment! (-> self align)) + (align! + (-> self align) + (align-opts adjust-y-vel adjust-xz-vel) + (the-as float 1.0) + (the-as float 1.0) + (the-as float 1.0) + ) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (let ((gp-4 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-4 - (the-as art-joint-anim (-> self draw art-group data 153)) - num-func-identity - ) - (set! (-> gp-4 frame-num) 0.0) - ) - (while #t + (ja :group! (-> self draw art-group data 153) :num! min) + (loop (suspend) ) (none) ) - :post - target-flut-post + :post target-flut-post ) (defstate target-flut-air-attack-hit-ground (target) - :event - target-flut-standard-event-handler - :enter - (behavior () + :event target-flut-standard-event-handler + :enter (behavior () (target-land-effect) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.4)) (set! (-> self control unknown-dword31) 0) (set! (-> self control unknown-dword33) 0) (set! (-> self control unknown-surface00) *flut-air-attack-mods*) - (sound-play-by-name (static-sound-name "flop-land") (new-sound-id) 1024 -609 0 1 #t) + (sound-play "flop-land" :pitch -0.4) (dummy-10 (-> self skel effect) 'group-flut-attack-strike-ground (ja-frame-num 0) 0) - (let* ((s5-2 (get-process *default-dead-pool* touch-tracker #x4000)) - (gp-2 (when s5-2 - (let ((t9-7 (method-of-type touch-tracker activate))) - (t9-7 (the-as touch-tracker s5-2) self 'touch-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 touch-tracker-init (-> self control trans) 4096.0 30) - (-> s5-2 ppointer) - ) - ) - ) + (let ((gp-2 (process-spawn touch-tracker :init touch-tracker-init (-> self control trans) 4096.0 30 :to self))) (send-event (ppointer->process gp-2) 'event 'attack 'flut-attack) - (send-event - (ppointer->process gp-2) - 'function - (lambda :behavior target - ((arg0 nav-enemy)) - (set! (-> arg0 collide-info root-prim local-sphere w) (seek - (-> arg0 collide-info root-prim local-sphere w) - (the-as float 28672.0) - (* 286720.0 (-> *display* seconds-per-frame)) - ) - ) - (update-transforms! (-> arg0 collide-info)) - (none) - ) - ) + (send-event (ppointer->process gp-2) 'function (lambda :behavior target + ((arg0 nav-enemy)) + (seek! + (-> arg0 collide-info root-prim local-sphere w) + (the-as float 28672.0) + (* 286720.0 (-> *display* seconds-per-frame)) + ) + (update-transforms! (-> arg0 collide-info)) + (none) + ) + ) ) (none) ) - :exit - (-> target-flut-air-attack exit) - :trans - (-> target-flut-hit-ground trans) - :code - (behavior () + :exit (-> target-flut-air-attack exit) + :trans (-> target-flut-hit-ground trans) + :code (behavior () (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 154))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 22.0) 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 154)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 154) + :num! (seek! (ja-aframe (the-as float 22.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-xz-vel) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 22.0) 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 22.0) 0))) ) (target-danger-set! 'harmless #f) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 154))) - (set! (-> gp-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 154)) data 0 length) -1)) - ) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) (ja-aframe (the-as float 22.0) 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 154)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 154) + :num! (seek!) + :frame-num (ja-aframe (the-as float 22.0) 0) + ) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-xz-vel) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go target-flut-stance) (none) ) - :post - target-flut-post + :post target-flut-post ) (defstate target-flut-hit (target) - :event - target-flut-standard-event-handler - :exit - (behavior () + :event target-flut-standard-event-handler + :exit (behavior () (if (!= (-> self next-state name) 'target-flut-death) - (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags being-attacked dying)) ) (target-exit) ((-> target-flut-start exit)) (none) ) - :trans - (behavior () + :trans (behavior () (when (= *cheat-mode* 'debug) (when (and (not *pause-lock*) (cpad-hold? (-> self control unknown-cpad-info00 number) r2)) (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) @@ -2134,8 +1635,7 @@ ) (none) ) - :code - (behavior ((arg0 symbol) (arg1 attack-info)) + :code (behavior ((arg0 symbol) (arg1 attack-info)) (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 (-> self attack-info))) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -2159,7 +1659,7 @@ ) ) (combine! gp-0 arg1) - (when (zero? (logand (-> gp-0 mask) 2)) + (when (zero? (logand (-> gp-0 mask) (attack-mask vector))) (vector-z-quaternion! (-> gp-0 vector) (-> self control unknown-quaternion00)) (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) (set! (-> gp-0 vector y) (-> gp-0 shove-up)) @@ -2180,7 +1680,7 @@ ) ) (when (= arg0 'attack) - (logior! (-> self state-flags) 8) + (logior! (-> self state-flags) (state-flags being-attacked)) (set! (-> self game hit-time) (-> *display* base-frame-counter)) (case (-> gp-0 mode) (('endlessfall) @@ -2240,47 +1740,23 @@ ) ) (target-hit-effect gp-0) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 -1524 0 1 #t) + (sound-play "flut-hit" :pitch -1) ) (set! (-> self control unknown-surface00) *smack-mods*) (let ((f30-0 1.0)) (case (-> gp-0 angle) (('shove) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 158) - ) - ) + (when (not (ja-group? (-> self draw art-group data 158))) (ja-channel-set! 1) - (let ((s4-3 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-3 - (the-as art-joint-anim (-> self draw art-group data 158)) - num-func-identity - ) - (set! (-> s4-3 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 158) :num! min) ) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 1524 0 1 #t) + (sound-play "smack-surface") + (sound-play "flut-hit" :pitch 1) ) (else - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 157) - ) - ) - (ja-channel-push! 1 22) - (let ((s4-6 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-6 - (the-as art-joint-anim (-> self draw art-group data 157)) - num-func-identity - ) - (set! (-> s4-6 frame-num) 0.0) - ) + (when (not (ja-group? (-> self draw art-group data 157))) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! (-> self draw art-group data 157) :num! min) ) ) ) @@ -2294,41 +1770,36 @@ (go target-flut-hit-ground) (none) ) - :post - target-flut-post + :post target-flut-post ) (defstate target-flut-death (target) - :event - (-> target-death event) - :exit - (behavior () - (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + :event (-> target-death event) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags being-attacked dying)) (target-exit) - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (copy-settings-from-target! *setting-control*) + (remove-setting! 'process-mask) + (apply-settings *setting-control*) (none) ) - :trans - (-> target-hit trans) - :code - (behavior ((arg0 symbol)) + :trans (-> target-hit trans) + :code (behavior ((arg0 symbol)) (local-vars (v1-104 symbol)) - (logior! (-> self state-flags) #x8000) + (logior! (-> self state-flags) (state-flags dying)) (set! (-> self neck flex-blend) 0.0) (target-timed-invulnerable-off self) - (push-setting! *setting-control* self 'process-mask 'set (-> (new 'static 'array float 1 0.0) 0) #x14a0000) - (copy-settings-from-target! *setting-control*) + (add-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) + (apply-settings *setting-control*) (set! (-> self control transv quad) (the-as uint128 0)) (cond ((or (= arg0 'none) (= arg0 'water-vol) (= arg0 'sharkey)) ) ((= arg0 'endlessfall) - (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 716 -2133 0 1 #t) + (sound-play "death-fall") + (sound-play "flut-hit" :vol 70 :pitch -1.4) (camera-change-to (the-as string cam-endlessfall) 30 #f) (set! (-> self control pat-ignore-mask unknown-bit) 1) - (set! (-> self water flags) (logand -17 (-> self water flags))) + (logclear! (-> self water flags) (water-flags wt04)) (let ((f30-0 (fmin -4096.0 (- (-> self control ground-impact-vel))))) (set! (-> self control unknown-uint20) (the-as uint f30-0)) (let ((gp-3 (new-stack-vector0))) @@ -2381,30 +1852,18 @@ ) (else (set! (-> self control unknown-surface00) *neutral-mods*) - (ja-channel-push! 1 30) - (let ((a0-33 (-> self skel root-channel 0))) - (set! (-> a0-33 frame-group) (the-as art-joint-anim (-> self draw art-group data 160))) - (set! (-> a0-33 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 160)) data 0 length) -1)) - ) - (set! (-> a0-33 param 1) 1.0) - (set! (-> a0-33 frame-num) 0.0) - (joint-control-channel-group! a0-33 (the-as art-joint-anim (-> self draw art-group data 160)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 160) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (let ((gp-5 (new 'stack-no-clear 'vector))) - (when (zero? (logand (-> self align flags) 1)) + (when (zero? (logand (-> self align flags) (align-flags disabled))) (vector-matrix*! gp-5 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (vector-float*! (-> self control transv) gp-5 (-> *display* frames-per-second)) ) ) (suspend) - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 param 0) (the float (+ (-> a0-37 frame-group data 0 length) -1))) - (set! (-> a0-37 param 1) 1.0) - (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -2418,20 +1877,16 @@ (go target-flut-stance) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) (defstate target-flut-get-on (target) - :event - target-generic-event-handler - :exit - (-> target-flut-start exit) - :code - (behavior ((arg0 handle)) + :event target-generic-event-handler + :exit (-> target-flut-start exit) + :code (behavior ((arg0 handle)) (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self alt-cam-pos quad) (-> (&-> (-> self control) unknown-qword00) 0)) - (logior! (-> self state-flags) 1024) + (logior! (-> self state-flags) (state-flags use-alt-cam-pos)) (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control trans quad)) @@ -2460,15 +1915,12 @@ ) ) (let ((gp-1 #f)) - (sound-play-by-name (static-sound-name "uppercut") (new-sound-id) 1024 0 0 1 #t) - (ja-channel-push! 1 15) - (let ((s5-2 (-> self skel root-channel 0))) - (set! (-> s5-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 155))) - (set! (-> s5-2 param 0) (ja-aframe (the-as float 24.0) 0)) - (set! (-> s5-2 param 1) 1.0) - (set! (-> s5-2 frame-num) 0.0) - (joint-control-channel-group! s5-2 (the-as art-joint-anim (-> self draw art-group data 155)) num-func-seek!) - ) + (sound-play "uppercut") + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 155) + :num! (seek! (ja-aframe (the-as float 24.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (when (and (not gp-1) (= (-> self skel root-channel 0) (-> self skel channel))) (send-event (ppointer->process (-> self manipy)) 'anim-mode 'clone-anim) @@ -2476,23 +1928,18 @@ ) (set! (-> self control transv quad) (the-as uint128 0)) (suspend) - (let ((s5-3 (-> self skel root-channel 0))) - (set! (-> s5-3 param 0) (ja-aframe (the-as float 24.0) 0)) - (set! (-> s5-3 param 1) 1.0) - (joint-control-channel-group-eval! s5-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 24.0) 0))) ) ) - (sound-play-by-name (static-sound-name "flut-coo") (new-sound-id) 1024 0 0 1 #t) - (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + (sound-play "flut-coo") + (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) (set! (-> self control transv quad) (the-as uint128 0)) (quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00)) (rot->dir-targ! (-> self control)) (go target-flut-stance) (none) ) - :post - (behavior () + :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (f30-0 (fmin 1.0 (* 0.0044444446 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) ) @@ -2524,15 +1971,12 @@ ) (defstate target-flut-get-off (target) - :event - target-generic-event-handler - :exit - (-> target-flut-start exit) - :code - (behavior ((arg0 handle)) - (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + :event target-generic-event-handler + :exit (-> target-flut-start exit) + :code (behavior ((arg0 handle)) + (set-forward-vel (the-as float 0.0)) (let ((s5-0 0)) - (while (zero? (logand (-> self control status) 1)) + (while (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (target-flut-falling-anim-trans) (+! s5-0 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) (suspend) @@ -2541,8 +1985,7 @@ (go target-flut-get-off-jump arg0) (none) ) - :post - (behavior () + :post (behavior () (target-no-stick-post) (target-flut-post-post) (none) @@ -2550,12 +1993,9 @@ ) (defstate target-flut-get-off-jump (target) - :event - target-generic-event-handler - :exit - (-> target-flut-start exit) - :code - (behavior ((arg0 handle)) + :event target-generic-event-handler + :exit (-> target-flut-start exit) + :code (behavior ((arg0 handle)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control transv quad) (the-as uint128 0)) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -2587,24 +2027,12 @@ (set! (-> self control unknown-vector102 quad) (-> gp-0 quad)) (set! (-> self control unknown-vector103 quad) (-> s4-0 quad)) ) - (sound-play-by-name (static-sound-name "flut-coo") (new-sound-id) 921 -762 0 1 #t) - (ja-channel-push! 1 15) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 156))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 156)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) 1.0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 156)) num-func-seek!) - ) + (sound-play "flut-coo" :vol 90 :pitch -0.5) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 156) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) 1.0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event (handle->process arg0) 'draw) (set-yaw-angle-clear-roll-pitch! @@ -2622,8 +2050,7 @@ (go target-flut-get-off-hit-ground #f) (none) ) - :post - (behavior () + :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (f30-0 (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) @@ -2661,46 +2088,31 @@ ) (defstate target-flut-get-off-hit-ground (target) - :event - target-standard-event-handler - :enter - (-> target-hit-ground enter) - :trans - (behavior () - (logior! (-> self control status) 7) + :event target-standard-event-handler + :enter (-> target-hit-ground enter) + :trans (behavior () + (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) ((-> target-hit-ground trans)) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe (the-as float 42.0) 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 35) + :num! (seek!) + :frame-num (ja-aframe (the-as float 42.0) 0) + ) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go target-stance) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-flut-grab (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) (-> self state name) @@ -2720,24 +2132,20 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self control unknown-surface00) *grab-mods*) (set! (-> self neck flex-blend) 0.0) - (logior! (-> self state-flags) 272) + (logior! (-> self state-flags) (state-flags invulnerable grabbed)) (none) ) - :exit - (behavior () - (set! (-> self state-flags) (logand -273 (-> self state-flags))) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags invulnerable grabbed)) (target-exit) ((-> target-flut-start exit)) (none) ) - :code - (-> target-flut-stance code) - :post - (behavior () + :code (-> target-flut-stance code) + :post (behavior () (target-no-stick-post) (target-flut-post-post) (none) @@ -2745,31 +2153,26 @@ ) (defstate target-flut-clone-anim (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (= arg2 'trans) (= (-> arg3 param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) ((-> target-flut-grab event) arg0 arg1 arg2 arg3) ) - :enter - (-> target-clone-anim enter) - :exit - (behavior () + :enter (-> target-clone-anim enter) + :exit (behavior () (send-event (ppointer->process (-> self sidekick)) 'matrix #f) ((-> target-clone-anim exit)) ((-> target-flut-start exit)) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (clone-anim arg0 33 #t "") (go target-flut-stance) (none) ) - :post - (behavior () + :post (behavior () (target-no-ja-move-post) (target-flut-post-post) (none) diff --git a/goal_src/levels/intro/evilbro.gc b/goal_src/levels/intro/evilbro.gc index 4e9525e65c..038f0bd5bf 100644 --- a/goal_src/levels/intro/evilbro.gc +++ b/goal_src/levels/intro/evilbro.gc @@ -7,8 +7,11 @@ ;; DECOMP BEGINS +(import "goal_src/import/evilbro-ag.gc") +(import "goal_src/import/evilsis-ag.gc") + (deftype evilbro (process-taskable) - ((evilsis entity :offset-assert 380) + ((evilsis entity-actor :offset-assert 380) ) :heap-base #x110 :method-count-assert 53 @@ -17,14 +20,11 @@ ) -(defskelgroup *evilbro-intro-sg* evilbro - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *evilbro-intro-sg* evilbro evilbro-lod0-jg evilbro-idle-ja + ((evilbro-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow evilbro-shadow-mg + ) (defmethod play-anim! evilbro ((obj evilbro) (arg0 symbol)) (cond @@ -45,8 +45,7 @@ (defstate play-anim (evilbro) :virtual #t - :exit - (behavior () + :exit (behavior () (send-event (-> self evilsis extra process) 'end-mode) ((-> (method-of-type process-taskable play-anim) exit)) (none) @@ -55,79 +54,39 @@ (defstate idle (evilbro) :virtual #t - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) - ) - (while #t - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) ) + (loop + (ja-no-eval :group! evilbro-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-0 (-> *display* base-frame-counter))) - (while (let* ((s5-0 (-> *display* base-frame-counter)) - (f30-0 300.0) - (f28-0 0.16) - (f26-0 0.17000002) - (v1-29 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-30 (the-as number (logior #x3f800000 v1-29))) - ) - (< (- s5-0 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-30)))))))) gp-0) + (while (let ((s5-0 (-> *display* base-frame-counter)) + (f30-0 300.0) + (f28-0 0.16) + (f26-0 0.17000002) + ) + (< (- s5-0 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (rand-float-gen))))))) gp-0) ) (suspend) ) ) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> gp-1 param 0) (ja-aframe 0.0 0)) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) (ja-aframe 16.0 0)) - (joint-control-channel-group! - gp-1 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 0.0 0)) :frame-num (ja-aframe 16.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe 0.0 0)) - (set! (-> gp-2 param 1) 1.0) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 0.0 0))) ) (let ((gp-3 (-> *display* base-frame-counter))) - (while (let* ((s5-1 (-> *display* base-frame-counter)) - (f30-1 300.0) - (f28-1 0.16) - (f26-1 0.17000002) - (v1-54 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-55 (the-as number (logior #x3f800000 v1-54))) - ) - (< (- s5-1 (the-as time-frame (the int (* f30-1 (+ f28-1 (* f26-1 (+ -1.0 (the-as float v1-55)))))))) gp-3) + (while (let ((s5-1 (-> *display* base-frame-counter)) + (f30-1 300.0) + (f28-1 0.16) + (f26-1 0.17000002) + ) + (< (- s5-1 (the-as time-frame (the int (* f30-1 (+ f28-1 (* f26-1 (rand-float-gen))))))) gp-3) ) (suspend) ) @@ -154,14 +113,11 @@ ) -(defskelgroup *evilsis-intro-sg* evilsis - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *evilsis-intro-sg* evilsis evilsis-lod0-jg evilsis-idle-ja + ((evilsis-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow evilsis-shadow-mg + ) (defmethod play-anim! evilsis ((obj evilsis) (arg0 symbol)) (if arg0 @@ -181,8 +137,7 @@ (defstate idle (evilsis) :virtual #t - :trans - (behavior () + :trans (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) (none) diff --git a/goal_src/levels/jungle/bouncer.gc b/goal_src/levels/jungle/bouncer.gc index d06304a9dc..bd7fd3f481 100644 --- a/goal_src/levels/jungle/bouncer.gc +++ b/goal_src/levels/jungle/bouncer.gc @@ -9,6 +9,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/bounceytarp-ag.gc") + (deftype springbox (process-drawable) ((spring-height meters :offset-assert 176) (smush float :offset-assert 180) @@ -27,30 +29,18 @@ (method-set! springbox 12 (method-of-type process run-logic?)) -(defskelgroup *bouncer-sg* bounceytarp - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *bouncer-sg* bounceytarp bounceytarp-lod0-jg bounceytarp-idle-ja + ((bounceytarp-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defstate bouncer-wait (springbox) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('bonk) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 3) - (set! (-> a1-3 message) 'jump) - (set! (-> a1-3 param 0) (the-as uint (-> self spring-height))) - (set! (-> a1-3 param 1) (the-as uint (-> self spring-height))) - (set! (-> a1-3 param 2) (the-as uint #f)) - (when (send-event-function arg0 a1-3) - (sound-play-by-name (static-sound-name "trampoline") (new-sound-id) 1024 0 0 1 #t) - (go bouncer-fire) - ) + (when (send-event arg0 'jump (-> self spring-height) (-> self spring-height) #f) + (sound-play "trampoline") + (go bouncer-fire) ) ) (('touch) @@ -66,18 +56,10 @@ ) ) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 2) :num! min) (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -86,8 +68,7 @@ ) (defstate bouncer-smush (springbox) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -98,34 +79,24 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self smush) 0.0) - (while #t - (cond - ((>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 0.0) - (set! (-> a0-1 param 1) 0.1) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (else - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 param 0) (lerp-scale - (ja-aframe 6.0 0) - (ja-aframe 2.0 0) - (vector-vector-xz-distance (target-pos 0) (-> self root trans)) - 0.0 - 4096.0 - ) - ) - (set! (-> gp-0 param 1) 0.2) - (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-seek!) - ) + (loop + (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (ja :num! (seek! 0.0 0.1)) + (ja :num! (seek! + (lerp-scale + (ja-aframe 6.0 0) + (ja-aframe 2.0 0) + (vector-vector-xz-distance (target-pos 0) (-> self root trans)) + 0.0 + 4096.0 + ) + 0.2 + ) + ) ) - ) (suspend) (if (ja-min? 0) (go bouncer-wait) @@ -133,36 +104,21 @@ ) (none) ) - :post - (the-as (function none :behavior springbox) transform-post) + :post (the-as (function none :behavior springbox) transform-post) ) (defstate bouncer-fire (springbox) - :code - (behavior () + :code (behavior () (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.1)) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 6.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num (ja-aframe 6.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go bouncer-wait) (none) ) - :post - (the-as (function none :behavior springbox) transform-post) + :post (the-as (function none :behavior springbox) transform-post) ) (defmethod init-from-entity! springbox ((obj springbox) (arg0 entity-actor)) diff --git a/goal_src/levels/jungle/darkvine.gc b/goal_src/levels/jungle/darkvine.gc index b5a698ebd8..c00e933300 100644 --- a/goal_src/levels/jungle/darkvine.gc +++ b/goal_src/levels/jungle/darkvine.gc @@ -12,6 +12,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/darkvine-ag.gc") + (deftype darkvine (process-drawable) ((root-override collide-shape :offset 112) (speed float :offset-assert 176) @@ -48,26 +50,21 @@ ) ) -(defskelgroup *darkvine-sg* darkvine - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 2 0 3.5) - :longest-edge (meters 0) - ) +(defskelgroup *darkvine-sg* darkvine darkvine-lod0-jg darkvine-idle-ja + ((darkvine-lod0-mg (meters 20)) (darkvine-lod1-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3.5) + ) (defpartgroup group-darkvine-puffs :id 175 :duration 150 :flags (use-local-clock) :bounds (static-bspherem 0 2 0 3) - :parts - ((sp-item 800) (sp-item 801) (sp-item 802)) + :parts ((sp-item 800) (sp-item 801) (sp-item 802)) ) (defpart 800 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-x (meters 0) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -89,8 +86,7 @@ ) (defpart 802 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0) (sp-rnd-flt spt-scale-x (meters 0.025) (meters 0.2) 1.0) @@ -111,8 +107,7 @@ ) (defpart 801 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.4) 1.0) @@ -140,16 +135,9 @@ ((= v1-0 'touch) (do-push-aways! (-> self root-override)) (when (-> self dangerous) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'attack) - (set! (-> a1-1 param 0) (-> arg3 param 0)) - (set! (-> a1-1 param 1) (the-as uint (new 'static 'attack-info))) - (if (send-event-function arg0 a1-1) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) - ) - ) + (if (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) + ) ) ) ((= v1-0 'attack) @@ -174,36 +162,22 @@ ) (defstate darkvine-idle (darkvine) - :event - darkvine-event-handler - :code - (behavior () + :event darkvine-event-handler + :code (behavior () (set! (-> self dangerous) #t) (set! (-> self vulnerable) #t) (let ((f30-0 0.0)) - (while #t + (loop (if (logtest? (get-reminder (get-task-control (game-task jungle-plant)) 0) 1) (go darkvine-die #f) ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) (-> self speed)) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! darkvine-idle-ja :num! (seek! max (-> self speed)) :frame-num 0.0) (until (ja-done? 0) (if (and (>= (ja-aframe-num 0) 120.0) (>= 180.0 (ja-aframe-num 0))) (seek-toward-yaw-angle! (-> self root-override) f30-0 32768.0 (seconds 0.5)) ) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) (-> self speed)) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self speed))) ) (set! f30-0 (if (rand-vu-percent? 0.5) (+ 16384.0 f30-0) @@ -214,8 +188,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (when (and (-> self hit-player) (or (not *target*) (>= (- (-> *display* base-frame-counter) (-> self touch-time)) (seconds 0.05))) ) @@ -236,39 +209,18 @@ ) (defstate darkvine-retreat (darkvine) - :event - darkvine-event-handler - :code - (behavior () + :event darkvine-event-handler + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self dangerous) #f) (set! (-> self vulnerable) #f) (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 45) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! darkvine-retreat-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 800) - (-> self root-override trans) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 800) (-> self root-override trans)) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (ja-channel-set! 0) (let ((gp-0 (-> *display* base-frame-counter))) @@ -276,23 +228,16 @@ (suspend) ) ) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 175) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 175) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (let ((gp-2 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.5)) @@ -302,47 +247,26 @@ (set! (-> self dangerous) #t) (logior! (-> self mask) (process-mask actor-pause)) (ja-channel-set! 1) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! darkvine-pushup-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go darkvine-idle) (none) ) - :post - (-> darkvine-idle post) + :post (-> darkvine-idle post) ) (defstate darkvine-die (darkvine) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (logclear! (-> self mask) (process-mask actor-pause)) (if arg0 (ja-channel-set! 1) - (ja-channel-push! 1 150) + (ja-channel-push! 1 (seconds 0.5)) ) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! darkvine-dead-ja :num! min) (while (!= (-> self skel root-channel 0) (-> self skel channel)) (suspend) ) @@ -350,8 +274,7 @@ (anim-loop) (none) ) - :post - (-> darkvine-idle post) + :post (-> darkvine-idle post) ) (defmethod init-from-entity! darkvine ((obj darkvine) (arg0 entity-actor)) diff --git a/goal_src/levels/jungle/fisher.gc b/goal_src/levels/jungle/fisher.gc index 26b49b553f..f68997ad64 100644 --- a/goal_src/levels/jungle/fisher.gc +++ b/goal_src/levels/jungle/fisher.gc @@ -9,6 +9,12 @@ ;; DECOMP BEGINS +(import "goal_src/import/fish-net-ag.gc") +(import "goal_src/import/fisher-ag.gc") +(import "goal_src/import/catch-fisha-ag.gc") +(import "goal_src/import/catch-fishb-ag.gc") +(import "goal_src/import/catch-fishc-ag.gc") + (deftype fisher-bank (basic) ((width meters :offset-assert 4) (net-radius meters :offset-assert 8) @@ -21,8 +27,7 @@ ) -(define - *FISHER-bank* +(define *FISHER-bank* (new 'static 'fisher-bank :width (meters 3.3) :net-radius (meters 0.7) :max-caught #xc8 :max-missed 20) ) @@ -32,13 +37,11 @@ :linger-duration 450 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 828) (sp-item 2013)) + :parts ((sp-item 828) (sp-item 2013)) ) (defpart 828 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-y (meters 0.2)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) @@ -58,13 +61,11 @@ ) (defpart 829 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) (defpart 2013 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-x (meters -0.7) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.1) (meters 0.2) 1.0) @@ -87,13 +88,11 @@ :linger-duration 450 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2001)) + :parts ((sp-item 2001)) ) (defpart 2001 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -116,13 +115,11 @@ :linger-duration 1200 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 830) (sp-item 831)) + :parts ((sp-item 830) (sp-item 831)) ) (defpart 831 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-scale-x (meters 5) (meters 1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -136,8 +133,7 @@ ) (defpart 830 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) (sp-int spt-rot-x 4) @@ -160,8 +156,7 @@ ) (defpart 832 - :init-specs - ((sp-flt spt-fade-a -0.8)) + :init-specs ((sp-flt spt-fade-a -0.8)) ) (deftype fisher-params (structure) @@ -182,10 +177,7 @@ ) -(define *fisher-params* (new - 'static - 'boxed-array - :type (inline-array fisher-params) :length 6 :allocated-length 6 +(define *fisher-params* (new 'static 'boxed-array :type (inline-array fisher-params) (new 'static 'inline-array fisher-params 16 (new 'static 'fisher-params :timeout (seconds 2)) (new 'static 'fisher-params @@ -299,7 +291,7 @@ :vel 0.6 :swing-min (seconds 0.5) :swing-max (seconds 2) - :period #x9e + :period (seconds 0.527) :fish-vel 1.6 :bad-percent 0.083 :powerup-percent 0.1 @@ -387,7 +379,7 @@ :vel 1.83 :swing-min (seconds 0.5) :swing-max (seconds 2) - :period #xa8 + :period (seconds 0.56) :fish-vel 1.6 :bad-percent 0.066 :powerup-percent 0.1 @@ -409,7 +401,7 @@ :vel 0.8 :swing-min (seconds 0.5) :swing-max (seconds 2) - :period (seconds 0.5133333) + :period (seconds 0.515) :fish-vel 1.7 :bad-percent 0.066 :powerup-percent 0.1 @@ -529,7 +521,7 @@ :timeout (seconds 3) :vel 0.6 :swing-min (seconds 333.33) - :swing-max (seconds 0.33333334) + :swing-max (seconds 0.335) :period (seconds 0.5) :fish-vel 1.3 :powerup-percent 0.5 @@ -548,7 +540,7 @@ :timeout (seconds 3) :vel 0.6 :swing-min (seconds 333.33) - :swing-max (seconds 0.33333334) + :swing-max (seconds 0.335) :period (seconds 0.5) :fish-vel 1.3 :powerup-percent 0.5 @@ -578,7 +570,7 @@ :timeout (seconds 3) :vel 0.6 :swing-min (seconds 333.33) - :swing-max (seconds 0.33333334) + :swing-max (seconds 0.335) :period (seconds 0.5) :fish-vel 1.3 :powerup-percent 0.5 @@ -597,7 +589,7 @@ :timeout (seconds 3) :vel 0.6 :swing-min (seconds 333.33) - :swing-max (seconds 0.33333334) + :swing-max (seconds 0.335) :period (seconds 0.5) :fish-vel 1.3 :powerup-percent 0.5 @@ -784,46 +776,31 @@ ) -(defskelgroup *catch-fisha-sg* catch-fisha - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *catch-fisha-sg* catch-fisha catch-fisha-lod0-jg catch-fisha-idle-ja + ((catch-fisha-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) -(defskelgroup *catch-fishb-sg* catch-fishb - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *catch-fishb-sg* catch-fishb catch-fishb-lod0-jg catch-fishb-idle-ja + ((catch-fishb-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) -(defskelgroup *catch-fishc-sg* catch-fishc - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *catch-fishc-sg* catch-fishc catch-fishc-lod0-jg catch-fishc-idle-ja + ((catch-fishc-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) -(defskelgroup *fish-net-sg* fish-net - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *fish-net-sg* fish-net fish-net-lod0-jg fish-net-fishing-ja + ((fish-net-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) -(defskelgroup *fisher-sg* fisher - 0 - 6 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 -6 0 14) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *fisher-sg* fisher fisher-lod0-jg fisher-idle-more-often-ja + ((fisher-lod0-mg (meters 20)) (fisher-lod1-mg (meters 40)) (fisher-lod2-mg (meters 999999))) + :bounds (static-spherem 0 -6 0 14) + :shadow fisher-shadow-mg + ) (defmethod dummy-52 fisher ((obj fisher)) (let ((v1-1 (-> obj draw shadow-ctrl))) @@ -838,7 +815,7 @@ ) ) 0 - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) ) ) (none) @@ -847,16 +824,19 @@ (defmethod draw-npc-shadow fisher ((obj fisher)) (-> obj draw shadow-ctrl) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -873,14 +853,7 @@ (set! (-> *part-id-table* 118 init-specs 1 initial-valuef) 0.05) (set! (-> *part-id-table* 118 init-specs 2 initial-valuef) 0.0) (set! (-> *part-id-table* 118 init-specs 13 initial-valuef) 0.35555556) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 118) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 118) gp-0) ) 0 (none) @@ -910,39 +883,13 @@ ) (defstate fisher-fish-fall (fisher-fish) - :code - (behavior () + :code (behavior () (set-heading-vec! (-> self root) (TODO-RENAME-12 (-> (the-as fisher (-> self parent 0)) path) (-> self dir) (-> self pos)) ) - (while #t - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-2 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (fisher-fish-move) (if (< (vector-vector-xz-distance (-> self root trans) (-> (the-as fisher (-> self parent 0)) paddle-pos)) @@ -956,52 +903,50 @@ (go fisher-fish-die) ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior fisher-fish) ja-post) + :post (the-as (function none :behavior fisher-fish) ja-post) ) (defstate fisher-fish-caught (fisher-fish) - :code - (behavior () + :code (behavior () (case (-> self mode) (('deadly 'bad) - (sound-play-by-name (static-sound-name "caught-eel") (new-sound-id) 1024 0 0 1 #t) + (sound-play "caught-eel") (ambient-hint-spawn "sksp0a42" (-> self root trans) *entity-pool* 'ambient) (send-event (ppointer->process (-> self parent)) 'deadly) ) (('powerup) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 179) -1 #f #f #f (-> self root trans)) - (-> gp-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 179) + -1 + #f + #f + #f + (-> self root trans) + :to *entity-pool* ) - (sound-play-by-name (static-sound-name "get-big-fish") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-big-fish") (send-event (ppointer->process (-> self parent)) 'fisher-fish-caught 5) ) (else - (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-3 - (let ((t9-11 (method-of-type part-tracker activate))) - (t9-11 (the-as part-tracker gp-3) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-3 part-tracker-init (-> *part-group-id-table* 179) -1 #f #f #f (-> self root trans)) - (-> gp-3 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 179) + -1 + #f + #f + #f + (-> self root trans) + :to *entity-pool* ) - (sound-play-by-name (static-sound-name "get-small-fish") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-small-fish") (send-event (ppointer->process (-> self parent)) 'fisher-fish-caught 1) ) ) @@ -1012,18 +957,14 @@ (vector-float*! (-> self root scale) (-> self root scale) 0.93) (ja-post) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) 1.0) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) ) (defstate fisher-fish-die (fisher-fish) - :code - (behavior () + :code (behavior () (case (-> self mode) (('deadly 'bad) ) @@ -1035,10 +976,7 @@ *entity-pool* (game-task none) ) - (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-3 (the-as number (logior #x3f800000 v1-2))) - (f0-2 (+ -1.0 (the-as float v1-3))) - ) + (let ((f0-2 (rand-float-gen))) (if (< 0.5 f0-2) (play-ambient (-> (the-as fisher (-> self parent 0)) ambient) "FIS-TA04" #t (-> self root trans)) (play-ambient (-> (the-as fisher (-> self parent 0)) ambient) "FIS-TA05" #t (-> self root trans)) @@ -1047,10 +985,7 @@ (send-event (ppointer->process (-> self parent)) 'fisher-fish-die 5) ) (else - (let* ((v1-21 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-22 (the-as number (logior #x3f800000 v1-21))) - (f0-5 (+ -1.0 (the-as float v1-22))) - ) + (let ((f0-5 (rand-float-gen))) (cond ((and (< 0.8333 f0-5) (< (-> (the-as fisher (-> self parent 0)) paddle-pos z) (-> self root trans z))) (play-ambient (-> (the-as fisher (-> self parent 0)) ambient) "FIS-TA01" #t (-> self root trans)) @@ -1179,8 +1114,7 @@ :name "fisher-introduction" :index 8 :parts 9 - :command-list - '((0 want-levels village1 jungle) + :command-list '((0 want-levels village1 jungle) (0 alive "jungle-part-1") (130 blackout 10) (130 display-level village1 movie) @@ -1225,8 +1159,7 @@ :name "fisher-resolution" :index 9 :parts 4 - :command-list - '((188 blackout 10) (199 blackout 0)) + :command-list '((188 blackout 10) (199 blackout 0)) ) ) (else @@ -1274,8 +1207,7 @@ :name "fisher-accept" :index 12 :parts 6 - :command-list - '((0 send-event self emissive-on) (700 send-event self emissive-off)) + :command-list '((0 send-event self emissive-on) (700 send-event self emissive-off)) ) ) @@ -1284,8 +1216,7 @@ ) (defstate fisher-done (fisher) - :enter - (behavior () + :enter (behavior () (init! (-> self query) (lookup-text! *common-text* (game-text-id play-again?) #f) @@ -1296,9 +1227,7 @@ (lookup-text! *common-text* (game-text-id quit) #f) ) (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (get-art-elem self))) - ) + (ja :group! (get-art-elem self)) (set! (-> self state-time) (-> *display* base-frame-counter)) (while (-> self child) (deactivate (-> self child 0)) @@ -1389,40 +1318,30 @@ (-> gp-2 user-uint8 6) ) ) - (let ((gp-3 (get-process *default-dead-pool* process #x4000))) - (when gp-3 - (let ((t9-15 (method-of-type process activate))) - (t9-15 gp-3 *default-pool* 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process gp-3 (lambda :behavior process - () - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) - (suspend) - ) - ) - (ambient-hint-spawn "st-lose" (the-as vector #f) *entity-pool* 'stinger) - (none) - ) - ) - (-> gp-3 ppointer) - ) - ) + (process-spawn-function process (lambda :behavior process + () + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) + (suspend) + ) + ) + (ambient-hint-spawn "st-lose" (the-as vector #f) *entity-pool* 'stinger) + (none) + ) + ) (send-event *target* 'lose) ) ) (none) ) - :exit - (behavior () + :exit (behavior () (when (and *target* (the-as target #f)) (send-event *target* 'end-mode) (process-grab? *target*) ) (none) ) - :trans - (behavior () + :trans (behavior () (set! *camera-look-through-other* 2) (cond ((>= (-> self caught) (-> *FISHER-bank* max-caught)) @@ -1430,32 +1349,28 @@ ((< (-> self caught) 0) ) (else - (when (< (mod (-> *display* base-frame-counter) 300) 150) - (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (gp-0 (-> s5-0 base)) - ) - (draw-string-xy - (lookup-text! *common-text* (game-text-id lose!) #f) - s5-0 - 256 - 100 - (font-color orange-red) - (font-flags shadow kerning middle large) - ) - (let ((a3-1 (-> s5-0 base))) - (let ((v1-13 (the-as dma-packet (-> s5-0 base)))) - (set! (-> v1-13 dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> v1-13 vif0) (new 'static 'vif-tag)) - (set! (-> v1-13 vif1) (new 'static 'vif-tag)) - (set! (-> s5-0 base) (&+ (the-as pointer v1-13) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - gp-0 - (the-as (pointer dma-tag) a3-1) + (when (< (mod (-> *display* base-frame-counter) (seconds 1)) (seconds 0.5)) + ;; PAL patch here + (let ((gp-0 (new + 'stack + 'font-context + *font-default-matrix* + 56 + 100 + 0.0 + (font-color orange-red) + (font-flags shadow kerning) + ) + ) ) + (let ((v1-10 gp-0)) + (set! (-> v1-10 width) (the float 400)) ) + (let ((v1-11 gp-0)) + (set! (-> v1-11 height) (the float 50)) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning middle large)) + (print-game-text (lookup-text! *common-text* (game-text-id lose!) #f) gp-0 #f 128 22) ) ) (fisher-draw-display self) @@ -1474,17 +1389,12 @@ (spool-push *art-control* "fisher-reject" 0 self -99.0) (none) ) - :code - (the-as (function none :behavior fisher) process-taskable-anim-loop) - :post - (the-as (function none :behavior fisher) ja-post) + :code (the-as (function none :behavior fisher) process-taskable-anim-loop) + :post (the-as (function none :behavior fisher) ja-post) ) (defbehavior fisher-spawn-ambient fisher () - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - (f0-2 (+ -1.0 (the-as float v1-2))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((and (< 0.3 f0-2) (< (+ (-> *FISHER-bank* max-caught) -30) (-> self caught))) (if (and (>= (- (-> *display* base-frame-counter) (-> self ambient-almost)) (seconds 10)) @@ -1575,23 +1485,15 @@ ) (set! (-> self spawner-last) (-> self spawner)) (set! (-> self spawn-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "fish-spawn") (new-sound-id) 716 0 0 1 #t) + (sound-play "fish-spawn" :vol 70) (fisher-spawn-ambient) - (let ((s5-1 (get-process *default-dead-pool* fisher-fish #x4000))) - (when s5-1 - (let ((t9-10 (method-of-type fisher-fish activate))) - (t9-10 (the-as fisher-fish s5-1) self 'fisher-fish (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 fisher-fish-init-by-other gp-0 (-> self spawner) (* 1.85 (-> self params fish-vel))) - (-> s5-1 ppointer) - ) - ) + (process-spawn fisher-fish gp-0 (-> self spawner) (* 1.85 (-> self params fish-vel)) :to self) ) ) (let ((f1-14 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 32.0 110.0 28.0))) (+! (-> self paddle-vel) (* f1-14 (-> *display* seconds-per-frame))) ) - (set! (-> self paddle-vel) (seek (-> self paddle-vel) 0.0 (* 15.0 (-> *display* seconds-per-frame)))) + (seek! (-> self paddle-vel) 0.0 (* 15.0 (-> *display* seconds-per-frame))) (set! (-> self paddle-vel) (fmax -2.0 (fmin 2.0 (-> self paddle-vel)))) (+! (-> self paddle) (* (-> self paddle-vel) (-> *display* seconds-per-frame))) (set! (-> self paddle) (fmax 0.0 (fmin 1.0 (-> self paddle)))) @@ -1606,12 +1508,11 @@ ) (defstate fisher-playing (fisher) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-2 object)) (case arg2 (('fisher-fish-die) - (sound-play-by-name (static-sound-name "fish-miss") (new-sound-id) 1024 0 0 1 #t) + (sound-play "fish-miss") (set! v0-2 (+ (-> self missed) (-> arg3 param 0))) (set! (-> self missed) (the-as int v0-2)) v0-2 @@ -1632,37 +1533,30 @@ ) ) ) - :enter - (behavior () - (set-setting! *setting-control* self 'ambient-volume 'rel 50.0 0) + :enter (behavior () + (set-setting! 'ambient-volume 'rel 50.0 0) (send-event *target* 'reset-pickup 'eco) (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (get-process *default-dead-pool* process #x4000))) - (when gp-0 - (let ((t9-5 (method-of-type process activate))) - (t9-5 gp-0 self 'process (the-as pointer #x70004000)) + (process-spawn-function + process + (lambda :behavior fisher-fish + () + (logclear! (-> self mask) (process-mask pause)) + (loop + (fisher-draw-display (the-as fisher (ppointer->process (-> self parent)))) + (suspend) ) - (run-next-time-in-process gp-0 (lambda :behavior fisher-fish - () - (logclear! (-> self mask) (process-mask pause)) - (while #t - (fisher-draw-display (the-as fisher (ppointer->process (-> self parent)))) - (suspend) - ) - (none) - ) - ) - (-> gp-0 ppointer) + (none) ) + :to self ) (send-event *camera* 'change-to-entity-by-name "camera-152") (init! (-> self query) (the-as string #f) 40 150 25 #t (lookup-text! *common-text* (game-text-id quit) #f)) (none) ) - :exit - (behavior () - (clear-pending-settings-from-process *setting-control* self 'ambient-volume) + :exit (behavior () + (remove-setting! 'ambient-volume) (let* ((v1-2 *camera-other-matrix*) (a3-0 (-> *camera-combiner* inv-camera-rot)) (a0-2 (-> a3-0 vector 0 quad)) @@ -1685,14 +1579,12 @@ 0 (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "fisher-resolution" 0 self -99.0) (spool-push *art-control* "fisher-reject" 0 self -99.0) (none) ) - :code - (behavior () + :code (behavior () (set! *display-profile* #f) (set! (-> self paddle) 0.5) (set! (-> self paddle-vel) 0.0) @@ -1714,7 +1606,7 @@ (set! (-> self ambient-steady) 0) (set! (-> self ambient-sagging) 0) (set! (-> self ambient-almost) 0) - (while #t + (loop (hide-hud-quick) (fisher-game-update) (if (or (zero? (-> self params timeout)) @@ -1727,8 +1619,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (none) ) @@ -1736,27 +1627,18 @@ (defstate enter-playing (fisher) :virtual #t - :trans - (behavior () - (set-blackout-frames (seconds 0.016666668)) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'change-mode) - (set! (-> a1-0 param 0) (the-as uint 'fishing)) - (set! (-> a1-0 param 1) (the-as uint self)) - (if (send-event-function *target* a1-0) - (go fisher-playing) - ) - ) + :trans (behavior () + (set-blackout-frames (seconds 0.017)) + (if (send-event *target* 'change-mode 'fishing self) + (go fisher-playing) + ) (none) ) ) (defstate query (fisher) :virtual #t - :enter - (behavior () + :enter (behavior () (init! (-> self query) (lookup-text! *common-text* (game-text-id fish?) #f) @@ -1774,10 +1656,7 @@ (cond ((closed? (-> obj tasks) (game-task jungle-fishgame) (task-status need-reminder)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 1) 122880.0 obj) - (let* ((v1-5 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-6 (the-as number (logior #x3f800000 v1-5))) - (f0-2 (+ -1.0 (the-as float v1-6))) - ) + (let ((f0-2 (rand-float-gen))) (if (< 0.5 f0-2) (play-ambient (-> obj ambient) "FIS-LO03" #f (-> obj root-override trans)) (play-ambient (-> obj ambient) "FIS-LO05" #f (-> obj root-override trans)) @@ -1787,10 +1666,7 @@ ) (else (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-16 (the-as number (logior #x3f800000 v1-15))) - (f0-5 (+ -1.0 (the-as float v1-16))) - ) + (let ((f0-5 (rand-float-gen))) (cond ((< 0.875 f0-5) (play-ambient (-> obj ambient) "FIS-LO01" #f (-> obj root-override trans)) @@ -1825,8 +1701,7 @@ (defstate play-accept (fisher) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 rgbaf)) (let ((v1-0 arg2)) (the-as object (cond @@ -1852,47 +1727,18 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (-> self training) (let ((gp-0 (new-stack-vector0))) (vector<-cspace! gp-0 (-> self node-list data 74)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2001) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 2001) gp-0) (fisher-fish-water gp-0 (+ 32768.0 (vector-y-angle (-> self node-list data 75 bone transform vector 1)))) (vector<-cspace! gp-0 (-> self node-list data 77)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2001) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 2001) gp-0) (fisher-fish-water gp-0 (+ 32768.0 (vector-y-angle (-> self node-list data 78 bone transform vector 1)))) (vector<-cspace! gp-0 (-> self node-list data 80)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 828) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2013) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 828) gp-0) + (launch-particles (-> *part-id-table* 2013) gp-0) (fisher-fish-water gp-0 (+ 32768.0 (vector-y-angle (-> self node-list data 80 bone transform vector 1)))) ) ) @@ -1907,8 +1753,7 @@ (defstate idle (fisher) :virtual #t - :trans - (behavior () + :trans (behavior () (let ((t9-1 (-> (the-as state (find-parent-method fisher 30)) trans))) (if t9-1 (t9-1) @@ -2028,83 +1873,31 @@ ) (none) ) - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 60) - ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.2)) ) + (loop + (ja :group! (get-art-elem self)) (let* ((f30-0 5.0) (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-10 (the-as number (logior #x3f800000 v1-9))) ) (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-10)))) 5)) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-10 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! - a0-10 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (TODO-RENAME-43 self) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (when (ja-group? fisher-idle-more-often-ja) + (ja-no-eval :group! fisher-idle-less-often-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (TODO-RENAME-43 self) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -2175,8 +1968,7 @@ ) (defstate target-fishing (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((= arg2 'bounce) (set-zero! (-> self control unknown-smush00)) @@ -2191,17 +1983,15 @@ ) ) ) - :enter - (behavior ((arg0 handle)) + :enter (behavior ((arg0 handle)) (set! (-> self control unknown-surface00) *empty-mods*) - (logior! (-> self state-flags) 16) + (logior! (-> self state-flags) (state-flags invulnerable)) (set-zero! (-> self control unknown-smush00)) (set! (-> self control unknown-uint20) (the-as uint #f)) (none) ) - :exit - (behavior () - (set! (-> self state-flags) (logand -17 (-> self state-flags))) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags invulnerable)) (let ((v1-2 (-> self manipy))) (when v1-2 (deactivate (-> v1-2 0)) @@ -2211,8 +2001,7 @@ (-> target-periscope exit) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (let ((v1-1 (handle->process arg0))) (when (and v1-1 (type-type? (-> v1-1 type) fisher)) (set-vector! (-> self control trans) 1067827.2 9420.8 -955596.8 1.0) @@ -2239,7 +2028,7 @@ a2-2 (if v1-16 (-> v1-16 entity) - (the-as entity #f) + (the-as entity-actor #f) ) *fish-net-sg* #f @@ -2268,35 +2057,15 @@ (set! (-> v1-35 0 param2) (the-as basic (-> self control quat))) ) ) - (let ((s5-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 99)) - num-func-identity - ) - (set! (-> s5-1 frame-num) (ja-aframe 15.0 0)) - ) + (ja :group! (-> self draw art-group data 99) :num! (identity (ja-aframe 15.0 0))) (let ((s5-2 (new 'stack-no-clear 'vector))) (until (-> self control unknown-spoolanim00) (let ((v1-42 (handle->process arg0))) (when v1-42 - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (* (fmax 0.0 (- 1.0 (-> (the-as fisher v1-42) paddle))) - (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! + (* (fmax 0.0 (- 1.0 (-> (the-as fisher v1-42) paddle))) (the float (+ (-> (ja-group) data 0 length) -1))) + ) + ) (when (-> self manipy) (let ((s2-0 (new-stack-vector0)) (s4-0 (new-stack-vector0)) @@ -2320,31 +2089,18 @@ ) (case (-> self control unknown-spoolanim00) (('lose) - (ja-channel-push! 1 30) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 frame-group) (the-as art-joint-anim (-> self draw art-group data 100))) - (set! (-> a0-38 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 100)) data 0 length) -1)) - ) - (set! (-> a0-38 param 1) 1.0) - (set! (-> a0-38 frame-num) 0.0) - (joint-control-channel-group! a0-38 (the-as art-joint-anim (-> self draw art-group data 100)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 100) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 param 0) (the float (+ (-> a0-39 frame-group data 0 length) -1))) - (set! (-> a0-39 param 1) 1.0) - (joint-control-channel-group-eval! a0-39 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (anim-loop) ) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) diff --git a/goal_src/levels/jungle/hopper.gc b/goal_src/levels/jungle/hopper.gc index a302e7cc14..56b0edb224 100644 --- a/goal_src/levels/jungle/hopper.gc +++ b/goal_src/levels/jungle/hopper.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/hopper-ag.gc") + (deftype hopper (nav-enemy) ((jump-length float :offset-assert 400) (shadow-min-y float :offset-assert 404) @@ -18,16 +20,14 @@ ) -(defskelgroup *hopper-sg* hopper - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 1) - :shadow 4 - ) +(defskelgroup *hopper-sg* hopper hopper-lod0-jg hopper-idle-ja + ((hopper-lod0-mg (meters 20)) (hopper-lod1-mg (meters 40)) (hopper-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :longest-edge (meters 1) + :shadow hopper-shadow-mg + ) -(defstatehandler hopper :event nav-enemy-default-event-handler) +nav-enemy-default-event-handler (defmethod common-post hopper ((obj hopper)) (let ((v1-1 (-> obj draw shadow-ctrl))) @@ -46,9 +46,16 @@ ) (set! (-> s5-0 quad) (-> arg0 quad)) (set! (-> s5-0 y) (+ 20480.0 (-> s5-0 y))) - (let ((f0-2 - (fill-and-probe-using-y-probe *collide-cache* s5-0 f30-0 (collide-kind background) self t1-0 (the-as uint 1)) - ) + (let ((f0-2 (fill-and-probe-using-y-probe + *collide-cache* + s5-0 + f30-0 + (collide-kind background) + self + t1-0 + (new 'static 'pat-surface :noentity #x1) + ) + ) ) (if (< f0-2 0.0) (return (the-as object #f)) @@ -74,18 +81,18 @@ (-> self nav-info jump-height-factor) -409600.0 ) - (set! (-> self nav-enemy-flags) (logand -513 (-> self nav-enemy-flags))) - (set! (-> self nav-enemy-flags) (logand -1025 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 16) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (when (not (nav-enemy-facing-point? (-> self jump-dest) 5461.3335)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) (set! (-> self shadow-min-y) (+ (-> self collide-info trans y) (-> self nav-info shadow-min-y))) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (nav-enemy-jump-land-anim) 0 (none) @@ -104,50 +111,24 @@ (defstate nav-enemy-idle (hopper) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior hopper) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 22) - (while #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (loop (dotimes (gp-0 3) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! hopper-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! hopper-burp-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) @@ -156,98 +137,53 @@ (defstate nav-enemy-patrol (hopper) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior hopper) nav-enemy-jump-event-handler ) - :trans - (behavior () - (if (zero? (logand (-> self nav-enemy-flags) 8)) + :trans (behavior () + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) ((-> (method-of-type nav-enemy nav-enemy-patrol) trans)) ) (none) ) - :code - (behavior () + :code (behavior () (vector-reset! (-> self collide-info transv)) (set! (-> self jump-length) 16384.0) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) - (while #t + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (loop (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - (ja-channel-push! 1 20) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + ((ja-group? hopper-jump-long-ja) + (ja-channel-push! 1 (seconds 0.067)) + (ja-no-eval :group! hopper-jump-long-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 9) - ) - (ja-channel-push! 1 30) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + ((ja-group? hopper-jump-short-ja) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! hopper-jump-short-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) (else - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) ) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! hopper-idle-ja :num! min) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) - (when (or (logtest? (nav-control-flags bit19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) + (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) (set! (-> self nav block-count) 0.0) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (nav-enemy-get-new-patrol-point) (set! (-> self nav target-pos quad) (-> self nav destination-pos quad)) ) @@ -255,19 +191,16 @@ ) (none) ) - :post - (the-as (function none :behavior hopper) nav-enemy-jump-post) + :post (the-as (function none :behavior hopper) nav-enemy-jump-post) ) (defstate nav-enemy-notice (hopper) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior hopper) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-chase) (none) ) @@ -275,113 +208,65 @@ (defstate nav-enemy-chase (hopper) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior hopper) nav-enemy-jump-event-handler ) - :trans - (behavior () - (if (zero? (logand (-> self nav-enemy-flags) 8)) + :trans (behavior () + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) ) (none) ) - :code - (behavior () + :code (behavior () (vector-reset! (-> self collide-info transv)) (set! (-> self jump-length) 32768.0) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) - (while #t + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (loop (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - (ja-channel-push! 1 20) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + ((ja-group? hopper-jump-long-ja) + (ja-channel-push! 1 (seconds 0.067)) + (ja-no-eval :group! hopper-jump-long-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 9) - ) - (ja-channel-push! 1 30) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + ((ja-group? hopper-jump-short-ja) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! hopper-jump-short-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) (else - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) ) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! hopper-idle-ja :num! min) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (set! (-> self nav target-pos quad) (-> (target-pos 0) quad)) (hopper-do-jump) ) (none) ) - :post - (the-as (function none :behavior hopper) nav-enemy-jump-post) + :post (the-as (function none :behavior hopper) nav-enemy-jump-post) ) (defstate nav-enemy-stop-chase (hopper) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior hopper) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-stare) (none) ) @@ -435,7 +320,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #t ) diff --git a/goal_src/levels/jungle/jungle-elevator.gc b/goal_src/levels/jungle/jungle-elevator.gc index 95e58a77ed..cfc13e83a8 100644 --- a/goal_src/levels/jungle/jungle-elevator.gc +++ b/goal_src/levels/jungle/jungle-elevator.gc @@ -25,8 +25,7 @@ (defstate plat-button-move-downward (jungle-elevator) :virtual #t - :enter - (behavior () + :enter (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-move-downward) enter))) (if t9-0 (t9-0) @@ -38,8 +37,7 @@ (send-event *target* 'reset-pickup 'eco) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> jungle bottom-height) (-> self bottom-height)) (let ((t9-0 (-> (method-of-type plat-button plat-button-move-downward) exit))) (if t9-0 @@ -48,8 +46,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -74,8 +71,7 @@ (defstate plat-button-move-upward (jungle-elevator) :virtual #t - :enter - (behavior () + :enter (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) enter))) (if t9-0 (t9-0) @@ -87,8 +83,7 @@ (set! (-> self grab-player?) (process-grab? *target*)) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> jungle bottom-height) (-> self bottom-height)) (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) exit))) (if t9-0 @@ -97,8 +92,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) trans))) (if t9-0 (t9-0) @@ -113,8 +107,7 @@ (defstate plat-button-at-end (jungle-elevator) :virtual #t - :code - (behavior () + :code (behavior () (cond ((!= (-> self path-pos) 0.0) (set! (-> self draw light-index) (the-as uint 1)) diff --git a/goal_src/levels/jungle/jungle-mirrors.gc b/goal_src/levels/jungle/jungle-mirrors.gc index 0006158e87..714d768efd 100644 --- a/goal_src/levels/jungle/jungle-mirrors.gc +++ b/goal_src/levels/jungle/jungle-mirrors.gc @@ -11,12 +11,14 @@ ;; DECOMP BEGINS +(import "goal_src/import/periscope-ag.gc") +(import "goal_src/import/reflector-mirror-ag.gc") + (defpartgroup group-jungle-binoculars :id 176 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 803) + :parts ((sp-item 803) (sp-item 804) (sp-item 805) (sp-item 806) @@ -41,8 +43,7 @@ ) (defpart 823 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x28 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x28 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-z (degrees -45.0)) @@ -59,8 +60,7 @@ ) (defpart 815 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees -15.0)) @@ -77,8 +77,7 @@ ) (defpart 816 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees 15.0)) @@ -95,8 +94,7 @@ ) (defpart 817 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees 75.0)) @@ -113,8 +111,7 @@ ) (defpart 818 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees 105.0)) @@ -131,8 +128,7 @@ ) (defpart 819 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees 165.0)) @@ -149,8 +145,7 @@ ) (defpart 820 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees 195.0)) @@ -167,8 +162,7 @@ ) (defpart 821 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees 255.0)) @@ -185,8 +179,7 @@ ) (defpart 822 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees 285.0)) @@ -203,8 +196,7 @@ ) (defpart 811 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.75)) (sp-flt spt-rot-z (degrees 0.0)) @@ -221,8 +213,7 @@ ) (defpart 812 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.75)) (sp-flt spt-rot-z (degrees 90.0)) @@ -239,8 +230,7 @@ ) (defpart 813 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.75)) (sp-flt spt-rot-z (degrees 180.0)) @@ -257,8 +247,7 @@ ) (defpart 814 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.75)) (sp-flt spt-rot-z (degrees 270.0)) @@ -275,8 +264,7 @@ ) (defpart 803 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.9)) (sp-flt spt-y (meters 2.1)) @@ -292,8 +280,7 @@ ) (defpart 804 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 1.11)) (sp-flt spt-y (meters 2.1)) @@ -309,8 +296,7 @@ ) (defpart 805 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.11)) (sp-flt spt-y (meters 2.1)) @@ -327,8 +313,7 @@ ) (defpart 806 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2.9)) (sp-flt spt-y (meters 2.1)) @@ -345,8 +330,7 @@ ) (defpart 807 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.9)) (sp-flt spt-y (meters -2.1)) @@ -363,8 +347,7 @@ ) (defpart 808 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 1.11)) (sp-flt spt-y (meters -2.1)) @@ -381,8 +364,7 @@ ) (defpart 809 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.11)) (sp-flt spt-y (meters -2.1)) @@ -399,8 +381,7 @@ ) (defpart 810 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2.9)) (sp-flt spt-y (meters -2.1)) @@ -419,13 +400,11 @@ (defpartgroup group-jungle-binoculars-aligned :id 689 :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 2840) (sp-item 2863) (sp-item 2864) (sp-item 2865)) + :parts ((sp-item 2840) (sp-item 2863) (sp-item 2864) (sp-item 2865)) ) (defpart 2865 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 5.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -449,13 +428,11 @@ ) (defpart 2866 - :init-specs - ((sp-flt spt-fade-a -0.85333335)) + :init-specs ((sp-flt spt-fade-a -0.85333335)) ) (defpart 2864 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -478,13 +455,11 @@ ) (defpart 2867 - :init-specs - ((sp-flt spt-fade-a -4.266667)) + :init-specs ((sp-flt spt-fade-a -4.266667)) ) (defpart 2863 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -502,8 +477,7 @@ ) (defpart 2840 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 13) (meters 5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -622,43 +596,31 @@ ) -(defskelgroup *periscope-base-sg* periscope - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 23.5 0 24) - :longest-edge (meters 4.5) - ) +(defskelgroup *periscope-base-sg* periscope periscope-base-lod0-jg periscope-base-idle-ja + ((periscope-base-lod0-mg (meters 20)) (periscope-base-lod1-mg (meters 999999))) + :bounds (static-spherem 0 23.5 0 24) + :longest-edge (meters 4.5) + ) -(defskelgroup *periscope-mirror-sg* periscope - 4 - 7 - ((5 (meters 20)) (6 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *periscope-mirror-sg* periscope periscope-mirror-lod0-jg periscope-mirror-idle-ja + ((periscope-mirror-lod0-mg (meters 20)) (periscope-mirror-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) -(defskelgroup *reflector-mirror-sg* reflector-mirror - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 9 0 9) - :longest-edge (meters 3) - ) +(defskelgroup *reflector-mirror-sg* reflector-mirror reflector-mirror-lod0-jg reflector-mirror-idle-ja + ((reflector-mirror-lod0-mg (meters 999999))) + :bounds (static-spherem 0 9 0 9) + :longest-edge (meters 3) + ) -(defskelgroup *reflector-mirror-break-sg* reflector-mirror - 4 - 6 - ((5 (meters 999999))) - :bounds (static-spherem 0 9 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *reflector-mirror-break-sg* reflector-mirror reflector-mirror-break-lod0-jg reflector-mirror-break-break-ja + ((reflector-mirror-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 9 0 9) + ) (defstate cam-periscope (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) (let ((v1-2 (-> self change-event-from))) @@ -675,22 +637,20 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (sv-32 int) (sv-48 int)) (let* ((gp-0 (-> self change-event-from)) (f28-0 (the-as float (-> (the-as periscope (-> gp-0 0)) tilt))) (f30-0 (the-as float (-> (the-as periscope (-> gp-0 0)) turn))) (s5-0 (new 'stack-no-clear 'vector)) ) - (while #t + (loop (when (not (or (paused?) (-> (the-as periscope (-> self change-event-from 0)) aligned?))) (vector-reset! s5-0) (when *camera-read-analog* @@ -727,7 +687,10 @@ (set! sv-32 0) (set! sv-48 1) (let ((t2-0 (target-pos 0))) - (the-as int (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-32 sv-48 (the-as symbol t2-0))) + (the-as + int + (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-32 (the-as sound-group sv-48) (the-as symbol t2-0)) + ) ) ) ) @@ -762,10 +725,9 @@ ) (defstate reflector-idle (reflector) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) - (while #t + (loop (set! (-> gp-0 x) (-> self parent-override 0 tilt)) (set! (-> gp-0 y) (-> self parent-override 0 turn)) (set! (-> gp-0 z) 0.0) @@ -838,15 +800,7 @@ ) (when (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (sound-stop (-> self sound-id)) - (sound-play-by-name - (static-sound-name "beam-connect") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (target-pos 0)) - ) + (sound-play "beam-connect" :position (the-as symbol (target-pos 0))) ) (process-entity-status! self (entity-perm-status complete) #t) (set! gp-0 #t) @@ -935,8 +889,7 @@ ) (defpart 825 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 4.5) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1045,14 +998,7 @@ (when (periscope-has-power-input?) (update! (-> self sound)) (if (logtest? (-> self draw status) (draw-status was-drawn)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 825) - (-> self reflector-trans) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 825) (-> self reflector-trans)) ) ) 0 @@ -1119,127 +1065,79 @@ (gp-0 (cond ((name= arg0 "reflector-mirror-2") - (let ((s5-1 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-1 - (let ((t9-3 (method-of-type pov-camera activate))) - (t9-3 (the-as pov-camera s5-1) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - pov-camera-init-by-other - (-> gp-0 extra trans) - *junglecam-sg* - "tower1" - 0 - #f - '((0 ambient camera "gamcam14")) - ) - (-> s5-1 ppointer) - ) + (process-spawn + pov-camera + (-> gp-0 extra trans) + *junglecam-sg* + "tower1" + 0 + #f + '((0 ambient camera "gamcam14")) + :to self ) ) ((name= arg0 "periscope-11") - (let ((s5-2 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-2 - (let ((t9-7 (method-of-type pov-camera activate))) - (t9-7 (the-as pov-camera s5-2) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-2 - pov-camera-init-by-other - (-> gp-0 extra trans) - *junglecam-sg* - "tower2" - 0 - #f - '((0 ambient camera "gamcam15") (0 want-force-vis jungle #t) (0 want-force-vis village1 #t)) - ) - (-> s5-2 ppointer) - ) + (process-spawn + pov-camera + (-> gp-0 extra trans) + *junglecam-sg* + "tower2" + 0 + #f + '((0 ambient camera "gamcam15") (0 want-force-vis jungle #t) (0 want-force-vis village1 #t)) + :to self ) ) ((name= arg0 "periscope-12") - (let ((s5-3 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-3 - (let ((t9-11 (method-of-type pov-camera activate))) - (t9-11 (the-as pov-camera s5-3) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-3 - pov-camera-init-by-other - (-> gp-0 extra trans) - *junglecam-sg* - "tower3" - 0 - #f - '((0 ambient camera "gamcam16")) - ) - (-> s5-3 ppointer) - ) + (process-spawn + pov-camera + (-> gp-0 extra trans) + *junglecam-sg* + "tower3" + 0 + #f + '((0 ambient camera "gamcam16")) + :to self ) ) ((name= arg0 "periscope-13") - (let ((s5-4 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-4 - (let ((t9-15 (method-of-type pov-camera activate))) - (t9-15 (the-as pov-camera s5-4) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-4 - pov-camera-init-by-other - (-> gp-0 extra trans) - *junglecam-sg* - "tower4" - 0 - #f - '((0 ambient camera "gamcam17")) - ) - (-> s5-4 ppointer) - ) + (process-spawn + pov-camera + (-> gp-0 extra trans) + *junglecam-sg* + "tower4" + 0 + #f + '((0 ambient camera "gamcam17")) + :to self ) ) ((name= arg0 "periscope-14") - (let ((s5-5 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-5 - (let ((t9-19 (method-of-type pov-camera activate))) - (t9-19 (the-as pov-camera s5-5) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-5 - pov-camera-init-by-other - (-> gp-0 extra trans) - *junglecam-sg* - "tower5" - 0 - #f - '((0 ambient camera "gamcam18") (0 want-force-vis jungle #t) (0 want-force-vis village1 #t)) - ) - (-> s5-5 ppointer) - ) + (process-spawn + pov-camera + (-> gp-0 extra trans) + *junglecam-sg* + "tower5" + 0 + #f + '((0 ambient camera "gamcam18") (0 want-force-vis jungle #t) (0 want-force-vis village1 #t)) + :to self ) ) ((name= arg0 "periscope-15") - (let ((s5-6 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-6 - (let ((t9-23 (method-of-type pov-camera activate))) - (t9-23 (the-as pov-camera s5-6) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-6 - pov-camera-init-by-other - (-> gp-0 extra trans) - *junglecam-sg* - "beamcam" - 0 - #f - '((0 ambient camera "gamcam19") - (0 want-force-vis jungle #t) - (0 want-force-vis village1 #t) - (0 display-level village1 movie) - ) - ) - (-> s5-6 ppointer) + (process-spawn + pov-camera + (-> gp-0 extra trans) + *junglecam-sg* + "beamcam" + 0 + #f + '((0 ambient camera "gamcam19") + (0 want-force-vis jungle #t) + (0 want-force-vis village1 #t) + (0 display-level village1 movie) ) + :to self ) ) (else @@ -1261,8 +1159,7 @@ ) (defstate periscope-idle (periscope) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('activate) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1270,21 +1167,17 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (clear-collide-with-as (-> self root-override)) (none) ) - :exit - (behavior () + :exit (behavior () (restore-collide-with-as (-> self root-override)) (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - periscope-debug-trans - :code - (behavior () + :trans periscope-debug-trans + :code (behavior () (logior! (-> self mask) (process-mask actor-pause)) (set! (-> self raised?) #f) (set! (-> self y-offset) 0.0) @@ -1296,7 +1189,7 @@ (suspend) (update-transforms! (-> self root-override)) (logior! (-> self draw status) (draw-status hidden)) - (while #t + (loop (suspend) ) (none) @@ -1304,24 +1197,13 @@ ) (defstate periscope-activate (periscope) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self rise-sound-id)) - (sound-play-by-name - (static-sound-name "eco-tower-stop") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self base)) - ) + (sound-play "eco-tower-stop" :position (the-as symbol (-> self base))) (none) ) - :trans - periscope-debug-trans - :code - (behavior () + :trans periscope-debug-trans + :code (behavior () (local-vars (v1-13 symbol)) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1333,24 +1215,10 @@ (set! (-> self turn) (+ 18204.445 (-> self target-turn))) ) (until (and v1-13 (= (-> self turn) (-> self target-turn)) (= (-> self tilt) (-> self target-tilt))) - (sound-play-by-name - (static-sound-name "eco-tower-rise") - (-> self rise-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self base)) - ) - (set! (-> self y-offset) - (seek (-> self y-offset) (-> self height) (* 16384.0 (-> *display* seconds-per-frame))) - ) - (set! (-> self turn) - (seek (-> self turn) (-> self target-turn) (* 7281.778 (-> *display* seconds-per-frame))) - ) - (set! (-> self tilt) - (seek (-> self tilt) (-> self target-tilt) (* 7281.778 (-> *display* seconds-per-frame))) - ) + (sound-play "eco-tower-rise" :id (-> self rise-sound-id) :position (the-as symbol (-> self base))) + (seek! (-> self y-offset) (-> self height) (* 16384.0 (-> *display* seconds-per-frame))) + (seek! (-> self turn) (-> self target-turn) (* 7281.778 (-> *display* seconds-per-frame))) + (seek! (-> self tilt) (-> self target-tilt) (* 7281.778 (-> *display* seconds-per-frame))) (set! (-> self raised?) (< (+ -12288.0 (-> self height)) (-> self y-offset))) (periscope-update-joints) (suspend) @@ -1360,27 +1228,23 @@ (go periscope-wait-for-power-input) (none) ) - :post - periscope-post + :post periscope-post ) (defstate periscope-wait-for-power-input (periscope) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self raised?) #t) (let ((f30-0 (+ -20480.0 (-> self height)))) (until (= (-> self y-offset-grips) f30-0) - (set! (-> self y-offset-grips) - (seek (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) (periscope-update-joints) (suspend) ) ) (update-transforms! (-> self root-override)) (set! (-> self y-offset) (-> self height)) - (while #t + (loop (if (periscope-has-power-input?) (go periscope-wait-for-player) ) @@ -1388,8 +1252,7 @@ ) (none) ) - :post - (the-as (function none :behavior periscope) ja-post) + :post (the-as (function none :behavior periscope) ja-post) ) (defun target-close-to-point? ((arg0 vector) (arg1 float)) @@ -1397,12 +1260,11 @@ ) (defstate periscope-wait-for-player (periscope) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) @@ -1430,13 +1292,11 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self grips-sound-id)) (none) ) - :code - (behavior () + :code (behavior () (hide-hud) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self raised?) #t) @@ -1448,18 +1308,8 @@ (if (nonzero? gp-0) (level-hint-spawn (game-text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) ) - (sound-play-by-name - (static-sound-name "site-moves") - (-> self grips-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self grips transform)) - ) - (set! (-> self y-offset-grips) - (seek (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) - ) + (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) + (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) (periscope-update-joints) (suspend) ) @@ -1471,17 +1321,15 @@ (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) - (while #t + (loop (set! (-> s5-0 quad) (-> self node-list data 4 bone transform vector 3 quad)) (let ((a0-10 s5-0) (f30-1 81920.0) ) (when (and *target* (>= f30-1 (vector-vector-distance a0-10 (-> *target* control trans)))) - (when (logtest? (-> *target* control status) 1) + (when (logtest? (-> *target* control status) (cshape-moving-flags onsurf)) (let ((f0-7 (fmax 4096.0 (fmin 12288.0 (+ (- 5120.0 (-> self base y)) (-> *target* control trans y)))))) - (set! (-> self y-offset-grips) - (seek (-> self y-offset-grips) f0-7 (* 16384.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self y-offset-grips) f0-7 (* 16384.0 (-> *display* seconds-per-frame))) ) ) (vector-! gp-1 (target-pos 0) (-> self base)) @@ -1517,7 +1365,7 @@ ) (when (cpad-pressed? 0 circle) (set! (-> self grips-moving?) #f) - (while #t + (loop (send-event *target* 'change-mode 'periscope self) (hide-hud) (suspend) @@ -1537,18 +1385,9 @@ ) (none) ) - :post - (behavior () + :post (behavior () (if (-> self grips-moving?) - (sound-play-by-name - (static-sound-name "site-moves") - (-> self grips-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self grips transform)) - ) + (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) (sound-stop (-> self grips-sound-id)) ) (periscope-draw-beam-impact) @@ -1558,21 +1397,18 @@ ) (defstate periscope-player-control (periscope) - :exit - (behavior () + :exit (behavior () (logclear! (-> self reflector 0 draw status) (draw-status hidden)) (periscope-find-reflection-angles) (set! (-> self turn) (-> self target-turn)) (set! (-> self tilt) (-> self target-tilt)) (none) ) - :trans - (behavior () + :trans (behavior () (hide-hud) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self lock-time) (-> *display* base-frame-counter)) (link-to-next-and-prev-actor (-> self link)) (periscope-find-next) @@ -1679,7 +1515,7 @@ (send-event *camera* 'change-state cam-periscope 0) (logior! (-> self reflector 0 draw status) (draw-status hidden)) (suspend) - (while #t + (loop (if (not (-> self aligned?)) (set! (-> self lock-time) (-> *display* base-frame-counter)) ) @@ -1691,93 +1527,81 @@ (if (periscope-test-task-complete?) (close-specific-task! (game-task jungle-lurkerm) (task-status need-reminder)) ) - (while #t - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 0) - (set! (-> a1-6 message) 'end-mode) - (when (send-event-function *target* a1-6) - (cond - ((and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) - (let ((gp-1 (ppointer->handle (peri-beamcam-init-by-other (the-as string (-> self name)))))) + (loop + (when (send-event *target* 'end-mode) + (cond + ((and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) + (let ((gp-1 (ppointer->handle (peri-beamcam-init-by-other (the-as string (-> self name)))))) + (suspend) + (while (and *target* (= (-> *target* next-state name) 'target-periscope)) + (periscope-crosshair) (suspend) - (while (and *target* (= (-> *target* next-state name) 'target-periscope)) - (periscope-crosshair) - (suspend) - ) - (logclear! (-> self reflector 0 draw status) (draw-status hidden)) - (periscope-find-reflection-angles) - (set! (-> self turn) (-> self target-turn)) - (set! (-> self tilt) (-> self target-tilt)) - (set! *camera-init-mat* (-> self old-camera-matrix)) - (send-event *camera* 'change-state *camera-base-mode* 0) - (set! *camera-init-mat* #f) - (while (handle->process (the-as handle gp-1)) - (suspend) - ) ) - (let ((gp-2 (get-process *default-dead-pool* process #x4000))) - (when gp-2 - (let ((t9-18 (method-of-type process activate))) - (t9-18 gp-2 self 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process - gp-2 - (lambda ((arg0 string)) - (while (or (-> *setting-control* current ambient) - (-> *setting-control* current movie) - (-> *setting-control* current hint) - ) - (suspend) - ) - (cond - ((name= arg0 "periscope-11") - (level-hint-spawn - (game-text-id jungle-mirrors-follow-the-beam) - "sksp0053" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((name= arg0 "periscope-12") - (level-hint-spawn - (game-text-id jungle-mirrors-go-to-the-next-tower) - "sksp0052" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((name= arg0 "periscope-15") - (level-hint-spawn - (game-text-id jungle-mirrors-completion-talk-to-mayor) - "sksp0018" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ) - (none) - ) - (-> self name) - ) - (-> gp-2 ppointer) - ) + (logclear! (-> self reflector 0 draw status) (draw-status hidden)) + (periscope-find-reflection-angles) + (set! (-> self turn) (-> self target-turn)) + (set! (-> self tilt) (-> self target-tilt)) + (set! *camera-init-mat* (-> self old-camera-matrix)) + (send-event *camera* 'change-state *camera-base-mode* 0) + (set! *camera-init-mat* #f) + (while (handle->process (the-as handle gp-1)) + (suspend) ) ) - (else - (set! *camera-init-mat* (-> self old-camera-matrix)) - (send-event *camera* 'change-state *camera-base-mode* 0) - (set! *camera-init-mat* #f) - ) + (process-spawn-function + process + (lambda ((arg0 string)) + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current movie) + (-> *setting-control* current hint) + ) + (suspend) + ) + (cond + ((name= arg0 "periscope-11") + (level-hint-spawn + (game-text-id jungle-mirrors-follow-the-beam) + "sksp0053" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((name= arg0 "periscope-12") + (level-hint-spawn + (game-text-id jungle-mirrors-go-to-the-next-tower) + "sksp0052" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((name= arg0 "periscope-15") + (level-hint-spawn + (game-text-id jungle-mirrors-completion-talk-to-mayor) + "sksp0018" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ) + (none) + ) + (-> self name) + :to self + ) + ) + (else + (set! *camera-init-mat* (-> self old-camera-matrix)) + (send-event *camera* 'change-state *camera-base-mode* 0) + (set! *camera-init-mat* #f) ) - (if (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) - (go periscope-power-on) - (go periscope-wait-for-player) - ) ) + (if (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) + (go periscope-power-on) + (go periscope-wait-for-player) + ) ) (suspend) ) @@ -1786,8 +1610,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (periscope-draw-beam) (periscope-update-joints) (ja-post) @@ -1796,10 +1619,8 @@ ) (defstate periscope-power-on (periscope) - :trans - periscope-debug-trans - :code - (behavior () + :trans periscope-debug-trans + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self y-offset) (-> self height)) (link-to-next-and-prev-actor (-> self link)) @@ -1808,31 +1629,20 @@ (set! (-> self tilt) (-> self target-tilt)) (let ((f30-0 (+ -20480.0 (-> self height)))) (until (= (-> self y-offset-grips) f30-0) - (set! (-> self y-offset-grips) - (seek (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) (periscope-update-joints) - (sound-play-by-name - (static-sound-name "site-moves") - (-> self grips-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self grips transform)) - ) + (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) (suspend) ) ) (sound-stop (-> self grips-sound-id)) (ja-post) - (while #t + (loop (suspend) ) (none) ) - :post - periscope-post + :post periscope-post ) (defmethod init-from-entity! periscope ((obj periscope) (arg0 entity-actor)) @@ -1883,18 +1693,7 @@ (set! (-> obj base quad) (-> obj root-override trans quad)) (set! (-> obj reflector-trans quad) (-> obj base quad)) (+! (-> obj reflector-trans y) (-> obj height)) - (let ((s5-1 (get-process *default-dead-pool* reflector #x4000))) - (set! (-> obj reflector) - (the-as (pointer reflector) (when s5-1 - (let ((t9-14 (method-of-type reflector activate))) - (t9-14 (the-as reflector s5-1) obj 'reflector (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 reflector-init-by-other (-> obj reflector-trans)) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> obj reflector) (process-spawn reflector (-> obj reflector-trans) :to obj)) (set! (-> obj link) (new 'process 'actor-link-info obj)) (periscope-find-next) (initialize-skeleton obj *periscope-base-sg* '()) @@ -1908,19 +1707,8 @@ (periscope-update-joints) (set! (-> obj grips-moving?) #f) (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "eco-beam") - :volume #x400 - :fo-max 50 - ) - (-> obj reflector-trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "eco-beam" :fo-max 50) (-> obj reflector-trans)) ) (set! (-> obj rise-sound-id) (new-sound-id)) (set! (-> obj grips-sound-id) (new-sound-id)) @@ -1951,8 +1739,7 @@ ) (defstate reflector-origin-idle (reflector-origin) - :code - (behavior () + :code (behavior () (reflector-origin-update (-> self blocker)) (while (zero? (logand (-> self blocker extra perm status) (entity-perm-status complete))) (suspend) @@ -1991,13 +1778,12 @@ ) (process-entity-status! self (entity-perm-status complete) #t) (reflector-origin-update (-> self link next)) - (while #t + (loop (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (draw-power-beam (-> self reflector-trans) (-> self next-reflector-trans)) (none) ) @@ -2015,37 +1801,27 @@ ) (defstate reflector-mirror-idle (reflector-mirror) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) - (sound-play-by-name (static-sound-name "mirror-smash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "mirror-smash") (go reflector-mirror-broken #f) ) ) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (new-stack-vector0))) (set! (-> gp-0 quad) (-> self root-override trans quad)) (set! (-> gp-0 y) (+ 49152.0 (-> gp-0 y))) - (while #t + (loop (draw-power-beam gp-0 (-> self beam-end)) (update! (-> self sound)) (when (logtest? (-> self draw status) (draw-status was-drawn)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 825) - (-> self beam-end) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 825) (-> self beam-end)) (when (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (start-hint-timer (game-text-id jungle-mirrors-break-the-mirror-jak)) (level-hint-spawn @@ -2062,13 +1838,11 @@ ) (none) ) - :post - (the-as (function none :behavior reflector-mirror) ja-post) + :post (the-as (function none :behavior reflector-mirror) ja-post) ) (defstate reflector-mirror-broken (reflector-mirror) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) @@ -2096,23 +1870,8 @@ ) (when (not arg0) (ambient-hint-spawn "gamcam21" (the-as vector #f) *entity-pool* 'camera) - (let* ((gp-1 (get-process *default-dead-pool* manipy #x4000)) - (v1-11 (when gp-1 - (let ((t9-8 (method-of-type manipy activate))) - (t9-8 (the-as manipy gp-1) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - manipy-init - (-> self root-override trans) - (-> self entity) - *reflector-mirror-break-sg* - #f - ) - (-> gp-1 ppointer) - ) - ) - ) + (let ((v1-11 (manipy-spawn (-> self root-override trans) (-> self entity) *reflector-mirror-break-sg* #f :to self)) + ) (send-event (ppointer->process v1-11) 'anim-mode 'play1) ) (let ((gp-2 (-> *display* base-frame-counter))) @@ -2133,7 +1892,7 @@ ) ) (logior! (-> self mask) (process-mask actor-pause)) - (while #t + (loop (suspend) ) (none) @@ -2183,19 +1942,8 @@ (set! (-> obj link) (new 'process 'actor-link-info obj)) (initialize-skeleton obj *reflector-mirror-sg* '()) (set-vector! (-> obj beam-end) 1805721.6 167936.0 -932659.2 1.0) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "eco-beam") - :volume #x400 - :fo-max 50 - ) - (-> obj beam-end) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "eco-beam" :fo-max 50) (-> obj beam-end)) ) (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) (go reflector-mirror-broken #t) @@ -2218,7 +1966,7 @@ (collide-kind target) (the-as process #f) t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/goal_src/levels/jungle/jungle-obs.gc b/goal_src/levels/jungle/jungle-obs.gc index 72e4aa33e7..e84d2d17f9 100644 --- a/goal_src/levels/jungle/jungle-obs.gc +++ b/goal_src/levels/jungle/jungle-obs.gc @@ -5,49 +5,30 @@ ;; name in dgo: jungle-obs ;; dgos: JUN, JUNGLE, L1 -(define-extern *jngpusher-sg* skeleton-group) -(define-extern *sidedoor-sg* skeleton-group) -(define-extern *maindoor-sg* skeleton-group) -(define-extern *precurbridge-sg* skeleton-group) -(define-extern *junglecam-sg* skeleton-group) -(define-extern *accordian-sg* skeleton-group) -(define-extern *lurkerm-piston-sg* skeleton-group) -(define-extern *lurkerm-short-sail-sg* skeleton-group) -(define-extern *lurkerm-tall-sail-sg* skeleton-group) -(define-extern *towertop-sg* skeleton-group) -(define-extern *logtrap-sg* skeleton-group) -(define-extern *med-res-firecanyon-sg* skeleton-group) -(define-extern *jungle-camera-sg* skeleton-group) - -(declare-type towertop process-drawable) -(declare-type lurkerm-tall-sail process-drawable) -(declare-type lurkerm-short-sail process-drawable) -(declare-type lurkerm-piston process-drawable) -(declare-type accordian process-drawable) -(declare-type precurbridge process-drawable) -(declare-type precurbridge process-drawable) -(declare-type maindoor process-drawable) -(declare-type jngpusher process-drawable) - - ;; DECOMP BEGINS -(defskelgroup *med-res-firecanyon-sg* medres-firecanyon - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -200 0 -440 530) - :longest-edge (meters 0.01) - ) +(import "goal_src/import/maindoor-ag.gc") +(import "goal_src/import/junglecam-ag.gc") +(import "goal_src/import/precurbridge-ag.gc") +(import "goal_src/import/sidedoor-ag.gc") +(import "goal_src/import/towertop-ag.gc") +(import "goal_src/import/logtrap-ag.gc") +(import "goal_src/import/lurkerm-tall-sail-ag.gc") +(import "goal_src/import/medres-firecanyon-ag.gc") +(import "goal_src/import/lurkerm-piston-ag.gc") +(import "goal_src/import/accordian-ag.gc") -(defskelgroup *jungle-camera-sg* jungle-camera - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *med-res-firecanyon-sg* medres-firecanyon medres-firecanyon-lod0-jg medres-firecanyon-idle-ja + ((medres-firecanyon-lod0-mg (meters 999999))) + :bounds (static-spherem -200 0 -440 530) + :longest-edge (meters 0.01) + ) + +(defskelgroup *jungle-camera-sg* jungle-camera 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :texture-level 2 + ) (deftype logtrap (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -62,36 +43,24 @@ ) -(defskelgroup *logtrap-sg* logtrap - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 8 0 13) - :longest-edge (meters 6) - :shadow 3 - ) +(defskelgroup *logtrap-sg* logtrap logtrap-lod0-jg logtrap-idle-ja + ((logtrap-lod0-mg (meters 20)) (logtrap-lod1-mg (meters 999999))) + :bounds (static-spherem 0 8 0 13) + :longest-edge (meters 6) + :shadow logtrap-shadow-mg + ) (defstate idle (logtrap) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (or (= arg2 'touch) (= arg2 'attack)) (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) ) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (logtest? (-> self draw status) (draw-status was-drawn)) (cond @@ -107,11 +76,7 @@ ) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) @@ -159,40 +124,23 @@ ) -(defskelgroup *towertop-sg* towertop - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *towertop-sg* towertop towertop-lod0-jg towertop-idle-ja + ((towertop-lod0-mg (meters 20)) (towertop-lod1-mg (meters 40)) (towertop-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) (defstate towertop-idle (towertop) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 0.4) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max 0.4) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 0.4) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.4)) ) ) (none) ) - :post - (the-as (function none :behavior towertop) ja-post) + :post (the-as (function none :behavior towertop) ja-post) ) (defmethod init-from-entity! towertop ((obj towertop) (arg0 entity-actor)) @@ -220,17 +168,17 @@ ) -(defskelgroup *lurkerm-tall-sail-sg* lurkerm-tall-sail - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 5 0 7) - :longest-edge (meters 4) - ) +(defskelgroup *lurkerm-tall-sail-sg* lurkerm-tall-sail lurkerm-tall-sail-lod0-jg lurkerm-tall-sail-idle-ja + ((lurkerm-tall-sail-lod0-mg (meters 20)) + (lurkerm-tall-sail-lod1-mg (meters 40)) + (lurkerm-tall-sail-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 5 0 7) + :longest-edge (meters 4) + ) (defstate lurkerm-tall-sail-idle (lurkerm-tall-sail) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'stop) (process-entity-status! self (entity-perm-status complete) #t) @@ -242,20 +190,10 @@ ) ) ) - :trans - (the-as (function none :behavior lurkerm-tall-sail) rider-trans) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) (* 0.5 (-> self speed))) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :trans (the-as (function none :behavior lurkerm-tall-sail) rider-trans) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-local-y! (-> self root-override quat) @@ -263,17 +201,12 @@ (* 12743.111 (-> *display* seconds-per-frame) (-> self speed)) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) (* 0.5 (-> self speed))) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (* 0.5 (-> self speed)))) ) ) (none) ) - :post - (the-as (function none :behavior lurkerm-tall-sail) rider-post) + :post (the-as (function none :behavior lurkerm-tall-sail) rider-post) ) (defmethod init-from-entity! lurkerm-tall-sail ((obj lurkerm-tall-sail) (arg0 entity-actor)) @@ -334,17 +267,13 @@ ) -(defskelgroup *lurkerm-short-sail-sg* lurkerm-short-sail - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 5 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *lurkerm-short-sail-sg* lurkerm-short-sail 0 4 + ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) + :bounds (static-spherem 0 5 0 9) + ) (defstate lurkerm-short-sail-idle (lurkerm-short-sail) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'stop) (process-entity-status! self (entity-perm-status complete) #t) @@ -356,20 +285,10 @@ ) ) ) - :trans - (the-as (function none :behavior lurkerm-short-sail) rider-trans) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) (* 0.5 (-> self speed))) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :trans (the-as (function none :behavior lurkerm-short-sail) rider-trans) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-local-y! (-> self root-override quat) @@ -377,17 +296,12 @@ (* -12743.111 (-> *display* seconds-per-frame) (-> self speed)) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) (* 0.5 (-> self speed))) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (* 0.5 (-> self speed)))) ) ) (none) ) - :post - (the-as (function none :behavior lurkerm-short-sail) rider-post) + :post (the-as (function none :behavior lurkerm-short-sail) rider-post) ) (defmethod init-from-entity! lurkerm-short-sail ((obj lurkerm-short-sail) (arg0 entity-actor)) @@ -468,17 +382,13 @@ ) -(defskelgroup *lurkerm-piston-sg* lurkerm-piston - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *lurkerm-piston-sg* lurkerm-piston lurkerm-piston-geo-jg lurkerm-piston-idle-ja + ((lurkerm-piston-geo-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) (defstate lurkerm-piston-idle (lurkerm-piston) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'stop) (process-entity-status! self (entity-perm-status complete) #t) @@ -490,20 +400,10 @@ ) ) ) - :trans - (the-as (function none :behavior lurkerm-piston) rider-trans) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) (-> self speed)) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + :trans (the-as (function none :behavior lurkerm-piston) rider-trans) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! max (-> self speed)) :frame-num 0.0) (until (ja-done? 0) (let ((gp-0 (new-stack-vector0))) (set! (-> gp-0 quad) (-> self base quad)) @@ -511,17 +411,12 @@ (move-to-point! (-> self root-override) gp-0) ) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) (-> self speed)) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self speed))) ) ) (none) ) - :post - (the-as (function none :behavior lurkerm-piston) rider-post) + :post (the-as (function none :behavior lurkerm-piston) rider-post) ) (defmethod init-from-entity! lurkerm-piston ((obj lurkerm-piston) (arg0 entity-actor)) @@ -601,17 +496,14 @@ ) -(defskelgroup *accordian-sg* accordian - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem -7 0 23 25) - :longest-edge (meters 4) - ) +(defskelgroup *accordian-sg* accordian accordian-lod0-jg accordian-idle-ja + ((accordian-lod0-mg (meters 20)) (accordian-lod1-mg (meters 999999))) + :bounds (static-spherem -7 0 23 25) + :longest-edge (meters 4) + ) (defstate accordian-idle (accordian) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'stop) (process-entity-status! self (entity-perm-status complete) #t) @@ -623,21 +515,13 @@ ) ) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + :code (behavior () + (ja-no-eval :num! (loop!) :frame-num 0.0) (ja-post) - (while #t + (loop (suspend) (when (logtest? (-> self draw status) (draw-status was-drawn)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (-> self speed)) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! (-> self speed))) (ja-post) ) ) @@ -659,13 +543,10 @@ (none) ) -(defskelgroup *junglecam-sg* junglecam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 80) - :longest-edge (meters 0) - ) +(defskelgroup *junglecam-sg* junglecam junglecam-lod0-jg junglecam-beamcam-ja + ((junglecam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) (deftype junglecam (process-hidden) () @@ -686,33 +567,16 @@ (defstate pov-camera-playing (precurbridgecam) :virtual #t - :code - (behavior () + :code (behavior () (ambient-hint-spawn "gamcam30" (the-as vector #f) *entity-pool* 'camera) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - ) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> gp-0 param 0) (ja-aframe 0.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja :group! (-> self draw art-group data 8)) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek! (ja-aframe 0.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 0.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 0.0 0))) ) (send-event (ppointer->process (-> self parent)) 'go) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) @@ -749,88 +613,63 @@ ) -(defskelgroup *precurbridge-sg* precurbridge - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 40) - :longest-edge (meters 3.6) - ) +(defskelgroup *precurbridge-sg* precurbridge precurbridge-geo-jg precurbridge-idle-ja + ((precurbridge-geo-mg (meters 20)) (precurbridge-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 40) + :longest-edge (meters 3.6) + ) (defstate precurbridge-idle (precurbridge) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('go) (go precurbridge-activate) ) ) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 3) :num! min) (transform-post) - (while #t + (loop (when (and *target* (< (vector-vector-xz-distance (-> self activation-point) (-> *target* control trans)) 49152.0) (< (-> self activation-point y) (-> *target* control trans y)) (< (-> *target* control trans y) (+ 20480.0 (-> self activation-point y))) (not (-> self child)) ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'powerup)) - (set! (-> a1-2 param 1) (the-as uint 3)) - (cond - ((send-event-function *target* a1-2) - (logclear! (-> self mask) (process-mask actor-pause)) - (logclear! (-> self mask) (process-mask platform)) - (let ((gp-1 (entity-by-name "junglecam-1"))) - (cond - (gp-1 - (let ((s5-0 (get-process *default-dead-pool* precurbridgecam #x4000))) - (when s5-0 - (let ((t9-6 (method-of-type precurbridgecam activate))) - (t9-6 (the-as precurbridgecam s5-0) self 'precurbridgecam (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> gp-1 extra trans) - *junglecam-sg* - "precurbridgecam" - 0 - #f - '() - ) - (-> s5-0 ppointer) - ) - ) - ) - (else - (format #t "ERROR: position for precursor bridge camera not found~%") - (go precurbridge-activate) + (cond + ((send-event *target* 'query 'powerup (pickup-type eco-blue)) + (logclear! (-> self mask) (process-mask actor-pause)) + (logclear! (-> self mask) (process-mask platform)) + (let ((gp-1 (entity-by-name "junglecam-1"))) + (cond + (gp-1 + (process-spawn + precurbridgecam + :init pov-camera-init-by-other + (-> gp-1 extra trans) + *junglecam-sg* + "precurbridgecam" + 0 + #f + '() + :to self ) ) + (else + (format #t "ERROR: position for precursor bridge camera not found~%") + (go precurbridge-activate) + ) ) ) - (else - (level-hint-spawn - (game-text-id jungle-precursorbridge-hint) - "sksp0039" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + ) + (else + (level-hint-spawn + (game-text-id jungle-precursorbridge-hint) + "sksp0039" + (the-as entity #f) + *entity-pool* + (game-task none) ) ) ) @@ -839,60 +678,34 @@ ) (none) ) - :post - (the-as (function none :behavior precurbridge) ja-post) + :post (the-as (function none :behavior precurbridge) ja-post) ) (defstate precurbridge-activate (precurbridge) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (the-as (function none :behavior precurbridge) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior precurbridge) rider-trans) + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 0.25) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.25) :frame-num 0.0) (until (ja-done? 0) (if (rand-vu-percent? 0.1) (spawn-projectile-blue *target*) ) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 0.25) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.25)) ) (go precurbridge-active #f) (none) ) - :post - (the-as (function none :behavior precurbridge) rider-post) + :post (the-as (function none :behavior precurbridge) rider-post) ) (defstate precurbridge-active (precurbridge) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -909,78 +722,41 @@ ) ) ) - :trans - (the-as (function none :behavior precurbridge) rider-trans) - :code - (behavior ((arg0 symbol)) + :trans (the-as (function none :behavior precurbridge) rider-trans) + :code (behavior ((arg0 symbol)) (set! (-> self draw bounds w) 81920.0) (when arg0 (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 4) :num! min) ) (ja-post) (update-transforms! (-> self root-override)) (logior! (-> self mask) (process-mask actor-pause)) - (while #t + (loop (if (not (movie?)) (set! (-> self mask) (logior (process-mask platform) (-> self mask))) ) (cond ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - ) - (ja-channel-push! 1 60) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (when (not (ja-group? (-> self draw art-group data 5))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 5) :num! min) ) ) (else - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 4) - ) - ) - (ja-channel-push! 1 60) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) + (when (not (ja-group? (-> self draw art-group data 4))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 4) :num! min) ) ) ) (update! (-> self sound)) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) 0.4) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! 0.4)) (suspend) ) (none) ) - :post - (the-as (function none :behavior precurbridge) rider-post) + :post (the-as (function none :behavior precurbridge) rider-post) ) (defmethod init-from-entity! precurbridge ((obj precurbridge) (arg0 entity-actor)) @@ -1184,44 +960,29 @@ ) -(defskelgroup *maindoor-sg* maindoor - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *maindoor-sg* maindoor maindoor-lod0-jg maindoor-idle-ja + ((maindoor-lod0-mg (meters 20)) (maindoor-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + ) (defstate maindoor-closed (maindoor) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (set! (-> self draw force-lod) 1) (logclear! (-> self draw status) (draw-status hidden)) - (when arg0 - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 num-func) num-func-identity) - (set! (-> v1-6 frame-num) 0.0) + (if arg0 + (ja :num-func num-func-identity :frame-num 0.0) ) - ) (suspend) (update-transforms! (-> self root-override)) - (while #t + (loop (when (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) (and (and *target* (>= (-> self thresh w) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) (go maindoor-open #f) ) (if (and *target* @@ -1239,11 +1000,7 @@ (set! (-> self root-override root-prim prim-core action) (collide-action solid)) (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) 0.0) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) (ja-post) (suspend) ) @@ -1252,38 +1009,29 @@ ) (defstate maindoor-open (maindoor) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (set! (-> self draw force-lod) 0) (logclear! (-> self draw status) (draw-status hidden)) (process-entity-status! self (entity-perm-status complete) #t) - (when arg0 - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 num-func) num-func-identity) - (set! (-> v1-6 frame-num) (the float (+ (-> v1-6 frame-group data 0 length) -1))) + (if arg0 + (ja :num-func num-func-identity :frame-num max) ) - ) (set! (-> self root-override root-prim prim-core action) (collide-action)) (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) (while (not (ja-max? 0)) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 2.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 2.0)) (if (and (not arg0) (rand-vu-percent? 0.2)) (spawn-projectile-blue *target*) ) (suspend) ) (logior! (-> self draw status) (draw-status hidden)) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior maindoor) ja-post) + :post (the-as (function none :behavior maindoor) ja-post) ) (defmethod init-from-entity! maindoor ((obj maindoor) (arg0 entity-actor)) @@ -1309,7 +1057,7 @@ (and (and *target* (>= (-> obj thresh w) (vector-vector-distance (-> obj root-override trans) (-> *target* control trans))) ) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) (go maindoor-open #t) @@ -1327,13 +1075,10 @@ ) -(defskelgroup *sidedoor-sg* sidedoor - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *sidedoor-sg* sidedoor sidedoor-geo-jg sidedoor-idle-ja + ((sidedoor-geo-mg (meters 20)) (sidedoor-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) (defmethod TODO-RENAME-24 sidedoor ((obj sidedoor)) (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) @@ -1389,24 +1134,15 @@ ) ) -(defskelgroup *jngpusher-sg* jngpusher - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *jngpusher-sg* jngpusher 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 10)) (defstate jngpusher-idle (jngpusher) - :trans - (the-as (function none :behavior jngpusher) rider-trans) - :code - (behavior () - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 num-func) num-func-identity) - (set! (-> gp-0 frame-num) (get-current-value-with-mirror (-> self sync) (the float (ja-num-frames 0)))) - ) + :trans (the-as (function none :behavior jngpusher) rider-trans) + :code (behavior () + (loop + (ja :num-func num-func-identity + :frame-num (get-current-value-with-mirror (-> self sync) (the float (ja-num-frames 0))) + ) (cond ((< (ja-frame-num 0) (the float (/ (ja-num-frames 0) 3))) (set! (-> self back-prim prim-core collide-as) (collide-kind)) @@ -1422,8 +1158,7 @@ ) (none) ) - :post - (the-as (function none :behavior jngpusher) rider-post) + :post (the-as (function none :behavior jngpusher) rider-post) ) (defmethod init-from-entity! jngpusher ((obj jngpusher) (arg0 entity-actor)) @@ -1485,8 +1220,7 @@ :count 3 :converted #f :normal-scale 1.5 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 30.0 :xdiv -2 :speed 4.0) (new 'static 'ripple-wave :scale 30.0 :xdiv 1 :zdiv -1 :speed 4.0) (new 'static 'ripple-wave :scale 10.0 :xdiv -5 :zdiv -3 :speed 2.0) diff --git a/goal_src/levels/jungle/jungle-part.gc b/goal_src/levels/jungle/jungle-part.gc index cb95816309..3bd790b629 100644 --- a/goal_src/levels/jungle/jungle-part.gc +++ b/goal_src/levels/jungle/jungle-part.gc @@ -17,8 +17,7 @@ (defpart 833 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.9 0.9 1.0) (sp-rnd-flt spt-x (meters -8) (meters 4) 1.0) (sp-flt spt-y (meters 47.5)) @@ -43,8 +42,7 @@ ) (defpart 834 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters 6) (meters 6) 1.0) (sp-flt spt-y (meters -6.5)) @@ -71,8 +69,7 @@ ) (defpart 835 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 1) 1.0) @@ -97,8 +94,7 @@ ) (defpart 836 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -8) (meters 4) 1.0) (sp-flt spt-y (meters 47.5)) @@ -124,8 +120,7 @@ ) (defpart 837 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.4 1.0) (sp-rnd-flt spt-x (meters -7) (meters 3.5) 1.0) (sp-flt spt-y (meters 47.5)) @@ -151,8 +146,7 @@ ) (defpart 838 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.8 0.8 1.0) (sp-rnd-flt spt-x (meters -10) (meters 4) 1.0) (sp-flt spt-y (meters 20)) @@ -178,8 +172,7 @@ ) (defpart 839 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.6 0.4 1.0) (sp-rnd-flt spt-x (meters -9) (meters 3.5) 1.0) (sp-flt spt-y (meters 20)) @@ -206,8 +199,7 @@ ) (defpart 840 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 4) 1.0) (sp-flt spt-y (meters 20)) @@ -234,8 +226,7 @@ ) (defpart 841 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters 0) (meters 6) 1.0) (sp-flt spt-y (meters -4.5)) @@ -263,8 +254,7 @@ ) (defpart 842 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters 1) (meters 7) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 1) 1.0) @@ -290,8 +280,7 @@ ) (defpart 843 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 1.0 0.6 1.0) (sp-rnd-flt spt-x (meters -9) (meters 4) 1.0) (sp-flt spt-y (meters 20)) @@ -317,8 +306,7 @@ ) (defpart 844 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.9 0.4 1.0) (sp-rnd-flt spt-x (meters -8) (meters 3.5) 1.0) (sp-flt spt-y (meters 20)) @@ -345,8 +333,7 @@ ) (defpart 845 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -9) (meters 4) 1.0) (sp-flt spt-y (meters 20)) @@ -373,8 +360,7 @@ ) (defpart 846 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters 0) (meters 6) 1.0) (sp-flt spt-y (meters -3.4)) @@ -402,8 +388,7 @@ ) (defpart 847 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 7) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 1) 1.0) @@ -429,8 +414,7 @@ ) (defpart 848 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.8 0.8 1.0) (sp-rnd-flt spt-x (meters -12) (meters 4) 1.0) (sp-flt spt-y (meters 25)) @@ -456,8 +440,7 @@ ) (defpart 849 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.6 0.4 1.0) (sp-rnd-flt spt-x (meters -11) (meters 3.5) 1.0) (sp-flt spt-y (meters 25)) @@ -484,8 +467,7 @@ ) (defpart 850 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -12) (meters 4) 1.0) (sp-flt spt-y (meters 25)) @@ -512,8 +494,7 @@ ) (defpart 851 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters -3) (meters 6) 1.0) (sp-flt spt-y (meters -4.5)) @@ -541,8 +522,7 @@ ) (defpart 852 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2) (meters 7) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 1) 1.0) @@ -571,8 +551,7 @@ :id 180 :flags (always-draw) :bounds (static-bspherem 0 25 0 100) - :parts - ((sp-item 833) + :parts ((sp-item 833) (sp-item 833 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 834) (sp-item 834 :fade-after (meters 120) :falloff-to (meters 120)) @@ -586,8 +565,7 @@ :id 181 :flags (always-draw) :bounds (static-bspherem 2 9 4 90) - :parts - ((sp-item 838) + :parts ((sp-item 838) (sp-item 838 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 841) (sp-item 841 :fade-after (meters 120) :falloff-to (meters 120)) @@ -601,8 +579,7 @@ :id 182 :flags (always-draw) :bounds (static-bspherem 0 8 0 90) - :parts - ((sp-item 843) + :parts ((sp-item 843) (sp-item 843 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 846) (sp-item 846 :fade-after (meters 120) :falloff-to (meters 120)) @@ -616,8 +593,7 @@ :id 183 :flags (always-draw) :bounds (static-bspherem 0 10 8 90) - :parts - ((sp-item 848) + :parts ((sp-item 848) (sp-item 848 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 851) (sp-item 851 :fade-after (meters 120) :falloff-to (meters 120)) @@ -628,8 +604,7 @@ ) (defpart 853 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -70) (meters 100) 1.0) (sp-rnd-flt spt-y (meters 3.5) (meters 4) 1.0) @@ -652,8 +627,7 @@ ) (defpart 854 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) @@ -665,8 +639,7 @@ ) (defpart 855 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0023333333)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0023333333)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r -0.64) (sp-flt spt-fade-g -0.85333335) @@ -677,8 +650,7 @@ ) (defpart 856 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) @@ -688,8 +660,7 @@ ) (defpart 857 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.0023333333)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.0023333333)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.64) (sp-flt spt-fade-g 0.85333335) @@ -699,8 +670,7 @@ ) (defpart 858 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) @@ -712,8 +682,7 @@ ) (defpart 859 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0023333333)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0023333333)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r -0.64) (sp-flt spt-fade-g -0.85333335) @@ -724,8 +693,7 @@ ) (defpart 860 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) @@ -735,8 +703,7 @@ ) (defpart 861 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.0023333333)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.0023333333)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.64) (sp-flt spt-fade-g 0.85333335) @@ -746,8 +713,7 @@ ) (defpart 862 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) @@ -759,8 +725,7 @@ ) (defpart 863 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) @@ -769,8 +734,7 @@ ) (defpart 864 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.02) (sp-rnd-flt spt-x (meters -55) (meters 75) 1.0) (sp-flt spt-y (meters 28)) @@ -796,15 +760,13 @@ ) (defpart 865 - :init-specs - ((sp-flt spt-fade-a -0.02)) + :init-specs ((sp-flt spt-fade-a -0.02)) ) (defpartgroup group-jungle-dapple-light-1 :id 184 :bounds (static-bspherem 0 0 0 55) - :parts - ((sp-item 864 :hour-mask #b111111100000000000111111) + :parts ((sp-item 864 :hour-mask #b111111100000000000111111) (sp-item 853 :fade-after (meters 130) :falloff-to (meters 160) :hour-mask #b11111111111000000) ) ) @@ -812,8 +774,7 @@ (defpartgroup group-jungle-tower-spewer :id 185 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 866 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 866 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 866 :fade-after (meters 50) :falloff-to (meters 50)) (sp-item 867 :fade-after (meters 300) :falloff-to (meters 300)) (sp-item 868 :fade-after (meters 400) :falloff-to (meters 400)) @@ -821,8 +782,7 @@ ) (defpart 866 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.25 1.0 1.0) (sp-rnd-flt spt-y (meters 1.6) (meters 2) 1.0) (sp-rnd-flt spt-scale-x (meters 5) (meters 1) 1.0) @@ -845,8 +805,7 @@ ) (defpart 869 - :init-specs - ((sp-flt spt-r 64.0) + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) (sp-flt spt-fade-r -0.4) (sp-flt spt-fade-g -0.4) @@ -855,8 +814,7 @@ ) (defpart 867 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 1.0 2.5 1.0) (sp-flt spt-y (meters 0.75)) (sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) @@ -875,8 +833,7 @@ ) (defpart 868 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.1 1.25 1.0) (sp-flt spt-y (meters 0.75)) (sp-rnd-flt spt-scale-x (meters 3.5) (meters 2) 1.0) @@ -897,8 +854,7 @@ ) (defpart 870 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 0.75)) (sp-flt spt-scale-x (meters 4)) @@ -922,15 +878,13 @@ ) (defpart 871 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) (defpartgroup group-jungle-lurkermachine-3 :id 186 :bounds (static-bspherem 0 6 6 16) - :parts - ((sp-item 872 :fade-after (meters 140) :falloff-to (meters 160) :period 300 :length 258) + :parts ((sp-item 872 :fade-after (meters 140) :falloff-to (meters 160) :period 300 :length 258) (sp-item 872 :fade-after (meters 140) :falloff-to (meters 160) :period 202 :length 36) (sp-item 872 :fade-after (meters 100) :falloff-to (meters 120) :period 450 :length 38) (sp-item 872 :fade-after (meters 100) :falloff-to (meters 120) :period 857 :length 106) @@ -989,8 +943,7 @@ ) (defpart 894 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters 3.8)) (sp-flt spt-y (meters 4.5)) @@ -1019,8 +972,7 @@ ) (defpart 893 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters 3.8)) (sp-flt spt-y (meters 4.5)) @@ -1050,8 +1002,7 @@ ) (defpart 892 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 4.7)) @@ -1081,8 +1032,7 @@ ) (defpart 891 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 4.7)) @@ -1113,8 +1063,7 @@ ) (defpart 890 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters -6.5)) (sp-flt spt-y (meters 2.3)) @@ -1144,8 +1093,7 @@ ) (defpart 889 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters -6.5)) (sp-flt spt-y (meters 2.3)) @@ -1178,8 +1126,7 @@ ) (defpart 888 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters -6.3)) (sp-flt spt-y (meters 6.8)) @@ -1208,8 +1155,7 @@ ) (defpart 887 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters -6.3)) (sp-flt spt-y (meters 6.8)) @@ -1239,8 +1185,7 @@ ) (defpart 886 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters 8.7)) (sp-flt spt-y (meters 6.8)) @@ -1270,8 +1215,7 @@ ) (defpart 885 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters 8.7)) (sp-flt spt-y (meters 6.8)) @@ -1302,8 +1246,7 @@ ) (defpart 884 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters 6.9)) (sp-flt spt-y (meters 5.3)) @@ -1332,8 +1275,7 @@ ) (defpart 883 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters 6.9)) (sp-flt spt-y (meters 5.3)) @@ -1363,8 +1305,7 @@ ) (defpart 882 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters 2.9)) (sp-flt spt-y (meters 8.9)) @@ -1394,8 +1335,7 @@ ) (defpart 881 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters 2.9)) (sp-flt spt-y (meters 8.9)) @@ -1426,8 +1366,7 @@ ) (defpart 880 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters -7.7)) (sp-flt spt-y (meters 2.3)) @@ -1457,8 +1396,7 @@ ) (defpart 879 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters -7.7)) (sp-flt spt-y (meters 2.3)) @@ -1491,13 +1429,11 @@ ) (defpart 895 - :init-specs - ((sp-flt spt-vel-y (meters 0))) + :init-specs ((sp-flt spt-vel-y (meters 0))) ) (defpart 878 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters -4.2)) (sp-flt spt-y (meters 10.9)) @@ -1526,8 +1462,7 @@ ) (defpart 877 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters -4.2)) (sp-flt spt-y (meters 10.9)) @@ -1557,8 +1492,7 @@ ) (defpart 876 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters -8.2)) (sp-flt spt-y (meters 6.8)) @@ -1588,8 +1522,7 @@ ) (defpart 875 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters -8.2)) (sp-flt spt-y (meters 6.8)) @@ -1620,8 +1553,7 @@ ) (defpart 872 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters -2.2) (meters 2.4) 1.0) (sp-rnd-flt spt-y (meters 5.5) (meters 1.3) 1.0) @@ -1652,8 +1584,7 @@ ) (defpart 873 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters -3.75) (meters 2.4) 1.0) (sp-rnd-flt spt-y (meters 8.5) (meters 1.3) 1.0) @@ -1684,8 +1615,7 @@ ) (defpart 874 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-rnd-flt spt-x (meters -10.5) (meters 0.8) 1.0) (sp-flt spt-y (meters 1.3)) @@ -1718,8 +1648,7 @@ (defpartgroup group-jungle-lurkermachine-1 :id 187 :bounds (static-bspherem 0 10 0 12) - :parts - ((sp-item 896 :fade-after (meters 140) :falloff-to (meters 160) :period 300 :length 258) + :parts ((sp-item 896 :fade-after (meters 140) :falloff-to (meters 160) :period 300 :length 258) (sp-item 896 :fade-after (meters 140) :falloff-to (meters 160) :period 202 :length 36) (sp-item 896 :fade-after (meters 100) :falloff-to (meters 120) :period 450 :length 38) (sp-item 896 :fade-after (meters 100) :falloff-to (meters 120) :period 857 :length 106) @@ -1738,8 +1667,7 @@ ) (defpart 896 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters 1) (meters 2.2) 1.0) (sp-rnd-flt spt-y (meters 9.4) (meters 1.3) 1.0) @@ -1770,8 +1698,7 @@ ) (defpart 897 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters -1.2) (meters 2.4) 1.0) (sp-rnd-flt spt-y (meters 8.5) (meters 1.3) 1.0) @@ -1802,8 +1729,7 @@ ) (defpart 898 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters 4.4)) (sp-rnd-flt spt-y (meters 8.5) (meters 1.3) 1.0) diff --git a/goal_src/levels/jungle/junglefish.gc b/goal_src/levels/jungle/junglefish.gc index c9e74046dc..729364d336 100644 --- a/goal_src/levels/jungle/junglefish.gc +++ b/goal_src/levels/jungle/junglefish.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/junglefish-ag.gc") + (deftype junglefish (nav-enemy) () :heap-base #x120 @@ -16,13 +18,10 @@ ) -(defskelgroup *junglefish-sg* junglefish - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 1.5) - :longest-edge (meters 0) - ) +(defskelgroup *junglefish-sg* junglefish junglefish-lod0-jg junglefish-swim-ja + ((junglefish-lod0-mg (meters 20)) (junglefish-lod1-mg (meters 40)) (junglefish-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.5) + ) nav-enemy-default-event-handler @@ -35,137 +34,60 @@ nav-enemy-default-event-handler (defstate nav-enemy-patrol (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :exit - (behavior () + :exit (behavior () (set! (-> self target-speed) (-> self nav-info walk-travel-speed)) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (while #t - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-2 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (when (nav-enemy-rnd-go-idle? 0.2) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) 1.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 180) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) (set! (-> self target-speed) 0.0) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - (set! (-> a0-8 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-8 param 1) f30-0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! - a0-8 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) f30-0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (until (not (nav-enemy-rnd-go-idle? 0.2)) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - (set! (-> a0-11 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-11 param 1) f30-0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! - a0-11 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) f30-0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (set! (-> self target-speed) (-> self nav-info walk-travel-speed)) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) 1.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 180) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-17 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-17 param 1) f30-0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! - a0-17 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! - ) - ) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) f30-0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -176,13 +98,11 @@ nav-enemy-default-event-handler (defstate nav-enemy-notice (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-chase) (none) ) @@ -190,13 +110,11 @@ nav-enemy-default-event-handler (defstate nav-enemy-chase (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :trans - (behavior () + :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) (if (and *target* (>= 8192.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (go-virtual nav-enemy-attack) @@ -207,13 +125,11 @@ nav-enemy-default-event-handler (defstate nav-enemy-stop-chase (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-patrol) (none) ) @@ -221,13 +137,11 @@ nav-enemy-default-event-handler (defstate nav-enemy-stare (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-patrol) (none) ) @@ -235,13 +149,11 @@ nav-enemy-default-event-handler (defstate nav-enemy-give-up (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-patrol) (none) ) @@ -249,81 +161,40 @@ nav-enemy-default-event-handler (defstate nav-enemy-attack (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! junglefish-chomp-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-chase) (none) ) - :post - (the-as (function none :behavior junglefish) nav-enemy-chase-post) + :post (the-as (function none :behavior junglefish) nav-enemy-chase-post) ) (defstate nav-enemy-victory (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 2.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! junglefish-swim-ja :num! (seek! max 2.0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 2.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 2.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + (ja :num! (seek! max 2.0)) ) + (ja-no-eval :group! junglefish-swim-ja :num! (seek! max 2.0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 2.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 2.0)) ) (go-virtual nav-enemy-patrol) (none) @@ -377,7 +248,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -406,7 +277,7 @@ nav-enemy-default-event-handler (initialize-skeleton obj *junglefish-sg* '()) (TODO-RENAME-45 obj *junglefish-nav-enemy-info*) (set! (-> obj water) (new 'process 'water-control obj 7 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (the-as uint 2)) + (set! (-> obj water flags) (water-flags wt01)) (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) (set! (-> obj water ripple-size) 5734.4) (set! (-> obj collide-info trans y) (+ -4096.0 (-> obj water height))) diff --git a/goal_src/levels/jungle/junglesnake.gc b/goal_src/levels/jungle/junglesnake.gc index e9beddcd62..c370b143bd 100644 --- a/goal_src/levels/jungle/junglesnake.gc +++ b/goal_src/levels/jungle/junglesnake.gc @@ -7,25 +7,23 @@ ;; DECOMP BEGINS -(defskelgroup *junglesnake-sg* junglesnake - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 14 0 18) - :longest-edge (meters 2.5) - ) +(import "goal_src/import/junglesnake-ag.gc") + +(defskelgroup *junglesnake-sg* junglesnake junglesnake-lod0-jg junglesnake-idle-ja + ((junglesnake-lod0-mg (meters 999999))) + :bounds (static-spherem 0 14 0 18) + :longest-edge (meters 2.5) + ) (defpartgroup group-junglesnake-dropping-down :id 173 :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 799 :period 300 :length 150)) + :parts ((sp-item 799 :period 300 :length 150)) ) (defpart 799 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -9) (meters 18) 1.0) (sp-flt spt-y (meters -6)) @@ -118,34 +116,26 @@ ) ) (cond - ((and (-> self is-lethal?) (zero? (logand (-> *target* state-flags) #x80f8))) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (set! (-> a1-2 param 1) (the-as uint (new 'static 'attack-info))) - (when (send-event-function arg0 a1-2) - (let ((v0-1 (the-as object #t))) - (set! (-> self hit-player) (the-as symbol v0-1)) - v0-1 - ) + ((and (-> self is-lethal?) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + ) + (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + (let ((v0-1 (the-as object #t))) + (set! (-> self hit-player) (the-as symbol v0-1)) + v0-1 ) ) ) (else (do-push-aways! (-> self root-override)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'shove) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((v1-17 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-17 shove-back) 8192.0) - (set! (-> v1-17 shove-up) 2048.0) - (set! (-> a1-3 param 1) (the-as uint v1-17)) - ) - (send-event-function arg0 a1-3) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-back (meters 2)) (shove-up (meters 0.5)))) ) ) ) @@ -336,10 +326,8 @@ junglesnake-default-event-handler ) (defstate junglesnake-sleeping (junglesnake) - :event - junglesnake-default-event-handler - :enter - (behavior () + :event junglesnake-default-event-handler + :enter (behavior () (set! (-> self skel postbind-function) #f) (set! (-> self track-player-ry) #f) (set! (-> self track-player-tilt) #f) @@ -348,8 +336,7 @@ junglesnake-default-event-handler (logior! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (when *target* (let* ((a0-1 (target-pos 0)) (f0-1 (- (-> a0-1 y) (-> self root-override trans y))) @@ -361,8 +348,7 @@ junglesnake-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -371,10 +357,8 @@ junglesnake-default-event-handler ) (defstate junglesnake-wake (junglesnake) - :event - junglesnake-default-event-handler - :enter - (behavior () + :event junglesnake-default-event-handler + :enter (behavior () (logclear! (-> self draw status) (draw-status hidden)) (set! (-> self track-player-ry) #f) (set! (-> self track-player-tilt) #f) @@ -383,8 +367,7 @@ junglesnake-default-event-handler 0 (none) ) - :trans - (behavior () + :trans (behavior () (dummy-20 self) (when *target* (if *target* @@ -398,47 +381,33 @@ junglesnake-default-event-handler ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 0.85) - (set! (-> a0-0 frame-num) 0.5) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! junglesnake-drop-down-ja :num! (seek! max 0.85) :frame-num 0.5) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 0.85) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.85)) ) (go junglesnake-tracking) (none) ) - :post - (the-as (function none :behavior junglesnake) transform-post) + :post (the-as (function none :behavior junglesnake) transform-post) ) (defstate junglesnake-tracking (junglesnake) - :event - junglesnake-default-event-handler - :enter - (behavior () + :event junglesnake-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self track-player-ry) #t) (set! (-> self track-player-tilt) #t) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self refractory-delay)) - (zero? (logand (-> *target* state-flags) #x80f8)) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) ) (go junglesnake-attack) ) @@ -464,67 +433,41 @@ junglesnake-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 2) - ) + ((ja-group? junglesnake-idle-ja) (while (not (ja-done? 0)) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) ) ) - (while #t - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (loop + (ja-no-eval :group! junglesnake-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior junglesnake) transform-post) + :post (the-as (function none :behavior junglesnake) transform-post) ) (defstate junglesnake-attack (junglesnake) - :event - junglesnake-default-event-handler - :enter - (behavior () + :event junglesnake-default-event-handler + :enter (behavior () (set! (-> self hit-player) #f) (none) ) - :exit - (behavior () + :exit (behavior () (dummy-24 self) (none) ) - :trans - (behavior () + :trans (behavior () (dummy-20 self) (when *target* (if *target* @@ -538,30 +481,15 @@ junglesnake-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self track-player-ry) #t) (set! (-> self track-player-tilt) #t) - (ja-channel-push! 2 45) + (ja-channel-push! 2 (seconds 0.15)) (dummy-23 self) (let ((f30-0 (lerp-scale 0.0 1.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)) 0.0 24576.0)) ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.25) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) - (let ((a0-6 (-> self skel root-channel 1))) - (set! (-> a0-6 frame-interp) f30-0) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-6 param 0) 0.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-chan) - ) + (ja-no-eval :group! junglesnake-strike-close-ja :num! (seek! max 1.25) :frame-num 0.0) + (ja-no-eval :chan 1 :group! junglesnake-strike-far-ja :num! (chan 0) :frame-interp f30-0 :frame-num 0.0) (until (ja-done? 0) (suspend) (set! f30-0 @@ -571,16 +499,8 @@ junglesnake-default-event-handler (* 2.0 (-> *display* seconds-per-frame)) ) ) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.25) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((a0-12 (-> self skel root-channel 1))) - (set! (-> a0-12 frame-interp) f30-0) - (set! (-> a0-12 param 0) 0.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (seek! max 1.25)) + (ja :chan 1 :num! (chan 0) :frame-interp f30-0) (let ((f0-12 (ja-aframe-num 0))) (cond ((and (>= f0-12 22.0) (< f0-12 44.0)) @@ -604,15 +524,12 @@ junglesnake-default-event-handler (go junglesnake-tracking) (none) ) - :post - (the-as (function none :behavior junglesnake) transform-post) + :post (the-as (function none :behavior junglesnake) transform-post) ) (defstate junglesnake-give-up (junglesnake) - :event - junglesnake-default-event-handler - :enter - (behavior () + :event junglesnake-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self track-player-ry) #f) (set! (-> self track-player-tilt) #f) @@ -620,34 +537,21 @@ junglesnake-default-event-handler (set! (-> self des-tilt) (-> self tilt)) (none) ) - :trans - (behavior () + :trans (behavior () (dummy-20 self) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self root-override trans quad)) (set! (-> s5-0 quad) (-> gp-0 quad)) (set! (-> s5-0 y) (+ 131072.0 (-> s5-0 y))) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 0.5) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! junglesnake-give-up-ja :num! (seek! max 0.5) :frame-num 0.0) (until (ja-done? 0) (let* ((f0-6 (ja-frame-num 0)) - (v1-18 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) + (v1-18 (ja-group)) (f0-7 (/ f0-6 (the float (+ (-> v1-18 data 0 length) -1)))) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -656,11 +560,7 @@ junglesnake-default-event-handler (move-to-point! (-> self root-override) s4-0) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 0.5) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.5)) ) ) (move-to-point! (-> self root-override) gp-0) @@ -669,43 +569,27 @@ junglesnake-default-event-handler (go junglesnake-sleeping) (none) ) - :post - (the-as (function none :behavior junglesnake) transform-post) + :post (the-as (function none :behavior junglesnake) transform-post) ) (defstate junglesnake-die (junglesnake) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglesnake) process-drawable-death-event-handler ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) - (ja-channel-push! 1 45) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! junglesnake-death-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior junglesnake) ja-post) + :post (the-as (function none :behavior junglesnake) ja-post) ) (defmethod dummy-23 junglesnake ((obj junglesnake)) diff --git a/goal_src/levels/jungleb/aphid.gc b/goal_src/levels/jungleb/aphid.gc index 2b5ef5134f..d4e1743684 100644 --- a/goal_src/levels/jungleb/aphid.gc +++ b/goal_src/levels/jungleb/aphid.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/aphid-lurker-ag.gc") + (deftype aphid (nav-enemy) ((try int32 :offset-assert 400) ) @@ -17,30 +19,29 @@ ) -(defskelgroup *aphid-sg* aphid-lurker - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 2) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *aphid-sg* aphid-lurker aphid-lurker-lod0-jg -1 + ((aphid-lurker-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 2) + :shadow aphid-lurker-shadow-mg + ) (defbehavior aphid-invulnerable aphid () - (set! (-> self nav-enemy-flags) (logand -33 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (set-collide-offense (-> self collide-info) 2 (collide-offense indestructible)) (none) ) (defbehavior aphid-vulnerable aphid () - (logior! (-> self nav-enemy-flags) 32) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (set-collide-offense (-> self collide-info) 2 (collide-offense touch)) (none) ) (defmethod dummy-43 aphid ((obj aphid) (arg0 process) (arg1 event-message-block)) (cond - ((or (logtest? (-> obj nav-enemy-flags) 32) (= arg0 (ppointer->process (-> obj parent)))) + ((or (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) + (= arg0 (ppointer->process (-> obj parent))) + ) (send-event arg0 'get-attack-count 1) (logclear! (-> obj mask) (process-mask actor-pause attackable)) (go (method-of-object obj nav-enemy-die)) @@ -53,10 +54,8 @@ (defstate nav-enemy-chase (aphid) :virtual #t - :exit - aphid-vulnerable - :code - (behavior () + :exit aphid-vulnerable + :code (behavior () (let ((gp-0 (cond ((>= (-> self try) 15) 450 @@ -73,87 +72,45 @@ ) ) ) - (while #t - (ja-channel-push! 1 15) - (sound-play-by-name (static-sound-name "aphid-spike-out") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (loop + (ja-channel-push! 1 (seconds 0.05)) + (sound-play "aphid-spike-out") + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (aphid-invulnerable) - (ja-channel-push! 1 30) - (let ((v1-28 (-> self skel root-channel 0))) - (set! (-> v1-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) - (let ((v1-31 (-> self skel root-channel 0))) - (set! (-> v1-31 num-func) num-func-identity) - (set! (-> v1-31 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 5)) + (ja :num-func num-func-identity :frame-num 0.0) (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1)) (s5-1 (-> *display* base-frame-counter)) (s4-1 (- (the int (nav-enemy-rnd-float-range 900.0 1440.0)) gp-0)) ) (until (>= (- (-> *display* base-frame-counter) s5-1) s4-1) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) f30-0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (aphid-vulnerable) - (ja-channel-push! 1 15) - (sound-play-by-name (static-sound-name "aphid-spike-in") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-17 param 0) 0.0) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (sound-play "aphid-spike-in") + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) 0.0) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (ja-channel-push! 1 30) - (let ((v1-63 (-> self skel root-channel 0))) - (set! (-> v1-63 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - ) - ) - (let ((v1-66 (-> self skel root-channel 0))) - (set! (-> v1-66 num-func) num-func-identity) - (set! (-> v1-66 frame-num) 0.0) + (ja :num! (seek! 0.0)) ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (let ((f30-1 (nav-enemy-rnd-float-range 0.9 1.1)) (s5-3 (-> *display* base-frame-counter)) (s4-3 (+ (the int (nav-enemy-rnd-float-range 660.0 900.0)) gp-0)) ) (until (>= (- (-> *display* base-frame-counter) s5-3) s4-3) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) f30-1) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-1)) ) ) ) @@ -164,82 +121,41 @@ (defstate nav-enemy-stare (aphid) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self turn-time) (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or (logtest? (-> self nav-enemy-flags) 256) + (when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) ) - (ja-channel-push! 1 30) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) f30-0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) f30-0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) - (while #t + (loop (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) 1.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 60) - (let ((v1-35 (-> self skel root-channel 0))) - (set! (-> v1-35 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) - (let ((v1-38 (-> self skel root-channel 0))) - (set! (-> v1-38 num-func) num-func-identity) - (set! (-> v1-38 frame-num) 0.0) - ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 4)) + (ja :num-func num-func-identity :frame-num 0.0) (until (nav-enemy-facing-player? 1820.4445) (ja-blend-eval) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) 0.75) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! 0.75)) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) (when (nav-enemy-rnd-percent? 0.3) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 10) - ) - ) - (ja-channel-push! 1 30) + (if (not (ja-group? (-> self draw art-group data 10))) + (ja-channel-push! 1 (seconds 0.1)) ) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-22 param 1) f30-0) - (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) f30-0) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -250,11 +166,10 @@ (defstate nav-enemy-give-up (aphid) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 218453.33) (set! (-> self turn-time) (seconds 0.5)) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) (let ((s4-0 (-> self collide-info)) (s5-0 (target-pos 0)) ) @@ -263,36 +178,16 @@ ) 12743.111 ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek-to-point-toward-point! (-> self collide-info) @@ -301,11 +196,7 @@ (-> self turn-time) ) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) (none) @@ -360,7 +251,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -413,13 +304,8 @@ (vector-identity! (-> self collide-info scale)) (set! (-> self entity) (-> arg0 entity)) (TODO-RENAME-48 self) - (set! (-> self nav-enemy-flags) (logand -4097 (-> self nav-enemy-flags))) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 0) - (set! (-> a1-3 message) 'try) - (set! (-> self try) (the-as int (send-event-function (ppointer->process (-> self parent)) a1-3))) - ) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf12)) + (set! (-> self try) (the-as int (send-event (ppointer->process (-> self parent)) 'try))) (go-virtual nav-enemy-chase) (none) ) diff --git a/goal_src/levels/jungleb/jungleb-obs.gc b/goal_src/levels/jungleb/jungleb-obs.gc index 5e242f0409..8c0b6aef1c 100644 --- a/goal_src/levels/jungleb/jungleb-obs.gc +++ b/goal_src/levels/jungleb/jungleb-obs.gc @@ -5,14 +5,12 @@ ;; name in dgo: jungleb-obs ;; dgos: JUB, L1 -(define-extern *jng-iris-door-sg* skeleton-group) -(define-extern *eggtop-sg* skeleton-group) - -(declare-type eggtop process-drawable) - ;; DECOMP BEGINS +(import "goal_src/import/eggtop-ag.gc") +(import "goal_src/import/jng-iris-door-ag.gc") + (deftype eggtop (process-drawable) ((root-override collide-shape-moving :offset 112) (cam-tracker handle :offset-assert 176) @@ -29,19 +27,15 @@ ) -(defskelgroup *eggtop-sg* eggtop - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -4.5 0 4.5) - :longest-edge (meters 0) - ) +(defskelgroup *eggtop-sg* eggtop eggtop-lod0-jg eggtop-idle-ja + ((eggtop-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -4.5 0 4.5) + ) (defpartgroup group-jungle-blue-eco-room-open :id 189 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 899 :fade-after (meters 110)) + :parts ((sp-item 899 :fade-after (meters 110)) (sp-item 900 :fade-after (meters 110)) (sp-item 901 :fade-after (meters 110)) (sp-item 902 :fade-after (meters 110)) @@ -53,13 +47,11 @@ :id 190 :duration 900 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 903) (sp-item 903) (sp-item 904 :flags (bit1) :period 1200 :length 15)) + :parts ((sp-item 903) (sp-item 903) (sp-item 904 :flags (bit1) :period 1200 :length 15)) ) (defpart 904 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 30.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 20) (meters 10) 1.0) @@ -80,18 +72,15 @@ ) (defpart 905 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 225) (sp-launcher-by-id spt-next-launcher 906)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 225) (sp-launcher-by-id spt-next-launcher 906)) ) (defpart 906 - :init-specs - ((sp-flt spt-fade-a -0.14222223)) + :init-specs ((sp-flt spt-fade-a -0.14222223)) ) (defpart 899 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 10) (meters 2) 1.0) @@ -106,8 +95,7 @@ ) (defpart 900 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) @@ -122,8 +110,7 @@ ) (defpart 901 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) @@ -143,8 +130,7 @@ ) (defpart 907 - :init-specs - ((sp-flt spt-r 64.0) + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) (sp-flt spt-fade-r -1.0) (sp-flt spt-fade-g -1.0) @@ -153,8 +139,7 @@ ) (defpart 902 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) @@ -174,8 +159,7 @@ ) (defpart 903 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-y (meters -6.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 2) 1.0) @@ -198,8 +182,7 @@ ) (defstate eggtop-idle (eggtop) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'notify) (case (-> arg3 param 0) @@ -213,127 +196,95 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self sound-id)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (not (-> self child)) (task-complete? *game-info* (-> self entity extra perm task))) (go eggtop-close #f) ) (spawn (-> self part) (-> self root-override trans)) - (sound-play-by-name (static-sound-name "electric-loop") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "electric-loop" :id (-> self sound-id)) (none) ) - :code - (behavior () + :code (behavior () (suspend) (update-transforms! (-> self root-override)) (anim-loop) (none) ) - :post - (the-as (function none :behavior eggtop) ja-post) + :post (the-as (function none :behavior eggtop) ja-post) ) (defstate eggtop-close (eggtop) - :trans - (behavior () + :trans (behavior () (rider-trans) (hide-hud-quick) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (when (not arg0) - (sound-play-by-name (static-sound-name "vent-switch") (new-sound-id) 2048 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 190) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (sound-play "vent-switch" :vol 200) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 190) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) - (let ((gp-2 (get-process *default-dead-pool* camera-tracker #x4000))) - (set! (-> self cam-tracker) - (ppointer->handle (when gp-2 - (let ((t9-6 (method-of-type camera-tracker activate))) - (t9-6 (the-as camera-tracker gp-2) self 'camera-tracker (the-as pointer #x70004000)) + (set! (-> self cam-tracker) + (ppointer->handle (process-spawn + camera-tracker + :init camera-tracker-init + (lambda :behavior camera-tracker + () + (while (not (process-grab? *target*)) + (suspend) ) - (run-now-in-process - gp-2 - camera-tracker-init - (lambda :behavior camera-tracker - () - (while (not (process-grab? *target*)) - (suspend) - ) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) - (suspend) - ) - ) - (send-event *camera* 'blend-from-as-fixed) - (camera-look-at (the-as pair "ecovent-171") (the-as uint 0)) - (camera-change-to "camera-223" 0 #f) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 3)) - (suspend) - ) - ) - (while (not (process-release? (handle->process (-> self grab-target)))) - (suspend) - ) - (send-event *camera* 'blend-from-as-fixed) - (level-hint-spawn - (game-text-id jungleb-eco-vents-opened) - "asstvb02" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (camera-look-at (the-as pair *target*) (the-as uint 0)) - (camera-change-to (the-as string 'base) 150 #f) - (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'show) - (none) + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) + (suspend) ) ) - (-> gp-2 ppointer) + (send-event *camera* 'blend-from-as-fixed) + (camera-look-at (the-as pair "ecovent-171") (the-as uint 0)) + (camera-change-to "camera-223" 0 #f) + (let ((gp-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 3)) + (suspend) + ) + ) + (while (not (process-release? (handle->process (-> self grab-target)))) + (suspend) + ) + (send-event *camera* 'blend-from-as-fixed) + (level-hint-spawn + (game-text-id jungleb-eco-vents-opened) + "asstvb02" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + (camera-look-at (the-as pair *target*) (the-as uint 0)) + (camera-change-to (the-as string 'base) 150 #f) + (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'show) + (none) ) + :to self ) - ) - ) + ) + ) (save-reminder (get-task-control (-> self entity extra perm task)) 2 0) - (sound-play-by-name (static-sound-name "jngb-eggtop-seq") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (sound-play "jngb-eggtop-seq") + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (process-entity-status! self (entity-perm-status complete) #t) @@ -342,24 +293,14 @@ (entity-task-complete-on a0-20) ) ) - (let ((gp-4 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-4 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-4 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - ) + (ja :group! (-> self draw art-group data 2) :num! max) (suspend) (logior! (-> self mask) (process-mask sleep)) (suspend) 0 (none) ) - :post - (the-as (function none :behavior eggtop) rider-post) + :post (the-as (function none :behavior eggtop) rider-post) ) (defmethod init-from-entity! eggtop ((obj eggtop) (arg0 entity-actor)) @@ -417,13 +358,10 @@ ) -(defskelgroup *jng-iris-door-sg* jng-iris-door - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *jng-iris-door-sg* jng-iris-door jng-iris-door-lod0-jg jng-iris-door-idle-ja + ((jng-iris-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) (defmethod TODO-RENAME-24 jng-iris-door ((obj jng-iris-door)) (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) diff --git a/goal_src/levels/jungleb/plant-boss.gc b/goal_src/levels/jungleb/plant-boss.gc index 329b4d4795..7727e9b13c 100644 --- a/goal_src/levels/jungleb/plant-boss.gc +++ b/goal_src/levels/jungleb/plant-boss.gc @@ -9,6 +9,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/plant-boss-ag.gc") + (deftype plant-boss (process-drawable) ((root-override collide-shape :offset 112) (neck joint-mod :offset-assert 176) @@ -46,12 +48,7 @@ plant-boss-idle plant-boss-intro (plant-boss-reset int) - (plant-boss-root-die symbol) - plant-boss-root-idle plant-boss-spawn - (plant-boss-vine-die symbol) - (plant-boss-vine-hit basic) - plant-boss-vine-idle plant-boss-vulnerable ) ) @@ -94,6 +91,11 @@ (plant-boss-back-arms-die symbol) (plant-boss-back-arms-hit symbol) plant-boss-back-arms-idle + (plant-boss-root-die symbol) + plant-boss-root-idle + (plant-boss-vine-die symbol) + (plant-boss-vine-hit basic) + plant-boss-vine-idle ) ) @@ -119,65 +121,44 @@ ) -(defskelgroup *plant-boss-sg* plant-boss - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 10 20) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *plant-boss-sg* plant-boss plant-boss-main-lod0-jg plant-boss-main-idle-ja + ((plant-boss-main-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 10 20) + :shadow plant-boss-main-shadow-mg + ) -(defskelgroup *plant-boss-arm-sg* plant-boss - 22 - 25 - ((23 (meters 999999))) - :bounds (static-spherem 0 0 0 20) - :longest-edge (meters 0) - :shadow 24 - ) +(defskelgroup *plant-boss-arm-sg* plant-boss plant-boss-arms-lod0-jg plant-boss-arms-idle-ja + ((plant-boss-arms-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + :shadow plant-boss-arms-shadow-mg + ) -(defskelgroup *plant-boss-leaf-sg* plant-boss - 37 - 42 - ((38 (meters 999999))) - :bounds (static-spherem 0 0 0 6) - :longest-edge (meters 0) - :shadow 39 - ) +(defskelgroup *plant-boss-leaf-sg* plant-boss plant-boss-leaf-lod0-jg plant-boss-leaf-idle-left-ja + ((plant-boss-leaf-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + :shadow plant-boss-leaf-shadow-mg + ) -(defskelgroup *plant-boss-back-arms-sg* plant-boss - 30 - 33 - ((31 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - :shadow 32 - ) +(defskelgroup *plant-boss-back-arms-sg* plant-boss plant-boss-back-arms-lod0-jg plant-boss-back-arms-idle-ja + ((plant-boss-back-arms-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + :shadow plant-boss-back-arms-shadow-mg + ) -(defskelgroup *plant-boss-vine-sg* plant-boss - 48 - 50 - ((49 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *plant-boss-vine-sg* plant-boss plant-boss-vine-lod0-jg plant-boss-vine-idle-ja + ((plant-boss-vine-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) -(defskelgroup *plant-boss-root-sg* plant-boss - 53 - 55 - ((54 (meters 999999))) - :bounds (static-spherem 0 20 0 20) - :longest-edge (meters 0) - ) +(defskelgroup *plant-boss-root-sg* plant-boss plant-boss-root-lod0-jg plant-boss-root-idle-ja + ((plant-boss-root-lod0-mg (meters 999999))) + :bounds (static-spherem 0 20 0 20) + ) -(define - *plant-boss-shadow-control* +(define *plant-boss-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #x2)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 409600.0) + :flags (shadow-flags disable-fade) + :shadow-dir (new 'static 'vector :y -1.0 :w 409600.0) :bot-plane (new 'static 'plane :y 1.0 :w 37683.2) :top-plane (new 'static 'plane :y 1.0 :w 4096.0) ) @@ -232,12 +213,7 @@ (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) - (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 13) - ) - ) + (not (ja-group? plant-boss-main-vulnerable2idle-ja)) ) (send-event arg0 'attack-or-shove (-> arg3 param 0) (new 'static 'attack-info)) ) @@ -260,8 +236,7 @@ ) (defstate plant-boss-arm-idle (plant-boss-arm) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hide 'die) (go plant-boss-arm-die (the-as symbol (-> arg3 param 0))) @@ -271,95 +246,44 @@ ) ) ) - :code - (behavior () + :code (behavior () (ja-channel-set! 2) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 25)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((gp-1 (-> self skel root-channel 1))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 26)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) - (while #t - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((v1-16 (-> self skel root-channel 1))) - (set! (-> v1-16 frame-interp) (- (-> (new 'static 'array float 1 1.0) 0) (-> self parent-override 0 energy))) - ) + (ja :group! plant-boss-arms-idle-ja :num! min) + (ja :chan 1 :group! plant-boss-arms-still-ja :num! min) + (loop + (ja :num! (loop!)) + (ja :chan 1 :frame-interp (- 1.0 (-> self parent-override 0 energy))) (suspend) ) (none) ) - :post - (the-as (function none :behavior plant-boss-arm) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) (defstate plant-boss-arm-hit (plant-boss-arm) - :event - (-> plant-boss-arm-idle event) - :code - (behavior ((arg0 basic)) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 29))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 90.0) 0)) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 29)) num-func-seek!) - ) + :event (-> plant-boss-arm-idle event) + :code (behavior ((arg0 basic)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! plant-boss-arms-hit-ja :num! (seek! (ja-aframe (the-as float 90.0) 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 90.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 75) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 25))) - (set! (-> gp-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 25)) data 0 length) -1)) - ) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-2 frame-num) (ja-aframe (the-as float 90.0) 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 25)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 90.0) 0))) ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-arms-idle-ja :num! (seek!) :frame-num (ja-aframe (the-as float 90.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go plant-boss-arm-idle) (none) ) - :post - (the-as (function none :behavior plant-boss-arm) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) (defstate plant-boss-arm-die (plant-boss-arm) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (let ((a0-1 (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0))) (set! (-> self root-override root-prim local-sphere w) 81920.0) (set! (-> (the-as collide-shape-prim-mesh a0-1) local-sphere w) 69632.0) @@ -381,48 +305,23 @@ (ja-channel-set! 1) ) (else - (ja-channel-push! 1 75) - (let ((f30-0 (rand-vu-float-range (-> (new 'static 'array float 1 0.8) 0) (-> (new 'static 'array float 1 1.0) 0))) - ) + (ja-channel-push! 1 (seconds 0.25)) + (let ((f30-0 (rand-vu-float-range (the-as float 0.8) (the-as float 1.0)))) (case (-> self side) ((1) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 28))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 28)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) f30-0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 28)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-arms-die-right-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) f30-0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (else - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 27))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 27)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) f30-0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 27)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-arms-die-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) f30-0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -431,28 +330,10 @@ ) (case (-> self side) ((1) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 28)) - num-func-identity - ) - (set! (-> gp-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 28)) data 0 length) -1)) - ) - ) + (ja :group! plant-boss-arms-die-right-ja :num! max) ) (else - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 27)) - num-func-identity - ) - (set! (-> gp-2 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 27)) data 0 length) -1)) - ) - ) + (ja :group! plant-boss-arms-die-ja :num! max) ) ) (set! (-> (find-prim-by-id (-> self root-override) (the-as uint 1)) prim-core action) (collide-action)) @@ -460,19 +341,17 @@ (set! (-> (find-prim-by-id (-> self root-override) (the-as uint 2)) prim-core action) (collide-action)) 0 (update-transforms! (-> self root-override)) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) (none) ) - :post - (the-as (function none :behavior plant-boss-arm) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) (defstate plant-boss-back-arms-idle (plant-boss-arm) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (or (= arg2 'touch) (= arg2 'attack)) (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) ) @@ -485,157 +364,86 @@ ) ) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 33))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 33)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 33)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! plant-boss-back-arms-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior plant-boss-arm) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) (defstate plant-boss-back-arms-hit (plant-boss-arm) - :event - (-> plant-boss-back-arms-idle event) - :code - (behavior ((arg0 symbol)) - (ja-channel-push! 1 30) + :event (-> plant-boss-back-arms-idle event) + :code (behavior ((arg0 symbol)) + (ja-channel-push! 1 (seconds 0.1)) (cond ((or (= arg0 'spin) (= arg0 'spin-air)) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 36))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 45.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-1 frame-num) 0.0) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 36)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-back-arms-hit-kick-ja + :num! (seek! (ja-aframe (the-as float 45.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe (the-as float 45.0) 0)) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 45.0) 0))) ) ) (else - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> gp-3 param 0) (ja-aframe (the-as float 45.0) 0)) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-3 frame-num) 0.0) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-back-arms-hit-ja + :num! (seek! (ja-aframe (the-as float 45.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 param 0) (ja-aframe (the-as float 45.0) 0)) - (set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 45.0) 0))) ) ) ) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 75) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 33))) - (set! (-> gp-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 33)) data 0 length) -1)) - ) - (set! (-> gp-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-5 frame-num) (ja-aframe (the-as float 45.0) 0)) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 33)) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-back-arms-idle-ja :num! (seek!) :frame-num (ja-aframe (the-as float 45.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go plant-boss-back-arms-idle) (none) ) - :post - (the-as (function none :behavior plant-boss-arm) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) (defstate plant-boss-back-arms-die (plant-boss-arm) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (cond (arg0 (ja-channel-set! 1) ) (else - (ja-channel-push! 1 75) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-back-arms-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 34)) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1)) - ) - ) - (while #t + (ja :group! plant-boss-back-arms-die-ja :num! max) + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior plant-boss-arm) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) -(defstate plant-boss-vine-idle (plant-boss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defstate plant-boss-vine-idle (plant-boss-arm) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hide 'die) (go plant-boss-vine-die (the-as symbol (-> arg3 param 0))) @@ -645,168 +453,92 @@ ) ) ) - :code - (behavior () + :code (behavior () (let ((f30-0 (rand-vu-float-range (the-as float 0.9) (the-as float 1.1)))) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 50))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 50)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) f30-0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 50)) num-func-seek!) - ) + (loop + (ja-no-eval :group! plant-boss-vine-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) f30-0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) (none) ) - :post - (the-as (function none :behavior plant-boss) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) -(defstate plant-boss-vine-hit (plant-boss) - :event - (-> plant-boss-vine-idle event) - :code - (behavior ((arg0 basic)) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 52))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 45.0) 0)) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 52)) num-func-seek!) - ) +(defstate plant-boss-vine-hit (plant-boss-arm) + :event (-> plant-boss-vine-idle event) + :code (behavior ((arg0 basic)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! plant-boss-vine-hit-ja :num! (seek! (ja-aframe (the-as float 45.0) 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 45.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 75) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 50))) - (set! (-> gp-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 50)) data 0 length) -1)) - ) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-2 frame-num) (ja-aframe (the-as float 45.0) 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 50)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 45.0) 0))) ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-vine-idle-ja :num! (seek!) :frame-num (ja-aframe (the-as float 45.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go plant-boss-vine-idle) (none) ) - :post - (the-as (function none :behavior plant-boss) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) -(defstate plant-boss-vine-die (plant-boss) - :code - (behavior ((arg0 symbol)) +(defstate plant-boss-vine-die (plant-boss-arm) + :code (behavior ((arg0 symbol)) (when (not arg0) - (let ((f30-0 (rand-vu-float-range (-> (new 'static 'array float 1 0.0) 0) (-> (new 'static 'array float 1 1.0) 0))) + (let ((f30-0 (rand-vu-float-range (the-as float 0.0) (the-as float 1.0))) (gp-0 (-> *display* base-frame-counter)) ) (until (>= (- (-> *display* base-frame-counter) gp-0) (the int (* 300.0 f30-0))) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) ) - (ja-channel-push! 1 75) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 51))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 51)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 51)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-vine-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior plant-boss) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) -(defstate plant-boss-root-idle (plant-boss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defstate plant-boss-root-idle (plant-boss-arm) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hide 'die) (go plant-boss-root-die (the-as symbol (-> arg3 param 0))) ) ) ) - :code - (behavior () + :code (behavior () (let ((f30-0 (rand-vu-float-range (the-as float 0.9) (the-as float 1.1)))) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 55))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 55)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) f30-0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 55)) num-func-seek!) - ) + (loop + (ja-no-eval :group! plant-boss-root-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) f30-0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) (none) ) - :post - (the-as (function none :behavior plant-boss) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) -(defstate plant-boss-root-die (plant-boss) - :code - (behavior ((arg0 symbol)) +(defstate plant-boss-root-die (plant-boss-arm) + :code (behavior ((arg0 symbol)) (when (not arg0) (let ((gp-0 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 4)) @@ -817,8 +549,7 @@ ) (none) ) - :post - (the-as (function none :behavior plant-boss) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) (defbehavior plant-boss-arm-init plant-boss-arm ((arg0 vector) (arg1 float) (arg2 int)) @@ -913,7 +644,7 @@ (defbehavior plant-boss-vine-init plant-boss-arm ((arg0 vector) (arg1 vector) (arg2 float) (arg3 int)) (stack-size-set! (-> self main-thread) 128) (set! (-> self root-override) (the-as collide-shape (new 'process 'trsqv))) - (set-vector! (-> self root-override scale) arg2 arg2 arg2 (-> (new 'static 'array float 1 1.0) 0)) + (set-vector! (-> self root-override scale) arg2 arg2 arg2 1.0) (set! (-> self root-override trans quad) (-> arg0 quad)) (quaternion-zxy! (-> self root-override quat) arg1) (set! (-> self side) arg3) @@ -935,8 +666,7 @@ ) (defstate plant-boss-leaf-idle (plant-boss-leaf) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go plant-boss-leaf-open (the-as symbol (-> arg3 param 0))) @@ -946,49 +676,24 @@ ) ) ) - :code - (behavior ((arg0 symbol)) - (while #t + :code (behavior ((arg0 symbol)) + (loop (case (-> self side) ((1) (dotimes (gp-0 4) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 43)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 43)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-leaf-stubby-right-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (else (dotimes (gp-1 5) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 40))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 40)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 40)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-leaf-stubby-left-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -996,13 +701,11 @@ ) (none) ) - :post - (the-as (function none :behavior plant-boss-leaf) ja-post) + :post (the-as (function none :behavior plant-boss-leaf) ja-post) ) (defstate plant-boss-leaf-open (plant-boss-leaf) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('kill) (go plant-boss-leaf-close) @@ -1012,99 +715,54 @@ ) ) ) - :trans - (the-as (function none :behavior plant-boss-leaf) rider-trans) - :code - (behavior ((arg0 symbol)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 30) + :trans (the-as (function none :behavior plant-boss-leaf) rider-trans) + :code (behavior ((arg0 symbol)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.1)) (case (-> self side) ((1) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 44))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 30.0) 0)) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-leaf-grow-right-ja + :num! (seek! (ja-aframe (the-as float 30.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 30.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 44))) - (set! (-> gp-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 44)) data 0 length) -1)) - ) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-3 frame-num) (ja-aframe (the-as float 30.0) 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 30.0) 0))) ) + (sound-play "plant-leaf") + (ja-no-eval :group! plant-boss-leaf-grow-right-ja :num! (seek!) :frame-num (ja-aframe (the-as float 30.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> gp-4 param 0) (ja-aframe (the-as float 30.0) 0)) - (set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-4 frame-num) 0.0) - (joint-control-channel-group! gp-4 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-leaf-grow-left-ja + :num! (seek! (ja-aframe (the-as float 30.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 param 0) (ja-aframe (the-as float 30.0) 0)) - (set! (-> gp-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-5 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-7 (-> self skel root-channel 0))) - (set! (-> gp-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> gp-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 41)) data 0 length) -1)) - ) - (set! (-> gp-7 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-7 frame-num) (ja-aframe (the-as float 30.0) 0)) - (joint-control-channel-group! gp-7 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 30.0) 0))) ) + (sound-play "plant-leaf") + (ja-no-eval :group! plant-boss-leaf-grow-left-ja :num! (seek!) :frame-num (ja-aframe (the-as float 30.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 param 0) (the float (+ (-> a0-26 frame-group data 0 length) -1))) - (set! (-> a0-26 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go plant-boss-leaf-open-idle #f) (none) ) - :post - (the-as (function none :behavior plant-boss-leaf) rider-post) + :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) (defstate plant-boss-leaf-open-idle (plant-boss-leaf) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('kill) (set! (-> self state-object) #t) @@ -1123,49 +781,36 @@ ) ) ) - :trans - (the-as (function none :behavior plant-boss-leaf) rider-trans) - :code - (behavior ((arg0 symbol)) + :trans (the-as (function none :behavior plant-boss-leaf) rider-trans) + :code (behavior ((arg0 symbol)) (local-vars (v1-19 symbol)) (set! (-> self state-object) arg0) - (case (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (((-> self draw art-group data 47) (-> self draw art-group data 46)) - (ja-channel-push! 1 30) + (case (ja-group) + ((plant-boss-leaf-right-bounce-ja plant-boss-leaf-left-bounce-ja) + (ja-channel-push! 1 (seconds 0.1)) ) ) (case (-> self side) ((1) - (let ((v1-10 (-> self skel root-channel 0))) - (set! (-> v1-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 45))) - ) + (ja :group! plant-boss-leaf-idle-right-ja) ) (else - (let ((v1-13 (-> self skel root-channel 0))) - (set! (-> v1-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 42))) - ) + (ja :group! plant-boss-leaf-idle-left-ja) ) ) (until v1-19 (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (set! v1-19 (and (-> self state-object) (< (-> self state-time-frame) (-> *display* base-frame-counter)))) ) (go plant-boss-leaf-close) (none) ) - :post - (the-as (function none :behavior plant-boss-leaf) rider-post) + :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) (defstate plant-boss-leaf-bounce (plant-boss-leaf) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('kill) (set! (-> self state-object) #t) @@ -1179,133 +824,76 @@ ) ) ) - :trans - (the-as (function none :behavior plant-boss-leaf) rider-trans) - :code - (behavior () - (ja-channel-push! 1 30) + :trans (the-as (function none :behavior plant-boss-leaf) rider-trans) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) (case (-> self side) ((1) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 47))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 47)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 47)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-leaf-right-bounce-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 46))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 46)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 46)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-leaf-left-bounce-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go plant-boss-leaf-open-idle (-> self state-object)) (none) ) - :post - (the-as (function none :behavior plant-boss-leaf) rider-post) + :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) (defstate plant-boss-leaf-close (plant-boss-leaf) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('die) (go plant-boss-leaf-die (the-as basic (-> arg3 param 0))) ) ) ) - :trans - (the-as (function none :behavior plant-boss-leaf) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior plant-boss-leaf) rider-trans) + :code (behavior () (case (-> self side) ((1) - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 44))) - (set! (-> a0-4 param 0) 0.0) - (set! (-> a0-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-4 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 44)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!) - ) + (sound-play "plant-leaf") + (ja-no-eval :group! plant-boss-leaf-grow-right-ja :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 0.0) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) ) (else - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> a0-10 param 0) 0.0) - (set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-10 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 41)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) - ) + (sound-play "plant-leaf") + (ja-no-eval :group! plant-boss-leaf-grow-left-ja :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) 0.0) - (set! (-> a0-11 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) ) ) (go plant-boss-leaf-idle #f) (none) ) - :post - (the-as (function none :behavior plant-boss-leaf) rider-post) + :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) (defstate plant-boss-leaf-die (plant-boss-leaf) - :code - (behavior ((arg0 basic)) - (while #t + :code (behavior ((arg0 basic)) + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) (none) ) - :post - (the-as (function none :behavior plant-boss-leaf) ja-post) + :post (the-as (function none :behavior plant-boss-leaf) ja-post) ) (defbehavior plant-boss-leaf-init plant-boss-leaf ((arg0 vector) (arg1 float) (arg2 int)) @@ -1340,9 +928,8 @@ ) (defstate plant-boss-far-idle (plant-boss) - :code - (behavior () - (clear-pending-settings-from-process *setting-control* self 'music) + :code (behavior () + (remove-setting! 'music) (let ((gp-0 (-> self child))) (while gp-0 (let ((s5-0 (ppointer->process gp-0))) @@ -1364,18 +951,10 @@ (set-mode! (-> self body) (joint-mod-handler-mode flex-blend)) (set! (-> self body flex-blend) 0.0) (ja-channel-set! 1) - (while #t - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (loop + (ja-no-eval :group! plant-boss-main-initial-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (set! (-> self energy) (seek (-> self energy) (the-as float 0.25) (-> *display* seconds-per-frame))) + (seek! (-> self energy) (the-as float 0.25) (-> *display* seconds-per-frame)) (if (and (and *target* (>= 245760.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -1384,42 +963,27 @@ (go plant-boss-intro) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior plant-boss) ja-post) + :post (the-as (function none :behavior plant-boss) ja-post) ) (defstate plant-boss-intro (plant-boss) - :code - (behavior () - (set-setting! *setting-control* self 'music 'danger (-> (new 'static 'array float 1 0.0) 0) 0) + :code (behavior () + (set-setting! 'music 'danger 0.0 0) (send-event *target* 'reset-pickup 'eco) (let ((v1-9 (-> self entity extra perm))) (logior! (-> v1-9 status) (entity-perm-status user-set-from-cstage)) (b! (zero? (-> v1-9 user-int8 2)) cfg-5 :delay (empty-form)) ) - (ja-channel-push! 1 150) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 10)) - num-func-identity - ) - (set! (-> gp-0 frame-num) (ja-aframe (the-as float 510.0) 0)) - ) + (ja-channel-push! 1 (seconds 0.5)) + (ja :group! plant-boss-main-intro-ja :num! (identity (ja-aframe (the-as float 510.0) 0))) (b! #t cfg-3 :delay (nop!)) (label cfg-2) - (set! (-> self energy) - (seek (-> self energy) (-> (new 'static 'array float 1 1.0) 0) (* 2.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self energy) (the-as float 1.0) (* 2.0 (-> *display* seconds-per-frame))) (suspend) (label cfg-3) (let ((v1-22 (-> self skel channel))) @@ -1429,54 +993,42 @@ (set-mode! (-> self body) (joint-mod-handler-mode world-look-at)) (b! #t cfg-17 :delay (nop!)) (label cfg-5) - (when (not (handle->process (-> self cam-tracker))) - (let ((gp-1 (get-process *default-dead-pool* camera-tracker #x4000))) + (if (not (handle->process (-> self cam-tracker))) (set! (-> self cam-tracker) - (ppointer->handle (when gp-1 - (let ((t9-9 (method-of-type camera-tracker activate))) - (t9-9 (the-as camera-tracker gp-1) self 'camera-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - camera-tracker-init - (lambda :behavior camera-tracker - () - (while (not (process-grab? *target*)) - (suspend) - ) - (ambient-hint-spawn "gamcam28" (the-as vector #f) *entity-pool* 'ambient) - (send-event *camera* 'blend-from-as-fixed) - (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 13)) - (camera-change-to "camera-220" 0 #f) - (while (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 0) - (set! (-> a1-4 message) 'intro-done?) - (not (send-event-function *camera* a1-4)) - ) - (suspend) - ) - (camera-change-to "camera-222" 600 #f) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 2)) - (suspend) - ) - ) - (while (not (process-release? (handle->process (-> self grab-target)))) - (suspend) - ) - (send-event *camera* 'blend-from-as-fixed) - (camera-look-at (the-as pair *target*) (the-as uint 0)) - (camera-change-to (the-as string 'base) 150 #f) - (none) + (ppointer->handle (process-spawn + camera-tracker + :init camera-tracker-init + (lambda :behavior camera-tracker + () + (while (not (process-grab? *target*)) + (suspend) ) + (ambient-hint-spawn "gamcam28" (the-as vector #f) *entity-pool* 'ambient) + (send-event *camera* 'blend-from-as-fixed) + (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 13)) + (camera-change-to "camera-220" 0 #f) + (while (not (send-event *camera* 'intro-done?)) + (suspend) + ) + (camera-change-to "camera-222" 600 #f) + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 2)) + (suspend) + ) + ) + (while (not (process-release? (handle->process (-> self grab-target)))) + (suspend) + ) + (send-event *camera* 'blend-from-as-fixed) + (camera-look-at (the-as pair *target*) (the-as uint 0)) + (camera-change-to (the-as string 'base) 150 #f) + (none) ) - (-> gp-1 ppointer) + :to self ) ) ) ) - ) (let ((v1-37 (-> self neck))) (set! (-> v1-37 blend) 0.0) ) @@ -1486,35 +1038,16 @@ (set-mode! (-> self neck) (joint-mod-handler-mode world-look-at)) (set-mode! (-> self body) (joint-mod-handler-mode world-look-at)) (set! (-> self body flex-blend) 0.0) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-25 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 150) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> gp-2 param 0) (ja-aframe (the-as float 510.0) 0)) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-2 frame-num) 0.0) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.5)) + (ja-no-eval :group! plant-boss-main-intro-ja :num! (seek! (ja-aframe (the-as float 510.0) 0)) :frame-num 0.0) (until (ja-done? 0) - (set! (-> self energy) - (seek (-> self energy) (-> (new 'static 'array float 1 1.0) 0) (* 0.2 (-> *display* seconds-per-frame))) - ) + (seek! (-> self energy) (the-as float 1.0) (* 0.2 (-> *display* seconds-per-frame))) (ja-blend-eval) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe (the-as float 510.0) 0)) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-33 (-> self skel root-channel 0))) - (set! (-> a0-33 param 0) (the float (+ (-> a0-33 frame-group data 0 length) -1))) - (set! (-> a0-33 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-33 (the-as art-joint-anim #f) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 510.0) 0))) ) + (ja-no-eval :num! (seek!)) (let ((v1-77 (-> self entity extra perm))) (logior! (-> v1-77 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-77 user-int8 2) 1) @@ -1525,23 +1058,19 @@ (go plant-boss-reset 0) (none) ) - :post - (the-as (function none :behavior plant-boss) ja-post) + :post (the-as (function none :behavior plant-boss) ja-post) ) (defstate plant-boss-idle (plant-boss) - :event - plant-boss-default-event-handler - :enter - (behavior () - (set-setting! *setting-control* self 'music 'danger (-> (new 'static 'array float 1 0.0) 0) 0) + :event plant-boss-default-event-handler + :enter (behavior () + (set-setting! 'music 'danger 0.0 0) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self body flex-blend) 0.0) - (set! (-> self neck flex-blend) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> self neck flex-blend) 1.0) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) (if (< 409600.0 f30-0) (go plant-boss-far-idle) @@ -1563,175 +1092,87 @@ ) ) *target* - (zero? (logand (-> *target* state-flags) #x80f8)) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) ) (go plant-boss-attack 1) ) ) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - (ja-channel-push! 1 150) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) (ja-aframe (the-as float 60.0) 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + ((ja-group? plant-boss-main-reset-ja) + (ja-channel-push! 1 (seconds 0.5)) + (ja-no-eval :group! plant-boss-main-idle-ja :num! (seek!) :frame-num (ja-aframe (the-as float 60.0) 0)) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 12) - ) - (ja-channel-push! 1 75) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 75.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-1 frame-num) 0.0) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + ((ja-group? plant-boss-main-vulnerable-ja) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-main-vulnerable2idle-ja + :num! (seek! (ja-aframe (the-as float 75.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe (the-as float 75.0) 0)) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 75) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-3 frame-num) (ja-aframe (the-as float 75.0) 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 75.0) 0))) ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-main-idle-ja :num! (seek!) :frame-num (ja-aframe (the-as float 75.0) 0)) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 10) - ) + ((ja-group? plant-boss-main-intro-ja) ) (else - (ja-channel-push! 1 75) + (ja-channel-push! 1 (seconds 0.25)) ) ) - (while #t + (loop (when (or (and *cheat-mode* (cpad-hold? 1 r3)) (zero? (-> self aphid-count))) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-35 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-35 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-35 frame-num) 0.0) - (joint-control-channel-group! a0-35 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-idle-ja :num! (seek!) :frame-num 0.0) (go plant-boss-vulnerable) ) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-36 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-36 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-36 frame-num) 0.0) - (joint-control-channel-group! a0-36 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 param 0) (the float (+ (-> a0-37 frame-group data 0 length) -1))) - (set! (-> a0-37 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (when (and *cheat-mode* (cpad-hold? 1 r3)) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-43 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-43 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-43 frame-num) 0.0) - (joint-control-channel-group! a0-43 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-idle-ja :num! (seek!) :frame-num 0.0) (go plant-boss-vulnerable) ) (when (rand-vu-percent? (the-as float 0.2)) - (let ((a0-45 (-> self skel root-channel 0))) - (set! (-> a0-45 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-45 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-45 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-45 frame-num) 0.0) - (joint-control-channel-group! a0-45 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-idle-alt-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-46 (-> self skel root-channel 0))) - (set! (-> a0-46 param 0) (the float (+ (-> a0-46 frame-group data 0 length) -1))) - (set! (-> a0-46 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-46 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (none) ) - :post - plant-boss-post + :post plant-boss-post ) (defstate plant-boss-spawn (plant-boss) - :event - plant-boss-default-event-handler - :enter - (behavior () + :event plant-boss-default-event-handler + :enter (behavior () (when (not (-> self try-inc)) (let ((gp-0 (-> self entity extra perm))) (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) - (set! (-> gp-0 user-int8 0) (seekl (-> gp-0 user-int8 0) 255 1)) + (seekl! (-> gp-0 user-int8 0) 255 1) (set! (-> self try) (-> gp-0 user-int8 0)) ) (set! (-> self try-inc) #t) @@ -1740,7 +1181,7 @@ (+! (-> self cycle-count) 1) (set! (-> self snap-count) 0) (set! (-> self body flex-blend) 0.0) - (set! (-> self neck flex-blend) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> self neck flex-blend) 1.0) (set! (-> self want-aphid-count) (min (- 4 (the int (-> self health))) (cond ((>= (-> self try) 15) 1 @@ -1756,8 +1197,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) (if (< 409600.0 f0-0) (go plant-boss-far-idle) @@ -1782,32 +1222,21 @@ ) ) ((>= (- (-> *display* base-frame-counter) (-> self aphid-spawn-time)) (seconds 1.4)) - (let ((gp-1 (get-process *default-dead-pool* aphid #x4000))) - (when (when gp-1 - (let ((t9-5 (method-of-type aphid activate))) - (t9-5 (the-as aphid gp-1) self 'aphid (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 aphid-init-by-other self (-> self root-override trans) (target-pos 0)) - (-> gp-1 ppointer) - ) - (+! (-> self aphid-count) 1) - (set! (-> self want-aphid-count) (seekl (-> self want-aphid-count) 0 1)) - (set! (-> self aphid-spawn-time) (-> *display* base-frame-counter)) - ) + (when (process-spawn aphid self (-> self root-override trans) (target-pos 0) :to self) + (+! (-> self aphid-count) 1) + (seekl! (-> self want-aphid-count) 0 1) + (set! (-> self aphid-spawn-time) (-> *display* base-frame-counter)) ) ) ) (none) ) - :code - (-> plant-boss-idle code) - :post - plant-boss-post + :code (-> plant-boss-idle code) + :post plant-boss-post ) (defstate plant-boss-vulnerable (plant-boss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (when ((method-of-type touching-shapes-entry prims-touching?) @@ -1815,17 +1244,11 @@ (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'shove) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (let ((v1-6 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-6 shove-up) (-> (new 'static 'array float 1 8192.0) 0)) - (set! (-> v1-6 shove-back) 24576.0) - (set! (-> a1-2 param 1) (the-as uint v1-6)) - ) - (send-event-function arg0 a1-2) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 2)) (shove-back (meters 6)))) ) (go plant-boss-hit (the-as symbol (-> arg3 param 1))) ) @@ -1835,8 +1258,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self body flex-blend) 0.0) (set! (-> self neck flex-blend) 0.0) @@ -1845,8 +1267,7 @@ (logior! (-> self attack-prim 0 prim-core action) (collide-action solid)) (none) ) - :exit - (behavior () + :exit (behavior () (send-event (ppointer->process (-> self leaf 1)) 'kill 0) (send-event (ppointer->process (-> self leaf 0)) 'kill 150) (set! (-> self attack-prim 0 local-sphere w) 16384.0) @@ -1854,58 +1275,34 @@ (logclear! (-> self attack-prim 0 prim-core action) (collide-action solid)) (none) ) - :code - (behavior () - (ja-channel-push! 1 75) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 60.0) 0)) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-main-idle2vulnerable-ja + :num! (seek! (ja-aframe (the-as float 60.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 60.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 60.0) 0))) ) (send-event (ppointer->process (-> self leaf 1)) 'trigger) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> gp-2 param 0) (ja-aframe (the-as float 120.0) 0)) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-2 frame-num) (ja-aframe (the-as float 60.0) 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-idle2vulnerable-ja + :num! (seek! (ja-aframe (the-as float 120.0) 0)) + :frame-num (ja-aframe (the-as float 60.0) 0) + ) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe (the-as float 120.0) 0)) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 120.0) 0))) ) (send-event (ppointer->process (-> self leaf 0)) 'trigger) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> gp-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-4 frame-num) (ja-aframe (the-as float 120.0) 0)) - (joint-control-channel-group! gp-4 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-idle2vulnerable-ja + :num! (seek!) + :frame-num (ja-aframe (the-as float 120.0) 0) + ) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-5 (cond ((>= (-> self try) 15) @@ -1924,35 +1321,21 @@ ) ) (while (< (- (-> *display* base-frame-counter) (-> self state-time)) gp-5) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-vulnerable-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go plant-boss-spawn) (none) ) - :post - plant-boss-post + :post plant-boss-post ) (defstate plant-boss-attack (plant-boss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (when (and ((method-of-type touching-shapes-entry prims-touching?) @@ -1960,27 +1343,12 @@ (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) - (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 13) - ) - ) + (not (ja-group? plant-boss-main-vulnerable2idle-ja)) ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack-or-shove) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (let ((a0-8 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-8 mode) 'plant-boss) - (set! (-> a1-2 param 1) (the-as uint a0-8)) - ) - (when (send-event-function arg0 a1-2) - (let ((v0-1 (the-as object #t))) - (set! (-> self ate) (the-as symbol v0-1)) - v0-1 - ) + (when (send-event arg0 'attack-or-shove (-> arg3 param 0) (static-attack-info ((mode 'plant-boss)))) + (let ((v0-1 (the-as object #t))) + (set! (-> self ate) (the-as symbol v0-1)) + v0-1 ) ) ) @@ -1990,51 +1358,26 @@ ) ) ) - :code - (behavior ((arg0 int)) + :code (behavior ((arg0 int)) (local-vars (v1-64 symbol)) (+! (-> self snap-count) 1) (set! (-> self ate) #f) (set! (-> self interp) 0.0) (let ((s5-0 #f)) - (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) + (if (ja-group? plant-boss-main-reset-ja) (set! s5-0 #t) ) - (ja-channel-push! 2 75) - (let ((s4-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> s4-0 frame-num) 0.0) - ) - (let ((s4-1 (-> self skel root-channel 1))) - (joint-control-channel-group-eval! - s4-1 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> s4-1 frame-num) 0.0) - ) + (ja-channel-push! 2 (seconds 0.25)) + (ja :group! plant-boss-main-attack-ja :num! min) + (ja :chan 1 :group! plant-boss-main-attack-close-ja :num! min) (when s5-0 - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 num-func) num-func-identity) - (set! (-> s5-1 frame-num) (ja-aframe (the-as float 100.0) 0)) - ) - (let ((s5-2 (-> self skel root-channel 1))) - (set! (-> s5-2 num-func) num-func-identity) - (set! (-> s5-2 frame-num) (ja-aframe (the-as float 100.0) 0)) - ) + (ja :num-func num-func-identity :frame-num (ja-aframe (the-as float 100.0) 0)) + (ja :chan 1 :num-func num-func-identity :frame-num (ja-aframe (the-as float 100.0) 0)) ) ) (let ((f30-0 (lerp-scale - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 0.0) + (the-as float 1.0) (vector-vector-distance (target-pos 0) (-> self root-override trans)) (the-as float 26624.0) (the-as float 86016.0) @@ -2042,23 +1385,13 @@ ) ) (until (or v1-64 (ja-done? 0)) - (set! (-> self body flex-blend) (seek - (-> self body flex-blend) - (-> (new 'static 'array float 1 1.0) 0) - (* 2.0 (-> *display* seconds-per-frame)) - ) - ) - (set! (-> self neck flex-blend) (seek - (-> self neck flex-blend) - (-> (new 'static 'array float 1 0.0) 0) - (* 2.0 (-> *display* seconds-per-frame)) - ) - ) + (seek! (-> self body flex-blend) (the-as float 1.0) (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self neck flex-blend) (the-as float 0.0) (* 2.0 (-> *display* seconds-per-frame))) (set! f30-0 (seek f30-0 (lerp-scale - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 1.0) + (the-as float 0.0) (vector-vector-distance (target-pos 0) (-> self root-override trans)) (the-as float 26624.0) (the-as float 86016.0) @@ -2067,16 +1400,8 @@ ) ) (set! (-> self interp) f30-0) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((a0-20 (-> self skel root-channel 1))) - (set! (-> a0-20 frame-interp) f30-0) - (set! (-> a0-20 param 0) 0.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (seek!)) + (ja :chan 1 :num! (chan 0) :frame-interp f30-0) (suspend) (set! v1-64 (>= (ja-aframe-num 0) 149.0)) ) @@ -2084,15 +1409,12 @@ (go plant-boss-reset arg0) (none) ) - :post - plant-boss-post + :post plant-boss-post ) (defstate plant-boss-eat (plant-boss) - :event - plant-boss-generic-event-handler - :exit - (behavior () + :event plant-boss-generic-event-handler + :exit (behavior () (logclear! (-> self skel status) (janim-status spool)) (let ((a0-4 (handle->process (-> self camera)))) (if a0-4 @@ -2101,56 +1423,30 @@ ) (none) ) - :code - (behavior () - (let ((f30-1 (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (fmax (-> (new 'static 'array float 1 129.0) 0) (ja-aframe-num 0)) - (-> (new 'static 'array float 1 129.0) 0) - ) + :code (behavior () + (let ((f30-1 (the-as float (if (ja-group? plant-boss-main-attack-ja) + (fmax 129.0 (ja-aframe-num 0)) + 129.0 + ) + ) ) (gp-0 0) ) (send-event *camera* 'change-state cam-lookat 0) (logior! (-> self skel status) (janim-status inited)) - (ja-channel-push! 2 30) - (let ((s5-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data 18)) - num-func-identity + (ja-channel-push! 2 (seconds 0.1)) + (ja :group! (-> self draw art-group data 18) :num! (identity (ja-aframe f30-1 0))) + (ja :chan 1 + :group! (-> self draw art-group data 19) + :num! (identity (ja-aframe f30-1 0)) + :frame-interp (-> self interp) ) - (set! (-> s5-0 frame-num) (ja-aframe f30-1 0)) - ) - (let ((s5-1 (-> self skel root-channel 1))) - (set! (-> s5-1 frame-interp) (-> self interp)) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 19)) - num-func-identity - ) - (set! (-> s5-1 frame-num) (ja-aframe f30-1 0)) - ) (until (>= (ja-aframe-num 0) 285.0) (try-preload-stream *art-control* "$GAMCAM29" 0 self (the-as float -99.0)) - (set! (-> self energy) (seek (-> self energy) (the-as float 0.5) (* 0.2 (-> *display* seconds-per-frame)))) + (seek! (-> self energy) (the-as float 0.5) (* 0.2 (-> *display* seconds-per-frame))) (when (and (>= (ja-aframe-num 0) 175.0) (zero? gp-0)) (set! gp-0 1) - (let ((s5-2 (get-process *default-dead-pool* othercam #x4000))) - (set! (-> self camera) - (ppointer->handle (when s5-2 - (let ((t9-11 (method-of-type othercam activate))) - (t9-11 (the-as othercam s5-2) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 othercam-init-by-other self 28 #f #t) - (-> s5-2 ppointer) - ) - ) - ) - ) + (set! (-> self camera) (ppointer->handle (process-spawn othercam self 28 #f #t :to self))) (logior! (-> self skel status) (janim-status spool)) (ambient-hint-spawn "gamcam29" (the-as vector #f) *entity-pool* 'ambient) ) @@ -2158,128 +1454,65 @@ (set! gp-0 2) (send-event (handle->process (-> self camera)) 'joint "camera2") ) - (set! (-> self body flex-blend) - (seek (-> self body flex-blend) (-> (new 'static 'array float 1 0.0) 0) (-> *display* seconds-per-frame)) - ) - (set! (-> self interp) - (seek (-> self interp) (-> (new 'static 'array float 1 0.0) 0) (-> *display* seconds-per-frame)) - ) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 param 0) (the float (+ (-> a0-31 frame-group data 0 length) -1))) - (set! (-> a0-31 param 1) 0.66) - (joint-control-channel-group-eval! a0-31 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((a0-32 (-> self skel root-channel 1))) - (set! (-> a0-32 frame-interp) (-> self interp)) - (set! (-> a0-32 param 0) 0.0) - (joint-control-channel-group-eval! a0-32 (the-as art-joint-anim #f) num-func-chan) - ) + (seek! (-> self body flex-blend) (the-as float 0.0) (-> *display* seconds-per-frame)) + (seek! (-> self interp) (the-as float 0.0) (-> *display* seconds-per-frame)) + (ja :num! (seek! max 0.66)) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self interp)) (suspend) ) ) - (ja-channel-push! 1 75) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 frame-group) (the-as art-joint-anim (-> self draw art-group data 20))) - (set! (-> a0-35 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 20)) data 0 length) -1)) - ) - (set! (-> a0-35 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-35 frame-num) 0.0) - (joint-control-channel-group! a0-35 (the-as art-joint-anim (-> self draw art-group data 20)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-main-swallow-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1))) - (set! (-> a0-36 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event *target* 'end-mode) (logclear! (-> self skel status) (janim-status inited)) (go plant-boss-idle) (none) ) - :post - plant-boss-post + :post plant-boss-post ) (defstate plant-boss-reset (plant-boss) - :event - (-> plant-boss-eat event) - :code - (behavior ((arg0 int)) + :event (-> plant-boss-eat event) + :code (behavior ((arg0 int)) (let ((gp-0 #f)) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 10) - ) + ((ja-group? plant-boss-main-intro-ja) (set! gp-0 #t) - (ja-channel-push! 1 150) + (ja-channel-push! 1 (seconds 0.5)) ) (else - (ja-channel-push! 1 300) + (ja-channel-push! 1 (seconds 1)) ) ) - (let ((s4-0 (-> self skel root-channel 0))) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> s4-0 param 0) (ja-aframe (the-as float 210.0) 0)) - (set! (-> s4-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> s4-0 frame-num) 0.0) - (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-reset-ja :num! (seek! (ja-aframe (the-as float 210.0) 0)) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) - (set! (-> self body flex-blend) - (seek (-> self body flex-blend) (-> (new 'static 'array float 1 0.0) 0) (-> *display* seconds-per-frame)) - ) + (seek! (-> self body flex-blend) (the-as float 0.0) (-> *display* seconds-per-frame)) (if (>= 1 arg0) - (set! (-> self neck flex-blend) - (seek (-> self neck flex-blend) (-> (new 'static 'array float 1 1.0) 0) (-> *display* seconds-per-frame)) - ) + (seek! (-> self neck flex-blend) (the-as float 1.0) (-> *display* seconds-per-frame)) ) (suspend) - (let ((s4-1 (-> self skel root-channel 0))) - (set! (-> s4-1 param 0) (ja-aframe (the-as float 210.0) 0)) - (set! (-> s4-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 210.0) 0))) ) (if (< 1 arg0) (go plant-boss-attack (+ arg0 -1)) ) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> s5-1 param 0) (ja-aframe (the-as float 240.0) 0)) - (set! (-> s5-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> s5-1 frame-num) (ja-aframe (the-as float 210.0) 0)) - (joint-control-channel-group! s5-1 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-reset-ja + :num! (seek! (ja-aframe (the-as float 240.0) 0)) + :frame-num (ja-aframe (the-as float 210.0) 0) + ) (until (ja-done? 0) - (set! (-> self body flex-blend) - (seek (-> self body flex-blend) (-> (new 'static 'array float 1 0.0) 0) (-> *display* seconds-per-frame)) - ) - (set! (-> self neck flex-blend) (seek - (-> self neck flex-blend) - (-> (new 'static 'array float 1 1.0) 0) - (* 2.0 (-> *display* seconds-per-frame)) - ) - ) + (seek! (-> self body flex-blend) (the-as float 0.0) (-> *display* seconds-per-frame)) + (seek! (-> self neck flex-blend) (the-as float 1.0) (* 2.0 (-> *display* seconds-per-frame))) (suspend) - (let ((s5-2 (-> self skel root-channel 0))) - (set! (-> s5-2 param 0) (ja-aframe (the-as float 240.0) 0)) - (set! (-> s5-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! s5-2 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-23 (the-as art-joint-anim #f) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 240.0) 0))) ) + (ja-no-eval :num! (seek!)) (if gp-0 (go plant-boss-spawn) (go plant-boss-idle) @@ -2287,95 +1520,59 @@ ) (none) ) - :post - plant-boss-post + :post plant-boss-post ) (defstate plant-boss-hit (plant-boss) - :event - (-> plant-boss-eat event) - :code - (behavior ((arg0 symbol)) + :event (-> plant-boss-eat event) + :code (behavior ((arg0 symbol)) (let ((s5-0 (-> self child))) (while s5-0 (send-event (ppointer->process s5-0) 'hit arg0) (set! s5-0 (-> s5-0 0 brother)) ) ) - (set! (-> self health) - (seek (-> self health) (-> (new 'static 'array float 1 0.0) 0) (-> (new 'static 'array float 1 1.0) 0)) - ) + (seek! (-> self health) (the-as float 0.0) (the-as float 1.0)) (send-event (ppointer->process (-> self leaf 1)) 'kill 0) (send-event (ppointer->process (-> self leaf 0)) 'kill 0) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 60) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) (cond ((= arg0 'spin) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 20.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-1 frame-num) 0.0) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-hit-kick-ja + :num! (seek! (ja-aframe (the-as float 20.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe (the-as float 20.0) 0)) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 20.0) 0))) ) ) ((= arg0 'spin-air) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> gp-3 param 0) (ja-aframe (the-as float 20.0) 0)) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-3 frame-num) 0.0) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-hit-jumpkick-ja + :num! (seek! (ja-aframe (the-as float 20.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 param 0) (ja-aframe (the-as float 20.0) 0)) - (set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 20.0) 0))) ) ) (else - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 14))) - (set! (-> gp-5 param 0) (ja-aframe (the-as float 20.0) 0)) - (set! (-> gp-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-5 frame-num) 0.0) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 14)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-hit-ja :num! (seek! (ja-aframe (the-as float 20.0) 0)) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 param 0) (ja-aframe (the-as float 20.0) 0)) - (set! (-> gp-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 20.0) 0))) ) ) ) (if (= (-> self health) 0.0) (go plant-boss-dead #f) ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) @@ -2383,15 +1580,12 @@ (go plant-boss-spawn) (none) ) - :post - plant-boss-post + :post plant-boss-post ) (defstate plant-boss-dead (plant-boss) - :event - plant-boss-generic-event-handler - :code - (behavior ((arg0 symbol)) + :event plant-boss-generic-event-handler + :code (behavior ((arg0 symbol)) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self neck flex-blend) 0.0) (set! (-> self body flex-blend) 0.0) @@ -2403,16 +1597,7 @@ (cond (arg0 (ja-channel-set! 1) - (let ((s5-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 17)) - num-func-identity - ) - (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - ) + (ja :group! plant-boss-main-die-ja :num! max) (suspend) (if (not (task-complete? *game-info* (-> self entity extra perm task))) (birth-pickup-at-point @@ -2429,21 +1614,9 @@ (let ((s4-0 #f) (s5-2 #f) ) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 150) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.5)) + (ja-no-eval :group! plant-boss-main-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (when (< 100.0 (ja-aframe-num 0)) @@ -2474,11 +1647,7 @@ ) ) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) (the float (+ (-> a0-22 frame-group data 0 length) -1))) - (set! (-> a0-22 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -2502,12 +1671,11 @@ (set! (-> (find-prim-by-id (-> self root-override) (the-as uint 16)) prim-core action) (collide-action)) 0 (logior! (-> self mask) (process-mask actor-pause)) - (clear-pending-settings-from-process *setting-control* self 'music) + (remove-setting! 'music) (go plant-boss-dead-idle) (none) ) - :post - (behavior () + :post (behavior () (plant-boss-post) (do-push-aways! (-> self root-override)) (none) @@ -2515,13 +1683,12 @@ ) (defstate plant-boss-dead-idle (plant-boss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('bonk) (go plant-boss-dead-bounce (lerp-scale (the-as float 0.1) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 1.0) (the-as float (-> arg3 param 1)) (the-as float 40960.0) (the-as float 81920.0) @@ -2533,19 +1700,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 17)) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - ) + (ja :group! plant-boss-main-die-ja :num! max) (let ((gp-1 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 5)) (transform-post) @@ -2553,7 +1710,7 @@ (suspend) ) ) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -2562,18 +1719,15 @@ ) (defstate plant-boss-dead-bounce (plant-boss) - :event - plant-boss-generic-event-handler - :trans - (the-as (function none :behavior plant-boss) rider-trans) - :code - (behavior ((arg0 float)) + :event plant-boss-generic-event-handler + :trans (the-as (function none :behavior plant-boss) rider-trans) + :code (behavior ((arg0 float)) (let ((v1-2 (-> self entity extra perm))) (if (and (< 0.3 arg0) (and (not (handle->process (-> self money))) (< (-> v1-2 user-int8 1) 5))) (set! (-> self money) (ppointer->handle (birth-pickup-at-point (-> self node-list data 42 bone transform vector 3) (pickup-type money) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 1.0) #t self (the-as fact-info #f) @@ -2583,43 +1737,17 @@ ) ) (ja-channel-set! 2) - (let ((s5-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data 21)) - num-func-identity - ) - (set! (-> s5-0 frame-num) 0.0) - ) - (let ((s5-1 (-> self skel root-channel 1))) - (set! (-> s5-1 frame-interp) (- (-> (new 'static 'array float 1 1.0) 0) arg0)) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 17)) - num-func-identity - ) - (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - ) + (ja :group! plant-boss-main-bounce-ja :num! min) + (ja :chan 1 :group! plant-boss-main-die-ja :num! max :frame-interp (- 1.0 arg0)) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((v1-39 (-> self skel root-channel 1))) - (set! (-> v1-39 frame-interp) (- (-> (new 'static 'array float 1 1.0) 0) arg0)) - (set! (-> v1-39 num-func) num-func-identity) - (set! (-> v1-39 frame-num) (the float (+ (-> v1-39 frame-group data 0 length) -1))) - ) + (ja :num! (seek!)) + (ja :chan 1 :frame-interp (- 1.0 arg0) :num-func num-func-identity :frame-num max) ) (go plant-boss-dead-idle) (none) ) - :post - (the-as (function none :behavior plant-boss) rider-post) + :post (the-as (function none :behavior plant-boss) rider-post) ) (defmethod init-from-entity! plant-boss ((obj plant-boss) (arg0 entity-actor)) @@ -2653,7 +1781,7 @@ (set! (-> s2-2 collide-with) (collide-kind target)) (set! (-> s2-2 prim-core offense) (collide-offense no-offense)) (set! (-> s2-2 transform-index) 13) - (set-vector! (-> s2-2 local-sphere) 0.0 (-> (new 'static 'array float 1 8192.0) 0) 0.0 16384.0) + (set-vector! (-> s2-2 local-sphere) 0.0 8192.0 0.0 16384.0) (append-prim s3-0 s2-2) (set! (-> obj attack-prim 0) s2-2) ) @@ -2662,7 +1790,7 @@ (set! (-> s2-3 collide-with) (collide-kind)) (set! (-> s2-3 prim-core offense) (collide-offense no-offense)) (set! (-> s2-3 transform-index) 13) - (set-vector! (-> s2-3 local-sphere) 0.0 (-> (new 'static 'array float 1 8192.0) 0) 0.0 16384.0) + (set-vector! (-> s2-3 local-sphere) 0.0 8192.0 0.0 16384.0) (append-prim s3-0 s2-3) (set! (-> obj death-prim 0) s2-3) ) @@ -2683,211 +1811,120 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *plant-boss-sg* '()) (set! (-> obj draw shadow-ctrl) *plant-boss-shadow-control*) - (let ((s5-1 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-1 - (let ((t9-18 (method-of-type plant-boss-arm activate))) - (t9-18 (the-as plant-boss-arm s5-1) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - plant-boss-arm-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -24576.0 :z 8192.0 :w 1.0)) - (-> (new 'static 'array float 1 -8192.0) 0) - 1 - ) - (-> s5-1 ppointer) - ) + (process-spawn + plant-boss-arm + :init plant-boss-arm-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -24576.0 :z 8192.0 :w 1.0)) + -8192.0 + 1 + :to obj ) - (let ((s5-2 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-2 - (let ((t9-21 (method-of-type plant-boss-arm activate))) - (t9-21 (the-as plant-boss-arm s5-2) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-2 - plant-boss-arm-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 24576.0 :z 8192.0 :w 1.0)) - (-> (new 'static 'array float 1 8192.0) 0) - 0 - ) - (-> s5-2 ppointer) - ) + (process-spawn + plant-boss-arm + :init plant-boss-arm-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 24576.0 :z 8192.0 :w 1.0)) + 8192.0 + 0 + :to obj ) - (let ((s5-3 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-3 - (let ((t9-24 (method-of-type plant-boss-arm activate))) - (t9-24 (the-as plant-boss-arm s5-3) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-3 - plant-boss-back-arms-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :w 1.0)) - (-> (new 'static 'array float 1 0.0) 0) - 2 - ) - (-> s5-3 ppointer) - ) + (process-spawn + plant-boss-arm + :init plant-boss-back-arms-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :w 1.0)) + 0.0 + 2 + :to obj ) - (let ((s5-4 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-4 - (let ((t9-27 (method-of-type plant-boss-arm activate))) - (t9-27 (the-as plant-boss-arm s5-4) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-4 - plant-boss-vine-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 38912.0 :z 8192.0 :w 1.0)) - (new 'static 'vector :y 14563.556) - (-> (new 'static 'array float 1 1.0) 0) - 3 - ) - (-> s5-4 ppointer) - ) + (process-spawn + plant-boss-arm + :init plant-boss-vine-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 38912.0 :z 8192.0 :w 1.0)) + (new 'static 'vector :y 14563.556) + 1.0 + 3 + :to obj ) - (let ((s5-5 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-5 - (let ((t9-30 (method-of-type plant-boss-arm activate))) - (t9-30 (the-as plant-boss-arm s5-5) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-5 - plant-boss-vine-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -40960.0 :z 8192.0 :w 1.0)) - (new 'static 'vector :y -5461.3335) - (-> (new 'static 'array float 1 1.0) 0) - 3 - ) - (-> s5-5 ppointer) - ) + (process-spawn + plant-boss-arm + :init plant-boss-vine-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -40960.0 :z 8192.0 :w 1.0)) + (new 'static 'vector :y -5461.3335) + 1.0 + 3 + :to obj ) - (let ((s5-6 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-6 - (let ((t9-33 (method-of-type plant-boss-arm activate))) - (t9-33 (the-as plant-boss-arm s5-6) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-6 - plant-boss-vine-init - (vector+! - (new-stack-vector0) - (-> obj root-override trans) - (new 'static 'vector :x -29491.2 :z -7168.0 :w 1.0) + (process-spawn + plant-boss-arm + :init plant-boss-vine-init + (vector+! + (new-stack-vector0) + (-> obj root-override trans) + (new 'static 'vector :x -29491.2 :z -7168.0 :w 1.0) + ) + (new 'static 'vector :x -1820.4445 :y -11286.756) + 0.8 + 3 + :to obj + ) + (process-spawn + plant-boss-arm + :init plant-boss-vine-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 32768.0 :z -3072.0 :w 1.0)) + (new 'static 'vector :x -910.2222 :y 22755.555) + 0.8 + 3 + :to obj + ) + (process-spawn + plant-boss-arm + :init plant-boss-root-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 18841.6 :z 4096.0 :w 1.0)) + (new 'static 'vector :y -4096.0) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + 4 + :to obj + ) + (process-spawn + plant-boss-arm + :init plant-boss-root-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -18841.6 :z 4096.0 :w 1.0)) + (new 'static 'vector :x 364.0889 :y 4096.0) + (new 'static 'vector :x 1.0 :y 1.25 :z 1.0) + 4 + :to obj + ) + (process-spawn + plant-boss-arm + :init plant-boss-root-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :z -2048.0 :w 1.0)) + (new 'static 'vector :x 1820.4445) + (new 'static 'vector :x 0.9 :y 1.5 :z 1.0) + 4 + :to obj + ) + (set! (-> obj leaf 0) + (process-spawn + plant-boss-leaf + :init plant-boss-leaf-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :w 1.0)) + 0.0 + 0 + :to obj ) - (new 'static 'vector :x -1820.4445 :y -11286.756) - (-> (new 'static 'array float 1 0.8) 0) - 3 ) - (-> s5-6 ppointer) - ) - ) - (let ((s5-7 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-7 - (let ((t9-36 (method-of-type plant-boss-arm activate))) - (t9-36 (the-as plant-boss-arm s5-7) obj 'plant-boss-arm (the-as pointer #x70004000)) + (set! (-> obj leaf 1) (process-spawn + plant-boss-leaf + :init plant-boss-leaf-init + (vector+! + (new-stack-vector0) + (-> obj root-override trans) + (new 'static 'vector :x -13189.12 :y 2838.528 :z 12288.0 :w 1.0) + ) + 0.0 + 1 + :to obj + ) ) - (run-now-in-process - s5-7 - plant-boss-vine-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 32768.0 :z -3072.0 :w 1.0)) - (new 'static 'vector :x -910.2222 :y 22755.555) - (-> (new 'static 'array float 1 0.8) 0) - 3 - ) - (-> s5-7 ppointer) - ) - ) - (let ((s5-8 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-8 - (let ((t9-39 (method-of-type plant-boss-arm activate))) - (t9-39 (the-as plant-boss-arm s5-8) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-8 - plant-boss-root-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 18841.6 :z 4096.0 :w 1.0)) - (new 'static 'vector :y -4096.0) - (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) - 4 - ) - (-> s5-8 ppointer) - ) - ) - (let ((s5-9 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-9 - (let ((t9-42 (method-of-type plant-boss-arm activate))) - (t9-42 (the-as plant-boss-arm s5-9) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-9 - plant-boss-root-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -18841.6 :z 4096.0 :w 1.0)) - (new 'static 'vector :x 364.0889 :y 4096.0) - (new 'static 'vector :x 1.0 :y 1.25 :z 1.0) - 4 - ) - (-> s5-9 ppointer) - ) - ) - (let ((s5-10 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-10 - (let ((t9-45 (method-of-type plant-boss-arm activate))) - (t9-45 (the-as plant-boss-arm s5-10) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-10 - plant-boss-root-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :z -2048.0 :w 1.0)) - (new 'static 'vector :x 1820.4445) - (new 'static 'vector :x 0.9 :y 1.5 :z 1.0) - 4 - ) - (-> s5-10 ppointer) - ) - ) - (let ((s5-11 (get-process *default-dead-pool* plant-boss-leaf #x4000))) - (set! (-> obj leaf 0) - (the-as - (pointer plant-boss-leaf) - (when s5-11 - (let ((t9-48 (method-of-type plant-boss-leaf activate))) - (t9-48 (the-as plant-boss-leaf s5-11) obj 'plant-boss-leaf (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-11 - plant-boss-leaf-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :w 1.0)) - (-> (new 'static 'array float 1 0.0) 0) - 0 - ) - (-> s5-11 ppointer) - ) - ) - ) - ) - (let ((s5-12 (get-process *default-dead-pool* plant-boss-leaf #x4000))) - (set! (-> obj leaf 1) - (the-as - (pointer plant-boss-leaf) - (when s5-12 - (let ((t9-51 (method-of-type plant-boss-leaf activate))) - (t9-51 (the-as plant-boss-leaf s5-12) obj 'plant-boss-leaf (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-12 - plant-boss-leaf-init - (vector+! - (new-stack-vector0) - (-> obj root-override trans) - (new 'static 'vector :x -13189.12 :y 2838.528 :z 12288.0 :w 1.0) - ) - (-> (new 'static 'array float 1 0.0) 0) - 1 - ) - (-> s5-12 ppointer) - ) - ) - ) - ) (set! (-> obj energy) 0.25) (set! (-> obj health) 3.0) (set! (-> obj cam-tracker) (the-as handle #f)) @@ -2895,24 +1932,12 @@ (set! (-> obj money) (the-as handle #f)) (set! (-> obj try-inc) #f) (set! (-> obj neck) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj 13)) - (set-vector! - (-> obj neck twist-max) - 3640.889 - (-> (new 'static 'array float 1 8192.0) 0) - 0.0 - (-> (new 'static 'array float 1 1.0) 0) - ) + (set-vector! (-> obj neck twist-max) 3640.889 8192.0 0.0 1.0) (set! (-> obj neck up) (the-as uint 0)) (set! (-> obj neck nose) (the-as uint 1)) (set! (-> obj neck ear) (the-as uint 2)) (set! (-> obj body) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj 4)) - (set-vector! - (-> obj body twist-max) - 0.0 - (-> (new 'static 'array float 1 8192.0) 0) - 0.0 - (-> (new 'static 'array float 1 1.0) 0) - ) + (set-vector! (-> obj body twist-max) 0.0 8192.0 0.0 1.0) (set! (-> obj body up) (the-as uint 1)) (set! (-> obj body nose) (the-as uint 0)) (set! (-> obj body ear) (the-as uint 2)) diff --git a/goal_src/levels/jungleb/plat-flip.gc b/goal_src/levels/jungleb/plat-flip.gc index 91f7287e17..30339dd17f 100644 --- a/goal_src/levels/jungleb/plat-flip.gc +++ b/goal_src/levels/jungleb/plat-flip.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/plat-flip-ag.gc") + (deftype plat-flip (process-drawable) ((root-override collide-shape-moving :offset 112) (path-pos float :offset-assert 176) @@ -29,99 +31,65 @@ ) -(defskelgroup *plat-flip-sg* plat-flip - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *plat-flip-sg* plat-flip plat-flip-geo-jg plat-flip-turn-down-ja + ((plat-flip-geo-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) (defstate plat-flip-idle (plat-flip) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'bonk) (activate! (-> self smush) -1.0 90 300 1.0 1.0) ) ((= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) (the-as smush-control #f) ) ) ) ) ) - :trans - (the-as (function none :behavior plat-flip) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior plat-flip) rider-trans) + :code (behavior () (local-vars (f30-0 float) (f30-1 float)) (let ((gp-0 #f)) - (while #t + (loop (let ((f0-1 (get-current-value (-> self sync) (-> self total-time)))) (cond ((< f0-1 (-> self before-turn-down-time)) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! plat-flip-turn-down-ja :num! min) (set! gp-0 #f) ) ((begin (set! f30-0 (- f0-1 (-> self before-turn-down-time))) (< f30-0 (-> self turn-down-time))) (when (not gp-0) (set! gp-0 #t) - (sound-play-by-name (static-sound-name "plat-flip") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plat-flip") ) - (let ((s5-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity + (ja :group! plat-flip-turn-down-ja + :num! (identity (/ (* f30-0 (the float (+ (-> (the-as art-joint-anim plat-flip-turn-down-ja) data 0 length) -1))) + (-> self turn-down-time) + ) + ) ) - (set! (-> s5-1 frame-num) - (/ (* f30-0 (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1))) - (-> self turn-down-time) - ) - ) - ) ) ((begin (set! f30-1 (- f30-0 (-> self turn-down-time))) (< f30-1 (-> self before-turn-up-time))) (set! gp-0 #f) - (let ((s5-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-2 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> s5-2 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - ) + (ja :group! plat-flip-turn-down-ja :num! max) ) (else (when (not gp-0) (set! gp-0 #t) - (sound-play-by-name (static-sound-name "plat-flip") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plat-flip") ) - (let ((f30-2 (- f30-1 (-> self before-turn-up-time))) - (s5-4 (-> self skel root-channel 0)) + (let ((f30-2 (- f30-1 (-> self before-turn-up-time)))) + (ja :group! plat-flip-turn-up-ja + :num! (identity (/ (* f30-2 (the float (+ (-> (the-as art-joint-anim plat-flip-turn-up-ja) data 0 length) -1))) + (-> self turn-up-time) + ) + ) ) - (joint-control-channel-group-eval! - s5-4 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> s5-4 frame-num) - (/ (* f30-2 (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1))) - (-> self turn-up-time) - ) - ) ) ) ) @@ -136,8 +104,7 @@ ) (none) ) - :post - (the-as (function none :behavior plat-flip) rider-post) + :post (the-as (function none :behavior plat-flip) rider-post) ) (defmethod init-from-entity! plat-flip ((obj plat-flip) (arg0 entity-actor)) diff --git a/goal_src/levels/lavatube/assistant-lavatube.gc b/goal_src/levels/lavatube/assistant-lavatube.gc index 5fa09f1261..dcbbcd4819 100644 --- a/goal_src/levels/lavatube/assistant-lavatube.gc +++ b/goal_src/levels/lavatube/assistant-lavatube.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/assistant-lavatube-start-ag.gc") + (deftype assistant-lavatube-start (process-taskable) () :heap-base #x110 @@ -16,14 +18,11 @@ ) -(defskelgroup *assistant-lavatube-start-sg* assistant-lavatube-start - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *assistant-lavatube-start-sg* assistant-lavatube-start assistant-lavatube-start-lod0-jg assistant-lavatube-start-idle-ja + ((assistant-lavatube-start-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow assistant-lavatube-start-shadow-mg + ) (defmethod play-anim! assistant-lavatube-start ((obj assistant-lavatube-start) (arg0 symbol)) (case (current-status (-> obj tasks)) @@ -35,8 +34,7 @@ :name "assistant-lavatube-start-resolution" :index 5 :parts 11 - :command-list - '((232 joint "cameraB") (491 joint "camera") (866 joint "cameraB") (1061 joint "camera")) + :command-list '((232 joint "cameraB") (491 joint "camera") (866 joint "cameraB") (1061 joint "camera")) ) ) (else @@ -59,8 +57,7 @@ (defstate hidden (assistant-lavatube-start) :virtual #t - :trans - (behavior () + :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) (when (and (cond ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) @@ -116,77 +113,29 @@ (defstate idle (assistant-lavatube-start) :virtual #t - :code - (behavior () - (while #t - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + :code (behavior () + (loop + (when (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 3)) ) (let* ((f30-0 2.0) (v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-8 (the-as number (logior #x3f800000 v1-7))) ) (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-8)))) 2)) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-12 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! - a0-12 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (ja-channel-push! 1 15) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) diff --git a/goal_src/levels/lavatube/lavatube-energy.gc b/goal_src/levels/lavatube/lavatube-energy.gc index 3141082c6d..e33154d55c 100644 --- a/goal_src/levels/lavatube/lavatube-energy.gc +++ b/goal_src/levels/lavatube/lavatube-energy.gc @@ -7,16 +7,20 @@ ;; DECOMP BEGINS +(import "goal_src/import/energyball-ag.gc") +(import "goal_src/import/energybase-ag.gc") +(import "goal_src/import/energyhub-ag.gc") +(import "goal_src/import/energyarm-ag.gc") +(import "goal_src/import/energydoor-ag.gc") + (defpartgroup group-energyarm :id 544 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1931 :fade-after (meters 120)) (sp-item 2167 :fade-after (meters 60) :falloff-to (meters 60))) + :parts ((sp-item 1931 :fade-after (meters 120)) (sp-item 2167 :fade-after (meters 60) :falloff-to (meters 60))) ) (defpart 1931 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -34,8 +38,7 @@ ) (defpart 2167 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 8.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -61,8 +64,7 @@ (defpartgroup group-energyball-always :id 545 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2168 :fade-after (meters 80) :falloff-to (meters 80)) + :parts ((sp-item 2168 :fade-after (meters 80) :falloff-to (meters 80)) (sp-item 2169 :fade-after (meters 120)) (sp-item 2170 :fade-after (meters 120)) (sp-item 2171 :fade-after (meters 120) :flags (is-3d)) @@ -74,8 +76,7 @@ ) (defpart 2168 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-y (meters -5.5)) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) @@ -100,8 +101,7 @@ ) (defpart 2176 - :init-specs - ((sp-flt spt-scale-x (meters 1.2)) + :init-specs ((sp-flt spt-scale-x (meters 1.2)) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-a 48.0) (sp-int spt-timer 5) @@ -109,8 +109,7 @@ ) (defpart 2177 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -133,8 +132,7 @@ ) (defpart 2169 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -5.5)) (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0) @@ -149,8 +147,7 @@ ) (defpart 2170 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -5.5)) (sp-rnd-flt spt-scale-x (meters 12) (meters 8) 1.0) @@ -166,8 +163,7 @@ ) (defpart 2171 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -5)) (sp-rnd-flt spt-scale-x (meters 12) (meters 8) 1.0) @@ -186,8 +182,7 @@ ) (defpart 2172 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-y (meters -5.5)) (sp-flt spt-scale-x (meters 0.5)) @@ -207,8 +202,7 @@ ) (defpart 2173 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 6) 1.0) (sp-int spt-rot-x 4) @@ -227,13 +221,11 @@ ) (defpart 2178 - :init-specs - ((sp-flt spt-b 0.0) (sp-flt spt-a 64.0) (sp-flt spt-fade-g -4.266667)) + :init-specs ((sp-flt spt-b 0.0) (sp-flt spt-a 64.0) (sp-flt spt-fade-g -4.266667)) ) (defpart 2174 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0) (sp-int spt-rot-x 4) @@ -252,8 +244,7 @@ ) (defpart 2175 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0) (sp-int spt-rot-x 4) @@ -275,8 +266,7 @@ :id 546 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 45) - :parts - ((sp-item 2179 :period 600 :length 5) + :parts ((sp-item 2179 :period 600 :length 5) (sp-item 2180 :period 600 :length 40) (sp-item 2181 :period 600 :length 20) (sp-item 2182 :period 600 :length 20) @@ -284,8 +274,7 @@ ) (defpart 2180 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) @@ -310,13 +299,11 @@ ) (defpart 2183 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) (defpart 2182 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 0.4)) @@ -334,8 +321,7 @@ ) (defpart 2179 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 40)) @@ -351,8 +337,7 @@ ) (defpart 2181 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters -2) (meters 4) 1.0) @@ -397,13 +382,10 @@ ) -(defskelgroup *energydoor-sg* energydoor - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 14 0 35) - :longest-edge (meters 0) - ) +(defskelgroup *energydoor-sg* energydoor energydoor-lod0-jg energydoor-idle-ja + ((energydoor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 14 0 35) + ) (defbehavior energydoor-player-dist energydoor () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -436,43 +418,12 @@ ) (defstate energydoor-closing (energydoor) - :event - energydoor-closed-handler - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) 0.0) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :event energydoor-closed-handler + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 0.0) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) (if (or (task-closed? (-> self entity extra perm task) (task-status need-resolution)) (< (energydoor-player-dist) 0.0) @@ -482,15 +433,12 @@ ) (none) ) - :post - (the-as (function none :behavior energydoor) transform-post) + :post (the-as (function none :behavior energydoor) transform-post) ) (defstate energydoor-opened (energydoor) - :event - energydoor-open-handler - :trans - (behavior () + :event energydoor-open-handler + :trans (behavior () (let ((f30-0 (energydoor-player-dist))) (cond ((< f30-0 -450560.0) @@ -521,14 +469,10 @@ ) (none) ) - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) (the float (+ (-> v1-2 frame-group data 0 length) -1))) - ) + :code (behavior () + (ja :num-func num-func-identity :frame-num max) (transform-post) - (while #t + (loop (suspend) ) (none) @@ -536,56 +480,22 @@ ) (defstate energydoor-opening (energydoor) - :event - energydoor-open-handler - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :event energydoor-open-handler + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go energydoor-opened) (none) ) - :post - (the-as (function none :behavior energydoor) transform-post) + :post (the-as (function none :behavior energydoor) transform-post) ) (defstate energydoor-closed-till-task (energydoor) - :event - energydoor-closed-handler - :trans - (behavior () + :event energydoor-closed-handler + :trans (behavior () (cond ((task-closed? (-> self entity extra perm task) (task-status need-resolution)) (go energydoor-opening) @@ -610,14 +520,10 @@ ) (none) ) - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) 0.0) - ) + :code (behavior () + (ja :num-func num-func-identity :frame-num 0.0) (transform-post) - (while #t + (loop (suspend) ) (none) @@ -625,23 +531,17 @@ ) (defstate energydoor-closed-till-near (energydoor) - :event - energydoor-closed-handler - :trans - (behavior () + :event energydoor-closed-handler + :trans (behavior () (if (< -409600.0 (energydoor-player-dist)) (go energydoor-opening) ) (none) ) - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) 0.0) - ) + :code (behavior () + (ja :num-func num-func-identity :frame-num 0.0) (transform-post) - (while #t + (loop (suspend) ) (none) @@ -726,19 +626,15 @@ ) -(defskelgroup *energybase-sg* energybase - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 40 0 40) - :longest-edge (meters 0) - ) +(defskelgroup *energybase-sg* energybase energybase-lod0-jg energybase-idle-ja + ((energybase-lod0-mg (meters 999999))) + :bounds (static-spherem 0 40 0 40) + ) (defstate energybase-stopped (energybase) - :code - (behavior () + :code (behavior () (ja-post) - (while #t + (loop (suspend) ) (none) @@ -746,68 +642,35 @@ ) (defstate energybase-stopping (energybase) - :code - (behavior () + :code (behavior () (let ((f30-0 1.0)) - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) f30-0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (set! f30-0 (- f30-0 (* 0.002 (-> *display* time-adjust-ratio)))) (if (< f30-0 0.0) (go energybase-stopped) ) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) f30-0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) (none) ) - :post - (the-as (function none :behavior energybase) ja-post) + :post (the-as (function none :behavior energybase) ja-post) ) (defstate energybase-idle (energybase) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('stop) (go energybase-stopping) ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (and *target* (>= 307200.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (game-text-id lavatube-shoot-the-spheres) @@ -817,45 +680,15 @@ (game-task none) ) ) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-2 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior energybase) ja-post) + :post (the-as (function none :behavior energybase) ja-post) ) (defmethod init-from-entity! energybase ((obj energybase) (arg0 entity-actor)) @@ -934,51 +767,37 @@ ) -(defskelgroup *energyball-sg* energyball - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *energyball-sg* energyball energyball-lod0-jg energyball-idle-ja + ((energyball-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) (defstate energyball-idle (energyball) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) - (the-as - object - (when (= v1-0 'attack) - (when (and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow)) - (increment-success-for-hint (game-text-id lavatube-shoot-the-spheres)) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 546) - 600 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (the-as object (when (= v1-0 'attack) + (when (and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow)) + (increment-success-for-hint (game-text-id lavatube-shoot-the-spheres)) + (sound-play "dcrate-break") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 546) + 600 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* + ) + (cleanup-for-death self) + (deactivate self) + ) + ) ) - (cleanup-for-death self) - (deactivate self) - ) - ) - ) ) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (spawn (-> self part) (-> self root-override trans)) (let* ((v1-3 (-> self parent-overide)) @@ -1006,48 +825,17 @@ ) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior energyball) rider-post) + :post (the-as (function none :behavior energyball) rider-post) ) (defun energyball-init ((arg0 energyball)) @@ -1082,13 +870,10 @@ (none) ) -(defskelgroup *energyarm-sg* energyarm - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 -20 17) - :longest-edge (meters 0) - ) +(defskelgroup *energyarm-sg* energyarm energyarm-lod0-jg energyarm-idle-ja + ((energyarm-lod0-mg (meters 20)) (energyarm-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 -20 17) + ) (defbehavior energyarm-trans energyarm () (rider-trans) @@ -1129,78 +914,42 @@ ) (defstate energyarm-stop (energyarm) - :enter - (behavior () + :enter (behavior () '() (none) ) - :trans - (behavior () + :trans (behavior () (update! (-> self x-rotation) 0.0) (update! (-> self y-chatter-rotation) 0.0) (energyarm-trans) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior energyarm) rider-post) + :post (the-as (function none :behavior energyarm) rider-post) ) (defstate energyarm-no-ball (energyarm) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('stop) (go energyarm-stop) ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self y-chatter-rotation osc target) 1.0) (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self x-correction) (fmax -1.0 (+ -0.1 (-> self x-correction)))) (update! (-> self x-rotation) 0.0) (when (at-min? (-> self x-rotation)) @@ -1226,58 +975,25 @@ (energyarm-trans) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior energyarm) rider-post) + :post (the-as (function none :behavior energyarm) rider-post) ) (defstate energyarm-fall (energyarm) - :enter - (behavior () + :enter (behavior () (set! (-> self x-fall-rotation osc target) 1.0) (none) ) - :trans - (behavior () + :trans (behavior () (update! (-> self x-fall-rotation) 0.0) (update! (-> self y-chatter-rotation) 0.0) (when (at-max? (-> self x-fall-rotation)) @@ -1290,61 +1006,28 @@ (energyarm-trans) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior energyarm) rider-post) + :post (the-as (function none :behavior energyarm) rider-post) ) (defstate energyarm-idle (energyarm) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('stop) (go energyarm-stop) ) ) ) - :trans - (behavior () + :trans (behavior () (update! (-> self x-rotation) 0.0) (when (at-min? (-> self x-rotation)) (let* ((f30-0 0.15) @@ -1382,33 +1065,25 @@ ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (-> self skel root-channel 0))) (set! (-> gp-0 num-func) num-func-identity) - (let* ((v1-4 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-5 (the-as number (logior #x3f800000 v1-4))) - ) - (set! (-> gp-0 frame-num) (* (+ -1.0 (the-as float v1-5)) (the float (ja-num-frames 0)))) - ) + (set! (-> gp-0 frame-num) (* (rand-float-gen) (the float (ja-num-frames 0)))) ) - (while #t + (loop (suspend) (let* ((f30-1 0.25) (f28-0 0.25) (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-10 (the-as number (logior #x3f800000 v1-9))) (f0-9 (+ f30-1 (* f28-0 (+ -1.0 (the-as float v1-10))))) - (a0-5 (-> self skel root-channel 0)) ) - (set! (-> a0-5 param 0) f0-9) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-loop!) + (ja :num! (loop! f0-9)) ) ) (none) ) - :post - (the-as (function none :behavior energyarm) rider-post) + :post (the-as (function none :behavior energyarm) rider-post) ) (defun energyarm-init ((arg0 energyarm)) @@ -1468,31 +1143,17 @@ (go energyarm-stop) ) (else - (let ((gp-1 (get-process *default-dead-pool* energyball #x4000))) - (set! (-> self ball) - (ppointer->handle (when gp-1 - (let ((t9-10 (method-of-type energyball activate))) - (t9-10 (the-as energyball gp-1) self 'energyball (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 energyball-init-by-other (-> self root-override trans)) - (-> gp-1 ppointer) - ) - ) - ) - ) + (set! (-> self ball) (ppointer->handle (process-spawn energyball (-> self root-override trans) :to self))) (go energyarm-idle) ) ) (none) ) -(defskelgroup *energyhub-sg* energyhub - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *energyhub-sg* energyhub energyhub-lod0-jg energyhub-idle-ja + ((energyhub-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 10) + ) (defbehavior energyhub-trans energyhub () (+! (-> self y-rotation) @@ -1550,8 +1211,7 @@ ) (defstate energyhub-stopped (energyhub) - :enter - (behavior () + :enter (behavior () (set! (-> self rotation-speed target) 0.0) (set! (-> self rotation-speed accel) 0.0005) (dotimes (gp-0 5) @@ -1562,37 +1222,31 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (update! (-> self rotation-speed) 0.0) (energyhub-trans) (energyhub-set-lava-height -122880.0) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) (let* ((f30-0 1.0) (f28-0 0.25) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-2 (the-as number (logior #x3f800000 v1-1))) (f0-4 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-2))))) - (a0-2 (-> self skel root-channel 0)) ) - (set! (-> a0-2 param 0) f0-4) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) + (ja :num! (loop! f0-4)) ) ) (none) ) - :post - (the-as (function none :behavior energyhub) ja-post) + :post (the-as (function none :behavior energyhub) ja-post) ) (defstate energyhub-stop (energyhub) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'flash) (let ((f0-0 1.9921875)) @@ -1603,8 +1257,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self rotation-speed target) 0.0) (set! (-> self rotation-speed accel) 0.0005) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -1650,8 +1303,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (update! (-> self rotation-speed) 0.0) (energyhub-trans) (energyhub-set-lava-height -122880.0) @@ -1660,30 +1312,25 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) (let* ((f30-0 1.0) (f28-0 0.25) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-2 (the-as number (logior #x3f800000 v1-1))) (f0-4 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-2))))) - (a0-2 (-> self skel root-channel 0)) ) - (set! (-> a0-2 param 0) f0-4) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) + (ja :num! (loop! f0-4)) ) ) (none) ) - :post - (the-as (function none :behavior energyhub) ja-post) + :post (the-as (function none :behavior energyhub) ja-post) ) (defstate energyhub-idle (energyhub) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'flash) (let ((f0-0 1.9921875)) @@ -1694,8 +1341,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (nonzero? (-> self sound)) (update! (-> self sound)) ) @@ -1744,25 +1390,21 @@ (energyhub-trans) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) (let* ((f30-0 1.0) (f28-0 0.25) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-2 (the-as number (logior #x3f800000 v1-1))) (f0-4 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-2))))) - (a0-2 (-> self skel root-channel 0)) ) - (set! (-> a0-2 param 0) f0-4) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) + (ja :num! (loop! f0-4)) ) ) (none) ) - :post - (the-as (function none :behavior energyhub) ja-post) + :post (the-as (function none :behavior energyhub) ja-post) ) (defmethod init-from-entity! energyhub ((obj energyhub) (arg0 entity-actor)) @@ -1783,18 +1425,7 @@ (set-vector! s5-2 0.0 2457.6 -24576.0 1.0) (matrix-rotate-y! s4-1 f30-0) (dotimes (s3-0 5) - (let ((s2-0 (get-process *default-dead-pool* energyarm #x4000))) - (set! (-> obj arm s3-0) - (ppointer->handle (when s2-0 - (let ((t9-9 (method-of-type energyarm activate))) - (t9-9 (the-as energyarm s2-0) obj 'energyarm (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 energyarm-init-by-other s5-2 (* (the float s3-0) f30-0)) - (-> s2-0 ppointer) - ) - ) - ) - ) + (set! (-> obj arm s3-0) (ppointer->handle (process-spawn energyarm s5-2 (* (the float s3-0) f30-0) :to obj))) (vector-matrix*! s5-2 s5-2 s4-1) ) ) @@ -1829,57 +1460,20 @@ ) -(defskelgroup *energylava-sg* energylava - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 120) - :longest-edge (meters 0) - ) +(defskelgroup *energylava-sg* energylava 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 120)) (defstate energylava-idle (energylava) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior energylava) ja-post) + :post (the-as (function none :behavior energylava) ja-post) ) (defmethod init-from-entity! energylava ((obj energylava) (arg0 entity-actor)) diff --git a/goal_src/levels/lavatube/lavatube-obs.gc b/goal_src/levels/lavatube/lavatube-obs.gc index c5de11221f..bf0292b7f5 100644 --- a/goal_src/levels/lavatube/lavatube-obs.gc +++ b/goal_src/levels/lavatube/lavatube-obs.gc @@ -7,6 +7,16 @@ ;; DECOMP BEGINS +(import "goal_src/import/lavafallsewerb-ag.gc") +(import "goal_src/import/lavashortcut-ag.gc") +(import "goal_src/import/lavabase-ag.gc") +(import "goal_src/import/lavafallsewera-ag.gc") +(import "goal_src/import/chainmine-ag.gc") +(import "goal_src/import/lavafall-ag.gc") +(import "goal_src/import/lavaballoon-ag.gc") +(import "goal_src/import/darkecobarrel-ag.gc") +(import "goal_src/import/lavayellowtarp-ag.gc") + (deftype lavabase (process-drawable) () :heap-base #x40 @@ -19,57 +29,24 @@ ) -(defskelgroup *lavabase-sg* lavabase - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 22) - :longest-edge (meters 9.4) - ) +(defskelgroup *lavabase-sg* lavabase lavabase-lod0-jg lavabase-idle-ja + ((lavabase-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 22) + :longest-edge (meters 9.4) + ) (defstate lavabase-idle (lavabase) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior lavabase) ja-post) + :post (the-as (function none :behavior lavabase) ja-post) ) (defmethod init-from-entity! lavabase ((obj lavabase) (arg0 entity-actor)) @@ -92,57 +69,24 @@ ) -(defskelgroup *lavafall-sg* lavafall - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 10 0 13) - :longest-edge (meters 5.4) - ) +(defskelgroup *lavafall-sg* lavafall lavafall-lod0-jg lavafall-idle-ja + ((lavafall-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 13) + :longest-edge (meters 5.4) + ) (defstate lavafall-idle (lavafall) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior lavafall) ja-post) + :post (the-as (function none :behavior lavafall) ja-post) ) (defmethod init-from-entity! lavafall ((obj lavafall) (arg0 entity-actor)) @@ -165,57 +109,24 @@ ) -(defskelgroup *lavashortcut-sg* lavashortcut - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -34 0 105) - :longest-edge (meters 11.9) - ) +(defskelgroup *lavashortcut-sg* lavashortcut lavashortcut-lod0-jg lavashortcut-idle-ja + ((lavashortcut-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -34 0 105) + :longest-edge (meters 11.9) + ) (defstate lavashortcut-idle (lavashortcut) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior lavashortcut) ja-post) + :post (the-as (function none :behavior lavashortcut) ja-post) ) (defmethod init-from-entity! lavashortcut ((obj lavashortcut) (arg0 entity-actor)) @@ -230,13 +141,11 @@ :id 540 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1932 :period 15 :length 5)) + :parts ((sp-item 1932 :period 15 :length 5)) ) (defpart 1932 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 2) 1.0) @@ -264,8 +173,7 @@ :id 541 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2125 :period 600 :length 5) + :parts ((sp-item 2125 :period 600 :length 5) (sp-item 2126 :period 600 :length 40) (sp-item 2127 :period 600 :length 20) (sp-item 2128 :period 600 :length 20) @@ -338,8 +246,7 @@ ) (defpart 2166 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters -2) (meters 4) 1.0) @@ -358,8 +265,7 @@ ) (defpart 2126 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -384,13 +290,11 @@ ) (defpart 2129 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) (defpart 2128 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 0.4)) @@ -408,8 +312,7 @@ ) (defpart 2125 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 32)) @@ -425,8 +328,7 @@ ) (defpart 2127 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 2) 1.0) @@ -520,13 +422,11 @@ ) ) -(defskelgroup *darkecobarrel-sg* darkecobarrel - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -7.75 0 8.6) - :longest-edge (meters 2.8) - ) +(defskelgroup *darkecobarrel-sg* darkecobarrel darkecobarrel-lod0-jg darkecobarrel-idle-ja + ((darkecobarrel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -7.75 0 8.6) + :longest-edge (meters 2.8) + ) (defbehavior darkecobarrel-base-time darkecobarrel-base () (+ (-> *display* base-frame-counter) (-> self sync)) @@ -596,23 +496,24 @@ ) (defstate darkecobarrel-mover-die (darkecobarrel-mover) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root-override trans quad)) (set! (-> gp-1 y) (+ -49152.0 (-> gp-1 y))) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 541) 600 #f #f #f gp-1) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 541) + 600 + #f + #f + #f + gp-1 + :to *entity-pool* ) ) (suspend) @@ -627,8 +528,7 @@ ) (defstate darkecobarrel-mover-move (darkecobarrel-mover) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (cond @@ -640,17 +540,7 @@ (-> self root-override) (the-as uint 1) ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack-invinc) - (set! (-> a1-2 param 0) s5-0) - (let ((a0-4 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-4 mode) 'death) - (set! (-> a1-2 param 1) (the-as uint a0-4)) - ) - (send-event-function arg0 a1-2) - ) + (send-event arg0 'attack-invinc s5-0 (static-attack-info ((mode 'death)))) ) (go darkecobarrel-mover-die) ) @@ -700,8 +590,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (update! (-> self y-offset) 0.0) (if (and (at-min? (-> self y-offset)) (< (-> self y-offset osc vel) 0.03)) (set! (-> self y-offset osc vel) (fabs (update! (-> self y-offset-tgt)))) @@ -710,34 +599,23 @@ (darkecobarrel-mover-pos) (none) ) - :code - (behavior () - (let* ((f30-0 0.9) - (f28-0 0.25) - (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-2)))) + :code (behavior () + (let ((f30-0 0.9) + (f28-0 0.25) + ) + (+ f30-0 (* f28-0 (rand-float-gen))) ) (let ((gp-0 (-> self skel root-channel 0))) (set! (-> gp-0 num-func) num-func-identity) - (let* ((v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-9 (the-as number (logior #x3f800000 v1-8))) - ) - (set! (-> gp-0 frame-num) (* (+ -1.0 (the-as float v1-9)) (the float (ja-num-frames 0)))) - ) + (set! (-> gp-0 frame-num) (* (rand-float-gen) (the float (ja-num-frames 0)))) ) - (while #t - (let ((v1-14 (-> self skel root-channel 0))) - (set! (-> v1-14 num-func) num-func-identity) - (set! (-> v1-14 frame-num) 0.0) - ) + (loop + (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) (none) ) - :post - (the-as (function none :behavior darkecobarrel-mover) pusher-post) + :post (the-as (function none :behavior darkecobarrel-mover) pusher-post) ) (defbehavior darkecobarrel-mover-init-by-other darkecobarrel-mover ((arg0 res-lump) (arg1 float) (arg2 time-frame) (arg3 time-frame)) @@ -808,29 +686,20 @@ ) (defstate darkecobarrel-spawner (darkecobarrel) - :trans - (behavior () + :trans (behavior () (let ((gp-1 (mod (darkecobarrel-base-time) (darkecobarrel-cycle-time)))) (if (and (> (-> self cur-spawn) 0) (< gp-1 (-> self spawn-array (+ (-> self cur-spawn) -1)))) (+! gp-1 (darkecobarrel-cycle-time)) ) (let ((gp-2 (- gp-1 (-> self spawn-array (-> self cur-spawn))))) (when (>= gp-2 0) - (let ((s5-0 (get-process *default-dead-pool* darkecobarrel-mover #x4000))) - (when s5-0 - (let ((t9-4 (method-of-type darkecobarrel-mover activate))) - (t9-4 (the-as darkecobarrel-mover s5-0) self 'darkecobarrel-mover (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - darkecobarrel-mover-init-by-other - (-> self entity) - (-> self speed) - (- (darkecobarrel-base-time) (the-as time-frame gp-2)) - (-> self sync) - ) - (-> s5-0 ppointer) - ) + (process-spawn + darkecobarrel-mover + (-> self entity) + (-> self speed) + (- (darkecobarrel-base-time) (the-as time-frame gp-2)) + (-> self sync) + :to self ) (darkecobarrel-advance-curspawn) ) @@ -841,42 +710,12 @@ ) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) @@ -888,19 +727,7 @@ (set! (-> obj root-override) (the-as collide-shape-moving (new 'process 'trsqv))) (darkecobarrel-base-init arg0) (set! (-> obj sound) - (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "lav-dark-eco") - :volume #x400 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (new 'process 'ambient-sound (static-sound-spec "lav-dark-eco" :fo-max 30) (-> obj root-override trans)) ) (logior! (-> obj draw status) (draw-status hidden)) (set! (-> obj speed) (/ 300.0 (res-lump-float (-> obj entity) 'speed :default 61440.0))) @@ -947,15 +774,7 @@ (s5-4 (- (darkecobarrel-base-time) (the-as time-frame (- s5-3 (-> obj spawn-array (-> obj cur-spawn)))))) ) (until (darkecobarrel-base-done? (darkecobarrel-base-pos s5-4)) - (let ((s3-0 (get-process *default-dead-pool* darkecobarrel-mover #x4000))) - (when s3-0 - (let ((t9-14 (method-of-type darkecobarrel-mover activate))) - (t9-14 (the-as darkecobarrel-mover s3-0) obj 'darkecobarrel-mover (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 darkecobarrel-mover-init-by-other (-> obj entity) (-> obj speed) s5-4 (-> obj sync)) - (-> s3-0 ppointer) - ) - ) + (process-spawn darkecobarrel-mover (-> obj entity) (-> obj speed) s5-4 (-> obj sync) :to obj) (set! s5-4 (- s5-4 (the-as time-frame (-> obj spawn-array s4-0)))) (+! s4-0 -1) (if (< s4-0 0) @@ -982,57 +801,23 @@ ) -(defskelgroup *lavafallsewera-sg* lavafallsewera - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -15 0 -5 185) - :longest-edge (meters 0) - ) +(defskelgroup *lavafallsewera-sg* lavafallsewera lavafallsewera-lod0-jg lavafallsewera-idle-ja + ((lavafallsewera-lod0-mg (meters 999999))) + :bounds (static-spherem -15 0 -5 185) + ) (defstate lavafallsewera-idle (lavafallsewera) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior lavafallsewera) ja-post) + :post (the-as (function none :behavior lavafallsewera) ja-post) ) (defmethod init-from-entity! lavafallsewera ((obj lavafallsewera) (arg0 entity-actor)) @@ -1055,57 +840,23 @@ ) -(defskelgroup *lavafallsewerb-sg* lavafallsewerb - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 120) - :longest-edge (meters 0) - ) +(defskelgroup *lavafallsewerb-sg* lavafallsewerb lavafallsewerb-lod0-jg lavafallsewerb-idle-ja + ((lavafallsewerb-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 120) + ) (defstate lavafallsewerb-idle (lavafallsewerb) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior lavafallsewerb) ja-post) + :post (the-as (function none :behavior lavafallsewerb) ja-post) ) (defmethod init-from-entity! lavafallsewerb ((obj lavafallsewerb) (arg0 entity-actor)) @@ -1134,8 +885,7 @@ :id 542 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2132 :period 600 :length 5) + :parts ((sp-item 2132 :period 600 :length 5) (sp-item 2133 :period 600 :length 40) (sp-item 2134 :period 600 :length 20) (sp-item 2135 :period 600 :length 20) @@ -1143,8 +893,7 @@ ) (defpart 2133 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -1171,13 +920,11 @@ ) (defpart 2136 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) (defpart 2135 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 0.4)) @@ -1197,8 +944,7 @@ ) (defpart 2132 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 32)) @@ -1214,8 +960,7 @@ ) (defpart 2134 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1242,8 +987,7 @@ ) (defpart 2137 - :init-specs - ((sp-flt spt-fade-r -1.0666667) + :init-specs ((sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g -1.0666667) (sp-flt spt-fade-b -2.1166666) (sp-int spt-next-time 60) @@ -1252,8 +996,7 @@ ) (defpart 2138 - :init-specs - ((sp-flt spt-fade-r -0.5688889) + :init-specs ((sp-flt spt-fade-r -0.5688889) (sp-flt spt-fade-g -0.28444445) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334) @@ -1263,37 +1006,35 @@ ) (defpart 2139 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) -(defskelgroup *chainmine-sg* chainmine - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -10.75 0 12.75) - :longest-edge (meters 2.4) - ) +(defskelgroup *chainmine-sg* chainmine chainmine-lod0-jg chainmine-idle-ja + ((chainmine-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10.75 0 12.75) + :longest-edge (meters 2.4) + ) (defstate die (chainmine) :virtual #t - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root-override trans quad)) (set! (-> gp-1 y) (+ -73728.0 (-> gp-1 y))) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 542) 600 #f #f #f gp-1) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 542) + 600 + #f + #f + #f + gp-1 + :to *entity-pool* ) ) (suspend) @@ -1309,70 +1050,28 @@ (defstate idle (chainmine) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack 'touch) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((a2-2 (new 'static 'attack-info :mask #x20))) - (set! (-> a2-2 mode) 'deadly) - (set! (-> a1-3 param 1) (the-as uint a2-2)) - ) - (send-event-function arg0 a1-3) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'deadly)))) (go-virtual die) ) ) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (nonzero? (-> self sound)) (update! (-> self sound)) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior chainmine) ja-post) + :post (the-as (function none :behavior chainmine) ja-post) ) (defmethod init-from-entity! chainmine ((obj chainmine) (arg0 entity-actor)) @@ -1398,31 +1097,17 @@ ) (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *chainmine-sg* '()) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "lava-mine-chain") - :volume #x400 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "lava-mine-chain" :fo-max 30) (-> obj root-override trans)) ) (go (method-of-object obj idle)) (none) ) -(defskelgroup *lavaballoon-sg* lavaballoon - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0.8 0 3.8) - :longest-edge (meters 0) - ) +(defskelgroup *lavaballoon-sg* lavaballoon lavaballoon-lod0-jg lavaballoon-idle-ja + ((lavaballoon-lod0-mg (meters 20)) (lavaballoon-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0.8 0 3.8) + ) (deftype lavaballoon (process-drawable) ((root-override collide-shape :offset 112) @@ -1443,13 +1128,11 @@ :id 543 :duration 5 :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 1987) (sp-item 1988) (sp-item 1989)) + :parts ((sp-item 1987) (sp-item 1988) (sp-item 1989)) ) (defpart 1988 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 2) 1.0) @@ -1469,8 +1152,7 @@ ) (defpart 1989 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-y (meters 2)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) @@ -1493,8 +1175,7 @@ ) (defpart 1987 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 12)) @@ -1512,29 +1193,21 @@ (defstate die (lavaballoon) :virtual #t - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "cool-balloon") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 543) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (sound-play "cool-balloon") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 543) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (suspend) (cleanup-for-death self) @@ -1545,8 +1218,7 @@ (defstate idle (lavaballoon) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (send-event arg0 'heat -10.0) @@ -1554,8 +1226,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (zero? (logand (-> self path flags) (path-control-flag not-found))) (let ((f0-4 (* 0.5 (+ 1.0 (sin (* (-> self move-per-tick) (the float (-> *display* base-frame-counter)))))))) (eval-path-curve! (-> self path) (-> self root-override trans) f0-4 'interp) @@ -1563,48 +1234,17 @@ ) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior lavaballoon) transform-post) + :post (the-as (function none :behavior lavaballoon) transform-post) ) (defmethod init-from-entity! lavaballoon ((obj lavaballoon) (arg0 entity-actor)) @@ -1647,8 +1287,7 @@ (define ripple-for-lavatube-lava (new 'static 'ripple-wave-set :count 2 :converted #f - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 2 :speed 3.0) (new 'static 'ripple-wave :scale 40.0 :xdiv -2 :zdiv 2 :speed 1.8) (new 'static 'ripple-wave) @@ -1659,8 +1298,7 @@ (defstate water-vol-idle (lavatube-lava) :virtual #t - :post - (behavior () + :post (behavior () (let ((t9-0 (-> (method-of-type water-anim water-vol-idle) post))) (if t9-0 ((the-as (function none :behavior lavatube-lava) t9-0)) @@ -1680,8 +1318,8 @@ (set! (-> v1-2 global-scale) 2048.0) (set! (-> v1-2 waveform) ripple-for-lavatube-lava) ) - (set! (-> obj flags) (logand -8388609 (-> obj flags))) - (set! (-> obj flags) (logior #x2000000 (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt23)) + (set! (-> obj flags) (logior (water-flags wt25) (-> obj flags))) (set! (-> obj attack-event) 'heat) (none) ) @@ -1698,57 +1336,23 @@ ) -(defskelgroup *lavayellowtarp-sg* lavayellowtarp - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *lavayellowtarp-sg* lavayellowtarp lavayellowtarp-lod0-jg lavayellowtarp-idle-ja + ((lavayellowtarp-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) (defstate lavayellowtarp-idle (lavayellowtarp) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior lavayellowtarp) ja-post) + :post (the-as (function none :behavior lavayellowtarp) ja-post) ) (defmethod init-from-entity! lavayellowtarp ((obj lavayellowtarp) (arg0 entity-actor)) diff --git a/goal_src/levels/lavatube/lavatube-part.gc b/goal_src/levels/lavatube/lavatube-part.gc index 68795a4461..0843f1f6a0 100644 --- a/goal_src/levels/lavatube/lavatube-part.gc +++ b/goal_src/levels/lavatube/lavatube-part.gc @@ -19,20 +19,17 @@ (defpartgroup group-lavatube-crust-20x20 :id 616 :bounds (static-bspherem 0 0 0 14) - :parts - ((sp-item 2489 :fade-after (meters 140) :falloff-to (meters 140))) + :parts ((sp-item 2489 :fade-after (meters 140) :falloff-to (meters 140))) ) (defpartgroup group-lavatube-lowlava-20x20 :id 617 :bounds (static-bspherem 0 12 0 48) - :parts - ((sp-item 2490 :fade-after (meters 190) :falloff-to (meters 190))) + :parts ((sp-item 2490 :fade-after (meters 190) :falloff-to (meters 190))) ) (defpart 2490 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 3)) @@ -58,13 +55,11 @@ ) (defpart 2491 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 2492)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 2492)) ) (defpart 2492 - :init-specs - ((sp-flt spt-fade-r -1.28) + :init-specs ((sp-flt spt-fade-r -1.28) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.42666668) (sp-int spt-next-time 150) @@ -73,13 +68,11 @@ ) (defpart 2493 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.035555556)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.035555556)) ) (defpart 2489 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0)) @@ -105,13 +98,11 @@ ) (defpart 2494 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 2496)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 2496)) ) (defpart 2496 - :init-specs - ((sp-flt spt-fade-r -0.85333335) + :init-specs ((sp-flt spt-fade-r -0.85333335) (sp-flt spt-fade-g -0.42666668) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2497) @@ -119,27 +110,23 @@ ) (defpart 2497 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a -0.026666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a -0.026666667)) ) (defpartgroup group-lavatube-crust-40x40 :id 629 :bounds (static-bspherem 0 0 0 32) - :parts - ((sp-item 2529 :fade-after (meters 180) :falloff-to (meters 180))) + :parts ((sp-item 2529 :fade-after (meters 180) :falloff-to (meters 180))) ) (defpartgroup group-lavatube-lowlava-40x40 :id 630 :bounds (static-bspherem 0 12 0 32) - :parts - ((sp-item 2530 :fade-after (meters 200) :falloff-to (meters 200))) + :parts ((sp-item 2530 :fade-after (meters 200) :falloff-to (meters 200))) ) (defpart 2530 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters 3)) @@ -165,8 +152,7 @@ ) (defpart 2529 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters 0)) @@ -194,8 +180,7 @@ (defpartgroup group-lavatube-green-smoke-down-1 :id 621 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) + :parts ((sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) (sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 770 :length 96) (sp-item 2516 :fade-after (meters 140) :falloff-to (meters 160) :period 936 :length 60) (sp-item 2517 :fade-after (meters 100) :falloff-to (meters 100)) @@ -205,8 +190,7 @@ (defpartgroup group-lavatube-green-smoke-down-2 :id 622 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 1536 :length 75) + :parts ((sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 1536 :length 75) (sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 596 :length 96) (sp-item 2516 :fade-after (meters 140) :falloff-to (meters 160) :period 1070 :length 60) (sp-item 2517 :fade-after (meters 100) :falloff-to (meters 100)) @@ -216,8 +200,7 @@ (defpartgroup group-lavatube-green-smoke-down-3 :id 623 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 1161 :length 75) + :parts ((sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 1161 :length 75) (sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 869 :length 96) (sp-item 2516 :fade-after (meters 140) :falloff-to (meters 160) :period 1029 :length 60) (sp-item 2517 :fade-after (meters 100) :falloff-to (meters 100)) @@ -225,8 +208,7 @@ ) (defpart 2517 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-rnd-flt spt-x (meters 0) (meters 3) 1.0) (sp-flt spt-y (meters -1)) @@ -254,22 +236,13 @@ ) (defpart 2518 - :init-specs - ((sp-flt spt-fade-a -0.47407407)) + :init-specs ((sp-flt spt-fade-a -0.47407407)) ) (defpart 2516 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.7 0.6 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "steam-release") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "steam-release" :num 0.05 :volume 100.0)) (sp-rnd-flt spt-x (meters 0) (meters 3) 1.0) (sp-flt spt-y (meters -1)) (sp-rnd-flt spt-scale-x (meters 6) (meters 4) 1.0) @@ -300,8 +273,7 @@ (defpartgroup group-lavatube-green-smoke-angle-1 :id 624 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 1050 :length 75) + :parts ((sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 1050 :length 75) (sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 886 :length 96) (sp-item 2519 :fade-after (meters 140) :falloff-to (meters 160) :period 1276 :length 60) (sp-item 2520 :fade-after (meters 100) :falloff-to (meters 100)) @@ -311,8 +283,7 @@ (defpartgroup group-lavatube-green-smoke-angle-2 :id 625 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 1830 :length 75) + :parts ((sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 1830 :length 75) (sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 970 :length 96) (sp-item 2519 :fade-after (meters 140) :falloff-to (meters 160) :period 1102 :length 60) (sp-item 2520 :fade-after (meters 100) :falloff-to (meters 100)) @@ -322,8 +293,7 @@ (defpartgroup group-lavatube-green-smoke-angle-3 :id 626 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 1530 :length 75) + :parts ((sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 1530 :length 75) (sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 1189 :length 96) (sp-item 2519 :fade-after (meters 140) :falloff-to (meters 160) :period 862 :length 60) (sp-item 2520 :fade-after (meters 100) :falloff-to (meters 100)) @@ -331,8 +301,7 @@ ) (defpart 2520 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-rnd-flt spt-scale-x (meters 5) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -358,17 +327,9 @@ ) (defpart 2519 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.4 0.3 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "steam-release") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "steam-release" :num 0.05 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 6) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -396,15 +357,13 @@ (defpartgroup group-lavatube-fountain :id 627 :bounds (static-bspherem 0 -10 0 12) - :parts - ((sp-item 2521 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 2521 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 2522 :fade-after (meters 100) :falloff-to (meters 100)) ) ) (defpart 2522 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-y (meters -0.75) (meters 0.25) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -428,8 +387,7 @@ ) (defpart 2521 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.1 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -454,8 +412,7 @@ ) (defpart 2523 - :init-specs - ((sp-flt spt-fade-r -0.64) + :init-specs ((sp-flt spt-fade-r -0.64) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.21333334) (sp-flt spt-fade-a -0.08) @@ -465,20 +422,17 @@ ) (defpart 2524 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) (defpartgroup group-lavatube-vents :id 628 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2525 :fade-after (meters 160) :falloff-to (meters 160))) + :parts ((sp-item 2525 :fade-after (meters 160) :falloff-to (meters 160))) ) (defpart 2525 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.3 1.0) (sp-flt spt-y (meters -1)) (sp-rnd-flt spt-scale-x (meters 8) (meters 6) 1.0) @@ -504,8 +458,7 @@ ) (defpart 2526 - :init-specs - ((sp-flt spt-fade-r -1.28) + :init-specs ((sp-flt spt-fade-r -1.28) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.42666668) (sp-flt spt-fade-a -0.10666667) @@ -515,20 +468,17 @@ ) (defpart 2527 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) (defpartgroup group-lavatube-heavy-smoke :id 631 :bounds (static-bspherem 0 10 0 22) - :parts - ((sp-item 2531 :fade-after (meters 140) :falloff-to (meters 140))) + :parts ((sp-item 2531 :fade-after (meters 140) :falloff-to (meters 140))) ) (defpart 2531 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.4 1.0) (sp-rnd-flt spt-x (meters -16) (meters 32) 1.0) (sp-rnd-flt spt-z (meters -16) (meters 32) 1.0) @@ -553,8 +503,7 @@ ) (defpart 2532 - :init-specs - ((sp-flt spt-fade-r -0.64) + :init-specs ((sp-flt spt-fade-r -0.64) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.21333334) (sp-flt spt-fade-a -0.08) @@ -564,22 +513,19 @@ ) (defpart 2533 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) (defpartgroup group-lavatube-heavy-smoke-start :id 632 :bounds (static-bspherem 0 10 0 22) - :parts - ((sp-item 2534 :fade-after (meters 140) :falloff-to (meters 140)) + :parts ((sp-item 2534 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 2535 :fade-after (meters 200) :falloff-to (meters 200)) ) ) (defpart 2534 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 5.0 1.0) (sp-rnd-flt spt-x (meters -14) (meters 28) 1.0) (sp-rnd-flt spt-y (meters 8) (meters 8) 1.0) @@ -604,8 +550,7 @@ ) (defpart 2535 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.4 0.8 1.0) (sp-rnd-flt spt-x (meters -16) (meters 32) 1.0) (sp-rnd-flt spt-y (meters -14) (meters 30) 1.0) @@ -633,15 +578,13 @@ (defpartgroup group-lavatube-heavy-smoke-end :id 633 :bounds (static-bspherem 0 10 0 22) - :parts - ((sp-item 2536 :fade-after (meters 140) :falloff-to (meters 140)) + :parts ((sp-item 2536 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 2537 :fade-after (meters 200) :falloff-to (meters 200)) ) ) (defpart 2536 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 3.0 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 8) 1.0) @@ -666,8 +609,7 @@ ) (defpart 2537 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.4 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-rnd-flt spt-y (meters -22) (meters 30) 1.0) diff --git a/goal_src/levels/maincave/baby-spider.gc b/goal_src/levels/maincave/baby-spider.gc index 7c9088742e..fc2f12fe7f 100644 --- a/goal_src/levels/maincave/baby-spider.gc +++ b/goal_src/levels/maincave/baby-spider.gc @@ -9,6 +9,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/baby-spider-ag.gc") + (deftype baby-spider-spawn-params (structure) ((hatched? symbol :offset-assert 0) (fast-start? symbol :offset-assert 4) @@ -59,14 +61,11 @@ ) -(defskelgroup *baby-spider-sg* baby-spider - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 2.25) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *baby-spider-sg* baby-spider baby-spider-lod0-jg -1 + ((baby-spider-lod0-mg (meters 20)) (baby-spider-lod1-mg (meters 40)) (baby-spider-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 2.25) + :shadow baby-spider-shadow-mg + ) (define *baby-spider-nav-enemy-info* (new 'static 'nav-enemy-info :idle-anim 6 @@ -83,11 +82,11 @@ :run-travel-speed (meters 7) :run-rotate-speed (degrees 7999.9995) :run-acceleration (meters 1) - :run-turn-time (seconds 0.07333333) + :run-turn-time (seconds 0.075) :walk-travel-speed (meters 2) :walk-rotate-speed (degrees 7999.9995) :walk-acceleration (meters 1) - :walk-turn-time (seconds 0.07333333) + :walk-turn-time (seconds 0.075) :attack-shove-back (meters 3) :attack-shove-up (meters 2) :shadow-size (meters 1) @@ -115,7 +114,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -136,11 +135,11 @@ :run-travel-speed (meters 7) :run-rotate-speed (degrees 7999.9995) :run-acceleration (meters 1) - :run-turn-time (seconds 0.07333333) + :run-turn-time (seconds 0.075) :walk-travel-speed (meters 2) :walk-rotate-speed (degrees 7999.9995) :walk-acceleration (meters 1) - :walk-turn-time (seconds 0.07333333) + :walk-turn-time (seconds 0.075) :attack-shove-back (meters 3) :attack-shove-up (meters 2) :shadow-size (meters 1) @@ -168,7 +167,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -225,7 +224,7 @@ baby-spider-default-event-handler (defmethod common-post baby-spider ((obj baby-spider)) - (when (logtest? (-> obj collide-info status) 1) + (when (logtest? (-> obj collide-info status) (cshape-moving-flags onsurf)) (vector-deg-seek (-> obj up-vector) (-> obj up-vector) (-> obj collide-info surface-normal) 910.2222) (vector-normalize! (-> obj up-vector) 1.0) ) @@ -302,43 +301,26 @@ baby-spider-default-event-handler ) (defstate baby-spider-hatching (baby-spider) - :event - baby-spider-default-event-handler - :code - (behavior () + :event baby-spider-default-event-handler + :code (behavior () (ja-channel-push! 1 0) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! baby-spider-birth-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (dummy-53 self) (go baby-spider-die-fast) ) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go baby-spider-resume) (none) ) - :post - (the-as (function none :behavior baby-spider) nav-enemy-simple-post) + :post (the-as (function none :behavior baby-spider) nav-enemy-simple-post) ) (defstate baby-spider-resume (baby-spider) - :event - baby-spider-default-event-handler - :code - (behavior () + :event baby-spider-default-event-handler + :code (behavior () (cond ((not *target*) (go-virtual nav-enemy-idle) @@ -364,10 +346,8 @@ baby-spider-default-event-handler (defstate nav-enemy-idle (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :enter - (behavior () + :event baby-spider-default-event-handler + :enter (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self collide-info trans quad)) (let ((t9-0 (-> (method-of-type nav-enemy nav-enemy-idle) enter))) @@ -381,8 +361,7 @@ baby-spider-default-event-handler ) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -393,8 +372,7 @@ baby-spider-default-event-handler ) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (none) ) @@ -402,10 +380,8 @@ baby-spider-default-event-handler (defstate nav-enemy-patrol (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -416,34 +392,16 @@ baby-spider-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-1 param 1) f30-0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) f30-0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -453,10 +411,8 @@ baby-spider-default-event-handler (defstate nav-enemy-notice (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -467,36 +423,16 @@ baby-spider-default-event-handler ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 51) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.17)) + (ja-no-eval :group! baby-spider-notice-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :num! (seek!)) (go-virtual nav-enemy-chase) (none) ) @@ -504,10 +440,8 @@ baby-spider-default-event-handler (defstate nav-enemy-chase (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -521,36 +455,24 @@ baby-spider-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self target-nav-time) (-> *display* base-frame-counter)) (set! (-> self wiggle-time) (+ (-> *display* base-frame-counter) (seconds -10))) (set! (-> self wiggle-angle) 0.0) (set! (-> self chase-rest-time) (rand-vu-int-range (seconds 1) (seconds 4))) - (ja-channel-push! 1 51) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 7)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (ja-channel-push! 1 (seconds 0.17)) + (ja :group! baby-spider-run-ja :num! min) + (loop (when (>= (- (-> *display* base-frame-counter) (-> self wiggle-time)) (seconds 1)) (set! (-> self wiggle-time) (-> *display* base-frame-counter)) (dummy-51 self) ) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (behavior () + :post (behavior () (dummy-52 self (target-pos 0)) (nav-enemy-travel-post) (none) @@ -559,10 +481,8 @@ baby-spider-default-event-handler (defstate nav-enemy-stop-chase (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -573,16 +493,13 @@ baby-spider-default-event-handler ) (none) ) - :code - (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) + :code (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) ) (defstate nav-enemy-stare (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -593,44 +510,25 @@ baby-spider-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 1456355.5) - (set! (-> self turn-time) (seconds 0.07333333)) + (set! (-> self turn-time) (seconds 0.075)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) - (while #t - (logior! (-> self nav-enemy-flags) 16) - (ja-channel-push! 1 30) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (loop + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! baby-spider-celebrate-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (ja-no-eval :num! (loop!)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((gp-0 (rand-vu-int-range 300 600)) (s5-0 (-> *display* base-frame-counter)) ) (until (>= (- (-> *display* base-frame-counter) s5-0) gp-0) - (let ((v1-33 (-> self skel root-channel 0))) - (set! (-> v1-33 num-func) num-func-identity) - (set! (-> v1-33 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (ja-blend-eval) (suspend) (suspend) @@ -644,10 +542,8 @@ baby-spider-default-event-handler (defstate nav-enemy-give-up (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -658,37 +554,16 @@ baby-spider-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! baby-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! baby-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek-to-point-toward-point! (-> self collide-info) @@ -697,11 +572,7 @@ baby-spider-default-event-handler (-> self turn-time) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) (none) @@ -710,10 +581,8 @@ baby-spider-default-event-handler (defstate nav-enemy-attack (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -724,25 +593,12 @@ baby-spider-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! baby-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-victory) (none) @@ -751,10 +607,8 @@ baby-spider-default-event-handler (defstate nav-enemy-victory (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -765,19 +619,16 @@ baby-spider-default-event-handler ) (none) ) - :code - (-> (method-of-type nav-enemy nav-enemy-victory) code) + :code (-> (method-of-type nav-enemy nav-enemy-victory) code) ) (defstate nav-enemy-die (baby-spider) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior baby-spider) process-drawable-death-event-handler ) - :enter - (behavior () + :enter (behavior () (let ((v1-0 (-> self event-death))) (if v1-0 (send-event (ppointer->process (-> self parent)) v1-0) @@ -795,10 +646,8 @@ baby-spider-default-event-handler ) (defstate baby-spider-die-fast (baby-spider) - :event - baby-spider-default-event-handler - :code - (behavior () + :event baby-spider-default-event-handler + :code (behavior () (cleanup-for-death self) (let ((v1-2 (-> self event-death))) (if v1-2 @@ -840,7 +689,7 @@ baby-spider-default-event-handler (TODO-RENAME-45 obj *baby-spider-nav-enemy-info*) ) (let ((v1-11 (-> obj draw shadow-ctrl settings))) - (set! (-> v1-11 flags) (logand -9 (-> v1-11 flags))) + (logclear! (-> v1-11 flags) (shadow-flags shdf03)) (set! (-> v1-11 fade-dist) 98304.0) ) (vector-float*! (-> obj collide-info scale) *identity-vector* 0.63) @@ -904,7 +753,7 @@ baby-spider-default-event-handler (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) (logior! (-> obj mask) (process-mask actor-pause)) (set! (-> obj nav) (new 'process 'nav-control (-> obj collide-info) 24 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (create-connection! diff --git a/goal_src/levels/maincave/dark-crystal.gc b/goal_src/levels/maincave/dark-crystal.gc index d63c38c8a7..1e67b4f2eb 100644 --- a/goal_src/levels/maincave/dark-crystal.gc +++ b/goal_src/levels/maincave/dark-crystal.gc @@ -5,14 +5,11 @@ ;; name in dgo: dark-crystal ;; dgos: L1, MAI, MAINCAVE -(define-extern *dark-crystal-sg* skeleton-group) -(define-extern *dark-crystal-explode-sg* skeleton-group) - -(declare-type dark-crystal process-drawable) - ;; DECOMP BEGINS +(import "goal_src/import/dark-crystal-ag.gc") + (deftype dark-crystal (process-drawable) ((root-override collide-shape :offset 112) (crystal-num int32 :offset-assert 176) @@ -40,37 +37,23 @@ ) -(defskelgroup *dark-crystal-sg* dark-crystal - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 3.4 0 3.8) - :longest-edge (meters 0) +(defskelgroup *dark-crystal-sg* dark-crystal dark-crystal-lod0-jg -1 + ((dark-crystal-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3.4 0 3.8) + ) + +(defskelgroup *dark-crystal-explode-sg* dark-crystal dark-crystal-explode-lod0-jg -1 + ((dark-crystal-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -15 0 50) + ) + +(define *dark-crystal-flash-delays* + (the-as (array int32) (new 'static 'boxed-array :type int32 #xb4 #x96 #x78 90 60 30 15 7 3)) ) -(defskelgroup *dark-crystal-explode-sg* dark-crystal - 3 - -1 - ((4 (meters 999999))) - :bounds (static-spherem 0 -15 0 50) - :longest-edge (meters 0) - ) - -(define - *dark-crystal-flash-delays* - (the-as (array int32) - (new 'static 'boxed-array :type int32 :length 9 :allocated-length 9 #xb4 #x96 #x78 90 60 30 15 7 3) - ) - ) - -(define - *dark-crystal-exploder-params* +(define *dark-crystal-exploder-params* (new 'static 'joint-exploder-static-params - :joints - (new - 'static - 'boxed-array - :type joint-exploder-static-joint-params :length 15 :allocated-length 15 + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) @@ -95,8 +78,7 @@ :duration 75 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 2153 :fade-after (meters 100) :period 600 :length 5 :binding 296) + :parts ((sp-item 2153 :fade-after (meters 100) :period 600 :length 5 :binding 296) (sp-item 296 :flags (start-dead launch-asap) :binding 297) (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) (sp-item 296 :flags (start-dead launch-asap) :binding 297) @@ -169,8 +151,7 @@ ) (defpart 2153 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 2) 1.0) @@ -189,8 +170,7 @@ ) (defpart 2155 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 24.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -215,13 +195,11 @@ ) (defpart 2158 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) (defpart 2157 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-flt spt-scale-x (meters 0.3)) @@ -239,8 +217,7 @@ ) (defpart 2154 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 24)) @@ -256,8 +233,7 @@ ) (defpart 2156 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -288,8 +264,7 @@ :linger-duration 12000 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 2159 :period 600 :length 5) + :parts ((sp-item 2159 :period 600 :length 5) (sp-item 2160 :period 600 :length 40) (sp-item 2161 :period 600 :length 20) (sp-item 2162 :period 600 :length 20) @@ -299,8 +274,7 @@ ) (defpart 2160 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 24.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -326,8 +300,7 @@ ) (defpart 2162 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-flt spt-scale-x (meters 0.3)) @@ -347,8 +320,7 @@ ) (defpart 2159 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 24)) @@ -365,8 +337,7 @@ ) (defpart 2161 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -395,8 +366,7 @@ ) (defpart 2163 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 6) 1.0) @@ -420,13 +390,11 @@ ) (defpart 2165 - :init-specs - ((sp-flt spt-fade-a 0.0)) + :init-specs ((sp-flt spt-fade-a 0.0)) ) (defpart 2164 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 6) 1.0) @@ -450,8 +418,7 @@ ) (defstate dark-crystal-idle (dark-crystal) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (if (= (-> arg0 type) target) @@ -468,9 +435,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -479,11 +445,10 @@ ) (defstate dark-crystal-activate (dark-crystal) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (dotimes (gp-0 (-> *dark-crystal-flash-delays* length)) - (sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warning") (set! (-> self draw color-mult quad) (-> self lit-color-mult quad)) (set! (-> self draw color-emissive quad) (-> self lit-color-emissive quad)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -505,8 +470,7 @@ ) (defstate dark-crystal-explode (dark-crystal) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) @@ -518,22 +482,7 @@ (set-vector! (-> gp-0 fountain-rand-transv-lo) -40960.0 20480.0 -40960.0 1.0) (set-vector! (-> gp-0 fountain-rand-transv-hi) 40960.0 49152.0 40960.0 1.0) ) - (let ((s5-0 (get-process *default-dead-pool* joint-exploder #x4000))) - (when s5-0 - (let ((t9-3 (method-of-type joint-exploder activate))) - (t9-3 (the-as joint-exploder s5-0) self 'joint-exploder (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - joint-exploder-init-by-other - *dark-crystal-explode-sg* - 5 - gp-0 - *dark-crystal-exploder-params* - ) - (-> s5-0 ppointer) - ) - ) + (process-spawn joint-exploder *dark-crystal-explode-sg* 5 gp-0 *dark-crystal-exploder-params* :to self) ) (activate! *camera-smush-control* 819.2 37 210 1.0 0.995) (let ((gp-1 (dummy-21 self))) @@ -543,29 +492,22 @@ (logior! (-> self draw status) (draw-status hidden)) (dummy-20 self) (if (-> self underwater?) - (sound-play-by-name (static-sound-name "water-explosion") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "crystal-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-explosion") + (sound-play "crystal-explode") ) - (let ((s5-3 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-3 - (let ((t9-15 (method-of-type part-tracker activate))) - (t9-15 (the-as part-tracker s5-3) *entity-pool* 'part-tracker (the-as pointer #x70004000)) + (process-spawn + part-tracker + :init part-tracker-init + (if (-> self underwater?) + (-> *part-group-id-table* 323) + (-> *part-group-id-table* 322) ) - (run-now-in-process - s5-3 - part-tracker-init - (if (-> self underwater?) - (-> *part-group-id-table* 323) - (-> *part-group-id-table* 322) - ) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> s5-3 ppointer) - ) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (let ((s5-4 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) s5-4) (seconds 0.25)) @@ -585,13 +527,11 @@ ) (defstate dark-crystal-spawn-fuel-cell (dark-crystal) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior dark-crystal) process-drawable-fuel-cell-handler ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) (level-hint-spawn @@ -637,7 +577,16 @@ (when (>= (-> obj explode-danger-radius) (vector-vector-distance s5-0 s3-0)) (vector-! s4-0 s3-0 s5-0) (let ((t2-0 (new 'stack-no-clear 'collide-tri-result))) - (if (< (fill-and-probe-using-line-sphere *collide-cache* s5-0 s4-0 819.2 (collide-kind background) obj t2-0 1) + (if (< (fill-and-probe-using-line-sphere + *collide-cache* + s5-0 + s4-0 + 819.2 + (collide-kind background) + obj + t2-0 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (send-event *target* 'attack #f (new 'static 'attack-info)) diff --git a/goal_src/levels/maincave/driller-lurker.gc b/goal_src/levels/maincave/driller-lurker.gc index f3edf9f338..3f8a875b0d 100644 --- a/goal_src/levels/maincave/driller-lurker.gc +++ b/goal_src/levels/maincave/driller-lurker.gc @@ -5,13 +5,11 @@ ;; name in dgo: driller-lurker ;; dgos: L1, MAI, MAINCAVE -(define-extern *driller-lurker-sg* skeleton-group) - -(declare-type driller-lurker process-drawable) - ;; DECOMP BEGINS +(import "goal_src/import/driller-lurker-ag.gc") + (deftype driller-lurker (process-drawable) ((root-overeride collide-shape-moving :offset 112) (hit-player? symbol :offset-assert 176) @@ -66,22 +64,20 @@ ) -(defskelgroup *driller-lurker-sg* driller-lurker - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1.5 0 7.75) - :longest-edge (meters 2.3) - :shadow 4 - ) +(defskelgroup *driller-lurker-sg* driller-lurker driller-lurker-lod0-jg -1 + ((driller-lurker-lod0-mg (meters 20)) + (driller-lurker-lod1-mg (meters 40)) + (driller-lurker-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 1.5 0 7.75) + :longest-edge (meters 2.3) + :shadow driller-lurker-shadow-mg + ) -(define - *driller-lurker-shadow-control* +(define *driller-lurker-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #x9)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 614400.0) + :flags (shadow-flags shdf00 shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) :bot-plane (new 'static 'plane :y 1.0 :w 4096.0) :top-plane (new 'static 'plane :y 1.0 :w -2048.0) :fade-dist 245760.0 @@ -93,8 +89,7 @@ :id 331 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 728 :fade-after (meters 80) :falloff-to (meters 80)) + :parts ((sp-item 728 :fade-after (meters 80) :falloff-to (meters 80)) (sp-item 2075 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 2076 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 2077 :fade-after (meters 40) :falloff-to (meters 40)) @@ -102,8 +97,7 @@ ) (defpart 728 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -130,8 +124,7 @@ ) (defpart 2075 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -158,8 +151,7 @@ ) (defpart 2076 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -185,13 +177,11 @@ ) (defpart 2078 - :init-specs - ((sp-flt spt-fade-a -1.7066667)) + :init-specs ((sp-flt spt-fade-a -1.7066667)) ) (defpart 2077 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 8.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -264,25 +254,19 @@ ) (cond ((or s2-0 (not s3-0)) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'attack) - (set! (-> a1-6 param 0) (-> arg3 param 0)) - (let ((v1-34 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-34 shove-up) 8192.0) - (set! (-> v1-34 shove-back) 12288.0) - (set! (-> a1-6 param 1) (the-as uint v1-34)) - ) - (when (send-event-function arg0 a1-6) - (set! (-> self hit-player?) #t) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) - (set-collide-offense (-> self root-overeride) 2 (collide-offense no-offense)) - (let ((v1-39 (-> self mode))) - (if (or (zero? v1-39) (= v1-39 1) (= v1-39 2)) - (go driller-lurker-chase #t) - ) - ) + (when (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) + ) + (set! (-> self hit-player?) #t) + (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-collide-offense (-> self root-overeride) 2 (collide-offense no-offense)) + (let ((v1-39 (-> self mode))) + (if (or (zero? v1-39) (= v1-39 1) (= v1-39 2)) + (go driller-lurker-chase #t) + ) ) ) ) @@ -313,25 +297,19 @@ ) ((= arg2 'touch) (when (= (-> arg0 type) target) - (let ((a1-11 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-11 from) self) - (set! (-> a1-11 num-params) 2) - (set! (-> a1-11 message) 'attack) - (set! (-> a1-11 param 0) (-> arg3 param 0)) - (let ((v1-57 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-57 shove-up) 8192.0) - (set! (-> v1-57 shove-back) 12288.0) - (set! (-> a1-11 param 1) (the-as uint v1-57)) - ) - (when (send-event-function arg0 a1-11) - (set! (-> self hit-player?) #t) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) - (set-collide-offense (-> self root-overeride) 2 (collide-offense no-offense)) - (let ((v1-62 (-> self mode))) - (if (or (zero? v1-62) (= v1-62 1) (= v1-62 2)) - (go driller-lurker-chase #t) - ) - ) + (when (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) + ) + (set! (-> self hit-player?) #t) + (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-collide-offense (-> self root-overeride) 2 (collide-offense no-offense)) + (let ((v1-62 (-> self mode))) + (if (or (zero? v1-62) (= v1-62 1) (= v1-62 2)) + (go driller-lurker-chase #t) + ) ) ) ) @@ -522,9 +500,13 @@ ) ) (when (and (-> obj hit-player?) - (or (not *target*) (and (zero? (logand (-> *target* state-flags) #x80f8)) - (>= (- (-> *display* base-frame-counter) (-> obj hit-player-time)) (seconds 0.05)) + (or (not *target*) + (and (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) + ) + (>= (- (-> *display* base-frame-counter) (-> obj hit-player-time)) (seconds 0.05)) + ) ) ) (set-collide-offense (-> obj root-overeride) 2 (collide-offense touch)) @@ -640,119 +622,71 @@ ) (defstate driller-lurker-debug-play-anims (driller-lurker) - :code - (behavior () + :code (behavior () 0 (none) ) - :post - (the-as (function none :behavior driller-lurker) transform-post) + :post (the-as (function none :behavior driller-lurker) transform-post) ) (defstate driller-lurker-idle-drilling (driller-lurker) - :event - driller-lurker-default-event-handler - :enter - (behavior () + :event driller-lurker-default-event-handler + :enter (behavior () (set! (-> self mode) (the-as uint 1)) (set! (-> self targ-path-speed) 0.0) (set! (-> self path-speed) 0.0) (shut-down! (-> self neck)) (none) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound2)) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-25 self) (go driller-lurker-chase #t) ) (dummy-20 self #t (the-as target #f)) (none) ) - :code - (behavior () + :code (behavior () (update-trans! (-> self sound2) (-> self root-overeride trans)) - (while #t + (loop (set! (-> self timeout) (rand-vu-int-range 4 8)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (dotimes (gp-0 (-> self timeout)) (let ((f30-0 (rand-vu-float-range 1.0 1.8))) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 15)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) f30-0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!) - ) + (ja-no-eval :group! driller-lurker-idle-drilling-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (update! (-> self sound2)) (if (and (>= (ja-aframe-num 0) 7.0) (>= 13.0 (ja-aframe-num 0))) (dummy-27 self) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) f30-0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) (stop! (-> self sound2)) - (ja-channel-push! 1 60) - (cond - ((zero? (rand-vu-int-count 2)) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) - ) - (else - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 7)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.2)) + (if (zero? (rand-vu-int-count 2)) + (ja :group! driller-lurker-idle-look-left-ja :num! min) + (ja :group! driller-lurker-idle-look-right-ja :num! min) ) - ) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior driller-lurker) transform-post) + :post (the-as (function none :behavior driller-lurker) transform-post) ) (defstate driller-lurker-patrol (driller-lurker) - :event - driller-lurker-default-event-handler - :enter - (behavior () + :event driller-lurker-default-event-handler + :enter (behavior () (set! (-> self mode) (the-as uint 2)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self timeout) (rand-vu-int-range 900 3600)) @@ -763,84 +697,54 @@ (shut-down! (-> self neck)) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-25 self) (go driller-lurker-chase #t) ) (dummy-20 self #t (the-as target #f)) (none) ) - :code - (behavior () - (ja-channel-push! 2 60) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 8)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-2 (-> self skel root-channel 1))) - (set! (-> a0-2 frame-interp) (-> self up-blend)) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-2 param 0) 0.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-chan) - ) - (while #t + :code (behavior () + (ja-channel-push! 2 (seconds 0.2)) + (ja :group! driller-lurker-walk-ja :num! min) + (ja :chan 1 :group! driller-lurker-walk-up-ja :num! (chan 0) :frame-interp (-> self up-blend)) + (loop (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) - (when (= (ja-group-size) 2) - (let ((a0-4 (-> self skel root-channel 1))) - (set! (-> a0-4 frame-interp) (-> self up-blend)) - (set! (-> a0-4 param 0) 0.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-chan) + (ja :num! (seek!)) + (if (= (ja-group-size) 2) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self up-blend)) ) - ) (when (ja-done? 0) (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self timeout)) (>= 546.13336 (fabs (deg- (-> self path-ry) (-> self facing-ry)))) ) (go driller-lurker-patrol-pause) ) - (let ((v1-34 (-> self skel root-channel 0))) - (set! (-> v1-34 num-func) num-func-identity) - (set! (-> v1-34 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) ) ) (none) ) - :post - (the-as (function none :behavior driller-lurker) transform-post) + :post (the-as (function none :behavior driller-lurker) transform-post) ) (defstate driller-lurker-patrol-pause (driller-lurker) - :event - driller-lurker-default-event-handler - :enter - (behavior () + :event driller-lurker-default-event-handler + :enter (behavior () (set! (-> self mode) (the-as uint 2)) (set! (-> self path-speed) 0.0) (set! (-> self targ-path-speed) 0.0) (shut-down! (-> self neck)) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-25 self) (go driller-lurker-chase #t) ) (dummy-20 self #t (the-as target #f)) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self timeout) (rand-vu-int-range 2 4)) (let ((s5-0 -1)) (dotimes (gp-0 (-> self timeout)) @@ -851,88 +755,41 @@ (set! s5-0 v1-0) (cond ((zero? v1-0) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - ) - (ja-channel-push! 1 60) + (if (not (ja-group? driller-lurker-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) ) - (let ((s4-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> s4-0 frame-num) 0.0) - ) + (ja :group! driller-lurker-idle-ja :num! min) ) ((= v1-0 1) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) + (if (not (ja-group? driller-lurker-idle-look-left-ja)) + (ja-channel-push! 1 (seconds 0.2)) ) - (let ((s4-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-1 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> s4-1 frame-num) 0.0) - ) + (ja :group! driller-lurker-idle-look-left-ja :num! min) ) ((= v1-0 2) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - ) - (ja-channel-push! 1 60) + (if (not (ja-group? driller-lurker-idle-look-right-ja)) + (ja-channel-push! 1 (seconds 0.2)) ) - (let ((s4-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-2 - (the-as art-joint-anim (-> self draw art-group data 7)) - num-func-identity - ) - (set! (-> s4-2 frame-num) 0.0) - ) + (ja :group! driller-lurker-idle-look-right-ja :num! min) ) ) ) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1))) - (set! (-> a0-27 param 1) 1.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go driller-lurker-patrol) (none) ) - :post - (the-as (function none :behavior driller-lurker) transform-post) + :post (the-as (function none :behavior driller-lurker) transform-post) ) (defstate driller-lurker-chase (driller-lurker) - :event - driller-lurker-default-event-handler - :enter - (behavior ((arg0 symbol)) + :event driller-lurker-default-event-handler + :enter (behavior ((arg0 symbol)) (if arg0 (set! (-> self started-chasing-time) (-> *display* base-frame-counter)) ) @@ -941,8 +798,7 @@ (set! (-> self targ-path-speed) 23552.0) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-24 self) (go driller-lurker-attack) ) @@ -978,67 +834,35 @@ (dummy-20 self #f (the-as target #t)) (none) ) - :code - (behavior ((arg0 symbol)) - (ja-channel-push! 2 60) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 11)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-3 (-> self skel root-channel 1))) - (set! (-> a0-3 frame-interp) (-> self up-blend)) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-3 param 0) 0.0) - (joint-control-channel-group-eval! - a0-3 - (the-as art-joint-anim (-> self draw art-group data 12)) - num-func-chan - ) - ) - (while #t + :code (behavior ((arg0 symbol)) + (ja-channel-push! 2 (seconds 0.2)) + (ja :group! driller-lurker-run-ja :num! min) + (ja :chan 1 :group! driller-lurker-run-up-ja :num! (chan 0) :frame-interp (-> self up-blend)) + (loop (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) - (when (= (ja-group-size) 2) - (let ((a0-5 (-> self skel root-channel 1))) - (set! (-> a0-5 frame-interp) (-> self up-blend)) - (set! (-> a0-5 param 0) 0.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-chan) + (ja :num! (seek!)) + (if (= (ja-group-size) 2) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self up-blend)) ) - ) - (when (ja-done? 0) - (let ((v1-27 (-> self skel root-channel 0))) - (set! (-> v1-27 num-func) num-func-identity) - (set! (-> v1-27 frame-num) 0.0) + (if (ja-done? 0) + (ja :num-func num-func-identity :frame-num 0.0) ) - ) ) (none) ) - :post - (the-as (function none :behavior driller-lurker) transform-post) + :post (the-as (function none :behavior driller-lurker) transform-post) ) (defstate driller-lurker-attack (driller-lurker) - :event - driller-lurker-default-event-handler - :enter - (behavior () + :event driller-lurker-default-event-handler + :enter (behavior () (set! (-> self mode) (the-as uint 4)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self path-speed) 0.0) (set! (-> self targ-path-speed) 0.0) (none) ) - :trans - (behavior () + :trans (behavior () (cond ((dummy-24 self) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1055,89 +879,44 @@ (dummy-20 self #f (the-as target #t)) (none) ) - :code - (behavior () - (ja-channel-push! 2 60) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 13)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-2 (-> self skel root-channel 1))) - (set! (-> a0-2 frame-interp) (-> self up-blend)) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 14))) - (set! (-> a0-2 param 0) 0.0) - (joint-control-channel-group-eval! - a0-2 - (the-as art-joint-anim (-> self draw art-group data 14)) - num-func-chan - ) - ) - (while #t + :code (behavior () + (ja-channel-push! 2 (seconds 0.2)) + (ja :group! driller-lurker-attack-ja :num! min) + (ja :chan 1 :group! driller-lurker-attack-up-ja :num! (chan 0) :frame-interp (-> self up-blend)) + (loop (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) - (when (= (ja-group-size) 2) - (let ((a0-4 (-> self skel root-channel 1))) - (set! (-> a0-4 frame-interp) (-> self up-blend)) - (set! (-> a0-4 param 0) 0.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-chan) + (ja :num! (seek!)) + (if (= (ja-group-size) 2) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self up-blend)) ) - ) - (when (ja-done? 0) - (let ((v1-27 (-> self skel root-channel 0))) - (set! (-> v1-27 num-func) num-func-identity) - (set! (-> v1-27 frame-num) 0.0) + (if (ja-done? 0) + (ja :num-func num-func-identity :frame-num 0.0) ) - ) ) (none) ) - :post - (the-as (function none :behavior driller-lurker) transform-post) + :post (the-as (function none :behavior driller-lurker) transform-post) ) (defstate driller-lurker-jammed-standing (driller-lurker) - :event - driller-lurker-default-event-handler - :enter - (behavior () + :event driller-lurker-default-event-handler + :enter (behavior () (set! (-> self mode) (the-as uint 5)) (set! (-> self path-speed) 0.0) (set! (-> self targ-path-speed) 0.0) (shut-down! (-> self neck)) (none) ) - :trans - (behavior () + :trans (behavior () (dummy-20 self #f (the-as target #f)) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! driller-lurker-drill-jams-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self started-chasing-time) (-> *display* base-frame-counter)) (cond @@ -1152,38 +931,23 @@ ) (none) ) - :post - (the-as (function none :behavior driller-lurker) transform-post) + :post (the-as (function none :behavior driller-lurker) transform-post) ) (defstate driller-lurker-die (driller-lurker) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior driller-lurker) process-drawable-death-event-handler ) - :code - (behavior () + :code (behavior () (shut-down! (-> self neck)) (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (clear-collide-with-as (-> self root-overeride)) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + (ja-no-eval :group! driller-lurker-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event self 'death-end) (while (-> self child) @@ -1192,8 +956,7 @@ (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior driller-lurker) ja-post) + :post (the-as (function none :behavior driller-lurker) ja-post) ) (defmethod relocate driller-lurker ((obj driller-lurker) (arg0 int)) @@ -1312,34 +1075,10 @@ ) (set! (-> obj draw shadow-ctrl) *driller-lurker-shadow-control*) (set! (-> obj sound) - (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "drill-idle") - :volume #x400 - :fo-max 40 - ) - (-> obj root-overeride trans) - ) + (new 'process 'ambient-sound (static-sound-spec "drill-idle" :fo-max 40) (-> obj root-overeride trans)) ) (set! (-> obj sound2) - (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "drill-idle2") - :volume #x400 - :fo-max 60 - ) - (-> obj root-overeride trans) - ) + (new 'process 'ambient-sound (static-sound-spec "drill-idle2" :fo-max 60) (-> obj root-overeride trans)) ) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 331) obj)) (let ((f0-34 (path-distance (-> obj path)))) @@ -1356,8 +1095,7 @@ arg0 'driller-lurker (pointer float) - :tag-ptr - (the-as (pointer res-tag) (new 'stack-no-clear 'vector)) + :tag-ptr (the-as (pointer res-tag) (new 'stack-no-clear 'vector)) ) ) ) diff --git a/goal_src/levels/maincave/gnawer.gc b/goal_src/levels/maincave/gnawer.gc index c798c8f3a0..ccc5078c5c 100644 --- a/goal_src/levels/maincave/gnawer.gc +++ b/goal_src/levels/maincave/gnawer.gc @@ -5,9 +5,6 @@ ;; name in dgo: gnawer ;; dgos: L1, MAI, MAINCAVE -(define-extern *gnawer-sg* skeleton-group) -(define-extern *gnawer-segment-sg* skeleton-group) - (declare-type gnawer process-drawable) @@ -15,6 +12,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/gnawer-ag.gc") + (deftype gnawer-falling-segment (process-drawable) ((transv vector :inline :offset-assert 176) (facing-rot vector :inline :offset-assert 192) @@ -121,65 +120,51 @@ ) -(defskelgroup *gnawer-sg* gnawer - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0.5 0 8) - :longest-edge (meters 0.8) - ) +(defskelgroup *gnawer-sg* gnawer gnawer-lod0-jg -1 + ((gnawer-lod0-mg (meters 20)) (gnawer-lod1-mg (meters 40)) (gnawer-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0.5 0 8) + :longest-edge (meters 0.8) + ) -(defskelgroup *gnawer-segment-sg* gnawer - 14 - -1 - ((15 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *gnawer-segment-sg* gnawer gnawer-segment-lod0-jg -1 + ((gnawer-segment-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) -(define - *gnawer-segment-infos* +(define *gnawer-segment-infos* (new 'static 'inline-array gnawer-segment-info 10 (new 'static 'gnawer-segment-info :num-joints 8 - :joint-index - (new 'static 'array int8 8 4 #x1f #xd #x20 #x21 #x22 #x23 #x24) + :joint-index (new 'static 'array int8 8 4 #x1f #xd #x20 #x21 #x22 #x23 #x24) ) (new 'static 'gnawer-segment-info :num-joints 3 :joint-index (new 'static 'array int8 8 5 #xe #xf 0 0 0 0 0)) (new 'static 'gnawer-segment-info :num-joints 3 - :joint-index - (new 'static 'array int8 8 #x6 #x10 #x11 0 0 0 0 0) + :joint-index (new 'static 'array int8 8 #x6 #x10 #x11 0 0 0 0 0) ) (new 'static 'gnawer-segment-info :num-joints 3 - :joint-index - (new 'static 'array int8 8 #x7 #x12 #x13 0 0 0 0 0) + :joint-index (new 'static 'array int8 8 #x7 #x12 #x13 0 0 0 0 0) ) (new 'static 'gnawer-segment-info :num-joints 3 - :joint-index - (new 'static 'array int8 8 #x8 #x14 #x15 0 0 0 0 0) + :joint-index (new 'static 'array int8 8 #x8 #x14 #x15 0 0 0 0 0) ) (new 'static 'gnawer-segment-info :num-joints 3 - :joint-index - (new 'static 'array int8 8 #x9 #x16 #x17 0 0 0 0 0) + :joint-index (new 'static 'array int8 8 #x9 #x16 #x17 0 0 0 0 0) ) (new 'static 'gnawer-segment-info :num-joints 3 - :joint-index - (new 'static 'array int8 8 #xa #x18 #x19 0 0 0 0 0) + :joint-index (new 'static 'array int8 8 #xa #x18 #x19 0 0 0 0 0) ) (new 'static 'gnawer-segment-info :num-joints 3 - :joint-index - (new 'static 'array int8 8 #xb #x1a #x1b 0 0 0 0 0) + :joint-index (new 'static 'array int8 8 #xb #x1a #x1b 0 0 0 0 0) ) (new 'static 'gnawer-segment-info :num-joints 3 - :joint-index - (new 'static 'array int8 8 #xc #x1c #x1d 0 0 0 0 0) + :joint-index (new 'static 'array int8 8 #xc #x1c #x1d 0 0 0 0 0) ) (new 'static 'gnawer-segment-info :num-joints 1 :joint-index (new 'static 'array int8 8 #x1e 0 0 0 0 0 0 0)) ) @@ -189,8 +174,7 @@ :id 329 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 727 :binding 2309) + :parts ((sp-item 727 :binding 2309) (sp-item 2309 :flags (start-dead)) (sp-item 2309 :flags (start-dead)) (sp-item 2309 :flags (start-dead)) @@ -270,8 +254,7 @@ ) (defpart 2310 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 16)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -287,8 +270,7 @@ ) (defpart 727 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 16.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.25) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -311,8 +293,7 @@ ) (defpart 2309 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) (sp-rnd-flt spt-num 0.25 0.5 1.0) (sp-rnd-flt spt-scale-x (meters 0.7) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -333,13 +314,11 @@ :id 330 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2141 :fade-after (meters 60) :falloff-to (meters 60))) + :parts ((sp-item 2141 :fade-after (meters 60) :falloff-to (meters 60))) ) (defpart 2141 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.35) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -361,8 +340,7 @@ (defstate falling (gnawer-falling-segment) :virtual #t - :trans - (behavior () + :trans (behavior () (+! (-> self transv y) (* -409600.0 (-> *display* seconds-per-frame))) (vector-v+! (-> self root trans) (-> self root trans) (-> self transv)) (+! (-> self facing-rot x) (* (-> self facing-rotv x) (-> *display* seconds-per-frame))) @@ -370,54 +348,28 @@ (deg-seek (-> self facing-rot z) 16384.0 (* (-> self facing-rotv z) (-> *display* seconds-per-frame))) ) (quaternion-zxy! (-> self root quat) (-> self facing-rot)) - (set! (-> self root scale x) (seek (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame)))) + (seek! (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame))) (set! (-> self root scale y) (-> self root scale x)) (set! (-> self root scale z) (-> self root scale x)) (none) ) - :code - (behavior () + :code (behavior () (ja-channel-push! 1 0) (dotimes (gp-0 1) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + (ja-no-eval :group! gnawer-segment-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!) - ) + (ja-no-eval :group! gnawer-segment-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (none) ) - :post - (the-as (function none :behavior gnawer-falling-segment) ja-post) + :post (the-as (function none :behavior gnawer-falling-segment) ja-post) ) (defbehavior gnawer-falling-segment-init-by-other gnawer-falling-segment ((arg0 gnawer) (arg1 vector) (arg2 vector)) @@ -750,15 +702,7 @@ (vector-! s1-0 s2-0 (-> obj root-override trans)) (set! (-> s1-0 y) 0.0) (vector-normalize! s1-0 1.0) - (let ((s0-0 (get-process *default-dead-pool* gnawer-falling-segment #x4000))) - (when s0-0 - (let ((t9-2 (method-of-type gnawer-falling-segment activate))) - (t9-2 (the-as gnawer-falling-segment s0-0) obj 'gnawer-falling-segment (the-as pointer #x70004000)) - ) - (run-now-in-process s0-0 gnawer-falling-segment-init-by-other obj s2-0 s1-0) - (-> s0-0 ppointer) - ) - ) + (process-spawn gnawer-falling-segment obj s2-0 s1-0 :to obj) ) (set! (-> s3-0 place) -1) ) @@ -882,166 +826,78 @@ ) (defstate gnawer-chewing-on-post (gnawer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (when (= (-> arg0 type) target) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'shove) - (set! (-> a1-4 param 0) (-> arg3 param 0)) - (let ((v1-6 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-6 shove-up) 6144.0) - (set! (-> v1-6 shove-back) 10240.0) - (set! (-> a1-4 param 1) (the-as uint v1-6)) + (if (= (-> arg0 type) target) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) ) - (send-event-function arg0 a1-4) ) - ) (go gnawer-retreat-into-post) ) (('attack) - (sound-play-by-name (static-sound-name "gnawer-dies") (new-sound-id) 1024 -381 0 1 #t) + (sound-play "gnawer-dies" :pitch -0.25) (go gnawer-retreat-into-post) ) ) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound2)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 81920.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) (go gnawer-retreat-into-post) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (cond - ((zero? (rand-vu-int-count 2)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 8)) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - ) - ) - (else - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 9)) - num-func-identity + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (if (zero? (rand-vu-int-count 2)) + (ja :group! gnawer-tear-side-to-side-ja + :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) + ) + (ja :group! gnawer-tug-ja + :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) ) - (set! (-> gp-1 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - ) ) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (let ((gp-2 (rand-vu-int-range 1 2)) (s4-0 (rand-vu-int-range 1 2)) ) (dotimes (s5-0 gp-2) (dotimes (s3-0 s4-0) (set! (-> self anim-speed) (rand-vu-float-range 0.8 1.0)) - (ja-channel-push! 1 22) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-13 param 1) (-> self anim-speed)) - (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! gnawer-tear-side-to-side-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (set! s4-0 (rand-vu-int-range 1 2)) (dotimes (s3-1 s4-0) (set! (-> self anim-speed) (rand-vu-float-range 0.8 1.0)) - (ja-channel-push! 1 22) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) (-> self anim-speed)) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! gnawer-tug-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) ) ) - (ja-channel-push! 1 22) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) 1.0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! gnawer-up-to-chew-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((gp-3 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-3 (-> self node-list data 34)) @@ -1052,25 +908,13 @@ (spawn (-> self part2) gp-4) ) (suspend) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-5 (rand-vu-int-range 1 4))) (set! (-> self anim-speed) (rand-vu-float-range 0.8 1.0)) (dotimes (s5-1 gp-5) - (ja-channel-push! 1 22) - (let ((a0-33 (-> self skel root-channel 0))) - (set! (-> a0-33 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-33 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-33 param 1) (-> self anim-speed)) - (set! (-> a0-33 frame-num) 0.0) - (joint-control-channel-group! a0-33 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! gnawer-chew-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (let ((s4-1 (new 'stack-no-clear 'vector))) (vector<-cspace! s4-1 (-> self node-list data 34)) @@ -1082,77 +926,44 @@ ) (update! (-> self sound2)) (suspend) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 param 0) (the float (+ (-> a0-39 frame-group data 0 length) -1))) - (set! (-> a0-39 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-39 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) ) (stop! (-> self sound2)) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> a0-42 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 13)) data 0 length) -1)) - ) - (set! (-> a0-42 param 1) 1.0) - (set! (-> a0-42 frame-num) 0.0) - (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + (ja-no-eval :group! gnawer-down-from-chew-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) (the float (+ (-> a0-43 frame-group data 0 length) -1))) - (set! (-> a0-43 param 1) 1.0) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior gnawer) transform-post) + :post (the-as (function none :behavior gnawer) transform-post) ) (defstate gnawer-retreat-into-post (gnawer) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 22) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! gnawer-notice-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (quaternion-identity! (-> self root-override quat)) (go gnawer-wait-to-run) (none) ) - :post - (the-as (function none :behavior gnawer) transform-post) + :post (the-as (function none :behavior gnawer) transform-post) ) (defstate gnawer-wait-to-run (gnawer) - :code - (behavior () + :code (behavior () (set! (-> self draw origin-joint-index) (the-as uint 0)) (dummy-23 self) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1167,40 +978,27 @@ ) (defstate gnawer-run (gnawer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('touch) - (when (= (-> arg0 type) target) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'shove) - (set! (-> a1-4 param 0) (-> arg3 param 0)) - (let ((v1-5 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-5 shove-up) 6144.0) - (set! (-> v1-5 shove-back) 10240.0) - (set! (-> a1-4 param 1) (the-as uint v1-5)) + (if (= (-> arg0 type) target) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) ) - (send-event-function arg0 a1-4) ) - ) ) (('attack) (cond ((= (-> arg0 type) target) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'attack) - (set! (-> a1-7 param 0) (-> arg3 param 0)) - (let ((v1-10 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-10 shove-up) 6144.0) - (set! (-> v1-10 shove-back) 10240.0) - (set! (-> a1-7 param 1) (the-as uint v1-10)) - ) - (send-event-function arg0 a1-7) + (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) ) ) (else @@ -1230,8 +1028,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self route-dist) 0.0) (dummy-24 self) @@ -1239,14 +1036,12 @@ (dummy-26 self) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (stop! (-> self sound)) (none) ) - :trans - (behavior () + :trans (behavior () (+! (-> self route-dist) (* (-> self speed) (-> *display* seconds-per-frame))) (if (dummy-22 self (-> self route-dist)) (go gnawer-wait-to-run) @@ -1254,75 +1049,39 @@ (update! (-> self sound)) (none) ) - :code - (behavior () + :code (behavior () (local-vars (v1-19 symbol) (v1-35 symbol)) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) - (while #t + (ja :group! gnawer-run-ja :num! min) + (ja-no-eval :num! (seek!)) + (loop (until v1-19 (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-19 (or (ja-done? 0) (-> self show-damage?))) ) (when (-> self show-damage?) (until (not (-> self show-damage?)) (set! (-> self show-damage?) #f) - (ja-channel-push! 1 30) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! gnawer-takes-hit-ja :num! min) (until v1-35 (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-35 (or (ja-done? 0) (-> self show-damage?))) ) ) - (ja-channel-push! 1 30) - ) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) + (ja-channel-push! 1 (seconds 0.1)) ) + (ja :group! gnawer-run-ja :num! min) ) (none) ) - :post - (the-as (function none :behavior gnawer) transform-post) + :post (the-as (function none :behavior gnawer) transform-post) ) (defstate gnawer-die (gnawer) - :enter - (behavior () + :enter (behavior () (let ((v1-0 (-> self segments))) (set! (-> self fall-trans quad) (-> v1-0 0 world-pos quad)) (vector-! (-> self root-override transv) (-> v1-0 0 world-pos) (-> self post-trans)) @@ -1333,8 +1092,7 @@ (vector-normalize! (-> self root-override transv) 32768.0) (none) ) - :trans - (behavior () + :trans (behavior () (+! (-> self root-override transv y) (* -409600.0 (-> *display* seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self fall-trans quad)) @@ -1350,39 +1108,24 @@ (spool-push *art-control* "maincavecam-gnawer-fuel-cell" 0 self -1.0) (none) ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (clear-collide-with-as (-> self root-override)) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! gnawer-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go gnawer-dying-give-pickups) (none) ) - :post - (the-as (function none :behavior gnawer) ja-post) + :post (the-as (function none :behavior gnawer) ja-post) ) (defstate gnawer-dying-give-pickups (gnawer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'notify) (if (and (= (-> arg0 type) money) (= (-> arg3 param 0) 'pickup)) @@ -1392,13 +1135,11 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "maincavecam-gnawer-fuel-cell" 0 self -1.0) (none) ) - :code - (behavior () + :code (behavior () (local-vars (sv-128 symbol)) (clear-collide-with-as (-> self root-override)) (set! (-> self skel postbind-function) #f) @@ -1455,8 +1196,7 @@ ) (defstate gnawer-give-fuel-cell (gnawer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'notify) (cond @@ -1475,8 +1215,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (when (not (task-complete? *game-info* (-> self entity extra perm task))) (spool-push *art-control* "maincavecam-gnawer-fuel-cell" 0 self -1.0) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1512,7 +1251,7 @@ ) ) 0 - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") (until (not (-> self child)) (suspend) ) @@ -1525,8 +1264,7 @@ ) (defstate gnawer-put-items-at-dest (gnawer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'notify) (if (and (= (-> arg0 type) money) (= (-> arg3 param 0) 'pickup)) @@ -1536,8 +1274,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self draw origin-joint-index) (the-as uint 0)) (clear-collide-with-as (-> self root-override)) (set! (-> self skel postbind-function) #f) @@ -1770,34 +1507,16 @@ ) ) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 329) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "gnawer-crawl") - :volume #x400 - :fo-min 30 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new + 'process + 'ambient-sound + (static-sound-spec "gnawer-crawl" :fo-min 30 :fo-max 30) + (-> obj root-override trans) + ) ) - (set! (-> obj sound2) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "gnawer-chew") - :volume #x400 - :fo-max 40 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound2) + (new 'process 'ambient-sound (static-sound-spec "gnawer-chew" :fo-max 40) (-> obj root-override trans)) ) (dotimes (v1-110 10) (let ((a0-59 (-> obj segments v1-110))) diff --git a/goal_src/levels/maincave/maincave-obs.gc b/goal_src/levels/maincave/maincave-obs.gc index 9d3dfaddcc..9a96531ac2 100644 --- a/goal_src/levels/maincave/maincave-obs.gc +++ b/goal_src/levels/maincave/maincave-obs.gc @@ -7,6 +7,13 @@ ;; DECOMP BEGINS +(import "goal_src/import/caveelevator-ag.gc") +(import "goal_src/import/cavespatulatwo-ag.gc") +(import "goal_src/import/cavetrapdoor-ag.gc") +(import "goal_src/import/maincavecam-ag.gc") +(import "goal_src/import/cavecrusher-ag.gc") +(import "goal_src/import/cavespatula-darkcave-ag.gc") + (deftype maincavecam (pov-camera) ((seq uint64 :offset-assert 224) ) @@ -17,13 +24,10 @@ ) -(defskelgroup *maincavecam-sg* maincavecam - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *maincavecam-sg* maincavecam maincavecam-lod0-jg -1 + ((maincavecam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) (defmethod set-stack-size! maincavecam ((obj maincavecam)) (stack-size-set! (-> obj main-thread) 512) @@ -32,23 +36,21 @@ (defstate pov-camera-playing (maincavecam) :virtual #t - :code - (behavior () + :code (behavior () (cond ((zero? (-> self seq)) - (let* ((gp-0 (get-process *default-dead-pool* fuel-cell #x4000)) - (gp-1 - (ppointer->handle - (when gp-0 - (let ((t9-1 (method-of-type fuel-cell activate))) - (t9-1 (the-as fuel-cell gp-0) (ppointer->process (-> self parent)) 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 fuel-cell-init-as-clone (process->handle self) (-> self entity extra perm task)) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 + (ppointer->handle + (process-spawn + fuel-cell + :init fuel-cell-init-as-clone + (process->handle self) + (-> self entity extra perm task) + :to (ppointer->process (-> self parent)) + ) + ) + ) + ) (ja-play-spooled-anim (new 'static 'spool-anim :name "maincavecam-gnawer-fuel-cell" :index 3 :parts 1 :command-list '()) (the-as art-joint-anim #f) @@ -85,8 +87,7 @@ :count 3 :converted #f :normal-scale 1.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 40.0 :xdiv -1 :zdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75) @@ -127,17 +128,13 @@ ) -(defskelgroup *cavecrusher-sg* cavecrusher - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *cavecrusher-sg* cavecrusher cavecrusher-lod0-jg -1 + ((cavecrusher-lod0-mg (meters 20)) (cavecrusher-lod1-mg (meters 40)) (cavecrusher-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) (defstate cavecrusher-idle (cavecrusher) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) (when (= (-> arg0 type) target) @@ -154,32 +151,18 @@ ) ) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (update! (-> self sound)) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior cavecrusher) ja-post) + :post (the-as (function none :behavior cavecrusher) ja-post) ) (defmethod init-from-entity! cavecrusher ((obj cavecrusher) (arg0 entity-actor)) @@ -199,19 +182,8 @@ ) (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *cavecrusher-sg* '()) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "crush-click") - :volume #x400 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "crush-click" :fo-max 30) (-> obj root-override trans)) ) (ja-channel-push! 1 0) (let ((s5-1 (-> obj skel root-channel 0))) @@ -243,48 +215,32 @@ ) -(defskelgroup *cavetrapdoor-sg* cavetrapdoor - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 5.7) - ) +(defskelgroup *cavetrapdoor-sg* cavetrapdoor cavetrapdoor-lod0-jg -1 + ((cavetrapdoor-lod0-mg (meters 20)) (cavetrapdoor-lod1-mg (meters 40)) (cavetrapdoor-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 5.7) + ) (defstate idle (cavetrapdoor) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) (when (= (-> arg0 type) target) (when (>= (- (-> (target-pos 0) y) (-> self root-override trans y)) 409.6) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) (go-virtual trigger) ) ) ) ) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (transform-post) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (anim-loop) (none) @@ -293,53 +249,26 @@ (defstate trigger (cavetrapdoor) :virtual #t - :code - (behavior () + :code (behavior () (when (nonzero? (-> self delay-before-wiggle)) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay-before-wiggle)) (suspend) ) ) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> gp-0 param 0) (ja-aframe 290.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek! (ja-aframe 290.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 290.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 290.0 0))) ) (restore-collide-with-as (-> self root-override)) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) @@ -347,71 +276,42 @@ (until (or (or (not *target*) (< 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - (and (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) ) (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-7))) ) ) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-14 param 1) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) 1.0) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (label cfg-14) ) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-27 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-27 param 1) 1.0) - (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (and *target* (>= 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (or (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-7)) ) ) (while (not (ja-min? 0)) (suspend) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 param 0) 0.0) - (set! (-> a0-38 param 1) 1.0) - (joint-control-channel-group-eval! a0-38 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) (goto cfg-14) ) (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) (the float (+ (-> a0-40 frame-group data 0 length) -1))) - (set! (-> a0-40 param 1) 1.0) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual idle) (none) ) - :post - (the-as (function none :behavior cavetrapdoor) pusher-post) + :post (the-as (function none :behavior cavetrapdoor) pusher-post) ) (defmethod init-from-entity! cavetrapdoor ((obj cavetrapdoor) (arg0 entity-actor)) @@ -490,8 +390,7 @@ (defpart 704 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-rnd-flt spt-rot-z (degrees -180.0) (degrees 360.0) 1.0) @@ -513,8 +412,7 @@ ) (defpart 705 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-rnd-flt spt-rot-z (degrees -180.0) (degrees 360.0) 1.0) @@ -536,8 +434,7 @@ ) (defstate caveflamepots-active (caveflamepots) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (when (= (-> arg0 type) target) @@ -549,51 +446,36 @@ ) (let ((s4-0 (new 'stack 'attack-info))) (dummy-41 (-> self root-override) s4-0 (-> self shove-up)) - (cond - ((or (= (-> *target* control unknown-surface00 mode) 'air) - (>= (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> *target* control unknown-dword11)) - (< 0.75 (-> *target* control poly-normal y)) - ) - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 2) - (set! (-> a1-5 message) 'attack-or-shove) - (set! (-> a1-5 param 0) (-> arg3 param 0)) - (let ((v1-22 (new 'static 'attack-info :mask #xa2))) - (set! (-> v1-22 mode) 'burn) - (set! (-> v1-22 vector quad) (-> s4-0 vector quad)) - (set! (-> v1-22 shove-up) (-> s4-0 shove-up)) - (set! (-> a1-5 param 1) (the-as uint v1-22)) - ) - (send-event-function arg0 a1-5) - ) - ) - (else - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'attack-or-shove) - (set! (-> a1-6 param 0) (-> arg3 param 0)) - (let ((v1-26 (new 'static 'attack-info :mask #x8e2))) - (set! (-> v1-26 mode) 'burn) - (set! (-> v1-26 shove-up) 0.0) - (set! (-> v1-26 shove-back) 8192.0) - (set! (-> v1-26 vector quad) (-> *target* control poly-normal quad)) - (set! (-> v1-26 angle) 'shove) - (set! (-> a1-6 param 1) (the-as uint v1-26)) + (if (or (= (-> *target* control unknown-surface00 mode) 'air) + (>= (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> *target* control unknown-dword11)) + (< 0.75 (-> *target* control poly-normal y)) ) - (send-event-function arg0 a1-6) + (send-event + arg0 + 'attack-or-shove + (-> arg3 param 0) + (static-attack-info ((mode 'burn) (vector (-> s4-0 vector)) (shove-up (-> s4-0 shove-up)))) + ) + (send-event + arg0 + 'attack-or-shove + (-> arg3 param 0) + (static-attack-info ((mode 'burn) + (shove-up (meters 0)) + (shove-back (meters 2)) + (vector (-> *target* control poly-normal)) + (angle 'shove) + ) + ) ) ) - ) ) ) ) ) ) ) - :trans - (behavior () + :trans (behavior () (let* ((v1-0 (-> self cycle-speed)) (a0-1 (- v1-0 (-> self cycle-pause))) (gp-0 (mod (+ (-> *display* base-frame-counter) (the-as time-frame (-> self cycle-offset))) v1-0)) @@ -601,26 +483,12 @@ (cond ((< gp-0 a0-1) (when (sphere-in-view-frustum? (the-as sphere (-> self root-override root-prim prim-core))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 704) - (the-as vector (-> self launch-pos)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 705) - (the-as vector (&-> self stack 112)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 704) (the-as vector (-> self launch-pos))) + (launch-particles (-> *part-id-table* 705) (the-as vector (&-> self stack 112))) ) (when (-> self should-play-sound?) (set! (-> self should-play-sound?) #f) - (sound-play-by-name (static-sound-name "hot-flame") (new-sound-id) 1024 0 0 1 #t) + (sound-play "hot-flame") ) (cond ((< gp-0 30) @@ -652,9 +520,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -804,25 +671,18 @@ ) -(defskelgroup *cavespatula-sg* cavespatula - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 -1 0 18) - :longest-edge (meters 0) - ) +(defskelgroup *cavespatula-sg* cavespatula 0 -1 + ((1 (meters 20)) (2 (meters 999999))) + :bounds (static-spherem 0 -1 0 18) + ) -(defskelgroup *cavespatula-darkcave-sg* cavespatula-darkcave - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 -1 0 18) - :longest-edge (meters 0) - ) +(defskelgroup *cavespatula-darkcave-sg* cavespatula-darkcave cavespatula-darkcave-lod0-jg -1 + ((cavespatula-darkcave-lod0-mg (meters 20)) (cavespatula-darkcave-lod1-mg (meters 999999))) + :bounds (static-spherem 0 -1 0 18) + ) (defstate cavespatula-idle (cavespatula) - :trans - (behavior () + :trans (behavior () (rider-trans) (update! (-> self sound)) (let ((f0-0 (get-current-phase (-> self sync)))) @@ -830,16 +690,14 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior cavespatula) rider-post) + :post (the-as (function none :behavior cavespatula) rider-post) ) (defmethod init-from-entity! cavespatula ((obj cavespatula) (arg0 entity-actor)) @@ -866,20 +724,7 @@ ) (process-drawable-from-entity! obj arg0) (set! (-> obj sound) - (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "spatula") - :volume #x400 - :fo-min 25 - :fo-max 50 - ) - (-> obj root-override trans) - ) + (new 'process 'ambient-sound (static-sound-spec "spatula" :fo-min 25 :fo-max 50) (-> obj root-override trans)) ) (case (-> (if (-> obj entity) (-> obj entity extra level) @@ -942,17 +787,14 @@ ) -(defskelgroup *cavespatulatwo-sg* cavespatulatwo - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 2.5 0 21) - :longest-edge (meters 8.7) - ) +(defskelgroup *cavespatulatwo-sg* cavespatulatwo cavespatulatwo-lod0-jg -1 + ((cavespatulatwo-lod0-mg (meters 20)) (cavespatulatwo-lod1-mg (meters 999999))) + :bounds (static-spherem 0 2.5 0 21) + :longest-edge (meters 8.7) + ) (defstate cavespatulatwo-idle (cavespatulatwo) - :trans - (behavior () + :trans (behavior () (rider-trans) (update! (-> self sound)) (let ((f0-0 (get-current-phase (-> self sync)))) @@ -960,16 +802,14 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior cavespatulatwo) rider-post) + :post (the-as (function none :behavior cavespatulatwo) rider-post) ) (defmethod init-from-entity! cavespatulatwo ((obj cavespatulatwo) (arg0 entity-actor)) @@ -1009,20 +849,8 @@ (set! (-> s5-1 frame-num) 0.0) ) (transform-post) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "spatula") - :volume #x400 - :fo-min 25 - :fo-max 50 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "spatula" :fo-min 25 :fo-max 50) (-> obj root-override trans)) ) (go cavespatulatwo-idle) (none) @@ -1058,13 +886,10 @@ ) -(defskelgroup *caveelevator-sg* caveelevator - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4.25) - :longest-edge (meters 0) - ) +(defskelgroup *caveelevator-sg* caveelevator caveelevator-lod0-jg -1 + ((caveelevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.25) + ) (defun cavecrystal-light-control-caveelevator-callback ((arg0 (pointer cavecrystal)) (arg1 int) (arg2 float)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -1114,8 +939,7 @@ ) (defstate caveelevator-cycle-active (caveelevator) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'bonk) (activate! (-> self smush) -1.0 60 150 1.0 1.0) @@ -1123,49 +947,33 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (TODO-RENAME-20 self) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((f30-1 (* (get-current-phase (-> self sync)) (the float (ja-num-frames 0))))) - (cond - ((< (-> self prev-frame-num) f30-1) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) f30-1) - (set! (-> a0-2 param 1) 10000.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (else - (let ((v1-7 (-> self skel root-channel 0))) - (set! (-> v1-7 num-func) num-func-identity) - (set! (-> v1-7 frame-num) f30-1) - ) + (if (< (-> self prev-frame-num) f30-1) + (ja :num! (seek! f30-1 10000.0)) + (ja :num-func num-func-identity :frame-num f30-1) ) - ) (set! (-> self prev-frame-num) f30-1) ) (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (rider-post) (TODO-RENAME-21 self) (none) @@ -1173,8 +981,7 @@ ) (defstate caveelevator-one-way-idle-start (caveelevator) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('bonk) (activate! (-> self smush) -1.0 60 150 1.0 1.0) @@ -1189,34 +996,23 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (TODO-RENAME-20 self) (none) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as - art-joint-anim - (-> (the-as art-joint-anim (+ (* (-> self anim 0) 4) (the-as int (-> self draw art-group)))) - master-art-group-name - ) - ) - num-func-identity + :code (behavior () + (ja :group! (-> (the-as art-joint-anim (+ (* (-> self anim 0) 4) (the-as int (-> self draw art-group)))) + master-art-group-name + ) + :num! min ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (loop (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (rider-post) (TODO-RENAME-21 self) (none) @@ -1224,8 +1020,7 @@ ) (defstate caveelevator-one-way-travel-to-end (caveelevator) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'bonk) (activate! (-> self smush) -1.0 60 150 1.0 1.0) @@ -1233,50 +1028,30 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (TODO-RENAME-20 self) (none) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self anim 0))) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja :group! (-> self draw art-group data (-> self anim 0)) :num! min) + (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go caveelevator-one-way-idle-end) (none) ) - :post - (behavior () + :post (behavior () (rider-post) (TODO-RENAME-21 self) (none) @@ -1284,8 +1059,7 @@ ) (defstate caveelevator-one-way-idle-end (caveelevator) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'bonk) (activate! (-> self smush) -1.0 60 150 1.0 1.0) @@ -1293,13 +1067,11 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (cond ((zero? (-> self root-override riders num-riders)) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) @@ -1314,25 +1086,14 @@ (TODO-RENAME-20 self) (none) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self anim 0))) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self anim 0))) data 0 length) -1)) - ) - ) - (while #t + :code (behavior () + (ja :group! (-> self draw art-group data (-> self anim 0)) :num! max) + (loop (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (rider-post) (TODO-RENAME-21 self) (none) @@ -1340,8 +1101,7 @@ ) (defstate caveelevator-one-way-travel-to-start (caveelevator) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'bonk) (activate! (-> self smush) -1.0 60 150 1.0 1.0) @@ -1349,50 +1109,30 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (TODO-RENAME-20 self) (none) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self anim 1))) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja :group! (-> self draw art-group data (-> self anim 1)) :num! min) + (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go caveelevator-one-way-idle-start) (none) ) - :post - (behavior () + :post (behavior () (rider-post) (TODO-RENAME-21 self) (none) diff --git a/goal_src/levels/maincave/maincave-part.gc b/goal_src/levels/maincave/maincave-part.gc index a9b691a754..9a85d60567 100644 --- a/goal_src/levels/maincave/maincave-part.gc +++ b/goal_src/levels/maincave/maincave-part.gc @@ -28,8 +28,7 @@ (defpartgroup group-part-maincave-torch :id 318 :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 706 :fade-after (meters 200) :falloff-to (meters 220)) + :parts ((sp-item 706 :fade-after (meters 200) :falloff-to (meters 220)) (sp-item 707 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 708 :fade-after (meters 50) :falloff-to (meters 50) :period 600 :length 90) (sp-item 709 :fade-after (meters 50) :falloff-to (meters 50) :period 369 :length 69) @@ -39,8 +38,7 @@ ) (defpart 711 - :init-specs - ((sp-flt spt-num 0.3) + :init-specs ((sp-flt spt-num 0.3) (sp-flt spt-x (meters 0.2)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-int spt-rot-x 5) @@ -58,13 +56,11 @@ ) (defpart 712 - :init-specs - ((sp-flt spt-fade-b -6.826667)) + :init-specs ((sp-flt spt-fade-b -6.826667)) ) (defpart 706 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1069547520 1 1.0) (sp-rnd-flt spt-x (meters -0.35) (meters 0.7) 1.0) (sp-rnd-flt spt-z (meters -0.35) (meters 0.7) 1.0) @@ -86,13 +82,11 @@ ) (defpart 713 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) (defpart 708 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters 1)) @@ -115,8 +109,7 @@ ) (defpart 709 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.2) (meters 0.6) 1.0) (sp-flt spt-y (meters 0.5)) @@ -139,8 +132,7 @@ ) (defpart 710 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 0.2) 1.0) (sp-flt spt-y (meters 0.6)) @@ -163,8 +155,7 @@ ) (defpart 707 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.3)) @@ -197,8 +188,7 @@ (defpartgroup group-cave-cavedrip-1 :id 319 :bounds (static-bspherem 0 8 0 8.25) - :parts - ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 369 :length 5) + :parts ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 369 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 768 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 1167 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 1701 :length 5) @@ -210,8 +200,7 @@ (defpartgroup group-cave-cavedrip-2 :id 320 :bounds (static-bspherem 0 8 0 8.25) - :parts - ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 467 :length 5) + :parts ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 467 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 834 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 984 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 2237 :length 5) @@ -223,8 +212,7 @@ (defpartgroup group-cave-cavedrip-3 :id 321 :bounds (static-bspherem 0 8 0 8.25) - :parts - ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 801 :length 5) + :parts ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 801 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 867 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 1269 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 1983 :length 5) @@ -234,8 +222,7 @@ ) (defpart 2231 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-flt spt-num 3.0 4.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -254,8 +241,7 @@ ) (defpart 2232 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.02)) (sp-flt spt-scale-x (meters 0.5)) @@ -274,8 +260,7 @@ ) (defpart 2230 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-func spt-birth-func 'birth-func-y->userdata) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 24)) @@ -297,38 +282,19 @@ ) (defpart 2233 - :init-specs - ((sp-flt spt-fade-a 0.0)) + :init-specs ((sp-flt spt-fade-a 0.0)) ) (defun check-drop-level-maincave-drip ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) (when (< (-> arg2 y) (-> arg1 user-float)) (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (if (< (+ -1.0 (the-as float v1-2)) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) - ) - ) + (if (< (rand-float-gen) 0.25) + (sound-play "water-drop") + ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2231) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2232) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 2231) gp-0) + (launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 2232) gp-0) ) ) (none) diff --git a/goal_src/levels/maincave/mother-spider-egg.gc b/goal_src/levels/maincave/mother-spider-egg.gc index ee7e181d4f..62b3425cb9 100644 --- a/goal_src/levels/maincave/mother-spider-egg.gc +++ b/goal_src/levels/maincave/mother-spider-egg.gc @@ -5,14 +5,11 @@ ;; name in dgo: mother-spider-egg ;; dgos: L1, MAI, MAINCAVE -(define-extern *mother-spider-egg-unbroken-sg* skeleton-group) -(define-extern *mother-spider-egg-broken-sg* skeleton-group) - -(declare-type mother-spider-egg process-drawable) - ;; DECOMP BEGINS +(import "goal_src/import/spider-egg-ag.gc") + (deftype mother-spider-egg (process-drawable) ((parent-override (pointer mother-spider) :offset 12) (root-override collide-shape-moving :offset 112) @@ -44,22 +41,22 @@ ) -(defskelgroup *mother-spider-egg-unbroken-sg* spider-egg - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 2) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *mother-spider-egg-unbroken-sg* spider-egg spider-egg-unbroken-lod0-jg -1 + ((spider-egg-unbroken-lod0-mg (meters 20)) + (spider-egg-unbroken-lod1-mg (meters 40)) + (spider-egg-unbroken-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 1 0 2) + :shadow spider-egg-unbroken-shadow-mg + ) -(defskelgroup *mother-spider-egg-broken-sg* spider-egg - 5 - -1 - ((6 (meters 20)) (7 (meters 40)) (8 (meters 999999))) - :bounds (static-spherem 0 1 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *mother-spider-egg-broken-sg* spider-egg spider-egg-broken-lod0-jg -1 + ((spider-egg-broken-lod0-mg (meters 20)) + (spider-egg-broken-lod1-mg (meters 40)) + (spider-egg-broken-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 1 0 2) + ) (defpartgroup group-spider-egg-hatches :id 324 @@ -67,15 +64,13 @@ :linger-duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2018 :fade-after (meters 50) :falloff-to (meters 50)) + :parts ((sp-item 2018 :fade-after (meters 50) :falloff-to (meters 50)) (sp-item 2071 :fade-after (meters 50) :falloff-to (meters 50)) ) ) (defpart 2071 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-y (meters 0.5)) (sp-flt spt-scale-x (meters 0.1)) @@ -94,8 +89,7 @@ ) (defpart 2072 - :init-specs - ((sp-flt spt-scale-x (meters 0.1)) + :init-specs ((sp-flt spt-scale-x (meters 0.1)) (sp-flt spt-scale-y (meters 2)) (sp-flt spt-scalevel-y (meters 0.2)) (sp-flt spt-fade-a -1.4222223) @@ -103,8 +97,7 @@ ) (defpart 2018 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters 0.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) @@ -131,8 +124,7 @@ ) (defpart 2073 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) (defpartgroup group-spider-egg-explodes @@ -141,13 +133,11 @@ :linger-duration 375 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2074 :fade-after (meters 50) :falloff-to (meters 50))) + :parts ((sp-item 2074 :fade-after (meters 50) :falloff-to (meters 50))) ) (defpart 2074 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters 0.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 2) 1.0) @@ -173,7 +163,10 @@ (defmethod draw-egg-shadow mother-spider-egg ((obj mother-spider-egg) (arg0 vector) (arg1 symbol)) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((s5-0 (new 'stack-no-clear 'collide-tri-result)) (a1-1 (new 'stack-no-clear 'vector)) (a2-1 (new 'stack-no-clear 'vector)) @@ -182,11 +175,20 @@ (set! (-> a1-1 y) (+ 1228.8 (-> a1-1 y))) (set-vector! a2-1 0.0 -61440.0 0.0 1.0) (cond - ((>= (fill-and-probe-using-line-sphere *collide-cache* a1-1 a2-1 7372.8 (collide-kind background) obj s5-0 1) + ((>= (fill-and-probe-using-line-sphere + *collide-cache* + a1-1 + a2-1 + 7372.8 + (collide-kind background) + obj + s5-0 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (let ((v1-11 (-> obj draw shadow-ctrl))) - (set! (-> v1-11 settings flags) (logand -33 (-> v1-11 settings flags))) + (logclear! (-> v1-11 settings flags) (shadow-flags disable-draw)) ) 0 (let ((v1-14 (-> obj draw shadow-ctrl))) @@ -201,7 +203,7 @@ ) (else (let ((v1-22 (-> obj draw shadow-ctrl))) - (logior! (-> v1-22 settings flags) 32) + (logior! (-> v1-22 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -210,7 +212,7 @@ ) (else (let ((v1-25 (-> obj draw shadow-ctrl))) - (logior! (-> v1-25 settings flags) 32) + (logior! (-> v1-25 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -219,21 +221,18 @@ ) (defstate mother-spider-egg-falling (mother-spider-egg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (go mother-spider-egg-die-while-falling) ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self falling-start-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (fmin (the float (- (-> *display* base-frame-counter) (-> self falling-start-time))) (-> self traj time)) ) @@ -245,44 +244,29 @@ ) ) (when (= f30-0 (-> self traj time)) - (sound-play-by-name (static-sound-name "eggs-lands") (new-sound-id) 1024 0 0 1 #t) + (sound-play "eggs-lands") (go mother-spider-egg-on-ground) ) ) (draw-egg-shadow self (-> self shadow-pos) #t) (none) ) - :code - (behavior () + :code (behavior () (ja-channel-push! 1 0) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) (-> self anim-speed)) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 9) :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (none) ) - :post - (the-as (function none :behavior mother-spider-egg) transform-post) + :post (the-as (function none :behavior mother-spider-egg) transform-post) ) (defstate mother-spider-egg-on-ground (mother-spider-egg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'touch) @@ -302,25 +286,22 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (if (not (draw-egg-shadow self (-> self shadow-pos) #t)) (set! (-> self shadow-pos quad) (-> self fall-dest quad)) ) (none) ) - :trans - (behavior () + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) (go mother-spider-egg-hatch) ) (draw-egg-shadow self (-> self shadow-pos) #f) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) (let ((gp-0 (new 'stack-no-clear 'quaternion)) (s5-0 (new 'stack-no-clear 'quaternion)) ) @@ -334,61 +315,32 @@ (quaternion-from-two-vectors! s5-0 s4-0 s3-0) ) (quaternion*! s5-0 s5-0 gp-0) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.3) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 11) :num! (seek! max 1.3) :frame-num 0.0) (until (ja-done? 0) (let* ((f0-8 (ja-frame-num 0)) - (v1-19 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) + (v1-19 (ja-group)) (f0-9 (/ f0-8 (the float (+ (-> v1-19 data 0 length) -1)))) ) (quaternion-slerp! (-> self root-override quat) gp-0 s5-0 f0-9) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.3) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 1.3)) ) ) - (while #t - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) (-> self anim-speed)) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 9) :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (none) ) - :post - (the-as (function none :behavior mother-spider-egg) transform-post) + :post (the-as (function none :behavior mother-spider-egg) transform-post) ) (defstate mother-spider-egg-hatch (mother-spider-egg) - :trans - (behavior () + :trans (behavior () (when (and (zero? (-> self draw cur-lod)) (logtest? (-> self draw status) (draw-status was-drawn))) (let ((a1-0 (new 'stack-no-clear 'vector))) (set! (-> a1-0 quad) (-> self fall-dest quad)) @@ -404,114 +356,71 @@ ) (none) ) - :code - (behavior () + :code (behavior () (send-event (ppointer->process (-> self parent-override)) 'trigger) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 324) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 324) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) - (ja-channel-push! 1 60) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((v1-37 (-> self draw shadow-ctrl))) - (logior! (-> v1-37 settings flags) 32) + (logior! (-> v1-37 settings flags) (shadow-flags disable-draw)) ) 0 (go mother-spider-egg-die-exit) (none) ) - :post - (the-as (function none :behavior mother-spider-egg) transform-post) + :post (the-as (function none :behavior mother-spider-egg) transform-post) ) (defstate mother-spider-egg-die (mother-spider-egg) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (let ((v1-3 (-> self draw shadow-ctrl))) - (logior! (-> v1-3 settings flags) 32) + (logior! (-> v1-3 settings flags) (shadow-flags disable-draw)) ) 0 (lods-assign! (-> self draw) (-> self broken-look)) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 325) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) - ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 325) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) + (ja-no-eval :group! (-> self draw art-group data 12) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go mother-spider-egg-die-exit) (none) ) - :post - (the-as (function none :behavior mother-spider-egg) ja-post) + :post (the-as (function none :behavior mother-spider-egg) ja-post) ) (defstate mother-spider-egg-die-while-falling (mother-spider-egg) - :trans - (behavior () + :trans (behavior () (let ((f0-2 (fmin (the float (- (-> *display* base-frame-counter) (-> self falling-start-time))) (-> self traj time)) ) @@ -520,69 +429,47 @@ ) (none) ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) (let ((v1-5 (-> self draw shadow-ctrl))) - (logior! (-> v1-5 settings flags) 32) + (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) 0 - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-2 (method-of-type part-tracker activate))) - (t9-2 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 325) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 325) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) - (ja-channel-push! 1 30) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 12) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go mother-spider-egg-die-exit) (none) ) - :post - (the-as (function none :behavior mother-spider-egg) ja-post) + :post (the-as (function none :behavior mother-spider-egg) ja-post) ) (defstate mother-spider-egg-die-exit (mother-spider-egg) - :code - (behavior () + :code (behavior () (send-event (ppointer->process (-> self parent-override)) 'untrigger) (logior! (-> self draw status) (draw-status hidden)) (let ((v1-8 (-> self draw shadow-ctrl))) - (logior! (-> v1-8 settings flags) 32) + (logior! (-> v1-8 settings flags) (shadow-flags disable-draw)) ) 0 - (set! (-> self root-override nav-flags) (logand -2 (-> self root-override nav-flags))) - (set! (-> self root-override nav-flags) (logand -3 (-> self root-override nav-flags))) + (logclear! (-> self root-override nav-flags) (nav-flags navf0)) + (logclear! (-> self root-override nav-flags) (nav-flags navf1)) (clear-collide-with-as (-> self root-override)) (until (not (-> self child)) (suspend) @@ -591,7 +478,7 @@ ) ) -(defbehavior mother-spider-egg-init-by-other mother-spider-egg ((arg0 entity) (arg1 vector) (arg2 vector) (arg3 vector)) +(defbehavior mother-spider-egg-init-by-other mother-spider-egg ((arg0 entity-actor) (arg1 vector) (arg2 vector) (arg3 vector)) (set! (-> self entity) arg0) (set! (-> self anim-speed) (rand-vu-float-range 0.8 1.2)) (set! (-> self falling-start-time) (-> *display* base-frame-counter)) @@ -625,9 +512,9 @@ (setup-lods! (-> self broken-look) *mother-spider-egg-broken-sg* (-> self draw art-group) (-> self entity)) (set! (-> self draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) (set! (-> self nav) (new 'process 'nav-control (-> self root-override) 16 40960.0)) - (logior! (-> self nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) - (set! (-> self root-override nav-flags) (logand -2 (-> self root-override nav-flags))) - (logior! (-> self root-override nav-flags) 2) + (logior! (-> self nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (logclear! (-> self root-override nav-flags) (nav-flags navf0)) + (logior! (-> self root-override nav-flags) (nav-flags navf1)) (set! (-> self nav extra-nav-sphere quad) (-> self fall-dest quad)) (set! (-> self nav extra-nav-sphere w) 4096.0) (setup-from-to-height! (-> self traj) (-> self root-override trans) arg2 4096.0 -4.551111) diff --git a/goal_src/levels/maincave/mother-spider-proj.gc b/goal_src/levels/maincave/mother-spider-proj.gc index a618aec85a..5c98189ae4 100644 --- a/goal_src/levels/maincave/mother-spider-proj.gc +++ b/goal_src/levels/maincave/mother-spider-proj.gc @@ -22,8 +22,7 @@ :id 326 :duration 300 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 718 :flags (launch-asap) :binding 716) + :parts ((sp-item 718 :flags (launch-asap) :binding 716) (sp-item 716 :flags (start-dead) :binding 717) (sp-item 717 :flags (start-dead launch-asap)) (sp-item 717 :flags (start-dead launch-asap)) @@ -75,8 +74,7 @@ ) (defpart 718 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.01)) (sp-copy-from-other spt-scale-y -4) @@ -88,8 +86,7 @@ ) (defpart 716 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -114,13 +111,11 @@ ) (defpart 720 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) (defpart 717 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 5.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -152,13 +147,11 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 722) (sp-item 723) (sp-item 724)) + :parts ((sp-item 722) (sp-item 723) (sp-item 724)) ) (defpart 722 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 64.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -185,8 +178,7 @@ ) (defpart 724 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -210,8 +202,7 @@ ) (defpart 723 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -231,8 +222,7 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 722)) + :parts ((sp-item 722)) ) (defmethod dummy-24 mother-spider-proj ((obj mother-spider-proj)) @@ -252,7 +242,7 @@ ) (sound-trans-convert (-> s5-0 parms trans) a1-1) ) - (set! (-> s5-0 parms mask) (the-as uint 32)) + (set! (-> s5-0 parms mask) (sound-mask trans)) (-> s5-0 id) ) (let ((f0-5 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (-> *display* base-frame-counter) 75))))))))) @@ -261,7 +251,7 @@ (the-as vector #f) f0-5 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -278,7 +268,7 @@ (s4-0 (new 'stack-no-clear 'vector)) (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0)) ) - (if (logtest? (-> arg0 root-override status) 4) + (if (logtest? (-> arg0 root-override status) (cshape-moving-flags tsurf)) (vector-flatten! s3-1 s3-1 (-> arg0 root-override local-normal)) ) (vector-normalize-copy! s4-0 s3-1 1.0) @@ -342,13 +332,18 @@ (set! (-> obj target quad) (-> (target-pos 0) quad)) (set! (-> obj target y) (+ 4915.2 (-> obj target y))) (set! (-> obj target-base quad) (-> obj target quad)) - (set! (-> obj sound-id) (sound-play-by-name (static-sound-name "mother-track") (new-sound-id) 1024 0 0 1 #t)) - (sound-play-by-name (static-sound-name "mother-fire") (new-sound-id) 1024 0 0 1 #t) + (set! (-> obj sound-id) (sound-play "mother-track")) + (sound-play "mother-fire") (none) ) (defmethod dummy-28 mother-spider-proj ((obj mother-spider-proj)) - (when (and *target* (zero? (logand (-> *target* state-flags) #x80f8))) + (when (and *target* + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + ) (let ((gp-0 (-> obj target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) (set! (-> gp-0 y) (+ 4915.2 (-> gp-0 y))) @@ -371,30 +366,22 @@ (defstate projectile-impact (mother-spider-proj) :virtual #t - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 327) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 327) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "mother-hit") (new-sound-id) 1024 0 0 1 #t) + (sound-play "mother-hit") (suspend) (go-virtual projectile-die) (none) @@ -403,25 +390,17 @@ (defstate projectile-dissipate (mother-spider-proj) :virtual #t - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 328) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 328) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) diff --git a/goal_src/levels/maincave/mother-spider.gc b/goal_src/levels/maincave/mother-spider.gc index 58e9f0e369..e765dc6aa8 100644 --- a/goal_src/levels/maincave/mother-spider.gc +++ b/goal_src/levels/maincave/mother-spider.gc @@ -10,25 +10,23 @@ ;; DECOMP BEGINS -(defskelgroup *mother-spider-sg* mother-spider - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - :shadow 4 - ) +(import "goal_src/import/mother-spider-ag.gc") -(defskelgroup *mother-spider-leg-sg* mother-spider - 13 - -1 - ((14 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *mother-spider-sg* mother-spider mother-spider-lod0-jg -1 + ((mother-spider-lod0-mg (meters 20)) + (mother-spider-lod1-mg (meters 40)) + (mother-spider-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 8) + :shadow mother-spider-shadow-mg + ) -(define - *mother-spider-threads* +(defskelgroup *mother-spider-leg-sg* mother-spider mother-spider-leg-lod0-jg -1 + ((mother-spider-leg-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) + +(define *mother-spider-threads* (new 'static 'inline-array mother-spider-thread 9 (new 'static 'mother-spider-thread :joint-index 27) (new 'static 'mother-spider-thread :trans-u (the-as float #x1a) :swing-arc-u 0.35) @@ -42,8 +40,7 @@ ) ) -(define - *mother-spider-leg-infos* +(define *mother-spider-leg-infos* (new 'static 'inline-array mother-spider-leg-info 8 (new 'static 'mother-spider-leg-info :joint-index0 13 :joint-index1 14 :cprim-index 8) (new 'static 'mother-spider-leg-info :joint-index0 7 :joint-index1 8 :cprim-index 5) @@ -60,13 +57,11 @@ :id 614 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2477)) + :parts ((sp-item 2477)) ) (defpart 2477 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.35) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -86,8 +81,7 @@ ) (defstate mother-spider-leg-flying (mother-spider-leg) - :trans - (behavior () + :trans (behavior () (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -116,7 +110,7 @@ (collide-kind background) self gp-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -143,71 +137,43 @@ (deg-seek (-> self facing-rot z) 16384.0 (* (-> self facing-rotv z) (-> *display* seconds-per-frame))) ) (quaternion-zxy! (-> self root quat) (-> self facing-rot)) - (set! (-> self root scale x) (seek (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame)))) + (seek! (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame))) (set! (-> self root scale y) (-> self root scale x)) (set! (-> self root scale z) (-> self root scale x)) (none) ) ) - :code - (behavior () + :code (behavior () (ja-channel-push! 1 0) (let ((f30-0 (rand-vu-float-range 0.2 0.7))) (dotimes (gp-0 3) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 15)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!) - ) + (ja-no-eval :group! mother-spider-leg-twitching-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (spawn (-> self part) (-> self root trans)) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) f30-0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) f30-0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + (ja-no-eval :group! mother-spider-leg-die-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) f30-0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (none) ) - :post - (the-as (function none :behavior mother-spider-leg) ja-post) + :post (the-as (function none :behavior mother-spider-leg) ja-post) ) (defstate wait-for-children (mother-spider) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (until (not (-> self child)) (suspend) ) (none) ) - :post - (the-as (function none :behavior mother-spider) ja-post) + :post (the-as (function none :behavior mother-spider) ja-post) ) (defbehavior mother-spider-leg-init-by-other mother-spider-leg ((arg0 mother-spider) (arg1 vector) (arg2 vector) (arg3 vector)) @@ -245,13 +211,11 @@ :id 618 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2498 :period 90 :length 30)) + :parts ((sp-item 2498 :period 90 :length 30)) ) (defpart 2498 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.35) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -316,26 +280,20 @@ ) (('touch) (when (= (-> arg0 type) target) - (let ((a1-15 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-15 from) self) - (set! (-> a1-15 num-params) 2) - (set! (-> a1-15 message) 'attack) - (set! (-> a1-15 param 0) (-> arg3 param 0)) - (let ((v1-18 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-18 shove-up) 2048.0) - (set! (-> v1-18 shove-back) 8192.0) - (set! (-> a1-15 param 1) (the-as uint v1-18)) - ) - (when (send-event-function arg0 a1-15) - (let ((gp-2 (new 'stack-no-clear 'vector))) - (let ((v1-20 (target-pos 0))) - (vector-! gp-2 (-> self root-override trans) v1-20) + (when (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 0.5)) (shove-back (meters 2)))) ) - (set! (-> gp-2 y) 0.0) - (vector-normalize! gp-2 1.0) - (set! (-> self thread-vel) (+ -8192.0 (-> self thread-vel))) - (TODO-RENAME-21 self gp-2 40960.0 #f) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (let ((v1-20 (target-pos 0))) + (vector-! gp-2 (-> self root-override trans) v1-20) ) + (set! (-> gp-2 y) 0.0) + (vector-normalize! gp-2 1.0) + (set! (-> self thread-vel) (+ -8192.0 (-> self thread-vel))) + (TODO-RENAME-21 self gp-2 40960.0 #f) ) ) ) @@ -393,15 +351,7 @@ (let ((s3-0 (new 'stack-no-clear 'baby-spider-spawn-params))) (init! s3-0 arg2 #f #t #f 7 1 'untrigger) (set-delay! s3-0 (seconds 9)) - (let ((s2-0 (get-process *default-dead-pool* baby-spider #x4000))) - (when s2-0 - (let ((t9-3 (method-of-type baby-spider activate))) - (t9-3 (the-as baby-spider s2-0) obj 'baby-spider (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 baby-spider-init-by-other obj arg0 arg1 s3-0) - (-> s2-0 ppointer) - ) - ) + (process-spawn baby-spider obj arg0 arg1 s3-0 :to obj) ) (let ((v0-5 (+ (-> obj baby-count) 1))) (set! (-> obj baby-count) v0-5) @@ -410,8 +360,8 @@ ) (defmethod is-player-stuck? mother-spider ((obj mother-spider)) - (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) @@ -451,11 +401,20 @@ (set-vector! a2-0 0.0 -81920.0 0.0 1.0) (set! (-> a1-0 y) (+ -8192.0 (-> a1-0 y))) (cond - ((>= (fill-and-probe-using-line-sphere *collide-cache* a1-0 a2-0 8192.0 (collide-kind background) obj s5-0 1) + ((>= (fill-and-probe-using-line-sphere + *collide-cache* + a1-0 + a2-0 + 8192.0 + (collide-kind background) + obj + s5-0 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (let ((v1-11 (-> obj draw shadow-ctrl))) - (set! (-> v1-11 settings flags) (logand -33 (-> v1-11 settings flags))) + (logclear! (-> v1-11 settings flags) (shadow-flags disable-draw)) ) 0 (let ((v1-14 (-> obj draw shadow-ctrl))) @@ -476,7 +435,7 @@ ) (else (let ((v1-23 (-> obj draw shadow-ctrl))) - (logior! (-> v1-23 settings flags) 32) + (logior! (-> v1-23 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -485,7 +444,7 @@ ) (else (let ((v1-25 (-> obj draw shadow-ctrl))) - (logior! (-> v1-25 settings flags) 32) + (logior! (-> v1-25 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -633,7 +592,7 @@ (when (logtest? s4-1 1) (cond ((>= (+ (-> *display* base-frame-counter) (seconds -1)) (-> obj leg-socket-part-time s3-0)) - (set! (-> obj leg-socket-part-mask) (logxor (-> obj leg-socket-part-mask) (ash 1 s3-0))) + (logxor! (-> obj leg-socket-part-mask) (ash 1 s3-0)) ) (else (let ((v1-20 (-> *mother-spider-leg-infos* s3-0)) @@ -752,7 +711,7 @@ (collide-kind background) obj (the-as collide-tri-result s5-1) - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -810,7 +769,7 @@ (let ((f0-44 (+ (-> obj orient-rot y) (* (-> obj spin-vel) (-> *display* seconds-per-frame))))) (set! (-> obj orient-rot y) (- f0-44 (* (the float (the int (/ f0-44 65536.0))) 65536.0))) ) - (set! (-> obj spin-vel) (seek (-> obj spin-vel) 0.0 (* 91022.22 (-> *display* seconds-per-frame)))) + (seek! (-> obj spin-vel) 0.0 (* 91022.22 (-> *display* seconds-per-frame))) (when (< (fabs (-> obj spin-vel)) 69176.89) (if (>= (-> obj spin-vel) 0.0) (set! (-> obj spin-vel) 69176.89) @@ -851,10 +810,9 @@ ) (defstate mother-spider-idle (mother-spider) - :enter - (behavior () + :enter (behavior () (let ((v1-1 (-> self draw shadow-ctrl))) - (logior! (-> v1-1 settings flags) 32) + (logior! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) 0 (set! (-> self mode) (the-as uint 0)) @@ -865,24 +823,21 @@ (logior! (-> self draw status) (draw-status hidden)) (none) ) - :exit - (behavior () + :exit (behavior () (restore-collide-with-as (-> self root-override)) (set! (-> self skel postbind-function) mother-spider-full-joint-callback) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (if (grab-player? self) (go mother-spider-traveling (the-as uint 1)) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -891,10 +846,8 @@ ) (defstate mother-spider-traveling (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior ((arg0 uint)) + :event mother-spider-default-event-handler + :enter (behavior ((arg0 uint)) (is-player-stuck? self) (let ((v1-2 arg0)) (cond @@ -931,8 +884,7 @@ (set! (-> self going-up?) (< (-> self targ-dist-from-anchor) (-> self dist-from-anchor))) (none) ) - :trans - (behavior () + :trans (behavior () (let ((gp-0 (is-player-stuck? self)) (v1-1 (-> self mode)) ) @@ -987,102 +939,55 @@ (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior ((arg0 uint)) + :code (behavior ((arg0 uint)) (local-vars (v1-12 symbol) (v1-28 symbol)) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 7)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! mother-spider-lowering-ja :num! min) + (loop (until v1-12 (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-12 (or (ja-done? 0) (-> self hit?))) ) (when (-> self hit?) (until (not (-> self hit?)) (set! (-> self hit?) #f) - (ja-channel-push! 1 60) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 9)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! mother-spider-takes-hit-ja :num! min) (until v1-28 (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-28 (or (ja-done? 0) (-> self hit?))) ) ) - (ja-channel-push! 1 60) - ) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 7)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) + (ja-channel-push! 1 (seconds 0.2)) ) + (ja :group! mother-spider-lowering-ja :num! min) ) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) (defstate mother-spider-stop-traveling (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior () + :event mother-spider-default-event-handler + :enter (behavior () (set! (-> self hit?) #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-tracking) ) (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! mother-spider-stopped-lowering-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((v1-22 (-> self mode))) (cond @@ -1101,22 +1006,18 @@ ) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) (defstate mother-spider-tracking (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior () + :event mother-spider-default-event-handler + :enter (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self last-player-in-air-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-tracking) ) @@ -1125,7 +1026,11 @@ ) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (-> self node-list data 6)) - (if (or (logtest? (-> *target* state-flags) #x80f8) (< (vector-vector-distance gp-0 (camera-pos)) 8192.0)) + (if (or (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + (< (vector-vector-distance gp-0 (camera-pos)) 8192.0) + ) (go mother-spider-traveling (the-as uint 2)) ) ) @@ -1141,8 +1046,8 @@ ) ) ) - (if (or (not *target*) (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (if (or (not *target*) (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) ) (set! (-> self last-player-in-air-time) (-> *display* base-frame-counter)) @@ -1177,63 +1082,38 @@ (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? mother-spider-idle-ja) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) ) (else - (ja-channel-push! 1 75) + (ja-channel-push! 1 (seconds 0.25)) ) ) - (while #t - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (loop + (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) (defstate mother-spider-hit-while-tracking (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior () + :event mother-spider-default-event-handler + :enter (behavior () (set! (-> self hit?) #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-tracking) ) @@ -1244,82 +1124,44 @@ (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! mother-spider-takes-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) - (while #t - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (loop + (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) (defstate mother-spider-spit (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior () + :event mother-spider-default-event-handler + :enter (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-tracking) ) (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior () - (ja-channel-push! 1 75) + :code (behavior () + (ja-channel-push! 1 (seconds 0.25)) (let ((gp-0 #f)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.5) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! mother-spider-spit-ja :num! (seek! max 1.5) :frame-num 0.0) (until (ja-done? 0) (when (and (not gp-0) (>= (ja-aframe-num 0) 6.0) (>= 8.0 (ja-aframe-num 0))) (when *target* @@ -1341,14 +1183,15 @@ (vector-normalize! s5-0 1.0) (vector-deg-seek s5-0 s2-0 s5-0 6371.5557) (vector-normalize-copy! s3-0 s5-0 32768.0) - (let ((gp-1 (get-process *default-dead-pool* mother-spider-proj #x4000))) - (when gp-1 - (let ((t9-12 (method-of-type mother-spider-proj activate))) - (t9-12 (the-as mother-spider-proj gp-1) self 'mother-spider-proj (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 projectile-init-by-other (-> self entity) s4-0 s3-0 0 (process->handle *target*)) - (-> gp-1 ppointer) - ) + (process-spawn + mother-spider-proj + :init projectile-init-by-other + (-> self entity) + s4-0 + s3-0 + 0 + (process->handle *target*) + :to self ) (set! gp-0 #t) (set! (-> self last-spit-time) (-> *display* base-frame-counter)) @@ -1366,11 +1209,7 @@ ) ) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.5) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 1.5)) ) ) (if (> (-> self spit-counter) 0) @@ -1379,21 +1218,17 @@ ) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) (defstate mother-spider-birthing (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior () + :event mother-spider-default-event-handler + :enter (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-birthing) ) @@ -1401,14 +1236,20 @@ (go mother-spider-traveling (the-as uint 0)) ) (if (and (>= (- (-> *display* base-frame-counter) (-> self started-birthing-time)) (seconds 6)) - (zero? (logand (-> *target* state-flags) #x80f8)) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) ) (go mother-spider-traveling (the-as uint 1)) ) (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) (> (-> self birthing-counter) 0) (and (>= 49152.0 (- (-> self max-dist-from-anchor) (-> self dist-from-anchor))) - (zero? (logand (-> *target* state-flags) #x80f8)) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) (TODO-RENAME-21 (-> self nav) (-> self root-override trans)) ) ) @@ -1417,64 +1258,39 @@ (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? mother-spider-idle-ja) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) ) (else - (ja-channel-push! 1 75) + (ja-channel-push! 1 (seconds 0.25)) ) ) - (while #t - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (loop + (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) (defstate mother-spider-birth-baby (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior () + :event mother-spider-default-event-handler + :enter (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-birthing) ) @@ -1487,19 +1303,10 @@ (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior () - (ja-channel-push! 1 75) + :code (behavior () + (ja-channel-push! 1 (seconds 0.25)) (let ((gp-0 #f)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.4) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! mother-spider-birth-ja :num! (seek! max 1.4) :frame-num 0.0) (until (ja-done? 0) (when (and (not gp-0) (>= (ja-aframe-num 0) 10.0)) (set! gp-0 #t) @@ -1507,41 +1314,21 @@ (s4-0 (new 'stack-no-clear 'vector)) ) (when (TODO-RENAME-20 self s5-0 s4-0) - (let ((s3-0 (get-process *default-dead-pool* mother-spider-egg #x4000))) - (when s3-0 - (let ((t9-5 (method-of-type mother-spider-egg activate))) - (t9-5 (the-as mother-spider-egg s3-0) self 'mother-spider-egg (the-as pointer #x70004000)) - ) - (run-now-in-process - s3-0 - mother-spider-egg-init-by-other - (-> self entity) - (-> self root-override trans) - s5-0 - s4-0 - ) - (-> s3-0 ppointer) - ) - ) + (process-spawn mother-spider-egg (-> self entity) (-> self root-override trans) s5-0 s4-0 :to self) (+! (-> self baby-count) 1) (+! (-> self birthing-counter) -1) - (sound-play-by-name (static-sound-name "lay-eggs") (new-sound-id) 1024 0 0 1 #t) + (sound-play "lay-eggs") ) ) ) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.4) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 1.4)) ) ) (go mother-spider-birthing) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) (defmethod TODO-RENAME-20 mother-spider ((obj mother-spider) (arg0 vector) (arg1 vector)) @@ -1642,7 +1429,7 @@ (collide-kind background) obj s2-2 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -1676,7 +1463,7 @@ (collide-kind background) obj s3-2 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -1693,15 +1480,12 @@ ) (defstate mother-spider-hit-while-birthing (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior () + :event mother-spider-default-event-handler + :enter (behavior () (set! (-> self hit?) #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-birthing) ) @@ -1711,57 +1495,29 @@ (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! mother-spider-takes-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) - (while #t - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (loop + (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) (defstate mother-spider-die-from-uppercut (mother-spider) - :event - mother-spider-death-event-handler - :enter - (behavior () + :event mother-spider-death-event-handler + :enter (behavior () (shut-down! (-> self neck)) (set! (-> self thread-speed) 122880.0) (set! (-> self targ-dist-from-anchor) (+ -24576.0 (-> self dist-from-anchor))) @@ -1783,15 +1539,7 @@ (set! (-> s1-0 quad) (-> s2-0 quad)) (set! (-> s1-0 y) (+ 0.3 (-> s1-0 y))) (vector-normalize! s1-0 1.0) - (let ((s0-1 (get-process *default-dead-pool* mother-spider-leg #x4000))) - (when s0-1 - (let ((t9-6 (method-of-type mother-spider-leg activate))) - (t9-6 (the-as mother-spider-leg s0-1) self 'mother-spider-leg (the-as pointer #x70004000)) - ) - (run-now-in-process s0-1 mother-spider-leg-init-by-other self s3-0 s2-0 s1-0) - (-> s0-1 ppointer) - ) - ) + (process-spawn mother-spider-leg self s3-0 s2-0 s1-0 :to self) ) (+! s5-0 1) ) @@ -1799,91 +1547,58 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (TODO-RENAME-29 self #f #f) (none) ) - :code - (behavior () + :code (behavior () (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-2 user-int8 0) 1) ) (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (clear-collide-with-as (-> self root-override)) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-no-eval :group! mother-spider-die-from-uppercut-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go mother-spider-die-wait-for-children) (none) ) - :post - (the-as (function none :behavior mother-spider) ja-post) + :post (the-as (function none :behavior mother-spider) ja-post) ) (defstate mother-spider-die (mother-spider) - :event - mother-spider-death-event-handler - :trans - (behavior () + :event mother-spider-death-event-handler + :trans (behavior () (TODO-RENAME-29 self #f #f) (none) ) - :code - (behavior () + :code (behavior () (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-2 user-int8 0) 1) ) (shut-down! (-> self neck)) (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (clear-collide-with-as (-> self root-override)) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! mother-spider-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go mother-spider-die-wait-for-children) (none) ) - :post - (the-as (function none :behavior mother-spider) ja-post) + :post (the-as (function none :behavior mother-spider) ja-post) ) (defstate mother-spider-die-wait-for-children (mother-spider) - :event - mother-spider-death-event-handler - :code - (behavior () + :event mother-spider-death-event-handler + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) (set! (-> self skel postbind-function) #f) @@ -2104,10 +1819,10 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *mother-spider-sg* '()) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav nearest-y-threshold) 409600.0) - (set! (-> obj root-override nav-flags) (logand -2 (-> obj root-override nav-flags))) - (set! (-> obj root-override nav-flags) (logand -3 (-> obj root-override nav-flags))) + (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) + (logclear! (-> obj root-override nav-flags) (nav-flags navf1)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (set! (-> obj fact) diff --git a/goal_src/levels/maincave/spiderwebs.gc b/goal_src/levels/maincave/spiderwebs.gc index 8ab8bf9dd4..322c9bcd13 100644 --- a/goal_src/levels/maincave/spiderwebs.gc +++ b/goal_src/levels/maincave/spiderwebs.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/spiderwebs-ag.gc") + (define *spider-jump-mods* (new 'static 'surface :name 'jump :turnv 131072.0 @@ -32,7 +34,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #xc00 + :flags (surface-flags allow-edge-grab jump) ) ) @@ -50,28 +52,17 @@ ) -(defskelgroup *spiderwebs-sg* spiderwebs - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3.5) - :longest-edge (meters 0) - ) +(defskelgroup *spiderwebs-sg* spiderwebs spiderwebs-good-lod0-jg -1 + ((spiderwebs-good-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + ) (defbehavior spiderwebs-default-event-handler spiderwebs ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('bonk) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 3) - (set! (-> a1-1 message) 'jump) - (set! (-> a1-1 param 0) (the-as uint (-> self spring-height))) - (set! (-> a1-1 param 1) (the-as uint (-> self spring-height))) - (set! (-> a1-1 param 2) (the-as uint *spider-jump-mods*)) - (if (send-event-function arg0 a1-1) - (go spiderwebs-bounce) - ) - ) + (if (send-event arg0 'jump (-> self spring-height) (-> self spring-height) *spider-jump-mods*) + (go spiderwebs-bounce) + ) ) (('touch) (when (= (-> arg0 type) target) @@ -100,21 +91,12 @@ ) (defstate spiderwebs-idle (spiderwebs) - :event - spiderwebs-default-event-handler - :code - (behavior () + :event spiderwebs-default-event-handler + :code (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! spiderwebs-bounce-ja :num! min) (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -123,48 +105,24 @@ ) (defstate spiderwebs-bounce (spiderwebs) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (sound-play-by-name (static-sound-name "web-tramp") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-1 param 0) (ja-aframe 10.0 0)) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) 0.0) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (sound-play "web-tramp") + (ja-no-eval :group! spiderwebs-bounce-ja :num! (seek! (ja-aframe 10.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe 10.0 0)) - (set! (-> gp-2 param 1) 1.0) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 10.0 0))) ) (set! (-> self event-hook) (-> spiderwebs-idle event)) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> gp-3 param 1) 1.0) - (set! (-> gp-3 frame-num) (ja-aframe 10.0 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! spiderwebs-bounce-ja :num! (seek!) :frame-num (ja-aframe 10.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go spiderwebs-idle) (none) ) - :post - (the-as (function none :behavior spiderwebs) transform-post) + :post (the-as (function none :behavior spiderwebs) transform-post) ) (defmethod init-from-entity! spiderwebs ((obj spiderwebs) (arg0 entity-actor)) diff --git a/goal_src/levels/misty/babak-with-cannon.gc b/goal_src/levels/misty/babak-with-cannon.gc index 5d0ce12e70..2f57dd0946 100644 --- a/goal_src/levels/misty/babak-with-cannon.gc +++ b/goal_src/levels/misty/babak-with-cannon.gc @@ -29,13 +29,11 @@ nav-enemy-default-event-handler (defstate nav-enemy-idle (babak-with-cannon) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak-with-cannon) nav-enemy-default-event-handler ) - :trans - (behavior () + :trans (behavior () (if (and (and *target* (>= (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) @@ -46,51 +44,27 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-post) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (anim-loop) (none) ) - :post - (the-as (function none :behavior babak-with-cannon) #f) + :post (the-as (function none :behavior babak-with-cannon) #f) ) (defstate nav-enemy-patrol (babak-with-cannon) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak-with-cannon) nav-enemy-default-event-handler ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (let ((f30-0 (- (-> (target-pos 0) y) (-> self collide-info trans y)))) (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) @@ -117,59 +91,41 @@ nav-enemy-default-event-handler ) (none) ) - :code - (-> (method-of-type babak nav-enemy-patrol) code) + :code (-> (method-of-type babak nav-enemy-patrol) code) ) (defstate babak-run-to-cannon (babak) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self nav destination-pos quad) (-> self entity extra trans quad)) (set! (-> self nav target-pos quad) (-> self entity extra trans quad)) (none) ) - :trans - (behavior () + :trans (behavior () (if (nav-enemy-notice-player?) (go-virtual nav-enemy-chase) ) - (if (logtest? (nav-control-flags bit19) (-> self nav flags)) + (if (logtest? (nav-control-flags navcf19) (-> self nav flags)) (go babak-with-cannon-jump-onto-cannon) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (loop + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (behavior () + :post (behavior () (nav-enemy-travel-post) (none) ) @@ -223,22 +179,19 @@ nav-enemy-default-event-handler ) (defstate babak-with-cannon-jump-onto-cannon (babak-with-cannon) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak-with-cannon) nav-enemy-jump-event-handler ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 24) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) - (set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (nav-enemy-neck-control-inactive) (let* ((v1-7 (-> self cannon-ent)) (gp-0 (if v1-7 @@ -261,12 +214,12 @@ nav-enemy-default-event-handler ) ) (when (not (nav-enemy-facing-point? (-> self jump-dest) 5461.3335)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) - (set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (let* ((v1-20 (-> self cannon-ent)) (gp-1 (if v1-20 (-> v1-20 extra process) @@ -280,77 +233,49 @@ nav-enemy-default-event-handler (when a0-9 (let ((gp-2 (babak-with-cannon-compute-cannon-dir (the-as mistycannon a0-9) (new 'stack-no-clear 'vector)))) (when (not (nav-enemy-facing-direction? gp-2 1820.4445)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (nav-enemy-turn-to-face-dir gp-2 182.04445) (forward-up->quaternion (-> self collide-info quat) gp-2 *y-vector*) ) ) ) ) - (ja-channel-push! 1 30) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 17) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go babak-with-cannon-shooting) (none) ) - :post - (the-as (function none :behavior babak-with-cannon) nav-enemy-jump-post) + :post (the-as (function none :behavior babak-with-cannon) nav-enemy-jump-post) ) (defstate babak-with-cannon-jump-off-cannon (babak-with-cannon) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak-with-cannon) nav-enemy-jump-event-handler ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 24) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (nav-enemy-initialize-jump (-> self entity extra trans)) (nav-enemy-neck-control-look-at) - (set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags))) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - (set! (-> a0-2 param 0) 0.0) - (set! (-> a0-2 param 1) 2.0) - (set! (-> a0-2 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!) - ) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) + (ja-no-eval :group! (-> self draw art-group data 17) :num! (seek! 0.0 2.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) 0.0) - (set! (-> a0-3 param 1) 2.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0 2.0)) ) (when (not (nav-enemy-facing-point? (-> self jump-dest) 5461.3335)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) (let ((a1-6 (dummy-16 (-> self nav) (-> self jump-dest)))) (set-current-poly! (-> self nav) a1-6) @@ -358,18 +283,15 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-jump-land) (none) ) - :post - (the-as (function none :behavior babak-with-cannon) nav-enemy-jump-post) + :post (the-as (function none :behavior babak-with-cannon) nav-enemy-jump-post) ) (defstate babak-with-cannon-shooting (babak-with-cannon) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak-with-cannon) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((v1-2 (entity-actor-lookup (-> self entity) 'alt-actor 0))) (if v1-2 @@ -378,8 +300,7 @@ nav-enemy-default-event-handler ) (none) ) - :exit - (behavior () + :exit (behavior () (let ((v1-0 (entity-actor-lookup (-> self entity) 'alt-actor 0))) (if v1-0 (logclear! (-> v1-0 extra perm status) (entity-perm-status complete)) @@ -387,8 +308,7 @@ nav-enemy-default-event-handler ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f0-1 (- (-> (target-pos 0) y) (-> self collide-info trans y)))) (if (and (< -40960.0 f0-1) (and (and *target* @@ -402,26 +322,22 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - babak-with-cannon-ride-cannon-post + :post babak-with-cannon-ride-cannon-post ) (defstate nav-enemy-die (babak-with-cannon) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak-with-cannon) nav-enemy-default-event-handler ) - :trans - (behavior () + :trans (behavior () (if (and *target* (= (-> *target* current-level name) 'beach)) (spool-push *art-control* "beachcam-cannon" 0 self -1.0) ) @@ -439,13 +355,11 @@ nav-enemy-default-event-handler (defstate nav-enemy-fuel-cell (babak-with-cannon) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak-with-cannon) process-drawable-fuel-cell-handler ) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self collide-info)) (ja-post) diff --git a/goal_src/levels/misty/balloonlurker.gc b/goal_src/levels/misty/balloonlurker.gc index 735702708d..8306726fb3 100644 --- a/goal_src/levels/misty/balloonlurker.gc +++ b/goal_src/levels/misty/balloonlurker.gc @@ -7,19 +7,19 @@ ;; DECOMP BEGINS +(import "goal_src/import/balloonlurker-ag.gc") + (defpartgroup group-balloonlurker-pilot-death :id 203 :duration 5 :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2015)) + :parts ((sp-item 2015)) ) (defpart 2015 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 16)) @@ -40,8 +40,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 964 :period 1200 :length 30) + :parts ((sp-item 964 :period 1200 :length 30) (sp-item 965 :fade-after (meters 60) :period 1200 :length 15) (sp-item 966 :period 1200 :length 15 :offset 15) (sp-item 967 :period 1200 :length 15) @@ -66,8 +65,7 @@ ) (defpart 964 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-y (meters 0.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -94,13 +92,11 @@ ) (defpart 969 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.32)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.32)) ) (defpart 965 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0.75)) (sp-rnd-flt spt-scale-x (meters 8) (meters 8) 1.0) @@ -124,13 +120,11 @@ ) (defpart 970 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) (defpart 966 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 24) (meters 16) 1.0) @@ -146,8 +140,7 @@ ) (defpart 967 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 24) (meters 16) 1.0) @@ -163,8 +156,7 @@ ) (defpart 968 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 5.0 10.0 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) @@ -191,8 +183,7 @@ ) (defpart 971 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0033333334)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0033333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r -4.266667) (sp-flt spt-fade-g 0.7111111) @@ -202,8 +193,7 @@ ) (defpart 963 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.25) (meters 0.5) 1.0) @@ -291,7 +281,7 @@ (explosion-joint-index-bytes int8 4 :offset 772) (vulnerable symbol :offset-assert 776) (water-y float :offset-assert 780) - (propeller joint-mod-set-local :offset-assert 784) + (propeller joint-mod-spinner :offset-assert 784) (rudder joint-mod-set-local :offset-assert 788) (mine joint-mod-set-world 2 :offset-assert 792) (buoyancy-factor float :offset-assert 800) @@ -339,21 +329,21 @@ ) -(defskelgroup *balloonlurker-sg* balloonlurker - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 12 0 17) - :longest-edge (meters 0) - ) +(defskelgroup *balloonlurker-sg* balloonlurker balloonlurker-lod0-jg balloonlurker-idle-ja + ((balloonlurker-lod0-mg (meters 20)) + (balloonlurker-lod1-mg (meters 40)) + (balloonlurker-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 12 0 17) + ) -(defskelgroup *balloonlurker-pilot-sg* balloonlurker - 6 - 10 - ((7 (meters 20)) (8 (meters 40)) (9 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *balloonlurker-pilot-sg* balloonlurker balloonlurker-pilot-lod0-jg balloonlurker-pilot-idle-ja + ((balloonlurker-pilot-lod0-mg (meters 20)) + (balloonlurker-pilot-lod1-mg (meters 40)) + (balloonlurker-pilot-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 4) + ) (defbehavior balloonlurker-get-path-point balloonlurker ((arg0 int)) (if (<= (-> self path curve num-cverts) 0) @@ -434,17 +424,11 @@ (the-as uint 1) ) (do-push-aways! (-> self root-overlay)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'shove) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((v1-9 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-9 shove-back) 8192.0) - (set! (-> v1-9 shove-up) 2048.0) - (set! (-> a1-3 param 1) (the-as uint v1-9)) - ) - (send-event-function arg0 a1-3) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-back (meters 2)) (shove-up (meters 0.5)))) ) ) (dotimes (s4-0 2) @@ -462,25 +446,15 @@ (let ((a0-10 (find-prim-by-id (-> self root-overlay) (the-as uint s3-0)))) (when a0-10 (set! (-> self explosion-force-position quad) (-> a0-10 prim-core world-sphere quad)) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'attack) - (set! (-> a1-6 param 0) (-> arg3 param 0)) - (let ((a0-13 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-13 mode) 'balloonlurker) - (set! (-> a1-6 param 1) (the-as uint a0-13)) - ) - (if (send-event-function arg0 a1-6) - (level-hint-spawn - (game-text-id misty-daxter-hit-lurkers-not-mines) - "sksp0063" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + (if (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'balloonlurker)))) + (level-hint-spawn + (game-text-id misty-daxter-hit-lurkers-not-mines) + "sksp0063" + (the-as entity #f) + *entity-pool* + (game-task none) ) - ) + ) (go balloonlurker-mine-explode s4-0) ) ) @@ -605,25 +579,15 @@ (f1-2 100.0) (f0-3 (* 3.0 f0-2)) ) - (sound-play-by-name - (static-sound-name "propeller") - (-> self engine-sound-id) - (the int (* 10.24 f1-2)) - (the int (* 1524.0 f0-3)) - 0 - 1 - (the-as symbol (-> self node-list data 4 bone transform vector 3)) + (sound-play + "propeller" + :id (-> self engine-sound-id) + :vol f1-2 + :pitch f0-3 + :position (the-as symbol (-> self node-list data 4 bone transform vector 3)) ) ) - (sound-play-by-name - (static-sound-name "pedals") - (-> self pedal-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-overlay trans)) - ) + (sound-play "pedals" :id (-> self pedal-sound-id) :position (the-as symbol (-> self root-overlay trans))) ) ) (else @@ -658,12 +622,11 @@ (let ((f0-4 (- (vector-dot s4-0 (-> self dest-point)) (vector-dot s4-0 gp-0))) (f2-2 (- (vector-dot (the-as vector s5-0) (-> self dest-point)) (vector-dot (the-as vector s5-0) gp-0))) ) - (set! (-> self rudder-control) (seek - (-> self rudder-control) - (fmax -1.0 (fmin 1.0 (/ f2-2 (fmax 4096.0 f0-4)))) - (* 4.0 (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self rudder-control) + (fmax -1.0 (fmin 1.0 (/ f2-2 (fmax 4096.0 f0-4)))) + (* 4.0 (-> *display* seconds-per-frame)) + ) ) (let ((f0-12 0.0) (f1-7 1.0) @@ -677,28 +640,25 @@ ) (else (let ((f0-14 (analog-input (the-as int (-> *cpad-list* cpads 1 leftx)) 128.0 48.0 110.0 -1.0))) - (set! (-> self rudder-control) (seek (-> self rudder-control) f0-14 (* 2.0 (-> *display* seconds-per-frame)))) + (seek! (-> self rudder-control) f0-14 (* 2.0 (-> *display* seconds-per-frame))) ) (if (cpad-hold? 1 x) - (set! (-> self throttle-control) (seek (-> self throttle-control) 1.0 (-> *display* seconds-per-frame))) - (set! (-> self throttle-control) - (seek (-> self throttle-control) 0.0 (* 0.25 (-> *display* seconds-per-frame))) - ) + (seek! (-> self throttle-control) 1.0 (-> *display* seconds-per-frame)) + (seek! (-> self throttle-control) 0.0 (* 0.25 (-> *display* seconds-per-frame))) ) ) ) - (set! (-> self engine-thrust) (seek - (-> self engine-thrust) - (* (-> self throttle-control) (-> *BALLOONLURKER-bank* max-engine-thrust)) - (* 0.005 (-> *BALLOONLURKER-bank* max-engine-thrust)) - ) - ) + (seek! + (-> self engine-thrust) + (* (-> self throttle-control) (-> *BALLOONLURKER-bank* max-engine-thrust)) + (* 0.005 (-> *BALLOONLURKER-bank* max-engine-thrust)) + ) (let ((f0-31 60.0) (f1-14 1820.4445) (f2-6 6735.6445) (f3-6 (-> *BALLOONLURKER-bank* max-engine-thrust)) ) - (set! (-> self propeller transform quat y) (* f0-31 (+ f1-14 (* f2-6 (/ 1.0 f3-6) (-> self engine-thrust))))) + (set! (-> self propeller spin-rate) (* f0-31 (+ f1-14 (* f2-6 (/ 1.0 f3-6) (-> self engine-thrust))))) ) (let ((f0-34 (* (-> *BALLOONLURKER-bank* max-rudder-deflection-angle) (-> self rudder-control))) (gp-1 (new 'stack-no-clear 'quaternion)) @@ -729,79 +689,50 @@ ) (defstate balloonlurker-patrol (balloonlurker) - :event - balloonlurker-event-handler - :trans - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + :event balloonlurker-event-handler + :trans (behavior () + (ja :num! (loop!)) (set! (-> self anim-frame) (ja-frame-num 0)) (none) ) - :code - (behavior () - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 4) - ) - ) - (ja-channel-push! 1 21) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 num-func) num-func-identity) - (set! (-> v1-11 frame-num) 0.0) - ) + :code (behavior () + (when (not (ja-group? balloonlurker-idle-ja)) + (ja-channel-push! 1 (seconds 0.07)) + (ja :group! balloonlurker-idle-ja) + (ja :num-func num-func-identity :frame-num 0.0) ) (ja-post) (anim-loop) (none) ) - :post - balloonlurker-post + :post balloonlurker-post ) (defstate balloonlurker-mine-explode (balloonlurker) - :event - balloonlurker-event-handler - :code - (behavior ((arg0 int)) + :event balloonlurker-event-handler + :code (behavior ((arg0 int)) (set! (-> self explosion-force-position quad) (-> self node-list data (-> self explosion-joint-index-bytes arg0) bone transform vector 3 quad) ) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker s5-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - part-tracker-init - (-> *part-group-id-table* 204) - -1 - #f - #f - #f - (-> self explosion-force-position) - ) - (-> s5-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 204) + -1 + #f + #f + #f + (-> self explosion-force-position) + :to *entity-pool* ) - (sound-play-by-name (static-sound-name "explosion") (new-sound-id) 1024 0 0 1 #t) + (sound-play "explosion") (set! (-> self explosion) #t) (vector-! (-> self explosion-force) (-> self rbody position) (-> self explosion-force-position)) (set! (-> self explosion-force y) (* 2.0 (-> self explosion-force y))) (vector-length (-> self explosion-force)) (vector-normalize! (-> self explosion-force) (-> *BALLOONLURKER-bank* explosion-force)) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (let ((v1-16 (-> self mine arg0))) (set! (-> v1-16 enable) #t) (set-vector! (-> v1-16 transform scale) 0.0 0.0 0.0 1.0) @@ -812,22 +743,18 @@ ) (none) ) - :post - balloonlurker-post + :post balloonlurker-post ) (defstate balloonlurker-die (balloonlurker) - :event - (the-as (function process int symbol event-message-block object :behavior balloonlurker) #f) - :enter - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior balloonlurker) #f) + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self vulnerable) #f) (set! (-> self dead) #t) (none) ) - :code - (behavior () + :code (behavior () (local-vars (v1-27 symbol) (sv-16 symbol) (sv-20 (pointer process-tree)) (sv-24 entity-actor)) (process-entity-status! self (entity-perm-status bit-4) #t) (process-entity-status! self (entity-perm-status dead) #t) @@ -868,10 +795,7 @@ (set! (-> self buoyancy-factor) (* 4.0 (-> self buoyancy-factor))) (until v1-27 (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (set! v1-27 (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 30)) (< 819200.0 (- (-> self root-overlay trans y) (-> self water-y))) ) @@ -883,8 +807,7 @@ ) (none) ) - :post - balloonlurker-post + :post balloonlurker-post ) (defmethod relocate balloonlurker ((obj balloonlurker) (arg0 int)) @@ -907,8 +830,7 @@ ) (defstate balloonlurker-pilot-idle (balloonlurker-pilot) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (send-event (ppointer->process (-> self parent-override)) 'die) @@ -916,27 +838,17 @@ ) ) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) - (while #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! balloonlurker-pilot-idle-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (loop (suspend) - (let ((v1-9 (-> self skel root-channel 0))) - (set! (-> v1-9 num-func) num-func-identity) - (set! (-> v1-9 frame-num) (-> self parent-override 0 anim-frame)) - ) + (ja :num-func num-func-identity :frame-num (-> self parent-override 0 anim-frame)) ) (none) ) - :post - (behavior () + :post (behavior () (set! (-> self root-override trans quad) (-> self parent-override 0 root-overlay trans quad)) (quaternion-copy! (-> self root-override quat) (-> self parent-override 0 root-overlay quat)) (update-transforms! (-> self root-override)) @@ -946,30 +858,21 @@ ) (defstate balloonlurker-pilot-die (balloonlurker-pilot) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior balloonlurker-pilot) process-drawable-death-event-handler ) - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 203) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 203) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (TODO-RENAME-17 (-> self parent-override 0 rbody) @@ -977,29 +880,16 @@ (-> self root-override transv) ) (clear-collide-with-as (-> self root-override)) - (ja-channel-push! 1 30) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! balloonlurker-pilot-death-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (cleanup-for-death self) (none) ) - :post - (behavior () + :post (behavior () (vector-v++! (-> self root-override transv) (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0) @@ -1159,17 +1049,12 @@ (set! (-> obj vulnerable) #t) (set! (-> obj dead) #f) (set! (-> obj explosion) #f) - (set! (-> obj propeller) - (the-as - joint-mod-set-local - (new 'process 'joint-mod-spinner obj 4 (new 'static 'vector :z -1.0 :w 1.0) 8192.0) - ) - ) + (set! (-> obj propeller) (new 'process 'joint-mod-spinner obj 4 (new 'static 'vector :z -1.0 :w 1.0) 8192.0)) (set! (-> obj rudder) (new 'process 'joint-mod-set-local obj 12 #f #t #f)) (set! (-> obj mine 0) (new 'process 'joint-mod-set-world obj 8 #f)) (set! (-> obj mine 1) (new 'process 'joint-mod-set-world obj 5 #f)) - (set! (-> obj stack 660) (the-as uint 10)) - (set! (-> obj stack 661) (the-as uint 7)) + (set! (-> obj explosion-joint-index-bytes 0) 10) + (set! (-> obj explosion-joint-index-bytes 1) 7) (set! (-> obj engine-sound-id) (new 'static 'sound-id)) (set! (-> obj pedal-sound-id) (new 'static 'sound-id)) (set! (-> obj player-force quad) (-> *null-vector* quad)) @@ -1192,15 +1077,7 @@ (return #f) ) (else - (let ((s5-1 (get-process *default-dead-pool* balloonlurker-pilot #x4000))) - (when s5-1 - (let ((t9-6 (method-of-type balloonlurker-pilot activate))) - (t9-6 (the-as balloonlurker-pilot s5-1) obj 'balloonlurker-pilot (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 balloonlurker-pilot-init-by-other obj) - (-> s5-1 ppointer) - ) - ) + (process-spawn balloonlurker-pilot obj :to obj) (go balloonlurker-patrol) ) ) diff --git a/goal_src/levels/misty/bonelurker.gc b/goal_src/levels/misty/bonelurker.gc index a25911bd75..f2fd938364 100644 --- a/goal_src/levels/misty/bonelurker.gc +++ b/goal_src/levels/misty/bonelurker.gc @@ -9,6 +9,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/bonelurker-ag.gc") + (deftype bonelurker (nav-enemy) ((bump-player-time time-frame :offset-assert 400) ) @@ -22,14 +24,11 @@ ) -(defskelgroup *bonelurker-sg* bonelurker - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 2 0 6) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *bonelurker-sg* bonelurker bonelurker-lod0-jg bonelurker-idle-ja + ((bonelurker-lod0-mg (meters 20)) (bonelurker-lod1-mg (meters 40)) (bonelurker-lod2-mg (meters 999999))) + :bounds (static-spherem 0 2 0 6) + :shadow bonelurker-shadow-mg + ) (defbehavior bonelurker-set-small-bounds-sphere bonelurker () (set! (-> self draw bounds w) 12288.0) @@ -44,20 +43,19 @@ ) (defmethod dummy-44 bonelurker ((obj bonelurker) (arg0 process) (arg1 event-message-block)) - (the-as - object - (when (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) - ) - (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (set! (-> obj speed-scale) 0.5) - #t - ) - ) - ) + (the-as object (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) + ) + (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) + (set! (-> obj speed-scale) 0.5) + #t + ) + ) + ) ) (defmethod dummy-43 bonelurker ((obj bonelurker) (arg0 process) (arg1 event-message-block)) @@ -84,17 +82,7 @@ (-> obj collide-info) (the-as uint 2) ) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'shove) - (set! (-> a1-3 param 0) (-> arg1 param 0)) - (let ((v1-19 (new 'static 'attack-info :mask #x40))) - (set! (-> v1-19 shove-back) 16384.0) - (set! (-> a1-3 param 1) (the-as uint v1-19)) - ) - (send-event-function arg0 a1-3) - ) + (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) (go bonelurker-stun) #t ) @@ -112,19 +100,9 @@ (or (= v1-30 (-> obj draw art-group data 9)) (= v1-30 (-> obj draw art-group data 10))) ) ) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) pp) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'shove) - (set! (-> a1-6 param 0) (-> arg1 param 0)) - (let ((v1-36 (new 'static 'attack-info :mask #x40))) - (set! (-> v1-36 shove-back) 16384.0) - (set! (-> a1-6 param 1) (the-as uint v1-36)) - ) - (send-event-function arg0 a1-6) - ) + (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) (set! (-> obj bump-player-time) (-> *display* base-frame-counter)) - (set! (-> obj nav-enemy-flags) (logand -65 (-> obj nav-enemy-flags))) + (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) 'push ) ) @@ -153,11 +131,11 @@ nav-enemy-default-event-handler (defbehavior bonelurker-push-post bonelurker () - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (dummy-11 (-> self nav) (-> self nav target-pos)) - (TODO-RENAME-11 + (align-vel-and-quat-only! (-> self align) - 4 + (align-opts adjust-xz-vel) (-> self nav travel) (the-as int 1.0) 1.0 @@ -167,7 +145,7 @@ nav-enemy-default-event-handler (-> self collide-info transv) (compute-acc-due-to-gravity (-> self collide-info) (new-stack-vector0) 0.0) ) - (TODO-RENAME-10 (-> self align) 16 1.0 1.0 1.0) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) @@ -183,18 +161,15 @@ nav-enemy-default-event-handler (defstate nav-enemy-idle (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :exit - (behavior () + :exit (behavior () (bonelurker-set-large-bounds-sphere) (none) ) - :code - (behavior () + :code (behavior () (bonelurker-set-small-bounds-sphere) ((the-as (function none :behavior bonelurker) (-> (method-of-type nav-enemy nav-enemy-idle) code))) (none) @@ -203,14 +178,12 @@ nav-enemy-default-event-handler (defstate nav-enemy-patrol (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 60) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) ((the-as (function none :behavior bonelurker) (-> (method-of-type nav-enemy nav-enemy-patrol) code))) (none) ) @@ -218,171 +191,86 @@ nav-enemy-default-event-handler (defstate nav-enemy-notice (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :code - (-> (method-of-type nav-enemy nav-enemy-notice) code) + :code (-> (method-of-type nav-enemy nav-enemy-notice) code) ) (defstate nav-enemy-chase (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :trans - (behavior () + :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) - (if (and (zero? (logand (-> self nav-enemy-flags) 64)) + (if (and (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf6))) (>= (- (-> *display* base-frame-counter) (-> self bump-player-time)) (seconds 0.5)) ) - (logior! (-> self nav-enemy-flags) 64) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 524288.0) (set! (-> self turn-time) (seconds 0.1)) (set! (-> self speed-scale) 1.0) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 13) - ) - (ja-channel-push! 1 90) + ((ja-group? bonelurker-win-ja) + (ja-channel-push! 1 (seconds 0.3)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 15) - ) - (ja-channel-push! 1 60) + ((ja-group? bonelurker-stun-ja) + (ja-channel-push! 1 (seconds 0.2)) ) (else - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) ) ) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) f30-0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! bonelurker-charge-left-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) f30-0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) f30-0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) + (ja :num! (seek! max f30-0)) ) + (ja-no-eval :group! bonelurker-charge-right-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) f30-0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) - (while #t + (loop (cond ((or (not *target*) (< 36864.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) f30-0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! bonelurker-charge-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) f30-0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (else - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-22 param 1) f30-0) - (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! bonelurker-charge-left-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) f30-0) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory) ) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-25 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-25 param 1) f30-0) - (set! (-> a0-25 frame-num) 0.0) - (joint-control-channel-group! a0-25 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! bonelurker-charge-right-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 param 0) (the float (+ (-> a0-26 frame-group data 0 length) -1))) - (set! (-> a0-26 param 1) f30-0) - (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory) ) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-28 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-28 param 1) f30-0) - (set! (-> a0-28 frame-num) 0.0) - (joint-control-channel-group! a0-28 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! bonelurker-charge-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1))) - (set! (-> a0-29 param 1) f30-0) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -394,104 +282,57 @@ nav-enemy-default-event-handler (defstate nav-enemy-stop-chase (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :code - (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) + :code (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) ) (defstate nav-enemy-stare (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 524288.0) (set! (-> self turn-time) (seconds 0.2)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) (when (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> gp-0 param 0) (ja-aframe 48.0 0)) - (set! (-> gp-0 param 1) f30-0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! bonelurker-win-ja :num! (seek! (ja-aframe 48.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 48.0 0)) - (set! (-> gp-1 param 1) f30-0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 48.0 0) f30-0)) ) ) - (while #t + (loop (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) - (ja-channel-push! 1 60) - (let ((v1-20 (-> self skel root-channel 0))) - (set! (-> v1-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - ) - (let ((v1-23 (-> self skel root-channel 0))) - (set! (-> v1-23 num-func) num-func-identity) - (set! (-> v1-23 frame-num) 0.0) - ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! bonelurker-turn-ja) + (ja :num-func num-func-identity :frame-num 0.0) (until (nav-enemy-facing-player? 1820.4445) (ja-blend-eval) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) - ) - (ja-channel-push! 1 75) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) f30-0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! bonelurker-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) f30-0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) 1.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim #f) num-func-loop!) + (ja :num! (seek! max f30-0)) ) + (ja-no-eval :num! (loop!)) (when (rand-vu-percent? 0.15) - (ja-channel-push! 1 30) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> gp-2 param 0) (ja-aframe 48.0 0)) - (set! (-> gp-2 param 1) f30-0) - (set! (-> gp-2 frame-num) 0.0) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! bonelurker-win-ja :num! (seek! (ja-aframe 48.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 48.0 0)) - (set! (-> gp-3 param 1) f30-0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 48.0 0) f30-0)) ) ) ) @@ -502,16 +343,14 @@ nav-enemy-default-event-handler (defstate nav-enemy-give-up (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 524288.0) (set! (-> self turn-time) (seconds 0.1)) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) (let ((s4-0 (-> self collide-info)) (s5-0 (target-pos 0)) ) @@ -520,70 +359,26 @@ nav-enemy-default-event-handler ) 12743.111 ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! bonelurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! bonelurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! bonelurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! bonelurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek-to-point-toward-point! (-> self collide-info) @@ -592,11 +387,7 @@ nav-enemy-default-event-handler (-> self turn-time) ) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) (none) @@ -605,58 +396,39 @@ nav-enemy-default-event-handler (defstate nav-enemy-victory (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :code - (-> (method-of-type nav-enemy nav-enemy-victory) code) + :code (-> (method-of-type nav-enemy nav-enemy-victory) code) ) (defstate bonelurker-stun (bonelurker) - :event - bonelurker-stunned-event-handler - :enter - (behavior () + :event bonelurker-stunned-event-handler + :enter (behavior () (nav-enemy-neck-control-inactive) (none) ) - :exit - (behavior () + :exit (behavior () (nav-enemy-neck-control-look-at) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-normalize-copy! gp-0 (-> self hit-from-dir) 16384.0) (vector+! gp-0 (-> self collide-info trans) gp-0) (set! (-> self nav target-pos quad) (-> gp-0 quad)) ) - (ja-channel-push! 1 30) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 15)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! bonelurker-stun-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-chase) (none) ) - :post - bonelurker-push-post + :post bonelurker-push-post ) (define *bonelurker-nav-enemy-info* (new 'static 'nav-enemy-info @@ -707,7 +479,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #t :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/goal_src/levels/misty/misty-conveyor.gc b/goal_src/levels/misty/misty-conveyor.gc index 9aaa59e0b2..677f269b2e 100644 --- a/goal_src/levels/misty/misty-conveyor.gc +++ b/goal_src/levels/misty/misty-conveyor.gc @@ -12,19 +12,21 @@ ;; DECOMP BEGINS +(import "goal_src/import/keg-conveyor-ag.gc") +(import "goal_src/import/keg-conveyor-paddle-ag.gc") +(import "goal_src/import/keg-ag.gc") + (defpartgroup group-keg-bounce :id 197 :duration 10 :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2014 :fade-after (meters 100) :falloff-to (meters 100))) + :parts ((sp-item 2014 :fade-after (meters 100) :falloff-to (meters 100))) ) (defpart 2014 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-x (meters -3) (meters 6) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -108,30 +110,21 @@ ) -(defskelgroup *keg-conveyor-sg* keg-conveyor - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -6 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *keg-conveyor-sg* keg-conveyor keg-conveyor-lod0-jg keg-conveyor-idle-ja + ((keg-conveyor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -6 0 8) + ) -(defskelgroup *keg-conveyor-paddle-sg* keg-conveyor-paddle - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -6 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *keg-conveyor-paddle-sg* keg-conveyor-paddle keg-conveyor-paddle-lod0-jg keg-conveyor-paddle-idle-ja + ((keg-conveyor-paddle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -6 0 8) + ) -(defskelgroup *keg-sg* keg - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *keg-sg* keg keg-lod0-jg keg-idle-ja + ((keg-lod0-mg (meters 20)) (keg-lod1-mg (meters 40)) (keg-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow keg-shadow-mg + ) (defun keg-update-smush ((arg0 keg) (arg1 float)) (set! (-> arg0 root-override scale x) (+ 1.0 (* -1.0 arg1))) @@ -143,41 +136,25 @@ (defbehavior keg-event-handler keg ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) - (the-as - object - (when (or (= v1-0 'touch) (= v1-0 'attack)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (set! (-> a1-3 param 1) (the-as uint (new 'static 'attack-info))) - (when (send-event-function arg0 a1-3) - (sound-play-by-name (static-sound-name "icrate-break") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 71) - 20 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) - ) - (sound-stop (-> self sound-id)) - (deactivate self) + (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) + (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + (sound-play "icrate-break") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 71) + 20 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* + ) + (sound-stop (-> self sound-id)) + (deactivate self) + ) + ) ) - ) - ) - ) ) ) @@ -187,15 +164,7 @@ ) (else (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 163840.0) - (sound-play-by-name - (static-sound-name "barrel-roll") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "barrel-roll" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) ) ) @@ -203,22 +172,17 @@ ) (defstate keg-on-paddle (keg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('detach) (go keg-paddle-to-path) ) ) ) - :code - (behavior () + :code (behavior () (set! (-> (the-as keg (-> self parent 0)) sync-offset) (the-as float (process->ppointer self))) - (let ((v1-3 (-> self skel root-channel 0))) - (set! (-> v1-3 num-func) num-func-identity) - (set! (-> v1-3 frame-num) 0.0) - ) - (while #t + (ja :num-func num-func-identity :frame-num 0.0) + (loop (let ((gp-0 (-> (the-as process-drawable (-> self parent 0)) node-list data 4))) (matrix->quaternion (-> self root-override quat) (-> gp-0 bone transform)) (vector<-cspace! (-> self root-override trans) gp-0) @@ -229,15 +193,12 @@ ) (none) ) - :post - (the-as (function none :behavior keg) keg-post) + :post (the-as (function none :behavior keg) keg-post) ) (defstate keg-paddle-to-path (keg) - :event - keg-event-handler - :code - (behavior () + :event keg-event-handler + :code (behavior () (let ((gp-0 (new-stack-vector0))) (set! (-> gp-0 quad) (-> self root-override trans quad)) (let ((s5-0 @@ -251,7 +212,7 @@ 0.0 0.0 (forward-up-nopitch->quaternion s3-0 a1-3 (new 'static 'vector :y 1.0 :w 1.0)) - (while #t + (loop (if (>= (the float (- (-> *display* base-frame-counter) (-> self state-time))) f30-0) (go keg-on-path) ) @@ -260,25 +221,19 @@ (set! (-> self path-position quad) (-> self root-override trans quad)) (quaternion-slerp! (-> self root-override quat) s4-0 s3-0 f28-0) ) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) ) ) (none) ) - :post - (the-as (function none :behavior keg) keg-post) + :post (the-as (function none :behavior keg) keg-post) ) (defstate keg-on-path (keg) - :event - keg-event-handler - :code - (behavior () + :event keg-event-handler + :code (behavior () (local-vars (sv-48 float) (sv-64 float) (sv-80 float) (sv-96 float) (sv-112 float)) (let ((gp-0 (new-stack-vector0)) (s5-0 (new 'stack 'vector3s)) @@ -298,7 +253,7 @@ (set! sv-48 0.0) (set! sv-64 0.0) (set! sv-80 (- (-> *standard-dynamics* gravity-length))) - (while #t + (loop (let ((f0-13 (+ (get-current-phase (-> (the-as keg-conveyor-paddle (-> self parent 0)) sync)) f26-1))) (set! sv-96 (- f0-13 (the float (the int f0-13)))) ) @@ -320,7 +275,7 @@ (cond ((>= (vector4-dot (camera-pos) (-> self shadow-enable-plane)) 0.0) (let ((v1-32 (-> self draw shadow-ctrl))) - (set! (-> v1-32 settings flags) (logand -33 (-> v1-32 settings flags))) + (logclear! (-> v1-32 settings flags) (shadow-flags disable-draw)) ) 0 (let ((v1-35 (-> self draw shadow-ctrl))) @@ -334,7 +289,7 @@ ) (else (let ((v1-41 (-> self draw shadow-ctrl))) - (logior! (-> v1-41 settings flags) 32) + (logior! (-> v1-41 settings flags) (shadow-flags disable-draw)) ) 0 (let ((v1-44 (-> self draw shadow-ctrl))) @@ -358,24 +313,17 @@ (set! sv-48 0.0) (activate! (-> self smush) -0.15 90 150 1.0 1.0) (set! sv-64 f24-0) - (sound-play-by-name (static-sound-name "barrel-bounce") (new-sound-id) 819 0 0 1 #t) - (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-1 - (let ((t9-12 (method-of-type part-tracker activate))) - (t9-12 (the-as part-tracker s4-1) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-1 - part-tracker-init - (-> *part-group-id-table* 197) - -1 - keg-bounce-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root-override trans) - ) - (-> s4-1 ppointer) - ) + (sound-play "barrel-bounce" :vol 80) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 197) + -1 + keg-bounce-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root-override trans) + :to self ) ) (let ((f0-39 (update! (-> self smush)))) @@ -386,10 +334,7 @@ (set! (-> s5-0 y) 1.0) (set! (-> s5-0 z) 0.0) ) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) ) @@ -399,15 +344,12 @@ ) (none) ) - :post - (the-as (function none :behavior keg) keg-post) + :post (the-as (function none :behavior keg) keg-post) ) (defstate keg-in-chute (keg) - :event - keg-event-handler - :code - (behavior () + :event keg-event-handler + :code (behavior () (let ((gp-0 (TODO-RENAME-12 (-> (the-as process-drawable (-> self parent 0)) path) (new-stack-vector0) @@ -420,13 +362,13 @@ (f26-0 (- (-> *standard-dynamics* gravity-length))) ) (let ((v1-10 (-> self draw shadow-ctrl))) - (logior! (-> v1-10 settings flags) 32) + (logior! (-> v1-10 settings flags) (shadow-flags disable-draw)) ) 0 (clear-collide-with-as (-> self root-override)) (vector-normalize! gp-0 1.0) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (go keg-die) ) @@ -436,30 +378,23 @@ (+! f28-0 (* f26-0 (-> *display* seconds-per-frame))) (vector+! v1-23 v1-23 s5-0) ) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) ) (none) ) - :post - (the-as (function none :behavior keg) keg-post) + :post (the-as (function none :behavior keg) keg-post) ) (defstate keg-die (keg) - :event - (the-as (function process int symbol event-message-block object :behavior keg) #f) - :code - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior keg) #f) + :code (behavior () (sound-stop (-> self sound-id)) (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior keg) transform-post) + :post (the-as (function none :behavior keg) transform-post) ) (defbehavior keg-init-by-other keg ((arg0 keg) (arg1 int)) @@ -486,7 +421,7 @@ (initialize-skeleton self *keg-sg* '()) (set! (-> self draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) (let ((v1-25 (-> self draw shadow-ctrl))) - (logior! (-> v1-25 settings flags) 32) + (logior! (-> v1-25 settings flags) (shadow-flags disable-draw)) ) 0 (let ((s5-1 (new 'static 'vector :x -514715.0 :y 226968.0 :z 3906894.8 :w 1.0))) @@ -515,59 +450,36 @@ ) (defun keg-conveyor-spawn-keg ((arg0 keg-conveyor)) - (let ((s5-0 (get-process *default-dead-pool* keg #x4000))) - (when s5-0 - (let ((t9-1 (method-of-type keg activate))) - (t9-1 (the-as keg s5-0) arg0 'keg (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 keg-init-by-other arg0 0) - (-> s5-0 ppointer) - ) - ) + (process-spawn keg arg0 0 :to arg0) ) (defun keg-conveyor-spawn-bouncing-keg ((arg0 keg-conveyor)) - (let ((s5-0 (get-process *default-dead-pool* keg #x4000))) - (when s5-0 - (let ((t9-1 (method-of-type keg activate))) - (t9-1 (the-as keg s5-0) arg0 'keg (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 keg-init-by-other arg0 1) - (-> s5-0 ppointer) - ) - ) + (process-spawn keg arg0 1 :to arg0) ) -(define - *keg-conveyor-keg-spawn-table* - (the-as (array int8) (new 'static 'boxed-array :type int8 :length 6 :allocated-length 6 1 2 1 1 2 1)) +(define *keg-conveyor-keg-spawn-table* + (the-as (array int8) (new 'static 'boxed-array :type int8 1 2 1 1 2 1)) ) (defstate keg-conveyor-idle (keg-conveyor) - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) 0.0) - ) + :code (behavior () + (ja :num-func num-func-identity :frame-num 0.0) 0.0 - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior keg-conveyor) ja-post) + :post (the-as (function none :behavior keg-conveyor) ja-post) ) (defstate keg-conveyor-paddle-idle (keg-conveyor-paddle) - :code - (behavior () + :code (behavior () (let ((f30-0 57.0) (gp-0 0) (s5-0 (length *keg-conveyor-keg-spawn-table*)) ) - (while #t + (loop (let ((s4-0 #f)) (when (or (not *target*) (< 102400.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) @@ -593,32 +505,7 @@ (if (>= gp-0 s5-0) (set! gp-0 0) ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (not s4-0) (>= (ja-aframe-num 0) f30-0)) (set! s4-0 #t) @@ -642,19 +529,14 @@ ) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) ) (none) ) - :post - (the-as (function none :behavior keg-conveyor-paddle) transform-post) + :post (the-as (function none :behavior keg-conveyor-paddle) transform-post) ) (defbehavior keg-conveyor-paddle-init-by-other keg-conveyor-paddle ((arg0 keg-conveyor-paddle)) @@ -724,15 +606,7 @@ ) (vector+! (-> obj root trans) (-> obj root trans) s5-1) ) - (let ((s5-2 (get-process *default-dead-pool* keg-conveyor-paddle #x4000))) - (when s5-2 - (let ((t9-11 (method-of-type keg-conveyor-paddle activate))) - (t9-11 (the-as keg-conveyor-paddle s5-2) obj 'keg-conveyor-paddle (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 keg-conveyor-paddle-init-by-other obj) - (-> s5-2 ppointer) - ) - ) + (process-spawn keg-conveyor-paddle obj :to obj) (go keg-conveyor-idle) (none) ) diff --git a/goal_src/levels/misty/misty-obs.gc b/goal_src/levels/misty/misty-obs.gc index 6a98c2733d..2657d82112 100644 --- a/goal_src/levels/misty/misty-obs.gc +++ b/goal_src/levels/misty/misty-obs.gc @@ -7,11 +7,19 @@ ;; DECOMP BEGINS +(import "goal_src/import/breakaway-right-ag.gc") +(import "goal_src/import/boatpaddle-ag.gc") +(import "goal_src/import/breakaway-mid-ag.gc") +(import "goal_src/import/mis-bone-platform-ag.gc") +(import "goal_src/import/breakaway-left-ag.gc") +(import "goal_src/import/windturbine-ag.gc") +(import "goal_src/import/mistycam-ag.gc") +(import "goal_src/import/mis-bone-bridge-ag.gc") + (defpartgroup group-windturbine-particles :id 191 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 908 :fade-after (meters 60) :period 1212 :length 10) + :parts ((sp-item 908 :fade-after (meters 60) :period 1212 :length 10) (sp-item 908 :fade-after (meters 60) :period 5790 :length 10) (sp-item 908 :fade-after (meters 60) :period 4988 :length 10) (sp-item 908 :fade-after (meters 60) :period 3510 :length 10) @@ -31,8 +39,7 @@ ) (defpart 910 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.066 0.066 1.0) (sp-flt spt-x (meters -4)) (sp-rnd-flt spt-y (meters -2) (meters 0.5) 1.0) @@ -56,13 +63,11 @@ ) (defpart 912 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 240) (sp-launcher-by-id spt-next-launcher 913)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 240) (sp-launcher-by-id spt-next-launcher 913)) ) (defpart 913 - :init-specs - ((sp-flt spt-vel-x (meters -0.06666667)) + :init-specs ((sp-flt spt-vel-x (meters -0.06666667)) (sp-flt spt-vel-y (meters 0.0033333334)) (sp-flt spt-scalevel-x (meters 0.016666668)) (sp-copy-from-other spt-scalevel-y -4) @@ -72,8 +77,7 @@ ) (defpart 911 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.066 0.066 1.0) (sp-flt spt-x (meters -4)) (sp-rnd-flt spt-y (meters -2) (meters 0.5) 1.0) @@ -97,8 +101,7 @@ ) (defpart 908 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 8.0 24.0 1.0) (sp-flt spt-x (meters -4)) (sp-rnd-flt spt-y (meters -4.5) (meters 1) 1.0) @@ -125,8 +128,7 @@ ) (defpart 909 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 8.0 24.0 1.0) (sp-flt spt-x (meters -4)) (sp-rnd-flt spt-y (meters -4.5) (meters 1) 1.0) @@ -157,8 +159,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 24) - :parts - ((sp-item 914 :period 780 :length 15) + :parts ((sp-item 914 :period 780 :length 15) (sp-item 915 :period 780 :length 15) (sp-item 916 :period 780 :length 64) (sp-item 917 :period 780 :length 32 :offset 65131) @@ -170,8 +171,7 @@ ) (defpart 921 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -199,8 +199,7 @@ ) (defpart 920 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-x (meters 2.5)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) @@ -227,8 +226,7 @@ ) (defpart 919 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -256,8 +254,7 @@ ) (defpart 918 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -286,13 +283,11 @@ ) (defpart 922 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) (defpart 917 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters -1) (meters 1.5) 1.0) (sp-rnd-flt spt-z (meters -5) (meters 10) 1.0) @@ -316,8 +311,7 @@ ) (defpart 914 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) @@ -343,8 +337,7 @@ ) (defpart 915 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.2) 1.0) @@ -370,13 +363,11 @@ ) (defpart 923 - :init-specs - ((sp-flt spt-fade-a -3.2)) + :init-specs ((sp-flt spt-fade-a -3.2)) ) (defpart 916 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -3.5) (meters 4.5) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 12) 1.0) @@ -403,8 +394,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 24) - :parts - ((sp-item 914 :period 780 :length 15) + :parts ((sp-item 914 :period 780 :length 15) (sp-item 915 :period 780 :length 15) (sp-item 924 :period 780 :length 64) (sp-item 925 :period 780 :length 32 :offset 65131) @@ -416,8 +406,7 @@ ) (defpart 929 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -445,8 +434,7 @@ ) (defpart 928 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-x (meters 2.5)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) @@ -473,8 +461,7 @@ ) (defpart 927 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -502,8 +489,7 @@ ) (defpart 926 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -532,8 +518,7 @@ ) (defpart 925 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters -1) (meters 1.5) 1.0) (sp-rnd-flt spt-z (meters -5) (meters 10) 1.0) @@ -557,8 +542,7 @@ ) (defpart 924 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -3.5) (meters 4.5) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 12) 1.0) @@ -585,8 +569,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 24) - :parts - ((sp-item 914 :period 780 :length 15) + :parts ((sp-item 914 :period 780 :length 15) (sp-item 915 :period 780 :length 15) (sp-item 930 :period 780 :length 64) (sp-item 931 :period 780 :length 32 :offset 65131) @@ -598,8 +581,7 @@ ) (defpart 935 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -627,8 +609,7 @@ ) (defpart 934 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-x (meters 2.5)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) @@ -655,8 +636,7 @@ ) (defpart 933 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -684,8 +664,7 @@ ) (defpart 932 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -714,8 +693,7 @@ ) (defpart 931 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters -1) (meters 1.5) 1.0) (sp-rnd-flt spt-z (meters -5) (meters 10) 1.0) @@ -739,8 +717,7 @@ ) (defpart 930 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -3.5) (meters 4.5) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 12) 1.0) @@ -767,8 +744,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 24) - :parts - ((sp-item 914 :period 780 :length 15) + :parts ((sp-item 914 :period 780 :length 15) (sp-item 915 :period 780 :length 15) (sp-item 936 :period 780 :length 64) (sp-item 937 :period 780 :length 32 :offset 65131) @@ -780,8 +756,7 @@ ) (defpart 941 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -809,8 +784,7 @@ ) (defpart 940 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-x (meters 2.5)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) @@ -837,8 +811,7 @@ ) (defpart 939 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -866,8 +839,7 @@ ) (defpart 938 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -896,8 +868,7 @@ ) (defpart 937 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters -1) (meters 1.5) 1.0) (sp-rnd-flt spt-z (meters -5) (meters 10) 1.0) @@ -921,8 +892,7 @@ ) (defpart 936 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -3.5) (meters 4.5) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 12) 1.0) @@ -947,13 +917,11 @@ (defpartgroup group-misty-boat-paddle :id 196 :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 944 :fade-after (meters 100))) + :parts ((sp-item 944 :fade-after (meters 100))) ) (defpart 944 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-x (meters -11) (meters 22) 1.0) (sp-flt spt-y (meters 0)) @@ -977,13 +945,11 @@ ) (defpart 945 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) (defpart 943 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-x (meters -9) (meters 18) 1.0) (sp-flt spt-scale-x (meters 0.5)) @@ -1008,13 +974,11 @@ ) (defpart 946 - :init-specs - ((sp-flt spt-fade-a -2.0)) + :init-specs ((sp-flt spt-fade-a -2.0)) ) (defpart 942 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -11) (meters 22) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1039,13 +1003,11 @@ ) (defpart 947 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 60) (sp-launcher-by-id spt-next-launcher 948)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 60) (sp-launcher-by-id spt-next-launcher 948)) ) (defpart 948 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) (deftype boatpaddle (process-drawable) @@ -1060,19 +1022,15 @@ ) -(defskelgroup *boatpaddle-sg* boatpaddle - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 18) - :longest-edge (meters 0) - ) +(defskelgroup *boatpaddle-sg* boatpaddle boatpaddle-lod0-jg boatpaddle-idle-ja + ((boatpaddle-lod0-mg (meters 20)) (boatpaddle-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 18) + ) (defstate boatpaddle-idle (boatpaddle) - :code - (behavior () + :code (behavior () (local-vars (s4-0 int)) - (while #t + (loop (quaternion-rotate-local-x! (-> self root quat) (-> self root quat) @@ -1084,18 +1042,7 @@ (let ((f30-0 1274.3112) (f28-0 (the float s4-0)) ) - ;; changed for divide by zero - (set! s4-0 (/-0-guard (the int (* 65536.0 (ja-frame-num 0))) (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) + (set! s4-0 (/-0-guard (the int (* 65536.0 (ja-frame-num 0))) (+ (-> (ja-group) data 0 length) -1))) (set! (-> *part-id-table* 943 init-specs 17 initial-valuef) (+ f30-0 (- f28-0 (* (the float (the int (/ (the float s4-0) 8192.0))) 8192.0))) ) @@ -1106,8 +1053,7 @@ ) (none) ) - :post - (the-as (function none :behavior boatpaddle) ja-post) + :post (the-as (function none :behavior boatpaddle) ja-post) ) (defmethod init-from-entity! boatpaddle ((obj boatpaddle) (arg0 entity-actor)) @@ -1135,18 +1081,14 @@ ) -(defskelgroup *windturbine-sg* windturbine - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 3 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *windturbine-sg* windturbine windturbine-lod0-jg windturbine-idle-ja + ((windturbine-lod0-mg (meters 20)) (windturbine-lod1-mg (meters 40)) (windturbine-lod2-mg (meters 999999))) + :bounds (static-spherem 0 3 0 7) + ) (defstate windturbine-idle (windturbine) - :code - (behavior () - (while #t + :code (behavior () + (loop (let* ((a0-0 (-> self root trans)) (f2-0 (-> *wind-work* @@ -1170,8 +1112,7 @@ ) (none) ) - :post - (the-as (function none :behavior windturbine) ja-post) + :post (the-as (function none :behavior windturbine) ja-post) ) (defmethod init-from-entity! windturbine ((obj windturbine) (arg0 entity-actor)) @@ -1208,13 +1149,10 @@ ) -(defskelgroup *mis-bone-bridge-sg* mis-bone-bridge - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 1 0 20) - :longest-edge (meters 0) - ) +(defskelgroup *mis-bone-bridge-sg* mis-bone-bridge mis-bone-bridge-lod0-jg mis-bone-bridge-idle-ja + ((mis-bone-bridge-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 20) + ) (defbehavior mis-bone-bridge-event-handler mis-bone-bridge ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 @@ -1233,17 +1171,10 @@ ) (cond ((and (< 0.0 f1-1) (< (fabs (* 0.5 f0-3)) f1-1)) - (let ((a1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-9 from) self) - (set! (-> a1-9 num-params) 2) - (set! (-> a1-9 message) 'query) - (set! (-> a1-9 param 0) (the-as uint 'powerup)) - (set! (-> a1-9 param 1) (the-as uint 2)) - (if (send-event-function *target* a1-9) - (go mis-bone-bridge-fall #f) - (go mis-bone-bridge-hit) - ) - ) + (if (send-event *target* 'query 'powerup (pickup-type eco-red)) + (go mis-bone-bridge-fall #f) + (go mis-bone-bridge-hit) + ) ) (else (go mis-bone-bridge-bump) @@ -1258,15 +1189,10 @@ ) (defstate mis-bone-bridge-idle (mis-bone-bridge) - :event - mis-bone-bridge-event-handler - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) 0.0) - ) - (while #t + :event mis-bone-bridge-event-handler + :code (behavior () + (ja :num-func num-func-identity :frame-num 0.0) + (loop (if (and *target* (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (level-hint-spawn (game-text-id misty-bone-bridge-hint) @@ -1280,141 +1206,74 @@ ) (none) ) - :post - (the-as (function none :behavior mis-bone-bridge) transform-post) + :post (the-as (function none :behavior mis-bone-bridge) transform-post) ) (defstate mis-bone-bridge-bump (mis-bone-bridge) - :event - mis-bone-bridge-event-handler - :trans - (the-as (function none :behavior mis-bone-bridge) rider-trans) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + :event mis-bone-bridge-event-handler + :trans (the-as (function none :behavior mis-bone-bridge) rider-trans) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go mis-bone-bridge-idle) (none) ) - :post - (the-as (function none :behavior mis-bone-bridge) rider-post) + :post (the-as (function none :behavior mis-bone-bridge) rider-post) ) (defstate mis-bone-bridge-hit (mis-bone-bridge) - :event - mis-bone-bridge-event-handler - :trans - (the-as (function none :behavior mis-bone-bridge) rider-trans) - :code - (behavior () + :event mis-bone-bridge-event-handler + :trans (the-as (function none :behavior mis-bone-bridge) rider-trans) + :code (behavior () (+! (-> self hit-points) -1) (if (zero? (-> self hit-points)) (go mis-bone-bridge-fall #f) ) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go mis-bone-bridge-idle) (none) ) - :post - (the-as (function none :behavior mis-bone-bridge) rider-post) + :post (the-as (function none :behavior mis-bone-bridge) rider-post) ) (defstate mis-bone-bridge-fall (mis-bone-bridge) - :trans - (the-as (function none :behavior mis-bone-bridge) rider-trans) - :code - (behavior ((arg0 symbol)) + :trans (the-as (function none :behavior mis-bone-bridge) rider-trans) + :code (behavior ((arg0 symbol)) (process-entity-status! self (entity-perm-status complete) #t) (when (not arg0) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-2 (method-of-type part-tracker activate))) - (t9-2 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 part-tracker-init (-> self particle-group) -1 #f #f #f (-> self root-override trans)) - (-> gp-1 ppointer) - ) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self fall-anim-index)))) - (set! (-> a0-5 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self fall-anim-index))) data 0 length) -1) - ) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! - a0-5 - (the-as art-joint-anim (-> self draw art-group data (-> self fall-anim-index))) - num-func-seek! - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> self particle-group) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) + (ja-no-eval :group! (-> self draw art-group data (-> self fall-anim-index)) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data (-> self fall-anim-index))) - num-func-identity + (ja :group! (-> self draw art-group data (-> self fall-anim-index)) + :num! (identity (the float (+ (-> (ja-group) data 0 length) -1))) ) - (set! (-> gp-2 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior mis-bone-bridge) rider-post) + :post (the-as (function none :behavior mis-bone-bridge) rider-post) ) (defmethod init-from-entity! mis-bone-bridge ((obj mis-bone-bridge) (arg0 entity-actor)) @@ -1511,19 +1370,16 @@ (defstate breakaway-idle (breakaway) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) (go breakaway-about-to-fall) ) ) ) - :code - (the-as (function none :behavior breakaway) anim-loop) - :post - (the-as (function none :behavior breakaway) transform-post) + :code (the-as (function none :behavior breakaway) anim-loop) + :post (the-as (function none :behavior breakaway) transform-post) ) (defun actor-wait-for-period ((arg0 time-frame)) @@ -1536,37 +1392,14 @@ ) (defstate breakaway-about-to-fall (breakaway) - :code - (behavior () - (sound-play-by-name (static-sound-name "falling-bones") (new-sound-id) 1024 0 0 1 #t) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 281) - (-> self root-override trans) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + :code (behavior () + (sound-play "falling-bones") + (launch-particles (-> *part-id-table* 281) (-> self root-override trans)) (let ((gp-1 #f) (s5-1 (-> *display* base-frame-counter)) ) - (while #t - (let ((s4-0 (-> self skel root-channel 0))) - (set! (-> s4-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> s4-0 param 0) (ja-aframe 15.0 0)) - (set! (-> s4-0 param 1) 1.0) - (set! (-> s4-0 frame-num) (ja-aframe 1.0 0)) - (joint-control-channel-group! - s4-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 15.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (when (and (not gp-1) (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.15))) (set! gp-1 #t) @@ -1576,60 +1409,34 @@ (go breakaway-fall) ) (suspend) - (let ((s4-1 (-> self skel root-channel 0))) - (set! (-> s4-1 param 0) (ja-aframe 15.0 0)) - (set! (-> s4-1 param 1) 1.0) - (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 15.0 0))) ) ) ) (none) ) - :post - (the-as (function none :behavior breakaway) rider-post) + :post (the-as (function none :behavior breakaway) rider-post) ) (defstate breakaway-fall (breakaway) - :code - (behavior () + :code (behavior () (let ((f30-0 0.0) (f28-0 0.0) (f26-0 (* 0.1 (- (-> *standard-dynamics* gravity-length)))) ) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> gp-0 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-0 param 1) 0.4) - (set! (-> gp-0 frame-num) (ja-aframe 16.0 0)) - (joint-control-channel-group! - gp-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 32.0 0) 0.4) :frame-num (ja-aframe 16.0 0)) (until (ja-done? 0) (+! f30-0 (* f28-0 (-> *display* seconds-per-frame))) (+! f28-0 (* f26-0 (-> *display* seconds-per-frame))) (+! (-> self root-override trans y) f30-0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-1 param 1) 0.4) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 32.0 0) 0.4)) ) ) (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior breakaway) rider-post) + :post (the-as (function none :behavior breakaway) rider-post) ) (defmethod init! breakaway ((obj breakaway) (arg0 res-lump) (arg1 int)) @@ -1691,29 +1498,20 @@ ) -(defskelgroup *breakaway-right-sg* breakaway-right - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *breakaway-right-sg* breakaway-right breakaway-right-lod0-jg breakaway-right-idle-ja + ((breakaway-right-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + ) -(defskelgroup *breakaway-mid-sg* breakaway-mid - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *breakaway-mid-sg* breakaway-mid breakaway-mid-lod0-jg breakaway-mid-idle-ja + ((breakaway-mid-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + ) -(defskelgroup *breakaway-left-sg* breakaway-left - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *breakaway-left-sg* breakaway-left breakaway-left-lod0-jg breakaway-left-idle-ja + ((breakaway-left-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + ) (defmethod init-from-entity! breakaway-right ((obj breakaway-right) (arg0 entity-actor)) (init! obj arg0 3) @@ -1773,13 +1571,10 @@ ) -(defskelgroup *mis-bone-platform-sg* mis-bone-platform - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *mis-bone-platform-sg* mis-bone-platform mis-bone-platform-lod0-jg mis-bone-platform-idle-ja + ((mis-bone-platform-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defmethod TODO-RENAME-27 bone-platform ((obj bone-platform) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -1810,31 +1605,26 @@ (defstate rigid-body-platform-idle (bone-platform) :virtual #t - :enter - (behavior () + :enter (behavior () (ja-channel-set! 0) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior bone-platform) ja-post) + :post (the-as (function none :behavior bone-platform) ja-post) ) (defstate rigid-body-platform-float (bone-platform) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bone-platform) rigid-body-platform-event-handler ) - :trans - (behavior () + :trans (behavior () (-> self entity extra trans y) (cond ((or (not *target*) (< (-> self info idle-distance) @@ -1842,39 +1632,28 @@ ) ) (let ((f30-1 -4096.0)) - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) (if (= (-> self float-height-offset) f30-1) (go-virtual rigid-body-platform-idle) ) ) ) (else - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) ) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) - (while #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 2)) + (ja :num-func num-func-identity :frame-num 0.0) + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior bone-platform) rigid-body-platform-post) + :post (the-as (function none :behavior bone-platform) rigid-body-platform-post) ) (defmethod TODO-RENAME-30 bone-platform ((obj bone-platform)) @@ -1934,50 +1713,32 @@ ) -(defskelgroup *mistycam-sg* mistycam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 20) - :longest-edge (meters 0) - ) +(defskelgroup *mistycam-sg* mistycam mistycam-lod0-jg mistycam-anim-ja + ((mistycam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) (defun mistycam-spawn () (with-pp (let ((gp-0 (entity-actor-lookup (-> pp entity) 'alt-actor 0))) (when gp-0 - (let* ((s5-0 (get-process *default-dead-pool* pov-camera #x4000)) - (gp-1 - (ppointer->handle - (when s5-0 - (let ((t9-2 (method-of-type pov-camera activate))) - (t9-2 (the-as pov-camera s5-0) pp 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> gp-0 extra trans) - *mistycam-sg* - (new 'static 'spool-anim :name "mistycam-cannon" :index 5 :parts 1 :command-list '()) - 0 - #f - '() - ) - (-> s5-0 ppointer) - ) - ) - ) - (s5-1 (get-process *default-dead-pool* fuel-cell #x4000)) - (s5-2 - (ppointer->handle (when s5-1 - (let ((t9-5 (method-of-type fuel-cell activate))) - (t9-5 (the-as fuel-cell s5-1) pp 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 fuel-cell-init-as-clone gp-1 (-> pp entity extra perm task)) - (-> s5-1 ppointer) + (let* ((gp-1 + (ppointer->handle (process-spawn + pov-camera + (-> gp-0 extra trans) + *mistycam-sg* + (new 'static 'spool-anim :name "mistycam-cannon" :index 5 :parts 1 :command-list '()) + 0 + #f + '() + :to pp ) ) ) + (s5-2 (ppointer->handle + (process-spawn fuel-cell :init fuel-cell-init-as-clone gp-1 (-> pp entity extra perm task) :to pp) + ) + ) ) (let ((v1-13 (handle->process gp-1))) (if v1-13 @@ -2007,21 +1768,12 @@ (defstate battlecontroller-play-intro-camera (misty-battlecontroller) :virtual #t - :code - (behavior () - (let* ((gp-0 (get-process *default-dead-pool* pov-camera #x4000)) - (gp-1 - (ppointer->handle - (when gp-0 - (let ((t9-1 (method-of-type pov-camera activate))) - (t9-1 (the-as pov-camera gp-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 pov-camera-init-by-other (-> self root trans) *mistycam-sg* "lurkerattack" 0 #f '()) - (-> gp-0 ppointer) - ) - ) - ) - ) + :code (behavior () + (let ((gp-1 (ppointer->handle + (process-spawn pov-camera (-> self root trans) *mistycam-sg* "lurkerattack" 0 #f '() :to self) + ) + ) + ) (while (handle->process (the-as handle gp-1)) (suspend) ) @@ -2095,8 +1847,7 @@ (defstate boat-fuelcell-idle (boat-fuelcell) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('task-complete) (set! (-> self play-cutscene?) #t) @@ -2105,41 +1856,24 @@ ) ) ) - :code - (the-as (function none :behavior boat-fuelcell) anim-loop) + :code (the-as (function none :behavior boat-fuelcell) anim-loop) ) (defstate boat-fuelcell-spawn (boat-fuelcell) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior boat-fuelcell) process-drawable-fuel-cell-handler ) - :code - (behavior () + :code (behavior () (process-drawable-birth-fuel-cell (the-as entity #f) (the-as vector #f) #f) (when (and *target* (-> self play-cutscene?)) (ambient-hint-spawn "gamcam02" (the-as vector #f) *entity-pool* 'camera) - (let* ((gp-0 (get-process *default-dead-pool* pov-camera #x4000)) - (gp-1 (ppointer->handle (when gp-0 - (let ((t9-3 (method-of-type pov-camera activate))) - (t9-3 (the-as pov-camera gp-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> self root trans) - *mistycam-sg* - "mistycam-balloon-fuel-cell" - 0 - #f - '() - ) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 + (ppointer->handle + (process-spawn pov-camera (-> self root trans) *mistycam-sg* "mistycam-balloon-fuel-cell" 0 #f '() :to self) + ) + ) + ) (while (handle->process (the-as handle gp-1)) (suspend) ) @@ -2154,8 +1888,7 @@ ) (defstate boat-fuelcell-die (boat-fuelcell) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (none) ) diff --git a/goal_src/levels/misty/misty-part.gc b/goal_src/levels/misty/misty-part.gc index d6cfb18e9c..6969e97f6b 100644 --- a/goal_src/levels/misty/misty-part.gc +++ b/goal_src/levels/misty/misty-part.gc @@ -17,8 +17,7 @@ (defpart 972 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 1)) @@ -44,8 +43,7 @@ ) (defpart 973 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 3.0 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 1)) @@ -73,8 +71,7 @@ (defpartgroup group-misty-ship-steam :id 205 :bounds (static-bspherem 0 0.5 0 4.5) - :parts - ((sp-item 972 :fade-after (meters 175) :falloff-to (meters 175) :period 1500 :length 300) + :parts ((sp-item 972 :fade-after (meters 175) :falloff-to (meters 175) :period 1500 :length 300) (sp-item 972 :fade-after (meters 175) :falloff-to (meters 175) :period 2928 :length 360) (sp-item 972 :fade-after (meters 175) :falloff-to (meters 175) :period 4602 :length 180) (sp-item 973 :fade-after (meters 125) :falloff-to (meters 125) :period 180 :length 45) @@ -84,8 +81,7 @@ (defpartgroup group-part-misty-torch :id 206 :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 974 :fade-after (meters 180) :falloff-to (meters 200)) + :parts ((sp-item 974 :fade-after (meters 180) :falloff-to (meters 200)) (sp-item 975 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 976 :fade-after (meters 50) :falloff-to (meters 50) :period 600 :length 90) (sp-item 977 :fade-after (meters 50) :falloff-to (meters 50) :period 369 :length 69) @@ -95,8 +91,7 @@ ) (defpart 979 - :init-specs - ((sp-flt spt-num 0.3) + :init-specs ((sp-flt spt-num 0.3) (sp-flt spt-x (meters 0.2)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-int spt-rot-x 5) @@ -114,13 +109,11 @@ ) (defpart 980 - :init-specs - ((sp-flt spt-fade-b -6.826667)) + :init-specs ((sp-flt spt-fade-b -6.826667)) ) (defpart 974 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1069547520 1 1.0) (sp-rnd-flt spt-x (meters -0.35) (meters 0.7) 1.0) (sp-rnd-flt spt-z (meters -0.35) (meters 0.7) 1.0) @@ -142,13 +135,11 @@ ) (defpart 981 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) (defpart 976 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters 1)) @@ -171,8 +162,7 @@ ) (defpart 977 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.2) (meters 0.6) 1.0) (sp-flt spt-y (meters 0.5)) @@ -195,8 +185,7 @@ ) (defpart 978 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 0.2) 1.0) (sp-flt spt-y (meters 0.6)) @@ -219,8 +208,7 @@ ) (defpart 975 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.3)) @@ -253,13 +241,11 @@ (defpartgroup group-misty-fog :id 207 :bounds (static-bspherem 64 7 0 96) - :parts - ((sp-item 982 :flags (is-3d))) + :parts ((sp-item 982 :flags (is-3d))) ) (defpart 982 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x7 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7 :page #x2)) (sp-flt spt-num 0.06125) (sp-rnd-flt spt-x (meters 0) (meters 128) 1.0) (sp-rnd-flt spt-y (meters 5.5) (meters 1.5) 1.0) @@ -287,28 +273,24 @@ ) (defpart 983 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 1200 299 1) (sp-launcher-by-id spt-next-launcher 984) ) ) (defpart 984 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) (defpartgroup group-misty-lurkermachine-vent-316 :id 208 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 985 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 985 :fade-after (meters 80) :falloff-to (meters 80))) ) (defpart 985 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -340,13 +322,11 @@ (defpartgroup group-misty-lurkermachine-vent-313 :id 209 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 986 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 986 :fade-after (meters 80) :falloff-to (meters 80))) ) (defpart 986 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -378,13 +358,11 @@ (defpartgroup group-misty-lurkermachine-vent-308 :id 210 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 987 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 987 :fade-after (meters 80) :falloff-to (meters 80))) ) (defpart 987 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -416,13 +394,11 @@ (defpartgroup group-misty-lurkermachine-vent-307 :id 211 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 988 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 988 :fade-after (meters 80) :falloff-to (meters 80))) ) (defpart 988 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -454,13 +430,11 @@ (defpartgroup group-misty-lurkermachine-vent-305 :id 212 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 989 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 989 :fade-after (meters 80) :falloff-to (meters 80))) ) (defpart 989 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -492,13 +466,11 @@ (defpartgroup group-misty-lurkermachine-vent-309 :id 213 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 990 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 990 :fade-after (meters 80) :falloff-to (meters 80))) ) (defpart 990 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -530,13 +502,11 @@ (defpartgroup group-misty-lurkermachine-vent-2 :id 214 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 991 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 991 :fade-after (meters 80) :falloff-to (meters 80))) ) (defpart 991 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -568,13 +538,11 @@ (defpartgroup group-misty-lurkermachine-vent-328 :id 215 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 992 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 992 :fade-after (meters 80) :falloff-to (meters 80))) ) (defpart 992 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -606,13 +574,11 @@ (defpartgroup group-misty-lurkermachine-vent-325 :id 216 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 993 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 993 :fade-after (meters 80) :falloff-to (meters 80))) ) (defpart 993 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -0.8) (meters 1.6) 1.0) (sp-rnd-flt spt-y (meters -0.3) (meters 0.6) 1.0) @@ -644,13 +610,11 @@ (defpartgroup group-misty-lurkermachine-vent-320 :id 217 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 994 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 994 :fade-after (meters 80) :falloff-to (meters 80))) ) (defpart 994 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -0.8) (meters 1.6) 1.0) (sp-rnd-flt spt-y (meters -0.3) (meters 0.6) 1.0) @@ -682,13 +646,11 @@ (defpartgroup group-misty-lurkermachine-vent-324 :id 218 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 995 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 995 :fade-after (meters 80) :falloff-to (meters 80))) ) (defpart 995 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -0.8) (meters 1.6) 1.0) (sp-rnd-flt spt-y (meters -0.3) (meters 0.6) 1.0) @@ -720,8 +682,7 @@ (defpartgroup group-misty-fort-steam :id 219 :bounds (static-bspherem 0 0.5 0 4.5) - :parts - ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1500 :length 300) + :parts ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1500 :length 300) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 2928 :length 360) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 4602 :length 180) (sp-item 997 :fade-after (meters 125) :falloff-to (meters 125) :period 180 :length 45) @@ -731,8 +692,7 @@ (defpartgroup group-misty-fort-steam2 :id 220 :bounds (static-bspherem 0 0.5 0 4.5) - :parts - ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1230 :length 300) + :parts ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1230 :length 300) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 2550 :length 360) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 6102 :length 180) (sp-item 997 :fade-after (meters 125) :falloff-to (meters 125) :period 210 :length 45) @@ -742,8 +702,7 @@ (defpartgroup group-misty-fort-steam3 :id 221 :bounds (static-bspherem 0 0.5 0 4.5) - :parts - ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1800 :length 300) + :parts ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1800 :length 300) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 2559 :length 360) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 5202 :length 180) (sp-item 997 :fade-after (meters 125) :falloff-to (meters 125) :period 240 :length 45) @@ -753,8 +712,7 @@ (defpartgroup group-misty-fort-steam4 :id 222 :bounds (static-bspherem 0 0.5 0 4.5) - :parts - ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1560 :length 300) + :parts ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1560 :length 300) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 2601 :length 360) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 4848 :length 180) (sp-item 997 :fade-after (meters 125) :falloff-to (meters 125) :period 270 :length 45) @@ -762,8 +720,7 @@ ) (defpart 996 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.6 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 1)) @@ -789,8 +746,7 @@ ) (defpart 997 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 1)) @@ -818,8 +774,7 @@ (defpartgroup group-misty-lurkermachine-spout-314 :id 223 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 998 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) + :parts ((sp-item 998 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) (sp-item 998 :fade-after (meters 100) :falloff-to (meters 120) :period 770 :length 96) (sp-item 998 :fade-after (meters 140) :falloff-to (meters 160) :period 936 :length 60) (sp-item 999 :fade-after (meters 100) :falloff-to (meters 100)) @@ -827,8 +782,7 @@ ) (defpart 999 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -849,17 +803,9 @@ ) (defpart 998 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.6 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "steam-release") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "steam-release" :num 0.05 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -883,8 +829,7 @@ (defpartgroup group-misty-lurkermachine-spout-310 :id 224 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1000 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) + :parts ((sp-item 1000 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) (sp-item 1000 :fade-after (meters 100) :falloff-to (meters 120) :period 770 :length 96) (sp-item 1000 :fade-after (meters 140) :falloff-to (meters 160) :period 936 :length 60) (sp-item 1001 :fade-after (meters 100) :falloff-to (meters 100)) @@ -892,8 +837,7 @@ ) (defpart 1001 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -915,17 +859,9 @@ ) (defpart 1000 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.6 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "steam-release") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "steam-release" :num 0.05 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -950,8 +886,7 @@ (defpartgroup group-misty-lurkermachine-spout-311 :id 225 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1002 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) + :parts ((sp-item 1002 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) (sp-item 1002 :fade-after (meters 100) :falloff-to (meters 120) :period 770 :length 96) (sp-item 1002 :fade-after (meters 140) :falloff-to (meters 160) :period 936 :length 60) (sp-item 1003 :fade-after (meters 100) :falloff-to (meters 100)) @@ -959,8 +894,7 @@ ) (defpart 1003 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -982,17 +916,9 @@ ) (defpart 1002 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.6 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "steam-release") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "steam-release" :num 0.05 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1017,8 +943,7 @@ (defpartgroup group-misty-lurkermachine-spout-312 :id 226 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1004 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) + :parts ((sp-item 1004 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) (sp-item 1004 :fade-after (meters 100) :falloff-to (meters 120) :period 770 :length 96) (sp-item 1004 :fade-after (meters 140) :falloff-to (meters 160) :period 936 :length 60) (sp-item 1005 :fade-after (meters 100) :falloff-to (meters 100)) @@ -1026,8 +951,7 @@ ) (defpart 1005 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1049,17 +973,9 @@ ) (defpart 1004 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.6 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "steam-release") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "steam-release" :num 0.05 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) diff --git a/goal_src/levels/misty/misty-teetertotter.gc b/goal_src/levels/misty/misty-teetertotter.gc index c170fb61e4..d91781cc24 100644 --- a/goal_src/levels/misty/misty-teetertotter.gc +++ b/goal_src/levels/misty/misty-teetertotter.gc @@ -9,6 +9,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/teetertotter-ag.gc") + (deftype teetertotter (process-drawable) ((launched-player basic :offset-assert 176) (in-launch-window basic :offset-assert 180) @@ -26,13 +28,10 @@ ) -(defskelgroup *teetertotter-sg* teetertotter - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *teetertotter-sg* teetertotter teetertotter-lod0-jg teetertotter-idle-ja + ((teetertotter-lod0-mg (meters 20)) (teetertotter-lod1-mg (meters 40)) (teetertotter-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) (defun target-on-end-of-teetertotter? ((arg0 teetertotter)) (let ((gp-1 (vector-! (new-stack-vector0) (-> *target* control trans) (-> arg0 root trans)))) @@ -43,8 +42,7 @@ ) (defstate teetertotter-idle (teetertotter) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (case (-> arg3 param 1) @@ -71,92 +69,57 @@ ) ) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + :code (behavior () + (ja :group! (-> self draw art-group data 4) :num! min) + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior teetertotter) transform-post) + :post (the-as (function none :behavior teetertotter) transform-post) ) (defstate teetertotter-launch (teetertotter) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (when (= arg2 'touch) - (when (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root)) - (the-as uint 1) - ) - (-> self rock-is-dangerous) - ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (let ((a0-2 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-2 mode) 'deadly) - (set! (-> a1-2 param 1) (the-as uint a0-2)) - ) - (send-event-function arg0 a1-2) - ) - ) - (when (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root)) - (the-as uint 2) - ) - (target-on-end-of-teetertotter? self) - (not (-> self launched-player)) - (-> self in-launch-window) - ) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'shove) - (set! (-> a1-4 param 0) (the-as uint #f)) - (let ((v1-16 (new 'static 'attack-info :mask #xcc0))) - (set! (-> v1-16 shove-back) 0.0) - (set! (-> v1-16 shove-up) 53248.0) - (set! (-> v1-16 angle) 'jump) - (set! (-> v1-16 control) 1.0) - (set! (-> a1-4 param 1) (the-as uint v1-16)) - ) - (when (send-event-function arg0 a1-4) - (let ((v0-0 #t)) - (set! (-> self launched-player) v0-0) - v0-0 - ) - ) - ) - ) - ) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (the-as + object + (when (= arg2 'touch) + (if (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root)) + (the-as uint 1) + ) + (-> self rock-is-dangerous) + ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'deadly)))) ) - ) - :code - (behavior () - (set! (-> self launched-player) #f) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) + (when (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root)) + (the-as uint 2) + ) + (target-on-end-of-teetertotter? self) + (not (-> self launched-player)) + (-> self in-launch-window) + ) + (when (send-event + arg0 + 'shove + #f + (static-attack-info ((shove-back (meters 0)) (shove-up (meters 13)) (angle 'jump) (control 1.0))) + ) + (let ((v0-0 #t)) + (set! (-> self launched-player) v0-0) + v0-0 + ) ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + ) + ) ) + ) + :code (behavior () + (set! (-> self launched-player) #f) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f0-4 (ja-aframe-num 0))) (set! (-> self in-launch-window) (and (>= f0-4 76.0) (>= 82.0 f0-4))) @@ -165,44 +128,25 @@ ) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go teetertotter-idle) (none) ) - :post - (the-as (function none :behavior teetertotter) rider-post) + :post (the-as (function none :behavior teetertotter) rider-post) ) (defstate teetertotter-bend (teetertotter) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go teetertotter-idle) (none) ) - :post - (the-as (function none :behavior teetertotter) rider-post) + :post (the-as (function none :behavior teetertotter) rider-post) ) (defmethod init-from-entity! teetertotter ((obj teetertotter) (arg0 entity-actor)) diff --git a/goal_src/levels/misty/misty-warehouse.gc b/goal_src/levels/misty/misty-warehouse.gc index e99aed7cf9..55f0608b01 100644 --- a/goal_src/levels/misty/misty-warehouse.gc +++ b/goal_src/levels/misty/misty-warehouse.gc @@ -9,6 +9,9 @@ ;; DECOMP BEGINS +(import "goal_src/import/silostep-ag.gc") +(import "goal_src/import/rounddoor-ag.gc") + (deftype silostep (process-drawable) ((anim-limit float :offset-assert 176) (cam-tracker handle :offset-assert 184) @@ -25,17 +28,13 @@ ) -(defskelgroup *silostep-sg* silostep - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *silostep-sg* silostep silostep-lod0-jg silostep-idle-ja + ((silostep-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 8) + ) (defstate silostep-idle (silostep) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go silostep-camera) @@ -45,65 +44,48 @@ ) ) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 2) :num! min) (transform-post) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior silostep) ja-post) + :post (the-as (function none :behavior silostep) ja-post) ) (defbehavior misty-camera-view silostep () - (let ((gp-0 (get-process *default-dead-pool* camera-tracker #x4000))) - (set! (-> self cam-tracker) - (ppointer->handle (when gp-0 - (let ((t9-1 (method-of-type camera-tracker activate))) - (t9-1 (the-as camera-tracker gp-0) self 'camera-tracker (the-as pointer #x70004000)) + (set! (-> self cam-tracker) + (ppointer->handle (process-spawn + camera-tracker + :init camera-tracker-init + (lambda :behavior camera-tracker + () + (while (not (process-grab? *target*)) + (suspend) ) - (run-now-in-process - gp-0 - camera-tracker-init - (lambda :behavior camera-tracker - () - (while (not (process-grab? *target*)) - (suspend) - ) - (camera-change-to "camera-160" 150 #f) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 3)) - (suspend) - ) - ) - (while (not (process-release? (handle->process (-> self grab-target)))) - (suspend) - ) - (camera-change-to (the-as string 'base) 150 #f) - (none) + (camera-change-to "camera-160" 150 #f) + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 3)) + (suspend) ) ) - (-> gp-0 ppointer) + (while (not (process-release? (handle->process (-> self grab-target)))) + (suspend) + ) + (camera-change-to (the-as string 'base) 150 #f) + (none) ) + :to self ) - ) - ) + ) + ) (none) ) (defstate silostep-camera (silostep) - :code - (behavior () + :code (behavior () (misty-camera-view) (let* ((gp-0 (get-task-control (game-task misty-warehouse))) (v1-1 (get-reminder gp-0 0)) @@ -116,55 +98,35 @@ (suspend) ) ) - (sound-play-by-name (static-sound-name "arena-steps") (new-sound-id) 1024 0 0 1 #t) + (sound-play "arena-steps") (send-to-all-after (-> self link) 'trigger-rise) (go silostep-rise #f) (none) ) - :post - (the-as (function none :behavior silostep) ja-post) + :post (the-as (function none :behavior silostep) ja-post) ) (defstate silostep-rise (silostep) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (process-entity-status! self (entity-perm-status complete) #t) (when (not arg0) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-2 param 0) (-> self anim-limit)) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! (-> self anim-limit)) :frame-num 0.0) (until (ja-done? 0) (rider-trans) (rider-post) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (-> self anim-limit)) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (-> self anim-limit))) ) ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-1 frame-num) (-> self anim-limit)) - ) + (ja :group! (-> self draw art-group data 2) :num! (identity (-> self anim-limit))) (rider-post) - (while #t + (loop (ja-post) (suspend) ) (none) ) - :post - (the-as (function none :behavior silostep) #f) + :post (the-as (function none :behavior silostep) #f) ) (defmethod init-from-entity! silostep ((obj silostep) (arg0 entity-actor)) @@ -204,13 +166,10 @@ (none) ) -(defskelgroup *rounddoor-sg* rounddoor - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *rounddoor-sg* rounddoor rounddoor-lod0-jg rounddoor-idle-ja + ((rounddoor-lod0-mg (meters 20)) (rounddoor-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) (deftype rounddoor (eco-door) () diff --git a/goal_src/levels/misty/mistycannon.gc b/goal_src/levels/misty/mistycannon.gc index 42506eb54a..1152fb3821 100644 --- a/goal_src/levels/misty/mistycannon.gc +++ b/goal_src/levels/misty/mistycannon.gc @@ -7,6 +7,9 @@ ;; DECOMP BEGINS +(import "goal_src/import/sack-ag.gc") +(import "goal_src/import/mistycannon-ag.gc") + (deftype angle-tracker (structure) ((value float :offset-assert 0) (min float :offset-assert 4) @@ -144,16 +147,14 @@ (defpartgroup group-beach-sack-fuse :id 117 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 517 :fade-after (meters 30)) + :parts ((sp-item 517 :fade-after (meters 30)) (sp-item 518 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 519 :fade-after (meters 80) :falloff-to (meters 80)) ) ) (defpart 517 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-scale-x (meters 0.1)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -174,8 +175,7 @@ ) (defpart 518 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.25) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -190,8 +190,7 @@ ) (defpart 519 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-scale-x (meters 0.2)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -216,8 +215,7 @@ :id 118 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 520 :period 1200 :length 30) + :parts ((sp-item 520 :period 1200 :length 30) (sp-item 521 :fade-after (meters 60) :period 1200 :length 15) (sp-item 522 :period 1200 :length 15 :offset 15) (sp-item 523 :period 1200 :length 15) @@ -242,8 +240,7 @@ ) (defpart 520 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-y (meters 0.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -270,13 +267,11 @@ ) (defpart 526 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.32)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.32)) ) (defpart 521 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0.75)) (sp-rnd-flt spt-scale-x (meters 8) (meters 8) 1.0) @@ -300,13 +295,11 @@ ) (defpart 527 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) (defpart 522 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 24) (meters 16) 1.0) @@ -322,8 +315,7 @@ ) (defpart 523 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 24) (meters 16) 1.0) @@ -339,8 +331,7 @@ ) (defpart 524 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 5.0 10.0 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) @@ -367,8 +358,7 @@ ) (defpart 528 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0033333334)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0033333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r -4.266667) (sp-flt spt-fade-g 0.7111111) @@ -378,8 +368,7 @@ ) (defpart 525 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.25) (meters 0.5) 1.0) @@ -404,8 +393,7 @@ :id 119 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 24) - :parts - ((sp-item 529 :fade-after (meters 200) :falloff-to (meters 200) :period 1200 :length 30) + :parts ((sp-item 529 :fade-after (meters 200) :falloff-to (meters 200) :period 1200 :length 30) (sp-item 530 :fade-after (meters 100) :falloff-to (meters 100) :period 1200 :length 15) (sp-item 531 :fade-after (meters 40) :falloff-to (meters 40) :period 1200 :length 15) (sp-item 532 :period 1200 :length 15 :offset 15) @@ -439,8 +427,7 @@ ) (defpart 529 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -469,16 +456,14 @@ ) (defpart 536 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.006666667)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.006666667)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.16) ) ) (defpart 530 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -506,8 +491,7 @@ ) (defpart 531 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0.75)) (sp-rnd-flt spt-scale-x (meters 16) (meters 16) 1.0) @@ -530,13 +514,11 @@ ) (defpart 537 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) (defpart 532 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 24) (meters 16) 1.0) @@ -552,8 +534,7 @@ ) (defpart 533 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 24) (meters 16) 1.0) @@ -569,8 +550,7 @@ ) (defpart 534 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 5.0 10.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -596,8 +576,7 @@ ) (defpart 538 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0033333334)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0033333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r -0.6) (sp-flt spt-fade-g -1.8) @@ -606,8 +585,7 @@ ) (defpart 535 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.25) (meters 0.5) 1.0) @@ -668,13 +646,10 @@ (none) ) -(defskelgroup *mistycannon-missile-sg* sack - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *mistycannon-missile-sg* sack sack-lod0-jg sack-idle-ja + ((sack-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defmethod spawn-part mistycannon-missile ((obj mistycannon-missile)) (let ((gp-0 (-> obj part)) @@ -687,42 +662,35 @@ ) (defstate mistycannon-missile-idle (mistycannon-missile) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (go mistycannon-missile-explode) ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self sfx) (the-as uint 0)) 0 (none) ) - :trans - (behavior () + :trans (behavior () (if (< (-> self root-override trans y) (-> self water-height)) (go mistycannon-missile-in-water) ) (none) ) - :code - (behavior () + :code (behavior () (clear-collide-with-as (-> self root-override)) (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (the int (* 300.0 (-> self muzzle-time)))) (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) (suspend) - (let ((f0-1 - (fmin - 1.0 - (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) - (the float (the int (* 300.0 (-> self muzzle-time)))) - ) - ) - ) + (let ((f0-1 (fmin 1.0 (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) + (the float (the int (* 300.0 (-> self muzzle-time)))) + ) + ) + ) ) (set! (-> self root-override scale x) (* 0.6 f0-1)) (set! (-> self root-override scale y) (* 0.6 f0-1)) @@ -731,7 +699,7 @@ ) (restore-collide-with-as (-> self root-override)) (set-vector! (-> self root-override scale) 0.6 0.6 0.6 1.0) - (while (zero? (logand (-> self root-override status) 1)) + (while (zero? (logand (-> self root-override status) (cshape-moving-flags onsurf))) (if (and (zero? (-> self sfx)) (< (if *target* (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) @@ -741,18 +709,7 @@ ) ) (set! (-> self sfx) - (the-as - uint - (sound-play-by-name - (static-sound-name "sack-incoming") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) - ) + (the-as uint (sound-play "sack-incoming" :position (the-as symbol (-> self root-override trans)))) ) ) (when (nonzero? (-> self sfx)) @@ -770,7 +727,7 @@ ) (sound-trans-convert (-> gp-1 parms trans) a1-3) ) - (set! (-> gp-1 parms mask) (the-as uint 32)) + (set! (-> gp-1 parms mask) (sound-mask trans)) (-> gp-1 id) ) ) @@ -785,54 +742,21 @@ 0 ) (set! (-> self ground-time) (-> *display* base-frame-counter)) - (sound-play-by-name - (static-sound-name "sack-land") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (sound-play "sack-land" :position (the-as symbol (-> self root-override trans))) + (ja-no-eval :group! sack-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-21 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-21 param 1) 1.0) - (set! (-> a0-21 frame-num) 0.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! sack-fuse-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) (the float (+ (-> a0-22 frame-group data 0 length) -1))) - (set! (-> a0-22 param 1) 1.0) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go mistycannon-missile-explode) (none) ) - :post - (behavior () + :post (behavior () (vector-v++! (-> self root-override transv) (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 1.0) @@ -846,7 +770,7 @@ (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) (spawn-part self) (when (and (zero? (-> self draw cur-lod)) (logtest? (-> self draw status) (draw-status was-drawn))) - (if (logtest? (-> self root-override status) 1) + (if (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) (draw-shadow (-> self root-override shadow-pos) (-> self root-override shadow-pos) @@ -860,7 +784,7 @@ (-> self root-override shadow-pos) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -872,8 +796,7 @@ ) (defstate mistycannon-missile-in-water (mistycannon-missile) - :code - (behavior () + :code (behavior () (when (nonzero? (-> self sfx)) (sound-stop (the-as sound-id (-> self sfx))) (set! (-> self sfx) (the-as uint 0)) @@ -898,15 +821,9 @@ (-> self root-override transv) (-> self root-override root-prim collide-with) ) - (set! (-> self root-override scale x) - (seek (-> self root-override scale x) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - ) - (set! (-> self root-override scale y) - (seek (-> self root-override scale y) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - ) - (set! (-> self root-override scale z) - (seek (-> self root-override scale z) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - ) + (seek! (-> self root-override scale x) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) + (seek! (-> self root-override scale y) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) + (seek! (-> self root-override scale z) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) (when (< 0.05 (-> self root-override scale x)) (suspend) (goto cfg-3) @@ -914,13 +831,11 @@ (ja-channel-set! 0) (none) ) - :post - (the-as (function none :behavior mistycannon-missile) ja-post) + :post (the-as (function none :behavior mistycannon-missile) ja-post) ) (defstate mistycannon-missile-explode (mistycannon-missile) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touched) (let* ((s4-0 arg0) @@ -946,23 +861,13 @@ (collide-kind background) self t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) (cond ((= (-> arg0 type) target) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((a0-8 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-8 mode) 'explode) - (set! (-> a1-3 param 1) (the-as uint a0-8)) - ) - (send-event-function arg0 a1-3) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'explode)))) ) (else (let ((a1-4 (new 'stack-no-clear 'event-message-block))) @@ -987,27 +892,10 @@ ) ) ) - :code - (behavior () + :code (behavior () (if (and *target* (= (-> *target* next-state name) 'target-periscope)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "explosion") - :volume #x400 - :fo-min #xc8 - :fo-max #x190 - ) - (new-sound-id) - (the-as vector #t) - ) - (sound-play-by-spec - (new 'static 'sound-spec :num 1.0 :group #x1 :sound-name (static-sound-name "explosion") :volume #x400) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "explosion" :fo-min 200 :fo-max 400) (new-sound-id) (the-as vector #t)) + (sound-play-by-spec (static-sound-spec "explosion") (new-sound-id) (the-as vector #t)) ) (spawn (-> self part2) (-> self root-override trans)) (ja-channel-set! 0) @@ -1035,8 +923,7 @@ (deactivate self) (none) ) - :post - (the-as (function none :behavior mistycannon-missile) ja-post) + :post (the-as (function none :behavior mistycannon-missile) ja-post) ) (defun mistycannon-collision-reaction ((arg0 collide-shape-moving) (arg1 collide-shape-intersect) (arg2 vector) (arg3 vector)) @@ -1054,7 +941,7 @@ (vector-float*! (-> arg0 transv) (-> arg0 transv) 0.15) (let ((v0-1 (logior s5-0 7))) (logior! (-> arg0 status) v0-1) - (the-as uint v0-1) + (the-as cshape-moving-flags v0-1) ) ) ) @@ -1073,7 +960,7 @@ ) -(defbehavior mistycannon-missile-init-by-other mistycannon-missile ((arg0 mistycannon-init-data) (arg1 entity)) +(defbehavior mistycannon-missile-init-by-other mistycannon-missile ((arg0 mistycannon-init-data) (arg1 entity-actor)) (set! (-> self mask) (logior (process-mask projectile) (-> self mask))) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self entity) arg1) @@ -1131,15 +1018,7 @@ (set! (-> s5-0 flight-time) arg4) (set! (-> s5-0 muzzle-time) arg5) (set! (-> s5-0 blast-radius) arg6) - (let ((s3-0 (get-process *default-dead-pool* mistycannon-missile #x4000))) - (when s3-0 - (let ((t9-1 (method-of-type mistycannon-missile activate))) - (t9-1 (the-as mistycannon-missile s3-0) arg0 'mistycannon-missile (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 mistycannon-missile-init-by-other s5-0 arg7) - (-> s3-0 ppointer) - ) - ) + (process-spawn mistycannon-missile s5-0 arg7 :to arg0) ) 0 (none) @@ -1196,10 +1075,8 @@ (set! (-> self at-point z) (+ (-> self center-point z) (* f30-0 (sin f28-1)))) ) (set! (-> self at-point w) 1.0) - (let ((f0-11 (rand-vu-float-range 2730.6667 12743.111))) - (set! (-> self target-theta) f0-11) - f0-11 - ) + (set! (-> self target-theta) (rand-vu-float-range 2730.6667 12743.111)) + (none) ) (defmethod rotate! mistycannon ((obj mistycannon) (arg0 float)) @@ -1236,7 +1113,7 @@ (vector+! (-> obj hellmouth) (-> obj hellmouth) s3-0) (spawn-mistycannon-missile obj s3-0 s2-0 f30-0 arg1 f28-0 arg2 (-> obj entity)) ) - (sound-play-by-name (static-sound-name "cannon-shot") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cannon-shot") (set! (-> obj part local-clock) 0) (set! (-> obj part-timer) (-> *display* base-frame-counter)) (mistycannon-pick-random-target-point) @@ -1288,17 +1165,15 @@ (none) ) -(defskelgroup *mistycannon-sg* mistycannon - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 5 0 9) - :longest-edge (meters 4) - ) +(defskelgroup *mistycannon-sg* mistycannon mistycannon-lod0-jg mistycannon-idle-ja + ((mistycannon-lod0-mg (meters 20)) (mistycannon-lod1-mg (meters 999999))) + :bounds (static-spherem 0 5 0 9) + :longest-edge (meters 4) + ) -(defun mistycannon-prebind-function ((arg0 mistycannon) (arg1 int) (arg2 mistycannon)) +(defun mistycannon-prebind-function ((arg0 pointer) (arg1 int) (arg2 mistycannon)) (let ((t9-0 quaternion-axis-angle!) - (a0-1 (&-> arg0 link)) + (a0-1 (&+ arg0 144)) (a1-1 0.0) (a2-1 1.0) (a3-0 0.0) @@ -1313,7 +1188,7 @@ ) ) (let ((t9-1 quaternion-axis-angle!) - (a0-2 (&-> arg0 tilt min)) + (a0-2 (&+ arg0 192)) (a1-2 -1.0) (a2-2 0.0) (a3-1 0.0) @@ -1340,10 +1215,10 @@ (the float (sar (shl (the int (+ (-> v1-19 min) (-> v1-19 value))) 48) 48)) ) ) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 stack 324)) -1.0 0.0 0.0 (-> arg2 front-wheel)) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 stack 276)) 1.0 0.0 0.0 (-> arg2 front-wheel)) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 goggles y)) -1.0 0.0 0.0 (-> arg2 rear-wheel)) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 at-point y)) 1.0 0.0 0.0 (-> arg2 rear-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 432)) -1.0 0.0 0.0 (-> arg2 front-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 384)) 1.0 0.0 0.0 (-> arg2 front-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 288)) -1.0 0.0 0.0 (-> arg2 rear-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 336)) 1.0 0.0 0.0 (-> arg2 rear-wheel)) 0 (none) ) @@ -1361,8 +1236,7 @@ ) (defstate mistycannon-idle (mistycannon) - :trans - (behavior () + :trans (behavior () (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (go mistycannon-waiting-for-player) ) @@ -1377,16 +1251,14 @@ (rider-trans) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (dummy-23 self) (suspend) ) (none) ) - :post - (the-as (function none :behavior mistycannon) rider-post) + :post (the-as (function none :behavior mistycannon) rider-post) ) (deftype quadratic-solution (structure) @@ -1550,13 +1422,11 @@ ) (defstate mistycannon-aim-at-player (mistycannon) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (go mistycannon-waiting-for-player) ) @@ -1570,9 +1440,8 @@ (rider-trans) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (< (vector-vector-xz-distance (target-pos 0) (-> self center-point)) (-> self center-point w)) (mistycannon-do-aim (-> *target* control trans) (-> *target* control transv)) (mistycannon-do-aim (-> self at-point) (new-stack-vector0)) @@ -1582,13 +1451,11 @@ ) (none) ) - :post - (the-as (function none :behavior mistycannon) rider-post) + :post (the-as (function none :behavior mistycannon) rider-post) ) (defstate mistycannon-waiting-for-player (mistycannon) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) (when ((method-of-type touching-shapes-entry prims-touching?) @@ -1607,18 +1474,16 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) (go mistycannon-aim-at-player) ) (rider-trans) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self player-touching-grips?) #f) - (while #t + (loop (let ((f0-0 2730.6667) (v1-0 (-> self tilt)) ) @@ -1647,7 +1512,7 @@ (print-game-text (lookup-text! *common-text* (game-text-id press-to-use) #f) gp-0 #f 128 22) ) (when (cpad-pressed? 0 circle) - (while #t + (loop (send-event *target* 'change-mode 'periscope self) (suspend) (suspend) @@ -1659,31 +1524,26 @@ ) (none) ) - :post - (the-as (function none :behavior mistycannon) rider-post) + :post (the-as (function none :behavior mistycannon) rider-post) ) (defstate cam-mistycannon (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((v1-0 (-> self change-event-from))) (set! (-> self trans quad) (-> (the-as mistycannon (-> v1-0 0)) goggles quad)) (let ((t9-0 matrix-rotate-yx!) @@ -1700,35 +1560,31 @@ ) (defstate mistycannon-player-control (mistycannon) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('change-mode) (send-event *camera* 'change-state cam-mistycannon 0) ) ) ) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self sound-id)) (sound-stop (-> self aim-sound-id)) (none) ) - :trans - (behavior () + :trans (behavior () (dummy-23 self) (rider-trans) (none) ) - :code - (behavior () + :code (behavior () (send-event *camera* 'change-state cam-mistycannon 0) (suspend) (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 0) (s5-0 0) ) - (while #t + (loop (when *camera-read-analog* (let ((f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0)) (f28-0 (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0)) @@ -1736,7 +1592,7 @@ (rotate! self f30-0) (tilt! self (- f28-0)) (if (or (!= f30-0 0.0) (!= f28-0 0.0)) - (sound-play-by-name (static-sound-name "telescope") (-> self aim-sound-id) 1024 0 0 1 #t) + (sound-play "telescope" :id (-> self aim-sound-id)) (sound-stop (-> self aim-sound-id)) ) ) @@ -1746,16 +1602,11 @@ (sound-stop (-> self sound-id)) (send-event *camera* 'change-to-entity-by-name "camera-111") (suspend) - (while #t - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) self) - (set! (-> a1-8 num-params) 0) - (set! (-> a1-8 message) 'end-mode) - (when (send-event-function *target* a1-8) - (send-event *camera* 'change-state *camera-base-mode* 0) - (process-entity-status! self (entity-perm-status bit-3) #f) - (go mistycannon-waiting-for-player-to-fuck-off) - ) + (loop + (when (send-event *target* 'end-mode) + (send-event *camera* 'change-state *camera-base-mode* 0) + (process-entity-status! self (entity-perm-status bit-3) #f) + (go mistycannon-waiting-for-player-to-fuck-off) ) (suspend) ) @@ -1766,15 +1617,7 @@ (set! gp-0 (seekl gp-0 300 (the-as int (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)))) ) - (sound-play-by-name - (static-sound-name "cannon-charge") - (-> self sound-id) - 1024 - (the int (* 1524.0 (* 0.008 (the float gp-0)))) - 0 - 1 - #t - ) + (sound-play "cannon-charge" :id (-> self sound-id) :pitch (* 0.008 (the float gp-0))) ) (when (or (= gp-0 300) (and (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))) (nonzero? gp-0)) @@ -1791,7 +1634,7 @@ (if (nonzero? gp-0) (debug-percent-bar #t - (bucket-id debug-draw0) + (bucket-id debug) 192 160 (* 0.0033333334 (the float gp-0)) @@ -1808,13 +1651,11 @@ ) (none) ) - :post - (the-as (function none :behavior mistycannon) rider-post) + :post (the-as (function none :behavior mistycannon) rider-post) ) (defstate mistycannon-waiting-for-player-to-fuck-off (mistycannon) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'touch) (when ((method-of-type touching-shapes-entry prims-touching?) @@ -1831,16 +1672,13 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (the-as (function none :behavior mistycannon) rider-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior mistycannon) rider-trans) + :code (behavior () + (loop (suspend) (dummy-23 self) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -1849,8 +1687,7 @@ ) (none) ) - :post - (the-as (function none :behavior mistycannon) rider-post) + :post (the-as (function none :behavior mistycannon) rider-post) ) (defmethod init-from-entity! mistycannon ((obj mistycannon) (arg0 entity-actor)) @@ -1897,9 +1734,7 @@ (initialize-skeleton obj *mistycannon-sg* '()) (logior! (-> obj skel status) (janim-status inited)) (update-transforms! (-> obj root-override)) - (set! (-> obj skel prebind-function) - (the-as (function pointer int process-drawable none) mistycannon-prebind-function) - ) + (set! (-> obj skel prebind-function) mistycannon-prebind-function) (set! (-> obj skel postbind-function) mistycannon-postbind-function) (set! (-> obj fact-info-override) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) diff --git a/goal_src/levels/misty/mud.gc b/goal_src/levels/misty/mud.gc index 0beb7ced85..a51b0599a5 100644 --- a/goal_src/levels/misty/mud.gc +++ b/goal_src/levels/misty/mud.gc @@ -20,8 +20,7 @@ :count 3 :converted #f :normal-scale 1.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 40.0 :xdiv -1 :zdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75) @@ -34,8 +33,7 @@ :count 3 :converted #f :normal-scale 1.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 20.0 :xdiv 2 :speed 0.5) (new 'static 'ripple-wave :scale 20.0 :xdiv -2 :zdiv 2 :speed 0.5) (new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75) @@ -48,8 +46,8 @@ (let ((t9-0 (method-of-type water-anim TODO-RENAME-22))) (t9-0 obj) ) - (set! (-> obj flags) (logand -8388609 (-> obj flags))) - (set! (-> obj flags) (logior #x40000 (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt23)) + (set! (-> obj flags) (logior (water-flags wt18) (-> obj flags))) (let ((gp-0 (new 'process 'ripple-control))) (set! (-> obj draw ripple) gp-0) (set! (-> gp-0 global-scale) 3072.0) diff --git a/goal_src/levels/misty/muse.gc b/goal_src/levels/misty/muse.gc index 3690ab649b..be7ddcf094 100644 --- a/goal_src/levels/misty/muse.gc +++ b/goal_src/levels/misty/muse.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/muse-ag.gc") + (deftype muse (nav-enemy) ((root-override collide-shape-moving :offset 112) (current-path-index float :offset-assert 400) @@ -148,14 +150,7 @@ (defmethod dummy-51 muse ((obj muse)) (dotimes (s5-0 2) (let ((v1-2 (rand-vu-int-range 3 (+ (-> obj node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 271) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data v1-2)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 271) (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data v1-2))) ) ) 0 @@ -169,14 +164,11 @@ (none) ) -(defskelgroup *muse-sg* muse - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 3) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *muse-sg* muse muse-lod0-jg muse-idle-ja + ((muse-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3) + :shadow muse-shadow-mg + ) (defmethod dummy-44 muse ((obj muse) (arg0 process) (arg1 event-message-block)) (go muse-caught) @@ -189,16 +181,12 @@ nav-enemy-default-event-handler (defstate muse-idle (muse) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior muse) nav-enemy-default-event-handler ) - :trans - (behavior () - (set! (-> self sprint-distance) - (seek (-> self sprint-distance) 61440.0 (* 8192.0 (-> *display* seconds-per-frame))) - ) + :trans (behavior () + (seek! (-> self sprint-distance) 61440.0 (* 8192.0 (-> *display* seconds-per-frame))) (if (and *target* (>= 102400.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (level-hint-spawn (game-text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) ) @@ -207,78 +195,42 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 4) - ) - (ja-channel-push! 1 30) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + :code (behavior () + (when (ja-group? muse-run-ja) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :num! (loop!)) + (ja-no-eval :group! muse-run-to-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (while #t - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (loop + (ja-no-eval :group! muse-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (spool-push *art-control* (-> self anim name) 0 self -99.0) (dummy-51 self) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior muse) ja-post) + :post (the-as (function none :behavior muse) ja-post) ) (defstate nav-enemy-chase (muse) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior muse) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (cond ((or (not *target*) (< 102400.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) @@ -288,10 +240,9 @@ nav-enemy-default-event-handler (go muse-idle) ) ) - ((or (not *target*) - (< (-> self sprint-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) + ((or (not *target*) (< (-> self sprint-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) ) (set! (-> self target-speed) 40960.0) ) @@ -299,67 +250,34 @@ nav-enemy-default-event-handler (set! (-> self target-speed) 61440.0) ) ) - (set! (-> self sprint-distance) - (seek (-> self sprint-distance) 0.0 (* 4096.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self sprint-distance) 0.0 (* 4096.0 (-> *display* seconds-per-frame))) (muse-check-dest-point) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) - ) - (ja-channel-push! 1 30) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + ((ja-group? muse-idle-ja) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :num! (loop!)) + (ja-no-eval :group! muse-idle-to-run-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) ) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (ja :group! muse-run-ja :num! min) + (loop (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (* 0.000016276043 (-> self momentum-speed))) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! (* 0.000016276043 (-> self momentum-speed)))) ) (none) ) - :post - (behavior () + :post (behavior () (set! (-> self nav destination-pos quad) (-> self dest-point quad)) (dummy-19 (-> self nav) @@ -368,8 +286,8 @@ nav-enemy-default-event-handler (-> self nav destination-pos) 546133.3 ) - (if (logtest? (nav-control-flags bit21) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit10)) + (if (logtest? (nav-control-flags navcf21) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (nav-enemy-travel-post) (none) @@ -378,53 +296,32 @@ nav-enemy-default-event-handler (defstate nav-enemy-jump (muse) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior muse) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () ((-> (method-of-type nav-enemy nav-enemy-jump) enter)) - (set! (-> self nav-enemy-flags) (logand -513 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) (none) ) - :code - (-> (method-of-type nav-enemy nav-enemy-jump) code) + :code (-> (method-of-type nav-enemy nav-enemy-jump) code) ) (defstate nav-enemy-jump-land (muse) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior muse) nav-enemy-default-event-handler ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 22) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 0.8) - (set! (-> gp-0 frame-num) (ja-aframe 6.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! muse-run-ja :num! (seek! max 0.8) :frame-num (ja-aframe 6.0 0)) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 0.8) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.8)) ) (go-virtual nav-enemy-chase) (none) @@ -432,114 +329,89 @@ nav-enemy-default-event-handler ) (defstate muse-caught (muse) - :event - (the-as (function process int symbol event-message-block object :behavior muse) #f) - :trans - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior muse) #f) + :trans (behavior () (spool-push *art-control* (-> self anim name) 0 self -1.0) (none) ) - :code - (behavior () - (sound-play-by-name (static-sound-name "money-pickup") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (sound-play "money-pickup") (close-specific-task! (game-task misty-muse) (task-status need-reminder)) (process-entity-status! self (entity-perm-status dead) #t) (suspend) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 1) - (set! (-> a1-3 message) 'clone-anim) - (set! (-> a1-3 param 0) (the-as uint self)) - (when (send-event-function *target* a1-3) - (set-blackout-frames (seconds 10)) - (let ((gp-1 (res-lump-struct (-> self entity) 'movie-pos vector))) - (cond - (gp-1 - (move-to-point! (-> self collide-info) gp-1) - (set-yaw-angle-clear-roll-pitch! (-> self collide-info) (-> gp-1 w)) - ) - (else - (move-to-point! (-> self collide-info) (-> *target* control trans)) - (quaternion-copy! (-> self collide-info quat) (-> *target* control quat)) - (move-to-ground (-> self collide-info) 40960.0 40960.0 #f (collide-kind background)) - ) - ) - ) - (send-event *target* 'trans 'save (-> self old-target-pos)) - (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) - (send-event *target* 'blend-shape #t) - (if (!= *kernel-boot-message* 'play) - (set! (-> self trans-hook) - (lambda :behavior muse () (spool-push *art-control* (-> self victory-anim name) 0 self -1.0) (none)) - ) - ) - (push-setting! *setting-control* self 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) - (push-setting! *setting-control* self 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) - (push-setting! - *setting-control* - self - 'ambient-volume - 'rel - (-> *setting-control* current ambient-volume-movie) - 0 - ) - (logclear! (-> self mask) (process-mask enemy)) - (let ((gp-2 (get-process *default-dead-pool* othercam #x4000))) - (when gp-2 - (let ((t9-19 (method-of-type othercam activate))) - (t9-19 (the-as othercam gp-2) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-2 othercam-init-by-other self 3 #f #t) - (-> gp-2 ppointer) - ) - ) - (auto-save-command 'auto-save 0 0 *default-pool*) - (ja-play-spooled-anim - (-> self anim) - (the-as art-joint-anim (-> self draw art-group data 3)) - (the-as art-joint-anim (-> self draw art-group data 3)) - (the-as (function process-drawable symbol) false-func) - ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) - (clear-pending-settings-from-process *setting-control* self 'ambient-volume) - (send-event *target* 'blend-shape #f) + (when (send-event *target* 'clone-anim self) + (set-blackout-frames (seconds 10)) + (let ((gp-1 (res-lump-struct (-> self entity) 'movie-pos vector))) (cond - ((!= *kernel-boot-message* 'play) - (set-blackout-frames 0) - (ja-channel-set! 0) - (ja-post) - (clear-collide-with-as (-> self collide-info)) - (send-event *target* 'trans 'reset) - (let ((gp-4 (ppointer->handle (birth-pickup-at-point - (target-pos 0) - (pickup-type fuel-cell) - (the float (-> self entity extra perm task)) - #f - self - (the-as fact-info #f) - ) + (gp-1 + (move-to-point! (-> self collide-info) gp-1) + (set-yaw-angle-clear-roll-pitch! (-> self collide-info) (-> gp-1 w)) + ) + (else + (move-to-point! (-> self collide-info) (-> *target* control trans)) + (quaternion-copy! (-> self collide-info quat) (-> *target* control quat)) + (move-to-ground (-> self collide-info) 40960.0 40960.0 #f (collide-kind background)) + ) + ) + ) + (send-event *target* 'trans 'save (-> self old-target-pos)) + (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) + (send-event *target* 'blend-shape #t) + (if (!= *kernel-boot-message* 'play) + (set! (-> self trans-hook) + (lambda :behavior muse () (spool-push *art-control* (-> self victory-anim name) 0 self -1.0) (none)) + ) + ) + (add-setting! 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) + (add-setting! 'ambient-volume 'rel (-> *setting-control* current ambient-volume-movie) 0) + (logclear! (-> self mask) (process-mask enemy)) + (process-spawn othercam self 3 #f #t :to self) + (auto-save-command 'auto-save 0 0 *default-pool*) + (ja-play-spooled-anim + (-> self anim) + (the-as art-joint-anim muse-idle-ja) + (the-as art-joint-anim muse-idle-ja) + (the-as (function process-drawable symbol) false-func) + ) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) + (send-event *target* 'blend-shape #f) + (cond + ((!= *kernel-boot-message* 'play) + (set-blackout-frames 0) + (ja-channel-set! 0) + (ja-post) + (clear-collide-with-as (-> self collide-info)) + (send-event *target* 'trans 'reset) + (let ((gp-4 (ppointer->handle (birth-pickup-at-point + (target-pos 0) + (pickup-type fuel-cell) + (the float (-> self entity extra perm task)) + #f + self + (the-as fact-info #f) ) - ) - ) - (send-event (handle->process (the-as handle gp-4)) 'pickup) - (while (handle->process (the-as handle gp-4)) - (suspend) + ) + ) ) + (send-event (handle->process (the-as handle gp-4)) 'pickup) + (while (handle->process (the-as handle gp-4)) + (suspend) ) ) - (else - (send-event *target* 'trans 'restore (-> self old-target-pos)) - (set-blackout-frames 0) - (set-blackout-frames (seconds 0.1)) - ) + ) + (else + (send-event *target* 'trans 'restore (-> self old-target-pos)) + (set-blackout-frames 0) + (set-blackout-frames (seconds 0.1)) ) ) ) (none) ) - :post - (behavior () + :post (behavior () (dummy-51 self) (level-hint-surpress!) (kill-current-level-hint '() '() 'exit) @@ -596,7 +468,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -645,8 +517,7 @@ nav-enemy-default-event-handler :name "muse-victory" :index 9 :parts 2 - :command-list - '((1 blackout 0) (219 blackout 60)) + :command-list '((1 blackout 0) (219 blackout 60)) ) ) (set! (-> obj victory-anim) (fuel-cell-pick-anim obj)) diff --git a/goal_src/levels/misty/quicksandlurker.gc b/goal_src/levels/misty/quicksandlurker.gc index 7761c5d6d5..5a31d6be16 100644 --- a/goal_src/levels/misty/quicksandlurker.gc +++ b/goal_src/levels/misty/quicksandlurker.gc @@ -7,11 +7,12 @@ ;; DECOMP BEGINS +(import "goal_src/import/quicksandlurker-ag.gc") + (defpartgroup group-quicksandlurker-missile :id 198 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 2481 :flags (launch-asap) :binding 2479) + :parts ((sp-item 2481 :flags (launch-asap) :binding 2479) (sp-item 2479 :flags (start-dead) :binding 2480) (sp-item 2480 :flags (start-dead launch-asap)) (sp-item 2480 :flags (start-dead launch-asap)) @@ -63,8 +64,7 @@ ) (defpart 2481 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.01)) (sp-copy-from-other spt-scale-y -4) @@ -76,8 +76,7 @@ ) (defpart 2479 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 1)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -102,13 +101,11 @@ ) (defpart 2482 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) (defpart 2480 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 5.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -139,13 +136,11 @@ :id 199 :duration 5 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 2483)) + :parts ((sp-item 2483)) ) (defpart 2483 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -175,13 +170,11 @@ :id 200 :duration 10 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 2484) (sp-item 2485) (sp-item 2486)) + :parts ((sp-item 2484) (sp-item 2485) (sp-item 2486)) ) (defpart 2484 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 64.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -208,8 +201,7 @@ ) (defpart 2486 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -233,8 +225,7 @@ ) (defpart 2485 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -254,8 +245,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 124 :flags (is-3d) :period 900 :length 63) + :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) (sp-item 125 :period 900 :length 15) (sp-item 126 :flags (is-3d) :period 900 :length 15) (sp-item 127 :flags (is-3d) :period 900 :length 15) @@ -279,8 +269,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 124 :flags (is-3d) :period 900 :length 63) + :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) (sp-item 125 :period 900 :length 15) (sp-item 126 :flags (is-3d) :period 900 :length 15) (sp-item 127 :flags (is-3d) :period 900 :length 15) @@ -314,23 +303,12 @@ (defstate quicksandlurker-missile-idle (quicksandlurker-missile) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touched) (when (cond ((= (-> arg0 type) target) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((a2-1 (new 'static 'attack-info :mask #x20))) - (set! (-> a2-1 mode) 'explode) - (set! (-> a1-3 param 1) (the-as uint a2-1)) - ) - (send-event-function arg0 a1-3) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'explode)))) ) (else (let ((a1-4 (new 'stack-no-clear 'event-message-block))) @@ -354,20 +332,18 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior () + :code (behavior () (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) (fill-cache-integrate-and-collide! (-> self root-override) (-> self root-override transv) (-> self root-override root-prim collide-with) ) - (if (or (logtest? (-> self root-override status) 8) + (if (or (logtest? (-> self root-override status) (cshape-moving-flags twall)) (< (vector-vector-distance (-> self root-override trans) (the-as vector (-> self root-override trans-old))) 40.96 ) @@ -380,7 +356,7 @@ (the-as vector #f) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -389,42 +365,25 @@ (cleanup-for-death self) (none) ) - :post - (behavior () + :post (behavior () (update-transforms! (-> self root-override)) (none) ) ) (defstate quicksandlurker-missile-impact (quicksandlurker-missile) - :code - (behavior () - (sound-play-by-name - (static-sound-name "sack-land") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 200) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + :code (behavior () + (sound-play "sack-land" :position (the-as symbol (-> self root-override trans))) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 200) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -445,7 +404,7 @@ ) -(defbehavior quicksandlurker-missile-init-by-other quicksandlurker-missile ((arg0 quicksandlurker-missile-init-data) (arg1 entity)) +(defbehavior quicksandlurker-missile-init-by-other quicksandlurker-missile ((arg0 quicksandlurker-missile-init-data) (arg1 entity-actor)) (set! (-> self entity) arg1) (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -480,19 +439,11 @@ (none) ) -(defun spawn-quicksandlurker-missile ((arg0 process) (arg1 vector) (arg2 vector) (arg3 entity)) +(defun spawn-quicksandlurker-missile ((arg0 process) (arg1 vector) (arg2 vector) (arg3 entity-actor)) (let ((s5-0 (new 'stack-no-clear 'quicksandlurker-missile-init-data))) (set! (-> s5-0 position) arg1) (set! (-> s5-0 velocity) arg2) - (let ((s3-0 (get-process *default-dead-pool* quicksandlurker-missile #x4000))) - (when s3-0 - (let ((t9-1 (method-of-type quicksandlurker-missile activate))) - (t9-1 (the-as quicksandlurker-missile s3-0) arg0 'quicksandlurker-missile (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 quicksandlurker-missile-init-by-other s5-0 arg3) - (-> s3-0 ppointer) - ) - ) + (process-spawn quicksandlurker-missile s5-0 arg3 :to arg0) ) 0 (none) @@ -525,13 +476,10 @@ ) -(defskelgroup *quicksandlurker-sg* quicksandlurker - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *quicksandlurker-sg* quicksandlurker quicksandlurker-lod0-jg quicksandlurker-idle-ja + ((quicksandlurker-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) (defbehavior orient-to-face-target quicksandlurker () (if *target* @@ -540,7 +488,6 @@ ) ;; ERROR: function has no type analysis. Cannot decompile. -;; get-height-over-navmesh, unused. (defun intersects-nav-mesh? ((arg0 nav-control) (arg1 vector)) (if (dummy-16 arg0 arg1) @@ -622,20 +569,16 @@ ) (defstate quicksandlurker-idle (quicksandlurker) - :event - (the-as (function process int symbol event-message-block object :behavior quicksandlurker) #f) - :enter - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior quicksandlurker) #f) + :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -643,22 +586,18 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior quicksandlurker) ja-post) + :post (the-as (function none :behavior quicksandlurker) ja-post) ) (defstate quicksandlurker-wait (quicksandlurker) - :event - quicksandlurker-default-event-handler - :trans - (behavior () + :event quicksandlurker-default-event-handler + :trans (behavior () (cond ((and *target* (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (set! (-> self y-offset) 1228.8) @@ -667,118 +606,70 @@ ((or (not *target*) (< 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - (set! (-> self y-offset) (seek (-> self y-offset) -6553.6 (* 20480.0 (-> *display* seconds-per-frame)))) + (seek! (-> self y-offset) -6553.6 (* 20480.0 (-> *display* seconds-per-frame))) (if (= (-> self y-offset) -6553.6) (go quicksandlurker-idle) ) ) (else - (set! (-> self y-offset) (seek (-> self y-offset) 1228.8 (* 20480.0 (-> *display* seconds-per-frame)))) + (seek! (-> self y-offset) 1228.8 (* 20480.0 (-> *display* seconds-per-frame))) ) ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 1.5 2.0)))) (s5-0 5) (s4-0 0) ) - (ja-channel-push! 1 30) - (while #t + (ja-channel-push! 1 (seconds 0.1)) + (loop (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! quicksandlurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (+! s4-0 1) (when (< s5-0 s4-0) (set! s4-0 0) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! quicksandlurker-yawn-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (orient-to-face-target) - (let ((v1-55 (-> self skel root-channel 0))) - (set! (-> v1-55 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - ) - (let ((v1-58 (-> self skel root-channel 0))) - (set! (-> v1-58 num-func) num-func-identity) - (set! (-> v1-58 frame-num) 0.0) - ) + (ja :group! quicksandlurker-idle-ja) + (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) ) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) (defstate quicksandlurker-yawn (quicksandlurker) - :event - quicksandlurker-default-event-handler - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :event quicksandlurker-default-event-handler + :code (behavior () + (ja-no-eval :group! quicksandlurker-yawn-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go quicksandlurker-wait) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) (defstate quicksandlurker-track (quicksandlurker) - :event - quicksandlurker-default-event-handler - :trans - (behavior () + :event quicksandlurker-default-event-handler + :trans (behavior () (if (or (not *target*) (< 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -787,31 +678,18 @@ (quicksandlurker-check-hide-transition) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 0.8 1.2)))) (s5-0 1) (s4-0 0) ) - (while #t + (loop (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! quicksandlurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (+! s4-0 1) @@ -822,20 +700,14 @@ ) ) (orient-to-face-target) - (let ((v1-39 (-> self skel root-channel 0))) - (set! (-> v1-39 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - ) - (let ((v1-42 (-> self skel root-channel 0))) - (set! (-> v1-42 num-func) num-func-identity) - (set! (-> v1-42 frame-num) 0.0) - ) + (ja :group! quicksandlurker-idle-ja) + (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) ) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) (defbehavior quicksandlurker-spit quicksandlurker () @@ -849,37 +721,28 @@ (vector-normalize! s5-0 49152.0) (spawn-quicksandlurker-missile self gp-0 s5-0 (-> self entity)) ) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 199) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 199) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) ) (defstate quicksandlurker-attack (quicksandlurker) - :event - quicksandlurker-default-event-handler - :trans - quicksandlurker-check-hide-transition - :code - (behavior () + :event quicksandlurker-default-event-handler + :trans quicksandlurker-check-hide-transition + :code (behavior () (let ((gp-0 #f) (f30-0 51.0) ) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! quicksandlurker-spit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (orient-to-face-target) (when (and (not gp-0) (>= (ja-aframe-num 0) f30-0)) @@ -887,90 +750,53 @@ (quicksandlurker-spit) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (go quicksandlurker-track) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) (defstate quicksandlurker-victory (quicksandlurker) - :event - quicksandlurker-default-event-handler - :trans - quicksandlurker-check-hide-transition - :code - (behavior () - (ja-channel-push! 1 60) + :event quicksandlurker-default-event-handler + :trans quicksandlurker-check-hide-transition + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) (cond ((rand-vu-percent? 0.5) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! quicksandlurker-victory-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! quicksandlurker-victory2-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go quicksandlurker-track) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) (defstate quicksandlurker-hide (quicksandlurker) - :event - quicksandlurker-default-event-handler - :enter - (behavior () + :event quicksandlurker-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (restore-collide-with-as (-> self root-override)) (none) ) - :trans - (behavior () + :trans (behavior () (if (not *target*) (go quicksandlurker-wait) ) @@ -994,135 +820,77 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 0.75) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! quicksandlurker-hide-ja :num! (seek! max 0.75) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 0.75) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.75)) ) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 201) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 201) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (clear-collide-with-as (-> self root-override)) - (while #t + (loop (orient-to-face-target) (suspend) ) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) (defstate quicksandlurker-popup (quicksandlurker) - :trans - quicksandlurker-check-hide-transition - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 202) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) - ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) + :trans quicksandlurker-check-hide-transition + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 202) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) + (ja-no-eval :group! quicksandlurker-popup-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (orient-to-face-target) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go quicksandlurker-track) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) (defstate quicksandlurker-die (quicksandlurker) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior quicksandlurker) process-drawable-death-event-handler ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 60) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! quicksandlurker-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (cleanup-for-death self) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) (defmethod init-from-entity! quicksandlurker ((obj quicksandlurker) (arg0 entity-actor)) @@ -1173,7 +941,7 @@ (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (rand-vu-float-range 0.0 65536.0)) (initialize-skeleton obj *quicksandlurker-sg* '()) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj fact) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) diff --git a/goal_src/levels/misty/sidekick-human.gc b/goal_src/levels/misty/sidekick-human.gc index 4ca3a6c3b6..15ee3a5f7e 100644 --- a/goal_src/levels/misty/sidekick-human.gc +++ b/goal_src/levels/misty/sidekick-human.gc @@ -7,6 +7,11 @@ ;; DECOMP BEGINS +(import "goal_src/import/darkecocan-ag.gc") +(import "goal_src/import/sidekick-human-ag.gc") +(import "goal_src/import/evilbro-ag.gc") +(import "goal_src/import/evilsis-ag.gc") + (deftype sequenceA (process-hidden) () :method-count-assert 15 @@ -19,8 +24,7 @@ :id 657 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2665 :period 300 :length 5 :binding 2663) + :parts ((sp-item 2665 :period 300 :length 5 :binding 2663) (sp-item 2663 :flags (start-dead launch-asap) :binding 2664) (sp-item 2663 :flags (start-dead launch-asap) :binding 2664) (sp-item 2664 :flags (start-dead)) @@ -32,8 +36,7 @@ ) (defpart 2665 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2.5) (meters 5) 1.0) (sp-rnd-flt spt-y (meters -1.5) (meters 3) 1.0) @@ -49,8 +52,7 @@ ) (defpart 2663 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -73,8 +75,7 @@ ) (defpart 2664 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -93,8 +94,7 @@ ) (defpart 2667 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters -3.90625)) (sp-flt spt-scale-x (meters 15)) @@ -109,8 +109,7 @@ ) (defpart 2666 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.3) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters -3) (meters 6) 1.0) @@ -134,16 +133,14 @@ ) (defpart 2668 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 300 299 1) (sp-launcher-by-id spt-next-launcher 2669) ) ) (defpart 2669 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) (defpartgroup group-evilsib-appear @@ -151,8 +148,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2345 :period 1500 :length 20 :offset 1500) + :parts ((sp-item 2345 :period 1500 :length 20 :offset 1500) (sp-item 2346 :period 1500 :length 20 :offset 1500) (sp-item 2347 :period 1500 :length 5 :offset 1500) (sp-item 2348 :period 1500 :length 20 :offset 1500) @@ -413,8 +409,7 @@ ) (defpart 2349 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 0) (meters 0.1) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 4) 1.0) @@ -435,13 +430,11 @@ ) (defpart 2353 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) (defpart 2350 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 0) (meters 0.1) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 4) 1.0) @@ -465,8 +458,7 @@ ) (defpart 2351 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 0) (meters 0.3) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 2) 1.0) @@ -490,8 +482,7 @@ ) (defpart 2352 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 0) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -515,8 +506,7 @@ ) (defpart 2344 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -543,13 +533,11 @@ ) (defpart 2354 - :init-specs - ((sp-flt spt-fade-a -3.2)) + :init-specs ((sp-flt spt-fade-a -3.2)) ) (defpart 2345 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-y (meters 1) (meters 2) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.2) 1.0) @@ -577,13 +565,11 @@ ) (defpart 2355 - :init-specs - ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a 0.0)) ) (defpart 2346 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-y (meters 0) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.4) 1.0) @@ -611,8 +597,7 @@ ) (defpart 2347 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-rnd-flt spt-scale-x (meters 28) (meters 4) 1.0) @@ -629,8 +614,7 @@ ) (defpart 2348 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-y (meters 0.5) (meters 2) 1.0) (sp-rnd-flt spt-scale-x (meters 0.25) (meters 0.1) 1.0) @@ -653,8 +637,7 @@ :id 558 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2386 :binding 2385) + :parts ((sp-item 2386 :binding 2385) (sp-item 2385 :flags (bit1 start-dead launch-asap) :binding 2384) (sp-item 2385 :flags (bit1 start-dead launch-asap) :binding 2384) (sp-item 2385 :flags (bit1 start-dead launch-asap) :binding 2384) @@ -737,8 +720,7 @@ ) (defpart 2386 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) @@ -752,8 +734,7 @@ ) (defpart 2385 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-flt spt-y (meters 0)) @@ -781,13 +762,11 @@ ) (defpart 2388 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2389)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2389)) ) (defpart 2389 - :init-specs - ((sp-flt spt-vel-z (meters -0.008333334)) + :init-specs ((sp-flt spt-vel-z (meters -0.008333334)) (sp-flt spt-scalevel-x (meters -0.00041666668)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -1.0666667) @@ -795,8 +774,7 @@ ) (defpart 2384 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -820,13 +798,11 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2298)) + :parts ((sp-item 2298)) ) (defpart 2298 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.25) (meters 0.5) 1.0) @@ -851,8 +827,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2785 :period 1800 :length 5) + :parts ((sp-item 2785 :period 1800 :length 5) (sp-item 2786 :period 1800 :length 40) (sp-item 2787 :period 1800 :length 20) (sp-item 2788 :period 1800 :length 20) @@ -925,8 +900,7 @@ ) (defpart 2830 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 2) 1.0) @@ -945,8 +919,7 @@ ) (defpart 2786 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-y (meters -1.5) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -971,13 +944,11 @@ ) (defpart 2789 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) (defpart 2788 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 12.0) (sp-flt spt-scale-x (meters 0.3)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) @@ -994,8 +965,7 @@ ) (defpart 2785 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 24)) (sp-copy-from-other spt-scale-y -4) @@ -1010,8 +980,7 @@ ) (defpart 2787 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters -1.5) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -1041,8 +1010,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) + :parts ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) (sp-item 296 :flags (start-dead launch-asap) :binding 297) (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) (sp-item 296 :flags (start-dead launch-asap) :binding 297) @@ -1087,13 +1055,11 @@ :linger-duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2790)) + :parts ((sp-item 2790)) ) (defpart 2790 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1120,8 +1086,7 @@ ) (defpart 2822 - :init-specs - ((sp-flt spt-fade-a -0.1)) + :init-specs ((sp-flt spt-fade-a -0.1)) ) (deftype sequenceB (process-taskable) @@ -1149,46 +1114,31 @@ ) -(defskelgroup *sidekick-human-sg* sidekick-human - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *sidekick-human-sg* sidekick-human sidekick-human-lod0-jg sidekick-human-idle-ja + ((sidekick-human-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow sidekick-human-shadow-mg + ) -(defskelgroup *darkecocan-sg* darkecocan - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - ) +(defskelgroup *darkecocan-sg* darkecocan darkecocan-lod0-jg darkecocan-idle-ja + ((darkecocan-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) -(defskelgroup *darkecocan-glow-sg* darkecocan - 2 - 4 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - ) +(defskelgroup *darkecocan-glow-sg* darkecocan darkecocan-glow-lod0-jg darkecocan-idle-ja + ((darkecocan-glow-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) -(defskelgroup *evilbro-sg* evilbro - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - ) +(defskelgroup *evilbro-sg* evilbro evilbro-lod0-jg evilbro-idle-ja + ((evilbro-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) -(defskelgroup *evilsis-sg* evilsis - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - ) +(defskelgroup *evilsis-sg* evilsis evilsis-lod0-jg evilsis-idle-ja + ((evilsis-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) (deftype army-info (structure) ((pos vector :offset-assert 0) @@ -1202,69 +1152,56 @@ ) -(define - *lurker-army* - (the-as (array army-info) (new - 'static - 'boxed-array - :type army-info :length 9 :allocated-length 9 +(define *lurker-army* + (the-as (array army-info) (new 'static 'boxed-array :type army-info (new 'static 'army-info - :pos - (new 'static 'vector :x -920633.4 :y 83546.11 :z 4210409.5) + :pos (new 'static 'vector :x -920633.4 :y 83546.11 :z 4210409.5) :rot 28556.04 :skel 'babak ) (new 'static 'army-info - :pos - (new 'static 'vector :x -873488.4 :y 86441.984 :z 4225454.0) + :pos (new 'static 'vector :x -873488.4 :y 86441.984 :z 4225454.0) :rot 37861.24 :start-frame 5.0 :skel 'babak ) (new 'static 'army-info - :pos - (new 'static 'vector :x -905871.4 :y 83132.414 :z 4231934.0) + :pos (new 'static 'vector :x -905871.4 :y 83132.414 :z 4231934.0) :rot 32054.021 :start-frame 10.0 :skel 'babak ) (new 'static 'army-info - :pos - (new 'static 'vector :x -926765.06 :y 83496.96 :z 4236230.5) + :pos (new 'static 'vector :x -926765.06 :y 83496.96 :z 4236230.5) :rot 30001.652 :start-frame 15.0 :skel 'babak ) (new 'static 'army-info - :pos - (new 'static 'vector :x -893345.8 :y 83517.44 :z 4212961.5) + :pos (new 'static 'vector :x -893345.8 :y 83517.44 :z 4212961.5) :rot 32755.074 :start-frame 20.0 :skel 'babak ) (new 'static 'army-info - :pos - (new 'static 'vector :x -842797.06 :y 84041.73 :z 4218855.5) + :pos (new 'static 'vector :x -842797.06 :y 84041.73 :z 4218855.5) :rot 43916.402 :skel 'bonelurker ) (new 'static 'army-info - :pos - (new 'static 'vector :x -839274.5 :y 82644.99 :z 4248723.5) + :pos (new 'static 'vector :x -839274.5 :y 82644.99 :z 4248723.5) :rot 40510.715 :start-frame 6.0 :skel 'bonelurker ) (new 'static 'army-info - :pos - (new 'static 'vector :x -871485.44 :y 85909.51 :z 4243181.5) + :pos (new 'static 'vector :x -871485.44 :y 85909.51 :z 4243181.5) :rot 37046.043 :start-frame 12.0 :skel 'bonelurker ) (new 'static 'army-info - :pos - (new 'static 'vector :x -947523.56 :y 85835.77 :z 4219314.0) + :pos (new 'static 'vector :x -947523.56 :y 85835.77 :z 4219314.0) :rot 26980.078 :start-frame 18.0 :skel 'bonelurker @@ -1280,14 +1217,16 @@ (defbehavior evilsib-trans-hook-wait evilbro () (when (>= (ja-aframe-num 0) 425.0) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-2 (method-of-type part-tracker activate))) - (t9-2 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 part-tracker-init (-> *part-group-id-table* 557) -1 #f #f #f (-> self draw origin)) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 557) + -1 + #f + #f + #f + (-> self draw origin) + :to *entity-pool* ) (send-event self 'trans-hook evilsib-trans-hook-hover) ) @@ -1296,182 +1235,151 @@ ) (defmethod play-anim! sequenceB ((obj sequenceB) (arg0 symbol)) - (with-pp - (cond - (arg0 - (send-event *target* 'sidekick #f) - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj bonelurker) - (ppointer->handle - (when s5-0 - (let ((t9-2 (method-of-type manipy activate))) - (t9-2 (the-as manipy s5-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> obj root-override trans) (-> obj entity) *bonelurker-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj bonelurker)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj bonelurker)) 'center-joint 3) - (set-setting! *setting-control* pp 'music-volume-movie 'abs (the-as float 0.0) 0) - (set-setting! *setting-control* pp 'sfx-volume-movie 'abs (the-as float 0.0) 0) - (set-setting! *setting-control* pp 'ambient-volume-movie 'abs (the-as float 0.0) 0) - (dotimes (s5-1 9) - (let ((s4-0 (-> *lurker-army* s5-1))) - (cond - ((= (-> s4-0 skel) 'bonelurker) - (let ((s3-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj lurker-army s5-1) - (ppointer->handle (when s3-0 - (let ((t9-10 (method-of-type manipy activate))) - (t9-10 (the-as manipy s3-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 manipy-init (-> s4-0 pos) (-> obj entity) *bonelurker-sg* #f) - (-> s3-0 ppointer) - ) - ) - ) - ) - (let ((s3-1 (handle->process (-> obj lurker-army s5-1)))) - (when s3-1 - (set! (-> (the-as babak s3-1) draw light-index) (the-as uint 1)) - (set! (-> (the-as babak s3-1) draw level-index) (the-as uint (-> (level-get *level* 'misty) index))) + (cond + (arg0 + (send-event *target* 'sidekick #f) + (set! (-> obj bonelurker) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *bonelurker-sg* #f :to obj)) + ) + (send-event (handle->process (-> obj bonelurker)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj bonelurker)) 'center-joint 3) + (set-setting! 'music-volume-movie 'abs 0.0 0) + (set-setting! 'sfx-volume-movie 'abs 0.0 0) + (set-setting! 'ambient-volume-movie 'abs 0.0 0) + (dotimes (s5-1 9) + (let ((s4-0 (-> *lurker-army* s5-1))) + (cond + ((= (-> s4-0 skel) 'bonelurker) + (set! (-> obj lurker-army s5-1) + (ppointer->handle (manipy-spawn (-> s4-0 pos) (-> obj entity) *bonelurker-sg* #f :to obj)) ) + (let ((s3-1 (handle->process (-> obj lurker-army s5-1)))) + (when s3-1 + (set! (-> (the-as babak s3-1) draw light-index) (the-as uint 1)) + (set! (-> (the-as babak s3-1) draw level-index) (the-as uint (-> (level-get *level* 'misty) index))) ) ) - (else - (let ((s3-2 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj lurker-army s5-1) - (ppointer->handle (when s3-2 - (let ((t9-14 (method-of-type manipy activate))) - (t9-14 (the-as manipy s3-2) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s3-2 manipy-init (-> s4-0 pos) (-> obj entity) *babak-sg* #f) - (-> s3-2 ppointer) - ) - ) - ) - ) - (let ((s3-3 (handle->process (-> obj lurker-army s5-1)))) - (when s3-3 - (set! (-> (the-as babak s3-3) draw light-index) (the-as uint 1)) - (set! (-> (the-as babak s3-3) draw level-index) (the-as uint (-> (level-get *level* 'misty) index))) + ) + (else + (set! (-> obj lurker-army s5-1) + (ppointer->handle (manipy-spawn (-> s4-0 pos) (-> obj entity) *babak-sg* #f :to obj)) ) + (let ((s3-3 (handle->process (-> obj lurker-army s5-1)))) + (when s3-3 + (set! (-> (the-as babak s3-3) draw light-index) (the-as uint 1)) + (set! (-> (the-as babak s3-3) draw level-index) (the-as uint (-> (level-get *level* 'misty) index))) ) - (send-event (handle->process (-> obj lurker-army s5-1)) 'art-joint-anim "idle" 0) ) + (send-event (handle->process (-> obj lurker-army s5-1)) 'art-joint-anim "idle" 0) ) - (send-event (handle->process (-> obj lurker-army s5-1)) 'rot (-> s4-0 rot)) ) + (send-event (handle->process (-> obj lurker-army s5-1)) 'rot (-> s4-0 rot)) ) ) - ((!= (level-status *level* 'intro) 'active) - (return (get-art-elem obj)) - ) ) - (new 'static 'spool-anim - :name "sidekick-human-intro-sequence-b" - :index 5 - :parts 11 - :command-list - '((0 blackout 0) - (0 setting-reset ocean-off near) - (0 want-levels misty intro) - (0 display-level intro special) - (0 kill "money-1404") - (0 kill "money-1405") - (0 kill "money-1406") - (0 kill "money-1407") - (0 kill "money-1551") - (0 kill "money-1552") - (0 kill "money-1553") - (0 kill "balloonlurker-9") - (0 kill "balloonlurker-10") - (0 kill "balloonlurker-11") - (0 kill "balloonlurker-12") - (0 kill "balloonlurker-13") - (0 kill "balloonlurker-14") - (0 kill "keg-conveyor-8") - (0 kill "mistycannon-8") - (0 kill "muse-2") - (0 kill "mud-1") - (0 kill "mud-2") - (0 kill "mud-3") - (0 kill "mud-4") - (0 kill "mud-5") - (0 kill "mud-6") - (0 kill "mud-7") - (0 kill "mud-8") - (0 kill "mud-9") - (0 kill "mud-10") - (0 kill "mud-11") - (0 kill "dark-eco-pool-11") - (0 kill "sharkey-32") - (0 kill "sharkey-34") - (0 kill "sharkey-39") - (0 kill "sharkey-41") - (0 kill "bonelurker-14") - (0 kill "bonelurker-15") - (0 kill "bonelurker-16") - (0 kill "bonelurker-17") - (0 kill "bonelurker-18") - (0 kill "bonelurker-19") - (0 kill "bonelurker-20") - (0 kill "bonelurker-21") - (0 kill "bonelurker-22") - (0 kill "bonelurker-23") - (0 kill "bonelurker-24") - (0 kill "bonelurker-26") - (0 kill "babak-with-cannon-5") - (0 kill "babak-200") - (0 kill "babak-201") - (0 kill "babak-202") - (0 kill "babak-203") - (0 kill "babak-204") - (0 kill "babak-205") - (0 kill "babak-206") - (0 kill "babak-207") - (0 kill "babak-208") - (0 kill "babak-209") - (0 kill "babak-212") - (0 kill "quicksandlurker-5") - (0 kill "boatpaddle-4") - (0 kill "silostep-7") - (0 kill "silostep-8") - (0 kill "silostep-9") - (0 kill "silostep-10") - (0 kill "orb-cache-top-15") - (0 kill "windturbine-11") - (0 kill "teetertotter-5") - (0 kill "bone-platform-4") - (0 kill "misty-battle-controller-1") - (30 send-event self offset-army) - (196 joint "cameraB") - (196 shadow target #f) - (196 shadow self #f) - (380 send-event self evilbro) - (385 send-event "evilbro" draw #t) - (385 send-event "evilsis" draw #t) - (397 joint "camera") - (410 setting-reset ocean-off #t) - (456 joint "cameraB") - (546 joint "camera") - (701 joint "cameraB") - (701 setting-reset ocean-off near) - (776 joint "camera") - (776 setting-reset ocean-off #t) - (937 joint "cameraB") - (1027 joint "camera") - (1122 joint "cameraB") - (1221 joint "cameraB") - (1221 setting-reset ocean-off near) - (1280 alive "sequenceC-1") - (1281 save) - (1281 shadow target #t) - (1281 setting-unset ocean-off) - ) + ((!= (level-status *level* 'intro) 'active) + (return (get-art-elem obj)) + ) + ) + (new 'static 'spool-anim + :name "sidekick-human-intro-sequence-b" + :index 5 + :parts 11 + :command-list '((0 blackout 0) + (0 setting-reset ocean-off near) + (0 want-levels misty intro) + (0 display-level intro special) + (0 kill "money-1404") + (0 kill "money-1405") + (0 kill "money-1406") + (0 kill "money-1407") + (0 kill "money-1551") + (0 kill "money-1552") + (0 kill "money-1553") + (0 kill "balloonlurker-9") + (0 kill "balloonlurker-10") + (0 kill "balloonlurker-11") + (0 kill "balloonlurker-12") + (0 kill "balloonlurker-13") + (0 kill "balloonlurker-14") + (0 kill "keg-conveyor-8") + (0 kill "mistycannon-8") + (0 kill "muse-2") + (0 kill "mud-1") + (0 kill "mud-2") + (0 kill "mud-3") + (0 kill "mud-4") + (0 kill "mud-5") + (0 kill "mud-6") + (0 kill "mud-7") + (0 kill "mud-8") + (0 kill "mud-9") + (0 kill "mud-10") + (0 kill "mud-11") + (0 kill "dark-eco-pool-11") + (0 kill "sharkey-32") + (0 kill "sharkey-34") + (0 kill "sharkey-39") + (0 kill "sharkey-41") + (0 kill "bonelurker-14") + (0 kill "bonelurker-15") + (0 kill "bonelurker-16") + (0 kill "bonelurker-17") + (0 kill "bonelurker-18") + (0 kill "bonelurker-19") + (0 kill "bonelurker-20") + (0 kill "bonelurker-21") + (0 kill "bonelurker-22") + (0 kill "bonelurker-23") + (0 kill "bonelurker-24") + (0 kill "bonelurker-26") + (0 kill "babak-with-cannon-5") + (0 kill "babak-200") + (0 kill "babak-201") + (0 kill "babak-202") + (0 kill "babak-203") + (0 kill "babak-204") + (0 kill "babak-205") + (0 kill "babak-206") + (0 kill "babak-207") + (0 kill "babak-208") + (0 kill "babak-209") + (0 kill "babak-212") + (0 kill "quicksandlurker-5") + (0 kill "boatpaddle-4") + (0 kill "silostep-7") + (0 kill "silostep-8") + (0 kill "silostep-9") + (0 kill "silostep-10") + (0 kill "orb-cache-top-15") + (0 kill "windturbine-11") + (0 kill "teetertotter-5") + (0 kill "bone-platform-4") + (0 kill "misty-battle-controller-1") + (30 send-event self offset-army) + (196 joint "cameraB") + (196 shadow target #f) + (196 shadow self #f) + (380 send-event self evilbro) + (385 send-event "evilbro" draw #t) + (385 send-event "evilsis" draw #t) + (397 joint "camera") + (410 setting-reset ocean-off #t) + (456 joint "cameraB") + (546 joint "camera") + (701 joint "cameraB") + (701 setting-reset ocean-off near) + (776 joint "camera") + (776 setting-reset ocean-off #t) + (937 joint "cameraB") + (1027 joint "camera") + (1122 joint "cameraB") + (1221 joint "cameraB") + (1221 setting-reset ocean-off near) + (1280 alive "sequenceC-1") + (1281 save) + (1281 shadow target #t) + (1281 setting-unset ocean-off) ) ) ) @@ -1482,8 +1390,7 @@ (defstate play-anim (sequenceB) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('offset-army) (dotimes (gp-0 9) @@ -1497,18 +1404,9 @@ (when (= (level-status *level* 'intro) 'active) (let ((gp-2 (entity-by-name "evilbro-2"))) (when gp-2 - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self evilbro) - (ppointer->handle (when s5-0 - (let ((t9-4 (method-of-type manipy activate))) - (t9-4 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> self root-override trans) gp-2 *evilbro-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> self evilbro) + (ppointer->handle (manipy-spawn (-> self root-override trans) gp-2 *evilbro-sg* #f :to self)) + ) (let ((gp-3 (handle->process (-> self evilbro)))) (when gp-3 (set! (-> (the-as evilbro gp-3) draw light-index) (the-as uint 1)) @@ -1533,18 +1431,9 @@ ) (let ((gp-4 (entity-by-name "evilsis-2"))) (when gp-4 - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self evilsis) - (ppointer->handle (when s5-1 - (let ((t9-15 (method-of-type manipy activate))) - (t9-15 (the-as manipy s5-1) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> self root-override trans) gp-4 *evilsis-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> self evilsis) + (ppointer->handle (manipy-spawn (-> self root-override trans) gp-4 *evilsis-sg* #f :to self)) + ) (let ((gp-5 (handle->process (-> self evilsis)))) (when gp-5 (set! (-> (the-as evilsis gp-5) draw light-index) (the-as uint 1)) @@ -1571,8 +1460,7 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (send-event *target* 'sidekick #t) (let ((a0-2 (handle->process (-> self bonelurker)))) (if a0-2 @@ -1610,8 +1498,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "sidekick-human-intro-sequence-c" 0 self (the-as float -1.0)) ((-> (method-of-type process-taskable play-anim) trans)) (none) @@ -1641,14 +1528,16 @@ (spawn (-> self part) gp-0) ) (when (>= (ja-aframe-num 0) 1590.0) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 561) -1 #f #f #f (-> self draw origin)) - (-> gp-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 561) + -1 + #f + #f + #f + (-> self draw origin) + :to *entity-pool* ) (send-event self 'trans-hook nothing) ) @@ -1667,119 +1556,96 @@ ) (defmethod play-anim! sequenceC ((obj sequenceC) (arg0 symbol)) - (with-pp - (when arg0 - (set-setting! *setting-control* pp 'music-volume-movie 'abs (the-as float 0.0) 0) - (set-setting! *setting-control* pp 'sfx-volume-movie 'abs (the-as float 0.0) 0) - (set-setting! *setting-control* pp 'ambient-volume-movie 'abs (the-as float 0.0) 0) - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj bonelurker) - (ppointer->handle - (when s5-0 - (let ((t9-4 (method-of-type manipy activate))) - (t9-4 (the-as manipy s5-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> obj root-override trans) (-> obj entity) *bonelurker-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj bonelurker)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj bonelurker)) 'center-joint 3) - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj darkecocan) - (ppointer->handle - (when s5-1 - (let ((t9-9 (method-of-type manipy activate))) - (t9-9 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *darkecocan-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj darkecocan)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj darkecocan)) 'center-joint 3) - (send-event (handle->process (-> obj darkecocan)) 'trans-hook sequenceC-can-trans-hook) - (send-event - (handle->process (-> obj darkecocan)) - 'eval - (lambda :behavior sequenceC - () - ((method-of-type lod-set setup-lods!) - (the-as lod-set (&-> (the-as process-taskable (-> self parent 0)) stack 288)) - *darkecocan-glow-sg* - (-> self draw art-group) - (-> (the-as process-taskable (-> self parent 0)) entity) - ) - (let ((v0-1 (create-launch-control (-> *part-group-id-table* 560) self))) - (set! (-> self part) v0-1) - v0-1 - ) + (when arg0 + (set-setting! 'music-volume-movie 'abs 0.0 0) + (set-setting! 'sfx-volume-movie 'abs 0.0 0) + (set-setting! 'ambient-volume-movie 'abs 0.0 0) + (set! (-> obj bonelurker) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *bonelurker-sg* #f :to obj)) + ) + (send-event (handle->process (-> obj bonelurker)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj bonelurker)) 'center-joint 3) + (set! (-> obj darkecocan) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *darkecocan-sg* #f :to obj)) + ) + (send-event (handle->process (-> obj darkecocan)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj darkecocan)) 'center-joint 3) + (send-event (handle->process (-> obj darkecocan)) 'trans-hook sequenceC-can-trans-hook) + (send-event + (handle->process (-> obj darkecocan)) + 'eval + (lambda :behavior sequenceC + () + ((method-of-type lod-set setup-lods!) + (the-as lod-set (&-> (the-as process-taskable (-> self parent 0)) stack 288)) + *darkecocan-glow-sg* + (-> self draw art-group) + (-> (the-as process-taskable (-> self parent 0)) entity) + ) + (let ((v0-1 (create-launch-control (-> *part-group-id-table* 560) self))) + (set! (-> self part) v0-1) + v0-1 ) ) ) - (the-as basic (new 'static 'spool-anim - :name "sidekick-human-intro-sequence-c" - :index 6 - :parts 22 - :command-list - '((0 blackout 0) - (0 kill "fuel-cell-11") - (0 kill "fuel-cell-50") - (0 kill "money-1561") - (0 kill "money-1562") - (0 kill "money-1563") - (0 kill "money-1564") - (0 kill "money-1565") - (5 alive "dark-eco-pool-11") - (151 joint "cameraB") - (200 want-levels misty village1) - (236 joint "camera") - (301 joint "cameraB") - (421 joint "camera") - (460 shadow self #f) - (470 shadow self #t) - (496 joint "cameraB") - (611 joint "camera") - (721 joint "cameraB") - (1176 joint "camera") - (1271 joint "cameraB") - (1331 joint "camera") - (1386 joint "cameraB") - (1461 joint "camera") - (1524 joint "cameraB") - (1558 joint "camera") - (1602 joint "cameraB") - (1628 joint "camera") - (1676 joint "cameraB") - (1728 joint "camera") - (1791 joint "cameraB") - (1831 joint "camera") - (1942 joint "cameraB") - (2000 display-level village1 special) - (2028 joint "camera") - (2096 joint "cameraB") - (2154 joint "camera") - (2226 joint "cameraB") - (2266 joint "camera") - (2307 joint "cameraB") - (2431 joint "camera") - (2476 joint "cameraB") - (2530 display-level misty movie) - (2530 want-force-vis misty #t) - (2530 dead "dark-eco-pool-11") - (2534 display-level village1 display) - (2535 want-vis vi1) - (2536 joint "camera") - (2580 alive "sage-23") - (2596 save) - ) - ) - ) ) + (the-as basic (new 'static 'spool-anim + :name "sidekick-human-intro-sequence-c" + :index 6 + :parts 22 + :command-list '((0 blackout 0) + (0 kill "fuel-cell-11") + (0 kill "fuel-cell-50") + (0 kill "money-1561") + (0 kill "money-1562") + (0 kill "money-1563") + (0 kill "money-1564") + (0 kill "money-1565") + (5 alive "dark-eco-pool-11") + (151 joint "cameraB") + (200 want-levels misty village1) + (236 joint "camera") + (301 joint "cameraB") + (421 joint "camera") + (460 shadow self #f) + (470 shadow self #t) + (496 joint "cameraB") + (611 joint "camera") + (721 joint "cameraB") + (1176 joint "camera") + (1271 joint "cameraB") + (1331 joint "camera") + (1386 joint "cameraB") + (1461 joint "camera") + (1524 joint "cameraB") + (1558 joint "camera") + (1602 joint "cameraB") + (1628 joint "camera") + (1676 joint "cameraB") + (1728 joint "camera") + (1791 joint "cameraB") + (1831 joint "camera") + (1942 joint "cameraB") + (2000 display-level village1 special) + (2028 joint "camera") + (2096 joint "cameraB") + (2154 joint "camera") + (2226 joint "cameraB") + (2266 joint "camera") + (2307 joint "cameraB") + (2431 joint "camera") + (2476 joint "cameraB") + (2530 display-level misty movie) + (2530 want-force-vis misty #t) + (2530 dead "dark-eco-pool-11") + (2534 display-level village1 display) + (2535 want-vis vi1) + (2536 joint "camera") + (2580 alive "sage-23") + (2596 save) + ) + ) + ) ) (defmethod get-art-elem sequenceC ((obj sequenceC)) @@ -1788,8 +1654,7 @@ (defstate play-anim (sequenceC) :virtual #t - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self bonelurker)))) (if a0-1 (deactivate a0-1) @@ -1804,8 +1669,7 @@ (start 'play (get-continue-by-name *game-info* "village1-intro")) (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "sage-intro-sequence-d1" 0 self (the-as float -1.0)) ((-> (method-of-type process-taskable play-anim) trans)) (none) @@ -1820,14 +1684,16 @@ (when (>= (ja-aframe-num 0) 1655.0) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (-> self node-list data 3)) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker s5-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 part-tracker-init (-> *part-group-id-table* 562) -1 #f #f #f gp-0) - (-> s5-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 562) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (set! (-> self cur-trans-hook) nothing) diff --git a/goal_src/levels/ogre/flying-lurker.gc b/goal_src/levels/ogre/flying-lurker.gc index 97a58a090d..574371e7d8 100644 --- a/goal_src/levels/ogre/flying-lurker.gc +++ b/goal_src/levels/ogre/flying-lurker.gc @@ -5,17 +5,16 @@ ;; name in dgo: flying-lurker ;; dgos: L1, OGR -(declare-type flying-lurker process-drawable) - ;; DECOMP BEGINS -(defskelgroup *ogrecam-sg* ogrecam - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 6) - :longest-edge (meters 0) - ) +(import "goal_src/import/ogrecam-ag.gc") +(import "goal_src/import/plunger-lurker-ag.gc") +(import "goal_src/import/flying-lurker-ag.gc") + +(defskelgroup *ogrecam-sg* ogrecam ogrecam-lod0-jg -1 + ((ogrecam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 6) + ) (deftype plunger-lurker (process-drawable) ((alt-actor entity-actor :offset-assert 176) @@ -34,39 +33,29 @@ ) -(defskelgroup *plunger-lurker-sg* plunger-lurker - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 2 4 0 12) - :longest-edge (meters 0) - ) +(defskelgroup *plunger-lurker-sg* plunger-lurker plunger-lurker-lod0-jg plunger-lurker-idle-ja + ((plunger-lurker-lod0-mg (meters 20)) + (plunger-lurker-lod1-mg (meters 40)) + (plunger-lurker-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 2 4 0 12) + ) (defstate plunger-lurker-plunge (plunger-lurker) - :code - (behavior () - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) + :code (behavior () + (set-setting! 'allow-progress #f 0.0 0) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) - (while (or (not *target*) (logtest? (-> *target* state-flags) #x8008)) + (while (or (not *target*) (logtest? (-> *target* state-flags) (state-flags being-attacked dying))) (suspend) ) (while (not (process-grab? *target*)) (suspend) ) - (let* ((gp-0 (get-process *default-dead-pool* manipy #x4000)) - (gp-1 - (ppointer->handle - (when gp-0 - (let ((t9-4 (method-of-type manipy activate))) - (t9-4 (the-as manipy gp-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 manipy-init (-> self entity extra trans) (-> self entity) *ogrecam-sg* #f) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 + (ppointer->handle (manipy-spawn (-> self entity extra trans) (-> self entity) *ogrecam-sg* #f :to self)) + ) + ) (let ((s5-0 (the-as othercam (get-process *default-dead-pool* othercam #x4000)))) (ppointer->handle (when s5-0 (let ((t9-7 (method-of-type othercam activate))) @@ -109,8 +98,7 @@ :name "plunger-lurker-blowup" :index 7 :parts 4 - :command-list - '((200 alive "tntbarrel-223") + :command-list '((200 alive "tntbarrel-223") (200 alive "tntbarrel-222") (200 alive "tntbarrel-221") (200 alive "tntbarrel-220") @@ -139,7 +127,7 @@ ) ) (the-as art-joint-anim #f) - (the-as art-joint-anim (-> self draw art-group data 4)) + (the-as art-joint-anim plunger-lurker-idle-ja) (the-as (function process-drawable symbol) false-func) ) (if (handle->process gp-1) @@ -164,60 +152,19 @@ (process-release? *target*) (suspend) 0 - (let ((a1-15 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-15 from) self) - (set! (-> a1-15 num-params) 2) - (set! (-> a1-15 message) 'attack-invinc) - (set! (-> a1-15 param 0) (the-as uint #f)) - (let ((a0-37 (new 'static 'array uint32 26 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x20 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - ) - ) - ) - (set! (-> a0-37 17) (the-as uint 'instant-death)) - (set! (-> a1-15 param 1) (the-as uint a0-37)) - ) - (send-event-function *target* a1-15) - ) + (send-event *target* 'attack-invinc #f (static-attack-info ((mode 'instant-death)))) (cleanup-for-death self) (deactivate self) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior plunger-lurker) ja-post) + :post (the-as (function none :behavior plunger-lurker) ja-post) ) (defstate plunger-lurker-flee (plunger-lurker) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'attack) (let ((v0-0 #t)) @@ -228,8 +175,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (-> self got-hit) (close-specific-task! (game-task plunger-lurker-hit) (task-status need-hint)) (process-entity-status! self (entity-perm-status complete) #t) @@ -240,68 +186,43 @@ *entity-pool* (game-task none) ) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 part-tracker-init (-> *part-group-id-table* 474) -1 #f #f #f (-> self root trans)) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 474) + -1 + #f + #f + #f + (-> self root trans) + :to *entity-pool* ) (cleanup-for-death self) (deactivate self) ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! plunger-lurker-notice-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! plunger-lurker-death-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior plunger-lurker) ja-post) + :post (the-as (function none :behavior plunger-lurker) ja-post) ) (defstate plunger-lurker-idle (plunger-lurker) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('plunge) (logclear! (-> self mask) (process-mask actor-pause)) @@ -309,8 +230,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "plunger-lurker-blowup" 0 self -99.0) (when (and *target* (< (vector-vector-distance-squared (-> self root trans) (target-pos 0)) 6710886400.0)) (logclear! (-> self mask) (process-mask actor-pause)) @@ -318,36 +238,21 @@ ) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! plunger-lurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior plunger-lurker) ja-post) + :post (the-as (function none :behavior plunger-lurker) ja-post) ) (defstate plunger-lurker-die (plunger-lurker) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (deactivate self) (suspend) @@ -423,14 +328,15 @@ ) -(defskelgroup *flying-lurker-sg* flying-lurker - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 2 0 6) - :longest-edge (meters 2.3) - :shadow 4 - ) +(defskelgroup *flying-lurker-sg* flying-lurker flying-lurker-lod0-jg flying-lurker-fly-ja + ((flying-lurker-lod0-mg (meters 20)) + (flying-lurker-lod1-mg (meters 40)) + (flying-lurker-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 2 0 6) + :longest-edge (meters 2.3) + :shadow flying-lurker-shadow-mg + ) (defmethod dummy-20 flying-lurker ((obj flying-lurker)) (with-pp @@ -448,7 +354,16 @@ (set! (-> a1-1 quad) (-> obj root trans quad)) (set! (-> a1-1 y) (+ -8192.0 (-> a1-1 y))) (set-vector! a2-0 0.0 -81920.0 0.0 1.0) - (when (>= (fill-and-probe-using-line-sphere *collide-cache* a1-1 a2-0 8192.0 (collide-kind background) pp s3-1 1) + (when (>= (fill-and-probe-using-line-sphere + *collide-cache* + a1-1 + a2-0 + 8192.0 + (collide-kind background) + pp + s3-1 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (set! (-> s3-1 intersect w) 8192.0) @@ -457,7 +372,7 @@ ) (set! s4-0 #t) (let ((v1-17 s5-0)) - (set! (-> v1-17 settings flags) (logand -33 (-> v1-17 settings flags))) + (logclear! (-> v1-17 settings flags) (shadow-flags disable-draw)) ) 0 (let ((v1-19 s5-0)) @@ -495,7 +410,7 @@ ) ) (when (not s4-0) - (logior! (-> s5-0 settings flags) 32) + (logior! (-> s5-0 settings flags) (shadow-flags disable-draw)) 0 (set! (-> obj draw bounds quad) (-> obj default-bounds quad)) (set! (-> obj draw origin-joint-index) (the-as uint 4)) @@ -510,7 +425,7 @@ (set! (-> self try-counted) #t) (let ((gp-0 (-> self entity extra perm))) (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) - (set! (-> gp-0 user-int8 0) (seekl (-> gp-0 user-int8 0) 255 1)) + (seekl! (-> gp-0 user-int8 0) 255 1) (set! (-> self try-count) (the-as uint (-> gp-0 user-int8 0))) ) ) @@ -523,8 +438,7 @@ ) (defstate flying-lurker-die (flying-lurker) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (deactivate self) (none) @@ -532,11 +446,10 @@ ) (defstate flying-lurker-sleep (flying-lurker) - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self draw status) (draw-status hidden)) - (while #t + (loop (suspend) ) (none) @@ -579,7 +492,13 @@ (set! (-> self speed) (+ (* (+ 0.5 f0-12) (- arg2 arg3)) arg3)) ) ) - (set! (-> self y-offset-desired) (fmin 65536.0 (fmax 0.0 (* 1.6 (- 40960.0 (fmin (- f28-0) f30-0)))))) + ;; PAL patch here + (let ((f0-16 65536.0)) + (if (and (< 0.6332 (-> self curve-position)) (< (-> self curve-position) 0.6928)) + (set! f0-16 40960.0) + ) + (set! (-> self y-offset-desired) (fmin f0-16 (fmax 0.0 (* 1.6 (- 40960.0 (fmin (- f28-0) f30-0)))))) + ) ) ) ) @@ -671,8 +590,7 @@ ) (defstate flying-lurker-fly (flying-lurker) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'clone-and-kill-links) @@ -773,14 +691,12 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (dummy-20 self) (when (not (movie?)) (flying-lurker-calc-speed (meters 15.0) (meters 30.0) (meters 0.11666667) (meters 0.083333336)) @@ -812,43 +728,20 @@ ) (none) ) - :code - (behavior () - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) - ) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 param 0) (flying-lurker-calc-anim-speed)) - (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-loop!) + :code (behavior () + (loop + (when (not (ja-group? flying-lurker-fly-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! flying-lurker-fly-ja) ) + (ja :num! (loop! (flying-lurker-calc-anim-speed))) (suspend) (when (>= (- (-> *display* base-frame-counter) (-> self last-look-time)) (-> self time-to-next-look)) - (ja-channel-push! 1 60) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! flying-lurker-look-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self last-look-time) (-> *display* base-frame-counter)) (let* ((f30-0 300.0) @@ -863,8 +756,7 @@ ) (none) ) - :post - (the-as (function none :behavior flying-lurker) ja-post) + :post (the-as (function none :behavior flying-lurker) ja-post) ) (defbehavior flying-lurker-handler flying-lurker ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) @@ -957,8 +849,8 @@ (logclear! (-> self mask) (process-mask actor-pause)) (close-specific-task! (game-task plunger-lurker-hit) (task-status unknown)) (while (and *target* - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) (suspend) ) @@ -976,19 +868,10 @@ (suspend) (kill-current-level-hint '() '() 'die) (suspend) - (let* ((gp-0 (get-process *default-dead-pool* manipy #x4000)) - (gp-1 - (ppointer->handle - (when gp-0 - (let ((t9-5 (method-of-type manipy activate))) - (t9-5 (the-as manipy gp-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 manipy-init (-> self entity extra trans) (-> self entity) *ogrecam-sg* #f) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 + (ppointer->handle (manipy-spawn (-> self entity extra trans) (-> self entity) *ogrecam-sg* #f :to self)) + ) + ) (let ((s5-0 (the-as othercam (get-process *default-dead-pool* othercam #x4000)))) (ppointer->handle (when s5-0 (let ((t9-8 (method-of-type othercam activate))) @@ -1038,53 +921,43 @@ ) ) (process-release? *target*) - (let ((gp-2 (get-process *default-dead-pool* process #x4000))) - (when gp-2 - (let ((t9-18 (method-of-type process activate))) - (t9-18 gp-2 self 'process (the-as pointer #x70004000)) + (process-spawn-function + process + (lambda :behavior process + () + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) + (suspend) + ) ) - (run-next-time-in-process gp-2 (lambda :behavior process - () - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) - (suspend) - ) - ) - (level-hint-spawn - (game-text-id assistant-voicebox-intro-ogre-race) - "asstvb24" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (none) - ) - ) - (-> gp-2 ppointer) + (level-hint-spawn + (game-text-id assistant-voicebox-intro-ogre-race) + "asstvb24" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + (none) ) + :to self ) (none) ) (defstate flying-lurker-start (flying-lurker) - :event - flying-lurker-handler - :exit - (behavior () - (clear-pending-settings-from-process *setting-control* self 'allow-progress) + :event flying-lurker-handler + :exit (behavior () + (remove-setting! 'allow-progress) (none) ) - :code - (behavior () + :code (behavior () (when (play-movie?) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (flying-lurker-play-intro) ) (flying-lurker-inc-try-count) (ja-channel-set! 1) - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) + (ja :group! flying-lurker-fly-ja) (let* ((v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-9 (the-as float (logior #x3f800000 v1-8))) (f0-2 (+ -1.0 v1-9)) @@ -1112,13 +985,11 @@ ) (none) ) - :post - (the-as (function none :behavior flying-lurker) ja-post) + :post (the-as (function none :behavior flying-lurker) ja-post) ) (defstate flying-lurker-clone (flying-lurker) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'die) @@ -1204,21 +1075,18 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (ja-channel-set! 0) (none) ) - :code - (behavior ((arg0 handle) (arg1 string)) + :code (behavior ((arg0 handle) (arg1 string)) (clone-anim arg0 3 #t arg1) (none) ) ) (defstate flying-lurker-idle (flying-lurker) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('saw-player) (set! (-> self take-off) #t) @@ -1283,21 +1151,18 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "flying-lurker-intro" 0 self -99.0) (if (and (-> self take-off) (first?)) (go flying-lurker-start) ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (gp-0 int) (f30-0 float)) 1.0 0 @@ -1315,7 +1180,7 @@ (set! gp-0 11) ) ) - (while #t + (loop (cond ((play-movie?) (ja-channel-set! 0) @@ -1336,28 +1201,14 @@ 0 ) (else - (let ((v1-27 (-> self skel root-channel 0))) - (set! (-> v1-27 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) f30-0) - (set! (-> a0-9 frame-num) (the float gp-0)) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja :group! flying-lurker-fly-ja) + (ja-no-eval :group! flying-lurker-fly-ja :num! (seek! max f30-0) :frame-num (the float gp-0)) (until (ja-done? 0) (if (and *target* (>= 172032.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (send-event self 'saw-player) ) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) f30-0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (set! gp-0 0) ) @@ -1365,8 +1216,7 @@ ) (none) ) - :post - (the-as (function none :behavior flying-lurker) ja-post) + :post (the-as (function none :behavior flying-lurker) ja-post) ) (defmethod init-from-entity! flying-lurker ((obj flying-lurker) (arg0 entity-actor)) @@ -1403,7 +1253,7 @@ (new 'process 'shadow-control 131072.0 151552.0 614400.0 (the-as float 60) 409600.0) ) (let ((v1-27 (-> obj draw shadow-ctrl))) - (set! (-> v1-27 settings flags) (logand -33 (-> v1-27 settings flags))) + (logclear! (-> v1-27 settings flags) (shadow-flags disable-draw)) ) 0 (set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) diff --git a/goal_src/levels/ogre/ogre-obs.gc b/goal_src/levels/ogre/ogre-obs.gc index 78e3fac564..191258d630 100644 --- a/goal_src/levels/ogre/ogre-obs.gc +++ b/goal_src/levels/ogre/ogre-obs.gc @@ -5,41 +5,27 @@ ;; name in dgo: ogre-obs ;; dgos: L1, OGR -(define-extern *shortcut-boulder-whole-sg* skeleton-group) -(define-extern *shortcut-boulder-broken-sg* skeleton-group) -(define-extern *ogre-bridgeend-sg* skeleton-group) -(define-extern *ogre-bridge-sg* skeleton-group) -(define-extern *ogre-isle-d-sg* skeleton-group) -(define-extern *ogre-isle-b-sg* skeleton-group) -(define-extern *ogre-step-b-sg* skeleton-group) -(define-extern *ogre-step-c-sg* skeleton-group) -(define-extern *ogre-step-a-sg* skeleton-group) -(define-extern *tntbarrel-sg* skeleton-group) -(define-extern *med-res-snow-sg* skeleton-group) -(define-extern *ogre-isle-a-sg* skeleton-group) -(define-extern *ogre-isle-c-sg* skeleton-group) - -(declare-type ogre-bridgeend process-drawable) -(declare-type ogre-bridge process-drawable) -(declare-type shortcut-boulder process-drawable) - ;; DECOMP BEGINS -(defskelgroup *med-res-snow-sg* medres-snow - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -390 150 70 410) - :longest-edge (meters 0) - ) +(import "goal_src/import/ogre-step-ag.gc") +(import "goal_src/import/tntbarrel-ag.gc") +(import "goal_src/import/ogre-bridge-ag.gc") +(import "goal_src/import/shortcut-boulder-ag.gc") +(import "goal_src/import/medres-snow-ag.gc") +(import "goal_src/import/ogre-bridgeend-ag.gc") +(import "goal_src/import/ogre-isle-ag.gc") + +(defskelgroup *med-res-snow-sg* medres-snow medres-snow-lod0-jg medres-snow-idle-ja + ((medres-snow-lod0-mg (meters 999999))) + :bounds (static-spherem -390 150 70 410) + ) (defpartgroup group-tntbarrel-BIG-explosion :id 473 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2234 :period 3000 :length 5) + :parts ((sp-item 2234 :period 3000 :length 5) (sp-item 2235 :period 3000 :length 5) (sp-item 2236 :period 3000 :length 40) (sp-item 2237 :period 3000 :length 40) @@ -48,8 +34,7 @@ ) (defpart 2236 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 2.4) (meters 1.8) 1.0) @@ -76,13 +61,11 @@ ) (defpart 2239 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) (defpart 2238 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-flt spt-scale-x (meters 0.5)) @@ -102,8 +85,7 @@ ) (defpart 2234 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 128)) @@ -118,8 +100,7 @@ ) (defpart 2235 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 32)) @@ -134,8 +115,7 @@ ) (defpart 2237 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 48.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 16) (meters 10) 1.0) @@ -163,8 +143,7 @@ ) (defpart 2240 - :init-specs - ((sp-flt spt-fade-r -0.26666668) + :init-specs ((sp-flt spt-fade-r -0.26666668) (sp-flt spt-fade-g -0.26666668) (sp-flt spt-fade-b -0.52916664) (sp-int spt-next-time 240) @@ -173,8 +152,7 @@ ) (defpart 2241 - :init-specs - ((sp-flt spt-fade-r -0.24380952) + :init-specs ((sp-flt spt-fade-r -0.24380952) (sp-flt spt-fade-g -0.12190476) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.09142857) @@ -184,8 +162,7 @@ ) (defpart 2242 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) (defpartgroup group-tntbarrel-explosion @@ -193,8 +170,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2079 :period 600 :length 5) + :parts ((sp-item 2079 :period 600 :length 5) (sp-item 2080 :period 600 :length 40) (sp-item 2081 :period 600 :length 20) (sp-item 2082 :period 600 :length 20) @@ -202,8 +178,7 @@ ) (defpart 2080 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -230,13 +205,11 @@ ) (defpart 2083 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) (defpart 2082 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-flt spt-scale-x (meters 0.3)) @@ -256,8 +229,7 @@ ) (defpart 2079 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 24)) @@ -273,8 +245,7 @@ ) (defpart 2081 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -302,8 +273,7 @@ ) (defpart 2084 - :init-specs - ((sp-flt spt-fade-r -1.0666667) + :init-specs ((sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g -1.0666667) (sp-flt spt-fade-b -2.1166666) (sp-int spt-next-time 60) @@ -312,8 +282,7 @@ ) (defpart 2085 - :init-specs - ((sp-flt spt-fade-r -0.5688889) + :init-specs ((sp-flt spt-fade-r -0.5688889) (sp-flt spt-fade-g -0.28444445) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334) @@ -323,17 +292,13 @@ ) (defpart 2086 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) -(defskelgroup *tntbarrel-sg* tntbarrel - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *tntbarrel-sg* tntbarrel tntbarrel-lod0-jg tntbarrel-idle-ja + ((tntbarrel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 4) + ) (deftype tntbarrel (process-drawable) ((root-override collide-shape :offset 112) @@ -351,54 +316,35 @@ (defstate die (tntbarrel) :virtual #t - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) - (cond - (arg0 - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 473) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (sound-play "dcrate-break") + (if arg0 + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 473) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* + ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 474) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) ) - (else - (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-2 - (let ((t9-9 (method-of-type part-tracker activate))) - (t9-9 (the-as part-tracker gp-2) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - part-tracker-init - (-> *part-group-id-table* 474) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-2 ppointer) - ) - ) - ) - ) (suspend) (cleanup-for-death self) (deactivate self) @@ -408,8 +354,7 @@ (defstate idle (tntbarrel) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('die-big) (go-virtual die #t) @@ -418,23 +363,12 @@ (go-virtual die #f) ) (('attack 'touch) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'attack-invinc) - (set! (-> a1-7 param 0) (-> arg3 param 0)) - (let ((a2-2 (new 'static 'attack-info :mask #x20))) - (set! (-> a2-2 mode) 'death) - (set! (-> a1-7 param 1) (the-as uint a2-2)) - ) - (send-event-function arg0 a1-7) - ) + (send-event arg0 'attack-invinc (-> arg3 param 0) (static-attack-info ((mode 'death)))) (go-virtual die #f) ) ) ) - :code - (behavior () + :code (behavior () (transform-post) (logior! (-> self mask) (process-mask sleep)) (suspend) @@ -465,61 +399,40 @@ (none) ) -(defskelgroup *ogre-step-a-sg* ogre-step - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 3 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-step-a-sg* ogre-step ogre-step-a-lod0-jg ogre-step-a-idle-ja + ((ogre-step-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3 0 5) + ) -(defskelgroup *ogre-step-b-sg* ogre-step - 3 - 5 - ((4 (meters 999999))) - :bounds (static-spherem 0 3 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-step-b-sg* ogre-step ogre-step-b-lod0-jg ogre-step-b-idle-ja + ((ogre-step-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3 0 5) + ) -(defskelgroup *ogre-step-c-sg* ogre-step - 6 - 8 - ((7 (meters 999999))) - :bounds (static-spherem 0 3 0 6.5) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-step-c-sg* ogre-step ogre-step-c-lod0-jg ogre-step-c-idle-ja + ((ogre-step-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3 0 6.5) + ) -(defskelgroup *ogre-isle-a-sg* ogre-isle - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-isle-a-sg* ogre-isle ogre-isle-a-lod0-jg ogre-isle-a-idle-ja + ((ogre-isle-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) -(defskelgroup *ogre-isle-b-sg* ogre-isle - 3 - 5 - ((4 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-isle-b-sg* ogre-isle ogre-isle-b-lod0-jg ogre-isle-b-idle-ja + ((ogre-isle-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) -(defskelgroup *ogre-isle-c-sg* ogre-isle - 6 - 8 - ((7 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-isle-c-sg* ogre-isle ogre-isle-c-lod0-jg ogre-isle-c-idle-ja + ((ogre-isle-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) -(defskelgroup *ogre-isle-d-sg* ogre-isle - 9 - 11 - ((10 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-isle-d-sg* ogre-isle ogre-isle-d-lod0-jg ogre-isle-d-idle-ja + ((ogre-isle-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) (deftype ogre-plat (rigid-body-platform) ((anchor-point vector :inline :offset-assert 736) @@ -545,8 +458,7 @@ (defstate rigid-body-platform-idle (ogre-plat) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'trigger) (set! (-> self triggered) (the-as entity-actor #t)) @@ -559,8 +471,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (cond ((-> self active) (when (and *target* (>= (-> self info idle-distance) @@ -568,7 +479,7 @@ ) ) (if (-> self triggered) - (sound-play-by-name (static-sound-name "rock-in-lava") (new-sound-id) 1024 0 0 1 #t) + (sound-play "rock-in-lava") ) (go-virtual rigid-body-platform-float) ) @@ -581,59 +492,49 @@ ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior ogre-plat) ja-post) + :post (the-as (function none :behavior ogre-plat) ja-post) ) (defstate rigid-body-platform-float (ogre-plat) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior ogre-plat) rigid-body-platform-event-handler ) - :trans - (behavior () + :trans (behavior () (cond ((or (not *target*) (< (-> self info idle-distance) (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) ) ) (let ((f30-1 (-> self idle-y-offset))) - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) (if (= (-> self float-height-offset) f30-1) (go-virtual rigid-body-platform-idle) ) ) ) (else - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) (-> self float-y-offset) (* 32768.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) (-> self float-y-offset) (* 32768.0 (-> *display* seconds-per-frame))) ) ) (none) ) - :code - (behavior () + :code (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior ogre-plat) rigid-body-platform-post) + :post (the-as (function none :behavior ogre-plat) rigid-body-platform-post) ) (defmethod TODO-RENAME-30 ogre-plat ((obj ogre-plat)) @@ -912,13 +813,11 @@ (none) ) -(defskelgroup *ogre-bridge-sg* ogre-bridge - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 52) - :longest-edge (meters 4.5) - ) +(defskelgroup *ogre-bridge-sg* ogre-bridge ogre-bridge-lod0-jg ogre-bridge-idle-ja + ((ogre-bridge-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 52) + :longest-edge (meters 4.5) + ) (deftype ogre-bridge (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -965,27 +864,24 @@ ) (defstate ogre-bridge-idle (ogre-bridge) - :exit - (behavior () + :exit (behavior () (ogre-bridge-update-joints) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (and *target* (>= 286720.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) (go ogre-bridge-activate) ) 0 (none) ) - :code - (behavior () + :code (behavior () (ja-post) - (while #t + (loop (suspend) ) (none) @@ -993,57 +889,37 @@ ) (defstate ogre-bridge-activate (ogre-bridge) - :code - (behavior () + :code (behavior () (let ((v1-0 (entity-actor-lookup (-> self entity) 'alt-actor 0))) - (when (when v1-0 - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'next-stage) - (not (send-event-function + (when (if v1-0 + (not (send-event (if v1-0 (-> v1-0 extra process) ) - a1-1 + 'next-stage ) ) ) - ) (suspend) 0 ) ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (rand-vu-percent? 0.2) (spawn-projectile-blue *target*) ) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ogre-bridge-activated) (none) ) - :post - (the-as (function none :behavior ogre-bridge) rider-post) + :post (the-as (function none :behavior ogre-bridge) rider-post) ) (defstate ogre-bridge-activated (ogre-bridge) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('break) (+! (-> self dead-joint-count) 4) @@ -1058,87 +934,58 @@ ) ) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 3) :num! max) (transform-post) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior ogre-bridge) ja-post) + :post (the-as (function none :behavior ogre-bridge) ja-post) ) (defstate ogre-bridge-break (ogre-bridge) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) - (the-as - object - (when (= v1-0 'effect) - (when (= (-> arg3 param 0) 'splash) - (let ((gp-0 (new 'stack-no-clear 'vector))) - (let ((a1-1 (-> arg3 param 2))) - (set! (-> gp-0 quad) (-> self node-list data a1-1 bone transform vector 3 quad)) - ) - (set! (-> gp-0 y) 118784.0) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker s5-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 part-tracker-init (-> *part-group-id-table* 466) -1 #f #f #f gp-0) - (-> s5-0 ppointer) - ) - ) + (the-as object (when (= v1-0 'effect) + (when (= (-> arg3 param 0) 'splash) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((a1-1 (-> arg3 param 2))) + (set! (-> gp-0 quad) (-> self node-list data a1-1 bone transform vector 3 quad)) + ) + (set! (-> gp-0 y) 118784.0) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 466) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* + ) + ) + ) + ) ) - ) - ) - ) ) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ogre-bridge-idle) (none) ) - :post - (the-as (function none :behavior ogre-bridge) rider-post) + :post (the-as (function none :behavior ogre-bridge) rider-post) ) -(define - *ogre-bridge-joint-array* - (the-as (array uint8) - (new 'static 'boxed-array :type uint8 :length 8 :allocated-length 8 #x4 #x9 #xc #x11 #x7 #xa #xf #x12) - ) +(define *ogre-bridge-joint-array* + (the-as (array uint8) (new 'static 'boxed-array :type uint8 #x4 #x9 #xc #x11 #x7 #xa #xf #x12)) ) (defmethod init-from-entity! ogre-bridge ((obj ogre-bridge) (arg0 entity-actor)) @@ -1339,13 +1186,10 @@ (none) ) -(defskelgroup *ogre-bridgeend-sg* ogre-bridgeend - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 -3 8.2) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-bridgeend-sg* ogre-bridgeend ogre-bridgeend-lod0-jg ogre-bridgeend-idle-ja + ((ogre-bridgeend-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -3 8.2) + ) (deftype ogre-bridgeend (process-drawable) ((root-override collide-shape :offset 112) @@ -1361,8 +1205,7 @@ (defstate ogre-bridgeend-idle (ogre-bridgeend) - :code - (behavior () + :code (behavior () (transform-post) (anim-loop) (none) @@ -1403,8 +1246,7 @@ (defstate water-vol-idle (ogre-lava) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('submerge1) (set! (-> self anim) 3) @@ -1431,62 +1273,29 @@ ) ) ) - :code - (behavior () - (ja-channel-push! 2 30) - (let ((gp-0 (-> self skel root-channel 1))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self idle-anim))) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self anim)))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self anim))) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 0.5) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 2 (seconds 0.1)) + (ja :chan 1 :group! (-> self draw art-group data (-> self idle-anim)) :num! min) + (ja-no-eval :group! (-> self draw art-group data (-> self anim)) :num! (seek! max 0.5) :frame-num 0.0) (until (ja-done? 0) - (let ((v1-25 (-> self skel root-channel 1))) - (set! (-> v1-25 frame-interp) 0.5) - ) + (ja :chan 1 :frame-interp 0.5) (ja-post) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 0.5) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.5)) ) - (let ((v1-37 (-> self skel root-channel 0))) - (set! (-> v1-37 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self idle-anim)))) - ) - (let ((v1-40 (-> self skel root-channel 0))) - (set! (-> v1-40 num-func) num-func-identity) - (set! (-> v1-40 frame-num) 0.0) - ) - (while #t + (ja :group! (-> self draw art-group data (-> self idle-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior ogre-lava) #f) + :post (the-as (function none :behavior ogre-lava) #f) ) (defstate water-vol-startup (ogre-lava) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self idle-anim) 2) (set! (-> self anim) (-> self idle-anim)) (go-virtual water-vol-idle) @@ -1497,8 +1306,7 @@ (define ripple-for-ogre-lava (new 'static 'ripple-wave-set :count 2 :converted #f - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 2 :speed 3.0) (new 'static 'ripple-wave :scale 40.0 :xdiv -2 :zdiv 2 :speed 1.8) (new 'static 'ripple-wave) @@ -1516,8 +1324,8 @@ (set! (-> v1-2 global-scale) 2048.0) (set! (-> v1-2 waveform) ripple-for-ogre-lava) ) - (set! (-> obj flags) (logand -8388609 (-> obj flags))) - (set! (-> obj flags) (logior #x2000000 (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt23)) + (set! (-> obj flags) (logior (water-flags wt25) (-> obj flags))) (set! (-> obj attack-event) 'lava) (none) ) @@ -1537,37 +1345,29 @@ ) -(defskelgroup *shortcut-boulder-whole-sg* shortcut-boulder - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 5.5 0 7.5) - :longest-edge (meters 0) - ) +(defskelgroup *shortcut-boulder-whole-sg* shortcut-boulder shortcut-boulder-whole-lod0-jg shortcut-boulder-idle-ja + ((shortcut-boulder-whole-lod0-mg (meters 999999))) + :bounds (static-spherem 0 5.5 0 7.5) + ) -(defskelgroup *shortcut-boulder-broken-sg* shortcut-boulder - 2 - 4 - ((3 (meters 999999))) - :bounds (static-spherem 0 5.5 0 20) - :longest-edge (meters 0) - ) +(defskelgroup *shortcut-boulder-broken-sg* shortcut-boulder shortcut-boulder-broken-lod0-jg shortcut-boulder-idle-ja + ((shortcut-boulder-broken-lod0-mg (meters 999999))) + :bounds (static-spherem 0 5.5 0 20) + ) (defpartgroup group-shortcut-boulder-explosion :id 475 :duration 300 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2149 :period 1500 :length 5) + :parts ((sp-item 2149 :period 1500 :length 5) (sp-item 2150 :period 1500 :length 5) (sp-item 2151 :period 1500 :length 15) ) ) (defpart 2150 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 15)) (sp-copy-from-other spt-scale-y -4) @@ -1582,8 +1382,7 @@ ) (defpart 2149 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 16.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1606,8 +1405,7 @@ ) (defpart 2151 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -1631,78 +1429,38 @@ ) (defpart 2152 - :init-specs - ((sp-flt spt-fade-a -0.2)) + :init-specs ((sp-flt spt-fade-a -0.2)) ) (defstate shortcut-boulder-break (shortcut-boulder) - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) (lods-assign! (-> self draw) (-> self broken-look)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 475) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-5 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! - a0-5 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 475) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (cleanup-for-death self) (deactivate self) (none) ) - :post - (the-as (function none :behavior shortcut-boulder) ja-post) + :post (the-as (function none :behavior shortcut-boulder) ja-post) ) (defstate shortcut-boulder-idle (shortcut-boulder) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (if (and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow)) @@ -1711,10 +1469,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) diff --git a/goal_src/levels/ogre/ogre-part.gc b/goal_src/levels/ogre/ogre-part.gc index 840678012f..9142e1b87e 100644 --- a/goal_src/levels/ogre/ogre-part.gc +++ b/goal_src/levels/ogre/ogre-part.gc @@ -13,8 +13,7 @@ :linger-duration 3000 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2193 :period 1500 :length 5) + :parts ((sp-item 2193 :period 1500 :length 5) (sp-item 2194 :period 1500 :length 40) (sp-item 2195 :period 1500 :length 20) (sp-item 2196 :period 1500 :length 20) @@ -22,8 +21,7 @@ ) (defpart 2194 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters -5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1.2) 1.0) @@ -50,13 +48,11 @@ ) (defpart 2197 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) (defpart 2196 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters -5) (meters 1) 1.0) (sp-flt spt-scale-x (meters 0.6)) @@ -76,8 +72,7 @@ ) (defpart 2193 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -4)) (sp-flt spt-scale-x (meters 44)) @@ -93,8 +88,7 @@ ) (defpart 2195 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 24.0) (sp-rnd-flt spt-y (meters -5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 5) (meters 2.5) 1.0) @@ -122,8 +116,7 @@ ) (defpart 2198 - :init-specs - ((sp-flt spt-fade-r -0.21333334) + :init-specs ((sp-flt spt-fade-r -0.21333334) (sp-flt spt-fade-g -0.21333334) (sp-flt spt-fade-b 0.0) (sp-int spt-next-time 150) @@ -132,8 +125,7 @@ ) (defpart 2199 - :init-specs - ((sp-flt spt-fade-r -0.021333333) + :init-specs ((sp-flt spt-fade-r -0.021333333) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.08533333) @@ -143,8 +135,7 @@ ) (defpart 2200 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) (defpartgroup group-ogreboss-lava-splash @@ -153,13 +144,11 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2023)) + :parts ((sp-item 2023)) ) (defpart 2023 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) @@ -183,13 +172,11 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2108) (sp-item 2109) (sp-item 2110) (sp-item 2111)) + :parts ((sp-item 2108) (sp-item 2109) (sp-item 2110) (sp-item 2111)) ) (defpart 2111 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 4.0 1.0) (sp-flt spt-y (meters -3)) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.75) 1.0) @@ -210,8 +197,7 @@ ) (defpart 2108 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 0) (meters 2) 1.0) (sp-flt spt-y (meters -3)) @@ -237,8 +223,7 @@ ) (defpart 2109 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 3) (meters 4) 1.0) (sp-flt spt-y (meters -3)) @@ -264,8 +249,7 @@ ) (defpart 2110 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters 0) (meters 3) 1.0) (sp-rnd-flt spt-y (meters -3) (meters 1) 1.0) @@ -296,8 +280,7 @@ ) (defpart 2112 - :init-specs - ((sp-flt spt-fade-a -0.08)) + :init-specs ((sp-flt spt-fade-a -0.08)) ) (defpartgroup group-ogreboss-boulder-grow @@ -306,13 +289,11 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2201) (sp-item 2202) (sp-item 2203) (sp-item 2204)) + :parts ((sp-item 2201) (sp-item 2202) (sp-item 2203) (sp-item 2204)) ) (defpart 2203 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) @@ -339,8 +320,7 @@ ) (defpart 2205 - :init-specs - ((sp-flt spt-fade-r -0.85333335) + :init-specs ((sp-flt spt-fade-r -0.85333335) (sp-flt spt-fade-g -0.42666668) (sp-flt spt-fade-b -0.42666668) (sp-flt spt-fade-a -0.85333335) @@ -348,8 +328,7 @@ ) (defpart 2204 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) @@ -368,8 +347,7 @@ ) (defpart 2201 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-rnd-flt spt-scale-x (meters 28) (meters 4) 1.0) @@ -385,8 +363,7 @@ ) (defpart 2202 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-rnd-flt spt-scale-x (meters 16) (meters 4) 1.0) @@ -405,13 +382,11 @@ (defpartgroup group-ogreboss-missile :id 469 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 1933) (sp-item 1934)) + :parts ((sp-item 1933) (sp-item 1934)) ) (defpart 1934 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.3 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 2) 1.0) @@ -438,8 +413,7 @@ ) (defpart 1933 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.3 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 2) 1.0) @@ -468,8 +442,7 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 2079 :period 600 :length 5) + :parts ((sp-item 2079 :period 600 :length 5) (sp-item 2206 :period 600 :length 40) (sp-item 2206 :period 600 :length 40) (sp-item 2206 :period 600 :length 30) @@ -481,8 +454,7 @@ ) (defpart 2206 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -514,8 +486,7 @@ :duration 300 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 2079 :period 600 :length 5) + :parts ((sp-item 2079 :period 600 :length 5) (sp-item 2080 :period 600 :length 40) (sp-item 2148 :period 600 :length 20) (sp-item 2082 :period 600 :length 20) @@ -525,8 +496,7 @@ (defpartgroup group-ogre-lava-lava-20x20 :id 472 :bounds (static-bspherem 0 0 0 14) - :parts - ((sp-item 2030 :fade-after (meters 40) :falloff-to (meters 40)) + :parts ((sp-item 2030 :fade-after (meters 40) :falloff-to (meters 40)) (sp-item 2031 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 2032 :fade-after (meters 80) :falloff-to (meters 80) :binding 2028) (sp-item 2028 :flags (start-dead)) @@ -545,8 +515,7 @@ ) (defpart 2031 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) @@ -572,8 +541,7 @@ ) (defpart 2033 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0)) @@ -593,8 +561,7 @@ ) (defpart 2032 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.02 0.02 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0)) @@ -616,8 +583,7 @@ ) (defpart 2030 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -10) (meters 20) 1.0) @@ -638,18 +604,15 @@ ) (defpart 2035 - :init-specs - ((sp-flt spt-fade-b 16.384)) + :init-specs ((sp-flt spt-fade-b 16.384)) ) (defpart 2034 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 2036)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 2036)) ) (defpart 2036 - :init-specs - ((sp-flt spt-fade-r -0.85333335) + :init-specs ((sp-flt spt-fade-r -0.85333335) (sp-flt spt-fade-g -0.42666668) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2037) @@ -657,13 +620,11 @@ ) (defpart 2037 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a -0.10666667)) ) (defpart 2028 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.7) (sp-rnd-flt spt-scale-x (meters 0.75) (meters 0.25) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -680,8 +641,7 @@ ) (defpart 2029 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) diff --git a/goal_src/levels/ogre/ogreboss.gc b/goal_src/levels/ogre/ogreboss.gc index 3ff880704a..6853b0965c 100644 --- a/goal_src/levels/ogre/ogreboss.gc +++ b/goal_src/levels/ogre/ogreboss.gc @@ -10,89 +10,60 @@ ;; DECOMP BEGINS -(defskelgroup *ogreboss-sg* ogreboss - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 20) - :longest-edge (meters 0) - ) +(import "goal_src/import/ogreboss-ag.gc") -(defskelgroup *ogreboss-cam-sg* ogreboss - 25 - 27 - ((26 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *ogreboss-sg* ogreboss ogreboss-lod0-jg ogreboss-idle-ja + ((ogreboss-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) -(defskelgroup *ogreboss-shoot-boulder-sg* ogreboss - 29 - 32 - ((30 (meters 999999))) - :bounds (static-spherem 0 0 0 300) - :longest-edge (meters 0) - :shadow 31 - ) +(defskelgroup *ogreboss-cam-sg* ogreboss ogreboss-cam-lod0-jg ogreboss-cam-idle-ja + ((ogreboss-cam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) -(defskelgroup *ogreboss-shoot-boulder-break-sg* ogreboss - 33 - 35 - ((34 (meters 999999))) - :bounds (static-spherem 0 0 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *ogreboss-shoot-boulder-sg* ogreboss ogreboss-shoot-boulder-lod0-jg ogreboss-shoot-boulder-idle-ja + ((ogreboss-shoot-boulder-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 300) + :shadow ogreboss-shoot-boulder-shadow-mg + ) -(defskelgroup *ogreboss-bounce-boulder-sg* ogreboss - 36 - 38 - ((37 (meters 999999))) - :bounds (static-spherem 0 0 0 50) - :longest-edge (meters 0) - ) +(defskelgroup *ogreboss-shoot-boulder-break-sg* ogreboss ogreboss-shoot-boulder-break-lod0-jg ogreboss-shoot-boulder-break-idle-ja + ((ogreboss-shoot-boulder-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) -(defskelgroup *ogreboss-super-boulder-sg* ogreboss - 39 - 41 - ((40 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *ogreboss-bounce-boulder-sg* ogreboss ogreboss-bounce-boulder-lod0-jg ogreboss-bounce-boulder-idle-ja + ((ogreboss-bounce-boulder-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + ) -(defskelgroup *ogreboss-column-sg* ogreboss - 45 - 47 - ((46 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *ogreboss-super-boulder-sg* ogreboss ogreboss-super-boulder-lod0-jg ogreboss-super-boulder-idle-ja + ((ogreboss-super-boulder-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) -(define - *ogreboss-missile-shadow-control* +(defskelgroup *ogreboss-column-sg* ogreboss ogreboss-column-lod0-jg ogreboss-column-idle-ja + ((ogreboss-column-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) + +(define *ogreboss-missile-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #xe)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 614400.0) - :bot-plane - (new 'static 'plane :y 1.0 :w -102400.0) - :top-plane - (new 'static 'plane :y 1.0 :w -143360.0) + :flags (shadow-flags disable-fade shdf02 shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) + :bot-plane (new 'static 'plane :y 1.0 :w -102400.0) + :top-plane (new 'static 'plane :y 1.0 :w -143360.0) ) ) ) -(define - *ogreboss-shadow-control* +(define *ogreboss-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #xc)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 614400.0) - :bot-plane - (new 'static 'plane :y 1.0 :w -102400.0) - :top-plane - (new 'static 'plane :y 1.0 :w -143360.0) + :flags (shadow-flags shdf02 shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) + :bot-plane (new 'static 'plane :y 1.0 :w -102400.0) + :top-plane (new 'static 'plane :y 1.0 :w -143360.0) :fade-dist 819200.0 ) ) @@ -122,13 +93,11 @@ (defstate ogreboss-missile-idle (ogreboss-missile) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'collide-tri-result)) @@ -146,7 +115,7 @@ (-> self root-override root-prim collide-with) (-> self parent-override 0) s4-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -169,13 +138,11 @@ (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior ogreboss-missile) transform-post) + :post (the-as (function none :behavior ogreboss-missile) transform-post) ) (defstate ogreboss-missile-seek (ogreboss-missile) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'collide-tri-result)) @@ -197,7 +164,7 @@ (-> self root-override root-prim collide-with) (-> self parent-override 0) s4-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -219,8 +186,7 @@ (cleanup-for-death self) (none) ) - :post - (behavior () + :post (behavior () (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) (transform-post) (none) @@ -229,39 +195,25 @@ (defun ogreboss-rock-explosion-effect ((arg0 basic)) (with-pp - (sound-play-by-name (static-sound-name "ogre-explode") (new-sound-id) 1024 0 0 1 (the-as symbol arg0)) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 471) -1 #f #f #f arg0) - (-> gp-1 ppointer) - ) + (sound-play "ogre-explode" :position (the-as symbol arg0)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 471) + -1 + #f + #f + #f + arg0 + :to *entity-pool* ) - (activate! - *camera-smush-control* - (the-as float 819.2) - 37 - 600 - (-> (new 'static 'array float 1 1.0) 0) - (the-as float 0.995) - ) - (let* ((s4-1 (get-process *default-dead-pool* manipy #x4000)) - (gp-2 (when s4-1 - (let ((t9-7 (method-of-type manipy activate))) - (t9-7 (the-as manipy s4-1) pp 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 manipy-init arg0 (-> pp entity) *ogreboss-shoot-boulder-break-sg* #f) - (-> s4-1 ppointer) - ) - ) - ) + (activate! *camera-smush-control* (the-as float 819.2) 37 600 (the-as float 1.0) (the-as float 0.995)) + (let ((gp-2 (manipy-spawn arg0 (-> pp entity) *ogreboss-shoot-boulder-break-sg* #f :to pp))) (quaternion-axis-angle! (-> (the-as manipy (-> gp-2 0)) root quat) - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) + (the-as float 1.0) + (the-as float 0.0) (* 65536.0 (rand-vu)) ) (send-event (ppointer->process gp-2) 'anim-mode 'play1) @@ -273,40 +225,23 @@ (defun ogreboss-missile-scale-explosion ((arg0 handle)) (let* ((gp-0 (handle->process arg0)) (f0-0 (-> (the-as process-drawable gp-0) root scale x)) - (f0-2 (seek f0-0 (-> (new 'static 'array float 1 0.0) 0) (-> *display* seconds-per-frame))) + (f0-2 (seek f0-0 (the-as float 0.0) (-> *display* seconds-per-frame))) ) - (set-vector! - (-> (the-as process-drawable gp-0) root scale) - f0-2 - f0-2 - f0-2 - (-> (new 'static 'array float 1 1.0) 0) - ) + (set-vector! (-> (the-as process-drawable gp-0) root scale) f0-2 f0-2 f0-2 1.0) ) 0 (none) ) (defstate ogreboss-missile-impact (ogreboss-missile) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touched) (cond (#f (cond ((= (-> arg0 type) target) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'attack) - (set! (-> a1-1 param 0) (-> arg3 param 0)) - (let ((a0-3 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-3 mode) 'explode) - (set! (-> a1-1 param 1) (the-as uint a0-3)) - ) - (send-event-function arg0 a1-1) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'explode)))) ) (else (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -344,7 +279,7 @@ 0.0 (set! (-> s4-1 quad) (-> (the-as target t1-0) control trans quad)) (set! (-> s4-1 y) (+ 4096.0 (-> s4-1 y))) - (set-vector! s3-0 0.0 (- 118784.0 (-> s4-1 y)) 0.0 (-> (new 'static 'array float 1 1.0) 0)) + (set-vector! s3-0 0.0 (- 118784.0 (-> s4-1 y)) 0.0 1.0) (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* @@ -354,30 +289,20 @@ (-> self root-override root-prim collide-with) t1-0 t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-1 s3-0 - (-> (new 'static 'array float 1 1.0) 0) + (meters 0.00024414062) (the-as rgba (new 'static 'rgba :g #xff :a #x80)) ) (when (>= f30-0 0.0) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'attack) - (set! (-> a1-7 param 0) (-> arg3 param 0)) - (let ((a0-16 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-16 mode) 'damage) - (set! (-> a1-7 param 1) (the-as uint a0-16)) - ) - (send-event-function arg0 a1-7) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'damage)))) (send-event (ppointer->process (-> self parent-override)) 'victory) ) ) @@ -385,7 +310,7 @@ ) (else (let ((v1-37 (new 'stack-no-clear 'vector))) - (set-vector! v1-37 0.0 -12288000.0 0.0 (-> (new 'static 'array float 1 1.0) 0)) + (set-vector! v1-37 0.0 -12288000.0 0.0 1.0) (send-event arg0 'impulse v1-37) ) ) @@ -396,8 +321,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask enemy projectile)) (ogreboss-rock-explosion-effect (the-as basic (-> self root-override trans))) (when (nonzero? (-> self pickup-type)) @@ -407,7 +331,7 @@ (-> self pickup-type) (-> *FACT-bank* eco-single-inc) #t - (the-as process-drawable *entity-pool*) + *entity-pool* t1-0 ) ) @@ -433,8 +357,7 @@ (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior ogreboss-missile) ja-post) + :post (the-as (function none :behavior ogreboss-missile) ja-post) ) (deftype ogreboss-missile-init-data (structure) @@ -451,7 +374,7 @@ ) -(defbehavior ogreboss-missile-init-by-other ogreboss-missile ((arg0 ogreboss-missile-init-data) (arg1 entity)) +(defbehavior ogreboss-missile-init-by-other ogreboss-missile ((arg0 ogreboss-missile-init-data) (arg1 entity-actor)) (set! (-> self entity) arg1) (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -504,19 +427,13 @@ (quaternion-axis-angle! (-> self tumble-quat) (cos f30-1) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (sin f30-1) (the-as float 2730.6667) ) ) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 469) self)) - (set-vector! - (-> self draw color-emissive) - (-> (new 'static 'array float 1 0.125) 0) - (-> (new 'static 'array float 1 0.0625) 0) - 0.0 - 0.0 - ) + (set-vector! (-> self draw color-emissive) 0.125 0.0625 0.0 0.0) (go ogreboss-missile-idle) (none) ) @@ -554,25 +471,17 @@ (defbehavior ogreboss-super-boulder-event-handler ogreboss-super-boulder ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('touch) + ;; PAL patch here + (('touch 'attack) (when (and *target* ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) (-> self root-override) (the-as uint 1) ) ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (let ((a0-4 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-4 mode) 'ogreboss-super-boulder) - (set! (-> a1-2 param 1) (the-as uint a0-4)) + (if (send-event arg0 'attack-invinc (-> arg3 param 0) (static-attack-info ((mode 'ogreboss-super-boulder)))) + #f ) - (send-event-function arg0 a1-2) - ) - (go ogreboss-super-boulder-killed-player) ) ) (('effect) @@ -603,8 +512,7 @@ ) (defstate ogreboss-super-boulder-idle (ogreboss-super-boulder) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('speedup) (let ((f0-1 (* 1.3 (-> self speed)))) @@ -613,7 +521,7 @@ ) ) (('grow-faster) - (let ((f0-2 (-> (new 'static 'array float 1 1.0) 0))) + (let ((f0-2 1.0)) (set! (-> self grow-rate) f0-2) f0-2 ) @@ -629,25 +537,16 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self sound-id)) (none) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 41)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! ogreboss-super-boulder-idle-ja :num! min) (set! (-> self joint enable) #t) - (set! (-> self joint blend) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> self joint blend) 1.0) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (quaternion-vector-angle! (-> self tumble-quat) (-> self spin-axis) @@ -655,63 +554,41 @@ ) (quaternion*! (-> self joint transform quat) (-> self joint transform quat) (-> self tumble-quat)) (+! (-> self size) (* (-> self grow-rate) (-> *display* seconds-per-frame))) - (set! (-> self size) (fmin (-> (new 'static 'array float 1 1.0) 0) (-> self size))) + (set! (-> self size) (fmin 1.0 (-> self size))) (let* ((f0-10 (sqrtf (-> self size))) (f28-0 (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> self state-time))))) (f30-0 (* 116508.445 f28-0 (-> self speed))) ) - (set-vector! (-> self joint transform scale) f0-10 f0-10 f0-10 (-> (new 'static 'array float 1 1.0) 0)) + (set-vector! (-> self joint transform scale) f0-10 f0-10 f0-10 1.0) (let ((gp-1 (-> self joint transform))) (set! (-> gp-1 trans x) (* 4096.0 (sin f30-0))) (set! (-> gp-1 trans y) (+ 122880.0 (* 12288.0 (sin (* 98304.0 f28-0))))) (set! (-> gp-1 trans z) (* 4096.0 (cos f30-0))) - (set! (-> gp-1 trans w) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> gp-1 trans w) 1.0) ) ) (spawn (-> self part) (-> self node-list data 3 bone transform vector 3)) - (sound-play-by-name - (static-sound-name "ogre-rock") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self joint transform)) - ) + (sound-play "ogre-rock" :id (-> self sound-id) :position (the-as symbol (-> self joint transform))) (suspend) ) (none) ) - :post - (the-as (function none :behavior ogreboss-super-boulder) transform-post) + :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) (defbehavior ogreboss-super-boulder-impact-effect ogreboss-super-boulder () - (sound-play-by-name - (static-sound-name "ogre-boulder") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self draw origin)) - ) - (activate! - *camera-smush-control* - (the-as float 819.2) - 37 - 600 - (-> (new 'static 'array float 1 1.0) 0) - (the-as float 0.995) - ) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 471) -1 #f #f #f (-> self draw origin)) - (-> gp-1 ppointer) - ) + (sound-play "ogre-boulder" :position (the-as symbol (-> self draw origin))) + (activate! *camera-smush-control* (the-as float 819.2) 37 600 (the-as float 1.0) (the-as float 0.995)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 471) + -1 + #f + #f + #f + (-> self draw origin) + :to *entity-pool* ) 0 (none) @@ -719,99 +596,63 @@ (defbehavior ogreboss-super-boulder-play-hit-anim ogreboss-super-boulder () (set! (-> self src-pos quad) (-> self root-override trans quad)) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 43)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 43)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-super-boulder-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (set! (-> self joint blend) - (seek (-> self joint blend) (-> (new 'static 'array float 1 0.0) 0) (* 5.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (-> *display* seconds-per-frame))) (let* ((f1-1 (/ (- (ja-frame-num 0) (ja-aframe (the-as float 54.0) 0)) (- (the float (ja-num-frames 0)) (ja-aframe (the-as float 54.0) 0)) ) ) - (f0-13 (fmax 0.0 (fmin (-> (new 'static 'array float 1 1.0) 0) f1-1))) + (f0-13 (fmax 0.0 (fmin 1.0 f1-1))) ) (vector-lerp! (-> self root-override trans) (-> self src-pos) (-> self orig-pos) f0-13) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (the-as object 0) ) (defstate ogreboss-super-boulder-throw (ogreboss-super-boulder) - :event - ogreboss-super-boulder-event-handler - :code - (behavior () + :event ogreboss-super-boulder-event-handler + :code (behavior () (set! (-> self hit-boss) #f) (set! (-> self src-pos quad) (-> self root-override trans quad)) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 42))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 42)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 42)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-super-boulder-throw-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (set! (-> self joint blend) - (seek (-> self joint blend) (-> (new 'static 'array float 1 0.0) 0) (* 5.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (-> *display* seconds-per-frame))) (let* ((f1-1 (/ (- (ja-frame-num 0) (ja-aframe (the-as float 32.0) 0)) (- (the float (ja-num-frames 0)) (ja-aframe (the-as float 32.0) 0)) ) ) - (f0-13 (fmax 0.0 (fmin (-> (new 'static 'array float 1 1.0) 0) f1-1))) + (f0-13 (fmax 0.0 (fmin 1.0 f1-1))) ) (vector-lerp! (-> self root-override trans) (-> self src-pos) (-> self orig-pos) f0-13) ) 0 (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ogreboss-super-boulder-land) (none) ) - :post - (the-as (function none :behavior ogreboss-super-boulder) transform-post) + :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) (defstate ogreboss-super-boulder-hit (ogreboss-super-boulder) - :event - ogreboss-super-boulder-event-handler - :code - (behavior () + :event ogreboss-super-boulder-event-handler + :code (behavior () (set! (-> self hit-boss) #t) (ogreboss-super-boulder-play-hit-anim) (go ogreboss-super-boulder-land) (none) ) - :post - (the-as (function none :behavior ogreboss-super-boulder) transform-post) + :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) (defstate ogreboss-super-boulder-die (ogreboss-super-boulder) - :event - ogreboss-super-boulder-event-handler - :code - (behavior () + :event ogreboss-super-boulder-event-handler + :code (behavior () (ogreboss-super-boulder-play-hit-anim) (ogreboss-rock-explosion-effect (the-as basic (-> self draw origin))) (ogreboss-rock-explosion-effect (the-as basic (-> self draw origin))) @@ -822,44 +663,33 @@ (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior ogreboss-super-boulder) transform-post) + :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) (defstate ogreboss-super-boulder-land (ogreboss-super-boulder) - :event - ogreboss-super-boulder-event-handler - :code - (behavior () + :event ogreboss-super-boulder-event-handler + :code (behavior () (set! (-> self root-override trans quad) (-> self orig-pos quad)) (ogreboss-super-boulder-impact-effect) (set! (-> self joint enable) #f) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 44))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 100.0) 0)) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-super-boulder-roll-ja + :num! (seek! (ja-aframe (the-as float 100.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (when (< 81920.0 (vector-vector-distance (the-as vector (-> self root-override root-prim prim-core)) (target-pos 0)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (go ogreboss-super-boulder-roll) ) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe (the-as float 100.0) 0)) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 100.0) 0))) ) (go ogreboss-super-boulder-roll) (none) ) - :post - (behavior () + :post (behavior () (transform-post) 0 (none) @@ -867,25 +697,16 @@ ) (defstate ogreboss-super-boulder-roll (ogreboss-super-boulder) - :event - ogreboss-super-boulder-event-handler - :code - (behavior () + :event ogreboss-super-boulder-event-handler + :code (behavior () (ogreboss-super-boulder-impact-effect) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 44))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 162.0) 0)) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) (ja-aframe (the-as float 100.0) 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-super-boulder-roll-ja + :num! (seek! (ja-aframe (the-as float 162.0) 0)) + :frame-num (ja-aframe (the-as float 100.0) 0) + ) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 162.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 162.0) 0))) ) (set! (-> self root-override root-prim local-sphere w) 28672.0) (cond @@ -930,28 +751,18 @@ ) ) ) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 44))) - (set! (-> gp-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 44)) data 0 length) -1)) - ) - (set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-4 frame-num) (ja-aframe (the-as float 162.0) 0)) - (joint-control-channel-group! gp-4 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-super-boulder-roll-ja + :num! (seek!) + :frame-num (ja-aframe (the-as float 162.0) 0) + ) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (cleanup-for-death self) (none) ) - :post - (behavior () + :post (behavior () (transform-post) 0 (none) @@ -972,18 +783,17 @@ ) (defstate ogreboss-super-boulder-killed-player (ogreboss-super-boulder) - :code - (behavior () + :code (behavior () (clear-collide-with-as (-> self root-override)) (ja-post) - (while #t + (loop (suspend) ) (none) ) ) -(defbehavior ogreboss-super-boulder-init-by-other ogreboss-super-boulder ((arg0 vector) (arg1 float) (arg2 entity)) +(defbehavior ogreboss-super-boulder-init-by-other ogreboss-super-boulder ((arg0 vector) (arg1 float) (arg2 entity-actor)) (set! (-> self entity) arg2) (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -1009,7 +819,8 @@ (set! (-> self root-override quat vec quad) (-> self parent-override 0 root quat vec quad)) (vector-identity! (-> self root-override scale)) (initialize-skeleton self *ogreboss-super-boulder-sg* '()) - (logclear! (-> self mask) (process-mask actor-pause)) + ;; PAL patch here + (logclear! (-> self mask) (process-mask actor-pause enemy)) (set! (-> self lava) (entity-actor-lookup (-> self entity) 'water-actor 0)) (logior! (-> self skel effect flags) 1) (set! (-> self draw origin-joint-index) (the-as uint 3)) @@ -1017,21 +828,15 @@ (quaternion-axis-angle! (-> self tumble-quat) (cos f30-1) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (sin f30-1) (the-as float 2730.6667) ) ) (set! (-> self joint) (new 'process 'joint-mod-blend-local self 3 #f)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 468) self)) - (set-vector! - (-> self draw color-emissive) - (-> (new 'static 'array float 1 0.125) 0) - (-> (new 'static 'array float 1 0.0625) 0) - 0.0 - 0.0 - ) - (set! (-> self speed) (-> (new 'static 'array float 1 1.0) 0)) + (set-vector! (-> self draw color-emissive) 0.125 0.0625 0.0 0.0) + (set! (-> self speed) 1.0) (set! (-> self size) 0.0) (set! (-> self grow-rate) (/ 300.0 arg1)) (set! (-> self sound-id) (new-sound-id)) @@ -1074,60 +879,37 @@ ) (defstate ogreboss-bounce-boulder-idle (ogreboss-bounce-boulder) - :event - ogreboss-bounce-boulder-event-handler - :code - (behavior () + :event ogreboss-bounce-boulder-event-handler + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((f30-0 (-> (new 'static 'array float 1 2.0) 0))) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 40.0) 0)) - (set! (-> gp-0 param 1) f30-0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-seek!) - ) + (let ((f30-0 2.0)) + (ja-no-eval :group! ogreboss-bounce-boulder-idle-ja + :num! (seek! (ja-aframe (the-as float 40.0) 0) f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (set! (-> self side-pos) - (* (fmin (-> (new 'static 'array float 1 1.0) 0) (/ (ja-frame-num 0) (ja-aframe (the-as float 40.0) 0))) - (-> self dest-pos) - ) + (* (fmin 1.0 (/ (ja-frame-num 0) (ja-aframe (the-as float 40.0) 0))) (-> self dest-pos)) ) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 40.0) 0)) - (set! (-> gp-1 param 1) f30-0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> gp-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 38)) data 0 length) -1)) - ) - (set! (-> gp-2 param 1) f30-0) - (set! (-> gp-2 frame-num) (ja-aframe (the-as float 40.0) 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 40.0) 0) f30-0)) ) + (ja-no-eval :group! ogreboss-bounce-boulder-idle-ja + :num! (seek! max f30-0) + :frame-num (ja-aframe (the-as float 40.0) 0) + ) (until (ja-done? 0) (if (>= (ja-frame-num 0) (ja-aframe (the-as float 235.0) 0)) - (set! (-> self side-pos) - (seek (-> self side-pos) (-> (new 'static 'array float 1 0.0) 0) (* 20480.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self side-pos) (the-as float 0.0) (* 20480.0 (-> *display* seconds-per-frame))) ) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) f30-0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (cleanup-for-death self) (none) ) - :post - (behavior () + :post (behavior () (vector+*! (-> self root-override trans) (-> self src-pos) (-> self side-dir) (-> self side-pos)) (transform-post) (find-ground-and-draw-shadow @@ -1135,15 +917,15 @@ (the-as vector #f) (the-as float 49152.0) (collide-kind background) - (the-as process #f) - (-> (new 'static 'array float 1 0.0) 0) + (the-as process-drawable #f) + (the-as float 0.0) (the-as float 409600.0) ) (none) ) ) -(defbehavior ogreboss-bounce-boulder-init-by-other ogreboss-bounce-boulder ((arg0 int) (arg1 entity)) +(defbehavior ogreboss-bounce-boulder-init-by-other ogreboss-bounce-boulder ((arg0 int) (arg1 entity-actor)) (set! (-> self entity) arg1) (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1172,7 +954,7 @@ (set! (-> self side-pos) 0.0) (set! (-> self dest-pos) (the-as float (cond ((zero? arg0) - (-> (new 'static 'array float 1 0.0) 0) + 0.0 ) ((= arg0 1) -20480.0 @@ -1181,7 +963,7 @@ 20480.0 ) (else - (-> (new 'static 'array float 1 0.0) 0) + 0.0 ) ) ) @@ -1190,13 +972,7 @@ (initialize-skeleton self *ogreboss-bounce-boulder-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self draw origin-joint-index) (the-as uint 3)) - (set-vector! - (-> self draw color-emissive) - (-> (new 'static 'array float 1 0.125) 0) - (-> (new 'static 'array float 1 0.0625) 0) - 0.0 - 0.0 - ) + (set-vector! (-> self draw color-emissive) 0.125 0.0625 0.0 0.0) (go ogreboss-bounce-boulder-idle) (none) ) @@ -1256,7 +1032,7 @@ (set! (-> self try-counted) #t) (let ((gp-0 (-> self entity extra perm))) (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) - (set! (-> gp-0 user-int8 0) (seekl (-> gp-0 user-int8 0) 255 1)) + (seekl! (-> gp-0 user-int8 0) 255 1) (set! (-> self try-count) (the-as uint (-> gp-0 user-int8 0))) ) ) @@ -1284,106 +1060,53 @@ ) (defbehavior ogreboss-idle-loop ogreboss () - (while #t - (ja-channel-push! 1 30) + (loop + (ja-channel-push! 1 (seconds 0.1)) (let ((v1-0 (rand-vu-int-range 0 2))) (cond ((zero? v1-0) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 140.0) 0)) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-idle-ja :num! (seek! (ja-aframe (the-as float 140.0) 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 140.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 140.0) 0))) ) (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.16666667)) + (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.167)) (suspend) ) ) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-3 param 0) (ja-aframe (the-as float 168.0) 0)) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-3 frame-num) (ja-aframe (the-as float 140.0) 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-idle-ja + :num! (seek! (ja-aframe (the-as float 168.0) 0)) + :frame-num (ja-aframe (the-as float 140.0) 0) + ) (until (ja-done? 0) (suspend) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 param 0) (ja-aframe (the-as float 168.0) 0)) - (set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 168.0) 0))) ) (let ((gp-5 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 0.16666667)) + (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 0.167)) (suspend) ) ) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> gp-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-6 frame-num) (ja-aframe (the-as float 168.0) 0)) - (joint-control-channel-group! gp-6 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-idle-ja :num! (seek!) :frame-num (ja-aframe (the-as float 168.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((= v1-0 1) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-idle-alt-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else (dotimes (gp-7 4) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-21 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-21 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-21 frame-num) 0.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-idle-bored-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) (the float (+ (-> a0-22 frame-group data 0 length) -1))) - (set! (-> a0-22 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -1395,20 +1118,9 @@ ) (defstate ogreboss-idle (ogreboss) - :enter - (behavior () + :enter (behavior () (when (zero? (-> self try-count)) - (let* ((s5-0 (get-process *default-dead-pool* manipy #x4000)) - (gp-0 - (when s5-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> self root-override trans) (-> self entity) *ogreboss-column-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) + (let ((gp-0 (manipy-spawn (-> self root-override trans) (-> self entity) *ogreboss-column-sg* #f :to self))) (set! (-> self column) (ppointer->handle gp-0)) (send-event (ppointer->process gp-0) 'anim-mode 'loop) (send-event (ppointer->process gp-0) 'art-joint-anim "ogreboss-column-idle" 0) @@ -1417,8 +1129,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (try-preload-stream *art-control* "$GAMCAM23" 0 self (the-as float -99.0)) (when *target* (let ((gp-0 (-> *target* control trans))) @@ -1432,19 +1143,16 @@ ) (none) ) - :code - (behavior () + :code (behavior () (ogreboss-reset-camera) (ogreboss-idle-loop) (none) ) - :post - (the-as (function none :behavior ogreboss) ja-post) + :post (the-as (function none :behavior ogreboss) ja-post) ) (defstate ogreboss-intro (ogreboss) - :code - (behavior () + :code (behavior () (when (zero? (-> self try-count)) (process-drawable-delay-player (seconds 1)) (let ((gp-0 (get-process *default-dead-pool* pov-camera #x4000))) @@ -1468,39 +1176,25 @@ ) (send-event (handle->process (-> self column)) 'anim-mode 'play1) (send-event (handle->process (-> self column)) 'art-joint-anim "ogreboss-column-intro" 0) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 24))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 24)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 24)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-intro-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (close-specific-task! (game-task ogre-boss) (task-status need-hint)) (suspend) (send-event *target* 'continue (get-continue-by-name *game-info* "ogre-start")) (ogreboss-inc-try-count) ) - (set-setting! *setting-control* self 'music 'ogreboss (-> (new 'static 'array float 1 0.0) 0) 0) + (set-setting! 'music 'ogreboss 0.0 0) (go ogreboss-wait-for-player) (none) ) - :post - (the-as (function none :behavior ogreboss) ja-post) + :post (the-as (function none :behavior ogreboss) ja-post) ) (defstate ogreboss-wait-for-player (ogreboss) - :trans - (behavior () + :trans (behavior () (when *target* (if (ogreboss-player-inside-range? (the-as float 614400.0)) (go ogreboss-stage1) @@ -1511,13 +1205,11 @@ ) (none) ) - :code - (behavior () + :code (behavior () (ogreboss-idle-loop) (none) ) - :post - (the-as (function none :behavior ogreboss) ja-post) + :post (the-as (function none :behavior ogreboss) ja-post) ) (defun ogreboss-debug-adjust-difficulty () @@ -1559,19 +1251,15 @@ gp-0 ) -(defbehavior ogreboss-shoot-boulder ogreboss ((arg0 int)) +(defbehavior ogreboss-shoot-boulder ogreboss ((arg0 pickup-type)) + ;; TODO non U1 v1 compatibility!! (let ((gp-0 (new 'stack-no-clear 'ogreboss-missile-init-data))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 src) (-> self node-list data 52 bone transform vector 3)) + (set! (-> gp-0 src) (-> self node-list data (#if *jak1-full-game* 50 52) bone transform vector 3)) (set! (-> gp-0 duration) - (the-as - time-frame - (the int - (* 300.0 (+ 1.25 (* -0.25 (-> self level)) (/ (-> (new 'static 'array float 1 0.5) 0) (-> self difficulty)))) - ) - ) + (the-as time-frame (the int (* 300.0 (+ 1.25 (* -0.25 (-> self level)) (/ 0.5 (-> self difficulty)))))) ) - (set! (-> gp-0 pickup-type) (the-as pickup-type arg0)) + (set! (-> gp-0 pickup-type) arg0) (set! (-> gp-0 blast-radius) 32768.0) (cond (*target* @@ -1597,33 +1285,19 @@ ) (set! (-> gp-0 dest) s5-0) ) - (sound-play-by-name - (static-sound-name "ogre-fires") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) - (let ((s5-2 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-2 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-2) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 part-tracker-init (-> *part-group-id-table* 470) -1 #f #f #f (-> gp-0 src)) - (-> s5-2 ppointer) - ) - ) - (let ((s5-3 (get-process *default-dead-pool* ogreboss-missile #x4000))) - (when s5-3 - (let ((t9-8 (method-of-type ogreboss-missile activate))) - (t9-8 (the-as ogreboss-missile s5-3) self 'ogreboss-missile (the-as pointer #x70004000)) - ) - (run-now-in-process s5-3 ogreboss-missile-init-by-other gp-0 (-> self entity)) - (-> s5-3 ppointer) - ) + (sound-play "ogre-fires" :position (the-as symbol (-> self root-override trans))) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 470) + -1 + #f + #f + #f + (-> gp-0 src) + :to *entity-pool* ) + (process-spawn ogreboss-missile gp-0 (-> self entity) :to self) ) 0 (none) @@ -1632,36 +1306,18 @@ (defbehavior ogreboss-submerge ogreboss ((arg0 time-frame) (arg1 float)) (when (not (-> self submerged)) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 13) - ) + ((ja-group? ogreboss-dive-ja) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) arg1) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max arg1)) ) ) (else - (ja-channel-push! 1 30) - (let ((s4-0 (-> self skel root-channel 0))) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> s4-0 param 0) (ja-aframe (the-as float 22.0) 0)) - (set! (-> s4-0 param 1) arg1) - (set! (-> s4-0 frame-num) 0.0) - (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ogreboss-dive-ja :num! (seek! (ja-aframe (the-as float 22.0) 0) arg1) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((s4-1 (-> self skel root-channel 0))) - (set! (-> s4-1 param 0) (ja-aframe (the-as float 22.0) 0)) - (set! (-> s4-1 param 1) arg1) - (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 22.0) 0) arg1)) ) (cond ((-> self at-near-spot) @@ -1699,22 +1355,10 @@ ) ) ) - (let ((s4-2 (-> self skel root-channel 0))) - (set! (-> s4-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> s4-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 13)) data 0 length) -1)) - ) - (set! (-> s4-2 param 1) arg1) - (set! (-> s4-2 frame-num) (ja-aframe (the-as float 22.0) 0)) - (joint-control-channel-group! s4-2 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-dive-ja :num! (seek! max arg1) :frame-num (ja-aframe (the-as float 22.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) arg1) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max arg1)) ) ) ) @@ -1770,22 +1414,10 @@ ) ) ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 14))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 14)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) arg0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 14)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-rise-ja :num! (seek! max arg0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) arg0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max arg0)) ) ) 0 @@ -1822,8 +1454,7 @@ ) (defstate ogreboss-stage1 (ogreboss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('next-stage) (set! (-> self bridge-assembled) #t) @@ -1831,13 +1462,11 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (-> self bridge-assembled) (ogreboss-player-inside-range? (the-as float 524288.0)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) @@ -1846,89 +1475,48 @@ ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self mask) (logior (process-mask enemy) (-> self mask))) (ogreboss-set-stage1-camera) - (ogreboss-move-near (seconds 3) (-> (new 'static 'array float 1 1.0) 0)) + (ogreboss-move-near (seconds 3) (the-as float 1.0)) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 16) - ) - (ja-channel-push! 1 30) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + ((ja-group? ogreboss-victory-ja) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ogreboss-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (ja-channel-push! 1 30) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ogreboss-roar-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (let* ((gp-0 (the int (* (-> self difficulty) (+ 8.0 (* 4.0 (-> self level)))))) - (f0-17 (-> (new 'static 'array float 1 1.0) 0)) + (f0-17 1.0) (f1-2 0.15) (f2-2 (-> self difficulty)) (f30-0 (+ f0-17 (* f1-2 (* f2-2 f2-2) (-> self level)))) ) - (ja-channel-push! 1 30) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) f30-0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ogreboss-attack2-start-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) f30-0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (countdown (gp-1 (+ gp-0 -1)) - (let ((s5-0 0)) + (let ((s5-0 (pickup-type none))) (let ((f28-0 0.0)) (cond - ((>= (-> (new 'static 'array float 1 1.0) 0) (-> *target* fact-info-target health)) + ((>= 1.0 (-> *target* fact-info-target health)) (set! f28-0 0.1) ) - ((>= (-> (new 'static 'array float 1 2.0) 0) (-> *target* fact-info-target health)) + ((>= 2.0 (-> *target* fact-info-target health)) (set! f28-0 0.05) ) ) @@ -1937,7 +1525,7 @@ (* 0.0 f28-0) ) ((< (-> self try-count) (the-as uint 10)) - (* (-> (new 'static 'array float 1 0.5) 0) f28-0) + (* 0.5 f28-0) ) (else (empty) @@ -1946,85 +1534,40 @@ ) ) (if (and *target* (< (rand-vu) f28-0)) - (set! s5-0 4) + (set! s5-0 (pickup-type eco-green)) ) ) (ogreboss-shoot-boulder s5-0) ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) f30-0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-attack2-loop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) f30-0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (ogreboss-inc-try-count) ) - (ogreboss-shoot-boulder 3) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) f30-0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ogreboss-shoot-boulder (pickup-type eco-blue)) + (ja-no-eval :group! ogreboss-attack2-last-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) f30-0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) - (ogreboss-move-far (seconds 2) (-> (new 'static 'array float 1 1.0) 0)) - (ja-channel-push! 1 30) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-28 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-28 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-28 frame-num) 0.0) - (joint-control-channel-group! a0-28 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + (ogreboss-move-far (seconds 2) (the-as float 1.0)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ogreboss-victory-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1))) - (set! (-> a0-29 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ogreboss-stage1) (none) ) - :post - ogreboss-post + :post ogreboss-post ) (defbehavior ogreboss-roll-boulder ogreboss () - (sound-play-by-name - (static-sound-name "ogre-fires") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-fires" :position (the-as symbol (-> self root-override trans))) (+! (-> self roll-boulder) (rand-vu-int-range 1 2)) (if (>= (-> self roll-boulder) 3) (+! (-> self roll-boulder) -3) @@ -2032,37 +1575,13 @@ (let ((v1-7 (-> self roll-boulder))) (cond ((zero? v1-7) - (let ((gp-2 (get-process *default-dead-pool* ogreboss-bounce-boulder #x4000))) - (when gp-2 - (let ((t9-4 (method-of-type ogreboss-bounce-boulder activate))) - (t9-4 (the-as ogreboss-bounce-boulder gp-2) self 'ogreboss-bounce-boulder (the-as pointer #x70004000)) - ) - (run-now-in-process gp-2 ogreboss-bounce-boulder-init-by-other 2 (-> self entity)) - (-> gp-2 ppointer) - ) - ) + (process-spawn ogreboss-bounce-boulder 2 (-> self entity) :to self) ) ((= v1-7 1) - (let ((gp-3 (get-process *default-dead-pool* ogreboss-bounce-boulder #x4000))) - (when gp-3 - (let ((t9-7 (method-of-type ogreboss-bounce-boulder activate))) - (t9-7 (the-as ogreboss-bounce-boulder gp-3) self 'ogreboss-bounce-boulder (the-as pointer #x70004000)) - ) - (run-now-in-process gp-3 ogreboss-bounce-boulder-init-by-other 1 (-> self entity)) - (-> gp-3 ppointer) - ) - ) + (process-spawn ogreboss-bounce-boulder 1 (-> self entity) :to self) ) (else - (let ((gp-4 (get-process *default-dead-pool* ogreboss-bounce-boulder #x4000))) - (when gp-4 - (let ((t9-10 (method-of-type ogreboss-bounce-boulder activate))) - (t9-10 (the-as ogreboss-bounce-boulder gp-4) self 'ogreboss-bounce-boulder (the-as pointer #x70004000)) - ) - (run-now-in-process gp-4 ogreboss-bounce-boulder-init-by-other 0 (-> self entity)) - (-> gp-4 ppointer) - ) - ) + (process-spawn ogreboss-bounce-boulder 0 (-> self entity) :to self) ) ) ) @@ -2076,11 +1595,8 @@ ) (let ((f30-0 (the float (- (-> *display* base-frame-counter) (-> self hit-time))))) (when (and (> (-> self hit-count) 0) (>= 45.0 f30-0)) - (set! f0-0 (+ (ja-aframe (-> (new 'static 'array float 1 0.0) 0) 1) - (* 0.022222223 - f30-0 - (- (ja-aframe (the-as float 8.0) 1) (ja-aframe (-> (new 'static 'array float 1 0.0) 0) 1)) - ) + (set! f0-0 (+ (ja-aframe (the-as float 0.0) 1) + (* 0.022222223 f30-0 (- (ja-aframe (the-as float 8.0) 1) (ja-aframe (the-as float 0.0) 1))) ) ) (set! f1-0 (cond @@ -2097,11 +1613,7 @@ ) ) ) - (let ((v1-22 (-> self skel root-channel 1))) - (set! (-> v1-22 frame-interp) f1-0) - (set! (-> v1-22 num-func) num-func-identity) - (set! (-> v1-22 frame-num) f0-0) - ) + (ja :chan 1 :frame-interp f1-0 :num-func num-func-identity :frame-num f0-0) ) 0 (none) @@ -2128,69 +1640,25 @@ (let ((v1-0 arg2)) (the-as object (when (= v1-0 'attack) (when (-> self vulnerable) - (cond - (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 128) - ) - (let ((gp-0 (-> self skel root-channel 1))) - (set! (-> gp-0 frame-interp) 0.0) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 11)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) + (if ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 128) ) - ) - (else - (let ((gp-1 (-> self skel root-channel 1))) - (set! (-> gp-1 frame-interp) 0.0) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 10)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :chan 1 :group! ogreboss-hit-crotch-ja :num! min :frame-interp 0.0) + (ja :chan 1 :group! ogreboss-hit-chest-ja :num! min :frame-interp 0.0) ) - ) (set! (-> self hit-time) (-> *display* base-frame-counter)) (let ((v1-17 (rand-vu-int-range 0 2))) (cond ((zero? v1-17) - (sound-play-by-name - (static-sound-name "ogre-grunt1") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-grunt1" :position (the-as symbol (-> self root-override trans))) ) ((= v1-17 1) - (sound-play-by-name - (static-sound-name "ogre-grunt2") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-grunt2" :position (the-as symbol (-> self root-override trans))) ) (else - (sound-play-by-name - (static-sound-name "ogre-grunt3") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-grunt3" :position (the-as symbol (-> self root-override trans))) ) ) ) @@ -2207,41 +1675,25 @@ ) (defstate ogreboss-stage2 (ogreboss) - :event - ogreboss-attack-event-handler - :enter - (behavior () + :event ogreboss-attack-event-handler + :enter (behavior () (set! (-> self boulder) (the-as handle #f)) (none) ) - :trans - (behavior () + :trans (behavior () 0 (none) ) - :code - (behavior () + :code (behavior () (ogreboss-set-stage2-camera) - (ogreboss-move-far (seconds 0.1) (-> (new 'static 'array float 1 2.0) 0)) + (ogreboss-move-far (seconds 0.1) (the-as float 2.0)) (let ((f30-0 (* 0.75 (-> self difficulty)))) (let ((gp-0 #f)) - (ja-channel-push! 1 60) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.5) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! ogreboss-attack2-start-ja :num! (seek! max 1.5) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.5) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 1.5)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (while (not gp-0) @@ -2252,83 +1704,42 @@ (ogreboss-player-inside-range? (the-as float 409600.0)) ) ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) f30-0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-attack2-loop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (if gp-0 0 ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) f30-0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) (ogreboss-roll-boulder) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) f30-0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-attack2-last-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) f30-0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (go ogreboss-stage3-shuffle) (none) ) - :post - ogreboss-post + :post ogreboss-post ) (defbehavior ogreboss-spawn-super-boulder ogreboss () - (let ((gp-0 (get-process *default-dead-pool* ogreboss-super-boulder #x4000))) - (set! (-> self boulder) - (ppointer->handle - (when gp-0 - (let ((t9-1 (method-of-type ogreboss-super-boulder activate))) - (t9-1 (the-as ogreboss-super-boulder gp-0) self 'ogreboss-super-boulder (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - ogreboss-super-boulder-init-by-other - (-> self far-pos) - (-> self grow-time) - (-> self entity) - ) - (-> gp-0 ppointer) - ) - ) + (set! (-> self boulder) + (ppointer->handle + (process-spawn ogreboss-super-boulder (-> self far-pos) (-> self grow-time) (-> self entity) :to self) ) - ) + ) 0 (none) ) (defstate ogreboss-stage3-shuffle (ogreboss) - :event - ogreboss-attack-event-handler - :enter - (behavior () + :event ogreboss-attack-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self hit-count) 0) (set! (-> self max-hit-count) (the int (* 6.0 (-> self difficulty)))) @@ -2336,16 +1747,14 @@ (set! (-> self boulder) (the-as handle #f)) (none) ) - :exit - (behavior () + :exit (behavior () (send-event *camera* 'point-of-interest #f) (set! (-> self vulnerable) #f) (none) ) - :trans - (behavior () + :trans (behavior () (let ((v1-1 (handle->process (-> self boulder)))) - (if (and v1-1 (>= (-> (the-as ogreboss-super-boulder v1-1) size) (-> (new 'static 'array float 1 1.0) 0))) + (if (and v1-1 (>= (-> (the-as ogreboss-super-boulder v1-1) size) 1.0)) (go ogreboss-stage3-throw) ) ) @@ -2358,51 +1767,27 @@ 0 (none) ) - :code - (behavior () + :code (behavior () (set! (-> self shuffle-pos) 0.0) - (let ((f30-0 (+ (-> (new 'static 'array float 1 1.0) 0) - (* (-> (new 'static 'array float 1 0.25) 0) (-> self difficulty) (-> self level)) - ) - ) - (gp-0 (if (rand-vu-percent? (-> (new 'static 'array float 1 0.5) 0)) + (let ((f30-0 (+ 1.0 (* 0.25 (-> self difficulty) (-> self level)))) + (gp-0 (if (rand-vu-percent? (the-as float 0.5)) 0 1 ) ) ) - (ja-channel-push! 1 60) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! ogreboss-shuffle-prepare-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (ogreboss-spawn-super-boulder) (set! (-> self state-time) (-> *display* base-frame-counter)) - (ja-channel-push! 2 15) - (let ((s5-0 (-> self skel root-channel 1))) - (set! (-> s5-0 frame-interp) 0.0) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data 10)) - num-func-identity - ) - (set! (-> s5-0 frame-num) 0.0) - ) + (ja-channel-push! 2 (seconds 0.05)) + (ja :chan 1 :group! ogreboss-hit-chest-ja :num! min :frame-interp 0.0) (set! (-> self vulnerable) #t) - (while #t + (loop (if (>= -61440.0 (-> self shuffle-pos)) (set! gp-0 1) ) @@ -2412,128 +1797,56 @@ (cond ((zero? gp-0) (set! gp-0 1) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 18))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 18)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) f30-0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 18)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-shuffle-right-start-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (let ((s5-1 (rand-vu-int-range 1 5))) (while (and (> s5-1 0) (< -61440.0 (-> self shuffle-pos))) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 19))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 19)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) f30-0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 19)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-shuffle-right-loop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) (set! (-> self shuffle-pos) (- (-> self shuffle-pos) (* 16384.0 (-> *display* seconds-per-frame) f30-0))) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) f30-0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (+! s5-1 -1) ) ) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 20))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 20)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) f30-0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 20)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-shuffle-right-stop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) f30-0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (else (set! gp-0 0) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 21))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 21)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) f30-0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 21)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-shuffle-left-start-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) f30-0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (let ((s5-2 (rand-vu-int-range 1 5))) (while (and (> s5-2 0) (< (-> self shuffle-pos) 61440.0)) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 22))) - (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 22)) data 0 length) -1)) - ) - (set! (-> a0-22 param 1) f30-0) - (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 22)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-shuffle-left-loop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) (+! (-> self shuffle-pos) (* 16384.0 (-> *display* seconds-per-frame) f30-0)) (suspend) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) f30-0) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (+! s5-2 -1) ) ) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> self draw art-group data 23))) - (set! (-> a0-26 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 23)) data 0 length) -1)) - ) - (set! (-> a0-26 param 1) f30-0) - (set! (-> a0-26 frame-num) 0.0) - (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> self draw art-group data 23)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-shuffle-left-stop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) (suspend) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1))) - (set! (-> a0-27 param 1) f30-0) - (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -2541,8 +1854,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (vector+*! (-> self root-override trans) (-> self far-pos) (-> self side-dir) (-> self shuffle-pos)) (ogreboss-post) (none) @@ -2550,46 +1862,21 @@ ) (defstate ogreboss-stage3-throw (ogreboss) - :code - (behavior () - (ja-channel-push! 1 30) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) (send-event (handle->process (-> self boulder)) 'go-throw) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-attack3-throw-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (ja-channel-push! 1 30) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ogreboss-victory-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ogreboss-submerge (seconds 1) (-> (new 'static 'array float 1 1.0) 0)) + (ogreboss-submerge (seconds 1) (the-as float 1.0)) (while (handle->process (-> self boulder)) (suspend) ) @@ -2597,35 +1884,21 @@ (go ogreboss-stage1) (none) ) - :post - (the-as (function none :behavior ogreboss) transform-post) + :post (the-as (function none :behavior ogreboss) transform-post) ) (defstate ogreboss-stage3-hit (ogreboss) - :code - (behavior () - (set! (-> self level) (+ (-> (new 'static 'array float 1 1.0) 0) (-> self level))) - (if (< (-> (new 'static 'array float 1 2.0) 0) (-> self level)) + :code (behavior () + (set! (-> self level) (+ 1.0 (-> self level))) + (if (< 2.0 (-> self level)) (go ogreboss-die) ) (send-event (handle->process (-> self boulder)) 'go-hit) - (ja-channel-push! 1 60) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! ogreboss-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self bridge-assembled) #f) (set! (-> self submerged) #t) @@ -2635,8 +1908,7 @@ (go ogreboss-stage1) (none) ) - :post - (the-as (function none :behavior ogreboss) transform-post) + :post (the-as (function none :behavior ogreboss) transform-post) ) (defbehavior ogreboss-trigger-steps ogreboss () @@ -2666,28 +1938,15 @@ ) (defstate ogreboss-die (ogreboss) - :code - (behavior () + :code (behavior () (ogreboss-reset-camera) (send-event (handle->process (-> self boulder)) 'go-die) - (ja-channel-push! 1 60) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! ogreboss-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (transform-post) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (ogreboss-trigger-steps) (go ogreboss-dead) @@ -2696,14 +1955,12 @@ ) (defstate ogreboss-dead (ogreboss) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior ogreboss) process-drawable-fuel-cell-handler ) - :code - (behavior () - (clear-pending-settings-from-process *setting-control* self 'music) + :code (behavior () + (remove-setting! 'music) (ogreboss-reset-camera) (let ((gp-0 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-0 from) self) @@ -2727,8 +1984,8 @@ (ja-post) (when (not (task-complete? *game-info* (-> self entity extra perm task))) (let ((gp-1 (new 'stack-no-clear 'vector))) - (let ((a0-9 (the-as entity (entity-actor-lookup (-> self entity) 'trigger-actor 2)))) - (if (not (the-as entity-actor a0-9)) + (let ((a0-9 (entity-actor-lookup (-> self entity) 'trigger-actor 2))) + (if (not a0-9) (set! a0-9 (-> self entity)) ) (set! (-> gp-1 quad) (-> a0-9 extra trans quad)) @@ -2763,9 +2020,9 @@ ) (set! (-> self target-count) gp-1) ) - (set-vector! (-> self target-offset-array 0) 0.0 16384.0 0.0 (-> (new 'static 'array float 1 1.0) 0)) - (set-vector! (-> self target-offset-array-2) 0.0 16384.0 0.0 (-> (new 'static 'array float 1 1.0) 0)) - (set-vector! (-> self target-offset-array-3) 0.0 16384.0 0.0 (-> (new 'static 'array float 1 1.0) 0)) + (set-vector! (-> self target-offset-array 0) 0.0 16384.0 0.0 1.0) + (set-vector! (-> self target-offset-array-2) 0.0 16384.0 0.0 1.0) + (set-vector! (-> self target-offset-array-3) 0.0 16384.0 0.0 1.0) (set! (-> self target-blast-radius-array 0) 24576.0) (set! (-> self target-blast-radius-array 1) 24576.0) (set! (-> self target-blast-radius-array 2) 24576.0) @@ -2849,7 +2106,7 @@ (set! (-> obj try-count) (-> obj entity extra perm user-uint8 0)) (cond ((< (-> obj try-count) (the-as uint 5)) - (set! (-> obj difficulty) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> obj difficulty) 1.0) ) ((< (-> obj try-count) (the-as uint 10)) (set! (-> obj difficulty) 0.83334) @@ -2858,7 +2115,7 @@ (set! (-> obj difficulty) 0.66667) ) (else - (set! (-> obj difficulty) (-> (new 'static 'array float 1 0.5) 0)) + (set! (-> obj difficulty) 0.5) ) ) (set! (-> obj lava) (entity-actor-lookup (-> obj entity) 'water-actor 0)) @@ -2871,8 +2128,8 @@ (set! (-> obj z-plane w) (- (vector-dot (-> obj z-plane) (-> obj root-override trans)))) (vector-x-quaternion! (-> obj side-dir) (-> obj root-override quat)) (set! (-> obj far-pos quad) (-> obj root-override trans quad)) - (let ((f0-38 (-> (new 'static 'array float 1 1.0) 0))) - (set-vector! (-> obj root-override scale) f0-38 f0-38 f0-38 (-> (new 'static 'array float 1 1.0) 0)) + (let ((f0-38 1.0)) + (set-vector! (-> obj root-override scale) f0-38 f0-38 f0-38 1.0) ) (vector+*! (-> obj near-pos) (-> obj far-pos) (-> obj z-plane) (the-as float 348160.0)) (set! (-> obj at-near-spot) #t) diff --git a/goal_src/levels/racer_common/collide-reaction-racer.gc b/goal_src/levels/racer_common/collide-reaction-racer.gc index 3560ba6d2e..e2c30686d8 100644 --- a/goal_src/levels/racer_common/collide-reaction-racer.gc +++ b/goal_src/levels/racer_common/collide-reaction-racer.gc @@ -61,7 +61,7 @@ (if s3-1 (set! sv-104 (logior sv-104 2)) ) - (when (zero? (logand (-> arg0 prev-status) 1)) + (when (zero? (logand (-> arg0 prev-status) (cshape-moving-flags onsurf))) (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) (set! sv-96 (logior sv-96 2048)) (when (not s3-1) @@ -113,22 +113,21 @@ (set! (-> arg0 cur-pat mode) 1) (set! (-> arg0 unknown-vector70 quad) (-> arg1 best-tri intersect quad)) (set! (-> arg0 unknown-vector71 quad) (-> arg0 poly-normal quad)) - (set! (-> arg0 unknown-int60) (the-as uint (-> arg1 best-tri pat))) + (set! (-> arg0 wall-pat) (-> arg1 best-tri pat)) (vector-reflect-flat-above! arg2 (-> sv-88 0) sv-84) (cond - ((not - (and (>= (-> arg1 best-from-prim local-sphere w) - (vector-dot - (-> arg0 ground-poly-normal) - (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-tri intersect) (-> arg0 ground-touch-point)) - ) - ) - (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) - (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) (seconds 0.3)) - (zero? (logand sv-104 32)) - ) - ) - ) + ((not (and (>= (-> arg1 best-from-prim local-sphere w) + (vector-dot + (-> arg0 ground-poly-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-tri intersect) (-> arg0 ground-touch-point)) + ) + ) + (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) + (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) (seconds 0.3)) + (zero? (logand sv-104 32)) + ) + ) + ) ) (else (set! sv-104 (logior sv-104 256)) @@ -183,7 +182,7 @@ ) ) (logior! (-> arg0 status) sv-96) - (set! (-> arg0 reaction-flag) (the-as uint sv-104)) + (set! (-> arg0 reaction-flag) (the-as cshape-reaction-flags sv-104)) (update! (-> arg0 history-data (-> arg0 unknown-halfword00)) arg0 @@ -192,7 +191,7 @@ arg2 ) (set! (-> arg0 unknown-halfword00) (logand (+ (-> arg0 unknown-halfword00) 1) 127)) - (the-as uint sv-96) + (the-as cshape-moving-flags sv-96) ) diff --git a/goal_src/levels/racer_common/racer-part.gc b/goal_src/levels/racer_common/racer-part.gc index b49e31507f..0c0c3ee1af 100644 --- a/goal_src/levels/racer_common/racer-part.gc +++ b/goal_src/levels/racer_common/racer-part.gc @@ -53,29 +53,25 @@ :id 108 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 740 :flags (launch-asap))) + :parts ((sp-item 740 :flags (launch-asap))) ) (defpartgroup group-part-hud-racer-speed :id 109 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 741 :flags (launch-asap))) + :parts ((sp-item 741 :flags (launch-asap))) ) (defpartgroup group-part-hud-racer-speed-front :id 110 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 1999 :flags (launch-asap))) + :parts ((sp-item 1999 :flags (launch-asap))) ) (defpart 741 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x45f)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x45f)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3)) (sp-int spt-rot-x 4) @@ -90,8 +86,7 @@ ) (defpart 740 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x45f)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x45f)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-int spt-rot-x 4) @@ -108,8 +103,7 @@ ) (defpart 1999 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x7 :page #x45f)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7 :page #x45f)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.8)) (sp-int spt-rot-x 4) @@ -202,37 +196,32 @@ :id 111 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 737 :flags (launch-asap))) + :parts ((sp-item 737 :flags (launch-asap))) ) (defpartgroup group-part-hud-racer-heat-dial :id 112 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 738 :flags (launch-asap))) + :parts ((sp-item 738 :flags (launch-asap))) ) (defpartgroup group-part-hud-racer-heat :id 113 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 739 :flags (launch-asap))) + :parts ((sp-item 739 :flags (launch-asap))) ) (defpartgroup group-part-hud-racer-heat-slice :id 114 :flags (use-local-clock screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 2010 :flags (launch-asap)) (sp-item 2011 :flags (launch-asap)) (sp-item 2012 :flags (launch-asap))) + :parts ((sp-item 2010 :flags (launch-asap)) (sp-item 2011 :flags (launch-asap)) (sp-item 2012 :flags (launch-asap))) ) (defpart 739 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x45f)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x45f)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3)) (sp-int spt-rot-x 4) @@ -247,8 +236,7 @@ ) (defpart 737 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x45f)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x45f)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3.5)) (sp-int spt-rot-x 4) @@ -263,8 +251,7 @@ ) (defpart 738 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x45f)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x45f)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.9)) (sp-int spt-rot-x 4) @@ -280,8 +267,7 @@ ) (defpart 2010 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-copy-from-other spt-scale-y -4) @@ -296,8 +282,7 @@ ) (defpart 2011 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-copy-from-other spt-scale-y -4) @@ -312,8 +297,7 @@ ) (defpart 2012 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-copy-from-other spt-scale-y -4) @@ -336,72 +320,70 @@ ) -(defmethod TODO-RENAME-19 hud-bike-heat ((obj hud-bike-heat)) +(defmethod hud-update hud-bike-heat ((obj hud-bike-heat)) (if *target* - (TODO-RENAME-16 obj (the int (-> *target* racer heat)) 0) + (tally-value obj (the int (-> *target* racer heat)) 0) ) 0 (none) ) (defmethod init-particles! hud-bike-heat ((obj hud-bike-heat) (arg0 int)) - (with-pp - (push-setting! *setting-control* pp 'common-page 'set 0.0 2) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 111) obj)) - (set! (-> obj particles s5-0 init-pos x) 13.0) - (set! (-> obj particles s5-0 init-pos y) 370.0) - (set! (-> obj particles s5-0 init-pos z) 10.0) - (set! (-> obj particles s5-0 part matrix) -1) - ) - (+! (-> obj nb-of-particles) 1) + (add-setting! 'common-page 'set 0.0 2) + (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) + (let ((s5-0 (-> obj nb-of-particles))) + (set! (-> obj particles s5-0) (new 'static 'hud-particle)) + (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 111) obj)) + (set! (-> obj particles s5-0 init-pos x) 13.0) + (set! (-> obj particles s5-0 init-pos y) 370.0) + (set! (-> obj particles s5-0 init-pos z) 10.0) + (set! (-> obj particles s5-0 part matrix) -1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 112) obj)) - (set! (-> obj particles s5-1 init-pos x) 70.0) - (set! (-> obj particles s5-1 init-pos y) 370.0) - (set! (-> obj particles s5-1 init-pos z) 6.0) - (set! (-> obj particles s5-1 part matrix) -1) - ) - (+! (-> obj nb-of-particles) 1) - ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-2 (-> obj nb-of-particles))) - (set! (-> obj particles s5-2) (new 'static 'hud-particle)) - (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 113) obj)) - (set! (-> obj particles s5-2 init-pos x) 20.0) - (set! (-> obj particles s5-2 init-pos y) 370.0) - (set! (-> obj particles s5-2 init-pos z) 1.0) - (set! (-> obj particles s5-2 part matrix) -1) - ) - (+! (-> obj nb-of-particles) 1) - ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-3 (-> obj nb-of-particles))) - (set! (-> obj particles s5-3) (new 'static 'hud-particle)) - (set! (-> obj particles s5-3 part) (create-launch-control (-> *part-group-id-table* 114) obj)) - (set! (-> obj particles s5-3 init-pos x) 70.0) - (set! (-> obj particles s5-3 init-pos y) 370.0) - (set! (-> obj particles s5-3 init-pos z) 7.0) - (set! (-> obj particles s5-3 part matrix) -1) - ) - (+! (-> obj nb-of-particles) 1) - ) - (dotimes (s5-4 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-4 part matrix) -1) - (set! (-> obj particles s5-4 part matrix) (sprite-allocate-user-hvdf)) - ) - ) - (set! (-> obj x-sgn) -1) - (set! (-> obj y-sgn) 1) - (set! (-> obj force-on-screen) #t) - 0 - (none) + (+! (-> obj nb-of-particles) 1) ) + (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) + (let ((s5-1 (-> obj nb-of-particles))) + (set! (-> obj particles s5-1) (new 'static 'hud-particle)) + (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 112) obj)) + (set! (-> obj particles s5-1 init-pos x) 70.0) + (set! (-> obj particles s5-1 init-pos y) 370.0) + (set! (-> obj particles s5-1 init-pos z) 6.0) + (set! (-> obj particles s5-1 part matrix) -1) + ) + (+! (-> obj nb-of-particles) 1) + ) + (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) + (let ((s5-2 (-> obj nb-of-particles))) + (set! (-> obj particles s5-2) (new 'static 'hud-particle)) + (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 113) obj)) + (set! (-> obj particles s5-2 init-pos x) 20.0) + (set! (-> obj particles s5-2 init-pos y) 370.0) + (set! (-> obj particles s5-2 init-pos z) 1.0) + (set! (-> obj particles s5-2 part matrix) -1) + ) + (+! (-> obj nb-of-particles) 1) + ) + (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) + (let ((s5-3 (-> obj nb-of-particles))) + (set! (-> obj particles s5-3) (new 'static 'hud-particle)) + (set! (-> obj particles s5-3 part) (create-launch-control (-> *part-group-id-table* 114) obj)) + (set! (-> obj particles s5-3 init-pos x) 70.0) + (set! (-> obj particles s5-3 init-pos y) 370.0) + (set! (-> obj particles s5-3 init-pos z) 7.0) + (set! (-> obj particles s5-3 part matrix) -1) + ) + (+! (-> obj nb-of-particles) 1) + ) + (dotimes (s5-4 (-> obj nb-of-particles)) + (if (= (-> obj particles s5-4 part matrix) -1) + (set! (-> obj particles s5-4 part matrix) (sprite-allocate-user-hvdf)) + ) + ) + (set! (-> obj x-sgn) -1) + (set! (-> obj y-sgn) 1) + (set! (-> obj force-on-screen) #t) + 0 + (none) ) (deftype hud-bike-speed (hud) @@ -413,66 +395,64 @@ ) -(defmethod TODO-RENAME-19 hud-bike-speed ((obj hud-bike-speed)) +(defmethod hud-update hud-bike-speed ((obj hud-bike-speed)) (if *target* - (TODO-RENAME-16 obj (the int (-> *target* control unknown-float01)) 0) + (tally-value obj (the int (-> *target* control unknown-float01)) 0) ) 0 (none) ) (defmethod init-particles! hud-bike-speed ((obj hud-bike-speed) (arg0 int)) - (with-pp - (push-setting! *setting-control* pp 'common-page 'set 0.0 2) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 108) obj)) - (set! (-> obj particles s5-0 init-pos x) 433.0) - (set! (-> obj particles s5-0 init-pos y) 370.0) - (set! (-> obj particles s5-0 init-pos z) 3.0) - (set! (-> obj particles s5-0 part matrix) -1) - ) - (+! (-> obj nb-of-particles) 1) + (add-setting! 'common-page 'set 0.0 2) + (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) + (let ((s5-0 (-> obj nb-of-particles))) + (set! (-> obj particles s5-0) (new 'static 'hud-particle)) + (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 108) obj)) + (set! (-> obj particles s5-0 init-pos x) 433.0) + (set! (-> obj particles s5-0 init-pos y) 370.0) + (set! (-> obj particles s5-0 init-pos z) 3.0) + (set! (-> obj particles s5-0 part matrix) -1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 109) obj)) - (set! (-> obj particles s5-1 init-pos x) 378.0) - (set! (-> obj particles s5-1 init-pos y) 370.0) - (set! (-> obj particles s5-1 init-pos z) 5.0) - (set! (-> obj particles s5-1 part matrix) -1) - ) - (+! (-> obj nb-of-particles) 1) - ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-2 (-> obj nb-of-particles))) - (set! (-> obj particles s5-2) (new 'static 'hud-particle)) - (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 110) obj)) - (set! (-> obj particles s5-2 init-pos x) 415.0) - (set! (-> obj particles s5-2 init-pos y) 370.0) - (set! (-> obj particles s5-2 init-pos z) 1.0) - (set! (-> obj particles s5-2 part matrix) -1) - ) - (+! (-> obj nb-of-particles) 1) - ) - (dotimes (s5-3 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-3 part matrix) -1) - (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) - ) - ) - (set! (-> obj x-sgn) 1) - (set! (-> obj y-sgn) 1) - (set! (-> obj force-on-screen) #t) - 0 - (none) + (+! (-> obj nb-of-particles) 1) ) + (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) + (let ((s5-1 (-> obj nb-of-particles))) + (set! (-> obj particles s5-1) (new 'static 'hud-particle)) + (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 109) obj)) + (set! (-> obj particles s5-1 init-pos x) 378.0) + (set! (-> obj particles s5-1 init-pos y) 370.0) + (set! (-> obj particles s5-1 init-pos z) 5.0) + (set! (-> obj particles s5-1 part matrix) -1) + ) + (+! (-> obj nb-of-particles) 1) + ) + (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) + (let ((s5-2 (-> obj nb-of-particles))) + (set! (-> obj particles s5-2) (new 'static 'hud-particle)) + (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 110) obj)) + (set! (-> obj particles s5-2 init-pos x) 415.0) + (set! (-> obj particles s5-2 init-pos y) 370.0) + (set! (-> obj particles s5-2 init-pos z) 1.0) + (set! (-> obj particles s5-2 part matrix) -1) + ) + (+! (-> obj nb-of-particles) 1) + ) + (dotimes (s5-3 (-> obj nb-of-particles)) + (if (= (-> obj particles s5-3 part matrix) -1) + (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) + ) + ) + (set! (-> obj x-sgn) 1) + (set! (-> obj y-sgn) 1) + (set! (-> obj force-on-screen) #t) + 0 + (none) ) (#when PC_PORT ;; extra methods needed for aspect ratio in pc port -(defmethod animate! hud-bike-heat ((obj hud-bike-heat) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-bike-heat ((obj hud-bike-heat) (arg0 symbol) (arg1 symbol)) (with-pc (let ((base-x (-> obj particles 0 init-pos x))) (*! base-x (-> *pc-settings* aspect-ratio-reciprocal)) @@ -492,7 +472,7 @@ (none) ) -(defmethod animate! hud-bike-speed ((obj hud-bike-speed) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-bike-speed ((obj hud-bike-speed) (arg0 symbol) (arg1 symbol)) (with-pc (let ((base-x (-> obj particles 1 init-pos x))) (+! base-x (* (- 512.0 base-x) (- 1.0 (-> *pc-settings* aspect-ratio-reciprocal)))) @@ -515,16 +495,14 @@ (defpartgroup group-racer-trans-pad :id 115 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 742 :fade-after (meters 160)) + :parts ((sp-item 742 :fade-after (meters 160)) (sp-item 743 :fade-after (meters 160)) (sp-item 744 :fade-after (meters 60) :falloff-to (meters 60) :flags (is-3d)) ) ) (defpart 742 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 7)) (sp-rnd-flt spt-scale-x (meters 14) (meters 1) 1.0) @@ -539,8 +517,7 @@ ) (defpart 743 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 4)) (sp-rnd-flt spt-scale-x (meters 7) (meters 1) 1.0) @@ -556,8 +533,7 @@ ) (defpart 744 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0.75) (meters 0.1) 1.0) (sp-flt spt-scale-x (meters 0)) @@ -580,8 +556,7 @@ ) (defpart 2211 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -603,8 +578,7 @@ ) (defpart 2207 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -628,8 +602,7 @@ ) (defpart 2221 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.35) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -651,8 +624,7 @@ ) (defpart 2208 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -676,8 +648,7 @@ ) (defpart 2218 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -700,8 +671,7 @@ ) (defpart 2215 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -725,8 +695,7 @@ ) (defpart 2216 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -750,8 +719,7 @@ ) (defpart 2831 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -775,8 +743,7 @@ ) (defpart 2214 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -800,8 +767,7 @@ ) (defpart 2220 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.025) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -824,8 +790,7 @@ ) (defpart 2213 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -849,8 +814,7 @@ ) (defpart 2275 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-x (meters 10)) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 3) 1.0) @@ -874,8 +838,7 @@ ) (defpart 2276 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-rnd-flt spt-num 0.04 0.03 1.0) (sp-rnd-flt spt-x (meters -0.2) (meters 0.4) 1.0) (sp-rnd-flt spt-z (meters -0.2) (meters 0.4) 1.0) @@ -897,8 +860,7 @@ ) (defpart 2212 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-func spt-birth-func 'birth-func-vector-orient) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 4) (meters -0.5) 1.0) @@ -917,8 +879,7 @@ ) (defpart 2225 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x2)) (sp-rnd-flt spt-num 4.0 16.0 1.0) (sp-flt spt-x (meters 0.9)) (sp-flt spt-y (meters 0.05)) @@ -947,8 +908,7 @@ ) (defpart 2226 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x2)) (sp-rnd-flt spt-num 4.0 16.0 1.0) (sp-flt spt-x (meters 0.9)) (sp-flt spt-y (meters 0.05)) @@ -977,8 +937,7 @@ ) (defpart 2227 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1001,8 +960,7 @@ ) (defpart 2277 - :init-specs - ((sp-flt spt-fade-r -5.0) + :init-specs ((sp-flt spt-fade-r -5.0) (sp-flt spt-fade-g -1.6) (sp-flt spt-fade-b 1.6) (sp-flt spt-fade-a 0.0) @@ -1012,8 +970,7 @@ ) (defpart 2278 - :init-specs - ((sp-flt spt-fade-r -0.2) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-r -0.2) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334)) ) (defpartgroup group-racer-explode @@ -1022,8 +979,7 @@ :linger-duration 3000 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2279 :period 600 :length 5) + :parts ((sp-item 2279 :period 600 :length 5) (sp-item 2280 :period 600 :length 40) (sp-item 2281 :period 600 :length 20) (sp-item 2282 :period 600 :length 20) @@ -1031,8 +987,7 @@ ) (defpart 2280 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -1059,13 +1014,11 @@ ) (defpart 2283 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) (defpart 2282 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-flt spt-scale-x (meters 0.3)) @@ -1085,8 +1038,7 @@ ) (defpart 2279 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 24)) @@ -1102,8 +1054,7 @@ ) (defpart 2281 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -1131,8 +1082,7 @@ ) (defpart 2284 - :init-specs - ((sp-flt spt-fade-r -1.0666667) + :init-specs ((sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g -1.0666667) (sp-flt spt-fade-b -2.1166666) (sp-int spt-next-time 60) @@ -1141,8 +1091,7 @@ ) (defpart 2285 - :init-specs - ((sp-flt spt-fade-r -0.5688889) + :init-specs ((sp-flt spt-fade-r -0.5688889) (sp-flt spt-fade-g -0.28444445) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334) @@ -1152,13 +1101,11 @@ ) (defpart 2286 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) (defpart 2229 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) (sp-copy-from-other spt-scale-y -4) diff --git a/goal_src/levels/racer_common/racer-states.gc b/goal_src/levels/racer_common/racer-states.gc index 45ba20095a..6582b1b6be 100644 --- a/goal_src/levels/racer_common/racer-states.gc +++ b/goal_src/levels/racer_common/racer-states.gc @@ -10,8 +10,7 @@ ;; DECOMP BEGINS (defstate target-racing-start (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) 'racer @@ -36,13 +35,14 @@ ) (('attack 'attack-or-shove 'attack-invinc) (let ((v1-27 (the-as attack-info (-> arg3 param 1)))) - (if (not (and (logtest? (-> v1-27 mask) 32) (or (= (-> v1-27 mode) 'burn) (= (-> v1-27 mode) 'burnup)))) + (if (not (and (logtest? (-> v1-27 mask) (attack-mask mode)) (or (= (-> v1-27 mode) 'burn) (= (-> v1-27 mode) 'burnup))) + ) (target-attacked arg2 (the-as attack-info (-> arg3 param 1)) arg0 (the-as process (-> arg3 param 0)) - target-racing-hit + (the-as (state symbol attack-info target) target-racing-hit) ) ) ) @@ -55,10 +55,8 @@ ) ) (('boost) - (sound-play-by-name (static-sound-name "get-blue-eco") (new-sound-id) 1024 0 0 1 #t) - (set! (-> self racer boost-sound-id) - (sound-play-by-name (static-sound-name "zoom-boost") (new-sound-id) 1024 0 0 1 #t) - ) + (sound-play "get-blue-eco") + (set! (-> self racer boost-sound-id) (sound-play "zoom-boost")) (set! (-> self racer boost-time) (-> *display* base-frame-counter)) (let ((f0-12 (seek (-> self racer boost-level) @@ -94,8 +92,7 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (when (not (or (= (-> self next-state name) 'target-racing) (= (-> self next-state name) 'target-racing-jump) (= (-> self next-state name) 'target-racing-bounce) @@ -134,7 +131,7 @@ (set! (-> *hud-parts* power 0 y-sgn) 1) (logclear! (-> self control root-prim prim-core action) (collide-action ca-9 ca-16)) (set! (-> self control unknown-surface00) *walk-mods*) - (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) (send-event *camera* 'clear-slave-option #x6000) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) @@ -148,17 +145,16 @@ (sound-stop (-> self racer engine-sound-id)) (set! (-> self racer engine-sound-id) (new 'static 'sound-id)) (set! (-> self control unknown-vector12 quad) (the-as uint128 0)) - (clear-pending-settings-from-process *setting-control* self 'sound-flava) + (remove-setting! 'sound-flava) (target-exit) ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (target-exit) (set! *display-profile* #f) (set! *display-entity-errors* #f) - (set-setting! *setting-control* self 'sound-flava #f 30.0 1) + (set-setting! 'sound-flava #f 30.0 (music-flava racer)) (if (zero? (-> self racer)) (set! (-> self racer) (new 'process 'racer-info)) ) @@ -184,7 +180,7 @@ (set! (-> self racer entity) #f) (let ((v1-28 (handle->process arg0))) (if v1-28 - (set! (-> self racer entity) (the-as entity-actor (-> v1-28 entity))) + (set! (-> self racer entity) (-> v1-28 entity)) ) ) (set! (-> self control surf) *race-track-surface*) @@ -244,20 +240,9 @@ (set! (-> self racer surface-y) (-> self control trans y)) (let ((s5-0 (-> self entity))) (set! (-> self entity) (-> self racer entity)) - (let ((s4-0 (get-process *8k-dead-pool* manipy #x4000))) - (set! (-> self manipy) - (the-as - (pointer manipy) - (when s4-0 - (let ((t9-9 (method-of-type manipy activate))) - (t9-9 (the-as manipy s4-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 manipy-init (-> self control trans) (-> self entity) *racer-sg* #f) - (-> s4-0 ppointer) - ) - ) - ) - ) + (set! (-> self manipy) + (manipy-spawn (-> self control trans) (-> self entity) *racer-sg* #f :from *8k-dead-pool* :to self) + ) (set! (-> self entity) s5-0) ) (when (-> self manipy) @@ -319,13 +304,12 @@ (go target-racing-get-on arg0) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defbehavior target-racing-smack-check target () (if (and (< 20480.0 (-> self control unknown-float01)) - (and (logtest? (-> self control status) 8) + (and (logtest? (-> self control status) (cshape-moving-flags twall)) (< (-> self control surface-angle) 0.5) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector70) (-> self control trans))) (s5-0 (new 'stack-no-clear 'vector)) @@ -345,21 +329,17 @@ ) (defstate target-racing (target) - :event - (-> target-racing-start event) - :enter - (behavior () + :event (-> target-racing-start event) + :enter (behavior () (set! (-> self control unknown-surface00) *racer-mods*) (none) ) - :exit - (behavior () + :exit (behavior () (target-racing-center-anim) ((-> target-racing-start exit)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) ) @@ -387,7 +367,7 @@ ) ) ) - (if (and (zero? (logand (-> self control status) 1)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (or (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (* (-> *TARGET-bank* ground-timeout) 2) ) @@ -403,29 +383,16 @@ (racer-buzz (+ 0.45 (* 1.7 (fabs (-> self racer slide-shift-x))))) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 138) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 138)) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) ) - ((let ((v1-16 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + ((let ((v1-16 (ja-group))) (or (or (= v1-16 (-> self draw art-group data 130)) (= v1-16 (-> self draw art-group data 131))) (> (-> self racer bounce) 0) ) @@ -440,14 +407,7 @@ ) (when (>= (-> self control unknown-float01) 40960.0) (set! (-> *part-id-table* 2225 init-specs 1 initial-valuef) 100.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2225) - (-> self control trans) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 2225) (-> self control trans)) ) (target-land-effect) (when (and (>= (-> self control ground-impact-vel) 61440.0) (zero? (-> self racer bounce))) @@ -495,55 +455,19 @@ ) (when (!= (-> self racer slide-shift-x) 0.0) (if (rand-vu-percent? 0.5) - (sound-play-by-name (static-sound-name "zoomer-rev1") (new-sound-id) 819 0 0 1 #t) - (sound-play-by-name (static-sound-name "zoomer-rev2") (new-sound-id) 819 0 0 1 #t) + (sound-play "zoomer-rev1" :vol 80) + (sound-play "zoomer-rev2" :vol 80) ) ) (set! (-> self racer bounce) 0) - (while #t + (loop (let ((gp-3 (-> *display* base-frame-counter))) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 123) - ) - ) - (ja-channel-push! 4 30) - (let ((s5-3 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-3 - (the-as art-joint-anim (-> self draw art-group data 123)) - num-func-identity - ) - (set! (-> s5-3 frame-num) (ja-aframe (-> self racer turn-anim-frame) 0)) - ) - (let ((a0-43 (-> self skel root-channel 1))) - (set! (-> a0-43 frame-group) (the-as art-joint-anim (-> self draw art-group data 124))) - (set! (-> a0-43 param 0) 0.0) - (joint-control-channel-group-eval! - a0-43 - (the-as art-joint-anim (-> self draw art-group data 124)) - num-func-chan - ) - ) - (let ((a0-44 (-> self skel root-channel 2))) - (set! (-> a0-44 frame-group) (the-as art-joint-anim (-> self draw art-group data 125))) - (set! (-> a0-44 param 0) 0.0) - (joint-control-channel-group-eval! - a0-44 - (the-as art-joint-anim (-> self draw art-group data 125)) - num-func-chan - ) - ) - (let ((a0-45 (-> self skel root-channel 3))) - (set! (-> a0-45 frame-group) (the-as art-joint-anim (-> self draw art-group data 126))) - (set! (-> a0-45 param 0) 0.0) - (joint-control-channel-group-eval! - a0-45 - (the-as art-joint-anim (-> self draw art-group data 126)) - num-func-chan - ) - ) + (when (not (ja-group? (-> self draw art-group data 123))) + (ja-channel-push! 4 (seconds 0.1)) + (ja :group! (-> self draw art-group data 123) :num! (identity (ja-aframe (-> self racer turn-anim-frame) 0))) + (ja :chan 1 :group! (-> self draw art-group data 124) :num! (chan 0)) + (ja :chan 2 :group! (-> self draw art-group data 125) :num! (chan 0)) + (ja :chan 3 :group! (-> self draw art-group data 126) :num! (chan 0)) ) (while (< (- (-> *display* base-frame-counter) gp-3) (seconds 1)) (if (or (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) @@ -557,21 +481,9 @@ (suspend) ) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 133) - ) - ) - (ja-channel-push! 1 120) - (let ((gp-4 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-4 - (the-as art-joint-anim (-> self draw art-group data 133)) - num-func-identity - ) - (set! (-> gp-4 frame-num) 0.0) - ) + (when (not (ja-group? (-> self draw art-group data 133))) + (ja-channel-push! 1 (seconds 0.4)) + (ja :group! (-> self draw art-group data 133) :num! min) ) (while (not (or (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (or (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1 x) @@ -580,16 +492,12 @@ ) ) (suspend) - (let ((a0-54 (-> self skel root-channel 0))) - (set! (-> a0-54 param 0) 1.0) - (joint-control-channel-group-eval! a0-54 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) ) (none) ) - :post - (behavior () + :post (behavior () (if (= (-> self next-state name) 'target-racing) (set! (-> self racer racing-time) (-> *display* base-frame-counter)) ) @@ -599,12 +507,10 @@ ) (defstate target-racing-jump (target) - :event - (-> target-racing-start event) - :enter - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + :event (-> target-racing-start event) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (set! (-> self racer shock-offsetv) 0.0) - (sound-play-by-name (static-sound-name "zoomer-jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-jump") (set! (-> self state-time) (-> *display* base-frame-counter)) (when arg2 (when (>= (-> self racer hill-ground-value) 0.11) @@ -612,14 +518,14 @@ (vector-normalize! (-> self control transv) (+ (-> self control unknown-float01) (-> self racer hill-boost))) ) ) - (if (and (logtest? (-> self control status) 1) (< 16384.0 (-> self control transv y))) + (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (< 16384.0 (-> self control transv y))) (set! (-> self racer hop?) #f) (set! (-> self racer hop?) arg2) ) (set! (-> self racer hop-start-y) (-> self control trans y)) (racer-calc-gravity) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *racer-air-mods*) (set! (-> self control unknown-float123) (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float01))))) @@ -635,15 +541,13 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self control root-prim prim-core action) (collide-action ca-15)) (set! (-> self racer hop?) #f) ((-> target-racing-start exit)) (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self control unknown-float123) (fmax (-> self control unknown-float123) @@ -654,9 +558,8 @@ ((cpad-pressed? (-> self control unknown-cpad-info00 number) l1 r1) (set! (-> self racer slide-down-time 0) (-> *display* base-frame-counter)) ) - ((zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) + ((zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) + ) (set! (-> self racer slide-down-time 0) 0) 0 ) @@ -690,7 +593,7 @@ ) ) ) - (if (and (logtest? (-> self control status) 1) + (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) ) (go target-racing) @@ -713,45 +616,39 @@ (racer-buzz 0.4) (none) ) - :code - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((a0-1 (if (< 0.1 (-> self racer hill-value)) 'jump ) ) ) - (target-racing-jump-anim a0-1 60) + (target-racing-jump-anim a0-1 (seconds 0.2)) ) (none) ) - :post - (-> target-racing post) + :post (-> target-racing post) ) (defstate target-racing-bounce (target) - :event - (-> target-racing-start event) - :enter - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + :event (-> target-racing-start event) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (logior! (-> self control root-prim prim-core action) (collide-action ca-15)) - (sound-play-by-name (static-sound-name "zoomer-jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-jump") (set! (-> self state-time) (-> *display* base-frame-counter)) (racer-calc-gravity) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-float123) (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float01))))) ) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self control root-prim prim-core action) (collide-action ca-15)) ((-> target-racing-start exit)) (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self control unknown-float123) (fmax (-> self control unknown-float123) @@ -776,7 +673,7 @@ ) (go target-racing-jump 2048.0 5324.8 #t) ) - (if (and (logtest? (-> self control status) 1) + (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) ) (go target-racing) @@ -786,68 +683,28 @@ (racer-buzz 0.4) (none) ) - :code - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (target-racing-land-anim arg2) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 123) - ) - ) - (ja-channel-push! 4 30) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 123)) - num-func-identity - ) - (set! (-> gp-0 frame-num) (ja-aframe (-> self racer turn-anim-frame) 0)) - ) - (let ((a0-9 (-> self skel root-channel 1))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 124))) - (set! (-> a0-9 param 0) 0.0) - (joint-control-channel-group-eval! - a0-9 - (the-as art-joint-anim (-> self draw art-group data 124)) - num-func-chan - ) - ) - (let ((a0-10 (-> self skel root-channel 2))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 125))) - (set! (-> a0-10 param 0) 0.0) - (joint-control-channel-group-eval! - a0-10 - (the-as art-joint-anim (-> self draw art-group data 125)) - num-func-chan - ) - ) - (let ((a0-11 (-> self skel root-channel 3))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 126))) - (set! (-> a0-11 param 0) 0.0) - (joint-control-channel-group-eval! - a0-11 - (the-as art-joint-anim (-> self draw art-group data 126)) - num-func-chan - ) - ) + (when (not (ja-group? (-> self draw art-group data 123))) + (ja-channel-push! 4 (seconds 0.1)) + (ja :group! (-> self draw art-group data 123) :num! (identity (ja-aframe (-> self racer turn-anim-frame) 0))) + (ja :chan 1 :group! (-> self draw art-group data 124) :num! (chan 0)) + (ja :chan 2 :group! (-> self draw art-group data 125) :num! (chan 0)) + (ja :chan 3 :group! (-> self draw art-group data 126) :num! (chan 0)) ) - (while #t + (loop (target-racing-turn-anim) (suspend) ) (none) ) - :post - (-> target-racing post) + :post (-> target-racing post) ) (defstate target-racing-smack (target) - :event - (-> target-racing-start event) - :enter - (behavior ((arg0 float) (arg1 symbol)) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + :event (-> target-racing-start event) + :enter (behavior ((arg0 float) (arg1 symbol)) + (sound-play "smack-surface") (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) (set! (-> self racer heavy) arg1) (vector-! (-> self control transv) (-> self control unknown-vector70) (-> self control trans)) @@ -865,71 +722,48 @@ 0 (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self racer heavy) #f) ((-> target-racing-start exit)) (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self racer turn-anim-targ) 0.0) (none) ) - :code - (behavior ((arg0 float) (arg1 symbol)) - (sound-play-by-name (static-sound-name "zoomer-crash-2") (new-sound-id) 1024 0 0 1 #t) - (ja-channel-push! 2 15) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 136))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 136)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 136)) num-func-seek!) - ) - (let ((s5-1 (-> self skel root-channel 1))) - (set! (-> s5-1 frame-interp) (lerp-scale 1.0 0.25 arg0 0.0 122880.0)) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 122)) - num-func-identity + :code (behavior ((arg0 float) (arg1 symbol)) + (sound-play "zoomer-crash-2") + (ja-channel-push! 2 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 136) :num! (seek!)) + (ja :chan 1 + :group! (-> self draw art-group data 122) + :num! (identity (ja-aframe 0.0 0)) + :frame-interp (lerp-scale 1.0 0.25 arg0 0.0 122880.0) ) - (set! (-> s5-1 frame-num) (ja-aframe 0.0 0)) - ) (until (ja-done? 0) (suspend) - (let ((s5-2 (-> self skel root-channel 0))) - (set! (-> s5-2 param 0) (the float (+ (-> s5-2 frame-group data 0 length) -1))) - (set! (-> s5-2 param 1) (lerp-scale 2.0 1.0 arg0 0.0 163840.0)) - (joint-control-channel-group-eval! s5-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (lerp-scale 2.0 1.0 arg0 0.0 163840.0))) ) (go target-racing) (none) ) - :post - (-> target-racing post) + :post (-> target-racing post) ) (defstate target-racing-falling (target) - :event - (-> target-racing-start event) - :enter - (behavior () + :event (-> target-racing-start event) + :enter (behavior () (set! (-> self control unknown-surface00) *racer-air-mods*) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self control root-prim prim-core action) (collide-action ca-15)) ((-> target-racing-start exit)) (none) ) - :trans - (behavior () - (if (logtest? (-> self control status) 1) + :trans (behavior () + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-racing) ) (target-racing-smack-check) @@ -939,20 +773,16 @@ ) (none) ) - :code - (behavior () - (target-racing-jump-anim #f 30) + :code (behavior () + (target-racing-jump-anim #f (seconds 0.1)) (none) ) - :post - (-> target-racing post) + :post (-> target-racing post) ) (defstate target-racing-hit (target) - :event - target-generic-event-handler - :enter - (behavior ((arg0 handle) (arg1 attack-info)) + :event target-generic-event-handler + :enter (behavior ((arg0 handle) (arg1 attack-info)) (let ((v1-0 (-> self attack-info))) (set! (-> v1-0 attacker) arg0) (set! (-> v1-0 mode) 'generic) @@ -977,24 +807,22 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (if (!= (-> self next-state name) 'target-racing-death) - (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags being-attacked dying)) ) ((-> target-racing-start exit)) (none) ) - :code - (behavior ((arg0 handle) (arg1 attack-info)) + :code (behavior ((arg0 handle) (arg1 attack-info)) (target-timed-invulnerable (-> *TARGET-bank* hit-invulnerable-timeout) self) (when (!= (-> self attack-info mode) 'endlessfall) (dummy-10 (-> self skel effect) 'group-target-hit -1.0 -1) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) - (sound-play-by-name (static-sound-name "oof") (new-sound-id) 1024 0 0 1 #t) + (sound-play "oof") ) (set! (-> self game hit-time) (-> *display* base-frame-counter)) - (logior! (-> self state-flags) 8) + (logior! (-> self state-flags) (state-flags being-attacked)) (set! (-> self racer boost-curve) 0.0) (set! (-> self racer boost-level) 0.0) (set! (-> self racer boost-target) 0.0) @@ -1034,70 +862,56 @@ ) (else (set! (-> self post-hook) target-racing-post) - (ja-channel-push! 1 15) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 136))) - (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 136)) data 0 length) -1)) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 136)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 136) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go target-racing) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) (defstate target-racing-death (target) - :event - (-> target-death event) - :exit - (behavior () - (set! (-> self state-flags) (logand -32769 (-> self state-flags))) + :event (-> target-death event) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags dying)) (send-event (ppointer->process (-> self manipy)) 'draw #t) (send-event (ppointer->process (-> self manipy)) 'anim-mode 'clone-anim) (target-timed-invulnerable-off self) - (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) (restore-collide-with-as (-> self control)) ((-> target-racing-start exit)) (target-exit) (set! (-> self racer stick-off) #f) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (local-vars (v1-154 symbol)) (set! (-> self racer stick-off) #t) (set! (-> self neck flex-blend) 0.0) (target-timed-invulnerable-off self) - (logior! (-> self state-flags) #x8000) + (logior! (-> self state-flags) (state-flags dying)) (case (-> self attack-info mode) (('explode 'darkeco 'heat 'death 'deadly 'balloonlurker) ((-> target-racing-start exit)) (send-event (ppointer->process (-> self manipy)) 'anim-mode 'loop) (send-event (ppointer->process (-> self manipy)) 'draw #f) - (sound-play-by-name (static-sound-name "zoomer-explode") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 116) -1 #f #f #f (-> self control trans)) - (-> gp-1 ppointer) - ) + (sound-play "zoomer-explode") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 116) + -1 + #f + #f + #f + (-> self control trans) + :to *entity-pool* ) (send-event (ppointer->process (-> self manipy)) @@ -1119,113 +933,77 @@ (vector-normalize! (-> gp-0 fountain-rand-transv-lo) (* 12288.0 f30-0)) ) (vector+! (-> gp-0 fountain-rand-transv-lo) (-> gp-0 fountain-rand-transv-lo) (-> s5-0 0 control trans)) - (let ((s5-1 (get-process *default-dead-pool* joint-exploder #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type joint-exploder activate))) - (t9-5 (the-as joint-exploder s5-1) self 'joint-exploder (the-as pointer #x70004000)) + (process-spawn + joint-exploder + *racer-explode-sg* + 24 + gp-0 + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) ) - (run-now-in-process - s5-1 - joint-exploder-init-by-other - *racer-explode-sg* - 24 - gp-0 - (new 'static 'joint-exploder-static-params - :joints - (new - 'static - 'boxed-array - :type joint-exploder-static-joint-params :length 16 :allocated-length 16 - (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) - ) - ) - ) - (-> s5-1 ppointer) ) + :to self ) ) ) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (fmax -182044.44 (fmin 182044.44 (* -40.0 (-> self racer rot z)))) (case (-> self attack-info mode) (('balloonlurker) (dummy-13 (-> self water) 2.0 (-> self control trans) 1 (-> self control transv)) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 139))) - (set! (-> gp-2 param 0) (ja-aframe 240.0 0)) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) 0.0) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 139)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 139) :num! (seek! (ja-aframe 240.0 0)) :frame-num 0.0) (until (ja-done? 0) (set! (-> self racer stick-lock) #t) - (set! (-> self control unknown-vector11 y) - (seek (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (-> *display* seconds-per-frame))) (send-event *camera* 'joystick 0.0 1.0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 240.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 240.0 0))) ) ) (else - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> self draw art-group data 139))) - (set! (-> a0-30 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 139)) data 0 length) -1)) - ) - (set! (-> a0-30 param 1) 1.0) - (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> self draw art-group data 139)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 139) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (set! (-> self racer stick-lock) #t) (send-event *camera* 'joystick 0.0 1.0) - (set! (-> self control unknown-vector11 y) - (seek (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (-> *display* seconds-per-frame))) (if (>= (ja-aframe-num 0) 245.0) (set-forward-vel (* 0.5 (-> self control unknown-float01))) ) (suspend) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1))) - (set! (-> a0-36 param 1) 1.0) - (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) ) (('melt) - (sound-play-by-name (static-sound-name "zoomer-melt") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-5 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-5 - (let ((t9-29 (method-of-type part-tracker activate))) - (t9-29 (the-as part-tracker gp-5) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-5 part-tracker-init (-> *part-group-id-table* 32) -1 #f #f #f (-> self control trans)) - (-> gp-5 ppointer) - ) + (sound-play "zoomer-melt") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 32) + -1 + #f + #f + #f + (-> self control trans) + :to *entity-pool* ) (clear-collide-with-as (-> self control)) (set! (-> self post-hook) target-no-ja-move-post) @@ -1238,7 +1016,7 @@ ) ) (('endlessfall) - (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-fall") (camera-change-to (the-as string cam-endlessfall) 30 #f) (set! (-> self control pat-ignore-mask unknown-bit) 1) (let ((f30-0 (fmin -4096.0 (- (-> self control ground-impact-vel))))) @@ -1302,20 +1080,16 @@ (go target-stance) (none) ) - :post - target-racing-post + :post target-racing-post ) (defstate target-racing-get-on (target) - :event - target-generic-event-handler - :exit - (-> target-racing-start exit) - :code - (behavior ((arg0 handle)) + :event target-generic-event-handler + :exit (-> target-racing-start exit) + :code (behavior ((arg0 handle)) (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self alt-cam-pos quad) (-> (&-> (-> self control) unknown-qword00) 0)) - (logior! (-> self state-flags) 1024) + (logior! (-> self state-flags) (state-flags use-alt-cam-pos)) (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control trans quad)) @@ -1346,14 +1120,8 @@ (let ((s5-1 #f) (gp-1 #f) ) - (ja-channel-push! 1 15) - (let ((s4-2 (-> self skel root-channel 0))) - (set! (-> s4-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 138))) - (set! (-> s4-2 param 0) (ja-aframe 77.0 0)) - (set! (-> s4-2 param 1) 1.0) - (set! (-> s4-2 frame-num) 0.0) - (joint-control-channel-group! s4-2 (the-as art-joint-anim (-> self draw art-group data 138)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 138) :num! (seek! (ja-aframe 77.0 0)) :frame-num 0.0) (until (ja-done? 0) (when (and (not s5-1) (= (-> self skel root-channel 0) (-> self skel channel))) (send-event (ppointer->process (-> self manipy)) 'anim-mode 'clone-anim) @@ -1362,7 +1130,7 @@ (set! (-> self control transv quad) (the-as uint128 0)) (when (< 50.0 (ja-aframe-num 0)) (when (not gp-1) - (sound-play-by-name (static-sound-name "zoomer-start") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-start") (set! gp-1 #t) ) (set! (-> self racer front-rotv) 65536.0) @@ -1382,14 +1150,10 @@ (set-twist! (-> self racer bottom-blade) (the-as float #f) (the-as float #f) (- (-> self racer bottom-rot))) ) (suspend) - (let ((s4-4 (-> self skel root-channel 0))) - (set! (-> s4-4 param 0) (ja-aframe 77.0 0)) - (set! (-> s4-4 param 1) 1.0) - (joint-control-channel-group-eval! s4-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 77.0 0))) ) ) - (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) (send-event *camera* 'set-slave-option #x6000) (set! (-> self control transv quad) (the-as uint128 0)) (quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00)) @@ -1400,38 +1164,12 @@ (= (-> *target* current-level name) 'firecanyon) (= (-> *target* current-level name) 'citadel) ) - (let ((gp-3 (get-process *default-dead-pool* hud-bike-heat #x4000))) - (set! (-> *hud-parts* bike-heat) - (the-as - (pointer hud-bike-heat) - (when gp-3 - (let ((t9-23 (method-of-type hud-bike-heat activate))) - (t9-23 (the-as hud-bike-heat gp-3) self 'hud-bike-heat (the-as pointer #x70004000)) - ) - (run-now-in-process gp-3 hud-init-by-other 0) - (-> gp-3 ppointer) - ) - ) - ) - ) + (set! (-> *hud-parts* bike-heat) (process-spawn hud-bike-heat :init hud-init-by-other 0 :to self)) (set! (-> *hud-parts* buzzers 0 next-y-offset) -120) (set! (-> *hud-parts* buzzers 0 y-sgn) 0) 0 ) - (let ((gp-4 (get-process *default-dead-pool* hud-bike-speed #x4000))) - (set! (-> *hud-parts* bike-speed) - (the-as - (pointer hud-bike-speed) - (when gp-4 - (let ((t9-26 (method-of-type hud-bike-speed activate))) - (t9-26 (the-as hud-bike-speed gp-4) self 'hud-bike-speed (the-as pointer #x70004000)) - ) - (run-now-in-process gp-4 hud-init-by-other 0) - (-> gp-4 ppointer) - ) - ) - ) - ) + (set! (-> *hud-parts* bike-speed) (process-spawn hud-bike-speed :init hud-init-by-other 0 :to self)) (set! (-> *hud-parts* power 0 next-y-offset) -120) (set! (-> *hud-parts* power 0 y-sgn) 0) 0 @@ -1439,8 +1177,7 @@ (go target-racing) (none) ) - :post - (behavior () + :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (f30-0 (fmin 1.0 (* 0.0044444446 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) ) @@ -1490,12 +1227,9 @@ ) (defstate target-racing-get-off (target) - :event - target-generic-event-handler - :exit - (-> target-racing-start exit) - :code - (behavior ((arg0 handle)) + :event target-generic-event-handler + :exit (-> target-racing-start exit) + :code (behavior ((arg0 handle)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *racer-mods*) (let ((a0-2 (-> *hud-parts* bike-speed))) @@ -1508,48 +1242,12 @@ (set! (-> a0-4 0 deactivate-when-hidden) #t) ) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 123) - ) - ) - (ja-channel-push! 4 30) - (let ((s5-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data 123)) - num-func-identity - ) - (set! (-> s5-0 frame-num) (ja-aframe (-> self racer turn-anim-frame) 0)) - ) - (let ((a0-13 (-> self skel root-channel 1))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 124))) - (set! (-> a0-13 param 0) 0.0) - (joint-control-channel-group-eval! - a0-13 - (the-as art-joint-anim (-> self draw art-group data 124)) - num-func-chan - ) - ) - (let ((a0-14 (-> self skel root-channel 2))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 125))) - (set! (-> a0-14 param 0) 0.0) - (joint-control-channel-group-eval! - a0-14 - (the-as art-joint-anim (-> self draw art-group data 125)) - num-func-chan - ) - ) - (let ((a0-15 (-> self skel root-channel 3))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 126))) - (set! (-> a0-15 param 0) 0.0) - (joint-control-channel-group-eval! - a0-15 - (the-as art-joint-anim (-> self draw art-group data 126)) - num-func-chan - ) - ) + (when (not (ja-group? (-> self draw art-group data 123))) + (ja-channel-push! 4 (seconds 0.1)) + (ja :group! (-> self draw art-group data 123) :num! (identity (ja-aframe (-> self racer turn-anim-frame) 0))) + (ja :chan 1 :group! (-> self draw art-group data 124) :num! (chan 0)) + (ja :chan 2 :group! (-> self draw art-group data 125) :num! (chan 0)) + (ja :chan 3 :group! (-> self draw art-group data 126) :num! (chan 0)) ) (let ((s5-1 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.5)) @@ -1558,27 +1256,21 @@ (set! (-> self racer turn-anim-targ) 0.0) (set! (-> self racer turn-anim-targ) 0.0) (target-racing-turn-anim) - (set! (-> self control unknown-vector11 y) - (seek (-> self control unknown-vector11 y) 6144.0 (* 3.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 3.0 (-> *display* seconds-per-frame))) (suspend) ) ) (go target-racing-get-off-jump arg0) (none) ) - :post - target-racing-post + :post target-racing-post ) (defstate target-racing-get-off-jump (target) - :event - target-generic-event-handler - :exit - (-> target-racing-start exit) - :code - (behavior ((arg0 handle)) - (sound-play-by-name (static-sound-name "zoomer-stop") (new-sound-id) 1024 0 0 1 #t) + :event target-generic-event-handler + :exit (-> target-racing-start exit) + :code (behavior ((arg0 handle)) + (sound-play "zoomer-stop") (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control transv quad) (the-as uint128 0)) (let ((gp-1 (new 'stack-no-clear 'vector))) @@ -1607,23 +1299,11 @@ (set! (-> self control unknown-vector102 quad) (-> gp-1 quad)) (set! (-> self control unknown-vector103 quad) (-> s4-1 quad)) ) - (ja-channel-push! 1 15) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 137))) - (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 137)) data 0 length) -1)) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 137)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 137) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event (handle->process arg0) 'draw) (set-yaw-angle-clear-roll-pitch! @@ -1641,8 +1321,7 @@ (go target-racing-get-off-hit-ground #f) (none) ) - :post - (behavior () + :post (behavior () (let* ((f0-2 (deg-diff (-> self racer front-rot) (-> *RACER-bank* default-front-blade))) (f0-5 (if (< 0.0 f0-2) (fmax 5461.3335 (* 4.0 f0-2)) @@ -1650,9 +1329,7 @@ ) ) ) - (set! (-> self racer front-rotv) - (seek (-> self racer front-rotv) f0-5 (* 54613.332 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer front-rotv) f0-5 (* 54613.332 (-> *display* seconds-per-frame))) ) (set! (-> self racer front-rot) (the float @@ -1721,41 +1398,24 @@ ) (defstate target-racing-get-off-hit-ground (target) - :event - target-standard-event-handler - :enter - (-> target-hit-ground enter) - :trans - (behavior () - (logior! (-> self control status) 7) + :event target-standard-event-handler + :enter (-> target-hit-ground enter) + :trans (behavior () + (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) ((-> target-hit-ground trans)) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 42.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 35) :num! (seek!) :frame-num (ja-aframe 42.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go target-stance) (none) ) - :post - (behavior () + :post (behavior () (hide-hud) (target-post) (none) @@ -1763,8 +1423,7 @@ ) (defstate target-racing-grab (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) (-> self state name) @@ -1784,90 +1443,47 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self control unknown-surface00) *grab-mods*) (set! (-> self neck flex-blend) 0.0) - (logior! (-> self state-flags) 272) + (logior! (-> self state-flags) (state-flags invulnerable grabbed)) (set! (-> self racer stick-off) #t) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self racer stick-off) #f) - (set! (-> self state-flags) (logand -273 (-> self state-flags))) - (set! (-> self water flags) (logand -65537 (-> self water flags))) + (logclear! (-> self state-flags) (state-flags invulnerable grabbed)) + (logclear! (-> self water flags) (water-flags wt16)) ((-> target-racing-start exit)) (none) ) - :code - (behavior () - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 123) - ) - ) - (ja-channel-push! 4 30) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 123)) - num-func-identity - ) - (set! (-> gp-0 frame-num) (ja-aframe (-> self racer turn-anim-frame) 0)) - ) - (let ((a0-7 (-> self skel root-channel 1))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 124))) - (set! (-> a0-7 param 0) 0.0) - (joint-control-channel-group-eval! - a0-7 - (the-as art-joint-anim (-> self draw art-group data 124)) - num-func-chan - ) - ) - (let ((a0-8 (-> self skel root-channel 2))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 125))) - (set! (-> a0-8 param 0) 0.0) - (joint-control-channel-group-eval! - a0-8 - (the-as art-joint-anim (-> self draw art-group data 125)) - num-func-chan - ) - ) - (let ((a0-9 (-> self skel root-channel 3))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 126))) - (set! (-> a0-9 param 0) 0.0) - (joint-control-channel-group-eval! - a0-9 - (the-as art-joint-anim (-> self draw art-group data 126)) - num-func-chan - ) - ) + :code (behavior () + (when (not (ja-group? (-> self draw art-group data 123))) + (ja-channel-push! 4 (seconds 0.1)) + (ja :group! (-> self draw art-group data 123) :num! (identity (ja-aframe (-> self racer turn-anim-frame) 0))) + (ja :chan 1 :group! (-> self draw art-group data 124) :num! (chan 0)) + (ja :chan 2 :group! (-> self draw art-group data 125) :num! (chan 0)) + (ja :chan 3 :group! (-> self draw art-group data 126) :num! (chan 0)) ) - (while #t + (loop (target-racing-turn-anim) (set-forward-vel 0.0) (suspend) ) (none) ) - :post - target-racing-post + :post target-racing-post ) (defstate target-racing-clone-anim (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (= arg2 'trans) (= (-> arg3 param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) ((-> target-racing-grab event) arg0 arg1 arg2 arg3) ) - :enter - (-> target-clone-anim enter) - :exit - (behavior () + :enter (-> target-clone-anim enter) + :exit (behavior () (set! (-> self control unknown-vector11 y) (the-as float (-> self control unknown-uint20))) (set! (-> self control unknown-vector12 y) (-> self control unknown-vector11 y)) (send-event (ppointer->process (-> self sidekick)) 'matrix #f) @@ -1876,8 +1492,7 @@ (vector-reset! (-> self control transv)) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-vector11 y))) (set! (-> self control unknown-vector11 y) 0.0) (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) @@ -1885,12 +1500,9 @@ (go target-racing) (none) ) - :post - (behavior () + :post (behavior () (racer-sounds) - (set! (-> self racer heat) - (seek (-> self racer heat) 0.0 (* (-> *RACER-bank* surface-heat-inc) (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer heat) 0.0 (* (-> *RACER-bank* surface-heat-inc) (-> *display* seconds-per-frame))) (vector+! (-> self racer bike-trans) (-> self control trans) (-> self control unknown-vector12)) (quaternion-copy! (the-as quaternion (-> self racer bike-quat)) (-> self control quat)) (set! (-> self racer bike-scale quad) (-> self control scale quad)) diff --git a/goal_src/levels/racer_common/racer.gc b/goal_src/levels/racer_common/racer.gc index a61df0a965..893d4d01fd 100644 --- a/goal_src/levels/racer_common/racer.gc +++ b/goal_src/levels/racer_common/racer.gc @@ -6,14 +6,16 @@ ;; dgos: L1, FIC, LAV, MIS, OGR, RACERP, ROL (define-extern blocking-plane-destroy (function none)) -(define-extern blocking-plane-spawn (function curve-control none)) +(define-extern blocking-plane-spawn (function curve-control none :behavior process)) + +;; DECOMP BEGINS + +(import "goal_src/import/racer-ag.gc") -;; failed to figure out what this is: (if (not (nmember "racerp" *kernel-packages*)) (set! *kernel-packages* (cons "racerp" *kernel-packages*)) ) -;; definition of type racer (deftype racer (process-drawable) ((parent-override (pointer target) :offset 12) (root-override collide-shape-moving :offset 112) @@ -38,24 +40,7 @@ ) ) -;; definition for method 3 of type racer -(defmethod inspect racer ((obj racer)) - (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) - ) - (format #t "~T~Textra-trans: ~`vector`P~%" (-> obj extra-trans)) - (format #t "~T~Tcondition: ~D~%" (-> obj condition)) - (format #t "~T~Tcell: ~D~%" (-> obj cell)) - (format #t "~T~Tpath-data[2] @ #x~X~%" (-> obj path-data)) - (format #t "~T~Tpath-target: ~A~%" (-> obj path-target)) - (format #t "~T~Tpath-racer: ~A~%" (-> obj path-racer)) - (format #t "~T~Tauto-get-off: ~A~%" (-> obj auto-get-off)) - (format #t "~T~Tshadow-backup: ~A~%" (-> obj shadow-backup)) - obj - ) -;; definition for method 7 of type racer -;; INFO: Return type mismatch process-drawable vs racer. (defmethod relocate racer ((obj racer) (arg0 int)) (countdown (v1-0 2) (if (-> obj path-data v1-0) @@ -65,42 +50,28 @@ (the-as racer ((method-of-type process-drawable relocate) obj arg0)) ) -;; failed to figure out what this is: -(defskelgroup *racer-sg* racer - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3.5) - :longest-edge (meters 0) - :shadow 2 - :sort 1 - ) +(defskelgroup *racer-sg* racer racer-geo-jg 3 + ((racer-geo-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + :shadow racer-shadow-mg + :sort 1 + ) -;; failed to figure out what this is: -(defskelgroup *racer-explode-sg* racer - 22 - 24 - ((23 (meters 999999))) - :bounds (static-spherem 0 0 0 3.5) - :longest-edge (meters 0) - ) +(defskelgroup *racer-explode-sg* racer racer-explode-lod0-jg racer-explode-idle-ja + ((racer-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + ) -;; definition for symbol *racer-shadow-control*, type shadow-control -(define - *racer-shadow-control* +(define *racer-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #xa)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 614400.0) + :flags (shadow-flags disable-fade shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) :bot-plane (new 'static 'plane :y 1.0 :w 81920.0) :top-plane (new 'static 'plane :y 1.0 :w 2048.0) ) ) ) -;; definition for function racer-effect -;; INFO: Return type mismatch int vs none. (defbehavior racer-effect racer () (when (!= (-> self condition) 4) (spawn (-> self part) (-> self root-override trans)) @@ -110,11 +81,9 @@ (none) ) -;; failed to figure out what this is: (defstate wait-for-start (racer) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-1 structure)) (let ((v1-0 arg2)) (the-as @@ -145,15 +114,13 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (set! (-> self root-override root-prim prim-core action) (collide-action)) (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) 0 (none) ) - :code - (behavior () + :code (behavior () (label cfg-0) (case (-> self condition) ((2) @@ -165,9 +132,7 @@ (case (current-status gp-0) (((task-status need-reward-speech)) (ja-channel-set! 1) - (let ((v1-15 (-> self skel root-channel 0))) - (set! (-> v1-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) (set! (-> self root-override root-prim prim-core action) (collide-action solid ca-11)) (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) (ja-post) @@ -243,25 +208,18 @@ ) ) -;; failed to figure out what this is: (defstate idle (racer) :virtual #t - :event - (-> (method-of-type racer wait-for-start) event) - :enter - (behavior () + :event (-> (method-of-type racer wait-for-start) event) + :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (-> self path-target)) (none) ) - :exit - (-> (method-of-type racer wait-for-start) exit) - :code - (behavior () + :exit (-> (method-of-type racer wait-for-start) exit) + :code (behavior () (ja-channel-set! 1) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) (set! (-> self root-override root-prim prim-core action) (collide-action solid ca-11)) (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) 0.0 @@ -271,7 +229,7 @@ ) ) ) - (while #t + (loop (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9))) (go-virtual wait-for-return) ) @@ -281,7 +239,7 @@ (hide-hud) (level-hint-surpress!) (kill-current-level-hint '() '(sidekick voicebox) 'exit) - (when (and (hud-hidden?) (can-grab-display? (the-as process-taskable self))) + (when (and (hud-hidden?) (can-grab-display? self)) (let ((gp-0 (new 'stack 'font-context *font-default-matrix* 32 160 0.0 (font-color default) (font-flags shadow kerning)) ) @@ -306,21 +264,16 @@ ) (none) ) - :post - (the-as (function none :behavior racer) ja-post) + :post (the-as (function none :behavior racer) ja-post) ) -;; failed to figure out what this is: (defstate pickup (racer) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('draw) (ja-channel-set! 1) - (let ((v1-3 (-> self skel root-channel 0))) - (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) (set! (-> self root-override root-prim prim-core action) (collide-action solid ca-11)) (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) (transform-post) @@ -347,13 +300,11 @@ ) ) ) - :enter - (behavior ((arg0 (state collectable))) + :enter (behavior ((arg0 (state collectable))) ((the-as (function none :behavior racer) (-> arg0 enter))) (none) ) - :code - (behavior ((arg0 (state collectable))) + :code (behavior ((arg0 (state collectable))) (ja-channel-set! 0) (ja-post) (while (zero? (ja-group-size)) @@ -384,7 +335,7 @@ (suspend) ) (let ((s5-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-0) 300) + (until (>= (- (-> *display* base-frame-counter) s5-0) (seconds 1)) (racer-effect) (suspend) ) @@ -394,11 +345,9 @@ ) ) -;; failed to figure out what this is: (defstate wait-for-return (racer) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (or (= arg2 'touch) (= arg2 'attack)) (and (!= (-> self condition) 4) (send-event *target* 'end-mode))) (go-virtual pickup (the-as (state collectable) (method-of-object self idle))) ) @@ -425,17 +374,15 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (the-as curve-control (-> self path-racer))) (none) ) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (ja-post) - (while #t + (loop (if (not (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9)))) (go-virtual idle) ) @@ -446,8 +393,6 @@ ) ) -;; definition for method 11 of type racer -;; INFO: Return type mismatch object vs none. (defmethod init-from-entity! racer ((obj racer) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -504,19 +449,8 @@ ) ) ) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "zoom-teleport") - :volume #x400 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> obj root-override trans)) ) (go (method-of-object obj wait-for-start)) (none) diff --git a/goal_src/levels/racer_common/target-racer-h.gc b/goal_src/levels/racer_common/target-racer-h.gc index f7fc5c9748..cfa1e5d4e1 100644 --- a/goal_src/levels/racer_common/target-racer-h.gc +++ b/goal_src/levels/racer_common/target-racer-h.gc @@ -11,12 +11,14 @@ (define-extern target-racing-land-anim (function symbol none :behavior target)) (define-extern target-racing-turn-anim (function none :behavior target)) (define-extern racer-calc-gravity (function vector :behavior target)) -(define-extern target-racing-jump-anim (function basic int none :behavior target)) +(define-extern target-racing-jump-anim (function basic time-frame none :behavior target)) (define-extern racer-sounds (function object :behavior target)) (define-extern *racer-air-mods* surface) ;; DECOMP BEGINS +(import "goal_src/import/balloon-ag.gc") + (deftype racer-info (basic) ((entity entity-actor :offset-assert 4) (bike-trans vector :inline :offset-assert 16) @@ -159,13 +161,11 @@ ) ) -(defskelgroup *balloon-sg* balloon - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 1.7 0 3) - :longest-edge (meters 0) - ) +;; PAL patch here +(defskelgroup *balloon-sg* balloon balloon-lod0-jg balloon-idle-ja + ((balloon-lod0-mg (meters 20)) (balloon-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0.3 0 6.3) + ) diff --git a/goal_src/levels/racer_common/target-racer.gc b/goal_src/levels/racer_common/target-racer.gc index 1c2a44e846..b882c77432 100644 --- a/goal_src/levels/racer_common/target-racer.gc +++ b/goal_src/levels/racer_common/target-racer.gc @@ -30,7 +30,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :flags #x1 + :flags (surface-flags allow-look-around) ) ) @@ -58,7 +58,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x801 + :flags (surface-flags allow-look-around jump) ) ) @@ -91,7 +91,7 @@ ) (defbehavior racer-on-ground? racer () - (logtest? (-> self root-override status) 1) + (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) ) (defbehavior racer-calc-gravity target () @@ -128,16 +128,14 @@ (let ((v1-1 (-> self racer slide-mode))) (cond ((zero? v1-1) - (if (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) + (if (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) + ) (set! (-> self racer slide-mode) -1) ) ) ((= v1-1 1) - (if (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) + (if (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) + ) (set! (-> self racer slide-mode) -1) ) ) @@ -154,7 +152,7 @@ ) ) ) - (set! (-> self racer slide-amp) (seek (-> self racer slide-amp) 0.0 (* 0.3 (-> *display* seconds-per-frame)))) + (seek! (-> self racer slide-amp) 0.0 (* 0.3 (-> *display* seconds-per-frame))) (if (= (-> self racer slide-amp) 0.0) (set! (-> self racer slide-mode) -1) ) @@ -164,7 +162,7 @@ (defbehavior racer-xz target ((arg0 float) (arg1 float)) (set! (-> self racer slide-shift-x) arg1) - (set! (-> self racer slide-interp) (seek (-> self racer slide-interp) 0.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer slide-interp) 0.0 (-> *display* seconds-per-frame)) (let ((f30-1 (if (or (< (* arg1 arg0) 0.0) (not (racer-on-ground?))) 1.0 @@ -178,9 +176,7 @@ (lerp-scale 91022.22 236657.78 (-> self control unknown-float01) 0.0 (* 0.125 (-> self racer transv-max))) ) ) - (set! (-> self racer rotv y) - (seek (-> self racer rotv y) (* arg0 f30-1 (- f28-1)) (* f0-18 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer rotv y) (* arg0 f30-1 (- f28-1)) (* f0-18 (-> *display* seconds-per-frame))) ) (set! (-> self racer rotv y) (* (-> self racer rotv y) @@ -195,15 +191,13 @@ (set! (-> self racer slide-grip-mult) 1.0) ) (s5-1 - (set! (-> self racer slide-grip-mult) - (seek (-> self racer slide-grip-mult) 1.0 (-> *display* seconds-per-frame)) - ) + (seek! (-> self racer slide-grip-mult) 1.0 (-> *display* seconds-per-frame)) ) ) (let ((f30-4 (* (deg-diff f30-3 0.0) (-> self racer slide-grip-mult)))) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control transv) (meters 0.000061035156) @@ -230,7 +224,7 @@ (vector-float*! gp-1 gp-1 0.5) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) gp-1 (meters 0.00024414062) @@ -239,7 +233,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "ltransv" @@ -250,7 +244,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "nose" @@ -282,13 +276,11 @@ (+! (-> self control unknown-vector00 z) (* f1-4 (-> *display* seconds-per-frame))) ) ) - (set! (-> self racer front-rotv) - (seek - (-> self racer front-rotv) - (+ 65536.0 (* 364088.88 (+ f0-0 (* 0.1 arg1)))) - (* 364088.88 (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self racer front-rotv) + (+ 65536.0 (* 364088.88 (+ f0-0 (* 0.1 arg1)))) + (* 364088.88 (-> *display* seconds-per-frame)) + ) ) (set! (-> self racer front-rot) (the float @@ -306,11 +298,10 @@ ) (set! f0-13 (cond - ((and (not - (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) - ) + ((and (not (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) + (>= (-> self fact-info-target eco-level) 1.0) + ) + ) (cpad-hold? (-> self control unknown-cpad-info00 number) square) ) (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) x) @@ -354,13 +345,11 @@ (defbehavior racer-cushion target ((arg0 float)) (let ((f30-0 (-> self racer bob-period))) (let ((f28-0 1.0)) - (set! (-> self racer bob-meta-timer) - (seek - (-> self racer bob-meta-timer) - (-> self racer bob-meta-meta-timer) - (* 4.0 (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self racer bob-meta-timer) + (-> self racer bob-meta-meta-timer) + (* 4.0 (-> *display* seconds-per-frame)) + ) (let* ((f0-8 (sin (/ (* 65536.0 (-> self racer bob-timer)) f30-0))) (f0-9 (* 1228.8 (-> self racer bob-mult-trans) f28-0 f0-8)) ) @@ -373,7 +362,7 @@ (+! (-> a2-1 y) (-> self racer cushion-bob)) (add-debug-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) a2-1 819.2 (new 'static 'rgba :r #xff :b #xff :a #x80) @@ -403,9 +392,7 @@ (set! (-> self racer hill-offset) (lerp (-> self racer hill-offset) 0.0 0.05)) ) ) - (set! (-> self racer hill-boost) - (seek (-> self racer hill-boost) 0.0 (* 81920.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer hill-boost) 0.0 (* 81920.0 (-> *display* seconds-per-frame))) (set! (-> self racer hill-offset) 0.0) 0 (none) @@ -448,21 +435,23 @@ ((< (-> self racer shock-offset) -8192.0) (set! (-> self racer shock-offset) -8192.0) (set! (-> self racer shock-offsetv) 0.0) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker s5-0) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 part-tracker-init (-> *part-group-id-table* 13) -1 #f #f #f (-> self control trans)) - (-> s5-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 13) + -1 + #f + #f + #f + (-> self control trans) + :to self ) (dummy-10 (-> self skel effect) 'effect-land -1.0 -1) ) ) (deg-diff (vector-y-angle gp-0) (vector-y-angle (-> self control transv))) (let ((f30-2 (vector-xz-length gp-0))) - (when (and (logtest? (-> self control status) 8) + (when (and (logtest? (-> self control status) (cshape-moving-flags twall)) (< 20480.0 f30-2) (and (< (fabs (-> self racer mod-x)) 0.5) (!= (-> self next-state name) 'target-racing-smack)) ) @@ -541,21 +530,21 @@ ) ) (let ((f0-2 - (if (or (and (logtest? (-> self control status) 8) (zero? (logand (-> self control status) 1))) - (logtest? (-> self state-flags) #x8000) + (if (or (and (logtest? (-> self control status) (cshape-moving-flags twall)) + (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + ) + (logtest? (-> self state-flags) (state-flags dying)) ) 0.0 (-> self control unknown-float81) ) ) ) - (set! (-> self control unknown-float80) - (seek - (-> self control unknown-float80) - f0-2 - (* (-> self control unknown-float82) (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self control unknown-float80) + f0-2 + (* (-> self control unknown-float82) (-> *display* seconds-per-frame)) + ) ) (vector-deg-slerp (-> self control dynam gravity-normal) @@ -580,11 +569,10 @@ 100.0 (let ((f0-6 (+ (* 2.0 f0-1) - (if (< 4096.0 - (vector-dot - (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) - ) + (if (< 4096.0 (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) + ) ) 0.7 0.0 @@ -596,50 +584,38 @@ (if (< 2.5 f0-6) (set! f0-6 2.5) ) - (set! (-> self racer engine-sound-pitch) - (seek (-> self racer engine-sound-pitch) f0-6 (* 4.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer engine-sound-pitch) f0-6 (* 4.0 (-> *display* seconds-per-frame))) ) ) (let ((f0-11 (lerp-scale 100.0 60.0 (-> self racer engine-sound-pitch) 0.8 2.0))) - (sound-play-by-name - (static-sound-name "zoomer-loop") - (-> self racer engine-sound-id) - (the int (* 10.24 f0-11)) - (the int (* 1524.0 (-> self racer engine-sound-pitch))) - 0 - 1 - (the-as symbol (-> self control trans)) + (sound-play + "zoomer-loop" + :id (-> self racer engine-sound-id) + :vol f0-11 + :pitch (-> self racer engine-sound-pitch) + :position (the-as symbol (-> self control trans)) ) ) (cond ((and (!= (-> self current-level name) 'ogre) (!= (-> self current-level name) 'lavatube)) #f ) - ((or (logtest? (-> self control status) 2) (< 12288.0 (vector-length (-> self control transv)))) + ((or (logtest? (-> self control status) (cshape-moving-flags onground)) + (< 12288.0 (vector-length (-> self control transv))) + ) (let ((v0-5 (the-as object (-> *display* base-frame-counter)))) (set! (-> self racer unstuck-time) (the-as time-frame v0-5)) v0-5 ) ) ((>= (- (-> *display* base-frame-counter) (-> self racer unstuck-time)) (seconds 5)) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'attack) - (set! (-> a1-6 param 0) (the-as uint #f)) - (let ((a0-12 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-12 mode) 'heat) - (set! (-> a1-6 param 1) (the-as uint a0-12)) - ) - (send-event-function self a1-6) - ) + (send-event self 'attack #f (static-attack-info ((mode 'heat)))) ) ((and (>= (- (-> *display* base-frame-counter) (-> self racer unstuck-time)) (seconds 3)) (>= (- (-> *display* base-frame-counter) (-> self racer heat-sound-time)) (seconds 1)) ) (set! (-> self racer heat-sound-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warning") ) ) ) @@ -674,14 +650,10 @@ (when (< 0.0 (-> *part-id-table* 2212 init-specs 11 initial-valuef)) (set! (-> *part-id-table* 2212 init-specs 14 initial-valuef) (the-as float gp-0)) (set! (-> *part-id-table* 2212 init-specs 3 initial-valuef) 15155.2) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2212) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 4)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* + (-> *part-id-table* 2212) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 4)) + ) ) ) (let ((gp-2 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)))) @@ -694,101 +666,75 @@ (when (< 0.0 (-> *part-id-table* 2212 init-specs 11 initial-valuef)) (set! (-> *part-id-table* 2212 init-specs 14 initial-valuef) (the-as float gp-2)) (set! (-> *part-id-table* 2212 init-specs 3 initial-valuef) 10240.0) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2212) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 10)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* + (-> *part-id-table* 2212) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 10)) + ) ) ) (when (and (racer-on-ground?) (< (-> self control unknown-float01) 90112.0)) (let* ((gp-4 #f) (s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 10))) (v1-61 (-> self control ground-pat material)) - (a1-13 - (cond - ((= v1-61 (pat-material waterbottom)) - (when (and (logtest? (-> self draw status) (draw-status was-drawn)) (zero? (-> self draw cur-lod))) - (let ((f1-3 (y-angle (-> self control))) - (f0-17 (-> self control unknown-float01)) - (s4-2 s5-2) - ) - (set! (-> s4-2 y) (-> self water height)) - (set! (-> *part-id-table* 2275 init-specs 4 initial-valuef) (+ 24576.0 f1-3)) - (set! (-> *part-id-table* 2275 init-specs 19 initial-valuef) (+ 49152.0 f1-3)) - (set! (-> *part-id-table* 2275 init-specs 1 initial-valuef) (* 0.0000036621095 f0-17)) - (set! (-> *part-id-table* 2275 init-specs 2 initial-valuef) (* 0.1 f0-17)) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2275) - s4-2 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2276) - s4-2 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 + (a1-13 (cond + ((= v1-61 (pat-material waterbottom)) + (when (and (logtest? (-> self draw status) (draw-status was-drawn)) (zero? (-> self draw cur-lod))) + (let ((f1-3 (y-angle (-> self control))) + (f0-17 (-> self control unknown-float01)) + (s4-2 s5-2) + ) + (set! (-> s4-2 y) (-> self water height)) + (set! (-> *part-id-table* 2275 init-specs 4 initial-valuef) (+ 24576.0 f1-3)) + (set! (-> *part-id-table* 2275 init-specs 19 initial-valuef) (+ 49152.0 f1-3)) + (set! (-> *part-id-table* 2275 init-specs 1 initial-valuef) (* 0.0000036621095 f0-17)) + (set! (-> *part-id-table* 2275 init-specs 2 initial-valuef) (* 0.1 f0-17)) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2275) s4-2) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2276) s4-2) + ) + ) + (-> *part-id-table* 2208) + ) + ((= v1-61 (pat-material lava)) + (-> *part-id-table* 2213) + ) + ((= v1-61 (pat-material hotcoals)) + (-> *part-id-table* 2214) + ) + ((or (= v1-61 (pat-material pcmetal)) + (= v1-61 (pat-material metal)) + (= v1-61 (pat-material tube)) + (= v1-61 (pat-material rotate)) + ) + (-> *part-id-table* 2215) + ) + ((= v1-61 (pat-material grass)) + (-> *part-id-table* 2207) + ) + ((or (= v1-61 (pat-material dirt)) + (= v1-61 (pat-material sand)) + (= v1-61 (pat-material straw)) + (= v1-61 (pat-material gravel)) + ) + (-> *part-id-table* 2216) + ) + ((or (= v1-61 (pat-material wood)) (= v1-61 (pat-material crwood))) + (-> *part-id-table* 2217) + ) + ((= v1-61 (pat-material stone)) + (-> *part-id-table* 2831) + ) + (else + (-> *part-id-table* 2211) ) ) ) - (-> *part-id-table* 2208) - ) - ((= v1-61 (pat-material lava)) - (-> *part-id-table* 2213) - ) - ((= v1-61 (pat-material hotcoals)) - (-> *part-id-table* 2214) - ) - ((or (= v1-61 (pat-material pcmetal)) - (= v1-61 (pat-material metal)) - (= v1-61 (pat-material tube)) - (= v1-61 (pat-material rotate)) - ) - (-> *part-id-table* 2215) - ) - ((= v1-61 (pat-material grass)) - (-> *part-id-table* 2207) - ) - ((or (= v1-61 (pat-material dirt)) - (= v1-61 (pat-material sand)) - (= v1-61 (pat-material straw)) - (= v1-61 (pat-material gravel)) - ) - (-> *part-id-table* 2216) - ) - ((or (= v1-61 (pat-material wood)) (= v1-61 (pat-material crwood))) - (-> *part-id-table* 2217) - ) - ((= v1-61 (pat-material stone)) - (-> *part-id-table* 2831) - ) - (else - (-> *part-id-table* 2211) - ) - ) - ) ) (set! (-> s5-2 y) (-> self control shadow-pos y)) (if (nonzero? a1-13) - (sp-launch-particles-var - (if gp-4 - *sp-particle-system-3d* - *sp-particle-system-2d* - ) - a1-13 - s5-2 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system (if gp-4 *sp-particle-system-3d* *sp-particle-system-2d*) + a1-13 + s5-2 + ) ) ) (let* ((gp-5 #f) @@ -815,17 +761,10 @@ ) (set! (-> a2-7 y) (-> self control shadow-pos y)) (if (nonzero? s5-3) - (sp-launch-particles-var - (if gp-5 - *sp-particle-system-3d* - *sp-particle-system-2d* - ) - (the-as sparticle-launcher s5-3) - a2-7 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system (if gp-5 *sp-particle-system-3d* *sp-particle-system-2d*) + (the-as sparticle-launcher s5-3) + a2-7 + ) ) ) ) @@ -834,7 +773,7 @@ ) (cpad-pressed? (-> self control unknown-cpad-info00 number) circle square) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 0.25)) - (zero? (logand (-> self state-flags) #x8008)) + (zero? (logand (-> self state-flags) (state-flags being-attacked dying))) ) (let ((gp-6 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat))) (s5-4 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 4))) @@ -842,25 +781,18 @@ (set! (-> gp-6 y) 0.0) (vector-normalize! gp-6 (-> *RACER-bank* yellow-projectile-speed)) (vector+! gp-6 gp-6 (-> self control transv)) - (let ((s4-3 (get-process *default-dead-pool* projectile-yellow #x4000))) - (when s4-3 - (let ((t9-22 (method-of-type projectile-yellow activate))) - (t9-22 (the-as projectile-yellow s4-3) self 'projectile-yellow (the-as pointer #x70004000)) + (process-spawn + projectile-yellow + :init projectile-init-by-other + (-> self entity) + s5-4 + gp-6 + (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + 152 + 136 ) - (run-now-in-process - s4-3 - projectile-init-by-other - (-> self entity) - s5-4 - gp-6 - (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) - 152 - 136 - ) - #f - ) - (-> s4-3 ppointer) - ) + #f + :to self ) ) (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) @@ -886,46 +818,30 @@ ) (case (-> self control poly-pat material) (((pat-material hotcoals)) - (set! (-> self racer heat) - (seek (-> self racer heat) (-> *RACER-bank* heat-max) (* f22-1 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f22-1 (-> *display* seconds-per-frame))) ) (((pat-material lava)) (if (racer-on-ground?) - (set! (-> self racer heat) - (seek (-> self racer heat) (-> *RACER-bank* heat-max) (* f24-1 (-> *display* seconds-per-frame))) - ) - (set! (-> self racer heat) - (seek (-> self racer heat) (-> *RACER-bank* heat-max) (* f28-2 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f24-1 (-> *display* seconds-per-frame))) + (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f28-2 (-> *display* seconds-per-frame))) ) ) (else (if (not (racer-on-ground?)) - (set! (-> self racer heat) (seek (-> self racer heat) 0.0 (* f26-0 (-> *display* seconds-per-frame)))) + (seek! (-> self racer heat) 0.0 (* f26-0 (-> *display* seconds-per-frame))) ) ) ) ) (let ((v1-189 (- (-> *display* base-frame-counter) (-> self control unknown-dword11)))) (if (and (>= v1-189 (seconds 0.9)) (>= (seconds 3) v1-189)) - (set! (-> self racer heat) (seek (-> self racer heat) 0.0 (* f30-2 (-> *display* seconds-per-frame)))) + (seek! (-> self racer heat) 0.0 (* f30-2 (-> *display* seconds-per-frame))) ) ) ) - (when (and (>= (-> self racer heat) (-> *RACER-bank* heat-max)) (= (-> self game mode) 'play)) - (let ((a1-43 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-43 from) self) - (set! (-> a1-43 num-params) 2) - (set! (-> a1-43 message) 'attack) - (set! (-> a1-43 param 0) (the-as uint #f)) - (let ((a0-68 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-68 mode) 'heat) - (set! (-> a1-43 param 1) (the-as uint a0-68)) - ) - (send-event-function self a1-43) + (if (and (>= (-> self racer heat) (-> *RACER-bank* heat-max)) (= (-> self game mode) 'play)) + (send-event self 'attack #f (static-attack-info ((mode 'heat)))) ) - ) (if (and *cheat-mode* *debug-segment* (cpad-pressed? 0 l2)) (send-event self 'boost 1.0) ) @@ -939,9 +855,8 @@ (set! (-> self racer boost-curve) 0.0) ) ) - (when (or (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) - ) + (when (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) + ) (< (-> self control unknown-float01) 4096.0) (= (-> self racer boost-level) 0.0) ) @@ -952,7 +867,7 @@ (set! (-> v1-241 parms volume) -4) (set! (-> v1-241 auto-time) 120) (set! (-> v1-241 auto-from) 2) - (set! (-> v1-241 parms mask) (the-as uint 17)) + (set! (-> v1-241 parms mask) (sound-mask volume time)) (-> v1-241 id) ) (set! (-> self racer boost-sound-id) (new 'static 'sound-id)) @@ -961,30 +876,23 @@ (set! (-> self racer boost-level) 0.0) ) (set! (-> self racer boost-target) (+ (-> self racer boost-curve) (-> self racer boost-level))) - (set! (-> self racer boost-output) - (seek (-> self racer boost-output) (-> self racer boost-target) (* 40960.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer boost-output) (-> self racer boost-target) (* 40960.0 (-> *display* seconds-per-frame))) (when (!= (-> self racer boost-output) 0.0) (dotimes (gp-7 8) (let ((v1-258 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2229) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-258)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 2229) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-258)) + ) ) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 1 (seconds 0.1)) ) - (when (logtest? (-> self control status) 8) + (when (logtest? (-> self control status) (cshape-moving-flags twall)) (let* ((gp-8 (racer-find-prop-point (new 'stack-no-clear 'vector) (-> self control unknown-vector70))) - (v1-274 (shr (shl (-> self control unknown-int60) 52) 58)) + (v1-274 (-> self control wall-pat material)) (a1-54 (cond - ((or (= v1-274 16) (= v1-274 8)) + ((or (= v1-274 (pat-material metal)) (= v1-274 (pat-material pcmetal))) (set! (-> *part-id-table* 2226 init-specs 1 initial-valuef) (lerp-scale 0.2 10.0 (-> self control unknown-float01) 0.0 (-> self racer transv-max)) ) @@ -999,23 +907,16 @@ ) ) ) - (sp-launch-particles-var - *sp-particle-system-2d* - a1-54 - gp-8 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles a1-54 gp-8) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 51 (seconds 0.05)) (sound-play-by-name - (sound-name-with-material 'zoom-hit (the-as pat-surface (-> self control unknown-int60)) "") + (sound-name-with-material 'zoom-hit (-> self control wall-pat) "") (-> self racer scrape-sound-id) 1024 0 0 - 1 + (sound-group sfx) #t ) ) @@ -1027,7 +928,7 @@ ) ) (set! (-> self racer heat-sound-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warning") ) (when (rand-vu-percent? (/ (-> self racer heat) (-> *RACER-bank* heat-max))) (let ((a2-28 @@ -1037,14 +938,7 @@ ) ) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2227) - a2-28 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 2227) a2-28) ) ) 0 @@ -1164,15 +1058,8 @@ (* -273.06668 (-> self racer tail-anim-frame)) ) (let ((f30-2 (fmin 1.0 (* 2.0 (fabs (-> self racer slide-shift-x)))))) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 num-func) num-func-identity) - (set! (-> gp-1 frame-num) (ja-aframe (-> self racer turn-anim-frame) 0)) - ) - (let ((a0-9 (-> self skel root-channel 1))) - (set! (-> a0-9 frame-interp) (+ 0.5 (* 0.025 (-> self racer tail-anim-frame)))) - (set! (-> a0-9 param 0) 0.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num-func num-func-identity :frame-num (ja-aframe (-> self racer turn-anim-frame) 0)) + (ja :chan 1 :num! (chan 0) :frame-interp (+ 0.5 (* 0.025 (-> self racer tail-anim-frame)))) (let ((gp-2 (-> self skel root-channel 2))) (let ((f0-82 (lerp (-> self racer slide-interp) f30-2 0.125))) (set! (-> self racer slide-interp) f0-82) @@ -1182,18 +1069,15 @@ (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-chan) ) ) - (let ((a0-12 (-> self skel root-channel 3))) - (set! (-> a0-12 frame-interp) - (* (-> self racer slide-interp) (+ 0.5 (* 0.025 (-> self racer tail-anim-frame)))) - ) - (set! (-> a0-12 param 0) 0.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :chan 3 + :num! (chan 0) + :frame-interp (* (-> self racer slide-interp) (+ 0.5 (* 0.025 (-> self racer tail-anim-frame)))) + ) 0 (none) ) -(defbehavior target-racing-jump-anim target ((arg0 basic) (arg1 int)) +(defbehavior target-racing-jump-anim target ((arg0 basic) (arg1 time-frame)) (let ((s4-0 'nothing) (f30-0 0.0) ) @@ -1207,17 +1091,9 @@ (when (!= s5-0 s4-0) (if (= s4-0 'nothing) (ja-channel-push! 1 arg1) - (ja-channel-push! 1 37) + (ja-channel-push! 1 (seconds 0.125)) ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 130))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 130)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) f30-0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 130)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 130) :num! (seek!) :frame-num f30-0) (set! s4-0 s5-0) ) ) @@ -1226,35 +1102,17 @@ (if (= (-> self next-state name) 'target-racing-falling) (set! f0-4 (* 0.5 f0-4)) ) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) f0-4) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f0-4)) ) (set! f30-0 (ja-aframe-num 0)) (ja-blend-eval) ) ) (ja-channel-set! 2) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 131)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) - (let ((gp-2 (-> self skel root-channel 1))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 132)) - num-func-identity - ) - (set! (-> gp-2 frame-num) (ja-aframe 44.0 0)) - ) + (ja :group! (-> self draw art-group data 131) :num! min) + (ja :chan 1 :group! (-> self draw art-group data 132) :num! (identity (ja-aframe 44.0 0))) (let ((f30-1 0.0)) - (while #t + (loop (suspend) (let ((gp-3 (-> self skel root-channel 1))) (set! f30-1 (seek f30-1 1.0 (-> *display* seconds-per-frame))) @@ -1270,72 +1128,36 @@ (if (>= (-> self racer slide-mode) 0) (goto cfg-23) ) - (ja-channel-push! 1 21) + (ja-channel-push! 1 (seconds 0.07)) (cond ((= arg0 'high-jump) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 135))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 135)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 135)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 135) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (>= (-> self racer slide-mode) 0) (goto cfg-23) ) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((= arg0 'jump) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 129))) - (set! (-> gp-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 129)) data 0 length) -1)) - ) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) (ja-aframe 44.0 0)) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 129)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 129) :num! (seek!) :frame-num (ja-aframe 44.0 0)) (until (ja-done? 0) (if (>= (-> self racer slide-mode) 0) (goto cfg-23) ) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 132))) - (set! (-> gp-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 132)) data 0 length) -1)) - ) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) (ja-aframe 44.0 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 132)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 132) :num! (seek!) :frame-num (ja-aframe 44.0 0)) (until (ja-done? 0) (if (>= (-> self racer slide-mode) 0) (goto cfg-23) ) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -1463,10 +1285,8 @@ ) (cond ((racer-on-ground?) - (set! (-> self control unknown-float81) - (seek (-> self control unknown-float81) 1.0 (* 8.0 (-> *display* seconds-per-frame))) - ) - (set! (-> self racer mult-rotx) (seek (-> self racer mult-rotx) 0.0 (* 2.0 (-> *display* seconds-per-frame)))) + (seek! (-> self control unknown-float81) 1.0 (* 8.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer mult-rotx) 0.0 (* 2.0 (-> *display* seconds-per-frame))) (set! (-> self racer targ-rotx) 0.0) (set! (-> self racer hill-rotx) 0.0) (set! (-> self racer speed-rotx) 0.25) @@ -1479,9 +1299,9 @@ (when (!= (the int (/ f0-52 (* 0.5 (-> self racer bob-period)))) (the int (/ (-> self racer bob-timer) (* 0.5 (-> self racer bob-period)))) ) - (set! (-> self racer bob-mult-trans) (seek (-> self racer bob-mult-trans) 1.0 0.75)) + (seek! (-> self racer bob-mult-trans) 1.0 0.75) (if (< 1.5 (-> self racer bob-meta-meta-timer)) - (set! (-> self racer bob-meta-meta-timer) (seek (-> self racer bob-meta-meta-timer) 1.0 0.5)) + (seek! (-> self racer bob-meta-meta-timer) 1.0 0.5) ) (when (>= (- (-> *display* base-frame-counter) (-> self racer bob-meta-time)) (seconds 2.2)) (set! (-> self racer bob-meta-time) (-> *display* base-frame-counter)) @@ -1490,9 +1310,7 @@ ) ) (let ((f0-63 (lerp-scale -1.0 -0.33 (-> self control unknown-float01) 0.0 (-> self racer transv-max)))) - (set! (-> self racer bob-mult-rot) - (seek (-> self racer bob-mult-rot) f0-63 (* 8.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer bob-mult-rot) f0-63 (* 8.0 (-> *display* seconds-per-frame))) ) (if (< 0.0 f30-1) (set! f30-1 0.0) @@ -1500,12 +1318,8 @@ (set! (-> self racer stick-lock) #f) ) (else - (set! (-> self control unknown-float81) - (seek (-> self control unknown-float81) 0.0 (* 2.0 (-> *display* seconds-per-frame))) - ) - (set! (-> self racer mult-rotx) - (seek (-> self racer mult-rotx) 1.0 (* 16.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self control unknown-float81) 0.0 (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer mult-rotx) 1.0 (* 16.0 (-> *display* seconds-per-frame))) (let ((f0-77 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (the-as vector (-> self control trans-old))) (let* ((v1-128 (-> self racer bounce)) @@ -1540,9 +1354,7 @@ ) (set! (-> self racer speed-rotx) 0.5) (when (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.1)) - (set! (-> self racer hill-rotx) - (seek (-> self racer hill-rotx) 0.0 (* 65536.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer hill-rotx) 0.0 (* 65536.0 (-> *display* seconds-per-frame))) (set! (-> self racer speed-rotx) 0.6) ) ) @@ -1550,9 +1362,7 @@ (set! (-> self racer speed-rotx) 0.25) ) ) - (set! (-> self racer mult-rotx) - (seek (-> self racer mult-rotx) 1.0 (* 64.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer mult-rotx) 1.0 (* 64.0 (-> *display* seconds-per-frame))) ) (else (set! (-> self racer speed-rotx) 0.025) @@ -1564,12 +1374,8 @@ ) (set! (-> self racer bob-timer) (- f0-91 (* (the float (the int (/ f0-91 f1-44))) f1-44))) ) - (set! (-> self racer bob-mult-rot) - (seek (-> self racer bob-mult-rot) 0.0 (* 16.0 (-> *display* seconds-per-frame))) - ) - (set! (-> self racer bob-mult-trans) - (seek (-> self racer bob-mult-trans) 0.0 (* 16.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer bob-mult-rot) 0.0 (* 16.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer bob-mult-trans) 0.0 (* 16.0 (-> *display* seconds-per-frame))) (set! f30-1 (lerp-scale f30-1 @@ -1580,7 +1386,7 @@ ) ) (cond - ((and (logtest? (-> self control status) 8) + ((and (logtest? (-> self control status) (cshape-moving-flags twall)) (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.1)) (or (-> self racer stick-lock) (< (target-move-dist (-> *TARGET-bank* stuck-time)) 4096.0)) (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) diff --git a/goal_src/levels/robocave/cave-trap.gc b/goal_src/levels/robocave/cave-trap.gc index ea0bf03bc6..8dfa5f593b 100644 --- a/goal_src/levels/robocave/cave-trap.gc +++ b/goal_src/levels/robocave/cave-trap.gc @@ -46,8 +46,7 @@ (defstate spider-vent-idle (spider-vent) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('can-spawn?) @@ -61,8 +60,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -116,68 +114,61 @@ (defmethod TODO-RENAME-20 cave-trap ((obj cave-trap)) - (with-pp - (set! (-> obj last-spawn-time) (-> *display* base-frame-counter)) - (set! (-> obj spawn-delay) (rand-vu-int-range (seconds 0.1) (seconds 0.5))) - (let ((s5-0 (new 'stack-no-clear 'spawn-baby-spider-work))) - (let ((s4-0 (new 'stack-no-clear 'vector))) - (dotimes (v1-2 4) - (set! (-> s5-0 best v1-2 index) -1) - ) - (set! (-> s4-0 quad) (-> (matrix-local->world #f #f) vector 2 quad)) - (set! (-> s4-0 y) 0.0) - (vector-normalize! s4-0 102400.0) - (vector+! s4-0 s4-0 (camera-pos)) - (set! (-> s4-0 y) (-> (target-pos 0) y)) - (dotimes (s3-2 (-> obj alt-actors length)) - (let* ((v1-10 (-> obj alt-actors s3-2)) - (s1-0 (if v1-10 - (-> v1-10 extra process) - ) - ) - (s2-2 (if (and (nonzero? s1-0) (type-type? (-> s1-0 type) process-drawable)) - s1-0 - ) - ) - ) - (when s2-2 - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) pp) - (set! (-> a1-6 num-params) 0) - (set! (-> a1-6 message) 'can-spawn?) - (when (send-event-function s2-2 a1-6) - (let ((f30-0 (vector-vector-distance s4-0 (-> (the-as process-drawable s2-2) root trans))) - (a0-12 (new 'stack-no-clear 'sphere)) - ) - (let ((v1-16 (-> s5-0 best 3))) - (when (or (< (-> v1-16 index) 0) (< f30-0 (-> v1-16 dist))) - (set! (-> v1-16 index) s3-2) - (set! (-> v1-16 dist) f30-0) + (set! (-> obj last-spawn-time) (-> *display* base-frame-counter)) + (set! (-> obj spawn-delay) (rand-vu-int-range (seconds 0.1) (seconds 0.5))) + (let ((s5-0 (new 'stack-no-clear 'spawn-baby-spider-work))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (dotimes (v1-2 4) + (set! (-> s5-0 best v1-2 index) -1) + ) + (set! (-> s4-0 quad) (-> (matrix-local->world #f #f) vector 2 quad)) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 102400.0) + (vector+! s4-0 s4-0 (camera-pos)) + (set! (-> s4-0 y) (-> (target-pos 0) y)) + (dotimes (s3-2 (-> obj alt-actors length)) + (let* ((v1-10 (-> obj alt-actors s3-2)) + (s1-0 (if v1-10 + (-> v1-10 extra process) + ) + ) + (s2-2 (if (and (nonzero? s1-0) (type-type? (-> s1-0 type) process-drawable)) + s1-0 + ) + ) + ) + (when s2-2 + (when (send-event s2-2 'can-spawn?) + (let ((f30-0 (vector-vector-distance s4-0 (-> (the-as process-drawable s2-2) root trans))) + (a0-12 (new 'stack-no-clear 'sphere)) + ) + (let ((v1-16 (-> s5-0 best 3))) + (when (or (< (-> v1-16 index) 0) (< f30-0 (-> v1-16 dist))) + (set! (-> v1-16 index) s3-2) + (set! (-> v1-16 dist) f30-0) + ) + ) + (set! (-> a0-12 quad) (-> (the-as process-drawable s2-2) root trans quad)) + (set! (-> a0-12 w) 4096.0) + (when (sphere-in-view-frustum? a0-12) + (let ((v1-18 (-> s5-0 best 2))) + (when (or (< (-> v1-18 index) 0) (< f30-0 (-> v1-18 dist))) + (set! (-> v1-18 index) s3-2) + (set! (-> v1-18 dist) f30-0) + ) + ) + (when (>= 40960.0 f30-0) + (let ((v1-19 (-> s5-0 best 1))) + (when (or (< (-> v1-19 index) 0) (< f30-0 (-> v1-19 dist))) + (set! (-> v1-19 index) s3-2) + (set! (-> v1-19 dist) f30-0) ) ) - (set! (-> a0-12 quad) (-> (the-as process-drawable s2-2) root trans quad)) - (set! (-> a0-12 w) 4096.0) - (when (sphere-in-view-frustum? a0-12) - (let ((v1-18 (-> s5-0 best 2))) - (when (or (< (-> v1-18 index) 0) (< f30-0 (-> v1-18 dist))) - (set! (-> v1-18 index) s3-2) - (set! (-> v1-18 dist) f30-0) - ) - ) - (when (>= 40960.0 f30-0) - (let ((v1-19 (-> s5-0 best 1))) - (when (or (< (-> v1-19 index) 0) (< f30-0 (-> v1-19 dist))) - (set! (-> v1-19 index) s3-2) - (set! (-> v1-19 dist) f30-0) - ) - ) - (when (= (-> s2-2 type) spider-egg) - (let ((v1-21 (-> s5-0 best))) - (when (or (< (-> v1-21 0 index) 0) (< f30-0 (-> v1-21 0 dist))) - (set! (-> v1-21 0 index) s3-2) - (set! (-> v1-21 0 dist) f30-0) - ) - ) + (when (= (-> s2-2 type) spider-egg) + (let ((v1-21 (-> s5-0 best))) + (when (or (< (-> v1-21 0 index) 0) (< f30-0 (-> v1-21 0 dist))) + (set! (-> v1-21 0 index) s3-2) + (set! (-> v1-21 0 dist) f30-0) ) ) ) @@ -188,62 +179,44 @@ ) ) ) - (dotimes (s4-1 4) - (let ((v1-29 (-> s5-0 best s4-1 index))) - (when (>= v1-29 0) - (let* ((v1-32 (-> obj alt-actors v1-29)) - (s2-3 (if v1-32 - (-> v1-32 extra process) - ) - ) - (s3-3 (if (and (nonzero? s2-3) (type-type? (-> s2-3 type) process-drawable)) - s2-3 - ) - ) - (s2-4 (new 'stack-no-clear 'vector)) - (s1-1 (new 'stack-no-clear 'baby-spider-spawn-params)) - ) - (vector-! s2-4 (target-pos 0) (-> (the-as process-drawable s3-3) root trans)) - (vector-normalize! s2-4 1.0) - (init! s1-1 (= (-> s3-3 type) spider-egg) #t #t #t 7 1 'untrigger) - (let* ((s0-2 (get-process *default-dead-pool* baby-spider #x4000)) - (v1-40 (when s0-2 - (let ((t9-14 (method-of-type baby-spider activate))) - (t9-14 (the-as baby-spider s0-2) obj 'baby-spider (the-as pointer #x70004000)) - ) - (run-now-in-process - s0-2 - baby-spider-init-by-other - obj - (-> (the-as process-drawable s3-3) root trans) - s2-4 - s1-1 - ) - (-> s0-2 ppointer) - ) - ) - ) - (when v1-40 - (set! (-> (the-as baby-spider (-> v1-40 0)) die-if-not-visible?) #t) - (+! (-> obj spider-count) 1) - (send-event s3-3 'notify-spawned) - (return #f) - ) + ) + (dotimes (s4-1 4) + (let ((v1-29 (-> s5-0 best s4-1 index))) + (when (>= v1-29 0) + (let* ((v1-32 (-> obj alt-actors v1-29)) + (s2-3 (if v1-32 + (-> v1-32 extra process) + ) + ) + (s3-3 (if (and (nonzero? s2-3) (type-type? (-> s2-3 type) process-drawable)) + s2-3 + ) + ) + (s2-4 (new 'stack-no-clear 'vector)) + (s1-1 (new 'stack-no-clear 'baby-spider-spawn-params)) + ) + (vector-! s2-4 (target-pos 0) (-> (the-as process-drawable s3-3) root trans)) + (vector-normalize! s2-4 1.0) + (init! s1-1 (= (-> s3-3 type) spider-egg) #t #t #t 7 1 'untrigger) + (let ((v1-40 (process-spawn baby-spider obj (-> (the-as process-drawable s3-3) root trans) s2-4 s1-1 :to obj))) + (when v1-40 + (set! (-> (the-as baby-spider (-> v1-40 0)) die-if-not-visible?) #t) + (+! (-> obj spider-count) 1) + (send-event s3-3 'notify-spawned) + (return #f) ) ) ) ) ) ) - #f ) + #f ) (defstate cave-trap-idle (cave-trap) - :event - cave-trap-default-event-handler - :trans - (behavior () + :event cave-trap-default-event-handler + :trans (behavior () (when *target* (let* ((gp-0 (target-pos 0)) (f0-0 (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) @@ -251,7 +224,7 @@ ) (when (and (>= 61440.0 f1-1) (>= f1-1 -16384.0)) (when (>= 274432.0 f0-0) - (when (or (>= 188416.0 f0-0) (send-event *target* 'query 'powerup 1)) + (when (or (>= 188416.0 f0-0) (send-event *target* 'query 'powerup (pickup-type eco-yellow))) (level-hint-spawn (game-text-id cave-trap-nest-hint) "sksp0341" @@ -268,8 +241,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -278,15 +250,12 @@ ) (defstate cave-trap-active (cave-trap) - :event - cave-trap-default-event-handler - :enter - (behavior () + :event cave-trap-default-event-handler + :enter (behavior () (set! (-> self spawn-delay) (seconds 0.5)) (none) ) - :trans - (behavior () + :trans (behavior () (cond (*target* (let* ((gp-0 (target-pos 0)) @@ -310,8 +279,7 @@ 0 (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -320,10 +288,8 @@ ) (defstate cave-trap-give-up (cave-trap) - :event - cave-trap-default-event-handler - :code - (behavior () + :event cave-trap-default-event-handler + :code (behavior () (suspend) (go cave-trap-idle) (none) @@ -356,9 +322,9 @@ ) (process-drawable-from-entity! obj arg0) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav nearest-y-threshold) 409600.0) - (set! (-> obj root-override nav-flags) (logand -2 (-> obj root-override nav-flags))) + (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((s4-1 (entity-actor-count arg0 'alt-actor))) diff --git a/goal_src/levels/robocave/robocave-part.gc b/goal_src/levels/robocave/robocave-part.gc index 6f13d26afa..49bff9d304 100644 --- a/goal_src/levels/robocave/robocave-part.gc +++ b/goal_src/levels/robocave/robocave-part.gc @@ -19,8 +19,7 @@ (defpartgroup group-part-robocave-torch :id 506 :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 729 :fade-after (meters 150) :falloff-to (meters 180)) + :parts ((sp-item 729 :fade-after (meters 150) :falloff-to (meters 180)) (sp-item 730 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 731 :fade-after (meters 40) :falloff-to (meters 40) :period 600 :length 90) (sp-item 732 :fade-after (meters 40) :falloff-to (meters 40) :period 369 :length 69) @@ -30,8 +29,7 @@ ) (defpart 734 - :init-specs - ((sp-flt spt-num 0.3) + :init-specs ((sp-flt spt-num 0.3) (sp-flt spt-x (meters 0.2)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-int spt-rot-x 5) @@ -49,13 +47,11 @@ ) (defpart 735 - :init-specs - ((sp-flt spt-fade-b -6.826667)) + :init-specs ((sp-flt spt-fade-b -6.826667)) ) (defpart 729 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1068708659 1 0.5) (sp-rnd-flt spt-x (meters -0.35) (meters 0.7) 1.0) (sp-rnd-flt spt-z (meters -0.35) (meters 0.7) 1.0) @@ -77,13 +73,11 @@ ) (defpart 736 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) (defpart 731 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters 1)) @@ -106,8 +100,7 @@ ) (defpart 732 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.2) (meters 0.6) 1.0) (sp-flt spt-y (meters 0.5)) @@ -130,8 +123,7 @@ ) (defpart 733 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 0.2) 1.0) (sp-flt spt-y (meters 0.6)) @@ -154,8 +146,7 @@ ) (defpart 730 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.3)) diff --git a/goal_src/levels/robocave/spider-egg.gc b/goal_src/levels/robocave/spider-egg.gc index 7b4eccbd52..a93f1b86f6 100644 --- a/goal_src/levels/robocave/spider-egg.gc +++ b/goal_src/levels/robocave/spider-egg.gc @@ -5,14 +5,11 @@ ;; name in dgo: spider-egg ;; dgos: L1, ROB -(define-extern *spider-egg-unbroken-sg* skeleton-group) -(define-extern *spider-egg-broken-sg* skeleton-group) - -(declare-type spider-egg process-drawable) - ;; DECOMP BEGINS +(import "goal_src/import/spider-egg-ag.gc") + (deftype spider-egg (process-drawable) ((root-override collide-shape-moving :offset 112) (notify-actor entity-actor :offset-assert 176) @@ -30,25 +27,24 @@ ) -(defskelgroup *spider-egg-unbroken-sg* spider-egg - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *spider-egg-unbroken-sg* spider-egg spider-egg-unbroken-lod0-jg -1 + ((spider-egg-unbroken-lod0-mg (meters 20)) + (spider-egg-unbroken-lod1-mg (meters 40)) + (spider-egg-unbroken-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 1 0 2) + ) -(defskelgroup *spider-egg-broken-sg* spider-egg - 5 - -1 - ((6 (meters 20)) (7 (meters 40)) (8 (meters 999999))) - :bounds (static-spherem 0 1 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *spider-egg-broken-sg* spider-egg spider-egg-broken-lod0-jg -1 + ((spider-egg-broken-lod0-mg (meters 20)) + (spider-egg-broken-lod1-mg (meters 40)) + (spider-egg-broken-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 1 0 2) + ) (defstate spider-egg-idle (spider-egg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 none)) (let ((v1-0 arg2)) (the-as object (cond @@ -76,103 +72,54 @@ ) ) ) - :enter - (behavior ((arg0 symbol)) + :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) (cond (arg0 (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> gp-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> gp-1 param 1) f30-0) - (set! (-> gp-1 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! spider-egg-idle-ja + :num! (seek! max f30-0) + :frame-num (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1))) + ) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) f30-0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (else - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) ) ) - (while #t + (loop (let ((gp-2 (rand-vu-int-range 2 6))) (dotimes (s5-0 gp-2) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) f30-0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! spider-egg-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) f30-0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) - (ja-channel-push! 1 30) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 13)) data 0 length) -1)) - ) - (set! (-> a0-13 param 1) 1.0) - (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! spider-egg-twitch-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) ) (none) ) - :post - (the-as (function none :behavior spider-egg) ja-post) + :post (the-as (function none :behavior spider-egg) ja-post) ) (defstate spider-egg-hatch (spider-egg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 symbol)) (case arg2 (('can-spawn?) @@ -181,47 +128,27 @@ ) ) ) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 324) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 324) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) - (ja-channel-push! 1 60) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! spider-egg-crack-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (logior! (-> self draw status) (draw-status hidden)) (until (not (-> self child)) @@ -229,13 +156,11 @@ ) (none) ) - :post - (the-as (function none :behavior spider-egg) ja-post) + :post (the-as (function none :behavior spider-egg) ja-post) ) (defstate spider-egg-die (spider-egg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 symbol)) (case arg2 (('can-spawn?) @@ -244,8 +169,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (logclear! (-> self mask) (process-mask actor-pause)) (when (-> self notify-actor) @@ -266,43 +190,24 @@ ) ) ) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 325) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 325) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (clear-collide-with-as (-> self root-override)) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-no-eval :group! spider-egg-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (logior! (-> self draw status) (draw-status hidden)) (until (not (-> self child)) @@ -310,8 +215,7 @@ ) (none) ) - :post - (the-as (function none :behavior spider-egg) ja-post) + :post (the-as (function none :behavior spider-egg) ja-post) ) (defmethod init-from-entity! spider-egg ((obj spider-egg) (arg0 entity-actor)) diff --git a/goal_src/levels/rolling/rolling-lightning-mole.gc b/goal_src/levels/rolling/rolling-lightning-mole.gc index 9f2b78e7ea..37ecb572cb 100644 --- a/goal_src/levels/rolling/rolling-lightning-mole.gc +++ b/goal_src/levels/rolling/rolling-lightning-mole.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/lightning-mole-ag.gc") + (defun find-adjacent-bounds-one ((arg0 nav-mesh) (arg1 nav-poly) (arg2 int) (arg3 (array int8)) (arg4 (array int8)) (arg5 vector)) (local-vars (v0-2 object) (v1-2 int) (v1-30 int) (a0-2 int) (a0-12 int) (sv-16 nav-poly) (sv-32 int)) (let ((v1-1 (+ arg2 1))) @@ -378,52 +380,31 @@ (defstate nav-enemy-patrol (fleeing-nav-enemy) :virtual #t - :enter - (-> (method-of-type nav-enemy nav-enemy-patrol) enter) - :exit - (-> (method-of-type nav-enemy nav-enemy-patrol) exit) - :trans - (behavior () + :enter (-> (method-of-type nav-enemy nav-enemy-patrol) enter) + :exit (-> (method-of-type nav-enemy nav-enemy-patrol) exit) + :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-patrol) trans)) (fleeing-nav-enemy-adjust-nav-info) (none) ) - :code - (-> (method-of-type nav-enemy nav-enemy-patrol) code) - :post - (-> (method-of-type nav-enemy nav-enemy-patrol) post) + :code (-> (method-of-type nav-enemy nav-enemy-patrol) code) + :post (-> (method-of-type nav-enemy nav-enemy-patrol) post) ) (defstate nav-enemy-notice (fleeing-nav-enemy) :virtual #t - :enter - (-> (method-of-type nav-enemy nav-enemy-notice) enter) - :trans - (behavior () + :enter (-> (method-of-type nav-enemy nav-enemy-notice) enter) + :trans (behavior () (fleeing-nav-enemy-adjust-nav-info) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (let ((f30-0 (nav-enemy-rnd-float-range 1.0 1.2))) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - ) - (set! (-> a0-2 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info notice-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (seek-toward-heading-vec! (-> self collide-info) @@ -438,72 +419,56 @@ (go-virtual nav-enemy-chase) ) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) f30-0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (go-virtual nav-enemy-chase) (none) ) - :post - (-> (method-of-type nav-enemy nav-enemy-notice) post) + :post (-> (method-of-type nav-enemy nav-enemy-notice) post) ) (defstate nav-enemy-chase (fleeing-nav-enemy) :virtual #t - :enter - (behavior () - (logior! (-> self nav flags) (nav-control-flags bit12)) + :enter (behavior () + (logior! (-> self nav flags) (nav-control-flags navcf12)) ((-> (method-of-type nav-enemy nav-enemy-chase) enter)) (none) ) - :exit - (behavior () - (logclear! (-> self nav flags) (nav-control-flags bit12)) + :exit (behavior () + (logclear! (-> self nav flags) (nav-control-flags navcf12)) (none) ) - :trans - (behavior () + :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) (fleeing-nav-enemy-adjust-nav-info) (none) ) - :code - (-> (method-of-type nav-enemy nav-enemy-chase) code) - :post - (-> (method-of-type nav-enemy nav-enemy-chase) post) + :code (-> (method-of-type nav-enemy nav-enemy-chase) code) + :post (-> (method-of-type nav-enemy nav-enemy-chase) post) ) (defstate nav-enemy-stop-chase (fleeing-nav-enemy) :virtual #t - :enter - (-> (method-of-type nav-enemy nav-enemy-stop-chase) enter) - :trans - (behavior () + :enter (-> (method-of-type nav-enemy nav-enemy-stop-chase) enter) + :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-stop-chase) trans)) (fleeing-nav-enemy-adjust-nav-info) (none) ) - :code - (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) - :post - (-> (method-of-type nav-enemy nav-enemy-stop-chase) post) + :code (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) + :post (-> (method-of-type nav-enemy nav-enemy-stop-chase) post) ) (defstate fleeing-nav-enemy-debug (fleeing-nav-enemy) - :enter - (-> (method-of-type nav-enemy nav-enemy-chase) enter) - :code - (behavior () + :enter (-> (method-of-type nav-enemy nav-enemy-chase) enter) + :code (behavior () (let ((gp-0 (new-stack-vector0)) (s5-0 (new-stack-vector0)) ) (set! (-> gp-0 x) 1.0) (set! (-> s5-0 x) 1.0) - (while #t + (loop (when (cpad-pressed? 1 r3) (suspend) (go fleeing-nav-enemy-debug) @@ -538,8 +503,7 @@ ) (none) ) - :post - (the-as (function none :behavior fleeing-nav-enemy) nav-enemy-travel-post) + :post (the-as (function none :behavior fleeing-nav-enemy) nav-enemy-travel-post) ) (define *lightning-mole-hole* (new 'static 'vector :x -241664.0 :y 106496.0 :z -6393856.0)) @@ -564,14 +528,14 @@ ) -(defskelgroup *lightning-mole-sg* lightning-mole - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *lightning-mole-sg* lightning-mole lightning-mole-lod0-jg lightning-mole-idle-ja + ((lightning-mole-lod0-mg (meters 20)) + (lightning-mole-lod1-mg (meters 40)) + (lightning-mole-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 8) + :shadow lightning-mole-shadow-mg + ) (defbehavior lightning-mole-task-complete? lightning-mole () (local-vars (sv-16 symbol)) @@ -582,31 +546,26 @@ (cond (sv-16 (close-specific-task! (-> self entity extra perm task) (task-status need-reminder)) - (let ((gp-0 (get-process *default-dead-pool* process #x4000))) - (when gp-0 - (let ((t9-4 (method-of-type process activate))) - (t9-4 gp-0 self 'process (the-as pointer #x70004000)) + (process-spawn-function + process + (lambda :behavior lightning-mole + () + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current movie) + (-> *setting-control* current hint) + ) + (suspend) ) - (run-next-time-in-process gp-0 (lambda :behavior lightning-mole - () - (while (or (-> *setting-control* current ambient) - (-> *setting-control* current movie) - (-> *setting-control* current hint) - ) - (suspend) - ) - (level-hint-spawn - (game-text-id rolling-lightning-moles-completion) - "sksp0112" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (none) - ) - ) - (-> gp-0 ppointer) + (level-hint-spawn + (game-text-id rolling-lightning-moles-completion) + "sksp0112" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + (none) ) + :to self ) (format #t "lightning-mole task is complete~%") ) @@ -625,29 +584,19 @@ ) (defbehavior lightning-mole-run-code lightning-mole () - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - (ja-channel-push! 1 60) - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) + (when (!= (ja-group) (-> self draw art-group data 7)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 7)) ) - (while #t - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (-> self speed-adjust)) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-loop!) - ) + (loop + (ja :num! (loop! (-> self speed-adjust))) (suspend) ) (none) ) (defstate lightning-mole-debug-blend (lightning-mole) - :trans - (behavior () + :trans (behavior () (let ((gp-0 (new-stack-vector0))) (let ((a1-0 (new-stack-vector0))) (clmf-input gp-0 a1-0 1) @@ -657,23 +606,19 @@ (set! (-> self speed-adjust) 1.0) (none) ) - :code - lightning-mole-run-code - :post - (the-as (function none :behavior lightning-mole) ja-post) + :code lightning-mole-run-code + :post (the-as (function none :behavior lightning-mole) ja-post) ) (defstate lightning-mole-debug-run (lightning-mole) - :enter - (behavior () + :enter (behavior () (set! (-> self speed-adjust) 1.0) (set-vector! (-> self debug-vector) 0.0 0.0 1.0 1.0) (set! (-> self saved-travel quad) (-> self debug-vector quad)) ((-> (method-of-type nav-enemy nav-enemy-chase) enter)) (none) ) - :trans - (behavior () + :trans (behavior () (when (cpad-pressed? 1 r3) (logclear! (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons r3)) (logclear! (-> *cpad-list* cpads 1 button0-rel 0) (pad-buttons r3)) @@ -681,10 +626,8 @@ ) (none) ) - :code - lightning-mole-run-code - :post - (behavior () + :code lightning-mole-run-code + :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (new-stack-vector0)) (a1-0 (new-stack-vector0)) @@ -726,8 +669,7 @@ ) (defstate lightning-mole-gone (lightning-mole) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (ja-channel-set! 0) (ja-post) @@ -740,27 +682,22 @@ ) (defstate lightning-mole-hiding (lightning-mole) - :enter - (behavior () + :enter (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self collide-info)) (none) ) - :trans - (behavior () + :trans (behavior () (when (task-closed? (-> self entity extra perm task) (task-status need-introduction)) (ja-channel-set! 1) - (let ((v1-4 (-> self skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) + (ja :group! (-> self draw art-group data 5)) (restore-collide-with-as (-> self collide-info)) (go-virtual nav-enemy-idle) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) @@ -768,8 +705,7 @@ ) (defstate lightning-mole-dive (lightning-mole) - :trans - (behavior () + :trans (behavior () (when (< (vector-vector-xz-distance *lightning-mole-hole* (-> self collide-info trans)) 61440.0) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) @@ -789,8 +725,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -800,16 +735,8 @@ (logior! (-> *target* mask) (process-mask sleep)) ) (ambient-hint-spawn "gamcam20" (the-as vector #f) *entity-pool* 'camera) - (ja-channel-push! 1 60) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) f30-0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 12) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> *camera-other-fov* data) 11650.845) @@ -821,11 +748,7 @@ (set! (-> *camera-other-root* quad) (-> *lightning-mole-hole* quad)) (set! *camera-look-through-other* 2) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) f30-0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (lightning-mole-task-complete?) @@ -835,18 +758,15 @@ (go lightning-mole-gone) (none) ) - :post - lightning-mole-hole-post + :post lightning-mole-hole-post ) (defstate lightning-mole-head-for-hole (lightning-mole) - :enter - (behavior () + :enter (behavior () (clear-collide-with-as (-> self collide-info)) (none) ) - :trans - (behavior () + :trans (behavior () (when (< (vector-vector-xz-distance *lightning-mole-hole* (-> self collide-info trans)) 61440.0) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) @@ -869,75 +789,52 @@ ) (none) ) - :code - (-> (method-of-type fleeing-nav-enemy nav-enemy-chase) code) - :post - lightning-mole-hole-post + :code (-> (method-of-type fleeing-nav-enemy nav-enemy-chase) code) + :post lightning-mole-hole-post ) (defstate lightning-mole-yelp (lightning-mole) - :enter - (behavior () + :enter (behavior () (clear-collide-with-as (-> self collide-info)) ((-> (method-of-type fleeing-nav-enemy nav-enemy-chase) enter)) (none) ) - :exit - (behavior () + :exit (behavior () (restore-collide-with-as (-> self collide-info)) (none) ) - :trans - (-> (method-of-type fleeing-nav-enemy nav-enemy-chase) trans) - :code - (behavior () - (ja-channel-push! 1 60) + :trans (-> (method-of-type fleeing-nav-enemy nav-enemy-chase) trans) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (go-virtual nav-enemy-chase) (none) ) - :post - (the-as (function none :behavior lightning-mole) nav-enemy-simple-post) + :post (the-as (function none :behavior lightning-mole) nav-enemy-simple-post) ) (defstate nav-enemy-stop-chase (lightning-mole) :virtual #t - :code - lightning-mole-run-code - :post - (the-as (function none :behavior lightning-mole) fleeing-nav-enemy-chase-post) + :code lightning-mole-run-code + :post (the-as (function none :behavior lightning-mole) fleeing-nav-enemy-chase-post) ) (defstate nav-enemy-chase (lightning-mole) :virtual #t - :enter - (behavior () + :enter (behavior () (set! (-> self speed-adjust) 1.0) (set! (-> self run-blend-interp) 0.0) (vector-! (-> self saved-travel) (-> self collide-info trans) (target-pos 0)) ((-> (method-of-type fleeing-nav-enemy nav-enemy-chase) enter)) (none) ) - :trans - (behavior () + :trans (behavior () (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) @@ -993,10 +890,8 @@ ((-> (method-of-type fleeing-nav-enemy nav-enemy-chase) trans)) (none) ) - :code - lightning-mole-run-code - :post - (the-as (function none :behavior lightning-mole) fleeing-nav-enemy-chase-post) + :code lightning-mole-run-code + :post (the-as (function none :behavior lightning-mole) fleeing-nav-enemy-chase-post) ) (defmethod dummy-43 lightning-mole ((obj lightning-mole) (arg0 process) (arg1 event-message-block)) @@ -1063,7 +958,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -1091,7 +986,7 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *lightning-mole-sg* '()) (TODO-RENAME-45 obj *lightning-mole-nav-enemy-info*) - (logclear! (-> obj nav flags) (nav-control-flags bit5 bit6 bit7)) + (logclear! (-> obj nav flags) (nav-control-flags navcf5 navcf6 navcf7)) (set! (-> obj draw origin-joint-index) (the-as uint 3)) (set! (-> obj reaction-time) (seconds 0.05)) (set! (-> obj last-reflection-time) 0) @@ -1134,13 +1029,11 @@ :id 456 :duration 5 :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 1768) (sp-item 1769 :period 120 :length 30) (sp-item 1770 :period 120 :length 60)) + :parts ((sp-item 1768) (sp-item 1769 :period 120 :length 30) (sp-item 1770 :period 120 :length 60)) ) (defpart 1768 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters -2)) @@ -1165,8 +1058,7 @@ ) (defpart 1769 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters -2)) @@ -1190,8 +1082,7 @@ ) (defpart 1770 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0)) @@ -1217,8 +1108,7 @@ ) (defpart 1771 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.05) 1.0) @@ -1242,8 +1132,7 @@ ) (defpart 1772 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.05) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1268,14 +1157,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 1771) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 1771) gp-0) ) ) (none) @@ -1285,22 +1167,11 @@ (when (< (-> arg2 y) (-> arg1 user-float)) (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (if (< (+ -1.0 (the-as float v1-2)) 0.05) - (sound-play-by-name (static-sound-name "land-grass") (new-sound-id) 1024 0 0 1 #t) - ) - ) + (if (< (rand-float-gen) 0.05) + (sound-play "land-grass") + ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 1772) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 1772) gp-0) ) ) (none) @@ -1322,8 +1193,7 @@ (defstate peeper-wait (peeper) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'hide) (let ((v0-0 (-> *display* base-frame-counter))) @@ -1334,16 +1204,14 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (not (and *target* (>= 81920.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans))))) ) @@ -1351,29 +1219,22 @@ ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior peeper) ja-post) + :post (the-as (function none :behavior peeper) ja-post) ) (defstate peeper-hide (peeper) - :code - (behavior () + :code (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 2.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek! max 2.0)) (while (not (ja-done? 0)) (suspend) (ja-eval) @@ -1382,28 +1243,24 @@ (go peeper-wait) (none) ) - :post - (the-as (function none :behavior peeper) ja-post) + :post (the-as (function none :behavior peeper) ja-post) ) (defstate peeper-down (peeper) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hide) (go peeper-wait) ) ) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 61440.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go peeper-wait) ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -1434,60 +1291,42 @@ (go peeper-up) (none) ) - :post - (the-as (function none :behavior peeper) ja-post) + :post (the-as (function none :behavior peeper) ja-post) ) (defstate peeper-up (peeper) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hide) (go peeper-hide) ) ) ) - :enter - (behavior () + :enter (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 61440.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go peeper-hide) ) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 13)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 13) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go peeper-down) ) (none) ) - :post - (the-as (function none :behavior peeper) ja-post) + :post (the-as (function none :behavior peeper) ja-post) ) (defmethod init-from-entity! peeper ((obj peeper) (arg0 entity-actor)) diff --git a/goal_src/levels/rolling/rolling-obs.gc b/goal_src/levels/rolling/rolling-obs.gc index 6f6b0352fa..d06e69a281 100644 --- a/goal_src/levels/rolling/rolling-obs.gc +++ b/goal_src/levels/rolling/rolling-obs.gc @@ -7,6 +7,12 @@ ;; DECOMP BEGINS +(import "goal_src/import/rollingcam-ag.gc") +(import "goal_src/import/pusher-ag.gc") +(import "goal_src/import/happy-plant-ag.gc") +(import "goal_src/import/dark-plant-ag.gc") +(import "goal_src/import/rolling-start-ag.gc") + (deftype rolling-part (part-spawner) ((root-override basic :offset 112) ) @@ -25,13 +31,10 @@ ) -(defskelgroup *rollingcam-sg* rollingcam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *rollingcam-sg* rollingcam rollingcam-lod0-jg rollingcam-anim-ja + ((rollingcam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) (deftype pusher-base (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -71,13 +74,10 @@ ) -(defskelgroup *pusher-sg* pusher - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *pusher-sg* pusher pusher-lod0-jg pusher-idle-ja + ((pusher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) (defbehavior pusher-base-init pusher-base () (set! (-> self mask) (logior (process-mask enemy platform) (-> self mask))) @@ -112,11 +112,9 @@ ) (defstate pusher-idle (pusher) - :trans - (the-as (function none :behavior pusher) rider-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior pusher) rider-trans) + :code (behavior () + (loop (let ((f0-0 -1.0)) (when (and *target* *camera*) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -124,29 +122,16 @@ (set! f0-0 (ray-capsule-intersect (-> self cyl) (camera-pos) gp-0)) ) ) - (cond - ((< f0-0 0.0) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (get-current-value-with-mirror (-> self sync) (-> self max-frame))) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (else - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) 0.0) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (if (< f0-0 0.0) + (ja :num! (seek! (get-current-value-with-mirror (-> self sync) (-> self max-frame)))) + (ja :num! (seek! 0.0)) ) - ) ) (suspend) ) (none) ) - :post - (the-as (function none :behavior pusher) rider-post) + :post (the-as (function none :behavior pusher) rider-post) ) (defmethod init-from-entity! pusher ((obj pusher) (arg0 entity-actor)) @@ -165,33 +150,18 @@ ) (defstate gorge-pusher-idle (gorge-pusher) - :trans - (the-as (function none :behavior gorge-pusher) rider-trans) - :code - (behavior () - (while #t - (cond - ((task-closed? (game-task rolling-race) (task-status need-introduction)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (-> self min-frame)) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (else - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (-> self max-frame)) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + :trans (the-as (function none :behavior gorge-pusher) rider-trans) + :code (behavior () + (loop + (if (task-closed? (game-task rolling-race) (task-status need-introduction)) + (ja :num! (seek! (-> self min-frame))) + (ja :num! (seek! (-> self max-frame))) ) - ) (suspend) ) (none) ) - :post - (the-as (function none :behavior gorge-pusher) rider-post) + :post (the-as (function none :behavior gorge-pusher) rider-post) ) (defmethod init-from-entity! gorge-pusher ((obj gorge-pusher) (arg0 entity-actor)) @@ -238,17 +208,14 @@ ) -(defskelgroup *dark-plant-sg* dark-plant - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 2.25 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *dark-plant-sg* dark-plant dark-plant-lod0-jg dark-plant-idle-ja + ((dark-plant-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2.25 0 6) + ) (defun dark-plant-check-target ((arg0 dark-plant)) (the-as symbol (and *target* (and (< (vector-vector-distance (-> arg0 root trans) (target-pos 0)) 16384.0) - (send-event *target* 'query 'powerup 4) + (send-event *target* 'query 'powerup (pickup-type eco-green)) ) ) ) @@ -263,7 +230,7 @@ ) (defun dark-plants-all-done ((arg0 dark-plant)) - (while #t + (loop (if (!= (-> arg0 state) dark-plant-gone) (return #f) ) @@ -302,40 +269,24 @@ ) (defstate dark-plant-sprout (dark-plant) - :trans - dark-plant-trans - :code - (behavior () + :trans dark-plant-trans + :code (behavior () (dark-plant-randomize self) (logclear! (-> self draw status) (draw-status hidden)) - (sound-play-by-name (static-sound-name "darkvine-grow") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (sound-play "darkvine-grow") + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go dark-plant-idle) (none) ) - :post - (the-as (function none :behavior dark-plant) ja-post) + :post (the-as (function none :behavior dark-plant) ja-post) ) (defstate dark-plant-gone (dark-plant) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (let* ((f30-0 1500.0) (v1-4 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -343,7 +294,7 @@ (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-5)))) 3000)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (when (and (!= (get-task-status (game-task rolling-plants)) (task-status invalid)) (!= (get-task-status (game-task rolling-plants)) 7) ) @@ -366,52 +317,35 @@ ) (none) ) - :post - (the-as (function none :behavior dark-plant) ja-post) + :post (the-as (function none :behavior dark-plant) ja-post) ) (defstate dark-plant-death (dark-plant) - :code - (behavior () + :code (behavior () (spawn (-> self part) (-> self root trans)) - (ja-channel-push! 1 60) - (sound-play-by-name (static-sound-name "darkvine-kill") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (sound-play "darkvine-kill") + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go dark-plant-gone) (none) ) - :post - (the-as (function none :behavior dark-plant) ja-post) + :post (the-as (function none :behavior dark-plant) ja-post) ) (defstate dark-plant-idle (dark-plant) - :trans - dark-plant-trans - :code - (behavior () - (while #t + :trans dark-plant-trans + :code (behavior () + (loop (when (and (logtest? (-> self draw status) (draw-status was-drawn)) *target* (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (if (rand-vu-percent? 0.3) - (sound-play-by-name (static-sound-name "darkvine-move") (new-sound-id) 1024 0 0 1 #t) + (sound-play "darkvine-move") ) (when (task-closed? (game-task rolling-plants) (task-status need-hint)) (level-hint-spawn @@ -421,22 +355,15 @@ *entity-pool* (game-task none) ) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'query) - (set! (-> a1-4 param 0) (the-as uint 'powerup)) - (set! (-> a1-4 param 1) (the-as uint 4)) - (if (not (send-event-function *target* a1-4)) - (level-hint-spawn - (game-text-id rolling-dark-plants-hint) - "sksp0114" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + (if (not (send-event *target* 'query 'powerup (pickup-type eco-green))) + (level-hint-spawn + (game-text-id rolling-dark-plants-hint) + "sksp0114" + (the-as entity #f) + *entity-pool* + (game-task none) ) - ) + ) ) ) (let ((gp-1 (-> self skel root-channel 0))) @@ -444,12 +371,10 @@ (set! (-> gp-1 param 0) (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) ) - (let* ((f30-1 0.9) - (f28-0 0.25) - (v1-32 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-33 (the-as number (logior #x3f800000 v1-32))) - ) - (set! (-> gp-1 param 1) (+ f30-1 (* f28-0 (+ -1.0 (the-as float v1-33))))) + (let ((f30-1 0.9) + (f28-0 0.25) + ) + (set! (-> gp-1 param 1) (+ f30-1 (* f28-0 (rand-float-gen)))) ) (set! (-> gp-1 frame-num) 0.0) (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) @@ -458,12 +383,10 @@ (suspend) (let ((gp-2 (-> self skel root-channel 0))) (set! (-> gp-2 param 0) (the float (+ (-> gp-2 frame-group data 0 length) -1))) - (let* ((f30-2 0.9) - (f28-1 0.25) - (v1-45 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-46 (the-as number (logior #x3f800000 v1-45))) - ) - (set! (-> gp-2 param 1) (+ f30-2 (* f28-1 (+ -1.0 (the-as float v1-46))))) + (let ((f30-2 0.9) + (f28-1 0.25) + ) + (set! (-> gp-2 param 1) (+ f30-2 (* f28-1 (rand-float-gen)))) ) (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) ) @@ -471,41 +394,29 @@ ) (none) ) - :post - (the-as (function none :behavior dark-plant) ja-post) + :post (the-as (function none :behavior dark-plant) ja-post) ) (defstate dark-plant-startup (dark-plant) - :trans - dark-plant-trans - :code - (behavior () + :trans dark-plant-trans + :code (behavior () (let ((gp-0 (-> self skel root-channel 0))) (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) (set! (-> gp-0 param 0) (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) ) (set! (-> gp-0 param 1) 1.0) - (let* ((v1-12 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-13 (the-as number (logior #x3f800000 v1-12))) - ) - (set! (-> gp-0 frame-num) (* (+ -1.0 (the-as float v1-13)) (the float (ja-num-frames 0)))) - ) + (set! (-> gp-0 frame-num) (* (rand-float-gen) (the float (ja-num-frames 0)))) (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) ) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go dark-plant-idle) (none) ) - :post - (the-as (function none :behavior dark-plant) ja-post) + :post (the-as (function none :behavior dark-plant) ja-post) ) (defpartgroup group-dark-plant @@ -513,13 +424,11 @@ :duration 42 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 1764) (sp-item 2356)) + :parts ((sp-item 1764) (sp-item 2356)) ) (defpart 2356 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 12)) @@ -537,8 +446,7 @@ ) (defpart 1764 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 128.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -601,45 +509,27 @@ ) -(defskelgroup *happy-plant-sg* happy-plant - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 2.25 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *happy-plant-sg* happy-plant happy-plant-lod0-jg happy-plant-init-ja + ((happy-plant-lod0-mg (meters 20)) (happy-plant-lod1-mg (meters 999999))) + :bounds (static-spherem 0 2.25 0 6) + ) (defstate happy-plant-opened (happy-plant) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior happy-plant) ja-post) + :post (the-as (function none :behavior happy-plant) ja-post) ) (defstate happy-plant-opening (happy-plant) - :exit - (behavior () + :exit (behavior () (when *target* (logclear! (-> *target* mask) (process-mask sleep)) (process-entity-status! self (entity-perm-status bit-3) #f) @@ -647,27 +537,17 @@ ) (none) ) - :code - (behavior () + :code (behavior () (close-specific-task! (game-task rolling-plants) (task-status need-reminder)) (process-entity-status! self (entity-perm-status bit-3) #t) (logclear! (-> self mask) (process-mask actor-pause)) (while (and *target* (< (vector-vector-distance (-> self root-override trans) (target-pos 0)) 24576.0)) (suspend) ) - (let* ((gp-1 (get-process *default-dead-pool* manipy #x4000)) - (gp-2 - (ppointer->handle - (when gp-1 - (let ((t9-5 (method-of-type manipy activate))) - (t9-5 (the-as manipy gp-1) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 manipy-init (-> self entity extra trans) (-> self entity) *rollingcam-sg* #f) - (-> gp-1 ppointer) - ) - ) - ) - ) + (let ((gp-2 + (ppointer->handle (manipy-spawn (-> self entity extra trans) (-> self entity) *rollingcam-sg* #f :to self)) + ) + ) (let ((s5-1 (get-process *default-dead-pool* othercam #x4000))) (ppointer->handle (when s5-1 (let ((t9-8 (method-of-type othercam activate))) @@ -678,17 +558,10 @@ ) ) ) - (let* ((s5-2 (get-process *default-dead-pool* fuel-cell #x4000)) - (s5-3 (ppointer->handle (when s5-2 - (let ((t9-11 (method-of-type fuel-cell activate))) - (t9-11 (the-as fuel-cell s5-2) self 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 fuel-cell-init-as-clone (process->handle self) 55) - (-> s5-2 ppointer) - ) - ) - ) - ) + (let ((s5-3 + (ppointer->handle (process-spawn fuel-cell :init fuel-cell-init-as-clone (process->handle self) 55 :to self)) + ) + ) (if *target* (logior! (-> *target* mask) (process-mask sleep)) ) @@ -698,17 +571,14 @@ :name "happy-plant-open" :index 5 :parts 2 - :command-list - '((0 send-event target draw #f) (10000 send-event target draw #t)) + :command-list '((0 send-event target draw #f) (10000 send-event target draw #t)) ) (the-as art-joint-anim #f) (the-as art-joint-anim (-> self draw art-group data 4)) (the-as (function process-drawable symbol) false-func) ) (ja-channel-set! 1) - (let ((v1-39 (-> self skel root-channel 0))) - (set! (-> v1-39 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) + (ja :group! (-> self draw art-group data 4)) (if (handle->process (the-as int gp-2)) (deactivate (-> gp-2 process 0)) ) @@ -727,13 +597,11 @@ (go happy-plant-opened) (none) ) - :post - (the-as (function none :behavior happy-plant) transform-post) + :post (the-as (function none :behavior happy-plant) transform-post) ) (defstate happy-plant-init (happy-plant) - :trans - (behavior () + :trans (behavior () (when (-> self alt-actor) (spool-push *art-control* "happy-plant-open" 0 self -99.0) (let* ((gp-0 (-> self alt-actor extra process)) @@ -751,49 +619,18 @@ ) (none) ) - :code - (behavior () + :code (behavior () (clear-collide-with-as (-> self root-override)) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-1 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior happy-plant) ja-post) + :post (the-as (function none :behavior happy-plant) ja-post) ) (defmethod init-from-entity! happy-plant ((obj happy-plant) (arg0 entity-actor)) @@ -869,16 +706,14 @@ (set! (-> arg0 digit 2) (the int f0-3)) (let ((f0-4 (- f0-3 (the float (-> arg0 digit 2))))) (set! (-> arg0 digit 3) (the int (* 10.0 f0-4))) - (let* ((f0-5 (- f0-4 (* 0.1 (the float (-> arg0 digit 3))))) - (v0-0 (the int (* 100.0 f0-5))) - ) - (set! (-> arg0 digit 4) v0-0) - v0-0 + (let ((f0-5 (- f0-4 (* 0.1 (the float (-> arg0 digit 3)))))) + (set! (-> arg0 digit 4) (the int (* 100.0 f0-5))) ) ) ) ) ) + (none) ) (defun race-time->seconds ((arg0 race-time)) @@ -908,41 +743,35 @@ #f ) -(defun race-time-save ((arg0 race-time) (arg1 int) (arg2 task-control)) - (dotimes (s3-0 5) - (save-reminder arg2 (-> arg0 digit s3-0) (+ arg1 s3-0)) +(defun race-time-save ((arg0 race-time) (arg1 task-control)) + (dotimes (s4-0 5) + (save-reminder arg1 (-> arg0 digit s4-0) s4-0) ) #f ) -(defun race-time-read ((arg0 race-time) (arg1 int) (arg2 task-control) (arg3 time-frame)) - (dotimes (s2-0 5) - (set! (-> arg0 digit s2-0) (get-reminder arg2 (+ arg1 s2-0))) +(defun race-time-read ((arg0 race-time) (arg1 task-control) (arg2 time-frame)) + (dotimes (s3-0 5) + (set! (-> arg0 digit s3-0) (get-reminder arg1 s3-0)) ) (let ((a1-3 (new 'stack 'race-time))) (set! (-> a1-3 digit 4) 1) - (the-as symbol (if (race-time-less-than arg0 a1-3) - (seconds->race-time arg0 arg3) - ) - ) + (if (race-time-less-than arg0 a1-3) + (seconds->race-time arg0 arg2) + ) ) + (none) ) -(defskelgroup *rolling-start-whole-sg* rolling-start - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *rolling-start-whole-sg* rolling-start rolling-start-whole-lod0-jg rolling-start-idle-ja + ((rolling-start-whole-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) -(defskelgroup *rolling-start-broken-sg* rolling-start - 2 - 4 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *rolling-start-broken-sg* rolling-start rolling-start-broken-lod0-jg rolling-start-idle-ja + ((rolling-start-broken-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) (deftype rolling-start (process-drawable) ((whole-look lod-set :inline :offset-assert 176) @@ -960,68 +789,30 @@ (defstate rolling-start-break (rolling-start) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('unbreak) (go rolling-start-whole) ) ) ) - :code - (behavior ((arg0 symbol)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior ((arg0 symbol)) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (lods-assign! (-> self draw) (-> self broken-look)) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (if arg0 (deactivate self) @@ -1029,16 +820,14 @@ ) (none) ) - :post - (the-as (function none :behavior rolling-start) ja-post) + :post (the-as (function none :behavior rolling-start) ja-post) ) (defstate rolling-start-whole (rolling-start) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('break) - (sound-play-by-name (static-sound-name "cool-rolling-st") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cool-rolling-st") (go rolling-start-break #f) ) (('break-and-die) @@ -1046,32 +835,18 @@ ) ) ) - :code - (behavior () + :code (behavior () (lods-assign! (-> self draw) (-> self whole-look)) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior rolling-start) ja-post) + :post (the-as (function none :behavior rolling-start) ja-post) ) (defbehavior rolling-start-init-by-other rolling-start ((arg0 vector) (arg1 float)) @@ -1198,11 +973,9 @@ ) (defstate gorge-abort-idle (gorge-abort) - :trans - (the-as (function none :behavior gorge-abort) gorge-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior gorge-abort) gorge-trans) + :code (behavior () + (loop (suspend) (if (gorge-behind self) (send-event (ppointer->process (-> self parent)) 'aborted) @@ -1221,11 +994,9 @@ ) (defstate gorge-finish-idle (gorge-finish) - :trans - (the-as (function none :behavior gorge-finish) gorge-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior gorge-finish) gorge-trans) + :code (behavior () + (loop (suspend) (if (gorge-in-front self) (send-event (ppointer->process (-> self parent)) 'finished) @@ -1351,7 +1122,7 @@ *entity-pool* (game-task none) ) - (race-time-save (-> self this-time) 1 (-> self tasks)) + (race-time-save (-> self this-time) (-> self tasks)) ) ) (else @@ -1377,48 +1148,31 @@ ) (defbehavior gorge-start-launch-start-banner gorge-start () - (the-as - handle - (when (task-closed? (game-task rolling-race) (task-status need-introduction)) - (when (not (handle->process (-> self start-banner))) - (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) - (let* ((s5-0 (get-process *default-dead-pool* rolling-start #x4000)) - (v0-1 - (ppointer->handle (when s5-0 - (let ((t9-2 (method-of-type rolling-start activate))) - (t9-2 (the-as rolling-start s5-0) self 'rolling-start (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 rolling-start-init-by-other gp-0 0.0) - (-> s5-0 ppointer) - ) - ) + (the-as handle (when (task-closed? (game-task rolling-race) (task-status need-introduction)) + (when (not (handle->process (-> self start-banner))) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root-override trans quad)) + (let ((v0-1 (ppointer->handle (process-spawn rolling-start gp-0 0.0 :to self)))) + (set! (-> self start-banner) (the-as handle v0-1)) + v0-1 + ) + ) + ) ) - ) - (set! (-> self start-banner) (the-as handle v0-1)) - v0-1 - ) ) - ) - ) - ) ) (defstate gorge-start-race-finished (gorge-start) - :trans - (behavior () + :trans (behavior () (gorge-trans) (none) ) - :code - (behavior () + :code (behavior () (gorge-start-draw-time #t #t) (suspend) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) - (set! (-> self timer-pos-offset) - (seekl (-> self timer-pos-offset) 100 (the int (* 3.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self timer-pos-offset) 100 (the int (* 3.0 (-> *display* time-adjust-ratio)))) (when (= (-> self timer-pos-offset) 100) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) (send-event (ppointer->process (-> *hud-parts* money)) 'enable) @@ -1435,18 +1189,14 @@ ) (defstate gorge-start-race-aborted (gorge-start) - :trans - (behavior () + :trans (behavior () (gorge-trans) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) - (set! (-> self timer-pos-offset) - (seekl (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) (when (= (-> self timer-pos-offset) 100) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) (send-event (ppointer->process (-> *hud-parts* money)) 'enable) @@ -1494,8 +1244,7 @@ ) (defstate gorge-start-racing (gorge-start) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('finished) (go gorge-start-race-finished) @@ -1505,112 +1254,58 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (send-event (handle->process (-> self start-banner)) 'break) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'disable) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'hide) (send-event (ppointer->process (-> *hud-parts* money)) 'disable) (send-event (ppointer->process (-> *hud-parts* money)) 'hide) - (race-time-read (-> self record-time) 1 (-> self tasks) (seconds 45)) - (let ((gp-0 (get-process *default-dead-pool* rolling-start #x4000))) - (set! (-> self end-banner) - (ppointer->handle (when gp-0 - (let ((t9-7 (method-of-type rolling-start activate))) - (t9-7 (the-as rolling-start gp-0) self 'rolling-start (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - rolling-start-init-by-other - (new 'static 'vector :x -86016.0 :y 112640.0 :z -6309888.0) - 16384.0 - ) - (-> gp-0 ppointer) - ) - ) + (race-time-read (-> self record-time) (-> self tasks) (seconds 45)) + (set! (-> self end-banner) + (ppointer->handle + (process-spawn rolling-start (new 'static 'vector :x -86016.0 :y 112640.0 :z -6309888.0) 16384.0 :to self) ) + ) + (process-spawn + gorge-finish + (new 'static 'vector :x -86016.0 :y 114688.0 :z -6303744.0) + (new 'static 'vector :x -1.0) + 57344.0 + :to self ) - (let ((gp-1 (get-process *default-dead-pool* gorge-finish #x4000))) - (when gp-1 - (let ((t9-10 (method-of-type gorge-finish activate))) - (t9-10 (the-as gorge-finish gp-1) self 'gorge-finish (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - gorge-finish-init-by-other - (new 'static 'vector :x -86016.0 :y 114688.0 :z -6303744.0) - (new 'static 'vector :x -1.0) - 57344.0 - ) - (-> gp-1 ppointer) - ) + (process-spawn + gorge-abort + (new 'static 'vector :x -696320.0 :y 122880.0 :z -6828032.0) + (new 'static 'vector :x -0.707 :y 0.707) + 163840.0 + :to self ) - (let ((gp-2 (get-process *default-dead-pool* gorge-abort #x4000))) - (when gp-2 - (let ((t9-13 (method-of-type gorge-abort activate))) - (t9-13 (the-as gorge-abort gp-2) self 'gorge-abort (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - gorge-abort-init-by-other - (new 'static 'vector :x -696320.0 :y 122880.0 :z -6828032.0) - (new 'static 'vector :x -0.707 :y 0.707) - 163840.0 - ) - (-> gp-2 ppointer) - ) + (process-spawn + gorge-abort + (new 'static 'vector :x -847872.0 :y 143360.0 :z -6828032.0) + (new 'static 'vector :x 0.707 :y 0.707) + 163840.0 + :to self ) - (let ((gp-3 (get-process *default-dead-pool* gorge-abort #x4000))) - (when gp-3 - (let ((t9-16 (method-of-type gorge-abort activate))) - (t9-16 (the-as gorge-abort gp-3) self 'gorge-abort (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-3 - gorge-abort-init-by-other - (new 'static 'vector :x -847872.0 :y 143360.0 :z -6828032.0) - (new 'static 'vector :x 0.707 :y 0.707) - 163840.0 - ) - (-> gp-3 ppointer) - ) + (process-spawn + gorge-abort + (new 'static 'vector :x -417792.0 :y 143360.0 :z -6004736.0) + (new 'static 'vector :x -0.5 :y 0.707 :z 0.3) + 266240.0 + :to self ) - (let ((gp-4 (get-process *default-dead-pool* gorge-abort #x4000))) - (when gp-4 - (let ((t9-19 (method-of-type gorge-abort activate))) - (t9-19 (the-as gorge-abort gp-4) self 'gorge-abort (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-4 - gorge-abort-init-by-other - (new 'static 'vector :x -417792.0 :y 143360.0 :z -6004736.0) - (new 'static 'vector :x -0.5 :y 0.707 :z 0.3) - 266240.0 - ) - (-> gp-4 ppointer) - ) - ) - (let ((gp-5 (get-process *default-dead-pool* gorge-abort #x4000))) - (when gp-5 - (let ((t9-22 (method-of-type gorge-abort activate))) - (t9-22 (the-as gorge-abort gp-5) self 'gorge-abort (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-5 - gorge-abort-init-by-other - (new 'static 'vector :x -647168.0 :y 143360.0 :z -6025216.0) - (new 'static 'vector :x 0.5 :y 0.707 :z -0.3) - 163840.0 - ) - (-> gp-5 ppointer) - ) + (process-spawn + gorge-abort + (new 'static 'vector :x -647168.0 :y 143360.0 :z -6025216.0) + (new 'static 'vector :x 0.5 :y 0.707 :z -0.3) + 163840.0 + :to self ) (sleep (-> self ticker) (seconds 6000)) - (set-setting! *setting-control* self 'sound-flava #f 40.0 42) + (set-setting! 'sound-flava #f 40.0 (music-flava rolling-gorge)) (none) ) - :exit - (behavior () + :exit (behavior () (let* ((v1-0 (-> self child)) (gp-0 (-> v1-0 0 brother)) ) @@ -1624,19 +1319,15 @@ ) (send-event (handle->process (-> self end-banner)) 'break-and-die) (send-event (handle->process (-> self start-banner)) 'unbreak) - (clear-pending-settings-from-process *setting-control* self 'sound-flava) + (remove-setting! 'sound-flava) (none) ) - :trans - (the-as (function none :behavior gorge-start) gorge-trans) - :code - (behavior () + :trans (the-as (function none :behavior gorge-start) gorge-trans) + :code (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (while #t + (loop (seconds->race-time (-> self this-time) (- (-> *display* game-frame-counter) (-> self state-time))) - (set! (-> self timer-pos-offset) - (seekl (-> self timer-pos-offset) 0 (the int (* 5.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self timer-pos-offset) 0 (the int (* 5.0 (-> *display* time-adjust-ratio)))) (completed? (-> self ticker)) (gorge-start-draw-time #f #f) (suspend) @@ -1649,15 +1340,11 @@ ) (defstate gorge-start-ready (gorge-start) - :trans - (the-as (function none :behavior gorge-start) gorge-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior gorge-start) gorge-trans) + :code (behavior () + (loop (suspend) - (set! (-> self timer-pos-offset) - (seekl (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) (when (= (-> self timer-pos-offset) 100) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) (send-event (ppointer->process (-> *hud-parts* money)) 'enable) @@ -1679,31 +1366,25 @@ ) (defstate gorge-start-idle (gorge-start) - :enter - (behavior () + :enter (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) (none) ) - :trans - (behavior () + :trans (behavior () (gorge-start-launch-start-banner) (gorge-trans) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) - (set! (-> self timer-pos-offset) - (seekl (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) (when (= (-> self timer-pos-offset) 100) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) (send-event (ppointer->process (-> *hud-parts* money)) 'enable) @@ -1741,14 +1422,12 @@ ) -(define - ripple-for-rolling-water +(define ripple-for-rolling-water (the-as object (new 'static 'ripple-wave-set :count 3 :converted #f :normal-scale 1.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 40.0 :xdiv -1 :zdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75) @@ -1770,7 +1449,7 @@ (set! (-> v1-2 far-fade-dist) 245760.0) (set! (-> v1-2 waveform) (the-as ripple-wave-set ripple-for-rolling-water)) ) - (set! (-> obj flags) (logand -8388609 (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt23)) (none) ) diff --git a/goal_src/levels/rolling/rolling-race-ring.gc b/goal_src/levels/rolling/rolling-race-ring.gc index 119656200b..6e34fb32cf 100644 --- a/goal_src/levels/rolling/rolling-race-ring.gc +++ b/goal_src/levels/rolling/rolling-race-ring.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/race-ring-ag.gc") + (deftype race-ring (process-drawable) ((rot-y float :offset-assert 176) (face-vec vector :inline :offset-assert 192) @@ -34,8 +36,7 @@ :id 457 :linger-duration 0 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1773 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 1773 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1774 :fade-after (meters 80)) (sp-item 1775 :flags (is-3d)) (sp-item 1776 :flags (is-3d)) @@ -43,8 +44,7 @@ ) (defpart 1773 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 2.0 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -64,8 +64,7 @@ ) (defpart 1774 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -85,8 +84,7 @@ ) (defpart 1775 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 10)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -104,8 +102,7 @@ ) (defpart 1776 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 12)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -126,16 +123,14 @@ :duration 5 :linger-duration 141 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1777 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 1777 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1778 :flags (is-3d)) (sp-item 1779 :flags (is-3d)) ) ) (defpart 1777 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -157,8 +152,7 @@ ) (defpart 1780 - :init-specs - ((sp-rnd-int spt-r 1115684864 1 64.0) + :init-specs ((sp-rnd-int spt-r 1115684864 1 64.0) (sp-flt spt-g 0.0) (sp-rnd-int spt-b 1115684864 1 64.0) (sp-rnd-int spt-a 0 63 1.0) @@ -168,8 +162,7 @@ ) (defpart 1778 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -190,8 +183,7 @@ ) (defpart 1781 - :init-specs - ((sp-rnd-int spt-r 1124073472 1 127.0) + :init-specs ((sp-rnd-int spt-r 1124073472 1 127.0) (sp-flt spt-g 0.0) (sp-rnd-int spt-b 1124073472 1 127.0) (sp-rnd-flt spt-a 32.0 32.0 1.0) @@ -201,8 +193,7 @@ ) (defpart 1779 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -223,8 +214,7 @@ ) (defpart 1782 - :init-specs - ((sp-rnd-int spt-r 1124073472 1 127.0) + :init-specs ((sp-rnd-int spt-r 1124073472 1 127.0) (sp-flt spt-g 0.0) (sp-rnd-int spt-b 1124073472 1 127.0) (sp-rnd-flt spt-a 32.0 32.0 1.0) @@ -238,13 +228,11 @@ :duration 5 :linger-duration 150 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1783 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1784 :flags (is-3d))) + :parts ((sp-item 1783 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1784 :flags (is-3d))) ) (defpart 1783 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 64.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -266,8 +254,7 @@ ) (defpart 1784 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 10)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -306,8 +293,7 @@ :id 460 :linger-duration 0 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1785 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 1785 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1786 :fade-after (meters 80)) (sp-item 1787 :flags (is-3d)) (sp-item 1788 :flags (is-3d)) @@ -315,8 +301,7 @@ ) (defpart 1785 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 2.0 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -336,8 +321,7 @@ ) (defpart 1786 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -357,8 +341,7 @@ ) (defpart 1787 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 10)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -376,8 +359,7 @@ ) (defpart 1788 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 12)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -398,16 +380,14 @@ :duration 5 :linger-duration 141 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1789 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 1789 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1790 :flags (is-3d)) (sp-item 1791 :flags (is-3d)) ) ) (defpart 1789 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -429,8 +409,7 @@ ) (defpart 1792 - :init-specs - ((sp-flt spt-r 0.0) + :init-specs ((sp-flt spt-r 0.0) (sp-rnd-int spt-g 1115684864 1 64.0) (sp-rnd-int spt-b 1115684864 1 64.0) (sp-rnd-int spt-a 0 63 1.0) @@ -440,8 +419,7 @@ ) (defpart 1790 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -462,8 +440,7 @@ ) (defpart 1793 - :init-specs - ((sp-flt spt-r 0.0) + :init-specs ((sp-flt spt-r 0.0) (sp-rnd-int spt-g 1124073472 1 127.0) (sp-rnd-int spt-b 1124073472 1 127.0) (sp-rnd-flt spt-a 32.0 32.0 1.0) @@ -473,8 +450,7 @@ ) (defpart 1791 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -495,8 +471,7 @@ ) (defpart 1794 - :init-specs - ((sp-flt spt-r 0.0) + :init-specs ((sp-flt spt-r 0.0) (sp-rnd-int spt-g 1124073472 1 127.0) (sp-rnd-int spt-b 1124073472 1 127.0) (sp-rnd-flt spt-a 32.0 32.0 1.0) @@ -510,13 +485,11 @@ :duration 5 :linger-duration 150 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1795 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1796 :flags (is-3d))) + :parts ((sp-item 1795 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1796 :flags (is-3d))) ) (defpart 1795 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 64.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -538,8 +511,7 @@ ) (defpart 1796 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 10)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -574,13 +546,10 @@ (none) ) -(defskelgroup *race-ring-sg* race-ring - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *race-ring-sg* race-ring race-ring-lod0-jg race-ring-race-ring-idle-ja + ((race-ring-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defun first-ring? ((arg0 race-ring)) (not (-> arg0 alt-actor)) @@ -591,8 +560,7 @@ ) (defstate race-ring-active (race-ring) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 symbol)) (let ((v1-0 arg2)) (the-as @@ -601,52 +569,36 @@ (when (and (= (-> arg3 param 0) 'die) (= arg0 (-> self part-track process 0))) (cond ((= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 460) - -1 - race-ring-blue-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 460) + -1 + race-ring-blue-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) (set! v0-0 #t) (set! (-> self keep-part-track-alive) v0-0) ) (else - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 457) - -1 - race-ring-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-1 ppointer) - ) - ) - ) - ) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 457) + -1 + race-ring-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) (set! v0-0 #t) (set! (-> self keep-part-track-alive) v0-0) ) @@ -657,8 +609,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (cond ((first-ring? self) (logior! (-> self mask) (process-mask actor-pause)) @@ -670,115 +621,74 @@ ) ) (set! (-> self keep-part-track-alive) #f) - (cond - ((= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-0 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-0) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 461) - -1 - race-ring-blue-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-0 ppointer) - ) - ) - ) - ) - ) - (else - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-1 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker gp-1) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 458) - -1 - race-ring-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-1 ppointer) - ) - ) - ) - ) + (if (= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 461) + -1 + race-ring-blue-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 458) + -1 + race-ring-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) ) - ) (set! (-> self old-hips quad) (-> (target-pos 26) quad)) (set! (-> self old-hips x) (+ 1.0 (-> self old-hips x))) (set! (-> self state-time) (-> *display* game-frame-counter)) (none) ) - :exit - (behavior () - (sound-play-by-name (static-sound-name "close-racering") (new-sound-id) 1024 0 0 1 #t) + :exit (behavior () + (sound-play "close-racering") (let ((a0-3 (handle->process (-> self part-track)))) (if a0-3 (deactivate a0-3) ) ) - (cond - ((= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 462) - -1 - race-ring-blue-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-1 ppointer) - ) - ) - ) - ) - ) - (else - (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-2 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker gp-2) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - part-tracker-init - (-> *part-group-id-table* 459) - -1 - race-ring-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-2 ppointer) - ) - ) - ) - ) + (if (= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 462) + -1 + race-ring-blue-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 459) + -1 + race-ring-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) ) - ) (cond ((first-ring? self) (logclear! (-> self mask) (process-mask actor-pause)) @@ -791,8 +701,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (nonzero? (-> self sound)) (update! (-> self sound)) ) @@ -803,51 +712,35 @@ ) ) ((= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-0 - (let ((t9-2 (method-of-type part-tracker activate))) - (t9-2 (the-as part-tracker gp-0) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 460) - -1 - race-ring-blue-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 460) + -1 + race-ring-blue-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) (set! (-> self keep-part-track-alive) #t) ) (else - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker gp-1) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 457) - -1 - race-ring-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-1 ppointer) - ) - ) - ) - ) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 457) + -1 + race-ring-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) (set! (-> self keep-part-track-alive) #t) ) ) @@ -863,9 +756,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) (cond ((first-ring? self) @@ -940,29 +832,17 @@ ) ) ((last-ring? self) - (let* ((gp-1 (get-process *default-dead-pool* othercam #x4000)) - (gp-2 (ppointer->handle (when gp-1 - (let ((t9-15 (method-of-type othercam activate))) - (t9-15 (the-as othercam gp-1) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 othercam-init-by-other self 4 #f #t) - (-> gp-1 ppointer) - ) - ) - ) - (s5-1 (get-process *default-dead-pool* fuel-cell #x4000)) - (s5-2 - (ppointer->handle - (when s5-1 - (let ((t9-18 (method-of-type fuel-cell activate))) - (t9-18 (the-as fuel-cell s5-1) self 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 fuel-cell-init-as-clone (process->handle self) (-> self entity extra perm task)) - (-> s5-1 ppointer) - ) - ) - ) - ) + (let ((gp-2 (ppointer->handle (process-spawn othercam self 4 #f #t :to self))) + (s5-2 (ppointer->handle (process-spawn + fuel-cell + :init fuel-cell-init-as-clone + (process->handle self) + (-> self entity extra perm task) + :to self + ) + ) + ) + ) (if *target* (logior! (-> *target* mask) (process-mask sleep)) ) @@ -1028,17 +908,15 @@ ) (none) ) - :post - (the-as (function none :behavior race-ring) ja-post) + :post (the-as (function none :behavior race-ring) ja-post) ) (defstate race-ring-wait (race-ring) - :code - (behavior () + :code (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (while #t + (loop (suspend) (when (= (get-task-status (the-as game-task (-> self alt-task))) (task-status invalid)) (close-specific-task! (-> self entity extra perm task) (task-status need-hint)) @@ -1051,8 +929,7 @@ ) (defstate race-ring-idle (race-ring) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('activate) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1060,12 +937,11 @@ ) ) ) - :code - (behavior () + :code (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (while #t + (loop (suspend) ) (none) @@ -1086,19 +962,8 @@ (set! (-> obj part-track) (the-as handle #f)) (set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) (logior! (-> obj draw status) (draw-status hidden)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "loop-racering") - :volume #x400 - :fo-max 40 - ) - (-> obj root trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "loop-racering" :fo-max 40) (-> obj root trans)) ) (let ((f0-1 (res-lump-float arg0 'timeout))) (set! (-> obj timeout) (the-as time-frame (the int (* 300.0 f0-1)))) diff --git a/goal_src/levels/rolling/rolling-robber.gc b/goal_src/levels/rolling/rolling-robber.gc index 10a518fbc2..46679b3ebb 100644 --- a/goal_src/levels/rolling/rolling-robber.gc +++ b/goal_src/levels/rolling/rolling-robber.gc @@ -4,18 +4,17 @@ ;; name: rolling-robber.gc ;; name in dgo: rolling-robber ;; dgos: L1, ROL +;; note: changed for high fps ;; DECOMP BEGINS +(import "goal_src/import/robber-ag.gc") + (defstate fuel-cell-spline-slider (fuel-cell) - :trans - (the-as (function none :behavior fuel-cell) hide-hud-quick) - :code - (behavior ((arg0 handle) (arg1 float) (arg2 float)) + :trans (the-as (function none :behavior fuel-cell) hide-hud-quick) + :code (behavior ((arg0 handle) (arg1 float) (arg2 float)) (logclear! (-> self mask) (process-mask actor-pause)) - (let ((v1-4 (-> self skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - ) + (ja :group! (-> self draw art-group data 2)) (if *target* (process-grab? *target*) ) @@ -25,10 +24,8 @@ (set! (-> *camera-other-trans* quad) (-> *math-camera* trans quad)) (set! (-> *camera-other-root* quad) (-> *math-camera* trans quad)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t - (dotimes (v1-14 (the int (-> *display* time-adjust-ratio))) - (set! arg2 (* 0.95 arg2)) - ) + (loop + (*! arg2 (- 1.0 (* 0.05 (-> *display* time-adjust-ratio)))) ;; changed for high fps (when (and (< (fabs arg2) 13.653334) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.5))) (if *target* (process-release? *target*) @@ -56,12 +53,9 @@ (forward-down->inv-matrix *camera-other-matrix* s4-0 (new 'static 'vector :y -1.0 :w 1.0)) ) (set! *camera-look-through-other* 2) - (set-letterbox-frames (seconds 0.033333335)) + (set-letterbox-frames (seconds 0.035)) (suspend) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) 0.5) - (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! 0.5)) ) (none) ) @@ -116,14 +110,11 @@ ) -(defskelgroup *robber-sg* robber - 0 - 10 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *robber-sg* robber robber-lod0-jg robber-idle-hover-ja + ((robber-lod0-mg (meters 20)) (robber-lod1-mg (meters 40)) (robber-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow robber-shadow-mg + ) (defbehavior robber-event-handler robber ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 @@ -164,7 +155,7 @@ (collide-kind background) self t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) (v1-5 (new 'stack-no-clear 'vector)) @@ -300,35 +291,9 @@ ) (defstate robber-debug (robber) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (new 'stack-no-clear 'vector))) @@ -350,22 +315,16 @@ (robber-rotate (the-as target #f) 1820.4445) (robber-find-ground) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robber) ja-post) + :post (the-as (function none :behavior robber) ja-post) ) (defstate robber-dead (robber) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (deactivate self) (none) @@ -373,13 +332,11 @@ ) (defstate robber-die (robber) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior robber) process-drawable-death-event-handler ) - :code - (behavior () + :code (behavior () (let ((gp-0 #t)) (when (robber-task-complete?) (let ((v1-3 (-> self entity extra perm))) @@ -393,21 +350,15 @@ -163840.0 ) ) - (s5-0 (get-process *default-dead-pool* fuel-cell #x4000)) ) - (when s5-0 - (let ((t9-2 (method-of-type fuel-cell activate))) - (t9-2 (the-as fuel-cell s5-0) self 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - fuel-cell-init-as-spline-slider - (process->handle self) - (-> self curve-position) - f30-0 - (-> self entity extra perm task) - ) - (-> s5-0 ppointer) + (process-spawn + fuel-cell + :init fuel-cell-init-as-spline-slider + (process->handle self) + (-> self curve-position) + f30-0 + (-> self entity extra perm task) + :to self ) ) ) @@ -431,25 +382,13 @@ ) ) (when gp-0 - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (robber-calc-speed 4096.0 8192.0 122880.0 122880.0 #f) (robber-move) (robber-rotate (the-as target #f) 1820.4445) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) 1.0) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -459,15 +398,12 @@ (go robber-dead) (none) ) - :post - (the-as (function none :behavior robber) transform-post) + :post (the-as (function none :behavior robber) transform-post) ) (defstate robber-got-away (robber) - :event - robber-event-handler - :trans - (behavior () + :event robber-event-handler + :trans (behavior () (if (and (not (and *target* (>= 204800.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -483,24 +419,13 @@ ) (none) ) - :code - (behavior () - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) + :code (behavior () + (when (not (ja-group? (-> self draw art-group data 7))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 7)) ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 param 0) (robber-calc-anim-speed)) - (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-loop!) - ) + (loop + (ja :num! (loop! (robber-calc-anim-speed))) (if (< 27.306667 (fabs (-> self speed))) (set! (-> self speed) (* 0.95 (-> self speed))) ) @@ -510,25 +435,20 @@ ) (none) ) - :post - (the-as (function none :behavior robber) transform-post) + :post (the-as (function none :behavior robber) transform-post) ) (defstate robber-tired (robber) - :event - robber-event-handler - :enter - (behavior () + :event robber-event-handler + :enter (behavior () (set! (-> self y-offset-desired) -12288.0) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self y-offset-desired) 0.0) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (and *target* (>= 163840.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -537,49 +457,26 @@ ) (none) ) - :code - (behavior () - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) - ) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 param 0) (robber-calc-anim-speed)) - (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-loop!) + :code (behavior () + (loop + (when (not (ja-group? (-> self draw art-group data 7))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 7)) ) + (ja :num! (loop! (robber-calc-anim-speed))) (robber-calc-speed 32768.0 122880.0 122060.8 20480.0 #f) (robber-move) (robber-rotate (the-as target #f) 1820.4445) (suspend) (when (>= (- (-> *display* base-frame-counter) (-> self last-ambient-time)) (-> self time-to-next-ambient)) - (ja-channel-push! 1 60) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-14 param 1) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 11) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (robber-calc-speed 32768.0 122880.0 122060.8 20480.0 #f) (robber-move) (robber-rotate (the-as target #f) 1820.4445) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self last-ambient-time) (-> *display* base-frame-counter)) (let* ((f30-0 300.0) @@ -596,22 +493,18 @@ ) (none) ) - :post - (the-as (function none :behavior robber) transform-post) + :post (the-as (function none :behavior robber) transform-post) ) (defstate robber-flee (robber) - :event - robber-event-handler - :enter - (behavior () + :event robber-event-handler + :enter (behavior () (set! (-> self near-timer) 3000) (set! (-> self far-time) (-> *display* base-frame-counter)) (set! (-> self y-offset-desired) 0.0) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (and *target* (>= 163840.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -635,49 +528,26 @@ ) (none) ) - :code - (behavior () - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) - ) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 param 0) (robber-calc-anim-speed)) - (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-loop!) + :code (behavior () + (loop + (when (not (ja-group? (-> self draw art-group data 7))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 7)) ) + (ja :num! (loop! (robber-calc-anim-speed))) (robber-calc-speed 61440.0 122880.0 204800.0 16384.0 #t) (robber-move) (robber-rotate (the-as target #f) 1820.4445) (suspend) (when (>= (- (-> *display* base-frame-counter) (-> self last-ambient-time)) (-> self time-to-next-ambient)) - (ja-channel-push! 1 60) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-14 param 1) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 11) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (robber-calc-speed 61440.0 122880.0 204800.0 16384.0 #t) (robber-move) (robber-rotate (the-as target #f) 1820.4445) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self last-ambient-time) (-> *display* base-frame-counter)) (let* ((f30-0 300.0) @@ -694,20 +564,16 @@ ) (none) ) - :post - (the-as (function none :behavior robber) transform-post) + :post (the-as (function none :behavior robber) transform-post) ) (defstate robber-idle (robber) - :event - robber-event-handler - :enter - (behavior () + :event robber-event-handler + :enter (behavior () (set! (-> self speed) 0.0) (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -717,39 +583,23 @@ (robber-move) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (loop + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robber) transform-post) + :post (the-as (function none :behavior robber) transform-post) ) (defstate robber-initial-notice (robber) - :event - robber-event-handler - :trans - (behavior () + :event robber-event-handler + :trans (behavior () (when (logtest? (-> self draw status) (draw-status was-drawn)) (if (and *target* (>= 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) @@ -770,8 +620,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (TODO-RENAME-14 (-> self path) (-> self tangent) (-> self curve-position)) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root-override trans) (target-pos 0))) (f0-1 6.826667) @@ -782,45 +631,29 @@ ) (set! (-> self speed) f0-1) ) - (ja-channel-push! 1 60) - (while #t - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 2.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (loop + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek! max 2.0) :frame-num 0.0) (until (ja-done? 0) (robber-calc-speed 61440.0 122880.0 2048.0 2048.0 #t) (robber-rotate (the-as target #f) 1820.4445) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 2.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 2.0)) ) (go robber-flee) ) (none) ) - :post - (the-as (function none :behavior robber) transform-post) + :post (the-as (function none :behavior robber) transform-post) ) (defstate robber-initial (robber) - :event - robber-event-handler - :enter - (behavior () + :event robber-event-handler + :enter (behavior () (set! (-> self speed) 0.0) (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -829,32 +662,18 @@ (robber-move) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (loop + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robber) transform-post) + :post (the-as (function none :behavior robber) transform-post) ) (defmethod init-from-entity! robber ((obj robber) (arg0 entity-actor)) diff --git a/goal_src/levels/snow/ice-cube.gc b/goal_src/levels/snow/ice-cube.gc index 323db37e3c..f4717ff782 100644 --- a/goal_src/levels/snow/ice-cube.gc +++ b/goal_src/levels/snow/ice-cube.gc @@ -7,13 +7,13 @@ ;; DECOMP BEGINS -(defskelgroup *ice-cube-break-sg* ice-cube-break - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 -15 0 50) - :longest-edge (meters 0) - ) +(import "goal_src/import/ice-cube-ag.gc") +(import "goal_src/import/ice-cube-break-ag.gc") + +(defskelgroup *ice-cube-break-sg* ice-cube-break ice-cube-break-lod0-jg -1 + ((ice-cube-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -15 0 50) + ) (deftype ice-cube (nav-enemy) ((part2 sparticle-launch-control :offset-assert 400) @@ -57,14 +57,11 @@ ) -(defskelgroup *ice-cube-sg* ice-cube - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 3 0 3.6) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *ice-cube-sg* ice-cube ice-cube-lod0-jg -1 + ((ice-cube-lod0-mg (meters 20)) (ice-cube-lod1-mg (meters 40)) (ice-cube-lod2-mg (meters 999999))) + :bounds (static-spherem 0 3 0 3.6) + :shadow ice-cube-shadow-mg + ) (define *ice-cube-nav-enemy-info* (new 'static 'nav-enemy-info :idle-anim 5 @@ -114,7 +111,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -124,15 +121,13 @@ :id 507 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 1887 :fade-after (meters 70) :falloff-to (meters 70)) + :parts ((sp-item 1887 :fade-after (meters 70) :falloff-to (meters 70)) (sp-item 1888 :fade-after (meters 70) :falloff-to (meters 70)) ) ) (defpart 1888 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) @@ -156,8 +151,7 @@ ) (defpart 1887 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) @@ -187,13 +181,11 @@ :id 508 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 1889 :fade-after (meters 70) :falloff-to (meters 70))) + :parts ((sp-item 1889 :fade-after (meters 70) :falloff-to (meters 70))) ) (defpart 1889 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -219,13 +211,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2325) (sp-item 2326) (sp-item 2327)) + :parts ((sp-item 2325) (sp-item 2326) (sp-item 2327)) ) (defpart 2325 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -249,8 +239,7 @@ ) (defpart 2326 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -274,8 +263,7 @@ ) (defpart 2327 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -301,13 +289,11 @@ :id 509 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 1890) (sp-item 1891) (sp-item 1892)) + :parts ((sp-item 1890) (sp-item 1891) (sp-item 1892)) ) (defpart 1892 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 64.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 0.24) (meters 0.24) 1.0) @@ -328,8 +314,7 @@ ) (defpart 1891 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters 1)) @@ -356,8 +341,7 @@ ) (defpart 1890 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters 1)) @@ -395,14 +379,7 @@ (cond ((and (= (-> arg0 type) target) (= (-> self cprims-type) 2) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'powerup)) - (set! (-> a1-1 param 1) (the-as uint 2)) - (not (send-event-function *target* a1-1)) - ) + (not (send-event *target* 'query 'powerup (pickup-type eco-red))) ) (when (and (cond ((= (-> arg0 type) target) @@ -427,7 +404,7 @@ (= (-> arg0 type) target) ) (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) 256) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (level-hint-spawn (game-text-id ice-cube-hint) "sksp0350" (the-as entity #f) *entity-pool* (game-task none)) ) ) @@ -462,24 +439,14 @@ ) (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) ;; NOTE fixed decompiler bug - (set! (-> self nav-enemy-flags) (logior (-> self nav-enemy-flags) 256)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) ) ) ((= v1-0 'touched) (when (!= (-> arg0 type) target) (cond ((= (-> arg0 type) target) - (let ((a1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-9 from) self) - (set! (-> a1-9 num-params) 2) - (set! (-> a1-9 message) 'attack) - (set! (-> a1-9 param 0) (-> arg3 param 0)) - (let ((v1-49 (new 'static 'attack-info :mask #x20))) - (set! (-> v1-49 mode) #f) - (set! (-> a1-9 param 1) (the-as uint v1-49)) - ) - (send-event-function arg0 a1-9) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode #f)))) ) (else (let ((a1-10 (new 'stack-no-clear 'event-message-block))) @@ -596,7 +563,7 @@ ) (defmethod TODO-RENAME-48 ice-cube ((obj ice-cube)) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (initialize-skeleton obj *ice-cube-sg* '()) (TODO-RENAME-45 obj *ice-cube-nav-enemy-info*) (set! (-> obj neck up) (the-as uint 0)) @@ -689,7 +656,7 @@ (collide-kind background) (-> obj collide-info process) s4-0 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -753,7 +720,7 @@ (collide-kind background) obj s3-1 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -781,22 +748,19 @@ ) (defstate ice-cube-trying-to-appear (ice-cube) - :enter - (behavior () + :enter (behavior () (ja-channel-set! 0) (ja-post) (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self collide-info)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self collide-info)) (none) ) - :trans - (behavior () + :trans (behavior () (when (and *target* (>= 163840.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) @@ -811,8 +775,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -821,10 +784,8 @@ ) (defstate ice-cube-appear (ice-cube) - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (dummy-57 self) (set! (-> self ground-y) (-> self collide-info trans y)) (spawn (-> self part) (-> self collide-info trans)) @@ -834,8 +795,7 @@ (set! (-> self collide-info transv y) (rand-vu-float-range 102400.0 114688.0)) (none) ) - :trans - (behavior () + :trans (behavior () (when (and (< (-> self collide-info trans y) (-> self ground-y)) (< (-> self collide-info transv y) 0.0)) (set! (-> self collide-info trans y) (-> self ground-y)) (set! (-> self collide-info transv quad) (-> *null-vector* quad)) @@ -850,63 +810,35 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! ice-cube-appear-jump-up-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior ice-cube) nav-enemy-falling-post) + :post (the-as (function none :behavior ice-cube) nav-enemy-falling-post) ) (defstate ice-cube-appear-land (ice-cube) - :event - ice-cube-default-event-handler - :code - (behavior () + :event ice-cube-default-event-handler + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (-> self node-list data 29)) (spawn (-> self part4) gp-0) (vector<-cspace! gp-0 (-> self node-list data 25)) (spawn (-> self part4) gp-0) ) - (ja-channel-push! 1 30) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ice-cube-appear-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (if (TODO-RENAME-46 self (-> self nav-info notice-distance)) (go ice-cube-become-mean) @@ -914,16 +846,13 @@ ) (none) ) - :post - (the-as (function none :behavior ice-cube) ja-post) + :post (the-as (function none :behavior ice-cube) ja-post) ) (defstate nav-enemy-idle (ice-cube) :virtual #t - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (let ((t9-0 (-> (method-of-type nav-enemy nav-enemy-idle) enter))) (if t9-0 (t9-0) @@ -937,10 +866,8 @@ (defstate nav-enemy-patrol (ice-cube) :virtual #t - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (let ((t9-0 (-> (method-of-type nav-enemy nav-enemy-patrol) enter))) (if t9-0 (t9-0) @@ -950,9 +877,8 @@ (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-patrol) code))) (if t9-1 ((the-as (function none) t9-1)) @@ -964,35 +890,30 @@ (defstate nav-enemy-notice (ice-cube) :virtual #t - :enter - (the-as (function none :behavior ice-cube) #f) - :exit - (the-as (function none :behavior ice-cube) #f) - :trans - (the-as (function none :behavior ice-cube) #f) - :code - (behavior () + :enter (the-as (function none :behavior ice-cube) #f) + :exit (the-as (function none :behavior ice-cube) #f) + :trans (the-as (function none :behavior ice-cube) #f) + :code (behavior () (dummy-57 self) - (set! (-> self nav-enemy-flags) (logand -3 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (logclear! (-> self mask) (process-mask actor-pause)) (go ice-cube-face-player) (none) ) - :post - (the-as (function none :behavior ice-cube) #f) + :post (the-as (function none :behavior ice-cube) #f) ) (defstate ice-cube-face-player (ice-cube) - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (dummy-57 self) (logclear! (-> self mask) (process-mask actor-pause)) (if (or (not *target*) - (logtest? (-> *target* state-flags) #x80f8) + (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) (not (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos))) ) (go-virtual nav-enemy-patrol) @@ -1003,19 +924,10 @@ (set-vector! (-> self collide-info transv) 0.0 114688.0 0.0 1.0) (none) ) - :code - (behavior () + :code (behavior () (local-vars (gp-0 symbol)) - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! ice-cube-appear-jump-up-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f30-0 (-> self collide-info transv y))) (integrate-for-enemy-with-move-to-ground! @@ -1033,19 +945,20 @@ ) (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) (let* ((v1-26 (>= 0.0 (-> self collide-info transv y))) - (v1-27 (and v1-26 (logtest? (-> self collide-info status) 1))) + (v1-27 (and v1-26 (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)))) ) (set! gp-0 (dummy-60 self (not v1-27))) ) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (let ((s5-0 (and (>= 0.0 (-> self collide-info transv y)) (logtest? (-> self collide-info status) 1)))) + (loop + (let ((s5-0 + (and (>= 0.0 (-> self collide-info transv y)) + (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)) + ) + ) + ) (set! gp-0 (and s5-0 gp-0)) (if gp-0 (goto cfg-26) @@ -1071,71 +984,42 @@ (vector<-cspace! gp-1 (-> self node-list data 25)) (spawn (-> self part4) gp-1) ) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! ice-cube-appear-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ice-cube-become-mean) (none) ) - :post - (the-as (function none :behavior ice-cube) nav-enemy-simple-post) + :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) (defstate ice-cube-become-mean (ice-cube) - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (set! (-> self draw force-lod) 0) (logclear! (-> self mask) (process-mask actor-pause)) (dummy-57 self) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (let ((gp-0 #f)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! ice-cube-extend-spikes-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (not gp-0) (>= (ja-aframe-num 0) 8.0)) (set! gp-0 #t) (dummy-58 self) ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (go ice-cube-mean-turn-to-charge) (none) ) - :post - (the-as (function none :behavior ice-cube) nav-enemy-simple-post) + :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) (defmethod dummy-54 ice-cube ((obj ice-cube) (arg0 vector)) @@ -1158,15 +1042,15 @@ ) (defstate ice-cube-mean-turn-to-charge (ice-cube) - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (dummy-58 self) (if (or (not *target*) - (logtest? (-> *target* state-flags) #x80f8) + (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) (not (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos))) ) (go ice-cube-retract-spikes) @@ -1177,19 +1061,10 @@ (set-vector! (-> self collide-info transv) 0.0 114688.0 0.0 1.0) (none) ) - :code - (behavior () + :code (behavior () (local-vars (gp-0 symbol)) - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! ice-cube-turn-on-player-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f30-0 (-> self collide-info transv y))) (integrate-for-enemy-with-move-to-ground! @@ -1207,19 +1082,20 @@ ) (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) (let* ((v1-26 (>= 0.0 (-> self collide-info transv y))) - (v1-27 (and v1-26 (logtest? (-> self collide-info status) 1))) + (v1-27 (and v1-26 (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)))) ) (set! gp-0 (dummy-60 self (not v1-27))) ) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (let ((s5-0 (and (>= 0.0 (-> self collide-info transv y)) (logtest? (-> self collide-info status) 1)))) + (loop + (let ((s5-0 + (and (>= 0.0 (-> self collide-info transv y)) + (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)) + ) + ) + ) (set! gp-0 (and s5-0 gp-0)) (if gp-0 (goto cfg-26) @@ -1245,41 +1121,28 @@ (vector<-cspace! gp-1 (-> self node-list data 25)) (spawn (-> self part4) gp-1) ) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! ice-cube-turn-on-player-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ice-cube-mean-charge) (none) ) - :post - (the-as (function none :behavior ice-cube) nav-enemy-simple-post) + :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) (defstate ice-cube-mean-charge (ice-cube) - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (dummy-58 self) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (set! (-> self next-skid-sound-time) (-> *display* base-frame-counter)) (if (or (not *target*) - (logtest? (-> *target* state-flags) #x80f8) + (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) (not (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos))) ) (go ice-cube-retract-spikes) @@ -1288,7 +1151,7 @@ (set! (-> self acceleration) (-> self nav-info run-acceleration)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) - (logclear! (-> self nav flags) (nav-control-flags bit8)) + (logclear! (-> self nav flags) (nav-control-flags navcf8)) (set-root-prim-collide-with! (-> self collide-info) (collide-kind cak-2 cak-3 target crate enemy)) (set! (-> self track-target?) #t) (set! (-> self slow-down?) #f) @@ -1300,15 +1163,13 @@ (set! (-> self charge-angle) (quaternion-y-angle (-> self collide-info quat))) (none) ) - :exit - (behavior () - (logior! (-> self nav flags) (nav-control-flags bit8)) + :exit (behavior () + (logior! (-> self nav flags) (nav-control-flags navcf8)) (set-root-prim-collide-with! (-> self collide-info) (collide-kind target)) (none) ) - :trans - (behavior () - (when (or (not *target*) (logtest? (-> *target* state-flags) 128)) + :trans (behavior () + (when (or (not *target*) (logtest? (-> *target* state-flags) (state-flags do-not-notice))) (cond ((= (-> self speed) 0.0) (go ice-cube-mean-charge-done) @@ -1380,15 +1241,7 @@ ) (when (>= (-> *display* base-frame-counter) (-> self next-skid-sound-time)) (set! (-> self next-skid-sound-time) (+ (-> *display* base-frame-counter) (nav-enemy-rnd-int-range 60 120))) - (sound-play-by-name - (static-sound-name "ice-stop") - (new-sound-id) - (the int (* 10.24 (the float (the int (* 0.0012207031 (-> self speed)))))) - 0 - 0 - 1 - #t - ) + (sound-play "ice-stop" :vol (the float (the int (* 0.0012207031 (-> self speed))))) ) ) (let ((f30-1 (* (vector-xz-length (-> self nav travel)) (-> *display* frames-per-second)))) @@ -1420,66 +1273,29 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 12)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! ice-cube-invuln-run-ja :num! min) (until (-> self slow-down?) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) - (ja-channel-push! 2 21) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 17)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) - (let ((a0-5 (-> self skel root-channel 1))) - (set! (-> a0-5 frame-interp) (-> self anim-blend)) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> a0-5 param 0) 0.0) - (joint-control-channel-group-eval! - a0-5 - (the-as art-joint-anim (-> self draw art-group data 13)) - num-func-chan - ) - ) - (while #t + (ja-channel-push! 2 (seconds 0.07)) + (ja :group! ice-cube-invuln-stopping-upright-ja :num! min) + (ja :chan 1 :group! ice-cube-invuln-stopping-ja :num! (chan 0) :frame-interp (-> self anim-blend)) + (loop (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((a0-7 (-> self skel root-channel 1))) - (set! (-> a0-7 frame-interp) (-> self anim-blend)) - (set! (-> a0-7 param 0) 0.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (loop!)) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self anim-blend)) ) (none) ) - :post - (the-as (function none :behavior ice-cube) nav-enemy-simple-post) + :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) (defstate ice-cube-mean-charge-done (ice-cube) - :event - ice-cube-default-event-handler - :code - (behavior () + :event ice-cube-default-event-handler + :code (behavior () (dummy-58 self) (nav-enemy-neck-control-inactive) (go ice-cube-retract-spikes) @@ -1488,53 +1304,35 @@ ) (defstate ice-cube-retract-spikes (ice-cube) - :event - ice-cube-default-event-handler - :code - (behavior () + :event ice-cube-default-event-handler + :code (behavior () (dummy-58 self) (nav-enemy-neck-control-inactive) - (ja-channel-push! 1 21) + (ja-channel-push! 1 (seconds 0.07)) (let ((gp-0 #f)) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 14))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 14)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 14)) num-func-seek!) - ) + (ja-no-eval :group! ice-cube-retract-spikes-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (not gp-0) (>= (ja-aframe-num 0) 3.0)) (set! gp-0 #t) (dummy-57 self) ) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (go ice-cube-tired) (none) ) - :post - (the-as (function none :behavior ice-cube) nav-enemy-simple-post) + :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) (defstate ice-cube-tired (ice-cube) - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) (cond ((or (not *target*) (< (-> self enemy-info idle-distance) @@ -1553,55 +1351,28 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! ice-cube-head-wipe-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 60) - (while #t - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 15)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (loop + (ja-no-eval :group! ice-cube-breathing-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior ice-cube) nav-enemy-simple-post) + :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) (defstate ice-cube-shatter (ice-cube) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (-> self node-list data 3)) @@ -1614,53 +1385,41 @@ (set! (-> gp-1 duration) (seconds 3)) (set! (-> gp-1 gravity) -327680.0) (set! (-> gp-1 fountain-rand-transv-lo quad) (-> (target-pos 0) quad)) - (let ((s5-1 (get-process *default-dead-pool* joint-exploder #x4000))) - (when s5-1 - (let ((t9-8 (method-of-type joint-exploder activate))) - (t9-8 (the-as joint-exploder s5-1) self 'joint-exploder (the-as pointer #x70004000)) + (process-spawn + joint-exploder + *ice-cube-break-sg* + 2 + gp-1 + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 28) + (new 'static 'joint-exploder-static-joint-params :joint-index 23) + (new 'static 'joint-exploder-static-joint-params :joint-index 8) + (new 'static 'joint-exploder-static-joint-params :joint-index 7) + (new 'static 'joint-exploder-static-joint-params :joint-index 26) + (new 'static 'joint-exploder-static-joint-params :joint-index 21) + (new 'static 'joint-exploder-static-joint-params :joint-index 24) + (new 'static 'joint-exploder-static-joint-params :joint-index 29) + (new 'static 'joint-exploder-static-joint-params :joint-index 11) + (new 'static 'joint-exploder-static-joint-params :joint-index 4) + (new 'static 'joint-exploder-static-joint-params :joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 15) + (new 'static 'joint-exploder-static-joint-params :joint-index 16) + (new 'static 'joint-exploder-static-joint-params :joint-index 17) + (new 'static 'joint-exploder-static-joint-params :joint-index 18) + (new 'static 'joint-exploder-static-joint-params :joint-index 19) + (new 'static 'joint-exploder-static-joint-params :joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 20) ) - (run-now-in-process - s5-1 - joint-exploder-init-by-other - *ice-cube-break-sg* - 2 - gp-1 - (new 'static 'joint-exploder-static-params - :joints - (new - 'static - 'boxed-array - :type joint-exploder-static-joint-params :length 22 :allocated-length 22 - (new 'static 'joint-exploder-static-joint-params :joint-index 28) - (new 'static 'joint-exploder-static-joint-params :joint-index 23) - (new 'static 'joint-exploder-static-joint-params :joint-index 8) - (new 'static 'joint-exploder-static-joint-params :joint-index 7) - (new 'static 'joint-exploder-static-joint-params :joint-index 26) - (new 'static 'joint-exploder-static-joint-params :joint-index 21) - (new 'static 'joint-exploder-static-joint-params :joint-index 24) - (new 'static 'joint-exploder-static-joint-params :joint-index 29) - (new 'static 'joint-exploder-static-joint-params :joint-index 11) - (new 'static 'joint-exploder-static-joint-params :joint-index 4) - (new 'static 'joint-exploder-static-joint-params :joint-index 6) - (new 'static 'joint-exploder-static-joint-params :joint-index 5) - (new 'static 'joint-exploder-static-joint-params :joint-index 12) - (new 'static 'joint-exploder-static-joint-params :joint-index 13) - (new 'static 'joint-exploder-static-joint-params :joint-index 14) - (new 'static 'joint-exploder-static-joint-params :joint-index 15) - (new 'static 'joint-exploder-static-joint-params :joint-index 16) - (new 'static 'joint-exploder-static-joint-params :joint-index 17) - (new 'static 'joint-exploder-static-joint-params :joint-index 18) - (new 'static 'joint-exploder-static-joint-params :joint-index 19) - (new 'static 'joint-exploder-static-joint-params :joint-index 3) - (new 'static 'joint-exploder-static-joint-params :joint-index 20) - ) - ) - ) - (-> s5-1 ppointer) ) + :to self ) ) - (sound-play-by-name (static-sound-name "ice-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ice-explode") (suspend) (ja-channel-set! 0) (ja-post) diff --git a/goal_src/levels/snow/snow-ball.gc b/goal_src/levels/snow/snow-ball.gc index f5f51492b7..489c9138a5 100644 --- a/goal_src/levels/snow/snow-ball.gc +++ b/goal_src/levels/snow/snow-ball.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/snow-ball-ag.gc") + (deftype snow-ball-shadow (process-drawable) () :heap-base #x40 @@ -93,30 +95,21 @@ ) -(defskelgroup *snow-ball-sg* snow-ball - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *snow-ball-sg* snow-ball snow-ball-lod0-jg snow-ball-idle-ja + ((snow-ball-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) -(defskelgroup *snow-ball-shadow-sg* snow-ball - 3 - -1 - ((4 (meters 999999))) - :bounds (static-spherem 0 -1.5 0 2) - :longest-edge (meters 0) - :shadow 5 - ) +(defskelgroup *snow-ball-shadow-sg* snow-ball snow-ball-shadow-lod0-jg -1 + ((snow-ball-shadow-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -1.5 0 2) + :shadow snow-ball-shadow-shadow-mg + ) -(define - *snow-ball-shadow-control* +(define *snow-ball-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #xa)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 245760.0) + :flags (shadow-flags disable-fade shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 245760.0) :bot-plane (new 'static 'plane :y 1.0 :w 26624.0) :top-plane (new 'static 'plane :y 1.0) :fade-dist 819200.0 @@ -125,23 +118,20 @@ ) (defstate snow-ball-shadow-idle (snow-ball-shadow) - :trans - (behavior () + :trans (behavior () (set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) (update-direction-from-time-of-day (-> self draw shadow-ctrl)) 0 (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior snow-ball-shadow) ja-post) + :post (the-as (function none :behavior snow-ball-shadow) ja-post) ) (defbehavior snow-ball-shadow-init-by-other snow-ball-shadow () @@ -153,14 +143,7 @@ (vector-identity! (-> self root scale)) (initialize-skeleton self *snow-ball-shadow-sg* '()) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! snow-ball-shadow-idle-ja :num! min) (set! (-> self draw shadow-ctrl) *snow-ball-shadow-control*) (go snow-ball-shadow-idle) (none) @@ -217,7 +200,7 @@ (defmethod play-landing-sound snow-ball-roller ((obj snow-ball-roller) (arg0 float)) (let ((f30-0 (* 0.0018780049 (fmin 53248.0 (fmax 0.0 (+ -4096.0 (fabs arg0))))))) - (sound-play-by-name (static-sound-name "snowball-land") (new-sound-id) (the int (* 10.24 f30-0)) 0 0 1 #t) + (sound-play "snowball-land" :vol f30-0) ) ) @@ -307,27 +290,16 @@ (cond ((zero? (-> self rolling-sound-id)) (if (and v1-54 (-> self rolling-sound-enabled?)) - (set! (-> self rolling-sound-id) (sound-play-by-name - (static-sound-name "snowball-roll") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (set! (-> self rolling-sound-id) + (sound-play "snowball-roll" :position (the-as symbol (-> self root-override trans))) ) ) ) ((and v1-54 (-> self rolling-sound-enabled?)) - (sound-play-by-name - (static-sound-name "snowball-roll") - (-> self rolling-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) + (sound-play + "snowball-roll" + :id (-> self rolling-sound-id) + :position (the-as symbol (-> self root-override trans)) ) ) (else @@ -341,74 +313,59 @@ ) (defmethod dummy-22 snow-ball-roller ((obj snow-ball-roller) (arg0 process-drawable)) - (with-pp - (cond - ((< (+ 4096.0 (-> arg0 root trans y)) (-> obj root-override trans y)) - (let ((f0-2 81920.0)) - (+! (-> obj root-override transv y) f0-2) - (play-landing-sound obj f0-2) - ) + (cond + ((< (+ 4096.0 (-> arg0 root trans y)) (-> obj root-override trans y)) + (let ((f0-2 81920.0)) + (+! (-> obj root-override transv y) f0-2) + (play-landing-sound obj f0-2) ) - (else - (let ((f0-3 24576.0)) - (+! (-> obj root-override transv y) f0-3) - (play-landing-sound obj f0-3) - ) + ) + (else + (let ((f0-3 24576.0)) + (+! (-> obj root-override transv y) f0-3) + (play-landing-sound obj f0-3) ) ) - (let ((s4-0 (new 'stack-no-clear 'vector))) - (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 (-> arg0 root trans) (-> obj root-override trans)) - (set! (-> s4-0 y) 0.0) - (vector-normalize! s4-0 1.0) - (TODO-RENAME-14 (-> obj path) s3-0 (-> obj path-u)) - (set! (-> s3-0 y) 0.0) - (vector-normalize! s3-0 1.0) - (let* ((f28-0 (atan (-> s4-0 x) (-> s4-0 z))) - (f30-0 (atan (-> s3-0 x) (-> s3-0 z))) - (f0-11 (deg- f28-0 f30-0)) - ) - (when (< (fabs f0-11) 10922.667) - (let ((f30-1 (+ f30-0 (if (>= f0-11 0.0) - 10922.667 - -10922.667 - ) - ) - ) - ) - (set-vector! s4-0 (sin f30-1) 0.0 (cos f30-1) 1.0) - ) - ) - ) - ) - (vector-normalize! s4-0 25600.0) - (vector+! s4-0 s4-0 (-> obj root-override trans)) - (vector-! s4-0 s4-0 (-> arg0 root trans)) - (set! (-> s4-0 y) 0.0) - (let ((f30-2 (vector-length s4-0))) - (vector-normalize! s4-0 1.0) - (let ((a1-17 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-17 from) pp) - (set! (-> a1-17 num-params) 2) - (set! (-> a1-17 message) 'attack) - (set! (-> a1-17 param 0) (the-as uint #f)) - (let ((v1-20 (new 'static 'attack-info :mask #xc2))) - (set! (-> v1-20 vector quad) (-> s4-0 quad)) - (set! (-> v1-20 shove-up) 12288.0) - (set! (-> v1-20 shove-back) f30-2) - (set! (-> a1-17 param 1) (the-as uint v1-20)) - ) - (send-event-function arg0 a1-17) - ) - ) - ) - (none) ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 root trans) (-> obj root-override trans)) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (TODO-RENAME-14 (-> obj path) s3-0 (-> obj path-u)) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (let* ((f28-0 (atan (-> s4-0 x) (-> s4-0 z))) + (f30-0 (atan (-> s3-0 x) (-> s3-0 z))) + (f0-11 (deg- f28-0 f30-0)) + ) + (when (< (fabs f0-11) 10922.667) + (let ((f30-1 (+ f30-0 (if (>= f0-11 0.0) + 10922.667 + -10922.667 + ) + ) + ) + ) + (set-vector! s4-0 (sin f30-1) 0.0 (cos f30-1) 1.0) + ) + ) + ) + ) + (vector-normalize! s4-0 25600.0) + (vector+! s4-0 s4-0 (-> obj root-override trans)) + (vector-! s4-0 s4-0 (-> arg0 root trans)) + (set! (-> s4-0 y) 0.0) + (let ((f30-2 (vector-length s4-0))) + (vector-normalize! s4-0 1.0) + (send-event arg0 'attack #f (static-attack-info ((vector s4-0) (shove-up (meters 3)) (shove-back f30-2)))) + ) + ) + (none) ) (defstate snow-ball-roller-idle (snow-ball-roller) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) (when (= (-> arg0 type) target) @@ -422,14 +379,12 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self last-bounce-time) (-> *display* base-frame-counter)) (snow-ball-roller-path-init) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self rolling-sound-enabled?) #f) (when (nonzero? (-> self rolling-sound-id)) (sound-stop (-> self rolling-sound-id)) @@ -438,21 +393,18 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (snow-ball-roller-path-update) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior snow-ball-roller) transform-post) + :post (the-as (function none :behavior snow-ball-roller) transform-post) ) (defbehavior snow-ball-roller-init-by-other snow-ball-roller ((arg0 entity-actor) (arg1 snow-ball) (arg2 float) (arg3 int) (arg4 (inline-array snow-ball-junction))) @@ -504,15 +456,7 @@ ) ) (set! (-> self delay-til-bounce) (rand-vu-int-range 900 2100)) - (let ((gp-1 (get-process *default-dead-pool* snow-ball-shadow #x4000))) - (when gp-1 - (let ((t9-11 (method-of-type snow-ball-shadow activate))) - (t9-11 (the-as snow-ball-shadow gp-1) self 'snow-ball-shadow (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 snow-ball-shadow-init-by-other) - (-> gp-1 ppointer) - ) - ) + (process-spawn snow-ball-shadow :to self) (go snow-ball-roller-idle) (none) ) @@ -565,8 +509,7 @@ ) (defstate snow-ball-idle (snow-ball) - :code - (behavior () + :code (behavior () (local-vars (gp-0 int)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self delay-til-next) 0) @@ -588,19 +531,11 @@ (let ((s4-0 0) (s5-0 (new 'stack-no-clear 'inline-array 'snow-ball-junction 4)) ) - (while #t + (loop (let ((s3-0 (/ (+ 98304.0 (rand-vu-float-range 0.0 32768.0)) (path-distance (-> self path gp-0))))) (dummy-14 self s5-0 s3-0 gp-0) (when (dummy-15 self s5-0 gp-0) - (let ((s4-1 (get-process *default-dead-pool* snow-ball-roller #x4000))) - (when s4-1 - (let ((t9-6 (method-of-type snow-ball-roller activate))) - (t9-6 (the-as snow-ball-roller s4-1) self 'snow-ball-roller (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 snow-ball-roller-init-by-other (-> self entity) self s3-0 gp-0 s5-0) - (-> s4-1 ppointer) - ) - ) + (process-spawn snow-ball-roller (-> self entity) self s3-0 gp-0 s5-0 :to self) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self delay-til-next) (rand-vu-int-range 450 1650)) (cond diff --git a/goal_src/levels/snow/snow-bumper.gc b/goal_src/levels/snow/snow-bumper.gc index 4716a4b2cd..388e08eb7a 100644 --- a/goal_src/levels/snow/snow-bumper.gc +++ b/goal_src/levels/snow/snow-bumper.gc @@ -5,13 +5,11 @@ ;; name in dgo: snow-bumper ;; dgos: L1, SNO -(define-extern *snow-bumper-sg* skeleton-group) - -(declare-type snow-bumper process-drawable) - ;; DECOMP BEGINS +(import "goal_src/import/snow-bumper-ag.gc") + (deftype snow-bumper (process-drawable) ((bumper-id int32 :offset-assert 176) (base-shove-ry float :offset-assert 180) @@ -37,25 +35,20 @@ ) -(defskelgroup *snow-bumper-sg* snow-bumper - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 2.2 0 3.4) - :longest-edge (meters 0) - ) +(defskelgroup *snow-bumper-sg* snow-bumper snow-bumper-lod0-jg -1 + ((snow-bumper-lod0-mg (meters 20)) (snow-bumper-lod1-mg (meters 999999))) + :bounds (static-spherem 0 2.2 0 3.4) + ) (defpartgroup group-snow-bumper-idle :id 519 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1893 :fade-after (meters 90) :falloff-to (meters 90) :period 25 :length 10)) + :parts ((sp-item 1893 :fade-after (meters 90) :falloff-to (meters 90) :period 25 :length 10)) ) (defpart 1893 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 15.0) (sp-flt spt-y (meters 1.5)) (sp-flt spt-z (meters 0)) @@ -82,13 +75,11 @@ :id 520 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1895)) + :parts ((sp-item 1895)) ) (defpart 1895 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-x (meters 5.5)) (sp-flt spt-y (meters 1.5)) @@ -110,73 +101,57 @@ ) (defmethod shove-player snow-bumper ((obj snow-bumper) (arg0 process-drawable)) - (with-pp - (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (-> arg0 root trans) (-> obj root trans)) - (set! (-> s5-0 y) 0.0) - (vector-normalize! s5-0 1.0) - (let* ((f0-3 (atan (-> s5-0 x) (-> s5-0 z))) - (f30-0 (-> obj base-shove-ry)) - (f28-0 (-> obj max-shove-diff-ry)) - (f0-4 (deg- f0-3 f30-0)) - ) - (when (< f28-0 (fabs f0-4)) - (let ((f30-1 (if (>= f0-4 0.0) - (+ f30-0 f28-0) - (- f30-0 f28-0) - ) - ) - ) - (set-vector! s5-0 (sin f30-1) 0.0 (cos f30-1) 1.0) - ) - ) - ) - (let ((f0-12 (+ -16384.0 (atan (-> s5-0 x) (-> s5-0 z))))) - (set! (-> *part-id-table* 1895 init-specs 17 initial-valuef) (+ -4096.0 f0-12)) - ) - (spawn (-> obj part2) (-> obj root trans)) - (let ((s3-1 (new 'stack-no-clear 'vector))) - (vector-normalize-copy! s3-1 s5-0 32768.0) - (vector+! s3-1 s3-1 (-> obj root trans)) - (vector-! s5-0 s3-1 (-> arg0 root trans)) - ) - (let ((f30-3 (vector-xz-length s5-0))) - (vector-normalize! s5-0 1.0) - (let ((a1-12 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-12 from) pp) - (set! (-> a1-12 num-params) 2) - (set! (-> a1-12 message) 'shove) - (set! (-> a1-12 param 0) (the-as uint #f)) - (let ((v1-16 (new 'static 'attack-info :mask #xc2))) - (set! (-> v1-16 vector quad) (-> s5-0 quad)) - (set! (-> v1-16 shove-up) 4096.0) - (set! (-> v1-16 shove-back) f30-3) - (set! (-> a1-12 param 1) (the-as uint v1-16)) - ) - (if (send-event-function *target* a1-12) - (set! (-> obj last-shoved-player-time) (-> *display* base-frame-counter)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 (-> arg0 root trans) (-> obj root trans)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (let* ((f0-3 (atan (-> s5-0 x) (-> s5-0 z))) + (f30-0 (-> obj base-shove-ry)) + (f28-0 (-> obj max-shove-diff-ry)) + (f0-4 (deg- f0-3 f30-0)) + ) + (when (< f28-0 (fabs f0-4)) + (let ((f30-1 (if (>= f0-4 0.0) + (+ f30-0 f28-0) + (- f30-0 f28-0) + ) + ) ) + (set-vector! s5-0 (sin f30-1) 0.0 (cos f30-1) 1.0) ) ) ) - (none) + (let ((f0-12 (+ -16384.0 (atan (-> s5-0 x) (-> s5-0 z))))) + (set! (-> *part-id-table* 1895 init-specs 17 initial-valuef) (+ -4096.0 f0-12)) + ) + (spawn (-> obj part2) (-> obj root trans)) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (vector-normalize-copy! s3-1 s5-0 32768.0) + (vector+! s3-1 s3-1 (-> obj root trans)) + (vector-! s5-0 s3-1 (-> arg0 root trans)) + ) + (let ((f30-3 (vector-xz-length s5-0))) + (vector-normalize! s5-0 1.0) + (if (send-event *target* 'shove #f (static-attack-info ((vector s5-0) (shove-up (meters 1)) (shove-back f30-3)))) + (set! (-> obj last-shoved-player-time) (-> *display* base-frame-counter)) + ) + ) ) + (none) ) (defstate snow-bumper-active-far-idle (snow-bumper) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 135895450000.0 (vector-vector-xz-distance-squared (-> self root trans) (target-pos 0)))) (go snow-bumper-active-close-idle) ) 0 (none) ) - :code - (behavior () + :code (behavior () (transform-post) (suspend) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -185,8 +160,7 @@ ) (defstate snow-bumper-active-close-idle (snow-bumper) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack 'bonk) (when (= (-> arg0 type) target) @@ -206,8 +180,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (cond (*target* (let* ((gp-0 (target-pos 0)) @@ -234,11 +207,10 @@ (update! (-> self sound)) (none) ) - :code - (behavior () + :code (behavior () (transform-post) (suspend) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -247,59 +219,32 @@ ) (defstate snow-bumper-deactivate (snow-bumper) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (the-as (function none :behavior snow-bumper) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior snow-bumper) rider-trans) + :code (behavior () (local-vars (sv-16 symbol)) (logclear! (-> self mask) (process-mask actor-pause)) - (sound-play-by-name (static-sound-name "bumper-pwr-dwn") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 0.05) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (sound-play "bumper-pwr-dwn") + (ja-no-eval :group! snow-bumper-button-ja :num! (seek! max 0.05) :frame-num 0.0) (until (ja-done? 0) (spawn (-> self part) (-> self root trans)) (update! (-> self sound)) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 0.05) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.05)) ) (stop! (-> self sound)) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) (suspend) ) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-10 param 1) 0.02) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! snow-bumper-collapse-ja :num! (seek! max 0.02) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 0.02) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.02)) ) (process-entity-status! self (entity-perm-status complete) #t) (set! sv-16 (the-as symbol #f)) @@ -311,24 +256,13 @@ (go snow-bumper-inactive-idle) (none) ) - :post - (the-as (function none :behavior snow-bumper) rider-post) + :post (the-as (function none :behavior snow-bumper) rider-post) ) (defstate snow-bumper-spawn-fuel-cell (snow-bumper) - :code - (behavior () + :code (behavior () (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - ) + (ja :group! snow-bumper-collapse-ja :num! max) (transform-post) (if (not (task-complete? *game-info* (-> self entity extra perm task))) (birth-pickup-at-point @@ -349,20 +283,10 @@ ) (defstate snow-bumper-inactive-idle (snow-bumper) - :code - (behavior () + :code (behavior () (set! (-> self root nav-radius) 6963.2) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - ) + (ja :group! snow-bumper-collapse-ja :num! max) (transform-post) (suspend) (logior! (-> self mask) (process-mask sleep-code)) @@ -435,19 +359,8 @@ (nav-mesh-connect obj (-> obj root) (the-as nav-control #f)) (set! (-> obj link) (new 'process 'actor-link-info obj)) (set! (-> obj bumper-id) (+ (actor-count-before (-> obj link)) 1)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "snow-bumper") - :volume #x400 - :fo-max 40 - ) - (-> obj root trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "snow-bumper" :fo-max 40) (-> obj root trans)) ) (ja-channel-set! 1) (let ((s5-1 (-> obj skel root-channel 0))) diff --git a/goal_src/levels/snow/snow-bunny.gc b/goal_src/levels/snow/snow-bunny.gc index f97259b980..e68bb61456 100644 --- a/goal_src/levels/snow/snow-bunny.gc +++ b/goal_src/levels/snow/snow-bunny.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/snow-bunny-ag.gc") + (deftype snow-bunny (nav-enemy) ((patrol-rand-distraction int32 :offset-assert 400) (base-hop-dist float :offset-assert 404) @@ -45,14 +47,11 @@ (define-extern *snow-bunny* (pointer snow-bunny)) -(defskelgroup *snow-bunny-sg* snow-bunny - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0.25 0 2) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *snow-bunny-sg* snow-bunny snow-bunny-lod0-jg snow-bunny-idle-ja + ((snow-bunny-lod0-mg (meters 20)) (snow-bunny-lod1-mg (meters 40)) (snow-bunny-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0.25 0 2) + :shadow snow-bunny-shadow-mg + ) (define *snow-bunny-nav-enemy-info* (new 'static 'nav-enemy-info :idle-anim 5 @@ -100,7 +99,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -113,18 +112,11 @@ (go-virtual nav-enemy-die) ) (('touch) - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 2) - (set! (-> a1-5 message) 'attack) - (set! (-> a1-5 param 0) (-> arg3 param 0)) - (set! (-> a1-5 param 1) (the-as uint (new 'static 'attack-info))) - (when (send-event-function arg0 a1-5) - (set! (-> self touch-time) (-> *display* base-frame-counter)) - (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) 256) - (go-virtual snow-bunny-attack) - ) + (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + (set! (-> self touch-time) (-> *display* base-frame-counter)) + (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) + (go-virtual snow-bunny-attack) ) ) (('jump) @@ -208,7 +200,7 @@ (defmethod TODO-RENAME-48 snow-bunny ((obj snow-bunny)) (dummy-60 obj) (TODO-RENAME-45 obj *snow-bunny-nav-enemy-info*) - (set! (-> obj draw shadow-ctrl settings flags) (logand -9 (-> obj draw shadow-ctrl settings flags))) + (logclear! (-> obj draw shadow-ctrl settings flags) (shadow-flags shdf03)) (cond ((zero? (res-lump-value (-> obj entity) 'mode uint128)) (set! (-> obj defense) (the-as uint 1)) @@ -246,7 +238,7 @@ ) (defmethod dummy-58 snow-bunny ((obj snow-bunny)) - (if (zero? (logand (-> *target* state-flags) 2)) + (if (zero? (logand (-> *target* state-flags) (state-flags dangerous))) (set! (-> obj last-nondangerous-time) (-> *display* base-frame-counter)) ) (none) @@ -254,8 +246,8 @@ (defbehavior snow-bunny-initialize-jump snow-bunny ((arg0 vector)) (nav-enemy-initialize-custom-jump arg0 #f (-> self jump-height-min) (-> self jump-height-factor) -307200.0) - (set! (-> self nav-enemy-flags) (logand -1025 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 512) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) 0 (none) ) @@ -293,7 +285,7 @@ ) (defmethod dummy-57 snow-bunny ((obj snow-bunny)) - (if (or (not *target*) (zero? (logand (-> *target* state-flags) 2))) + (if (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags dangerous)))) (return #f) ) (let ((f0-0 (vector-vector-xz-distance (target-pos 0) (-> obj collide-info trans)))) @@ -322,19 +314,16 @@ (defstate snow-bunny-tune-spheres (snow-bunny) :virtual override - :code - (behavior () + :code (behavior () 0 (none) ) - :post - (the-as (function none :behavior snow-bunny) transform-post) + :post (the-as (function none :behavior snow-bunny) transform-post) ) (defstate nav-enemy-idle (snow-bunny) :virtual #t - :enter - (behavior () + :enter (behavior () (dummy-76 self #f) (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-idle) enter))) (if t9-1 @@ -343,36 +332,15 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-identity + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) ) - (set! (-> gp-0 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - ) (let ((f30-0 (nav-enemy-rnd-float-range 0.75 1.25))) - (while #t + (loop (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) f30-0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) @@ -381,12 +349,9 @@ (defstate nav-enemy-patrol (snow-bunny) :virtual #t - :enter - (the-as (function none :behavior snow-bunny) #f) - :trans - (the-as (function none :behavior snow-bunny) #f) - :code - (behavior () + :enter (the-as (function none :behavior snow-bunny) #f) + :trans (the-as (function none :behavior snow-bunny) #f) + :code (behavior () (go-virtual snow-bunny-nav-resume) (none) ) @@ -394,8 +359,7 @@ (defstate snow-bunny-nav-resume (snow-bunny) :virtual override - :code - (behavior () + :code (behavior () (cond (*target* (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans)))) @@ -425,20 +389,17 @@ (defstate snow-bunny-patrol-idle (snow-bunny) :virtual override - :event - snow-bunny-default-event-handler - :enter - (behavior () + :event snow-bunny-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (dummy-76 self #f) - (set! (-> self nav flags) (logior (nav-control-flags bit19) (-> self nav flags))) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 8) + (set! (-> self nav flags) (logior (nav-control-flags navcf19) (-> self nav flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (set! (-> self state-timeout) (seconds 0.1)) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-57 self) (go-virtual snow-bunny-defend) ) @@ -458,8 +419,7 @@ (dummy-58 self) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (nav-enemy-rnd-int-count 3))) (when (and (not (-> self patrol-hop-failed?)) (zero? gp-0)) (if (dummy-53 self) @@ -468,35 +428,15 @@ ) (set! (-> self patrol-hop-failed?) #f) (let ((gp-2 (min gp-0 (nav-enemy-rnd-int-count 3)))) - (ja-channel-push! 1 30) - (let ((s5-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-identity + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) ) - (set! (-> s5-0 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - ) - (while #t + (loop (let ((s5-1 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) s5-1) (seconds 2.52)) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) ) (cond @@ -514,8 +454,7 @@ ) (none) ) - :post - (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) + :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) (defmethod dummy-51 snow-bunny ((obj snow-bunny) (arg0 vector) (arg1 vector)) @@ -533,7 +472,7 @@ (collide-kind background) (-> obj collide-info process) s4-0 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -643,10 +582,8 @@ (defstate snow-bunny-patrol-hop (snow-bunny) :virtual override - :event - snow-bunny-default-event-handler - :enter - (behavior () + :event snow-bunny-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (when (not (dummy-54 self)) (set! (-> self patrol-hop-failed?) #t) @@ -662,19 +599,16 @@ (set! (-> self turn-time) (seconds 0.1)) (none) ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 24) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (none) ) - :trans - (behavior () + :trans (behavior () (dummy-58 self) (none) ) - :code - (behavior () + :code (behavior () (snow-bunny-execute-jump) (if (-> self using-jump-event?) (set-current-poly! (-> self nav) (dummy-16 (-> self nav) (-> self collide-info trans))) @@ -687,64 +621,41 @@ ) (none) ) - :post - (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) + :post (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) ) (defstate nav-enemy-notice (snow-bunny) :virtual #t - :event - snow-bunny-default-event-handler - :enter - (behavior () - (logior! (-> self nav-enemy-flags) 4) + :event snow-bunny-default-event-handler + :enter (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-neck-control-look-at) - (if (logtest? (-> self nav-enemy-flags) 2) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-chase) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (dummy-76 self #t) (set-vector! (-> self collide-info transv) 0.0 (nav-enemy-rnd-float-range 102400.0 131072.0) 0.0 1.0) (none) ) - :exit - (the-as (function none :behavior snow-bunny) #f) - :trans - (behavior () + :exit (the-as (function none :behavior snow-bunny) #f) + :trans (behavior () (dummy-58 self) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - ) - (set! (-> gp-0 param 0) (ja-aframe 8.0 0)) - (set! (-> gp-0 param 1) f30-0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info notice-anim)) + :num! (seek! (ja-aframe 8.0 0) f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 8.0 0)) - (set! (-> gp-1 param 1) f30-0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 8.0 0) f30-0)) ) - (until (logtest? (-> self collide-info status) 1) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) f30-0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (until (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)) + (ja :num! (seek! max f30-0)) (+! (-> self collide-info transv y) (* -546119.7 (-> *display* seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) @@ -763,53 +674,32 @@ ) (suspend) ) - (ja-channel-push! 1 22) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self notice-land-anim)))) - (set! (-> a0-18 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self notice-land-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-18 param 1) f30-0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! - a0-18 - (the-as art-joint-anim (-> self draw art-group data (-> self notice-land-anim))) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data (-> self notice-land-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) f30-0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (go-virtual nav-enemy-chase) (none) ) - :post - (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) + :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) (defstate nav-enemy-chase (snow-bunny) :virtual #t - :event - (the-as (function process int symbol event-message-block object :behavior snow-bunny) #f) - :exit - (the-as (function none :behavior snow-bunny) #f) - :trans - (the-as (function none :behavior snow-bunny) #f) - :code - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior snow-bunny) #f) + :exit (the-as (function none :behavior snow-bunny) #f) + :trans (the-as (function none :behavior snow-bunny) #f) + :code (behavior () (go-virtual snow-bunny-chase-hop) (none) ) - :post - (the-as (function none :behavior snow-bunny) #f) + :post (the-as (function none :behavior snow-bunny) #f) ) (defmethod dummy-52 snow-bunny ((obj snow-bunny)) @@ -882,13 +772,11 @@ (defstate snow-bunny-chase-hop (snow-bunny) :virtual override - :event - snow-bunny-default-event-handler - :enter - (behavior () + :event snow-bunny-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self should-retreat?) #f) - (if (or (not *target*) (logtest? (-> *target* state-flags) 128)) + (if (or (not *target*) (logtest? (-> *target* state-flags) (state-flags do-not-notice))) (go-virtual nav-enemy-patrol) ) (if (not (TODO-RENAME-46 self (-> self nav-info stop-chase-distance))) @@ -898,7 +786,7 @@ (go-virtual snow-bunny-defend) ) (when (not (dummy-52 self)) - (set! (-> self nav-enemy-flags) (logand -3 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-notice) ) (set-jump-height-factor! self 1) @@ -908,22 +796,19 @@ (set! (-> self turn-time) (seconds 0.1)) (none) ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 24) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-57 self) (set! (-> self should-retreat?) #t) ) (dummy-58 self) (none) ) - :code - (behavior () + :code (behavior () (snow-bunny-execute-jump) (if (-> self using-jump-event?) (set-current-poly! (-> self nav) (dummy-16 (-> self nav) (-> self collide-info trans))) @@ -934,14 +819,12 @@ (go-virtual snow-bunny-chase-hop) (none) ) - :post - (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) + :post (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) ) (defstate snow-bunny-defend (snow-bunny) :virtual override - :code - (behavior () + :code (behavior () (if (= (-> self defense) 1) (go-virtual snow-bunny-retreat-hop) (go-virtual snow-bunny-lunge) @@ -1155,16 +1038,14 @@ (defstate snow-bunny-retreat-hop (snow-bunny) :virtual override - :event - snow-bunny-default-event-handler - :enter - (behavior () + :event snow-bunny-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (if (not *target*) (go-virtual nav-enemy-patrol) ) (let ((v1-8 (>= 73728.0 (vector-vector-xz-distance (target-pos 0) (-> self collide-info trans))))) - (when (or (-> self should-retreat?) (and v1-8 (logtest? (-> *target* state-flags) 2))) + (when (or (-> self should-retreat?) (and v1-8 (logtest? (-> *target* state-flags) (state-flags dangerous)))) (set! (-> self retreat-timeout-time) (+ (-> *display* base-frame-counter) (the int (* 300.0 (-> self retreat-timeout)))) ) @@ -1172,7 +1053,7 @@ ) (when (or (>= (-> *display* base-frame-counter) (-> self retreat-timeout-time)) (not v1-8)) (if (or (not *target*) - (logtest? (-> *target* state-flags) 128) + (logtest? (-> *target* state-flags) (state-flags do-not-notice)) (not (TODO-RENAME-46 self (-> self nav-info stop-chase-distance))) ) (go-virtual nav-enemy-patrol) @@ -1191,19 +1072,16 @@ (set! (-> self turn-time) (seconds 0.1)) (none) ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 24) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (none) ) - :trans - (behavior () + :trans (behavior () (dummy-58 self) (none) ) - :code - (behavior () + :code (behavior () (snow-bunny-execute-jump) (if (-> self using-jump-event?) (set-current-poly! (-> self nav) (dummy-16 (-> self nav) (-> self collide-info trans))) @@ -1211,22 +1089,18 @@ (go-virtual snow-bunny-retreat-hop) (none) ) - :post - (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) + :post (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) ) (defstate snow-bunny-lunge (snow-bunny) :virtual override - :event - snow-bunny-default-event-handler - :enter - (behavior () + :event snow-bunny-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (dummy-76 self #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (not *target*) (go-virtual nav-enemy-patrol) ) @@ -1236,63 +1110,40 @@ (go-virtual snow-bunny-chase-hop) ) ) - (if (not (logtest? (-> *target* state-flags) 2)) + (if (not (logtest? (-> *target* state-flags) (state-flags dangerous))) (go-virtual snow-bunny-chase-hop) ) - (if (and (logtest? (-> *target* state-flags) 2) (not (TODO-RENAME-46 self (-> self nav-info notice-distance)))) + (if (and (logtest? (-> *target* state-flags) (state-flags dangerous)) + (not (TODO-RENAME-46 self (-> self nav-info notice-distance))) + ) (go-virtual snow-bunny-retreat-hop) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) + :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) (defstate snow-bunny-attack (snow-bunny) :virtual override - :event - snow-bunny-default-event-handler - :enter - (behavior () + :event snow-bunny-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set-vector! (-> self collide-info transv) 0.0 0.0 0.0 1.0) (dummy-76 self #t) (none) ) - :trans - (behavior () + :trans (behavior () (when *target* (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 (target-pos 0) (-> self collide-info trans)) @@ -1311,40 +1162,20 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self attack-anim)))) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self attack-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self attack-anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data (-> self attack-anim)) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (until (logtest? (-> self collide-info status) 1) + (until (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)) (suspend) ) (go-virtual snow-bunny-retreat-hop) (none) ) - :post - (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) + :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) diff --git a/goal_src/levels/snow/snow-flutflut-obs.gc b/goal_src/levels/snow/snow-flutflut-obs.gc index ae08e512bf..09403e80ee 100644 --- a/goal_src/levels/snow/snow-flutflut-obs.gc +++ b/goal_src/levels/snow/snow-flutflut-obs.gc @@ -5,17 +5,14 @@ ;; name in dgo: snow-flutflut-obs ;; dgos: L1, SNO -(define-extern *flutflut-plat-large-sg* skeleton-group) -(define-extern *flutflut-plat-med-sg* skeleton-group) -(define-extern *flutflut-plat-small-sg* skeleton-group) -(define-extern *snow-button-sg* skeleton-group) - -(declare-type flutflut-plat plat) -(declare-type snow-button process-drawable) - ;; DECOMP BEGINS +(import "goal_src/import/snow-button-ag.gc") +(import "goal_src/import/flutflut-plat-med-ag.gc") +(import "goal_src/import/flutflut-plat-small-ag.gc") +(import "goal_src/import/flutflut-plat-large-ag.gc") + (deftype flutflut-plat (plat) ((has-path? symbol :offset-assert 264) (plat-type int32 :offset-assert 268) @@ -47,12 +44,13 @@ (deftype snow-button (process-drawable) - ((root-override collide-shape-moving :offset 112) - (wiggled? symbol :offset-assert 176) - (timeout time-frame :offset-assert 184) - (delay-til-wiggle time-frame :offset-assert 192) - (prev-button entity-actor :offset-assert 200) - (ticker ticky :inline :offset-assert 208) + ((root-override collide-shape-moving :offset 112) + (wiggled? symbol :offset-assert 176) + (trying-for-fuel-cell? symbol :offset-assert 180) + (timeout time-frame :offset-assert 184) + (delay-til-wiggle time-frame :offset-assert 192) + (prev-button entity-actor :offset-assert 200) + (ticker ticky :inline :offset-assert 208) ) :heap-base #x80 :method-count-assert 20 @@ -66,51 +64,37 @@ ) -(defskelgroup *flutflut-plat-small-sg* flutflut-plat-small - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -0.5 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *flutflut-plat-small-sg* flutflut-plat-small flutflut-plat-small-lod0-jg flutflut-plat-small-idle-ja + ((flutflut-plat-small-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -0.5 0 4) + ) -(defskelgroup *flutflut-plat-med-sg* flutflut-plat-med - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -1 0 6.75) - :longest-edge (meters 0) - ) +(defskelgroup *flutflut-plat-med-sg* flutflut-plat-med flutflut-plat-med-lod0-jg flutflut-plat-med-idle-ja + ((flutflut-plat-med-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -1 0 6.75) + ) -(defskelgroup *flutflut-plat-large-sg* flutflut-plat-large - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *flutflut-plat-large-sg* flutflut-plat-large flutflut-plat-large-lod0-jg flutflut-plat-large-idle-ja + ((flutflut-plat-large-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 9) + ) -(defskelgroup *snow-button-sg* snow-button - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4.3) - :longest-edge (meters 0) - ) +(defskelgroup *snow-button-sg* snow-button snow-button-lod0-jg -1 + ((snow-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.3) + ) (defpartgroup group-flutflut-plat-small :id 516 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2087 :fade-after (meters 50) :falloff-to (meters 50)) + :parts ((sp-item 2087 :fade-after (meters 50) :falloff-to (meters 50)) (sp-item 2088 :fade-after (meters 120) :falloff-to (meters 120)) ) ) (defpart 2087 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters -1)) (sp-rnd-flt spt-z (meters -2) (meters 4) 1.0) @@ -127,8 +111,7 @@ ) (defpart 2088 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -3) (meters 6) 1.0) (sp-flt spt-y (meters -1.25)) @@ -153,15 +136,13 @@ :id 517 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2089 :fade-after (meters 50) :falloff-to (meters 50)) + :parts ((sp-item 2089 :fade-after (meters 50) :falloff-to (meters 50)) (sp-item 2090 :fade-after (meters 120) :falloff-to (meters 120)) ) ) (defpart 2089 - :init-specs - ((sp-flt spt-num 3.0) + :init-specs ((sp-flt spt-num 3.0) (sp-flt spt-y (meters -2.5)) (sp-int spt-rot-x 5) (sp-flt spt-r 5324.8) @@ -178,8 +159,7 @@ ) (defpart 2090 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters -2.25)) (sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) @@ -204,15 +184,13 @@ :id 518 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2091 :fade-after (meters 50) :falloff-to (meters 50)) + :parts ((sp-item 2091 :fade-after (meters 50) :falloff-to (meters 50)) (sp-item 2092 :fade-after (meters 120) :falloff-to (meters 120)) ) ) (defpart 2091 - :init-specs - ((sp-flt spt-num 4.0) + :init-specs ((sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters -1.5)) (sp-rnd-flt spt-z (meters -6) (meters 12) 1.0) @@ -229,8 +207,7 @@ ) (defpart 2092 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters -1.25)) @@ -252,8 +229,7 @@ ) (defstate snow-button-up-idle (snow-button) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-2 object)) (case arg2 (('touch 'attack 'bonk) @@ -273,16 +249,8 @@ ) ) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 2) :num! min) (transform-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -292,8 +260,7 @@ ) (defstate snow-button-activate (snow-button) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('untrigger) @@ -305,10 +272,11 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self wiggled?) #f) + ;; PAL patch here + (set! (-> self trying-for-fuel-cell?) (not (task-complete? *game-info* (game-task snow-ball)))) (sleep (-> self ticker) (-> self timeout)) (when (-> self prev-button) (let* ((v1-6 (-> self prev-button)) @@ -325,11 +293,15 @@ (send-to-all-after (-> self link) 'trigger) (none) ) - :trans - (behavior () + :trans (behavior () (if (completed? (-> self ticker)) (go snow-button-deactivate) ) + (when (and (-> self trying-for-fuel-cell?) (task-complete? *game-info* (game-task snow-ball))) + (set! (-> self trying-for-fuel-cell?) #f) + (go snow-button-deactivate) + ) + ;; PAL patch here (when (reached-delay? (-> self ticker) (-> self delay-til-wiggle)) (when (not (-> self wiggled?)) (set! (-> self wiggled?) #t) @@ -339,38 +311,23 @@ (rider-trans) (none) ) - :code - (behavior () - (sound-play-by-name (static-sound-name "prec-button1") (new-sound-id) 1024 -1524 0 1 #t) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + :code (behavior () + (sound-play "prec-button1" :pitch -1) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 (none) ) - :post - (the-as (function none :behavior snow-button) rider-post) + :post (the-as (function none :behavior snow-button) rider-post) ) (defstate snow-button-deactivate (snow-button) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 symbol)) (case arg2 (('query) @@ -379,43 +336,27 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :trans - (the-as (function none :behavior snow-button) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior snow-button) rider-trans) + :code (behavior () (send-to-all-after (-> self link) 'untrigger) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.6)) (suspend) ) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go snow-button-up-idle) (none) ) - :post - (the-as (function none :behavior snow-button) rider-post) + :post (the-as (function none :behavior snow-button) rider-post) ) (defmethod init-from-entity! snow-button ((obj snow-button) (arg0 entity-actor)) @@ -473,6 +414,8 @@ (set! (-> obj prev-button) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> obj prev-button) #f) ) + ;; PAL patch here + (set! (-> obj trying-for-fuel-cell?) (not (task-complete? *game-info* (game-task snow-ball)))) (ja-channel-set! 1) (let ((s5-1 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! @@ -548,8 +491,7 @@ (defstate plat-startup (flutflut-plat) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (when (or (!= (-> self plat-type) 1) @@ -561,8 +503,7 @@ ) ) ) - :code - (behavior ((arg0 plat)) + :code (behavior ((arg0 plat)) (cond ((and (= (-> self plat-type) 1) (-> self entity) @@ -597,8 +538,7 @@ ) (defstate flutflut-plat-hidden-idle (flutflut-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (logclear! (-> self mask) (process-mask actor-pause)) @@ -606,15 +546,13 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (and (= (-> self plat-type) 1) (get-lit-skel self)) (go flutflut-plat-appear) ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self root-override)) (set! (-> self root-override trans quad) (-> self appear-trans-top quad)) @@ -627,8 +565,7 @@ ) (defstate flutflut-plat-appear (flutflut-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (or (= v1-0 'bonk) (= v1-0 'bounce)) (dummy-22 self) @@ -636,8 +573,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) @@ -655,13 +591,11 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (behavior () + :trans (behavior () (plat-trans) (let* ((f0-1 (fmin @@ -701,16 +635,13 @@ (dummy-20 self) (none) ) - :code - (the-as (function none :behavior flutflut-plat) anim-loop) - :post - (the-as (function none :behavior flutflut-plat) rider-post) + :code (the-as (function none :behavior flutflut-plat) anim-loop) + :post (the-as (function none :behavior flutflut-plat) rider-post) ) (defstate plat-idle (flutflut-plat) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((or (= v1-0 'bonk) (= v1-0 'bounce)) @@ -723,8 +654,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (let ((t9-0 (-> (method-of-type plat plat-idle) enter))) (if t9-0 (t9-0) @@ -733,8 +663,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (let ((t9-0 (-> (method-of-type plat plat-idle) exit))) (if t9-0 @@ -743,8 +672,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((t9-0 (-> (method-of-type plat plat-idle) trans))) (if t9-0 (t9-0) @@ -759,8 +687,7 @@ (defstate plat-path-active (flutflut-plat) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((or (= v1-0 'bonk) (= v1-0 'bounce)) @@ -773,8 +700,7 @@ ) ) ) - :enter - (behavior ((arg0 plat)) + :enter (behavior ((arg0 plat)) (let ((t9-0 (-> (method-of-type plat plat-path-active) enter))) (if t9-0 (t9-0 arg0) @@ -787,8 +713,7 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (let ((t9-0 (-> (method-of-type plat plat-path-active) exit))) (if t9-0 @@ -800,8 +725,7 @@ ) (defstate flutflut-plat-hide (flutflut-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'bonk) (dummy-22 self) @@ -809,8 +733,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self root-override root-prim prim-core action) (collide-action ca-1)) @@ -827,14 +750,12 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self root-override root-prim prim-core action) (collide-action ca-1)) (none) ) - :trans - (behavior () + :trans (behavior () (plat-trans) (let* ((f0-1 (fmin @@ -857,15 +778,12 @@ (dummy-20 self) (none) ) - :code - (the-as (function none :behavior flutflut-plat) anim-loop) - :post - (the-as (function none :behavior flutflut-plat) rider-post) + :code (the-as (function none :behavior flutflut-plat) anim-loop) + :post (the-as (function none :behavior flutflut-plat) rider-post) ) (defstate elevator-idle-at-cave (flutflut-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -887,27 +805,22 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self path-pos) 0.0) (eval-path-curve! (-> self path) (-> self basetrans) 0.0 'interp) (none) ) - :trans - (behavior () + :trans (behavior () (plat-trans) (dummy-20 self) (none) ) - :code - (the-as (function none :behavior flutflut-plat) anim-loop) - :post - (the-as (function none :behavior flutflut-plat) plat-post) + :code (the-as (function none :behavior flutflut-plat) anim-loop) + :post (the-as (function none :behavior flutflut-plat) plat-post) ) (defstate elevator-travel-to-fort (flutflut-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (or (= v1-0 'bonk) (= v1-0 'bounce)) (dummy-22 self) @@ -915,27 +828,24 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (= (-> self path-pos) 1.0) (dummy-22 self) (go elevator-idle-at-fort) ) - (set! (-> self path-pos) (seek (-> self path-pos) 1.0 (* 0.06666667 (-> *display* seconds-per-frame)))) + ;; PAL patch here + (seek! (-> self path-pos) 1.0 (* 0.16 (-> *display* seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (plat-trans) (dummy-20 self) (none) ) - :code - (the-as (function none :behavior flutflut-plat) anim-loop) - :post - (the-as (function none :behavior flutflut-plat) plat-post) + :code (the-as (function none :behavior flutflut-plat) anim-loop) + :post (the-as (function none :behavior flutflut-plat) plat-post) ) (defstate elevator-idle-at-fort (flutflut-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (or (= v1-0 'bonk) (= v1-0 'bounce)) (dummy-22 self) @@ -943,18 +853,16 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self path-pos) 1.0) (eval-path-curve! (-> self path) (-> self basetrans) 1.0 'interp) (none) ) - :trans - (behavior () + :trans (behavior () (when *target* (if (and (>= 798720.0 (-> (target-pos 0) y)) - (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) @@ -965,15 +873,12 @@ (dummy-20 self) (none) ) - :code - (the-as (function none :behavior flutflut-plat) anim-loop) - :post - (the-as (function none :behavior flutflut-plat) plat-post) + :code (the-as (function none :behavior flutflut-plat) anim-loop) + :post (the-as (function none :behavior flutflut-plat) plat-post) ) (defstate elevator-travel-to-cave (flutflut-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (or (= v1-0 'bonk) (= v1-0 'bounce)) (dummy-22 self) @@ -981,22 +886,20 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (= (-> self path-pos) 0.0) (dummy-22 self) (go elevator-idle-at-cave) ) - (set! (-> self path-pos) (seek (-> self path-pos) 0.0 (* 0.06666667 (-> *display* seconds-per-frame)))) + ;; PAL patch here + (seek! (-> self path-pos) 0.0 (* 0.16 (-> *display* seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (plat-trans) (dummy-20 self) (none) ) - :code - (the-as (function none :behavior flutflut-plat) anim-loop) - :post - (the-as (function none :behavior flutflut-plat) plat-post) + :code (the-as (function none :behavior flutflut-plat) anim-loop) + :post (the-as (function none :behavior flutflut-plat) plat-post) ) (deftype flutflut-plat-small (flutflut-plat) diff --git a/goal_src/levels/snow/snow-obs.gc b/goal_src/levels/snow/snow-obs.gc index 8491c8aa49..bd50ba6b29 100644 --- a/goal_src/levels/snow/snow-obs.gc +++ b/goal_src/levels/snow/snow-obs.gc @@ -7,6 +7,15 @@ ;; DECOMP BEGINS +(import "goal_src/import/snowcam-ag.gc") +(import "goal_src/import/snow-fort-gate-ag.gc") +(import "goal_src/import/snow-eggtop-ag.gc") +(import "goal_src/import/snow-spatula-ag.gc") +(import "goal_src/import/snow-switch-ag.gc") +(import "goal_src/import/snow-gears-ag.gc") +(import "goal_src/import/snowpusher-ag.gc") +(import "goal_src/import/snow-log-ag.gc") + (deftype snowcam (pov-camera) ((seq uint64 :offset-assert 224) ) @@ -17,13 +26,10 @@ ) -(defskelgroup *snowcam-sg* snowcam - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *snowcam-sg* snowcam snowcam-lod0-jg -1 + ((snowcam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) (defmethod set-stack-size! snowcam ((obj snowcam)) (stack-size-set! (-> obj main-thread) 512) @@ -32,61 +38,24 @@ (defstate pov-camera-playing (snowcam) :virtual #t - :code - (behavior () + :code (behavior () (let ((v1-0 (-> self seq))) (cond ((zero? v1-0) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 0.2) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! max 0.2) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 0.2) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 0.25) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) + (ja :num! (seek! max 0.2)) ) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.25) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 0.25) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + (ja :num! (seek! max 0.25)) ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-0 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 4.5)) @@ -95,29 +64,28 @@ ) ) ((= v1-0 1) - (let* ((gp-1 (get-process *default-dead-pool* fuel-cell #x4000)) - (gp-2 - (ppointer->handle - (when gp-1 - (let ((t9-10 (method-of-type fuel-cell activate))) - (t9-10 (the-as fuel-cell gp-1) (ppointer->process (-> self parent)) 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 fuel-cell-init-as-clone (process->handle self) (-> self entity extra perm task)) - (-> gp-1 ppointer) - ) - ) - ) - ) - (push-setting! *setting-control* self 'music-volume 'abs 0.0 0) - (push-setting! *setting-control* self 'sfx-volume 'rel 50.0 0) + (let ((gp-2 + (ppointer->handle + (process-spawn + fuel-cell + :init fuel-cell-init-as-clone + (process->handle self) + (-> self entity extra perm task) + :to (ppointer->process (-> self parent)) + ) + ) + ) + ) + (add-setting! 'music-volume 'abs 0.0 0) + (add-setting! 'sfx-volume 'rel 50.0 0) (ja-play-spooled-anim (the-as spool-anim (-> self anim-name)) (the-as art-joint-anim #f) (the-as art-joint-anim #f) (the-as (function process-drawable symbol) false-func) ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) (let ((a0-21 (handle->process gp-2))) (if a0-21 (send-event a0-21 'stop-cloning) @@ -126,40 +94,16 @@ ) ) ((= v1-0 2) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event (handle->process (-> self notify-handle)) 'notify 'cut) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-31 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-31 param 1) 1.0) - (set! (-> a0-31 frame-num) 0.0) - (joint-control-channel-group! a0-31 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-32 (-> self skel root-channel 0))) - (set! (-> a0-32 param 0) (the float (+ (-> a0-32 frame-group data 0 length) -1))) - (set! (-> a0-32 param 1) 1.0) - (joint-control-channel-group-eval! a0-32 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else @@ -190,19 +134,15 @@ ) -(defskelgroup *snow-eggtop-sg* snow-eggtop - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *snow-eggtop-sg* snow-eggtop snow-eggtop-lod0-jg snow-eggtop-idle-ja + ((snow-eggtop-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defpartgroup group-snow-yellow-eco-room-open :id 510 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 1990 :fade-after (meters 110)) + :parts ((sp-item 1990 :fade-after (meters 110)) (sp-item 1991 :fade-after (meters 110)) (sp-item 1992 :fade-after (meters 110)) (sp-item 1993 :fade-after (meters 110)) @@ -214,13 +154,11 @@ :id 511 :duration 900 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 1994) (sp-item 1994) (sp-item 1995 :flags (bit1) :period 1200 :length 15)) + :parts ((sp-item 1994) (sp-item 1994) (sp-item 1995 :flags (bit1) :period 1200 :length 15)) ) (defpart 1995 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 30.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 20) (meters 10) 1.0) @@ -241,18 +179,15 @@ ) (defpart 1996 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 225) (sp-launcher-by-id spt-next-launcher 1997)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 225) (sp-launcher-by-id spt-next-launcher 1997)) ) (defpart 1997 - :init-specs - ((sp-flt spt-fade-a -0.14222223)) + :init-specs ((sp-flt spt-fade-a -0.14222223)) ) (defpart 1990 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 10) (meters 2) 1.0) @@ -267,8 +202,7 @@ ) (defpart 1991 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) @@ -283,8 +217,7 @@ ) (defpart 1992 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) @@ -304,8 +237,7 @@ ) (defpart 1998 - :init-specs - ((sp-flt spt-r 64.0) + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) (sp-flt spt-fade-r -1.0) (sp-flt spt-fade-g -1.0) @@ -314,8 +246,7 @@ ) (defpart 1993 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) @@ -335,8 +266,7 @@ ) (defpart 1994 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-y (meters -6.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 2) 1.0) @@ -359,8 +289,7 @@ ) (defstate snow-eggtop-idle-up (snow-eggtop) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'notify) (case (-> arg3 param 0) @@ -374,8 +303,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (and (not (-> self child)) (task-complete? *game-info* (-> self entity extra perm task))) (go snow-eggtop-activate) ) @@ -383,19 +311,11 @@ (update! (-> self sound)) (none) ) - :code - (behavior () + :code (behavior () (ja-channel-push! 1 0) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 2) :num! min) (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -404,8 +324,7 @@ ) (defstate snow-eggtop-activate (snow-eggtop) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notify) (when (= (-> arg0 type) snowcam) @@ -426,85 +345,56 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) (set! (-> self play-sound?) #t) (none) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :trans - (the-as (function none :behavior snow-eggtop) rider-trans) - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 511) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + :trans (the-as (function none :behavior snow-eggtop) rider-trans) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 511) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) - (let* ((gp-1 (get-process *default-dead-pool* snowcam #x4000)) - (v1-7 - (when gp-1 - (let ((t9-4 (method-of-type snowcam activate))) - (t9-4 (the-as snowcam gp-1) self 'snowcam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (-> self spawn-trans) - *snowcam-sg* - "gearstart" - 0 - self - '((0 ambient camera "gamcam38") (10 alive "ecovent-278")) - ) - (-> gp-1 ppointer) - ) - ) - ) + (let ((v1-7 + (process-spawn + snowcam + :init pov-camera-init-by-other + (-> self spawn-trans) + *snowcam-sg* + "gearstart" + 0 + self + '((0 ambient camera "gamcam38") (10 alive "ecovent-278")) + :to self + ) + ) + ) (set! (-> (the-as snowcam (-> v1-7 0)) seq) (the-as uint 2)) ) (change-sound! (-> self sound) (static-sound-name "snw-eggtop-seq")) (save-reminder (get-task-control (-> self entity extra perm task)) 2 4) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (-> self play-sound?) (update! (-> self sound)) ) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (level-hint-spawn (game-text-id snowy-turned-on-yellow-vents) @@ -527,7 +417,7 @@ ) ) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'show) - (while #t + (loop (if (-> self play-sound?) (update! (-> self sound)) ) @@ -535,13 +425,11 @@ ) (none) ) - :post - (the-as (function none :behavior snow-eggtop) rider-post) + :post (the-as (function none :behavior snow-eggtop) rider-post) ) (defstate snow-eggtop-idle-down (snow-eggtop) - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) (let ((a0-1 (-> self entity))) (if (and a0-1 (= self (-> a0-1 extra process))) @@ -549,16 +437,7 @@ ) ) (ja-channel-push! 1 0) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - ) + (ja :group! (-> self draw art-group data 2) :num! max) (transform-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -595,19 +474,8 @@ (set! (-> obj root-override trans y) (+ -2662.4 (-> obj root-override trans y))) (update-transforms! (-> obj root-override)) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 510) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "electric-loop") - :volume #x400 - :fo-max 40 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "electric-loop" :fo-max 40) (-> obj root-override trans)) ) (cond ((task-complete? *game-info* (-> obj entity extra perm task)) @@ -649,34 +517,26 @@ ) -(defskelgroup *snowpusher-sg* snowpusher - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *snowpusher-sg* snowpusher snowpusher-lod0-jg snowpusher-idle-ja + ((snowpusher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) (defstate snowpusher-idle (snowpusher) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) #f ) ) ) ) - :code - (behavior () + :code (behavior () (let ((gp-0 #f)) - (while #t + (loop (let ((f0-0 (get-current-phase-with-mirror (-> self sync)))) - (let ((v1-4 (-> self skel root-channel 0))) - (set! (-> v1-4 num-func) num-func-identity) - (set! (-> v1-4 frame-num) (* f0-0 (-> self max-frame))) - ) + (ja :num-func num-func-identity :frame-num (* f0-0 (-> self max-frame))) (cond ((or (= f0-0 0.0) (= f0-0 1.0)) (set! gp-0 #f) @@ -685,8 +545,8 @@ (when (not gp-0) (set! gp-0 #t) (if (>= f0-0 0.5) - (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) + (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) ) ) ) @@ -697,8 +557,7 @@ ) (none) ) - :post - (the-as (function none :behavior snowpusher) pusher-post) + :post (the-as (function none :behavior snowpusher) pusher-post) ) (defmethod init-from-entity! snowpusher ((obj snowpusher) (arg0 entity-actor)) @@ -779,33 +638,28 @@ ) -(defskelgroup *snow-spatula-sg* snow-spatula - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 10 0 10) - :longest-edge (meters 9.4) - ) +(defskelgroup *snow-spatula-sg* snow-spatula snow-spatula-lod0-jg snow-spatula-idle-ja + ((snow-spatula-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 10) + :longest-edge (meters 9.4) + ) (defstate snow-spatula-idle (snow-spatula) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'bonk) (dummy-22 self) - (sound-play-by-name (static-sound-name "snow-spat-short") (new-sound-id) 768 1143 0 1 #t) + (sound-play "snow-spat-short" :vol 75 :pitch 0.75) ) ) ) ) - :trans - (the-as (function none :behavior snow-spatula) plat-trans) - :code - (behavior () + :trans (the-as (function none :behavior snow-spatula) plat-trans) + :code (behavior () (let ((f28-0 0.0) (gp-0 1) ) - (while #t + (loop (let ((f30-0 (get-current-phase-with-mirror (-> self sync)))) (when (!= f30-0 f28-0) (let ((v1-3 1)) @@ -816,26 +670,10 @@ (set! gp-0 v1-3) (cond ((> v1-3 0) - (sound-play-by-name - (static-sound-name "snow-spat-long") - (new-sound-id) - 1024 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-long" :pitch (rand-vu-float-range -0.2 0.2)) ) (1 - (sound-play-by-name - (static-sound-name "snow-spat-short") - (new-sound-id) - 1024 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-short" :pitch (rand-vu-float-range -0.2 0.2)) ) ) ) @@ -853,8 +691,7 @@ ) (none) ) - :post - (the-as (function none :behavior snow-spatula) plat-post) + :post (the-as (function none :behavior snow-spatula) plat-post) ) (defmethod init-from-entity! snow-spatula ((obj snow-spatula) (arg0 entity-actor)) @@ -908,25 +745,21 @@ ) -(defskelgroup *snow-fort-gate-sg* snow-fort-gate - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 15 0 24) - :longest-edge (meters 12.8) - ) +(defskelgroup *snow-fort-gate-sg* snow-fort-gate snow-fort-gate-lod0-jg -1 + ((snow-fort-gate-lod0-mg (meters 999999))) + :bounds (static-spherem 0 15 0 24) + :longest-edge (meters 12.8) + ) (defpartgroup group-snow-fort-gate-coming-down :id 512 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1896)) + :parts ((sp-item 1896)) ) (defpart 1896 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) @@ -952,21 +785,18 @@ ) (defpart 1897 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) (defpartgroup group-snow-fort-gate-hits-bottom :id 513 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1898)) + :parts ((sp-item 1898)) ) (defpart 1898 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 64.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) @@ -993,15 +823,13 @@ ) (defpart 1899 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) (defpartgroup group-snow-fort-gate-snowdrops :id 514 :bounds (static-bspherem 0 -16 0 32) - :parts - ((sp-item 2271 :fade-after (meters 100) :falloff-to (meters 130) :period 1200 :length 150) + :parts ((sp-item 2271 :fade-after (meters 100) :falloff-to (meters 130) :period 1200 :length 150) (sp-item 2271 :fade-after (meters 100) :falloff-to (meters 130) :period 1200 :length 100) (sp-item 2271 :fade-after (meters 100) :falloff-to (meters 130) :period 1200 :length 60) (sp-item 2271 :fade-after (meters 100) :falloff-to (meters 130) :period 1200 :length 30) @@ -1020,8 +848,7 @@ ) (defpart 2271 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) @@ -1043,13 +870,11 @@ ) (defpart 2274 - :init-specs - ((sp-flt spt-fade-a -0.42666668)) + :init-specs ((sp-flt spt-fade-a -0.42666668)) ) (defpart 2272 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 1)) @@ -1072,8 +897,7 @@ ) (defpart 2273 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 1)) @@ -1093,16 +917,14 @@ ) (defstate snow-fort-gate-idle-closed (snow-fort-gate) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notice) (go snow-fort-gate-activate) ) ) ) - :trans - (behavior () + :trans (behavior () (when (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (level-hint-spawn (game-text-id snow-fort-reminder) @@ -1115,20 +937,12 @@ ) (none) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 2) :num! min) (set! (-> self root-override trans quad) (-> self closed-trans quad)) (transform-post) (suspend) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -1137,21 +951,18 @@ ) (defstate snow-fort-gate-activate (snow-fort-gate) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 #f)) - (while #t + (loop (let ((a1-0 (new 'stack-no-clear 'vector))) (set! (-> a1-0 quad) (-> self closed-trans quad)) (set! (-> a1-0 y) (+ -12288.0 (-> a1-0 y))) @@ -1171,7 +982,7 @@ ) ) (when (>= 1677.7216 f30-0) - (sound-play-by-name (static-sound-name "lodge-close") (new-sound-id) 1024 0 0 1 #t) + (sound-play "lodge-close") (activate! *camera-smush-control* 819.2 37 150 1.0 0.99) (go snow-fort-gate-idle-open) ) @@ -1192,26 +1003,17 @@ ) (none) ) - :post - (the-as (function none :behavior snow-fort-gate) transform-post) + :post (the-as (function none :behavior snow-fort-gate) transform-post) ) (defstate snow-fort-gate-idle-open (snow-fort-gate) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 2) :num! min) (set! (-> self root-override trans quad) (-> self open-trans quad)) (transform-post) (suspend) (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -1267,19 +1069,8 @@ (set! (-> obj closed-trans quad) (-> obj open-trans quad)) (set! (-> obj open-trans y) (+ -141312.0 (-> obj open-trans y))) (set! (-> obj open-trans z) (+ 32768.0 (-> obj open-trans z))) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "lodge-door-mov") - :volume #x400 - :fo-max 80 - ) - (-> obj open-trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "lodge-door-mov" :fo-max 80) (-> obj open-trans)) ) (ja-channel-push! 1 0) (let ((s5-1 (-> obj skel root-channel 0))) @@ -1323,25 +1114,21 @@ ) -(defskelgroup *snow-gears-sg* snow-gears - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 60) - :longest-edge (meters 12.1) - ) +(defskelgroup *snow-gears-sg* snow-gears snow-gears-lod0-jg snow-gears-idle-ja + ((snow-gears-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 60) + :longest-edge (meters 12.1) + ) (defpartgroup group-snow-gears-dripping :id 515 :flags (use-local-clock) :bounds (static-bspherem 0 -4 0 16) - :parts - ((sp-item 1900) (sp-item 1901)) + :parts ((sp-item 1900) (sp-item 1901)) ) (defpart 1900 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -9) (meters 18) 1.0) (sp-flt spt-y (meters -6)) @@ -1364,8 +1151,7 @@ ) (defpart 1901 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -7)) (sp-rnd-flt spt-scale-x (meters 3) (meters 4.5) 1.0) @@ -1390,16 +1176,14 @@ ) (defpart 1902 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 450 239 1) (sp-launcher-by-id spt-next-launcher 1903) ) ) (defpart 1903 - :init-specs - ((sp-flt spt-fade-a -0.14222223)) + :init-specs ((sp-flt spt-fade-a -0.14222223)) ) (defmethod TODO-RENAME-20 snow-gears ((obj snow-gears)) @@ -1412,8 +1196,7 @@ ) (defstate snow-gears-idle (snow-gears) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notice) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1422,18 +1205,10 @@ ) ) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 2) :num! min) (ja-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -1442,58 +1217,25 @@ ) (defstate snow-gears-activate (snow-gears) - :trans - (behavior () + :trans (behavior () (TODO-RENAME-20 self) (none) ) - :code - (behavior () - (sound-play-by-name (static-sound-name "eng-start-up") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 0.85) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :code (behavior () + (sound-play "eng-start-up") + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.85) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 0.85) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 0.35) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + (ja :num! (seek! max 0.85)) ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max 0.35) :frame-num 0.0) (until (ja-done? 0) (update! (-> self sound)) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 0.35) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.35)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 2) :num! min) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) (update! (-> self sound)) (suspend) @@ -1501,73 +1243,43 @@ (go snow-gears-halt) (none) ) - :post - (the-as (function none :behavior snow-gears) ja-post) + :post (the-as (function none :behavior snow-gears) ja-post) ) (defstate snow-gears-halt (snow-gears) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (none) ) - :trans - (behavior () + :trans (behavior () (TODO-RENAME-20 self) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 0.35) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max 0.35) :frame-num 0.0) (until (ja-done? 0) (update! (-> self sound)) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 0.35) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.35)) ) (stop! (-> self sound)) - (sound-play-by-name (static-sound-name "eng-shut-down") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 0.85) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (sound-play "eng-shut-down") + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek! max 0.85) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 0.85) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.85)) ) (go snow-gears-stopped) (none) ) - :post - (the-as (function none :behavior snow-gears) ja-post) + :post (the-as (function none :behavior snow-gears) ja-post) ) (defstate snow-gears-stopped (snow-gears) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -1580,19 +1292,8 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *snow-gears-sg* '()) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 515) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "snow-engine") - :volume #x400 - :fo-max #x12c - ) - (-> obj root trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "snow-engine" :fo-max 300) (-> obj root trans)) ) (go snow-gears-idle) (none) @@ -1616,13 +1317,10 @@ ) -(defskelgroup *snow-switch-sg* snow-switch - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *snow-switch-sg* snow-switch snow-switch-lod0-jg snow-switch-idle-ja + ((snow-switch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) (defbehavior snow-switch-event-handler snow-switch ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) @@ -1652,11 +1350,9 @@ ) (defstate snow-switch-idle-up (snow-switch) - :event - snow-switch-event-handler - :code - (behavior () - (while #t + :event snow-switch-event-handler + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -1665,24 +1361,20 @@ ) (defstate snow-switch-activate (snow-switch) - :event - snow-switch-event-handler - :exit - (behavior () + :event snow-switch-event-handler + :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (the-as (function none :behavior snow-switch) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior snow-switch) rider-trans) + :code (behavior () (local-vars (v1-1 symbol)) (until v1-1 (suspend) - (set! v1-1 (or (not *target*) (zero? (logand (-> *target* state-flags) 256)))) + (set! v1-1 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) ) - (sound-play-by-name (static-sound-name "prec-button1") (new-sound-id) 1024 -1524 0 1 #t) + (sound-play "prec-button1" :pitch -1) (let ((gp-1 (get-process *default-dead-pool* snowcam #x4000))) (set! (-> (the-as snowcam (-> (when gp-1 (let ((t9-3 (method-of-type snowcam activate))) @@ -1710,7 +1402,7 @@ ) 0 (let ((gp-2 #f)) - (while #t + (loop (let ((s5-1 (new 'stack-no-clear 'vector)) (f0-1 (+ -1433.6 (-> self orig-trans y))) ) @@ -1735,20 +1427,17 @@ ) (none) ) - :post - (the-as (function none :behavior snow-switch) rider-post) + :post (the-as (function none :behavior snow-switch) rider-post) ) (defstate snow-switch-idle-down (snow-switch) - :event - snow-switch-event-handler - :code - (behavior () + :event snow-switch-event-handler + :code (behavior () (set! (-> self pressed?) #t) (set! (-> self root-override trans quad) (-> self orig-trans quad)) (set! (-> self root-override trans y) (+ -1433.6 (-> self root-override trans y))) (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -1837,26 +1526,21 @@ ) -(defskelgroup *snow-log-sg* snow-log - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 5 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *snow-log-sg* snow-log snow-log-lod0-jg -1 + ((snow-log-lod0-mg (meters 999999))) + :bounds (static-spherem 0 5 0 9) + ) (defstate snow-log-wait-for-master (snow-log) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go snow-log-activate) ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (while (let ((v1-0 (-> self master))) (not (if v1-0 (-> v1-0 extra process) @@ -1873,19 +1557,14 @@ ) ) (when a0-1 - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 0) - (set! (-> a1-0 message) 'query) - (cond - ((send-event-function a0-1 a1-0) - (logclear! (-> self mask) (process-mask actor-pause)) - (process-entity-status! self (entity-perm-status bit-3) #t) - (go snow-log-active) - ) - (else - (go snow-log-hidden) - ) + (cond + ((send-event a0-1 'query) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-entity-status! self (entity-perm-status bit-3) #t) + (go snow-log-active) + ) + (else + (go snow-log-hidden) ) ) ) @@ -1896,8 +1575,7 @@ ) (defstate snow-log-hidden (snow-log) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1906,17 +1584,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (ja-channel-push! 1 0) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 2) :num! min) (transform-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -1926,122 +1596,74 @@ ) (defstate snow-log-activate (snow-log) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :trans - (the-as (function none :behavior snow-log) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior snow-log) rider-trans) + :code (behavior () (activate! *camera-smush-control* 819.2 37 150 1.0 0.99) (ja-channel-push! 1 0) (let ((gp-0 #f)) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (not gp-0) (>= (ja-frame-num 0) 5.0)) (set! gp-0 #t) - (sound-play-by-name (static-sound-name "explosion") (new-sound-id) 409 1371 0 1 #t) - (sound-play-by-name (static-sound-name "snow-spat-short") (new-sound-id) 1024 381 0 1 #t) + (sound-play "explosion" :vol 40 :pitch 0.9) + (sound-play "snow-spat-short" :pitch 0.25) ) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (go snow-log-active) (none) ) - :post - (the-as (function none :behavior snow-log) rider-post) + :post (the-as (function none :behavior snow-log) rider-post) ) (defstate snow-log-active (snow-log) - :trans - (the-as (function none :behavior snow-log) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior snow-log) rider-trans) + :code (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) (logclear! (-> self draw status) (draw-status hidden)) - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) (let ((gp-0 #t) (s5-0 #t) ) - (while #t - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 0.25) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.25) :frame-num 0.0) (until (ja-done? 0) (let ((f0-4 (ja-aframe-num 0))) (cond ((and gp-0 (< f0-4 1.0)) (set! gp-0 #f) (set! s5-0 #t) - (sound-play-by-name - (static-sound-name "snow-spat-long") - (new-sound-id) - 870 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-long" :vol 85 :pitch (rand-vu-float-range -0.2 0.2)) ) ((and s5-0 (>= f0-4 11.0)) (set! s5-0 #f) (set! gp-0 #t) - (sound-play-by-name - (static-sound-name "snow-spat-short") - (new-sound-id) - 870 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-short" :vol 85 :pitch (rand-vu-float-range -0.2 0.2)) ) ) ) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 0.25) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.25)) ) ) ) (none) ) - :post - (the-as (function none :behavior snow-log) rider-post) + :post (the-as (function none :behavior snow-log) rider-post) ) (defmethod init-from-entity! snow-log ((obj snow-log) (arg0 entity-actor)) @@ -2126,11 +1748,9 @@ ) (defstate snow-log-button-idle-up (snow-log-button) - :event - snow-log-button-event-handler - :code - (behavior () - (while #t + :event snow-log-button-event-handler + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -2139,20 +1759,16 @@ ) (defstate snow-log-button-activate (snow-log-button) - :event - snow-log-button-event-handler - :exit - (behavior () + :event snow-log-button-event-handler + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :trans - (the-as (function none :behavior snow-log-button) rider-trans) - :code - (behavior () - (sound-play-by-name (static-sound-name "prec-button1") (new-sound-id) 1024 0 0 1 #t) - (while #t + :trans (the-as (function none :behavior snow-log-button) rider-trans) + :code (behavior () + (sound-play "prec-button1") + (loop (let ((f30-0 (+ -1433.6 (-> self orig-trans y)))) (when (= (-> self root-override trans y) f30-0) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -2185,19 +1801,16 @@ ) (none) ) - :post - (the-as (function none :behavior snow-log-button) rider-post) + :post (the-as (function none :behavior snow-log-button) rider-post) ) (defstate snow-log-button-idle-down (snow-log-button) - :event - snow-log-button-event-handler - :code - (behavior () + :event snow-log-button-event-handler + :code (behavior () (set! (-> self root-override trans quad) (-> self orig-trans quad)) (set! (-> self root-override trans y) (+ -1433.6 (-> self root-override trans y))) (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) diff --git a/goal_src/levels/snow/snow-part.gc b/goal_src/levels/snow/snow-part.gc index 5deb9c5487..d0d1e59e20 100644 --- a/goal_src/levels/snow/snow-part.gc +++ b/goal_src/levels/snow/snow-part.gc @@ -19,8 +19,7 @@ (defpartgroup group-snow-snowdrops1 :id 528 :bounds (static-bspherem 0 -16 0 32) - :parts - ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 2700 :length 150) + :parts ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 2700 :length 150) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 2700 :length 100) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 2700 :length 60) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 2700 :length 30) @@ -41,8 +40,7 @@ (defpartgroup group-snow-snowdrops2 :id 529 :bounds (static-bspherem 0 -16 0 32) - :parts - ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3068 :length 150 :offset 900) + :parts ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3068 :length 150 :offset 900) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3068 :length 100 :offset 900) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3068 :length 60 :offset 900) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3068 :length 30 :offset 900) @@ -63,8 +61,7 @@ (defpartgroup group-snow-snowdrops3 :id 530 :bounds (static-bspherem 0 -16 0 32) - :parts - ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3345 :length 150 :offset 1800) + :parts ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3345 :length 150 :offset 1800) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3345 :length 100 :offset 1800) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3345 :length 60 :offset 1800) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3345 :length 30 :offset 1800) @@ -85,8 +82,7 @@ (defpartgroup group-snow-snowdrops4 :id 531 :bounds (static-bspherem 0 -16 0 32) - :parts - ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 4035 :length 150 :offset 300) + :parts ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 4035 :length 150 :offset 300) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 4035 :length 100 :offset 300) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 4035 :length 60 :offset 300) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 4035 :length 30 :offset 300) @@ -107,8 +103,7 @@ (defpartgroup group-snow-snowdrops5 :id 532 :bounds (static-bspherem 0 -16 0 32) - :parts - ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 5385 :length 150 :offset 1200) + :parts ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 5385 :length 150 :offset 1200) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 5385 :length 100 :offset 1200) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 5385 :length 60 :offset 1200) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 5385 :length 30 :offset 1200) @@ -129,8 +124,7 @@ (defpartgroup group-snow-snowdrops6 :id 533 :bounds (static-bspherem 0 -16 0 32) - :parts - ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 6129 :length 150 :offset 2100) + :parts ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 6129 :length 150 :offset 2100) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 6129 :length 100 :offset 2100) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 6129 :length 60 :offset 2100) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 6129 :length 30 :offset 2100) @@ -149,8 +143,7 @@ ) (defpart 1924 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) @@ -172,13 +165,11 @@ ) (defpart 1927 - :init-specs - ((sp-flt spt-fade-a -0.42666668)) + :init-specs ((sp-flt spt-fade-a -0.42666668)) ) (defpart 1925 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 1)) @@ -201,8 +192,7 @@ ) (defpart 1926 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 1)) @@ -224,8 +214,7 @@ (defpartgroup group-part-snow-torch :id 534 :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 2041 :fade-after (meters 200) :falloff-to (meters 220)) + :parts ((sp-item 2041 :fade-after (meters 200) :falloff-to (meters 220)) (sp-item 2042 :fade-after (meters 140) :falloff-to (meters 1400)) (sp-item 2043 :fade-after (meters 50) :falloff-to (meters 50) :period 600 :length 90) (sp-item 2044 :fade-after (meters 50) :falloff-to (meters 50) :period 369 :length 69) @@ -235,8 +224,7 @@ ) (defpart 2046 - :init-specs - ((sp-flt spt-num 0.3) + :init-specs ((sp-flt spt-num 0.3) (sp-flt spt-x (meters 0.2)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-int spt-rot-x 5) @@ -254,13 +242,11 @@ ) (defpart 2047 - :init-specs - ((sp-flt spt-fade-b -6.826667)) + :init-specs ((sp-flt spt-fade-b -6.826667)) ) (defpart 2041 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1069547520 1 1.0) (sp-rnd-flt spt-x (meters -0.35) (meters 0.7) 1.0) (sp-rnd-flt spt-z (meters -0.35) (meters 0.7) 1.0) @@ -282,13 +268,11 @@ ) (defpart 2048 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) (defpart 2043 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters 1)) @@ -311,8 +295,7 @@ ) (defpart 2044 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.2) (meters 0.6) 1.0) (sp-flt spt-y (meters 0.5)) @@ -335,8 +318,7 @@ ) (defpart 2045 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 0.2) 1.0) (sp-flt spt-y (meters 0.6)) @@ -359,8 +341,7 @@ ) (defpart 2042 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.3)) @@ -393,8 +374,7 @@ (defpartgroup group-snow-mountain-snow :id 535 :bounds (static-bspherem 0 -16 -32 80) :parts ((sp-item 2093))) (defpart 2093 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-rnd-flt spt-y (meters -30) (meters 20) 1.0) @@ -420,15 +400,13 @@ ) (defpart 2094 - :init-specs - ((sp-flt spt-fade-a -0.035555556)) + :init-specs ((sp-flt spt-fade-a -0.035555556)) ) (defpartgroup group-snow-door-torch :id 536 :bounds (static-bspherem 0 5 0 6) - :parts - ((sp-item 2113 :fade-after (meters 240) :falloff-to (meters 240)) + :parts ((sp-item 2113 :fade-after (meters 240) :falloff-to (meters 240)) (sp-item 2114 :fade-after (meters 40) :falloff-to (meters 40) :period 492 :length 60) (sp-item 2115 :fade-after (meters 240) :falloff-to (meters 240)) (sp-item 2116 :fade-after (meters 40) :falloff-to (meters 40) :period 369 :length 219) @@ -440,8 +418,7 @@ ) (defpart 2120 - :init-specs - ((sp-flt spt-num 0.6) + :init-specs ((sp-flt spt-num 0.6) (sp-rnd-flt spt-x (meters 0) (meters 2) 1.0) (sp-flt spt-y (meters 2)) (sp-int spt-rot-x 5) @@ -459,13 +436,11 @@ ) (defpart 2121 - :init-specs - ((sp-flt spt-fade-b -10.922667)) + :init-specs ((sp-flt spt-fade-b -10.922667)) ) (defpart 2113 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.75 0.6 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -492,8 +467,7 @@ ) (defpart 2114 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1058642330 1 1.3) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -520,8 +494,7 @@ ) (defpart 2115 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.6 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 1)) @@ -550,8 +523,7 @@ ) (defpart 2123 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.2 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 1)) @@ -580,8 +552,7 @@ ) (defpart 2122 - :init-specs - ((sp-flt spt-fade-g 0.26666668) + :init-specs ((sp-flt spt-fade-g 0.26666668) (sp-flt spt-fade-b 0.53333336) (sp-int spt-next-time 120) (sp-launcher-by-id spt-next-launcher 2124) @@ -589,13 +560,11 @@ ) (defpart 2124 - :init-specs - ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) (defpart 2116 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.6 0.7 1.0) (sp-rnd-flt spt-x (meters -1.2) (meters 2.4) 1.0) (sp-flt spt-y (meters 0.5)) @@ -622,8 +591,7 @@ ) (defpart 2117 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1056964608 1 0.9) (sp-rnd-flt spt-x (meters -1.2) (meters 1) 1.0) (sp-flt spt-y (meters 1.25)) @@ -650,8 +618,7 @@ ) (defpart 2118 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.75 1.2 1.0) (sp-rnd-flt spt-x (meters -1.2) (meters 2.4) 1.0) (sp-flt spt-y (meters 0.5)) @@ -678,8 +645,7 @@ ) (defpart 2119 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1060320051 1 1.6) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-flt spt-y (meters 1.25)) @@ -708,8 +674,7 @@ (defpartgroup group-snow-birds :id 537 :bounds (static-bspherem 0 8 0 45) - :parts - ((sp-item 2245 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 2243) + :parts ((sp-item 2245 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 2243) (sp-item 2245 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 2243) (sp-item 2245 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 2243) (sp-item 2245 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 2243) @@ -772,8 +737,7 @@ ) (defpart 2245 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-func spt-birth-func 'birth-func-random-next-time) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -70) (meters 140) 1.0) @@ -797,8 +761,7 @@ ) (defpart 2243 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-func spt-birth-func 'birth-func-copy-omega-to-z) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) @@ -823,8 +786,7 @@ ) (defpart 2246 - :init-specs - ((sp-flt spt-scale-x (meters 8)) + :init-specs ((sp-flt spt-scale-x (meters 8)) (sp-flt spt-scalevel-x (meters -0.08)) (sp-int spt-timer 600) (sp-int spt-next-time 100) @@ -833,8 +795,7 @@ ) (defpart 2247 - :init-specs - ((sp-flt spt-scale-x (meters 0)) + :init-specs ((sp-flt spt-scale-x (meters 0)) (sp-flt spt-scalevel-x (meters -0.04)) (sp-int spt-timer 600) (sp-int spt-next-time 199) @@ -843,8 +804,7 @@ ) (defpart 2244 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-func spt-birth-func 'birth-func-copy2-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 4)) diff --git a/goal_src/levels/snow/snow-ram-boss.gc b/goal_src/levels/snow/snow-ram-boss.gc index 156127b702..5c363ad4d3 100644 --- a/goal_src/levels/snow/snow-ram-boss.gc +++ b/goal_src/levels/snow/snow-ram-boss.gc @@ -9,6 +9,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/ram-boss-ag.gc") + (deftype ram-boss-proj (projectile) ((parent-override (pointer ram-boss) :offset 12) (part2 sparticle-launch-control :offset-assert 412) @@ -72,13 +74,11 @@ ) -(defskelgroup *ram-boss-sg* ram-boss - 0 - 13 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 4.4) - :longest-edge (meters 1.2) - ) +(defskelgroup *ram-boss-sg* ram-boss ram-boss-lod0-jg ram-boss-far-idle-ja + ((ram-boss-lod0-mg (meters 20)) (ram-boss-lod1-mg (meters 40)) (ram-boss-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 4.4) + :longest-edge (meters 1.2) + ) (define *ram-boss-nav-enemy-info* (new 'static 'nav-enemy-info :idle-anim 13 @@ -127,7 +127,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -180,7 +180,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -190,13 +190,11 @@ :id 521 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1904) (sp-item 1905) (sp-item 2487)) + :parts ((sp-item 1904) (sp-item 1905) (sp-item 2487)) ) (defpart 2487 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -215,8 +213,7 @@ ) (defpart 1904 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -238,8 +235,7 @@ ) (defpart 1905 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -261,8 +257,7 @@ :id 522 :duration 300 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 1910 :flags (launch-asap) :binding 1908) + :parts ((sp-item 1910 :flags (launch-asap) :binding 1908) (sp-item 1908 :flags (start-dead) :binding 1909) (sp-item 1909 :flags (start-dead launch-asap)) (sp-item 1909 :flags (start-dead launch-asap)) @@ -314,8 +309,7 @@ ) (defpart 1910 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.01)) (sp-copy-from-other spt-scale-y -4) @@ -327,8 +321,7 @@ ) (defpart 1908 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -353,13 +346,11 @@ ) (defpart 1912 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) (defpart 1909 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 5.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -391,13 +382,11 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1914) (sp-item 1915) (sp-item 1916)) + :parts ((sp-item 1914) (sp-item 1915) (sp-item 1916)) ) (defpart 1914 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 64.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -422,8 +411,7 @@ ) (defpart 1916 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -447,8 +435,7 @@ ) (defpart 1915 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -468,8 +455,7 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1914)) + :parts ((sp-item 1914)) ) (defmethod dummy-24 ram-boss-proj ((obj ram-boss-proj)) @@ -490,7 +476,7 @@ (the-as vector #f) f0-9 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -512,7 +498,7 @@ ) (sound-trans-convert (-> s5-0 parms trans) a1-4) ) - (set! (-> s5-0 parms mask) (the-as uint 32)) + (set! (-> s5-0 parms mask) (sound-mask trans)) (-> s5-0 id) ) (none) @@ -527,7 +513,7 @@ (s4-0 (new 'stack-no-clear 'vector)) (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0)) ) - (if (logtest? (-> arg0 root-override status) 4) + (if (logtest? (-> arg0 root-override status) (cshape-moving-flags tsurf)) (vector-flatten! s3-1 s3-1 (-> arg0 root-override local-normal)) ) (vector-normalize-copy! s4-0 s3-1 1.0) @@ -594,7 +580,7 @@ (set! (-> obj attack-mode) 'snow-ram-proj) (set! (-> obj launch-time) (-> *display* base-frame-counter)) (set! (-> obj timeout) (seconds 4)) - (set! (-> obj sound-id) (sound-play-by-name (static-sound-name "ramboss-track") (new-sound-id) 1024 0 0 1 #t)) + (set! (-> obj sound-id) (sound-play "ramboss-track")) (let ((v1-12 (-> obj parent-override))) (set! (-> v1-12 0 proj-stoked) #t) (set! (-> v1-12 0 proj-status) (the-as uint 1)) @@ -618,7 +604,12 @@ ) (defmethod dummy-28 ram-boss-proj ((obj ram-boss-proj)) - (when (and *target* (zero? (logand (-> *target* state-flags) #x80f8))) + (when (and *target* + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + ) (let ((gp-0 (-> obj target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) (set! (-> gp-0 y) (+ 4915.2 (-> gp-0 y))) @@ -640,8 +631,7 @@ ) (defstate ram-boss-proj-growing (ram-boss-proj) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('launch) (let ((v1-1 (-> self parent-override))) @@ -653,12 +643,9 @@ ) ) ) - :code - (behavior () - (set! (-> self charge-sound-id) - (sound-play-by-name (static-sound-name "ramboss-charge") (new-sound-id) 1024 0 0 1 #t) - ) - (while #t + :code (behavior () + (set! (-> self charge-sound-id) (sound-play "ramboss-charge")) + (loop (let ((gp-1 (-> self parent-override))) (when (-> gp-1 0 dead?) (set! (-> gp-1 0 proj-stoked) #f) @@ -699,9 +686,8 @@ ) (defstate ram-boss-proj-launch (ram-boss-proj) - :code - (behavior () - (sound-play-by-name (static-sound-name "ramboss-fire") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (sound-play "ramboss-fire") (set! (-> self launched?) #t) (set! (-> self growth) 1.0) (logior! (-> self root-override root-prim prim-core action) (collide-action solid)) @@ -717,30 +703,22 @@ (defstate projectile-impact (ram-boss-proj) :virtual #t - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 523) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 523) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "ramboss-hit") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ramboss-hit") (suspend) (go-virtual projectile-die) (none) @@ -749,25 +727,17 @@ (defstate projectile-dissipate (ram-boss-proj) :virtual #t - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 524) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 524) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) @@ -782,13 +752,11 @@ :id 525 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1919)) + :parts ((sp-item 1919)) ) (defpart 1919 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -816,13 +784,11 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2367) (sp-item 2368) (sp-item 2369)) + :parts ((sp-item 2367) (sp-item 2368) (sp-item 2369)) ) (defpart 2367 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -846,8 +812,7 @@ ) (defpart 2368 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -871,8 +836,7 @@ ) (defpart 2369 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -901,76 +865,38 @@ (('attack 'bonk 'roll) (cond ((-> self has-shield?) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'powerup)) - (set! (-> a1-3 param 1) (the-as uint 2)) - (cond - ((send-event-function *target* a1-3) - (nav-enemy-set-hit-from-direction arg0) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'shove) - (set! (-> a1-4 param 0) (the-as uint #f)) - (let ((v1-9 (new 'static 'attack-info :mask #x40))) - (set! (-> v1-9 shove-back) 8192.0) - (set! (-> a1-4 param 1) (the-as uint v1-9)) + (cond + ((send-event *target* 'query 'powerup (pickup-type eco-red)) + (nav-enemy-set-hit-from-direction arg0) + (send-event arg0 'shove #f (static-attack-info ((shove-back (meters 2))))) + (go ram-boss-lose-shield) + (return #t) + v0-4 + ) + ((begin + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))) + (do-push-aways! (-> self collide-info)) ) - (send-event-function arg0 a1-4) + (level-hint-spawn + (game-text-id ram-boss-red-eco-hint) + "sksp0346" + (the-as entity #f) + *entity-pool* + (game-task none) ) - (go ram-boss-lose-shield) - (return #t) - v0-4 + (>= (- (-> (target-pos 0) y) (-> self collide-info trans y)) 9420.8) ) - ((begin - (if (zero? (logand (-> self nav-enemy-flags) 256)) - (do-push-aways! (-> self collide-info)) - ) - (level-hint-spawn - (game-text-id ram-boss-red-eco-hint) - "sksp0346" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (>= (- (-> (target-pos 0) y) (-> self collide-info trans y)) 9420.8) - ) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'shove) - (set! (-> a1-6 param 0) (the-as uint #f)) - (let ((v1-22 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-22 shove-back) 16384.0) - (set! (-> v1-22 shove-up) 8192.0) - (set! (-> a1-6 param 1) (the-as uint v1-22)) - ) - (send-event-function arg0 a1-6) - ) - (go ram-boss-up-defend-block) - (return #t) - v0-4 - ) - (else - (when (= arg2 'attack) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'shove) - (set! (-> a1-7 param 0) (the-as uint #f)) - (let ((v1-30 (new 'static 'attack-info :mask #x40))) - (set! (-> v1-30 shove-back) 16384.0) - (set! (-> a1-7 param 1) (the-as uint v1-30)) - ) - (send-event-function arg0 a1-7) - ) - (go ram-boss-forward-defend-block) - (return #t) - v0-4 - ) + (send-event arg0 'shove #f (static-attack-info ((shove-back (meters 4)) (shove-up (meters 2))))) + (go ram-boss-up-defend-block) + (return #t) + v0-4 + ) + (else + (when (= arg2 'attack) + (send-event arg0 'shove #f (static-attack-info ((shove-back (meters 4))))) + (go ram-boss-forward-defend-block) + (return #t) + v0-4 ) ) ) @@ -983,24 +909,18 @@ ) ) (('touch) - (if (zero? (logand (-> self nav-enemy-flags) 256)) + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))) (do-push-aways! (-> self collide-info)) ) (cond ((-> self has-shield?) (cond ((>= (- (-> (target-pos 0) y) (-> self collide-info trans y)) 9420.8) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) self) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'shove) - (set! (-> a1-8 param 0) (-> arg3 param 0)) - (let ((v1-49 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-49 shove-back) 16384.0) - (set! (-> v1-49 shove-up) 8192.0) - (set! (-> a1-8 param 1) (the-as uint v1-49)) - ) - (send-event-function arg0 a1-8) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-back (meters 4)) (shove-up (meters 2)))) ) (go ram-boss-up-defend-block) (return #t) @@ -1008,17 +928,7 @@ ) (else (when (= arg2 'attack) - (let ((a1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-9 from) self) - (set! (-> a1-9 num-params) 2) - (set! (-> a1-9 message) 'shove) - (set! (-> a1-9 param 0) (-> arg3 param 0)) - (let ((v1-58 (new 'static 'attack-info :mask #x40))) - (set! (-> v1-58 shove-back) 16384.0) - (set! (-> a1-9 param 1) (the-as uint v1-58)) - ) - (send-event-function arg0 a1-9) - ) + (send-event arg0 'shove (-> arg3 param 0) (static-attack-info ((shove-back (meters 4))))) (go ram-boss-forward-defend-block) (return #t) v0-4 @@ -1233,7 +1143,7 @@ ) (else (ja-post) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go ram-boss-idle) ) ) @@ -1270,7 +1180,7 @@ (collide-kind background cak-2 ground-object) obj t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -1308,24 +1218,18 @@ (set! (-> obj proj-stoked) #t) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (the-as uint128 0)) - (let* ((s4-0 (the-as ram-boss-proj (get-process *default-dead-pool* ram-boss-proj #x4000))) - (v1-9 (when s4-0 - (let ((t9-1 (method-of-type ram-boss-proj activate))) - (t9-1 s4-0 obj 'ram-boss-proj (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-0 - projectile-init-by-other - (-> obj entity) - (-> obj collide-info trans) - s5-0 - 0 - (process->handle *target*) - ) - (-> s4-0 ppointer) - ) - ) - ) + (let ((v1-9 (process-spawn + ram-boss-proj + :init projectile-init-by-other + (-> obj entity) + (-> obj collide-info trans) + s5-0 + 0 + (process->handle *target*) + :to obj + ) + ) + ) (set! (-> (the-as (pointer ram-boss-proj) v1-9) 0 notify-handle) (process->handle obj)) ) ) @@ -1340,23 +1244,19 @@ ) (defstate ram-boss-show-anims (ram-boss) - :trans - (behavior () + :trans (behavior () 0 (none) ) - :code - (behavior () + :code (behavior () 0 (none) ) - :post - (the-as (function none :behavior ram-boss) transform-post) + :post (the-as (function none :behavior ram-boss) transform-post) ) (defstate ram-boss-idle (ram-boss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('jump) (go ram-boss-jump-down arg0) @@ -1366,17 +1266,15 @@ ) ) ) - :enter - (behavior () + :enter (behavior () ((-> (method-of-type nav-enemy nav-enemy-idle) enter)) (set! (-> self frustration) 0) 0 (none) ) - :code - (behavior () - (logior! (-> self nav-enemy-flags) 4) - (while #t + :code (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) + (loop (clone-anim-once (ppointer->handle (-> self parent-override)) (the-as int (-> self draw origin-joint-index)) @@ -1404,18 +1302,16 @@ ) (defstate ram-boss-jump-down (ram-boss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 'generic) ) ) ) - :enter - (behavior ((arg0 basic)) + :enter (behavior ((arg0 basic)) (dummy-52 self) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (-> self node-list data 0 bone transform)) ) @@ -1441,8 +1337,7 @@ (set! (-> self collide-info transv y) 102400.0) (none) ) - :trans - (behavior () + :trans (behavior () (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) @@ -1453,23 +1348,14 @@ #f #f ) - (if (logtest? (-> self collide-info status) 1) + (if (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)) (go ram-boss-jump-down-hit-ground) ) (none) ) - :code - (behavior ((arg0 basic)) - (ja-channel-push! 1 240) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + :code (behavior ((arg0 basic)) + (ja-channel-push! 1 (seconds 0.8)) + (ja-no-eval :group! (-> self draw art-group data 16) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 (target-pos 0) (-> self collide-info trans)) @@ -1477,57 +1363,36 @@ (seek-toward-heading-vec! (-> self collide-info) gp-0 182044.44 (seconds 0.01)) ) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior ram-boss) nav-enemy-simple-post) + :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) (defstate ram-boss-jump-down-hit-ground (ram-boss) - :event - (-> ram-boss-jump-down event) - :code - (behavior () - (logior! (-> self nav-enemy-flags) 4) + :event (-> ram-boss-jump-down event) + :code (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (activate! *camera-smush-control* 409.6 37 150 1.0 0.99) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 17) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go ram-boss-nav-start) (none) ) - :post - (the-as (function none :behavior ram-boss) nav-enemy-simple-post) + :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) (defstate ram-boss-already-down (ram-boss) - :code - (behavior ((arg0 basic)) - (logior! (-> self nav-enemy-flags) 4) + :code (behavior ((arg0 basic)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (dummy-52 self) (let ((a1-0 (new 'stack-no-clear 'vector)) (a2-0 (-> self parent-override 0 node-list data 0 bone transform)) @@ -1547,8 +1412,7 @@ ) (defstate ram-boss-nav-start (ram-boss) - :code - (behavior () + :code (behavior () (let ((a1-1 (dummy-16 (-> self nav) (-> self collide-info trans)))) (when (not a1-1) (go process-drawable-art-error "not on nav mesh") @@ -1562,8 +1426,7 @@ ) (defstate ram-boss-nav-resume (ram-boss) - :code - (behavior () + :code (behavior () (set! (-> self frustration) 0) (when *target* (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans)))) @@ -1593,18 +1456,15 @@ (defstate nav-enemy-patrol (ram-boss) :virtual #t - :event - ram-boss-on-ground-event-handler - :enter - (behavior () + :event ram-boss-on-ground-event-handler + :enter (behavior () ((-> (method-of-type nav-enemy nav-enemy-patrol) enter)) (set! (-> self state-timeout) (-> self nav-enemy-patrol-timeout)) (set! (-> self nav-enemy-patrol-timeout) (seconds 1)) - (ja-channel-push! 1 90) + (ja-channel-push! 1 (seconds 0.3)) (none) ) - :trans - (behavior () + :trans (behavior () (when *target* (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans)))) (if (>= 18432.0 f0-0) @@ -1619,10 +1479,8 @@ (defstate nav-enemy-chase (ram-boss) :virtual #t - :event - ram-boss-on-ground-event-handler - :enter - (behavior () + :event ram-boss-on-ground-event-handler + :enter (behavior () (let ((t9-0 (-> (method-of-type nav-enemy nav-enemy-chase) enter))) (if t9-0 (t9-0) @@ -1630,8 +1488,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans)))) (if (>= 18432.0 f30-0) (go ram-boss-tracking) @@ -1646,7 +1503,7 @@ ) ) (cond - ((logtest? (nav-control-flags bit17) (-> self nav flags)) + ((logtest? (nav-control-flags navcf17) (-> self nav flags)) (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 1)) (go-virtual nav-enemy-patrol) ) @@ -1662,12 +1519,9 @@ (defstate nav-enemy-attack (ram-boss) :virtual #t - :event - ram-boss-on-ground-event-handler - :trans - (the-as (function none :behavior ram-boss) #f) - :code - (behavior () + :event ram-boss-on-ground-event-handler + :trans (the-as (function none :behavior ram-boss) #f) + :code (behavior () (go ram-boss-tracking) (none) ) @@ -1699,17 +1553,14 @@ ) (defstate ram-boss-tracking (ram-boss) - :event - ram-boss-on-ground-event-handler - :enter - (behavior () + :event ram-boss-on-ground-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self facing-y) (quaternion-y-angle (-> self collide-info quat))) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) - :trans - (behavior () + :trans (behavior () (set-jump-height-factor! self (the-as int (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.75))) @@ -1762,7 +1613,10 @@ ) ) (when (and (= (-> self proj-status) 2) - (zero? (logand (-> *target* state-flags) #x80f8)) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) ) (let ((gp-2 (new 'stack-no-clear 'vector)) @@ -1781,219 +1635,108 @@ 0 (none) ) - :code - (behavior () + :code (behavior () (let ((f30-0 -1.0)) - (while #t + (loop (set! f30-0 (dummy-57 self f30-0)) (cond ((< 5461.3335 (-> self last-turn-speed)) (cond ((-> self has-shield?) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - ) - (ja-channel-push! 2 60) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 7)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-7 (-> self skel root-channel 1))) - (set! (-> a0-7 frame-interp) f30-0) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 22))) - (set! (-> a0-7 param 0) 0.0) - (joint-control-channel-group-eval! - a0-7 - (the-as art-joint-anim (-> self draw art-group data 22)) - num-func-chan - ) - ) + (when (not (ja-group? (-> self draw art-group data 7))) + (ja-channel-push! 2 (seconds 0.2)) + (ja :group! (-> self draw art-group data 7) :num! min) + (ja :chan 1 :group! (-> self draw art-group data 22) :num! (chan 0) :frame-interp f30-0) ) ) (else - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 20) - ) - ) - (ja-channel-push! 1 60) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 20)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (when (not (ja-group? (-> self draw art-group data 20))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 20) :num! min) ) ) ) ) ((-> self has-shield?) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 2 60) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) - (let ((a0-20 (-> self skel root-channel 1))) - (set! (-> a0-20 frame-interp) f30-0) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 21))) - (set! (-> a0-20 param 0) 0.0) - (joint-control-channel-group-eval! - a0-20 - (the-as art-joint-anim (-> self draw art-group data 21)) - num-func-chan - ) - ) + (when (not (ja-group? (-> self draw art-group data 6))) + (ja-channel-push! 2 (seconds 0.2)) + (ja :group! (-> self draw art-group data 6) :num! min) + (ja :chan 1 :group! (-> self draw art-group data 21) :num! (chan 0) :frame-interp f30-0) ) ) (else - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 24) - ) - ) - (ja-channel-push! 1 60) - (let ((gp-3 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-3 - (the-as art-joint-anim (-> self draw art-group data 24)) - num-func-identity - ) - (set! (-> gp-3 frame-num) 0.0) - ) + (when (not (ja-group? (-> self draw art-group data 24))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 24) :num! min) ) ) ) (suspend) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) 1.0) - (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-loop!) - ) - (when (= (ja-group-size) 2) - (let ((a0-28 (-> self skel root-channel 1))) - (set! (-> a0-28 frame-interp) f30-0) - (set! (-> a0-28 param 0) 0.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-chan) + (ja :num! (loop!)) + (if (= (ja-group-size) 2) + (ja :chan 1 :num! (chan 0) :frame-interp f30-0) ) - ) ) ) (none) ) - :post - (the-as (function none :behavior ram-boss) nav-enemy-simple-post) + :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) (defstate ram-boss-forward-defend-block (ram-boss) - :enter - (behavior () + :enter (behavior () (set! (-> self frustration) 0) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) - :trans - (behavior () + :trans (behavior () (set-jump-height-factor! self (the-as int #t)) 0 (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ram-boss-tracking) (none) ) - :post - (the-as (function none :behavior ram-boss) nav-enemy-simple-post) + :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) (defstate ram-boss-up-defend-block (ram-boss) - :enter - (behavior () + :enter (behavior () (set! (-> self frustration) 0) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) - :trans - (behavior () + :trans (behavior () (set-jump-height-factor! self (the-as int #t)) 0 (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 9) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ram-boss-tracking) (none) ) - :post - (the-as (function none :behavior ram-boss) nav-enemy-simple-post) + :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) (defstate nav-enemy-victory (ram-boss) :virtual #t - :event - ram-boss-on-ground-event-handler - :enter - (the-as (function none :behavior ram-boss) #f) - :exit - (the-as (function none :behavior ram-boss) #f) - :trans - (behavior () + :event ram-boss-on-ground-event-handler + :enter (the-as (function none :behavior ram-boss) #f) + :exit (the-as (function none :behavior ram-boss) #f) + :trans (behavior () (when *target* (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans)))) (if (and (>= 18432.0 f0-0) (-> self has-shield?)) @@ -2003,63 +1746,38 @@ ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self frustration) 0) - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - ) - (set! (-> a0-2 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) data 0 length) - -1 - ) - ) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info victory-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (go-virtual nav-enemy-attack) (none) ) - :post - (the-as (function none :behavior ram-boss) nav-enemy-simple-post) + :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) (defstate nav-enemy-stare (ram-boss) :virtual #t - :event - ram-boss-on-ground-event-handler - :enter - (behavior () + :event ram-boss-on-ground-event-handler + :enter (behavior () (go ram-boss-nav-resume) (none) ) ) (defstate ram-boss-throw (ram-boss) - :event - ram-boss-on-ground-event-handler - :enter - (behavior () - (logior! (-> self nav-enemy-flags) 4) + :event ram-boss-on-ground-event-handler + :enter (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (let ((gp-0 (-> self child))) (while gp-0 (send-event (ppointer->process gp-0) 'launch) @@ -2069,73 +1787,44 @@ (set! (-> self proj-last-thrown-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (set-jump-height-factor! self (the-as int #t)) 0 (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (cond ((-> self has-shield?) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 23))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 23)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 23)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 23) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go ram-boss-tracking) (none) ) - :post - (the-as (function none :behavior ram-boss) nav-enemy-simple-post) + :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) (defstate ram-boss-lose-shield (ram-boss) - :enter - (behavior () - (logior! (-> self nav-enemy-flags) 4) + :enter (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-neck-control-inactive) (dummy-53 self) (TODO-RENAME-49 self *ram-boss-nav-enemy-info-no-shield*) (none) ) - :exit - (behavior () + :exit (behavior () (nav-enemy-neck-control-look-at) (set! (-> self has-shield?) #f) (let ((v1-2 (-> self entity extra perm))) @@ -2148,45 +1837,31 @@ ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-normalize-copy! gp-0 (-> self hit-from-dir) 16384.0) (vector+! gp-0 (-> self collide-info trans) gp-0) (set! (-> self nav target-pos quad) (-> gp-0 quad)) ) - (ja-channel-push! 1 30) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 18))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 18)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 18)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 18) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((gp-1 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-1 (-> self node-list data 32)) (spawn (-> self part) gp-1) ) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ram-boss-tracking) (none) ) - :post - (behavior () - (TODO-RENAME-9 (-> self align)) + :post (behavior () + (compute-alignment! (-> self align)) (dummy-11 (-> self nav) (-> self nav target-pos)) - (TODO-RENAME-11 + (align-vel-and-quat-only! (-> self align) - 4 + (align-opts adjust-xz-vel) (-> self nav travel) (the-as int 1.0) 1.0 @@ -2196,7 +1871,7 @@ (-> self collide-info transv) (compute-acc-due-to-gravity (-> self collide-info) (new-stack-vector0) 0.0) ) - (TODO-RENAME-10 (-> self align) 16 1.0 1.0 1.0) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) @@ -2213,9 +1888,8 @@ (defstate nav-enemy-die (ram-boss) :virtual #t - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (clear-collide-with-as (-> self collide-info)) (nav-enemy-fall-and-play-death-anim (the-as art-joint-anim (-> self draw art-group data (-> self nav-info die-anim))) diff --git a/goal_src/levels/snow/snow-ram.gc b/goal_src/levels/snow/snow-ram.gc index 01c780d737..68abde7133 100644 --- a/goal_src/levels/snow/snow-ram.gc +++ b/goal_src/levels/snow/snow-ram.gc @@ -7,25 +7,23 @@ ;; DECOMP BEGINS -(defskelgroup *ram-sg* ram - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 5 0 8.5) - :longest-edge (meters 7.7) - ) +(import "goal_src/import/ram-ag.gc") + +(defskelgroup *ram-sg* ram ram-lod0-jg ram-cock-ja + ((ram-lod0-mg (meters 20)) (ram-lod1-mg (meters 40)) (ram-lod2-mg (meters 999999))) + :bounds (static-spherem 0 5 0 8.5) + :longest-edge (meters 7.7) + ) (defpartgroup group-ram-hit-wall :id 526 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1921) (sp-item 1922 :fade-after (meters 60) :falloff-to (meters 60))) + :parts ((sp-item 1921) (sp-item 1922 :fade-after (meters 60) :falloff-to (meters 60))) ) (defpart 1920 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 64.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -46,8 +44,7 @@ ) (defpart 1922 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -69,8 +66,7 @@ ) (defpart 1921 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -89,13 +85,11 @@ :id 527 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1923 :fade-after (meters 70) :falloff-to (meters 70))) + :parts ((sp-item 1923 :fade-after (meters 70) :falloff-to (meters 70))) ) (defpart 1923 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) @@ -186,79 +180,49 @@ ) (defstate ram-idle (ram) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) - (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self root-override) - (the-as uint 1) - ) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((v1-7 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-7 shove-up) 2048.0) - (set! (-> v1-7 shove-back) 8192.0) - (set! (-> a1-3 param 1) (the-as uint v1-7)) + (if ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self root-override) + (the-as uint 1) + ) + (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 0.5)) (shove-back (meters 2)))) ) - (send-event-function arg0 a1-3) ) - ) ) ) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (if (-> self give-fuel-cell-anim) (spool-push *art-control* (-> self give-fuel-cell-anim name) 0 self -99.0) ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (sv-16 symbol)) - (ja-channel-push! 1 22) - (while #t - (sound-play-by-name (static-sound-name "set-ram") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (loop + (sound-play "set-ram") + (ja-no-eval :group! ram-cock-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-1 #f)) - (sound-play-by-name (static-sound-name "slam-crash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "slam-crash") (logclear! (-> self mask) (process-mask actor-pause)) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! ram-release-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f30-0 (ja-aframe-num 0))) (when (and (not gp-1) (>= f30-0 61.0)) @@ -270,11 +234,7 @@ ) ) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (logior! (-> self mask) (process-mask actor-pause)) @@ -291,13 +251,11 @@ ) (none) ) - :post - (the-as (function none :behavior ram) rider-post) + :post (the-as (function none :behavior ram) rider-post) ) (defstate ram-fun-idle (ram) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notify) (when (= (-> arg0 type) ram-boss) @@ -308,27 +266,18 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (-> self give-fuel-cell-anim) (spool-push *art-control* (-> self give-fuel-cell-anim name) 0 self -99.0) ) (none) ) - :code - (behavior () + :code (behavior () (if (-> self give-fuel-cell?) (go ram-give-fuel-cell) ) (ja-channel-push! 1 0) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! ram-idle-ja :num! min) (transform-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -338,8 +287,7 @@ ) (defstate ram-give-fuel-cell (ram) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notify) (if (and (= (-> arg0 type) snowcam) (= (-> arg3 param 0) 'die)) @@ -348,50 +296,35 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self give-fuel-cell?) #f) (ja-channel-push! 1 0) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! ram-idle-ja :num! min) (transform-post) (when (and (not (task-complete? *game-info* (-> self entity extra perm task))) (-> self give-fuel-cell-anim)) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) - (let* ((gp-1 (the-as snowcam (get-process *default-dead-pool* snowcam #x4000))) - (v1-14 (when gp-1 - (let ((t9-6 (method-of-type snowcam activate))) - (t9-6 gp-1 self 'snowcam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (-> self root-override trans) - *snowcam-sg* - (-> self give-fuel-cell-anim) - 0 - self - '() - ) - (-> gp-1 ppointer) - ) - ) - ) + (let ((v1-14 (process-spawn + snowcam + :init pov-camera-init-by-other + (-> self root-override trans) + *snowcam-sg* + (-> self give-fuel-cell-anim) + 0 + self + '() + :to self + ) + ) + ) (set! (-> (the-as (pointer snowcam) v1-14) 0 seq) (the-as uint 1)) ) - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -523,27 +456,11 @@ ((and (not s3-1) (has-nav-mesh? arg0)) (cond (s4-1 - (let ((s5-1 (get-process *default-dead-pool* ram-boss #x4000))) - (when s5-1 - (let ((t9-28 (method-of-type ram-boss activate))) - (t9-28 (the-as ram-boss s5-1) obj 'ram-boss (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 ram-boss-init-by-other (-> obj entity) obj #t) - (-> s5-1 ppointer) - ) - ) + (process-spawn ram-boss (-> obj entity) obj #t :to obj) (go ram-fun-idle) ) (else - (let ((s5-2 (get-process *default-dead-pool* ram-boss #x4000))) - (when s5-2 - (let ((t9-32 (method-of-type ram-boss activate))) - (t9-32 (the-as ram-boss s5-2) obj 'ram-boss (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 ram-boss-init-by-other (-> obj entity) obj #f) - (-> s5-2 ppointer) - ) - ) + (process-spawn ram-boss (-> obj entity) obj #f :to obj) (go ram-idle) ) ) diff --git a/goal_src/levels/snow/target-ice.gc b/goal_src/levels/snow/target-ice.gc index fbcc690741..f0503eeea8 100644 --- a/goal_src/levels/snow/target-ice.gc +++ b/goal_src/levels/snow/target-ice.gc @@ -8,17 +8,13 @@ ;; DECOMP BEGINS (defstate target-ice-stance (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () (set! (-> self control unknown-surface00) *walk-mods*) (none) ) - :exit - target-state-hook-exit - :trans - (behavior () + :exit target-state-hook-exit + :trans (behavior () ((-> self state-hook)) (if (!= (-> self control ground-pat material) (pat-material ice)) (go target-stance) @@ -60,212 +56,80 @@ (fall-test) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 60)) - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-2 (ja-group))) (cond ((or (= v1-2 (-> self draw art-group data 34)) (= v1-2 (-> self draw art-group data 38))) (set! gp-0 21) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 71) - ) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 72))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 72)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 72)) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 71)) + (ja-no-eval :group! (-> self draw art-group data 72) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 51) - ) + ((ja-group? (-> self draw art-group data 51)) (cond ((rand-vu-percent? 0.3) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 53))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 53)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 53)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 53) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 52))) - (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 52)) data 0 length) -1)) - ) - (set! (-> a0-22 param 1) 1.0) - (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 52)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 52) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) 1.0) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 78) - ) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> self draw art-group data 79))) - (set! (-> a0-29 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 79)) data 0 length) -1)) - ) - (set! (-> a0-29 param 1) 1.0) - (set! (-> a0-29 frame-num) 0.0) - (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> self draw art-group data 79)) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 78)) + (ja-no-eval :group! (-> self draw art-group data 79) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 param 0) (the float (+ (-> a0-30 frame-group data 0 length) -1))) - (set! (-> a0-30 param 1) 1.0) - (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 84) - ) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 frame-group) (the-as art-joint-anim (-> self draw art-group data 85))) - (set! (-> a0-36 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 85)) data 0 length) -1)) - ) - (set! (-> a0-36 param 1) 1.0) - (set! (-> a0-36 frame-num) 0.0) - (joint-control-channel-group! a0-36 (the-as art-joint-anim (-> self draw art-group data 85)) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 84)) + (ja-no-eval :group! (-> self draw art-group data 85) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 param 0) (the float (+ (-> a0-37 frame-group data 0 length) -1))) - (set! (-> a0-37 param 1) 1.0) - (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! gp-0 0) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 59) - ) + ((ja-group? (-> self draw art-group data 59)) (set! (-> self control unknown-float81) (-> self control unknown-float80)) (set! (-> self control unknown-surface00) *walk-no-turn-mods*) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (if (rand-vu-percent? 0.3) - (-> self draw art-group data 61) - (-> self draw art-group data 60) - ) - ) - ) - (set! (-> s5-0 param 0) (the float (+ (-> (the-as art-joint-anim (if (rand-vu-percent? 0.3) - (-> self draw art-group data 61) - (-> self draw art-group data 60) - ) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> s5-0 param 1) 1.0) - (set! (-> s5-0 frame-num) 0.0) - (joint-control-channel-group! - s5-0 - (the-as art-joint-anim (if (rand-vu-percent? 0.3) - (-> self draw art-group data 61) - (-> self draw art-group data 60) - ) + (ja-no-eval :group! (if (rand-vu-percent? 0.3) + (-> self draw art-group data 61) + (-> self draw art-group data 60) + ) + :num! (seek!) + :frame-num 0.0 ) - num-func-seek! - ) - ) (until (ja-done? 0) - (set! (-> self control unknown-float81) - (seek (-> self control unknown-float81) 0.0 (-> *display* seconds-per-frame)) - ) + (seek! (-> self control unknown-float81) 0.0 (-> *display* seconds-per-frame)) (suspend) - (let ((a0-49 (-> self skel root-channel 0))) - (set! (-> a0-49 param 0) (the float (+ (-> a0-49 frame-group data 0 length) -1))) - (set! (-> a0-49 param 1) 1.0) - (joint-control-channel-group-eval! a0-49 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self control unknown-surface00) *walk-mods*) (set! (-> self control unknown-float81) 0.0) (rot->dir-targ! (-> self control)) ) - ((let ((v1-188 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + ((let ((v1-188 (ja-group))) (or (= v1-188 (-> self draw art-group data 31)) (= v1-188 (-> self draw art-group data 32))) ) - (ja-channel-push! 1 12) - (let ((a0-61 (-> self skel root-channel 0))) - (set! (-> a0-61 frame-group) (the-as art-joint-anim (-> self draw art-group data 30))) - (set! (-> a0-61 param 0) 0.0) - (set! (-> a0-61 param 1) 1.2) - (set! (-> a0-61 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-61 (the-as art-joint-anim (-> self draw art-group data 30)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! (-> self draw art-group data 30) :num! (seek! 0.0 1.2) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-62 (-> self skel root-channel 0))) - (set! (-> a0-62 param 0) 0.0) - (set! (-> a0-62 param 1) 1.2) - (joint-control-channel-group-eval! a0-62 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0 1.2)) ) (set! gp-0 60) ) @@ -273,68 +137,44 @@ ) (while (< 16384.0 (-> self control unknown-float01)) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 103) - ) + ((ja-group? (-> self draw art-group data 103)) ) (else - (ja-channel-push! 1 gp-0) + (ja-channel-push! 1 (the-as time-frame gp-0)) (set! gp-0 150) - (let ((v1-219 (-> self skel root-channel 0))) - (set! (-> v1-219 frame-group) (the-as art-joint-anim (-> self draw art-group data 103))) - ) + (ja :group! (-> self draw art-group data 103)) ) ) (suspend) - (let ((a0-72 (-> self skel root-channel 0))) - (set! (-> a0-72 param 0) 1.0) - (joint-control-channel-group-eval! a0-72 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 104) - ) - ) - (ja-channel-push! 1 gp-0) - (let ((v1-233 (-> self skel root-channel 0))) - (set! (-> v1-233 frame-group) (the-as art-joint-anim (-> self draw art-group data 104))) - ) + (when (not (ja-group? (-> self draw art-group data 104))) + (ja-channel-push! 1 (the-as time-frame gp-0)) + (ja :group! (-> self draw art-group data 104)) ) ) - (while #t + (loop (suspend) - (let ((a0-81 (-> self skel root-channel 0))) - (set! (-> a0-81 param 0) 1.0) - (joint-control-channel-group-eval! a0-81 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-ice-walk (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *walk-mods*) (none) ) - :exit - (behavior () + :exit (behavior () (target-effect-exit) (target-state-hook-exit) (none) ) - :trans - (behavior () + :trans (behavior () ((-> self state-hook)) (when (!= (-> self control ground-pat material) (pat-material ice)) (remove-exit) @@ -358,10 +198,7 @@ (remove-exit) (go target-duck-stance) ) - (when (and (not (move-legs?)) (let ((gp-0 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) + (when (and (not (move-legs?)) (let ((gp-0 (ja-group)) (f0-1 (ja-aframe-num 0)) ) (if (and (= gp-0 (-> self draw art-group data 102)) (>= f0-1 30.0) (>= 35.0 f0-1)) @@ -402,113 +239,59 @@ (fall-test) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) + ((ja-group? (-> self draw art-group data 23)) (let ((f30-0 (ja-aframe-num 0))) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 102)) - num-func-identity - ) - (set! (-> gp-0 frame-num) f30-0) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 102) :num! (identity f30-0)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 102) - ) + ((ja-group? (-> self draw art-group data 102)) ) (else - (let ((v1-18 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-18 (ja-group))) (cond ((or (= v1-18 (-> self draw art-group data 60)) (= v1-18 (-> self draw art-group data 61))) (set! (-> self control unknown-float81) (-> self control unknown-float80)) (set! (-> self control unknown-surface00) *walk-no-turn-mods*) (while (< (ja-aframe-num 0) 42.0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self control unknown-surface00) *walk-mods*) (set! (-> self control unknown-float81) 0.0) - (ja-channel-push! 1 30) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 102)) - num-func-identity - ) - (set! (-> gp-1 frame-num) (ja-aframe 34.0 0)) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 102) :num! (identity (ja-aframe 34.0 0))) (while (!= (-> self skel root-channel 0) (-> self skel channel)) (suspend) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 59) - ) + ((ja-group? (-> self draw art-group data 59)) (set! (-> self control unknown-float81) (-> self control unknown-float80)) (set! (-> self control unknown-surface00) *walk-no-turn-mods*) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 60))) - (set! (-> gp-2 param 0) (ja-aframe 42.0 0)) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) 0.0) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 60)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 60) :num! (seek! (ja-aframe 42.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 42.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 42.0 0))) ) (set! (-> self control unknown-surface00) *walk-mods*) (set! (-> self control unknown-float81) 0.0) - (ja-channel-push! 1 30) - (let ((gp-4 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-4 - (the-as art-joint-anim (-> self draw art-group data 102)) - num-func-identity - ) - (set! (-> gp-4 frame-num) (ja-aframe 34.0 0)) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 102) :num! (identity (ja-aframe 34.0 0))) (while (!= (-> self skel root-channel 0) (-> self skel channel)) (suspend) ) ) (else - (ja-channel-push! 1 15) - (let ((v1-74 (-> self skel root-channel 0))) - (set! (-> v1-74 frame-group) (the-as art-joint-anim (-> self draw art-group data 102))) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 102)) ) ) ) ) ) - (while #t + (loop (suspend) (let* ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control unknown-vector01) 1.0)) (gp-6 (vector-float*! @@ -518,27 +301,25 @@ ) ) (f0-18 (fmax -1.0 (fmin 1.0 (vector-dot s5-0 gp-6)))) - (gp-7 (-> self skel root-channel 0)) ) - (set! (-> gp-7 param 0) (cond - ((< f0-18 0.0) - (lerp-scale 2.0 1.0 f0-18 -1.0 0.5) - ) - ((< 0.5 f0-18) - (lerp-scale 1.0 0.75 f0-18 0.5 1.0) - ) - (else - (lerp-scale 1.33 1.0 f0-18 0.0 0.5) - ) - ) - ) - (joint-control-channel-group-eval! gp-7 (the-as art-joint-anim #f) num-func-loop!) + (ja :num! (loop! (cond + ((< f0-18 0.0) + (lerp-scale 2.0 1.0 f0-18 -1.0 0.5) + ) + ((< 0.5 f0-18) + (lerp-scale 1.0 0.75 f0-18 0.5 1.0) + ) + (else + (lerp-scale 1.33 1.0 f0-18 0.0 0.5) + ) + ) + ) + ) ) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) diff --git a/goal_src/levels/snow/target-snowball.gc b/goal_src/levels/snow/target-snowball.gc index 2c19cb557e..dd3e4e9259 100644 --- a/goal_src/levels/snow/target-snowball.gc +++ b/goal_src/levels/snow/target-snowball.gc @@ -49,8 +49,7 @@ ) (defstate target-snowball-start (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) 'snowball @@ -70,8 +69,7 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (when (!= (-> self next-state name) 'target-snowball) (let ((v1-1 (-> self manipy))) (when v1-1 @@ -89,8 +87,7 @@ ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (target-exit) (set! *display-profile* #f) (set! *display-entity-errors* #f) @@ -109,36 +106,24 @@ (move-by-vector! (-> self control) (new 'static 'vector :y 4096.0 :w 1.0)) (logior! (-> self control root-prim prim-core action) (collide-action ca-12)) (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 5) :num! min) (remove-exit) (go target-snowball) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-snowball (target) - :event - (-> target-snowball-start event) - :exit - (-> target-snowball-start exit) - :code - (behavior () - (while #t + :event (-> target-snowball-start event) + :exit (-> target-snowball-start exit) + :code (behavior () + (loop (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (target-snowball-post) (none) ) diff --git a/goal_src/levels/snow/yeti.gc b/goal_src/levels/snow/yeti.gc index 83d317ce1a..30caa0344b 100644 --- a/goal_src/levels/snow/yeti.gc +++ b/goal_src/levels/snow/yeti.gc @@ -10,6 +10,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/yeti-ag.gc") + (deftype yeti-slave (nav-enemy) ((ground-y float :offset-assert 400) (part2 sparticle-launch-control :offset-assert 404) @@ -51,13 +53,11 @@ ) -(defskelgroup *yeti-sg* yeti - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0.75 0 3.9) - :longest-edge (meters 1.3) - ) +(defskelgroup *yeti-sg* yeti yeti-lod0-jg -1 + ((yeti-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0.75 0 3.9) + :longest-edge (meters 1.3) + ) (define *yeti-nav-enemy-info* (new 'static 'nav-enemy-info :idle-anim 2 @@ -107,7 +107,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -117,15 +117,13 @@ :id 538 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 1928 :fade-after (meters 70) :falloff-to (meters 70)) + :parts ((sp-item 1928 :fade-after (meters 70) :falloff-to (meters 70)) (sp-item 1929 :fade-after (meters 70) :falloff-to (meters 70)) ) ) (defpart 1929 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) @@ -149,8 +147,7 @@ ) (defpart 1928 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) @@ -180,13 +177,11 @@ :id 539 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 1930 :fade-after (meters 70) :falloff-to (meters 70))) + :parts ((sp-item 1930 :fade-after (meters 70) :falloff-to (meters 70))) ) (defpart 1930 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -220,16 +215,14 @@ ) (defstate yeti-slave-appear-jump-up (yeti-slave) - :event - yeti-slave-default-event-handler - :enter - (behavior () + :event yeti-slave-default-event-handler + :enter (behavior () (nav-enemy-neck-control-inactive) (set! (-> self state-time) (-> *display* base-frame-counter)) (if (-> self nav-info move-to-ground) (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background)) ) - (set! (-> self nav-enemy-flags) (logand -7 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1 navenmf2)) (set! (-> self state-timeout) (seconds 1)) (set! (-> self ground-y) (-> self collide-info trans y)) (spawn (-> self part) (-> self collide-info trans)) @@ -238,8 +231,7 @@ (set! (-> self collide-info transv y) (rand-vu-float-range 102400.0 114688.0)) (none) ) - :trans - (behavior () + :trans (behavior () (when (and (< (-> self collide-info trans y) (-> self ground-y)) (< (-> self collide-info transv y) 0.0)) (set! (-> self collide-info trans y) (-> self ground-y)) (set! (-> self collide-info transv quad) (-> *null-vector* quad)) @@ -254,57 +246,29 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 10.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! yeti-jump-ja :num! (seek!) :frame-num (ja-aframe 10.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior yeti-slave) nav-enemy-falling-post) + :post (the-as (function none :behavior yeti-slave) nav-enemy-falling-post) ) (defstate yeti-slave-appear-land (yeti-slave) - :event - yeti-slave-default-event-handler - :code - (behavior () - (ja-channel-push! 1 15) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 0.5) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + :event yeti-slave-default-event-handler + :code (behavior () + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! yeti-jump-land-ja :num! (seek! max 0.5) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 0.5) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.5)) ) (if (TODO-RENAME-46 self (-> self nav-info notice-distance)) (go-virtual nav-enemy-chase) @@ -312,128 +276,65 @@ ) (none) ) - :post - (the-as (function none :behavior yeti-slave) ja-post) + :post (the-as (function none :behavior yeti-slave) ja-post) ) (defstate yeti-slave-show-anims (yeti-slave) - :trans - (behavior () + :trans (behavior () 0 (none) ) - :code - (behavior () + :code (behavior () 0 (none) ) - :post - (the-as (function none :behavior yeti-slave) transform-post) + :post (the-as (function none :behavior yeti-slave) transform-post) ) (defstate nav-enemy-patrol (yeti-slave) :virtual #t - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - (ja-channel-push! 1 45) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 12.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + ((ja-group? yeti-give-up-hop-ja) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! yeti-walk-ja :num! (seek!) :frame-num (ja-aframe 12.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) ) ) - (while #t - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (loop + (ja-no-eval :group! yeti-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (when (nav-enemy-rnd-percent? 0.2) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) 1.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 180) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((gp-1 (nav-enemy-rnd-int-range 2 6))) (dotimes (s5-0 gp-1) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! yeti-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (logior! (-> self nav-enemy-flags) 8) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) 1.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 180) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) 1.0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (ja-no-eval :group! yeti-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) 1.0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -443,65 +344,31 @@ (defstate nav-enemy-chase (yeti-slave) :virtual #t - :code - (behavior () + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 11) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 51) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim)))) - (set! (-> a0-7 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-7 param 1) f30-0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! - a0-7 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - num-func-seek! - ) - ) + ((ja-group? yeti-jump-land-ja) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.17)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info run-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (else - (ja-channel-push! 1 60) - (let ((v1-42 (-> self skel root-channel 0))) - (set! (-> v1-42 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - ) - ) - (let ((v1-45 (-> self skel root-channel 0))) - (set! (-> v1-45 num-func) num-func-identity) - (set! (-> v1-45 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) ) ) - (while #t + (loop (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) f30-0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) @@ -510,96 +377,47 @@ (defstate nav-enemy-stare (yeti-slave) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self turn-time) (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or (logtest? (-> self nav-enemy-flags) 256) + (when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) ) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> gp-0 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-0 param 1) f30-0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! yeti-win-ja :num! (seek! (ja-aframe 68.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-1 param 1) f30-0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 68.0 0) f30-0)) ) ) - (while #t + (loop (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) 1.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 60) - (let ((v1-25 (-> self skel root-channel 0))) - (set! (-> v1-25 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - ) - (let ((v1-28 (-> self skel root-channel 0))) - (set! (-> v1-28 num-func) num-func-identity) - (set! (-> v1-28 frame-num) 0.0) - ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! yeti-turn-ja) + (ja :num-func num-func-identity :frame-num 0.0) (until (nav-enemy-facing-player? 1820.4445) (ja-blend-eval) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) 0.75) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! 0.75)) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 2) - ) - ) - (ja-channel-push! 1 60) + (if (not (ja-group? yeti-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) f30-0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! yeti-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) f30-0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (when (nav-enemy-rnd-percent? 0.3) - (ja-channel-push! 1 30) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> gp-2 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-2 param 1) f30-0) - (set! (-> gp-2 frame-num) 0.0) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! yeti-win-ja :num! (seek! (ja-aframe 68.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-3 param 1) f30-0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 68.0 0) f30-0)) ) ) ) @@ -610,11 +428,10 @@ (defstate nav-enemy-give-up (yeti-slave) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 218453.33) (set! (-> self turn-time) (seconds 0.5)) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) (let ((s4-0 (-> self collide-info)) (s5-0 (target-pos 0)) ) @@ -623,36 +440,16 @@ ) 12743.111 ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! yeti-give-up-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! yeti-give-up-hop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek-to-point-toward-point! (-> self collide-info) @@ -661,11 +458,7 @@ (-> self turn-time) ) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) (none) @@ -674,35 +467,17 @@ (defstate nav-enemy-jump-land (yeti-slave) :virtual #t - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 22) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - ) - (set! (-> gp-0 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-0 param 1) 0.5) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info jump-land-anim)) + :num! (seek! (ja-aframe 32.0 0) 0.5) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-1 param 1) 0.5) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) ) (go-virtual nav-enemy-chase) (none) @@ -850,9 +625,8 @@ ) (defstate yeti-first-time-start (yeti) - :code - (behavior () - (while #t + :code (behavior () + (loop (when *target* (when (>= (-> self first-time-spawn-dist) (vector-vector-xz-distance (target-pos 0) (-> self root trans))) (process-entity-status! self (entity-perm-status complete) #t) @@ -866,8 +640,7 @@ ) (defstate yeti-resuming-start (yeti) - :code - (behavior () + :code (behavior () (let ((gp-0 0)) (let ((v1-0 (the-as (pointer process-tree) (-> self child-process)))) (while v1-0 @@ -884,15 +657,7 @@ (if (not (TODO-RENAME-20 self s5-0 s4-0)) (go yeti-idle) ) - (let ((s3-0 (get-process *default-dead-pool* yeti-slave #x4000))) - (when s3-0 - (let ((t9-3 (method-of-type yeti-slave activate))) - (t9-3 (the-as yeti-slave s3-0) self 'yeti-slave (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 yeti-slave-init-by-other (-> self entity) self s5-0 s4-0 #t) - (-> s3-0 ppointer) - ) - ) + (process-spawn yeti-slave (-> self entity) self s5-0 s4-0 #t :to self) ) (+! gp-0 1) ) @@ -903,9 +668,8 @@ ) (defstate yeti-idle (yeti) - :code - (behavior () - (while #t + :code (behavior () + (loop (cond ((zero? (-> self spawn-delay)) (let ((v1-1 0)) @@ -929,15 +693,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (when (TODO-RENAME-20 self gp-0 s5-0) - (let ((s4-0 (get-process *default-dead-pool* yeti-slave #x4000))) - (when s4-0 - (let ((t9-3 (method-of-type yeti-slave activate))) - (t9-3 (the-as yeti-slave s4-0) self 'yeti-slave (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 yeti-slave-init-by-other (-> self entity) self gp-0 s5-0 #f) - (-> s4-0 ppointer) - ) - ) + (process-spawn yeti-slave (-> self entity) self gp-0 s5-0 #f :to self) (set! (-> self spawn-delay) 0) 0 ) diff --git a/goal_src/levels/sunken/bully.gc b/goal_src/levels/sunken/bully.gc index 510e836a8e..e4f17be3ea 100644 --- a/goal_src/levels/sunken/bully.gc +++ b/goal_src/levels/sunken/bully.gc @@ -7,11 +7,10 @@ (declare-type bully process-drawable) -(define-extern *bully-sg* skeleton-group) -(define-extern *bully-broken-cage-sg* skeleton-group) - ;; DECOMP BEGINS +(import "goal_src/import/bully-ag.gc") + (deftype bully-broken-cage (process-drawable) ((parent-override (pointer bully) :offset 12) ) @@ -59,30 +58,21 @@ ) -(defskelgroup *bully-sg* bully - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1.5 0 3) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *bully-sg* bully bully-lod0-jg bully-idle-ja + ((bully-lod0-mg (meters 20)) (bully-lod1-mg (meters 40)) (bully-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 3) + :shadow bully-shadow-mg + ) -(defskelgroup *bully-broken-cage-sg* bully - 14 - -1 - ((15 (meters 999999))) - :bounds (static-spherem 0 2 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *bully-broken-cage-sg* bully bully-broken-cage-lod0-jg -1 + ((bully-broken-cage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 6) + ) -(define - *bully-shadow-control* +(define *bully-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #x9)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 614400.0) + :flags (shadow-flags shdf00 shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) :bot-plane (new 'static 'plane :y 1.0 :w 10240.0) :top-plane (new 'static 'plane :y 1.0 :w -2048.0) :fade-dist 245760.0 @@ -94,13 +84,11 @@ :id 454 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2871) (sp-item 2872) (sp-item 2873) (sp-item 2874) (sp-item 2875)) + :parts ((sp-item 2871) (sp-item 2872) (sp-item 2873) (sp-item 2874) (sp-item 2875)) ) (defpart 2871 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0.5) (meters 2) 1.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -123,13 +111,11 @@ ) (defpart 2876 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) (defpart 2872 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 1.5)) (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) @@ -153,13 +139,11 @@ ) (defpart 2877 - :init-specs - ((sp-flt spt-fade-a -2.1333334)) + :init-specs ((sp-flt spt-fade-a -2.1333334)) ) (defpart 2873 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1.5)) (sp-flt spt-scale-x (meters 12)) @@ -175,8 +159,7 @@ ) (defpart 2874 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) @@ -204,16 +187,14 @@ ) (defpart 2878 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0033333334)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0033333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -3.4) ) ) (defpart 2875 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) (sp-flt spt-num 16.5) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) @@ -241,33 +222,19 @@ ) (defstate bully-broken-cage-explode (bully-broken-cage) - :code - (behavior () + :code (behavior () (ja-channel-push! 1 0) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + (ja-no-eval :group! bully-broken-cage-explode-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (none) ) - :post - (the-as (function none :behavior bully-broken-cage) ja-post) + :post (the-as (function none :behavior bully-broken-cage) ja-post) ) -(defbehavior bully-broken-cage-init-by-other bully-broken-cage ((arg0 entity)) +(defbehavior bully-broken-cage-init-by-other bully-broken-cage ((arg0 entity-actor)) (set! (-> self entity) arg0) (set! (-> self root) (new 'process 'trsqv)) (set! (-> self root trans quad) (-> self parent-override 0 root-override trans quad)) @@ -329,46 +296,29 @@ ) (set-vector! s4-0 (* (sin f26-0) f28-0) 0.0 (* (cos f26-0) f28-0) 1.0) ) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) self) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'shove) - (set! (-> a1-8 param 0) (-> arg3 param 0)) - (let ((v1-23 (new 'static 'attack-info :mask #x82))) - (set! (-> v1-23 shove-up) f30-0) - (set! (-> v1-23 vector quad) (-> s4-0 quad)) - (set! (-> a1-8 param 1) (the-as uint v1-23)) - ) - (when (send-event-function arg0 a1-8) - (level-hint-spawn - (game-text-id sunken-bully-dive-hint) - "sksp0131" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (set! (-> self bounced?) #t) - (set! v0-0 (the-as none 100)) - (set! (-> self bounce-volume) (the-as int v0-0)) - v0-0 + (when (send-event arg0 'shove (-> arg3 param 0) (static-attack-info ((shove-up f30-0) (vector s4-0)))) + (level-hint-spawn + (game-text-id sunken-bully-dive-hint) + "sksp0131" + (the-as entity #f) + *entity-pool* + (game-task none) ) + (set! (-> self bounced?) #t) + (set! v0-0 (the-as none 100)) + (set! (-> self bounce-volume) (the-as int v0-0)) + v0-0 ) ) ) (else - (let ((f0-21 (fmax 0.6 (* 0.000023935356 (-> self travel-speed)))) - (a1-10 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-10 from) self) - (set! (-> a1-10 num-params) 2) - (set! (-> a1-10 message) 'attack) - (set! (-> a1-10 param 0) (-> arg3 param 0)) - (let ((v1-29 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-29 shove-up) (* 12288.0 f0-21)) - (set! (-> v1-29 shove-back) (* 16384.0 f0-21)) - (set! (-> a1-10 param 1) (the-as uint v1-29)) - ) - (when (send-event-function arg0 a1-10) + (let ((f0-21 (fmax 0.6 (* 0.000023935356 (-> self travel-speed))))) + (when (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (* 12288.0 f0-21)) (shove-back (* 16384.0 f0-21)))) + ) (level-hint-spawn (game-text-id sunken-bully-dive-hint) "sksp0131" @@ -392,17 +342,7 @@ (when (= arg2 'touched) (cond ((= (-> arg0 type) target) - (let ((a1-13 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-13 from) self) - (set! (-> a1-13 num-params) 2) - (set! (-> a1-13 message) 'attack) - (set! (-> a1-13 param 0) (-> arg3 param 0)) - (let ((a0-26 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-26 mode) 'explode) - (set! (-> a1-13 param 1) (the-as uint a0-26)) - ) - (send-event-function arg0 a1-13) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'explode)))) ) (else (let ((a1-14 (new 'stack-no-clear 'event-message-block))) @@ -430,9 +370,13 @@ (defbehavior bully-post bully () (when (and (-> self hit-player?) - (or (not *target*) (and (zero? (logand (-> *target* state-flags) #x80f8)) - (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) + (or (not *target*) + (and (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) + ) + (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) + ) ) ) (set-collide-offense (-> self root-override) 2 (collide-offense normal-attack)) @@ -517,30 +461,26 @@ ) (defstate bully-idle (bully) - :event - bully-default-event-handler - :enter - (behavior ((arg0 symbol)) + :event bully-default-event-handler + :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self reaction-delay) (rand-vu-int-range 0 (seconds 0.35))) (set! (-> self travel-speed) 0.0) (shut-down! (-> self neck)) (let ((v1-5 (-> self draw shadow-ctrl))) - (logior! (-> v1-5 settings flags) 32) + (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) 0 (none) ) - :exit - (behavior () + :exit (behavior () (let ((v1-1 (-> self draw shadow-ctrl))) - (set! (-> v1-1 settings flags) (logand -33 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) 0 (none) ) - :trans - (behavior () + :trans (behavior () (when (and (and *target* (>= (-> self fact-override idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -552,61 +492,26 @@ ) (none) ) - :code - (behavior ((arg0 symbol)) - (ja-channel-push! 1 22) - (cond - (arg0 - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity + :code (behavior ((arg0 symbol)) + (ja-channel-push! 1 (seconds 0.075)) + (if arg0 + (ja :group! bully-idle-ja + :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) ) - (set! (-> gp-1 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - ) + (ja :group! bully-idle-ja :num! min) ) - (else - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) - ) - ) - (while #t + (loop (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - bully-post + :post bully-post ) (defstate bully-notice (bully) - :event - bully-default-event-handler - :trans - (behavior () + :event bully-default-event-handler + :trans (behavior () (when *target* (if *target* (look-at-enemy! @@ -620,32 +525,17 @@ ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self travel-speed) 0.0) - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) (set-vector! (-> self root-override transv) 0.0 (rand-vu-float-range 61440.0 90112.0) 0.0 1.0) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> gp-1 param 0) (ja-aframe 13.0 0)) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) 0.0) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! bully-notice-jump-up-ja :num! (seek! (ja-aframe 13.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe 13.0 0)) - (set! (-> gp-2 param 1) 1.0) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 13.0 0))) ) - (until (logtest? (-> self root-override status) 1) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (until (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) + (ja :num! (seek!)) (+! (-> self root-override transv y) (* -545996.8 (-> *display* seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! (-> self root-override) @@ -665,35 +555,20 @@ ) (suspend) ) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-14 param 1) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! bully-notice-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) 1.0) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go bully-start-spinning) (none) ) - :post - bully-post + :post bully-post ) (defstate bully-start-spinning (bully) - :event - bully-default-event-handler - :enter - (behavior () + :event bully-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self start-spin-time) (-> *display* base-frame-counter)) (set! (-> self slow-down) (rand-vu-int-range (seconds 4) (seconds 8))) @@ -709,8 +584,7 @@ (+! (-> self travel-ry) (rand-vu-float-range -910.2222 910.2222)) (none) ) - :trans - (behavior () + :trans (behavior () (when *target* (if *target* (look-at-enemy! @@ -724,13 +598,13 @@ ) (cond ((>= (- (-> *display* base-frame-counter) (-> self start-spin-time)) (-> self slow-down)) - (set! (-> self speed-u) (seek (-> self speed-u) 0.0 (* 0.5555556 (-> *display* seconds-per-frame)))) + (seek! (-> self speed-u) 0.0 (* 0.5555556 (-> *display* seconds-per-frame))) (if (= (-> self speed-u) 0.0) (go bully-stop-spinning) ) ) (else - (set! (-> self speed-u) (seek (-> self speed-u) 1.0 (* 0.5555556 (-> *display* seconds-per-frame)))) + (seek! (-> self speed-u) 1.0 (* 0.5555556 (-> *display* seconds-per-frame))) ) ) (set! (-> self spin-vel) (* 196608.0 (-> self speed-u))) @@ -750,108 +624,54 @@ (TODO-RENAME-27 (-> self nav)) (none) ) - :code - (behavior () + :code (behavior () (local-vars (v1-34 symbol) (v1-52 symbol)) - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! bully-start-spin-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self bounced?) #f) - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 9)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! bully-spin-ja :num! min) + (loop (until v1-34 (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-34 (or (ja-done? 0) (-> self bounced?))) ) (when (-> self bounced?) - (sound-play-by-name - (static-sound-name "bully-bounce") - (new-sound-id) - (the int (* 10.24 (the float (-> self bounce-volume)))) - 0 - 0 - 1 - #t - ) + (sound-play "bully-bounce" :vol (the float (-> self bounce-volume))) (until (not (-> self bounced?)) (set! (-> self bounced?) #f) - (ja-channel-push! 1 60) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 11)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! bully-idle-bounced-ja :num! min) (until v1-52 (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-52 (or (ja-done? 0) (-> self bounced?))) ) ) - (ja-channel-push! 1 60) - ) - (let ((gp-3 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-3 - (the-as art-joint-anim (-> self draw art-group data 9)) - num-func-identity - ) - (set! (-> gp-3 frame-num) 0.0) + (ja-channel-push! 1 (seconds 0.2)) ) + (ja :group! bully-spin-ja :num! min) ) (none) ) - :post - bully-post + :post bully-post ) (defstate bully-stop-spinning (bully) - :event - bully-default-event-handler - :enter - (behavior () + :event bully-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self reaction-delay) (rand-vu-int-range (seconds 2) (seconds 3))) (set! (-> self travel-speed) 0.0) (set! (-> self bounced?) #f) (none) ) - :trans - (behavior () + :trans (behavior () (when *target* (if *target* (look-at-enemy! @@ -865,77 +685,39 @@ ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (v1-17 symbol) (v1-35 symbol)) (let ((gp-0 2)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-delay)) (cond ((>= gp-0 0) (+! gp-0 -1) - (let ((s5-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data 13)) - num-func-identity - ) - (set! (-> s5-0 frame-num) 0.0) - ) + (ja :group! bully-dizzy-ja :num! min) ) (else - (let ((s5-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> s5-1 frame-num) 0.0) - ) + (ja :group! bully-idle-ja :num! min) ) ) (until v1-17 (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-17 (or (ja-done? 0) (-> self bounced?))) ) (when (-> self bounced?) - (sound-play-by-name - (static-sound-name "bully-bounce") - (new-sound-id) - (the int (* 10.24 (the float (-> self bounce-volume)))) - 0 - 0 - 1 - #t - ) + (sound-play "bully-bounce" :vol (the float (-> self bounce-volume))) (set! gp-0 0) (until (not (-> self bounced?)) (set! (-> self bounced?) #f) - (ja-channel-push! 1 60) - (let ((s5-3 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-3 - (the-as art-joint-anim (-> self draw art-group data 11)) - num-func-identity - ) - (set! (-> s5-3 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! bully-idle-bounced-ja :num! min) (until v1-35 (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-35 (or (ja-done? 0) (-> self bounced?))) ) ) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) ) ) ) @@ -948,45 +730,23 @@ (go bully-start-spinning) (none) ) - :post - bully-post + :post bully-post ) (defstate bully-die (bully) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (shut-down! (-> self neck)) (logclear! (-> self mask) (process-mask actor-pause)) - (let ((gp-0 (get-process *default-dead-pool* bully-broken-cage #x4000))) - (when gp-0 - (let ((t9-3 (method-of-type bully-broken-cage activate))) - (t9-3 (the-as bully-broken-cage gp-0) self 'bully-broken-cage (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 bully-broken-cage-init-by-other (-> self entity)) - (-> gp-0 ppointer) - ) - ) + (process-spawn bully-broken-cage (-> self entity) :to self) (spawn (-> self part) (-> self root-override trans)) (clear-collide-with-as (-> self root-override)) (drop-pickup (-> self fact-override) #t *entity-pool* (-> self fact-override) 0) - (ja-channel-push! 1 22) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! bully-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (increment-success-for-hint (game-text-id sunken-bully-dive-hint)) (logior! (-> self draw status) (draw-status hidden)) @@ -995,8 +755,7 @@ ) (none) ) - :post - (the-as (function none :behavior bully) transform-post) + :post (the-as (function none :behavior bully) transform-post) ) (defmethod relocate bully ((obj bully) (arg0 int)) @@ -1056,7 +815,7 @@ (initialize-skeleton obj *bully-sg* '()) (set! (-> obj draw shadow-ctrl) *bully-shadow-control*) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 454) obj)) (set! (-> obj fact-override) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) diff --git a/goal_src/levels/sunken/double-lurker.gc b/goal_src/levels/sunken/double-lurker.gc index 23d4c3c5f5..f0364f9bf8 100644 --- a/goal_src/levels/sunken/double-lurker.gc +++ b/goal_src/levels/sunken/double-lurker.gc @@ -9,6 +9,9 @@ ;; DECOMP BEGINS +(import "goal_src/import/double-lurker-ag.gc") +(import "goal_src/import/double-lurker-top-ag.gc") + (deftype double-lurker-top (nav-enemy) ((parent-process (pointer double-lurker) :offset 12) (fall-dest vector :inline :offset-assert 400) @@ -53,23 +56,25 @@ ) -(defskelgroup *double-lurker-sg* double-lurker - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 4.5) - :longest-edge (meters 1) - :shadow 4 - ) +(defskelgroup *double-lurker-sg* double-lurker double-lurker-lod0-jg double-lurker-both-idle-ja + ((double-lurker-lod0-mg (meters 20)) + (double-lurker-lod1-mg (meters 40)) + (double-lurker-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 1 0 4.5) + :longest-edge (meters 1) + :shadow double-lurker-shadow-mg + ) -(defskelgroup *double-lurker-top-sg* double-lurker-top - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0.5 0 4.5) - :longest-edge (meters 1) - :shadow 4 - ) +(defskelgroup *double-lurker-top-sg* double-lurker-top double-lurker-top-lod0-jg -1 + ((double-lurker-top-lod0-mg (meters 20)) + (double-lurker-top-lod1-mg (meters 40)) + (double-lurker-top-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0.5 0 4.5) + :longest-edge (meters 1) + :shadow double-lurker-top-shadow-mg + ) (define *double-lurker-top-nav-enemy-info* (new 'static 'nav-enemy-info :idle-anim 12 @@ -119,7 +124,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -173,7 +178,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -227,15 +232,14 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) ) (defstate double-lurker-top-on-shoulders (double-lurker-top) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (let ((v1-1 (-> self fall-dest)) @@ -259,9 +263,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (clone-anim-once (ppointer->handle (-> self parent-process)) (the-as int (-> self draw origin-joint-index)) @@ -276,76 +279,46 @@ ) (defstate double-lurker-top-on-shoulders-die (double-lurker-top) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 30) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 18))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 18)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 18)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! double-lurker-bottom-take-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (none) ) - :post - (the-as (function none :behavior double-lurker-top) ja-post) + :post (the-as (function none :behavior double-lurker-top) ja-post) ) (defstate double-lurker-top-knocked-down (double-lurker-top) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'shove) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (let ((v1-4 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-4 shove-up) 12288.0) - (set! (-> v1-4 shove-back) 8192.0) - (set! (-> a1-2 param 1) (the-as uint v1-4)) - ) - (send-event-function arg0 a1-2) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 3)) (shove-back (meters 2)))) ) ) ) ) - :code - (behavior ((arg0 object) (arg1 vector) (arg2 vector)) + :code (behavior ((arg0 object) (arg1 vector) (arg2 vector)) (dummy-51 self) (let ((v1-3 (-> self draw shadow-ctrl))) - (set! (-> v1-3 settings flags) (logand -33 (-> v1-3 settings flags))) + (logclear! (-> v1-3 settings flags) (shadow-flags disable-draw)) ) 0 - (set! (-> self collide-info nav-flags) (logand -2 (-> self collide-info nav-flags))) - (logior! (-> self collide-info nav-flags) 2) + (logclear! (-> self collide-info nav-flags) (nav-flags navf0)) + (logior! (-> self collide-info nav-flags) (nav-flags navf1)) (set! (-> self nav extra-nav-sphere quad) (-> self fall-dest quad)) (set! (-> self nav extra-nav-sphere w) 9011.2) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self collide-info trans quad)) - (ja-channel-push! 1 30) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-14 param 1) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! double-lurker-both-break-apart-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (vector-lerp! (-> self collide-info trans) @@ -354,26 +327,20 @@ (fmin 1.0 (/ (ja-frame-num 0) (ja-aframe 44.0 0))) ) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (logior! (-> self collide-info nav-flags) 1) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logior! (-> self collide-info nav-flags) (nav-flags navf0)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (TODO-RENAME-27 (-> self nav)) (go double-lurker-top-resume) (none) ) - :post - (the-as (function none :behavior double-lurker-top) transform-post) + :post (the-as (function none :behavior double-lurker-top) transform-post) ) (defstate double-lurker-top-resume (double-lurker-top) - :code - (behavior () + :code (behavior () (cond ((not *target*) (go-virtual nav-enemy-idle) @@ -399,18 +366,10 @@ (defstate nav-enemy-patrol (double-lurker-top) :virtual #t - :code - (behavior () - (ja-channel-push! 1 60) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info walk-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-patrol) code))) (if t9-1 ((the-as (function none) t9-1)) @@ -422,8 +381,7 @@ (defstate nav-enemy-die (double-lurker-top) :virtual #t - :enter - (behavior () + :enter (behavior () (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-2 user-int8 1) 1) @@ -440,7 +398,7 @@ (defmethod dummy-51 double-lurker-top ((obj double-lurker-top)) (restore-collide-with-as (-> obj collide-info)) - (logior! (-> obj collide-info nav-flags) 1) + (logior! (-> obj collide-info nav-flags) (nav-flags navf0)) (TODO-RENAME-27 (-> obj nav)) (none) ) @@ -524,7 +482,7 @@ (set-vector! (-> obj collide-info scale) 1.0 1.0 1.0 1.0) (quaternion-copy! (-> obj collide-info quat) (-> v1-5 0 collide-info quat)) ) - (set! (-> obj collide-info nav-flags) (logand -2 (-> obj collide-info nav-flags))) + (logclear! (-> obj collide-info nav-flags) (nav-flags navf0)) (none) ) @@ -536,31 +494,17 @@ (cond (arg2 (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! double-lurker-both-idle-ja :num! min) (transform-post) (let ((v1-13 (-> self draw shadow-ctrl))) - (logior! (-> v1-13 settings flags) 32) + (logior! (-> v1-13 settings flags) (shadow-flags disable-draw)) ) 0 (go double-lurker-top-on-shoulders) ) (else (ja-channel-set! 1) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 12)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) + (ja :group! double-lurker-idle-ja :num! min) (transform-post) (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background)) (dummy-51 self) @@ -590,22 +534,16 @@ ((and (>= (-> s4-0 y) 8192.0) (>= 14563.556 (fabs (deg- (quaternion-y-angle (-> self collide-info quat)) (atan (-> s4-0 x) (-> s4-0 z))))) ) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'shove) - (set! (-> a1-4 param 0) (-> arg3 param 0)) - (let ((v1-13 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-13 shove-up) 12288.0) - (set! (-> v1-13 shove-back) 8192.0) - (set! (-> a1-4 param 1) (the-as uint v1-13)) - ) - (when (send-event-function arg0 a1-4) - (increment-success-for-hint (game-text-id sunken-double-lurker-hint)) - (go double-lurker-buddy-was-hit) - (return #f) - v0-0 - ) + (when (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 3)) (shove-back (meters 2)))) + ) + (increment-success-for-hint (game-text-id sunken-double-lurker-hint)) + (go double-lurker-buddy-was-hit) + (return #f) + v0-0 ) ) (else @@ -615,17 +553,11 @@ (collide-action solid) (collide-action) ) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'shove) - (set! (-> a1-6 param 0) (-> arg3 param 0)) - (let ((v1-23 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-23 shove-up) 12288.0) - (set! (-> v1-23 shove-back) 8192.0) - (set! (-> a1-6 param 1) (the-as uint v1-23)) - ) - (send-event-function arg0 a1-6) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 3)) (shove-back (meters 2)))) ) ) (level-hint-spawn @@ -654,23 +586,19 @@ ) (defstate double-lurker-show-anims (double-lurker) - :trans - (behavior () + :trans (behavior () 0 (none) ) - :code - (behavior () + :code (behavior () 0 (none) ) - :post - (the-as (function none :behavior double-lurker) transform-post) + :post (the-as (function none :behavior double-lurker) transform-post) ) (defstate double-lurker-resume (double-lurker) - :code - (behavior () + :code (behavior () (cond ((not *target*) (go-virtual nav-enemy-idle) @@ -696,26 +624,16 @@ (defstate nav-enemy-idle (double-lurker) :virtual #t - :event - double-lurker-default-event-handler + :event double-lurker-default-event-handler ) (defstate nav-enemy-patrol (double-lurker) :virtual #t - :event - double-lurker-default-event-handler - :code - (behavior () - (ja-channel-push! 1 60) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) + :event double-lurker-default-event-handler + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info walk-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-patrol) code))) (if t9-1 ((the-as (function none) t9-1)) @@ -727,10 +645,8 @@ (defstate nav-enemy-notice (double-lurker) :virtual #t - :event - double-lurker-default-event-handler - :enter - (behavior () + :event double-lurker-default-event-handler + :enter (behavior () (start-hint-timer (game-text-id sunken-double-lurker-hint)) (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-notice) enter))) (if t9-1 @@ -743,32 +659,27 @@ (defstate nav-enemy-chase (double-lurker) :virtual #t - :event - double-lurker-default-event-handler + :event double-lurker-default-event-handler ) (defstate nav-enemy-stop-chase (double-lurker) :virtual #t - :event - double-lurker-default-event-handler + :event double-lurker-default-event-handler ) (defstate nav-enemy-stare (double-lurker) :virtual #t - :event - double-lurker-default-event-handler + :event double-lurker-default-event-handler ) (defstate nav-enemy-victory (double-lurker) :virtual #t - :event - double-lurker-default-event-handler + :event double-lurker-default-event-handler ) (defstate nav-enemy-die (double-lurker) :virtual #t - :enter - (behavior () + :enter (behavior () (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-2 user-int8 0) 1) @@ -784,13 +695,11 @@ ) (defstate double-lurker-both-knocked-back (double-lurker) - :enter - (behavior () + :enter (behavior () (set! (-> self knocked-back-speed) 40960.0) (none) ) - :trans - (behavior () + :trans (behavior () (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -919,31 +828,17 @@ (none) ) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! double-lurker-both-take-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go double-lurker-resume) (none) ) - :post - (the-as (function none :behavior double-lurker) nav-enemy-simple-post) + :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post) ) (defmethod dummy-52 double-lurker ((obj double-lurker) (arg0 vector)) @@ -1034,7 +929,7 @@ (collide-kind background) obj s4-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -1047,8 +942,7 @@ ) (defstate double-lurker-buddy-was-hit (double-lurker) - :code - (behavior () + :code (behavior () (set! (-> self buddy-on-shoulders?) #f) (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) @@ -1068,42 +962,25 @@ ) (defstate double-lurker-break-apart (double-lurker) - :event - double-lurker-default-event-handler - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + :event double-lurker-default-event-handler + :code (behavior () + (ja-no-eval :group! double-lurker-both-break-apart-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go double-lurker-resume) (none) ) - :post - (the-as (function none :behavior double-lurker) nav-enemy-simple-post) + :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post) ) (defstate double-lurker-knocked-back (double-lurker) - :enter - (behavior () + :enter (behavior () (set! (-> self knocked-back-speed) 40960.0) (none) ) - :trans - (behavior () + :trans (behavior () (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -1232,36 +1109,21 @@ (none) ) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 18))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 18)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 18)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! double-lurker-bottom-take-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go double-lurker-resume) (none) ) - :post - (the-as (function none :behavior double-lurker) nav-enemy-simple-post) + :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post) ) (defstate double-lurker-waiting-to-die (double-lurker) - :code - (behavior () + :code (behavior () (clear-collide-with-as (-> self collide-info)) (logior! (-> self draw status) (draw-status hidden)) (until (not (-> self child)) @@ -1406,7 +1268,7 @@ (defmethod TODO-RENAME-48 double-lurker ((obj double-lurker)) (set! (-> obj buddy-handle) (the-as handle #f)) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (set! (-> obj align) (new 'process 'align-control obj)) (initialize-skeleton obj *double-lurker-sg* '()) (set! (-> obj draw origin-joint-index) (the-as uint 3)) @@ -1446,26 +1308,11 @@ (if (-> obj buddy-on-shoulders?) (set! (-> s5-0 quad) (-> obj collide-info trans quad)) ) - (let ((s4-0 (get-process *default-dead-pool* double-lurker-top #x4000))) - (set! (-> obj buddy-handle) - (ppointer->handle - (when s4-0 - (let ((t9-6 (method-of-type double-lurker-top activate))) - (t9-6 (the-as double-lurker-top s4-0) obj 'double-lurker-top (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-0 - double-lurker-top-init-by-other - (-> obj entity) - obj - (-> obj buddy-on-shoulders?) - s5-0 - ) - (-> s4-0 ppointer) - ) - ) + (set! (-> obj buddy-handle) + (ppointer->handle + (process-spawn double-lurker-top (-> obj entity) obj (-> obj buddy-on-shoulders?) s5-0 :to obj) ) - ) + ) ) ) (when (and (not (-> obj dead?)) (not (-> obj buddy-on-shoulders?))) diff --git a/goal_src/levels/sunken/floating-launcher.gc b/goal_src/levels/sunken/floating-launcher.gc index 80415590e2..24b5b9ec09 100644 --- a/goal_src/levels/sunken/floating-launcher.gc +++ b/goal_src/levels/sunken/floating-launcher.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/floating-launcher-ag.gc") + (deftype floating-launcher (baseplat) ((trigger-height float :offset-assert 228) (launcher (pointer launcher) :offset-assert 232) @@ -23,51 +25,43 @@ ) -(defskelgroup *floating-launcher-sg* floating-launcher - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *floating-launcher-sg* floating-launcher floating-launcher-lod0-jg floating-launcher-idle-ja + ((floating-launcher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) (defstate floating-launcher-idle (floating-launcher) - :event - (the-as (function process int symbol event-message-block object :behavior floating-launcher) plat-event) - :trans - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior floating-launcher) plat-event) + :trans (behavior () (plat-trans) (when (< (vector-xz-length (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root-override trans))) 81920.0 ) - (if (and (>= (-> (target-pos 0) y) (-> self trigger-height)) (logtest? (-> *target* control status) 2)) + (if (and (>= (-> (target-pos 0) y) (-> self trigger-height)) + (logtest? (-> *target* control status) (cshape-moving-flags onground)) + ) (go floating-launcher-lowering) ) ) (none) ) - :code - (behavior () + :code (behavior () (transform-post) (suspend) (transform-post) (suspend) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior floating-launcher) plat-post) + :post (the-as (function none :behavior floating-launcher) plat-post) ) (defstate floating-launcher-lowering (floating-launcher) - :event - (the-as (function process int symbol event-message-block object :behavior floating-launcher) plat-event) - :trans - (the-as (function none :behavior floating-launcher) plat-trans) - :code - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior floating-launcher) plat-event) + :trans (the-as (function none :behavior floating-launcher) plat-trans) + :code (behavior () (let ((a0-1 (entity-actor-lookup (-> self entity) 'alt-actor 0))) (if a0-1 (entity-birth-no-kill a0-1) @@ -88,19 +82,14 @@ (go floating-launcher-ready) (none) ) - :post - (the-as (function none :behavior floating-launcher) plat-post) + :post (the-as (function none :behavior floating-launcher) plat-post) ) (defstate floating-launcher-ready (floating-launcher) - :event - (the-as (function process int symbol event-message-block object :behavior floating-launcher) plat-event) - :trans - (the-as (function none :behavior floating-launcher) plat-trans) - :code - (the-as (function none :behavior floating-launcher) plat-code) - :post - (the-as (function none :behavior floating-launcher) plat-post) + :event (the-as (function process int symbol event-message-block object :behavior floating-launcher) plat-event) + :trans (the-as (function none :behavior floating-launcher) plat-trans) + :code (the-as (function none :behavior floating-launcher) plat-code) + :post (the-as (function none :behavior floating-launcher) plat-post) ) (defmethod init-from-entity! floating-launcher ((obj floating-launcher) (arg0 entity-actor)) @@ -129,21 +118,8 @@ (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (eval-path-curve-div! (-> obj path) (-> obj root-override trans) 1.0 'interp) - (let ((f30-0 (res-lump-float arg0 'spring-height :default 163840.0)) - (s4-1 (get-process *default-dead-pool* launcher #x4000)) - ) - (set! (-> obj launcher) - (the-as - (pointer launcher) - (when s4-1 - (let ((t9-11 (method-of-type launcher activate))) - (t9-11 (the-as launcher s4-1) obj 'launcher (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 launcher-init-by-other (-> obj root-override trans) f30-0 0 81920.0) - (-> s4-1 ppointer) - ) - ) - ) + (let ((f30-0 (res-lump-float arg0 'spring-height :default 163840.0))) + (set! (-> obj launcher) (process-spawn launcher (-> obj root-override trans) f30-0 0 81920.0 :to obj)) ) (initialize-skeleton obj *floating-launcher-sg* '()) (logior! (-> obj skel status) (janim-status inited)) diff --git a/goal_src/levels/sunken/helix-water.gc b/goal_src/levels/sunken/helix-water.gc index 0b2f3c2692..06ed974368 100644 --- a/goal_src/levels/sunken/helix-water.gc +++ b/goal_src/levels/sunken/helix-water.gc @@ -8,12 +8,15 @@ (declare-type helix-water basic) (declare-type helix-slide-door basic) (declare-type helix-button basic) -(define-extern *helix-slide-door* helix-slide-door) +(define-extern *helix-slide-door* helix-slide-door) (define-extern *helix-water* helix-water) (define-extern *helix-button* helix-button) ;; DECOMP BEGINS +(import "goal_src/import/helix-slide-door-ag.gc") +(import "goal_src/import/helix-button-ag.gc") + (deftype helix-slide-door (process-drawable) ((root-override collide-shape :offset 112) ) @@ -29,13 +32,10 @@ ) -(defskelgroup *helix-slide-door-sg* helix-slide-door - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 12 0 18) - :longest-edge (meters 0) - ) +(defskelgroup *helix-slide-door-sg* helix-slide-door helix-slide-door-lod0-jg helix-slide-door-idle-ja + ((helix-slide-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 12 0 18) + ) (deftype helix-button (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -59,13 +59,10 @@ ) -(defskelgroup *helix-button-sg* helix-button - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 3.5 0 5.4) - :longest-edge (meters 0) - ) +(defskelgroup *helix-button-sg* helix-button helix-button-lod0-jg helix-button-idle-ja + ((helix-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3.5 0 5.4) + ) (deftype helix-dark-eco (dark-eco-pool) () @@ -101,8 +98,7 @@ (defstate water-vol-idle (helix-dark-eco) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (let ((a0-1 (-> self sound))) @@ -115,8 +111,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (let ((t9-0 (-> (method-of-type dark-eco-pool water-vol-idle) enter))) (if t9-0 (t9-0) @@ -128,8 +123,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((t9-0 (-> (method-of-type dark-eco-pool water-vol-idle) trans))) (if t9-0 (t9-0) @@ -138,8 +132,7 @@ (update! (-> self sound)) (none) ) - :post - (behavior () + :post (behavior () (let ((t9-0 (-> (method-of-type dark-eco-pool water-vol-idle) post))) (if t9-0 ((the-as (function none :behavior helix-dark-eco) t9-0)) @@ -151,17 +144,15 @@ ) (defstate helix-slide-door-idle-open (helix-slide-door) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go helix-slide-door-close) ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) @@ -169,37 +160,22 @@ ) (defstate helix-slide-door-close (helix-slide-door) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (transform-post) (go helix-slide-door-idle-closed) (none) ) - :post - (the-as (function none :behavior helix-slide-door) transform-post) + :post (the-as (function none :behavior helix-slide-door) transform-post) ) (defstate helix-slide-door-idle-closed (helix-slide-door) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -242,8 +218,7 @@ ) (defstate helix-button-startup (helix-button) - :code - (behavior () + :code (behavior () (when (not (task-complete? *game-info* (game-task sunken-slide))) (let ((a0-1 (new 'stack-no-clear 'vector))) (set! (-> a0-1 quad) (-> self root-override trans quad)) @@ -271,12 +246,11 @@ ) (defstate helix-button-idle-up (helix-button) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) (when *target* - (when (logtest? (-> *target* control status) 1) + (when (logtest? (-> *target* control status) (cshape-moving-flags onsurf)) (cond ((and (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) (not (handle->process (-> self fcell-handle))) @@ -293,9 +267,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -304,41 +277,33 @@ ) (defstate helix-button-activate (helix-button) - :trans - (the-as (function none :behavior helix-button) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior helix-button) rider-trans) + :code (behavior () (local-vars (v1-7 symbol)) (let ((a0-1 (handle->process (-> self fcell-handle)))) (when a0-1 (send-event a0-1 'pickup) (until v1-7 (suspend) - (set! v1-7 (or (not *target*) (zero? (logand (-> *target* state-flags) 256)))) + (set! v1-7 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) ) ) ) - (let* ((gp-0 (the-as sunkencam (get-process *default-dead-pool* sunkencam #x4000))) - (v1-11 - (when gp-0 - (let ((t9-2 (method-of-type sunkencam activate))) - (t9-2 gp-0 self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> self spawn-trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> gp-0 ppointer-override) - ) - ) - ) - (set! (-> v1-11 0 seq) (the-as uint 2)) + (let ((v1-11 + (process-spawn + sunkencam + :init pov-camera-init-by-other + (-> self spawn-trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + :to self + ) + ) + ) + (set! (-> (the-as (pointer sunkencam) v1-11) 0 seq) (the-as uint 2)) ) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) self) @@ -379,7 +344,7 @@ (game-task none) ) (send-event *target* 'play-anim 'shock-in) - (sound-play-by-name (static-sound-name "prec-button8") (new-sound-id) 1024 0 0 1 #t) + (sound-play "prec-button8") (set! (-> self root-override transv quad) (the-as uint128 0)) (let ((gp-3 5)) (until (<= gp-3 0) @@ -408,7 +373,7 @@ (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.25)) (suspend) ) - (sound-play-by-name (static-sound-name "maindoor") (new-sound-id) 1024 0 0 1 #t) + (sound-play "maindoor") (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.9)) (suspend) ) @@ -463,15 +428,12 @@ (go helix-button-idle-down) (none) ) - :post - (the-as (function none :behavior helix-button) rider-post) + :post (the-as (function none :behavior helix-button) rider-post) ) (defstate helix-button-quick-activate (helix-button) - :trans - (the-as (function none :behavior helix-button) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior helix-button) rider-trans) + :code (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) (set! (-> a1-0 num-params) 0) @@ -487,8 +449,8 @@ ) ) ) - (sound-play-by-name (static-sound-name "prec-button8") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "maindoor") (new-sound-id) 1024 0 0 1 #t) + (sound-play "prec-button8") + (sound-play "maindoor") (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) self) (set! (-> a1-3 num-params) 0) @@ -546,14 +508,12 @@ (go helix-button-idle-down) (none) ) - :post - (the-as (function none :behavior helix-button) rider-post) + :post (the-as (function none :behavior helix-button) rider-post) ) (defstate helix-button-idle-down (helix-button) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) @@ -651,55 +611,50 @@ ) (defstate helix-water-idle (helix-water) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'trigger) (go helix-water-activated) ) ((= v1-0 'music) - (set-setting! *setting-control* self 'music 'danger 0.0 0) + (set-setting! 'music 'danger 0.0 0) ) ) ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self root trans y) (-> self start-y)) (set! (-> self last-alt-actor-consumed) -1) (set! (-> self transv-y) 9216.0) (suspend) (send-event (ppointer->process (-> self dark-eco)) 'move-to (-> self root trans)) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior helix-water) ja-post) + :post (the-as (function none :behavior helix-water) ja-post) ) (defstate helix-water-activated (helix-water) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notify) (when (= (-> arg0 type) launcherdoor) - (clear-pending-settings-from-process *setting-control* self 'music) + (remove-setting! 'music) (go helix-water-idle) ) ) ) ) - :trans - (behavior () - (set! (-> self root scale y) (seek (-> self root scale y) 0.8 (* 0.667 (-> *display* seconds-per-frame)))) + :trans (behavior () + (seek! (-> self root scale y) 0.8 (* 0.667 (-> *display* seconds-per-frame))) (when *target* (let ((f0-4 (-> (target-pos 0) y))) - (when (zero? (logand (-> *target* state-flags) 256)) + (when (zero? (logand (-> *target* state-flags) (state-flags grabbed))) (let* ((f0-5 (- f0-4 (-> self root trans y))) (f0-6 (+ -40960.0 f0-5)) (f0-7 (* 0.000024414063 f0-6)) @@ -725,17 +680,15 @@ (dummy-21 self) (none) ) - :code - (behavior () + :code (behavior () (send-event (ppointer->process (-> self dark-eco)) 'trigger) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior helix-water) ja-post) + :post (the-as (function none :behavior helix-water) ja-post) ) (defmethod relocate helix-water ((obj helix-water) (arg0 int)) @@ -763,20 +716,7 @@ ) ) (set! (-> obj root trans y) (-> obj start-y)) - (let ((s5-1 (get-process *default-dead-pool* helix-dark-eco #x4000))) - (set! (-> obj dark-eco) - (the-as - (pointer helix-dark-eco) - (when s5-1 - (let ((t9-6 (method-of-type helix-dark-eco activate))) - (t9-6 (the-as helix-dark-eco s5-1) obj 'helix-dark-eco (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 water-vol-init-by-other (-> obj entity)) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> obj dark-eco) (process-spawn helix-dark-eco :init water-vol-init-by-other (-> obj entity) :to obj)) (set! *helix-water* obj) (go helix-water-idle) (none) diff --git a/goal_src/levels/sunken/orbit-plat.gc b/goal_src/levels/sunken/orbit-plat.gc index 567432d3d2..e3cd038d55 100644 --- a/goal_src/levels/sunken/orbit-plat.gc +++ b/goal_src/levels/sunken/orbit-plat.gc @@ -9,6 +9,9 @@ ;; DECOMP BEGINS +(import "goal_src/import/orbit-plat-ag.gc") +(import "goal_src/import/orbit-plat-bottom-ag.gc") + (deftype orbit-plat-bottom (process-drawable) ((parent-override (pointer orbit-plat) :offset 12) (part2 sparticle-launch-control :offset-assert 176) @@ -26,13 +29,10 @@ ) -(defskelgroup *orbit-plat-bottom-sg* orbit-plat-bottom - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.8) - :longest-edge (meters 0) - ) +(defskelgroup *orbit-plat-bottom-sg* orbit-plat-bottom orbit-plat-bottom-lod0-jg orbit-plat-bottom-idle-ja + ((orbit-plat-bottom-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.8) + ) (deftype orbit-plat (baseplat) ((other entity-actor :offset-assert 228) @@ -62,19 +62,15 @@ ) -(defskelgroup *orbit-plat-sg* orbit-plat - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3.4) - :longest-edge (meters 0) - ) +(defskelgroup *orbit-plat-sg* orbit-plat orbit-plat-lod0-jg orbit-plat-idle-ja + ((orbit-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.4) + ) (defpartgroup group-orbit-plat-jet :id 440 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1715 :fade-after (meters 100) :falloff-to (meters 120) :period 150 :length 75) + :parts ((sp-item 1715 :fade-after (meters 100) :falloff-to (meters 120) :period 150 :length 75) (sp-item 1715 :fade-after (meters 100) :falloff-to (meters 120) :period 75 :length 96) (sp-item 1715 :fade-after (meters 140) :falloff-to (meters 160) :period 90 :length 60) (sp-item 1716 :fade-after (meters 100) :falloff-to (meters 100)) @@ -82,8 +78,7 @@ ) (defpart 1716 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -104,17 +99,9 @@ ) (defpart 1715 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "steam-medium") - :volume #x333 - ) - ) + (sp-sound (static-sound-spec "steam-medium" :num 0.05 :volume 80.0)) (sp-rnd-flt spt-scale-x (meters 0.75) (meters 0.75) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -135,8 +122,7 @@ ) (defpart 1717 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 3.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.7) (meters 0.3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -166,22 +152,14 @@ ) (set! (-> *part-id-table* 1717 init-specs 1 random-rangef) (* 0.000009494358 f30-0)) ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 1717) - arg0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 1717) arg0) 0 (none) ) (defstate orbit-plat-bottom-idle (orbit-plat-bottom) - :code - (behavior () - (while #t + :code (behavior () + (loop (set! (-> self root trans quad) (-> self parent-override 0 root-override trans quad)) (set! (-> self root trans y) (+ -5324.8 (-> self root trans y))) (spawn (-> self part2) (-> self root trans)) @@ -251,8 +229,7 @@ ) (none) ) - :post - (the-as (function none :behavior orbit-plat-bottom) ja-post) + :post (the-as (function none :behavior orbit-plat-bottom) ja-post) ) (defmethod relocate orbit-plat-bottom ((obj orbit-plat-bottom) (arg0 int)) @@ -270,7 +247,7 @@ (none) ) -(defbehavior orbit-plat-bottom-init-by-other orbit-plat-bottom ((arg0 entity) (arg1 orbit-plat)) +(defbehavior orbit-plat-bottom-init-by-other orbit-plat-bottom ((arg0 entity-actor) (arg1 orbit-plat)) (set! (-> self entity) arg0) (set! (-> self mask) (logior (process-mask platform) (-> self mask))) (set! (-> self root) (new 'process 'trsqv)) @@ -282,21 +259,13 @@ (set! (-> self part2) (create-launch-control (-> *part-group-id-table* 107) self)) (initialize-skeleton self *orbit-plat-bottom-sg* '()) (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! orbit-plat-idle-ja :num! min) (go orbit-plat-bottom-idle) (none) ) (defstate orbit-plat-idle (orbit-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'bonk) @@ -332,28 +301,18 @@ ) ) ) - :trans - (the-as (function none :behavior orbit-plat) plat-trans) - :code - (behavior () + :trans (the-as (function none :behavior orbit-plat) plat-trans) + :code (behavior () (set! (-> self plat-status) (the-as uint 0)) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 0.0) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek! 0.0)) (dotimes (gp-0 2) (transform-post) (suspend) - (when (not (ja-done? 0)) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) 0.0) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) + (if (not (ja-done? 0)) + (ja :num! (seek! 0.0)) ) - ) ) - (while #t + (loop (when (nonzero? (-> self root-override riders num-riders)) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) self) @@ -373,13 +332,9 @@ (go orbit-plat-riding) ) (suspend) - (when (not (ja-done? 0)) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 0.0) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) + (if (not (ja-done? 0)) + (ja :num! (seek! 0.0)) ) - ) (when (not (-> self is-reset?)) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) self) @@ -400,8 +355,7 @@ ) (none) ) - :post - (the-as (function none :behavior orbit-plat) plat-post) + :post (the-as (function none :behavior orbit-plat) plat-post) ) (defmethod dummy-28 orbit-plat ((obj orbit-plat)) @@ -425,8 +379,7 @@ ) (defstate orbit-plat-still (orbit-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'bonk) @@ -439,17 +392,11 @@ ) ) ) - :trans - (the-as (function none :behavior orbit-plat) plat-trans) - :code - (behavior () + :trans (the-as (function none :behavior orbit-plat) plat-trans) + :code (behavior () (set! (-> self plat-status) (the-as uint 0)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 0.0) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek! 0.0)) (until (dummy-28 self) (when (nonzero? (-> self root-override riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -470,35 +417,23 @@ (go orbit-plat-riding) ) (suspend) - (when (not (ja-done? 0)) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) 0.0) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) + (if (not (ja-done? 0)) + (ja :num! (seek! 0.0)) ) - ) ) (go orbit-plat-idle) (none) ) - :post - (the-as (function none :behavior orbit-plat) plat-post) + :post (the-as (function none :behavior orbit-plat) plat-post) ) (defstate orbit-plat-riding (orbit-plat) - :event - (the-as (function process int symbol event-message-block object :behavior orbit-plat) plat-event) - :trans - (the-as (function none :behavior orbit-plat) plat-trans) - :code - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior orbit-plat) plat-event) + :trans (the-as (function none :behavior orbit-plat) plat-trans) + :code (behavior () (set! (-> self plat-status) (the-as uint 1)) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) - (while #t + (ja-no-eval :num! (seek!)) + (loop (when (zero? (-> self root-override riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) @@ -518,18 +453,13 @@ (go orbit-plat-still) ) (suspend) - (when (not (ja-done? 0)) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) + (if (not (ja-done? 0)) + (ja :num! (seek!)) ) - ) ) (none) ) - :post - (the-as (function none :behavior orbit-plat) plat-post) + :post (the-as (function none :behavior orbit-plat) plat-post) ) (defun get-rotate-point! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float) (arg5 float)) @@ -553,7 +483,7 @@ (defun get-nav-point! ((arg0 vector) (arg1 orbit-plat) (arg2 vector) (arg3 float)) (set! (-> arg1 nav target-pos quad) (-> arg2 quad)) - (logclear! (-> arg1 nav flags) (nav-control-flags bit19)) + (logclear! (-> arg1 nav flags) (nav-control-flags navcf19)) (dummy-11 (-> arg1 nav) (-> arg1 nav target-pos)) (let ((f0-0 (vector-length (-> arg1 nav travel)))) (if (< arg3 f0-0) @@ -568,8 +498,7 @@ ) (defstate orbit-plat-rotating (orbit-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'bonk) @@ -582,10 +511,8 @@ ) ) ) - :trans - (the-as (function none :behavior orbit-plat) plat-trans) - :code - (behavior () + :trans (the-as (function none :behavior orbit-plat) plat-trans) + :code (behavior () (set! (-> self plat-status) (the-as uint 2)) (set! (-> self is-reset?) #f) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -609,11 +536,7 @@ (vector-! a0-0 (-> self basetrans) gp-0) (let ((f30-0 (vector-length a0-0))) (set! (-> self reset-length) f30-0) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 0.0) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek! 0.0)) (label cfg-3) (dotimes (s4-0 2) (get-rotate-point! s5-0 gp-0 (-> self basetrans) (the-as vector f30-0) (-> self rot-dir) 40960.0) @@ -628,18 +551,13 @@ ) (label cfg-9) (suspend) - (when (not (ja-done? 0)) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) 0.0) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) + (if (not (ja-done? 0)) + (ja :num! (seek! 0.0)) ) - ) (b! #t cfg-3 :delay (nop!)) (none) ) - :post - (the-as (function none :behavior orbit-plat) plat-post) + :post (the-as (function none :behavior orbit-plat) plat-post) ) ;; WARN: disable def twice: 132. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. @@ -717,7 +635,7 @@ ) ) (when (>= 614.4 (vector-vector-xz-distance (-> obj basetrans) (-> obj reset-trans))) - (set! v0-11 (logior (nav-control-flags bit19) (-> obj nav flags))) + (set! v0-11 (logior (nav-control-flags navcf19) (-> obj nav flags))) (set! (-> obj nav flags) (the-as nav-control-flags v0-11)) v0-11 ) @@ -744,7 +662,7 @@ (vector-normalize! s5-2 (-> obj reset-length)) (vector+! s5-2 s5-2 s4-1) (when (not (dummy-16 (-> obj nav) s5-2)) - (logclear! (-> obj nav flags) (nav-control-flags bit19)) + (logclear! (-> obj nav flags) (nav-control-flags navcf19)) (get-rotate-point! s5-2 s4-1 (-> obj basetrans) (the-as vector (-> obj reset-length)) 0.0 40960.0) (when (not (dummy-16 (-> obj nav) s5-2)) (get-rotate-point! @@ -793,8 +711,7 @@ ) (defstate orbit-plat-reset (orbit-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'bonk) @@ -807,18 +724,12 @@ ) ) ) - :trans - (the-as (function none :behavior orbit-plat) plat-trans) - :code - (behavior () + :trans (the-as (function none :behavior orbit-plat) plat-trans) + :code (behavior () (set! (-> self plat-status) (the-as uint 3)) - (logclear! (-> self nav flags) (nav-control-flags bit19)) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) 0.0) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) - (while (zero? (logand (nav-control-flags bit19) (-> self nav flags))) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) + (ja-no-eval :num! (seek! 0.0)) + (while (zero? (logand (nav-control-flags navcf19) (-> self nav flags))) (dummy-27 self) (when (nonzero? (-> self root-override riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -839,32 +750,22 @@ (go orbit-plat-riding) ) (suspend) - (when (not (ja-done? 0)) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) 0.0) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) + (if (not (ja-done? 0)) + (ja :num! (seek! 0.0)) ) - ) ) (set! (-> self is-reset?) #t) (go orbit-plat-idle) (none) ) - :post - (the-as (function none :behavior orbit-plat) plat-post) + :post (the-as (function none :behavior orbit-plat) plat-post) ) (defstate orbit-plat-wait-for-other (orbit-plat) - :code - (behavior () + :code (behavior () (set! (-> self plat-status) (the-as uint 0)) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 0.0) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) - (while #t + (ja-no-eval :num! (seek! 0.0)) + (loop (let ((v1-3 (-> self other))) (when (if v1-3 (-> v1-3 extra process) @@ -874,18 +775,13 @@ ) ) (suspend) - (when (not (ja-done? 0)) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) 0.0) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) + (if (not (ja-done? 0)) + (ja :num! (seek! 0.0)) ) - ) ) (none) ) - :post - (the-as (function none :behavior orbit-plat) ja-post) + :post (the-as (function none :behavior orbit-plat) ja-post) ) (defmethod init-from-entity! orbit-plat ((obj orbit-plat) (arg0 entity-actor)) @@ -927,7 +823,7 @@ (update-transforms! (-> obj root-override)) (dummy-21 obj) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav gap-event) 'blocked) (set! (-> obj other) (entity-actor-lookup arg0 'alt-actor 0)) (let ((f0-7 (res-lump-float arg0 'scale :default 1.0))) @@ -937,15 +833,7 @@ (set! (-> obj rot-dir) 1.0) (set! (-> obj reset-trans quad) (-> obj basetrans quad)) (set! (-> obj is-reset?) #t) - (let ((s5-1 (get-process *default-dead-pool* orbit-plat-bottom #x4000))) - (when s5-1 - (let ((t9-18 (method-of-type orbit-plat-bottom activate))) - (t9-18 (the-as orbit-plat-bottom s5-1) obj 'orbit-plat-bottom (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 orbit-plat-bottom-init-by-other (-> obj entity) obj) - (-> s5-1 ppointer) - ) - ) + (process-spawn orbit-plat-bottom (-> obj entity) obj :to obj) (go orbit-plat-wait-for-other) (none) ) diff --git a/goal_src/levels/sunken/puffer.gc b/goal_src/levels/sunken/puffer.gc index b743df03a4..7b40bb9eb5 100644 --- a/goal_src/levels/sunken/puffer.gc +++ b/goal_src/levels/sunken/puffer.gc @@ -5,14 +5,11 @@ ;; name in dgo: puffer ;; dgos: L1, SUN, SUNKEN -(define-extern *puffer-sg* skeleton-group) -(define-extern *puffer-mean-sg* skeleton-group) - -(declare-type puffer process-drawable) - ;; DECOMP BEGINS +(import "goal_src/import/puffer-ag.gc") + (deftype puffer (process-drawable) ((root-override collide-shape-moving :offset 112) (fact-info-override fact-info-enemy :offset 144) @@ -71,23 +68,19 @@ ) -(defskelgroup *puffer-sg* puffer - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 5.25) - :longest-edge (meters 1.2) - :shadow 4 - ) +(defskelgroup *puffer-sg* puffer puffer-main-lod0-jg -1 + ((puffer-main-lod0-mg (meters 20)) (puffer-main-lod1-mg (meters 40)) (puffer-main-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 5.25) + :longest-edge (meters 1.2) + :shadow puffer-main-shadow-mg + ) -(defskelgroup *puffer-mean-sg* puffer - 5 - -1 - ((6 (meters 20)) (7 (meters 40)) (8 (meters 999999))) - :bounds (static-spherem 0 1 0 5.25) - :longest-edge (meters 1.2) - :shadow 4 - ) +(defskelgroup *puffer-mean-sg* puffer puffer-mean-lod0-jg -1 + ((puffer-mean-lod0-mg (meters 20)) (puffer-mean-lod1-mg (meters 40)) (puffer-mean-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 5.25) + :longest-edge (meters 1.2) + :shadow puffer-main-shadow-mg + ) ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 56] (defbehavior puffer-default-event-handler puffer ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) @@ -117,21 +110,15 @@ (return (the-as object #t)) ) (when (= (-> arg0 type) target) - (let ((a1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-9 from) self) - (set! (-> a1-9 num-params) 2) - (set! (-> a1-9 message) 'attack) - (set! (-> a1-9 param 0) (-> arg3 param 0)) - (let ((v1-19 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-19 shove-up) 6144.0) - (set! (-> v1-19 shove-back) 10240.0) - (set! (-> a1-9 param 1) (the-as uint v1-19)) - ) - (when (send-event-function arg0 a1-9) - (set! (-> self hit-player?) #t) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) - ) + (when (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) + ) + (set! (-> self hit-player?) #t) + (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) ) ) ) @@ -141,9 +128,13 @@ (defbehavior puffer-post puffer () (when (and (-> self hit-player?) - (or (not *target*) (and (zero? (logand (-> *target* state-flags) #x80f8)) - (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) + (or (not *target*) + (and (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) + ) + (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) + ) ) ) (set-collide-offense (-> self root-override) 2 (collide-offense normal-attack)) @@ -155,7 +146,10 @@ (defmethod dummy-28 puffer ((obj puffer)) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((s5-0 (new 'stack-no-clear 'collide-tri-result)) (a1-0 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) @@ -171,12 +165,12 @@ (collide-kind background cak-3 ground-object) obj s5-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) (let ((v1-11 (-> obj draw shadow-ctrl))) - (set! (-> v1-11 settings flags) (logand -33 (-> v1-11 settings flags))) + (logclear! (-> v1-11 settings flags) (shadow-flags disable-draw)) ) 0 (let ((v1-14 (-> obj draw shadow-ctrl))) @@ -190,7 +184,7 @@ ) (else (let ((v1-19 (-> obj draw shadow-ctrl))) - (logior! (-> v1-19 settings flags) 32) + (logior! (-> v1-19 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -199,7 +193,7 @@ ) (else (let ((v1-21 (-> obj draw shadow-ctrl))) - (logior! (-> v1-21 settings flags) 32) + (logior! (-> v1-21 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -234,7 +228,10 @@ (defmethod dummy-25 puffer ((obj puffer) (arg0 float)) (when *target* (let ((gp-0 (target-pos 0))) - (when (and (zero? (logand (-> *target* state-flags) #x80f8)) + (when (and (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) (dummy-24 obj gp-0) (>= (-> gp-0 y) (+ -14336.0 (-> obj attack-bottom-y))) (>= (+ 2048.0 (-> obj top-y)) (-> gp-0 y)) @@ -568,22 +565,19 @@ ) (defstate puffer-idle (puffer) - :event - puffer-default-event-handler - :enter - (behavior () + :event puffer-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self attacking?) #f) (shut-down! (-> self neck)) (let ((v1-5 (-> self draw shadow-ctrl))) - (logior! (-> v1-5 settings flags) 32) + (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) 0 (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (and (and *target* (>= (-> self fact-info-override idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -598,15 +592,12 @@ ) (none) ) - :post - puffer-post + :post puffer-post ) (defstate puffer-patrol (puffer) - :event - puffer-default-event-handler - :enter - (behavior () + :event puffer-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self attacking?) #f) (set! (-> self reaction-delay) (rand-vu-int-range (seconds 0.1) (seconds 0.35))) @@ -618,8 +609,7 @@ (set! (-> self last-on-screen-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (not (and *target* (>= (-> self fact-info-override idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -667,37 +657,31 @@ (dummy-28 self) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (dummy-26 self) (suspend) ) (none) ) - :post - puffer-post + :post puffer-post ) (defstate puffer-attack (puffer) - :event - puffer-default-event-handler - :enter - (behavior () + :event puffer-default-event-handler + :enter (behavior () (set! (-> self attacking?) #t) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self travel-turn-speed) 21845.334) (none) ) - :exit - (behavior () + :exit (behavior () (shut-down! (-> self neck)) (set! (-> self attacking?) #f) (set! (-> self travel-turn-speed) 16384.0) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (dummy-25 self (-> self give-up-dist))) (go puffer-patrol) ) @@ -721,21 +705,18 @@ (dummy-28 self) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (dummy-26 self) (suspend) ) (none) ) - :post - puffer-post + :post puffer-post ) (defstate puffer-die (puffer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as uint @@ -753,34 +734,20 @@ ) ) ) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (shut-down! (-> self neck)) (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) (clear-collide-with-as (-> self root-override)) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 15)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!) - ) + (ja-no-eval :group! puffer-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (none) ) - :post - (the-as (function none :behavior puffer) ja-post) + :post (the-as (function none :behavior puffer) ja-post) ) (defmethod dummy-21 puffer ((obj puffer)) @@ -888,7 +855,7 @@ ) (cond ((-> obj attacking?) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (let ((s5-0 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! s5-0 @@ -930,7 +897,7 @@ ) (cond ((not (-> obj attacking?)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (let ((s5-1 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! s5-1 @@ -972,7 +939,7 @@ ) (cond ((ja-done? 0) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (cond ((-> obj attacking?) (let ((s5-2 (-> obj skel root-channel 0))) @@ -1011,7 +978,7 @@ ) ) (else - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (let ((s5-4 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! s5-4 @@ -1035,7 +1002,7 @@ ) (cond ((-> obj attacking?) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (let ((s5-5 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! s5-5 @@ -1077,7 +1044,7 @@ ) (cond ((not (-> obj attacking?)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (let ((s5-6 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! s5-6 @@ -1119,7 +1086,7 @@ ) (cond ((ja-done? 0) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (let ((s5-7 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! s5-7 @@ -1144,7 +1111,7 @@ ) ) (else - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (let ((s5-8 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! s5-8 @@ -1193,7 +1160,7 @@ (set! (-> obj look-mean?) #f) (set! (-> obj travel-turn-speed) 16384.0) (dummy-21 obj) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (initialize-skeleton obj *puffer-sg* '()) (set! (-> obj draw origin-joint-index) (the-as uint 3)) (logclear! (-> obj mask) (process-mask actor-pause)) @@ -1204,7 +1171,7 @@ (set! (-> obj notice-dist) (res-lump-float arg0 'notice-dist :default 57344.0)) (set! (-> obj give-up-dist) (+ 20480.0 (-> obj notice-dist))) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (TODO-RENAME-26 (-> obj nav)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) diff --git a/goal_src/levels/sunken/qbert-plat.gc b/goal_src/levels/sunken/qbert-plat.gc index 7981872be4..d462519a7c 100644 --- a/goal_src/levels/sunken/qbert-plat.gc +++ b/goal_src/levels/sunken/qbert-plat.gc @@ -10,6 +10,9 @@ ;; DECOMP BEGINS +(import "goal_src/import/qbert-plat-ag.gc") +(import "goal_src/import/qbert-plat-on-ag.gc") + (deftype qbert-plat-on (process-drawable) () :heap-base #x40 @@ -19,13 +22,10 @@ ) -(defskelgroup *qbert-plat-on-sg* qbert-plat-on - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -2 0 4.5) - :longest-edge (meters 0) - ) +(defskelgroup *qbert-plat-on-sg* qbert-plat-on qbert-plat-on-lod0-jg qbert-plat-on-idle-ja + ((qbert-plat-on-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -2 0 4.5) + ) (deftype qbert-plat (rigid-body-platform) ((anchor-point vector :inline :offset-assert 736) @@ -46,13 +46,10 @@ ) -(defskelgroup *qbert-plat-sg* qbert-plat - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -2 0 4.5) - :longest-edge (meters 0) - ) +(defskelgroup *qbert-plat-sg* qbert-plat qbert-plat-lod0-jg qbert-plat-idle-ja + ((qbert-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -2 0 4.5) + ) (define *qbert-plat-constants* (new 'static 'rigid-body-platform-constants :drag-factor 2.0 @@ -109,18 +106,16 @@ (defstate qbert-plat-on-mimic (qbert-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('die) (go qbert-plat-on-die) ) ) ) - :code - (behavior () + :code (behavior () (set-vector! (-> self draw color-emissive) 0.0 0.0 1.0 0.0) - (while #t + (loop (let ((gp-0 (-> self parent))) (set! (-> self root-overlay trans quad) (-> (the-as (pointer rigid-body-platform) gp-0) 0 root-overlay trans quad) @@ -137,19 +132,17 @@ ) (none) ) - :post - (the-as (function none :behavior qbert-plat) ja-post) + :post (the-as (function none :behavior qbert-plat) ja-post) ) (defstate qbert-plat-on-die (qbert-plat) - :code - (behavior () + :code (behavior () '() (none) ) ) -(defbehavior qbert-plat-on-init-by-other qbert-plat ((arg0 entity) (arg1 qbert-plat)) +(defbehavior qbert-plat-on-init-by-other qbert-plat ((arg0 entity-actor) (arg1 qbert-plat)) (set! (-> self entity) arg0) (set! (-> self mask) (logior (process-mask platform) (-> self mask))) (set! (-> self root-overlay) (the-as collide-shape-moving (new 'process 'trsqv))) @@ -159,14 +152,7 @@ (initialize-skeleton self *qbert-plat-on-sg* '()) (logior! (-> self skel status) (janim-status inited)) (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! qbert-plat-idle-ja :num! min) (go qbert-plat-on-mimic) (none) ) @@ -208,16 +194,8 @@ (set! (-> obj on?) v1-3) (cond (v1-3 - (let ((s5-0 (get-process *default-dead-pool* qbert-plat-on #x4000))) - (when s5-0 - (let ((t9-2 (method-of-type qbert-plat-on activate))) - (t9-2 (the-as qbert-plat-on s5-0) obj 'qbert-plat-on (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 qbert-plat-on-init-by-other (-> obj entity) obj) - (-> s5-0 ppointer) - ) - ) - (sound-play-by-name (static-sound-name "plat-light-on") (new-sound-id) 1024 0 0 1 #t) + (process-spawn qbert-plat-on (-> obj entity) obj :to obj) + (sound-play "plat-light-on") ) (else (let ((gp-2 (-> obj child))) @@ -226,7 +204,7 @@ (set! gp-2 (-> gp-2 0 brother)) ) ) - (sound-play-by-name (static-sound-name "plat-light-off") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plat-light-off") ) ) ) @@ -236,9 +214,8 @@ ) (defstate qbert-plat-wait-for-master (qbert-plat) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((v1-0 (-> self master))) (when (if v1-0 (-> v1-0 extra process) @@ -253,38 +230,31 @@ ) (none) ) - :post - (the-as (function none :behavior qbert-plat) ja-post) + :post (the-as (function none :behavior qbert-plat) ja-post) ) (defstate rigid-body-platform-idle (qbert-plat) :virtual #t - :event - qbert-plat-event-handler - :code - (behavior () - (while #t + :event qbert-plat-event-handler + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior qbert-plat) ja-post) + :post (the-as (function none :behavior qbert-plat) ja-post) ) (defstate rigid-body-platform-float (qbert-plat) :virtual #t - :event - qbert-plat-event-handler - :exit - (behavior () + :event qbert-plat-event-handler + :exit (behavior () (if (-> self on?) (logior! (-> self draw status) (draw-status hidden)) ) (none) ) - :trans - (behavior () + :trans (behavior () (logclear! (-> self draw status) (draw-status hidden)) ((-> (method-of-type rigid-body-platform rigid-body-platform-float) trans)) (let* ((v1-5 (-> self root-overlay riders)) @@ -299,8 +269,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () ((the-as (function none :behavior qbert-plat) (-> (method-of-type rigid-body-platform rigid-body-platform-float) post) @@ -406,8 +375,7 @@ ) (defstate qbert-plat-master-idle (qbert-plat-master) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (start-hint-timer (game-text-id sunken-qbert-plat-hint)) @@ -418,7 +386,7 @@ (set! (-> self last-plat-triggered) (the-as int v1-2)) (let ((s5-1 (= (-> self plat-states-needed-to-open-door) (-> self plat-states)))) (let ((v1-3 (ash 1 v1-2))) - (set! (-> self plat-states) (logxor (-> self plat-states) (the-as uint v1-3))) + (logxor! (-> self plat-states) (the-as uint v1-3)) (if (zero? (logand v1-3 (-> self plat-states))) (level-hint-spawn (game-text-id sunken-qbert-plat-hint) @@ -442,9 +410,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (-> self puzzle-beaten?)) (when (task-complete? *game-info* (game-task sunken-platforms)) (set! (-> self puzzle-beaten?) #t) @@ -485,7 +452,7 @@ ) (when (and *target* (not (-> self puzzle-beaten?))) (let ((gp-0 #f)) - (let ((s5-1 (logtest? (-> *target* water flags) 512))) + (let ((s5-1 (logtest? (-> *target* water flags) (water-flags wt09)))) (when s5-1 (when (not (-> self player-in-water?)) (set! gp-0 #t) @@ -500,7 +467,7 @@ ) (set! (-> self player-in-water?) s5-1) ) - (when (logtest? (-> *target* control status) 1) + (when (logtest? (-> *target* control status) (cshape-moving-flags onsurf)) (let ((s5-2 #t)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -569,8 +536,7 @@ ) (defstate qbert-plat-master-do-door (qbert-plat-master) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (when (not (-> self play-door-cam?)) (cond (arg0 @@ -644,48 +610,14 @@ (cond (arg0 (ambient-hint-spawn "gamcam08" (the-as vector #f) *entity-pool* 'camera) - (let ((s5-0 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-0 - (let ((t9-7 (method-of-type pov-camera activate))) - (t9-7 (the-as pov-camera s5-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> s5-0 ppointer) - ) - ) + (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "qbert-show-door-open" 0 #f '() :to self) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.4)) (suspend) ) ) (else (ambient-hint-spawn "gamcam07" (the-as vector #f) *entity-pool* 'camera) - (let ((s5-1 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-1 - (let ((t9-11 (method-of-type pov-camera activate))) - (t9-11 (the-as pov-camera s5-1) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-close" - 0 - #f - '() - ) - (-> s5-1 ppointer) - ) - ) + (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "qbert-show-door-close" 0 #f '() :to self) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (suspend) ) @@ -764,9 +696,8 @@ ) (defstate qbert-plat-master-wait-for-door (qbert-plat-master) - :code - (behavior () - (while #t + :code (behavior () + (loop (let* ((v1-0 (-> self door)) (gp-0 (if v1-0 (-> v1-0 extra process) diff --git a/goal_src/levels/sunken/shover.gc b/goal_src/levels/sunken/shover.gc index cd96b1077d..957020a036 100644 --- a/goal_src/levels/sunken/shover.gc +++ b/goal_src/levels/sunken/shover.gc @@ -10,6 +10,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/shover-ag.gc") + (deftype shover (process-drawable) ((root-override collide-shape :offset 112) (shove-up float :offset-assert 176) @@ -24,17 +26,13 @@ ) -(defskelgroup *shover-sg* shover - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *shover-sg* shover shover-lod0-jg shover-idle-ja + ((shover-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) (defstate shover-idle (shover) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (when (= (-> arg0 type) target) @@ -53,51 +51,36 @@ *entity-pool* (game-task none) ) - (cond - ((or (= (-> *target* control unknown-surface00 mode) 'air) - (>= (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> *target* control unknown-dword11)) - (< 0.75 (-> *target* control poly-normal y)) - ) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'attack-or-shove) - (set! (-> a1-6 param 0) (-> arg3 param 0)) - (let ((v1-22 (new 'static 'attack-info :mask #xa2))) - (set! (-> v1-22 mode) 'burn) - (set! (-> v1-22 vector quad) (-> s4-0 vector quad)) - (set! (-> v1-22 shove-up) (-> s4-0 shove-up)) - (set! (-> a1-6 param 1) (the-as uint v1-22)) - ) - (send-event-function arg0 a1-6) - ) - ) - (else - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'attack-or-shove) - (set! (-> a1-7 param 0) (-> arg3 param 0)) - (let ((v1-26 (new 'static 'attack-info :mask #x8e2))) - (set! (-> v1-26 mode) 'burn) - (set! (-> v1-26 shove-up) 0.0) - (set! (-> v1-26 shove-back) 8192.0) - (set! (-> v1-26 vector quad) (-> *target* control poly-normal quad)) - (set! (-> v1-26 angle) 'shove) - (set! (-> a1-7 param 1) (the-as uint v1-26)) + (if (or (= (-> *target* control unknown-surface00 mode) 'air) + (>= (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> *target* control unknown-dword11)) + (< 0.75 (-> *target* control poly-normal y)) ) - (send-event-function arg0 a1-7) + (send-event + arg0 + 'attack-or-shove + (-> arg3 param 0) + (static-attack-info ((mode 'burn) (vector (-> s4-0 vector)) (shove-up (-> s4-0 shove-up)))) + ) + (send-event + arg0 + 'attack-or-shove + (-> arg3 param 0) + (static-attack-info ((mode 'burn) + (shove-up (meters 0)) + (shove-back (meters 2)) + (vector (-> *target* control poly-normal)) + (angle 'shove) + ) + ) ) ) - ) ) ) ) ) ) ) - :code - (the-as (function none :behavior shover) anim-loop) + :code (the-as (function none :behavior shover) anim-loop) ) (defmethod init-from-entity! shover ((obj shover) (arg0 entity-actor)) diff --git a/goal_src/levels/sunken/square-platform.gc b/goal_src/levels/sunken/square-platform.gc index 761589f0d3..c1b1dc828b 100644 --- a/goal_src/levels/sunken/square-platform.gc +++ b/goal_src/levels/sunken/square-platform.gc @@ -10,6 +10,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/square-platform-ag.gc") + (deftype square-platform (baseplat) ((plat-id int32 :offset-assert 228) (pos-u float :offset-assert 232) @@ -38,13 +40,10 @@ ) -(defskelgroup *square-platform-sg* square-platform - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 -11 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *square-platform-sg* square-platform square-platform-lod0-jg square-platform-idle-ja + ((square-platform-lod0-mg (meters 20)) (square-platform-lod1-mg (meters 999999))) + :bounds (static-spherem 0 -11 0 8) + ) (deftype square-platform-button (basebutton) () @@ -81,13 +80,11 @@ :id 437 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2222 :flags (is-3d)) (sp-item 2315 :flags (is-3d))) + :parts ((sp-item 2222 :flags (is-3d)) (sp-item 2315 :flags (is-3d))) ) (defpart 2222 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 0) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 3.5) (meters 3.5) 1.0) @@ -111,13 +108,11 @@ ) (defpart 2316 - :init-specs - ((sp-flt spt-fade-a -0.17066666)) + :init-specs ((sp-flt spt-fade-a -0.17066666)) ) (defpart 2315 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 3) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) @@ -144,13 +139,11 @@ :id 438 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2223)) + :parts ((sp-item 2223)) ) (defpart 2223 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-z (meters -4) (meters 8) 1.0) @@ -173,16 +166,14 @@ ) (defpart 2317 - :init-specs - ((sp-flt spt-fade-a 0.0)) + :init-specs ((sp-flt spt-fade-a 0.0)) ) (defpartgroup group-square-platform-submerge-splash :id 439 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2222 :flags (is-3d)) (sp-item 2315 :flags (is-3d))) + :parts ((sp-item 2222 :flags (is-3d)) (sp-item 2315 :flags (is-3d))) ) (defmethod TODO-RENAME-27 square-platform ((obj square-platform) (arg0 symbol)) @@ -232,7 +223,7 @@ (t1-0 1) (t2-0 #t) ) - (s2-0 (the-as sound-name s1-0) s0-0 sv-48 a3-0 t0-0 t1-0 t2-0) + (s2-0 (the-as sound-name s1-0) s0-0 sv-48 a3-0 t0-0 (the-as sound-group t1-0) t2-0) ) ) ) @@ -271,8 +262,7 @@ ) (defstate square-platform-lowered (square-platform) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (if (and (= (-> arg0 type) square-platform-master) @@ -283,10 +273,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self pos-u) 0.0) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -295,8 +284,7 @@ ) (defstate square-platform-rising (square-platform) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((or (= v1-0 'bonk) (= v1-0 'bounce)) @@ -309,15 +297,13 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self start-splash-time) 0) (set! (-> self splash-counter) 0) 0 (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self pos-u) (seek-with-smooth (-> self pos-u) 1.0 (/ 1.0 (* 0.75 (-> *display* frames-per-second))) 0.8 0.01) ) @@ -330,21 +316,18 @@ (TODO-RENAME-27 self #t) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior square-platform) plat-post) + :post (the-as (function none :behavior square-platform) plat-post) ) (defstate square-platform-raised (square-platform) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((or (= v1-0 'bonk) (= v1-0 'bounce)) @@ -357,24 +340,20 @@ ) ) ) - :trans - (the-as (function none :behavior square-platform) plat-trans) - :code - (behavior () + :trans (the-as (function none :behavior square-platform) plat-trans) + :code (behavior () (set! (-> self pos-u) 1.0) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior square-platform) plat-post) + :post (the-as (function none :behavior square-platform) plat-post) ) (defstate square-platform-lowering (square-platform) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((or (= v1-0 'bonk) (= v1-0 'bounce)) @@ -384,22 +363,20 @@ (go square-platform-rising) ) ((= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) #f ) ) ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self start-splash-time) 0) (set! (-> self splash-counter) 0) 0 (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self pos-u) (seek-with-smooth (-> self pos-u) 0.0 (/ 1.0 (* 0.75 (-> *display* frames-per-second))) 0.8 0.01) ) @@ -412,16 +389,14 @@ (TODO-RENAME-27 self #f) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior square-platform) plat-post) + :post (the-as (function none :behavior square-platform) plat-post) ) (defmethod deactivate square-platform ((obj square-platform)) @@ -526,8 +501,7 @@ ) (defstate square-platform-master-idle (square-platform-master) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (when (= (-> arg0 type) square-platform-button) @@ -539,8 +513,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -549,8 +522,7 @@ ) (defstate square-platform-master-activate (square-platform-master) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self wiggled?) #f) (sleep (-> self ticker) (-> self timeout)) @@ -561,95 +533,71 @@ (let ((v1-7 (-> self button-id))) (cond ((zero? v1-7) - (let* ((s5-0 (get-process *default-dead-pool* sunkencam #x4000)) - (a0-4 (when s5-0 - (let ((t9-3 (method-of-type sunkencam activate))) - (t9-3 (the-as sunkencam s5-0) self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> s5-0 ppointer) - ) - ) - ) + (let ((a0-4 (process-spawn + sunkencam + :init pov-camera-init-by-other + (-> self root trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + :to self + ) + ) + ) (set! (-> (the-as sunkencam (-> a0-4 0)) seq) (the-as uint 3)) ) ) ((= v1-7 1) - (let* ((gp-1 (get-process *default-dead-pool* sunkencam #x4000)) - (v1-13 (when gp-1 - (let ((t9-6 (method-of-type sunkencam activate))) - (t9-6 (the-as sunkencam gp-1) self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> gp-1 ppointer) - ) - ) - ) + (let ((v1-13 (process-spawn + sunkencam + :init pov-camera-init-by-other + (-> self root trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + :to self + ) + ) + ) (set! (-> (the-as sunkencam (-> v1-13 0)) seq) (the-as uint 4)) ) (set! gp-0 -1) ) ((= v1-7 2) - (let* ((s5-1 (get-process *default-dead-pool* sunkencam #x4000)) - (a0-17 (when s5-1 - (let ((t9-9 (method-of-type sunkencam activate))) - (t9-9 (the-as sunkencam s5-1) self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> s5-1 ppointer) - ) - ) - ) + (let ((a0-17 (process-spawn + sunkencam + :init pov-camera-init-by-other + (-> self root trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + :to self + ) + ) + ) (set! (-> (the-as sunkencam (-> a0-17 0)) seq) (the-as uint 5)) ) ) ((= v1-7 3) - (let* ((gp-2 (get-process *default-dead-pool* sunkencam #x4000)) - (v1-24 (when gp-2 - (let ((t9-12 (method-of-type sunkencam activate))) - (t9-12 (the-as sunkencam gp-2) self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> gp-2 ppointer) - ) - ) - ) + (let ((v1-24 (process-spawn + sunkencam + :init pov-camera-init-by-other + (-> self root trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + :to self + ) + ) + ) (set! (-> (the-as sunkencam (-> v1-24 0)) seq) (the-as uint 6)) ) (set! gp-0 -1) @@ -663,14 +611,12 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :trans - (behavior () + :trans (behavior () (when (completed? (-> self ticker)) (send-to-all (-> self link) 'untrigger) (go square-platform-master-idle) @@ -687,7 +633,7 @@ (a0-5 (-> self plat-id-dir)) (a1-3 (-> self plat-mask)) ) - (while #t + (loop (+! v1-20 a0-5) (cond ((<= v1-20 0) @@ -711,8 +657,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 diff --git a/goal_src/levels/sunken/steam-cap.gc b/goal_src/levels/sunken/steam-cap.gc index 1363cbd493..a6b57508a8 100644 --- a/goal_src/levels/sunken/steam-cap.gc +++ b/goal_src/levels/sunken/steam-cap.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/steam-cap-ag.gc") + (deftype steam-cap-control-pt (structure) ((trans vector :inline :offset-assert 0) (transv vector :inline :offset-assert 16) @@ -48,8 +50,7 @@ (defpartgroup group-steam-cap-sides :id 441 :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 1718 :fade-after (meters 100) :falloff-to (meters 160) :period 180 :length 75) + :parts ((sp-item 1718 :fade-after (meters 100) :falloff-to (meters 160) :period 180 :length 75) (sp-item 1719 :fade-after (meters 100) :falloff-to (meters 160) :period 180 :length 75 :offset 60) (sp-item 1720 :fade-after (meters 100) :falloff-to (meters 160) :period 180 :length 75 :offset 120) (sp-item 1721 :fade-after (meters 100) :falloff-to (meters 160) :period 180 :length 75) @@ -60,8 +61,7 @@ ) (defpart 1724 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) (sp-flt spt-g 2867.2) @@ -80,13 +80,11 @@ ) (defpart 1725 - :init-specs - ((sp-flt spt-fade-b -2.7306666)) + :init-specs ((sp-flt spt-fade-b -2.7306666)) ) (defpart 1718 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 2.0 1.0) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) @@ -114,8 +112,7 @@ ) (defpart 1721 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 2.0 1.0) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) @@ -143,8 +140,7 @@ ) (defpart 1719 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 2.0 1.0) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) @@ -172,8 +168,7 @@ ) (defpart 1722 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 2.0 1.0) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) @@ -201,8 +196,7 @@ ) (defpart 1720 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 2.0 1.0) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) @@ -230,8 +224,7 @@ ) (defpart 1723 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 2.0 1.0) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) @@ -259,15 +252,13 @@ ) (defpart 1726 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) (defpartgroup group-steam-cap-plume :id 442 :bounds (static-bspherem 0 0 0 32) - :parts - ((sp-item 1727 :fade-after (meters 120) :falloff-to (meters 160)) + :parts ((sp-item 1727 :fade-after (meters 120) :falloff-to (meters 160)) (sp-item 1728 :fade-after (meters 120) :falloff-to (meters 160)) (sp-item 1729 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1730 :fade-after (meters 60) :falloff-to (meters 60) :flags (start-dead)) @@ -277,15 +268,13 @@ (defpartgroup group-steam-cap-plume-spread :id 443 :bounds (static-bspherem 0 0 0 32) - :parts - ((sp-item 1731 :fade-after (meters 120) :falloff-to (meters 160)) + :parts ((sp-item 1731 :fade-after (meters 120) :falloff-to (meters 160)) (sp-item 1732 :fade-after (meters 120) :falloff-to (meters 160)) ) ) (defpart 1730 - :init-specs - ((sp-flt spt-num 0.4) + :init-specs ((sp-flt spt-num 0.4) (sp-int spt-rot-x 5) (sp-flt spt-r 6144.0) (sp-flt spt-g 2867.2) @@ -304,8 +293,7 @@ ) (defpart 1732 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -332,8 +320,7 @@ ) (defpart 1731 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -360,13 +347,11 @@ ) (defpart 1735 - :init-specs - ((sp-flt spt-fade-a -0.32)) + :init-specs ((sp-flt spt-fade-a -0.32)) ) (defpart 1727 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-flt spt-y (meters -1)) @@ -388,8 +373,7 @@ ) (defpart 1728 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters 0) (meters 0.5) 1.0) (sp-flt spt-y (meters -1)) @@ -410,8 +394,7 @@ ) (defpart 1729 - :init-specs - ((sp-flt spt-num 0.5) + :init-specs ((sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 0.5) (meters 0.5) 1.0) (sp-int spt-rot-x 5) (sp-flt spt-r 6144.0) @@ -424,59 +407,43 @@ ) ) -(defskelgroup *steam-cap-sg* steam-cap - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *steam-cap-sg* steam-cap steam-cap-lod0-jg steam-cap-idle-ja + ((steam-cap-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) (defmethod dummy-20 steam-cap ((obj steam-cap)) - (with-pp - (when *target* - (let* ((a1-0 (target-pos 0)) - (f0-0 (-> a1-0 y)) - ) - (when (and (>= f0-0 (+ -8192.0 (-> obj down y))) - (and (>= (+ -4096.0 (-> obj root-override trans y)) f0-0) (zero? (-> obj root-override riders num-riders))) - ) - (let ((f0-1 (vector-vector-xz-distance-squared (-> obj down) a1-0))) - (when (>= 104857600.0 f0-1) - (let ((s5-0 (>= 37748736.0 f0-1))) - (when (not s5-0) - (when (>= (- (-> obj root-override trans y) (-> obj down y)) 3072.0) - (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 x) (the-as float 1)) - (set! (-> a1-1 y) (the-as float #f)) - (if (find-overlapping-shapes (-> obj root-override) (the-as overlaps-others-params a1-1)) - (set! s5-0 #t) - ) - ) - ) - ) - (when s5-0 - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) pp) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'shove) - (set! (-> a1-2 param 0) (the-as uint #f)) - (let ((v1-16 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-16 shove-up) 2048.0) - (set! (-> v1-16 shove-back) 6144.0) - (set! (-> a1-2 param 1) (the-as uint v1-16)) - ) - (send-event-function *target* a1-2) + (when *target* + (let* ((a1-0 (target-pos 0)) + (f0-0 (-> a1-0 y)) + ) + (when (and (>= f0-0 (+ -8192.0 (-> obj down y))) + (and (>= (+ -4096.0 (-> obj root-override trans y)) f0-0) (zero? (-> obj root-override riders num-riders))) + ) + (let ((f0-1 (vector-vector-xz-distance-squared (-> obj down) a1-0))) + (when (>= 104857600.0 f0-1) + (let ((s5-0 (>= 37748736.0 f0-1))) + (when (not s5-0) + (when (>= (- (-> obj root-override trans y) (-> obj down y)) 3072.0) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 x) (the-as float 1)) + (set! (-> a1-1 y) (the-as float #f)) + (if (find-overlapping-shapes (-> obj root-override) (the-as overlaps-others-params a1-1)) + (set! s5-0 #t) + ) ) ) ) + (if s5-0 + (send-event *target* 'shove #f (static-attack-info ((shove-up (meters 0.5)) (shove-back (meters 1.5))))) + ) ) ) ) ) ) - (none) ) + (none) ) (defmethod dummy-21 steam-cap ((obj steam-cap)) @@ -516,7 +483,7 @@ (set! s5-0 #f) (set! (-> obj do-falling-sound?) #t) (when (-> obj do-burst?) - (sound-play-by-name (static-sound-name "sunk-top-rises") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sunk-top-rises") (set! (-> obj do-burst?) #f) (spawn (-> obj part) (-> obj down)) (spawn (-> obj part) (-> obj down)) @@ -537,7 +504,7 @@ (set! s5-0 #t) (when (-> obj do-falling-sound?) (set! (-> obj do-falling-sound?) #f) - (sound-play-by-name (static-sound-name "sunk-top-falls") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sunk-top-falls") ) ) ) @@ -567,7 +534,7 @@ (when (< (-> s3-3 y) (-> obj down y)) (when (-> obj do-landing-sound?) (set! (-> obj do-landing-sound?) #f) - (sound-play-by-name (static-sound-name "sunk-top-lands") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sunk-top-lands") ) (set! (-> s3-3 y) (-> obj down y)) (let ((f0-20 (-> s2-0 transv y))) @@ -575,7 +542,7 @@ (let ((f0-22 (* 0.3 (- f0-20)))) (set! (-> s2-0 transv y) f0-22) (if (< 7782.4 f0-22) - (sound-play-by-name (static-sound-name "sunk-top-lands") (new-sound-id) 614 0 0 1 #t) + (sound-play "sunk-top-lands" :vol 60) ) ) ) @@ -667,19 +634,16 @@ ) (defstate steam-cap-idle (steam-cap) - :trans - (the-as (function none :behavior steam-cap) rider-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior steam-cap) rider-trans) + :code (behavior () + (loop (dummy-20 self) (dummy-21 self) (suspend) ) (none) ) - :post - (the-as (function none :behavior steam-cap) rider-post) + :post (the-as (function none :behavior steam-cap) rider-post) ) (defmethod relocate steam-cap ((obj steam-cap) (arg0 int)) diff --git a/goal_src/levels/sunken/sun-exit-chamber.gc b/goal_src/levels/sunken/sun-exit-chamber.gc index 9345ed7733..b6041d69d3 100644 --- a/goal_src/levels/sunken/sun-exit-chamber.gc +++ b/goal_src/levels/sunken/sun-exit-chamber.gc @@ -10,6 +10,10 @@ ;; DECOMP BEGINS +(import "goal_src/import/exit-chamber-ag.gc") +(import "goal_src/import/blue-eco-charger-ag.gc") +(import "goal_src/import/blue-eco-charger-orb-ag.gc") + (deftype blue-eco-charger-orb (process-drawable) ((parent-process (pointer blue-eco-charger) :offset 12) (orbit-rot vector :inline :offset-assert 176) @@ -31,13 +35,10 @@ ) -(defskelgroup *blue-eco-charger-orb-sg* blue-eco-charger-orb - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1.1) - :longest-edge (meters 0) - ) +(defskelgroup *blue-eco-charger-orb-sg* blue-eco-charger-orb blue-eco-charger-orb-lod0-jg blue-eco-charger-orb-idle-ja + ((blue-eco-charger-orb-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.1) + ) (deftype blue-eco-charger (process-drawable) ((root-override collide-shape :offset 112) @@ -62,13 +63,10 @@ ) -(defskelgroup *blue-eco-charger-sg* blue-eco-charger - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 1.9 0 2.7) - :longest-edge (meters 0) - ) +(defskelgroup *blue-eco-charger-sg* blue-eco-charger blue-eco-charger-lod0-jg blue-eco-charger-open-ja + ((blue-eco-charger-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.9 0 2.7) + ) (deftype exit-chamber-items (structure) ((door-pos vector :inline :offset-assert 0) @@ -118,26 +116,21 @@ ) -(defskelgroup *exit-chamber-sg* exit-chamber - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 4 0 16.5) - :longest-edge (meters 0) - ) +(defskelgroup *exit-chamber-sg* exit-chamber exit-chamber-lod0-jg exit-chamber-idle-ja + ((exit-chamber-lod0-mg (meters 999999))) + :bounds (static-spherem 0 4 0 16.5) + ) (defpartgroup group-exit-chamber-ripples :id 620 :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2512 :flags (is-3d))) + :parts ((sp-item 2512 :flags (is-3d))) ) (defpart 2513 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-func spt-birth-func 'birth-func-ocean-height) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters 5) (meters 3) 1.0) @@ -163,13 +156,11 @@ ) (defpart 2514 - :init-specs - ((sp-flt spt-fade-a -0.094814815)) + :init-specs ((sp-flt spt-fade-a -0.094814815)) ) (defpart 2512 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-func spt-birth-func 'birth-func-ocean-height) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 6) (meters 4) 1.0) @@ -206,10 +197,9 @@ ) (defstate blue-eco-charger-orb-idle (blue-eco-charger-orb) - :code - (behavior () + :code (behavior () (set! (-> self root trans quad) (-> self rest-pos quad)) - (while #t + (loop (let ((f0-0 (-> self parent-process 0 open-level))) (if (< 0.0 f0-0) (go blue-eco-charger-orb-active) @@ -219,13 +209,11 @@ ) (none) ) - :post - (the-as (function none :behavior blue-eco-charger-orb) ja-post) + :post (the-as (function none :behavior blue-eco-charger-orb) ja-post) ) (defstate blue-eco-charger-orb-active (blue-eco-charger-orb) - :code - (behavior () + :code (behavior () (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -234,7 +222,7 @@ (init-vf0-vector) (dummy-20 self (-> self parent-process 0 open-level)) (vector-reset! (-> self orbit-rotv)) - (while #t + (loop (let ((f30-0 (-> self parent-process 0 open-level))) (if (>= 0.0 f30-0) (go blue-eco-charger-orb-idle) @@ -303,11 +291,10 @@ (none) ) ) - :post - (the-as (function none :behavior blue-eco-charger-orb) ja-post) + :post (the-as (function none :behavior blue-eco-charger-orb) ja-post) ) -(defbehavior blue-eco-charger-orb-init-by-other blue-eco-charger-orb ((arg0 entity) (arg1 blue-eco-charger-orb)) +(defbehavior blue-eco-charger-orb-init-by-other blue-eco-charger-orb ((arg0 entity-actor) (arg1 blue-eco-charger-orb)) (set! (-> self entity) arg0) (set! (-> self root) (new 'process 'trsqv)) (set! (-> self root trans quad) (-> arg1 root trans quad)) @@ -317,14 +304,7 @@ (set! (-> self rest-pos quad) (-> self root trans quad)) (initialize-skeleton self *blue-eco-charger-orb-sg* '()) (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 2) :num! min) (set-vector! (-> self orbit-rot) 0.0 0.0 0.0 1.0) (go blue-eco-charger-orb-idle) (none) @@ -362,34 +342,19 @@ (defmethod dummy-20 blue-eco-charger ((obj blue-eco-charger)) (and (and *target* (>= 16384.0 (vector-vector-distance (-> obj root-override trans) (-> *target* control trans)))) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) (defstate blue-eco-charger-idle (blue-eco-charger) - :code - (behavior () + :code (behavior () (set! (-> self open-level) 0.0) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (ja :group! (-> self draw art-group data 2) :num! min) + (loop (when (logtest? (-> self draw status) (draw-status was-drawn)) (if (and (and *target* (>= 16384.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'powerup)) - (set! (-> a1-2 param 1) (the-as uint 3)) - (not (send-event-function *target* a1-2)) - ) + (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (level-hint-spawn (game-text-id sunken-blue-eco-charger-hint) @@ -411,57 +376,33 @@ ) (none) ) - :post - (the-as (function none :behavior blue-eco-charger) ja-post) + :post (the-as (function none :behavior blue-eco-charger) ja-post) ) (defstate blue-eco-charger-open (blue-eco-charger) - :enter - (behavior ((arg0 symbol)) + :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (if arg0 - (sound-play-by-name (static-sound-name "blue-eco-start") (new-sound-id) 1024 0 0 1 #t) + (sound-play "blue-eco-start") ) (dummy-21 self #t) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-20 self) (set! (-> self state-time) (-> *display* base-frame-counter)) ) (update! (-> self sound)) (none) ) - :code - (behavior ((arg0 symbol)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior ((arg0 symbol)) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) - (set! (-> self open-level) - (/ (ja-frame-num 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) + (ja :num! (seek!)) + (set! (-> self open-level) (/ (ja-frame-num 0) (the float (+ (-> (ja-group) data 0 length) -1)))) ) - (while #t + (loop (cond ((zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 20)) @@ -483,19 +424,16 @@ ) (none) ) - :post - (the-as (function none :behavior blue-eco-charger) ja-post) + :post (the-as (function none :behavior blue-eco-charger) ja-post) ) (defstate blue-eco-charger-stuck-open (blue-eco-charger) - :trans - (behavior () + :trans (behavior () (update! (-> self sound)) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -504,18 +442,12 @@ ) (defstate blue-eco-charger-close (blue-eco-charger) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 0.0) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek! 0.0)) (while (not (ja-done? 0)) (when (dummy-20 self) (increment-success-for-hint (game-text-id sunken-blue-eco-charger-hint)) @@ -526,31 +458,14 @@ ) (update! (-> self sound)) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) 0.0) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) - (set! (-> self open-level) - (/ (ja-frame-num 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) + (ja :num! (seek! 0.0)) + (set! (-> self open-level) (/ (ja-frame-num 0) (the float (+ (-> (ja-group) data 0 length) -1)))) ) (dummy-21 self #f) (go blue-eco-charger-idle) (none) ) - :post - (the-as (function none :behavior blue-eco-charger) ja-post) + :post (the-as (function none :behavior blue-eco-charger) ja-post) ) (defmethod init-from-entity! blue-eco-charger ((obj blue-eco-charger) (arg0 entity-actor)) @@ -591,28 +506,9 @@ (set! (-> obj master) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> obj link) (new 'process 'actor-link-info obj)) (set! (-> obj charger-id) (+ (actor-count-before (-> obj link)) 1)) - (let ((s5-1 (get-process *default-dead-pool* blue-eco-charger-orb #x4000))) - (when s5-1 - (let ((t9-17 (method-of-type blue-eco-charger-orb activate))) - (t9-17 (the-as blue-eco-charger-orb s5-1) obj 'blue-eco-charger-orb (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 blue-eco-charger-orb-init-by-other (-> obj entity) obj) - (-> s5-1 ppointer) - ) - ) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "blue-eco-charg") - :volume #x400 - :fo-max 35 - ) - (-> obj root-override trans) - ) + (process-spawn blue-eco-charger-orb (-> obj entity) obj :to obj) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "blue-eco-charg" :fo-max 35) (-> obj root-override trans)) ) (if (zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) (go blue-eco-charger-idle) @@ -631,7 +527,7 @@ (defbehavior exit-chamber-button-init-by-other exit-chamber-button ((arg0 vector) (arg1 quaternion) (arg2 entity-actor) (arg3 symbol)) - (basebutton-init-by-other (the-as basebutton #f) arg0 arg1 arg2 arg3 0.0) + (basebutton-init-by-other (the-as entity-actor #f) arg0 arg1 arg2 arg3 0.0) (none) ) @@ -647,8 +543,7 @@ ) (defpart 2515 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.2) 1.0) (sp-rnd-flt spt-scale-y (meters 0.3) (meters 0.1) 1.0) @@ -676,14 +571,7 @@ (vector-matrix*! gp-0 gp-0 s4-0) (vector-float*! gp-0 gp-0 (/ 1.0 (-> gp-0 w))) (set! (-> *part-id-table* 2515 init-specs 13 initial-valuef) (+ 24576.0 (-> gp-0 y))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 2515) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 2515) gp-0) ) (none) ) @@ -749,8 +637,7 @@ ) (defstate exit-chamber-charger-puzzle (exit-chamber) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('notify) @@ -783,14 +670,12 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root-override trans))) (logclear! (-> self draw status) (draw-status hidden)) (logior! (-> self draw status) (draw-status hidden)) @@ -799,30 +684,20 @@ ) (none) ) - :post - (the-as (function none :behavior exit-chamber) ja-post) + :post (the-as (function none :behavior exit-chamber) ja-post) ) (defstate exit-chamber-charger-puzzle-beaten (exit-chamber) - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type pov-camera activate))) - (t9-1 (the-as pov-camera gp-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> self root-override trans) - *sunkencam-sg* - "exit-chamber-door-open" - 0 - #f - '() - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + pov-camera + (-> self root-override trans) + *sunkencam-sg* + "exit-chamber-door-open" + 0 + #f + '() + :to self ) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2.5)) @@ -835,8 +710,7 @@ ) (defstate exit-chamber-idle-in-sunken (exit-chamber) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-1 object)) (case arg2 (('trigger) @@ -859,13 +733,11 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :code - (behavior () + :code (behavior () (save-reminder (get-task-control (game-task sunken-room)) 1 0) (set! (-> self wave-scale) 0.0) (if (-> self door) @@ -874,7 +746,7 @@ (if (-> self button) (send-event (ppointer->process (-> self button)) 'untrigger) ) - (while #t + (loop (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root-override trans))) (logclear! (-> self draw status) (draw-status hidden)) (logior! (-> self draw status) (draw-status hidden)) @@ -886,20 +758,17 @@ ) (defstate exit-chamber-rise (exit-chamber) - :enter - (behavior () + :enter (behavior () (set! (-> self move-player?) #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (-> self move-player?)) (rider-trans) ) (none) ) - :code - (behavior () + :code (behavior () (aybabtu 2) (let ((v1-1 (handle->process (-> self fcell-handle)))) (if v1-1 @@ -937,82 +806,38 @@ (suspend) (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-1 #f)) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-13 param 1) 1.0) - (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (not gp-1) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.75)) (-> self door)) (set! gp-1 #t) (send-event (ppointer->process (-> self door)) 'untrigger) ) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (set! (-> self move-player?) #t) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (load-state-want-levels 'sunken 'village2) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) 1.0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (dummy-24 self 51200.0) (update-trans! (-> self sound) (-> self last-pos)) (update! (-> self sound)) (suspend) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1))) - (set! (-> a0-27 param 1) 1.0) - (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (stop! (-> self sound)) (load-state-want-display-level 'village2 'display) (load-state-want-display-level 'sunken 'special) (let ((gp-2 #f)) - (let ((a0-32 (-> self skel root-channel 0))) - (set! (-> a0-32 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-32 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-32 param 1) 1.0) - (set! (-> a0-32 frame-num) 0.0) - (joint-control-channel-group! a0-32 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (set! (-> self wave-scale) (seek (-> self wave-scale) 1.0 0.0016666667)) + (seek! (-> self wave-scale) 1.0 0.0016666667) (dummy-20 self (-> self wave-scale)) (if (and (-> self move-player?) (>= (ja-aframe-num 0) 310.0)) (set! (-> self move-player?) #f) @@ -1030,11 +855,7 @@ ) ) (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) (the float (+ (-> a0-40 frame-group data 0 length) -1))) - (set! (-> a0-40 param 1) 1.0) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (kill-and-free-particles (-> self part)) @@ -1047,7 +868,7 @@ ) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (set! (-> self wave-scale) (seek (-> self wave-scale) 1.0 0.0016666667)) + (seek! (-> self wave-scale) 1.0 0.0016666667) (dummy-20 self (-> self wave-scale)) (suspend) ) @@ -1056,15 +877,14 @@ ) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2.5)) - (set! (-> self wave-scale) (seek (-> self wave-scale) 1.0 0.0016666667)) + (seek! (-> self wave-scale) 1.0 0.0016666667) (dummy-20 self (-> self wave-scale)) (suspend) ) (go exit-chamber-idle-in-village #f) (none) ) - :post - (behavior () + :post (behavior () (if (-> self move-player?) (transform-post) (rider-post) @@ -1075,8 +895,7 @@ ) (defstate exit-chamber-idle-in-village (exit-chamber) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go exit-chamber-lower) @@ -1096,19 +915,16 @@ ) ) ) - :enter - (behavior ((arg0 symbol)) + :enter (behavior ((arg0 symbol)) (set! (-> self mask) (logior (process-mask platform) (-> self mask))) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self mask) (process-mask platform)) (none) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (when *target* (let ((f30-0 (vector-vector-xz-distance (target-pos 0) (-> self last-pos)))) @@ -1132,8 +948,7 @@ ) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (set! (-> self move-player?) #f) (set! (-> self wave-scale) 1.0) (save-reminder (get-task-control (game-task sunken-room)) 2 0) @@ -1146,14 +961,13 @@ (suspend) (logclear! (-> self draw status) (draw-status skip-bones)) ) - (while #t + (loop (dummy-20 self 1.0) (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (rider-post) (dummy-23 self #t) (if (and *target* (>= (vector-vector-xz-distance (target-pos 0) (-> self last-pos)) 40960.0)) @@ -1164,8 +978,7 @@ ) (defstate exit-chamber-lower (exit-chamber) - :enter - (behavior () + :enter (behavior () (set! (-> self move-player?) #t) (let ((v1-2 (handle->process (-> self fcell-handle)))) (if v1-2 @@ -1174,36 +987,28 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (-> self move-player?)) (rider-trans) ) - (set! (-> self wave-scale) (seek (-> self wave-scale) 0.0 0.0016666667)) + (seek! (-> self wave-scale) 0.0 0.0016666667) (dummy-20 self (-> self wave-scale)) (none) ) - :code - (behavior () - (let* ((gp-0 (get-process *default-dead-pool* sunkencam #x4000)) - (v1-1 (when gp-0 - (let ((t9-1 (method-of-type sunkencam activate))) - (t9-1 (the-as sunkencam gp-0) self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> self root-override trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> gp-0 ppointer) - ) - ) - ) + :code (behavior () + (let ((v1-1 (process-spawn + sunkencam + :init pov-camera-init-by-other + (-> self root-override trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + :to self + ) + ) + ) (set! (-> (the-as sunkencam (-> v1-1 0)) seq) (the-as uint 1)) ) (load-state-want-display-level 'sunken 'display) @@ -1212,15 +1017,7 @@ (let ((gp-1 #f) (s5-0 #f) ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (not gp-1) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) (-> self door)) (set! gp-1 #t) @@ -1239,54 +1036,26 @@ (spawn (-> self part) (-> self last-pos)) ) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (load-state-want-levels 'sunken 'sunkenb) (kill-and-free-particles (-> self part)) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (dummy-24 self 47104.0) (update-trans! (-> self sound) (-> self last-pos)) (update! (-> self sound)) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (stop! (-> self sound)) (load-state-want-display-level 'sunkenb 'display) (load-state-want-vis 'sub) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 9) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self move-player?) #f) (if (-> self door) @@ -1305,8 +1074,7 @@ (go exit-chamber-idle-in-sunken) (none) ) - :post - (behavior () + :post (behavior () (if (-> self move-player?) (transform-post) (rider-post) @@ -1412,47 +1180,15 @@ ) ) ) - (let ((s0-1 (get-process *default-dead-pool* sun-iris-door #x4000))) - (set! (-> obj door) - (the-as - (pointer sun-iris-door) - (when s0-1 - (let ((t9-23 (method-of-type sun-iris-door activate))) - (t9-23 (the-as sun-iris-door s0-1) obj 'sun-iris-door (the-as pointer #x70004000)) - ) - (run-now-in-process s0-1 sun-iris-door-init-by-other (-> s3-1 vector) (-> s3-1 vector 1) s1-3) - (-> s0-1 ppointer) - ) - ) - ) - ) - ) - (let ((s1-4 (get-process *default-dead-pool* exit-chamber-button #x4000))) - (set! (-> obj button) - (the-as - (pointer exit-chamber-button) - (when s1-4 - (let ((t9-26 (method-of-type exit-chamber-button activate))) - (t9-26 (the-as exit-chamber-button s1-4) obj 'exit-chamber-button (the-as pointer #x70004000)) - ) - (run-now-in-process s1-4 exit-chamber-button-init-by-other (-> s3-1 vector 2) (-> s3-1 vector 3) arg0 #f) - (-> s1-4 ppointer) - ) - ) - ) + (set! (-> obj door) (process-spawn sun-iris-door (-> s3-1 vector) (-> s3-1 vector 1) s1-3 :to obj)) ) + (set! (-> obj button) + (process-spawn exit-chamber-button (-> s3-1 vector 2) (-> s3-1 vector 3) arg0 #f :to obj) + ) (set! (-> obj sound) (new 'process 'ambient-sound - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "chamber-move") - :volume #x400 - :fo-min #x12c - :fo-max #x190 - ) + (static-sound-spec "chamber-move" :fo-min 300 :fo-max 400) (-> obj root-override trans) ) ) diff --git a/goal_src/levels/sunken/sun-iris-door.gc b/goal_src/levels/sunken/sun-iris-door.gc index 8ba2b1cedf..058ec92f03 100644 --- a/goal_src/levels/sunken/sun-iris-door.gc +++ b/goal_src/levels/sunken/sun-iris-door.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/sun-iris-door-ag.gc") + (deftype sun-iris-door (process-drawable) ((root-override collide-shape :offset 112) (timeout float :offset-assert 176) @@ -37,13 +39,10 @@ ) -(defskelgroup *sun-iris-door-sg* sun-iris-door - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4.5) - :longest-edge (meters 0) - ) +(defskelgroup *sun-iris-door-sg* sun-iris-door sun-iris-door-lod0-jg sun-iris-door-idle-ja + ((sun-iris-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.5) + ) (defmethod should-open? sun-iris-door ((obj sun-iris-door)) (let ((f30-0 1228800.0)) @@ -81,8 +80,7 @@ ) (defstate sun-iris-door-closed (sun-iris-door) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go sun-iris-door-opening) @@ -94,8 +92,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (-> self proximity?) (if (should-open? self) (go sun-iris-door-opening) @@ -103,16 +100,14 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) (move-to-point! (-> self root-override) (-> self move-to-pos)) @@ -124,8 +119,7 @@ ) (defstate sun-iris-door-opening (sun-iris-door) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('untrigger) (go sun-iris-door-closing) @@ -137,28 +131,18 @@ ) ) ) - :code - (behavior () - (sound-play-by-name (static-sound-name "irisdoor2") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (sound-play "irisdoor2") + (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (ja-post) (go sun-iris-door-open) (none) ) - :post - (behavior () + :post (behavior () (cond ((-> self move-to?) (set! (-> self move-to?) #f) @@ -227,8 +211,7 @@ ) (defstate sun-iris-door-open (sun-iris-door) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (let ((v0-0 (the-as object (-> *display* base-frame-counter)))) @@ -246,21 +229,18 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (clear-collide-with-as (-> self root-override)) (logior! (-> self draw status) (draw-status hidden)) (none) ) - :exit - (behavior () + :exit (behavior () (restore-collide-with-as (-> self root-override)) (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (when (-> self proximity?) (if (should-close? self) (go sun-iris-door-closing) @@ -273,16 +253,14 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) (move-to-point! (-> self root-override) (-> self move-to-pos)) @@ -294,8 +272,7 @@ ) (defstate sun-iris-door-closing (sun-iris-door) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go sun-iris-door-opening) @@ -307,28 +284,18 @@ ) ) ) - :code - (behavior () - (sound-play-by-name (static-sound-name "irisdoor2") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) 0.0) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (sound-play "irisdoor2") + (ja-no-eval :num! (seek! 0.0)) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) 0.0) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) (ja-post) (go sun-iris-door-closed) (none) ) - :post - (behavior () + :post (behavior () (cond ((-> self move-to?) (set! (-> self move-to?) #f) @@ -432,30 +399,10 @@ (set! (-> self proximity?) #f) (set! (-> self directional-proximity?) #f) (ja-channel-set! 1) - (cond - (arg2 - (let ((s5-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - ) + (if arg2 + (ja :group! sun-iris-door-idle-ja :num! max) + (ja :group! sun-iris-door-idle-ja :num! min) ) - (else - (let ((s5-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-2 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> s5-2 frame-num) 0.0) - ) - ) - ) (transform-post) (if arg2 (go sun-iris-door-open) diff --git a/goal_src/levels/sunken/sunken-fish.gc b/goal_src/levels/sunken/sunken-fish.gc index 2832a8d382..3a88a47f3c 100644 --- a/goal_src/levels/sunken/sunken-fish.gc +++ b/goal_src/levels/sunken/sunken-fish.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/sunkenfisha-ag.gc") + (deftype sunkenfisha (process-drawable) ((path-u float :offset-assert 176) (path-speed float :offset-assert 180) @@ -43,29 +45,20 @@ ) -(defskelgroup *sunkenfisha-red-yellow-sg* sunkenfisha - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 1.5 0 2.5) - :longest-edge (meters 0) - ) +(defskelgroup *sunkenfisha-red-yellow-sg* sunkenfisha sunkenfisha-red-yellow-lod0-jg -1 + ((sunkenfisha-red-yellow-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 2.5) + ) -(defskelgroup *sunkenfisha-yellow-blue-sg* sunkenfisha - 2 - -1 - ((3 (meters 999999))) - :bounds (static-spherem 0 1.5 0 2.5) - :longest-edge (meters 0) - ) +(defskelgroup *sunkenfisha-yellow-blue-sg* sunkenfisha sunkenfisha-yellow-blue-lod0-jg -1 + ((sunkenfisha-yellow-blue-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 2.5) + ) -(defskelgroup *sunkenfisha-yellow-eye-sg* sunkenfisha - 4 - -1 - ((5 (meters 999999))) - :bounds (static-spherem 0 1.5 0 2.5) - :longest-edge (meters 0) - ) +(defskelgroup *sunkenfisha-yellow-eye-sg* sunkenfisha sunkenfisha-yellow-eye-lod0-jg -1 + ((sunkenfisha-yellow-eye-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 2.5) + ) (defmethod dummy-22 sunkenfisha ((obj sunkenfisha)) 0 @@ -190,8 +183,7 @@ ) (defstate sunkenfisha-idle (sunkenfisha) - :trans - (behavior () + :trans (behavior () (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -222,36 +214,22 @@ (none) ) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior sunkenfisha) ja-post) + :post (the-as (function none :behavior sunkenfisha) ja-post) ) (defmethod TODO-RENAME-26 sunkenfisha ((obj sunkenfisha)) (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (set-vector! (-> obj root scale) 6.0 6.0 6.0 1.0) (let ((v1-3 (rand-vu-int-count 3))) (cond @@ -358,7 +336,7 @@ ) ) -(defbehavior sunkenfisha-init-by-other sunkenfisha ((arg0 entity)) +(defbehavior sunkenfisha-init-by-other sunkenfisha ((arg0 entity-actor)) (set! (-> self entity) arg0) (TODO-RENAME-26 self) (TODO-RENAME-27 self) @@ -371,15 +349,7 @@ (TODO-RENAME-27 obj) (let ((s5-0 (+ (res-lump-value (-> obj entity) 'count uint128 :default (the-as uint128 1)) -1))) (while (> (the-as int s5-0) 0) - (let ((s4-0 (get-process *default-dead-pool* sunkenfisha #x4000))) - (when s4-0 - (let ((t9-4 (method-of-type sunkenfisha activate))) - (t9-4 (the-as sunkenfisha s4-0) obj 'sunkenfisha (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 sunkenfisha-init-by-other (-> obj entity)) - (-> s4-0 ppointer) - ) - ) + (process-spawn sunkenfisha (-> obj entity) :to obj) (+! s5-0 -1) ) ) diff --git a/goal_src/levels/sunken/sunken-obs.gc b/goal_src/levels/sunken/sunken-obs.gc index f736369537..bb5c3b3ded 100644 --- a/goal_src/levels/sunken/sunken-obs.gc +++ b/goal_src/levels/sunken/sunken-obs.gc @@ -4,16 +4,16 @@ ;; name: sunken-obs.gc ;; name in dgo: sunken-obs ;; dgos: L1, SUN, SUNKEN - -(define-extern *seaweed-sg* skeleton-group) -(define-extern *side-to-side-plat-sg* skeleton-group) -(define-extern *sunkencam-sg* skeleton-group) (declare-type seaweed basic) (define-extern *seaweed* seaweed) ;; DECOMP BEGINS +(import "goal_src/import/seaweed-ag.gc") +(import "goal_src/import/sunkencam-ag.gc") +(import "goal_src/import/side-to-side-plat-ag.gc") + (deftype water-vol-deadly (process-hidden) () :method-count-assert 15 @@ -32,27 +32,22 @@ ) -(defskelgroup *side-to-side-plat-sg* side-to-side-plat - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 14) - :longest-edge (meters 0) - ) +(defskelgroup *side-to-side-plat-sg* side-to-side-plat side-to-side-plat-lod0-jg side-to-side-plat-idle-ja + ((side-to-side-plat-lod0-mg (meters 20)) (side-to-side-plat-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 14) + ) (defpartgroup group-side-to-side-plat :id 436 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1713 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1713 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1714 :fade-after (meters 160) :falloff-to (meters 160)) ) ) (defpart 1713 - :init-specs - ((sp-flt spt-num 4.0) + :init-specs ((sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters -11) (meters 22) 1.0) (sp-flt spt-y (meters 1)) (sp-int spt-rot-x 5) @@ -71,8 +66,7 @@ ) (defpart 1714 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-x (meters -11) (meters 22) 1.0) (sp-flt spt-y (meters 1.5)) @@ -156,13 +150,10 @@ ) -(defskelgroup *sunkencam-sg* sunkencam - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *sunkencam-sg* sunkencam sunkencam-lod0-jg -1 + ((sunkencam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) (defmethod set-stack-size! sunkencam ((obj sunkencam)) (stack-size-set! (-> obj main-thread) 512) @@ -171,160 +162,74 @@ (defstate pov-camera-playing (sunkencam) :virtual #t - :exit - (behavior () + :exit (behavior () (set! (-> *screen-filter* draw?) #f) (none) ) - :code - (behavior () + :code (behavior () (let ((v1-0 (-> self seq))) (cond ((zero? v1-0) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((v1-45 *screen-filter*)) (set! (-> v1-45 draw?) #t) (set! (-> v1-45 color) (new 'static 'rgba :g #x20 :b #x40 :a #x50)) ) (set-blackout-frames (seconds 0.1)) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set-blackout-frames (seconds 0.5)) (let ((gp-0 2)) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-13 param 1) 1.0) - (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (+! gp-0 -1) (if (zero? gp-0) (set! (-> *screen-filter* draw?) #f) ) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (set-blackout-frames (seconds 0.1)) ) ((= v1-0 1) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 9) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((v1-116 *screen-filter*)) (set! (-> v1-116 draw?) #t) (set! (-> v1-116 color) (new 'static 'rgba :g #x20 :b #x40 :a #x50)) ) (set-blackout-frames (seconds 0.1)) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set-blackout-frames (seconds 0.1)) (let ((gp-1 2)) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-28 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-28 param 1) 1.0) - (set! (-> a0-28 frame-num) 0.0) - (joint-control-channel-group! a0-28 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 11) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (+! gp-1 -1) (if (zero? gp-1) (set! (-> *screen-filter* draw?) #f) ) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1))) - (set! (-> a0-29 param 1) 1.0) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (let ((gp-2 *camera*)) @@ -338,39 +243,15 @@ ) ) ((= v1-0 2) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-36 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-36 param 1) 1.0) - (set! (-> a0-36 frame-num) 0.0) - (joint-control-channel-group! a0-36 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 16) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 param 0) (the float (+ (-> a0-37 frame-group data 0 length) -1))) - (set! (-> a0-37 param 1) 1.0) - (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - (set! (-> a0-39 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - (set! (-> a0-39 param 1) 0.67) - (set! (-> a0-39 frame-num) 0.0) - (joint-control-channel-group! a0-39 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! (-> self draw art-group data 17) :num! (seek! max 0.67) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) (the float (+ (-> a0-40 frame-group data 0 length) -1))) - (set! (-> a0-40 param 1) 0.67) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.67)) ) (pov-camera-play-and-reposition (the-as art-joint-anim (-> self draw art-group data 18)) @@ -438,49 +319,28 @@ ) -(defskelgroup *seaweed-sg* seaweed - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 6 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *seaweed-sg* seaweed seaweed-lod0-jg -1 + ((seaweed-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6 0 7) + ) (defstate seaweed-idle (seaweed) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) (-> self anim-speed)) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek! max (-> self anim-speed))) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (while #t - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) (-> self anim-speed)) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (none) ) - :post - (the-as (function none :behavior seaweed) ja-post) + :post (the-as (function none :behavior seaweed) ja-post) ) (defmethod init-from-entity! seaweed ((obj seaweed) (arg0 entity-actor)) diff --git a/goal_src/levels/sunken/sunken-part.gc b/goal_src/levels/sunken/sunken-part.gc index 3861afb04d..59b519659e 100644 --- a/goal_src/levels/sunken/sunken-part.gc +++ b/goal_src/levels/sunken/sunken-part.gc @@ -19,8 +19,7 @@ (defpartgroup group-sunken-heatpipe-183 :id 332 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1420 :fade-after (meters 80) :falloff-to (meters 80) :binding 1419) + :parts ((sp-item 1420 :fade-after (meters 80) :falloff-to (meters 80) :binding 1419) (sp-item 1419 :flags (bit1 start-dead launch-asap)) (sp-item 1419 :flags (bit1 start-dead launch-asap)) (sp-item 1419 :flags (bit1 start-dead launch-asap)) @@ -51,8 +50,7 @@ ) (defpart 1420 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.5)) (sp-flt spt-y (meters 0.2)) @@ -69,8 +67,7 @@ ) (defpart 1419 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 4)) (sp-flt spt-y (meters 4.2222223)) @@ -93,13 +90,11 @@ ) (defpart 1422 - :init-specs - ((sp-flt spt-fade-a -0.64)) + :init-specs ((sp-flt spt-fade-a -0.64)) ) (defpart 1421 - :init-specs - ((sp-flt spt-num 0.25) + :init-specs ((sp-flt spt-num 0.25) (sp-flt spt-x (meters -2.5)) (sp-flt spt-y (meters 0.2)) (sp-int spt-rot-x 6) @@ -120,8 +115,7 @@ (defpartgroup group-sunken-tunnel-bubbles-27 :id 333 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1425 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1425 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1425 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1426 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1426 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) @@ -223,8 +217,7 @@ ) (defpart 1427 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -37) (meters 64) 1.0) (sp-flt spt-y (meters -2)) @@ -246,8 +239,7 @@ ) (defpart 1428 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -37) (meters 64) 1.0) (sp-flt spt-y (meters -2)) @@ -269,8 +261,7 @@ ) (defpart 1425 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -37) (meters 64) 1.0) (sp-flt spt-y (meters -2)) @@ -287,8 +278,7 @@ ) (defpart 1426 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -37) (meters 64) 1.0) (sp-flt spt-y (meters -2)) @@ -305,21 +295,18 @@ ) (defpart 1429 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 1800 1799 1) (sp-launcher-by-id spt-next-launcher 1430) ) ) (defpart 1430 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) (defpart 1423 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -345,8 +332,7 @@ ) (defpart 1431 - :init-specs - ((sp-flt spt-scale-x (meters 1.2)) + :init-specs ((sp-flt spt-scale-x (meters 1.2)) (sp-flt spt-scale-y (meters 1)) (sp-flt spt-scalevel-x (meters 0.010000001)) (sp-flt spt-scalevel-y (meters -0.0033333334)) @@ -357,8 +343,7 @@ ) (defpart 1432 - :init-specs - ((sp-flt spt-scale-x (meters 1.5)) + :init-specs ((sp-flt spt-scale-x (meters 1.5)) (sp-flt spt-scale-y (meters 0.9)) (sp-flt spt-scalevel-x (meters -0.010000001)) (sp-flt spt-scalevel-y (meters 0.0033333334)) @@ -368,8 +353,7 @@ ) (defpart 1433 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 0)) (sp-flt spt-z (meters 0)) @@ -387,8 +371,7 @@ ) (defpart 1424 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -410,8 +393,7 @@ ) (defpart 1434 - :init-specs - ((sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.0016666667) 1.0) + :init-specs ((sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.0016666667) 1.0) (sp-flt spt-accel-y -0.27306667) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 1435) @@ -419,15 +401,13 @@ ) (defpart 1435 - :init-specs - ((sp-flt spt-fade-a -0.14222223)) + :init-specs ((sp-flt spt-fade-a -0.14222223)) ) (defpartgroup group-sunken-tunnel-bubbles-32 :id 334 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1436 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1436 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1436 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1437 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1437 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) @@ -529,8 +509,7 @@ ) (defpart 1438 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -24) (meters 48) 1.0) (sp-flt spt-y (meters -2)) @@ -552,8 +531,7 @@ ) (defpart 1439 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -24) (meters 48) 1.0) (sp-flt spt-y (meters -2)) @@ -575,8 +553,7 @@ ) (defpart 1436 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -24) (meters 48) 1.0) (sp-flt spt-y (meters -2)) @@ -593,8 +570,7 @@ ) (defpart 1437 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -24) (meters 48) 1.0) (sp-flt spt-y (meters -2)) @@ -613,8 +589,7 @@ (defpartgroup group-sunken-tunnel-bubbles-33 :id 335 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1440 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1440 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1440 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1441 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1441 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) @@ -716,8 +691,7 @@ ) (defpart 1442 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.02) (sp-rnd-flt spt-x (meters -13) (meters 25) 1.0) (sp-flt spt-y (meters -2)) @@ -739,8 +713,7 @@ ) (defpart 1443 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.02) (sp-rnd-flt spt-x (meters -13) (meters 25) 1.0) (sp-flt spt-y (meters -2)) @@ -762,8 +735,7 @@ ) (defpart 1440 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -13) (meters 25) 1.0) (sp-flt spt-y (meters -2)) @@ -780,8 +752,7 @@ ) (defpart 1441 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -13) (meters 25) 1.0) (sp-flt spt-y (meters -2)) @@ -800,8 +771,7 @@ (defpartgroup group-sunken-tunnel-bubbles-199 :id 336 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1444 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1444 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1444 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1445 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1445 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) @@ -903,8 +873,7 @@ ) (defpart 1446 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -25) (meters 36) 1.0) (sp-flt spt-y (meters -2)) @@ -926,8 +895,7 @@ ) (defpart 1447 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -25) (meters 36) 1.0) (sp-flt spt-y (meters -2)) @@ -949,8 +917,7 @@ ) (defpart 1444 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -25) (meters 36) 1.0) (sp-flt spt-y (meters -2)) @@ -967,8 +934,7 @@ ) (defpart 1445 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -25) (meters 36) 1.0) (sp-flt spt-y (meters -2)) @@ -987,8 +953,7 @@ (defpartgroup group-sunken-tunnel-bubbles-281 :id 337 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1448 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1448 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1448 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1449 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1449 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) @@ -1090,8 +1055,7 @@ ) (defpart 1450 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1113,8 +1077,7 @@ ) (defpart 1451 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1136,8 +1099,7 @@ ) (defpart 1448 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1154,8 +1116,7 @@ ) (defpart 1449 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1174,8 +1135,7 @@ (defpartgroup group-sunken-tunnel-bubbles-202 :id 338 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1452 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1452 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1452 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1453 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1453 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) @@ -1277,8 +1237,7 @@ ) (defpart 1454 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -22) (meters 44) 1.0) (sp-flt spt-y (meters -2)) @@ -1300,8 +1259,7 @@ ) (defpart 1455 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -22) (meters 44) 1.0) (sp-flt spt-y (meters -2)) @@ -1323,8 +1281,7 @@ ) (defpart 1452 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -22) (meters 44) 1.0) (sp-flt spt-y (meters -2)) @@ -1341,8 +1298,7 @@ ) (defpart 1453 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -22) (meters 44) 1.0) (sp-flt spt-y (meters -2)) @@ -1361,8 +1317,7 @@ (defpartgroup group-sunken-window-bubbles-35 :id 339 :bounds (static-bspherem 0 8 0 32) - :parts - ((sp-item 1456 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1456 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1456 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1414,8 +1369,7 @@ ) (defpart 1457 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1437,8 +1391,7 @@ ) (defpart 1456 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1457,13 +1410,11 @@ (defpartgroup group-sunken-helix-bubbles-398 :id 340 :bounds (static-bspherem 0 4 0 40) - :parts - ((sp-item 1458 :fade-after (meters 100) :falloff-to (meters 100))) + :parts ((sp-item 1458 :fade-after (meters 100) :falloff-to (meters 100))) ) (defpart 1458 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.75) (sp-rnd-flt spt-x (meters -5) (meters 10) 1.0) (sp-rnd-flt spt-y (meters -10) (meters 15) 1.0) @@ -1485,28 +1436,24 @@ ) (defpart 1459 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 900 899 1) (sp-launcher-by-id spt-next-launcher 1460) ) ) (defpart 1460 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) (defpartgroup group-sunken-helix-bubbles-397 :id 341 :bounds (static-bspherem 0 4 0 40) - :parts - ((sp-item 1461 :fade-after (meters 100) :falloff-to (meters 100))) + :parts ((sp-item 1461 :fade-after (meters 100) :falloff-to (meters 100))) ) (defpart 1461 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.75) (sp-rnd-flt spt-x (meters -5) (meters 10) 1.0) (sp-rnd-flt spt-y (meters -20) (meters 30) 1.0) @@ -1530,8 +1477,7 @@ (defpartgroup group-sunken-heatpipe-355 :id 342 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1463 :fade-after (meters 80) :falloff-to (meters 80) :binding 1462) + :parts ((sp-item 1463 :fade-after (meters 80) :falloff-to (meters 80) :binding 1462) (sp-item 1462 :flags (bit1 start-dead launch-asap)) (sp-item 1462 :flags (bit1 start-dead launch-asap)) (sp-item 1462 :flags (bit1 start-dead launch-asap)) @@ -1562,8 +1508,7 @@ ) (defpart 1463 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -1581,8 +1526,7 @@ ) (defpart 1462 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 2.6666667)) (sp-flt spt-y (meters 3.3333333)) @@ -1605,8 +1549,7 @@ ) (defpart 1464 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1628,8 +1571,7 @@ (defpartgroup group-sunken-heatpipe-361 :id 343 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1466 :fade-after (meters 80) :falloff-to (meters 80) :binding 1465) + :parts ((sp-item 1466 :fade-after (meters 80) :falloff-to (meters 80) :binding 1465) (sp-item 1465 :flags (bit1 start-dead launch-asap)) (sp-item 1465 :flags (bit1 start-dead launch-asap)) (sp-item 1465 :flags (bit1 start-dead launch-asap)) @@ -1660,8 +1602,7 @@ ) (defpart 1466 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -1679,8 +1620,7 @@ ) (defpart 1465 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.5555553)) (sp-flt spt-y (meters 3.3333333)) @@ -1703,8 +1643,7 @@ ) (defpart 1467 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1726,8 +1665,7 @@ (defpartgroup group-sunken-heatpipe-360 :id 344 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1469 :fade-after (meters 80) :falloff-to (meters 80) :binding 1468) + :parts ((sp-item 1469 :fade-after (meters 80) :falloff-to (meters 80) :binding 1468) (sp-item 1468 :flags (bit1 start-dead launch-asap)) (sp-item 1468 :flags (bit1 start-dead launch-asap)) (sp-item 1468 :flags (bit1 start-dead launch-asap)) @@ -1758,8 +1696,7 @@ ) (defpart 1469 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -1777,8 +1714,7 @@ ) (defpart 1468 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.5555553)) (sp-flt spt-y (meters 4.6666665)) @@ -1801,8 +1737,7 @@ ) (defpart 1470 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1824,8 +1759,7 @@ (defpartgroup group-sunken-heatpipe-377 :id 345 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1472 :fade-after (meters 80) :falloff-to (meters 80) :binding 1471) + :parts ((sp-item 1472 :fade-after (meters 80) :falloff-to (meters 80) :binding 1471) (sp-item 1471 :flags (bit1 start-dead launch-asap)) (sp-item 1471 :flags (bit1 start-dead launch-asap)) (sp-item 1471 :flags (bit1 start-dead launch-asap)) @@ -1856,8 +1790,7 @@ ) (defpart 1472 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -1875,8 +1808,7 @@ ) (defpart 1471 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 4.6666665)) (sp-flt spt-y (meters 4.6666665)) @@ -1899,8 +1831,7 @@ ) (defpart 1473 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1922,8 +1853,7 @@ (defpartgroup group-sunken-heatpipe-376 :id 346 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1475 :fade-after (meters 80) :falloff-to (meters 80) :binding 1474) + :parts ((sp-item 1475 :fade-after (meters 80) :falloff-to (meters 80) :binding 1474) (sp-item 1474 :flags (bit1 start-dead launch-asap)) (sp-item 1474 :flags (bit1 start-dead launch-asap)) (sp-item 1474 :flags (bit1 start-dead launch-asap)) @@ -1954,8 +1884,7 @@ ) (defpart 1475 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -1973,8 +1902,7 @@ ) (defpart 1474 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 4.6666665)) (sp-flt spt-y (meters 3.3333333)) @@ -1997,8 +1925,7 @@ ) (defpart 1476 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -2020,8 +1947,7 @@ (defpartgroup group-sunken-heatpipe-375 :id 347 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1478 :fade-after (meters 80) :falloff-to (meters 80) :binding 1477) + :parts ((sp-item 1478 :fade-after (meters 80) :falloff-to (meters 80) :binding 1477) (sp-item 1477 :flags (bit1 start-dead launch-asap)) (sp-item 1477 :flags (bit1 start-dead launch-asap)) (sp-item 1477 :flags (bit1 start-dead launch-asap)) @@ -2052,8 +1978,7 @@ ) (defpart 1478 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -2071,8 +1996,7 @@ ) (defpart 1477 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.3333335)) (sp-flt spt-y (meters 4.4444447)) @@ -2095,8 +2019,7 @@ ) (defpart 1479 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -2118,8 +2041,7 @@ (defpartgroup group-sunken-heatpipe-374 :id 348 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1481 :fade-after (meters 80) :falloff-to (meters 80) :binding 1480) + :parts ((sp-item 1481 :fade-after (meters 80) :falloff-to (meters 80) :binding 1480) (sp-item 1480 :flags (bit1 start-dead launch-asap)) (sp-item 1480 :flags (bit1 start-dead launch-asap)) (sp-item 1480 :flags (bit1 start-dead launch-asap)) @@ -2150,8 +2072,7 @@ ) (defpart 1481 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -2169,8 +2090,7 @@ ) (defpart 1480 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.3333335)) (sp-flt spt-y (meters 3.5555556)) @@ -2193,8 +2113,7 @@ ) (defpart 1482 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -2216,8 +2135,7 @@ (defpartgroup group-sunken-heatpipe-363 :id 349 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1484 :fade-after (meters 80) :falloff-to (meters 80) :binding 1483) + :parts ((sp-item 1484 :fade-after (meters 80) :falloff-to (meters 80) :binding 1483) (sp-item 1483 :flags (bit1 start-dead launch-asap)) (sp-item 1483 :flags (bit1 start-dead launch-asap)) (sp-item 1483 :flags (bit1 start-dead launch-asap)) @@ -2248,8 +2166,7 @@ ) (defpart 1484 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.3)) @@ -2267,8 +2184,7 @@ ) (defpart 1483 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.4222223)) (sp-flt spt-y (meters 4.4444447)) @@ -2291,8 +2207,7 @@ ) (defpart 1485 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -2314,8 +2229,7 @@ (defpartgroup group-sunken-heatpipe-362 :id 350 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1487 :fade-after (meters 80) :falloff-to (meters 80) :binding 1486) + :parts ((sp-item 1487 :fade-after (meters 80) :falloff-to (meters 80) :binding 1486) (sp-item 1486 :flags (bit1 start-dead launch-asap)) (sp-item 1486 :flags (bit1 start-dead launch-asap)) (sp-item 1486 :flags (bit1 start-dead launch-asap)) @@ -2346,8 +2260,7 @@ ) (defpart 1487 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -2365,8 +2278,7 @@ ) (defpart 1486 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.4222223)) (sp-flt spt-y (meters 3.5555556)) @@ -2389,8 +2301,7 @@ ) (defpart 1488 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -2412,8 +2323,7 @@ (defpartgroup group-sunken-heatpipe-364 :id 351 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1490 :fade-after (meters 80) :falloff-to (meters 80) :binding 1489) + :parts ((sp-item 1490 :fade-after (meters 80) :falloff-to (meters 80) :binding 1489) (sp-item 1489 :flags (bit1 start-dead launch-asap)) (sp-item 1489 :flags (bit1 start-dead launch-asap)) (sp-item 1489 :flags (bit1 start-dead launch-asap)) @@ -2444,8 +2354,7 @@ ) (defpart 1490 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.3)) @@ -2463,8 +2372,7 @@ ) (defpart 1489 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -0.9777778)) (sp-flt spt-y (meters 3.5555556)) @@ -2487,8 +2395,7 @@ ) (defpart 1491 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -2510,8 +2417,7 @@ (defpartgroup group-sunken-heatpipe-365 :id 352 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1493 :fade-after (meters 80) :falloff-to (meters 80) :binding 1492) + :parts ((sp-item 1493 :fade-after (meters 80) :falloff-to (meters 80) :binding 1492) (sp-item 1492 :flags (bit1 start-dead launch-asap)) (sp-item 1492 :flags (bit1 start-dead launch-asap)) (sp-item 1492 :flags (bit1 start-dead launch-asap)) @@ -2542,8 +2448,7 @@ ) (defpart 1493 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -2561,8 +2466,7 @@ ) (defpart 1492 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -1.1111112)) (sp-flt spt-y (meters 4.4444447)) @@ -2585,8 +2489,7 @@ ) (defpart 1494 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) diff --git a/goal_src/levels/sunken/sunken-part2.gc b/goal_src/levels/sunken/sunken-part2.gc index 7ff2918a88..126c21ede4 100644 --- a/goal_src/levels/sunken/sunken-part2.gc +++ b/goal_src/levels/sunken/sunken-part2.gc @@ -10,8 +10,7 @@ (defpartgroup group-sunken-window-bubbles-34 :id 353 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1495 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1495 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1495 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -63,8 +62,7 @@ ) (defpart 1496 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -86,8 +84,7 @@ ) (defpart 1495 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -106,8 +103,7 @@ (defpartgroup group-sunken-window-bubbles-36 :id 354 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1497 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1497 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1497 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -159,8 +155,7 @@ ) (defpart 1498 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -182,8 +177,7 @@ ) (defpart 1497 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -202,8 +196,7 @@ (defpartgroup group-sunken-window-bubbles-30 :id 355 :bounds (static-bspherem 0 4 0 30) - :parts - ((sp-item 1499 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1499 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1499 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -255,8 +248,7 @@ ) (defpart 1500 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -278,8 +270,7 @@ ) (defpart 1499 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -298,8 +289,7 @@ (defpartgroup group-sunken-window-bubbles-31 :id 356 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1501 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1501 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1501 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -351,8 +341,7 @@ ) (defpart 1502 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -374,8 +363,7 @@ ) (defpart 1501 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -394,8 +382,7 @@ (defpartgroup group-sunken-window-bubbles-29 :id 357 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1503 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1503 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1503 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -447,8 +434,7 @@ ) (defpart 1504 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -470,8 +456,7 @@ ) (defpart 1503 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -490,8 +475,7 @@ (defpartgroup group-sunken-window-bubbles-159 :id 358 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1505 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1505 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1505 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -543,8 +527,7 @@ ) (defpart 1506 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -566,8 +549,7 @@ ) (defpart 1505 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -586,8 +568,7 @@ (defpartgroup group-sunken-window-bubbles-161 :id 359 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1507 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1507 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1507 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -639,8 +620,7 @@ ) (defpart 1508 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -662,8 +642,7 @@ ) (defpart 1507 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -682,8 +661,7 @@ (defpartgroup group-sunken-window-bubbles-204 :id 360 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1509 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1509 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1509 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -735,8 +713,7 @@ ) (defpart 1510 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -758,8 +735,7 @@ ) (defpart 1509 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -778,8 +754,7 @@ (defpartgroup group-sunken-window-bubbles-205 :id 361 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1511 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1511 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1511 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -831,8 +806,7 @@ ) (defpart 1512 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -854,8 +828,7 @@ ) (defpart 1511 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -874,8 +847,7 @@ (defpartgroup group-sunken-window-bubbles-203 :id 362 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1513 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1513 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1513 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -927,8 +899,7 @@ ) (defpart 1514 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters -2)) @@ -950,8 +921,7 @@ ) (defpart 1513 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters -2)) @@ -970,8 +940,7 @@ (defpartgroup group-sunken-window-bubbles-42 :id 363 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1515 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1515 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1515 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1023,8 +992,7 @@ ) (defpart 1516 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -25) (meters 50) 1.0) (sp-flt spt-y (meters -2)) @@ -1046,8 +1014,7 @@ ) (defpart 1515 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -25) (meters 50) 1.0) (sp-flt spt-y (meters -2)) @@ -1066,8 +1033,7 @@ (defpartgroup group-sunken-window-bubbles-41 :id 364 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1517 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1517 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1517 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1119,8 +1085,7 @@ ) (defpart 1518 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1142,8 +1107,7 @@ ) (defpart 1517 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1162,8 +1126,7 @@ (defpartgroup group-sunken-window-bubbles-206 :id 365 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1519 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1519 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1519 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1215,8 +1178,7 @@ ) (defpart 1520 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1238,8 +1200,7 @@ ) (defpart 1519 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1258,8 +1219,7 @@ (defpartgroup group-sunken-window-bubbles-201 :id 366 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1521 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1521 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1521 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1311,8 +1271,7 @@ ) (defpart 1522 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1334,8 +1293,7 @@ ) (defpart 1521 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1354,8 +1312,7 @@ (defpartgroup group-sunken-window-bubbles-3 :id 367 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1523 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1523 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1523 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1407,8 +1364,7 @@ ) (defpart 1524 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1430,8 +1386,7 @@ ) (defpart 1523 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1450,8 +1405,7 @@ (defpartgroup group-sunken-window-bubbles-2 :id 368 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1525 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1525 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1525 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1503,8 +1457,7 @@ ) (defpart 1526 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1526,8 +1479,7 @@ ) (defpart 1525 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1546,8 +1498,7 @@ (defpartgroup group-sunken-heatpipe-382 :id 369 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1528 :fade-after (meters 80) :falloff-to (meters 80) :binding 1527) + :parts ((sp-item 1528 :fade-after (meters 80) :falloff-to (meters 80) :binding 1527) (sp-item 1527 :flags (bit1 start-dead launch-asap)) (sp-item 1527 :flags (bit1 start-dead launch-asap)) (sp-item 1527 :flags (bit1 start-dead launch-asap)) @@ -1578,8 +1529,7 @@ ) (defpart 1528 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -1597,8 +1547,7 @@ ) (defpart 1527 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 6.2222223)) (sp-flt spt-y (meters 4)) @@ -1621,8 +1570,7 @@ ) (defpart 1529 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -1644,8 +1592,7 @@ (defpartgroup group-sunken-heatpipe-381 :id 370 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1531 :fade-after (meters 80) :falloff-to (meters 80) :binding 1530) + :parts ((sp-item 1531 :fade-after (meters 80) :falloff-to (meters 80) :binding 1530) (sp-item 1530 :flags (bit1 start-dead launch-asap)) (sp-item 1530 :flags (bit1 start-dead launch-asap)) (sp-item 1530 :flags (bit1 start-dead launch-asap)) @@ -1676,8 +1623,7 @@ ) (defpart 1531 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -1695,8 +1641,7 @@ ) (defpart 1530 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 7.5555553)) (sp-flt spt-y (meters 4)) @@ -1719,8 +1664,7 @@ ) (defpart 1532 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -1742,8 +1686,7 @@ (defpartgroup group-sunken-heatpipe-380 :id 371 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1534 :fade-after (meters 80) :falloff-to (meters 80) :binding 1533) + :parts ((sp-item 1534 :fade-after (meters 80) :falloff-to (meters 80) :binding 1533) (sp-item 1533 :flags (bit1 start-dead launch-asap)) (sp-item 1533 :flags (bit1 start-dead launch-asap)) (sp-item 1533 :flags (bit1 start-dead launch-asap)) @@ -1774,8 +1717,7 @@ ) (defpart 1534 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -1793,8 +1735,7 @@ ) (defpart 1533 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 6.2222223)) (sp-flt spt-y (meters 4)) @@ -1817,8 +1758,7 @@ ) (defpart 1535 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -1840,8 +1780,7 @@ (defpartgroup group-sunken-heatpipe-379 :id 372 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1537 :fade-after (meters 80) :falloff-to (meters 80) :binding 1536) + :parts ((sp-item 1537 :fade-after (meters 80) :falloff-to (meters 80) :binding 1536) (sp-item 1536 :flags (bit1 start-dead launch-asap)) (sp-item 1536 :flags (bit1 start-dead launch-asap)) (sp-item 1536 :flags (bit1 start-dead launch-asap)) @@ -1872,8 +1811,7 @@ ) (defpart 1537 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -1891,8 +1829,7 @@ ) (defpart 1536 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 7.111111)) (sp-flt spt-y (meters 4)) @@ -1915,8 +1852,7 @@ ) (defpart 1538 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -1938,8 +1874,7 @@ (defpartgroup group-sunken-heatpipe-378 :id 373 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1540 :fade-after (meters 80) :falloff-to (meters 80) :binding 1539) + :parts ((sp-item 1540 :fade-after (meters 80) :falloff-to (meters 80) :binding 1539) (sp-item 1539 :flags (bit1 start-dead launch-asap)) (sp-item 1539 :flags (bit1 start-dead launch-asap)) (sp-item 1539 :flags (bit1 start-dead launch-asap)) @@ -1970,8 +1905,7 @@ ) (defpart 1540 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -1989,8 +1923,7 @@ ) (defpart 1539 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.111111)) (sp-flt spt-y (meters 4)) @@ -2013,8 +1946,7 @@ ) (defpart 1541 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -2036,8 +1968,7 @@ (defpartgroup group-sunken-window-bubbles-402 :id 374 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1542 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1542 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1542 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -2089,8 +2020,7 @@ ) (defpart 1543 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -2112,8 +2042,7 @@ ) (defpart 1542 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -2132,8 +2061,7 @@ (defpartgroup group-sunken-window-bubbles-401 :id 375 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1544 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1544 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1544 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -2185,8 +2113,7 @@ ) (defpart 1545 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -2208,8 +2135,7 @@ ) (defpart 1544 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -2228,8 +2154,7 @@ (defpartgroup group-sunken-window-bubbles-400 :id 376 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1546 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1546 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1546 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -2281,8 +2206,7 @@ ) (defpart 1547 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -2304,8 +2228,7 @@ ) (defpart 1546 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -2324,8 +2247,7 @@ (defpartgroup group-sunken-window-bubbles-399 :id 377 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1548 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1548 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1548 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -2377,8 +2299,7 @@ ) (defpart 1549 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -2400,8 +2321,7 @@ ) (defpart 1548 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) diff --git a/goal_src/levels/sunken/sunken-part3.gc b/goal_src/levels/sunken/sunken-part3.gc index a149e5f673..158e772e87 100644 --- a/goal_src/levels/sunken/sunken-part3.gc +++ b/goal_src/levels/sunken/sunken-part3.gc @@ -10,8 +10,7 @@ (defpartgroup group-sunken-heatpipe-383 :id 378 :bounds (static-bspherem 0 1 0 3) - :parts - ((sp-item 1551 :fade-after (meters 80) :falloff-to (meters 80) :binding 1550) + :parts ((sp-item 1551 :fade-after (meters 80) :falloff-to (meters 80) :binding 1550) (sp-item 1550 :flags (bit1 start-dead launch-asap)) (sp-item 1550 :flags (bit1 start-dead launch-asap)) (sp-item 1550 :flags (bit1 start-dead launch-asap)) @@ -42,8 +41,7 @@ ) (defpart 1551 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -61,8 +59,7 @@ ) (defpart 1550 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 4)) @@ -85,8 +82,7 @@ ) (defpart 1552 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -108,8 +104,7 @@ (defpartgroup group-sunken-heatpipe-198 :id 379 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1554 :fade-after (meters 80) :falloff-to (meters 80) :binding 1553) + :parts ((sp-item 1554 :fade-after (meters 80) :falloff-to (meters 80) :binding 1553) (sp-item 1553 :flags (bit1 start-dead launch-asap)) (sp-item 1553 :flags (bit1 start-dead launch-asap)) (sp-item 1553 :flags (bit1 start-dead launch-asap)) @@ -140,8 +135,7 @@ ) (defpart 1554 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -159,8 +153,7 @@ ) (defpart 1553 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.3333334)) (sp-flt spt-y (meters 4)) @@ -183,8 +176,7 @@ ) (defpart 1555 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -206,8 +198,7 @@ (defpartgroup group-sunken-heatpipe-189 :id 380 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1557 :fade-after (meters 80) :falloff-to (meters 80) :binding 1556) + :parts ((sp-item 1557 :fade-after (meters 80) :falloff-to (meters 80) :binding 1556) (sp-item 1556 :flags (bit1 start-dead launch-asap)) (sp-item 1556 :flags (bit1 start-dead launch-asap)) (sp-item 1556 :flags (bit1 start-dead launch-asap)) @@ -238,8 +229,7 @@ ) (defpart 1557 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 0.7) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -257,8 +247,7 @@ ) (defpart 1556 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-x (meters 1.1555556)) (sp-flt spt-y (meters 4)) @@ -281,8 +270,7 @@ ) (defpart 1558 - :init-specs - ((sp-flt spt-num 0.05) + :init-specs ((sp-flt spt-num 0.05) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -304,8 +292,7 @@ (defpartgroup group-sunken-heatpipe-193 :id 381 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1560 :fade-after (meters 80) :falloff-to (meters 80) :binding 1559) + :parts ((sp-item 1560 :fade-after (meters 80) :falloff-to (meters 80) :binding 1559) (sp-item 1559 :flags (bit1 start-dead launch-asap)) (sp-item 1559 :flags (bit1 start-dead launch-asap)) (sp-item 1559 :flags (bit1 start-dead launch-asap)) @@ -337,8 +324,7 @@ ) (defpart 1560 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 0.4) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters -1.4)) @@ -356,8 +342,7 @@ ) (defpart 1559 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.1555556)) (sp-flt spt-y (meters 0)) @@ -380,8 +365,7 @@ ) (defpart 1561 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -1.4) (meters 2.8) 1.0) (sp-int spt-rot-x 6) (sp-flt spt-r 3276.8) @@ -398,8 +382,7 @@ ) (defpart 1562 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -1.4) (meters 2.8) 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) @@ -423,8 +406,7 @@ (defpartgroup group-sunken-heatpipe-207 :id 382 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1564 :fade-after (meters 80) :falloff-to (meters 80) :binding 1563) + :parts ((sp-item 1564 :fade-after (meters 80) :falloff-to (meters 80) :binding 1563) (sp-item 1563 :flags (bit1 start-dead launch-asap)) (sp-item 1563 :flags (bit1 start-dead launch-asap)) (sp-item 1563 :flags (bit1 start-dead launch-asap)) @@ -455,8 +437,7 @@ ) (defpart 1564 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -474,8 +455,7 @@ ) (defpart 1563 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.1555557)) (sp-flt spt-y (meters 4)) @@ -498,8 +478,7 @@ ) (defpart 1565 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -521,8 +500,7 @@ (defpartgroup group-sunken-window-bubbles-388 :id 383 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1566 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1566 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1566 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -574,8 +552,7 @@ ) (defpart 1567 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -12) (meters 24) 1.0) (sp-flt spt-y (meters -2)) @@ -597,8 +574,7 @@ ) (defpart 1566 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -12) (meters 24) 1.0) (sp-flt spt-y (meters -2)) @@ -617,8 +593,7 @@ (defpartgroup group-sunken-window-bubbles-387 :id 384 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1568 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1568 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1568 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -670,8 +645,7 @@ ) (defpart 1569 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -693,8 +667,7 @@ ) (defpart 1568 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -713,8 +686,7 @@ (defpartgroup group-sunken-window-bubbles-386 :id 385 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1570 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1570 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1570 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -766,8 +738,7 @@ ) (defpart 1571 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -789,8 +760,7 @@ ) (defpart 1570 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -809,8 +779,7 @@ (defpartgroup group-sunken-window-bubbles-384 :id 386 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1572 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1572 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1572 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -862,8 +831,7 @@ ) (defpart 1573 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -12) (meters 24) 1.0) (sp-flt spt-y (meters -2)) @@ -885,8 +853,7 @@ ) (defpart 1572 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -12) (meters 24) 1.0) (sp-flt spt-y (meters -2)) @@ -905,8 +872,7 @@ (defpartgroup group-sunken-window-bubbles-385 :id 387 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1574 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1574 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1574 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -958,8 +924,7 @@ ) (defpart 1575 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -981,8 +946,7 @@ ) (defpart 1574 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1001,8 +965,7 @@ (defpartgroup group-sunken-window-bubbles-394 :id 388 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1576 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1576 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1576 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1054,8 +1017,7 @@ ) (defpart 1577 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1077,8 +1039,7 @@ ) (defpart 1576 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1097,8 +1058,7 @@ (defpartgroup group-sunken-window-bubbles-390 :id 389 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1578 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1578 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1578 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1150,8 +1110,7 @@ ) (defpart 1579 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1173,8 +1132,7 @@ ) (defpart 1578 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1193,8 +1151,7 @@ (defpartgroup group-sunken-window-bubbles-393 :id 390 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1582 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1582 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1582 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1246,8 +1203,7 @@ ) (defpart 1583 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters -2)) @@ -1269,8 +1225,7 @@ ) (defpart 1582 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters -2)) @@ -1289,8 +1244,7 @@ (defpartgroup group-sunken-window-bubbles-392 :id 391 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1584 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1584 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1584 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1342,8 +1296,7 @@ ) (defpart 1585 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1365,8 +1318,7 @@ ) (defpart 1584 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1385,8 +1337,7 @@ (defpartgroup group-sunken-window-bubbles-38 :id 392 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1586 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1586 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1586 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1438,8 +1389,7 @@ ) (defpart 1587 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1461,8 +1411,7 @@ ) (defpart 1586 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1481,8 +1430,7 @@ (defpartgroup group-sunken-window-bubbles-200 :id 393 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1588 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1588 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1588 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1534,8 +1482,7 @@ ) (defpart 1589 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -10) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1557,8 +1504,7 @@ ) (defpart 1588 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1577,8 +1523,7 @@ (defpartgroup group-sunken-window-bubbles-391 :id 394 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1580 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1580 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1580 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1630,8 +1575,7 @@ ) (defpart 1581 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1653,8 +1597,7 @@ ) (defpart 1580 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) diff --git a/goal_src/levels/sunken/sunken-part4.gc b/goal_src/levels/sunken/sunken-part4.gc index 6b98341a25..2612e6e7d0 100644 --- a/goal_src/levels/sunken/sunken-part4.gc +++ b/goal_src/levels/sunken/sunken-part4.gc @@ -10,8 +10,7 @@ (defpartgroup group-sunken-heatpipe-282 :id 395 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1591 :fade-after (meters 80) :falloff-to (meters 80) :binding 1590) + :parts ((sp-item 1591 :fade-after (meters 80) :falloff-to (meters 80) :binding 1590) (sp-item 1590 :flags (bit1 start-dead launch-asap)) (sp-item 1590 :flags (bit1 start-dead launch-asap)) (sp-item 1590 :flags (bit1 start-dead launch-asap)) @@ -42,8 +41,7 @@ ) (defpart 1591 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -61,8 +59,7 @@ ) (defpart 1590 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.1111112)) (sp-flt spt-y (meters 3.3333333)) @@ -85,8 +82,7 @@ ) (defpart 1592 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -108,8 +104,7 @@ (defpartgroup group-sunken-heatpipe-285 :id 396 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1594 :fade-after (meters 80) :falloff-to (meters 80) :binding 1593) + :parts ((sp-item 1594 :fade-after (meters 80) :falloff-to (meters 80) :binding 1593) (sp-item 1593 :flags (bit1 start-dead launch-asap)) (sp-item 1593 :flags (bit1 start-dead launch-asap)) (sp-item 1593 :flags (bit1 start-dead launch-asap)) @@ -140,8 +135,7 @@ ) (defpart 1594 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -159,8 +153,7 @@ ) (defpart 1593 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0.6666667)) (sp-flt spt-y (meters 3.3333333)) @@ -183,8 +176,7 @@ ) (defpart 1595 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -206,8 +198,7 @@ (defpartgroup group-sunken-heatpipe-288 :id 397 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1597 :fade-after (meters 80) :falloff-to (meters 80) :binding 1596) + :parts ((sp-item 1597 :fade-after (meters 80) :falloff-to (meters 80) :binding 1596) (sp-item 1596 :flags (bit1 start-dead launch-asap)) (sp-item 1596 :flags (bit1 start-dead launch-asap)) (sp-item 1596 :flags (bit1 start-dead launch-asap)) @@ -238,8 +229,7 @@ ) (defpart 1597 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -257,8 +247,7 @@ ) (defpart 1596 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 3.3333333)) @@ -281,8 +270,7 @@ ) (defpart 1598 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -304,8 +292,7 @@ (defpartgroup group-sunken-heatpipe-299 :id 398 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1600 :fade-after (meters 80) :falloff-to (meters 80) :binding 1599) + :parts ((sp-item 1600 :fade-after (meters 80) :falloff-to (meters 80) :binding 1599) (sp-item 1599 :flags (bit1 start-dead launch-asap)) (sp-item 1599 :flags (bit1 start-dead launch-asap)) (sp-item 1599 :flags (bit1 start-dead launch-asap)) @@ -336,8 +323,7 @@ ) (defpart 1600 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -355,8 +341,7 @@ ) (defpart 1599 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -1.1111112)) (sp-flt spt-y (meters 3.3333333)) @@ -379,8 +364,7 @@ ) (defpart 1601 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -402,8 +386,7 @@ (defpartgroup group-sunken-heatpipe-302 :id 399 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1603 :fade-after (meters 80) :falloff-to (meters 80) :binding 1602) + :parts ((sp-item 1603 :fade-after (meters 80) :falloff-to (meters 80) :binding 1602) (sp-item 1602 :flags (bit1 start-dead launch-asap)) (sp-item 1602 :flags (bit1 start-dead launch-asap)) (sp-item 1602 :flags (bit1 start-dead launch-asap)) @@ -434,8 +417,7 @@ ) (defpart 1603 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -453,8 +435,7 @@ ) (defpart 1602 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -1.7777778)) (sp-flt spt-y (meters 3.3333333)) @@ -477,8 +458,7 @@ ) (defpart 1604 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -500,8 +480,7 @@ (defpartgroup group-sunken-heatpipe-367 :id 400 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1606 :fade-after (meters 80) :falloff-to (meters 80) :binding 1605) + :parts ((sp-item 1606 :fade-after (meters 80) :falloff-to (meters 80) :binding 1605) (sp-item 1605 :flags (bit1 start-dead launch-asap)) (sp-item 1605 :flags (bit1 start-dead launch-asap)) (sp-item 1605 :flags (bit1 start-dead launch-asap)) @@ -532,8 +511,7 @@ ) (defpart 1606 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -551,8 +529,7 @@ ) (defpart 1605 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -2.6666667)) (sp-flt spt-y (meters 3.3333333)) @@ -575,8 +552,7 @@ ) (defpart 1607 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -598,8 +574,7 @@ (defpartgroup group-sunken-heatpipe-371 :id 401 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1609 :fade-after (meters 80) :falloff-to (meters 80) :binding 1608) + :parts ((sp-item 1609 :fade-after (meters 80) :falloff-to (meters 80) :binding 1608) (sp-item 1608 :flags (bit1 start-dead launch-asap)) (sp-item 1608 :flags (bit1 start-dead launch-asap)) (sp-item 1608 :flags (bit1 start-dead launch-asap)) @@ -630,8 +605,7 @@ ) (defpart 1609 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -649,8 +623,7 @@ ) (defpart 1608 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -3.5555556)) (sp-flt spt-y (meters 3.3333333)) @@ -673,8 +646,7 @@ ) (defpart 1610 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -696,8 +668,7 @@ (defpartgroup group-sunken-heatpipe-308 :id 402 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1612 :fade-after (meters 80) :falloff-to (meters 80) :binding 1611) + :parts ((sp-item 1612 :fade-after (meters 80) :falloff-to (meters 80) :binding 1611) (sp-item 1611 :flags (bit1 start-dead launch-asap)) (sp-item 1611 :flags (bit1 start-dead launch-asap)) (sp-item 1611 :flags (bit1 start-dead launch-asap)) @@ -728,8 +699,7 @@ ) (defpart 1612 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.3)) @@ -747,8 +717,7 @@ ) (defpart 1611 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 3.7777777)) @@ -771,8 +740,7 @@ ) (defpart 1613 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -794,8 +762,7 @@ (defpartgroup group-sunken-heatpipe-312 :id 403 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1615 :fade-after (meters 80) :falloff-to (meters 80) :binding 1614) + :parts ((sp-item 1615 :fade-after (meters 80) :falloff-to (meters 80) :binding 1614) (sp-item 1614 :flags (bit1 start-dead launch-asap)) (sp-item 1614 :flags (bit1 start-dead launch-asap)) (sp-item 1614 :flags (bit1 start-dead launch-asap)) @@ -826,8 +793,7 @@ ) (defpart 1615 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.3)) @@ -845,8 +811,7 @@ ) (defpart 1614 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -4.4444447)) (sp-flt spt-y (meters 4.4444447)) @@ -869,8 +834,7 @@ ) (defpart 1616 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -892,8 +856,7 @@ (defpartgroup group-sunken-heatpipe-316 :id 404 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1618 :fade-after (meters 80) :falloff-to (meters 80) :binding 1617) + :parts ((sp-item 1618 :fade-after (meters 80) :falloff-to (meters 80) :binding 1617) (sp-item 1617 :flags (bit1 start-dead launch-asap)) (sp-item 1617 :flags (bit1 start-dead launch-asap)) (sp-item 1617 :flags (bit1 start-dead launch-asap)) @@ -924,8 +887,7 @@ ) (defpart 1618 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.3)) @@ -943,8 +905,7 @@ ) (defpart 1617 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -3.1111112)) (sp-flt spt-y (meters 4.4444447)) @@ -967,8 +928,7 @@ ) (defpart 1619 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -990,8 +950,7 @@ (defpartgroup group-sunken-heatpipe-320 :id 405 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1621 :fade-after (meters 80) :falloff-to (meters 80) :binding 1620) + :parts ((sp-item 1621 :fade-after (meters 80) :falloff-to (meters 80) :binding 1620) (sp-item 1620 :flags (bit1 start-dead launch-asap)) (sp-item 1620 :flags (bit1 start-dead launch-asap)) (sp-item 1620 :flags (bit1 start-dead launch-asap)) @@ -1022,8 +981,7 @@ ) (defpart 1621 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.3)) @@ -1041,8 +999,7 @@ ) (defpart 1620 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -0.6666667)) (sp-flt spt-y (meters 4.4444447)) @@ -1065,8 +1022,7 @@ ) (defpart 1622 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -1088,8 +1044,7 @@ (defpartgroup group-sunken-heatpipe-324 :id 406 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1624 :fade-after (meters 80) :falloff-to (meters 80) :binding 1623) + :parts ((sp-item 1624 :fade-after (meters 80) :falloff-to (meters 80) :binding 1623) (sp-item 1623 :flags (bit1 start-dead launch-asap)) (sp-item 1623 :flags (bit1 start-dead launch-asap)) (sp-item 1623 :flags (bit1 start-dead launch-asap)) @@ -1120,8 +1075,7 @@ ) (defpart 1624 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.2)) @@ -1139,8 +1093,7 @@ ) (defpart 1623 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0.22222222)) (sp-flt spt-y (meters 4.2222223)) @@ -1163,8 +1116,7 @@ ) (defpart 1625 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) (sp-int spt-rot-x 6) @@ -1186,8 +1138,7 @@ (defpartgroup group-sunken-heatpipe-328 :id 407 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1627 :fade-after (meters 80) :falloff-to (meters 80) :binding 1626) + :parts ((sp-item 1627 :fade-after (meters 80) :falloff-to (meters 80) :binding 1626) (sp-item 1626 :flags (bit1 start-dead launch-asap)) (sp-item 1626 :flags (bit1 start-dead launch-asap)) (sp-item 1626 :flags (bit1 start-dead launch-asap)) @@ -1218,8 +1169,7 @@ ) (defpart 1627 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.2)) @@ -1237,8 +1187,7 @@ ) (defpart 1626 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0.8888889)) (sp-flt spt-y (meters 4.2222223)) @@ -1261,8 +1210,7 @@ ) (defpart 1628 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) (sp-int spt-rot-x 6) @@ -1284,8 +1232,7 @@ (defpartgroup group-sunken-heatpipe-332 :id 408 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1630 :fade-after (meters 80) :falloff-to (meters 80) :binding 1629) + :parts ((sp-item 1630 :fade-after (meters 80) :falloff-to (meters 80) :binding 1629) (sp-item 1629 :flags (bit1 start-dead launch-asap)) (sp-item 1629 :flags (bit1 start-dead launch-asap)) (sp-item 1629 :flags (bit1 start-dead launch-asap)) @@ -1316,8 +1263,7 @@ ) (defpart 1630 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.4)) @@ -1335,8 +1281,7 @@ ) (defpart 1629 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 3.3333333)) (sp-flt spt-y (meters 4.6666665)) @@ -1359,8 +1304,7 @@ ) (defpart 1631 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.70000005)) (sp-int spt-rot-x 6) @@ -1382,8 +1326,7 @@ (defpartgroup group-sunken-heatpipe-333 :id 409 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1633 :fade-after (meters 80) :falloff-to (meters 80) :binding 1632) + :parts ((sp-item 1633 :fade-after (meters 80) :falloff-to (meters 80) :binding 1632) (sp-item 1632 :flags (bit1 start-dead launch-asap)) (sp-item 1632 :flags (bit1 start-dead launch-asap)) (sp-item 1632 :flags (bit1 start-dead launch-asap)) @@ -1414,8 +1357,7 @@ ) (defpart 1633 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.9)) (sp-flt spt-y (meters 0.9)) @@ -1433,8 +1375,7 @@ ) (defpart 1632 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.3333335)) (sp-flt spt-y (meters 5.111111)) @@ -1457,8 +1398,7 @@ ) (defpart 1634 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.9)) (sp-flt spt-y (meters 1.2)) (sp-int spt-rot-x 6) @@ -1480,8 +1420,7 @@ (defpartgroup group-sunken-heatpipe-334 :id 410 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1636 :fade-after (meters 80) :falloff-to (meters 80) :binding 1635) + :parts ((sp-item 1636 :fade-after (meters 80) :falloff-to (meters 80) :binding 1635) (sp-item 1635 :flags (bit1 start-dead launch-asap)) (sp-item 1635 :flags (bit1 start-dead launch-asap)) (sp-item 1635 :flags (bit1 start-dead launch-asap)) @@ -1512,8 +1451,7 @@ ) (defpart 1636 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.9)) (sp-flt spt-y (meters 0.7)) @@ -1531,8 +1469,7 @@ ) (defpart 1635 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.111111)) (sp-flt spt-y (meters 5.111111)) @@ -1555,8 +1492,7 @@ ) (defpart 1637 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.9)) (sp-flt spt-y (meters 1)) (sp-int spt-rot-x 6) @@ -1578,8 +1514,7 @@ (defpartgroup group-sunken-heatpipe-335 :id 411 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1639 :fade-after (meters 80) :falloff-to (meters 80) :binding 1638) + :parts ((sp-item 1639 :fade-after (meters 80) :falloff-to (meters 80) :binding 1638) (sp-item 1638 :flags (bit1 start-dead launch-asap)) (sp-item 1638 :flags (bit1 start-dead launch-asap)) (sp-item 1638 :flags (bit1 start-dead launch-asap)) @@ -1610,8 +1545,7 @@ ) (defpart 1639 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -1629,8 +1563,7 @@ ) (defpart 1638 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 4.4444447)) (sp-flt spt-y (meters 5.111111)) @@ -1653,8 +1586,7 @@ ) (defpart 1640 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1676,8 +1608,7 @@ (defpartgroup group-sunken-heatpipe-336 :id 412 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1642 :fade-after (meters 80) :falloff-to (meters 80) :binding 1641) + :parts ((sp-item 1642 :fade-after (meters 80) :falloff-to (meters 80) :binding 1641) (sp-item 1641 :flags (bit1 start-dead launch-asap)) (sp-item 1641 :flags (bit1 start-dead launch-asap)) (sp-item 1641 :flags (bit1 start-dead launch-asap)) @@ -1708,8 +1639,7 @@ ) (defpart 1642 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -1727,8 +1657,7 @@ ) (defpart 1641 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 3.7777777)) (sp-flt spt-y (meters 5.111111)) @@ -1751,8 +1680,7 @@ ) (defpart 1643 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1774,8 +1702,7 @@ (defpartgroup group-sunken-heatpipe-337 :id 413 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1645 :fade-after (meters 80) :falloff-to (meters 80) :binding 1644) + :parts ((sp-item 1645 :fade-after (meters 80) :falloff-to (meters 80) :binding 1644) (sp-item 1644 :flags (bit1 start-dead launch-asap)) (sp-item 1644 :flags (bit1 start-dead launch-asap)) (sp-item 1644 :flags (bit1 start-dead launch-asap)) @@ -1806,8 +1733,7 @@ ) (defpart 1645 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -1825,8 +1751,7 @@ ) (defpart 1644 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 2.4444444)) (sp-flt spt-y (meters 5.111111)) @@ -1849,8 +1774,7 @@ ) (defpart 1646 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1872,8 +1796,7 @@ (defpartgroup group-sunken-heatpipe-338 :id 414 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1648 :fade-after (meters 80) :falloff-to (meters 80) :binding 1647) + :parts ((sp-item 1648 :fade-after (meters 80) :falloff-to (meters 80) :binding 1647) (sp-item 1647 :flags (bit1 start-dead launch-asap)) (sp-item 1647 :flags (bit1 start-dead launch-asap)) (sp-item 1647 :flags (bit1 start-dead launch-asap)) @@ -1904,8 +1827,7 @@ ) (defpart 1648 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -1923,8 +1845,7 @@ ) (defpart 1647 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.7777778)) (sp-flt spt-y (meters 5.111111)) @@ -1947,8 +1868,7 @@ ) (defpart 1649 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1970,8 +1890,7 @@ (defpartgroup group-sunken-heatpipe-339 :id 415 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1651 :fade-after (meters 80) :falloff-to (meters 80) :binding 1650) + :parts ((sp-item 1651 :fade-after (meters 80) :falloff-to (meters 80) :binding 1650) (sp-item 1650 :flags (bit1 start-dead launch-asap)) (sp-item 1650 :flags (bit1 start-dead launch-asap)) (sp-item 1650 :flags (bit1 start-dead launch-asap)) @@ -2002,8 +1921,7 @@ ) (defpart 1651 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.3)) @@ -2021,8 +1939,7 @@ ) (defpart 1650 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0.44444445)) (sp-flt spt-y (meters 4.4444447)) @@ -2045,8 +1962,7 @@ ) (defpart 1652 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -2068,8 +1984,7 @@ (defpartgroup group-sunken-heatpipe-340 :id 416 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1654 :fade-after (meters 80) :falloff-to (meters 80) :binding 1653) + :parts ((sp-item 1654 :fade-after (meters 80) :falloff-to (meters 80) :binding 1653) (sp-item 1653 :flags (bit1 start-dead launch-asap)) (sp-item 1653 :flags (bit1 start-dead launch-asap)) (sp-item 1653 :flags (bit1 start-dead launch-asap)) @@ -2100,8 +2015,7 @@ ) (defpart 1654 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -2119,8 +2033,7 @@ ) (defpart 1653 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 3.1111112)) (sp-flt spt-y (meters 3.5555556)) @@ -2143,8 +2056,7 @@ ) (defpart 1655 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -2166,8 +2078,7 @@ (defpartgroup group-sunken-heatpipe-341 :id 417 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1657 :fade-after (meters 80) :falloff-to (meters 80) :binding 1656) + :parts ((sp-item 1657 :fade-after (meters 80) :falloff-to (meters 80) :binding 1656) (sp-item 1656 :flags (bit1 start-dead launch-asap)) (sp-item 1656 :flags (bit1 start-dead launch-asap)) (sp-item 1656 :flags (bit1 start-dead launch-asap)) @@ -2198,8 +2109,7 @@ ) (defpart 1657 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.3)) @@ -2217,8 +2127,7 @@ ) (defpart 1656 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 3.7777777)) (sp-flt spt-y (meters 3.5555556)) @@ -2241,8 +2150,7 @@ ) (defpart 1658 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -2264,8 +2172,7 @@ (defpartgroup group-sunken-heatpipe-357 :id 418 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1660 :fade-after (meters 80) :falloff-to (meters 80) :binding 1659) + :parts ((sp-item 1660 :fade-after (meters 80) :falloff-to (meters 80) :binding 1659) (sp-item 1659 :flags (bit1 start-dead launch-asap)) (sp-item 1659 :flags (bit1 start-dead launch-asap)) (sp-item 1659 :flags (bit1 start-dead launch-asap)) @@ -2296,8 +2203,7 @@ ) (defpart 1660 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.3)) @@ -2315,8 +2221,7 @@ ) (defpart 1659 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.7777778)) (sp-flt spt-y (meters 3.5555556)) @@ -2339,8 +2244,7 @@ ) (defpart 1661 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -2362,8 +2266,7 @@ (defpartgroup group-sunken-heatpipe-356 :id 419 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1663 :fade-after (meters 80) :falloff-to (meters 80) :binding 1662) + :parts ((sp-item 1663 :fade-after (meters 80) :falloff-to (meters 80) :binding 1662) (sp-item 1662 :flags (bit1 start-dead launch-asap)) (sp-item 1662 :flags (bit1 start-dead launch-asap)) (sp-item 1662 :flags (bit1 start-dead launch-asap)) @@ -2394,8 +2297,7 @@ ) (defpart 1663 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.3)) @@ -2413,8 +2315,7 @@ ) (defpart 1662 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.7777778)) (sp-flt spt-y (meters 4.4444447)) @@ -2437,8 +2338,7 @@ ) (defpart 1664 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -2460,8 +2360,7 @@ (defpartgroup group-sunken-heatpipe-354 :id 420 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1666 :fade-after (meters 80) :falloff-to (meters 80) :binding 1665) + :parts ((sp-item 1666 :fade-after (meters 80) :falloff-to (meters 80) :binding 1665) (sp-item 1665 :flags (bit1 start-dead launch-asap)) (sp-item 1665 :flags (bit1 start-dead launch-asap)) (sp-item 1665 :flags (bit1 start-dead launch-asap)) @@ -2492,8 +2391,7 @@ ) (defpart 1666 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.3)) @@ -2511,8 +2409,7 @@ ) (defpart 1665 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 2.6666667)) (sp-flt spt-y (meters 4.4444447)) @@ -2535,8 +2432,7 @@ ) (defpart 1667 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -2558,13 +2454,11 @@ (defpartgroup group-sunken-sheild :id 565 :bounds (static-bspherem 0 0 0 32) - :parts - ((sp-item 2311) (sp-item 2312 :flags (is-3d))) + :parts ((sp-item 2311) (sp-item 2312 :flags (is-3d))) ) (defpart 2312 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-rnd-flt spt-num 0.1 0.6 1.0) (sp-rnd-flt spt-x (meters 0) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) @@ -2588,13 +2482,11 @@ ) (defpart 2313 - :init-specs - ((sp-flt spt-fade-a 0.0)) + :init-specs ((sp-flt spt-fade-a 0.0)) ) (defpart 2311 - :init-specs - ((sp-rnd-flt spt-num 4.0 2.0 1.0) + :init-specs ((sp-rnd-flt spt-num 4.0 2.0 1.0) (sp-rnd-flt spt-x (meters 2) (meters 17) 1.0) (sp-flt spt-y (meters -6)) (sp-int spt-rot-x 8) @@ -2612,8 +2504,7 @@ ) (defpart 2314 - :init-specs - ((sp-flt spt-fade-b 32.768)) + :init-specs ((sp-flt spt-fade-b 32.768)) ) diff --git a/goal_src/levels/sunken/sunken-part5.gc b/goal_src/levels/sunken/sunken-part5.gc index 065f54e577..94993ac9f6 100644 --- a/goal_src/levels/sunken/sunken-part5.gc +++ b/goal_src/levels/sunken/sunken-part5.gc @@ -10,8 +10,7 @@ (defpartgroup group-sunken-heatpipe-227 :id 421 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1669 :fade-after (meters 80) :falloff-to (meters 80) :binding 1668) + :parts ((sp-item 1669 :fade-after (meters 80) :falloff-to (meters 80) :binding 1668) (sp-item 1668 :flags (bit1 start-dead launch-asap)) (sp-item 1668 :flags (bit1 start-dead launch-asap)) (sp-item 1668 :flags (bit1 start-dead launch-asap)) @@ -42,8 +41,7 @@ ) (defpart 1669 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) @@ -61,8 +59,7 @@ ) (defpart 1668 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -1.7777778)) (sp-flt spt-y (meters 4.888889)) @@ -85,8 +82,7 @@ ) (defpart 1670 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.90000004)) (sp-int spt-rot-x 6) @@ -108,8 +104,7 @@ (defpartgroup group-sunken-heatpipe-238 :id 422 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1672 :fade-after (meters 80) :falloff-to (meters 80) :binding 1671) + :parts ((sp-item 1672 :fade-after (meters 80) :falloff-to (meters 80) :binding 1671) (sp-item 1671 :flags (bit1 start-dead launch-asap)) (sp-item 1671 :flags (bit1 start-dead launch-asap)) (sp-item 1671 :flags (bit1 start-dead launch-asap)) @@ -140,8 +135,7 @@ ) (defpart 1672 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) @@ -159,8 +153,7 @@ ) (defpart 1671 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -0.44444445)) (sp-flt spt-y (meters 4.888889)) @@ -183,8 +176,7 @@ ) (defpart 1673 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.90000004)) (sp-int spt-rot-x 6) @@ -206,8 +198,7 @@ (defpartgroup group-sunken-heatpipe-239 :id 423 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1675 :fade-after (meters 80) :falloff-to (meters 80) :binding 1674) + :parts ((sp-item 1675 :fade-after (meters 80) :falloff-to (meters 80) :binding 1674) (sp-item 1674 :flags (bit1 start-dead launch-asap)) (sp-item 1674 :flags (bit1 start-dead launch-asap)) (sp-item 1674 :flags (bit1 start-dead launch-asap)) @@ -238,8 +229,7 @@ ) (defpart 1675 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) @@ -257,8 +247,7 @@ ) (defpart 1674 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -1.1111112)) (sp-flt spt-y (meters 4.888889)) @@ -281,8 +270,7 @@ ) (defpart 1676 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.90000004)) (sp-int spt-rot-x 6) @@ -304,8 +292,7 @@ (defpartgroup group-sunken-heatpipe-240 :id 424 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1678 :fade-after (meters 80) :falloff-to (meters 80) :binding 1677) + :parts ((sp-item 1678 :fade-after (meters 80) :falloff-to (meters 80) :binding 1677) (sp-item 1677 :flags (bit1 start-dead launch-asap)) (sp-item 1677 :flags (bit1 start-dead launch-asap)) (sp-item 1677 :flags (bit1 start-dead launch-asap)) @@ -336,8 +323,7 @@ ) (defpart 1678 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) @@ -355,8 +341,7 @@ ) (defpart 1677 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 4.888889)) @@ -379,8 +364,7 @@ ) (defpart 1679 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.90000004)) (sp-int spt-rot-x 6) @@ -402,8 +386,7 @@ (defpartgroup group-sunken-heatpipe-241 :id 425 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1681 :fade-after (meters 80) :falloff-to (meters 80) :binding 1680) + :parts ((sp-item 1681 :fade-after (meters 80) :falloff-to (meters 80) :binding 1680) (sp-item 1680 :flags (bit1 start-dead launch-asap)) (sp-item 1680 :flags (bit1 start-dead launch-asap)) (sp-item 1680 :flags (bit1 start-dead launch-asap)) @@ -434,8 +417,7 @@ ) (defpart 1681 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) @@ -453,8 +435,7 @@ ) (defpart 1680 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -0.6666667)) (sp-flt spt-y (meters 4.888889)) @@ -477,8 +458,7 @@ ) (defpart 1682 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.90000004)) (sp-int spt-rot-x 6) @@ -500,8 +480,7 @@ (defpartgroup group-sunken-heatpipe-242 :id 426 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1684 :fade-after (meters 80) :falloff-to (meters 80) :binding 1683) + :parts ((sp-item 1684 :fade-after (meters 80) :falloff-to (meters 80) :binding 1683) (sp-item 1683 :flags (bit1 start-dead launch-asap)) (sp-item 1683 :flags (bit1 start-dead launch-asap)) (sp-item 1683 :flags (bit1 start-dead launch-asap)) @@ -532,8 +511,7 @@ ) (defpart 1684 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) @@ -551,8 +529,7 @@ ) (defpart 1683 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 4.888889)) @@ -575,8 +552,7 @@ ) (defpart 1685 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.90000004)) (sp-int spt-rot-x 6) @@ -598,8 +574,7 @@ (defpartgroup group-sunken-heatpipe-243 :id 427 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1687 :fade-after (meters 80) :falloff-to (meters 80) :binding 1686) + :parts ((sp-item 1687 :fade-after (meters 80) :falloff-to (meters 80) :binding 1686) (sp-item 1686 :flags (bit1 start-dead launch-asap)) (sp-item 1686 :flags (bit1 start-dead launch-asap)) (sp-item 1686 :flags (bit1 start-dead launch-asap)) @@ -630,8 +605,7 @@ ) (defpart 1687 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.4)) @@ -649,8 +623,7 @@ ) (defpart 1686 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -2.4444444)) (sp-flt spt-y (meters 4.4444447)) @@ -673,8 +646,7 @@ ) (defpart 1688 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.70000005)) (sp-int spt-rot-x 6) @@ -696,8 +668,7 @@ (defpartgroup group-sunken-heatpipe-278 :id 428 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1690 :fade-after (meters 80) :falloff-to (meters 80) :binding 1689) + :parts ((sp-item 1690 :fade-after (meters 80) :falloff-to (meters 80) :binding 1689) (sp-item 1689 :flags (bit1 start-dead launch-asap)) (sp-item 1689 :flags (bit1 start-dead launch-asap)) (sp-item 1689 :flags (bit1 start-dead launch-asap)) @@ -728,8 +699,7 @@ ) (defpart 1690 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.4)) @@ -747,8 +717,7 @@ ) (defpart 1689 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -3.0222223)) (sp-flt spt-y (meters 4.6666665)) @@ -771,8 +740,7 @@ ) (defpart 1691 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.70000005)) (sp-int spt-rot-x 6) @@ -794,8 +762,7 @@ (defpartgroup group-sunken-heatpipe-251 :id 429 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1693 :fade-after (meters 80) :falloff-to (meters 80) :binding 1692) + :parts ((sp-item 1693 :fade-after (meters 80) :falloff-to (meters 80) :binding 1692) (sp-item 1692 :flags (bit1 start-dead launch-asap)) (sp-item 1692 :flags (bit1 start-dead launch-asap)) (sp-item 1692 :flags (bit1 start-dead launch-asap)) @@ -826,8 +793,7 @@ ) (defpart 1693 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.4)) @@ -845,8 +811,7 @@ ) (defpart 1692 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -2.1333334)) (sp-flt spt-y (meters 4.6666665)) @@ -869,8 +834,7 @@ ) (defpart 1694 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.70000005)) (sp-int spt-rot-x 6) @@ -892,8 +856,7 @@ (defpartgroup group-sunken-heatpipe-254 :id 430 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1696 :fade-after (meters 80) :falloff-to (meters 80) :binding 1695) + :parts ((sp-item 1696 :fade-after (meters 80) :falloff-to (meters 80) :binding 1695) (sp-item 1695 :flags (bit1 start-dead launch-asap)) (sp-item 1695 :flags (bit1 start-dead launch-asap)) (sp-item 1695 :flags (bit1 start-dead launch-asap)) @@ -924,8 +887,7 @@ ) (defpart 1696 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.4)) @@ -943,8 +905,7 @@ ) (defpart 1695 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -3.911111)) (sp-flt spt-y (meters 4.6666665)) @@ -967,8 +928,7 @@ ) (defpart 1697 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.70000005)) (sp-int spt-rot-x 6) @@ -990,8 +950,7 @@ (defpartgroup group-sunken-heatpipe-264 :id 431 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1699 :fade-after (meters 80) :falloff-to (meters 80) :binding 1698) + :parts ((sp-item 1699 :fade-after (meters 80) :falloff-to (meters 80) :binding 1698) (sp-item 1698 :flags (bit1 start-dead launch-asap)) (sp-item 1698 :flags (bit1 start-dead launch-asap)) (sp-item 1698 :flags (bit1 start-dead launch-asap)) @@ -1022,8 +981,7 @@ ) (defpart 1699 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.4)) @@ -1041,8 +999,7 @@ ) (defpart 1698 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -4.6666665)) (sp-flt spt-y (meters 4.6666665)) @@ -1065,8 +1022,7 @@ ) (defpart 1700 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.70000005)) (sp-int spt-rot-x 6) @@ -1088,8 +1044,7 @@ (defpartgroup group-sunken-heatpipe-265 :id 432 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1702 :fade-after (meters 80) :falloff-to (meters 80) :binding 1701) + :parts ((sp-item 1702 :fade-after (meters 80) :falloff-to (meters 80) :binding 1701) (sp-item 1701 :flags (bit1 start-dead launch-asap)) (sp-item 1701 :flags (bit1 start-dead launch-asap)) (sp-item 1701 :flags (bit1 start-dead launch-asap)) @@ -1120,8 +1075,7 @@ ) (defpart 1702 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.4)) @@ -1139,8 +1093,7 @@ ) (defpart 1701 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -5.3333335)) (sp-flt spt-y (meters 4.6666665)) @@ -1163,8 +1116,7 @@ ) (defpart 1703 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.70000005)) (sp-int spt-rot-x 6) @@ -1186,8 +1138,7 @@ (defpartgroup group-sunken-heatpipe-266 :id 433 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1705 :fade-after (meters 80) :falloff-to (meters 80) :binding 1704) + :parts ((sp-item 1705 :fade-after (meters 80) :falloff-to (meters 80) :binding 1704) (sp-item 1704 :flags (bit1 start-dead launch-asap)) (sp-item 1704 :flags (bit1 start-dead launch-asap)) (sp-item 1704 :flags (bit1 start-dead launch-asap)) @@ -1218,8 +1169,7 @@ ) (defpart 1705 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) @@ -1237,8 +1187,7 @@ ) (defpart 1704 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -6.4444447)) (sp-flt spt-y (meters 4.888889)) @@ -1261,8 +1210,7 @@ ) (defpart 1706 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.90000004)) (sp-int spt-rot-x 6) @@ -1284,8 +1232,7 @@ (defpartgroup group-sunken-heatpipe-267 :id 434 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1708 :fade-after (meters 80) :falloff-to (meters 80) :binding 1707) + :parts ((sp-item 1708 :fade-after (meters 80) :falloff-to (meters 80) :binding 1707) (sp-item 1707 :flags (bit1 start-dead launch-asap)) (sp-item 1707 :flags (bit1 start-dead launch-asap)) (sp-item 1707 :flags (bit1 start-dead launch-asap)) @@ -1316,8 +1263,7 @@ ) (defpart 1708 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.7)) @@ -1335,8 +1281,7 @@ ) (defpart 1707 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -7.7777777)) (sp-flt spt-y (meters 5.111111)) @@ -1359,8 +1304,7 @@ ) (defpart 1709 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 1)) (sp-int spt-rot-x 6) @@ -1382,8 +1326,7 @@ (defpartgroup group-sunken-heatpipe-268 :id 435 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1711 :fade-after (meters 80) :falloff-to (meters 80) :binding 1710) + :parts ((sp-item 1711 :fade-after (meters 80) :falloff-to (meters 80) :binding 1710) (sp-item 1710 :flags (bit1 start-dead launch-asap)) (sp-item 1710 :flags (bit1 start-dead launch-asap)) (sp-item 1710 :flags (bit1 start-dead launch-asap)) @@ -1414,8 +1357,7 @@ ) (defpart 1711 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.7)) @@ -1433,8 +1375,7 @@ ) (defpart 1710 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -9.333333)) (sp-flt spt-y (meters 4.6666665)) @@ -1457,8 +1398,7 @@ ) (defpart 1712 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 1)) (sp-int spt-rot-x 6) diff --git a/goal_src/levels/sunken/sunken-pipegame.gc b/goal_src/levels/sunken/sunken-pipegame.gc index 4fb587d031..3ac8c56d4a 100644 --- a/goal_src/levels/sunken/sunken-pipegame.gc +++ b/goal_src/levels/sunken/sunken-pipegame.gc @@ -67,13 +67,11 @@ :id 448 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1741) (sp-item 1742) (sp-item 1743) (sp-item 1744 :flags (is-3d))) + :parts ((sp-item 1741) (sp-item 1742) (sp-item 1743) (sp-item 1744 :flags (is-3d))) ) (defpart 1741 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 10.0) (sp-flt spt-y (meters 6)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -96,13 +94,11 @@ ) (defpart 1745 - :init-specs - ((sp-flt spt-fade-a 0.0)) + :init-specs ((sp-flt spt-fade-a 0.0)) ) (defpart 1742 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-y (meters 0) (meters 8) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -121,8 +117,7 @@ ) (defpart 1743 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 4)) (sp-rnd-flt spt-scale-x (meters 7) (meters 1) 1.0) @@ -138,8 +133,7 @@ ) (defpart 1744 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.3)) (sp-rnd-flt spt-scale-x (meters 5.5) (meters 2) 1.0) @@ -158,13 +152,11 @@ :id 449 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1746) (sp-item 1742) (sp-item 1747) (sp-item 1748 :flags (is-3d))) + :parts ((sp-item 1746) (sp-item 1742) (sp-item 1747) (sp-item 1748 :flags (is-3d))) ) (defpart 1746 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 10.0) (sp-flt spt-y (meters 6)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -187,8 +179,7 @@ ) (defpart 1747 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 4)) (sp-rnd-flt spt-scale-x (meters 7) (meters 1) 1.0) @@ -204,8 +195,7 @@ ) (defpart 1748 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.3)) (sp-rnd-flt spt-scale-x (meters 5.5) (meters 2) 1.0) @@ -224,13 +214,11 @@ :id 450 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1749) (sp-item 1742) (sp-item 1750) (sp-item 1751 :flags (is-3d))) + :parts ((sp-item 1749) (sp-item 1742) (sp-item 1750) (sp-item 1751 :flags (is-3d))) ) (defpart 1749 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 10.0) (sp-flt spt-y (meters 6)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -253,8 +241,7 @@ ) (defpart 1750 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 4)) (sp-rnd-flt spt-scale-x (meters 7) (meters 1) 1.0) @@ -270,8 +257,7 @@ ) (defpart 1751 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.3)) (sp-rnd-flt spt-scale-x (meters 5.5) (meters 2) 1.0) @@ -290,13 +276,11 @@ :id 451 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1752) (sp-item 1753) (sp-item 1754) (sp-item 1755 :flags (is-3d))) + :parts ((sp-item 1752) (sp-item 1753) (sp-item 1754) (sp-item 1755 :flags (is-3d))) ) (defpart 1752 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -319,13 +303,11 @@ ) (defpart 1756 - :init-specs - ((sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-a -1.4222223)) ) (defpart 1753 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-y (meters 0) (meters -8) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -344,8 +326,7 @@ ) (defpart 1754 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -3.5)) (sp-rnd-flt spt-scale-x (meters 3) (meters 0.5) 1.0) @@ -362,8 +343,7 @@ ) (defpart 1755 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.3)) (sp-rnd-flt spt-scale-x (meters 5.5) (meters 2) 1.0) @@ -382,13 +362,11 @@ :id 452 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1757) (sp-item 1753) (sp-item 1758) (sp-item 1759 :flags (is-3d))) + :parts ((sp-item 1757) (sp-item 1753) (sp-item 1758) (sp-item 1759 :flags (is-3d))) ) (defpart 1757 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -411,8 +389,7 @@ ) (defpart 1758 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -3.5)) (sp-rnd-flt spt-scale-x (meters 3) (meters 0.5) 1.0) @@ -429,8 +406,7 @@ ) (defpart 1759 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.3)) (sp-rnd-flt spt-scale-x (meters 5.5) (meters 2) 1.0) @@ -449,13 +425,11 @@ :id 453 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1760) (sp-item 1753) (sp-item 1761) (sp-item 1762 :flags (is-3d))) + :parts ((sp-item 1760) (sp-item 1753) (sp-item 1761) (sp-item 1762 :flags (is-3d))) ) (defpart 1760 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -478,8 +452,7 @@ ) (defpart 1761 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -3.5)) (sp-rnd-flt spt-scale-x (meters 3) (meters 0.5) 1.0) @@ -496,8 +469,7 @@ ) (defpart 1762 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.3)) (sp-rnd-flt spt-scale-x (meters 5.5) (meters 2) 1.0) @@ -513,7 +485,7 @@ ) (defbehavior sunken-pipegame-button-init-by-other sunken-pipegame-button ((arg0 vector) (arg1 quaternion) (arg2 entity-actor) (arg3 symbol)) - (basebutton-init-by-other (the-as basebutton #f) arg0 arg1 arg2 arg3 0.0) + (basebutton-init-by-other (the-as entity-actor #f) arg0 arg1 arg2 arg3 0.0) (none) ) @@ -533,8 +505,7 @@ ) (defstate sunken-pipegame-start-up (sunken-pipegame) - :code - (behavior () + :code (behavior () (suspend) (send-event (handle->process (-> self prize 0 actor-handle)) 'anim #f) (go sunken-pipegame-idle) @@ -543,8 +514,7 @@ ) (defstate sunken-pipegame-idle (sunken-pipegame) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (when (= (-> arg0 type) sunken-pipegame-button) @@ -554,9 +524,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) @@ -564,8 +533,7 @@ ) (defstate sunken-pipegame-begin-play (sunken-pipegame) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notify) (case (-> arg0 type) @@ -576,8 +544,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (dummy-21 self #f) (set! (-> self abort-audio-if-beaten?) #f) (dotimes (gp-0 3) @@ -589,8 +556,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (v1-112 symbol)) (let ((gp-0 (-> *display* base-frame-counter))) (if (not (handle->process (-> self prize (-> self challenge) actor-handle))) @@ -601,66 +567,15 @@ (cond ((zero? v1-10) (ambient-hint-spawn "gamcam27" (the-as vector #f) *entity-pool* 'camera) - (let ((s5-0 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-0 - (let ((t9-4 (method-of-type pov-camera activate))) - (t9-4 (the-as pov-camera s5-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "pipegame-left" - 0 - #f - '() - ) - (-> s5-0 ppointer) - ) - ) + (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "pipegame-left" 0 #f '() :to self) ) ((= v1-10 1) (ambient-hint-spawn "gamcam25" (the-as vector #f) *entity-pool* 'camera) - (let ((s5-1 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-1 - (let ((t9-8 (method-of-type pov-camera activate))) - (t9-8 (the-as pov-camera s5-1) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "pipegame-middle" - 0 - #f - '() - ) - (-> s5-1 ppointer) - ) - ) + (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "pipegame-middle" 0 #f '() :to self) ) ((= v1-10 2) (ambient-hint-spawn "gamcam26" (the-as vector #f) *entity-pool* 'camera) - (let ((s5-2 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-2 - (let ((t9-12 (method-of-type pov-camera activate))) - (t9-12 (the-as pov-camera s5-2) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-2 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "pipegame-right" - 0 - #f - '() - ) - (-> s5-2 ppointer) - ) - ) + (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "pipegame-right" 0 #f '() :to self) ) ) ) @@ -764,7 +679,7 @@ ) (until v1-112 (suspend) - (set! v1-112 (or (not *target*) (zero? (logand (-> *target* state-flags) 256)))) + (set! v1-112 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (sleep (-> self ticker) (-> self prize (-> self challenge) puzzle-delay)) @@ -898,8 +813,7 @@ ) (defstate sunken-pipegame-beat-challenge (sunken-pipegame) - :code - (behavior () + :code (behavior () (logior! (-> self challenges-mask) (ash 1 (-> self challenge))) (if (-> self abort-audio-if-beaten?) (kill-current-level-hint '(camera) '() 'exit) @@ -910,14 +824,13 @@ ) (defstate sunken-pipegame-end-play (sunken-pipegame) - :code - (behavior () + :code (behavior () (local-vars (v1-3 symbol)) (dummy-21 self #t) (set! (-> self abort-audio-if-beaten?) #f) (until v1-3 (suspend) - (set! v1-3 (or (not *target*) (zero? (logand (-> *target* state-flags) 256)))) + (set! v1-3 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) ) (if (not (handle->process (-> self prize (-> self challenge) actor-handle))) (logior! (-> self challenges-mask) (ash 1 (-> self challenge))) @@ -1122,17 +1035,7 @@ ) ) (vector+! s4-0 s4-0 (-> obj root trans)) - (let* ((s0-3 (get-process *default-dead-pool* sunken-pipegame-button #x4000)) - (v1-102 - (when s0-3 - (let ((t9-23 (method-of-type sunken-pipegame-button activate))) - (t9-23 (the-as sunken-pipegame-button s0-3) obj 'sunken-pipegame-button (the-as pointer #x70004000)) - ) - (run-now-in-process s0-3 sunken-pipegame-button-init-by-other s4-0 s3-0 arg0 s1-1) - (-> s0-3 ppointer) - ) - ) - ) + (let ((v1-102 (process-spawn sunken-pipegame-button s4-0 s3-0 arg0 s1-1 :to obj))) (set! (-> obj button s2-0) (the-as (pointer sunken-pipegame-button) v1-102)) (set! (-> (the-as (pointer sunken-pipegame-button) v1-102) 0 button-id) s2-0) ) diff --git a/goal_src/levels/sunken/sunken-water.gc b/goal_src/levels/sunken/sunken-water.gc index 61d8715d2a..8bb8022a5c 100644 --- a/goal_src/levels/sunken/sunken-water.gc +++ b/goal_src/levels/sunken/sunken-water.gc @@ -32,8 +32,7 @@ :count 3 :converted #f :normal-scale 1.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 40.0 :xdiv -1 :zdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75) @@ -46,13 +45,11 @@ :id 446 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1736 :fade-after (meters 50))) + :parts ((sp-item 1736 :fade-after (meters 50))) ) (defpart 1736 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 1) (meters 4) 1.0) @@ -72,8 +69,7 @@ ) (defpart 2022 - :init-specs - ((sp-flt spt-r 255.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) (sp-flt spt-b 0.0) (sp-flt spt-fade-a -1.28)) + :init-specs ((sp-flt spt-r 255.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) (sp-flt spt-b 0.0) (sp-flt spt-fade-a -1.28)) ) (defmethod draw-ripple sunken-water ((obj sunken-water)) @@ -84,14 +80,7 @@ ) (set! (-> gp-0 vertex-skip) 128) (dotimes (s5-0 (-> gp-0 vertex-count)) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 1736) - (-> gp-0 data s5-0) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles (-> *part-id-table* 1736) (-> gp-0 data s5-0)) ) ) #f @@ -99,12 +88,11 @@ (defstate water-vol-idle (sunken-water) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notify) (if (= (-> arg3 param 0) 'attack) - (sound-play-by-name (static-sound-name "get-shocked") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-shocked") ) ) (else @@ -112,8 +100,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (let ((t9-0 (-> (method-of-type water-anim water-vol-idle) trans))) (if t9-0 (t9-0) @@ -124,7 +111,7 @@ (cond ((< (get-current-phase (-> self sync)) (-> self deadly-time)) (when (!= (-> self deadly-fade) 1.0) - (set! (-> self deadly-fade) (seek (-> self deadly-fade) 1.0 (* 8.0 (-> *display* seconds-per-frame)))) + (seek! (-> self deadly-fade) 1.0 (* 8.0 (-> *display* seconds-per-frame))) (let ((f30-0 (-> self deadly-fade))) (vector-lerp! (-> self draw color-mult) (-> self safe-color-mult) (-> self deadly-color-mult) f30-0) (vector-lerp! @@ -135,21 +122,21 @@ ) (set! (-> self draw color-mult w) 0.5) (if (= f30-0 1.0) - (set! (-> self flags) (logior #x80000 (-> self flags))) + (set! (-> self flags) (logior (water-flags wt19) (-> self flags))) ) ) ) (draw-ripple self) (when (not (-> self playing-deadly-sound?)) (set! (-> self playing-deadly-sound?) #t) - (sound-play-by-name (static-sound-name "water-on") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-on") ) (update! (-> self sound)) ) (else - (set! (-> self flags) (logand -524289 (-> self flags))) + (logclear! (-> self flags) (water-flags wt19)) (when (!= (-> self deadly-fade) 0.0) - (set! (-> self deadly-fade) (seek (-> self deadly-fade) 0.0 (* 8.0 (-> *display* seconds-per-frame)))) + (seek! (-> self deadly-fade) 0.0 (* 8.0 (-> *display* seconds-per-frame))) (let ((f30-1 (-> self deadly-fade))) (vector-lerp! (-> self draw color-mult) (-> self safe-color-mult) (-> self deadly-color-mult) f30-1) (vector-lerp! @@ -160,14 +147,14 @@ ) (set! (-> self draw color-mult w) 0.5) (if (= f30-1 0.0) - (set! (-> self flags) (logand -524289 (-> self flags))) + (logclear! (-> self flags) (water-flags wt19)) ) ) ) (when (-> self playing-deadly-sound?) (set! (-> self playing-deadly-sound?) #f) (stop! (-> self sound)) - (sound-play-by-name (static-sound-name "water-off") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-off") ) ) ) @@ -180,7 +167,7 @@ ) ) (else - (when (logtest? #x80000 (-> self flags)) + (when (logtest? (water-flags wt19) (-> self flags)) (draw-ripple self) (update! (-> self sound)) (set! (-> self playing-deadly-sound?) #t) @@ -189,12 +176,10 @@ ) (none) ) - :post - (the-as (function none :behavior sunken-water) ja-post) + :post (the-as (function none :behavior sunken-water) ja-post) ) (defmethod TODO-RENAME-25 sunken-water ((obj sunken-water)) - (local-vars (v0-3 uint)) (let ((t9-0 (method-of-type water-anim TODO-RENAME-25))) (t9-0 obj) ) @@ -210,7 +195,7 @@ (s5-0 0.5 ) - ((logtest? #x80000 (-> obj flags)) + ((logtest? (water-flags wt19) (-> obj flags)) 1.0 ) (else @@ -222,28 +207,21 @@ (when (and s5-0 (or (= f0-16 0.0) (= f0-16 1.0))) (set! s5-0 #f) (if (= f0-16 0.0) - (set! (-> obj flags) (logior #x80000 (-> obj flags))) - (set! (-> obj flags) (logand -524289 (-> obj flags))) + (set! (-> obj flags) (logior (water-flags wt19) (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt19)) ) ) (set! (-> obj use-sync?) s5-0) (set! (-> obj deadly-time) f0-16) ) - (the-as object (when s5-0 - (cond - ((< (get-current-phase (-> obj sync)) (-> obj deadly-time)) - (set! v0-3 (logior (the-as uint #x80000) (-> obj flags))) - (set! (-> obj flags) v0-3) - ) - (else - (set! v0-3 (logand (the-as uint -524289) (-> obj flags))) - (set! (-> obj flags) v0-3) - ) - ) - v0-3 - ) - ) + (when s5-0 + (if (< (get-current-phase (-> obj sync)) (-> obj deadly-time)) + (set! (-> obj flags) (the-as water-flags (logior (water-flags wt19) (-> obj flags)))) + (set! (-> obj flags) (the-as water-flags (logclear (-> obj flags) (water-flags wt19)))) + ) + ) ) + (none) ) (defmethod TODO-RENAME-22 sunken-water ((obj sunken-water)) @@ -252,7 +230,7 @@ ) (set! (-> obj play-ambient-sound?) #f) (cond - ((logtest? #x80000 (-> obj flags)) + ((logtest? (water-flags wt19) (-> obj flags)) (set! (-> obj draw color-mult quad) (-> obj deadly-color-mult quad)) (set! (-> obj draw color-emissive quad) (-> obj deadly-color-emissive quad)) (set! (-> obj deadly-fade) 1.0) diff --git a/goal_src/levels/sunken/target-tube.gc b/goal_src/levels/sunken/target-tube.gc index 2db0cfb656..d3107005c1 100644 --- a/goal_src/levels/sunken/target-tube.gc +++ b/goal_src/levels/sunken/target-tube.gc @@ -61,7 +61,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x800 + :flags (surface-flags jump) ) ) @@ -110,7 +110,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :flags #x28 + :flags (surface-flags no-turn-around always-rotate-toward-transv) ) ) ) @@ -155,26 +155,23 @@ (define *TUBE-bank* (new 'static 'tube-bank)) (defbehavior tube-sounds target () - (set! (-> self tube tube-sound-vol) (seek - (-> self tube tube-sound-vol) - (if (logtest? (-> self control status) 1) - 100.0 - 0.0 - ) - (* 200.0 (-> *display* seconds-per-frame)) - ) + (seek! + (-> self tube tube-sound-vol) + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) + 100.0 + 0.0 ) + (* 200.0 (-> *display* seconds-per-frame)) + ) (let ((f30-0 (-> self tube tube-sound-vol)) (f0-5 (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 122880.0)) ) - (sound-play-by-name - (static-sound-name "slide-loop") - (-> self tube tube-sound-id) - (the int (* 10.24 f30-0)) - (the int (* 1524.0 f0-5)) - 0 - 1 - (the-as symbol (-> self control trans)) + (sound-play + "slide-loop" + :id (-> self tube tube-sound-id) + :vol f30-0 + :pitch f0-5 + :position (the-as symbol (-> self control trans)) ) ) ) @@ -185,7 +182,7 @@ (vector-flatten! s4-1 s4-1 (-> self control local-normal)) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s4-1 (meters 0.00024414062) @@ -197,7 +194,7 @@ (vector-normalize! s4-1 (-> self control unknown-surface01 target-speed)) ) (vector-v++! (-> self control unknown-vector00) s4-1) - (when (logtest? (-> self control status) 8) + (when (logtest? (-> self control status) (cshape-moving-flags twall)) (let ((s3-0 (-> self tube old-transv))) (-> self control unknown-vector00 y) (vector-reflect! s4-1 s3-0 (-> self control unknown-vector71)) @@ -253,7 +250,7 @@ (vector-flatten! s3-1 s3-1 (-> self control local-normal)) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s3-1 (meters 2.0) @@ -266,7 +263,7 @@ (vector-flatten! s4-2 s4-2 (-> self control local-normal)) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s4-2 (meters 2.0) @@ -303,7 +300,7 @@ (vector-float*! gp-1 gp-1 0.5) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) gp-1 (meters 0.00024414062) @@ -312,7 +309,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "ltransv" @@ -323,7 +320,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "nose" @@ -343,7 +340,7 @@ (set! (-> self tube old-transv quad) (-> self control transv quad)) (flag-setup) (build-conversions (-> self control transv)) - (if (logtest? (-> self state-flags) 32) + (if (logtest? (-> self state-flags) (state-flags timed-invulnerable)) (set! (-> self control unknown-surface01 turnv) (* 3.0 (-> self control unknown-surface01 turnv))) ) (forward-up-nopitch->quaternion @@ -428,8 +425,7 @@ ) (defstate target-tube-start (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) 'tube @@ -464,8 +460,7 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (when (not (or (= (-> self next-state name) 'target-tube) (= (-> self next-state name) 'target-tube-jump) (= (-> self next-state name) 'target-tube-hit) @@ -491,8 +486,7 @@ ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (send-event *camera* 'set-slave-option #x6000) (target-exit) (set! *display-profile* #f) @@ -516,33 +510,35 @@ (set! (-> self control unknown-float01) 0.0) (logior! (-> self control root-prim prim-core action) (collide-action ca-13)) (remove-exit) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 4) - (set! (-> a1-4 message) 'update) - (set! (-> a1-4 param 0) (the-as uint (-> self tube centertube))) - (set! (-> a1-4 param 1) (the-as uint (-> self tube downtube))) - (set! (-> a1-4 param 2) (the-as uint (-> self tube sidetube))) - (set! (-> a1-4 param 3) (the-as uint (-> self tube foretube))) - (cond - ((< (the-as float (send-event-function (handle->process (-> self tube tube)) a1-4)) 0.5) - (vector-normalize-copy! (-> self control transv) (-> self tube downtube) 40960.0) - (forward-up-nopitch->quaternion - (-> self control dir-targ) - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) - (-> self control dynam gravity-normal) - ) - (go target-tube-jump (-> *TARGET-bank* tube-jump-height-min) (-> *TARGET-bank* tube-jump-height-max)) - ) - (else - (go target-tube) + (cond + ((< (the-as + float + (send-event + (handle->process (-> self tube tube)) + 'update + (-> self tube centertube) + (-> self tube downtube) + (-> self tube sidetube) + (-> self tube foretube) + ) + ) + 0.5 ) + (vector-normalize-copy! (-> self control transv) (-> self tube downtube) 40960.0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + (-> self control dynam gravity-normal) + ) + (go target-tube-jump (-> *TARGET-bank* tube-jump-height-min) (-> *TARGET-bank* tube-jump-height-max)) + ) + (else + (go target-tube) ) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defbehavior target-tube-turn-anim target () @@ -591,31 +587,20 @@ ) (set-time-ratios *display* (the float gp-0)) ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 105)) - num-func-identity - ) - (set! (-> gp-1 frame-num) (ja-aframe (-> self tube turn-anim-frame) 0)) - ) + (ja :group! (-> self draw art-group data 105) :num! (identity (ja-aframe (-> self tube turn-anim-frame) 0))) 0 (none) ) (defstate target-tube (target) - :event - (-> target-tube-start event) - :enter - (behavior () + :event (-> target-tube-start event) + :enter (behavior () (set! (-> self control unknown-surface00) *tube-mods*) (set! (-> self control surf) *tube-surface*) (none) ) - :exit - (-> target-tube-start exit) - :trans - (behavior () + :exit (-> target-tube-start exit) + :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) ) @@ -629,89 +614,59 @@ ) (none) ) - :code - (behavior () - (case (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + :code (behavior () + (case (ja-group) (((-> self draw art-group data 41) (-> self draw art-group data 38)) - (ja-channel-push! 1 12) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 106))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 106)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 106)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! (-> self draw art-group data 106) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self tube turn-anim-frame) 0.0) ) (else - (ja-channel-push! 1 12) + (ja-channel-push! 1 (seconds 0.04)) ) ) - (while #t + (loop (set! (-> self tube turn-anim-targ) (* 20.0 (-> self tube mod-x))) (target-tube-turn-anim) (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (target-tube-post) (none) ) ) (defstate target-tube-jump (target) - :event - (-> target-tube-start event) - :enter - (behavior ((arg0 float) (arg1 float)) + :event (-> target-tube-start event) + :enter (behavior ((arg0 float) (arg1 float)) (set! (-> self state-time) (-> *display* base-frame-counter)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *tube-jump-mods*) (none) ) - :exit - (-> target-tube-start exit) - :trans - (behavior () - (if (logtest? (-> self control status) 1) + :exit (-> target-tube-start exit) + :trans (behavior () + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-tube) ) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) - (set! (-> self control unknown-float122) - (seek - (-> self control unknown-float122) - (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) - ) - ) + (seek! + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (ja-channel-push! 1 15) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 41)) - num-func-identity - ) - (set! (-> gp-0 frame-num) (ja-aframe 16.0 0)) - ) + :code (behavior ((arg0 float) (arg1 float)) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 41) :num! (identity (ja-aframe 16.0 0))) (let ((f30-0 35.0) (f28-0 1.0) ) @@ -734,35 +689,19 @@ (suspend) ) ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-9 param 0) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-loop!) - ) - (while #t + (ja-no-eval :group! (-> self draw art-group data 38) :num! (loop!) :frame-num 0.0) + (loop (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-10 param 0) 1.0) - (joint-control-channel-group-eval! - a0-10 - (the-as art-joint-anim (-> self draw art-group data 38)) - num-func-loop! - ) - ) + (ja :group! (-> self draw art-group data 38) :num! (loop!)) ) (none) ) - :post - (-> target-tube post) + :post (-> target-tube post) ) (defstate target-tube-hit (target) - :event - (-> target-tube-start event) - :enter - (behavior ((arg0 handle) (arg1 attack-info)) + :event (-> target-tube-start event) + :enter (behavior ((arg0 symbol) (arg1 attack-info)) (send-event (handle->process (-> self tube tube)) 'update @@ -773,22 +712,20 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (if (!= (-> self next-state name) 'target-tube-death) - (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags being-attacked dying)) ) - (set! (-> self state-flags) (logand -901 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags sf02 do-not-notice grabbed first-person-mode)) ((-> target-tube-start exit)) (none) ) - :code - (behavior ((arg0 handle) (arg1 attack-info)) + :code (behavior ((arg0 symbol) (arg1 attack-info)) (let ((gp-0 (-> self attack-info))) (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self state-flags) 8) + (logior! (-> self state-flags) (state-flags being-attacked)) (set! (-> self game hit-time) (-> *display* base-frame-counter)) - (when (zero? (logand (-> arg1 mask) 2)) + (when (zero? (logand (-> arg1 mask) (attack-mask vector))) (vector-! (-> arg1 vector) (vector+float*! (new 'stack-no-clear 'vector) (-> self tube foretube) (-> self tube downtube) 20480.0) @@ -812,11 +749,14 @@ ) ) ) - (logior! (-> arg1 mask) 2) + (logior! (-> arg1 mask) (attack-mask vector)) ) - (when (and (logtest? (-> arg1 mask) 32) (= (-> arg1 mode) 'darkeco) (zero? (logand (-> arg1 mask) 128))) + (when (and (logtest? (-> arg1 mask) (attack-mask mode)) + (= (-> arg1 mode) 'darkeco) + (zero? (logand (-> arg1 mask) (attack-mask shove-up))) + ) (set! (-> arg1 shove-up) 12288.0) - (logior! (-> arg1 mask) 128) + (logior! (-> arg1 mask) (attack-mask shove-up)) ) (let ((v1-30 gp-0)) (set! (-> v1-30 attacker) (the-as handle #f)) @@ -872,53 +812,39 @@ (go target-tube) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) (defstate target-tube-death (target) - :event - (-> target-death event) - :exit - (behavior () - (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + :event (-> target-death event) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags being-attacked dying)) (target-exit) - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (copy-settings-from-target! *setting-control*) + (remove-setting! 'process-mask) + (apply-settings *setting-control*) ((-> target-tube-start exit)) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (local-vars (v1-40 symbol)) (set! (-> self neck flex-blend) 0.0) (target-timed-invulnerable-off self) - (push-setting! *setting-control* self 'process-mask 'set 0.0 #x14a0000) - (copy-settings-from-target! *setting-control*) + (add-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) + (apply-settings *setting-control*) (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self control unknown-surface00) *neutral-mods*) - (ja-channel-push! 1 30) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 76))) - (set! (-> gp-1 param 0) (ja-aframe 134.0 0)) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) 0.0) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 76)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 76) :num! (seek! (ja-aframe 134.0 0)) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (let ((gp-2 (new 'stack-no-clear 'vector))) - (when (zero? (logand (-> self align flags) 1)) + (when (zero? (logand (-> self align flags) (align-flags disabled))) (vector-matrix*! gp-2 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (vector-float*! (-> self control transv) gp-2 (-> *display* frames-per-second)) ) ) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 134.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 134.0 0))) ) (set! (-> self control transv quad) (the-as uint128 0)) (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) @@ -930,8 +856,7 @@ (go target-tube) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) (deftype slide-control (process-drawable) @@ -1001,16 +926,14 @@ (defstate slide-control-watch (slide-control) :virtual #t - :enter - (behavior () + :enter (behavior () (eval-path-curve-div! (-> self path) (-> self trans) 0.2 'interp) (eval-path-curve-div! (-> self path) (-> self root trans) 0.2 'interp) (TODO-RENAME-12 (-> self path) (-> self rot) 0.2) (set! (-> self pos) 0.2) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (and *target* (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (and (< 0.0 (vector-dot (vector-! (new 'stack-no-clear 'vector) (-> *target* control trans) (-> self trans)) @@ -1024,14 +947,12 @@ ) (none) ) - :code - (the-as (function none :behavior slide-control) anim-loop) + :code (the-as (function none :behavior slide-control) anim-loop) ) (defstate slide-control-ride (slide-control) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('end-mode) (go-virtual slide-control-watch) @@ -1058,21 +979,18 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self pos) 0.0) (set! (-> self target) (process->handle *target*)) (process-entity-status! self (entity-perm-status bit-3) #t) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self target) (the-as handle #f)) (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :trans - (behavior () + :trans (behavior () (let ((gp-0 (handle->process (-> self target)))) (cond ((if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) @@ -1086,8 +1004,7 @@ ) (none) ) - :code - (the-as (function none :behavior slide-control) anim-loop) + :code (the-as (function none :behavior slide-control) anim-loop) ) (defmethod init-from-entity! slide-control ((obj slide-control) (arg0 entity-actor)) diff --git a/goal_src/levels/sunken/wall-plat.gc b/goal_src/levels/sunken/wall-plat.gc index 66a9bba8c0..01f1a9e413 100644 --- a/goal_src/levels/sunken/wall-plat.gc +++ b/goal_src/levels/sunken/wall-plat.gc @@ -9,6 +9,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/wall-plat-ag.gc") + (deftype wall-plat (process-drawable) ((root-override collide-shape-moving :offset 112) (use-sync? symbol :offset-assert 176) @@ -31,30 +33,25 @@ ) -(defskelgroup *wall-plat-sg* wall-plat - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 1 -2 0 6.5) - :longest-edge (meters 0) - ) +(defskelgroup *wall-plat-sg* wall-plat wall-plat-lod0-jg -1 + ((wall-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 1 -2 0 6.5) + ) (defstate wall-plat-retracted (wall-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go wall-plat-extending) ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self extended-amount) 0.0) (move-to-point! (-> self root-override) (-> self in-trans)) (transform-post) (clear-collide-with-as (-> self root-override)) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -63,29 +60,25 @@ ) (defstate wall-plat-extending (wall-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) #f ) ) ) ) - :enter - (behavior () - (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) + :enter (behavior () + (sound-play "wall-plat") (none) ) - :trans - (the-as (function none :behavior wall-plat) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior wall-plat) rider-trans) + :code (behavior () (restore-collide-with-as (-> self root-override)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t - (set! (-> self extended-amount) (seek (-> self extended-amount) 1.0 (* 2.5 (-> *display* seconds-per-frame)))) + (loop + (seek! (-> self extended-amount) 1.0 (* 2.5 (-> *display* seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) (move-to-point! (-> self root-override) gp-0) @@ -97,25 +90,22 @@ ) (none) ) - :post - (the-as (function none :behavior wall-plat) rider-post) + :post (the-as (function none :behavior wall-plat) rider-post) ) (defstate wall-plat-extended (wall-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('untrigger) (go wall-plat-retracting) ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self extended-amount) 1.0) (move-to-point! (-> self root-override) (-> self out-trans)) (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -124,28 +114,24 @@ ) (defstate wall-plat-retracting (wall-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) #f ) ) ) ) - :enter - (behavior () - (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) + :enter (behavior () + (sound-play "wall-plat") (none) ) - :trans - (the-as (function none :behavior wall-plat) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior wall-plat) rider-trans) + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t - (set! (-> self extended-amount) (seek (-> self extended-amount) 0.0 (* 2.5 (-> *display* seconds-per-frame)))) + (loop + (seek! (-> self extended-amount) 0.0 (* 2.5 (-> *display* seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) (move-to-point! (-> self root-override) gp-0) @@ -157,37 +143,31 @@ ) (none) ) - :post - (the-as (function none :behavior wall-plat) rider-post) + :post (the-as (function none :behavior wall-plat) rider-post) ) (defstate wall-plat-sync-idle (wall-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) #f ) ) ) ) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (the-as (function none :behavior wall-plat) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior wall-plat) rider-trans) + :code (behavior () (let ((gp-0 #f)) - (while #t + (loop (let ((f30-0 (get-current-phase-with-mirror (-> self sync)))) (let ((s5-0 (new 'stack-no-clear 'vector))) (vector-lerp! s5-0 (-> self in-trans) (-> self out-trans) f30-0) @@ -204,7 +184,7 @@ ) (else (when (not gp-0) - (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) + (sound-play "wall-plat") (set! gp-0 #t) ) (restore-collide-with-as (-> self root-override)) @@ -216,8 +196,7 @@ ) (none) ) - :post - (the-as (function none :behavior wall-plat) rider-post) + :post (the-as (function none :behavior wall-plat) rider-post) ) (defmethod init-from-entity! wall-plat ((obj wall-plat) (arg0 entity-actor)) diff --git a/goal_src/levels/sunken/wedge-plats.gc b/goal_src/levels/sunken/wedge-plats.gc index 72e7f5aeb7..625e27a6b8 100644 --- a/goal_src/levels/sunken/wedge-plats.gc +++ b/goal_src/levels/sunken/wedge-plats.gc @@ -11,6 +11,9 @@ ;; DECOMP BEGINS +(import "goal_src/import/wedge-plat-outer-ag.gc") +(import "goal_src/import/wedge-plat-ag.gc") + (deftype wedge-plat-master (process) ((center vector :inline :offset-assert 112) (rotspeed float :offset-assert 128) @@ -28,9 +31,8 @@ (defstate wedge-plat-master-idle (wedge-plat-master) - :code - (behavior () - (while #t + :code (behavior () + (loop (set! (-> self rotate-inner) (the float (sar (shl (the int (+ (-> self rotate-inner) (* (-> self rotspeed) (-> *display* seconds-per-frame)))) 48) 48) @@ -78,13 +80,10 @@ ) -(defskelgroup *wedge-plat-sg* wedge-plat - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *wedge-plat-sg* wedge-plat wedge-plat-lod0-jg wedge-plat-idle-ja + ((wedge-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) (defmethod dummy-27 wedge-plat ((obj wedge-plat)) (let* ((a0-1 (-> obj master)) @@ -121,8 +120,7 @@ ) (defstate wedge-plat-idle (wedge-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'bonk) (dummy-22 self) @@ -130,15 +128,10 @@ ) ) ) - :trans - (the-as (function none :behavior wedge-plat) plat-trans) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 num-func) num-func-identity) - (set! (-> gp-0 frame-num) (ja-aframe 0.0 0)) - ) - (while #t + :trans (the-as (function none :behavior wedge-plat) plat-trans) + :code (behavior () + (ja :num-func num-func-identity :frame-num (ja-aframe 0.0 0)) + (loop (if (dummy-27 self) (go wedge-plat-tip) ) @@ -146,92 +139,63 @@ ) (none) ) - :post - (the-as (function none :behavior wedge-plat) plat-post) + :post (the-as (function none :behavior wedge-plat) plat-post) ) (defstate wedge-plat-tip (wedge-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'bonk) (dummy-22 self) ) ((= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) #f ) ) ) ) ) - :trans - (the-as (function none :behavior wedge-plat) plat-trans) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-0 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 0.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :trans (the-as (function none :behavior wedge-plat) plat-trans) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (ja-aframe 60.0 0)) + :frame-num (ja-aframe 0.0 0) + ) (until (ja-done? 0) (dummy-27 self) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-2 param 0) (ja-aframe 100.0 0)) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) (ja-aframe 60.0 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) + (ja :num! (seek! (ja-aframe 60.0 0))) ) + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (ja-aframe 100.0 0)) + :frame-num (ja-aframe 60.0 0) + ) (until (ja-done? 0) (dummy-27 self) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 100.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 100.0 0))) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 num-func) num-func-identity) - (set! (-> gp-4 frame-num) (ja-aframe 100.0 0)) - ) + (ja :num-func num-func-identity :frame-num (ja-aframe 100.0 0)) (dummy-27 self) (suspend) ) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-5 param 0) (ja-aframe 153.0 0)) - (set! (-> gp-5 param 1) 1.0) - (set! (-> gp-5 frame-num) (ja-aframe 100.0 0)) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (ja-aframe 153.0 0)) + :frame-num (ja-aframe 100.0 0) + ) (until (ja-done? 0) (dummy-27 self) (suspend) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 param 0) (ja-aframe 153.0 0)) - (set! (-> gp-6 param 1) 1.0) - (joint-control-channel-group-eval! gp-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 153.0 0))) ) (go wedge-plat-idle) (none) ) - :post - (the-as (function none :behavior wedge-plat) plat-post) + :post (the-as (function none :behavior wedge-plat) plat-post) ) (defmethod init-from-entity! wedge-plat ((obj wedge-plat) (arg0 entity-actor)) @@ -282,13 +246,10 @@ ) -(defskelgroup *wedge-plat-outer-sg* wedge-plat-outer - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *wedge-plat-outer-sg* wedge-plat-outer wedge-plat-outer-lod0-jg wedge-plat-outer-idle-ja + ((wedge-plat-outer-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) (defmethod dummy-27 wedge-plat-outer ((obj wedge-plat-outer)) (let* ((a0-1 (-> obj master)) @@ -325,8 +286,7 @@ ) (defstate wedge-plat-outer-idle (wedge-plat-outer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'bonk) (dummy-22 self) @@ -334,15 +294,10 @@ ) ) ) - :trans - (the-as (function none :behavior wedge-plat-outer) plat-trans) - :code - (behavior () - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 num-func) num-func-identity) - (set! (-> gp-0 frame-num) (ja-aframe 0.0 0)) - ) + :trans (the-as (function none :behavior wedge-plat-outer) plat-trans) + :code (behavior () + (loop + (ja :num-func num-func-identity :frame-num (ja-aframe 0.0 0)) (if (dummy-27 self) (go wedge-plat-outer-tip) ) @@ -350,91 +305,62 @@ ) (none) ) - :post - (the-as (function none :behavior wedge-plat-outer) plat-post) + :post (the-as (function none :behavior wedge-plat-outer) plat-post) ) (defstate wedge-plat-outer-tip (wedge-plat-outer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'bonk) (dummy-22 self) ) ((= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) ) ) ) ) ) - :trans - (the-as (function none :behavior wedge-plat-outer) plat-trans) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-0 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 0.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :trans (the-as (function none :behavior wedge-plat-outer) plat-trans) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (ja-aframe 60.0 0)) + :frame-num (ja-aframe 0.0 0) + ) (until (ja-done? 0) (dummy-27 self) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-2 param 0) (ja-aframe 100.0 0)) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) (ja-aframe 60.0 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) + (ja :num! (seek! (ja-aframe 60.0 0))) ) + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (ja-aframe 100.0 0)) + :frame-num (ja-aframe 60.0 0) + ) (until (ja-done? 0) (dummy-27 self) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 100.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 100.0 0))) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 num-func) num-func-identity) - (set! (-> gp-4 frame-num) (ja-aframe 100.0 0)) - ) + (ja :num-func num-func-identity :frame-num (ja-aframe 100.0 0)) (dummy-27 self) (suspend) ) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-5 param 0) (ja-aframe 153.0 0)) - (set! (-> gp-5 param 1) 1.0) - (set! (-> gp-5 frame-num) (ja-aframe 100.0 0)) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (ja-aframe 153.0 0)) + :frame-num (ja-aframe 100.0 0) + ) (until (ja-done? 0) (dummy-27 self) (suspend) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 param 0) (ja-aframe 153.0 0)) - (set! (-> gp-6 param 1) 1.0) - (joint-control-channel-group-eval! gp-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 153.0 0))) ) (go wedge-plat-outer-idle) (none) ) - :post - (the-as (function none :behavior wedge-plat-outer) plat-post) + :post (the-as (function none :behavior wedge-plat-outer) plat-post) ) (defmethod init-from-entity! wedge-plat-outer ((obj wedge-plat-outer) (arg0 entity-actor)) diff --git a/goal_src/levels/sunken/whirlpool.gc b/goal_src/levels/sunken/whirlpool.gc index c3f94805f9..171c19a553 100644 --- a/goal_src/levels/sunken/whirlpool.gc +++ b/goal_src/levels/sunken/whirlpool.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/whirlpool-ag.gc") + (deftype whirlpool (process-drawable) ((root-override collide-shape :offset 112) (spin-ry float :offset-assert 176) @@ -19,7 +21,7 @@ :size-assert #xcc :flag-assert #x15006000cc (:methods - (dummy-20 (_type_ float) uint 20) + (dummy-20 (_type_ float) cshape-moving-flags 20) ) (:states whirlpool-idle @@ -27,20 +29,16 @@ ) -(defskelgroup *whirlpool-sg* whirlpool - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0.6 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *whirlpool-sg* whirlpool whirlpool-lod0-jg whirlpool-idle-ja + ((whirlpool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0.6 0 3) + ) (defpartgroup group-whirlpool-swirl :id 447 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1739 :fade-after (meters 60) :falloff-to (meters 60) :binding 1737) + :parts ((sp-item 1739 :fade-after (meters 60) :falloff-to (meters 60) :binding 1737) (sp-item 1737 :flags (bit1 start-dead launch-asap) :binding 1738) (sp-item 1737 :flags (bit1 start-dead launch-asap) :binding 1738) (sp-item 1737 :flags (bit1 start-dead launch-asap) :binding 1738) @@ -231,8 +229,7 @@ ) (defpart 1739 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 6.6)) (sp-flt spt-scale-x (meters 0.2)) @@ -246,8 +243,7 @@ ) (defpart 1737 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 0)) @@ -272,13 +268,11 @@ ) (defpart 1740 - :init-specs - ((sp-flt spt-fade-a 0.0)) + :init-specs ((sp-flt spt-fade-a 0.0)) ) (defpart 1738 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -325,8 +319,7 @@ ) (defstate whirlpool-idle (whirlpool) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (+ (* (get-current-phase-with-mirror (-> self sync)) (-> self spin-speed-delta)) (-> self spin-speed-idle)) ) @@ -340,7 +333,7 @@ ) (+! (-> self spin-ry) (* f30-0 (-> *display* seconds-per-frame))) (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (-> self spin-ry)) - (if (and *target* (logtest? (-> *target* water flags) 512)) + (if (and *target* (logtest? (-> *target* water flags) (water-flags wt09))) (dummy-20 self f30-0) ) (update! (-> self sound)) @@ -350,10 +343,8 @@ ) (none) ) - :code - (the-as (function none :behavior whirlpool) anim-loop) - :post - (the-as (function none :behavior whirlpool) ja-post) + :code (the-as (function none :behavior whirlpool) anim-loop) + :post (the-as (function none :behavior whirlpool) ja-post) ) (defmethod deactivate whirlpool ((obj whirlpool)) @@ -397,19 +388,8 @@ (set! (-> obj spin-speed-delta) (- f28-0 f30-0)) ) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 447) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "whirlpool") - :volume #x400 - :fo-max 55 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "whirlpool" :fo-max 55) (-> obj root-override trans)) ) (ja-channel-set! 1) (let ((s5-1 (-> obj skel root-channel 0))) diff --git a/goal_src/levels/swamp/billy.gc b/goal_src/levels/swamp/billy.gc index 6fce71ad4c..15156e13cb 100644 --- a/goal_src/levels/swamp/billy.gc +++ b/goal_src/levels/swamp/billy.gc @@ -9,6 +9,10 @@ ;; DECOMP BEGINS +(import "goal_src/import/farthy-snack-ag.gc") +(import "goal_src/import/billy-ag.gc") +(import "goal_src/import/billy-sidekick-ag.gc") + (deftype billy (process-taskable) ((child-override (pointer billy-snack) :offset 20) (farthy handle :offset-assert 384) @@ -63,115 +67,47 @@ ) -(defskelgroup *farthy-snack-sg* farthy-snack - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *farthy-snack-sg* farthy-snack farthy-snack-lod0-jg farthy-snack-idle-ja + ((farthy-snack-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defstate billy-snack-eat (billy-snack) - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-3 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! - a0-3 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja :group! farthy-snack-eat-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (deactivate self) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior billy-snack) ja-post) + :post (the-as (function none :behavior billy-snack) ja-post) ) (defstate billy-snack-idle (billy-snack) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('eat) (go billy-snack-eat) ) ) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior billy-snack) ja-post) + :post (the-as (function none :behavior billy-snack) ja-post) ) (defbehavior billy-snack-init-by-other billy-snack ((arg0 vector)) @@ -206,19 +142,16 @@ (defstate nav-enemy-idle (billy-rat) :virtual #t - :enter - (behavior () + :enter (behavior () (go-virtual nav-enemy-chase) (none) ) - :post - (the-as (function none :behavior billy-rat) nav-enemy-common-post) + :post (the-as (function none :behavior billy-rat) nav-enemy-common-post) ) (defstate nav-enemy-die (billy-rat) :virtual #t - :code - (behavior () + :code (behavior () (nav-enemy-fall-and-play-death-anim (the-as art-joint-anim (-> self draw art-group data (-> self nav-info die-anim))) 1.0 @@ -233,100 +166,45 @@ ) (defstate billy-rat-eat (billy-rat) - :trans - (behavior () + :trans (behavior () (seek-to-point-toward-point! (-> self collide-info) (-> self destination) 131072.0 (seconds 0.01)) (none) ) - :code - (behavior () + :code (behavior () (send-event (handle->process (-> self snack)) 'eat) - (sound-play-by-name (static-sound-name "rat-gulp") (new-sound-id) 1024 0 0 1 #t) - (ja-channel-push! 1 15) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-9 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! - a0-9 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (sound-play "rat-gulp") + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 12)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) - (logclear! (-> self nav flags) (nav-control-flags bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) (go-virtual nav-enemy-chase) (none) ) - :post - (the-as (function none :behavior billy-rat) nav-enemy-simple-post) + :post (the-as (function none :behavior billy-rat) nav-enemy-simple-post) ) (defstate billy-rat-salivate (billy-rat) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior billy-rat) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (dotimes (gp-0 1) - (sound-play-by-name (static-sound-name "rat-eat") (new-sound-id) 1024 0 0 1 #t) + (sound-play "rat-eat") (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - ) - (set! (-> a0-3 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) data 0 length) - -1 - ) - ) - ) - (set! (-> a0-3 param 1) f30-0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! - a0-3 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info victory-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) f30-0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -337,21 +215,19 @@ ) (none) ) - :post - (the-as (function none :behavior billy-rat) nav-enemy-simple-post) + :post (the-as (function none :behavior billy-rat) nav-enemy-simple-post) ) (defstate nav-enemy-victory (billy-rat) :virtual #t - :enter - (behavior () + :enter (behavior () (let ((t9-1 (-> (the-as (state nav-enemy) (find-parent-method billy-rat 33)) enter))) (if t9-1 (t9-1) ) ) - (when (logtest? (nav-control-flags bit19) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit19)) + (when (logtest? (nav-control-flags navcf19) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) (if (rat-about-to-eat? self (-> self billy 0)) (go billy-rat-salivate) (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) @@ -363,8 +239,7 @@ (defstate nav-enemy-stare (billy-rat) :virtual #t - :enter - (behavior () + :enter (behavior () (go-virtual nav-enemy-chase) (none) ) @@ -372,18 +247,16 @@ (defstate nav-enemy-chase (billy-rat) :virtual #t - :trans - (behavior () + :trans (behavior () (set! (-> self speed-scale) (-> self billy 0 rat-speed)) - (if (or (logtest? (nav-control-flags bit19) (-> self nav flags)) + (if (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self chase-rest-time)) ) (go-virtual nav-enemy-victory) ) (none) ) - :post - (behavior () + :post (behavior () (swamp-rat-update-wiggle-target (-> self destination)) (nav-enemy-travel-post) (none) @@ -403,22 +276,17 @@ (none) ) -(defskelgroup *billy-sg* billy - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 1) - :shadow 2 - ) +(defskelgroup *billy-sg* billy billy-lod0-jg billy-idle-breath-ja + ((billy-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :longest-edge (meters 1) + :shadow billy-shadow-mg + ) -(defskelgroup *billy-sidekick-sg* billy-sidekick - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *billy-sidekick-sg* billy-sidekick billy-sidekick-lod0-jg billy-sidekick-idle-ja + ((billy-sidekick-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defbehavior billy-kill-all-but-farthy billy () (let* ((gp-0 (the-as (pointer process-tree) (-> self child-override))) @@ -446,15 +314,7 @@ (eval-path-curve-div! (-> obj path-snacks) s5-1 (the float s4-0) 'exact) (set! (-> s5-1 x) (+ -40960.0 (-> s5-1 x))) (set! (-> s5-1 z) (+ 20480.0 (-> s5-1 z))) - (let ((s3-0 (get-process *default-dead-pool* manipy #x4000))) - (when s3-0 - (let ((t9-4 (method-of-type manipy activate))) - (t9-4 (the-as manipy s3-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 manipy-init s5-1 (-> obj entity) *farthy-snack-sg* #f) - (-> s3-0 ppointer) - ) - ) + (manipy-spawn s5-1 (-> obj entity) *farthy-snack-sg* #f :to obj) ) ) ) @@ -462,8 +322,7 @@ :name "billy-introduction" :index 5 :parts 14 - :command-list - '((0 kill "swamp-blimp-3") + :command-list '((0 kill "swamp-blimp-3") (0 kill "swamp-tetherrock-14") (0 kill "swamp-tetherrock-15") (0 kill "flutflut-3") @@ -504,8 +363,7 @@ :name "billy-reminder-1" :index 8 :parts 2 - :command-list - '((0 kill "swamp-blimp-3") + :command-list '((0 kill "swamp-blimp-3") (0 kill "swamp-tetherrock-14") (0 kill "swamp-tetherrock-15") (0 kill "flutflut-3") @@ -539,8 +397,7 @@ :name "billy-resolution" :index 9 :parts 2 - :command-list - '((0 kill "swamp-blimp-3") + :command-list '((0 kill "swamp-blimp-3") (0 kill "swamp-tetherrock-14") (0 kill "swamp-tetherrock-15") (0 kill "flutflut-3") @@ -617,8 +474,7 @@ ) (defstate billy-done (billy) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'billy-rat-needs-destination) (let* ((gp-0 arg0) @@ -636,8 +492,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (init! (-> self query) (lookup-text! *common-text* (game-text-id play-again?) #f) @@ -648,9 +503,7 @@ (lookup-text! *common-text* (game-text-id quit) #f) ) (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (get-art-elem self))) - ) + (ja :group! (get-art-elem self)) (send-event *target* 'end-mode) (when (and (handle->process (-> self offending-rat)) (zero? (-> self num-snacks))) (send-event *camera* 'change-target (handle->process (-> self offending-rat))) @@ -663,10 +516,7 @@ (let ((a0-24 (get-reminder (-> self tasks) 0))) (save-reminder (-> self tasks) (seekl a0-24 255 1) 0) ) - (let* ((v1-49 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-50 (the-as number (logior #x3f800000 v1-49))) - (f0-2 (+ -1.0 (the-as float v1-50))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.75 f0-2) (play-ambient (-> self ambient) "BIL-TA04" #t (the-as vector #f)) @@ -685,15 +535,13 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (billy-kill-all-but-farthy) (send-event *camera* 'change-target *target*) (send-event *camera* 'change-state *camera-base-mode* 0) (none) ) - :trans - (behavior () + :trans (behavior () (cond ((> (-> self num-snacks) 0) (when (process-grab? *target*) @@ -706,7 +554,7 @@ ) (else (process-grab? *target*) - (when (and *target* (logtest? (-> *target* state-flags) 256)) + (when (and *target* (logtest? (-> *target* state-flags) (state-flags grabbed))) (let ((gp-0 (get-response (-> self query)))) (cond ((and (= gp-0 'yes) (process-release? *target*)) @@ -723,10 +571,8 @@ (spool-push *art-control* "billy-reject" 0 self -99.0) (none) ) - :code - (the-as (function none :behavior billy) process-taskable-anim-loop) - :post - (behavior () + :code (the-as (function none :behavior billy) process-taskable-anim-loop) + :post (behavior () (ja-post) (none) ) @@ -905,17 +751,9 @@ ) (get-random-point (-> self path-starts) gp-0) (get-random-point (-> self path-waypts) s5-0) - (let ((s4-0 (get-process *default-dead-pool* billy-rat #x4000))) - (if (when s4-0 - (let ((t9-4 (method-of-type billy-rat activate))) - (t9-4 (the-as billy-rat s4-0) self 'billy-rat (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 billy-rat-init-by-other self gp-0 s5-0) - (-> s4-0 ppointer) - ) - (+! (-> self num-rats) 1) - ) - ) + (if (process-spawn billy-rat self gp-0 s5-0 :to self) + (+! (-> self num-rats) 1) + ) ) ) 0 @@ -923,14 +761,11 @@ ) (defstate billy-playing (billy) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('billy-rat-die) (+! (-> self num-rats) -1) - (let* ((v1-4 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-5 (the-as number (logior #x3f800000 v1-4))) - (f0-2 (+ -1.0 (the-as float v1-5))) + (let* ((f0-2 (rand-float-gen)) (f0-3 (* 3.0 f0-2)) ) (cond @@ -966,10 +801,7 @@ ) ) (when gp-0 - (let* ((v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-16 (the-as number (logior #x3f800000 v1-15))) - (f0-6 (+ -1.0 (the-as float v1-16))) - ) + (let ((f0-6 (rand-float-gen))) (cond ((< 0.75 f0-6) (play-ambient (-> self ambient) "BIL-TA01" #t (the-as vector #f)) @@ -1051,9 +883,8 @@ ) ) ) - :enter - (behavior () - (push-setting! *setting-control* self 'music 'danger 0.0 0) + :enter (behavior () + (add-setting! 'music 'danger 0.0 0) (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (init! (-> self query) (the-as string #f) 40 150 25 #t (lookup-text! *common-text* (game-text-id quit) #f)) @@ -1065,17 +896,9 @@ (let ((gp-1 (new 'stack-no-clear 'vector))) (dotimes (s5-1 (+ (the int (the float (+ (-> self path-snacks curve num-cverts) -1))) 1)) (eval-path-curve-div! (-> self path-snacks) gp-1 (the float s5-1) 'exact) - (let ((s4-1 (get-process *default-dead-pool* billy-snack #x4000))) - (if (when s4-1 - (let ((t9-7 (method-of-type billy-snack activate))) - (t9-7 (the-as billy-snack s4-1) self 'billy-snack (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 billy-snack-init-by-other gp-1) - (-> s4-1 ppointer) - ) - (+! (-> self num-snacks) 1) - ) - ) + (if (process-spawn billy-snack gp-1 :to self) + (+! (-> self num-snacks) 1) + ) ) ) (backup-load-state-and-set-cmds *load-state* '()) @@ -1113,23 +936,20 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (restore-collide-with-as (-> self root-override)) (restore-load-state-and-cleanup *load-state*) (set! (-> *ACTOR-bank* birth-max) 1000) - (clear-pending-settings-from-process *setting-control* self 'music) + (remove-setting! 'music) (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "billy-resolution" 0 self -99.0) (spool-push *art-control* "billy-reject" 0 self -99.0) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (billy-game-update) (if (or (zero? (-> self num-snacks)) (and (zero? (-> self num-rats)) (-> self passed-last-stage)) @@ -1141,8 +961,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (none) ) @@ -1150,23 +969,16 @@ (defstate enter-playing (billy) :virtual #t - :trans - (behavior () - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'change-mode) - (set! (-> a1-0 param 0) (the-as uint 'billy)) - (when (send-event-function *target* a1-0) - (send-event *target* 'trans 'reset) - (let ((v1-8 (entity-actor-lookup (-> self entity) 'alt-actor 0))) - (cond - (v1-8 - (move-to-point! (-> *target* control) (-> v1-8 extra trans)) - (go billy-playing) - ) - (else - ) + :trans (behavior () + (when (send-event *target* 'change-mode 'billy) + (send-event *target* 'trans 'reset) + (let ((v1-8 (entity-actor-lookup (-> self entity) 'alt-actor 0))) + (cond + (v1-8 + (move-to-point! (-> *target* control) (-> v1-8 extra trans)) + (go billy-playing) + ) + (else ) ) ) @@ -1177,10 +989,7 @@ (defmethod TODO-RENAME-43 billy ((obj billy)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f30-0 (+ -1.0 (the-as float v1-4))) - ) + (let ((f30-0 (rand-float-gen))) (cond ((< 0.9411765 f30-0) (play-ambient (-> obj ambient) "BIL-AM01" #f (-> obj root-override trans)) @@ -1243,8 +1052,7 @@ (defstate play-anim (billy) :virtual #t - :exit - (behavior () + :exit (behavior () (billy-kill-all-but-farthy) ((-> (method-of-type process-taskable play-anim) exit)) (none) @@ -1253,82 +1061,30 @@ (defstate idle (billy) :virtual #t - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 60) - ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.2)) ) + (loop + (ja :group! (get-art-elem self)) (let* ((f30-0 5.0) (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-10 (the-as number (logior #x3f800000 v1-9))) ) (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-10)))) 5)) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-10 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! - a0-10 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (TODO-RENAME-43 self) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) - ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (when (ja-group? billy-idle-breath-ja) + (ja-no-eval :group! billy-idle-shoo-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -1353,19 +1109,9 @@ ) ) (set! (-> obj path) (-> obj path-snacks)) - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj farthy) - (ppointer->handle - (when s5-1 - (let ((t9-4 (method-of-type manipy activate))) - (t9-4 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *billy-sidekick-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> obj farthy) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *billy-sidekick-sg* #f :to obj)) + ) (send-event (handle->process (-> obj farthy)) 'center-joint 3) (send-event (handle->process (-> obj farthy)) 'anim-mode 'clone-anim) (dummy-42 obj) diff --git a/goal_src/levels/swamp/kermit.gc b/goal_src/levels/swamp/kermit.gc index bcd064e98e..f4f7be0df7 100644 --- a/goal_src/levels/swamp/kermit.gc +++ b/goal_src/levels/swamp/kermit.gc @@ -9,11 +9,12 @@ ;; DECOMP BEGINS +(import "goal_src/import/kermit-ag.gc") + (defpartgroup group-kermit-charging-up :id 298 :bounds (static-bspherem 0 5 0 5) - :parts - ((sp-item 1359 :fade-after (meters 140) :falloff-to (meters 140) :binding 1356) + :parts ((sp-item 1359 :fade-after (meters 140) :falloff-to (meters 140) :binding 1356) (sp-item 1359 :fade-after (meters 140) :falloff-to (meters 140) :binding 1357) (sp-item 1359 :fade-after (meters 140) :falloff-to (meters 140) :binding 1358) (sp-item 1360) @@ -32,8 +33,7 @@ ) (defpart 1360 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -52,8 +52,7 @@ ) (defpart 1359 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.05 0.1 1.0) (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -72,17 +71,9 @@ ) (defpart 1356 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-flt spt-num 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "eco-blue-spark1") - :volume #x2cc - ) - ) + (sp-sound (static-sound-spec "eco-blue-spark1" :num 0.05 :volume 70.0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -100,17 +91,9 @@ ) (defpart 1357 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-flt spt-num 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.075 - :group #x1 - :sound-name (static-sound-name "eco-blue-spark2") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "eco-blue-spark2" :num 0.075 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -128,17 +111,9 @@ ) (defpart 1358 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-flt spt-num 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "eco-blue-spark3") - :volume #x2cc - ) - ) + (sp-sound (static-sound-spec "eco-blue-spark3" :num 0.05 :volume 70.0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -156,8 +131,7 @@ ) (defpart 1361 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.1 0.5 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -179,8 +153,7 @@ ) (defpart 1362 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.2 0.4 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -202,8 +175,7 @@ ) (defpart 1363 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-rnd-flt spt-num 0.3 0.1 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -225,8 +197,7 @@ ) (defpart 1364 - :init-specs - ((sp-flt spt-r 64.0) + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) (sp-flt spt-fade-r -1.0) (sp-flt spt-fade-g -1.0) @@ -238,13 +209,11 @@ :id 299 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1365 :period 15 :length 5)) + :parts ((sp-item 1365 :period 15 :length 5)) ) (defpart 1365 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -268,8 +237,7 @@ (defpartgroup group-kermit-pulse :id 300 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1368 :flags (launch-asap) :binding 1366) + :parts ((sp-item 1368 :flags (launch-asap) :binding 1366) (sp-item 1366 :flags (start-dead launch-asap) :binding 1367) (sp-item 1367 :flags (start-dead)) (sp-item 1367 :flags (start-dead)) @@ -277,8 +245,7 @@ ) (defpart 1368 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3)) (sp-copy-from-other spt-scale-y -4) @@ -295,8 +262,7 @@ ) (defpart 1369 - :init-specs - ((sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) + :init-specs ((sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-a 100.0 28.0 1.0) (sp-int spt-next-time 5) @@ -305,8 +271,7 @@ ) (defpart 1366 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-y (meters 4) (meters 16) 1.0) (sp-flt spt-z (meters 0)) @@ -328,13 +293,11 @@ ) (defpart 1370 - :init-specs - ((sp-flt spt-vel-z (meters 0))) + :init-specs ((sp-flt spt-vel-z (meters 0))) ) (defpart 1367 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.85)) (sp-copy-from-other spt-scale-y -4) @@ -355,13 +318,11 @@ :id 301 :duration 5 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 1371) (sp-item 1372)) + :parts ((sp-item 1371) (sp-item 1372)) ) (defpart 1371 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -0.1) (meters 0.2) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.2) 1.0) @@ -391,8 +352,7 @@ ) (defpart 1373 - :init-specs - ((sp-flt spt-fade-r -3.2) + :init-specs ((sp-flt spt-fade-r -3.2) (sp-flt spt-fade-g 1.0) (sp-flt spt-fade-b 1.0) (sp-int spt-next-time 30) @@ -401,13 +361,11 @@ ) (defpart 1374 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) (defpart 1372 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -0.1) (meters 0.2) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.2) 1.0) @@ -567,8 +525,7 @@ (defstate kermit-pulse-idle (kermit-pulse) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) @@ -576,35 +533,24 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self sound-id)) (none) ) - :code - (behavior () + :code (behavior () (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) - (sound-play-by-name - (static-sound-name "kermit-loop") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "kermit-loop" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) (spawn (-> self part) (-> self root-override trans)) (find-ground-and-draw-shadow (-> self root-override trans) (the-as vector #f) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -613,41 +559,32 @@ (cleanup-for-death self) (none) ) - :post - (behavior () + :post (behavior () (update-transforms! (-> self root-override)) (none) ) ) (defstate kermit-pulse-impact (kermit-pulse) - :code - (behavior () - (sound-play-by-name (static-sound-name "get-shocked") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 301) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + :code (behavior () + (sound-play "get-shocked") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 301) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (cleanup-for-death self) (none) ) ) -(defbehavior kermit-pulse-init-by-other kermit-pulse ((arg0 vector) (arg1 entity)) +(defbehavior kermit-pulse-init-by-other kermit-pulse ((arg0 vector) (arg1 entity-actor)) (logclear! (-> self mask) (process-mask enemy attackable)) (set! (-> self mask) (logior (process-mask projectile) (-> self mask))) (set! (-> self entity) arg1) @@ -680,15 +617,7 @@ ) (defun spawn-kermit-pulse ((arg0 kermit) (arg1 vector) (arg2 entity)) - (let ((s3-0 (get-process *default-dead-pool* kermit-pulse #x4000))) - (when s3-0 - (let ((t9-1 (method-of-type kermit-pulse activate))) - (t9-1 (the-as kermit-pulse s3-0) arg0 'kermit-pulse (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 kermit-pulse-init-by-other arg1 arg2) - (-> s3-0 ppointer) - ) - ) + (process-spawn kermit-pulse arg1 arg2 :to arg0) 0 (none) ) @@ -740,13 +669,11 @@ (none) ) -(defskelgroup *kermit-sg* kermit - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 -1 0 3) - :longest-edge (meters 2) - ) +(defskelgroup *kermit-sg* kermit kermit-lod0-jg kermit-idle-ja + ((kermit-lod0-mg (meters 20)) (kermit-lod1-mg (meters 40)) (kermit-lod2-mg (meters 999999))) + :bounds (static-spherem 0 -1 0 3) + :longest-edge (meters 2) + ) (defbehavior kermit-enable-tongue kermit () (set! (-> self tongue-control enable) #t) @@ -800,7 +727,7 @@ (collide-kind background cak-2 crate enemy wall-object projectile ground-object) self t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) (gp-1 (< f30-0 0.0)) @@ -845,15 +772,7 @@ ) (defbehavior kermit-short-hop kermit () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! kermit-hop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f0-4 (ja-aframe-num 0))) (if (>= f0-4 4.0) @@ -864,25 +783,13 @@ ) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) (defbehavior kermit-long-hop kermit () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! kermit-longhop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f0-4 (ja-aframe-num 0))) (if (>= f0-4 7.0) @@ -893,17 +800,13 @@ ) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) (defbehavior kermit-hop kermit ((arg0 float)) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (set! (-> self rotate-speed) 1820444.5) (let ((f0-2 (fmin arg0 (vector-vector-distance (-> self collide-info trans) (-> self nav target-pos))))) (cond @@ -923,7 +826,7 @@ (defbehavior kermit-set-rotate-dir-to-nav-target kermit () (cond - ((logtest? (nav-control-flags bit19) (-> self nav flags)) + ((logtest? (nav-control-flags navcf19) (-> self nav flags)) (vector-! (-> self rotate-dir) (-> self nav target-pos) (-> self collide-info trans)) ) (else @@ -1003,19 +906,16 @@ nav-enemy-default-event-handler ) (defstate kermit-idle (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self notice-time) 0) 0 (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) @@ -1024,46 +924,31 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (kermit-disable-tongue) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :group! kermit-idle-ja :num! min) + (loop + (ja :num! (loop!)) (suspend) ) (none) ) - :post - (the-as (function none :behavior kermit) ja-post) + :post (the-as (function none :behavior kermit) ja-post) ) (defstate kermit-patrol (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) (kermit-get-new-patrol-point) (dummy-11 (-> self nav) (-> self nav target-pos)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (or (not *target*) (< (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) @@ -1076,95 +961,70 @@ nav-enemy-default-event-handler (if (and (not (-> self airborne)) (nav-enemy-test-point-in-nav-mesh? (target-pos 0))) (go kermit-notice) ) - (if (logtest? (nav-control-flags bit19) (-> self nav flags)) + (if (logtest? (nav-control-flags navcf19) (-> self nav flags)) (kermit-get-new-patrol-point) ) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 3.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! kermit-idle-ja :num! (seek! max 3.0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 3.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 3.0)) ) (kermit-hop 20480.0) ) (none) ) - :post - kermit-post + :post kermit-post ) (defstate kermit-notice (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) (none) ) - :trans - (behavior () + :trans (behavior () (kermit-set-rotate-dir-to-player) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) (kermit-hop 0.0) (go kermit-chase) (none) ) - :post - kermit-post + :post kermit-post ) (defstate kermit-give-up (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) (none) ) - :code - (behavior () + :code (behavior () (go kermit-patrol) (none) ) - :post - kermit-simple-post + :post kermit-simple-post ) (defstate kermit-chase-new-position (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self miss-count) 0) (let* ((a1-1 (kermit-get-head-dir-xz self (new 'stack-no-clear 'vector))) @@ -1189,11 +1049,10 @@ nav-enemy-default-event-handler (dummy-11 (-> self nav) (-> self nav target-pos)) (none) ) - :trans - (behavior () + :trans (behavior () (when (not (-> self airborne)) (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) - (and (logtest? (nav-control-flags bit19) (-> self nav flags)) + (and (logtest? (nav-control-flags navcf19) (-> self nav flags)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) ) ) @@ -1202,54 +1061,37 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 51) + :code (behavior () + (ja-channel-push! 1 (seconds 0.17)) (dotimes (gp-0 3) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 4.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! kermit-idle-ja :num! (seek! max 4.0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 4.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 4.0)) ) ) - (while #t + (loop (kermit-hop 81920.0) (nop!) ) (none) ) - :post - kermit-post + :post kermit-post ) (defstate kermit-chase (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) (kermit-set-nav-mesh-target (-> self collide-info trans)) (dummy-11 (-> self nav) (-> self nav target-pos)) (none) ) - :trans - (behavior () + :trans (behavior () (kermit-set-nav-mesh-target (-> self collide-info trans)) (kermit-set-rotate-dir-to-player) (if (nav-enemy-test-point-in-nav-mesh? (target-pos 0)) @@ -1282,26 +1124,13 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 51) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 3.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.17)) + (loop + (ja-no-eval :group! kermit-idle-ja :num! (seek! max 3.0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 3.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 3.0)) ) (if (not (kermit-check-to-hit-player? 3640.889)) (kermit-hop 81920.0) @@ -1309,34 +1138,23 @@ nav-enemy-default-event-handler ) (none) ) - :post - kermit-post + :post kermit-post ) (defstate kermit-attack (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 51) + :code (behavior () + (ja-channel-push! 1 (seconds 0.17)) (set! (-> self tongue-control forward-scale-control) 0.0) (kermit-enable-tongue) (let ((s5-0 #f) (gp-0 #f) ) (let ((f30-0 1.0)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! kermit-lash-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (set! (-> self tongue-control target-pos quad) (-> (kermit-player-target-pos) quad)) (when (and (not s5-0) (>= (ja-aframe-num 0) 14.0)) @@ -1350,16 +1168,10 @@ nav-enemy-default-event-handler (if (and (not gp-0) (= (-> self tongue-control forward-scale-control) f30-0)) (go kermit-retract-tongue) ) - (set! (-> self tongue-control forward-scale-control) - (seek (-> self tongue-control forward-scale-control) f30-0 0.25) - ) + (seek! (-> self tongue-control forward-scale-control) f30-0 0.25) ) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (cond @@ -1387,18 +1199,15 @@ nav-enemy-default-event-handler ) (none) ) - :post - kermit-simple-post + :post kermit-simple-post ) (defstate kermit-tongue-stuck (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self miss-count) 0) (set! (-> self tongue-control forward-scale-control) 1.0) (kermit-enable-tongue) @@ -1406,8 +1215,7 @@ nav-enemy-default-event-handler (spawn-kermit-pulse self (kermit-tongue-pos self) (-> self entity)) (none) ) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self sound-id)) (let ((v1-0 (-> self child-override))) (if v1-0 @@ -1416,8 +1224,7 @@ nav-enemy-default-event-handler ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((s5-0 (kermit-player-target-pos)) (gp-0 (kermit-tongue-pos self)) ) @@ -1426,9 +1233,7 @@ nav-enemy-default-event-handler ) (go kermit-retract-tongue) ) - (set! (-> self tongue-pulse-pos) - (seek (-> self tongue-pulse-pos) 1.0 (* 0.3 (-> *display* seconds-per-frame))) - ) + (seek! (-> self tongue-pulse-pos) 1.0 (* 0.3 (-> *display* seconds-per-frame))) (when (and (-> self child-override) (let ((v1-9 (-> self child-override))) (= (-> (if v1-9 (-> v1-9 0 self-override) @@ -1453,41 +1258,19 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (loop + (ja-no-eval :group! kermit-turn-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (sound-play-by-name - (static-sound-name "kermit-stretch") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self collide-info trans)) - ) + (sound-play "kermit-stretch" :id (-> self sound-id) :position (the-as symbol (-> self collide-info trans))) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (behavior () + :post (behavior () (seek-to-point-toward-point! (-> self collide-info) (target-pos 0) (-> self rotate-speed) (seconds 0.05)) (kermit-simple-post) (none) @@ -1495,26 +1278,22 @@ nav-enemy-default-event-handler ) (defstate kermit-retract-tongue (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self charged-up) #f) (+! (-> self miss-count) 1) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self tongue-control forward-scale-control) 0.0) (kermit-disable-tongue) (none) ) - :trans - (behavior () + :trans (behavior () (kermit-set-nav-mesh-target (-> self collide-info trans)) (kermit-set-rotate-dir-to-player) (when (not (-> self airborne)) @@ -1526,58 +1305,30 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! kermit-miss-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (>= (ja-aframe-num 0) 3.0) - (set! (-> self tongue-control forward-scale-control) - (seek (-> self tongue-control forward-scale-control) 0.0 0.125) - ) + (seek! (-> self tongue-control forward-scale-control) 0.0 0.125) ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self tongue-control forward-scale-control) 0.0) (kermit-disable-tongue) - (while #t - (ja-channel-push! 1 30) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 4.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (loop + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! kermit-idle-ja :num! (seek! max 4.0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 4.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 4.0)) ) (kermit-hop 0.0) ) (none) ) - :post - kermit-post + :post kermit-post ) (define *kermit-nav-enemy-info* (new 'static 'nav-enemy-info @@ -1627,7 +1378,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/goal_src/levels/swamp/swamp-bat.gc b/goal_src/levels/swamp/swamp-bat.gc index ba71fc4ae9..9373c49981 100644 --- a/goal_src/levels/swamp/swamp-bat.gc +++ b/goal_src/levels/swamp/swamp-bat.gc @@ -10,6 +10,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/swamp-bat-ag.gc") + (deftype swamp-bat-idle-path (structure) ((origin vector :inline :offset-assert 0) (x-axis vector :inline :offset-assert 16) @@ -140,16 +142,13 @@ swamp-bat-slave-event-handler (TODO-RENAME-12 s2-0 gp-0 f30-0) (vector-cross! s4-0 gp-0 s3-0) (vector-normalize! s4-0 1.0) - (let ((f0-4 - (fmax - (fmin (- (vector-dot (target-pos 0) s4-0) (vector-dot s5-0 s4-0)) (-> self strafe-envelope)) - (- (-> self strafe-envelope)) - ) - ) + (let ((f0-4 (fmax + (fmin (- (vector-dot (target-pos 0) s4-0) (vector-dot s5-0 s4-0)) (-> self strafe-envelope)) + (- (-> self strafe-envelope)) + ) + ) ) - (set! (-> self strafe-distance) - (seek (-> self strafe-distance) f0-4 (* 20480.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self strafe-distance) f0-4 (* 20480.0 (-> *display* seconds-per-frame))) ) (vector-float*! s4-0 s4-0 (-> self strafe-distance)) (vector+! (-> self root-override trans) s5-0 s4-0) @@ -158,13 +157,10 @@ swamp-bat-slave-event-handler (swamp-bat-slave-post) ) -(defskelgroup *swamp-bat-slave-sg* swamp-bat - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - ) +(defskelgroup *swamp-bat-slave-sg* swamp-bat swamp-bat-lod0-jg swamp-bat-idle-ja + ((swamp-bat-lod0-mg (meters 20)) (swamp-bat-lod1-mg (meters 40)) (swamp-bat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + ) (defbehavior swamp-bat-slave-get-new-path swamp-bat-slave () (set! (-> self path-select) (-> self parent-process 0 path-select)) @@ -193,16 +189,12 @@ swamp-bat-slave-event-handler ) (defstate swamp-bat-slave-idle (swamp-bat-slave) - :event - swamp-bat-slave-event-handler - :code - (behavior () + :event swamp-bat-slave-event-handler + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self launch-ready) #f) - (ja-channel-push! 1 49) - (let ((v1-4 (-> self skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) + (ja-channel-push! 1 (seconds 0.165)) + (ja :group! swamp-bat-idle-ja) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> self root-override trans quad)) (let ((s4-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root-override quat))) @@ -218,7 +210,7 @@ swamp-bat-slave-event-handler (s3-0 (the int (* f0-0 (/ 1.0 f1-0) (vector-vector-distance s5-0 (-> self idle-position))))) ) (forward-up->quaternion gp-0 s2-0 (new 'static 'vector :y 1.0 :w 1.0)) - (while #t + (loop (let ((v1-17 (- (-> *display* base-frame-counter) (-> self state-time)))) (when (>= v1-17 s3-0) 0 @@ -233,10 +225,7 @@ swamp-bat-slave-event-handler (quaternion-slerp! (-> self root-override quat) s4-0 gp-0 f30-1) ) ) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (-> self idle-anim-speed)) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! (-> self idle-anim-speed))) (suspend) 0 ) @@ -250,7 +239,7 @@ swamp-bat-slave-event-handler (set! (-> self launch-ready) #t) (logior! (-> self mask) (process-mask actor-pause)) (let ((f30-2 0.0)) - (while #t + (loop (let ((f26-0 (cos f30-2)) (f28-0 (sin f30-2)) ) @@ -258,36 +247,28 @@ swamp-bat-slave-event-handler (vector+*! (-> self root-override trans) (-> self root-override trans) (-> self idle-path x-axis) f26-0) (vector+*! (-> self root-override trans) (-> self root-override trans) (-> self idle-path y-axis) f28-0) ) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 param 0) (-> self idle-anim-speed)) - (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! (-> self idle-anim-speed))) (suspend) (+! f30-2 (* 32768.0 (-> *display* seconds-per-frame) (-> self idle-anim-speed))) ) ) (none) ) - :post - (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) + :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) ) (defstate swamp-bat-slave-launch (swamp-bat-slave) - :event - swamp-bat-slave-event-handler - :code - (behavior () + :event swamp-bat-slave-event-handler + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self launch-ready) #f) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (let ((gp-0 (new-stack-vector0))) (set! (-> gp-0 quad) (-> self root-override trans quad)) (let ((s5-0 (new-stack-vector0))) (eval-path-curve-div! (-> self parent-process 0 path-list (-> self path-select)) s5-0 0.0 'interp) - (let ((v1-12 (-> self skel root-channel 0))) - (set! (-> v1-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) - (while #t + (ja :group! swamp-bat-idle-ja) + (loop (let ((s4-0 (- (-> *display* base-frame-counter) (-> self state-time)))) (if (>= s4-0 (seconds 0.3)) (go swamp-bat-slave-swoop) @@ -296,10 +277,7 @@ swamp-bat-slave-event-handler (vector-lerp! (-> self root-override trans) gp-0 s5-0 f0-1) ) ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (-> self idle-anim-speed)) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! (-> self idle-anim-speed))) (suspend) 0 ) @@ -307,97 +285,65 @@ swamp-bat-slave-event-handler ) (none) ) - :post - (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) + :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) ) (defstate swamp-bat-slave-swoop (swamp-bat-slave) - :event - swamp-bat-slave-event-handler - :code - (behavior () + :event swamp-bat-slave-event-handler + :code (behavior () (set! (-> self strafe-envelope) 0.0) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! swamp-bat-notice-ja :num! min) (until (ja-done? 0) (if (< (ja-aframe-num 0) 10.0) (sync-now! (-> self sync) 0.0) ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self strafe-envelope) 20480.0) - (ja-channel-push! 1 30) - (let ((v1-18 (-> self skel root-channel 0))) - (set! (-> v1-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) - (while #t + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! swamp-bat-swoop-ja) + (loop (if (>= (dummy-20 self) 2.0) (go swamp-bat-slave-strafe) ) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) (none) ) - :post - (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) + :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) ) (defstate swamp-bat-slave-strafe (swamp-bat-slave) - :event - swamp-bat-slave-event-handler - :code - (behavior () + :event swamp-bat-slave-event-handler + :code (behavior () (set! (-> self strafe-envelope) 20480.0) - (ja-channel-push! 1 30) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) - (while #t + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! swamp-bat-strafe-ja) + (loop (if (>= (dummy-20 self) 6.0) (go swamp-bat-slave-return) ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) (none) ) - :post - (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) + :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) ) (defstate swamp-bat-slave-return (swamp-bat-slave) - :event - swamp-bat-slave-event-handler - :code - (behavior () + :event swamp-bat-slave-event-handler + :code (behavior () (set! (-> self strafe-envelope) 0.0) - (ja-channel-push! 1 22) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! swamp-bat-strafe-ja) (let ((f30-0 (+ -1.0 (-> self path-point-count))) (gp-0 #t) ) - (while #t + (loop (let ((f28-0 (dummy-20 self))) (if (>= f28-0 f30-0) (go swamp-bat-slave-idle) @@ -410,28 +356,22 @@ swamp-bat-slave-event-handler ) ) ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) ) (none) ) - :post - (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) + :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) ) (defstate swamp-bat-slave-die (swamp-bat-slave) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior swamp-bat-slave) process-drawable-death-event-handler ) - :code - (behavior ((arg0 handle)) - (ja-channel-push! 1 21) + :code (behavior ((arg0 handle)) + (ja-channel-push! 1 (seconds 0.07)) (let ((gp-0 (new-stack-vector0))) (let ((v1-1 (handle->process arg0))) (if v1-1 @@ -440,24 +380,17 @@ swamp-bat-slave-event-handler ) (set! (-> gp-0 y) (+ -6144.0 (-> gp-0 y))) (vector-normalize! gp-0 98304.0) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - ) + (ja :group! swamp-bat-die-ja) (until (ja-done? 0) (vector-v++! (-> self root-override trans) gp-0) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 0.5) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.5)) (suspend) ) ) (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) + :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) ) (defbehavior swamp-bat-slave-init-by-other swamp-bat-slave ((arg0 swamp-bat-slave) (arg1 int)) @@ -581,15 +514,13 @@ swamp-bat-slave-event-handler ) (defstate swamp-bat-idle (swamp-bat) - :trans - swamp-bat-debug - :code - (behavior () + :trans swamp-bat-debug + :code (behavior () (when (zero? (-> self path-count)) (process-entity-status! self (entity-perm-status dead) #t) (deactivate self) ) - (while #t + (loop (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) *target* (>= (-> self fact-override idle-distance) @@ -613,8 +544,7 @@ swamp-bat-slave-event-handler ) (none) ) - :post - (the-as (function none :behavior swamp-bat) #f) + :post (the-as (function none :behavior swamp-bat) #f) ) (defbehavior swamp-bat-launch-slave swamp-bat () @@ -635,12 +565,10 @@ swamp-bat-slave-event-handler ) (defstate swamp-bat-launch-slaves (swamp-bat) - :trans - swamp-bat-debug - :code - (behavior () + :trans swamp-bat-debug + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (swamp-bat-update-path) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -652,8 +580,7 @@ swamp-bat-slave-event-handler ) (none) ) - :post - (the-as (function none :behavior swamp-bat) #f) + :post (the-as (function none :behavior swamp-bat) #f) ) (defmethod init-from-entity! swamp-bat ((obj swamp-bat) (arg0 entity-actor)) @@ -696,15 +623,7 @@ swamp-bat-slave-event-handler (swamp-bat-setup-new-path 0) (swamp-bat-update-path) (dotimes (s5-1 (-> obj slave-count)) - (let ((s4-1 (get-process *default-dead-pool* swamp-bat-slave 4512))) - (when s4-1 - (let ((t9-16 (method-of-type swamp-bat-slave activate))) - (t9-16 (the-as swamp-bat-slave s4-1) obj 'swamp-bat-slave (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 swamp-bat-slave-init-by-other obj s5-1) - (-> s4-1 ppointer) - ) - ) + (process-spawn swamp-bat-slave obj s5-1 :to obj :stack-size 4512) ) (go swamp-bat-idle) (none) diff --git a/goal_src/levels/swamp/swamp-obs.gc b/goal_src/levels/swamp/swamp-obs.gc index d6325bff95..e6f3485e49 100644 --- a/goal_src/levels/swamp/swamp-obs.gc +++ b/goal_src/levels/swamp/swamp-obs.gc @@ -5,36 +5,31 @@ ;; name in dgo: swamp-obs ;; dgos: L1, SWA -(define-extern *swampcam-sg* skeleton-group) -(define-extern *tar-plat-sg* skeleton-group) -(define-extern *swamp-rock-sg* skeleton-group) -(define-extern *balance-plat-sg* skeleton-group) -(define-extern *swamp-spike-sg* skeleton-group) - -(declare-type swamp-rock process-drawable) -(declare-type balance-plat process-drawable) -(declare-type swamp-spike process-drawable) (declare-type swampgate swamp-spike) (define-extern swamp-spike-gate-down (state swampgate)) ;; DECOMP BEGINS +(import "goal_src/import/swamp-rock-ag.gc") +(import "goal_src/import/swamp-spike-ag.gc") +(import "goal_src/import/swampcam-ag.gc") +(import "goal_src/import/tar-plat-ag.gc") +(import "goal_src/import/balance-plat-ag.gc") + (defpartgroup group-swamp-spike-up :id 289 :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1325 :fade-after (meters 120) :falloff-to (meters 120)) + :parts ((sp-item 1325 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1326 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1327 :fade-after (meters 60) :falloff-to (meters 60)) ) ) (defpart 1325 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-int-flt spt-x (meters -2) 2 8192.0) (sp-flt spt-y (meters 0.75)) @@ -59,13 +54,11 @@ ) (defpart 1328 - :init-specs - ((sp-flt spt-fade-a -0.32)) + :init-specs ((sp-flt spt-fade-a -0.32)) ) (defpart 1326 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-int-flt spt-x (meters -2) 2 8192.0) (sp-flt spt-y (meters -0.75)) @@ -90,8 +83,7 @@ ) (defpart 1327 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-int-flt spt-x (meters -2) 2 8192.0) (sp-flt spt-y (meters 0.25)) @@ -121,8 +113,7 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1325 :fade-after (meters 120) :falloff-to (meters 120)) + :parts ((sp-item 1325 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1326 :fade-after (meters 120) :falloff-to (meters 120)) ) ) @@ -146,13 +137,11 @@ ) -(defskelgroup *swamp-spike-sg* swamp-spike - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 5 0 6) - :longest-edge (meters 2.5) - ) +(defskelgroup *swamp-spike-sg* swamp-spike swamp-spike-lod0-jg swamp-spike-up-ja + ((swamp-spike-lod0-mg (meters 20)) (swamp-spike-lod1-mg (meters 999999))) + :bounds (static-spherem 0 5 0 6) + :longest-edge (meters 2.5) + ) (defbehavior swamp-spike-default-event-handler swamp-spike ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 @@ -195,25 +184,18 @@ ) (defstate swamp-spike-idle (swamp-spike) - :event - swamp-spike-default-event-handler - :code - (behavior () + :event swamp-spike-default-event-handler + :code (behavior () (set! (-> self dangerous) #f) (let ((gp-0 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) (vector-z-quaternion! gp-0 (-> self root-override quat)) (set! (-> gp-0 w) (- (vector-dot gp-0 (-> self root-override trans)))) - (while #t + (loop (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((v1-10 (-> self skel root-channel 0))) - (set! (-> v1-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) (until (>= (get-current-phase (-> self sync)) 0.5) - (let ((v1-13 (-> self skel root-channel 0))) - (set! (-> v1-13 num-func) num-func-identity) - (set! (-> v1-13 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) (let ((s5-0 (or (not *target*) @@ -233,106 +215,53 @@ ) ) (else - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (when (logtest? (-> self draw status) (draw-status was-drawn)) - (let ((s5-3 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-3 - (let ((t9-11 (method-of-type part-tracker activate))) - (t9-11 (the-as part-tracker s5-3) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-3 - part-tracker-init - (-> *part-group-id-table* 289) - -1 - swamp-spike-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root-override trans) - ) - (-> s5-3 ppointer) + (if (logtest? (-> self draw status) (draw-status was-drawn)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 289) + -1 + swamp-spike-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root-override trans) + :to self ) ) - ) (set! (-> self dangerous) #t) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self dangerous) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((v1-96 (-> self skel root-channel 0))) - (set! (-> v1-96 num-func) num-func-identity) - (set! (-> v1-96 frame-num) (the float (+ (-> v1-96 frame-group data 0 length) -1))) - ) + (ja :num-func num-func-identity :frame-num max) (until (< (get-current-phase (-> self sync)) 0.5) (suspend) ) - (when (logtest? (-> self draw status) (draw-status was-drawn)) - (let ((s5-4 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-4 - (let ((t9-18 (method-of-type part-tracker activate))) - (t9-18 (the-as part-tracker s5-4) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-4 - part-tracker-init - (-> *part-group-id-table* 290) - -1 - swamp-spike-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root-override trans) - ) - (-> s5-4 ppointer) + (if (logtest? (-> self draw status) (draw-status was-drawn)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 290) + -1 + swamp-spike-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root-override trans) + :to self ) ) - ) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-29 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-29 param 1) 1.0) - (set! (-> a0-29 frame-num) 0.0) - (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 param 0) (the float (+ (-> a0-30 frame-group data 0 length) -1))) - (set! (-> a0-30 param 1) 1.0) - (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -341,13 +270,11 @@ ) (none) ) - :post - swamp-spike-post + :post swamp-spike-post ) (defstate swamp-spike-gate-up (swampgate) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'trigger) (let ((v0-0 #t)) @@ -358,70 +285,42 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((v1-4 (-> self skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) + (ja :group! (-> self draw art-group data 4)) (until (-> self open-gate) - (let ((v1-7 (-> self skel root-channel 0))) - (set! (-> v1-7 num-func) num-func-identity) - (set! (-> v1-7 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 290) - -1 - swamp-spike-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) - ) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 290) + -1 + swamp-spike-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root-override trans) + :to self ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go swamp-spike-gate-down) (none) ) - :post - (the-as (function none :behavior swampgate) swamp-spike-post) + :post (the-as (function none :behavior swampgate) swamp-spike-post) ) (defstate swamp-spike-gate-down (swampgate) - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior swampgate) swamp-spike-post) + :post (the-as (function none :behavior swampgate) swamp-spike-post) ) (defmethod init! swamp-spike ((obj swamp-spike)) @@ -455,7 +354,7 @@ (backup-collide-with-as s5-0) (set! (-> obj root-override) s5-0) ) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (initialize-skeleton obj *swamp-spike-sg* '()) (set! (-> obj draw origin-joint-index) (the-as uint 3)) (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) @@ -511,17 +410,13 @@ ) -(defskelgroup *balance-plat-sg* balance-plat - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *balance-plat-sg* balance-plat balance-plat-lod0-jg balance-plat-idle-ja + ((balance-plat-lod0-mg (meters 20)) (balance-plat-lod1-mg (meters 40)) (balance-plat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) (defstate balance-plat-idle (balance-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'grow) (let ((v0-0 #t)) @@ -532,17 +427,15 @@ ) ) ) - :trans - (the-as (function none :behavior balance-plat) rider-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior balance-plat) rider-trans) + :code (behavior () + (loop (let ((f30-0 (* -0.025 (+ (-> self y-offset) (-> self y-travel)))) (f28-0 (* -0.025 (- (-> self y-offset) (-> self y-travel)))) ) (cond ((and (-> self root-override riders) (nonzero? (-> self root-override riders num-riders))) - (send-event *target* 'no-look-around 75) + (send-event *target* 'no-look-around (seconds 0.25)) (set! (-> self y-accel) (fmin 4.096 (fmax -4.096 (+ -0.2048 (-> self y-accel))))) (set! (-> self y-vel) (fmin f28-0 (fmax f30-0 (+ (-> self y-vel) (-> self y-accel))))) (send-to-all-after (-> self link) 'grow) @@ -575,13 +468,13 @@ ) (none) ) - :post - (the-as (function none :behavior balance-plat) rider-post) + :post (the-as (function none :behavior balance-plat) rider-post) ) (defmethod init-from-entity! balance-plat ((obj balance-plat) (arg0 entity-actor)) + ;; PAL patch here. usually-hit-by-player -> hit-by-others (set! (-> obj mask) (logior (process-mask platform) (-> obj mask))) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -633,16 +526,14 @@ :duration 300 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1330 :period 1500 :length 5) + :parts ((sp-item 1330 :period 1500 :length 5) (sp-item 1331 :period 1500 :length 5) (sp-item 1332 :period 1500 :length 15) ) ) (defpart 1331 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 15)) (sp-copy-from-other spt-scale-y -4) @@ -657,8 +548,7 @@ ) (defpart 1330 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 16.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -681,8 +571,7 @@ ) (defpart 1332 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -706,43 +595,38 @@ ) (defpart 1333 - :init-specs - ((sp-flt spt-fade-a -0.2)) + :init-specs ((sp-flt spt-fade-a -0.2)) ) -(defskelgroup *swamp-rock-sg* swamp-rock - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *swamp-rock-sg* swamp-rock swamp-rock-lod0-jg swamp-rock-idle-ja + ((swamp-rock-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) (defstate swamp-rock-break (swamp-rock) - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (sound-play-by-name (static-sound-name "rock-break") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 291) -1 #f #f #f (-> self root trans)) - (-> gp-1 ppointer) - ) + (sound-play "rock-break") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 291) + -1 + #f + #f + #f + (-> self root trans) + :to *entity-pool* ) (cleanup-for-death self) (deactivate self) (none) ) - :post - (the-as (function none :behavior swamp-rock) ja-post) + :post (the-as (function none :behavior swamp-rock) ja-post) ) (defstate swamp-rock-idle (swamp-rock) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (if (and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow)) @@ -751,10 +635,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -819,13 +702,10 @@ (none) ) -(defskelgroup *tar-plat-sg* tar-plat - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *tar-plat-sg* tar-plat tar-plat-lod0-jg tar-plat-idle-ja + ((tar-plat-lod0-mg (meters 20)) (tar-plat-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) (define *tar-plat-constants* (new 'static 'rigid-body-platform-constants :drag-factor 2.0 @@ -881,70 +761,54 @@ (defstate rigid-body-platform-idle (tar-plat) :virtual #t - :enter - (behavior () + :enter (behavior () (ja-channel-set! 0) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior tar-plat) ja-post) + :post (the-as (function none :behavior tar-plat) ja-post) ) (defstate rigid-body-platform-float (tar-plat) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior tar-plat) rigid-body-platform-event-handler ) - :trans - (behavior () + :trans (behavior () (cond ((or (not *target*) (< (-> self info idle-distance) (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) ) ) (let ((f30-1 -2048.0)) - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) (if (= (-> self float-height-offset) f30-1) (go-virtual rigid-body-platform-idle) ) ) ) (else - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) ) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) - (while #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 3)) + (ja :num-func num-func-identity :frame-num 0.0) + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior tar-plat) rigid-body-platform-post) + :post (the-as (function none :behavior tar-plat) rigid-body-platform-post) ) (defmethod TODO-RENAME-30 tar-plat ((obj tar-plat)) @@ -1015,13 +879,10 @@ ) -(defskelgroup *swampcam-sg* swampcam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *swampcam-sg* swampcam swampcam-lod0-jg swampcam-anim-ja + ((swampcam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) (deftype swamp-battlecontroller (battlecontroller) () @@ -1034,23 +895,14 @@ (defstate battlecontroller-play-intro-camera (swamp-battlecontroller) :virtual #t - :code - (behavior () + :code (behavior () (suspend) (process-drawable-delay-player (seconds 1)) - (let* ((gp-0 (get-process *default-dead-pool* pov-camera #x4000)) - (gp-1 - (ppointer->handle - (when gp-0 - (let ((t9-2 (method-of-type pov-camera activate))) - (t9-2 (the-as pov-camera gp-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 pov-camera-init-by-other (-> self root trans) *swampcam-sg* "swamp-ambush" 0 #f '()) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 (ppointer->handle + (process-spawn pov-camera (-> self root trans) *swampcam-sg* "swamp-ambush" 0 #f '() :to self) + ) + ) + ) (while (handle->process (the-as handle gp-1)) (suspend) ) @@ -1062,8 +914,7 @@ (defstate battlecontroller-die (swamp-battlecontroller) :virtual #t - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) ((the-as (function none :behavior battlecontroller) diff --git a/goal_src/levels/swamp/swamp-part.gc b/goal_src/levels/swamp/swamp-part.gc index cf4ac648e5..5453bc2a4f 100644 --- a/goal_src/levels/swamp/swamp-part.gc +++ b/goal_src/levels/swamp/swamp-part.gc @@ -19,8 +19,7 @@ (defpartgroup group-swamp-bayou-billy-hut :id 302 :bounds (static-bspherem -4 -3 0 12) - :parts - ((sp-item 1377 :fade-after (meters 175) :falloff-to (meters 175) :period 1500 :length 300) + :parts ((sp-item 1377 :fade-after (meters 175) :falloff-to (meters 175) :period 1500 :length 300) (sp-item 1377 :fade-after (meters 175) :falloff-to (meters 175) :period 2928 :length 360) (sp-item 1377 :fade-after (meters 175) :falloff-to (meters 175) :period 4602 :length 180) (sp-item 1378 :fade-after (meters 175) :falloff-to (meters 175) :period 1500 :length 300) @@ -100,8 +99,7 @@ ) (defpart 2305 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-x (meters 6)) (sp-flt spt-y (meters -13)) @@ -118,13 +116,11 @@ ) (defpart 2308 - :init-specs - ((sp-int spt-timer 300) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2308)) + :init-specs ((sp-int spt-timer 300) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2308)) ) (defpart 2306 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-x (meters 5)) (sp-flt spt-y (meters -13.5)) @@ -141,8 +137,7 @@ ) (defpart 2307 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-x (meters 6.5)) (sp-flt spt-y (meters -12.5)) @@ -159,8 +154,7 @@ ) (defpart 2303 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-int spt-num 1065353216 1 2.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.5) (meters 1) 1.0) @@ -182,8 +176,7 @@ ) (defpart 2304 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 3.0) (sp-flt spt-scale-x (meters 0.075)) @@ -199,8 +192,7 @@ ) (defpart 1384 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 15) (meters 30) 1.0) (sp-rnd-flt spt-y (meters 14) (meters 3) 1.0) @@ -221,8 +213,7 @@ ) (defpart 1385 - :init-specs - ((sp-flt spt-g 128.0) + :init-specs ((sp-flt spt-g 128.0) (sp-flt spt-vel-x (meters 0)) (sp-flt spt-vel-y (meters 0)) (sp-flt spt-vel-z (meters 0)) @@ -235,16 +226,14 @@ ) (defpart 1386 - :init-specs - ((sp-flt spt-b 128.0) + :init-specs ((sp-flt spt-b 128.0) (sp-rnd-int spt-accel-x -1070677186 1 5.4613333) (sp-rnd-int spt-accel-z -1070677186 1 5.4613333) ) ) (defpart 1383 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 15) (meters 30) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 3) 1.0) @@ -265,8 +254,7 @@ ) (defpart 1375 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -290,8 +278,7 @@ ) (defpart 1387 - :init-specs - ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) (sp-rnd-flt spt-vel-y (meters -0.0074074077) (meters 0.0148148155) 1.0) (sp-rnd-flt spt-rotvel-z (degrees -0.4) (degrees 0.8) 1.0) (sp-int-plain-rnd spt-next-time 150 449 1) @@ -300,8 +287,7 @@ ) (defpart 1376 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 4.0) (sp-flt spt-scale-x (meters 1)) @@ -318,8 +304,7 @@ ) (defpart 1377 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-flt spt-y (meters -0.25)) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) @@ -350,8 +335,7 @@ ) (defpart 1378 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.9 1.0) (sp-rnd-flt spt-scale-x (meters 0.75) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -379,8 +363,7 @@ ) (defpart 1379 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-flt spt-y (meters -0.25)) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) @@ -411,8 +394,7 @@ ) (defpart 1380 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -440,8 +422,7 @@ ) (defpart 1381 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.9 1.0) (sp-flt spt-x (meters -7.8)) (sp-flt spt-y (meters -8.5)) @@ -471,8 +452,7 @@ ) (defpart 1382 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-flt spt-x (meters -7.8)) (sp-flt spt-y (meters -8.5)) @@ -504,8 +484,7 @@ (defpartgroup group-swamp-bubbles-01 :id 303 :bounds (static-bspherem 0 0 -8 30) - :parts - ((sp-item 1390 :fade-after (meters 125) :period 150 :length 5 :binding 1388) + :parts ((sp-item 1390 :fade-after (meters 125) :period 150 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -559,8 +538,7 @@ ) (defpart 1390 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 35) 1.0) (sp-rnd-flt spt-z (meters -35) (meters 55) 1.0) @@ -574,8 +552,7 @@ ) (defpart 1388 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x20 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x20 :page #x2)) (sp-rnd-flt spt-num 0.05 0.1 1.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-z (meters -2) (meters 4) 1.0) @@ -596,18 +573,15 @@ ) (defpart 1391 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 1050) (sp-launcher-by-id spt-next-launcher 1392)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 1050) (sp-launcher-by-id spt-next-launcher 1392)) ) (defpart 1392 - :init-specs - ((sp-flt spt-g 0.0) (sp-flt spt-b 0.0) (sp-flt spt-a 0.0) (sp-int spt-timer 5)) + :init-specs ((sp-flt spt-g 0.0) (sp-flt spt-b 0.0) (sp-flt spt-a 0.0) (sp-int spt-timer 5)) ) (defpart 1389 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -624,8 +598,7 @@ ) (defpart 1393 - :init-specs - ((sp-rnd-flt spt-a 8.0 32.0 1.0) + :init-specs ((sp-rnd-flt spt-a 8.0 32.0 1.0) (sp-flt spt-scalevel-x (meters 0.04)) (sp-copy-from-other spt-scalevel-y -4) (sp-int spt-timer 5) @@ -635,8 +608,7 @@ (defpartgroup group-swamp-bubbles-02 :id 304 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1394 :fade-after (meters 125) :period 450 :length 5 :binding 1388) + :parts ((sp-item 1394 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -673,8 +645,7 @@ ) (defpart 1394 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -8) (meters 16) 1.0) (sp-rnd-flt spt-z (meters -20) (meters 40) 1.0) @@ -691,8 +662,7 @@ (defpartgroup group-swamp-bubbles-03 :id 305 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1395 :fade-after (meters 125) :period 450 :length 5 :binding 1388) + :parts ((sp-item 1395 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -746,8 +716,7 @@ ) (defpart 1395 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -4) (meters 12) 1.0) (sp-rnd-flt spt-z (meters -40) (meters 60) 1.0) @@ -764,8 +733,7 @@ (defpartgroup group-swamp-bubbles-04 :id 306 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1396 :fade-after (meters 125) :period 150 :length 5 :binding 1388) + :parts ((sp-item 1396 :fade-after (meters 125) :period 150 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -819,8 +787,7 @@ ) (defpart 1396 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -35) (meters 60) 1.0) (sp-rnd-flt spt-z (meters -12) (meters 18) 1.0) @@ -837,8 +804,7 @@ (defpartgroup group-swamp-bubbles-05 :id 307 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1397 :fade-after (meters 125) :period 600 :length 5 :binding 1388) + :parts ((sp-item 1397 :fade-after (meters 125) :period 600 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1389 :flags (start-dead launch-asap)) @@ -861,8 +827,7 @@ ) (defpart 1397 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-rnd-flt spt-z (meters -6) (meters 12) 1.0) @@ -879,8 +844,7 @@ (defpartgroup group-swamp-bubbles-06 :id 308 :bounds (static-bspherem 0 0 0 40) - :parts - ((sp-item 1398 :fade-after (meters 200) :period 120 :length 5 :binding 1388) + :parts ((sp-item 1398 :fade-after (meters 200) :period 120 :length 5 :binding 1388) (sp-item 1399 :fade-after (meters 200) :period 450 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -953,8 +917,7 @@ ) (defpart 1398 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -45) (meters 80) 1.0) (sp-rnd-flt spt-z (meters -20) (meters 40) 1.0) @@ -969,8 +932,7 @@ ) (defpart 1399 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 40) 1.0) (sp-rnd-flt spt-z (meters 18) (meters 15) 1.0) @@ -987,8 +949,7 @@ (defpartgroup group-swamp-bubbles-07 :id 309 :bounds (static-bspherem 0 0 0 40) - :parts - ((sp-item 1400 :fade-after (meters 125) :period 450 :length 5 :binding 1388) + :parts ((sp-item 1400 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1401 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1402 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1403 :fade-after (meters 125) :period 600 :length 5 :binding 1388) @@ -1063,8 +1024,7 @@ ) (defpart 1400 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 15) 1.0) (sp-rnd-flt spt-z (meters -8) (meters 38) 1.0) @@ -1079,8 +1039,7 @@ ) (defpart 1401 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -17.5) (meters 10) 1.0) (sp-rnd-flt spt-z (meters -15) (meters 50) 1.0) @@ -1095,8 +1054,7 @@ ) (defpart 1402 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 45) 1.0) (sp-rnd-flt spt-z (meters 21) (meters 8) 1.0) @@ -1111,8 +1069,7 @@ ) (defpart 1403 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -33) (meters 6) 1.0) (sp-rnd-flt spt-z (meters -25) (meters 25) 1.0) @@ -1130,8 +1087,7 @@ (defpartgroup group-swamp-bubbles-08 :id 310 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1404 :fade-after (meters 125) :period 150 :length 5 :binding 1388) + :parts ((sp-item 1404 :fade-after (meters 125) :period 150 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -1173,8 +1129,7 @@ ) (defpart 1404 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -18) (meters 45) 1.0) (sp-rnd-flt spt-z (meters -25) (meters 40) 1.0) @@ -1191,8 +1146,7 @@ (defpartgroup group-swamp-bubbles-09 :id 311 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1405 :fade-after (meters 125) :period 450 :length 5 :binding 1388) + :parts ((sp-item 1405 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -1221,8 +1175,7 @@ ) (defpart 1405 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 42) 1.0) (sp-rnd-flt spt-z (meters -10) (meters 18) 1.0) @@ -1239,8 +1192,7 @@ (defpartgroup group-swamp-bubbles-10 :id 312 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1406 :fade-after (meters 125) :period 450 :length 5 :binding 1388) + :parts ((sp-item 1406 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -1282,8 +1234,7 @@ ) (defpart 1406 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -30) (meters 52) 1.0) (sp-rnd-flt spt-z (meters -10) (meters 18) 1.0) @@ -1300,8 +1251,7 @@ (defpartgroup group-swamp-bubbles-11 :id 313 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1407 :fade-after (meters 125) :period 450 :length 5 :binding 1388) + :parts ((sp-item 1407 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -1343,8 +1293,7 @@ ) (defpart 1407 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -14) (meters 22) 1.0) (sp-rnd-flt spt-z (meters -13) (meters 30) 1.0) @@ -1361,8 +1310,7 @@ (defpartgroup group-swamp-bubbles-12 :id 314 :bounds (static-bspherem 0 0 0 40) - :parts - ((sp-item 1408 :fade-after (meters 125) :period 150 :length 5 :binding 1388) + :parts ((sp-item 1408 :fade-after (meters 125) :period 150 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -1391,8 +1339,7 @@ ) (defpart 1408 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 33) 1.0) (sp-rnd-flt spt-z (meters -13) (meters 70) 1.0) @@ -1409,8 +1356,7 @@ (defpartgroup group-swamp-bubbles-13 :id 315 :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 1409 :fade-after (meters 125) :period 600 :length 5 :binding 1388) + :parts ((sp-item 1409 :fade-after (meters 125) :period 600 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -1439,8 +1385,7 @@ ) (defpart 1409 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -8) (meters 20) 1.0) (sp-rnd-flt spt-z (meters -8) (meters 20) 1.0) @@ -1457,8 +1402,7 @@ (defpartgroup group-swamp-bubbles-14 :id 316 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1410 :fade-after (meters 125) :period 120 :length 5 :binding 1388) + :parts ((sp-item 1410 :fade-after (meters 125) :period 120 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -1500,8 +1444,7 @@ ) (defpart 1410 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -35) (meters 50) 1.0) (sp-rnd-flt spt-z (meters -40) (meters 55) 1.0) @@ -1518,8 +1461,7 @@ (defpartgroup group-swamp-torch :id 317 :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 1411 :fade-after (meters 200) :falloff-to (meters 220)) + :parts ((sp-item 1411 :fade-after (meters 200) :falloff-to (meters 220)) (sp-item 1412 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 1413 :fade-after (meters 50) :falloff-to (meters 50) :period 600 :length 90) (sp-item 1414 :fade-after (meters 50) :falloff-to (meters 50) :period 369 :length 69) @@ -1529,8 +1471,7 @@ ) (defpart 1416 - :init-specs - ((sp-flt spt-num 0.3) + :init-specs ((sp-flt spt-num 0.3) (sp-flt spt-x (meters 0.2)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-int spt-rot-x 5) @@ -1548,13 +1489,11 @@ ) (defpart 1417 - :init-specs - ((sp-flt spt-fade-b -6.826667)) + :init-specs ((sp-flt spt-fade-b -6.826667)) ) (defpart 1411 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1069547520 1 1.0) (sp-rnd-flt spt-x (meters -0.35) (meters 0.7) 1.0) (sp-rnd-flt spt-z (meters -0.35) (meters 0.7) 1.0) @@ -1576,13 +1515,11 @@ ) (defpart 1418 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) (defpart 1413 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters 1)) @@ -1605,8 +1542,7 @@ ) (defpart 1414 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.2) (meters 0.6) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1629,8 +1565,7 @@ ) (defpart 1415 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 0.2) 1.0) (sp-flt spt-y (meters 0.6)) @@ -1653,8 +1588,7 @@ ) (defpart 1412 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.3)) diff --git a/goal_src/levels/swamp/swamp-rat-nest.gc b/goal_src/levels/swamp/swamp-rat-nest.gc index 8d5a065e51..5cb9a19661 100644 --- a/goal_src/levels/swamp/swamp-rat-nest.gc +++ b/goal_src/levels/swamp/swamp-rat-nest.gc @@ -11,13 +11,14 @@ ;; DECOMP BEGINS +(import "goal_src/import/swamp-rat-nest-ag.gc") + (defpartgroup group-swamp-rat-nest-a-explosion :id 292 :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1334) (sp-item 1335) (sp-item 1336) (sp-item 1337) (sp-item 1338) (sp-item 1339)) + :parts ((sp-item 1334) (sp-item 1335) (sp-item 1336) (sp-item 1337) (sp-item 1338) (sp-item 1339)) ) (defpartgroup group-swamp-rat-nest-b-explosion @@ -25,8 +26,7 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1342) (sp-item 1339) (sp-item 1337) (sp-item 1334)) + :parts ((sp-item 1342) (sp-item 1339) (sp-item 1337) (sp-item 1334)) ) (defpartgroup group-swamp-rat-nest-c-explosion @@ -34,37 +34,32 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1335) (sp-item 1339) (sp-item 1337) (sp-item 1334)) + :parts ((sp-item 1335) (sp-item 1339) (sp-item 1337) (sp-item 1334)) ) (defpartgroup group-swamp-rat-nest-a-puff :id 295 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1346) (sp-item 1347) (sp-item 1348)) + :parts ((sp-item 1346) (sp-item 1347) (sp-item 1348)) ) (defpartgroup group-swamp-rat-nest-b-puff :id 296 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1350) (sp-item 1351)) + :parts ((sp-item 1350) (sp-item 1351)) ) (defpartgroup group-swamp-rat-nest-c-puff :id 297 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1353) (sp-item 1354)) + :parts ((sp-item 1353) (sp-item 1354)) ) (defpart 1353 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -89,8 +84,7 @@ ) (defpart 1354 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.05) 1.0) @@ -113,8 +107,7 @@ ) (defpart 1355 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -4.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -139,8 +132,7 @@ ) (defpart 1350 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -165,8 +157,7 @@ ) (defpart 1351 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -1) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.05) 1.0) @@ -189,8 +180,7 @@ ) (defpart 1352 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -10.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -215,8 +205,7 @@ ) (defpart 1334 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 16)) @@ -233,8 +222,7 @@ ) (defpart 1341 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -12)) (sp-flt spt-scale-x (meters 16)) @@ -251,8 +239,7 @@ ) (defpart 1339 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 8.0 1.0) (sp-rnd-flt spt-y (meters -1) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.75) (meters 1) 1.0) @@ -278,8 +265,7 @@ ) (defpart 1335 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 16.0 8.0 1.0) (sp-rnd-flt spt-y (meters -2) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -304,8 +290,7 @@ ) (defpart 1340 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 10.0 5.0 1.0) (sp-rnd-flt spt-y (meters -12) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -330,8 +315,7 @@ ) (defpart 1336 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 12.0 8.0 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -356,8 +340,7 @@ ) (defpart 1337 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-y (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.6) 1.0) @@ -381,8 +364,7 @@ ) (defpart 1338 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 32.0 32.0 1.0) (sp-rnd-flt spt-y (meters 2) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.25) (meters 0.5) 1.0) @@ -406,8 +388,7 @@ ) (defpart 1346 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -432,8 +413,7 @@ ) (defpart 1349 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -12) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -458,8 +438,7 @@ ) (defpart 1347 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.05) 1.0) @@ -482,8 +461,7 @@ ) (defpart 1348 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-y (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.25) (meters 0.5) 1.0) @@ -506,8 +484,7 @@ ) (defpart 1342 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 20.0 8.0 1.0) (sp-rnd-flt spt-y (meters -3.5) (meters 2.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -532,8 +509,7 @@ ) (defpart 1343 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 16.0 5.0 1.0) (sp-rnd-flt spt-y (meters -10.5) (meters 2.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -558,8 +534,7 @@ ) (defpart 1344 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num -5.0) (sp-flt spt-y (meters -12)) (sp-flt spt-scale-x (meters 16)) @@ -576,8 +551,7 @@ ) (defpart 1345 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 12.0 4.0 1.0) (sp-rnd-flt spt-y (meters -4) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -687,7 +661,7 @@ (let* ((a0-0 (-> self spawn-joint-array gp-0)) (a2-0 (-> self node-list data a0-0 bone transform)) ) - (add-debug-matrix #t (bucket-id debug-draw1) a2-0) + (add-debug-matrix #t (bucket-id debug-no-zbuf) a2-0) ) ) #f @@ -719,7 +693,7 @@ ((and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow)) (swamp-rat-nest-dummy-take-damage 3) (if (< (vector-vector-distance (target-pos 0) (-> self top-sphere)) (-> self top-sphere w)) - (send-event *target* 'no-look-around 75) + (send-event *target* 'no-look-around (seconds 0.25)) ) (go swamp-rat-nest-dummy-hit) ) @@ -742,150 +716,70 @@ ) (defstate swamp-rat-nest-dummy-idle (swamp-rat-nest-dummy) - :event - swamp-rat-nest-dummy-event-handler - :code - (behavior () - (while #t - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) (the float (+ (-> v1-2 frame-group data 0 length) -1))) - ) + :event swamp-rat-nest-dummy-event-handler + :code (behavior () + (loop + (ja :num-func num-func-identity :frame-num max) (suspend) ) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) + :post (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) ) (defstate swamp-rat-nest-dummy-hit (swamp-rat-nest-dummy) - :event - swamp-rat-nest-dummy-event-handler - :enter - (behavior () + :event swamp-rat-nest-dummy-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (if (<= (-> self parent-process 0 hit-points) 0) (go swamp-rat-nest-dummy-die) ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (< (-> self parent-process 0 hit-points) 3) (spawn (-> self part) (-> self node-list data (-> self particle-spawn-joint) bone transform vector 3)) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go swamp-rat-nest-dummy-idle) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) + :post (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) ) (defstate swamp-rat-nest-dummy-shake (swamp-rat-nest-dummy) - :event - swamp-rat-nest-dummy-event-handler - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :event swamp-rat-nest-dummy-event-handler + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go swamp-rat-nest-dummy-idle) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) + :post (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) ) (defstate swamp-rat-nest-dummy-die (swamp-rat-nest-dummy) - :event - (the-as (function process int symbol event-message-block object :behavior swamp-rat-nest-dummy) #f) - :code - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior swamp-rat-nest-dummy) #f) + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self parent-process 0 dummy) (the-as (pointer swamp-rat-nest-dummy) #f)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> self death-part) - -1 - #f - #f - #f - (-> self node-list data (-> self particle-spawn-joint) bone transform vector 3) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> self death-part) + -1 + #f + #f + #f + (-> self node-list data (-> self particle-spawn-joint) bone transform vector 3) + :to *entity-pool* ) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (suspend) @@ -903,14 +797,14 @@ (let ((gp-0 (-> arg0 entity))) (set! (-> self mask) (logior (process-mask enemy) (-> self mask))) (dummy-20 self) - (process-drawable-from-entity! self (the-as entity-actor gp-0)) + (process-drawable-from-entity! self gp-0) (set! (-> self top-sphere quad) (-> self root-override trans quad)) (set! (-> self top-sphere y) (+ 24576.0 (-> self top-sphere y))) (set! (-> self top-sphere w) 18432.0) (set! (-> self entity) gp-0) ) (set! (-> self nav) (new 'process 'nav-control (-> self root-override) 16 40960.0)) - (logior! (-> self nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> self nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set-current-poly! (-> self nav) (find-poly (-> self nav) (-> self root-override trans))) (+! (-> self parent-process 0 hit-points) 3) (dummy-21 self) @@ -961,26 +855,22 @@ swamp-rat-nest-default-event-handler ;; WARN: Function may read a register that is not set: t2 (defbehavior swamp-rat-nest-spawn-rat swamp-rat-nest () (local-vars (t2-0 none)) - (when (and (-> self dummy) (> (-> self dummy 0 spawn-joint-count) 0)) - (let* ((v1-5 (swamp-rat-nest-pick-spawn-joint)) - (v1-8 (-> self dummy 0 node-list data v1-5 bone)) - (gp-0 (new 'stack-no-clear 'vector)) - ) - (set! (-> gp-0 quad) (-> v1-8 transform vector 3 quad)) - (let ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> v1-8 transform vector 1) 1.0)) - (s4-0 (if (= (-> self fact-override pickup-type) (pickup-type none)) - 0 - 9 - ) - ) - (s3-0 (get-process *default-dead-pool* swamp-rat #x4000)) - ) - (when s3-0 - (let ((t9-3 (method-of-type swamp-rat activate))) - (t9-3 (the-as swamp-rat s3-0) self 'swamp-rat (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 swamp-rat-init-by-other self gp-0 s5-0 s4-0 t2-0) - (-> s3-0 ppointer) + (the-as + (pointer swamp-rat) + (when (and (-> self dummy) (> (-> self dummy 0 spawn-joint-count) 0)) + (let* ((v1-5 (swamp-rat-nest-pick-spawn-joint)) + (v1-8 (-> self dummy 0 node-list data v1-5 bone)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> v1-8 transform vector 3 quad)) + (let ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> v1-8 transform vector 1) 1.0)) + (s4-0 (if (= (-> self fact-override pickup-type) (pickup-type none)) + 0 + 9 + ) + ) + ) + (process-spawn swamp-rat self gp-0 s5-0 s4-0 t2-0 :to self) ) ) ) @@ -992,52 +882,19 @@ swamp-rat-nest-default-event-handler (let ((v1-1 (-> self dummy-type))) (cond ((zero? v1-1) - (let ((gp-0 (get-process *default-dead-pool* swamp-rat-nest-dummy-a #x4000))) - (set! (-> self dummy) - (the-as - (pointer swamp-rat-nest-dummy) - (when gp-0 - (let ((t9-1 (method-of-type swamp-rat-nest-dummy-a activate))) - (t9-1 (the-as swamp-rat-nest-dummy-a gp-0) self 'swamp-rat-nest-dummy-a (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 swamp-rat-nest-dummy-init-by-other self) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self dummy) + (process-spawn swamp-rat-nest-dummy-a :init swamp-rat-nest-dummy-init-by-other self :to self) + ) ) ((= v1-1 1) - (let ((gp-1 (get-process *default-dead-pool* swamp-rat-nest-dummy-b #x4000))) - (set! (-> self dummy) - (the-as - (pointer swamp-rat-nest-dummy) - (when gp-1 - (let ((t9-4 (method-of-type swamp-rat-nest-dummy-b activate))) - (t9-4 (the-as swamp-rat-nest-dummy-b gp-1) self 'swamp-rat-nest-dummy-b (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 swamp-rat-nest-dummy-init-by-other self) - (-> gp-1 ppointer) - ) - ) - ) - ) + (set! (-> self dummy) + (process-spawn swamp-rat-nest-dummy-b :init swamp-rat-nest-dummy-init-by-other self :to self) + ) ) ((= v1-1 2) - (let ((gp-2 (get-process *default-dead-pool* swamp-rat-nest-dummy-c #x4000))) - (set! (-> self dummy) - (the-as - (pointer swamp-rat-nest-dummy) - (when gp-2 - (let ((t9-7 (method-of-type swamp-rat-nest-dummy-c activate))) - (t9-7 (the-as swamp-rat-nest-dummy-c gp-2) self 'swamp-rat-nest-dummy-c (the-as pointer #x70004000)) - ) - (run-now-in-process gp-2 swamp-rat-nest-dummy-init-by-other self) - (-> gp-2 ppointer) - ) - ) - ) - ) + (set! (-> self dummy) + (process-spawn swamp-rat-nest-dummy-c :init swamp-rat-nest-dummy-init-by-other self :to self) + ) ) (else (go swamp-rat-nest-die) @@ -1051,21 +908,18 @@ swamp-rat-nest-default-event-handler ) (defstate swamp-rat-nest-idle (swamp-rat-nest) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hit) (go swamp-rat-nest-active) ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= (-> self fact-override idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)) ) @@ -1074,28 +928,23 @@ swamp-rat-nest-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (swamp-rat-nest-check-dummy) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest) #f) + :post (the-as (function none :behavior swamp-rat-nest) #f) ) (defstate swamp-rat-nest-active (swamp-rat-nest) - :event - swamp-rat-nest-default-event-handler - :enter - (behavior () + :event swamp-rat-nest-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (swamp-rat-nest-check-dummy) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self test-interval)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1116,27 +965,22 @@ swamp-rat-nest-default-event-handler ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest) #f) + :post (the-as (function none :behavior swamp-rat-nest) #f) ) (defstate swamp-rat-nest-gestate (swamp-rat-nest) - :event - swamp-rat-nest-default-event-handler - :enter - (behavior () + :event swamp-rat-nest-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (swamp-rat-nest-check-dummy) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the int (* (-> self spawn-period-scale) (-> self spawn-period))) @@ -1147,22 +991,18 @@ swamp-rat-nest-default-event-handler ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest) #f) + :post (the-as (function none :behavior swamp-rat-nest) #f) ) (defstate swamp-rat-nest-victory (swamp-rat-nest) - :event - (the-as (function process int symbol event-message-block object :behavior swamp-rat-nest) #f) - :code - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior swamp-rat-nest) #f) + :code (behavior () (let ((gp-0 (the-as (pointer process-tree) (-> self child-process)))) (while gp-0 (let* ((s5-0 (ppointer->process gp-0)) @@ -1181,15 +1021,12 @@ swamp-rat-nest-default-event-handler (go swamp-rat-nest-active) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest) #f) + :post (the-as (function none :behavior swamp-rat-nest) #f) ) (defstate swamp-rat-nest-die (swamp-rat-nest) - :event - swamp-rat-nest-default-event-handler - :code - (behavior () + :event swamp-rat-nest-default-event-handler + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) (process-entity-status! self (entity-perm-status dead) #t) (drop-pickup (-> self fact-override) #t *entity-pool* (-> self fact-override) 0) @@ -1198,8 +1035,7 @@ swamp-rat-nest-default-event-handler ) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest) #f) + :post (the-as (function none :behavior swamp-rat-nest) #f) ) (defmethod init-from-entity! swamp-rat-nest ((obj swamp-rat-nest) (arg0 entity-actor)) @@ -1232,29 +1068,20 @@ swamp-rat-nest-default-event-handler (none) ) -(defskelgroup *swamp-rat-nest-dummy-a-sg* swamp-rat-nest - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *swamp-rat-nest-dummy-a-sg* swamp-rat-nest swamp-rat-nest-a-lod0-jg swamp-rat-nest-a-idle-ja + ((swamp-rat-nest-a-lod0-mg (meters 20)) (swamp-rat-nest-a-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) -(defskelgroup *swamp-rat-nest-dummy-b-sg* swamp-rat-nest - 4 - 7 - ((5 (meters 20)) (6 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *swamp-rat-nest-dummy-b-sg* swamp-rat-nest swamp-rat-nest-b-lod0-jg swamp-rat-nest-b-idle-ja + ((swamp-rat-nest-b-lod0-mg (meters 20)) (swamp-rat-nest-b-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) -(defskelgroup *swamp-rat-nest-dummy-c-sg* swamp-rat-nest - 8 - 11 - ((9 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *swamp-rat-nest-dummy-c-sg* swamp-rat-nest swamp-rat-nest-c-lod0-jg swamp-rat-nest-c-idle-ja + ((swamp-rat-nest-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) (defmethod dummy-20 swamp-rat-nest-dummy-a ((obj swamp-rat-nest-dummy-a)) (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) diff --git a/goal_src/levels/swamp/swamp-rat.gc b/goal_src/levels/swamp/swamp-rat.gc index c691e60c73..cd780d4379 100644 --- a/goal_src/levels/swamp/swamp-rat.gc +++ b/goal_src/levels/swamp/swamp-rat.gc @@ -10,6 +10,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/swamp-rat-ag.gc") + (deftype swamp-rat (nav-enemy) ((up-vector vector :inline :offset-assert 400) (state-float float :offset-assert 416) @@ -33,13 +35,11 @@ ) -(defskelgroup *swamp-rat-sg* swamp-rat - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 4) - :longest-edge (meters 1) - ) +(defskelgroup *swamp-rat-sg* swamp-rat swamp-rat-lod0-jg swamp-rat-idle-ja + ((swamp-rat-lod0-mg (meters 20)) (swamp-rat-lod1-mg (meters 40)) (swamp-rat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 4) + :longest-edge (meters 1) + ) (defmethod dummy-44 swamp-rat ((obj swamp-rat) (arg0 process) (arg1 event-message-block)) (when ((method-of-type touching-shapes-entry prims-touching?) @@ -77,7 +77,7 @@ swamp-rat-default-event-handler (defmethod common-post swamp-rat ((obj swamp-rat)) - (when (logtest? (-> obj collide-info status) 1) + (when (logtest? (-> obj collide-info status) (cshape-moving-flags onsurf)) (vector-deg-seek (-> obj up-vector) (-> obj up-vector) (-> obj collide-info surface-normal) 910.2222) (vector-normalize! (-> obj up-vector) 1.0) ) @@ -113,10 +113,8 @@ swamp-rat-default-event-handler (defstate nav-enemy-idle (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :post - (behavior () + :event swamp-rat-default-event-handler + :post (behavior () (ja-post) (none) ) @@ -124,36 +122,17 @@ swamp-rat-default-event-handler (defstate nav-enemy-patrol (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :code - (behavior () + :event swamp-rat-default-event-handler + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-1 param 1) f30-0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) f30-0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -163,36 +142,17 @@ swamp-rat-default-event-handler (defstate nav-enemy-notice (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 51) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> gp-0 param 0) (ja-aframe 30.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + :event swamp-rat-default-event-handler + :code (behavior () + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.17)) + (ja-no-eval :group! swamp-rat-notice-ja :num! (seek! (ja-aframe 30.0 0)) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 30.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-seek!) + (ja :num! (seek! (ja-aframe 30.0 0))) ) + (ja-no-eval :num! (seek!)) (go-virtual nav-enemy-chase) (none) ) @@ -234,46 +194,32 @@ swamp-rat-default-event-handler (defstate nav-enemy-chase (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :trans - (behavior () + :event swamp-rat-default-event-handler + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self chase-rest-time)) (go-virtual nav-enemy-victory) ) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self target-nav-time) (-> *display* base-frame-counter)) (set! (-> self wiggle-time) (+ (-> *display* base-frame-counter) (seconds -10))) (set! (-> self wiggle-angle) 0.0) (set! (-> self chase-rest-time) (rand-vu-int-range (seconds 1) (seconds 4))) - (ja-channel-push! 1 51) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 9)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (ja-channel-push! 1 (seconds 0.17)) + (ja :group! swamp-rat-run-ja :num! min) + (loop (when (>= (- (-> *display* base-frame-counter) (-> self wiggle-time)) (seconds 1)) (set! (-> self wiggle-time) (-> *display* base-frame-counter)) (swamp-rat-update-wiggle-params) ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (behavior () + :post (behavior () (swamp-rat-update-wiggle-target (target-pos 0)) (nav-enemy-travel-post) (none) @@ -282,54 +228,32 @@ swamp-rat-default-event-handler (defstate nav-enemy-stop-chase (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :code - (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) + :event swamp-rat-default-event-handler + :code (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) ) (defstate nav-enemy-stare (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :code - (behavior () + :event swamp-rat-default-event-handler + :code (behavior () (set! (-> self rotate-speed) 1456355.5) - (set! (-> self turn-time) (seconds 0.07333333)) + (set! (-> self turn-time) (seconds 0.075)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) - (while #t - (logior! (-> self nav-enemy-flags) 16) - (ja-channel-push! 1 30) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (loop + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! swamp-rat-celebrate-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (ja-no-eval :num! (loop!)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((gp-0 (rand-vu-int-range 300 600)) (s5-0 (-> *display* base-frame-counter)) ) (until (>= (- (-> *display* base-frame-counter) s5-0) gp-0) - (let ((v1-33 (-> self skel root-channel 0))) - (set! (-> v1-33 num-func) num-func-identity) - (set! (-> v1-33 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (ja-blend-eval) (suspend) (suspend) @@ -343,39 +267,17 @@ swamp-rat-default-event-handler (defstate nav-enemy-give-up (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :code - (behavior () - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :event swamp-rat-default-event-handler + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! swamp-rat-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! swamp-rat-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek-to-point-toward-point! (-> self collide-info) @@ -384,11 +286,7 @@ swamp-rat-default-event-handler (-> self turn-time) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) (none) @@ -397,27 +295,13 @@ swamp-rat-default-event-handler (defstate nav-enemy-attack (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :code - (behavior () - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :event swamp-rat-default-event-handler + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! swamp-rat-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-victory) (none) @@ -426,17 +310,13 @@ swamp-rat-default-event-handler (defstate nav-enemy-victory (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :code - (-> (method-of-type nav-enemy nav-enemy-victory) code) + :event swamp-rat-default-event-handler + :code (-> (method-of-type nav-enemy nav-enemy-victory) code) ) (defstate swamp-rat-spawn (swamp-rat) - :event - swamp-rat-default-event-handler - :code - (behavior () + :event swamp-rat-default-event-handler + :code (behavior () (let ((gp-0 (new-stack-vector0))) (set! (-> gp-0 x) 0.0) (set! (-> gp-0 y) (- (-> *standard-dynamics* gravity-length))) @@ -444,15 +324,8 @@ swamp-rat-default-event-handler (set! (-> gp-0 w) 1.0) (let ((f30-0 0.125)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((s5-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> s5-0 frame-num) 0.0) - ) - (while #t + (ja :group! swamp-rat-fall-ja :num! min) + (loop (set! f30-0 (seek f30-0 1.5 0.1)) (vector-v++! (-> self collide-info transv) gp-0) (integrate-for-enemy-with-move-to-ground! @@ -464,7 +337,7 @@ swamp-rat-default-event-handler #f #f ) - (when (or (logtest? (-> self collide-info status) 4) + (when (or (logtest? (-> self collide-info status) (cshape-moving-flags tsurf)) (or (< (-> self collide-info trans y) (-> self min-height)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) ) @@ -473,10 +346,7 @@ swamp-rat-default-event-handler (goto cfg-13) ) (vector-float*! (-> self collide-info scale) *identity-vector* f30-0) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) ) @@ -487,22 +357,10 @@ swamp-rat-default-event-handler ) (set! (-> self collide-info transv quad) (-> *null-vector* quad)) (vector-float*! (-> self collide-info scale) *identity-vector* 1.5) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! swamp-rat-bounce-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (if (TODO-RENAME-46 self (-> self nav-info stop-chase-distance)) (go-virtual nav-enemy-chase) @@ -510,8 +368,7 @@ swamp-rat-default-event-handler ) (none) ) - :post - (the-as (function none :behavior swamp-rat) nav-enemy-simple-post) + :post (the-as (function none :behavior swamp-rat) nav-enemy-simple-post) ) (define *swamp-rat-nav-enemy-info* (new 'static 'nav-enemy-info @@ -529,11 +386,11 @@ swamp-rat-default-event-handler :run-travel-speed (meters 7) :run-rotate-speed (degrees 7999.9995) :run-acceleration (meters 1) - :run-turn-time (seconds 0.07333333) + :run-turn-time (seconds 0.075) :walk-travel-speed (meters 2) :walk-rotate-speed (degrees 7999.9995) :walk-acceleration (meters 1) - :walk-turn-time (seconds 0.07333333) + :walk-turn-time (seconds 0.075) :attack-shove-back (meters 3) :attack-shove-up (meters 2) :shadow-size (meters 1) @@ -561,7 +418,7 @@ swamp-rat-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -603,7 +460,7 @@ swamp-rat-default-event-handler (set! (-> obj reaction-time) (rand-vu-int-range (seconds 0.1) (seconds 0.8))) (set! (-> obj chase-rest-time) (seconds 1)) (set! (-> obj water) (new 'process 'water-control obj 7 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (the-as uint 2)) + (set! (-> obj water flags) (water-flags wt01)) (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) (set! (-> obj water ripple-size) 12288.0) (set! (-> obj min-height) (+ -2048.0 (-> obj water height))) diff --git a/goal_src/levels/title/title-obs.gc b/goal_src/levels/title/title-obs.gc index f68cb39c27..e6ebcdee8c 100644 --- a/goal_src/levels/title/title-obs.gc +++ b/goal_src/levels/title/title-obs.gc @@ -7,6 +7,14 @@ ;; DECOMP BEGINS +(import "goal_src/import/logo-cam-ag.gc") +(import "goal_src/import/logo-black-ag.gc") +(import "goal_src/import/logo-ag.gc") +(import "goal_src/import/logo-volumes-ag.gc") +(import "goal_src/import/ndi-cam-ag.gc") +(import "goal_src/import/ndi-ag.gc") +(import "goal_src/import/ndi-volumes-ag.gc") + (deftype logo (process-drawable) ((camera handle :offset-assert 176) (camera-anim handle :offset-assert 184) @@ -60,82 +68,54 @@ (the-as logo-slave ((method-of-type process-drawable relocate) obj arg0)) ) -(defskelgroup *logo-sg* logo - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *logo-sg* logo logo-english-lod0-jg logo-idle-ja + ((logo-english-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) -(defskelgroup *logo-japan-sg* logo - 2 - 4 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *logo-japan-sg* logo logo-japan-lod0-jg logo-idle-ja + ((logo-japan-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) -(defskelgroup *logo-volumes-sg* logo-volumes - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5.5) - :longest-edge (meters 0) - ) +(defskelgroup *logo-volumes-sg* logo-volumes logo-volumes-english-lod0-jg logo-volumes-idle-ja + ((logo-volumes-english-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + ) -(defskelgroup *logo-volumes-japan-sg* logo-volumes - 2 - 4 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 5.5) - :longest-edge (meters 0) - ) +(defskelgroup *logo-volumes-japan-sg* logo-volumes logo-volumes-japan-lod0-jg logo-volumes-idle-ja + ((logo-volumes-japan-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + ) -(defskelgroup *logo-black-sg* logo-black - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5.5) - :longest-edge (meters 0) - ) +(defskelgroup *logo-black-sg* logo-black logo-black-lod0-jg logo-black-idle-ja + ((logo-black-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + ) -(defskelgroup *logo-cam-sg* logo-cam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5.5) - :longest-edge (meters 0) - ) +(defskelgroup *logo-cam-sg* logo-cam logo-cam-lod0-jg logo-cam-idle-ja + ((logo-cam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + ) -(defskelgroup *ndi-sg* ndi - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 10 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *ndi-sg* ndi ndi-lod0-jg ndi-idle-ja + ((ndi-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 30) + ) -(defskelgroup *ndi-volumes-sg* ndi-volumes - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5.5) - :longest-edge (meters 0) - ) +(defskelgroup *ndi-volumes-sg* ndi-volumes ndi-volumes-lod0-jg ndi-volumes-idle-ja + ((ndi-volumes-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + ) -(defskelgroup *ndi-cam-sg* ndi-cam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5.5) - :longest-edge (meters 0) - ) +(defskelgroup *ndi-cam-sg* ndi-cam ndi-cam-lod0-jg ndi-cam-idle-ja + ((ndi-cam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + ) (defstate idle (logo-slave) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 uint)) (let ((v1-0 arg2)) (the-as object (cond @@ -161,10 +141,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (ja-post) - (while #t + (loop (clone-anim-once (ppointer->handle (-> self parent-process)) (the-as int (-> self draw origin-joint-index)) @@ -185,7 +164,7 @@ ) ) -(defbehavior logo-slave-init-by-other logo-slave ((arg0 entity) (arg1 skeleton-group)) +(defbehavior logo-slave-init-by-other logo-slave ((arg0 entity-actor) (arg1 skeleton-group)) (set! (-> self entity) arg0) (set! (-> self root) (new 'process 'trsqv)) (initialize-skeleton self arg1 '()) @@ -207,17 +186,15 @@ (defstate startup (logo) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'update) - (clear-pending-settings-from-process *setting-control* self 'process-mask) + (remove-setting! 'process-mask) ) ) ) ) - :exit - (behavior () + :exit (behavior () (let ((a0-0 (-> self anim))) (when (nonzero? a0-0) (ja-abort-spooled-anim a0-0 (the-as art-joint-anim #f) -1) @@ -232,8 +209,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (none-reserved? *art-control*)) (go-virtual hidden) ) @@ -242,84 +218,43 @@ ) (none) ) - :code - (behavior () + :code (behavior () (while (!= (file-status *art-control* (-> self next-anim name) 0) 'active) (set-blackout-frames (seconds 0.05)) (suspend) ) (set! (-> *setting-control* current bg-a) 1.0) - (set-setting! *setting-control* self 'bg-a 'abs 0.0 0) - (let ((gp-1 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self camera-anim) - (ppointer->handle (when gp-1 - (let ((t9-4 (method-of-type logo-slave activate))) - (t9-4 (the-as logo-slave gp-1) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 logo-slave-init-by-other (-> self entity) *logo-cam-sg*) - (-> gp-1 ppointer) - ) - ) - ) - ) - (let ((gp-2 (get-process *default-dead-pool* othercam #x4000))) - (set! (-> self camera) - (ppointer->handle - (when gp-2 - (let ((t9-7 (method-of-type othercam activate))) - (t9-7 (the-as othercam gp-2) (handle->process (-> self camera-anim)) 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-2 othercam-init-by-other (handle->process (-> self camera-anim)) 4 #t 'logo) - (-> gp-2 ppointer) - ) + (set-setting! 'bg-a 'abs 0.0 0) + (set! (-> self camera-anim) + (ppointer->handle (process-spawn logo-slave (-> self entity) *logo-cam-sg* :to self)) + ) + (set! (-> self camera) + (ppointer->handle + (process-spawn + othercam + (handle->process (-> self camera-anim)) + 4 + #t + 'logo + :to (handle->process (-> self camera-anim)) ) ) - ) + ) (send-event (handle->process (-> self camera)) 'mask 0) (case (scf-get-territory) ((2) - (let ((gp-3 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self volumes) - (ppointer->handle - (when gp-3 - (let ((t9-12 (method-of-type logo-slave activate))) - (t9-12 (the-as logo-slave gp-3) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-3 logo-slave-init-by-other (-> self entity) *logo-volumes-japan-sg*) - (-> gp-3 ppointer) - ) - ) - ) - ) + (set! (-> self volumes) + (ppointer->handle (process-spawn logo-slave (-> self entity) *logo-volumes-japan-sg* :to self)) + ) ) (else - (let ((gp-4 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self volumes) - (ppointer->handle (when gp-4 - (let ((t9-15 (method-of-type logo-slave activate))) - (t9-15 (the-as logo-slave gp-4) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-4 logo-slave-init-by-other (-> self entity) *logo-volumes-sg*) - (-> gp-4 ppointer) - ) - ) - ) - ) + (set! (-> self volumes) + (ppointer->handle (process-spawn logo-slave (-> self entity) *logo-volumes-sg* :to self)) + ) ) ) (send-event (handle->process (-> self volumes)) 'origin-joint-index 3) - (let ((gp-5 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self black) - (ppointer->handle (when gp-5 - (let ((t9-19 (method-of-type logo-slave activate))) - (t9-19 (the-as logo-slave gp-5) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-5 logo-slave-init-by-other (-> self entity) *logo-black-sg*) - (-> gp-5 ppointer) - ) - ) - ) - ) + (set! (-> self black) (ppointer->handle (process-spawn logo-slave (-> self entity) *logo-black-sg* :to self))) (send-event (handle->process (-> self black)) 'origin-joint-index 3) (set! (-> self anim) (-> self next-anim)) (set! (-> self next-anim) @@ -327,8 +262,7 @@ :name "logo-intro-2" :index 7 :parts 15 - :command-list - '((260 want-force-inside village1 #t) + :command-list '((260 want-force-inside village1 #t) (261 kill "sage-23") (261 kill "assistant-11") (261 kill "explorer-4") @@ -358,30 +292,21 @@ (the-as (function process-drawable symbol) false-func) ) (set! *spawn-actors* #f) - (push-setting! *setting-control* self 'process-mask 'set 0.0 16) - (copy-settings-from-target! *setting-control*) + (add-setting! 'process-mask 'set 0.0 (process-mask progress)) + (apply-settings *setting-control*) (deactivate (handle->process (-> self black))) (deactivate (handle->process (-> self volumes))) (send-event (ppointer->process (-> self parent)) 'wait) (send-event self 'update) (ja-channel-set! 1) - (let ((a0-60 (-> self skel root-channel 0))) - (set! (-> a0-60 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-60 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-60 param 1) 1.0) - (set! (-> a0-60 frame-num) 0.0) - (joint-control-channel-group! a0-60 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + ;; PAL patch here + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (logior! (-> self skel status) (janim-status spool)) (suspend) - (let ((a0-62 (-> self skel root-channel 0))) - (set! (-> a0-62 param 0) (the float (+ (-> a0-62 frame-group data 0 length) -1))) - (set! (-> a0-62 param 1) 1.0) - (joint-control-channel-group-eval! a0-62 (the-as art-joint-anim #f) num-func-seek!) - ) + (if (not (paused?)) + (ja :num! (seek!)) + ) ) (set! (-> self anim) (-> self next-anim)) (set! (-> self next-anim) @@ -389,8 +314,7 @@ :name "logo-loop" :index 9 :parts 17 - :command-list - '((61 kill "sage-23") + :command-list '((61 kill "sage-23") (61 kill "assistant-11") (61 kill "explorer-4") ((new 'static 'bfloat :data 61.5) kill "farmer-3") @@ -418,8 +342,7 @@ (go-virtual idle) (none) ) - :post - (behavior () + :post (behavior () (if *progress-process* (logior! (-> self draw status) (draw-status skip-bones)) (logclear! (-> self draw status) (draw-status skip-bones)) @@ -457,48 +380,35 @@ (defstate idle (logo) :virtual #t - :exit - (-> (method-of-type logo startup) exit) - :trans - (-> (method-of-type logo startup) trans) - :code - (behavior () - (while #t + :exit (-> (method-of-type logo startup) exit) + :trans (-> (method-of-type logo startup) trans) + :code (behavior () + (loop (set! (-> self anim) (-> self next-anim)) - (when (not (handle->process (-> self camera))) - (let ((gp-0 (get-process *default-dead-pool* othercam #x4000))) + (if (not (handle->process (-> self camera))) (set! (-> self camera) (ppointer->handle - (when gp-0 - (let ((t9-1 (method-of-type othercam activate))) - (t9-1 (the-as othercam gp-0) (handle->process (-> self camera-anim)) 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 othercam-init-by-other (handle->process (-> self camera-anim)) 4 #t 'logo) - (-> gp-0 ppointer) + (process-spawn + othercam + (handle->process (-> self camera-anim)) + 4 + #t + 'logo + :to (handle->process (-> self camera-anim)) ) ) ) ) - ) (set! *spawn-actors* #f) (ja-channel-set! 1) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + ;; PAL patch here + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (logior! (-> self skel status) (janim-status spool)) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (if (not (paused?)) + (ja :num! (seek!)) + ) ) (set! *spawn-actors* #t) (ja-play-spooled-anim @@ -510,21 +420,18 @@ ) (none) ) - :post - (-> (method-of-type logo startup) post) + :post (-> (method-of-type logo startup) post) ) (defstate hidden (logo) :virtual #t - :trans - (behavior () + :trans (behavior () (if (nonzero? (-> self next-anim)) (spool-push *art-control* (-> self next-anim name) 0 self -1.0) ) (none) ) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (ja-post) (let ((gp-0 *master-mode*)) @@ -532,7 +439,7 @@ (clear-rec *art-control*) (set! *master-mode* gp-0) ) - (while #t + (loop (when (and (none-reserved? *art-control*) (not (paused?))) (let ((gp-1 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 0.1)) @@ -551,19 +458,17 @@ (defstate ndi (logo) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'blackout) - (set-setting! *setting-control* self 'bg-a 'abs 1.0 0) + (set-setting! 'bg-a 'abs 1.0 0) ) ) ) ) - :enter - (behavior () - (set-setting! *setting-control* self 'bg-a 'abs 0.0 0) - (copy-settings-from-target! *setting-control*) + :enter (behavior () + (set-setting! 'bg-a 'abs 0.0 0) + (apply-settings *setting-control*) (set! (-> self state-time) (-> *display* base-frame-counter)) (if *time-of-day-proc* (set! (-> *time-of-day-proc* 0 hour) 12) @@ -571,20 +476,18 @@ (set! (-> self done?) #f) (none) ) - :exit - (behavior () + :exit (behavior () ((-> (method-of-type logo startup) exit)) - (set-blackout-frames (seconds 0.033333335)) + (set-blackout-frames (seconds 0.035)) (none) ) - :trans - (behavior () + :trans (behavior () ((-> (method-of-type logo startup) trans)) (if (and *debug-segment* (cpad-pressed? 0 start circle x) (member (level-status *level* 'village1) '(loaded active)) ) - (set-setting! *setting-control* self 'bg-a 'abs 1.0 0) + (set-setting! 'bg-a 'abs 1.0 0) ) (when (and (= (-> *setting-control* current bg-a) 1.0) (and (member (level-status *level* 'village1) '(active loaded)) @@ -612,78 +515,36 @@ ) (none) ) - :code - (behavior () + :code (behavior () (while (!= (file-status *art-control* (-> self next-anim name) 0) 'active) (set-blackout-frames (seconds 0.05)) (suspend) ) (set! (-> *setting-control* current bg-a) 1.0) - (let ((gp-1 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self camera-anim) - (ppointer->handle (when gp-1 - (let ((t9-3 (method-of-type logo-slave activate))) - (t9-3 (the-as logo-slave gp-1) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 logo-slave-init-by-other (-> self entity) *ndi-cam-sg*) - (-> gp-1 ppointer) - ) - ) - ) - ) - (let ((gp-2 (get-process *default-dead-pool* othercam #x4000))) - (set! (-> self camera) - (ppointer->handle - (when gp-2 - (let ((t9-6 (method-of-type othercam activate))) - (t9-6 (the-as othercam gp-2) (handle->process (-> self camera-anim)) 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-2 othercam-init-by-other (handle->process (-> self camera-anim)) 3 #t 'logo) - (-> gp-2 ppointer) - ) + (set! (-> self camera-anim) + (ppointer->handle (process-spawn logo-slave (-> self entity) *ndi-cam-sg* :to self)) + ) + (set! (-> self camera) + (ppointer->handle + (process-spawn + othercam + (handle->process (-> self camera-anim)) + 3 + #t + 'logo + :to (handle->process (-> self camera-anim)) ) ) - ) + ) (send-event (handle->process (-> self camera)) 'mask 0) - (let ((gp-3 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self volumes) - (ppointer->handle (when gp-3 - (let ((t9-10 (method-of-type logo-slave activate))) - (t9-10 (the-as logo-slave gp-3) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-3 logo-slave-init-by-other (-> self entity) *ndi-volumes-sg*) - (-> gp-3 ppointer) - ) - ) - ) - ) + (set! (-> self volumes) + (ppointer->handle (process-spawn logo-slave (-> self entity) *ndi-volumes-sg* :to self)) + ) (send-event (handle->process (-> self volumes)) 'origin-joint-index 3) - (let ((gp-4 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self target) - (ppointer->handle (when gp-4 - (let ((t9-14 (method-of-type logo-slave activate))) - (t9-14 (the-as logo-slave gp-4) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-4 logo-slave-init-by-other #f *jchar-sg*) - (-> gp-4 ppointer) - ) - ) - ) - ) + (set! (-> self target) (ppointer->handle (process-spawn logo-slave #f *jchar-sg* :to self))) (send-event (handle->process (-> self target)) 'blend-shape #t) (send-event (handle->process (-> self target)) 'origin-joint-index 33) - (let ((gp-5 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self sidekick) - (ppointer->handle (when gp-5 - (let ((t9-19 (method-of-type logo-slave activate))) - (t9-19 (the-as logo-slave gp-5) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-5 logo-slave-init-by-other #f *sidekick-sg*) - (-> gp-5 ppointer) - ) - ) - ) - ) + (set! (-> self sidekick) (ppointer->handle (process-spawn logo-slave #f *sidekick-sg* :to self))) (send-event (handle->process (-> self sidekick)) 'blend-shape #t) (send-event (handle->process (-> self sidekick)) 'origin-joint-index 6) (set! (-> self anim) (-> self next-anim)) @@ -695,18 +556,17 @@ (the-as (function process-drawable symbol) false-func) ) (set! (-> self done?) #t) - (set-setting! *setting-control* self 'bg-a 'abs 1.0 0) + (set-setting! 'bg-a 'abs 1.0 0) (anim-loop) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (none) ) ) -(defbehavior logo-init-by-other logo ((arg0 entity) (arg1 vector) (arg2 symbol)) +(defbehavior logo-init-by-other logo ((arg0 entity-actor) (arg1 vector) (arg2 symbol)) (stack-size-set! (-> self main-thread) 512) (logclear! (-> self mask) (process-mask progress)) (set! (-> self entity) arg0) @@ -730,8 +590,7 @@ :name "logo-intro" :index 5 :parts 3 - :command-list - '((0 want-levels title village1) + :command-list '((0 want-levels title village1) (5 display-level village1 special) (5 want-vis vi1) (5 want-force-inside village1 #t) @@ -791,17 +650,15 @@ ) (defstate target-title (target) - :event - target-generic-event-handler - :enter - (behavior () - (set-setting! *setting-control* self 'music-volume 'abs 0.0 0) - (set-setting! *setting-control* self 'sfx-volume 'abs 0.0 0) - (set-setting! *setting-control* self 'ambient-volume 'abs 0.0 0) - (set-setting! *setting-control* self 'allow-pause #f 0.0 0) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) - (set-setting! *setting-control* self 'border-mode #f 0.0 0) - (copy-settings-from-target! *setting-control*) + :event target-generic-event-handler + :enter (behavior () + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'border-mode #f 0.0 0) + (apply-settings *setting-control*) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self manipy) (the-as (pointer manipy) #f)) (ja-channel-set! 0) @@ -809,8 +666,7 @@ (send-event *camera* 'change-state cam-fixed 0) (none) ) - :exit - (behavior () + :exit (behavior () (when (not (or (= (-> self next-state name) 'target-title-play) (= (-> self next-state name) 'target-title-wait))) (if (-> self manipy) (deactivate (-> self manipy 0)) @@ -818,19 +674,32 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (hide-hud-quick) (spool-push *art-control* "ndi-intro" 0 self -1.0) - (sound-group-pause (the-as uint 2)) + ;; PAL patch here + (if *sound-player-enable* + (sound-group-pause (sound-group music)) + ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (the-as handle #f))) - (case (scf-get-territory) - ((2) - (set! gp-0 (ppointer->handle (static-screen-spawn 5 #x64900000 #x64900100 #x64900200 900 #f self))) + ;; PAL patch here + (cond + ((and (= (scf-get-territory) 2) *first-boot*) + (set! *first-boot* #f) + (set! gp-0 (ppointer->handle (static-screen-spawn + 5 + (new 'static 'texture-id :page #x649) + (new 'static 'texture-id :index #x1 :page #x649) + (new 'static 'texture-id :index #x2 :page #x649) + (seconds 3) + #f + self + ) + ) + ) ) (else (while (!= (file-status *art-control* "ndi-intro" 0) 'active) @@ -865,16 +734,16 @@ (if (zero? (-> s5-2 handle)) (set! gp-1 8) ) - (set-setting! *setting-control* self 'allow-progress #t 0.0 0) + (set-setting! 'allow-progress #t 0.0 0) (set-blackout-frames 0) (set! (-> *setting-control* default bg-a-force) 0.0) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (set! (-> *setting-control* current bg-a) 0.0) (set! (-> *setting-control* current bg-a-force) 0.0) (activate-progress *dproc* (the-as progress-screen gp-1)) ) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) - (copy-settings-from-target! *setting-control*) + (set-setting! 'allow-progress #f 0.0 0) + (apply-settings *setting-control*) (while *progress-process* (suspend) ) @@ -889,16 +758,7 @@ ) (label cfg-41) (let ((gp-3 (entity-by-name "logo-1"))) - (let* ((s5-3 (get-process *default-dead-pool* logo #x4000)) - (v1-53 (when s5-3 - (let ((t9-17 (method-of-type logo activate))) - (t9-17 (the-as logo s5-3) self 'logo (the-as pointer #x70004000)) - ) - (run-now-in-process s5-3 logo-init-by-other gp-3 (-> gp-3 extra trans) 'ndi) - (-> s5-3 ppointer) - ) - ) - ) + (let ((v1-53 (process-spawn logo gp-3 (-> gp-3 extra trans) 'ndi :to self))) (set! (-> self manipy) (the-as (pointer manipy) v1-53)) (let ((s5-4 (ppointer->handle v1-53))) (while (handle->process (the-as handle s5-4)) @@ -906,29 +766,18 @@ ) ) ) - (let ((s5-5 (get-process *default-dead-pool* logo #x4000))) - (set! (-> self manipy) - (the-as (pointer manipy) (when s5-5 - (let ((t9-20 (method-of-type logo activate))) - (t9-20 (the-as logo s5-5) self 'logo (the-as pointer #x70004000)) - ) - (run-now-in-process s5-5 logo-init-by-other gp-3 (-> gp-3 extra trans) 'logo) - (-> s5-5 ppointer) - ) - ) - ) - ) + (set! (-> self manipy) + (the-as (pointer manipy) (process-spawn logo gp-3 (-> gp-3 extra trans) 'logo :to self)) + ) ) (go target-title-play) (none) ) - :post - target-no-move-post + :post target-no-move-post ) (defstate target-title-play (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'wait) @@ -944,25 +793,19 @@ ) ) ) - :enter - (behavior () - (set-setting! *setting-control* self 'allow-pause #f 0.0 0) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) + :enter (behavior () + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (none) ) - :exit - (-> target-title exit) - :trans - (the-as (function none :behavior target) hide-hud-quick) - :code - (the-as (function none :behavior target) anim-loop) - :post - target-no-move-post + :exit (-> target-title exit) + :trans (the-as (function none :behavior target) hide-hud-quick) + :code (the-as (function none :behavior target) anim-loop) + :post target-no-move-post ) (defstate target-title-wait (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'play) @@ -978,35 +821,39 @@ ) ) ) - :enter - (behavior () - (clear-pending-settings-from-process *setting-control* self 'ambient-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'allow-progress) - (sound-group-continue (the-as uint 2)) + :enter (behavior () + (remove-setting! 'ambient-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'music-volume) + ;; PAL patch here (code removal) + (sound-group-continue (sound-group music)) (when *time-of-day-proc* (set! (-> *time-of-day-proc* 0 time-ratio) 18000.0) (set! *time-of-day-fast* #t) ) (none) ) - :exit - (behavior () + :exit (behavior () (when *time-of-day-proc* (set! (-> *time-of-day-proc* 0 time-ratio) 300.0) (set! *time-of-day-fast* #f) ) - (clear-pending-settings-from-process *setting-control* self 'allow-pause) + ;; PAL patch here + (remove-setting! 'allow-pause) + (remove-setting! 'allow-progress) ((-> target-title exit)) (none) ) - :trans - (behavior () + :trans (behavior () (hide-hud-quick) - (if (cpad-pressed? 0 start) - (activate-progress *dproc* (progress-screen title)) - ) + ;; PAL patch here + (when (cpad-pressed? 0 start) + (set-setting! 'allow-progress #t 0.0 0) + (apply-settings *setting-control*) + (activate-progress *dproc* (progress-screen title)) + (set-setting! 'allow-progress #f 0.0 0) + (apply-settings *setting-control*) + ) (when (and (< (mod (-> *display* real-frame-counter) 300) 270) (not *progress-process*)) (let ((gp-0 (new 'stack 'font-context *font-default-matrix* 80 170 0.0 (font-color default) (font-flags shadow kerning)) @@ -1024,10 +871,8 @@ ) (none) ) - :code - (the-as (function none :behavior target) anim-loop) - :post - target-no-move-post + :code (the-as (function none :behavior target) anim-loop) + :post target-no-move-post ) diff --git a/goal_src/levels/training/training-obs.gc b/goal_src/levels/training/training-obs.gc index 4e0db4d37a..40ae53f4d0 100644 --- a/goal_src/levels/training/training-obs.gc +++ b/goal_src/levels/training/training-obs.gc @@ -7,6 +7,12 @@ ;; DECOMP BEGINS +(import "goal_src/import/scarecrow-b-ag.gc") +(import "goal_src/import/pontoonfive-ag.gc") +(import "goal_src/import/trainingcam-ag.gc") +(import "goal_src/import/scarecrow-a-ag.gc") +(import "goal_src/import/jng-iris-door-ag.gc") + (deftype training-water (water-anim) () :heap-base #x70 @@ -20,8 +26,7 @@ :count 3 :converted #f :normal-scale 1.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 40.0 :xdiv -1 :zdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75) @@ -45,13 +50,10 @@ (none) ) -(defskelgroup *training-cam-sg* trainingcam - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 80) - :longest-edge (meters 0) - ) +(defskelgroup *training-cam-sg* trainingcam trainingcam-lod0-jg -1 + ((trainingcam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) (deftype training-cam (process) ((root trsq :offset-assert 112) @@ -78,9 +80,8 @@ (defstate idle (training-cam) :virtual #t - :code - (behavior () - (while #t + :code (behavior () + (loop (when (and *target* (< (vector-vector-distance (target-pos 0) (-> self root trans)) (-> self range)) (-> *setting-control* current play-hints) @@ -92,8 +93,8 @@ ) (when (!= (-> self index) 6) (while (and *target* - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) (suspend) ) @@ -106,15 +107,15 @@ ) ) ) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (let* ((a0-15 *setting-control*) - (t9-6 (method-of-object a0-15 set-setting!)) + (t9-6 (method-of-object a0-15 set-setting)) (a2-3 'movie) (a3-1 (process->ppointer self)) ) - (t9-6 a0-15 self a2-3 (the-as symbol a3-1) 0.0 0) + (t9-6 a0-15 self a2-3 a3-1 0.0 0) ) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (dotimes (gp-1 2) (while (or (-> *setting-control* current talking) (-> *setting-control* current spooling) @@ -128,8 +129,8 @@ (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (suspend) ) - (clear-pending-settings-from-process *setting-control* self 'movie) - (copy-settings-from-target! *setting-control*) + (remove-setting! 'movie) + (apply-settings *setting-control*) (suspend) (suspend) ) @@ -146,24 +147,7 @@ *entity-pool* (game-task none) ) - (let ((gp-2 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-2 - (let ((t9-13 (method-of-type pov-camera activate))) - (t9-13 (the-as pov-camera gp-2) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - pov-camera-init-by-other - (-> self entity extra trans) - *training-cam-sg* - "orbcam" - 0 - #f - '() - ) - (-> gp-2 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "orbcam" 0 #f '() :to self) ) ((= v1-61 1) (level-hint-spawn @@ -173,24 +157,7 @@ *entity-pool* (game-task none) ) - (let ((gp-3 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-3 - (let ((t9-17 (method-of-type pov-camera activate))) - (t9-17 (the-as pov-camera gp-3) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-3 - pov-camera-init-by-other - (-> self entity extra trans) - *training-cam-sg* - "fuelcellcam" - 0 - #f - '() - ) - (-> gp-3 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "fuelcellcam" 0 #f '() :to self) ) ((= v1-61 2) (level-hint-spawn @@ -200,24 +167,7 @@ *entity-pool* (game-task none) ) - (let ((gp-4 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-4 - (let ((t9-21 (method-of-type pov-camera activate))) - (t9-21 (the-as pov-camera gp-4) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-4 - pov-camera-init-by-other - (-> self entity extra trans) - *training-cam-sg* - "ecocam" - 0 - #f - '() - ) - (-> gp-4 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "ecocam" 0 #f '() :to self) ) ((= v1-61 3) (level-hint-spawn @@ -227,24 +177,7 @@ *entity-pool* (game-task none) ) - (let ((gp-5 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-5 - (let ((t9-25 (method-of-type pov-camera activate))) - (t9-25 (the-as pov-camera gp-5) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-5 - pov-camera-init-by-other - (-> self entity extra trans) - *training-cam-sg* - "precursordoorcam" - 0 - #f - '() - ) - (-> gp-5 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "precursordoorcam" 0 #f '() :to self) ) ((= v1-61 4) (level-hint-spawn @@ -254,24 +187,7 @@ *entity-pool* (game-task none) ) - (let ((gp-6 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-6 - (let ((t9-29 (method-of-type pov-camera activate))) - (t9-29 (the-as pov-camera gp-6) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-6 - pov-camera-init-by-other - (-> self entity extra trans) - *training-cam-sg* - "ecoventcam" - 0 - #f - '() - ) - (-> gp-6 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "ecoventcam" 0 #f '() :to self) ) ((= v1-61 5) (level-hint-spawn @@ -281,24 +197,7 @@ *entity-pool* (game-task none) ) - (let ((gp-7 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-7 - (let ((t9-33 (method-of-type pov-camera activate))) - (t9-33 (the-as pov-camera gp-7) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-7 - pov-camera-init-by-other - (-> self entity extra trans) - *training-cam-sg* - "greenecocam" - 0 - #f - '() - ) - (-> gp-7 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "greenecocam" 0 #f '() :to self) ) ((= v1-61 6) (when (not (task-complete? *game-info* (game-task training-climb))) @@ -412,13 +311,10 @@ ) ) -(defskelgroup *tra-pontoon-sg* pontoonfive - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *tra-pontoon-sg* pontoonfive pontoonfive-lod0-jg pontoonfive-idle-ja + ((pontoonfive-lod0-mg (meters 20)) (pontoonfive-lod1-mg (meters 40)) (pontoonfive-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) (defmethod TODO-RENAME-30 tra-pontoon ((obj tra-pontoon)) (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) @@ -489,13 +385,10 @@ ) -(defskelgroup *tra-iris-door-sg* jng-iris-door - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *tra-iris-door-sg* jng-iris-door jng-iris-door-lod0-jg jng-iris-door-idle-ja + ((jng-iris-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) (defmethod TODO-RENAME-24 tra-iris-door ((obj tra-iris-door)) (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) @@ -529,13 +422,11 @@ :id 143 :duration 15 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2912) (sp-item 2913) (sp-item 2914) (sp-item 2915) (sp-item 2916)) + :parts ((sp-item 2912) (sp-item 2913) (sp-item 2914) (sp-item 2915) (sp-item 2916)) ) (defpart 2912 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 2.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -561,18 +452,15 @@ ) (defpart 2917 - :init-specs - ((sp-flt spt-fade-a -0.4) (sp-int-plain-rnd spt-next-time 30 29 1) (sp-launcher-by-id spt-next-launcher 2918)) + :init-specs ((sp-flt spt-fade-a -0.4) (sp-int-plain-rnd spt-next-time 30 29 1) (sp-launcher-by-id spt-next-launcher 2918)) ) (defpart 2918 - :init-specs - ((sp-flt spt-fade-a -0.04)) + :init-specs ((sp-flt spt-fade-a -0.04)) ) (defpart 2913 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 2.5)) (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) @@ -596,13 +484,11 @@ ) (defpart 2919 - :init-specs - ((sp-flt spt-fade-a -2.1333334)) + :init-specs ((sp-flt spt-fade-a -2.1333334)) ) (defpart 2914 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 2.5) (sp-flt spt-y (meters 1.5)) (sp-flt spt-scale-x (meters 12)) @@ -618,8 +504,7 @@ ) (defpart 2915 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x2)) (sp-rnd-flt spt-num 8.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 2.5) (meters 1.5) 1.0) @@ -647,16 +532,14 @@ ) (defpart 2920 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0033333334)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0033333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -3.4) ) ) (defpart 2916 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) (sp-rnd-flt spt-num 8.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 2.5) (meters 1.5) 1.0) @@ -687,16 +570,14 @@ :id 144 :duration 15 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2912)) + :parts ((sp-item 2912)) ) (defpartgroup group-scarecrow-hit :id 145 :duration 15 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2913)) + :parts ((sp-item 2913)) ) (deftype scarecrow-a (process-drawable) @@ -731,26 +612,19 @@ ) -(defskelgroup *scarecrow-a-sg* scarecrow-a - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 2.5 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *scarecrow-a-sg* scarecrow-a scarecrow-a-lod0-jg scarecrow-a-idle-ja + ((scarecrow-a-lod0-mg (meters 20)) (scarecrow-a-lod1-mg (meters 40)) (scarecrow-a-lod2-mg (meters 999999))) + :bounds (static-spherem 0 2.5 0 3) + ) -(defskelgroup *scarecrow-a-break-sg* scarecrow-a - 0 - 5 - ((4 (meters 999999))) - :bounds (static-spherem 0 -15 0 50) - :longest-edge (meters 0) - ) +(defskelgroup *scarecrow-a-break-sg* scarecrow-a scarecrow-a-lod0-jg scarecrow-a-idle-ja + ((scarecrow-a-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -15 0 50) + ) (defstate idle (scarecrow-a) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -811,19 +685,21 @@ (get-middle-of-bsphere-overlap a0-24 (-> self intersection)) (target-pos 0) ) - (the-as symbol (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 2) - ) - (or (= (-> self type) scarecrow-a) - (and (= (-> arg0 type) target) - (logtest? (-> (the-as target arg0) control unknown-surface00 flags) 2048) - (zero? (logand (-> (the-as target arg0) control status) 1)) - ) - ) - ) + (the-as + symbol + (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 2) ) + (or (= (-> self type) scarecrow-a) + (and (= (-> arg0 type) target) + (logtest? (-> (the-as target arg0) control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> (the-as target arg0) control status) (cshape-moving-flags onsurf))) + ) + ) + ) + ) ) ) ) @@ -843,104 +719,52 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (get-reminder (get-task-control (game-task training-gimmie)) 0) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 36) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.12)) + (loop + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior scarecrow-a) ja-post) + :post (the-as (function none :behavior scarecrow-a) ja-post) ) (defstate hit (scarecrow-a) :virtual #t - :code - (behavior ((arg0 float) (arg1 vector) (arg2 symbol)) + :code (behavior ((arg0 float) (arg1 vector) (arg2 symbol)) (when (not arg2) (dummy-10 (-> self skel effect) 'group-scarecrow-hit 4.0 -1) - (ja-channel-push! 1 21) + (ja-channel-push! 1 (seconds 0.07)) (cond ((< (fabs arg0) 8192.0) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((and (< 8192.0 arg0) (< arg0 24576.0)) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -950,7 +774,7 @@ (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 12.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 20.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-explode 4.0 -1) - (sound-play-by-name (static-sound-name "break-dummy") (new-sound-id) 1024 0 0 1 #t) + (sound-play "break-dummy") (ja-channel-set! 0) (let ((s5-2 (new 'stack 'joint-exploder-tuning 1))) (set! (-> s5-2 duration) (seconds 1.5)) @@ -960,38 +784,26 @@ (set! (-> s5-2 fountain-rand-transv-hi z) 20480.0) (set! (-> s5-2 fountain-rand-transv-hi w) 49152.0) (set! (-> s5-2 fountain-rand-transv-lo quad) (-> arg1 quad)) - (let ((gp-1 (get-process *default-dead-pool* joint-exploder #x4000))) - (when gp-1 - (let ((t9-21 (method-of-type joint-exploder activate))) - (t9-21 (the-as joint-exploder gp-1) self 'joint-exploder (the-as pointer #x70004000)) + (process-spawn + joint-exploder + *scarecrow-a-break-sg* + 5 + s5-2 + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 10) + (new 'static 'joint-exploder-static-joint-params :joint-index 20) + (new 'static 'joint-exploder-static-joint-params :joint-index 4) + (new 'static 'joint-exploder-static-joint-params :joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 11) + (new 'static 'joint-exploder-static-joint-params :joint-index 9) + (new 'static 'joint-exploder-static-joint-params :joint-index 7) + (new 'static 'joint-exploder-static-joint-params :joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 13) ) - (run-now-in-process - gp-1 - joint-exploder-init-by-other - *scarecrow-a-break-sg* - 5 - s5-2 - (new 'static 'joint-exploder-static-params - :joints - (new - 'static - 'boxed-array - :type joint-exploder-static-joint-params :length 10 :allocated-length 10 - (new 'static 'joint-exploder-static-joint-params :joint-index 12) - (new 'static 'joint-exploder-static-joint-params :joint-index 10) - (new 'static 'joint-exploder-static-joint-params :joint-index 20) - (new 'static 'joint-exploder-static-joint-params :joint-index 4) - (new 'static 'joint-exploder-static-joint-params :joint-index 5) - (new 'static 'joint-exploder-static-joint-params :joint-index 11) - (new 'static 'joint-exploder-static-joint-params :joint-index 9) - (new 'static 'joint-exploder-static-joint-params :joint-index 7) - (new 'static 'joint-exploder-static-joint-params :joint-index 14) - (new 'static 'joint-exploder-static-joint-params :joint-index 13) - ) - ) - ) - (-> gp-1 ppointer) ) + :to self ) ) (while (-> self child) @@ -1000,8 +812,7 @@ (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior scarecrow-a) ja-post) + :post (the-as (function none :behavior scarecrow-a) ja-post) ) (defmethod init-from-entity! scarecrow-a ((obj scarecrow-a) (arg0 entity-actor)) @@ -1039,117 +850,59 @@ (none) ) -(defskelgroup *scarecrow-b-sg* scarecrow-b - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 3.5 0 3.8) - :longest-edge (meters 0) - ) +(defskelgroup *scarecrow-b-sg* scarecrow-b scarecrow-b-lod0-jg scarecrow-b-idle-ja + ((scarecrow-b-lod0-mg (meters 20)) (scarecrow-b-lod1-mg (meters 40)) (scarecrow-b-lod2-mg (meters 999999))) + :bounds (static-spherem 0 3.5 0 3.8) + ) -(defskelgroup *scarecrow-b-break-sg* scarecrow-b - 0 - 5 - ((4 (meters 999999))) - :bounds (static-spherem 0 -15 0 50) - :longest-edge (meters 0) - ) +(defskelgroup *scarecrow-b-break-sg* scarecrow-b scarecrow-b-lod0-jg scarecrow-b-idle-ja + ((scarecrow-b-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -15 0 50) + ) (defstate idle (scarecrow-b) :virtual #t - :event - (-> (method-of-type scarecrow-a idle) event) - :code - (behavior () - (ja-channel-push! 1 36) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :event (-> (method-of-type scarecrow-a idle) event) + :code (behavior () + (ja-channel-push! 1 (seconds 0.12)) + (loop + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior scarecrow-b) ja-post) + :post (the-as (function none :behavior scarecrow-b) ja-post) ) (defstate hit (scarecrow-b) :virtual #t - :code - (behavior ((arg0 float) (arg1 vector) (arg2 symbol)) + :code (behavior ((arg0 float) (arg1 vector) (arg2 symbol)) (when (not arg2) (dummy-10 (-> self skel effect) 'group-scarecrow-hit 4.0 -1) - (ja-channel-push! 1 21) + (ja-channel-push! 1 (seconds 0.07)) (cond ((< (fabs arg0) 8192.0) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((and (< 8192.0 arg0) (< arg0 24576.0)) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -1159,7 +912,7 @@ (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 12.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 21.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-explode 4.0 -1) - (sound-play-by-name (static-sound-name "break-dummy") (new-sound-id) 1024 0 0 1 #t) + (sound-play "break-dummy") (ja-channel-set! 0) (let ((s5-2 (new 'stack 'joint-exploder-tuning 1))) (set! (-> s5-2 duration) (seconds 1.5)) @@ -1168,42 +921,30 @@ (set! (-> s5-2 fountain-rand-transv-hi z) 40960.0) (set! (-> s5-2 fountain-rand-transv-hi w) 102400.0) (set! (-> s5-2 fountain-rand-transv-lo quad) (-> arg1 quad)) - (let ((gp-1 (get-process *default-dead-pool* joint-exploder #x4000))) - (when gp-1 - (let ((t9-21 (method-of-type joint-exploder activate))) - (t9-21 (the-as joint-exploder gp-1) self 'joint-exploder (the-as pointer #x70004000)) + (process-spawn + joint-exploder + *scarecrow-b-break-sg* + 5 + s5-2 + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 10) + (new 'static 'joint-exploder-static-joint-params :joint-index 21) + (new 'static 'joint-exploder-static-joint-params :joint-index 4) + (new 'static 'joint-exploder-static-joint-params :joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 11) + (new 'static 'joint-exploder-static-joint-params :joint-index 9) + (new 'static 'joint-exploder-static-joint-params :joint-index 7) + (new 'static 'joint-exploder-static-joint-params :joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 16) + (new 'static 'joint-exploder-static-joint-params :joint-index 15) ) - (run-now-in-process - gp-1 - joint-exploder-init-by-other - *scarecrow-b-break-sg* - 5 - s5-2 - (new 'static 'joint-exploder-static-params - :joints - (new - 'static - 'boxed-array - :type joint-exploder-static-joint-params :length 14 :allocated-length 14 - (new 'static 'joint-exploder-static-joint-params :joint-index 12) - (new 'static 'joint-exploder-static-joint-params :joint-index 10) - (new 'static 'joint-exploder-static-joint-params :joint-index 21) - (new 'static 'joint-exploder-static-joint-params :joint-index 4) - (new 'static 'joint-exploder-static-joint-params :joint-index 5) - (new 'static 'joint-exploder-static-joint-params :joint-index 11) - (new 'static 'joint-exploder-static-joint-params :joint-index 9) - (new 'static 'joint-exploder-static-joint-params :joint-index 7) - (new 'static 'joint-exploder-static-joint-params :joint-index 14) - (new 'static 'joint-exploder-static-joint-params :joint-index 13) - (new 'static 'joint-exploder-static-joint-params :joint-index 14) - (new 'static 'joint-exploder-static-joint-params :joint-index 13) - (new 'static 'joint-exploder-static-joint-params :joint-index 16) - (new 'static 'joint-exploder-static-joint-params :joint-index 15) - ) - ) - ) - (-> gp-1 ppointer) ) + :to self ) ) (while (-> self child) @@ -1212,8 +953,7 @@ (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior scarecrow-b) ja-post) + :post (the-as (function none :behavior scarecrow-b) ja-post) ) (defmethod init-from-entity! scarecrow-b ((obj scarecrow-b) (arg0 entity-actor)) diff --git a/goal_src/levels/training/training-part.gc b/goal_src/levels/training/training-part.gc index 4bb664239e..b999b2d384 100644 --- a/goal_src/levels/training/training-part.gc +++ b/goal_src/levels/training/training-part.gc @@ -20,8 +20,7 @@ :id 146 :flags (always-draw) :bounds (static-bspherem 0 32 0 70) - :parts - ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 4500) + :parts ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 4500) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1140 :offset 4530) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1080 :offset 4560) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1020 :offset 4590) @@ -54,8 +53,7 @@ :id 147 :flags (always-draw) :bounds (static-bspherem 0 32 0 70) - :parts - ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 900) + :parts ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 900) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1140 :offset 930) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1080 :offset 960) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1020 :offset 990) @@ -88,8 +86,7 @@ :id 149 :flags (always-draw) :bounds (static-bspherem 0 32 0 70) - :parts - ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 2100) + :parts ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 2100) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1140 :offset 2130) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1080 :offset 2160) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1020 :offset 2190) @@ -114,8 +111,7 @@ :id 148 :flags (always-draw) :bounds (static-bspherem 0 32 0 70) - :parts - ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 3300) + :parts ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 3300) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1140 :offset 3330) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1080 :offset 3360) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1020 :offset 3390) @@ -145,19 +141,9 @@ ) (defpart 752 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.2) - (sp-sound (new 'static 'sound-spec - :mask #xc0 - :num 0.1 - :group #x1 - :sound-name (static-sound-name "geyser") - :volume #x400 - :fo-min 50 - :fo-max #xc8 - ) - ) + (sp-sound (static-sound-spec "geyser" :num 0.1 :fo-min 50 :fo-max 200)) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-flt spt-y (meters -8)) (sp-flt spt-scale-x (meters 8)) @@ -181,13 +167,11 @@ ) (defpart 761 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.06666667)) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.06666667)) (sp-flt spt-fade-a -1.0666667)) ) (defpart 753 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 85) (meters 10) 1.0) @@ -219,8 +203,7 @@ ) (defpart 762 - :init-specs - ((sp-flt spt-fade-a -0.03678161)) + :init-specs ((sp-flt spt-fade-a -0.03678161)) ) (defun check-drop-level-training-mist ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) @@ -232,8 +215,7 @@ ) (defpart 754 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.035) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 85) (meters 10) 1.0) @@ -265,8 +247,7 @@ ) (defpart 763 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-int spt-num 0 1 1.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -285,8 +266,7 @@ ) (defpart 764 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.02)) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -309,38 +289,19 @@ (when (< (-> arg2 y) (-> arg1 user-float)) (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (if (< (+ -1.0 (the-as float v1-2)) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) - ) - ) + (if (< (rand-float-gen) 0.25) + (sound-play "water-drop") + ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 763) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 764) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 763) gp-0) + (launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 764) gp-0) ) ) (none) ) (defpart 759 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 40) 1.0) (sp-rnd-flt spt-y (meters 10) (meters 20) 1.0) @@ -360,8 +321,7 @@ ) (defpart 760 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters 0) (meters 40) 1.0) (sp-rnd-flt spt-y (meters 10) (meters 20) 1.0) @@ -379,8 +339,7 @@ ) (defpart 757 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 40) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 8) 1.0) @@ -400,8 +359,7 @@ ) (defpart 758 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters 0) (meters 40) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 10) 1.0) @@ -419,8 +377,7 @@ ) (defpart 755 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 40) 1.0) (sp-rnd-flt spt-y (meters 10) (meters 10) 1.0) @@ -440,8 +397,7 @@ ) (defpart 756 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters 0) (meters 40) 1.0) (sp-rnd-flt spt-y (meters 10) (meters 20) 1.0) @@ -461,8 +417,7 @@ (defpartgroup group-training-warpgate :id 150 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 767 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 767 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 768 :fade-after (meters 60) :falloff-to (meters 100) :binding 765) (sp-item 765 :flags (bit1 start-dead launch-asap)) (sp-item 765 :flags (bit1 start-dead launch-asap)) @@ -638,8 +593,7 @@ ) (defpart 770 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-x (meters 0)) (sp-flt spt-scale-x (meters 5)) @@ -656,8 +610,7 @@ ) (defpart 769 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters -2)) (sp-flt spt-scale-x (meters 0.25)) @@ -672,8 +625,7 @@ ) (defpart 766 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.6666667)) (sp-flt spt-y (meters 4)) @@ -696,8 +648,7 @@ ) (defpart 767 - :init-specs - ((sp-rnd-flt spt-num 3.0 3.0 1.0) + :init-specs ((sp-rnd-flt spt-num 3.0 3.0 1.0) (sp-flt spt-x (meters -0.5)) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) @@ -714,8 +665,7 @@ ) (defpart 768 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.25)) (sp-copy-from-other spt-scale-y -4) @@ -729,8 +679,7 @@ ) (defpart 765 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.6666667)) (sp-flt spt-y (meters 4)) @@ -756,8 +705,7 @@ (defpartgroup group-training-butterflies :id 151 :bounds (static-bspherem 0 0 0 30) - :parts - ((sp-item 773 :fade-after (meters 120) :period 4903 :length 5 :hour-mask #b111111100000000000111111 :binding 771) + :parts ((sp-item 773 :fade-after (meters 120) :period 4903 :length 5 :hour-mask #b111111100000000000111111 :binding 771) (sp-item 773 :fade-after (meters 120) :period 6637 :length 5 :hour-mask #b111111100000000000111111 :binding 771) (sp-item 773 :fade-after (meters 120) :period 9846 :length 5 :hour-mask #b111111100000000000111111 :binding 771) (sp-item 771 :flags (start-dead launch-asap) :binding 772) @@ -774,8 +722,7 @@ ) (defpart 773 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 7.5) 1.0) (sp-rnd-flt spt-y (meters 14) (meters 3) 1.0) @@ -794,21 +741,18 @@ ) (defpart 774 - :init-specs - ((sp-flt spt-accel-y 0.0) + :init-specs ((sp-flt spt-accel-y 0.0) (sp-int-plain-rnd spt-next-time 2700 1499 1) (sp-launcher-by-id spt-next-launcher 775) ) ) (defpart 775 - :init-specs - ((sp-flt spt-accel-y 1.3653333)) + :init-specs ((sp-flt spt-accel-y 1.3653333)) ) (defpart 771 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -831,8 +775,7 @@ ) (defpart 776 - :init-specs - ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) (sp-rnd-flt spt-vel-y (meters -0.0074074077) (meters 0.0148148155) 1.0) (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) (sp-int-plain-rnd spt-next-time 150 449 1) @@ -841,8 +784,7 @@ ) (defpart 772 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 0.9)) @@ -861,8 +803,7 @@ (defpartgroup group-training-birds :id 152 :bounds (static-bspherem 0 8 0 45) - :parts - ((sp-item 779 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 777) + :parts ((sp-item 779 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 777) (sp-item 779 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 777) (sp-item 779 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 777) (sp-item 777 :flags (start-dead launch-asap) :binding 778) @@ -884,8 +825,7 @@ ) (defpart 779 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-func spt-birth-func 'birth-func-random-next-time) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) @@ -909,8 +849,7 @@ ) (defpart 777 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-func spt-birth-func 'birth-func-copy-omega-to-z) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) @@ -935,8 +874,7 @@ ) (defpart 780 - :init-specs - ((sp-flt spt-scale-x (meters 8)) + :init-specs ((sp-flt spt-scale-x (meters 8)) (sp-flt spt-scalevel-x (meters -0.08)) (sp-int spt-timer 600) (sp-int spt-next-time 100) @@ -945,8 +883,7 @@ ) (defpart 781 - :init-specs - ((sp-flt spt-scale-x (meters 0)) + :init-specs ((sp-flt spt-scale-x (meters 0)) (sp-flt spt-scalevel-x (meters -0.04)) (sp-int spt-timer 600) (sp-int spt-next-time 199) @@ -955,8 +892,7 @@ ) (defpart 778 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-func spt-birth-func 'birth-func-copy2-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 4)) @@ -971,8 +907,7 @@ :id 153 :flags (always-draw) :bounds (static-bspherem 0 16 0 32) - :parts - ((sp-item 782 :fade-after (meters 160) :falloff-to (meters 160)) + :parts ((sp-item 782 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 783 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 784 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 785 :fade-after (meters 80) :falloff-to (meters 80)) @@ -982,23 +917,19 @@ ) (defpart 789 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) (defpart 790 - :init-specs - ((sp-flt spt-fade-a -0.16)) + :init-specs ((sp-flt spt-fade-a -0.16)) ) (defpart 791 - :init-specs - ((sp-flt spt-fade-a -2.6666667)) + :init-specs ((sp-flt spt-fade-a -2.6666667)) ) (defpart 782 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.9) (sp-rnd-flt spt-x (meters -9) (meters 1) 1.0) (sp-flt spt-y (meters 47)) @@ -1026,8 +957,7 @@ ) (defpart 783 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.9) (sp-rnd-flt spt-x (meters -9) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 39) (meters 5) 1.0) @@ -1055,8 +985,7 @@ ) (defpart 784 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2) (meters 3) 1.0) (sp-rnd-flt spt-y (meters 24) (meters 6) 1.0) @@ -1083,8 +1012,7 @@ ) (defpart 785 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -9) (meters 1) 1.0) (sp-flt spt-y (meters 47)) @@ -1110,8 +1038,7 @@ ) (defpart 786 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.4 1.0) (sp-rnd-flt spt-x (meters -7) (meters 3.5) 1.0) (sp-flt spt-y (meters 47)) @@ -1140,8 +1067,7 @@ ) (defpart 787 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.133) (sp-rnd-flt spt-x (meters 0) (meters 6) 1.0) (sp-flt spt-y (meters -3.5)) @@ -1174,8 +1100,7 @@ :id 154 :flags (always-draw) :bounds (static-bspherem 0 12 0 12) - :parts - ((sp-item 792 :fade-after (meters 160) :falloff-to (meters 160)) + :parts ((sp-item 792 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 793 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 794 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 795 :fade-after (meters 160) :falloff-to (meters 160)) @@ -1185,8 +1110,7 @@ ) (defpart 792 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -6) (meters 1) 1.0) (sp-flt spt-y (meters 15.5)) @@ -1214,8 +1138,7 @@ ) (defpart 793 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 1.4) (sp-rnd-flt spt-x (meters -4) (meters 1) 1.0) (sp-flt spt-y (meters 15.5)) @@ -1243,8 +1166,7 @@ ) (defpart 794 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.4 1.0) (sp-rnd-flt spt-x (meters -6) (meters 1) 1.0) (sp-flt spt-y (meters 15.5)) @@ -1273,8 +1195,7 @@ ) (defpart 795 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.4 1.0) (sp-rnd-flt spt-x (meters -4) (meters 1) 1.0) (sp-flt spt-y (meters 15.5)) @@ -1303,8 +1224,7 @@ ) (defpart 796 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.133) (sp-rnd-flt spt-x (meters 0) (meters 6) 1.0) (sp-flt spt-y (meters -3.5)) @@ -1334,8 +1254,7 @@ ) (defpart 797 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters 0) (meters 5) 1.0) (sp-rnd-flt spt-z (meters -8) (meters 8) 1.0) diff --git a/goal_src/levels/village1/assistant.gc b/goal_src/levels/village1/assistant.gc index 8d0e6e9996..0ffdeff23b 100644 --- a/goal_src/levels/village1/assistant.gc +++ b/goal_src/levels/village1/assistant.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/assistant-ag.gc") + (deftype assistant (process-taskable) ((sound-id sound-id :offset-assert 380) ) @@ -17,14 +19,11 @@ ) -(defskelgroup *assistant-sg* assistant - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *assistant-sg* assistant assistant-lod0-jg assistant-idle-leaning-right-ja + ((assistant-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :shadow assistant-shadow-mg + ) (defmethod dummy-52 assistant ((obj assistant)) (let ((v1-1 (-> obj draw shadow-ctrl))) @@ -39,7 +38,7 @@ ) ) 0 - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) ) ) (none) @@ -48,16 +47,19 @@ (defmethod draw-npc-shadow assistant ((obj assistant)) (-> obj draw shadow-ctrl) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -66,113 +68,102 @@ ) (defmethod play-anim! assistant ((obj assistant) (arg0 symbol)) - (with-pp - (case (current-status (-> obj tasks)) - (((task-status need-hint) (task-status need-introduction)) - (case (current-task (-> obj tasks)) - (((game-task jungle-eggtop)) - (when arg0 - (let* ((s5-1 (-> obj tasks)) - (s4-0 (method-of-object s5-1 save-reminder)) - (a1-3 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (s4-0 s5-1 (the int (the-as float (send-event-function *target* a1-3))) 1) - ) - (close-status! (-> obj tasks) (task-status need-introduction)) + (case (current-status (-> obj tasks)) + (((task-status need-hint) (task-status need-introduction)) + (case (current-task (-> obj tasks)) + (((game-task jungle-eggtop)) + (when arg0 + (let* ((s5-1 (-> obj tasks)) + (s4-0 (method-of-object s5-1 save-reminder)) + ) + (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (new 'static 'spool-anim - :name - "assistant-introduction-blue-eco-switch" - :index 10 - :parts 11 - :command-list - '((0 want-levels village1 beach) - (128 joint "cameraB") - (312 joint "camera") - (492 joint "cameraB") - (537 joint "camera") - (734 display-level beach movie) - (734 want-force-vis beach #t) - (735 alive "ecovent-48") - (742 blackout 10) - (743 joint "cameraB") - (745 blackout 0) - (839 alive "ecovent-200") - (841 joint "camera") - (842 dead "ecovent-48") - (942 blackout 10) - (944 joint "cameraB") - (945 blackout 0) - (945 dead "ecovent-200") - (945 display-level beach #f) - (1049 blackout 10) - (1051 joint "camera") - (1052 blackout 0) - (1135 blackout 10) - (1137 joint "cameraB") - (1138 blackout 0) - (1216 joint "camera") - ) + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "assistant-introduction-blue-eco-switch" + :index 10 + :parts 11 + :command-list '((0 want-levels village1 beach) + (128 joint "cameraB") + (312 joint "camera") + (492 joint "cameraB") + (537 joint "camera") + (734 display-level beach movie) + (734 want-force-vis beach #t) + (735 alive "ecovent-48") + (742 blackout 10) + (743 joint "cameraB") + (745 blackout 0) + (839 alive "ecovent-200") + (841 joint "camera") + (842 dead "ecovent-48") + (942 blackout 10) + (944 joint "cameraB") + (945 blackout 0) + (945 dead "ecovent-200") + (945 display-level beach #f) + (1049 blackout 10) + (1051 joint "camera") + (1052 blackout 0) + (1135 blackout 10) + (1137 joint "cameraB") + (1138 blackout 0) + (1216 joint "camera") ) ) - (else - (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name "assistant-introduction-race-bike" - :index 12 - :parts 6 - :command-list - '((0 want-levels village1 beach) (129 joint "cameraB") (319 joint "camera") (505 joint "cameraB")) - ) - ) - ) - ) - (((task-status need-reminder) (task-status need-reminder-a)) - (set! (-> obj skippable) #t) - (cond - ((= (current-task (-> obj tasks)) (game-task none)) - (new 'static 'spool-anim :name "assistant-reminder-1-generic" :index 14 :parts 2 :command-list '()) - ) - ((closed? (-> obj tasks) (game-task jungle-eggtop) (task-status need-resolution)) - (new 'static 'spool-anim :name "assistant-reminder-1-race-bike" :index 13 :parts 3 :command-list '()) - ) - ((or (closed? (-> obj tasks) (game-task misty-bike) (task-status need-resolution)) - (not (closed? (-> obj tasks) (game-task misty-bike) (task-status need-introduction))) - ) - (new 'static 'spool-anim :name "assistant-reminder-1-blue-eco-switch" :index 11 :parts 3 :command-list '()) - ) - ((zero? (get-reminder (-> obj tasks) 2)) - (if arg0 - (save-reminder (-> obj tasks) 1 2) - ) - (new 'static 'spool-anim :name "assistant-reminder-1-race-bike" :index 13 :parts 3 :command-list '()) - ) - (else - (if arg0 - (save-reminder (-> obj tasks) 0 2) - ) - (new 'static 'spool-anim :name "assistant-reminder-1-blue-eco-switch" :index 11 :parts 3 :command-list '()) - ) - ) - ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) - ) - (-> obj draw art-group data 3) ) + (else + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "assistant-introduction-race-bike" + :index 12 + :parts 6 + :command-list '((0 want-levels village1 beach) (129 joint "cameraB") (319 joint "camera") (505 joint "cameraB")) + ) + ) + ) + ) + (((task-status need-reminder) (task-status need-reminder-a)) + (set! (-> obj skippable) #t) + (cond + ((= (current-task (-> obj tasks)) (game-task none)) + (new 'static 'spool-anim :name "assistant-reminder-1-generic" :index 14 :parts 2 :command-list '()) + ) + ((closed? (-> obj tasks) (game-task jungle-eggtop) (task-status need-resolution)) + (new 'static 'spool-anim :name "assistant-reminder-1-race-bike" :index 13 :parts 3 :command-list '()) + ) + ((or (closed? (-> obj tasks) (game-task misty-bike) (task-status need-resolution)) + (not (closed? (-> obj tasks) (game-task misty-bike) (task-status need-introduction))) + ) + (new 'static 'spool-anim :name "assistant-reminder-1-blue-eco-switch" :index 11 :parts 3 :command-list '()) + ) + ((zero? (get-reminder (-> obj tasks) 2)) + (if arg0 + (save-reminder (-> obj tasks) 1 2) + ) + (new 'static 'spool-anim :name "assistant-reminder-1-race-bike" :index 13 :parts 3 :command-list '()) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 2) + ) + (new 'static 'spool-anim :name "assistant-reminder-1-blue-eco-switch" :index 11 :parts 3 :command-list '()) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) + ) + ) + (-> obj draw art-group data 3) ) ) ) @@ -184,10 +175,7 @@ (defmethod TODO-RENAME-43 assistant ((obj assistant)) (let ((s5-0 (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj))) (when s5-0 - (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-3 (the-as number (logior #x3f800000 v1-2))) - (f0-2 (+ -1.0 (the-as float v1-3))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 16384.0 (-> s5-0 y)) #f @@ -215,272 +203,80 @@ (defstate idle (assistant) :virtual #t - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) - ) - (ja-channel-push! 1 60) + :code (behavior () + (if (!= (ja-group) assistant-idle-leaning-right-ja) + (ja-channel-push! 1 (seconds 0.2)) ) - (while #t + (loop (TODO-RENAME-43 self) - (let ((v1-9 (-> self skel root-channel 0))) - (set! (-> v1-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (let* ((v1-11 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-12 (the-as number (logior #x3f800000 v1-11))) - ) - (countdown (gp-0 (+ (the int (+ -1.0 (the-as float v1-12))) 2)) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-12 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! - a0-12 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) - ) + (ja :group! assistant-idle-leaning-right-ja) + (countdown (gp-0 (+ (the int (rand-float-gen)) 2)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) ) ) - (let* ((v1-46 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-47 (the-as number (logior #x3f800000 v1-46))) - ) - (cond - ((< (+ -1.0 (the-as float v1-47)) 0.66) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) + (cond + ((< (rand-float-gen) 0.66) + (ja-no-eval :group! assistant-idle-transition-to-welding-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sound-play "welding-loop" :id (-> self sound-id) :position (the-as symbol (target-pos 0))) + (ja :group! assistant-idle-welding-ja) + (let* ((f30-0 4.0) + (v1-76 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-77 (the-as number (logior #x3f800000 v1-76))) + ) + (countdown (gp-2 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-77)))) 4)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30))) + (suspend) + (ja :num! (seek!)) ) - ) - (sound-play-by-name - (static-sound-name "welding-loop") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (target-pos 0)) - ) - (let ((v1-74 (-> self skel root-channel 0))) - (set! (-> v1-74 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - ) - (let* ((f30-0 4.0) - (v1-76 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-77 (the-as number (logior #x3f800000 v1-76))) - ) - (countdown (gp-2 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-77)))) 4)) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-28 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-28 param 1) 1.0) - (set! (-> a0-28 frame-num) 0.0) - (joint-control-channel-group! - a0-28 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30))) - (suspend) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 param 0) (the float (+ (-> a0-31 frame-group data 0 length) -1))) - (set! (-> a0-31 param 1) 1.0) - (joint-control-channel-group-eval! a0-31 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-33 (-> self skel root-channel 0))) - (set! (-> a0-33 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-33 param 0) 0.0) - (set! (-> a0-33 param 1) 1.0) - (set! (-> a0-33 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-33 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30))) - (suspend) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 param 0) 0.0) - (set! (-> a0-36 param 1) 1.0) - (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - ) - ) - (sound-stop (-> self sound-id)) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-39 param 0) 0.0) - (set! (-> a0-39 param 1) 1.0) - (set! (-> a0-39 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-39 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) 0.0) - (set! (-> a0-40 param 1) 1.0) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let* ((v1-159 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-160 (the-as number (logior #x3f800000 v1-159))) - ) - (when (< (+ -1.0 (the-as float v1-160)) 0.66) - (let ((a0-44 (-> self skel root-channel 0))) - (set! (-> a0-44 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-44 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-44 param 1) 1.0) - (set! (-> a0-44 frame-num) 0.0) - (joint-control-channel-group! a0-44 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-45 (-> self skel root-channel 0))) - (set! (-> a0-45 param 0) (the float (+ (-> a0-45 frame-group data 0 length) -1))) - (set! (-> a0-45 param 1) 1.0) - (joint-control-channel-group-eval! a0-45 (the-as art-joint-anim #f) num-func-seek!) - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30))) + (suspend) + (ja :num! (seek! 0.0)) ) ) ) - (else - (let ((a0-47 (-> self skel root-channel 0))) - (set! (-> a0-47 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-47 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-47 param 1) 1.0) - (set! (-> a0-47 frame-num) 0.0) - (joint-control-channel-group! a0-47 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (sound-stop (-> self sound-id)) + (ja-no-eval :group! assistant-idle-transition-to-welding-ja :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + (when (< (rand-float-gen) 0.66) + (ja-no-eval :group! assistant-idle-wiping-brow-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (else + (ja-no-eval :group! assistant-idle-transition-right-to-left-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (countdown (gp-3 (+ (the int (rand-float-gen)) 1)) + (ja-no-eval :group! assistant-idle-leaning-left-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-48 (-> self skel root-channel 0))) - (set! (-> a0-48 param 0) (the float (+ (-> a0-48 frame-group data 0 length) -1))) - (set! (-> a0-48 param 1) 1.0) - (joint-control-channel-group-eval! a0-48 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let* ((v1-208 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-209 (the-as number (logior #x3f800000 v1-208))) - ) - (countdown (gp-3 (+ (the int (+ -1.0 (the-as float v1-209))) 1)) - (let ((a0-52 (-> self skel root-channel 0))) - (set! (-> a0-52 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-52 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-52 param 1) 1.0) - (set! (-> a0-52 frame-num) 0.0) - (joint-control-channel-group! a0-52 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-53 (-> self skel root-channel 0))) - (set! (-> a0-53 param 0) (the float (+ (-> a0-53 frame-group data 0 length) -1))) - (set! (-> a0-53 param 1) 1.0) - (joint-control-channel-group-eval! a0-53 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - ) - ) - (let ((a0-55 (-> self skel root-channel 0))) - (set! (-> a0-55 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-55 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-55 param 1) 1.0) - (set! (-> a0-55 frame-num) 0.0) - (joint-control-channel-group! a0-55 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-56 (-> self skel root-channel 0))) - (set! (-> a0-56 param 0) (the float (+ (-> a0-56 frame-group data 0 length) -1))) - (set! (-> a0-56 param 1) 1.0) - (joint-control-channel-group-eval! a0-56 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) + (ja-no-eval :group! assistant-idle-transition-left-to-right-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) ) ) ) @@ -491,15 +287,13 @@ (defpartgroup group-assistant-torch :id 122 :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 365 :fade-after (meters 30) :falloff-to (meters 30)) + :parts ((sp-item 365 :fade-after (meters 30) :falloff-to (meters 30)) (sp-item 366 :fade-after (meters 60) :falloff-to (meters 80)) ) ) (defpart 365 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -515,8 +309,7 @@ ) (defpart 366 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -541,8 +334,7 @@ ) (defpart 367 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 3.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.075) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -563,22 +355,11 @@ (when (< (-> arg2 y) (-> arg1 user-float)) (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (if (< (+ -1.0 (the-as float v1-2)) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) - ) - ) + (if (< (rand-float-gen) 0.25) + (sound-play "water-drop") + ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 367) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 367) gp-0) ) ) (none) diff --git a/goal_src/levels/village1/explorer.gc b/goal_src/levels/village1/explorer.gc index 3248780803..2923dc38b2 100644 --- a/goal_src/levels/village1/explorer.gc +++ b/goal_src/levels/village1/explorer.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/explorer-ag.gc") + (deftype explorer (process-taskable) () :heap-base #x110 @@ -16,14 +18,11 @@ ) -(defskelgroup *explorer-sg* explorer - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *explorer-sg* explorer explorer-lod0-jg explorer-idle-ja + ((explorer-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow explorer-shadow-mg + ) (defmethod dummy-52 explorer ((obj explorer)) (let ((v1-1 (-> obj draw shadow-ctrl))) @@ -38,7 +37,7 @@ ) ) 0 - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) ) ) (none) @@ -47,16 +46,19 @@ (defmethod draw-npc-shadow explorer ((obj explorer)) (-> obj draw shadow-ctrl) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -75,8 +77,7 @@ :name "explorer-introduction" :index 9 :parts 11 - :command-list - '((418 joint "cameraB") (695 shadow self #f) (695 joint "camera") (838 shadow self #t) (838 joint "cameraB")) + :command-list '((418 joint "cameraB") (695 shadow self #f) (695 joint "camera") (838 shadow self #t) (838 joint "cameraB")) ) ) (((task-status need-reminder)) @@ -90,8 +91,7 @@ :name "explorer-reminder-1" :index 10 :parts 5 - :command-list - '((0 send-event target draw #f) + :command-list '((0 send-event target draw #f) (148 send-event target draw #t) (148 joint "cameraB") (390 send-event target draw #f) @@ -124,8 +124,7 @@ :name "explorer-resolution" :index 12 :parts 5 - :command-list - '((167 joint "cameraB") (310 joint "camera")) + :command-list '((167 joint "cameraB") (310 joint "camera")) ) ) (else @@ -148,10 +147,7 @@ (defmethod TODO-RENAME-43 explorer ((obj explorer)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) (play-ambient (-> obj ambient) "EXP-AM05" #f (-> obj root-override trans)) @@ -189,363 +185,149 @@ (defstate idle (explorer) :virtual #t - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) - ) - (ja-channel-push! 1 60) + :code (behavior () + (if (!= (ja-group) explorer-idle-ja) + (ja-channel-push! 1 (seconds 0.2)) ) - (while #t + (loop (TODO-RENAME-43 self) - (let ((v1-9 (-> self skel root-channel 0))) - (set! (-> v1-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! explorer-idle-ja) (let* ((f30-0 2.0) (v1-11 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-12 (the-as number (logior #x3f800000 v1-11))) ) (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-12)))) 1)) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! explorer-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let* ((v1-40 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-41 (the-as number (logior #x3f800000 v1-40))) - ) - (cond - ((< (+ -1.0 (the-as float v1-41)) 0.5) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + (cond + ((< (rand-float-gen) 0.5) + (ja-no-eval :group! explorer-idle2-look-at-map-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-1 (-> *display* base-frame-counter))) + (while (let ((s5-0 (-> *display* base-frame-counter)) + (f30-1 300.0) + (f28-0 0.5) + (f26-0 0.5) + ) + (< (- s5-0 (the-as time-frame (the int (* f30-1 (+ f28-0 (* f26-0 (rand-float-gen))))))) gp-1) + ) + (suspend) ) + ) + (when (< (rand-float-gen) 0.75) + (ja-no-eval :group! explorer-idle2-look-right-map-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (let ((gp-1 (-> *display* base-frame-counter))) - (while (let* ((s5-0 (-> *display* base-frame-counter)) - (f30-1 300.0) - (f28-0 0.5) - (f26-0 0.5) - (v1-68 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-69 (the-as number (logior #x3f800000 v1-68))) - ) - (< (- s5-0 (the-as time-frame (the int (* f30-1 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-69)))))))) gp-1) + (let ((gp-2 (-> *display* base-frame-counter))) + (while (let ((s5-1 (-> *display* base-frame-counter)) + (f30-2 300.0) + (f28-1 0.5) + (f26-1 0.5) + ) + (< (- s5-1 (the-as time-frame (the int (* f30-2 (+ f28-1 (* f26-1 (rand-float-gen))))))) gp-2) ) (suspend) ) ) - (let* ((v1-75 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-76 (the-as number (logior #x3f800000 v1-75))) - ) - (when (< (+ -1.0 (the-as float v1-76)) 0.75) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-2 (-> *display* base-frame-counter))) - (while (let* ((s5-1 (-> *display* base-frame-counter)) - (f30-2 300.0) - (f28-1 0.5) - (f26-1 0.5) - (v1-104 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-105 (the-as number (logior #x3f800000 v1-104))) - ) - (< (- s5-1 (the-as time-frame (the int (* f30-2 (+ f28-1 (* f26-1 (+ -1.0 (the-as float v1-105)))))))) gp-2) - ) - (suspend) - ) - ) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-29 param 0) 0.0) - (set! (-> a0-29 param 1) 1.0) - (set! (-> a0-29 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-29 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 param 0) 0.0) - (set! (-> a0-30 param 1) 1.0) - (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let* ((v1-135 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-136 (the-as number (logior #x3f800000 v1-135))) - ) - (when (< (+ -1.0 (the-as float v1-136)) 0.5) - (let ((a0-34 (-> self skel root-channel 0))) - (set! (-> a0-34 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-34 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-34 param 1) 1.0) - (set! (-> a0-34 frame-num) 0.0) - (joint-control-channel-group! a0-34 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 param 0) (the float (+ (-> a0-35 frame-group data 0 length) -1))) - (set! (-> a0-35 param 1) 1.0) - (joint-control-channel-group-eval! a0-35 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-3 (-> *display* base-frame-counter))) - (while (let* ((s5-2 (-> *display* base-frame-counter)) - (f30-3 300.0) - (f28-2 0.5) - (f26-2 0.5) - (v1-164 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-165 (the-as number (logior #x3f800000 v1-164))) - ) - (< (- s5-2 (the-as time-frame (the int (* f30-3 (+ f28-2 (* f26-2 (+ -1.0 (the-as float v1-165)))))))) gp-3) - ) - (suspend) - ) - ) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-39 param 0) 0.0) - (set! (-> a0-39 param 1) 1.0) - (set! (-> a0-39 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-39 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) 0.0) - (set! (-> a0-40 param 1) 1.0) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - ) - ) - ) - ) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-42 param 0) 0.0) - (set! (-> a0-42 param 1) 1.0) - (set! (-> a0-42 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) 0.0) - (set! (-> a0-43 param 1) 1.0) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) + (ja :num! (seek! 0.0)) + ) + (when (< (rand-float-gen) 0.5) + (ja-no-eval :group! explorer-idle2-look-right-map-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-3 (-> *display* base-frame-counter))) + (while (let ((s5-2 (-> *display* base-frame-counter)) + (f30-3 300.0) + (f28-2 0.5) + (f26-2 0.5) + ) + (< (- s5-2 (the-as time-frame (the int (* f30-3 (+ f28-2 (* f26-2 (rand-float-gen))))))) gp-3) + ) + (suspend) + ) + ) + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) ) ) ) - (else - (let ((a0-45 (-> self skel root-channel 0))) - (set! (-> a0-45 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-45 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-45 param 1) 1.0) - (set! (-> a0-45 frame-num) 0.0) - (joint-control-channel-group! a0-45 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) - (until (ja-done? 0) + (ja-no-eval :group! explorer-idle2-look-at-map-ja :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + (else + (ja-no-eval :group! explorer-idle3-step-right-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-4 (-> *display* base-frame-counter))) + (while (let ((s5-3 (-> *display* base-frame-counter)) + (f30-4 300.0) + (f28-3 0.5) + (f26-3 0.5) + ) + (< (- s5-3 (the-as time-frame (the int (* f30-4 (+ f28-3 (* f26-3 (rand-float-gen))))))) gp-4) + ) (suspend) - (let ((a0-46 (-> self skel root-channel 0))) - (set! (-> a0-46 param 0) (the float (+ (-> a0-46 frame-group data 0 length) -1))) - (set! (-> a0-46 param 1) 1.0) - (joint-control-channel-group-eval! a0-46 (the-as art-joint-anim #f) num-func-seek!) - ) ) - (let ((gp-4 (-> *display* base-frame-counter))) - (while (let* ((s5-3 (-> *display* base-frame-counter)) - (f30-4 300.0) - (f28-3 0.5) - (f26-3 0.5) - (v1-237 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-238 (the-as number (logior #x3f800000 v1-237))) - ) - (< (- s5-3 (the-as time-frame (the int (* f30-4 (+ f28-3 (* f26-3 (+ -1.0 (the-as float v1-238)))))))) gp-4) - ) - (suspend) - ) - ) - (let ((a0-50 (-> self skel root-channel 0))) - (set! (-> a0-50 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-50 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-50 param 1) 1.0) - (set! (-> a0-50 frame-num) 0.0) - (joint-control-channel-group! a0-50 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) - (until (ja-done? 0) + ) + (ja-no-eval :group! explorer-idle3-looking-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-5 (-> *display* base-frame-counter))) + (while (let ((s5-4 (-> *display* base-frame-counter)) + (f30-5 300.0) + (f28-4 0.5) + (f26-4 0.5) + ) + (< (- s5-4 (the-as time-frame (the int (* f30-5 (+ f28-4 (* f26-4 (rand-float-gen))))))) gp-5) + ) (suspend) - (let ((a0-51 (-> self skel root-channel 0))) - (set! (-> a0-51 param 0) (the float (+ (-> a0-51 frame-group data 0 length) -1))) - (set! (-> a0-51 param 1) 1.0) - (joint-control-channel-group-eval! a0-51 (the-as art-joint-anim #f) num-func-seek!) - ) ) - (let ((gp-5 (-> *display* base-frame-counter))) - (while (let* ((s5-4 (-> *display* base-frame-counter)) - (f30-5 300.0) - (f28-4 0.5) - (f26-4 0.5) - (v1-268 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-269 (the-as number (logior #x3f800000 v1-268))) - ) - (< (- s5-4 (the-as time-frame (the int (* f30-5 (+ f28-4 (* f26-4 (+ -1.0 (the-as float v1-269)))))))) gp-5) - ) - (suspend) - ) - ) - (let ((a0-55 (-> self skel root-channel 0))) - (set! (-> a0-55 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-55 param 0) 0.0) - (set! (-> a0-55 param 1) 1.0) - (set! (-> a0-55 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-55 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) + ) + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + (let ((gp-6 (-> *display* base-frame-counter))) + (while (let ((s5-5 (-> *display* base-frame-counter)) + (f30-6 300.0) + (f28-5 0.5) + (f26-5 0.5) + ) + (< (- s5-5 (the-as time-frame (the int (* f30-6 (+ f28-5 (* f26-5 (rand-float-gen))))))) gp-6) + ) (suspend) - (let ((a0-56 (-> self skel root-channel 0))) - (set! (-> a0-56 param 0) 0.0) - (set! (-> a0-56 param 1) 1.0) - (joint-control-channel-group-eval! a0-56 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-6 (-> *display* base-frame-counter))) - (while (let* ((s5-5 (-> *display* base-frame-counter)) - (f30-6 300.0) - (f28-5 0.5) - (f26-5 0.5) - (v1-301 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-302 (the-as number (logior #x3f800000 v1-301))) - ) - (< (- s5-5 (the-as time-frame (the int (* f30-6 (+ f28-5 (* f26-5 (+ -1.0 (the-as float v1-302)))))))) gp-6) - ) - (suspend) - ) - ) - (let ((a0-60 (-> self skel root-channel 0))) - (set! (-> a0-60 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-60 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-60 param 1) 1.0) - (set! (-> a0-60 frame-num) 0.0) - (joint-control-channel-group! a0-60 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-61 (-> self skel root-channel 0))) - (set! (-> a0-61 param 0) (the float (+ (-> a0-61 frame-group data 0 length) -1))) - (set! (-> a0-61 param 1) 1.0) - (joint-control-channel-group-eval! a0-61 (the-as art-joint-anim #f) num-func-seek!) - ) ) ) + (ja-no-eval :group! explorer-idle3-step-left-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) ) ) ) diff --git a/goal_src/levels/village1/farmer.gc b/goal_src/levels/village1/farmer.gc index b3b68dad10..78500ca77c 100644 --- a/goal_src/levels/village1/farmer.gc +++ b/goal_src/levels/village1/farmer.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/farmer-ag.gc") + (deftype farmer (process-taskable) () :heap-base #x110 @@ -16,14 +18,11 @@ ) -(defskelgroup *farmer-sg* farmer - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 3 - ) +(defskelgroup *farmer-sg* farmer farmer-lod0-jg farmer-sitting-cycle-ja + ((farmer-lod0-mg (meters 20)) (farmer-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow farmer-shadow-mg + ) (defmethod play-anim! farmer ((obj farmer) (arg0 symbol)) (case (current-status (-> obj tasks)) @@ -84,10 +83,7 @@ (defmethod TODO-RENAME-43 farmer ((obj farmer)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.8333333 f0-2) (play-ambient (-> obj ambient) "FAR-LO1A" #f (-> obj root-override trans)) diff --git a/goal_src/levels/village1/fishermans-boat.gc b/goal_src/levels/village1/fishermans-boat.gc index 695f4bc821..ed5a3c28a5 100644 --- a/goal_src/levels/village1/fishermans-boat.gc +++ b/goal_src/levels/village1/fishermans-boat.gc @@ -9,6 +9,10 @@ ;; DECOMP BEGINS +(import "goal_src/import/evilbro-ag.gc") +(import "goal_src/import/fishermans-boat-ag.gc") +(import "goal_src/import/evilsis-ag.gc") + (define *fishermans-boat-constants* (new 'static 'rigid-body-platform-constants :drag-factor 2.0 :buoyancy-factor 1.5 @@ -121,7 +125,7 @@ (set! (-> s3-0 w) 1.0) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 s3-0 (new 'static 'rgba :r #xff :g #xff :a #x80) @@ -130,7 +134,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 s5-0 (meters 0.00024414062) @@ -447,14 +451,14 @@ (debug-draw (-> obj path)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj dest-circle) (-> obj dest-circle w) (new 'static 'rgba :g #xff :a #x80) ) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj target-point) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) @@ -526,29 +530,21 @@ ) -(defskelgroup *fishermans-boat-sg* fishermans-boat - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 3 0 15) - :longest-edge (meters 7.3) - ) +(defskelgroup *fishermans-boat-sg* fishermans-boat fishermans-boat-lod0-jg fishermans-boat-idle-ja + ((fishermans-boat-lod0-mg (meters 20)) (fishermans-boat-lod1-mg (meters 999999))) + :bounds (static-spherem 0 3 0 15) + :longest-edge (meters 7.3) + ) -(defskelgroup *fb-evilbro-sg* evilbro - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - ) +(defskelgroup *fb-evilbro-sg* evilbro evilbro-lod0-jg evilbro-idle-ja + ((evilbro-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) -(defskelgroup *fb-evilsis-sg* evilsis - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - ) +(defskelgroup *fb-evilsis-sg* evilsis evilsis-lod0-jg evilsis-idle-ja + ((evilsis-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) (defmethod TODO-RENAME-23 fishermans-boat ((obj fishermans-boat) (arg0 float)) (local-vars (sv-128 int) (sv-144 rigid-body-control-point) (sv-160 int) (sv-176 vector)) @@ -661,8 +657,7 @@ ) (defpart 2896 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-x (meters 10)) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 3) 1.0) @@ -693,14 +688,7 @@ (set! (-> *part-id-table* 2896 init-specs 19 initial-valuef) (+ 49152.0 arg1)) (set! (-> *part-id-table* 2896 init-specs 1 initial-valuef) (* 0.0000036621095 arg2)) (set! (-> *part-id-table* 2896 init-specs 2 initial-valuef) (* 0.1 arg2)) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2896) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2896) gp-0) ) 0 (none) @@ -724,12 +712,8 @@ (defbehavior fishermans-boat-play-sounds fishermans-boat () (if (-> self ignition) - (set! (-> self engine-sound-envelope) - (seek (-> self engine-sound-envelope) 1.0 (* 2.0 (-> *display* seconds-per-frame))) - ) - (set! (-> self engine-sound-envelope) - (seek (-> self engine-sound-envelope) 0.0 (-> *display* seconds-per-frame)) - ) + (seek! (-> self engine-sound-envelope) 1.0 (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self engine-sound-envelope) 0.0 (-> *display* seconds-per-frame)) ) (cond ((< 0.0 (-> self engine-sound-envelope)) @@ -742,14 +726,12 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (vector<-cspace! gp-0 (-> self node-list data 4)) - (sound-play-by-name - (static-sound-name "boat-engine") - (-> self engine-sound-id) - (the int (* 10.24 f30-0)) - (the int (* 1524.0 f28-0)) - 0 - 1 - (the-as symbol gp-0) + (sound-play + "boat-engine" + :id (-> self engine-sound-id) + :vol f30-0 + :pitch f28-0 + :position (the-as symbol gp-0) ) ) ) @@ -767,17 +749,7 @@ (defbehavior fishermans-boat-post fishermans-boat () (when (and *target* (-> self kill-player)) (set! (-> self kill-player) #f) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'attack) - (set! (-> a1-0 param 0) (the-as uint #f)) - (let ((a0-0 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-0 mode) 'endlessfall) - (set! (-> a1-0 param 1) (the-as uint a0-0)) - ) - (when (send-event-function *target* a1-0) - ) + (when (send-event *target* 'attack #f (static-attack-info ((mode 'endlessfall)))) ) ) (when (and *target* (-> self ignition)) @@ -789,15 +761,11 @@ (else (when (not (-> self measure-parameters)) (let ((f0-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0))) - (set! (-> self controller steering) - (seek (-> self controller steering) (fmax -1.0 (fmin 1.0 f0-0)) (-> *display* seconds-per-frame)) - ) + (seek! (-> self controller steering) (fmax -1.0 (fmin 1.0 f0-0)) (-> *display* seconds-per-frame)) ) (if (cpad-hold? 0 x) - (set! (-> self controller throttle) (seek (-> self controller throttle) 0.8 (-> *display* seconds-per-frame))) - (set! (-> self controller throttle) - (seek (-> self controller throttle) 0.0 (* 0.25 (-> *display* seconds-per-frame))) - ) + (seek! (-> self controller throttle) 0.8 (-> *display* seconds-per-frame)) + (seek! (-> self controller throttle) 0.0 (* 0.25 (-> *display* seconds-per-frame))) ) 0 ) @@ -818,9 +786,7 @@ ) ) (if (-> self ignition) - (set! (-> self engine-thrust) - (seek (-> self engine-thrust) (* 1228800.0 (-> self controller throttle)) 6144.0) - ) + (seek! (-> self engine-thrust) (* 1228800.0 (-> self controller throttle)) 6144.0) (set! (-> self engine-thrust) 0.0) ) (cond @@ -834,7 +800,7 @@ ) ) (else - (set! (-> self propeller spin-rate) (seek (-> self propeller spin-rate) 0.0 218.45334)) + (seek! (-> self propeller spin-rate) 0.0 218.45334) ) ) (TODO-RENAME-28 self) @@ -844,14 +810,14 @@ (dummy-16 (-> self controller)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> self boat-path)) 614400.0 (new 'static 'rgba :b #xff :a #x80) ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (&-> self stack 848)) 409600.0 (new 'static 'rgba :b #xff :a #x80) @@ -921,18 +887,15 @@ ) (defstate fishermans-boat-docked-village (fishermans-boat) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior fishermans-boat) rigid-body-platform-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (fishermans-boat-leave-dock?) (go fishermans-boat-ride-to-misty) ) @@ -942,14 +905,12 @@ ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self anim) (new 'static 'spool-anim :name "fishermans-boat-ride-to-misty" :index 15 :parts 3 - :command-list - '((0 want-levels village1 misty) + :command-list '((0 want-levels village1 misty) (0 shadow target #f) (0 shadow sidekick #f) (250 display-level misty display) @@ -968,13 +929,11 @@ (anim-loop) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) (defstate fishermans-boat-leaving-village (fishermans-boat) - :trans - (behavior () + :trans (behavior () (when (< 614400.0 (vector-vector-xz-distance (-> self root-overlay trans) (-> self dock-point))) (load-state-want-display-level 'village1 'special) (load-state-want-display-level 'misty 'display) @@ -985,50 +944,40 @@ (rider-trans) (none) ) - :code - (behavior () + :code (behavior () (load-state-want-levels 'village1 'misty) - (let ((gp-0 (get-process *default-dead-pool* camera-tracker #x4000))) - (set! (-> self cam-tracker) - (ppointer->handle (when gp-0 - (let ((t9-2 (method-of-type camera-tracker activate))) - (t9-2 (the-as camera-tracker gp-0) self 'camera-tracker (the-as pointer #x70004000)) + (set! (-> self cam-tracker) + (ppointer->handle (process-spawn + camera-tracker + :init camera-tracker-init + (lambda :behavior fishermans-boat + () + (camera-change-to "camera-282" 0 #f) + (while (!= (-> self rbody lin-momentum-damping-factor) 'release) + (suspend) ) - (run-now-in-process - gp-0 - camera-tracker-init - (lambda :behavior fishermans-boat - () - (camera-change-to "camera-282" 0 #f) - (while (!= (-> self rbody lin-momentum-damping-factor) 'release) - (suspend) - ) - (set! (-> self rbody lin-momentum-damping-factor) (the-as float #f)) - (camera-change-to (the-as string 'base) 0 #f) - (none) - ) - ) - (-> gp-0 ppointer) + (set! (-> self rbody lin-momentum-damping-factor) (the-as float #f)) + (camera-change-to (the-as string 'base) 0 #f) + (none) ) + :to self ) - ) - ) + ) + ) (send-event (handle->process (-> self cam-tracker)) 'border #t) (send-event (handle->process (-> self cam-tracker)) 'mask #x20800) (fishermans-boat-set-path-point 0) (fishermans-boat-next-path-point) - (while #t + (loop (suspend) ) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) (defstate fishermans-boat-entering-village (fishermans-boat) - :trans - (behavior () + :trans (behavior () (when (fishermans-boat-enter-dock?) (set! (-> self waiting-for-player) #f) (when #t @@ -1043,8 +992,7 @@ (rider-trans) (none) ) - :code - (behavior () + :code (behavior () (load-state-want-levels 'village1 'beach) (load-state-want-vis 'vi1) (fishermans-boat-set-dock-point 0) @@ -1052,23 +1000,19 @@ (anim-loop) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) (defstate fishermans-boat-docked-misty (fishermans-boat) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior fishermans-boat) rigid-body-platform-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (fishermans-boat-leave-dock?) (go fishermans-boat-ride-to-village1) ) @@ -1078,15 +1022,13 @@ ) (none) ) - :code - (behavior () + :code (behavior () (if #t (set! (-> self anim) (new 'static 'spool-anim :name "fishermans-boat-ride-to-village1" :index 16 :parts 3 - :command-list - '((0 want-levels village1 misty) + :command-list '((0 want-levels village1 misty) (0 shadow target #f) (0 shadow sidekick #f) (250 display-level village1 display) @@ -1104,8 +1046,7 @@ :name "fishermans-boat-ride-to-village1-alt" :index 17 :parts 12 - :command-list - '((0 want-levels village1 misty) + :command-list '((0 want-levels village1 misty) (105 want-levels village1 intro) (150 display-level intro display) (150 want-vis int) @@ -1131,13 +1072,11 @@ (anim-loop) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) (defstate fishermans-boat-leaving-misty (fishermans-boat) - :trans - (behavior () + :trans (behavior () (when (< 409600.0 (vector-vector-xz-distance (-> self root-overlay trans) (-> self dock-point))) (load-state-want-force-vis 'village1 #t) (load-state-want-display-level 'village1 'display) @@ -1148,49 +1087,39 @@ (rider-trans) (none) ) - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* camera-tracker #x4000))) - (set! (-> self cam-tracker) - (ppointer->handle (when gp-0 - (let ((t9-1 (method-of-type camera-tracker activate))) - (t9-1 (the-as camera-tracker gp-0) self 'camera-tracker (the-as pointer #x70004000)) + :code (behavior () + (set! (-> self cam-tracker) + (ppointer->handle (process-spawn + camera-tracker + :init camera-tracker-init + (lambda :behavior fishermans-boat + () + (camera-change-to "camera-287" 0 #f) + (while (!= (-> self rbody lin-momentum-damping-factor) 'release) + (suspend) ) - (run-now-in-process - gp-0 - camera-tracker-init - (lambda :behavior fishermans-boat - () - (camera-change-to "camera-287" 0 #f) - (while (!= (-> self rbody lin-momentum-damping-factor) 'release) - (suspend) - ) - (set! (-> self rbody lin-momentum-damping-factor) (the-as float #f)) - (camera-change-to (the-as string 'base) 0 #f) - (none) - ) - ) - (-> gp-0 ppointer) + (set! (-> self rbody lin-momentum-damping-factor) (the-as float #f)) + (camera-change-to (the-as string 'base) 0 #f) + (none) ) + :to self ) - ) - ) + ) + ) (send-event (handle->process (-> self cam-tracker)) 'border #t) (send-event (handle->process (-> self cam-tracker)) 'mask #x20800) (fishermans-boat-set-path-point 4) (fishermans-boat-next-path-point) - (while #t + (loop (suspend) ) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) (defstate fishermans-boat-entering-misty (fishermans-boat) - :trans - (behavior () + :trans (behavior () (when (fishermans-boat-enter-dock?) (set! (-> self waiting-for-player) #f) (level-hint-spawn @@ -1209,29 +1138,25 @@ (rider-trans) (none) ) - :code - (behavior () + :code (behavior () (set-continue! *game-info* "misty-start") (fishermans-boat-set-dock-point 4) (fishermans-boat-set-path-point 2) - (while #t + (loop (suspend) ) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) (defstate fishermans-boat-player-control (fishermans-boat) - :exit - (behavior () + :exit (behavior () (send-event *camera* 'change-state *camera-base-mode* 0) (set! (-> self auto-pilot) #t) (none) ) - :trans - (behavior () + :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (nth-point (-> self boat-path) 0 gp-0) (if (< (vector-vector-xz-distance (-> self root-overlay trans) gp-0) 614400.0) @@ -1245,12 +1170,11 @@ 0 (none) ) - :code - (behavior () + :code (behavior () (send-event (handle->process (-> self cam-tracker)) 'message 'release) (suspend) (send-event *camera* 'change-state cam-stick 0) - (while #t + (loop (if (and (= *cheat-mode* 'debug) (cpad-pressed? 0 triangle)) (set! (-> self auto-pilot) #f) ) @@ -1258,8 +1182,7 @@ ) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) (defbehavior fishermans-boat-set-throttle-by-speed fishermans-boat ((arg0 float)) @@ -1275,20 +1198,17 @@ ) (defstate fishermans-boat-measurements (fishermans-boat) - :exit - (behavior () + :exit (behavior () (set! (-> self measure-parameters) #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (cpad-pressed? 1 square) (go fishermans-boat-player-control) ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self auto-pilot) #f) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 1) @@ -1326,8 +1246,7 @@ (go fishermans-boat-player-control) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) (defmethod relocate fishermans-boat ((obj fishermans-boat) (arg0 int)) @@ -1515,106 +1434,82 @@ ) (defstate fishermans-boat-ride-to-misty (fishermans-boat) - :code - (behavior () + :code (behavior () (set! (-> self propeller enable) #f) (quaternion-identity! (-> self root-overlay quat)) (set! (-> self root-overlay trans quad) (-> self entity extra trans quad)) (set! (-> self player-riding) #f) (set! (-> self auto-pilot) #f) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'clone-anim) - (set! (-> a1-0 param 0) (the-as uint self)) - (when (send-event-function *target* a1-0) - (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) - (send-event *target* 'blend-shape #t) - (let* ((gp-0 (get-process *default-dead-pool* othercam #x4000)) - (v1-20 (when gp-0 - (let ((t9-5 (method-of-type othercam activate))) - (t9-5 (the-as othercam gp-0) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 othercam-init-by-other self 5 #f #t) - (-> gp-0 ppointer) - ) - ) - ) - (send-event (ppointer->process v1-20) 'mask 2048) - ) - (set! (-> self draw force-lod) 0) - (ja-play-spooled-anim - (-> self anim) - (the-as art-joint-anim (-> self draw art-group data 3)) - (the-as art-joint-anim #f) - (the-as (function process-drawable symbol) false-func) - ) - (set! (-> self draw force-lod) -1) - (send-event *target* 'blend-shape #f) - (ja-channel-set! 1) - (let ((v1-33 (-> self skel root-channel 0))) - (set! (-> v1-33 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (vector<-cspace! (-> self root-overlay trans) (-> self node-list data 3)) - (matrix->quaternion (-> self root-overlay quat) (-> self node-list data 3 bone transform)) - (fishermans-boat-reset-physics) - (transform-post) - (when *target* - (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) - (send-event *target* 'trans 'restore (-> self old-target-pos)) - (send-event *target* 'end-mode) - (update-transforms! (-> self root-overlay)) - (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) - (logior! (-> *target* control status) 7) - (suspend) - (send-event *camera* 'teleport-to-other-start-string) - ) - (set-continue! *game-info* "misty-start") + (when (send-event *target* 'clone-anim self) + (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) + (send-event *target* 'blend-shape #t) + (let ((v1-20 (process-spawn othercam self 5 #f #t :to self))) + (send-event (ppointer->process v1-20) 'mask 2048) ) + (set! (-> self draw force-lod) 0) + (ja-play-spooled-anim + (-> self anim) + (the-as art-joint-anim fishermans-boat-idle-ja) + (the-as art-joint-anim #f) + (the-as (function process-drawable symbol) false-func) + ) + (set! (-> self draw force-lod) -1) + (send-event *target* 'blend-shape #f) + (ja-channel-set! 1) + (ja :group! fishermans-boat-idle-ja) + (vector<-cspace! (-> self root-overlay trans) (-> self node-list data 3)) + (matrix->quaternion (-> self root-overlay quat) (-> self node-list data 3 bone transform)) + (fishermans-boat-reset-physics) + (transform-post) + (when *target* + (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) + (send-event *target* 'trans 'restore (-> self old-target-pos)) + (send-event *target* 'end-mode) + (update-transforms! (-> self root-overlay)) + (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) + (logior! (-> *target* control status) (cshape-moving-flags onsurf onground tsurf)) + (suspend) + (send-event *camera* 'teleport-to-other-start-string) + ) + (set-continue! *game-info* "misty-start") ) (set! (-> self waiting-for-player) #t) (set! (-> self ignition) #f) (set! (-> self anchored) #t) (set! (-> self propeller enable) #t) (fishermans-boat-play-sounds) - (copy-settings-from-target! *setting-control*) - (let ((gp-1 (get-process *default-dead-pool* process #x4000))) - (when gp-1 - (let ((t9-25 (method-of-type process activate))) - (t9-25 gp-1 self 'process (the-as pointer #x70004000)) + (apply-settings *setting-control*) + (process-spawn-function + process + (lambda :behavior fishermans-boat + () + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) + (suspend) + ) ) - (run-next-time-in-process gp-1 (lambda :behavior fishermans-boat - () - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) - (suspend) - ) - ) - (while (or (-> *setting-control* current ambient) - (-> *setting-control* current hint) - (-> *setting-control* current movie) - ) - (suspend) - ) - (suspend) - (level-hint-spawn - (game-text-id misty-daxter-scared) - "sksp0060" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (none) - ) - ) - (-> gp-1 ppointer) + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current hint) + (-> *setting-control* current movie) + ) + (suspend) + ) + (suspend) + (level-hint-spawn + (game-text-id misty-daxter-scared) + "sksp0060" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + (none) ) + :to self ) (go fishermans-boat-docked-misty) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (fishermans-boat-spawn-particles 81920.0) (fishermans-boat-play-sounds) @@ -1623,8 +1518,7 @@ ) (defstate fishermans-boat-ride-to-village1 (fishermans-boat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -1633,19 +1527,9 @@ (when (= (level-status *level* 'intro) 'active) (let ((gp-1 (entity-by-name "evilbro-2"))) (when gp-1 - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self evilbro) - (ppointer->handle - (when s5-0 - (let ((t9-3 (method-of-type manipy activate))) - (t9-3 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> self root-overlay trans) gp-1 *fb-evilbro-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> self evilbro) + (ppointer->handle (manipy-spawn (-> self root-overlay trans) gp-1 *fb-evilbro-sg* #f :to self)) + ) (send-event (handle->process (-> self evilbro)) 'anim-mode 'clone-anim) (send-event (handle->process (-> self evilbro)) 'blend-shape #t) (send-event (handle->process (-> self evilbro)) 'center-joint 3) @@ -1653,19 +1537,9 @@ ) (let ((gp-2 (entity-by-name "evilsis-2"))) (when gp-2 - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self evilsis) - (ppointer->handle - (when s5-1 - (let ((t9-10 (method-of-type manipy activate))) - (t9-10 (the-as manipy s5-1) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> self root-overlay trans) gp-2 *fb-evilsis-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> self evilsis) + (ppointer->handle (manipy-spawn (-> self root-overlay trans) gp-2 *fb-evilsis-sg* #f :to self)) + ) (send-event (handle->process (-> self evilsis)) 'anim-mode 'clone-anim) (send-event (handle->process (-> self evilsis)) 'blend-shape #t) (send-event (handle->process (-> self evilsis)) 'center-joint 3) @@ -1689,8 +1563,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self propeller enable) #f) (set! (-> self evilbro) (the-as handle #f)) (set! (-> self evilsis) (the-as handle #f)) @@ -1698,55 +1571,38 @@ (set! (-> self root-overlay trans quad) (-> self entity extra trans quad)) (set! (-> self player-riding) #f) (set! (-> self auto-pilot) #f) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'clone-anim) - (set! (-> a1-0 param 0) (the-as uint self)) - (when (send-event-function *target* a1-0) - (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) - (send-event *target* 'blend-shape #t) - (let* ((gp-0 (get-process *default-dead-pool* othercam #x4000)) - (v1-20 (when gp-0 - (let ((t9-5 (method-of-type othercam activate))) - (t9-5 (the-as othercam gp-0) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 othercam-init-by-other self 5 #f #t) - (-> gp-0 ppointer) - ) - ) - ) - (send-event (ppointer->process v1-20) 'mask 2048) - ) - (set! (-> self draw force-lod) 0) - (ja-play-spooled-anim - (-> self anim) - (the-as art-joint-anim (-> self draw art-group data 3)) - (the-as art-joint-anim #f) - (the-as (function process-drawable symbol) false-func) - ) - (set! (-> self draw force-lod) -1) - (send-event *target* 'blend-shape #f) - (ja-channel-set! 1) - (let ((v1-33 (-> self skel root-channel 0))) - (set! (-> v1-33 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (vector<-cspace! (-> self root-overlay trans) (-> self node-list data 3)) - (matrix->quaternion (-> self root-overlay quat) (-> self node-list data 3 bone transform)) - (fishermans-boat-reset-physics) - (transform-post) - (when *target* - (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) - (send-event *target* 'trans 'restore (-> self old-target-pos)) - (send-event *target* 'end-mode) - (update-transforms! (-> self root-overlay)) - (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) - (logior! (-> *target* control status) 7) - (suspend) - (send-event *camera* 'teleport-to-other-start-string) - ) - (set-continue! *game-info* "village1-hut") + (when (send-event *target* 'clone-anim self) + (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) + (send-event *target* 'blend-shape #t) + (let ((v1-20 (process-spawn othercam self 5 #f #t :to self))) + (send-event (ppointer->process v1-20) 'mask 2048) ) + (set! (-> self draw force-lod) 0) + (ja-play-spooled-anim + (-> self anim) + (the-as art-joint-anim fishermans-boat-idle-ja) + (the-as art-joint-anim #f) + (the-as (function process-drawable symbol) false-func) + ) + (set! (-> self draw force-lod) -1) + (send-event *target* 'blend-shape #f) + (ja-channel-set! 1) + (ja :group! fishermans-boat-idle-ja) + (vector<-cspace! (-> self root-overlay trans) (-> self node-list data 3)) + (matrix->quaternion (-> self root-overlay quat) (-> self node-list data 3 bone transform)) + (fishermans-boat-reset-physics) + (transform-post) + (when *target* + (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) + (send-event *target* 'trans 'restore (-> self old-target-pos)) + (send-event *target* 'end-mode) + (update-transforms! (-> self root-overlay)) + (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) + (logior! (-> *target* control status) (cshape-moving-flags onsurf onground tsurf)) + (suspend) + (send-event *camera* 'teleport-to-other-start-string) + ) + (set-continue! *game-info* "village1-hut") ) (set! (-> self waiting-for-player) #t) (set! (-> self ignition) #f) @@ -1757,8 +1613,7 @@ (go fishermans-boat-docked-village) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (fishermans-boat-spawn-particles 81920.0) (fishermans-boat-play-sounds) diff --git a/goal_src/levels/village1/sage.gc b/goal_src/levels/village1/sage.gc index 1a46c7570e..deb39e091d 100644 --- a/goal_src/levels/village1/sage.gc +++ b/goal_src/levels/village1/sage.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/sage-ag.gc") + (deftype sage (process-taskable) ((reminder-played basic :offset-assert 380) (assistant handle :offset-assert 384) @@ -18,345 +20,317 @@ ) -(defskelgroup *sage-sg* sage - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *sage-sg* sage sage-lod0-jg sage-idle-ecorocks-breathe-ja + ((sage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow sage-shadow-mg + ) (defmethod play-anim! sage ((obj sage) (arg0 symbol)) - (with-pp - (when (!= *kernel-boot-message* 'play) - (close-specific-task! (game-task intro) (task-status need-resolution)) - (return (new 'static 'spool-anim - :name "sage-introduction-misty-cannon" - :index 8 - :parts 12 - :command-list - '((1 blackout 0) - (100 want-levels village1 misty) - (261 joint "cameraB") - (521 joint "camera") - (776 joint "cameraB") - (810 joint "camera") - (1171 joint "cameraB") - (1235 joint "camera") - (1235 save) - (1418 blackout 30) - ) + (when (!= *kernel-boot-message* 'play) + (close-specific-task! (game-task intro) (task-status need-resolution)) + (return (new 'static 'spool-anim + :name "sage-introduction-misty-cannon" + :index 8 + :parts 12 + :command-list '((1 blackout 0) + (100 want-levels village1 misty) + (261 joint "cameraB") + (521 joint "camera") + (776 joint "cameraB") + (810 joint "camera") + (1171 joint "cameraB") + (1235 joint "camera") + (1235 save) + (1418 blackout 30) ) ) - ) - (case (current-status (-> obj tasks)) - (((task-status need-hint) (task-status need-introduction)) - (case (current-task (-> obj tasks)) - (((game-task intro)) - (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (set-setting! *setting-control* pp 'music-volume-movie 'abs 0.0 0) - (copy-settings-from-target! *setting-control*) ) - (new 'static 'spool-anim - :name "sage-intro-sequence-d1" - :index 16 - :parts 17 - :command-list - '((0 display-level misty #f) - (0 display-level village1 display) - (0 want-vis vi1) - (0 save) - (0 want-force-inside village1 #t) - (0 want-force-vis village1 #t) - (0 kill "assistant-11") - (0 kill "reflector-middle-2") - (0 kill "eco-11") - (0 kill "eco-10") - (0 kill "sharkey-12") - (0 kill "reflector-end-1") - (0 kill "water-vol-10") - (0 kill "water-vol-8") - (0 kill "water-vol-7") - (0 kill "fishermans-boat-2") - (0 kill "revcycleprop-2") - (0 kill "revcycle-8") - (0 kill "ropebridge-5") - (0 kill "ropebridge-4") - (0 kill "villagea-water-2") - (0 time-of-day 7) - (1 time-of-day -1) - (3 blackout 0) - (25 blackout 0) - (25 want-force-vis village1 #f) - (56 joint "cameraB") - (100 want-force-inside village1 #f) - (107 joint "camera") - (137 joint "cameraB") - (202 joint "camera") - (286 joint "cameraB") - (554 joint "camera") - (633 joint "cameraB") - (711 joint "camera") - (796 joint "cameraB") - (921 joint "camera") - (1021 shadow self #f) - (1021 joint "cameraB") - (1081 joint "camera") - (1183 joint "cameraB") - (1221 joint "camera") - (1496 shadow self #t) - (1496 joint "cameraB") - (1496 time-of-day 18) - (1721 joint "camera") - (1721 time-of-day 7) - (1722 time-of-day -1) - ) + ) + (case (current-status (-> obj tasks)) + (((task-status need-hint) (task-status need-introduction)) + (case (current-task (-> obj tasks)) + (((game-task intro)) + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (set-setting! 'music-volume-movie 'abs 0.0 0) + (apply-settings *setting-control*) + ) + (new 'static 'spool-anim + :name "sage-intro-sequence-d1" + :index 16 + :parts 17 + :command-list '((0 display-level misty #f) + (0 display-level village1 display) + (0 want-vis vi1) + (0 save) + (0 want-force-inside village1 #t) + (0 want-force-vis village1 #t) + (0 kill "assistant-11") + (0 kill "reflector-middle-2") + (0 kill "eco-11") + (0 kill "eco-10") + (0 kill "sharkey-12") + (0 kill "reflector-end-1") + (0 kill "water-vol-10") + (0 kill "water-vol-8") + (0 kill "water-vol-7") + (0 kill "fishermans-boat-2") + (0 kill "revcycleprop-2") + (0 kill "revcycle-8") + (0 kill "ropebridge-5") + (0 kill "ropebridge-4") + (0 kill "villagea-water-2") + (0 time-of-day 7) + (1 time-of-day -1) + (3 blackout 0) + (25 blackout 0) + (25 want-force-vis village1 #f) + (56 joint "cameraB") + (100 want-force-inside village1 #f) + (107 joint "camera") + (137 joint "cameraB") + (202 joint "camera") + (286 joint "cameraB") + (554 joint "camera") + (633 joint "cameraB") + (711 joint "camera") + (796 joint "cameraB") + (921 joint "camera") + (1021 shadow self #f) + (1021 joint "cameraB") + (1081 joint "camera") + (1183 joint "cameraB") + (1221 joint "camera") + (1496 shadow self #t) + (1496 joint "cameraB") + (1496 time-of-day 18) + (1721 joint "camera") + (1721 time-of-day 7) + (1722 time-of-day -1) ) ) - (((game-task beach-ecorocks)) - (when arg0 - (let* ((s5-1 (-> obj tasks)) - (s4-0 (method-of-object s5-1 save-reminder)) - (a1-6 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-6 from) pp) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'query) - (set! (-> a1-6 param 0) (the-as uint 'pickup)) - (set! (-> a1-6 param 1) (the-as uint 6)) - (s4-0 s5-1 (the int (the-as float (send-event-function *target* a1-6))) 1) - ) - (close-status! (-> obj tasks) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name "sage-intro-sequence-e" - :index 14 - :parts 13 - :command-list - '((0 want-levels village1 beach) - (0 blackout 0) - (197 joint "cameraB") - (361 joint "camera") - (660 joint "cameraB") - (937 display-level beach movie) - (937 want-force-vis beach #t) - (938 alive "ecoventrock-3") - (938 alive "ecoventrock-4") - (938 alive "ecoventrock-5") - (938 alive "ecoventrock-6") - (938 alive "ecoventrock-7") - (938 alive "harvester-87") - (938 alive "harvester-88") - (938 alive "harvester-89") - (938 alive "harvester-90") - (938 alive "harvester-91") - (940 joint "camera") - (1160 joint "cameraB") - (1162 dead "ecoventrock-3") - (1162 dead "ecoventrock-4") - (1162 dead "ecoventrock-5") - (1162 dead "ecoventrock-6") - (1162 dead "ecoventrock-7") - (1162 dead "harvester-87") - (1162 dead "harvester-88") - (1162 dead "harvester-89") - (1162 dead "harvester-90") - (1162 dead "harvester-91") - (1310 joint "camera") - (1313 want-force-vis beach #f) - (1313 display-level beach #f) - (1313 send-event "warp-gate-switch-3" 'hide) - ) - ) - ) - (else - (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name "sage-introduction-misty-cannon" - :index 8 - :parts 12 - :command-list - '((0 want-levels village1 beach) - (261 joint "cameraB") - (521 joint "camera") - (776 joint "cameraB") - (810 joint "camera") - (1171 joint "cameraB") - (1235 joint "camera") - ) - ) - ) - ) - ) - (((task-status need-reminder)) - (set! (-> obj skippable) #t) - (if arg0 - (set! (-> obj reminder-played) #t) - ) - (case (get-reminder (-> obj tasks) 0) - ((3) - (new 'static 'spool-anim :name "sage-reminder-2-generic" :index 13 :parts 4 :command-list '()) - ) - ((2) - (new 'static 'spool-anim :name "sage-reminder-1-generic" :index 12 :parts 3 :command-list '()) - ) - ((1) - (new 'static 'spool-anim - :name "sage-reminder-1-misty-cannon" - :index 9 - :parts 5 - :command-list - '((86 joint "cameraB") (320 joint "camera")) - ) - ) - (else - (new 'static 'spool-anim - :name "sage-reminder-1-ecorocks" - :index 11 - :parts 4 - :command-list - '((0 want-levels village1 beach) - (245 display-level beach movie) - (245 want-force-vis beach #t) - (246 alive "ecoventrock-3") - (246 alive "ecoventrock-4") - (246 alive "ecoventrock-5") - (246 alive "ecoventrock-6") - (246 alive "ecoventrock-7") - (246 alive "harvester-87") - (246 alive "harvester-88") - (246 alive "harvester-89") - (246 alive "harvester-90") - (246 alive "harvester-91") - (246 joint "cameraB") - (365 want-force-vis beach #f) - (365 display-level beach #f) - (366 joint "camera") - ) - ) - ) - ) - ) - (((task-status need-reward-speech)) - (when arg0 - (set-setting! *setting-control* pp 'music-volume-movie 'abs 0.0 0) - (copy-settings-from-target! *setting-control*) - (close-status! (-> obj tasks) (task-status need-reward-speech)) - (let ((s5-2 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj assistant) - (ppointer->handle - (when s5-2 - (let ((t9-15 (method-of-type manipy activate))) - (t9-15 (the-as manipy s5-2) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 manipy-init (-> obj root-override trans) (-> obj entity) *assistant-sg* #f) - (-> s5-2 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj assistant)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj assistant)) 'blend-shape #t) - (send-event (handle->process (-> obj assistant)) 'center-joint 3) - (let ((v1-68 (handle->process (-> obj assistant)))) - (if v1-68 - (set! (-> (the-as assistant v1-68) draw light-index) (the-as uint 1)) - ) - ) - (set! (-> obj draw bounds w) 40960.0) - ) - (new 'static 'spool-anim - :name "sage-intro-sequence-d2" - :index 15 - :parts 20 - :command-list - '((0 want-levels village1 beach) - (0 kill "assistant-11") - (0 kill "reflector-middle-2") - (0 kill "eco-11") - (0 kill "eco-10") - (0 kill "sharkey-12") - (0 kill "reflector-end-1") - (0 kill "water-vol-10") - (0 kill "water-vol-8") - (0 kill "water-vol-7") - (0 kill "fishermans-boat-2") - (0 kill "revcycleprop-2") - (0 kill "revcycle-8") - (113 joint "cameraB") - (232 joint "camera") - (289 joint "cameraB") - (338 joint "camera") - (405 joint "cameraB") - (560 joint "camera") - (660 joint "cameraB") - (699 joint "camera") - (837 joint "cameraB") - (837 shadow self #f) - (910 joint "camera") - (945 alive "farmer-3") - (945 alive "hutlamp-2") - (950 joint "cameraB") - (974 display-level beach movie) - (974 want-force-vis beach #t) - (1011 alive "bird-lady-4") - (1015 joint "camera") - (1018 dead "farmer-3") - (1018 dead "hutlamp-2") - (1075 alive "explorer-4") - (1080 joint "cameraB") - (1080 want-force-vis beach #f) - (1080 display-level beach #f) - (1082 dead "bird-lady-4") - (1133 joint "camera") - (1135 dead "explorer-4") - (1244 display-level beach movie) - (1244 want-force-vis beach #t) - (1245 alive "fuel-cell-42") - (1246 joint "cameraB") - (1369 joint "camera") - (1438 alive "fuel-cell-42") - (1438 want-force-vis beach #f) - (1438 dead "fuel-cell-42") - (1438 kill "villagea-water-2") - (1438 kill "crate-3147") - (1438 kill "crate-3146") - (1438 kill "crate-3143") - (1438 kill "sagesail-6") - (1438 kill "windmill-sail-4") - (1438 kill "ropebridge-4") - (1438 kill "ropebridge-5") - (1438 kill "windspinner-8") - (1438 kill "windspinner-9") - (1438 joint "cameraB") - (1439 want-levels village1 training) - (1439 save) - (1529 joint "camera") - (1691 joint "cameraB") - (1753 joint "camera") - (1874 joint "cameraB") - (2057 joint "camera") - (2176 joint "cameraB") - (2226 joint "camera") - (2226 shadow self #t) - ) - ) - ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) - ) - (get-art-elem obj) ) + (((game-task beach-ecorocks)) + (when arg0 + (let* ((s5-1 (-> obj tasks)) + (s4-0 (method-of-object s5-1 save-reminder)) + ) + (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) + ) + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "sage-intro-sequence-e" + :index 14 + :parts 13 + :command-list '((0 want-levels village1 beach) + (0 blackout 0) + (197 joint "cameraB") + (361 joint "camera") + (660 joint "cameraB") + (937 display-level beach movie) + (937 want-force-vis beach #t) + (938 alive "ecoventrock-3") + (938 alive "ecoventrock-4") + (938 alive "ecoventrock-5") + (938 alive "ecoventrock-6") + (938 alive "ecoventrock-7") + (938 alive "harvester-87") + (938 alive "harvester-88") + (938 alive "harvester-89") + (938 alive "harvester-90") + (938 alive "harvester-91") + (940 joint "camera") + (1160 joint "cameraB") + (1162 dead "ecoventrock-3") + (1162 dead "ecoventrock-4") + (1162 dead "ecoventrock-5") + (1162 dead "ecoventrock-6") + (1162 dead "ecoventrock-7") + (1162 dead "harvester-87") + (1162 dead "harvester-88") + (1162 dead "harvester-89") + (1162 dead "harvester-90") + (1162 dead "harvester-91") + (1310 joint "camera") + (1313 want-force-vis beach #f) + (1313 display-level beach #f) + (1313 send-event "warp-gate-switch-3" 'hide) + ) + ) + ) + (else + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "sage-introduction-misty-cannon" + :index 8 + :parts 12 + :command-list '((0 want-levels village1 beach) + (261 joint "cameraB") + (521 joint "camera") + (776 joint "cameraB") + (810 joint "camera") + (1171 joint "cameraB") + (1235 joint "camera") + ) + ) + ) + ) + ) + (((task-status need-reminder)) + (set! (-> obj skippable) #t) + (if arg0 + (set! (-> obj reminder-played) #t) + ) + (case (get-reminder (-> obj tasks) 0) + ((3) + (new 'static 'spool-anim :name "sage-reminder-2-generic" :index 13 :parts 4 :command-list '()) + ) + ((2) + (new 'static 'spool-anim :name "sage-reminder-1-generic" :index 12 :parts 3 :command-list '()) + ) + ((1) + (new 'static 'spool-anim + :name "sage-reminder-1-misty-cannon" + :index 9 + :parts 5 + :command-list '((86 joint "cameraB") (320 joint "camera")) + ) + ) + (else + (new 'static 'spool-anim + :name "sage-reminder-1-ecorocks" + :index 11 + :parts 4 + :command-list '((0 want-levels village1 beach) + (245 display-level beach movie) + (245 want-force-vis beach #t) + (246 alive "ecoventrock-3") + (246 alive "ecoventrock-4") + (246 alive "ecoventrock-5") + (246 alive "ecoventrock-6") + (246 alive "ecoventrock-7") + (246 alive "harvester-87") + (246 alive "harvester-88") + (246 alive "harvester-89") + (246 alive "harvester-90") + (246 alive "harvester-91") + (246 joint "cameraB") + (365 want-force-vis beach #f) + (365 display-level beach #f) + (366 joint "camera") + ) + ) + ) + ) + ) + (((task-status need-reward-speech)) + (when arg0 + (set-setting! 'music-volume-movie 'abs 0.0 0) + (apply-settings *setting-control*) + (close-status! (-> obj tasks) (task-status need-reward-speech)) + (set! (-> obj assistant) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *assistant-sg* #f :to obj)) + ) + (send-event (handle->process (-> obj assistant)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj assistant)) 'blend-shape #t) + (send-event (handle->process (-> obj assistant)) 'center-joint 3) + (let ((v1-68 (handle->process (-> obj assistant)))) + (if v1-68 + (set! (-> (the-as assistant v1-68) draw light-index) (the-as uint 1)) + ) + ) + (set! (-> obj draw bounds w) 40960.0) + ) + (new 'static 'spool-anim + :name "sage-intro-sequence-d2" + :index 15 + :parts 20 + :command-list '((0 want-levels village1 beach) + (0 kill "assistant-11") + (0 kill "reflector-middle-2") + (0 kill "eco-11") + (0 kill "eco-10") + (0 kill "sharkey-12") + (0 kill "reflector-end-1") + (0 kill "water-vol-10") + (0 kill "water-vol-8") + (0 kill "water-vol-7") + (0 kill "fishermans-boat-2") + (0 kill "revcycleprop-2") + (0 kill "revcycle-8") + (113 joint "cameraB") + (232 joint "camera") + (289 joint "cameraB") + (338 joint "camera") + (405 joint "cameraB") + (560 joint "camera") + (660 joint "cameraB") + (699 joint "camera") + (837 joint "cameraB") + (837 shadow self #f) + (910 joint "camera") + (945 alive "farmer-3") + (945 alive "hutlamp-2") + (950 joint "cameraB") + (974 display-level beach movie) + (974 want-force-vis beach #t) + (1011 alive "bird-lady-4") + (1015 joint "camera") + (1018 dead "farmer-3") + (1018 dead "hutlamp-2") + (1075 alive "explorer-4") + (1080 joint "cameraB") + (1080 want-force-vis beach #f) + (1080 display-level beach #f) + (1082 dead "bird-lady-4") + (1133 joint "camera") + (1135 dead "explorer-4") + (1244 display-level beach movie) + (1244 want-force-vis beach #t) + (1245 alive "fuel-cell-42") + (1246 joint "cameraB") + (1369 joint "camera") + (1438 alive "fuel-cell-42") + (1438 want-force-vis beach #f) + (1438 dead "fuel-cell-42") + (1438 kill "villagea-water-2") + (1438 kill "crate-3147") + (1438 kill "crate-3146") + (1438 kill "crate-3143") + (1438 kill "sagesail-6") + (1438 kill "windmill-sail-4") + (1438 kill "ropebridge-4") + (1438 kill "ropebridge-5") + (1438 kill "windspinner-8") + (1438 kill "windspinner-9") + (1438 joint "cameraB") + (1439 want-levels village1 training) + (1439 save) + (1529 joint "camera") + (1691 joint "cameraB") + (1753 joint "camera") + (1874 joint "cameraB") + (2057 joint "camera") + (2176 joint "cameraB") + (2226 joint "camera") + (2226 shadow self #t) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) + ) + ) + (get-art-elem obj) ) ) ) @@ -447,10 +421,7 @@ (defmethod TODO-RENAME-43 sage ((obj sage)) (let ((s5-0 (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj))) (when s5-0 - (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-3 (the-as number (logior #x3f800000 v1-2))) - (f0-2 (+ -1.0 (the-as float v1-3))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< (-> s5-0 y) -12288.0) #f @@ -478,8 +449,7 @@ (defstate idle (sage) :virtual #t - :trans - (behavior () + :trans (behavior () (case (get-task-status (game-task intro)) (((task-status need-reward-speech)) (if (process-grab? *target*) @@ -490,51 +460,19 @@ ((-> (method-of-type process-taskable idle) trans)) (none) ) - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 60) - ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.2)) ) + (loop + (ja :group! (get-art-elem self)) (let* ((f30-0 3.0) (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-10 (the-as number (logior #x3f800000 v1-9))) ) (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-10)))) 5)) (TODO-RENAME-43 self) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-11 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! - a0-11 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (and (-> self reminder-played) (< 81920.0 (vector-vector-distance (-> self root-override trans) (camera-pos))) @@ -542,35 +480,15 @@ (go-virtual idle) ) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 4) - ) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-20 param 1) 1.0) - (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (when (ja-group? sage-idle-ecorocks-breathe-ja) + (ja-no-eval :group! sage-idle-ecorocks-peer-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -580,8 +498,7 @@ (defstate play-anim (sage) :virtual #t - :exit - (behavior () + :exit (behavior () (set! (-> self draw bounds w) 10240.0) (let ((a0-1 (handle->process (-> self assistant)))) (if a0-1 @@ -591,15 +508,14 @@ ((-> (method-of-type process-taskable play-anim) exit)) (case (get-task-status (game-task intro)) (((task-status need-resolution)) - (clear-pending-settings-from-process *setting-control* self 'music-volume-movie) + (remove-setting! 'music-volume-movie) (close-specific-task! (game-task intro) (task-status need-resolution)) (start 'play (get-continue-by-name *game-info* "game-start")) ) ) (none) ) - :trans - (behavior () + :trans (behavior () (case (get-task-status (game-task intro)) (((task-status need-reward-speech)) (spool-push *art-control* "sage-intro-sequence-d2" 0 self -1.0) diff --git a/goal_src/levels/village1/sequence-a-village1.gc b/goal_src/levels/village1/sequence-a-village1.gc index 098bced966..5f3a346a1b 100644 --- a/goal_src/levels/village1/sequence-a-village1.gc +++ b/goal_src/levels/village1/sequence-a-village1.gc @@ -14,13 +14,11 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2854 :period 900 :length 600)) + :parts ((sp-item 2854 :period 900 :length 600)) ) (defpart 2854 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 128.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) @@ -48,13 +46,11 @@ :linger-duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2855)) + :parts ((sp-item 2855)) ) (defpart 2855 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-scale-x (meters 0.025) (meters 0.025) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -78,25 +74,24 @@ ) ) +;; PAL patch here (defpartgroup group-sequenceAV-2d-intro-mist :id 688 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2858 :period 300 :length 5 :binding 2856) + :parts ((sp-item 2858 :period 300 :length 5 :binding 2856) (sp-item 2856 :flags (start-dead launch-asap) :binding 2857) (sp-item 2856 :flags (start-dead launch-asap) :binding 2857) (sp-item 2857 :flags (start-dead)) (sp-item 2857 :flags (start-dead)) (sp-item 2857 :flags (start-dead)) (sp-item 2859) - (sp-item 2860) + (sp-item 2860 :flags (bit6)) ) ) (defpart 2858 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2.5) (meters 5) 1.0) (sp-rnd-flt spt-y (meters -1.5) (meters 3) 1.0) @@ -112,8 +107,7 @@ ) (defpart 2856 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -136,8 +130,7 @@ ) (defpart 2857 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -156,8 +149,7 @@ ) (defpart 2860 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters -3.90625)) (sp-flt spt-scale-x (meters 15)) @@ -172,8 +164,7 @@ ) (defpart 2859 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.3) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters -3) (meters 6) 1.0) @@ -197,16 +188,14 @@ ) (defpart 2861 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 300 299 1) (sp-launcher-by-id spt-next-launcher 2862) ) ) (defpart 2862 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) (deftype sequenceA-village1 (process-taskable) @@ -229,29 +218,20 @@ (send-event *camera* 'force-blend 0) (send-event *camera* 'change-state cam-fixed 0) (send-event *target* 'sidekick #f) - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj boat) - (ppointer->handle - (when s5-0 - (let ((t9-6 (method-of-type manipy activate))) - (t9-6 (the-as manipy s5-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> obj root-override trans) (-> obj entity) *fishermans-boat-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> obj boat) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *fishermans-boat-sg* #f :to obj)) + ) (send-event (handle->process (-> obj boat)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj boat)) 'origin-joint-index 3) ) + ;; PAL patch here (the-as basic (new 'static 'spool-anim :name "sage-intro-sequence-a" :index 17 :parts 22 - :command-list - '((0 blackout 0) + :command-list '((0 blackout 0) (0 want-levels village1 misty) + (1120 send-event self pause) (1210 display-level misty display) (1210 want-vis mis) (1210 want-force-vis misty #t) @@ -281,8 +261,7 @@ (defstate play-anim (sequenceA-village1) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('sidekick-human) (format 0 "got sidekick-human~%") @@ -290,19 +269,9 @@ (let ((gp-1 (entity-by-name "sequenceA-1"))) (when gp-1 (format 0 "found entity for sidekick-human~%") - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self side) - (ppointer->handle - (when s5-0 - (let ((t9-5 (method-of-type manipy activate))) - (t9-5 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> self root-override trans) gp-1 *sidekick-human-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> self side) + (ppointer->handle (manipy-spawn (-> self root-override trans) gp-1 *sidekick-human-sg* #f :to self)) + ) (send-event (handle->process (-> self side)) 'anim-mode 'clone-anim) (send-event (handle->process (-> self side)) 'center-joint 3) (send-event (handle->process (-> self side)) 'blend-shape #t) @@ -310,10 +279,16 @@ ) ) ) + ;; PAL patch here + (('pause) + (let ((v0-2 (the-as object (logior (-> self mask) (process-mask pause))))) + (set! (-> self mask) (the-as process-mask v0-2)) + v0-2 + ) + ) ) ) - :exit - (behavior () + :exit (behavior () (send-event *target* 'sidekick #t) (let ((a0-2 (handle->process (-> self boat)))) (if a0-2 @@ -339,8 +314,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "sage-intro-sequence-b" 0 self -1.0) ((-> (method-of-type process-taskable play-anim) trans)) (none) @@ -383,7 +357,7 @@ (none) ) -(defbehavior sequenceA-village1-init-by-other sequenceA-village1 ((arg0 entity)) +(defbehavior sequenceA-village1-init-by-other sequenceA-village1 ((arg0 entity-actor)) (set! (-> self entity) arg0) (dummy-40 self arg0 *sage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> self tasks) (get-task-control (game-task intro))) @@ -394,24 +368,16 @@ (set! (-> self cur-trans-hook) sequenceA-village1-trans-hook) (logclear! (-> self mask) (process-mask pause actor-pause)) (set! (-> self been-kicked) #t) - (set-setting! *setting-control* self 'music-volume-movie 'abs 0.0 0) - (set-setting! *setting-control* self 'sfx-volume-movie 'abs 0.0 0) - (set-setting! *setting-control* self 'ambient-volume-movie 'abs 0.0 0) + (set-setting! 'music-volume-movie 'abs 0.0 0) + (set-setting! 'sfx-volume-movie 'abs 0.0 0) + (set-setting! 'ambient-volume-movie 'abs 0.0 0) (go-virtual hidden) (none) ) (defun start-sequence-a () (set-blackout-frames (seconds 100)) - (let ((gp-0 (get-process *default-dead-pool* sequenceA-village1 #x4000))) - (when gp-0 - (let ((t9-2 (method-of-type sequenceA-village1 activate))) - (t9-2 (the-as sequenceA-village1 gp-0) *entity-pool* 'sequenceA-village1 (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 sequenceA-village1-init-by-other (entity-by-name "sage-23")) - (-> gp-0 ppointer) - ) - ) + (process-spawn sequenceA-village1 (entity-by-name "sage-23") :to *entity-pool*) 0 (none) ) diff --git a/goal_src/levels/village1/village-obs.gc b/goal_src/levels/village1/village-obs.gc index 0a8cc9269b..94916e6f22 100644 --- a/goal_src/levels/village1/village-obs.gc +++ b/goal_src/levels/village1/village-obs.gc @@ -5,142 +5,106 @@ ;; name in dgo: village-obs ;; dgos: VI1 -(define-extern *revcycle-sg* skeleton-group) -(define-extern *revcycleprop-sg* skeleton-group) -(define-extern *hutlamp-sg* skeleton-group) -(define-extern *starfish-sg* skeleton-group) -(define-extern *starfish-nav-enemy-info* nav-enemy-info) -(define-extern *reflector-middle-sg* skeleton-group) -(define-extern *mayorgears-sg* skeleton-group) -(define-extern *windspinner-sg* skeleton-group) -(define-extern *sagesail-sg* skeleton-group) -(define-extern *windmill-sail-sg* skeleton-group) -(define-extern *med-res-jungle-sg* skeleton-group) -(define-extern *med-res-jungle1-sg* skeleton-group) -(define-extern *med-res-jungle2-sg* skeleton-group) -(define-extern *med-res-beach-sg* skeleton-group) -(define-extern *med-res-beach1-sg* skeleton-group) -(define-extern *med-res-beach2-sg* skeleton-group) -(define-extern *med-res-beach3-sg* skeleton-group) -(define-extern *med-res-misty-sg* skeleton-group) -(define-extern *med-res-village11-sg* skeleton-group) -(define-extern *med-res-village12-sg* skeleton-group) -(define-extern *med-res-village13-sg* skeleton-group) -(define-extern *med-res-training-sg* skeleton-group) - -(declare-type windmill-sail process-drawable) -(declare-type sagesail process-drawable) -(declare-type windspinner process-drawable) -(declare-type mayorgears process-drawable) -(declare-type reflector-middle process-drawable) -(declare-type starfish nav-enemy) -(declare-type reflector-end process-drawable) -(declare-type hutlamp process-drawable) -(declare-type village-fish process-drawable) -(declare-type villa-starfish process-drawable) - ;; DECOMP BEGINS -(defskelgroup *med-res-jungle-sg* medres-jungle - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -80 0 -80 240) - :longest-edge (meters 0.01) - ) +(import "goal_src/import/windmill-sail-ag.gc") +(import "goal_src/import/medres-beach3-ag.gc") +(import "goal_src/import/mayorgears-ag.gc") +(import "goal_src/import/medres-village11-ag.gc") +(import "goal_src/import/revcycleprop-ag.gc") +(import "goal_src/import/medres-jungle2-ag.gc") +(import "goal_src/import/revcycle-ag.gc") +(import "goal_src/import/medres-misty-ag.gc") +(import "goal_src/import/sagesail-ag.gc") +(import "goal_src/import/windspinner-ag.gc") +(import "goal_src/import/medres-jungle1-ag.gc") +(import "goal_src/import/medres-village12-ag.gc") +(import "goal_src/import/hutlamp-ag.gc") +(import "goal_src/import/medres-jungle-ag.gc") +(import "goal_src/import/medres-village13-ag.gc") +(import "goal_src/import/medres-beach2-ag.gc") +(import "goal_src/import/villa-starfish-ag.gc") +(import "goal_src/import/medres-training-ag.gc") +(import "goal_src/import/medres-beach-ag.gc") +(import "goal_src/import/reflector-middle-ag.gc") +(import "goal_src/import/medres-beach1-ag.gc") +(import "goal_src/import/evilplant-ag.gc") -(defskelgroup *med-res-jungle1-sg* medres-jungle1 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 30 0 -40 230) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-jungle-sg* medres-jungle medres-jungle-lod0-jg medres-jungle-idle-ja + ((medres-jungle-lod0-mg (meters 999999))) + :bounds (static-spherem -80 0 -80 240) + :longest-edge (meters 0.01) + ) -(defskelgroup *med-res-jungle2-sg* medres-jungle2 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 90 0 130 110) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-jungle1-sg* medres-jungle1 medres-jungle1-lod0-jg medres-jungle1-idle-ja + ((medres-jungle1-lod0-mg (meters 999999))) + :bounds (static-spherem 30 0 -40 230) + :longest-edge (meters 0.01) + ) -(defskelgroup *med-res-beach-sg* medres-beach - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 -140 200) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-jungle2-sg* medres-jungle2 medres-jungle2-lod0-jg medres-jungle2-idle-ja + ((medres-jungle2-lod0-mg (meters 999999))) + :bounds (static-spherem 90 0 130 110) + :longest-edge (meters 0.01) + ) -(defskelgroup *med-res-beach1-sg* medres-beach1 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 -360 200) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-beach-sg* medres-beach medres-beach-lod0-jg medres-beach-idle-ja + ((medres-beach-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -140 200) + :longest-edge (meters 0.01) + ) -(defskelgroup *med-res-beach2-sg* medres-beach2 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -200 0 -450 180) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-beach1-sg* medres-beach1 medres-beach1-lod0-jg medres-beach1-idle-ja + ((medres-beach1-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -360 200) + :longest-edge (meters 0.01) + ) -(defskelgroup *med-res-beach3-sg* medres-beach3 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 75 70 -480 100) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-beach2-sg* medres-beach2 medres-beach2-lod0-jg medres-beach2-idle-ja + ((medres-beach2-lod0-mg (meters 999999))) + :bounds (static-spherem -200 0 -450 180) + :longest-edge (meters 0.01) + ) -(defskelgroup *med-res-misty-sg* medres-misty - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -40 0 -20 260) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-beach3-sg* medres-beach3 medres-beach3-lod0-jg medres-beach3-idle-ja + ((medres-beach3-lod0-mg (meters 999999))) + :bounds (static-spherem 75 70 -480 100) + :longest-edge (meters 0.01) + ) -(defskelgroup *med-res-village11-sg* medres-village11 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -100 0 90 200) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-misty-sg* medres-misty medres-misty-lod0-jg medres-misty-idle-ja + ((medres-misty-lod0-mg (meters 999999))) + :bounds (static-spherem -40 0 -20 260) + :longest-edge (meters 0.01) + ) -(defskelgroup *med-res-village12-sg* medres-village12 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 40 0 -50 155) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-village11-sg* medres-village11 medres-village11-lod0-jg medres-village11-idle-ja + ((medres-village11-lod0-mg (meters 999999))) + :bounds (static-spherem -100 0 90 200) + :longest-edge (meters 0.01) + ) -(defskelgroup *med-res-village13-sg* medres-village13 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 180 -40 -40 180) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-village12-sg* medres-village12 medres-village12-lod0-jg medres-village12-idle-ja + ((medres-village12-lod0-mg (meters 999999))) + :bounds (static-spherem 40 0 -50 155) + :longest-edge (meters 0.01) + ) -(defskelgroup *med-res-training-sg* medres-training - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 -60 220) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-village13-sg* medres-village13 medres-village13-lod0-jg medres-village13-idle-ja + ((medres-village13-lod0-mg (meters 999999))) + :bounds (static-spherem 180 -40 -40 180) + :longest-edge (meters 0.01) + ) + +(defskelgroup *med-res-training-sg* medres-training medres-training-lod0-jg medres-training-idle-ja + ((medres-training-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -60 220) + :longest-edge (meters 0.01) + ) (defpart 368 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 2.5) (sp-flt spt-x (meters 0.8)) (sp-flt spt-scale-x (meters 1.7)) @@ -161,8 +125,7 @@ ) (defpart 369 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-x (meters 4)) (sp-flt spt-scale-x (meters 0.5)) @@ -189,8 +152,7 @@ ) (defpart 370 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 4)) (sp-flt spt-scale-x (meters 1.7)) @@ -216,8 +178,7 @@ ) (defpart 371 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 3.8) (sp-flt spt-x (meters 5.5)) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -274,19 +235,19 @@ (none) ) -(defskelgroup *windmill-sail-sg* windmill-sail - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 21) - :longest-edge (meters 14.9) - ) +(defskelgroup *windmill-sail-sg* windmill-sail windmill-sail-lod0-jg windmill-sail-idle-ja + ((windmill-sail-lod0-mg (meters 20)) + (windmill-sail-lod1-mg (meters 40)) + (windmill-sail-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 21) + :longest-edge (meters 14.9) + ) (defpartgroup group-win-wind-mill :id 123 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 368 :fade-after (meters 100)) + :parts ((sp-item 368 :fade-after (meters 100)) (sp-item 369 :fade-after (meters 100)) (sp-item 370 :fade-after (meters 200)) (sp-item 371 :fade-after (meters 200)) @@ -296,13 +257,11 @@ (defpartgroup group-win-wind-mill-hires :id 124 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 368) (sp-item 369) (sp-item 370) (sp-item 371)) + :parts ((sp-item 368) (sp-item 369) (sp-item 370) (sp-item 371)) ) (defstate windmill-sail-idle (windmill-sail) - :trans - (behavior () + :trans (behavior () (cond ((task-closed? (game-task jungle-lurkerm) (task-status need-reminder)) (let ((f30-0 (get-current-value (-> self sync) 65536.0))) @@ -353,10 +312,8 @@ ) (none) ) - :code - (the-as (function none :behavior windmill-sail) anim-loop) - :post - (the-as (function none :behavior windmill-sail) ja-post) + :code (the-as (function none :behavior windmill-sail) anim-loop) + :post (the-as (function none :behavior windmill-sail) ja-post) ) (defmethod init-from-entity! windmill-sail ((obj windmill-sail) (arg0 entity-actor)) @@ -392,17 +349,14 @@ ) -(defskelgroup *sagesail-sg* sagesail - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 25.5) - :longest-edge (meters 24.2) - ) +(defskelgroup *sagesail-sg* sagesail sagesail-lod0-jg sagesail-idle-ja + ((sagesail-lod0-mg (meters 20)) (sagesail-lod1-mg (meters 40)) (sagesail-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25.5) + :longest-edge (meters 24.2) + ) (defstate sagesail-idle (sagesail) - :trans - (behavior () + :trans (behavior () (let ((f0-0 (get-current-value (-> self sync) 65536.0))) (quaternion-axis-angle! (-> self root-override quat) @@ -416,10 +370,8 @@ (quaternion-normalize! (-> self root-override quat)) (none) ) - :code - (the-as (function none :behavior sagesail) anim-loop) - :post - (the-as (function none :behavior sagesail) ja-post) + :code (the-as (function none :behavior sagesail) anim-loop) + :post (the-as (function none :behavior sagesail) ja-post) ) (defmethod init-from-entity! sagesail ((obj sagesail) (arg0 entity-actor)) @@ -466,17 +418,13 @@ ) ) -(defskelgroup *windspinner-sg* windspinner - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *windspinner-sg* windspinner windspinner-lod0-jg windspinner-idle-ja + ((windspinner-lod0-mg (meters 20)) (windspinner-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) (defstate windspinner-idle (windspinner) - :trans - (behavior () + :trans (behavior () (let* ((f0-0 0.992) (f1-0 0.008090864) (a0-0 (-> self root trans)) @@ -512,10 +460,8 @@ (quaternion-normalize! (-> self root quat)) (none) ) - :code - (the-as (function none :behavior windspinner) anim-loop) - :post - (the-as (function none :behavior windspinner) ja-post) + :code (the-as (function none :behavior windspinner) anim-loop) + :post (the-as (function none :behavior windspinner) ja-post) ) (defmethod init-from-entity! windspinner ((obj windspinner) (arg0 entity-actor)) @@ -546,38 +492,23 @@ ) -(defskelgroup *mayorgears-sg* mayorgears - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4.5) - :longest-edge (meters 0) - ) +(defskelgroup *mayorgears-sg* mayorgears mayorgears-geo-jg mayorgears-idle-ja + ((mayorgears-geo-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.5) + ) (defstate mayorgears-idle (mayorgears) - :code - (behavior () - (while #t - (cond - ((task-closed? (game-task jungle-lurkerm) (task-status need-reminder)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-loop!) - ) - ) - (else - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) 0.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) - ) + :code (behavior () + (loop + (if (task-closed? (game-task jungle-lurkerm) (task-status need-reminder)) + (ja :num! (loop!)) + (ja :num! (loop! 0.0)) ) - ) (suspend) ) (none) ) - :post - (the-as (function none :behavior mayorgears) ja-post) + :post (the-as (function none :behavior mayorgears) ja-post) ) (defmethod init-from-entity! mayorgears ((obj mayorgears) (arg0 entity-actor)) @@ -590,6 +521,53 @@ (none) ) +;; PAL patch here +(deftype evilplant (process-drawable) + () + :heap-base #x40 + :method-count-assert 21 + :size-assert #xb0 + :flag-assert #x15004000b0 + (:methods + (idle () _type_ :state 20) + ) + ) + +(defmethod inspect evilplant ((obj evilplant)) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + obj + ) + +(defskelgroup *evilplant-sg* evilplant evilplant-lod0-jg evilplant-idle-ja + ((evilplant-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 3.8) + ) + +(defstate idle (evilplant) + :virtual #t + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (none) + ) + :post (the-as (function none :behavior evilplant) ja-post) + ) + +(defmethod init-from-entity! evilplant ((obj evilplant) (arg0 entity-actor)) + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton obj *evilplant-sg* '()) + (go (method-of-object obj idle)) + (none) + ) + (deftype reflector-middle (process-drawable) ((reflector-trans vector :inline :offset-assert 176) (next-reflector-trans vector :inline :offset-assert 192) @@ -604,27 +582,21 @@ ) -(defskelgroup *reflector-middle-sg* reflector-middle - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 17 0 17) - :longest-edge (meters 0) - ) +(defskelgroup *reflector-middle-sg* reflector-middle reflector-middle-geo-jg reflector-middle-idle-ja + ((reflector-middle-geo-mg (meters 999999))) + :bounds (static-spherem 0 17 0 17) + ) (defstate reflector-middle-idle (reflector-middle) - :trans - (behavior () + :trans (behavior () (when (task-closed? (game-task jungle-lurkerm) (task-status need-reminder)) (process-entity-status! self (entity-perm-status complete) #t) (draw-eco-beam (-> self reflector-trans) (-> self next-reflector-trans)) ) (none) ) - :code - (the-as (function none :behavior reflector-middle) anim-loop) - :post - (the-as (function none :behavior reflector-middle) ja-post) + :code (the-as (function none :behavior reflector-middle) anim-loop) + :post (the-as (function none :behavior reflector-middle) ja-post) ) (defmethod init-from-entity! reflector-middle ((obj reflector-middle) (arg0 entity-actor)) @@ -659,8 +631,7 @@ (defstate reflector-end-idle (reflector-end) - :code - (the-as (function none :behavior reflector-end) anim-loop) + :code (the-as (function none :behavior reflector-end) anim-loop) ) (defmethod init-from-entity! reflector-end ((obj reflector-end) (arg0 entity-actor)) @@ -683,13 +654,10 @@ ) -(defskelgroup *starfish-sg* villa-starfish - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *starfish-sg* villa-starfish villa-starfish-lod0-jg villa-starfish-idle-ja + ((villa-starfish-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) (deftype starfish (nav-enemy) () @@ -705,45 +673,38 @@ (defstate starfish-idle (starfish) - :enter - (behavior () + :enter (behavior () (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background)) (set! (-> self state-time) (-> *display* base-frame-counter)) (ja-channel-set! 0) (none) ) - :exit - (behavior () + :exit (behavior () (ja-channel-set! 1) (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 163840.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (go starfish-patrol) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior starfish) ja-post) + :post (the-as (function none :behavior starfish) ja-post) ) (defstate starfish-patrol (starfish) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self nav flags) (logior (nav-control-flags bit19) (-> self nav flags))) + (set! (-> self nav flags) (logior (nav-control-flags navcf19) (-> self nav flags))) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (if (or (not *target*) (< 204800.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) @@ -753,34 +714,20 @@ ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self target-speed) 4096.0) (set! (-> self rotate-speed) 12743.111) (set! (-> self turn-time) (seconds 0.5)) - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior starfish) nav-enemy-patrol-post) + :post (the-as (function none :behavior starfish) nav-enemy-patrol-post) ) (define *starfish-nav-enemy-info* (new 'static 'nav-enemy-info @@ -829,7 +776,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -892,24 +839,14 @@ (defbehavior starfish-spawn-child starfish () (let ((gp-0 (new-stack-vector0))) (get-random-point (-> self path) gp-0) - (let ((s5-0 (get-process *default-dead-pool* starfish #x4000))) - (the-as (pointer starfish) (when s5-0 - (let ((t9-2 (method-of-type starfish activate))) - (t9-2 (the-as starfish s5-0) self 'starfish (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 starfish-init-by-other self gp-0) - (-> s5-0 ppointer) - ) - ) - ) + (process-spawn starfish self gp-0 :to self) ) ) (defstate villa-starfish-idle (villa-starfish) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) (set! (-> self state-time) (-> *display* base-frame-counter)) (if (and (and *target* (>= 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) @@ -922,8 +859,7 @@ ) (none) ) - :post - (the-as (function none :behavior villa-starfish) #f) + :post (the-as (function none :behavior villa-starfish) #f) ) (defmethod init-from-entity! villa-starfish ((obj villa-starfish) (arg0 entity-actor)) @@ -951,16 +887,14 @@ (defstate village-fish-idle (village-fish) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior village-fish) #f) + :post (the-as (function none :behavior village-fish) #f) ) (defmethod init-from-entity! village-fish ((obj village-fish) (arg0 entity-actor)) @@ -1037,18 +971,15 @@ ) ) -(defskelgroup *hutlamp-sg* hutlamp - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 1 0 1.2) - :longest-edge (meters 0.7) - ) +(defskelgroup *hutlamp-sg* hutlamp hutlamp-lod0-jg hutlamp-idle-ja + ((hutlamp-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.2) + :longest-edge (meters 0.7) + ) (defstate hutlamp-idle (hutlamp) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((f0-3 (* 1820.4445 (sin (* 65536.0 (update-clock (-> self clock))))))) (quaternion-vector-angle! (-> self pivot transform quat) *x-vector* f0-3) ) @@ -1056,8 +987,7 @@ ) (none) ) - :post - (the-as (function none :behavior hutlamp) ja-post) + :post (the-as (function none :behavior hutlamp) ja-post) ) (defmethod init-from-entity! hutlamp ((obj hutlamp) (arg0 entity-actor)) @@ -1083,20 +1013,15 @@ ) -(defskelgroup *revcycleprop-sg* revcycleprop - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.2) - :longest-edge (meters 0) - ) +(defskelgroup *revcycleprop-sg* revcycleprop revcycleprop-lod0-jg revcycleprop-idle-ja + ((revcycleprop-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.2) + ) (defstate idle (revcycleprop) :virtual #t - :code - (the-as (function none :behavior revcycleprop) anim-loop) - :post - (the-as (function none :behavior revcycleprop) ja-post) + :code (the-as (function none :behavior revcycleprop) anim-loop) + :post (the-as (function none :behavior revcycleprop) ja-post) ) (defmethod init-from-entity! revcycleprop ((obj revcycleprop) (arg0 entity-actor)) @@ -1120,20 +1045,15 @@ ) -(defskelgroup *revcycle-sg* revcycle - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3.2) - :longest-edge (meters 0) - ) +(defskelgroup *revcycle-sg* revcycle revcycle-geo-jg revcycle-idle-ja + ((revcycle-geo-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + ) (defstate idle (revcycle) :virtual #t - :code - (the-as (function none :behavior revcycle) anim-loop) - :post - (the-as (function none :behavior revcycle) ja-post) + :code (the-as (function none :behavior revcycle) anim-loop) + :post (the-as (function none :behavior revcycle) ja-post) ) (defmethod init-from-entity! revcycle ((obj revcycle) (arg0 entity-actor)) @@ -1158,8 +1078,7 @@ :count 3 :converted #f :normal-scale 4.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 10.0 :xdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 10.0 :xdiv -1 :zdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 5.0 :xdiv 5 :zdiv 3 :speed 0.75) diff --git a/goal_src/levels/village1/village1-part.gc b/goal_src/levels/village1/village1-part.gc index 06bf2f8434..bda4286fd3 100644 --- a/goal_src/levels/village1/village1-part.gc +++ b/goal_src/levels/village1/village1-part.gc @@ -19,8 +19,7 @@ (defpartgroup group-village1-butterflies :id 127 :bounds (static-bspherem 0 0 0 30) - :parts - ((sp-item 380 :fade-after (meters 120) :period 4903 :length 5 :hour-mask #b111111100000000000111111 :binding 381) + :parts ((sp-item 380 :fade-after (meters 120) :period 4903 :length 5 :hour-mask #b111111100000000000111111 :binding 381) (sp-item 380 :fade-after (meters 120) :period 6637 :length 5 :hour-mask #b111111100000000000111111 :binding 381) (sp-item 380 :fade-after (meters 120) :period 9846 :length 5 :hour-mask #b111111100000000000111111 :binding 381) (sp-item 381 :flags (start-dead launch-asap) :binding 382) @@ -37,8 +36,7 @@ ) (defpart 380 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 7.5) 1.0) (sp-rnd-flt spt-y (meters 14) (meters 3) 1.0) @@ -57,21 +55,18 @@ ) (defpart 383 - :init-specs - ((sp-flt spt-accel-y 0.0) + :init-specs ((sp-flt spt-accel-y 0.0) (sp-int-plain-rnd spt-next-time 2700 1499 1) (sp-launcher-by-id spt-next-launcher 384) ) ) (defpart 384 - :init-specs - ((sp-flt spt-accel-y 1.3653333)) + :init-specs ((sp-flt spt-accel-y 1.3653333)) ) (defpart 381 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -94,8 +89,7 @@ ) (defpart 385 - :init-specs - ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) (sp-rnd-flt spt-vel-y (meters -0.0074074077) (meters 0.0148148155) 1.0) (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) (sp-int-plain-rnd spt-next-time 150 449 1) @@ -104,8 +98,7 @@ ) (defpart 382 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 0.9)) @@ -124,16 +117,14 @@ (defpartgroup group-village1-moth :id 128 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 386 :fade-after (meters 120) :flags (bit1) :period 18030 :length 5 :hour-mask #b1111111110000000 :binding 387) + :parts ((sp-item 386 :fade-after (meters 120) :flags (bit1) :period 18030 :length 5 :hour-mask #b1111111110000000 :binding 387) (sp-item 387 :flags (start-dead launch-asap) :binding 388) (sp-item 388 :flags (is-3d start-dead)) ) ) (defpart 386 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.1)) (sp-copy-from-other spt-scale-y -4) @@ -146,8 +137,7 @@ ) (defpart 387 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 1.5)) @@ -170,8 +160,7 @@ ) (defpart 389 - :init-specs - ((sp-rnd-flt spt-vel-x (meters -0.035555556) (meters 0.07111111) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters -0.035555556) (meters 0.07111111) 1.0) (sp-rnd-flt spt-vel-y (meters -0.0148148155) (meters 0.029629631) 1.0) (sp-rnd-flt spt-rotvel-z (degrees -0.4) (degrees 0.8) 1.0) (sp-int-plain-rnd spt-next-time 150 449 1) @@ -180,8 +169,7 @@ ) (defpart 388 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 0.4)) @@ -199,8 +187,7 @@ (defpartgroup group-village1-hummingbird :id 129 :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 390 :fade-after (meters 20) :flags (is-3d bit1) :period 6000 :length 5 :hour-mask #b111111100000000000111111) + :parts ((sp-item 390 :fade-after (meters 20) :flags (is-3d bit1) :period 6000 :length 5 :hour-mask #b111111100000000000111111) (sp-item 391 :fade-after (meters 20) :flags (is-3d bit1) :period 6000 :length 5) (sp-item 392 :fade-after (meters 20) :flags (is-3d bit1) :period 6000 :length 5) (sp-item 393 :fade-after (meters 20) :flags (is-3d bit1) :period 6000 :length 5) @@ -210,8 +197,7 @@ ) (defpart 390 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -231,8 +217,7 @@ ) (defpart 396 - :init-specs - ((sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.1) 1.0) + :init-specs ((sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.1) 1.0) (sp-rnd-int spt-a 1119879168 1 16.0) (sp-int spt-next-time 5) (sp-launcher-by-id spt-next-launcher 396) @@ -240,8 +225,7 @@ ) (defpart 391 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -261,8 +245,7 @@ ) (defpart 397 - :init-specs - ((sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.1) 1.0) + :init-specs ((sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.1) 1.0) (sp-rnd-int spt-a 1119879168 1 16.0) (sp-flt spt-accel-x 2.7306666) (sp-flt spt-accel-y 1.3653333) @@ -272,8 +255,7 @@ ) (defpart 398 - :init-specs - ((sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.1) 1.0) + :init-specs ((sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.1) 1.0) (sp-rnd-int spt-a 1119879168 1 16.0) (sp-int spt-next-time 5) (sp-launcher-by-id spt-next-launcher 398) @@ -281,8 +263,7 @@ ) (defpart 392 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -304,8 +285,7 @@ ) (defpart 399 - :init-specs - ((sp-flt spt-rot-x 24576.0) + :init-specs ((sp-flt spt-rot-x 24576.0) (sp-flt spt-rot-y (degrees 90.0)) (sp-rnd-flt spt-rot-z (degrees -70.0) (degrees 140.0) 1.0) (sp-rnd-int spt-a 1107296256 1 32.0) @@ -315,8 +295,7 @@ ) (defpart 393 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -338,8 +317,7 @@ ) (defpart 400 - :init-specs - ((sp-flt spt-rot-x 24576.0) + :init-specs ((sp-flt spt-rot-x 24576.0) (sp-flt spt-rot-y (degrees 90.0)) (sp-rnd-flt spt-rot-z (degrees -70.0) (degrees 140.0) 1.0) (sp-rnd-int spt-a 1107296256 1 32.0) @@ -351,8 +329,7 @@ ) (defpart 401 - :init-specs - ((sp-flt spt-rot-x 24576.0) + :init-specs ((sp-flt spt-rot-x 24576.0) (sp-flt spt-rot-y (degrees 90.0)) (sp-rnd-flt spt-rot-z (degrees -70.0) (degrees 140.0) 1.0) (sp-rnd-int spt-a 1107296256 1 32.0) @@ -362,8 +339,7 @@ ) (defpart 394 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 8192.0) @@ -384,8 +360,7 @@ ) (defpart 402 - :init-specs - ((sp-flt spt-rot-x 8192.0) + :init-specs ((sp-flt spt-rot-x 8192.0) (sp-flt spt-rot-y (degrees -90.0)) (sp-rnd-flt spt-rot-z (degrees -70.0) (degrees 140.0) 1.0) (sp-rnd-int spt-a 1107296256 1 32.0) @@ -395,8 +370,7 @@ ) (defpart 395 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 8192.0) @@ -418,8 +392,7 @@ ) (defpart 403 - :init-specs - ((sp-flt spt-rot-x 8192.0) + :init-specs ((sp-flt spt-rot-x 8192.0) (sp-flt spt-rot-y (degrees -90.0)) (sp-rnd-flt spt-rot-z (degrees -70.0) (degrees 140.0) 1.0) (sp-rnd-int spt-a 1107296256 1 32.0) @@ -431,8 +404,7 @@ ) (defpart 404 - :init-specs - ((sp-flt spt-rot-x 8192.0) + :init-specs ((sp-flt spt-rot-x 8192.0) (sp-flt spt-rot-y (degrees -90.0)) (sp-rnd-flt spt-rot-z (degrees -70.0) (degrees 140.0) 1.0) (sp-rnd-int spt-a 1107296256 1 32.0) @@ -442,8 +414,7 @@ ) (defpart 405 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.03) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 2.3)) @@ -470,8 +441,7 @@ ) (defpart 406 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) @@ -493,8 +463,7 @@ ) (defpart 407 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-flt spt-y (meters 1.2)) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.15) 1.0) @@ -523,8 +492,7 @@ ) (defpart 408 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.16) (sp-rnd-flt spt-x (meters -0.22) (meters 0.44) 1.0) (sp-flt spt-y (meters 0)) @@ -552,8 +520,7 @@ (defpartgroup group-village1-pot :id 130 :bounds (static-bspherem 0 2.5 0 2.5) - :parts - ((sp-item 405 :fade-after (meters 50) :falloff-to (meters 60)) + :parts ((sp-item 405 :fade-after (meters 50) :falloff-to (meters 60)) (sp-item 406 :fade-after (meters 50) :falloff-to (meters 60)) (sp-item 407 :fade-after (meters 60) :falloff-to (meters 80)) (sp-item 409 :fade-after (meters 60) :falloff-to (meters 80)) @@ -563,8 +530,7 @@ (defpartgroup group-village1-mayor-fire :id 131 :bounds (static-bspherem 0 2.5 0 2.5) - :parts - ((sp-item 410 :fade-after (meters 50) :falloff-to (meters 80)) + :parts ((sp-item 410 :fade-after (meters 50) :falloff-to (meters 80)) (sp-item 411 :fade-after (meters 40) :falloff-to (meters 40) :binding 2292) (sp-item 2292 :flags (bit1 start-dead launch-asap)) (sp-item 2292 :flags (bit1 start-dead launch-asap)) @@ -636,17 +602,9 @@ ) (defpart 411 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "fire-pop") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "fire-pop" :volume 100.0)) (sp-rnd-flt spt-x (meters -0.6) (meters 1.3) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -667,8 +625,7 @@ ) (defpart 2292 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -695,13 +652,11 @@ ) (defpart 2293 - :init-specs - ((sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g 1.0666667) (sp-flt spt-fade-b 1.0666667)) + :init-specs ((sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g 1.0666667) (sp-flt spt-fade-b 1.0666667)) ) (defpart 410 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 4.0 10.0 1.0) (sp-rnd-flt spt-x (meters -1.2) (meters 2) 1.0) (sp-flt spt-y (meters 0)) @@ -725,8 +680,7 @@ ) (defpart 412 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters 0)) @@ -754,8 +708,7 @@ ) (defpart 413 - :init-specs - ((sp-flt spt-num 0.4) + :init-specs ((sp-flt spt-num 0.4) (sp-flt spt-x (meters 0.2)) (sp-int spt-rot-x 8) (sp-flt spt-r 3276.8) @@ -773,15 +726,13 @@ ) (defpart 414 - :init-specs - ((sp-flt spt-fade-b -1.3653333)) + :init-specs ((sp-flt spt-fade-b -1.3653333)) ) (defpartgroup group-village1-sagehut-seagulls :id 132 :bounds (static-bspherem 0 8 0 45) - :parts - ((sp-item 415 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 416) + :parts ((sp-item 415 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 416) (sp-item 415 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 416) (sp-item 415 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 416) (sp-item 415 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 416) @@ -844,8 +795,7 @@ ) (defpart 415 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-func spt-birth-func 'birth-func-random-next-time) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) @@ -869,8 +819,7 @@ ) (defpart 416 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-func spt-birth-func 'birth-func-copy-omega-to-z) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) @@ -895,8 +844,7 @@ ) (defpart 418 - :init-specs - ((sp-flt spt-scale-x (meters 8)) + :init-specs ((sp-flt spt-scale-x (meters 8)) (sp-flt spt-scalevel-x (meters -0.08)) (sp-int spt-timer 600) (sp-int spt-next-time 100) @@ -905,8 +853,7 @@ ) (defpart 419 - :init-specs - ((sp-flt spt-scale-x (meters 0)) + :init-specs ((sp-flt spt-scale-x (meters 0)) (sp-flt spt-scalevel-x (meters -0.04)) (sp-int spt-timer 600) (sp-int spt-next-time 199) @@ -915,8 +862,7 @@ ) (defpart 417 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-func spt-birth-func 'birth-func-copy2-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 4)) @@ -930,15 +876,13 @@ (defpartgroup group-village1-butterfly-sitting :id 133 :bounds (static-bspherem 0 0.2 0 0.5) - :parts - ((sp-item 420 :fade-after (meters 60) :flags (is-3d bit1) :period 600 :length 5) + :parts ((sp-item 420 :fade-after (meters 60) :flags (is-3d bit1) :period 600 :length 5) (sp-item 421 :fade-after (meters 60) :flags (is-3d bit1) :period 600 :length 5) ) ) (defpart 420 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.05)) (sp-flt spt-scale-x (meters 0.9)) @@ -958,13 +902,11 @@ ) (defpart 422 - :init-specs - ((sp-flt spt-rotvel-x (degrees -0.31666666))) + :init-specs ((sp-flt spt-rotvel-x (degrees -0.31666666))) ) (defpart 421 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.05)) (sp-flt spt-scale-x (meters 0.9)) @@ -984,15 +926,13 @@ ) (defpart 423 - :init-specs - ((sp-flt spt-rotvel-x (degrees 0.31666666))) + :init-specs ((sp-flt spt-rotvel-x (degrees 0.31666666))) ) (defpartgroup group-village1-fountain :id 134 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 424 :fade-after (meters 150) :falloff-to (meters 150)) + :parts ((sp-item 424 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 425 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 425 :fade-after (meters 150) :falloff-to (meters 150) :period 463 :length 139) (sp-item 426 :fade-after (meters 90) :falloff-to (meters 90) :period 526 :length 186) @@ -1005,8 +945,7 @@ ) (defpart 431 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 1.0 4.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1026,8 +965,7 @@ ) (defpart 430 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.9) (sp-rnd-flt spt-y (meters 0) (meters 0.4) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -1052,13 +990,11 @@ ) (defpart 432 - :init-specs - ((sp-flt spt-fade-a -0.07111111)) + :init-specs ((sp-flt spt-fade-a -0.07111111)) ) (defpart 426 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 2.0 4.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters 0.4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) @@ -1085,8 +1021,7 @@ ) (defpart 428 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 2.0 4.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters 0.4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) @@ -1113,8 +1048,7 @@ ) (defpart 427 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 2.0 4.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters 0.4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) @@ -1141,8 +1075,7 @@ ) (defpart 425 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 3.0 4.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters 0.4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) @@ -1169,8 +1102,7 @@ ) (defpart 429 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-y (meters 0) (meters 0.4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) @@ -1197,8 +1129,7 @@ ) (defpart 424 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 1.0 7.0 1.0) (sp-rnd-flt spt-y (meters -0.4) (meters 0.4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.15) 1.0) @@ -1219,13 +1150,11 @@ ) (defpart 433 - :init-specs - ((sp-flt spt-scalevel-y (meters 0.0023076923))) + :init-specs ((sp-flt spt-scalevel-y (meters 0.0023076923))) ) (defpart 434 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1244,8 +1173,7 @@ ) (defpart 435 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.02)) (sp-flt spt-scale-x (meters 1)) @@ -1281,22 +1209,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 434) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 435) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) + (launch-particles :rate 1.0 (-> *part-id-table* 434) gp-0) + (launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 435) gp-0) ) ) (none) @@ -1305,8 +1219,7 @@ (defpartgroup group-village1-bird-lady-birds :id 135 :bounds (static-bspherem 0 0 6 18) - :parts - ((sp-item 436 :fade-after (meters 40) :period 900 :length 5 :binding 437) + :parts ((sp-item 436 :fade-after (meters 40) :period 900 :length 5 :binding 437) (sp-item 437 :flags (bit1 start-dead launch-asap) :binding 438) (sp-item 438 :flags (is-3d bit1 start-dead) :binding 439) (sp-item 439 :flags (is-3d bit1 start-dead) :binding 440) @@ -1376,8 +1289,7 @@ ) (defpart 472 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0.8)) (sp-flt spt-y (meters 0.8)) @@ -1392,8 +1304,7 @@ ) (defpart 473 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2)) (sp-flt spt-y (meters 1.0666667)) @@ -1412,8 +1323,7 @@ ) (defpart 474 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -1429,8 +1339,7 @@ ) (defpart 475 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1447,8 +1356,7 @@ ) (defpart 476 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1465,8 +1373,7 @@ ) (defpart 464 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 5.9)) (sp-flt spt-y (meters 2.4)) @@ -1485,8 +1392,7 @@ ) (defpart 465 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -1501,8 +1407,7 @@ ) (defpart 466 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1519,8 +1424,7 @@ ) (defpart 467 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1537,8 +1441,7 @@ ) (defpart 468 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -8)) (sp-flt spt-y (meters 3.7)) @@ -1557,8 +1460,7 @@ ) (defpart 469 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -1573,8 +1475,7 @@ ) (defpart 470 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1591,8 +1492,7 @@ ) (defpart 471 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1609,8 +1509,7 @@ ) (defpart 460 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 1)) (sp-flt spt-y (meters 0.4)) @@ -1629,13 +1528,11 @@ ) (defpart 477 - :init-specs - ((sp-flt spt-accel-y 0.53248)) + :init-specs ((sp-flt spt-accel-y 0.53248)) ) (defpart 461 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -1650,8 +1547,7 @@ ) (defpart 462 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1668,8 +1564,7 @@ ) (defpart 463 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1686,8 +1581,7 @@ ) (defpart 457 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -6)) (sp-flt spt-y (meters 1.9)) @@ -1707,8 +1601,7 @@ ) (defpart 458 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -6)) (sp-flt spt-y (meters 1.9)) @@ -1731,8 +1624,7 @@ ) (defpart 459 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -6)) (sp-flt spt-y (meters 1.9)) @@ -1755,8 +1647,7 @@ ) (defpart 454 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -5.5)) (sp-flt spt-y (meters 4.5)) @@ -1776,8 +1667,7 @@ ) (defpart 455 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -5.5)) (sp-flt spt-y (meters 4.5)) @@ -1800,8 +1690,7 @@ ) (defpart 456 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -5.5)) (sp-flt spt-y (meters 4.5)) @@ -1824,8 +1713,7 @@ ) (defpart 451 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2)) (sp-flt spt-y (meters 5)) @@ -1845,8 +1733,7 @@ ) (defpart 452 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2)) (sp-flt spt-y (meters 5)) @@ -1869,13 +1756,11 @@ ) (defpart 478 - :init-specs - ((sp-flt spt-rotvel-x (degrees -0.31666666))) + :init-specs ((sp-flt spt-rotvel-x (degrees -0.31666666))) ) (defpart 453 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2)) (sp-flt spt-y (meters 5)) @@ -1898,13 +1783,11 @@ ) (defpart 479 - :init-specs - ((sp-flt spt-rotvel-x (degrees 0.31666666))) + :init-specs ((sp-flt spt-rotvel-x (degrees 0.31666666))) ) (defpart 446 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -6.4)) (sp-flt spt-y (meters 4.8)) @@ -1919,8 +1802,7 @@ ) (defpart 447 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.7111111)) (sp-flt spt-y (meters 4)) @@ -1939,8 +1821,7 @@ ) (defpart 448 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -1956,8 +1837,7 @@ ) (defpart 449 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1974,8 +1854,7 @@ ) (defpart 450 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1992,8 +1871,7 @@ ) (defpart 441 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.1)) (sp-flt spt-y (meters 3.7)) @@ -2008,8 +1886,7 @@ ) (defpart 442 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters -1.8666667)) @@ -2028,8 +1905,7 @@ ) (defpart 443 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -2045,8 +1921,7 @@ ) (defpart 444 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -2063,8 +1938,7 @@ ) (defpart 445 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -2081,8 +1955,7 @@ ) (defpart 436 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.3)) (sp-flt spt-y (meters 4.6)) @@ -2097,8 +1970,7 @@ ) (defpart 437 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 1.4222223)) @@ -2117,8 +1989,7 @@ ) (defpart 438 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -2133,8 +2004,7 @@ ) (defpart 439 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -2151,8 +2021,7 @@ ) (defpart 440 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) diff --git a/goal_src/levels/village1/village1-part2.gc b/goal_src/levels/village1/village1-part2.gc index 62d41f2b83..c83094d2f0 100644 --- a/goal_src/levels/village1/village1-part2.gc +++ b/goal_src/levels/village1/village1-part2.gc @@ -10,8 +10,7 @@ (defpartgroup group-village1-sagehut-rings :id 136 :bounds (static-bspherem 7 4 -4.5 12) - :parts - ((sp-item 480 :fade-after (meters 60) :flags (is-3d)) + :parts ((sp-item 480 :fade-after (meters 60) :flags (is-3d)) (sp-item 481 :fade-after (meters 60) :flags (is-3d)) (sp-item 482 :fade-after (meters 50) :binding 483) (sp-item 483 :fade-after (meters 50) :flags (start-dead launch-asap) :period 1200 :length 5) @@ -382,8 +381,7 @@ (defpartgroup group-village1-sagehut-rings-2 :id 137 :bounds (static-bspherem 7 4 -4.5 12) - :parts - ((sp-item 488 :fade-after (meters 50) :binding 489) + :parts ((sp-item 488 :fade-after (meters 50) :binding 489) (sp-item 489 :fade-after (meters 50) :flags (start-dead launch-asap) :period 1200 :length 5) (sp-item 489 :fade-after (meters 50) :flags (start-dead launch-asap) :period 1200 :length 5) (sp-item 489 :fade-after (meters 50) :flags (start-dead launch-asap) :period 1200 :length 5) @@ -752,8 +750,7 @@ (defpartgroup group-village1-sagehut-rings-3 :id 138 :bounds (static-bspherem 7 4 -4.5 12) - :parts - ((sp-item 494 :fade-after (meters 50) :binding 495) + :parts ((sp-item 494 :fade-after (meters 50) :binding 495) (sp-item 495 :fade-after (meters 50) :flags (start-dead launch-asap) :period 1200 :length 5) (sp-item 495 :fade-after (meters 50) :flags (start-dead launch-asap) :period 1200 :length 5) (sp-item 495 :fade-after (meters 50) :flags (start-dead launch-asap) :period 1200 :length 5) @@ -1120,8 +1117,7 @@ ) (defpart 482 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters -0.049)) (sp-flt spt-y (meters 2.368)) @@ -1136,8 +1132,7 @@ ) (defpart 483 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 1.3333334)) (sp-flt spt-y (meters 0.44444445)) @@ -1159,8 +1154,7 @@ ) (defpart 480 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.5 1.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-flt spt-y (meters -0.55)) @@ -1186,8 +1180,7 @@ ) (defpart 481 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters -0.26)) (sp-flt spt-scale-x (meters 6)) @@ -1204,8 +1197,7 @@ ) (defpart 484 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters -0.094)) (sp-flt spt-y (meters 3.068)) @@ -1220,8 +1212,7 @@ ) (defpart 485 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.5) (sp-flt spt-x (meters -1.3333334)) (sp-flt spt-y (meters 0.6666667)) @@ -1243,8 +1234,7 @@ ) (defpart 486 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters -0.425)) (sp-flt spt-y (meters 3.792)) @@ -1259,8 +1249,7 @@ ) (defpart 487 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.8888889)) (sp-flt spt-y (meters 1.3333334)) @@ -1282,8 +1271,7 @@ ) (defpart 488 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters 2.893)) (sp-flt spt-y (meters 3.56)) @@ -1298,8 +1286,7 @@ ) (defpart 489 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2.6666667)) (sp-flt spt-y (meters -1.3333334)) @@ -1321,8 +1308,7 @@ ) (defpart 490 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters 2.482)) (sp-flt spt-y (meters 4.296)) @@ -1337,8 +1323,7 @@ ) (defpart 491 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2.6666667)) (sp-flt spt-y (meters -0.44444445)) @@ -1360,8 +1345,7 @@ ) (defpart 492 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters 2.538)) (sp-flt spt-y (meters 4.979)) @@ -1376,8 +1360,7 @@ ) (defpart 493 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 0.22222222)) @@ -1399,8 +1382,7 @@ ) (defpart 494 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters 11.611)) (sp-flt spt-y (meters 2.762)) @@ -1415,8 +1397,7 @@ ) (defpart 495 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.6666667)) (sp-flt spt-y (meters -1.1111112)) @@ -1438,8 +1419,7 @@ ) (defpart 496 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters 11.543)) (sp-flt spt-y (meters 2.356)) @@ -1454,8 +1434,7 @@ ) (defpart 497 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4.888889)) (sp-flt spt-y (meters 0.9777778)) @@ -1477,8 +1456,7 @@ ) (defpart 498 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters 11.588)) (sp-flt spt-y (meters 6.887)) @@ -1493,8 +1471,7 @@ ) (defpart 499 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.35555556)) (sp-flt spt-y (meters -1.3333334)) @@ -1518,8 +1495,7 @@ (defpartgroup group-village1-sagehut-drips :id 139 :bounds (static-bspherem 7 4 -4.5 12) - :parts - ((sp-item 500 :fade-after (meters 40) :period 673 :length 5) + :parts ((sp-item 500 :fade-after (meters 40) :period 673 :length 5) (sp-item 500 :fade-after (meters 50) :period 1036 :length 5) (sp-item 500 :fade-after (meters 60) :period 1572 :length 5) (sp-item 500 :fade-after (meters 40) :period 2158 :length 5) @@ -1537,17 +1513,9 @@ ) (defpart 502 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-flt spt-num 2.0 6.0 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "drip-on-wood") - :volume #x200 - ) - ) + (sp-sound (static-sound-spec "drip-on-wood" :volume 50.0)) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-g 96.0 128.0 1.0) @@ -1564,8 +1532,7 @@ ) (defpart 503 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.02)) (sp-flt spt-scale-x (meters 1)) @@ -1583,8 +1550,7 @@ ) (defpart 500 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.9)) (sp-flt spt-y (meters 8.825)) @@ -1609,13 +1575,11 @@ ) (defpart 504 - :init-specs - ((sp-flt spt-scalevel-y (meters 0.00033333333)) (sp-flt spt-accel-x 0.13653333) (sp-flt spt-accel-y -2.048)) + :init-specs ((sp-flt spt-scalevel-y (meters 0.00033333333)) (sp-flt spt-accel-x 0.13653333) (sp-flt spt-accel-y -2.048)) ) (defpart 501 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -3.25)) (sp-flt spt-y (meters 5.55)) @@ -1638,38 +1602,19 @@ ) (defpart 505 - :init-specs - ((sp-flt spt-accel-y -3.1402667)) + :init-specs ((sp-flt spt-accel-y -3.1402667)) ) (defun check-drop-level-sagehut ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) (when (< (-> arg2 y) (-> arg1 user-float)) (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (if (< (+ -1.0 (the-as float v1-2)) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) - ) - ) + (if (< (rand-float-gen) 0.25) + (sound-play "water-drop") + ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 502) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 503) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) + (launch-particles :rate 1.0 (-> *part-id-table* 502) gp-0) + (launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 503) gp-0) ) ) (none) @@ -1678,8 +1623,7 @@ (defpartgroup group-village1-sagehut-warpgate :id 140 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1970 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1970 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1971 :fade-after (meters 60) :falloff-to (meters 100) :binding 1968) (sp-item 1968 :flags (bit1 start-dead launch-asap)) (sp-item 1968 :flags (bit1 start-dead launch-asap)) @@ -1855,8 +1799,7 @@ ) (defpart 1973 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-x (meters 0)) (sp-flt spt-scale-x (meters 5)) @@ -1873,8 +1816,7 @@ ) (defpart 1972 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters -2)) (sp-flt spt-scale-x (meters 0.25)) @@ -1889,8 +1831,7 @@ ) (defpart 1969 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2.4444444)) (sp-flt spt-y (meters 4)) @@ -1913,8 +1854,7 @@ ) (defpart 1970 - :init-specs - ((sp-rnd-flt spt-num 3.0 3.0 1.0) + :init-specs ((sp-rnd-flt spt-num 3.0 3.0 1.0) (sp-flt spt-x (meters -0.5)) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) @@ -1931,8 +1871,7 @@ ) (defpart 1971 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.25)) (sp-copy-from-other spt-scale-y -4) @@ -1946,8 +1885,7 @@ ) (defpart 1968 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2.4444444)) (sp-flt spt-y (meters 4)) @@ -1974,13 +1912,11 @@ :id 141 :flags (always-draw) :bounds (static-bspherem 0 10 0 260) - :parts - ((sp-item 511)) + :parts ((sp-item 511)) ) (defpart 511 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.04) (sp-flt spt-y (meters 45)) (sp-rnd-flt spt-scale-x (meters 300) (meters 100) 1.0) @@ -2003,21 +1939,18 @@ ) (defpart 512 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 450 149 1) (sp-launcher-by-id spt-next-launcher 513)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 450 149 1) (sp-launcher-by-id spt-next-launcher 513)) ) (defpart 513 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) (defpartgroup group-village1-training-spouts :id 684 :flags (always-draw) :bounds (static-bspherem 0 10 0 12) - :parts - ((sp-item 2844 :period 4500 :length 1200) + :parts ((sp-item 2844 :period 4500 :length 1200) (sp-item 2845 :period 4500 :length 1200 :offset 4050) (sp-item 2846 :period 4500 :length 1200 :offset 1500) (sp-item 2847 :period 4500 :length 1200 :offset 1050) @@ -2027,8 +1960,7 @@ ) (defpart 2848 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-x (meters 60)) (sp-flt spt-y (meters -8)) @@ -2054,8 +1986,7 @@ ) (defpart 2849 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters 60)) (sp-rnd-flt spt-y (meters 95) (meters 20) 1.0) @@ -2085,8 +2016,7 @@ ) (defpart 2846 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters -8)) @@ -2112,8 +2042,7 @@ ) (defpart 2847 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters 0)) (sp-rnd-flt spt-y (meters 95) (meters 20) 1.0) @@ -2143,8 +2072,7 @@ ) (defpart 2844 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-x (meters -100)) (sp-flt spt-y (meters -8)) @@ -2170,13 +2098,11 @@ ) (defpart 2850 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.06666667)) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.06666667)) (sp-flt spt-fade-a -1.0666667)) ) (defpart 2845 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters -100)) (sp-rnd-flt spt-y (meters 95) (meters 20) 1.0) @@ -2206,23 +2132,20 @@ ) (defpart 2851 - :init-specs - ((sp-flt spt-fade-a -0.03678161)) + :init-specs ((sp-flt spt-fade-a -0.03678161)) ) (defpartgroup group-village1-trans-pad :id 142 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 514 :fade-after (meters 160)) + :parts ((sp-item 514 :fade-after (meters 160)) (sp-item 515 :fade-after (meters 160)) (sp-item 516 :fade-after (meters 60) :falloff-to (meters 60) :flags (is-3d)) ) ) (defpart 514 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 5)) (sp-rnd-flt spt-scale-x (meters 10) (meters 1) 1.0) @@ -2237,8 +2160,7 @@ ) (defpart 515 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 3)) (sp-rnd-flt spt-scale-x (meters 5) (meters 1) 1.0) @@ -2254,8 +2176,7 @@ ) (defpart 516 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0.75) (meters 0.1) 1.0) (sp-flt spt-scale-x (meters 0)) diff --git a/goal_src/levels/village1/yakow.gc b/goal_src/levels/village1/yakow.gc index 42e0d52c0c..79c329f8d7 100644 --- a/goal_src/levels/village1/yakow.gc +++ b/goal_src/levels/village1/yakow.gc @@ -9,28 +9,20 @@ ;; DECOMP BEGINS -(defskelgroup *village1cam-sg* village1cam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(import "goal_src/import/village1cam-ag.gc") +(import "goal_src/import/yakow-ag.gc") + +(defskelgroup *village1cam-sg* village1cam village1cam-lod0-jg village1cam-anim-ja + ((village1cam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defun yakow-cam () (with-pp (let ((gp-0 (entity-actor-lookup (-> pp entity) 'alt-actor 0))) - (when gp-0 - (let ((s5-0 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-0 - (let ((t9-2 (method-of-type pov-camera activate))) - (t9-2 (the-as pov-camera s5-0) pp 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 pov-camera-init-by-other (-> gp-0 extra trans) *village1cam-sg* "anim" 0 #f '()) - (-> s5-0 ppointer) - ) + (if gp-0 + (process-spawn pov-camera (-> gp-0 extra trans) *village1cam-sg* "anim" 0 #f '() :to pp) ) - ) ) (none) ) @@ -136,14 +128,12 @@ ) -(defskelgroup *yakow-sg* yakow - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 2.5 0 4.4) - :longest-edge (meters 1.3) - :shadow 3 - ) +(defskelgroup *yakow-sg* yakow yakow-lod0-jg yakow-idle-ja + ((yakow-lod0-mg (meters 20)) (yakow-lod1-mg (meters 999999))) + :bounds (static-spherem 0 2.5 0 4.4) + :longest-edge (meters 1.3) + :shadow yakow-shadow-mg + ) ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 52] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 54] @@ -214,12 +204,27 @@ yakow-default-event-handler (if gp-0 (yakow-cam) ) - (level-hint-spawn - (game-text-id yakow-owed-powercell) - "sksp018a" - (the-as entity #f) - *entity-pool* - (game-task none) + ;; PAL patch here + (process-spawn-function + process + (lambda :behavior process + () + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current movie) + (-> *setting-control* current hint) + ) + (suspend) + ) + (level-hint-spawn + (game-text-id yakow-owed-powercell) + "sksp018a" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + (none) + ) + :to self ) ) (else @@ -271,13 +276,11 @@ yakow-default-event-handler ) ) ) - (set! (-> self walk-turn-blend) - (seek - (-> self walk-turn-blend) - f30-0 - (* (-> *YAKOW-bank* walk-turn-blend-rate) (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self walk-turn-blend) + f30-0 + (* (-> *YAKOW-bank* walk-turn-blend-rate) (-> *display* seconds-per-frame)) + ) ) (set! (-> self final-speed) (fmin (-> self travel-speed) (* (vector-length (-> self nav travel)) (-> *display* frames-per-second))) @@ -353,85 +356,33 @@ yakow-default-event-handler (defbehavior yakow-blend-walk-run yakow () (let ((gp-0 (-> *display* base-frame-counter))) - (while #t + (loop (let ((f30-0 (-> self final-speed))) (cond ((and (>= 409.6 (-> self final-speed)) (not (-> self rotating))) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 4) - ) - ) - (ja-channel-push! 1 45) + (if (not (ja-group? yakow-idle-ja)) + (ja-channel-push! 1 (seconds 0.15)) ) - (let ((s5-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> s5-0 frame-num) 0.0) - ) + (ja :group! yakow-idle-ja :num! min) (while (or (< (- (-> *display* base-frame-counter) gp-0) (seconds 0.2)) (< (-> self final-speed) 409.6)) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) ) (else (set! gp-0 (-> *display* base-frame-counter)) ) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 3 22) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 frame-interp) 0.0) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> s5-1 frame-num) 0.0) - ) - (let ((s5-2 (-> self skel root-channel 1))) - (set! (-> s5-2 frame-interp) 0.0) - (joint-control-channel-group-eval! - s5-2 - (the-as art-joint-anim (-> self draw art-group data 10)) - num-func-identity - ) - (set! (-> s5-2 frame-num) 0.0) - ) - (let ((s5-3 (-> self skel root-channel 2))) - (set! (-> s5-3 frame-interp) 0.0) - (joint-control-channel-group-eval! - s5-3 - (the-as art-joint-anim (-> self draw art-group data 7)) - num-func-identity - ) - (set! (-> s5-3 frame-num) 0.0) - ) + (when (not (ja-group? yakow-walk-ja)) + (ja-channel-push! 3 (seconds 0.075)) + (ja :group! yakow-walk-ja :num! min :frame-interp 0.0) + (ja :chan 1 :group! yakow-walk-left-ja :num! min :frame-interp 0.0) + (ja :chan 2 :group! yakow-run-ja :num! min :frame-interp 0.0) ) - (cond - ((< (-> self walk-turn-blend) 0.0) - (let ((v1-49 (-> self skel root-channel 1))) - (set! (-> v1-49 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - ) - ) - (else - (let ((v1-52 (-> self skel root-channel 1))) - (set! (-> v1-52 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - ) + (if (< (-> self walk-turn-blend) 0.0) + (ja :chan 1 :group! yakow-walk-left-ja) + (ja :chan 1 :group! yakow-walk-right-ja) ) - ) (cond ((< f30-0 (-> *YAKOW-bank* min-run-speed)) (set! (-> self run-mode) #f) @@ -441,19 +392,19 @@ yakow-default-event-handler ) ) (if (-> self run-mode) - (set! (-> self walk-run-blend) - (seek (-> self walk-run-blend) 1.0 (* (-> *YAKOW-bank* walk-run-blend-rate) (-> *display* seconds-per-frame))) - ) - (set! (-> self walk-run-blend) - (seek (-> self walk-run-blend) 0.0 (* (-> *YAKOW-bank* walk-run-blend-rate) (-> *display* seconds-per-frame))) - ) + (seek! + (-> self walk-run-blend) + 1.0 + (* (-> *YAKOW-bank* walk-run-blend-rate) (-> *display* seconds-per-frame)) + ) + (seek! + (-> self walk-run-blend) + 0.0 + (* (-> *YAKOW-bank* walk-run-blend-rate) (-> *display* seconds-per-frame)) + ) ) - (let ((v1-68 (-> self skel root-channel 1))) - (set! (-> v1-68 frame-interp) (fabs (-> self walk-turn-blend))) - ) - (let ((v1-72 (-> self skel root-channel 2))) - (set! (-> v1-72 frame-interp) (-> self walk-run-blend)) - ) + (ja :chan 1 :frame-interp (fabs (-> self walk-turn-blend))) + (ja :chan 2 :frame-interp (-> self walk-run-blend)) (let* ((f0-25 (* (-> *YAKOW-bank* walk-anim-speed) f30-0)) (f1-5 (-> *YAKOW-bank* walk-speed)) (f0-26 (* f0-25 (/ 1.0 f1-5))) @@ -471,20 +422,11 @@ yakow-default-event-handler (if (-> self rotating) (set! f0-26 (fmax (-> *YAKOW-bank* min-walk-anim-speed) f0-26)) ) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) f0-26) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f0-26)) ) ) - (let ((s5-4 (-> self skel root-channel 1))) - (set! (-> s5-4 num-func) num-func-identity) - (set! (-> s5-4 frame-num) (ja-frame-num 0)) - ) - (let ((s5-5 (-> self skel root-channel 2))) - (set! (-> s5-5 num-func) num-func-identity) - (set! (-> s5-5 frame-num) (ja-frame-num 0)) - ) + (ja :chan 1 :num-func num-func-identity :frame-num (ja-frame-num 0)) + (ja :chan 2 :num-func num-func-identity :frame-num (ja-frame-num 0)) (suspend) 0 ) @@ -514,16 +456,13 @@ yakow-default-event-handler ) (defstate yakow-idle (yakow) - :event - yakow-default-event-handler - :enter - (behavior () + :event yakow-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self travel-speed) 0.0) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> *YAKOW-bank* default-patrol-time)) (and *target* (>= (-> self fact-override idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) @@ -535,10 +474,9 @@ yakow-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 45) - (while #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.15)) + (loop (cond ((rand-vu-percent? 0.2) (dummy-10 (-> self skel effect) 'yakow-1 0.0 -1) @@ -548,96 +486,65 @@ yakow-default-event-handler ) ) (let ((f30-0 (rand-vu-float-range 0.9 1.1))) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) f30-0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! yakow-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) f30-0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (when (rand-vu-percent? 0.25) - (ja-channel-push! 1 30) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! yakow-graze-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) ) (none) ) - :post - (the-as (function none :behavior yakow) ja-post) + :post (the-as (function none :behavior yakow) ja-post) ) (defstate yakow-notice (yakow) - :event - yakow-default-event-handler - :enter - (behavior () + :event yakow-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self travel-speed) 0.0) (none) ) - :code - (behavior () + :code (behavior () (go yakow-run-away) (none) ) - :post - yakow-simple-post + :post yakow-simple-post ) (defstate yakow-walk-to (yakow) - :event - yakow-default-event-handler - :enter - (behavior ((arg0 vector)) + :event yakow-default-event-handler + :enter (behavior ((arg0 vector)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (set! (-> self nav destination-pos quad) (-> arg0 quad)) (set! (-> self rotate-speed) (-> *YAKOW-bank* walk-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* walk-turn-time)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> *YAKOW-bank* default-patrol-time)) (not (-> self in-pen)) - (and *target* (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (and *target* + (>= (-> self fact-override idle-distance) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) ) (not (yakow-facing-player? 21845.334)) ) (go yakow-notice) ) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) - (when (or (logtest? (nav-control-flags bit19) (-> self nav flags)) + (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (< (vector-vector-xz-distance (-> self root-override trans) (-> self nav destination-pos)) 4096.0) ) (if (-> self in-pen) @@ -646,18 +553,15 @@ yakow-default-event-handler ) ) ) - (set! (-> self travel-speed) (seek - (-> self travel-speed) - (-> *YAKOW-bank* walk-speed) - (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self travel-speed) + (-> *YAKOW-bank* walk-speed) + (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame)) + ) (none) ) - :code - (the-as (function vector none :behavior yakow) yakow-blend-walk-run) - :post - (behavior () + :code (the-as (function vector none :behavior yakow) yakow-blend-walk-run) + :post (behavior () (dummy-19 (-> self nav) (-> self nav target-pos) @@ -665,8 +569,8 @@ yakow-default-event-handler (-> self nav destination-pos) 131072.0 ) - (if (logtest? (nav-control-flags bit21) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit10)) + (if (logtest? (nav-control-flags navcf21) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (yakow-post) (none) @@ -674,10 +578,8 @@ yakow-default-event-handler ) (defstate yakow-graze (yakow) - :event - yakow-default-event-handler - :enter - (behavior () + :event yakow-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self travel-speed) 0.0) (set! (-> self grazing) #t) @@ -691,118 +593,61 @@ yakow-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (while (< 546.13336 (fabs (deg-diff (-> self dest-rot) (y-angle (-> self root-override))))) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 22) + (if (not (ja-group? yakow-walk-ja)) + (ja-channel-push! 1 (seconds 0.075)) ) (seek-toward-yaw-angle! (-> self root-override) (-> self dest-rot) 16384.0 (seconds 0.5)) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-6 param 0) 1.0) - (joint-control-channel-group-eval! - a0-6 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-loop! - ) - ) + (ja :group! yakow-walk-ja :num! (loop!)) (suspend) ) - (ja-channel-push! 1 45) - (while #t - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.15)) + (loop + (ja-no-eval :group! yakow-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (when (rand-vu-percent? 0.5) - (ja-channel-push! 1 30) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! yakow-graze-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) ) (none) ) - :post - yakow-simple-post + :post yakow-simple-post ) (defstate yakow-graze-kicked (yakow) - :event - (the-as (function process int symbol event-message-block object :behavior yakow) #f) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + :event (the-as (function process int symbol event-message-block object :behavior yakow) #f) + :code (behavior () + (ja-no-eval :group! yakow-kicked-in-place-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go yakow-graze) (none) ) - :post - yakow-simple-post + :post yakow-simple-post ) (defstate yakow-run-away (yakow) - :event - yakow-default-event-handler - :enter - (behavior () + :event yakow-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (set! (-> self rotate-speed) (-> *YAKOW-bank* run-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* run-turn-time)) (none) ) - :trans - (behavior () + :trans (behavior () (when (or (not *target*) (< (-> *YAKOW-bank* safe-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -819,37 +664,30 @@ yakow-default-event-handler (vector-vector-distance (-> self root-override trans) (target-pos 0)) ) ) - (f30-2 - (lerp-scale - (-> *YAKOW-bank* run-speed) - (-> *YAKOW-bank* walk-speed) - f0-2 - (-> *YAKOW-bank* run-away-dist) - (-> *YAKOW-bank* walk-away-dist) - ) - ) + (f30-2 (lerp-scale + (-> *YAKOW-bank* run-speed) + (-> *YAKOW-bank* walk-speed) + f0-2 + (-> *YAKOW-bank* run-away-dist) + (-> *YAKOW-bank* walk-away-dist) + ) + ) ) (if (yakow-facing-player? 21845.334) (set! f30-2 0.0) ) (set! (-> self enable-turn-around) (< (-> *YAKOW-bank* run-speed) f30-2)) - (set! (-> self travel-speed) - (seek (-> self travel-speed) f30-2 (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame))) - ) + (seek! (-> self travel-speed) f30-2 (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame))) ) (none) ) - :code - yakow-blend-walk-run - :post - yakow-run-post + :code yakow-blend-walk-run + :post yakow-run-post ) (defstate yakow-kicked (yakow) - :event - (the-as (function process int symbol event-message-block object :behavior yakow) #f) - :enter - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior yakow) #f) + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (if (-> self grazing) (go yakow-graze-kicked) @@ -862,39 +700,30 @@ yakow-default-event-handler ) (none) ) - :exit - (behavior () + :exit (behavior () '() (none) ) - :trans - (behavior () + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) - (set! (-> self travel-speed) (seek - (-> self travel-speed) - (-> *YAKOW-bank* run-speed) - (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self travel-speed) + (-> *YAKOW-bank* run-speed) + (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame)) + ) ) 0 (none) ) - :code - (behavior () + :code (behavior () (set! (-> self enable-turn-around) #t) 1.0 (suspend) - (ja-channel-push! 1 15) + (ja-channel-push! 1 (seconds 0.05)) (cond ((< 40.96 (vector-length (-> self nav travel))) - (let ((v1-4 (-> self skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - ) - (let ((v1-7 (-> self skel root-channel 0))) - (set! (-> v1-7 num-func) num-func-identity) - (set! (-> v1-7 frame-num) 0.0) - ) + (ja :group! yakow-kicked-ja) + (ja :num-func num-func-identity :frame-num 0.0) (until (ja-done? 0) (suspend) (let* ((f0-3 0.75) @@ -906,49 +735,31 @@ yakow-default-event-handler ) ) ) - (a0-6 (-> self skel root-channel 0)) ) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) f0-4) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) + (ja :num! (seek! max f0-4)) ) ) ) (else - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! yakow-kicked-in-place-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (< 40.96 (-> self final-speed)) (go yakow-run-away) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go yakow-run-away) (none) ) - :post - yakow-run-post + :post yakow-run-post ) (defstate yakow-die (yakow) - :event - (the-as (function process int symbol event-message-block object :behavior yakow) #f) - :code - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior yakow) #f) + :code (behavior () (let ((v1-1 (-> self root-override root-prim))) (set! (-> v1-1 collide-with) (collide-kind)) (set! (-> v1-1 prim-core collide-as) (collide-kind)) @@ -983,7 +794,7 @@ yakow-default-event-handler (process-drawable-from-entity! obj arg0) (set! (-> obj align) (new 'process 'align-control obj)) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav nearest-y-threshold) 409600.0) (set! (-> obj fact-override) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) @@ -995,7 +806,7 @@ yakow-default-event-handler ) (set! (-> obj link) (new 'process 'actor-link-info obj)) (set! (-> obj water) (new 'process 'water-control obj 6 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (the-as uint 2)) + (set! (-> obj water flags) (water-flags wt01)) (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) (set! (-> obj water ripple-size) 12288.0) (set! (-> obj home-base quad) (-> obj root-override trans quad)) diff --git a/goal_src/levels/village2/assistant-village2.gc b/goal_src/levels/village2/assistant-village2.gc index 621708813e..7161b86d80 100644 --- a/goal_src/levels/village2/assistant-village2.gc +++ b/goal_src/levels/village2/assistant-village2.gc @@ -7,6 +7,9 @@ ;; DECOMP BEGINS +(import "goal_src/import/jaws-ag.gc") +(import "goal_src/import/assistant-village2-ag.gc") + (deftype assistant-levitator (process-taskable) ((boulder entity-actor :offset-assert 380) (particle sparticle-launch-control 4 :offset-assert 384) @@ -42,22 +45,19 @@ (none) ) -(defskelgroup *assistant-village2-sg* assistant-village2 - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *assistant-village2-sg* assistant-village2 assistant-village2-lod0-jg assistant-village2-idle-a-ja + ((assistant-village2-lod0-mg (meters 20)) + (assistant-village2-lod1-mg (meters 40)) + (assistant-village2-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 2) + :shadow assistant-village2-shadow-mg + ) -(defskelgroup *jaws-sg* jaws - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 0.25) - :longest-edge (meters 0) - ) +(defskelgroup *jaws-sg* jaws jaws-lod0-jg jaws-idle-ja + ((jaws-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.25) + ) (defmethod dummy-52 assistant-levitator ((obj assistant-levitator)) (let ((v1-1 (-> obj draw shadow-ctrl))) @@ -72,7 +72,7 @@ ) ) 0 - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) ) ) (none) @@ -81,16 +81,19 @@ (defmethod draw-npc-shadow assistant-levitator ((obj assistant-levitator)) (-> obj draw shadow-ctrl) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -99,326 +102,296 @@ ) (defmethod play-anim! assistant-bluehut ((obj assistant-bluehut) (arg0 symbol)) - (with-pp - (set! (-> obj talk-message) (game-text-id press-to-talk-to-assistant)) - (case (current-status (-> obj tasks)) - (((task-status unknown) (task-status need-hint) (task-status need-introduction)) - (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> obj talk-message) (game-text-id press-to-talk-to-assistant)) + (case (current-status (-> obj tasks)) + (((task-status unknown) (task-status need-hint) (task-status need-introduction)) + (if (not arg0) + (set! (-> obj will-talk) #t) + ) + (case (current-task (-> obj tasks)) + (((game-task village2-levitator)) + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (send-event (-> obj sage extra process) 'clone (process->handle obj)) + (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) + ) + (new 'static 'spool-anim + :name "assistant-village2-introduction" + :index 15 + :parts 16 + :command-list '((0 send-event target draw #f) + (0 kill "villageb-part-33") + (95 send-event target draw #t) + (95 joint "cameraB") + (131 send-event target draw #f) + (131 joint "camera") + (190 setting-reset ocean-off #t) + (190 kill "pontoonten-20") + (190 kill "pontoonten-19") + (190 kill "pontoonten-18") + (190 kill "pontoonten-17") + (190 kill "pontoonten-16") + (190 kill "pontoonten-15") + (190 kill "pontoonten-14") + (190 kill "pontoonten-13") + (190 kill "pontoonten-12") + (190 kill "pontoonten-11") + (190 kill "pontoonten-10") + (190 kill "pontoonten-9") + (190 kill "pontoonten-8") + (190 kill "pontoonten-7") + (190 kill "pontoonten-6") + (190 kill "pontoonfive-3") + (190 kill "pontoonfive-4") + (190 kill "pontoonfive-5") + (190 kill "pontoonfive-6") + (190 kill "pontoonfive-7") + (190 kill "pontoonfive-8") + (190 kill "pontoonfive-12") + (190 kill "pontoonfive-13") + (190 kill "pontoonfive-14") + (190 kill "pontoonfive-15") + (190 kill "pontoonfive-16") + (190 kill "pontoonfive-17") + (190 kill "pontoonfive-18") + (190 kill "pontoonfive-19") + (190 kill "pontoonfive-20") + (190 kill "allpontoons-1") + (190 kill "med-res-level-12") + (190 kill "med-res-level-13") + (190 kill "med-res-level-15") + (190 kill "swamp-blimp-3") + (190 kill "barrel-85") + (190 kill "barrel-86") + (190 kill "money-2844") + (190 kill "money-2845") + (190 kill "money-2846") + (190 kill "money-2847") + (190 kill "money-2848") + (190 kill "money-2849") + (190 kill "money-4923") + (190 kill "money-4924") + (190 kill "money-4925") + (190 kill "money-4926") + (190 kill "money-4927") + (190 kill "eco-27") + (190 kill "sharkey-25") + (190 kill "barrel-117") + (190 kill "barrel-118") + (190 kill "barrel-119") + (190 kill "barrel-120") + (190 kill "barrel-121") + (190 kill "barrel-122") + (190 kill "crate-3129") + (190 kill "crate-3132") + (190 kill "crate-3133") + (190 kill "villageb-part-32") + (190 kill "villageb-part-30") + (190 kill "exit-chamber-dummy-1") + (190 kill "villageb-part-34") + (191 send-event target draw #t) + (191 joint "cameraB") + (241 joint "camera") + (241 send-event target draw #f) + (241 setting-unset ocean-off) + (241 dead "pontoonten-20") + (241 dead "pontoonten-19") + (241 dead "pontoonten-18") + (241 dead "pontoonten-17") + (241 dead "pontoonten-16") + (241 dead "pontoonten-15") + (241 dead "pontoonten-14") + (241 dead "pontoonten-13") + (241 dead "pontoonten-12") + (241 dead "pontoonten-11") + (241 dead "pontoonten-10") + (241 dead "pontoonten-9") + (241 dead "pontoonten-8") + (241 dead "pontoonten-7") + (241 dead "pontoonten-6") + (241 dead "pontoonfive-3") + (241 dead "pontoonfive-4") + (241 dead "pontoonfive-5") + (241 dead "pontoonfive-6") + (241 dead "pontoonfive-7") + (241 dead "pontoonfive-8") + (241 dead "pontoonfive-12") + (241 dead "pontoonfive-13") + (241 dead "pontoonfive-14") + (241 dead "pontoonfive-15") + (241 dead "pontoonfive-16") + (241 dead "pontoonfive-17") + (241 dead "pontoonfive-18") + (241 dead "pontoonfive-19") + (241 dead "pontoonfive-20") + (241 dead "allpontoons-1") + (241 dead "med-res-level-12") + (241 dead "med-res-level-13") + (241 dead "med-res-level-15") + (241 dead "swamp-blimp-3") + (241 dead "barrel-85") + (241 dead "barrel-86") + (241 dead "money-2844") + (241 dead "money-2845") + (241 dead "money-2846") + (241 dead "money-2847") + (241 dead "money-2848") + (241 dead "money-2849") + (241 dead "money-4923") + (241 dead "money-4924") + (241 dead "money-4925") + (241 dead "money-4926") + (241 dead "money-4927") + (241 dead "eco-27") + (241 dead "sharkey-25") + (241 dead "barrel-117") + (241 dead "barrel-118") + (241 dead "barrel-119") + (241 dead "barrel-120") + (241 dead "barrel-121") + (241 dead "barrel-122") + (241 dead "crate-3129") + (241 dead "crate-3132") + (241 dead "crate-3133") + (241 dead "villageb-part-32") + (241 dead "villageb-part-30") + (321 joint "cameraB") + (352 joint "camera") + (383 joint "cameraB") + (411 joint "camera") + (501 joint "cameraB") + (501 send-event target draw #t) + (567 joint "camera") + (634 alive "fireboulder-6") + (635 joint "cameraB") + (701 joint "camera") + (741 joint "cameraB") + (784 joint "camera") + (936 joint "cameraB") + (1065 joint "camera") + (1145 joint "cameraB") + (1241 joint "camera") + ) + ) + ) + (((game-task sunken-room)) + (when arg0 + (let* ((s5-2 (-> obj tasks)) + (s4-0 (method-of-object s5-2 save-reminder)) + ) + (s4-0 s5-2 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) + ) + (close-status! (-> obj tasks) (task-status need-introduction)) + (set! (-> obj jaws) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *jaws-sg* #f :to obj)) + ) + (let ((v1-42 (handle->process (-> obj jaws)))) + (if v1-42 + (set! (-> (the-as manipy v1-42) draw light-index) (the-as uint 1)) + ) + ) + (send-event (handle->process (-> obj jaws)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj jaws)) 'center-joint 3) + (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) + ) + (new 'static 'spool-anim + :name "assistant-village2-introduction-room" + :index 21 + :parts 10 + :command-list '((197 joint "cameraB") + (351 joint "camera") + (431 joint "cameraB") + (553 joint "camera") + (631 joint "cameraB") + (842 joint "camera") + (900 joint "cameraB") + (1069 joint "camera") + ) + ) + ) + (((game-task rolling-robbers)) + (when arg0 + (let* ((s5-5 (-> obj tasks)) + (s4-1 (method-of-object s5-5 save-reminder)) + ) + (s4-1 s5-5 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) + ) + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "assistant-village2-introduction-robbers" + :index 17 + :parts 6 + :command-list '((55 joint "cameraB") (145 joint "camera") (207 joint "cameraB") (363 joint "camera")) + ) + ) + (else + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) ) - (case (current-task (-> obj tasks)) - (((game-task village2-levitator)) - (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (send-event (-> obj sage extra process) 'clone (process->handle obj)) - (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) - ) - (new 'static 'spool-anim - :name "assistant-village2-introduction" - :index 15 - :parts 16 - :command-list - '((0 send-event target draw #f) - (0 kill "villageb-part-33") - (95 send-event target draw #t) - (95 joint "cameraB") - (131 send-event target draw #f) - (131 joint "camera") - (190 setting-reset ocean-off #t) - (190 kill "pontoonten-20") - (190 kill "pontoonten-19") - (190 kill "pontoonten-18") - (190 kill "pontoonten-17") - (190 kill "pontoonten-16") - (190 kill "pontoonten-15") - (190 kill "pontoonten-14") - (190 kill "pontoonten-13") - (190 kill "pontoonten-12") - (190 kill "pontoonten-11") - (190 kill "pontoonten-10") - (190 kill "pontoonten-9") - (190 kill "pontoonten-8") - (190 kill "pontoonten-7") - (190 kill "pontoonten-6") - (190 kill "pontoonfive-3") - (190 kill "pontoonfive-4") - (190 kill "pontoonfive-5") - (190 kill "pontoonfive-6") - (190 kill "pontoonfive-7") - (190 kill "pontoonfive-8") - (190 kill "pontoonfive-12") - (190 kill "pontoonfive-13") - (190 kill "pontoonfive-14") - (190 kill "pontoonfive-15") - (190 kill "pontoonfive-16") - (190 kill "pontoonfive-17") - (190 kill "pontoonfive-18") - (190 kill "pontoonfive-19") - (190 kill "pontoonfive-20") - (190 kill "allpontoons-1") - (190 kill "med-res-level-12") - (190 kill "med-res-level-13") - (190 kill "med-res-level-15") - (190 kill "swamp-blimp-3") - (190 kill "barrel-85") - (190 kill "barrel-86") - (190 kill "money-2844") - (190 kill "money-2845") - (190 kill "money-2846") - (190 kill "money-2847") - (190 kill "money-2848") - (190 kill "money-2849") - (190 kill "money-4923") - (190 kill "money-4924") - (190 kill "money-4925") - (190 kill "money-4926") - (190 kill "money-4927") - (190 kill "eco-27") - (190 kill "sharkey-25") - (190 kill "barrel-117") - (190 kill "barrel-118") - (190 kill "barrel-119") - (190 kill "barrel-120") - (190 kill "barrel-121") - (190 kill "barrel-122") - (190 kill "crate-3129") - (190 kill "crate-3132") - (190 kill "crate-3133") - (190 kill "villageb-part-32") - (190 kill "villageb-part-30") - (190 kill "exit-chamber-dummy-1") - (190 kill "villageb-part-34") - (191 send-event target draw #t) - (191 joint "cameraB") - (241 joint "camera") - (241 send-event target draw #f) - (241 setting-unset ocean-off) - (241 dead "pontoonten-20") - (241 dead "pontoonten-19") - (241 dead "pontoonten-18") - (241 dead "pontoonten-17") - (241 dead "pontoonten-16") - (241 dead "pontoonten-15") - (241 dead "pontoonten-14") - (241 dead "pontoonten-13") - (241 dead "pontoonten-12") - (241 dead "pontoonten-11") - (241 dead "pontoonten-10") - (241 dead "pontoonten-9") - (241 dead "pontoonten-8") - (241 dead "pontoonten-7") - (241 dead "pontoonten-6") - (241 dead "pontoonfive-3") - (241 dead "pontoonfive-4") - (241 dead "pontoonfive-5") - (241 dead "pontoonfive-6") - (241 dead "pontoonfive-7") - (241 dead "pontoonfive-8") - (241 dead "pontoonfive-12") - (241 dead "pontoonfive-13") - (241 dead "pontoonfive-14") - (241 dead "pontoonfive-15") - (241 dead "pontoonfive-16") - (241 dead "pontoonfive-17") - (241 dead "pontoonfive-18") - (241 dead "pontoonfive-19") - (241 dead "pontoonfive-20") - (241 dead "allpontoons-1") - (241 dead "med-res-level-12") - (241 dead "med-res-level-13") - (241 dead "med-res-level-15") - (241 dead "swamp-blimp-3") - (241 dead "barrel-85") - (241 dead "barrel-86") - (241 dead "money-2844") - (241 dead "money-2845") - (241 dead "money-2846") - (241 dead "money-2847") - (241 dead "money-2848") - (241 dead "money-2849") - (241 dead "money-4923") - (241 dead "money-4924") - (241 dead "money-4925") - (241 dead "money-4926") - (241 dead "money-4927") - (241 dead "eco-27") - (241 dead "sharkey-25") - (241 dead "barrel-117") - (241 dead "barrel-118") - (241 dead "barrel-119") - (241 dead "barrel-120") - (241 dead "barrel-121") - (241 dead "barrel-122") - (241 dead "crate-3129") - (241 dead "crate-3132") - (241 dead "crate-3133") - (241 dead "villageb-part-32") - (241 dead "villageb-part-30") - (321 joint "cameraB") - (352 joint "camera") - (383 joint "cameraB") - (411 joint "camera") - (501 joint "cameraB") - (501 send-event target draw #t) - (567 joint "camera") - (634 alive "fireboulder-6") - (635 joint "cameraB") - (701 joint "camera") - (741 joint "cameraB") - (784 joint "camera") - (936 joint "cameraB") - (1065 joint "camera") - (1145 joint "cameraB") - (1241 joint "camera") - ) - ) - ) - (((game-task sunken-room)) - (when arg0 - (let* ((s5-2 (-> obj tasks)) - (s4-0 (method-of-object s5-2 save-reminder)) - (a1-7 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-7 from) pp) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'query) - (set! (-> a1-7 param 0) (the-as uint 'pickup)) - (set! (-> a1-7 param 1) (the-as uint 6)) - (s4-0 s5-2 (the int (the-as float (send-event-function *target* a1-7))) 1) - ) - (close-status! (-> obj tasks) (task-status need-introduction)) - (let ((s5-3 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj jaws) - (ppointer->handle - (when s5-3 - (let ((t9-10 (method-of-type manipy activate))) - (t9-10 (the-as manipy s5-3) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-3 manipy-init (-> obj root-override trans) (-> obj entity) *jaws-sg* #f) - (-> s5-3 ppointer) - ) - ) - ) - ) - (let ((v1-42 (handle->process (-> obj jaws)))) - (if v1-42 - (set! (-> (the-as manipy v1-42) draw light-index) (the-as uint 1)) - ) - ) - (send-event (handle->process (-> obj jaws)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj jaws)) 'center-joint 3) - (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) - ) - (new 'static 'spool-anim - :name "assistant-village2-introduction-room" - :index 21 - :parts 10 - :command-list - '((197 joint "cameraB") - (351 joint "camera") - (431 joint "cameraB") - (553 joint "camera") - (631 joint "cameraB") - (842 joint "camera") - (900 joint "cameraB") - (1069 joint "camera") - ) - ) - ) - (((game-task rolling-robbers)) - (when arg0 - (let* ((s5-5 (-> obj tasks)) - (s4-1 (method-of-object s5-5 save-reminder)) - (a1-17 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-17 from) pp) - (set! (-> a1-17 num-params) 2) - (set! (-> a1-17 message) 'query) - (set! (-> a1-17 param 0) (the-as uint 'pickup)) - (set! (-> a1-17 param 1) (the-as uint 6)) - (s4-1 s5-5 (the int (the-as float (send-event-function *target* a1-17))) 1) - ) - (close-status! (-> obj tasks) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name - "assistant-village2-introduction-robbers" - :index 17 - :parts 6 - :command-list - '((55 joint "cameraB") (145 joint "camera") (207 joint "cameraB") (363 joint "camera")) - ) - ) - (else - (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) - ) - (new 'static 'spool-anim - :name - "assistant-village2-introduction-flutflut" - :index 19 - :parts 8 - :command-list - '((71 joint "cameraB") (308 joint "camera") (426 joint "cameraB") (550 joint "camera") (644 joint "cameraB")) - ) + (new 'static 'spool-anim + :name "assistant-village2-introduction-flutflut" + :index 19 + :parts 8 + :command-list '((71 joint "cameraB") (308 joint "camera") (426 joint "cameraB") (550 joint "camera") (644 joint "cameraB")) ) ) ) - (((task-status need-reminder)) - (set! (-> obj skippable) #t) - (let ((s4-2 (+ (get-reminder (-> obj tasks) 0) 1))) - (if (< (the-as uint 2) (the-as uint s4-2)) - (set! s4-2 0) - ) - (countdown (s3-0 3) - (let ((v1-92 s4-2)) - (cond - ((zero? v1-92) - (if (!= (get-task-status (game-task sunken-room)) (task-status need-reminder)) - (set! s4-2 1) - ) - ) - ((= v1-92 1) - (if (!= (get-task-status (game-task rolling-robbers)) (task-status need-reminder)) - (set! s4-2 2) - ) - ) - (else - (if (!= (get-task-status (game-task swamp-flutflut)) (task-status need-reminder)) - (set! s4-2 0) - ) - ) + ) + (((task-status need-reminder)) + (set! (-> obj skippable) #t) + (let ((s4-2 (+ (get-reminder (-> obj tasks) 0) 1))) + (if (< (the-as uint 2) (the-as uint s4-2)) + (set! s4-2 0) + ) + (countdown (s3-0 3) + (let ((v1-92 s4-2)) + (cond + ((zero? v1-92) + (if (!= (get-task-status (game-task sunken-room)) (task-status need-reminder)) + (set! s4-2 1) + ) + ) + ((= v1-92 1) + (if (!= (get-task-status (game-task rolling-robbers)) (task-status need-reminder)) + (set! s4-2 2) + ) + ) + (else + (if (!= (get-task-status (game-task swamp-flutflut)) (task-status need-reminder)) + (set! s4-2 0) + ) ) ) ) - (if arg0 - (save-reminder (-> obj tasks) s4-2 2) - ) - (cond - ((zero? s4-2) - (new 'static 'spool-anim :name "assistant-village2-reminder-1-room" :index 22 :parts 3 :command-list '()) - ) - ((= s4-2 1) - (new 'static 'spool-anim :name "assistant-village2-reminder-1-robbers" :index 18 :parts 3 :command-list '()) - ) - (else - (new 'static 'spool-anim :name "assistant-village2-reminder-1-flutflut" :index 20 :parts 3 :command-list '()) - ) + ) + (if arg0 + (save-reminder (-> obj tasks) s4-2 2) + ) + (cond + ((zero? s4-2) + (new 'static 'spool-anim :name "assistant-village2-reminder-1-room" :index 22 :parts 3 :command-list '()) + ) + ((= s4-2 1) + (new 'static 'spool-anim :name "assistant-village2-reminder-1-robbers" :index 18 :parts 3 :command-list '()) + ) + (else + (new 'static 'spool-anim :name "assistant-village2-reminder-1-flutflut" :index 20 :parts 3 :command-list '()) ) ) ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) ) - (-> obj draw art-group data 5) - ) + ) + (-> obj draw art-group data 5) ) ) ) @@ -494,10 +467,7 @@ (defmethod TODO-RENAME-43 assistant-bluehut ((obj assistant-bluehut)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f30-0 (+ -1.0 (the-as float v1-4))) - ) + (let ((f30-0 (rand-float-gen))) (cond ((= (get-task-status (game-task village2-levitator)) (task-status invalid)) #f @@ -515,8 +485,7 @@ (defstate idle (assistant-bluehut) :virtual #t - :trans - (behavior () + :trans (behavior () (case (get-task-status (game-task village2-levitator)) (((task-status need-hint) (task-status need-introduction)) (send-event self 'play-anim) @@ -525,262 +494,80 @@ ((-> (method-of-type process-taskable idle) trans)) (none) ) - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) - ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) - (set! (-> gp-0 param 0) (the float (+ (-> (the-as art-joint-anim (get-art-elem self)) data 0 length) -1))) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (get-art-elem self)) num-func-seek!) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) ) + (loop + (ja-no-eval :group! (get-art-elem self) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (let* ((v1-24 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-25 (the-as number (logior #x3f800000 v1-24))) - (f0-9 (+ -1.0 (the-as float v1-25))) - ) + (let ((f0-9 (rand-float-gen))) (cond ((< f0-9 0.33333334) (TODO-RENAME-43 self) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! assistant-village2-idle-hut-look-right-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-1 (-> *display* base-frame-counter))) - (while (let* ((s5-1 (-> *display* base-frame-counter)) - (f30-0 300.0) - (f28-0 0.16) - (f26-0 0.17000002) - (v1-55 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-56 (the-as number (logior #x3f800000 v1-55))) - ) - (< (- s5-1 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-56)))))))) gp-1) + (while (let ((s5-1 (-> *display* base-frame-counter)) + (f30-0 300.0) + (f28-0 0.16) + (f26-0 0.17000002) + ) + (< (- s5-1 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (rand-float-gen))))))) gp-1) ) (suspend) ) ) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-21 param 0) 0.0) - (set! (-> a0-21 param 1) 1.0) - (set! (-> a0-21 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-21 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) 0.0) - (set! (-> a0-22 param 1) 1.0) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) ) ((< f0-9 0.6666667) - (sound-play-by-name - (static-sound-name "welding-loop") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (target-pos 0)) - ) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-27 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-27 param 1) 1.0) - (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (sound-play "welding-loop" :id (-> self sound-id) :position (the-as symbol (target-pos 0))) + (ja-no-eval :group! assistant-village2-idle-hut-start-welding-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((v1-111 (-> self skel root-channel 0))) - (set! (-> v1-111 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) + (ja :num! (seek!)) ) + (ja :group! assistant-village2-idle-hut-welding-ja) (let* ((f30-1 2.0) (v1-113 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-114 (the-as number (logior #x3f800000 v1-113))) ) (countdown (gp-3 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-114)))) 4)) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-35 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-35 param 1) 1.0) - (set! (-> a0-35 frame-num) 0.0) - (joint-control-channel-group! - a0-35 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30))) (suspend) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 param 0) (the float (+ (-> a0-38 frame-group data 0 length) -1))) - (set! (-> a0-38 param 1) 1.0) - (joint-control-channel-group-eval! a0-38 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-40 param 0) 0.0) - (set! (-> a0-40 param 1) 1.0) - (set! (-> a0-40 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-40 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (ja :num! (seek!)) ) + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30))) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) 0.0) - (set! (-> a0-43 param 1) 1.0) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) ) ) - (let ((a0-45 (-> self skel root-channel 0))) - (set! (-> a0-45 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-45 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-45 param 1) 1.0) - (set! (-> a0-45 frame-num) 0.0) - (joint-control-channel-group! - a0-45 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30))) (suspend) - (let ((a0-48 (-> self skel root-channel 0))) - (set! (-> a0-48 param 0) (the float (+ (-> a0-48 frame-group data 0 length) -1))) - (set! (-> a0-48 param 1) 1.0) - (joint-control-channel-group-eval! a0-48 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (sound-stop (-> self sound-id)) - (let ((a0-51 (-> self skel root-channel 0))) - (set! (-> a0-51 frame-group) (the-as art-joint-anim (-> self draw art-group data 14))) - (set! (-> a0-51 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 14)) data 0 length) -1)) - ) - (set! (-> a0-51 param 1) 1.0) - (set! (-> a0-51 frame-num) 0.0) - (joint-control-channel-group! a0-51 (the-as art-joint-anim (-> self draw art-group data 14)) num-func-seek!) - ) + (ja-no-eval :group! assistant-village2-idle-hut-stop-welding-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-52 (-> self skel root-channel 0))) - (set! (-> a0-52 param 0) (the float (+ (-> a0-52 frame-group data 0 length) -1))) - (set! (-> a0-52 param 1) 1.0) - (joint-control-channel-group-eval! a0-52 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -792,8 +579,7 @@ (defstate play-anim (assistant-bluehut) :virtual #t - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self jaws)))) (if a0-1 (deactivate a0-1) @@ -805,8 +591,7 @@ (close-specific-task! (game-task village2-levitator) (task-status need-reminder-a)) (none) ) - :trans - (behavior () + :trans (behavior () '() (none) ) @@ -830,15 +615,13 @@ (defpartgroup group-assistant-bluehut-torch :id 288 :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 1322 :fade-after (meters 30) :falloff-to (meters 30)) + :parts ((sp-item 1322 :fade-after (meters 30) :falloff-to (meters 30)) (sp-item 1323 :fade-after (meters 60) :falloff-to (meters 80)) ) ) (defpart 1322 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -854,8 +637,7 @@ ) (defpart 1323 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -880,8 +662,7 @@ ) (defpart 1324 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 3.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.075) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -902,22 +683,11 @@ (when (< (-> arg2 y) (-> arg1 user-float)) (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (if (< (+ -1.0 (the-as float v1-2)) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) - ) - ) + (if (< (rand-float-gen) 0.25) + (sound-play "water-drop") + ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 1324) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 1324) gp-0) ) ) (none) @@ -940,8 +710,7 @@ :id 658 :flags (use-local-clock) :bounds (static-bspherem -20 8 0 80) - :parts - ((sp-item 2673 :fade-after (meters 120) :falloff-to (meters 140) :binding 2670) + :parts ((sp-item 2673 :fade-after (meters 120) :falloff-to (meters 140) :binding 2670) (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2671) (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2672) (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2671) @@ -972,8 +741,7 @@ ) (defpart 2694 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.2 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -992,8 +760,7 @@ ) (defpart 2693 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1012,8 +779,7 @@ ) (defpart 2673 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.025 0.025 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1033,8 +799,7 @@ ) (defpart 2670 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1056,8 +821,7 @@ ) (defpart 2671 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1076,8 +840,7 @@ ) (defpart 2672 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1096,8 +859,7 @@ ) (defpart 2674 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-y (meters 0.6) (meters 0.8) 1.0) @@ -1117,8 +879,7 @@ ) (defpart 2676 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1138,8 +899,7 @@ ) (defpart 2675 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1158,13 +918,11 @@ :id 659 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 34) - :parts - ((sp-item 2695) (sp-item 2696 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 2677)) + :parts ((sp-item 2695) (sp-item 2696 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 2677)) ) (defpart 2696 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 2.0 6.0 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1) 1.0) @@ -1190,8 +948,7 @@ ) (defpart 2695 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 180.0) (degrees 360.0) 1.0) @@ -1210,8 +967,7 @@ ) (defpart 2677 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 6) 1.0) (sp-rnd-flt spt-rot-z (degrees 180.0) (degrees 360.0) 1.0) @@ -1234,8 +990,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2751 :fade-after (meters 100) :falloff-to (meters 100) :binding 2750) + :parts ((sp-item 2751 :fade-after (meters 100) :falloff-to (meters 100) :binding 2750) (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2797) (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2798) (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2797) @@ -1277,8 +1032,7 @@ ) (defpart 2678 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.001) (meters 0.002) 1.0) (sp-rnd-flt spt-y (meters -0.001) (meters 0.002) 1.0) @@ -1299,8 +1053,7 @@ ) (defpart 2751 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1315,8 +1068,7 @@ ) (defpart 2750 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1338,8 +1090,7 @@ ) (defpart 2797 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 0.4 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1358,8 +1109,7 @@ ) (defpart 2798 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-rnd-flt spt-num 0.2 0.4 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1382,13 +1132,11 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2679)) + :parts ((sp-item 2679)) ) (defpart 2679 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.001) (meters 0.002) 1.0) (sp-rnd-flt spt-y (meters -0.001) (meters 0.002) 1.0) @@ -1436,31 +1184,20 @@ (vector-! s4-0 gp-0 s5-0) (let ((t2-0 (new 'stack-no-clear 'collide-tri-result))) 0.0 - (when (>= (fill-and-probe-using-line-sphere - *collide-cache* - s5-0 - s4-0 - 6144.0 - (collide-kind target) - (the-as process #f) - t2-0 - 1 - ) - 0.0 + (if (>= (fill-and-probe-using-line-sphere + *collide-cache* + s5-0 + s4-0 + 6144.0 + (collide-kind target) + (the-as process #f) + t2-0 + (new 'static 'pat-surface :noentity #x1) ) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'shove) - (set! (-> a1-7 param 0) (the-as uint #f)) - (let ((v1-13 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-13 shove-up) 8192.0) - (set! (-> v1-13 shove-back) 12288.0) - (set! (-> a1-7 param 1) (the-as uint v1-13)) - ) - (send-event-function *target* a1-7) + 0.0 + ) + (send-event *target* 'shove #f (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3))))) ) - ) ) (vector-normalize! s4-0 (+ -20480.0 (vector-length s4-0))) (vector+! gp-0 s5-0 s4-0) @@ -1508,8 +1245,7 @@ :name "assistant-village2-resolution" :index 16 :parts 7 - :command-list - '((196 joint "cameraB") + :command-list '((196 joint "cameraB") (241 joint "camera") (286 joint "cameraB") (436 joint "camera") @@ -1544,8 +1280,7 @@ (defstate play-anim (assistant-levitator) :virtual #t - :exit - (behavior () + :exit (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) (set! (-> a1-0 num-params) 0) @@ -1564,8 +1299,7 @@ ((-> (method-of-type process-taskable play-anim) exit)) (none) ) - :trans - (behavior () + :trans (behavior () (assistant-levitator-blue-glow) (if (< 200.0 (ja-aframe-num 0)) (assistant-levitator-blue-beam) @@ -1577,8 +1311,7 @@ (defstate hidden (assistant-levitator) :virtual #t - :trans - (behavior () + :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) (when (and (cond ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) @@ -1645,172 +1378,67 @@ (defstate idle (assistant-levitator) :virtual #t - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) ((-> (method-of-type process-taskable idle) exit)) (none) ) - :trans - (behavior () + :trans (behavior () (assistant-levitator-blue-glow) (update! (-> self sound)) ((-> (method-of-type process-taskable idle) trans)) (none) ) - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) ) - (while #t + (loop (cond ((= (get-task-status (game-task village2-levitator)) (task-status invalid)) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! assistant-village2-idle-after-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (assistant-levitator-blue-beam) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((v1-29 (-> self skel root-channel 0))) - (set! (-> v1-29 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) + (ja :group! assistant-village2-idle-a-ja) (let* ((f30-0 2.0) (v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-32 (the-as number (logior #x3f800000 v1-31))) ) (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-32)))) 3)) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-16 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! - a0-16 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! assistant-village2-idle-to-b-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((v1-89 (-> self skel root-channel 0))) - (set! (-> v1-89 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) + (ja :num! (seek!)) ) + (ja :group! assistant-village2-idle-b-ja) (let* ((f30-1 2.0) (v1-91 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-92 (the-as number (logior #x3f800000 v1-91))) ) (countdown (gp-1 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-92)))) 3)) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-27 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-27 param 1) 1.0) - (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! - a0-27 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-30 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-30 param 1) 1.0) - (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! assistant-village2-idle-to-a-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 param 0) (the float (+ (-> a0-31 frame-group data 0 length) -1))) - (set! (-> a0-31 param 1) 1.0) - (joint-control-channel-group-eval! a0-31 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -1826,10 +1454,9 @@ ) (defstate just-particles (assistant-levitator) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) - (while #t + (loop (assistant-levitator-blue-glow) (assistant-levitator-blue-beam) (update! (-> self sound)) @@ -1847,19 +1474,8 @@ (set! (-> obj particle 1) (create-launch-control (-> *part-group-id-table* 659) obj)) (set! (-> obj particle 2) (create-launch-control (-> *part-group-id-table* 660) obj)) (set! (-> obj particle 3) (create-launch-control (-> *part-group-id-table* 661) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "lev-mach-idle") - :volume #x400 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "lev-mach-idle" :fo-max 30) (-> obj root-override trans)) ) (if (= (get-task-status (game-task village2-levitator)) (task-status invalid)) (go just-particles) diff --git a/goal_src/levels/village2/flutflut-bluehut.gc b/goal_src/levels/village2/flutflut-bluehut.gc index 8b29d5555f..cf42b5308b 100644 --- a/goal_src/levels/village2/flutflut-bluehut.gc +++ b/goal_src/levels/village2/flutflut-bluehut.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/flutflut-bluehut-ag.gc") + (deftype flutflut-bluehut (process-taskable) () :heap-base #x110 @@ -16,13 +18,10 @@ ) -(defskelgroup *flutflut-bluehut-sg* flutflut-bluehut - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3.25) - :longest-edge (meters 0) - ) +(defskelgroup *flutflut-bluehut-sg* flutflut-bluehut flutflut-bluehut-lod0-jg flutflut-bluehut-idle-breathe-ja + ((flutflut-bluehut-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.25) + ) (defmethod play-anim! flutflut-bluehut ((obj flutflut-bluehut) (arg0 symbol)) (current-status (-> obj tasks)) @@ -49,102 +48,36 @@ (defstate idle (flutflut-bluehut) :virtual #t - :trans - (behavior () + :trans (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) (none) ) - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) - ) - (while #t - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) ) + (loop + (ja :group! flutflut-bluehut-idle-breathe-ja) (let* ((f30-0 2.0) (v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-9 (the-as number (logior #x3f800000 v1-8))) ) (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-9)))) 1)) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-12 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! - a0-12 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((s5-0 (-> *display* base-frame-counter))) (while (< (+ (-> *display* base-frame-counter) (seconds -0.5)) s5-0) (suspend) ) ) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-15 param 0) 0.0) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-15 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) 0.0) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) (let ((s5-1 (-> *display* base-frame-counter))) (while (< (+ (-> *display* base-frame-counter) (seconds -0.5)) s5-1) @@ -153,83 +86,28 @@ ) ) ) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! flutflut-bluehut-idle-start-scratch-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((v1-100 (-> self skel root-channel 0))) - (set! (-> v1-100 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) + (ja :num! (seek!)) ) + (ja :group! flutflut-bluehut-idle-scratch-ja) (let* ((f30-1 2.0) (v1-102 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-103 (the-as number (logior #x3f800000 v1-102))) ) (countdown (gp-1 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-103)))) 6)) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-26 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-26 param 1) 1.0) - (set! (-> a0-26 frame-num) 0.0) - (joint-control-channel-group! - a0-26 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1))) - (set! (-> a0-27 param 1) 1.0) - (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-29 param 0) 0.0) - (set! (-> a0-29 param 1) 1.0) - (set! (-> a0-29 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! flutflut-bluehut-idle-start-scratch-ja :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 param 0) 0.0) - (set! (-> a0-30 param 1) 1.0) - (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) ) (none) diff --git a/goal_src/levels/village2/gambler.gc b/goal_src/levels/village2/gambler.gc index 254a16873a..3562f0e4ac 100644 --- a/goal_src/levels/village2/gambler.gc +++ b/goal_src/levels/village2/gambler.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/gambler-ag.gc") + (deftype gambler (process-taskable) () :heap-base #x110 @@ -16,14 +18,11 @@ ) -(defskelgroup *gambler-sg* gambler - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *gambler-sg* gambler gambler-lod0-jg gambler-idle-tiptoe-ja + ((gambler-lod0-mg (meters 20)) (gambler-lod1-mg (meters 40)) (gambler-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow gambler-shadow-mg + ) (defmethod play-anim! gambler ((obj gambler) (arg0 symbol)) (set! (-> obj talk-message) (game-text-id press-to-talk)) @@ -37,8 +36,7 @@ :name "gambler-introduction-1" :index 11 :parts 9 - :command-list - '((0 want-levels village2 rolling) + :command-list '((0 want-levels village2 rolling) (0 display-level rolling #f) (29 joint "cameraB") (103 joint "camera") @@ -128,10 +126,7 @@ (defmethod TODO-RENAME-43 gambler ((obj gambler)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 61440.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.9230769 f0-2) (play-ambient (-> obj ambient) "GAM-AM01" #f (-> obj root-override trans)) @@ -181,88 +176,37 @@ (defstate idle (gambler) :virtual #t - :code - (behavior () - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - (ja-channel-push! 1 60) - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) + :code (behavior () + (when (!= (ja-group) gambler-idle-fidget-ja) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! gambler-idle-fidget-ja) ) - (while #t - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-9 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! - a0-9 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (TODO-RENAME-43 self) - (let* ((v1-38 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-39 (the-as number (logior #x3f800000 v1-38))) - (f0-9 (+ -1.0 (the-as float v1-39))) - ) + (let ((f0-9 (rand-float-gen))) (cond ((< f0-9 0.16666667) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) + (ja :group! gambler-idle-tiptoe-ja) ) ((< f0-9 0.33333334) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) + (ja :group! gambler-idle-look-1-ja) ) ((< f0-9 0.5) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) + (ja :group! gambler-idle-fidget-ja) ) ((< f0-9 0.6666667) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - ) + (ja :group! gambler-idle-scratch-1-ja) ) ((< f0-9 0.8333333) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - ) + (ja :group! gambler-idle-look-2-ja) ) (else - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - ) + (ja :group! gambler-idle-scratch-2-ja) ) ) ) diff --git a/goal_src/levels/village2/geologist.gc b/goal_src/levels/village2/geologist.gc index f6696f3a09..3ff140861a 100644 --- a/goal_src/levels/village2/geologist.gc +++ b/goal_src/levels/village2/geologist.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/geologist-ag.gc") + (deftype geologist (process-taskable) () :heap-base #x110 @@ -16,14 +18,11 @@ ) -(defskelgroup *geologist-sg* geologist - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *geologist-sg* geologist geologist-lod0-jg geologist-idle-ja + ((geologist-lod0-mg (meters 20)) (geologist-lod1-mg (meters 40)) (geologist-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow geologist-shadow-mg + ) (defmethod play-anim! geologist ((obj geologist) (arg0 symbol)) (set! (-> obj talk-message) (game-text-id press-to-talk)) @@ -37,8 +36,7 @@ :name "geologist-introduction" :index 6 :parts 13 - :command-list - '((0 want-levels village2 rolling) + :command-list '((0 want-levels village2 rolling) (199 joint "cameraB") (325 joint "camera") (520 alive "racer-2") @@ -120,10 +118,7 @@ (defmethod TODO-RENAME-43 geologist ((obj geologist)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.8888889 f0-2) (play-ambient (-> obj ambient) "GEO-AM01" #f (-> obj root-override trans)) diff --git a/goal_src/levels/village2/sage-bluehut.gc b/goal_src/levels/village2/sage-bluehut.gc index 7b28f54c2b..7f6e6a026e 100644 --- a/goal_src/levels/village2/sage-bluehut.gc +++ b/goal_src/levels/village2/sage-bluehut.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/sage-bluehut-ag.gc") + (deftype assistant-bluehut (process-taskable) ((sound-id sound-id :offset-assert 380) (jaws handle :offset-assert 384) @@ -31,112 +33,97 @@ ) -(defskelgroup *sage-bluehut-sg* sage-bluehut - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *sage-bluehut-sg* sage-bluehut sage-bluehut-lod0-jg sage-bluehut-idle-ja + ((sage-bluehut-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow sage-bluehut-shadow-mg + ) (defmethod play-anim! sage-bluehut ((obj sage-bluehut) (arg0 symbol)) - (with-pp - (set! (-> obj talk-message) (game-text-id press-to-talk-to-sage)) - (case (current-status (-> obj tasks)) - (((task-status need-hint) (task-status need-introduction)) - (if (not arg0) - (set! (-> obj will-talk) #t) - ) - (case (current-task (-> obj tasks)) - (((game-task rolling-plants)) - (when arg0 - (let* ((s5-1 (-> obj tasks)) - (s4-0 (method-of-object s5-1 save-reminder)) - (a1-3 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (s4-0 s5-1 (the int (the-as float (send-event-function *target* a1-3))) 1) - ) - (close-status! (-> obj tasks) (task-status need-introduction)) - (let ((s5-2 (-> obj assistant extra process))) - (if (and s5-2 (should-display? (the-as assistant-bluehut s5-2))) - (send-event s5-2 'clone (process->handle obj)) - ) - ) - (set! (-> obj draw bounds w) 40960.0) - ) - (new 'static 'spool-anim - :name - "sage-bluehut-introduction-crop-dusting" - :index 8 - :parts 12 - :command-list - '((678 joint "cameraB") (1166 joint "camera") (1258 joint "cameraB")) - ) - ) - (else - (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (close-specific-task! (game-task swamp-tether-1) (task-status need-introduction)) - (close-specific-task! (game-task swamp-tether-2) (task-status need-introduction)) - (close-specific-task! (game-task swamp-tether-3) (task-status need-introduction)) - (close-specific-task! (game-task swamp-tether-4) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name "sage-bluehut-introduction-prec-arm" - :index 6 - :parts 8 - :command-list - '((141 joint "cameraB") - (214 joint "camera") - (308 joint "cameraB") - (686 joint "camera") - (786 joint "cameraB") - (843 joint "camera") - ) - ) - ) + (set! (-> obj talk-message) (game-text-id press-to-talk-to-sage)) + (case (current-status (-> obj tasks)) + (((task-status need-hint) (task-status need-introduction)) + (if (not arg0) + (set! (-> obj will-talk) #t) ) - ) - (((task-status need-reminder)) - (set! (-> obj skippable) #t) - (if arg0 - (set! (-> obj reminder-played) #t) - ) - (cond - ((zero? (get-reminder (-> obj tasks) 0)) - (new 'static 'spool-anim :name "sage-bluehut-reminder-1-crop-dusting" :index 9 :parts 3 :command-list '()) - ) - (else - (if arg0 - (set! (-> obj draw bounds w) 40960.0) - ) - (new 'static 'spool-anim - :name "sage-bluehut-reminder-1-prec-arm" - :index 7 - :parts 4 - :command-list - '((90 joint "cameraB") (259 joint "camera") (352 joint "cameraB")) - ) - ) - ) - ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) + (case (current-task (-> obj tasks)) + (((game-task rolling-plants)) + (when arg0 + (let* ((s5-1 (-> obj tasks)) + (s4-0 (method-of-object s5-1 save-reminder)) + ) + (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (get-art-elem obj) + (close-status! (-> obj tasks) (task-status need-introduction)) + (let ((s5-2 (-> obj assistant extra process))) + (if (and s5-2 (should-display? (the-as assistant-bluehut s5-2))) + (send-event s5-2 'clone (process->handle obj)) + ) + ) + (set! (-> obj draw bounds w) 40960.0) + ) + (new 'static 'spool-anim + :name "sage-bluehut-introduction-crop-dusting" + :index 8 + :parts 12 + :command-list '((678 joint "cameraB") (1166 joint "camera") (1258 joint "cameraB")) + ) ) + (else + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (close-specific-task! (game-task swamp-tether-1) (task-status need-introduction)) + (close-specific-task! (game-task swamp-tether-2) (task-status need-introduction)) + (close-specific-task! (game-task swamp-tether-3) (task-status need-introduction)) + (close-specific-task! (game-task swamp-tether-4) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "sage-bluehut-introduction-prec-arm" + :index 6 + :parts 8 + :command-list '((141 joint "cameraB") + (214 joint "camera") + (308 joint "cameraB") + (686 joint "camera") + (786 joint "cameraB") + (843 joint "camera") + ) + ) + ) + ) + ) + (((task-status need-reminder)) + (set! (-> obj skippable) #t) + (if arg0 + (set! (-> obj reminder-played) #t) + ) + (cond + ((zero? (get-reminder (-> obj tasks) 0)) + (new 'static 'spool-anim :name "sage-bluehut-reminder-1-crop-dusting" :index 9 :parts 3 :command-list '()) + ) + (else + (if arg0 + (set! (-> obj draw bounds w) 40960.0) + ) + (new 'static 'spool-anim + :name "sage-bluehut-reminder-1-prec-arm" + :index 7 + :parts 4 + :command-list '((90 joint "cameraB") (259 joint "camera") (352 joint "cameraB")) + ) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) + ) + ) + (get-art-elem obj) ) ) ) @@ -212,8 +199,7 @@ (defstate play-anim (sage-bluehut) :virtual #t - :exit - (behavior () + :exit (behavior () (send-event (-> self assistant extra process) 'end-mode) (set! (-> self draw bounds w) 10240.0) ((-> (method-of-type process-taskable play-anim) exit)) @@ -249,10 +235,7 @@ (defmethod TODO-RENAME-43 sage-bluehut ((obj sage-bluehut)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.8 f0-2) (play-ambient (-> obj ambient) "SAGELP20" #f (-> obj root-override trans)) @@ -276,18 +259,13 @@ (defstate idle (sage-bluehut) :virtual #t - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((gp-0 (get-art-elem self))) (cond - ((= gp-0 (-> self draw art-group data 4)) - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - gp-0 - ) - (ja-channel-push! 1 60) + ((= gp-0 sage-bluehut-idle-stand-ja) + (if (!= (ja-group) gp-0) + (ja-channel-push! 1 (seconds 0.2)) ) (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) (let* ((f30-0 3.0) @@ -296,113 +274,39 @@ ) (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-16)))) 5)) (TODO-RENAME-43 self) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-5 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! - a0-5 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (dummy-45 self) (go-virtual idle) ) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (ja-channel-push! 1 60) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! sage-bluehut-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (dummy-45 self) (go-virtual idle) ) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else (TODO-RENAME-43 self) - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - gp-0 - ) - (ja-channel-push! 1 60) + (if (!= (ja-group) gp-0) + (ja-channel-push! 1 (seconds 0.2)) ) (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-16 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! - a0-16 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (dummy-45 self) (go-virtual idle) ) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) diff --git a/goal_src/levels/village2/sunken-elevator.gc b/goal_src/levels/village2/sunken-elevator.gc index 248e7e1ccc..057d257233 100644 --- a/goal_src/levels/village2/sunken-elevator.gc +++ b/goal_src/levels/village2/sunken-elevator.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/sunken-elevator-ag.gc") + (deftype sunken-elevator (plat-button) ((play-at-top-going-up-camera? symbol :offset-assert 240) (teleport-if-below-y float :offset-assert 244) @@ -19,13 +21,10 @@ ) -(defskelgroup *sunken-elevator-sg* sunken-elevator - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -1 0 6.6) - :longest-edge (meters 0) - ) +(defskelgroup *sunken-elevator-sg* sunken-elevator sunken-elevator-lod0-jg sunken-elevator-pressed-ja + ((sunken-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -1 0 6.6) + ) (defmethod should-teleport? sunken-elevator ((obj sunken-elevator)) (let ((f0-0 (-> (camera-pos) y))) @@ -47,8 +46,7 @@ (defstate plat-button-pressed (sunken-elevator) :virtual #t - :enter - (behavior () + :enter (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-pressed) enter))) (if t9-0 (t9-0) @@ -85,25 +83,19 @@ 0 ) ((1.0) - (let* ((gp-1 (get-process *default-dead-pool* village2cam #x4000)) - (v1-10 (when gp-1 - (let ((t9-6 (method-of-type village2cam activate))) - (t9-6 (the-as village2cam gp-1) self 'village2cam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (-> self spawn-pos) - *village2cam-sg* - "elevator-at-top-going-down" - 0 - #f - '() - ) - (-> gp-1 ppointer) - ) - ) - ) + (let ((v1-10 (process-spawn + village2cam + :init pov-camera-init-by-other + (-> self spawn-pos) + *village2cam-sg* + "elevator-at-top-going-down" + 0 + #f + '() + :to self + ) + ) + ) (set! (-> (the-as village2cam (-> v1-10 0)) seq) (the-as uint 1)) ) ) @@ -114,8 +106,7 @@ (defstate plat-button-move-upward (sunken-elevator) :virtual #t - :enter - (behavior () + :enter (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) enter))) (if t9-0 (t9-0) @@ -124,8 +115,7 @@ (set! (-> self play-at-top-going-up-camera?) #t) (none) ) - :trans - (behavior () + :trans (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) trans))) (if t9-0 (t9-0) @@ -135,25 +125,19 @@ (set! *teleport* #t) (set! (-> self play-at-top-going-up-camera?) #f) (load-state-want-display-level 'sunken 'special) - (let* ((gp-0 (get-process *default-dead-pool* village2cam #x4000)) - (v1-8 (when gp-0 - (let ((t9-3 (method-of-type village2cam activate))) - (t9-3 (the-as village2cam gp-0) self 'village2cam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> self spawn-pos) - *village2cam-sg* - "elevator-at-top-going-down" - 0 - #f - '() - ) - (-> gp-0 ppointer) - ) - ) - ) + (let ((v1-8 (process-spawn + village2cam + :init pov-camera-init-by-other + (-> self spawn-pos) + *village2cam-sg* + "elevator-at-top-going-down" + 0 + #f + '() + :to self + ) + ) + ) (set! (-> (the-as village2cam (-> v1-8 0)) seq) (the-as uint 2)) ) ) @@ -163,8 +147,7 @@ (defstate plat-button-move-downward (sunken-elevator) :virtual #t - :trans - (behavior () + :trans (behavior () (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) diff --git a/goal_src/levels/village2/swamp-blimp.gc b/goal_src/levels/village2/swamp-blimp.gc index f945f37827..96aceefecb 100644 --- a/goal_src/levels/village2/swamp-blimp.gc +++ b/goal_src/levels/village2/swamp-blimp.gc @@ -5,67 +5,50 @@ ;; name in dgo: swamp-blimp ;; dgos: L1, VI2 -(define-extern *swamp-blimp-sg* skeleton-group) -(define-extern *swamp-rope-sg* skeleton-group) -(define-extern *swamp-tetherrock-explode-sg* skeleton-group) -(define-extern *precursor-arm-sg* skeleton-group) -(define-extern *swamp-tetherrock-sg* skeleton-group) - (declare-type swamp-blimp process-drawable) -(declare-type swamp-rope process-drawable) -(declare-type swamp-tetherrock process-drawable) -(declare-type precursor-arm process-drawable) ;; DECOMP BEGINS -(defskelgroup *swamp-tetherrock-sg* swamp-tetherrock - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 4 0 6) - :longest-edge (meters 0) - ) +(import "goal_src/import/swamp-tetherrock-ag.gc") +(import "goal_src/import/swamp-rope-ag.gc") +(import "goal_src/import/swamp-tetherrock-explode-ag.gc") +(import "goal_src/import/precursor-arm-ag.gc") +(import "goal_src/import/swamp-blimp-ag.gc") -(defskelgroup *swamp-tetherrock-explode-sg* swamp-tetherrock-explode - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 4 0 16) - :longest-edge (meters 0) - ) +(defskelgroup *swamp-tetherrock-sg* swamp-tetherrock swamp-tetherrock-lod0-jg swamp-tetherrock-idle-ja + ((swamp-tetherrock-lod0-mg (meters 999999))) + :bounds (static-spherem 0 4 0 6) + ) -(defskelgroup *precursor-arm-sg* precursor-arm - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 15 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *swamp-tetherrock-explode-sg* swamp-tetherrock-explode swamp-tetherrock-explode-lod0-jg swamp-tetherrock-explode-idle-ja + ((swamp-tetherrock-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 4 0 16) + ) -(defskelgroup *swamp-rope-sg* swamp-rope - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 300) - :longest-edge (meters 66) - ) +(defskelgroup *precursor-arm-sg* precursor-arm precursor-arm-lod0-jg precursor-arm-idle-ja + ((precursor-arm-lod0-mg (meters 999999))) + :bounds (static-spherem 0 15 0 15) + ) -(defskelgroup *swamp-blimp-sg* swamp-blimp - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 10 60 0 95) - :longest-edge (meters 40) - ) +(defskelgroup *swamp-rope-sg* swamp-rope swamp-rope-lod0-jg swamp-rope-idle-ja + ((swamp-rope-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 300) + :longest-edge (meters 66) + ) + +(defskelgroup *swamp-blimp-sg* swamp-blimp swamp-blimp-lod0-jg swamp-blimp-idle-ja + ((swamp-blimp-lod0-mg (meters 20)) (swamp-blimp-lod1-mg (meters 999999))) + :bounds (static-spherem 10 60 0 95) + :longest-edge (meters 40) + ) (defpartgroup group-tetherrock-explode :id 285 :duration 150 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 2065 :period 600 :length 5) + :parts ((sp-item 2065 :period 600 :length 5) (sp-item 2066 :period 600 :length 40) (sp-item 2067 :period 600 :length 20) (sp-item 2068 :period 600 :length 20) @@ -73,8 +56,7 @@ ) (defpart 2066 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 0.33) (meters 0.66) 1.0) @@ -99,13 +81,11 @@ ) (defpart 2069 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) ) (defpart 2068 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-flt spt-scale-x (meters 0.4)) @@ -123,8 +103,7 @@ ) (defpart 2065 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 32)) @@ -140,8 +119,7 @@ ) (defpart 2067 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) @@ -169,13 +147,11 @@ ) (defpart 2070 - :init-specs - ((sp-flt spt-fade-r -0.53333336) (sp-flt spt-fade-g -0.53333336) (sp-flt spt-fade-b -1.0583333)) + :init-specs ((sp-flt spt-fade-r -0.53333336) (sp-flt spt-fade-g -0.53333336) (sp-flt spt-fade-b -1.0583333)) ) (defpart 2017 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.2) (sp-flt spt-y (meters 0.1)) (sp-flt spt-scale-x (meters 3)) @@ -198,13 +174,11 @@ :id 287 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1321 :period 15 :length 5)) + :parts ((sp-item 1321 :period 15 :length 5)) ) (defpart 1321 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -237,8 +211,7 @@ ) -(define - *SWAMP_BLIMP-bank* +(define *SWAMP_BLIMP-bank* (new 'static 'swamp-blimp-bank :pause-before-dropping-arm #x4b0 :rise-per-break 16384.0 :arm-sink-wait 1500.0) ) @@ -625,8 +598,7 @@ ) (defstate swamp-tetherrock-die (swamp-tetherrock) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (deactivate self) (suspend) @@ -636,11 +608,10 @@ ) (defstate swamp-tetherrock-hide (swamp-tetherrock) - :code - (behavior () + :code (behavior () (clear-collide-with-as (-> self root-override)) (logior! (-> self draw status) (draw-status hidden)) - (while #t + (loop (when (= (get-task-status (-> self entity extra perm task)) (task-status invalid)) (if (not (-> self child)) (go swamp-tetherrock-die) @@ -653,21 +624,19 @@ ) (defstate swamp-tetherrock-break (swamp-tetherrock) - :exit - (behavior () - (clear-pending-settings-from-process *setting-control* self 'movie) - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (copy-settings-from-target! *setting-control*) + :exit (behavior () + (remove-setting! 'movie) + (remove-setting! 'process-mask) + (apply-settings *setting-control*) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (tetherrock-get-info (-> self entity)))) (hide-hud-quick) (process-grab? *target*) - (set-setting! *setting-control* self 'movie (the-as symbol (process->ppointer self)) 0.0 0) - (set-setting! *setting-control* self 'process-mask 'set 0.0 #x80800) - (copy-settings-from-target! *setting-control*) + (set-setting! 'movie (process->ppointer self) 0.0 0) + (set-setting! 'process-mask 'set 0.0 (process-mask movie platform)) + (apply-settings *setting-control*) (let* ((s4-0 (get-task-control (game-task swamp-tether-1))) (s5-0 (+ (get-reminder s4-0 0) 1)) ) @@ -723,43 +692,28 @@ ) ) ) - (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-1 - (let ((t9-21 (method-of-type part-tracker activate))) - (t9-21 (the-as part-tracker s4-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-1 - part-tracker-init - (-> *part-group-id-table* 285) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> s4-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 285) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (logior! (-> self draw status) (draw-status skip-bones)) - (let* ((s4-2 (get-process *default-dead-pool* manipy #x4000)) - (s4-3 (ppointer->handle (when s4-2 - (let ((t9-24 (method-of-type manipy activate))) - (t9-24 (the-as manipy s4-2) *entity-pool* 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-2 - manipy-init - (-> self root-override trans) - (-> self entity) - *swamp-tetherrock-explode-sg* - #f - ) - (-> s4-2 ppointer) - ) - ) - ) - ) + (let ((s4-3 (ppointer->handle (manipy-spawn + (-> self root-override trans) + (-> self entity) + *swamp-tetherrock-explode-sg* + #f + :to *entity-pool* + ) + ) + ) + ) (send-event (handle->process (the-as handle s4-3)) 'anim-mode 'play1) (send-event (handle->process (the-as handle s4-3)) 'art-joint-anim "swamp-tetherrock-explode-explode" 0) (send-event (handle->process (the-as handle s4-3)) 'draw #t) @@ -801,64 +755,57 @@ ) ) (process-release? *target*) - (let ((gp-3 (get-process *default-dead-pool* process #x4000))) - (when gp-3 - (let ((t9-37 (method-of-type process activate))) - (t9-37 gp-3 self 'process (the-as pointer #x70004000)) + (process-spawn-function + process + (lambda ((arg0 int)) + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current hint) + (-> *setting-control* current movie) + ) + (suspend) ) - (run-next-time-in-process - gp-3 - (lambda ((arg0 int)) - (while (or (-> *setting-control* current ambient) - (-> *setting-control* current hint) - (-> *setting-control* current movie) - ) - (suspend) - ) - (cond - ((= arg0 3) - (level-hint-spawn - (game-text-id swamp-tethers-three-to-go) - "sksp0157" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 2) - (level-hint-spawn - (game-text-id swamp-tethers-two-to-go) - "sksp0158" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 1) - (level-hint-spawn - (game-text-id swamp-tethers-lefts-find-the-last) - "sksp0159" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((zero? arg0) - (level-hint-spawn - (game-text-id swamp-tethers-completion-sage-precursor-arm) - "sagevb04" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ) - (none) - ) - s5-2 + (cond + ((= arg0 3) + (level-hint-spawn + (game-text-id swamp-tethers-three-to-go) + "sksp0157" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 2) + (level-hint-spawn + (game-text-id swamp-tethers-two-to-go) + "sksp0158" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 1) + (level-hint-spawn + (game-text-id swamp-tethers-lefts-find-the-last) + "sksp0159" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((zero? arg0) + (level-hint-spawn + (game-text-id swamp-tethers-completion-sage-precursor-arm) + "sagevb04" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) ) - (-> gp-3 ppointer) + (none) ) + s5-2 + :to self ) ) ) @@ -866,13 +813,11 @@ (go swamp-tetherrock-hide) (none) ) - :post - (the-as (function none :behavior swamp-tetherrock) ja-post) + :post (the-as (function none :behavior swamp-tetherrock) ja-post) ) (defstate swamp-tetherrock-idle (swamp-tetherrock) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (when (and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow)) @@ -887,26 +832,20 @@ s5-0 ) ) - (s5-1 (get-process *default-dead-pool* part-tracker #x4000)) ) - (when s5-1 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - part-tracker-init - (-> *part-group-id-table* 287) - 150 - #f - #f - #f - (if gp-0 - (-> (the-as process-drawable gp-0) root trans) - (-> self root-override trans) - ) - ) - (-> s5-1 ppointer) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 287) + 150 + #f + #f + #f + (if gp-0 + (-> (the-as process-drawable gp-0) root trans) + (-> self root-override trans) + ) + :to *entity-pool* ) ) ) @@ -915,9 +854,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((s4-0 (new 'static 'vector :y 1.0 :w 1.0)) (s3-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) @@ -946,8 +884,7 @@ ) (none) ) - :post - (the-as (function none :behavior swamp-tetherrock) transform-post) + :post (the-as (function none :behavior swamp-tetherrock) transform-post) ) (defmethod init-from-entity! swamp-tetherrock ((obj swamp-tetherrock) (arg0 entity-actor)) @@ -1006,11 +943,10 @@ ) (defstate precursor-arm-die (precursor-arm) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (deactivate self) - (while #t + (loop (suspend) ) (none) @@ -1018,8 +954,7 @@ ) (defstate precursor-arm-sink (precursor-arm) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the int (-> *SWAMP_BLIMP-bank* arm-sink-wait)) @@ -1028,7 +963,7 @@ ) (close-specific-task! (-> self entity extra perm task) (task-status need-reminder)) (close-specific-task! (-> self entity extra perm task) (task-status need-resolution)) - (while #t + (loop (cond ((< -40960.0 (-> self y-offset)) (set! (-> self y-offset) (- (-> self y-offset) (* 409.6 (-> *display* time-adjust-ratio)))) @@ -1044,8 +979,7 @@ ) (none) ) - :post - (the-as (function none :behavior precursor-arm) transform-post) + :post (the-as (function none :behavior precursor-arm) transform-post) ) (defun precursor-arm-slip ((arg0 float)) @@ -1067,16 +1001,14 @@ ) (defstate precursor-arm-idle (precursor-arm) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('arm-sink-evt) (go precursor-arm-sink) ) ) ) - :trans - (behavior () + :trans (behavior () (when (>= (-> self rot-t) 1.0) (+! (-> self rot-base) (-> self rot-dist)) (set! (-> self rot-dist) (rand-vu-float-range -16384.0 16384.0)) @@ -1098,21 +1030,13 @@ (let ((a2-1 (new 'static 'vector))) (set! (-> a2-1 quad) (-> self root-override trans quad)) (set! (-> a2-1 y) 0.0) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2017) - a2-1 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (launch-particles :rate 1.0 (-> *part-id-table* 2017) a2-1) ) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (set! (-> self tension) 1.5) (let* ((f26-0 (+ 225.0 (* 150.0 (sin (rand-vu-float-range 0.0 16384.0))))) (f0-5 (+ 4096.0 (* 8192.0 (sin (rand-vu-float-range 0.0 16384.0))))) @@ -1170,8 +1094,7 @@ ) (none) ) - :post - (the-as (function none :behavior precursor-arm) transform-post) + :post (the-as (function none :behavior precursor-arm) transform-post) ) (defmethod init-from-entity! precursor-arm ((obj precursor-arm) (arg0 entity-actor)) @@ -1276,24 +1199,19 @@ ) (defstate swamp-rope-break (swamp-rope) - :enter - (behavior () + :enter (behavior () (set! (-> self scale-base) (-> self root scale y)) (none) ) - :trans - (behavior () + :trans (behavior () (vector<-cspace! (-> self root trans) (-> self parent-override 0 node-list data (-> self parent-rp))) (none) ) - :code - (behavior () - (let* ((f30-0 18.204445) - (f28-0 9.102222) - (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (set! (-> self rot-speed) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-2))))) + :code (behavior () + (let ((f30-0 18.204445) + (f28-0 9.102222) + ) + (set! (-> self rot-speed) (+ f30-0 (* f28-0 (rand-float-gen)))) ) (let* ((f30-1 3000000.0) (v1-5 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -1301,38 +1219,25 @@ ) (set! (-> self state-time) (the-as time-frame (the int (* f30-1 (+ -1.0 (the-as float v1-6)))))) ) - (ja-channel-push! 1 150) - (while #t + (ja-channel-push! 1 (seconds 0.5)) + (loop (let* ((f30-2 0.3) (f28-1 0.25) (v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-11 (the-as number (logior #x3f800000 v1-10))) (f30-3 (+ f30-2 (* f28-1 (+ -1.0 (the-as float v1-11))))) ) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) f30-3) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max f30-3) :frame-num 0.0) (until (ja-done? 0) (swamp-rope-break-code) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) f30-3) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-3)) ) ) ) (none) ) - :post - (behavior () + :post (behavior () (set! (-> self other-pos quad) (-> self root trans quad)) (set! (-> self other-pos y) (+ -245760.0 (-> self other-pos y))) (swamp-rope-post) @@ -1381,14 +1286,10 @@ ) (defstate swamp-rope-idle-rock (swamp-rope) - :trans - swamp-rope-trans - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (while #t + :trans swamp-rope-trans + :code (behavior () + (ja :group! swamp-blimp-idle-ja) + (loop (let* ((f0-1 (* 2000.0 (- (-> self old-scale) (-> self root scale y)))) (f1-3 (+ 0.5 f0-1)) ) @@ -1406,27 +1307,19 @@ (set! (-> (the-as swamp-rope a0-4) frame vector-overlay quad) (-> self root trans quad)) ) ) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 num-func) num-func-identity) - (set! (-> gp-0 frame-num) (* (-> self frame value) (the float (ja-num-frames 0)))) - ) + (ja :num-func num-func-identity :frame-num (* (-> self frame value) (the float (ja-num-frames 0)))) (suspend) ) (none) ) - :post - swamp-rope-post + :post swamp-rope-post ) (defstate swamp-rope-idle-arm (swamp-rope) - :trans - swamp-rope-trans - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (while #t + :trans swamp-rope-trans + :code (behavior () + (ja :group! swamp-blimp-idle-ja) + (loop (let* ((a0-3 (-> self other-entity)) (v1-3 (if a0-3 (-> a0-3 extra process) @@ -1438,16 +1331,12 @@ ) ) (TODO-RENAME-10 (-> self frame) 0.0) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 num-func) num-func-identity) - (set! (-> gp-0 frame-num) (* (-> self frame value) (the float (ja-num-frames 0)))) - ) + (ja :num-func num-func-identity :frame-num (* (-> self frame value) (the float (ja-num-frames 0)))) (suspend) ) (none) ) - :post - swamp-rope-post + :post swamp-rope-post ) (defbehavior swamp-rope-init-by-other swamp-rope ((arg0 vector) (arg1 entity-actor)) @@ -1534,8 +1423,7 @@ ) (defstate swamp-blimp-bye-bye (swamp-blimp) - :enter - (behavior () + :enter (behavior () (let ((gp-0 (entity-actor-lookup (-> self entity) 'alt-actor (-> *SWAMP_BLIMP-bank* arm-index)))) (when gp-0 (entity-birth-no-kill gp-0) @@ -1550,14 +1438,12 @@ 0 (none) ) - :trans - (the-as (function none :behavior swamp-blimp) blimp-trans) - :code - (behavior () + :trans (the-as (function none :behavior swamp-blimp) blimp-trans) + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-copy! gp-0 (-> self rot-at-init)) - (while #t + (loop (quaternion-vector-angle! (-> self rot-at-init) (new 'static 'vector :y 1.0 :w 1.0) @@ -1578,8 +1464,7 @@ ) (none) ) - :post - (the-as (function none :behavior swamp-blimp) transform-post) + :post (the-as (function none :behavior swamp-blimp) transform-post) ) (defbehavior swamp-blimp-setup swamp-blimp () @@ -1661,14 +1546,13 @@ (vector-normalize! (the-as vector (-> self gondola-tilt-oscillator)) 1.0) ) ) + gp-0 ) - (none) ) ) (defstate swamp-blimp-idle (swamp-blimp) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'tetherrock-break-evt) (increment-success-for-hint (game-text-id swamp-tethers-advice-hint)) @@ -1677,14 +1561,10 @@ ) ) ) - :trans - (the-as (function none :behavior swamp-blimp) blimp-trans) - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (while #t + :trans (the-as (function none :behavior swamp-blimp) blimp-trans) + :code (behavior () + (ja :group! swamp-blimp-idle-ja) + (loop (when (< 300 (-> self arm-timer)) (set! (-> self arm-timer) (- (the-as time-frame (-> self arm-timer)) (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) @@ -1713,16 +1593,12 @@ (go swamp-blimp-bye-bye) ) ) - (let ((v1-28 (-> self skel root-channel 0))) - (set! (-> v1-28 num-func) num-func-identity) - (set! (-> v1-28 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) (none) ) - :post - (the-as (function none :behavior swamp-blimp) transform-post) + :post (the-as (function none :behavior swamp-blimp) transform-post) ) (defmethod init-from-entity! swamp-blimp ((obj swamp-blimp) (arg0 entity-actor)) @@ -1770,20 +1646,11 @@ (let ((s5-2 (entity-actor-count (-> obj entity) 'alt-actor))) (dotimes (s4-1 s5-2) (let ((s3-1 (entity-actor-lookup (-> obj entity) 'alt-actor s4-1))) - (when s3-1 - (let ((s2-0 (get-process *default-dead-pool* swamp-rope #x4000))) + (if s3-1 (set! (-> obj the-ropes s4-1) - (ppointer->handle (when s2-0 - (let ((t9-19 (method-of-type swamp-rope activate))) - (t9-19 (the-as swamp-rope s2-0) obj 'swamp-rope (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 swamp-rope-init-by-other (-> obj trans-at-init) s3-1) - (-> s2-0 ppointer) - ) - ) + (ppointer->handle (process-spawn swamp-rope (-> obj trans-at-init) s3-1 :to obj)) ) ) - ) ) ) ) diff --git a/goal_src/levels/village2/village2-obs.gc b/goal_src/levels/village2/village2-obs.gc index 0564b3b95e..5778888a04 100644 --- a/goal_src/levels/village2/village2-obs.gc +++ b/goal_src/levels/village2/village2-obs.gc @@ -8,6 +8,18 @@ ;; DECOMP BEGINS +(import "goal_src/import/pontoonfive-ag.gc") +(import "goal_src/import/allpontoons-ag.gc") +(import "goal_src/import/medres-village2-ag.gc") +(import "goal_src/import/exit-chamber-dummy-ag.gc") +(import "goal_src/import/village2cam-ag.gc") +(import "goal_src/import/fireboulder-ag.gc") +(import "goal_src/import/ogreboss-village2-ag.gc") +(import "goal_src/import/ceilingflag-ag.gc") +(import "goal_src/import/medres-rolling1-ag.gc") +(import "goal_src/import/medres-rolling-ag.gc") +(import "goal_src/import/pontoonten-ag.gc") + (deftype village2cam (pov-camera) ((seq uint64 :offset-assert 224) ) @@ -18,13 +30,10 @@ ) -(defskelgroup *village2cam-sg* village2cam - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *village2cam-sg* village2cam village2cam-lod0-jg -1 + ((village2cam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) (defmethod set-stack-size! village2cam ((obj village2cam)) (stack-size-set! (-> obj main-thread) 512) @@ -33,46 +42,21 @@ (defstate pov-camera-playing (village2cam) :virtual #t - :code - (behavior () + :code (behavior () (let ((v1-0 (-> self seq))) (cond ((zero? v1-0) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((= v1-0 1) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((= v1-0 2) @@ -93,29 +77,23 @@ ) ) -(defskelgroup *med-res-rolling-sg* medres-rolling - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -520 110 70 100) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-rolling-sg* medres-rolling medres-rolling-lod0-jg medres-rolling-idle-ja + ((medres-rolling-lod0-mg (meters 999999))) + :bounds (static-spherem -520 110 70 100) + :longest-edge (meters 0.01) + ) -(defskelgroup *med-res-rolling1-sg* medres-rolling1 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -300 30 -20 120) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-rolling1-sg* medres-rolling1 medres-rolling1-lod0-jg medres-rolling1-idle-ja + ((medres-rolling1-lod0-mg (meters 999999))) + :bounds (static-spherem -300 30 -20 120) + :longest-edge (meters 0.01) + ) -(defskelgroup *med-res-village2-sg* medres-village2 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -60 65 0 90) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-village2-sg* medres-village2 medres-village2-lod0-jg medres-village2-idle-ja + ((medres-village2-lod0-mg (meters 999999))) + :bounds (static-spherem -60 65 0 90) + :longest-edge (meters 0.01) + ) (deftype pontoon (rigid-body-platform) ((anchor-point vector :inline :offset-assert 736) @@ -134,28 +112,24 @@ (defstate pontoon-hidden (pontoon) - :enter - (behavior () + :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self root-overlay)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self root-overlay)) (none) ) - :trans - (behavior () + :trans (behavior () (if (task-closed? (the-as game-task (-> self task)) (task-status need-resolution)) (go-virtual rigid-body-platform-idle) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) @@ -163,8 +137,7 @@ ) (defstate pontoon-die (pontoon) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (deactivate self) (none) @@ -173,8 +146,7 @@ (defstate rigid-body-platform-float (pontoon) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'die) @@ -192,8 +164,7 @@ (defstate rigid-body-platform-idle (pontoon) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'die) (cleanup-for-death self) @@ -310,21 +281,17 @@ ) -(defskelgroup *pontoonfive-sg* pontoonfive - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 3.5) - ) +(defskelgroup *pontoonfive-sg* pontoonfive pontoonfive-lod0-jg pontoonfive-idle-ja + ((pontoonfive-lod0-mg (meters 20)) (pontoonfive-lod1-mg (meters 40)) (pontoonfive-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :longest-edge (meters 3.5) + ) -(defskelgroup *pontoonten-sg* pontoonten - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 7) - :longest-edge (meters 4) - ) +(defskelgroup *pontoonten-sg* pontoonten pontoonten-lod0-jg pontoonten-idle-ja + ((pontoonten-lod0-mg (meters 20)) (pontoonten-lod1-mg (meters 40)) (pontoonten-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + :longest-edge (meters 4) + ) (defmethod TODO-RENAME-30 pontoonfive ((obj pontoonfive)) (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) @@ -450,13 +417,11 @@ :id 563 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2841 :flags (is-3d) :period 900 :length 5) (sp-item 2842 :flags (is-3d) :period 900 :length 5)) + :parts ((sp-item 2841 :flags (is-3d) :period 900 :length 5) (sp-item 2842 :flags (is-3d) :period 900 :length 5)) ) (defpart 2841 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 0) (meters 9) 1.0) (sp-flt spt-y (meters 0.1)) @@ -481,13 +446,11 @@ ) (defpart 2843 - :init-specs - ((sp-flt spt-fade-a -0.094814815)) + :init-specs ((sp-flt spt-fade-a -0.094814815)) ) (defpart 2842 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 8) (meters 8) 1.0) (sp-flt spt-y (meters 0.1)) @@ -525,17 +488,13 @@ ) -(defskelgroup *allpontoons-sg* allpontoons - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 32 0 -5 34) - :longest-edge (meters 0) - ) +(defskelgroup *allpontoons-sg* allpontoons allpontoons-lod0-jg allpontoons-idle-ja + ((allpontoons-lod0-mg (meters 999999))) + :bounds (static-spherem 32 0 -5 34) + ) (defstate allpontoons-be-clone (allpontoons) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'end-mode) (cleanup-for-death self) @@ -544,19 +503,16 @@ ) ) ) - :enter - (behavior ((arg0 handle)) + :enter (behavior ((arg0 handle)) (logclear! (-> self draw status) (draw-status hidden)) (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (ja-aframe-num 0) 500.0) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4))) @@ -567,8 +523,7 @@ ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (clone-anim arg0 3 #t "") (cleanup-for-death self) (deactivate self) @@ -577,22 +532,19 @@ ) (defstate allpontoons-idle (allpontoons) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('clone) (go allpontoons-be-clone (the-as handle (-> arg3 param 0))) ) ) ) - :enter - (behavior () + :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (and (nonzero? (-> self task)) (task-closed? (the-as game-task (-> self task)) (task-status need-resolution))) (cleanup-for-death self) (deactivate self) @@ -631,13 +583,11 @@ ) -(defskelgroup *fireboulder-sg* fireboulder - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 3.5 0 6) - :longest-edge (meters 3.5) - ) +(defskelgroup *fireboulder-sg* fireboulder fireboulder-lod0-jg fireboulder-idle-ja + ((fireboulder-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3.5 0 6) + :longest-edge (meters 3.5) + ) (defbehavior fireboulder-disable-blocking-collision fireboulder () (let ((v1-1 (-> self root-override root-prim))) @@ -699,13 +649,10 @@ ) (defstate fireboulder-hover (fireboulder) - :enter - (behavior () + :enter (behavior () (fireboulder-disable-blocking-collision) (ja-channel-set! 1) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) (logclear! (-> self draw status) (draw-status hidden)) (set! (-> self root-override trans quad) (-> self entity extra trans quad)) (vector-reset! (-> self draw origin)) @@ -719,46 +666,18 @@ (set! (-> self draw bounds w) 24576.0) (none) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (none) ) - :trans - (behavior () + :trans (behavior () (fireboulder-hover-stuff) (update! (-> self sound)) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-y! (-> self root-override quat) @@ -766,43 +685,33 @@ (* 455.1111 (-> *display* time-adjust-ratio)) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior fireboulder) transform-post) + :post (the-as (function none :behavior fireboulder) transform-post) ) (defstate fireboulder-be-clone (fireboulder) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('stop-cloning) (go fireboulder-hover) ) ) ) - :enter - (behavior ((arg0 handle)) + :enter (behavior ((arg0 handle)) (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logclear! (-> self skel status) (janim-status spool)) (none) ) - :trans - (the-as (function none :behavior fireboulder) fireboulder-hover-stuff) - :code - (behavior ((arg0 handle)) + :trans (the-as (function none :behavior fireboulder) fireboulder-hover-stuff) + :code (behavior ((arg0 handle)) (clone-anim arg0 3 #t "") (format 0 "ERROR: fireboulder-be-clone ended~%") (cleanup-for-death self) @@ -812,16 +721,14 @@ ) (defstate fireboulder-idle (fireboulder) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('clone) (go fireboulder-be-clone (the-as handle (-> arg3 param 0))) ) ) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self tracker)))) (if a0-1 (deactivate a0-1) @@ -829,36 +736,10 @@ ) (none) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (cond ((zero? (-> self task)) @@ -869,42 +750,28 @@ ) ) (else - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self tracker) - (ppointer->handle - (when gp-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 271) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self tracker) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 271) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* + ) + ) + ) ) ) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior fireboulder) ja-post) + :post (the-as (function none :behavior fireboulder) ja-post) ) (defmethod init-from-entity! fireboulder ((obj fireboulder) (arg0 entity-actor)) @@ -943,19 +810,8 @@ (cond ((name= (-> obj name) "fireboulder-6") (quaternion-axis-angle! (-> obj root-override quat) 0.0 1.0 0.0 16384.0) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "rock-hover") - :volume #x400 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "rock-hover" :fo-max 30) (-> obj root-override trans)) ) ) (else @@ -992,57 +848,23 @@ ) -(defskelgroup *ceilingflag-sg* ceilingflag - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -4 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *ceilingflag-sg* ceilingflag ceilingflag-geo-jg ceilingflag-idle-ja + ((ceilingflag-geo-mg (meters 999999))) + :bounds (static-spherem 0 -4 0 7) + ) (defstate ceilingflag-idle (ceilingflag) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior ceilingflag) ja-post) + :post (the-as (function none :behavior ceilingflag) ja-post) ) (defmethod init-from-entity! ceilingflag ((obj ceilingflag) (arg0 entity-actor)) @@ -1071,13 +893,10 @@ ) -(defskelgroup *exit-chamber-dummy-sg* exit-chamber-dummy - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 5 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *exit-chamber-dummy-sg* exit-chamber-dummy exit-chamber-dummy-lod0-jg -1 + ((exit-chamber-dummy-lod0-mg (meters 999999))) + :bounds (static-spherem 0 5 0 15) + ) (defmethod skip-reminder? exit-chamber-dummy ((obj exit-chamber-dummy)) (case (get-reminder (get-task-control (game-task sunken-room)) 0) @@ -1093,8 +912,7 @@ ) (defstate exit-chamber-dummy-wait-to-appear (exit-chamber-dummy) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (while (not (skip-reminder? self)) (suspend) @@ -1115,8 +933,7 @@ ) (defstate exit-chamber-dummy-idle (exit-chamber-dummy) - :code - (behavior () + :code (behavior () (logclear! (-> self draw status) (draw-status hidden)) (let ((gp-0 0)) (while (< gp-0 2) @@ -1149,8 +966,7 @@ (go exit-chamber-dummy-wait-to-appear) (none) ) - :post - (the-as (function none :behavior exit-chamber-dummy) ja-post) + :post (the-as (function none :behavior exit-chamber-dummy) ja-post) ) (defmethod init-from-entity! exit-chamber-dummy ((obj exit-chamber-dummy) (arg0 entity-actor)) @@ -1189,27 +1005,22 @@ ) -(defskelgroup *ogreboss-village2-sg* ogreboss-village2 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 10 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *ogreboss-village2-sg* ogreboss-village2 ogreboss-village2-lod0-jg ogreboss-village2-idle-ja + ((ogreboss-village2-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 15) + ) (defpartgroup group-ogreboulder-trail :id 564 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2319 :fade-after (meters 200) :falloff-to (meters 200)) + :parts ((sp-item 2319 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 2320 :fade-after (meters 200) :falloff-to (meters 200)) ) ) (defpart 2320 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 2) 1.0) @@ -1236,8 +1047,7 @@ ) (defpart 2319 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 2) 1.0) @@ -1267,13 +1077,11 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2287 :period 900 :length 40)) + :parts ((sp-item 2287 :period 900 :length 40)) ) (defpart 2287 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.1) 1.0) @@ -1295,16 +1103,14 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2288 :period 900 :length 20) + :parts ((sp-item 2288 :period 900 :length 20) (sp-item 2321 :flags (is-3d) :period 900 :length 10) (sp-item 2322 :flags (is-3d) :period 900 :length 10) ) ) (defpart 2321 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 0) (meters 9) 1.0) (sp-rnd-flt spt-scale-x (meters 16) (meters 8) 1.0) @@ -1328,13 +1134,11 @@ ) (defpart 2323 - :init-specs - ((sp-flt spt-fade-a -0.094814815)) + :init-specs ((sp-flt spt-fade-a -0.094814815)) ) (defpart 2322 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 8) (meters 8) 1.0) (sp-rnd-flt spt-scale-x (meters 4.5) (meters 3.5) 1.0) @@ -1358,8 +1162,7 @@ ) (defpart 2288 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 6) 1.0) @@ -1398,15 +1201,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 552) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "boulder-splash") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 552) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook nothing) @@ -1421,15 +1226,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 552) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "boulder-splash") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 552) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook nothing) @@ -1444,15 +1251,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 551) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "v2ogre-boulder") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 551) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook boulder2-trans-2) @@ -1467,15 +1276,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 552) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "boulder-splash") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 552) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook nothing) @@ -1490,15 +1301,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 551) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "v2ogre-boulder") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 551) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook boulder3-trans-2) @@ -1513,15 +1326,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 552) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "boulder-splash") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 552) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook nothing) @@ -1536,15 +1351,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 551) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "v2ogre-boulder") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 551) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook boulder4-trans-3) @@ -1559,15 +1376,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 551) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "v2ogre-boulder") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 551) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook boulder4-trans-2) @@ -1577,23 +1396,11 @@ ) (defstate ogreboss-village2-throw (ogreboss-village2) - :trans - ogreboss-village2-trans - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self boulder) - (ppointer->handle - (when gp-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy gp-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 manipy-init (-> self entity extra trans) (-> self entity) *fireboulder-sg* #f) - (-> gp-0 ppointer) - ) - ) - ) - ) + :trans ogreboss-village2-trans + :code (behavior () + (set! (-> self boulder) + (ppointer->handle (manipy-spawn (-> self entity extra trans) (-> self entity) *fireboulder-sg* #f :to self)) + ) (send-event (handle->process (-> self boulder)) 'anim-mode 'play1) (send-event (handle->process (-> self boulder)) 'art-joint-anim "fireboulder-pre-throw" 0) (send-event (handle->process (-> self boulder)) 'draw #t) @@ -1610,28 +1417,13 @@ ) ) ) - (ja-channel-push! 1 60) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-31 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-31 param 1) 1.0) - (set! (-> a0-31 frame-num) 0.0) - (joint-control-channel-group! a0-31 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-32 (-> self skel root-channel 0))) - (set! (-> a0-32 param 0) (the float (+ (-> a0-32 frame-group data 0 length) -1))) - (set! (-> a0-32 param 1) 1.0) - (joint-control-channel-group-eval! a0-32 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (let* ((v1-72 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-73 (the-as number (logior #x3f800000 v1-72))) - (f0-9 (+ -1.0 (the-as float v1-73))) - ) + (let ((f0-9 (rand-float-gen))) (cond ((< 0.75 f0-9) (send-event (handle->process (-> self boulder)) 'art-joint-anim "fireboulder-boulder1" 0) @@ -1651,164 +1443,81 @@ ) ) ) - (ja-channel-push! 1 60) - (let ((a0-69 (-> self skel root-channel 0))) - (set! (-> a0-69 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-69 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-69 param 1) 1.0) - (set! (-> a0-69 frame-num) 0.0) - (joint-control-channel-group! a0-69 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-70 (-> self skel root-channel 0))) - (set! (-> a0-70 param 0) (the float (+ (-> a0-70 frame-group data 0 length) -1))) - (set! (-> a0-70 param 1) 1.0) - (joint-control-channel-group-eval! a0-70 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ogreboss-village2-idle) (none) ) - :post - (the-as (function none :behavior ogreboss-village2) ja-post) + :post (the-as (function none :behavior ogreboss-village2) ja-post) ) (defstate ogreboss-village2-idle (ogreboss-village2) - :trans - ogreboss-village2-trans - :code - (behavior () - (while #t - (ja-channel-push! 1 30) + :trans ogreboss-village2-trans + :code (behavior () + (loop + (ja-channel-push! 1 (seconds 0.1)) (let ((v1-0 (rand-vu-int-range 0 2))) (cond ((zero? v1-0) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-0 param 0) (ja-aframe 140.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! (ja-aframe 140.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 140.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 140.0 0))) ) (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.16666667)) + (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.167)) (suspend) ) ) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-3 param 0) (ja-aframe 168.0 0)) - (set! (-> gp-3 param 1) 1.0) - (set! (-> gp-3 frame-num) (ja-aframe 140.0 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) + :num! (seek! (ja-aframe 168.0 0)) + :frame-num (ja-aframe 140.0 0) + ) (until (ja-done? 0) (suspend) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 param 0) (ja-aframe 168.0 0)) - (set! (-> gp-4 param 1) 1.0) - (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 168.0 0))) ) (let ((gp-5 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 0.16666667)) + (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 0.167)) (suspend) ) ) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> gp-6 param 1) 1.0) - (set! (-> gp-6 frame-num) (ja-aframe 168.0 0)) - (joint-control-channel-group! gp-6 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num (ja-aframe 168.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) 1.0) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((= v1-0 1) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else (dotimes (gp-7 4) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-21 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-21 param 1) 1.0) - (set! (-> a0-21 frame-num) 0.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) (the float (+ (-> a0-22 frame-group data 0 length) -1))) - (set! (-> a0-22 param 1) 1.0) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) ) ) - (let* ((v1-104 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-105 (the-as number (logior #x3f800000 v1-104))) - (f0-33 (+ -1.0 (the-as float v1-105))) - ) + (let ((f0-33 (rand-float-gen))) (cond ((< 0.6666667 f0-33) - (ja-channel-push! 1 60) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-27 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-27 param 1) 1.0) - (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((not (handle->process (-> self boulder))) @@ -1819,8 +1528,7 @@ ) (none) ) - :post - (the-as (function none :behavior ogreboss-village2) ja-post) + :post (the-as (function none :behavior ogreboss-village2) ja-post) ) (defmethod init-from-entity! ogreboss-village2 ((obj ogreboss-village2) (arg0 entity-actor)) @@ -1877,8 +1585,7 @@ :count 3 :converted #f :normal-scale 6.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 7.0 :xdiv 1 :speed 6.0) (new 'static 'ripple-wave :scale 7.0 :xdiv -1 :zdiv 1 :speed 6.0) (new 'static 'ripple-wave :scale 3.0 :xdiv 5 :zdiv 3 :speed 3.0) diff --git a/goal_src/levels/village2/village2-part.gc b/goal_src/levels/village2/village2-part.gc index 8a5e30e16b..d05f9afcd2 100644 --- a/goal_src/levels/village2/village2-part.gc +++ b/goal_src/levels/village2/village2-part.gc @@ -19,16 +19,14 @@ (defpartgroup group-village2-moth :id 264 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 1129 :fade-after (meters 120) :flags (bit1) :period 18030 :length 5 :binding 1127) + :parts ((sp-item 1129 :fade-after (meters 120) :flags (bit1) :period 18030 :length 5 :binding 1127) (sp-item 1127 :flags (start-dead launch-asap) :binding 1128) (sp-item 1128 :flags (is-3d start-dead)) ) ) (defpart 1129 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.1)) (sp-copy-from-other spt-scale-y -4) @@ -41,8 +39,7 @@ ) (defpart 1127 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 1.5)) @@ -65,8 +62,7 @@ ) (defpart 1130 - :init-specs - ((sp-rnd-flt spt-vel-x (meters -0.035555556) (meters 0.07111111) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters -0.035555556) (meters 0.07111111) 1.0) (sp-rnd-flt spt-vel-y (meters -0.0148148155) (meters 0.029629631) 1.0) (sp-rnd-flt spt-rotvel-z (degrees -0.4) (degrees 0.8) 1.0) (sp-int-plain-rnd spt-next-time 150 449 1) @@ -75,8 +71,7 @@ ) (defpart 1128 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 0.4)) @@ -94,8 +89,7 @@ (defpartgroup group-village2-tableflys :id 265 :bounds (static-bspherem 0 3 0 10) - :parts - ((sp-item 1133 :flags (launch-asap) :binding 1131) + :parts ((sp-item 1133 :flags (launch-asap) :binding 1131) (sp-item 1134 :flags (launch-asap) :binding 1131) (sp-item 1135 :flags (launch-asap) :binding 1131) (sp-item 1131 :flags (start-dead launch-asap) :binding 1132) @@ -108,8 +102,7 @@ ) (defpart 1133 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 2)) @@ -125,13 +118,11 @@ ) (defpart 1136 - :init-specs - ((sp-int spt-timer 300) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 1136)) + :init-specs ((sp-int spt-timer 300) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 1136)) ) (defpart 1134 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4)) (sp-flt spt-y (meters 2)) @@ -147,8 +138,7 @@ ) (defpart 1135 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -4)) (sp-flt spt-y (meters 2)) @@ -164,8 +154,7 @@ ) (defpart 1131 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-int spt-num 1065353216 1 2.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 1) (meters 1) 1.0) @@ -184,8 +173,7 @@ ) (defpart 1132 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 3.0) (sp-flt spt-scale-x (meters 0.15)) @@ -203,8 +191,7 @@ (defpartgroup group-village2-flamepot :id 266 :bounds (static-bspherem 0 5 0 6) - :parts - ((sp-item 1137 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1137 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1138 :fade-after (meters 40) :falloff-to (meters 40) :period 492 :length 60) (sp-item 1139 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1140 :fade-after (meters 40) :falloff-to (meters 40) :period 369 :length 219) @@ -218,8 +205,7 @@ (defpartgroup group-village2-flamepot-half :id 267 :bounds (static-bspherem 0 5 0 6) - :parts - ((sp-item 1145 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1145 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1146 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1147 :fade-after (meters 50) :falloff-to (meters 60)) ) @@ -228,8 +214,7 @@ (defpartgroup group-village2-flamepot-alt1 :id 268 :bounds (static-bspherem 0 5 0 6) - :parts - ((sp-item 1137 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1137 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1138 :fade-after (meters 40) :falloff-to (meters 40) :period 378 :length 60) (sp-item 1139 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1140 :fade-after (meters 40) :falloff-to (meters 40) :period 435 :length 219) @@ -243,8 +228,7 @@ (defpartgroup group-village2-flamepot-alt2 :id 269 :bounds (static-bspherem 0 5 0 6) - :parts - ((sp-item 1137 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1137 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1138 :fade-after (meters 40) :falloff-to (meters 40) :period 609 :length 60) (sp-item 1139 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1140 :fade-after (meters 40) :falloff-to (meters 40) :period 288 :length 219) @@ -258,13 +242,11 @@ (defpartgroup group-village2-flamepot-off :id 270 :bounds (static-bspherem 0 5 0 6) - :parts - ((sp-item 1148 :fade-after (meters 100) :falloff-to (meters 100))) + :parts ((sp-item 1148 :fade-after (meters 100) :falloff-to (meters 100))) ) (defpart 1144 - :init-specs - ((sp-flt spt-num 0.4) + :init-specs ((sp-flt spt-num 0.4) (sp-flt spt-x (meters 1)) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) @@ -281,13 +263,11 @@ ) (defpart 1149 - :init-specs - ((sp-flt spt-fade-b -5.4613333)) + :init-specs ((sp-flt spt-fade-b -5.4613333)) ) (defpart 1147 - :init-specs - ((sp-flt spt-num 0.15) + :init-specs ((sp-flt spt-num 0.15) (sp-flt spt-x (meters 0.4)) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) @@ -303,13 +283,11 @@ ) (defpart 1150 - :init-specs - ((sp-flt spt-fade-b -3.4133334)) + :init-specs ((sp-flt spt-fade-b -3.4133334)) ) (defpart 1137 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.4 1.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.75) 1.0) (sp-flt spt-y (meters -0.25)) @@ -336,8 +314,7 @@ ) (defpart 1145 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.35 0.25 1.0) (sp-rnd-flt spt-x (meters -0.1) (meters 0.1) 1.0) (sp-flt spt-y (meters -0.25)) @@ -364,8 +341,7 @@ ) (defpart 1138 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1060320051 1 1.0) (sp-rnd-flt spt-x (meters 0) (meters 0.5) 1.0) (sp-flt spt-y (meters -0.25)) @@ -392,8 +368,7 @@ ) (defpart 1139 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.15 0.2 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters -0.25)) @@ -422,8 +397,7 @@ ) (defpart 1146 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.06 0.06 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters -0.25)) @@ -452,8 +426,7 @@ ) (defpart 1148 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.08 0.1 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters -0.25)) @@ -482,8 +455,7 @@ ) (defpart 1151 - :init-specs - ((sp-flt spt-fade-g 0.53333336) + :init-specs ((sp-flt spt-fade-g 0.53333336) (sp-flt spt-fade-b 1.0666667) (sp-int spt-next-time 120) (sp-launcher-by-id spt-next-launcher 1152) @@ -491,13 +463,11 @@ ) (defpart 1152 - :init-specs - ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) (defpart 1140 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.4 0.55 1.0) (sp-rnd-flt spt-x (meters -0.6) (meters 1.2) 1.0) (sp-flt spt-y (meters -0.25)) @@ -524,8 +494,7 @@ ) (defpart 1141 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1031127695 1 0.9) (sp-rnd-flt spt-x (meters -0.6) (meters 0.5) 1.0) (sp-flt spt-y (meters 0.75)) @@ -552,8 +521,7 @@ ) (defpart 1142 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.6 0.9 1.0) (sp-rnd-flt spt-x (meters -0.6) (meters 1.2) 1.0) (sp-flt spt-y (meters -0.25)) @@ -580,8 +548,7 @@ ) (defpart 1143 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1060320051 1 1.5) (sp-rnd-flt spt-x (meters -0.25) (meters 0.75) 1.0) (sp-flt spt-y (meters 0.75)) @@ -610,8 +577,7 @@ (defpartgroup group-village2-fireboulder-off :id 634 :bounds (static-bspherem 0 4 0 10.5) - :parts - ((sp-item 1169 :fade-after (meters 80) :falloff-to (meters 100)) + :parts ((sp-item 1169 :fade-after (meters 80) :falloff-to (meters 100)) (sp-item 1170 :fade-after (meters 80) :falloff-to (meters 100)) ) ) @@ -620,8 +586,7 @@ :id 271 :duration 18000 :bounds (static-bspherem 0 4 0 10.5) - :parts - ((sp-item 1153 :fade-after (meters 200) :falloff-to (meters 240)) + :parts ((sp-item 1153 :fade-after (meters 200) :falloff-to (meters 240)) (sp-item 1154 :fade-after (meters 100) :falloff-to (meters 120) :period 300 :length 60) (sp-item 1155 :fade-after (meters 80) :falloff-to (meters 100)) (sp-item 1156 :fade-after (meters 50) :falloff-to (meters 50)) @@ -643,8 +608,7 @@ ) (defpart 1156 - :init-specs - ((sp-flt spt-num 0.15) + :init-specs ((sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters 1.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-z (meters 0.5) (meters 2.5) 1.0) @@ -663,13 +627,11 @@ ) (defpart 1171 - :init-specs - ((sp-flt spt-fade-b 13.653334)) + :init-specs ((sp-flt spt-fade-b 13.653334)) ) (defpart 1160 - :init-specs - ((sp-flt spt-num 0.15) + :init-specs ((sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -3.5) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters 5.5) (meters 1) 1.0) (sp-rnd-flt spt-z (meters -1) (meters 1) 1.0) @@ -688,8 +650,7 @@ ) (defpart 1164 - :init-specs - ((sp-flt spt-num 0.15) + :init-specs ((sp-flt spt-num 0.15) (sp-flt spt-x (meters 2.7)) (sp-rnd-flt spt-y (meters 4) (meters 1) 1.0) (sp-rnd-flt spt-z (meters -3) (meters 2) 1.0) @@ -708,8 +669,7 @@ ) (defpart 1153 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.7 1.2 1.0) (sp-rnd-flt spt-x (meters 1.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 5) (meters 1) 1.0) @@ -735,8 +695,7 @@ ) (defpart 1154 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1058642330 1 1.7) (sp-rnd-flt spt-x (meters 1.5) (meters 0.7) 1.0) (sp-rnd-flt spt-y (meters 6) (meters 0.6) 1.0) @@ -762,8 +721,7 @@ ) (defpart 1155 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.05 0.2 1.0) (sp-rnd-flt spt-x (meters 1.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 6) (meters 1) 1.0) @@ -792,8 +750,7 @@ ) (defpart 1172 - :init-specs - ((sp-flt spt-fade-g 0.53333336) + :init-specs ((sp-flt spt-fade-g 0.53333336) (sp-flt spt-fade-b 1.0666667) (sp-int spt-next-time 120) (sp-launcher-by-id spt-next-launcher 1173) @@ -801,13 +758,11 @@ ) (defpart 1173 - :init-specs - ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) (defpart 1157 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.65 1.2 1.0) (sp-rnd-flt spt-x (meters -3.5) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters 4.5) (meters 1) 1.0) @@ -834,8 +789,7 @@ ) (defpart 1158 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1056964608 1 1.2) (sp-rnd-flt spt-x (meters -3.5) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters 4.5) (meters 1) 1.0) @@ -862,8 +816,7 @@ ) (defpart 1159 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.08 0.25 1.0) (sp-rnd-flt spt-x (meters -3.5) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters 5.5) (meters 1) 1.0) @@ -893,8 +846,7 @@ ) (defpart 1161 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.7 1.5 1.0) (sp-flt spt-x (meters 2.7)) (sp-rnd-flt spt-y (meters 3) (meters 1) 1.0) @@ -921,8 +873,7 @@ ) (defpart 1162 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1058642330 1 1.4) (sp-flt spt-x (meters 2.7)) (sp-rnd-flt spt-y (meters 3) (meters 1) 1.0) @@ -949,8 +900,7 @@ ) (defpart 1163 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.08 0.25 1.0) (sp-flt spt-x (meters 2.7)) (sp-rnd-flt spt-y (meters 4) (meters 1) 1.0) @@ -980,8 +930,7 @@ ) (defpart 1165 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.65 1.5 1.0) (sp-rnd-flt spt-x (meters -3) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 1) 1.0) @@ -1008,8 +957,7 @@ ) (defpart 1166 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1059481190 1 1.5) (sp-rnd-flt spt-x (meters -3) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 1) 1.0) @@ -1036,8 +984,7 @@ ) (defpart 1167 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.08 0.25 1.0) (sp-rnd-flt spt-x (meters -3) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 5) (meters 1) 1.0) @@ -1067,8 +1014,7 @@ ) (defpart 1168 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.1 0.4 1.0) (sp-rnd-flt spt-x (meters 1.5) (meters 1) 1.0) (sp-flt spt-y (meters -0.5)) @@ -1096,8 +1042,7 @@ ) (defpart 1169 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.15 0.15 1.0) (sp-flt spt-y (meters 4)) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.2) 1.0) @@ -1126,8 +1071,7 @@ ) (defpart 1174 - :init-specs - ((sp-flt spt-vel-y (meters 0.013333334)) + :init-specs ((sp-flt spt-vel-y (meters 0.013333334)) (sp-flt spt-fade-a 0.0) (sp-flt spt-accel-y -0.00040000002) (sp-int spt-next-time 300) @@ -1136,13 +1080,11 @@ ) (defpart 1175 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.10666667)) ) (defpart 1170 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.15 0.3 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.2) 1.0) @@ -1170,13 +1112,11 @@ ) (defpart 1176 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 600) (sp-launcher-by-id spt-next-launcher 1177)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 600) (sp-launcher-by-id spt-next-launcher 1177)) ) (defpart 1177 - :init-specs - ((sp-flt spt-vel-x (meters 0)) + :init-specs ((sp-flt spt-vel-x (meters 0)) (sp-flt spt-vel-y (meters 0.011666667)) (sp-flt spt-vel-z (meters 0)) (sp-flt spt-scalevel-x (meters 0.0016666667)) @@ -1193,8 +1133,7 @@ (defpartgroup group-village2-window-flames-45 :id 272 :bounds (static-bspherem 8 -8 0 36) - :parts - ((sp-item 1178 :fade-after (meters 300)) + :parts ((sp-item 1178 :fade-after (meters 300)) (sp-item 1179 :fade-after (meters 300)) (sp-item 1179 :fade-after (meters 180)) (sp-item 1180 :fade-after (meters 200) :period 2160 :length 5) @@ -1208,8 +1147,7 @@ ) (defpart 1178 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.015 0.035 1.0) (sp-rnd-flt spt-x (meters 4) (meters 12) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 8) 1.0) @@ -1235,21 +1173,18 @@ ) (defpart 1183 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 300 299 1) (sp-launcher-by-id spt-next-launcher 1184) ) ) (defpart 1184 - :init-specs - ((sp-flt spt-fade-a -0.08)) + :init-specs ((sp-flt spt-fade-a -0.08)) ) (defpart 1179 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.4 1.0) (sp-rnd-flt spt-x (meters 10) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 6) 1.0) @@ -1275,13 +1210,11 @@ ) (defpart 1185 - :init-specs - ((sp-flt spt-fade-a -0.85333335)) + :init-specs ((sp-flt spt-fade-a -0.85333335)) ) (defpart 1180 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.8 0.4 1.0) (sp-rnd-flt spt-x (meters 10) (meters 4) 1.0) (sp-flt spt-y (meters 6)) @@ -1305,8 +1238,7 @@ ) (defpart 1181 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.015 0.03 1.0) (sp-rnd-flt spt-x (meters -6) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 8) (meters 8) 1.0) @@ -1332,8 +1264,7 @@ ) (defpart 1182 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 6) 1.0) @@ -1361,8 +1292,7 @@ (defpartgroup group-village2-window-flames-41 :id 273 :bounds (static-bspherem 8 -8 0 36) - :parts - ((sp-item 1186 :fade-after (meters 300)) + :parts ((sp-item 1186 :fade-after (meters 300)) (sp-item 1187 :fade-after (meters 300)) (sp-item 1187 :fade-after (meters 180)) (sp-item 1188 :fade-after (meters 200) :period 2160 :length 5) @@ -1376,8 +1306,7 @@ ) (defpart 1186 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.015 0.03 1.0) (sp-rnd-flt spt-x (meters 6) (meters 12) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 8) 1.0) @@ -1403,8 +1332,7 @@ ) (defpart 1187 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.4 1.0) (sp-rnd-flt spt-x (meters 10) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 6) 1.0) @@ -1430,8 +1358,7 @@ ) (defpart 1188 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.8 0.4 1.0) (sp-rnd-flt spt-x (meters 10) (meters 4) 1.0) (sp-flt spt-y (meters 6)) @@ -1455,8 +1382,7 @@ ) (defpart 1189 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.015 0.03 1.0) (sp-rnd-flt spt-x (meters -2) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 8) (meters 8) 1.0) @@ -1482,8 +1408,7 @@ ) (defpart 1190 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters 6) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 6) 1.0) @@ -1511,16 +1436,14 @@ (defpartgroup group-village2-big-boulder :id 274 :bounds (static-bspherem 8 -8 0 36) - :parts - ((sp-item 1191 :fade-after (meters 300)) + :parts ((sp-item 1191 :fade-after (meters 300)) (sp-item 1192 :fade-after (meters 300)) (sp-item 1192 :fade-after (meters 180)) ) ) (defpart 1191 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.015 0.03 1.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 8) (meters 4) 1.0) @@ -1546,8 +1469,7 @@ ) (defpart 1192 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.4 0.4 1.0) (sp-flt spt-x (meters 2)) (sp-flt spt-y (meters 4)) @@ -1577,8 +1499,7 @@ (defpartgroup group-village2-sages-controlpanel :id 275 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1193 :fade-after (meters 30) :period 736 :length 10) + :parts ((sp-item 1193 :fade-after (meters 30) :period 736 :length 10) (sp-item 1193 :fade-after (meters 30) :period 1696 :length 10) (sp-item 1193 :fade-after (meters 30) :period 5079 :length 10) (sp-item 1194 :fade-after (meters 30) :period 5079 :length 10) @@ -1588,8 +1509,7 @@ ) (defpart 1195 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.4 1.0) (sp-flt spt-x (meters 0.9)) (sp-flt spt-y (meters 0.25)) @@ -1617,8 +1537,7 @@ ) (defpart 1196 - :init-specs - ((sp-flt spt-fade-r -0.053333335) + :init-specs ((sp-flt spt-fade-r -0.053333335) (sp-flt spt-fade-g -0.053333335) (sp-flt spt-fade-b -0.053333335) (sp-flt spt-fade-a -0.10666667) @@ -1626,12 +1545,9 @@ ) (defpart 1193 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 16.0 1.0) - (sp-sound - (new 'static 'sound-spec :mask #x1 :num 0.1 :group #x1 :sound-name (static-sound-name "spark") :volume #x400) - ) + (sp-sound (static-sound-spec "spark" :num 0.1 :volume 100.0)) (sp-flt spt-x (meters 0.9)) (sp-flt spt-y (meters 0.05)) (sp-flt spt-z (meters -0.9)) @@ -1657,12 +1573,9 @@ ) (defpart 1194 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 16.0 1.0) - (sp-sound - (new 'static 'sound-spec :mask #x1 :num 0.1 :group #x1 :sound-name (static-sound-name "spark") :volume #x400) - ) + (sp-sound (static-sound-spec "spark" :num 0.1 :volume 100.0)) (sp-flt spt-x (meters -1.2)) (sp-flt spt-y (meters -0.5)) (sp-flt spt-z (meters 1.2)) @@ -1690,8 +1603,7 @@ (defpartgroup group-village2-sages-machine :id 276 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1199 :fade-after (meters 40) :period 768 :length 10 :binding 1197) + :parts ((sp-item 1199 :fade-after (meters 40) :period 768 :length 10 :binding 1197) (sp-item 1199 :fade-after (meters 40) :period 1096 :length 10 :binding 1198) (sp-item 1199 :fade-after (meters 40) :period 2137 :length 10 :binding 1197) (sp-item 1197 :fade-after (meters 40) :flags (start-dead)) @@ -1709,8 +1621,7 @@ ) (defpart 1201 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-flt spt-x (meters -0.75)) (sp-flt spt-y (meters -0.8)) @@ -1734,8 +1645,7 @@ ) (defpart 1202 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.75)) (sp-flt spt-y (meters -0.8)) @@ -1754,8 +1664,7 @@ ) (defpart 1200 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 1.0 0.5 1.0) (sp-flt spt-x (meters -0.7)) (sp-flt spt-y (meters -0.7)) @@ -1777,8 +1686,7 @@ ) (defpart 1205 - :init-specs - ((sp-flt spt-r 64.0) + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) (sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g -1.0666667) @@ -1787,8 +1695,7 @@ ) (defpart 1203 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.4 1.0) (sp-flt spt-x (meters -1.25)) (sp-flt spt-y (meters 0)) @@ -1816,8 +1723,7 @@ ) (defpart 1206 - :init-specs - ((sp-flt spt-fade-r -0.053333335) + :init-specs ((sp-flt spt-fade-r -0.053333335) (sp-flt spt-fade-g -0.053333335) (sp-flt spt-fade-b -0.053333335) (sp-flt spt-fade-a -0.10666667) @@ -1826,8 +1732,7 @@ ) (defpart 1204 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.8 1.0) (sp-flt spt-x (meters -0.7)) (sp-flt spt-y (meters -0.7)) @@ -1857,8 +1762,7 @@ ) (defpart 1199 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-copy-from-other spt-scale-y -4) @@ -1876,12 +1780,9 @@ ) (defpart 1197 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 2.0 8.0 1.0) - (sp-sound - (new 'static 'sound-spec :mask #x1 :num 0.1 :group #x1 :sound-name (static-sound-name "spark") :volume #x400) - ) + (sp-sound (static-sound-spec "spark" :num 0.1 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) @@ -1904,12 +1805,9 @@ ) (defpart 1198 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 2.0 6.0 1.0) - (sp-sound - (new 'static 'sound-spec :mask #x1 :num 0.1 :group #x1 :sound-name (static-sound-name "spark") :volume #x400) - ) + (sp-sound (static-sound-spec "spark" :num 0.1 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) @@ -1933,8 +1831,7 @@ ) (defpart 1207 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.0 3.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.075) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1955,22 +1852,11 @@ (when (< (-> arg2 y) (-> arg1 user-float)) (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (if (< (+ -1.0 (the-as float v1-2)) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) - ) - ) + (if (< (rand-float-gen) 0.25) + (sound-play "water-drop") + ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 1207) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - (the-as float 1.0) - ) + (launch-particles :rate 1.0 (-> *part-id-table* 1207) gp-0) ) ) (none) @@ -1981,8 +1867,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 2792 :fade-after (meters 100) :falloff-to (meters 100) :binding 2791) + :parts ((sp-item 2792 :fade-after (meters 100) :falloff-to (meters 100) :binding 2791) (sp-item 2791 :flags (bit1 start-dead launch-asap)) (sp-item 2791 :flags (bit1 start-dead launch-asap)) (sp-item 2791 :flags (bit1 start-dead launch-asap)) @@ -2029,8 +1914,7 @@ ) (defpart 2795 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.2 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 12.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -2049,8 +1933,7 @@ ) (defpart 2794 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-rnd-flt spt-num 0.2 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 12.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -2069,8 +1952,7 @@ ) (defpart 2793 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.001) (meters 0.002) 1.0) (sp-rnd-flt spt-y (meters -0.001) (meters 0.002) 1.0) @@ -2091,8 +1973,7 @@ ) (defpart 2792 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -2107,8 +1988,7 @@ ) (defpart 2791 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) diff --git a/goal_src/levels/village2/village2-part2.gc b/goal_src/levels/village2/village2-part2.gc index 693b6d74d4..3ff82ebfdf 100644 --- a/goal_src/levels/village2/village2-part2.gc +++ b/goal_src/levels/village2/village2-part2.gc @@ -8,26 +8,22 @@ ;; DECOMP BEGINS (defpart 1208 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) (defpart 1209 - :init-specs - ((sp-flt spt-fade-a -0.16)) + :init-specs ((sp-flt spt-fade-a -0.16)) ) (defpart 1210 - :init-specs - ((sp-flt spt-fade-a -2.6666667)) + :init-specs ((sp-flt spt-fade-a -2.6666667)) ) (defpartgroup group-village2-waterfall-29 :id 277 :flags (always-draw) :bounds (static-bspherem 0 22 0 35) - :parts - ((sp-item 1211) + :parts ((sp-item 1211) (sp-item 1211 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1211 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 1212 :fade-after (meters 100) :falloff-to (meters 100)) @@ -87,8 +83,7 @@ ) (defpart 1211 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-flt spt-x (meters -7)) (sp-rnd-flt spt-y (meters 41.5) (meters 1.5) 1.0) @@ -115,8 +110,7 @@ ) (defpart 1214 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-flt spt-x (meters -12)) (sp-rnd-flt spt-y (meters 42.5) (meters 1.5) 1.0) @@ -143,8 +137,7 @@ ) (defpart 1217 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.5 0.8 1.0) (sp-rnd-flt spt-x (meters -2) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 24) (meters 1.5) 1.0) @@ -171,8 +164,7 @@ ) (defpart 1220 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.5 0.8 1.0) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters 27.5) (meters 1.5) 1.0) @@ -197,8 +189,7 @@ ) (defpart 1223 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters -1) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 28.5) (meters 1.5) 1.0) @@ -223,8 +214,7 @@ ) (defpart 1224 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 26) (meters 1.5) 1.0) @@ -251,8 +241,7 @@ ) (defpart 1212 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -7)) (sp-rnd-flt spt-y (meters 41.5) (meters 1.5) 1.0) @@ -279,8 +268,7 @@ ) (defpart 1215 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -12)) (sp-rnd-flt spt-y (meters 42.5) (meters 1.5) 1.0) @@ -307,8 +295,7 @@ ) (defpart 1218 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 23.5) (meters 1.5) 1.0) @@ -335,8 +322,7 @@ ) (defpart 1221 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -4) (meters 10) 1.0) (sp-rnd-flt spt-y (meters 27.5) (meters 1.5) 1.0) @@ -362,8 +348,7 @@ ) (defpart 1225 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 26) (meters 1.5) 1.0) @@ -390,8 +375,7 @@ ) (defpart 1213 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.2 1.0) (sp-flt spt-x (meters -7)) (sp-rnd-flt spt-y (meters 41.5) (meters 1.5) 1.0) @@ -419,8 +403,7 @@ ) (defpart 1216 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.2 1.0) (sp-flt spt-x (meters -12)) (sp-rnd-flt spt-y (meters 42.5) (meters 1.5) 1.0) @@ -448,8 +431,7 @@ ) (defpart 1219 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.2 1.0) (sp-rnd-flt spt-x (meters -2) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 23.5) (meters 1.5) 1.0) @@ -477,8 +459,7 @@ ) (defpart 1222 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters 27.5) (meters 1.5) 1.0) @@ -505,8 +486,7 @@ ) (defpart 1227 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters -1) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 28.5) (meters 1.5) 1.0) @@ -533,8 +513,7 @@ ) (defpart 1226 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.2 1.0) (sp-rnd-flt spt-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 26) (meters 1.5) 1.0) @@ -562,8 +541,7 @@ ) (defpart 1228 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters 2) (meters 7) 1.0) (sp-flt spt-y (meters 12.5)) @@ -591,8 +569,7 @@ ) (defpart 1229 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters 3) (meters 5) 1.0) (sp-flt spt-y (meters 7)) @@ -615,8 +592,7 @@ ) (defpart 1230 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.035 0.03 1.0) (sp-rnd-flt spt-x (meters 3.5) (meters 5) 1.0) (sp-flt spt-y (meters 12.5)) @@ -644,8 +620,7 @@ ) (defpart 1231 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.025) (sp-rnd-flt spt-x (meters 3) (meters 2) 1.0) (sp-flt spt-y (meters 8)) @@ -668,8 +643,7 @@ ) (defpart 1232 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.035 0.03 1.0) (sp-rnd-flt spt-x (meters -7.5) (meters 5) 1.0) (sp-flt spt-y (meters 12.5)) @@ -697,8 +671,7 @@ ) (defpart 1233 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.025) (sp-rnd-flt spt-x (meters -6.5) (meters 3) 1.0) (sp-flt spt-y (meters 8)) @@ -721,8 +694,7 @@ ) (defpart 1234 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-flt spt-x (meters -6)) (sp-rnd-flt spt-y (meters 43) (meters 0.5) 1.0) @@ -749,8 +721,7 @@ ) (defpart 1235 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.03 1.0 1.0) (sp-flt spt-x (meters -6)) (sp-rnd-flt spt-y (meters 43) (meters 0.5) 1.0) @@ -777,8 +748,7 @@ ) (defpart 1236 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.3) (sp-flt spt-x (meters -6)) (sp-rnd-flt spt-y (meters 43) (meters 0.5) 1.0) @@ -805,8 +775,7 @@ ) (defpart 1237 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.7) (sp-flt spt-x (meters -6)) (sp-rnd-flt spt-y (meters 43) (meters 0.5) 1.0) @@ -833,8 +802,7 @@ ) (defpart 1238 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.1 1.0) (sp-flt spt-x (meters -6)) (sp-rnd-flt spt-y (meters 42.5) (meters 0.5) 1.0) @@ -863,8 +831,7 @@ ) (defpart 1239 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.06 1.0) (sp-flt spt-x (meters -6)) (sp-rnd-flt spt-y (meters 42.5) (meters 0.5) 1.0) @@ -892,8 +859,7 @@ ) (defpart 1240 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-flt spt-x (meters 0)) (sp-rnd-flt spt-y (meters 28) (meters 1.5) 1.0) @@ -922,8 +888,7 @@ ) (defpart 1241 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-rnd-flt spt-y (meters 28) (meters 1.5) 1.0) @@ -951,8 +916,7 @@ ) (defpart 1242 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.3 1.0) (sp-flt spt-x (meters 0)) (sp-rnd-flt spt-y (meters 28) (meters 1.5) 1.0) @@ -985,8 +949,7 @@ :id 278 :flags (always-draw) :bounds (static-bspherem 0 22 0 35) - :parts - ((sp-item 1243) + :parts ((sp-item 1243) (sp-item 1243 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 1243 :fade-after (meters 240) :falloff-to (meters 240)) (sp-item 1244 :fade-after (meters 80) :falloff-to (meters 80)) @@ -999,8 +962,7 @@ ) (defpart 1243 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters -8) (meters 4) 1.0) (sp-flt spt-y (meters 49.5)) @@ -1028,8 +990,7 @@ ) (defpart 1244 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -8) (meters 4) 1.0) (sp-flt spt-y (meters 49.5)) @@ -1056,8 +1017,7 @@ ) (defpart 1245 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters -7) (meters 3.5) 1.0) (sp-flt spt-y (meters 49.5)) @@ -1086,8 +1046,7 @@ ) (defpart 1246 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters 3) (meters 6) 1.0) (sp-flt spt-y (meters 6)) @@ -1115,8 +1074,7 @@ ) (defpart 1247 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters 5) (meters 10) 1.0) (sp-flt spt-y (meters 2.5)) @@ -1142,16 +1100,14 @@ :id 279 :flags (always-draw) :bounds (static-bspherem 0 22 0 35) - :parts - ((sp-item 2324)) + :parts ((sp-item 2324)) ) (defpartgroup group-village2-waterfall-32 :id 280 :flags (always-draw) :bounds (static-bspherem 0 22 0 35) - :parts - ((sp-item 1253) + :parts ((sp-item 1253) (sp-item 1253 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 1253 :fade-after (meters 240) :falloff-to (meters 240)) (sp-item 1254 :fade-after (meters 80) :falloff-to (meters 80)) @@ -1174,8 +1130,7 @@ ) (defpart 1253 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.266 0.333 1.0) (sp-rnd-flt spt-x (meters -12) (meters 1) 1.0) (sp-flt spt-y (meters 50.5)) @@ -1202,8 +1157,7 @@ ) (defpart 1264 - :init-specs - ((sp-rnd-flt spt-scale-y (meters 1) (meters 1) 1.0) + :init-specs ((sp-rnd-flt spt-scale-y (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-vel-x (meters 0.053333335) (meters 0.013333334) 1.0) (sp-rnd-flt spt-vel-y (meters -0.026666667) (meters -0.013333334) 1.0) (sp-rnd-flt spt-vel-z (meters 0.04) (meters 0.013333334) 1.0) @@ -1215,8 +1169,7 @@ ) (defpart 1254 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -12) (meters 1) 1.0) (sp-flt spt-y (meters 50.5)) @@ -1245,8 +1198,7 @@ ) (defpart 1265 - :init-specs - ((sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) + :init-specs ((sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-vel-x (meters 0.026666667) (meters 0.013333334) 1.0) (sp-rnd-flt spt-vel-y (meters 0) (meters 0.013333334) 1.0) @@ -1256,8 +1208,7 @@ ) (defpart 1255 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.2 1.0) (sp-rnd-flt spt-x (meters -12) (meters 1) 1.0) (sp-flt spt-y (meters 50.5)) @@ -1285,8 +1236,7 @@ ) (defpart 1266 - :init-specs - ((sp-rnd-flt spt-vel-x (meters 0.053333335) (meters 0.013333334) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters 0.053333335) (meters 0.013333334) 1.0) (sp-rnd-flt spt-vel-y (meters -0.026666667) (meters -0.013333334) 1.0) (sp-rnd-flt spt-vel-z (meters 0.04) (meters 0.006666667) 1.0) (sp-flt spt-scalevel-x (meters 0.009765625)) @@ -1299,8 +1249,7 @@ ) (defpart 1256 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -3) (meters 12) 1.0) (sp-flt spt-y (meters 6)) @@ -1328,8 +1277,7 @@ ) (defpart 1257 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters -3) (meters 12) 1.0) (sp-flt spt-y (meters 2.5)) @@ -1352,8 +1300,7 @@ ) (defpart 1258 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.033 1.2 1.0) (sp-rnd-flt spt-x (meters -12) (meters 1) 1.0) (sp-flt spt-y (meters 50.5)) @@ -1380,8 +1327,7 @@ ) (defpart 1259 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -12) (meters 1) 1.0) (sp-flt spt-y (meters 50.5)) @@ -1408,8 +1354,7 @@ ) (defpart 1260 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.2 1.0) (sp-rnd-flt spt-x (meters -12) (meters 1) 1.0) (sp-flt spt-y (meters 50.5)) @@ -1437,8 +1382,7 @@ ) (defpart 1261 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.33 1.2 1.0) (sp-rnd-flt spt-x (meters -2) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 23.5) (meters 6) 1.0) @@ -1465,8 +1409,7 @@ ) (defpart 1262 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 25.5) (meters 4) 1.0) @@ -1493,8 +1436,7 @@ ) (defpart 1263 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters -2) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 22.5) (meters 7) 1.0) @@ -1525,8 +1467,7 @@ :id 281 :flags (always-draw) :bounds (static-bspherem 0 22 0 35) - :parts - ((sp-item 1267) + :parts ((sp-item 1267) (sp-item 1267 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1267 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 1268) @@ -1549,8 +1490,7 @@ ) (defpart 1267 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.4 1.0 1.0) (sp-flt spt-x (meters -7.5)) (sp-rnd-flt spt-y (meters 48) (meters 0.5) 1.0) @@ -1577,8 +1517,7 @@ ) (defpart 1268 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.03 1.0 1.0) (sp-flt spt-x (meters -7.5)) (sp-rnd-flt spt-y (meters 48) (meters 0.5) 1.0) @@ -1605,8 +1544,7 @@ ) (defpart 1269 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.3) (sp-flt spt-x (meters -7.5)) (sp-rnd-flt spt-y (meters 48) (meters 0.5) 1.0) @@ -1633,8 +1571,7 @@ ) (defpart 1270 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.7) (sp-flt spt-x (meters -7.5)) (sp-rnd-flt spt-y (meters 48) (meters 0.5) 1.0) @@ -1661,8 +1598,7 @@ ) (defpart 1271 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.1 1.0) (sp-flt spt-x (meters -7)) (sp-rnd-flt spt-y (meters 47.5) (meters 0.5) 1.0) @@ -1691,8 +1627,7 @@ ) (defpart 1272 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.06 1.0) (sp-flt spt-x (meters -7)) (sp-rnd-flt spt-y (meters 47.5) (meters 0.5) 1.0) @@ -1720,8 +1655,7 @@ ) (defpart 1273 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-flt spt-x (meters -1.5)) (sp-rnd-flt spt-y (meters 33) (meters 1.5) 1.0) @@ -1750,8 +1684,7 @@ ) (defpart 1274 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.5)) (sp-rnd-flt spt-y (meters 33) (meters 1.5) 1.0) @@ -1779,8 +1712,7 @@ ) (defpart 1275 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-flt spt-x (meters -1.5)) (sp-rnd-flt spt-y (meters 33) (meters 1.5) 1.0) @@ -1810,8 +1742,7 @@ ) (defpart 1276 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters 2.5) (meters 12) 1.0) (sp-flt spt-y (meters 7)) @@ -1839,8 +1770,7 @@ ) (defpart 1277 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters 3.5) (meters 10) 1.0) (sp-flt spt-y (meters 2.5)) @@ -1866,8 +1796,7 @@ :id 282 :flags (always-draw) :bounds (static-bspherem -15 17 -10 40) - :parts - ((sp-item 1278) + :parts ((sp-item 1278) (sp-item 1278 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1278 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 1279 :fade-after (meters 80) :falloff-to (meters 80)) @@ -1929,8 +1858,7 @@ ) (defpart 1278 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters -15) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -1958,8 +1886,7 @@ ) (defpart 1281 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.15 0.075 1.0) (sp-rnd-flt spt-x (meters -18) (meters 4) 1.0) (sp-flt spt-y (meters 42.5)) @@ -1987,8 +1914,7 @@ ) (defpart 1284 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.15 0.075 1.0) (sp-rnd-flt spt-x (meters -20) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2016,8 +1942,7 @@ ) (defpart 1279 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters -15) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2044,8 +1969,7 @@ ) (defpart 1282 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.375) (sp-rnd-flt spt-x (meters -18) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2072,8 +1996,7 @@ ) (defpart 1285 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.375) (sp-rnd-flt spt-x (meters -20) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2100,8 +2023,7 @@ ) (defpart 1280 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.375 0.3 1.0) (sp-rnd-flt spt-x (meters -15) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2130,8 +2052,7 @@ ) (defpart 1283 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.225 0.15 1.0) (sp-rnd-flt spt-x (meters -18) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2160,8 +2081,7 @@ ) (defpart 1286 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.225 0.15 1.0) (sp-rnd-flt spt-x (meters -20) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2190,8 +2110,7 @@ ) (defpart 1287 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.3 0.6 1.0) (sp-rnd-flt spt-x (meters 26) (meters 4) 1.0) (sp-flt spt-y (meters 4.5)) @@ -2219,8 +2138,7 @@ ) (defpart 1290 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.15 0.3 1.0) (sp-rnd-flt spt-x (meters 33) (meters 4) 1.0) (sp-flt spt-y (meters -1)) @@ -2248,8 +2166,7 @@ ) (defpart 1288 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters 26) (meters 4) 1.0) (sp-flt spt-y (meters 4.5)) @@ -2276,8 +2193,7 @@ ) (defpart 1291 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters 33) (meters 4) 1.0) (sp-flt spt-y (meters -1)) @@ -2304,8 +2220,7 @@ ) (defpart 1289 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.375 0.3 1.0) (sp-rnd-flt spt-x (meters 26) (meters 4) 1.0) (sp-flt spt-y (meters 4.5)) @@ -2334,8 +2249,7 @@ ) (defpart 1292 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.375 0.3 1.0) (sp-rnd-flt spt-x (meters 33) (meters 4) 1.0) (sp-flt spt-y (meters -1)) @@ -2364,8 +2278,7 @@ ) (defpart 1293 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.3 0.6 1.0) (sp-rnd-flt spt-x (meters 24) (meters 4) 1.0) (sp-flt spt-y (meters 4.5)) @@ -2393,8 +2306,7 @@ ) (defpart 1294 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters 24) (meters 4) 1.0) (sp-flt spt-y (meters 4.5)) @@ -2421,8 +2333,7 @@ ) (defpart 1295 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.375 0.3 1.0) (sp-rnd-flt spt-x (meters 24) (meters 4) 1.0) (sp-flt spt-y (meters 4.5)) @@ -2451,8 +2362,7 @@ ) (defpart 1296 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.45 0.75 1.0) (sp-rnd-flt spt-x (meters 38) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 1.5) 1.0) @@ -2480,8 +2390,7 @@ ) (defpart 1297 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters 38) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 1.5) 1.0) @@ -2508,8 +2417,7 @@ ) (defpart 1300 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.325) (sp-rnd-flt spt-x (meters 45) (meters 4) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 1.5) 1.0) @@ -2536,8 +2444,7 @@ ) (defpart 1298 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.375 0.3 1.0) (sp-rnd-flt spt-x (meters 38) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 1.5) 1.0) @@ -2566,8 +2473,7 @@ ) (defpart 1301 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.15 0.225 1.0) (sp-rnd-flt spt-x (meters 45) (meters 4) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 1.5) 1.0) @@ -2594,8 +2500,7 @@ ) (defpart 1302 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.15 0.45 1.0) (sp-flt spt-x (meters -30)) (sp-rnd-flt spt-y (meters 3.5) (meters 2) 1.0) @@ -2623,8 +2528,7 @@ ) (defpart 1303 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.15 0.4 1.0) (sp-flt spt-x (meters -24)) (sp-rnd-flt spt-y (meters 3.5) (meters 2) 1.0) @@ -2652,8 +2556,7 @@ ) (defpart 1304 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.15 0.4 1.0) (sp-flt spt-x (meters -26)) (sp-rnd-flt spt-y (meters 3.5) (meters 2) 1.0) @@ -2681,8 +2584,7 @@ ) (defpart 1305 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.0375 0.0375 1.0) (sp-rnd-flt spt-x (meters -9) (meters 4) 1.0) (sp-flt spt-y (meters -2)) @@ -2710,8 +2612,7 @@ ) (defpart 1307 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.075 0.015 1.0) (sp-rnd-flt spt-x (meters -45) (meters 12) 1.0) (sp-flt spt-y (meters -2)) @@ -2739,8 +2640,7 @@ ) (defpart 1309 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.075 0.015 1.0) (sp-rnd-flt spt-x (meters -49) (meters 6) 1.0) (sp-flt spt-y (meters -2)) @@ -2768,8 +2668,7 @@ ) (defpart 1306 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.00625) (sp-rnd-flt spt-x (meters -9) (meters 4) 1.0) (sp-flt spt-y (meters -6)) @@ -2792,8 +2691,7 @@ ) (defpart 1308 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.0375) (sp-rnd-flt spt-x (meters -44) (meters 10) 1.0) (sp-flt spt-y (meters -6)) @@ -2816,8 +2714,7 @@ ) (defpart 1310 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.00625) (sp-rnd-flt spt-x (meters -45) (meters 4) 1.0) (sp-flt spt-y (meters -6)) @@ -2842,8 +2739,7 @@ (defpartgroup group-village2-sagehut-warpgate :id 283 :bounds (static-bspherem 7 4 -4.5 12) - :parts - ((sp-item 1313 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1313 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1314 :fade-after (meters 60) :falloff-to (meters 100) :binding 1311) (sp-item 1311 :flags (bit1 start-dead launch-asap)) (sp-item 1311 :flags (bit1 start-dead launch-asap)) @@ -3022,8 +2918,7 @@ ) (defpart 1315 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters -2)) (sp-flt spt-scale-x (meters 0.25)) @@ -3038,8 +2933,7 @@ ) (defpart 1312 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 1.0 0.2 1.0) (sp-flt spt-x (meters 4.4444447)) (sp-flt spt-y (meters 4)) @@ -3062,8 +2956,7 @@ ) (defpart 1313 - :init-specs - ((sp-rnd-flt spt-num 3.0 3.0 1.0) + :init-specs ((sp-rnd-flt spt-num 3.0 3.0 1.0) (sp-flt spt-x (meters -0.5)) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) @@ -3080,8 +2973,7 @@ ) (defpart 1314 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-flt spt-scale-x (meters 0.25)) (sp-copy-from-other spt-scale-y -4) @@ -3094,8 +2986,7 @@ ) (defpart 1311 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.4 1.0) (sp-flt spt-x (meters 4.4444447)) (sp-flt spt-y (meters 4)) @@ -3121,8 +3012,7 @@ (defpartgroup group-village2-tree-fire :id 284 :bounds (static-bspherem 0 10 0 12) - :parts - ((sp-item 1316 :fade-after (meters 120) :falloff-to (meters 120)) + :parts ((sp-item 1316 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1317 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1318 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1319 :fade-after (meters 120) :falloff-to (meters 120)) @@ -3130,8 +3020,7 @@ ) (defpart 1316 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-x (meters 2.2) (meters 0.5) 1.0) (sp-flt spt-y (meters -0.9)) @@ -3161,13 +3050,11 @@ ) (defpart 1320 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) (defpart 1317 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-x (meters -0.6) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.2) (meters 0.5) 1.0) @@ -3196,8 +3083,7 @@ ) (defpart 1318 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.2 1.0) (sp-rnd-flt spt-x (meters -0.6) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.2) (meters 0.5) 1.0) @@ -3228,8 +3114,7 @@ ) (defpart 1319 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.2 1.0) (sp-rnd-flt spt-x (meters -0.6) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.2) (meters 0.5) 1.0) diff --git a/goal_src/levels/village2/warrior.gc b/goal_src/levels/village2/warrior.gc index 8f4520f2db..eaf7da09b0 100644 --- a/goal_src/levels/village2/warrior.gc +++ b/goal_src/levels/village2/warrior.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/warrior-ag.gc") + (deftype warrior (process-taskable) () :heap-base #x110 @@ -16,14 +18,11 @@ ) -(defskelgroup *warrior-sg* warrior - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *warrior-sg* warrior warrior-lod0-jg warrior-idle-ja + ((warrior-lod0-mg (meters 20)) (warrior-lod1-mg (meters 40)) (warrior-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow warrior-shadow-mg + ) (defmethod dummy-52 warrior ((obj warrior)) (let ((v1-1 (-> obj draw shadow-ctrl))) @@ -44,16 +43,19 @@ (defmethod draw-npc-shadow warrior ((obj warrior)) (-> obj draw shadow-ctrl) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -73,8 +75,7 @@ :name "warrior-introduction" :index 6 :parts 29 - :command-list - '((125 joint "cameraB") + :command-list '((125 joint "cameraB") (260 joint "camera") (574 joint "cameraB") (918 joint "camera") @@ -127,8 +128,7 @@ :name "warrior-resolution" :index 8 :parts 6 - :command-list - '((508 blackout 10) (511 blackout 0)) + :command-list '((508 blackout 10) (511 blackout 0)) ) ) (else @@ -152,8 +152,7 @@ (defstate play-anim (warrior) :virtual #t - :exit - (behavior () + :exit (behavior () (send-event (-> (entity-by-type allpontoons) extra process) 'end-mode) ((-> (method-of-type process-taskable play-anim) exit)) (none) @@ -162,10 +161,7 @@ (defmethod TODO-RENAME-43 warrior ((obj warrior)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 2) 61440.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.66 f0-2) (play-ambient (-> obj ambient) "WAR-LO1A" #f (-> obj root-override trans)) diff --git a/goal_src/levels/village3/assistant-village3.gc b/goal_src/levels/village3/assistant-village3.gc index ca9196027a..632c4d7a12 100644 --- a/goal_src/levels/village3/assistant-village3.gc +++ b/goal_src/levels/village3/assistant-village3.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/assistant-village3-ag.gc") + (deftype assistant-villagec (process-taskable) () :heap-base #x110 @@ -16,14 +18,11 @@ ) -(defskelgroup *assistant-village3-sg* assistant-village3 - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *assistant-village3-sg* assistant-village3 assistant-village3-lod0-jg assistant-village3-idle-ja + ((assistant-village3-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow assistant-village3-shadow-mg + ) (defmethod dummy-52 assistant-villagec ((obj assistant-villagec)) (let ((v1-1 (-> obj draw shadow-ctrl))) @@ -44,16 +43,19 @@ (defmethod draw-npc-shadow assistant-villagec ((obj assistant-villagec)) (-> obj draw shadow-ctrl) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -95,10 +97,7 @@ (defmethod TODO-RENAME-43 assistant-villagec ((obj assistant-villagec)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) (play-ambient (-> obj ambient) "ASSTLP31" #f (-> obj root-override trans)) @@ -140,80 +139,40 @@ (defstate idle (assistant-villagec) :virtual #t - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) ) - (while #t + (loop (TODO-RENAME-43 self) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! assistant-village3-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-0 (-> *display* base-frame-counter))) - (while (let* ((s5-0 (-> *display* base-frame-counter)) - (f30-0 300.0) - (f28-0 0.16) - (f26-0 0.17000002) - (v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-32 (the-as number (logior #x3f800000 v1-31))) - ) - (< (- s5-0 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-32)))))))) gp-0) + (while (let ((s5-0 (-> *display* base-frame-counter)) + (f30-0 300.0) + (f28-0 0.16) + (f26-0 0.17000002) + ) + (< (- s5-0 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (rand-float-gen))))))) gp-0) ) (suspend) ) ) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> gp-1 param 0) (ja-aframe 0.0 0)) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) (ja-aframe 16.0 0)) - (joint-control-channel-group! - gp-1 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 0.0 0)) :frame-num (ja-aframe 16.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe 0.0 0)) - (set! (-> gp-2 param 1) 1.0) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 0.0 0))) ) (let ((gp-3 (-> *display* base-frame-counter))) - (while (let* ((s5-1 (-> *display* base-frame-counter)) - (f30-1 300.0) - (f28-1 0.16) - (f26-1 0.17000002) - (v1-56 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-57 (the-as number (logior #x3f800000 v1-56))) - ) - (< (- s5-1 (the-as time-frame (the int (* f30-1 (+ f28-1 (* f26-1 (+ -1.0 (the-as float v1-57)))))))) gp-3) + (while (let ((s5-1 (-> *display* base-frame-counter)) + (f30-1 300.0) + (f28-1 0.16) + (f26-1 0.17000002) + ) + (< (- s5-1 (the-as time-frame (the int (* f30-1 (+ f28-1 (* f26-1 (rand-float-gen))))))) gp-3) ) (suspend) ) diff --git a/goal_src/levels/village3/minecart.gc b/goal_src/levels/village3/minecart.gc index 858de9181a..c31bd2781f 100644 --- a/goal_src/levels/village3/minecart.gc +++ b/goal_src/levels/village3/minecart.gc @@ -7,13 +7,15 @@ ;; DECOMP BEGINS -(defskelgroup *minecartsteel-sg* minecartsteel - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(import "goal_src/import/minecartsteel-ag.gc") + +(defskelgroup *minecartsteel-sg* minecartsteel minecartsteel-lod0-jg minecartsteel-idle-ja + ((minecartsteel-lod0-mg (meters 20)) + (minecartsteel-lod1-mg (meters 40)) + (minecartsteel-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 4) + ) (deftype minecartsteel (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -33,14 +35,13 @@ (defstate idle (minecartsteel) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) (when (= (-> arg0 type) target) (let ((a2-1 (new 'stack 'collide-overlap-result))) (if (not (on-platform (-> self root-override) (-> *target* control) a2-1)) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) ) ) ) @@ -49,31 +50,14 @@ ) ) ) - :trans - (the-as (function none :behavior minecartsteel) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior minecartsteel) rider-trans) + :code (behavior () (ja-channel-set! 1) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self anim))) - ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 num-func) num-func-identity) - (set! (-> gp-0 frame-num) - (* (get-current-phase (-> self sync)) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - ) + (ja :group! (-> self anim)) + (loop + (ja :num-func num-func-identity + :frame-num (* (get-current-phase (-> self sync)) (the float (+ (-> (ja-group) data 0 length) -1))) + ) (let ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)))) (update-trans! (-> self sound) a1-1) ) @@ -82,8 +66,7 @@ ) (none) ) - :post - (the-as (function none :behavior minecartsteel) rider-post) + :post (the-as (function none :behavior minecartsteel) rider-post) ) (defbehavior minecartsteel-initialize-by-other minecartsteel ((arg0 entity-actor) (arg1 float)) @@ -114,19 +97,8 @@ (set! (-> self draw origin-joint-index) (the-as uint 3)) (logior! (-> self skel status) (janim-status inited)) (load-params! (-> self sync) self (the-as uint 9000) arg1 0.15 0.15) - (set! (-> self sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "v3-cartride") - :volume #x400 - :fo-max 30 - ) - (-> self root-override trans) - ) + (set! (-> self sound) + (new 'process 'ambient-sound (static-sound-spec "v3-cartride" :fo-max 30) (-> self root-override trans)) ) (set! (-> self index) (res-lump-value arg0 'index int)) (let ((v1-33 (-> self index))) @@ -166,14 +138,12 @@ (defmethod init-from-entity! minecartsteel ((obj minecartsteel) (arg0 entity-actor)) (dotimes (s4-0 4) - (let ((s3-0 (get-process *default-dead-pool* minecartsteel #x4000))) - (when s3-0 - (let ((t9-1 (method-of-type minecartsteel activate))) - (t9-1 (the-as minecartsteel s3-0) obj 'minecartsteel (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 minecartsteel-initialize-by-other arg0 (* 0.2 (the float (+ s4-0 1)))) - (-> s3-0 ppointer) - ) + (process-spawn + minecartsteel + :init minecartsteel-initialize-by-other + arg0 + (* 0.2 (the float (+ s4-0 1))) + :to obj ) ) (minecartsteel-initialize-by-other arg0 0.0) diff --git a/goal_src/levels/village3/miners.gc b/goal_src/levels/village3/miners.gc index 7dad001dbb..49718bb9ce 100644 --- a/goal_src/levels/village3/miners.gc +++ b/goal_src/levels/village3/miners.gc @@ -9,23 +9,18 @@ ;; DECOMP BEGINS +(import "goal_src/import/minershort-ag.gc") +(import "goal_src/import/cavegem-ag.gc") +(import "goal_src/import/minertall-ag.gc") + (defbehavior miners-anim-loop minershort () - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) - ) + (when (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (get-art-elem self)) ) - (while #t + (loop (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) 2.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! 2.0)) (if (= (-> self next-state name) 'idle) (TODO-RENAME-43 self) ) @@ -43,14 +38,11 @@ ) -(defskelgroup *minertall-sg* minertall - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *minertall-sg* minertall minertall-lod0-jg minertall-idle-ja + ((minertall-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow minertall-shadow-mg + ) (defmethod dummy-52 minertall ((obj minertall)) (let ((v1-1 (-> obj draw shadow-ctrl))) @@ -65,7 +57,7 @@ ) ) 0 - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) ) ) (none) @@ -74,16 +66,19 @@ (defmethod draw-npc-shadow minertall ((obj minertall)) (-> obj draw shadow-ctrl) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -111,14 +106,12 @@ (defstate idle (minertall) :virtual #t - :trans - (behavior () + :trans (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) (none) ) - :code - (the-as (function none :behavior minertall) miners-anim-loop) + :code (the-as (function none :behavior minertall) miners-anim-loop) ) (defmethod init-from-entity! minertall ((obj minertall) (arg0 entity-actor)) @@ -139,28 +132,23 @@ ) -(defskelgroup *minershort-sg* minershort - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *minershort-sg* minershort minershort-lod0-jg minershort-idle-ja + ((minershort-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow minershort-shadow-mg + ) (defpartgroup group-minershort-candle :id 566 :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 2364 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 2364 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 2365 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 2366 :fade-after (meters 60) :falloff-to (meters 60)) ) ) (defpart 2366 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.075) (meters 0.075) 1.0) @@ -188,8 +176,7 @@ ) (defpart 2364 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-y (meters -0.08) (meters 0.02) 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) @@ -210,8 +197,7 @@ ) (defpart 2365 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -0.02)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.75) 1.0) @@ -246,7 +232,7 @@ ) ) 0 - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) ) ) (none) @@ -255,16 +241,19 @@ (defmethod draw-npc-shadow minershort ((obj minershort)) (-> obj draw shadow-ctrl) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -278,220 +267,200 @@ ) (defmethod play-anim! minershort ((obj minershort) (arg0 symbol)) - (with-pp - (set! (-> obj talk-message) (game-text-id press-to-talk)) - (case (current-status (-> obj tasks)) - (((task-status need-hint) (task-status need-introduction)) - (if (not arg0) - (set! (-> obj will-talk) #t) - ) - (case (current-task (-> obj tasks)) - (((game-task village3-miner-money1)) - (when arg0 - (let* ((s5-1 (-> obj tasks)) - (s4-0 (method-of-object s5-1 save-reminder)) - (a1-3 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (s4-0 s5-1 (the int (the-as float (send-event-function *target* a1-3))) 1) - ) - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - (close-specific-task! (game-task village3-miner-money1) (task-status need-introduction)) - (close-specific-task! (game-task village3-miner-money2) (task-status need-introduction)) - (close-specific-task! (game-task village3-miner-money3) (task-status need-introduction)) - (close-specific-task! (game-task village3-miner-money4) (task-status need-introduction)) + (set! (-> obj talk-message) (game-text-id press-to-talk)) + (case (current-status (-> obj tasks)) + (((task-status need-hint) (task-status need-introduction)) + (if (not arg0) + (set! (-> obj will-talk) #t) + ) + (case (current-task (-> obj tasks)) + (((game-task village3-miner-money1)) + (when arg0 + (let* ((s5-1 (-> obj tasks)) + (s4-0 (method-of-object s5-1 save-reminder)) + ) + (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (new 'static 'spool-anim - :name "minershort-introduction-orbs" - :index 4 - :parts 16 - :command-list - '((171 joint "cameraB") - (206 joint "camera") - (423 joint "cameraB") - (591 joint "camera") - (692 joint "cameraB") - (918 joint "camera") - (1122 joint "cameraB") - (1122 shadow self #f) - (1241 joint "camera") - (1241 shadow self #t) - ) + (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (close-specific-task! (game-task village3-miner-money1) (task-status need-introduction)) + (close-specific-task! (game-task village3-miner-money2) (task-status need-introduction)) + (close-specific-task! (game-task village3-miner-money3) (task-status need-introduction)) + (close-specific-task! (game-task village3-miner-money4) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "minershort-introduction-orbs" + :index 4 + :parts 16 + :command-list '((171 joint "cameraB") + (206 joint "camera") + (423 joint "cameraB") + (591 joint "camera") + (692 joint "cameraB") + (918 joint "camera") + (1122 joint "cameraB") + (1122 shadow self #f) + (1241 joint "camera") + (1241 shadow self #t) ) ) - (((game-task cave-gnawers)) - (when arg0 - (let* ((s5-2 (-> obj tasks)) - (s4-1 (method-of-object s5-2 save-reminder)) - (a1-10 (new 'stack-no-clear 'event-message-block)) + ) + (((game-task cave-gnawers)) + (when arg0 + (let* ((s5-2 (-> obj tasks)) + (s4-1 (method-of-object s5-2 save-reminder)) + ) + (s4-1 s5-2 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) + ) + (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "minershort-introduction-gnawers" + :index 9 + :parts 8 + :command-list '((0 want-levels village3 maincave) + (149 joint "cameraB") + (158 display-level maincave movie) + (158 want-force-vis maincave #t) + (435 display-level maincave #f) + (435 joint "camera") + (680 joint "cameraB") + (719 joint "camera") + ) + ) + ) + (else + (when arg0 + (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "minershort-introduction-switch" + :index 11 + :parts 7 + :command-list '((2 shadow "minertall-1" #f) (835 shadow "minertall-1" #t)) + ) + ) + ) + ) + (((task-status need-reminder)) + (set! (-> obj skippable) #t) + (let ((s4-2 (+ (get-reminder (-> obj tasks) 0) 1))) + (if (< (the-as uint 3) (the-as uint s4-2)) + (set! s4-2 0) + ) + (countdown (s3-0 4) + (let ((v1-59 s4-2)) + (cond + ((zero? v1-59) + (if (not (or (= (get-task-status (game-task village3-miner-money1)) (task-status need-reminder)) + (= (get-task-status (game-task village3-miner-money2)) (task-status need-reminder)) + (= (get-task-status (game-task village3-miner-money3)) (task-status need-reminder)) + (= (get-task-status (game-task village3-miner-money4)) (task-status need-reminder)) + ) + ) + (set! s4-2 1) + ) + ) + ((= v1-59 1) + (if (!= (get-task-status (game-task cave-gnawers)) (task-status need-reminder)) + (set! s4-2 2) + ) + ) + ((= v1-59 2) + (if (not (or (= (get-task-status (game-task village3-miner-money1)) (task-status need-reminder)) + (= (get-task-status (game-task village3-miner-money2)) (task-status need-reminder)) + (= (get-task-status (game-task village3-miner-money3)) (task-status need-reminder)) + (= (get-task-status (game-task village3-miner-money4)) (task-status need-reminder)) + ) + ) + (set! s4-2 3) + ) + ) + (else + (if (!= (get-task-status (game-task snow-eggtop)) (task-status need-reminder)) + (set! s4-2 0) ) - (set! (-> a1-10 from) pp) - (set! (-> a1-10 num-params) 2) - (set! (-> a1-10 message) 'query) - (set! (-> a1-10 param 0) (the-as uint 'pickup)) - (set! (-> a1-10 param 1) (the-as uint 6)) - (s4-1 s5-2 (the int (the-as float (send-event-function *target* a1-10))) 1) + ) + ) + ) + ) + (if arg0 + (save-reminder (-> obj tasks) s4-2 0) + ) + (cond + ((zero? s4-2) + (new 'static 'spool-anim :name "minershort-reminder-1-orbs" :index 5 :parts 3 :command-list '()) + ) + ((= s4-2 1) + (if arg0 + (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) ) - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - (close-status! (-> obj tasks) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name "minershort-introduction-gnawers" - :index 9 - :parts 8 - :command-list - '((0 want-levels village3 maincave) - (149 joint "cameraB") - (158 display-level maincave movie) - (158 want-force-vis maincave #t) - (435 display-level maincave #f) - (435 joint "camera") - (680 joint "cameraB") - (719 joint "camera") + (new 'static 'spool-anim :name "minershort-reminder-1-gnawers" :index 10 :parts 3 :command-list '()) + ) + ((= s4-2 2) + (if arg0 + (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) ) - ) + (new 'static 'spool-anim :name "minershort-reminder-2-orbs" :index 6 :parts 2 :command-list '()) ) (else - (when arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - (close-status! (-> obj tasks) (task-status need-introduction)) - ) + (if arg0 + (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + ) (new 'static 'spool-anim - :name "minershort-introduction-switch" - :index 11 - :parts 7 - :command-list - '((2 shadow "minertall-1" #f) (835 shadow "minertall-1" #t)) + :name "minershort-reminder-1-switch" + :index 12 + :parts 5 + :command-list '((2 shadow "minertall-1" #f) (500 shadow "minertall-1" #t)) ) ) ) ) - (((task-status need-reminder)) - (set! (-> obj skippable) #t) - (let ((s4-2 (+ (get-reminder (-> obj tasks) 0) 1))) - (if (< (the-as uint 3) (the-as uint s4-2)) - (set! s4-2 0) - ) - (countdown (s3-0 4) - (let ((v1-59 s4-2)) - (cond - ((zero? v1-59) - (if (not (or (= (get-task-status (game-task village3-miner-money1)) (task-status need-reminder)) - (= (get-task-status (game-task village3-miner-money2)) (task-status need-reminder)) - (= (get-task-status (game-task village3-miner-money3)) (task-status need-reminder)) - (= (get-task-status (game-task village3-miner-money4)) (task-status need-reminder)) - ) - ) - (set! s4-2 1) - ) - ) - ((= v1-59 1) - (if (!= (get-task-status (game-task cave-gnawers)) (task-status need-reminder)) - (set! s4-2 2) - ) - ) - ((= v1-59 2) - (if (not (or (= (get-task-status (game-task village3-miner-money1)) (task-status need-reminder)) - (= (get-task-status (game-task village3-miner-money2)) (task-status need-reminder)) - (= (get-task-status (game-task village3-miner-money3)) (task-status need-reminder)) - (= (get-task-status (game-task village3-miner-money4)) (task-status need-reminder)) - ) - ) - (set! s4-2 3) - ) - ) - (else - (if (!= (get-task-status (game-task snow-eggtop)) (task-status need-reminder)) - (set! s4-2 0) - ) - ) - ) - ) + ) + (((task-status need-reward-speech)) + (let ((s4-3 (get-reminder (-> obj tasks) 2))) + (cond + (arg0 + (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (set! (-> obj cell-for-task) (current-task (-> obj tasks))) + (close-current! (-> obj tasks)) + (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) + (save-reminder (-> obj tasks) (+ s4-3 1) 2) ) - (if arg0 - (save-reminder (-> obj tasks) s4-2 0) - ) - (cond - ((zero? s4-2) - (new 'static 'spool-anim :name "minershort-reminder-1-orbs" :index 5 :parts 3 :command-list '()) - ) - ((= s4-2 1) - (if arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - ) - (new 'static 'spool-anim :name "minershort-reminder-1-gnawers" :index 10 :parts 3 :command-list '()) - ) - ((= s4-2 2) - (if arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - ) - (new 'static 'spool-anim :name "minershort-reminder-2-orbs" :index 6 :parts 2 :command-list '()) - ) - (else - (if arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - ) - (new 'static 'spool-anim - :name "minershort-reminder-1-switch" - :index 12 - :parts 5 - :command-list - '((2 shadow "minertall-1" #f) (500 shadow "minertall-1" #t)) - ) - ) + (else + (set! (-> obj will-talk) #t) + (set! (-> obj talk-message) (game-text-id press-to-trade-money)) ) ) - ) - (((task-status need-reward-speech)) - (let ((s4-3 (get-reminder (-> obj tasks) 2))) - (cond - (arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) - (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) - (save-reminder (-> obj tasks) (+ s4-3 1) 2) - ) - (else - (set! (-> obj will-talk) #t) - (set! (-> obj talk-message) (game-text-id press-to-trade-money)) + (if (< (the-as uint s4-3) (the-as uint 3)) + (new 'static 'spool-anim :name "minershort-resolution-1-orbs" :index 7 :parts 2 :command-list '()) + (new 'static 'spool-anim + :name "minershort-resolution-2-orbs" + :index 8 + :parts 6 + :command-list '((154 joint "cameraB") (461 joint "camera")) ) ) - (if (< (the-as uint s4-3) (the-as uint 3)) - (new 'static 'spool-anim :name "minershort-resolution-1-orbs" :index 7 :parts 2 :command-list '()) - (new 'static 'spool-anim - :name "minershort-resolution-2-orbs" - :index 8 - :parts 6 - :command-list - '((154 joint "cameraB") (461 joint "camera")) - ) - ) - ) ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) ) - (-> obj draw art-group data 3) - ) + ) + (-> obj draw art-group data 3) ) ) ) (defstate play-anim (minershort) :virtual #t - :exit - (behavior () + :exit (behavior () (send-event (-> self other-miner ppointer 3) 'end-mode) ((-> (method-of-type process-taskable play-anim) exit)) (none) @@ -504,10 +473,7 @@ (defmethod TODO-RENAME-43 minershort ((obj minershort)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.9655172 f0-2) (play-ambient (-> obj ambient) "MIN-LO01" #f (-> obj root-override trans)) @@ -603,8 +569,7 @@ (defstate idle (minershort) :virtual #t - :code - miners-anim-loop + :code miners-anim-loop ) (defmethod init-from-entity! minershort ((obj minershort) (arg0 entity-actor)) @@ -631,58 +596,24 @@ ) -(defskelgroup *cavegem-sg* cavegem - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *cavegem-sg* cavegem cavegem-lod0-jg cavegem-idle-ja + ((cavegem-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 9) + ) (defstate idle (cavegem) :virtual #t - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior cavegem) ja-post) + :post (the-as (function none :behavior cavegem) ja-post) ) (defmethod init-from-entity! cavegem ((obj cavegem) (arg0 entity-actor)) diff --git a/goal_src/levels/village3/sage-village3.gc b/goal_src/levels/village3/sage-village3.gc index 8569c03c42..6f0b290c2d 100644 --- a/goal_src/levels/village3/sage-village3.gc +++ b/goal_src/levels/village3/sage-village3.gc @@ -7,6 +7,10 @@ ;; DECOMP BEGINS +(import "goal_src/import/evilsis-village3-ag.gc") +(import "goal_src/import/sage-village3-ag.gc") +(import "goal_src/import/evilbro-village3-ag.gc") + (deftype sage-villagec (process-taskable) ((evilbro handle :offset-assert 384) (evilsis handle :offset-assert 392) @@ -19,198 +23,162 @@ ) -(defskelgroup *sage-village3-sg* sage-village3 - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *sage-village3-sg* sage-village3 sage-village3-lod0-jg sage-village3-idle-ja + ((sage-village3-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow sage-village3-shadow-mg + ) -(defskelgroup *evilbro-village3-sg* evilbro-village3 - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *evilbro-village3-sg* evilbro-village3 evilbro-village3-lod0-jg evilbro-village3-idle-ja + ((evilbro-village3-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow evilbro-village3-shadow-mg + ) -(defskelgroup *evilsis-village3-sg* evilsis-village3 - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *evilsis-village3-sg* evilsis-village3 evilsis-village3-lod0-jg evilsis-village3-idle-ja + ((evilsis-village3-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow evilsis-village3-shadow-mg + ) (defmethod play-anim! sage-villagec ((obj sage-villagec) (arg0 symbol)) - (with-pp - (set! (-> obj talk-message) (game-text-id press-to-talk-to-sage)) - (case (current-status (-> obj tasks)) - (((task-status unknown) (task-status need-hint) (task-status need-introduction)) - (if (not arg0) - (set! (-> obj will-talk) #t) - ) - (case (current-task (-> obj tasks)) - (((game-task village3-button)) - (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (send-event (-> obj assistant extra process) 'clone (process->handle obj)) - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj evilbro) - (ppointer->handle - (when s5-1 - (let ((t9-5 (method-of-type manipy activate))) - (t9-5 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *evilbro-village3-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj evilbro)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj evilbro)) 'blend-shape #t) - (send-event (handle->process (-> obj evilbro)) 'center-joint 3) - (let ((s5-2 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj evilsis) - (ppointer->handle - (when s5-2 - (let ((t9-11 (method-of-type manipy activate))) - (t9-11 (the-as manipy s5-2) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 manipy-init (-> obj root-override trans) (-> obj entity) *evilsis-village3-sg* #f) - (-> s5-2 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj evilsis)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj evilsis)) 'blend-shape #t) - (send-event (handle->process (-> obj evilsis)) 'center-joint 3) - (set! (-> obj draw bounds w) 40960.0) - ) - (new 'static 'spool-anim - :name "sage-village3-introduction" - :index 8 - :parts 58 - :command-list - '((206 joint "cameraB") - (268 joint "camera") - (321 joint "cameraB") - (415 joint "camera") - (502 joint "cameraB") - (655 joint "camera") - (864 joint "cameraB") - (958 joint "camera") - (1178 joint "cameraB") - (1295 joint "camera") - (1377 joint "cameraB") - (1683 joint "camera") - (2066 joint "cameraB") - (2209 joint "camera") - (2389 joint "cameraB") - (2707 joint "camera") - (2769 joint "cameraB") - (2901 joint "camera") - (3021 joint "cameraB") - (3158 joint "camera") - (3301 joint "cameraB") - (3533 joint "camera") - (3632 joint "cameraB") - (3692 joint "camera") - (3780 joint "cameraB") - (3818 joint "camera") - (4188 joint "cameraB") - (4324 joint "camera") - (4462 joint "cameraB") - (4542 joint "camera") - ) - ) - ) - (((game-task cave-dark-crystals)) - (when arg0 - (let* ((s5-3 (-> obj tasks)) - (s4-0 (method-of-object s5-3 save-reminder)) - (a1-18 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-18 from) pp) - (set! (-> a1-18 num-params) 2) - (set! (-> a1-18 message) 'query) - (set! (-> a1-18 param 0) (the-as uint 'pickup)) - (set! (-> a1-18 param 1) (the-as uint 6)) - (s4-0 s5-3 (the int (the-as float (send-event-function *target* a1-18))) 1) - ) - (close-status! (-> obj tasks) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name "sage-village3-introduction-dark-eco" - :index 4 - :parts 9 - :command-list - '((111 joint "cameraB") (189 joint "camera") (455 joint "cameraB") (638 joint "camera") (753 joint "cameraB")) - ) - ) - (else - (if arg0 - (close-specific-task! (game-task snow-ram) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name "sage-village3-introduction-rams" - :index 6 - :parts 6 - :command-list - '((155 joint "cameraB") (370 joint "camera")) - ) - ) + (set! (-> obj talk-message) (game-text-id press-to-talk-to-sage)) + (case (current-status (-> obj tasks)) + (((task-status unknown) (task-status need-hint) (task-status need-introduction)) + (if (not arg0) + (set! (-> obj will-talk) #t) ) - ) - (((task-status need-reminder-a) (task-status need-reminder)) - (set! (-> obj skippable) #t) - (let ((s4-1 (+ (get-reminder (-> obj tasks) 0) 1))) - (if (< (the-as uint 1) (the-as uint s4-1)) - (set! s4-1 0) - ) - (countdown (s3-0 2) - (cond - ((zero? s4-1) - (if (!= (get-task-status (game-task cave-dark-crystals)) (task-status need-reminder)) - (set! s4-1 1) + (case (current-task (-> obj tasks)) + (((game-task village3-button)) + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (send-event (-> obj assistant extra process) 'clone (process->handle obj)) + (set! (-> obj evilbro) + (ppointer->handle + (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilbro-village3-sg* #f :to obj) ) - ) - (else - (if (not (or (= (get-task-status (game-task snow-ram)) (task-status need-reminder)) - (= (get-task-status (game-task snow-ram)) (task-status need-reminder-a)) - ) - ) - (set! s4-1 0) - ) - ) - ) - ) + ) + (send-event (handle->process (-> obj evilbro)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj evilbro)) 'blend-shape #t) + (send-event (handle->process (-> obj evilbro)) 'center-joint 3) + (set! (-> obj evilsis) + (ppointer->handle + (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilsis-village3-sg* #f :to obj) + ) + ) + (send-event (handle->process (-> obj evilsis)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj evilsis)) 'blend-shape #t) + (send-event (handle->process (-> obj evilsis)) 'center-joint 3) + (set! (-> obj draw bounds w) 40960.0) + ) + (new 'static 'spool-anim + :name "sage-village3-introduction" + :index 8 + :parts 58 + :command-list '((206 joint "cameraB") + (268 joint "camera") + (321 joint "cameraB") + (415 joint "camera") + (502 joint "cameraB") + (655 joint "camera") + (864 joint "cameraB") + (958 joint "camera") + (1178 joint "cameraB") + (1295 joint "camera") + (1377 joint "cameraB") + (1683 joint "camera") + (2066 joint "cameraB") + (2209 joint "camera") + (2389 joint "cameraB") + (2707 joint "camera") + (2769 joint "cameraB") + (2901 joint "camera") + (3021 joint "cameraB") + (3158 joint "camera") + (3301 joint "cameraB") + (3533 joint "camera") + (3632 joint "cameraB") + (3692 joint "camera") + (3780 joint "cameraB") + (3818 joint "camera") + (4188 joint "cameraB") + (4324 joint "camera") + (4462 joint "cameraB") + (4542 joint "camera") + ) + ) + ) + (((game-task cave-dark-crystals)) + (when arg0 + (let* ((s5-3 (-> obj tasks)) + (s4-0 (method-of-object s5-3 save-reminder)) + ) + (s4-0 s5-3 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) + ) + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "sage-village3-introduction-dark-eco" + :index 4 + :parts 9 + :command-list '((111 joint "cameraB") (189 joint "camera") (455 joint "cameraB") (638 joint "camera") (753 joint "cameraB")) + ) + ) + (else (if arg0 - (save-reminder (-> obj tasks) s4-1 0) - ) - (if (zero? s4-1) - (new 'static 'spool-anim :name "sage-village3-reminder-1-dark-eco" :index 5 :parts 2 :command-list '()) - (new 'static 'spool-anim :name "sage-village3-reminder-1-rams" :index 7 :parts 3 :command-list '()) + (close-specific-task! (game-task snow-ram) (task-status need-introduction)) ) + (new 'static 'spool-anim + :name "sage-village3-introduction-rams" + :index 6 + :parts 6 + :command-list '((155 joint "cameraB") (370 joint "camera")) + ) ) ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) + ) + (((task-status need-reminder-a) (task-status need-reminder)) + (set! (-> obj skippable) #t) + (let ((s4-1 (+ (get-reminder (-> obj tasks) 0) 1))) + (if (< (the-as uint 1) (the-as uint s4-1)) + (set! s4-1 0) + ) + (countdown (s3-0 2) + (cond + ((zero? s4-1) + (if (!= (get-task-status (game-task cave-dark-crystals)) (task-status need-reminder)) + (set! s4-1 1) + ) ) - (get-art-elem obj) - ) + (else + (if (not (or (= (get-task-status (game-task snow-ram)) (task-status need-reminder)) + (= (get-task-status (game-task snow-ram)) (task-status need-reminder-a)) + ) + ) + (set! s4-1 0) + ) + ) + ) + ) + (if arg0 + (save-reminder (-> obj tasks) s4-1 0) + ) + (if (zero? s4-1) + (new 'static 'spool-anim :name "sage-village3-reminder-1-dark-eco" :index 5 :parts 2 :command-list '()) + (new 'static 'spool-anim :name "sage-village3-reminder-1-rams" :index 7 :parts 3 :command-list '()) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) + ) + ) + (get-art-elem obj) ) ) ) @@ -225,10 +193,7 @@ (defmethod TODO-RENAME-43 sage-villagec ((obj sage-villagec)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.875 f0-2) (play-ambient (-> obj ambient) "SAGELP31" #f (-> obj root-override trans)) @@ -267,8 +232,7 @@ (defstate idle (sage-villagec) :virtual #t - :trans - (behavior () + :trans (behavior () (case (get-task-status (game-task village3-button)) (((task-status need-introduction)) (send-event self 'play-anim) @@ -281,8 +245,7 @@ (defstate play-anim (sage-villagec) :virtual #t - :exit - (behavior () + :exit (behavior () (set! (-> self draw bounds w) 10240.0) (send-event (-> self assistant extra process) 'end-mode) (let ((a0-2 (handle->process (-> self evilbro)))) @@ -319,18 +282,21 @@ (defmethod draw-npc-shadow sage-villagec ((obj sage-villagec)) (let ((v1-1 (-> obj draw shadow-ctrl))) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) - (set! (-> v1-1 settings flags) (logand -5 (-> v1-1 settings flags))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf02)) (set! (-> v1-1 settings bot-plane w) 20480.0) (let ((a0-8 v1-1)) - (set! (-> a0-8 settings flags) (logand -33 (-> a0-8 settings flags))) + (logclear! (-> a0-8 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day v1-1) ) (else - (logior! (-> v1-1 settings flags) 32) + (logior! (-> v1-1 settings flags) (shadow-flags disable-draw)) 0 ) ) diff --git a/goal_src/levels/village3/village3-obs.gc b/goal_src/levels/village3/village3-obs.gc index 7ba2b6c9ff..58a289600d 100644 --- a/goal_src/levels/village3/village3-obs.gc +++ b/goal_src/levels/village3/village3-obs.gc @@ -7,37 +7,37 @@ ;; DECOMP BEGINS -(defskelgroup *med-res-ogre-sg* medres-ogre - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -200 0 -450 350) - :longest-edge (meters 0.01) - ) +(import "goal_src/import/medres-ogre-ag.gc") +(import "goal_src/import/medres-finalboss-ag.gc") +(import "goal_src/import/pistons-ag.gc") +(import "goal_src/import/gondola-ag.gc") +(import "goal_src/import/medres-ogre2-ag.gc") +(import "goal_src/import/medres-ogre3-ag.gc") +(import "goal_src/import/gondolacables-ag.gc") -(defskelgroup *med-res-ogre2-sg* medres-ogre2 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -200 0 -950 320) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-ogre-sg* medres-ogre medres-ogre-lod0-jg medres-ogre-idle-ja + ((medres-ogre-lod0-mg (meters 999999))) + :bounds (static-spherem -200 0 -450 350) + :longest-edge (meters 0.01) + ) -(defskelgroup *med-res-ogre3-sg* medres-ogre3 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -100 0 -1370 300) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-ogre2-sg* medres-ogre2 medres-ogre2-lod0-jg medres-ogre2-idle-ja + ((medres-ogre2-lod0-mg (meters 999999))) + :bounds (static-spherem -200 0 -950 320) + :longest-edge (meters 0.01) + ) -(defskelgroup *med-res-finalboss-sg* medres-finalboss - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 80 120 -150 470) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-ogre3-sg* medres-ogre3 medres-ogre3-lod0-jg medres-ogre3-idle-ja + ((medres-ogre3-lod0-mg (meters 999999))) + :bounds (static-spherem -100 0 -1370 300) + :longest-edge (meters 0.01) + ) + +(defskelgroup *med-res-finalboss-sg* medres-finalboss medres-finalboss-lod0-jg medres-finalboss-idle-ja + ((medres-finalboss-lod0-mg (meters 999999))) + :bounds (static-spherem 80 120 -150 470) + :longest-edge (meters 0.01) + ) (deftype villagec-lava (water-anim) () @@ -51,8 +51,7 @@ (define ripple-for-villagec-lava (new 'static 'ripple-wave-set :count 2 :converted #f - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 2 :speed 1.5) (new 'static 'ripple-wave :scale 40.0 :xdiv -2 :zdiv 2 :speed 0.9) (new 'static 'ripple-wave) @@ -70,8 +69,8 @@ (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 waveform) ripple-for-villagec-lava) ) - (set! (-> obj flags) (logand -8388609 (-> obj flags))) - (set! (-> obj flags) (logior #x2000000 (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt23)) + (set! (-> obj flags) (logior (water-flags wt25) (-> obj flags))) (set! (-> obj attack-event) 'lava) (none) ) @@ -93,19 +92,15 @@ ) -(defskelgroup *gondola-sg* gondola - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 -5.5 0 6.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *gondola-sg* gondola gondola-lod0-jg gondola-idle-down-ja + ((gondola-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -5.5 0 6.5) + :shadow gondola-shadow-mg + ) (defstate idle (gondola) :virtual #t - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (ja-channel-set! 1) (cond @@ -114,8 +109,7 @@ :name "gondola-ride-down" :index 6 :parts 3 - :command-list - '((0 want-levels village3 snow) + :command-list '((0 want-levels village3 snow) (0 shadow target #f) (0 shadow sidekick #f) (1 display-level village3 display) @@ -127,17 +121,14 @@ ) ) ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) + (ja :group! (-> self draw art-group data 4)) ) (else (set! (-> self anim) (new 'static 'spool-anim :name "gondola-ride-up" :index 5 :parts 3 - :command-list - '((0 want-levels village3 snow) + :command-list '((0 want-levels village3 snow) (0 shadow target #f) (400 setting-reset music snow) (400 display-level snow display) @@ -147,13 +138,11 @@ ) ) ) - (let ((v1-9 (-> self skel root-channel 0))) - (set! (-> v1-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) ) ) (transform-post) - (while #t + (loop (when (and *target* (and (< (vector-vector-distance (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3)) (target-pos 0) @@ -221,8 +210,8 @@ ) ) (when (and (< (vector-vector-xz-distance s5-1 (-> *target* control trans)) 18432.0) - (and (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) ) (and (< (+ -40960.0 (-> s5-1 y)) (-> *target* control trans y)) @@ -269,56 +258,40 @@ (defstate ride-up (gondola) :virtual #t - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'clone-anim) - (set! (-> a1-1 param 0) (the-as uint self)) - (when (send-event-function *target* a1-1) - (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) - (send-event *target* 'blend-shape #t) - (set-setting! *setting-control* self 'sound-flava #f 30.0 4) - (logclear! (-> self mask) (process-mask enemy)) - (let ((gp-0 (get-process *default-dead-pool* othercam #x4000))) - (when gp-0 - (let ((t9-6 (method-of-type othercam activate))) - (t9-6 (the-as othercam gp-0) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 othercam-init-by-other self 4 #f #t) - (-> gp-0 ppointer) - ) - ) - (ja-play-spooled-anim - (-> self anim) - (the-as art-joint-anim (-> self draw art-group data 3)) - (the-as art-joint-anim (-> self draw art-group data 4)) - (the-as (function process-drawable symbol) false-func) - ) - (clear-pending-settings-from-process *setting-control* self 'sound-flava) - (send-event *target* 'blend-shape #f) - (when *target* - (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) - (send-event *target* 'trans 'restore (-> self old-target-pos)) - (send-event *target* 'end-mode) - (update-transforms! (-> self root-override)) - (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) - (logior! (-> *target* control status) 7) - (suspend) - (send-event *camera* 'teleport-to-other-start-string) - ) - (load-state-want-vis 'sno) - (set-continue! *game-info* "snow-start") + (when (send-event *target* 'clone-anim self) + (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) + (send-event *target* 'blend-shape #t) + (set-setting! 'sound-flava #f 30.0 (music-flava to-snow)) + (logclear! (-> self mask) (process-mask enemy)) + (process-spawn othercam self 4 #f #t :to self) + (ja-play-spooled-anim + (-> self anim) + (the-as art-joint-anim (-> self draw art-group data 3)) + (the-as art-joint-anim (-> self draw art-group data 4)) + (the-as (function process-drawable symbol) false-func) ) + (remove-setting! 'sound-flava) + (send-event *target* 'blend-shape #f) + (when *target* + (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) + (send-event *target* 'trans 'restore (-> self old-target-pos)) + (send-event *target* 'end-mode) + (update-transforms! (-> self root-override)) + (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) + (logior! (-> *target* control status) (cshape-moving-flags onsurf onground tsurf)) + (suspend) + (send-event *camera* 'teleport-to-other-start-string) + ) + (load-state-want-vis 'sno) + (set-continue! *game-info* "snow-start") ) (process-entity-status! self (entity-perm-status bit-3) #f) (go-virtual idle #t) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (update-direction-from-time-of-day (-> self draw shadow-ctrl)) (none) @@ -327,57 +300,41 @@ (defstate ride-down (gondola) :virtual #t - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'clone-anim) - (set! (-> a1-1 param 0) (the-as uint self)) - (when (send-event-function *target* a1-1) - (send-event *target* 'trans 'save (-> self old-target-pos)) - (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) - (send-event *target* 'blend-shape #t) - (set-setting! *setting-control* self 'sound-flava #f 30.0 4) - (logclear! (-> self mask) (process-mask enemy)) - (let ((gp-0 (get-process *default-dead-pool* othercam #x4000))) - (when gp-0 - (let ((t9-7 (method-of-type othercam activate))) - (t9-7 (the-as othercam gp-0) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 othercam-init-by-other self 4 #f #t) - (-> gp-0 ppointer) - ) - ) - (ja-play-spooled-anim - (-> self anim) - (the-as art-joint-anim (-> self draw art-group data 4)) - (the-as art-joint-anim (-> self draw art-group data 3)) - (the-as (function process-drawable symbol) false-func) - ) - (clear-pending-settings-from-process *setting-control* self 'sound-flava) - (send-event *target* 'blend-shape #f) - (when *target* - (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) - (send-event *target* 'trans 'restore (-> self old-target-pos)) - (send-event *target* 'end-mode) - (update-transforms! (-> self root-override)) - (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) - (logior! (-> *target* control status) 7) - (suspend) - (send-event *camera* 'teleport-to-other-start-string) - ) - (load-state-want-vis 'vi3) - (set-continue! *game-info* "village3-farside") + (when (send-event *target* 'clone-anim self) + (send-event *target* 'trans 'save (-> self old-target-pos)) + (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) + (send-event *target* 'blend-shape #t) + (set-setting! 'sound-flava #f 30.0 (music-flava to-snow)) + (logclear! (-> self mask) (process-mask enemy)) + (process-spawn othercam self 4 #f #t :to self) + (ja-play-spooled-anim + (-> self anim) + (the-as art-joint-anim (-> self draw art-group data 4)) + (the-as art-joint-anim (-> self draw art-group data 3)) + (the-as (function process-drawable symbol) false-func) ) + (remove-setting! 'sound-flava) + (send-event *target* 'blend-shape #f) + (when *target* + (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) + (send-event *target* 'trans 'restore (-> self old-target-pos)) + (send-event *target* 'end-mode) + (update-transforms! (-> self root-override)) + (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) + (logior! (-> *target* control status) (cshape-moving-flags onsurf onground tsurf)) + (suspend) + (send-event *camera* 'teleport-to-other-start-string) + ) + (load-state-want-vis 'vi3) + (set-continue! *game-info* "village3-farside") ) (process-entity-status! self (entity-perm-status bit-3) #f) (go-virtual idle #f) (none) ) - :post - (-> (method-of-type gondola ride-up) post) + :post (-> (method-of-type gondola ride-up) post) ) (defmethod init-from-entity! gondola ((obj gondola) (arg0 entity-actor)) @@ -442,31 +399,26 @@ :flag-assert #x16004000b0 (:methods (idle () _type_ :state 20) - (active (basic symbol) _type_ :state 21) + (active (handle symbol) _type_ :state 21) ) ) -(defskelgroup *pistons-sg* pistons - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 6 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *pistons-sg* pistons pistons-lod0-jg pistons-idle-ja + ((pistons-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6 0 8) + ) (defstate idle (pistons) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('update) - (go-virtual active (the-as basic (process->handle arg0)) #f) + (go-virtual active (process->handle arg0) #f) ) ) ) - :code - (behavior () + :code (behavior () (ja-post) (logior! (-> self mask) (process-mask sleep)) (suspend) @@ -477,11 +429,10 @@ (defstate active (pistons) :virtual #t - :code - (behavior ((arg0 basic) (arg1 symbol)) + :code (behavior ((arg0 handle) (arg1 symbol)) (process-entity-status! self (entity-perm-status complete) #t) (if (not arg1) - (sound-play-by-name (static-sound-name "gdl-start-up") (new-sound-id) 1024 0 0 1 #t) + (sound-play "gdl-start-up") ) (let ((f30-0 (if arg1 1.0 @@ -489,19 +440,16 @@ ) ) ) - (while #t + (loop (set! f30-0 (seek f30-0 1.0 (* 0.2 (-> *display* seconds-per-frame)))) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) f30-0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) (ja-post) (update! (-> self sound)) (suspend) ) ) - ;; note : deleted some unused trash "code" here - (none) + ;; decompiler never gets here and fails hard + (go-virtual idle) ) ) @@ -509,22 +457,11 @@ (set! (-> obj root) (new 'process 'trsqv)) (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *pistons-sg* '()) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "gdl-gen-loop") - :volume #x400 - :fo-max 100 - ) - (-> obj root trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "gdl-gen-loop" :fo-max 100) (-> obj root trans)) ) (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (go (method-of-object obj active) #f #t) + (go (method-of-object obj active) (the-as handle #f) #t) (go (method-of-object obj idle)) ) (none) @@ -542,18 +479,14 @@ ) -(defskelgroup *gondolacables-sg* gondolacables - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 120) - :longest-edge (meters 0) - ) +(defskelgroup *gondolacables-sg* gondolacables gondolacables-lod0-jg gondolacables-idle-ja + ((gondolacables-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 120) + ) (defstate idle (gondolacables) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'update) (process-entity-status! self (entity-perm-status complete) #t) @@ -565,48 +498,17 @@ ) ) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior gondolacables) ja-post) + :post (the-as (function none :behavior gondolacables) ja-post) ) (defmethod init-from-entity! gondolacables ((obj gondolacables) (arg0 entity-actor)) diff --git a/goal_src/levels/village3/village3-part.gc b/goal_src/levels/village3/village3-part.gc index 6229b34c47..bad96c140f 100644 --- a/goal_src/levels/village3/village3-part.gc +++ b/goal_src/levels/village3/village3-part.gc @@ -19,15 +19,13 @@ (defpartgroup group-village3-candle :id 476 :bounds (static-bspherem 0 10 0 12) - :parts - ((sp-item 1797 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1797 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1798 :fade-after (meters 60) :falloff-to (meters 60)) ) ) (defpart 1797 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -0.08) (meters 0.02) 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) @@ -48,8 +46,7 @@ ) (defpart 1798 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -0.04)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) @@ -74,8 +71,7 @@ (defpartgroup group-village3-sulphur-05 :id 477 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1799 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1799 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -83,8 +79,7 @@ (defpartgroup group-village3-sulphur-06 :id 478 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1801 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1801 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -92,8 +87,7 @@ (defpartgroup group-village3-sulphur-07 :id 479 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1802 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1802 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -101,8 +95,7 @@ (defpartgroup group-village3-sulphur-08 :id 480 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1803 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1803 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -110,8 +103,7 @@ (defpartgroup group-village3-sulphur-09 :id 481 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1804 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1804 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -119,8 +111,7 @@ (defpartgroup group-village3-sulphur-10 :id 482 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1805 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1805 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -128,8 +119,7 @@ (defpartgroup group-village3-sulphur-11 :id 483 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1806 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1806 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -137,8 +127,7 @@ (defpartgroup group-village3-sulphur-12 :id 484 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1807 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1807 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -146,8 +135,7 @@ (defpartgroup group-village3-sulphur-13 :id 485 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1808 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1808 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -155,8 +143,7 @@ (defpartgroup group-village3-sulphur-14 :id 486 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1809 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1809 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -164,15 +151,13 @@ (defpartgroup group-village3-sulphur-15 :id 487 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1810 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1810 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) (defpart 1810 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -197,8 +182,7 @@ ) (defpart 1808 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -223,8 +207,7 @@ ) (defpart 1809 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -249,8 +232,7 @@ ) (defpart 1807 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -275,8 +257,7 @@ ) (defpart 1812 - :init-specs - ((sp-flt spt-vel-y (meters 0.00033333333)) + :init-specs ((sp-flt spt-vel-y (meters 0.00033333333)) (sp-flt spt-fade-a -0.023703704) (sp-flt spt-accel-y -0.027306668) (sp-int spt-next-time 750) @@ -285,8 +266,7 @@ ) (defpart 1806 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -311,8 +291,7 @@ ) (defpart 1814 - :init-specs - ((sp-flt spt-vel-y (meters 0.00033333333)) + :init-specs ((sp-flt spt-vel-y (meters 0.00033333333)) (sp-flt spt-fade-a -0.023703704) (sp-flt spt-accel-y -0.027306668) (sp-int spt-next-time 225) @@ -321,8 +300,7 @@ ) (defpart 1805 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -347,8 +325,7 @@ ) (defpart 1804 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -373,8 +350,7 @@ ) (defpart 1815 - :init-specs - ((sp-flt spt-vel-y (meters 0.00033333333)) + :init-specs ((sp-flt spt-vel-y (meters 0.00033333333)) (sp-flt spt-fade-a -0.023703704) (sp-flt spt-accel-y -0.027306668) (sp-int spt-next-time 150) @@ -383,8 +359,7 @@ ) (defpart 1803 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -409,8 +384,7 @@ ) (defpart 1816 - :init-specs - ((sp-flt spt-vel-y (meters 0.00033333333)) + :init-specs ((sp-flt spt-vel-y (meters 0.00033333333)) (sp-flt spt-fade-a -0.023703704) (sp-flt spt-accel-y -0.027306668) (sp-int spt-next-time 150) @@ -419,8 +393,7 @@ ) (defpart 1802 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -445,8 +418,7 @@ ) (defpart 1817 - :init-specs - ((sp-flt spt-vel-y (meters 0.00033333333)) + :init-specs ((sp-flt spt-vel-y (meters 0.00033333333)) (sp-flt spt-fade-a -0.023703704) (sp-flt spt-accel-y -0.027306668) (sp-int spt-next-time 750) @@ -455,13 +427,11 @@ ) (defpart 1813 - :init-specs - ((sp-flt spt-fade-a -0.047407407) (sp-flt spt-accel-y 1.3653333)) + :init-specs ((sp-flt spt-fade-a -0.047407407) (sp-flt spt-accel-y 1.3653333)) ) (defpart 1801 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -486,8 +456,7 @@ ) (defpart 1799 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -512,13 +481,11 @@ ) (defpart 1811 - :init-specs - ((sp-flt spt-vel-y (meters 0.00033333333)) (sp-flt spt-fade-a -0.017777778) (sp-flt spt-accel-y -0.027306668)) + :init-specs ((sp-flt spt-vel-y (meters 0.00033333333)) (sp-flt spt-fade-a -0.017777778) (sp-flt spt-accel-y -0.027306668)) ) (defpart 1800 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) @@ -544,8 +511,7 @@ (defpartgroup group-village3-minor-fire :id 488 :bounds (static-bspherem 0 2.5 0 2.5) - :parts - ((sp-item 2358 :fade-after (meters 50) :falloff-to (meters 80)) + :parts ((sp-item 2358 :fade-after (meters 50) :falloff-to (meters 80)) (sp-item 2359 :fade-after (meters 40) :falloff-to (meters 40) :binding 2357) (sp-item 2357 :flags (bit1 start-dead launch-asap)) (sp-item 2357 :flags (bit1 start-dead launch-asap)) @@ -617,17 +583,9 @@ ) (defpart 2359 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "fire-pop") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "fire-pop" :volume 100.0)) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -648,8 +606,7 @@ ) (defpart 2357 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -676,13 +633,11 @@ ) (defpart 2362 - :init-specs - ((sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g 1.0666667) (sp-flt spt-fade-b 1.0666667)) + :init-specs ((sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g 1.0666667) (sp-flt spt-fade-b 1.0666667)) ) (defpart 2358 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 3.0 7.0 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.1) 1.0) (sp-flt spt-y (meters -0.75)) @@ -706,8 +661,7 @@ ) (defpart 2360 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -0.5) (meters 1.1) 1.0) (sp-flt spt-y (meters -0.75)) @@ -735,8 +689,7 @@ ) (defpart 2361 - :init-specs - ((sp-flt spt-num 0.4) + :init-specs ((sp-flt spt-num 0.4) (sp-flt spt-x (meters 0.2)) (sp-flt spt-y (meters -0.75)) (sp-int spt-rot-x 8) @@ -755,15 +708,13 @@ ) (defpart 2363 - :init-specs - ((sp-flt spt-fade-b -1.3653333)) + :init-specs ((sp-flt spt-fade-b -1.3653333)) ) (defpartgroup group-spewing-volcano-36 :id 489 :bounds (static-bspherem 0 3 0 14) - :parts - ((sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1200 :offset 300) + :parts ((sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1200 :offset 300) (sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1320 :offset 360) (sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1440 :offset 420) (sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1560 :offset 480) @@ -815,8 +766,7 @@ (defpartgroup group-spewing-volcano-37 :id 490 :bounds (static-bspherem 0 3 0 14) - :parts - ((sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1200 :offset 1500) + :parts ((sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1200 :offset 1500) (sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1320 :offset 1560) (sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1440 :offset 1620) (sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1560 :offset 1680) @@ -866,8 +816,7 @@ ) (defpart 1836 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-int spt-rot-x 5) (sp-flt spt-r 8192.0) (sp-flt spt-g 6144.0) @@ -885,8 +834,7 @@ ) (defpart 1837 - :init-specs - ((sp-flt spt-fade-r 40.96) + :init-specs ((sp-flt spt-fade-r 40.96) (sp-flt spt-fade-g 34.133335) (sp-flt spt-fade-b 30.72) (sp-flt spt-accel-x 0.0) @@ -899,13 +847,11 @@ ) (defpart 1838 - :init-specs - ((sp-flt spt-fade-g 27.306667) (sp-int spt-timer 300)) + :init-specs ((sp-flt spt-fade-g 27.306667) (sp-int spt-timer 300)) ) (defpart 1833 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.6) (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -930,8 +876,7 @@ ) (defpart 1839 - :init-specs - ((sp-rnd-flt spt-a 16.0 8.0 1.0) + :init-specs ((sp-rnd-flt spt-a 16.0 8.0 1.0) (sp-flt spt-scalevel-x (meters 0.013333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.42666668) @@ -948,13 +893,11 @@ ) (defpart 1840 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) (defpart 1834 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 3.5) (meters 0.75) 1.0) (sp-flt spt-y (meters -7)) @@ -980,8 +923,7 @@ ) (defpart 1835 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-x (meters 3.5) (meters 0.75) 1.0) (sp-flt spt-y (meters -6.5)) @@ -1010,8 +952,7 @@ ) (defpart 1829 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters 7) (meters 3) 1.0) (sp-flt spt-y (meters -7)) @@ -1037,8 +978,7 @@ ) (defpart 1828 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.09) (sp-rnd-flt spt-x (meters 7) (meters 3) 1.0) (sp-flt spt-y (meters -6.5)) @@ -1067,8 +1007,7 @@ ) (defpart 1827 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters 5) (meters 2) 1.0) (sp-flt spt-y (meters -7)) @@ -1093,8 +1032,7 @@ ) (defpart 1826 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters 5) (meters 2) 1.0) (sp-flt spt-y (meters -6.5)) @@ -1122,8 +1060,7 @@ ) (defpart 1824 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.09) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -1152,8 +1089,7 @@ ) (defpart 1823 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.3) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -1180,8 +1116,7 @@ ) (defpart 1825 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) (sp-flt spt-num 0.7) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -1212,8 +1147,7 @@ ) (defpart 1832 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-int spt-rot-x 4) @@ -1241,8 +1175,7 @@ ) (defpart 1831 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1269,13 +1202,11 @@ ) (defpart 1841 - :init-specs - ((sp-flt spt-fade-r -0.08888889) (sp-flt spt-fade-g 0.0)) + :init-specs ((sp-flt spt-fade-r -0.08888889) (sp-flt spt-fade-g 0.0)) ) (defpart 1830 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) @@ -1306,8 +1237,7 @@ (defpartgroup group-village3-steam-puff-31 :id 491 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1842 :fade-after (meters 100) :falloff-to (meters 100) :period 900 :length 126) + :parts ((sp-item 1842 :fade-after (meters 100) :falloff-to (meters 100) :period 900 :length 126) (sp-item 1843 :fade-after (meters 100) :falloff-to (meters 100) :period 1260 :length 167) (sp-item 1844 :fade-after (meters 100) :falloff-to (meters 100) :period 690 :length 150) (sp-item 1845 :fade-after (meters 100) :falloff-to (meters 100) :period 1920 :length 80) @@ -1318,8 +1248,7 @@ (defpartgroup group-village3-steam-puff-22 :id 492 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1842 :fade-after (meters 100) :falloff-to (meters 100) :period 1230 :length 156) + :parts ((sp-item 1842 :fade-after (meters 100) :falloff-to (meters 100) :period 1230 :length 156) (sp-item 1843 :fade-after (meters 100) :falloff-to (meters 100) :period 2310 :length 107) (sp-item 1844 :fade-after (meters 100) :falloff-to (meters 100) :period 960 :length 120) (sp-item 1845 :fade-after (meters 100) :falloff-to (meters 100) :period 1350 :length 170) @@ -1330,8 +1259,7 @@ (defpartgroup group-village3-steam-puff-23 :id 493 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1842 :fade-after (meters 100) :falloff-to (meters 100) :period 1200 :length 126) + :parts ((sp-item 1842 :fade-after (meters 100) :falloff-to (meters 100) :period 1200 :length 126) (sp-item 1843 :fade-after (meters 100) :falloff-to (meters 100) :period 1560 :length 107) (sp-item 1844 :fade-after (meters 100) :falloff-to (meters 100) :period 1830 :length 120) (sp-item 1845 :fade-after (meters 100) :falloff-to (meters 100) :period 690 :length 110) @@ -1340,12 +1268,9 @@ ) (defpart 1842 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-scale-x (meters 0.4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1369,12 +1294,9 @@ ) (defpart 1843 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-scale-x (meters 0.4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1398,12 +1320,9 @@ ) (defpart 1844 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-scale-x (meters 0.4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1427,12 +1346,9 @@ ) (defpart 1845 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-scale-x (meters 0.4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1456,12 +1372,9 @@ ) (defpart 1846 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-scale-x (meters 0.4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1487,8 +1400,7 @@ (defpartgroup group-village3-bottom-puff-25 :id 494 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 900 :length 126) + :parts ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 900 :length 126) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1260 :length 167) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 669 :length 150) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1920 :length 80) @@ -1499,8 +1411,7 @@ (defpartgroup group-village3-bottom-puff-27 :id 495 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1200 :length 126) + :parts ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1200 :length 126) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1080 :length 167) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1569 :length 150) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 990 :length 80) @@ -1511,8 +1422,7 @@ (defpartgroup group-village3-bottom-puff-28 :id 496 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1500 :length 126) + :parts ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1500 :length 126) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1470 :length 167) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1029 :length 150) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 720 :length 80) @@ -1523,8 +1433,7 @@ (defpartgroup group-village3-bottom-puff-29 :id 497 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1500 :length 126) + :parts ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1500 :length 126) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 2010 :length 167) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 999 :length 150) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 720 :length 80) @@ -1535,8 +1444,7 @@ (defpartgroup group-village3-bottom-puff-30 :id 498 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1500 :length 126) + :parts ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1500 :length 126) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 960 :length 167) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1869 :length 150) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1050 :length 80) @@ -1545,12 +1453,9 @@ ) (defpart 1847 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-y (meters 0.7)) (sp-flt spt-scale-x (meters 0.4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1577,8 +1482,7 @@ (defpartgroup group-village3-lava-lava-20x20 :id 499 :bounds (static-bspherem 0 0 0 14) - :parts - ((sp-item 1850 :fade-after (meters 40) :falloff-to (meters 40)) + :parts ((sp-item 1850 :fade-after (meters 40) :falloff-to (meters 40)) (sp-item 1851 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1852 :fade-after (meters 80) :falloff-to (meters 80) :binding 1848) (sp-item 1848 :flags (start-dead)) @@ -1597,8 +1501,7 @@ ) (defpart 1851 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1624,8 +1527,7 @@ ) (defpart 1853 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0)) @@ -1645,8 +1547,7 @@ ) (defpart 1852 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.02 0.02 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0)) @@ -1668,8 +1569,7 @@ ) (defpart 1850 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -10) (meters 20) 1.0) @@ -1690,18 +1590,15 @@ ) (defpart 1856 - :init-specs - ((sp-flt spt-fade-b 16.384)) + :init-specs ((sp-flt spt-fade-b 16.384)) ) (defpart 1855 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 1857)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 1857)) ) (defpart 1857 - :init-specs - ((sp-flt spt-fade-r -0.85333335) + :init-specs ((sp-flt spt-fade-r -0.85333335) (sp-flt spt-fade-g -0.42666668) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 1858) @@ -1709,13 +1606,11 @@ ) (defpart 1858 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a -0.10666667)) ) (defpart 1848 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.7) (sp-rnd-flt spt-scale-x (meters 0.75) (meters 0.25) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1732,8 +1627,7 @@ ) (defpart 1849 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1754,8 +1648,7 @@ (defpartgroup group-village3-sagehut-warpgate :id 500 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1861 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1861 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1862 :fade-after (meters 60) :falloff-to (meters 100) :binding 1859) (sp-item 1859 :flags (bit1 start-dead launch-asap)) (sp-item 1859 :flags (bit1 start-dead launch-asap)) @@ -1934,8 +1827,7 @@ ) (defpart 1863 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters -2)) (sp-flt spt-scale-x (meters 0.25)) @@ -1950,8 +1842,7 @@ ) (defpart 1860 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 1.0 0.2 1.0) (sp-flt spt-x (meters 3.1111112)) (sp-flt spt-y (meters 4)) @@ -1974,8 +1865,7 @@ ) (defpart 1861 - :init-specs - ((sp-rnd-flt spt-num 5.0 5.0 1.0) + :init-specs ((sp-rnd-flt spt-num 5.0 5.0 1.0) (sp-flt spt-x (meters -0.5)) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) @@ -1992,8 +1882,7 @@ ) (defpart 1862 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.4 1.0 1.0) (sp-flt spt-scale-x (meters 0.25)) (sp-copy-from-other spt-scale-y -4) @@ -2006,8 +1895,7 @@ ) (defpart 1859 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.4 1.0) (sp-flt spt-x (meters 3.1111112)) (sp-flt spt-y (meters 4)) @@ -2033,13 +1921,11 @@ (defpartgroup group-village3-sagehut-boiling :id 501 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1864 :fade-after (meters 60) :flags (is-3d)) (sp-item 1865 :fade-after (meters 60) :flags (is-3d))) + :parts ((sp-item 1864 :fade-after (meters 60) :flags (is-3d)) (sp-item 1865 :fade-after (meters 60) :flags (is-3d))) ) (defpart 1864 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.5 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters -2)) @@ -2066,13 +1952,11 @@ ) (defpart 1866 - :init-specs - ((sp-flt spt-fade-a -0.2)) + :init-specs ((sp-flt spt-fade-a -0.2)) ) (defpart 1865 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -0.5)) (sp-flt spt-z (meters -0.26)) @@ -2093,8 +1977,7 @@ (defpartgroup group-village3-sagehut-steam :id 502 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1867 :fade-after (meters 60) :falloff-to (meters 60) :period 1200 :length 126) + :parts ((sp-item 1867 :fade-after (meters 60) :falloff-to (meters 60) :period 1200 :length 126) (sp-item 1867 :fade-after (meters 60) :falloff-to (meters 60) :period 1560 :length 107) (sp-item 1867 :fade-after (meters 60) :falloff-to (meters 60) :period 1830 :length 120) (sp-item 1867 :fade-after (meters 60) :falloff-to (meters 60) :period 690 :length 110) @@ -2103,12 +1986,9 @@ ) (defpart 1867 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-scale-x (meters 0.3)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -2134,8 +2014,7 @@ (defpartgroup group-village3-sagehut-understeam :id 503 :bounds (static-bspherem 0 -3 0 8) - :parts - ((sp-item 1868 :fade-after (meters 200) :falloff-to (meters 200) :period 1200 :length 126) + :parts ((sp-item 1868 :fade-after (meters 200) :falloff-to (meters 200) :period 1200 :length 126) (sp-item 1868 :fade-after (meters 200) :falloff-to (meters 200) :period 1560 :length 107) (sp-item 1868 :fade-after (meters 200) :falloff-to (meters 200) :period 1830 :length 120) (sp-item 1868 :fade-after (meters 200) :falloff-to (meters 200) :period 690 :length 110) @@ -2144,12 +2023,9 @@ ) (defpart 1868 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 4.0 4.0 1.0) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-x (meters 1.5)) (sp-flt spt-y (meters 0.6)) (sp-flt spt-scale-x (meters 1)) diff --git a/goal_src/levels/village_common/oracle.gc b/goal_src/levels/village_common/oracle.gc index 2ca653a7ad..f22c235805 100644 --- a/goal_src/levels/village_common/oracle.gc +++ b/goal_src/levels/village_common/oracle.gc @@ -7,6 +7,8 @@ ;; DECOMP BEGINS +(import "goal_src/import/oracle-ag.gc") + (deftype oracle (process-taskable) ((first-task uint8 :offset-assert 380) (second-task uint8 :offset-assert 381) @@ -20,13 +22,10 @@ ) -(defskelgroup *oracle-sg* oracle - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *oracle-sg* oracle oracle-lod0-jg oracle-idle-ja + ((oracle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) (defmethod play-anim! oracle ((obj oracle) (arg0 symbol)) (set! (-> obj talk-message) (game-text-id press-to-talk)) @@ -45,8 +44,7 @@ :name "oracle-intro-2" :index 11 :parts 4 - :command-list - '((0 kill "pontoonten-20") + :command-list '((0 kill "pontoonten-20") (0 kill "pontoonten-19") (0 kill "pontoonten-18") (0 kill "pontoonten-15") @@ -227,14 +225,12 @@ (defstate idle (oracle) :virtual #t - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) ((-> (method-of-type process-taskable idle) exit)) (none) ) - :trans - (behavior () + :trans (behavior () (update! (-> self sound)) ((-> (method-of-type process-taskable idle) trans)) (none) @@ -243,19 +239,8 @@ (defmethod init-from-entity! oracle ((obj oracle) (arg0 entity-actor)) (dummy-40 obj arg0 *oracle-sg* 3 4 (new 'static 'vector :y -4096.0 :w 4096.0) -1) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "oracle-sleep") - :volume #x400 - :fo-max 50 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "oracle-sleep" :fo-max 50) (-> obj root-override trans)) ) (set! (-> obj first-task) (the-as uint (-> arg0 extra perm task))) (set! (-> obj second-task) (res-lump-value arg0 'alt-task uint)) @@ -287,19 +272,9 @@ (ja-post) (when (not (task-closed? (the-as game-task (-> obj first-task)) (task-status need-resolution))) (vector<-cspace! s4-0 (-> obj node-list data 5)) - (let ((s3-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj right-eye-cell) - (ppointer->handle - (when s3-0 - (let ((t9-8 (method-of-type manipy activate))) - (t9-8 (the-as manipy s3-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 manipy-init s4-0 (-> obj entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2)) - (-> s3-0 ppointer) - ) - ) - ) - ) + (set! (-> obj right-eye-cell) + (ppointer->handle (manipy-spawn s4-0 (-> obj entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to obj)) + ) (send-event (handle->process (-> obj right-eye-cell)) 'eval @@ -313,19 +288,9 @@ ) (when (not (task-closed? (the-as game-task (-> obj second-task)) (task-status need-resolution))) (vector<-cspace! s4-0 (-> obj node-list data 6)) - (let ((s3-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj left-eye-cell) - (ppointer->handle - (when s3-1 - (let ((t9-15 (method-of-type manipy activate))) - (t9-15 (the-as manipy s3-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s3-1 manipy-init s4-0 (-> obj entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2)) - (-> s3-1 ppointer) - ) - ) - ) - ) + (set! (-> obj left-eye-cell) + (ppointer->handle (manipy-spawn s4-0 (-> obj entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to obj)) + ) (send-event (handle->process (-> obj left-eye-cell)) 'eval diff --git a/goal_src/levels/village_common/villagep-obs.gc b/goal_src/levels/village_common/villagep-obs.gc index f8c0766e6b..603c6a9191 100644 --- a/goal_src/levels/village_common/villagep-obs.gc +++ b/goal_src/levels/village_common/villagep-obs.gc @@ -8,6 +8,9 @@ ;; DECOMP BEGINS +(import "goal_src/import/warp-gate-switch-ag.gc") +(import "goal_src/import/village-cam-ag.gc") + (deftype warpgate (process-hidden) () :method-count-assert 15 @@ -17,14 +20,10 @@ (defstate target-warp-in (target) - :event - target-generic-event-handler - :enter - (-> target-warp-out enter) - :exit - (-> target-warp-out exit) - :trans - (behavior () + :event target-generic-event-handler + :enter (-> target-warp-out enter) + :exit (-> target-warp-out exit) + :trans (behavior () (set! (-> self control transv x) (- (-> self control unknown-vector103 x) (-> self control unknown-vector102 x)) ) @@ -32,13 +31,12 @@ (- (-> self control unknown-vector103 z) (-> self control unknown-vector102 z)) ) (vector-xz-normalize! (-> self control transv) 49152.0) - (if (logtest? (-> self control status) 1) + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-hit-ground #f) ) (none) ) - :code - (behavior ((arg0 vector) (arg1 vector)) + :code (behavior ((arg0 vector) (arg1 vector)) (clear-collide-with-as (-> self control)) (ja-channel-set! 0) (vector-reset! (-> self control transv)) @@ -74,69 +72,46 @@ (set! (-> self post-hook) target-no-stick-post) (ja-channel-set! 1) (send-event self 'do-effect 'death-warp-in -1.0) - (sound-play-by-name (static-sound-name "warpgate-tele") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> gp-3 param 0) (ja-aframe 50.0 0)) - (set! (-> gp-3 param 1) 1.0) - (set! (-> gp-3 frame-num) (ja-aframe 40.0 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) - ) + (sound-play "warpgate-tele") + (ja-no-eval :group! (-> self draw art-group data 41) + :num! (seek! (ja-aframe 50.0 0)) + :frame-num (ja-aframe 40.0 0) + ) (until (ja-done? 0) (suspend) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 param 0) (ja-aframe 50.0 0)) - (set! (-> gp-4 param 1) 1.0) - (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 50.0 0))) ) (restore-collide-with-as (-> self control)) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> gp-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 41)) data 0 length) -1)) - ) - (set! (-> gp-5 param 1) 1.0) - (set! (-> gp-5 frame-num) (ja-aframe 50.0 0)) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 41) :num! (seek!) :frame-num (ja-aframe 50.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 param 0) (the float (+ (-> a0-26 frame-group data 0 length) -1))) - (set! (-> a0-26 param 1) 1.0) - (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (target-falling-anim -1 99) + (target-falling-anim -1 (seconds 0.33)) (none) ) - :post - target-no-move-post + :post target-no-move-post ) (defstate idle (warp-gate) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hide) (go-virtual hidden) ) ) ) - :code - (behavior () - (clear-pending-settings-from-process *setting-control* self 'allow-progress) + :code (behavior () + (remove-setting! 'allow-progress) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (when (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (and (>= (-> self level-slot) 0) (not (movie?)) (not (level-hint-displayed?)) - (zero? - (logand (-> *target* control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) - ) + (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) + ) (let* ((v1-16 (-> self root)) (a1-2 (-> *target* control trans)) (f0-1 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) a1-2 (-> v1-16 trans)))) @@ -245,16 +220,14 @@ (defstate active (warp-gate) :virtual #t - :enter - (behavior () - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) - (copy-settings-from-target! *setting-control*) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + :enter (behavior () + (set-setting! 'allow-progress #f 0.0 0) + (apply-settings *setting-control*) + (sound-play "start-options") (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (when (or (and (cpad-pressed? 0 triangle) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (process-release? *target*) @@ -263,7 +236,7 @@ ) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (go-virtual idle) ) (when *target* @@ -284,8 +257,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (sv-112 int) (sv-128 int) (sv-144 int)) (let ((gp-0 (get-next-slot-up self (+ (-> self level-slot) -1)))) 0 @@ -294,19 +266,19 @@ (s4-0 #f) (s3-0 gp-0) ) - (while #t + (loop (when (zero? s2-0) (cond ((cpad-pressed? 0 right) (set! s5-0 #t) (set! s4-0 #f) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! s3-0 (get-next-slot-up self s3-0)) ) ((cpad-pressed? 0 left) (set! s5-0 #t) (set! s4-0 #t) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! s3-0 (get-next-slot-down self s3-0)) ) ) @@ -426,8 +398,7 @@ (defstate hidden (warp-gate) :virtual #t - :code - (the-as (function none :behavior warp-gate) anim-loop) + :code (the-as (function none :behavior warp-gate) anim-loop) ) (defbehavior warp-gate-init-by-other warp-gate ((arg0 vector)) @@ -492,13 +463,10 @@ ) -(defskelgroup *warp-gate-switch-sg* warp-gate-switch - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1.5) - :longest-edge (meters 0) - ) +(defskelgroup *warp-gate-switch-sg* warp-gate-switch warp-gate-switch-lod0-jg warp-gate-switch-down-ja + ((warp-gate-switch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.5) + ) (defmethod TODO-RENAME-27 warp-gate-switch ((obj warp-gate-switch)) (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) @@ -653,7 +621,7 @@ ) ;; note: they appear to be calling this on the wrong object. ;; this doesn't actually cause any problems but corrupts the type of `float` in the symbol - ;; table because they they write to some field of arg0, which is actually #t and not a + ;; table because they they write to some field of arg0, which is actually #t and not a ;; basebutton. The corruption is completely harmless but is annoying because it looks like ;; a more severe memory corruption problem. So we fix it. (the-as int ((the-as (function basebutton symbol none) (find-parent-method warp-gate-switch 31)) @@ -667,8 +635,7 @@ (defstate basebutton-up-idle (warp-gate-switch) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (when (pressable? self) @@ -684,8 +651,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((t9-0 (-> (method-of-type basebutton basebutton-up-idle) enter))) (if t9-0 @@ -694,8 +660,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) (set! (-> a1-0 num-params) 0) @@ -789,8 +754,7 @@ (defstate basebutton-down-idle (warp-gate-switch) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hide) (send-event (handle->process (-> self warp)) arg2) @@ -800,21 +764,9 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((gp-0 (get-process *default-dead-pool* warp-gate #x4000))) - (set! (-> self warp) - (ppointer->handle (when gp-0 - (let ((t9-1 (method-of-type warp-gate activate))) - (t9-1 (the-as warp-gate gp-0) self 'warp-gate (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 warp-gate-init-by-other (-> self notify-actor extra trans)) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self warp) (ppointer->handle (process-spawn warp-gate (-> self notify-actor extra trans) :to self))) (process-entity-status! self (entity-perm-status complete) #t) (let ((t9-4 (-> (method-of-type basebutton basebutton-down-idle) enter))) (if t9-4 @@ -823,8 +775,7 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self warp)))) (if a0-1 (deactivate a0-1) @@ -837,8 +788,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 60)) (case (-> self entity extra perm task) (((game-task training-door)) @@ -867,10 +817,9 @@ (defstate basebutton-going-down (warp-gate-switch) :virtual #t - :code - (behavior () - (sound-play-by-name (static-sound-name "warpgate-butt") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "warpgate-act") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (sound-play "warpgate-butt") + (sound-play "warpgate-act") (let ((gp-2 (entity-actor-count (-> self entity) 'trigger-actor))) (dotimes (s5-2 gp-2) (let ((s4-0 (entity-actor-lookup (-> self entity) 'trigger-actor s5-2)) @@ -911,13 +860,10 @@ ) ) -(defskelgroup *village-cam-sg* village-cam - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 80) - :longest-edge (meters 0) - ) +(defskelgroup *village-cam-sg* village-cam village-cam-lod0-jg -1 + ((village-cam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) (deftype village-cam (process) ((root-override trsq :offset-assert 112) @@ -944,10 +890,9 @@ (defstate idle (village-cam) :virtual #t - :code - (behavior () + :code (behavior () (local-vars (v1-18 symbol)) - (while #t + (loop (let ((v1-5 (and (and *target* (>= (-> self range) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) @@ -1007,8 +952,8 @@ ) ) (while (and *target* - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) (suspend) ) @@ -1016,29 +961,30 @@ (process-grab? *target*) (process-entity-status! self (entity-perm-status bit-3) #t) (kill-current-level-hint '(ambient) '() 'exit) - (until (not (or (-> *setting-control* current talking) (or (-> *setting-control* current spooling) - (-> *setting-control* current hint) - (-> *setting-control* current ambient) - (not *target*) - (logtest? (-> *target* state-flags) #x8008) - ) + (until (not (or (-> *setting-control* current talking) + (or (-> *setting-control* current spooling) + (-> *setting-control* current hint) + (-> *setting-control* current ambient) + (not *target*) + (logtest? (-> *target* state-flags) (state-flags being-attacked dying)) + ) ) ) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (let* ((a0-25 *setting-control*) - (t9-14 (method-of-object a0-25 set-setting!)) + (t9-14 (method-of-object a0-25 set-setting)) (a2-5 'movie) (a3-1 (process->ppointer self)) ) - (t9-14 a0-25 self a2-5 (the-as symbol a3-1) 0.0 0) + (t9-14 a0-25 self a2-5 a3-1 0.0 0) ) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (while (or (-> *setting-control* current talking) (-> *setting-control* current spooling) (-> *setting-control* current hint) (!= (-> *level* loading-level) (-> *level* level-default)) (not *target*) - (logtest? (-> *target* state-flags) #x8008) + (logtest? (-> *target* state-flags) (state-flags being-attacked dying)) *progress-process* ) (suspend) @@ -1050,8 +996,8 @@ (suspend) (kill-current-level-hint '() '() 'die) (process-release? *target*) - (clear-pending-settings-from-process *setting-control* self 'movie) - (copy-settings-from-target! *setting-control*) + (remove-setting! 'movie) + (apply-settings *setting-control*) (suspend) (suspend) ) @@ -1070,33 +1016,25 @@ *entity-pool* (game-task none) ) - (let ((s5-0 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-0 - (let ((t9-23 (method-of-type pov-camera activate))) - (t9-23 (the-as pov-camera s5-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> self entity extra trans) - *village-cam-sg* - "firecanyon-cam" - 0 - #f - '((0 want-force-vis village1 #t) - (0 alive "money-2669") - (0 alive "money-2670") - (0 alive "money-2671") - (0 alive "money-2672") - (0 alive "money-2673") - (0 alive "money-2674") - (0 alive "money-2675") - (0 alive "money-2677") - (0 alive "money-2678") - ) - ) - (-> s5-0 ppointer) + (process-spawn + pov-camera + (-> self entity extra trans) + *village-cam-sg* + "firecanyon-cam" + 0 + #f + '((0 want-force-vis village1 #t) + (0 alive "money-2669") + (0 alive "money-2670") + (0 alive "money-2671") + (0 alive "money-2672") + (0 alive "money-2673") + (0 alive "money-2674") + (0 alive "money-2675") + (0 alive "money-2677") + (0 alive "money-2678") ) + :to self ) ) ((= v1-84 1) @@ -1107,33 +1045,25 @@ *entity-pool* (game-task none) ) - (let ((s5-1 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-1 - (let ((t9-27 (method-of-type pov-camera activate))) - (t9-27 (the-as pov-camera s5-1) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - pov-camera-init-by-other - (-> self entity extra trans) - *village-cam-sg* - "firecanyon-alt-cam" - 0 - #f - '((0 want-force-vis village1 #t) - (0 alive "money-2669") - (0 alive "money-2670") - (0 alive "money-2671") - (0 alive "money-2672") - (0 alive "money-2673") - (0 alive "money-2674") - (0 alive "money-2675") - (0 alive "money-2677") - (0 alive "money-2678") - ) - ) - (-> s5-1 ppointer) + (process-spawn + pov-camera + (-> self entity extra trans) + *village-cam-sg* + "firecanyon-alt-cam" + 0 + #f + '((0 want-force-vis village1 #t) + (0 alive "money-2669") + (0 alive "money-2670") + (0 alive "money-2671") + (0 alive "money-2672") + (0 alive "money-2673") + (0 alive "money-2674") + (0 alive "money-2675") + (0 alive "money-2677") + (0 alive "money-2678") ) + :to self ) ) ) @@ -1152,24 +1082,7 @@ *entity-pool* (game-task none) ) - (let ((gp-1 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-1 - (let ((t9-33 (method-of-type pov-camera activate))) - (t9-33 (the-as pov-camera gp-1) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (-> self entity extra trans) - *village-cam-sg* - "vi2-button-cam" - 0 - #f - '() - ) - (-> gp-1 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *village-cam-sg* "vi2-button-cam" 0 #f '() :to self) ) ) ((= v1-79 3) @@ -1181,24 +1094,7 @@ *entity-pool* (game-task none) ) - (let ((gp-2 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-2 - (let ((t9-38 (method-of-type pov-camera activate))) - (t9-38 (the-as pov-camera gp-2) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - pov-camera-init-by-other - (-> self entity extra trans) - *village-cam-sg* - "vi3-button-cam" - 0 - #f - '() - ) - (-> gp-2 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *village-cam-sg* "vi3-button-cam" 0 #f '() :to self) ) ) ) @@ -1220,7 +1116,7 @@ (when (zero? (-> self index)) (let ((a0-70 (-> self entity extra perm))) (when (= (-> a0-70 user-uint8 0) 1) - (clear-pending-settings-from-process *setting-control* self 'allow-progress) + (remove-setting! 'allow-progress) (let ((gp-3 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-3) (seconds 300)) (suspend) diff --git a/goal_src/pc/README.md b/goal_src/pc/README.md index 763908b3cb..84091e8cd8 100644 --- a/goal_src/pc/README.md +++ b/goal_src/pc/README.md @@ -1,3 +1 @@ -This directory contains either completely new source code files OR files we've significantly modified from the original - -Please try to preserve the original file path (with the addition of `pc/`) to make regression testing easy if it falls into the category of the latter. +This directory contains new source code files used for the PC port diff --git a/goal_src/pc/anim-tester-x.gc b/goal_src/pc/anim-tester-x.gc new file mode 100644 index 0000000000..1f4cec1bac --- /dev/null +++ b/goal_src/pc/anim-tester-x.gc @@ -0,0 +1,691 @@ +;;-*-Lisp-*- +(in-package goal) + +#| + + Code for the PC port anim tester. It's like their original anim tester tool, but actually functional, and with + different features. + + |# + +;; debug-only file! +(declare-file (debug)) +(when *debug-segment* +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; constants +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; types and enums +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +;;;------------------------ +;; settings +;;;------------------------ + + +(deftype atx-item (basic) + ((next atx-item :offset-assert 4) + (text string) + + (extra basic) + (group art-group :overlay-at extra) + (jgeo art-joint-geo :overlay-at extra) + (janim art-joint-anim :overlay-at extra) + (mgeo merc-ctrl :overlay-at extra) + ) + (:methods + (new (symbol type string basic) _type_ 0) + ) + ) + +(defmethod new atx-item ((allocation symbol) (type-to-make type) (text string) (extra basic)) + "make a new atx-item" + + (let ((obj (object-new allocation type-to-make (the int (-> type-to-make size))))) + (set! (-> obj next) #f) + (set! (-> obj text) text) + (set! (-> obj extra) extra) + + obj) + ) + +(deftype atx-list (structure) + ((head atx-item :offset-assert 0) + (tail atx-item) + (selection int16) + (offset int16) + (func (function atx-item object)) + ) + ) + + +(defenum atx-flags + :bitfield #t + :type int32 + (eye) + (blerc) + (show-joints) + ) + +(deftype anim-tester-x-settings (structure) + ( + (speed float) + (frame-num float) + (mode symbol) + (flags atx-flags) + (list-ctrl atx-list :inline) + ) + ) + +(define *ATX-settings* (new 'static 'anim-tester-x-settings :speed 1.0 + :mode 'loop + :flags (atx-flags))) + + +(deftype atx-item-art-group (atx-item) + ((ja-list atx-list :inline) + (jg-list atx-list :inline) + (mg-list atx-list :inline) + ) + (:methods + (new (symbol type string art-group) _type_ 0) + ) + ) + +;;;---------------------------------- +;; process +;;;---------------------------------- + + +(defenum atx-edit-mode + :type uint8 + (none) + (art-group) + (anim) + (mgeo) + (jgeo) + ) + + +(deftype anim-tester-x (process-drawable) + ( + (edit-mode atx-edit-mode) + (cur-list atx-list) + (selected-art-group atx-item-art-group) + + (cur-art-group art-group) + (cur-joint-geo art-joint-geo) + (cur-mesh-geo merc-ctrl) + (cur-joint-anim art-joint-anim) + ) + ) + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; list functions and macros +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defmacro do-atx-list (bindings &rest body) + "iterate through an atx-list." + (with-gensyms (next) + `(let ((,(car bindings) (-> ,(cadr bindings) head))) + (while ,(car bindings) + (let ((,next (-> ,(car bindings) next))) + + ,@body + + (set! ,(car bindings) ,next) + ) + ) + ) + ) + ) + +(defun atx-list-init! ((lst atx-list)) + "initialize an atx-list" + (set! (-> lst head) #f) + (set! (-> lst tail) #f) + (set! (-> lst selection) 0) + (set! (-> lst offset) 0) + (set! (-> lst func) (the (function atx-item object) nothing)) + lst) + +(defun atx-list-size ((lst atx-list)) + "return size of an atx-list" + (let ((items 0)) + (do-atx-list (item lst) (1+! items)) + items) + ) + +(defun atx-list-append ((lst atx-list) (item atx-item)) + "append an item to a list. returns the added item." + + (if (not (-> lst head)) (set! (-> lst head) item)) + (if (-> lst tail) (set! (-> lst tail next) item)) + (set! (-> lst tail) item) + item) + +(defun atx-list-remove ((lst atx-list) (item atx-item)) + "remove an item from a list. removes all instances of that item. but it's weird if you have multiple..." + + (cond + ((= (-> lst head) item) + (set! (-> lst head) (-> item next)) + (if (= (-> lst tail) item) + (set! (-> lst tail) #f) + ) + ) + (else + (let ((last (the atx-item #f)) + (i 0)) + (do-atx-list (it lst) + (when (= it item) + (if (>= (-> lst selection) i) + (1-! (-> lst selection))) + (set! (-> last next) (-> it next)) + (set! it last) + ) + (set! last it) + ) + ) + ) + ) + 0) + +(defun atx-list-remove-by-object ((lst atx-list) (obj basic)) + "remove all items with a specific object from a list." + + (do-atx-list (it lst) + (if (= (-> it extra) obj) + (atx-list-remove lst it) + ) + ) + 0) + +(defun atx-list-get-by-index ((lst atx-list) (idx int)) + "get an item by its index." + + (let ((items 0)) + (do-atx-list (item lst) + (if (= items idx) + (return item)) + (1+! items)) + items) + (the atx-item #f)) + +(defun atx-list-get-by-name ((lst atx-list) (name string)) + "get an item by its index." + + (do-atx-list (item lst) + (if (string= (-> item text) name) + (return item)) + ) + (the atx-item #f)) + + +(defmacro atx-interface-square-to-menu () + `(when (cpad-pressed? 0 square) + (cpad-clear! 0 square) + (true! *camera-read-buttons*) + (set! (-> self edit-mode) (atx-edit-mode none)) + (set! (-> *debug-menu-context* is-hidden) #f) + ) + ) + +(defun atx-list-interface ((lst atx-list) (title string) (warning string) (sel-obj basic)) + "run interface and draw an atx-list" + + (let ((items-drawn (-> lst offset)) + (i 0) + (color (font-color dim-white)) + (text-len 0.0)) + + (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) + (bucket-id debug-no-zbuf)) + + (when (nonzero? (length title)) + (set! text-len (draw-string-xy title buf 9 (+ 28 4 (* items-drawn 8)) (font-color dim-white) (font-flags shadow kerning))) + (1+! items-drawn) + ) + + (do-atx-list (item lst) + (let ((selected? (= i (-> lst selection)))) + + (set! color (if (= (-> item extra) sel-obj) (font-color yellow-green) (font-color dim-white))) + + (let ((this-len (draw-string-xy (-> item group name) buf 21 (+ 28 4 (* items-drawn 8)) color (font-flags shadow kerning)))) + (if (> this-len text-len) + (set! text-len this-len))) + + (if selected? + (draw-string-xy ">" buf 9 (+ 28 4 (* items-drawn 8)) color (font-flags shadow kerning))) + + (1+! items-drawn) + (1+! i) + + )) + + (when (not (-> lst head)) + (draw-string-xy warning buf 21 (+ 28 4 8) (font-color red) (font-flags shadow kerning)) + (1+! items-drawn)) + + ) + + (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) + (bucket-id debug)) + + + (draw-sprite2d-xy buf 6 (+ 28 (* (-> lst offset) 8)) + (+ 6 12 12 (the int text-len)) (+ 8 (* 8 (- items-drawn (-> lst offset)))) + (static-rgba 0 0 0 64)) + + ) + ) + + (when (-> lst head) + (if (cpad-pressed? 0 down) + (+! (-> lst selection) 1)) + (if (cpad-pressed? 0 right) + (+! (-> lst selection) 5)) + (if (cpad-pressed? 0 up) + (-! (-> lst selection) 1)) + (if (cpad-pressed? 0 left) + (-! (-> lst selection) 5)) + (if (< (-> lst selection) 0) + (set! (-> lst selection) (1- (atx-list-size lst)))) + (if (>= (-> lst selection) (atx-list-size lst)) + (set! (-> lst selection) 0)) + (if (cpad-pressed? 0 x) + ((-> lst func) (atx-list-get-by-index lst (-> lst selection))) + ) + + (when (< 16 (+ (-> lst selection) (-> lst offset))) + (set! (-> lst offset) (- 16 (-> lst selection))) + ) + (when (< (+ (-> lst selection) (-> lst offset)) 0) + (set! (-> lst offset) (- 0 (-> lst selection))) + ) + ) + 0) + + +(defbehavior atx-list-art-group-func anim-tester-x ((item atx-item-art-group)) + + (if (not (and (type-type? (-> item type) atx-item-art-group) + (-> item group) + (-> item ja-list head) + (-> item jg-list head) + (-> item mg-list head) + )) + (return #f)) + + (set! (-> self selected-art-group) item) + (set! (-> self edit-mode) (atx-edit-mode anim)) + (set! (-> self cur-art-group) (-> item group)) + (set! (-> self cur-joint-anim) (-> item ja-list head janim)) + (set! (-> self cur-joint-geo) (-> item jg-list head jgeo)) + (set! (-> self cur-mesh-geo) (-> item mg-list head mgeo)) + (ja-no-eval :frame-num 0.0) + 0) + +(defbehavior atx-list-joint-anim-func anim-tester-x ((item atx-item)) + + (if (not (-> item janim)) + (return #f)) + (set! (-> self cur-joint-anim) (-> item janim)) + (ja-no-eval :frame-num 0.0) + 0) +(defbehavior atx-list-joint-geo-func anim-tester-x ((item atx-item)) + + (if (not (-> item janim)) + (return #f)) + (set! (-> self cur-joint-geo) (-> item jgeo)) + 0) +(defbehavior atx-list-mesh-geo-func anim-tester-x ((item atx-item)) + + (if (not (-> item janim)) + (return #f)) + (set! (-> self cur-mesh-geo) (-> item mgeo)) + 0) + + + +(defmethod new atx-item-art-group ((allocation symbol) (type-to-make type) (text string) (ag art-group)) + "make a new atx-item" + + (let ((obj (object-new allocation type-to-make (the int (-> type-to-make size))))) + (set! (-> obj next) #f) + (set! (-> obj text) text) + (set! (-> obj group) ag) + + (atx-list-init! (-> obj ja-list)) + (atx-list-init! (-> obj jg-list)) + (atx-list-init! (-> obj mg-list)) + (set! (-> obj ja-list func) atx-list-joint-anim-func) + (set! (-> obj jg-list func) atx-list-joint-geo-func) + (set! (-> obj mg-list func) atx-list-mesh-geo-func) + + obj) + ) + + + +;;;---------------------------------------------- +;; globals +;;;---------------------------------------------- + +;; initialize the lists in the static defs +(atx-list-init! (-> *ATX-settings* list-ctrl)) +(set! (-> *ATX-settings* list-ctrl func) atx-list-art-group-func) + +;; the actual process. +(define-perm *atx* (pointer anim-tester-x) #f) + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; states +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + + + +(defbehavior anim-tester-x-reset anim-tester-x () + "reset the anim tester to default settings" + + (format #t "resetting anim tester~%") + (set! (-> self edit-mode) (atx-edit-mode none)) + (set! (-> self selected-art-group) #f) + (set! (-> self cur-art-group) #f) + (set! (-> self cur-joint-anim) #f) + (set! (-> self cur-joint-geo) #f) + (set! (-> self cur-mesh-geo) #f) + 0) + + +(defbehavior clean-art-groups anim-tester-x () + "purge possible invalid art groups automatically." + (do-atx-list (it (-> *ATX-settings* list-ctrl)) + (when (!= (-> it group type) art-group) + (when (= it (-> self selected-art-group)) + (anim-tester-x-reset) + ) + (atx-list-remove (-> *ATX-settings* list-ctrl) it) + ) + ) + ) + + +(defbehavior anim-tester-x-interface anim-tester-x () + "UI controls for anim tester" + + (set! (-> *debug-menu-context* is-hidden) #t) + (set! (-> self cur-list) #f) + + (case (-> self edit-mode) + (((atx-edit-mode none)) + (set! (-> *debug-menu-context* is-hidden) #f)) + (((atx-edit-mode art-group)) + (set! (-> self cur-list) (-> *ATX-settings* list-ctrl)) + (atx-list-interface (-> self cur-list) "---- pick art group ----" "Add an art group with atx-add-group" (-> self cur-art-group)) + (atx-interface-square-to-menu) + ) + (((atx-edit-mode anim)) + (set! (-> self cur-list) (-> self selected-art-group ja-list)) + (atx-list-interface (-> self cur-list) "---- pick anim ----" "" (-> self cur-joint-anim)) + (atx-interface-square-to-menu) + ) + (((atx-edit-mode jgeo)) + (set! (-> self cur-list) (-> self selected-art-group jg-list)) + (atx-list-interface (-> self cur-list) "---- pick skeleton ----" "" (-> self cur-joint-geo)) + (atx-interface-square-to-menu) + ) + (((atx-edit-mode mgeo)) + (set! (-> self cur-list) (-> self selected-art-group mg-list)) + (atx-list-interface (-> self cur-list) "---- pick mesh ----" "" (-> self cur-mesh-geo)) + (atx-interface-square-to-menu) + ) + ) + + 0) + + +(defstate anim-tester-x-process (anim-tester-x) + + :trans (behavior () + (clean-art-groups) + + (if (= *master-mode* 'menu) + (anim-tester-x-interface) + (set! *camera-read-buttons* #t) + ) + (when (!= *master-mode* 'menu) + (add-debug-x #t (bucket-id debug-no-zbuf) (-> self root trans) *color-white*) + ) + (none)) + + :code (behavior () + + (loop + + (when (and (-> self cur-joint-geo) (!= (-> self cur-joint-geo) (-> self draw jgeo))) + (process-disconnect self) + (set! (-> self draw art-group) (-> self cur-art-group)) + (set! (-> self draw cur-lod) -1) + (set! (-> self draw jgeo) (-> self cur-joint-geo)) + (set! (-> self draw sink-group) (-> *level* level-default foreground-sink-group 1)) + (set! (-> self draw lod-set lod 0 geo) (-> self cur-mesh-geo)) + (set! (-> self draw lod-set lod 0 dist) (meters 999999)) + (set! (-> self draw bounds w) (meters 10)) + (set! (-> self draw data-format) (the-as uint 1)) + (vector-copy! (-> self draw color-mult) (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) + (vector-copy! (-> self draw color-emissive) (new 'static 'vector)) + (set! (-> self draw secondary-interp) 0.0) + (set! (-> self draw shadow) #f) + (set! (-> self draw shadow-ctrl) #f) + (set! (-> self draw ripple) #f) + (set! (-> self draw level-index) (the-as uint 2)) + (set! (-> self node-list) (make-nodes-from-jg (-> self draw jgeo) *default-skel-template* 'debug)) + (if (not (-> self skel effect)) + (set! (-> self skel effect) (new 'process 'effect-control self))) + (fill-skeleton-cache self) + (lod-set! (-> self draw) 0) + (ja-channel-set! 0) + ) + + (cond + ((-> self cur-joint-geo) + (if (> 1 (-> self skel active-channels)) + (ja-channel-set! 1)) + (set! (-> self draw lod-set lod 0 geo) (-> self cur-mesh-geo)) + (ja-no-eval :group! (-> self cur-joint-anim)) + (when (!= *master-mode* 'menu) + (case (-> *ATX-settings* mode) + (('loop) + (ja :num! (loop! (-> *ATX-settings* speed))) + ) + (('identity) + (ja :num! (identity (-> *ATX-settings* frame-num))) + ) + (('seek) + (ja :num! (seek! max (-> *ATX-settings* speed))) + ) + ) + ) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel keep-other-velocities adjust-quat) + 1.0 1.0 1.0) + ) + (else + (if (!= *master-mode* 'menu) + (format *stdcon* "~%~%no art selected~%") + ) + ) + ) + + (suspend)) + ) + + :post (behavior () + (when (-> self cur-joint-geo) + (ja-post) + (when (!= *master-mode* 'menu) + (when (logtest? (-> *ATX-settings* flags) (atx-flags show-joints)) + (draw-joint-spheres self) + ) + (format *stdcon* "~%~%") + (debug-print-channels (-> self skel) (the-as symbol *stdcon*)) + ) + ) + ) + + ) + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; helper functions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +(defbehavior anim-tester-x-init-by-other anim-tester-x () + "external initializer for anim-tester-x process" + + (logclear! (-> self mask) (process-mask menu)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self draw) (new 'process 'draw-control self (the art-joint-geo #f))) + (set! (-> self draw dma-add-func) dma-add-process-drawable) + (set! (-> self skel) (new 'process 'joint-control 24)) ;; allocate 24 anim channels + (set! (-> self align) (new 'process 'align-control self)) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (position-in-front-of-camera! (-> self root trans) (meters 10) (meters 1)) + (anim-tester-x-reset) + (go anim-tester-x-process) + (none) + ) + + +(defun atx-stop () + "kill the anim tester process" + + (kill-by-type anim-tester-x *default-pool*) + (set! *atx* (the (pointer anim-tester-x) #f))) + +(defun atx-start () + "start the anim tester process" + + (when *atx* + (atx-stop) + ) + + (if *target* + (stop 'play)) + (set! *atx* (process-spawn anim-tester-x :from *pc-dead-pool* :stack-size (* 8 1024))) + (set! *camera-orbit-target* *atx*) + (send-event *camera* 'change-state cam-free-floating 0) + ) + + +(defun atx-add-new-art-group ((ag art-group)) + + (let ((ag-item (the atx-item-art-group (atx-list-append (-> *ATX-settings* list-ctrl) + (new 'debug 'atx-item-art-group (-> ag name) ag))))) + (dotimes (i (-> ag length)) + (when (-> ag data i) + (case (-> ag data i type) + ((art-joint-geo) (atx-list-append (-> ag-item jg-list) (new 'debug 'atx-item (-> ag name) (-> ag data i)))) + ((merc-ctrl) (atx-list-append (-> ag-item mg-list) (new 'debug 'atx-item (-> ag name) (-> ag data i)))) + ((art-joint-anim) (atx-list-append (-> ag-item ja-list) (new 'debug 'atx-item (-> ag name) (-> ag data i)))) + ) + ) + ) + ag-item) + ) + +(defun atx-add-group ((name string) (level-name symbol)) + + (protect ((-> *level* log-in-level-bsp)) + (set! (-> *level* log-in-level-bsp) (aif (level-get *level* level-name) (-> it bsp))) + (let ((ag (load-to-heap-by-name (-> *level* level-default art-group) name #t debug 0))) + (cond + (ag + (if (not *atx*) (atx-start)) + + (atx-add-new-art-group ag) + ) + (else + (format #t "ERROR: no art-group ~A~%" name) + ) + ) + )) + 0) + +(defun atx-append-group ((append-to string) (name string) (level-name symbol)) + + (protect ((-> *level* log-in-level-bsp)) + (set! (-> *level* log-in-level-bsp) (aif (level-get *level* level-name) (-> it bsp))) + (let ((ag (load-to-heap-by-name (-> *level* level-default art-group) name #t debug 0))) + (cond + (ag + (if (not *atx*) (atx-start)) + + (let ((ag-item (the atx-item-art-group (atx-list-get-by-name (-> *ATX-settings* list-ctrl) append-to)))) + (when (not ag-item) + (format #t "ERROR: art-group ~A not loaded~%" append-to) + (return #f) + ) + (dotimes (i (-> ag length)) + (when (-> ag data i) + (case (-> ag data i type) + ((art-joint-geo) (atx-list-append (-> ag-item jg-list) (new 'debug 'atx-item (-> ag name) (-> ag data i)))) + ((merc-ctrl) (atx-list-append (-> ag-item mg-list) (new 'debug 'atx-item (-> ag name) (-> ag data i)))) + ((art-joint-anim) (atx-list-append (-> ag-item ja-list) (new 'debug 'atx-item (-> ag name) (-> ag data i)))) + ) + ) + )) + ) + (else + (format #t "ERROR: no art-group ~A~%" name) + ) + ) + )) + 0) + +(defun atx-add-level-group () + + (if (not *atx*) (atx-start)) + + (do-atx-list (item (-> *ATX-settings* list-ctrl)) + (if (or (and (>= (-> item group) (-> *level* level 0 heap base)) (< (-> item group) (-> *level* level 0 heap top))) + (and (>= (-> item group) (-> *level* level 1 heap base)) (< (-> item group) (-> *level* level 1 heap top)))) + (atx-list-remove (-> *ATX-settings* list-ctrl) item) + ) + ) + (dotimes (i 2) + (doarray (ag (-> *level* level i art-group data-array)) + (atx-add-new-art-group (the art-group ag)) + ) + ) + ) + +(defun atx-add-common-group () + + (if (not *atx*) (atx-start)) + (doarray (ag (-> *level* level 2 art-group data-array)) + (atx-add-new-art-group (the art-group ag)) + ) + ) + + + + + +) \ No newline at end of file diff --git a/goal_src/pc/engine/ui/progress-h.gc b/goal_src/pc/engine/ui/progress-h.gc deleted file mode 100644 index dd63829d43..0000000000 --- a/goal_src/pc/engine/ui/progress-h.gc +++ /dev/null @@ -1,271 +0,0 @@ -;;-*-Lisp-*- -(in-package goal) - -;; name: progress-h.gc -;; name in dgo: progress-h -;; dgos: GAME, ENGINE - - -(defenum progress-screen - :type int64 - (invalid -1) - (fuel-cell 0) - (money 1) - (buzzer 2) - (settings 3) - (game-settings 4) - (graphic-settings 5) - (sound-settings 6) - (memcard-no-space 7) - (memcard-not-inserted 8) - (memcard-not-formatted 9) - (memcard-format 10) - (memcard-data-exists 11) - (memcard-loading 12) - (memcard-saving 13) - (memcard-formatting 14) - (memcard-creating 15) - (load-game 16) - (save-game 17) - (save-game-title 18) - (memcard-insert 19) - (memcard-error-loading 20) - (memcard-error-saving 21) - (memcard-removed 22) - (memcard-no-data 23) - (memcard-error-formatting 24) - (memcard-error-creating 25) - (memcard-auto-save-error 26) - (title 27) - (settings-title 28) - (auto-save 29) - (pal-change-to-60hz 30) - (pal-now-60hz 31) - (no-disc 32) - (bad-disc 33) - (quit 34) - ;; custom - (language-options 35) - ) - -(defun-extern activate-progress process progress-screen none) -(defun-extern hide-progress-screen none) -(defun-extern hide-progress-icons none) - -(declare-type level-tasks-info basic) - -(define-extern *level-task-data* (array level-tasks-info)) -(define-extern *level-task-data-remap* (array int32)) - -(declare-type count-info structure) - -(defun-extern get-game-count int count-info) -(defun-extern progress-allowed? symbol) -(defun-extern pause-allowed? symbol) - -(declare-type progress process) - -(defun-extern deactivate-progress none) -(defun-extern calculate-completion progress float) -(defun-extern make-current-level-available-to-progress none) - -;; DECOMP BEGINS - -(deftype count-info (structure) - ((money-count int32 :offset-assert 0) - (buzzer-count int32 :offset-assert 4) - ) - :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 - ) - - -(deftype game-count-info (basic) - ((length int32 :offset-assert 4) - (data count-info :inline :dynamic :offset-assert 8) - ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 - ) - - -(deftype task-info-data (basic) - ((task-id game-task :offset-assert 4) - (task-name game-text-id 4 :offset-assert 8) - (text-index-when-resolved int32 :offset-assert 24) - ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c - ) - - -(deftype level-tasks-info (basic) - ((level-name-id game-text-id :offset-assert 4) - (text-group-index int32 :offset-assert 8) - (nb-of-tasks int32 :offset-assert 12) - (buzzer-task-index int32 :offset-assert 16) - (task-info task-info-data 8 :offset-assert 20) - ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 - ) - - -(deftype game-option (basic) - ((option-type uint64 :offset-assert 8) - (name game-text-id :offset-assert 16) - (scale basic :offset-assert 20) - (param1 float :offset-assert 24) - (param2 float :offset-assert 28) - (param3 int32 :offset-assert 32) - (value-to-modify pointer :offset-assert 36) - ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 - ) - -;; new custom type to extend the very limited progress-menu system -;; the user can only interact with one element at a time, so a single global is sufficient -(deftype progress-menu-list-tracker (basic) - ((direction symbol :offset-assert 4) ; 'left | 'right - (transition? symbol :offset-assert 8) ; '?? - (x-offset int32 :offset-assert 12) - (selected-index int32 :offset-assert 16))) - -;; why a new global? because i dont want to modify the type below....but that would get me what i want as well! -(define *progress-menu-list-tracker* (new 'static 'progress-menu-list-tracker)) - -(deftype progress (process) - ((current-debug-string int32 :offset-assert 112) - (current-debug-language int32 :offset-assert 116) - (current-debug-group int32 :offset-assert 120) - (in-out-position int32 :offset-assert 124) - (display-state progress-screen :offset-assert 128) - (next-display-state progress-screen :offset-assert 136) - (option-index int32 :offset-assert 144) - (selected-option basic :offset-assert 148) - (completion-percentage float :offset-assert 152) - (ready-to-run basic :offset-assert 156) - (display-level-index int32 :offset-assert 160) - (next-level-index int32 :offset-assert 164) - (task-index int32 :offset-assert 168) - (in-transition basic :offset-assert 172) - (last-in-transition basic :offset-assert 176) - (force-transition basic :offset-assert 180) - (stat-transition basic :offset-assert 184) - (level-transition int32 :offset-assert 188) - (language-selection uint64 :offset-assert 192) - ; true = left | false = right - (language-direction symbol :offset-assert 200) - (language-transition symbol :offset-assert 204) - (language-x-offset int32 :offset-assert 208) - (sides-x-scale float :offset-assert 212) - (sides-y-scale float :offset-assert 216) - (left-x-offset int32 :offset-assert 220) - (right-x-offset int32 :offset-assert 224) - (button-scale float :offset-assert 228) - (slot-scale float :offset-assert 232) - (left-side-x-scale float :offset-assert 236) - (left-side-y-scale float :offset-assert 240) - (right-side-x-scale float :offset-assert 244) - (right-side-y-scale float :offset-assert 248) - (small-orb-y-offset int32 :offset-assert 252) - (big-orb-y-offset int32 :offset-assert 256) - (transition-offset int32 :offset-assert 260) - (transition-offset-invert int32 :offset-assert 264) - (transition-percentage float :offset-assert 268) - (transition-percentage-invert float :offset-assert 272) - (transition-speed float :offset-assert 276) - (total-nb-of-power-cells int32 :offset-assert 280) - (total-nb-of-orbs int32 :offset-assert 284) - (total-nb-of-buzzers int32 :offset-assert 288) - (card-info mc-slot-info :offset-assert 292) - (last-option-index-change time-frame :offset-assert 296) - (video-mode-timeout time-frame :offset-assert 304) - (display-state-stack progress-screen 5 :offset-assert 312) - (option-index-stack int32 5 :offset-assert 352) - (display-state-pos int32 :offset-assert 372) - (nb-of-icons int32 :offset-assert 376) - (icons hud-icon 6 :offset-assert 380) - (max-nb-of-particles int32 :offset-assert 404) - (nb-of-particles int32 :offset-assert 408) - (particles hud-particle 40 :offset-assert 412) - (particle-state int32 40 :offset-assert 572) - ) - :heap-base #x270 - :method-count-assert 59 - :size-assert #x2dc - :flag-assert #x3b027002dc - (:methods - (dummy-14 (_type_) none 14) - (dummy-15 (_type_) none 15) - (dummy-16 (_type_) none 16) - (draw-progress (_type_) none 17) - (dummy-18 () none 18) - (dummy-19 (_type_) symbol 19) - (hidden? (_type_) symbol 20) - (adjust-sprites (_type_) none 21) - (adjust-icons (_type_) none 22) - (adjust-ratios (_type_ symbol symbol) none 23) - (draw-fuel-cell-screen (_type_ int) none 24) - (draw-money-screen (_type_ int) none 25) - (draw-buzzer-screen (_type_ int) none 26) - (draw-notice-screen (_type_) none 27) - (draw-options (_type_ int int float) none 28) - (dummy-29 (_type_) none 29) - (respond-progress (_type_) none 30) - (dummy-31 (_type_) none 31) - (dummy-32 (_type_) symbol 32) - (initialize-icons (_type_) none 33) - (initialize-particles (_type_) none 34) - (draw-memcard-storage-error (_type_ font-context) none 35) - (draw-memcard-data-exists (_type_ font-context) none 36) - (draw-memcard-no-data (_type_ font-context) none 37) - (draw-memcard-accessing (_type_ font-context) none 38) - (draw-memcard-insert (_type_ font-context) none 39) - (draw-memcard-file-select (_type_ font-context) none 40) - (draw-memcard-auto-save-error (_type_ font-context) none 41) - (draw-memcard-removed (_type_ font-context) none 42) - (draw-memcard-error (_type_ font-context) none 43) - (dummy-44 (_type_) none 44) - (push! (_type_) none 45) - (pop! (_type_) none 46) - (dummy-47 (_type_) none 47) - (enter! (_type_ progress-screen int) none 48) - (draw-memcard-format (_type_ font-context) none 49) - (draw-auto-save (_type_ font-context) none 50) - (set-transition-progress! (_type_ int) none 51) - (set-transition-speed! (_type_) none 52) - (dummy-53 (_type_ progress-screen) progress-screen 53) - (draw-pal-change-to-60hz (_type_ font-context) none 54) - (draw-pal-now-60hz (_type_ font-context) none 55) - (draw-no-disc (_type_ font-context) none 56) - (draw-bad-disc (_type_ font-context) none 57) - (draw-quit (_type_ font-context) none 58) - ) - (:states - progress-coming-in - progress-debug - progress-going-out - progress-gone - progress-normal - progress-waiting - ) - ) - - -(define *progress-process* (the-as (pointer progress) #f)) - -(define *progress-last-task-index* 0) - -0 - - - - diff --git a/goal_src/pc/engine/ui/progress/progress-draw.gc b/goal_src/pc/engine/ui/progress/progress-draw.gc deleted file mode 100644 index 44c76589f8..0000000000 --- a/goal_src/pc/engine/ui/progress/progress-draw.gc +++ /dev/null @@ -1,2157 +0,0 @@ -;;-*-Lisp-*- -(in-package goal) - -;; name: progress-draw.gc -;; name in dgo: progress-draw -;; dgos: GAME, ENGINE - -;; DECOMP BEGINS - -(defun adjust-pos ((arg0 int) (arg1 int)) - (if (< arg0 arg1) - 0 - (- arg0 arg1) - ) - ) - -(defmethod draw-fuel-cell-screen progress ((obj progress) (arg0 int)) - (local-vars - (sv-112 int) - (sv-128 int) - (sv-144 int) - (sv-160 (function trsqv float quaternion)) - (sv-176 trsqv) - (sv-192 int) - (sv-208 int) - (sv-224 (function string float font-context int none)) - ) - (hide-progress-icons) - (let ((s5-0 (-> *level-task-data* arg0))) - (if (and (= *cheat-mode* 'debug) (cpad-hold? 0 l3)) - (format *stdcon* "fcd:~d~%" (-> *game-info* fuel-cell-deaths)) - ) - (set! (-> *progress-process* 0 particles 14 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 15 init-pos x) -320.0) - (set! (-> *progress-process* 0 icons 4 icon-x) -320) - (when (and (!= s5-0 #f) (= (-> *game-info* level-opened arg0) 1)) - (set! sv-112 (- (-> *task-egg-starting-x* (-> s5-0 nb-of-tasks)) (-> obj left-x-offset))) - (set! sv-128 (the int (* 47.0 (-> obj transition-percentage-invert)))) - 0 - (let ((s0-0 6) - (s2-0 0) - (s4-1 (if (= (-> obj level-transition) 1) - (- (-> obj transition-offset)) - (-> obj transition-offset) - ) - ) - (f30-0 (-> obj transition-percentage-invert)) - (s1-0 0) - (s3-0 #f) - ) - (when (-> obj stat-transition) - (set! sv-128 47) - (set! s2-0 (if (!= (-> obj display-state) (-> obj next-display-state)) - (- (-> obj transition-offset)) - (-> obj transition-offset) - ) - ) - (set! s4-1 0) - (set! f30-0 1.0) - ) - (set! sv-144 0) - (while (< sv-144 4) - (let ((a0-18 (-> obj icons sv-144 icon 0 root))) - (set! sv-176 a0-18) - (set! sv-160 (method-of-object sv-176 set-yaw-angle-clear-roll-pitch!)) - (let ((a1-2 (+ (y-angle a0-18) (* 182.04445 (* 0.5 (-> *display* time-adjust-ratio)))))) - (sv-160 sv-176 a1-2) - ) - ) - (set! sv-144 (+ sv-144 1)) - ) - (set! sv-192 (+ sv-112 (/ (- (* 47 (-> s5-0 nb-of-tasks)) (* sv-128 (-> s5-0 nb-of-tasks))) 2))) - (set! sv-208 0) - (while (< sv-208 (-> s5-0 nb-of-tasks)) - (let ((v0-4 (get-task-status (-> s5-0 task-info sv-208 task-id))) - (v1-59 -1) - (a0-25 #f) - ) - (set! (-> obj particle-state s0-0) 2) - (cond - ((or (= v0-4 (task-status need-hint)) (= v0-4 (task-status unknown))) - (if (= *kernel-boot-message* 'play) - (set! (-> obj particle-state s0-0) 1) - ) - ) - ((= v0-4 (task-status invalid)) - (set! v1-59 (-> s5-0 task-info sv-208 text-index-when-resolved)) - (set! (-> obj particle-state s0-0) 3) - (set! a0-25 #t) - ) - ((= v0-4 (task-status need-introduction)) - (set! v1-59 0) - ) - ((= v0-4 (task-status need-reminder-a)) - (set! v1-59 0) - ) - ((= v0-4 (task-status need-reminder)) - (set! v1-59 1) - ) - ((= v0-4 (task-status need-reward-speech)) - (set! v1-59 2) - ) - ((= v0-4 (task-status need-resolution)) - (set! v1-59 2) - ) - ) - (if (and (!= *kernel-boot-message* 'play) (= v1-59 -1)) - (set! v1-59 0) - ) - (set! (-> obj particles s0-0 init-pos x) (the float (+ sv-192 s2-0))) - (set! (-> obj particles s0-0 init-pos y) (the float (+ s4-1 204))) - (+! s0-0 1) - (when (= sv-208 (-> obj task-index)) - (set! s1-0 v1-59) - (set! s3-0 a0-25) - (set! (-> obj particles 5 init-pos x) (the float (+ sv-192 s2-0))) - (set! (-> obj particles 5 init-pos y) (the float (+ s4-1 204))) - ) - ) - (set! sv-192 (+ sv-192 sv-128)) - (set! sv-208 (+ sv-208 1)) - ) - (dotimes (v1-77 (- 8 (-> s5-0 nb-of-tasks))) - (set! (-> *progress-process* 0 particles s0-0 init-pos x) (the float (+ s2-0 -320))) - (set! (-> obj particles s0-0 init-pos y) (the float (+ s4-1 194))) - (+! s0-0 1) - ) - (when *common-text* - (when (and (!= s1-0 -1) - (> (-> s5-0 nb-of-tasks) 0) - (>= (-> obj task-index) 0) - (< (-> obj task-index) (-> s5-0 nb-of-tasks)) - ) - (let ((s0-1 (new - 'stack - 'font-context - *font-default-matrix* - (- (+ s2-0 32) (-> obj left-x-offset)) - (+ (/ s4-1 2) 125) - 8325000.0 - (font-color yellow-orange) - (font-flags shadow kerning) - ) - ) - ) - (let ((v1-91 s0-1)) - (set! (-> v1-91 width) (the float 328)) - ) - (let ((v1-92 s0-1)) - (set! (-> v1-92 height) (the float 50)) - ) - (let ((v1-93 s0-1)) - (set! (-> v1-93 scale) 0.7) - ) - (set! (-> s0-1 flags) (font-flags shadow kerning middle left large)) - (set! sv-224 print-game-text-scaled) - (let ((a0-47 (lookup-text! *common-text* (-> s5-0 task-info (-> obj task-index) task-name s1-0) #f)) - (a1-57 f30-0) - (a2-15 s0-1) - (a3-2 (the int (* 128.0 f30-0))) - ) - (sv-224 a0-47 a1-57 a2-15 a3-2) - ) - (when s3-0 - (set! (-> s0-1 origin x) (the float (- (+ s2-0 32) (-> obj left-x-offset)))) - (set! (-> s0-1 origin y) (the float (+ (/ s4-1 2) 175))) - (let ((a0-49 s0-1)) - (set! (-> a0-49 color) (font-color lighter-lighter-blue)) - ) - (let ((v1-104 s0-1)) - (set! (-> v1-104 height) (the float 15)) - ) - (let ((v1-105 s0-1)) - (set! (-> v1-105 scale) 0.5) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id task-completed) #f) - f30-0 - s0-1 - (the int (* 128.0 f30-0)) - ) - ) - ) - ) - ) - ) - ) - ) - 0 - (none) - ) - -(defmethod draw-money-screen progress ((obj progress) (arg0 int)) - (hide-progress-icons) - (let* ((v1-1 (/ (-> obj transition-offset) 16)) - (s4-0 (if (= (-> obj level-transition) 1) - (- (-> obj transition-offset)) - (-> obj transition-offset) - ) - ) - (f30-0 (-> obj transition-percentage-invert)) - (s3-0 (- v1-1)) - ) - (when (-> obj stat-transition) - (set! v1-1 (if (!= (-> obj display-state) (-> obj next-display-state)) - (- (-> obj transition-offset)) - (-> obj transition-offset) - ) - ) - (set! s3-0 v1-1) - (set! s4-0 0) - (set! f30-0 1.0) - ) - (set! (-> obj particles 15 init-pos x) (the float (- (+ v1-1 150) (-> obj left-x-offset)))) - (set! (-> obj particles 15 init-pos y) (the float (+ s4-0 214))) - (set! (-> obj icons 4 icon-x) (- (+ v1-1 148) (-> obj left-x-offset))) - (set! (-> obj icons 4 icon-y) (+ (-> obj big-orb-y-offset) s4-0)) - (let ((a0-15 (-> obj icons 4 icon 0 root))) - (set-yaw-angle-clear-roll-pitch! - a0-15 - (- (y-angle a0-15) (* 182.04445 (* 4.0 (-> *display* time-adjust-ratio)))) - ) - ) - (let ((s4-1 - (new - 'stack - 'font-context - *font-default-matrix* - (- (+ s3-0 200) (-> obj left-x-offset)) - (+ (/ s4-0 2) 96) - 8325000.0 - (font-color default) - (font-flags shadow kerning) - ) - ) - ) - (let ((v1-19 s4-1)) - (set! (-> v1-19 width) (the float 328)) - ) - (let ((v1-20 s4-1)) - (set! (-> v1-20 height) (the float 70)) - ) - (set! (-> s4-1 flags) (font-flags shadow kerning large)) - (let ((s3-1 print-game-text-scaled)) - (format - (clear *temp-string*) - "~D/~D" - (-> *game-info* money-per-level arg0) - (-> *game-counts* data arg0 money-count) - ) - (s3-1 *temp-string* f30-0 s4-1 (the int (* 128.0 f30-0))) - ) - (let ((v1-26 s4-1)) - (set! (-> v1-26 width) (the float 428)) - ) - (set! (-> s4-1 origin x) (+ -220.0 (-> s4-1 origin x))) - (set! (-> s4-1 origin y) (+ 40.0 (-> s4-1 origin y))) - (set! (-> s4-1 flags) (font-flags shadow kerning middle large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id total-collected) #f) - (* 0.7 f30-0) - s4-1 - (the int (* 128.0 f30-0)) - ) - (set! (-> s4-1 origin y) (+ 15.0 (-> s4-1 origin y))) - (let ((s5-2 print-game-text-scaled)) - (format (clear *temp-string*) "~D/~D" (the int (-> *game-info* money-total)) (-> obj total-nb-of-orbs)) - (s5-2 *temp-string* f30-0 s4-1 (the int (* 128.0 f30-0))) - ) - ) - ) - 0 - (none) - ) - -(defmethod draw-buzzer-screen progress ((obj progress) (arg0 int)) - (hide-progress-icons) - (let* ((v1-2 (-> *level-task-data* arg0)) - (a0-3 (/ (-> obj transition-offset) 16)) - (s4-0 (if (= (-> obj level-transition) 1) - (- (-> obj transition-offset)) - (-> obj transition-offset) - ) - ) - (f30-0 (-> obj transition-percentage-invert)) - (s3-0 (- a0-3)) - ) - (when (-> obj stat-transition) - (set! a0-3 (if (!= (-> obj display-state) (-> obj next-display-state)) - (- (-> obj transition-offset)) - (-> obj transition-offset) - ) - ) - (set! s3-0 a0-3) - (set! s4-0 0) - (set! f30-0 1.0) - ) - (set! (-> obj particles 14 init-pos x) (the float (- (+ a0-3 150) (-> obj left-x-offset)))) - (set! (-> obj particles 14 init-pos y) (the float (+ s4-0 214))) - (let ((s2-0 0)) - (let ((a1-8 (-> v1-2 buzzer-task-index))) - (if (!= a1-8 -1) - (set! s2-0 (buzzer-count *game-info* (-> v1-2 task-info a1-8 task-id))) - ) - ) - (let ((s4-1 - (new - 'stack - 'font-context - *font-default-matrix* - (- (+ s3-0 200) (-> obj left-x-offset)) - (+ (/ s4-0 2) 96) - 8325000.0 - (font-color default) - (font-flags shadow kerning) - ) - ) - ) - (let ((v1-9 s4-1)) - (set! (-> v1-9 width) (the float 328)) - ) - (let ((v1-10 s4-1)) - (set! (-> v1-10 height) (the float 70)) - ) - (set! (-> s4-1 flags) (font-flags shadow kerning large)) - (let ((s3-1 print-game-text-scaled)) - (format (clear *temp-string*) "~D/~D" s2-0 (-> *game-counts* data arg0 buzzer-count)) - (s3-1 *temp-string* f30-0 s4-1 (the int (* 128.0 f30-0))) - ) - (let ((v1-14 s4-1)) - (set! (-> v1-14 width) (the float 428)) - ) - (set! (-> s4-1 origin x) (+ -220.0 (-> s4-1 origin x))) - (set! (-> s4-1 origin y) (+ 40.0 (-> s4-1 origin y))) - (set! (-> s4-1 flags) (font-flags shadow kerning middle large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id total-collected) #f) - (* 0.7 f30-0) - s4-1 - (the int (* 128.0 f30-0)) - ) - (set! (-> s4-1 origin y) (+ 15.0 (-> s4-1 origin y))) - (let ((s5-2 print-game-text-scaled)) - (format (clear *temp-string*) "~D/~D" (the int (-> *game-info* buzzer-total)) (-> obj total-nb-of-buzzers)) - (s5-2 *temp-string* f30-0 s4-1 (the int (* 128.0 f30-0))) - ) - ) - ) - ) - 0 - (none) - ) - -(defmethod draw-memcard-storage-error progress ((obj progress) (arg0 font-context)) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.55) - ) - (let ((v1-1 arg0)) - (set! (-> v1-1 width) (the float 265)) - ) - (let ((v1-2 arg0)) - (set! (-> v1-2 height) (the float 55)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (let ((s4-0 (game-text-id card-not-formatted-title))) - (case (-> obj display-state) - (((progress-screen memcard-no-space)) - (set! s4-0 (game-text-id memcard-no-space)) - ) - (((progress-screen memcard-not-inserted)) - (set! s4-0 (game-text-id memcard-not-inserted)) - ) - ) - (let ((s3-0 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* s4-0 #f) 1) - (s3-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 70.0) - (let ((v1-12 arg0)) - (set! (-> v1-12 width) (the float 350)) - ) - (let ((v1-13 arg0)) - (set! (-> v1-13 height) (the float 40)) - ) - (let ((s4-1 print-game-text-scaled)) - (format - (clear *temp-string*) - (lookup-text! *common-text* (game-text-id memcard-space-requirement1) #f) - (if (-> obj card-info) - (-> obj card-info mem-required) - 0 - ) - ) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - (set! (-> arg0 origin y) 115.0) - (let ((v1-17 arg0)) - (set! (-> v1-17 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id memcard-space-requirement2) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (let ((v1-19 arg0)) - (set! (-> v1-19 scale) 0.65) - ) - (set! (-> arg0 origin y) 160.0) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-memcard-format progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin y) 35.0) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.55) - ) - (let ((v1-1 arg0)) - (set! (-> v1-1 width) (the float 265)) - ) - (let ((v1-2 arg0)) - (set! (-> v1-2 height) (the float 55)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (let ((s4-0 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id card-not-formatted-title) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 105.0) - (let ((v1-7 arg0)) - (set! (-> v1-7 width) (the float 360)) - ) - (let ((v1-8 arg0)) - (set! (-> v1-8 height) (the float 40)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id card-not-formatted-msg) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (let ((v1-10 arg0)) - (set! (-> v1-10 scale) 0.65) - ) - (set! (-> arg0 origin y) 138.0) - (let ((v1-11 arg0)) - (set! (-> v1-11 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id format?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-memcard-data-exists progress ((obj progress) (arg0 font-context)) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.65) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 55.0) - (let ((v1-4 arg0)) - (set! (-> v1-4 width) (the float 365)) - ) - (let ((v1-5 arg0)) - (set! (-> v1-5 height) (the float 75)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id save-data-already-exists) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin y) 140.0) - (let ((v1-7 arg0)) - (set! (-> v1-7 width) (the float 360)) - ) - (let ((v1-8 arg0)) - (set! (-> v1-8 height) (the float 40)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id overwrite?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-memcard-no-data progress ((obj progress) (arg0 font-context)) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.65) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 40.0) - (let ((v1-4 arg0)) - (set! (-> v1-4 width) (the float 365)) - ) - (let ((v1-5 arg0)) - (set! (-> v1-5 height) (the float 75)) - ) - (let ((s4-0 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id no-save-data) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - (set! (-> arg0 origin y) 130.0) - (let ((v1-7 arg0)) - (set! (-> v1-7 width) (the float 360)) - ) - (let ((v1-8 arg0)) - (set! (-> v1-8 height) (the float 40)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id create-save-data?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-memcard-accessing progress ((obj progress) (arg0 font-context)) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 1.0) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 35.0) - (let ((v1-4 arg0)) - (set! (-> v1-4 width) (the float 365)) - ) - (let ((v1-5 arg0)) - (set! (-> v1-5 height) (the float 75)) - ) - (when (or (< (mod (-> *display* real-frame-counter) 300) 150) (!= (-> obj transition-percentage-invert) 1.0)) - (let ((a1-1 (game-text-id loading-data))) - (case (-> obj display-state) - (((progress-screen memcard-saving)) - (set! a1-1 (game-text-id saving-data)) - ) - (((progress-screen memcard-formatting)) - (set! a1-1 (game-text-id formatting)) - ) - (((progress-screen memcard-creating)) - (set! a1-1 (game-text-id creating-save-data)) - ) - ) - (print-game-text-scaled (lookup-text! *common-text* a1-1 #f) (-> obj transition-percentage-invert) arg0 128) - ) - ) - (let ((v1-18 arg0)) - (set! (-> v1-18 scale) 0.65) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 15 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 100.0) - (let ((v1-22 arg0)) - (set! (-> v1-22 width) (the float 370)) - ) - (let ((v1-23 arg0)) - (set! (-> v1-23 height) (the float 75)) - ) - (let ((s4-1 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id do-not-remove-mem-card) #f) 1) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - 0 - (none) - ) - -(defmethod draw-memcard-insert progress ((obj progress) (arg0 font-context)) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.65) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 35.0) - (let ((v1-4 arg0)) - (set! (-> v1-4 width) (the float 310)) - ) - (let ((v1-5 arg0)) - (set! (-> v1-5 height) (the float 110)) - ) - (let ((s4-0 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id insert-memcard) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - (let ((v1-7 arg0)) - (set! (-> v1-7 scale) 0.65) - ) - (set! (-> arg0 origin y) 130.0) - (let ((v1-8 arg0)) - (set! (-> v1-8 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id back?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-memcard-file-select progress ((obj progress) (arg0 font-context)) - (local-vars - (sv-16 (function _varargs_ object)) - (sv-32 (function _varargs_ object)) - (sv-48 (function _varargs_ object)) - (sv-64 (function _varargs_ object)) - (sv-80 (function _varargs_ object)) - (sv-96 (function _varargs_ object)) - (sv-112 (function _varargs_ object)) - (sv-128 (function _varargs_ object)) - (sv-144 (function _varargs_ object)) - ) - (let ((s4-0 (* (+ (-> obj transition-offset) -256) 2))) - (if (< s4-0 0) - (set! s4-0 0) - ) - (if (< 500 s4-0) - (set! s4-0 700) - ) - (set! (-> obj particles 19 init-pos x) (the float (- (- 202 (adjust-pos s4-0 150)) (-> obj left-x-offset)))) - (set! (-> obj particles 20 init-pos x) (the float (- (+ (adjust-pos s4-0 100) 202) (-> obj left-x-offset)))) - (set! (-> obj particles 21 init-pos x) (the float (- (- 202 (adjust-pos s4-0 50)) (-> obj left-x-offset)))) - (set! (-> obj particles 22 init-pos x) (the float (- (+ s4-0 202) (-> obj left-x-offset)))) - ) - (cond - ((= (-> *setting-control* current video-mode) 'pal) - (set! (-> obj particles 21 init-pos y) 256.0) - (set! (-> obj particles 22 init-pos y) 338.0) - ) - (else - (set! (-> obj particles 21 init-pos y) 255.0) - (set! (-> obj particles 22 init-pos y) 336.0) - ) - ) - (let ((f0-13 (* 2.0 (+ -0.5 (-> obj transition-percentage-invert))))) - 128 - (if (< f0-13 0.0) - (set! f0-13 0.0) - ) - (let ((s4-1 (the int (* 128.0 f0-13)))) - (let ((v1-29 arg0)) - (set! (-> v1-29 scale) 0.5) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 102 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 5.0) - (let ((v1-33 arg0)) - (set! (-> v1-33 width) (the float 200)) - ) - (let ((v1-34 arg0)) - (set! (-> v1-34 height) (the float 20)) - ) - (print-game-text - (lookup-text! - *common-text* - (the-as game-text-id (if (= (-> obj display-state) (progress-screen load-game)) - 321 - 320 - ) - ) - #f - ) - arg0 - #f - s4-1 - 22 - ) - (set! (-> arg0 origin y) 26.0) - (let ((v1-37 arg0)) - (set! (-> v1-37 height) (the float 20)) - ) - (let ((s3-3 (-> obj card-info)) - (s2-0 23) - ) - (dotimes (s1-0 4) - (set! (-> arg0 origin x) (the float (- 41 (-> obj left-x-offset)))) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (let ((a0-17 arg0)) - (set! (-> a0-17 color) (font-color default)) - ) - (let ((v1-42 arg0)) - (set! (-> v1-42 width) (the float 320)) - ) - (cond - ((and s3-3 (= (-> s3-3 formatted) 1) (= (-> s3-3 inited) 1) (= (-> s3-3 file s1-0 present) 1)) - (set! (-> obj particles s2-0 init-pos x) (the float (- 66 (-> obj left-x-offset)))) - (let ((v1-57 arg0)) - (set! (-> v1-57 scale) 0.6) - ) - (if (and (< (-> s3-3 file s1-0 level-index) (length *level-task-data-remap*)) - (> (-> s3-3 file s1-0 level-index) 0) - ) - (print-game-text - (lookup-text! - *common-text* - (-> *level-task-data* (-> *level-task-data-remap* (+ (-> s3-3 file s1-0 level-index) -1)) level-name-id) - #f - ) - arg0 - #f - s4-1 - 22 - ) - (print-game-text "OLD SAVE GAME" arg0 #f s4-1 22) - ) - (let ((a0-28 arg0)) - (set! (-> a0-28 color) (font-color blue-white)) - ) - (cond - ((or (>= (seconds 2) (- (-> *display* real-frame-counter) (-> obj last-option-index-change))) - (or (< (mod (- (-> *display* real-frame-counter) (-> obj last-option-index-change)) 1200) 600) - (!= (-> obj option-index) s1-0) - (-> obj in-transition) - ) - ) - (let ((v1-87 arg0)) - (set! (-> v1-87 scale) 0.5) - ) - (set! (-> arg0 origin y) (+ 16.0 (-> arg0 origin y))) - (set! (-> arg0 flags) (font-flags shadow kerning middle large)) - (set! (-> arg0 origin x) (the float (- -73 (-> obj left-x-offset)))) - (let ((v1-91 arg0)) - (set! (-> v1-91 width) (the float 350)) - ) - (let ((s0-2 print-game-text)) - (set! sv-16 format) - (let ((a0-40 (clear *temp-string*)) - (a1-13 "~D") - (a2-5 (the int (-> s3-3 file s1-0 fuel-cell-count))) - ) - (sv-16 a0-40 a1-13 a2-5) - ) - (s0-2 *temp-string* arg0 #f s4-1 22) - ) - (set! (-> arg0 origin x) (the float (- 1 (-> obj left-x-offset)))) - (let ((s0-3 print-game-text)) - (set! sv-32 format) - (let ((a0-44 (clear *temp-string*)) - (a1-15 "~D") - (a2-7 (the int (-> s3-3 file s1-0 money-count))) - ) - (sv-32 a0-44 a1-15 a2-7) - ) - (s0-3 *temp-string* arg0 #f s4-1 22) - ) - (set! (-> arg0 origin x) (the float (- 79 (-> obj left-x-offset)))) - (let ((s0-4 print-game-text)) - (set! sv-48 format) - (let ((a0-48 (clear *temp-string*)) - (a1-17 "~D") - (a2-9 (the int (-> s3-3 file s1-0 buzzer-count))) - ) - (sv-48 a0-48 a1-17 a2-9) - ) - (s0-4 *temp-string* arg0 #f s4-1 22) - ) - (set! (-> arg0 origin y) (+ 1.0 (-> arg0 origin y))) - (let ((v1-108 arg0)) - (set! (-> v1-108 scale) 1.0) - ) - (set! (-> arg0 flags) (font-flags shadow kerning right large)) - (set! (-> arg0 origin x) (the float (- 352 (-> obj left-x-offset)))) - (let ((s0-5 print-game-text)) - (set! sv-64 format) - (let ((a0-52 (clear *temp-string*)) - (a1-19 "~D%") - (a2-11 (the int (-> s3-3 file s1-0 completion-percentage))) - ) - (sv-64 a0-52 a1-19 a2-11) - ) - (s0-5 *temp-string* arg0 #f s4-1 22) - ) - (let ((v1-116 arg0)) - (set! (-> v1-116 scale) 0.5) - ) - (set! (-> arg0 origin y) (+ 9.0 (-> arg0 origin y))) - (set! (-> arg0 flags) (font-flags shadow kerning large)) - (set! (-> arg0 origin x) (the float (- 85 (-> obj left-x-offset)))) - (let ((s0-6 print-game-text)) - (set! sv-80 format) - (let ((a0-56 (clear *temp-string*)) - (a1-21 "/~D") - (a2-17 (if (< 100 (the int (-> s3-3 file s1-0 fuel-cell-count))) - (-> obj total-nb-of-power-cells) - 100 - ) - ) - ) - (sv-80 a0-56 a1-21 a2-17) - ) - (s0-6 *temp-string* arg0 #f s4-1 22) - ) - (set! (-> arg0 origin x) (the float (- 150 (-> obj left-x-offset)))) - (let ((s0-7 print-game-text)) - (set! sv-96 format) - (let ((a0-60 (clear *temp-string*)) - (a1-23 "/~D") - (a2-19 (-> obj total-nb-of-orbs)) - ) - (sv-96 a0-60 a1-23 a2-19) - ) - (s0-7 *temp-string* arg0 #f s4-1 22) - ) - (set! (-> arg0 origin x) (the float (- 238 (-> obj left-x-offset)))) - (let ((s0-8 print-game-text)) - (set! sv-112 format) - (let ((a0-64 (clear *temp-string*)) - (a1-25 "/~D") - (a2-21 (-> obj total-nb-of-buzzers)) - ) - (sv-112 a0-64 a1-25 a2-21) - ) - (s0-8 *temp-string* arg0 #f s4-1 22) - ) - (set! (-> arg0 origin y) (+ 15.0 (-> arg0 origin y))) - ) - (else - (set! (-> arg0 origin y) (+ 18.0 (-> arg0 origin y))) - (set! (-> arg0 origin x) (the float (- 28 (-> obj left-x-offset)))) - (let ((v1-131 arg0)) - (set! (-> v1-131 scale) 0.8) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle large)) - (let ((v1-133 arg0)) - (set! (-> v1-133 width) (the float 350)) - ) - (cond - ((= (scf-get-territory) 1) - (let ((s0-10 print-game-text)) - (set! sv-128 format) - (let ((a0-69 (clear *temp-string*)) - (a1-27 "~X/~X/20~2X ~2X:~2X") - (a2-23 (-> s3-3 file s1-0 day)) - (a3-10 (-> s3-3 file s1-0 month)) - (t0-10 (-> s3-3 file s1-0 year)) - (t1-0 (-> s3-3 file s1-0 hour)) - (t2-0 (-> s3-3 file s1-0 minute)) - ) - (sv-128 a0-69 a1-27 a2-23 a3-10 t0-10 t1-0 t2-0) - ) - (s0-10 *temp-string* arg0 #f s4-1 22) - ) - ) - (else - (let ((s0-11 print-game-text)) - (set! sv-144 format) - (let ((a0-72 (clear *temp-string*)) - (a1-29 "~X/~X/20~2X ~2X:~2X") - (a2-25 (-> s3-3 file s1-0 month)) - (a3-12 (-> s3-3 file s1-0 day)) - (t0-12 (-> s3-3 file s1-0 year)) - (t1-1 (-> s3-3 file s1-0 hour)) - (t2-1 (-> s3-3 file s1-0 minute)) - ) - (sv-144 a0-72 a1-29 a2-25 a3-12 t0-12 t1-1 t2-1) - ) - (s0-11 *temp-string* arg0 #f s4-1 22) - ) - ) - ) - (set! (-> obj particles s2-0 init-pos x) -320.0) - (set! (-> arg0 origin y) (+ 23.0 (-> arg0 origin y))) - ) - ) - ) - (else - (set! (-> obj particles s2-0 init-pos x) -320.0) - (set! (-> arg0 origin y) (+ 12.0 (-> arg0 origin y))) - (let ((v1-173 arg0)) - (set! (-> v1-173 scale) 0.7) - ) - (print-game-text (lookup-text! *common-text* (game-text-id empty) #f) arg0 #f s4-1 22) - (set! (-> arg0 origin y) (+ 29.0 (-> arg0 origin y))) - ) - ) - (+! s2-0 1) - ) - ) - ) - ) - 0 - (none) - ) - -(defmethod draw-memcard-auto-save-error progress ((obj progress) (arg0 font-context)) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.6) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 70 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 5.0) - (let ((v1-4 arg0)) - (set! (-> v1-4 width) (the float 265)) - ) - (let ((v1-5 arg0)) - (set! (-> v1-5 height) (the float 35)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id error-saving) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 34.0) - (let ((v1-9 arg0)) - (set! (-> v1-9 width) (the float 360)) - ) - (let ((v1-10 arg0)) - (set! (-> v1-10 height) (the float 50)) - ) - (let ((s4-1 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id check-memcard) #f) 1) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - (set! (-> arg0 origin y) 89.0) - (let ((v1-12 arg0)) - (set! (-> v1-12 width) (the float 360)) - ) - (let ((v1-13 arg0)) - (set! (-> v1-13 height) (the float 20)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id autosave-disabled-title) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin y) 118.0) - (let ((v1-15 arg0)) - (set! (-> v1-15 width) (the float 360)) - ) - (let ((v1-16 arg0)) - (set! (-> v1-16 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id autosave-disabled-msg) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (let ((v1-18 arg0)) - (set! (-> v1-18 scale) 0.65) - ) - (set! (-> arg0 origin y) 160.0) - (let ((v1-19 arg0)) - (set! (-> v1-19 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-memcard-removed progress ((obj progress) (arg0 font-context)) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.6) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 70 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 10.0) - (let ((v1-4 arg0)) - (set! (-> v1-4 width) (the float 265)) - ) - (let ((v1-5 arg0)) - (set! (-> v1-5 height) (the float 55)) - ) - (let ((s4-0 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id memcard-removed) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 78.0) - (let ((v1-9 arg0)) - (set! (-> v1-9 width) (the float 360)) - ) - (let ((v1-10 arg0)) - (set! (-> v1-10 height) (the float 20)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id autosave-disabled-title) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin y) 112.0) - (let ((v1-12 arg0)) - (set! (-> v1-12 width) (the float 360)) - ) - (let ((v1-13 arg0)) - (set! (-> v1-13 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id autosave-disabled-msg) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (let ((v1-15 arg0)) - (set! (-> v1-15 scale) 0.65) - ) - (set! (-> arg0 origin y) 160.0) - (let ((v1-16 arg0)) - (set! (-> v1-16 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-memcard-error progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin y) 15.0) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.7) - ) - (let ((v1-1 arg0)) - (set! (-> v1-1 width) (the float 265)) - ) - (let ((v1-2 arg0)) - (set! (-> v1-2 height) (the float 55)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (let ((s4-0 (game-text-id error-loading))) - (case (-> obj display-state) - (((progress-screen memcard-error-saving)) - (set! s4-0 (game-text-id error-saving)) - ) - (((progress-screen memcard-error-formatting)) - (set! s4-0 (game-text-id error-formatting)) - ) - (((progress-screen memcard-error-creating)) - (set! s4-0 (game-text-id error-creating-data)) - ) - ) - (let ((s3-0 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* s4-0 #f) 1) - (s3-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 80.0) - (let ((v1-13 arg0)) - (set! (-> v1-13 width) (the float 360)) - ) - (let ((v1-14 arg0)) - (set! (-> v1-14 height) (the float 70)) - ) - (let ((s4-1 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id check-memcard-and-retry) #f) 1) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - (let ((v1-16 arg0)) - (set! (-> v1-16 scale) 0.65) - ) - (set! (-> arg0 origin y) 155.0) - (let ((v1-17 arg0)) - (set! (-> v1-17 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-auto-save progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 35 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 18.0) - (let ((v1-2 arg0)) - (set! (-> v1-2 scale) 0.6) - ) - (let ((v1-3 arg0)) - (set! (-> v1-3 width) (the float 330)) - ) - (let ((v1-4 arg0)) - (set! (-> v1-4 height) (the float 60)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id autosave-warn-title) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin x) (the float (- 15 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 110.0) - (let ((v1-9 arg0)) - (set! (-> v1-9 width) (the float 370)) - ) - (let ((v1-10 arg0)) - (set! (-> v1-10 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id autosave-warn-msg) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (let ((v1-12 arg0)) - (set! (-> v1-12 scale) 0.65) - ) - (set! (-> arg0 origin y) 175.0) - (let ((v1-13 arg0)) - (set! (-> v1-13 height) (the float 20)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> *progress-process* 0 particles 31 init-pos y) (the float (if (= (get-aspect-ratio) 'aspect16x9) - 170 - 180 - ) - ) - ) - (set! (-> *progress-process* 0 particles 31 init-pos x) - (the float - (- (if (or (< (mod (-> *display* real-frame-counter) 300) 270) (!= (-> obj transition-percentage-invert) 1.0)) - 205 - -320 - ) - (-> obj left-x-offset) - ) - ) - ) - 0 - (none) - ) - -(defmethod draw-pal-change-to-60hz progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 20.0) - (let ((v1-2 arg0)) - (set! (-> v1-2 scale) 0.6) - ) - (let ((v1-3 arg0)) - (set! (-> v1-3 width) (the float 300)) - ) - (let ((v1-4 arg0)) - (set! (-> v1-4 height) (the float 40)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id screen-change-to-60hz) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin x) (the float (- 15 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 60.0) - (let ((v1-9 arg0)) - (set! (-> v1-9 width) (the float 370)) - ) - (let ((v1-10 arg0)) - (set! (-> v1-10 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id screen-60hz-warn-support) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin y) 120.0) - (let ((v1-12 arg0)) - (set! (-> v1-12 height) (the float 50)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id screen-60hz-warn-timer) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (let ((v1-14 arg0)) - (set! (-> v1-14 scale) 0.65) - ) - (set! (-> arg0 origin y) 175.0) - (let ((v1-15 arg0)) - (set! (-> v1-15 height) (the float 20)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-no-disc progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 50.0) - (let ((v1-2 arg0)) - (set! (-> v1-2 scale) 0.6) - ) - (let ((v1-3 arg0)) - (set! (-> v1-3 width) (the float 300)) - ) - (let ((v1-4 arg0)) - (set! (-> v1-4 height) (the float 40)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id no-disc-title) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 90.0) - (let ((v1-9 arg0)) - (set! (-> v1-9 width) (the float 360)) - ) - (let ((v1-10 arg0)) - (set! (-> v1-10 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id no-disc-msg) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (when (is-cd-in?) - (let ((v1-13 arg0)) - (set! (-> v1-13 scale) 0.65) - ) - (set! (-> arg0 origin y) 155.0) - (let ((v1-14 arg0)) - (set! (-> v1-14 height) (the float 20)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - ) - 0 - (none) - ) - -(defmethod draw-bad-disc progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 50.0) - (let ((v1-2 arg0)) - (set! (-> v1-2 scale) 0.6) - ) - (let ((v1-3 arg0)) - (set! (-> v1-3 width) (the float 300)) - ) - (let ((v1-4 arg0)) - (set! (-> v1-4 height) (the float 40)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id bad-disc-title) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 90.0) - (let ((v1-9 arg0)) - (set! (-> v1-9 width) (the float 360)) - ) - (let ((v1-10 arg0)) - (set! (-> v1-10 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id bad-disc-msg) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (let ((v1-12 arg0)) - (set! (-> v1-12 scale) 0.65) - ) - (set! (-> arg0 origin y) 155.0) - (let ((v1-13 arg0)) - (set! (-> v1-13 height) (the float 20)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-quit progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 70.0) - (let ((v1-2 arg0)) - (set! (-> v1-2 scale) 0.6) - ) - (let ((v1-3 arg0)) - (set! (-> v1-3 width) (the float 300)) - ) - (let ((v1-4 arg0)) - (set! (-> v1-4 height) (the float 40)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id quit?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-pal-now-60hz progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 45.0) - (let ((v1-2 arg0)) - (set! (-> v1-2 scale) 0.6) - ) - (let ((v1-3 arg0)) - (set! (-> v1-3 width) (the float 300)) - ) - (let ((v1-4 arg0)) - (set! (-> v1-4 height) (the float 50)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id screen-now-60hz) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin y) 95.0) - (let ((v1-7 arg0)) - (set! (-> v1-7 height) (the float 50)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id screen-60hz-keep?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-notice-screen progress ((obj progress)) - (hide-progress-icons) - (when *common-text* - (let ((a1-1 (new - 'stack - 'font-context - *font-default-matrix* - (- 70 (-> obj left-x-offset)) - 10 - 0.0 - (font-color default) - (font-flags shadow kerning) - ) - ) - ) - (case (-> obj display-state) - (((progress-screen memcard-format)) - (draw-memcard-format obj a1-1) - ) - (((progress-screen memcard-no-space) - (progress-screen memcard-not-inserted) - (progress-screen memcard-not-formatted) - ) - (draw-memcard-storage-error obj a1-1) - ) - (((progress-screen memcard-data-exists)) - (draw-memcard-data-exists obj a1-1) - ) - (((progress-screen memcard-no-data)) - (draw-memcard-no-data obj a1-1) - ) - (((progress-screen memcard-loading) - (progress-screen memcard-saving) - (progress-screen memcard-formatting) - (progress-screen memcard-creating) - ) - (draw-memcard-accessing obj a1-1) - ) - (((progress-screen memcard-insert)) - (draw-memcard-insert obj a1-1) - ) - (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) - (draw-memcard-file-select obj a1-1) - ) - (((progress-screen memcard-auto-save-error)) - (draw-memcard-auto-save-error obj a1-1) - ) - (((progress-screen memcard-removed)) - (draw-memcard-removed obj a1-1) - ) - (((progress-screen memcard-error-loading) - (progress-screen memcard-error-saving) - (progress-screen memcard-error-formatting) - (progress-screen memcard-error-creating) - ) - (draw-memcard-error obj a1-1) - ) - (((progress-screen auto-save)) - (draw-auto-save obj a1-1) - ) - (((progress-screen pal-change-to-60hz)) - (draw-pal-change-to-60hz obj a1-1) - ) - (((progress-screen pal-now-60hz)) - (draw-pal-now-60hz obj a1-1) - ) - (((progress-screen no-disc)) - (draw-no-disc obj a1-1) - ) - (((progress-screen bad-disc)) - (draw-bad-disc obj a1-1) - ) - (((progress-screen quit)) - (draw-quit obj a1-1) - ) - ) - ) - ) - 0 - (none) - ) - -(defun draw-percent-bar ((arg0 int) (arg1 int) (arg2 float) (arg3 int)) - (let* ((s2-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (gp-0 (-> s2-0 base)) - ) - (draw-sprite2d-xy s2-0 arg0 arg1 255 14 (new 'static 'rgba :a #x60)) - (draw-sprite2d-xy s2-0 arg0 (+ arg1 2) (the int (* 255.0 arg2)) 10 (the-as rgba arg3)) - (let ((a3-3 (-> s2-0 base))) - (let ((v1-3 (the-as dma-packet (-> s2-0 base)))) - (set! (-> v1-3 dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> v1-3 vif0) (new 'static 'vif-tag)) - (set! (-> v1-3 vif1) (new 'static 'vif-tag)) - (set! (-> s2-0 base) (&+ (the-as pointer v1-3) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id sprite) - gp-0 - (the-as (pointer dma-tag) a3-3) - ) - ) - ) - 0 - (none) - ) - -(defun print-list-item-name ((arg0 int) (arg1 font-context) (arg2 int) (arg3 symbol) (name-list (array game-text-id))) - (let ((s5-0 (if arg3 - arg2 - (- arg2) - ) - ) - ) - (+! (-> arg1 origin x) (the float s5-0)) - (let ((f30-0 (- 1.0 (* 0.0033333334 (the float arg2))))) - (print-game-text-scaled - (lookup-text! *common-text* (-> name-list arg0) #f) - f30-0 - arg1 - (the int (* 128.0 f30-0)) - ) - ) - (set! (-> arg1 origin x) (- (-> arg1 origin x) (the float s5-0))) - ) - (set! (-> arg1 color) (font-color default)) - arg1 - ) - - -(defun draw-options-list ((obj progress) - (font-ctx font-context) - (something-unknown int) - (name-list (array game-text-id))) - "Given a progress object, draw it's arbitrarily sized list of options. This is option-type `1`" - (local-vars - (list-size int) - (curr-selection-index int) - (unknown-modified-index int) - (unknown-modified-index-2 int) - (unknown-modified-index-3 int) - (unknown-modified-index-4 int) - (screen-arr (array game-option))) - - (set! list-size (length name-list)) - (set! screen-arr (-> *options-remap* (-> obj display-state))) - (set! curr-selection-index (-> *progress-menu-list-tracker* selected-index)) - (if (-> *progress-menu-list-tracker* transition?) - (set! (-> *progress-menu-list-tracker* x-offset) - (seekl (-> *progress-menu-list-tracker* x-offset) - 200 - (the int (* 10.0 (-> *display* time-adjust-ratio)))))) - - (when (>= (-> *progress-menu-list-tracker* x-offset) 100) - (set! (-> *progress-menu-list-tracker* transition?) #f) - (set! (-> *progress-menu-list-tracker* x-offset) 0)) - - (set! (-> font-ctx origin y) (the float (+ something-unknown 3))) - (set! (-> font-ctx color) (font-color lighter-lighter-blue)) - (set! unknown-modified-index (mod (+ curr-selection-index 1) list-size)) - - (let ((unknown-modified-index-2 (mod (+ list-size -1 curr-selection-index) list-size)) - (unknown-modified-index-3 (mod (the-as int (+ curr-selection-index 2)) list-size))) - (set! unknown-modified-index-4 (mod (+ list-size -2 curr-selection-index) list-size)) - ; cleanup this logic, doesnt have to all be conds - (cond - ((= (-> *progress-menu-list-tracker* direction) 'left) - (let ((a2-22 (- 200 (+ (-> *progress-menu-list-tracker* x-offset) 100)))) - (print-list-item-name unknown-modified-index-2 font-ctx a2-22 #f name-list)) - (let ((a2-23 (+ (-> *progress-menu-list-tracker* x-offset) 100))) - (if (< a2-23 150) - (print-list-item-name unknown-modified-index font-ctx a2-23 #t name-list) - (print-list-item-name unknown-modified-index-4 font-ctx (- 200 (-> *progress-menu-list-tracker* x-offset)) #f name-list)))) - (else - (let ((a2-25 (+ (-> *progress-menu-list-tracker* x-offset) 100))) - (cond - ((< a2-25 150) - (print-list-item-name unknown-modified-index-2 font-ctx a2-25 #f name-list)) - (else - (let ((a2-26 (- 200 (-> *progress-menu-list-tracker* x-offset)))) - (print-list-item-name unknown-modified-index-3 font-ctx a2-26 #t name-list))))) - (let ((a2-27 (- 200 (+ (-> *progress-menu-list-tracker* x-offset) 100)))) - (print-list-item-name unknown-modified-index font-ctx a2-27 #t name-list))))) - (when (not (-> *progress-menu-list-tracker* transition?)) - (let ((a0-75 font-ctx)) - (set! (-> a0-75 color) (font-color yellow-green-2)))) - (print-list-item-name (the-as int curr-selection-index) - font-ctx - (-> *progress-menu-list-tracker* x-offset) - (-> *progress-menu-list-tracker* direction) - name-list)) - - -(defmethod draw-options progress ((obj progress) (arg0 int) (arg1 int) (arg2 float)) - (local-vars - (font-ctx font-context) - (sv-128 int) - (sv-144 int) - (sv-160 (function _varargs_ object)) - (sv-176 string) - (sv-192 string) - (sv-208 string) - (sv-224 (function _varargs_ object)) - (sv-240 string) - (sv-256 string) - (sv-272 string) - (sv-288 (function string font-context symbol int int float)) - (sv-304 (function _varargs_ object)) - (sv-320 (function _varargs_ object)) - (sv-336 string) - (sv-352 string) - (sv-368 string) - (sv-384 (function _varargs_ object)) - (sv-400 string) - (sv-416 string) - (sv-432 string) - (sv-448 uint) - (sv-464 int) - (sv-480 int) - (sv-496 int) - (sv-512 uint) - (sv-528 (function _varargs_ object)) - (sv-544 string) - (sv-560 string) - (sv-576 string) - (sv-592 (function _varargs_ object)) - (sv-608 string) - (sv-624 string) - (sv-640 string) - (sv-656 (function _varargs_ object)) - (sv-672 string) - (sv-688 string) - (sv-704 string) - (sv-720 (function _varargs_ object)) - (sv-736 string) - (sv-752 string) - (sv-768 string) - (sv-784 (function _varargs_ object)) - (sv-800 string) - (sv-816 string) - (sv-832 string) - (sv-848 (function _varargs_ object)) - (sv-864 string) - (sv-880 string) - (sv-896 string) - (sv-912 string) - ) - (let ((s3-0 (-> *options-remap* (-> obj display-state)))) - (when s3-0 - (let ((s2-1 (- arg0 (/ (* arg1 (length s3-0)) 2))) - (s1-0 0) - ) - 27 - 0 - (set! font-ctx - (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) - ) - (let ((v1-11 font-ctx)) - (set! (-> v1-11 width) (the float 350)) - ) - (let ((v1-12 font-ctx)) - (set! (-> v1-12 height) (the float 25)) - ) - (set! (-> font-ctx flags) (font-flags shadow kerning middle left large)) - (dotimes (s0-0 (length s3-0)) - (set! sv-912 (the-as string #f)) - (set! sv-128 27) - (set! sv-144 s2-1) - (let ((v1-18 (-> s3-0 s0-0 option-type))) - (cond - ((= v1-18 7) - (cond - ((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (set! sv-160 format) - (set! sv-176 (clear *temp-string*)) - (set! sv-192 "~30L~S~0L ~S") - (set! sv-208 (lookup-text! *common-text* (game-text-id yes) #f)) - (let ((a3-2 (lookup-text! *common-text* (game-text-id no) #f))) - (sv-160 sv-176 sv-192 sv-208 a3-2) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-224 format) - (set! sv-240 (clear *temp-string*)) - (set! sv-256 "~0L~S ~30L~S~1L") - (set! sv-272 (lookup-text! *common-text* (game-text-id yes) #f)) - (let ((a3-3 (lookup-text! *common-text* (game-text-id no) #f))) - (sv-224 sv-240 sv-256 sv-272 a3-3) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - ) - ) - ((or (= v1-18 6) (= v1-18 8)) - (cond - ((nonzero? (-> s3-0 s0-0 name)) - (set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - sv-912 - ) - (else - (set! sv-912 (the-as string #f)) - (the-as symbol sv-912) - ) - ) - ) - ((and (-> obj selected-option) (= (-> obj option-index) s0-0)) - (let ((a0-19 font-ctx)) - (set! (-> a0-19 color) (font-color default)) - ) - (set! (-> font-ctx origin x) (the float (- sv-128 (-> obj left-x-offset)))) - (case (-> s3-0 s0-0 option-type) - ((3) - (set! (-> font-ctx origin y) (the float (+ s2-1 -20))) - ) - (else - (set! (-> font-ctx origin y) (the float (+ s2-1 -8))) - ) - ) - (let ((v1-64 font-ctx)) - (set! (-> v1-64 scale) 0.6) - ) - (set! sv-288 print-game-text) - (let ((a0-23 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - (a1-11 font-ctx) - (a2-10 #f) - (a3-4 128) - (t0-1 22) - ) - (sv-288 a0-23 a1-11 a2-10 a3-4 t0-1) - ) - (case (-> s3-0 s0-0 option-type) - ((3) - (set! sv-144 (+ s2-1 3)) - sv-144 - ) - (else - (set! sv-144 (+ s2-1 7)) - sv-144 - ) - ) - (let ((v1-81 (-> s3-0 s0-0 option-type))) - (cond - ((zero? v1-81) - (let* ((v1-82 (the-as uint #x8000ffff)) - (f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) - (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) - (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) - ) - (draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as int a3-5)) - ) - (set! sv-304 format) - (let ((a0-42 (clear *temp-string*)) - (a1-13 "~D") - (a2-12 (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) - ) - (sv-304 a0-42 a1-13 a2-12) - ) - (set! sv-912 *temp-string*) - (set! sv-128 (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100)) - sv-128 - ) - ((or (= v1-81 2) (= v1-81 #x15)) - (cond - ((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (set! sv-320 format) - (set! sv-336 (clear *temp-string*)) - (set! sv-352 "~30L~S~0L ~S") - (set! sv-368 (lookup-text! *common-text* (game-text-id on) #f)) - (let ((a3-6 (lookup-text! *common-text* (game-text-id off) #f))) - (sv-320 sv-336 sv-352 sv-368 a3-6) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-384 format) - (set! sv-400 (clear *temp-string*)) - (set! sv-416 "~0L~S ~30L~S~1L") - (set! sv-432 (lookup-text! *common-text* (game-text-id on) #f)) - (let ((a3-7 (lookup-text! *common-text* (game-text-id off) #f))) - (sv-384 sv-400 sv-416 sv-432 a3-7) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - ) - ) - ;; language selection - when selected - ((= v1-81 1) - (draw-options-list obj font-ctx s2-1 *language-name-remap*)) - ((= v1-81 #x10) - (if (-> *pc-settings* use-original-aspect-ratio?) - (draw-options-list obj font-ctx s2-1 *pc-graphics-original-aspect-ratio-mode-remap*) - (draw-options-list obj font-ctx s2-1 *pc-graphics-aspect-ratio-mode-remap*))) - ((= v1-81 #x11) - (case (-> *pc-settings* aspect-ratio-mode) - (('pc-aspect-4x3 'orig-aspect-4x3) - (draw-options-list obj font-ctx s2-1 *pc-graphics-4x3-valid-resolutions-names*)) - (('pc-aspect-5x4) - (draw-options-list obj font-ctx s2-1 *pc-graphics-5x4-valid-resolutions-names*)) - (('pc-aspect-16x9 'orig-aspect-16x9) - (draw-options-list obj font-ctx s2-1 *pc-graphics-16x9-valid-resolutions-names*)) - (('pc-aspect-21x9) - (draw-options-list obj font-ctx s2-1 *pc-graphics-21x9-valid-resolutions-names*)) - (('pc-aspect-32x9) - (draw-options-list obj font-ctx s2-1 *pc-graphics-32x9-valid-resolutions-names*)))) - ((= v1-81 #x12) - (draw-options-list obj font-ctx s2-1 *pc-graphics-display-mode-remap*)) - ((= v1-81 #x13) - (draw-options-list obj font-ctx s2-1 *pc-subtitle-language-name-remap*)) - ((= v1-81 #x14) - (draw-options-list obj font-ctx s2-1 *pc-subtitle-speaker-setting-remap*)) - ((= v1-81 3) - (set! sv-912 (lookup-text! *common-text* (game-text-id move-dpad) #f)) - sv-912 - ) - ;; aspect ratio - original - ((= v1-81 4) - (cond - ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'aspect4x3) - (format (clear *temp-string*) - "~30L~S~0L ~S" - (lookup-text! *common-text* (game-text-id 4x3) #f) - (lookup-text! *common-text* (game-text-id 16x9) #f)) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (format (clear *temp-string*) - "~0L~S ~30L~S~1L" - (lookup-text! *common-text* (game-text-id 4x3) #f) - (lookup-text! *common-text* (game-text-id 16x9) #f)) - (set! sv-912 *temp-string*) - sv-912 - ) - ) - ) - ;; pal refresh rate - ((= v1-81 5) - (cond - ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'ntsc) - (set! sv-656 format) - (set! sv-672 (clear *temp-string*)) - (set! sv-688 "~0L~S ~30L~S~1L") - (set! sv-704 (lookup-text! *common-text* (game-text-id 50hz) #f)) - (let ((a3-17 (lookup-text! *common-text* (game-text-id 60hz) #f))) - (sv-656 sv-672 sv-688 sv-704 a3-17) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-720 format) - (set! sv-736 (clear *temp-string*)) - (set! sv-752 "~30L~S~0L ~S") - (set! sv-768 (lookup-text! *common-text* (game-text-id 50hz) #f)) - (let ((a3-18 (lookup-text! *common-text* (game-text-id 60hz) #f))) - (sv-720 sv-736 sv-752 sv-768 a3-18) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - ) - ) - ) - ) - ) - (else - (let ((v1-195 (-> s3-0 s0-0 option-type))) - (cond - ;; boolean flag - ((= v1-195 2) - (set! sv-784 format) - (set! sv-800 (clear *temp-string*)) - (set! sv-816 "~S: ~S") - (set! sv-832 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - ;; Danger -- assumes there is a value to be modified, iniitalized in progress! - (let ((a3-19 (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (lookup-text! *common-text* (game-text-id on) #f) - (lookup-text! *common-text* (game-text-id off) #f) - ) - ) - ) - (sv-784 sv-800 sv-816 sv-832 a3-19) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - ;; language selection - ;; unfortunate everything is hard-coded with these ids.. - ((= v1-195 1) - (set! sv-848 format) - (set! sv-864 (clear *temp-string*)) - (set! sv-880 "~S: ~S") - (set! sv-896 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - (let ((a3-20 (lookup-text! - *common-text* - (-> *language-name-remap* (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) - #f - ) - ) - ) - (sv-848 sv-864 sv-880 sv-896 a3-20) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - sv-912) - ) - ) - ) - ) - ) - (when sv-912 - (let ((f0-23 (-> obj transition-percentage-invert))) - (let ((v1-235 font-ctx)) - (set! (-> v1-235 color) - (the-as font-color (if (and (= s0-0 (-> obj option-index)) (not (-> obj in-transition))) - 30 - 0 - ) - ) - ) - ) - (set! (-> font-ctx origin x) (the float (- sv-128 (-> obj left-x-offset)))) - (set! (-> font-ctx origin y) (the float (the int (* (the float sv-144) (if (-> s3-0 s0-0 scale) - f0-23 - 1.0 - ) - ) - ) - ) - ) - (let ((v1-246 font-ctx)) - (set! (-> v1-246 scale) (* arg2 f0-23)) - ) - (let ((t9-60 print-game-text) - (a1-64 font-ctx) - (a2-50 #f) - (a3-21 (the int (* 128.0 f0-23))) - (t0-2 22) - ) - (t9-60 sv-912 a1-64 a2-50 a3-21 t0-2) - ) - ) - ) - (+! s2-1 arg1) - (+! s1-0 1) - ) - ) - ) - ) - 0 - (none) - ) - -(defmethod draw-progress progress ((obj progress)) - (let ((f30-0 (+ -409.0 (-> obj particles 2 init-pos x) (* 0.8 (the float (-> obj left-x-offset))))) - (s5-0 (if (or (-> obj stat-transition) (nonzero? (-> obj level-transition))) - 0 - (-> obj transition-offset) - ) - ) - ) - (let ((f28-0 (if (or (-> obj stat-transition) (nonzero? (-> obj level-transition))) - 1.0 - (-> obj transition-percentage-invert) - ) - ) - ) - (let* ((s3-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (s4-0 (-> s3-0 base)) - ) - (let ((s2-0 draw-string-xy)) - (format (clear *temp-string*) "~D" (the int (+ 0.5 (-> *target* game money)))) - (s2-0 - *temp-string* - s3-0 - (the int (+ 428.0 (the float s5-0) f30-0)) - (- 12 (the int (* 0.16666667 f30-0))) - (font-color default) - (font-flags shadow kerning large) - ) - ) - (let ((s2-1 draw-string-xy)) - (format (clear *temp-string*) "~D" (the int (+ 0.5 (-> *target* game fuel)))) - (s2-1 - *temp-string* - s3-0 - (the int (+ 456.0 (the float (adjust-pos s5-0 50)) f30-0)) - (- 48 (the int (* 0.125 f30-0))) - (font-color default) - (font-flags shadow kerning large) - ) - ) - (let ((s2-2 draw-string-xy)) - (format (clear *temp-string*) "~D" (the int (+ 0.5 (-> *target* fact-info-target buzzer)))) - (s2-2 - *temp-string* - s3-0 - (the int (+ 469.0 (the float (adjust-pos s5-0 100)) f30-0)) - 89 - (font-color default) - (font-flags shadow kerning large) - ) - ) - (let ((a3-4 (-> s3-0 base))) - (let ((v1-20 (the-as object (-> s3-0 base)))) - (set! (-> (the-as dma-packet v1-20) dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> (the-as dma-packet v1-20) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-20) vif1) (new 'static 'vif-tag)) - (set! (-> s3-0 base) (&+ (the-as pointer v1-20) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - s4-0 - (the-as (pointer dma-tag) a3-4) - ) - ) - ) - (let ((s4-2 - (new - 'stack - 'font-context - *font-default-matrix* - (the int (+ (- 423.0 (the float (/ (-> obj left-x-offset) 2))) f30-0 (the float (adjust-pos s5-0 150)))) - 131 - 0.0 - (font-color default) - (font-flags shadow kerning) - ) - ) - ) - (let ((v1-29 s4-2)) - (set! (-> v1-29 width) (the float 100)) - ) - (let ((v1-30 s4-2)) - (set! (-> v1-30 height) (the float 15)) - ) - (let ((v1-31 s4-2)) - (set! (-> v1-31 scale) 0.5) - ) - (set! (-> s4-2 flags) (font-flags shadow kerning large)) - (print-game-text (lookup-text! *common-text* (game-text-id options) #f) s4-2 #f 128 22) - (let ((v1-34 s4-2)) - (set! (-> v1-34 width) (the float 160)) - ) - (let ((v1-35 s4-2)) - (set! (-> v1-35 height) (the float 22)) - ) - (let ((v1-36 s4-2)) - (set! (-> v1-36 scale) 1.3) - ) - (let ((a0-31 s4-2)) - (set! (-> a0-31 color) (font-color another-light-blue)) - ) - (set! (-> s4-2 origin x) - (+ (- 435.0 (the float (if (< (-> *progress-process* 0 completion-percentage) 10.0) - 93 - 80 - ) - ) - ) - f30-0 - ) - ) - (set! (-> s4-2 origin y) 180.0) - (set! (-> s4-2 flags) (font-flags shadow kerning middle left large)) - (let ((s3-3 print-game-text)) - (format (clear *temp-string*) "~2D%" (the int (-> *progress-process* 0 completion-percentage))) - (s3-3 *temp-string* s4-2 #f (the int (* 128.0 f28-0)) 22) - ) - ) - ) - 0.0 - (let ((f28-1 (+ -94.0 (-> obj particles 2 init-pos x))) - (s3-4 90) - (s4-3 224) - (s2-5 (/ s5-0 5)) - (f26-3 (-> obj button-scale)) - ) - (let ((f24-0 (* 182.04445 (- (/ -36.0 f26-3) (the float s2-5))))) - (set! (-> obj particles 27 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-0)))))) - (set! (-> obj particles 27 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-0)))))) - ) - (let ((f24-2 (* 182.04445 (- (/ -21.0 f26-3) (the float (adjust-pos s2-5 10)))))) - (set! (-> obj particles 28 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-2)))))) - (set! (-> obj particles 28 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-2)))))) - ) - (let ((f24-4 (* 182.04445 (- (/ -6.0 f26-3) (the float (adjust-pos s2-5 15)))))) - (set! (-> obj particles 29 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-4)))))) - (set! (-> obj particles 29 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-4)))))) - ) - (let ((f26-5 (* 182.04445 (- (/ 9.0 f26-3) (the float (adjust-pos s2-5 20)))))) - (set! (-> obj particles 30 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f26-5)))))) - (set! (-> obj particles 30 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f26-5)))))) - ) - ) - (when *cheat-mode* - (let ((a0-46 "AUTO SAVE OFF")) - (if (-> *setting-control* current auto-save) - (set! a0-46 "AUTO SAVE ON") - ) - (let* ((s3-5 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (s4-4 (-> s3-5 base)) - ) - (draw-string-xy - a0-46 - s3-5 - (the int (+ 430.0 f30-0)) - 200 - (font-color blue-white) - (font-flags shadow kerning middle) - ) - (let ((a3-9 (-> s3-5 base))) - (let ((v1-81 (the-as object (-> s3-5 base)))) - (set! (-> (the-as dma-packet v1-81) dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> (the-as dma-packet v1-81) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-81) vif1) (new 'static 'vif-tag)) - (set! (-> s3-5 base) (&+ (the-as pointer v1-81) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - s4-4 - (the-as (pointer dma-tag) a3-9) - ) - ) - ) - ) - ) - (let ((a0-52 (-> obj icons 5 icon 0 root))) - (set-yaw-angle-clear-roll-pitch! - a0-52 - (- (y-angle a0-52) (* 182.04445 (* 4.0 (-> *display* time-adjust-ratio)))) - ) - ) - (let* ((f28-2 (* 0.00024414062 (the float (-> *progress-process* 0 in-out-position)))) - (f30-1 (* 300.0 f28-2)) - ) - (set! (-> obj particles 18 init-pos x) - (the float (+ (the int (the float (adjust-pos s5-0 50))) 394 (the int f30-1) (-> obj right-x-offset))) - ) - (set! (-> obj particles 18 init-pos y) (the float (- 40 (the int (* 80.0 f28-2))))) - (set! (-> obj icons 5 icon-x) - (+ (the int (the float (adjust-pos s5-0 50))) 393 (the int f30-1) (-> obj right-x-offset)) - ) - (set! (-> obj icons 5 icon-y) (- (-> obj small-orb-y-offset) (the int (* 80.0 f28-2)))) - (set! (-> obj particles 16 init-pos x) - (the float (+ (the int (the float (adjust-pos s5-0 100))) 425 (the int f30-1) (-> obj right-x-offset))) - ) - (set! (-> obj particles 16 init-pos y) (the float (- 112 (the int (* 60.0 f28-2))))) - (set! (-> obj particles 17 init-pos x) (the float (+ (the int (the float (adjust-pos s5-0 150))) - 442 - (the int f30-1) - (the int (* 0.7 (the float (-> obj right-x-offset)))) - ) - ) - ) - ) - ) - (set! (-> obj particles 17 init-pos y) 193.0) - 0 - (none) - ) - - - - diff --git a/goal_src/pc/engine/ui/progress/progress-static.gc b/goal_src/pc/engine/ui/progress/progress-static.gc deleted file mode 100644 index e08952ce54..0000000000 --- a/goal_src/pc/engine/ui/progress/progress-static.gc +++ /dev/null @@ -1,1498 +0,0 @@ -;;-*-Lisp-*- -(in-package goal) - -;; name: progress-static.gc -;; name in dgo: progress-static -;; dgos: GAME, ENGINE - -;; This file contains the layouts for all of the menus. - -;; options in the start menu options -(define *main-options* - (new 'static 'boxed-array :type game-option :length 7 :allocated-length 7 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x6 :name (game-text-id load-game) :scale #t :param3 16) - (new 'static 'game-option :option-type #x6 :name (game-text-id save-game) :scale #t :param3 17) - (new 'static 'game-option :option-type #x6 :name (game-text-id quit-game) :scale #t :param3 34) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *title* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id new-game) :scale #t :param3 18) - (new 'static 'game-option :option-type #x6 :name (game-text-id load-game) :scale #t :param3 16) - (new 'static 'game-option :option-type #x6 :name (game-text-id options) :scale #t :param3 28) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *options* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *main-options-demo* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -;; param3 corresponds to the index defined in `*options-remap*` in progress.gc -;; it is the screen it should go to next, it's only used for type `6` - -(define *main-options-demo-shared* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id exit-demo) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -;; TODO - option type should be an enum -;; 1 - a list? (only used by language so there might be some bad assumptions here...) -;; 2 - boolean -;; 3 - dpad input (center screen) -;; 4 - used for aspect ratio, also a list -;; 6 - go forward a screen -;; 8 - go back a screen -;; --- -;; 10 - port aspect ratio -;; 11 - port resolution -;; 12 - port window type -;; 13 - port subtitle language -;; 14 - port subtitle speaker -;; 15 - original aspect ratio - -(define *game-options* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x6 :name (game-text-id progress-language-options) :scale #t :param3 35) - (new 'static 'game-option :option-type #x2 :name (game-text-id progress-discord-rpc) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *game-options-japan* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x1 :name (game-text-id progress-language-options) :scale #t :param3 35) - (new 'static 'game-option :option-type #x2 :name (game-text-id progress-discord-rpc) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *game-options-demo* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x1 :name (game-text-id progress-language-options) :scale #t :param3 35) - (new 'static 'game-option :option-type #x2 :name (game-text-id progress-discord-rpc) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *language-options* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x1 :name (game-text-id language) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id progress-subtitles) :scale #t) - (new 'static 'game-option :option-type #x13 :name (game-text-id progress-subtitles-language) :scale #t) - (new 'static 'game-option :option-type #x14 :name (game-text-id progress-subtitles-label-speaker) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - )) - -(define *graphic-options* - (new 'static 'boxed-array :type game-option :length 6 - (new 'static 'game-option :option-type #x15 :name (game-text-id progress-use-original-aspect) :scale #t) - (new 'static 'game-option :option-type #x12 :name (game-text-id progress-display-mode) :scale #t) - (new 'static 'game-option :option-type #x10 :name (game-text-id aspect-ratio) :scale #t) - (new 'static 'game-option :option-type #x11 :name (game-text-id progress-resolution) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id progress-letterbox) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *graphic-title-options-pal* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x3 :name (game-text-id center-screen) :scale #t) - (new 'static 'game-option :option-type #x5 :name (game-text-id video-mode) :scale #t) - (new 'static 'game-option :option-type #x4 :name (game-text-id aspect-ratio) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *sound-options* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :name (game-text-id sfx-volume) :scale #t :param2 100.0) - (new 'static 'game-option :name (game-text-id music-volume) :scale #t :param2 100.0) - (new 'static 'game-option :name (game-text-id speech-volume) :scale #t :param2 100.0) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *yes-no-options* - (new 'static 'boxed-array :type game-option :length 1 :allocated-length 1 - (new 'static 'game-option :option-type #x7 :scale #f) - ) - ) - -(define *ok-options* - (new 'static 'boxed-array :type game-option :length 1 :allocated-length 1 - (new 'static 'game-option :option-type #x8 :name (game-text-id ok) :scale #f) - ) - ) - -(define *load-options* - (new 'static 'boxed-array - :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) - ) - -(define *save-options* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) - ) - -(define *save-options-title* - (new 'static 'boxed-array - :type game-option :length 6 :allocated-length 6 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id continue-without-saving) :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) - ) - -;; maps options to a progress screen -(define *options-remap* - (new 'static 'boxed-array :type (array game-option) :length 0 :allocated-length 36) - ) - -;; TODO probably an enum. -;; maps "levels" to the appropriate offset in *level-task-data* -(define *level-task-data-remap* - (new 'static 'boxed-array :type int32 :length 23 :allocated-length 23 - 0 - 1 - 2 - 3 ;; jungle? - 3 ;; jungleb? - 4 - 5 - 6 - 7 ;; sunken? - 7 ;; sunkenb? - 8 - 9 - 10 - 11 - 12 - 13 ;; maincave? - 13 ;; robocave? - 13 ;; darkcave? - 14 - 15 ;; citadel? - 15 ;; finalboss? - 4 ;; demo? - 4 ;; intro? - ) - ) - -;; maps goal language ID to its name string ID -(define *language-name-remap* - (new 'static 'boxed-array :type game-text-id :length 6 :allocated-length 6 - (game-text-id english) - (game-text-id french) - (game-text-id german) - (game-text-id spanish) - (game-text-id italian) - (game-text-id japanese) - ) - ) - -(define *pc-subtitle-language-name-remap* - (new 'static 'boxed-array :type game-text-id :length 14 :allocated-length 14 - (game-text-id english) - (game-text-id french) - (game-text-id german) - (game-text-id spanish) - (game-text-id italian) - (game-text-id japanese) - (game-text-id progress-subtitle-language-uk-english) - (game-text-id progress-subtitle-language-portuguese) - (game-text-id progress-subtitle-language-finnish) - (game-text-id progress-subtitle-language-swedish) - (game-text-id progress-subtitle-language-danish) - (game-text-id progress-subtitle-language-norwegian) - (game-text-id progress-subtitle-language-korean) - (game-text-id progress-subtitle-language-russian))) - -(define *pc-subtitle-speaker-setting-remap* - (new 'static 'boxed-array :type game-text-id :length 3 :allocated-length 3 - (game-text-id progress-subtitles-label-speaker-on) - (game-text-id progress-subtitles-label-speaker-off) - (game-text-id progress-subtitles-label-speaker-auto))) - -(define *pc-graphics-display-mode-remap* - (new 'static 'boxed-array :type game-text-id :length 3 :allocated-length 3 - (game-text-id progress-display-mode-borderless) - (game-text-id progress-display-mode-fullscreen) - (game-text-id progress-display-mode-windowed))) - -(define *pc-graphics-original-aspect-ratio-mode-remap* - (new 'static 'boxed-array :type game-text-id :length 2 :allocated-length 2 - (game-text-id progress-aspect-ratio-4x3) - (game-text-id progress-aspect-ratio-16x9))) - -(define *pc-graphics-aspect-ratio-mode-remap* - (new 'static 'boxed-array :type game-text-id :length 5 :allocated-length 5 - (game-text-id progress-aspect-ratio-4x3) - (game-text-id progress-aspect-ratio-5x4) - (game-text-id progress-aspect-ratio-16x9) - (game-text-id progress-aspect-ratio-21x9) - (game-text-id progress-aspect-ratio-32x9))) - -(define *pc-graphics-4x3-valid-resolutions-names* - (new 'static 'boxed-array :type game-text-id :length 5 :allocated-length 5 - (game-text-id progress-res-4x3-640x480) - (game-text-id progress-res-4x3-800x600) - (game-text-id progress-res-4x3-1024x768) - (game-text-id progress-res-4x3-1280x960) - (game-text-id progress-res-4x3-1600x1200))) - -(define *pc-graphics-5x4-valid-resolutions-names* - (new 'static 'boxed-array :type game-text-id :length 3 :allocated-length 3 - (game-text-id progress-res-5x4-960x768) - (game-text-id progress-res-5x4-1280x1024) - (game-text-id progress-res-5x4-1500x1200))) - -(define *pc-graphics-16x9-valid-resolutions-names* - (new 'static 'boxed-array :type game-text-id :length 7 :allocated-length 7 - (game-text-id progress-res-16x9-854x480) - (game-text-id progress-res-16x9-1280x720) - (game-text-id progress-res-16x9-1920x1080) - (game-text-id progress-res-16x9-2560x1440) - (game-text-id progress-res-16x9-2880x1620) - (game-text-id progress-res-16x9-3840x2160) - (game-text-id progress-res-16x9-5120x2880))) - -(define *pc-graphics-21x9-valid-resolutions-names* - (new 'static 'boxed-array :type game-text-id :length 6 :allocated-length 6 - (game-text-id progress-res-21x9-2560x1080) - (game-text-id progress-res-21x9-3120x1440) - (game-text-id progress-res-21x9-3200x1440) - (game-text-id progress-res-21x9-3440x1440) - (game-text-id progress-res-21x9-3840x1600) - (game-text-id progress-res-21x9-5120x2160))) - -(define *pc-graphics-32x9-valid-resolutions-names* - (new 'static 'boxed-array :type game-text-id :length 1 :allocated-length 1 - (game-text-id progress-res-32x9-5120x1440))) - -;; all level tasks -(define *level-task-data* - (new 'static 'boxed-array :type level-tasks-info :length 16 :allocated-length 16 - (new 'static 'level-tasks-info - :level-name-id (game-text-id training-level-name) - :text-group-index 1 - :nb-of-tasks 4 - :buzzer-task-index 3 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task training-gimmie) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-gimmie-task-name) - (game-text-id training-gimmie-task-name) - (game-text-id training-gimmie-task-name) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task training-door) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-door-task-name) - (game-text-id training-door-task-name) - (game-text-id training-door-task-name) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task training-climb) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-climb-task-name) - (game-text-id training-climb-task-name) - (game-text-id training-climb-task-name) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task training-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-buzzer-task-name) - (game-text-id training-buzzer-task-name) - (game-text-id training-buzzer-task-name) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id village1-level-name) - :text-group-index 1 - :nb-of-tasks 6 - :buzzer-task-index 5 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task village1-mayor-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-mayor-money) - (game-text-id village1-mayor-money) - (game-text-id village1-mayor-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-uncle-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id vollage1-uncle-money) - (game-text-id vollage1-uncle-money) - (game-text-id vollage1-uncle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-yakow) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-yakow-herd) - (game-text-id village1-yakow-herd) - (game-text-id village1-yakow-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-oracle-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-oracle-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id beach-level-name) - :text-group-index 1 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task beach-ecorocks) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-ecorocks) - (game-text-id beach-ecorocks) - (game-text-id beach-ecorocks) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-flutflut) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-flutflut-push) - (game-text-id beach-flutflut-push) - (game-text-id beach-flutflut-meet) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-pelican) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-pelican) - (game-text-id beach-pelican) - (game-text-id beach-pelican) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-seagull) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-seagull) - (game-text-id beach-seagull) - (game-text-id beach-seagull-get) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-cannon) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-cannon) - (game-text-id beach-cannon) - (game-text-id beach-cannon) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-gimmie) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-gimmie) - (game-text-id beach-gimmie) - (game-text-id beach-gimmie) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-sentinel) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-sentinel) - (game-text-id beach-sentinel) - (game-text-id beach-sentinel) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id jungle-level-name) - :text-group-index 1 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task jungle-lurkerm) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-lurkerm-unblock) - (game-text-id jungle-lurkerm-connect) - (game-text-id jungle-lurkerm-return) - (game-text-id zero) - ) - :text-index-when-resolved 1 - ) - (new 'static 'task-info-data - :task-id (game-task jungle-tower) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-tower) - (game-text-id jungle-tower) - (game-text-id jungle-tower) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-eggtop) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-eggtop) - (game-text-id jungle-eggtop) - (game-text-id jungle-eggtop) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-plant) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-plant) - (game-text-id jungle-plant) - (game-text-id jungle-plant) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-fishgame) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-fishgame) - (game-text-id jungle-fishgame) - (game-text-id jungle-fishgame) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-canyon-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-canyon-end) - (game-text-id jungle-canyon-end) - (game-text-id jungle-canyon-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-temple-door) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-temple-door) - (game-text-id jungle-temple-door) - (game-text-id jungle-temple-door) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id misty-level-name) - :text-group-index 1 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task misty-muse) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-muse-catch) - (game-text-id misty-muse-catch) - (game-text-id misty-muse-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-boat) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-boat) - (game-text-id misty-boat) - (game-text-id misty-boat) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-cannon) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-cannon) - (game-text-id misty-cannon) - (game-text-id misty-cannon) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-warehouse) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-return-to-pool) - (game-text-id misty-return-to-pool) - (game-text-id misty-return-to-pool) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-bike) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-find-transpad) - (game-text-id misty-balloon-lurkers) - (game-text-id misty-find-transpad) - (game-text-id zero) - ) - :text-index-when-resolved 1 - ) - (new 'static 'task-info-data - :task-id (game-task misty-bike-jump) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-bike-jump) - (game-text-id misty-bike-jump) - (game-text-id misty-bike-jump) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-eco-challenge) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-eco-challenge) - (game-text-id misty-eco-challenge) - (game-text-id misty-eco-challenge) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id fire-canyon-level-name) - :text-group-index 5 - :nb-of-tasks 2 - :buzzer-task-index 1 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task firecanyon-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id fire-canyon-end) - (game-text-id fire-canyon-end) - (game-text-id fire-canyon-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task firecanyon-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id fire-canyon-buzzer) - (game-text-id fire-canyon-buzzer) - (game-text-id fire-canyon-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id village2-level-name) - :text-group-index 2 - :nb-of-tasks 6 - :buzzer-task-index 5 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task village2-gambler-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-gambler-money) - (game-text-id village2-gambler-money) - (game-text-id village2-gambler-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-geologist-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-geologist-money) - (game-text-id village2-geologist-money) - (game-text-id village2-geologist-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-warrior-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-warrior-money) - (game-text-id village2-warrior-money) - (game-text-id village2-warrior-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-oracle-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-oracle-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id sunken-level-name) - :text-group-index 2 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task sunken-room) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-elevator-raise) - (game-text-id sunken-elevator-raise) - (game-text-id sunken-elevator-get-to-roof) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-pipe) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-pipe) - (game-text-id sunken-pipe) - (game-text-id sunken-pipe) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-slide) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-bottom) - (game-text-id sunken-bottom) - (game-text-id sunken-bottom) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-sharks) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-pool) - (game-text-id sunken-pool) - (game-text-id sunken-pool) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-platforms) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-platforms) - (game-text-id sunken-platforms) - (game-text-id sunken-platforms) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-top-of-helix) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-climb-tube) - (game-text-id sunken-climb-tube) - (game-text-id sunken-climb-tube) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-spinning-room) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id reach-center) - (game-text-id reach-center) - (game-text-id reach-center) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id swamp-level-name) - :text-group-index 2 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task swamp-flutflut) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-flutflut) - (game-text-id swamp-flutflut) - (game-text-id swamp-flutflut) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-billy) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-billy) - (game-text-id swamp-billy) - (game-text-id swamp-billy) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-battle) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-battle) - (game-text-id swamp-battle) - (game-text-id swamp-battle) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-4) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-3) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id rolling-level-name) - :text-group-index 2 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task rolling-moles) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-moles) - (game-text-id rolling-moles) - (game-text-id rolling-moles-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-robbers) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-robbers) - (game-text-id rolling-robbers) - (game-text-id rolling-robbers) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-race) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-race) - (game-text-id rolling-race) - (game-text-id rolling-race-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-lake) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-lake) - (game-text-id rolling-lake) - (game-text-id rolling-lake) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-plants) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-plants) - (game-text-id rolling-plants) - (game-text-id rolling-plants) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-ring-chase-1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-ring-chase-1) - (game-text-id rolling-ring-chase-1) - (game-text-id rolling-ring-chase-1) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-ring-chase-2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-ring-chase-2) - (game-text-id rolling-ring-chase-2) - (game-text-id rolling-ring-chase-2) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id ogre-level-name) - :text-group-index 6 - :nb-of-tasks 4 - :buzzer-task-index 3 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task ogre-boss) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id ogre-boss) - (game-text-id ogre-boss) - (game-text-id ogre-boss) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task ogre-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id ogre-end) - (game-text-id ogre-end) - (game-text-id ogre-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task ogre-secret) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task ogre-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id ogre-buzzer) - (game-text-id ogre-buzzer) - (game-text-id ogre-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id village3-level-name) - :text-group-index 3 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task village3-miner-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-miner-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-miner-money3) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-miner-money4) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-oracle-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-oracle-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-extra1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id snowy-level-name) - :text-group-index 3 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task snow-eggtop) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-eggtop) - (game-text-id snow-eggtop) - (game-text-id snow-eggtop) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-ram) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-ram-3-left) - (game-text-id snow-ram-2-left) - (game-text-id snow-ram-1-left) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-bumpers) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-bumpers) - (game-text-id snow-bumpers) - (game-text-id snow-bumpers) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-cage) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-frozen-crate) - (game-text-id snow-frozen-crate) - (game-text-id snow-frozen-crate) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-fort) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-fort) - (game-text-id snow-fort) - (game-text-id snow-fort) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-ball) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-open-door) - (game-text-id snow-open-door) - (game-text-id snow-open-door) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-bunnies) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-bunnies) - (game-text-id snow-bunnies) - (game-text-id snow-bunnies) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id cave-level-name) - :text-group-index 3 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task cave-gnawers) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-gnawers) - (game-text-id cave-gnawers) - (game-text-id cave-gnawers) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-dark-crystals) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-dark-crystals) - (game-text-id cave-dark-crystals) - (game-text-id cave-dark-crystals) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-dark-climb) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-dark-climb) - (game-text-id cave-dark-climb) - (game-text-id cave-dark-climb) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-robot-climb) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-robot-climb) - (game-text-id cave-robot-climb) - (game-text-id cave-robot-climb) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-swing-poles) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-swing-poles) - (game-text-id cave-swing-poles) - (game-text-id cave-swing-poles) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-spider-tunnel) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-spider-tunnel) - (game-text-id cave-spider-tunnel) - (game-text-id cave-spider-tunnel) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-platforms) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-platforms) - (game-text-id cave-platforms) - (game-text-id cave-platforms) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id lavatube-level-name) - :text-group-index 3 - :nb-of-tasks 2 - :buzzer-task-index 1 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task lavatube-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id lavatube-end) - (game-text-id lavatube-end) - (game-text-id lavatube-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task lavatube-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id lavatube-buzzer) - (game-text-id lavatube-buzzer) - (game-text-id lavatube-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id citadel-level-name) - :text-group-index 4 - :nb-of-tasks 5 - :buzzer-task-index 4 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task citadel-sage-blue) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-blue) - (game-text-id citadel-sage-blue) - (game-text-id citadel-sage-blue) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-sage-red) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-red) - (game-text-id citadel-sage-red) - (game-text-id citadel-sage-red) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-sage-yellow) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-yellow) - (game-text-id citadel-sage-yellow) - (game-text-id citadel-sage-yellow) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-sage-green) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-green) - (game-text-id citadel-sage-green) - (game-text-id citadel-sage-green) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-buzzer) - (game-text-id citadel-buzzer) - (game-text-id citadel-buzzer) - (game-text-id zero) - ) - ) - ) - ) - ) - ) - -;; goes down by 24 or 23 every time -(define *task-egg-starting-x* - (new 'static 'boxed-array :type int32 :length 9 :allocated-length 9 - 218 - 194 - 171 - 147 - 124 - 100 - 77 - 53 - 30 - ) - ) - -(define *game-counts* (the-as game-count-info #f)) - - - - diff --git a/goal_src/pc/engine/ui/progress/progress.gc b/goal_src/pc/engine/ui/progress/progress.gc deleted file mode 100644 index 1fd0ac0f71..0000000000 --- a/goal_src/pc/engine/ui/progress/progress.gc +++ /dev/null @@ -1,2762 +0,0 @@ -;;-*-Lisp-*- -(in-package goal) - -;; name: progress.gc -;; name in dgo: progress -;; dgos: GAME, ENGINE - -;; DECOMP BEGINS - -(deftype progress-global-state (basic) - ((aspect-ratio-choice symbol :offset-assert 4) - (video-mode-choice symbol :offset-assert 8) - (yes-no-choice symbol :offset-assert 12) - (which int32 :offset-assert 16) - (starting-state progress-screen :offset-assert 24) - (last-slot-saved int32 :offset-assert 32) - (slider-backup float :offset-assert 36) - (language-backup int64 :offset-assert 40) - (on-off-backup symbol :offset-assert 48) - (center-x-backup int32 :offset-assert 52) - (center-y-backup int32 :offset-assert 56) - (aspect-ratio-backup symbol :offset-assert 60) - (last-slider-sound time-frame :offset-assert 64) - ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 - ) - -(define *progress-state* - (new 'static 'progress-global-state - :yes-no-choice #f - :which -1 - :last-slot-saved -1 - ) - ) - - -(defun get-game-count ((arg0 int)) - (-> *game-counts* data arg0) - ) - -(defun progress-allowed? () - (not (or (-> *setting-control* current talking) - (-> *setting-control* current movie) - (movie?) - (handle->process (-> *game-info* pov-camera-handle)) - (handle->process (-> *game-info* other-camera-handle)) - (< (-> *display* base-frame-counter) (-> *game-info* letterbox-time)) - (< (-> *display* base-frame-counter) (-> *game-info* blackout-time)) - (!= (-> *setting-control* current bg-a) 0.0) - (!= (-> *setting-control* current bg-a-force) 0.0) - (not (-> *setting-control* current allow-progress)) - (or (and (handle->process (-> *game-info* auto-save-proc)) - (not (send-event (handle->process (-> *game-info* auto-save-proc)) 'progress-allowed?)) - ) - (not *target*) - ) - ) - ) - ) - -(defun pause-allowed? () - (not (or (< (-> *display* base-frame-counter) (-> *game-info* blackout-time)) - (!= (-> *setting-control* current bg-a) 0.0) - (!= (-> *setting-control* current bg-a-force) 0.0) - (not (-> *setting-control* current allow-pause)) - (handle->process (-> *game-info* auto-save-proc)) - (not *target*) - ) - ) - ) - -(defun init-game-options ((obj progress)) - "Set the options for all of the menus." - - ;; start off by making them all invalid - (dotimes (i (-> *options-remap* allocated-length)) - (set! (-> *options-remap* i) #f) - ) - - ;; main menu - (set! (-> *options-remap* 3) - (case *kernel-boot-message* - (('demo) - ;; game demo - *main-options-demo* - ) - (('demo-shared) - ;; game demo with external launcher - *main-options-demo-shared* - ) - (else - ;; normal game - *main-options* - ) - ) - ) - (set! (-> *options-remap* 4) - (cond - ((!= *kernel-boot-message* 'play) - (if (= (scf-get-territory) GAME_TERRITORY_SCEE) - *game-options* - *game-options-demo* - ) - ) - ((and (= (scf-get-territory) GAME_TERRITORY_SCEI) - (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))) - ;; if ntsc-j and we're not using language cheat (needs l2+r2) - *game-options-japan* - ) - (else - *game-options* - ) - ) - ) - (set! (-> *options-remap* 5) - (if (and (= (-> *progress-state* starting-state) 27) - (or (= (scf-get-territory) GAME_TERRITORY_SCEE) - (and (= *progress-cheat* 'pal) - (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l2)) - (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons r2)) - ) - ) - ) - ;; (only if we came from title) if PAL or we're using the PAL cheat (needs l2+r2) - *graphic-title-options-pal* - *graphic-options* - ) - ) - (set! (-> *options-remap* 6) *sound-options*) - (set! (-> *options-remap* 7) *ok-options*) - (set! (-> *options-remap* 8) *ok-options*) - (set! (-> *options-remap* 9) *ok-options*) - (set! (-> *options-remap* 10) *yes-no-options*) - (set! (-> *options-remap* 11) *yes-no-options*) - (set! (-> *options-remap* 19) *ok-options*) - (set! (-> *options-remap* 16) *load-options*) - (set! (-> *options-remap* 17) *save-options*) - (set! (-> *options-remap* 18) *save-options-title*) - (set! (-> *options-remap* 20) *ok-options*) - (set! (-> *options-remap* 21) *ok-options*) - (set! (-> *options-remap* 24) *ok-options*) - (set! (-> *options-remap* 25) *ok-options*) - (set! (-> *options-remap* 26) *ok-options*) - (set! (-> *options-remap* 22) *ok-options*) - (set! (-> *options-remap* 23) *yes-no-options*) - (set! (-> *options-remap* 27) *title*) - (set! (-> *options-remap* 28) *options*) - (set! (-> *options-remap* 29) *ok-options*) - (set! (-> *options-remap* 30) *yes-no-options*) - (set! (-> *options-remap* 31) *yes-no-options*) - (set! (-> *options-remap* 32) *ok-options*) - (set! (-> *options-remap* 33) *ok-options*) - (set! (-> *options-remap* 34) *yes-no-options*) - (set! (-> *progress-state* video-mode-choice) (get-video-mode)) - (set! (-> *progress-state* yes-no-choice) #f) - (set! (-> *game-options* 0 value-to-modify) (&-> *setting-control* default vibration)) - (set! (-> *game-options* 1 value-to-modify) (&-> *setting-control* default play-hints)) - (set! (-> *game-options-japan* 0 value-to-modify) (&-> *setting-control* default vibration)) - (set! (-> *game-options-japan* 1 value-to-modify) (&-> *setting-control* default play-hints)) - (set! (-> *game-options-demo* 0 value-to-modify) (&-> *setting-control* default vibration)) - (set! (-> *game-options-demo* 1 value-to-modify) (&-> *setting-control* default play-hints)) - (set! (-> *graphic-title-options-pal* 1 value-to-modify) (&-> *progress-state* video-mode-choice)) - (set! (-> *graphic-title-options-pal* 2 value-to-modify) (&-> *progress-state* aspect-ratio-choice)) - (set! (-> *sound-options* 0 value-to-modify) (&-> *setting-control* default sfx-volume)) - (set! (-> *sound-options* 1 value-to-modify) (&-> *setting-control* default music-volume)) - (set! (-> *sound-options* 2 value-to-modify) (&-> *setting-control* default dialog-volume)) - (set! (-> *yes-no-options* 0 value-to-modify) (&-> *progress-state* yes-no-choice)) - - ;; new stuff - (set! (-> *options-remap* 35) *language-options*) - (set! (-> *game-options* 3 value-to-modify) (&-> *pc-settings* discord-rpc?)) - (set! (-> *language-options* 0 value-to-modify) (&-> *setting-control* default language)) - (set! (-> *language-options* 1 value-to-modify) (&-> *pc-settings* subtitles?)) - (set! (-> *language-options* 2 value-to-modify) (&-> *pc-settings* subtitle-language)) - (set! (-> *language-options* 3 value-to-modify) (&-> *pc-settings* subtitle-speaker?)) ;; TODO - refactor this like i did with display-mode - (set! (-> *graphic-options* 0 value-to-modify) (&-> *progress-state* aspect-ratio-choice)) - (set! (-> *graphic-options* 1 value-to-modify) (&-> *pc-settings* display-mode)) - (set! (-> *graphic-options* 2 value-to-modify) (&-> *pc-settings* aspect-ratio-mode)) - (set! (-> *graphic-options* 3 value-to-modify) (&-> *pc-settings* resolution)) - (set! (-> *graphic-options* 4 value-to-modify) (&-> *pc-settings* letterbox?)) - - (none) - ) - -(defun make-current-level-available-to-progress () - "exactly what it says on the tin." - - (when (and *target* (-> *level* border?)) - (let* ((cur-lev (-> *target* current-level)) - (lev-idx (+ (-> cur-lev info index) -1)) - ) - (if (and (>= lev-idx 0) - (< lev-idx (-> *level-task-data-remap* length)) - (zero? (-> *game-info* level-opened (-> *level-task-data-remap* lev-idx))) - (or (= *kernel-boot-message* 'play) (= (-> cur-lev nickname) 'mis)) - ) - (set! (-> *game-info* level-opened (-> *level-task-data-remap* lev-idx)) (the-as uint 1)) - ) - ) - ) - 0 - (none) - ) - -(defun make-levels-with-tasks-available-to-progress () - "Open levels that have tasks to do!" - - ;; go through EVERY LEVEL'S TASKS - (dotimes (i (length *level-task-data*)) - ;; level tasks - (let ((tasks (-> *level-task-data* i))) - ;; unless there's no tasks or the level is already open... - (unless (or (= tasks #f) (= (-> *game-info* level-opened i) 1)) - (cond - ((!= *kernel-boot-message* 'play) - (if (= (-> tasks level-name-id) (game-text-id misty-level-name)) - (set! (-> *game-info* level-opened i) (the-as uint 1)) - ) - ) - (*cheat-mode* - (set! (-> *game-info* level-opened i) (the-as uint 1)) - ) - (else - (dotimes (ii (-> tasks nb-of-tasks)) - (if (and (zero? (-> *game-info* level-opened ii)) - (!= ii (-> tasks buzzer-task-index)) - (task-known? (-> tasks task-info ii task-id)) - ) - (set! (-> *game-info* level-opened ii) (the-as uint 1)) - ) - ) - ) - ) - ) - ) - ) - 0 - (none) - ) - -(defun get-next-task-up ((cur-task-idx int) (lev-idx int)) - "find next available task. skips over unknown tasks and doesn't do anything if none are found" - - (let ((gp-0 cur-task-idx)) - (let ((s4-0 (+ cur-task-idx 1)) - (s3-0 (-> *level-task-data* lev-idx)) - ) - (while (and (< s4-0 (-> s3-0 nb-of-tasks)) (= gp-0 cur-task-idx)) - (if (or *cheat-mode* (task-known? (-> s3-0 task-info s4-0 task-id))) - (set! gp-0 s4-0) - ) - (+! s4-0 1) - ) - ) - gp-0 - ) - ) - -(defun get-next-task-down ((cur-task-idx int) (lev-idx int)) - "find previous available task. skips over unknown tasks and doesn't do anything if none are found" - - (let ((gp-0 cur-task-idx)) - (let ((s4-0 (+ cur-task-idx -1)) - (s3-0 (-> *level-task-data* lev-idx)) - ) - (while (and (>= s4-0 0) (= gp-0 cur-task-idx)) - (if (or *cheat-mode* (task-known? (-> s3-0 task-info s4-0 task-id))) - (set! gp-0 s4-0) - ) - (+! s4-0 -1) - ) - ) - gp-0 - ) - ) - -(defun get-next-level-up ((lev-idx int)) - (let ((gp-0 lev-idx)) - (let ((s4-0 (+ lev-idx 1))) - (while (and (< s4-0 (length *level-task-data*)) (= gp-0 lev-idx)) - (if (= (-> *game-info* level-opened s4-0) 1) - (set! gp-0 s4-0) - ) - (+! s4-0 1) - ) - ) - gp-0 - ) - ) - -(defun get-next-level-down ((lev-idx int)) - (let ((v0-0 lev-idx)) - (let ((v1-0 (+ lev-idx -1))) - (while (and (>= v1-0 0) (= v0-0 lev-idx)) - (if (= (-> *game-info* level-opened v1-0) 1) - (set! v0-0 v1-0) - ) - (+! v1-0 -1) - ) - ) - v0-0 - ) - ) - -(defun calculate-completion ((the-progress progress)) - "Updates counters and calculates game completion. - Cells are tallied 80% - Buzzers are tallied 10% - Orbs are tallied 10%" - - (local-vars - (current-cells int) - (current-buzzers int) - (current-orbs int) - (total-cells int) - (total-buzzers int) - (total-orbs int) - ) - (set! current-cells 0) - (set! current-buzzers 0) - (set! current-orbs 0) - (set! total-cells 0) - (set! total-buzzers 0) - (set! total-orbs 0) - (dotimes (s5-0 (length *level-task-data*)) - (let ((s4-0 (-> *level-task-data* s5-0))) - (when (!= s4-0 #f) - (when (or (= *kernel-boot-message* 'play) (= (-> s4-0 level-name-id) (game-text-id misty-level-name))) - (dotimes (s3-0 (-> s4-0 nb-of-tasks)) - (if (= (get-task-status (-> s4-0 task-info s3-0 task-id)) (task-status invalid)) - (set! current-cells (+ current-cells 1)) - ) - ) - (set! total-cells (+ total-cells (-> s4-0 nb-of-tasks))) - (set! current-orbs (+ current-orbs (-> *game-info* money-per-level s5-0))) - (set! total-orbs (+ total-orbs (-> *game-counts* data s5-0 money-count))) - (let ((v1-20 (-> s4-0 buzzer-task-index))) - (when (!= v1-20 -1) - (set! current-buzzers (+ current-buzzers (buzzer-count *game-info* (-> s4-0 task-info v1-20 task-id)))) - (set! total-buzzers (+ total-buzzers (-> *game-counts* data s5-0 buzzer-count))) - ) - ) - ) - ) - ) - ) - (when the-progress - (set! (-> the-progress total-nb-of-power-cells) total-cells) - (set! (-> the-progress total-nb-of-buzzers) total-buzzers) - (set! (-> the-progress total-nb-of-orbs) total-orbs) - ) - (+ (/ (* 80.0 (the float current-cells)) (the float total-cells)) - (/ (* 10.0 (the float current-orbs)) (the float total-orbs)) - (/ (* 10.0 (the float current-buzzers)) (the float total-buzzers)) - ) - ) - -(define *progress-save-info* (new 'global 'mc-slot-info)) - -(defmacro progress-make-manipy-icon (obj &key skel - &key x - &key y - &key z - &key scale-x - &key scale-y - ) - `(when (< (-> ,obj nb-of-icons) 6) - (let ((icon-idx (-> ,obj nb-of-icons))) - (set! (-> ,obj icons icon-idx) (new 'static 'hud-icon)) - (let ((new-manipy (make-init-process manipy manipy-init (new 'static 'vector :w 1.0) #f ,skel #f - :to ,obj - :stack *scratch-memory-top* - ))) - (when new-manipy - (set! (-> (-> new-manipy) draw dma-add-func) dma-add-process-drawable-hud) - (set-vector! (-> (-> new-manipy) root trans) 0.0 0.0 0.0 1.0) - (set-vector! (-> (-> new-manipy) root scale) ,scale-x ,scale-y ,scale-x 1.0) - (when #f - (send-event (ppointer->process new-manipy) 'trans-hook #f) - ) - ) - (set! (-> ,obj icons icon-idx icon) new-manipy) - (when new-manipy - (logior! (-> new-manipy 0 mask) (process-mask pause)) - (logclear! (-> new-manipy 0 mask) (process-mask menu progress)) - (set! (-> (-> new-manipy) root trans z) ,z) - (set! (-> ,obj icons icon-idx icon-x) ,x) - (set! (-> ,obj icons icon-idx icon-y) ,y) - (set! (-> ,obj icons icon-idx icon-z) 0) - (set! (-> ,obj icons icon-idx scale-x) ,scale-x) - (set! (-> ,obj icons icon-idx scale-y) ,scale-y) - ) - ) - ) - (+! (-> ,obj nb-of-icons) 1) - ) - ) - -(defmethod initialize-icons progress ((obj progress)) - (progress-make-manipy-icon obj :skel *fuelcell-naked-sg* - :x 256 - :y 77 - :z (meters 0.5) - :scale-x 0.006 - :scale-y 0.006 - ) - (progress-make-manipy-icon obj :skel *fuelcell-naked-sg* - :x 256 - :y 77 - :z (meters 0.5) - :scale-x 0.006 - :scale-y 0.006 - ) - (progress-make-manipy-icon obj :skel *fuelcell-naked-sg* - :x 256 - :y 77 - :z (meters 0.5) - :scale-x 0.006 - :scale-y 0.006 - ) - (progress-make-manipy-icon obj :skel *fuelcell-naked-sg* - :x 256 - :y 77 - :z (meters 0.5) - :scale-x 0.006 - :scale-y 0.006 - ) - (progress-make-manipy-icon obj :skel *money-sg* - :x -320 - :y 253 - :z (meters 17) - :scale-x 0.013 - :scale-y -0.015 - ) - (progress-make-manipy-icon obj :skel *money-sg* - :x -320 - :y 253 - :z (meters 0.25) - :scale-x 0.008 - :scale-y -0.009 - ) - (send-event (ppointer->process (-> obj icons 1 icon)) 'set-frame-num 2.5) - (send-event (ppointer->process (-> obj icons 2 icon)) 'set-frame-num 10.0) - (send-event (ppointer->process (-> obj icons 3 icon)) 'set-frame-num 15.5) - 0 - (none) - ) - -(defmethod enter! progress ((obj progress) (screen progress-screen) (option int)) - (when (!= (-> obj display-state) screen) - (set! (-> *progress-state* yes-no-choice) #f) - (set! (-> obj selected-option) #f) - (set! (-> obj option-index) option) - (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) - (set! (-> obj display-state) screen) - (set! (-> obj next-display-state) screen) - (set-transition-speed! obj) - (case (-> obj display-state) - (((progress-screen memcard-creating)) - (auto-save-command 'create-file 0 0 obj) - ) - (((progress-screen memcard-loading)) - (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which)) - (sound-volume-off) - (auto-save-command 'restore 0 (-> *progress-state* which) obj) - ) - (((progress-screen memcard-saving)) - (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which)) - (auto-save-command 'save 0 (-> *progress-state* which) obj) - ) - (((progress-screen memcard-formatting)) - (auto-save-command 'format-card 0 0 obj) - ) - (((progress-screen save-game) (progress-screen load-game)) - (set! (-> obj option-index) (max 0 (-> *progress-state* last-slot-saved))) - ) - (((progress-screen memcard-removed)) - (set! (-> *progress-state* last-slot-saved) 0) - 0 - ) - ) - ) - 0 - (none) - ) - -(defmethod push! progress ((obj progress)) - (let ((v1-0 (-> obj display-state-pos))) - (cond - ((< v1-0 5) - (set! (-> obj display-state-stack v1-0) (-> obj display-state)) - (set! (-> obj option-index-stack v1-0) (-> obj option-index)) - (set! (-> obj display-state-pos) (+ v1-0 1)) - ) - (else - (format #t "ERROR: Can't push any more states on the display-state-stack.~%") - ) - ) - ) - 0 - (none) - ) - -(defmethod pop! progress ((obj progress)) - (let ((v1-0 (-> obj display-state-pos))) - (cond - ((> v1-0 0) - (let ((a2-0 (+ v1-0 -1))) - (set! (-> obj display-state-pos) a2-0) - (enter! obj (-> obj display-state-stack a2-0) (-> obj option-index-stack a2-0)) - ) - ) - (else - (set-master-mode 'game) - ) - ) - ) - 0 - (none) - ) - -(defmethod set-transition-progress! progress ((obj progress) (arg0 int)) - (set! (-> obj transition-offset) arg0) - (set! (-> obj transition-offset-invert) (- 512 arg0)) - (set! (-> obj transition-percentage) (* 0.001953125 (the float arg0))) - (set! (-> obj transition-percentage-invert) (- 1.0 (-> obj transition-percentage))) - 0 - (none) - ) - -(defmethod set-transition-speed! progress ((obj progress)) - (case (-> obj display-state) - (((progress-screen fuel-cell) - (progress-screen money) - (progress-screen buzzer) - (progress-screen load-game) - (progress-screen save-game) - (progress-screen save-game-title) - ) - (set! (-> obj transition-speed) 15.0) - ) - (else - (set! (-> obj transition-speed) 45.0) - ) - ) - 0 - (none) - ) - -(defbehavior progress-init-by-other progress () - (logclear! (-> self mask) (process-mask menu progress)) - (set! (-> self nb-of-particles) 0) - (set! (-> self max-nb-of-particles) 40) - (set! (-> self nb-of-icons) 0) - (set! (-> self in-out-position) 4096) - (set! (-> self current-debug-string) 0) - (set! (-> self current-debug-group) 0) - (set! (-> self display-level-index) 0) - (set! (-> self next-level-index) 0) - (set! (-> self option-index) 0) - (set! (-> self selected-option) #f) - (set! (-> self card-info) #f) - (set! (-> self last-option-index-change) (-> *display* real-frame-counter)) - (set! (-> self display-state-pos) 0) - (set! (-> self in-transition) #f) - (set! (-> self force-transition) #f) - (set! (-> self stat-transition) #f) - (set! (-> self level-transition) 0) - (set! (-> self left-side-x-scale) 0.0) - (set! (-> self left-side-y-scale) 0.0) - (set! (-> self right-side-x-scale) 0.0) - (set! (-> self right-side-y-scale) 0.0) - (dotimes (v1-6 5) - (set! (-> self display-state-stack v1-6) (progress-screen fuel-cell)) - ) - (init-game-options self) - (initialize-icons self) - (initialize-particles self) - (set! (-> self particle-state 0) 0) - (set! (-> self particle-state 1) 0) - (set! (-> self particle-state 2) 0) - (set! (-> self particle-state 3) 0) - (set! (-> self particle-state 4) 0) - (set! (-> self particle-state 5) 0) - (set! (-> self particle-state 6) 1) - (set! (-> self particle-state 7) 1) - (set! (-> self particle-state 8) 1) - (set! (-> self particle-state 9) 1) - (set! (-> self particle-state 10) 1) - (set! (-> self particle-state 11) 1) - (set! (-> self particle-state 12) 1) - (set! (-> self particle-state 13) 1) - (set! (-> self particle-state 14) 0) - (set! (-> self particle-state 15) 0) - (set! (-> self particle-state 16) 3) - (set! (-> self particle-state 17) 0) - (set! (-> self particle-state 18) 0) - (set! (-> self particle-state 19) 0) - (set! (-> self particle-state 20) 0) - (set! (-> self particle-state 21) 0) - (set! (-> self particle-state 22) 0) - (set! (-> self particle-state 23) 0) - (set! (-> self particle-state 24) 0) - (set! (-> self particle-state 25) 0) - (set! (-> self particle-state 26) 0) - (set! (-> self particle-state 27) 0) - (set! (-> self particle-state 28) 0) - (set! (-> self particle-state 29) 0) - (set! (-> self particle-state 30) 0) - (set! (-> self particle-state 31) 0) - (let ((gp-0 (new 'stack-no-clear 'quaternion))) - (quaternion-axis-angle! gp-0 0.0 1.0 0.0 16384.0) - (quaternion*! (-> self icons 0 icon 0 root quat) gp-0 (-> self icons 0 icon 0 root quat)) - (quaternion-axis-angle! gp-0 0.0 1.0 0.0 32768.0) - (quaternion*! (-> self icons 1 icon 0 root quat) gp-0 (-> self icons 1 icon 0 root quat)) - (quaternion-axis-angle! gp-0 0.0 1.0 0.0 49152.0) - (quaternion*! (-> self icons 2 icon 0 root quat) gp-0 (-> self icons 2 icon 0 root quat)) - (quaternion-axis-angle! gp-0 0.0 1.0 0.0 0.0) - (quaternion*! (-> self icons 3 icon 0 root quat) gp-0 (-> self icons 3 icon 0 root quat)) - ) - (adjust-ratios self (get-aspect-ratio) (get-video-mode)) - (adjust-icons self) - (set! (-> self event-hook) (-> progress-waiting event)) - (go progress-waiting) - (none) - ) - -(define *progress-stack* (the-as (pointer uint8) (malloc 'global #x3800))) -(defconstant *progress-stack-top* (&-> *progress-stack* #x3800)) - -(defun activate-progress ((creator process) (screen progress-screen)) - (when *target* - (cond - ((not *progress-process*) - (when (progress-allowed?) - (hide-hud) - (make-levels-with-tasks-available-to-progress) - (disable-level-text-file-loading) - (set! (-> *progress-state* starting-state) screen) - (let ((s4-0 (get-process *default-dead-pool* progress #x4000))) - (set! *progress-process* - (the-as (pointer progress) (when s4-0 - (let ((t9-5 (method-of-type progress activate))) - (t9-5 (the-as progress s4-0) creator 'progress (&-> *progress-stack* 14336)) - ) - (run-now-in-process s4-0 progress-init-by-other) - (-> s4-0 ppointer) - ) - ) - ) - ) - (let ((s5-1 *progress-process*)) - (set! (-> s5-1 0 completion-percentage) (calculate-completion (-> s5-1 0))) - (set! *master-mode* 'progress) - (let ((s4-1 (-> *target* current-level))) - (cond - ((!= *kernel-boot-message* 'play) - (set! (-> s5-1 0 display-level-index) 4) - ) - ((or (= s4-1 #f) (< (length *level-task-data-remap*) (-> s4-1 info index))) - (set! (-> s5-1 0 display-level-index) 0) - 0 - ) - (else - (set! (-> s5-1 0 display-level-index) (-> *level-task-data-remap* (+ (-> s4-1 info index) -1))) - ) - ) - ) - (set! (-> s5-1 0 next-level-index) (-> s5-1 0 display-level-index)) - (set! (-> s5-1 0 display-state) (progress-screen invalid)) - (set-transition-progress! (-> s5-1 0) 512) - (set! (-> s5-1 0 task-index) (get-next-task-up -1 (-> s5-1 0 display-level-index))) - ) - ) - (when *progress-process* - (enter! (-> *progress-process* 0) screen 0) - (set! (-> *progress-process* 0 card-info) #f) - ) - ) - (else - (push! (-> *progress-process* 0)) - (set! (-> *progress-process* 0 next-display-state) screen) - (set! (-> *progress-process* 0 card-info) #f) - ) - ) - ) - 0 - (none) - ) - -(defun deactivate-progress () - (when (and *progress-process* (= (-> *progress-process* 0 next-state name) 'progress-gone)) - (copy-settings-from-target! *setting-control*) - (dotimes (gp-0 (-> *progress-process* 0 nb-of-particles)) - (kill-and-free-particles (-> *progress-process* 0 particles gp-0 part)) - (set! (-> *progress-process* 0 particles gp-0 part matrix) -1) - ) - (set! (-> *progress-process* 0 nb-of-particles) 0) - (deactivate (-> *progress-process* 0)) - (set! *progress-process* (the-as (pointer progress) #f)) - (enable-level-text-file-loading) - ) - 0 - (none) - ) - -(defun hide-progress-screen () - "shoo!" - - (if *progress-process* - (send-event (ppointer->process *progress-process*) 'go-away) - ) - 0 - (none) - ) - -(defun hide-progress-icons () - (let ((v1-0 6)) - (dotimes (a0-0 8) - (set! (-> *progress-process* 0 particles v1-0 init-pos x) -320.0) - (+! v1-0 1) - ) - ) - (set! (-> *progress-process* 0 particles 5 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 14 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 15 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 19 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 20 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 21 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 22 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 23 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 24 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 25 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 26 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 27 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 28 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 29 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 30 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 31 init-pos x) -320.0) - (set! (-> *progress-process* 0 icons 4 icon-x) -320) - 0 - (none) - ) - -(defmethod relocate game-count-info ((obj game-count-info) (arg0 int)) - "Load in the game-count-info. This is a bit of a hack." - (set! *game-counts* obj) - ) - -(defmethod relocate progress ((obj progress) (arg0 int)) - (dotimes (v1-0 (-> obj nb-of-particles)) - (when (-> obj particles v1-0 part) - (if (nonzero? (-> obj particles v1-0 part)) - (set! (-> obj particles v1-0 part) - (the-as sparticle-launch-control (&+ (the-as pointer (-> obj particles v1-0 part)) arg0)) - ) - ) - ) - ) - (the-as progress ((method-of-type process relocate) obj arg0)) - ) - -(defmethod adjust-sprites progress ((obj progress)) - (let ((f0-1 (* (1/ METER_LENGTH) (the float (-> obj in-out-position))))) - (set! (-> obj particles 2 init-pos x) (the float (+ (-> obj right-x-offset) 409 (the int (* 301.5 f0-1))))) - (set! (-> obj particles 1 init-pos x) (the float (+ (-> obj left-x-offset) 59))) - (set! (-> obj left-side-x-scale) (meters (+ (/ 3.5 (-> obj sides-x-scale)) (* 10.0 f0-1)))) - (set! (-> obj left-side-y-scale) (meters (+ (-> obj sides-y-scale) (* 10.0 f0-1)))) - (set! (-> obj right-side-x-scale) (meters (+ (/ 6.0 (-> obj sides-x-scale)) (* 4.0 f0-1)))) - (set! (-> obj right-side-y-scale) (meters (+ (-> obj sides-y-scale) (* 4.0 f0-1)))) - ) - (dotimes (s5-0 (-> obj nb-of-particles)) - (set! (-> obj particles s5-0 pos x) (+ -256.0 (-> obj particles s5-0 init-pos x))) - (set! (-> obj particles s5-0 pos y) - (* 0.5 (- (* (-> obj particles s5-0 init-pos y) (-> *video-parms* relative-y-scale)) - (the float (-> *video-parms* screen-sy)) - ) - ) - ) - (set! (-> obj particles s5-0 pos z) (-> obj particles s5-0 init-pos z)) - (if (> (-> obj particles s5-0 part matrix) 0) - (set-vector! (sprite-get-user-hvdf (-> obj particles s5-0 part matrix)) - (the float (+ (the int (-> obj particles s5-0 pos x)) 2048)) - (the float (+ (the int (-> obj particles s5-0 pos y)) 2048)) - (- (-> *math-camera* hvdf-off z) (* 1024.0 (-> obj particles s5-0 pos z))) - (-> *math-camera* hvdf-off w) - ) - ) - (spawn (-> obj particles s5-0 part) *null-vector*) - ) - 0 - (none) - ) - -(defmethod adjust-icons progress ((obj progress)) - (dotimes (v1-0 (-> obj nb-of-icons)) - (when (>= v1-0 4) - (set-vector! (-> obj icons v1-0 icon 0 root scale) - (* (-> obj icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) - (* (-> obj icons v1-0 scale-y) (-> *video-parms* relative-y-scale)) - (* (-> obj icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) - 1.0 - ) - (set! (-> obj icons v1-0 icon 0 root trans x) (the float (+ (-> obj icons v1-0 icon-x) -256))) - (set! (-> obj icons v1-0 icon 0 root trans y) - (* (-> *video-parms* relative-y-scale) - (- (* (-> *video-parms* relative-y-scale) (the float (-> obj icons v1-0 icon-y))) - (the float (-> *video-parms* screen-sy)) - ) - ) - ) - ) - ) - 0 - (none) - ) - -(defmethod adjust-ratios progress ((obj progress) (aspect symbol) (video-mode symbol)) - (case aspect - (('aspect4x3) - (set! (-> obj sides-x-scale) 1.0) - (set! (-> obj sides-y-scale) 13.0) - (set! (-> obj left-x-offset) 0) - (set! (-> obj right-x-offset) 0) - (set! (-> obj button-scale) 1.0) - (set! (-> obj slot-scale) 8192.0) - (set! (-> obj small-orb-y-offset) 58) - (set! (-> obj icons 5 scale-x) 0.008) - (set! (-> obj icons 5 scale-y) -0.009) - (set! (-> obj big-orb-y-offset) 243) - (set! (-> obj icons 4 scale-x) 0.013) - (set! (-> obj icons 4 scale-y) -0.015) - ) - (('aspect16x9) - (set! (-> obj sides-x-scale) 1.2) - (set! (-> obj sides-y-scale) 9.8) - (set! (-> obj left-x-offset) -10) - (set! (-> obj right-x-offset) 17) - (set! (-> obj button-scale) 1.05) - (set! (-> obj slot-scale) 6144.0) - (set! (-> obj small-orb-y-offset) 59) - (set! (-> obj icons 5 scale-x) 0.008) - (set! (-> obj icons 5 scale-y) -0.0098) - (set! (-> obj big-orb-y-offset) 255) - (set! (-> obj icons 4 scale-x) 0.017) - (set! (-> obj icons 4 scale-y) -0.0205) - ) - ) - (when (= video-mode 'pal) - (set! (-> obj icons 5 scale-y) (* 1.15 (-> obj icons 5 scale-y))) - (set! (-> obj icons 4 scale-x) (* 1.05 (-> obj icons 4 scale-x))) - (set! (-> obj icons 4 scale-y) (* (-> obj icons 4 scale-y) (the-as float (if (= aspect 'aspect16x9) - 1.18 - 1.15 - ) - ) - ) - ) - (+! (-> obj big-orb-y-offset) (if (= aspect 'aspect16x9) - 3 - 2 - ) - ) - ) - 0 - (none) - ) - -(defmethod dummy-32 progress ((obj progress)) - (let ((v1-2 (-> *progress-process* 0 display-state)) - (a1-1 (-> *progress-state* starting-state)) - ) - (and (= (-> obj next-state name) 'progress-normal) - (not (-> obj in-transition)) - (not (-> obj selected-option)) - (or (= v1-2 (progress-screen fuel-cell)) - (= v1-2 (progress-screen money)) - (= v1-2 (progress-screen buzzer)) - (and (or (= a1-1 (progress-screen fuel-cell)) - (= a1-1 (progress-screen money)) - (= a1-1 (progress-screen buzzer)) - (= a1-1 (progress-screen title)) - ) - (or (= v1-2 (progress-screen settings)) - (= v1-2 (progress-screen game-settings)) - (= v1-2 (progress-screen graphic-settings)) - (= v1-2 (progress-screen sound-settings)) - (= v1-2 (progress-screen title)) - (= v1-2 (progress-screen settings-title)) - (= v1-2 (progress-screen language-options)) - ) - ) - ) - ) - ) - ) - -(defmethod dummy-19 progress ((obj progress)) - (the-as symbol (and *progress-process* (zero? (-> *progress-process* 0 in-out-position)))) - ) - -(defmethod hidden? progress ((obj progress)) - (or (not *progress-process*) (= (-> *progress-process* 0 in-out-position) 4096)) - ) - -(defstate progress-waiting (progress) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('go-away) - (go progress-gone) - ) - ) - ) - :code - (behavior () - (loop - (when (hud-hidden?) - (dotimes (gp-0 (-> self nb-of-particles)) - (if (= (-> self particles gp-0 part matrix) -1) - (set! (-> self particles gp-0 part matrix) (sprite-allocate-user-hvdf)) - ) - ) - (set-setting! *setting-control* self 'common-page 'set 0.0 1) - (suspend) - (go progress-coming-in) - ) - (suspend) - ) - (none) - ) - ) - -(defstate progress-gone (progress) - :code - (behavior () - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (copy-settings-from-target! *setting-control*) - (logior! (-> self mask) (process-mask sleep)) - (suspend) - 0 - (none) - ) - ) - -(defmethod dummy-53 progress ((obj progress) (arg0 progress-screen)) - "Changes the next progress screen if need be for saving related reasons" - (let ((s4-0 (-> obj card-info)) - (gp-0 arg0) - ) - (when s4-0 - (case arg0 - (((progress-screen memcard-no-space) - (progress-screen memcard-not-inserted) - (progress-screen memcard-not-formatted) - ) - (cond - ((zero? (-> s4-0 handle)) - (set! gp-0 (progress-screen memcard-not-inserted)) - ) - ((zero? (-> s4-0 formatted)) - (cond - ((or (zero? (-> obj display-state-pos)) - (and (!= (-> *progress-state* starting-state) 27) (nonzero? (-> *progress-state* starting-state))) - ) - (set-master-mode 'game) - ) - (else - (if (!= arg0 (progress-screen memcard-not-formatted)) - (set! gp-0 (progress-screen memcard-format)) - ) - ) - ) - ) - ((and (zero? (-> s4-0 inited)) (< (-> s4-0 mem-actual) (-> s4-0 mem-required))) - (set! gp-0 (progress-screen memcard-no-space)) - ) - ((or (zero? (-> obj display-state-pos)) - (and (!= (-> *progress-state* starting-state) 27) (nonzero? (-> *progress-state* starting-state))) - ) - (set-master-mode 'game) - ) - (else - (set! gp-0 (progress-screen save-game)) - ) - ) - ) - (((progress-screen memcard-insert)) - (if (= (-> s4-0 inited) 1) - (set! gp-0 (progress-screen load-game)) - ) - ) - ) - (cond - ((zero? (-> s4-0 handle)) - (cond - ((-> *setting-control* current auto-save) - (set! gp-0 (progress-screen memcard-removed)) - ) - (else - (cond - ((= arg0 (progress-screen load-game)) - (set! gp-0 (progress-screen memcard-insert)) - ) - ((or (= arg0 (progress-screen memcard-format)) - (= arg0 (progress-screen memcard-no-space)) - (= arg0 (progress-screen memcard-not-formatted)) - (= arg0 (progress-screen save-game)) - (= arg0 (progress-screen save-game-title)) - (= arg0 (progress-screen memcard-no-data)) - (= arg0 (progress-screen memcard-data-exists)) - ) - (set! gp-0 (progress-screen memcard-not-inserted)) - ) - ) - ) - ) - ) - ((zero? (-> s4-0 formatted)) - (case arg0 - (((progress-screen load-game)) - (set! gp-0 (progress-screen memcard-insert)) - ) - (((progress-screen save-game) (progress-screen save-game-title)) - (set! gp-0 (progress-screen memcard-format)) - ) - ) - ) - ((zero? (-> s4-0 inited)) - (case arg0 - (((progress-screen save-game) (progress-screen save-game-title)) - (if (>= (-> s4-0 mem-actual) (-> s4-0 mem-required)) - (set! gp-0 (progress-screen memcard-no-data)) - (set! gp-0 (progress-screen memcard-no-space)) - ) - ) - (((progress-screen load-game)) - (set! gp-0 (progress-screen memcard-insert)) - ) - ) - ) - ) - ) - gp-0 - ) - ) - -(defmethod dummy-31 progress ((obj progress)) - (let ((s5-0 (-> obj card-info))) - (when (and s5-0 (not (-> obj in-transition))) - (when (or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (case (-> obj display-state) - (((progress-screen load-game)) - (cond - ((< (-> obj option-index) 4) - (when (nonzero? (-> s5-0 file (-> obj option-index) present)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> *progress-state* which) (-> obj option-index)) - (set! (-> obj next-display-state) (progress-screen memcard-loading)) - ) - ) - (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - (((progress-screen save-game) (progress-screen save-game-title)) - (cond - ((< (-> obj option-index) 4) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> *progress-state* which) (-> obj option-index)) - (if (zero? (-> s5-0 file (-> obj option-index) present)) - (set! (-> obj next-display-state) (progress-screen memcard-saving)) - (set! (-> obj next-display-state) (progress-screen memcard-data-exists)) - ) - ) - ((and (= (-> obj display-state) (progress-screen save-game-title)) (= (-> obj option-index) 4)) - (sound-play-by-name (static-sound-name "starts-options") (new-sound-id) 1024 0 0 1 #t) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "intro-start") - (set-master-mode 'game) - ) - (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - (((progress-screen memcard-insert)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - (((progress-screen memcard-data-exists)) - (cond - ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen memcard-saving)) - ) - ((begin - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (= (-> obj display-state-stack 0) (progress-screen title)) - ) - (set! (-> obj next-display-state) (progress-screen save-game-title)) - ) - (else - (set! (-> obj next-display-state) (progress-screen save-game)) - ) - ) - ) - (((progress-screen memcard-no-data)) - (cond - ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen memcard-creating)) - ) - (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "intro-start") - (set-master-mode 'game) - ) - ) - ) - (((progress-screen memcard-no-space) - (progress-screen memcard-not-inserted) - (progress-screen memcard-not-formatted) - ) - (cond - ((= (-> obj display-state-stack 0) (progress-screen title)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "intro-start") - (set-master-mode 'game) - ) - ((nonzero? (-> obj display-state-stack 0)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set-master-mode 'game) - ) - (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - (((progress-screen memcard-error-loading) - (progress-screen memcard-error-saving) - (progress-screen memcard-error-formatting) - (progress-screen memcard-error-creating) - (progress-screen memcard-auto-save-error) - (progress-screen memcard-removed) - (progress-screen auto-save) - ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - (((progress-screen pal-change-to-60hz)) - (cond - ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (set! (-> obj video-mode-timeout) (-> *display* real-frame-counter)) - (set! (-> obj next-display-state) (progress-screen pal-now-60hz)) - ) - (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> *progress-state* video-mode-choice) 'pal) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - (((progress-screen pal-now-60hz)) - (cond - ((not (-> *progress-state* yes-no-choice)) - (set! (-> *progress-state* video-mode-choice) 'pal) - (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - ) - (else - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - ) - ) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - (((progress-screen no-disc) (progress-screen bad-disc)) - (when (is-cd-in?) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - (((progress-screen quit)) - (cond - ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "title-start") - ) - (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - (((progress-screen memcard-format)) - (cond - ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen memcard-formatting)) - ) - ((= (-> obj display-state-stack 0) (progress-screen title)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "intro-start") - (set-master-mode 'game) - ) - (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - ) - ) - ) - ) - 0 - (none) - ) - -(defmethod dummy-29 progress ((obj progress)) - (mc-get-slot-info 0 *progress-save-info*) - (set! (-> obj card-info) *progress-save-info*) - (let ((s5-0 (-> *options-remap* (-> obj display-state)))) - (when (and s5-0 (not (-> obj in-transition))) - (cond - ((cpad-hold? 0 up) - (cond - ((cpad-pressed? 0 up) - (when (not (-> obj selected-option)) - (if (!= (length s5-0) 1) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) - ) - (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) - (if (> (-> obj option-index) 0) - (+! (-> obj option-index) -1) - (set! (-> obj option-index) (+ (length s5-0) -1)) - ) - ) - ) - (else - (when (-> obj selected-option) - (let ((v1-34 #f)) - (case (-> s5-0 (-> obj option-index) option-type) - ((3) - (when (< -48 (-> *setting-control* current screeny)) - (set! v1-34 #t) - (+! (-> *setting-control* default screeny) -1) - ) - ) - ) - (when v1-34 - (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) - (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) 1024 0 0 1 #t) - ) - ) - ) - ) - ) - ) - ) - ((cpad-hold? 0 down) - (cond - ((cpad-pressed? 0 down) - (when (not (-> obj selected-option)) - (if (!= (length s5-0) 1) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) - ) - (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) - (cond - ((< (-> obj option-index) (+ (length s5-0) -1)) - (+! (-> obj option-index) 1) - ) - (else - (set! (-> obj option-index) 0) - 0 - ) - ) - ) - ) - (else - (when (-> obj selected-option) - (let ((v1-69 #f)) - (case (-> s5-0 (-> obj option-index) option-type) - ((3) - (when (< (-> *setting-control* current screeny) 48) - (set! v1-69 #t) - (+! (-> *setting-control* default screeny) 1) - ) - ) - ) - (when v1-69 - (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) - (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) 1024 0 0 1 #t) - ) - ) - ) - ) - ) - ) - ) - ((cpad-hold? 0 left) - (cond - ((cpad-pressed? 0 left) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) 7)) - (let ((play-sound? #f)) - (case (-> s5-0 (-> obj option-index) option-type) - ((2 7) - (when (not (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)))) - (set! play-sound? #t) - (if (= (-> s5-0 (-> obj option-index) value-to-modify) (&-> *setting-control* current vibration)) - (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) - ) - ) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #t) - ) - ((4) - (set! play-sound? (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect16x9)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect4x3) - ) - ((5) - (set! play-sound? (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'ntsc)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'pal) - ) - ((#x15) - (set! play-sound? (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #f)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #t)) - ;; arbitrary list options - ((1 #x10 #x11 #x12 #x13 #x14) - ;; every list moves the same way, common logic - (set! (-> *progress-menu-list-tracker* transition?) #t) - (set! (-> *progress-menu-list-tracker* direction) 'left) - (set! play-sound? #t) - ;; now the per menu logic...this should all be refactored and made easier but...must resist - (case (-> s5-0 (-> obj option-index) option-type) - ;; language selection - ((1) - (if (= (-> *progress-menu-list-tracker* selected-index) 0) - (set! (-> *progress-menu-list-tracker* selected-index) (dec (length *language-name-remap*))) - (set! (-> *progress-menu-list-tracker* selected-index) (dec (-> *progress-menu-list-tracker* selected-index)))) - (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-menu-list-tracker* selected-index))) - ;; display mode setting - ((#x12) - ;; get the current selected item - (let ((curr-val (-> *pc-graphics-display-mode-symbol-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (first-arr *pc-graphics-display-mode-symbol-options*)) - ;; if we've hit the beginning, wrap around to the end - (set! (-> *progress-menu-list-tracker* selected-index) - (last-idx-arr *pc-graphics-display-mode-symbol-options*)) - ;; else just move left - (set! (-> *progress-menu-list-tracker* selected-index) - (dec (-> *progress-menu-list-tracker* selected-index)))))) - ;; aspect ratio setting - ((#x10) - (if (-> *pc-settings* use-original-aspect-ratio?) - (let ((curr-val (-> *pc-graphics-original-aspect-ratio-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (first-arr *pc-graphics-original-aspect-ratio-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) - (last-idx-arr *pc-graphics-original-aspect-ratio-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) - (dec (-> *progress-menu-list-tracker* selected-index))))) - (let ((curr-val (-> *pc-graphics-aspect-ratio-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (first-arr *pc-graphics-aspect-ratio-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) - (last-idx-arr *pc-graphics-aspect-ratio-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) - (dec (-> *progress-menu-list-tracker* selected-index))))))) - ;; resolution setting - ;; this is a little more sophisticated -- only display the ones related to the aspect ratio - ((#x11) - (let ((curr-idx (-> *progress-menu-list-tracker* selected-index)) - (new-idx (dec (-> *progress-menu-list-tracker* selected-index)))) - (case (-> *pc-settings* aspect-ratio-mode) - (('orig-aspect-4x3) - (when (= (-> *pc-graphics-4x3-valid-resolutions* curr-idx) - (first-arr *pc-graphics-4x3-valid-resolutions*)) - (set! new-idx (last-idx-arr *pc-graphics-4x3-valid-resolutions*)))) - (('orig-aspect-16x9) - (when (= (-> *pc-graphics-16x9-valid-resolutions* curr-idx) - (first-arr *pc-graphics-16x9-valid-resolutions*)) - (set! new-idx (last-idx-arr *pc-graphics-16x9-valid-resolutions*)))) - (('pc-aspect-4x3) - (when (= (-> *pc-graphics-4x3-valid-resolutions* curr-idx) - (first-arr *pc-graphics-4x3-valid-resolutions*)) - (set! new-idx (last-idx-arr *pc-graphics-4x3-valid-resolutions*)))) - (('pc-aspect-5x4) - (when (= (-> *pc-graphics-5x4-valid-resolutions* curr-idx) - (first-arr *pc-graphics-5x4-valid-resolutions*)) - (set! new-idx (last-idx-arr *pc-graphics-5x4-valid-resolutions*)))) - (('pc-aspect-16x9) - (when (= (-> *pc-graphics-16x9-valid-resolutions* curr-idx) - (first-arr *pc-graphics-16x9-valid-resolutions*)) - (set! new-idx (last-idx-arr *pc-graphics-16x9-valid-resolutions*)))) - (('pc-aspect-21x9) - (when (= (-> *pc-graphics-21x9-valid-resolutions* curr-idx) - (first-arr *pc-graphics-21x9-valid-resolutions*)) - (set! new-idx (last-idx-arr *pc-graphics-21x9-valid-resolutions*)))) - (('pc-aspect-32x9) - (when (= (-> *pc-graphics-32x9-valid-resolutions* curr-idx) - (first-arr *pc-graphics-32x9-valid-resolutions*)) - (set! new-idx (last-idx-arr *pc-graphics-32x9-valid-resolutions*))))) - (set! (-> *progress-menu-list-tracker* selected-index) new-idx))) - ;; subtitle language selection - ((#x13) - (if (= (-> *progress-menu-list-tracker* selected-index) 0) - (set! (-> *progress-menu-list-tracker* selected-index) (dec (length *pc-subtitle-language-name-remap*))) - (set! (-> *progress-menu-list-tracker* selected-index) (dec (-> *progress-menu-list-tracker* selected-index))))) - ((#x14) - ;; get the current selected item - (let ((curr-val (-> *pc-subtitle-speaker-valid-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (first-arr *pc-subtitle-speaker-valid-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) - (last-idx-arr *pc-subtitle-speaker-valid-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) - (dec (-> *progress-menu-list-tracker* selected-index))))))) - (format 0 "VAS: Moving Left. New Index: ~D~%" (-> *progress-menu-list-tracker* selected-index)))) - (if play-sound? - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t))))) - (else - (when (-> obj selected-option) - (let ((v1-157 #f)) - (let ((a0-101 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? a0-101) - (cond - ((>= (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ 1.0 (-> s5-0 (-> obj option-index) param1)) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ -1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - (set! v1-157 #t) - ) - ((< (-> s5-0 (-> obj option-index) param1) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param1) - ) - (set! v1-157 #t) - ) - ) - ) - ((= a0-101 3) - (when (< -96 (-> *setting-control* default screenx)) - (set! v1-157 #t) - (+! (-> *setting-control* default screenx) -1) - ) - ) - ) - ) - (when v1-157 - (let ((f30-0 100.0)) - (case (-> s5-0 (-> obj option-index) name) - (((game-text-id music-volume) (game-text-id speech-volume)) - (set! f30-0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) - (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 f30-0)) 0 0 1 #t) - ) - ) - ) - ) - ) - ) - ) - ) - ((cpad-hold? 0 right) - (cond - ((cpad-pressed? 0 right) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) 7)) - (let ((play-sound? #f)) - (case (-> s5-0 (-> obj option-index) option-type) - ((2 7) - (set! play-sound? (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)))) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #f) - ) - ((4) - (set! play-sound? (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect4x3)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect16x9) - ) - ((5) - (set! play-sound? (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'pal)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'ntsc) - ) - ((#x15) - (set! play-sound? (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #t)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #f)) - ;; arbitrary list options - ((1 #x10 #x11 #x12 #x13 #x14) - ;; every list moves the same way, common logic - (set! (-> *progress-menu-list-tracker* transition?) #t) - (set! (-> *progress-menu-list-tracker* direction) 'right) - (set! play-sound? #t) - ;; now the per menu logic...this should all be refactored and made easier but...must resist - (case (-> s5-0 (-> obj option-index) option-type) - ;; language selection - ((1) - (if (= (-> *progress-menu-list-tracker* selected-index) (dec (length *language-name-remap*))) - (set! (-> *progress-menu-list-tracker* selected-index) 0) - (set! (-> *progress-menu-list-tracker* selected-index) (inc (-> *progress-menu-list-tracker* selected-index)))) - (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-menu-list-tracker* selected-index))) - ;; display mode setting - ((#x12) - ;; get the current selected item - (let ((curr-val (-> *pc-graphics-display-mode-symbol-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (last-arr *pc-graphics-display-mode-symbol-options*)) - ;; if we've hit the end, wrap around to the beginning - (set! (-> *progress-menu-list-tracker* selected-index) 0) - ;; else just move right - (set! (-> *progress-menu-list-tracker* selected-index) - (inc (-> *progress-menu-list-tracker* selected-index)))))) - ;; aspect ratio setting - ((#x10) - (if (-> *pc-settings* use-original-aspect-ratio?) - (let ((curr-val (-> *pc-graphics-original-aspect-ratio-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (last-arr *pc-graphics-original-aspect-ratio-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) 0) - (set! (-> *progress-menu-list-tracker* selected-index) - (inc (-> *progress-menu-list-tracker* selected-index))))) - (let ((curr-val (-> *pc-graphics-aspect-ratio-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (last-arr *pc-graphics-aspect-ratio-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) 0) - (set! (-> *progress-menu-list-tracker* selected-index) - (inc (-> *progress-menu-list-tracker* selected-index))))))) - ;; resolution setting - ;; this is a little more sophisticated -- only display the ones related to the aspect ratio - ((#x11) - (let ((curr-idx (-> *progress-menu-list-tracker* selected-index)) - (new-idx (inc (-> *progress-menu-list-tracker* selected-index)))) - (case (-> *pc-settings* aspect-ratio-mode) - (('orig-aspect-4x3) - (when (= (-> *pc-graphics-4x3-valid-resolutions* curr-idx) - (last-arr *pc-graphics-4x3-valid-resolutions*)) - (set! new-idx 0))) - (('orig-aspect-16x9) - (when (= (-> *pc-graphics-16x9-valid-resolutions* curr-idx) - (last-arr *pc-graphics-16x9-valid-resolutions*)) - (set! new-idx 0))) - (('pc-aspect-4x3) - (when (= (-> *pc-graphics-4x3-valid-resolutions* curr-idx) - (last-arr *pc-graphics-4x3-valid-resolutions*)) - (set! new-idx 0))) - (('pc-aspect-5x4) - (when (= (-> *pc-graphics-5x4-valid-resolutions* curr-idx) - (last-arr *pc-graphics-5x4-valid-resolutions*)) - (set! new-idx 0))) - (('pc-aspect-16x9) - (when (= (-> *pc-graphics-16x9-valid-resolutions* curr-idx) - (last-arr *pc-graphics-16x9-valid-resolutions*)) - (set! new-idx 0))) - (('pc-aspect-21x9) - (when (= (-> *pc-graphics-21x9-valid-resolutions* curr-idx) - (last-arr *pc-graphics-21x9-valid-resolutions*)) - (set! new-idx 0))) - (('pc-aspect-32x9) - (when (= (-> *pc-graphics-32x9-valid-resolutions* curr-idx) - (last-arr *pc-graphics-32x9-valid-resolutions*)) - (set! new-idx 0)))) - (set! (-> *progress-menu-list-tracker* selected-index) new-idx))) - ;; subtitle language selection - ((#x13) - (if (= (-> *progress-menu-list-tracker* selected-index) (dec (length *pc-subtitle-language-name-remap*))) - (set! (-> *progress-menu-list-tracker* selected-index) 0) - (set! (-> *progress-menu-list-tracker* selected-index) (inc (-> *progress-menu-list-tracker* selected-index))))) - ((#x14) - ;; get the current selected item - (let ((curr-val (-> *pc-subtitle-speaker-valid-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (last-arr *pc-subtitle-speaker-valid-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) 0) - (set! (-> *progress-menu-list-tracker* selected-index) - (inc (-> *progress-menu-list-tracker* selected-index))))))) - (format 0 "VAS: Moving Right. New Index: ~D~%" (-> *progress-menu-list-tracker* selected-index)))) - (if play-sound? - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t))))) - (else - (when (-> obj selected-option) - (let ((v1-263 #f)) - (let ((a0-177 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? a0-177) - (cond - ((>= (+ -1.0 (-> s5-0 (-> obj option-index) param2)) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ 1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - (set! v1-263 #t) - ) - ((< (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) - ) - (set! v1-263 #t) - ) - ) - ) - ((= a0-177 3) - (when (< (-> *setting-control* default screenx) 96) - (set! v1-263 #t) - (+! (-> *setting-control* default screenx) 1) - ) - ) - ) - ) - (when v1-263 - (let ((f30-1 100.0)) - (case (-> s5-0 (-> obj option-index) name) - (((game-text-id music-volume) (game-text-id speech-volume)) - (set! f30-1 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) - (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 f30-1)) 0 0 1 #t) - ) - ) - ) - ) - ) - ) - ) - ) - ((or (cpad-pressed? 0 square) (cpad-pressed? 0 triangle)) - (cond - ((-> obj selected-option) - (let ((v1-319 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? v1-319) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* slider-backup) - ) - ) - ((= v1-319 1) - (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* language-backup) - ) - ) - ((= v1-319 2) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* on-off-backup) - ) - ) - ((= v1-319 3) - (set! (-> *setting-control* default screenx) (-> *progress-state* center-x-backup)) - (set! (-> *setting-control* default screeny) (-> *progress-state* center-y-backup)) - ) - ((or (= v1-319 4) (= v1-319 5)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* aspect-ratio-backup) - ) - ) - ) - ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj selected-option) #f) - ) - ((or (dummy-32 obj) - (= (-> obj display-state) (progress-screen load-game)) - (= (-> obj display-state) (progress-screen save-game)) - (= (-> obj display-state) (progress-screen save-game-title)) - ) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons square)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons square)) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - (if (= (-> obj display-state) (progress-screen settings)) - (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - ) - (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - ;; confirm selection - ((or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) - (cond - ((not (-> obj selected-option)) - (cond - ((= (-> s5-0 (-> obj option-index) option-type) 6) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (push! obj) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (the-as progress-screen (-> s5-0 (-> obj option-index) param3))) - (case (-> obj next-display-state) - (((progress-screen load-game) - (progress-screen save-game) - (progress-screen save-game-title)) - (set! (-> obj next-display-state) - (dummy-53 obj (-> obj next-display-state))) - ) - ) - ) - ((= (-> s5-0 (-> obj option-index) option-type) 8) - (cond - ((= (-> s5-0 (-> obj option-index) name) (game-text-id exit-demo)) - (set! *master-exit* 'force) - (set-master-mode 'game) - ) - ((= (-> s5-0 (-> obj option-index) name) (game-text-id back)) - (if (= (-> obj display-state) (progress-screen settings)) - (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - ) - (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - ((!= (-> s5-0 (-> obj option-index) option-type) 7) - (let ((v1-427 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? v1-427) - (set! (-> *progress-state* slider-backup) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - ) - ) - ((= v1-427 1) - (set! (-> *progress-state* language-backup) - (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ((= v1-427 2) - (set! (-> *progress-state* on-off-backup) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ((= v1-427 3) - (set! (-> *progress-state* center-x-backup) (-> *setting-control* default screenx)) - (set! (-> *progress-state* center-y-backup) (-> *setting-control* default screeny)) - ) - ((= v1-427 #x15) - (set! (-> *progress-state* aspect-ratio-choice) (-> *pc-settings* use-original-aspect-ratio?))))) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (set! (-> obj selected-option) #t) - ;; arbitrary sized list options, they always scroll in the same manner - (when (or (= (-> s5-0 (-> obj option-index) option-type) 1) - (= (-> s5-0 (-> obj option-index) option-type) #x10) - (= (-> s5-0 (-> obj option-index) option-type) #x11) - (= (-> s5-0 (-> obj option-index) option-type) #x12) - (= (-> s5-0 (-> obj option-index) option-type) #x13) - (= (-> s5-0 (-> obj option-index) option-type) #x14)) - (format 0 "VAS: list option opened~%") - ;; reset tracker to defaults ;; defaults to left? - (set! (-> *progress-menu-list-tracker* direction) 'left) - (set! (-> *progress-menu-list-tracker* transition?) #f) - (set! (-> *progress-menu-list-tracker* x-offset) 0) - ;; each one has a slightly different handling though - ;; set the currently selected item - (case (-> s5-0 (-> obj option-index) option-type) - ((1) - (set! (-> *progress-menu-list-tracker* selected-index) - (the-as int (-> *setting-control* current language)))) - ((#x10) - (if (-> *pc-settings* use-original-aspect-ratio?) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-original-aspect-ratio-options* (-> *pc-settings* aspect-ratio-mode) 0)) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-aspect-ratio-options* (-> *pc-settings* aspect-ratio-mode) 0)))) - ((#x11) - (case (-> *pc-settings* aspect-ratio-mode) - (('orig-aspect-4x3) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-4x3-valid-resolutions* (-> *pc-settings* resolution) 0))) - (('orig-aspect-16x9) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-16x9-valid-resolutions* (-> *pc-settings* resolution) 0))) - (('pc-aspect-4x3) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-4x3-valid-resolutions* (-> *pc-settings* resolution) 0))) - (('pc-aspect-5x4) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-5x4-valid-resolutions* (-> *pc-settings* resolution) 0))) - (('pc-aspect-16x9) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-16x9-valid-resolutions* (-> *pc-settings* resolution) 0))) - (('pc-aspect-21x9) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-21x9-valid-resolutions* (-> *pc-settings* resolution) 0))) - (('pc-aspect-32x9) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-32x9-valid-resolutions* (-> *pc-settings* resolution) 0))))) - ((#x12) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-display-mode-symbol-options* (-> *pc-settings* display-mode) 0))) - ((#x13) - (set! (-> *progress-menu-list-tracker* selected-index) - (the-as int (-> *pc-settings* subtitle-language)))) - ((#x14) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-subtitle-speaker-valid-options* (-> *pc-settings* subtitle-speaker?) 0))))) - ) - ) - ) - (else - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj selected-option) #f) - (format 0 "VAS: list selection confirmed!~%") - (case (-> s5-0 (-> obj option-index) option-type) - ((#x15) - (use-orig-aspect-ratio! *pc-settings* (-> *progress-state* aspect-ratio-choice))) - ((5) - (case (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))) - (('pal) - (set! (-> *setting-control* default video-mode) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - (('ntsc) - (push! obj) - (set! (-> obj next-display-state) (progress-screen pal-change-to-60hz)) - ) - ) - ) - ((1) - (when (not (-> *progress-menu-list-tracker* transition?)) - (load-level-text-files (-> obj display-level-index)))) - ((#x10) - (if (-> *pc-settings* use-original-aspect-ratio?) - (set-aspect-ratio-mode! *pc-settings* - (-> *pc-graphics-original-aspect-ratio-options* (-> *progress-menu-list-tracker* selected-index))) - (set-aspect-ratio-mode! *pc-settings* - (-> *pc-graphics-aspect-ratio-options* (-> *progress-menu-list-tracker* selected-index))))) - ((#x11) - (case (-> *pc-settings* aspect-ratio-mode) - (('orig-aspect-4x3) - (set-resolution! *pc-settings* - (-> *pc-graphics-4x3-valid-resolutions* (-> *progress-menu-list-tracker* selected-index)))) - (('orig-aspect-16x9) - (set-resolution! *pc-settings* - (-> *pc-graphics-16x9-valid-resolutions* (-> *progress-menu-list-tracker* selected-index)))) - (('pc-aspect-4x3) - (set-resolution! *pc-settings* - (-> *pc-graphics-4x3-valid-resolutions* (-> *progress-menu-list-tracker* selected-index)))) - (('pc-aspect-5x4) - (set-resolution! *pc-settings* - (-> *pc-graphics-5x4-valid-resolutions* (-> *progress-menu-list-tracker* selected-index)))) - (('pc-aspect-16x9) - (set-resolution! *pc-settings* - (-> *pc-graphics-16x9-valid-resolutions* (-> *progress-menu-list-tracker* selected-index)))) - (('pc-aspect-21x9) - (set-resolution! *pc-settings* - (-> *pc-graphics-21x9-valid-resolutions* (-> *progress-menu-list-tracker* selected-index)))) - (('pc-aspect-32x9) - (set-resolution! *pc-settings* - (-> *pc-graphics-32x9-valid-resolutions* (-> *progress-menu-list-tracker* selected-index)))))) - ((#x12) - (set-display-mode! *pc-settings* - (-> *pc-graphics-display-mode-symbol-options* (-> *progress-menu-list-tracker* selected-index)))) - ((#x13) - (set! (-> *pc-settings* subtitle-language) - (the pc-subtitle-lang (-> *progress-menu-list-tracker* selected-index)))) - ((#x14) - (set! (-> *pc-settings* subtitle-speaker?) - (-> *pc-subtitle-speaker-valid-options* (-> *progress-menu-list-tracker* selected-index)))) - ) - ;; persist pc-settings - (commit-to-file *pc-settings*) - ) - ) - ) - ) - ) - ) - 0 - (none) - ) - -(defmethod respond-progress progress ((obj progress)) - (when (not (-> obj in-transition)) - (cond - ((cpad-pressed? 0 up) - (let ((s5-0 (-> obj display-level-index))) - (set! (-> obj next-level-index) (get-next-level-down s5-0)) - (when (!= s5-0 (-> obj next-level-index)) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj level-transition) 2) - ) - ) - ) - ((cpad-pressed? 0 down) - (let ((s5-2 (-> obj next-level-index))) - (set! (-> obj next-level-index) (get-next-level-up s5-2)) - (when (!= s5-2 (-> obj next-level-index)) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj level-transition) 1) - ) - ) - ) - ((cpad-pressed? 0 square) - (when (nonzero? (-> obj display-state)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen fuel-cell)) - (set! (-> obj stat-transition) #t) - ) - ) - ((cpad-pressed? 0 x) - (when (!= (-> obj display-state) (progress-screen money)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen money)) - (set! (-> obj stat-transition) #t) - ) - ) - ((cpad-pressed? 0 triangle) - (when (!= (-> obj display-state) (progress-screen buzzer)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen buzzer)) - (set! (-> obj stat-transition) #t) - ) - ) - ((cpad-pressed? 0 circle) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (push! obj) - (set! (-> obj next-display-state) (progress-screen settings)) - ) - ((= (-> obj display-state) (progress-screen fuel-cell)) - (cond - ((cpad-pressed? 0 left) - (let ((s5-8 (-> obj task-index))) - (set! (-> obj task-index) (get-next-task-down (-> obj task-index) (-> obj display-level-index))) - (if (!= s5-8 (-> obj task-index)) - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) - ) - ) - ) - ((cpad-pressed? 0 right) - (let ((s5-10 (-> obj task-index))) - (set! (-> obj task-index) (get-next-task-up (-> obj task-index) (-> obj display-level-index))) - (if (!= s5-10 (-> obj task-index)) - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) - ) - ) - ) - ) - ) - ) - ) - 0 - (none) - ) - -(defstate progress-normal (progress) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (local-vars (v0-0 none)) - (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'go-away) - (go progress-going-out) - ) - ((= v1-0 'notify) - (cond - ((= (-> arg3 param 0) 'done) - (case (-> self display-state) - (((progress-screen memcard-saving)) - (cond - ((= (-> self display-state-stack 0) (progress-screen title)) - (let ((gp-1 (-> *setting-control* default auto-save))) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "intro-start") - (set! (-> *setting-control* default auto-save) gp-1) - ) - (set-master-mode 'game) - ) - (else - (set! v0-0 (the-as none -1)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - ) - ) - (((progress-screen memcard-formatting)) - (set! (-> self force-transition) #t) - (set! v0-0 (the-as none 15)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-creating)) - (cond - ((= (-> self display-state-stack 0) (progress-screen title)) - (set! v0-0 (the-as none 18)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - ) - (else - (set! v0-0 (the-as none 17)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - ) - ) - v0-0 - ) - ) - ) - ((= (-> arg3 param 0) 'error) - (let ((t9-4 format) - (a0-17 #t) - (a1-2 "ERROR NOTIFY: ~S ~D~%") - (v1-13 (-> arg3 param 1)) - ) - (t9-4 - a0-17 - a1-2 - (cond - ((= v1-13 17) - "no-auto-save" - ) - ((= v1-13 16) - "no-process" - ) - ((= v1-13 15) - "bad-version" - ) - ((= v1-13 14) - "no-space" - ) - ((= v1-13 13) - "no-save" - ) - ((= v1-13 12) - "no-file" - ) - ((= v1-13 11) - "no-format" - ) - ((= v1-13 10) - "no-last" - ) - ((= v1-13 9) - "no-card" - ) - ((= v1-13 8) - "no-memory" - ) - ((= v1-13 7) - "new-game" - ) - ((= v1-13 6) - "read-error" - ) - ((= v1-13 5) - "write-error" - ) - ((= v1-13 4) - "internal-error" - ) - ((= v1-13 3) - "format-failed" - ) - ((= v1-13 2) - "bad-handle" - ) - ((= v1-13 1) - "ok" - ) - ((zero? v1-13) - "busy" - ) - (else - "*unknown*" - ) - ) - (-> self display-state) - ) - ) - (case (-> arg3 param 1) - ((14) - (set! v0-0 (the-as none 7)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (else - (case (-> self display-state) - (((progress-screen memcard-formatting)) - (set! v0-0 (the-as none 24)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-creating)) - (set! v0-0 (the-as none 25)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-saving)) - (set! v0-0 (the-as none 21)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-loading)) - (set! v0-0 (the-as none 20)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - ) - ) - ) - ) - ) - ) - ) - ) - ) - ) - :code - (behavior () - (loop - (when (and (cpad-hold? 0 l1) (cpad-hold? 0 r1) *cheat-mode*) - (when (and (< (-> self task-index) (-> *level-task-data* (-> self display-level-index) nb-of-tasks)) - (>= (-> self task-index) 0) - ) - (let ((gp-0 (-> *level-task-data* (-> self display-level-index) task-info (-> self task-index) task-id))) - (close-specific-task! gp-0 (task-status need-resolution)) - (send-event *target* 'get-pickup 6 (the float gp-0)) - ) - ) - ) - (if (and (= (-> self display-state) (-> self next-display-state)) - (= (-> self display-level-index) (-> self next-level-index)) - ) - (set! (-> self transition-offset) - (seekl - (-> self transition-offset) - 0 - (* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - (if (or (-> self stat-transition) (nonzero? (-> self level-transition))) - 2 - 1 - ) - ) - ) - ) - (set! (-> self transition-offset) - (seekl - (-> self transition-offset) - 512 - (* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - (if (or (-> self stat-transition) (nonzero? (-> self level-transition))) - 2 - 1 - ) - ) - ) - ) - ) - (set-transition-progress! self (-> self transition-offset)) - (set! (-> self in-transition) (or (-> self force-transition) (nonzero? (-> self transition-offset)))) - (when (and (not (handle->process (-> *game-info* auto-save-proc))) - (or (-> self force-transition) (-> self in-transition)) - (>= (-> self transition-offset) (if (and (zero? (-> self level-transition)) - (nonzero? (-> self next-display-state)) - (!= (-> self next-display-state) 1) - (!= (-> self next-display-state) 2) - ) - 512 - 256 - ) - ) - ) - (if (>= (the-as int (-> self next-display-state)) 0) - ;; transition to the next menu - (enter! self (-> self next-display-state) 0) - (pop! self) - ) - (set! (-> self display-level-index) (-> self next-level-index)) - (when (nonzero? (-> self level-transition)) - (set! (-> self task-index) (get-next-task-up -1 (-> self display-level-index))) - (case (-> self level-transition) - ((1) - (set! (-> self level-transition) 2) - ) - ((2) - (set! (-> self level-transition) 1) - ) - ) - ) - (set! (-> self force-transition) #f) - ) - (when (zero? (-> self transition-offset)) - (set! (-> self stat-transition) #f) - (set! (-> self level-transition) 0) - 0 - ) - (let ((gp-1 #f)) - (let ((v1-62 #f)) - (case (-> self display-state) - (((progress-screen fuel-cell) (progress-screen money) (progress-screen buzzer)) - (let ((s5-0 (-> self display-level-index))) - (when (and (< (mod (-> *display* real-frame-counter) 60) 30) - (zero? (-> *progress-process* 0 in-out-position)) - (not (-> self in-transition)) - (zero? (-> self transition-offset)) - ) - (set! gp-1 (!= s5-0 (get-next-level-up s5-0))) - (set! v1-62 (!= s5-0 (get-next-level-down s5-0))) - ) - ) - ) - ) - (set! (-> self particles 3 init-pos x) (the float (if v1-62 - (- 195 (-> *progress-process* 0 left-x-offset)) - -320 - ) - ) - ) - ) - (set! (-> self particles 4 init-pos x) (the float (if gp-1 - (- 195 (-> *progress-process* 0 left-x-offset)) - -320 - ) - ) - ) - ) - (dummy-29 self) - (set! (-> self next-display-state) - (dummy-53 self (-> self next-display-state))) - (let ((v1-74 (-> self display-state))) - (cond - ((or (= v1-74 (progress-screen fuel-cell)) - (or (= v1-74 (progress-screen money)) (= v1-74 (progress-screen buzzer))) - ) - (respond-progress self) - ) - ((or (= v1-74 (progress-screen memcard-no-space)) - (= v1-74 (progress-screen memcard-format)) - (= v1-74 (progress-screen memcard-data-exists)) - (= v1-74 (progress-screen memcard-insert)) - (= v1-74 (progress-screen load-game)) - (= v1-74 (progress-screen save-game)) - (= v1-74 (progress-screen save-game-title)) - (= v1-74 (progress-screen memcard-error-loading)) - (= v1-74 (progress-screen memcard-error-saving)) - (= v1-74 (progress-screen memcard-error-formatting)) - (= v1-74 (progress-screen memcard-error-creating)) - (= v1-74 (progress-screen memcard-auto-save-error)) - (= v1-74 (progress-screen memcard-removed)) - (= v1-74 (progress-screen memcard-no-data)) - (= v1-74 (progress-screen memcard-not-inserted)) - (= v1-74 (progress-screen memcard-not-formatted)) - (= v1-74 (progress-screen auto-save)) - (= v1-74 (progress-screen pal-change-to-60hz)) - (= v1-74 (progress-screen pal-now-60hz)) - (= v1-74 (progress-screen no-disc)) - (= v1-74 (progress-screen bad-disc)) - (= v1-74 (progress-screen quit)) - ) - (dummy-31 self) - ) - ) - ) - (suspend) - ) - (none) - ) - :post - (behavior () - (let* ((a1-0 (-> self display-level-index)) - (gp-0 (-> *level-task-data* a1-0)) - ) - #t - (let ((s5-0 #f)) - (case (-> self display-state) - (((progress-screen fuel-cell)) - (set! s5-0 #t) - (draw-fuel-cell-screen self a1-0) - ) - (((progress-screen money)) - (set! s5-0 #t) - (draw-money-screen self a1-0) - ) - (((progress-screen buzzer)) - (set! s5-0 #t) - (draw-buzzer-screen self a1-0) - ) - (((progress-screen game-settings) (progress-screen settings)) - (hide-progress-icons) - (draw-options self 115 30 0.82) - ) - (((progress-screen graphic-settings) - (progress-screen sound-settings) - (progress-screen settings-title) - (progress-screen title) - (progress-screen language-options) - ) - (hide-progress-icons) - (draw-options self 115 30 0.82) - ) - (((progress-screen memcard-removed) (progress-screen memcard-auto-save-error)) - (draw-notice-screen self) - (draw-options self 192 0 0.82) - ) - (((progress-screen memcard-no-data)) - (draw-notice-screen self) - (draw-options self 165 0 0.82) - ) - (((progress-screen memcard-format)) - (draw-notice-screen self) - (draw-options self 172 0 0.82) - ) - (((progress-screen memcard-no-space) - (progress-screen memcard-not-inserted) - (progress-screen memcard-not-formatted) - ) - (draw-notice-screen self) - (draw-options self 195 0 0.82) - ) - (((progress-screen memcard-error-loading) - (progress-screen memcard-error-saving) - (progress-screen memcard-error-formatting) - (progress-screen memcard-error-creating) - (progress-screen memcard-auto-save-error) - ) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen pal-change-to-60hz)) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen pal-now-60hz)) - (when (< (seconds 10) (- (-> *display* real-frame-counter) (-> self video-mode-timeout))) - (set! (-> *progress-state* video-mode-choice) 'pal) - (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (set! (-> self next-display-state) (progress-screen invalid)) - ) - (draw-notice-screen self) - (draw-options self 140 0 0.82) - ) - (((progress-screen no-disc) (progress-screen bad-disc)) - (draw-notice-screen self) - (if (is-cd-in?) - (draw-options self 170 0 0.82) - ) - ) - (((progress-screen quit)) - (draw-notice-screen self) - (draw-options self 110 0 0.82) - ) - (((progress-screen auto-save)) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen memcard-insert)) - (draw-notice-screen self) - (draw-options self 165 0 0.82) - ) - (((progress-screen memcard-data-exists)) - (draw-notice-screen self) - (draw-options self 168 0 0.82) - ) - (((progress-screen memcard-loading) - (progress-screen memcard-saving) - (progress-screen memcard-formatting) - (progress-screen memcard-creating) - ) - (draw-notice-screen self) - ) - (((progress-screen load-game) (progress-screen save-game)) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen save-game-title)) - (draw-notice-screen self) - (draw-options self 169 15 0.6) - ) - ) - (when s5-0 - (let* ((v1-98 (cond - ((-> self stat-transition) - 0 - ) - ((= (-> self level-transition) 1) - (- (-> self transition-offset)) - ) - (else - (-> self transition-offset) - ) - ) - ) - (f30-0 (the-as float (if (-> self stat-transition) - 1.0 - (-> self transition-percentage-invert) - ) - ) - ) - (s5-1 - (new - 'stack - 'font-context - *font-default-matrix* - (- 32 (-> self left-x-offset)) - (the int (* (+ 42.0 (the float (/ v1-98 2))) f30-0)) - 8325000.0 - (font-color lighter-lighter-blue) - (font-flags shadow kerning) - ) - ) - ) - (let ((v1-103 s5-1)) - (set! (-> v1-103 width) (the float 328)) - ) - (let ((v1-104 s5-1)) - (set! (-> v1-104 height) (the float 45)) - ) - (set! (-> s5-1 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (-> gp-0 level-name-id) #f) - f30-0 - s5-1 - (the int (* 128.0 f30-0)) - ) - ) - ) - ) - ) - (case (-> self display-state) - (((progress-screen fuel-cell) (progress-screen money) (progress-screen buzzer)) - (draw-progress self) - ) - ) - (adjust-sprites self) - (adjust-icons self) - (none) - ) - ) - -(defstate progress-coming-in (progress) - :event - (-> progress-waiting event) - :enter - (behavior () - (sound-group-pause (the-as uint 255)) - (logclear! (-> *setting-control* default process-mask) (process-mask pause menu)) - (push-setting! *setting-control* self 'process-mask 'set 0.0 16) - (copy-settings-from-target! *setting-control*) - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) - (set-blackout-frames 0) - (set! *pause-lock* #f) - (none) - ) - :code - (behavior () - (loop - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 0 (the int (* 170.0 (-> *display* time-adjust-ratio)))) - ) - (when (< (-> self in-out-position) 2867) - (set! (-> self transition-offset) (seekl - (-> self transition-offset) - 0 - (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - ) - ) - (set-transition-progress! self (-> self transition-offset)) - ) - (if (zero? (-> self in-out-position)) - (go progress-normal) - ) - (suspend) - ) - (none) - ) - :post - (-> progress-normal post) - ) - -(defstate progress-going-out (progress) - :enter - (behavior () - (sound-play-by-name (static-sound-name "menu-close") (new-sound-id) 1024 0 0 1 #t) - (hide-progress-icons) - (set! (-> self particles 3 init-pos x) -320.0) - (set! (-> self particles 4 init-pos x) -320.0) - (case (-> self display-state) - (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) - (set! (-> self transition-speed) 30.0) - ) - ) - (none) - ) - :code - (behavior () - (loop - (set! (-> self transition-offset) (seekl - (-> self transition-offset) - 512 - (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - ) - ) - (set-transition-progress! self (-> self transition-offset)) - (when (< 153 (-> self transition-offset)) - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 4096 (the int (* 170.0 (-> *display* time-adjust-ratio)))) - ) - (if (= (-> self in-out-position) 4096) - (go progress-gone) - ) - ) - (suspend) - ) - (none) - ) - :post - (-> progress-normal post) - ) - -(defstate progress-debug (progress) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('go-away) - (go progress-going-out) - ) - ) - ) - :code - (behavior () - (loop - (cond - ((cpad-pressed? 0 left) - (if (> (-> self current-debug-string) 0) - (+! (-> self current-debug-string) -1) - ) - ) - ((cpad-pressed? 0 right) - (if (< (-> self current-debug-string) (+ (-> *common-text* length) -1)) - (+! (-> self current-debug-string) 1) - ) - ) - ((cpad-pressed? 0 up) - (when (> (-> self current-debug-group) 0) - (+! (-> self current-debug-group) -1) - (set! (-> self current-debug-string) 0) - 0 - ) - ) - ((cpad-pressed? 0 down) - (when (< (-> self current-debug-group) (+ (-> *text-group-names* length) -1)) - (+! (-> self current-debug-group) 1) - (set! (-> self current-debug-string) 0) - 0 - ) - ) - ((cpad-pressed? 0 l1) - (if (> (the-as int (-> *setting-control* default language)) 0) - (+! (-> *setting-control* default language) -1) - ) - ) - ((cpad-pressed? 0 r1) - (if (< (the-as int (-> *setting-control* default language)) 6) - (+! (-> *setting-control* default language) 1) - ) - ) - ((cpad-pressed? 0 l2) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l2)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons l2)) - (go progress-normal) - ) - ) - (load-game-text-info (-> *text-group-names* (-> self current-debug-group)) '*common-text* *common-text-heap*) - (suspend) - ) - (none) - ) - :post - (behavior () - (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (gp-0 (-> s5-0 base)) - ) - (let ((s4-0 draw-string-xy)) - (let ((s3-0 format) - (a0-4 (clear *temp-string*)) - (a1-0 "TEXT DEBUG: LANGUAGE ~S ID 0x~X") - (v1-4 (-> *setting-control* current language)) - ) - (s3-0 - a0-4 - a1-0 - (cond - ((= v1-4 (language-enum uk-english)) - "uk-english" - ) - ((= v1-4 (language-enum japanese)) - "japanese" - ) - ((= v1-4 (language-enum italian)) - "italian" - ) - ((= v1-4 (language-enum spanish)) - "spanish" - ) - ((= v1-4 (language-enum german)) - "german" - ) - ((= v1-4 (language-enum french)) - "french" - ) - ((= v1-4 (language-enum english)) - "english" - ) - (else - "*unknown*" - ) - ) - (-> *common-text* data (-> self current-debug-string) id) - ) - ) - (s4-0 *temp-string* s5-0 40 40 (font-color default) (font-flags shadow kerning)) - ) - (let ((a3-4 (-> s5-0 base))) - (let ((v1-7 (the-as dma-packet (-> s5-0 base)))) - (set! (-> v1-7 dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> v1-7 vif0) (new 'static 'vif-tag)) - (set! (-> v1-7 vif1) (new 'static 'vif-tag)) - (set! (-> s5-0 base) (&+ (the-as pointer v1-7) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - gp-0 - (the-as (pointer dma-tag) a3-4) - ) - ) - ) - (let* ((s5-1 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (gp-1 (-> s5-1 base)) - ) - (let ((s4-1 draw-string-xy)) - (format (clear *temp-string*) "USE LEFT/RIGHT TO SELECT STRING") - (s4-1 *temp-string* s5-1 40 155 (font-color default) (font-flags shadow kerning)) - ) - (let ((a3-6 (-> s5-1 base))) - (let ((v1-16 (the-as dma-packet (-> s5-1 base)))) - (set! (-> v1-16 dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> v1-16 vif0) (new 'static 'vif-tag)) - (set! (-> v1-16 vif1) (new 'static 'vif-tag)) - (set! (-> s5-1 base) (the-as pointer (the-as dma-packet (&+ v1-16 16)))) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - gp-1 - (the-as (pointer dma-tag) a3-6) - ) - ) - ) - (let* ((s5-2 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (gp-2 (-> s5-2 base)) - ) - (let ((s4-2 draw-string-xy)) - (format (clear *temp-string*) "USE UP/DOWN TO SELECT GROUP") - (s4-2 *temp-string* s5-2 40 165 (font-color default) (font-flags shadow kerning)) - ) - (let ((a3-8 (-> s5-2 base))) - (let ((v1-25 (the-as dma-packet (-> s5-2 base)))) - (set! (-> v1-25 dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> v1-25 vif0) (new 'static 'vif-tag)) - (set! (-> v1-25 vif1) (new 'static 'vif-tag)) - (set! (-> s5-2 base) (the-as pointer (the-as dma-packet (&+ v1-25 16)))) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - gp-2 - (the-as (pointer dma-tag) a3-8) - ) - ) - ) - (let* ((s5-3 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (gp-3 (-> s5-3 base)) - ) - (let ((s4-3 draw-string-xy)) - (format (clear *temp-string*) "USE L1/R1 TO SELECT LANGUAGE") - (s4-3 *temp-string* s5-3 40 175 (font-color default) (font-flags shadow kerning)) - ) - (let ((a3-10 (-> s5-3 base))) - (let ((v1-34 (the-as dma-packet (-> s5-3 base)))) - (set! (-> v1-34 dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> v1-34 vif0) (new 'static 'vif-tag)) - (set! (-> v1-34 vif1) (new 'static 'vif-tag)) - (set! (-> s5-3 base) (the-as pointer (the-as dma-packet (&+ v1-34 16)))) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - gp-3 - (the-as (pointer dma-tag) a3-10) - ) - ) - ) - (let ((gp-4 (new - 'stack - 'font-context - *font-default-matrix* - 32 - 50 - 0.0 - (font-color default) - (font-flags shadow kerning) - ) - ) - ) - (let ((v1-42 gp-4)) - (set! (-> v1-42 width) (the float 328)) - ) - (let ((v1-43 gp-4)) - (set! (-> v1-43 height) (the float 100)) - ) - (logior! (-> gp-4 flags) (font-flags shadow kerning large)) - (draw-debug-text-box gp-4) - (print-game-text (-> *common-text* data (-> self current-debug-string) text) gp-4 #f 128 22) - ) - (none) - ) - ) - - diff --git a/goal_src/pc/engine/ui/text-h.gc b/goal_src/pc/engine/ui/text-h.gc deleted file mode 100644 index 753b58b036..0000000000 --- a/goal_src/pc/engine/ui/text-h.gc +++ /dev/null @@ -1,562 +0,0 @@ -;;-*-Lisp-*- -(in-package goal) - -;; name: text-h.gc -;; name in dgo: text-h -;; dgos: GAME, ENGINE - -;; This file contains types related to game text. -;; Each game string is assigned an ID number. -;; This ID is used to lookup the string for the currently selected language. -;; These ID's are shared with short spoken audio clips (daxter hints) -;; most (all?) of the daxter clips don't have text strings. - -(defenum game-text-id - :type uint32 - :bitfield #f -;; GAME-TEXT-ID ENUM BEGINS - (zero 0) - (one 1) - (confirm #x103) - (press-to-talk #x104) - (press-to-use #x105) - (confirm-play #x106) - (play-again? #x107) - (quit #x108) - (pause #x109) - (sfx-volume #x10a) - (music-volume #x10b) - (speech-volume #x10c) - (language #x10d) - (vibrations #x10e) - (play-hints #x10f) - (center-screen #x110) - (on #x111) - (off #x112) - (move-dpad #x113) - (english #x114) - (french #x115) - (german #x116) - (spanish #x117) - (italian #x118) - (japanese #x119) - (press-to-trade-money #x11a) - (press-to-trade-money-oracle #x11b) - (press-to-warp #x11c) - (press-to-exit #x11d) - (press-to-talk-to-sage #x123) - (press-to-talk-to-assistant #x124) - (aspect-ratio #x125) - (video-mode #x126) - (game-options #x127) - (graphic-options #x128) - (sound-options #x129) - (4x3 #x12a) - (16x9 #x12b) - (60hz #x12c) - (50hz #x12d) - (game-title #x12e) - (hidden-power-cell #x12f) ;; why is this here?? - (memcard-no-space #x130) - (memcard-not-inserted #x131) - (card-not-formatted-title #x132) - (memcard-space-requirement1 #x133) - (memcard-space-requirement2 #x134) - (card-not-formatted-msg #x135) - (saving-data #x136) - (loading-data #x137) - (do-not-remove-mem-card #x138) - (overwrite? #x139) - (format? #x13a) - - (yes #x13c) - (no #x13d) - (back #x13e) - (continue-without-saving #x13f) - (select-file-to-save #x140) - (select-file-to-load #x141) - (save-data-already-exists #x142) - (insert-memcard #x143) - (continue? #x144) - (load-game #x14b) - (save-game #x14c) - (formatting #x14d) - (creating-save-data #x14e) - (empty #x14f) - (options #x150) - (error-loading #x151) - (error-saving #x152) - (error-formatting #x153) - (error-creating-data #x154) - (memcard-removed #x156) - (autosave-disabled-title #x157) - (autosave-disabled-msg #x158) - (no-save-data #x159) - (create-save-data? #x15a) - (check-memcard #x15b) - (new-game #x15c) - (back? #x15d) - (ok #x15e) - (exit-demo #x15f) - (autosave-warn-title #x160) - (autosave-warn-msg #x161) - (task-completed #x162) - (check-memcard-and-retry #x163) - (screen-change-to-60hz #x164) - (screen-60hz-warn-support #x165) - (screen-60hz-warn-timer #x166) - (screen-now-60hz #x167) - (screen-60hz-keep? #x168) - (warp-gate-use-dpad #x169) - (no-disc-title #x16a) - (no-disc-msg #x16b) - (bad-disc-title #x16c) - (bad-disc-msg #x16d) - (press-start #x16e) - (quit-game #x16f) - (quit? #x170) - (total-collected #x171) - - (village1-mayor-money #x200) - (vollage1-uncle-money #x201) - (village1-yakow-herd #x202) - (village1-yakow-return #x203) - (village1-oracle #x204) - (beach-ecorocks #x205) - (beach-flutflut-push #x206) - (beach-flutflut-meet #x207) - (beach-pelican #x208) - (beach-seagull #x209) - (beach-cannon #x20a) - (beach-buzzer #x20b) - (jungle-lurkerm-connect #x20c) - (jungle-tower #x20d) - (jungle-eggtop #x20e) - (jungle-plant #x20f) - (jungle-fishgame #x210) - (misty-muse-catch #x211) - (misty-muse-return #x212) - (misty-boat #x213) - (misty-cannon #x214) - (misty-return-to-pool #x215) ;; task name?? - (misty-find-transpad #x216) ;; task name? - (misty-balloon-lurkers #x217) - - (village1-level-name #x220) - (beach-level-name #x221) - (jungle-level-name #x222) - (misty-level-name #x223) - - (beach-seagull-get #x22e) - - (jungle-lurkerm-unblock #x22f) - (jungle-lurkerm-return #x230) - - (MISSING-orb-hint #x233) - - (beach-eco-rock-increment #x239) - - (jungle-maindoor-hint #x23c) - - (firecanyon-not-enough-cells #x24f) - - (sidekick-hint-orb-cache-top #x251) - - (jungle-precursorbridge-hint #x25b) - (daxter-launcher-no-eco #x25c) - - (jungle-mirrors-completion-talk-to-mayor #x25e) - - (beach-gimmie #x262) - (beach-sentinel #x263) - (jungle-canyon-end #x264) - (jungle-temple-door #x265) - (misty-bike-jump #x266) - (misty-eco-challenge #x267) - (beach-seagull-chased-one #x268) - (beach-seagull-chased-two #x26a) - (beach-seagull-chased-three #x26b) - (beach-seagull-chased-four #x26c) - - (misty-daxter-scared #x26f) - - (beach-seagulls-avalanche #x273) - - (beach-pelican-quick-get-cell #x274) - - (beach-flutflutegg-hint #x275) - - (sidekick-hint-fish-powerup #x278) - (misty-racer-hit-the-ballon-lurkers #x27e) - (misty-daxter-hit-lurkers-not-mines #x27f) - - (sidekick-speech-hint-crate-darkeco1 #x281) - (sidekick-speech-crate-steel-break1 #x283) - (sidekick-speech-hint-crate-iron #x284) - (sidekick-speech-hint-crate-steel #x285) - (beach-collectors-unblocked #x288) - (misty-stopped-lurkers-at-silo #x28a) - (misty-stopped-balloon-lurkers #x28b) - (jungleb-eco-vents-opened #x289) - (sidekick-speech-crate-steel-break2 #x28e) - (sidekick-speech-hint-crate-darkeco2 #x28f) - - (daxter-screaming-jump #x290) - (daxter-wahoo-jump #x291) - (daxter-get-some #x292) - - (collectables-scout-flies-red-boxes #x295) - (found-all-scout-flies #x296) - (yakow-owed-powercell #x297) - - (jungle-mirrors-tutorial #x29c) - (jungle-mirrors-break-the-mirror-jak #x29d) - (jungle-mirrors-go-to-the-next-tower #x29f) - (jungle-mirrors-follow-the-beam #x2a0) - - (misty-teetertotter-bonk-dax-tutorial #x2a4) - (sidekick-hint-misty-get-red-eco #x2a5) - - (red-eco-tutorial #x2a6) - - (daxter-blue-eco-plat-tutorial #x2a7) - - (fish? #x2a9) - - (misty-bone-bridge-hint #x2aa) - - (beach-grottopole-increment #x2af) - - (firecanyon-collect-cells-collected #x2b1) - (firecanyon-collect-cells-collected-reminder #x2b2) - (firecanyon-collect-cells-text #x2b3) - (caught #x2b4) - (missed #x2b5) - (lose! #x2b6) - - (village2-gambler-money #x300) - (village2-geologist-money #x301) - (village2-warrior-money #x302) - (village2-oracle-money #x303) - (swamp-tether #x304) - - (swamp-flutflut #x307) - - (swamp-billy #x309) - - (sunken-elevator-raise #x30a) - (sunken-elevator-get-to-roof #x30b) - (sunken-pipe #x30c) - (sunken-climb-tube #x30d) ;; task name? - (sunken-pool #x30e) ;; task name? - (sunken-platforms #x30f) - - (rolling-moles #x310) - (rolling-moles-return #x311) - (rolling-robbers #x312) - (rolling-race #x313) - (rolling-race-return #x314) - (rolling-lake #x315) - (rolling-plants #x316) - - (unknown-buzzers #x317) - - (village2-level-name #x319) - - (rolling-level-name #x31b) - (swamp-level-name #x31c) - (sunken-level-name #x31d) - (ogre-level-name #x31e) - - (swamp-battle #x321) - (sunken-bottom #x322) ;; task name? - (reach-center #x323) ;; task name? - (rolling-ring-chase-1 #x324) - (rolling-ring-chase-2 #x325) - (sunken-kiera-you-raised-a-piece-of-lpc #x326) - (rolling-beat-lurkers #x327) - (swamp-finished-with-flutflut #x328) - (rolling-race-beat-record #x335) - (sidekick-speech-hint-rolling-crate-darkeco #x336) - (rolling-lightning-moles-completion #x338) - (rolling-dark-plants-location-hint #x339) - (rolling-dark-plants-hint #x33a) - (rolling-flying-lurker-intro #x33c) - (rolling-ring-hint-one-ring-down #x33f) - (rolling-ring-hint-be-quick-to-next #x340) - (rolling-ring-hint-be-quick-all #x341) - - (sunken-pipegame-follow-it #x343) - (sunken-helix-daxter-bad-feeling #x344) - (sunken-blue-eco-charger-hint #x345) - (sunken-double-lurker-hint #x347) - (sunken-helix-daxter-eco-rising #x348) - (sunken-qbert-plat-hint #x34a) - (sunken-bully-dive-hint #x34b) - (sunken-take-it-easy-hot-pipes #x34e) - - (sunken-blue-eco-charger-all-hint #x34d) - - (swamp-tethers-advice-hint #x352) - - (kermit-break-tongue #x357) - (swamp-rats-nest-hint #x358) - (daxter-you-can-shoot-with-yellow-eco #x359) - - (kermit-run-away-jak #x35f) - - (swamp-bats-hint #x364) ;; maybe we can duck the bats - (swamp-tethers-three-to-go #x365) - (swamp-tethers-two-to-go #x366) - (swamp-tethers-lefts-find-the-last #x367) - (flutflut-reminder #x368) - - (sage-golfclap-i-have-low-expectations #x36a) ;; where was this said? - - (swamp-tethers-completion-sage-precursor-arm #x36b) - - (village2-warp-gate-reminder #x36f) - (village2-warp-gate-reminder-annoyed #x370) - (village2-warp-gate-reminder-very-annoyed #x371) - - (village2-not-enough-cells-levitator #x36c) - (villlage2-levitator-cell-req-text #x372) - - (rolling-race-time-string-prefix #x373) - (rolling-race-record-string-prefix #x374) - (rolling-race-new-record-string-prefix #x375) - (rolling-race-try-again-string #x376) - (rolling-race-start-race-aborted #x377) ;; double check this - - (village3-miner-money #x400) - (village3-oracle-money #x401) - (snow-ram-3-left #x402) - (snow-ram-2-left #x403) - (snow-ram-1-left #x404) - (snow-fort #x405) - (snow-bunnies #x406) - (snow-open-door #x408) ;; task name? - - (cave-robot-climb #x40e) - (cave-dark-climb #x40f) ;; destroy crystals - - (cave-gnawers #x410) - (cave-dark-crystals #x411) - - (village3-buzzer #x413) - - (village3-level-name #x415) - - (snowy-level-name #x417) - - (cave-level-name #x419) - - (lavatube-level-name #x41b) - - (snow-eggtop #x421) - - (cave-spider-tunnel #x423) - (cave-platforms #x424) - - (cave-swing-poles #x426) - - (assistant-lavatube-powercell-hint #x428) - (village3-gondola-malfunctioning #x429) - (village3-gondola-reactivated #x42a) - - (snow-frozen-crate #x42b) ;; task name? - (snow-bumpers #x42c) - - (dark-crystal-last-one #x432) - (daxter-maybe-you-can-shoot-better-goggles #x433) - - (darkcave-light-crystal-low-light-hint #x437) - (darkcave-light-crystal-hint #x438) - (dark-crystal-run-away #x439) - (cave-trap-nest-hint #x440) - (snow-fort-reminder #x443) - (ram-boss-red-eco-hint #x444) - - (ice-cube-hint #x448) - - (snowy-turned-on-yellow-vents #x44c) - - (village3-warp-gate-reminder #x452) - (village3-warp-gate-reminder=annoyed #x453) - (village3-warp-gate-reminder-very-annoyed #x454) - (lavatube-powercell-req-text #x455) - - (fire-canyon-end #x500) - (fire-canyon-buzzer #x501) - - (daxter-maybe-i-should-drive #x506) - (daxter-you-are-trying-to-avoid-dark-eco #x507) - - (fire-canyon-level-name #x50c) - - (fire-canyon-we-made-it #x515) - - (collectables-theres-scout-flys-here-too #x516) - - (ogre-end #x600) - (ogre-buzzer #x601) - (ogre-boss #x603) - (ogre-boss-killed #x604) - - (assistant-voicebox-intro-ogre-race #x605) - - (sidekick-speech-hint-ogre-race #x61c) - (assistant-finished-mountain-pass-race #x61d) - - (lavatube-end #x700) - (lavatube-buzzer #x701) - - (lavatube-shoot-the-spheres #x70d) - - (lavatube-spheres-door-open #x710) - - (citadel-buzzer #x800) - (citadel-level-name #x801) - (citadel-sage-blue #x802) - (citadel-sage-red #x803) - (citadel-sage-yellow #x804) - (citadel-sage-green #x805) - (citadel-break-generator-hint #x806) - (citadel-lurker-bunny-alert #x808) - (citadel-break-generators-reminder #x809) - (citadel-climb-plat-hint #x80c) - - (daxter-dont-miss-the-next-launcher #x80d) - - (daxter-land-on-the-next-launcher #x812) - (misty-battle-finished #x813) - - (training-precursor-orbs #x901) - (training-power-cells #x902) - (training-assistant-found-scout-fly #x903) - (training-assistant-found-scout-fly-cell #x904) - (training-blue-eco-vent #x907) - (training-eco-green #x908) - (training-eco-blue #x909) - (training-more-eco-more-time #x90a) - (training-precursor-door #x90b) - (training-eco-opened-door #x90c) - (training-double-jump #x90e) - - (sage-voicebox-hint-crate-iron #x917) - (training-warp-gate-blocked #x919) - (training-warp-gate-reminder #x91a) - - (training-gimmie-task-name #x91b) - (training-buzzer-task-name #x91c) - (training-door-task-name #x91d) - (training-climb-task-name #x91e) - (training-level-name #x91f) - - (inc #xf10) - (europe #xf11) -;; GAME-TEXT-ID ENUM ENDS - - ; PC Port TEXT - (progress-resolution #x1000) - (progress-display-mode #x1001) - (progress-letterbox #x1002) - (progress-subtitles #x1003) - (progress-subtitles-label-speaker #x1004) - (progress-discord-rpc #x1005) - (progress-language-options #x1006) - ;; subtitle languages - (progress-subtitles-language #x1007) - (progress-subtitle-language-uk-english #x1008) - (progress-subtitle-language-portuguese #x1009) - (progress-subtitle-language-finnish #x1010) - (progress-subtitle-language-swedish #x1011) - (progress-subtitle-language-danish #x1012) - (progress-subtitle-language-norwegian #x1013) - (progress-subtitle-language-korean #x1014) - (progress-subtitle-language-russian #x1015) - (progress-subtitles-label-speaker-on #x1016) - (progress-subtitles-label-speaker-off #x1017) - (progress-subtitles-label-speaker-auto #x1018) - ;; display modes - (progress-display-mode-borderless #x1019) - (progress-display-mode-fullscreen #x1020) - (progress-display-mode-windowed #x1021) - ;; aspect ratios - (progress-aspect-ratio-4x3 #x1022) - (progress-aspect-ratio-5x4 #x1023) - (progress-aspect-ratio-16x9 #x1024) - (progress-aspect-ratio-21x9 #x1025) - (progress-aspect-ratio-32x9 #x1026) - ;; 4:3 resolutions - (progress-res-4x3-640x480 #x1027) - (progress-res-4x3-800x600 #x1028) - (progress-res-4x3-1024x768 #x1029) - (progress-res-4x3-1280x960 #x1030) - (progress-res-4x3-1600x1200 #x1031) - ;; 5:4 resolutions - (progress-res-5x4-960x768 #x1032) - (progress-res-5x4-1280x1024 #x1033) - (progress-res-5x4-1500x1200 #x1034) - ;; 16:9 resolutions - (progress-res-16x9-854x480 #x1035) - (progress-res-16x9-1280x720 #x1036) - (progress-res-16x9-1920x1080 #x1037) - (progress-res-16x9-2560x1440 #x1038) - (progress-res-16x9-2880x1620 #x1039) - (progress-res-16x9-3840x2160 #x1040) - (progress-res-16x9-5120x2880 #x1041) - ;; 21:9 resolutions - (progress-res-21x9-2560x1080 #x1042) - (progress-res-21x9-3120x1440 #x1043) - (progress-res-21x9-3200x1440 #x1044) - (progress-res-21x9-3440x1440 #x1045) - (progress-res-21x9-3840x1600 #x1046) - (progress-res-21x9-5120x2160 #x1047) - ;; 32:9 resolutions - (progress-res-32x9-5120x1440 #x1048) - ;; original aspect ratio - (progress-use-original-aspect #x1049) - ) - -;; an individual string. -(deftype game-text (structure) - ((id game-text-id :offset-assert 0) - (text string :offset-assert 4) - ) - :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 - ) - -;; A table of all strings. -(deftype game-text-info (basic) - ((length int32 :offset-assert 4) - (language-id int32 :offset-assert 8) - (group-name string :offset-assert 12) - (data game-text :inline :dynamic :offset-assert 16) - ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 - (:methods - (lookup-text! (_type_ game-text-id symbol) string 9) - ) - ) - -;; all text is stored in the COMMON text files (one file per language). -;; in theory, you could have multiple text files that are only loaded when needed, but they didn't do this. -(define *text-group-names* (new 'static 'boxed-array :type string :length 1 "common")) - -;; The heap for storing text -(define *common-text-heap* (new 'global 'kheap)) - -;; will store the COMMON text when it is loaded. -(define *common-text* (the-as game-text-info #f)) - - -(defun-extern print-game-text string font-context symbol int int float) - - - diff --git a/goal_src/pc/hud-classes-pc.gc b/goal_src/pc/hud-classes-pc.gc new file mode 100644 index 0000000000..8ec52bae22 --- /dev/null +++ b/goal_src/pc/hud-classes-pc.gc @@ -0,0 +1,625 @@ +;;-*-Lisp-*- +(in-package goal) + +#| + + Code for extra HUD elements in the PC port. + + |# + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; constants +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +(defconstant HUD_ICON_COUNT 6) +(defconstant HUD_PART_PC_AMOUNT 1) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; hud processes and parts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +;; a pc hud element +(deftype hud-pc (hud) + () + ) + +;; hud element for battles +(deftype hud-battle-enemy (hud) + ((want-skel symbol) + (want-skel2 symbol) + + (last-battle handle) + (battle-entity entity-actor) + (battle-max int32) + (battle-alive int32) + (battle-mode symbol) + (last-task entity-actor) + (task-entity entity-actor) + (task-track int32) + (task2-entity entity-actor) + (task2-time time-frame) + (task2-track int32) + + (last-level symbol) + (ready? symbol) + (kicked symbol) + (display-mode? symbol) + ) + (:methods + (make-enemy-icon (_type_ int symbol entity) int) + (kill-icon (_type_ int) int) + (kill-all-icons (_type_) int) + (update-display-status (_type_ symbol entity int symbol) int) + ) + ) + + +;; all pc hud elements +(deftype hud-parts-pc (structure) + ((battle-enemy (pointer hud-battle-enemy)) + + (parts (pointer hud-pc) HUD_PART_PC_AMOUNT :offset 0) + ) + ) + + + +;;;---------------------------------------------- +;; globals +;;;---------------------------------------------- + + +;; all of the pc hud elements +(define *hud-parts-pc* (new 'static 'hud-parts-pc + :battle-enemy #f + )) + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; hud macros +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +(defmacro hud-pc-make-icon (obj max &key skel + &key x + &key y + &key z + &key scale-x + &key scale-y + &key (entity #f) + ) + `(when (< (-> ,obj nb-of-icons) ,max) + (let ((icon-idx (-> ,obj nb-of-icons))) + (set! (-> ,obj icons icon-idx) (new 'static 'hud-icon)) + (let ((new-manipy (manipy-spawn (new 'static 'vector :w 1.0) ,entity ,skel #f :to ,obj))) + (when new-manipy + (set! (-> (-> new-manipy) draw dma-add-func) dma-add-process-drawable-hud-with-hud-lights) + (set-vector! (-> (-> new-manipy) root trans) 0.0 0.0 0.0 1.0) + (set-vector! (-> (-> new-manipy) root scale) ,scale-x ,scale-y ,scale-x 1.0) + (when #f + (send-event (ppointer->process new-manipy) 'trans-hook #f) + ) + ) + (set! (-> ,obj icons icon-idx icon) new-manipy) + (when new-manipy + (logior! (-> new-manipy 0 mask) (process-mask pause)) + (logclear! (-> new-manipy 0 mask) (process-mask menu progress)) + (set! (-> (-> new-manipy) root trans z) ,z) + (set! (-> ,obj icons icon-idx icon-x) ,x) + (set! (-> ,obj icons icon-idx icon-y) ,y) + (set! (-> ,obj icons icon-idx icon-z) 0) + (set! (-> ,obj icons icon-idx scale-x) ,scale-x) + (set! (-> ,obj icons icon-idx scale-y) ,scale-y) + ) + ) + ) + (+! (-> ,obj nb-of-icons) 1) + ) + ) + +(defmacro hud-pc-replace-icon (obj idx &key skel + &key z + &key (entity #f) + ) + `(let ((new-manipy (manipy-spawn (new 'static 'vector :w 1.0) ,entity ,skel #f :to ,obj))) + (when new-manipy + (set! (-> (-> new-manipy) draw dma-add-func) dma-add-process-drawable-hud-with-hud-lights) + (set-vector! (-> (-> new-manipy) root trans) 0.0 0.0 0.0 1.0) + (set-vector! (-> (-> new-manipy) root scale) (-> ,obj icons ,idx scale-x) (-> ,obj icons ,idx scale-y) (-> ,obj icons ,idx scale-x) 1.0) + (when #f + (send-event (ppointer->process new-manipy) 'trans-hook #f) + ) + ) + (set! (-> ,obj icons ,idx icon) new-manipy) + (when new-manipy + (logior! (-> new-manipy 0 mask) (process-mask pause)) + (logclear! (-> new-manipy 0 mask) (process-mask menu progress)) + (set! (-> (-> new-manipy) root trans z) ,z) + ) + ) + ) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; hud rendering with level lights +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +(define *hud-pc-lights* (new 'global 'vu-lights)) +(set-vector! (-> *hud-pc-lights* direction 0) 1.0 0.0 0.0 1.0) +(set-vector! (-> *hud-pc-lights* direction 1) 0.0 1.0 0.0 1.0) +(set-vector! (-> *hud-pc-lights* direction 2) 0.0 0.0 1.0 1.0) +(set-vector! (-> *hud-pc-lights* color 0) 0.75 0.75 1.0 1.0) +(set-vector! (-> *hud-pc-lights* color 1) 0.75 0.75 1.0 1.0) +(set-vector! (-> *hud-pc-lights* color 2) 0.75 0.75 1.0 1.0) +(set-vector! (-> *hud-pc-lights* ambient) 0.2 0.2 0.2 1.0) + +(defun dma-add-process-drawable-hud-with-lights ((proc process-drawable) (draw draw-control) (arg2 symbol) (buf dma-buffer)) + (logclear! (-> draw status) (draw-status was-drawn)) + (when (zero? (logand (-> draw status) (draw-status hidden no-anim no-skeleton-update))) + (let ((vu-lgt (the-as vu-lights (+ 64 (scratchpad-object int)))) + (lgt (if (= (-> draw level-index) 2) + (-> *time-of-day-context* light-group (-> draw light-index)) + (-> *time-of-day-context* moods (-> draw level-index) light-group (-> draw light-index)) + )) + ) + (vu-lights<-light-group! vu-lgt lgt) + ) + (lod-set! draw 0) + (logior! (-> draw status) (draw-status was-drawn)) + (draw-bones-hud draw buf) + ) + 0 + (none) + ) + +(defun dma-add-process-drawable-hud-with-hud-lights ((proc process-drawable) (draw draw-control) (arg2 symbol) (buf dma-buffer)) + (logclear! (-> draw status) (draw-status was-drawn)) + (when (zero? (logand (-> draw status) (draw-status hidden no-anim no-skeleton-update))) + (let ((vu-lgt (the-as vu-lights (+ 64 (scratchpad-object int)))) + (lgt *hud-pc-lights*) + ) + (set! (-> vu-lgt direction 0 quad) (-> lgt direction 0 quad)) + (set! (-> vu-lgt direction 1 quad) (-> lgt direction 1 quad)) + (set! (-> vu-lgt direction 2 quad) (-> lgt direction 2 quad)) + (set! (-> vu-lgt color 0 quad) (-> lgt color 0 quad)) + (set! (-> vu-lgt color 1 quad) (-> lgt color 1 quad)) + (set! (-> vu-lgt color 2 quad) (-> lgt color 2 quad)) + (set! (-> vu-lgt ambient quad) (-> lgt ambient quad)) + ) + (lod-set! draw 0) + (logior! (-> draw status) (draw-status was-drawn)) + (draw-bones-hud draw buf) + ) + 0 + (none) + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; hud methods +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + + +(defmethod deactivate hud-pc ((obj hud-pc)) + (dotimes (i HUD_PART_PC_AMOUNT) + (if (and (-> *hud-parts-pc* parts i) (= (ppointer->process (-> *hud-parts-pc* parts i)) obj)) + (set! (-> *hud-parts-pc* parts i) (the (pointer hud-pc) #f)) + ) + ) + ((method-of-type hud deactivate) obj) + (none) + ) + + +(defmethod kill-icon hud-battle-enemy ((obj hud-battle-enemy) (idx int)) + "kill a hud icon" + + (when (and (nonzero? (-> obj icons idx)) (nonzero? (-> obj icons idx icon)) (-> obj icons idx icon)) + (deactivate (ppointer->process (-> obj icons idx icon))) + (set! (-> obj icons idx icon) #f) + ) + 0) + +(defmethod kill-all-icons hud-battle-enemy ((obj hud-battle-enemy)) + "kill all hud icons" + + (dotimes (i (-> obj nb-of-icons)) + (kill-icon obj i) + ) + 0) + +(defmethod make-enemy-icon hud-battle-enemy ((obj hud-battle-enemy) (idx int) (skel-sym symbol) (enemy-ent entity)) + "make a new icon for the hud" + + ;; make new manipy + (kill-icon obj 0) + (hud-pc-replace-icon obj 0 :skel (-> skel-sym value) :entity enemy-ent :z (meters 0.5)) + + 0) + +(defmethod update-display-status hud-battle-enemy ((obj hud-battle-enemy) (skel symbol) (ent entity) (icon-idx int) (trigger-force symbol)) + "logic for displaying or hiding the hud, and drawing the icons." + + + ;; do stuff depending on our current state + (cond + ((hidden? obj) + ;; we're hidden, so let's make our new icons and see if we are allowed to show + + ;; if we have icons made then show! + (when (-> obj ready?) + (set! (-> obj kicked) #f) + (send-event obj 'show) + ) + + ;; no icons, make new ones but keep them hidden for now + (when (and (not (-> obj ready?)) skel (not *progress-process*)) + (case skel + (('*swamp-rat-sg* '*citb-bunny-sg*) + (set! (-> obj icons icon-idx icon-x) (the int (* 0.84 512))) + (set! (-> obj icons icon-idx icon-y) (the int (* 0.51 448))) + (set! (-> obj icons icon-idx scale-x) 0.006) + ) + (('*gnawer-sg*) + (set! (-> obj icons icon-idx icon-x) (the int (* 0.78 512))) + (set! (-> obj icons icon-idx icon-y) (the int (* 0.54 448))) + (set! (-> obj icons icon-idx scale-x) 0.003) + ) + (('*flying-lurker-sg*) + (set! (-> obj icons icon-idx icon-x) (the int (* 0.80 512))) + (set! (-> obj icons icon-idx icon-y) (the int (* 0.40 448))) + (set! (-> obj icons icon-idx scale-x) 0.003) + ) + (else + (set! (-> obj icons icon-idx icon-x) (the int (* 0.84 512))) + (set! (-> obj icons icon-idx icon-y) (the int (* 0.51 448))) + (set! (-> obj icons icon-idx scale-x) 0.004) + ) + ) + (set! (-> obj icons icon-idx scale-y) (* (-> obj icons icon-idx scale-x) (/ -512.0 448.0))) + (make-enemy-icon obj icon-idx skel ent) + (let ((icon0 (the manipy (ppointer->process (-> obj icons icon-idx icon))))) + (case skel + (('*babak-sg*) + (send-event icon0 'art-joint-anim "babak-idle" 0) + (send-event icon0 'rot-quat (quaternion-axis-angle! (new-stack-quaternion0) 0.0 1.0 0.15 (degrees 210))) + ) + (('*citb-bunny-sg*) + (send-event icon0 'art-joint-anim "citb-bunny-idle" 0) + (send-event icon0 'rot-quat (quaternion-axis-angle! (new-stack-quaternion0) 0.0 1.0 0.15 (degrees 210))) + ) + (('*bonelurker-sg*) + (send-event icon0 'art-joint-anim "bonelurker-idle" 0) + (send-event icon0 'rot-quat (quaternion-axis-angle! (new-stack-quaternion0) 0.0 1.0 0.15 (degrees 210))) + ) + (('*swamp-rat-sg*) + (send-event icon0 'art-joint-anim "swamp-rat-celebrate" 0) + (send-event icon0 'rot-quat (quaternion-axis-angle! (new-stack-quaternion0) 0.0 1.0 0.15 (degrees 210))) + ) + (('*gnawer-sg*) + (send-event icon0 'art-joint-anim "gnawer-idle" 0) + (send-event icon0 'rot-quat (quaternion-axis-angle! (new-stack-quaternion0) 0.0 1.0 0.15 (degrees 210))) + ) + (('*flying-lurker-sg*) + (send-event icon0 'art-joint-anim "flying-lurker-fly" 0) + (send-event icon0 'rot-quat (quaternion-axis-angle! (new-stack-quaternion0) 0.0 1.0 0.15 (degrees 210))) + ) + ) + (send-event icon0 'draw #f) + ) + (true! (-> obj ready?)) + ) + ) + (else + ;; we want to be shown! + + ;; progress is open, let's leave. + (when (and (not (-> obj kicked)) (= *master-mode* 'progress)) + (true! (-> obj kicked)) + (false! (-> obj ready?)) + (send-event obj 'hide-quick) + ) + + ;; set the trigger time so we don't automatically go away + (if (and trigger-force (!= (-> obj next-state name) 'hud-leaving)) + (set! (-> obj trigger-time) (current-time))) + ) + ) + 0) + + +(defmacro actor-by-name (name) + "get an entity by name and cast it to an actor. not super safe!" + `(the entity-actor (entity-by-name ,name))) + +(defmacro actor-by-name-safe (name) + "safe, slower version of actor-by-name" + `(aif (entity-by-name ,name) + (if (type-type? it entity-actor) + (the entity-actor it)) + ) + ) + +(defmethod hud-update hud-battle-enemy ((obj hud-battle-enemy)) + "hud logic." + + (when (not (-> *pc-settings* extra-hud?)) + (kill-all-icons obj) + (return #f)) + + (when (and (not (-> obj ready?)) (hidden? obj)) + (kill-all-icons obj) + ) + + (let ((battle (the process #f)) + (cur-lev (aif (level-get-target-inside *level*) (-> it name))) + (actor-list-task? #f) + ) + ;; default params + (set! (-> obj task-entity) #f) + (set! (-> obj battle-entity) #f) + (set! (-> obj battle-mode) 'remain) + + ;; find an entity for a battlecontroller, check current level + (case cur-lev + (('swamp) + (set! (-> obj battle-entity) (actor-by-name "swamp-battlecontroller-1")) + (set! (-> obj want-skel) '*swamp-rat-sg*) + ) + (('misty) + (set! (-> obj battle-entity) (actor-by-name "misty-battlecontroller-1")) + (set! (-> obj want-skel) '*bonelurker-sg*) + ) + (('citadel) + (set! (-> obj battle-entity) (actor-by-name "citb-battlecontroller-1")) + (set! (-> obj want-skel) '*citb-bunny-sg*) + (set! (-> obj battle-mode) 'alive) + ) + (('maincave) + (set! (-> obj task-entity) (the entity-actor (or (actor-by-name "gnawer-11") + (actor-by-name "gnawer-12") + (actor-by-name "gnawer-13") + (actor-by-name "gnawer-14") + (actor-by-name "gnawer-15") + (actor-by-name "gnawer-16") + (actor-by-name "gnawer-17") + (actor-by-name "gnawer-18") + (actor-by-name "gnawer-19") + ))) + (true! actor-list-task?) + (set! (-> obj want-skel) '*gnawer-sg*) + ) + (('ogre) + (when (= 'debug *cheat-mode*) + (set! (-> obj battle-entity) (actor-by-name "flying-lurker-1")) + (set! (-> obj want-skel) '*flying-lurker-sg*) + (set! (-> obj battle-mode) 'alive) + ) + ) + ) + + ;; have an entity, grab its process + (if (-> obj battle-entity) + (set! battle (-> obj battle-entity extra process))) + + (cond + ;; check level statuses FIRST + ((not (aif (level-get *level* (-> obj last-level)) (-> it display?))) + ;; the old level died. kill everything. + (unless (hidden? obj) + (set! (-> obj last-battle) INVALID_HANDLE) + (set! (-> obj last-task) #f) + (false! (-> obj ready?)) + (kill-all-icons obj) + (go hud-hidden) + ) + ) + ;; check if we have anything + ((-> obj task-entity) + ;; we have a task to track. + + ;; see if we've changed tracking now + (when (or (!= (-> obj display-mode?) 'task) + (!= (-> obj task-entity) (-> obj last-task))) + (set! (-> obj last-task) (-> obj task-entity)) + (set! (-> obj display-mode?) 'task) + (false! (-> obj ready?)) + (send-event obj 'hide) + ) + + ;; logic for each kind of task + (cond + (actor-list-task? + ;; simple: check a list of actors and count how many have completed their task. + (set! (-> obj battle-max) 0) + (set! (-> obj value) 0) + (let ((actor (-> obj task-entity))) + + ;; get the first actor + (while (prev-actor actor) + (set! actor (prev-actor actor))) + + ;; now count forwards. + (while actor + + ;; stuff. + (1+! (-> obj battle-max)) + (when (logtest? (-> actor extra perm status) (entity-perm-status complete)) + (1+! (-> obj value)) + ) + + (set! actor (next-actor actor)) + ) + ) + + (when (and (!= (-> obj value) (-> obj battle-max)) + (or (> (-> obj value) 0) (task-closed? (-> obj task-entity task) (task-status need-hint))) + ) + (update-display-status obj (-> obj want-skel) (-> obj task-entity) 0 #t) + ) + ) + ) + ) + (battle + ;; if its a different process, panic and restart the whole sequence. it's OK + (when (or (!= (-> obj display-mode?) 'battle) + (!= (handle->process (-> obj last-battle)) battle)) + (set! (-> obj last-battle) (process->handle battle)) + (set! (-> obj display-mode?) 'battle) + (false! (-> obj ready?)) + (send-event obj 'hide) + ) + + ;; logic for each kind of process. + (cond + ((type-type? (-> battle type) battlecontroller) + (let ((battle (the battlecontroller battle)) + ) + ;; wait until battle is active + (when (= 'battlecontroller-active (-> battle next-state name)) + ;; get battle stats + (let ((alive-count 0)) + (with-children (child battle) + (1+! alive-count)) + (set! (-> obj value) (- (-> battle spawn-count) alive-count)) + (set! (-> obj battle-max) (-> battle max-spawn-count)) + (set! (-> obj battle-alive) alive-count) + ) + + (update-display-status obj (-> obj want-skel) (-> obj battle-entity) 0 #t) + ) + )) + ((and (= 'debug *cheat-mode*) (= (-> obj battle-entity) (actor-by-name "flying-lurker-1"))) + (let ((battle (the process-drawable battle))) + + (if *target* + (set! (-> obj battle-alive) (the int (/ (vector-vector-distance (-> battle root trans) (target-pos 0)) METER_LENGTH)))) + + (update-display-status obj (-> obj want-skel) (-> obj battle-entity) 0 #t) + )) + ) + ) + (else + ;; we have nothing. kill everything. + (unless (hidden? obj) + (set! (-> obj last-battle) INVALID_HANDLE) + (set! (-> obj last-task) #f) + (false! (-> obj ready?)) + (cond + ((and (!= (-> obj next-state name) 'hud-leaving) + (aif (level-get *level* (-> obj last-level)) (-> it display?)) + ) + (send-event obj 'hide) + ) + (else + (kill-all-icons obj) + (go hud-hidden) + ) + ) + ) + ) + ) + + ;; save the current level + (set! (-> obj last-level) cur-lev) + ) + 0 + (none) + ) + + +(defmethod draw-hud hud-battle-enemy ((obj hud-battle-enemy)) + (let ((t9-0 (method-of-type hud draw-hud))) + (t9-0 obj) + ) + (with-dma-buffer-add-bucket ((buf (-> (current-frame) global-buf)) + (bucket-id debug)) + (let ((str-x (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset)))) + (str-y (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) + (the int (-> *video-parms* relative-y-scale))) + 2)) + ) + + (case (-> obj battle-mode) + (('dead) + (draw-string-xy (string-format "~D/~D" (-> obj value) (-> obj battle-max)) + buf str-x str-y (font-color white) (font-flags shadow kerning large middle)) + ) + (('alive) + (draw-string-xy (string-format "~D" (-> obj battle-alive)) + buf str-x str-y (font-color white) (font-flags shadow kerning large middle)) + ) + (('remain) + (draw-string-xy (string-format "~D" (- (-> obj battle-max) (-> obj value))) + buf str-x str-y (font-color white) (font-flags shadow kerning large middle)) + ) + ) + ) + ) + 0 + (none) + ) + + +(defmethod init-particles! hud-battle-enemy ((obj hud-battle-enemy) (arg0 int)) + (hud-pc-make-icon obj HUD_ICON_COUNT :skel *fuelcell-naked-sg* + :x (the int (* 0.84 512)) :y (the int (* 0.51 448)) :z (meters 0.5) + :scale-x 0.004 :scale-y (* -0.004 (/ 512.0 448.0))) + (set! (-> obj text-x) (the int (* 0.84 512))) + (set! (-> obj text-y) (the int (* 0.5 448))) + (set! (-> obj x-sgn) 1) + (set! (-> obj y-sgn) 0) + (set! (-> obj increment-on-event) #t) + (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + + (set! (-> obj last-battle) INVALID_HANDLE) + (set! (-> obj last-task) #f) + (set! (-> obj want-skel) #f) + (set! (-> obj battle-max) 0) + + (set! (-> obj last-level) #f) + (set! (-> obj kicked) #f) + (set! (-> obj ready?) #f) + 0 + (none) + ) + + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; hud helper funcs +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +(defun deactivate-hud-pc () + "kill the pc hud" + + (dotimes (i HUD_PART_PC_AMOUNT) + (if (-> *hud-parts-pc* parts i) + (deactivate (ppointer->process (-> *hud-parts-pc* parts i)))) + ) + 0) + +(defun activate-hud-pc ((tree process-tree)) + "make the pc hud" + + (deactivate-hud-pc) + + (set! (-> *hud-parts-pc* battle-enemy) (process-spawn hud-battle-enemy :init hud-init-by-other 0 + :from *pc-dead-pool* :to tree)) + 0) + + +(activate-hud-pc *display-pool*) + + + + + diff --git a/goal_src/pc/pckernel-h.gc b/goal_src/pc/pckernel-h.gc index c40f8803d5..1ebbd18fb5 100644 --- a/goal_src/pc/pckernel-h.gc +++ b/goal_src/pc/pckernel-h.gc @@ -23,18 +23,15 @@ |# -(#when PC_PORT - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; constants ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defglobalconstant PC_KERNEL_VERSION_BUILD #x0001) -(defglobalconstant PC_KERNEL_VERSION_REVISION #x0002) +(defglobalconstant PC_KERNEL_VERSION_REVISION #x0006) -(defglobalconstant PC_KERNEL_VERSION_MINOR #x0000) +(defglobalconstant PC_KERNEL_VERSION_MINOR #x0006) (defglobalconstant PC_KERNEL_VERSION_MAJOR #x0001) (defglobalconstant PC_KERNEL_VERSION (logior (ash PC_KERNEL_VERSION_MAJOR 48) @@ -51,37 +48,18 @@ (defconstant ASPECT_16X9_SCALE (/ ASPECT_16X9 ASPECT_4X3)) (defconstant PC_BASE_WIDTH 640) (defconstant PC_BASE_HEIGHT 480) +(defconstant PC_MIN_WIDTH 320) +(defconstant PC_MIN_HEIGHT 240) + + +;; how many entries the music log has. the game only has 21 tracks but let's have more space for no reason. +(defconstant PC_MUSIC_LOG_LENGTH 30) +;; how many entries the spool anim log has. only 164 are used in-game. +(defconstant PC_SPOOL_LOG_LENGTH 170) (defconstant PC_SETTINGS_FILE_NAME "game_config/pc-settings.txt") -(define *pc-subtitle-speaker-valid-options* - (new 'static 'boxed-array :type symbol :length 3 :allocated-length 3 #t #f 'auto)) - -(define *pc-graphics-display-mode-symbol-options* - (new 'static 'boxed-array :type symbol :length 3 :allocated-length 3 'borderless 'fullscreen 'windowed)) - -(define *pc-graphics-original-aspect-ratio-options* - (new 'static 'boxed-array :type symbol :length 2 :allocated-length 2 'orig-aspect-4x3 'orig-aspect-16x9)) - -(define *pc-graphics-aspect-ratio-options* - (new 'static 'boxed-array :type symbol :length 5 :allocated-length 5 'pc-aspect-4x3 'pc-aspect-5x4 'pc-aspect-16x9 'pc-aspect-21x9 'pc-aspect-32x9)) - -(define *pc-graphics-4x3-valid-resolutions* - (new 'static 'boxed-array :type symbol :length 5 :allocated-length 5 '640x480 '800x600 '1024x768 '1280x960 '1600x1200)) - -(define *pc-graphics-5x4-valid-resolutions* - (new 'static 'boxed-array :type symbol :length 3 :allocated-length 3 '960x768 '1280x1024 '1500x1200)) - -(define *pc-graphics-16x9-valid-resolutions* - (new 'static 'boxed-array :type symbol :length 7 :allocated-length 7 '854x480 '1280x720 '1920x1080 '2560x1440 '2880x1620 '3840x2160 '5120x2880)) - -(define *pc-graphics-21x9-valid-resolutions* - (new 'static 'boxed-array :type symbol :length 6 :allocated-length 6 '2560x1080 '3120x1440 '3200x1440 '3440x1440 '3840x1600 '5120x2160)) - -(define *pc-graphics-32x9-valid-resolutions* - (new 'static 'boxed-array :type symbol :length 1 :allocated-length 1 '5120x1440)) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; types and enums ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -144,15 +122,24 @@ (eco-yellow) (invinc) (sidekick-blue) + (tunes) ) (defmacro pc-cheats? (obj &rest cheats) `(logtest? (-> ,obj cheats) (pc-cheats ,@cheats))) +;; music log info +(deftype pc-music-log-entry (structure) + ((name symbol) + (flava-mask int32) + ) + :pack-me + ) + ;; secrets and goodies (deftype pc-game-secrets (structure) ((art pc-jak1-concept-art) ;; concept art unlocked - (music uint64 30) ;; flavas unlocked, for each track (there's like 30 musics, right?) + (music pc-music-log-entry PC_MUSIC_LOG_LENGTH :inline) (hard-fish-hiscore int32) (hard-rats? symbol) ;; enable this crap (hard-rats-hiscore int32) @@ -166,21 +153,6 @@ :pack-me ) -;; general fixes -(deftype pc-fixes (structure) - ((crash-sagecage symbol) ;; citadel - (crash-dma symbol) ;; general out of memory crash - (crash-light-eco symbol) ;; why does this one even happen? - (crash-moles symbol) ;; dont know either - (lockout-pelican symbol) ;; kill pelican during chase - (lockout-pipegame symbol) ;; last buzzer is pipegame - (lockout-gambler symbol) ;; talk without completing - (fix-movies symbol) ;; bad camera and single-frame crappiness - (fix-credits symbol) ;; one of the credits lines has the wrong color!! - ) - :pack-me - ) - ;; bingo integration. placeholder for now. (deftype pc-bingo-info (structure) () @@ -221,23 +193,29 @@ ;; "generic" graphics settings (target-fps int16) ;; the target framerate of the game - (width int32) ;; the width of the rendering, may not match window + ;; game resolution? + (width int32) (height int32) - (win-width int32) ;; the width of the display window + ;; window size. resolution = window size in windowed mode. + (win-width int32) (win-height int32) + ;; real window size from OS + (real-width int32) + (real-height int32) + ;; letterboxed window size + (lbox-width int32) + (lbox-height int32) (dpi-x float) ;; DPI width scale (dpi-y float) ;; DPI height scale - (use-original-aspect-ratio? symbol) - (aspect-ratio-auto? symbol) ;; if on, aspect ratio is calculated automatically. + (aspect-ratio-auto? symbol) ;; if on, aspect ratio is calculated automatically based on game display size. (aspect-ratio float) ;; the desired aspect ratio. set auto to off and then this to 4/3 to force 4x3 aspect. (aspect-ratio-scale float) ;; aspect ratio compared to 4x3 - (aspect-ratio-reciprocal float) ;; aspect ratio compared to 3x4 - (resolution symbol) ;; selected resolution + (aspect-ratio-reciprocal float) ;; reciprocal of that (display-mode symbol) ;; display mode. can be windowed, fullscreen or borderless - (aspect-ratio-mode symbol) ;; explicit vetted aspect ratios - 4:3 | 5:4 | 16:9 | 21:9 | 32:9 (letterbox? symbol) ;; letterbox. #f = stretched (vsync? symbol) ;; vsync. (font-scale float) ;; font scaling. + (window-lock? symbol) ;; whether the window can be resized by the user or not. ;; debug settings (os symbol) ;; windows, linux, macos @@ -248,10 +226,11 @@ (aspect-custom-x int) (aspect-custom-y int) (debug-pad-display symbol) - (progress-force? symbol) (display-bug-report symbol) (display-heap-status symbol) (display-actor-counts symbol) + (display-text-box symbol) + (display-sha symbol) (mood-override? symbol) (mood-overrides float 8) (movie? symbol) @@ -274,6 +253,7 @@ (gfx-renderer pc-gfx-renderer) ;; the renderer to use (gfx-resolution float) ;; for supersampling (gfx-anisotropy float) ;; for anisotropy + (gfx-msaa int) ;; for MSAA ;; ps2 settings (ps2-read-speed? symbol) ;; emulate DVD loads @@ -292,7 +272,7 @@ (lod-force-actor int8) ;; merc lod tier override ;; misc settings - (force-actors? symbol) ;; see actor-force-visible? + (force-actors? symbol) ;; skips vis check for actor entity (music-fade? symbol) ;; if off, music has no fade in (use-vis? symbol) ;; if off, don't use vis trees. this MUST be off for custom (non-cropping) aspect ratios. (skip-movies? symbol) ;; if on, enable cutscene skipping @@ -300,22 +280,28 @@ (hinttitles? symbol) ;; if on, non-cutscene subtitles will show up (subtitle-language pc-subtitle-lang) ;; language for subtitles (subtitle-speaker? symbol) ;; #f (force off), #t (force on), auto (on for offscreen) - (camera-hflip? symbol) ;; horizontal camera invert - (camera-vflip? symbol) ;; vertical camera invert + (first-camera-h-inverted? symbol) ;; first-person horizontal camera inverted + (first-camera-v-inverted? symbol) ;; first-person vertical camera inverted + (third-camera-h-inverted? symbol) ;; third-person horizontal camera inverted + (third-camera-v-inverted? symbol) ;; third-person vertical camera inverted (money-starburst? symbol) ;; add a starburst to the money - - (fixes pc-fixes :inline) ;; extra game fixes + (extra-hud? symbol) ;; extra hud elements. + (music-fadeout? symbol) ;; music fadeout toggle. + (music-fadein? symbol) ;; music fadein toggle. (bingo pc-bingo-info :inline) ;; bingo integration. does nothing for now. (secrets pc-game-secrets :inline) ;; hidden goodies and additional secrets! - (scenes-seen uint8 197) ;; cutscenes that have been seen, by spool-anim (maybe use 8-char name or bits instead?) + (scenes-seen uint8 PC_SPOOL_LOG_LENGTH) ;; cutscenes that have been seen, by spool-anim (maybe use 8-char name or bits instead?) (discord-rpc? symbol) ;; enable discord rich presence integration (cheats pc-cheats) + (cheats-known pc-cheats) + (flava-hack int64) + ;; TODO - save/restore original settings (language/sound/etc) ) @@ -330,21 +316,22 @@ (reset-gfx (_type_) none) (reset-ps2 (_type_) none) (reset-misc (_type_) none) - (reset-fixes (_type_) none) + (reset-original-camera (_type_) none) (reset-extra (_type_) none) (draw (_type_ dma-buffer) none) - (use-orig-aspect-ratio! (_type_ symbol) none) - (set-display-mode! (_type_ symbol) none) - (set-aspect-ratio-mode! (_type_ symbol) none) - (set-resolution! (_type_ symbol) none) + (set-display-mode! (_type_ symbol) int) (set-size! (_type_ int int) none) (set-aspect! (_type_ int int) none) (set-aspect-ratio! (_type_ float) none) + (set-window-lock! (_type_ symbol) symbol) + (set-frame-rate! (_type_ int) int) (read-from-file (_type_ string) symbol) (write-to-file (_type_ string) symbol) - (actor-force-visible? (_type_) symbol) (update-cheats (_type_) int) + (update-music-log (_type_) int) + (add-to-music-log (_type_ symbol int) int) (commit-to-file (_type_) none) + (load-settings (_type_) int) ) ) @@ -363,9 +350,15 @@ ((fuel (pointer float)) (money-total (pointer float)) (buzzer-total (pointer float)) + (deaths (pointer int32)) (status string) (level string) (cutscene? symbol) + (ogreboss? symbol) + (plant-boss? symbol) + (racer? symbol) + (flutflut? symbol) + (time-of-day (pointer float)) ) ) @@ -393,23 +386,24 @@ (set! (-> obj new-lb?) #f) (set! (-> obj display-actor-bank) #f) (set! (-> obj debug-pad-display) #f) - (set! (-> obj progress-force?) #f) (set! (-> obj display-bug-report) #f) (set! (-> obj display-heap-status) #f) (set! (-> obj display-actor-counts) #f) + (set! (-> obj display-text-box) #f) + (set! (-> obj display-sha) *debug-segment*) (set! (-> obj mood-override?) #f) (set! (-> obj movie?) #f) (set! (-> obj font-scale) 1.0) - (set! (-> obj aspect-custom-x) 1) - (set! (-> obj aspect-custom-y) 1) + (set! (-> obj aspect-custom-x) 4) + (set! (-> obj aspect-custom-y) 3) (set! (-> obj discord-rpc?) #t) + (set! (-> obj window-lock?) #t) (reset-gfx obj) (reset-audio obj) (reset-input obj) (reset-ps2 obj) (reset-misc obj) - (reset-fixes obj) (reset-extra obj) (none)) @@ -422,14 +416,15 @@ (set! (-> obj width) PC_BASE_WIDTH) (set! (-> obj height) PC_BASE_HEIGHT) (set! (-> obj use-vis?) #f) - (set! (-> obj use-original-aspect-ratio?) #f) (set! (-> obj aspect-ratio-auto?) #f) (set! (-> obj vsync?) #t) (set! (-> obj letterbox?) #t) - (set-aspect-ratio-mode! obj 'pc-aspect-4x3) - (set-resolution! obj '640x480) (set-display-mode! obj 'windowed) + (set-size! obj PC_BASE_WIDTH PC_BASE_HEIGHT) + (set-aspect! obj 4 3) + + (set! (-> obj gfx-msaa) 4) ;; 4x msaa (none)) @@ -440,6 +435,10 @@ (set! (-> obj audio-pan-override) 0.0) (set! (-> obj audio-volume-override) 1.0) (set! (-> obj audio-channel-nb) PS2_VOICE_AMOUNT) + + (set! (-> obj music-fadeout?) #t) + (set! (-> obj music-fadein?) #t) + (none)) (defmethod reset-input pc-settings ((obj pc-settings)) @@ -452,7 +451,7 @@ "Set the default ps2 settings" (set! (-> obj ps2-read-speed?) #f) - (set! (-> obj ps2-parts?) #t) + (set! (-> obj ps2-parts?) #f) (set! (-> obj ps2-music?) #t) (set! (-> obj ps2-se?) #t) (set! (-> obj ps2-hints?) #t) @@ -476,33 +475,29 @@ (set! (-> obj hinttitles?) #t) (set! (-> obj subtitle-speaker?) 'auto) (set! (-> obj subtitle-language) (pc-subtitle-lang english)) - (set! (-> obj camera-hflip?) #f) - (set! (-> obj camera-vflip?) #f) + (reset-original-camera obj) (set! (-> obj money-starburst?) #f) + (set! (-> obj extra-hud?) #f) (none)) -(defmethod reset-fixes pc-settings ((obj pc-settings)) - "Set the default fixes settings" - - (set! (-> obj fixes crash-sagecage) #t) - (set! (-> obj fixes crash-dma) #t) - (set! (-> obj fixes crash-light-eco) #t) - (set! (-> obj fixes crash-moles) #t) - (set! (-> obj fixes lockout-pelican) #t) - (set! (-> obj fixes lockout-pipegame) #t) - (set! (-> obj fixes lockout-gambler) #t) - (set! (-> obj fixes fix-movies) #f) - (set! (-> obj fixes fix-credits) #t) +(defmethod reset-original-camera pc-settings ((obj pc-settings)) + "Set the original game's camera controls" + + (set! (-> obj first-camera-h-inverted?) #f) ;; first-person horizontal is NOT inverted in original game + (set! (-> obj first-camera-v-inverted?) #t) ;; first-person vertical IS inverted in original game + (set! (-> obj third-camera-h-inverted?) #t) ;; third person horizontal IS inverted in original game + (set! (-> obj third-camera-v-inverted?) #t) ;; third-person vertical IS inverted in original game (none)) (defmethod reset-extra pc-settings ((obj pc-settings)) "Set the default goodies settings" - (dotimes (i 197) + (dotimes (i PC_SPOOL_LOG_LENGTH) (set! (-> obj scenes-seen i) 0) ) - (dotimes (i 30) - (set! (-> obj secrets music i) 0) + (dotimes (i PC_MUSIC_LOG_LENGTH) + (set! (-> obj secrets music i name) #f) + (set! (-> obj secrets music i flava-mask) 0) ) (set! (-> obj secrets art) (pc-jak1-concept-art)) @@ -515,14 +510,11 @@ (set! (-> obj secrets hud-counters?) #t) (set! (-> obj secrets hud-watch?) #f) (set! (-> obj secrets watch-12hr?) #f) + + (set! (-> obj cheats) (pc-cheats)) + (set! (-> obj cheats-known) (pc-cheats)) (none)) -(defmethod actor-force-visible? pc-settings ((obj pc-settings)) - "return #t if actors should be visible regardless of vis." - (declare (inline)) - (and (not (-> obj use-vis?)) (-> obj force-actors?)) - ) - (defmacro with-pc (&rest body) "encapsulates the code around PC-specific checks" `(#when PC_PORT (when (and *pc-settings*) @@ -608,7 +600,4 @@ )) -) - - diff --git a/goal_src/pc/pckernel.gc b/goal_src/pc/pckernel.gc index 3a9103adaf..3d498325ed 100644 --- a/goal_src/pc/pckernel.gc +++ b/goal_src/pc/pckernel.gc @@ -3,7 +3,7 @@ #| - This file contains code that we need for the PC port of the game specifically. + This file contains new code that we need for the PC port of the game specifically. It should be included as part of the game engine package (engine.cgo). This file contains various types and functions to store PC-specific information @@ -23,9 +23,27 @@ |# -(#when PC_PORT +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; global variables +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; collision renderer things. debug only. +(define *collision-renderer* #f) +(define *collision-wireframe* #f) +(define *collision-mode* (pc-collision-mode mode)) + +;; todo +(defenum pc-pat-skip-hack + :bitfield #t + (noentity 0) + (nocamera 1) + (noedge 2) + (nolineofsight 12) + (unknowncamera 13) + (unknown 15) + ) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; updates ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -35,24 +53,23 @@ (defmethod set-display-mode! pc-settings ((obj pc-settings) (mode symbol)) "sets the game's display mode" - ;; changing to same mode, no-op - (if (= (-> obj display-mode) mode) - (return 0)) - - ;; else change it and update it + ;; change the display mode. (set! (-> obj display-mode) mode) - (cond - ((= mode 'borderless) - (pc-set-fullscreen 2 0)) - ((= mode 'fullscreen) - (pc-set-fullscreen 1 0)) - (else ;; default to windowed - (pc-set-fullscreen 0 0))) - (none)) + 0) (defmethod set-size! pc-settings ((obj pc-settings) (width int) (height int)) "sets the size of the display window" - (pc-set-window-size width height) + (format #t "Setting size to ~D x ~D~%" width height) + (cond + ((= 'windowed (-> obj display-mode)) + (set! (-> obj win-width) width) + (set! (-> obj win-height) height) + ) + (else + (format 0 "Nope! No changing fullscreen resolution for now!") + (format #t "Nope! No changing fullscreen resolution for now!") + ) + ) (none)) @@ -60,23 +77,13 @@ "set the aspect ratio used for rendering. this forces native widescreen and takes width and height ratios." (let ((aspect (/ (the float aw) (the float ah)))) (set-aspect-ratio! obj aspect) + (set! (-> obj aspect-custom-x) aw) + (set! (-> obj aspect-custom-y) ah) (set! (-> obj aspect-ratio-auto?) #f) (set! (-> obj use-vis?) #f) ) (none)) -(defmethod use-orig-aspect-ratio! pc-settings ((obj pc-settings) (val symbol)) - "whether to use the pc port's aspect ratio, or the original games 4:3/16:9" - (if (= (-> obj use-original-aspect-ratio?) val) - (return 0)) - (set! (-> obj use-original-aspect-ratio?) val) - ;; default to the simplist resolution if we are changing - (if val - (set-aspect-ratio-mode! obj 'orig-aspect-4x3) - (set-aspect-ratio-mode! obj 'pc-aspect-4x3)) - (set! (-> *pc-settings* use-vis?) val) - (none)) - (defmethod set-aspect-ratio! pc-settings ((obj pc-settings) (aspect float)) "set the aspect ratio used for rendering." (set! (-> obj aspect-ratio) aspect) @@ -84,102 +91,52 @@ (set! (-> obj aspect-ratio-reciprocal) (/ ASPECT_4X3 aspect)) (none)) -(defmethod set-aspect-ratio-mode! pc-settings ((obj pc-settings) (mode symbol)) - "sets the game's aspect ratio mode" +(defmethod set-window-lock! pc-settings ((obj pc-settings) (lock symbol)) + "set the aspect ratio used for rendering." + (pc-set-window-lock lock) + (set! (-> obj window-lock?) lock)) - ;; changing to same mode, no-op - (if (= (-> obj aspect-ratio-mode) mode) - (return 0)) - - ;; else change it and update it - (set! (-> obj aspect-ratio-mode) mode) - ;; also default to the lowest resolution option at the same time - (case mode - (('orig-aspect-4x3) - (set-resolution! obj (-> *pc-graphics-4x3-valid-resolutions* 0))) - (('orig-aspect-16x9) - (set-resolution! obj (-> *pc-graphics-16x9-valid-resolutions* 0))) - (('pc-aspect-4x3) - (set-aspect! obj 4 3) - (set-resolution! obj (-> *pc-graphics-4x3-valid-resolutions* 0))) - (('pc-aspect-5x4) - (set-aspect! obj 5 4) - (set-resolution! obj (-> *pc-graphics-5x4-valid-resolutions* 0))) - (('pc-aspect-16x9) - (set-aspect! obj 16 9) - (set-resolution! obj (-> *pc-graphics-16x9-valid-resolutions* 0))) - (('pc-aspect-21x9) - (set-aspect! obj 21 9) - (set-resolution! obj (-> *pc-graphics-21x9-valid-resolutions* 0))) - (('pc-aspect-32x9) - (set-aspect! obj 32 9) - (set-resolution! obj (-> *pc-graphics-32x9-valid-resolutions* 0)))) - - ;; NOTE - i believe this is a temporary workaround to get the hud looking decent on pc aspect ratios - ;; eventually i assume this will only be required for the original ones! - (case mode - (('orig-aspect-4x3 'pc-aspect-4x3) - (set! (-> *setting-control* default aspect-ratio) 'aspect4x3)) - (else - (set! (-> *setting-control* default aspect-ratio) 'aspect16x9))) - - ;; NOTE - it should not be necessarily to call `set-aspect-ratio` as that is - ;; done on a per frame basis as long as it differs from the "current" setting-control value - ;; - ;; However, if I'm wrong, then that needs to be fixed at the build/load level again - ;; as that function is defined in `video` later in the order. - (none)) - -(defmethod set-resolution! pc-settings ((obj pc-settings) (mode symbol)) - "sets the game's resolution" - - ;; TODO - implement a custom resolution mode which will enable resizing and use the values stored - ;; changing to same mode, no-op - (if (= (-> obj resolution) mode) - (none)) - - ;; else change it and update it - (set! (-> obj resolution) mode) - (case mode - (('640x480) (set-size! obj 640 480)) - (('800x600) (set-size! obj 800 600)) - (('1024x768) (set-size! obj 1024 768)) - (('1280x960) (set-size! obj 1280 960)) - (('1600x1200) (set-size! obj 1600 1200)) - (('960x768) (set-size! obj 960 768)) - (('1280x1024) (set-size! obj 1280 1024)) - (('1500x1200) (set-size! obj 1500 1200)) - (('854x480) (set-size! obj 854 480)) - (('1280x720) (set-size! obj 1280 720)) - (('1920x1080) (set-size! obj 1920 1080)) - (('2560x1440) (set-size! obj 2560 1440)) - (('2880x1620) (set-size! obj 2880 1620)) - (('3840x2160) (set-size! obj 3840 2160)) - (('5120x2880) (set-size! obj 5120 2880)) - (('2560x1080) (set-size! obj 2560 1080)) - (('3120x1440) (set-size! obj 3120 1440)) - (('3200x1440) (set-size! obj 3200 1440)) - (('3440x1440) (set-size! obj 3440 1440)) - (('3840x1600) (set-size! obj 3840 1600)) - (('5120x2160) (set-size! obj 5120 2160)) - (('5120x1440) (set-size! obj 5120 1440))) - (none)) +(defmethod set-frame-rate! pc-settings ((obj pc-settings) (rate int)) + "set the aspect ratio used for rendering." + + (pc-set-frame-rate rate) + (if (and (!= 'fullscreen (-> obj display-mode)) + (!= (pc-get-screen-rate -1) rate)) + (set! (-> obj vsync?) #f)) + (case rate + ((60) + (set! (-> obj target-fps) rate) + (set! (-> *setting-control* default video-mode) 'ntsc) + (set-video-mode 'ntsc) + ) + ((100) + (set! (-> obj target-fps) rate) + (set! (-> *setting-control* default video-mode) '100fps) + (set-video-mode '100fps) + ) + ((150) + (set! (-> obj target-fps) rate) + (set! (-> *setting-control* default video-mode) '150fps) + (set-video-mode '150fps) + ) + ) + + rate) (defmethod commit-to-file pc-settings ((obj pc-settings)) "commits the current settings to the file" ;; auto load settings if available - (clear *pc-temp-string-1*) - (format *pc-temp-string-1* "~S/pc-settings.gc" *pc-settings-folder*) + + (format (clear *pc-temp-string-1*) "~S/pc-settings.gc" *pc-settings-folder*) (pc-mkdir-file-path *pc-temp-string-1*) (write-to-file obj *pc-temp-string-1*) - (clear *pc-temp-string-1*) (none)) (defmethod update-from-os pc-settings ((obj pc-settings)) - "Update settings from the PC kernel to GOAL." + "Update settings from the C kernel to GOAL." (set! (-> obj os) (pc-get-os)) - (pc-get-window-size (&-> obj win-width) (&-> obj win-height)) + (pc-get-window-size (&-> obj real-width) (&-> obj real-height)) (pc-get-window-scale (&-> obj dpi-x) (&-> obj dpi-y)) (when (-> obj use-vis?) @@ -189,28 +146,28 @@ ) ) - (let ((win-aspect (/ (the float (-> obj win-width)) (the float (-> obj win-height))))) + (let ((win-aspect (/ (the float (-> obj real-width)) (the float (-> obj real-height))))) (cond ((and (not (-> obj use-vis?)) (-> obj aspect-ratio-auto?)) ;; the window determines the resolution (set-aspect-ratio! obj win-aspect) - (set! (-> obj width) (-> obj win-width)) - (set! (-> obj height) (-> obj win-height)) + (set! (-> obj lbox-width) (-> obj real-width)) + (set! (-> obj lbox-height) (-> obj real-height)) ) ((> win-aspect (-> obj aspect-ratio)) ;; too wide - (set! (-> obj width) (the int (* (the float (-> obj win-height)) (-> obj aspect-ratio)))) - (set! (-> obj height) (-> obj win-height)) + (set! (-> obj lbox-width) (the int (* (the float (-> obj real-height)) (-> obj aspect-ratio)))) + (set! (-> obj lbox-height) (-> obj real-height)) ) ((< win-aspect (-> obj aspect-ratio)) ;; too tall - (set! (-> obj width) (-> obj win-width)) - (set! (-> obj height) (the int (/ (the float (-> obj win-width)) (-> obj aspect-ratio)))) + (set! (-> obj lbox-width) (-> obj real-width)) + (set! (-> obj lbox-height) (the int (/ (the float (-> obj real-width)) (-> obj aspect-ratio)))) ) (else ;; just right - (set! (-> obj width) (-> obj win-width)) - (set! (-> obj height) (-> obj win-height)) + (set! (-> obj lbox-width) (-> obj real-width)) + (set! (-> obj lbox-height) (-> obj real-height)) ) ) ) @@ -219,39 +176,58 @@ (none)) (defmethod update-to-os pc-settings ((obj pc-settings)) - "Update settings from GOAL to the PC kernel." + "Update settings from GOAL to the C kernel." (cond ((-> obj letterbox?) - (pc-set-letterbox (-> obj width) (-> obj height)) + (pc-set-letterbox (-> obj lbox-width) (-> obj lbox-height)) ) (else - (pc-set-letterbox (-> obj win-width) (-> obj win-height)) + (pc-set-letterbox (-> obj real-width) (-> obj real-height)) ) ) - (cond - ((-> obj discord-rpc?) - (pc-discord-rpc-set 1) - ) - (else - (pc-discord-rpc-set 0) - ) + (pc-set-fullscreen (-> obj display-mode) 0) + (when (-> obj window-lock?) + (pc-set-vsync (-> obj vsync?)) + + (when (!= 'fullscreen (-> obj display-mode)) + (if (< (pc-get-screen-rate -1) (-> obj target-fps)) + (pc-set-vsync #f)) + (pc-set-frame-rate (-> obj target-fps))) + + (if (and (= 'windowed (-> obj display-mode)) + (or (!= (-> obj win-width) (-> obj real-width)) + (!= (-> obj win-height) (-> obj real-height)))) + (pc-set-window-size (max PC_MIN_WIDTH (-> obj win-width)) (max PC_MIN_HEIGHT (-> obj win-height)))) ) + (pc-discord-rpc-set (if (-> obj discord-rpc?) 1 0)) + (when #t ;; (not (-> obj ps2-lod-dist?)) (pc-renderer-tree-set-lod (pc-renderer-tree-type tfrag3) (-> obj lod-force-tfrag)) (pc-renderer-tree-set-lod (pc-renderer-tree-type tie3) (-> obj lod-force-tie)) ) - ;; TODO - save changes + (when *debug-segment* + (pc-set-collision *collision-renderer*) + (pc-set-collision-wireframe *collision-wireframe*) + (pc-set-collision-mode *collision-mode*) + ) + + (pc-sound-set-flava-hack (-> obj flava-hack)) + (let ((fade-hack 0)) + (unless (-> obj music-fadein?) (logior! fade-hack 1)) + (unless (-> obj music-fadeout?) (logior! fade-hack 2)) + (pc-sound-set-fade-hack fade-hack) + ) (none)) -(define *pc-cheat-temp* (the-as (pointer int32) (malloc 'global 24))) +(define *pc-cheat-temp* (the-as (pointer int32) (malloc 'global (* 4 7)))) (defmacro pc-cheat-toggle-and-tune (obj cheat) `(begin - (cpad-clear-buttons! 0 r1) + (cpad-clear! 0 r1) (logxor! (-> ,obj cheats) (pc-cheats ,cheat)) (cheats-sound-play (logtest? (-> ,obj cheats) (pc-cheats ,cheat))) ) @@ -270,14 +246,52 @@ (set! (-> info fuel) (&-> *game-info* fuel)) (set! (-> info money-total) (&-> *game-info* money-total)) (set! (-> info buzzer-total) (&-> *game-info* buzzer-total)) - (set! (-> info status) "Playing Jak and Daxter: TPL") - (set! (-> info level) (if *target* - (symbol->string (-> *target* current-level name)) ;; use target's level if it exists - (symbol->string (-> (level-get-target-inside *level*) name)) ;; use camera's level otherwise - ) - ) - (set! (-> info cutscene?) (movie?)) - (pc-discord-rpc-update info) + (set! (-> info deaths) (&-> *game-info* total-deaths)) + (set! (-> info status) "Playing Jak and Daxter: The Precursor Legacy™") + (set! (-> info level) (symbol->string (-> (level-get-target-inside *level*) name))) ;; grab the name of level we're in + (set! (-> info cutscene?) (-> obj movie?)) + (set! (-> info ogreboss?) (aif (process-by-ename "ogreboss-1") (case (-> it next-state name) ( + ('ogreboss-die + 'ogreboss-idle + 'ogreboss-stage1 + 'ogreboss-stage2 + 'ogreboss-stage3-hit + 'ogreboss-stage3-shuffle + 'ogreboss-stage3-throw + 'ogreboss-wait-for-player) #t)))) + (set! (-> info plant-boss?) (aif (process-by-ename "plant-boss-3") (case (-> it next-state name) ( + ('plant-boss-idle + 'plant-boss-hit + 'plant-boss-vulnerable + 'plant-boss-spawn + 'plant-boss-reset + 'plant-boss-attack) #t)))) + (set! (-> info racer?) (aif *target* (case (-> it next-state name) ( + ('target-racing + 'target-racing-bounce + 'target-racing-death + 'target-racing-falling + 'target-racing-grab + 'target-racing-hit + 'target-racing-jump + 'target-racing-smack + 'target-racing-start) #t)))) + (set! (-> info flutflut?) (aif *target* (case (-> it next-state name) ( + ('target-flut-air-attack + 'target-flut-air-attack-hit-ground + 'target-flut-double-jump + 'target-flut-falling + 'target-flut-grab + 'target-flut-hit + 'target-flut-hit-ground + 'target-flut-jump + 'target-flut-running-attack + 'target-flut-stance + 'target-flut-start + 'target-flut-walk) #t)))) + (set! (-> info time-of-day) (&-> *time-of-day-context* time)) + + (with-profiler "discord-update" (pc-discord-rpc-update info)) ) (when (not (-> obj use-vis?)) @@ -291,8 +305,9 @@ (when *progress-process* ;; adjust sizes for progress. ;; video.gc sets the sizes in the normal game. + ;; this is a complete hack and i'm losing it (let ((pr (-> *progress-process*)) - (wide-adjust (* 4.0 (- (/ (-> obj aspect-ratio-scale) ASPECT_16X9_SCALE) (1/ ASPECT_16X9_SCALE)))) + ;(wide-adjust (* 4.0 (- (/ (-> obj aspect-ratio-scale) ASPECT_16X9_SCALE) (1/ ASPECT_16X9_SCALE)))) ) (set! (-> pr sides-x-scale) 1.0) (set! (-> pr sides-y-scale) 13.0) @@ -303,18 +318,21 @@ ) ) (cond - ((actor-force-visible? obj) - (set! (-> *ACTOR-bank* birth-dist) (meters 10000)) - (set! (-> *ACTOR-bank* pause-dist) (meters 10000)) - (set! (-> *ACTOR-bank* birth-max) 1000) - ) - ((> (-> *ACTOR-bank* birth-dist) (meters 220)) + ((-> obj force-actors?) + ;; kinda overkill. + (set! (-> *ACTOR-bank* birth-dist) (meters 10000)) + (set! (-> *ACTOR-bank* pause-dist) (meters 10000)) + (set! (-> *ACTOR-bank* birth-max) 1000) + ) + ((> (-> *ACTOR-bank* birth-dist) (meters 220)) ;; the original caps at 220m, exceeding that means it was using our hacks (set! (-> *ACTOR-bank* birth-dist) (meters 220)) (set! (-> *ACTOR-bank* pause-dist) (meters 220)) )) ;; cheats. (update-cheats obj) + ;; music. + (update-music-log obj) (none)) @@ -344,44 +362,140 @@ (pc-check-cheat-code (-> *pc-cheat-temp* 5) 0 (l e a d s) (pc-cheat-toggle-and-tune obj sidekick-blue)) + + (pc-check-cheat-code (-> *pc-cheat-temp* 6) 0 (t u n e s) + (pc-cheat-toggle-and-tune obj tunes)) ) (when *target* + (with-pp (protect ((-> *target* fact-info-target eco-source) *sound-player-enable*) + ;; act as if this isnt a new source of eco to prevent spamming sounds. then restore the old source! + (when (< 0 (-> *target* fact-info-target eco-level)) + (set! (-> *target* fact-info-target eco-source) (process->handle pp)) + (false! *sound-player-enable*) + ) + + ;; blue eco! (when (and (pc-cheats? obj eco-blue) (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-blue)) (<= (-> *target* fact-info-target eco-level) 0.0))) - (send-event *target* 'get-pickup (pickup-type eco-blue) (-> *FACT-bank* eco-full-inc))) + (protect ((-> *target* event-hook)) + (set! (-> *target* event-hook) target-generic-event-handler) + (send-event *target* 'get-pickup (pickup-type eco-blue) (-> *FACT-bank* eco-full-inc)) + ) + (send-event *target* 'boost (-> *FACT-bank* eco-single-inc))) + ;; yellow eco! (when (and (pc-cheats? obj eco-yellow) (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-yellow)) (<= (-> *target* fact-info-target eco-level) 0.0))) (send-event *target* 'get-pickup (pickup-type eco-yellow) (-> *FACT-bank* eco-full-inc))) + ;; red eco! (when (and (pc-cheats? obj eco-red) (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-red)) (<= (-> *target* fact-info-target eco-level) 0.0))) (send-event *target* 'get-pickup (pickup-type eco-red) (-> *FACT-bank* eco-full-inc))) + ;; green eco! (when (and (pc-cheats? obj eco-green) (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-green)) (<= (-> *target* fact-info-target eco-level) 0.0))) - (with-pp (define-extern vent type) - (protect ((-> (the basic pp) type) (-> *target* control root-prim prim-core action)) - (set! (-> (the basic pp) type) vent) - (logior! (-> *target* control root-prim prim-core action) #x200) + (protect ((-> pp type) (-> *target* control root-prim prim-core action)) + (set! (-> pp type) vent) + (logior! (-> *target* control root-prim prim-core action) (collide-action ca-9)) (send-event *target* 'get-pickup (pickup-type eco-green) (-> *FACT-bank* eco-full-inc))) - )) + ) + )) (when (pc-cheats? obj invinc) - (logior! (-> *target* state-flags) 16) + (logior! (-> *target* state-flags) (state-flags invulnerable)) ) ) + + (if (pc-cheats? obj tunes) + (set! (-> obj flava-hack) -1) + (set! (-> obj flava-hack) 0) + ) + + (logior! (-> obj cheats-known) (-> obj cheats)) 0) +(defmethod add-to-music-log pc-settings ((obj pc-settings) (music symbol) (flava int)) + "add music and flava information to the music log. + if music already exists, adds flava. if flava already exists, nothing happens." + + ;; go through our music log + (dotimes (i PC_MUSIC_LOG_LENGTH) + (cond + ;; an empty log entry! place the currently playing music there, and fill flava. + ((not (-> obj secrets music i name)) + (set! (-> obj secrets music i name) music) + (set! (-> obj secrets music i flava-mask) (ash 1 flava)) + (return 0) + ) + ;; an existing log entry for the current music. fill flava. + ((= music (-> obj secrets music i name)) + (logior! (-> obj secrets music i flava-mask) (ash 1 flava)) + (return 0) + ) + ;; something else. maybe the wrong entry, in which case nothing to do. + ) + ) + + 0) + +(defmethod update-music-log pc-settings ((obj pc-settings)) + "update music log settings." + + ;; add whatever is playing to the music log. + (add-to-music-log obj (-> *setting-control* current music) (the int (-> *setting-control* current sound-flava))) + + ;; special cases. for example, npc's that despawn and you can't hear their music anymore. + (if (task-closed? (game-task beach-ecorocks) (task-status need-introduction)) + (add-to-music-log obj 'village1 1)) + (if (task-closed? (game-task jungle-plant) (task-status need-resolution)) + (add-to-music-log obj 'jungleb 2)) + (if (task-closed? (game-task beach-flutflut) (task-status need-resolution)) + (add-to-music-log obj 'beach (flava-lookup 'beach (music-flava birdlady)))) + (if (task-closed? (game-task beach-flutflut) (task-status need-resolution)) + (add-to-music-log obj 'village1 (flava-lookup 'village1 (music-flava birdlady)))) + (if (task-closed? (game-task misty-warehouse) (task-status need-resolution)) + (add-to-music-log obj 'misty (flava-lookup 'misty (music-flava misty-battle)))) + (if (task-closed? (game-task misty-cannon) (task-status need-resolution)) + (add-to-music-log obj 'misty 4)) + (if (task-closed? (game-task firecanyon-end) (task-status need-resolution)) + (add-to-music-log obj 'firecanyon 2)) + (if (task-closed? (game-task swamp-billy) (task-status need-resolution)) + (add-to-music-log obj 'swamp 1)) + (if (task-closed? (game-task swamp-battle) (task-status need-resolution)) + (add-to-music-log obj 'swamp (flava-lookup 'swamp (music-flava swamp-battle)))) + (if (task-closed? (game-task snow-bunnies) (task-status need-resolution)) + (add-to-music-log obj 'snow (flava-lookup 'snow (music-flava snow-battle)))) + (if (task-closed? (game-task citadel-sage-yellow) (task-status need-resolution)) + (add-to-music-log obj 'citadel (flava-lookup 'citadel (music-flava sage-yellow)))) + (if (task-closed? (game-task citadel-sage-red) (task-status need-resolution)) + (add-to-music-log obj 'citadel (flava-lookup 'citadel (music-flava sage-red)))) + (if (task-closed? (game-task citadel-sage-blue) (task-status need-resolution)) + (add-to-music-log obj 'citadel (flava-lookup 'citadel (music-flava sage-blue)))) + (if (task-closed? (game-task citadel-sage-green) (task-status need-resolution)) + (add-to-music-log obj 'citadel (flava-lookup 'citadel (music-flava sage)))) + (if (task-closed? (game-task citadel-buzzer) (task-status need-resolution)) + (add-to-music-log obj 'citadel (flava-lookup 'citadel (music-flava assistant)))) + (when (and *target* (>= (float->int (send-event *target* 'query 'pickup (pickup-type fuel-cell))) 100)) + (add-to-music-log obj 'credits 0) + (add-to-music-log obj 'credits 1) + (add-to-music-log obj 'credits 2) + ) + + 0) + + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -394,8 +508,8 @@ (clear *pc-temp-string*) (format *pc-temp-string* "game resolution: ~D x ~D~%" (-> obj width) (-> obj height)) - (format *pc-temp-string* "window size: ~D x ~D (~,,1f x ~,,1f)~%" (-> obj win-width) (-> obj win-height) (-> obj dpi-x) (-> obj dpi-y)) - (format *pc-temp-string* "target aspect: ~,,3f/~,,3f A: ~A/~A L: ~A~%" (-> obj aspect-ratio) (/ (the float (-> obj win-width)) (the float (-> obj win-height))) (-> obj aspect-ratio-auto?) (-> obj use-vis?) (-> obj letterbox?)) + (format *pc-temp-string* "window size: ~D x ~D (~,,1f x ~,,1f)~%" (-> obj real-width) (-> obj real-height) (-> obj dpi-x) (-> obj dpi-y)) + (format *pc-temp-string* "target aspect: ~,,3f/~,,3f A: ~A/~A L: ~A~%" (-> obj aspect-ratio) (/ (the float (-> obj real-width)) (the float (-> obj real-height))) (-> obj aspect-ratio-auto?) (-> obj use-vis?) (-> obj letterbox?)) (format *pc-temp-string* "display-type: ~A ~A~%" (-> obj display-mode) (-> obj vsync?)) (draw-string-xy *pc-temp-string* buf 0 (- 224 (* 8 4)) (font-color default) (font-flags shadow kerning)) @@ -405,6 +519,31 @@ ) +(defun find-music-log ((music symbol)) + "return #t if the given music is logged into the *pc-settings*, #f otherwise." + (dotimes (i PC_MUSIC_LOG_LENGTH) + (if (= music (-> *pc-settings* secrets music i name)) + (return #t))) + #f) + +(defun find-flava-log ((music symbol) (flava-idx int)) + "return #t if the given music's flava is logged into the *pc-settings*, #f otherwise." + (dotimes (i PC_MUSIC_LOG_LENGTH) + (if (= music (-> *pc-settings* secrets music i name)) + (return (logtest? (-> *pc-settings* secrets music i flava-mask) (ash 1 flava-idx))))) + #f) + +(defun-debug print-music-log ((out object)) + "prints the *pc-settings* music log." + + (dotimes (i PC_MUSIC_LOG_LENGTH) + (if (-> *pc-settings* secrets music i name) + (format out "music log ~D: ~A (f #x~x)~%" i (-> *pc-settings* secrets music i name) (-> *pc-settings* secrets music i flava-mask))) + ) + + 0) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; file IO @@ -525,6 +664,21 @@ ) ) +(defmacro file-stream-get-next-char-ret (fs) + `(begin + (file-stream-seek-past-whitespace ,fs) + (let ((c (file-stream-getc ,fs))) + (file-stream-seek ,fs -1 SCE_SEEK_CUR) + c)) + ) + +(defmacro file-stream-get-next-char (fs) + `(begin + (file-stream-seek-past-whitespace ,fs) + (file-stream-getc ,fs) + ) + ) + (defmacro dosettings (bindings &rest body) "iterate over a list of key-value pairs like so: ( ) ( ) ... the name of key is stored in *pc-temp-string*" @@ -535,8 +689,7 @@ ,@body - (file-stream-seek-past-whitespace ,fs) - (set! c (file-stream-getc ,fs)) + (set! c (file-stream-get-next-char ,fs)) (when (!= #x29 c) (pc-settings-read-throw-error ,fs (string-format "invalid char, ) not found, got #x~X ~A" c *pc-temp-string*)) ) @@ -558,29 +711,40 @@ (let ((version PC_KERNEL_VERSION)) (with-settings-scope (file) - (file-stream-read-word file) - (case-str *pc-temp-string* + (case-str (file-stream-read-word file) (("settings") (set! version (file-stream-read-int file)) + (cond + ((= (logand version #xffffffff00000000) (logand PC_KERNEL_VERSION #xffffffff00000000)) + ;; minor difference + ) + (else + ;; major difference + (format 0 "PC kernel version mismatch! Got ~D.~D vs ~D.~D~%" PC_KERNEL_VERSION_MAJOR PC_KERNEL_VERSION_MINOR (bit-field int version 32 16) (bit-field int version 48 16)) + (file-stream-close file) + (return #f) + ) + ) (dosettings (file) (case-str *pc-temp-string* (("fps") (set! (-> obj target-fps) (file-stream-read-int file))) - (("size") + (("window-size") + (set! (-> obj win-width) (file-stream-read-int file)) + (set! (-> obj win-height) (file-stream-read-int file)) + ) + (("game-size") (set! (-> obj width) (file-stream-read-int file)) (set! (-> obj height) (file-stream-read-int file)) - (set-size! obj (-> obj width) (-> obj height)) - (set-aspect! obj (-> obj width) (-> obj height)) ) - (("use-original-aspect-ratio?") - (set! (-> obj use-original-aspect-ratio?) (file-stream-read-symbol file))) - (("aspect") + (("aspect") (set-aspect! obj (file-stream-read-int file) (file-stream-read-int file))) + (("aspect-test") (set! (-> obj aspect-custom-x) (file-stream-read-int file)) (set! (-> obj aspect-custom-y) (file-stream-read-int file)) ) (("aspect-auto") (set! (-> obj aspect-ratio-auto?) (file-stream-read-symbol file))) + (("aspect-game") (set! (-> *setting-control* default aspect-ratio) (file-stream-read-symbol file))) + (("video-mode") (set! (-> *setting-control* default video-mode) (file-stream-read-symbol file))) (("display-mode") (set-display-mode! obj (file-stream-read-symbol file))) - (("aspect-ratio-mode") (set-aspect-ratio-mode! obj (file-stream-read-symbol file))) - (("resolution") (set-resolution! obj (file-stream-read-symbol file))) (("letterbox") (set! (-> obj letterbox?) (file-stream-read-symbol file))) (("vsync") (set! (-> obj vsync?) (file-stream-read-symbol file))) (("font-scale") (set! (-> obj font-scale) (file-stream-read-float file))) @@ -613,29 +777,19 @@ (("subtitles?") (set! (-> obj subtitles?) (file-stream-read-symbol file))) (("hinttitles?") (set! (-> obj hinttitles?) (file-stream-read-symbol file))) (("discord-rpc?") (set! (-> obj discord-rpc?) (file-stream-read-symbol file))) - (("camera-hflip?") (set! (-> obj camera-hflip?) (file-stream-read-symbol file))) - (("camera-vflip?") (set! (-> obj camera-vflip?) (file-stream-read-symbol file))) + (("first-camera-h-inverted?") (set! (-> obj first-camera-h-inverted?) (file-stream-read-symbol file))) + (("first-camera-v-inverted?") (set! (-> obj first-camera-v-inverted?) (file-stream-read-symbol file))) + (("third-camera-h-inverted?") (set! (-> obj third-camera-h-inverted?) (file-stream-read-symbol file))) + (("third-camera-v-inverted?") (set! (-> obj third-camera-v-inverted?) (file-stream-read-symbol file))) (("money-starburst?") (set! (-> obj money-starburst?) (file-stream-read-symbol file))) + (("extra-hud?") (set! (-> obj extra-hud?) (file-stream-read-symbol file))) + (("music-fadein?") (set! (-> obj music-fadein?) (file-stream-read-symbol file))) + (("music-fadeout?") (set! (-> obj music-fadeout?) (file-stream-read-symbol file))) (("scenes-seen") - (dotimes (i 197) + (dotimes (i PC_SPOOL_LOG_LENGTH) (set! (-> obj scenes-seen i) (file-stream-read-int file)) ) ) - (("fixes") - (dosettings (file) - (case-str *pc-temp-string* - (("crash-sagecage") (set! (-> obj fixes crash-sagecage) (file-stream-read-symbol file))) - (("crash-dma") (set! (-> obj fixes crash-dma) (file-stream-read-symbol file))) - (("crash-light-eco") (set! (-> obj fixes crash-light-eco) (file-stream-read-symbol file))) - (("crash-moles") (set! (-> obj fixes crash-moles) (file-stream-read-symbol file))) - (("lockout-pelican") (set! (-> obj fixes lockout-pelican) (file-stream-read-symbol file))) - (("lockout-pipegame") (set! (-> obj fixes lockout-pipegame) (file-stream-read-symbol file))) - (("lockout-gambler") (set! (-> obj fixes lockout-gambler) (file-stream-read-symbol file))) - (("fix-movies") (set! (-> obj fixes fix-movies) (file-stream-read-symbol file))) - (("fix-credits") (set! (-> obj fixes fix-credits) (file-stream-read-symbol file))) - ) - ) - ) (("secrets") (dosettings (file) (case-str *pc-temp-string* @@ -650,8 +804,13 @@ (("hard-rats-hiscore") (set! (-> obj secrets hard-rats-hiscore) (file-stream-read-int file))) (("hard-rats-hiwave") (set! (-> obj secrets hard-rats-hiwave) (file-stream-read-int file))) (("music") - (dotimes (i 30) - (set! (-> obj secrets music i) (file-stream-read-int file)) + (dotimes (i PC_MUSIC_LOG_LENGTH) + (when (!= #x29 (file-stream-get-next-char-ret file)) + (with-settings-scope (file) + (set! (-> obj secrets music i name) (file-stream-read-symbol file)) + (set! (-> obj secrets music i flava-mask) (file-stream-read-int file)) + ) + ) ) ) ) @@ -672,18 +831,6 @@ ) ) - (when (!= PC_KERNEL_VERSION version) - (cond - ((= (logand version #xffffffff00000000) (logand PC_KERNEL_VERSION #xffffffff00000000)) - ;; minor difference - ) - (else - ;; major difference - (format 0 "PC kernel version mismatch! Got ~D.~D vs ~D.~D~%" PC_KERNEL_VERSION_MAJOR PC_KERNEL_VERSION_MINOR (bit-field int version 32 16) (bit-field int version 48 16)) - ) - ) - ) - ) (file-stream-close file) @@ -707,13 +854,14 @@ (format file "(settings #x~X~%" (-> obj version)) (format file " (fps ~D)~%" (-> obj target-fps)) - (format file " (size ~D ~D)~%" (-> obj width) (-> obj height)) - (format file " (use-original-aspect-ratio? ~A)~%" (-> obj use-original-aspect-ratio?)) - (format file " (aspect ~D ~D)~%" (-> obj aspect-custom-x) (-> obj aspect-custom-y)) + (format file " (game-size ~D ~D)~%" (-> obj width) (-> obj height)) + (format file " (window-size ~D ~D)~%" (-> obj win-width) (-> obj win-height)) + (format file " (aspect ~D ~D)~%" (-> obj width) (-> obj height)) + (format file " (aspect-test ~D ~D)~%" (-> obj aspect-custom-x) (-> obj aspect-custom-y)) (format file " (aspect-auto ~A)~%" (-> obj aspect-ratio-auto?)) + (format file " (aspect-game ~A)~%" (-> *setting-control* default aspect-ratio)) + (format file " (video-mode ~A)~%" (-> *setting-control* default video-mode)) (format file " (display-mode ~A)~%" (-> obj display-mode)) - (format file " (aspect-ratio-mode ~A)~%" (-> obj aspect-ratio-mode)) - (format file " (resolution ~A)~%" (-> obj resolution)) (format file " (letterbox ~A)~%" (-> obj letterbox?)) (format file " (vsync ~A)~%" (-> obj vsync?)) (format file " (font-scale ~f)~%" (-> obj font-scale)) @@ -745,37 +893,33 @@ (format file " (use-vis? ~A)~%" (-> obj use-vis?)) (format file " (skip-movies? ~A)~%" (-> obj skip-movies?)) (format file " (discord-rpc? ~A)~%" (-> obj discord-rpc?)) - (format file " (camera-hflip? ~A)~%" (-> obj camera-hflip?)) - (format file " (camera-vflip? ~A)~%" (-> obj camera-vflip?)) + (format file " (first-camera-h-inverted? ~A)~%" (-> obj first-camera-h-inverted?)) + (format file " (first-camera-v-inverted? ~A)~%" (-> obj first-camera-v-inverted?)) + (format file " (third-camera-h-inverted? ~A)~%" (-> obj third-camera-h-inverted?)) + (format file " (third-camera-v-inverted? ~A)~%" (-> obj third-camera-v-inverted?)) (format file " (money-starburst? ~A)~%" (-> obj money-starburst?)) (format file " (force-actors? ~A)~%" (-> obj force-actors?)) + (format file " (extra-hud? ~A)~%" (-> obj extra-hud?)) + (format file " (music-fadein? ~A)~%" (-> obj music-fadein?)) + (format file " (music-fadeout? ~A)~%" (-> obj music-fadeout?)) (format file " (subtitles? ~A)~%" (-> obj subtitles?)) (format file " (hinttitles? ~A)~%" (-> obj hinttitles?)) (format file " (subtitle-language ~D)~%" (-> obj subtitle-language)) (format file " (subtitle-speaker ~A)~%" (-> obj subtitle-speaker?)) + #| (format file " (scenes-seen") - (dotimes (i 197) + (dotimes (i PC_SPOOL_LOG_LENGTH) (if (zero? (mod i 16)) (format file "~% ") ) (format file " ~D" (-> obj scenes-seen i)) ) (format file "~% )~%") - - (format file " (fixes~%") - (format file " (crash-sagecage ~A)~%" (-> obj fixes crash-sagecage)) - (format file " (crash-dma ~A)~%" (-> obj fixes crash-dma)) - (format file " (crash-light-eco ~A)~%" (-> obj fixes crash-light-eco)) - (format file " (crash-moles ~A)~%" (-> obj fixes crash-moles)) - (format file " (lockout-pelican ~A)~%" (-> obj fixes lockout-pelican)) - (format file " (lockout-pipegame ~A)~%" (-> obj fixes lockout-pipegame)) - (format file " (lockout-gambler ~A)~%" (-> obj fixes lockout-gambler)) - (format file " (fix-movies ~A)~%" (-> obj fixes fix-movies)) - (format file " (fix-credits ~A)~%" (-> obj fixes fix-credits)) - (format file " )~%") + |# (format file " (secrets~%") + #| (format file " (art #x~X)~%" (-> obj secrets art)) (format file " (hard-rats? ~A)~%" (-> obj secrets hard-rats?)) (format file " (hero-mode? ~A)~%" (-> obj secrets hero-mode?)) @@ -784,14 +928,17 @@ (format file " (hard-fish-hiscore ~D)~%" (-> obj secrets hard-fish-hiscore)) (format file " (hard-rats-hiscore ~D)~%" (-> obj secrets hard-rats-hiscore)) (format file " (hard-rats-hiwave ~D)~%" (-> obj secrets hard-rats-hiwave)) - (format file " (music") - (dotimes (i 30) - (if (zero? (mod i 1)) - (format file "~% ") - ) - (format file " #x~X" (-> obj secrets music i)) + |# + + (format file " (music~%") + (dotimes (i PC_MUSIC_LOG_LENGTH) + (if (-> obj secrets music i name) + (format file " (~A #x~X)~%" (-> obj secrets music i name) (-> obj secrets music i flava-mask)) + ) ) - (format file "~% )~%") + + (format file " )~%") + (format file " )~%") (format file " )~%") @@ -803,6 +950,18 @@ #t ) +(defmethod load-settings pc-settings ((obj pc-settings)) + "load" + + (format (clear *pc-temp-string-1*) "~S/pc-settings.gc" *pc-settings-folder*) + (if (pc-filepath-exists? *pc-temp-string-1*) + (begin + (format 0 "[PC] PC Settings found at '~S'...loading!~%" *pc-temp-string-1*) + (unless (read-from-file obj *pc-temp-string-1*) + (format 0 "[PC] PC Settings found at '~S' but could not be loaded, using defaults!~%" *pc-temp-string-1*) + (reset obj))) + (format 0 "[PC] PC Settings not found at '~S'...initializing with defaults!~%" *pc-temp-string-1*)) + 0) (defmethod new pc-settings ((allocation symbol) (type-to-make type)) "make a new pc-settings" @@ -810,19 +969,9 @@ (reset obj) ;; auto load settings if available ;; if saved settings are corrupted or not found, use defaults - (clear *pc-temp-string-1*) - (format *pc-temp-string-1* "~S/pc-settings.gc" *pc-settings-folder*) - (if (pc-filepath-exists? *pc-temp-string-1*) - (begin - (format 0 "[PC] PC Settings found at '~S'...loading!~%" *pc-temp-string-1*) - (unless (read-from-file obj *pc-temp-string-1*) - (begin - (format 0 "[PC] PC Settings found at '~S' but could not be loaded, using defaults!~%" *pc-temp-string-1*) - (reset obj)))) - (format 0 "[PC] PC Settings not found at '~S'...initializing with defaults!~%" *pc-temp-string-1*)) + (load-settings obj) - (clear *pc-temp-string-1*) obj)) @@ -898,10 +1047,29 @@ (define *entity-debug-inspect* (new 'debug 'entity-debug-inspect)) -) +) ;; when debug_segment + +(defun-debug draw-build-revision () + (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) + (bucket-id debug-no-zbuf)) + (draw-string-xy *pc-settings-built-sha* + buf + 0 + (* 10 (-> *video-parms* relative-y-scale)) + (font-color flat-yellow) + (font-flags shadow kerning)))) + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; process pools +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +;; the actor pool for PC processes! it has space for 4 processes, with 16K of space. +(defconstant PC_PROC_DEFAULT_STACK_SIZE 1024) +(define *pc-dead-pool* (new 'global 'dead-pool 4 (* 16 1024) '*pc-dead-pool*)) - -) diff --git a/goal_src/pc/progress-pc.gc b/goal_src/pc/progress-pc.gc new file mode 100644 index 0000000000..73450a93e0 --- /dev/null +++ b/goal_src/pc/progress-pc.gc @@ -0,0 +1,2199 @@ +;;-*-Lisp-*- +(in-package goal) + +#| + + Code for the progress menu in the PC port. The original code is still loaded, this just has some overriden functions. + + |# + + +;;--------------------------- +;;--------------------------- +;; pc menu extra stuff + +(defconstant PROGRESS_PC_PAGE_HEIGHT 7) +(defconstant PROGRESS_SCROLL_DIR_UP -1) +(defconstant PROGRESS_SCROLL_DIR_DOWN 1) + +(defconstant GAME_MIN_RES_MULT 0.5) + + +(deftype progress-scroll (structure) + ((transition float) + (start-index int16) + (real-index int16) + (direction int8) + (last-screen progress-screen) + ) + ) +(define *progress-scroll* (new 'static 'progress-scroll)) + +(defmacro progress-scrolling? () `(< (-> *progress-scroll* transition) 1.0)) +(defmacro progress-scrolling-up? () `(and (progress-scrolling?) (= (-> *progress-scroll* direction) PROGRESS_SCROLL_DIR_UP))) +(defmacro progress-scrolling-down? () `(and (progress-scrolling?) (= (-> *progress-scroll* direction) PROGRESS_SCROLL_DIR_DOWN))) +(defconstant *progress-scroll-start* (-> *progress-scroll* start-index)) +(defconstant *progress-scroll-end* (+ -1 PROGRESS_PC_PAGE_HEIGHT (-> *progress-scroll* start-index))) +(defmacro progress-scroll-reset () + "resets scroll. nothing will be scrolling, as if it had finished." + `(begin + (set! (-> *progress-scroll* transition) 1.0) + (set! (-> *progress-scroll* direction) 0) + (set! (-> *progress-scroll* start-index) 0))) +(defmacro progress-scroll-up! () + `(begin + (set! (-> *progress-scroll* transition) 0.0) + (set! (-> *progress-scroll* direction) PROGRESS_SCROLL_DIR_UP) + (1-! (-> *progress-scroll* start-index)))) +(defmacro progress-scroll-down! () + `(begin + (set! (-> *progress-scroll* transition) 0.0) + (set! (-> *progress-scroll* direction) PROGRESS_SCROLL_DIR_DOWN) + (1+! (-> *progress-scroll* start-index)))) + + +;; ############################ +;; CAROUSELL STUFF +;; ############################ + +(deftype progress-carousell-state (structure) + ((int-backup int) + (symbol-backup symbol) + (subtitle-backup pc-subtitle-lang) + (aspect-native-choice symbol) + (current-carousell (array game-text-id)) + + (selection int) + (direction symbol) + (transition symbol) + (x-offset int32) + ) + ) +(define *progress-carousell* (new 'static 'progress-carousell-state)) + + +(defmacro def-progress-carousell (name texts) + `(define ,name (new 'static 'boxed-array :type game-text-id + ,@(apply (lambda (x) `(game-text-id ,x)) texts) + )) + ) + +;; all carousells +(def-progress-carousell *carousell-display-mode* (windowed fullscreen borderless)) +(def-progress-carousell *carousell-msaa* (off 2-times 4-times 8-times 16-times)) +(def-progress-carousell *carousell-lod-bg* (lod-high lod-low)) +(def-progress-carousell *carousell-lod-fg* (lod-high lod-low lod-ps2)) +(def-progress-carousell *carousell-subtitle-language* (english french german spanish italian japanese)) +(def-progress-carousell *carousell-speaker* (speaker-always speaker-never speaker-auto)) +(def-progress-carousell *carousell-frame-rate-150fps* (60fps 100fps 150fps)) +(def-progress-carousell *carousell-frame-rate-100fps* (60fps 100fps)) +(define *carousell-frame-rate* *carousell-frame-rate-150fps*) + + + +;;--------------------------- +;;--------------------------- +;; pc menu defines + + +(define *game-options-pc* (new 'static 'boxed-array :type game-option + ;(new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id camera-options) :scale #t :param3 (game-option-menu camera-options)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id accessibility-options) :scale #t :param3 (game-option-menu accessibility-options)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id misc-options) :scale #t :param3 (game-option-menu misc-options)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *graphic-options-pc* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id game-resolution) :scale #t :param3 (game-option-menu resolution)) + (new 'static 'game-option :option-type (game-option-type display-mode) :name (game-text-id display-mode) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vsync) :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-native) :name (game-text-id ps2-aspect-ratio) :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-ratio) :name (game-text-id aspect-ratio-ps2) :scale #t) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id aspect-ratio) :scale #t :param3 (game-option-menu aspect-ratio)) + ;(new 'static 'game-option :option-type (game-option-type msaa) :name (game-text-id msaa) :scale #t) + (new 'static 'game-option :option-type (game-option-type frame-rate) :name (game-text-id frame-rate) :scale #t) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id ps2-options) :scale #t :param3 (game-option-menu gfx-ps2-options)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *graphic-options-no-frame-rate-pc* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id game-resolution) :scale #t :param3 (game-option-menu resolution)) + (new 'static 'game-option :option-type (game-option-type display-mode) :name (game-text-id display-mode) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vsync) :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-native) :name (game-text-id ps2-aspect-ratio) :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-ratio) :name (game-text-id aspect-ratio-ps2) :scale #t) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id aspect-ratio) :scale #t :param3 (game-option-menu aspect-ratio)) + ;(new 'static 'game-option :option-type (game-option-type msaa) :name (game-text-id msaa) :scale #t) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id ps2-options) :scale #t :param3 (game-option-menu gfx-ps2-options)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *misc-options* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id discord-rpc) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *camera-options* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type normal-inverted) :name (game-text-id camera-controls-first-horz) :scale #t) + (new 'static 'game-option :option-type (game-option-type normal-inverted) :name (game-text-id camera-controls-first-vert) :scale #t) + (new 'static 'game-option :option-type (game-option-type normal-inverted) :name (game-text-id camera-controls-third-horz) :scale #t) + (new 'static 'game-option :option-type (game-option-type normal-inverted) :name (game-text-id camera-controls-third-vert) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id restore-defaults) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *accessibility-options* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id money-starburst) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *gfx-ps2-options* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type lod-bg) :name (game-text-id lod-bg) :scale #t) + (new 'static 'game-option :option-type (game-option-type lod-fg) :name (game-text-id lod-fg) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id ps2-parts) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *aspect-ratio-options* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type aspect-new) :name (game-text-id fit-to-screen) :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-new) :name (game-text-id resolution-fmt) :param1 4.0 :param2 3.0 :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-new) :name (game-text-id resolution-fmt) :param1 16.0 :param2 9.0 :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-new) :name (game-text-id resolution-fmt) :param1 21.0 :param2 9.0 :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-new) :name (game-text-id resolution-fmt) :param1 64.0 :param2 27.0 :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *sound-options-pc* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :name (game-text-id sfx-volume) :scale #t :param2 100.0) + (new 'static 'game-option :name (game-text-id music-volume) :scale #t :param2 100.0) + (new 'static 'game-option :name (game-text-id speech-volume) :scale #t :param2 100.0) + (new 'static 'game-option :option-type (game-option-type language) :name (game-text-id language) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id subtitles) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id hinttitles) :scale #t) + (new 'static 'game-option :option-type (game-option-type language-subtitles) :name (game-text-id subtitles-language) :scale #t) + (new 'static 'game-option :option-type (game-option-type speaker) :name (game-text-id subtitles-speaker) :scale #t) + ;(new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id music-fadein) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *title-pc* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id new-game) :scale #t :param3 (game-option-menu save-game-title)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id load-game) :scale #t :param3 (game-option-menu load-game)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id options) :scale #t :param3 (game-option-menu settings-title)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id secrets) :scale #t :param3 (game-option-menu secrets)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id quit-game) :scale #t :param3 (game-option-menu quit-title)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *secrets-options* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id music-player) :scale #t :param3 (game-option-menu music-player)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *music-player-options* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id village1-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id beach-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id jungle-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id fishgame) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id jungleb-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id misty-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id fire-canyon-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id village2-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id rolling-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id swamp-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id sunken-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id ogre-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id ogreboss) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id village3-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id snowy-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id cave-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id lavatube-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id citadel-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id finalboss-level-name) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id credits) :scale #t) + (new 'static 'game-option :option-type (game-option-type button-music) :name (game-text-id danger-mus) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *music-list* '(village1 beach jungle fishgame jungleb misty firecanyon + village2 rolling swamp sunken ogre ogreboss + village3 snow maincave lavatube + citadel finalboss credits danger)) +(define *progress-music* -1) +(defmacro progress-get-music-by-index (idx) + `(the symbol (ref *music-list* ,idx))) +(defmacro progress-reset-music-parms () + `(begin + (set! *progress-music* -1) + (set! *progress-flava* -1))) + +(defmacro static-text-list-array (&rest texts) + `(new 'static 'boxed-array :type game-text-id + ,@(apply (lambda (x) `(game-text-id ,x)) texts) + ) + ) +(define *music-flava-name-list* (new 'static 'boxed-array :type (array game-text-id) + (static-text-list-array village1-level-name flava-vi1-unused0 flava-sage flava-sage-hut flava-birdlady flava-farmer flava-assistant flava-mayor flava-sculptor flava-explorer flava-dock) + (static-text-list-array beach-level-name flava-bea-sentinel flava-bea-cannon flava-bea-grotto flava-birdlady) + (static-text-list-array jungle-level-name flava-jun-temple-exit flava-jun-lurkerm flava-jun-temple-top) + (static-text-list-array fishgame) + (static-text-list-array jungleb-level-name flava-jub-eggtop flava-jub-plant-boss) + (static-text-list-array misty-level-name flava-mis-battle flava-mis-boat flava-racer flava-mis-unused0) + (static-text-list-array fire-canyon-level-name flava-racer flava-fic-unused0) + (static-text-list-array village2-level-name flava-sage flava-assistant flava-warrior flava-geologist flava-gambler flava-levitator) + (static-text-list-array rolling-level-name flava-rol-gorge) + (static-text-list-array swamp-level-name flava-swa-game flava-swa-launcher flava-swa-battle flava-flutflut) + (static-text-list-array sunken-level-name) + (static-text-list-array ogre-level-name flava-ogr-middle flava-ogr-end) + (static-text-list-array ogreboss) + (static-text-list-array village3-level-name flava-vi3-miners flava-sage flava-assistant flava-vi3-mai flava-vi3-sno) + (static-text-list-array snowy-level-name flava-sno-battle flava-flutflut flava-sno-cave flava-sno-fort flava-sno-balls) + (static-text-list-array cave-level-name flava-mai-rob flava-mai-rob-top flava-mai-mai flava-mai-dar) + (static-text-list-array zero lavatube-level-name flava-lav-middle flava-lav-end) + (static-text-list-array citadel-level-name flava-sage flava-assistant flava-cit-yellowsage flava-cit-redsage flava-cit-bluesage flava-cit-hub) + (static-text-list-array finalboss-level-name flava-fin-middle flava-fin-end) + (static-text-list-array credits flava-credits-middle flava-credits-end) + (static-text-list-array danger-mus) + )) + + +(define-perm *temp-options-alloced* symbol #f) + +(defconstant RESOLUTIONS 6) +(define *resolutions* (new 'static 'array int32 RESOLUTIONS + 640 720 768 800 960 1080)) + +;; this is to avoid changing the value of *temp-options* or reallocating the options when reloading file +(unless *temp-options-alloced* +(define *temp-options* (new 'static 'boxed-array :type game-option :length 200 :allocated-length 200)) +(dotimes (i (-> *temp-options* length)) + (set! (-> *temp-options* i) (new 'global 'game-option))) +(true! *temp-options-alloced*)) + + +(defun find-highest-resolution () + + (let ((sx 0) (sy 0) (found #f) (mult GAME_MIN_RES_MULT) (lastr 0) (hir 0) (lor 0)) + (pc-get-screen-size -1 (the (pointer int32) (& sx)) (the (pointer int32) (& sy))) + (if (> sy sx) + (set! sy sx)) + + (until found + + (dotimes (i RESOLUTIONS) + (let ((thisr (the int (* mult (the float (-> *resolutions* i)))))) + (cond + ((< sy thisr) + (if (zero? i) + (*! mult 0.5)) + (set! i RESOLUTIONS) + (true! found) + ) + (else + (set! lastr thisr)) + ) + )) + + (if (not found) + (*! mult 2)) + + ) + (set! hir lastr) + mult + ) + + ) + +(defmacro add-resolution-option (x y) + "add a resolution button to *temp-options* with specified size" + `(let ((option (-> *temp-options* (length *temp-options*)))) + (set! (-> option option-type) (game-option-type resolution)) + (set! (-> option name) (game-text-id resolution-fmt)) + (set! (-> option param1) (the float ,x)) + (set! (-> option param2) (the float ,y)) + (set! (-> option scale) #t) + + (1+! (-> *temp-options* length)) + ) + ) + +(defmacro add-flava-player-option (text-id flava) + "add a resolution button to *temp-options* with specified size" + `(let ((option (-> *temp-options* (length *temp-options*)))) + (set! (-> option option-type) (game-option-type button-flava)) + (set! (-> option name) ,text-id) + (set! (-> option param1) (the float ,flava)) + (set! (-> option scale) #t) + + (1+! (-> *temp-options* length)) + ) + ) + +(defmacro add-back-option () + "add *back-button* to *temp-options*" + `(let ((option (-> *temp-options* (length *temp-options*)))) + (set! (-> option option-type) (game-option-type button)) + (set! (-> option name) (game-text-id back)) + (set! (-> option scale) #t) + + (1+! (-> *temp-options* length)) + ) + ) + +(defun build-resolution-options ((skip int) (amount int)) + + (set! (-> *temp-options* length) 0) + + (let ((done? #f) (mult (find-highest-resolution)) (sx 0) (sy 0) (flip? #f) (aspect 0.0) + ;; hack - do not use screen resolution in windowed mode, taskbar etc. messes it up and makes it useless! + (skip? (= 'windowed (pc-get-fullscreen))) + ;; shortcut + (max-options (1- (-> *temp-options* allocated-length)))) + + ;; get screen size (for capping) + (pc-get-screen-size -1 (the (pointer int32) (& sx)) (the (pointer int32) (& sy))) + ;; portrait mode. unused + (set! flip? (> sy sx)) + + (case (pc-get-fullscreen) + (('fullscreen) + ;; insert psyched out trollface here + (set! sx 0) + (set! sy 0) + (countdown (i (pc-get-screen-vmode-count)) + (let ((thisx 0) (thisy 0)) + (pc-get-screen-size i (the (pointer int32) (& thisx)) (the (pointer int32) (& thisy))) + + (when (not (and (= thisx sx) (= thisy sy))) + (add-resolution-option thisx thisy) + ) + (set! sx thisx) + (set! sy thisy) + ) + ) + ) + + (else + ;; extra button when fullscreen + (when (not skip?) + (add-resolution-option sx sy) + (set! (-> *temp-options* (1- (length *temp-options*)) name) (game-text-id fit-to-screen)) + ) + ;; game aspect ratio + (set! aspect (-> *pc-settings* aspect-ratio)) + + (until (or done? (= (length *temp-options*) max-options)) + (countdown (i RESOLUTIONS) + (let* ((thisr (the int (* mult (the float (-> *resolutions* i))))) + (thisx (the int (* aspect (the float thisr)))) + (thisy thisr) + ) + + (when (and (not skip?) (< (length *temp-options*) max-options) + (<= thisy sy) (<= thisx sx) + (= aspect (/ (the float thisx) (the float thisy))) + (>= thisx PC_MIN_WIDTH) (>= thisy PC_MIN_HEIGHT)) + (add-resolution-option thisx thisy) + )) + (false! skip?) + ) + + (if (> mult GAME_MIN_RES_MULT) + (*! mult 0.5) + (true! done?)) + ) + ) + ) + (add-back-option) + ) + + + *temp-options* + ) + +(defun build-flava-player-options ((mus-idx int)) + + (set! (-> *temp-options* length) 0) + + (dotimes (i (-> *music-flava-name-list* mus-idx length)) + (if (nonzero? (-> *music-flava-name-list* mus-idx i)) + (add-flava-player-option (-> *music-flava-name-list* mus-idx i) i) + ) + ) + (add-back-option) + + *temp-options* + ) + + +(defun print-string-in-carousell ((arg0 game-text-id) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((s5-0 (if arg3 + arg2 + (- arg2) + ) + ) + ) + (+! (-> arg1 origin x) (the float s5-0)) + (let ((f30-0 (- 1.0 (* 0.0033333334 (the float arg2))))) + (print-game-text-scaled (lookup-text! *common-text* arg0 #f) f30-0 arg1 (the int (* 128.0 f30-0))) + ) + (set! (-> arg1 origin x) (- (-> arg1 origin x) (the float s5-0))) + ) + (set! (-> arg1 color) (font-color default)) + arg1 + ) + +(defun progress-draw-carousell-from-string-list ((options (array game-text-id)) (font font-context) (y-off int) (new-val int)) + "yep." + + (let ((old-lang (-> *progress-carousell* selection)) + (new-lang new-val) + (max-lang (length options)) + ) + (if (-> *progress-carousell* transition) + (seekl! (-> *progress-carousell* x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio))))) + (when (>= (-> *progress-carousell* x-offset) 100) + (set! (-> *progress-carousell* selection) new-lang) + (set! old-lang new-lang) + (set! (-> *progress-carousell* transition) #f) + (set! (-> *progress-carousell* x-offset) 0) + ) + (set! (-> font origin y) (the float (+ y-off 3))) + (set-color! font (font-color lighter-lighter-blue)) + 0 + (let ((next-lang (mod (+ old-lang 1) max-lang)) + (prev-lang (mod (+ max-lang -1 old-lang) max-lang)) + ;; these are used during the transition since it technically allows you to see 4 langs at once. + (next2-lang (mod (+ old-lang 2) max-lang)) + (prev2-lang (mod (+ max-lang -2 old-lang) max-lang)) + ) + (cond + ((-> *progress-carousell* direction) + (let ((a2-22 (- 200 (+ (-> *progress-carousell* x-offset) 100)))) + (print-string-in-carousell (-> options prev-lang) font a2-22 #f) + ) + (set-color! font (font-color lighter-lighter-blue)) + (let ((a2-23 (+ (-> *progress-carousell* x-offset) 100))) + (cond + ((< a2-23 150) + (print-string-in-carousell (-> options next-lang) font a2-23 #t) + ) + (else + (let ((a2-24 (- 200 (-> *progress-carousell* x-offset)))) + (print-string-in-carousell (-> options prev2-lang) font a2-24 #f) + ) + ) + ) + ) + ) + (else + (let ((a2-25 (+ (-> *progress-carousell* x-offset) 100))) + (cond + ((< a2-25 150) + (print-string-in-carousell (-> options prev-lang) font a2-25 #f) + ) + (else + (let ((a2-26 (- 200 (-> *progress-carousell* x-offset)))) + (print-string-in-carousell (-> options next2-lang) font a2-26 #t) + ) + ) + ) + ) + (set-color! font (font-color lighter-lighter-blue)) + (let ((a2-27 (- 200 (+ (-> *progress-carousell* x-offset) 100)))) + (print-string-in-carousell (-> options next-lang) font a2-27 #t) + ) + ) + ) + ) + (if (not (-> *progress-carousell* transition)) + (set-color! font (font-color yellow-green-2))) + (print-string-in-carousell (-> options old-lang) font (-> *progress-carousell* x-offset) (-> *progress-carousell* direction)) + ) + ) + +;;--------------------------- +;;--------------------------- +;; function overrides + +(defun init-game-options ((obj progress)) + "Set the options for all of the menus." + + ;; start off by making them all invalid + (dotimes (i (progress-screen max)) + (set! (-> *options-remap* i) #f) + ) + + ;; set up options for each screen + (set! (-> *options-remap* (progress-screen settings)) *main-options*) + (set! (-> *options-remap* (progress-screen game-settings)) *game-options-pc*) + (let ((max-refresh-rate (pc-get-screen-rate -1))) + (cond + ((or *debug-segment* (> max-refresh-rate 100)) + (set! (-> *options-remap* (progress-screen graphic-settings)) *graphic-options-pc*) + (set! *carousell-frame-rate* *carousell-frame-rate-150fps*) + ) + ((> max-refresh-rate 60) + (set! (-> *options-remap* (progress-screen graphic-settings)) *graphic-options-pc*) + (set! *carousell-frame-rate* *carousell-frame-rate-100fps*) + ) + (else + (set! (-> *options-remap* (progress-screen graphic-settings)) *graphic-options-no-frame-rate-pc*) + ) + )) + + (set! (-> *options-remap* (progress-screen sound-settings)) *sound-options-pc*) + (set! (-> *options-remap* (progress-screen memcard-no-space)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-not-inserted)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-not-formatted)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-format)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen memcard-data-exists)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen memcard-insert)) *ok-options*) + (set! (-> *options-remap* (progress-screen load-game)) *load-options*) + (set! (-> *options-remap* (progress-screen save-game)) *save-options*) + (set! (-> *options-remap* (progress-screen save-game-title)) *save-options-title*) + (set! (-> *options-remap* (progress-screen memcard-error-loading)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-error-saving)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-error-formatting)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-error-creating)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-auto-save-error)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-removed)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-no-data)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen title)) *title-pc*) + (set! (-> *options-remap* (progress-screen settings-title)) *options*) + (set! (-> *options-remap* (progress-screen auto-save)) *ok-options*) + (set! (-> *options-remap* (progress-screen pal-change-to-60hz)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen pal-now-60hz)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen no-disc)) *ok-options*) + (set! (-> *options-remap* (progress-screen bad-disc)) *ok-options*) + (set! (-> *options-remap* (progress-screen quit)) *yes-no-options*) + ;; our screens! + (set! (-> *options-remap* (progress-screen aspect-msg)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen camera-options)) *camera-options*) + (set! (-> *options-remap* (progress-screen misc-options)) *misc-options*) + (set! (-> *options-remap* (progress-screen accessibility-options)) *accessibility-options*) + (set! (-> *options-remap* (progress-screen gfx-ps2-options)) *gfx-ps2-options*) + (set! (-> *options-remap* (progress-screen resolution)) *temp-options*) + (set! (-> *options-remap* (progress-screen aspect-ratio)) *aspect-ratio-options*) + (set! (-> *options-remap* (progress-screen quit-title)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen secrets)) *secrets-options*) + (set! (-> *options-remap* (progress-screen music-player)) *music-player-options*) + (set! (-> *options-remap* (progress-screen flava-player)) *temp-options*) + + ;; set default params + (set! (-> *progress-state* aspect-ratio-choice) (get-aspect-ratio)) + (set! (-> *progress-state* video-mode-choice) (get-video-mode)) + (set! (-> *progress-state* yes-no-choice) #f) + + ;; set variable pointers + (set! (-> *game-options* 0 value-to-modify) (&-> *setting-control* default vibration)) + (set! (-> *game-options* 1 value-to-modify) (&-> *setting-control* default play-hints)) + (set! (-> *game-options* 2 value-to-modify) (&-> *setting-control* default language)) + (set! (-> *game-options-japan* 0 value-to-modify) (&-> *setting-control* default vibration)) + (set! (-> *game-options-japan* 1 value-to-modify) (&-> *setting-control* default play-hints)) + (set! (-> *game-options-demo* 0 value-to-modify) (&-> *setting-control* default vibration)) + (set! (-> *game-options-demo* 1 value-to-modify) (&-> *setting-control* default play-hints)) + (set! (-> *graphic-options* 1 value-to-modify) (&-> *progress-state* aspect-ratio-choice)) + (set! (-> *sound-options* 0 value-to-modify) (&-> *setting-control* default sfx-volume)) + (set! (-> *sound-options* 1 value-to-modify) (&-> *setting-control* default music-volume)) + (set! (-> *sound-options* 2 value-to-modify) (&-> *setting-control* default dialog-volume)) + (set! (-> *yes-no-options* 0 value-to-modify) (&-> *progress-state* yes-no-choice)) + ;; our options! + ;(set! (-> *game-options-pc* 0 value-to-modify) (&-> *setting-control* default vibration)) + (set! (-> *game-options-pc* 0 value-to-modify) (&-> *setting-control* default play-hints)) + (set! (-> *graphic-options-pc* 1 value-to-modify) (&-> *progress-carousell* int-backup)) + (set! (-> *graphic-options-pc* 2 value-to-modify) (&-> *pc-settings* vsync?)) + (set! (-> *graphic-options-pc* 3 value-to-modify) (&-> *progress-carousell* aspect-native-choice)) + (set! (-> *graphic-options-pc* 4 value-to-modify) (&-> *progress-state* aspect-ratio-choice)) + ;(set! (-> *graphic-options-pc* 6 value-to-modify) (&-> *progress-carousell* int-backup)) + (set! (-> *graphic-options-pc* 6 value-to-modify) (&-> *progress-carousell* int-backup)) + (set! (-> *graphic-options-no-frame-rate-pc* 1 value-to-modify) (&-> *progress-carousell* int-backup)) + (set! (-> *graphic-options-no-frame-rate-pc* 2 value-to-modify) (&-> *pc-settings* vsync?)) + (set! (-> *graphic-options-no-frame-rate-pc* 3 value-to-modify) (&-> *progress-carousell* aspect-native-choice)) + (set! (-> *graphic-options-no-frame-rate-pc* 4 value-to-modify) (&-> *progress-state* aspect-ratio-choice)) + ;(set! (-> *graphic-options-pc* 6 value-to-modify) (&-> *progress-carousell* int-backup)) + (set! (-> *misc-options* 0 value-to-modify) (&-> *pc-settings* discord-rpc?)) + (set! (-> *camera-options* 0 value-to-modify) (&-> *pc-settings* first-camera-h-inverted?)) + (set! (-> *camera-options* 1 value-to-modify) (&-> *pc-settings* first-camera-v-inverted?)) + (set! (-> *camera-options* 2 value-to-modify) (&-> *pc-settings* third-camera-h-inverted?)) + (set! (-> *camera-options* 3 value-to-modify) (&-> *pc-settings* third-camera-v-inverted?)) + (set! (-> *accessibility-options* 0 value-to-modify) (&-> *pc-settings* money-starburst?)) + (set! (-> *gfx-ps2-options* 0 value-to-modify) (&-> *progress-carousell* int-backup)) + (set! (-> *gfx-ps2-options* 1 value-to-modify) (&-> *progress-carousell* int-backup)) + (set! (-> *gfx-ps2-options* 2 value-to-modify) (&-> *pc-settings* ps2-parts?)) + (set! (-> *sound-options-pc* 0 value-to-modify) (&-> *setting-control* default sfx-volume)) + (set! (-> *sound-options-pc* 1 value-to-modify) (&-> *setting-control* default music-volume)) + (set! (-> *sound-options-pc* 2 value-to-modify) (&-> *setting-control* default dialog-volume)) + (set! (-> *sound-options-pc* 3 value-to-modify) (&-> *setting-control* default language)) + (set! (-> *sound-options-pc* 4 value-to-modify) (&-> *pc-settings* subtitles?)) + (set! (-> *sound-options-pc* 5 value-to-modify) (&-> *pc-settings* hinttitles?)) + (set! (-> *sound-options-pc* 6 value-to-modify) (&-> *progress-carousell* subtitle-backup)) + (set! (-> *sound-options-pc* 7 value-to-modify) (&-> *progress-carousell* int-backup)) + ;(set! (-> *sound-options-pc* 8 value-to-modify) (&-> *pc-settings* music-fadein?)) + (set! (-> *progress-carousell* aspect-native-choice) (-> *pc-settings* use-vis?)) + + ;; scroll stuff! + (progress-scroll-reset) + (none) + ) + + + +(defmethod respond-common progress ((obj progress)) + "common logic for navigating the progress menu. + this is the overriden version, purged of no longer necessary code and with additional new code." + + ;; read memcard + (mc-get-slot-info 0 *progress-save-info*) + (set! (-> obj card-info) *progress-save-info*) + ;; build custom dynamic menus + (case (-> obj display-state) + (((progress-screen resolution)) + ;; TODO infinite scrolling + (build-resolution-options 0 0) + ) + (((progress-screen flava-player)) + (build-flava-player-options *progress-music*) + ) + ) + ;; run nav code + (let ((options (-> *options-remap* (-> obj display-state)))) + ;; snap scroll if oob + (when (> (length options) PROGRESS_PC_PAGE_HEIGHT) + (set! (-> *progress-scroll* start-index) (max (-> *progress-scroll* start-index) + (- (-> obj option-index) (+ PROGRESS_PC_PAGE_HEIGHT -2)))) + ) + (when (and options (not (or (progress-scrolling?) (-> obj in-transition)))) + ;; only respond to inputs when transition is done (and also there's options at all) + (cond + ((cpad-pressed? 0 up) + ;; pressed up + ;; original code checked hold and then press, because hold can be used during center screen option. which we don't use. + (when (not (-> obj selected-option)) + (if (!= (length options) 1) + (sound-play "cursor-up-down") + ) + (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) + (cond + ((> (-> obj option-index) 0) + (1-! (-> obj option-index)) + (when (and (> (length options) PROGRESS_PC_PAGE_HEIGHT) (< (-> obj option-index) *progress-scroll-start*)) + (progress-scroll-up!) + ) + ) + (else + (set! (-> obj option-index) (1- (length options))) + (set! (-> *progress-scroll* start-index) (max 0 (- (length options) PROGRESS_PC_PAGE_HEIGHT -1))) + ) + ) + ) + ) + ((cpad-pressed? 0 down) + ;; pressed down. + (when (not (-> obj selected-option)) + (if (!= (length options) 1) + (sound-play "cursor-up-down") + ) + (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) + (cond + ((< (-> obj option-index) (1- (length options))) + (1+! (-> obj option-index)) + (when (and (> (length options) PROGRESS_PC_PAGE_HEIGHT) (>= (-> obj option-index) *progress-scroll-end*)) + (progress-scroll-down!) + ) + ) + (else + (set! (-> obj option-index) 0) + (set! (-> *progress-scroll* start-index) 0) + ) + ) + ) + ) + ((cpad-hold? 0 left) + ;; holding left. sliders use hold. + (cond + ((cpad-pressed? 0 left) + ;; navigate left. + (when (or (-> obj selected-option) (= (-> options (-> obj option-index) option-type) (game-option-type yes-no))) + (let ((sound? #f)) + (case (-> options (-> obj option-index) option-type) + (((game-option-type on-off) + (game-option-type yes-no) + (game-option-type normal-inverted) + (game-option-type aspect-native)) + ;; pressed left on an on/off yes/no option + (when (not (-> (the-as (pointer uint32) (-> options (-> obj option-index) value-to-modify)))) + ;; it was on 'off' or 'no' + (set! sound? #t) + ;; vibrate if this toggles vibration. broken in original game. + (if (= (-> options (-> obj option-index) value-to-modify) (&-> *setting-control* default vibration)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) + ) + ) + ;; it's on 'on' or 'yes' now + (set! (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) #t) + ) + (((game-option-type aspect-ratio)) + (set! sound? (= (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) 'aspect16x9)) + (set! (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) 'aspect4x3) + ) + (((game-option-type language)) + ;; language selection. if not on first language, go back. if on first language, go to last. + (if (> (the-as int (-> (the-as (pointer uint64) (-> options (-> obj option-index) value-to-modify)))) 0) + (+! (-> (the-as (pointer uint64) (-> options (-> obj option-index) value-to-modify))) -1) + (set! (-> (the-as (pointer int64) (-> options (-> obj option-index) value-to-modify))) 5) + ) + ;; language was updated. + (set! (-> obj language-transition) #t) + (set! (-> obj language-direction) #t) + (set! sound? #t) + ) + (((game-option-type display-mode) + (game-option-type msaa) + (game-option-type lod-bg) + (game-option-type lod-fg) + (game-option-type speaker) + (game-option-type frame-rate) + ) + ;; a carousell like language + (if (> (-> (the-as (pointer int) (-> options (-> obj option-index) value-to-modify))) 0) + (+! (-> (the-as (pointer int) (-> options (-> obj option-index) value-to-modify))) -1) + (set! (-> (the-as (pointer int) (-> options (-> obj option-index) value-to-modify))) (1- (length (-> *progress-carousell* current-carousell)))) + ) + ;; updated. + (set! (-> *progress-carousell* transition) #t) + (set! (-> *progress-carousell* direction) #t) + (set! sound? #t) + ) + (((game-option-type language-subtitles)) + ;; a carousell like language + (if (> (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (the-as pc-subtitle-lang 0)) + (+! (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (the-as pc-subtitle-lang -1)) + (set! (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (the-as pc-subtitle-lang (1- (length (-> *progress-carousell* current-carousell))))) + ) + ;; updated. + (set! (-> *progress-carousell* transition) #t) + (set! (-> *progress-carousell* direction) #t) + (set! sound? #t) + ) + ) + (if sound? + (sound-play "cursor-l-r") + ) + ) + ) + ) + (else + ;; holding left + (when (-> obj selected-option) + (let ((sound? #f)) + (case (-> options (-> obj option-index) option-type) + (((game-option-type slider)) + ;; slider is selected + (cond + ((>= (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))) + (+ 1.0 (-> options (-> obj option-index) param1))) + ;; we're 1 above minimum, so reduce by 1 + (set! (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))) + (+ -1.0 (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))))) + (set! sound? #t) + ) + ((< (-> options (-> obj option-index) param1) + ;; not at least 1 above minimum, just set to minimum (why not just use max or something!!) + (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify)))) + (set! (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))) + (-> options (-> obj option-index) param1)) + (set! sound? #t) + ) + ) + ) + ) + ;; play sound + (when sound? + (let ((vol 100.0)) + (case (-> options (-> obj option-index) name) + (((game-text-id music-volume) (game-text-id speech-volume)) + (set! vol (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify)))) + ) + ) + (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) + (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) + (sound-play "slider2001" :vol vol) + ) + ) + ) + ) + ) + ) + ) + ) + ((cpad-hold? 0 right) + ;; holding right + (cond + ((cpad-pressed? 0 right) + ;; pressed right + (when (or (-> obj selected-option) (= (-> options (-> obj option-index) option-type) (game-option-type yes-no))) + (let ((sound? #f)) + (case (-> options (-> obj option-index) option-type) + (((game-option-type on-off) + (game-option-type yes-no) + (game-option-type normal-inverted) + (game-option-type aspect-native) + ) + ;; play sound if it was on 'yes' because we're going to 'no' now + (set! sound? (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify)))) + ;; set to no + (set! (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) #f) + ) + (((game-option-type aspect-ratio)) + ;; same shit different toilet + (set! sound? (= (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) 'aspect4x3)) + (set! (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) 'aspect16x9) + ) + (((game-option-type language)) + ;; same thing as before. if at last, go to first. otherwise, keep going forward. + (if (< (the-as int (-> (the-as (pointer uint64) (-> options (-> obj option-index) value-to-modify)))) 5) + (1+! (-> (the-as (pointer uint64) (-> options (-> obj option-index) value-to-modify)))) + (set! (-> (the-as (pointer int64) (-> options (-> obj option-index) value-to-modify))) 0) + ) + (set! (-> obj language-transition) #t) + (set! (-> obj language-direction) #f) + (set! sound? #t) + ) + (((game-option-type display-mode) + (game-option-type msaa) + (game-option-type lod-bg) + (game-option-type lod-fg) + (game-option-type speaker) + (game-option-type frame-rate) + ) + ;; same thing as before. if at last, go to first. otherwise, keep going forward. + (if (< (-> (the-as (pointer int) (-> options (-> obj option-index) value-to-modify))) (1- (length (-> *progress-carousell* current-carousell)))) + (1+! (-> (the-as (pointer int) (-> options (-> obj option-index) value-to-modify)))) + (set! (-> (the-as (pointer int) (-> options (-> obj option-index) value-to-modify))) 0) + ) + (set! (-> *progress-carousell* transition) #t) + (set! (-> *progress-carousell* direction) #f) + (set! sound? #t) + ) + (((game-option-type language-subtitles)) + ;; same thing as before. if at last, go to first. otherwise, keep going forward. + (if (< (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (1- (length (-> *progress-carousell* current-carousell)))) + (+! (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (the-as pc-subtitle-lang 1)) + (set! (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (the-as pc-subtitle-lang 0)) + ) + (set! (-> *progress-carousell* transition) #t) + (set! (-> *progress-carousell* direction) #f) + (set! sound? #t) + ) + ) + ;; play sound if desired + (if sound? + (sound-play "cursor-l-r") + ) + ) + ) + ) + (else + ;; holding right, but didnt just press it. same slider stuff as before + (when (-> obj selected-option) + (let ((sound? #f)) + (case (-> options (-> obj option-index) option-type) + (((game-option-type slider)) + (cond + ((>= (+ -1.0 (-> options (-> obj option-index) param2)) + (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify)))) + (set! (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))) + (+ 1.0 (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))))) + (set! sound? #t) + ) + ((< (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))) + (-> options (-> obj option-index) param2)) + (set! (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))) + (-> options (-> obj option-index) param2)) + (set! sound? #t) + ) + ) + ) + ) + (when sound? + (let ((vol 100.0)) + (case (-> options (-> obj option-index) name) + (((game-text-id music-volume) (game-text-id speech-volume)) + (set! vol (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify)))) + ) + ) + (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) + (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) + (sound-play "slider2001" :vol vol) + ) + ) + ) + ) + ) + ) + ) + ) + ((or (cpad-pressed? 0 square) (cpad-pressed? 0 triangle)) + ;; pressed square or triangle, cancel out! + (cond + ((-> obj selected-option) + ;; an option is selected. AHHH!!! just restore to whatever was on the backup + (case (-> options (-> obj option-index) option-type) + (((game-option-type slider)) + (set! (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))) + (-> *progress-state* slider-backup)) + ) + (((game-option-type language)) + (set! (-> (the-as (pointer language-enum) (-> options (-> obj option-index) value-to-modify))) + (-> *progress-state* language-backup)) + ) + (((game-option-type on-off) (game-option-type normal-inverted)) + (set! (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) + (-> *progress-state* on-off-backup)) + ) + ) + ;; ding + (sound-play "cursor-options") + (set! (-> obj selected-option) #f) + ) + ((or (can-go-back? obj) + (= (-> obj display-state) (progress-screen load-game)) + (= (-> obj display-state) (progress-screen save-game)) + (= (-> obj display-state) (progress-screen save-game-title)) + ) + ;; no option selected, go back + (cpad-clear! 0 square) + (cpad-clear! 0 triangle) + (if (= (-> obj display-state) (progress-screen settings)) + (sound-play "menu-stats") + (sound-play "cursor-options") + ) + (when (= (-> obj display-state) (progress-screen music-player)) + (sound-group-pause (sound-group music)) + (progress-reset-music-parms)) + (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ) + ) + ((or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) + ;; pressed x or circle. advance! + (cond + ((not (-> obj selected-option)) + ;; no option already selected. + (cond + ((= (-> options (-> obj option-index) option-type) (game-option-type menu)) + ;; go to a menu + (cpad-clear! 0 x) + (cpad-clear! 0 circle) + (push! obj) + (sound-play "select-option") + (set! (-> obj next-display-state) (the-as progress-screen (-> options (-> obj option-index) param3))) + (case (-> obj next-display-state) + (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) + (set! (-> obj next-display-state) (set-memcard-screen obj (-> obj next-display-state))) + ) + ) + ) + ((= (-> options (-> obj option-index) option-type) (game-option-type button-music)) + ;; go to the music+flava player + (when (find-music-log (progress-get-music-by-index (-> obj option-index))) + (cpad-clear! 0 x) + (cpad-clear! 0 circle) + (set! *progress-music* (-> obj option-index)) + (push! obj) + (sound-play "select-option") + (set! (-> obj next-display-state) (progress-screen flava-player)) + ) + ) + ((= (-> options (-> obj option-index) option-type) (game-option-type button-flava)) + ;; set flava + (when (find-flava-log (progress-get-music-by-index *progress-music*) (the int (-> options (-> obj option-index) param1))) + (cpad-clear! 0 x) + (cpad-clear! 0 circle) + (set-setting *setting-control* obj 'music (progress-get-music-by-index *progress-music*) 0.0 0) + (set! *progress-flava* (the int (-> options (-> obj option-index) param1))) + (sound-group-continue (sound-group music)) + (sound-play "select-option") + ) + ) + ((= (-> options (-> obj option-index) option-type) (game-option-type button)) + ;; a button. what? + (case (-> options (-> obj option-index) name) + (((game-text-id exit-demo)) + ;; exit demo! + (set! *master-exit* 'force) + (set-master-mode 'game) + ) + (((game-text-id back)) + ;; go back! + (if (= (-> obj display-state) (progress-screen settings)) + (sound-play "menu-stats") + (sound-play "cursor-options") + ) + (when (= (-> obj display-state) (progress-screen music-player)) + (sound-group-pause (sound-group music)) + (progress-reset-music-parms)) + (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + (((game-text-id restore-defaults)) + ;; restore default camera controls + (reset-original-camera *pc-settings*) + (sound-play "cursor-options") + ) + ) + ;; other behaviors are hardcoded elsewhere because screw you. + ) + ((= (-> options (-> obj option-index) option-type) (game-option-type resolution)) + ;; resolution button. change resolution! + (let ((newx (the int (-> options (-> obj option-index) param1))) + (newy (the int (-> options (-> obj option-index) param2)))) + (set-size! *pc-settings* newx newy)) + (cpad-clear! 0 x) + (cpad-clear! 0 circle) + (cpad-clear! 0 square) + (cpad-clear! 0 triangle) + (sound-play "cursor-options") + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ((= (-> options (-> obj option-index) option-type) (game-option-type aspect-new)) + ;; aspect ratio button. + (let ((newx (the int (-> options (-> obj option-index) param1))) + (newy (the int (-> options (-> obj option-index) param2)))) + (if (= (-> options (-> obj option-index) name) (game-text-id fit-to-screen)) + (true! (-> *pc-settings* aspect-ratio-auto?)) + (set-aspect! *pc-settings* newx newy))) + (cpad-clear! 0 x) + (cpad-clear! 0 circle) + (cpad-clear! 0 square) + (cpad-clear! 0 triangle) + (sound-play "cursor-options") + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ((!= (-> options (-> obj option-index) option-type) (game-option-type yes-no)) + ;; not yes-no + ;; set backups! we're entering some toggle or whatever + (case (-> options (-> obj option-index) option-type) + (((game-option-type slider)) + (set! (-> *progress-state* slider-backup) + (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify)))) + ) + (((game-option-type language)) + (set! (-> *progress-state* language-backup) + (-> (the-as (pointer language-enum) (-> options (-> obj option-index) value-to-modify)))) + ) + (((game-option-type language-subtitles)) + (set! (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (-> *pc-settings* subtitle-language)) + ) + (((game-option-type on-off) (game-option-type normal-inverted)) + (set! (-> *progress-state* on-off-backup) + (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify)))) + ) + (((game-option-type display-mode)) + ;; display-mode just reuses language stuff + (case (pc-get-fullscreen) + (('windowed #f) (set! (-> *progress-carousell* int-backup) 0)) + (('fullscreen #t) (set! (-> *progress-carousell* int-backup) 1)) + (('borderless) (set! (-> *progress-carousell* int-backup) 2)) + ) + ) + (((game-option-type msaa)) + (case (-> *pc-settings* gfx-msaa) + ((2) (set! (-> *progress-carousell* int-backup) 1)) + ((4) (set! (-> *progress-carousell* int-backup) 2)) + ((8) (set! (-> *progress-carousell* int-backup) 3)) + ((16) (set! (-> *progress-carousell* int-backup) 4)) + (else (set! (-> *progress-carousell* int-backup) 0)) + ) + ) + (((game-option-type lod-bg)) + (case (-> *pc-settings* lod-force-tfrag) + ((0) (set! (-> *progress-carousell* int-backup) 0)) + ((1 2) (set! (-> *progress-carousell* int-backup) 1)) + (else (set! (-> *progress-carousell* int-backup) 2)) + ) + ) + (((game-option-type lod-fg)) + (cond + ((-> *pc-settings* ps2-lod-dist?) (set! (-> *progress-carousell* int-backup) 1)) + (else (set! (-> *progress-carousell* int-backup) 0)) + ) + ) + (((game-option-type speaker)) + (case (-> *pc-settings* subtitle-speaker?) + ((#t) (set! (-> *progress-carousell* int-backup) 0)) + ((#f) (set! (-> *progress-carousell* int-backup) 1)) + (('auto) (set! (-> *progress-carousell* int-backup) 2)) + ) + ) + (((game-option-type frame-rate)) + (case (-> *setting-control* default video-mode) + (('ntsc 'pal) (set! (-> *progress-carousell* int-backup) 0)) + (('100fps) (set! (-> *progress-carousell* int-backup) 1)) + (('150fps) (set! (-> *progress-carousell* int-backup) 2)) + ) + ) + ) + (sound-play "select-option") + (cpad-clear! 0 x) + (cpad-clear! 0 circle) + (set! (-> obj selected-option) #t) + (case (-> options (-> obj option-index) option-type) + (((game-option-type language)) + (set! (-> obj language-selection) (-> *setting-control* current language)) + (set! (-> obj language-direction) #t) + (set! (-> obj language-transition) #f) + (set! (-> obj language-x-offset) 0) + ) + (else + (set! (-> *progress-carousell* selection) (-> *progress-carousell* int-backup)) + (set! (-> *progress-carousell* direction) #t) + (set! (-> *progress-carousell* transition) #f) + (set! (-> *progress-carousell* x-offset) 0) + (case (-> options (-> obj option-index) option-type) + (((game-option-type display-mode)) (set! (-> *progress-carousell* current-carousell) *carousell-display-mode*)) + (((game-option-type msaa)) (set! (-> *progress-carousell* current-carousell) *carousell-msaa*)) + (((game-option-type lod-bg)) (set! (-> *progress-carousell* current-carousell) *carousell-lod-bg*)) + (((game-option-type lod-fg)) (set! (-> *progress-carousell* current-carousell) *carousell-lod-bg*)) + (((game-option-type speaker)) (set! (-> *progress-carousell* current-carousell) *carousell-speaker*)) + (((game-option-type frame-rate)) (set! (-> *progress-carousell* current-carousell) *carousell-frame-rate*)) + (((game-option-type language-subtitles)) + (set! (-> *progress-carousell* current-carousell) *carousell-subtitle-language*) + (set! (-> *progress-carousell* selection) (the int (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))))) + ) + ) + ) + ) + ) + ) + ) + (else + ;; an option was selected. write stuff! + (sound-play "start-options") + (set! (-> obj selected-option) #f) + (case (-> options (-> obj option-index) option-type) + (((game-option-type aspect-ratio)) + ;; aspect ratio is first written to the backup. so this is for applying the change if we went through with it. + (set! (-> *setting-control* default aspect-ratio) (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify)))) + ) + (((game-option-type aspect-native)) + (set! (-> *pc-settings* use-vis?) (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify)))) + (if (-> *pc-settings* use-vis?) + (set! (-> *setting-control* current aspect-ratio) #f) + (set-aspect! *pc-settings* (-> *pc-settings* aspect-custom-x) (-> *pc-settings* aspect-custom-y))) + ) + (((game-option-type display-mode)) + ;; same thing. + (case (-> *progress-carousell* int-backup) + ((0) (set-display-mode! *pc-settings* 'windowed)) + ((1) (set-display-mode! *pc-settings* 'fullscreen)) + ((2) (set-display-mode! *pc-settings* 'borderless)) + ) + ) + (((game-option-type msaa)) + (case (-> *progress-carousell* int-backup) + ((0) (set! (-> *pc-settings* gfx-msaa) 1)) + ((1) (set! (-> *pc-settings* gfx-msaa) 2)) + ((2) (set! (-> *pc-settings* gfx-msaa) 4)) + ((3) (set! (-> *pc-settings* gfx-msaa) 8)) + ((4) (set! (-> *pc-settings* gfx-msaa) 16)) + ) + ) + (((game-option-type lod-bg)) + (case (-> *progress-carousell* int-backup) + ((0) (set! (-> *pc-settings* lod-force-tfrag) 0) (set! (-> *pc-settings* lod-force-tie) 0)) + ((1) (set! (-> *pc-settings* lod-force-tfrag) 2) (set! (-> *pc-settings* lod-force-tie) 2)) + ((2) (set! (-> *pc-settings* lod-force-tfrag) 2) (set! (-> *pc-settings* lod-force-tie) 3)) + ) + ) + (((game-option-type lod-fg)) + (case (-> *progress-carousell* int-backup) + ((0) (set! (-> *pc-settings* lod-force-actor) 0) (set! (-> *pc-settings* ps2-lod-dist?) #f)) + ((1) (set! (-> *pc-settings* lod-force-actor) 0) (set! (-> *pc-settings* ps2-lod-dist?) #t)) + ) + ) + (((game-option-type language)) + (if (not (-> obj language-transition)) + (load-level-text-files (-> obj display-level-index))) + ) + (((game-option-type language-subtitles)) + (set! (-> *pc-settings* subtitle-language) (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify)))) + ) + (((game-option-type speaker)) + ;; same thing. + (case (-> *progress-carousell* int-backup) + ((0) (set! (-> *pc-settings* subtitle-speaker?) #t)) + ((1) (set! (-> *pc-settings* subtitle-speaker?) #f)) + ((2) (set! (-> *pc-settings* subtitle-speaker?) 'auto)) + ) + ) + (((game-option-type frame-rate)) + (case (-> *progress-carousell* int-backup) + ((0) (set-frame-rate! *pc-settings* 60)) + ((1) (set-frame-rate! *pc-settings* 100)) + ((2) (set-frame-rate! *pc-settings* 150)) + ) + (set-video-mode (-> *setting-control* default video-mode)) + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod respond-memcard progress ((obj progress)) + "logic for handling input in memcard screens." + + (let ((s5-0 (-> obj card-info))) + (when (and s5-0 (not (-> obj in-transition))) + (when (or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) + (cpad-clear! 0 x) + (cpad-clear! 0 circle) + (case (-> obj display-state) + (((progress-screen load-game)) + (cond + ((< (-> obj option-index) 4) + (when (nonzero? (-> s5-0 file (-> obj option-index) present)) + (sound-play "start-options") + (set! (-> *progress-state* which) (-> obj option-index)) + (set! (-> obj next-display-state) (progress-screen memcard-loading)) + ) + ) + (else + (sound-play "cursor-options") + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ) + ) + (((progress-screen save-game) (progress-screen save-game-title)) + (cond + ((< (-> obj option-index) 4) + (sound-play "start-options") + (set! (-> *progress-state* which) (-> obj option-index)) + (if (zero? (-> s5-0 file (-> obj option-index) present)) + (set! (-> obj next-display-state) (progress-screen memcard-saving)) + (set! (-> obj next-display-state) (progress-screen memcard-data-exists)) + ) + ) + ((and (= (-> obj display-state) (progress-screen save-game-title)) (= (-> obj option-index) 4)) + (sound-play "starts-options") + (sound-volume-off) + (set! (-> *game-info* mode) 'play) + (initialize! *game-info* 'game (the-as game-save #f) "intro-start") + (set-master-mode 'game) + ) + (else + (sound-play "cursor-options") + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ) + ) + (((progress-screen memcard-insert)) + (sound-play "cursor-options") + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + (((progress-screen memcard-data-exists)) + (cond + ((-> *progress-state* yes-no-choice) + (sound-play "start-options") + (set! (-> obj next-display-state) (progress-screen memcard-saving)) + ) + (else + (sound-play "cursor-options") + (if (= (-> obj display-state-stack 0) (progress-screen title)) + (set! (-> obj next-display-state) (progress-screen save-game-title)) + (set! (-> obj next-display-state) (progress-screen save-game)) + ) + ) + ) + ) + (((progress-screen memcard-no-data)) + (cond + ((-> *progress-state* yes-no-choice) + (sound-play "start-options") + (set! (-> obj next-display-state) (progress-screen memcard-creating)) + ) + (else + (sound-play "cursor-options") + (sound-volume-off) + (set! (-> *game-info* mode) 'play) + (initialize! *game-info* 'game (the-as game-save #f) "intro-start") + (set-master-mode 'game) + ) + ) + ) + (((progress-screen memcard-no-space) + (progress-screen memcard-not-inserted) + (progress-screen memcard-not-formatted) + ) + (cond + ((= (-> obj display-state-stack 0) (progress-screen title)) + (sound-play "start-options") + (sound-volume-off) + (set! (-> *game-info* mode) 'play) + (initialize! *game-info* 'game (the-as game-save #f) "intro-start") + (set-master-mode 'game) + ) + ((nonzero? (-> obj display-state-stack 0)) + (sound-play "start-options") + (set-master-mode 'game) + ) + (else + (sound-play "cursor-options") + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ) + ) + (((progress-screen memcard-error-loading) + (progress-screen memcard-error-saving) + (progress-screen memcard-error-formatting) + (progress-screen memcard-error-creating) + (progress-screen memcard-auto-save-error) + (progress-screen memcard-removed) + (progress-screen auto-save) + ) + (sound-play "cursor-options") + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + (((progress-screen pal-change-to-60hz)) + (cond + ((-> *progress-state* yes-no-choice) + (sound-play "start-options") + (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) + (set! (-> obj video-mode-timeout) (-> *display* real-frame-counter)) + (set! (-> obj next-display-state) (progress-screen pal-now-60hz)) + ) + (else + (sound-play "cursor-options") + (set! (-> *progress-state* video-mode-choice) 'pal) + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ) + ) + (((progress-screen pal-now-60hz)) + (cond + ((not (-> *progress-state* yes-no-choice)) + (set! (-> *progress-state* video-mode-choice) 'pal) + (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) + (sound-play "cursor-options") + ) + (else + (sound-play "start-options") + ) + ) + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + (((progress-screen no-disc) (progress-screen bad-disc)) + (when (is-cd-in?) + (sound-play "cursor-options") + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ) + (((progress-screen quit)) + (cond + ((-> *progress-state* yes-no-choice) + (sound-play "start-options") + (sound-volume-off) + (set! (-> *game-info* mode) 'play) + (initialize! *game-info* 'game (the-as game-save #f) "title-start") + ) + (else + (sound-play "cursor-options") + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ) + ) + (((progress-screen memcard-format)) + (cond + ((-> *progress-state* yes-no-choice) + (sound-play "start-options") + (set! (-> obj next-display-state) (progress-screen memcard-formatting)) + ) + ((= (-> obj display-state-stack 0) (progress-screen title)) + (sound-play "start-options") + (sound-volume-off) + (set! (-> *game-info* mode) 'play) + (initialize! *game-info* 'game (the-as game-save #f) "intro-start") + (set-master-mode 'game) + ) + (else + (sound-play "cursor-options") + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ) + ) + (((progress-screen quit-title)) + (cond + ((-> *progress-state* yes-no-choice) + (sound-play "start-options") + (sound-volume-off) + (kernel-shutdown) + ) + (else + (sound-play "cursor-options") + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + + +(defmethod draw-options progress ((obj progress) (arg0 int) (arg1 int) (arg2 float)) + "common logic for drawing options menus." + + (let ((options (-> *options-remap* (-> obj display-state)))) + (when options + ;; this menu has options to draw omg + (let* ((line-amt (if (> (length options) PROGRESS_PC_PAGE_HEIGHT) (1- PROGRESS_PC_PAGE_HEIGHT) (length options))) + (y-off (- arg0 (/ (* arg1 line-amt) 2))) + (option-count 0) + (unkx 27) + (unk2 0) + (font (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning))) + ) + ;; set the common params for the text drawing + (set-width! font 370) + (set-height! font 25) + (set! (-> font flags) (font-flags shadow kerning middle left large)) + ;; set scroll arrow sprite vertical position right now + (set! (-> obj particles 32 init-pos y) (the float (* 2 (- y-off 20)))) + ;; when scrolling we draw an extra line + (cond + ((progress-scrolling-down?) (set! y-off (+ (- y-off arg1) (* (the float arg1) (- 1.0 (-> *progress-scroll* transition)))))) + ((progress-scrolling-up?) (set! y-off (+ (- y-off arg1) (* (the float arg1) (-> *progress-scroll* transition))))) + ) + (let ((draw-arrows (and (not (-> obj in-transition)) + (= (-> obj next-state name) 'progress-normal) + (> (length options) PROGRESS_PC_PAGE_HEIGHT) + (< (mod (-> *display* real-frame-counter) (seconds 0.2)) (seconds 0.1)))) + (draw-prev (< 0 *progress-scroll-start*)) + (draw-next (> (length options) *progress-scroll-end*))) + (set! (-> obj particles 32 init-pos x) (the float (if (and draw-arrows draw-prev) + (- 195 (-> *progress-process* 0 left-x-offset)) + -320 + ))) + (set! (-> obj particles 33 init-pos x) (the float (if (and draw-arrows draw-next) + (- 195 (-> *progress-process* 0 left-x-offset)) + -320 + ))) + ) + ;; cheating a bit and putting some screen-specific code here. it's not a big deal. + (case (-> obj display-state) + (((progress-screen music-player)) + (set-color! font (font-color default)) + (set-origin! font (- 17 (-> obj left-x-offset)) 14) + (set-scale! font (* 0.6 (-> obj transition-percentage-invert))) + (print-game-text (lookup-text! *common-text* (game-text-id select-level) #f) font #f (the int (* 128.0 (-> obj transition-percentage-invert))) 22) + ) + (((progress-screen flava-player)) + (set-color! font (font-color default)) + (set-origin! font (- 17 (-> obj left-x-offset)) 14) + (set-scale! font (* 0.6 (-> obj transition-percentage-invert))) + (print-game-text (lookup-text! *common-text* (game-text-id select-flava) #f) font #f (the int (* 128.0 (-> obj transition-percentage-invert))) 22) + ) + ) + (dotimes (index (length options)) + (let ((option-str (the string #f)) ;; the option text + (option-x 17) + (option-y y-off) + ) + (case (-> options index option-type) + (((game-option-type yes-no)) + ;; yes-no option. text is either '->YES<- NO' or 'YES ->NO<-', not the most robust but this option is a strange hack anyway. + (if (-> (the-as (pointer uint32) (-> options index value-to-modify))) + (set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id yes) #f) (lookup-text! *common-text* (game-text-id no) #f))) + (set! option-str (string-format "~0L~S ~30L~S" (lookup-text! *common-text* (game-text-id yes) #f) (lookup-text! *common-text* (game-text-id no) #f))) + ) + ) + (((game-option-type menu) (game-option-type button)) + ;; menu option or simple button. just draw its text! + (if (nonzero? (-> options index name)) + (set! option-str (lookup-text! *common-text* (-> options index name) #f)) + (set! option-str (the-as string #f)) + ) + ) + (((game-option-type button-music)) + ;; a button for the music player. has the text "locked" sometimes! + (if (and (nonzero? (-> options index name)) (find-music-log (progress-get-music-by-index index))) + (set! option-str (lookup-text! *common-text* (-> options index name) #f)) + (set! option-str (lookup-text! *common-text* (game-text-id locked) #f)) + ) + ) + (((game-option-type button-flava)) + ;; a button for the flava player. has the text "locked" sometimes! + (if (and (nonzero? (-> options index name)) (find-flava-log (progress-get-music-by-index *progress-music*) (the int (-> options index param1)))) + (set! option-str (lookup-text! *common-text* (-> options index name) #f)) + (set! option-str (lookup-text! *common-text* (game-text-id locked) #f)) + ) + ) + (((game-option-type resolution) (game-option-type aspect-new)) + ;; resolution settings + (set! option-str (string-format (lookup-text! *common-text* (-> options index name) #f) + (the int (-> options index param1)) (the int (-> options index param2)))) + ) + (else + (cond + ((and (-> obj selected-option) (= (-> obj option-index) index)) + ;; this option is SELECTED! + (set-color! font (font-color default)) + (set! (-> font origin x) (the float (- option-x (-> obj left-x-offset)))) + (set! (-> font origin y) (the float (+ y-off -8))) + (set-scale! font 0.6) + (print-game-text (lookup-text! *common-text* (-> options index name) #f) font #f 128 22) + (set! option-y (+ y-off 7)) + (case (-> options index option-type) + (((game-option-type slider)) + ;; draw a slider and its text. + ;; this ugliness is just decompiler stuff. all it does is fade the alpha according to value. + (let* ((v1-82 (the-as uint #x8000ffff)) + (f0-12 (* 0.01 (-> (the-as (pointer float) (-> options index value-to-modify))))) + (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) + (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) + ) + (draw-percent-bar (- 75 (-> obj left-x-offset)) (+ y-off 8) f0-12 (the-as rgba a3-5)) + ) + (set! option-str (string-format "~D" (the int (-> (the-as (pointer float) (-> options index value-to-modify)))))) + (set! option-x (+ (the int (* 2.5 (-> (the-as (pointer float) (-> options index value-to-modify))))) -100)) + ) + (((game-option-type on-off) (game-option-type normal-inverted) (game-option-type aspect-native)) + ;; on-off option or some other toggle. same logic as yes-no. changed to cut down code duping. + (let ( + (on-str (case (-> options index option-type) + (((game-option-type on-off) (game-option-type aspect-native)) + (lookup-text! *common-text* (game-text-id on) #f)) + (((game-option-type normal-inverted)) + (lookup-text! *common-text* (game-text-id inverted) #f)) + )) + (off-str (case (-> options index option-type) + (((game-option-type on-off) (game-option-type aspect-native)) + (lookup-text! *common-text* (game-text-id off) #f)) + (((game-option-type normal-inverted)) + (lookup-text! *common-text* (game-text-id normal) #f)) + )) + ) + (if (-> (the-as (pointer symbol) (-> options index value-to-modify))) + (set! option-str (string-format "~30L~S~0L ~S" on-str off-str)) + (set! option-str (string-format "~0L~S ~30L~S" on-str off-str)) + ) + ) + ) + (((game-option-type display-mode) + (game-option-type msaa) + (game-option-type lod-bg) + (game-option-type lod-fg) + (game-option-type speaker) + (game-option-type frame-rate) + ) + ;; crunched down to one generic function. + (progress-draw-carousell-from-string-list (-> *progress-carousell* current-carousell) font y-off (-> (the-as (pointer int) (-> options index value-to-modify)))) + ) + (((game-option-type language-subtitles)) + ;; crunched down to one generic function. + (progress-draw-carousell-from-string-list (-> *progress-carousell* current-carousell) font y-off (the int (-> (the-as (pointer pc-subtitle-lang) (-> options index value-to-modify))))) + ) + (((game-option-type language)) + ;; language carousell. who knew this could be so complicated. + (let ((old-lang (-> obj language-selection)) + (new-lang (-> (the-as (pointer language-enum) (-> options index value-to-modify)))) + (max-lang 6) + ) + (if (-> obj language-transition) + (seekl! (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio))))) + (when (>= (-> obj language-x-offset) 100) + (set! (-> obj language-selection) new-lang) + (set! old-lang new-lang) + (set! (-> obj language-transition) #f) + (set! (-> obj language-x-offset) 0) + ) + (set! (-> font origin y) (the float (+ y-off 3))) + (set-color! font (font-color lighter-lighter-blue)) + 0 + (let ((next-lang (mod (+ old-lang 1) max-lang)) + (prev-lang (mod (+ max-lang -1 old-lang) max-lang)) + ;; these are used during the transition since it technically allows you to see 4 langs at once. + (next2-lang (mod (+ old-lang 2) max-lang)) + (prev2-lang (mod (+ max-lang -2 old-lang) max-lang)) + ) + (cond + ((-> obj language-direction) + (let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100)))) + (print-language-name prev-lang font a2-22 #f) + ) + (set-color! font (font-color lighter-lighter-blue)) + (let ((a2-23 (+ (-> obj language-x-offset) 100))) + (cond + ((< a2-23 150) + (print-language-name (the int next-lang) font a2-23 #t) + ) + (else + (let ((a2-24 (- 200 (-> obj language-x-offset)))) + (print-language-name prev2-lang font a2-24 #f) + ) + ) + ) + ) + ) + (else + (let ((a2-25 (+ (-> obj language-x-offset) 100))) + (cond + ((< a2-25 150) + (print-language-name prev-lang font a2-25 #f) + ) + (else + (let ((a2-26 (- 200 (-> obj language-x-offset)))) + (print-language-name (the int next2-lang) font a2-26 #t) + ) + ) + ) + ) + (set-color! font (font-color lighter-lighter-blue)) + (let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100)))) + (print-language-name (the int next-lang) font a2-27 #t) + ) + ) + ) + ) + (if (not (-> obj language-transition)) + (set-color! font (font-color yellow-green-2))) + (print-language-name (the-as int old-lang) font (-> obj language-x-offset) (-> obj language-direction)) + )) + (((game-option-type aspect-ratio)) + ;; same as on-off but checks a different symbol + (if (= (-> (the-as (pointer symbol) (-> options index value-to-modify))) 'aspect4x3) + (set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id 4x3) #f) (lookup-text! *common-text* (game-text-id 16x9) #f))) + (set! option-str (string-format "~0L~S ~30L~S" (lookup-text! *common-text* (game-text-id 4x3) #f) (lookup-text! *common-text* (game-text-id 16x9) #f))) + ) + ) + ) + ) + (else + ;; this option is not selected :-( + (case (-> options index option-type) + (((game-option-type slider) + (game-option-type aspect-ratio) + (game-option-type display-mode) + (game-option-type msaa) + (game-option-type lod-bg) + (game-option-type lod-fg) + (game-option-type speaker) + (game-option-type frame-rate) + (game-option-type normal-inverted) + ) + ;; slider and aspect ratio options just show their text + (set! option-str (lookup-text! *common-text* (-> options index name) #f)) + ) + (((game-option-type on-off) (game-option-type aspect-native)) + ;; on-off options show their text + on or off + (set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> options index name) #f) + (if (-> (the-as (pointer uint32) (-> options index value-to-modify))) + (lookup-text! *common-text* (game-text-id on) #f) + (lookup-text! *common-text* (game-text-id off) #f) + ))) + ) + (((game-option-type language)) + ;; language options show their text + language name + (set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> options index name) #f) + (lookup-text! *common-text* (-> *language-name-remap* (-> (the-as (pointer uint64) (-> options index value-to-modify)))) #f))) + ) + (((game-option-type language-subtitles)) + (let ((stupidity (the int (-> (the-as (pointer pc-subtitle-lang) (-> options index value-to-modify)))))) + (set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> options index name) #f) + (lookup-text! *common-text* (-> *carousell-subtitle-language* stupidity) #f))) + ) + ) + ) + ) + )) + ) + (when (or (<= (length options) PROGRESS_PC_PAGE_HEIGHT) + (and (not (progress-scrolling?)) + (>= index *progress-scroll-start*) + (< index *progress-scroll-end*)) + (and (progress-scrolling-down?) + (>= index (1- *progress-scroll-start*)) + (< index *progress-scroll-end*)) + (and (progress-scrolling-up?) + (>= index *progress-scroll-start*) + (< index (1+ *progress-scroll-end*))) + ) + (when option-str + ;; draw the actual text! + (let ((f0-23 (-> obj transition-percentage-invert)) + (scroll-amt (-> *progress-scroll* transition))) + (cond + ((or (and (progress-scrolling-up?) (= index *progress-scroll-start*)) + (and (progress-scrolling-down?) (= index (1- *progress-scroll-end*)))) + ) + ((or (and (progress-scrolling-down?) (= index (1- *progress-scroll-start*))) + (and (progress-scrolling-up?) (= index *progress-scroll-end*))) + (set! scroll-amt (- 1.0 scroll-amt)) + ) + (else + (set! scroll-amt 1.0) + ) + ) + (set-color! font (cond + ((and (!= index (-> obj option-index)) + (string= (lookup-text! *common-text* (game-text-id locked) #f) option-str)) ;; hacky.. + ;; for "locked" options! + (font-color flat-dark-purple)) + ((and (= index (-> obj option-index)) + (not (or (progress-scrolling?) (-> obj in-transition)))) + (font-color yellow-green-2)) + (else + (font-color default)) + )) + (set! (-> font origin x) (the float (- option-x (-> obj left-x-offset)))) + (set! (-> font origin y) (the float (the int (* (the float option-y) (if (-> options index scale) + f0-23 + 1.0 + ))))) + (set-scale! font (* arg2 f0-23 scroll-amt)) + (print-game-text option-str font #f (the int (* 128.0 f0-23 scroll-amt)) 22) + ) + ) + (+! y-off arg1) + (+! option-count 1) + ) + )) + ) + ) + ) + 0 + (none) + ) + + +(defmethod draw-notice-screen progress ((obj progress)) + (hide-progress-icons) + (when *common-text* + (let ((a1-1 (new 'stack 'font-context *font-default-matrix* (- 70 (-> obj left-x-offset)) 10 0.0 + (font-color default) (font-flags shadow kerning)))) + (case (-> obj display-state) + (((progress-screen memcard-format)) + (draw-memcard-format obj a1-1) + ) + (((progress-screen memcard-no-space) + (progress-screen memcard-not-inserted) + (progress-screen memcard-not-formatted) + ) + (draw-memcard-storage-error obj a1-1) + ) + (((progress-screen memcard-data-exists)) + (draw-memcard-data-exists obj a1-1) + ) + (((progress-screen memcard-no-data)) + (draw-memcard-no-data obj a1-1) + ) + (((progress-screen memcard-loading) + (progress-screen memcard-saving) + (progress-screen memcard-formatting) + (progress-screen memcard-creating) + ) + (draw-memcard-accessing obj a1-1) + ) + (((progress-screen memcard-insert)) + (draw-memcard-insert obj a1-1) + ) + (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) + (draw-memcard-file-select obj a1-1) + ) + (((progress-screen memcard-auto-save-error)) + (draw-memcard-auto-save-error obj a1-1) + ) + (((progress-screen memcard-removed)) + (draw-memcard-removed obj a1-1) + ) + (((progress-screen memcard-error-loading) + (progress-screen memcard-error-saving) + (progress-screen memcard-error-formatting) + (progress-screen memcard-error-creating) + ) + (draw-memcard-error obj a1-1) + ) + (((progress-screen auto-save)) + (draw-auto-save obj a1-1) + ) + (((progress-screen pal-change-to-60hz)) + (draw-pal-change-to-60hz obj a1-1) + ) + (((progress-screen pal-now-60hz)) + (draw-pal-now-60hz obj a1-1) + ) + (((progress-screen no-disc)) + (draw-no-disc obj a1-1) + ) + (((progress-screen bad-disc)) + (draw-bad-disc obj a1-1) + ) + (((progress-screen quit) (progress-screen quit-title)) + (draw-quit obj a1-1) + ) + ) + ) + ) + 0 + (none) + ) + + +;; override the post handler for progress-normal +(set! (-> progress-normal post) + (lambda :behavior progress () + (when (progress-scrolling?) + (seek! (-> *progress-scroll* transition) 1.0 (* 1.75 (1/ 512) (-> self transition-speed) (-> *display* time-adjust-ratio))) + ) + (when (!= (-> self display-state) (-> *progress-scroll* last-screen)) + (progress-scroll-reset) + (set! (-> *progress-scroll* last-screen) (-> self display-state)) + ) + ;; draw the menus!! + (let* ((a1-0 (-> self display-level-index)) + (gp-0 (-> *level-task-data* a1-0)) + (unk #t) + (stats? #f) + ) + (case (-> self display-state) + (((progress-screen fuel-cell)) + (set! stats? #t) + (draw-fuel-cell-screen self a1-0) + ) + (((progress-screen money)) + (set! stats? #t) + (draw-money-screen self a1-0) + ) + (((progress-screen buzzer)) + (set! stats? #t) + (draw-buzzer-screen self a1-0) + ) + (((progress-screen graphic-settings) + (progress-screen settings-title) + (progress-screen title) + (progress-screen game-settings) + (progress-screen settings) + (progress-screen misc-options) + (progress-screen accessibility-options) + (progress-screen game-ps2-options) + (progress-screen resolution) + (progress-screen aspect-ratio) + (progress-screen secrets) + ) + (hide-progress-icons) + (draw-options self 115 25 0.82) + ) + (((progress-screen music-player)) + (hide-progress-icons) + (draw-options self 128 21 0.82) + ) + (((progress-screen flava-player)) + (hide-progress-icons) + (draw-options self 128 21 0.82) + ) + (((progress-screen camera-options)) + ;; camera options lines are a bit too big + (hide-progress-icons) + (draw-options self 115 25 0.65) + ) + (((progress-screen gfx-ps2-options)) + (hide-progress-icons) + (draw-options self 115 25 0.72) + ) + (((progress-screen sound-settings)) + (hide-progress-icons) + (draw-options self 115 25 0.76) + ) + (((progress-screen memcard-removed) (progress-screen memcard-auto-save-error)) + (draw-notice-screen self) + (draw-options self 192 0 0.82) + ) + (((progress-screen memcard-no-data)) + (draw-notice-screen self) + (draw-options self 165 0 0.82) + ) + (((progress-screen memcard-format)) + (draw-notice-screen self) + (draw-options self 172 0 0.82) + ) + (((progress-screen memcard-no-space) + (progress-screen memcard-not-inserted) + (progress-screen memcard-not-formatted) + ) + (draw-notice-screen self) + (draw-options self 195 0 0.82) + ) + (((progress-screen memcard-error-loading) + (progress-screen memcard-error-saving) + (progress-screen memcard-error-formatting) + (progress-screen memcard-error-creating) + (progress-screen memcard-auto-save-error) + (progress-screen auto-save) (progress-screen load-game) (progress-screen save-game) + ) + (draw-notice-screen self) + (draw-options self 190 0 0.82) + ) + (((progress-screen no-disc) (progress-screen bad-disc)) + (draw-notice-screen self) + (if (is-cd-in?) + (draw-options self 170 0 0.82) + ) + ) + (((progress-screen quit) (progress-screen quit-title)) + (draw-notice-screen self) + (draw-options self 110 0 0.82) + ) + (((progress-screen memcard-insert)) + (draw-notice-screen self) + (draw-options self 165 0 0.82) + ) + (((progress-screen memcard-data-exists)) + (draw-notice-screen self) + (draw-options self 168 0 0.82) + ) + (((progress-screen memcard-loading) + (progress-screen memcard-saving) + (progress-screen memcard-formatting) + (progress-screen memcard-creating) + ) + (draw-notice-screen self) + ) + (((progress-screen save-game-title)) + (draw-notice-screen self) + (draw-options self 169 15 0.6) + ) + ) + (when stats? + (let* ((v1-98 (cond ((-> self stat-transition) 0) + ((= (-> self level-transition) 1) (- (-> self transition-offset))) + (else (-> self transition-offset)) + )) + (f30-0 (the-as float (if (-> self stat-transition) + 1.0 + (-> self transition-percentage-invert) + ))) + (s5-1 (new 'stack 'font-context *font-default-matrix* + (- 32 (-> self left-x-offset)) + (the int (* (+ 42.0 (the float (/ v1-98 2))) f30-0)) + 8325000.0 + (font-color lighter-lighter-blue) + (font-flags shadow kerning) + )) + ) + (set-width! s5-1 328) + (set-height! s5-1 45) + (set! (-> s5-1 flags) (font-flags shadow kerning middle left large)) + (print-game-text-scaled (lookup-text! *common-text* (-> gp-0 level-name-id) #f) f30-0 s5-1 (the int (* 128.0 f30-0))) + ) + ) + ) + (case (-> self display-state) + (((progress-screen fuel-cell) (progress-screen money) (progress-screen buzzer)) + (draw-progress self) + ) + ) + (adjust-sprites self) + (adjust-icons self) + (none) + )) + +;; override the enter handler for progress-going-out +(set! (-> progress-going-out enter) + (lambda :behavior progress () + (sound-play "menu-close") + (hide-progress-icons) + (remove-setting! 'music) + (apply-settings *setting-control*) + (progress-reset-music-parms) + (commit-to-file *pc-settings*) + (set! (-> self particles 3 init-pos x) -320.0) + (set! (-> self particles 4 init-pos x) -320.0) + (set! (-> self particles 32 init-pos x) -320.0) + (set! (-> self particles 33 init-pos x) -320.0) + (case (-> self display-state) + (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) + (set! (-> self transition-speed) 30.0) + ) + ) + (none) + )) + +;; these need to be overridden as well +(set! (-> progress-going-out post) (-> progress-normal post)) +(set! (-> progress-coming-in post) (-> progress-normal post)) + +;; override this as well... +(set! (-> progress-normal code) + (lambda :behavior progress () + (loop + (when (and (cpad-hold? 0 l1) (cpad-hold? 0 r1) *cheat-mode*) + (when (and (< (-> self task-index) (-> *level-task-data* (-> self display-level-index) nb-of-tasks)) + (>= (-> self task-index) 0) + ) + (let ((gp-0 (-> *level-task-data* (-> self display-level-index) task-info (-> self task-index) task-id))) + (close-specific-task! gp-0 (task-status need-resolution)) + (send-event *target* 'get-pickup 6 (the float gp-0)) + ) + ) + ) + (if (and (= (-> self display-state) (-> self next-display-state)) + (= (-> self display-level-index) (-> self next-level-index)) + ) + (seekl! + (-> self transition-offset) + 0 + (* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) + (if (or (-> self stat-transition) (nonzero? (-> self level-transition))) + 2 + 1 + ) + ) + ) + (seekl! + (-> self transition-offset) + 512 + (* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) + (if (or (-> self stat-transition) (nonzero? (-> self level-transition))) + 2 + 1 + ) + ) + ) + ) + (set-transition-progress! self (-> self transition-offset)) + (set! (-> self in-transition) (or (-> self force-transition) (nonzero? (-> self transition-offset)))) + (when (and (not (handle->process (-> *game-info* auto-save-proc))) + (or (-> self force-transition) (-> self in-transition)) + (>= (-> self transition-offset) (if (and (zero? (-> self level-transition)) + (nonzero? (-> self next-display-state)) + (!= (-> self next-display-state) 1) + (!= (-> self next-display-state) 2) + ) + 512 + 256 + ) + ) + ) + (if (>= (the-as int (-> self next-display-state)) 0) + (enter! self (-> self next-display-state) 0) + (pop! self) + ) + (set! (-> self display-level-index) (-> self next-level-index)) + (when (nonzero? (-> self level-transition)) + (set! (-> self task-index) (get-next-task-up -1 (-> self display-level-index))) + (case (-> self level-transition) + ((1) + (set! (-> self level-transition) 2) + ) + ((2) + (set! (-> self level-transition) 1) + ) + ) + ) + (set! (-> self force-transition) #f) + ) + (when (zero? (-> self transition-offset)) + (set! (-> self stat-transition) #f) + (set! (-> self level-transition) 0) + 0 + ) + (let ((gp-1 #f)) + (let ((v1-62 #f)) + (case (-> self display-state) + (((progress-screen fuel-cell) (progress-screen money) (progress-screen buzzer)) + (let ((s5-0 (-> self display-level-index))) + (when (and (< (mod (-> *display* real-frame-counter) (seconds 0.2)) (seconds 0.1)) + (zero? (-> *progress-process* 0 in-out-position)) + (not (-> self in-transition)) + (zero? (-> self transition-offset)) + ) + (set! gp-1 (!= s5-0 (get-next-level-up s5-0))) + (set! v1-62 (!= s5-0 (get-next-level-down s5-0))) + ) + ) + ) + ) + (set! (-> self particles 3 init-pos x) (the float (if v1-62 + (- 195 (-> *progress-process* 0 left-x-offset)) + -320 + ) + ) + ) + ) + (set! (-> self particles 4 init-pos x) (the float (if gp-1 + (- 195 (-> *progress-process* 0 left-x-offset)) + -320 + ) + ) + ) + ) + (respond-common self) + (set! (-> self next-display-state) (set-memcard-screen self (-> self next-display-state))) + (let ((v1-74 (-> self display-state))) + (cond + ((or (= v1-74 (progress-screen fuel-cell)) + (or (= v1-74 (progress-screen money)) (= v1-74 (progress-screen buzzer))) + ) + (respond-progress self) + ) + ((or (= v1-74 (progress-screen memcard-no-space)) + (= v1-74 (progress-screen memcard-format)) + (= v1-74 (progress-screen memcard-data-exists)) + (= v1-74 (progress-screen memcard-insert)) + (= v1-74 (progress-screen load-game)) + (= v1-74 (progress-screen save-game)) + (= v1-74 (progress-screen save-game-title)) + (= v1-74 (progress-screen memcard-error-loading)) + (= v1-74 (progress-screen memcard-error-saving)) + (= v1-74 (progress-screen memcard-error-formatting)) + (= v1-74 (progress-screen memcard-error-creating)) + (= v1-74 (progress-screen memcard-auto-save-error)) + (= v1-74 (progress-screen memcard-removed)) + (= v1-74 (progress-screen memcard-no-data)) + (= v1-74 (progress-screen memcard-not-inserted)) + (= v1-74 (progress-screen memcard-not-formatted)) + (= v1-74 (progress-screen auto-save)) + (= v1-74 (progress-screen pal-change-to-60hz)) + (= v1-74 (progress-screen pal-now-60hz)) + (= v1-74 (progress-screen no-disc)) + (= v1-74 (progress-screen bad-disc)) + (= v1-74 (progress-screen quit)) + (= v1-74 (progress-screen quit-title)) + ) + (respond-memcard self) + ) + ) + ) + (suspend) + ) + (none) + ) + ) + + + + diff --git a/goal_src/pc/subtitle.gc b/goal_src/pc/subtitle.gc index 3c7c5eb595..82cddb8813 100644 --- a/goal_src/pc/subtitle.gc +++ b/goal_src/pc/subtitle.gc @@ -5,27 +5,25 @@ Code for subtitles for the PC port. A PC actor pool is provided, and the subtitle process lives there. It automatically detects the currently playing cutscene and plays the subtitles for it on channel 0. - Channel 1 and 2 are reserved for ambient sounds, which cannot be auto-detected, so the ambient-control needs to - notify the subtitle process manually (TODO: verify this!) - + The other two channels are for hints, first checked automatically by name, then by text ID. + There is a hack in ambient.gc to store the name of the last ambient hint vag played to aid in this. + Similarly to the generic text file, only one subtitles text file is loaded at once, stored in a specific heap. - + In Jak 2, the subtitles are stored directly within the .STR files. We don't have that luxury here, unfortunately. |# -(#when PC_PORT - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; constants ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defconstant PC_SUBTITLE_FILE_SIZE (* 64 1024)) +(defconstant PC_SUBTITLE_FILE_SIZE (* 128 1024)) ;; 128K heap for subtitles. adjust later if necessary. (defconstant PC_SUBTITLE_FILE_NAME "subtit") +(defconstant PC_SUBTITLE_STR_ADJUST 17) (defglobalconstant PC_SUBTITLE_DEBUG #f) @@ -42,8 +40,14 @@ ;; enum for the subtitle channels, no more than 2 bytes! (defenum pc-subtitle-channel :type int16 - (invalid -1) (movie 0) (ambient 1) (hint 2)) + (invalid -1) (movie 0) (hint 1) (hint-named 2)) +(defconstant SUBTITLE_CHANNEL_COUNT 3) +(defenum pc-subtitle-flags + :bitfield #t + :type uint32 + (offscreen) ;; speaker is offscreen. + ) ;; information about a single line of subtitles (deftype subtitle-keyframe (structure) @@ -51,7 +55,7 @@ (frame int32) ;; the frame to play the subtitle line on (string string) ;; the text for the subtitle line (speaker string) ;; name of the speaker. leave blank for no speaker. - (offscreen symbol) ;; speaker is offscreen. + (flags pc-subtitle-flags) ;; flags ) :pack-me ) @@ -65,17 +69,17 @@ (length int16) ;; data (keyframes (inline-array subtitle-keyframe)) - + ;; now we store a way to identify and lookup the subtitles. - - ;; the game-text-id if this is for a hint - (id game-text-id :offset 8) + ;; the name of the spool-anim (name string :offset 8) + ;; the game-text-id if this is for a hint + (id game-text-id :offset 12) ;; the 8-character name for an ambient or hint (hash uint64 :offset 8) - - + + ) :size-assert #x10 ;; compact! @@ -88,31 +92,63 @@ (dummy int32) (data subtitle-text :inline :dynamic) ) - + (:methods (get-scene-by-name (_type_ pc-subtitle-channel string) subtitle-text) + (get-scene-by-text-id (_type_ pc-subtitle-channel game-text-id) subtitle-text) ) ) +(defmacro subtitle-flags? (sub &rest flags) + `(logtest? (-> ,sub flags) (pc-subtitle-flags ,@flags))) + + + ;;;---------------------------------- ;; process type ;;;---------------------------------- +;; graphic parameters for subtitles +(deftype subtitle-bank (structure) + ( + (scale float) + (width float) + (height float) + (lines float) + ) + + ) + +(define *SUBTITLE-bank* + (new 'static 'subtitle-bank + :scale 0.49 + :width 0.87 + :height 0.835 + :lines 2.0 + )) + ;; the subtitle process! it lives on the PC actor pool and awaits for incoming subtitle messages, or a movie (deftype subtitle (process) ( - (font font-context) + (font font-context) ;; the font to use for the subtitles. + (bank-backup subtitle-bank :inline) ;; debug backup. + ( spool-name string) (old-spool-name string) + (text-id game-text-id) (cur-channel pc-subtitle-channel) + + (want-subtitle subtitle-keyframe) ;; the subtitle we want to display + (hint-subtitle? symbol) ) - :heap-base #x10 - + (:methods (subtitle-format (_type_ subtitle-keyframe) string) ) + (:states + subtitle-debug) ) @@ -123,9 +159,7 @@ ;;;---------------------------------------------- -;; the actor pool for PC processes! it has 1K of space for 1 process. -(define *pc-dead-pool* (new 'global 'dead-pool 1 (* 1 1024) '*pc-dead-pool*)) -(define *subtitle-temp-string* (new 'global 'string 16 (the string #f))) +;; the subtitle process. (define *subtitle* (the (pointer subtitle) #f)) ;; subtitle text data @@ -141,14 +175,34 @@ (defmethod get-scene-by-name subtitle-text-info ((obj subtitle-text-info) (kind pc-subtitle-channel) (name string)) "get a subtitle scene info with the corresponding name. #f = none found" - + + ;; invalid kind so return invalid scene. + (if (or (not name) (= kind (pc-subtitle-channel invalid))) + (return (the subtitle-text #f))) + (dotimes (i (-> obj length)) ;; name and kind matches, return that! (when (and (= kind (-> obj data i kind)) (string= (-> obj data i name) name)) (return (-> obj data i)) ) ) - + + (the subtitle-text #f)) + +(defmethod get-scene-by-text-id subtitle-text-info ((obj subtitle-text-info) (kind pc-subtitle-channel) (id game-text-id)) + "get a subtitle scene info with the corresponding name. #f = none found" + + ;; invalid kind so return invalid scene. + (if (= kind (pc-subtitle-channel invalid)) + (return (the subtitle-text #f))) + + (dotimes (i (-> obj length)) + ;; name and kind matches, return that! + (when (and (= kind (-> obj data i kind)) (= (-> obj data i id) id)) + (return (-> obj data i)) + ) + ) + (the subtitle-text #f)) (defun load-subtitle-text-info ((txt-name string) (curr-text symbol) (heap kheap)) @@ -157,48 +211,78 @@ curr-text = a symbol to a subtitle-text-info to link the file to heap = the text heap to load the file onto" - (local-vars (v0-2 int) (heap-sym-heap subtitle-text-info) (lang pc-subtitle-lang) (load-status int) (heap-free int)) - (set! heap-sym-heap (the-as subtitle-text-info (-> curr-text value))) - (set! lang (-> *pc-settings* subtitle-language)) - (set! load-status 0) - (set! heap-free (&- (-> heap top) (the-as uint (-> heap base)))) - (when (or (= heap-sym-heap #f) - (!= (-> heap-sym-heap lang) lang) - ) - (kheap-reset heap) + (let ((heap-sym-heap (the-as subtitle-text-info (-> curr-text value))) + (lang (-> *pc-settings* subtitle-language)) + (load-status 0) + (heap-free (&- (-> heap top) (the-as uint (-> heap base))))) - (while (not (str-load (string-format "~D~S.TXT" lang txt-name) -1 (logand -64 (&+ (-> heap current) 63)) (&- (-> heap top) (-> heap current)))) - (return 0) - ) + ;; current text has nothing loaded, or language doesn't match. + (when (or (= heap-sym-heap #f) + (!= (-> heap-sym-heap lang) lang) + ) + ;; so reload. - (label retry) - (let ((v1-20 (str-load-status (the-as (pointer int32) (& load-status))))) - (when (= v1-20 'error) - (format 0 "Error loading subtitle~%") - (return 0) - (goto loaded) + ;; reset the text heap. + (kheap-reset heap) + + ;; try to load load... + (while (not (str-load (string-format "~D~S.TXT" lang txt-name) -1 (logand -64 (&+ (-> heap current) 63)) (&- (-> heap top) (-> heap current)))) + (return 0) + ) + ;; load succeeded. check status. + + (label retry) + (let ((status (str-load-status (the-as (pointer int32) (& load-status))))) + (when (= status 'error) + (format 0 "Error loading subtitle~%") + (return 0) + (goto loaded) + ) + (cond + ((>= load-status (+ heap-free -300)) + (format 0 "Game subtitle heap overrun!~%") + (return 0) + ) + ((= status 'busy) + ;; still loading. + (goto retry) + ) + ) ) - (cond - ((>= load-status (+ heap-free -300)) - (format 0 "Game subtitle heap overrun!~%") - (return 0) - ) - ((= v1-20 'busy) - (goto retry) - ) - ) - ) - (label loaded) - (let ((s2-1 (logand -64 (&+ (-> heap current) 63)))) - (flush-cache 0) - (set! (-> curr-text value) (link s2-1 (-> (string-format "~D~S.TXT" lang txt-name) data) load-status heap 0)) - ) - (if (<= (the-as int (-> curr-text value)) 0) - (set! (-> curr-text value) (the-as object #f)) - ) - ) + (label loaded) + + ;; link the text file! + (let ((new-mem (logand -64 (&+ (-> heap current) 63)))) + (flush-cache 0) + (set! (-> curr-text value) (link new-mem (-> (string-format "~D~S.TXT" lang txt-name) data) load-status heap 0)) + ) + ;; if linking failed just make the text invalid. + (if (<= (the-as int (-> curr-text value)) 0) + (set! (-> curr-text value) (the-as object #f)) + ) + )) 0) +(defun load-level-subtitle-files ((idx int)) + "Load the subtitle files needed for level idx. + This function made more sense back when text files were split up, but in the end they put everything + in a single text group and file." + + ;; just load common. + (if (or *level-text-file-load-flag* (>= idx 0)) + (load-subtitle-text-info PC_SUBTITLE_FILE_NAME '*subtitle-text* *subtitle-text-heap*) + ) + + (none)) + + +(defmacro reload-subtitles () + "rebuild and reload subtitles." + `(begin + (asm-text-file subtitle :files ("game/assets/game_subtitle.gp")) + (+! (-> *subtitle-text* lang) (the-as pc-subtitle-lang 1)))) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -206,103 +290,466 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun-recursive print-game-subtitle float ((str string) (font-ctxt font-context) (opaque symbol) (alpha int) (line-height int)) + "Print text. Not worth commenting until we get stack variables in lets, I think" + (local-vars + (sv-112 float) + (sv-116 float) + (sv-120 float) + (sv-124 float) + (sv-128 float) + (sv-132 float) + (sv-136 float) + (sv-140 (pointer uint8)) + (sv-144 float) + (sv-148 float) + (sv-152 float) + (sv-156 float) + (sv-160 float) + (sv-164 float) + (sv-168 int) + (sv-176 int) + (sv-184 int) + (sv-192 int) + (sv-200 int) + (sv-208 symbol) + (sv-212 symbol) + ) + (let ((gp-0 (new + 'stack + 'font-context + *font-default-matrix* + (the int (-> font-ctxt origin x)) + (the int (-> font-ctxt origin y)) + 0.0 + (font-color default) + (font-flags shadow kerning) + ) + ) + ) + (when (< 0.1 (-> font-ctxt scale)) + (set! sv-112 (-> font-ctxt mat vector 0 x)) + (set! sv-116 (-> font-ctxt mat vector 1 y)) + (set! sv-120 (-> *video-parms* relative-x-scale)) + (set! sv-124 (-> *video-parms* relative-y-scale)) + (set! sv-128 (-> *video-parms* relative-x-scale-reciprical)) + (set! sv-132 (-> *video-parms* relative-y-scale-reciprical)) + (set! sv-136 (-> font-ctxt scale)) + (set! (-> gp-0 origin z) (-> font-ctxt origin z)) + (set! (-> gp-0 flags) (-> font-ctxt flags)) + (set! (-> gp-0 color) (-> font-ctxt color)) + (set! (-> gp-0 scale) sv-136) + (when (logtest? (-> gp-0 flags) (font-flags left)) + (logclear! (-> gp-0 flags) (font-flags left)) + (let ((f30-0 (-> gp-0 width)) + (f28-0 (-> gp-0 height)) + ) + (set! (-> gp-0 width) (-> font-ctxt width)) + (set! (-> gp-0 height) (-> font-ctxt height)) + (+! (-> gp-0 origin y) + (the float (the int (* 0.5 (- (-> gp-0 height) (print-game-subtitle str gp-0 #t 128 22))))) + ) + (set! (-> gp-0 width) f30-0) + (set! (-> gp-0 height) f28-0) + ) + ) + (set! (-> gp-0 mat vector 0 x) (* (-> gp-0 mat vector 0 x) sv-136)) + (set! (-> gp-0 mat vector 1 y) (* (-> gp-0 mat vector 1 y) sv-136)) + (set! (-> *video-parms* relative-x-scale) (* (-> *video-parms* relative-x-scale) sv-136)) + (set! (-> *video-parms* relative-y-scale) (* (-> *video-parms* relative-y-scale) sv-136)) + (set! (-> *video-parms* relative-x-scale-reciprical) (/ 1.0 (-> *video-parms* relative-x-scale))) + (set! (-> *video-parms* relative-y-scale-reciprical) (/ 1.0 sv-136)) + (set! sv-140 (-> str data)) + (set! sv-144 (-> gp-0 origin x)) + (set! sv-148 (-> gp-0 origin x)) + (set! sv-152 (+ (-> gp-0 origin x) (-> font-ctxt width))) + (set! sv-156 (+ (-> gp-0 origin y) (-> font-ctxt height))) + (set! sv-160 (* (get-string-length " " gp-0) (-> *video-parms* relative-x-scale))) + (set! sv-164 (* (if (logtest? (-> gp-0 flags) (font-flags large)) + (the float line-height) + 14.0 + ) + sv-136 + ) + ) + (set! sv-168 0) + (if (logtest? (-> gp-0 flags) (font-flags middle)) + (+! (-> gp-0 origin x) (* 0.5 (-> font-ctxt width))) + ) + (set! sv-176 (the-as int (-> sv-140 0))) + (set! sv-184 0) + (set! sv-192 0) + (set! sv-200 0) + (set! sv-208 (the-as symbol #f)) + (set! sv-212 (the-as symbol #f)) + (set! (-> *game-text-line* data 0) (the-as uint 0)) + (while (or (not (and (zero? sv-176) (zero? sv-184) (zero? sv-192))) (>= sv-156 (-> gp-0 origin y))) + (cond + ((= sv-176 32) + (set! (-> *game-text-word* data sv-184) (the-as uint sv-176)) + (set! sv-184 (+ sv-184 1)) + (set! sv-208 #t) + ) + ((zero? sv-176) + (if (zero? sv-184) + (set! sv-212 #t) + (set! sv-208 #t) + ) + ) + (else + (if (= sv-176 95) + (set! sv-176 32) + ) + (set! (-> *game-text-word* data sv-184) (the-as uint sv-176)) + (set! sv-184 (+ sv-184 1)) + ) + ) + (when (= sv-208 #t) + (set! (-> *game-text-word* data sv-184) (the-as uint 0)) + (let* ((f30-1 sv-144) + (f0-49 (* (get-string-length *game-text-word* gp-0) (-> *video-parms* relative-x-scale))) + (f1-14 (+ f30-1 f0-49)) + ) + (if (= (-> *game-text-word* data (+ sv-184 -1)) 32) + (set! f1-14 (- f1-14 sv-160)) + ) + (cond + ((< sv-152 f1-14) + (set! sv-144 (+ sv-148 f0-49)) + (set! sv-212 #t) + ) + (else + (set! sv-144 (+ sv-144 f0-49)) + ) + ) + ) + ) + (when (= sv-212 #t) + (when (>= sv-200 (the-as int (-> gp-0 start-line))) + (let ((f30-2 (+ (-> gp-0 origin y) sv-164))) + (when (>= sv-156 f30-2) + (when (= (-> *game-text-line* data (+ sv-192 -1)) 32) + (set! (-> *game-text-line* data (+ sv-192 -1)) (the-as uint 0)) + (when (and (= (-> *game-text-line* data (+ sv-192 -5)) 126) (= (-> *game-text-line* data (+ sv-192 -2)) 72)) + (set! (-> *game-text-line* data (+ sv-192 -5)) (the-as uint 0)) + 0 + ) + ) + ) + (when (and (= (-> *game-text-line* data (+ sv-192 -4)) 126) (= (-> *game-text-line* data (+ sv-192 -1)) 72)) + (set! (-> *game-text-line* data (+ sv-192 -4)) (the-as uint 0)) + 0 + ) + (if (nonzero? (-> *game-text-line* data 0)) + (set! sv-168 (+ sv-168 1)) + ) + (when (not opaque) + (let* ((s1-1 (-> *display* frames (-> *display* on-screen) frame global-buf)) + (s2-1 (-> s1-1 base)) + ) + (set-font-color-alpha (-> font-ctxt color) alpha) + (draw-string *game-text-line* s1-1 gp-0) + (set-font-color-alpha (-> font-ctxt color) 128) + (set! (-> gp-0 color) (-> *font-work* last-color)) + (let ((a3-3 (-> s1-1 base))) + (let ((v1-127 (the-as object (-> s1-1 base)))) + (set! (-> (the-as dma-packet v1-127) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-127) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-127) vif1) (new 'static 'vif-tag)) + (set! (-> s1-1 base) (&+ (the-as pointer v1-127) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) frame bucket-group) + (bucket-id subtitle) + s2-1 + (the-as (pointer dma-tag) a3-3) + ) + ) + ) + ) + (set! (-> gp-0 origin y) f30-2) + ) + ) + (set! sv-200 (+ sv-200 1)) + (set! (-> *game-text-line* data 0) (the-as uint 0)) + (set! sv-192 0) + (set! sv-212 (the-as symbol #f)) + ) + (when (= sv-208 #t) + (copy-charp<-charp (&-> *game-text-line* data sv-192) (-> *game-text-word* data)) + (set! sv-192 (+ sv-192 sv-184)) + (set! sv-184 0) + (set! sv-208 (the-as symbol #f)) + ) + (when (nonzero? sv-176) + (set! sv-140 (&-> sv-140 1)) + (set! sv-176 (the-as int (-> sv-140 0))) + ) + ) + (set! (-> gp-0 mat vector 0 x) sv-112) + (set! (-> gp-0 mat vector 1 y) sv-116) + (set! (-> *video-parms* relative-x-scale) sv-120) + (set! (-> *video-parms* relative-y-scale) sv-124) + (set! (-> *video-parms* relative-x-scale-reciprical) sv-128) + (set! (-> *video-parms* relative-y-scale-reciprical) sv-132) + (if (> sv-168 0) + (* sv-164 (the float sv-168)) + 0.0 + ) + ) + ) + ) + + + (defmethod subtitle-format subtitle ((obj subtitle) (keyframe subtitle-keyframe)) "check settings and format subtitle accordingly." - + (cond ((= 0 (length (-> keyframe speaker))) + ;; there's no speaker so who cares. (string-format "~S" (-> keyframe string)) ) ((or (= #t (-> *pc-settings* subtitle-speaker?)) - (and (= 'auto (-> *pc-settings* subtitle-speaker?)) (-> keyframe offscreen))) + (and (= 'auto (-> *pc-settings* subtitle-speaker?)) (subtitle-flags? keyframe offscreen))) + ;; there is a speaker and we do want it. (string-format "~3L~S:~0L ~S" (-> keyframe speaker) (-> keyframe string)) ) (else (string-format "~S" (-> keyframe string)) ) ) - + ) -(defun subtitle? () +(defun subtitle? ((hinttitles? symbol)) "can a subtitle be displayed right now?" - (and (-> *pc-settings* subtitles?) ;; subtitles enabled + (and (or (and (not hinttitles?) (-> *pc-settings* subtitles?)) ;; subtitles enabled + (and hinttitles? (-> *pc-settings* hinttitles?))) (or *debug-segment* (= *master-mode* 'game)) ;; current mode is game, OR we are just debugging + (not *progress-process*) ;; no progress open ) ) +(defun subtitle-str-adjust ((pos int)) + (if (< pos 0) -1 (/ pos PC_SUBTITLE_STR_ADJUST))) + (defstate subtitle-process (subtitle) - + :event (behavior ((from process) (argc int) (msg symbol) (block event-message-block)) (case msg (('subtitle-start) 0 ) + (('debug) + (go subtitle-debug) + ) ) ) + :code (behavior () (loop (suspend)) ) + :trans (behavior () - (load-subtitle-text-info PC_SUBTITLE_FILE_NAME '*subtitle-text* *subtitle-text-heap*) + (load-level-subtitle-files 0) ;; reset params + (set! (-> self want-subtitle) (the subtitle-keyframe #f)) + (set! (-> self hint-subtitle?) #f) (set! (-> self spool-name) #f) (set! (-> self cur-channel) (pc-subtitle-channel invalid)) - (none)) - :post (behavior () + ;; check what kind of subtitles are running - (when (and (movie?) (-> *art-control* spool-lock) (-> *art-control* active-stream)) - ;; there's a cutscene happening and an active spool with a valid owner. - (set! (-> self spool-name) (-> *art-control* active-stream)) - (set! (-> self cur-channel) (pc-subtitle-channel movie)) - (with-proc ((handle->process (-> *art-control* spool-lock))) - (format *stdcon* "current spool frame is ~D~%" (the int (ja-aframe-num 0))) + (cond + ((and (movie?) (-> *art-control* spool-lock) (-> *art-control* active-stream)) + ;; there's a cutscene happening and an active spool with a valid owner. + (set! (-> self spool-name) (-> *art-control* active-stream)) + (set! (-> self cur-channel) (pc-subtitle-channel movie)) + (with-proc ((handle->process (-> *art-control* spool-lock))) + (if *debug-segment* + (format *stdcon* "movie spool detected:~%~3L~A~0L~%current spool frame is ~3L~D~0L~%" + (-> *art-control* active-stream) (the int (ja-aframe-num 0))) + ) + ) + ) + (*hint-semaphore* + ;; there's a hint playing + (set! (-> self spool-name) (-> *hint-semaphore* 0 sound-to-play)) + (unless (-> self spool-name) + (set! (-> self spool-name) *level-hint-spool-name*)) + (set! (-> self text-id) (-> *hint-semaphore* 0 text-id-to-display)) + (set! (-> self cur-channel) (if (-> self spool-name) + (pc-subtitle-channel hint-named) + (pc-subtitle-channel hint))) + (if *debug-segment* + (format *stdcon* "hint detected!~%~3L~A~0L/~3L#x~X~0L~%current str pos is ~D (~3L~D~0L)~%" + (-> self spool-name) (-> self text-id) + (current-str-pos (-> *hint-semaphore* 0 sound-id)) + (subtitle-str-adjust (current-str-pos (-> *hint-semaphore* 0 sound-id)))) + ) ) ) - + ;; do subtitles - (case (-> self cur-channel) - (((pc-subtitle-channel movie)) - ;; cutscenes, check if user toggled subtitles - (if (and (= 'game *master-mode*) (cpad-pressed? 0 square)) - (not! (-> *pc-settings* subtitles?))) - (when (subtitle?) - ;; subtitles on! get a subtitle info that matches our current cutscene, and find at what point we're in. - (let ((scene (get-scene-by-name *subtitle-text* (-> self cur-channel) (-> self spool-name)))) - (when scene - ;; got a scene! get closest subtitle now. - (let ((pos 0) - (keyframe (the subtitle-keyframe #f))) - ;; get frame num - (with-proc ((handle->process (-> *art-control* spool-lock))) - (set! pos (the int (ja-aframe-num 0))) - ) - ;; find closest keyframe - (dotimes (i (-> scene length)) - (when (>= pos (-> scene keyframes i frame)) - (set! keyframe (-> scene keyframes i))) - ) - (when keyframe - ;; we got the closest keyframe! finally just render the subtitles! - (print-game-text (subtitle-format self keyframe) (-> self font) #f 128 22) - (#when PC_SUBTITLE_DEBUG - (draw-debug-text-box (-> self font)) - ) - ) - ) + + ;; get a subtitle info that matches our current status + (let ((keyframe (the subtitle-keyframe #f))) + (case (-> self cur-channel) + (((pc-subtitle-channel movie)) + ;; cutscenes. get our cutscene. + (set! (-> self hint-subtitle?) #f) + (awhen (get-scene-by-name *subtitle-text* (-> self cur-channel) (-> self spool-name)) + + ;; find out position in the scene. + (let ((pos 0)) + ;; get frame num + (with-proc ((handle->process (-> *art-control* spool-lock))) + (set! pos (the int (ja-aframe-num 0))) + ) + ;; find closest keyframe + (dotimes (i (-> it length)) + (when (>= pos (-> it keyframes i frame)) + (set! keyframe (-> it keyframes i))) + ) ) ) - + ;; keep this for later (set! (-> self old-spool-name) (-> self spool-name)) ) + (((pc-subtitle-channel hint) (pc-subtitle-channel hint-named)) + ;; hint! find it. or else. + (set! (-> self hint-subtitle?) #t) + (awhen (if (= (-> self cur-channel) (pc-subtitle-channel hint-named)) + (get-scene-by-name *subtitle-text* (-> self cur-channel) (-> self spool-name)) + (get-scene-by-text-id *subtitle-text* (-> self cur-channel) (-> self text-id)) + ) + + (let ((pos (subtitle-str-adjust (current-str-pos (-> *hint-semaphore* 0 sound-id))))) + ;; find closest keyframe + (dotimes (i (-> it length)) + (when (>= pos (-> it keyframes i frame)) + (set! keyframe (-> it keyframes i))) + ) + ) + ) + ) + ) + + ;; save whatever subtitle we got. + (set! (-> self want-subtitle) keyframe)) + + ;; during a cutscene, check if user toggled subtitles + (if (and (= (pc-subtitle-channel movie) (-> self cur-channel)) + (= 'game *master-mode*) + (-> self want-subtitle) + (cpad-pressed? 0 square)) + (not! (-> *pc-settings* subtitles?))) + + (when *debug-segment* + (when (and (cpad-hold? 0 l3) (cpad-pressed? 0 start)) + (cpad-clear! 0 start) + (send-event self 'debug) + ) + + ) + + (none)) + + :post (behavior () + + ;; set font settings. + (set! (-> self font origin x) (* (- 1.0 (-> *SUBTITLE-bank* width)) 256)) + (set! (-> self font origin y) (* (-> *SUBTITLE-bank* height) 224)) + (set-width! (-> self font) (the int (* (-> *SUBTITLE-bank* width) 512))) + (set-height! (-> self font) (the int (* (-> *SUBTITLE-bank* lines) 11))) + (set-scale! (-> self font) (-> *SUBTITLE-bank* scale)) + + (when (and (-> self want-subtitle) (subtitle? (-> self hint-subtitle?))) + ;; we got a valid subtitle! render it. + (hide-bottom-hud) + (print-game-subtitle (subtitle-format self (-> self want-subtitle)) (-> self font) #f 128 22) + (#when PC_SUBTITLE_DEBUG + (draw-debug-text-box (-> self font)) + ) + ) + 0) + + ) + + + +(defstate subtitle-debug (subtitle) + + + :event (behavior ((from process) (argc int) (msg symbol) (block event-message-block)) + (case msg + (('debug) + (go subtitle-process) + ) ) ) - 0) - - ) + + :enter (behavior () + (mem-copy! (the pointer (-> self bank-backup)) (the pointer *SUBTITLE-bank*) (size-of subtitle-bank)) + (set-master-mode 'pause) + ) + :exit (behavior () + (toggle-pause) (none)) ;; todo fuck + + :trans (behavior () + + (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) + (bucket-id debug)) + + (draw-string-xy "~3LSUBTITLE DEBUG!~0L" buf 16 40 (font-color default) (font-flags shadow kerning)) + (draw-string-xy "Square: reset" buf 16 48 (font-color default) (font-flags shadow kerning)) + (draw-string-xy "Up/down: Move vertically" buf 16 56 (font-color default) (font-flags shadow kerning)) + (draw-string-xy "Triangle+R1/L1: width" buf 16 64 (font-color default) (font-flags shadow kerning)) + (draw-string-xy "Triangle+R2/L2: height" buf 16 72 (font-color default) (font-flags shadow kerning)) + (draw-string-xy "Circle+R1/L1: scale" buf 16 80 (font-color default) (font-flags shadow kerning)) + (draw-string-xy "L3+Start: exit" buf 16 88 (font-color default) (font-flags shadow kerning)) + + ) + + (when (= 'pause *master-mode*) + (when (cpad-pressed? 0 square) + (mem-copy! (the pointer *SUBTITLE-bank*) (the pointer (-> self bank-backup)) (size-of subtitle-bank)) + ) + + (when (cpad-hold? 0 up) (+! (-> *SUBTITLE-bank* height) -0.01)) + (when (cpad-hold? 0 down) (+! (-> *SUBTITLE-bank* height) 0.01)) + + (cond + ((cpad-hold? 0 triangle) + (when (cpad-hold? 0 r1) (-! (-> *SUBTITLE-bank* width) 0.01)) + (when (cpad-hold? 0 l1) (+! (-> *SUBTITLE-bank* width) 0.01)) + (when (cpad-hold? 0 r2) (-! (-> *SUBTITLE-bank* lines) 0.05)) + (when (cpad-hold? 0 l2) (+! (-> *SUBTITLE-bank* lines) 0.05)) + ) + ((cpad-hold? 0 circle) + (when (cpad-hold? 0 r1) (+! (-> *SUBTITLE-bank* scale) 0.01)) + (when (cpad-hold? 0 l1) (-! (-> *SUBTITLE-bank* scale) 0.01)) + ) + ) + ) + + (when (and (cpad-hold? 0 l3) (cpad-pressed? 0 start)) + (cpad-clear! 0 start) + (send-event self 'debug) + ) + + (none)) + + :code (-> subtitle-process code) + :post (-> subtitle-process post) + + ) + + @@ -323,11 +770,19 @@ ) +(defbehavior subtitle-init-by-other subtitle () + "external initializer for subtitle process" + + (set! (-> self font) (new 'process 'font-context *font-default-matrix* + 0 0 0.0 (font-color default) (font-flags shadow kerning middle large))) + (go subtitle-process) + ) + (defun subtitle-stop () "kill the subtitle process" - (kill-by-type subtitle *active-pool*) + (kill-by-type subtitle *display-pool*) (set! *subtitle* (the (pointer subtitle) #f))) (defun subtitle-start () @@ -336,28 +791,14 @@ (when *subtitle* (subtitle-stop) ) - - (set! *subtitle* (make-init-process subtitle - (lambda :behavior subtitle () - (set! (-> self font) (new 'process 'font-context *font-default-matrix* - (the int (* 0.12 256)) (+ 112 (* 11 5)) 0.0 - (font-color default) - (font-flags shadow kerning middle large))) - (set-scale! (-> self font) 0.5) - (set-width! (-> self font) (the int (* 0.88 256 2))) - (set-height! (-> self font) (* 11 3)) - (go subtitle-process) - ) - :from *pc-dead-pool* :to *active-pool* - :stack-size (* 1 1024))) + + (set! *subtitle* (process-spawn subtitle :from *pc-dead-pool* :to *display-pool* + :stack-size PC_PROC_DEFAULT_STACK_SIZE)) ) -;; start the subtitle process +;; start the subtitle process when this file loads. (subtitle-start) -) - - diff --git a/goal_src/pc_debug/font-encode-test.gc b/goal_src/pc_debug/font-encode-test.gc index 69cdc4342c..05809eef87 100644 --- a/goal_src/pc_debug/font-encode-test.gc +++ b/goal_src/pc_debug/font-encode-test.gc @@ -38,7 +38,7 @@ "start the encode test proc" (unless (process-by-name 'font-encode *active-pool*) - (make-function-process process :name 'font-encode + (process-spawn-function process :name 'font-encode (lambda :behavior process () (stack-size-set! (-> self main-thread) 768) diff --git a/goal_src/pc_debug/pc-pad-utils.gc b/goal_src/pc_debug/pc-pad-utils.gc index 9d935aca66..fd00295898 100644 --- a/goal_src/pc_debug/pc-pad-utils.gc +++ b/goal_src/pc_debug/pc-pad-utils.gc @@ -95,14 +95,42 @@ (if (not (handle->process (-> *pc-pad-proc-list* show))) (let ((procp - (make-function-process pc-pad-proc :name 'pc-pad-show + (process-spawn-function pc-pad-proc :name 'pc-pad-show (lambda :behavior pc-pad-proc () (stack-size-set! (-> self main-thread) 512) + (format #t "Reference keycode constants at https://www.glfw.org/docs/latest/group__keys.html~%") (loop + (dotimes (_ 9) + (format *stdcon* "~%") + ) (dotimes (ii 2) - (format *stdcon* "~3Lcpad ~D~0L~%" ii) - (dotimes (i 16) - (format *stdcon* " ~S: ~32L~D~0L~%" (-> *pc-pad-button-names* i) (pc-pad-get-mapped-button ii i)) + (format *stdcon* " ~0k~3Lcpad ~D~0L~%" ii) + (dotimes (j 8) + (dotimes (i 2) + (format *stdcon* " ") + (let* ( + (btn-idx (+ i(* j 2))) + (btn-name (-> *pc-pad-button-names* btn-idx)) + (keycode (pc-pad-get-mapped-button ii btn-idx)) + ) + (format *stdcon* "~8L~S: " btn-name) + ;; longest button string is TRIANGLE, which is 8 characters in length + ;; but only shows up in the left column. CIRCLE and SQUARE are longest in the right with 6 + (dotimes (_ (- + (cond ((= i 0) 8) ((= i 1) 6)) + (length btn-name))) + (format *stdcon* " ") + ) + (format *stdcon* "~0L~D" keycode) + (when (< keycode 100) + (format *stdcon* " ") + (if (< keycode 10) + (format *stdcon* " ") + ) + ) + ) + ) + (format *stdcon* "~%") ) ) (suspend) @@ -128,8 +156,8 @@ (if (not (handle->process (-> *pc-pad-proc-list* input))) (let ((procp - (make-init-process pc-pad-proc :name 'pc-pad-input - (lambda :behavior pc-pad-proc ((pad-idx int)) + (process-spawn pc-pad-proc :name 'pc-pad-input + :init (lambda :behavior pc-pad-proc ((pad-idx int)) (set! (-> self pad-idx) pad-idx) (pc-pad-input-mode-set #t) (pc-pad-input-pad-set (-> self pad-idx)) @@ -160,7 +188,7 @@ (defbehavior pc-pi-post pc-pad-proc () (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string-xy (string-format "MAPPING PAD ~D" (-> self pad-idx)) buf 256 PC_PAD_TOP_Y (font-color red) (font-flags shadow kerning large middle)) ) @@ -181,7 +209,7 @@ (set-state-time) (until (time-passed? PC_PAD_INPUT_NOTICE_TIME) (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string-xy (string-format "MAPPED ~D TO ~S!" (pc-pad-input-key-get) (-> *pc-pad-button-names* (1- (-> self input-index)))) buf 256 (+ PC_PAD_TOP_Y 64) (font-color green) (font-flags shadow kerning large middle)) @@ -207,7 +235,7 @@ (set-state-time) (until (time-passed? PC_PAD_INPUT_NOTICE_TIME) (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string-xy "CANCELED!" buf 256 (+ PC_PAD_TOP_Y 64) (font-color red-reverse) (font-flags shadow kerning large middle)) ) (suspend) @@ -223,7 +251,7 @@ (set-state-time) (until (time-passed? PC_PAD_INPUT_NOTICE_TIME) (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string-xy (string-format "MAPPED ~D TO ~S!" (pc-pad-input-key-get) (-> *pc-pad-button-names* (1- (-> self input-index)))) buf 256 (+ PC_PAD_TOP_Y 64) (font-color green) (font-flags shadow kerning large middle)) @@ -233,7 +261,7 @@ (set-state-time) (until (time-passed? PC_PAD_INPUT_NOTICE_TIME) (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string-xy (string-format "KEY MAPPING COMPLETE!~%SETTINGS SAVED.") buf 256 (+ PC_PAD_TOP_Y 64) (font-color green) (font-flags shadow kerning large middle)) ) (suspend) @@ -246,7 +274,7 @@ :code (behavior () (loop (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string-xy "PRESS ESCAPE TO EXIT" buf 256 (+ PC_PAD_TOP_Y 32) (font-color default) (font-flags shadow kerning large middle)) (draw-string-xy (string-format "PRESS KEY FOR ~S" (-> *pc-pad-button-names* (-> self input-index))) buf 256 (+ PC_PAD_TOP_Y 64) (font-color default) (font-flags shadow kerning large middle)) diff --git a/goalc/CMakeLists.txt b/goalc/CMakeLists.txt index 4b0c61fc5d..40aa875e4b 100644 --- a/goalc/CMakeLists.txt +++ b/goalc/CMakeLists.txt @@ -5,6 +5,16 @@ add_library(compiler emitter/ObjectGenerator.cpp emitter/Register.cpp debugger/disassemble.cpp + build_level/build_level.cpp + build_level/collide_bvh.cpp + build_level/collide_drawable.cpp + build_level/collide_pack.cpp + build_level/color_quantization.cpp + build_level/FileInfo.cpp + build_level/gltf_mesh_extract.cpp + build_level/LevelFile.cpp + build_level/ResLump.cpp + build_level/Tfrag.cpp compiler/Compiler.cpp compiler/Env.cpp compiler/Val.cpp @@ -15,6 +25,7 @@ add_library(compiler compiler/compilation/Asm.cpp compiler/compilation/Atoms.cpp compiler/compilation/CompilerControl.cpp + compiler/compilation/ConstantPropagation.cpp compiler/compilation/Block.cpp compiler/compilation/Macro.cpp compiler/compilation/Math.cpp @@ -26,11 +37,10 @@ add_library(compiler compiler/compilation/State.cpp compiler/compilation/Static.cpp compiler/Util.cpp - data_compiler/game_text.cpp + data_compiler/game_text_common.cpp data_compiler/dir_tpages.cpp - data_compiler/DataObjectGenerator.cpp data_compiler/game_count.cpp - data_compiler/game_subtitle.cpp + data_compiler/DataObjectGenerator.cpp debugger/Debugger.cpp debugger/DebugInfo.cpp listener/Listener.cpp @@ -44,7 +54,7 @@ add_library(compiler regalloc/Allocator_v2.cpp ) -target_link_libraries(compiler common Zydis) +target_link_libraries(compiler common Zydis tiny_gltf) if (WIN32) target_link_libraries(compiler mman) diff --git a/goalc/build_level/FileInfo.cpp b/goalc/build_level/FileInfo.cpp new file mode 100644 index 0000000000..229a674573 --- /dev/null +++ b/goalc/build_level/FileInfo.cpp @@ -0,0 +1,32 @@ +#include "FileInfo.h" + +#include "common/versions.h" + +#include "goalc/data_compiler/DataObjectGenerator.h" + +size_t FileInfo::add_to_object_file(DataObjectGenerator& gen) const { + gen.align_to_basic(); + gen.add_type_tag("file-info"); + size_t offset = gen.current_offset_bytes(); + gen.add_type_tag(file_type); + gen.add_ref_to_string_in_pool(file_name); + gen.add_word(major_version); + gen.add_word(minor_version); + gen.add_ref_to_string_in_pool(maya_file_name); + gen.add_ref_to_string_in_pool(tool_debug); + gen.add_ref_to_string_in_pool(tool_debug); + + return offset; +} + +FileInfo make_file_info_for_level(const std::string& file_name) { + FileInfo info; + info.file_type = "bsp-header"; + info.file_name = file_name; + info.major_version = versions::jak1::LEVEL_FILE_VERSION; + info.minor_version = 0; + info.maya_file_name = "Unknown"; + info.tool_debug = "Created by OpenGOAL buildlevel"; + info.mdb_file_name = "Unknown"; + return info; +} \ No newline at end of file diff --git a/goalc/build_level/FileInfo.h b/goalc/build_level/FileInfo.h new file mode 100644 index 0000000000..7932018ca1 --- /dev/null +++ b/goalc/build_level/FileInfo.h @@ -0,0 +1,28 @@ +#pragma once + +#include + +#include "common/common_types.h" + +class DataObjectGenerator; + +struct FileInfo { + // (file-type symbol :offset-assert 4) + std::string file_type; + // (file-name basic :offset-assert 8) + std::string file_name; + // (major-version uint32 :offset-assert 12) + u32 major_version = 0; + // (minor-version uint32 :offset-assert 16) + u32 minor_version = 0; + // (maya-file-name basic :offset-assert 20) + std::string maya_file_name; + // (tool-debug basic :offset-assert 24) + std::string tool_debug; + // (mdb-file-name basic :offset-assert 28) + std::string mdb_file_name; + + size_t add_to_object_file(DataObjectGenerator& gen) const; +}; + +FileInfo make_file_info_for_level(const std::string& file_name); \ No newline at end of file diff --git a/goalc/build_level/LevelFile.cpp b/goalc/build_level/LevelFile.cpp new file mode 100644 index 0000000000..92a931707e --- /dev/null +++ b/goalc/build_level/LevelFile.cpp @@ -0,0 +1,106 @@ +#include "LevelFile.h" + +#include "goalc/data_compiler/DataObjectGenerator.h" + +size_t DrawableTreeArray::add_to_object_file(DataObjectGenerator& gen) const { + /* + (deftype drawable-tree-array (drawable-group) + ((trees drawable-tree 1 :offset 32 :score 100)) + :flag-assert #x1200000024 + ) + (deftype drawable-group (drawable) + ((length int16 :offset 6) + (data drawable 1 :offset-assert 32) + ) + (:methods + (new (symbol type int) _type_) + ) + :flag-assert #x1200000024 + ) + */ + gen.align_to_basic(); + gen.add_type_tag("drawable-tree-array"); + size_t result = gen.current_offset_bytes(); + int num_trees = 0; + num_trees += tfrags.size(); + num_trees += collides.size(); + gen.add_word(num_trees << 16); + gen.add_word(0); + gen.add_word(0); + + gen.add_word(0); + gen.add_word(0); + gen.add_word(0); + gen.add_word(0); + + // todo add trees... + + if (num_trees == 0) { + gen.add_word(0); // the one at the end. + } else { + int tree_word = (int)gen.current_offset_bytes() / 4; + for (int i = 0; i < num_trees; i++) { + gen.add_word(0); + } + + for (auto& tfrag : tfrags) { + // gen.set_word(tree_word++, tfrag.add_to_object_file(gen)); + gen.link_word_to_byte(tree_word++, tfrag.add_to_object_file(gen)); + } + + for (auto& collide : collides) { + gen.link_word_to_byte(tree_word++, collide.add_to_object_file(gen)); + } + } + + return result; +} + +std::vector LevelFile::save_object_file() const { + DataObjectGenerator gen; + gen.add_type_tag("bsp-header"); + + // add blank space for the bsp-header + while (gen.words() < 100) { + gen.add_word(0); + } + + //(info file-info :offset 4) + auto file_info_slot = info.add_to_object_file(gen); + gen.link_word_to_byte(1, file_info_slot); + + //(bsphere vector :inline :offset-assert 16) + //(all-visible-list (pointer uint16) :offset-assert 32) + //(visible-list-length int32 :offset-assert 36) + //(drawable-trees drawable-tree-array :offset-assert 40) + gen.link_word_to_byte(40 / 4, drawable_trees.add_to_object_file(gen)); + //(pat pointer :offset-assert 44) + //(pat-length int32 :offset-assert 48) + //(texture-remap-table (pointer uint64) :offset-assert 52) + //(texture-remap-table-len int32 :offset-assert 56) + //(texture-ids (pointer texture-id) :offset-assert 60) + //(texture-page-count int32 :offset-assert 64) + //(unk-zero-0 basic :offset-assert 68) + //(name symbol :offset-assert 72) + gen.link_word_to_symbol(name, 72 / 4); + //(nickname symbol :offset-assert 76) + gen.link_word_to_symbol(nickname, 76 / 4); + //(vis-info level-vis-info 8 :offset-assert 80) + //(actors drawable-inline-array-actor :offset-assert 112) + //(cameras (array entity-camera) :offset-assert 116) + //(nodes (inline-array bsp-node) :offset-assert 120) + //(level level :offset-assert 124) + //(current-leaf-idx uint16 :offset-assert 128) + //(unk-data-2 uint16 9 :offset-assert 130) + //(boxes box8s-array :offset-assert 148) + //(current-bsp-back-flags uint32 :offset-assert 152) + //(ambients drawable-inline-array-ambient :offset-assert 156) + //(unk-data-4 float :offset-assert 160) + //(unk-data-5 float :offset-assert 164) + //(adgifs adgif-shader-array :offset-assert 168) + //(actor-birth-order (pointer uint32) :offset-assert 172) + //(split-box-indices (pointer uint16) :offset-assert 176) + //(unk-data-8 uint32 55 :offset-assert 180) + + return gen.generate_v2(); +} \ No newline at end of file diff --git a/goalc/build_level/LevelFile.h b/goalc/build_level/LevelFile.h new file mode 100644 index 0000000000..5ae7e48d72 --- /dev/null +++ b/goalc/build_level/LevelFile.h @@ -0,0 +1,141 @@ +#pragma once + +#include +#include +#include + +#include "common/common_types.h" + +#include "goalc/build_level/FileInfo.h" +#include "goalc/build_level/Tfrag.h" +#include "goalc/build_level/collide_bvh.h" +#include "goalc/build_level/collide_common.h" +#include "goalc/build_level/collide_drawable.h" +#include "goalc/build_level/collide_pack.h" + +struct VisibilityString { + std::vector bytes; +}; + +struct DrawableTreeInstanceTie {}; + +struct DrawableTreeActor {}; + +struct DrawableTreeAmbient {}; + +struct DrawableTreeInstanceShrub {}; + +struct DrawableTreeArray { + std::vector tfrags; + std::vector ties; + std::vector actors; // unused? + std::vector collides; + std::vector ambients; + std::vector shrubs; + size_t add_to_object_file(DataObjectGenerator& gen) const; +}; + +struct TextureRemap {}; + +struct TextureId {}; + +struct VisInfo {}; + +struct DrawableActor {}; + +struct DrawableInlineArrayActor {}; + +struct EntityCamera {}; + +struct BspNode {}; + +struct Box8s {}; + +struct DrawableAmbient {}; + +struct DrawableInlineArrayAmbient {}; + +struct AdgifShaderArray {}; + +// This is a place to collect all the data that should go into the bsp-header file. +struct LevelFile { + // (info file-info :offset 4) + FileInfo info; + + // (all-visible-list (pointer uint16) :offset-assert 32) + // (visible-list-length int32 :offset-assert 36) + VisibilityString all_visibile_list; + + // (drawable-trees drawable-tree-array :offset-assert 40) + DrawableTreeArray drawable_trees; + + // (pat pointer :offset-assert 44) + // (pat-length int32 :offset-assert 48) + std::vector pat; + + // (texture-remap-table (pointer uint64) :offset-assert 52) + // (texture-remap-table-len int32 :offset-assert 56) + std::vector texture_remap_table; + + // (texture-ids (pointer texture-id) :offset-assert 60) + // (texture-page-count int32 :offset-assert 64) + std::vector texture_ids; + + // (unk-zero-0 basic :offset-assert 68) + // "misc", seems like it can be zero and is unused. + + // (name symbol :offset-assert 72) + std::string name; // full name + + // (nickname symbol :offset-assert 76) + std::string nickname; // 3 char name + + // (vis-info level-vis-info 8 :offset-assert 80) ;; note: 0 when + std::array vis_infos; + + // (actors drawable-inline-array-actor :offset-assert 112) + DrawableInlineArrayActor actors; + + // (cameras (array entity-camera) :offset-assert 116) + std::vector cameras; + + // (nodes (inline-array bsp-node) :offset-assert 120) + std::vector nodes; + + // (level level :offset-assert 124) + // zero + + // (current-leaf-idx uint16 :offset-assert 128) + // zero + + // (unk-data-2 uint16 9 :offset-assert 130) + // looks like padding plus 4 floats? unused + + // (boxes box8s-array :offset-assert 148) + std::vector boxes; + + // (current-bsp-back-flags uint32 :offset-assert 152) + // zero + + // (ambients drawable-inline-array-ambient :offset-assert 156) + DrawableInlineArrayAmbient ambients; + + // (unk-data-4 float :offset-assert 160) + float close_subdiv = 0; + + // (unk-data-5 float :offset-assert 164) + float far_subdiv = 0; + + // (adgifs adgif-shader-array :offset-assert 168) + AdgifShaderArray adgifs; + + // (actor-birth-order (pointer uint32) :offset-assert 172) + std::vector actor_birth_order; + + // (split-box-indices (pointer uint16) :offset-assert 176) + std::vector split_box_indices; + + // (unk-data-8 uint32 55 :offset-assert 180) + + std::vector save_object_file() const; +}; \ No newline at end of file diff --git a/goalc/build_level/ResLump.cpp b/goalc/build_level/ResLump.cpp new file mode 100644 index 0000000000..541d37a11f --- /dev/null +++ b/goalc/build_level/ResLump.cpp @@ -0,0 +1,5 @@ +#include "ResLump.h" + +#include "goalc/data_compiler/DataObjectGenerator.h" + +#include "third-party/fmt/core.h" diff --git a/goalc/build_level/ResLump.h b/goalc/build_level/ResLump.h new file mode 100644 index 0000000000..865faeeefc --- /dev/null +++ b/goalc/build_level/ResLump.h @@ -0,0 +1,7 @@ +#pragma once + +#include +#include +#include + +#include "common/common_types.h" diff --git a/goalc/build_level/TexturePool.h b/goalc/build_level/TexturePool.h new file mode 100644 index 0000000000..5309eb7515 --- /dev/null +++ b/goalc/build_level/TexturePool.h @@ -0,0 +1,12 @@ +#pragma once + +#include +#include +#include + +#include "common/custom_data/Tfrag3Data.h" + +struct TexturePool { + std::unordered_map textures_by_name; + std::vector textures_by_idx; +}; \ No newline at end of file diff --git a/goalc/build_level/Tfrag.cpp b/goalc/build_level/Tfrag.cpp new file mode 100644 index 0000000000..1b0e277941 --- /dev/null +++ b/goalc/build_level/Tfrag.cpp @@ -0,0 +1,99 @@ +#include "Tfrag.h" + +#include + +#include "common/custom_data/pack_helpers.h" + +#include "goalc/build_level/gltf_mesh_extract.h" +#include "goalc/data_compiler/DataObjectGenerator.h" + +void tfrag_from_gltf(const gltf_mesh_extract::TfragOutput& mesh_extract_out, + DrawableTreeTfrag& /*out*/, + tfrag3::TfragTree& out_pc) { + out_pc.kind = tfrag3::TFragmentTreeKind::NORMAL; // todo more types? + out_pc.draws = std::move(mesh_extract_out.strip_draws); + pack_tfrag_vertices(&out_pc.packed_vertices, mesh_extract_out.vertices); + + for (auto& col : mesh_extract_out.color_palette) { + tfrag3::TimeOfDayColor todc; + for (auto& rgba : todc.rgba) { + rgba = col; + } + out_pc.colors.push_back(todc); + } + out_pc.use_strips = false; +} + +/* + +(deftype drawable-group (drawable) + ((length int16 :offset 6) + (data drawable 1 :offset-assert 32) + ) + (:methods + (new (symbol type int) _type_) + ) + :flag-assert #x1200000024 + ) + + (deftype drawable-tree (drawable-group) + () + :flag-assert #x1200000024 + ) + +(deftype drawable-inline-array (drawable) + ((length int16 :offset 6) ;; this is kinda weird. + ) + :method-count-assert 18 + :size-assert #x20 + :flag-assert #x1200000020 + ) + +(deftype drawable-inline-array-tfrag (drawable-inline-array) + ((data tfragment 1 :inline :offset-assert 32) + (pad uint32)) + :method-count-assert 18 + :size-assert #x64 + :flag-assert #x1200000064 + ) + +(deftype drawable-tree-tfrag (drawable-tree) + ((time-of-day-pal time-of-day-palette :offset 12) + (arrays drawable-inline-array 1 :offset 32 :score 100) ;; either drawable-inline-array-node +or drawable-inline-array-tfrag + ) + :method-count-assert #x12 + :size-assert #x24 + :flag-assert #x1200000024 + ) + + + */ + +size_t add_empty_dia(const std::string& name, DataObjectGenerator& gen, int total_size) { + gen.align_to_basic(); + gen.add_type_tag(name); + size_t result = gen.current_offset_bytes(); + total_size -= 4; + while (total_size > 0) { + gen.add_word(0); + total_size -= 4; + } + + return result; +} + +size_t DrawableTreeTfrag::add_to_object_file(DataObjectGenerator& gen) const { + gen.align_to_basic(); + gen.add_type_tag("drawable-tree-tfrag"); + size_t result = gen.current_offset_bytes(); + gen.add_word(1 << 16); + for (int i = 0; i < 6; i++) { + gen.add_word(0); + } + size_t slot = gen.add_word(0); + ASSERT(slot * 4 - result == 28); + gen.link_word_to_byte(slot, add_empty_dia("drawable-inline-array-tfrag", gen, 0x64)); + + return result; +} \ No newline at end of file diff --git a/goalc/build_level/Tfrag.h b/goalc/build_level/Tfrag.h new file mode 100644 index 0000000000..5fe9198a0c --- /dev/null +++ b/goalc/build_level/Tfrag.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "common/custom_data/Tfrag3Data.h" + +#include "goalc/build_level/TexturePool.h" +#include "goalc/build_level/gltf_mesh_extract.h" + +class DataObjectGenerator; + +struct DrawableTreeTfrag { + size_t add_to_object_file(DataObjectGenerator& gen) const; +}; + +void tfrag_from_gltf(const gltf_mesh_extract::TfragOutput& mesh_extract_out, + DrawableTreeTfrag& out, + tfrag3::TfragTree& out_pc); \ No newline at end of file diff --git a/goalc/build_level/build_level.cpp b/goalc/build_level/build_level.cpp new file mode 100644 index 0000000000..cc5a77a13f --- /dev/null +++ b/goalc/build_level/build_level.cpp @@ -0,0 +1,103 @@ +#include "common/custom_data/Tfrag3Data.h" +#include "common/log/log.h" +#include "common/util/FileUtil.h" +#include "common/util/compress.h" +#include "common/util/json_util.h" + +#include "goalc/build_level/FileInfo.h" +#include "goalc/build_level/LevelFile.h" +#include "goalc/build_level/Tfrag.h" +#include "goalc/build_level/collide_bvh.h" +#include "goalc/build_level/collide_pack.h" +#include "goalc/build_level/gltf_mesh_extract.h" + +#include "third-party/fmt/core.h" + +void save_pc_data(const std::string& nickname, tfrag3::Level& data) { + Serializer ser; + data.serialize(ser); + auto compressed = + compression::compress_zstd(ser.get_save_result().first, ser.get_save_result().second); + fmt::print("stats for {}\n", data.level_name); + print_memory_usage(data, ser.get_save_result().second); + fmt::print("compressed: {} -> {} ({:.2f}%)\n", ser.get_save_result().second, compressed.size(), + 100.f * compressed.size() / ser.get_save_result().second); + file_util::write_binary_file(file_util::get_file_path({fmt::format("assets/{}.fr3", nickname)}), + compressed.data(), compressed.size()); +} + +std::vector get_build_level_deps(const std::string& input_file) { + auto level_json = parse_commented_json( + file_util::read_text_file(file_util::get_file_path({input_file})), input_file); + return {level_json.at("gltf_file").get()}; +} + +bool run_build_level(const std::string& input_file, const std::string& output_file) { + auto level_json = parse_commented_json( + file_util::read_text_file(file_util::get_file_path({input_file})), input_file); + LevelFile file; // GOAL level file + tfrag3::Level pc_level; // PC level file + TexturePool tex_pool; // pc level texture pool + + // process input mesh from blender + gltf_mesh_extract::Input mesh_extract_in; + mesh_extract_in.filename = + file_util::get_file_path({level_json.at("gltf_file").get()}); + mesh_extract_in.tex_pool = &tex_pool; + gltf_mesh_extract::Output mesh_extract_out; + gltf_mesh_extract::extract(mesh_extract_in, mesh_extract_out); + + // add stuff to the GOAL level structure + file.info = make_file_info_for_level(std::filesystem::path(input_file).filename().string()); + // all vis + // drawable trees + // pat + // texture remap + // texture ids + // unk zero + // name + file.name = level_json.at("long_name").get(); + // nick + file.nickname = level_json.at("nickname").get(); + // vis infos + // actors + // cameras + // nodes + // boxes + // ambients + // subdivs + // adgifs + // actor birht + // split box + + // add stuff to the PC level structure + pc_level.level_name = file.name; + + // TFRAG + auto& tfrag_drawable_tree = file.drawable_trees.tfrags.emplace_back(); + tfrag_from_gltf(mesh_extract_out.tfrag, tfrag_drawable_tree, + pc_level.tfrag_trees[0].emplace_back()); + pc_level.textures = std::move(tex_pool.textures_by_idx); + + // COLLIDE + if (mesh_extract_out.collide.faces.empty()) { + lg::error("No collision geometry was found"); + } else { + auto& collide_drawable_tree = file.drawable_trees.collides.emplace_back(); + collide_drawable_tree.bvh = collide::construct_collide_bvh(mesh_extract_out.collide.faces); + collide_drawable_tree.packed_frags = pack_collide_frags(collide_drawable_tree.bvh.frags.frags); + } + + // Save the GOAL level + auto result = file.save_object_file(); + fmt::print("Level bsp file size {} bytes\n", result.size()); + auto save_path = file_util::get_file_path({output_file}); + file_util::create_dir_if_needed_for_file(save_path); + fmt::print("Saving to {}\n", save_path); + file_util::write_binary_file(save_path, result.data(), result.size()); + + // Save the PC level + save_pc_data(file.nickname, pc_level); + + return true; +} diff --git a/goalc/build_level/build_level.h b/goalc/build_level/build_level.h new file mode 100644 index 0000000000..e37d1ef15c --- /dev/null +++ b/goalc/build_level/build_level.h @@ -0,0 +1,7 @@ +#pragma once + +#include +#include + +bool run_build_level(const std::string& input_file, const std::string& output_file); +std::vector get_build_level_deps(const std::string& input_file); \ No newline at end of file diff --git a/goalc/build_level/collide_bvh.cpp b/goalc/build_level/collide_bvh.cpp new file mode 100644 index 0000000000..ece6a40b37 --- /dev/null +++ b/goalc/build_level/collide_bvh.cpp @@ -0,0 +1,290 @@ +#include "collide_bvh.h" + +#include + +#include "common/log/log.h" +#include "common/util/Assert.h" +#include "common/util/Timer.h" + +// Collision BVH algorithm +// We start with all the points in a single node, then recursively split nodes in 8 until no nodes +// have too many faces. +// The splitting is done by doing median cuts along the x, y, or z axis. + +// The bspheres are built at the end. + +namespace collide { + +namespace { +constexpr int MAX_FACES_IN_FRAG = 100; + +/*! + * The Collide node. + * Has either children collide node or children faces, but not both + * The size of child_nodes is either 0 or 8 at all times. + */ +struct CNode { + std::vector child_nodes; + std::vector faces; + math::Vector4f bsphere; +}; + +struct BBox { + math::Vector3f mins, maxs; + std::string sz_to_string() const { + return fmt::format("({})", ((maxs - mins) / 4096.f).to_string_aligned()); + } +}; + +/*! + * Make the bounding box hold this node and all its children. + */ +void add_to_bbox_recursive(const CNode& node, BBox& bbox) { + if (node.faces.empty()) { + for (auto& child : node.child_nodes) { + add_to_bbox_recursive(child, bbox); + } + } else { + for (auto& face : node.faces) { + for (auto& vert : face.v) { + bbox.mins.min_in_place(vert); + bbox.maxs.max_in_place(vert); + } + } + } +} + +BBox bbox_of_node(const CNode& node) { + BBox bbox; + bbox.mins.fill(std::numeric_limits::max()); + bbox.maxs.fill(-std::numeric_limits::max()); + add_to_bbox_recursive(node, bbox); + return bbox; +} + +/*! + * Make the bsphere hold this node and all its children. + */ +void update_bsphere_recursive(const CNode& node, const math::Vector3f& origin, float& r_squared) { + if (node.faces.empty()) { + for (auto& child : node.child_nodes) { + update_bsphere_recursive(child, origin, r_squared); + } + } else { + for (auto& face : node.faces) { + for (auto& vert : face.v) { + r_squared = std::max(r_squared, (vert - origin).squared_length()); + } + } + } +} + +/*! + * Compute the bsphere of a single node. + */ +void compute_my_bsphere(CNode& node) { + // first compute bbox. + BBox bbox = bbox_of_node(node); + float r = 0; + math::Vector3f origin = (bbox.maxs + bbox.mins) * 0.5; + update_bsphere_recursive(node, origin, r); + node.bsphere.x() = origin.x(); + node.bsphere.y() = origin.y(); + node.bsphere.z() = origin.z(); + node.bsphere.w() = std::sqrt(r); +} + +/*! + * Split faces in two along a coordinate plane. + * Will clear the input faces + */ +void split_along_dim(std::vector& faces, + int dim, + std::vector* out0, + std::vector* out1) { + std::sort(faces.begin(), faces.end(), [=](const CollideFace& a, const CollideFace& b) { + return a.bsphere[dim] < b.bsphere[dim]; + }); + size_t split_idx = faces.size() / 2; + out0->insert(out0->end(), faces.begin(), faces.begin() + split_idx); + out1->insert(out1->end(), faces.begin() + split_idx, faces.end()); +} + +/*! + * Split a node into two nodes. The outputs should be uninitialized nodes + */ +void split_node_once(CNode& node, CNode* out0, CNode* out1) { + CNode temps[6]; + // split_along_dim(node.faces, pick_dim_for_split(node.faces), &out0->faces, &out1->faces); + split_along_dim(node.faces, 0, &temps[0].faces, &temps[1].faces); + split_along_dim(node.faces, 1, &temps[2].faces, &temps[3].faces); + split_along_dim(node.faces, 2, &temps[4].faces, &temps[5].faces); + node.faces.clear(); + for (auto& t : temps) { + compute_my_bsphere(t); + } + + float max_bspheres[3] = {0, 0, 0}; + for (int i = 0; i < 3; i++) { + max_bspheres[i] = std::max(temps[i * 2].bsphere.w(), temps[i * 2 + 1].bsphere.w()); + } + + int best_dim = 0; + float best_w = max_bspheres[0]; + for (int i = 0; i < 3; i++) { + if (max_bspheres[i] < best_w) { + best_dim = i; + best_w = max_bspheres[i]; + } + } + + *out0 = temps[best_dim * 2]; + *out1 = temps[best_dim * 2 + 1]; +} + +/*! + * Split a node into 8 children and store these in the given node. + */ +void split_node_to_8_children(CNode& node) { + ASSERT(node.child_nodes.empty()); + node.child_nodes.resize(8); + // level 0 + CNode level0[2]; + split_node_once(node, &level0[0], &level0[1]); + // level 1 + CNode level1[4]; + split_node_once(level0[0], &level1[0], &level1[1]); + split_node_once(level0[1], &level1[2], &level1[3]); + // level 2 + split_node_once(level1[0], &node.child_nodes[0], &node.child_nodes[1]); + split_node_once(level1[1], &node.child_nodes[2], &node.child_nodes[3]); + split_node_once(level1[2], &node.child_nodes[4], &node.child_nodes[5]); + split_node_once(level1[3], &node.child_nodes[6], &node.child_nodes[7]); +} + +struct SplitResult { + size_t max_leaf_count = 0; + float max_bsphere_w = 0; +}; +/*! + * Split all leaf nodes. Returns the number of faces in the leaf with the most faces after + * splitting. + * This slightly unusual recursion pattern is to make sure we split everything to same depth, + * which we believe might be a requirement of the collision system. + */ +SplitResult split_all_leaves(CNode& node) { + SplitResult result; + if (node.child_nodes.empty()) { + // we're a leaf! + // split us: + split_node_to_8_children(node); + for (auto& child : node.child_nodes) { + result.max_leaf_count = std::max(result.max_leaf_count, child.faces.size()); + result.max_bsphere_w = std::max(result.max_bsphere_w, child.bsphere.w()); + } + return result; + } else { + // not a leaf, recurse + for (auto& child : node.child_nodes) { + auto cret = split_all_leaves(child); + result.max_bsphere_w = std::max(result.max_bsphere_w, cret.max_bsphere_w); + result.max_leaf_count = std::max(result.max_leaf_count, cret.max_leaf_count); + } + return result; + } +} + +/*! + * Main BVH construction function. Splits leaves until it is no longer needed. + */ +void split_as_needed(CNode& root) { + int initial_tri_count = root.faces.size(); + int num_leaves = 1; + bool need_to_split = true; + while (need_to_split) { + SplitResult worst = split_all_leaves(root); + num_leaves *= 8; + lg::info("after splitting, the worst leaf has {} tris, {} radius", worst.max_leaf_count, + worst.max_bsphere_w / 4096.f); + if (worst.max_leaf_count < MAX_FACES_IN_FRAG && worst.max_bsphere_w < (100.f * 4096.f)) { + need_to_split = false; + } + } + lg::info("average triangles per leaf: {}", initial_tri_count / num_leaves); + lg::info("leaf count: {}", num_leaves); +} + +/*! + * Recursively compute bspheres of all children + * (note that we don't do bspheres of bspheres... I think this is better?) + */ +void bsphere_recursive(CNode& node) { + compute_my_bsphere(node); + for (auto& child : node.child_nodes) { + bsphere_recursive(child); + } +} + +void drawable_layout_helper(CNode& node, int depth, CollideTree& tree_out, size_t my_idx_check) { + if (node.child_nodes.empty()) { + // we're a leaf! add us to the frags + auto& frag = tree_out.frags.frags.emplace_back(); + frag.bsphere = node.bsphere; + frag.faces = node.faces; + } else { + // not a leaf + if ((int)tree_out.node_arrays.size() <= depth) { + tree_out.node_arrays.resize(depth + 1); + } + ASSERT(my_idx_check == tree_out.node_arrays.at(depth).nodes.size()); + auto& draw_node = tree_out.node_arrays[depth].nodes.emplace_back(); + draw_node.bsphere = node.bsphere; + for (int i = 0; i < 8; i++) { + draw_node.children[i] = my_idx_check * 8 + i; + drawable_layout_helper(node.child_nodes.at(i), depth + 1, tree_out, draw_node.children[i]); + } + } +} + +CollideTree build_collide_tree(CNode& root) { + CollideTree tree; + drawable_layout_helper(root, 0, tree, 0); + return tree; +} + +void debug_stats(const CollideTree& tree) { + lg::info("Tree build: {} draw node layers", tree.node_arrays.size()); + float sum_w = 0, max_w = 0; + for (auto& frag : tree.frags.frags) { + sum_w += frag.bsphere.w(); + max_w = std::max(frag.bsphere.w(), max_w); + } + lg::info("Max bsphere radius: {:.2f}m, average {:.2f} (aiming for around 20-30m avg)", + max_w / 4096, sum_w / (4096 * tree.frags.frags.size())); +} + +} // namespace + +CollideTree construct_collide_bvh(const std::vector& tris) { + // part 1: build the tree + Timer bvh_timer; + lg::info("Building collide bvh from {} triangles", tris.size()); + CNode root; + root.faces = tris; + split_as_needed(root); + lg::info("BVH tree constructed in {:.2f} ms", bvh_timer.getMs()); + + // part 2: compute bspheres + bvh_timer.start(); + bsphere_recursive(root); + lg::info("Found bspheres in {:.2f} ms", bvh_timer.getMs()); + + // part 3: layout tree + bvh_timer.start(); + auto tree = build_collide_tree(root); + debug_stats(tree); + lg::info("Tree layout done in {:.2f} ms", bvh_timer.getMs()); + return tree; +} + +} // namespace collide \ No newline at end of file diff --git a/goalc/build_level/collide_bvh.h b/goalc/build_level/collide_bvh.h new file mode 100644 index 0000000000..c4abe6c0ca --- /dev/null +++ b/goalc/build_level/collide_bvh.h @@ -0,0 +1,38 @@ +#pragma once + +#include + +#include "goalc/build_level/collide_common.h" + +// requirements: +// max depth of 3 (maybe?) +// max face per frag = 90 +// max vert per frag = 110 +// branching factor of 8 everywhere. +namespace collide { + +struct DrawNode { + s32 children[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; + math::Vector4f bsphere; +}; + +struct CollideFrag { + math::Vector4f bsphere; + std::vector faces; +}; + +struct DrawableInlineArrayNode { + std::vector nodes; +}; + +struct DrawableInlineArrayCollideFrag { + std::vector frags; +}; + +struct CollideTree { + std::vector node_arrays; + DrawableInlineArrayCollideFrag frags; +}; + +CollideTree construct_collide_bvh(const std::vector& tris); +} // namespace collide diff --git a/goalc/build_level/collide_common.h b/goalc/build_level/collide_common.h new file mode 100644 index 0000000000..3ef5146167 --- /dev/null +++ b/goalc/build_level/collide_common.h @@ -0,0 +1,110 @@ +#pragma once +#include "common/common_types.h" +#include "common/math/Vector.h" + +struct PatSurface { + enum class Mode { GROUND = 0, WALL = 1, OBSTACLE = 2 }; + enum class Material { + STONE = 0, + ICE = 1, + QUICKSAND = 2, + WATERBOTTOM = 3, + TAR = 4, + SAND = 5, + WOOD = 6, + GRASS = 7, + PCMETAL = 8, + SNOW = 9, + DEEPSNOW = 10, + HOTCOALS = 11, + LAVA = 12, + CRWOOD = 13, + GRAVEL = 14, + DIRT = 15, + METAL = 16, + STRAW = 17, + TUBE = 18, + SWAMP = 19, + STOPPROJ = 20, + ROTATE = 21, + NEUTRAL = 22, + }; + + enum class Event { + NONE = 0, + DEADLY = 1, + ENDLESSFALL = 2, + BURN = 3, + DEADLYUP = 4, + BURNUP = 5, + MELT = 6, + }; + + void set_noentity(bool x) { + if (x) { + val |= (1 << 0); + } else { + val &= ~(1 << 0); + } + } + bool get_noentity() const { return val & (1 << 0); } + + void set_nocamera(bool x) { + if (x) { + val |= (1 << 1); + } else { + val &= ~(1 << 1); + } + } + bool get_nocamera() const { return val & (1 << 1); } + + void set_noedge(bool x) { + if (x) { + val |= (1 << 2); + } else { + val &= ~(1 << 2); + } + } + bool get_noedge() const { return val & (1 << 2); } + + void set_mode(Mode mode) { + val &= ~(0b111 << 3); + val |= ((u32)mode << 3); + } + Mode get_mode() const { return (Mode)(0b111 & (val >> 3)); } + + void set_material(Material mat) { + val &= ~(0b111111 << 6); + val |= ((u32)mat << 6); + } + Material get_material() const { return (Material)(0b111111 & (val >> 6)); } + + void set_nolineofsight(bool x) { + if (x) { + val |= (1 << 12); + } else { + val &= ~(1 << 12); + } + } + bool get_nolineofsight() const { return val & (1 << 12); } + + void set_event(Event ev) { + val &= ~(0b111111 << 14); + val |= ((u32)ev << 6); + } + Event get_event() const { return (Event)(0b111111 & (val >> 14)); } + + bool operator==(const PatSurface& other) const { return val == other.val; } + // bits 13, [15-31] are unused, or have unknown purpose. + u32 val = 0; +}; + +struct CollideVertex { + float x, y, z; +}; + +struct CollideFace { + math::Vector4f bsphere; + math::Vector3f v[3]; + PatSurface pat; +}; diff --git a/goalc/build_level/collide_drawable.cpp b/goalc/build_level/collide_drawable.cpp new file mode 100644 index 0000000000..788f5e0584 --- /dev/null +++ b/goalc/build_level/collide_drawable.cpp @@ -0,0 +1,264 @@ +#include "collide_drawable.h" + +#include "common/util/Assert.h" + +#include "goalc/data_compiler/DataObjectGenerator.h" + +/* +(deftype drawable (basic) + ((id int16 :offset-assert 4) + (bsphere vector :inline :offset-assert 16) + ) + +(deftype drawable-group (drawable) + ((length int16 :offset 6) + (data drawable 1 :offset-assert 32) + ) + +(deftype drawable-tree (drawable-group) + () + +(deftype drawable-inline-array (drawable) + ((length int16 :offset 6) ;; this is kinda weird. + ) + +(deftype drawable-tree-collide-fragment (drawable-tree) + ((data-override drawable-inline-array 1 :offset 32)) ;; should be 1 there + +(deftype drawable-inline-array-collide-fragment (drawable-inline-array) + ((data collide-fragment 1 :inline :offset-assert 32) + + (deftype collide-fragment (drawable) + ((mesh collide-frag-mesh :offset 8) + ) + :method-count-assert 18 + :size-assert #x20 + +(deftype collide-frag-mesh (basic) + ((packed-data uint32 :offset-assert 4) + (pat-array uint32 :offset-assert 8) + (strip-data-len uint16 :offset-assert 12) + (poly-count uint16 :offset-assert 14) + (base-trans vector :inline :offset-assert 16) + ;; these go in the w of the vector above. + (vertex-count uint8 :offset 28) + (vertex-data-qwc uint8 :offset 29) + (total-qwc uint8 :offset 30) + (unused uint8 :offset 31) + ) + :method-count-assert 9 + :size-assert #x20 + +(deftype draw-node (drawable) + ((child-count uint8 :offset 6) + (flags uint8 :offset 7) + (child drawable :offset 8) + (distance float :offset 12) + ) + :size-assert #x20 + + (deftype drawable-inline-array-node (drawable-inline-array) + ((data draw-node 1 :inline) + (pad uint32) + ) + :method-count-assert 18 + :size-assert #x44 + */ + +size_t generate_pat_array(DataObjectGenerator& gen, const std::vector& pats) { + gen.align_to_basic(); + size_t result = gen.current_offset_bytes(); + for (auto& pat : pats) { + gen.add_word(pat.val); + } + return result; +} + +size_t generate_packed_collide_data(DataObjectGenerator& gen, const std::vector& data) { + gen.align_to_basic(); + size_t result = gen.current_offset_bytes(); + ASSERT((data.size() % 4) == 0); + for (size_t i = 0; i < data.size(); i += 4) { + u32 word; + memcpy(&word, data.data() + i, 4); + gen.add_word(word); + } + return result; +} + +size_t generate_collide_frag_mesh(DataObjectGenerator& gen, + const CollideFragMeshData& mesh, + size_t packed_data_loc, + size_t pat_array_loc) { + gen.align_to_basic(); + gen.add_type_tag("collide-frag-mesh"); // 0 + size_t result = gen.current_offset_bytes(); + gen.link_word_to_byte(gen.add_word(0), packed_data_loc); // 4 + gen.link_word_to_byte(gen.add_word(0), pat_array_loc); // 8 + gen.add_word(mesh.strip_data_len | (mesh.poly_count << 16)); // 12 + gen.add_word(mesh.base_trans_xyz_s32.x()); // 16 + gen.add_word(mesh.base_trans_xyz_s32.y()); // 20 + gen.add_word(mesh.base_trans_xyz_s32.z()); // 24 + u32 packed = 0; + packed |= mesh.vertex_count; + packed |= ((u32)mesh.vertex_data_qwc) << 8; + packed |= ((u32)mesh.total_qwc) << 16; + gen.add_word(packed); // 28 + return result; +} + +size_t generate_collide_fragment(DataObjectGenerator& gen, + const CollideFragMeshData& mesh, + size_t frag_mesh_loc) { + /* + .type collide-fragment + .word 0x10000 + .word L705 + .word 0x0 + .word 0x46bf480a + .word 0x43dc730b + .word 0xb71ed4fe + .word 0x46c42e44 + */ + gen.align_to_basic(); + gen.add_type_tag("collide-fragment"); + size_t result = gen.current_offset_bytes(); + gen.add_word(0x10000); // ??? + gen.link_word_to_byte(gen.add_word(0), frag_mesh_loc); + gen.add_word(0); + for (int i = 0; i < 4; i++) { + gen.add_word_float(mesh.bsphere[i]); + } + + return result; +} + +size_t generate_collide_fragment_array(DataObjectGenerator& gen, + const std::vector& meshes, + const std::vector& frag_mesh_locs, + std::vector& parent_ref_out) { + gen.align_to_basic(); + gen.add_type_tag("drawable-inline-array-collide-fragment"); // 0 + size_t result = gen.current_offset_bytes(); + ASSERT(meshes.size() < UINT16_MAX); + gen.add_word(meshes.size() << 16); // 4, 6 + gen.add_word(0); // 8 + gen.add_word(0); // 12 + gen.add_word(0); // 16 + gen.add_word(0); // 20 + gen.add_word(0); // 24 + gen.add_word(0); // 28 + + ASSERT(meshes.size() == frag_mesh_locs.size()); + for (size_t i = 0; i < meshes.size(); i++) { + auto& mesh = meshes[i]; + // should be 8 words here: + gen.add_type_tag("collide-fragment"); // 1 + size_t me = gen.current_offset_bytes(); + gen.add_word(0x10000); // ??? + gen.link_word_to_byte(gen.add_word(0), frag_mesh_locs[i]); + gen.add_word(0); + for (int j = 0; j < 4; j++) { + gen.add_word_float(mesh.bsphere[j]); + } + if ((i % 8) == 0) { + parent_ref_out.push_back(me); + } + } + + return result; +} + +size_t generate_collide_draw_node_array(DataObjectGenerator& gen, + const std::vector& nodes, + u32 flag, + const std::vector& children, + std::vector& parent_ref_out) { + gen.align_to_basic(); + gen.add_type_tag("drawable-inline-array-node"); // 0 + size_t result = gen.current_offset_bytes(); + gen.add_word(nodes.size() << 16); // 4, 6 + gen.add_word(0); // 8 + gen.add_word(0); // 12 + gen.add_word(0); // 16 + gen.add_word(0); // 20 + gen.add_word(0); // 24 + gen.add_word(0); // 28 + + ASSERT(nodes.size() == children.size()); + for (size_t i = 0; i < nodes.size(); i++) { + auto& node = nodes[i]; + // should be 8 words here: + gen.add_type_tag("draw-node"); // 1 + size_t me = gen.current_offset_bytes(); + u32 packed_flags = 0; + packed_flags |= (8 << 16); // TODO hard-coded size here + packed_flags |= (flag << 24); + gen.add_word(packed_flags); // 2 + gen.link_word_to_byte(gen.add_word(0), children[i]); // 3 + gen.add_word(0); // 4 + if ((i % 8) == 0) { + parent_ref_out.push_back(me); + } + gen.add_word_float(node.bsphere.x()); // 5 + gen.add_word_float(node.bsphere.y()); // 6 + gen.add_word_float(node.bsphere.z()); // 7 + gen.add_word_float(node.bsphere.w()); // 8 + } + + return result; +} + +size_t DrawableTreeCollideFragment::add_to_object_file(DataObjectGenerator& gen) const { + // generate pat array + size_t pat_array_loc = generate_pat_array(gen, packed_frags.pats); + + // generated packed data + std::vector packed_data_locs; + for (auto& mesh : packed_frags.packed_frag_data) { + packed_data_locs.push_back(generate_packed_collide_data(gen, mesh.packed_data)); + } + + // generate collide frag meshes + std::vector collide_frag_meshes; + for (size_t i = 0; i < packed_data_locs.size(); i++) { + collide_frag_meshes.push_back(generate_collide_frag_mesh(gen, packed_frags.packed_frag_data[i], + packed_data_locs[i], pat_array_loc)); + } + + std::vector array_locs; + array_locs.resize(bvh.node_arrays.size() + 1); // plus one for the frags. + int array_slot = bvh.node_arrays.size(); + + std::vector children_refs; + array_locs[array_slot--] = generate_collide_fragment_array(gen, packed_frags.packed_frag_data, + collide_frag_meshes, children_refs); + u32 flag = 0; + while (array_slot >= 0) { + ASSERT(children_refs.size() == bvh.node_arrays.at(array_slot).nodes.size()); + std::vector next_children; + + array_locs[array_slot] = generate_collide_draw_node_array( + gen, bvh.node_arrays.at(array_slot).nodes, flag, children_refs, next_children); + + children_refs = std::move(next_children); + array_slot--; + flag = 1; + } + + { + gen.align_to_basic(); + gen.add_type_tag("drawable-tree-collide-fragment"); + size_t result = gen.current_offset_bytes(); + gen.add_word((array_locs.size() - 1) << 16); // todo the minus one here?? + for (int i = 0; i < 6; i++) { + gen.add_word(0); + } + + for (size_t i = 1; i < array_locs.size(); i++) { // todo the offset here? + gen.link_word_to_byte(gen.add_word(0), array_locs[i]); + } + + return result; + } +} diff --git a/goalc/build_level/collide_drawable.h b/goalc/build_level/collide_drawable.h new file mode 100644 index 0000000000..5804dbb5c1 --- /dev/null +++ b/goalc/build_level/collide_drawable.h @@ -0,0 +1,12 @@ +#pragma once + +#include "goalc/build_level/collide_bvh.h" +#include "goalc/build_level/collide_pack.h" + +class DataObjectGenerator; + +struct DrawableTreeCollideFragment { + CollideFragMeshDataArray packed_frags; + collide::CollideTree bvh; + size_t add_to_object_file(DataObjectGenerator& gen) const; +}; diff --git a/goalc/build_level/collide_pack.cpp b/goalc/build_level/collide_pack.cpp new file mode 100644 index 0000000000..fe7c9d72ca --- /dev/null +++ b/goalc/build_level/collide_pack.cpp @@ -0,0 +1,263 @@ +#include "collide_pack.h" + +#include + +#include "common/log/log.h" +#include "common/util/Assert.h" +#include "common/util/Timer.h" + +struct PackedU16Verts { + math::Vector base; + std::vector> vertex; +}; + +/*! + * Assert that the given float can be converted to a packed u16, and return that u16. + */ +u16 magic_float_to_u16(float in) { + u16 u16s[2]; + memcpy(u16s, &in, 4); + ASSERT_MSG(u16s[1] == 0x4d00, + "Unable to pack collision vertex data to u16's. Try to make smaller triangles and " + "avoid skinny triangles. (or there is a bug in the packer)"); + return u16s[0]; +} + +namespace { +float u32_to_float(u32 in) { + float out; + memcpy(&out, &in, 4); + return out; +} +} // namespace + +/*! + * Pack vertices to base + u16. + * The format is quite strange to allow for fast unpacking. + */ +PackedU16Verts pack_verts_to_u16(const std::vector& input) { + PackedU16Verts result; + if (input.empty()) { + lg::warn("Empty collide fragment"); + } + + // this "magic" offset is a large float where a ulp is 16.f, or 1/256th of a meter. + // this means that float -> int can be done as a single addition. + // (or, in some cases, we can avoid float->int entirely) + math::Vector3f magic_offset; + magic_offset.fill(u32_to_float(0x4d000000)); + + // we'll be treating everything as an offset from this minimum vertex: + math::Vector3f min_vtx = input.empty() ? math::Vector3f::zero() : input[0]; + for (auto& vtx : input) { + min_vtx.min_in_place(vtx); + } + // give us a tiny bit of extra room to avoid rounding problems + min_vtx -= 16.f; + + // to round down to nearest integer + result.base = min_vtx.cast(); + auto base = result.base.cast(); + + // compute offset relative to base. + for (auto& vtx : input) { + // add the "magic offset" to make this a 0x4dXXXXXX float. + // subtract the base to make this a 0x4d00XXXX float. + auto vertex_magic = vtx + magic_offset - base; + // and if we did it right, we should be able to pack to u16's here + result.vertex.emplace_back(magic_float_to_u16(vertex_magic[0]), + magic_float_to_u16(vertex_magic[1]), + magic_float_to_u16(vertex_magic[2])); + } + + // verify + /* + for (size_t i = 0; i < input.size(); i++) { + math::Vector3f v; + v[0] = u32_to_float(0x4d000000 + result.vertex[i][0]); + v[1] = u32_to_float(0x4d000000 + result.vertex[i][1]); + v[2] = u32_to_float(0x4d000000 + result.vertex[i][2]); + float base_offset = u32_to_float(0x4d000000); + math::Vector3f vf13_combo_offset(base_offset, base_offset, base_offset); + math::Vector3f vf14_base_trans_float(result.base[0], result.base[1], result.base[2]); + vf13_combo_offset -= vf14_base_trans_float; + v -= vf13_combo_offset; + fmt::print("error {}\n", (v - input[i]).to_string_aligned());; + } + */ + + return result; +} + +struct PatSurfaceHash { + size_t operator()(const PatSurface& in) const { return std::hash()(in.val); } +}; + +/*! + * pat -> pat index mapping. + * There's a pat "palette" with up 255 unique pats. + */ +struct PatMap { + std::unordered_map map; + std::vector pats; + + u32 add_pat(PatSurface pat) { + const auto& lookup = map.find(pat); + if (lookup == map.end()) { + u32 new_idx = pats.size(); + if (new_idx > UINT8_MAX) { + lg::die("Too many pats. Use fewer. Or improve the pat code to use multiple pat arrays."); + } + map[pat] = new_idx; + pats.push_back(pat); + return new_idx; + } else { + return lookup->second; + } + } +}; + +/*! + * A face, represented as indices + */ +struct IndexFace { + math::Vector vertex_indices; // per vertex, winding order matters here + u8 pat_idx; // pat for the whole face +}; + +/*! + * All the faces in a frag + */ +struct IndexedFaces { + std::vector faces; // index in to the two vertex array below: + std::vector vertices_float; + PackedU16Verts vertices_u16; +}; + +struct Vector3fHash { + size_t operator()(const math::Vector3f& in) const { + return std::hash()(in.x()) ^ std::hash()(in.y()) ^ std::hash()(in.z()); + } +}; + +/*! + * Deduplicate vertices, converted to indexed, add to pat palette, pack to u16s. + */ +IndexedFaces dedup_frag_mesh(const collide::CollideFrag& frag, PatMap* pat_map) { + IndexedFaces result; + std::unordered_map vertex_map; + + for (auto& face_in : frag.faces) { + auto& face_out = result.faces.emplace_back(); + // pat: + face_out.pat_idx = pat_map->add_pat(face_in.pat); + // vertices + for (int i = 0; i < 3; i++) { + const auto& lookup = vertex_map.find(face_in.v[i]); + if (lookup == vertex_map.end()) { + u32 idx = result.vertices_float.size(); + result.vertices_float.push_back(face_in.v[i]); + face_out.vertex_indices[i] = idx; + vertex_map[face_in.v[i]] = idx; + } else { + face_out.vertex_indices[i] = lookup->second; + } + } + } + result.vertices_u16 = pack_verts_to_u16(result.vertices_float); + return result; +} + +/*! + * make strip table that doesn't do any stripping. It will be quite long, which might cause problem + */ +std::vector make_dumb_strip_table(const IndexedFaces& faces) { + std::vector out; + ASSERT_MSG( + faces.vertices_float.size() < UINT8_MAX, + "somehow have UINT8_MAX deduped vertices in a single fragment, likely a bug somewhere."); + for (auto& face : faces.faces) { + out.push_back(face.vertex_indices[0]); + out.push_back(face.vertex_indices[1]); + out.push_back(face.vertex_indices[2]); + out.push_back(0); + } + out.push_back(-1); + + return out; +} + +CollideFragMeshDataArray pack_collide_frags(const std::vector& frag_data) { + Timer pack_timer; + CollideFragMeshDataArray result; + PatMap pat_map; + + size_t total_pack_bytes = 0; + lg::info("Packing {} fragments", frag_data.size()); + + for (auto& frag_in : frag_data) { + auto& frag_out = result.packed_frag_data.emplace_back(); + auto indexed = dedup_frag_mesh(frag_in, &pat_map); + // first part of packed_data is the u16 vertex data: + frag_out.vertex_count = indexed.vertices_u16.vertex.size(); + frag_out.packed_data.resize(sizeof(u16) * frag_out.vertex_count * 3); + memcpy(frag_out.packed_data.data(), indexed.vertices_u16.vertex.data(), + frag_out.packed_data.size()); + // align to 16-bytes + while (frag_out.packed_data.size() & 0xf) { + frag_out.packed_data.push_back(0); + } + // remember where + frag_out.vertex_data_qwc = frag_out.packed_data.size() / 16; + + // up next, the strip table + auto strip = make_dumb_strip_table(indexed); + frag_out.packed_data.insert(frag_out.packed_data.end(), strip.begin(), strip.end()); + frag_out.strip_data_len = strip.size(); + ASSERT(frag_out.strip_data_len < UINT16_MAX); // probably in big trouble in here. + + // pat table + for (auto& face : indexed.faces) { + frag_out.packed_data.push_back(face.pat_idx); + } + + // align to 16-bytes so total_qwc works. + while (frag_out.packed_data.size() & 0xf) { + frag_out.packed_data.push_back(0); + } + // gonna guess here: + frag_out.poly_count = indexed.faces.size(); + frag_out.total_qwc = frag_out.packed_data.size() / 16; + frag_out.base_trans_xyz_s32 = indexed.vertices_u16.base; + frag_out.bsphere = frag_in.bsphere; + total_pack_bytes += frag_out.packed_data.size(); + } + + result.pats = pat_map.pats; + lg::info("Total packed data size: {} kB, took {:.2f} ms", total_pack_bytes / 1024, + pack_timer.getMs()); + return result; +} + +/* +(deftype collide-frag-mesh (basic) + ((packed-data uint32 :offset-assert 4) <- ptr + (pat-array uint32 :offset-assert 8) <- ptr + (strip-data-len uint16 :offset-assert 12) + (poly-count uint16 :offset-assert 14) + (base-trans vector :inline :offset-assert 16) + ;; these go in the w of the vector above. + (vertex-count uint8 :offset 28) // done! + (vertex-data-qwc uint8 :offset 29) // done! + (total-qwc uint8 :offset 30) + (unused uint8 :offset 31) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + */ + +// packed_data: +// (u16x3) per vertex, packed float vtx format. +// diff --git a/goalc/build_level/collide_pack.h b/goalc/build_level/collide_pack.h new file mode 100644 index 0000000000..316b56e9f4 --- /dev/null +++ b/goalc/build_level/collide_pack.h @@ -0,0 +1,21 @@ +#pragma once + +#include "goalc/build_level/collide_bvh.h" + +struct CollideFragMeshData { + math::Vector4f bsphere; // not part of the collide frag, but is part of the drawable wrapping it + std::vector packed_data; + u32 strip_data_len; + u32 poly_count; + math::Vector base_trans_xyz_s32; + u8 vertex_count; + u8 vertex_data_qwc; + u8 total_qwc; +}; + +struct CollideFragMeshDataArray { + std::vector packed_frag_data; + std::vector pats; +}; + +CollideFragMeshDataArray pack_collide_frags(const std::vector& frag_data); \ No newline at end of file diff --git a/goalc/build_level/color_quantization.cpp b/goalc/build_level/color_quantization.cpp new file mode 100644 index 0000000000..5ff39cb519 --- /dev/null +++ b/goalc/build_level/color_quantization.cpp @@ -0,0 +1,222 @@ +#include "color_quantization.h" + +#include + +#include "common/log/log.h" +#include "common/util/Assert.h" + +/*! + * Just removes duplicate colors, which can work if there are only a few unique colors. + */ +QuantizedColors quantize_colors_dumb(const std::vector>& in) { + QuantizedColors result; + std::unordered_map color_to_slot; + for (auto& vtx : in) { + u64 key; + memcpy(&key, vtx.data(), sizeof(u64)); + const auto& existing = color_to_slot.find(key); + if (existing == color_to_slot.end()) { + auto cidx = result.final_colors.size(); + result.vtx_to_color.push_back(cidx); + color_to_slot[key] = cidx; + result.final_colors.push_back(vtx); + } else { + result.vtx_to_color.push_back(existing->second); + } + } + fmt::print("quantize_colors_dumb: {} -> {}\n", in.size(), result.final_colors.size()); + ASSERT(result.final_colors.size() < 8192); + return result; +} + +namespace { + +using Color = math::Vector; + +// An octree node. +// Represents a color in the output if rgb_sum_count > 0. +// Otherwise, just organizational. +struct Node { + u32 r_sum = 0; + u32 g_sum = 0; + u32 b_sum = 0; + u32 rgb_sum_count = 0; + u8 depth = 0xff; // 0 for root, 7 deepest + + // children stuff + u32 leaves_under_me = 0; + std::vector children; + Node* parent = nullptr; + + u32 final_idx = UINT32_MAX; +}; + +u8 child_index(Color color, u8 depth) { + u8 r_bit = (color.x() >> (7 - depth)) & 1; + u8 g_bit = (color.y() >> (7 - depth)) & 1; + u8 b_bit = (color.z() >> (7 - depth)) & 1; + return (r_bit) + (g_bit * 2) + (b_bit * 4); +} + +void insert(Node& root, Color color, u8 current_depth) { + if (current_depth == 7) { + root.r_sum += color.x(); + root.g_sum += color.y(); + root.b_sum += color.z(); + if (root.rgb_sum_count == 0) { + for (auto* up = root.parent; up; up = up->parent) { + up->leaves_under_me++; + } + } + root.rgb_sum_count++; + } else { + if (root.children.empty()) { + root.children.resize(8); + } + auto& next_node = root.children[child_index(color, current_depth)]; + if (next_node.depth == 0xff) { + next_node.depth = current_depth + 1; + next_node.parent = &root; + } + insert(next_node, color, current_depth + 1); + } +} + +template +void for_each_node(Node& root, T&& func) { + func(root); + for (auto& child : root.children) { + for_each_node(child, func); + } +} + +u32 count_leaves(Node& root) { + u32 result = 0; + for_each_node(root, [&](Node& n) { + if (n.rgb_sum_count) { + ASSERT(n.children.empty()); + result++; + } + }); + return result; +} + +void collapse1(Node& root) { + ASSERT(!root.children.empty()); + u32 total_children_removed = 0; + u32 total_rgb_sum_moved_up = 0; + bool started_as_leaf = root.rgb_sum_count; + for (auto& child : root.children) { + if (child.depth != 0xff) { + ASSERT(child.children.empty()); + ASSERT(child.rgb_sum_count); + total_children_removed++; + root.r_sum += child.r_sum; + root.g_sum += child.g_sum; + root.b_sum += child.b_sum; + root.rgb_sum_count += child.rgb_sum_count; + total_rgb_sum_moved_up += child.rgb_sum_count; + } + } + ASSERT(total_children_removed == root.leaves_under_me); + + if (!started_as_leaf && root.rgb_sum_count) { + total_children_removed--; + } + root.children.clear(); + root.leaves_under_me = 0; + if (total_children_removed) { + for (auto* up = root.parent; up; up = up->parent) { + up->leaves_under_me -= total_children_removed; + } + } + + ASSERT(count_leaves(root) == 1); +} + +void find_nodes_at_level(Node& n, std::vector& out, u8 level) { + if (n.depth == level) { + out.push_back(&n); + } else if (n.depth < level) { + for (auto& child : n.children) { + find_nodes_at_level(child, out, level); + } + } +} + +void collapse_at_level(Node& root, u8 level, u32 target_leaf_count) { + std::vector nodes_at_level; + find_nodes_at_level(root, nodes_at_level, level); + std::stable_sort(nodes_at_level.begin(), nodes_at_level.end(), + [](Node* a, Node* b) { return a->leaves_under_me < b->leaves_under_me; }); + + size_t at_level_to_try = 0; + while (root.leaves_under_me > target_leaf_count && at_level_to_try < nodes_at_level.size()) { + collapse1(*nodes_at_level[at_level_to_try++]); + } +} + +void collapse_as_needed(Node& root, u32 target_leaf_count) { + u32 level_to_reduce = 6; + while (root.leaves_under_me > target_leaf_count) { + collapse_at_level(root, level_to_reduce--, target_leaf_count); + } +} + +void assign_colors(Node& root, std::vector& palette_out) { + u32 idx = 0; + for_each_node(root, [&](Node& n) { + if (n.rgb_sum_count) { + n.final_idx = idx++; + palette_out.emplace_back(n.r_sum / n.rgb_sum_count, n.g_sum / n.rgb_sum_count, + n.b_sum / n.rgb_sum_count); + } + }); +} + +u32 lookup_node_for_color(Node& root, Color c, u8 depth) { + if (root.children.empty()) { + return root.final_idx; + } else { + return lookup_node_for_color(root.children[child_index(c, depth)], c, depth + 1); + } +} + +} // namespace + +/*! + * Quantize colors using an octree for clustering. + */ +QuantizedColors quantize_colors_octree(const std::vector>& in, + u32 target_count) { + Node root; + root.depth = 0; + for (auto& color : in) { + insert(root, color, 0); + } + + collapse_as_needed(root, target_count); + + QuantizedColors out; + assign_colors(root, out.final_colors); + for (auto& color : in) { + out.vtx_to_color.push_back(lookup_node_for_color(root, color, 0)); + } + + float total_error[3] = {0, 0, 0}; + for (size_t i = 0; i < in.size(); i++) { + // fmt::print(" {} -> {}\n", in[i].to_string_hex_byte(), + // out.final_colors[out.vtx_to_color[i]].to_string_hex_byte()); + auto diff = in[i].cast() - out.final_colors[out.vtx_to_color[i]].cast(); + + for (int j = 0; j < 3; j++) { + total_error[j] += std::abs(diff[j]); + } + } + + lg::info("Octree quantize average error (as 8-bit ints): r: {}, g: {} b: {}", + total_error[0] / in.size(), total_error[1] / in.size(), total_error[2] / in.size()); + lg::info("Final palette size: {}", out.final_colors.size()); + + return out; +} \ No newline at end of file diff --git a/goalc/build_level/color_quantization.h b/goalc/build_level/color_quantization.h new file mode 100644 index 0000000000..f0b92a81de --- /dev/null +++ b/goalc/build_level/color_quantization.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "common/common_types.h" +#include "common/math/Vector.h" + +// TODO: come up with something for time of day colors. +// time of day colors make the colors effectively 24-channel instead of just 3. +// the octree approach doesn't work too well here (we'd need a 16777216-tree) +// but a k-d tree seems like the right approach. + +struct QuantizedColors { + std::vector> final_colors; + std::vector vtx_to_color; +}; + +QuantizedColors quantize_colors_dumb(const std::vector>& in); + +QuantizedColors quantize_colors_octree(const std::vector>& in, + u32 target_count); \ No newline at end of file diff --git a/goalc/build_level/gltf_mesh_extract.cpp b/goalc/build_level/gltf_mesh_extract.cpp new file mode 100644 index 0000000000..7415300019 --- /dev/null +++ b/goalc/build_level/gltf_mesh_extract.cpp @@ -0,0 +1,772 @@ +/*! + * Mesh extraction for GLTF meshes. + */ + +#include "gltf_mesh_extract.h" + +#include + +#include "common/log/log.h" +#include "common/math/geometry.h" +#include "common/util/Timer.h" + +#include "goalc/build_level/color_quantization.h" + +#include "third-party/tiny_gltf/tiny_gltf.h" + +namespace gltf_mesh_extract { + +namespace { + +/*! + * Convert a GLTF index buffer to std::vector + */ +template +std::vector index_list_to_u32(const u8* data, u32 num_verts, u32 offset, u32 stride) { + std::vector result; + result.reserve(num_verts); + for (u32 i = 0; i < num_verts; i++) { + T val; + memcpy(&val, data, sizeof(T)); + result.push_back(offset + val); + data += stride; + } + return result; +} + +/*! + * Convert a GLTF position buffer or similar to std::vector + */ +std::vector extract_vec3f(const u8* data, u32 count, u32 stride) { + std::vector result; + result.reserve(count); + for (u32 i = 0; i < count; i++) { + memcpy(&result.emplace_back(), data, sizeof(math::Vector3f)); + data += stride; + } + return result; +} + +std::vector extract_vec2f(const u8* data, u32 count, u32 stride) { + std::vector result; + result.reserve(count); + for (u32 i = 0; i < count; i++) { + memcpy(&result.emplace_back(), data, sizeof(math::Vector2f)); + data += stride; + } + return result; +} + +/*! + * Convert a GLTF color buffer to u8 colors. + */ +std::vector> extract_color_from_vec4_u16(const u8* data, + u32 count, + u32 stride) { + std::vector> result; + result.reserve(count); + for (u32 i = 0; i < count; i++) { + math::Vector temp; + memcpy(&temp, data, sizeof(math::Vector)); + data += stride; + result.emplace_back(temp.x() >> 8, temp.y() >> 8, temp.z() >> 8, temp.w() >> 8); + } + return result; +} + +/*! + * Convert a GLTF index buffer + */ +std::vector gltf_index_buffer(const tinygltf::Model& model, + int indices_idx, + u32 index_offset) { + const auto& indices_accessor = model.accessors[indices_idx]; + const auto& buffer_view = model.bufferViews[indices_accessor.bufferView]; + const auto& buffer = model.buffers[buffer_view.buffer]; + const auto data_ptr = buffer.data.data() + buffer_view.byteOffset + indices_accessor.byteOffset; + const auto stride = indices_accessor.ByteStride(buffer_view); + const auto count = indices_accessor.count; + + switch (indices_accessor.componentType) { + case TINYGLTF_COMPONENT_TYPE_BYTE: + return index_list_to_u32(data_ptr, count, index_offset, stride); + case TINYGLTF_COMPONENT_TYPE_UNSIGNED_BYTE: + return index_list_to_u32(data_ptr, count, index_offset, stride); + case TINYGLTF_COMPONENT_TYPE_SHORT: + return index_list_to_u32(data_ptr, count, index_offset, stride); + case TINYGLTF_COMPONENT_TYPE_UNSIGNED_SHORT: + return index_list_to_u32(data_ptr, count, index_offset, stride); + case TINYGLTF_COMPONENT_TYPE_INT: + return index_list_to_u32(data_ptr, count, index_offset, stride); + case TINYGLTF_COMPONENT_TYPE_UNSIGNED_INT: + return index_list_to_u32(data_ptr, count, index_offset, stride); + default: + ASSERT_MSG(false, "unsupported component type"); + } +} + +struct ExtractedVertices { + std::vector vtx; + std::vector> vtx_colors; + std::vector normals; +}; + +ExtractedVertices gltf_vertices(const tinygltf::Model& model, + const std::map& attributes, + const math::Matrix4f& w_T_local, + bool get_colors, + bool get_normals, + const std::string& debug_name) { + std::vector result; + std::vector> vtx_colors; + + { + const auto& position_attrib = attributes.find("POSITION"); + ASSERT_MSG(position_attrib != attributes.end(), "Did not find position attribute."); + + const auto attrib_accessor = model.accessors[position_attrib->second]; + const auto& buffer_view = model.bufferViews[attrib_accessor.bufferView]; + const auto& buffer = model.buffers[buffer_view.buffer]; + const auto data_ptr = buffer.data.data() + buffer_view.byteOffset + attrib_accessor.byteOffset; + const auto byte_stride = attrib_accessor.ByteStride(buffer_view); + const auto count = attrib_accessor.count; + + ASSERT_MSG(attrib_accessor.type == TINYGLTF_TYPE_VEC3, "POSITION wasn't vec3"); + ASSERT_MSG(attrib_accessor.componentType == TINYGLTF_COMPONENT_TYPE_FLOAT, + "POSITION wasn't float"); + // for (auto& attrib : attributes) { + // fmt::print("attrib: {}\n", attrib.first); + //} + auto mesh_verts = extract_vec3f(data_ptr, count, byte_stride); + result.reserve(mesh_verts.size()); + for (auto& vert : mesh_verts) { + auto& new_vert = result.emplace_back(); + math::Vector4f v_in(vert.x(), vert.y(), vert.z(), 1); + math::Vector4f v_w = w_T_local * v_in; + new_vert.x = v_w.x() * 4096; + new_vert.y = v_w.y() * 4096; + new_vert.z = v_w.z() * 4096; + } + } + + if (get_colors) { + const auto& color_attrib = attributes.find("COLOR_0"); + if (color_attrib == attributes.end()) { + lg::error("Mesh {} didn't have any colors, using white", debug_name); + for (size_t i = 0; i < result.size(); i++) { + vtx_colors.emplace_back(0x80, 0x80, 0x80, 0xff); + } + } else { + const auto attrib_accessor = model.accessors[color_attrib->second]; + const auto& buffer_view = model.bufferViews[attrib_accessor.bufferView]; + const auto& buffer = model.buffers[buffer_view.buffer]; + const auto data_ptr = + buffer.data.data() + buffer_view.byteOffset + attrib_accessor.byteOffset; + const auto byte_stride = attrib_accessor.ByteStride(buffer_view); + const auto count = attrib_accessor.count; + + ASSERT_MSG(attrib_accessor.type == TINYGLTF_TYPE_VEC4, "COLOR_0 wasn't vec4"); + ASSERT_MSG( + attrib_accessor.componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_SHORT, + fmt::format("COLOR_0 wasn't float, got {} instead", attrib_accessor.componentType)); + auto colors = extract_color_from_vec4_u16(data_ptr, count, byte_stride); + vtx_colors.insert(vtx_colors.end(), colors.begin(), colors.end()); + } + + // ASSERT_MSG(color_attrib != attributes.end(), "Did not find color attribute."); + } + + bool got_texture = false; + { + const auto& texcoord_attrib = attributes.find("TEXCOORD_0"); + if (texcoord_attrib != attributes.end()) { + const auto attrib_accessor = model.accessors[texcoord_attrib->second]; + const auto& buffer_view = model.bufferViews[attrib_accessor.bufferView]; + const auto& buffer = model.buffers[buffer_view.buffer]; + const auto data_ptr = + buffer.data.data() + buffer_view.byteOffset + attrib_accessor.byteOffset; + const auto byte_stride = attrib_accessor.ByteStride(buffer_view); + const auto count = attrib_accessor.count; + + ASSERT_MSG(attrib_accessor.type == TINYGLTF_TYPE_VEC2, "TEXCOORD wasn't vec2"); + ASSERT_MSG(attrib_accessor.componentType == TINYGLTF_COMPONENT_TYPE_FLOAT, + "TEXCOORD wasn't float"); + auto mesh_verts = extract_vec2f(data_ptr, count, byte_stride); + ASSERT(mesh_verts.size() == result.size()); + got_texture = true; + for (size_t i = 0; i < mesh_verts.size(); i++) { + result[i].s = mesh_verts[i].x(); + result[i].t = mesh_verts[i].y(); + } + } else { + if (!get_normals) { + // don't warn if we're just getting collision + lg::warn("No texcoord attribute for mesh: {}", debug_name); + } + } + } + + std::vector normals; + if (get_normals) { + const auto& normal_attrib = attributes.find("NORMAL"); + if (normal_attrib != attributes.end()) { + const auto attrib_accessor = model.accessors[normal_attrib->second]; + const auto& buffer_view = model.bufferViews[attrib_accessor.bufferView]; + const auto& buffer = model.buffers[buffer_view.buffer]; + const auto data_ptr = + buffer.data.data() + buffer_view.byteOffset + attrib_accessor.byteOffset; + const auto byte_stride = attrib_accessor.ByteStride(buffer_view); + const auto count = attrib_accessor.count; + + ASSERT_MSG(attrib_accessor.type == TINYGLTF_TYPE_VEC3, "NORMAL wasn't vec3"); + ASSERT_MSG(attrib_accessor.componentType == TINYGLTF_COMPONENT_TYPE_FLOAT, + "NORMAL wasn't float"); + normals = extract_vec3f(data_ptr, count, byte_stride); + for (auto& nrm : normals) { + math::Vector4f nrm4(nrm.x(), nrm.y(), nrm.z(), 0.f); + nrm = (w_T_local * nrm4).xyz(); + } + ASSERT(normals.size() == result.size()); + } else { + lg::error("No NORMAL attribute for mesh: {}", debug_name); + } + } + + for (auto& v : result) { + v.color_index = 0; + if (!got_texture) { + v.s = 0; + v.t = 0; + } + + v.q_unused = 0; + v.pad[0] = 0; + v.pad[1] = 0; + v.pad[2] = 0; + } + // TODO: other properties + return {result, vtx_colors, normals}; +} + +DrawMode make_default_draw_mode() { + DrawMode mode; + mode.set_depth_write_enable(true); + mode.set_depth_test(GsTest::ZTest::GEQUAL); + mode.set_alpha_blend(DrawMode::AlphaBlend::DISABLED); + mode.set_aref(0); + mode.set_alpha_fail(GsTest::AlphaFail::KEEP); + mode.set_clamp_s_enable(false); + mode.set_clamp_t_enable(false); + mode.disable_filt(); // for checkerboard... + mode.enable_tcc(); // ? + mode.disable_at(); + mode.enable_zt(); + mode.disable_ab(); + mode.disable_decal(); + mode.enable_fog(); + return mode; +} + +int texture_pool_debug_checker(TexturePool* pool) { + const auto& existing = pool->textures_by_name.find("DEBUG_CHECKERBOARD"); + if (existing == pool->textures_by_name.end()) { + size_t idx = pool->textures_by_idx.size(); + pool->textures_by_name["DEBUG_CHECKERBOARD"] = idx; + auto& tex = pool->textures_by_idx.emplace_back(); + tex.w = 16; + tex.h = 16; + tex.debug_name = "DEBUG_CHECKERBOARD"; + tex.debug_tpage_name = "DEBUG"; + tex.load_to_pool = false; + tex.combo_id = 0; // doesn't matter, not a pool tex + tex.data.resize(16 * 16); + u32 c0 = 0xa0303030; + u32 c1 = 0xa0e0e0e0; + for (int i = 0; i < 16; i++) { + for (int j = 0; j < 16; j++) { + tex.data[i * 16 + j] = (((i / 4) & 1) ^ ((j / 4) & 1)) ? c1 : c0; + } + } + return idx; + } else { + return existing->second; + } +} + +int texture_pool_add_texture(TexturePool* pool, const tinygltf::Image& tex) { + const auto& existing = pool->textures_by_name.find(tex.name); + if (existing != pool->textures_by_name.end()) { + lg::info("Reusing image: {}", tex.name); + return existing->second; + } + + ASSERT(tex.bits == 8); + ASSERT(tex.component == 4); + ASSERT(tex.pixel_type == TINYGLTF_TEXTURE_TYPE_UNSIGNED_BYTE); + + size_t idx = pool->textures_by_idx.size(); + pool->textures_by_name[tex.name] = idx; + auto& tt = pool->textures_by_idx.emplace_back(); + tt.w = tex.width; + tt.h = tex.height; + tt.debug_name = tex.name; + tt.debug_tpage_name = "custom-level"; + tt.load_to_pool = false; + tt.combo_id = 0; // doesn't matter, not a pool tex + tt.data.resize(tt.w * tt.h * 4); + ASSERT(tex.image.size() >= tt.data.size()); + memcpy(tt.data.data(), tex.image.data(), tt.data.size()); + return idx; +} +} // namespace + +math::Matrix4f affine_translation(const math::Vector3f& translation) { + math::Matrix4f result = math::Matrix4f::identity(); + result(0, 3) = translation[0]; + result(1, 3) = translation[1]; + result(2, 3) = translation[2]; + result(3, 3) = 1; + return result; +} + +math::Matrix4f affine_scale(const math::Vector3f& scale) { + math::Matrix4f result = math::Matrix4f::zero(); + result(0, 0) = scale[0]; + result(1, 1) = scale[1]; + result(2, 2) = scale[2]; + result(3, 3) = 1; + return result; +} + +math::Matrix4f affine_rot_qxyzw(const math::Vector4f& quat) { + math::Matrix4f result = math::Matrix4f::zero(); + result(3, 3) = 1; + result(0, 0) = 1.0 - 2.0 * (quat.y() * quat.y() + quat.z() * quat.z()); + result(0, 1) = 2.0 * (quat.x() * quat.y() - quat.z() * quat.w()); + result(0, 2) = 2.0 * (quat.x() * quat.z() + quat.y() * quat.w()); + result(1, 0) = 2.0 * (quat.x() * quat.y() + quat.z() * quat.w()); + result(1, 1) = 1.0 - 2.0 * (quat.x() * quat.x() + quat.z() * quat.z()); + result(1, 2) = 2.0 * (quat.y() * quat.z() - quat.x() * quat.w()); + result(2, 0) = 2.0 * (quat.x() * quat.z() - quat.y() * quat.w()); + result(2, 1) = 2.0 * (quat.y() * quat.z() + quat.x() * quat.w()); + result(2, 2) = 1.0 - 2.0 * (quat.x() * quat.x() + quat.y() * quat.y()); + return result; +} + +math::Vector3f vector3f_from_gltf(const std::vector& in) { + ASSERT(in.size() == 3); + return math::Vector3f{in[0], in[1], in[2]}; +} + +math::Vector4f vector4f_from_gltf(const std::vector& in) { + ASSERT(in.size() == 4); + return math::Vector4f{in[0], in[1], in[2], in[3]}; +} + +math::Matrix4f matrix_from_node(const tinygltf::Node& node) { + if (!node.matrix.empty()) { + math::Matrix4f result; + for (int i = 0; i < 16; i++) { + result.data()[i] = node.matrix[i]; + } + return result; + } else { + // from trs + math::Matrix4f t, r, s; + if (!node.translation.empty()) { + t = affine_translation(vector3f_from_gltf(node.translation)); + } else { + t = math::Matrix4f::identity(); + } + + if (!node.rotation.empty()) { + r = affine_rot_qxyzw(vector4f_from_gltf(node.rotation)); + } else { + r = math::Matrix4f::identity(); + } + + if (!node.scale.empty()) { + s = affine_scale(vector3f_from_gltf(node.scale)); + } else { + s = math::Matrix4f::identity(); + } + + return t * r * s; + } +} + +struct NodeWithTransform { + int node_idx; + math::Matrix4f w_T_node; +}; + +/*! + * Recursively walk the tree of nodes, flatten, and compute w_T_node for each. + */ +void node_find_helper(const tinygltf::Model& model, + const math::Matrix4f& w_T_parent, + int node_idx, + std::vector* out) { + const auto& node = model.nodes.at(node_idx); + math::Matrix4f w_T_node = w_T_parent * matrix_from_node(node); + out->push_back({node_idx, w_T_node}); + for (auto& child : node.children) { + node_find_helper(model, w_T_node, child, out); + } +} + +std::vector flatten_nodes_from_all_scenes(const tinygltf::Model& model) { + std::vector out; + for (auto& scene : model.scenes) { + for (auto& nidx : scene.nodes) { + math::Matrix4f identity = math::Matrix4f::identity(); + node_find_helper(model, identity, nidx, &out); + } + } + return out; +} + +void dedup_vertices(const std::vector& vertices_in, + std::vector& vertices_out, + std::vector& old_to_new_out) { + ASSERT(vertices_out.empty()); + ASSERT(old_to_new_out.empty()); + old_to_new_out.resize(vertices_in.size(), -1); + + std::unordered_map vtx_to_new; + + for (size_t in_idx = 0; in_idx < vertices_in.size(); in_idx++) { + auto& vtx = vertices_in[in_idx]; + const auto& lookup = vtx_to_new.find(vtx); + if (lookup == vtx_to_new.end()) { + // first time seeing this one + size_t new_idx = vertices_out.size(); + vertices_out.push_back(vtx); + old_to_new_out[in_idx] = new_idx; + vtx_to_new[vtx] = new_idx; + } else { + old_to_new_out[in_idx] = lookup->second; + } + } +} + +void dedup_vertices(TfragOutput& data) { + Timer timer; + size_t original_size = data.vertices.size(); + std::vector new_verts; + std::vector old_to_new; + + dedup_vertices(data.vertices, new_verts, old_to_new); + data.vertices = std::move(new_verts); + + for (auto& draw : data.strip_draws) { + ASSERT(draw.runs.empty()); // not supported yet + for (auto& idx : draw.plain_indices) { + idx = old_to_new.at(idx); + } + } + + lg::info("Deduplication took {:.2f} ms, {} -> {} ({:.2f} %)", timer.getMs(), original_size, + data.vertices.size(), 100.f * data.vertices.size() / original_size); +} + +DrawMode draw_mode_from_sampler(const tinygltf::Sampler& sampler) { + DrawMode mode = make_default_draw_mode(); + if (sampler.magFilter == TINYGLTF_TEXTURE_FILTER_NEAREST) { + ASSERT(sampler.minFilter == TINYGLTF_TEXTURE_FILTER_NEAREST); + mode.set_filt_enable(false); + } else { + ASSERT(sampler.minFilter != TINYGLTF_TEXTURE_FILTER_NEAREST); + mode.set_filt_enable(true); + } + + switch (sampler.wrapS) { + case TINYGLTF_TEXTURE_WRAP_CLAMP_TO_EDGE: + mode.set_clamp_s_enable(true); + break; + case TINYGLTF_TEXTURE_WRAP_REPEAT: + mode.set_clamp_s_enable(false); + break; + default: + ASSERT(false); + } + + switch (sampler.wrapT) { + case TINYGLTF_TEXTURE_WRAP_CLAMP_TO_EDGE: + mode.set_clamp_t_enable(true); + break; + case TINYGLTF_TEXTURE_WRAP_REPEAT: + mode.set_clamp_t_enable(false); + break; + default: + ASSERT(false); + } + + return mode; +} + +void extract(const Input& in, + TfragOutput& out, + const tinygltf::Model& model, + const std::vector& all_nodes) { + std::vector> all_vtx_colors; + ASSERT(out.vertices.empty()); + std::map draw_by_material; + int mesh_count = 0; + int prim_count = 0; + + for (const auto& n : all_nodes) { + const auto& node = model.nodes[n.node_idx]; + if (node.mesh >= 0) { + const auto& mesh = model.meshes[node.mesh]; + if (!mesh.extras.Has("tfrag")) { + // fmt::print("skip tfrag: {}\n", mesh.name); + // continue; + } + mesh_count++; + for (const auto& prim : mesh.primitives) { + prim_count++; + // extract index buffer + std::vector prim_indices = gltf_index_buffer(model, prim.indices, out.vertices.size()); + ASSERT_MSG(prim.mode == TINYGLTF_MODE_TRIANGLES, "Unsupported triangle mode"); + // extract vertices + auto verts = + gltf_vertices(model, prim.attributes, n.w_T_node, in.get_colors, false, mesh.name); + out.vertices.insert(out.vertices.end(), verts.vtx.begin(), verts.vtx.end()); + if (in.get_colors) { + all_vtx_colors.insert(all_vtx_colors.end(), verts.vtx_colors.begin(), + verts.vtx_colors.end()); + ASSERT(all_vtx_colors.size() == out.vertices.size()); + } + + // TODO: just putting it all in one material + auto& draw = draw_by_material[prim.material]; + draw.mode = make_default_draw_mode(); // todo rm + draw.tree_tex_id = texture_pool_debug_checker(in.tex_pool); // todo rm + draw.num_triangles += prim_indices.size() / 3; + if (draw.vis_groups.empty()) { + auto& grp = draw.vis_groups.emplace_back(); + grp.num_inds += prim_indices.size(); + grp.num_tris += draw.num_triangles; + grp.vis_idx_in_pc_bvh = UINT32_MAX; + } else { + auto& grp = draw.vis_groups.back(); + grp.num_inds += prim_indices.size(); + grp.num_tris += draw.num_triangles; + grp.vis_idx_in_pc_bvh = UINT32_MAX; + } + + draw.plain_indices.insert(draw.plain_indices.end(), prim_indices.begin(), + prim_indices.end()); + } + } + } + + for (const auto& [mat_idx, d_] : draw_by_material) { + out.strip_draws.push_back(d_); + auto& draw = out.strip_draws.back(); + draw.mode = make_default_draw_mode(); + + if (mat_idx == -1) { + lg::warn("Draw had a material index of -1, using default texture."); + draw.tree_tex_id = texture_pool_debug_checker(in.tex_pool); + continue; + } + const auto& mat = model.materials[mat_idx]; + int tex_idx = mat.pbrMetallicRoughness.baseColorTexture.index; + if (tex_idx == -1) { + lg::warn("Material {} has no texture, using default texture.", mat.name); + draw.tree_tex_id = texture_pool_debug_checker(in.tex_pool); + continue; + } + + const auto& tex = model.textures[tex_idx]; + ASSERT(tex.sampler >= 0); + ASSERT(tex.source >= 0); + draw.mode = draw_mode_from_sampler(model.samplers.at(tex.sampler)); + + const auto& img = model.images[tex.source]; + draw.tree_tex_id = texture_pool_add_texture(in.tex_pool, img); + } + lg::info("total of {} unique materials", out.strip_draws.size()); + + lg::info("Merged {} meshes and {} prims into {} vertices", mesh_count, prim_count, + out.vertices.size()); + + if (in.get_colors) { + Timer quantize_timer; + auto quantized = quantize_colors_octree(all_vtx_colors, 1024); + for (size_t i = 0; i < out.vertices.size(); i++) { + out.vertices[i].color_index = quantized.vtx_to_color[i]; + } + out.color_palette = std::move(quantized.final_colors); + lg::info("Color palette generation took {:.2f} ms", quantize_timer.getMs()); + } + + dedup_vertices(out); +} + +std::optional> subdivide_face_if_needed(CollideFace face_in) { + math::Vector3f v_min = face_in.v[0]; + v_min.min_in_place(face_in.v[1]); + v_min.min_in_place(face_in.v[2]); + v_min -= 16.f; + bool needs_subdiv = false; + for (auto& vert : face_in.v) { + if ((vert - v_min).squared_length() > 154.f * 154.f * 4096.f * 4096.f) { + needs_subdiv = true; + break; + } + } + + if (needs_subdiv) { + math::Vector3f a = (face_in.v[0] + face_in.v[1]) * 0.5f; + math::Vector3f b = (face_in.v[1] + face_in.v[2]) * 0.5f; + math::Vector3f c = (face_in.v[2] + face_in.v[0]) * 0.5f; + math::Vector3f v0 = face_in.v[0]; + math::Vector3f v1 = face_in.v[1]; + math::Vector3f v2 = face_in.v[2]; + CollideFace fs[4]; + fs[0].v[0] = v0; + fs[0].v[1] = a; + fs[0].v[2] = c; + fs[0].bsphere = math::bsphere_of_triangle(face_in.v); + + fs[1].v[0] = a; + fs[1].v[1] = v1; + fs[1].v[2] = b; + fs[1].bsphere = math::bsphere_of_triangle(fs[1].v); + fs[1].pat = face_in.pat; + + fs[2].v[0] = a; + fs[2].v[1] = b; + fs[2].v[2] = c; + fs[2].bsphere = math::bsphere_of_triangle(fs[2].v); + fs[2].pat = face_in.pat; + + fs[3].v[0] = b; + fs[3].v[1] = v2; + fs[3].v[2] = c; + fs[3].bsphere = math::bsphere_of_triangle(fs[3].v); + fs[3].pat = face_in.pat; + + std::vector result; + for (auto f : fs) { + auto next_faces = subdivide_face_if_needed(f); + if (next_faces) { + result.insert(result.end(), next_faces->begin(), next_faces->end()); + } else { + result.push_back(f); + } + } + return result; + } else { + return std::nullopt; + } +} + +void extract(const Input& /*in*/, + CollideOutput& out, + const tinygltf::Model& model, + const std::vector& all_nodes) { + int mesh_count = 0; + int prim_count = 0; + int suspicious_faces = 0; + + for (const auto& n : all_nodes) { + const auto& node = model.nodes[n.node_idx]; + if (node.mesh >= 0) { + const auto& mesh = model.meshes[node.mesh]; + if (!mesh.extras.Has("collide")) { + // fmt::print("skip collide: {}\n", mesh.name); + // continue; + } + mesh_count++; + for (const auto& prim : mesh.primitives) { + prim_count++; + // extract index buffer + std::vector prim_indices = gltf_index_buffer(model, prim.indices, 0); + ASSERT_MSG(prim.mode == TINYGLTF_MODE_TRIANGLES, "Unsupported triangle mode"); + // extract vertices + auto verts = gltf_vertices(model, prim.attributes, n.w_T_node, false, true, mesh.name); + + for (size_t iidx = 0; iidx < prim_indices.size(); iidx += 3) { + CollideFace face; + + // get the positions + for (int j = 0; j < 3; j++) { + auto& vtx = verts.vtx.at(prim_indices.at(iidx + j)); + face.v[j].x() = vtx.x; + face.v[j].y() = vtx.y; + face.v[j].z() = vtx.z; + } + + // now face normal + math::Vector3f face_normal = + (face.v[2] - face.v[0]).cross(face.v[1] - face.v[0]).normalized(); + + float dots[3]; + for (int j = 0; j < 3; j++) { + dots[j] = face_normal.dot(verts.normals.at(prim_indices.at(iidx + j)).normalized()); + } + + if (dots[0] > 1e-3 && dots[1] > 1e-3 && dots[2] > 1e-3) { + suspicious_faces++; + auto temp = face.v[2]; + face.v[2] = face.v[1]; + face.v[1] = temp; + } + + face.bsphere = math::bsphere_of_triangle(face.v); + face.bsphere.w() += 1e-1; + for (int j = 0; j < 3; j++) { + float output_dist = face.bsphere.w() - (face.bsphere.xyz() - face.v[j]).length(); + if (output_dist < 0) { + fmt::print("{}\n", output_dist); + fmt::print("BAD:\n{}\n{}\n{}\n", face.v[0].to_string_aligned(), + face.v[1].to_string_aligned(), face.v[2].to_string_aligned()); + fmt::print("bsphere: {}\n", face.bsphere.to_string_aligned()); + } + } + + out.faces.push_back(face); + } + } + } + } + + std::vector fixed_faces; + int fix_count = 0; + for (auto& face : out.faces) { + auto try_fix = subdivide_face_if_needed(face); + if (try_fix) { + fix_count++; + fixed_faces.insert(fixed_faces.end(), try_fix->begin(), try_fix->end()); + } else { + fixed_faces.push_back(face); + } + } + out.faces = std::move(fixed_faces); + + lg::info("{} out of {} faces appeared to have wrong orientation and were flipped", + suspicious_faces, out.faces.size()); + lg::info("{} faces were too big and were subdivided", fix_count); + // lg::info("Collision extract{} {}", mesh_count, prim_count); +} + +void extract(const Input& in, Output& out) { + lg::info("Reading gltf mesh: {}", in.filename); + Timer read_timer; + tinygltf::TinyGLTF loader; + tinygltf::Model model; + std::string err, warn; + bool res = loader.LoadBinaryFromFile(&model, &err, &warn, in.filename); + ASSERT_MSG(warn.empty(), warn.c_str()); + ASSERT_MSG(err.empty(), err.c_str()); + ASSERT_MSG(res, "Failed to load GLTF file!"); + auto all_nodes = flatten_nodes_from_all_scenes(model); + extract(in, out.tfrag, model, all_nodes); + extract(in, out.collide, model, all_nodes); + lg::info("GLTF total took {:.2f} ms", read_timer.getMs()); +} +} // namespace gltf_mesh_extract diff --git a/goalc/build_level/gltf_mesh_extract.h b/goalc/build_level/gltf_mesh_extract.h new file mode 100644 index 0000000000..f429f07b9c --- /dev/null +++ b/goalc/build_level/gltf_mesh_extract.h @@ -0,0 +1,35 @@ +#pragma once + +#include + +#include "common/custom_data/Tfrag3Data.h" + +#include "goalc/build_level/TexturePool.h" +#include "goalc/build_level/collide_common.h" + +namespace gltf_mesh_extract { + +struct Input { + std::string filename; + TexturePool* tex_pool = nullptr; + bool get_colors = true; +}; + +struct TfragOutput { + std::vector strip_draws; + std::vector vertices; + std::vector> color_palette; +}; + +struct CollideOutput { + std::vector faces; +}; + +struct Output { + TfragOutput tfrag; + CollideOutput collide; +}; + +void extract(const Input& in, Output& out); + +} // namespace gltf_mesh_extract \ No newline at end of file diff --git a/goalc/compiler/CodeGenerator.cpp b/goalc/compiler/CodeGenerator.cpp index 50eee36f19..98be758210 100644 --- a/goalc/compiler/CodeGenerator.cpp +++ b/goalc/compiler/CodeGenerator.cpp @@ -5,13 +5,17 @@ * Currently owns the logic for emitting the function prologues/epilogues and stack spill ops. */ -#include -#include "goalc/debugger/DebugInfo.h" -#include "third-party/fmt/core.h" #include "CodeGenerator.h" -#include "goalc/emitter/IGen.h" + +#include + #include "IR.h" +#include "goalc/debugger/DebugInfo.h" +#include "goalc/emitter/IGen.h" + +#include "third-party/fmt/core.h" + using namespace emitter; CodeGenerator::CodeGenerator(FileEnv* env, DebugInfo* debug_info) diff --git a/goalc/compiler/CodeGenerator.h b/goalc/compiler/CodeGenerator.h index bc97bcd5c5..958c197d7e 100644 --- a/goalc/compiler/CodeGenerator.h +++ b/goalc/compiler/CodeGenerator.h @@ -8,6 +8,7 @@ #pragma once #include "Env.h" + #include "goalc/emitter/ObjectGenerator.h" class DebugInfo; diff --git a/goalc/compiler/Compiler.cpp b/goalc/compiler/Compiler.cpp index 86040ceb59..d0cdda805a 100644 --- a/goalc/compiler/Compiler.cpp +++ b/goalc/compiler/Compiler.cpp @@ -1,18 +1,28 @@ #include "Compiler.h" + #include #include + #include "CompilerException.h" #include "IR.h" + +#include "common/goos/PrettyPrinter.h" #include "common/link_types.h" +#include "common/util/FileUtil.h" + #include "goalc/make/Tools.h" #include "goalc/regalloc/Allocator.h" #include "goalc/regalloc/Allocator_v2.h" + #include "third-party/fmt/core.h" using namespace goos; Compiler::Compiler(const std::string& user_profile, std::unique_ptr repl) - : m_goos(user_profile), m_debugger(&m_listener, &m_goos.reader), m_repl(std::move(repl)) { + : m_goos(user_profile), + m_debugger(&m_listener, &m_goos.reader), + m_repl(std::move(repl)), + m_make(user_profile) { m_listener.add_debugger(&m_debugger); m_ts.add_builtin_types(); m_global_env = std::make_unique(); @@ -20,12 +30,12 @@ Compiler::Compiler(const std::string& user_profile, std::unique_ptr // let the build system run us m_make.add_tool(std::make_shared(this)); - m_make.add_tool(std::make_shared(this)); // load GOAL library Object library_code = m_goos.reader.read_from_file({"goal_src", "goal-lib.gc"}); compile_object_file("goal-lib", library_code, false); + // user profile stuff if (user_profile != "#f") { try { Object user_code = @@ -44,91 +54,63 @@ Compiler::Compiler(const std::string& user_profile, std::unique_ptr // load auto-complete history, only if we are running in the interactive mode. if (m_repl) { m_repl->load_history(); + // init repl + m_repl->print_welcome_message(); + auto examples = m_repl->examples; + auto regex_colors = m_repl->regex_colors; + m_repl->init_default_settings(); + using namespace std::placeholders; + m_repl->get_repl().set_completion_callback( + std::bind(&Compiler::find_symbols_by_prefix, this, _1, _2, std::cref(examples))); + m_repl->get_repl().set_hint_callback( + std::bind(&Compiler::find_hints_by_prefix, this, _1, _2, _3, std::cref(examples))); + m_repl->get_repl().set_highlighter_callback( + std::bind(&Compiler::repl_coloring, this, _1, _2, std::cref(regex_colors))); } // add GOOS forms that get info from the compiler setup_goos_forms(); } -ReplStatus Compiler::execute_repl(bool auto_listen, bool auto_debug) { - // init repl - m_repl->print_welcome_message(); - auto examples = m_repl->examples; - auto regex_colors = m_repl->regex_colors; - m_repl->init_default_settings(); - using namespace std::placeholders; - m_repl->get_repl().set_completion_callback( - std::bind(&Compiler::find_symbols_by_prefix, this, _1, _2, std::cref(examples))); - m_repl->get_repl().set_hint_callback( - std::bind(&Compiler::find_hints_by_prefix, this, _1, _2, _3, std::cref(examples))); - m_repl->get_repl().set_highlighter_callback( - std::bind(&Compiler::repl_coloring, this, _1, _2, std::cref(regex_colors))); - - std::string auto_input; - if (auto_debug || auto_listen) { - auto_input.append("(lt)"); - } - if (auto_debug) { - auto_input.append("(dbg) (:cont)"); - } - - while (!m_want_exit && !m_want_reload) { - try { - std::optional code; - - if (auto_input.empty()) { - // 1). get a line from the user (READ) - std::string prompt = fmt::format(fmt::emphasis::bold | fg(fmt::color::cyan), "g > "); - if (m_listener.is_connected()) { - prompt = fmt::format(fmt::emphasis::bold | fg(fmt::color::lime_green), "gc> "); - } - if (m_debugger.is_halted()) { - prompt = fmt::format(fmt::emphasis::bold | fg(fmt::color::magenta), "gs> "); - } else if (m_debugger.is_attached()) { - prompt = fmt::format(fmt::emphasis::bold | fg(fmt::color::red), "gr> "); - } - - code = m_goos.reader.read_from_stdin(prompt, *m_repl); - } else { - code = m_goos.reader.read_from_string(auto_input); - auto_input.clear(); - } - - if (!code) { - continue; - } - - // 2). compile - auto obj_file = compile_object_file("repl", *code, m_listener.is_connected()); - if (m_settings.debug_print_ir) { - obj_file->debug_print_tl(); - } - - if (!obj_file->is_empty()) { - // 3). color - color_object_file(obj_file); - - // 4). codegen - auto data = codegen_object_file(obj_file); - - // 4). send! - if (m_listener.is_connected()) { - m_listener.send_code(data); - if (!m_listener.most_recent_send_was_acked()) { - print_compiler_warning("Runtime is not responding. Did it crash?\n"); - } - } - } - - } catch (std::exception& e) { - print_compiler_warning("REPL Error: {}\n", e.what()); - } - } - +Compiler::~Compiler() { if (m_listener.is_connected()) { m_listener.send_reset(false); // reset the target m_listener.disconnect(); } +} + +ReplStatus Compiler::handle_repl_string(const std::string& input) { + if (input.empty()) { + return ReplStatus::OK; + } + + try { + // 1). read + goos::Object code = m_goos.reader.read_from_string(input, true); + // 2). compile + auto obj_file = compile_object_file("repl", code, m_listener.is_connected()); + if (m_settings.debug_print_ir) { + obj_file->debug_print_tl(); + } + + if (!obj_file->is_empty()) { + // 3). color + color_object_file(obj_file); + + // 4). codegen + auto data = codegen_object_file(obj_file); + + // 4). send! + if (m_listener.is_connected()) { + m_listener.send_code(data); + if (!m_listener.most_recent_send_was_acked()) { + print_compiler_warning("Runtime is not responding. Did it crash?\n"); + } + } + } + } catch (std::exception& e) { + print_compiler_warning("REPL Error: {}\n", e.what()); + } if (m_want_exit) { return ReplStatus::WANT_EXIT; @@ -184,11 +166,6 @@ Val* Compiler::compile_error_guard(const goos::Object& code, Env* env) { return compile(code, env); } catch (CompilerException& ce) { if (ce.print_err_stack) { - auto obj_print = code.print(); - if (obj_print.length() > 80) { - obj_print = obj_print.substr(0, 80); - obj_print += "..."; - } bool term; auto loc_info = m_goos.reader.db.get_info_for(code, &term); if (term) { @@ -197,7 +174,7 @@ Val* Compiler::compile_error_guard(const goos::Object& code, Env* env) { } fmt::print(fg(fmt::color::yellow) | fmt::emphasis::bold, "Code:\n"); - fmt::print("{}\n", obj_print); + fmt::print("{}\n", pretty_print::to_string(code, 120)); if (term) { ce.print_err_stack = false; @@ -212,12 +189,6 @@ Val* Compiler::compile_error_guard(const goos::Object& code, Env* env) { catch (std::runtime_error& e) { fmt::print(fg(fmt::color::crimson) | fmt::emphasis::bold, "-- Compilation Error! --\n"); fmt::print(fmt::emphasis::bold, "{}\n", e.what()); - - auto obj_print = code.print(); - if (obj_print.length() > 80) { - obj_print = obj_print.substr(0, 80); - obj_print += "..."; - } bool term; auto loc_info = m_goos.reader.db.get_info_for(code, &term); if (term) { @@ -226,7 +197,7 @@ Val* Compiler::compile_error_guard(const goos::Object& code, Env* env) { } fmt::print(fg(fmt::color::yellow) | fmt::emphasis::bold, "Code:\n"); - fmt::print("{}\n", obj_print); + fmt::print("{}\n", pretty_print::to_string(code, 120)); CompilerException ce("Compiler Exception"); if (term) { @@ -328,74 +299,6 @@ bool Compiler::codegen_and_disassemble_object_file(FileEnv* env, return ok; } -void Compiler::compile_and_send_from_string(const std::string& source_code) { - if (!connect_to_target()) { - throw std::runtime_error( - "Compiler failed to connect to target for compile_and_send_from_string."); - } - - auto code = m_goos.reader.read_from_string(source_code); - auto compiled = compile_object_file("test-code", code, true); - ASSERT(!compiled->is_empty()); - color_object_file(compiled); - auto data = codegen_object_file(compiled); - m_listener.send_code(data); - if (!m_listener.most_recent_send_was_acked()) { - print_compiler_warning("Runtime is not responding after sending test code. Did it crash?\n"); - } -} - -std::vector Compiler::run_test_from_file(const std::string& source_code) { - try { - if (!connect_to_target()) { - throw std::runtime_error("Compiler::run_test_from_file couldn't connect!"); - } - - auto code = m_goos.reader.read_from_file({source_code}); - auto compiled = compile_object_file("test-code", code, true); - if (compiled->is_empty()) { - return {}; - } - color_object_file(compiled); - auto data = codegen_object_file(compiled); - m_listener.record_messages(ListenerMessageKind::MSG_PRINT); - m_listener.send_code(data); - if (!m_listener.most_recent_send_was_acked()) { - print_compiler_warning("Runtime is not responding after sending test code. Did it crash?\n"); - } - return m_listener.stop_recording_messages(); - } catch (std::exception& e) { - fmt::print("[Compiler] Failed to compile test program {}: {}\n", source_code, e.what()); - throw e; - } -} - -std::vector Compiler::run_test_from_string(const std::string& src, - const std::string& obj_name) { - try { - if (!connect_to_target()) { - throw std::runtime_error("Compiler::run_test_from_file couldn't connect!"); - } - - auto code = m_goos.reader.read_from_string({src}); - auto compiled = compile_object_file(obj_name, code, true); - if (compiled->is_empty()) { - return {}; - } - color_object_file(compiled); - auto data = codegen_object_file(compiled); - m_listener.record_messages(ListenerMessageKind::MSG_PRINT); - m_listener.send_code(data); - if (!m_listener.most_recent_send_was_acked()) { - print_compiler_warning("Runtime is not responding after sending test code. Did it crash?\n"); - } - return m_listener.stop_recording_messages(); - } catch (std::exception& e) { - fmt::print("[Compiler] Failed to compile test program from string {}: {}\n", src, e.what()); - throw e; - } -} - bool Compiler::connect_to_target() { if (!m_listener.is_connected()) { for (int i = 0; i < 1000; i++) { @@ -412,52 +315,6 @@ bool Compiler::connect_to_target() { return true; } -/*! - * Just run the front end on a string. Will not do register allocation or code generation. - * Useful for typechecking, defining types, or running strings that invoke the compiler again. - */ -void Compiler::run_front_end_on_string(const std::string& src) { - auto code = m_goos.reader.read_from_string({src}); - compile_object_file("run-on-string", code, true); -} - -/*! - * Just run the front end on a file. Will not do register allocation or code generation. - * Useful for typechecking, defining types, or running strings that invoke the compiler again. - */ -void Compiler::run_front_end_on_file(const std::vector& path) { - auto code = m_goos.reader.read_from_file(path); - compile_object_file("run-on-file", code, true); -} - -/*! - * Run the entire compilation process on the input source code. Will generate an object file, but - * won't save it anywhere. - */ -void Compiler::run_full_compiler_on_string_no_save(const std::string& src, - const std::optional& string_name) { - auto code = m_goos.reader.read_from_string(src, true, string_name); - auto compiled = compile_object_file("run-on-string", code, true); - color_object_file(compiled); - codegen_object_file(compiled); -} - -std::vector Compiler::run_test_no_load(const std::string& source_code) { - auto code = m_goos.reader.read_from_file({source_code}); - compile_object_file("test-code", code, true); - return {}; -} - -void Compiler::shutdown_target() { - if (m_debugger.is_attached()) { - m_debugger.detach(); - } - - if (m_listener.is_connected()) { - m_listener.send_reset(true); - } -} - void Compiler::typecheck(const goos::Object& form, const TypeSpec& expected, const TypeSpec& actual, @@ -486,10 +343,6 @@ void Compiler::typecheck_reg_type_allow_false(const goos::Object& form, typecheck(form, expected, coerce_to_reg_type(actual->type()), error_message); } -bool Compiler::knows_object_file(const std::string& name) { - return m_debugger.knows_object(name); -} - void Compiler::setup_goos_forms() { m_goos.register_form("get-enum-vals", [&](const goos::Object& form, goos::Arguments& args, const std::shared_ptr& env) { @@ -521,3 +374,68 @@ void Compiler::setup_goos_forms() { return goos::build_list(enum_vals); }); } + +void Compiler::asm_file(const CompilationOptions& options) { + auto code = m_goos.reader.read_from_file({options.filename}); + + std::string obj_file_name = options.filename; + + // Extract object name from file name. + for (int idx = int(options.filename.size()) - 1; idx-- > 0;) { + if (options.filename.at(idx) == '\\' || options.filename.at(idx) == '/') { + obj_file_name = options.filename.substr(idx + 1); + break; + } + } + obj_file_name = obj_file_name.substr(0, obj_file_name.find_last_of('.')); + + // COMPILE + auto obj_file = compile_object_file(obj_file_name, code, !options.no_code); + + if (options.color) { + // register allocation + color_object_file(obj_file); + + // code/object file generation + std::vector data; + std::string disasm; + if (options.disassemble) { + codegen_and_disassemble_object_file(obj_file, &data, &disasm); + if (options.disassembly_output_file.empty()) { + printf("%s\n", disasm.c_str()); + } else { + file_util::write_text_file(options.disassembly_output_file, disasm); + } + } else { + data = codegen_object_file(obj_file); + } + + // send to target + if (options.load) { + if (m_listener.is_connected()) { + m_listener.send_code(data, obj_file_name); + } else { + printf("WARNING - couldn't load because listener isn't connected\n"); // todo log warn + } + } + + // save file + if (options.write) { + auto path = file_util::get_file_path({"out", "obj", obj_file_name + ".o"}); + file_util::create_dir_if_needed_for_file(path); + file_util::write_binary_file(path, (void*)data.data(), data.size()); + } + } else { + if (options.load) { + printf("WARNING - couldn't load because coloring is not enabled\n"); + } + + if (options.write) { + printf("WARNING - couldn't write because coloring is not enabled\n"); + } + + if (options.disassemble) { + printf("WARNING - couldn't disassemble because coloring is not enabled\n"); + } + } +} diff --git a/goalc/compiler/Compiler.h b/goalc/compiler/Compiler.h index a23f100c50..7a58808bcd 100644 --- a/goalc/compiler/Compiler.h +++ b/goalc/compiler/Compiler.h @@ -1,39 +1,61 @@ #pragma once #include +#include #include -#include "third-party/fmt/color.h" -#include "third-party/fmt/core.h" - #include "common/goos/Interpreter.h" #include "common/goos/ReplUtils.h" #include "common/type_system/TypeSystem.h" + #include "goalc/compiler/CompilerException.h" #include "goalc/compiler/CompilerSettings.h" #include "goalc/compiler/Env.h" #include "goalc/compiler/IR.h" #include "goalc/compiler/SymbolInfo.h" +#include "goalc/data_compiler/game_text_common.h" #include "goalc/debugger/Debugger.h" #include "goalc/emitter/Register.h" #include "goalc/listener/Listener.h" #include "goalc/make/MakeSystem.h" -#include "goalc/data_compiler/game_subtitle.h" + +#include "third-party/fmt/color.h" +#include "third-party/fmt/core.h" enum MathMode { MATH_INT, MATH_BINT, MATH_FLOAT, MATH_INVALID }; enum class ReplStatus { OK, WANT_EXIT, WANT_RELOAD }; +struct CompilationOptions { + std::string filename; // input file + std::string disassembly_output_file; // file to write, containing x86 assembly output + bool load = false; // send to target + bool color = false; // do register allocation/code generation passes + bool write = false; // write object file to out/obj + bool no_code = false; // file shouldn't generate code, throw error if it does + bool disassemble = false; // either print disassembly to stdout or output_file + bool print_time = false; // print timing statistics +}; + class Compiler { public: Compiler(const std::string& user_profile = "#f", std::unique_ptr repl = nullptr); - ReplStatus execute_repl(bool auto_listen = false, bool auto_debug = false); + ~Compiler(); + void asm_file(const CompilationOptions& options); + + void save_repl_history(); + void print_to_repl(const std::string_view& str); + std::string get_prompt(); + std::string get_repl_input(); + ReplStatus handle_repl_string(const std::string& input); goos::Interpreter& get_goos() { return m_goos; } FileEnv* compile_object_file(const std::string& name, goos::Object code, bool allow_emit); std::unique_ptr compile_top_level_function(const std::string& name, const goos::Object& code, Env* env); Val* compile(const goos::Object& code, Env* env); + Val* compile_no_const_prop(const goos::Object& code, Env* env); + Val* compile_error_guard(const goos::Object& code, Env* env); None* get_none() { return m_none.get(); } std::vector run_test_from_file(const std::string& source_code); @@ -54,7 +76,6 @@ class Compiler { listener::Listener& listener() { return m_listener; } void poke_target() { m_listener.send_poke(); } bool connect_to_target(); - GameSubtitleDB& subtitle_db() { return m_subtitle_db; } Replxx::completions_t find_symbols_by_prefix(std::string const& context, int& contextLen, std::vector const& user_data); @@ -66,6 +87,7 @@ class Compiler { Replxx::colors_t& colors, std::vector> const& user_data); bool knows_object_file(const std::string& name); + MakeSystem& make_system() { return m_make; } private: TypeSystem m_ts; @@ -85,7 +107,6 @@ class Compiler { SymbolInfoMap m_symbol_info; std::unique_ptr m_repl; MakeSystem m_make; - GameSubtitleDB m_subtitle_db; struct DebugStats { int num_spills = 0; @@ -211,7 +232,7 @@ class Compiler { const Val* actual, const std::string& error_message = ""); - TypeSpec parse_typespec(const goos::Object& src); + TypeSpec parse_typespec(const goos::Object& src, Env* env); bool is_local_symbol(const goos::Object& obj, Env* env); emitter::HWRegKind get_preferred_reg_kind(const TypeSpec& ts); Val* compile_real_function_call(const goos::Object& form, @@ -220,8 +241,10 @@ class Compiler { Env* env, const std::string& method_type_name = ""); - bool try_getting_constant_integer(const goos::Object& in, int64_t* out, Env* env); - bool try_getting_constant_float(const goos::Object& in, float* out, Env* env); + s64 get_constant_integer_or_error(const goos::Object& in, Env* env); + ValOrConstInt get_constant_integer_or_variable(const goos::Object& in, Env* env); + ValOrConstFloat get_constant_float_or_variable(const goos::Object& in, Env* env); + Val* compile_heap_new(const goos::Object& form, const std::string& allocation, const goos::Object& type, @@ -384,7 +407,9 @@ class Compiler { int get_size_for_size_of(const goos::Object& form, const goos::Object& rest); template - void throw_compiler_error(const goos::Object& code, const std::string& str, Args&&... args) { + [[noreturn]] void throw_compiler_error(const goos::Object& code, + const std::string& str, + Args&&... args) { fmt::print(fg(fmt::color::crimson) | fmt::emphasis::bold, "-- Compilation Error! --\n"); if (!str.empty() && str.back() == '\n') { fmt::print(fmt::emphasis::bold, str, std::forward(args)...); @@ -398,7 +423,7 @@ class Compiler { } template - void throw_compiler_error_no_code(const std::string& str, Args&&... args) { + [[noreturn]] void throw_compiler_error_no_code(const std::string& str, Args&&... args) { fmt::print(fg(fmt::color::crimson) | fmt::emphasis::bold, "-- Compilation Error! --\n"); if (!str.empty() && str.back() == '\n') { fmt::print(fmt::emphasis::bold, str, std::forward(args)...); @@ -430,6 +455,13 @@ class Compiler { Val*& enter_val); public: + struct ConstPropResult { + goos::Object value; + bool has_side_effects = true; + }; + ConstPropResult try_constant_propagation(const goos::Object& form, Env* env); + ConstPropResult constant_propagation_dispatch(const goos::Object& form, Env* env); + // Asm Val* compile_rlet(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_asm_ret(const goos::Object& form, const goos::Object& rest, Env* env); @@ -440,8 +472,6 @@ class Compiler { Val* compile_asm_load_sym(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_asm_jr(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_asm_mov(const goos::Object& form, const goos::Object& rest, Env* env); - Val* compile_asm_movn(const goos::Object& form, const goos::Object& rest, Env* env); - Val* compile_asm_slt(const goos::Object& form, const goos::Object& rest, Env* env); // Vector Float Operations Val* compile_asm_lvf(const goos::Object& form, const goos::Object& rest, Env* env); @@ -540,6 +570,7 @@ class Compiler { // Block Val* compile_begin(const goos::Object& form, const goos::Object& rest, Env* env); + ConstPropResult const_prop_begin(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_top_level(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_block(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_return_from(const goos::Object& form, const goos::Object& rest, Env* env); @@ -603,6 +634,7 @@ class Compiler { // Macro Val* compile_gscond(const goos::Object& form, const goos::Object& rest, Env* env); + ConstPropResult const_prop_gscond(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_quote(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_defglobalconstant(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_defconstant(const goos::Object& form, const goos::Object& rest, Env* env); @@ -651,6 +683,7 @@ class Compiler { Val* compile_none(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_defenum(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_size_of(const goos::Object& form, const goos::Object& rest, Env* env); + ConstPropResult const_prop_size_of(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_psize_of(const goos::Object& form, const goos::Object& rest, Env* env); // State diff --git a/goalc/compiler/CompilerSettings.h b/goalc/compiler/CompilerSettings.h index 634e189f61..61d788d3a5 100644 --- a/goalc/compiler/CompilerSettings.h +++ b/goalc/compiler/CompilerSettings.h @@ -3,8 +3,9 @@ #ifndef JAK_COMPILERSETTINGS_H #define JAK_COMPILERSETTINGS_H -#include #include +#include + #include "common/goos/Object.h" class CompilerSettings { diff --git a/goalc/compiler/ConstantValue.h b/goalc/compiler/ConstantValue.h index 44a1c5071e..af02b21ebe 100644 --- a/goalc/compiler/ConstantValue.h +++ b/goalc/compiler/ConstantValue.h @@ -1,10 +1,12 @@ #pragma once #include + #include "common/common_types.h" -#include "common/util/BitUtils.h" -#include "third-party/fmt/core.h" #include "common/util/Assert.h" +#include "common/util/BitUtils.h" + +#include "third-party/fmt/core.h" struct U128 { U128() = default; diff --git a/goalc/compiler/Env.cpp b/goalc/compiler/Env.cpp index a157cf7127..de604c7aa0 100644 --- a/goalc/compiler/Env.cpp +++ b/goalc/compiler/Env.cpp @@ -1,9 +1,13 @@ -#include -#include "third-party/fmt/core.h" #include "Env.h" + +#include + #include "IR.h" + #include "common/goos/Reader.h" +#include "third-party/fmt/core.h" + /////////////////// // Env /////////////////// diff --git a/goalc/compiler/Env.h b/goalc/compiler/Env.h index 2ef9cbcd76..64a3ba7ce0 100644 --- a/goalc/compiler/Env.h +++ b/goalc/compiler/Env.h @@ -6,16 +6,19 @@ * manages the memory for stuff generated during compiling. */ -#include #include +#include #include -#include "common/type_system/TypeSpec.h" -#include "goalc/regalloc/allocator_interface.h" -#include "common/goos/Object.h" -#include "StaticObject.h" + #include "Label.h" +#include "StaticObject.h" #include "Val.h" +#include "common/goos/Object.h" +#include "common/type_system/TypeSpec.h" + +#include "goalc/regalloc/allocator_interface.h" + class FileEnv; class BlockEnv; class FunctionEnv; diff --git a/goalc/compiler/IR.cpp b/goalc/compiler/IR.cpp index 9c908f810c..0cf498fbcc 100644 --- a/goalc/compiler/IR.cpp +++ b/goalc/compiler/IR.cpp @@ -1,11 +1,15 @@ -#include #include "IR.h" -#include "goalc/emitter/IGen.h" -#include "third-party/fmt/core.h" + +#include + #include "common/symbols.h" -using namespace emitter; +#include "goalc/emitter/IGen.h" +#include "third-party/fmt/core.h" + +using namespace emitter; +using namespace jak1_symbols; // TODO jak 1 symbols namespace { Register get_reg(const RegVal* rv, const AllocationResult& allocs, emitter::IR_Record irec) { if (rv->rlet_constraint().has_value()) { @@ -553,6 +557,8 @@ std::string IR_IntegerMath::print() { return fmt::format("udiv {}, {}", m_dest->print(), m_arg->print()); case IntegerMathKind::IMOD_32: return fmt::format("imod {}, {}", m_dest->print(), m_arg->print()); + case IntegerMathKind::UMOD_32: + return fmt::format("umod {}, {}", m_dest->print(), m_arg->print()); case IntegerMathKind::SARV_64: return fmt::format("sarv {}, {}", m_dest->print(), m_arg->print()); case IntegerMathKind::SHLV_64: @@ -589,7 +595,7 @@ RegAllocInstr IR_IntegerMath::to_rai() { } if (m_kind == IntegerMathKind::IDIV_32 || m_kind == IntegerMathKind::IMOD_32 || - m_kind == IntegerMathKind::UDIV_32) { + m_kind == IntegerMathKind::UDIV_32 || m_kind == IntegerMathKind::UMOD_32) { rai.exclude.emplace_back(emitter::RDX); } return rai; @@ -645,8 +651,10 @@ void IR_IntegerMath::do_codegen(emitter::ObjectGenerator* gen, gen->add_instr(IGen::sar_gpr64_u8(get_reg(m_dest, allocs, irec), m_shift_amount), irec); break; case IntegerMathKind::IMUL_32: { + // just a 32-bit multiply, signed/unsigned doesn't affect lower 32 bits of result. auto dr = get_reg(m_dest, allocs, irec); gen->add_instr(IGen::imul_gpr32_gpr32(dr, get_reg(m_arg, allocs, irec)), irec); + // the PS2 sign extends the result even if we used multu. We replicate this here. gen->add_instr(IGen::movsx_r64_r32(dr, dr), irec); } break; case IntegerMathKind::IMUL_64: { @@ -662,6 +670,9 @@ void IR_IntegerMath::do_codegen(emitter::ObjectGenerator* gen, // zero extend, not sign extend to avoid overflow gen->add_instr(IGen::xor_gpr64_gpr64(Register(RDX), Register(RDX)), irec); gen->add_instr(IGen::unsigned_div_gpr32(get_reg(m_arg, allocs, irec)), irec); + // note: this probably needs hardware testing to know for sure if the PS2 actually sign + // extends here or not. Nothing seems to break either way, and PCSX2/Dobie interpreters both + // sign extend, so that seems like the safest option. gen->add_instr(IGen::movsx_r64_r32(get_reg(m_dest, allocs, irec), emitter::RAX), irec); } break; case IntegerMathKind::IMOD_32: { @@ -669,7 +680,13 @@ void IR_IntegerMath::do_codegen(emitter::ObjectGenerator* gen, gen->add_instr(IGen::idiv_gpr32(get_reg(m_arg, allocs, irec)), irec); gen->add_instr(IGen::movsx_r64_r32(get_reg(m_dest, allocs, irec), emitter::RDX), irec); } break; - + case IntegerMathKind::UMOD_32: { + // zero extend, not sign extend to avoid overflow + gen->add_instr(IGen::xor_gpr64_gpr64(Register(RDX), Register(RDX)), irec); + gen->add_instr(IGen::unsigned_div_gpr32(get_reg(m_arg, allocs, irec)), irec); + // see note on udiv, same applies here. + gen->add_instr(IGen::movsx_r64_r32(get_reg(m_dest, allocs, irec), emitter::RDX), irec); + } break; default: ASSERT(false); } diff --git a/goalc/compiler/IR.h b/goalc/compiler/IR.h index c56da37ab9..477d5036fe 100644 --- a/goalc/compiler/IR.h +++ b/goalc/compiler/IR.h @@ -1,11 +1,13 @@ #pragma once #include + #include "CodeGenerator.h" -#include "goalc/regalloc/allocator_interface.h" #include "Val.h" + #include "goalc/emitter/ObjectGenerator.h" #include "goalc/emitter/Register.h" +#include "goalc/regalloc/allocator_interface.h" class IR { public: @@ -201,6 +203,7 @@ enum class IntegerMathKind { SAR_64, SHR_64, IMOD_32, + UMOD_32, OR_64, AND_64, XOR_64, diff --git a/goalc/compiler/Lambda.h b/goalc/compiler/Lambda.h index 8be93f675b..ed8c17cf31 100644 --- a/goalc/compiler/Lambda.h +++ b/goalc/compiler/Lambda.h @@ -4,6 +4,7 @@ #define JAK_LAMBDA_H #include "common/goos/Object.h" +#include "common/type_system/TypeSpec.h" // note - we cannot easily reuse the GOOS argument system because GOAL's is slightly different. // there's no rest or keyword support. diff --git a/goalc/compiler/StaticObject.cpp b/goalc/compiler/StaticObject.cpp index 6343d13a5d..514c8517e0 100644 --- a/goalc/compiler/StaticObject.cpp +++ b/goalc/compiler/StaticObject.cpp @@ -1,8 +1,11 @@ -#include "third-party/fmt/core.h" #include "StaticObject.h" + #include "common/goal_constants.h" + #include "goalc/compiler/Env.h" +#include "third-party/fmt/core.h" + namespace { template uint32_t push_data_to_byte_vector(T data, std::vector& v) { diff --git a/goalc/compiler/StaticObject.h b/goalc/compiler/StaticObject.h index 95a19ce501..26cd318b68 100644 --- a/goalc/compiler/StaticObject.h +++ b/goalc/compiler/StaticObject.h @@ -2,11 +2,13 @@ #include #include + #include "common/type_system/TypeSpec.h" -#include "goalc/emitter/ObjectGenerator.h" -#include "goalc/compiler/ConstantValue.h" #include "common/util/BitUtils.h" +#include "goalc/compiler/ConstantValue.h" +#include "goalc/emitter/ObjectGenerator.h" + class FunctionEnv; class StaticObject { diff --git a/goalc/compiler/SymbolInfo.h b/goalc/compiler/SymbolInfo.h index ca66c1320d..56f4070b15 100644 --- a/goalc/compiler/SymbolInfo.h +++ b/goalc/compiler/SymbolInfo.h @@ -1,11 +1,12 @@ #pragma once -#include -#include #include -#include "common/util/Trie.h" +#include +#include + #include "common/goos/Object.h" #include "common/util/Assert.h" +#include "common/util/Trie.h" /*! * Info about a single symbol, representing one of: diff --git a/goalc/compiler/Util.cpp b/goalc/compiler/Util.cpp index 80be666c99..0e9f9d8ea3 100644 --- a/goalc/compiler/Util.cpp +++ b/goalc/compiler/Util.cpp @@ -1,8 +1,158 @@ -#include "goalc/compiler/Compiler.h" -#include "goalc/compiler/IR.h" #include "common/goos/ParseHelpers.h" #include "common/type_system/deftype.h" +#include "goalc/compiler/Compiler.h" +#include "goalc/compiler/IR.h" + +void Compiler::save_repl_history() { + m_repl->save_history(); +} + +void Compiler::print_to_repl(const std::string_view& str) { + m_repl->print_to_repl(str); +} + +std::string Compiler::get_prompt() { + std::string prompt = fmt::format(fmt::emphasis::bold | fg(fmt::color::cyan), "g > "); + if (m_listener.is_connected()) { + prompt = fmt::format(fmt::emphasis::bold | fg(fmt::color::lime_green), "gc> "); + } + if (m_debugger.is_halted()) { + prompt = fmt::format(fmt::emphasis::bold | fg(fmt::color::magenta), "gs> "); + } else if (m_debugger.is_attached()) { + prompt = fmt::format(fmt::emphasis::bold | fg(fmt::color::red), "gr> "); + } + return "\033[0m" + prompt; +} + +std::string Compiler::get_repl_input() { + auto str = m_repl->readline(get_prompt()); + if (str) { + m_repl->add_to_history(str); + return str; + } else { + return ""; + } +} + +void Compiler::compile_and_send_from_string(const std::string& source_code) { + if (!connect_to_target()) { + throw std::runtime_error( + "Compiler failed to connect to target for compile_and_send_from_string."); + } + + auto code = m_goos.reader.read_from_string(source_code); + auto compiled = compile_object_file("test-code", code, true); + ASSERT(!compiled->is_empty()); + color_object_file(compiled); + auto data = codegen_object_file(compiled); + m_listener.send_code(data); + if (!m_listener.most_recent_send_was_acked()) { + print_compiler_warning("Runtime is not responding after sending test code. Did it crash?\n"); + } +} + +std::vector Compiler::run_test_from_file(const std::string& source_code) { + try { + if (!connect_to_target()) { + throw std::runtime_error("Compiler::run_test_from_file couldn't connect!"); + } + + auto code = m_goos.reader.read_from_file({source_code}); + auto compiled = compile_object_file("test-code", code, true); + if (compiled->is_empty()) { + return {}; + } + color_object_file(compiled); + auto data = codegen_object_file(compiled); + m_listener.record_messages(ListenerMessageKind::MSG_PRINT); + m_listener.send_code(data); + if (!m_listener.most_recent_send_was_acked()) { + print_compiler_warning("Runtime is not responding after sending test code. Did it crash?\n"); + } + return m_listener.stop_recording_messages(); + } catch (std::exception& e) { + fmt::print("[Compiler] Failed to compile test program {}: {}\n", source_code, e.what()); + throw e; + } +} + +std::vector Compiler::run_test_from_string(const std::string& src, + const std::string& obj_name) { + try { + if (!connect_to_target()) { + throw std::runtime_error("Compiler::run_test_from_file couldn't connect!"); + } + + auto code = m_goos.reader.read_from_string({src}); + auto compiled = compile_object_file(obj_name, code, true); + if (compiled->is_empty()) { + return {}; + } + color_object_file(compiled); + auto data = codegen_object_file(compiled); + m_listener.record_messages(ListenerMessageKind::MSG_PRINT); + m_listener.send_code(data); + if (!m_listener.most_recent_send_was_acked()) { + print_compiler_warning("Runtime is not responding after sending test code. Did it crash?\n"); + } + return m_listener.stop_recording_messages(); + } catch (std::exception& e) { + fmt::print("[Compiler] Failed to compile test program from string {}: {}\n", src, e.what()); + throw e; + } +} + +/*! + * Just run the front end on a string. Will not do register allocation or code generation. + * Useful for typechecking, defining types, or running strings that invoke the compiler again. + */ +void Compiler::run_front_end_on_string(const std::string& src) { + auto code = m_goos.reader.read_from_string({src}); + compile_object_file("run-on-string", code, true); +} + +/*! + * Just run the front end on a file. Will not do register allocation or code generation. + * Useful for typechecking, defining types, or running strings that invoke the compiler again. + */ +void Compiler::run_front_end_on_file(const std::vector& path) { + auto code = m_goos.reader.read_from_file(path); + compile_object_file("run-on-file", code, true); +} + +/*! + * Run the entire compilation process on the input source code. Will generate an object file, but + * won't save it anywhere. + */ +void Compiler::run_full_compiler_on_string_no_save(const std::string& src, + const std::optional& string_name) { + auto code = m_goos.reader.read_from_string(src, true, string_name); + auto compiled = compile_object_file("run-on-string", code, true); + color_object_file(compiled); + codegen_object_file(compiled); +} + +std::vector Compiler::run_test_no_load(const std::string& source_code) { + auto code = m_goos.reader.read_from_file({source_code}); + compile_object_file("test-code", code, true); + return {}; +} + +void Compiler::shutdown_target() { + if (m_debugger.is_attached()) { + m_debugger.detach(); + } + + if (m_listener.is_connected()) { + m_listener.send_reset(true); + } +} + +bool Compiler::knows_object_file(const std::string& name) { + return m_debugger.knows_object(name); +} + /*! * Parse arguments into a goos::Arguments format. */ @@ -124,7 +274,11 @@ void Compiler::expect_empty_list(const goos::Object& o) { } } -TypeSpec Compiler::parse_typespec(const goos::Object& src) { +TypeSpec Compiler::parse_typespec(const goos::Object& src, Env* env) { + if (src.is_pair() && src.as_pair()->car.is_symbol("current-method-type") && + src.as_pair()->cdr.is_empty_list()) { + return env->function_env()->method_of_type_name; + } return ::parse_typespec(&m_ts, src); } @@ -182,58 +336,6 @@ bool Compiler::is_pair(const TypeSpec& ts) { return m_ts.tc(m_ts.make_typespec("pair"), ts); } -bool Compiler::try_getting_constant_integer(const goos::Object& in, int64_t* out, Env* env) { - (void)env; - if (in.is_int()) { - *out = in.as_int(); - return true; - } - - if (in.is_pair()) { - auto head = in.as_pair()->car; - if (head.is_symbol()) { - auto head_sym = head.as_symbol(); - auto enum_type = m_ts.try_enum_lookup(head_sym->name); - if (enum_type) { - bool success; - u64 as_enum = enum_lookup(in, enum_type, in.as_pair()->cdr, false, &success); - if (success) { - *out = as_enum; - return true; - } - } - - if (head_sym->name == "size-of") { - *out = get_size_for_size_of(in, in.as_pair()->cdr); - return true; - } - } - } - - if (in.is_symbol()) { - auto global_constant = m_global_constants.find(in.as_symbol()); - if (global_constant != m_global_constants.end()) { - // recursively get constant integer, so we can have constants set to constants, etc. - if (try_getting_constant_integer(global_constant->second, out, env)) { - return true; - } - } - } - - return false; -} - -bool Compiler::try_getting_constant_float(const goos::Object& in, float* out, Env* env) { - (void)env; - if (in.is_float()) { - *out = in.as_float(); - return true; - } - - // todo, try more things like constants before giving up. - return false; -} - bool Compiler::get_true_or_false(const goos::Object& form, const goos::Object& boolean) { // todo try other things. if (boolean.is_symbol()) { diff --git a/goalc/compiler/Val.cpp b/goalc/compiler/Val.cpp index 3a15a1c924..c79c64ea4c 100644 --- a/goalc/compiler/Val.cpp +++ b/goalc/compiler/Val.cpp @@ -1,8 +1,10 @@ -#include "third-party/fmt/core.h" #include "Val.h" + #include "Env.h" #include "IR.h" +#include "third-party/fmt/core.h" + /*! * Fallback to_gpr if a more optimized one is not provided. */ diff --git a/goalc/compiler/Val.h b/goalc/compiler/Val.h index 94a19c8b90..12f7958241 100644 --- a/goalc/compiler/Val.h +++ b/goalc/compiler/Val.h @@ -5,15 +5,18 @@ * The GOAL Value. A value represents a place (where the value is stored) and a type. */ -#include -#include -#include #include -#include "common/type_system/TypeSystem.h" -#include "goalc/regalloc/IRegister.h" +#include +#include +#include + #include "Lambda.h" #include "StaticObject.h" + +#include "common/type_system/TypeSystem.h" + #include "goalc/compiler/ConstantValue.h" +#include "goalc/regalloc/IRegister.h" class RegVal; class Env; @@ -293,3 +296,18 @@ class BitFieldVal : public Val { bool m_sign_extend = false; bool m_use_128 = false; }; + +template +struct ValOrConstant { + explicit ValOrConstant(const T& c) : constant(c), val(nullptr) {} + explicit ValOrConstant(Val* v) : val(v) {} + + T constant; + Val* val = nullptr; + + bool is_constant() const { return val == nullptr; } + bool is_variable() const { return val != nullptr; } +}; + +using ValOrConstInt = ValOrConstant; +using ValOrConstFloat = ValOrConstant; \ No newline at end of file diff --git a/goalc/compiler/compilation/Asm.cpp b/goalc/compiler/compilation/Asm.cpp index 091ad8e89e..ecbef4fbf6 100644 --- a/goalc/compiler/compilation/Asm.cpp +++ b/goalc/compiler/compilation/Asm.cpp @@ -54,7 +54,7 @@ Val* Compiler::compile_rlet(const goos::Object& form, const goos::Object& rest, // get the type of the new place TypeSpec ts = m_ts.make_typespec("object"); if (def_args.has_named("type")) { - ts = parse_typespec(def_args.named.at("type")); + ts = parse_typespec(def_args.named.at("type"), env); } // figure out the class @@ -590,11 +590,7 @@ Val* Compiler::compile_asm_int128_math2_imm_u8(const goos::Object& form, auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env); auto src = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env); - s64 imm; - if (!try_getting_constant_integer(args.unnamed.at(2), &imm, env)) { - throw_compiler_error(form, "Could not evaluate {} as a compile-time integer.", - args.unnamed.at(2).print()); - } + s64 imm = get_constant_integer_or_error(args.unnamed.at(2), env); if (imm < 0 || imm > 255) { throw_compiler_error(form, "Immediate {} is invalid. The value {} is out of range for a uint8.", diff --git a/goalc/compiler/compilation/Atoms.cpp b/goalc/compiler/compilation/Atoms.cpp index 6cbdae3331..3d491a129c 100644 --- a/goalc/compiler/compilation/Atoms.cpp +++ b/goalc/compiler/compilation/Atoms.cpp @@ -262,10 +262,7 @@ const std::unordered_map< {"define-virtual-state-hook", &Compiler::compile_define_virtual_state_hook}, }; -/*! - * Highest level compile function - */ -Val* Compiler::compile(const goos::Object& code, Env* env) { +Val* Compiler::compile_no_const_prop(const goos::Object& code, Env* env) { switch (code.type) { case goos::ObjectType::PAIR: return compile_pair(code, env); @@ -285,6 +282,14 @@ Val* Compiler::compile(const goos::Object& code, Env* env) { return get_none(); } +/*! + * Highest level compile function + */ +Val* Compiler::compile(const goos::Object& code, Env* env) { + // auto propagated = try_constant_propagation(code, env); + return compile_no_const_prop(code, env); +} + /*! * Compile a pair/list. * Can be a compiler form, function call (possibly inlined), method call, immediate application of a @@ -297,18 +302,18 @@ Val* Compiler::compile_pair(const goos::Object& code, Env* env) { if (head.is_symbol()) { auto head_sym = head.as_symbol(); - // first try as a goal compiler form - auto kv_gfs = g_goal_forms.find(head_sym->name); - if (kv_gfs != g_goal_forms.end()) { - return ((*this).*(kv_gfs->second))(code, rest, env); - } - - // next try as a macro + // first try as a macro goos::Object macro_obj; if (try_getting_macro_from_goos(head, ¯o_obj)) { return compile_goos_macro(code, macro_obj, rest, head, env); } + // next try as a goal compiler form + auto kv_gfs = g_goal_forms.find(head_sym->name); + if (kv_gfs != g_goal_forms.end()) { + return ((*this).*(kv_gfs->second))(code, rest, env); + } + // next try as an enum auto enum_type = m_ts.try_enum_lookup(head_sym->name); if (enum_type) { @@ -384,6 +389,7 @@ Val* Compiler::compile_get_symbol_value(const goos::Object& form, /*! * Compile a symbol. Can get mlet macro symbols, local variables, constants, or symbols. + * Note: order of checks here should match try_constant_propagation */ Val* Compiler::compile_symbol(const goos::Object& form, Env* env) { auto name = symbol_string(form); diff --git a/goalc/compiler/compilation/CompilerControl.cpp b/goalc/compiler/compilation/CompilerControl.cpp index ab975f8006..2b7bf77244 100644 --- a/goalc/compiler/compilation/CompilerControl.cpp +++ b/goalc/compiler/compilation/CompilerControl.cpp @@ -11,12 +11,12 @@ #include "common/util/DgoWriter.h" #include "common/util/FileUtil.h" #include "common/util/Timer.h" + #include "goalc/compiler/Compiler.h" #include "goalc/compiler/IR.h" #include "goalc/data_compiler/dir_tpages.h" #include "goalc/data_compiler/game_count.h" -#include "goalc/data_compiler/game_text.h" -#include "goalc/data_compiler/game_subtitle.h" +#include "goalc/data_compiler/game_text_common.h" /*! * Exit the compiler. Disconnects the listener and tells the target to reset itself. @@ -66,10 +66,7 @@ Val* Compiler::compile_asm_data_file(const goos::Object& form, const goos::Objec auto args = get_va(form, rest); va_check(form, args, {goos::ObjectType::SYMBOL, goos::ObjectType::STRING}, {}); auto kind = symbol_string(args.unnamed.at(0)); - if (kind == "game-text") { - // TODO version - compile_game_text(as_string(args.unnamed.at(1))); - } else if (kind == "game-count") { + if (kind == "game-count") { compile_game_count(as_string(args.unnamed.at(1))); } else if (kind == "dir-tpages") { compile_dir_tpages(as_string(args.unnamed.at(1))); @@ -85,19 +82,34 @@ Val* Compiler::compile_asm_data_file(const goos::Object& form, const goos::Objec Val* Compiler::compile_asm_text_file(const goos::Object& form, const goos::Object& rest, Env* env) { (void)env; auto args = get_va(form, rest); - va_check(form, args, {goos::ObjectType::SYMBOL, goos::ObjectType::INTEGER}, - {{"files", {true, goos::ObjectType::PAIR}}}); - auto kind = symbol_string(args.unnamed.at(0)); + va_check(form, args, {goos::ObjectType::SYMBOL}, {{"files", {true, goos::ObjectType::PAIR}}}); + + // list of files per text version. + std::unordered_map> inputs; + + // what kind of text file? + const auto kind = symbol_string(args.unnamed.at(0)); + + // open all project files specified (usually one). + for_each_in_list(args.named.at("files"), [this, &inputs, &form, &kind](const goos::Object& o) { + if (o.is_string()) { + open_text_project(kind, o.as_string()->data, inputs); + } else { + throw_compiler_error(form, "Invalid object {} in asm-text-file files list.", o.print()); + } + }); + + // compile files. if (kind == "subtitle") { - std::vector files; - for_each_in_list(args.named.at("files"), [this, &files, &form](const goos::Object& o) { - if (o.is_string()) { - files.push_back(o.as_string()->data); - } else { - throw_compiler_error(form, "Invalid object {} in asm-text-file files list.", o.print()); - } - }); - compile_game_subtitle(files, (GameTextVersion)args.unnamed.at(1).as_int(), m_subtitle_db); + for (auto& [ver, in] : inputs) { + GameSubtitleDB db; + compile_game_subtitle(in, ver, db); + } + } else if (kind == "text") { + for (auto& [ver, in] : inputs) { + GameTextDB db; + compile_game_text(in, ver, db); + } } else { throw_compiler_error(form, "The option {} was not recognized for asm-text-file.", kind); } @@ -111,17 +123,8 @@ Val* Compiler::compile_asm_text_file(const goos::Object& form, const goos::Objec Val* Compiler::compile_asm_file(const goos::Object& form, const goos::Object& rest, Env* env) { (void)env; int i = 0; - std::string filename; - std::string disasm_filename = ""; - bool load = false; - bool color = false; - bool write = false; - bool no_code = false; - bool disassemble = false; - bool no_time_prints = false; - - std::vector> timing; - Timer total_timer; + CompilationOptions options; + bool no_throw = false; // parse arguments bool last_was_disasm = false; @@ -129,28 +132,28 @@ Val* Compiler::compile_asm_file(const goos::Object& form, const goos::Object& re if (last_was_disasm) { last_was_disasm = false; if (o.type == goos::ObjectType::STRING) { - disasm_filename = as_string(o); + options.disassembly_output_file = as_string(o); i++; return; } } if (i == 0) { - filename = as_string(o); + options.filename = as_string(o); } else { auto setting = symbol_string(o); if (setting == ":load") { - load = true; + options.load = true; } else if (setting == ":color") { - color = true; + options.color = true; } else if (setting == ":write") { - write = true; + options.write = true; } else if (setting == ":no-code") { - no_code = true; + options.no_code = true; + } else if (setting == ":no-throw") { + no_throw = true; } else if (setting == ":disassemble") { - disassemble = true; + options.disassemble = true; last_was_disasm = true; - } else if (setting == ":no-time-prints") { - no_time_prints = true; } else { throw_compiler_error(form, "The option {} was not recognized for asm-file.", setting); } @@ -158,89 +161,11 @@ Val* Compiler::compile_asm_file(const goos::Object& form, const goos::Object& re i++; }); - // READ - Timer reader_timer; - auto code = m_goos.reader.read_from_file({filename}); - timing.emplace_back("read", reader_timer.getMs()); - - Timer compile_timer; - std::string obj_file_name = filename; - - // Extract object name from file name. - for (int idx = int(filename.size()) - 1; idx-- > 0;) { - if (filename.at(idx) == '\\' || filename.at(idx) == '/') { - obj_file_name = filename.substr(idx + 1); - break; - } - } - obj_file_name = obj_file_name.substr(0, obj_file_name.find_last_of('.')); - - // COMPILE - auto obj_file = compile_object_file(obj_file_name, code, !no_code); - timing.emplace_back("compile", compile_timer.getMs()); - - if (color) { - // register allocation - Timer color_timer; - color_object_file(obj_file); - timing.emplace_back("color", color_timer.getMs()); - - // code/object file generation - Timer codegen_timer; - std::vector data; - std::string disasm; - if (disassemble) { - codegen_and_disassemble_object_file(obj_file, &data, &disasm); - if (disasm_filename == "") { - printf("%s\n", disasm.c_str()); - } else { - file_util::write_text_file(disasm_filename, disasm); - } - } else { - data = codegen_object_file(obj_file); - } - timing.emplace_back("codegen", codegen_timer.getMs()); - - // send to target - if (load) { - if (m_listener.is_connected()) { - m_listener.send_code(data, obj_file_name); - } else { - printf("WARNING - couldn't load because listener isn't connected\n"); // todo log warn - } - } - - // save file - if (write) { - auto path = file_util::get_file_path({"out", "obj", obj_file_name + ".o"}); - file_util::create_dir_if_needed_for_file(path); - file_util::write_binary_file(path, (void*)data.data(), data.size()); - } - } else { - if (load) { - printf("WARNING - couldn't load because coloring is not enabled\n"); - } - - if (write) { - printf("WARNING - couldn't write because coloring is not enabled\n"); - } - - if (disassemble) { - printf("WARNING - couldn't disassemble because coloring is not enabled\n"); - } - } - - if (m_settings.print_timing) { - printf("F: %36s ", obj_file_name.c_str()); - timing.emplace_back("total", total_timer.getMs()); - for (auto& e : timing) { - printf(" %12s %4.0f", e.first.c_str(), e.second); - } - printf("\n"); - } else { - auto total_time = total_timer.getMs(); - if (total_time > 10.0 && color && !no_time_prints) { - fmt::print("[ASM-FILE] {} took {:.2f} ms\n", obj_file_name, total_time); + try { + asm_file(options); + } catch (std::runtime_error& e) { + if (!no_throw) { + throw_compiler_error(form, "Error while compiling file: {}", e.what()); } } diff --git a/goalc/compiler/compilation/ConstantPropagation.cpp b/goalc/compiler/compilation/ConstantPropagation.cpp new file mode 100644 index 0000000000..900baa400e --- /dev/null +++ b/goalc/compiler/compilation/ConstantPropagation.cpp @@ -0,0 +1,319 @@ +#include "goalc/compiler/Compiler.h" + +/*! + * Main table for compiler forms that can be constant propagated. + */ +const std::unordered_map + g_const_prop_forms = { + // INLINE ASM + {"begin", &Compiler::const_prop_begin}, + {"size-of", &Compiler::const_prop_size_of}, + {"#cond", &Compiler::const_prop_gscond}}; + +// Note: writing const_prop functions is a bit tricky because you have to try expanding macros, but +// if you decide that you can't constant propagate, then there's no way to "undo" any side effects +// from the macro expansion. So the solution is to return a form with all macro expansions already +// applied. + +// The result should be a goos Object that is either code to be compiled, or some constant +// integer/string/float/symbol. The const prop functions should emit no code. + +/*! + * Constant propagate a form like: + * (begin a b c d ...) + * The head doesn't have to be "begin" and it will still work (the form argument is ignored). + * + * If constant propagation fails, it will return a form like + * (begin a c ..) + * where the head is always begin (even if it wasn't originally), and some of a, b, c... + * may be macro expanded, or omitted if they have no side effects. + * + * If constant propagation succeeds (the expression is a compile time constant with no side effects) + * it will return a single value. The other values don't matter at all. + * + * This applies constant propagation recursively, so elements may be macro expanded and nested + * begins can be eliminated. + * + * This function can generally be used to constant propagate any "body" of code. + */ +Compiler::ConstPropResult Compiler::const_prop_begin(const goos::Object& /*form*/, + const goos::Object& rest, + Env* env) { + ConstPropResult result; + result.has_side_effects = false; + result.value = goos::PairObject::make_new({}, {}); + goos::Object* out_it = &result.value.as_pair()->cdr; + const goos::Object* it = &rest; + while (!it->is_empty_list()) { + const goos::Object& obj = it->as_pair()->car; + + auto this_elt_prop = + result.has_side_effects ? ConstPropResult{obj, true} : try_constant_propagation(obj, env); + if (this_elt_prop.has_side_effects) { + result.has_side_effects = true; + } + it = &it->as_pair()->cdr; + if (it->is_empty_list() && !result.has_side_effects) { + // can throw out the begin and replace it with the last thing + return this_elt_prop; + } + + if (this_elt_prop.has_side_effects) { + *out_it = goos::PairObject::make_new(this_elt_prop.value, {}); + out_it = &out_it->as_pair()->cdr; + } + } + + result.value.as_pair()->car = m_goos.intern("begin"); + *out_it = goos::Object::make_empty_list(); + + return result; +} + +/*! + * Constant propagate a #cond form. + * This will always evaluate the actual conditions. + * In cases where we return none, it gives up constant propagation, as we can't really do anything + * with that. + * In other cases, it tries to constant propagate the body of the matching case. + */ +Compiler::ConstPropResult Compiler::const_prop_gscond(const goos::Object& form, + const goos::Object& rest, + Env* env) { + if (!rest.is_pair()) { + throw_compiler_error(form, "#cond must have at least one clause, which must be a form"); + } + + goos::Object lst = rest; + for (;;) { + if (lst.is_pair()) { + goos::Object current_case = lst.as_pair()->car; + if (!current_case.is_pair()) { + throw_compiler_error(lst, "Bad case in #cond"); + } + + // check condition: + goos::Object condition_result = m_goos.eval_with_rewind( + current_case.as_pair()->car, m_goos.global_environment.as_env_ptr()); + if (m_goos.truthy(condition_result)) { + if (current_case.as_pair()->cdr.is_empty_list()) { + // would return none, let's just return that this has side effects and let the compiler + // handle it. + return {form, true}; + } + // got a match! + return const_prop_begin(current_case, current_case.as_pair()->cdr, env); + } else { + // no match, continue. + lst = lst.as_pair()->cdr; + } + } else if (lst.is_empty_list()) { + return {form, true}; + } else { + throw_compiler_error(form, "malformed #cond"); + } + } +} + +namespace { +size_t code_size(Env* e) { + auto fe = e->function_env(); + if (fe) { + return fe->code().size(); + } else { + return 0; + } +} +} // namespace + +Compiler::ConstPropResult Compiler::try_constant_propagation(const goos::Object& form, Env* env) { + size_t start_size = code_size(env); + auto ret = constant_propagation_dispatch(form, env); + size_t end_size = code_size(env); + if (start_size != end_size) { + fmt::print("Compiler bug in constant propagation. Code was generated: {} vs {}\n", start_size, + end_size); + ASSERT(false); + } + return ret; +} + +/*! + * Main constant propagation dispatch. + * Note that there are some tricky orders to get right here - we don't want to use a global constant + * when the normal compiler would use a lexical variable. + */ +Compiler::ConstPropResult Compiler::constant_propagation_dispatch(const goos::Object& code, + Env* env) { + // first, expand macros. + // this only does something if code is a pair, and for pairs macros are the first check. + auto expanded = expand_macro_completely(code, env); + + switch (expanded.type) { + case goos::ObjectType::INTEGER: + case goos::ObjectType::STRING: + case goos::ObjectType::FLOAT: + // we got a plain value, no code is needed to figure out the value and we can return it + // directly. + return {expanded, false}; + case goos::ObjectType::SYMBOL: { + // NOTE: order must match compile_symbol + // #t/#f + // mlet + // lexical + // constant/symbol + + // first, try to resolve the symbol in an mlet environment. + auto mlet_env = env->symbol_macro_env(); + while (mlet_env) { + auto mlkv = mlet_env->macros.find(expanded.as_symbol()); + if (mlkv != mlet_env->macros.end()) { + // we found a match, substitute and keep trying. + return try_constant_propagation(mlkv->second, env); + } + mlet_env = mlet_env->parent()->symbol_macro_env(); + } + + // see if it's a local variable + auto lexical = env->lexical_lookup(expanded); + if (lexical) { + // if so, that's what we should use, not a constant with the same name. + // give up on constant propagation, we never do it for lexicals (can't really in a single + // pass). + return {expanded, true}; + } + + // it can either be a global or symbol + const auto& global_constant = m_global_constants.find(expanded.as_symbol()); + const auto& existing_symbol = m_symbol_types.find(expanded.as_symbol()->name); + + // see if it's a constant + if (global_constant != m_global_constants.end()) { + // check there is no symbol with the same name, this is likely a bug and complain. + if (existing_symbol != m_symbol_types.end()) { + throw_compiler_error( + code, + "Ambiguous symbol: {} is both a global variable and a constant and it " + "is not clear which should be used here."); + } + + // got a global constant + return try_constant_propagation(global_constant->second, env); + } else { + // return to the compiler, we can't figure it out. + return {expanded, true}; + } + } break; + + case goos::ObjectType::PAIR: { + auto pair = expanded.as_pair(); + auto head = pair->car; + auto rest = pair->cdr; + + // in theory you could write code like: + // ((#if PC_PORT foo bar) ...) + // and you might want the compiler to constant propagate (foo ...) + // but this is not implemented because the logic in compile_function_or_method_call + // is quite complicated and this case seems unlikely to ever be used. + + if (head.is_symbol()) { + auto head_sym = head.as_symbol(); + // the first thing tried should be macros, but we already did that. And it iterates until + // all are expanded, so we don't need to do it again. + + // first try as a goal compiler form + auto kv_gfs = g_const_prop_forms.find(head_sym->name); + if (kv_gfs != g_const_prop_forms.end()) { + return ((*this).*(kv_gfs->second))(expanded, rest, env); + } + + const auto& kv_goal = g_goal_forms.find(head_sym->name); + if (kv_goal != g_goal_forms.end()) { + // it's a compiler form that we can't constant propagate. + return {expanded, true}; + } + } + + return {expanded, true}; + } + default: + return {expanded, true}; + } +} + +s64 Compiler::get_constant_integer_or_error(const goos::Object& in, Env* env) { + auto prop = try_constant_propagation(in, env); + if (prop.value.is_pair()) { + auto head = prop.value.as_pair()->car; + if (head.is_symbol()) { + auto head_sym = head.as_symbol(); + auto enum_type = m_ts.try_enum_lookup(head_sym->name); + if (enum_type) { + bool success; + u64 as_enum = + enum_lookup(prop.value, enum_type, prop.value.as_pair()->cdr, false, &success); + if (success) { + return as_enum; + } + } + } + } + + if (prop.has_side_effects) { + throw_compiler_error(in, "Value {} cannot be used as a constant - it has side effects.", + in.print()); + } else { + if (prop.value.is_int()) { + return prop.value.as_int(); + } else { + throw_compiler_error( + in, "Value {} cannot be used as a constant integer - it has the wrong type.", in.print()); + } + } +} + +ValOrConstInt Compiler::get_constant_integer_or_variable(const goos::Object& in, Env* env) { + auto prop = try_constant_propagation(in, env); + + if (prop.value.is_pair()) { + auto head = prop.value.as_pair()->car; + if (head.is_symbol()) { + auto head_sym = head.as_symbol(); + auto enum_type = m_ts.try_enum_lookup(head_sym->name); + if (enum_type) { + bool success; + u64 as_enum = + enum_lookup(prop.value, enum_type, prop.value.as_pair()->cdr, false, &success); + if (success) { + return ValOrConstInt(as_enum); + } + } + } + } + + if (prop.has_side_effects) { + return ValOrConstInt(compile_no_const_prop(prop.value, env)); + } else { + if (prop.value.is_int()) { + return ValOrConstInt(prop.value.as_int()); + } else { + return ValOrConstInt(compile_no_const_prop(prop.value, env)); + } + } +} + +ValOrConstFloat Compiler::get_constant_float_or_variable(const goos::Object& in, Env* env) { + auto prop = try_constant_propagation(in, env); + if (prop.has_side_effects) { + return ValOrConstFloat(compile_no_const_prop(prop.value, env)); + } else { + if (prop.value.is_float()) { + return ValOrConstFloat(prop.value.as_float()); + } else { + return ValOrConstFloat(compile_no_const_prop(prop.value, env)); + } + } +} \ No newline at end of file diff --git a/goalc/compiler/compilation/ControlFlow.cpp b/goalc/compiler/compilation/ControlFlow.cpp index c8eafb0b33..4a122667d8 100644 --- a/goalc/compiler/compilation/ControlFlow.cpp +++ b/goalc/compiler/compilation/ControlFlow.cpp @@ -3,9 +3,10 @@ * Compiler forms related to conditional branching and control flow. */ -#include "goalc/compiler/Compiler.h" #include "common/goos/ParseHelpers.h" +#include "goalc/compiler/Compiler.h" + /*! * Convert an expression into a GoalCondition for use in a conditional branch. * diff --git a/goalc/compiler/compilation/Debug.cpp b/goalc/compiler/compilation/Debug.cpp index ef5cd8e2d6..4d13ec2939 100644 --- a/goalc/compiler/compilation/Debug.cpp +++ b/goalc/compiler/compilation/Debug.cpp @@ -1,6 +1,8 @@ +#include "common/util/FileUtil.h" + #include "goalc/compiler/Compiler.h" #include "goalc/debugger/disassemble.h" -#include "common/util/FileUtil.h" + #include "third-party/fmt/core.h" u32 Compiler::parse_address_spec(const goos::Object& form) { diff --git a/goalc/compiler/compilation/Define.cpp b/goalc/compiler/compilation/Define.cpp index d3cb1fdc75..2d3603a57e 100644 --- a/goalc/compiler/compilation/Define.cpp +++ b/goalc/compiler/compilation/Define.cpp @@ -3,9 +3,10 @@ * Forms which define or set things. */ -#include "goalc/compiler/Compiler.h" #include "common/log/log.h" +#include "goalc/compiler/Compiler.h" + /*! * Define or set a global value. Has some special magic to store data for functions which may be * inlined. @@ -76,7 +77,7 @@ Val* Compiler::compile_define_extern(const goos::Object& form, const goos::Objec auto& sym = args.unnamed.at(0); auto& typespec = args.unnamed.at(1); - auto new_type = parse_typespec(typespec); + auto new_type = parse_typespec(typespec, env); auto existing_type = m_symbol_types.find(symbol_string(sym)); if (existing_type != m_symbol_types.end() && existing_type->second != new_type) { diff --git a/goalc/compiler/compilation/Function.cpp b/goalc/compiler/compilation/Function.cpp index bdf1d77e09..3e0eac37cc 100644 --- a/goalc/compiler/compilation/Function.cpp +++ b/goalc/compiler/compilation/Function.cpp @@ -5,6 +5,7 @@ #include "goalc/compiler/Compiler.h" #include "goalc/emitter/CallingConvention.h" + #include "third-party/fmt/core.h" namespace { @@ -71,7 +72,7 @@ Val* Compiler::compile_local_vars(const goos::Object& form, const goos::Object& auto param_args = get_va(o, o); va_check(o, param_args, {goos::ObjectType::SYMBOL, {}}, {}); auto name = symbol_string(param_args.unnamed.at(0)); - auto type = parse_typespec(param_args.unnamed.at(1)); + auto type = parse_typespec(param_args.unnamed.at(1), env); if (fe->params.find(name) != fe->params.end()) { throw_compiler_error(form, "Cannot declare a local named {}, this already exists.", name); @@ -129,7 +130,7 @@ Val* Compiler::compile_lambda(const goos::Object& form, const goos::Object& rest GoalArg parm; parm.name = symbol_string(param_args.unnamed.at(0)); - parm.type = parse_typespec(param_args.unnamed.at(1)); + parm.type = parse_typespec(param_args.unnamed.at(1), env); lambda.params.push_back(parm); lambda_ts.add_arg(parm.type); @@ -687,7 +688,7 @@ Val* Compiler::compile_declare(const goos::Object& form, const goos::Object& res throw_compiler_error( form, "Declare asm-func must provide the function's return type as an argument."); } - fe->asm_func_return_type = parse_typespec(rrest->as_pair()->car); + fe->asm_func_return_type = parse_typespec(rrest->as_pair()->car, env); if (!rrest->as_pair()->cdr.is_empty_list()) { throw_compiler_error(first, "Invalid asm-func declare"); } diff --git a/goalc/compiler/compilation/Macro.cpp b/goalc/compiler/compilation/Macro.cpp index 13cb7e5695..ed68e198e9 100644 --- a/goalc/compiler/compilation/Macro.cpp +++ b/goalc/compiler/compilation/Macro.cpp @@ -1,7 +1,9 @@ -#include "goalc/compiler/Compiler.h" -#include "third-party/fmt/core.h" #include "common/goos/PrettyPrinter.h" +#include "goalc/compiler/Compiler.h" + +#include "third-party/fmt/core.h" + using namespace goos; /*! @@ -35,11 +37,9 @@ Val* Compiler::compile_goos_macro(const goos::Object& o, auto mac_env = mac_env_obj.as_env_ptr(); mac_env->parent_env = m_goos.global_environment.as_env_ptr(); m_goos.set_args_in_env(o, args, macro->args, mac_env); - m_goos.goal_to_goos.enclosing_method_type = env->function_env()->method_of_type_name; auto goos_result = m_goos.eval_list_return_last(macro->body, macro->body, mac_env); // make the macro expanded form point to the source where the macro was used for error messages. // m_goos.reader.db.inherit_info(o, goos_result); - m_goos.goal_to_goos.reset(); auto compile_env_for_macro = env->function_env()->alloc_env(env, name.as_symbol(), macro->body, o); diff --git a/goalc/compiler/compilation/Math.cpp b/goalc/compiler/compilation/Math.cpp index 8105200720..0eca1167af 100644 --- a/goalc/compiler/compilation/Math.cpp +++ b/goalc/compiler/compilation/Math.cpp @@ -1,7 +1,9 @@ -#include "goalc/compiler/Compiler.h" -#include "common/util/BitUtils.h" #include +#include "common/util/BitUtils.h" + +#include "goalc/compiler/Compiler.h" + MathMode Compiler::get_math_mode(const TypeSpec& ts) { if (m_ts.tc(m_ts.make_typespec("binteger"), ts)) { return MATH_BINT; @@ -530,14 +532,15 @@ Val* Compiler::compile_shl(const goos::Object& form, const goos::Object& rest, E auto args = get_va(form, rest); va_check(form, args, {{}, {}}, {}); auto first = compile_error_guard(args.unnamed.at(0), env)->to_gpr(form, env); - int64_t constant_sa = -1; - if (try_getting_constant_integer(args.unnamed.at(1), &constant_sa, env)) { - if (constant_sa < 0 || constant_sa > 64) { + + auto sa = get_constant_integer_or_variable(args.unnamed.at(1), env); + if (sa.is_constant()) { + if (sa.constant < 0 || sa.constant > 64) { throw_compiler_error(form, "Cannot shift by more than 64, or by a negative amount."); } - return compile_fixed_shift(form, first, constant_sa, env, IntegerMathKind::SHL_64); + return compile_fixed_shift(form, first, sa.constant, env, IntegerMathKind::SHL_64); } else { - auto second = compile_error_guard(args.unnamed.at(1), env)->to_gpr(form, env); + auto second = sa.val->to_gpr(form, env); return compile_variable_shift(form, first, second, env, IntegerMathKind::SHLV_64); } } @@ -546,14 +549,15 @@ Val* Compiler::compile_shr(const goos::Object& form, const goos::Object& rest, E auto args = get_va(form, rest); va_check(form, args, {{}, {}}, {}); auto first = compile_error_guard(args.unnamed.at(0), env)->to_gpr(form, env); - int64_t constant_sa = -1; - if (try_getting_constant_integer(args.unnamed.at(1), &constant_sa, env)) { - if (constant_sa < 0 || constant_sa > 64) { + + auto sa = get_constant_integer_or_variable(args.unnamed.at(1), env); + if (sa.is_constant()) { + if (sa.constant < 0 || sa.constant > 64) { throw_compiler_error(form, "Cannot shift by more than 64, or by a negative amount."); } - return compile_fixed_shift(form, first, constant_sa, env, IntegerMathKind::SHR_64); + return compile_fixed_shift(form, first, sa.constant, env, IntegerMathKind::SHR_64); } else { - auto second = compile_error_guard(args.unnamed.at(1), env)->to_gpr(form, env); + auto second = sa.val->to_gpr(form, env); return compile_variable_shift(form, first, second, env, IntegerMathKind::SHRV_64); } } @@ -562,14 +566,15 @@ Val* Compiler::compile_sar(const goos::Object& form, const goos::Object& rest, E auto args = get_va(form, rest); va_check(form, args, {{}, {}}, {}); auto first = compile_error_guard(args.unnamed.at(0), env)->to_gpr(form, env); - int64_t constant_sa = -1; - if (try_getting_constant_integer(args.unnamed.at(1), &constant_sa, env)) { - if (constant_sa < 0 || constant_sa > 64) { + + auto sa = get_constant_integer_or_variable(args.unnamed.at(1), env); + if (sa.is_constant()) { + if (sa.constant < 0 || sa.constant > 64) { throw_compiler_error(form, "Cannot shift by more than 64, or by a negative amount."); } - return compile_fixed_shift(form, first, constant_sa, env, IntegerMathKind::SAR_64); + return compile_fixed_shift(form, first, sa.constant, env, IntegerMathKind::SAR_64); } else { - auto second = compile_error_guard(args.unnamed.at(1), env)->to_gpr(form, env); + auto second = sa.val->to_gpr(form, env); return compile_variable_shift(form, first, second, env, IntegerMathKind::SARV_64); } } @@ -618,7 +623,11 @@ Val* Compiler::compile_mod(const goos::Object& form, const goos::Object& rest, E con.desired_register = emitter::RAX; fenv->constrain(con); - env->emit_ir(form, IntegerMathKind::IMOD_32, result, second); + env->emit_ir(form, + is_singed_integer_or_binteger(first->type()) + ? IntegerMathKind::IMOD_32 + : IntegerMathKind::UMOD_32, + result, second); auto result_moved = env->make_gpr(first->type()); env->emit_ir(form, result_moved, result); diff --git a/goalc/compiler/compilation/State.cpp b/goalc/compiler/compilation/State.cpp index 56a778c1ff..6ce4d36729 100644 --- a/goalc/compiler/compilation/State.cpp +++ b/goalc/compiler/compilation/State.cpp @@ -1,6 +1,7 @@ -#include "goalc/compiler/Compiler.h" #include "common/type_system/state.h" +#include "goalc/compiler/Compiler.h" + /*! * Helper func for compiling the set!'s within defstates */ @@ -12,8 +13,9 @@ void Compiler::compile_state_handler_set(StructureType* state_type_info, Env* env, Val*& code_val, Val*& enter_val) { - // do not set state handler field if handler is #f, that's already the value in the static data - // but what if it's ACTUALLY setting it to #f??? see crate-buzzer wait + // do not set state handler field if handler is *no-state* + // we don't use #f here because you might want to actually set the state to #f + // (see crate-buzzer wait) auto& arg = args.named.at(name); if (!(arg.is_symbol() && arg.as_symbol()->name == "*no-state*")) { auto field = get_field_of_structure(state_type_info, state_object, name, env); diff --git a/goalc/compiler/compilation/Static.cpp b/goalc/compiler/compilation/Static.cpp index 9ac4f3042c..b3c9e3297c 100644 --- a/goalc/compiler/compilation/Static.cpp +++ b/goalc/compiler/compilation/Static.cpp @@ -4,10 +4,12 @@ * This is the front end for things in StaticObject.cpp */ -#include "goalc/compiler/Compiler.h" -#include "third-party/fmt/core.h" #include "common/goos/ParseHelpers.h" +#include "goalc/compiler/Compiler.h" + +#include "third-party/fmt/core.h" + /*! * Compile the fields of a static structure into the given StaticStructure*, applying an offset. * This can be used to generate an entire structure (set offset to 0), or to fill out an inline @@ -32,8 +34,7 @@ void Compiler::compile_static_structure_inline(const goos::Object& form, auto field_name_def = symbol_string(pair_car(*field_defs)); field_defs = &pair_cdr(*field_defs); - auto field_value = pair_car(*field_defs); - field_value = expand_macro_completely(field_value, env); + auto field_value = expand_macro_completely(pair_car(*field_defs), env); field_defs = &pair_cdr(*field_defs); if (field_name_def.at(0) != ':') { @@ -84,7 +85,7 @@ void Compiler::compile_static_structure_inline(const goos::Object& form, "Array field must be defined with (new 'static ['array, 'inline-array] type-name ...)"); } - auto array_content_type = parse_typespec(new_form.at(3)); + auto array_content_type = parse_typespec(new_form.at(3), env); if (is_inline) { if (field_info.field.type() != array_content_type) { @@ -96,11 +97,7 @@ void Compiler::compile_static_structure_inline(const goos::Object& form, m_ts.typecheck_and_throw(field_info.field.type(), array_content_type, "Array content type"); } - s64 elt_array_len; - if (!try_getting_constant_integer(new_form.at(4), &elt_array_len, env)) { - throw_compiler_error(field_value, "Array field size is invalid, got {}", - new_form.at(4).print()); - } + s64 elt_array_len = get_constant_integer_or_error(new_form.at(4), env); if (elt_array_len != field_info.field.array_size()) { throw_compiler_error(field_value, "Array field had an expected size of {} but got {}", @@ -171,7 +168,7 @@ void Compiler::compile_static_structure_inline(const goos::Object& form, "Inline field must be defined with (new 'static 'type-name ...)"); } - auto inlined_type = parse_typespec(unquote(new_form.at(2))); + auto inlined_type = parse_typespec(unquote(new_form.at(2)), env); if (inlined_type != field_info.type) { throw_compiler_error(field_value, "Cannot store a {} in an inline {}", inlined_type.print(), field_info.type.print()); @@ -321,7 +318,8 @@ Val* Compiler::compile_bitfield_definition(const goos::Object& form, // dynamic_defs list below. The second pass will combine the constant and dynamic defs to build // the final value. struct DynamicDef { - goos::Object definition; + // goos::Object definition; + RegVal* value = nullptr; int field_offset, field_size; std::string field_name; // for error message TypeSpec expected_type; @@ -351,9 +349,8 @@ Val* Compiler::compile_bitfield_definition(const goos::Object& form, if (is_integer(field_info.result_type) || field_info.result_type.base_type() == "pointer") { // first, try as a constant - s64 value = 0; - bool got_constant = false; - got_constant = try_getting_constant_integer(field_value, &value, env); + auto compiled_field_val = get_constant_integer_or_variable(field_value, env); + bool got_constant = compiled_field_val.is_constant(); if (!got_constant && is_bitfield(field_info.result_type) && !allow_dynamic_construction) { auto static_result = compile_static(field_value, env); if (static_result.is_constant_data()) { @@ -362,7 +359,9 @@ Val* Compiler::compile_bitfield_definition(const goos::Object& form, typecheck(field_value, field_info.result_type, static_result.typespec(), "Type of static constant"); got_constant = true; - value = constant_data.value_64(); + compiled_field_val.val = nullptr; + compiled_field_val.constant = constant_data.value_64(); + // TODO: handle this in the constant propagation stuff } } } @@ -370,7 +369,7 @@ Val* Compiler::compile_bitfield_definition(const goos::Object& form, // failed to get as constant, add to dynamic or error. if (allow_dynamic_construction) { DynamicDef dyn; - dyn.definition = field_value; + dyn.value = compiled_field_val.val->to_gpr(field_value, env); dyn.field_offset = field_offset; dyn.field_size = field_size; dyn.field_name = field_name_def; @@ -383,11 +382,11 @@ Val* Compiler::compile_bitfield_definition(const goos::Object& form, } else { throw_compiler_error(form, "Field {} is an integer, but the value given couldn't be " - "converted to an integer at compile time.", - field_name_def); + "converted to an integer at compile time: {}", + field_name_def, field_value.print()); } } else { - u64 unsigned_value = value; + u64 unsigned_value = compiled_field_val.constant; u64 or_value = unsigned_value; ASSERT(field_size <= 64); // shift us all the way left to clear upper bits. @@ -415,12 +414,13 @@ Val* Compiler::compile_bitfield_definition(const goos::Object& form, "bytes. This is probably not what you wanted to do."); } - float value = 0.f; - if (!try_getting_constant_float(field_value, &value, env)) { + // float value = 0.f; + auto float_value_or_const = get_constant_float_or_variable(field_value, env); + if (float_value_or_const.is_variable()) { // failed to get as constant, add to dynamic or error. if (allow_dynamic_construction) { DynamicDef dyn; - dyn.definition = field_value; + dyn.value = float_value_or_const.val->to_gpr(field_value, env); dyn.field_offset = field_offset; dyn.field_size = field_size; dyn.field_name = field_name_def; @@ -432,20 +432,21 @@ Val* Compiler::compile_bitfield_definition(const goos::Object& form, "be converted to a float at compile time.", field_name_def); } - } - u64 float_value = float_as_u32(value); - bool start_lo = field_offset < 64; - bool end_lo = (field_offset + field_size) <= 64; - ASSERT(start_lo == end_lo); - if (end_lo) { - constant_integer_part.lo |= (float_value << field_offset); } else { - constant_integer_part.hi |= (float_value << (field_offset - 64)); + u64 float_value = float_as_u32(float_value_or_const.constant); + bool start_lo = field_offset < 64; + bool end_lo = (field_offset + field_size) <= 64; + ASSERT(start_lo == end_lo); + if (end_lo) { + constant_integer_part.lo |= (float_value << field_offset); + } else { + constant_integer_part.hi |= (float_value << (field_offset - 64)); + } } } else if (field_info.result_type == TypeSpec("symbol")) { if (allow_dynamic_construction) { DynamicDef dyn; - dyn.definition = field_value; + dyn.value = compile_error_guard(field_value, env)->to_gpr(field_value, env); dyn.field_offset = field_offset; dyn.field_size = field_size; dyn.field_name = field_name_def; @@ -459,7 +460,7 @@ Val* Compiler::compile_bitfield_definition(const goos::Object& form, } else if (m_ts.tc(TypeSpec("structure"), field_info.result_type)) { if (allow_dynamic_construction) { DynamicDef dyn; - dyn.definition = field_value; + dyn.value = compile_error_guard(field_value, env)->to_gpr(field_value, env); dyn.field_offset = field_offset; dyn.field_size = field_size; dyn.field_name = field_name_def; @@ -499,7 +500,7 @@ Val* Compiler::compile_bitfield_definition(const goos::Object& form, auto xmm_temp = fe->make_ireg(TypeSpec("object"), RegClass::INT_128); for (auto& def : dynamic_defs) { - auto field_val_in = compile_error_guard(def.definition, env)->to_gpr(def.definition, env); + auto field_val_in = def.value; auto field_val = env->make_gpr(field_val_in->type()); env->emit_ir(form, field_val, field_val_in); if (!m_ts.tc(def.expected_type, field_val->type())) { @@ -541,7 +542,7 @@ Val* Compiler::compile_bitfield_definition(const goos::Object& form, } else { RegVal* integer_reg = integer->to_gpr(form, env); for (auto& def : dynamic_defs) { - auto field_val_in = compile_error_guard(def.definition, env)->to_gpr(def.definition, env); + auto field_val_in = def.value; auto field_val = env->make_gpr(field_val_in->type()); env->emit_ir(form, field_val, field_val_in); if (!m_ts.tc(def.expected_type, field_val->type())) { @@ -735,7 +736,7 @@ StaticResult Compiler::compile_static(const goos::Object& form_before_macro, Env } else if (unquote(args.at(1)).as_symbol()->name == "inline-array") { return fill_static_inline_array(form, rest, env, segment); } else { - auto ts = parse_typespec(unquote(args.at(1))); + auto ts = parse_typespec(unquote(args.at(1)), env); if (ts == TypeSpec("string")) { // (new 'static 'string) if (rest.is_pair() && rest.as_pair()->cdr.is_empty_list() && @@ -762,25 +763,21 @@ StaticResult Compiler::compile_static(const goos::Object& form_before_macro, Env } else if (first.is_symbol() && first.as_symbol()->name == "the-as") { auto args = get_va(form, rest); va_check(form, args, {{}, {}}, {}); - auto type = parse_typespec(args.unnamed.at(0)); + auto type = parse_typespec(args.unnamed.at(0), env); if (type == TypeSpec("float")) { - s64 value; - if (try_getting_constant_integer(args.unnamed.at(1), &value, env)) { - if (integer_fits(value, 4, false)) { - return StaticResult::make_constant_data(value, TypeSpec("float")); - } + s64 value = get_constant_integer_or_error(args.unnamed.at(1), env); + if (integer_fits(value, 4, false)) { + return StaticResult::make_constant_data(value, TypeSpec("float")); } } } else if (first.is_symbol() && first.as_symbol()->name == "the") { auto args = get_va(form, rest); va_check(form, args, {{}, {}}, {}); - auto type = parse_typespec(args.unnamed.at(0)); + auto type = parse_typespec(args.unnamed.at(0), env); if (type == TypeSpec("binteger")) { - s64 value; - if (try_getting_constant_integer(args.unnamed.at(1), &value, env)) { - if (integer_fits(value, 4, true)) { - return StaticResult::make_constant_data(value << 3, TypeSpec("binteger")); - } + s64 value = get_constant_integer_or_error(args.unnamed.at(1), env); + if (integer_fits(value, 4, true)) { + return StaticResult::make_constant_data(value << 3, TypeSpec("binteger")); } } } else if (first.is_symbol("type-ref")) { @@ -823,10 +820,8 @@ StaticResult Compiler::compile_static(const goos::Object& form_before_macro, Env return StaticResult::make_func_ref(lambda->func, lambda->type()); } else { // maybe an enum - s64 int_out; - if (try_getting_constant_integer(form, &int_out, env)) { - return StaticResult::make_constant_data(int_out, TypeSpec("int")); - } + s64 int_out = get_constant_integer_or_error(form, env); + return StaticResult::make_constant_data(int_out, TypeSpec("int")); } } @@ -884,11 +879,8 @@ StaticResult Compiler::fill_static_array(const goos::Object& form, if (args.size() < 4) { throw_compiler_error(form, "new static array must have type and min-size arguments"); } - auto content_type = parse_typespec(args.at(2)); - s64 min_size; - if (!try_getting_constant_integer(args.at(3), &min_size, env)) { - throw_compiler_error(form, "The length {} is not valid.", args.at(3).print()); - } + auto content_type = parse_typespec(args.at(2), env); + s64 min_size = get_constant_integer_or_error(args.at(3), env); s32 length = std::max(min_size, s64(args.size() - 4)); // todo - generalize this array stuff if we ever need other types of static arrays. auto pointer_type = m_ts.make_pointer_typespec(content_type); @@ -923,33 +915,33 @@ StaticResult Compiler::fill_static_boxed_array(const goos::Object& form, auto args = get_va(form, rest); if (args.unnamed.size() < 2) { - throw_compiler_error(form, "new static boxed array must have type and min-size arguments"); + throw_compiler_error(form, "new static boxed array must have heap and type arguments"); } if (!args.has_named("type")) { throw_compiler_error(form, "boxed array must have type"); } - auto content_type = parse_typespec(args.get_named("type")); + auto content_type = parse_typespec(args.get_named("type"), env); + + s64 initialized_count = args.unnamed.size() - 2; - if (!args.has_named("length")) { - throw_compiler_error(form, "boxed array must have length"); - } s64 length; - if (!try_getting_constant_integer(args.get_named("length"), &length, env)) { - throw_compiler_error(form, "boxed array has invalid length"); + if (!args.has_named("length")) { + length = initialized_count; + } else { + length = get_constant_integer_or_error(args.get_named("length"), env); } s64 allocated_length; if (args.has_named("allocated-length")) { - if (!try_getting_constant_integer(args.get_named("allocated-length"), &allocated_length, env)) { - throw_compiler_error(form, "boxed array has invalid allocated-length"); + if (!args.has_named("length")) { + throw_compiler_error(form, "boxed array must length if it also has allocated-length"); } + allocated_length = get_constant_integer_or_error(args.get_named("allocated-length"), env); } else { allocated_length = length; } - s64 initialized_count = args.unnamed.size() - 2; - if (initialized_count > length) { throw_compiler_error(form, "Initialized {} elements, but length was {}", initialized_count, length); @@ -1032,7 +1024,7 @@ void Compiler::fill_static_inline_array_inline(const goos::Object& form, elt_def, "Inline array element must be defined with (new 'static 'type-name ...)"); } - auto inlined_type = parse_typespec(unquote(new_form.at(2))); + auto inlined_type = parse_typespec(unquote(new_form.at(2)), env); if (inlined_type != content_type) { throw_compiler_error(elt_def, "Cannot store a {} in an inline array of {}", inlined_type.print(), content_type.print()); @@ -1056,11 +1048,8 @@ StaticResult Compiler::fill_static_inline_array(const goos::Object& form, if (args.size() < 4) { throw_compiler_error(form, "new static boxed array must have type and min-size arguments"); } - auto content_type = parse_typespec(args.at(2)); - s64 min_size; - if (!try_getting_constant_integer(args.at(3), &min_size, env)) { - throw_compiler_error(form, "The length {} is not valid.", args.at(3).print()); - } + auto content_type = parse_typespec(args.at(2), env); + s64 min_size = get_constant_integer_or_error(args.at(3), env); s32 length = std::max(min_size, s64(args.size() - 4)); auto inline_array_type = m_ts.make_inline_array_typespec(content_type); diff --git a/goalc/compiler/compilation/Type.cpp b/goalc/compiler/compilation/Type.cpp index ff91256438..c730125754 100644 --- a/goalc/compiler/compilation/Type.cpp +++ b/goalc/compiler/compilation/Type.cpp @@ -1,10 +1,12 @@ -#include "goalc/compiler/Compiler.h" -#include "third-party/fmt/core.h" #include "common/type_system/defenum.h" #include "common/type_system/deftype.h" -#include "goalc/emitter/CallingConvention.h" -#include "common/util/math_util.h" #include "common/type_system/state.h" +#include "common/util/math_util.h" + +#include "goalc/compiler/Compiler.h" +#include "goalc/emitter/CallingConvention.h" + +#include "third-party/fmt/core.h" namespace { @@ -463,7 +465,7 @@ Val* Compiler::compile_defmethod(const goos::Object& form, const goos::Object& _ GoalArg parm; parm.name = symbol_string(param_args.unnamed.at(0)); - parm.type = parse_typespec(param_args.unnamed.at(1)); + parm.type = parse_typespec(param_args.unnamed.at(1), env); // before substituting _type_ lambda_ts.add_arg(parm.type); @@ -639,10 +641,8 @@ Val* Compiler::get_field_of_structure(const StructureType* type, result = fe->alloc_val(di.result_type, loc, MemLoadInfo(di)); result->mark_as_settable(); } else { - auto type_for_offset = field.type; - if (field.type.base_type() == "inline-array") { - type_for_offset = field.type.get_single_arg(); - } + const auto& type_for_offset = + field.type.base_type() == "inline-array" ? field.type.get_single_arg() : field.type; auto field_type_info = m_ts.lookup_type(type_for_offset); result = fe->alloc_val( field.type, object, field.field.offset() + offset + field_type_info->get_offset()); @@ -754,10 +754,14 @@ Val* Compiler::compile_deref(const goos::Object& form, const goos::Object& _rest int64_t constant_index_value; RegVal* index_value = nullptr; + auto idx_val = get_constant_integer_or_variable(field_obj, env); + bool has_constant_idx = idx_val.is_constant(); + if (has_constant_idx) { + constant_index_value = idx_val.constant; + } - bool has_constant_idx = try_getting_constant_integer(field_obj, &constant_index_value, env); if (!has_constant_idx) { - index_value = compile_error_guard(field_obj, env)->to_gpr(form, env); + index_value = idx_val.val->to_gpr(form, env); if (!is_integer(index_value->type())) { throw_compiler_error(form, "Cannot use -> with field {}.", field_obj.print()); } @@ -769,7 +773,6 @@ Val* Compiler::compile_deref(const goos::Object& form, const goos::Object& _rest result->type().print()); } auto di = m_ts.get_deref_info(result->type()); - auto base_type = di.result_type; ASSERT(di.can_deref); if (has_constant_idx) { result = fe->alloc_val(di.result_type, result, @@ -786,7 +789,6 @@ Val* Compiler::compile_deref(const goos::Object& form, const goos::Object& _rest result->type().print()); } auto di = m_ts.get_deref_info(result->type()); - auto base_type = di.result_type; ASSERT(di.mem_deref); ASSERT(di.can_deref); Val* loc = nullptr; @@ -890,7 +892,7 @@ Val* Compiler::compile_addr_of(const goos::Object& form, const goos::Object& res Val* Compiler::compile_the_as(const goos::Object& form, const goos::Object& rest, Env* env) { auto args = get_va(form, rest); va_check(form, args, {{}, {}}, {}); - auto desired_ts = parse_typespec(args.unnamed.at(0)); + auto desired_ts = parse_typespec(args.unnamed.at(0), env); auto base = compile_error_guard(args.unnamed.at(1), env); auto result = env->function_env()->alloc_val(desired_ts, base); if (base->settable()) { @@ -907,7 +909,7 @@ Val* Compiler::compile_the_as(const goos::Object& form, const goos::Object& rest Val* Compiler::compile_the(const goos::Object& form, const goos::Object& rest, Env* env) { auto args = get_va(form, rest); va_check(form, args, {{}, {}}, {}); - auto desired_ts = parse_typespec(args.unnamed.at(0)); + auto desired_ts = parse_typespec(args.unnamed.at(0), env); auto base = compile_error_guard(args.unnamed.at(1), env); if (is_number(base->type())) { @@ -960,7 +962,7 @@ Val* Compiler::compile_heap_new(const goos::Object& form, bool making_boxed_array = unquote(type).as_symbol()->name == "boxed-array"; TypeSpec main_type; if (!making_boxed_array) { - main_type = parse_typespec(unquote(type)); + main_type = parse_typespec(unquote(type), env); } if (main_type == TypeSpec("inline-array") || main_type == TypeSpec("array")) { @@ -971,8 +973,8 @@ Val* Compiler::compile_heap_new(const goos::Object& form, auto count_obj = pair_car(*rest); rest = &pair_cdr(*rest); // try to get the size as a compile time constant. - int64_t constant_count = 0; - bool is_constant_size = try_getting_constant_integer(count_obj, &constant_count, env); + auto cv = get_constant_integer_or_variable(count_obj, env); + bool is_constant_size = cv.is_constant(); if (!rest->is_empty_list()) { // got extra arguments @@ -991,12 +993,12 @@ Val* Compiler::compile_heap_new(const goos::Object& form, args.push_back(compile_get_sym_obj(allocation, env)->to_reg(form, env)); if (is_constant_size) { - auto array_size = constant_count * info.stride; + auto array_size = cv.constant * info.stride; args.push_back(compile_integer(array_size, env)->to_reg(form, env)); } else { auto array_size = compile_integer(info.stride, env)->to_reg(form, env); env->emit_ir(form, IntegerMathKind::IMUL_32, array_size, - compile_error_guard(count_obj, env)->to_gpr(form, env)); + cv.val->to_gpr(form, env)); args.push_back(array_size); } @@ -1058,7 +1060,7 @@ Val* Compiler::compile_static_new(const goos::Object& form, auto result = fe->alloc_val(sr.reference(), sr.typespec()); return result; } else { - auto type_of_object = parse_typespec(unquote(type)); + auto type_of_object = parse_typespec(unquote(type), env); if (is_structure(type_of_object)) { return compile_new_static_structure_or_basic(form, type_of_object, *rest, env, env->function_env()->segment_for_static_data()); @@ -1079,7 +1081,7 @@ Val* Compiler::compile_stack_new(const goos::Object& form, Env* env, bool call_constructor, bool use_singleton) { - auto type_of_object = parse_typespec(unquote(type)); + auto type_of_object = parse_typespec(unquote(type), env); auto fe = env->function_env(); auto st_type_info = dynamic_cast(m_ts.lookup_type(type_of_object)); if (st_type_info && st_type_info->is_always_stack_singleton()) { @@ -1103,11 +1105,7 @@ Val* Compiler::compile_stack_new(const goos::Object& form, auto count_obj = pair_car(*rest); rest = &pair_cdr(*rest); // try to get the size as a compile time constant. - int64_t constant_count = 0; - bool is_constant_size = try_getting_constant_integer(count_obj, &constant_count, env); - if (!is_constant_size) { - throw_compiler_error(form, "Cannot create a dynamically sized stack array"); - } + int64_t constant_count = get_constant_integer_or_error(count_obj, env); if (constant_count <= 0) { throw_compiler_error(form, "Cannot create a stack array with size {}", constant_count); @@ -1133,8 +1131,9 @@ Val* Compiler::compile_stack_new(const goos::Object& form, return addr; } - int stride = - align(type_info->get_size_in_memory(), type_info->get_inline_array_stride_alignment()); + int stride = is_inline ? align(type_info->get_size_in_memory(), + type_info->get_inline_array_stride_alignment()) + : 4; ASSERT(stride == info.stride); int size_in_bytes = info.stride * constant_count; @@ -1433,6 +1432,12 @@ Val* Compiler::compile_size_of(const goos::Object& form, const goos::Object& res return compile_integer(get_size_for_size_of(form, rest), env); } +Compiler::ConstPropResult Compiler::const_prop_size_of(const goos::Object& form, + const goos::Object& rest, + Env* /*env*/) { + return {goos::Object::make_integer(get_size_for_size_of(form, rest)), false}; +} + Val* Compiler::compile_psize_of(const goos::Object& form, const goos::Object& rest, Env* env) { return compile_integer((get_size_for_size_of(form, rest) + 0xf) & ~0xf, env); } diff --git a/goalc/data_compiler/DataObjectGenerator.cpp b/goalc/data_compiler/DataObjectGenerator.cpp index 12fa9767d7..27d6fb05ad 100644 --- a/goalc/data_compiler/DataObjectGenerator.cpp +++ b/goalc/data_compiler/DataObjectGenerator.cpp @@ -1,6 +1,8 @@ -#include -#include #include "DataObjectGenerator.h" + +#include +#include + #include "common/link_types.h" #include "common/util/Assert.h" @@ -51,6 +53,17 @@ int DataObjectGenerator::add_word(u32 word) { return result; } +int DataObjectGenerator::add_word_float(float f) { + auto result = int(m_words.size()); + m_words.push_back(0); + memcpy(&m_words.back(), &f, sizeof(float)); + return result; +} + +void DataObjectGenerator::set_word(u32 word_idx, u32 val) { + m_words.at(word_idx) = val; +} + void DataObjectGenerator::link_word_to_word(int source, int target, int offset) { link_word_to_byte(source, target * 4 + offset); } @@ -68,6 +81,10 @@ int DataObjectGenerator::add_ref_to_string_in_pool(const std::string& str) { return result; } +void DataObjectGenerator::link_word_to_string_in_pool(const std::string& str, int word_idx) { + m_string_pool[str].push_back(word_idx); +} + int DataObjectGenerator::add_type_tag(const std::string& str) { auto result = int(m_words.size()); m_words.push_back(0); @@ -82,12 +99,20 @@ int DataObjectGenerator::add_symbol_link(const std::string& str) { return result; } +void DataObjectGenerator::link_word_to_symbol(const std::string& str, int word_idx) { + m_symbol_links[str].push_back(word_idx); +} + void DataObjectGenerator::align(int alignment_words) { while (m_words.size() % alignment_words) { m_words.push_back(0); } } +void DataObjectGenerator::align_to_basic() { + align(4); +} + int DataObjectGenerator::words() const { return int(m_words.size()); } diff --git a/goalc/data_compiler/DataObjectGenerator.h b/goalc/data_compiler/DataObjectGenerator.h index 3522b9a3b7..5ef2175be0 100644 --- a/goalc/data_compiler/DataObjectGenerator.h +++ b/goalc/data_compiler/DataObjectGenerator.h @@ -1,22 +1,30 @@ #pragma once -#include "common/common_types.h" -#include #include +#include #include +#include "common/common_types.h" + class DataObjectGenerator { public: int add_word(u32 word); + int add_word_float(float f); + void set_word(u32 word_idx, u32 val); void link_word_to_word(int source, int target, int offset = 0); void link_word_to_byte(int source_word, int target_byte); int add_ref_to_string_in_pool(const std::string& str); + void link_word_to_string_in_pool(const std::string& str, int word_idx); int add_type_tag(const std::string& str); int add_symbol_link(const std::string& str); + void link_word_to_symbol(const std::string& str, int word_idx); std::vector generate_v2(); std::vector generate_v4(); void align(int alignment_words); + void align_to_basic(); int words() const; + size_t current_offset_bytes() const { return m_words.size() * sizeof(u32); } + u8* data() { return (u8*)m_words.data(); } private: void add_strings(); diff --git a/goalc/data_compiler/dir_tpages.cpp b/goalc/data_compiler/dir_tpages.cpp index 93b2449803..fd898f51bc 100644 --- a/goalc/data_compiler/dir_tpages.cpp +++ b/goalc/data_compiler/dir_tpages.cpp @@ -1,8 +1,9 @@ #include "dir_tpages.h" #include "DataObjectGenerator.h" -#include "common/goos/Reader.h" + #include "common/goos/ParseHelpers.h" +#include "common/goos/Reader.h" #include "common/util/FileUtil.h" void compile_dir_tpages(const std::string& filename) { @@ -32,4 +33,4 @@ void compile_dir_tpages(const std::string& filename) { file_util::create_dir_if_needed(file_util::get_file_path({"out", "obj"})); file_util::write_binary_file(file_util::get_file_path({"out", "obj", "dir-tpages.go"}), data.data(), data.size()); -} \ No newline at end of file +} diff --git a/goalc/data_compiler/game_count.cpp b/goalc/data_compiler/game_count.cpp index 0edcf726bd..3eeb68ba53 100644 --- a/goalc/data_compiler/game_count.cpp +++ b/goalc/data_compiler/game_count.cpp @@ -1,9 +1,12 @@ +#include "game_count.h" + #include + #include "DataObjectGenerator.h" + #include "common/goos/ParseHelpers.h" #include "common/goos/Reader.h" #include "common/util/FileUtil.h" -#include "game_count.h" void compile_game_count(const std::string& filename) { struct Count { @@ -74,4 +77,4 @@ void compile_game_count(const std::string& filename) { file_util::create_dir_if_needed(file_util::get_file_path({"out", "obj"})); file_util::write_binary_file(file_util::get_file_path({"out", "obj", "game-cnt.go"}), result.data(), result.size()); -} \ No newline at end of file +} diff --git a/goalc/data_compiler/game_subtitle.cpp b/goalc/data_compiler/game_subtitle.cpp deleted file mode 100644 index d87058b2cb..0000000000 --- a/goalc/data_compiler/game_subtitle.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/*! - * @file game_subtitle.cpp - * Builds the XSUBTIT.TXT text files. Each file contains all the strings used as subtitles for - * cutscenes, hints and ambient speech, along with the timings. - * - * This kind of file is completely custom. - */ - -#include -#include -#include -#include "game_subtitle.h" -#include "DataObjectGenerator.h" -#include "common/goos/Reader.h" -#include "common/util/FileUtil.h" -#include "common/goos/ParseHelpers.h" -#include "third-party/fmt/core.h" - -namespace { -int64_t get_int(const goos::Object& obj) { - if (obj.is_int()) { - return obj.integer_obj.value; - } - throw std::runtime_error(obj.print() + " was supposed to be an integer, but isn't"); -} - -const goos::Object& car(const goos::Object& x) { - if (!x.is_pair()) { - throw std::runtime_error("invalid pair"); - } - - return x.as_pair()->car; -} - -const goos::Object& cdr(const goos::Object& x) { - if (!x.is_pair()) { - throw std::runtime_error("invalid pair"); - } - - return x.as_pair()->cdr; -} - -std::string uppercase(const std::string& in) { - std::string result; - result.reserve(in.size()); - for (auto c : in) { - if (c >= 'a' && c <= 'z') { - c -= ('a' - 'A'); - } - result.push_back(c); - } - return result; -} - -/*! - * Parse a game subtitle file. - * Information is added to the game subtitles database. - * - * The file should begin with (language-id x y z...) with the given language IDs. - * Each entry should be (name (frame "line-text-0" "line-text-1") ... ) - * This adds the subtitle to each of the specified languages. - */ -void parse(const goos::Object& data, GameTextVersion text_ver, GameSubtitleDB& db) { - auto font = get_font_bank(text_ver); - std::map banks; - bool languages_set = false; - - for_each_in_list(data.as_pair()->cdr, [&](const goos::Object& obj) { - if (obj.is_pair()) { - auto& head = car(obj); - if (head.is_symbol() && head.as_symbol()->name == "language-id") { - if (languages_set) { - throw std::runtime_error("Languages have been set multiple times."); - } - - if (cdr(obj).is_empty_list()) { - throw std::runtime_error("At least one language must be set."); - } - - for_each_in_list(cdr(obj), [&](const goos::Object& obj) { - auto lang = get_int(obj); - if (!db.bank_exists(lang)) { - // database has no lang yet - banks[lang] = db.new_bank(lang); - } else { - banks[lang] = db.bank_by_id(lang); - } - }); - - languages_set = true; - } - - else if (head.is_string()) { - if (!languages_set) { - throw std::runtime_error("At least one language must be set before defining entries."); - } - GameSubtitleSceneInfo scene(head.as_string()->data); - for_each_in_list(cdr(obj), [&](const goos::Object& entry) { - if (entry.is_pair()) { - if (!car(entry).is_int() || !car(cdr(entry)).is_symbol() || - !car(cdr(cdr(entry))).is_string() || !car(cdr(cdr(cdr(entry)))).is_string()) { - throw std::runtime_error( - "Each entry must be of format (number symbol \"string\" \"string\")"); - } - - auto line = font->convert_utf8_to_game(car(cdr(cdr(cdr(entry)))).as_string()->data); - auto speaker = font->convert_utf8_to_game(car(cdr(cdr(entry))).as_string()->data); - auto offscreen = car(cdr(entry)).as_symbol()->name != "#f"; - scene.add_line(car(entry).as_int(), line, speaker, offscreen); - } else { - throw std::runtime_error("Each entry must be a list"); - } - }); - for (auto& [lang, bank] : banks) { - if (!bank->scene_exists(scene.name())) { - bank->add_scene(scene); - } else { - // this should copy the data, so it's safe to delete the new one afterwards. - auto& old_scene = bank->scene_by_name(scene.name()); - old_scene.from_other_scene(scene); - } - } - } else { - throw std::runtime_error("Invalid game subtitles file entry: " + head.print()); - } - } else { - throw std::runtime_error("Invalid game subtitles file"); - } - }); - if (!languages_set) { - throw std::runtime_error("At least one language must be set."); - } -} - -/*! - * Write game subtitle data to a file. Uses the V2 object format which is identical between GOAL and - * OpenGOAL. - */ -void compile(GameSubtitleDB& db) { - for (const auto& [lang, bank] : db.banks()) { - DataObjectGenerator gen; - gen.add_type_tag("subtitle-text-info"); // type - gen.add_word(bank->scenes().size()); // length - gen.add_word(lang); // lang - gen.add_word(0); // dummy - - // fifo queue for scene data arrays - std::queue array_link_sources; - // now add all the scene infos - for (auto& [name, scene] : bank->scenes()) { - gen.add_word(0 | - (scene.lines().size() << 16)); // kind (lower 16 bits), length (upper 16 bits) - - array_link_sources.push(gen.words()); - gen.add_word(0); // keyframes (linked later) - - gen.add_ref_to_string_in_pool(scene.name()); // name - - gen.add_word(0); // pad (string is 4 bytes but we have 8) - } - // now add all the scene *data!* (keyframes) - for (auto& [name, scene] : bank->scenes()) { - // link inline-array with reference from earlier - gen.link_word_to_word(array_link_sources.front(), gen.words()); - array_link_sources.pop(); - - for (auto& subtitle : scene.lines()) { - gen.add_word(subtitle.frame); // frame - gen.add_ref_to_string_in_pool(subtitle.line); // line - gen.add_ref_to_string_in_pool(subtitle.speaker); // speaker - gen.add_symbol_link(subtitle.offscreen ? "#t" : "#f"); // offscreen - } - } - - auto data = gen.generate_v2(); - - file_util::create_dir_if_needed(file_util::get_file_path({"out", "iso"})); - file_util::write_binary_file( - file_util::get_file_path( - {"out", "iso", fmt::format("{}{}.TXT", lang, uppercase("subtit"))}), - data.data(), data.size()); - } -} -} // namespace - -void compile_game_subtitle(const std::vector& filenames, - GameTextVersion text_ver, - GameSubtitleDB& db) { - goos::Reader reader; - for (auto& filename : filenames) { - fmt::print("[Build Game Subtitle] {}\n", filename.c_str()); - auto code = reader.read_from_file({filename}); - parse(code, text_ver, db); - } - compile(db); -} diff --git a/goalc/data_compiler/game_subtitle.h b/goalc/data_compiler/game_subtitle.h deleted file mode 100644 index 59488fda45..0000000000 --- a/goalc/data_compiler/game_subtitle.h +++ /dev/null @@ -1,92 +0,0 @@ -#pragma once -#include "common/util/FontUtils.h" -#include "common/util/Assert.h" -#include -#include -#include - -class GameSubtitleSceneInfo { - public: - GameSubtitleSceneInfo() {} - GameSubtitleSceneInfo(std::string name) : m_name(name) {} - - struct SubtitleLine { - SubtitleLine(int frame, std::string line, std::string speaker, bool offscreen) - : frame(frame), line(line), speaker(speaker), offscreen(offscreen) {} - - int frame; - std::string line; - std::string speaker; - bool offscreen; - }; - - const std::string& name() const { return m_name; } - const std::vector& lines() const { return m_lines; } - void clear_lines() { m_lines.clear(); } - void from_other_scene(GameSubtitleSceneInfo& scene) { - m_name = scene.name(); - m_lines = scene.lines(); - } - - void add_line(int frame, std::string line, std::string speaker, bool offscreen) { - m_lines.emplace_back(frame, line, speaker, offscreen); - } - - private: - std::string m_name; - std::vector m_lines; -}; - -class GameSubtitleBank { - public: - GameSubtitleBank(int lang_id) : m_lang_id(lang_id) {} - - int lang() const { return m_lang_id; } - const std::map& scenes() const { return m_scenes; } - - bool scene_exists(const std::string& name) const { return m_scenes.find(name) != m_scenes.end(); } - GameSubtitleSceneInfo& scene_by_name(const std::string& name) { return m_scenes.at(name); } - void add_scene(GameSubtitleSceneInfo& scene) { - ASSERT(!scene_exists(scene.name())); - m_scenes[scene.name()] = scene; - } - - private: - int m_lang_id; - - std::map m_scenes; -}; - -/*! - * The subtitles database contains a subtitbles bank for each language. - * Each subtitles bank contains a series of subtitle scene infos. - */ -class GameSubtitleDB { - public: - const std::map& banks() const { return m_banks; } - - bool bank_exists(int id) const { return m_banks.find(id) != m_banks.end(); } - - GameSubtitleBank* new_bank(int id) { - ASSERT(!bank_exists(id)); - m_banks[id] = new GameSubtitleBank(id); - return m_banks.at(id); - } - void add_bank(GameSubtitleBank* bank) { - ASSERT(!bank_exists(bank->lang())); - m_banks[bank->lang()] = bank; - } - GameSubtitleBank* bank_by_id(int id) { - if (!bank_exists(id)) { - return nullptr; - } - return m_banks.at(id); - } - - private: - std::map m_banks; -}; - -void compile_game_subtitle(const std::vector& filenames, - GameTextVersion text_ver, - GameSubtitleDB& db); diff --git a/goalc/data_compiler/game_text.cpp b/goalc/data_compiler/game_text.cpp deleted file mode 100644 index 175916ecf6..0000000000 --- a/goalc/data_compiler/game_text.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/*! - * @file game_text.cpp - * Builds the XCOMMON.TXT text files. Each file contains all the strings that appear in the game - * translated into a language. - * - * The decompiler/data/game_text.cpp file extracts text from the game and creates a file that - * can be read with these functions. - */ - -#include -#include "game_text.h" -#include "common/goos/Reader.h" -#include "DataObjectGenerator.h" -#include "common/util/FileUtil.h" -#include "common/util/FontUtils.h" -#include "common/goos/ParseHelpers.h" -#include "third-party/fmt/core.h" - -namespace { -int64_t get_int(const goos::Object& obj) { - if (obj.is_int()) { - return obj.integer_obj.value; - } - throw std::runtime_error(obj.print() + " was supposed to be an integer, but isn't"); -} - -const goos::Object& car(const goos::Object& x) { - if (!x.is_pair()) { - throw std::runtime_error("invalid pair"); - } - - return x.as_pair()->car; -} - -const goos::Object& cdr(const goos::Object& x) { - if (!x.is_pair()) { - throw std::runtime_error("invalid pair"); - } - - return x.as_pair()->cdr; -} - -std::string get_string(const goos::Object& x) { - if (x.is_string()) { - return x.as_string()->data; - } - throw std::runtime_error(x.print() + " was supposed to be a string, but isn't"); -} - -std::string uppercase(const std::string& in) { - std::string result; - result.reserve(in.size()); - for (auto c : in) { - if (c >= 'a' && c <= 'z') { - c -= ('a' - 'A'); - } - result.push_back(c); - } - return result; -} - -/*! - * Parse a game text file for all languages. - * The result is a vector> - * so result[lang_id][text_id] gets you the text in the given language. - * - * The file should begin with (language-count x) with the given number of languages. - * Each entry should be (text-id "text-in-lang-0" "text-in-lang-1" ... ) - * The text id's can be out of order or missing entries. - */ -std::vector> parse(const goos::Object& data, - std::string* group_name) { - std::vector> text; - bool languages_set = false; - bool group_name_set = false; - std::string possible_group_name; - - for_each_in_list(data.as_pair()->cdr, [&](const goos::Object& obj) { - if (obj.is_pair()) { - auto& head = obj.as_pair()->car; - if (head.is_symbol() && head.as_symbol()->name == "language-count") { - if (languages_set) { - throw std::runtime_error("Languages has been set multiple times."); - } - languages_set = true; - - text.resize(get_int(car(cdr(obj)))); - if (!cdr(cdr(obj)).is_empty_list()) { - throw std::runtime_error("language-count has too many arguments"); - } - } else if (head.is_symbol() && head.as_symbol()->name == "group-name") { - if (group_name_set) { - throw std::runtime_error("group-name has been set multiple times."); - } - group_name_set = true; - - possible_group_name = get_string(car(cdr(obj))); - if (!cdr(cdr(obj)).is_empty_list()) { - throw std::runtime_error("group-name has too many arguments"); - } - } - - else if (head.is_int()) { - int i = 0; - int id = head.as_int(); - for_each_in_list(cdr(obj), [&](const goos::Object& entry) { - if (i >= int(text.size())) { - throw std::runtime_error( - "String has too many entries. There should be one per language"); - } - - if (entry.is_string()) { - auto& map = text.at(i); - if (map.find(id) != map.end()) { - throw std::runtime_error("Entry appears more than once"); - } - - // TODO - auto font = get_font_bank(GameTextVersion::JAK1_V1); - map[id] = font->convert_utf8_to_game(entry.as_string()->data); - } else { - throw std::runtime_error("Each entry must be a string"); - } - - i++; - }); - if (i != int(text.size())) { - throw std::runtime_error("String did not have an entry for each language"); - } - } else { - throw std::runtime_error("Invalid game text file entry: " + head.print()); - } - } else { - throw std::runtime_error("Invalid game text file"); - } - }); - - if (!group_name_set) { - throw std::runtime_error("group-name not set."); - } - *group_name = possible_group_name; - return text; -} - -/* -(deftype game-text (structure) - ((id uint32 :offset-assert 0) - (text basic :offset-assert 4) - ) - ) - -(deftype game-text-info (basic) - ((length int32 :offset-assert 4) - (language-id int32 :offset-assert 8) - (group-name basic :offset-assert 12) - (data game-text :dynamic :offset-assert 16) - ) - ) - */ - -/*! - * Write game text data to a file. Uses the V2 object format which is identical between GOAL and - * OpenGOAL, so this should produce exactly identical files to what is found in the game. - */ -void compile(const std::vector>& text, - const std::string& group_name) { - if (text.empty()) { - return; - } - // get all text ID's we know - std::vector add_order; - add_order.reserve(text.front().size()); - for (auto& x : text.front()) { - add_order.push_back(x.first); - } - // and sort them to be added in order. This matches the game. - std::sort(add_order.begin(), add_order.end()); - - for (int lang = 0; lang < int(text.size()); lang++) { - DataObjectGenerator gen; - gen.add_type_tag("game-text-info"); // type - gen.add_word(text.front().size()); // length - gen.add_word(lang); // language-id - // this string is found in the string pool. - gen.add_ref_to_string_in_pool(group_name); // group-name - - // now add all the datas: - for (auto id : add_order) { - gen.add_word(id); // id - // these strings must be in the string pool, as sometimes there are duplicate - // strings in a single language, and these strings should be stored once and have multiple - // references to them. - gen.add_ref_to_string_in_pool(text.at(lang).at(id)); // text - } - auto data = gen.generate_v2(); - - file_util::create_dir_if_needed(file_util::get_file_path({"out", "iso"})); - file_util::write_binary_file( - file_util::get_file_path( - {"out", "iso", fmt::format("{}{}.TXT", lang, uppercase(group_name))}), - data.data(), data.size()); - } -} -} // namespace - -/*! - * Read a game text description file and generate GOAL objects. - */ -void compile_game_text(const std::string& filename) { - goos::Reader reader; - auto code = reader.read_from_file({filename}); - printf("[Build Game Text] %s\n", filename.c_str()); - std::string group_name; - auto text_map = parse(code, &group_name); - compile(text_map, group_name); -} diff --git a/goalc/data_compiler/game_text.h b/goalc/data_compiler/game_text.h deleted file mode 100644 index d2aa968f64..0000000000 --- a/goalc/data_compiler/game_text.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include - -void compile_game_text(const std::string& filename); \ No newline at end of file diff --git a/goalc/data_compiler/game_text_common.cpp b/goalc/data_compiler/game_text_common.cpp new file mode 100644 index 0000000000..7ae7b15540 --- /dev/null +++ b/goalc/data_compiler/game_text_common.cpp @@ -0,0 +1,173 @@ +/*! + * @file game_text.cpp + * Builds the XCOMMON.TXT text files. Each file contains all the strings that appear in the game + * translated into a language. + * + * The decompiler/data/game_text.cpp file extracts text from the game and creates a file that + * can be read with these functions. + * + * Also builds the XSUBTIT.TXT text files. Each file contains all the strings used as subtitles for + * cutscenes, hints and ambient speech, along with the timings. + * This kind of file is completely custom. + */ + +#include "game_text_common.h" + +#include +#include + +#include "DataObjectGenerator.h" + +#include "common/goos/ParseHelpers.h" +#include "common/goos/Reader.h" +#include "common/serialization/subtitles/subtitles.h" +#include "common/util/FileUtil.h" +#include "common/util/FontUtils.h" + +#include "third-party/fmt/core.h" + +namespace { + +std::string uppercase(const std::string& in) { + std::string result; + result.reserve(in.size()); + for (auto c : in) { + if (c >= 'a' && c <= 'z') { + c -= ('a' - 'A'); + } + result.push_back(c); + } + return result; +} + +/* +(deftype game-text (structure) + ((id uint32 :offset-assert 0) + (text basic :offset-assert 4) + ) + ) + +(deftype game-text-info (basic) + ((length int32 :offset-assert 4) + (language-id int32 :offset-assert 8) + (group-name basic :offset-assert 12) + (data game-text :dynamic :offset-assert 16) + ) + ) + */ + +/*! + * Write game text data to a file. Uses the V2 object format which is identical between GOAL and + * OpenGOAL, so this should produce exactly identical files to what is found in the game. + */ +void compile_text(GameTextDB& db) { + for (const auto& [group_name, banks] : db.groups()) { + for (const auto& [lang, bank] : banks) { + DataObjectGenerator gen; + gen.add_type_tag("game-text-info"); // type + gen.add_word(bank->lines().size()); // length + gen.add_word(lang); // language-id + // this string is found in the string pool. + gen.add_ref_to_string_in_pool(group_name); // group-name + + // now add all the datas: (the lines are already sorted by id) + for (auto& [id, line] : bank->lines()) { + gen.add_word(id); // id + // these strings must be in the string pool, as sometimes there are duplicate + // strings in a single language, and these strings should be stored once and have multiple + // references to them. + gen.add_ref_to_string_in_pool(line); // text + } + + auto data = gen.generate_v2(); + + file_util::create_dir_if_needed(file_util::get_file_path({"out", "iso"})); + file_util::write_binary_file( + file_util::get_file_path( + {"out", "iso", fmt::format("{}{}.TXT", lang, uppercase(group_name))}), + data.data(), data.size()); + } + } +} + +/*! + * Write game subtitle data to a file. Uses the V2 object format which is identical between GOAL and + * OpenGOAL. + */ +void compile_subtitle(GameSubtitleDB& db) { + for (const auto& [lang, bank] : db.banks()) { + DataObjectGenerator gen; + gen.add_type_tag("subtitle-text-info"); // type + gen.add_word(bank->scenes().size()); // length + gen.add_word(lang); // lang + gen.add_word(0); // dummy + + // fifo queue for scene data arrays + std::queue array_link_sources; + // now add all the scene infos + for (auto& [name, scene] : bank->scenes()) { + gen.add_word((u16)scene.kind() | + (scene.lines().size() << 16)); // kind (lower 16 bits), length (upper 16 bits) + + array_link_sources.push(gen.words()); + gen.add_word(0); // keyframes (linked later) + + if (scene.kind() == SubtitleSceneKind::Movie || + scene.kind() == SubtitleSceneKind::HintNamed) { + gen.add_ref_to_string_in_pool(scene.name()); // name + } else if (scene.kind() == SubtitleSceneKind::Hint) { + gen.add_word(0); // nothing + } + gen.add_word(scene.id()); + } + // now add all the scene *data!* (keyframes) + for (auto& [name, scene] : bank->scenes()) { + // link inline-array with reference from earlier + gen.link_word_to_word(array_link_sources.front(), gen.words()); + array_link_sources.pop(); + + for (auto& subtitle : scene.lines()) { + gen.add_word(subtitle.frame); // frame + gen.add_ref_to_string_in_pool(subtitle.line); // line + gen.add_ref_to_string_in_pool(subtitle.speaker); // speaker + gen.add_word(subtitle.offscreen); // offscreen + } + } + + auto data = gen.generate_v2(); + + file_util::create_dir_if_needed(file_util::get_file_path({"out", "iso"})); + file_util::write_binary_file( + file_util::get_file_path( + {"out", "iso", fmt::format("{}{}.TXT", lang, uppercase("subtit"))}), + data.data(), data.size()); + } +} +} // namespace + +/*! + * Read a game text description file and generate GOAL objects. + */ +void compile_game_text(const std::vector& filenames, + GameTextVersion text_ver, + GameTextDB& db) { + goos::Reader reader; + for (auto& filename : filenames) { + fmt::print("[Build Game Text] {}\n", filename.c_str()); + auto code = reader.read_from_file({filename}); + parse_text(code, text_ver, db); + } + compile_text(db); +} + +void compile_game_subtitle(const std::vector& filenames, + GameTextVersion text_ver, + GameSubtitleDB& db) { + goos::Reader reader; + for (auto& filename : filenames) { + fmt::print("[Build Game Subtitle] {}\n", filename.c_str()); + auto code = reader.read_from_file({filename}); + parse_subtitle(code, text_ver, db, filename); + } + compile_subtitle(db); +} diff --git a/goalc/data_compiler/game_text_common.h b/goalc/data_compiler/game_text_common.h new file mode 100644 index 0000000000..19200dd25b --- /dev/null +++ b/goalc/data_compiler/game_text_common.h @@ -0,0 +1,21 @@ +#pragma once +#include +#include +#include +#include +#include + +#include "common/serialization/subtitles/subtitles.h" +#include "common/util/Assert.h" +#include "common/util/FontUtils.h" + +void compile_game_text(const std::vector& filenames, + GameTextVersion text_ver, + GameTextDB& db); +void compile_game_subtitle(const std::vector& filenames, + GameTextVersion text_ver, + GameSubtitleDB& db); + +void open_text_project(const std::string& kind, + const std::string& filename, + std::unordered_map>& inputs); diff --git a/goalc/debugger/DebugInfo.cpp b/goalc/debugger/DebugInfo.cpp index 47db9a4bd8..1dbc08542c 100644 --- a/goalc/debugger/DebugInfo.cpp +++ b/goalc/debugger/DebugInfo.cpp @@ -1,5 +1,7 @@ -#include #include "DebugInfo.h" + +#include + #include "third-party/fmt/core.h" DebugInfo::DebugInfo(std::string obj_name) : m_obj_name(std::move(obj_name)) {} @@ -8,7 +10,7 @@ std::string FunctionDebugInfo::disassemble_debug_info(bool* had_failure, const goos::Reader* reader) { std::string result = fmt::format("[{}]\n", name); result += disassemble_x86_function(generated_code.data(), generated_code.size(), reader, 0x10000, - 0x10000, instructions, function.get(), had_failure); + 0x10000, instructions, function.get(), had_failure, true); return result; } diff --git a/goalc/debugger/DebugInfo.h b/goalc/debugger/DebugInfo.h index 98640f3d54..c38252ac99 100644 --- a/goalc/debugger/DebugInfo.h +++ b/goalc/debugger/DebugInfo.h @@ -1,15 +1,17 @@ #pragma once -#include -#include -#include #include +#include +#include #include +#include + #include "common/common_types.h" -#include "goalc/emitter/Instruction.h" -#include "goalc/debugger/disassemble.h" #include "common/util/Assert.h" +#include "goalc/debugger/disassemble.h" +#include "goalc/emitter/Instruction.h" + class FunctionEnv; /*! diff --git a/goalc/debugger/Debugger.cpp b/goalc/debugger/Debugger.cpp index b4194c4b6a..d7cac28b0b 100644 --- a/goalc/debugger/Debugger.cpp +++ b/goalc/debugger/Debugger.cpp @@ -5,14 +5,17 @@ */ #include "Debugger.h" + #include "common/goal_constants.h" #include "common/symbols.h" +#include "common/util/Assert.h" #include "common/util/Timer.h" + #include "goalc/debugger/disassemble.h" #include "goalc/emitter/Register.h" #include "goalc/listener/Listener.h" + #include "third-party/fmt/core.h" -#include "common/util/Assert.h" /*! * Is the target halted? If we don't know or aren't connected, returns false. @@ -396,7 +399,8 @@ Disassembly Debugger::disassemble_at_rip(const InstructionPointerInfo& info) { result.text += disassemble_x86_function( function_mem.data(), function_mem.size(), m_reader, m_debug_context.base + info.map_entry->start_addr + func_info->offset_in_seg, - rip + rip_offset, func_info->instructions, func_info->function.get(), &result.failed); + rip + rip_offset, func_info->instructions, func_info->function.get(), &result.failed, + false); } } else { result.failed = true; @@ -512,6 +516,9 @@ bool Debugger::write_memory(const u8* src_buffer, int size, u32 goal_addr) { * Read the GOAL Symbol table from an attached and halted target. */ void Debugger::read_symbol_table() { + // todo: this assumes many things specific to jak 1. + using namespace jak1_symbols; + using namespace jak1; ASSERT(is_valid() && is_attached() && is_halted()); u32 bytes_read = 0; u32 reads = 0; @@ -762,8 +769,8 @@ void Debugger::watcher() { break; #endif default: - printf("[Debugger] unhandled signal in watcher: %d\n", int(signal_info.kind)); - ASSERT(false); + ASSERT_MSG(false, fmt::format("[Debugger] unhandled signal in watcher: {}", + int(signal_info.kind))); } { diff --git a/goalc/debugger/Debugger.h b/goalc/debugger/Debugger.h index 5fc8df3fb9..45a2764aad 100644 --- a/goalc/debugger/Debugger.h +++ b/goalc/debugger/Debugger.h @@ -12,9 +12,12 @@ #include #include #include + #include "DebugInfo.h" + #include "common/common_types.h" #include "common/cross_os_debug/xdbg.h" + #include "goalc/listener/MemoryMap.h" namespace listener { diff --git a/goalc/debugger/disassemble.cpp b/goalc/debugger/disassemble.cpp index ae3b39daee..8c014869ac 100644 --- a/goalc/debugger/disassemble.cpp +++ b/goalc/debugger/disassemble.cpp @@ -1,10 +1,13 @@ #include "disassemble.h" + +#include "common/goos/Reader.h" + #include "Zydis/Zydis.h" -#include "third-party/fmt/core.h" #include "goalc/compiler/Env.h" #include "goalc/compiler/IR.h" -#include "common/goos/Reader.h" + #include "third-party/fmt/color.h" +#include "third-party/fmt/core.h" std::string disassemble_x86(u8* data, int len, u64 base_addr) { std::string result; @@ -81,7 +84,8 @@ std::string disassemble_x86_function(u8* data, u64 highlight_addr, const std::vector& x86_instructions, const FunctionEnv* fenv, - bool* had_failure) { + bool* had_failure, + bool print_whole_function) { std::string result; ZydisDecoder decoder; ZydisDecoderInit(&decoder, ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_STACK_WIDTH_64); @@ -207,8 +211,8 @@ std::string disassemble_x86_function(u8* data, } for (auto& line : lines) { - if (line.first >= rip_src_idx - FORM_DUMP_SIZE_REV && - line.first < rip_src_idx + FORM_DUMP_SIZE_FWD) { + if (print_whole_function || (line.first >= rip_src_idx - FORM_DUMP_SIZE_REV && + line.first < rip_src_idx + FORM_DUMP_SIZE_FWD)) { result.append(line.second); } } diff --git a/goalc/debugger/disassemble.h b/goalc/debugger/disassemble.h index ebbffbbf91..b75a5af0c1 100644 --- a/goalc/debugger/disassemble.h +++ b/goalc/debugger/disassemble.h @@ -2,7 +2,9 @@ #include #include + #include "common/common_types.h" + #include "goalc/emitter/Instruction.h" class FunctionEnv; @@ -34,4 +36,5 @@ std::string disassemble_x86_function(u8* data, u64 highlight_addr, const std::vector& x86_instructions, const FunctionEnv* fenv, - bool* had_failure); \ No newline at end of file + bool* had_failure, + bool print_whole_function); \ No newline at end of file diff --git a/goalc/emitter/CallingConvention.cpp b/goalc/emitter/CallingConvention.cpp index 4228a39588..0e64a9b839 100644 --- a/goalc/emitter/CallingConvention.cpp +++ b/goalc/emitter/CallingConvention.cpp @@ -1,4 +1,5 @@ #include "CallingConvention.h" + #include "common/util/Assert.h" CallingConvention get_function_calling_convention(const TypeSpec& function_type, diff --git a/goalc/emitter/CallingConvention.h b/goalc/emitter/CallingConvention.h index a6338d4441..5ac144c561 100644 --- a/goalc/emitter/CallingConvention.h +++ b/goalc/emitter/CallingConvention.h @@ -1,9 +1,10 @@ #pragma once -#include #include +#include #include "common/type_system/TypeSystem.h" + #include "goalc/emitter/Register.h" struct CallingConvention { diff --git a/goalc/emitter/CodeTester.cpp b/goalc/emitter/CodeTester.cpp index 225a289ca0..479fbceb62 100644 --- a/goalc/emitter/CodeTester.cpp +++ b/goalc/emitter/CodeTester.cpp @@ -13,9 +13,12 @@ #endif #include + #include "CodeTester.h" #include "IGen.h" +#include "third-party/fmt/core.h" + namespace emitter { CodeTester::CodeTester() : m_info(RegisterInfo::make_register_info()) {} @@ -133,8 +136,7 @@ void CodeTester::init_code_buffer(int capacity) { code_buffer = (u8*)mmap(nullptr, capacity, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); if (code_buffer == (u8*)(-1)) { - printf("[CodeTester] Failed to map memory!\n"); - ASSERT(false); + ASSERT_MSG(false, "[CodeTester] Failed to map memory!"); } code_buffer_capacity = capacity; diff --git a/goalc/emitter/CodeTester.h b/goalc/emitter/CodeTester.h index 3a087c20ef..aaa9650856 100644 --- a/goalc/emitter/CodeTester.h +++ b/goalc/emitter/CodeTester.h @@ -11,11 +11,14 @@ #ifndef JAK_CODETESTER_H #define JAK_CODETESTER_H -#include -#include "common/common_types.h" -#include "Register.h" -#include "Instruction.h" +#include #include +#include + +#include "Instruction.h" +#include "Register.h" + +#include "common/common_types.h" namespace emitter { class CodeTester { diff --git a/goalc/emitter/IGen.h b/goalc/emitter/IGen.h index 261bab823c..24ac7554b1 100644 --- a/goalc/emitter/IGen.h +++ b/goalc/emitter/IGen.h @@ -1,8 +1,10 @@ #pragma once -#include "Register.h" -#include "Instruction.h" #include + +#include "Instruction.h" +#include "Register.h" + #include "common/util/Assert.h" namespace emitter { diff --git a/goalc/emitter/ObjectFileData.h b/goalc/emitter/ObjectFileData.h index 8ae8565438..9cb62803e0 100644 --- a/goalc/emitter/ObjectFileData.h +++ b/goalc/emitter/ObjectFileData.h @@ -5,6 +5,7 @@ #include #include + #include "common/common_types.h" #include "common/link_types.h" diff --git a/goalc/emitter/ObjectGenerator.cpp b/goalc/emitter/ObjectGenerator.cpp index 538a6b43ca..40249f10e6 100644 --- a/goalc/emitter/ObjectGenerator.cpp +++ b/goalc/emitter/ObjectGenerator.cpp @@ -14,10 +14,13 @@ */ #include "ObjectGenerator.h" -#include "goalc/debugger/DebugInfo.h" + #include "common/goal_constants.h" -#include "common/versions.h" #include "common/type_system/TypeSystem.h" +#include "common/versions.h" + +#include "goalc/debugger/DebugInfo.h" + #include "third-party/fmt/core.h" namespace emitter { diff --git a/goalc/emitter/ObjectGenerator.h b/goalc/emitter/ObjectGenerator.h index 11cb400e1b..90702b5ae3 100644 --- a/goalc/emitter/ObjectGenerator.h +++ b/goalc/emitter/ObjectGenerator.h @@ -8,8 +8,10 @@ #include #include #include -#include "ObjectFileData.h" + #include "Instruction.h" +#include "ObjectFileData.h" + #include "goalc/debugger/DebugInfo.h" struct FunctionDebugInfo; diff --git a/goalc/emitter/Register.cpp b/goalc/emitter/Register.cpp index 57ac46e8ff..30bd7b6d20 100644 --- a/goalc/emitter/Register.cpp +++ b/goalc/emitter/Register.cpp @@ -1,4 +1,5 @@ #include "Register.h" + #include namespace emitter { diff --git a/goalc/emitter/Register.h b/goalc/emitter/Register.h index 4edce8b644..a819657888 100644 --- a/goalc/emitter/Register.h +++ b/goalc/emitter/Register.h @@ -6,8 +6,9 @@ */ #include -#include #include +#include + #include "common/common_types.h" #include "common/goal_constants.h" #include "common/util/Assert.h" diff --git a/goalc/listener/Listener.cpp b/goalc/listener/Listener.cpp index 8f89db149d..84943bcd99 100644 --- a/goalc/listener/Listener.cpp +++ b/goalc/listener/Listener.cpp @@ -3,10 +3,12 @@ * The Listener can connect to a Deci2Server for debugging. */ +// clang-format off #ifdef __linux__ #include -#include + #include +#include #include #elif _WIN32 #define WIN32_LEAN_AND_MEAN @@ -18,18 +20,20 @@ #undef max #endif -#include "common/cross_sockets/xsocket.h" - -#include -#include -#include -#include #include -#include "Listener.h" +#include +#include +#include +#include + +#include "common/cross_sockets/XSocket.h" +#include "common/util/Assert.h" #include "common/versions.h" +#include "Listener.h" + #include "third-party/fmt/core.h" -#include "common/util/Assert.h" +// clang-format on using namespace versions; constexpr bool debug_listener = false; diff --git a/goalc/listener/Listener.h b/goalc/listener/Listener.h index 7865fe1a6c..ff58b00fe1 100644 --- a/goalc/listener/Listener.h +++ b/goalc/listener/Listener.h @@ -5,19 +5,23 @@ * The Listener can connect to a Deci2Server for debugging. */ +// clang-format off #ifndef JAK1_LISTENER_H #define JAK1_LISTENER_H -#include -#include -#include #include +#include +#include #include +#include + #include "common/common_types.h" -#include "common/listener_common.h" #include "common/cross_os_debug/xdbg.h" +#include "common/listener_common.h" + #include "goalc/debugger/Debugger.h" #include "MemoryMap.h" +// clang-format on namespace listener { diff --git a/goalc/listener/MemoryMap.cpp b/goalc/listener/MemoryMap.cpp index 7750c42cde..9d3dc934bc 100644 --- a/goalc/listener/MemoryMap.cpp +++ b/goalc/listener/MemoryMap.cpp @@ -1,10 +1,13 @@ +#include "MemoryMap.h" + #include #include -#include "MemoryMap.h" -#include "third-party/fmt/core.h" + #include "common/link_types.h" -#include "common/util/BitUtils.h" #include "common/util/Assert.h" +#include "common/util/BitUtils.h" + +#include "third-party/fmt/core.h" namespace listener { std::string LoadEntry::print() const { diff --git a/goalc/listener/MemoryMap.h b/goalc/listener/MemoryMap.h index c6b7f63bb7..ba6001aa6c 100644 --- a/goalc/listener/MemoryMap.h +++ b/goalc/listener/MemoryMap.h @@ -1,8 +1,9 @@ #pragma once #include -#include #include +#include + #include "common/common_types.h" namespace listener { diff --git a/goalc/main.cpp b/goalc/main.cpp index a49c1ae526..8498d3c255 100644 --- a/goalc/main.cpp +++ b/goalc/main.cpp @@ -1,97 +1,155 @@ #include -#include "goalc/compiler/Compiler.h" -#include "common/versions.h" -#include "common/util/FileUtil.h" -#include "common/log/log.h" - -#include "third-party/fmt/core.h" -#include "third-party/fmt/color.h" +#include #include "common/goos/ReplUtils.h" +#include "common/log/log.h" +#include "common/nrepl/ReplServer.h" +#include "common/util/FileUtil.h" +#include "common/versions.h" -void setup_logging(bool verbose) { +#include "goalc/compiler/Compiler.h" + +#include "third-party/CLI11.hpp" +#include "third-party/fmt/color.h" +#include "third-party/fmt/core.h" + +void setup_logging() { lg::set_file(file_util::get_file_path({"log/compiler.txt"})); - if (verbose) { - lg::set_file_level(lg::level::info); - lg::set_stdout_level(lg::level::info); - lg::set_flush_level(lg::level::info); - } else { - lg::set_file_level(lg::level::warn); - lg::set_stdout_level(lg::level::warn); - lg::set_flush_level(lg::level::warn); - } + lg::set_file_level(lg::level::info); + lg::set_stdout_level(lg::level::info); + lg::set_flush_level(lg::level::info); lg::initialize(); } int main(int argc, char** argv) { - (void)argc; - (void)argv; - - std::string argument; - std::string username = "#f"; - bool verbose = false; bool auto_listen = false; bool auto_debug = false; - for (int i = 1; i < argc; i++) { - if (std::string("-v") == argv[i]) { - verbose = true; - } else if (std::string("-cmd") == argv[i] && i + 1 < argc) { - argument = argv[++i]; - } else if (std::string("-auto-lt") == argv[i]) { - auto_listen = true; - } else if (std::string("-auto-dbg") == argv[i]) { - auto_debug = true; - } else if (std::string("-user") == argv[i] && i + 1 < argc) { - username = argv[++i]; - } else if (std::string("-user-auto") == argv[i]) { - try { - auto text = std::make_shared( - file_util::get_file_path({"goal_src", "user", "user.txt"}), "goal_src/user/user.txt"); - goos::TextStream ts(text); - ts.seek_past_whitespace_and_comments(); - username.clear(); - while (ts.text_remains()) { - char c = ts.read(); - if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || - c == '-' || c == '.' || c == '!' || c == '?' || c == '<' || c == '>') { - username.push_back(c); - } else { - break; - } + bool auto_find_user = false; + std::string cmd = ""; + std::string startup_cmd = ""; + std::string username = "#f"; + int nrepl_port = 8181; + + CLI::App app{"OpenGOAL Compiler / REPL"}; + app.add_option("-c,--cmd", cmd, "Specify a command to run"); + app.add_option("--startup-cmd", startup_cmd, + "Specify a command to run and keep the REPL open afterwards"); + app.add_option("-u,--user", username, + "Specify the username to use for your user profile in 'goal_src/user/'"); + app.add_option("-p,--port", nrepl_port, "Specify the nREPL port. Defaults to 8181"); + app.add_flag("--auto-lt", auto_listen, + "Attempt to automatically connect to the listener on startup"); + app.add_flag("--auto-dbg", auto_debug, + "Attempt to automatically connect to the debugger on startup"); + app.add_flag("--user-auto", auto_find_user, + "Attempt to automatically deduce the user, overrides '-user'"); + app.validate_positionals(); + CLI11_PARSE(app, argc, argv); + + if (!file_util::setup_project_path(std::nullopt)) { + return 1; + } + + if (auto_find_user) { + username = "#f"; + std::regex allowed_chars("[0-9a-zA-Z\\-\\.\\!\\?<>]"); + try { + auto text = std::make_shared( + file_util::get_file_path({"goal_src", "user", "user.txt"}), "goal_src/user/user.txt"); + goos::TextStream ts(text); + ts.seek_past_whitespace_and_comments(); + std::string found_username; + while (ts.text_remains()) { + auto character = ts.read(); + if (!std::regex_match(std::string(1, character), allowed_chars)) { + break; } - if (username.empty()) { - username = "#f"; - } - } catch (std::exception& e) { - printf("error opening user desc file: %s\n", e.what()); - username = "#f"; + found_username.push_back(character); } + if (!found_username.empty()) { + username = found_username; + } + } catch (std::exception& e) { + printf("error opening user desc file: %s\n", e.what()); } } - setup_logging(verbose); + + setup_logging(); lg::info("OpenGOAL Compiler {}.{}", versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR); // Init REPL + ReplStatus status = ReplStatus::WANT_RELOAD; + std::function shutdown_callback = [&]() { return status == ReplStatus::WANT_EXIT; }; + ReplServer repl_server(shutdown_callback, nrepl_port); + bool repl_server_ok = repl_server.init_server(); + std::thread nrepl_thread; // the compiler may throw an exception if it fails to load its standard library. try { std::unique_ptr compiler; - if (argument.empty()) { - ReplStatus status = ReplStatus::WANT_RELOAD; - while (status == ReplStatus::WANT_RELOAD) { - compiler = std::make_unique(username, std::make_unique()); - status = compiler->execute_repl(auto_listen, auto_debug); - if (status == ReplStatus::WANT_RELOAD) { - fmt::print("Reloading compiler...\n"); - } - } - } else { + std::mutex compiler_mutex; + // if a command is provided on the command line, no REPL just run the compiler on it + if (!cmd.empty()) { compiler = std::make_unique(); - compiler->run_front_end_on_string(argument); + compiler->run_front_end_on_string(cmd); + return 0; + } + // Start nREPL Server + if (repl_server_ok) { + nrepl_thread = std::thread([&]() { + while (!shutdown_callback()) { + auto resp = repl_server.get_msg(); + if (resp) { + std::lock_guard lock(compiler_mutex); + status = compiler->handle_repl_string(resp.value()); + // Print out the prompt, just for better UX + compiler->print_to_repl(compiler->get_prompt()); + } + std::this_thread::sleep_for(std::chrono::microseconds(50000)); + } + }); + } + // Run automatic forms if applicable + if (auto_debug || auto_listen) { + std::lock_guard lock(compiler_mutex); + status = compiler->handle_repl_string("(lt)"); + } + if (auto_debug) { + std::lock_guard lock(compiler_mutex); + status = compiler->handle_repl_string("(dbg) (:cont)"); + } + // Poll Terminal + while (status != ReplStatus::WANT_EXIT) { + if (status == ReplStatus::WANT_RELOAD) { + fmt::print("Reloading compiler...\n"); + std::lock_guard lock(compiler_mutex); + if (compiler) { + compiler->save_repl_history(); + } + compiler = std::make_unique(username, std::make_unique()); + if (!startup_cmd.empty()) { + compiler->handle_repl_string(startup_cmd); + // reset to prevent re-executing on manual reload + startup_cmd = ""; + } + status = ReplStatus::OK; + } + std::string input_from_stdin = compiler->get_repl_input(); + if (!input_from_stdin.empty()) { + // lock, while we compile + std::lock_guard lock(compiler_mutex); + status = compiler->handle_repl_string(input_from_stdin); + } } } catch (std::exception& e) { - fmt::print("Compiler Fatal Error: {}\n", e.what()); + fmt::print(stderr, "Compiler Fatal Error: {}\n", e.what()); + status = ReplStatus::WANT_EXIT; } + // Cleanup + if (repl_server_ok) { + repl_server.shutdown_server(); + nrepl_thread.join(); + } return 0; } diff --git a/goalc/make/MakeSystem.cpp b/goalc/make/MakeSystem.cpp index 0173815e8a..171c0ff99e 100644 --- a/goalc/make/MakeSystem.cpp +++ b/goalc/make/MakeSystem.cpp @@ -1,15 +1,16 @@ -#include - #include "MakeSystem.h" -#include "third-party/fmt/color.h" -#include "third-party/fmt/core.h" +#include #include "common/goos/ParseHelpers.h" +#include "common/util/FileUtil.h" #include "common/util/Timer.h" #include "goalc/make/Tools.h" +#include "third-party/fmt/color.h" +#include "third-party/fmt/core.h" + std::string MakeStep::print() const { std::string result = fmt::format("Tool {} with inputs", tool); int i = 0; @@ -37,7 +38,7 @@ std::string MakeStep::print() const { return result; } -MakeSystem::MakeSystem() { +MakeSystem::MakeSystem(const std::string& username) : m_goos(username) { m_goos.register_form("defstep", [=](const goos::Object& obj, goos::Arguments& args, const std::shared_ptr& env) { return handle_defstep(obj, args, env); @@ -55,12 +56,17 @@ MakeSystem::MakeSystem() { m_goos.set_global_variable_to_symbol("ASSETS", "#t"); + set_constant("*iso-data*", file_util::get_file_path({"iso_data"})); + set_constant("*use-iso-data-path*", false); + add_tool(); add_tool(); add_tool(); add_tool(); - add_tool(); add_tool(); + add_tool(); + add_tool(); + add_tool(); } /*! @@ -353,11 +359,7 @@ bool MakeSystem::make(const std::string& target, bool force, bool verbose) { print_input(rule->input, '\n'); } else { fmt::print("[{:3d}%] [{:8s}] {:.3f} ", percent, tool->name(), step_timer.getSeconds()); - if (tool->name() == "goalc") { - print_input(rule->input, '\r'); - } else { - print_input(rule->input, '\n'); - } + print_input(rule->input, '\n'); } } } @@ -365,3 +367,11 @@ bool MakeSystem::make(const std::string& target, bool force, bool verbose) { make_timer.getSeconds()); return true; } + +void MakeSystem::set_constant(const std::string& name, const std::string& value) { + m_goos.set_global_variable_by_name(name, goos::StringObject::make_new(value)); +} + +void MakeSystem::set_constant(const std::string& name, bool value) { + m_goos.set_global_variable_to_symbol(name, value ? "#t" : "#f"); +} diff --git a/goalc/make/MakeSystem.h b/goalc/make/MakeSystem.h index 4231e90a9e..247e1ee056 100644 --- a/goalc/make/MakeSystem.h +++ b/goalc/make/MakeSystem.h @@ -1,6 +1,7 @@ #pragma once #include "common/goos/Interpreter.h" + #include "goalc/make/Tool.h" struct MakeStep { @@ -14,7 +15,7 @@ struct MakeStep { class MakeSystem { public: - MakeSystem(); + MakeSystem(const std::string& username = "#f"); void load_project_file(const std::string& file_path); goos::Object handle_defstep(const goos::Object& obj, @@ -35,6 +36,8 @@ class MakeSystem { bool make(const std::string& target, bool force, bool verbose); void add_tool(std::shared_ptr tool); + void set_constant(const std::string& name, const std::string& value); + void set_constant(const std::string& name, bool value); template void add_tool() { diff --git a/goalc/make/Tool.cpp b/goalc/make/Tool.cpp index 8ee74454da..e2e7fa2b98 100644 --- a/goalc/make/Tool.cpp +++ b/goalc/make/Tool.cpp @@ -1,12 +1,13 @@ +#include "Tool.h" + #include #include -#include "third-party/fmt/core.h" - -#include "Tool.h" #include "common/util/FileUtil.h" +#include "third-party/fmt/core.h" + Tool::Tool(const std::string& name) : m_name(name) {} bool Tool::needs_run(const ToolInput& task) { diff --git a/goalc/make/Tool.h b/goalc/make/Tool.h index fe477295b6..d1d2168a94 100644 --- a/goalc/make/Tool.h +++ b/goalc/make/Tool.h @@ -3,6 +3,7 @@ #include #include #include + #include "common/goos/Object.h" struct ToolInput { diff --git a/goalc/make/Tools.cpp b/goalc/make/Tools.cpp index 2f90e549a4..75c1d302e3 100644 --- a/goalc/make/Tools.cpp +++ b/goalc/make/Tools.cpp @@ -1,16 +1,18 @@ - - #include "Tools.h" #include -#include "goalc/compiler/Compiler.h" + #include "common/goos/ParseHelpers.h" #include "common/util/DgoWriter.h" #include "common/util/FileUtil.h" -#include "third-party/fmt/core.h" + +#include "goalc/build_level/build_level.h" +#include "goalc/compiler/Compiler.h" #include "goalc/data_compiler/dir_tpages.h" #include "goalc/data_compiler/game_count.h" -#include "goalc/data_compiler/game_text.h" +#include "goalc/data_compiler/game_text_common.h" + +#include "third-party/fmt/core.h" CompilerTool::CompilerTool(Compiler* compiler) : Tool("goalc"), m_compiler(compiler) {} @@ -28,8 +30,11 @@ bool CompilerTool::needs_run(const ToolInput& task) { bool CompilerTool::run(const ToolInput& task) { // todo check inputs try { - m_compiler->run_front_end_on_string( - fmt::format("(asm-file \"{}\" :no-time-prints :color :write)", task.input.at(0))); + CompilationOptions options; + options.filename = task.input.at(0); + options.color = true; + options.write = true; + m_compiler->asm_file(options); } catch (std::exception& e) { fmt::print("Compilation failed: {}\n", e.what()); return false; @@ -67,33 +72,6 @@ DgoDescription parse_desc_file(const std::string& filename, goos::Reader& reader }); return desc; } - -static const std::unordered_map s_text_ver_enum_map = { - {"jak1-v1", GameTextVersion::JAK1_V1}}; - -std::unordered_map> open_subtitle_project( - const std::string& filename) { - goos::Reader reader; - auto& proj = reader.read_from_file({filename}).as_pair()->cdr.as_pair()->car; - if (!proj.is_pair() || !proj.as_pair()->car.is_symbol() || - proj.as_pair()->car.as_symbol()->name != "subtitle") { - throw std::runtime_error("invalid subtitle project"); - } - - std::unordered_map> inputs; - goos::for_each_in_list(proj.as_pair()->cdr, [&](const goos::Object& o) { - if (!o.is_pair()) { - throw std::runtime_error("invalid entry in subtitle project"); - } - - auto& ver = o.as_pair()->car.as_symbol()->name; - auto& in = o.as_pair()->cdr.as_pair()->car.as_string()->data; - - inputs[s_text_ver_enum_map.at(ver)].push_back(in); - }); - - return inputs; -} } // namespace DgoTool::DgoTool() : Tool("dgo") {} @@ -152,11 +130,29 @@ bool GameCntTool::run(const ToolInput& task) { TextTool::TextTool() : Tool("text") {} -bool TextTool::run(const ToolInput& task) { +bool TextTool::needs_run(const ToolInput& task) { if (task.input.size() != 1) { throw std::runtime_error(fmt::format("Invalid amount of inputs to {} tool", name())); } - compile_game_text(task.input.at(0)); + + std::vector deps; + std::unordered_map> inputs; + open_text_project("text", task.input.at(0), inputs); + for (auto& [ver, files] : inputs) { + for (auto& in : files) { + deps.push_back(in); + } + } + return Tool::needs_run({task.input, deps, task.output, task.arg}); +} + +bool TextTool::run(const ToolInput& task) { + GameTextDB db; + std::unordered_map> inputs; + open_text_project("text", task.input.at(0), inputs); + for (auto& [ver, in] : inputs) { + compile_game_text(in, ver, db); + } return true; } @@ -166,7 +162,7 @@ bool GroupTool::run(const ToolInput&) { return true; } -SubtitleTool::SubtitleTool(Compiler* compiler) : Tool("subtitle"), m_compiler(compiler) {} +SubtitleTool::SubtitleTool() : Tool("subtitle") {} bool SubtitleTool::needs_run(const ToolInput& task) { if (task.input.size() != 1) { @@ -174,8 +170,10 @@ bool SubtitleTool::needs_run(const ToolInput& task) { } std::vector deps; - for (auto& [ver, inputs] : open_subtitle_project(task.input.at(0))) { - for (auto& in : inputs) { + std::unordered_map> inputs; + open_text_project("subtitle", task.input.at(0), inputs); + for (auto& [ver, files] : inputs) { + for (auto& in : files) { deps.push_back(in); } } @@ -183,8 +181,30 @@ bool SubtitleTool::needs_run(const ToolInput& task) { } bool SubtitleTool::run(const ToolInput& task) { - for (auto& [ver, in] : open_subtitle_project(task.input.at(0))) { - compile_game_subtitle(in, ver, m_compiler->subtitle_db()); + GameSubtitleDB db; + db.m_subtitle_groups = std::make_unique(); + db.m_subtitle_groups->hydrate_from_asset_file(); + std::unordered_map> inputs; + open_text_project("subtitle", task.input.at(0), inputs); + for (auto& [ver, in] : inputs) { + compile_game_subtitle(in, ver, db); } return true; } + +BuildLevelTool::BuildLevelTool() : Tool("build-level") {} + +bool BuildLevelTool::needs_run(const ToolInput& task) { + if (task.input.size() != 1) { + throw std::runtime_error(fmt::format("Invalid amount of inputs to {} tool", name())); + } + auto deps = get_build_level_deps(task.input.at(0)); + return Tool::needs_run({task.input, deps, task.output, task.arg}); +} + +bool BuildLevelTool::run(const ToolInput& task) { + if (task.input.size() != 1) { + throw std::runtime_error(fmt::format("Invalid amount of inputs to {} tool", name())); + } + return run_build_level(task.input.at(0), task.output.at(0)); +} diff --git a/goalc/make/Tools.h b/goalc/make/Tools.h index 49622d1320..59a0390d08 100644 --- a/goalc/make/Tools.h +++ b/goalc/make/Tools.h @@ -1,8 +1,8 @@ #pragma once -#include "goalc/make/Tool.h" #include "common/goos/Reader.h" -#include "goalc/data_compiler/game_subtitle.h" + +#include "goalc/make/Tool.h" class Compiler; @@ -48,6 +48,7 @@ class TextTool : public Tool { public: TextTool(); bool run(const ToolInput& task) override; + bool needs_run(const ToolInput& task) override; }; class GroupTool : public Tool { @@ -58,10 +59,14 @@ class GroupTool : public Tool { class SubtitleTool : public Tool { public: - SubtitleTool(Compiler* compiler); + SubtitleTool(); + bool run(const ToolInput& task) override; + bool needs_run(const ToolInput& task) override; +}; + +class BuildLevelTool : public Tool { + public: + BuildLevelTool(); bool run(const ToolInput& task) override; bool needs_run(const ToolInput& task) override; - - private: - Compiler* m_compiler; }; diff --git a/goalc/regalloc/Allocator.cpp b/goalc/regalloc/Allocator.cpp index 986247d1a2..fc3d1459c8 100644 --- a/goalc/regalloc/Allocator.cpp +++ b/goalc/regalloc/Allocator.cpp @@ -3,11 +3,14 @@ * Implementation of register allocation algorithms */ -#include -#include "third-party/fmt/core.h" #include "Allocator.h" + +#include + #include "goalc/regalloc/allocator_interface.h" +#include "third-party/fmt/core.h" + std::string LiveInfo::print_assignment() { std::string result = "Assignment for var " + std::to_string(var) + "\n"; for (uint32_t i = 0; i < assignment.size(); i++) { @@ -569,8 +572,7 @@ bool try_spill_coloring(int var, RegAllocCache* cache, const AllocationInput& in } if (spill_assignment.reg == -1) { - printf("SPILLING FAILED BECAUSE WE COULDN'T FIND A TEMP REGISTER!\n"); - ASSERT(false); + ASSERT_MSG(false, "SPILLING FAILED BECAUSE WE COULDN'T FIND A TEMP REGISTER!"); return false; } @@ -844,4 +846,4 @@ AllocationResult allocate_registers(const AllocationInput& input) { result.num_spills = cache.stats.num_spill_ops; return result; -} \ No newline at end of file +} diff --git a/goalc/regalloc/Allocator.h b/goalc/regalloc/Allocator.h index 7f18b3b098..d4a8a356dc 100644 --- a/goalc/regalloc/Allocator.h +++ b/goalc/regalloc/Allocator.h @@ -1,9 +1,10 @@ #pragma once -#include #include -#include "IRegSet.h" #include +#include + +#include "IRegSet.h" #include "IRegister.h" #include "allocator_interface.h" diff --git a/goalc/regalloc/Allocator_v2.cpp b/goalc/regalloc/Allocator_v2.cpp index 9674278db9..7865dd4188 100644 --- a/goalc/regalloc/Allocator_v2.cpp +++ b/goalc/regalloc/Allocator_v2.cpp @@ -1,9 +1,12 @@ -#include +#include "Allocator_v2.h" + #include #include -#include "third-party/fmt/core.h" +#include + #include "common/util/Range.h" -#include "Allocator_v2.h" + +#include "third-party/fmt/core.h" /*! Documentation: @@ -219,7 +222,7 @@ class VarAssignment { } } - const std::vector live_vector() const { return m_live; } + const std::vector& live_vector() const { return m_live; } private: // common info diff --git a/goalc/regalloc/IRegSet.h b/goalc/regalloc/IRegSet.h index 5da9d86730..295c3adb6e 100644 --- a/goalc/regalloc/IRegSet.h +++ b/goalc/regalloc/IRegSet.h @@ -14,12 +14,13 @@ * The space used is (highest_set_reg + 63) / 64 + constant overhead (vector + int) */ #include + #include "common/common_types.h" #include "common/util/Assert.h" class IRegSet { public: - IRegSet() { m_data.reserve(4); } + IRegSet() { resize(64 * 4); } /*! * Add the given ireg to the set. diff --git a/goalc/regalloc/IRegister.cpp b/goalc/regalloc/IRegister.cpp index 2b994dad6b..2af3ab29a7 100644 --- a/goalc/regalloc/IRegister.cpp +++ b/goalc/regalloc/IRegister.cpp @@ -1,7 +1,9 @@ -#include "third-party/fmt/core.h" #include "IRegister.h" + #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + std::string IRegister::to_string() const { // if (with_constraints) { // std::string result = fmt::format("i{}-{}\n", emitter::to_string(kind), id); diff --git a/goalc/regalloc/IRegister.h b/goalc/regalloc/IRegister.h index 52cba278d7..6da5caf23c 100644 --- a/goalc/regalloc/IRegister.h +++ b/goalc/regalloc/IRegister.h @@ -6,6 +6,7 @@ #include #include + #include "goalc/emitter/Register.h" struct IRegister { diff --git a/goalc/regalloc/allocator_interface.cpp b/goalc/regalloc/allocator_interface.cpp index e5be037464..949b663e8d 100644 --- a/goalc/regalloc/allocator_interface.cpp +++ b/goalc/regalloc/allocator_interface.cpp @@ -3,10 +3,11 @@ * Runs the register allocator. */ +#include "allocator_interface.h" + #include #include "third-party/fmt/core.h" -#include "allocator_interface.h" /*! * Print out the input data for debugging. diff --git a/goalc/regalloc/allocator_interface.h b/goalc/regalloc/allocator_interface.h index 4b8092a450..a1dfe554bd 100644 --- a/goalc/regalloc/allocator_interface.h +++ b/goalc/regalloc/allocator_interface.h @@ -9,8 +9,9 @@ * allocate_registers algorithm. */ -#include #include +#include + #include "goalc/emitter/Register.h" #include "goalc/regalloc/IRegSet.h" #include "goalc/regalloc/IRegister.h" diff --git a/scripts/batch/decomp-jak1_jp.bat b/scripts/batch/decomp-jak1_jp.bat new file mode 100644 index 0000000000..c817d73ace --- /dev/null +++ b/scripts/batch/decomp-jak1_jp.bat @@ -0,0 +1,4 @@ +@echo off +cd ..\.. +out\build\Release\bin\decompiler decompiler\config\jak1_jp.jsonc iso_data decompiler_out\ +pause diff --git a/scripts/batch/decomp-jak1pal.bat b/scripts/batch/decomp-jak1_pal.bat similarity index 67% rename from scripts/batch/decomp-jak1pal.bat rename to scripts/batch/decomp-jak1_pal.bat index d835ad154c..d8584f8305 100644 --- a/scripts/batch/decomp-jak1pal.bat +++ b/scripts/batch/decomp-jak1_pal.bat @@ -1,4 +1,4 @@ @echo off cd ..\.. -out\build\Release\bin\decompiler decompiler\config\jak1_pal.jsonc iso_data\jak1pal decompiler_out\jak1pal +out\build\Release\bin\decompiler decompiler\config\jak1_pal.jsonc iso_data decompiler_out\ pause diff --git a/scripts/batch/decomp-jak1_us2.bat b/scripts/batch/decomp-jak1_us2.bat new file mode 100644 index 0000000000..a2a0e3163c --- /dev/null +++ b/scripts/batch/decomp-jak1_us2.bat @@ -0,0 +1,4 @@ +@echo off +cd ..\.. +out\build\Release\bin\decompiler decompiler\config\jak1_us2.jsonc iso_data decompiler_out\ +pause diff --git a/scripts/batch/decomp-jak1sced.bat b/scripts/batch/decomp-jak1sced.bat deleted file mode 100644 index 8d3935beea..0000000000 --- a/scripts/batch/decomp-jak1sced.bat +++ /dev/null @@ -1,4 +0,0 @@ -@echo off -cd ..\.. -out\build\Release\bin\decompiler decompiler\config\jak1_sced.jsonc iso_data\jak1sced decompiler_out\jak1sced -pause diff --git a/scripts/batch/gc-dbg.bat b/scripts/batch/gc-dbg.bat index 5c69b5e26b..057af06427 100644 --- a/scripts/batch/gc-dbg.bat +++ b/scripts/batch/gc-dbg.bat @@ -1,4 +1,4 @@ @echo off cd ..\.. -out\build\Release\bin\goalc -v -auto-dbg -user-auto +out\build\Release\bin\goalc --auto-dbg --user-auto pause diff --git a/scripts/batch/gc-no-lt.bat b/scripts/batch/gc-no-lt.bat index 82b4e4d087..59bc6c053f 100644 --- a/scripts/batch/gc-no-lt.bat +++ b/scripts/batch/gc-no-lt.bat @@ -1,4 +1,4 @@ @echo off cd ..\.. -out\build\Release\bin\goalc -v -user-auto +out\build\Release\bin\goalc --user-auto pause diff --git a/scripts/batch/gc.bat b/scripts/batch/gc.bat index 2e72bdb9b7..f7f2d4455b 100644 --- a/scripts/batch/gc.bat +++ b/scripts/batch/gc.bat @@ -1,4 +1,4 @@ @echo off cd ..\.. -out\build\Release\bin\goalc -v -auto-lt -user-auto +out\build\Release\bin\goalc --auto-lt --user-auto pause diff --git a/scripts/batch/repo-settings-mark.bat b/scripts/batch/repo-settings-mark.bat index d44608d553..b112fa806b 100644 --- a/scripts/batch/repo-settings-mark.bat +++ b/scripts/batch/repo-settings-mark.bat @@ -1,2 +1,2 @@ cd ..\.. -git update-index --assume-unchanged decompiler\config\jak1_ntsc_black_label.jsonc decompiler\config\jak1_ntsc_black_label\inputs.jsonc +git update-index --assume-unchanged decompiler\config\jak1_ntsc_black_label.jsonc diff --git a/scripts/batch/repo-settings-unmark.bat b/scripts/batch/repo-settings-unmark.bat index bf3eee7899..75b2a4777c 100644 --- a/scripts/batch/repo-settings-unmark.bat +++ b/scripts/batch/repo-settings-unmark.bat @@ -1,2 +1,2 @@ cd ..\.. -git update-index --no-assume-unchanged decompiler\config\jak1_ntsc_black_label.jsonc decompiler\config\jak1_ntsc_black_label\inputs.jsonc +git update-index --no-assume-unchanged decompiler\config\jak1_ntsc_black_label.jsonc diff --git a/scripts/nrepl-test.py b/scripts/nrepl-test.py new file mode 100644 index 0000000000..81145e7e7e --- /dev/null +++ b/scripts/nrepl-test.py @@ -0,0 +1,15 @@ +import socket +import struct +clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM); +clientSocket.connect(("127.0.0.1", 8181)) +print(clientSocket) +data = clientSocket.recv(1024) +print(data.decode()) + +form = "(:status)" + +header = struct.pack(' 0: + output_json[os.path.basename(source_file)[:-3]] = list(deps) + to_modify[source_file] = deps + + # uncomment to modify files + # for file, deps in to_modify.items(): + # print("modifying ", file, deps) + # with open(file, "r") as f: + # lines = f.readlines() + # to_add = [] # ["\n"] + # for dep in deps: + # to_add.append("(import \"{}\")\n".format(dep)) + # print(to_add) + # added = False + # for i, line in enumerate(lines): + # if ";; decomp begins" in line.lower(): + # lines[i+1:i+1] = to_add + # added = True + # break + # if not added: + # lines[6:6] = to_add + # assert lines[1] == "(in-package goal)\n" + # with open(file, "w") as f: + # f.writelines(lines) + + # uncomment to print json. + # print(json.dumps(output_json, indent=4)) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/scripts/shell/decomp2.sh b/scripts/shell/decomp2.sh new file mode 100755 index 0000000000..4761152dd3 --- /dev/null +++ b/scripts/shell/decomp2.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# Directory of this script +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +"${DIR}"/../../build/decompiler/decompiler "${DIR}"/../../decompiler/config/jak2_ntsc_v1.jsonc "${DIR}"/../../iso_data/ "${DIR}"/../../decompiler_out diff --git a/scripts/shell/offline_test_git_branch.sh b/scripts/shell/offline_test_git_branch.sh index 325f2160bb..0d07d11c9e 100755 --- a/scripts/shell/offline_test_git_branch.sh +++ b/scripts/shell/offline_test_git_branch.sh @@ -48,7 +48,7 @@ echo " ================ Decompiling..." ../scripts/shell/decomp.sh echo " ================ Building project..." -../scripts/shell/gc.sh -cmd \(make-group\ \"iso\"\) +../scripts/shell/gc.sh --cmd \(make-group\ \"iso\"\) echo " ================ Checking assets..." ../scripts/shell/check.sh diff --git a/scripts/update-goal-src.py b/scripts/update-goal-src.py index 41b1fdd1bf..7d8df4c760 100644 --- a/scripts/update-goal-src.py +++ b/scripts/update-goal-src.py @@ -21,7 +21,6 @@ throw_error = False # list, it will remind you such a file was touched by making a root file # that will be picked up by git to shame you files_with_modifications = [ - "target-util", "ambient", "viewer", "sunken-obs", @@ -31,16 +30,20 @@ files_with_modifications = [ "default-menu", "collide-shape", "cam-states", - "helix-water", + "misty-obs", "lavatube-energy", - "sage-finalboss-FIN", + "sage-finalboss", "progress", "entity", "ogreboss", "navigate", "ice-cube", "snow-bunny", - "citadel-sages" + "citadel-sages", + "racer-part", + "collectables-part", + "collectables", + "basebutton" ] for file in files: diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 79247bbd70..0000000000 --- a/shell.nix +++ /dev/null @@ -1,4 +0,0 @@ -(import (fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz"; - sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; -}) { src = ./.; }).shellNix diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b98c46ce29..1929508bdc 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -8,7 +8,7 @@ add_executable(goalc-test ${CMAKE_CURRENT_LIST_DIR}/test_reader.cpp ${CMAKE_CURRENT_LIST_DIR}/test_goos.cpp ${CMAKE_CURRENT_LIST_DIR}/test_listener_deci2.cpp - ${CMAKE_CURRENT_LIST_DIR}/test_kernel.cpp + ${CMAKE_CURRENT_LIST_DIR}/test_kernel_jak1.cpp ${CMAKE_CURRENT_LIST_DIR}/all_jak1_symbols.cpp ${CMAKE_CURRENT_LIST_DIR}/test_type_system.cpp ${CMAKE_CURRENT_LIST_DIR}/test_CodeTester.cpp diff --git a/test/decompiler/FormRegressionTest.cpp b/test/decompiler/FormRegressionTest.cpp index c573815163..8a695ece7a 100644 --- a/test/decompiler/FormRegressionTest.cpp +++ b/test/decompiler/FormRegressionTest.cpp @@ -1,18 +1,20 @@ #include "FormRegressionTest.h" -#include "decompiler/analysis/type_analysis.h" -#include "decompiler/analysis/variable_naming.h" -#include "decompiler/analysis/reg_usage.h" +#include "common/goos/PrettyPrinter.h" +#include "common/util/json_util.h" + +#include "decompiler/IR2/Form.h" #include "decompiler/analysis/cfg_builder.h" #include "decompiler/analysis/expression_build.h" #include "decompiler/analysis/final_output.h" -#include "decompiler/analysis/stack_spill.h" -#include "decompiler/analysis/insert_lets.h" #include "decompiler/analysis/inline_asm_rewrite.h" +#include "decompiler/analysis/insert_lets.h" +#include "decompiler/analysis/reg_usage.h" +#include "decompiler/analysis/stack_spill.h" +#include "decompiler/analysis/type_analysis.h" +#include "decompiler/analysis/variable_naming.h" #include "decompiler/util/config_parsers.h" -#include "common/goos/PrettyPrinter.h" -#include "common/util/json_util.h" -#include "decompiler/IR2/Form.h" + #include "third-party/json.hpp" using namespace decompiler; @@ -126,7 +128,7 @@ std::unique_ptr FormRegressionTest::make_function( auto program = parser->parse_program(code, string_label_names); // create the test data collection - auto test = std::make_unique(program.instructions.size()); + auto test = std::make_unique(program.instructions.size(), settings.version); // populate the LinkedObjectFile test->file.words_by_seg.resize(3); test->file.labels = program.labels; @@ -158,7 +160,7 @@ std::unique_ptr FormRegressionTest::make_function( // analyze function prologue/epilogue test->func.analyze_prologue(test->file); // build control flow graph - test->func.cfg = build_cfg(test->file, 0, test->func, {}, {}); + test->func.cfg = build_cfg(test->file, 0, test->func, {}, {}, settings.version); EXPECT_TRUE(test->func.cfg->is_fully_resolved()); if (!test->func.cfg->is_fully_resolved()) { fmt::print("CFG:\n{}\n", test->func.cfg->to_dot()); @@ -173,7 +175,8 @@ std::unique_ptr FormRegressionTest::make_function( // convert instruction to atomic ops DecompWarnings warnings; - auto ops = convert_function_to_atomic_ops(test->func, program.labels, warnings, false, {}); + auto ops = convert_function_to_atomic_ops(test->func, program.labels, warnings, false, {}, + settings.version); test->func.ir2.atomic_ops = std::make_shared(std::move(ops)); test->func.ir2.atomic_ops_succeeded = true; test->func.ir2.env.set_end_var(test->func.ir2.atomic_ops->end_op().return_var()); @@ -233,8 +236,9 @@ std::unique_ptr FormRegressionTest::make_function( test->func, *dts); // move variables into lets. + LetRewriteStats dummy; insert_lets(test->func, test->func.ir2.env, *test->func.ir2.form_pool, - test->func.ir2.top_form); + test->func.ir2.top_form, dummy); } } @@ -276,7 +280,7 @@ void FormRegressionTest::test(const std::string& code, EXPECT_TRUE(expected_form == actual_form); } -void FormRegressionTest::test_final_function( +void FormRegressionTest::test_final_function_jak1( const std::string& code, const std::string& type, const std::string& expected, @@ -307,12 +311,12 @@ void FormRegressionTest::test_final_function( EXPECT_TRUE(expected_form == actual_form); } -void FormRegressionTest::test_with_stack_structures(const std::string& code, - const std::string& type, - const std::string& expected, - const std::string& stack_map_json, - const std::string& cast_json, - const std::string& var_map_json) { +void FormRegressionTest::test_with_stack_structures_jak1(const std::string& code, + const std::string& type, + const std::string& expected, + const std::string& stack_map_json, + const std::string& cast_json, + const std::string& var_map_json) { TestSettings settings; settings.do_expressions = true; settings.stack_structure_json = stack_map_json; @@ -322,4 +326,4 @@ void FormRegressionTest::test_with_stack_structures(const std::string& code, } std::unique_ptr FormRegressionTest::parser; -std::unique_ptr FormRegressionTest::dts; \ No newline at end of file +std::unique_ptr FormRegressionTest::dts; diff --git a/test/decompiler/FormRegressionTest.h b/test/decompiler/FormRegressionTest.h index e428749623..28f07a79c0 100644 --- a/test/decompiler/FormRegressionTest.h +++ b/test/decompiler/FormRegressionTest.h @@ -1,11 +1,12 @@ #pragma once #include -#include "gtest/gtest.h" + #include "decompiler/Disasm/InstructionParser.h" -#include "decompiler/util/DecompilerTypeSystem.h" #include "decompiler/Function/Function.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "decompiler/util/DecompilerTypeSystem.h" +#include "gtest/gtest.h" namespace decompiler { struct RegisterTypeCast; @@ -19,6 +20,7 @@ struct TestSettings { std::string casts_json; std::string var_map_json; std::string stack_structure_json; + GameVersion version = GameVersion::Jak1; }; class FormRegressionTest : public ::testing::Test { @@ -30,7 +32,7 @@ class FormRegressionTest : public ::testing::Test { static void TearDownTestCase(); struct TestData { - explicit TestData(int instrs) : func(0, instrs) {} + explicit TestData(int instrs, GameVersion version) : func(0, instrs, version) {} decompiler::Function func; decompiler::LinkedObjectFile file; @@ -40,28 +42,28 @@ class FormRegressionTest : public ::testing::Test { std::unique_ptr make_function(const std::string& code, const TypeSpec& function_type, const TestSettings& settings); - void test(const std::string& code, const std::string& type, const std::string& expected, const TestSettings& settings); - void test_final_function(const std::string& code, - const std::string& type, - const std::string& expected, - bool allow_pairs = false, - const std::vector>& strings = {}, - const std::string& cast_json = "", - const std::string& var_map_json = ""); + void test_final_function_jak1( + const std::string& code, + const std::string& type, + const std::string& expected, + bool allow_pairs = false, + const std::vector>& strings = {}, + const std::string& cast_json = "", + const std::string& var_map_json = ""); - void test_no_expr(const std::string& code, - const std::string& type, - const std::string& expected, - bool allow_pairs = false, - const std::string& method_name = "", - const std::vector>& strings = {}, - const std::string& cast_json = "", - const std::string& var_map_json = "") { + void test_no_expr_jak1(const std::string& code, + const std::string& type, + const std::string& expected, + bool allow_pairs = false, + const std::string& method_name = "", + const std::vector>& strings = {}, + const std::string& cast_json = "", + const std::string& var_map_json = "") { TestSettings settings; settings.allow_pairs = allow_pairs; settings.method_name = method_name; @@ -72,14 +74,14 @@ class FormRegressionTest : public ::testing::Test { test(code, type, expected, settings); } - void test_with_expr(const std::string& code, - const std::string& type, - const std::string& expected, - bool allow_pairs = false, - const std::string& method_name = "", - const std::vector>& strings = {}, - const std::string& cast_json = "", - const std::string& var_map_json = "") { + void test_with_expr_jak1(const std::string& code, + const std::string& type, + const std::string& expected, + bool allow_pairs = false, + const std::string& method_name = "", + const std::vector>& strings = {}, + const std::string& cast_json = "", + const std::string& var_map_json = "") { TestSettings settings; settings.allow_pairs = allow_pairs; settings.method_name = method_name; @@ -90,10 +92,10 @@ class FormRegressionTest : public ::testing::Test { test(code, type, expected, settings); } - void test_with_stack_structures(const std::string& code, - const std::string& type, - const std::string& expected, - const std::string& stack_map_json, - const std::string& cast_json = "", - const std::string& var_map_json = ""); + void test_with_stack_structures_jak1(const std::string& code, + const std::string& type, + const std::string& expected, + const std::string& stack_map_json, + const std::string& cast_json = "", + const std::string& var_map_json = ""); }; \ No newline at end of file diff --git a/test/decompiler/reference/decompiler-macros.gc b/test/decompiler/reference/decompiler-macros.gc index 9bdb47442f..aa11ce3a1e 100644 --- a/test/decompiler/reference/decompiler-macros.gc +++ b/test/decompiler/reference/decompiler-macros.gc @@ -676,8 +676,8 @@ ) (defmacro sp-rnd-flt (field-name val range mult) - `(new 'static 'sp-field-init-spec - :field (sp-field-id ,field-name) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) :initial-valuef ,val :random-rangef ,range :random-multf ,mult @@ -686,8 +686,8 @@ ) (defmacro sp-flt (field-name val) - `(new 'static 'sp-field-init-spec - :field (sp-field-id ,field-name) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) :initial-valuef ,val :random-rangef 0.0 :random-multf 1.0 @@ -840,20 +840,16 @@ ) ) -(defmacro send-event (proc msg &rest params) +(defmacro send-event (proc msg &key (from (with-pp pp)) &rest params) "Send an event to a process. This should be used over send-event-function" - `(with-pp - (let ((event-data (new 'stack-singleton-no-clear 'event-message-block))) - (set! (-> event-data from) pp) + `(let ((event-data (new 'stack-no-clear 'event-message-block))) + (set! (-> event-data from) ,from) (set! (-> event-data num-params) ,(length params)) (set! (-> event-data message) ,msg) - ,@(let ((ep 0)) - (apply (lambda (x) `(set! (-> event-data param ep) (the-as uint ,x)) (inc! ep)) params) - ) + ,@(apply-i (lambda (x i) `(set! (-> event-data param ,i) (the-as uint ,x))) params) (send-event-function ,proc event-data) ) - ) ) ;; vector-h @@ -866,10 +862,26 @@ ) ;; art-h +(desfun art-elt->index (ag-name elt-name) + (if (number? elt-name) + elt-name + (let ((ag-info (hash-table-try-ref *art-info* (symbol->string ag-name)))) + (if (not (car ag-info)) + -1 + (let ((elt-info (hash-table-try-ref (cdr ag-info) (symbol->string elt-name)))) + (if (not (car elt-info)) + -1 + (cadr (cdr elt-info))) + ) + ) + ) + ) + ) + (defmacro defskelgroup (name art-name joint-geom joint-anim lods &key (shadow 0) &key bounds - &key longest-edge + &key (longest-edge 0.0) &key (texture-level 0) &key (sort 0) &key (version 6) ;; do NOT use this! @@ -883,18 +895,18 @@ :longest-edge ,longest-edge :version ,version :max-lod ,(- (length lods) 1) - :shadow ,shadow + :shadow ,(art-elt->index (string->symbol-format "{}-ag" art-name) shadow) :texture-level ,texture-level :sort ,sort ))) ;; set joint geometry and joint bones - (set! (-> skel jgeo) ,joint-geom) - (set! (-> skel janim) ,joint-anim) - + (set! (-> skel jgeo) ,(art-elt->index (string->symbol-format "{}-ag" art-name) joint-geom)) + (set! (-> skel janim) ,(art-elt->index (string->symbol-format "{}-ag" art-name) joint-anim)) + ;; set lods ,@(apply-i (lambda (x i) `(begin - (set! (-> skel mgeo ,i) ,(car x)) + (set! (-> skel mgeo ,i) ,(art-elt->index (string->symbol-format "{}-ag" art-name) (car x))) (set! (-> skel lod-dist ,i) ,(cadr x)) ) ) lods) @@ -929,3 +941,346 @@ (fake-asm .mtc0 dest src) (fake-asm .mtpc dest src) (fake-asm .mfpc dest src) + +;; math +(defmacro seek! (place target rate) + "Macro to use seek in-place. place is the base, and where the result is stored." + `(set! ,place (seek ,place ,target ,rate)) + ) + +(defmacro seekl! (place target rate) + "Macro to use seekl in-place. place is the base, and where the result is stored." + `(set! ,place (seekl ,place ,target ,rate)) + ) + +(defmacro rand-float-gen (&key (gen *random-generator*)) + "Generate a float from [0, 1)" + `(+ -1.0 (the-as float (logior #x3f800000 (/ (rand-uint31-gen ,gen) 256)))) + ) + +;; gsound-h +(defmacro sound-vol (vol) + "convert to sound volume units" + (if (number? vol) + (* 1 (/ (* vol 1024) 100)) + `(the int (/ (* ,vol 1024) 100)) + ) + ) + +(defmacro static-sound-spec (name &key (num 1.0) &key (group 1) + &key (volume #f) + &key (pitch-mod 0) + &key (fo-min 0) &key (fo-max 0) + &key (mask ())) + (let ((snd-mask mask) + (snd-volume 100.0)) + (when (nonzero? fo-max) (cons! snd-mask 'fo-max)) + (when (nonzero? fo-min) (cons! snd-mask 'fo-min)) + (when (nonzero? pitch-mod) (cons! snd-mask 'pitch)) + (when volume (cons! snd-mask 'volume) (set! snd-volume volume)) + `(new 'static 'sound-spec + :sound-name (static-sound-name ,name) + :num ,num + :group ,group + :volume (sound-vol ,snd-volume) + :pitch-mod ,pitch-mod + :fo-min ,fo-min + :fo-max ,fo-max + :mask (sound-mask ,@snd-mask) + )) + ) + +;; gsound +(defmacro sound-play (name &key (id (new-sound-id)) + &key (vol 100.0) &key (pitch 0) &key (bend 0) + &key (group sfx) + &key (position #t)) + `(sound-play-by-name (static-sound-name ,name) ,id (the int (* (/ 1024.0 100.0) ,vol)) (the int (* 1524.0 ,pitch)) ,bend (sound-group ,group) ,position) + ) + +;; process-drawable +(defmacro ja-group (&key (chan 0)) + "get the frame group for self. default channel is 0, the base channel. returns #f if no frame group." + `(if (> (-> self skel active-channels) ,chan) + (-> self skel root-channel ,chan frame-group)) + ) + +(defmacro ja-group? (group &key (chan 0)) + "is self in this frame group on this channel? default is channel 0, which is the base channel." + `(= (ja-group) ,group) + ) + +(defmacro ja (&key (chan 0) + &key (group! #f) + &key (num! #f) + &key (param0 #f) + &key (param1 #f) + &key (num-func #f) + &key (frame-num #f) + &key (frame-interp #f) + &key (dist #f) + &key (eval? #t) + ) + "set various joint anim parameters for self and eval them. + you can use this for playing animations! + + chan = the channel to modify. defaults to 0 (base channel). this is usually what you want. + group! = when not #f, set this as the new frame-group. defaults to #f + num! = set the frame playback function. this is what determines what frame an animation is at. funcs below. + #f = no func will be set, and there wont be a frame eval. + num-func = sets the num-func field for the channel. this lets you change the function with eval'ing. + param0 = 1st parameter for the playback function. ONLY USE THESE WITH num-func !! + param1 = 2nd parameter for the playback function. ONLY USE THESE WITH num-func !! + frame-num = set the frame-num field. + frame-interp = set the frame-interp field. + dist = set the dist field. + + available num! functions: + - (+!) = advance anim. + - (-!) = reverse anim. + - (identity num) = play 'num' frame. + - (seek! target speed) = animate towards frame target at a speed. + speed is optional and defaults to 1.0 when not provided. + target is optional and defaults to the last frame of the animation. + if you want to set the speed, you therefore must also set the target. + target can be max (no quote), which is just the same as the default value. + - (loop! speed) = loop animation at a speed. default speed is 1.0 when not provided. + - (chan channel) = copy frame from another channel. + - min = the start of the animation. + - max = the end of the animation. + " + + (let* ((num-args (if (pair? num!) (cdr num!) '())) + (num! (if (pair? num!) (car num!) num!)) + (nf (cond + ((or (eq? num! 'identity) + (eq? num! 'min) + (eq? num! 'max) + ) + 'num-func-identity) + ((eq? num! 'none) 'num-func-none) + ((eq? num! '+!) 'num-func-+!) + ((eq? num! '-!) 'num-func--!) + ((eq? num! 'seek!) 'num-func-seek!) + ((eq? num! 'loop!) 'num-func-loop!) + ((eq? num! 'blend-in!) 'num-func-blend-in!) + ((eq? num! 'chan) 'num-func-chan) + )) + (p0 (if param0 param0 + (cond + ((eq? num! 'chan) `(the float ,(car num-args))) + ((eq? num! '+!) (if (null? num-args) 1.0 (car num-args))) + ((eq? num! '-!) (if (null? num-args) 1.0 (car num-args))) + ((eq? num! 'loop!) (if (null? num-args) 1.0 (if (eq? 'max (car num-args)) + (if group! + `(the float (1- (-> (the art-joint-anim ,group!) data 0 length))) + `(the float (1- (-> ja-ch frame-group data 0 length))) + ) + (car num-args)))) + ((eq? num! 'seek!) (if (or (null? num-args) (eq? (car num-args) 'max)) + (if group! + `(the float (1- (-> (the art-joint-anim ,group!) data 0 length))) + `(the float (1- (-> ja-ch frame-group data 0 length))) + ) + (car num-args))) + ))) + (p1 (if param1 param1 + (cond + ((eq? num! 'seek!) (if (or (null? num-args) (null? (cdr num-args))) 1.0 (cadr num-args))) + ))) + (frame-num (if (eq? 'max frame-num) (if group! + `(the float (1- (-> (the art-joint-anim ,group!) data 0 length))) + `(the float (1- (-> ja-ch frame-group data 0 length))) + ) + frame-num)) + (frame-group (if (or p0 p1 frame-num (not nf)) group! #f)) + ) + `(let ((ja-ch (-> self skel root-channel ,chan))) + ,(if frame-interp `(set! (-> ja-ch frame-interp) ,frame-interp) `(none)) + ,(if dist `(set! (-> ja-ch dist) ,dist) `(none)) + ,(if frame-group `(set! (-> ja-ch frame-group) (the art-joint-anim ,frame-group)) `(none)) + ,(if p0 `(set! (-> ja-ch param 0) ,p0) `(none)) + ,(if p1 `(set! (-> ja-ch param 1) ,p1) `(none)) + ,(if num-func `(set! (-> ja-ch num-func) ,num-func) `(none)) + ,(if frame-num `(set! (-> ja-ch frame-num) ,frame-num) `(none)) + ,(if nf + `(,(if eval? 'joint-control-channel-group-eval! 'joint-control-channel-group!) + ja-ch (the art-joint-anim ,group!) ,nf) + `(none)) + ,(cond + ((eq? num! 'min) `(set! (-> ja-ch frame-num) 0.0)) + ((eq? num! 'max) (if group! + `(set! (-> ja-ch frame-num) (the float (1- (-> (the art-joint-anim ,group!) data 0 length)))) + `(set! (-> ja-ch frame-num) (the float (1- (-> ja-ch frame-group data 0 length)))) + )) + ((eq? num! 'identity) `(set! (-> ja-ch frame-num) ,(car num-args))) + (#t `(none)) + ) + )) + ) + +(defmacro ja-no-eval (&key (chan 0) + &key (group! #f) + &key (num! #f) + &key (param0 #f) + &key (param1 #f) + &key (num-func #f) + &key (frame-num #f) + &key (frame-interp #f) + &key (dist #f) + ) + `(ja :eval? #f :chan ,chan :group! ,group! :num! ,num! :param0 ,param0 :param1 ,param1 :num-func ,num-func :frame-num ,frame-num :frame-interp ,frame-interp :dist ,dist) + ) + +;; gkernel-h + +(defconstant *scratch-memory-top* (the pointer #x70004000)) +(defconstant DPROCESS_STACK_SIZE #x8000) + +;; gkernel + +(defconstant *kernel-dram-stack* (&+ *dram-stack* DPROCESS_STACK_SIZE)) + +;; gstate +(defmacro process-spawn-function (proc-type func &key (from *default-dead-pool*) &key (to *default-pool*) &key (name #f) &key (stack-size #x4000) &key (stack *scratch-memory-top*) &rest args) + "Start a new process that runs a function on its main thread. + Returns a pointer to the new process (or #f? on error)." + + (with-gensyms (new-proc) + `(let ((,new-proc (the-as ,proc-type (get-process ,from ,proc-type ,stack-size)))) + (when ,new-proc + ((method-of-type ,proc-type activate) ,new-proc ,to ,(if name name `(quote ,proc-type)) ,stack) + (run-next-time-in-process ,new-proc ,func ,@args) + (the (pointer ,proc-type) (-> ,new-proc ppointer)) + ) + ) + ) + ) + +(defmacro process-spawn (proc-type &key (init #f) &key (from *default-dead-pool*) &key (to *default-pool*) &key (name #f) &key (stack-size #x4000) &key (stack *scratch-memory-top*) &rest args) + "Start a new process and run an init function on it. + Returns a pointer to the new process, or #f (or is it 0?) if something goes wrong." + + (with-gensyms (new-proc) + `(let ((,new-proc (the-as ,proc-type (get-process ,from ,proc-type ,stack-size)))) + (when ,new-proc + ((method-of-type ,proc-type activate) ,new-proc ,to ,(if name name `(quote ,proc-type)) ,stack) + (run-now-in-process ,new-proc ,(if init init (string->symbol (fmt #f "{}-init-by-other" proc-type))) ,@args) + (the (pointer ,proc-type) (-> ,new-proc ppointer)) + ) + ) + ) + ) + +;; generic-obs + +(defmacro manipy-spawn (trans entity skel arg &key (from *default-dead-pool*) &key (to *default-pool*) &key (name #f) &key (stack-size #x4000) &key (stack *scratch-memory-top*)) + `(process-spawn manipy :init manipy-init ,trans ,entity ,skel ,arg :from ,from :to ,to :name ,name :stack-size ,stack-size :stack ,stack) + ) + +;; game-h +(defmacro static-attack-info (&key (mask ()) &rest args) + (when (!= (length args) 1) + (error "static-attack-info can only have 1 arg")) + (let ((mask-actual mask) + (arg (car args)) + ) + (when (not (null? (assoc 'shove-up arg))) (cons! mask-actual 'shove-up)) + (when (not (null? (assoc 'shove-back arg))) (cons! mask-actual 'shove-back)) + (when (not (null? (assoc 'mode arg))) (cons! mask-actual 'mode)) + (when (not (null? (assoc 'vector arg))) (cons! mask-actual 'vector)) + (when (not (null? (assoc 'angle arg))) (cons! mask-actual 'angle)) + (when (not (null? (assoc 'control arg))) (cons! mask-actual 'control)) + `(let ((atk (new 'static 'attack-info :mask (attack-mask ,@mask-actual)))) + ,@(apply (lambda (x) (if (eq? (car x) 'vector) + `(vector-copy! (-> atk ,(car x)) ,(cadr x)) + `(set! (-> atk ,(car x)) ,(cadr x)) + )) arg) + atk) + ) + ) + +;; settings-h + + +(defmacro setting-control-func! (func s &rest args) + (let ((argb #f) + (argi 0) + (argf 0.0) + (setting (cadr s))) + (cond + ; ((or (eq? setting 'border-mode) + ; (eq? setting 'allow-look-around) + ; (eq? setting 'ocean-off) + ; (eq? setting 'music) + ; (eq? setting 'vibration) + ; (eq? setting 'auto-save) + ; (eq? setting 'allow-pause) + ; (eq? setting 'allow-progress) + ; (eq? setting 'play-hints) + ; (eq? setting 'movie) + ; (eq? setting 'talking) + ; (eq? setting 'spooling) + ; (eq? setting 'hint) + ; (eq? setting 'ambient) + ; ) + ; (set! argb (car args)) + ; ) + ; ((or (eq? setting 'bg-r) + ; (eq? setting 'bg-g) + ; (eq? setting 'bg-b) + ; (eq? setting 'bg-a) + ; (eq? setting 'bg-a-speed) + ; (eq? setting 'bg-a-force) + ; ) + ; (set! argf (car args)) + ; ) + ; ((or (eq? setting 'language) + ; ) + ; (set! argi (car args)) + ; ) + ; ((or (eq? setting 'sound-flava) + ; ) + ; (set! argi (car args)) + ; (set! argf (cadr args)) + ; ) + ; ((or (eq? setting 'process-mask) + ; (eq? setting 'common-page) + ; ) + ; (set! argb (car args)) + ; (set! argi (cadr args)) + ; ) + ; ((or (eq? setting 'sfx-volume) + ; (eq? setting 'music-volume) + ; (eq? setting 'ambient-volume) + ; (eq? setting 'dialog-volume) + ; (eq? setting 'sfx-volume-movie) + ; (eq? setting 'music-volume-movie) + ; (eq? setting 'ambient-volume-movie) + ; (eq? setting 'dialog-volume-hint) + ; ) + ; (set! argb (car args)) + ; (set! argf (cadr args)) + ; ) + (#t + (set! argb (car args)) + (set! argf (cadr args)) + (set! argi (caddr args)) + ) + ) + `(,func *setting-control* (with-pp pp) ,s ,argb ,argf ,argi) + ) + ) + +(defmacro add-setting! (s &rest args) + `(setting-control-func! add-setting ,s ,@args) + ) +(defmacro set-setting! (s &rest args) + `(setting-control-func! set-setting ,s ,@args) + ) +(defmacro remove-setting! (s) + `(remove-setting *setting-control* (with-pp pp) ,s) + ) + + + diff --git a/test/decompiler/reference/engine/ambient/ambient_REF.gc b/test/decompiler/reference/engine/ambient/ambient_REF.gc index 5eca687627..34773099f0 100644 --- a/test/decompiler/reference/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/engine/ambient/ambient_REF.gc @@ -231,7 +231,7 @@ ) (and *target* (!= (-> *target* next-state name) 'target-look-around) - (zero? (logand (-> *target* state-flags) #x8008)) + (zero? (logand (-> *target* state-flags) (state-flags being-attacked dying))) (= *master-mode* 'game) ) ) @@ -265,15 +265,7 @@ (let ((s3-1 (level-hint-task-process arg2 (the-as uint128 arg0) arg1))) (when (!= s3-1 -1) (kill-current-level-hint '() '() 'exit) - (let ((s2-0 (get-process *default-dead-pool* level-hint #x4000))) - (when s2-0 - (let ((t9-4 (method-of-type level-hint activate))) - (t9-4 (the-as level-hint s2-0) arg3 'level-hint (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 level-hint-init-by-other s3-1 arg1 arg2) - (-> s2-0 ppointer) - ) - ) + (process-spawn level-hint s3-1 arg1 arg2 :to arg3) ) ) 0 @@ -289,15 +281,7 @@ ) ) (the-as object (and (not *hint-semaphore*) - (let ((s2-0 (get-process *default-dead-pool* level-hint #x4000))) - (when s2-0 - (let ((t9-2 (method-of-type level-hint activate))) - (t9-2 (the-as level-hint s2-0) arg2 'level-hint (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 ambient-hint-init-by-other arg0 arg1 arg3) - (-> s2-0 ppointer) - ) - ) + (process-spawn level-hint :init ambient-hint-init-by-other arg0 arg1 arg3 :to arg2) ) ) ) @@ -328,7 +312,7 @@ (set! (-> self total-off-time) 0) (set! (-> self last-time) (-> *display* base-frame-counter)) (set! *hint-semaphore* (the-as (pointer level-hint) (process->ppointer self))) - (push-setting! *setting-control* self 'hint (process->ppointer self) 0.0 0) + (add-setting! 'hint (process->ppointer self) 0.0 0) (set! (-> self voicebox) (the-as handle #f)) (let ((s5-1 (res-lump-struct arg2 'play-mode structure)) (a0-6 (the-as string ((method-of-type res-lump get-property-struct) @@ -371,12 +355,12 @@ (set! (-> self last-time) (-> *display* base-frame-counter)) (set! (-> self trans) arg1) (set! *hint-semaphore* (the-as (pointer level-hint) (process->ppointer self))) - (push-setting! *setting-control* self 'hint (process->ppointer self) 0.0 0) + (add-setting! 'hint (process->ppointer self) 0.0 0) (set! (-> self mode) arg2) (if (or (= arg2 'camera) (= arg2 'ambient) (= arg2 'stinger)) - (push-setting! *setting-control* self 'ambient (process->ppointer self) 0.0 0) + (add-setting! 'ambient (process->ppointer self) 0.0 0) ) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (set! (-> self event-hook) (lambda :behavior level-hint ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) @@ -424,8 +408,7 @@ ;; failed to figure out what this is: (defstate level-hint-normal (level-hint) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'exit) @@ -438,15 +421,13 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (if (= (ppointer->process *hint-semaphore*) self) (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) (none) ) - :code - (behavior () + :code (behavior () (cond ((= (-> self text-id-to-display) (game-text-id zero)) (if *debug-segment* @@ -487,8 +468,7 @@ ;; failed to figure out what this is: (defstate level-hint-sidekick (level-hint) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'exit) @@ -506,22 +486,20 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) - (clear-pending-settings-from-process *setting-control* self 'dialog-volume) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'dialog-volume) (if (= (ppointer->process *hint-semaphore*) self) (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) (send-event (handle->process (-> self voicebox)) 'die) (none) ) - :code - (behavior ((arg0 string)) + :code (behavior ((arg0 string)) (when (and (-> *setting-control* current play-hints) (< 0.0 (-> *setting-control* current dialog-volume))) (case (-> self mode) (('voicebox) @@ -540,7 +518,7 @@ (s4-1 string->sound-name) ) (format (clear *temp-string*) "spool-~S" arg0) - (let ((s5-2 (s5-1 (s4-1 *temp-string*) (new-sound-id) 1024 0 0 1 #t))) + (let ((s5-2 (s5-1 (s4-1 *temp-string*) (new-sound-id) 1024 0 0 (sound-group sfx) #t))) (set! (-> self sound-id) s5-2) (let ((s4-3 (-> *display* base-frame-counter))) (while (and (!= (current-str-id) s5-2) (< (- (-> *display* base-frame-counter) s4-3) (seconds 5))) @@ -549,9 +527,9 @@ ) (cond ((= (current-str-id) s5-2) - (push-setting! *setting-control* self 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) - (push-setting! *setting-control* self 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) - (push-setting! *setting-control* self 'dialog-volume 'rel (-> *setting-control* current dialog-volume-hint) 0) + (add-setting! 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) + (add-setting! 'dialog-volume 'rel (-> *setting-control* current dialog-volume-hint) 0) (while (= (current-str-id) s5-2) (suspend) ) @@ -570,22 +548,19 @@ ;; failed to figure out what this is: (defstate level-hint-ambient-sound (level-hint) - :event - (-> level-hint-sidekick event) - :exit - (behavior () + :event (-> level-hint-sidekick event) + :exit (behavior () (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) (if (= (ppointer->process *hint-semaphore*) self) (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) (none) ) - :code - (behavior ((arg0 string)) + :code (behavior ((arg0 string)) (while (not *sound-player-enable*) (suspend) ) @@ -596,7 +571,7 @@ ) (format (clear *temp-string*) "spool-~S" arg0) (set! (-> self sound-id) - (s5-0 (s4-0 *temp-string*) (new-sound-id) 1024 1 0 1 (the-as symbol (-> self trans))) + (s5-0 (s4-0 *temp-string*) (new-sound-id) 1024 1 0 (sound-group sfx) (the-as symbol (-> self trans))) ) ) ) @@ -605,7 +580,7 @@ (s4-2 string->sound-name) ) (format (clear *temp-string*) "spool-~S" arg0) - (set! (-> self sound-id) (s5-1 (s4-2 *temp-string*) (new-sound-id) 1024 0 0 1 #t)) + (set! (-> self sound-id) (s5-1 (s4-2 *temp-string*) (new-sound-id) 1024 0 0 (sound-group sfx) #t)) ) ) ) @@ -617,8 +592,8 @@ (cond ((= (current-str-id) (-> self sound-id)) (when (or (= (-> self mode) 'stinger) (= (-> self mode) 'camera)) - (push-setting! *setting-control* self 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) - (push-setting! *setting-control* self 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) + (add-setting! 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) ) (while (= (current-str-id) (-> self sound-id)) (suspend) @@ -635,11 +610,9 @@ ;; failed to figure out what this is: (defstate level-hint-error (level-hint) - :event - (-> level-hint-normal event) - :code - (behavior ((arg0 string) (arg1 string)) - (clear-pending-settings-from-process *setting-control* self 'hint) + :event (-> level-hint-normal event) + :code (behavior ((arg0 string) (arg1 string)) + (remove-setting! 'hint) (let ((s4-0 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) s4-0) (seconds 1)) (when (and *debug-segment* (not (paused?)) (not (str-is-playing?)) (bottom-hud-hidden?)) @@ -670,8 +643,7 @@ ;; failed to figure out what this is: (defstate level-hint-exit (level-hint) - :code - (behavior () + :code (behavior () (if (= (ppointer->process *hint-semaphore*) self) (set! *hint-semaphore* (the-as (pointer level-hint) #f)) ) @@ -695,7 +667,7 @@ *temp-string* (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) *temp-string* (-> arg0 bsphere) (font-color orange-red) @@ -738,15 +710,7 @@ ) ((!= s5-0 -1) (kill-current-level-hint '() '() 'exit) - (let ((s4-0 (get-process *default-dead-pool* level-hint #x4000))) - (when s4-0 - (let ((t9-8 (method-of-type level-hint activate))) - (t9-8 (the-as level-hint s4-0) pp 'level-hint (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 level-hint-init-by-other s5-0 #f (-> arg0 ambient)) - (-> s4-0 ppointer) - ) - ) + (process-spawn level-hint s5-0 #f (-> arg0 ambient) :to pp) ) ) ) @@ -778,9 +742,9 @@ (set! sv-16 (symbol->string (res-lump-struct s5-0 'effect-name symbol :time f30-0))) (let ((s4-2 (new 'stack 'sound-spec))) (set! (-> s4-2 sound-name) (string->sound-name sv-16)) - (logior! (-> s4-2 mask) 1) + (logior! (-> s4-2 mask) (sound-mask volume)) (set! (-> s4-2 volume) 1024) - (logior! (-> s4-2 mask) 4) + (logior! (-> s4-2 mask) (sound-mask bend)) (set! (-> s4-2 bend) (the int (* 327.66998 (rand-vu-float-range -100.0 100.0)))) (set! sv-112 (new 'static 'res-tag)) (let ((a1-7 ((method-of-type res-lump get-property-data) @@ -833,7 +797,7 @@ (s4-0 (new 'stack 'sound-spec)) ) (set! (-> s4-0 sound-name) (string->sound-name s2-0)) - (logior! (-> s4-0 mask) 1) + (logior! (-> s4-0 mask) (sound-mask volume)) (set! (-> s4-0 volume) 1024) (when (the-as (pointer res-tag) s3-0) (let ((t9-2 effect-param->sound-spec) @@ -1183,7 +1147,7 @@ (when *display-ambient-sound-marks* (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string (res-lump-struct obj 'effect-name symbol :time 0.0)) gp-0 (font-color white) @@ -1211,7 +1175,7 @@ (when (and (nonzero? a1-7) *common-text*) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (lookup-text! *common-text* (the-as game-text-id a1-7) #f) gp-0 (font-color white) @@ -1277,7 +1241,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (res-lump-struct obj 'name string) gp-0 (font-color white) @@ -1285,7 +1249,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string s5-0) gp-0 (font-color white) diff --git a/test/decompiler/reference/engine/ambient/mood-tables_REF.gc b/test/decompiler/reference/engine/ambient/mood-tables_REF.gc index 3d8d27ea38..7b9e3f4ade 100644 --- a/test/decompiler/reference/engine/ambient/mood-tables_REF.gc +++ b/test/decompiler/reference/engine/ambient/mood-tables_REF.gc @@ -318,11 +318,9 @@ ) ;; definition for symbol *default-interp-table*, type sky-color-day -(define - *default-interp-table* +(define *default-interp-table* (new 'static 'sky-color-day - :hour - (new 'static 'inline-array sky-color-hour 24 + :hour (new 'static 'inline-array sky-color-hour 24 (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.2 :morph-end 0.4) (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.4 :morph-end 0.6) (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.6 :morph-end 0.8) @@ -352,11 +350,9 @@ ) ;; definition for symbol *village1-palette-interp-table*, type sky-color-day -(define - *village1-palette-interp-table* +(define *village1-palette-interp-table* (new 'static 'sky-color-day - :hour - (new 'static 'inline-array sky-color-hour 24 + :hour (new 'static 'inline-array sky-color-hour 24 (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.2 :morph-end 0.4) (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.4 :morph-end 0.6) (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.6 :morph-end 0.8) @@ -386,11 +382,9 @@ ) ;; definition for symbol *misty-palette-interp-table*, type sky-color-day -(define - *misty-palette-interp-table* +(define *misty-palette-interp-table* (new 'static 'sky-color-day - :hour - (new 'static 'inline-array sky-color-hour 24 + :hour (new 'static 'inline-array sky-color-hour 24 (new 'static 'sky-color-hour :snapshot1 1 :morph-start 0.04 :morph-end 0.08) (new 'static 'sky-color-hour :snapshot1 1 :morph-start 0.08 :morph-end 0.12) (new 'static 'sky-color-hour :snapshot1 1 :morph-start 0.12 :morph-end 0.16) @@ -420,11 +414,9 @@ ) ;; definition for symbol *firecanyon-palette-interp-table*, type sky-color-day -(define - *firecanyon-palette-interp-table* +(define *firecanyon-palette-interp-table* (new 'static 'sky-color-day - :hour - (new 'static 'inline-array sky-color-hour 24 + :hour (new 'static 'inline-array sky-color-hour 24 (new 'static 'sky-color-hour :snapshot1 3 :morph-end 0.08) (new 'static 'sky-color-hour :snapshot1 3 :morph-start 0.08 :morph-end 0.12) (new 'static 'sky-color-hour :snapshot1 3 :morph-start 0.12 :morph-end 0.16) @@ -454,11 +446,9 @@ ) ;; definition for symbol *rolling-palette-interp-table*, type sky-color-day -(define - *rolling-palette-interp-table* +(define *rolling-palette-interp-table* (new 'static 'sky-color-day - :hour - (new 'static 'inline-array sky-color-hour 24 + :hour (new 'static 'inline-array sky-color-hour 24 (new 'static 'sky-color-hour :snapshot1 2 :snapshot2 3 :morph-start 0.2 :morph-end 0.4) (new 'static 'sky-color-hour :snapshot1 2 :snapshot2 3 :morph-start 0.4 :morph-end 0.6) (new 'static 'sky-color-hour :snapshot1 2 :snapshot2 3 :morph-start 0.6 :morph-end 0.8) @@ -488,11 +478,9 @@ ) ;; definition for symbol *village2-sky-texture-table*, type sky-color-day -(define - *village2-sky-texture-table* +(define *village2-sky-texture-table* (new 'static 'sky-color-day - :hour - (new 'static 'inline-array sky-color-hour 24 + :hour (new 'static 'inline-array sky-color-hour 24 (new 'static 'sky-color-hour :snapshot1 1 :snapshot2 4 :morph-start 0.2 :morph-end 0.4) (new 'static 'sky-color-hour :snapshot1 1 :snapshot2 4 :morph-start 0.4 :morph-end 0.6) (new 'static 'sky-color-hour :snapshot1 1 :snapshot2 4 :morph-start 0.6 :morph-end 0.8) @@ -522,11 +510,9 @@ ) ;; definition for symbol *finalboss-interp-table*, type sky-color-day -(define - *finalboss-interp-table* +(define *finalboss-interp-table* (new 'static 'sky-color-day - :hour - (new 'static 'inline-array sky-color-hour 24 + :hour (new 'static 'inline-array sky-color-hour 24 (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.2 :morph-end 0.4) (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.4 :morph-end 0.6) (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.6 :morph-end 0.8) @@ -556,62 +542,46 @@ ) ;; definition for symbol *village1-mood-fog-table*, type mood-fog-table -(define - *village1-mood-fog-table* +(define *village1-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 6717440.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog :fog-color (new 'static 'vector :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 4984832.0 :z 255.0 :w 51.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 4984832.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 80.0 :z 64.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 80.0 :z 64.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) ) @@ -619,95 +589,63 @@ ) ;; definition for symbol *village1-mood-lights-table*, type mood-lights-table -(define - *village1-mood-lights-table* +(define *village1-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.066987306 :y 0.25000003 :z 0.9659258) - :lgt-color - (new 'static 'vector :x 1.558 :y 1.454 :z 0.228 :w 1.0) + :direction (new 'static 'vector :x -0.066987306 :y 0.25000003 :z 0.9659258) + :lgt-color (new 'static 'vector :x 1.558 :y 1.454 :z 0.228 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.4 :y 0.266 :z 0.6 :w 1.0) - :shadow - (new 'static 'vector :x -0.066987306 :y 0.25000003 :z 0.9659258) + :amb-color (new 'static 'vector :x 0.4 :y 0.266 :z 0.6 :w 1.0) + :shadow (new 'static 'vector :x -0.066987306 :y 0.25000003 :z 0.9659258) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) - :lgt-color - (new 'static 'vector :x 1.632 :y 1.586 :z 1.428 :w 1.0) + :direction (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) + :lgt-color (new 'static 'vector :x 1.632 :y 1.586 :z 1.428 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.387 :y 0.387 :z 0.475 :w 1.0) - :shadow - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) + :amb-color (new 'static 'vector :x 0.387 :y 0.387 :z 0.475 :w 1.0) + :shadow (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.25881904 :y 0.9659258) - :lgt-color - (new 'static 'vector :x 1.644 :y 1.598 :z 1.438 :w 1.0) + :direction (new 'static 'vector :x -0.25881904 :y 0.9659258) + :lgt-color (new 'static 'vector :x 1.644 :y 1.598 :z 1.438 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.362 :y 0.362 :z 0.425 :w 1.0) - :shadow - (new 'static 'vector :x -0.25881904 :y 0.9659258) + :amb-color (new 'static 'vector :x 0.362 :y 0.362 :z 0.425 :w 1.0) + :shadow (new 'static 'vector :x -0.25881904 :y 0.9659258) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z -0.70710677) - :lgt-color - (new 'static 'vector :x 1.632 :y 1.586 :z 1.428 :w 1.0) + :direction (new 'static 'vector :x -0.1830127 :y 0.6830127 :z -0.70710677) + :lgt-color (new 'static 'vector :x 1.632 :y 1.586 :z 1.428 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.387 :y 0.387 :z 0.475 :w 1.0) - :shadow - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z -0.70710677) + :amb-color (new 'static 'vector :x 0.387 :y 0.387 :z 0.475 :w 1.0) + :shadow (new 'static 'vector :x -0.1830127 :y 0.6830127 :z -0.70710677) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.066987306 :y 0.25000003 :z -0.9659258) - :lgt-color - (new 'static 'vector :x 1.646 :y 1.118 :w 1.0) + :direction (new 'static 'vector :x -0.066987306 :y 0.25000003 :z -0.9659258) + :lgt-color (new 'static 'vector :x 1.646 :y 1.118 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.32 :y 0.35 :z 0.6 :w 1.0) - :shadow - (new 'static 'vector :x -0.066987306 :y 0.25000003 :z -0.9659258) + :amb-color (new 'static 'vector :x 0.32 :y 0.35 :z 0.6 :w 1.0) + :shadow (new 'static 'vector :x -0.066987306 :y 0.25000003 :z -0.9659258) ) (new 'static 'mood-lights :direction (new 'static 'vector :y 1.0) - :lgt-color - (new 'static 'vector :x 0.25 :y 0.5 :z 1.0 :w 1.0) + :lgt-color (new 'static 'vector :x 0.25 :y 0.5 :z 1.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.31 :y 0.29 :z 0.35 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) + :amb-color (new 'static 'vector :x 0.31 :y 0.29 :z 0.35 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) - :lgt-color - (new 'static 'vector :x 0.192 :y 0.256 :z 0.961 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) + :lgt-color (new 'static 'vector :x 0.192 :y 0.256 :z 0.961 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.383 :y 0.439 :z 0.7 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) + :amb-color (new 'static 'vector :x 0.383 :y 0.439 :z 0.7 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.354 :y 0.866 :z 0.354) - :lgt-color - (new 'static 'vector :x 0.0495 :y 0.62075 :z 0.326 :w 1.0) + :direction (new 'static 'vector :x 0.354 :y 0.866 :z 0.354) + :lgt-color (new 'static 'vector :x 0.0495 :y 0.62075 :z 0.326 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.25 :y 0.439 :z 0.7 :w 1.0) - :shadow - (new 'static 'vector :x 0.5393 :y 0.7652 :z -0.3514) + :amb-color (new 'static 'vector :x 0.25 :y 0.439 :z 0.7 :w 1.0) + :shadow (new 'static 'vector :x 0.5393 :y 0.7652 :z -0.3514) ) ) ) @@ -738,118 +676,85 @@ (update-mood-shadow-direction (-> *village1-mood-lights-table* data 7)) ;; definition for symbol *village1-mood-sun-table*, type mood-sun-table -(define - *village1-mood-sun-table* +(define *village1-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 196.0 :z 64.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 196.0 :z 64.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 96.0 :y 96.0 :z 196.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 96.0 :y 96.0 :z 196.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 64.0 :y 150.0 :z 196.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 64.0 :y 150.0 :z 196.0 :w 255.0) ) ) ) ) ;; definition for symbol *training-mood-fog-table*, type mood-fog-table -(define - *training-mood-fog-table* +(define *training-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog :fog-color (new 'static 'vector :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 51.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 80.0 :z 64.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 80.0 :z 64.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 10240000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) ) @@ -857,63 +762,46 @@ ) ;; definition for symbol *snow-mood-fog-table*, type mood-fog-table -(define - *snow-mood-fog-table* +(define *snow-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 210.0 :y 183.0 :z 160.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 210.0 :y 183.0 :z 160.0 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 190.25 :y 198.0 :z 195.25 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 190.25 :y 198.0 :z 195.25 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 180.5 :y 203.0 :z 220.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 180.5 :y 203.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 192.75 :y 190.5 :z 197.75 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 192.75 :y 190.5 :z 197.75 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 205.0 :y 178.0 :z 175.5 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 205.0 :y 178.0 :z 175.5 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 48.0 :y 44.0 :z 64.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 48.0 :y 44.0 :z 64.0 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 8.0 :y 16.0 :z 32.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 8.0 :y 16.0 :z 32.0 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 16.0 :y 64.0 :z 60.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 16.0 :y 64.0 :z 60.0 :w 128.0) + :fog-dists (new 'static 'vector :x 819200.0 :y 2662400.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) ) @@ -921,51 +809,35 @@ ) ;; definition for symbol *snow-mood-lights-table*, type mood-lights-table -(define - *snow-mood-lights-table* +(define *snow-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.067 :y 0.25 :z 0.966) - :lgt-color - (new 'static 'vector :x 0.943 :y 0.88 :z 0.137 :w 1.0) + :direction (new 'static 'vector :x -0.067 :y 0.25 :z 0.966) + :lgt-color (new 'static 'vector :x 0.943 :y 0.88 :z 0.137 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.449 :y 0.35 :z 0.599 :w 1.0) - :shadow - (new 'static 'vector :x -0.066987306 :y 0.25000003 :z 0.9659258) + :amb-color (new 'static 'vector :x 0.449 :y 0.35 :z 0.599 :w 1.0) + :shadow (new 'static 'vector :x -0.066987306 :y 0.25000003 :z 0.9659258) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.259 :y 0.966) - :lgt-color - (new 'static 'vector :x 0.66 :y 0.436 :z 0.291 :w 1.0) + :direction (new 'static 'vector :x -0.259 :y 0.966) + :lgt-color (new 'static 'vector :x 0.66 :y 0.436 :z 0.291 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.358 :y 0.575 :z 0.716 :w 1.0) - :shadow - (new 'static 'vector :x -0.25881904 :y 0.9659258) + :amb-color (new 'static 'vector :x 0.358 :y 0.575 :z 0.716 :w 1.0) + :shadow (new 'static 'vector :x -0.25881904 :y 0.9659258) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.067 :y 0.25 :z -0.966) - :lgt-color - (new 'static 'vector :x 1.056 :y 0.747 :w 1.0) + :direction (new 'static 'vector :x -0.067 :y 0.25 :z -0.966) + :lgt-color (new 'static 'vector :x 1.056 :y 0.747 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.383 :y 0.366 :z 0.599 :w 1.0) - :shadow - (new 'static 'vector :x -0.066987306 :y 0.25000003 :z -0.9659258) + :amb-color (new 'static 'vector :x 0.383 :y 0.366 :z 0.599 :w 1.0) + :shadow (new 'static 'vector :x -0.066987306 :y 0.25000003 :z -0.9659258) ) (new 'static 'mood-lights :direction (new 'static 'vector :x 0.866 :y 0.5) - :lgt-color - (new 'static 'vector :x 0.067 :y 0.089 :z 0.333 :w 1.0) + :lgt-color (new 'static 'vector :x 0.067 :y 0.089 :z 0.333 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.304 :y 0.409 :z 0.76 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) + :amb-color (new 'static 'vector :x 0.304 :y 0.409 :z 0.76 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881907) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -1095,63 +967,50 @@ ) ;; definition for symbol *snow-mood-sun-table*, type mood-sun-table -(define - *snow-mood-sun-table* +(define *snow-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 192.0 :y 176.5 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 192.0 :y 176.5 :z 96.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 176.0 :z 192.0 :w 255.0) + :env-color (new 'static 'vector :x 128.0 :y 176.0 :z 192.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 180.0 :z 194.0 :w 255.0) + :env-color (new 'static 'vector :x 128.0 :y 180.0 :z 194.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 176.0 :z 192.0 :w 255.0) + :env-color (new 'static 'vector :x 128.0 :y 176.0 :z 192.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 192.0 :y 176.5 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 192.0 :y 176.5 :z 96.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :w 128.0) - :env-color - (new 'static 'vector :x 80.0 :y 80.0 :z 173.0 :w 255.0) + :env-color (new 'static 'vector :x 80.0 :y 80.0 :z 173.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :w 128.0) - :env-color - (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) + :env-color (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :w 128.0) - :env-color - (new 'static 'vector :x 64.0 :y 107.0 :z 173.0 :w 255.0) + :env-color (new 'static 'vector :x 64.0 :y 107.0 :z 173.0 :w 255.0) ) ) ) ) ;; definition for symbol *jungleb-mood-fog-table*, type mood-fog-table -(define - *jungleb-mood-fog-table* +(define *jungleb-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog :fog-color (new 'static 'vector :w 128.0) - :fog-dists - (new 'static 'vector :x 98304.0 :y 3072000.0 :z 255.0 :w 150.0) + :fog-dists (new 'static 'vector :x 98304.0 :y 3072000.0 :z 255.0 :w 150.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog) @@ -1166,16 +1025,13 @@ ) ;; definition for symbol *jungleb-mood-lights-table*, type mood-lights-table -(define - *jungleb-mood-lights-table* +(define *jungleb-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights :direction (new 'static 'vector :y 1.0) - :lgt-color - (new 'static 'vector :x 0.287 :y 0.283 :z 0.4 :w 1.0) + :lgt-color (new 'static 'vector :x 0.287 :y 0.283 :z 0.4 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.14125 :y 0.1875 :z 0.375 :w 1.0) + :amb-color (new 'static 'vector :x 0.14125 :y 0.1875 :z 0.375 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights) @@ -1190,14 +1046,11 @@ ) ;; definition for symbol *jungleb-mood-sun-table*, type mood-sun-table -(define - *jungleb-mood-sun-table* +(define *jungleb-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 48.0 :y 60.0 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 48.0 :y 60.0 :z 96.0 :w 255.0) ) (new 'static 'mood-sun) (new 'static 'mood-sun) @@ -1211,14 +1064,11 @@ ) ;; definition for symbol *maincave-mood-fog-table*, type mood-fog-table -(define - *maincave-mood-fog-table* +(define *maincave-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 96.0 :z 96.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 434176.0 :y 1048576.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :y 96.0 :z 96.0 :w 128.0) + :fog-dists (new 'static 'vector :x 434176.0 :y 1048576.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog) @@ -1233,16 +1083,13 @@ ) ;; definition for symbol *maincave-mood-lights-table*, type mood-lights-table -(define - *maincave-mood-lights-table* +(define *maincave-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights :direction (new 'static 'vector :y 1.0) - :lgt-color - (new 'static 'vector :x 0.25 :y 0.6 :z 0.75 :w 1.0) + :lgt-color (new 'static 'vector :x 0.25 :y 0.6 :z 0.75 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.15 :y 0.2 :z 0.25 :w 1.0) + :amb-color (new 'static 'vector :x 0.15 :y 0.2 :z 0.25 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights) @@ -1257,14 +1104,11 @@ ) ;; definition for symbol *maincave-mood-sun-table*, type mood-sun-table -(define - *maincave-mood-sun-table* +(define *maincave-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 255.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 128.0 :y 255.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun) (new 'static 'mood-sun) @@ -1278,13 +1122,11 @@ ) ;; definition for symbol *robocave-mood-fog-table*, type mood-fog-table -(define - *robocave-mood-fog-table* +(define *robocave-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog :fog-color (new 'static 'vector :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2048000.0 :z 255.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2048000.0 :z 255.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog) @@ -1299,13 +1141,11 @@ ) ;; definition for symbol *darkcave-mood-fog-table*, type mood-fog-table -(define - *darkcave-mood-fog-table* +(define *darkcave-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog :fog-color (new 'static 'vector :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1024000.0 :z 255.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1024000.0 :z 255.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog) @@ -1320,16 +1160,13 @@ ) ;; definition for symbol *darkcave-mood-lights-table*, type mood-lights-table -(define - *darkcave-mood-lights-table* +(define *darkcave-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 0.3 :y 0.4 :z 0.5 :w 1.0) + :lgt-color (new 'static 'vector :x 0.3 :y 0.4 :z 0.5 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.3 :y 0.4 :z 0.5 :w 1.0) + :amb-color (new 'static 'vector :x 0.3 :y 0.4 :z 0.5 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights) @@ -1344,14 +1181,11 @@ ) ;; definition for symbol *darkcave-mood-sun-table*, type mood-sun-table -(define - *darkcave-mood-sun-table* +(define *darkcave-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 127.5 :y 255.0 :z 127.5 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 127.5 :y 255.0 :z 127.5 :w 255.0) ) (new 'static 'mood-sun) (new 'static 'mood-sun) @@ -1365,63 +1199,46 @@ ) ;; definition for symbol *misty-mood-fog-table*, type mood-fog-table -(define - *misty-mood-fog-table* +(define *misty-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 132.0 :y 140.0 :z 227.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :x 132.0 :y 140.0 :z 227.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 132.0 :y 140.0 :z 243.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :x 132.0 :y 140.0 :z 243.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 132.0 :y 140.0 :z 241.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :x 132.0 :y 140.0 :z 241.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 64.0 :z 152.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :y 64.0 :z 152.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 32.0 :z 96.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :y 32.0 :z 96.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 17.0 :y 119.0 :z 143.0 :w 128.0) - :fog-dists - (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) + :fog-color (new 'static 'vector :x 17.0 :y 119.0 :z 143.0 :w 128.0) + :fog-dists (new 'static 'vector :y 737280.0 :z 255.0 :w 50.0) :erase-color (new 'static 'vector :w 128.0) ) ) @@ -1429,30 +1246,21 @@ ) ;; definition for symbol *misty-mood-lights-table*, type mood-lights-table -(define - *misty-mood-lights-table* +(define *misty-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.877 :y 0.877 :z 0.877 :w 1.0) + :direction (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.877 :y 0.877 :z 0.877 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.374 :y 0.374 :z 0.375 :w 1.0) - :shadow - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.374 :y 0.374 :z 0.375 :w 1.0) + :shadow (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.334 :y 0.348 :z 0.64 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.334 :y 0.348 :z 0.64 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.428 :y 0.44 :z 0.55 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.428 :y 0.44 :z 0.55 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -1471,119 +1279,85 @@ (update-mood-shadow-direction (-> *misty-mood-lights-table* data 1)) ;; definition for symbol *misty-mood-sun-table*, type mood-sun-table -(define - *misty-mood-sun-table* +(define *misty-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 132.0 :y 140.0 :z 227.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 132.0 :y 140.0 :z 227.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 132.0 :y 140.0 :z 243.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 132.0 :y 140.0 :z 243.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 132.0 :y 140.0 :z 241.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 132.0 :y 140.0 :z 241.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 186.0 :y 148.0 :z 164.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 32.0 :y 48.0 :z 160.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 32.0 :y 48.0 :z 160.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 32.0 :y 48.0 :z 150.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 32.0 :y 48.0 :z 150.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 32.0 :y 100.0 :z 160.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 32.0 :y 100.0 :z 160.0 :w 255.0) ) ) ) ) ;; definition for symbol *village2-mood-fog-table*, type mood-fog-table -(define - *village2-mood-fog-table* +(define *village2-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 75.0 :y 82.0 :z 96.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 75.0 :y 82.0 :z 96.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 100.0 :y 102.0 :z 116.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 102.0) + :fog-color (new 'static 'vector :x 100.0 :y 102.0 :z 116.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 102.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 112.0 :y 114.0 :z 132.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 112.0 :y 114.0 :z 132.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 100.0 :y 102.0 :z 116.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 100.0 :y 102.0 :z 116.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 75.0 :y 82.0 :z 96.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 75.0 :y 82.0 :z 96.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 27.5 :y 40.0 :z 52.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 27.5 :y 40.0 :z 52.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 10.0 :y 23.0 :z 28.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 10.0 :y 23.0 :z 28.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 5.0 :y 35.0 :z 35.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) + :fog-color (new 'static 'vector :x 5.0 :y 35.0 :z 35.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) ) @@ -1591,50 +1365,35 @@ ) ;; definition for symbol *village2-mood-lights-table*, type mood-lights-table -(define - *village2-mood-lights-table* +(define *village2-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.793 :y 0.793 :z 0.793 :w 1.0) + :direction (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.793 :y 0.793 :z 0.793 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) - :shadow - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) + :shadow (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.173 :y 0.259 :z 0.432 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.173 :y 0.259 :z 0.432 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) + :shadow (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) + :shadow (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -1657,111 +1416,80 @@ (update-mood-shadow-direction (-> *village2-mood-lights-table* data 3)) ;; definition for symbol *village2-mood-sun-table*, type mood-sun-table -(define - *village2-mood-sun-table* +(define *village2-mood-sun-table* (new 'static 'mood-sun-table - :data - (new 'static 'inline-array mood-sun 8 + :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 133.0 :z 194.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 128.0 :y 133.0 :z 194.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :y 32.0 :z 76.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :y 32.0 :z 76.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0)) (new 'static 'mood-sun :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0)) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 17.0 :y 76.0 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 17.0 :y 76.0 :z 96.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 132.0 :y 131.0 :z 160.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 132.0 :y 131.0 :z 160.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 126.0 :z 192.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 128.0 :y 126.0 :z 192.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 153.0 :y 141.0 :z 192.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 153.0 :y 141.0 :z 192.0 :w 255.0) ) ) ) ) ;; definition for symbol *swamp-mood-fog-table*, type mood-fog-table -(define - *swamp-mood-fog-table* +(define *swamp-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 22.0 :y 89.0 :z 101.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 22.0 :y 89.0 :z 101.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 32.0 :y 105.0 :z 116.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 32.0 :y 105.0 :z 116.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 36.0 :y 118.0 :z 130.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 36.0 :y 118.0 :z 130.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 32.0 :y 105.0 :z 116.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 32.0 :y 105.0 :z 116.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 22.0 :y 89.0 :z 101.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 22.0 :y 89.0 :z 101.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 20.0 :y 60.0 :z 70.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 20.0 :y 60.0 :z 70.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 12.0 :y 42.0 :z 60.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 12.0 :y 42.0 :z 60.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 17.0 :y 76.0 :z 86.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 17.0 :y 76.0 :z 86.0 :w 128.0) + :fog-dists (new 'static 'vector :x 20480.0 :y 783360.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) ) @@ -1769,50 +1497,35 @@ ) ;; definition for symbol *swamp-mood-lights-table*, type mood-lights-table -(define - *swamp-mood-lights-table* +(define *swamp-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.825 :y 0.825 :z 0.825 :w 1.0) + :direction (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.825 :y 0.825 :z 0.825 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) - :shadow - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) + :shadow (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.173 :y 0.259 :z 0.519 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.173 :y 0.259 :z 0.519 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.412 :y 0.463 :z 0.55 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.412 :y 0.463 :z 0.55 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.7094065 :y 0.57357645 :z -0.40957603) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x 0.7094065 :y 0.57357645 :z -0.40957603) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x 0.7094065 :y 0.57357645 :z -0.40957603) + :shadow (new 'static 'vector :x 0.7094065 :y 0.57357645 :z -0.40957603) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.7094065 :y 0.57357645 :z 0.40957603) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x -0.7094065 :y 0.57357645 :z 0.40957603) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x -0.7094065 :y 0.57357645 :z 0.40957603) + :shadow (new 'static 'vector :x -0.7094065 :y 0.57357645 :z 0.40957603) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -1835,72 +1548,51 @@ (update-mood-shadow-direction (-> *swamp-mood-lights-table* data 3)) ;; definition for symbol *swamp-mood-sun-table*, type mood-sun-table -(define - *swamp-mood-sun-table* +(define *swamp-mood-sun-table* (new 'static 'mood-sun-table - :data - (new 'static 'inline-array mood-sun 8 + :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 24.0 :y 133.0 :z 243.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 24.0 :y 133.0 :z 243.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :y 32.0 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :y 32.0 :z 96.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0)) (new 'static 'mood-sun :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0)) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 17.0 :y 119.0 :z 143.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 17.0 :y 119.0 :z 143.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 132.0 :y 131.0 :z 200.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 132.0 :y 131.0 :z 200.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 87.0 :y 126.0 :z 227.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 87.0 :y 126.0 :z 227.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 153.0 :y 141.0 :z 240.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 153.0 :y 141.0 :z 240.0 :w 255.0) ) ) ) ) ;; definition for symbol *sunken-mood-fog-table*, type mood-fog-table -(define - *sunken-mood-fog-table* +(define *sunken-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 16.512 :y 26.112 :z 54.912 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1351680.0 :z 255.0) - :erase-color - (new 'static 'vector :x 16.512 :y 26.112 :z 54.912 :w 128.0) + :fog-color (new 'static 'vector :x 16.512 :y 26.112 :z 54.912 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1351680.0 :z 255.0) + :erase-color (new 'static 'vector :x 16.512 :y 26.112 :z 54.912 :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 4.096 :y 15.744 :z 54.912 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1351680.0 :z 255.0) - :erase-color - (new 'static 'vector :x 4.096 :y 15.744 :z 54.912 :w 128.0) + :fog-color (new 'static 'vector :x 4.096 :y 15.744 :z 54.912 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1351680.0 :z 255.0) + :erase-color (new 'static 'vector :x 4.096 :y 15.744 :z 54.912 :w 128.0) ) (new 'static 'mood-fog) (new 'static 'mood-fog) @@ -1913,25 +1605,20 @@ ) ;; definition for symbol *sunken-mood-lights-table*, type mood-lights-table -(define - *sunken-mood-lights-table* +(define *sunken-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights :direction (new 'static 'vector :y 1.0) - :lgt-color - (new 'static 'vector :x 0.265 :y 0.387 :z 0.509 :w 1.0) + :lgt-color (new 'static 'vector :x 0.265 :y 0.387 :z 0.509 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) + :amb-color (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y 1.0) - :lgt-color - (new 'static 'vector :x 0.172 :y 0.185 :z 0.298 :w 1.0) + :lgt-color (new 'static 'vector :x 0.172 :y 0.185 :z 0.298 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) + :amb-color (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights) @@ -1951,20 +1638,15 @@ (update-mood-shadow-direction (-> *sunken-mood-lights-table* data 1)) ;; definition for symbol *sunken-mood-sun-table*, type mood-sun-table -(define - *sunken-mood-sun-table* +(define *sunken-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 127.5 :y 191.25 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 127.5 :y 191.25 :z 255.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 76.5 :y 102.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 76.5 :y 102.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun) (new 'static 'mood-sun) @@ -1977,63 +1659,46 @@ ) ;; definition for symbol *rolling-mood-fog-table*, type mood-fog-table -(define - *rolling-mood-fog-table* +(define *rolling-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 42.0 :y 50.0 :z 68.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 42.0 :y 50.0 :z 68.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 94.0 :y 106.0 :z 126.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 94.0 :y 106.0 :z 126.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 104.0 :y 116.0 :z 136.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 104.0 :y 116.0 :z 136.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 94.0 :y 106.0 :z 126.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 94.0 :y 106.0 :z 126.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 42.0 :y 50.0 :z 68.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 42.0 :y 50.0 :z 68.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 17.0 :y 26.0 :z 43.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 17.0 :y 26.0 :z 43.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) ) @@ -2041,52 +1706,35 @@ ) ;; definition for symbol *rolling-mood-lights-table*, type mood-lights-table -(define - *rolling-mood-lights-table* +(define *rolling-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) - :lgt-color - (new 'static 'vector :x 0.922 :y 0.905 :z 0.873 :w 1.0) + :direction (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) + :lgt-color (new 'static 'vector :x 0.922 :y 0.905 :z 0.873 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) - :shadow - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) + :amb-color (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) + :shadow (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) - :lgt-color - (new 'static 'vector :x 0.914 :y 0.898 :z 0.866 :w 1.0) + :direction (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) + :lgt-color (new 'static 'vector :x 0.914 :y 0.898 :z 0.866 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) - :shadow - (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) + :amb-color (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) + :shadow (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.09 :y 0.135 :z 0.225 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.09 :y 0.135 :z 0.225 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) - :lgt-color - (new 'static 'vector :x 0.0464 :y 0.1344 :z 0.1254 :w 1.0) + :direction (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) + :lgt-color (new 'static 'vector :x 0.0464 :y 0.1344 :z 0.1254 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) - :shadow - (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) + :amb-color (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) + :shadow (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -2109,111 +1757,80 @@ (update-mood-shadow-direction (-> *rolling-mood-lights-table* data 3)) ;; definition for symbol *rolling-mood-sun-table*, type mood-sun-table -(define - *rolling-mood-sun-table* +(define *rolling-mood-sun-table* (new 'static 'mood-sun-table - :data - (new 'static 'inline-array mood-sun 8 + :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 133.0 :z 194.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 128.0 :y 133.0 :z 194.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :y 32.0 :z 76.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :y 32.0 :z 76.0 :w 255.0) ) (new 'static 'mood-sun :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0)) (new 'static 'mood-sun :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0)) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 17.0 :y 76.0 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 17.0 :y 76.0 :z 96.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 132.0 :y 131.0 :z 160.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 132.0 :y 131.0 :z 160.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 128.0 :y 126.0 :z 192.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 128.0 :y 126.0 :z 192.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 153.0 :y 141.0 :z 192.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 153.0 :y 141.0 :z 192.0 :w 255.0) ) ) ) ) ;; definition for symbol *firecanyon-mood-fog-table*, type mood-fog-table -(define - *firecanyon-mood-fog-table* +(define *firecanyon-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 180.0 :y 113.0 :z 80.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 140.0 :y 64.5 :z 60.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 140.0 :y 64.5 :z 60.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 128.0 :y 44.0 :z 40.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 128.0 :y 44.0 :z 40.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 140.0 :y 50.0 :z 60.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) + :fog-color (new 'static 'vector :x 140.0 :y 50.0 :z 60.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2048000.0 :z 255.0 :w 119.0) :erase-color (new 'static 'vector :w 128.0) ) ) @@ -2221,57 +1838,39 @@ ) ;; definition for symbol *firecanyon-mood-lights-table*, type mood-lights-table -(define - *firecanyon-mood-lights-table* +(define *firecanyon-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.0278 :y 0.6578 :z 0.7526) - :lgt-color - (new 'static 'vector :x 1.0979 :y 1.0567 :z 0.4653 :w 1.0) + :direction (new 'static 'vector :x -0.0278 :y 0.6578 :z 0.7526) + :lgt-color (new 'static 'vector :x 1.0979 :y 1.0567 :z 0.4653 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.574 :y 0.32 :z 0.487 :w 1.0) - :shadow - (new 'static 'vector :x -0.0278 :y 0.6578 :z 0.7526) + :amb-color (new 'static 'vector :x 0.574 :y 0.32 :z 0.487 :w 1.0) + :shadow (new 'static 'vector :x -0.0278 :y 0.6578 :z 0.7526) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.25881904 :y 0.9659258) - :lgt-color - (new 'static 'vector :x 1.644 :y 1.598 :z 1.438 :w 128.0) + :direction (new 'static 'vector :x -0.25881904 :y 0.9659258) + :lgt-color (new 'static 'vector :x 1.644 :y 1.598 :z 1.438 :w 128.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.368 :y 0.368 :z 0.4 :w 1.0) - :shadow - (new 'static 'vector :x -0.25881904 :y 0.9659258) + :amb-color (new 'static 'vector :x 0.368 :y 0.368 :z 0.4 :w 1.0) + :shadow (new 'static 'vector :x -0.25881904 :y 0.9659258) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.0353 :y 0.8338 :z -0.5508 :w 1.0) - :lgt-color - (new 'static 'vector :x 1.1419 :y 0.8887 :z 0.3513 :w 1.0) + :direction (new 'static 'vector :x -0.0353 :y 0.8338 :z -0.5508 :w 1.0) + :lgt-color (new 'static 'vector :x 1.1419 :y 0.8887 :z 0.3513 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.347 :y 0.362 :z 0.487 :w 1.0) - :shadow - (new 'static 'vector :x -0.0353 :y 0.8338 :z -0.5508 :w 1.0) + :amb-color (new 'static 'vector :x 0.347 :y 0.362 :z 0.487 :w 1.0) + :shadow (new 'static 'vector :x -0.0353 :y 0.8338 :z -0.5508 :w 1.0) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365 :y 0.4829 :z 0.2588) - :lgt-color - (new 'static 'vector :x 0.1824 :y 0.2574 :z 0.6964 :w 1.0) + :direction (new 'static 'vector :x 0.8365 :y 0.4829 :z 0.2588) + :lgt-color (new 'static 'vector :x 0.1824 :y 0.2574 :z 0.6964 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.434 :y 0.423 :z 0.625 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365 :y 0.4829 :z 0.2588) + :amb-color (new 'static 'vector :x 0.434 :y 0.423 :z 0.625 :w 1.0) + :shadow (new 'static 'vector :x 0.8365 :y 0.4829 :z 0.2588) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) @@ -2295,119 +1894,85 @@ (update-mood-shadow-direction (-> *firecanyon-mood-lights-table* data 3)) ;; definition for symbol *firecanyon-mood-sun-table*, type mood-sun-table -(define - *firecanyon-mood-sun-table* +(define *firecanyon-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 200.0 :y 200.0 :z 128.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 200.0 :y 200.0 :z 128.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 200.0 :y 200.0 :z 200.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 200.0 :y 200.0 :z 200.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 200.0 :y 200.0 :z 200.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 200.0 :y 200.0 :z 200.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 196.0 :z 64.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 196.0 :z 64.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 96.0 :y 96.0 :z 150.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 96.0 :y 96.0 :z 150.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 96.0 :y 200.0 :z 150.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 96.0 :y 200.0 :z 150.0 :w 255.0) ) ) ) ) ;; definition for symbol *ogre-mood-fog-table*, type mood-fog-table -(define - *ogre-mood-fog-table* +(define *ogre-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 18.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 18.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) ) @@ -2415,72 +1980,49 @@ ) ;; definition for symbol *ogre-mood-lights-table*, type mood-lights-table -(define - *ogre-mood-lights-table* +(define *ogre-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) - :lgt-color - (new 'static 'vector :x 1.154 :y 1.132 :z 1.093 :w 1.0) + :direction (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) + :lgt-color (new 'static 'vector :x 1.154 :y 1.132 :z 1.093 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) - :shadow - (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) + :amb-color (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) + :shadow (new 'static 'vector :x -0.1830127 :y 0.6830127 :z 0.70710677) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) - :lgt-color - (new 'static 'vector :x 1.144 :y 1.124 :z 0.939 :w 1.0) + :direction (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) + :lgt-color (new 'static 'vector :x 1.144 :y 1.124 :z 0.939 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) - :shadow - (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) + :amb-color (new 'static 'vector :x 0.346 :y 0.359 :z 0.384 :w 1.0) + :shadow (new 'static 'vector :x -0.24321035 :y 0.90767336 :z -0.34202015) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.113 :y 0.169 :z 0.282 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.113 :y 0.169 :z 0.282 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) - :lgt-color - (new 'static 'vector :x 0.058 :y 0.168 :z 0.157 :w 1.0) + :direction (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) + :lgt-color (new 'static 'vector :x 0.058 :y 0.168 :z 0.157 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) - :shadow - (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) + :amb-color (new 'static 'vector :x 0.398 :y 0.398 :z 0.574 :w 1.0) + :shadow (new 'static 'vector :x 0.6262 :y 0.7098 :z 0.3222) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) + :shadow (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) + :shadow (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -2507,72 +2049,49 @@ (update-mood-shadow-direction (-> *ogre-mood-lights-table* data 5)) ;; definition for symbol *ogre2-mood-lights-table*, type mood-lights-table -(define - *ogre2-mood-lights-table* +(define *ogre2-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.793 :y 0.793 :z 0.793 :w 1.0) + :direction (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.793 :y 0.793 :z 0.793 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) - :shadow - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) + :shadow (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.793 :y 0.793 :z 0.793 :w 1.0) + :direction (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.793 :y 0.793 :z 0.793 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) - :shadow - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.374 :y 0.374 :z 0.374 :w 1.0) + :shadow (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.173 :y 0.259 :z 0.432 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.173 :y 0.259 :z 0.432 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) - :lgt-color - (new 'static 'vector :x 0.173 :y 0.259 :z 0.432 :w 1.0) + :direction (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :lgt-color (new 'static 'vector :x 0.173 :y 0.259 :z 0.432 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) - :shadow - (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.463 :y 0.412 :z 0.55 :w 1.0) + :shadow (new 'static 'vector :x 0.8365163 :y 0.4829629 :z 0.25881904) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) + :shadow (new 'static 'vector :x 0.40957603 :y 0.57357645 :z 0.7094065) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) - :lgt-color - (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) + :direction (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) + :lgt-color (new 'static 'vector :x 2.0 :y 2.0 :z 2.0 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :amb-color (new 'static 'vector :w 1.0) - :shadow - (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) + :shadow (new 'static 'vector :x -0.40957603 :y 0.57357645 :z -0.7094065) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -2599,14 +2118,11 @@ (update-mood-shadow-direction (-> *ogre2-mood-lights-table* data 5)) ;; definition for symbol *ogre3-mood-fog-table*, type mood-fog-table -(define - *ogre3-mood-fog-table* +(define *ogre3-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 255.0 :y 96.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 393216.0 :y 7458816.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 255.0 :y 96.0 :w 128.0) + :fog-dists (new 'static 'vector :x 393216.0 :y 7458816.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog) @@ -2621,18 +2137,14 @@ ) ;; definition for symbol *ogre3-mood-lights-table*, type mood-lights-table -(define - *ogre3-mood-lights-table* +(define *ogre3-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights :direction (new 'static 'vector :y 0.666 :z 0.745) - :lgt-color - (new 'static 'vector :x 0.6 :y 0.51 :z 0.51 :w 1.0) + :lgt-color (new 'static 'vector :x 0.6 :y 0.51 :z 0.51 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.313 :y 0.375 :z 0.375 :w 1.0) - :shadow - (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) + :amb-color (new 'static 'vector :x 0.313 :y 0.375 :z 0.375 :w 1.0) + :shadow (new 'static 'vector :x -0.25 :y 0.9330127 :z 0.25881904) ) (new 'static 'mood-lights) (new 'static 'mood-lights) @@ -2649,63 +2161,46 @@ (update-mood-shadow-direction (the-as mood-lights (-> *ogre3-mood-lights-table* data))) ;; definition for symbol *village3-mood-fog-table*, type mood-fog-table -(define - *village3-mood-fog-table* +(define *village3-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 74.0 :y 86.0 :z 106.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 64.0 :y 68.0 :z 68.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 12.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 18.0 :z 18.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 18.0 :z 18.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 2236416.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) ) @@ -2713,45 +2208,34 @@ ) ;; definition for symbol *village3-mood-lights-table*, type mood-lights-table -(define - *village3-mood-lights-table* +(define *village3-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.067 :y 0.25 :z 0.966) + :direction (new 'static 'vector :x -0.067 :y 0.25 :z 0.966) :lgt-color (new 'static 'vector :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.449 :y 0.35 :z 0.599 :w 1.0) + :amb-color (new 'static 'vector :x 0.449 :y 0.35 :z 0.599 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.259 :y 0.966) - :lgt-color - (new 'static 'vector :x 0.66 :y 0.436 :z 0.291 :w 1.0) + :direction (new 'static 'vector :x -0.259 :y 0.966) + :lgt-color (new 'static 'vector :x 0.66 :y 0.436 :z 0.291 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.358 :y 0.575 :z 0.716 :w 1.0) + :amb-color (new 'static 'vector :x 0.358 :y 0.575 :z 0.716 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights - :direction - (new 'static 'vector :x -0.067 :y 0.25 :z -0.966) - :lgt-color - (new 'static 'vector :x 1.056 :y 0.747 :w 1.0) + :direction (new 'static 'vector :x -0.067 :y 0.25 :z -0.966) + :lgt-color (new 'static 'vector :x 1.056 :y 0.747 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.383 :y 0.366 :z 0.599 :w 1.0) + :amb-color (new 'static 'vector :x 0.383 :y 0.366 :z 0.599 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :x 0.866 :y 0.5) - :lgt-color - (new 'static 'vector :x 0.067 :y 0.089 :z 0.333 :w 1.0) + :lgt-color (new 'static 'vector :x 0.067 :y 0.089 :z 0.333 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.304 :y 0.409 :z 0.76 :w 1.0) + :amb-color (new 'static 'vector :x 0.304 :y 0.409 :z 0.76 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights) @@ -2763,14 +2247,11 @@ ) ;; definition for symbol *lavatube-mood-fog-table*, type mood-fog-table -(define - *lavatube-mood-fog-table* +(define *lavatube-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 255.0 :y 96.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 1851392.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 255.0 :y 96.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1851392.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog) @@ -2785,64 +2266,54 @@ ) ;; definition for symbol *lavatube-mood-lights-table*, type mood-lights-table -(define - *lavatube-mood-lights-table* +(define *lavatube-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights :direction (new 'static 'vector :y 1.0) - :lgt-color - (new 'static 'vector :x 0.19 :y 0.128 :z 0.128 :w 1.0) + :lgt-color (new 'static 'vector :x 0.19 :y 0.128 :z 0.128 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.31 :y 0.372 :z 0.372 :w 1.0) + :amb-color (new 'static 'vector :x 0.31 :y 0.372 :z 0.372 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights :direction (new 'static 'vector :y -1.0) - :lgt-color - (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) + :lgt-color (new 'static 'vector :x 1.0 :y 0.364 :w 1.0) :prt-color (new 'static 'vector :w 1.0) :shadow (new 'static 'vector :y -1.0) ) @@ -2854,14 +2325,11 @@ (update-mood-shadow-direction (the-as mood-lights (-> *lavatube-mood-lights-table* data))) ;; definition for symbol *lavatube-mood-sun-table*, type mood-sun-table -(define - *lavatube-mood-sun-table* +(define *lavatube-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 175.0 :z 128.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 175.0 :z 128.0 :w 255.0) ) (new 'static 'mood-sun) (new 'static 'mood-sun) @@ -2875,118 +2343,85 @@ ) ;; definition for symbol *finalboss-mood-sun-table*, type mood-sun-table -(define - *finalboss-mood-sun-table* +(define *finalboss-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 109.0 :y 64.0 :z 160.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 109.0 :y 64.0 :z 160.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) - :env-color - (new 'static 'vector :x 255.0 :y 196.0 :z 64.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 128.0 :w 128.0) + :env-color (new 'static 'vector :x 255.0 :y 196.0 :z 64.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 96.0 :y 96.0 :z 196.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 96.0 :y 96.0 :z 196.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 64.0 :y 64.0 :z 150.0 :w 255.0) ) (new 'static 'mood-sun - :sun-color - (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) - :env-color - (new 'static 'vector :x 64.0 :y 150.0 :z 196.0 :w 255.0) + :sun-color (new 'static 'vector :x 255.0 :y 225.0 :z 96.0 :w 128.0) + :env-color (new 'static 'vector :x 64.0 :y 150.0 :z 196.0 :w 255.0) ) ) ) ) ;; definition for symbol *finalboss-mood-fog-table*, type mood-fog-table -(define - *finalboss-mood-fog-table* +(define *finalboss-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 45.0 :z 96.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 909312.0 :y 1912832.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 45.0 :z 96.0 :w 128.0) + :fog-dists (new 'static 'vector :x 909312.0 :y 1912832.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog :fog-color (new 'static 'vector :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 51.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 51.0) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog - :fog-color - (new 'static 'vector :y 80.0 :z 64.0 :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) + :fog-color (new 'static 'vector :y 80.0 :z 64.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 22528000.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) ) @@ -3090,13 +2525,11 @@ ) ;; definition for symbol *citadel-mood-fog-table*, type mood-fog-table -(define - *citadel-mood-fog-table* +(define *citadel-mood-fog-table* (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 (new 'static 'mood-fog :fog-color (new 'static 'vector :w 128.0) - :fog-dists - (new 'static 'vector :x 262144.0 :y 2252800.0 :z 255.0 :w 25.5) + :fog-dists (new 'static 'vector :x 262144.0 :y 2252800.0 :z 255.0 :w 25.5) :erase-color (new 'static 'vector :w 128.0) ) (new 'static 'mood-fog) @@ -3111,16 +2544,13 @@ ) ;; definition for symbol *citadel-mood-lights-table*, type mood-lights-table -(define - *citadel-mood-lights-table* +(define *citadel-mood-lights-table* (new 'static 'mood-lights-table :data (new 'static 'inline-array mood-lights 8 (new 'static 'mood-lights :direction (new 'static 'vector :y 1.0) - :lgt-color - (new 'static 'vector :x 0.75 :y 0.725 :z 0.5 :w 1.0) + :lgt-color (new 'static 'vector :x 0.75 :y 0.725 :z 0.5 :w 1.0) :prt-color (new 'static 'vector :w 1.0) - :amb-color - (new 'static 'vector :x 0.3 :y 0.3 :z 0.3 :w 1.0) + :amb-color (new 'static 'vector :x 0.3 :y 0.3 :z 0.3 :w 1.0) :shadow (new 'static 'vector :y -1.0) ) (new 'static 'mood-lights) @@ -3135,13 +2565,11 @@ ) ;; definition for symbol *citadel-mood-sun-table*, type mood-sun-table -(define - *citadel-mood-sun-table* +(define *citadel-mood-sun-table* (new 'static 'mood-sun-table :data (new 'static 'inline-array mood-sun 8 (new 'static 'mood-sun :sun-color (new 'static 'vector :w 128.0) - :env-color - (new 'static 'vector :x 96.0 :y 96.0 :z 96.0 :w 255.0) + :env-color (new 'static 'vector :x 96.0 :y 96.0 :z 96.0 :w 255.0) ) (new 'static 'mood-sun) (new 'static 'mood-sun) diff --git a/test/decompiler/reference/engine/ambient/mood_REF.gc b/test/decompiler/reference/engine/ambient/mood_REF.gc index bc0d032d9d..9dd745ef8a 100644 --- a/test/decompiler/reference/engine/ambient/mood_REF.gc +++ b/test/decompiler/reference/engine/ambient/mood_REF.gc @@ -509,177 +509,69 @@ ) ;; definition for symbol *flash0*, type (array float) -(define *flash0* (the-as (array float) (new - 'static - 'boxed-array - :type float :length 13 :allocated-length 13 - 1.0 - 0.0 - 0.5 - 1.0 - 0.5 - 0.0 - 0.5 - 0.35 - 0.4 - 0.35 - 0.25 - 0.1 - 0.04 - ) - ) - ) +(define *flash0* + (new 'static 'boxed-array :type float 1.0 0.0 0.5 1.0 0.5 0.0 0.5 0.35 0.4 0.35 0.25 0.1 0.04) + ) ;; definition for symbol *flash1*, type (array float) -(define - *flash1* - (the-as (array float) - (new 'static 'boxed-array :type float :length 9 :allocated-length 9 1.0 0.8 0.0 1.0 0.5 1.0 0.4 0.2 0.1) - ) - ) +(define *flash1* (new 'static 'boxed-array :type float 1.0 0.8 0.0 1.0 0.5 1.0 0.4 0.2 0.1)) ;; definition for symbol *flash2*, type (array float) -(define - *flash2* - (the-as (array float) - (new 'static 'boxed-array :type float :length 10 :allocated-length 10 1.0 0.9 0.8 0.7 0.0 0.0 1.0 0.0 1.0 0.5) - ) - ) +(define *flash2* (new 'static 'boxed-array :type float 1.0 0.9 0.8 0.7 0.0 0.0 1.0 0.0 1.0 0.5)) ;; definition for symbol *flash3*, type (array float) -(define *flash3* (the-as (array float) (new - 'static - 'boxed-array - :type float :length 13 :allocated-length 13 - 0.5 - 0.0 - 1.0 - 0.9 - 1.0 - 0.8 - 0.3 - 0.0 - 0.0 - 0.5 - 0.1 - 0.5 - 0.35 - ) - ) - ) +(define *flash3* (new 'static 'boxed-array :type float 0.5 0.0 1.0 0.9 1.0 0.8 0.3 0.0 0.0 0.5 0.1 0.5 0.35)) ;; definition for symbol *flash4*, type (array float) -(define *flash4* (the-as (array float) (new - 'static - 'boxed-array - :type float :length 18 :allocated-length 18 - 1.0 - 0.0 - 1.0 - 0.0 - 1.0 - 0.9 - 0.8 - 0.7 - 0.6 - 0.5 - 0.4 - 0.3 - 0.2 - 0.5 - 0.4 - 0.3 - 0.2 - 0.1 - ) - ) - ) +(define *flash4* + (new 'static 'boxed-array :type float 1.0 0.0 1.0 0.0 1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.5 0.4 0.3 0.2 0.1) + ) ;; definition for symbol *flash5*, type (array float) -(define *flash5* (the-as (array float) (new - 'static - 'boxed-array - :type float :length 31 :allocated-length 31 - 1.0 - 0.0 - 1.0 - 0.0 - 1.0 - 0.95 - 0.9 - 0.85 - 0.8 - 0.75 - 0.7 - 0.65 - 0.6 - 0.55 - 0.5 - 0.45 - 0.4 - 0.35 - 0.3 - 0.25 - 0.2 - 0.5 - 0.45 - 0.4 - 0.35 - 0.3 - 0.25 - 0.2 - 0.15 - 0.1 - 0.05 - ) - ) +(define *flash5* (new 'static 'boxed-array :type float + 1.0 + 0.0 + 1.0 + 0.0 + 1.0 + 0.95 + 0.9 + 0.85 + 0.8 + 0.75 + 0.7 + 0.65 + 0.6 + 0.55 + 0.5 + 0.45 + 0.4 + 0.35 + 0.3 + 0.25 + 0.2 + 0.5 + 0.45 + 0.4 + 0.35 + 0.3 + 0.25 + 0.2 + 0.15 + 0.1 + 0.05 + ) ) ;; definition for symbol *flash6*, type (array float) -(define *flash6* (the-as (array float) (new - 'static - 'boxed-array - :type float :length 14 :allocated-length 14 - 1.0 - 0.0 - 1.0 - 0.0 - 0.5 - 0.0 - 0.5 - 0.35 - 0.0 - 0.0 - 1.0 - 0.0 - 0.2 - 0.1 - ) - ) - ) +(define *flash6* + (new 'static 'boxed-array :type float 1.0 0.0 1.0 0.0 0.5 0.0 0.5 0.35 0.0 0.0 1.0 0.0 0.2 0.1) + ) ;; definition for symbol *flash7*, type (array float) -(define *flash7* (the-as (array float) (new - 'static - 'boxed-array - :type float :length 14 :allocated-length 14 - 1.0 - 0.8 - 0.3 - 0.0 - 0.6 - 0.5 - 0.4 - 0.3 - 0.2 - 0.5 - 0.4 - 0.3 - 0.2 - 0.1 - ) - ) - ) +(define *flash7* + (new 'static 'boxed-array :type float 1.0 0.8 0.3 0.0 0.6 0.5 0.4 0.3 0.2 0.5 0.4 0.3 0.2 0.1) + ) ;; definition for symbol *lightning-index*, type int (define *lightning-index* 0) @@ -827,23 +719,17 @@ ) (when (>= (-> *math-camera* trans y) -81920.0) (if arg6 - (sound-play-by-name - (static-sound-name "thunder") - *thunder-id* - (the int (* 10.24 (rand-vu-float-range 25.0 75.0))) - (the int (* 1524.0 (rand-vu-float-range -1.0 1.0))) - 0 - 1 - #t + (sound-play + "thunder" + :id *thunder-id* + :vol (rand-vu-float-range 25.0 75.0) + :pitch (rand-vu-float-range -1.0 1.0) ) - (sound-play-by-name - (static-sound-name "thunder") - *thunder-id* - (the int (* 10.24 (rand-vu-float-range 200.0 400.0))) - (the int (* 1524.0 (rand-vu-float-range -1.0 1.0))) - 0 - 1 - #t + (sound-play + "thunder" + :id *thunder-id* + :vol (rand-vu-float-range 200.0 400.0) + :pitch (rand-vu-float-range -1.0 1.0) ) ) ) @@ -867,7 +753,7 @@ ) (sound-trans-convert (-> gp-3 parms trans) a1-23) ) - (set! (-> gp-3 parms mask) (the-as uint 32)) + (set! (-> gp-3 parms mask) (sound-mask trans)) (-> gp-3 id) ) (let ((gp-4 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) @@ -884,7 +770,7 @@ ) (sound-trans-convert (-> gp-4 parms trans) a1-25) ) - (set! (-> gp-4 parms mask) (the-as uint 32)) + (set! (-> gp-4 parms mask) (sound-mask trans)) (-> gp-4 id) ) (let ((gp-5 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) @@ -901,7 +787,7 @@ ) (sound-trans-convert (-> gp-5 parms trans) a1-27) ) - (set! (-> gp-5 parms mask) (the-as uint 32)) + (set! (-> gp-5 parms mask) (sound-mask trans)) (-> gp-5 id) ) ) @@ -1109,11 +995,11 @@ ;; definition for function update-mood-misty ;; INFO: Return type mismatch int vs none. -(defun update-mood-misty ((arg0 mood-context) (arg1 float) (arg2 float)) +(defun update-mood-misty ((arg0 mood-context) (arg1 float) (arg2 int)) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) (clear-mood-times arg0) - (update-mood-palette arg0 arg1 (the-as int arg2)) + (update-mood-palette arg0 arg1 arg2) (when *time-of-day-effects* (update-mood-flames arg0 2 4 0 0.333 0.001953125 1.0) (let* ((s4-1 (get-task-control (game-task misty-warehouse))) @@ -1874,19 +1760,16 @@ ) ;; definition for symbol *rolling-spheres-light2*, type light-ellipse -(define - *rolling-spheres-light2* +(define *rolling-spheres-light2* (new 'static 'light-ellipse - :matrix - (new 'static 'matrix :vector (new 'static 'inline-array vector 4 + :matrix (new 'static 'matrix :vector (new 'static 'inline-array vector 4 (new 'static 'vector :x -581632.0 :y 114688.0 :z -6479872.0 :w 24576.0) (new 'static 'vector :x -737280.0 :y 110592.0 :z -7159808.0 :w 24576.0) (new 'static 'vector :x -733184.0 :y 110592.0 :z -7266304.0 :w 24576.0) (new 'static 'vector :x -1363968.0 :y 110592.0 :z -6578176.0 :w 24576.0) ) ) - :color - (new 'static 'rgbaf :x -1404928.0 :y 110592.0 :z -6541312.0 :w 24576.0) + :color (new 'static 'rgbaf :x -1404928.0 :y 110592.0 :z -6541312.0 :w 24576.0) ) ) @@ -2814,8 +2697,8 @@ (cond ((or (logtest? (get-reminder (get-task-control (game-task finalboss-movies)) 0) 1) (not *time-of-day-effects*)) (when (and *target* (= (-> *target* next-state name) 'target-continue)) - (set! (-> s4-0 start-time) (+ (-> *display* base-frame-counter) (seconds -33.333332))) - (set! (-> s4-0 secret-time) (+ (-> *display* base-frame-counter) (seconds -33.333332))) + (set! (-> s4-0 start-time) (+ (-> *display* base-frame-counter) (seconds -33.335))) + (set! (-> s4-0 secret-time) (+ (-> *display* base-frame-counter) (seconds -33.335))) ) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) diff --git a/test/decompiler/reference/engine/ambient/weather-part_REF.gc b/test/decompiler/reference/engine/ambient/weather-part_REF.gc index af1feb1f3b..b81ddfc2a5 100644 --- a/test/decompiler/reference/engine/ambient/weather-part_REF.gc +++ b/test/decompiler/reference/engine/ambient/weather-part_REF.gc @@ -6,8 +6,7 @@ :id 188 :flags (screen-space) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 18 :binding 19) + :parts ((sp-item 18 :binding 19) (sp-item 19 :flags (start-dead launch-asap) :binding 20) (sp-item 19 :flags (start-dead launch-asap) :binding 20) (sp-item 19 :flags (start-dead launch-asap) :binding 20) @@ -81,8 +80,7 @@ ;; failed to figure out what this is: (defpart 21 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -4.5) (meters 9) 1.0) (sp-rnd-flt spt-y (meters -3) (meters 6) 1.0) @@ -103,8 +101,7 @@ ;; failed to figure out what this is: (defpart 22 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.5)) (sp-copy-from-other spt-scale-y -4) @@ -125,8 +122,7 @@ ;; failed to figure out what this is: (defpart 24 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.004166667)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.004166667)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.06666667) ) @@ -134,8 +130,7 @@ ;; failed to figure out what this is: (defpart 23 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-int spt-rot-x 12) (sp-flt spt-r 4096.0) (sp-flt spt-g 3276.8) @@ -153,14 +148,12 @@ ;; failed to figure out what this is: (defpart 25 - :init-specs - ((sp-flt spt-fade-g -5.1200004)) + :init-specs ((sp-flt spt-fade-g -5.1200004)) ) ;; failed to figure out what this is: (defpart 18 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -4.5) (meters 9) 1.0) (sp-rnd-flt spt-y (meters -3) (meters 6) 1.0) @@ -181,8 +174,7 @@ ;; failed to figure out what this is: (defpart 19 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2.6)) (sp-copy-from-other spt-scale-y -4) @@ -203,8 +195,7 @@ ;; failed to figure out what this is: (defpart 26 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.008333334)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.008333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.06666667) ) @@ -212,8 +203,7 @@ ;; failed to figure out what this is: (defpart 20 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-int spt-rot-x 24) (sp-flt spt-r 12288.0) (sp-flt spt-g 6553.6) @@ -231,8 +221,7 @@ ;; failed to figure out what this is: (defpart 27 - :init-specs - ((sp-flt spt-fade-g -10.240001)) + :init-specs ((sp-flt spt-fade-g -10.240001)) ) ;; failed to figure out what this is: @@ -240,14 +229,12 @@ :id 34 :flags (always-draw) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 28) (sp-item 29) (sp-item 30)) + :parts ((sp-item 28) (sp-item 29) (sp-item 30)) ) ;; failed to figure out what this is: (defpart 28 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 40) (meters 40) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -269,20 +256,17 @@ ;; failed to figure out what this is: (defpart 31 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 29999700) (sp-launcher-by-id spt-next-launcher 32)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 29999700) (sp-launcher-by-id spt-next-launcher 32)) ) ;; failed to figure out what this is: (defpart 32 - :init-specs - ((sp-flt spt-fade-a -0.42666668)) + :init-specs ((sp-flt spt-fade-a -0.42666668)) ) ;; failed to figure out what this is: (defpart 29 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 40) (meters 40) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -304,8 +288,7 @@ ;; failed to figure out what this is: (defpart 30 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 40) (meters 40) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -327,8 +310,7 @@ ;; failed to figure out what this is: (defpart 33 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters 10) (meters 10) 1.0) (sp-rnd-flt spt-y (meters 2) (meters 14) 1.0) @@ -353,8 +335,7 @@ ;; failed to figure out what this is: (defpart 34 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.0) (sp-rnd-flt spt-x (meters 0) (meters 20) 1.0) (sp-flt spt-y (meters 16)) @@ -379,14 +360,12 @@ ;; failed to figure out what this is: (defpart 35 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 1200) (sp-launcher-by-id spt-next-launcher 36)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 1200) (sp-launcher-by-id spt-next-launcher 36)) ) ;; failed to figure out what this is: (defpart 36 - :init-specs - ((sp-flt spt-fade-a -0.85333335)) + :init-specs ((sp-flt spt-fade-a -0.85333335)) ) ;; definition for function update-snow @@ -423,8 +402,7 @@ ;; failed to figure out what this is: (defpart 37 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters 0) (meters 20) 1.0) (sp-flt spt-y (meters 16)) @@ -445,8 +423,7 @@ ;; failed to figure out what this is: (defpart 38 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 4.5) (sp-rnd-flt spt-x (meters 0) (meters 20) 1.0) (sp-flt spt-y (meters 16)) @@ -465,8 +442,7 @@ ;; failed to figure out what this is: (defpart 39 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-int spt-num 0 1 2.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -486,8 +462,7 @@ ;; failed to figure out what this is: (defpart 40 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.02)) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -638,14 +613,12 @@ :id 35 :flags (always-draw) :bounds (static-bspherem 0 0 0 70) - :parts - ((sp-item 1950) (sp-item 1951) (sp-item 1952)) + :parts ((sp-item 1950) (sp-item 1951) (sp-item 1952)) ) ;; failed to figure out what this is: (defpart 1950 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1200)) (sp-copy-from-other spt-scale-y -4) @@ -662,8 +635,7 @@ ;; failed to figure out what this is: (defpart 1951 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2800)) (sp-flt spt-rot-z (degrees 0.0)) @@ -682,8 +654,7 @@ ;; failed to figure out what this is: (defpart 1952 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2200)) (sp-flt spt-rot-z (degrees 0.0)) @@ -705,14 +676,12 @@ :id 36 :flags (always-draw) :bounds (static-bspherem 0 0 0 70) - :parts - ((sp-item 1974) (sp-item 1975) (sp-item 1976)) + :parts ((sp-item 1974) (sp-item 1975) (sp-item 1976)) ) ;; failed to figure out what this is: (defpart 1974 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 600)) (sp-copy-from-other spt-scale-y -4) @@ -729,8 +698,7 @@ ;; failed to figure out what this is: (defpart 1975 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1400)) (sp-flt spt-rot-z (degrees 0.0)) @@ -749,8 +717,7 @@ ;; failed to figure out what this is: (defpart 1976 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x35 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1100)) (sp-flt spt-rot-z (degrees 0.0)) diff --git a/test/decompiler/reference/engine/anim/aligner-h_REF.gc b/test/decompiler/reference/engine/anim/aligner-h_REF.gc index df36ac7e5e..1af902de45 100644 --- a/test/decompiler/reference/engine/anim/aligner-h_REF.gc +++ b/test/decompiler/reference/engine/anim/aligner-h_REF.gc @@ -3,7 +3,7 @@ ;; definition of type align-control (deftype align-control (basic) - ((flags uint32 :offset-assert 4) + ((flags align-flags :offset-assert 4) (process process-drawable :offset-assert 8) (frame-group art-joint-anim :offset-assert 12) (frame-num float :offset-assert 16) @@ -18,9 +18,9 @@ :flag-assert #xe00000134 (:methods (new (symbol type process) _type_ :behavior process-drawable 0) - (TODO-RENAME-9 (_type_) transformq 9) - (TODO-RENAME-10 (_type_ int float float float) trsqv 10) - (TODO-RENAME-11 (_type_ int vector int float float) none 11) + (compute-alignment! (_type_) transformq 9) + (align! (_type_ align-opts float float float) trsqv 10) + (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv 11) (first-transform (_type_) transform 12) (snd-transform (_type_) transform 13) ) diff --git a/test/decompiler/reference/engine/anim/aligner_REF.gc b/test/decompiler/reference/engine/anim/aligner_REF.gc index 3f53aca505..6f52598139 100644 --- a/test/decompiler/reference/engine/anim/aligner_REF.gc +++ b/test/decompiler/reference/engine/anim/aligner_REF.gc @@ -5,7 +5,7 @@ ;; WARN: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; WARN: Unsupported inline assembly instruction kind - [jr ra] ;; Used lq/sq -(defmethod TODO-RENAME-9 align-control ((obj align-control)) +(defmethod compute-alignment! align-control ((obj align-control)) (local-vars (a0-9 symbol) (s7-0 none) (ra-0 int)) (with-pp (let ((s5-0 (-> obj process skel active-channels))) @@ -54,8 +54,8 @@ ) ) (if a0-9 - (logior! (-> obj flags) 1) - (set! (-> obj flags) (logand -2 (-> obj flags))) + (logior! (-> obj flags) (align-flags disabled)) + (logclear! (-> obj flags) (align-flags disabled)) ) (set! (-> obj frame-group) v1-16) (set! (-> obj frame-num) f0-0) @@ -128,8 +128,8 @@ ) ;; definition for method 10 of type align-control -(defmethod TODO-RENAME-10 align-control ((obj align-control) (arg0 int) (arg1 float) (arg2 float) (arg3 float)) - (when (zero? (logand (-> obj flags) 1)) +(defmethod align! align-control ((obj align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float)) + (when (zero? (logand (-> obj flags) (align-flags disabled))) (let* ((a0-1 (-> obj process)) (t9-0 (method-of-object a0-1 apply-alignment)) (v1-4 (-> obj delta)) @@ -146,7 +146,7 @@ ) ;; definition for method 26 of type trsqv -(defmethod TODO-RENAME-26 trsqv ((obj trsqv) (arg0 int) (arg1 vector) (arg2 float)) +(defmethod set-and-limit-velocity trsqv ((obj trsqv) (arg0 int) (arg1 vector) (arg2 float)) (let ((gp-0 (-> obj transv))) (when (logtest? arg0 4) (set! (-> gp-0 x) (-> arg1 x)) @@ -160,15 +160,14 @@ ) ;; definition for method 11 of type align-control -;; INFO: Return type mismatch trsqv vs none. -(defmethod TODO-RENAME-11 align-control ((obj align-control) (arg0 int) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) - (when (zero? (logand (-> obj flags) 1)) +(defmethod align-vel-and-quat-only! align-control ((obj align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) + (when (zero? (logand (-> obj flags) (align-flags disabled))) (let ((s5-0 (-> obj delta))) (let ((s3-0 (-> obj process root transv))) - (if (logtest? arg0 2) + (if (logtest? arg0 (align-opts adjust-y-vel)) (set! (-> s3-0 y) (* (-> s5-0 trans y) arg3 (-> *display* frames-per-second))) ) - (when (logtest? arg0 4) + (when (logtest? arg0 (align-opts adjust-xz-vel)) (set! (-> s3-0 x) (-> arg1 x)) (set! (-> s3-0 z) (-> arg1 z)) (let ((f0-8 (* (fmin (vector-xz-length arg1) (* (vector-xz-length (-> s5-0 trans)) arg4)) @@ -182,11 +181,10 @@ ) ) ) - (if (logtest? arg0 16) + (if (logtest? arg0 (align-opts adjust-quat)) (quaternion-normalize! (quaternion*! (-> obj process root quat) (-> obj process root quat) (-> s5-0 quat))) ) ) ) (-> obj process root) - (none) ) diff --git a/test/decompiler/reference/engine/anim/joint-h_REF.gc b/test/decompiler/reference/engine/anim/joint-h_REF.gc index e6cc0e14de..071f9904ca 100644 --- a/test/decompiler/reference/engine/anim/joint-h_REF.gc +++ b/test/decompiler/reference/engine/anim/joint-h_REF.gc @@ -69,7 +69,7 @@ :flag-assert #xb000000c0 (:methods (new (symbol type int) _type_ 0) - (dummy-9 (_type_) float 9) + (current-cycle-distance (_type_) float 9) (debug-print-channels (_type_ symbol) int 10) ) ) diff --git a/test/decompiler/reference/engine/anim/joint_REF.gc b/test/decompiler/reference/engine/anim/joint_REF.gc index 054dfac254..adbd4af362 100644 --- a/test/decompiler/reference/engine/anim/joint_REF.gc +++ b/test/decompiler/reference/engine/anim/joint_REF.gc @@ -668,20 +668,20 @@ ) ;; definition for function joint-control-channel-eval +;; INFO: Return type mismatch float vs none. (defun joint-control-channel-eval ((arg0 joint-control-channel)) - (let ((f0-2 ((-> arg0 num-func) arg0 (-> arg0 param 0) (-> arg0 param 1)))) - (set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter))) - f0-2 - ) + ((-> arg0 num-func) arg0 (-> arg0 param 0) (-> arg0 param 1)) + (set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter))) + (none) ) ;; definition for function joint-control-channel-eval! +;; INFO: Return type mismatch float vs none. (defun joint-control-channel-eval! ((arg0 joint-control-channel) (arg1 (function joint-control-channel float float float))) (set! (-> arg0 num-func) arg1) - (let ((f0-2 (arg1 arg0 (-> arg0 param 0) (-> arg0 param 1)))) - (set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter))) - f0-2 - ) + (arg1 arg0 (-> arg0 param 0) (-> arg0 param 1)) + (set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter))) + (none) ) ;; definition for function joint-control-channel-group-eval! @@ -1128,7 +1128,7 @@ ) ;; definition for method 9 of type cspace -(defmethod dummy-9 cspace ((obj cspace) (arg0 basic)) +(defmethod reset-and-assign-geo! cspace ((obj cspace) (arg0 basic)) (set! (-> obj parent) #f) (set! (-> obj joint) #f) (set! (-> obj geo) arg0) @@ -1144,7 +1144,7 @@ (v1-1 type-to-make) ) (-> type-to-make size) - ((method-of-type cspace dummy-9) (the-as cspace (t9-0 allocation v1-1)) arg0) + ((method-of-type cspace reset-and-assign-geo!) (the-as cspace (t9-0 allocation v1-1)) arg0) ) ) diff --git a/test/decompiler/reference/engine/anim/mspace-h_REF.gc b/test/decompiler/reference/engine/anim/mspace-h_REF.gc index e2df620ae8..4131ebd75b 100644 --- a/test/decompiler/reference/engine/anim/mspace-h_REF.gc +++ b/test/decompiler/reference/engine/anim/mspace-h_REF.gc @@ -104,7 +104,7 @@ :flag-assert #xa00000020 (:methods (new (symbol type basic) _type_ 0) - (dummy-9 (_type_ basic) _type_ 9) + (reset-and-assign-geo! (_type_ basic) _type_ 9) ) ) diff --git a/test/decompiler/reference/engine/camera/cam-combiner_REF.gc b/test/decompiler/reference/engine/camera/cam-combiner_REF.gc index c4ea1dd4f3..0f0cec38df 100644 --- a/test/decompiler/reference/engine/camera/cam-combiner_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-combiner_REF.gc @@ -3,8 +3,7 @@ ;; failed to figure out what this is: (defstate cam-combiner-active (camera-combiner) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -170,10 +169,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (local-vars (sv-160 cam-rotation-tracker)) - (while #t + (loop (when (and (zero? (logand (-> *camera* master-options) 2)) (!= (-> self tracking-status) 0)) (set! (-> self tracking-status) (the-as uint 0)) 0 @@ -313,7 +311,7 @@ ) ) ((and (< 16384.0 f28-1) (< (vector-dot (-> self flip-control-axis) s4-1) 0.0)) - (set! (-> *camera* master-options) (logxor (-> *camera* master-options) 16)) + (logxor! (-> *camera* master-options) 16) ) ) (set! (-> self flip-control-axis quad) (-> s4-1 quad)) diff --git a/test/decompiler/reference/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/engine/camera/cam-layout_REF.gc index e0ac1e29d2..81820ba657 100644 --- a/test/decompiler/reference/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-layout_REF.gc @@ -263,7 +263,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-4) ) @@ -314,7 +314,7 @@ (sv-288 int) ) (let ((s4-0 0)) - (while #t + (loop (set! sv-16 (new 'static 'res-tag)) (let ((s3-0 (the-as (inline-array vector) ((method-of-type res-lump get-property-data) arg0 @@ -362,9 +362,9 @@ (when (!= s1-0 sv-272) (vector-float*! sv-192 (-> s3-0 sv-272) (-> s3-0 sv-272 w)) (vector-cross! sv-208 (-> s3-0 sv-272) (-> s3-0 s1-0)) - (vector-normalize! sv-208 (-> (new 'static 'array float 1 1.0) 0)) + (vector-normalize! sv-208 (the-as float 1.0)) (vector-cross! sv-224 sv-208 (-> s3-0 sv-272)) - (vector-normalize! sv-224 (-> (new 'static 'array float 1 1.0) 0)) + (vector-normalize! sv-224 (the-as float 1.0)) (let ((f0-6 (cam-layout-intersect-dist (-> s3-0 s1-0) sv-192 sv-224))) (when (!= f0-6 409600000.0) (vector+float*! sv-240 sv-192 sv-224 f0-6) @@ -416,7 +416,7 @@ (else (dotimes (v1-87 (the-as int (-> sv-16 elt-count))) (when (and (!= v1-87 s1-0) (!= v1-87 sv-272)) - (if (< (-> (new 'static 'array float 1 4096.0) 0) (- (vector-dot sv-160 (-> s3-0 v1-87)) (-> s3-0 v1-87 w))) + (if (< 4096.0 (- (vector-dot sv-160 (-> s3-0 v1-87)) (-> s3-0 v1-87 w))) (goto cfg-47) ) ) @@ -446,7 +446,7 @@ (set! sv-272 (+ sv-272 1)) ) (when (nonzero? sv-256) - (vector-float*! s0-0 s0-0 (/ (-> (new 'static 'array float 1 1.0) 0) (the float sv-256))) + (vector-float*! s0-0 s0-0 (/ 1.0 (the float sv-256))) (cond ((>= *volume-normal-current* 599) (format 0 "ERROR : camera editing out of volume normals~%") @@ -535,20 +535,20 @@ 0.0 0.0 (cond - ((< (-> (new 'static 'array float 1 1.0) 0) arg3) - (set! arg3 (-> (the-as (pointer float) (new 'static 'array float 1 1.0)) 0)) + ((< 1.0 arg3) + (set! arg3 (the-as float 1.0)) ) ((< arg3 0.0) - (set! arg3 (-> (the-as (pointer float) (new 'static 'array float 1 0.0)) 0)) + (set! arg3 (the-as float 0.0)) ) ) - (vector-normalize-copy! s2-0 arg1 (-> (new 'static 'array float 1 1.0) 0)) - (vector-normalize-copy! s1-0 arg2 (-> (new 'static 'array float 1 1.0) 0)) + (vector-normalize-copy! s2-0 arg1 (the-as float 1.0)) + (vector-normalize-copy! s1-0 arg2 (the-as float 1.0)) (vector-cross! s0-0 s2-0 s1-0) (let* ((f30-0 (vector-length s0-0)) (f28-0 (asin f30-0)) ) - (vector-float*! arg0 arg1 (/ (sin (* (- (-> (new 'static 'array float 1 1.0) 0) arg3) f28-0)) f30-0)) + (vector-float*! arg0 arg1 (/ (sin (* (- 1.0 arg3) f28-0)) f30-0)) (vector+float*! arg0 arg0 arg2 (/ (sin (* arg3 f28-0)) f30-0)) ) ) @@ -586,36 +586,15 @@ (let ((s3-0 (new-stack-vector0)) (gp-0 (new-stack-vector0)) ) - (arg0 - s3-0 - (-> arg1 from) - (-> arg1 to) - (-> (new 'static 'array float 1 0.0) 0) - (-> arg1 axis) - (-> (new 'static 'array float 1 65536.0) 0) - ) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) (the-as float 0.0) (-> arg1 axis) (the-as float 65536.0)) (vector+! s3-0 s3-0 (-> arg1 origin)) (dotimes (s2-0 10) (set! (-> gp-0 quad) (-> s3-0 quad)) - (arg0 - s3-0 - (-> arg1 from) - (-> arg1 to) - (* 0.1 (+ (-> (new 'static 'array float 1 1.0) 0) (the float s2-0))) - (-> arg1 axis) - (-> (new 'static 'array float 1 65536.0) 0) - ) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) (* 0.1 (+ 1.0 (the float s2-0))) (-> arg1 axis) (the-as float 65536.0)) (vector+! s3-0 s3-0 (-> arg1 origin)) (camera-line s3-0 gp-0 (-> arg1 color)) ) - (arg0 - gp-0 - (-> arg1 from) - (-> arg1 to) - (-> *CAM_LAYOUT-bank* debug-t) - (-> arg1 axis) - (-> (new 'static 'array float 1 65536.0) 0) - ) + (arg0 gp-0 (-> arg1 from) (-> arg1 to) (-> *CAM_LAYOUT-bank* debug-t) (-> arg1 axis) (the-as float 65536.0)) (format *stdcon* "~S ~f~%" (-> arg1 disp) (vector-length gp-0)) (vector+! gp-0 gp-0 (-> arg1 origin)) (camera-line (-> arg1 origin) gp-0 (-> arg1 color)) @@ -624,7 +603,7 @@ (new 'static 'vector :z 1024.0) gp-0 (-> arg1 color) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) @@ -635,17 +614,11 @@ (let ((s3-0 (new-stack-vector0)) (gp-0 (new-stack-vector0)) ) - (arg0 s3-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) (-> (new 'static 'array float 1 0.0) 0)) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) (the-as float 0.0)) (vector+! s3-0 s3-0 (-> arg1 origin)) (dotimes (s2-0 10) (set! (-> gp-0 quad) (-> s3-0 quad)) - (arg0 - s3-0 - (-> arg1 from) - (-> arg1 to) - (-> arg1 axis) - (* 182.04445 (* 18.0 (+ (-> (new 'static 'array float 1 1.0) 0) (the float s2-0)))) - ) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) (* 182.04445 (* 18.0 (+ 1.0 (the float s2-0))))) (vector+! s3-0 s3-0 (-> arg1 origin)) (camera-line s3-0 gp-0 (-> arg1 color)) ) @@ -658,7 +631,7 @@ (new 'static 'vector :z 1024.0) gp-0 (-> arg1 color) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) @@ -680,8 +653,8 @@ s5-0 s4-0 (* 0.5 (cam-slave-get-fov arg0)) - (-> (new 'static 'array float 1 0.75) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 0.75) + (the-as float 1.0) (new 'static 'vector4w :z #xff :w #x80) ) ) @@ -695,7 +668,7 @@ (new 'static 'vector :z 1024.0) s5-1 (new 'static 'vector4w :x #x80 :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) @@ -708,7 +681,7 @@ (new 'static 'vector :z 1024.0) s5-2 (new 'static 'vector4w :y #x80 :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) @@ -721,7 +694,7 @@ (new 'static 'vector :z 1024.0) s5-3 (new 'static 'vector4w :x #x80 :z #x80 :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) @@ -735,7 +708,7 @@ ) (cond ((cam-slave-get-vector-with-offset arg0 s4-1 'pivot) - (curve-get-pos! s5-4 (-> (new 'static 'array float 1 0.0) 0) s3-1) + (curve-get-pos! s5-4 (the-as float 0.0) s3-1) (vector-! s4-1 s4-1 s5-4) ) (else @@ -757,11 +730,11 @@ ) ) ) - (curve-get-pos! s5-4 (-> (new 'static 'array float 1 0.0) 0) s3-1) + (curve-get-pos! s5-4 (the-as float 0.0) s3-1) (vector+! s5-4 s5-4 s4-1) (dotimes (s1-1 8) (set! (-> s2-0 quad) (-> s5-4 quad)) - (curve-get-pos! s5-4 (* (-> (new 'static 'array float 1 0.125) 0) (the float (+ s1-1 1))) s3-1) + (curve-get-pos! s5-4 (* 0.125 (the float (+ s1-1 1))) s3-1) (vector+! s5-4 s5-4 s4-1) (camera-line s2-0 s5-4 (new 'static 'vector4w :x #xff :y #xff :w #x80)) ) @@ -772,7 +745,7 @@ (new 'static 'vector :z 1024.0) s5-4 (new 'static 'vector4w :x #xff :y #xff :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) @@ -787,24 +760,24 @@ ) (cond ((cam-slave-get-vector-with-offset arg0 s4-2 'pivot) - (curve-get-pos! s5-5 (-> (new 'static 'array float 1 1.0) 0) s3-2) + (curve-get-pos! s5-5 (the-as float 1.0) s3-2) (vector-! s4-2 s4-2 s5-5) ) ((get-curve-data! arg0 s1-2 'campath 'campath-k (the-as float -1000000000.0)) - (curve-get-pos! s4-2 (-> (new 'static 'array float 1 0.0) 0) s1-2) - (curve-get-pos! s5-5 (-> (new 'static 'array float 1 1.0) 0) s3-2) + (curve-get-pos! s4-2 (the-as float 0.0) s1-2) + (curve-get-pos! s5-5 (the-as float 1.0) s3-2) (vector-! s4-2 s4-2 s5-5) ) ((cam-slave-get-vector-with-offset arg0 s4-2 'trans) - (curve-get-pos! s5-5 (-> (new 'static 'array float 1 1.0) 0) s3-2) + (curve-get-pos! s5-5 (the-as float 1.0) s3-2) (vector-! s4-2 s4-2 s5-5) ) ) - (curve-get-pos! s5-5 (-> (new 'static 'array float 1 0.0) 0) s3-2) + (curve-get-pos! s5-5 (the-as float 0.0) s3-2) (vector+! s5-5 s5-5 s4-2) (dotimes (s1-3 8) (set! (-> s2-1 quad) (-> s5-5 quad)) - (curve-get-pos! s5-5 (* (-> (new 'static 'array float 1 0.125) 0) (the float (+ s1-3 1))) s3-2) + (curve-get-pos! s5-5 (* 0.125 (the float (+ s1-3 1))) s3-2) (vector+! s5-5 s5-5 s4-2) (camera-line s2-1 s5-5 (new 'static 'vector4w :z #xff :w #x80)) ) @@ -815,20 +788,20 @@ (new 'static 'vector :z 1024.0) s5-5 (new 'static 'vector4w :z #xff :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) - (curve-get-pos! s5-5 (cam-slave-get-float arg0 'intro-exitValue (-> (new 'static 'array float 1 0.0) 0)) s3-2) + (curve-get-pos! s5-5 (cam-slave-get-float arg0 'intro-exitValue (the-as float 0.0)) s3-2) (vector+! s5-5 s5-5 s4-2) (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-5 (new 'static 'vector4w :z #xff :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) - (let ((s2-3 (res-lump-data arg0 'campoints pointer :time (-> (new 'static 'array float 1 1.0) 0))) + (let ((s2-3 (res-lump-data arg0 'campoints pointer :time (the-as float 1.0))) (v1-95 (res-lump-struct arg0 'campoints-offset structure :time (the-as float -1000000000.0))) (s4-3 (new 'stack-no-clear 'vector)) (s3-3 (new 'stack-no-clear 'vector)) @@ -852,11 +825,11 @@ (new 'static 'vector :z 1024.0) s5-6 (new 'static 'vector4w :x #xff :y #xff :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) - (let ((s4-4 (res-lump-data arg0 'focalpull pointer :time (-> (new 'static 'array float 1 1.0) 0))) + (let ((s4-4 (res-lump-data arg0 'focalpull pointer :time (the-as float 1.0))) (s5-7 (new 'static 'vector)) ) (when (and s4-4 (or (!= *camera-layout-blink* 'focalpull) (logtest? (-> *display* real-actual-frame-counter) 8))) @@ -876,7 +849,7 @@ (new 'static 'vector :z 1024.0) s5-7 (new 'static 'vector4w :y #xff :z #xff :w #x80) - (-> (new 'static 'array float 1 4096.0) 0) + (meters 1.0) ) ) ) @@ -892,12 +865,12 @@ (vector-! (-> s5-8 from) (-> s5-8 from) (-> s5-8 origin)) (vector-! (-> s5-8 to) (-> s5-8 to) (-> s5-8 origin)) (vector-cross! s4-5 (-> s5-8 from) (-> s5-8 to)) - (vector-normalize! s4-5 (-> (new 'static 'array float 1 8192.0) 0)) + (vector-normalize! s4-5 (the-as float 8192.0)) (vector+! s4-5 s4-5 (-> s5-8 origin)) (camera-line (-> s5-8 origin) s4-5 (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80)) (when (not (paused?)) (+! (-> *CAM_LAYOUT-bank* debug-t) (-> *CAM_LAYOUT-bank* debug-step)) - (if (< (-> (new 'static 'array float 1 1.0) 0) (-> *CAM_LAYOUT-bank* debug-t)) + (if (< 1.0 (-> *CAM_LAYOUT-bank* debug-t)) (set! (-> *CAM_LAYOUT-bank* debug-t) 0.0) ) ) @@ -958,10 +931,10 @@ ((cpad-hold? arg2 l3) (set! (-> arg0 z) (- (-> arg0 z) (analog-input (the-as int (-> *cpad-list* cpads arg2 rightx)) - (-> (new 'static 'array float 1 128.0) 0) - (-> (new 'static 'array float 1 48.0) 0) - (-> (new 'static 'array float 1 110.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 128.0) + (the-as float 48.0) + (the-as float 110.0) + (the-as float 1.0) ) ) ) @@ -969,27 +942,27 @@ (else (set! (-> arg0 y) (- (-> arg0 y) (analog-input (the-as int (-> *cpad-list* cpads arg2 rightx)) - (-> (new 'static 'array float 1 128.0) 0) - (-> (new 'static 'array float 1 48.0) 0) - (-> (new 'static 'array float 1 110.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 128.0) + (the-as float 48.0) + (the-as float 110.0) + (the-as float 1.0) ) ) ) (+! (-> arg0 x) (analog-input (the-as int (-> *cpad-list* cpads arg2 righty)) - (-> (new 'static 'array float 1 128.0) 0) - (-> (new 'static 'array float 1 48.0) 0) - (-> (new 'static 'array float 1 110.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 128.0) + (the-as float 48.0) + (the-as float 110.0) + (the-as float 1.0) ) ) (set! (-> arg1 x) (- (-> arg1 x) (analog-input (the-as int (-> *cpad-list* cpads arg2 leftx)) - (-> (new 'static 'array float 1 128.0) 0) - (-> (new 'static 'array float 1 48.0) 0) - (-> (new 'static 'array float 1 110.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 128.0) + (the-as float 48.0) + (the-as float 110.0) + (the-as float 1.0) ) ) ) @@ -998,9 +971,9 @@ (set! (-> arg1 y) (+ 0.5 (analog-input (the-as int (-> *cpad-list* cpads arg2 abutton 9)) - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 32.0) 0) - (-> (new 'static 'array float 1 230.0) 0) + (the-as float 0.0) + (the-as float 32.0) + (the-as float 230.0) (the-as float 0.5) ) (-> arg1 y) @@ -1012,9 +985,9 @@ (if (cpad-hold? arg2 l1) (set! (-> arg1 y) (- (-> arg1 y) (+ 0.5 (analog-input (the-as int (-> *cpad-list* cpads arg2 abutton 8)) - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 32.0) 0) - (-> (new 'static 'array float 1 230.0) 0) + (the-as float 0.0) + (the-as float 32.0) + (the-as float 230.0) (the-as float 0.5) ) ) @@ -1024,10 +997,10 @@ ) (set! (-> arg1 z) (- (-> arg1 z) (analog-input (the-as int (-> *cpad-list* cpads arg2 lefty)) - (-> (new 'static 'array float 1 128.0) 0) - (-> (new 'static 'array float 1 48.0) 0) - (-> (new 'static 'array float 1 110.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 128.0) + (the-as float 48.0) + (the-as float 110.0) + (the-as float 1.0) ) ) ) @@ -1303,11 +1276,13 @@ ) ;; definition for function fov->maya +;; INFO: Return type mismatch number vs float. (defun fov->maya ((arg0 float)) - (if (= arg0 0.0) - (-> (new 'static 'array float 1 0.0) 0) - (/ 12.700255 (tan (* 0.5 arg0))) - ) + (the-as float (if (= arg0 0.0) + 0.0 + (/ 12.700255 (tan (* 0.5 arg0))) + ) + ) ) ;; definition for function cam-layout-save-cam-rot @@ -1548,7 +1523,7 @@ 'fov 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1562,7 +1537,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1601,7 +1576,7 @@ 'focalPull 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1615,7 +1590,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1819,7 +1794,7 @@ 'intro-time 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1833,7 +1808,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1844,7 +1819,7 @@ (if arg0 (format #t "setup intro-time 0.0 (defaults to 1 sec)~%") ) - (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) + (set! f30-0 1.0) ) (arg0 (format #t "setup intro-time ~f~%" f30-0) @@ -1872,7 +1847,7 @@ 'intro-exitValue 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1886,7 +1861,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1920,7 +1895,7 @@ 'interpTime 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -1934,7 +1909,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2002,7 +1977,7 @@ 'spline-follow-dist-offset 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2047,7 +2022,7 @@ 'tiltAdjust 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2061,7 +2036,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2092,7 +2067,7 @@ 'stringMinLength 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2106,7 +2081,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2137,7 +2112,7 @@ 'stringMaxLength 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2151,7 +2126,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2182,7 +2157,7 @@ 'stringMinHeight 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2196,7 +2171,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2227,7 +2202,7 @@ 'stringMaxHeight 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2241,7 +2216,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2272,7 +2247,7 @@ 'stringCliffHeight 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2286,7 +2261,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2317,7 +2292,7 @@ 'maxAngle 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2330,7 +2305,7 @@ (string->symbol *res-key-string*) 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2681,7 +2656,7 @@ arg0 'interp (the-as float -1000000000.0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as (pointer res-tag) #f) *res-static-buf* ) @@ -2689,15 +2664,15 @@ (f0-0 (-> arg1 0)) ) (if (= f0-0 0.0) - (set! f0-0 (-> (new 'static 'array float 1 1.0) 0)) + (set! f0-0 1.0) ) (let ((f0-2 (+ f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) - (-> (new 'static 'array float 1 128.0) 0) - (-> (new 'static 'array float 1 48.0) 0) - (-> (new 'static 'array float 1 110.0) 0) + (the-as float 128.0) + (the-as float 48.0) + (the-as float 110.0) f0-0 ) ) @@ -2716,7 +2691,7 @@ ;; definition for function clmf-cam-meters (defbehavior clmf-cam-meters cam-layout ((arg0 meters) (arg1 symbol)) - (let ((f0-0 (cam-slave-get-float (-> self cam-entity) arg1 (-> (new 'static 'array float 1 0.0) 0)))) + (let ((f0-0 (cam-slave-get-float (-> self cam-entity) arg1 (the-as float 0.0)))) (format arg0 ": ~M" f0-0) ) #t @@ -2730,7 +2705,7 @@ ;; definition for function clmf-cam-deg (defbehavior clmf-cam-deg cam-layout ((arg0 degrees) (arg1 symbol)) - (format arg0 ": ~R" (cam-slave-get-float (-> self cam-entity) arg1 (-> (new 'static 'array float 1 0.0) 0))) + (format arg0 ": ~R" (cam-slave-get-float (-> self cam-entity) arg1 (the-as float 0.0))) #t ) @@ -2751,7 +2726,7 @@ ;; definition for function clmf-cam-float (defbehavior clmf-cam-float cam-layout ((arg0 float) (arg1 symbol)) - (format arg0 ": ~f" (cam-slave-get-float (-> self cam-entity) arg1 (-> (new 'static 'array float 1 0.0) 0))) + (format arg0 ": ~f" (cam-slave-get-float (-> self cam-entity) arg1 (the-as float 0.0))) #t ) @@ -2773,45 +2748,30 @@ ) ;; definition for symbol *clm-focalpull-attr*, type clm -(define - *clm-focalpull-attr* +(define *clm-focalpull-attr* (new 'static 'clm :title "---focalpull attributes--" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " ok" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) ) (new 'static 'clm-item :description "adjust" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :func #f) + :action (new 'static 'clm-item-action :button #x4000 :func #f) ) (new 'static 'clm-list :tracker #f - :items - (new - 'static - 'boxed-array - :type clm-list-item :length 2 :allocated-length 2 + :items (new 'static 'boxed-array :type clm-list-item (new 'static 'clm-list-item :description "radial " :track-val #f :val-func 'clmf-cam-flag :val-parm0 16 :val-parm1-basic 'focalpull-flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -2827,15 +2787,14 @@ :val-func 'clmf-cam-flag :val-parm0 8 :val-parm1-basic 'focalpull-flags - :actions - (new 'static 'boxed-array :type clm-item-action :length 1 :allocated-length 1 (new 'static 'clm-item-action - :button #x4000 - :options #x1 - :func 'clmf-cam-flag-toggle - :parm0 8 - :parm1-basic 'focalpull-flags - ) - ) + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 8 + :parm1-basic 'focalpull-flags + ) + ) ) ) ) @@ -2844,45 +2803,30 @@ ) ;; definition for symbol *clm-index-attr*, type clm -(define - *clm-index-attr* +(define *clm-index-attr* (new 'static 'clm :title "---index attributes--" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " ok" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) ) (new 'static 'clm-item :description "adjust" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :func #f) + :action (new 'static 'clm-item-action :button #x4000 :func #f) ) (new 'static 'clm-list :tracker #f - :items - (new - 'static - 'boxed-array - :type clm-list-item :length 2 :allocated-length 2 + :items (new 'static 'boxed-array :type clm-list-item (new 'static 'clm-list-item :description "radial " :track-val #f :val-func 'clmf-cam-flag :val-parm0 16 :val-parm1-basic 'campoints-flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -2898,15 +2842,14 @@ :val-func 'clmf-cam-flag :val-parm0 8 :val-parm1-basic 'campoints-flags - :actions - (new 'static 'boxed-array :type clm-item-action :length 1 :allocated-length 1 (new 'static 'clm-item-action - :button #x4000 - :options #x1 - :func 'clmf-cam-flag-toggle - :parm0 8 - :parm1-basic 'campoints-flags - ) - ) + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 8 + :parm1-basic 'campoints-flags + ) + ) ) ) ) @@ -2915,167 +2858,125 @@ ) ;; definition for symbol *clm-intro-attr*, type clm -(define - *clm-intro-attr* +(define *clm-intro-attr* (new 'static 'clm :title "---intro attributes--" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " ok" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) ) (new 'static 'clm-item :description "adjust" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :func #f) + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "time " + :track-val #f + :val-func 'clmf-cam-intro-time + :val-parm0-basic 'intro-time + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-basic 'intro-time-offset + :parm1-basic (new 'static 'bfloat :data 0.01) + ) + ) + ) + (new 'static 'clm-list-item + :description "exitValue" + :track-val #f + :val-func 'clmf-cam-float + :val-parm0-basic 'intro-exitValue + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-basic 'intro-exitValue-offset + :parm1-basic (new 'static 'bfloat :data 0.001) + ) + ) + ) + ) ) - (new 'static 'clm-list :tracker #f :items (new - 'static - 'boxed-array - :type clm-list-item :length 2 :allocated-length 2 - (new 'static 'clm-list-item - :description "time " - :track-val #f - :val-func 'clmf-cam-intro-time - :val-parm0-basic 'intro-time - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 - (new 'static 'clm-item-action - :button #x4000 - :func 'clmf-cam-float-adjust - :parm0-basic 'intro-time-offset - :parm1-basic (new 'static 'bfloat :data 0.01) - ) - ) - ) - (new 'static 'clm-list-item - :description "exitValue" - :track-val #f - :val-func 'clmf-cam-float - :val-parm0-basic 'intro-exitValue - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 - (new 'static 'clm-item-action - :button #x4000 - :func 'clmf-cam-float-adjust - :parm0-basic 'intro-exitValue-offset - :parm1-basic (new 'static 'bfloat :data 0.001) - ) - ) - ) - ) - ) ) ) ) ;; definition for symbol *clm-spline-attr*, type clm -(define - *clm-spline-attr* +(define *clm-spline-attr* (new 'static 'clm :title "---spline attributes--" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " ok" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) ) (new 'static 'clm-item :description "adjust" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :func #f) + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "followDist" + :track-val #f + :val-func 'clmf-cam-meters + :val-parm0-basic 'spline-follow-dist + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-basic 'spline-follow-dist-offset + :parm1-basic (new 'static 'bfloat :data 409.6) + ) + ) + ) + ) ) - (new 'static 'clm-list :tracker #f :items (new - 'static - 'boxed-array - :type clm-list-item :length 1 :allocated-length 1 - (new 'static 'clm-list-item - :description "followDist" - :track-val #f - :val-func 'clmf-cam-meters - :val-parm0-basic 'spline-follow-dist - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 - (new 'static 'clm-item-action - :button #x4000 - :func 'clmf-cam-float-adjust - :parm0-basic 'spline-follow-dist-offset - :parm1-basic (new 'static 'bfloat :data 409.6) - ) - ) - ) - ) - ) ) ) ) ;; definition for symbol *clm-vol-attr*, type clm -(define - *clm-vol-attr* +(define *clm-vol-attr* (new 'static 'clm :title "---volume attributes--" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " ok" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) ) (new 'static 'clm-item :description "adjust" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :func #f) + :action (new 'static 'clm-item-action :button #x4000 :func #f) ) (new 'static 'clm-list :tracker #f - :items - (new - 'static - 'boxed-array - :type clm-list-item :length 1 :allocated-length 1 + :items (new 'static 'boxed-array :type clm-list-item (new 'static 'clm-list-item :description "airSwitch" :track-val #f :val-func 'clmf-cam-flag :val-parm0 8 :val-parm1-basic 'vol-flags - :actions - (new 'static 'boxed-array :type clm-item-action :length 1 :allocated-length 1 (new 'static 'clm-item-action - :button #x4000 - :options #x1 - :func 'clmf-cam-flag-toggle - :parm0 8 - :parm1-basic 'vol-flags - ) - ) + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 8 + :parm1-basic 'vol-flags + ) + ) ) ) ) @@ -3084,45 +2985,30 @@ ) ;; definition for symbol *clm-cam-attr*, type clm -(define - *clm-cam-attr* +(define *clm-cam-attr* (new 'static 'clm :title "---camera attributes--" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " ok" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) ) (new 'static 'clm-item :description "adjust" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :func #f) + :action (new 'static 'clm-item-action :button #x4000 :func #f) ) (new 'static 'clm-list :tracker #f - :items - (new - 'static - 'boxed-array - :type clm-list-item :length 18 :allocated-length 18 + :items (new 'static 'boxed-array :type clm-list-item (new 'static 'clm-list-item :description "drag " :track-val #f :val-func 'clmf-cam-flag :val-parm0 #x400 :val-parm1-basic 'flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -3137,11 +3023,7 @@ :track-val #f :val-func 'clmf-cam-fov :val-parm0-basic 'fov - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3155,11 +3037,7 @@ :track-val #f :val-func 'clmf-cam-deg :val-parm0-basic 'focalPull - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3173,11 +3051,7 @@ :track-val #f :val-func 'clmf-cam-interp-time :val-parm0-basic 'interpTime - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3192,11 +3066,7 @@ :val-func 'clmf-cam-flag :val-parm0 16 :val-parm1-basic 'flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -3212,11 +3082,7 @@ :val-func 'clmf-cam-flag :val-parm0 32 :val-parm1-basic 'flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -3231,11 +3097,7 @@ :track-val #f :val-func 'clmf-cam-meters :val-parm0-basic 'stringMinLength - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3249,11 +3111,7 @@ :track-val #f :val-func 'clmf-cam-meters :val-parm0-basic 'stringMaxLength - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3267,11 +3125,7 @@ :track-val #f :val-func 'clmf-cam-meters :val-parm0-basic 'stringMinHeight - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3285,11 +3139,7 @@ :track-val #f :val-func 'clmf-cam-meters :val-parm0-basic 'stringMaxHeight - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3303,11 +3153,7 @@ :track-val #f :val-func 'clmf-cam-meters :val-parm0-basic 'stringCliffHeight - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3321,19 +3167,14 @@ :track-val #f :val-func 'clmf-cam-string :val-parm0-basic 'alternates - :actions - (new 'static 'boxed-array :type clm-item-action :length 0 :allocated-length 0) + :actions (new 'static 'boxed-array :type clm-item-action) ) (new 'static 'clm-list-item :description "maxAngle " :track-val #f :val-func 'clmf-cam-deg :val-parm0-basic 'maxAngle - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3348,11 +3189,7 @@ :val-func 'clmf-cam-flag :val-parm0 #x4000 :val-parm1-basic 'flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -3368,11 +3205,7 @@ :val-func 'clmf-cam-flag :val-parm0 #x40000 :val-parm1-basic 'flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -3387,11 +3220,7 @@ :track-val #f :val-func 'clmf-cam-deg :val-parm0-basic 'tiltAdjust - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-cam-float-adjust @@ -3406,11 +3235,7 @@ :val-func 'clmf-cam-flag :val-parm0 #x80000 :val-parm1-basic 'flags - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 @@ -3426,15 +3251,14 @@ :val-func 'clmf-cam-flag :val-parm0 #x100000 :val-parm1-basic 'flags - :actions - (new 'static 'boxed-array :type clm-item-action :length 1 :allocated-length 1 (new 'static 'clm-item-action - :button #x4000 - :options #x1 - :func 'clmf-cam-flag-toggle - :parm0 #x100000 - :parm1-basic 'flags - ) - ) + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x100000 + :parm1-basic 'flags + ) + ) ) ) ) @@ -3443,32 +3267,24 @@ ) ;; definition for symbol *clm-cam-lookthrough*, type clm -(define - *clm-cam-lookthrough* +(define *clm-cam-lookthrough* (new 'static 'clm :title "---cam-lookthrough---" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 5 :allocated-length 5 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " " :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :options #x4 :func 'clmf-look-through) + :action (new 'static 'clm-item-action :button #x4000 :options #x4 :func 'clmf-look-through) ) (new 'static 'clm-item :description " ok" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-to-edit) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-to-edit) ) (new 'static 'clm-item :description "pos/rot" :button-symbol 'x - :action - (new 'static 'clm-item-action + :action (new 'static 'clm-item-action :button #x4000 :options #x8 :func 'clmf-pos-rot @@ -3479,93 +3295,68 @@ (new 'static 'clm-item :description " adjust" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :func #f) + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "fov" + :track-val #f + :val-func 'clmf-cam-fov + :val-parm0-basic 'fov + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-basic 'fov-offset + :parm1-basic (new 'static 'bfloat :data 91.022224) + ) + ) + ) + ) ) - (new 'static 'clm-list :tracker #f :items (new - 'static - 'boxed-array - :type clm-list-item :length 1 :allocated-length 1 - (new 'static 'clm-list-item - :description "fov" - :track-val #f - :val-func 'clmf-cam-fov - :val-parm0-basic 'fov - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 1 :allocated-length 1 - (new 'static 'clm-item-action - :button #x4000 - :func 'clmf-cam-float-adjust - :parm0-basic 'fov-offset - :parm1-basic (new 'static 'bfloat :data 91.022224) - ) - ) - ) - ) - ) ) ) ) ;; definition for symbol *clm-edit*, type clm -(define - *clm-edit* +(define *clm-edit* (new 'static 'clm :title "---edit---" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 6 :allocated-length 6 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " ok" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-to-select) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-to-select) ) (new 'static 'clm-item :description "attributes" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :options #x1 :func #f) + :action (new 'static 'clm-item-action :button #x4000 :options #x1 :func #f) ) (new 'static 'clm-item :description " edit part" :button-symbol 'circle - :action - (new 'static 'clm-item-action :button #x2000 :options #x1 :func #f) + :action (new 'static 'clm-item-action :button #x2000 :options #x1 :func #f) ) (new 'static 'clm-item :description "scale/next" :button-symbol 'r2 - :action - (new 'static 'clm-item-action :button #x200 :func #f) + :action (new 'static 'clm-item-action :button #x200 :func #f) ) (new 'static 'clm-item :description " pos/rot" :button-symbol 'l2 - :action - (new 'static 'clm-item-action :button #x100 :func #f) + :action (new 'static 'clm-item-action :button #x100 :func #f) ) (new 'static 'clm-list :tracker '*camera-layout-blink* - :items - (new - 'static - 'boxed-array - :type clm-list-item :length 9 :allocated-length 9 + :items (new 'static 'boxed-array :type clm-list-item (new 'static 'clm-list-item :description "camera " :track-val 'camera :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 :func '*clm-cam-attr*) (new 'static 'clm-item-action :button #x2000 :func '*clm-cam-lookthrough*) (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) @@ -3581,11 +3372,7 @@ :description "volume " :track-val 'volume :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-vol-attr) (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) (new 'static 'clm-item-action :button #x200 :func 'clmf-next-vol-dpad) @@ -3596,11 +3383,7 @@ :description "align " :track-val 'align :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-bna) (new 'static 'clm-item-action :button #x2000 :func 'clmf-bna) (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) @@ -3611,11 +3394,7 @@ :description "pivot " :track-val 'pivot :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-bna) (new 'static 'clm-item-action :button #x2000 :func 'clmf-bna) (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) @@ -3626,11 +3405,7 @@ :description "interesting" :track-val 'interesting :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-bna) (new 'static 'clm-item-action :button #x2000 :func 'clmf-bna) (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) @@ -3646,11 +3421,7 @@ :description "spline " :track-val 'spline :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :func 'clmf-to-spline-attr) (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) @@ -3661,11 +3432,7 @@ :description "intro " :track-val 'intro :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-intro-attr) (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) @@ -3676,11 +3443,7 @@ :description "index " :track-val 'index :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-index-attr) (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) @@ -3691,11 +3454,7 @@ :description "focalpull" :track-val 'focalpull :val-func #f - :actions - (new - 'static - 'boxed-array - :type clm-item-action :length 4 :allocated-length 4 + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-focalpull-attr) (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) @@ -3709,114 +3468,87 @@ ) ;; definition for symbol *clm-save-all*, type clm -(define - *clm-save-all* +(define *clm-save-all* (new 'static 'clm :title "---save all?---" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " save all" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-save-all :parm0 16) + :action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-save-all :parm0 16) ) (new 'static 'clm-item :description "print all" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-save-all :parm0 8) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-save-all :parm0 8) ) (new 'static 'clm-item :description " done" :button-symbol 'triangle - :action - (new 'static 'clm-item-action :button #x1000 :options #x1 :func 'clmf-to-select) + :action (new 'static 'clm-item-action :button #x1000 :options #x1 :func 'clmf-to-select) ) ) ) ) ;; definition for symbol *clm-save-one*, type clm -(define - *clm-save-one* +(define *clm-save-one* (new 'static 'clm :title "---single save?---" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 3 :allocated-length 3 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " single save" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-save-one :parm0 16) + :action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-save-one :parm0 16) ) (new 'static 'clm-item :description "single print" :button-symbol 'square - :action - (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-save-one :parm0 8) + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-save-one :parm0 8) ) (new 'static 'clm-item :description " done" :button-symbol 'triangle - :action - (new 'static 'clm-item-action :button #x1000 :options #x1 :func 'clmf-to-select) + :action (new 'static 'clm-item-action :button #x1000 :options #x1 :func 'clmf-to-select) ) ) ) ) ;; definition for symbol *clm-select*, type clm -(define - *clm-select* +(define *clm-select* (new 'static 'clm :title "---camera---" - :items - (new - 'static - 'boxed-array - :type clm-basic :length 6 :allocated-length 6 + :items (new 'static 'boxed-array :type clm-basic (new 'static 'clm-item :description " edit" :button-symbol 'x - :action - (new 'static 'clm-item-action :button #x4000 :options #x3 :func 'clmf-to-edit-cam) + :action (new 'static 'clm-item-action :button #x4000 :options #x3 :func 'clmf-to-edit-cam) ) (new 'static 'clm-item :description "save one" :button-symbol 'triangle - :action - (new 'static 'clm-item-action :button #x1000 :options #x3 :func '*clm-save-one*) + :action (new 'static 'clm-item-action :button #x1000 :options #x3 :func '*clm-save-one*) ) (new 'static 'clm-item :description " next" :button-symbol 'down - :action - (new 'static 'clm-item-action :button #x40 :options #x3 :func 'clmf-next-entity :parm0 8) + :action (new 'static 'clm-item-action :button #x40 :options #x3 :func 'clmf-next-entity :parm0 8) ) (new 'static 'clm-item :description " prev" :button-symbol 'up - :action - (new 'static 'clm-item-action :button #x10 :options #x3 :func 'clmf-next-entity :parm0 -8) + :action (new 'static 'clm-item-action :button #x10 :options #x3 :func 'clmf-next-entity :parm0 -8) ) (new 'static 'clm-item :description " next 5" :button-symbol 'right - :action - (new 'static 'clm-item-action :button #x20 :options #x3 :func 'clmf-next-entity :parm0 40) + :action (new 'static 'clm-item-action :button #x20 :options #x3 :func 'clmf-next-entity :parm0 40) ) (new 'static 'clm-item :description " prev 5" :button-symbol 'left - :action - (new 'static 'clm-item-action :button #x80 :options #x3 :func 'clmf-next-entity :parm0 -40) + :action (new 'static 'clm-item-action :button #x80 :options #x3 :func 'clmf-next-entity :parm0 -40) ) ) ) @@ -4028,9 +3760,8 @@ ;; failed to figure out what this is: (defstate cam-layout-active (cam-layout) - :code - (behavior () - (while #t + :code (behavior () + (loop (cam-layout-entity-info (the-as entity-actor (-> self cam-entity))) (cam-layout-entity-volume-info) (cam-layout-do-menu *clm*) @@ -4078,16 +3809,7 @@ ) (cond ((not *cam-layout*) - (let* ((gp-0 (get-process *camera-dead-pool* cam-layout #x4000)) - (v1-4 (when gp-0 - (let ((t9-3 (method-of-type cam-layout activate))) - (t9-3 (the-as cam-layout gp-0) *default-pool* 'cam-layout (the-as pointer #x70004000)) - ) - (run-next-time-in-process gp-0 cam-layout-init) - (-> gp-0 ppointer) - ) - ) - ) + (let ((v1-4 (process-spawn-function cam-layout cam-layout-init :from *camera-dead-pool*))) (cond (v1-4 (logclear! (-> v1-4 0 mask) (process-mask pause menu)) diff --git a/test/decompiler/reference/engine/camera/cam-master_REF.gc b/test/decompiler/reference/engine/camera/cam-master_REF.gc index 33ca6c3939..15c02f8b16 100644 --- a/test/decompiler/reference/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-master_REF.gc @@ -74,10 +74,11 @@ (set! (-> self foot-offset) (-> *CAMERA_MASTER-bank* onscreen-foot-height)) (set! (-> self head-offset) (-> *CAMERA_MASTER-bank* onscreen-head-height)) (set! (-> self target-height) (-> *CAMERA_MASTER-bank* target-height)) - (set! (-> self on-ground) (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) + (set! (-> self on-ground) + (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + ) + ) ) (set! (-> self on-pole) #f) (set! (-> self ease-t) 1.0) @@ -108,7 +109,9 @@ ) ) (cond - ((and (logtest? (-> *target* water flags) 4096) (zero? (logand (-> *target* water flags) 16))) + ((and (logtest? (-> *target* water flags) (water-flags wt12)) + (zero? (logand (-> *target* water flags) (water-flags wt04))) + ) (set! (-> self under-water) 2) ) (else @@ -339,7 +342,9 @@ ) ) (cond - ((and (logtest? (-> *target* water flags) 4096) (zero? (logand (-> *target* water flags) 16))) + ((and (logtest? (-> *target* water flags) (water-flags wt12)) + (zero? (logand (-> *target* water flags) (water-flags wt04))) + ) (set! (-> self under-water) 2) ) ((> (-> self under-water) 0) @@ -389,17 +394,18 @@ (vector--float*! s5-2 (-> self tpos-curr) (-> self local-down) (-> self target-height)) (vector-float*! gp-5 (-> self tgt-rot-mat vector 2) 4915.2) (vector-! s5-2 s5-2 gp-5) - (let ((f0-20 (fill-and-probe-using-line-sphere - *collide-cache* - s5-2 - gp-5 - 4300.8 - (collide-kind background) - (the-as process #f) - s4-2 - 4098 - ) - ) + (let ((f0-20 + (fill-and-probe-using-line-sphere + *collide-cache* + s5-2 + gp-5 + 4300.8 + (collide-kind background) + (the-as process #f) + s4-2 + (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1) + ) + ) ) (if (and (< 0.0 f0-20) (< f0-20 1.0)) (vector+float*! (-> self tpos-curr) (-> self tpos-curr) gp-5 (+ -1.0 f0-20)) @@ -407,16 +413,17 @@ ) ) ) - (set! (-> self on-ground) (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) + (set! (-> self on-ground) + (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + ) + ) ) (let ((gp-6 (new-stack-vector0))) 0.0 (cond - ((and (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + ((and (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) (!= (-> *target* control unknown-surface00 name) 'launch-jump) ) @@ -462,7 +469,7 @@ (vector-! gp-6 (-> self tpos-curr) (-> self tpos-old)) (let ((f0-38 (vector-dot gp-6 (-> self local-down)))) (cond - ((logtest? (-> *target* water flags) 512) + ((logtest? (-> *target* water flags) (water-flags wt09)) (set! (-> self upspeed) 0.0) ) ((< 0.0 f0-38) @@ -491,7 +498,7 @@ (reset-follow) ) (let ((v1-196 (-> *target* water flags))) - (when (and (logtest? v1-196 512) (logtest? v1-196 6144)) + (when (and (logtest? v1-196 (water-flags wt09)) (logtest? v1-196 (water-flags wt11 wt12))) (let ((f0-45 (- (-> *target* water base-height) (-> self target-height)))) (if (< (-> self tpos-curr-adj y) f0-45) (set! (-> self tpos-curr-adj y) f0-45) @@ -538,7 +545,7 @@ (defun in-cam-entity-volume? ((arg0 vector) (arg1 entity) (arg2 float) (arg3 symbol)) (local-vars (sv-16 res-tag)) (let ((s2-0 0)) - (while #t + (loop (set! sv-16 (new 'static 'res-tag)) (let ((v1-1 (the-as object ((method-of-type res-lump get-property-data) arg1 @@ -588,15 +595,9 @@ (set! (-> self stringCliffHeight) 163840.0) (send-event *camera* 'point-of-interest #f) (set! (-> *camera-combiner* tracking point-of-interest-blend target) 0.0) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'query-state) - (set! (-> a1-1 param 0) (the-as uint *camera-base-mode*)) - (if (not (send-event-function *camera* a1-1)) - (send-event *camera* 'change-state *camera-base-mode* 450) - ) - ) + (if (not (send-event *camera* 'query-state *camera-base-mode*)) + (send-event *camera* 'change-state *camera-base-mode* (seconds 1.5)) + ) (set! (-> *camera-combiner* tracking tilt-adjust target) (-> *CAMERA-bank* default-tilt-adjust)) (send-event *camera* 'clear-slave-option #x10000) ) @@ -626,15 +627,9 @@ (set! (-> self stringMaxLength) (-> *CAMERA-bank* default-string-max-z)) ) (set! (-> self stringCliffHeight) (cam-slave-get-float arg0 'stringCliffHeight 163840.0)) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 1) - (set! (-> a1-7 message) 'query-state) - (set! (-> a1-7 param 0) (the-as uint *camera-base-mode*)) - (if (not (send-event-function *camera* a1-7)) - (send-event *camera* 'change-state *camera-base-mode* 450) - ) - ) + (if (not (send-event *camera* 'query-state *camera-base-mode*)) + (send-event *camera* 'change-state *camera-base-mode* (seconds 1.5)) + ) (if (logtest? #x10000 (cam-slave-get-flags (-> self cam-entity) 'flags)) (send-event *camera* 'set-slave-option #x10000) ) @@ -800,90 +795,82 @@ ;; definition for function master-check-regions (defbehavior master-check-regions camera-master () - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'query-state) - (set! (-> a1-0 param 0) (the-as uint cam-eye)) - (cond - ((send-event-function *camera* a1-0) - #f - ) - ((or (not *target*) (logtest? (-> self master-options) 1)) - (master-unset-region) - ) - ((and (logtest? (-> self master-options) 4) - (not (-> self on-ground)) - (or (not (-> self cam-entity)) (zero? (logand #x20000 (cam-slave-get-flags (-> self cam-entity) 'flags)))) - ) - #f - ) - ((and (-> self cam-entity) - (not (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 0.0 'cutoutvol)) - (or (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 1024.0 'pvol) - (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 1024.0 'vol) - (and (not ((method-of-type res-lump get-property-data) - (-> self cam-entity) - 'pvol - 'exact - 0.0 - (the-as pointer #f) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - (not ((method-of-type res-lump get-property-data) - (-> self cam-entity) - 'vol - 'exact - 0.0 - (the-as pointer #f) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - ) - ) - ) - #f - ) - (else - (let ((v1-17 (-> *camera-engine* alive-list next0))) - *camera-engine* - (let ((gp-5 (-> v1-17 next0))) - (while (!= v1-17 (-> *camera-engine* alive-list-end)) - (let ((s5-1 (-> (the-as connection v1-17) param1))) - (when (and (not (in-cam-entity-volume? (target-pos 0) (the-as entity s5-1) 1024.0 'cutoutvol)) - (in-cam-entity-volume? (target-pos 0) (the-as entity s5-1) 0.0 'vol) - ) - (if (master-switch-to-entity (the-as entity s5-1)) - (return #t) - ) - ) - ) - (set! v1-17 gp-5) - *camera-engine* - (set! gp-5 (-> gp-5 next0)) + (cond + ((send-event *camera* 'query-state cam-eye) + #f + ) + ((or (not *target*) (logtest? (-> self master-options) 1)) + (master-unset-region) + ) + ((and (logtest? (-> self master-options) 4) + (not (-> self on-ground)) + (or (not (-> self cam-entity)) (zero? (logand #x20000 (cam-slave-get-flags (-> self cam-entity) 'flags)))) + ) + #f + ) + ((and (-> self cam-entity) + (not (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 0.0 'cutoutvol)) + (or (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 1024.0 'pvol) + (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 1024.0 'vol) + (and (not ((method-of-type res-lump get-property-data) + (-> self cam-entity) + 'pvol + 'exact + 0.0 + (the-as pointer #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + (not ((method-of-type res-lump get-property-data) + (-> self cam-entity) + 'vol + 'exact + 0.0 + (the-as pointer #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) ) + ) + #f + ) + (else + (let ((v1-17 (-> *camera-engine* alive-list next0))) + *camera-engine* + (let ((gp-5 (-> v1-17 next0))) + (while (!= v1-17 (-> *camera-engine* alive-list-end)) + (let ((s5-1 (-> (the-as connection v1-17) param1))) + (when (and (not (in-cam-entity-volume? (target-pos 0) (the-as entity s5-1) 1024.0 'cutoutvol)) + (in-cam-entity-volume? (target-pos 0) (the-as entity s5-1) 0.0 'vol) + ) + (if (master-switch-to-entity (the-as entity s5-1)) + (return #t) + ) + ) + ) + (set! v1-17 gp-5) + *camera-engine* + (set! gp-5 (-> gp-5 next0)) ) ) - (master-unset-region) ) + (master-unset-region) ) ) ) ;; failed to figure out what this is: (defstate cam-master-active (camera-master) - :enter - (behavior () + :enter (behavior () (if (and (nonzero? camera-master-debug) *debug-segment*) (add-connection *debug-engine* self camera-master-debug self #f #f) ) (none) ) - :trans - (behavior () + :trans (behavior () (when (not (paused?)) (vector-negate! (-> self local-down) @@ -893,9 +880,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (and *dproc* *debug-segment*) (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) @@ -911,15 +897,9 @@ (master-track-target) (set! (-> last-try-to-look-at-data horz) 0.0) (set! (-> last-try-to-look-at-data vert) 0.0) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'slave-option?) - (set! (-> a1-1 param 0) (the-as uint #x4000)) - (when (send-event-function *camera* a1-1) - (set! (-> self string-min target y) 18432.0) - (set! (-> self string-max target y) 18432.041) - ) + (when (send-event *camera* 'slave-option? #x4000) + (set! (-> self string-min target y) 18432.0) + (set! (-> self string-max target y) 18432.041) ) (when (not (paused?)) (update! (-> self string-min) (the-as vector #f)) @@ -968,9 +948,8 @@ ;; failed to figure out what this is: (defstate list-keeper-active (camera-master) - :code - (behavior () - (while #t + :code (behavior () + (loop (change-to-last-brother self) (suspend) ) @@ -1026,34 +1005,18 @@ ) (set! (-> self pov-handle) (the-as handle #f)) (set! (-> self pov-bone) 0) - (let ((gp-1 (get-process *camera-dead-pool* list-keeper #x4000))) - (cond - ((when gp-1 - (let ((t9-5 (method-of-type list-keeper activate))) - (t9-5 (the-as list-keeper gp-1) self 'list-keeper (the-as pointer #x70004000)) - ) - (run-next-time-in-process gp-1 list-keeper-init) - (-> gp-1 ppointer) - ) - ) - (else - (format 0 "ERROR : master camera list keeper failed to activate~%") - ) + (cond + ((process-spawn-function list-keeper list-keeper-init :from *camera-dead-pool* :to self) + ) + (else + (format 0 "ERROR : master camera list keeper failed to activate~%") ) ) - (let ((gp-2 (get-process *camera-dead-pool* camera-slave #x4000))) - (cond - ((when gp-2 - (let ((t9-9 (method-of-type camera-slave activate))) - (t9-9 (the-as camera-slave gp-2) self 'camera-slave (the-as pointer #x70004000)) - ) - (run-next-time-in-process gp-2 cam-slave-init cam-free-floating #f) - (-> gp-2 ppointer) - ) - ) - (else - (format 0 "ERROR : first slave failed to activate~%") - ) + (cond + ((process-spawn-function camera-slave cam-slave-init cam-free-floating #f :from *camera-dead-pool* :to self) + ) + (else + (format 0 "ERROR : first slave failed to activate~%") ) ) (set! (-> self water-drip) (create-launch-control group-rain-screend-drop self)) diff --git a/test/decompiler/reference/engine/camera/cam-start_REF.gc b/test/decompiler/reference/engine/camera/cam-start_REF.gc index 007ca57979..6399944334 100644 --- a/test/decompiler/reference/engine/camera/cam-start_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-start_REF.gc @@ -17,30 +17,14 @@ ;; INFO: Return type mismatch int vs none. (defun cam-start ((arg0 symbol)) (cam-stop) - (let ((s5-0 (get-process *camera-dead-pool* camera-combiner #x4000))) - (when s5-0 - (let ((t9-2 (method-of-type camera-combiner activate))) - (t9-2 (the-as camera-combiner s5-0) *camera-pool* 'camera-combiner (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 cam-combiner-init) - (-> s5-0 ppointer) - ) - ) - (let ((s5-1 (get-process *camera-master-dead-pool* camera-master #x4000))) - (set! *camera* - (the-as camera-master - (ppointer->process - (when s5-1 - (let ((t9-5 (method-of-type camera-master activate))) - (t9-5 (the-as camera-master s5-1) *camera-pool* 'camera-master (the-as pointer #x70004000)) - ) - (run-next-time-in-process s5-1 cam-master-init) - (-> s5-1 ppointer) - ) - ) + (process-spawn camera-combiner :init cam-combiner-init :from *camera-dead-pool* :to *camera-pool*) + (set! *camera* + (the-as camera-master + (ppointer->process + (process-spawn-function camera-master cam-master-init :from *camera-master-dead-pool* :to *camera-pool*) ) ) - ) + ) (if arg0 (reset-cameras) ) diff --git a/test/decompiler/reference/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/engine/camera/cam-states-dbg_REF.gc index 6a6dc69db5..a90c4e5b41 100644 --- a/test/decompiler/reference/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-states-dbg_REF.gc @@ -24,8 +24,7 @@ ;; failed to figure out what this is: (defstate cam-point-watch (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -35,8 +34,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self pivot-rad) 40960.0) (set! (-> self blend-from-type) (the-as uint 1)) @@ -44,9 +42,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((s5-0 (new-stack-vector0)) (gp-0 (new-stack-vector0)) ) @@ -419,8 +416,7 @@ ;; failed to figure out what this is: (defstate cam-free-floating (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -430,8 +426,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) @@ -439,9 +434,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((a2-0 (-> *camera* local-down))) (if (logtest? (-> self options) 8) (set! a2-0 (the-as vector #f)) @@ -528,8 +522,7 @@ ;; failed to figure out what this is: (defstate cam-orbit (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -539,8 +532,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (if (not *camera-orbit-target*) (cam-slave-go cam-free-floating) @@ -554,14 +546,12 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () '() (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (not *camera-orbit-target*) (cam-slave-go cam-free-floating) ) diff --git a/test/decompiler/reference/engine/camera/cam-states_REF.gc b/test/decompiler/reference/engine/camera/cam-states_REF.gc index 7d405dab19..4741ca2a42 100644 --- a/test/decompiler/reference/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-states_REF.gc @@ -3,8 +3,7 @@ ;; failed to figure out what this is: (defstate cam-fixed (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -14,8 +13,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self saved-pt quad) (-> self trans quad)) (set! (-> self blend-from-type) (the-as uint 1)) @@ -24,9 +22,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (paused?)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> self trans quad) (-> self saved-pt quad)) @@ -45,8 +42,7 @@ ;; failed to figure out what this is: (defstate cam-fixed-read-entity (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -56,8 +52,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (cond ((-> self enter-has-run) ) @@ -80,9 +75,8 @@ (go cam-fixed) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (format *stdcon* "ERROR : stayed in cam-fixed-read-entity~%") (suspend) ) @@ -92,8 +86,7 @@ ;; failed to figure out what this is: (defstate cam-pov (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -103,25 +96,22 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) (none) ) - :trans - (behavior () + :trans (behavior () (when (not (handle->process (-> *camera* pov-handle))) (set! (-> self blend-from-type) (the-as uint 0)) (cam-slave-go cam-fixed) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (paused?)) (vector<-cspace! (-> self trans) @@ -156,8 +146,7 @@ ;; failed to figure out what this is: (defstate cam-pov180 (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -167,24 +156,21 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) (none) ) - :trans - (behavior () + :trans (behavior () (when (not (handle->process (-> *camera* pov-handle))) (set! (-> self blend-from-type) (the-as uint 0)) (cam-slave-go cam-fixed) ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) (s4-0 #t) @@ -204,7 +190,7 @@ ) (vector-normalize-copy! s5-0 (-> v1-11 vector 2) (the-as float 1.0)) ) - (while #t + (loop (when (not (paused?)) (let ((s0-0 (-> (the-as pov-camera (-> *camera* pov-handle process 0)) @@ -260,10 +246,8 @@ ;; failed to figure out what this is: (defstate cam-pov-track (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (the-as uint 2)) @@ -275,16 +259,14 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (or (not (handle->process (-> *camera* pov-handle))) (zero? (logand (-> *camera* master-options) 2))) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (not (paused?)) (vector<-cspace! (-> self trans) @@ -307,8 +289,7 @@ ;; failed to figure out what this is: (defstate cam-standoff (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('set-standoff-dist) (vector-normalize! (-> self pivot-pt) (the-as float (-> arg3 param 0))) @@ -329,8 +310,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (vector-! (-> self pivot-pt) (-> self trans) (-> *camera* tpos-curr-adj)) (cond @@ -348,16 +328,14 @@ (cam-calc-follow! (-> self tracking) (-> self trans) #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (paused?)) (cam-calc-follow! (-> self tracking) (-> self trans) #t) (cam-standoff-calc-trans) @@ -370,10 +348,8 @@ ;; failed to figure out what this is: (defstate cam-standoff-read-entity (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (cond ((-> self enter-has-run) ) @@ -408,9 +384,8 @@ (go cam-standoff) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (format *stdcon* "ERROR : stayed in cam-standoff-read-entity~%") (suspend) ) @@ -441,15 +416,13 @@ ) ;; definition for symbol *CAM_EYE-bank*, type cam-eye-bank -(define - *CAM_EYE-bank* +(define *CAM_EYE-bank* (new 'static 'cam-eye-bank :rot-speed 364.0889 :max-degrees 12743.111 :max-fov 11650.845 :min-fov 6189.511) ) ;; failed to figure out what this is: (defstate cam-eye (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -459,8 +432,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (let ((v1-3 (vector-float*! (new-stack-vector0) (-> *camera* local-down) (+ 1024.0 (-> *camera* target-height))))) (vector-! (-> self trans) (-> *camera* tpos-curr) v1-3) @@ -472,24 +444,24 @@ (set! (-> self fov) 11650.845) (none) ) - :exit - (behavior () - (if (and *target* (logtest? (-> *camera* master-options) 2) (logtest? (-> *target* state-flags) 512)) + :exit (behavior () + (if (and *target* + (logtest? (-> *camera* master-options) 2) + (logtest? (-> *target* state-flags) (state-flags first-person-mode)) + ) (send-event *target* 'end-mode) ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (go cam-free-floating) ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (-> *display* base-frame-counter))) - (while #t + (loop (when (not (paused?)) (let ((s4-0 (vector-reset! (new-stack-vector0))) (s5-0 (new-stack-matrix0)) @@ -629,8 +601,7 @@ ;; failed to figure out what this is: (defstate cam-billy (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -640,8 +611,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (let ((v1-3 (vector-float*! (new-stack-vector0) (-> *camera* local-down) (-> *camera* target-height)))) (vector-! (-> self trans) (-> *camera* tpos-curr) v1-3) @@ -654,21 +624,18 @@ (matrix-rotate-y! (the-as matrix (-> self tracking)) (the-as float -32768.0)) (none) ) - :exit - (behavior () + :exit (behavior () '() (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (paused?)) (let ((s5-0 (vector-reset! (new-stack-vector0))) (s4-0 (vector-reset! (new-stack-vector0))) @@ -751,10 +718,8 @@ ;; failed to figure out what this is: (defstate cam-spline (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (cond ((-> self enter-has-run) ) @@ -833,16 +798,14 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (paused?)) (cam-calc-follow! (-> self tracking) (-> self trans) #t) (new 'stack 'curve) @@ -857,8 +820,7 @@ ;; failed to figure out what this is: (defstate cam-decel (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -868,16 +830,14 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (if (not (-> self enter-has-run)) (set! (-> self saved-pt quad) (-> self trans quad)) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (paused?)) (let ((s5-0 (new-stack-vector0)) (gp-0 (new-stack-vector0)) @@ -913,8 +873,7 @@ ;; failed to figure out what this is: (defstate cam-endlessfall (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -924,16 +883,14 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (the-as uint 2)) ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'cam-vector-seeker)) (f30-0 (-> self velocity y)) ) @@ -947,7 +904,7 @@ (init! gp-0 s4-0 (the-as float 81.92) (fmax 819.2 (vector-length s5-0)) (the-as float 0.75)) (set! (-> gp-0 vel quad) (-> s5-0 quad)) ) - (while #t + (loop (when (not (paused?)) (set! (-> gp-0 target x) (-> (target-pos 0) x)) (set! (-> gp-0 target z) (-> (target-pos 0) z)) @@ -1155,8 +1112,7 @@ ;; failed to figure out what this is: (defstate cam-circular (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -1170,8 +1126,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (cond ((-> self enter-has-run) ) @@ -1242,16 +1197,14 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (not (paused?)) (cam-circular-code) ) @@ -1263,26 +1216,22 @@ ;; failed to figure out what this is: (defstate cam-lookat (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 2)) (set! (-> self blend-to-type) (the-as uint 2)) ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) @@ -1325,7 +1274,7 @@ ) (vector--float*! s5-0 s5-0 (-> *camera* local-down) (-> *CAMERA-bank* default-string-min-y)) (set! (-> arg0 quad) (-> s5-0 quad)) - (while #t + (loop (vector--float*! s4-0 arg0 (-> *camera* local-down) (-> *camera* target-height)) (if (< (fill-and-probe-using-line-sphere *collide-cache* @@ -1335,7 +1284,7 @@ (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process #f) s3-0 - 2 + (new 'static 'pat-surface :nocamera #x1) ) 0.0 ) @@ -1393,7 +1342,7 @@ (let ((t1-0 #x40000080)) (add-debug-flat-triangle #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> gp-0 0)) (-> gp-0 0 vertex 1) (-> gp-0 0 vertex 2) @@ -1697,7 +1646,7 @@ ) ;; definition for function cam-los-spline-collide -(defun cam-los-spline-collide ((arg0 vector) (arg1 vector) (arg2 vector)) +(defun cam-los-spline-collide ((arg0 vector) (arg1 vector) (arg2 pat-surface)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 *collide-cache*) (f30-0 2.0) @@ -1711,7 +1660,7 @@ (-> *CAM_STRING-bank* los-coll-rad2) (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process-drawable #f) - (the-as int arg2) + arg2 ) (let* ((f0-2 (vector-length s5-0)) (f28-0 @@ -1917,7 +1866,7 @@ ;; WARN: Unsupported inline assembly instruction kind - [madda.s f3, f6] ;; WARN: Unsupported inline assembly instruction kind - [madd.s f2, f4, f7] ;; Used lq/sq -(defbehavior cam-los-collide camera-slave ((arg0 vector) (arg1 vector) (arg2 clip-travel-vector-to-mesh-return-info) (arg3 int)) +(defbehavior cam-los-collide camera-slave ((arg0 vector) (arg1 vector) (arg2 clip-travel-vector-to-mesh-return-info) (arg3 pat-surface)) (local-vars (s1-3 int) (s2-2 int) (f2-1 float) (sv-224 vector) (sv-240 vector)) (dist-info-init (the-as collide-los-dist-info (-> arg2 intersection))) (dist-info-init (the-as collide-los-dist-info (-> arg2 next-normal))) @@ -2070,7 +2019,7 @@ (cam-los-spline-collide (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 (-> *camera* target-spline end-point)))) arg0 - (the-as vector 4098) + (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1) ) ) ) @@ -2103,7 +2052,7 @@ (cam-los-spline-collide (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 s2-2))) arg0 - (the-as vector 4098) + (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1) ) ) (< f30-1 0.0) @@ -2373,7 +2322,7 @@ (let ((f30-0 (vector-length (-> self view-flat)))) (vector--float*! s5-0 (-> *camera* tpos-curr) (-> *camera* local-down) (-> *camera* target-height)) (vector-! s5-0 s5-0 (-> self string-trans)) - (cam-los-collide (-> self string-trans) s5-0 gp-0 4098) + (cam-los-collide (-> self string-trans) s5-0 gp-0 (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1)) (when (-> gp-0 vert-next y) (when (or (= (-> self los-state) (slave-los-state ccw)) (= (-> self los-state) (slave-los-state cw))) (let ((a0-6 (new 'stack-no-clear 'vector))) @@ -2607,7 +2556,7 @@ (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process #f) s4-0 - 2 + (new 'static 'pat-surface :nocamera #x1) ) 0.0 ) @@ -2712,7 +2661,7 @@ (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process #f) s4-2 - 2 + (new 'static 'pat-surface :nocamera #x1) ) -100000000.0 ) @@ -2879,8 +2828,7 @@ ;; failed to figure out what this is: (defstate cam-string (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) (let ((gp-0 (new-stack-vector0))) @@ -2923,8 +2871,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (set-string-parms) (set! *camera-base-mode* cam-string) @@ -3017,7 +2964,7 @@ (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process #f) s4-0 - 4098 + (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1) ) ) ) @@ -3073,16 +3020,14 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (paused?)) (set-string-parms) (cam-string-code) @@ -3118,8 +3063,7 @@ ) ;; definition for symbol *CAM_STICK-bank*, type cam-stick-bank -(define - *CAM_STICK-bank* +(define *CAM_STICK-bank* (new 'static 'cam-stick-bank :max-z (meters 30) :min-z (meters 5) :max-y (meters 15) :min-y (meters 2)) ) @@ -3166,7 +3110,7 @@ (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process #f) s3-0 - 2 + (new 'static 'pat-surface :nocamera #x1) ) -100000000.0 ) @@ -3225,10 +3169,8 @@ ;; failed to figure out what this is: (defstate cam-stick (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self view-off-param) (-> *camera* view-off-param-save)) (set! (-> self view-off x) 0.0) @@ -3252,8 +3194,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) @@ -3330,9 +3271,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (not (paused?)) (cam-stick-code) ) @@ -3365,8 +3305,7 @@ ) ;; definition for symbol *CAM_BIKE-bank*, type cam-bike-bank -(define - *CAM_BIKE-bank* +(define *CAM_BIKE-bank* (new 'static 'cam-bike-bank :max-z (meters 6) :min-z (meters 10) :max-y (meters 3) :min-y (meters 5)) ) @@ -3450,7 +3389,7 @@ (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process #f) s4-3 - 2 + (new 'static 'pat-surface :nocamera #x1) ) -100000000.0 ) @@ -3482,10 +3421,8 @@ ;; failed to figure out what this is: (defstate cam-bike (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> *camera* foot-offset) 4096.0) (set! (-> *camera* head-offset) 16384.0) @@ -3506,16 +3443,14 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (not (paused?)) (cam-bike-code) ) diff --git a/test/decompiler/reference/engine/camera/cam-update_REF.gc b/test/decompiler/reference/engine/camera/cam-update_REF.gc index 8ab8eefb9c..0a994a3250 100644 --- a/test/decompiler/reference/engine/camera/cam-update_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-update_REF.gc @@ -299,7 +299,7 @@ (when *display-level-spheres* (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s5-1 info bsphere) (-> s5-1 info bsphere w) (new 'static 'rgba :r #xff :a #x80) diff --git a/test/decompiler/reference/engine/camera/camera_REF.gc b/test/decompiler/reference/engine/camera/camera_REF.gc index dc74a12e5d..f1a7a6ef61 100644 --- a/test/decompiler/reference/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/engine/camera/camera_REF.gc @@ -695,7 +695,7 @@ (set! (-> arg2 partial-pt) (-> obj partial-point)) ) 0.0 - (while #t + (loop (cond ((= (-> arg2 cur-pt) (-> obj end-point)) (set! (-> arg2 partial-pt) 0.0) @@ -1246,123 +1246,115 @@ ;; definition for function cam-calc-follow! ;; Used lq/sq (defun cam-calc-follow! ((arg0 cam-rotation-tracker) (arg1 vector) (arg2 symbol)) - (with-pp - (cond - (arg2 - (update! (-> arg0 tilt-adjust) 0.0) - (update! (-> arg0 point-of-interest-blend) 0.0) - (update! (-> arg0 underwater-blend) 0.0) - ) - (else - (jump-to-target! (-> arg0 tilt-adjust) 0.0) - (jump-to-target! (-> arg0 point-of-interest-blend) 0.0) - (jump-to-target! (-> arg0 underwater-blend) 0.0) - ) + (cond + (arg2 + (update! (-> arg0 tilt-adjust) 0.0) + (update! (-> arg0 point-of-interest-blend) 0.0) + (update! (-> arg0 underwater-blend) 0.0) ) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) pp) - (set! (-> a1-7 num-params) 1) - (set! (-> a1-7 message) 'slave-option?) - (set! (-> a1-7 param 0) (the-as uint #x4000)) - (cond - ((send-event-function *camera* a1-7) - (let ((s3-0 (new 'stack-no-clear 'vector)) - (s2-0 (new 'stack-no-clear 'vector)) - (f30-0 (vector-vector-distance (-> *camera* tpos-curr-adj) (-> *camera* tpos-old-adj))) - (s5-1 (new 'stack-no-clear 'vector)) - ) - (vector-flatten! s3-0 (-> *camera* tgt-face-mat vector 2) (-> *camera* local-down)) - (vector-normalize! s3-0 1.0) - (vector-! s2-0 (-> *camera* tpos-curr-adj) arg1) - (vector-flatten! s2-0 s2-0 (-> *camera* local-down)) - (vector-normalize! s2-0 1.0) - (vector-float*! s5-1 (-> *camera* tgt-face-mat vector 2) 32768.0) - (let* ((f30-1 (lerp-clamp 0.7 0.4 (parameter-ease-sin-clamp (* 0.00081380206 (+ -409.6 f30-0))))) - (f0-4 (acos (vector-dot s2-0 s3-0))) - (f28-0 (fmax 1820.4445 f0-4)) - ) - (if (< f28-0 8192.0) - (vector-float*! - s5-1 - s5-1 - (+ f30-1 - (* (/ (- 1.0 f30-1) (- 1.0 (cos 32768.0))) (+ (- (cos 32768.0)) (cos (* 5.142857 (- 8192.0 f28-0))))) - ) - ) - ) - ) - (cond - ((< (-> *camera* ease-t) 1.0) - ) - ((< (-> arg0 follow-blend) 1.0) - (let* ((f0-18 (-> arg0 follow-blend)) - (f0-19 (* f0-18 f0-18)) - (f0-20 (* f0-19 f0-19)) - ) - (vector-! s5-1 s5-1 (-> arg0 follow-off)) - (vector-float*! s5-1 s5-1 f0-20) - ) - (+! (-> arg0 follow-blend) (* 0.016666668 (-> *display* time-adjust-ratio))) - (vector+! (-> arg0 follow-off) (-> arg0 follow-off) s5-1) - ) - (else - (set! (-> arg0 follow-off quad) (-> s5-1 quad)) - ) - ) + (else + (jump-to-target! (-> arg0 tilt-adjust) 0.0) + (jump-to-target! (-> arg0 point-of-interest-blend) 0.0) + (jump-to-target! (-> arg0 underwater-blend) 0.0) + ) + ) + (cond + ((send-event *camera* 'slave-option? #x4000) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (f30-0 (vector-vector-distance (-> *camera* tpos-curr-adj) (-> *camera* tpos-old-adj))) + (s5-1 (new 'stack-no-clear 'vector)) ) - (vector+! (-> arg0 follow-pt) (-> *camera* tpos-curr-adj) (-> arg0 follow-off)) - (vector--float*! - (-> arg0 follow-pt) - (-> arg0 follow-pt) - (-> *camera* local-down) - (+ 12288.0 (-> *camera* target-height)) + (vector-flatten! s3-0 (-> *camera* tgt-face-mat vector 2) (-> *camera* local-down)) + (vector-normalize! s3-0 1.0) + (vector-! s2-0 (-> *camera* tpos-curr-adj) arg1) + (vector-flatten! s2-0 s2-0 (-> *camera* local-down)) + (vector-normalize! s2-0 1.0) + (vector-float*! s5-1 (-> *camera* tgt-face-mat vector 2) 32768.0) + (let* ((f30-1 (lerp-clamp 0.7 0.4 (parameter-ease-sin-clamp (* 0.00081380206 (+ -409.6 f30-0))))) + (f0-4 (acos (vector-dot s2-0 s3-0))) + (f28-0 (fmax 1820.4445 f0-4)) + ) + (if (< f28-0 8192.0) + (vector-float*! + s5-1 + s5-1 + (+ f30-1 + (* (/ (- 1.0 f30-1) (- 1.0 (cos 32768.0))) (+ (- (cos 32768.0)) (cos (* 5.142857 (- 8192.0 f28-0))))) + ) + ) + ) + ) + (cond + ((< (-> *camera* ease-t) 1.0) + ) + ((< (-> arg0 follow-blend) 1.0) + (let* ((f0-18 (-> arg0 follow-blend)) + (f0-19 (* f0-18 f0-18)) + (f0-20 (* f0-19 f0-19)) + ) + (vector-! s5-1 s5-1 (-> arg0 follow-off)) + (vector-float*! s5-1 s5-1 f0-20) + ) + (+! (-> arg0 follow-blend) (* 0.016666668 (-> *display* time-adjust-ratio))) + (vector+! (-> arg0 follow-off) (-> arg0 follow-off) s5-1) + ) + (else + (set! (-> arg0 follow-off quad) (-> s5-1 quad)) ) ) - (else - 0.0 - (let ((s3-2 (new-stack-vector0))) - (set! (-> arg0 follow-blend) 0.0) - (cond - ((-> arg0 no-follow) - (vector-reset! s3-2) - ) - (else - (vector-! s3-2 (-> *camera* tpos-curr-adj) arg1) - (vector-normalize! s3-2 1.0) - (let* ((f0-28 (vector-dot (-> *camera* tgt-rot-mat vector 2) s3-2)) - (f30-2 (cond - ((< f0-28 0.0) - 1.0 - ) - (else - (let* ((f0-29 (* f0-28 f0-28)) (f0-30 (- 1.0 f0-29))) (* f0-30 (* f0-30 f0-30))) - ) - ) + ) + (vector+! (-> arg0 follow-pt) (-> *camera* tpos-curr-adj) (-> arg0 follow-off)) + (vector--float*! + (-> arg0 follow-pt) + (-> arg0 follow-pt) + (-> *camera* local-down) + (+ 12288.0 (-> *camera* target-height)) + ) + ) + (else + 0.0 + (let ((s3-2 (new-stack-vector0))) + (set! (-> arg0 follow-blend) 0.0) + (cond + ((-> arg0 no-follow) + (vector-reset! s3-2) + ) + (else + (vector-! s3-2 (-> *camera* tpos-curr-adj) arg1) + (vector-normalize! s3-2 1.0) + (let* ((f0-28 (vector-dot (-> *camera* tgt-rot-mat vector 2) s3-2)) + (f30-2 (cond + ((< f0-28 0.0) + 1.0 + ) + (else + (let* ((f0-29 (* f0-28 f0-28)) (f0-30 (- 1.0 f0-29))) (* f0-30 (* f0-30 f0-30))) ) - ) - (vector-! s3-2 arg1 (-> *camera* tpos-curr-adj)) - (vector-flatten! s3-2 s3-2 (-> *camera* local-down)) - (let* ((f0-33 (* 0.000022194603 (+ -20480.0 (vector-length s3-2)))) - (f0-34 (fmin 1.0 f0-33)) - (f0-35 (fmax 0.0 f0-34)) - ) - (vector-float*! s3-2 (-> *camera* tgt-rot-mat vector 2) (* (lerp 2048.0 8192.0 f0-35) f30-2)) - ) - ) + ) + ) + ) + (vector-! s3-2 arg1 (-> *camera* tpos-curr-adj)) + (vector-flatten! s3-2 s3-2 (-> *camera* local-down)) + (let* ((f0-33 (* 0.000022194603 (+ -20480.0 (vector-length s3-2)))) + (f0-34 (fmin 1.0 f0-33)) + (f0-35 (fmax 0.0 f0-34)) + ) + (vector-float*! s3-2 (-> *camera* tgt-rot-mat vector 2) (* (lerp 2048.0 8192.0 f0-35) f30-2)) ) ) - (if arg2 - (vector-seek-3d-smooth! (-> arg0 follow-off) s3-2 (* 20480.0 (-> *display* seconds-per-frame)) 0.05) - (set! (-> arg0 follow-off quad) (-> s3-2 quad)) - ) ) - (vector+! (-> arg0 follow-pt) (-> *camera* tpos-curr-adj) (-> arg0 follow-off)) - (vector--float*! (-> arg0 follow-pt) (-> arg0 follow-pt) (-> *camera* local-down) (-> *camera* target-height)) ) + (if arg2 + (vector-seek-3d-smooth! (-> arg0 follow-off) s3-2 (* 20480.0 (-> *display* seconds-per-frame)) 0.05) + (set! (-> arg0 follow-off quad) (-> s3-2 quad)) + ) ) + (vector+! (-> arg0 follow-pt) (-> *camera* tpos-curr-adj) (-> arg0 follow-off)) + (vector--float*! (-> arg0 follow-pt) (-> arg0 follow-pt) (-> *camera* local-down) (-> *camera* target-height)) ) - (-> arg0 follow-pt) ) + (-> arg0 follow-pt) ) ;; definition for function mat-remove-z-rot diff --git a/test/decompiler/reference/engine/camera/pov-camera-h_REF.gc b/test/decompiler/reference/engine/camera/pov-camera-h_REF.gc index e3c29f5e56..2650d5558c 100644 --- a/test/decompiler/reference/engine/camera/pov-camera-h_REF.gc +++ b/test/decompiler/reference/engine/camera/pov-camera-h_REF.gc @@ -9,7 +9,7 @@ (notify-handle handle :offset-assert 192) (anim-name string :offset-assert 200) (command-list pair :offset-assert 204) - (mask-to-clear uint32 :offset-assert 208) + (mask-to-clear process-mask :offset-assert 208) (music-volume-movie float :offset-assert 212) (sfx-volume-movie float :offset-assert 216) ) diff --git a/test/decompiler/reference/engine/camera/pov-camera_REF.gc b/test/decompiler/reference/engine/camera/pov-camera_REF.gc index 44d3e8e561..f5182f5819 100644 --- a/test/decompiler/reference/engine/camera/pov-camera_REF.gc +++ b/test/decompiler/reference/engine/camera/pov-camera_REF.gc @@ -30,8 +30,7 @@ ;; failed to figure out what this is: (defstate pov-camera-startup (pov-camera) :virtual #t - :code - (behavior () + :code (behavior () (go-virtual pov-camera-start-playing) (none) ) @@ -40,8 +39,7 @@ ;; failed to figure out what this is: (defstate pov-camera-start-playing (pov-camera) :virtual #t - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (while (not (target-grabbed? self)) (suspend) @@ -52,16 +50,7 @@ (set! gp-0 (+ (-> v1-7 number) 1)) ) ) - (let* ((s5-0 (get-process *default-dead-pool* othercam #x4000)) - (v1-10 (when s5-0 - (let ((t9-3 (method-of-type othercam activate))) - (t9-3 (the-as othercam s5-0) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 othercam-init-by-other self gp-0 #t #t) - (-> s5-0 ppointer) - ) - ) - ) + (let ((v1-10 (process-spawn othercam self gp-0 #t #t :to self))) (send-event (ppointer->process v1-10) 'mask (-> self mask-to-clear)) ) ) @@ -74,40 +63,16 @@ ;; INFO: Return type mismatch int vs none. (defbehavior pov-camera-play-and-reposition pov-camera ((arg0 art-joint-anim) (arg1 vector) (arg2 float)) (let ((s4-0 #f)) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) arg0) - (set! (-> v1-2 param 0) (the float (+ (-> arg0 data 0 length) -1))) - (set! (-> v1-2 param 1) arg2) - (set! (-> v1-2 frame-num) 0.0) - (joint-control-channel-group! v1-2 arg0 num-func-seek!) - ) + (ja-no-eval :group! arg0 :num! (seek! max arg2) :frame-num 0.0) (until (ja-done? 0) - (let ((v1-4 (and (not s4-0) (< (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -4 - ) - ) - (ja-frame-num 0) - ) - ) - ) - ) + (let ((v1-4 (and (not s4-0) (< (the float (+ (-> (ja-group) data 0 length) -4)) (ja-frame-num 0))))) (when v1-4 (set! s4-0 #t) (send-event *camera* 'teleport-to-vector-start-string arg1) ) ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) arg2) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max arg2)) ) ) 0 @@ -117,8 +82,7 @@ ;; failed to figure out what this is: (defstate pov-camera-playing (pov-camera) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('abort) (when (logtest? (-> self flags) (pov-camera-flag notify-of-abort)) @@ -130,63 +94,31 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self debounce-start-time) (-> *display* base-frame-counter)) (if (= (-> self anim-name type) string) (backup-load-state-and-set-cmds *load-state* (-> self command-list)) ) (none) ) - :exit - (behavior () + :exit (behavior () (if (= (-> self anim-name type) string) (restore-load-state-and-cleanup *load-state*) ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) (none) ) - :code - (behavior () - (push-setting! *setting-control* self 'music-volume 'rel (-> self music-volume-movie) 0) - (push-setting! *setting-control* self 'sfx-volume 'rel (-> self sfx-volume-movie) 0) + :code (behavior () + (add-setting! 'music-volume 'rel (-> self music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> self sfx-volume-movie) 0) (cond ((= (-> self anim-name type) string) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! - a0-4 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (check-for-abort self) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((= (-> self anim-name type) spool-anim) @@ -201,8 +133,7 @@ (go-virtual pov-camera-done-playing) (none) ) - :post - (behavior () + :post (behavior () (if (= (-> self anim-name type) string) (execute-commands-up-to *load-state* (ja-aframe-num 0)) ) @@ -214,14 +145,12 @@ ;; failed to figure out what this is: (defstate pov-camera-abort (pov-camera) :virtual #t - :enter - (behavior () + :enter (behavior () (logior! (-> self flags) (pov-camera-flag allow-abort)) (none) ) - :code - (behavior () - (set-blackout-frames (seconds 0.033333335)) + :code (behavior () + (set-blackout-frames (seconds 0.035)) (suspend) (suspend) (go-virtual pov-camera-done-playing) @@ -232,8 +161,7 @@ ;; failed to figure out what this is: (defstate pov-camera-done-playing (pov-camera) :virtual #t - :code - (behavior () + :code (behavior () (while (begin self (not ((method-of-object self target-released?)))) (suspend) ) @@ -304,14 +232,14 @@ ((= (-> arg2 type) spool-anim) ) ) - (set! (-> self mask-to-clear) (the-as uint #x4a0800)) + (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) (set! (-> self event-hook) (lambda :behavior pov-camera ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'mask) (let ((v0-0 (the-as number (-> arg3 param 0)))) - (set! (-> self mask-to-clear) (the-as uint v0-0)) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) v0-0 ) ) diff --git a/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc b/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc index fb6f9858c7..acc608f5fe 100644 --- a/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc @@ -7,7 +7,7 @@ (num-spheres uint32 :offset-assert 4) (collide-with collide-kind :offset-assert 8) (proc process-drawable :offset-assert 16) - (ignore-pat uint32 :offset-assert 20) + (ignore-pat pat-surface :offset-assert 20) (solid-only basic :offset-assert 24) ) :method-count-assert 9 @@ -183,17 +183,17 @@ :flag-assert #x2100008670 (:methods (debug-draw (_type_) none 9) - (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result int) float 10) + (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result pat-surface) float 10) (fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol 11) - (fill-and-probe-using-y-probe (_type_ vector float collide-kind process collide-tri-result uint) float 12) + (fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float 12) (fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none 13) - (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable int) none 14) + (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable pat-surface) none 14) (fill-using-spheres (_type_ collide-using-spheres-params) none 15) - (fill-using-y-probe (_type_ vector float collide-kind process-drawable uint) none 16) + (fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none 16) (initialize (_type_) none 17) - (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result int) float 18) + (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float 18) (probe-using-spheres (_type_ collide-using-spheres-params) symbol 19) - (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result uint) float 20) + (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20) (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none 21) (fill-from-foreground-using-box (_type_) none 22) (fill-from-foreground-using-line-sphere (_type_) none 23) diff --git a/test/decompiler/reference/engine/collide/collide-edge-grab-h_REF.gc b/test/decompiler/reference/engine/collide/collide-edge-grab-h_REF.gc index 9949706df7..51e2a5b615 100644 --- a/test/decompiler/reference/engine/collide/collide-edge-grab-h_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-edge-grab-h_REF.gc @@ -222,26 +222,17 @@ (define *collide-edge-work* (new 'static 'collide-edge-work :max-dist-sqrd-to-outward-pt 37748736.0 :max-dir-cosa-delta 0.6 - :split-dists - (new 'static 'array float 2 1024.0 1433.6) - :outward-offset - (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0) - :local-cache-fill-box - (new 'static 'bounding-box - :min - (new 'static 'vector :x -8192.0 :y -11059.2 :z -8192.0 :w 1.0) - :max - (new 'static 'vector :x 8192.0 :y 24576.0 :z 8192.0 :w 1.0) + :split-dists (new 'static 'array float 2 1024.0 1433.6) + :outward-offset (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0) + :local-cache-fill-box (new 'static 'bounding-box + :min (new 'static 'vector :x -8192.0 :y -11059.2 :z -8192.0 :w 1.0) + :max (new 'static 'vector :x 8192.0 :y 24576.0 :z 8192.0 :w 1.0) ) - :local-within-reach-box - (new 'static 'bounding-box - :min - (new 'static 'vector :x -6144.0 :y 5324.8 :z -6144.0 :w 1.0) - :max - (new 'static 'vector :x 6144.0 :y 11059.2 :z 6144.0 :w 1.0) + :local-within-reach-box (new 'static 'bounding-box + :min (new 'static 'vector :x -6144.0 :y 5324.8 :z -6144.0 :w 1.0) + :max (new 'static 'vector :x 6144.0 :y 11059.2 :z 6144.0 :w 1.0) ) - :local-player-spheres - (new 'static 'inline-array sphere 12 + :local-player-spheres (new 'static 'inline-array sphere 12 (new 'static 'sphere :x 1720.32 :y -819.2 :w 1433.6) (new 'static 'sphere :x 2293.76 :y -3276.8 :w 1884.16) (new 'static 'sphere :x 1966.08 :y -6144.0 :w 1556.48) diff --git a/test/decompiler/reference/engine/collide/collide-edge-grab_REF.gc b/test/decompiler/reference/engine/collide/collide-edge-grab_REF.gc new file mode 100644 index 0000000000..35773a7119 --- /dev/null +++ b/test/decompiler/reference/engine/collide/collide-edge-grab_REF.gc @@ -0,0 +1,810 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 20 of type target +;; INFO: Return type mismatch int vs object. +;; Used lq/sq +(defmethod find-edge-grabs! target ((obj target) (arg0 collide-cache)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (let ((gp-0 *collide-edge-work*)) + (set! (-> gp-0 num-verts) (the-as uint 0)) + (set! (-> gp-0 num-edges) (the-as uint 0)) + (set! (-> gp-0 num-tris) (the-as uint 0)) + (let ((v1-0 (-> obj control))) + (set! (-> gp-0 ccache) arg0) + (.lvf vf1 (&-> gp-0 local-cache-fill-box min quad)) + (.lvf vf2 (&-> gp-0 local-cache-fill-box max quad)) + (set! (-> gp-0 cshape) v1-0) + (.lvf vf3 (&-> v1-0 trans quad)) + ) + (.add.vf vf1 vf1 vf3 :mask #b111) + (.add.vf vf2 vf2 vf3 :mask #b111) + (.svf (&-> gp-0 cache-fill-box min quad) vf1) + (.svf (&-> gp-0 cache-fill-box max quad) vf2) + (.lvf vf4 (&-> gp-0 local-within-reach-box min quad)) + (.lvf vf5 (&-> gp-0 local-within-reach-box max quad)) + (.add.vf vf4 vf4 vf3 :mask #b111) + (.add.vf vf5 vf5 vf3 :mask #b111) + (.ftoi.vf vf6 vf4) + (.ftoi.vf vf7 vf5) + (.svf (&-> gp-0 within-reach-box min quad) vf4) + (.svf (&-> gp-0 within-reach-box max quad) vf5) + (.svf (&-> gp-0 within-reach-box4w min quad) vf6) + (.svf (&-> gp-0 within-reach-box4w max quad) vf7) + (fill-using-bounding-box + arg0 + (-> gp-0 cache-fill-box) + (-> obj control root-prim collide-with) + obj + (new 'static 'pat-surface :noentity #x1) + ) + (find-grabbable-tris! gp-0) + (when (nonzero? (-> gp-0 num-tris)) + (find-grabbable-edges! gp-0) + (when (nonzero? (-> gp-0 num-edges)) + (set! (-> gp-0 search-pt quad) (-> *target* control unknown-vector90 quad)) + (when (!= (-> *cpad-list* cpads (-> *target* control unknown-cpad-info00 number) stick0-speed) 0.0) + (set! (-> gp-0 search-dir-vec quad) (-> *target* control unknown-vector20 quad)) + (search-for-edges gp-0 (-> gp-0 hold-list)) + (when (find-best-grab! gp-0 (-> gp-0 hold-list) *edge-grab-info*) + (send-event *target* 'edge-grab) + (return (the-as object #f)) + ) + ) + (vector-z-quaternion! (-> gp-0 search-dir-vec) (-> *target* control unknown-quaternion00)) + (search-for-edges gp-0 (-> gp-0 hold-list)) + (if (find-best-grab! gp-0 (-> gp-0 hold-list) *edge-grab-info*) + (send-event *target* 'edge-grab) + ) + 0 + ) + ) + ) + 0 + ) + ) + +;; definition for method 9 of type collide-edge-work +(defmethod search-for-edges collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-list)) + (set! (-> arg0 num-allocs) (the-as uint 0)) + (set! (-> arg0 num-attempts) (the-as uint 0)) + (set! (-> arg0 head) #f) + (let ((s4-0 (the-as collide-edge-hold-item (-> arg0 items))) + (s3-0 (the-as collide-edge-edge (-> obj edges))) + ) + (countdown (s2-0 (-> obj num-edges)) + (when (not (-> s3-0 ignore)) + (compute-center-point! obj s3-0 (-> s4-0 center-pt)) + (when (should-add-to-list? obj s4-0 s3-0) + (add-to-list! arg0 s4-0) + (+! (-> arg0 num-allocs) 1) + (when (= (-> arg0 num-allocs) 32) + (format 0 "ERROR: Reached limit of edge grab hold items!~%") + (return #f) + ) + (&+! s4-0 48) + ) + ) + (&+! s3-0 48) + ) + ) + #f + ) + +;; definition for method 10 of type collide-edge-hold-list +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition of type pbhp-stack-vars +(deftype pbhp-stack-vars (structure) + ((edge collide-edge-edge :offset-assert 0) + (allocated basic :offset-assert 4) + (neg-hold-pt vector :inline :offset-assert 16) + (split-vec vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type pbhp-stack-vars +(defmethod inspect pbhp-stack-vars ((obj pbhp-stack-vars)) + (format #t "[~8x] ~A~%" obj 'pbhp-stack-vars) + (format #t "~Tedge: #~%" (-> obj edge)) + (format #t "~Tallocated: ~A~%" (-> obj allocated)) + (format #t "~Tneg-hold-pt: #~%" (-> obj neg-hold-pt)) + (format #t "~Tsplit-vec: #~%" (-> obj split-vec)) + obj + ) + +;; definition for method 18 of type collide-edge-work +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for method 19 of type collide-edge-work +;; Used lq/sq +(defmethod check-grab-for-collisions collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) + (local-vars (sv-144 (function vector vector vector float vector)) (sv-160 vector) (sv-176 vector)) + (let* ((s3-0 (-> arg0 edge)) + (s1-0 (-> s3-0 etri ctri)) + (s4-0 (-> s1-0 prim-index)) + ) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (vector+*! s0-0 (-> arg0 center-pt) (-> s3-0 edge-vec-norm) 1105.92) + (let ((f0-0 (dummy-14 obj (-> arg1 right-hand-hold) s0-0 (the-as int s4-0)))) + (if (< 491.52 f0-0) + (return #f) + ) + ) + (set! sv-144 vector+*!) + (set! sv-160 s0-0) + (set! sv-176 (-> arg0 center-pt)) + (let ((a2-3 (vector-negate! (new 'stack-no-clear 'vector) (-> s3-0 edge-vec-norm))) + (a3-2 1105.92) + ) + (sv-144 sv-160 sv-176 a2-3 a3-2) + ) + (let ((f0-1 (dummy-14 obj (-> arg1 left-hand-hold) s0-0 (the-as int s4-0)))) + (if (< 491.52 f0-1) + (return #f) + ) + ) + ) + (set! (-> arg1 tri-vertex 0 quad) (-> s1-0 vertex 0 quad)) + (set! (-> arg1 world-vertex 4 quad) (-> s1-0 vertex 1 quad)) + (set! (-> arg1 world-vertex 5 quad) (-> s1-0 vertex 2 quad)) + (set! (-> arg1 edge-tri-pat) (the-as uint (-> s1-0 pat))) + (set! (-> arg1 center-hold quad) (-> arg0 center-pt quad)) + (set! (-> arg1 world-vertex 0 quad) (-> s3-0 vertex-ptr 0 0 quad)) + (set! (-> arg1 world-vertex 1 quad) (-> s3-0 vertex-ptr 1 0 quad)) + (set! (-> arg1 hanging-matrix vector 1 quad) (-> *target* control dynam gravity-normal quad)) + (vector-normalize! + (vector-! (-> arg1 hanging-matrix vector 2) (-> arg1 world-vertex 1) (the-as vector (-> arg1 world-vertex))) + 1.0 + ) + (vector-normalize! + (vector-cross! + (the-as vector (-> arg1 hanging-matrix)) + (-> arg1 hanging-matrix vector 2) + (-> arg1 hanging-matrix vector 1) + ) + 1.0 + ) + (vector-cross! + (-> arg1 hanging-matrix vector 2) + (the-as vector (-> arg1 hanging-matrix)) + (-> arg1 hanging-matrix vector 1) + ) + (set! (-> arg1 hanging-matrix vector 3 quad) (-> arg1 center-hold quad)) + (transform-vectors! (-> arg1 hanging-matrix) (-> obj world-player-spheres) (-> obj local-player-spheres) 12) + (let ((a1-13 (new 'stack-no-clear 'collide-using-spheres-params))) + (set! (-> a1-13 spheres) (-> obj world-player-spheres)) + (set! (-> a1-13 num-spheres) (the-as uint 12)) + (set! (-> a1-13 collide-with) (-> obj cshape root-prim collide-with)) + (set! (-> a1-13 proc) #f) + (set! (-> a1-13 ignore-pat) (new 'static 'pat-surface :noentity #x1)) + (set! (-> a1-13 solid-only) #t) + (if (probe-using-spheres (-> obj ccache) a1-13) + (return #f) + ) + ) + (let* ((v1-36 (the-as object (-> obj ccache prims s4-0 prim))) + (a0-35 (-> (the-as collide-shape-prim v1-36) cshape)) + ) + (cond + (a0-35 + (set! (-> arg1 actor-cshape-prim-offset) (- (the-as int v1-36) (the-as uint (the-as int (-> a0-35 process))))) + (set! (-> arg1 actor-handle) (process->handle (-> a0-35 process))) + (let ((a1-19 + (-> a0-35 process node-list data (-> (the-as collide-shape-prim v1-36) transform-index) bone transform) + ) + (s5-1 (new 'stack-no-clear 'matrix)) + ) + (matrix-4x4-inverse! s5-1 a1-19) + (dotimes (s4-1 6) + (vector-matrix*! (-> arg1 local-vertex s4-1) (-> arg1 world-vertex s4-1) s5-1) + ) + ) + ) + (else + (set! (-> arg1 actor-cshape-prim-offset) 0) + (set! (-> arg1 actor-handle) (the-as handle #f)) + ) + ) + ) + ) + #t + ) + +;; definition for method 9 of type edge-grab-info +;; Used lq/sq +(defmethod dummy-9 edge-grab-info ((obj edge-grab-info)) + (local-vars (v0-0 symbol) (v1-14 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (the-as object #f))) + (set! (-> obj center-hold-old quad) (-> obj center-hold quad)) + (let ((v1-1 (-> obj actor-cshape-prim-offset))) + (when (nonzero? v1-1) + (let ((a0-5 (handle->process (-> obj actor-handle)))) + (if (not (the-as process a0-5)) + (return #f) + ) + (set! s5-0 (+ (the-as int a0-5) v1-1)) + (if (zero? (-> (the-as collide-shape-prim s5-0) prim-core collide-as)) + (return #f) + ) + (let ((s4-0 + (-> (the-as process-drawable a0-5) + node-list + data + (-> (the-as collide-shape-prim s5-0) transform-index) + bone + transform + ) + ) + ) + (dotimes (s3-0 6) + (vector-matrix*! (-> obj world-vertex s3-0) (-> obj local-vertex s3-0) s4-0) + ) + ) + ) + (.lvf vf1 (&-> obj world-vertex 3 quad)) + (.lvf vf2 (&-> obj world-vertex 4 quad)) + (.lvf vf3 (&-> obj world-vertex 5 quad)) + (.sub.vf vf4 vf2 vf1) + (.sub.vf vf5 vf3 vf1) + (.outer.product.a.vf acc vf4 vf5) + (.outer.product.b.vf vf6 vf5 vf4 acc) + (.mul.vf vf7 vf6 vf6) + (.mul.x.vf acc vf0 vf7 :mask #b1000) + (.add.mul.y.vf acc vf0 vf7 acc :mask #b1000) + (.add.mul.z.vf vf7 vf0 vf7 acc :mask #b1000) + (.isqrt.vf Q vf0 vf7 :fsf #b11 :ftf #b11) + (let ((f1-0 0.707)) + (.wait.vf) + (nop!) + (.mul.vf vf6 vf6 Q :mask #b111) + (.mov v1-14 vf6) + (b! (>= (the-as float (gpr->fpr (sar (the-as int v1-14) 32))) f1-0) cfg-17) + ) + (set! v0-0 #f) + (b! #t cfg-27 :delay (nop!)) + (label cfg-17) + (set! (-> obj hanging-matrix vector 1 quad) (-> *target* control dynam gravity-normal quad)) + (vector-normalize! + (vector-! (-> obj hanging-matrix vector 2) (-> obj world-vertex 1) (the-as vector (-> obj world-vertex))) + 1.0 + ) + (vector-normalize! + (vector-cross! + (the-as vector (-> obj hanging-matrix)) + (-> obj hanging-matrix vector 2) + (-> obj hanging-matrix vector 1) + ) + 1.0 + ) + (vector-cross! + (-> obj hanging-matrix vector 2) + (the-as vector (-> obj hanging-matrix)) + (-> obj hanging-matrix vector 1) + ) + (set! (-> obj hanging-matrix vector 3 quad) (-> obj center-hold quad)) + (let ((v1-21 *collide-edge-work*)) + (transform-vectors! + (-> obj hanging-matrix) + (-> v1-21 world-player-spheres) + (-> v1-21 local-player-spheres) + 12 + ) + ) + ) + ) + (let ((v1-22 *collide-edge-work*) + (a1-14 (new 'stack-no-clear 'collide-using-spheres-params)) + ) + (let ((a0-24 'target-edge-grab-jump)) + (b! (!= (-> *target* next-state name) a0-24) cfg-20 :delay (nop!)) + ) + (set! (-> a1-14 spheres) (-> v1-22 world-player-leap-up-spheres)) + (set! (-> a1-14 num-spheres) (the-as uint 6)) + (set! (-> a1-14 collide-with) (-> v1-22 cshape root-prim collide-with)) + (set! (-> a1-14 proc) #f) + (set! (-> a1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1)) + (set! (-> a1-14 solid-only) #t) + (b! #t cfg-21 :delay (nop!)) + (label cfg-20) + (set! (-> a1-14 spheres) (-> v1-22 world-player-spheres)) + (set! (-> a1-14 num-spheres) (the-as uint 6)) + (set! (-> a1-14 collide-with) (-> v1-22 cshape root-prim collide-with)) + (set! (-> a1-14 proc) #f) + (set! (-> a1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1)) + (set! (-> a1-14 solid-only) #t) + (label cfg-21) + (b! (not (fill-and-probe-using-spheres *collide-cache* a1-14)) cfg-24 :delay (empty-form)) + ) + (set! v0-0 #f) + (b! #t cfg-27 :delay (nop!)) + (the-as none 0) + (label cfg-24) + (b! (not (the-as int s5-0)) cfg-26 :delay (empty-form)) + (let ((v1-40 (-> (the-as collide-shape-prim s5-0) cshape))) + (send-event (-> v1-40 process) 'edge-grabbed obj) + ) + ) + (label cfg-26) + (set! v0-0 #t) + (label cfg-27) + v0-0 + ) + ) + +;; definition for method 16 of type collide-edge-work +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for method 15 of type collide-edge-work +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for method 14 of type collide-edge-work +;; Used lq/sq +(defmethod dummy-14 collide-edge-work ((obj collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) + (let ((f30-0 -1.0)) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (dotimes (s1-0 (the-as int (-> obj num-edges))) + (let ((v1-3 (-> obj edges s1-0))) + (when (not (-> v1-3 ignore)) + (when (= (-> v1-3 etri ctri prim-index) arg2) + (let ((f0-0 (vector-segment-distance-point! arg1 (-> v1-3 vertex-ptr 0 0) (-> v1-3 vertex-ptr 1 0) s2-0))) + (when (or (< f30-0 0.0) (< f0-0 f30-0)) + (set! f30-0 f0-0) + (set! (-> arg0 quad) (-> s2-0 quad)) + ) + ) + ) + ) + ) + ) + ) + f30-0 + ) + ) + +;; definition for method 17 of type collide-edge-work +;; Used lq/sq +(defmethod should-add-to-list? collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-item) (arg1 collide-edge-edge)) + (local-vars + (v1-1 uint128) + (v1-2 uint128) + (v1-4 float) + (v1-5 float) + (v1-6 float) + (a3-1 uint128) + (t0-0 uint128) + (t1-1 uint128) + ) + (rlet ((Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (nop!) + (nop!) + (.lvf vf1 (&-> arg0 center-pt quad)) + (nop!) + (let ((a3-0 (-> obj within-reach-box4w min quad))) + (nop!) + (let ((t1-0 (-> obj within-reach-box4w max quad))) + (.ftoi.vf vf2 vf1) + (let ((v1-0 (-> obj cshape))) + (.mov t0-0 vf2) + (.lvf vf3 (&-> arg1 outward quad)) + (.pcgtw t1-1 t0-0 t1-0) + (.lvf vf4 (&-> obj outward-offset quad)) + (.pcgtw a3-1 a3-0 t0-0) + (.lvf vf5 (&-> v1-0 trans quad)) + ) + ) + ) + (.por v1-1 t1-1 a3-1) + (let ((f0-0 (-> obj max-dist-sqrd-to-outward-pt))) + (.ppach v1-2 (the-as uint128 0) v1-1) + (let ((f1-0 (-> obj max-dir-cosa-delta))) + (b! (nonzero? (shl (the-as int v1-2) 16)) cfg-4 :delay (.lvf vf6 (&-> obj search-dir-vec quad))) + (.mul.x.vf vf10 vf3 vf4) + (.lvf vf11 (&-> obj search-pt quad)) + (.add.vf vf10 vf10 vf1) + (.sub.vf vf7 vf5 vf10) + (.mul.vf vf7 vf7 vf7) + (.add.z.vf vf7 vf7 vf7 :mask #b1) + (.mov v1-4 vf7) + (b! (< f0-0 v1-4) cfg-4) + (.sub.vf vf8 vf1 vf5) + (.mul.vf vf7 vf8 vf8) + (.add.z.vf vf7 vf7 vf7 :mask #b1) + (.isqrt.vf Q vf0 vf7 :fsf #b11 :ftf #b0) + (nop!) + (.wait.vf) + (nop!) + (.mul.vf vf8 vf8 Q :mask #b101) + (.mul.vf vf9 vf8 vf6) + (.add.z.vf vf9 vf9 vf9 :mask #b1) + (.mov v1-5 vf9) + (b! (< v1-5 f1-0) cfg-4) + ) + ) + (.sub.vf vf7 vf11 vf1) + (.svf (&-> arg0 center-pt quad) vf1) + (.mul.vf vf7 vf7 vf7) + (set! (-> arg0 split) 0) + (.svf (&-> arg0 outward-pt quad) vf10) + (.add.z.vf vf7 vf7 vf7 :mask #b1) + (set! (-> arg0 edge) arg1) + (.mov v1-6 vf7) + (set! (-> arg0 rating) v1-6) + (let ((v0-0 #t)) + (b! #t cfg-6 :delay (nop!)) + (label cfg-4) + (set! v0-0 #f) + (b! #t cfg-6 :delay (nop!)) + (set! v0-0 (the-as symbol 0)) + (label cfg-6) + v0-0 + ) + ) + ) + +;; definition for method 13 of type collide-edge-work +(defmethod compute-center-point! collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) + (local-vars (v0-0 float) (v1-1 float) (v1-2 float) (v1-3 float)) + (rlet ((Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (.mov.vf vf7 vf0) + (.lvf vf1 (&-> obj search-pt quad)) + (let ((f0-0 0.0)) + (let ((v1-0 (-> arg0 vertex-ptr 0)) + (a0-1 (-> arg0 vertex-ptr 1)) + ) + (.lvf vf2 (&-> v1-0 0 quad)) + (.lvf vf3 (&-> a0-1 0 quad)) + ) + (.sub.vf vf4 vf1 vf2) + (.sub.vf vf5 vf3 vf2) + (.mul.vf vf6 vf5 vf5) + (.add.z.vf vf6 vf6 vf6 :mask #b1) + (.sqrt.vf Q vf6 :ftf #b0) + (nop!) + (.wait.vf) + (nop!) + (.add.vf vf6 vf0 Q :mask #b1) + (.nop.vf) + (.mov v1-1 vf6) + (let ((f1-0 v1-1)) + (.div.vf Q vf0 vf6 :fsf #b11 :ftf #b0) + (.wait.vf) + (nop!) + (.add.vf vf8 vf0 Q :mask #b1) + (.mul.x.vf vf9 vf5 vf8) + (.mov v1-2 vf8) + (.mul.vf vf10 vf9 vf4) + (.add.z.vf vf10 vf10 vf10 :mask #b1) + (let ((f2-0 v1-2)) + (.mov v1-3 vf10) + (let ((f3-0 v1-3)) + (b! (< f3-0 f0-0) cfg-4 :likely-delay (set! f3-0 f0-0)) + (b! (< f1-0 f3-0) cfg-4 :likely-delay (set! f3-0 f1-0)) + (label cfg-4) + (let ((v1-4 (* f3-0 f2-0))) + (.mov vf11 v1-4) + ) + ) + ) + ) + ) + (.mul.x.vf vf7 vf5 vf11 :mask #b111) + (.add.vf vf7 vf7 vf2 :mask #b111) + (.svf (&-> arg1 quad) vf7) + (.mov v0-0 vf7) + v0-0 + ) + ) + +;; definition for method 10 of type edge-grab-info +;; INFO: Return type mismatch object vs symbol. +(defmethod debug-draw edge-grab-info ((obj edge-grab-info)) + (add-debug-line + #t + (bucket-id debug-no-zbuf) + (the-as vector (-> obj world-vertex)) + (-> obj world-vertex 1) + (new 'static 'rgba :r #xff :a #x60) + #f + (the-as rgba -1) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf) + (-> obj center-hold) + 204.8 + (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf) + (-> obj left-hand-hold) + 204.8 + (new 'static 'rgba :r #xff :g #xff :a #x60) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf) + (-> obj right-hand-hold) + 204.8 + (new 'static 'rgba :r #xff :g #xff :a #x60) + ) + (add-debug-outline-triangle + #t + (bucket-id debug-no-zbuf) + (the-as vector (-> obj tri-vertex)) + (-> obj world-vertex 4) + (-> obj world-vertex 5) + (new 'static 'rgba :r #xff :a #x30) + ) + (the-as symbol (cond + ((nonzero? (-> obj actor-cshape-prim-offset)) + (if (handle->process (-> obj actor-handle)) + (format *stdcon* "grab: ~A~%" (-> obj actor-handle process 0 name)) + (format *stdcon* "grab: invalid handle~%") + ) + ) + (else + (format *stdcon* "grab: ground~%") + ) + ) + ) + ) + +;; definition for method 10 of type collide-edge-work +(defmethod debug-draw-edges collide-edge-work ((obj collide-edge-work)) + (let ((gp-0 0)) + (dotimes (s4-0 (the-as int (-> obj num-edges))) + (let* ((s3-0 (-> obj edges s4-0)) + (a2-0 (-> s3-0 vertex-ptr 0 0)) + (a3-0 (-> s3-0 vertex-ptr 1 0)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (vector+! s2-0 a2-0 a3-0) + (vector-float*! s2-0 s2-0 0.5) + (cond + ((-> s3-0 ignore) + (add-debug-line + #t + (bucket-id debug-no-zbuf) + a2-0 + a3-0 + (new 'static 'rgba :r #x7f :g #x7f :b #x7f :a #x50) + #f + (the-as rgba -1) + ) + (+! gp-0 1) + ) + (else + (add-debug-line + #t + (bucket-id debug-no-zbuf) + a2-0 + a3-0 + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x60) + #f + (the-as rgba -1) + ) + (add-debug-vector + #t + (bucket-id debug-no-zbuf) + s2-0 + (-> s3-0 outward) + (meters 0.3) + (new 'static 'rgba :r #xff :a #x80) + ) + ) + ) + ) + ) + (format *stdcon* "found ~D edges (and ~D ignored)~%" (- (-> obj num-edges) (the-as uint gp-0)) gp-0) + ) + ) + +;; definition for method 12 of type collide-edge-work +(defmethod debug-draw-sphere collide-edge-work ((obj collide-edge-work)) + (dotimes (s5-0 (the-as int (-> obj num-verts))) + (let ((a2-0 (-> obj verts s5-0))) + (add-debug-sphere #t (bucket-id debug-no-zbuf) a2-0 819.2 (new 'static 'rgba :r #xff :g #xff :a #x80)) + ) + ) + #f + ) + +;; definition for method 9 of type collide-edge-hold-list +;; Used lq/sq +(defmethod debug-draw collide-edge-hold-list ((obj collide-edge-hold-list)) + (let ((s4-0 (-> obj head)) + (s5-0 0) + ) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 #t) + ) + (set! (-> s3-0 quad) (-> *target* control unknown-vector90 quad)) + (while s4-0 + (+! s5-0 1) + (set! (-> s3-0 y) (-> s4-0 center-pt y)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s3-0 409.6 (new 'static 'rgba :a #x80)) + (cond + (s2-0 + (set! s2-0 #f) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf) + (-> s4-0 center-pt) + 614.4 + (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + (add-debug-sphere #t (bucket-id debug-no-zbuf) (-> s4-0 outward-pt) 409.6 (new 'static 'rgba :r #xff :a #x80)) + ) + (else + (add-debug-sphere + #t + (bucket-id debug-no-zbuf) + (-> s4-0 center-pt) + 614.4 + (new 'static 'rgba :r #x7f :g #x7f :a #x40) + ) + (add-debug-sphere #t (bucket-id debug-no-zbuf) (-> s4-0 outward-pt) 409.6 (new 'static 'rgba :r #x7f :a #x40)) + ) + ) + (set! s4-0 (-> s4-0 next)) + ) + ) + (format *stdcon* "hold list has ~D item(s)~%" s5-0) + ) + (dotimes (s5-1 (the-as int (-> obj num-attempts))) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf) + (the-as vector (-> obj attempts s5-1)) + 409.6 + (new 'static 'rgba :a #x40) + ) + ) + (format *stdcon* "hold list has ~D attempt(s)~%" (-> obj num-attempts)) + ) + +;; definition for method 11 of type collide-edge-work +;; INFO: Return type mismatch symbol vs none. +(defmethod debug-draw-tris collide-edge-work ((obj collide-edge-work)) + (dotimes (s5-0 (the-as int (-> obj num-tris))) + (let* ((v1-3 (-> obj tris s5-0 ctri)) + (t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-3 pat mode) color) a 64)) + ) + (add-debug-outline-triangle + #t + (bucket-id debug-no-zbuf) + (the-as vector (-> v1-3 vertex)) + (-> v1-3 vertex 1) + (-> v1-3 vertex 2) + t1-0 + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(let ((v1-1 + (new 'static 'surface + :name '*rotate-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 153600.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :flags (surface-flags moving-ground) + ) + ) + ) + (set! *rotate-surface* v1-1) + (set! (-> v1-1 mult-hook) + (the-as + (function surface surface surface int none) + (lambda ((arg0 surface) (arg1 object) (arg2 object) (arg3 int)) (when (= arg3 1) + (let ((f0-0 151756.8)) + (set! (-> arg0 fric) f0-0) + f0-0 + ) + ) + ) + ) + ) + (set! (-> v1-1 touch-hook) nothing) + (set! (-> v1-1 active-hook) nothing) + ) + +;; failed to figure out what this is: +(let ((v1-2 (new 'static 'surface + :name '*no-walk-surface* + :turnv 0.5 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 0.7 + :target-speed 0.7 + :seek0 24576.0 + :seek90 24576.0 + :seek180 24576.0 + :fric 23756.8 + :nonlin-fric-dist 4091904.0 + :slope-slip-angle 16384.0 + :bend-speed 4.0 + :alignv 0.5 + :slope-up-traction 0.9 + :align-speed 1.0 + :flags (surface-flags no-turn-around always-rotate-toward-transv) + ) + ) + ) + (set! *no-walk-surface* v1-2) + (set! (-> v1-2 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-2 touch-hook) nothing) + (set! (-> v1-2 active-hook) nothing) + ) diff --git a/test/decompiler/reference/engine/collide/collide-mesh_REF.gc b/test/decompiler/reference/engine/collide/collide-mesh_REF.gc index d2fb22962f..6f3b1fdffa 100644 --- a/test/decompiler/reference/engine/collide/collide-mesh_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-mesh_REF.gc @@ -72,7 +72,7 @@ (.svf (&-> a2-1 quad) vf1) (.svf (&-> a3-0 quad) vf2) (.svf (&-> t0-0 quad) vf3) - (add-debug-flat-triangle #t (bucket-id debug-draw1) a2-1 a3-0 t0-0 t1-0) + (add-debug-flat-triangle #t (bucket-id debug-no-zbuf) a2-1 a3-0 t0-0 t1-0) ) ) (set! s5-0 (-> (the-as (inline-array collide-mesh-tri) s5-0) 1)) @@ -445,7 +445,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/engine/collide/collide-reaction-target_REF.gc b/test/decompiler/reference/engine/collide/collide-reaction-target_REF.gc new file mode 100644 index 0000000000..5184c34f5a --- /dev/null +++ b/test/decompiler/reference/engine/collide/collide-reaction-target_REF.gc @@ -0,0 +1,452 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function collide-shape-moving-angle-set! +;; INFO: Return type mismatch int vs none. +;; Used lq/sq +(defun collide-shape-moving-angle-set! ((arg0 collide-shape-moving) (arg1 vector) (arg2 vector)) + (set! (-> arg0 surface-normal quad) (-> arg1 quad)) + (set! (-> arg0 surface-angle) (vector-dot arg1 (-> arg0 dynam gravity-normal))) + (set! (-> arg0 poly-angle) (vector-dot (-> arg0 poly-normal) (-> arg0 dynam gravity-normal))) + (set! (-> arg0 touch-angle) + (fmax + (-> arg0 touch-angle) + (vector-dot arg1 (vector-normalize! (vector-negate! (new-stack-vector0) arg2) 1.0)) + ) + ) + 0 + (none) + ) + +;; definition for function poly-find-nearest-edge +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; Used lq/sq +(defun poly-find-nearest-edge ((arg0 vector) (arg1 (inline-array vector)) (arg2 vector) (arg3 vector)) + (local-vars (sv-32 vector) (sv-36 float) (sv-40 int) (sv-48 float) (sv-80 vector)) + (set! sv-32 (new 'stack-no-clear 'vector)) + (set! sv-36 4095996000.0) + (set! sv-40 -1) + (set! sv-48 0.0) + (dotimes (s2-0 3) + (let ((s0-0 (-> arg1 s2-0))) + (set! sv-80 (-> arg1 (mod (+ s2-0 1) 3))) + (let ((f30-0 (vector-line-distance-point! arg2 s0-0 sv-80 sv-32)) + (s1-1 (vector-! (new 'stack-no-clear 'vector) sv-80 s0-0)) + ) + 0.0 + (vector-normalize! s1-1 1.0) + (let ((f0-5 (fabs (vector-dot arg3 s1-1)))) + (when (or (< f30-0 sv-36) (and (= f30-0 sv-36) (< sv-48 f0-5))) + (set! sv-36 f30-0) + (set! sv-40 s2-0) + (set! sv-48 f0-5) + ) + ) + ) + ) + ) + (let ((v1-20 (&-> arg0 x)) + (a0-7 (-> arg1 sv-40 quad)) + ) + (s.q! v1-20 a0-7) + ) + (set! (-> (&+ arg0 16) quad) (-> arg1 (mod (+ sv-40 1) 3) quad)) + arg0 + ) + +;; definition for function target-collision-low-coverage +;; INFO: Return type mismatch int vs uint. +;; Used lq/sq +(defun target-collision-low-coverage ((arg0 control-info) + (arg1 collide-shape-intersect) + (arg2 vector) + (arg3 (pointer uint32)) + (arg4 (pointer uint64)) + (arg5 (pointer symbol)) + ) + (local-vars + (sv-16 vector) + (sv-20 (pointer uint32)) + (sv-24 (pointer uint64)) + (sv-28 (pointer symbol)) + (sv-32 uint) + (sv-40 uint) + (sv-48 symbol) + (sv-52 vector) + (sv-56 vector) + (sv-160 vector) + (sv-164 collide-tri-result) + (sv-208 vector) + (sv-212 vector) + (sv-272 vector) + (sv-276 vector) + ) + (set! sv-16 arg2) + (set! sv-20 arg3) + (set! sv-24 arg4) + (set! sv-28 arg5) + (set! sv-32 (-> arg3 0)) + (set! sv-40 (-> arg4 0)) + (set! sv-48 (-> arg5 0)) + (set! sv-52 (-> arg0 unknown-vector60)) + (set! sv-56 (vector-cross! (-> arg0 unknown-vector-coverage-2) (-> arg0 poly-normal) sv-16)) + (vector-normalize! sv-56 1.0) + (if (>= (fabs (vector-dot (-> arg0 dynam gravity-normal) sv-56)) 0.866) + (set! sv-32 (logior sv-32 512)) + ) + (vector-cross! sv-52 sv-16 sv-56) + (if (< 0.0 (vector-dot (-> arg0 dynam gravity-normal) sv-52)) + (vector-negate! sv-52 sv-52) + ) + (vector-normalize! sv-52 1.0) + (set! sv-160 (vector-flatten! (-> arg0 unknown-vector-coverage-3) sv-52 (-> arg0 dynam gravity-normal))) + (set! sv-164 (new 'stack 'collide-tri-result)) + (vector-normalize! sv-160 1.0) + (if (< (vector-dot sv-160 sv-16) 0.0) + (vector-negate! sv-160 sv-160) + ) + (set! (-> arg0 unknown-float-coverage-0) 4095996000.0) + (set! (-> arg0 unknown-float-coverage-2) 4095996000.0) + (set! sv-208 (vector+float*! (new 'stack-no-clear 'vector) (-> arg1 best-tri intersect) sv-160 2867.2)) + (set! sv-212 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 dynam gravity-normal) -20480.0)) + (vector+float*! sv-212 sv-212 sv-160 4096.0) + (when (>= (probe-using-line-sphere + *collide-cache* + sv-208 + sv-212 + 409.6 + (-> arg1 best-from-prim collide-with) + sv-164 + (new 'static 'pat-surface :noentity #x1) + ) + 0.0 + ) + (set! (-> arg0 unknown-float-coverage-0) + (vector-dot + (-> arg0 dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-tri intersect) (-> sv-164 intersect)) + ) + ) + (set! (-> arg0 unknown-float-coverage-1) (the-as float (-> sv-164 pat))) + (set! (-> arg0 unknown-vector-coverage-0 quad) (-> sv-164 normal quad)) + 0 + ) + (set! sv-272 (vector+float*! + (new 'stack-no-clear 'vector) + (-> arg1 best-tri intersect) + (-> arg0 dynam gravity-normal) + 819.2 + ) + ) + (set! sv-276 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 dynam gravity-normal) -20480.0)) + (vector+float*! sv-272 sv-272 sv-160 -819.2) + (vector+float*! sv-276 sv-276 sv-160 -4096.0) + (when (>= (probe-using-line-sphere + *collide-cache* + sv-272 + sv-276 + 409.6 + (-> arg1 best-from-prim collide-with) + sv-164 + (new 'static 'pat-surface :noentity #x1) + ) + 0.0 + ) + (set! (-> arg0 unknown-float-coverage-2) (vector-vector-distance sv-272 (-> sv-164 intersect))) + (set! (-> arg0 unknown-u32-coverage-0) (the-as uint (-> sv-164 pat))) + (set! (-> arg0 unknown-vector-coverage-1 quad) (-> sv-164 normal quad)) + 0 + ) + (when (and (zero? (logand sv-32 512)) + (and (or (< (* 1.25 (-> arg1 best-from-prim local-sphere w)) (-> arg0 unknown-float-coverage-0)) + (= (shr (shl (the-as int (-> arg0 unknown-float-coverage-1)) 58) 61) 1) + ) + (and (< (-> arg0 unknown-float-coverage-2) (* 2.0 (-> arg1 best-from-prim local-sphere w))) + (zero? (shr (shl (-> arg0 unknown-u32-coverage-0) 58) 61)) + ) + ) + ) + (set! sv-32 (logior sv-32 128)) + (set! (-> arg0 unknown-dword-coverage) (the-as int (-> *display* base-frame-counter))) + (set! sv-40 (logior sv-40 128)) + (set! (-> arg0 unknown-dword21) (-> *display* base-frame-counter)) + (let ((f30-0 (vector-dot sv-52 (-> arg0 unknown-vector22))) + (f0-21 (if (logtest? sv-32 2) + (cos (- 16384.0 (acos (-> arg0 coverage)))) + (-> arg0 coverage) + ) + ) + (f1-11 (vector-dot + (-> arg0 dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg0 trans) (-> arg1 best-tri intersect)) + ) + ) + ) + (if (or (zero? (logand sv-32 32)) (< 0.5 f0-21)) + (set! sv-48 (the-as symbol #f)) + ) + (when (and (or (and (< f0-21 0.95) (>= f30-0 0.0)) + (and (logtest? sv-32 32) (< f0-21 0.3)) + (< f1-11 (* -0.25 (-> arg1 best-from-prim local-sphere w))) + ) + (>= (vector-dot sv-52 sv-16) -0.000001) + ) + (set! (-> arg0 surf) *edge-surface*) + (set! sv-32 (logior sv-32 1024)) + (set! sv-48 (the-as symbol #f)) + (when (logtest? sv-32 32) + (set! sv-48 #t) + (set! sv-32 (logior sv-32 4096)) + ) + ) + ) + ) + (if (< (-> arg0 surface-angle) 0.0) + (set! sv-48 #t) + ) + (when sv-48 + (cond + ((and (or (= (-> arg0 poly-pat mode) (pat-mode ground)) + (and (logtest? sv-32 8) + (>= (* 1.25 (-> arg1 best-from-prim local-sphere w)) (-> arg0 unknown-float-coverage-0)) + (zero? (shr (shl (the-as int (-> arg0 unknown-float-coverage-1)) 58) 61)) + (< 0.3 (fabs (-> arg0 surface-angle))) + ) + ) + (zero? (logand sv-32 128)) + ) + (set! sv-32 (logior sv-32 64)) + (set! sv-40 (logior sv-40 128)) + (set! (-> arg0 unknown-dword21) (-> *display* base-frame-counter)) + (set! sv-48 (the-as symbol #f)) + ) + (#t + (set! sv-32 (logior sv-32 64)) + (set! sv-40 (logior sv-40 128)) + (set! (-> arg0 unknown-dword21) (-> *display* base-frame-counter)) + ) + ) + ) + (set! (-> sv-24 0) sv-40) + (set! (-> sv-20 0) sv-32) + (set! (-> sv-28 0) sv-48) + (the-as uint 0) + ) + +;; definition for function target-collision-reaction +;; INFO: Return type mismatch int vs cshape-moving-flags. +;; Used lq/sq +(defun target-collision-reaction ((arg0 control-info) (arg1 collide-shape-intersect) (arg2 vector) (arg3 vector)) + (local-vars (sv-80 vector) (sv-84 vector) (sv-88 matrix) (sv-96 int) (sv-104 int) (sv-160 symbol)) + (set! sv-80 (new-stack-vector0)) + (set! sv-84 (new-stack-vector0)) + (let ((v1-2 (new 'stack-no-clear 'matrix))) + (dotimes (a0-1 2) + (set! (-> v1-2 vector a0-1 quad) (the-as uint128 0)) + ) + (set! sv-88 v1-2) + ) + (set! sv-96 0) + (set! sv-104 0) + (set! (-> sv-88 vector 0 quad) (-> arg3 quad)) + (set! (-> sv-88 vector 1 quad) (-> arg3 quad)) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (vector-float*! a1-3 (-> arg1 move-vec) (-> arg1 best-u)) + (move-by-vector! arg0 a1-3) + ) + (set-and-handle-pat! arg0 (-> arg1 best-tri pat)) + (if (= (-> arg0 poly-pat mode) (pat-mode wall)) + (set! sv-104 (logior sv-104 1)) + ) + (if (logtest? (-> arg0 unknown-surface00 flags) (surface-flags jump)) + (set! sv-104 (logior sv-104 32)) + ) + (let ((v1-23 (new 'stack-no-clear 'vector))) + (set! (-> v1-23 quad) (-> arg1 best-from-prim prim-core world-sphere quad)) + (vector-! sv-80 v1-23 (-> arg1 best-tri intersect)) + ) + (vector-normalize! sv-80 1.0) + (set! (-> arg0 coverage) (vector-dot sv-80 (-> arg1 best-tri normal))) + (when (< (-> arg0 coverage) 0.0) + (set! (-> arg0 coverage) 0.0) + (vector-flatten! sv-80 sv-80 (-> arg1 best-tri normal)) + (vector-normalize! sv-80 1.0) + ) + (if (< (-> arg0 coverage) 0.9999) + (set! sv-104 (logior sv-104 24)) + ) + (let ((v1-33 (-> sv-80 quad))) + (set! (-> sv-84 quad) v1-33) + ) + (if (= (-> arg1 best-u) 0.0) + (move-by-vector! arg0 (vector-normalize-copy! (new-stack-vector0) sv-84 3.0)) + ) + (set! (-> arg0 poly-normal quad) (-> arg1 best-tri normal quad)) + (collide-shape-moving-angle-set! arg0 sv-84 (the-as vector (-> sv-88 vector))) + (if (< (-> arg0 poly-angle) -0.2) + (set! sv-96 (logior sv-96 16)) + ) + (if (< (-> arg0 poly-angle) 0.0) + (set! sv-96 (logior sv-96 #x4000)) + ) + (set! sv-160 (< (fabs (-> arg0 surface-angle)) (-> *pat-mode-info* (-> arg0 cur-pat mode) wall-angle))) + (if (and sv-160 (and (= (-> arg0 unknown-surface00 mode) 'dive) (< 0.2 (fabs (-> arg0 surface-angle))))) + (set! sv-160 (the-as symbol #f)) + ) + (if sv-160 + (set! sv-104 (logior sv-104 2)) + ) + (if (logtest? sv-104 8) + (target-collision-low-coverage + arg0 + arg1 + sv-84 + (the-as (pointer uint32) (& sv-104)) + (the-as (pointer uint64) (& sv-96)) + (& sv-160) + ) + ) + (when (zero? (logand (-> arg0 prev-status) (cshape-moving-flags onsurf))) + (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) + (set! sv-96 (logior sv-96 2048)) + (when (not sv-160) + (let ((f30-0 (- 1.0 (-> arg0 surf impact-fric)))) + (when (< f30-0 1.0) + (let ((s3-1 (new-stack-vector0)) + (f28-0 (vector-dot (-> arg0 dynam gravity-normal) (the-as vector (-> sv-88 vector)))) + ) + 0.0 + (vector-! s3-1 (the-as vector (-> sv-88 vector)) (vector-float*! s3-1 (-> arg0 dynam gravity-normal) f28-0)) + (let* ((f0-20 (vector-length s3-1)) + (f1-9 f0-20) + ) + (if (< f28-0 0.0) + (set! f28-0 (* f28-0 f30-0)) + ) + (vector+! + (the-as vector (-> sv-88 vector)) + (vector-float*! (the-as vector (-> sv-88 vector)) (-> arg0 dynam gravity-normal) f28-0) + (vector-float*! s3-1 s3-1 (/ f0-20 f1-9)) + ) + ) + ) + ) + ) + ) + ) + (set! sv-96 (logior sv-96 4)) + (cond + ((-> arg1 best-to-prim) + (set! sv-96 (logior sv-96 32)) + (set! (-> arg0 unknown-vector72 quad) (-> arg1 best-tri intersect quad)) + (set! (-> arg0 unknown-vector73 quad) (-> arg0 poly-normal quad)) + (set! (-> arg0 unknown-handle00) (process->handle (-> arg1 best-to-prim cshape process))) + ) + ((= (-> arg0 poly-pat material) (pat-material waterbottom)) + ) + (else + (set! sv-96 (logior sv-96 4096)) + ) + ) + (cond + (sv-160 + (set! sv-104 (logior sv-104 4)) + (set! sv-96 (logior sv-96 8)) + (set! (-> arg0 cur-pat mode) 1) + (set! (-> arg0 unknown-vector70 quad) (-> arg1 best-tri intersect quad)) + (set! (-> arg0 unknown-vector71 quad) (-> arg0 poly-normal quad)) + (set! (-> arg0 unknown-vector121 quad) (-> sv-84 quad)) + (set! (-> arg0 wall-pat) (-> arg1 best-tri pat)) + (-> arg0 history-data (logand (+ (-> arg0 unknown-halfword00) 127) 127)) + (cond + (#f + (sound-play "cursor-options") + (set! sv-104 (logior sv-104 8192)) + (vector-reflect-flat-above! arg2 (the-as vector (-> sv-88 vector)) sv-84) + ) + (else + (vector-reflect-flat! arg2 (the-as vector (-> sv-88 vector)) sv-84) + ) + ) + (cond + ((not (and (>= (-> arg1 best-from-prim local-sphere w) + (vector-dot + (-> arg0 ground-poly-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-tri intersect) (-> arg0 ground-touch-point)) + ) + ) + (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) + (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) (seconds 0.3)) + (zero? (logand sv-104 32)) + ) + ) + ) + ) + (else + (set! sv-104 (logior sv-104 256)) + (set! sv-104 (logand -65 sv-104)) + (let ((s3-4 (vector-cross! (new 'stack-no-clear 'vector) (-> arg0 poly-normal) (-> arg0 ground-poly-normal)))) + (vector-normalize! s3-4 1.0) + (vector-float*! arg2 s3-4 (vector-dot (the-as vector (-> sv-88 vector)) s3-4)) + ) + (vector+! arg2 arg2 (-> arg0 poly-normal)) + ) + ) + ) + (else + (set! sv-96 (logior sv-96 1)) + (set! (-> arg0 cur-pat mode) 0) + (if (= (-> arg1 best-from-prim prim-id) 6) + (set! (-> arg0 local-normal quad) (-> sv-84 quad)) + ) + (vector-reflect-flat! arg2 (the-as vector (-> sv-88 vector)) sv-84) + (vector+! arg2 arg2 sv-84) + (set! (-> arg0 ground-touch-point w) 0.0) + (when (not (or (logtest? sv-104 15) (nonzero? (-> arg0 poly-pat event)))) + (set! sv-96 (logior sv-96 2)) + (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) + (set! (-> arg0 unknown-vector53 quad) (-> sv-84 quad)) + (set! (-> arg0 unknown-float60) (vector-dot sv-84 (-> arg0 dynam gravity-normal))) + (set! (-> arg0 unknown-dword10) (-> *display* base-frame-counter)) + (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) + (set! (-> arg0 ground-touch-point quad) (-> arg1 best-tri intersect quad)) + (set! (-> arg0 unknown-vector55 quad) (-> arg1 best-from-prim prim-core world-sphere quad)) + (set! sv-104 (logior sv-104 2048)) + (if (= (-> arg0 poly-pat material) (pat-material waterbottom)) + (set! sv-96 (logior sv-96 1024)) + ) + ) + ) + ) + (logior! (-> arg0 status) sv-96) + (set! (-> arg0 reaction-flag) (the-as cshape-reaction-flags sv-104)) + (update! + (-> arg0 history-data (-> arg0 unknown-halfword00)) + arg0 + (-> arg1 best-tri intersect) + (-> sv-88 vector 1) + arg2 + ) + (set! (-> arg0 unknown-halfword00) (logand (+ (-> arg0 unknown-halfword00) 1) 127)) + (the-as cshape-moving-flags sv-96) + ) + +;; definition for function target-collision-no-reaction +;; INFO: Return type mismatch int vs none. +(defun target-collision-no-reaction ((arg0 control-info) (arg1 collide-shape-intersect) (arg2 vector) (arg3 vector)) + (if (= (-> arg0 unknown-surface00 mode) 'air) + (logior! (-> arg0 reaction-flag) (cshape-reaction-flags csrf05)) + ) + (let ((s5-0 (-> arg0 history-data (-> arg0 unknown-halfword00)))) + (update! s5-0 arg0 (-> arg0 trans) arg3 arg2) + (logior! (-> s5-0 status) (cshape-moving-flags csmf08)) + ) + (set! (-> arg0 unknown-halfword00) (logand (+ (-> arg0 unknown-halfword00) 1) 127)) + 0 + (none) + ) diff --git a/test/decompiler/reference/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/engine/collide/collide-shape-h_REF.gc index 23fe0d66a0..fb395956df 100644 --- a/test/decompiler/reference/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-shape-h_REF.gc @@ -233,7 +233,7 @@ (add-fg-prim-using-y-probe (_type_ collide-cache) none 14) (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 15) (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 16) - (dummy-17 () none 17) + (unused-17 () none 17) (collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none 18) (collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none 19) (add-to-bounding-box (_type_ collide-kind) symbol 20) @@ -377,11 +377,11 @@ (deftype collide-shape (trsqv) ((process process-drawable :offset-assert 140) (max-iteration-count uint8 :offset-assert 144) - (nav-flags uint8 :offset-assert 145) + (nav-flags nav-flags :offset-assert 145) (pad-byte uint8 2 :offset-assert 146) (pat-ignore-mask pat-surface :offset-assert 148) - (event-self basic :offset-assert 152) - (event-other basic :offset-assert 156) + (event-self symbol :offset-assert 152) + (event-other symbol :offset-assert 156) (root-prim collide-shape-prim :offset-assert 160) (riders collide-sticky-rider-group :offset-assert 164) (backup-collide-as collide-kind :offset-assert 168) @@ -454,31 +454,31 @@ ;; definition of type collide-shape-moving (deftype collide-shape-moving (collide-shape) - ((rider-time time-frame :offset-assert 184) - (rider-last-move vector :inline :offset-assert 192) - (trans-old vector 3 :inline :offset-assert 208) - (poly-pat pat-surface :offset-assert 256) - (cur-pat pat-surface :offset-assert 260) - (ground-pat pat-surface :offset-assert 264) - (status uint64 :offset-assert 272) - (old-status uint64 :offset-assert 280) - (prev-status uint64 :offset-assert 288) - (reaction-flag uint32 :offset-assert 296) - (reaction (function collide-shape-moving collide-shape-intersect vector vector uint) :offset-assert 300) - (no-reaction (function collide-shape-moving collide-shape-intersect vector vector none) :offset-assert 304) - (local-normal vector :inline :offset-assert 320) - (surface-normal vector :inline :offset-assert 336) - (poly-normal vector :inline :offset-assert 352) - (ground-poly-normal vector :inline :offset-assert 368) - (ground-touch-point vector :inline :offset-assert 384) - (shadow-pos vector :inline :offset-assert 400) - (ground-impact-vel meters :offset-assert 416) - (surface-angle float :offset-assert 420) - (poly-angle float :offset-assert 424) - (touch-angle float :offset-assert 428) - (coverage float :offset-assert 432) - (dynam dynamics :offset-assert 436) - (surf surface :offset-assert 440) + ((rider-time time-frame :offset-assert 184) + (rider-last-move vector :inline :offset-assert 192) + (trans-old vector 3 :inline :offset-assert 208) + (poly-pat pat-surface :offset-assert 256) + (cur-pat pat-surface :offset-assert 260) + (ground-pat pat-surface :offset-assert 264) + (status cshape-moving-flags :offset-assert 272) + (old-status cshape-moving-flags :offset-assert 280) + (prev-status cshape-moving-flags :offset-assert 288) + (reaction-flag cshape-reaction-flags :offset-assert 296) + (reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags) :offset-assert 300) + (no-reaction (function collide-shape-moving collide-shape-intersect vector vector none) :offset-assert 304) + (local-normal vector :inline :offset-assert 320) + (surface-normal vector :inline :offset-assert 336) + (poly-normal vector :inline :offset-assert 352) + (ground-poly-normal vector :inline :offset-assert 368) + (ground-touch-point vector :inline :offset-assert 384) + (shadow-pos vector :inline :offset-assert 400) + (ground-impact-vel meters :offset-assert 416) + (surface-angle float :offset-assert 420) + (poly-angle float :offset-assert 424) + (touch-angle float :offset-assert 428) + (coverage float :offset-assert 432) + (dynam dynamics :offset-assert 436) + (surf surface :offset-assert 440) ) :method-count-assert 65 :size-assert #x1bc @@ -638,17 +638,17 @@ (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (set! (-> obj process) proc) (set! (-> obj max-iteration-count) (the-as uint 1)) - (set! (-> obj nav-flags) (the-as uint 1)) + (set! (-> obj nav-flags) (nav-flags navf0)) (set! (-> obj event-self) #f) (set! (-> obj event-other) #f) (set! (-> obj riders) #f) (set! (-> obj root-prim) #f) (case (-> proc type symbol) (('camera) - (set! (-> obj pat-ignore-mask) (new 'static 'pat-surface :skip #x2 :nocamera #x1)) + (set! (-> obj pat-ignore-mask) (new 'static 'pat-surface :nocamera #x1)) ) (else - (set! (-> obj pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) + (set! (-> obj pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) ) ) (set! (-> obj trans w) 1.0) @@ -698,8 +698,7 @@ ;; definition for symbol *collide-shape-prim-backgnd*, type collide-shape-prim-mesh (define *collide-shape-prim-backgnd* (new 'static 'collide-shape-prim-mesh :cshape #f - :prim-core - (new 'static 'collide-prim-core + :prim-core (new 'static 'collide-prim-core :world-sphere (new 'static 'vector :w 204800000.0) :collide-as (collide-kind background) :action (collide-action solid) @@ -714,8 +713,7 @@ ;; definition for symbol *collide-shape-prim-water*, type collide-shape-prim-mesh (define *collide-shape-prim-water* (new 'static 'collide-shape-prim-mesh :cshape #f - :prim-core - (new 'static 'collide-prim-core + :prim-core (new 'static 'collide-prim-core :world-sphere (new 'static 'vector :w 204800000.0) :collide-as (collide-kind water) :action (collide-action solid) diff --git a/test/decompiler/reference/engine/collide/collide-shape-rider_REF.gc b/test/decompiler/reference/engine/collide/collide-shape-rider_REF.gc new file mode 100644 index 0000000000..809e41fde2 --- /dev/null +++ b/test/decompiler/reference/engine/collide/collide-shape-rider_REF.gc @@ -0,0 +1,488 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 39 of type collide-shape +(defmethod on-platform collide-shape ((obj collide-shape) (arg0 collide-shape) (arg1 collide-overlap-result)) + (let ((v1-0 arg1)) + (set! (-> v1-0 best-dist) 0.0) + (set! (-> v1-0 best-from-prim) #f) + (set! (-> v1-0 best-to-prim) #f) + ) + (set! (-> arg1 best-dist) 122.88) + (let ((s5-0 (-> obj root-prim)) + (s4-0 (-> arg0 root-prim)) + ) + (when (and (logtest? (-> s5-0 collide-with) (-> s4-0 prim-core collide-as)) + (logtest? (-> s5-0 prim-core action) (collide-action ca-1)) + (logtest? (-> s4-0 prim-core action) (collide-action ca-2)) + ) + (let ((f0-4 (- (- (vector-vector-distance (the-as vector (-> s5-0 prim-core)) (the-as vector (-> s4-0 prim-core))) + (-> s5-0 prim-core world-sphere w) + ) + (-> s4-0 prim-core world-sphere w) + ) + ) + ) + (if (< f0-4 122.88) + (on-platform-test s5-0 s4-0 arg1 f0-4) + ) + ) + ) + ) + (< (-> arg1 best-dist) 122.88) + ) + +;; definition for method 22 of type collide-shape-prim +;; INFO: Return type mismatch object vs none. +(defmethod on-platform-test collide-shape-prim ((obj collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) + (format 0 "ERROR: collide-shape-prim::on-platform-test was called illegally!~%") + (none) + ) + +;; definition for method 22 of type collide-shape-prim-group +;; INFO: Return type mismatch symbol vs none. +(defmethod on-platform-test collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) + (let ((s3-0 (-> arg0 prim-core collide-as))) + (dotimes (s2-0 (-> obj num-prims)) + (let ((s1-0 (-> obj prims s2-0))) + (when (and (logtest? (-> s1-0 collide-with) s3-0) (logtest? (-> s1-0 prim-core action) (collide-action ca-1))) + (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> s1-0 prim-core)) (the-as vector (-> arg0 prim-core))) + (-> s1-0 prim-core world-sphere w) + ) + (-> arg0 prim-core world-sphere w) + ) + ) + ) + (if (< f0-2 122.88) + (on-platform-test s1-0 arg0 arg1 f0-2) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 22 of type collide-shape-prim-mesh +;; INFO: Return type mismatch pat-surface vs none. +;; WARN: Expression building failed: Function (method 22 collide-shape-prim-mesh) has a return type of none, but the expression builder found a return statement. +;; Used lq/sq +(defmethod on-platform-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) + (case (-> arg0 type) + ((collide-shape-prim-group) + (let ((s3-0 (-> obj collide-with))) + (dotimes (s2-0 (-> (the-as collide-shape-prim-group arg0) num-prims)) + (let ((s1-0 (-> (the-as collide-shape-prim-group arg0) prims s2-0))) + (when (and (logtest? s3-0 (-> s1-0 prim-core collide-as)) + (logtest? (-> s1-0 prim-core action) (collide-action ca-2)) + ) + (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> obj prim-core)) (the-as vector (-> s1-0 prim-core))) + (-> obj prim-core world-sphere w) + ) + (-> s1-0 prim-core world-sphere w) + ) + ) + ) + (if (< f0-2 122.88) + (on-platform-test obj s1-0 arg1 f0-2) + ) + ) + ) + ) + ) + ) + ) + ((collide-shape-prim-sphere) + (let ((s3-1 (-> obj mesh))) + (when s3-1 + (let ((s2-1 *collide-mesh-cache*)) + (when (!= (-> obj mesh-cache-id) (-> s2-1 id)) + (let ((v1-17 (allocate! s2-1 (* (the-as uint 96) (-> s3-1 num-tris))))) + (cond + (v1-17 + (set! (-> obj mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-17)) + (set! (-> obj mesh-cache-id) (-> s2-1 id)) + (populate-cache! + s3-1 + (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) + (-> obj cshape process node-list data (-> obj transform-index) bone transform) + ) + ) + (else + (return #f) + ) + ) + ) + ) + ) + (let* ((s2-2 (new 'stack-no-clear 'collide-tri-result)) + (f0-4 (sphere-on-platform-test + s3-1 + (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) + s2-2 + (the-as vector (-> arg0 prim-core)) + (-> arg1 best-dist) + ) + ) + ) + (when (< f0-4 (-> arg1 best-dist)) + (set! (-> arg1 best-dist) f0-4) + (set! (-> arg1 best-from-prim) obj) + (set! (-> arg1 best-to-prim) arg0) + (set! (-> arg1 best-from-tri vertex 0 quad) (-> s2-2 vertex 0 quad)) + (set! (-> arg1 best-from-tri vertex 1 quad) (-> s2-2 vertex 1 quad)) + (set! (-> arg1 best-from-tri vertex 2 quad) (-> s2-2 vertex 2 quad)) + (set! (-> arg1 best-from-tri intersect quad) (-> s2-2 intersect quad)) + (set! (-> arg1 best-from-tri normal quad) (-> s2-2 normal quad)) + (set! (-> arg1 best-from-tri pat) (-> s2-2 pat)) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 9 of type collide-sticky-rider-group +(defmethod add-rider! collide-sticky-rider-group ((obj collide-sticky-rider-group) (arg0 process-drawable)) + (let ((gp-0 (the-as collide-sticky-rider #f))) + (cond + ((< (-> obj num-riders) (-> obj allocated-riders)) + (set! gp-0 (-> obj rider (-> obj num-riders))) + (+! (-> obj num-riders) 1) + (let ((v1-6 gp-0)) + (set! (-> v1-6 rider-handle) (the-as handle arg0)) + (set! (-> v1-6 sticky-prim) #f) + ) + ) + (else + (format 0 "ERROR: Exeeded max number of riders!~%") + ) + ) + gp-0 + ) + ) + +;; definition for method 35 of type collide-shape +(defmethod detect-riders! collide-shape ((obj collide-shape)) + (let ((s5-0 (-> obj riders))) + (when s5-0 + (let* ((v1-0 *collide-mesh-cache*) + (a0-1 (-> v1-0 id)) + ) + (set! (-> v1-0 used-size) (the-as uint 0)) + (let ((a0-2 (the-as int (+ a0-1 1)))) + (b! (zero? (the-as uint a0-2)) cfg-3 :likely-delay (set! a0-2 1)) + (label cfg-3) + (set! (-> v1-0 id) (the-as uint a0-2)) + ) + ) + (set! (-> s5-0 num-riders) 0) + 0 + (let ((s4-0 (-> obj root-prim collide-with))) + (when (logtest? s4-0 (collide-kind target)) + (let ((v1-7 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((s3-0 (-> v1-7 next0))) + (while (!= v1-7 (-> *collide-player-list* alive-list-end)) + (let* ((s2-0 (the-as object (-> (the-as connection v1-7) param1))) + (v1-8 (-> (the-as collide-shape s2-0) root-prim)) + ) + (when (logtest? s4-0 (-> v1-8 prim-core collide-as)) + (when (and (logtest? (-> v1-8 prim-core action) (collide-action ca-2)) + (!= (-> obj process) (-> (the-as collide-shape s2-0) process)) + ) + (let ((s1-0 (new 'stack-no-clear 'collide-overlap-result))) + (when (on-platform obj (the-as collide-shape s2-0) s1-0) + (let ((s4-1 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-0) process))))) + ) + (when s4-1 + (let ((a0-11 (-> s1-0 best-from-prim))) + (set! (-> s4-1 sticky-prim) a0-11) + (let ((s1-1 + (-> (the-as process-drawable (-> obj process)) node-list data (-> a0-11 transform-index) bone transform) + ) + ) + (set! (-> s4-1 prim-ry) (matrix-y-angle s1-1)) + (let ((s0-0 (new 'stack-no-clear 'matrix))) + (matrix-4x4-inverse! s0-0 s1-1) + (vector-matrix*! (-> s4-1 rider-local-pos) (-> (the-as collide-shape s2-0) trans) s0-0) + ) + ) + ) + (send-event (-> obj process) 'ridden s4-1) + ) + ) + (set! s4-0 (-> obj root-prim collide-with)) + ) + ) + ) + ) + ) + (set! v1-7 s3-0) + *collide-player-list* + (set! s3-0 (-> s3-0 next0)) + ) + ) + ) + ) + (when (logtest? s4-0 (collide-kind cak-1 cak-2 cak-3)) + (when (logtest? s4-0 (collide-kind cak-1)) + (let ((v1-37 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((s3-1 (-> v1-37 next0))) + (while (!= v1-37 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((s2-1 (the-as object (-> (the-as connection v1-37) param1))) + (v1-38 (-> (the-as collide-shape s2-1) root-prim)) + ) + (when (logtest? s4-0 (-> v1-38 prim-core collide-as)) + (when (and (logtest? (-> v1-38 prim-core action) (collide-action ca-2)) + (!= (-> obj process) (-> (the-as collide-shape s2-1) process)) + ) + (let ((s1-2 (new 'stack-no-clear 'collide-overlap-result))) + (when (on-platform obj (the-as collide-shape s2-1) s1-2) + (let ((s4-2 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-1) process))))) + ) + (when s4-2 + (let ((a0-30 (-> s1-2 best-from-prim))) + (set! (-> s4-2 sticky-prim) a0-30) + (let ((s1-3 (-> obj process node-list data (-> a0-30 transform-index) bone transform))) + (set! (-> s4-2 prim-ry) (matrix-y-angle s1-3)) + (let ((s0-1 (new 'stack-no-clear 'matrix))) + (matrix-4x4-inverse! s0-1 s1-3) + (vector-matrix*! (-> s4-2 rider-local-pos) (-> (the-as collide-shape s2-1) trans) s0-1) + ) + ) + ) + (send-event (-> obj process) 'ridden s4-2) + ) + ) + (set! s4-0 (-> obj root-prim collide-with)) + ) + ) + ) + ) + ) + (set! v1-37 s3-1) + *collide-hit-by-player-list* + (set! s3-1 (-> s3-1 next0)) + ) + ) + ) + ) + (when (logtest? s4-0 (collide-kind cak-2)) + (let ((v1-66 (-> *collide-usually-hit-by-player-list* alive-list next0))) + *collide-usually-hit-by-player-list* + (let ((s3-2 (-> v1-66 next0))) + (while (!= v1-66 (-> *collide-usually-hit-by-player-list* alive-list-end)) + (let* ((s2-2 (the-as object (-> (the-as connection v1-66) param1))) + (v1-67 (-> (the-as collide-shape s2-2) root-prim)) + ) + (when (logtest? s4-0 (-> v1-67 prim-core collide-as)) + (when (and (logtest? (-> v1-67 prim-core action) (collide-action ca-2)) + (!= (-> obj process) (-> (the-as collide-shape s2-2) process)) + ) + (let ((s1-4 (new 'stack-no-clear 'collide-overlap-result))) + (when (on-platform obj (the-as collide-shape s2-2) s1-4) + (let ((s4-3 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-2) process))))) + ) + (when s4-3 + (let ((a0-49 (-> s1-4 best-from-prim))) + (set! (-> s4-3 sticky-prim) a0-49) + (let ((s1-5 (-> obj process node-list data (-> a0-49 transform-index) bone transform))) + (set! (-> s4-3 prim-ry) (matrix-y-angle s1-5)) + (let ((s0-2 (new 'stack-no-clear 'matrix))) + (matrix-4x4-inverse! s0-2 s1-5) + (vector-matrix*! (-> s4-3 rider-local-pos) (-> (the-as collide-shape s2-2) trans) s0-2) + ) + ) + ) + (send-event (-> obj process) 'ridden s4-3) + ) + ) + (set! s4-0 (-> obj root-prim collide-with)) + ) + ) + ) + ) + ) + (set! v1-66 s3-2) + *collide-usually-hit-by-player-list* + (set! s3-2 (-> s3-2 next0)) + ) + ) + ) + ) + (when (logtest? s4-0 (collide-kind cak-3)) + (let ((v1-94 (-> *collide-hit-by-others-list* alive-list next0))) + *collide-hit-by-others-list* + (let ((s3-3 (-> v1-94 next0))) + (while (!= v1-94 (-> *collide-hit-by-others-list* alive-list-end)) + (let* ((s2-3 (the-as object (-> (the-as connection v1-94) param1))) + (v1-95 (-> (the-as collide-shape s2-3) root-prim)) + ) + (when (logtest? s4-0 (-> v1-95 prim-core collide-as)) + (when (and (logtest? (-> v1-95 prim-core action) (collide-action ca-2)) + (!= (-> obj process) (-> (the-as collide-shape s2-3) process)) + ) + (let ((s1-6 (new 'stack-no-clear 'collide-overlap-result))) + (when (on-platform obj (the-as collide-shape s2-3) s1-6) + (let ((s4-4 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-3) process))))) + ) + (when s4-4 + (let ((a0-68 (-> s1-6 best-from-prim))) + (set! (-> s4-4 sticky-prim) a0-68) + (let ((s1-7 (-> obj process node-list data (-> a0-68 transform-index) bone transform))) + (set! (-> s4-4 prim-ry) (matrix-y-angle s1-7)) + (let ((s0-3 (new 'stack-no-clear 'matrix))) + (matrix-4x4-inverse! s0-3 s1-7) + (vector-matrix*! (-> s4-4 rider-local-pos) (-> (the-as collide-shape s2-3) trans) s0-3) + ) + ) + ) + (send-event (-> obj process) 'ridden s4-4) + ) + ) + (set! s4-0 (-> obj root-prim collide-with)) + ) + ) + ) + ) + ) + (set! v1-94 s3-3) + *collide-hit-by-others-list* + (set! s3-3 (-> s3-3 next0)) + ) + ) + ) + #f + ) + ) + ) + ) + ) + ) + +;; definition for method 44 of type collide-shape +(defmethod pull-riders! collide-shape ((obj collide-shape)) + (let ((s5-0 (-> obj riders))) + (when s5-0 + (let ((s4-0 (new 'stack-no-clear 'pull-rider-info))) + (countdown (s3-0 (-> s5-0 num-riders)) + (let* ((v1-2 (-> s5-0 rider s3-0)) + (a0-1 (-> v1-2 rider-handle)) + ) + (when (handle->process a0-1) + (set! (-> s4-0 rider) v1-2) + (set! (-> s4-0 rider-cshape) + (the-as collide-shape-moving (-> (the-as process-drawable (-> a0-1 process 0)) root)) + ) + (let ((a0-5 (-> v1-2 sticky-prim))) + (when a0-5 + (let ((s2-0 (-> obj process node-list data (-> a0-5 transform-index) bone transform))) + (let ((s1-0 (-> s4-0 rider-dest))) + (vector-matrix*! s1-0 (-> v1-2 rider-local-pos) s2-0) + (vector-float*! s1-0 s1-0 (/ 1.0 (-> s1-0 w))) + ) + (set! (-> s4-0 rider-delta-ry) (deg- (matrix-y-angle s2-0) (-> s4-0 rider prim-ry))) + ) + (pull-rider! obj s4-0) + ) + ) + ) + ) + ) + ) + #f + ) + ) + ) + +;; definition for method 43 of type collide-shape +;; INFO: Return type mismatch object vs none. +;; Used lq/sq +(defmethod pull-rider! collide-shape ((obj collide-shape) (arg0 pull-rider-info)) + (local-vars (at-0 int) (sv-160 (function collide-shape-moving float collide-kind none))) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> arg0 rider-cshape))) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 quad) (-> gp-0 trans quad)) + (vector-! s3-0 (-> arg0 rider-dest) s4-0) + (cond + ((logtest? (-> obj root-prim prim-core action) (collide-action ca-4)) + (let ((s1-0 (-> obj root-prim prim-core collide-as))) + (set! (-> obj root-prim prim-core collide-as) (collide-kind)) + (let ((s0-0 gp-0)) + (set! sv-160 (method-of-object s0-0 fill-cache-for-shape!)) + (let ((a1-3 (+ 8192.0 (vector-length s3-0))) + (a2-0 (-> gp-0 root-prim collide-with)) + ) + (sv-160 s0-0 a1-3 a2-0) + ) + ) + (set! (-> obj root-prim prim-core collide-as) s1-0) + ) + (let ((s2-1 (new 'stack-no-clear 'vector))) + (set! (-> s2-1 quad) (-> s3-0 quad)) + (let ((v1-12 s2-1)) + (.lvf vf1 (&-> s2-1 quad)) + (let ((f0-2 (-> *display* frames-per-second))) + (.mov at-0 f0-2) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-12 quad) vf1) + ) + (cond + ((type-type? (-> gp-0 type) collide-shape-moving) + (let ((s3-1 (-> gp-0 status))) + (integrate-and-collide! gp-0 s2-1) + (set! (-> gp-0 status) s3-1) + ) + ) + (else + (integrate-and-collide! gp-0 s2-1) + ) + ) + ) + ) + (else + (move-by-vector! gp-0 s3-0) + ) + ) + (when (type-type? (-> gp-0 type) collide-shape-moving) + (let ((v1-18 (new 'stack-no-clear 'vector))) + (vector-! v1-18 (-> gp-0 trans) s4-0) + (vector-float*! (-> gp-0 rider-last-move) v1-18 (-> *display* frames-per-second)) + ) + (set! (-> gp-0 rider-time) (-> *display* base-frame-counter)) + ) + ) + (let ((f0-4 (-> arg0 rider-delta-ry))) + (if (!= f0-4 0.0) + (send-event (-> gp-0 process) 'rotate-y-angle f0-4) + ) + ) + ) + (none) + ) + ) + +;; definition for method 29 of type collide-shape +;; INFO: Return type mismatch object vs none. +(defmethod alloc-riders collide-shape ((obj collide-shape) (arg0 int)) + (if (-> obj riders) + (format 0 "ERROR: colide-shape::alloc-riders is being called multiple times!~%") + (set! (-> obj riders) (new 'process 'collide-sticky-rider-group arg0)) + ) + (none) + ) diff --git a/test/decompiler/reference/engine/collide/collide-target-h_REF.gc b/test/decompiler/reference/engine/collide/collide-target-h_REF.gc index cd0ac9f788..0b862838e5 100644 --- a/test/decompiler/reference/engine/collide/collide-target-h_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-target-h_REF.gc @@ -3,16 +3,16 @@ ;; definition of type collide-history (deftype collide-history (structure) - ((intersect vector :inline :offset-assert 0) - (trans vector :inline :offset-assert 16) - (transv vector :inline :offset-assert 32) - (transv-out vector :inline :offset-assert 48) - (local-normal vector :inline :offset-assert 64) - (surface-normal vector :inline :offset-assert 80) - (time time-frame :offset-assert 96) - (status uint64 :offset-assert 104) - (pat pat-surface :offset-assert 112) - (reaction-flag uint32 :offset-assert 116) + ((intersect vector :inline :offset-assert 0) + (trans vector :inline :offset-assert 16) + (transv vector :inline :offset-assert 32) + (transv-out vector :inline :offset-assert 48) + (local-normal vector :inline :offset-assert 64) + (surface-normal vector :inline :offset-assert 80) + (time time-frame :offset-assert 96) + (status cshape-moving-flags :offset-assert 104) + (pat pat-surface :offset-assert 112) + (reaction-flag cshape-reaction-flags :offset-assert 116) ) :method-count-assert 10 :size-assert #x78 @@ -158,6 +158,7 @@ (unknown-uint30 uint32 :offset 2188) (unknown-float121 float :offset 2188) (unknown-uint31 uint32 :offset 2192) + (unknown-int37 int32 :offset 2192) (unknown-float122 float :offset 2196) (unknown-float123 float :offset 2200) (unknown-float124 float :offset 2204) @@ -192,13 +193,17 @@ (unknown-vector120 vector :inline :offset 18928) (unknown-float150 float :offset 18944) (unknown-vector121 vector :inline :offset 18960) - (unknown-int60 uint32 :offset 18976) + (wall-pat pat-surface :offset 18976) (unknown-soundid00 sound-id :offset 18980) (unknown-float141 float :offset 18984) + (unknown-soundid01 sound-id :offset 18988) + (unknown-int34 int32 :offset 18992) + (unknown-int35 int32 :offset 18996) + (unknown-int36 int32 :offset 19000) ) :method-count-assert 65 - :size-assert #x4a2c - :flag-assert #x4100004a2c + :size-assert #x4a3c + :flag-assert #x4100004a3c ) ;; definition for method 9 of type collide-history diff --git a/test/decompiler/reference/engine/collide/collide-touch_REF.gc b/test/decompiler/reference/engine/collide/collide-touch_REF.gc index 632ad5d9c7..6dec9ed64c 100644 --- a/test/decompiler/reference/engine/collide/collide-touch_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-touch_REF.gc @@ -329,65 +329,41 @@ ;; definition for method 12 of type touching-list ;; INFO: Return type mismatch int vs none. (defmethod send-events-for-touching-shapes touching-list ((obj touching-list)) - (let ((gp-0 (the-as object (-> obj touching-shapes)))) - (countdown (s5-0 (-> obj num-touching-shapes)) - (let ((s4-0 (-> (the-as touching-shapes-entry gp-0) cshape1))) - (when s4-0 - (let ((s3-0 (-> (the-as touching-shapes-entry gp-0) cshape2))) - (when (= (-> s3-0 process type) target) - (let ((v1-2 s4-0)) - (set! s4-0 s3-0) - (set! s3-0 v1-2) + (let ((entry (the-as touching-shapes-entry (-> obj touching-shapes)))) + (countdown (i (-> obj num-touching-shapes)) + (let ((c1 (-> entry cshape1))) + (when c1 + (let ((c2 (-> entry cshape2))) + (when (= (-> c2 process type) target) + (let ((v1-2 c1)) + (set! c1 c2) + (set! c2 v1-2) ) ) - (let ((v1-4 (-> s4-0 event-self))) - (when v1-4 - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) (-> s3-0 process)) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) (the-as symbol v1-4)) - (set! (-> a1-0 param 0) (the-as uint gp-0)) - (send-event-function (-> s4-0 process) a1-0) + (let ((v1-4 (-> c1 event-self))) + (if v1-4 + (send-event (-> c1 process) v1-4 :from (-> c2 process) entry) ) - ) ) - (let ((v1-5 (-> s4-0 event-other))) - (when v1-5 - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) (-> s4-0 process)) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) (the-as symbol v1-5)) - (set! (-> a1-1 param 0) (the-as uint gp-0)) - (send-event-function (-> s3-0 process) a1-1) + (let ((v1-5 (-> c1 event-other))) + (if v1-5 + (send-event (-> c2 process) v1-5 :from (-> c1 process) entry) ) - ) ) - (let ((v1-6 (-> s3-0 event-self))) - (when v1-6 - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) (-> s4-0 process)) - (set! (-> a1-2 num-params) 1) - (set! (-> a1-2 message) (the-as symbol v1-6)) - (set! (-> a1-2 param 0) (the-as uint gp-0)) - (send-event-function (-> s3-0 process) a1-2) + (let ((v1-6 (-> c2 event-self))) + (if v1-6 + (send-event (-> c2 process) v1-6 :from (-> c1 process) entry) ) - ) ) - (let ((v1-7 (-> s3-0 event-other))) - (when v1-7 - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) (-> s3-0 process)) - (set! (-> a1-3 num-params) 1) - (set! (-> a1-3 message) (the-as symbol v1-7)) - (set! (-> a1-3 param 0) (the-as uint gp-0)) - (send-event-function (-> s4-0 process) a1-3) + (let ((v1-7 (-> c2 event-other))) + (if v1-7 + (send-event (-> c1 process) v1-7 :from (-> c2 process) entry) ) - ) ) ) ) ) - (set! gp-0 (&+ (the-as touching-shapes-entry gp-0) 16)) + (set! entry (-> (the-as (inline-array touching-shapes-entry) entry) 1)) ) ) 0 diff --git a/test/decompiler/reference/engine/collide/collide_REF.gc b/test/decompiler/reference/engine/collide/collide_REF.gc index ac3b598ec4..92b0a5866d 100644 --- a/test/decompiler/reference/engine/collide/collide_REF.gc +++ b/test/decompiler/reference/engine/collide/collide_REF.gc @@ -2,10 +2,7 @@ (in-package goal) ;; definition for symbol *collide-vif0-init*, type (array uint32) -(define *collide-vif0-init* (the-as (array uint32) (new - 'static - 'boxed-array - :type uint32 :length 12 :allocated-length 12 +(define *collide-vif0-init* (the-as (array uint32) (new 'static 'boxed-array :type uint32 #x30000000 #x4d000000 #x4d000000 diff --git a/test/decompiler/reference/engine/collide/main-collide_REF.gc b/test/decompiler/reference/engine/collide/main-collide_REF.gc index 445c408522..d560e1dba7 100644 --- a/test/decompiler/reference/engine/collide/main-collide_REF.gc +++ b/test/decompiler/reference/engine/collide/main-collide_REF.gc @@ -212,11 +212,7 @@ (nop!) (let ((a2-0 (new-stack-vector0))) (.svf (&-> a2-0 quad) vf9) - (add-debug-sphere #t (bucket-id debug-draw0) a2-0 a3-0 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + (add-debug-sphere #t (bucket-id debug) a2-0 a3-0 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) ) ) ) - - - - diff --git a/test/decompiler/reference/engine/data/art-h_REF.gc b/test/decompiler/reference/engine/data/art-h_REF.gc index fbe513c03c..b9847c72df 100644 --- a/test/decompiler/reference/engine/data/art-h_REF.gc +++ b/test/decompiler/reference/engine/data/art-h_REF.gc @@ -307,7 +307,7 @@ ;; definition of type skeleton-group (deftype skeleton-group (basic) - ((art-group-name basic :offset-assert 4) + ((art-group-name string :offset-assert 4) (jgeo int32 :offset-assert 8) (janim int32 :offset-assert 12) (bounds vector :inline :offset-assert 16) diff --git a/test/decompiler/reference/engine/debug/anim-tester_REF.gc b/test/decompiler/reference/engine/debug/anim-tester_REF.gc index 4db1852ca4..5040de90be 100644 --- a/test/decompiler/reference/engine/debug/anim-tester_REF.gc +++ b/test/decompiler/reference/engine/debug/anim-tester_REF.gc @@ -242,7 +242,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-3 (the-as (pointer dma-tag) a3-6) ) @@ -261,7 +261,7 @@ (let ((v1-88 (-> arg0 the-node))) "is this node the start of the list. #t = start" (when (not (not (-> v1-88 prev))) - (while #t + (loop (let ((v1-92 (-> arg0 the-node))) "return the previous node in the list" (let ((v1-93 (-> v1-92 prev))) @@ -298,7 +298,7 @@ (let ((v1-107 (-> arg0 the-node))) "is this node the end of the list. #t = end" (when (not (not (-> v1-107 next))) - (while #t + (loop (let ((v1-111 (-> arg0 the-node))) "return the next node in the list" (let ((v1-112 (-> v1-111 next))) @@ -371,7 +371,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-6 (the-as (pointer dma-tag) a3-12) ) @@ -504,10 +504,10 @@ ;; INFO: Return type mismatch object vs none. (defun anim-tester-num-print ((arg0 basic) (arg1 float)) (cond - ((= arg1 (-> (new 'static 'array float 1 -2.0) 0)) + ((= arg1 -2.0) (format arg0 "max") ) - ((= arg1 (-> (new 'static 'array float 1 -1.0) 0)) + ((= arg1 -1.0) (format arg0 "min") ) (else @@ -700,8 +700,8 @@ (set! (-> (the-as anim-test-seq-item v0-0) privname) arg1) (set! (-> (the-as anim-test-seq-item v0-0) speed) 100) (set! (-> (the-as anim-test-seq-item v0-0) blend) 0) - (set! (-> (the-as anim-test-seq-item v0-0) first-frame) (-> (new 'static 'array float 1 -1.0) 0)) - (set! (-> (the-as anim-test-seq-item v0-0) last-frame) (-> (new 'static 'array float 1 -2.0) 0)) + (set! (-> (the-as anim-test-seq-item v0-0) first-frame) -1.0) + (set! (-> (the-as anim-test-seq-item v0-0) last-frame) -2.0) (the-as anim-test-seq-item v0-0) ) ) @@ -773,7 +773,7 @@ #t " item ~A SP=~f BL=~d FIRST=" (-> s3-0 privname) - (* (-> (new 'static 'array float 1 0.01) 0) (the float (-> s3-0 speed))) + (* 0.01 (the float (-> s3-0 speed))) (-> s3-0 blend) ) (anim-tester-num-print #t (-> s3-0 first-frame)) @@ -812,7 +812,7 @@ ) (format #t "-------------~%") (format #t "current-obj=~A~%" (-> obj current-obj)) - (format #t "speed=~f~%" (* (-> (new 'static 'array float 1 0.01) 0) (the float (-> obj speed)))) + (format #t "speed=~f~%" (* 0.01 (the float (-> obj speed)))) (format #t "--flags:--~%") (the-as anim-tester (format #t " CONNECTED: ~A~%" (if (logtest? (-> obj flags) (anim-tester-flags fanimt0)) "TRUE" @@ -960,10 +960,8 @@ (defbehavior anim-tester-update-anim-info anim-tester ((arg0 anim-test-seq-item)) (set! (-> self anim-first) (-> arg0 first-frame)) (set! (-> self anim-last) (-> arg0 last-frame)) - (set! (-> self anim-gspeed) (* (-> (new 'static 'array float 1 0.01) 0) (the float (-> self speed)))) - (set! (-> self anim-speed) - (* (-> (new 'static 'array float 1 0.01) 0) (-> self anim-gspeed) (the float (-> arg0 speed))) - ) + (set! (-> self anim-gspeed) (* 0.01 (the float (-> self speed)))) + (set! (-> self anim-speed) (* 0.01 (-> self anim-gspeed) (the float (-> arg0 speed)))) (when (< (-> self anim-speed) 0.0) (set! (-> self anim-first) (-> arg0 last-frame)) (set! (-> self anim-last) (-> arg0 first-frame)) @@ -1007,11 +1005,11 @@ (set! (-> self draw art-group) (-> v1-1 obj-art-group)) (set! (-> self draw cur-lod) -1) (set! (-> self draw jgeo) a0-15) - (set! (-> self draw sink-group) (-> *level* level-default foreground-sink-group 1)) + (set! (-> self draw sink-group) (-> *level* level-default pris-tex-foreground-sink-group)) (set! (-> self draw lod-set lod 0 geo) a1-4) ) - (set! (-> self draw lod-set lod 0 dist) (-> (new 'static 'array float 1 4095996000.0) 0)) - (set! (-> self draw bounds w) (-> (new 'static 'array float 1 40960.0) 0)) + (set! (-> self draw lod-set lod 0 dist) 4095996000.0) + (set! (-> self draw bounds w) 40960.0) (set! (-> self draw data-format) (the-as uint 1)) (let ((v1-16 (-> (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) quad))) (set! (-> self draw color-mult quad) v1-16) @@ -1048,13 +1046,13 @@ (gp-0 (-> s3-0 base)) ) (cond - ((= arg1 (-> (new 'static 'array float 1 -1.0) 0)) + ((= arg1 -1.0) (let ((s2-1 draw-string-adv)) (format (clear *temp-string*) "~Smin" arg0) (s2-1 *temp-string* s3-0 arg3) ) ) - ((= arg1 (-> (new 'static 'array float 1 -2.0) 0)) + ((= arg1 -2.0) (let ((s2-2 draw-string-adv)) (format (clear *temp-string*) "~Smax" arg0) (s2-2 *temp-string* s3-0 arg3) @@ -1083,7 +1081,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-2) ) @@ -1180,7 +1178,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-2) ) @@ -1255,7 +1253,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-2 (the-as (pointer dma-tag) a3-4) ) @@ -1309,7 +1307,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-2) ) @@ -1326,7 +1324,7 @@ "is the list empty, #t = empty" (when (not (= (-> v1-15 tailpred) v1-15)) (let ((v1-17 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index)))) - (while #t + (loop "return the previous node in the list" (set! v1-17 (-> (the-as anim-test-obj v1-17) prev)) (let ((a0-23 (the-as anim-test-obj v1-17))) @@ -1350,7 +1348,7 @@ "is the list empty, #t = empty" (when (not (= (-> v1-21 tailpred) v1-21)) (let ((v1-23 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index)))) - (while #t + (loop "return the next node in the list" (set! v1-23 (-> (the-as anim-test-obj v1-23) next)) (let ((a0-40 (the-as anim-test-obj v1-23))) @@ -1428,7 +1426,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-1 (the-as (pointer dma-tag) a3-4) ) @@ -1486,7 +1484,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-2) ) @@ -1503,7 +1501,7 @@ "is the list empty, #t = empty" (when (not (= (-> v1-17 tailpred) v1-17)) (let ((v1-19 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index)))) - (while #t + (loop "return the previous node in the list" (set! v1-19 (-> (the-as anim-test-sequence v1-19) prev)) (let ((a0-24 (the-as anim-test-sequence v1-19))) @@ -1527,7 +1525,7 @@ "is the list empty, #t = empty" (when (not (= (-> v1-23 tailpred) v1-23)) (let ((v1-25 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index)))) - (while #t + (loop "return the next node in the list" (set! v1-25 (-> (the-as anim-test-sequence v1-25) next)) (let ((a0-42 (the-as anim-test-sequence v1-25))) @@ -1600,7 +1598,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-1 (the-as (pointer dma-tag) a3-4) ) @@ -1630,36 +1628,37 @@ ) ;; definition for function anim-tester-adjust-frame +;; INFO: Return type mismatch number vs float. (defun anim-tester-adjust-frame ((arg0 float) (arg1 float)) (cond ((cpad-hold? 0 down) (cond - ((= arg0 (-> (new 'static 'array float 1 -2.0) 0)) - (set! arg0 (+ (-> (new 'static 'array float 1 -1.0) 0) arg1)) + ((= arg0 -2.0) + (set! arg0 (+ -1.0 arg1)) ) - ((!= arg0 (-> (new 'static 'array float 1 -1.0) 0)) - (set! arg0 (+ (-> (new 'static 'array float 1 -1.0) 0) arg0)) + ((!= arg0 -1.0) + (set! arg0 (+ -1.0 arg0)) (if (< arg0 0.0) - (set! arg0 (-> (new 'static 'array float 1 -1.0) 0)) + (set! arg0 (the-as float -1.0)) ) ) ) ) ((cpad-hold? 0 up) (cond - ((= arg0 (-> (new 'static 'array float 1 -1.0) 0)) - (set! arg0 (-> (new 'static 'array float 1 0.0) 0)) + ((= arg0 -1.0) + (set! arg0 (the-as float 0.0)) ) - ((!= arg0 (-> (new 'static 'array float 1 -2.0) 0)) - (set! arg0 (+ (-> (new 'static 'array float 1 1.0) 0) arg0)) + ((!= arg0 -2.0) + (set! arg0 (+ 1.0 arg0)) (if (>= arg0 arg1) - (set! arg0 (-> (new 'static 'array float 1 -2.0) 0)) + (set! arg0 (the-as float -2.0)) ) ) ) ) ) - arg0 + (the-as float arg0) ) ;; definition for function anim-tester-pick-item-setup @@ -1733,7 +1732,7 @@ ;; Used lq/sq (defun anim-test-edit-sequence-list-handler ((arg0 int) (arg1 list-control)) (local-vars - (sv-192 (function string dma-buffer int int font-color font-flags none)) + (sv-192 (function string dma-buffer int int font-color font-flags float)) (sv-208 (function _varargs_ object)) ) (let ((gp-0 (-> arg1 the-node)) @@ -1751,7 +1750,7 @@ *font-default-matrix* (-> arg1 xpos) (-> arg1 ypos) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as font-color (if (= (-> arg1 the-index) (-> arg1 current-index)) 15 12 @@ -1785,7 +1784,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s1-0 (the-as (pointer dma-tag) a3-4) ) @@ -1836,7 +1835,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s1-1 (the-as (pointer dma-tag) a3-8) ) @@ -1930,7 +1929,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) (the-as pointer s4-1) (the-as (pointer dma-tag) a3-15) ) @@ -2227,7 +2226,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-2 (the-as (pointer dma-tag) a3-17) ) @@ -2258,7 +2257,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-3 (the-as (pointer dma-tag) a3-21) ) @@ -2318,7 +2317,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-1 (the-as (pointer dma-tag) a3-1) ) @@ -2360,7 +2359,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-3 (the-as (pointer dma-tag) a3-3) ) @@ -2403,7 +2402,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-4 (the-as (pointer dma-tag) a3-5) ) @@ -2434,7 +2433,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-5 (the-as (pointer dma-tag) a3-7) ) @@ -2462,7 +2461,7 @@ (s4-0 (-> arg0 playing-item)) ) (when (logtest? (-> v0-0 flags) 5) - (while #t + (loop (+! s4-0 1) (if (>= s4-0 (glst-num-elements (-> arg0 item-list))) (set! s4-0 0) @@ -2483,15 +2482,12 @@ ;; failed to figure out what this is: (defstate anim-tester-process (anim-tester) - :event - anim-tester-standard-event-handler - :enter - (behavior () + :event anim-tester-standard-event-handler + :enter (behavior () (logior! (-> self flags) (anim-tester-flags fanimt1)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (zero? (logand (-> self flags) (anim-tester-flags fanimt1))) (= *master-mode* 'menu)) (anim-tester-interface) ) @@ -2500,17 +2496,16 @@ (debug-print-channels (-> self skel) (the-as symbol *stdcon*)) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self root trans) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (s4-0 glst-node) (s5-1 anim-test-seq-item) (gp-2 anim-test-sequence)) - (while #t + (loop (logclear! (-> self flags) (anim-tester-flags fanimt0)) (let ((v1-2 (-> self obj-list))) "is the list empty, #t = empty" @@ -2588,39 +2583,30 @@ (s4-1 (logior! (-> self flags) (anim-tester-flags fanimt0)) (if (nonzero? (-> s5-1 blend)) - (ja-channel-push! 1 (the int (* (the float (-> s5-1 blend)) (-> self anim-gspeed)))) + (ja-channel-push! 1 (the-as time-frame (the int (* (the float (-> s5-1 blend)) (-> self anim-gspeed))))) (ja-channel-set! 1) ) (cond - ((= (-> self anim-first) (-> (new 'static 'array float 1 -1.0) 0)) - (let ((s3-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! s3-0 s4-1 num-func-identity) - (set! (-> s3-0 frame-num) 0.0) - ) + ((= (-> self anim-first) -1.0) + (ja :group! s4-1 :num! min) ) - ((= (-> self anim-first) (-> (new 'static 'array float 1 -2.0) 0)) - (let ((s3-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! s3-1 s4-1 num-func-identity) - (set! (-> s3-1 frame-num) (the float (+ (-> s4-1 data 0 length) -1))) - ) + ((= (-> self anim-first) -2.0) + (ja :group! s4-1 :num! max) ) (else - (let ((s3-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! s3-2 s4-1 num-func-identity) - (set! (-> s3-2 frame-num) (-> self anim-first)) - ) + (ja :group! s4-1 :num! (identity (-> self anim-first))) ) ) (when (nonzero? (-> s5-1 blend)) (while (and (!= (-> self skel root-channel 0) (-> self skel channel)) (logtest? (-> s5-1 flags) 2)) (when (logtest? (-> self flags) (anim-tester-flags fanimt5)) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 + (compute-alignment! (-> self align)) + (align! (-> self align) - 31 - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel keep-other-velocities adjust-quat) + (the-as float 1.0) + (the-as float 1.0) + (the-as float 1.0) ) ) (suspend) @@ -2628,50 +2614,30 @@ ) (until (ja-done? 0) (when (logtest? (-> self flags) (anim-tester-flags fanimt5)) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 + (compute-alignment! (-> self align)) + (align! (-> self align) - 31 - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel keep-other-velocities adjust-quat) + (the-as float 1.0) + (the-as float 1.0) + (the-as float 1.0) ) ) (suspend) (anim-tester-update-anim-info s5-1) - (let ((v1-73 (= (-> self anim-last) (-> (new 'static 'array float 1 -2.0) 0)))) + (let ((v1-73 (= (-> self anim-last) -2.0))) (cond ((or v1-73 (>= (-> self anim-last) (-> self anim-first))) - (cond - ((= (-> self anim-last) (-> (new 'static 'array float 1 -2.0) 0)) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 param 0) (the float (+ (-> a0-42 frame-group data 0 length) -1))) - (set! (-> a0-42 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-42 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (else - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) (-> self anim-last)) - (set! (-> a0-43 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) - ) + (if (= (-> self anim-last) -2.0) + (ja :num! (seek! max (-> self anim-speed))) + (ja :num! (seek! (-> self anim-last) (-> self anim-speed))) ) - ) ) - ((= (-> self anim-last) (-> (new 'static 'array float 1 -1.0) 0)) - (let ((a0-44 (-> self skel root-channel 0))) - (set! (-> a0-44 param 0) 0.0) - (set! (-> a0-44 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-44 (the-as art-joint-anim #f) num-func-seek!) - ) + ((= (-> self anim-last) -1.0) + (ja :num! (seek! 0.0 (-> self anim-speed))) ) (else - (let ((a0-45 (-> self skel root-channel 0))) - (set! (-> a0-45 param 0) (-> self anim-last)) - (set! (-> a0-45 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-45 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (-> self anim-last) (-> self anim-speed))) ) ) ) @@ -2696,8 +2662,7 @@ ) (none) ) - :post - anim-tester-post + :post anim-tester-post ) ;; definition for function initialize-anim-tester @@ -2719,11 +2684,7 @@ (set! (-> self list-con list-owner) (the-as uint self)) (quaternion-identity! (-> self root quat)) (vector-identity! (-> self root scale)) - (position-in-front-of-camera! - (-> self root trans) - (-> (new 'static 'array float 1 40960.0) 0) - (-> (new 'static 'array float 1 4096.0) 0) - ) + (position-in-front-of-camera! (-> self root trans) (the-as float 40960.0) (the-as float 4096.0)) (set! (-> self event-hook) anim-tester-standard-event-handler) (anim-tester-reset) (go anim-tester-process) @@ -2964,19 +2925,7 @@ ;; definition for function anim-tester-start (defun anim-tester-start () (anim-tester-stop) - (let ((gp-0 (get-process *16k-dead-pool* anim-tester #x4000))) - (set! *anim-tester* - (the-as (pointer anim-tester) - (when gp-0 - (let ((t9-2 (method-of-type anim-tester activate))) - (t9-2 (the-as anim-tester gp-0) *default-pool* 'anim-tester (the-as pointer #x70004000)) - ) - ((the-as (function process function none) run-function-in-process) gp-0 initialize-anim-tester) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! *anim-tester* (process-spawn anim-tester :init initialize-anim-tester :from *16k-dead-pool*)) (set! *camera-orbit-target* *anim-tester*) (send-event *camera* 'change-state cam-orbit 0) #f diff --git a/test/decompiler/reference/engine/debug/debug_REF.gc b/test/decompiler/reference/engine/debug/debug_REF.gc index e79dedefe5..879a9863e7 100644 --- a/test/decompiler/reference/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/engine/debug/debug_REF.gc @@ -1276,7 +1276,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-1) ) @@ -1410,7 +1410,7 @@ (if (!= (+ s5-1 1) (-> arg0 h-first)) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> arg0 points s5-1) (-> arg0 points (+ s5-1 1)) (new 'static 'rgba :r #x80 :g #xc0 :b #x80 :a #x80) diff --git a/test/decompiler/reference/engine/debug/default-menu_REF.gc b/test/decompiler/reference/engine/debug/default-menu_REF.gc index 36f8686cf1..c55c5c6761 100644 --- a/test/decompiler/reference/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/engine/debug/default-menu_REF.gc @@ -53,10 +53,10 @@ (send-event *camera* 'reset-root) ) ((= arg0 9) - (set! (-> *camera* master-options) (logxor (-> *camera* master-options) 1)) + (logxor! (-> *camera* master-options) 1) ) ((= arg0 10) - (set! (-> *camera* master-options) (logxor (-> *camera* master-options) 4)) + (logxor! (-> *camera* master-options) 4) ) ((= arg0 11) (send-event *camera* 'toggle-slave-option 32) @@ -179,60 +179,53 @@ ;; definition for function dm-cam-render-float (defun dm-cam-render-float ((arg0 int) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (with-pp - (when (= arg1 (debug-menu-msg press)) - (cond - ((zero? (/ arg0 8)) - (when *math-camera* - (set! (-> *math-camera* fov) (* 182.04445 arg2)) - (update-math-camera - *math-camera* - (-> *setting-control* current video-mode) - (-> *setting-control* current aspect-ratio) - ) - ) - ) - ((= (/ arg0 8) 1) - (if *camera* - (send-event *camera* 'set-fov (* 182.04445 arg2)) - ) - ) - ) - ) + (when (= arg1 (debug-menu-msg press)) (cond ((zero? (/ arg0 8)) - (cond - (*math-camera* - (* 0.005493164 (-> *math-camera* fov)) - ) - (else - (empty) - arg3 + (when *math-camera* + (set! (-> *math-camera* fov) (* 182.04445 arg2)) + (update-math-camera + *math-camera* + (-> *setting-control* current video-mode) + (-> *setting-control* current aspect-ratio) ) ) ) ((= (/ arg0 8) 1) - (cond - (*camera* - (let ((f30-0 0.005493164) - (a1-3 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 0) - (set! (-> a1-3 message) 'query-fov) - (* f30-0 (the-as float (send-event-function *camera* a1-3))) - ) - ) - (else - (empty) - arg3 + (if *camera* + (send-event *camera* 'set-fov (* 182.04445 arg2)) ) + ) + ) + ) + (cond + ((zero? (/ arg0 8)) + (cond + (*math-camera* + (* 0.005493164 (-> *math-camera* fov)) + ) + (else + (empty) + arg3 ) ) - (else - (empty) - arg3 - ) + ) + ((= (/ arg0 8) 1) + (cond + (*camera* + (let ((f30-0 0.005493164)) + (* f30-0 (the-as float (send-event *camera* 'query-fov))) + ) + ) + (else + (empty) + arg3 + ) + ) + ) + (else + (empty) + arg3 ) ) ) @@ -491,7 +484,7 @@ (let ((v1-0 (find-instance-by-name *edit-instance*))) (when v1-0 (if (= arg1 (debug-menu-msg press)) - (set! (-> v1-0 flags) (logxor (-> v1-0 flags) (the-as uint arg0))) + (logxor! (-> v1-0 flags) (the-as uint arg0)) ) (logtest? (-> v1-0 flags) arg0) ) @@ -597,7 +590,7 @@ (cond (v1-0 (if (= arg1 (debug-menu-msg press)) - (set! (-> v1-0 flags) (logxor (-> v1-0 flags) 1)) + (logxor! (-> v1-0 flags) 1) ) (zero? (logand (-> v1-0 flags) 1)) ) @@ -3145,19 +3138,10 @@ ;; definition for function dm-task-get-money (defun dm-task-get-money ((arg0 int) (arg1 debug-menu-msg)) - (with-pp - (if (= arg1 (debug-menu-msg press)) - (send-event *target* 'get-pickup 5 (-> *GAME-bank* money-task-inc)) - ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) pp) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'pickup)) - (set! (-> a1-2 param 1) (the-as uint 5)) - (>= (the-as float (send-event-function *target* a1-2)) (-> *GAME-bank* money-task-inc)) + (if (= arg1 (debug-menu-msg press)) + (send-event *target* 'get-pickup 5 (-> *GAME-bank* money-task-inc)) ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ;; definition for function dm-give-all-cells @@ -3347,13 +3331,13 @@ (case arg0 (('at-apply-align) (if (= arg1 (debug-menu-msg press)) - (set! (-> *anim-tester* 0 flags) (logxor (-> *anim-tester* 0 flags) (anim-tester-flags fanimt5))) + (logxor! (-> *anim-tester* 0 flags) (anim-tester-flags fanimt5)) ) (return (logtest? (-> *anim-tester* 0 flags) (anim-tester-flags fanimt5))) ) (('at-show-joint-info) (if (= arg1 (debug-menu-msg press)) - (set! (-> *anim-tester* 0 flags) (logxor (-> *anim-tester* 0 flags) (anim-tester-flags fanimt4))) + (logxor! (-> *anim-tester* 0 flags) (anim-tester-flags fanimt4)) ) (return (logtest? (-> *anim-tester* 0 flags) (anim-tester-flags fanimt4))) ) @@ -3824,15 +3808,18 @@ (function "Play" #f (lambda () (play #t #t))) (function "Start" #f (lambda () (the-as int (start 'debug (get-or-create-continue! *game-info*))))) (function "Stop" #f (lambda () (stop 'debug))) - (flag "Invulnerable" #f (lambda ((arg0 int) (arg1 debug-menu-msg)) - (when (= arg1 (debug-menu-msg press)) - (if *target* - (set! (-> *target* state-flags) (logxor (-> *target* state-flags) 16)) - ) - ) - (the-as symbol (and *target* (logtest? (-> *target* state-flags) 16))) - ) + (flag + "Invulnerable" + #f + (lambda ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (logxor! (-> *target* state-flags) (state-flags invulnerable)) + ) ) + (the-as symbol (and *target* (logtest? (-> *target* state-flags) (state-flags invulnerable)))) + ) + ) (function "Reset Trans" #f diff --git a/test/decompiler/reference/engine/debug/menu_REF.gc b/test/decompiler/reference/engine/debug/menu_REF.gc index 10862eae61..59c1e1f9e5 100644 --- a/test/decompiler/reference/engine/debug/menu_REF.gc +++ b/test/decompiler/reference/engine/debug/menu_REF.gc @@ -877,7 +877,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 (the-as (pointer dma-tag) a3-1) ) @@ -927,7 +927,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s5-0 (the-as (pointer dma-tag) a3-1) ) @@ -978,7 +978,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s5-0 (the-as (pointer dma-tag) a3-1) ) @@ -1048,7 +1048,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 (the-as (pointer dma-tag) a3-1) ) @@ -1119,7 +1119,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s1-0 (the-as (pointer dma-tag) a3-2) ) @@ -1157,7 +1157,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) sv-32 (the-as (pointer dma-tag) a3-3) ) diff --git a/test/decompiler/reference/engine/debug/part-tester_REF.gc b/test/decompiler/reference/engine/debug/part-tester_REF.gc index 74c9e316c2..9a8d8a46de 100644 --- a/test/decompiler/reference/engine/debug/part-tester_REF.gc +++ b/test/decompiler/reference/engine/debug/part-tester_REF.gc @@ -44,9 +44,8 @@ ;; failed to figure out what this is: (defstate part-tester-idle (part-tester) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((gp-0 (entity-by-name *part-tester-name*))) (when gp-0 (let ((s5-0 (-> gp-0 extra process))) @@ -59,7 +58,7 @@ ) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self root trans) (the-as rgba (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) ) @@ -111,18 +110,13 @@ ;; INFO: Return type mismatch (pointer process) vs none. (defun start-part () (kill-by-type part-tester *active-pool*) - (let ((gp-0 (get-process *debug-part-dead-pool* part-tester #x4000))) - (when gp-0 - (let ((t9-2 (method-of-type part-tester activate))) - (t9-2 (the-as part-tester gp-0) *default-pool* 'part-tester (the-as pointer #x70004000)) + (process-spawn + part-tester + (if *anim-tester* + (-> *anim-tester* 0 root trans) + (target-pos 0) ) - (run-now-in-process gp-0 part-tester-init-by-other (if *anim-tester* - (-> *anim-tester* 0 root trans) - (target-pos 0) - ) - ) - (-> gp-0 ppointer) - ) + :from *debug-part-dead-pool* ) (none) ) diff --git a/test/decompiler/reference/engine/debug/viewer_REF.gc b/test/decompiler/reference/engine/debug/viewer_REF.gc index 9a47fb99a7..c5807c2d58 100644 --- a/test/decompiler/reference/engine/debug/viewer_REF.gc +++ b/test/decompiler/reference/engine/debug/viewer_REF.gc @@ -4,8 +4,7 @@ ;; definition for symbol *viewer-sg*, type skeleton-group (define *viewer-sg* (new 'static 'skeleton-group :bounds (new 'static 'vector :w 16384.0) - :lod-dist - (new 'static 'array float 4 4095996000.0 0.0 0.0 0.0) + :lod-dist (new 'static 'array float 4 4095996000.0 0.0 0.0 0.0) ) ) @@ -33,31 +32,28 @@ ;; failed to figure out what this is: (defstate viewer-process (viewer) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (-> self janim)) - (set! (-> a0-0 param 0) (the float (+ (-> self janim data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (-> self janim) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! (-> self janim) + :num! (seek! (the float (+ (-> self janim data 0 length) -1))) + :frame-num 0.0 + ) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 31 1.0 1.0 1.0) - (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) + (compute-alignment! (-> self align)) + (align! + (-> self align) + (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel keep-other-velocities adjust-quat) + 1.0 + 1.0 + 1.0 ) + (suspend) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior viewer) ja-post) + :post (the-as (function none :behavior viewer) ja-post) ) ;; definition for symbol viewer-string, type string @@ -245,7 +241,7 @@ ;; definition for function birth-viewer ;; INFO: Return type mismatch symbol vs object. -(defun birth-viewer ((arg0 process) (arg1 entity)) +(defun birth-viewer ((arg0 process) (arg1 entity-actor)) (set! (-> arg0 type) viewer) (let ((t9-0 init-entity)) viewer diff --git a/test/decompiler/reference/engine/dma/dma-disasm_REF.gc b/test/decompiler/reference/engine/dma/dma-disasm_REF.gc index b7f36c07c4..0428b298be 100644 --- a/test/decompiler/reference/engine/dma/dma-disasm_REF.gc +++ b/test/decompiler/reference/engine/dma/dma-disasm_REF.gc @@ -31,13 +31,9 @@ ) ;; definition for symbol *vif-disasm-table*, type (array vif-disasm-element) -(define - *vif-disasm-table* +(define *vif-disasm-table* (the-as (array vif-disasm-element) - (new - 'static - 'boxed-array - :type vif-disasm-element :length 34 :allocated-length 34 + (new 'static 'boxed-array :type vif-disasm-element (new 'static 'vif-disasm-element :mask #x7f :string1 "nop") (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 stcycl) :print #x2 :string1 "stcycl") (new 'static 'vif-disasm-element diff --git a/test/decompiler/reference/engine/draw/drawable-tree_REF.gc b/test/decompiler/reference/engine/draw/drawable-tree_REF.gc index 5ee003c6c6..048e742a11 100644 --- a/test/decompiler/reference/engine/draw/drawable-tree_REF.gc +++ b/test/decompiler/reference/engine/draw/drawable-tree_REF.gc @@ -67,7 +67,7 @@ (t1-6 (&+ arg0 t1-5)) (t2-3 (&+ arg0 t2-2)) ) - (while #t + (loop (let ((t3-0 (-> t1-6 0))) (set! t1-6 (&-> t1-6 1)) (let ((t4-0 128)) diff --git a/test/decompiler/reference/engine/draw/drawable_REF.gc b/test/decompiler/reference/engine/draw/drawable_REF.gc index 92c502e3d0..3851955afb 100644 --- a/test/decompiler/reference/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/engine/draw/drawable_REF.gc @@ -157,12 +157,19 @@ (when (sphere-cull (-> arg0 bsphere)) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (-> arg0 bsphere) (-> arg0 bsphere w) (new 'static 'rgba :r #x80 :a #x80) ) - (add-debug-text-3d #t (bucket-id debug-draw1) arg1 (-> arg0 bsphere) (font-color white) (the-as vector2h #f)) + (add-debug-text-3d + #t + (bucket-id debug-no-zbuf) + arg1 + (-> arg0 bsphere) + (font-color white) + (the-as vector2h #f) + ) ) ) ) @@ -572,8 +579,8 @@ (logclear! (-> arg1 status) (draw-status was-drawn)) (when (zero? (logand (-> arg1 status) (draw-status hidden no-anim no-skeleton-update))) (let ((s4-0 (the-as vector (+ 48 (the-as int (the-as terrain-context #x70000000))))) - (s2-0 (the-as vu-lights (+ 64 (the-as int (the-as terrain-context #x70000000))))) - (s3-0 *time-of-day-context*) + (vu-lgt (the-as vu-lights (+ 64 (the-as int (the-as terrain-context #x70000000))))) + (tod *time-of-day-context*) ) (.lvf vf16 (&-> arg1 origin quad)) (.lvf vf17 (&-> arg1 bounds quad)) @@ -585,135 +592,130 @@ (when (sphere-in-view-frustum? (the-as sphere s4-0)) (case (-> arg1 global-effect) (((draw-effect title)) - (when (not (-> s3-0 title-updated)) - (set! (-> s3-0 title-updated) #t) + (when (not (-> tod title-updated)) + (set! (-> tod title-updated) #t) (let ((s0-0 (-> *math-camera* inv-camera-rot)) (a1-1 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) ) (set-vector! a1-1 0.612 0.5 -0.612 0.0) (set-vector! s1-0 -0.696 0.174 0.696 0.0) - (vector-matrix*! (the-as vector (-> s3-0 title-light-group)) a1-1 s0-0) - (vector-matrix*! (the-as vector (-> s3-0 title-light-group dir1)) s1-0 s0-0) + (vector-matrix*! (the-as vector (-> tod title-light-group)) a1-1 s0-0) + (vector-matrix*! (the-as vector (-> tod title-light-group dir1)) s1-0 s0-0) ) (set-vector! (-> *time-of-day-context* current-shadow) 0.612 -0.5 -0.612 1.0) ) - (vu-lights<-light-group! s2-0 (-> s3-0 title-light-group)) + (vu-lights<-light-group! vu-lgt (-> tod title-light-group)) ) (else - (let ((f28-0 (-> arg1 secondary-interp)) - (f30-0 (-> arg1 current-secondary-interp)) - (v1-17 (-> arg1 shadow-mask)) - (a0-10 (-> arg1 level-index)) - (s0-1 (-> s3-0 light-group (-> *target* draw light-index))) - (s1-1 (new 'stack-no-clear 'light-group)) + (let ((interp (-> arg1 secondary-interp)) + (cur-interp (-> arg1 current-secondary-interp)) + (shadow-msk (-> arg1 shadow-mask)) + (lev-idx (-> arg1 level-index)) + (lgt (-> tod light-group (-> *target* draw light-index))) + (cur-lgt (new 'stack-no-clear 'light-group)) ) (cond ((= (-> arg1 light-index) 255) ) - ((= a0-10 2) - (set! s0-1 (-> s3-0 light-group (-> arg1 light-index))) + ((= lev-idx 2) + (set! lgt (-> tod light-group (-> arg1 light-index))) ) (else - (set! s0-1 (-> s3-0 moods a0-10 light-group (-> arg1 light-index))) + (set! lgt (-> tod moods lev-idx light-group (-> arg1 light-index))) ) ) - (when (not (or (= a0-10 2) (zero? v1-17))) - (let* ((a1-22 (-> s3-0 light-masks-0 a0-10)) - (a2-14 (-> s3-0 light-masks-1 a0-10)) - (f26-0 (-> s3-0 light-interp a0-10)) - (a0-13 (logand a1-22 v1-17)) - (v1-18 (logand a2-14 v1-17)) + (when (not (or (= lev-idx 2) (zero? shadow-msk))) + (let* ((lgt-msk-0 (-> tod light-masks-0 lev-idx)) + (lgt-msk-1 (-> tod light-masks-1 lev-idx)) + (lgt-interp (-> tod light-interp lev-idx)) + (a0-13 (logand lgt-msk-0 shadow-msk)) + (v1-18 (logand lgt-msk-1 shadow-msk)) ) (cond ((and (zero? a0-13) (zero? v1-18)) ) (else - (set! f28-0 (cond - ((and (nonzero? a0-13) (nonzero? v1-18)) - 1.0 - ) - ((zero? a0-13) - (quad-copy! (the-as pointer s1-1) (the-as pointer s0-1) 12) - (set! s0-1 s1-1) - (set! (-> s0-1 dir1 levels x) 0.0) - f26-0 - ) - (else - (quad-copy! (the-as pointer s1-1) (the-as pointer s0-1) 12) - (set! s0-1 s1-1) - (set! (-> s0-1 dir0 levels x) 0.0) - (- 1.0 f26-0) + (set! interp (cond + ((and (nonzero? a0-13) (nonzero? v1-18)) + 1.0 ) - ) + ((zero? a0-13) + (quad-copy! (the-as pointer cur-lgt) (the-as pointer lgt) 12) + (set! lgt cur-lgt) + (set! (-> lgt dir1 levels x) 0.0) + lgt-interp + ) + (else + (quad-copy! (the-as pointer cur-lgt) (the-as pointer lgt) 12) + (set! lgt cur-lgt) + (set! (-> lgt dir0 levels x) 0.0) + (- 1.0 lgt-interp) + ) + ) ) ) ) ) ) (if *teleport* - (set! f30-0 f28-0) + (set! cur-interp interp) ) - (when (not (or (paused?) (= f28-0 f30-0))) - (let ((f0-15 (- f30-0 f28-0))) - (set! f30-0 (cond - ((< (fabs f0-15) 0.2) - f28-0 - ) - ((< f0-15 0.0) - (+ 0.2 f30-0) - ) - (else - (+ -0.2 f30-0) - ) - ) + (when (not (or (paused?) (= interp cur-interp))) + (let ((f0-15 (- cur-interp interp))) + (set! cur-interp (cond + ((< (fabs f0-15) 0.2) + interp + ) + ((< f0-15 0.0) + (+ 0.2 cur-interp) + ) + (else + (+ -0.2 cur-interp) + ) + ) ) ) - (set! (-> arg1 current-secondary-interp) f30-0) + (set! (-> arg1 current-secondary-interp) cur-interp) ) (cond - ((= f30-0 0.0) - (vu-lights<-light-group! s2-0 s0-1) + ((= cur-interp 0.0) + (vu-lights<-light-group! vu-lgt lgt) ) (else - (if (!= s0-1 s1-1) - (quad-copy! (the-as pointer s1-1) (the-as pointer s0-1) 12) + (if (!= lgt cur-lgt) + (quad-copy! (the-as pointer cur-lgt) (the-as pointer lgt) 12) ) - (let ((f0-20 (- 1.0 f30-0))) - (set! (-> s1-1 dir0 levels x) (* (-> s1-1 dir0 levels x) f0-20)) - (set! (-> s1-1 dir0 levels y) (* (-> s1-1 dir0 levels y) f0-20)) - (set! (-> s1-1 dir1 levels x) (* (-> s1-1 dir1 levels x) f0-20)) - (set! (-> s1-1 dir1 levels y) (* (-> s1-1 dir1 levels y) f0-20)) - (set! (-> s1-1 dir2 levels x) (* (-> s1-1 dir2 levels x) f0-20)) - (set! (-> s1-1 dir2 levels y) (* (-> s1-1 dir2 levels y) f0-20)) + (let ((f0-20 (- 1.0 cur-interp))) + (set! (-> cur-lgt dir0 levels x) (* (-> cur-lgt dir0 levels x) f0-20)) + (set! (-> cur-lgt dir0 levels y) (* (-> cur-lgt dir0 levels y) f0-20)) + (set! (-> cur-lgt dir1 levels x) (* (-> cur-lgt dir1 levels x) f0-20)) + (set! (-> cur-lgt dir1 levels y) (* (-> cur-lgt dir1 levels y) f0-20)) + (set! (-> cur-lgt dir2 levels x) (* (-> cur-lgt dir2 levels x) f0-20)) + (set! (-> cur-lgt dir2 levels y) (* (-> cur-lgt dir2 levels y) f0-20)) ) - (vu-lights<-light-group! s2-0 s1-1) + (vu-lights<-light-group! vu-lgt cur-lgt) ) ) ) - (.lvf vf2 (&-> s2-0 color 0 quad)) - (.lvf vf3 (&-> s2-0 color 1 quad)) - (.lvf vf4 (&-> s2-0 color 2 quad)) - (.lvf vf5 (&-> s2-0 ambient quad)) + (.lvf vf2 (&-> vu-lgt color 0 quad)) + (.lvf vf3 (&-> vu-lgt color 1 quad)) + (.lvf vf4 (&-> vu-lgt color 2 quad)) + (.lvf vf5 (&-> vu-lgt ambient quad)) (.mul.vf vf5 vf5 vf28) (.mul.vf vf2 vf2 vf28) (.mul.vf vf3 vf3 vf28) (.mul.vf vf4 vf4 vf28) (.add.vf vf5 vf5 vf29) - (.svf (&-> s2-0 color 0 quad) vf2) - (.svf (&-> s2-0 color 1 quad) vf3) - (.svf (&-> s2-0 color 2 quad) vf4) - (.svf (&-> s2-0 ambient quad) vf5) + (.svf (&-> vu-lgt color 0 quad) vf2) + (.svf (&-> vu-lgt color 1 quad) vf3) + (.svf (&-> vu-lgt color 2 quad) vf4) + (.svf (&-> vu-lgt ambient quad) vf5) (.mov v1-37 vf5) ) ) (if *display-lights* - (add-debug-lights - #t - (bucket-id debug-draw0) - (the-as (inline-array light) (-> s3-0 light-group)) - (-> arg1 origin) - ) + (add-debug-lights #t (bucket-id debug) (the-as (inline-array light) (-> tod light-group)) (-> arg1 origin)) ) (let ((at-0 *math-camera*)) (.lvf vf16 (&-> at-0 plane 0 quad)) @@ -1533,7 +1535,7 @@ (set! (-> new-frame bucket-group) (dma-buffer-add-buckets (-> new-frame calc-buf) 69)) ) (debug-init-buffer - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24) :zmsk #x1) (new 'static 'gs-test :zte #x1 :ztst (gs-ztest always)) ) @@ -1629,7 +1631,7 @@ ) (toggle-pause) ) - (when (or (not *progress-process*) (dummy-32 (-> *progress-process* 0))) + (when (or (not *progress-process*) (can-go-back? (-> *progress-process* 0))) (if (or (cpad-pressed? 0 select r3 start) (and (logtest? (-> *cpad-list* cpads 0 valid) 128) (= *master-mode* 'game) diff --git a/test/decompiler/reference/engine/draw/process-drawable_REF.gc b/test/decompiler/reference/engine/draw/process-drawable_REF.gc index 8f6d47ab8f..28e765e0f2 100644 --- a/test/decompiler/reference/engine/draw/process-drawable_REF.gc +++ b/test/decompiler/reference/engine/draw/process-drawable_REF.gc @@ -167,7 +167,7 @@ (set! gp-0 (the-as cspace-array #f)) (goto cfg-16) ) - (let ((v1-10 ((method-of-type cspace dummy-9) (the-as cspace (-> gp-0 data)) #f))) + (let ((v1-10 ((method-of-type cspace reset-and-assign-geo!) (the-as cspace (-> gp-0 data)) #f))) (set! (-> v1-10 bone) (the-as bone (-> s4-1 bones))) (let ((a0-6 (-> gp-0 data))) (set! (-> a0-6 0 param0) cspace<-transformq!) @@ -176,13 +176,13 @@ (set! (-> v1-10 bone cache bone-matrix) (the-as uint 0)) ) 0 - (let ((v1-14 (dummy-9 (-> gp-0 data 1) #f))) + (let ((v1-14 (reset-and-assign-geo! (-> gp-0 data 1) #f))) (set! (-> v1-14 joint) (-> arg0 data 0)) (set! (-> v1-14 bone) (-> s4-1 bones 1)) (set! (-> v1-14 parent) (the-as cspace (-> gp-0 data))) (set! (-> v1-14 bone cache bone-matrix) (the-as uint 128)) ) - (let ((v1-17 (dummy-9 (-> gp-0 data 2) #f))) + (let ((v1-17 (reset-and-assign-geo! (-> gp-0 data 2) #f))) (set! (-> v1-17 joint) (-> arg0 data 1)) (set! (-> v1-17 bone) (-> s4-1 bones 2)) (set! (-> v1-17 parent) (the-as cspace (-> gp-0 data))) @@ -200,7 +200,7 @@ 0 ) ) - (v1-29 (dummy-9 (-> gp-0 data s3-0) #f)) + (v1-29 (reset-and-assign-geo! (-> gp-0 data s3-0) #f)) ) (set! (-> v1-29 joint) s1-0) (set! (-> v1-29 bone) (-> s4-1 bones s3-0)) @@ -381,7 +381,7 @@ (defun draw-joint-spheres ((arg0 process-drawable)) (dotimes (s5-0 (-> arg0 node-list length)) (let ((a2-0 (vector<-cspace! (new-stack-vector0) (-> arg0 node-list data s5-0)))) - (add-debug-sphere #t (bucket-id debug-draw0) a2-0 819.2 (new 'static 'rgba :g #xff :a #x40)) + (add-debug-sphere #t (bucket-id debug) a2-0 819.2 (new 'static 'rgba :g #xff :a #x40)) ) ) #f @@ -401,10 +401,9 @@ ;; failed to figure out what this is: (defstate process-drawable-art-error (process-drawable) - :code - (behavior ((arg0 string)) + :code (behavior ((arg0 string)) (logior! (-> self entity extra perm status) (entity-perm-status bit-1)) - (while #t + (loop (when *display-entity-errors* (let ((s5-0 add-debug-text-3d) (s4-0 #t) @@ -429,10 +428,8 @@ ;; failed to figure out what this is: (defstate process-drawable-idle (process-drawable) - :code - anim-loop - :post - ja-post + :code anim-loop + :post ja-post ) ;; definition for method 14 of type process-drawable @@ -456,15 +453,7 @@ ) ) ) - (let ((s4-0 (load-to-heap-by-name - (-> s1-0 art-group) - (the-as string (-> arg0 art-group-name)) - #f - global - (-> arg0 version) - ) - ) - ) + (let ((s4-0 (load-to-heap-by-name (-> s1-0 art-group) (-> arg0 art-group-name) #f global (-> arg0 version)))) (when (or (zero? s4-0) (or (not s4-0) (!= (-> s4-0 type) art-group))) (go process-drawable-art-error "art-group") (set! s3-0 (the-as draw-control #f)) @@ -616,44 +605,46 @@ ;; definition for method 16 of type process-drawable ;; INFO: Return type mismatch trsqv vs collide-shape. -(defmethod apply-alignment process-drawable ((obj process-drawable) (arg0 int) (arg1 transformq) (arg2 vector)) - (when (logtest? arg0 7) +(defmethod apply-alignment process-drawable ((obj process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector)) + (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) (let* ((body-T-world (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj root quat))) (world-T-body (matrix-transpose! (new 'stack-no-clear 'matrix) body-T-world)) (grav-rt-body (vector-matrix*! (new 'stack-no-clear 'vector) (-> *standard-dynamics* gravity) world-T-body)) (vel-rt-body (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj root transv) world-T-body)) ) - (if (logtest? arg0 2048) + (if (logtest? arg0 (align-opts no-gravity)) (set-vector! grav-rt-body 0.0 0.0 0.0 1.0) ) - (when (logtest? arg0 1) + (when (logtest? arg0 (align-opts adjust-x-vel)) (set! (-> vel-rt-body x) (+ (* (-> arg1 trans x) (-> arg2 x) (-> *display* frames-per-second)) (* (-> grav-rt-body x) (-> *display* seconds-per-frame)) ) ) - (if (zero? (logand arg0 12)) + (if (zero? (logand arg0 (align-opts adjust-xz-vel keep-other-velocities))) (set! (-> vel-rt-body z) 0.0) ) ) - (if (and (logtest? arg0 2) (not (and (logtest? arg0 4096) (= (-> arg1 trans y) 0.0)))) + (if (and (logtest? arg0 (align-opts adjust-y-vel)) + (not (and (logtest? arg0 (align-opts ignore-y-if-zero)) (= (-> arg1 trans y) 0.0))) + ) (set! (-> vel-rt-body y) (+ (* (-> arg1 trans y) (-> arg2 y) (-> *display* frames-per-second)) (* (-> grav-rt-body y) (-> *display* seconds-per-frame)) ) ) ) - (when (logtest? arg0 4) + (when (logtest? arg0 (align-opts adjust-xz-vel)) (set! (-> vel-rt-body z) (+ (* (-> arg1 trans z) (-> arg2 z) (-> *display* frames-per-second)) (* (-> grav-rt-body z) (-> *display* seconds-per-frame)) ) ) - (if (zero? (logand arg0 9)) + (if (zero? (logand arg0 (align-opts adjust-x-vel keep-other-velocities))) (set! (-> vel-rt-body x) 0.0) ) ) (vector-matrix*! (-> obj root transv) vel-rt-body body-T-world) ) ) - (if (logtest? arg0 16) + (if (logtest? arg0 (align-opts adjust-quat)) (quaternion-normalize! (quaternion*! (-> obj root quat) (-> obj root quat) (-> arg1 quat))) ) (the-as collide-shape (-> obj root)) @@ -761,7 +752,7 @@ ) ;; definition for function ja-channel-push! -(defbehavior ja-channel-push! process-drawable ((arg0 int) (arg1 int)) +(defbehavior ja-channel-push! process-drawable ((arg0 int) (arg1 time-frame)) (cond ((or (zero? (-> self skel active-channels)) (zero? arg1) @@ -1017,7 +1008,7 @@ ) ;; definition for method 9 of type joint-control -(defmethod dummy-9 joint-control ((obj joint-control)) +(defmethod current-cycle-distance joint-control ((obj joint-control)) (cond ((< (the-as int (-> obj root-channel)) (the-as int (-> obj channel (-> obj active-channels)))) (let ((s5-0 (-> obj root-channel (-> obj root-channel 0 group-size))) @@ -1052,7 +1043,7 @@ ;; definition for function anim-loop (defbehavior anim-loop process-drawable () (logior! (-> self mask) (process-mask sleep-code)) - (while #t + (loop (nop!) (suspend) ) @@ -1096,8 +1087,8 @@ ;; definition for function process-drawable-delay-player (defbehavior process-drawable-delay-player process-drawable ((arg0 time-frame)) (while (and *target* - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) (suspend) ) @@ -1155,7 +1146,7 @@ ) (set! (-> s4-0 options) (fact-options)) (if arg2 - (set! (-> s4-0 options) (fact-options fop6)) + (set! (-> s4-0 options) (fact-options instant-collect)) ) (when (and (nonzero? s5-0) (not (task-complete? *game-info* s5-0))) (label cfg-12) @@ -1215,11 +1206,10 @@ (else (set! s5-0 (cond ((valid? (-> s2-0 frame-group) art-joint-anim "joint-control frame-group" #t *valid-con*) - (when (not - (and (>= (the int (-> s2-0 frame-num)) 0) - (< (the int (-> s2-0 frame-num)) (-> s2-0 frame-group data 0 length)) - ) - ) + (when (not (and (>= (the int (-> s2-0 frame-num)) 0) + (< (the int (-> s2-0 frame-num)) (-> s2-0 frame-group data 0 length)) + ) + ) (format *valid-con* "ERROR: ~`joint-control-channel`P #~D has an invalid frame-num ~F/~D [0-~D]~%" diff --git a/test/decompiler/reference/engine/entity/actor-link-h_REF.gc b/test/decompiler/reference/engine/entity/actor-link-h_REF.gc index ab3d73d1ac..943217d975 100644 --- a/test/decompiler/reference/engine/entity/actor-link-h_REF.gc +++ b/test/decompiler/reference/engine/entity/actor-link-h_REF.gc @@ -164,7 +164,7 @@ (set! s4-0 (entity-actor-lookup s4-0 'prev-actor 0)) ) (while s4-0 - (if (arg0 (the-as entity-actor s4-0) arg1) + (if (arg0 s4-0 arg1) (return (the-as int #f)) ) (let ((a0-4 s4-0)) @@ -292,7 +292,7 @@ ;; definition for method 9 of type actor-link-info (defmethod get-matching-actor-type-mask actor-link-info ((obj actor-link-info) (matching-type type)) - (let ((actor (the-as entity-actor (-> obj process entity))) + (let ((actor (-> obj process entity)) (mask 0) ) (let ((current-bit 1)) diff --git a/test/decompiler/reference/engine/entity/entity-table_REF.gc b/test/decompiler/reference/engine/entity/entity-table_REF.gc index 81784d2b46..494fe77e2e 100644 --- a/test/decompiler/reference/engine/entity/entity-table_REF.gc +++ b/test/decompiler/reference/engine/entity/entity-table_REF.gc @@ -2,13 +2,9 @@ (in-package goal) ;; definition for symbol *entity-info*, type (array entity-info) -(define *entity-info* (the-as (array entity-info) (new - 'static - 'boxed-array - :type entity-info :length 19 :allocated-length 19 +(define *entity-info* (the-as (array entity-info) (new 'static 'boxed-array :type entity-info (new 'static 'entity-info - :ptype - (type-ref sage-finalboss :method-count 53) + :ptype (type-ref sage-finalboss :method-count 53) :package "l1" :art-group '() :pool '*16k-dead-pool* @@ -22,8 +18,7 @@ :heap-size #x8000 ) (new 'static 'entity-info - :ptype - (type-ref assistant-levitator :method-count 53) + :ptype (type-ref assistant-levitator :method-count 53) :package "l1" :art-group '() :pool '*16k-dead-pool* @@ -58,8 +53,7 @@ :heap-size #x400 ) (new 'static 'entity-info - :ptype - (type-ref pickup-spawner :method-count 30) + :ptype (type-ref pickup-spawner :method-count 30) :package "game" :art-group '() :pool '*16k-dead-pool* @@ -87,8 +81,7 @@ :heap-size #xc00 ) (new 'static 'entity-info - :ptype - (type-ref orb-cache-top :method-count 29) + :ptype (type-ref orb-cache-top :method-count 29) :package "game" :art-group '("orb-cache-top") :pool '*16k-dead-pool* @@ -137,8 +130,7 @@ :heap-size #xc00 ) (new 'static 'entity-info - :ptype - (type-ref target-start :method-count 15) + :ptype (type-ref target-start :method-count 15) :package "game" :art-group '() :pool '*16k-dead-pool* diff --git a/test/decompiler/reference/engine/entity/entity_REF.gc b/test/decompiler/reference/engine/entity/entity_REF.gc index 30bfba5d46..13280c4f04 100644 --- a/test/decompiler/reference/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/engine/entity/entity_REF.gc @@ -841,7 +841,7 @@ (let ((s1-1 (the-as process-drawable (-> s0-0 extra process)))) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s1-1 root trans) (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) ) @@ -857,7 +857,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string (-> s1-1 state name)) (-> s1-1 root trans) (font-color white) @@ -889,7 +889,7 @@ (if (and (the-as structure v0-10) (= (-> v0-10 type) symbol)) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string v0-10) (-> s1-1 root trans) (font-color white) @@ -900,11 +900,11 @@ ) ) ((or (= arg0 'full) (-> s0-0 extra process)) - (add-debug-x #t (bucket-id debug-draw1) s1-0 (the-as rgba (if (-> s0-0 extra process) - (the-as uint #x8080ff80) - (the-as uint #x800000ff) - ) - ) + (add-debug-x #t (bucket-id debug-no-zbuf) s1-0 (the-as rgba (if (-> s0-0 extra process) + (the-as uint #x8080ff80) + (the-as uint #x800000ff) + ) + ) ) (set! sv-192 add-debug-text-3d) (set! sv-208 #t) @@ -961,13 +961,13 @@ (when (and (type-type? (-> s0-3 type) process-drawable) (nonzero? (-> (the-as process-drawable s0-3) draw))) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> (the-as process-drawable s0-3) root trans) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (vector+! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s0-3) draw origin) @@ -1001,15 +1001,15 @@ (s4-2 (-> (the-as process-drawable s5-2) root trans)) ) (when s3-2 - (add-debug-x #t (bucket-id debug-draw1) s4-2 (the-as rgba (if (-> s3-2 extra process) - (the-as uint #x8080ff80) - (the-as uint #x800000ff) - ) - ) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-2 (the-as rgba (if (-> s3-2 extra process) + (the-as uint #x8080ff80) + (the-as uint #x800000ff) + ) + ) ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (res-lump-struct s3-2 'name string) s4-2 (the-as font-color (if (logtest? (-> s3-2 extra perm status) (entity-perm-status bit-0 bit-1)) @@ -1021,7 +1021,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string (-> (the-as process-drawable s5-2) state name)) s4-2 (font-color white) @@ -1049,7 +1049,7 @@ ) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (vector+! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s5-2) draw origin) @@ -1069,7 +1069,7 @@ (if v0-35 (add-debug-box #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (&+ v0-35 0)) (the-as vector (&+ v0-35 16)) (the-as rgba (if (is-object-visible? (-> s5-3 extra level) a1-31) @@ -1165,7 +1165,7 @@ (countdown (s2-4 (-> s3-4 length)) (add-debug-box #t - (bucket-id debug-draw0) + (bucket-id debug) (the-as vector (-> s3-4 data s2-4)) (the-as vector (+ (the-as uint (-> s3-4 data 0 max)) (* s2-4 32))) (the-as rgba (if (zero? (-> s4-4 index)) @@ -1223,7 +1223,7 @@ ;; definition for function init-entity ;; INFO: Return type mismatch process vs none. -(defun init-entity ((proc process) (ent entity)) +(defun init-entity ((proc process) (ent entity-actor)) (activate proc *entity-pool* (res-lump-struct ent 'name basic) (the-as pointer #x70004000)) (set! (-> proc entity) ent) (set! (-> ent extra process) proc) @@ -1272,7 +1272,7 @@ ;; definition for function entity-deactivate-handler ;; INFO: Return type mismatch symbol vs none. -(defun entity-deactivate-handler ((arg0 process) (arg1 entity)) +(defun entity-deactivate-handler ((arg0 process) (arg1 entity-actor)) (when (= arg0 (-> arg1 extra process)) (logclear! (-> arg1 extra perm status) (entity-perm-status bit-1 bit-3)) (set! (-> arg1 extra process) #f) @@ -1633,13 +1633,9 @@ (when (not (paused?)) (let ((s5-1 (-> *display* frames (-> *display* last-screen) frame run-time))) (let ((f0-5 (fmax 327680.0 (fmin (+ 327680.0 (* 204.8 (the float (- 7000 s5-1)))) (-> *ACTOR-bank* birth-dist))))) - (set! (-> *ACTOR-bank* pause-dist) - (seek (-> *ACTOR-bank* pause-dist) f0-5 (* 81920.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> *ACTOR-bank* pause-dist) f0-5 (* 81920.0 (-> *display* seconds-per-frame))) ) - (set! (-> *ACTOR-bank* birth-max) - (seekl (-> *ACTOR-bank* birth-max) (the int (lerp-scale 25.0 1.0 (the float s5-1) 2000.0 7000.0)) 10) - ) + (seekl! (-> *ACTOR-bank* birth-max) (the int (lerp-scale 25.0 1.0 (the float s5-1) 2000.0 7000.0)) 10) ) (if (movie?) (set! (-> *ACTOR-bank* birth-max) 1000) diff --git a/test/decompiler/reference/engine/game/collectables-part_REF.gc b/test/decompiler/reference/engine/game/collectables-part_REF.gc index 27045dbdf7..7cf7011dc7 100644 --- a/test/decompiler/reference/engine/game/collectables-part_REF.gc +++ b/test/decompiler/reference/engine/game/collectables-part_REF.gc @@ -4,7 +4,8 @@ ;; definition for function eco-fadeout ;; INFO: Return type mismatch int vs none. (defun eco-fadeout ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) - (if (zero? (logand (-> (the-as process-drawable (-> arg1 key proc)) state-flags) 1)) + (if (zero? (logand (-> (the-as process-drawable (-> arg1 key proc)) state-flags) (state-flags fade-out-particles)) + ) (set! (-> arg1 next-time) (the-as uint (* (-> *sp-frame-time* x) 2))) ) 0 @@ -20,7 +21,7 @@ (set! (-> arg2 y) (-> a0-3 world-sphere y)) (set! (-> arg2 z) (-> a0-3 world-sphere z)) ) - (if (zero? (logand (-> v1-1 state-flags) 1)) + (if (zero? (logand (-> v1-1 state-flags) (state-flags fade-out-particles))) (set! (-> arg1 next-time) (the-as uint (* (-> *sp-frame-time* x) 2))) ) ) @@ -79,8 +80,7 @@ (defpartgroup group-eco-blue :id 42 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2 :flags (launch-asap) :binding 3) + :parts ((sp-item 2 :flags (launch-asap) :binding 3) (sp-item 3 :fade-after (meters 40) :flags (start-dead launch-asap) :binding 5) (sp-item 3 :fade-after (meters 60) :flags (start-dead launch-asap) :binding 5) (sp-item 3 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 5) @@ -105,8 +105,7 @@ ;; failed to figure out what this is: (defpart 2 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4)) (sp-flt spt-scale-x (meters 0.01)) @@ -119,8 +118,7 @@ ;; failed to figure out what this is: (defpart 3 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.3) (meters 0.15) 1.0) @@ -146,14 +144,12 @@ ;; failed to figure out what this is: (defpart 4 - :init-specs - ((sp-flt spt-fade-a -0.21333334) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.21333334) (sp-int spt-timer 150)) ) ;; failed to figure out what this is: (defpart 5 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.2) (meters 0.1) 1.0) @@ -179,14 +175,12 @@ ;; failed to figure out what this is: (defpart 6 - :init-specs - ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) ) ;; failed to figure out what this is: (defpart 7 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -206,8 +200,7 @@ ;; failed to figure out what this is: (defpart 8 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -227,8 +220,7 @@ ;; failed to figure out what this is: (defpart 9 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -248,8 +240,7 @@ ;; failed to figure out what this is: (defpart 10 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.2 0.2 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -268,8 +259,7 @@ :duration 150 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 11 :flags (launch-asap) :binding 12) + :parts ((sp-item 11 :flags (launch-asap) :binding 12) (sp-item 12 :flags (start-dead launch-asap) :binding 13) (sp-item 12 :flags (start-dead launch-asap) :binding 14) (sp-item 12 :flags (start-dead launch-asap) :binding 13) @@ -292,8 +282,7 @@ ;; failed to figure out what this is: (defpart 11 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -313,8 +302,7 @@ ;; failed to figure out what this is: (defpart 12 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) (sp-flt spt-z (meters 0.08)) @@ -336,8 +324,7 @@ ;; failed to figure out what this is: (defpart 13 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -357,8 +344,7 @@ ;; failed to figure out what this is: (defpart 14 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -378,8 +364,7 @@ ;; failed to figure out what this is: (defpart 147 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -401,8 +386,7 @@ (defpartgroup group-part-vent-blue-active :id 44 :bounds (static-bspherem 0 5 0 5) - :parts - ((sp-item 149 :fade-after (meters 140) :falloff-to (meters 140) :binding 156) + :parts ((sp-item 149 :fade-after (meters 140) :falloff-to (meters 140) :binding 156) (sp-item 149 :fade-after (meters 140) :falloff-to (meters 140) :binding 155) (sp-item 149 :fade-after (meters 140) :falloff-to (meters 140) :binding 154) (sp-item 150) @@ -424,14 +408,12 @@ (defpartgroup group-part-vent-blue-inactive :id 45 :bounds (static-bspherem 0 5 0 5) - :parts - ((sp-item 149 :fade-after (meters 100)) (sp-item 150)) + :parts ((sp-item 149 :fade-after (meters 100)) (sp-item 150)) ) ;; failed to figure out what this is: (defpart 150 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -451,8 +433,7 @@ ;; failed to figure out what this is: (defpart 149 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.05 0.1 1.0) (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -471,8 +452,7 @@ ;; failed to figure out what this is: (defpart 156 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) @@ -492,8 +472,7 @@ ;; failed to figure out what this is: (defpart 155 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) @@ -513,8 +492,7 @@ ;; failed to figure out what this is: (defpart 154 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) @@ -534,8 +512,7 @@ ;; failed to figure out what this is: (defpart 151 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.1 0.5 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -558,8 +535,7 @@ ;; failed to figure out what this is: (defpart 152 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.2 0.4 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -582,8 +558,7 @@ ;; failed to figure out what this is: (defpart 153 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-rnd-flt spt-num 0.3 0.1 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -606,8 +581,7 @@ ;; failed to figure out what this is: (defpart 146 - :init-specs - ((sp-flt spt-r 64.0) + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) (sp-flt spt-fade-r -1.0) (sp-flt spt-fade-g -1.0) @@ -619,8 +593,7 @@ (defpartgroup group-eco-red :id 48 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 160 :flags (launch-asap) :binding 161) + :parts ((sp-item 160 :flags (launch-asap) :binding 161) (sp-item 161 :flags (start-dead launch-asap) :binding 162) (sp-item 161 :flags (start-dead launch-asap) :binding 162) (sp-item 161 :flags (start-dead launch-asap) :binding 162) @@ -641,8 +614,7 @@ ;; failed to figure out what this is: (defpart 160 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4)) (sp-flt spt-scale-x (meters 0.01)) @@ -655,8 +627,7 @@ ;; failed to figure out what this is: (defpart 161 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.15) (meters 0.2) 1.0) @@ -682,14 +653,12 @@ ;; failed to figure out what this is: (defpart 165 - :init-specs - ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) ) ;; failed to figure out what this is: (defpart 162 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.25) (meters 0.1) 1.0) @@ -712,14 +681,12 @@ ;; failed to figure out what this is: (defpart 166 - :init-specs - ((sp-flt spt-fade-a -0.21333334) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.21333334) (sp-int spt-timer 150)) ) ;; failed to figure out what this is: (defpart 163 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -740,8 +707,7 @@ ;; failed to figure out what this is: (defpart 164 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -765,8 +731,7 @@ ;; failed to figure out what this is: (defpart 167 - :init-specs - ((sp-flt spt-fade-g 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0)) ) ;; failed to figure out what this is: @@ -776,8 +741,7 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 168 :flags (launch-asap) :binding 169) + :parts ((sp-item 168 :flags (launch-asap) :binding 169) (sp-item 169 :flags (start-dead launch-asap) :binding 170) (sp-item 169 :flags (start-dead launch-asap) :binding 170) (sp-item 169 :flags (start-dead launch-asap) :binding 170) @@ -793,8 +757,7 @@ ;; failed to figure out what this is: (defpart 168 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -814,8 +777,7 @@ ;; failed to figure out what this is: (defpart 169 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) (sp-flt spt-z (meters 0.08)) @@ -837,8 +799,7 @@ ;; failed to figure out what this is: (defpart 170 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -865,8 +826,7 @@ (defpartgroup group-part-vent-red-active :id 50 :bounds (static-bspherem 0 3 0 5) - :parts - ((sp-item 172 :fade-after (meters 30) :period 330 :length 5 :binding 173) + :parts ((sp-item 172 :fade-after (meters 30) :period 330 :length 5 :binding 173) (sp-item 172 :fade-after (meters 60) :period 736 :length 5 :binding 173) (sp-item 172 :fade-after (meters 90) :period 936 :length 5 :binding 173) (sp-item 172 :fade-after (meters 130) :period 528 :length 5 :binding 173) @@ -904,14 +864,12 @@ (defpartgroup group-part-vent-red-inactive :id 51 :bounds (static-bspherem 0 3 0 5) - :parts - ((sp-item 176 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 177)) + :parts ((sp-item 176 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 177)) ) ;; failed to figure out what this is: (defpart 177 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.6 0.6 1.0) (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -933,8 +891,7 @@ ;; failed to figure out what this is: (defpart 176 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.1 0.3 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -956,8 +913,7 @@ ;; failed to figure out what this is: (defpart 172 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 1.5) 1.0) (sp-flt spt-scale-x (meters 0.01)) @@ -973,8 +929,7 @@ ;; failed to figure out what this is: (defpart 173 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 0.5)) @@ -998,8 +953,7 @@ ;; failed to figure out what this is: (defpart 174 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.25) (meters 0.1) 1.0) @@ -1019,8 +973,7 @@ ;; failed to figure out what this is: (defpart 175 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1045,16 +998,14 @@ ;; failed to figure out what this is: (defpart 171 - :init-specs - ((sp-flt spt-fade-g 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0)) ) ;; failed to figure out what this is: (defpartgroup group-part-vent-yellow-active :id 52 :bounds (static-bspherem 0 3 0 5) - :parts - ((sp-item 178 :fade-after (meters 40) :period 330 :length 5 :binding 179) + :parts ((sp-item 178 :fade-after (meters 40) :period 330 :length 5 :binding 179) (sp-item 178 :fade-after (meters 60) :period 736 :length 5 :binding 179) (sp-item 178 :fade-after (meters 80) :period 936 :length 5 :binding 179) (sp-item 178 :fade-after (meters 100) :period 528 :length 5 :binding 179) @@ -1092,14 +1043,12 @@ (defpartgroup group-part-vent-yellow-inactive :id 53 :bounds (static-bspherem 0 3 0 5) - :parts - ((sp-item 182 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 183)) + :parts ((sp-item 182 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 183)) ) ;; failed to figure out what this is: (defpart 183 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.6 0.6 1.0) (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1121,8 +1070,7 @@ ;; failed to figure out what this is: (defpart 182 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.1 0.3 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1144,8 +1092,7 @@ ;; failed to figure out what this is: (defpart 178 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 1.5) 1.0) (sp-flt spt-scale-x (meters 0.01)) @@ -1161,8 +1108,7 @@ ;; failed to figure out what this is: (defpart 179 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-flt spt-y (meters 0)) @@ -1183,8 +1129,7 @@ ;; failed to figure out what this is: (defpart 180 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1205,8 +1150,7 @@ ;; failed to figure out what this is: (defpart 181 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.5 2.0 1.0) (sp-flt spt-y (meters -0.05)) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.1) 1.0) @@ -1234,16 +1178,14 @@ ;; failed to figure out what this is: (defpart 190 - :init-specs - ((sp-flt spt-fade-r 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0)) ) ;; failed to figure out what this is: (defpartgroup group-eco-yellow :id 56 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 191 :flags (launch-asap) :binding 192) + :parts ((sp-item 191 :flags (launch-asap) :binding 192) (sp-item 192 :flags (start-dead launch-asap) :binding 193) (sp-item 192 :flags (start-dead launch-asap) :binding 193) (sp-item 192 :flags (start-dead launch-asap) :binding 193) @@ -1267,8 +1209,7 @@ ;; failed to figure out what this is: (defpart 191 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4)) (sp-flt spt-scale-x (meters 0.01)) @@ -1281,8 +1222,7 @@ ;; failed to figure out what this is: (defpart 192 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.15) (meters 0.2) 1.0) @@ -1308,14 +1248,12 @@ ;; failed to figure out what this is: (defpart 196 - :init-specs - ((sp-flt spt-fade-a -0.10666667) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.10666667) (sp-int spt-timer 150)) ) ;; failed to figure out what this is: (defpart 193 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.75) (meters 0.1) 1.0) @@ -1338,14 +1276,12 @@ ;; failed to figure out what this is: (defpart 197 - :init-specs - ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) ) ;; failed to figure out what this is: (defpart 194 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1366,8 +1302,7 @@ ;; failed to figure out what this is: (defpart 195 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1389,8 +1324,7 @@ ;; failed to figure out what this is: (defpart 198 - :init-specs - ((sp-flt spt-fade-g 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0)) ) ;; failed to figure out what this is: @@ -1399,8 +1333,7 @@ :duration 150 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 199 :flags (launch-asap) :binding 200) + :parts ((sp-item 199 :flags (launch-asap) :binding 200) (sp-item 200 :flags (start-dead launch-asap) :binding 201) (sp-item 200 :flags (start-dead launch-asap) :binding 201) (sp-item 200 :flags (start-dead launch-asap) :binding 201) @@ -1416,8 +1349,7 @@ ;; failed to figure out what this is: (defpart 199 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1437,8 +1369,7 @@ ;; failed to figure out what this is: (defpart 200 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) (sp-flt spt-z (meters 0.08)) @@ -1460,8 +1391,7 @@ ;; failed to figure out what this is: (defpart 201 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1485,8 +1415,7 @@ (defpartgroup group-eco-green :id 58 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 202 :flags (launch-asap) :binding 203) + :parts ((sp-item 202 :flags (launch-asap) :binding 203) (sp-item 203 :flags (start-dead launch-asap) :binding 204) (sp-item 203 :flags (start-dead launch-asap) :binding 204) (sp-item 203 :flags (start-dead launch-asap) :binding 204) @@ -1509,8 +1438,7 @@ ;; failed to figure out what this is: (defpart 202 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4)) (sp-flt spt-scale-x (meters 0.01)) @@ -1526,8 +1454,7 @@ ;; failed to figure out what this is: (defpart 203 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.3) (meters 0.25) 1.0) @@ -1552,14 +1479,12 @@ ;; failed to figure out what this is: (defpart 206 - :init-specs - ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) ) ;; failed to figure out what this is: (defpart 204 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 0.3)) @@ -1582,14 +1507,12 @@ ;; failed to figure out what this is: (defpart 207 - :init-specs - ((sp-flt spt-fade-a -0.42666668) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.42666668) (sp-int spt-timer 150)) ) ;; failed to figure out what this is: (defpart 205 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-y (meters -0.05)) (sp-flt spt-scale-x (meters 0.3)) @@ -1611,16 +1534,14 @@ ;; failed to figure out what this is: (defpart 208 - :init-specs - ((sp-flt spt-fade-r 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0)) ) ;; failed to figure out what this is: (defpartgroup group-eco-green-pill :id 59 :bounds (static-bspherem 0 0 0 0.4) - :parts - ((sp-item 209 :flags (launch-asap) :binding 210) + :parts ((sp-item 209 :flags (launch-asap) :binding 210) (sp-item 210 :flags (start-dead launch-asap) :binding 211) (sp-item 211 :flags (start-dead launch-asap) :binding 212) (sp-item 212 :flags (start-dead launch-asap) :binding 213) @@ -1633,8 +1554,7 @@ ;; failed to figure out what this is: (defpart 209 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.01)) (sp-copy-from-other spt-scale-y -4) @@ -1649,8 +1569,7 @@ ;; failed to figure out what this is: (defpart 210 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.2) (meters 0.1) 1.0) @@ -1675,14 +1594,12 @@ ;; failed to figure out what this is: (defpart 214 - :init-specs - ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) ) ;; failed to figure out what this is: (defpart 211 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0) (meters 0.2) 1.0) @@ -1707,8 +1624,7 @@ ;; failed to figure out what this is: (defpart 212 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 0.08)) @@ -1731,14 +1647,12 @@ ;; failed to figure out what this is: (defpart 215 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-a -0.8466667) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-a -0.8466667) (sp-int spt-timer 150)) ) ;; failed to figure out what this is: (defpart 213 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-y (meters -0.05)) (sp-flt spt-scale-x (meters 0.15)) @@ -1764,8 +1678,7 @@ :duration 150 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 216 :flags (launch-asap) :binding 217) + :parts ((sp-item 216 :flags (launch-asap) :binding 217) (sp-item 217 :flags (start-dead launch-asap) :binding 218) (sp-item 217 :flags (start-dead launch-asap) :binding 218) (sp-item 217 :flags (start-dead launch-asap) :binding 218) @@ -1785,8 +1698,7 @@ :duration 150 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 216 :flags (launch-asap) :binding 219) + :parts ((sp-item 216 :flags (launch-asap) :binding 219) (sp-item 219 :flags (start-dead launch-asap) :binding 218) (sp-item 219 :flags (start-dead launch-asap) :binding 218) (sp-item 219 :flags (start-dead launch-asap) :binding 218) @@ -1802,8 +1714,7 @@ ;; failed to figure out what this is: (defpart 216 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1822,8 +1733,7 @@ ;; failed to figure out what this is: (defpart 148 - :init-specs - ((sp-flt spt-scale-x (meters 0.1)) + :init-specs ((sp-flt spt-scale-x (meters 0.1)) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-a 0.0) (sp-flt spt-fade-a 0.0) @@ -1832,8 +1742,7 @@ ;; failed to figure out what this is: (defpart 219 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) (sp-flt spt-z (meters 0.08)) @@ -1854,8 +1763,7 @@ ;; failed to figure out what this is: (defpart 217 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) (sp-flt spt-z (meters 0.08)) @@ -1876,8 +1784,7 @@ ;; failed to figure out what this is: (defpart 220 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -0.05)) (sp-flt spt-scale-x (meters 0.3)) @@ -1899,8 +1806,7 @@ ;; failed to figure out what this is: (defpart 218 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -0.05)) (sp-flt spt-scale-x (meters 0.2)) @@ -1924,8 +1830,7 @@ (defpartgroup group-part-vent-green-active :id 62 :bounds (static-bspherem 0 5 0 5) - :parts - ((sp-item 222 :fade-after (meters 80) :falloff-to (meters 80) :period 48 :length 5 :binding 223) + :parts ((sp-item 222 :fade-after (meters 80) :falloff-to (meters 80) :period 48 :length 5 :binding 223) (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) @@ -1963,8 +1868,7 @@ ;; failed to figure out what this is: (defpart 226 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.6 0.6 1.0) (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1986,8 +1890,7 @@ ;; failed to figure out what this is: (defpart 225 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.1 0.3 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2009,8 +1912,7 @@ ;; failed to figure out what this is: (defpart 222 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-scale-x (meters 0.01)) @@ -2024,8 +1926,7 @@ ;; failed to figure out what this is: (defpart 223 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.2) (meters 0.6) 1.0) @@ -2049,14 +1950,12 @@ ;; failed to figure out what this is: (defpart 227 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-a -0.8466667) (sp-int spt-timer 150)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-a -0.8466667) (sp-int spt-timer 150)) ) ;; failed to figure out what this is: (defpart 224 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.2)) (sp-copy-from-other spt-scale-y -4) @@ -2079,8 +1978,7 @@ (defpartgroup group-fuel-cell-starburst :id 63 :bounds (static-bspherem 0 0.5 0 1.5) - :parts - ((sp-item 228 :fade-after (meters 35)) + :parts ((sp-item 228 :fade-after (meters 35)) (sp-item 229 :fade-after (meters 20)) (sp-item 230 :flags (bit1 launch-asap)) (sp-item 231 :flags (bit1 launch-asap)) @@ -2089,8 +1987,7 @@ ;; failed to figure out what this is: (defpart 228 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-int spt-rot-x 4) @@ -2114,14 +2011,12 @@ ;; failed to figure out what this is: (defpart 232 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) ;; failed to figure out what this is: (defpart 229 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-int spt-rot-x 4) @@ -2144,8 +2039,7 @@ ;; failed to figure out what this is: (defpart 230 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3.5)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2163,8 +2057,7 @@ ;; failed to figure out what this is: (defpart 231 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 4)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2198,8 +2091,7 @@ ;; failed to figure out what this is: (defpart 233 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-int spt-rot-x 4) @@ -2222,14 +2114,12 @@ ;; failed to figure out what this is: (defpart 234 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) ;; failed to figure out what this is: (defpart 235 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-int spt-rot-x 4) @@ -2251,8 +2141,7 @@ ;; failed to figure out what this is: (defpart 236 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2.5)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2270,8 +2159,7 @@ ;; failed to figure out what this is: (defpart 237 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2294,14 +2182,12 @@ (defpartgroup group-buzzer-effect :id 65 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 239 :flags (is-3d)) (sp-item 240 :flags (is-3d))) + :parts ((sp-item 239 :flags (is-3d)) (sp-item 240 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 239 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1a :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-scale-x (meters 1.3) (meters 0.2) 1.0) (sp-rnd-flt spt-rot-x 0.0 12743.111 1.0) @@ -2321,8 +2207,7 @@ ;; failed to figure out what this is: (defpart 240 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1a :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-scale-x (meters 1.3) (meters 0.2) 1.0) (sp-rnd-flt spt-rot-x 20024.889 12743.111 1.0) @@ -2347,14 +2232,12 @@ :linger-duration 1200 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 241) (sp-item 242) (sp-item 243)) + :parts ((sp-item 241) (sp-item 242) (sp-item 243)) ) ;; failed to figure out what this is: (defpart 241 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -2378,8 +2261,7 @@ ;; failed to figure out what this is: (defpart 242 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 2) 1.0) (sp-int spt-rot-x 4) @@ -2402,8 +2284,7 @@ ;; failed to figure out what this is: (defpart 243 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 6)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2431,14 +2312,12 @@ :linger-duration 1200 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 246) (sp-item 247) (sp-item 248)) + :parts ((sp-item 246) (sp-item 247) (sp-item 248)) ) ;; failed to figure out what this is: (defpart 246 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -2462,8 +2341,7 @@ ;; failed to figure out what this is: (defpart 247 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 2) 1.0) (sp-int spt-rot-x 4) @@ -2486,8 +2364,7 @@ ;; failed to figure out what this is: (defpart 248 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 6)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2515,14 +2392,12 @@ :linger-duration 1200 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 249) (sp-item 250) (sp-item 251)) + :parts ((sp-item 249) (sp-item 250) (sp-item 251)) ) ;; failed to figure out what this is: (defpart 249 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -2546,14 +2421,12 @@ ;; failed to figure out what this is: (defpart 244 - :init-specs - ((sp-flt spt-fade-a -0.15238096)) + :init-specs ((sp-flt spt-fade-a -0.15238096)) ) ;; failed to figure out what this is: (defpart 250 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 2) 1.0) (sp-int spt-rot-x 4) @@ -2576,8 +2449,7 @@ ;; failed to figure out what this is: (defpart 251 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 6)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2600,8 +2472,7 @@ ;; failed to figure out what this is: (defpart 245 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.025)) (sp-copy-from-other spt-scalevel-y -4)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.025)) (sp-copy-from-other spt-scalevel-y -4)) ) ;; failed to figure out what this is: @@ -2611,14 +2482,12 @@ :linger-duration 1200 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 252) (sp-item 253) (sp-item 254)) + :parts ((sp-item 252) (sp-item 253) (sp-item 254)) ) ;; failed to figure out what this is: (defpart 252 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -2642,8 +2511,7 @@ ;; failed to figure out what this is: (defpart 253 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 2) 1.0) (sp-int spt-rot-x 4) @@ -2666,8 +2534,7 @@ ;; failed to figure out what this is: (defpart 254 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 6)) (sp-flt spt-rot-z (degrees 0.0)) diff --git a/test/decompiler/reference/engine/game/collectables_REF.gc b/test/decompiler/reference/engine/game/collectables_REF.gc index 7b4bb8c7d6..9d98dff75d 100644 --- a/test/decompiler/reference/engine/game/collectables_REF.gc +++ b/test/decompiler/reference/engine/game/collectables_REF.gc @@ -1,6 +1,11 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/buzzer-ag.gc") +(import "goal_src/import/ecovalve-ag.gc") +(import "goal_src/import/money-ag.gc") +(import "goal_src/import/fuel-cell-ag.gc") + ;; definition for symbol *eco-pill-count*, type int (define *eco-pill-count* 0) @@ -31,9 +36,6 @@ (initialize (_type_) _type_ 20) (initialize-params (_type_ time-frame float) none 21) ) - (:states - (hud-collecting handle) - ) ) ;; definition for method 3 of type collectable @@ -74,7 +76,7 @@ ) (cond ((or (= (vector-length (-> obj root-override transv)) 0.0) - (logtest? (-> obj fact options) (fact-options fop6)) + (logtest? (-> obj fact options) (fact-options instant-collect)) ) (vector-reset! (-> obj root-override transv)) ) @@ -200,60 +202,28 @@ (set! (-> obj collect-effect) (-> *part-group-id-table* 68)) (set! (-> obj collect-effect2) (-> *part-group-id-table* 57)) (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "yel-eco-idle") - :volume #x400 - :fo-max 15 - ) - ) + (set! (-> obj sound-name) (static-sound-spec "yel-eco-idle" :fo-max 15)) ) (((pickup-type eco-red)) (set! (-> obj eco-effect) (-> *part-group-id-table* 48)) (set! (-> obj collect-effect) (-> *part-group-id-table* 69)) (set! (-> obj collect-effect2) (-> *part-group-id-table* 49)) (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "red-eco-idle") - :volume #x400 - :fo-max 15 - ) - ) + (set! (-> obj sound-name) (static-sound-spec "red-eco-idle" :fo-max 15)) ) (((pickup-type eco-blue)) (set! (-> obj eco-effect) (-> *part-group-id-table* 42)) (set! (-> obj collect-effect) (-> *part-group-id-table* 67)) (set! (-> obj collect-effect2) (-> *part-group-id-table* 43)) (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "blue-eco-idle") - :volume #x400 - :fo-max 15 - ) - ) + (set! (-> obj sound-name) (static-sound-spec "blue-eco-idle" :fo-max 15)) ) (((pickup-type eco-green)) (set! (-> obj eco-effect) (-> *part-group-id-table* 58)) (set! (-> obj collect-effect) (-> *part-group-id-table* 66)) (set! (-> obj collect-effect2) (-> *part-group-id-table* 61)) (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "green-eco-idle") - :volume #x400 - :fo-max 15 - ) - ) + (set! (-> obj sound-name) (static-sound-spec "green-eco-idle" :fo-max 15)) ) (((pickup-type eco-pill)) (set! (-> obj eco-effect) (-> *part-group-id-table* 59)) @@ -461,24 +431,21 @@ ;; failed to figure out what this is: (defstate blocked (eco-collectable) :virtual #t - :trans - (behavior () + :trans (behavior () (if (task-complete? *game-info* (-> self entity extra perm task)) (go-virtual wait) ) (none) ) - :code - (the-as (function none :behavior eco-collectable) anim-loop) + :code (the-as (function none :behavior eco-collectable) anim-loop) ) ;; failed to figure out what this is: (defstate jump (eco-collectable) :virtual #t - :code - (behavior () + :code (behavior () (if (type-type? (-> self type) fuel-cell) - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") ) (logclear! (-> self mask) (process-mask actor-pause)) (let ((gp-1 (new 'stack 'trajectory))) @@ -498,12 +465,9 @@ (transform-post) (animate self) (suspend) - (when (nonzero? (-> self skel)) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) 0.5) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) + (if (nonzero? (-> self skel)) + (ja :num! (loop! 0.5)) ) - ) ) ) (set! (-> self root-override trans quad) (-> self jump-pos quad)) @@ -523,8 +487,7 @@ ;; failed to figure out what this is: (defstate wait (eco-collectable) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-3 none)) (when (and (or (= arg2 'touch) (= arg2 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) @@ -603,9 +566,8 @@ ) ) ) - :enter - (behavior () - (if (and (logtest? (-> self fact options) (fact-options fop6 can-collect)) + :enter (behavior () + (if (and (logtest? (-> self fact options) (fact-options instant-collect can-collect)) (logtest? (-> self flags) (collectable-flags can-collect)) (!= (-> self next-state name) 'pickup) (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) @@ -614,8 +576,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (cond ((logtest? (-> self flags) (collectable-flags trans)) (vector-v++! @@ -642,7 +603,7 @@ ) (go-virtual notice-blue (process->handle *target*)) ) - (if (and (logtest? (-> self fact options) (fact-options fop6 can-collect)) + (if (and (logtest? (-> self fact options) (fact-options instant-collect can-collect)) (!= (-> self next-state name) 'pickup) (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) ) @@ -659,9 +620,8 @@ (update-transforms! (-> self root-override)) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((gp-0 (-> self part)) (s5-0 (-> self root-override root-prim prim-core)) ) @@ -681,7 +641,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self actor-pause) #f) (logior! (-> self flags) (collectable-flags fading)) - (logior! (-> self state-flags) 1) + (logior! (-> self state-flags) (state-flags fade-out-particles)) (set! (-> gp-0 fade) (* 0.0033333334 (the float v1-10))) ) ) @@ -701,8 +661,7 @@ ;; failed to figure out what this is: (defstate notice-blue (eco-collectable) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (and (or (= arg2 'touch) (= arg2 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) @@ -714,8 +673,7 @@ (go-virtual pickup #f (process->handle arg0)) ) ) - :enter - (behavior ((arg0 handle)) + :enter (behavior ((arg0 handle)) (set! (-> self target) arg0) (set! (-> self speed quad) (the-as uint128 0)) (set! (-> self speed z) (the-as float (if (rand-vu-percent? (the-as float 0.5)) @@ -728,15 +686,13 @@ (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) (set! (-> a1-0 num-params) 2) @@ -749,9 +705,8 @@ ) (none) ) - :code - (behavior ((arg0 handle)) - (while #t + :code (behavior ((arg0 handle)) + (loop (set! (-> self root-override trans quad) (-> self base quad)) (add-blue-motion #t #f #t #f) (update-transforms! (-> self root-override)) @@ -777,8 +732,7 @@ ;; failed to figure out what this is: (defstate pickup (eco-collectable) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -817,8 +771,7 @@ ) ) ) - :enter - (behavior ((arg0 object) (arg1 handle)) + :enter (behavior ((arg0 object) (arg1 handle)) (set! (-> self pickup-handle) arg1) (when (-> self notify-parent) (let ((gp-0 (new 'stack-no-clear 'event-message-block))) @@ -841,8 +794,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :code - (behavior ((arg0 object) (arg1 handle)) + :code (behavior ((arg0 object) (arg1 handle)) (clear-collide-with-as (-> self root-override)) (if (not (or (= (-> self fact pickup-type) (pickup-type eco-pill)) (logtest? (-> self fact options) (fact-options powerup)) @@ -855,13 +807,13 @@ ) (case (-> self fact pickup-type) (((pickup-type eco-yellow)) - (sound-play-by-name (static-sound-name "y-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "y-eco-pickup") ) (((pickup-type eco-red)) - (sound-play-by-name (static-sound-name "r-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "r-eco-pickup") ) (((pickup-type eco-blue)) - (sound-play-by-name (static-sound-name "b-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "b-eco-pickup") (case (-> (level-get-target-inside *level*) name) (('training) (level-hint-spawn @@ -875,85 +827,71 @@ ) ) (((pickup-type eco-green)) - (sound-play-by-name (static-sound-name "g-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "g-eco-pickup") ) (((pickup-type eco-green) (pickup-type eco-pill)) - (sound-play-by-name (static-sound-name "pill-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "pill-pickup") ) ) (if (nonzero? (-> self part)) (kill-and-free-particles (-> self part)) ) (let ((gp-6 (handle->process (-> self pickup-handle)))) - (when (nonzero? (-> self collect-effect)) - (let ((s5-5 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-5 - (let ((t9-17 (method-of-type part-tracker activate))) - (t9-17 (the-as part-tracker s5-5) gp-6 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-5 - part-tracker-init - (-> self collect-effect) - -1 - part-tracker-track-target - #f - #f - (-> self root-override root-prim prim-core) - ) - (-> s5-5 ppointer) + (if (nonzero? (-> self collect-effect)) + (process-spawn + part-tracker + :init part-tracker-init + (-> self collect-effect) + -1 + part-tracker-track-target + #f + #f + (-> self root-override root-prim prim-core) + :to gp-6 ) ) - ) ) - (when (nonzero? (-> self collect-effect2)) - (let ((gp-7 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-7 - (let ((t9-20 (method-of-type part-tracker activate))) - (t9-20 (the-as part-tracker gp-7) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-7 - part-tracker-init - (-> self collect-effect2) - -1 - (lambda ((arg0 part-tracker)) - (let ((s5-0 (handle->process (-> arg0 userdata)))) - (when s5-0 - (let* ((v1-4 (handle->process (-> (the-as eco-collectable s5-0) pickup-handle))) - (a2-0 (cond - ((not v1-4) - (-> arg0 root trans) - ) - ((= (-> v1-4 type) target) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as target v1-4) node-list data 5)) - ) - (else - (-> (the-as target v1-4) control trans) - ) + (if (nonzero? (-> self collect-effect2)) + (process-spawn + part-tracker + :init part-tracker-init + (-> self collect-effect2) + -1 + (lambda ((arg0 part-tracker)) + (let ((s5-0 (handle->process (-> arg0 userdata)))) + (when s5-0 + (let* ((v1-4 (handle->process (-> (the-as eco-collectable s5-0) pickup-handle))) + (a2-0 (cond + ((not v1-4) + (-> arg0 root trans) + ) + ((= (-> v1-4 type) target) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as target v1-4) node-list data 5)) + ) + (else + (-> (the-as target v1-4) control trans) ) ) - ) - (vector-lerp! - (-> arg0 root trans) - (-> arg0 offset) - a2-0 - (/ (the float (- (-> *display* base-frame-counter) (-> arg0 start-time))) - (the float (-> (the-as eco-collectable s5-0) collect-effect-time)) - ) - ) + ) + ) + (vector-lerp! + (-> arg0 root trans) + (-> arg0 offset) + a2-0 + (/ (the float (- (-> *display* base-frame-counter) (-> arg0 start-time))) + (the float (-> (the-as eco-collectable s5-0) collect-effect-time)) + ) ) ) ) ) - (process->handle self) - #f - (-> self root-override root-prim prim-core) ) - (-> gp-7 ppointer) + (process->handle self) + #f + (-> self root-override root-prim prim-core) + :to self ) ) - ) (while (-> self child) (suspend) ) @@ -965,8 +903,7 @@ ;; failed to figure out what this is: (defstate die (eco-collectable) :virtual #t - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status dead) #t) (none) ) @@ -1007,8 +944,7 @@ ;; failed to figure out what this is: (defstate die (eco) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'fade) @@ -1022,19 +958,17 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) (none) ) - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) (logclear! (-> self mask) (process-mask actor-pause)) - (logclear! (-> self fact options) (fact-options fop6 can-collect)) + (logclear! (-> self fact options) (fact-options instant-collect can-collect)) (if (nonzero? (-> self part)) (kill-and-free-particles (-> self part)) ) @@ -1047,15 +981,8 @@ ) ) (else - (while (let ((f30-0 0.0) - (a1-1 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'pickup)) - (set! (-> a1-1 param 1) (the-as uint (-> self fact pickup-type))) - (< f30-0 (the-as float (send-event-function *target* a1-1))) + (while (let ((f30-0 0.0)) + (< f30-0 (the-as float (send-event *target* 'query 'pickup (-> self fact pickup-type)))) ) (suspend) ) @@ -1254,24 +1181,18 @@ ) ;; failed to figure out what this is: -(defskelgroup *money-sg* money - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 0.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *money-sg* money money-lod0-jg money-idle-ja + ((money-lod0-mg (meters 20)) (money-lod1-mg (meters 40)) (money-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.6) + :texture-level 2 + ) ;; failed to figure out what this is: -(defskelgroup *fuel-cell-sg* fuel-cell - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *fuel-cell-sg* fuel-cell fuel-cell-lod0-jg fuel-cell-idle-ja + ((fuel-cell-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) ;; definition of type money (deftype money (eco-collectable) @@ -1320,9 +1241,8 @@ ;; failed to figure out what this is: (defstate wait (money) :virtual #t - :code - (behavior () - (while #t + :code (behavior () + (loop (quaternion-rotate-y! (-> self root-override quat) (-> self root-override quat) @@ -1355,9 +1275,8 @@ ;; failed to figure out what this is: (defstate notice-blue (money) :virtual #t - :code - (behavior ((arg0 handle)) - (while #t + :code (behavior ((arg0 handle)) + (loop (quaternion-rotate-y! (-> self root-override quat) (-> self root-override quat) @@ -1391,8 +1310,7 @@ ;; failed to figure out what this is: (defstate pickup (money) :virtual #t - :code - (behavior ((arg0 object) (arg1 handle)) + :code (behavior ((arg0 object) (arg1 handle)) (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) (process-entity-status! self (entity-perm-status dead) #t) @@ -1448,7 +1366,7 @@ ;; INFO: Return type mismatch object vs none. (defmethod init-from-entity! money ((obj money) (arg0 entity-actor)) (initialize obj) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (initialize-params obj 0 (the-as float 1024.0)) (update-transforms! (-> obj root-override)) (go (method-of-object obj wait)) @@ -1458,7 +1376,7 @@ ;; definition for function money-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior money-init-by-other money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity)) +(defbehavior money-init-by-other money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) (let ((s3-0 (-> arg2 pickup-type)) (f30-0 (-> arg2 pickup-spawn-amount)) ) @@ -1485,7 +1403,7 @@ ;; definition for function money-init-by-other-no-bob ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior money-init-by-other-no-bob money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 float) (arg4 entity)) +(defbehavior money-init-by-other-no-bob money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 float) (arg4 entity-actor)) (set! (-> self entity) arg4) (set! (-> self pickup-type) (the-as pickup-type arg2)) (set! (-> self pickup-amount) arg3) @@ -1654,8 +1572,7 @@ ;; failed to figure out what this is: (defstate wait (fuel-cell) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-3 none)) (when (and (or (= arg2 'touch) (= arg2 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) @@ -1664,12 +1581,12 @@ (not *progress-process*) (!= (-> self next-state name) 'pickup) *target* - (zero? (logand (-> *target* state-flags) #x8100)) + (zero? (logand (-> *target* state-flags) (state-flags grabbed dying))) ) ) ) - (push-setting! *setting-control* self 'allow-progress #f 0.0 0) - (copy-settings-from-target! *setting-control*) + (add-setting! 'allow-progress #f 0.0 0) + (apply-settings *setting-control*) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual pickup #f (process->handle arg0)) ) @@ -1715,14 +1632,11 @@ ) ) ) - :code - (behavior () + :code (behavior () 0.5 (let ((f28-0 0.0)) - (let ((v1-3 (-> self skel root-channel 0))) - (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - ) - (while #t + (ja :group! (-> self draw art-group data 2)) + (loop (let ((f30-0 (vector-vector-distance (-> self base) (target-pos 0)))) (set! f28-0 (if (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (zero? (logand (-> self flags) (collectable-flags anim)))) @@ -1738,10 +1652,7 @@ (transform-post) (fuel-cell-animate) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) f30-1) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-1)) ) ) ) @@ -1753,8 +1664,7 @@ ;; failed to figure out what this is: (defstate pickup (fuel-cell) :virtual #t - :enter - (behavior ((arg0 object) (arg1 handle)) + :enter (behavior ((arg0 object) (arg1 handle)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self state-object) #t) (let ((t9-1 (-> (the-as (state eco-collectable) (find-parent-method fuel-cell 23)) enter))) @@ -1764,8 +1674,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (the-as float (cond ((string= (-> self victory-anim name) "fuel-cell-victory") 97.0 @@ -1810,23 +1719,21 @@ (set! (-> self state-object) #f) (kill-and-free-particles (-> self part)) (logior! (-> self draw status) (draw-status skip-bones)) - (if (not - (or (logtest? (the-as int (res-lump-value (-> self entity) 'options uint128 :time (the-as float -1000000000.0))) - 4096 - ) - (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9))) - ) - ) + (if (not (or (logtest? (res-lump-value (-> self entity) 'options fact-options :time (the-as float -1000000000.0)) + (fact-options powerup) + ) + (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9))) + ) + ) (send-event *camera* 'teleport-to-other-start-string) ) ) ) (none) ) - :code - (behavior ((arg0 object) (arg1 handle)) + :code (behavior ((arg0 object) (arg1 handle)) (local-vars (sv-96 res-tag)) - (sound-play-by-name (static-sound-name "pu-powercell") (new-sound-id) 1024 0 0 1 #t) + (sound-play "pu-powercell") (clear-collide-with-as (-> self root-override)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) @@ -1843,13 +1750,7 @@ (spool-push *art-control* (-> self victory-anim name) 0 self (the-as float -99.0)) (suspend) ) - (while (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) self) - (set! (-> a1-8 num-params) 1) - (set! (-> a1-8 message) 'clone-anim) - (set! (-> a1-8 param 0) (the-as uint self)) - (not (send-event-function *target* a1-8)) - ) + (while (not (send-event *target* 'clone-anim self)) (spool-push *art-control* (-> self victory-anim name) 0 self (the-as float -99.0)) (format #t "WARNING: fuel-cell stall on not cloning.~%") (suspend) @@ -1860,10 +1761,8 @@ (-> self entity) 'movie-pos (inline-array vector) - :tag-ptr - (& sv-96) - :time - (the-as float -1000000000.0) + :tag-ptr (& sv-96) + :time (the-as float -1000000000.0) ) ) (gp-1 (if (and v1-34 (< (-> self movie-pos-index) (the-as int (-> sv-96 elt-count)))) @@ -1901,25 +1800,10 @@ (set! (-> self draw bounds w) 32768.0) (logior! (-> self skel status) (janim-status inited)) (send-event *target* 'blend-shape #t) - (push-setting! *setting-control* self 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) - (push-setting! *setting-control* self 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) - (push-setting! - *setting-control* - self - 'ambient-volume - 'rel - (-> *setting-control* current ambient-volume-movie) - 0 - ) - (let ((gp-3 (get-process *default-dead-pool* othercam #x4000))) - (when gp-3 - (let ((t9-26 (method-of-type othercam activate))) - (t9-26 (the-as othercam gp-3) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-3 othercam-init-by-other self 10 #f #t) - (-> gp-3 ppointer) - ) - ) + (add-setting! 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) + (add-setting! 'ambient-volume 'rel (-> *setting-control* current ambient-volume-movie) 0) + (process-spawn othercam self 10 #f #t :to self) (auto-save-command 'auto-save 0 0 *default-pool*) (ja-play-spooled-anim (-> self victory-anim) @@ -1927,9 +1811,9 @@ (the-as art-joint-anim #f) (the-as (function process-drawable symbol) false-func) ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) - (clear-pending-settings-from-process *setting-control* self 'ambient-volume) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) (send-event *target* 'blend-shape #f) (send-event *target* 'end-mode) (send-event *camera* 'no-intro) @@ -1937,264 +1821,257 @@ (ja-channel-set! 0) (suspend) (suspend) - (let ((gp-4 (get-process *default-dead-pool* process #x4000))) - (when gp-4 - (let ((t9-39 (method-of-type process activate))) - (t9-39 gp-4 self 'process (the-as pointer #x70004000)) + (process-spawn-function + process + (lambda :behavior collectable + ((arg0 game-task)) + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current movie) + (-> *setting-control* current hint) + (str-is-playing?) + ) + (suspend) ) - (run-next-time-in-process - gp-4 - (lambda :behavior collectable - ((arg0 game-task)) - (while (or (-> *setting-control* current ambient) - (-> *setting-control* current movie) - (-> *setting-control* current hint) - (str-is-playing?) - ) - (suspend) - ) - (cond - ((= arg0 (game-task training-buzzer)) - (level-hint-spawn - (game-text-id training-assistant-found-scout-fly-cell) - "asstvb45" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task training-door)) - (level-hint-spawn - (game-text-id training-eco-opened-door) - "sagevb25" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task beach-ecorocks)) - (level-hint-spawn - (game-text-id beach-collectors-unblocked) - "sagevb01" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task misty-cannon)) - (level-hint-spawn - (game-text-id misty-stopped-lurkers-at-silo) - "sagevb02" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task misty-bike)) - (level-hint-spawn - (game-text-id misty-stopped-balloon-lurkers) - "asstvb03" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task firecanyon-end)) - (level-hint-spawn - (game-text-id fire-canyon-we-made-it) - "sksp0095" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task rolling-robbers)) - (level-hint-spawn - (game-text-id rolling-beat-lurkers) - "asstvb20" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task rolling-plants)) - (level-hint-spawn - (game-text-id sage-golfclap-i-have-low-expectations) - "sagevb03" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task swamp-flutflut)) - (level-hint-spawn - (game-text-id swamp-finished-with-flutflut) - "asstvb21" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task ogre-boss)) - (level-hint-spawn - (game-text-id ogre-boss-killed) - "asstvb23" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task ogre-end)) - (level-hint-spawn - (game-text-id assistant-finished-mountain-pass-race) - "asstvb25" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task beach-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task jungle-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task misty-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task firecanyon-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task rolling-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task sunken-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task swamp-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task ogre-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task cave-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task snow-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task lavatube-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task citadel-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task village1-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task village2-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task village3-buzzer)) - (level-hint-spawn - (game-text-id found-all-scout-flies) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ) - (none) - ) - (the int (-> self fact pickup-amount)) + (cond + ((= arg0 (game-task training-buzzer)) + (level-hint-spawn + (game-text-id training-assistant-found-scout-fly-cell) + "asstvb45" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task training-door)) + (level-hint-spawn + (game-text-id training-eco-opened-door) + "sagevb25" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task beach-ecorocks)) + (level-hint-spawn + (game-text-id beach-collectors-unblocked) + "sagevb01" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task misty-cannon)) + (level-hint-spawn + (game-text-id misty-stopped-lurkers-at-silo) + "sagevb02" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task misty-bike)) + (level-hint-spawn + (game-text-id misty-stopped-balloon-lurkers) + "asstvb03" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task firecanyon-end)) + (level-hint-spawn + (game-text-id fire-canyon-we-made-it) + "sksp0095" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task rolling-robbers)) + (level-hint-spawn + (game-text-id rolling-beat-lurkers) + "asstvb20" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task rolling-plants)) + (level-hint-spawn + (game-text-id sage-golfclap-i-have-low-expectations) + "sagevb03" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task swamp-flutflut)) + (level-hint-spawn + (game-text-id swamp-finished-with-flutflut) + "asstvb21" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task ogre-boss)) + (level-hint-spawn + (game-text-id ogre-boss-killed) + "asstvb23" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task ogre-end)) + (level-hint-spawn + (game-text-id assistant-finished-mountain-pass-race) + "asstvb25" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task beach-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task jungle-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task misty-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task firecanyon-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task rolling-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task sunken-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task swamp-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task ogre-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task cave-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task snow-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task lavatube-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task citadel-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task village1-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task village2-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 (game-task village3-buzzer)) + (level-hint-spawn + (game-text-id found-all-scout-flies) + "sksp009k" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) ) - (-> gp-4 ppointer) + (none) ) + (the int (-> self fact pickup-amount)) + :to self ) (case (the int (-> self fact pickup-amount)) (((game-task citadel-sage-blue)) @@ -2218,8 +2095,7 @@ (convert-to-hud-object self (the-as hud (ppointer->process (-> *hud-parts* fuel-cell)))) (none) ) - :post - (behavior () + :post (behavior () (transform-post) (if (-> self state-object) (spawn (-> self part) (the-as vector (-> self root-override root-prim prim-core))) @@ -2257,19 +2133,8 @@ (set! (-> obj base quad) (-> obj root-override trans quad)) (set! (-> obj old-base quad) (-> obj root-override trans quad)) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 63) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "powercell-idle") - :volume #x400 - :fo-max 40 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "powercell-idle" :fo-max 40) (-> obj root-override trans)) ) (set! (-> obj victory-anim) (fuel-cell-pick-anim obj)) obj @@ -2279,7 +2144,7 @@ ;; INFO: Return type mismatch object vs none. (defmethod init-from-entity! fuel-cell ((obj fuel-cell) (arg0 entity-actor)) (initialize obj) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (initialize-params obj 0 (the-as float 1024.0)) (logclear! (-> obj fact options) (fact-options can-collect)) (update-transforms! (-> obj root-override)) @@ -2290,7 +2155,7 @@ ;; definition for function fuel-cell-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior fuel-cell-init-by-other fuel-cell ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity)) +(defbehavior fuel-cell-init-by-other fuel-cell ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) (let ((s3-0 (-> arg2 pickup-type)) (f30-0 (-> arg2 pickup-spawn-amount)) ) @@ -2318,12 +2183,11 @@ (go-virtual jump) ) ((and gp-1 - (zero? - (logand (the-as int (res-lump-value (-> self entity) 'options uint128 :time (the-as float -1000000000.0))) - 128 - ) - ) - (zero? (logand (-> self fact options) (fact-options fop7))) + (zero? (logand (res-lump-value (-> self entity) 'options fact-options :time (the-as float -1000000000.0)) + (fact-options skip-jump-anim) + ) + ) + (zero? (logand (-> self fact options) (fact-options skip-jump-anim))) ) (set! (-> self jump-pos quad) (-> (the-as vector gp-1) quad)) (set! (-> self jump-pos y) (+ 4096.0 (-> self jump-pos y))) @@ -2338,8 +2202,7 @@ ;; failed to figure out what this is: (defstate fuel-cell-clone-anim (fuel-cell) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('pickup) (when (!= (-> self next-state name) 'pickup) @@ -2359,33 +2222,28 @@ (set! (-> self root-override trans quad) (-> self draw origin quad)) (set! (-> self base quad) (-> self root-override trans quad)) (ja-channel-set! 1) - (let ((v1-20 (-> self skel root-channel 0))) - (set! (-> v1-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - ) + (ja :group! (-> self draw art-group data 2)) (logclear! (-> self draw status) (draw-status hidden)) (vector-reset! (-> self draw origin)) (go-virtual wait) ) ) ) - :exit - (behavior () + :exit (behavior () (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) (logclear! (-> self skel status) (janim-status spool)) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (logclear! (-> self mask) (process-mask actor-pause)) (clone-anim arg0 3 #t "") (format #t "ERROR: clone-anim returned in fuel-cell~%") (deactivate self) (none) ) - :post - (behavior () + :post (behavior () (update-transforms! (-> self root-override)) (animate self) (none) @@ -2401,20 +2259,17 @@ (initialize-params self 0 (the-as float 1024.0)) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self actor-pause) #f) - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") (go fuel-cell-clone-anim arg0) (none) ) ;; failed to figure out what this is: -(defskelgroup *buzzer-sg* buzzer - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *buzzer-sg* buzzer buzzer-lod0-jg buzzer-idle-ja + ((buzzer-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) ;; definition of type buzzer (deftype buzzer (eco-collectable) @@ -2465,14 +2320,13 @@ ;; failed to figure out what this is: (defstate wait (buzzer) :virtual #t - :code - (behavior () + :code (behavior () (case (get-reminder (get-task-control (the-as game-task (logand (the int (-> self fact pickup-amount)) #xffff))) 0) ((127) (go-virtual pickup #t (the-as handle #f)) ) ) - (while #t + (loop (transform-post) (animate self) (suspend) @@ -2484,8 +2338,7 @@ ;; failed to figure out what this is: (defstate pickup (buzzer) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'notify) (process-entity-status! self (entity-perm-status dead) #t) @@ -2493,17 +2346,15 @@ ) ) ) - :enter - (behavior ((arg0 object) (arg1 handle)) + :enter (behavior ((arg0 object) (arg1 handle)) (set! (-> self pickup-handle) arg1) (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :code - (behavior ((arg0 object) (arg1 handle)) + :code (behavior ((arg0 object) (arg1 handle)) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status complete) #t) - (sound-play-by-name (static-sound-name "buzzer-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "buzzer-pickup") (case (-> (level-get-target-inside *level*) name) (('training) (level-hint-spawn @@ -2539,16 +2390,7 @@ (stop! (-> self sound)) ) (when (not arg0) - (let* ((s5-1 (get-process *default-dead-pool* manipy #x4000)) - (v1-18 (when s5-1 - (let ((t9-11 (method-of-type manipy activate))) - (t9-11 (the-as manipy s5-1) *entity-pool* 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> self root-override trans) #f *buzzer-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) + (let ((v1-18 (manipy-spawn (-> self root-override trans) #f *buzzer-sg* #f :to *entity-pool*))) (send-event (ppointer->process v1-18) 'become-hud-object (ppointer->process (-> *hud-parts* buzzers))) ) ) @@ -2565,7 +2407,7 @@ (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9 ca-12 ca-13 ca-14)) (not arg0) ) - (logior! (-> self fact options) (fact-options fop6 fop7)) + (logior! (-> self fact options) (fact-options instant-collect skip-jump-anim)) ) (let ((v1-47 (birth-pickup-at-point @@ -2636,19 +2478,8 @@ (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type buzzer) (the-as float 0.0))) (initialize-skeleton obj *buzzer-sg* '()) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 65) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "buzzer") - :volume #x400 - :fo-max 40 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "buzzer" :fo-max 40) (-> obj root-override trans)) ) (set! (-> obj victory-anim) (fuel-cell-pick-anim obj)) obj @@ -2658,7 +2489,7 @@ ;; INFO: Return type mismatch object vs none. (defmethod init-from-entity! buzzer ((obj buzzer) (arg0 entity-actor)) (initialize obj) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (initialize-params obj 0 (the-as float 1024.0)) (set! (-> obj collect-timeout) (seconds 2)) (update-transforms! (-> obj root-override)) @@ -2673,7 +2504,7 @@ ;; definition for function buzzer-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior buzzer-init-by-other buzzer ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity)) +(defbehavior buzzer-init-by-other buzzer ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) (let ((s3-0 (-> arg2 pickup-type)) (f30-0 (-> arg2 pickup-spawn-amount)) ) @@ -3003,9 +2834,9 @@ s2-1 (the-as float 81920.0) (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) s1-1 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -3049,23 +2880,19 @@ ) ;; failed to figure out what this is: -(defskelgroup *ecovalve-sg* ecovalve - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *ecovalve-sg* ecovalve ecovalve-geo-jg ecovalve-idle-ja + ((ecovalve-geo-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) ;; failed to figure out what this is: (defstate ecovalve-idle (ecovalve) - :code - (behavior () + :code (behavior () (transform-post) (suspend) (transform-post) - (while #t + (loop (if (not ((-> self block-func) (the-as vent (ppointer->process (-> self parent))))) (set-vector! (-> self offset-target) 0.0 0.0 0.0 1.0) ) @@ -3245,15 +3072,7 @@ ) ) ) - (let ((s5-1 (get-process *pickup-dead-pool* ecovalve #x4000))) - (when s5-1 - (let ((t9-17 (method-of-type ecovalve activate))) - (t9-17 (the-as ecovalve s5-1) obj 'ecovalve (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 ecovalve-init-by-other (-> obj block-func)) - (-> s5-1 ppointer) - ) - ) + (process-spawn ecovalve (-> obj block-func) :from *pickup-dead-pool* :to obj) ) (if ((-> obj block-func) obj) (go vent-blocked) @@ -3281,8 +3100,7 @@ ;; failed to figure out what this is: (defstate vent-wait-for-touch (vent) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (or (= arg2 'touch) (= arg2 'attack)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) @@ -3299,9 +3117,8 @@ ) (vent-standard-event-handler arg0 arg1 arg2 arg3) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((a0-0 (-> self part)) (a1-0 (-> self root-override trans)) (gp-0 (-> self sound)) @@ -3321,17 +3138,15 @@ ;; failed to figure out what this is: (defstate vent-blocked (vent) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('show) (go vent-wait-for-touch) ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (not ((-> self block-func) self)) (go vent-wait-for-touch) ) @@ -3343,10 +3158,8 @@ ;; failed to figure out what this is: (defstate vent-pickup (vent) - :event - vent-standard-event-handler - :code - (behavior ((arg0 handle)) + :event vent-standard-event-handler + :code (behavior ((arg0 handle)) (when (-> self show-particles) (when (nonzero? (-> self collect-effect)) (let* ((s5-0 (handle->process arg0)) @@ -3363,41 +3176,27 @@ ) ) (when s5-1 - (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-1 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker s4-1) gp-0 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-1 - part-tracker-init - (-> self collect-effect) - -1 - part-tracker-track-target - #f - #f - (-> (the-as collide-shape s5-1) root-prim prim-core) - ) - (-> s4-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> self collect-effect) + -1 + part-tracker-track-target + #f + #f + (-> (the-as collide-shape s5-1) root-prim prim-core) + :to gp-0 ) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker gp-1) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> self collect-effect2) - -1 - part-tracker-move-to-target - #f - #f - (-> self root-override root-prim prim-core) - ) - (-> gp-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> self collect-effect2) + -1 + part-tracker-move-to-target + #f + #f + (-> self root-override root-prim prim-core) + :to self ) ) ) diff --git a/test/decompiler/reference/engine/game/crates_REF.gc b/test/decompiler/reference/engine/game/crates_REF.gc index 0368af49d5..e7622401f0 100644 --- a/test/decompiler/reference/engine/game/crates_REF.gc +++ b/test/decompiler/reference/engine/game/crates_REF.gc @@ -1,65 +1,52 @@ ;;-*-Lisp-*- (in-package goal) -;; failed to figure out what this is: -(defskelgroup *crate-barrel-sg* crate - 17 - 21 - ((18 (meters 20)) (19 (meters 40)) (20 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(import "goal_src/import/crate-ag.gc") ;; failed to figure out what this is: -(defskelgroup *crate-bucket-sg* crate - 22 - 24 - ((23 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *crate-barrel-sg* crate crate-barrel-lod0-jg crate-barrel-idle-ja + ((crate-barrel-lod0-mg (meters 20)) (crate-barrel-lod1-mg (meters 40)) (crate-barrel-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) ;; failed to figure out what this is: -(defskelgroup *crate-wood-sg* crate - 0 - 16 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *crate-bucket-sg* crate crate-bucket-lod0-jg crate-bucket-idle-ja + ((crate-bucket-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :texture-level 2 + ) ;; failed to figure out what this is: -(defskelgroup *crate-iron-sg* crate - 4 - 16 - ((5 (meters 20)) (6 (meters 40)) (7 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *crate-wood-sg* crate crate-wood-lod0-jg crate-idle-ja + ((crate-wood-lod0-mg (meters 20)) (crate-wood-lod1-mg (meters 40)) (crate-wood-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) ;; failed to figure out what this is: -(defskelgroup *crate-steel-sg* crate - 8 - 16 - ((9 (meters 20)) (10 (meters 40)) (11 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *crate-iron-sg* crate crate-iron-lod0-jg crate-idle-ja + ((crate-iron-lod0-mg (meters 20)) (crate-iron-lod1-mg (meters 40)) (crate-iron-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) ;; failed to figure out what this is: -(defskelgroup *crate-darkeco-sg* crate - 12 - 16 - ((13 (meters 20)) (14 (meters 40)) (15 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *crate-steel-sg* crate crate-steel-lod0-jg crate-idle-ja + ((crate-steel-lod0-mg (meters 20)) (crate-steel-lod1-mg (meters 40)) (crate-steel-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) + +;; failed to figure out what this is: +(defskelgroup *crate-darkeco-sg* crate crate-darkeco-lod0-jg crate-idle-ja + ((crate-darkeco-lod0-mg (meters 20)) + (crate-darkeco-lod1-mg (meters 40)) + (crate-darkeco-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) ;; definition of type crate-bank (deftype crate-bank (basic) @@ -82,8 +69,7 @@ ) ;; definition for symbol *CRATE-bank*, type crate-bank -(define - *CRATE-bank* +(define *CRATE-bank* (new 'static 'crate-bank :COLLIDE_YOFF 4096.0 :COLLIDE_RADIUS 4915.2 :DARKECO_EXPLODE_RADIUS 16384.0) ) @@ -145,8 +131,7 @@ ;; failed to figure out what this is: (defpart 281 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) @@ -170,14 +155,12 @@ ;; failed to figure out what this is: (defpart 282 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 283 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 0.75)) (sp-flt spt-scale-x (meters 6)) @@ -202,14 +185,12 @@ ;; failed to figure out what this is: (defpart 284 - :init-specs - ((sp-flt spt-fade-a -2.1333334)) + :init-specs ((sp-flt spt-fade-a -2.1333334)) ) ;; failed to figure out what this is: (defpart 285 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 8)) @@ -226,8 +207,7 @@ ;; failed to figure out what this is: (defpart 286 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) @@ -256,8 +236,7 @@ ;; failed to figure out what this is: (defpart 287 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0033333334)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0033333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -3.4) ) @@ -265,8 +244,7 @@ ;; failed to figure out what this is: (defpart 288 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) (sp-flt spt-num 4.5) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) @@ -299,8 +277,7 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 281) (sp-item 283) (sp-item 285) (sp-item 286) (sp-item 288)) + :parts ((sp-item 281) (sp-item 283) (sp-item 285) (sp-item 286) (sp-item 288)) ) ;; failed to figure out what this is: @@ -309,8 +286,7 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 281) (sp-item 283) (sp-item 285) (sp-item 288) (sp-item 288) (sp-item 288)) + :parts ((sp-item 281) (sp-item 283) (sp-item 285) (sp-item 288) (sp-item 288) (sp-item 288)) ) ;; failed to figure out what this is: @@ -319,8 +295,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) + :parts ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) (sp-item 296 :flags (start-dead launch-asap) :binding 297) (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) (sp-item 296 :flags (start-dead launch-asap) :binding 297) @@ -363,8 +338,7 @@ ;; failed to figure out what this is: (defpart 2096 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -389,14 +363,12 @@ ;; failed to figure out what this is: (defpart 2099 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) ) ;; failed to figure out what this is: (defpart 2098 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-scale-x (meters 0.2)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) @@ -414,8 +386,7 @@ ;; failed to figure out what this is: (defpart 2095 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 16)) (sp-copy-from-other spt-scale-y -4) @@ -431,8 +402,7 @@ ;; failed to figure out what this is: (defpart 2097 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -457,8 +427,7 @@ ;; failed to figure out what this is: (defpart 295 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 0.1)) @@ -476,8 +445,7 @@ ;; failed to figure out what this is: (defpart 296 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.3) (meters 0.3) 1.0) @@ -502,8 +470,7 @@ ;; failed to figure out what this is: (defpart 297 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -524,8 +491,7 @@ ;; failed to figure out what this is: (defpart 292 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) @@ -554,8 +520,7 @@ ;; failed to figure out what this is: (defpart 301 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0033333334)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0033333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -3.4) ) @@ -572,7 +537,7 @@ (('iron) (case (-> arg3 param 1) (('flop 'uppercut 'explode 'darkeco 'eco-yellow 'bonk 'racer 'tube 'flut-bonk 'flut-attack) - (if (and (logtest? (-> self fact options) (fact-options fop11)) + (if (and (logtest? (-> self fact options) (fact-options require-zoomer)) *target* (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-9))) ) @@ -585,9 +550,8 @@ ) (else (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root-override trans y) (-> self base y))) - (if (not - (and (!= *kernel-boot-message* 'play) (= (-> *setting-control* current language) (language-enum japanese))) - ) + (if (not (and (!= *kernel-boot-message* 'play) (= (-> *setting-control* current language) (language-enum japanese))) + ) (level-hint-spawn (game-text-id sage-voicebox-hint-crate-iron) "sagevb36" @@ -612,7 +576,7 @@ ) (set! (-> self incomming-attack-id) s4-0) (if (not (!= (-> self smush amp) 0.0)) - (sound-play-by-name (static-sound-name "icrate-nobreak") (new-sound-id) 1024 0 0 1 #t) + (sound-play "icrate-nobreak") ) (activate! (-> self smush) 0.1 90 150 1.0 1.0) (go-virtual bounce-on) @@ -655,7 +619,7 @@ ) (set! (-> self incomming-attack-id) s4-0) (if (not (!= (-> self smush amp) 0.0)) - (sound-play-by-name (static-sound-name "scrate-nobreak") (new-sound-id) 1024 0 0 1 #t) + (sound-play "scrate-nobreak") ) (activate! (-> self smush) 0.1 90 150 1.0 1.0) (go-virtual bounce-on) @@ -665,17 +629,7 @@ ) ) (('darkeco) - (let ((a1-32 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-32 from) self) - (set! (-> a1-32 num-params) 2) - (set! (-> a1-32 message) 'attack) - (set! (-> a1-32 param 0) (-> arg3 param 0)) - (let ((a0-57 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-57 mode) 'darkeco) - (set! (-> a1-32 param 1) (the-as uint a0-57)) - ) - (send-event-function arg0 a1-32) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'darkeco)))) (when (= (-> arg0 type) target) (level-hint-spawn (game-text-id sidekick-speech-hint-crate-darkeco2) @@ -731,17 +685,7 @@ (('touch) (case (-> self defense) (('darkeco) - (let ((a1-41 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-41 from) self) - (set! (-> a1-41 num-params) 2) - (set! (-> a1-41 message) 'attack) - (set! (-> a1-41 param 0) (-> arg3 param 0)) - (let ((a0-75 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-75 mode) 'darkeco) - (set! (-> a1-41 param 1) (the-as uint a0-75)) - ) - (send-event-function arg0 a1-41) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'darkeco)))) (go-virtual die #f 0) ) ) @@ -773,70 +717,54 @@ ;; failed to figure out what this is: (defstate wait (crate) :virtual #t - :event - crate-standard-event-handler - :code - (behavior () + :event crate-standard-event-handler + :code (behavior () (suspend) (update-transforms! (-> self root-override)) (logior! (-> self mask) (process-mask sleep)) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior crate) ja-post) + :post (the-as (function none :behavior crate) ja-post) ) ;; failed to figure out what this is: (defstate bounce-on (crate) :virtual #t - :event - crate-standard-event-handler - :code - (behavior () + :event crate-standard-event-handler + :code (behavior () (while (!= (-> self smush amp) 0.0) (suspend) ) (go-virtual wait) (none) ) - :post - (the-as (function none :behavior crate) crate-post) + :post (the-as (function none :behavior crate) crate-post) ) ;; failed to figure out what this is: (defstate notice-blue (crate) :virtual #t - :event - crate-standard-event-handler - :trans - (behavior () - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'powerup)) - (set! (-> a1-0 param 1) (the-as uint 3)) - (cond - ((not (send-event-function *target* a1-0)) - (logior! (-> self mask) (process-mask sleep-code)) - (if (not (!= (-> self smush amp) 0.0)) - (go-virtual wait) - ) - ) - (else - (logclear! (-> self mask) (process-mask sleep-code)) - ) + :event crate-standard-event-handler + :trans (behavior () + (cond + ((not (send-event *target* 'query 'powerup (pickup-type eco-blue))) + (logior! (-> self mask) (process-mask sleep-code)) + (if (not (!= (-> self smush amp) 0.0)) + (go-virtual wait) + ) + ) + (else + (logclear! (-> self mask) (process-mask sleep-code)) ) ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (set! (-> self target) arg0) - (while #t + (loop (let* ((gp-0 (handle->process (-> self target))) (v1-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) gp-0 @@ -891,32 +819,20 @@ ) (none) ) - :post - (the-as (function none :behavior crate) crate-post) + :post (the-as (function none :behavior crate) crate-post) ) ;; failed to figure out what this is: (defstate die (crate) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touched) (case (-> self defense) (('darkeco) (cond ((= (-> arg0 type) target) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'attack) - (set! (-> a1-4 param 0) (-> arg3 param 0)) - (let ((a2-1 (new 'static 'attack-info :mask #x20))) - (set! (-> a2-1 mode) 'darkeco) - (set! (-> a1-4 param 1) (the-as uint a2-1)) - ) - (send-event-function arg0 a1-4) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'darkeco)))) ) (else (let ((a1-5 (new 'stack-no-clear 'event-message-block))) @@ -939,8 +855,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (case (-> self type) ((crate-buzzer) (if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0)) @@ -950,8 +865,7 @@ ) (none) ) - :code - (behavior ((arg0 symbol) (arg1 int)) + :code (behavior ((arg0 symbol) (arg1 int)) (clear-collide-with-as (-> self root-override)) (if (nonzero? (-> self sound)) (stop! (-> self sound)) @@ -962,7 +876,7 @@ (not arg0) ) ) - (logior! (-> self fact options) (fact-options fop6)) + (logior! (-> self fact options) (fact-options instant-collect)) ) (when (not arg0) (let ((s5-1 (-> *display* base-frame-counter))) @@ -973,16 +887,16 @@ (logior! (-> self draw status) (draw-status hidden)) (case (-> self look) (('iron) - (sound-play-by-name (static-sound-name "icrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "icrate-break") ) (('steel) - (sound-play-by-name (static-sound-name "scrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "scrate-break") ) (('darkeco) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") ) (else - (sound-play-by-name (static-sound-name "wcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "wcrate-break") ) ) (case (-> self defense) @@ -993,82 +907,54 @@ ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 f0-0)) (seconds 0.3)) ) - (let ((s5-7 (get-process *default-dead-pool* touch-tracker #x4000))) - (when s5-7 - (let ((t9-15 (method-of-type touch-tracker activate))) - (t9-15 (the-as touch-tracker s5-7) self 'touch-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-7 - touch-tracker-init - (-> self root-override trans) - (-> *CRATE-bank* DARKECO_EXPLODE_RADIUS) - 30 - ) - (-> s5-7 ppointer) - ) + (process-spawn + touch-tracker + :init touch-tracker-init + (-> self root-override trans) + (-> *CRATE-bank* DARKECO_EXPLODE_RADIUS) + 30 + :to self ) ) ) (case (-> self look) (('darkeco) - (let ((s5-8 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-8 - (let ((t9-18 (method-of-type part-tracker activate))) - (t9-18 (the-as part-tracker s5-8) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-8 - part-tracker-init - (-> *part-group-id-table* 73) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> s5-8 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 73) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) ) (('steel 'iron) - (let ((s5-9 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-9 - (let ((t9-21 (method-of-type part-tracker activate))) - (t9-21 (the-as part-tracker s5-9) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-9 - part-tracker-init - (-> *part-group-id-table* 72) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> s5-9 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 72) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) ) (else - (let ((s5-10 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-10 - (let ((t9-24 (method-of-type part-tracker activate))) - (t9-24 (the-as part-tracker s5-10) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-10 - part-tracker-init - (-> *part-group-id-table* 71) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> s5-10 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 71) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) ) ) @@ -1099,8 +985,7 @@ ;; failed to figure out what this is: (defstate special-contents-die (crate) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'notify) (case (-> arg3 param 0) @@ -1128,10 +1013,8 @@ ) ) ) - :trans - (-> (method-of-type crate die) trans) - :code - (behavior () + :trans (-> (method-of-type crate die) trans) + :code (behavior () (when (or (= (-> self fact pickup-type) (pickup-type money)) (= (-> self defense) 'iron) (= (-> self defense) 'steel) @@ -1416,14 +1299,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 302)) + :parts ((sp-item 302)) ) ;; failed to figure out what this is: (defpart 302 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1473,15 +1354,7 @@ (set! (-> obj sound) (new 'process 'ambient-sound - (new 'static 'sound-spec - :mask #x82 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "buzzer") - :volume #x400 - :pitch-mod -762 - :fo-max 40 - ) + (static-sound-spec "buzzer" :pitch-mod -762 :fo-max 40) (-> obj root-override trans) ) ) @@ -1492,8 +1365,7 @@ ;; failed to figure out what this is: (defstate wait (crate-buzzer) :virtual #t - :trans - (behavior () + :trans (behavior () (when (and (and *target* (>= 327680.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -1512,18 +1384,17 @@ ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (suspend) (update-transforms! (-> self root-override)) - (while #t + (loop (set! (-> self state-time) (-> *display* base-frame-counter)) (ja-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) (let ((f30-0 57001.605)) - (sound-play-by-name (static-sound-name "crate-jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "crate-jump") (while (or (!= (-> self smush amp) 0.0) (!= f30-0 0.0)) (+! f30-0 (* -245760.0 (-> *display* seconds-per-frame))) (+! (-> self root-override trans y) (* f30-0 (-> *display* seconds-per-frame))) @@ -1543,15 +1414,13 @@ ) (none) ) - :post - (the-as (function none :behavior crate-buzzer) #f) + :post (the-as (function none :behavior crate-buzzer) #f) ) ;; failed to figure out what this is: (defstate bounce-on (crate-buzzer) :virtual #t - :code - (behavior () + :code (behavior () (while (!= (-> self smush amp) 0.0) (spawn (-> self part) (-> self root-override trans)) (suspend) @@ -1605,9 +1474,8 @@ ;; failed to figure out what this is: (defstate wait (pickup-spawner) :virtual #t - :code - (behavior () - (while #t + :code (behavior () + (loop (if (or (not (-> self blocker)) (logtest? (-> self blocker extra perm status) (entity-perm-status complete))) (go-virtual die #t 0) ) diff --git a/test/decompiler/reference/engine/game/effect-control_REF.gc b/test/decompiler/reference/engine/game/effect-control_REF.gc index faecadbfd4..1edd56fa3e 100644 --- a/test/decompiler/reference/engine/game/effect-control_REF.gc +++ b/test/decompiler/reference/engine/game/effect-control_REF.gc @@ -82,39 +82,39 @@ (while (> arg2 0) (case (the int (-> arg1 0)) ((3) - (logior! (-> arg0 mask) 1) + (logior! (-> arg0 mask) (sound-mask volume)) (set! (-> arg0 volume) (the int (* 10.24 (-> arg1 1)))) ) ((4) - (logior! (-> arg0 mask) 1) + (logior! (-> arg0 mask) (sound-mask volume)) (+! (-> arg0 volume) (the int (* 10.24 (* (-> arg1 1) (rand-vu))))) ) ((5) - (logior! (-> arg0 mask) 2) + (logior! (-> arg0 mask) (sound-mask pitch)) (set! (-> arg0 pitch-mod) (the int (* 1524.0 (-> arg1 1)))) ) ((6) - (logior! (-> arg0 mask) 2) + (logior! (-> arg0 mask) (sound-mask pitch)) (+! (-> arg0 pitch-mod) (the int (* 1524.0 (* (-> arg1 1) (rand-vu))))) ) ((9) - (logior! (-> arg0 mask) 4) + (logior! (-> arg0 mask) (sound-mask bend)) (set! (-> arg0 bend) (the int (* 327.66998 (-> arg1 1)))) ) ((10) - (logior! (-> arg0 mask) 4) + (logior! (-> arg0 mask) (sound-mask bend)) (+! (-> arg0 bend) (the int (* 327.66998 (* (-> arg1 1) (rand-vu))))) ) ((11) - (logior! (-> arg0 mask) 64) + (logior! (-> arg0 mask) (sound-mask fo-min)) (set! (-> arg0 fo-min) (the int (-> arg1 1))) ) ((12) - (logior! (-> arg0 mask) 128) + (logior! (-> arg0 mask) (sound-mask fo-max)) (set! (-> arg0 fo-max) (the int (-> arg1 1))) ) ((13) - (logior! (-> arg0 mask) 256) + (logior! (-> arg0 mask) (sound-mask fo-curve)) (set! (-> arg0 fo-curve) (the int (-> arg1 1))) ) ((19) @@ -282,175 +282,87 @@ (sv-272 symbol) (sv-288 res-lump) ) - (with-pp - (let ((s3-0 (-> arg0 value)) - (s5-0 (cond - ((< arg2 0) - (let ((v0-0 (get-property-value - (-> obj res) - 'effect-joint - 'exact - arg1 - (the-as uint128 0) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) + (let ((s3-0 (-> arg0 value)) + (s5-0 (cond + ((< arg2 0) + (let ((v0-0 (get-property-value + (-> obj res) + 'effect-joint + 'exact + arg1 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* ) - ) - (if (zero? v0-0) - 0 - (the-as int (+ v0-0 1)) - ) - ) - ) - (else - (empty) - arg2 - ) - ) - ) - ) - (when (logtest? (-> obj flags) 1) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) pp) - (set! (-> a1-2 num-params) 3) - (set! (-> a1-2 message) 'effect) - (set! (-> a1-2 param 0) (the-as uint arg0)) - (set! (-> a1-2 param 1) (the-as uint arg1)) - (set! (-> a1-2 param 2) (the-as uint s5-0)) - (if (send-event-function (-> obj process) a1-2) - (return (the-as object 0)) - ) - ) - ) - (let ((v1-10 (symbol->string arg0))) - (cond - ((and (= (-> v1-10 data 0) 101) - (= (-> v1-10 data 1) 102) - (= (-> v1-10 data 2) 102) - (= (-> v1-10 data 3) 101) - (= (-> v1-10 data 4) 99) - (= (-> v1-10 data 5) 116) - (= (-> v1-10 data 6) 45) - ) - (let* ((s3-1 (-> obj process root)) - (v1-14 (if (and (nonzero? s3-1) (type-type? (-> s3-1 type) collide-shape-moving)) - s3-1 ) - ) - (t1-1 (if v1-14 - (the-as int (-> (the-as collide-shape-moving v1-14) ground-pat)) - *footstep-surface* - ) - ) - ) - (dummy-11 obj arg0 arg1 s5-0 (-> obj res) (the-as pat-surface t1-1)) - ) - ) - ((let ((v1-18 (symbol->string arg0))) - (and (= (-> v1-18 data 0) 103) - (= (-> v1-18 data 1) 114) - (= (-> v1-18 data 2) 111) - (= (-> v1-18 data 3) 117) - (= (-> v1-18 data 4) 112) - (= (-> v1-18 data 5) 45) - ) - ) - (set! s3-0 (cond - ((zero? s3-0) - (let ((v0-5 (lookup-part-group-pointer-by-name (symbol->string arg0)))) - (when v0-5 - (set! (-> arg0 value) v0-5) - (set! s3-0 (-> v0-5 0)) - ) - ) - (the-as (pointer sparticle-launch-group) s3-0) - ) - (else - (-> (the-as (pointer sparticle-launch-group) s3-0) 0) - ) - ) - ) - (when (and (nonzero? s3-0) (= (-> (the-as sparticle-launch-group s3-0) type) sparticle-launch-group)) - (if *debug-effect-control* - (format - #t - "(~5D) effect group ~A ~A frame ~F joint ~D~%" - (-> *display* base-frame-counter) - (-> obj process name) - arg0 - arg1 - s5-0 - ) - ) - (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-1 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker s4-1) (-> obj process) 'part-tracker (the-as pointer #x70004000)) - ) - (let ((s2-1 run-function-in-process) - (s1-0 s4-1) - (s0-0 part-tracker-init) ) - (set! sv-160 -1) - (set! sv-176 (the-as symbol #f)) - (set! sv-192 (the-as symbol #f)) - (set! sv-208 (the-as symbol #f)) - (let ((t3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)))) - ((the-as (function object object object object object object object object none) s2-1) - s1-0 - s0-0 - (the-as sparticle-launch-group s3-0) - sv-160 - sv-176 - sv-192 - sv-208 - t3-0 - ) - ) + (if (zero? v0-0) + 0 + (the-as int (+ v0-0 1)) + ) ) - (-> s4-1 ppointer) ) + (else + (empty) + arg2 + ) + ) + ) + ) + (when (logtest? (-> obj flags) 1) + (if (send-event (-> obj process) 'effect arg0 arg1 s5-0) + (return (the-as object 0)) + ) + ) + (let ((v1-10 (symbol->string arg0))) + (cond + ((and (= (-> v1-10 data 0) 101) + (= (-> v1-10 data 1) 102) + (= (-> v1-10 data 2) 102) + (= (-> v1-10 data 3) 101) + (= (-> v1-10 data 4) 99) + (= (-> v1-10 data 5) 116) + (= (-> v1-10 data 6) 45) + ) + (let* ((s3-1 (-> obj process root)) + (v1-14 (if (and (nonzero? s3-1) (type-type? (-> s3-1 type) collide-shape-moving)) + s3-1 + ) + ) + (t1-1 (if v1-14 + (the-as int (-> (the-as collide-shape-moving v1-14) ground-pat)) + *footstep-surface* + ) + ) + ) + (dummy-11 obj arg0 arg1 s5-0 (-> obj res) (the-as pat-surface t1-1)) + ) + ) + ((let ((v1-18 (symbol->string arg0))) + (and (= (-> v1-18 data 0) 103) + (= (-> v1-18 data 1) 114) + (= (-> v1-18 data 2) 111) + (= (-> v1-18 data 3) 117) + (= (-> v1-18 data 4) 112) + (= (-> v1-18 data 5) 45) + ) + ) + (set! s3-0 (cond + ((zero? s3-0) + (let ((v0-5 (lookup-part-group-pointer-by-name (symbol->string arg0)))) + (when v0-5 + (set! (-> arg0 value) v0-5) + (set! s3-0 (-> v0-5 0)) + ) + ) + (the-as (pointer sparticle-launch-group) s3-0) + ) + (else + (-> (the-as (pointer sparticle-launch-group) s3-0) 0) + ) + ) ) - ) - ) - ((= arg0 'camera-shake) - (activate! *camera-smush-control* 819.2 37 600 1.0 0.995) - ) - ((zero? s3-0) - (dummy-12 obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) - ) - ((= (-> (the-as basic s3-0) type) sparticle-launcher) - (if *debug-effect-control* - (format - #t - "(~5D) effect part ~A ~A frame ~F joint ~D~%" - (-> *display* base-frame-counter) - (-> obj process name) - arg0 - arg1 - s5-0 - ) - ) - (format - #t - "-----> (~5D) effect part ~A ~A frame ~F joint ~D~%" - (-> *display* base-frame-counter) - (-> obj process name) - arg0 - arg1 - s5-0 - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (the-as sparticle-launcher s3-0) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - ) - ((= (-> (the-as basic s3-0) type) sparticle-launch-group) + (when (and (nonzero? s3-0) (= (-> (the-as sparticle-launch-group s3-0) type) sparticle-launch-group)) (if *debug-effect-control* (format #t @@ -462,96 +374,174 @@ s5-0 ) ) - (let ((s4-3 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-3 - (let ((t9-19 (method-of-type part-tracker activate))) - (t9-19 (the-as part-tracker s4-3) (-> obj process) 'part-tracker (the-as pointer #x70004000)) + (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when s4-1 + (let ((t9-7 (method-of-type part-tracker activate))) + (t9-7 (the-as part-tracker s4-1) (-> obj process) 'part-tracker (the-as pointer #x70004000)) ) - (let ((s2-3 run-function-in-process) - (s1-2 s4-3) - (s0-2 part-tracker-init) + (let ((s2-1 run-function-in-process) + (s1-0 s4-1) + (s0-0 part-tracker-init) ) - (set! sv-224 -1) - (set! sv-240 (the-as symbol #f)) - (set! sv-256 (the-as symbol #f)) - (set! sv-272 (the-as symbol #f)) - (let ((t3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)))) - ((the-as (function object object object object object object object object none) s2-3) - s1-2 - s0-2 - s3-0 - sv-224 - sv-240 - sv-256 - sv-272 - t3-1 + (set! sv-160 -1) + (set! sv-176 (the-as symbol #f)) + (set! sv-192 (the-as symbol #f)) + (set! sv-208 (the-as symbol #f)) + (let ((t3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)))) + ((the-as (function object object object object object object object object none) s2-1) + s1-0 + s0-0 + (the-as sparticle-launch-group s3-0) + sv-160 + sv-176 + sv-192 + sv-208 + t3-0 ) ) ) - (-> s4-3 ppointer) + (-> s4-1 ppointer) ) ) ) - ((= (-> (the-as basic s3-0) type) sound-spec) - (sound-play-by-spec - (the-as sound-spec s3-0) - (new-sound-id) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) + ) + ((= arg0 'camera-shake) + (activate! *camera-smush-control* 819.2 37 600 1.0 0.995) + ) + ((zero? s3-0) + (dummy-12 obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) + ) + ((= (-> (the-as basic s3-0) type) sparticle-launcher) + (if *debug-effect-control* + (format + #t + "(~5D) effect part ~A ~A frame ~F joint ~D~%" + (-> *display* base-frame-counter) + (-> obj process name) + arg0 + arg1 + s5-0 + ) + ) + (format + #t + "-----> (~5D) effect part ~A ~A frame ~F joint ~D~%" + (-> *display* base-frame-counter) + (-> obj process name) + arg0 + arg1 + s5-0 + ) + (sp-launch-particles-var + *sp-particle-system-2d* + (the-as sparticle-launcher s3-0) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ((= (-> (the-as basic s3-0) type) sparticle-launch-group) + (if *debug-effect-control* + (format + #t + "(~5D) effect group ~A ~A frame ~F joint ~D~%" + (-> *display* base-frame-counter) + (-> obj process name) + arg0 + arg1 + s5-0 + ) + ) + (let ((s4-3 (get-process *default-dead-pool* part-tracker #x4000))) + (when s4-3 + (let ((t9-19 (method-of-type part-tracker activate))) + (t9-19 (the-as part-tracker s4-3) (-> obj process) 'part-tracker (the-as pointer #x70004000)) + ) + (let ((s2-3 run-function-in-process) + (s1-2 s4-3) + (s0-2 part-tracker-init) + ) + (set! sv-224 -1) + (set! sv-240 (the-as symbol #f)) + (set! sv-256 (the-as symbol #f)) + (set! sv-272 (the-as symbol #f)) + (let ((t3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)))) + ((the-as (function object object object object object object object object none) s2-3) + s1-2 + s0-2 + s3-0 + sv-224 + sv-240 + sv-256 + sv-272 + t3-1 + ) + ) + ) + (-> s4-3 ppointer) ) ) - ((= (-> (the-as basic s3-0) type) death-info) - (let ((v1-67 (-> obj process draw))) - (let ((a1-42 (-> (the-as death-info s3-0) vertex-skip)) - (a0-55 - (max - 2 - (the-as int (/ (-> (the-as death-info s3-0) timer) (the-as uint (the int (-> *display* time-factor))))) - ) + ) + ((= (-> (the-as basic s3-0) type) sound-spec) + (sound-play-by-spec + (the-as sound-spec s3-0) + (new-sound-id) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) + ) + ) + ((= (-> (the-as basic s3-0) type) death-info) + (let ((v1-67 (-> obj process draw))) + (let ((a1-42 (-> (the-as death-info s3-0) vertex-skip)) + (a0-55 + (max + 2 + (the-as int (/ (-> (the-as death-info s3-0) timer) (the-as uint (the int (-> *display* time-factor))))) ) ) - (when (= (-> *setting-control* current video-mode) 'pal) - (if (< (the-as uint 1) a1-42) - (set! a1-42 (/ (the-as uint (* (the-as uint 50) a1-42)) (the-as uint 60))) - ) ) - (let ((a2-29 (-> *display* frames (-> *display* last-screen) frame run-time))) - (cond - ((< 9000 a2-29) - (set! a1-42 (* a1-42 4)) - ) - ((< 7000 a2-29) - (set! a1-42 (* a1-42 2)) - ) + (when (= (-> *setting-control* current video-mode) 'pal) + (if (< (the-as uint 1) a1-42) + (set! a1-42 (/ (the-as uint (* (the-as uint 50) a1-42)) (the-as uint 60))) ) - ) - (set! (-> v1-67 death-vertex-skip) a1-42) - (set! (-> v1-67 death-effect) (-> (the-as death-info s3-0) effect)) - (set! (-> v1-67 death-timer) (+ a0-55 1)) ) - (set! (-> v1-67 death-timer-org) (-> v1-67 death-timer)) - (set! (-> v1-67 death-draw-overlap) (-> (the-as death-info s3-0) overlap)) - ) - (when (-> (the-as death-info s3-0) sound) - (let* ((s2-5 obj) - (s1-3 (method-of-object s2-5 dummy-12)) - (s0-3 (-> (the-as death-info s3-0) sound)) - ) - (set! sv-288 (-> obj res)) - (let ((t1-11 (string->sound-name (symbol->string (-> (the-as death-info s3-0) sound))))) - (s1-3 s2-5 s0-3 arg1 s5-0 sv-288 t1-11) + (let ((a2-29 (-> *display* frames (-> *display* last-screen) frame run-time))) + (cond + ((< 9000 a2-29) + (set! a1-42 (* a1-42 4)) + ) + ((< 7000 a2-29) + (set! a1-42 (* a1-42 2)) + ) ) ) + (set! (-> v1-67 death-vertex-skip) a1-42) + (set! (-> v1-67 death-effect) (-> (the-as death-info s3-0) effect)) + (set! (-> v1-67 death-timer) (+ a0-55 1)) ) - (send-event (-> obj process) 'death-start (the-as death-info s3-0)) + (set! (-> v1-67 death-timer-org) (-> v1-67 death-timer)) + (set! (-> v1-67 death-draw-overlap) (-> (the-as death-info s3-0) overlap)) ) - (else - (dummy-12 obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) - ) + (when (-> (the-as death-info s3-0) sound) + (let* ((s2-5 obj) + (s1-3 (method-of-object s2-5 dummy-12)) + (s0-3 (-> (the-as death-info s3-0) sound)) + ) + (set! sv-288 (-> obj res)) + (let ((t1-11 (string->sound-name (symbol->string (-> (the-as death-info s3-0) sound))))) + (s1-3 s2-5 s0-3 arg1 s5-0 sv-288 t1-11) + ) + ) + ) + (send-event (-> obj process) 'death-start (the-as death-info s3-0)) + ) + (else + (dummy-12 obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) ) ) ) - 0 ) + 0 ) ;; definition for method 11 of type effect-control @@ -1079,14 +1069,7 @@ ;; definition for method 12 of type effect-control ;; Used lq/sq (defmethod dummy-12 effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) - (local-vars - (r0-0 uint128) - (v1-10 uint128) - (sv-112 int) - (sv-128 sound-name) - (sv-144 basic) - (sv-160 (function vector vector float)) - ) + (local-vars (sv-112 res-tag) (sv-128 sound-name) (sv-144 basic) (sv-160 (function vector vector float))) (set! sv-144 arg3) (let ((s0-0 arg4) (gp-0 (new 'stack 'sound-spec)) @@ -1097,32 +1080,23 @@ ) ) (set! (-> gp-0 sound-name) s0-0) - (logior! (-> gp-0 mask) 1) + (logior! (-> gp-0 mask) (sound-mask volume)) (set! (-> gp-0 volume) 1024) - (logior! (-> gp-0 mask) 4) + (logior! (-> gp-0 mask) (sound-mask bend)) (set! (-> gp-0 bend) (the int (* 327.66998 (rand-vu-float-range -100.0 100.0)))) - (set! sv-112 0) + (set! sv-112 (new 'static 'res-tag)) (let* ((t9-3 (method-of-type res-lump get-property-data)) (a1-6 'effect-param) (a2-1 'exact) (a3-1 arg1) (t0-1 #f) - (t1-1 (the-as (pointer int) (& sv-112))) + (t1-1 (the-as (pointer res-tag) (& sv-112))) (t2-0 *res-static-buf*) - (a1-7 - (t9-3 (the-as res-lump sv-144) a1-6 a2-1 a3-1 (the-as pointer t0-1) (the-as (pointer res-tag) t1-1) t2-0) - ) + (a1-7 (t9-3 (the-as res-lump sv-144) a1-6 a2-1 a3-1 (the-as pointer t0-1) t1-1 t2-0)) ) - (when a1-7 - (let ((t9-4 effect-param->sound-spec) - (a0-5 gp-0) - ) - (let ((v1-9 (the-as uint128 sv-112))) - (.pcpyud v1-10 v1-9 r0-0) - ) - (t9-4 a0-5 (the-as (pointer float) a1-7) (shr (* (the-as int v1-10) 2) 49)) + (if a1-7 + (effect-param->sound-spec gp-0 (the-as (pointer float) a1-7) (the-as int (-> sv-112 elt-count))) ) - ) ) (if (and (nonzero? (-> gp-0 fo-max)) (let ((f30-1 (* 4096.0 (the float (-> gp-0 fo-max))))) (set! sv-160 vector-vector-distance) @@ -1177,11 +1151,11 @@ ) 0 0 - 1 + (sound-group sfx) #t ) ) - ((logtest? (-> self water flags) 512) + ((logtest? (-> self water flags) (water-flags wt09)) (dummy-10 (-> self skel effect) 'effect-land-water -1.0 -1) ) (else diff --git a/test/decompiler/reference/engine/game/game-h_REF.gc b/test/decompiler/reference/engine/game/game-h_REF.gc index 273b6c2fcb..6af3ab2de3 100644 --- a/test/decompiler/reference/engine/game/game-h_REF.gc +++ b/test/decompiler/reference/engine/game/game-h_REF.gc @@ -16,7 +16,7 @@ (part sparticle-launch-control :offset-assert 152) (water water-control :offset-assert 156) (sound ambient-sound :offset-assert 160) - (state-flags uint32 :offset-assert 164) + (state-flags state-flags :offset-assert 164) (state-time time-frame :offset-assert 168) ) :heap-base #x40 @@ -26,7 +26,7 @@ (:methods (initialize-skeleton (_type_ skeleton-group pair) none 14) (initialize-skeleton-by-name (_type_ string object) _type_ 15) - (apply-alignment (_type_ int transformq vector) collide-shape 16) + (apply-alignment (_type_ align-opts transformq vector) collide-shape 16) (do-joint-math! (_type_) none 17) (cleanup-for-death (_type_) none 18) (evaluate-joint-control (_type_) none 19) @@ -124,21 +124,21 @@ ;; definition of type attack-info (deftype attack-info (structure) - ((trans vector :inline :offset-assert 0) - (vector vector :inline :offset-assert 16) - (intersection vector :inline :offset-assert 32) - (attacker handle :offset-assert 48) - (invinc-time time-frame :offset-assert 56) - (mask uint32 :offset-assert 64) - (mode symbol :offset-assert 68) - (shove-back meters :offset-assert 72) - (shove-up meters :offset-assert 76) - (speed meters :offset-assert 80) - (dist meters :offset-assert 84) - (control float :offset-assert 88) - (angle symbol :offset-assert 92) - (rotate-to degrees :offset-assert 96) - (prev-state state :offset-assert 100) + ((trans vector :inline :offset-assert 0) + (vector vector :inline :offset-assert 16) + (intersection vector :inline :offset-assert 32) + (attacker handle :offset-assert 48) + (invinc-time time-frame :offset-assert 56) + (mask attack-mask :offset-assert 64) + (mode symbol :offset-assert 68) + (shove-back meters :offset-assert 72) + (shove-up meters :offset-assert 76) + (speed meters :offset-assert 80) + (dist meters :offset-assert 84) + (control float :offset-assert 88) + (angle symbol :offset-assert 92) + (rotate-to degrees :offset-assert 96) + (prev-state state :offset-assert 100) ) :method-count-assert 10 :size-assert #x68 diff --git a/test/decompiler/reference/engine/game/game-info-h_REF.gc b/test/decompiler/reference/engine/game/game-info-h_REF.gc index cd4c57a192..66981f7e95 100644 --- a/test/decompiler/reference/engine/game/game-info-h_REF.gc +++ b/test/decompiler/reference/engine/game/game-info-h_REF.gc @@ -114,19 +114,19 @@ ;; definition of type continue-point (deftype continue-point (basic) - ((name string :offset-assert 4) - (level symbol :offset-assert 8) - (flags uint32 :offset-assert 12) - (trans vector :inline :offset-assert 16) - (quat quaternion :inline :offset-assert 32) - (camera-trans vector :inline :offset-assert 48) - (camera-rot float 9 :offset-assert 64) - (load-commands pair :offset-assert 100) - (vis-nick symbol :offset-assert 104) - (lev0 symbol :offset-assert 108) - (disp0 symbol :offset-assert 112) - (lev1 symbol :offset-assert 116) - (disp1 symbol :offset-assert 120) + ((name string :offset-assert 4) + (level symbol :offset-assert 8) + (flags continue-flags :offset-assert 12) + (trans vector :inline :offset-assert 16) + (quat quaternion :inline :offset-assert 32) + (camera-trans vector :inline :offset-assert 48) + (camera-rot float 9 :offset-assert 64) + (load-commands pair :offset-assert 100) + (vis-nick symbol :offset-assert 104) + (lev0 symbol :offset-assert 108) + (disp0 symbol :offset-assert 112) + (lev1 symbol :offset-assert 116) + (disp1 symbol :offset-assert 120) ) :method-count-assert 10 :size-assert #x7c diff --git a/test/decompiler/reference/engine/game/game-info_REF.gc b/test/decompiler/reference/engine/game/game-info_REF.gc index a5746a74b6..8312720c32 100644 --- a/test/decompiler/reference/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/engine/game/game-info_REF.gc @@ -11,8 +11,8 @@ ) ) ) - (add-debug-text-sphere #t (bucket-id debug-draw1) (-> obj trans) 819.2 (symbol->string (-> obj name)) s5-0) - (add-debug-vector #t (bucket-id debug-draw1) (-> obj trans) (-> obj normal) (meters 2.0) s5-0) + (add-debug-text-sphere #t (bucket-id debug-no-zbuf) (-> obj trans) 819.2 (symbol->string (-> obj name)) s5-0) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> obj trans) (-> obj normal) (meters 2.0) s5-0) ) 0 (none) @@ -240,9 +240,9 @@ ) ((= v1-65 'play) (when *target* - (set-setting! *setting-control* *target* 'allow-pause #f 0.0 0) - (set-setting! *setting-control* *target* 'allow-progress #f 0.0 0) - (copy-settings-from-target! *setting-control*) + (set-setting *setting-control* *target* 'allow-pause #f 0.0 0) + (set-setting *setting-control* *target* 'allow-progress #f 0.0 0) + (apply-settings *setting-control*) ) (send-event (handle->process (-> *game-info* auto-save-proc)) 'die) (set! (-> *level* border?) #f) @@ -257,12 +257,12 @@ ) (let ((s2-0 (the-as (function cpu-thread function object object object object pointer) set-to-run)) (s1-0 (-> s3-1 main-thread)) - (s0-0 (lambda ((arg0 symbol) (arg1 symbol) (arg2 continue-point) (arg3 symbol)) + (s0-0 (lambda ((arg0 symbol) (arg1 symbol) (arg2 continue-point) (arg3 game-save)) (stop arg0) (reset-actors arg1) (set-continue! *game-info* arg2) (when arg3 - (load-game! *game-info* (the-as game-save arg3)) + (load-game! *game-info* arg3) (set! arg2 (get-or-create-continue! *game-info*)) ) (suspend) @@ -294,8 +294,8 @@ (case item (('life) (if (>= amount 0.0) - (set! (-> obj life) (seek (-> obj life) (-> obj life-max) amount)) - (set! (-> obj life) (seek (-> obj life) 0.0 (- amount))) + (seek! (-> obj life) (-> obj life-max) amount) + (seek! (-> obj life) 0.0 (- amount)) ) (-> obj life) ) @@ -450,7 +450,7 @@ (if (or (!= (handle->process source-handle) (handle->process (-> obj eco-source))) (>= (- (-> *display* base-frame-counter) (-> obj eco-source-time)) (seconds 0.5)) ) - (sound-play-by-name (static-sound-name "get-green-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-green-eco") ) (when (handle->process source-handle) (set! (-> obj eco-source) source-handle) @@ -466,10 +466,10 @@ ) ) (set! (-> obj health-pickup-time) (-> *display* base-frame-counter)) - (set! (-> obj health) (seek (-> obj health) (-> obj health-max) amount)) + (seek! (-> obj health) (-> obj health-max) amount) ) (else - (set! (-> obj health) (seek (-> obj health) 0.0 (- amount))) + (seek! (-> obj health) 0.0 (- amount)) (if (>= amount -10.0) (pickup-collectable! obj (pickup-type eco-pill) 0.0 source-handle) ) @@ -483,15 +483,14 @@ (type-type? (-> (handle->process source-handle) type) vent) ) cfg-80 - :delay - (nop!) + :delay (nop!) ) (-> obj health) ) (((pickup-type eco-pill)) (when (>= amount 0.0) (set! (-> obj eco-pill-pickup-time) (-> *display* base-frame-counter)) - (set! (-> obj eco-pill) (seek (-> obj eco-pill) (-> obj eco-pill-max) amount)) + (seek! (-> obj eco-pill) (-> obj eco-pill-max) amount) (when (and (>= (-> obj eco-pill) (-> *FACT-bank* eco-pill-max-default)) (< (-> obj health) (-> obj health-max))) (set! (-> obj eco-pill) (- (-> obj eco-pill) (-> *FACT-bank* eco-pill-max-default))) (pickup-collectable! @@ -507,7 +506,7 @@ (((pickup-type money)) (when (< 0.0 amount) (if (>= (- (-> *display* base-frame-counter) (-> obj money-pickup-time)) (seconds 0.05)) - (sound-play-by-name (static-sound-name "money-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "money-pickup") ) (set! (-> obj money-pickup-time) (-> *display* base-frame-counter)) ) @@ -582,16 +581,16 @@ (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 17 (seconds 0.2)) (case kind (((pickup-type eco-blue)) - (sound-play-by-name (static-sound-name "get-blue-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-blue-eco") ) (((pickup-type eco-green)) - (sound-play-by-name (static-sound-name "get-green-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-green-eco") ) (((pickup-type eco-yellow)) - (sound-play-by-name (static-sound-name "get-yellow-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-yellow-eco") ) (((pickup-type eco-red)) - (sound-play-by-name (static-sound-name "get-red-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-red-eco") ) ) ) @@ -600,20 +599,24 @@ (when (= kind (pickup-type eco-blue)) (when (= eco-lev 0.0) (let ((s5-1 (-> obj process))) - (let* ((s3-5 (get-process *default-dead-pool* touch-tracker #x4000)) - (s4-3 - (when s3-5 - (let ((t9-28 (method-of-type touch-tracker activate))) - (t9-28 (the-as touch-tracker s3-5) s5-1 'touch-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s3-5 touch-tracker-init (-> s5-1 root trans) (-> *FACT-bank* suck-bounce-dist) 300) - (-> s3-5 ppointer) - ) - ) - ) + (let ((s4-3 + (process-spawn + touch-tracker + :init touch-tracker-init + (-> s5-1 root trans) + (-> *FACT-bank* suck-bounce-dist) + 300 + :to s5-1 + ) + ) + ) (send-event (ppointer->process s4-3) 'target s5-1) (send-event (ppointer->process s4-3) 'event 'eco-blue) - (send-event (ppointer->process s4-3) 'exit (lambda () (send-event *target* 'query 'powerup 3))) + (send-event + (ppointer->process s4-3) + 'exit + (lambda () (send-event *target* 'query 'powerup (pickup-type eco-blue))) + ) (send-event (ppointer->process s4-3) 'eval @@ -626,26 +629,20 @@ ) ) ) - (let ((s4-4 (get-process *4k-dead-pool* process #x4000))) - (when s4-4 - (let ((t9-35 (method-of-type process activate))) - (t9-35 s4-4 s5-1 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process - s4-4 - (lambda ((arg0 process-drawable)) - (let ((s5-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-0) (seconds 0.6)) - (send-event arg0 'effect 'eco-blue) - (suspend) - ) - ) - (none) + (process-spawn-function + process + (lambda ((arg0 process-drawable)) + (let ((s5-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) s5-0) (seconds 0.6)) + (send-event arg0 'effect 'eco-blue) + (suspend) ) - s5-1 ) - (-> s4-4 ppointer) + (none) ) + s5-1 + :from *4k-dead-pool* + :to s5-1 ) ) ) @@ -734,10 +731,10 @@ ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (defmethod debug-draw! continue-point ((obj continue-point)) - (add-debug-x #t (bucket-id debug-draw1) (-> obj trans) (new 'static 'rgba :r #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf) (-> obj trans) (new 'static 'rgba :r #xff :a #x80)) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj name) (-> obj trans) (font-color white) @@ -746,7 +743,7 @@ (let ((a3-2 (vector-z-quaternion! (new-stack-vector0) (-> obj quat)))) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj trans) a3-2 (meters 2.0) diff --git a/test/decompiler/reference/engine/game/game-save_REF.gc b/test/decompiler/reference/engine/game/game-save_REF.gc index b46f74a558..f494d715f8 100644 --- a/test/decompiler/reference/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/engine/game/game-save_REF.gc @@ -219,7 +219,7 @@ (((game-save-elt buzzer-total)) "buzzer-total" ) - (((game-save-elt moeny-per-level)) + (((game-save-elt money-per-level)) "money-per-level" ) (((game-save-elt money-total)) @@ -312,7 +312,7 @@ ) (when detail (case (-> tag elt-type) - (((game-save-elt moeny-per-level) (game-save-elt deaths-per-level)) + (((game-save-elt money-per-level) (game-save-elt deaths-per-level)) (dotimes (prog-lev-idx (-> tag elt-count)) (let ((lev-name (progress-level-index->string prog-lev-idx))) (if lev-name @@ -510,7 +510,7 @@ ) (let ((v1-56 (&+ v1-55 16))) (let ((a0-30 (the-as game-save-tag (&+ v1-56 0)))) - (set! (-> a0-30 elt-type) (game-save-elt moeny-per-level)) + (set! (-> a0-30 elt-type) (game-save-elt money-per-level)) (set! (-> a0-30 elt-count) 32) (set! (-> a0-30 elt-size) (the-as uint 1)) ) @@ -944,7 +944,7 @@ (((game-save-elt money-total)) (set! (-> obj money-total) (-> data user-float0)) ) - (((game-save-elt moeny-per-level)) + (((game-save-elt money-per-level)) (let ((v1-34 (min 32 (-> data elt-count)))) (dotimes (a0-76 v1-34) (set! (-> obj money-per-level a0-76) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-76)) @@ -1164,14 +1164,12 @@ :id 656 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 2662)) + :parts ((sp-item 2662)) ) ;; failed to figure out what this is: (defpart 2662 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6b :page #x1cf)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6b :page #x1cf)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.5)) (sp-copy-from-other spt-scale-y -4) @@ -1384,8 +1382,7 @@ auto-save-post ;; failed to figure out what this is: (defstate get-heap (auto-save) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* real-frame-counter)) (let ((a0-1 (reserve-alloc *art-control*))) (while (not a0-1) @@ -1400,15 +1397,13 @@ auto-save-post (go-virtual get-card) (none) ) - :post - auto-save-post + :post auto-save-post ) ;; failed to figure out what this is: (defstate get-card (auto-save) :virtual #t - :code - (behavior () + :code (behavior () (label cfg-0) (mc-get-slot-info (-> self slot) (-> self info)) (when (zero? (-> self info known)) @@ -1455,15 +1450,13 @@ auto-save-post ) (none) ) - :post - auto-save-post + :post auto-save-post ) ;; failed to figure out what this is: (defstate format-card (auto-save) :virtual #t - :code - (behavior () + :code (behavior () (when (zero? (-> self info formatted)) (label cfg-1) (set! (-> self result) (mc-format (-> self card))) @@ -1499,15 +1492,13 @@ auto-save-post (go-virtual done) (none) ) - :post - auto-save-post + :post auto-save-post ) ;; failed to figure out what this is: (defstate unformat-card (auto-save) :virtual #t - :code - (behavior () + :code (behavior () (when (nonzero? (-> self info formatted)) (label cfg-1) (set! (-> self result) (mc-unformat (-> self card))) @@ -1515,7 +1506,7 @@ auto-save-post (suspend) (goto cfg-1) ) - (while #t + (loop (set! (-> self result) (the-as mc-status-code (mc-check-result))) (case (-> self result) (((mc-status-code busy)) @@ -1534,15 +1525,13 @@ auto-save-post (go-virtual done) (none) ) - :post - auto-save-post + :post auto-save-post ) ;; failed to figure out what this is: (defstate create-file (auto-save) :virtual #t - :code - (behavior () + :code (behavior () (cond ((zero? (-> self info formatted)) (go-virtual error (mc-status-code no-format)) @@ -1560,7 +1549,7 @@ auto-save-post (suspend) (goto cfg-6) ) - (while #t + (loop (set! (-> self result) (the-as mc-status-code (mc-check-result))) (case (-> self result) (((mc-status-code busy)) @@ -1588,15 +1577,13 @@ auto-save-post (go-virtual done) (none) ) - :post - auto-save-post + :post auto-save-post ) ;; failed to figure out what this is: (defstate save (auto-save) :virtual #t - :code - (behavior () + :code (behavior () (cond ((zero? (-> self info formatted)) (go-virtual error (mc-status-code no-format)) @@ -1627,7 +1614,7 @@ auto-save-post (suspend) (goto cfg-7) ) - (while #t + (loop (set! (-> self result) (the-as mc-status-code (mc-check-result))) (let ((v1-24 (-> self result))) (set! gp-0 (cond @@ -1645,7 +1632,7 @@ auto-save-post (else (case (-> self mode) (('auto-save) - (set! (-> *game-info* auto-save-count) (seekl (-> *game-info* auto-save-count) 0 1)) + (seekl! (-> *game-info* auto-save-count) 0 1) ) ) (go-virtual error (-> self result)) @@ -1660,15 +1647,13 @@ auto-save-post (go-virtual done) (none) ) - :post - auto-save-post + :post auto-save-post ) ;; failed to figure out what this is: (defstate restore (auto-save) :virtual #t - :code - (behavior () + :code (behavior () (local-vars (gp-0 object)) (cond ((zero? (-> self info formatted)) @@ -1690,7 +1675,7 @@ auto-save-post (suspend) (goto cfg-6) ) - (while #t + (loop (set! (-> self result) (the-as mc-status-code (mc-check-result))) (let ((v1-22 (-> self result))) (set! gp-0 (cond @@ -1724,28 +1709,26 @@ auto-save-post (go-virtual error (mc-status-code bad-version)) ) ) - (set-setting! *setting-control* self 'music-volume 'abs 0.0 0) - (set-setting! *setting-control* self 'sfx-volume 'abs 0.0 0) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (-> self save) (the-as string #f)) (set-master-mode 'game) - (push-setting! *setting-control* self 'process-mask 'set 0.0 16) - (copy-settings-from-target! *setting-control*) + (add-setting! 'process-mask 'set 0.0 (process-mask progress)) + (apply-settings *setting-control*) (dotimes (gp-1 15) (suspend) ) (go-virtual done) (none) ) - :post - auto-save-post + :post auto-save-post ) ;; failed to figure out what this is: (defstate error (auto-save) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'progress-allowed?) @@ -1758,8 +1741,7 @@ auto-save-post ) ) ) - :code - (behavior ((arg0 mc-status-code)) + :code (behavior ((arg0 mc-status-code)) (if (-> self buffer) (reserve-free *art-control* (-> self buffer)) ) @@ -1855,15 +1837,13 @@ auto-save-post ) (none) ) - :post - auto-save-post + :post auto-save-post ) ;; failed to figure out what this is: (defstate done (auto-save) :virtual #t - :code - (behavior () + :code (behavior () (if (and (-> self buffer) (-> *art-control* reserve-buffer)) (reserve-free *art-control* (-> self buffer)) ) @@ -1896,22 +1876,13 @@ auto-save-post ) (none) ) - :post - auto-save-post + :post auto-save-post ) ;; definition for function auto-save-command ;; INFO: Return type mismatch (pointer process) vs none. (defun auto-save-command ((arg0 symbol) (arg1 int) (arg2 int) (arg3 process-tree)) - (let ((s2-0 (get-process *default-dead-pool* auto-save #x4000))) - (when s2-0 - (let ((t9-1 (method-of-type auto-save activate))) - (t9-1 (the-as auto-save s2-0) *default-pool* 'auto-save (&-> *dram-stack* 14336)) - ) - (run-now-in-process s2-0 auto-save-init-by-other arg0 arg3 arg1 arg2) - (-> s2-0 ppointer) - ) - ) + (process-spawn auto-save arg0 arg3 arg1 arg2 :stack *kernel-dram-stack*) (none) ) diff --git a/test/decompiler/reference/engine/game/generic-obs-h_REF.gc b/test/decompiler/reference/engine/game/generic-obs-h_REF.gc index a7ed5cd29b..96662b5ffa 100644 --- a/test/decompiler/reference/engine/game/generic-obs-h_REF.gc +++ b/test/decompiler/reference/engine/game/generic-obs-h_REF.gc @@ -15,7 +15,7 @@ (joint joint-mod 4 :offset-assert 240) (new-post-hook (function none) :offset-assert 256) (cur-post-hook (function none) :offset-assert 260) - (clone-copy-trans basic :offset-assert 264) + (clone-copy-trans symbol :offset-assert 264) (shadow-backup basic :offset-assert 268) (draw? symbol :offset-assert 272) ) @@ -130,13 +130,12 @@ ;; definition of type camera-tracker (deftype camera-tracker (process) - ((entity-override entity-actor :offset 52) - (grab-target handle :offset 120) + ((grab-target handle :offset 120) (grab-event symbol :offset-assert 128) (release-event symbol :offset-assert 132) - (old-global-mask uint32 :offset-assert 136) - (old-self-mask uint32 :offset-assert 140) - (old-parent-mask uint32 :offset-assert 144) + (old-global-mask process-mask :offset-assert 136) + (old-self-mask process-mask :offset-assert 140) + (old-parent-mask process-mask :offset-assert 144) (look-at-target handle :offset-assert 152) (pov-target handle :offset-assert 160) (work-process handle :offset-assert 168) @@ -146,7 +145,7 @@ (userdata basic :offset-assert 196) (message basic :offset-assert 200) (border-value basic :offset-assert 204) - (mask-to-clear uint32 :offset-assert 208) + (mask-to-clear process-mask :offset-assert 208) (script pair :offset-assert 212) (script-line pair :offset-assert 216) (script-func (function none) :offset-assert 220) @@ -288,17 +287,17 @@ ;; definition of type othercam (deftype othercam (process) - ((hand handle :offset-assert 112) - (old-global-mask uint32 :offset-assert 120) - (mask-to-clear uint32 :offset-assert 124) - (cam-joint-index int32 :offset-assert 128) - (old-pos vector :inline :offset-assert 144) - (old-mat-z vector :inline :offset-assert 160) - (had-valid-frame basic :offset-assert 176) - (border-value basic :offset-assert 180) - (die? symbol :offset-assert 184) - (survive-anim-end? symbol :offset-assert 188) - (spooling? symbol :offset-assert 192) + ((hand handle :offset-assert 112) + (old-global-mask process-mask :offset-assert 120) + (mask-to-clear process-mask :offset-assert 124) + (cam-joint-index int32 :offset-assert 128) + (old-pos vector :inline :offset-assert 144) + (old-mat-z vector :inline :offset-assert 160) + (had-valid-frame basic :offset-assert 176) + (border-value basic :offset-assert 180) + (die? symbol :offset-assert 184) + (survive-anim-end? symbol :offset-assert 188) + (spooling? symbol :offset-assert 192) ) :heap-base #x60 :method-count-assert 14 diff --git a/test/decompiler/reference/engine/game/generic-obs_REF.gc b/test/decompiler/reference/engine/game/generic-obs_REF.gc index 05ed572bc2..49862f25ae 100644 --- a/test/decompiler/reference/engine/game/generic-obs_REF.gc +++ b/test/decompiler/reference/engine/game/generic-obs_REF.gc @@ -92,23 +92,16 @@ ;; failed to figure out what this is: (defstate swingpole-stance (swingpole) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (and *target* (< (vector-vector-distance (-> self root trans) (-> *target* control unknown-vector90)) (-> self range)) (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-6)) (< (-> *target* control unknown-vector90 y) (+ (-> self root trans y) (* 0.5 (-> self range)))) ) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'pole-grab) - (set! (-> a1-1 param 0) (the-as uint self)) - (if (send-event-function *target* a1-1) - (go swingpole-active) - ) - ) + (if (send-event *target* 'pole-grab self) + (go swingpole-active) + ) ) (suspend) ) @@ -118,8 +111,7 @@ ;; failed to figure out what this is: (defstate swingpole-active (swingpole) - :code - (behavior () + :code (behavior () (suspend) (while (and *target* (= (handle->process (-> *target* control unknown-handle10)) self)) (suspend) @@ -157,8 +149,7 @@ ;; failed to figure out what this is: (defstate die (process-hidden) :virtual #t - :code - (the-as (function none :behavior process-hidden) nothing) + :code (the-as (function none :behavior process-hidden) nothing) ) ;; definition for method 11 of type process-hidden @@ -252,8 +243,7 @@ ;; failed to figure out what this is: (defstate manipy-idle (manipy) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 none)) (let ((v1-0 arg2)) (the-as @@ -386,7 +376,7 @@ ) ((= v1-0 'clone-copy-trans) (set! v0-0 (the-as none (-> arg3 param 0))) - (set! (-> self clone-copy-trans) (the-as basic v0-0)) + (set! (-> self clone-copy-trans) (the-as symbol v0-0)) v0-0 ) ((= v1-0 'release) @@ -431,17 +421,7 @@ (('done) (case (-> self anim-mode) (('play1 'play) - (>= (ja-frame-num 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -2 - ) - ) - ) + (>= (ja-frame-num 0) (the float (+ (-> (ja-group) data 0 length) -2))) ) ) ) @@ -465,8 +445,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (!= (-> self cur-trans-hook) (-> self new-trans-hook)) (set! (-> self cur-trans-hook) (-> self new-trans-hook)) ) @@ -475,19 +454,10 @@ ) (when (and (-> self new-joint-anim) (nonzero? (-> self skel)) - (and (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self new-joint-anim) - ) - (!= (-> self anim-mode) 'clone-anim) - ) + (and (!= (ja-group) (-> self new-joint-anim)) (!= (-> self anim-mode) 'clone-anim)) ) - (ja-channel-push! 1 (the-as int (-> self new-joint-anim-blend))) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! gp-0 (-> self new-joint-anim) num-func-identity) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja-channel-push! 1 (the-as time-frame (-> self new-joint-anim-blend))) + (ja :group! (-> self new-joint-anim) :num! min) ) (let ((v1-20 (handle->process (-> self cur-grab-handle)))) (when v1-20 @@ -510,10 +480,9 @@ ((-> self cur-trans-hook)) (none) ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask heap-shrunk)) - (while #t + (loop ((-> self cur-post-hook)) (if (!= (-> self anim-mode) 'clone-anim) (ja-post) @@ -521,25 +490,15 @@ (suspend) (case (-> self anim-mode) (('loop) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (('play) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (('copy-parent) - (let ((v1-18 (-> self skel root-channel 0))) - (set! (-> v1-18 num-func) num-func-identity) - (set! (-> v1-18 frame-num) - (-> (the-as process-drawable (ppointer->process (-> self parent))) skel root-channel 0 frame-num) - ) - ) + (ja :num-func num-func-identity + :frame-num (-> (the-as process-drawable (ppointer->process (-> self parent))) skel root-channel 0 frame-num) + ) ) (('clone-parent) (let ((gp-0 (ppointer->process (-> self parent)))) @@ -564,18 +523,14 @@ ) ) (the-as int (-> self draw origin-joint-index)) - (the-as symbol (-> self clone-copy-trans)) + (-> self clone-copy-trans) "" ) ) (('still) ) (('play1) - (let ((a0-33 (-> self skel root-channel 0))) - (set! (-> a0-33 param 0) (the float (+ (-> a0-33 frame-group data 0 length) -1))) - (set! (-> a0-33 param 1) 1.0) - (joint-control-channel-group-eval! a0-33 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (if (ja-done? 0) (deactivate self) ) @@ -589,7 +544,7 @@ ;; definition for function manipy-init ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior manipy-init manipy ((arg0 vector) (arg1 entity) (arg2 skeleton-group) (arg3 vector)) +(defbehavior manipy-init manipy ((arg0 vector) (arg1 entity-actor) (arg2 skeleton-group) (arg3 vector)) (stack-size-set! (-> self main-thread) 128) (logior! (-> self mask) (process-mask heap-shrunk)) (set! (-> self entity) arg1) @@ -644,10 +599,7 @@ (set! (-> self draw?) #t) (cond ((nonzero? (-> self skel)) - (set! (-> self new-joint-anim) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) + (set! (-> self new-joint-anim) (ja-group)) (set! (-> self anim-mode) 'loop) ) (else @@ -690,8 +642,7 @@ ;; failed to figure out what this is: (defstate part-tracker-process (part-tracker) - :code - (behavior () + :code (behavior () (set! (-> self start-time) (-> *display* base-frame-counter)) (while (< (- (-> *display* base-frame-counter) (-> self start-time)) (-> self duration)) (let ((gp-0 (handle->process (-> self target)))) @@ -922,16 +873,7 @@ ;; INFO: Return type mismatch object vs symbol. (defbehavior process-release? process ((arg0 process)) (let ((gp-0 (command-get-process arg0 *target*))) - (the-as symbol (if (and gp-0 - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'mode)) - (send-event-function gp-0 a1-1) - ) - 'target-grab - ) + (the-as symbol (if (and gp-0 (send-event gp-0 'query 'mode) 'target-grab) (send-event gp-0 'end-mode) #t ) @@ -1211,8 +1153,7 @@ ;; failed to figure out what this is: (defstate camera-tracker-process (camera-tracker) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 uint)) (let ((v1-0 arg2)) (the-as object (cond @@ -1223,7 +1164,7 @@ ) ((= v1-0 'mask) (set! v0-0 (-> arg3 param 0)) - (set! (-> self mask-to-clear) v0-0) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) v0-0 ) ((= v1-0 'border) @@ -1235,29 +1176,26 @@ ) ) ) - :enter - (behavior () - (if (-> self entity-override) - (dummy-30 (-> self entity-override) (entity-perm-status bit-3) #t) + :enter (behavior () + (if (-> self entity) + (dummy-30 (-> self entity) (entity-perm-status bit-3) #t) ) (if (not (-> self border-value)) - (push-setting! *setting-control* self 'border-mode (-> self border-value) 0.0 0) + (add-setting! 'border-mode (-> self border-value) 0.0 0) ) - (push-setting! *setting-control* self 'process-mask 'set 0.0 (-> self mask-to-clear)) - (push-setting! *setting-control* self 'movie (process->ppointer self) 0.0 0) + (add-setting! 'process-mask 'set 0.0 (-> self mask-to-clear)) + (add-setting! 'movie (process->ppointer self) 0.0 0) (hide-hud-quick) (none) ) - :exit - (behavior () - (if (-> self entity-override) - (dummy-30 (-> self entity-override) (entity-perm-status bit-3) #f) + :exit (behavior () + (if (-> self entity) + (dummy-30 (-> self entity) (entity-perm-status bit-3) #f) ) (send-event *camera* 'clear-entity) (none) ) - :code - (behavior () + :code (behavior () (cond ((-> self script-func) ((-> self script-func)) @@ -1269,7 +1207,7 @@ ) ) ) - (clear-pending-settings-from-process *setting-control* self 'process-mask) + (remove-setting! 'process-mask) (send-event *camera* 'clear-entity) (suspend) (suspend) @@ -1283,7 +1221,7 @@ (defbehavior camera-tracker-init camera-tracker ((arg0 object)) (stack-size-set! (-> self main-thread) 512) (logclear! (-> self mask) (process-mask actor-pause movie enemy platform projectile)) - (set! (-> self mask-to-clear) (the-as uint #x4a0800)) + (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) (set! (-> self grab-target) (the-as handle #f)) (set! (-> self grab-event) 'grab) (set! (-> self release-event) 'end-mode) @@ -1316,7 +1254,7 @@ ) ) (if v1-17 - (set! (-> self entity-override) (the-as entity-actor (-> (the-as process v1-17) entity))) + (set! (-> self entity) (-> (the-as process v1-17) entity)) ) ) (set! (-> self event-hook) (-> camera-tracker-process event)) @@ -1351,27 +1289,23 @@ ;; failed to figure out what this is: (defstate med-res-level-idle (med-res-level) - :code - (behavior () + :code (behavior () (local-vars (v1-37 float)) (rlet ((vf0 :class vf) (vf16 :class vf) (vf17 :class vf) ) (init-vf0-vector) - (while #t + (loop (let ((a0-1 (level-get *level* (-> self level))) (v1-3 (-> *game-info* current-continue level)) ) (cond ((and a0-1 (or (= (-> a0-1 display?) 'special) (= (-> a0-1 display?) 'special-vis))) (logclear! (-> self draw status) (draw-status hidden)) - (when (nonzero? (-> self skel)) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-loop!) + (if (nonzero? (-> self skel)) + (ja :num! (loop!)) ) - ) ) ((or (and a0-1 (= (-> a0-1 status) 'active)) (= v1-3 'firecanyon)) (logior! (-> self draw status) (draw-status hidden)) @@ -1384,12 +1318,9 @@ (if (nonzero? (-> self part)) (spawn (-> self part) (-> self root trans)) ) - (when (nonzero? (-> self skel)) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-loop!) + (if (nonzero? (-> self skel)) + (ja :num! (loop!)) ) - ) ) ) ) @@ -1410,8 +1341,7 @@ (none) ) ) - :post - (the-as (function none :behavior med-res-level) ja-post) + :post (the-as (function none :behavior med-res-level) ja-post) ) ;; definition for symbol *lev-string*, type string @@ -1492,8 +1422,7 @@ ;; failed to figure out what this is: (defstate part-spawner-active (part-spawner) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('stop) (process-entity-status! self (entity-perm-status complete) #t) @@ -1513,9 +1442,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (-> self enable) (spawn (-> self part) (-> self root trans)) (if (nonzero? (-> self sound)) @@ -1630,8 +1558,7 @@ (defpartgroup group-beach-launcher :id 37 :bounds (static-bspherem 0 3 0 5) - :parts - ((sp-item 45 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 45 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 46 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) (sp-item 47 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) (sp-item 48 :fade-after (meters 50) :falloff-to (meters 80)) @@ -1641,8 +1568,7 @@ ;; failed to figure out what this is: (defpart 45 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-flt spt-x (meters 1.5)) (sp-flt spt-y (meters -0.5)) (sp-int spt-rot-x 5) @@ -1660,14 +1586,12 @@ ;; failed to figure out what this is: (defpart 50 - :init-specs - ((sp-flt spt-fade-b -4.551111)) + :init-specs ((sp-flt spt-fade-b -4.551111)) ) ;; failed to figure out what this is: (defpart 46 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 1.8) 1.0) (sp-flt spt-scale-x (meters 0.2)) @@ -1688,8 +1612,7 @@ ;; failed to figure out what this is: (defpart 47 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 1.8) (meters 1) 1.0) (sp-flt spt-scale-x (meters 0.2)) @@ -1710,8 +1633,7 @@ ;; failed to figure out what this is: (defpart 48 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters 2.9) (meters 2.5) 1.0) (sp-flt spt-y (meters -0.5)) @@ -1736,8 +1658,7 @@ ;; failed to figure out what this is: (defpart 49 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 2.9) (meters 2.5) 1.0) (sp-flt spt-y (meters -0.5)) @@ -1764,16 +1685,14 @@ ;; failed to figure out what this is: (defpart 51 - :init-specs - ((sp-flt spt-fade-a -0.18)) + :init-specs ((sp-flt spt-fade-a -0.18)) ) ;; failed to figure out what this is: (defpartgroup group-jungle-launcher :id 38 :bounds (static-bspherem 0 3 0 5) - :parts - ((sp-item 45 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 45 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 52 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) (sp-item 53 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) (sp-item 54 :fade-after (meters 70) :falloff-to (meters 100)) @@ -1782,8 +1701,7 @@ ;; failed to figure out what this is: (defpart 52 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 1.4) 1.0) (sp-flt spt-scale-x (meters 0.2)) @@ -1804,8 +1722,7 @@ ;; failed to figure out what this is: (defpart 53 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 1.4) (meters 0.9) 1.0) (sp-flt spt-scale-x (meters 0.2)) @@ -1826,8 +1743,7 @@ ;; failed to figure out what this is: (defpart 54 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 2.9) (meters 2.5) 1.0) (sp-flt spt-y (meters -0.5)) @@ -1856,8 +1772,7 @@ (defpartgroup group-swamp-launcher :id 39 :bounds (static-bspherem 0 3 0 5) - :parts - ((sp-item 45 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 45 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 46 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) (sp-item 47 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) (sp-item 55 :fade-after (meters 70) :falloff-to (meters 100)) @@ -1866,8 +1781,7 @@ ;; failed to figure out what this is: (defpart 55 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 2.9) (meters 2.5) 1.0) (sp-flt spt-y (meters -0.5)) @@ -1914,8 +1828,7 @@ ;; failed to figure out what this is: (defstate cam-launcher-shortfall (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -1925,8 +1838,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) @@ -1947,22 +1859,20 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (-> *display* base-frame-counter))) - (while #t + (loop (when (not (paused?)) (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) (send-event *camera* 'teleport) (if (and (-> *camera* on-ground) (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1))) - (send-event *camera* 'change-state *camera-base-mode* 150) + (send-event *camera* 'change-state *camera-base-mode* (seconds 0.5)) ) ) (suspend) @@ -1991,8 +1901,7 @@ ;; failed to figure out what this is: (defstate cam-launcher-longfall (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('teleport) #f @@ -2002,8 +1911,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (when (not (-> self enter-has-run)) (new 'stack-no-clear 'vector) (vector-negate! (-> self view-flat) (-> self tracking inv-mat vector 2)) @@ -2017,18 +1925,16 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (cam-launcher-long-joystick) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (-> *display* base-frame-counter))) - (while #t + (loop (when (not (paused?)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) @@ -2070,7 +1976,7 @@ (set! (-> self trans z) (-> *camera* tpos-curr z)) (vector+! (-> self trans) (-> self trans) (-> self view-flat)) (if (and (-> *camera* on-ground) (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1))) - (send-event *camera* 'change-state *camera-base-mode* 150) + (send-event *camera* 'change-state *camera-base-mode* (seconds 0.5)) ) ) (vector-reset! (-> self tracking follow-off)) @@ -2091,8 +1997,7 @@ ;; failed to figure out what this is: (defstate launcher-idle (launcher) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('instant-death) (go launcher-deactivated) @@ -2103,46 +2008,25 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (and *target* (>= (-> self active-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) ) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'powerup)) - (set! (-> a1-1 param 1) (the-as uint 3)) - (cond - ((send-event-function *target* a1-1) - (go launcher-active) - ) - (else - (let ((gp-0 'target-launch) - (a1-2 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 1) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'mode)) - (if (= (send-event-function *target* a1-2) gp-0) - (send-event *target* 'end-mode) - ) - ) + (cond + ((send-event *target* 'query 'powerup (pickup-type eco-blue)) + (go launcher-active) + ) + (else + (let ((gp-0 'target-launch)) + (if (= (send-event *target* 'query 'mode) gp-0) + (send-event *target* 'end-mode) + ) ) ) ) (if (and (and *target* (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 2) - (set! (-> a1-5 message) 'query) - (set! (-> a1-5 param 0) (the-as uint 'powerup)) - (set! (-> a1-5 param 1) (the-as uint 3)) - (not (send-event-function *target* a1-5)) - ) + (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (level-hint-spawn (game-text-id daxter-launcher-no-eco) @@ -2155,14 +2039,12 @@ ) (none) ) - :code - (the-as (function none :behavior launcher) anim-loop) + :code (the-as (function none :behavior launcher) anim-loop) ) ;; failed to figure out what this is: (defstate launcher-active (launcher) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (or (= arg2 'touch) (= arg2 'attack)) (set! (-> self state-time) (-> *display* base-frame-counter)) (send-event arg0 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) @@ -2177,38 +2059,29 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-param)) (set! (-> v1-0 id) (-> self sound-id)) (set! (-> v1-0 parms volume) -4) (set! (-> v1-0 auto-time) 120) (set! (-> v1-0 auto-from) 2) - (set! (-> v1-0 parms mask) (the-as uint 17)) + (set! (-> v1-0 parms mask) (sound-mask volume time)) (-> v1-0 id) ) (none) ) - :trans - (behavior () + :trans (behavior () (if (or (or (not *target*) (< (-> self active-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) ) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'powerup)) - (set! (-> a1-1 param 1) (the-as uint 3)) - (not (send-event-function *target* a1-1)) - ) + (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (go launcher-idle) ) (spawn (-> self part) (-> self root-override trans)) - (sound-play-by-name (static-sound-name "launch-idle") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "launch-idle" :id (-> self sound-id)) (if (and (and *target* (>= (+ 2867.2 (-> self root-override root-prim prim-core world-sphere w)) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -2219,9 +2092,8 @@ ) (none) ) - :code - (behavior () - (sound-play-by-name (static-sound-name "launch-start") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (sound-play "launch-start") (anim-loop) (none) ) @@ -2229,8 +2101,7 @@ ;; failed to figure out what this is: (defstate launcher-deactivated (launcher) - :code - (the-as (function none :behavior launcher) anim-loop) + :code (the-as (function none :behavior launcher) anim-loop) ) ;; definition for method 11 of type launcher @@ -2359,8 +2230,7 @@ ;; failed to figure out what this is: (defstate touch-tracker-idle (touch-tracker) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 none)) (let ((v1-0 arg2)) (the-as object (cond @@ -2371,28 +2241,23 @@ ((= (-> self event) 'attack) (cond ((= (-> arg0 type) target) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) (the-as process v1-1)) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) (-> self event)) - (set! (-> a1-2 param 0) (the-as uint #f)) - (let ((a2-2 (new 'static 'attack-info :mask #x20))) - (set! (-> a2-2 mode) (the-as symbol (-> self event-mode))) - (set! (-> a1-2 param 1) (the-as uint a2-2)) - ) - (send-event-function arg0 a1-2) + (send-event + arg0 + (-> self event) + :from (the-as process v1-1) + #f + (static-attack-info ((mode (the-as symbol (-> self event-mode))))) ) ) ((= (-> v1-1 type) target) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) (the-as process v1-1)) - (set! (-> a1-4 num-params) 4) - (set! (-> a1-4 message) (-> self event)) - (set! (-> a1-4 param 0) (the-as uint #f)) - (set! (-> a1-4 param 1) (the-as uint (-> self event-mode))) - (set! (-> a1-4 param 2) (the-as uint (-> *target* control unknown-dword50))) - (set! (-> a1-4 param 3) (the-as uint (-> *target* control unknown-dword51))) - (send-event-function arg0 a1-4) + (send-event + arg0 + (-> self event) + :from (the-as process v1-1) + #f + (-> self event-mode) + (-> *target* control unknown-dword50) + (-> *target* control unknown-dword51) ) ) (else @@ -2413,12 +2278,7 @@ ) ) ((-> self event) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) (the-as process v1-1)) - (set! (-> a1-6 num-params) 0) - (set! (-> a1-6 message) (-> self event)) - (send-event-function arg0 a1-6) - ) + (send-event arg0 (-> self event) :from (the-as process v1-1)) ) (else (let ((t0-5 (new 'stack-no-clear 'event-message-block))) @@ -2467,8 +2327,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (while ((-> self run-function)) (let* ((gp-0 (handle->process (-> self target))) @@ -2625,8 +2484,7 @@ ;; failed to figure out what this is: (defpart 2528 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xc :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc :page #x2)) (sp-func spt-birth-func 'birth-func-set-quat) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) diff --git a/test/decompiler/reference/engine/game/main_REF.gc b/test/decompiler/reference/engine/game/main_REF.gc index 91e5d42913..8508036b19 100644 --- a/test/decompiler/reference/engine/game/main_REF.gc +++ b/test/decompiler/reference/engine/game/main_REF.gc @@ -25,7 +25,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-0 (the-as (pointer dma-tag) a3-2) ) @@ -62,7 +62,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) sprite-dma-data (the-as (pointer dma-tag) a3-1) ) @@ -101,7 +101,7 @@ ) (logclear! (-> *setting-control* default process-mask) (process-mask menu)) (set! *pause-lock* #f) - (sound-group-pause (the-as uint 255)) + (sound-group-pause (sound-group sfx music dialog sog3 ambient sog5 sog6 sog7)) (hide-progress-screen) ) (('menu) @@ -121,11 +121,11 @@ ) (('game) (logclear! (-> *setting-control* default process-mask) (process-mask pause menu)) - (sound-group-continue (the-as uint 255)) + (sound-group-continue (sound-group sfx music dialog sog3 ambient sog5 sog6 sog7)) (hide-progress-screen) ) ) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) 0 (none) ) @@ -245,8 +245,7 @@ ) ;; definition for symbol *screen-filter*, type screen-filter -(define - *screen-filter* +(define *screen-filter* (new 'static 'screen-filter :draw? #f :color (new 'static 'rgba :g #x20 :b #x40 :a #x50)) ) @@ -266,7 +265,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-0 (the-as (pointer dma-tag) a3-1) ) @@ -440,8 +439,8 @@ (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons r1)) (set! *cheat-mode* (not *cheat-mode*)) (if *cheat-mode* - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-menu") + (sound-play "cursor-options") ) (set! (-> *cheat-temp* 0) 0) 0 @@ -613,8 +612,8 @@ ) ) (if *cheat-mode* - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-menu") + (sound-play "cursor-options") ) (set! (-> *cheat-temp* 1) 0) 0 @@ -722,8 +721,8 @@ ) ) (if *progress-cheat* - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-menu") + (sound-play "cursor-options") ) (set! (-> *cheat-temp* 2) 0) 0 @@ -831,8 +830,8 @@ ) ) (if *progress-cheat* - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-menu") + (sound-play "cursor-options") ) (set! (-> *cheat-temp* 3) 0) 0 @@ -879,7 +878,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) dma-start (the-as (pointer dma-tag) a3-9) ) @@ -907,37 +906,27 @@ (progress-allowed?) (!= *master-exit* #t) ) - (let ((game-end-proc (get-process *default-dead-pool* process #x4000))) - (if (when game-end-proc - (let ((t9-28 (method-of-type process activate))) - (t9-28 game-end-proc *default-pool* 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process - game-end-proc - (lambda :behavior process - () - (set-blackout-frames (seconds 100)) - (set! (-> *setting-control* default allow-pause) #f) - (set! (-> *setting-control* default allow-progress) #f) - (copy-settings-from-target! *setting-control*) - (set! (-> *setting-control* default sfx-volume) 0.0) - (set! (-> *setting-control* default music-volume) 0.0) - (set! (-> *setting-control* default dialog-volume) 0.0) - (set! (-> *setting-control* default ambient-volume) 0.0) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) - (suspend) - ) - ) - (kernel-shutdown) - (none) - ) - ) - (-> game-end-proc ppointer) - ) - (set! *master-exit* #t) - ) - ) + (if (process-spawn-function process (lambda :behavior process + () + (set-blackout-frames (seconds 100)) + (set! (-> *setting-control* default allow-pause) #f) + (set! (-> *setting-control* default allow-progress) #f) + (apply-settings *setting-control*) + (set! (-> *setting-control* default sfx-volume) 0.0) + (set! (-> *setting-control* default music-volume) 0.0) + (set! (-> *setting-control* default dialog-volume) 0.0) + (set! (-> *setting-control* default ambient-volume) 0.0) + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) + (suspend) + ) + ) + (kernel-shutdown) + (none) + ) + ) + (set! *master-exit* #t) + ) ) ) ) @@ -981,7 +970,7 @@ (let ((disp *display*)) (dma-send-to-spr (the-as uint #x70000000) (the-as uint *terrain-context*) (the-as uint 0) #t) (set! *teleport* #t) - (update-per-frame-settings! *setting-control*) + (update *setting-control*) (init-time-of-day-context *time-of-day-context*) (display-sync disp) (swap-display disp) @@ -1272,7 +1261,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-3 (the-as (pointer dma-tag) a3-6) ) @@ -1321,7 +1310,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-4 (the-as (pointer dma-tag) a3-9) ) diff --git a/test/decompiler/reference/engine/game/powerups_REF.gc b/test/decompiler/reference/engine/game/powerups_REF.gc index f195340ad8..2e61adb28e 100644 --- a/test/decompiler/reference/engine/game/powerups_REF.gc +++ b/test/decompiler/reference/engine/game/powerups_REF.gc @@ -43,7 +43,7 @@ ) (cond ((zero? arg5) - (while #t + (loop (suspend) ) ) @@ -64,8 +64,7 @@ ;; failed to figure out what this is: (defpart 255 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -84,8 +83,7 @@ ;; failed to figure out what this is: (defpart 256 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -104,8 +102,7 @@ ;; failed to figure out what this is: (defpart 257 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 1.0 3.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) @@ -125,8 +122,7 @@ ;; failed to figure out what this is: (defpart 259 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.0 3.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) @@ -146,8 +142,7 @@ ;; failed to figure out what this is: (defpart 258 - :init-specs - ((sp-flt spt-r 64.0) + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) (sp-flt spt-fade-r -1.0) (sp-flt spt-fade-g -0.4) @@ -157,8 +152,7 @@ ;; failed to figure out what this is: (defpart 260 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -181,14 +175,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 261) (sp-item 262) (sp-item 263 :flags (is-3d)) (sp-item 264) (sp-item 265 :flags (is-3d))) + :parts ((sp-item 261) (sp-item 262) (sp-item 263 :flags (is-3d)) (sp-item 264) (sp-item 265 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 264 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 32.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-scale-x (meters 1) (meters 3) 1.0) @@ -212,8 +204,7 @@ ;; failed to figure out what this is: (defpart 266 - :init-specs - ((sp-flt spt-r 0.0) + :init-specs ((sp-flt spt-r 0.0) (sp-rnd-flt spt-g 32.0 32.0 1.0) (sp-rnd-flt spt-b 192.0 63.0 1.0) (sp-rnd-int spt-a 0 63 1.0) @@ -224,8 +215,7 @@ ;; failed to figure out what this is: (defpart 265 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.5)) (sp-flt spt-scale-x (meters 0)) @@ -245,14 +235,12 @@ ;; failed to figure out what this is: (defpart 267 - :init-specs - ((sp-flt spt-fade-a -2.1333334)) + :init-specs ((sp-flt spt-fade-a -2.1333334)) ) ;; failed to figure out what this is: (defpart 263 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.5)) (sp-flt spt-scale-x (meters 0)) @@ -273,14 +261,12 @@ ;; failed to figure out what this is: (defpart 268 - :init-specs - ((sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-a -1.4222223)) ) ;; failed to figure out what this is: (defpart 261 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -305,8 +291,7 @@ ;; failed to figure out what this is: (defpart 262 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -331,8 +316,7 @@ ;; failed to figure out what this is: (defpart 269 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -351,8 +335,7 @@ ;; failed to figure out what this is: (defpart 270 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -371,8 +354,7 @@ ;; failed to figure out what this is: (defpart 271 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.5 2.0 1.0) (sp-flt spt-y (meters -0.05)) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) @@ -400,14 +382,12 @@ ;; failed to figure out what this is: (defpart 272 - :init-specs - ((sp-flt spt-fade-r 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0)) ) ;; failed to figure out what this is: (defpart 273 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -426,8 +406,7 @@ ;; failed to figure out what this is: (defpart 274 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -446,8 +425,7 @@ ;; failed to figure out what this is: (defpart 275 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.5 2.0 1.0) (sp-flt spt-y (meters -0.05)) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) @@ -475,14 +453,12 @@ ;; failed to figure out what this is: (defpart 276 - :init-specs - ((sp-flt spt-fade-r 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0)) ) ;; failed to figure out what this is: (defpart 277 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -501,8 +477,7 @@ ;; failed to figure out what this is: (defpart 278 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -521,8 +496,7 @@ ;; failed to figure out what this is: (defpart 279 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.5 2.0 1.0) (sp-flt spt-y (meters -0.05)) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) @@ -550,8 +524,7 @@ ;; failed to figure out what this is: (defpart 280 - :init-specs - ((sp-flt spt-fade-g 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0)) ) ;; definition for function eco-blue-glow @@ -642,29 +615,20 @@ ) ) (let ((f0-8 (lerp-scale 60.0 90.0 (-> self control unknown-float01) 0.0 81920.0))) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 104) - ) - ) + (if (not (ja-group? (-> self draw art-group data 104))) (set! f0-8 (* 0.75 f0-8)) ) - (set! (-> self control unknown-float141) - (seek (-> self control unknown-float141) f0-8 (* 100.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self control unknown-float141) f0-8 (* 100.0 (-> *display* seconds-per-frame))) ) (let ((f30-0 (-> self control unknown-float141)) (f0-13 (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 81920.0)) ) - (sound-play-by-name - (static-sound-name "ice-loop") - (-> self control unknown-soundid00) - (the int (* 10.24 f30-0)) - (the int (* 1524.0 f0-13)) - 0 - 1 - (the-as symbol (-> self control trans)) + (sound-play + "ice-loop" + :id (-> self control unknown-soundid00) + :vol f30-0 + :pitch f0-13 + :position (the-as symbol (-> self control trans)) ) ) ) @@ -676,7 +640,7 @@ (set! (-> v1-64 parms volume) -4) (set! (-> v1-64 auto-time) 48) (set! (-> v1-64 auto-from) 2) - (set! (-> v1-64 parms mask) (the-as uint 17)) + (set! (-> v1-64 parms mask) (sound-mask volume time)) (-> v1-64 id) ) ) @@ -695,12 +659,12 @@ ) (set! (-> self fact-info-target eco-level) 0.0) (set! (-> self fact-info-target eco-timeout) 0) - (set! (-> self state-flags) (logand -65 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags invuln-powerup)) (send-event self 'reset-collide) (stop! (-> self sound)) ) (when (and (< 0.0 (-> self fact-info-target eco-level)) - (zero? (logand (-> self state-flags) 512)) + (zero? (logand (-> self state-flags) (state-flags first-person-mode))) (zero? (logand (-> self draw status) (draw-status hidden no-anim))) (not (movie?)) (rand-vu-percent? @@ -788,7 +752,9 @@ (change-sound! (-> self sound) (static-sound-name "blue-eco-jak")) (let ((v1-150 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) (cond - ((and (logtest? (-> self control unknown-surface00 flags) 2048) (zero? (logand (-> self control status) 1))) + ((and (logtest? (-> self control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + ) (set! (-> *part-id-table* 259 init-specs 4 initial-valuef) 0.0) (set! (-> *part-id-table* 259 init-specs 4 random-rangef) 65536.0) ) diff --git a/test/decompiler/reference/engine/game/projectiles_REF.gc b/test/decompiler/reference/engine/game/projectiles_REF.gc index d89f1b2f25..bd62e03e13 100644 --- a/test/decompiler/reference/engine/game/projectiles_REF.gc +++ b/test/decompiler/reference/engine/game/projectiles_REF.gc @@ -117,7 +117,7 @@ ) ;; definition for function projectile-collision-reaction -;; INFO: Return type mismatch int vs uint. +;; INFO: Return type mismatch int vs cshape-moving-flags. ;; Used lq/sq (defun projectile-collision-reaction ((arg0 collide-shape-moving) (arg1 collide-shape-intersect) (arg2 vector) (arg3 vector)) (local-vars (sv-64 vector) (sv-68 vector) (sv-72 matrix) (sv-80 int) (sv-224 symbol)) @@ -159,7 +159,7 @@ (set! sv-80 (logior sv-80 16)) ) (set! sv-224 (< (fabs (-> arg0 surface-angle)) (-> *pat-mode-info* (-> arg0 cur-pat mode) wall-angle))) - (if (zero? (logand (-> arg0 prev-status) 1)) + (if (zero? (logand (-> arg0 prev-status) (cshape-moving-flags onsurf))) (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) ) (set! sv-80 (logior sv-80 4)) @@ -187,7 +187,7 @@ ) ) (logior! (-> arg0 status) sv-80) - (the-as uint sv-80) + (the-as cshape-moving-flags sv-80) ) ;; failed to figure out what this is: @@ -195,8 +195,7 @@ :id 102 :duration 300 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 349 :flags (launch-asap) :binding 350) + :parts ((sp-item 349 :flags (launch-asap) :binding 350) (sp-item 350 :flags (start-dead launch-asap) :binding 351) (sp-item 351 :flags (start-dead launch-asap) :binding 352) (sp-item 352 :flags (start-dead) :binding 353) @@ -235,8 +234,7 @@ ;; failed to figure out what this is: (defpart 349 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.01)) (sp-copy-from-other spt-scale-y -4) @@ -249,8 +247,7 @@ ;; failed to figure out what this is: (defpart 350 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 16) 1.0) @@ -270,8 +267,7 @@ ;; failed to figure out what this is: (defpart 351 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 0)) @@ -291,8 +287,7 @@ ;; failed to figure out what this is: (defpart 352 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -311,8 +306,7 @@ ;; failed to figure out what this is: (defpart 353 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-y (meters -0.05)) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) @@ -340,8 +334,7 @@ ;; failed to figure out what this is: (defpart 354 - :init-specs - ((sp-flt spt-fade-r 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0)) ) ;; failed to figure out what this is: @@ -349,8 +342,7 @@ :id 103 :duration 600 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 355 :flags (launch-asap)) + :parts ((sp-item 355 :flags (launch-asap)) (sp-item 356 :flags (bit1) :period 630 :length 15) (sp-item 357 :flags (launch-asap)) (sp-item 358 :flags (launch-asap) :binding 359) @@ -375,8 +367,7 @@ ;; failed to figure out what this is: (defpart 355 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 8)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -395,8 +386,7 @@ ;; failed to figure out what this is: (defpart 357 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-x (meters -0.6) (meters 1.2) 1.0) (sp-rnd-flt spt-y (meters -0.6) (meters 1.2) 1.0) @@ -421,8 +411,7 @@ ;; failed to figure out what this is: (defpart 356 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -446,8 +435,7 @@ ;; failed to figure out what this is: (defpart 360 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 24.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -471,8 +459,7 @@ ;; failed to figure out what this is: (defpart 358 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-scale-x (meters 0.1)) (sp-copy-from-other spt-scale-y -4) @@ -489,8 +476,7 @@ ;; failed to figure out what this is: (defpart 361 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 32.0) (sp-flt spt-scale-x (meters 0.1)) (sp-copy-from-other spt-scale-y -4) @@ -507,8 +493,7 @@ ;; failed to figure out what this is: (defpart 359 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.1) (meters 0.2) 1.0) @@ -537,8 +522,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 2059 :period 600 :length 5) + :parts ((sp-item 2059 :period 600 :length 5) (sp-item 2060 :fade-after (meters 80) :falloff-to (meters 80) :period 600 :length 40) (sp-item 2061 :period 600 :length 20) (sp-item 2062 :fade-after (meters 120) :falloff-to (meters 120) :period 600 :length 20) @@ -547,8 +531,7 @@ ;; failed to figure out what this is: (defpart 2060 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -573,14 +556,12 @@ ;; failed to figure out what this is: (defpart 2063 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) ) ;; failed to figure out what this is: (defpart 2062 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-scale-x (meters 0.2)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) @@ -598,8 +579,7 @@ ;; failed to figure out what this is: (defpart 2059 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 16)) (sp-copy-from-other spt-scale-y -4) @@ -615,8 +595,7 @@ ;; failed to figure out what this is: (defpart 2061 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -643,8 +622,7 @@ ;; failed to figure out what this is: (defpart 2064 - :init-specs - ((sp-flt spt-fade-r -0.53333336) + :init-specs ((sp-flt spt-fade-r -0.53333336) (sp-flt spt-fade-g -0.53333336) (sp-flt spt-fade-b -1.0666667) (sp-flt spt-fade-a -0.53333336) @@ -669,24 +647,13 @@ ;; failed to figure out what this is: (defstate projectile-moving (projectile) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touched) (when (-> self attack-mode) (when (cond ((= (-> arg0 type) target) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'attack) - (set! (-> a1-1 param 0) (-> arg3 param 0)) - (let ((a0-4 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-4 mode) (-> self attack-mode)) - (set! (-> a1-1 param 1) (the-as uint a0-4)) - ) - (send-event-function arg0 a1-1) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode (-> self attack-mode))))) ) (else (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -721,13 +688,11 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 #f)) (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (-> self timeout)) (let ((s5-0 (the int (-> *display* time-ratio)))) @@ -739,14 +704,14 @@ (dummy-28 self) ((-> self update-velocity) self) (when (logtest? (-> self options) 2) - (set! (-> self tween) (seek (-> self tween) 1.0 (* 0.5 (-> *display* seconds-per-frame)))) + (seek! (-> self tween) 1.0 (* 0.5 (-> *display* seconds-per-frame))) (let ((f0-6 (vector-vector-distance (-> self root-override trans) (-> self target)))) (cond ((< f0-6 20480.0) - (set! (-> self tween) (seek (-> self tween) 1.0 (* 3.0 (-> *display* seconds-per-frame)))) + (seek! (-> self tween) 1.0 (* 3.0 (-> *display* seconds-per-frame))) ) ((< f0-6 40960.0) - (set! (-> self tween) (seek (-> self tween) 1.0 (-> *display* seconds-per-frame))) + (seek! (-> self tween) 1.0 (-> *display* seconds-per-frame)) ) ) ) @@ -767,7 +732,9 @@ (countdown (v1-35 16) (+! f0-16 (-> self old-dist v1-35)) ) - (if (or (and (logtest? (-> self root-override status) 8) (< f0-16 2048.0)) (< f0-16 204.8)) + (if (or (and (logtest? (-> self root-override status) (cshape-moving-flags twall)) (< f0-16 2048.0)) + (< f0-16 204.8) + ) (set! gp-0 #t) ) ) @@ -792,7 +759,7 @@ (s3-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0)) (f30-0 (vector-length (-> arg0 root-override transv))) ) - (if (logtest? (-> arg0 root-override status) 4) + (if (logtest? (-> arg0 root-override status) (cshape-moving-flags tsurf)) (vector-flatten! s5-1 s5-1 (-> arg0 root-override local-normal)) ) (vector-normalize-copy! s4-0 s5-1 1.0) @@ -825,30 +792,22 @@ ;; failed to figure out what this is: (defstate projectile-impact (projectile) :virtual #t - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 104) - -1 - #f - #f - #f - (-> self root-override root-prim prim-core) - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 104) + -1 + #f + #f + #f + (-> self root-override root-prim prim-core) + :to *entity-pool* ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "yellow-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "yellow-explode") (suspend) (go-virtual projectile-die) (none) @@ -858,30 +817,22 @@ ;; failed to figure out what this is: (defstate projectile-dissipate (projectile) :virtual #t - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 104) - -1 - #f - #f - #f - (-> self root-override root-prim prim-core) - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 104) + -1 + #f + #f + #f + (-> self root-override root-prim prim-core) + :to *entity-pool* ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "yellow-fizzle") (new-sound-id) 1024 0 0 1 #t) + (sound-play "yellow-fizzle") (suspend) (go-virtual projectile-die) (none) @@ -933,8 +884,7 @@ ;; failed to figure out what this is: (defstate projectile-die (projectile) :virtual #t - :code - (behavior () + :code (behavior () (let ((v1-0 (-> self notify-handle))) (if (handle->process v1-0) (send-event (-> v1-0 process 0) 'notify 'die) @@ -956,7 +906,7 @@ ;; definition for function projectile-init-by-other ;; Used lq/sq -(defbehavior projectile-init-by-other projectile ((arg0 entity) (arg1 vector) (arg2 vector) (arg3 uint) (arg4 handle)) +(defbehavior projectile-init-by-other projectile ((arg0 entity-actor) (arg1 vector) (arg2 vector) (arg3 uint) (arg4 handle)) (stack-size-set! (-> self main-thread) 512) (set! (-> self entity) arg0) (set! (-> self attack-mode) #f) @@ -1030,19 +980,11 @@ (set! (-> *part-id-table* 358 init-specs 11 initial-valuef) (the float (sar (shl (the int (+ -16384.0 f30-0)) 48) 48)) ) - (sound-play-by-name (static-sound-name "yellow-fire") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj sound-id) (sound-play-by-name (static-sound-name "yellow-buzz") (new-sound-id) 1024 0 0 1 #t)) - (when (zero? (logand (-> obj options) 416)) - (let ((s4-2 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-2 - (let ((t9-10 (method-of-type part-tracker activate))) - (t9-10 (the-as part-tracker s4-2) obj 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s4-2 part-tracker-init (-> *part-group-id-table* 103) -1 #f #f #f s5-0) - (-> s4-2 ppointer) - ) + (sound-play "yellow-fire") + (set! (-> obj sound-id) (sound-play "yellow-buzz")) + (if (zero? (logand (-> obj options) 416)) + (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 103) -1 #f #f #f s5-0 :to obj) ) - ) (set! (-> *part-id-table* 350 init-specs 2 initial-valuef) f30-0) ) ) @@ -1051,7 +993,7 @@ (case (-> *target* current-level name) (('swamp) (set! (-> obj water) (new 'process 'water-control obj 0 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (the-as uint 146)) + (set! (-> obj water flags) (water-flags wt01 wt04 wt07)) (set! (-> obj water height) (if (logtest? (-> obj options) 64) 8192.0 10240.0 @@ -1062,7 +1004,7 @@ (('ogre) (when (zero? (logand (-> obj options) 128)) (set! (-> obj water) (new 'process 'water-control obj 0 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (the-as uint 146)) + (set! (-> obj water flags) (water-flags wt01 wt04 wt07)) (set! (-> obj water height) 129024.0) (logior! (-> obj root-override root-prim collide-with) (collide-kind water)) ) @@ -1070,7 +1012,7 @@ (('finalboss) (set! (-> obj root-override trans y) (+ 4096.0 (-> obj root-override trans y))) (set! (-> obj water) (new 'process 'water-control obj 0 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (the-as uint 146)) + (set! (-> obj water flags) (water-flags wt01 wt04 wt07)) (set! (-> obj water height) 1977958.4) (logior! (-> obj root-override root-prim collide-with) (collide-kind water)) ) @@ -1099,7 +1041,7 @@ (-> obj root-override shadow-pos) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 12288.0 81920.0 ) @@ -1138,7 +1080,7 @@ ) (sound-trans-convert (-> s5-0 parms trans) a1-3) ) - (set! (-> s5-0 parms mask) (the-as uint 32)) + (set! (-> s5-0 parms mask) (sound-mask trans)) (-> s5-0 id) ) 0 @@ -1233,7 +1175,7 @@ ;; Used lq/sq (defmethod dummy-27 projectile-blue ((obj projectile-blue)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) - (sound-play-by-name (static-sound-name "blue-eco-on") (new-sound-id) 1024 0 0 1 #t) + (sound-play "blue-eco-on") (set! (-> obj mode) 2) (set! (-> obj max-speed) (-> *TARGET-bank* yellow-projectile-speed)) (set! (-> obj update-velocity) projectile-update-velocity-space-wars) @@ -1288,7 +1230,7 @@ ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (defun spawn-projectile-blue ((arg0 target)) - (local-vars (sv-48 entity)) + (local-vars (sv-48 entity-actor)) (with-pp (when arg0 (let ((s3-0 (rand-vu-int-range 3 (+ (-> arg0 node-list length) -1))) @@ -1369,8 +1311,7 @@ ;; failed to figure out what this is: (defstate projectile-impact (projectile-blue) :virtual #t - :code - (behavior () + :code (behavior () (cleanup-for-death self) (none) ) @@ -1379,8 +1320,7 @@ ;; failed to figure out what this is: (defstate projectile-dissipate (projectile-blue) :virtual #t - :code - (behavior () + :code (behavior () (go-virtual projectile-die) (none) ) diff --git a/test/decompiler/reference/engine/game/settings-h_REF.gc b/test/decompiler/reference/engine/game/settings-h_REF.gc index 0782a75509..b96e193214 100644 --- a/test/decompiler/reference/engine/game/settings-h_REF.gc +++ b/test/decompiler/reference/engine/game/settings-h_REF.gc @@ -106,11 +106,11 @@ :flag-assert #xe00000278 (:methods (new (symbol type int) _type_ 0) - (push-setting! (_type_ process symbol object object object) none 9) - (set-setting! (_type_ process symbol symbol float int) none 10) - (clear-pending-settings-from-process (_type_ process symbol) none 11) - (copy-settings-from-target! (_type_) setting-data 12) - (update-per-frame-settings! (_type_) setting-data 13) + (add-setting (_type_ process symbol object object object) none 9) + (set-setting (_type_ process symbol object object object) none 10) + (remove-setting (_type_ process symbol) none 11) + (apply-settings (_type_) setting-data 12) + (update (_type_) setting-data 13) ) ) diff --git a/test/decompiler/reference/engine/game/settings_REF.gc b/test/decompiler/reference/engine/game/settings_REF.gc index 088b6d6bca..ef48fb637a 100644 --- a/test/decompiler/reference/engine/game/settings_REF.gc +++ b/test/decompiler/reference/engine/game/settings_REF.gc @@ -194,7 +194,7 @@ ;; definition for method 9 of type setting-control ;; INFO: Return type mismatch int vs none. -(defmethod push-setting! setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) +(defmethod add-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) 0 (none) @@ -202,8 +202,8 @@ ;; definition for method 10 of type setting-control ;; INFO: Return type mismatch int vs none. -(defmethod set-setting! setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 symbol) (arg3 float) (arg4 int)) - (clear-pending-settings-from-process obj arg0 arg1) +(defmethod set-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) + (remove-setting obj arg0 arg1) (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) 0 (none) @@ -211,7 +211,7 @@ ;; definition for method 11 of type setting-control ;; INFO: Return type mismatch int vs none. -(defmethod clear-pending-settings-from-process setting-control ((obj setting-control) (arg0 process) (arg1 symbol)) +(defmethod remove-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol)) (when arg0 (let ((s5-0 (-> obj engine)) (s4-0 (-> arg0 connection-list next1)) @@ -231,7 +231,7 @@ ) ;; definition for method 12 of type setting-control -(defmethod copy-settings-from-target! setting-control ((obj setting-control)) +(defmethod apply-settings setting-control ((obj setting-control)) (let ((gp-0 (-> obj current))) (let ((s5-0 (-> obj target))) (mem-copy! (the-as pointer s5-0) (the-as pointer (-> obj default)) 196) @@ -263,34 +263,26 @@ ) ;; definition for method 13 of type setting-control -(defmethod update-per-frame-settings! setting-control ((obj setting-control)) - (copy-settings-from-target! obj) +(defmethod update setting-control ((obj setting-control)) + (apply-settings obj) (let ((gp-0 (-> obj current))) (let ((s5-1 (-> obj target))) (when *sound-player-enable* (when (!= (-> gp-0 sfx-volume) (-> s5-1 sfx-volume)) - (set! (-> gp-0 sfx-volume) - (seek (-> gp-0 sfx-volume) (-> s5-1 sfx-volume) (* 100.0 (-> *display* seconds-per-frame))) - ) - (sound-set-volume (the-as uint 1) (-> gp-0 sfx-volume)) + (seek! (-> gp-0 sfx-volume) (-> s5-1 sfx-volume) (* 100.0 (-> *display* seconds-per-frame))) + (sound-set-volume (sound-group sfx) (-> gp-0 sfx-volume)) ) (when (!= (-> gp-0 music-volume) (-> s5-1 music-volume)) - (set! (-> gp-0 music-volume) - (seek (-> gp-0 music-volume) (-> s5-1 music-volume) (* 100.0 (-> *display* seconds-per-frame))) - ) - (sound-set-volume (the-as uint 2) (-> gp-0 music-volume)) + (seek! (-> gp-0 music-volume) (-> s5-1 music-volume) (* 100.0 (-> *display* seconds-per-frame))) + (sound-set-volume (sound-group music) (-> gp-0 music-volume)) ) (when (!= (-> gp-0 dialog-volume) (-> s5-1 dialog-volume)) - (set! (-> gp-0 dialog-volume) - (seek (-> gp-0 dialog-volume) (-> s5-1 dialog-volume) (* 100.0 (-> *display* seconds-per-frame))) - ) - (sound-set-volume (the-as uint 4) (-> gp-0 dialog-volume)) + (seek! (-> gp-0 dialog-volume) (-> s5-1 dialog-volume) (* 100.0 (-> *display* seconds-per-frame))) + (sound-set-volume (sound-group dialog) (-> gp-0 dialog-volume)) ) (when (!= (-> gp-0 ambient-volume) (-> s5-1 ambient-volume)) - (set! (-> gp-0 ambient-volume) - (seek (-> gp-0 ambient-volume) (-> s5-1 ambient-volume) (* 100.0 (-> *display* seconds-per-frame))) - ) - (sound-set-volume (the-as uint 16) (-> gp-0 ambient-volume)) + (seek! (-> gp-0 ambient-volume) (-> s5-1 ambient-volume) (* 100.0 (-> *display* seconds-per-frame))) + (sound-set-volume (sound-group ambient) (-> gp-0 ambient-volume)) ) ) (when (!= (-> gp-0 language) (-> s5-1 language)) @@ -342,9 +334,7 @@ (set! (-> gp-0 bg-r) (-> s5-1 bg-r)) (set! (-> gp-0 bg-g) (-> s5-1 bg-g)) (set! (-> gp-0 bg-b) (-> s5-1 bg-b)) - (set! (-> gp-0 bg-a) - (seek (-> gp-0 bg-a) (-> s5-1 bg-a) (* (-> s5-1 bg-a-speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> gp-0 bg-a) (-> s5-1 bg-a) (* (-> s5-1 bg-a-speed) (-> *display* seconds-per-frame))) ) (let ((v1-60 (-> *display* frames (-> *display* on-screen) display)) (f0-39 (-> gp-0 bg-a)) diff --git a/test/decompiler/reference/engine/game/task/hint-control_REF.gc b/test/decompiler/reference/engine/game/task/hint-control_REF.gc index 627ee656cf..8bd16eef99 100644 --- a/test/decompiler/reference/engine/game/task/hint-control_REF.gc +++ b/test/decompiler/reference/engine/game/task/hint-control_REF.gc @@ -2,43 +2,34 @@ (in-package goal) ;; failed to figure out what this is: -(set! (-> *game-info* hint-control) (new - 'static - 'boxed-array - :type level-hint-control :length 25 :allocated-length 25 +(set! (-> *game-info* hint-control) (new 'static 'boxed-array :type level-hint-control (new 'static 'level-hint-control - :id - (game-text-id sage-voicebox-hint-crate-iron) + :id (game-text-id sage-voicebox-hint-crate-iron) :num-attempts-before-playing 1 :num-success-before-killing 3 ) (new 'static 'level-hint-control - :id - (game-text-id training-more-eco-more-time) + :id (game-text-id training-more-eco-more-time) :num-attempts-before-playing 3 :num-success-before-killing -1 ) (new 'static 'level-hint-control - :id - (game-text-id sidekick-speech-hint-crate-iron) + :id (game-text-id sidekick-speech-hint-crate-iron) :num-attempts-before-playing 3 :num-success-before-killing 3 ) (new 'static 'level-hint-control - :id - (game-text-id sidekick-speech-hint-crate-steel) + :id (game-text-id sidekick-speech-hint-crate-steel) :num-attempts-before-playing 1 :num-success-before-killing 1 ) (new 'static 'level-hint-control - :id - (game-text-id sidekick-hint-orb-cache-top) + :id (game-text-id sidekick-hint-orb-cache-top) :num-attempts-before-playing 1 :num-success-before-killing 1 ) (new 'static 'level-hint-control - :id - (game-text-id beach-grottopole-increment) + :id (game-text-id beach-grottopole-increment) :num-attempts-before-playing 1 :num-success-before-killing 1 ) @@ -50,21 +41,18 @@ ) (new 'static 'level-hint-control :delay-before-playing (seconds 5) - :id - (game-text-id jungle-mirrors-break-the-mirror-jak) + :id (game-text-id jungle-mirrors-break-the-mirror-jak) :num-attempts-before-playing 1 :num-success-before-killing -1 ) (new 'static 'level-hint-control :delay-before-playing (seconds 3) - :id - (game-text-id jungle-precursorbridge-hint) + :id (game-text-id jungle-precursorbridge-hint) :num-attempts-before-playing 1 :num-success-before-killing -1 ) (new 'static 'level-hint-control - :id - (game-text-id misty-teetertotter-bonk-dax-tutorial) + :id (game-text-id misty-teetertotter-bonk-dax-tutorial) :num-attempts-before-playing 3 :num-success-before-killing 1 ) @@ -93,33 +81,28 @@ :num-success-before-killing -1 ) (new 'static 'level-hint-control - :id - (game-text-id sunken-blue-eco-charger-all-hint) + :id (game-text-id sunken-blue-eco-charger-all-hint) :num-attempts-before-playing 3 :num-success-before-killing -1 ) (new 'static 'level-hint-control - :id - (game-text-id sunken-blue-eco-charger-hint) + :id (game-text-id sunken-blue-eco-charger-hint) :num-attempts-before-playing 3 :num-success-before-killing 2 ) (new 'static 'level-hint-control - :id - (game-text-id swamp-tethers-advice-hint) + :id (game-text-id swamp-tethers-advice-hint) :num-attempts-before-playing 1 :num-success-before-killing 1 ) (new 'static 'level-hint-control :delay-before-playing (seconds 30) - :id - (game-text-id sunken-double-lurker-hint) + :id (game-text-id sunken-double-lurker-hint) :num-attempts-before-playing 3 :num-success-before-killing 1 ) (new 'static 'level-hint-control - :id - (game-text-id sunken-take-it-easy-hot-pipes) + :id (game-text-id sunken-take-it-easy-hot-pipes) :num-attempts-before-playing 3 :num-success-before-killing -1 ) @@ -130,34 +113,29 @@ ) (new 'static 'level-hint-control :delay-before-playing (seconds 3) - :id - (game-text-id darkcave-light-crystal-hint) + :id (game-text-id darkcave-light-crystal-hint) :num-attempts-before-playing 1 :num-success-before-killing -1 ) (new 'static 'level-hint-control - :id - (game-text-id daxter-maybe-you-can-shoot-better-goggles) + :id (game-text-id daxter-maybe-you-can-shoot-better-goggles) :num-attempts-before-playing 4 :num-success-before-killing -1 ) (new 'static 'level-hint-control - :id - (game-text-id lavatube-shoot-the-spheres) + :id (game-text-id lavatube-shoot-the-spheres) :num-attempts-before-playing 1 :num-success-before-killing 2 ) (new 'static 'level-hint-control :delay-before-playing (seconds 5) - :id - (game-text-id citadel-break-generator-hint) + :id (game-text-id citadel-break-generator-hint) :num-attempts-before-playing 1 :num-success-before-killing 1 ) (new 'static 'level-hint-control :delay-before-playing (seconds 5) - :id - (game-text-id citadel-break-generators-reminder) + :id (game-text-id citadel-break-generators-reminder) :num-attempts-before-playing 1 :num-success-before-killing 1 ) @@ -166,16 +144,9 @@ ;; failed to figure out what this is: (set! (-> *game-info* task-hint-control) - (new - 'static - 'boxed-array - :type task-hint-control-group :length 16 :allocated-length 16 + (new 'static 'boxed-array :type task-hint-control-group (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 3 :allocated-length 3 + :tasks (new 'static 'boxed-array :type task-hint-control (new 'static 'task-hint-control :task (game-task training-gimmie) :delay (seconds 600)) (new 'static 'task-hint-control :task (game-task training-door) :delay (seconds 1200)) (new 'static 'task-hint-control :task (game-task training-climb) :delay (seconds 1800)) @@ -183,32 +154,20 @@ ) (new 'static 'task-hint-control-group) (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 3 :allocated-length 3 + :tasks (new 'static 'boxed-array :type task-hint-control (new 'static 'task-hint-control :task (game-task beach-gimmie) :delay (seconds 900)) (new 'static 'task-hint-control :task (game-task beach-sentinel) :delay (seconds 1800)) (new 'static 'task-hint-control :task (game-task beach-cannon) :delay (seconds 2700)) ) ) (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 2 :allocated-length 2 + :tasks (new 'static 'boxed-array :type task-hint-control (new 'static 'task-hint-control :task (game-task jungle-plant) :delay (seconds 1200)) (new 'static 'task-hint-control :task (game-task jungle-canyon-end) :delay (seconds 2400)) ) ) (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 4 :allocated-length 4 + :tasks (new 'static 'boxed-array :type task-hint-control (new 'static 'task-hint-control :task (game-task misty-boat) :delay (seconds 1200)) (new 'static 'task-hint-control :task (game-task misty-warehouse) :delay (seconds 1800)) (new 'static 'task-hint-control :task (game-task misty-bike-jump) :delay (seconds 2400)) @@ -218,58 +177,34 @@ (new 'static 'task-hint-control-group) (new 'static 'task-hint-control-group) (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 3 :allocated-length 3 + :tasks (new 'static 'boxed-array :type task-hint-control (new 'static 'task-hint-control :task (game-task sunken-spinning-room) :delay (seconds 1200)) (new 'static 'task-hint-control :task (game-task sunken-sharks) :delay (seconds 1800)) (new 'static 'task-hint-control :task (game-task sunken-slide) :delay (seconds 2400)) ) ) (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 1 :allocated-length 1 + :tasks (new 'static 'boxed-array :type task-hint-control (new 'static 'task-hint-control :task (game-task swamp-battle) :delay (seconds 2400)) ) ) (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 1 :allocated-length 1 + :tasks (new 'static 'boxed-array :type task-hint-control (new 'static 'task-hint-control :task (game-task rolling-lake) :delay (seconds 2400)) ) ) (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 1 :allocated-length 1 + :tasks (new 'static 'boxed-array :type task-hint-control (new 'static 'task-hint-control :task (game-task ogre-secret) :delay (seconds 3600)) ) ) (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 1 :allocated-length 1 + :tasks (new 'static 'boxed-array :type task-hint-control (new 'static 'task-hint-control :task (game-task village3-extra1) :delay (seconds 3600)) ) ) (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 4 :allocated-length 4 + :tasks (new 'static 'boxed-array :type task-hint-control (new 'static 'task-hint-control :task (game-task snow-bumpers) :delay (seconds 1200)) (new 'static 'task-hint-control :task (game-task snow-cage) :delay (seconds 1800)) (new 'static 'task-hint-control :task (game-task snow-ball) :delay (seconds 2400)) @@ -277,11 +212,7 @@ ) ) (new 'static 'task-hint-control-group - :tasks - (new - 'static - 'boxed-array - :type task-hint-control :length 4 :allocated-length 4 + :tasks (new 'static 'boxed-array :type task-hint-control (new 'static 'task-hint-control :task (game-task cave-dark-climb) :delay (seconds 1200)) (new 'static 'task-hint-control :task (game-task cave-robot-climb) :delay (seconds 1800)) (new 'static 'task-hint-control :task (game-task cave-swing-poles) :delay (seconds 2400)) @@ -329,9 +260,7 @@ (defun increment-success-for-hint ((arg0 game-text-id)) (let ((gp-0 (find-hint-control-index arg0))) (when (>= gp-0 0) - (set! (-> *game-info* hint-control gp-0 num-success) - (seekl (-> *game-info* hint-control gp-0 num-success) 127 1) - ) + (seekl! (-> *game-info* hint-control gp-0 num-success) 127 1) 0 ) ) @@ -398,7 +327,7 @@ ) (cond (v1-21 - (set! (-> gp-1 num-attempts) (seekl (-> gp-1 num-attempts) 127 1)) + (seekl! (-> gp-1 num-attempts) 127 1) (and (>= (-> gp-1 num-attempts) (-> gp-1 num-attempts-before-playing)) (or (= (-> gp-1 num-success-before-killing) -1) (< (-> gp-1 num-success) (-> gp-1 num-success-before-killing)) diff --git a/test/decompiler/reference/engine/game/task/process-taskable_REF.gc b/test/decompiler/reference/engine/game/task/process-taskable_REF.gc index b8fa020658..d21a0dff12 100644 --- a/test/decompiler/reference/engine/game/task/process-taskable_REF.gc +++ b/test/decompiler/reference/engine/game/task/process-taskable_REF.gc @@ -88,7 +88,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-0 (the-as (pointer dma-tag) a3-4) ) @@ -117,7 +117,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-1 (the-as (pointer dma-tag) a3-7) ) @@ -152,56 +152,54 @@ ;; definition for method 46 of type process-taskable ;; INFO: Return type mismatch int vs none. (defmethod dummy-46 process-taskable ((obj process-taskable)) - (with-pp - (when (nonzero? (-> obj sound-flava)) - (let ((s5-1 (vector-! - (new 'stack-no-clear 'vector) - (target-pos 0) - (the-as vector (-> obj root-override root-prim prim-core)) - ) + (when (nonzero? (-> obj sound-flava)) + (let ((s5-1 (vector-! + (new 'stack-no-clear 'vector) + (target-pos 0) + (the-as vector (-> obj root-override root-prim prim-core)) ) - ) - (set! (-> s5-1 y) (* 4.0 (-> s5-1 y))) - (cond - ((< (vector-length s5-1) 102400.0) - (when (not (-> obj have-flava)) - (set! (-> obj have-flava) #t) - (set-setting! *setting-control* pp 'sound-flava #f 20.0 (the-as int (-> obj sound-flava))) - ) - ) - ((-> obj have-flava) - (clear-pending-settings-from-process *setting-control* pp 'sound-flava) - (set! (-> obj have-flava) #f) - ) + ) ) + (set! (-> s5-1 y) (* 4.0 (-> s5-1 y))) + (cond + ((< (vector-length s5-1) 102400.0) + (when (not (-> obj have-flava)) + (set! (-> obj have-flava) #t) + (set-setting! 'sound-flava #f 20.0 (-> obj sound-flava)) + ) + ) + ((-> obj have-flava) + (remove-setting! 'sound-flava) + (set! (-> obj have-flava) #f) + ) ) ) - (when (-> obj music) - (let ((s5-3 (vector-! - (new 'stack-no-clear 'vector) - (target-pos 0) - (the-as vector (-> obj root-override root-prim prim-core)) - ) - ) - ) - (set! (-> s5-3 y) (* 4.0 (-> s5-3 y))) - (cond - ((< (vector-length s5-3) 102400.0) - (when (not (-> obj have-music)) - (set! (-> obj have-music) #t) - (set-setting! *setting-control* pp 'music (-> obj music) 0.0 0) - ) - ) - ((-> obj have-music) - (clear-pending-settings-from-process *setting-control* pp 'music) - (set! (-> obj have-music) #f) - ) - ) - ) - ) - 0 - (none) ) + (when (-> obj music) + (let ((s5-3 (vector-! + (new 'stack-no-clear 'vector) + (target-pos 0) + (the-as vector (-> obj root-override root-prim prim-core)) + ) + ) + ) + (set! (-> s5-3 y) (* 4.0 (-> s5-3 y))) + (cond + ((< (vector-length s5-3) 102400.0) + (when (not (-> obj have-music)) + (set! (-> obj have-music) #t) + (set-setting! 'music (-> obj music) 0.0 0) + ) + ) + ((-> obj have-music) + (remove-setting! 'music) + (set! (-> obj have-music) #f) + ) + ) + ) + ) + 0 + (none) ) ;; definition for method 31 of type process-taskable @@ -293,22 +291,13 @@ ;; definition for function process-taskable-anim-loop (defbehavior process-taskable-anim-loop process-taskable () - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) - ) + (when (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (get-art-elem self)) ) - (while #t + (loop (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (if (= (-> self next-state name) 'idle) (TODO-RENAME-43 self) ) @@ -320,8 +309,7 @@ ;; failed to figure out what this is: (defstate release (process-taskable) :virtual #t - :trans - (behavior () + :trans (behavior () (when (process-release? *target*) (send-event *target* 'trans 'restore (-> self old-target-pos)) (if (should-display? self) @@ -333,17 +321,14 @@ ((-> self cur-trans-hook)) (none) ) - :code - process-taskable-anim-loop - :post - (the-as (function none :behavior process-taskable) ja-post) + :code process-taskable-anim-loop + :post (the-as (function none :behavior process-taskable) ja-post) ) ;; failed to figure out what this is: (defstate give-cell (process-taskable) :virtual #t - :trans - (behavior () + :trans (behavior () (cond ((nonzero? (-> self cell-for-task)) (let ((gp-0 (handle->process (-> self cell-x)))) @@ -370,22 +355,18 @@ ((-> self cur-trans-hook)) (none) ) - :code - process-taskable-anim-loop - :post - (the-as (function none :behavior process-taskable) ja-post) + :code process-taskable-anim-loop + :post (the-as (function none :behavior process-taskable) ja-post) ) ;; failed to figure out what this is: (defstate lose (process-taskable) :virtual #t - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 5)) (or (not *target*) (< 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) @@ -396,37 +377,24 @@ ((-> self cur-trans-hook)) (none) ) - :code - process-taskable-anim-loop - :post - (the-as (function none :behavior process-taskable) ja-post) + :code process-taskable-anim-loop + :post (the-as (function none :behavior process-taskable) ja-post) ) ;; failed to figure out what this is: (defstate enter-playing (process-taskable) :virtual #t - :code - process-taskable-anim-loop - :post - (the-as (function none :behavior process-taskable) ja-post) + :code process-taskable-anim-loop + :post (the-as (function none :behavior process-taskable) ja-post) ) ;; definition for function process-taskable-play-anim-enter (defbehavior process-taskable-play-anim-enter process-taskable () (init! (-> self query) (the-as string #f) 40 150 25 #t (the-as string #f)) (logior! (-> self skel status) (janim-status blerc)) - (let ((gp-0 (get-process *default-dead-pool* othercam #x4000))) - (set! (-> self camera) - (ppointer->handle (when gp-0 - (let ((t9-2 (method-of-type othercam activate))) - (t9-2 (the-as othercam gp-0) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 othercam-init-by-other self (-> self cam-joint-index) #f #t) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self camera) + (ppointer->handle (process-spawn othercam self (-> self cam-joint-index) #f #t :to self)) + ) (set! (-> self cell-for-task) (game-task none)) (set! (-> self skippable) #f) (set! (-> self blend-on-exit) #f) @@ -452,7 +420,7 @@ (if (nonzero? *camera-look-through-other*) (set! *camera-look-through-other* 2) ) - (set-letterbox-frames (seconds 0.016666668)) + (set-letterbox-frames (seconds 0.017)) (draw-npc-shadow self) (none) ) @@ -460,37 +428,23 @@ ;; definition for function process-taskable-play-anim-code (defbehavior process-taskable-play-anim-code process-taskable ((arg0 art-joint-anim) (arg1 basic)) (when (nonzero? (-> self cell-for-task)) - (cond - ((name= (-> self state name) "play-anim") - (let ((s4-0 (get-process *default-dead-pool* fuel-cell #x4000))) - (set! (-> self cell-x) - (ppointer->handle - (when s4-0 - (let ((t9-2 (method-of-type fuel-cell activate))) - (t9-2 (the-as fuel-cell s4-0) self 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 fuel-cell-init-as-clone (process->handle self) (-> self cell-for-task)) - (-> s4-0 ppointer) - ) - ) - ) - ) - ) - (else + (if (name= (-> self state name) "play-anim") + (set! (-> self cell-x) (ppointer->handle (process-spawn + fuel-cell + :init fuel-cell-init-as-clone + (process->handle self) + (-> self cell-for-task) + :to self + ) + ) + ) (format #t "ERROR: ~S ~S trying to give cell on release~%" (-> self name) (-> self state name)) ) - ) ) (cond ((and arg1 (type-type? (-> arg1 type) spool-anim)) (when *target* - (while (let ((a1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-9 from) self) - (set! (-> a1-9 num-params) 1) - (set! (-> a1-9 message) 'clone-anim) - (set! (-> a1-9 param 0) (the-as uint self)) - (not (send-event-function *target* a1-9)) - ) + (while (not (send-event *target* 'clone-anim self)) (spool-push *art-control* (-> (the-as spool-anim arg1) name) 0 self -99.0) (format #t "WARNING: ~A stall on not cloning.~%" (-> self name)) (suspend) @@ -498,16 +452,9 @@ (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) (send-event *target* 'blend-shape #t) ) - (push-setting! *setting-control* self 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) - (push-setting! *setting-control* self 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) - (push-setting! - *setting-control* - self - 'ambient-volume - 'rel - (-> *setting-control* current ambient-volume-movie) - 0 - ) + (add-setting! 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) + (add-setting! 'ambient-volume 'rel (-> *setting-control* current ambient-volume-movie) 0) (if (-> self blend-on-exit) (set! (-> self blend-on-exit) arg0) ) @@ -525,18 +472,15 @@ (the-as (function process-drawable symbol) false-func) ) ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) - (clear-pending-settings-from-process *setting-control* self 'ambient-volume) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) (send-event *target* 'blend-shape #f) ) (else (when (not arg1) (format #t "ERROR: ~S ~S got #f from anim picker~%" (-> self name) (-> self state name)) - (set! arg1 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) + (set! arg1 (ja-group)) ) (when (not (type-type? (-> arg1 type) art-joint-anim)) (format @@ -545,58 +489,23 @@ (-> self name) (-> self state name) ) - (set! arg1 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) + (set! arg1 (ja-group)) ) (format #t "~S ~S anim ~S~%" (-> self name) (-> self state name) (-> (the-as art-joint-anim arg1) name)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim arg1)) (when (< (ja-num-frames 0) 3) (suspend) (suspend) 0 ) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-30 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-30 param 1) 1.0) - (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! - a0-30 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (when (and *debug-segment* (= (get-response (-> self query)) 'no)) - (let ((v1-106 (-> self skel root-channel 0))) - (set! (-> v1-106 num-func) num-func-identity) - (set! (-> v1-106 frame-num) (the float (+ (-> v1-106 frame-group data 0 length) -1))) + (if (and *debug-segment* (= (get-response (-> self query)) 'no)) + (ja :num-func num-func-identity :frame-num max) ) - ) (suspend) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 param 0) (the float (+ (-> a0-38 frame-group data 0 length) -1))) - (set! (-> a0-38 param 1) 1.0) - (joint-control-channel-group-eval! a0-38 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) @@ -606,18 +515,14 @@ ;; failed to figure out what this is: (defstate play-accept (process-taskable) :virtual #t - :enter - (the-as (function none :behavior process-taskable) process-taskable-play-anim-enter) - :exit - process-taskable-play-anim-exit - :trans - (behavior () + :enter (the-as (function none :behavior process-taskable) process-taskable-play-anim-enter) + :exit process-taskable-play-anim-exit + :trans (behavior () (process-taskable-play-anim-trans) ((-> self cur-trans-hook)) (none) ) - :code - (behavior () + :code (behavior () (process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (get-accept-anim self #t)) (while (not (process-release? *target*)) (suspend) @@ -625,38 +530,31 @@ (go-virtual enter-playing) (none) ) - :post - (the-as (function none :behavior process-taskable) ja-post) + :post (the-as (function none :behavior process-taskable) ja-post) ) ;; failed to figure out what this is: (defstate play-reject (process-taskable) :virtual #t - :enter - (the-as (function none :behavior process-taskable) process-taskable-play-anim-enter) - :exit - process-taskable-play-anim-exit - :trans - (behavior () + :enter (the-as (function none :behavior process-taskable) process-taskable-play-anim-enter) + :exit process-taskable-play-anim-exit + :trans (behavior () (process-taskable-play-anim-trans) ((-> self cur-trans-hook)) (none) ) - :code - (behavior () + :code (behavior () (process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (get-reject-anim self #t)) (go-virtual release) (none) ) - :post - (the-as (function none :behavior process-taskable) ja-post) + :post (the-as (function none :behavior process-taskable) ja-post) ) ;; failed to figure out what this is: (defstate query (process-taskable) :virtual #t - :enter - (behavior () + :enter (behavior () (init! (-> self query) (lookup-text! *common-text* (game-text-id confirm-play) #f) @@ -668,10 +566,8 @@ ) (none) ) - :exit - process-taskable-play-anim-exit - :trans - (behavior () + :exit process-taskable-play-anim-exit + :trans (behavior () (case (current-status (-> self tasks)) (((task-status need-reminder-a)) (case (get-response (-> self query)) @@ -702,17 +598,14 @@ ((-> self cur-trans-hook)) (none) ) - :code - process-taskable-anim-loop - :post - (the-as (function none :behavior process-taskable) ja-post) + :code process-taskable-anim-loop + :post (the-as (function none :behavior process-taskable) ja-post) ) ;; failed to figure out what this is: (defstate play-anim (process-taskable) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('shadow) (cond @@ -740,12 +633,9 @@ ) ) ) - :enter - (the-as (function none :behavior process-taskable) process-taskable-play-anim-enter) - :exit - process-taskable-play-anim-exit - :trans - (behavior () + :enter (the-as (function none :behavior process-taskable) process-taskable-play-anim-enter) + :exit process-taskable-play-anim-exit + :trans (behavior () (process-taskable-play-anim-trans) (let ((a3-0 (handle->process (-> self cell-x)))) (if a3-0 @@ -755,22 +645,20 @@ ((-> self cur-trans-hook)) (none) ) - :code - (behavior () + :code (behavior () (process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (play-anim! self #t)) (dummy-38 self) (none) ) - :post - (the-as (function none :behavior process-taskable) ja-post) + :post (the-as (function none :behavior process-taskable) ja-post) ) ;; definition for function process-taskable-clean-up-after-talking (defbehavior process-taskable-clean-up-after-talking process-taskable () (logclear! (-> self draw status) (draw-status hidden)) (logclear! (-> self skel status) (janim-status inited)) - (clear-pending-settings-from-process *setting-control* self 'border-mode) - (clear-pending-settings-from-process *setting-control* self 'talking) + (remove-setting! 'border-mode) + (remove-setting! 'talking) (none) ) @@ -803,7 +691,7 @@ (defbehavior process-taskable-hide-enter process-taskable () (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((v1-3 (-> self draw shadow-ctrl))) - (logior! (-> v1-3 settings flags) 32) + (logior! (-> v1-3 settings flags) (shadow-flags disable-draw)) ) 0 (process-taskable-clean-up-after-talking) @@ -821,13 +709,11 @@ ) (else (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) - ) + (ja :group! (get-art-elem self)) (restore-collide-with-as (-> self root-override)) (process-entity-status! self (entity-perm-status bit-3) #t) (let ((v1-7 (-> self draw shadow-ctrl))) - (set! (-> v1-7 settings flags) (logand -33 (-> v1-7 settings flags))) + (logclear! (-> v1-7 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -838,20 +724,16 @@ ;; failed to figure out what this is: (defstate hidden (process-taskable) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior process-taskable) process-taskable-hide-handler ) - :enter - (the-as (function none :behavior process-taskable) process-taskable-hide-enter) - :exit - (behavior () + :enter (the-as (function none :behavior process-taskable) process-taskable-hide-enter) + :exit (behavior () (process-taskable-hide-exit (= (-> self next-state name) 'hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (process-entity-status! self (entity-perm-status bit-3) #f) ) @@ -860,8 +742,7 @@ ) (none) ) - :code - (the-as (function none :behavior process-taskable) anim-loop) + :code (the-as (function none :behavior process-taskable) anim-loop) ) ;; definition for method 50 of type process-taskable @@ -880,20 +761,16 @@ ;; failed to figure out what this is: (defstate hidden-other (process-taskable) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior process-taskable) process-taskable-hide-handler ) - :enter - (the-as (function none :behavior process-taskable) process-taskable-hide-enter) - :exit - (behavior () + :enter (the-as (function none :behavior process-taskable) process-taskable-hide-enter) + :exit (behavior () (process-taskable-hide-exit (= (-> self next-state name) 'hidden-other)) (none) ) - :trans - (behavior () + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (process-entity-status! self (entity-perm-status bit-3) #f) ) @@ -910,15 +787,13 @@ ) (none) ) - :code - (the-as (function none :behavior process-taskable) anim-loop) + :code (the-as (function none :behavior process-taskable) anim-loop) ) ;; failed to figure out what this is: (defstate be-clone (process-taskable) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as shadow-geo (cond ((= v1-0 'shadow) @@ -957,15 +832,13 @@ ) ) ) - :enter - (behavior ((arg0 handle)) + :enter (behavior ((arg0 handle)) (logior! (-> self skel status) (janim-status blerc)) (logclear! (-> self mask) (process-mask actor-pause)) (set-vector! (-> self draw bounds) 0.0 (-> self draw-bounds-y-offset) 0.0 (-> self draw bounds w)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self skel status) (janim-status blerc spool)) (logior! (-> self mask) (process-mask actor-pause)) (let ((v1-6 (-> self entity extra trans))) @@ -976,14 +849,12 @@ (ja-channel-set! 0) (none) ) - :trans - (behavior () + :trans (behavior () (draw-npc-shadow self) ((-> self cur-trans-hook)) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (clone-anim arg0 (-> self center-joint-index) #t "") (format #t "ERROR: handle invalid while ~S is cloning~%" (-> self name)) (go-virtual hidden) @@ -999,63 +870,56 @@ ;; failed to figure out what this is: (defstate idle (process-taskable) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'attack) - (the-as symbol (when (-> self bounce-away) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'shove) - (set! (-> a1-3 param 0) (the-as uint #f)) - (let ((v1-4 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-4 shove-back) 12288.0) - (set! (-> v1-4 shove-up) 4096.0) - (set! (-> a1-3 param 1) (the-as uint v1-4)) - ) - (the-as symbol (send-event-function arg0 a1-3)) - ) - ) - ) - ) - ((= v1-0 'touch) - (the-as symbol (send-shove-back - (-> self root-override) - arg0 - (the-as touching-shapes-entry (-> arg3 param 0)) - 0.7 - 6144.0 - 16384.0 - ) - ) - ) - ((= v1-0 'clone) - (the-as symbol (go-virtual be-clone (the-as handle (-> arg3 param 0)))) - ) - ((= v1-0 'play-anim) - (logclear! (-> self mask) (process-mask actor-pause)) - (let ((v0-0 #t)) - (set! (-> self been-kicked) v0-0) - v0-0 - ) - ) - ((= v1-0 'hidden-other) - (the-as symbol (go-virtual hidden-other)) - ) - ) - ) + (the-as + object + (cond + ((= v1-0 'attack) + (the-as + symbol + (if (-> self bounce-away) + (the-as + symbol + (send-event arg0 'shove #f (static-attack-info ((shove-back (meters 3)) (shove-up (meters 1))))) + ) + ) + ) + ) + ((= v1-0 'touch) + (the-as symbol (send-shove-back + (-> self root-override) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + 0.7 + 6144.0 + 16384.0 + ) + ) + ) + ((= v1-0 'clone) + (the-as symbol (go-virtual be-clone (the-as handle (-> arg3 param 0)))) + ) + ((= v1-0 'play-anim) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((v0-0 #t)) + (set! (-> self been-kicked) v0-0) + v0-0 + ) + ) + ((= v1-0 'hidden-other) + (the-as symbol (go-virtual hidden-other)) + ) + ) + ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (process-taskable-clean-up-after-talking) (none) ) - :exit - (behavior () + :exit (behavior () (cond ((or (= (-> self next-state name) 'dead-state) (= (-> self next-state name) 'idle)) (process-entity-status! self (entity-perm-status bit-3) #f) @@ -1065,15 +929,14 @@ (logior! (-> self skel status) (janim-status inited)) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) - (set-setting! *setting-control* self 'border-mode #f 0.0 0) - (set-setting! *setting-control* self 'talking (the-as symbol (process->ppointer self)) 0.0 0) - (copy-settings-from-target! *setting-control*) + (set-setting! 'border-mode #f 0.0 0) + (set-setting! 'talking (process->ppointer self) 0.0 0) + (apply-settings *setting-control*) ) ) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) @@ -1088,11 +951,10 @@ ) ((begin (dummy-46 self) - (and (not - (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) + (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + ) + ) (< (-> (target-pos 0) y) (+ 8192.0 (-> self root-override root-prim prim-core world-sphere y))) (< (vector-vector-distance (target-pos 0) (the-as vector (-> self root-override root-prim prim-core))) 32768.0 @@ -1162,10 +1024,8 @@ ((-> self cur-trans-hook)) (none) ) - :code - process-taskable-anim-loop - :post - (behavior () + :code process-taskable-anim-loop + :post (behavior () (when *target* (when (!= (-> self neck-joint-index) -1) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -1317,8 +1177,7 @@ ;; failed to figure out what this is: (defstate othercam-running (othercam) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('die) @@ -1356,22 +1215,21 @@ ) (('mask) (set! v0-0 (-> arg3 param 0)) - (set! (-> self mask-to-clear) (the-as uint v0-0)) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) v0-0 ) ) ) - :enter - (behavior () + :enter (behavior () (hide-hud-quick) (case (-> self spooling?) (('logo) ) (else - (push-setting! *setting-control* self 'process-mask 'set 0.0 (-> self mask-to-clear)) - (push-setting! *setting-control* self 'movie (process->ppointer self) 0.0 0) + (add-setting! 'process-mask 'set 0.0 (-> self mask-to-clear)) + (add-setting! 'movie (process->ppointer self) 0.0 0) (if (not (-> self border-value)) - (push-setting! *setting-control* self 'border-mode (-> self border-value) 0.0 0) + (add-setting! 'border-mode (-> self border-value) 0.0 0) ) ) ) @@ -1385,18 +1243,16 @@ (vector-normalize-copy! (-> self old-mat-z) (-> v1-19 vector 2) -1.0) ) ) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (none) ) - :exit - (behavior () - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (copy-settings-from-target! *setting-control*) + :exit (behavior () + (remove-setting! 'process-mask) + (apply-settings *setting-control*) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((s2-0 (-> self hand process 0))) (when (not s2-0) (format #t "ERROR: othercam parent invalid~%") @@ -1478,7 +1334,7 @@ (set! (-> self border-value) #f) (set! (-> self die?) #f) (set! (-> self survive-anim-end?) arg2) - (set! (-> self mask-to-clear) (the-as uint #x4a0800)) + (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) (set! (-> self event-hook) (-> othercam-running event)) (go othercam-running) 0 @@ -1498,7 +1354,7 @@ ) (else (let ((v1-10 gp-0)) - (logior! (-> v1-10 settings flags) 32) + (logior! (-> v1-10 settings flags) (shadow-flags disable-draw)) ) 0 ) diff --git a/test/decompiler/reference/engine/game/task/task-control_REF.gc b/test/decompiler/reference/engine/game/task/task-control_REF.gc index 9c9221b76f..8a72bd9001 100644 --- a/test/decompiler/reference/engine/game/task/task-control_REF.gc +++ b/test/decompiler/reference/engine/game/task/task-control_REF.gc @@ -102,12 +102,9 @@ ) ;; definition for symbol *null-task-control*, type task-control -(define *null-task-control* (new 'static 'task-control - :current-stage -1 - :stage - (new 'static 'boxed-array :type task-cstage :length 0 :allocated-length 0) - ) - ) +(define *null-task-control* + (new 'static 'task-control :current-stage -1 :stage (new 'static 'boxed-array :type task-cstage)) + ) ;; definition for method 9 of type task-control ;; INFO: Return type mismatch int vs game-task. @@ -284,49 +281,33 @@ ) ;; definition for symbol *assistant-tasks*, type task-control -(define - *assistant-tasks* +(define *assistant-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 12 :allocated-length 12 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-eggtop) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-eggtop) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) (or (closed? arg0 (game-task jungle-eggtop) (task-status need-reminder)) (and (closed? arg0 (game-task jungle-eggtop) (task-status need-introduction)) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'pickup)) - (set! (-> a1-2 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-2)) (+ (get-reminder arg0 1) 3)) - ) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) + ) ) ) ) @@ -334,21 +315,14 @@ (new 'static 'task-cstage :game-task (game-task misty-bike) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) (or (closed? arg0 (game-task jungle-eggtop) (task-status need-reminder)) (and (closed? arg0 (game-task jungle-eggtop) (task-status need-introduction)) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'pickup)) - (set! (-> a1-2 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-2)) (+ (get-reminder arg0 1) 3)) - ) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) + ) ) ) ) @@ -357,34 +331,29 @@ :game-task (game-task jungle-eggtop) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike) :status (task-status need-reminder-a) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :status (task-status unknown) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (task-closed? (game-task village4-button) (task-status need-reward-speech)) ) @@ -392,242 +361,166 @@ (new 'static 'task-cstage :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-eggtop) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) ;; definition for symbol *assistant-village2-tasks*, type task-control -(define - *assistant-village2-tasks* +(define *assistant-village2-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 22 :allocated-length 22 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village2-levitator) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-levitator) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-levitator) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-levitator) :status (task-status need-reminder-a) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-levitator) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-0)) 45) - ) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 45) ) ) (new 'static 'task-cstage :game-task (game-task sunken-room) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-room) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-flutflut) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (and (task-closed? (game-task beach-flutflut) (task-status need-reminder)) - (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) - (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) pp) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'query) - (set! (-> a1-4 param 0) (the-as uint 'pickup)) - (set! (-> a1-4 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (and (task-closed? (game-task beach-flutflut) (task-status need-reminder)) + (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) + (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) - ) + ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task swamp-flutflut) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (and (task-closed? (game-task beach-flutflut) (task-status need-reminder)) - (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) - (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) pp) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'query) - (set! (-> a1-4 param 0) (the-as uint 'pickup)) - (set! (-> a1-4 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (and (task-closed? (game-task beach-flutflut) (task-status need-reminder)) + (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) + (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) - ) + ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task rolling-robbers) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (if (task-closed? (game-task beach-flutflut) (task-status need-reminder)) - (or (closed? arg0 (game-task swamp-flutflut) (task-status need-reminder)) - (and (closed? arg0 (game-task swamp-flutflut) (task-status need-introduction)) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) pp) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'query) - (set! (-> a1-4 param 0) (the-as uint 'pickup)) - (set! (-> a1-4 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (if (task-closed? (game-task beach-flutflut) (task-status need-reminder)) + (or (closed? arg0 (game-task swamp-flutflut) (task-status need-reminder)) + (and (closed? arg0 (game-task swamp-flutflut) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) - (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) pp) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'query) - (set! (-> a1-8 param 0) (the-as uint 'pickup)) - (set! (-> a1-8 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-8)) (+ (get-reminder arg0 1) 3)) + ) + ) + (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) + (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) - ) + ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task rolling-robbers) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (if (task-closed? (game-task beach-flutflut) (task-status need-reminder)) - (or (closed? arg0 (game-task swamp-flutflut) (task-status need-reminder)) - (and (closed? arg0 (game-task swamp-flutflut) (task-status need-introduction)) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) pp) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'query) - (set! (-> a1-4 param 0) (the-as uint 'pickup)) - (set! (-> a1-4 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (if (task-closed? (game-task beach-flutflut) (task-status need-reminder)) + (or (closed? arg0 (game-task swamp-flutflut) (task-status need-reminder)) + (and (closed? arg0 (game-task swamp-flutflut) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) - (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) pp) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'query) - (set! (-> a1-8 param 0) (the-as uint 'pickup)) - (set! (-> a1-8 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-8)) (+ (get-reminder arg0 1) 3)) + ) + ) + (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) + (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) - ) + ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task sunken-room) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-room) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-flutflut) :status (task-status unknown) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (task-closed? (game-task beach-flutflut) (task-status need-reminder)) ) @@ -636,8 +529,7 @@ :game-task (game-task swamp-flutflut) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (task-closed? (game-task beach-flutflut) (task-status need-reminder)) ) @@ -645,101 +537,80 @@ (new 'static 'task-cstage :game-task (game-task rolling-robbers) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-robbers) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-room) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-robbers) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-flutflut) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-levitator) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) ;; definition for symbol *gambler-tasks*, type task-control -(define - *gambler-tasks* +(define *gambler-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 10 :allocated-length 10 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task rolling-race) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-race) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-gambler-money) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-gambler-money) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-race) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-race) (task-status need-reward-speech)) ) ) @@ -747,8 +618,7 @@ :game-task (game-task village2-gambler-money) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task village2-gambler-money) (task-status need-reward-speech)) ) ) @@ -756,8 +626,7 @@ :game-task (game-task rolling-race) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-race) (task-status need-reminder)) ) ) @@ -765,22 +634,12 @@ :game-task (game-task village2-gambler-money) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -789,16 +648,14 @@ :game-task (game-task rolling-race) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-race) (task-status need-introduction)) ) ) (new 'static 'task-cstage :game-task (game-task village2-gambler-money) :status (task-status need-reminder) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-race) (task-status need-introduction)) ) ) @@ -807,53 +664,39 @@ ) ;; definition for symbol *geologist-tasks*, type task-control -(define - *geologist-tasks* +(define *geologist-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 10 :allocated-length 10 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task rolling-moles) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-moles) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-geologist-money) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-geologist-money) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-moles) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-moles) (task-status need-reward-speech)) ) ) @@ -861,8 +704,7 @@ :game-task (game-task village2-geologist-money) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task village2-geologist-money) (task-status need-reward-speech)) ) ) @@ -870,8 +712,7 @@ :game-task (game-task rolling-moles) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-moles) (task-status need-reminder)) ) ) @@ -879,22 +720,12 @@ :game-task (game-task village2-geologist-money) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -903,16 +734,14 @@ :game-task (game-task rolling-moles) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-moles) (task-status need-introduction)) ) ) (new 'static 'task-cstage :game-task (game-task village2-geologist-money) :status (task-status need-reminder) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task rolling-moles) (task-status need-introduction)) ) ) @@ -921,53 +750,39 @@ ) ;; definition for symbol *mayor-tasks*, type task-control -(define - *mayor-tasks* +(define *mayor-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 11 :allocated-length 11 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-lurkerm) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-lurkerm) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-mayor-money) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-mayor-money) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-lurkerm) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task jungle-lurkerm) (task-status need-reward-speech)) ) ) @@ -975,8 +790,7 @@ :game-task (game-task village1-mayor-money) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task village1-mayor-money) (task-status need-reward-speech)) ) ) @@ -984,8 +798,7 @@ :game-task (game-task jungle-lurkerm) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task jungle-lurkerm) (task-status need-reminder)) ) ) @@ -993,22 +806,12 @@ :game-task (game-task village1-mayor-money) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -1017,8 +820,7 @@ :game-task (game-task jungle-lurkerm) :status (task-status need-reminder-a) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task jungle-lurkerm) (task-status need-introduction)) ) ) @@ -1026,16 +828,14 @@ :game-task (game-task jungle-lurkerm) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task jungle-lurkerm) (task-status need-introduction)) ) ) (new 'static 'task-cstage :game-task (game-task village1-mayor-money) :status (task-status need-reminder) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) + :condition (lambda ((arg0 task-control) (arg1 task-control)) (closed? arg0 (game-task jungle-lurkerm) (task-status need-introduction)) ) ) @@ -1044,123 +844,89 @@ ) ;; definition for symbol *sage-tasks*, type task-control -(define - *sage-tasks* +(define *sage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 14 :allocated-length 14 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task intro) :status (task-status need-introduction) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task intro) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task intro) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-ecorocks) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-ecorocks) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-cannon) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task beach-ecorocks) (task-status need-reminder)) - (and (closed? arg0 (game-task beach-ecorocks) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task beach-ecorocks) (task-status need-reminder)) + (and (closed? arg0 (game-task beach-ecorocks) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task misty-cannon) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task beach-ecorocks) (task-status need-reminder)) - (and (closed? arg0 (game-task beach-ecorocks) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task beach-ecorocks) (task-status need-reminder)) + (and (closed? arg0 (game-task beach-ecorocks) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task beach-ecorocks) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-cannon) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-cannon) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :status (task-status unknown) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (task-closed? (game-task village4-button) (task-status need-reward-speech)) ) @@ -1168,204 +934,145 @@ (new 'static 'task-cstage :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-ecorocks) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-cannon) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) ;; definition for symbol *sage-bluehut-tasks*, type task-control -(define - *sage-bluehut-tasks* +(define *sage-bluehut-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 10 :allocated-length 10 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task rolling-plants) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-plants) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-arm) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task rolling-plants) (task-status need-reminder)) - (and (closed? arg0 (game-task rolling-plants) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task rolling-plants) (task-status need-reminder)) + (and (closed? arg0 (game-task rolling-plants) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task swamp-arm) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task rolling-plants) (task-status need-reminder)) - (and (closed? arg0 (game-task rolling-plants) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task rolling-plants) (task-status need-reminder)) + (and (closed? arg0 (game-task rolling-plants) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task rolling-plants) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-arm) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-arm) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-plants) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-arm) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) ;; definition for symbol *oracle-village1-tasks*, type task-control -(define - *oracle-village1-tasks* +(define *oracle-village1-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 10 :allocated-length 10 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village1-oracle-money1) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-oracle-money1) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-oracle-money2) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-oracle-money2) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-oracle-money1) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-oracle-inc)) ) ) ) @@ -1373,36 +1080,24 @@ (new 'static 'task-cstage :game-task (game-task village1-oracle-money1) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-oracle-money1) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-oracle-money2) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-oracle-inc)) ) ) ) @@ -1410,82 +1105,57 @@ (new 'static 'task-cstage :game-task (game-task village1-oracle-money2) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-oracle-money2) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) ;; definition for symbol *oracle-village2-tasks*, type task-control -(define - *oracle-village2-tasks* +(define *oracle-village2-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 10 :allocated-length 10 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village2-oracle-money1) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-oracle-money1) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-oracle-money2) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-oracle-money2) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-oracle-money1) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-oracle-inc)) ) ) ) @@ -1493,36 +1163,24 @@ (new 'static 'task-cstage :game-task (game-task village2-oracle-money1) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-oracle-money1) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-oracle-money2) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-oracle-inc)) ) ) ) @@ -1530,82 +1188,57 @@ (new 'static 'task-cstage :game-task (game-task village2-oracle-money2) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-oracle-money2) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) ;; definition for symbol *oracle-village3-tasks*, type task-control -(define - *oracle-village3-tasks* +(define *oracle-village3-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 10 :allocated-length 10 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village3-oracle-money1) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-oracle-money1) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-oracle-money2) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-oracle-money2) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-oracle-money1) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-oracle-inc)) ) ) ) @@ -1613,36 +1246,24 @@ (new 'static 'task-cstage :game-task (game-task village3-oracle-money1) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-oracle-money1) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-oracle-money2) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-oracle-inc)) ) ) ) @@ -1650,114 +1271,81 @@ (new 'static 'task-cstage :game-task (game-task village3-oracle-money2) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-oracle-money2) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) ;; definition for symbol *miners-tasks*, type task-control -(define - *miners-tasks* +(define *miners-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 35 :allocated-length 35 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village3-miner-money1) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money1) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money2) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money2) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money3) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money3) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money4) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money4) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money1) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -1766,22 +1354,12 @@ :game-task (game-task village3-miner-money2) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -1790,22 +1368,12 @@ :game-task (game-task village3-miner-money3) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -1814,22 +1382,12 @@ :game-task (game-task village3-miner-money4) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -1837,363 +1395,269 @@ (new 'static 'task-cstage :game-task (game-task cave-gnawers) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task village3-miner-money4) (task-status need-reminder)) - (and (closed? arg0 (game-task village3-miner-money4) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task village3-miner-money4) (task-status need-reminder)) + (and (closed? arg0 (game-task village3-miner-money4) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task cave-gnawers) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task village3-miner-money4) (task-status need-reminder)) - (and (closed? arg0 (game-task village3-miner-money4) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task village3-miner-money4) (task-status need-reminder)) + (and (closed? arg0 (game-task village3-miner-money4) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task snow-eggtop) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task cave-gnawers) (task-status need-reminder)) - (and (closed? arg0 (game-task cave-gnawers) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task cave-gnawers) (task-status need-reminder)) + (and (closed? arg0 (game-task cave-gnawers) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task snow-eggtop) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task cave-gnawers) (task-status need-reminder)) - (and (closed? arg0 (game-task cave-gnawers) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task cave-gnawers) (task-status need-reminder)) + (and (closed? arg0 (game-task cave-gnawers) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money1) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money1) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money2) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money2) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money3) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money3) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money4) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money4) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-gnawers) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-gnawers) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-eggtop) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-eggtop) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money1) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money2) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money3) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-miner-money4) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-gnawers) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-eggtop) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) ;; definition for symbol *sage-villagec-tasks*, type task-control -(define - *sage-villagec-tasks* +(define *sage-villagec-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 14 :allocated-length 14 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village3-button) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-button) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-button) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-dark-crystals) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-dark-crystals) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ram) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task cave-dark-crystals) (task-status need-reminder)) - (and (closed? arg0 (game-task cave-dark-crystals) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task cave-dark-crystals) (task-status need-reminder)) + (and (closed? arg0 (game-task cave-dark-crystals) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task snow-ram) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda ((arg0 task-control) (arg1 task-control)) - (with-pp - (or (closed? arg0 (game-task cave-dark-crystals) (task-status need-reminder)) - (and (closed? arg0 (game-task cave-dark-crystals) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + :flags (task-flags has-entity closed-by-default) + :condition (lambda ((arg0 task-control) (arg1 task-control)) + (or (closed? arg0 (game-task cave-dark-crystals) (task-status need-reminder)) + (and (closed? arg0 (game-task cave-dark-crystals) (task-status need-introduction)) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) + (+ (get-reminder arg0 1) 3) ) - ) - ) - ) + ) + ) ) ) (new 'static 'task-cstage :game-task (game-task cave-dark-crystals) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ram) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ram) :status (task-status need-reminder-a) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ram) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-dark-crystals) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ram) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -2202,25 +1666,18 @@ ;; definition for symbol *citb-greensage-tasks*, type task-control (define *citb-greensage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task citadel-sage-green) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task citadel-sage-green) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -2229,25 +1686,18 @@ ;; definition for symbol *citb-bluesage-tasks*, type task-control (define *citb-bluesage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task citadel-sage-blue) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task citadel-sage-blue) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -2256,25 +1706,18 @@ ;; definition for symbol *citb-redsage-tasks*, type task-control (define *citb-redsage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task citadel-sage-red) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task citadel-sage-red) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -2283,386 +1726,282 @@ ;; definition for symbol *citb-yellowsage-tasks*, type task-control (define *citb-yellowsage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task citadel-sage-yellow) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task citadel-sage-yellow) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) ) ;; definition for symbol *task-controls*, type (array task-control) -(define - *task-controls* +(define *task-controls* (the-as (array task-control) - (new - 'static - 'boxed-array - :type basic :length 116 :allocated-length 116 + (new 'static 'boxed-array :type basic '*null-task-control* '*null-task-control* '*assistant-tasks* '*mayor-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-tower) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-tower) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-tower) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-tower) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 7 :allocated-length 7 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-fishgame) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-fishgame) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-fishgame) :status (task-status need-reminder-a) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-fishgame) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-fishgame) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-fishgame) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-plant) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-plant) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-plant) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-plant) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-canyon-end) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-canyon-end) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-canyon-end) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-canyon-end) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task jungle-temple-door) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-temple-door) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-temple-door) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task jungle-temple-door) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 5 :allocated-length 5 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village1-yakow) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-yakow) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-yakow) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-yakow) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-yakow) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) '*mayor-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 5 :allocated-length 5 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village1-uncle-money) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-uncle-money) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-uncle-money) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -2670,15 +2009,13 @@ (new 'static 'task-cstage :game-task (game-task village1-uncle-money) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-uncle-money) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -2687,405 +2024,303 @@ '*sage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task beach-pelican) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-pelican) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-pelican) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-pelican) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 5 :allocated-length 5 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task beach-flutflut) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-flutflut) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-flutflut) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-flutflut) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-flutflut) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task beach-seagull) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-seagull) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-seagull) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-seagull) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task beach-cannon) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-cannon) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-cannon) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-cannon) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task beach-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task beach-gimmie) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-gimmie) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-gimmie) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-gimmie) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task beach-sentinel) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-sentinel) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-sentinel) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task beach-sentinel) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 5 :allocated-length 5 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task misty-muse) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-muse) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-muse) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-muse) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-muse) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task misty-boat) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-boat) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-boat) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-boat) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task misty-warehouse) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-warehouse) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-warehouse) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-warehouse) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -3093,118 +2328,88 @@ '*assistant-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task misty-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task misty-bike-jump) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike-jump) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike-jump) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-bike-jump) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task misty-eco-challenge) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-eco-challenge) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-eco-challenge) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task misty-eco-challenge) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -3212,18 +2417,12 @@ '*geologist-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 5 :allocated-length 5 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village2-warrior-money) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) (and (not (task-closed? (game-task ogre-boss) (task-status need-reminder))) (not (task-closed? (game-task village2-levitator) (task-status need-reward-speech))) @@ -3233,10 +2432,8 @@ (new 'static 'task-cstage :game-task (game-task village2-warrior-money) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) (and (not (task-closed? (game-task ogre-boss) (task-status need-reminder))) (not (task-closed? (game-task village2-levitator) (task-status need-reward-speech))) @@ -3247,22 +2444,12 @@ :game-task (game-task village2-warrior-money) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (the-as symbol (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) + (>= (the-as float (send-event *target* 'query 'pickup (pickup-type money))) (-> *GAME-bank* money-task-inc)) ) ) ) @@ -3270,15 +2457,13 @@ (new 'static 'task-cstage :game-task (game-task village2-warrior-money) :status (task-status need-reminder) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-warrior-money) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -3286,564 +2471,421 @@ '*oracle-village2-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 6 :allocated-length 6 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task swamp-billy) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-billy) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-billy) :status (task-status need-reminder-a) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-billy) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-billy) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-billy) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) '*assistant-village2-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task swamp-battle) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-battle) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-battle) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-battle) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task swamp-tether-1) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-1) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-1) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-1) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task swamp-tether-2) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-2) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-2) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-2) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task swamp-tether-3) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-3) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-3) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-3) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task swamp-tether-4) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-4) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-4) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-tether-4) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task swamp-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task swamp-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task sunken-platforms) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-platforms) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-platforms) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-platforms) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task sunken-pipe) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-pipe) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-pipe) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-pipe) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task sunken-slide) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-slide) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-slide) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-slide) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) '*assistant-village2-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task sunken-sharks) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-sharks) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-sharks) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-sharks) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task sunken-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task sunken-top-of-helix) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-top-of-helix) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-top-of-helix) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-top-of-helix) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task sunken-spinning-room) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-spinning-room) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-spinning-room) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task sunken-spinning-room) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -3853,157 +2895,117 @@ '*sage-bluehut-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task rolling-lake) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-lake) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-lake) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-lake) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task rolling-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-1) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-1) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-1) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-1) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-2) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-2) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-2) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task rolling-ring-chase-2) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -4011,313 +3013,233 @@ '*sage-villagec-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task snow-fort) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-fort) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-fort) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-fort) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task snow-ball) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ball) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ball) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-ball) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task snow-bunnies) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-bunnies) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-bunnies) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-bunnies) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task snow-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task snow-bumpers) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-bumpers) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-bumpers) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-bumpers) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task snow-cage) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-cage) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-cage) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task snow-cage) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task firecanyon-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task firecanyon-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task firecanyon-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task firecanyon-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task firecanyon-end) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task firecanyon-end) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task firecanyon-end) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task firecanyon-end) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -4327,157 +3249,117 @@ '*citb-yellowsage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village3-extra1) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-extra1) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-extra1) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-extra1) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village1-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village1-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village2-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village2-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village3-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village3-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -4485,625 +3367,465 @@ '*sage-villagec-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task cave-dark-climb) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-dark-climb) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-dark-climb) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-dark-climb) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task cave-robot-climb) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-robot-climb) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-robot-climb) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-robot-climb) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task cave-swing-poles) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-swing-poles) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-swing-poles) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-swing-poles) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task cave-spider-tunnel) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-spider-tunnel) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-spider-tunnel) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-spider-tunnel) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task cave-platforms) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-platforms) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-platforms) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-platforms) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task cave-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task cave-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task ogre-boss) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-boss) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-boss) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-boss) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task ogre-end) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-end) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-end) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-end) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task ogre-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task lavatube-end) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-end) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-end) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-end) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task lavatube-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task citadel-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task citadel-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task citadel-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task citadel-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task training-gimmie) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-gimmie) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-gimmie) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-gimmie) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task training-door) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-door) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-door) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-door) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task training-climb) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-climb) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-climb) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-climb) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task training-buzzer) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-buzzer) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-buzzer) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task training-buzzer) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -5115,33 +3837,20 @@ '*oracle-village3-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task firecanyon-assistant) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-0)) 20) - ) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 20) ) ) (new 'static 'task-cstage :game-task (game-task firecanyon-assistant) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) @@ -5150,290 +3859,209 @@ '*sage-villagec-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task red-eggtop) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task red-eggtop) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task red-eggtop) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task red-eggtop) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task lavatube-balls) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-balls) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-balls) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task lavatube-balls) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task lavatube-start) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-0)) 72) - ) + (>= (the int (the float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 72) ) ) (new 'static 'task-cstage :game-task (game-task lavatube-start) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) '*sage-tasks* (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 4 :allocated-length 4 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task ogre-secret) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-secret) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-secret) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task ogre-secret) :status (task-status need-resolution) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 3 :allocated-length 3 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task village4-button) :status (task-status unknown) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village4-button) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task village4-button) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 5 :allocated-length 5 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task finalboss-movies) :status (task-status unknown) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task finalboss-movies) :status (task-status need-introduction) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task finalboss-movies) :status (task-status need-reminder-a) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task finalboss-movies) :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task finalboss-movies) :status (task-status need-reward-speech) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task plunger-lurker-hit) :status (task-status unknown) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task plunger-lurker-hit) :status (task-status need-hint) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :game-task (game-task leaving-misty) :status (task-status need-introduction) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) (new 'static 'task-cstage :game-task (game-task leaving-misty) :status (task-status need-reminder) - :flags - (task-flags has-entity closed-by-default) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :flags (task-flags has-entity closed-by-default) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) (new 'static 'task-control :current-stage -1 - :stage - (new - 'static - 'boxed-array - :type task-cstage :length 2 :allocated-length 2 + :stage (new 'static 'boxed-array :type task-cstage (new 'static 'task-cstage :status (task-status unknown) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable + :condition (lambda :behavior process-taskable ((arg0 task-control)) (task-closed? (game-task village4-button) (task-status need-reward-speech)) ) @@ -5441,8 +4069,7 @@ (new 'static 'task-cstage :status (task-status need-reminder) :flags (task-flags has-entity) - :condition - (lambda :behavior process-taskable ((arg0 task-control)) #t) + :condition (lambda :behavior process-taskable ((arg0 task-control)) #t) ) ) ) diff --git a/test/decompiler/reference/engine/game/voicebox_REF.gc b/test/decompiler/reference/engine/game/voicebox_REF.gc index 4c6761c4f8..a521272b00 100644 --- a/test/decompiler/reference/engine/game/voicebox_REF.gc +++ b/test/decompiler/reference/engine/game/voicebox_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/speaker-ag.gc") + ;; definition of type camera-voicebox (deftype camera-voicebox (camera-slave) () @@ -56,18 +58,14 @@ ;; failed to figure out what this is: (defstate empty-state (process) - :code - (the-as (function none :behavior process) nothing) + :code (the-as (function none :behavior process) nothing) ) ;; failed to figure out what this is: -(defskelgroup *voicebox-sg* speaker - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *voicebox-sg* speaker speaker-lod0-jg speaker-idle-ja + ((speaker-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; definition for function voicebox-track ;; INFO: Return type mismatch int vs none. @@ -104,8 +102,8 @@ ) ) (if (< 0.0 f0-8) - (set! (-> self twist) (seek (-> self twist) -0.4 (* 0.3 (-> *display* seconds-per-frame)))) - (set! (-> self twist) (seek (-> self twist) 0.4 (* 0.3 (-> *display* seconds-per-frame)))) + (seek! (-> self twist) -0.4 (* 0.3 (-> *display* seconds-per-frame))) + (seek! (-> self twist) 0.4 (* 0.3 (-> *display* seconds-per-frame))) ) ) (let ((a1-9 (new 'stack-no-clear 'event-message-block))) @@ -136,25 +134,22 @@ ;; failed to figure out what this is: (defstate enter (voicebox) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('die) (go-virtual exit) ) ) ) - :trans - (behavior () + :trans (behavior () (voicebox-track) (if (< 0.1 (-> self blend)) (point-toward-point-clear-roll-pitch! (-> self root) (target-pos 0)) ) (none) ) - :code - (behavior () - (set-setting! *setting-control* self 'sound-flava #f 20.0 6) + :code (behavior () + (set-setting! 'sound-flava #f 20.0 (music-flava assistant)) (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9))) (send-event (ppointer->process (-> self parent-override)) @@ -180,40 +175,30 @@ (go-virtual idle) (none) ) - :post - (the-as (function none :behavior voicebox) ja-post) + :post (the-as (function none :behavior voicebox) ja-post) ) ;; failed to figure out what this is: (defstate idle (voicebox) :virtual #t - :event - (-> (method-of-type voicebox enter) event) - :trans - voicebox-track - :code - (behavior () - (while #t + :event (-> (method-of-type voicebox enter) event) + :trans voicebox-track + :code (behavior () + (loop (suspend) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior voicebox) ja-post) + :post (the-as (function none :behavior voicebox) ja-post) ) ;; failed to figure out what this is: (defstate exit (voicebox) :virtual #t - :trans - voicebox-track - :code - (behavior () - (clear-pending-settings-from-process *setting-control* self 'sound-flava) + :trans voicebox-track + :code (behavior () + (remove-setting! 'sound-flava) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self seeker target) 1.0) (while (and (< (-> self blend) 0.9999) @@ -233,8 +218,7 @@ 0 (none) ) - :post - (the-as (function none :behavior voicebox) ja-post) + :post (the-as (function none :behavior voicebox) ja-post) ) ;; definition for function voicebox-init-by-other @@ -253,45 +237,25 @@ ;; failed to figure out what this is: (defstate cam-voicebox (camera-voicebox) - :event - (-> cam-string event) - :enter - (-> cam-string enter) - :trans - (behavior () + :event (-> cam-string event) + :enter (-> cam-string enter) + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (deactivate self) ) (none) ) - :code - (-> cam-string code) + :code (-> cam-string code) ) ;; definition for function voicebox-spawn (defun voicebox-spawn ((arg0 process) (arg1 vector)) (with-pp - (let* ((s3-0 (get-process *camera-dead-pool* camera-voicebox #x4000)) - (s4-0 (when s3-0 - (let ((t9-1 (method-of-type camera-voicebox activate))) - (t9-1 (the-as camera-voicebox s3-0) arg0 'camera-voicebox (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 cam-slave-init cam-voicebox #f) - (-> s3-0 ppointer) - ) - ) - ) - (when s4-0 - (let ((s5-1 (get-process *default-dead-pool* voicebox #x4000))) - (when s5-1 - (let ((t9-4 (method-of-type voicebox activate))) - (t9-4 (the-as voicebox s5-1) (ppointer->process s4-0) 'voicebox (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 voicebox-init-by-other arg1 (process->handle pp)) - (-> s5-1 ppointer) - ) + (let ((s4-0 (process-spawn camera-voicebox :init cam-slave-init cam-voicebox #f :from *camera-dead-pool* :to arg0)) + ) + (if s4-0 + (process-spawn voicebox arg1 (process->handle pp) :to (ppointer->process s4-0)) ) - ) ) ) ) diff --git a/test/decompiler/reference/engine/geometry/vol-h_REF.gc b/test/decompiler/reference/engine/geometry/vol-h_REF.gc index 92fad74c60..7b3b22079a 100644 --- a/test/decompiler/reference/engine/geometry/vol-h_REF.gc +++ b/test/decompiler/reference/engine/geometry/vol-h_REF.gc @@ -83,7 +83,7 @@ ) (set! (-> (the-as vol-control gp-0) process) arg0) (let* ((s5-1 (the-as res-lump (-> (the-as vol-control gp-0) process entity))) - (s4-0 (-> ((method-of-type res-lump lookup-tag-idx) (the-as entity s5-1) 'vol 'exact 0.0) lo)) + (s4-0 (-> ((method-of-type res-lump lookup-tag-idx) (the-as entity-actor s5-1) 'vol 'exact 0.0) lo)) ) (when (>= (the-as int s4-0) 0) (let ((s3-0 (the-as int s4-0)) @@ -105,7 +105,7 @@ ) ) (let* ((s5-2 (the-as res-lump (-> (the-as vol-control gp-0) process entity))) - (s4-1 (-> ((method-of-type res-lump lookup-tag-idx) (the-as entity s5-2) 'cutoutvol 'exact 0.0) lo)) + (s4-1 (-> ((method-of-type res-lump lookup-tag-idx) (the-as entity-actor s5-2) 'cutoutvol 'exact 0.0) lo)) ) (when (>= (the-as int s4-1) 0) (let ((s3-1 (the-as int s4-1)) diff --git a/test/decompiler/reference/engine/geometry/vol_REF.gc b/test/decompiler/reference/engine/geometry/vol_REF.gc index e1c8992617..b51228f5e8 100644 --- a/test/decompiler/reference/engine/geometry/vol_REF.gc +++ b/test/decompiler/reference/engine/geometry/vol_REF.gc @@ -191,7 +191,7 @@ (dotimes (s3-0 (/ (-> obj point-count) 2)) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector s4-0) (the-as vector (&-> s4-0 4)) (the-as rgba s5-0) diff --git a/test/decompiler/reference/engine/gfx/background_REF.gc b/test/decompiler/reference/engine/gfx/background_REF.gc index 44f60467a4..96b6e291d2 100644 --- a/test/decompiler/reference/engine/gfx/background_REF.gc +++ b/test/decompiler/reference/engine/gfx/background_REF.gc @@ -365,7 +365,7 @@ ) (dotimes (gp-2 (-> *background-work* tie-tree-count)) (when (nonzero? (-> *background-work* tie-generic gp-2)) - (let* ((s5-4 (-> *background-work* tie-levels gp-2 foreground-sink-group 0 generic-sink)) + (let* ((s5-4 (-> *background-work* tie-levels gp-2 tfrag-tex-foreground-sink-group generic-sink)) (s3-1 (-> *display* frames (-> *display* on-screen) frame global-buf)) (s4-3 (-> s3-1 base)) ) diff --git a/test/decompiler/reference/engine/gfx/depth-cue_REF.gc b/test/decompiler/reference/engine/gfx/depth-cue_REF.gc index d05494f760..3cb028d030 100644 --- a/test/decompiler/reference/engine/gfx/depth-cue_REF.gc +++ b/test/decompiler/reference/engine/gfx/depth-cue_REF.gc @@ -2,53 +2,33 @@ (in-package goal) ;; definition for symbol *depth-cue-work*, type depth-cue-work -(define - *depth-cue-work* +(define *depth-cue-work* (new 'static 'depth-cue-work - :texture-strip-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + :texture-strip-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x50ab400000008001 #x43431) + :gif (new 'static 'array uint64 2 #x50ab400000008001 #x43431) ) - :temp-strip-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + :temp-strip-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x508b400000008001 #x43431) + :gif (new 'static 'array uint64 2 #x508b400000008001 #x43431) ) - :stencil-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x17 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x17 :cmd (vif-cmd direct) :msk #x1) + :stencil-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x17 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x17 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #xb003400000008002 #x44444444441) + :gif (new 'static 'array uint64 2 #xb003400000008002 #x44444444441) ) - :set-color - (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) - :draw-color - (new 'static 'vector4w :x #x84 :y #x84 :z #x84 :w #x80) - :depth - (new 'static 'depth-cue-data :data (new 'static 'vector :x 1.0 :z 163840.0)) - :front - (new 'static 'depth-cue-data :data (new 'static 'vector :x 0.999 :y 0.4 :z 4096.0 :w 1.0)) + :set-color (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) + :draw-color (new 'static 'vector4w :x #x84 :y #x84 :z #x84 :w #x80) + :depth (new 'static 'depth-cue-data :data (new 'static 'vector :x 1.0 :z 163840.0)) + :front (new 'static 'depth-cue-data :data (new 'static 'vector :x 0.999 :y 0.4 :z 4096.0 :w 1.0)) ) ) diff --git a/test/decompiler/reference/engine/gfx/eye_REF.gc b/test/decompiler/reference/engine/gfx/eye_REF.gc index b15f804b68..e49fee348a 100644 --- a/test/decompiler/reference/engine/gfx/eye_REF.gc +++ b/test/decompiler/reference/engine/gfx/eye_REF.gc @@ -3,44 +3,28 @@ ;; definition for symbol *eye-work*, type eye-work (define *eye-work* (new 'static 'eye-work - :sprite-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + :sprite-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x508b400000008001 #x53531) + :gif (new 'static 'array uint64 2 #x508b400000008001 #x53531) ) - :sprite-tmpl2 - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + :sprite-tmpl2 (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x50ab400000008001 #x53531) + :gif (new 'static 'array uint64 2 #x50ab400000008001 #x53531) ) - :adgif-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + :adgif-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x1000000000008005 #xe) + :gif (new 'static 'array uint64 2 #x1000000000008005 #xe) ) - :blink-table - (new 'static 'array float 10 0.0 0.667 0.9 1.0 1.0 1.0 1.0 0.333 0.1 0.0) + :blink-table (new 'static 'array float 10 0.0 0.667 0.9 1.0 1.0 1.0 1.0 0.333 0.1 0.0) ) ) @@ -812,7 +796,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id merc-eyes) + (bucket-id eyes) gp-2 (the-as (pointer dma-tag) a3-5) ) @@ -886,7 +870,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id merc-eyes) + (bucket-id eyes) s4-1 (the-as (pointer dma-tag) a3-7) ) @@ -1072,7 +1056,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id merc-eyes) + (bucket-id eyes) gp-6 (the-as (pointer dma-tag) a3-10) ) diff --git a/test/decompiler/reference/engine/gfx/font-h_REF.gc b/test/decompiler/reference/engine/gfx/font-h_REF.gc index 5c2f43c7eb..f2f9bb3708 100644 --- a/test/decompiler/reference/engine/gfx/font-h_REF.gc +++ b/test/decompiler/reference/engine/gfx/font-h_REF.gc @@ -300,32 +300,21 @@ ) ;; definition for symbol *font-work*, type font-work -(define - *font-work* +(define *font-work* (new 'static 'font-work - :font-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1) + :font-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x102e400000008001 #xe) + :gif (new 'static 'array uint64 2 #x102e400000008001 #xe) ) - :char-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #xe :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #xe :cmd (vif-cmd direct) :msk #x1) + :char-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xe :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #xe :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #xd02e400000008001 #x412412412412e) + :gif (new 'static 'array uint64 2 #xd02e400000008001 #x412412412412e) ) :tex1-tmpl (new 'static 'array uint64 2 #x60 #x14) :small-font-lo-tmpl (new 'static 'array uint64 2 #x0 #x6) @@ -334,62 +323,49 @@ :large-font-hi-tmpl (new 'static 'array uint64 2 #x0 #x6) :size1-small (new 'static 'vector :x 12.0 :w 0.5) :size2-small (new 'static 'vector :y 8.0 :w 8.0) - :size3-small - (new 'static 'vector :x 12.0 :y 8.0 :w 8.0) + :size3-small (new 'static 'vector :x 12.0 :y 8.0 :w 8.0) :size1-large (new 'static 'vector :x 24.0 :w 1.0) :size2-large (new 'static 'vector :y 16.0 :w 16.0) - :size3-large - (new 'static 'vector :x 24.0 :y 16.0 :w 16.0) + :size3-large (new 'static 'vector :x 24.0 :y 16.0 :w 16.0) :size-st1 (new 'static 'vector :x 0.08985 :w 0.5) - :size-st2 - (new 'static 'vector :y 0.06153846 :w 0.5) - :size-st3 - (new 'static 'vector :x 0.08985 :y 0.06153846 :w 0.5) - :current-verts - (new 'static 'char-verts - :pos - (new 'static 'inline-array vector 4 + :size-st2 (new 'static 'vector :y 0.06153846 :w 0.5) + :size-st3 (new 'static 'vector :x 0.08985 :y 0.06153846 :w 0.5) + :current-verts (new 'static 'char-verts + :pos (new 'static 'inline-array vector 4 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0) ) - :tex-st - (new 'static 'inline-array vector 4 + :tex-st (new 'static 'inline-array vector 4 (new 'static 'vector :z 1.0) (new 'static 'vector :z 1.0) (new 'static 'vector :z 1.0) (new 'static 'vector :z 1.0) ) ) - :src-verts - (new 'static 'char-verts - :pos - (new 'static 'inline-array vector 4 + :src-verts (new 'static 'char-verts + :pos (new 'static 'inline-array vector 4 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0) ) - :tex-st - (new 'static 'inline-array vector 4 + :tex-st (new 'static 'inline-array vector 4 (new 'static 'vector :z 1.0) (new 'static 'vector :z 1.0) (new 'static 'vector :z 1.0) (new 'static 'vector :z 1.0) ) ) - :dest-verts - (new 'static 'char-verts - :pos - (new 'static 'inline-array vector 4 + :dest-verts (new 'static 'char-verts + :pos (new 'static 'inline-array vector 4 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0) ) - :tex-st - (new 'static 'inline-array vector 4 + :tex-st (new 'static 'inline-array vector 4 (new 'static 'vector :z 1.0) (new 'static 'vector :z 1.0) (new 'static 'vector :z 1.0) @@ -397,8 +373,7 @@ ) ) :color-shadow (new 'static 'vector4w :w #x80) - :color-table - (new 'static 'inline-array char-color 64 + :color-table (new 'static 'inline-array char-color 64 (new 'static 'char-color :color (new 'static 'array rgba 4 (new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80) (new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80) diff --git a/test/decompiler/reference/engine/gfx/font_REF.gc b/test/decompiler/reference/engine/gfx/font_REF.gc index e7d3bea977..333ebae1ad 100644 --- a/test/decompiler/reference/engine/gfx/font_REF.gc +++ b/test/decompiler/reference/engine/gfx/font_REF.gc @@ -557,12 +557,10 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for function draw-string-xy -;; INFO: Return type mismatch float vs none. (defun draw-string-xy ((arg0 string) (arg1 dma-buffer) (arg2 int) (arg3 int) (arg4 font-color) (arg5 font-flags)) (let ((a2-2 (new 'stack 'font-context *font-default-matrix* arg2 arg3 0.0 arg4 arg5))) (draw-string arg0 arg1 a2-2) ) - (none) ) ;; definition for function draw-string-adv diff --git a/test/decompiler/reference/engine/gfx/generic/generic-h_REF.gc b/test/decompiler/reference/engine/gfx/generic/generic-h_REF.gc index cf50dc7962..b3ce6e59fc 100644 --- a/test/decompiler/reference/engine/gfx/generic/generic-h_REF.gc +++ b/test/decompiler/reference/engine/gfx/generic/generic-h_REF.gc @@ -281,7 +281,7 @@ (gifbuf-adr uint32 :offset-assert 68) (inbuf-adr uint32 :offset-assert 72) (fade-val uint32 :offset-assert 76) - (time-of-day-color uint32 :offset-assert 80) + (time-of-day-color rgba :offset-assert 80) (to-vu0-waits uint32 :offset-assert 84) (to-spr-waits uint32 :offset-assert 88) (from-spr-waits uint32 :offset-assert 92) diff --git a/test/decompiler/reference/engine/gfx/generic/generic_REF.gc b/test/decompiler/reference/engine/gfx/generic/generic_REF.gc index 5e18f60849..1d11e3d7a9 100644 --- a/test/decompiler/reference/engine/gfx/generic/generic_REF.gc +++ b/test/decompiler/reference/engine/gfx/generic/generic_REF.gc @@ -2,41 +2,44 @@ (in-package goal) ;; definition for symbol *generic-foreground-sinks*, type (array generic-dma-foreground-sink) -(define - *generic-foreground-sinks* +(define *generic-foreground-sinks* (the-as (array generic-dma-foreground-sink) (new 'static 'boxed-array :type generic-dma-foreground-sink :length 0 :allocated-length 9) ) ) ;; failed to figure out what this is: -(set! (-> *generic-foreground-sinks* 0) (-> *level* level0 foreground-sink-group 0 generic-sink)) +(set! (-> *generic-foreground-sinks* 0) (-> *level* level0 tfrag-tex-foreground-sink-group generic-sink)) ;; failed to figure out what this is: -(set! (-> *generic-foreground-sinks* 1) (-> *level* level0 foreground-sink-group 1 generic-sink)) +(set! (-> *generic-foreground-sinks* 1) (-> *level* level0 pris-tex-foreground-sink-group generic-sink)) ;; failed to figure out what this is: -(set! (-> *generic-foreground-sinks* 2) (-> *level* level1 foreground-sink-group 0 generic-sink)) +(set! (-> *generic-foreground-sinks* 2) (-> *level* level1 tfrag-tex-foreground-sink-group generic-sink)) ;; failed to figure out what this is: -(set! (-> *generic-foreground-sinks* 3) (-> *level* level1 foreground-sink-group 1 generic-sink)) +(set! (-> *generic-foreground-sinks* 3) (-> *level* level1 pris-tex-foreground-sink-group generic-sink)) ;; failed to figure out what this is: -(set! (-> *generic-foreground-sinks* 4) (-> *level* level-default foreground-sink-group 0 generic-sink)) - -;; failed to figure out what this is: -(set! (-> *generic-foreground-sinks* 5) (-> *level* level-default foreground-sink-group 1 generic-sink)) - -;; failed to figure out what this is: -(set! (-> *generic-foreground-sinks* 6) - (new 'static 'generic-dma-foreground-sink :bucket (bucket-id generic-foreground)) +(set! (-> *generic-foreground-sinks* 4) + (-> *level* level-default tfrag-tex-foreground-sink-group generic-sink) ) ;; failed to figure out what this is: -(set! (-> *generic-foreground-sinks* 7) (-> *level* level0 foreground-sink-group 2 generic-sink)) +(set! (-> *generic-foreground-sinks* 5) + (-> *level* level-default pris-tex-foreground-sink-group generic-sink) + ) ;; failed to figure out what this is: -(set! (-> *generic-foreground-sinks* 8) (-> *level* level1 foreground-sink-group 2 generic-sink)) +(set! (-> *generic-foreground-sinks* 6) + (new 'static 'generic-dma-foreground-sink :bucket (bucket-id shrub-generic1)) + ) + +;; failed to figure out what this is: +(set! (-> *generic-foreground-sinks* 7) (-> *level* level0 water-tex-foreground-sink-group generic-sink)) + +;; failed to figure out what this is: +(set! (-> *generic-foreground-sinks* 8) (-> *level* level1 water-tex-foreground-sink-group generic-sink)) ;; definition for function generic-dma-foreground-sink-init ;; INFO: Return type mismatch int vs none. diff --git a/test/decompiler/reference/engine/gfx/hw/display_REF.gc b/test/decompiler/reference/engine/gfx/hw/display_REF.gc index e8a6b0f684..2d46b9f275 100644 --- a/test/decompiler/reference/engine/gfx/hw/display_REF.gc +++ b/test/decompiler/reference/engine/gfx/hw/display_REF.gc @@ -195,8 +195,7 @@ ) ;; definition for symbol *font-context*, type font-context -(define - *font-context* +(define *font-context* (new 'global 'font-context *font-default-matrix* 0 24 0.0 (font-color default) (font-flags shadow kerning)) ) diff --git a/test/decompiler/reference/engine/gfx/hw/vu1-user-h_REF.gc b/test/decompiler/reference/engine/gfx/hw/vu1-user-h_REF.gc index e4261bbd0c..9635597185 100644 --- a/test/decompiler/reference/engine/gfx/hw/vu1-user-h_REF.gc +++ b/test/decompiler/reference/engine/gfx/hw/vu1-user-h_REF.gc @@ -15,7 +15,7 @@ shrub-near billboard trans-shrubbery - trans-frag + trans-tfrag sprite shadow depth-cue diff --git a/test/decompiler/reference/engine/gfx/merc/merc-death_REF.gc b/test/decompiler/reference/engine/gfx/merc/merc-death_REF.gc index aef0b0be45..8f15252829 100644 --- a/test/decompiler/reference/engine/gfx/merc/merc-death_REF.gc +++ b/test/decompiler/reference/engine/gfx/merc/merc-death_REF.gc @@ -36,39 +36,33 @@ ) ;; definition for symbol death-beach-puppy, type death-info -(define - death-beach-puppy +(define death-beach-puppy (new 'static 'death-info :vertex-skip #x82 :timer #x4b :overlap #x4 :effect #x29 :sound 'temp-enemy-die) ) ;; definition for symbol death-jungle-snake, type death-info -(define - death-jungle-snake +(define death-jungle-snake (new 'static 'death-info :vertex-skip #xa :timer #x4b :overlap #x4 :effect #x29 :sound 'temp-enemy-die) ) ;; definition for symbol death-default, type death-info -(define - death-default +(define death-default (new 'static 'death-info :vertex-skip #x50 :timer #x4b :overlap #x4 :effect #x29 :sound 'temp-enemy-die) ) ;; definition for symbol death-warp-in, type death-info -(define - death-warp-in +(define death-warp-in (new 'static 'death-info :vertex-skip #x96 :timer #x4b :effect #x29 :sound 'warpgate-tele) ) ;; definition for symbol death-warp-out, type death-info -(define - death-warp-out +(define death-warp-out (new 'static 'death-info :vertex-skip #x96 :timer #x96 :effect #x29 :sound 'warpgate-tele) ) ;; failed to figure out what this is: (defpart 41 - :init-specs - ((sp-flt spt-scale-x (meters 0.5)) + :init-specs ((sp-flt spt-scale-x (meters 0.5)) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 64.0 32.0 1.0) (sp-rnd-flt spt-g 16.0 32.0 1.0) @@ -87,8 +81,7 @@ ;; failed to figure out what this is: (defpart 42 - :init-specs - ((sp-flt spt-fade-a -1.4222223) + :init-specs ((sp-flt spt-fade-a -1.4222223) (sp-int spt-timer 45) (sp-int spt-next-time 42) (sp-launcher-by-id spt-next-launcher 43) @@ -97,8 +90,7 @@ ;; failed to figure out what this is: (defpart 43 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) (sp-flt spt-fade-a -0.21333334) (sp-int-plain-rnd spt-timer 0 296 1)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-flt spt-fade-a -0.21333334) (sp-int-plain-rnd spt-timer 0 296 1)) ) ;; definition for function merc-death-spawn diff --git a/test/decompiler/reference/engine/gfx/merc/merc_REF.gc b/test/decompiler/reference/engine/gfx/merc/merc_REF.gc index f30138fb9d..0585ac09c9 100644 --- a/test/decompiler/reference/engine/gfx/merc/merc_REF.gc +++ b/test/decompiler/reference/engine/gfx/merc/merc_REF.gc @@ -504,7 +504,7 @@ 0 ) (merc-vu1-init-buffer - (bucket-id bucket-49) + (bucket-id merc-pris0) (new 'static 'gs-test :ate #x1 :atst (gs-atest greater-equal) @@ -526,7 +526,7 @@ 0 ) (merc-vu1-init-buffer - (bucket-id bucket-52) + (bucket-id merc-pris1) (new 'static 'gs-test :ate #x1 :atst (gs-atest greater-equal) @@ -537,7 +537,7 @@ 0 ) (merc-vu1-init-buffer - (bucket-id bucket-45) + (bucket-id merc-alpha-tex) (new 'static 'gs-test :ate #x1 :atst (gs-atest greater-equal) @@ -548,7 +548,7 @@ 0 ) (merc-vu1-init-buffer - (bucket-id bucket-55) + (bucket-id merc-pris-common) (new 'static 'gs-test :ate #x1 :atst (gs-atest greater-equal) @@ -559,7 +559,7 @@ 0 ) (merc-vu1-init-buffer - (bucket-id bucket-58) + (bucket-id merc-water0) (new 'static 'gs-test :ate #x1 :atst (gs-atest greater-equal) @@ -571,7 +571,7 @@ 0 ) (merc-vu1-init-buffer - (bucket-id bucket-61) + (bucket-id merc-water1) (new 'static 'gs-test :ate #x1 :atst (gs-atest greater-equal) diff --git a/test/decompiler/reference/engine/gfx/ocean/ocean-mid_REF.gc b/test/decompiler/reference/engine/gfx/ocean/ocean-mid_REF.gc index 6f455ce979..5562ba7f8a 100644 --- a/test/decompiler/reference/engine/gfx/ocean/ocean-mid_REF.gc +++ b/test/decompiler/reference/engine/gfx/ocean/ocean-mid_REF.gc @@ -1158,7 +1158,3 @@ (none) ) ) - - - - diff --git a/test/decompiler/reference/engine/gfx/ocean/ocean-near_REF.gc b/test/decompiler/reference/engine/gfx/ocean/ocean-near_REF.gc index 159b9b2b7c..5d5ce5a876 100644 --- a/test/decompiler/reference/engine/gfx/ocean/ocean-near_REF.gc +++ b/test/decompiler/reference/engine/gfx/ocean/ocean-near_REF.gc @@ -730,7 +730,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/engine/gfx/ocean/ocean-tables_REF.gc b/test/decompiler/reference/engine/gfx/ocean/ocean-tables_REF.gc index 83d0052755..44947951f6 100644 --- a/test/decompiler/reference/engine/gfx/ocean/ocean-tables_REF.gc +++ b/test/decompiler/reference/engine/gfx/ocean/ocean-tables_REF.gc @@ -2,8 +2,7 @@ (in-package goal) ;; definition for symbol *ocean-spheres-village1*, type ocean-spheres -(define - *ocean-spheres-village1* +(define *ocean-spheres-village1* (new 'static 'ocean-spheres :spheres (new 'static 'inline-array sphere 36 (new 'static 'sphere :x -7864320.0 :z -7864320.0 :w 2224365.5) (new 'static 'sphere :x -4718592.0 :z -7864320.0 :w 2224365.5) @@ -46,8 +45,7 @@ ) ;; definition for symbol *ocean-colors-village1*, type ocean-colors -(define - *ocean-colors-village1* +(define *ocean-colors-village1* (new 'static 'ocean-colors :colors (new 'static 'array rgba 2548 (new 'static 'rgba :r #x1 :g #x2d :b #x38 :a #x80) (new 'static 'rgba :r #x1 :g #x2c :b #x38 :a #x80) @@ -2602,15 +2600,12 @@ ) ;; definition for symbol *ocean-near-indices-village1*, type ocean-near-indices -(define - *ocean-near-indices-village1* +(define *ocean-near-indices-village1* (new 'static 'ocean-near-indices - :data - (new 'static 'inline-array ocean-near-index 68 + :data (new 'static 'inline-array ocean-near-index 68 (new 'static 'ocean-near-index) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x0 #x1 #xffff @@ -2630,8 +2625,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -2651,8 +2645,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -2672,12 +2665,10 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #xa #xb #x0 #x0 #x0 #x14 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x0 #x0 #xa #xb #x0 #x0 #x0 #x14 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -2697,24 +2688,19 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #xc #xd #xe #xf #xffff #xffff #x16 #x17 #xffff #x1b #x1c #x0 #x22 #x23 #x24 #x0) + :data (new 'static 'array uint16 16 #xc #xd #xe #xf #xffff #xffff #x16 #x17 #xffff #x1b #x1c #x0 #x22 #x23 #x24 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x10 #x11 #x12 #x13 #x0 #x0 #x18 #x19 #x1d #x1e #x0 #x1f #x0 #x0 #x0 #x25) + :data (new 'static 'array uint16 16 #x10 #x11 #x12 #x13 #x0 #x0 #x18 #x19 #x1d #x1e #x0 #x1f #x0 #x0 #x0 #x25) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x0 #x26 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x26 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x27 #x0 #x17 #x0 #x0 #x0 #x0 #x2b #x0 #x0 #x0 #x2e #x0 #x0 #x0 #x32) + :data (new 'static 'array uint16 16 #x27 #x0 #x17 #x0 #x0 #x0 #x0 #x2b #x0 #x0 #x0 #x2e #x0 #x0 #x0 #x32) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x0 #x28 #x29 @@ -2734,8 +2720,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -2755,8 +2740,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -2776,12 +2760,10 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x0 #x38 #x0 #x0 #x0 #x38 #x0 #x0 #x0 #x48 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x38 #x0 #x0 #x0 #x38 #x0 #x0 #x0 #x48 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -2801,8 +2783,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -2822,8 +2803,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x39 #x3a #x2d @@ -2843,8 +2823,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x3b #x3c #xffff @@ -2864,16 +2843,13 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x3d #x0 #x0 #x0 #x47 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x3d #x0 #x0 #x0 #x47 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x54 #xffff #x0 #x0 #x59 #xffff #x0 #x0 #x5c #x56 #x0 #x62 #x63 #x64) + :data (new 'static 'array uint16 16 #x0 #x0 #x54 #xffff #x0 #x0 #x59 #xffff #x0 #x0 #x5c #x56 #x0 #x62 #x63 #x64) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -2893,8 +2869,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #x55 #x56 @@ -2914,8 +2889,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -2935,8 +2909,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -2956,12 +2929,10 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x58 #x0 #x0 #x0 #x3d #x0 #x0 #x0 #x3d #x0 #x0 #x0 #x3d #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x58 #x0 #x0 #x0 #x3d #x0 #x0 #x0 #x3d #x0 #x0 #x0 #x3d #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x0 #x6c #xffff @@ -2981,8 +2952,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -3002,8 +2972,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -3023,16 +2992,13 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x6e #x41 #x6f #x0 #x73 #x74 #x75 #x76 #x7b #x7c #x7d #x17 #x86 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x6e #x41 #x6f #x0 #x73 #x74 #x75 #x76 #x7b #x7c #x7d #x17 #x86 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x87 #x88 #x0 #x0 #x8e #xffff #x0 #x0 #x91 #xffff #x0 #x0 #x95 #x96) + :data (new 'static 'array uint16 16 #x0 #x0 #x87 #x88 #x0 #x0 #x8e #xffff #x0 #x0 #x91 #xffff #x0 #x0 #x95 #x96) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #x89 #x20 @@ -3052,48 +3018,37 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x8b #x0 #x0 #x8c #x0 #x0 #x0 #x90 #x0 #x0 #x0 #x93 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x8b #x0 #x0 #x8c #x0 #x0 #x0 #x90 #x0 #x0 #x0 #x93 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #xffff #x8d #x0 #x0 #x66 #x0 #x0 #x0 #x94 #x0 #x0 #x0 #x98 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #xffff #x8d #x0 #x0 #x66 #x0 #x0 #x0 #x94 #x0 #x0 #x0 #x98 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x0 #x20 #x0 #x0 #x0 #x9b #x0 #x0 #x0 #x0 #x0 #x9d #x9e #x0) + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x20 #x0 #x0 #x0 #x9b #x0 #x0 #x0 #x0 #x0 #x9d #x9e #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x99 #x9a #x0 #x0 #x9c #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x99 #x9a #x0 #x0 #x9c #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x9f #xa0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x0 #x9f #xa0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #xa1 #x0 #x0) + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #xa1 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x79 #x0 #x0) + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x79 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #xb2 #xb3 #xb4 #xb5) + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #xb2 #xb3 #xb4 #xb5) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #xb6 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #xb6 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #xab #xac #x0 #xb7 #xb8 #xb9) + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #xab #xac #x0 #xb7 #xb8 #xb9) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x0 #x0 #xa2 @@ -3113,8 +3068,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xa4 #xa5 #x0 @@ -3134,12 +3088,10 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #xa9 #xaa #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #xa9 #xaa #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x0 #xbf #xc0 @@ -3159,8 +3111,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xc2 #xffff #xffff @@ -3180,8 +3131,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xc3 #x0 @@ -3201,12 +3151,10 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x0 #xc4 #x0 #x0 #x70 #x3b #x0 #x0 #xffff #xffff #x0 #x0 #xffff #xffff) + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #xc4 #x0 #x0 #x70 #x3b #x0 #x0 #xffff #xffff #x0 #x0 #xffff #xffff) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x0 #xc5 #xc6 @@ -3226,8 +3174,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xc8 #xc9 #xca @@ -3247,8 +3194,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -3268,12 +3214,10 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #xcb #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #xcb #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x0 #xdc #xdd @@ -3293,8 +3237,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x64 #xffff #xffff @@ -3314,8 +3257,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -3335,12 +3277,10 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #xffff #xdf #x0 #x0 #xffff #xe5 #xe6 #x0 #xea #xeb #xec #x0 #xf6 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #xffff #xdf #x0 #x0 #xffff #xe5 #xe6 #x0 #xea #xeb #xec #x0 #xf6 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x0 #x0 #xffff @@ -3360,8 +3300,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xe0 @@ -3381,8 +3320,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xe2 #xffff #xffff @@ -3402,12 +3340,10 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #xfa #xfb #xfc #xfd #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #xfa #xfb #xfc #xfd #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xfe #xffff #xffff @@ -3427,16 +3363,13 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #xff #x100 #x0 #x0 #x106 #x107 #x0 #x0 #x10d #x10e #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #xff #x100 #x0 #x0 #x106 #x107 #x0 #x0 #x10d #x10e #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x101 #xffff #x0 #x0 #x0 #xfa #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x0 #x0 #x101 #xffff #x0 #x0 #x0 #xfa #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -3456,8 +3389,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x0 #x0 #x0 @@ -3477,24 +3409,20 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x103 #x104 #xc3 #x0 #xffff #x10c #x17 #x0 #x112 #x113 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x103 #x104 #xc3 #x0 #xffff #x10c #x17 #x0 #x112 #x113 #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x117 #x0 #x118 #x0 #x11a #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x117 #x0 #x118 #x0 #x11a #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x119 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x119 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) ) ) ) ;; definition for symbol *ocean-trans-indices-village1*, type ocean-trans-indices -(define - *ocean-trans-indices-village1* +(define *ocean-trans-indices-village1* (new 'static 'ocean-trans-indices :data (new 'static 'inline-array ocean-trans-index 2304 (new 'static 'ocean-trans-index :parent -1 :child -1) (new 'static 'ocean-trans-index :parent -1 :child -1) @@ -5847,11 +5775,9 @@ ) ;; definition for symbol *ocean-mid-masks-village1*, type ocean-mid-masks -(define - *ocean-mid-masks-village1* +(define *ocean-mid-masks-village1* (new 'static 'ocean-mid-masks - :data - (new 'static 'inline-array ocean-mid-mask 322 + :data (new 'static 'inline-array ocean-mid-mask 322 (new 'static 'ocean-mid-mask) (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf8 #xf8 #xf8 #xfc #xfe #xfe #xfe #xfe)) (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfe #xc0 #xc0 #xc0 #x80 #x80 #x80 #x0)) @@ -6179,8 +6105,7 @@ ) ;; definition for symbol *ocean-spheres-village2*, type ocean-spheres -(define - *ocean-spheres-village2* +(define *ocean-spheres-village2* (new 'static 'ocean-spheres :spheres (new 'static 'inline-array sphere 36 (new 'static 'sphere :x -6320128.0 :z -14385152.0 :w 2224365.5) (new 'static 'sphere :x -3174400.0 :z -14385152.0 :w 2224365.5) @@ -6223,8 +6148,7 @@ ) ;; definition for symbol *ocean-colors-village2*, type ocean-colors -(define - *ocean-colors-village2* +(define *ocean-colors-village2* (new 'static 'ocean-colors :colors (new 'static 'array rgba 2548 (new 'static 'rgba :r #x1f :g #x32 :b #x42 :a #x80) (new 'static 'rgba :r #x1f :g #x32 :b #x42 :a #x80) @@ -8779,15 +8703,12 @@ ) ;; definition for symbol *ocean-near-indices-village2*, type ocean-near-indices -(define - *ocean-near-indices-village2* +(define *ocean-near-indices-village2* (new 'static 'ocean-near-indices - :data - (new 'static 'inline-array ocean-near-index 23 + :data (new 'static 'inline-array ocean-near-index 23 (new 'static 'ocean-near-index) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x1 #xffff #xffff @@ -8807,12 +8728,10 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x1 #x0 #x0 #x0 #xffff #x0 #x0 #x0 #xffff #x0 #x0 #x0 #xffff #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x1 #x0 #x0 #x0 #xffff #x0 #x0 #x0 #xffff #x0 #x0 #x0 #xffff #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -8832,8 +8751,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #x0 #x0 @@ -8853,16 +8771,13 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #xffff #x4 #x5 #x6 #xffff #x7 #x0 #x0 #xffff #x8 #x0 #x0 #xffff #x9 #x0 #x0) + :data (new 'static 'array uint16 16 #xffff #x4 #x5 #x6 #xffff #x7 #x0 #x0 #xffff #x8 #x0 #x0 #xffff #x9 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #xa #xb #x0 #x0 #xc #x0 #x0 #x0 #xd #x0 #x0 #x0 #xe #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #xa #xb #x0 #x0 #xc #x0 #x0 #x0 #xd #x0 #x0 #x0 #xe #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xf #xf @@ -8882,28 +8797,22 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #xf #xf #x10 #x11 #xf #xf #xf #x12 #x0 #x0 #xf #x14 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #xf #xf #x10 #x11 #xf #xf #xf #x12 #x0 #x0 #xf #x14 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #xffff #xffff #xffff #xffff #xffff #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #xffff #xffff #xffff #xffff #xffff #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x16 #xffff #xffff #x0 #x0 #x1d #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x0 #x16 #xffff #xffff #x0 #x0 #x1d #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x17 #x18 #x19 #x1a #x0 #x0 #x1e #x1f #x0 #x0 #x0 #x22 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x17 #x18 #x19 #x1a #x0 #x0 #x1e #x1f #x0 #x0 #x0 #x22 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #xffff #x1b #x1c #x0 #x20 #x21 #x0 #x0 #x0 #x0 #x0 #x0 #x23 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #xffff #x1b #x1c #x0 #x20 #x21 #x0 #x0 #x0 #x0 #x0 #x0 #x23 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #xffff #xffff @@ -8923,24 +8832,19 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x0 #x25 #x2a #x2b #x2c #x2d #xffff #x33 #x0 #x34 #xffff #x38 #x39 #x3a) + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x25 #x2a #x2b #x2c #x2d #xffff #x33 #x0 #x34 #xffff #x38 #x39 #x3a) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x26 #x27 #x0 #x2e #x2f #x30 #x0 #xffff #x35 #x36 #x0 #x3b #x3c #x6 #x0) + :data (new 'static 'array uint16 16 #x0 #x26 #x27 #x0 #x2e #x2f #x30 #x0 #xffff #x35 #x36 #x0 #x3b #x3c #x6 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x0 #x0 #x0 #x28 #x0 #x0 #x31 #x32 #x0 #x0 #x37 #x0 #x0 #x0 #x3d #x0) + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x28 #x0 #x0 #x31 #x32 #x0 #x0 #x37 #x0 #x0 #x0 #x3d #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x29 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #x29 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #xffff #x3e #x3f @@ -8960,12 +8864,10 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #x41 #x0 #x0 #x0 #x0 #x0 #x0 #x43 #x4a #x4b #x0 #x4c #x4e #x4f #x50 #x51) + :data (new 'static 'array uint16 16 #x41 #x0 #x0 #x0 #x0 #x0 #x0 #x43 #x4a #x4b #x0 #x4c #x4e #x4f #x50 #x51) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x0 #x0 #x0 @@ -8985,8 +8887,7 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 + :data (new 'static 'array uint16 16 #x53 #x54 #xffff @@ -9006,16 +8907,14 @@ ) ) (new 'static 'ocean-near-index - :data - (new 'static 'array uint16 16 #xffff #xffff #x0 #x0 #xffff #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :data (new 'static 'array uint16 16 #xffff #xffff #x0 #x0 #xffff #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) ) ) ) ;; definition for symbol *ocean-trans-indices-village2*, type ocean-trans-indices -(define - *ocean-trans-indices-village2* +(define *ocean-trans-indices-village2* (new 'static 'ocean-trans-indices :data (new 'static 'inline-array ocean-trans-index 2304 (new 'static 'ocean-trans-index :parent -1 :child -1) (new 'static 'ocean-trans-index :parent -1 :child -1) @@ -11368,11 +11267,9 @@ ) ;; definition for symbol *ocean-mid-masks-village2*, type ocean-mid-masks -(define - *ocean-mid-masks-village2* +(define *ocean-mid-masks-village2* (new 'static 'ocean-mid-masks - :data - (new 'static 'inline-array ocean-mid-mask 102 + :data (new 'static 'inline-array ocean-mid-mask 102 (new 'static 'ocean-mid-mask) (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfe #xff #xff #xff #xff #xff #xff #xff)) (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xff #xff #xff #xff #x7f)) @@ -11480,11 +11377,9 @@ ) ;; definition for symbol *ocean-near-indices-sunken*, type ocean-near-indices -(define - *ocean-near-indices-sunken* +(define *ocean-near-indices-sunken* (new 'static 'ocean-near-indices - :data - (new 'static 'inline-array ocean-near-index 1 (new 'static 'ocean-near-index)) + :data (new 'static 'inline-array ocean-near-index 1 (new 'static 'ocean-near-index)) ) ) @@ -11495,20 +11390,16 @@ (define *ocean-mid-indices-sunken* (new 'static 'ocean-mid-indices)) ;; definition for symbol *ocean-mid-masks-sunken*, type ocean-mid-masks -(define - *ocean-mid-masks-sunken* +(define *ocean-mid-masks-sunken* (new 'static 'ocean-mid-masks - :data - (new 'static 'inline-array ocean-mid-mask 2 (new 'static 'ocean-mid-mask) (new 'static 'ocean-mid-mask)) + :data (new 'static 'inline-array ocean-mid-mask 2 (new 'static 'ocean-mid-mask) (new 'static 'ocean-mid-mask)) ) ) ;; definition for symbol *ocean-map-village1*, type ocean-map (define *ocean-map-village1* (new 'static 'ocean-map - :start-corner - (new 'static 'vector :x -9437184.0 :z -9437184.0 :w 1.0) - :far-color - (new 'static 'vector :x 1.505882 :y 45.678432 :z 56.72157) + :start-corner (new 'static 'vector :x -9437184.0 :z -9437184.0 :w 1.0) + :far-color (new 'static 'vector :x 1.505882 :y 45.678432 :z 56.72157) ) ) @@ -11532,10 +11423,8 @@ ;; definition for symbol *ocean-map-village2*, type ocean-map (define *ocean-map-village2* (new 'static 'ocean-map - :start-corner - (new 'static 'vector :x -7892992.0 :z -15958016.0 :w 1.0) - :far-color - (new 'static 'vector :x 31.62353 :y 50.19608 :z 66.76079) + :start-corner (new 'static 'vector :x -7892992.0 :z -15958016.0 :w 1.0) + :far-color (new 'static 'vector :x 31.62353 :y 50.19608 :z 66.76079) ) ) @@ -11559,10 +11448,8 @@ ;; definition for symbol *ocean-map-sunken*, type ocean-map (define *ocean-map-sunken* (new 'static 'ocean-map - :start-corner - (new 'static 'vector :x -7892992.0 :z -15958016.0 :w 1.0) - :far-color - (new 'static 'vector :x 31.62353 :y 50.19608 :z 66.76079) + :start-corner (new 'static 'vector :x -7892992.0 :z -15958016.0 :w 1.0) + :far-color (new 'static 'vector :x 31.62353 :y 50.19608 :z 66.76079) ) ) @@ -11583,7 +11470,3 @@ ;; failed to figure out what this is: (set! (-> *ocean-map-sunken* ocean-near-indices) *ocean-near-indices-sunken*) - - - - diff --git a/test/decompiler/reference/engine/gfx/ocean/ocean-texture_REF.gc b/test/decompiler/reference/engine/gfx/ocean/ocean-texture_REF.gc index fb4b80657c..3e7adfc0ea 100644 --- a/test/decompiler/reference/engine/gfx/ocean/ocean-texture_REF.gc +++ b/test/decompiler/reference/engine/gfx/ocean/ocean-texture_REF.gc @@ -3,41 +3,26 @@ ;; definition for symbol *ocean-texture-work*, type ocean-texture-work (define *ocean-texture-work* (new 'static 'ocean-texture-work - :sprite-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + :sprite-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x508b400000008001 #x53531) + :gif (new 'static 'array uint64 2 #x508b400000008001 #x53531) ) - :sprite-tmpl2 - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1) + :sprite-tmpl2 (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x3023400000008001 #x551) + :gif (new 'static 'array uint64 2 #x3023400000008001 #x551) ) - :adgif-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + :adgif-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x1000000000008005 #xe) + :gif (new 'static 'array uint64 2 #x1000000000008005 #xe) ) ) ) diff --git a/test/decompiler/reference/engine/gfx/ocean/ocean-vu0_REF.gc b/test/decompiler/reference/engine/gfx/ocean/ocean-vu0_REF.gc index 28ea0b2159..cd8f97eb9a 100644 --- a/test/decompiler/reference/engine/gfx/ocean/ocean-vu0_REF.gc +++ b/test/decompiler/reference/engine/gfx/ocean/ocean-vu0_REF.gc @@ -3,12 +3,9 @@ ;; definition for symbol *ocean-vu0-work*, type ocean-vu0-work (define *ocean-vu0-work* (new 'static 'ocean-vu0-work - :scales - (new 'static 'vector :x -0.00006975447 :y 255.0 :z -0.00006975447) - :mask-hi - (new 'static 'vector4w :x -65536 :y -65536 :z -65536 :w -65536) - :mask-lo - (new 'static 'vector4w :x #xffff :y #xffff :z #xffff :w #xffff) + :scales (new 'static 'vector :x -0.00006975447 :y 255.0 :z -0.00006975447) + :mask-hi (new 'static 'vector4w :x -65536 :y -65536 :z -65536 :w -65536) + :mask-lo (new 'static 'vector4w :x #xffff :y #xffff :z #xffff :w #xffff) ) ) @@ -20,7 +17,3 @@ ;; definition for function ocean-generate-verts ;; ERROR: function was not converted to expressions. Cannot decompile. - - - - diff --git a/test/decompiler/reference/engine/gfx/ripple_REF.gc b/test/decompiler/reference/engine/gfx/ripple_REF.gc index d6dd9e535f..66da0a07ca 100644 --- a/test/decompiler/reference/engine/gfx/ripple_REF.gc +++ b/test/decompiler/reference/engine/gfx/ripple_REF.gc @@ -144,7 +144,7 @@ ) (set! (-> s5-0 w) 0.0) (vector+! s5-0 s5-0 (-> arg0 root trans)) - (add-debug-sphere #t (bucket-id debug-draw0) s5-0 2048.0 (new 'static 'rgba :r #xff :g #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug) s5-0 2048.0 (new 'static 'rgba :r #xff :g #xff :a #x80)) ) (none) ) diff --git a/test/decompiler/reference/engine/gfx/shadow/shadow-vu1_REF.gc b/test/decompiler/reference/engine/gfx/shadow/shadow-vu1_REF.gc index 194dea0956..8a1d16eca2 100644 --- a/test/decompiler/reference/engine/gfx/shadow/shadow-vu1_REF.gc +++ b/test/decompiler/reference/engine/gfx/shadow/shadow-vu1_REF.gc @@ -65,29 +65,21 @@ ;; definition for symbol *shadow-vu1-tri-template*, type shadow-vu1-gifbuf-template (define *shadow-vu1-tri-template* (new 'static 'shadow-vu1-gifbuf-template - :adgif - (new 'static 'gs-gif-tag - :tag - (new 'static 'gif-tag64 :nloop #x1 :nreg #x1) - :regs - (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)) + :adgif (new 'static 'gs-gif-tag + :tag (new 'static 'gif-tag64 :nloop #x1 :nreg #x1) + :regs (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)) ) - :ad - (new 'static 'ad-cmd :cmd (gs-reg texflush)) - :flush - (new 'static 'ad-cmd :data #x3f80000000000000 :cmd (gs-reg rgbaq)) - :trigif - (new 'static 'gs-gif-tag - :tag - (new 'static 'gif-tag64 + :ad (new 'static 'ad-cmd :cmd (gs-reg texflush)) + :flush (new 'static 'ad-cmd :data #x3f80000000000000 :cmd (gs-reg rgbaq)) + :trigif (new 'static 'gs-gif-tag + :tag (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :pre #x1 :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :tme #x1) :nreg #x7 ) - :regs - (new 'static 'gif-tag-regs + :regs (new 'static 'gif-tag-regs :regs0 (gif-reg-id rgbaq) :regs1 (gif-reg-id st) :regs2 (gif-reg-id xyzf2) @@ -97,18 +89,15 @@ :regs6 (gif-reg-id xyzf2) ) ) - :quadgif - (new 'static 'gs-gif-tag - :tag - (new 'static 'gif-tag64 + :quadgif (new 'static 'gs-gif-tag + :tag (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :pre #x1 :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :tme #x1) :nreg #x9 ) - :regs - (new 'static 'gif-tag-regs + :regs (new 'static 'gif-tag-regs :regs0 (gif-reg-id rgbaq) :regs1 (gif-reg-id st) :regs2 (gif-reg-id xyzf2) diff --git a/test/decompiler/reference/engine/gfx/shadow/shadow_REF.gc b/test/decompiler/reference/engine/gfx/shadow/shadow_REF.gc index 51c49fd558..79a9b79a12 100644 --- a/test/decompiler/reference/engine/gfx/shadow/shadow_REF.gc +++ b/test/decompiler/reference/engine/gfx/shadow/shadow_REF.gc @@ -115,14 +115,31 @@ ;; definition for function find-ground-and-draw-shadow ;; INFO: Return type mismatch int vs none. ;; Used lq/sq -(defun find-ground-and-draw-shadow ((arg0 vector) (arg1 vector) (arg2 float) (arg3 collide-kind) (arg4 process) (arg5 float) (arg6 float)) +(defun find-ground-and-draw-shadow ((arg0 vector) + (arg1 vector) + (arg2 float) + (arg3 collide-kind) + (arg4 process-drawable) + (arg5 float) + (arg6 float) + ) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> arg0 quad)) (new 'stack-no-clear 'vector) (+! (-> s2-0 y) arg5) (let ((s4-0 (new 'stack-no-clear 'collide-tri-result))) (cond - ((>= (fill-and-probe-using-y-probe *collide-cache* s2-0 arg6 arg3 arg4 s4-0 (the-as uint 1)) 0.0) + ((>= (fill-and-probe-using-y-probe + *collide-cache* + s2-0 + arg6 + arg3 + arg4 + s4-0 + (new 'static 'pat-surface :noentity #x1) + ) + 0.0 + ) (if (!= arg2 0.0) (compute-and-draw-shadow s2-0 (-> s4-0 intersect) (-> s4-0 normal) (the-as vector arg2) arg6 (the-as float 0)) ) @@ -146,7 +163,7 @@ ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (defbehavior do-target-shadow target () - (if (and (logtest? (-> self control status) 1) + (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (!= (-> self control unknown-surface00 mode) 'swim) (!= (-> self control unknown-surface00 mode) 'dive) (!= (-> self next-state name) 'target-flop) @@ -169,8 +186,7 @@ ;; failed to figure out what this is: (defpart 362 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-scale-x (meters 0.3)) (sp-rnd-flt spt-rot-z (degrees -180.0) (degrees 360.0) 1.0) diff --git a/test/decompiler/reference/engine/gfx/shrub/shrub-work_REF.gc b/test/decompiler/reference/engine/gfx/shrub/shrub-work_REF.gc index 7f4ff5f4ed..b680a4f300 100644 --- a/test/decompiler/reference/engine/gfx/shrub/shrub-work_REF.gc +++ b/test/decompiler/reference/engine/gfx/shrub/shrub-work_REF.gc @@ -2,11 +2,9 @@ (in-package goal) ;; definition for symbol *instance-shrub-work*, type instance-shrub-work -(define - *instance-shrub-work* +(define *instance-shrub-work* (new 'static 'instance-shrub-work - :matrix-tmpl - (new 'static 'inline-array qword 20 + :matrix-tmpl (new 'static 'inline-array qword 20 (new 'static 'qword :data (new 'static 'array uint32 4 #x10000005 #x0 #x0 #x6c050143)) (new 'static 'qword :data (new 'static 'array uint32 4 #x20000005 #x0 #x0 #x6c050148)) (new 'static 'qword :data (new 'static 'array uint32 4 #x20000005 #x0 #x0 #x6c05014d)) @@ -28,8 +26,7 @@ (new 'static 'qword :data (new 'static 'array uint32 4 #x20000005 #x0 #x0 #x6c05019e)) (new 'static 'qword :data (new 'static 'array uint32 4 #x10000005 #x0 #x0 #x6c0501a3)) ) - :count-tmpl - (new 'static 'inline-array vector4w 20 + :count-tmpl (new 'static 'inline-array vector4w 20 (new 'static 'vector4w :x #x20000000 :z #x60010175 :w 10) (new 'static 'vector4w :x #x20000000 :z #x60010142 :w 1) (new 'static 'vector4w :x #x20000000 :z #x60010142 :w 2) @@ -51,424 +48,246 @@ (new 'static 'vector4w :x #x20000000 :z #x60010175 :w 8) (new 'static 'vector4w :x #x20000000 :z #x60010175 :w 9) ) - :mscalf-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1) + :mscalf-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1) ) - :mscalf-ret-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ret)) - :vif0 - (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1) + :mscalf-ret-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ret)) + :vif0 (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1) ) - :adgif-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id next)) - :vif1 - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + :adgif-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id next)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x1000000000008005 #xe) + :gif (new 'static 'array uint64 2 #x1000000000008005 #xe) ) - :billboard-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #xd :id (dma-tag-id next)) - :vif1 - (new 'static 'vif-tag :imm #xd :cmd (vif-cmd direct) :msk #x1) + :billboard-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xd :id (dma-tag-id next)) + :vif1 (new 'static 'vif-tag :imm #xd :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x303e400000008004 #x412) + :gif (new 'static 'array uint64 2 #x303e400000008004 #x412) ) - :shrub-near-packets - (new 'static 'inline-array shrub-near-packet 6 + :shrub-near-packets (new 'static 'inline-array shrub-near-packet 6 (new 'static 'shrub-near-packet - :matrix-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x345 :num #x6 :cmd (vif-cmd unpack-v4-32)) + :matrix-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x345 :num #x6 :cmd (vif-cmd unpack-v4-32)) ) - :header-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x34c :cmd (vif-cmd unpack-v4-32)) + :header-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x34c :cmd (vif-cmd unpack-v4-32)) ) - :stq-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x9 :cmd (vif-cmd unpack-v2-16)) + :stq-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x9 :cmd (vif-cmd unpack-v2-16)) ) - :color-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x400a :cmd (vif-cmd unpack-v3-8)) + :color-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x400a :cmd (vif-cmd unpack-v3-8)) ) - :vertex-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #xb :cmd (vif-cmd unpack-v3-16)) + :vertex-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #xb :cmd (vif-cmd unpack-v3-16)) ) - :mscal-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) + :mscal-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) ) - :init-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) + :init-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) ) - :init-data - (new 'static 'array uint32 8 #x0 #x0 #x345 #x117 #x0 #x0 #x0 #x1500000c) + :init-data (new 'static 'array uint32 8 #x0 #x0 #x345 #x117 #x0 #x0 #x0 #x1500000c) ) (new 'static 'shrub-near-packet - :matrix-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x363 :num #x6 :cmd (vif-cmd unpack-v4-32)) + :matrix-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x363 :num #x6 :cmd (vif-cmd unpack-v4-32)) ) - :header-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x36a :cmd (vif-cmd unpack-v4-32)) + :header-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x36a :cmd (vif-cmd unpack-v4-32)) ) - :stq-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x120 :cmd (vif-cmd unpack-v2-16)) + :stq-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x120 :cmd (vif-cmd unpack-v2-16)) ) - :color-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x4121 :cmd (vif-cmd unpack-v3-8)) + :color-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x4121 :cmd (vif-cmd unpack-v3-8)) ) - :vertex-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x122 :cmd (vif-cmd unpack-v3-16)) + :vertex-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x122 :cmd (vif-cmd unpack-v3-16)) ) - :mscal-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) + :mscal-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) ) - :init-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) + :init-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) ) - :init-data - (new 'static 'array uint32 8 #x0 #x0 #x363 #x22e #x0 #x0 #x0 #x1500000c) + :init-data (new 'static 'array uint32 8 #x0 #x0 #x363 #x22e #x0 #x0 #x0 #x1500000c) ) (new 'static 'shrub-near-packet - :matrix-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x345 :num #x6 :cmd (vif-cmd unpack-v4-32)) + :matrix-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x345 :num #x6 :cmd (vif-cmd unpack-v4-32)) ) - :header-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x34c :cmd (vif-cmd unpack-v4-32)) + :header-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x34c :cmd (vif-cmd unpack-v4-32)) ) - :stq-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x237 :cmd (vif-cmd unpack-v2-16)) + :stq-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x237 :cmd (vif-cmd unpack-v2-16)) ) - :color-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x4238 :cmd (vif-cmd unpack-v3-8)) + :color-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x4238 :cmd (vif-cmd unpack-v3-8)) ) - :vertex-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x239 :cmd (vif-cmd unpack-v3-16)) + :vertex-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x239 :cmd (vif-cmd unpack-v3-16)) ) - :mscal-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) + :mscal-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) ) - :init-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) + :init-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) ) - :init-data - (new 'static 'array uint32 8 #x0 #x0 #x345 #x0 #x0 #x0 #x0 #x1500000c) + :init-data (new 'static 'array uint32 8 #x0 #x0 #x345 #x0 #x0 #x0 #x0 #x1500000c) ) (new 'static 'shrub-near-packet - :matrix-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x363 :num #x6 :cmd (vif-cmd unpack-v4-32)) + :matrix-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x363 :num #x6 :cmd (vif-cmd unpack-v4-32)) ) - :header-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x36a :cmd (vif-cmd unpack-v4-32)) + :header-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x36a :cmd (vif-cmd unpack-v4-32)) ) - :stq-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x9 :cmd (vif-cmd unpack-v2-16)) + :stq-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x9 :cmd (vif-cmd unpack-v2-16)) ) - :color-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x400a :cmd (vif-cmd unpack-v3-8)) + :color-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x400a :cmd (vif-cmd unpack-v3-8)) ) - :vertex-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #xb :cmd (vif-cmd unpack-v3-16)) + :vertex-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #xb :cmd (vif-cmd unpack-v3-16)) ) - :mscal-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) + :mscal-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) ) - :init-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) + :init-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) ) - :init-data - (new 'static 'array uint32 8 #x0 #x0 #x363 #x117 #x0 #x0 #x0 #x1500000c) + :init-data (new 'static 'array uint32 8 #x0 #x0 #x363 #x117 #x0 #x0 #x0 #x1500000c) ) (new 'static 'shrub-near-packet - :matrix-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x345 :num #x6 :cmd (vif-cmd unpack-v4-32)) + :matrix-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x345 :num #x6 :cmd (vif-cmd unpack-v4-32)) ) - :header-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x34c :cmd (vif-cmd unpack-v4-32)) + :header-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x34c :cmd (vif-cmd unpack-v4-32)) ) - :stq-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x120 :cmd (vif-cmd unpack-v2-16)) + :stq-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x120 :cmd (vif-cmd unpack-v2-16)) ) - :color-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x4121 :cmd (vif-cmd unpack-v3-8)) + :color-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x4121 :cmd (vif-cmd unpack-v3-8)) ) - :vertex-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x122 :cmd (vif-cmd unpack-v3-16)) + :vertex-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x122 :cmd (vif-cmd unpack-v3-16)) ) - :mscal-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) + :mscal-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) ) - :init-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) + :init-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) ) - :init-data - (new 'static 'array uint32 8 #x0 #x0 #x345 #x22e #x0 #x0 #x0 #x1500000c) + :init-data (new 'static 'array uint32 8 #x0 #x0 #x345 #x22e #x0 #x0 #x0 #x1500000c) ) (new 'static 'shrub-near-packet - :matrix-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x363 :num #x6 :cmd (vif-cmd unpack-v4-32)) + :matrix-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x363 :num #x6 :cmd (vif-cmd unpack-v4-32)) ) - :header-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x36a :cmd (vif-cmd unpack-v4-32)) + :header-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x36a :cmd (vif-cmd unpack-v4-32)) ) - :stq-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x237 :cmd (vif-cmd unpack-v2-16)) + :stq-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x103 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x237 :cmd (vif-cmd unpack-v2-16)) ) - :color-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x4238 :cmd (vif-cmd unpack-v3-8)) + :color-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x4238 :cmd (vif-cmd unpack-v3-8)) ) - :vertex-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x239 :cmd (vif-cmd unpack-v3-16)) + :vertex-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x239 :cmd (vif-cmd unpack-v3-16)) ) - :mscal-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) + :mscal-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1) ) - :init-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) + :init-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32)) ) - :init-data - (new 'static 'array uint32 8 #x0 #x0 #x363 #x0 #x0 #x0 #x0 #x1500000c) + :init-data (new 'static 'array uint32 8 #x0 #x0 #x363 #x0 #x0 #x0 #x0 #x1500000c) ) ) - :dma-ref - (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref))) - :dma-end - (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id end))) - :wind-const - (new 'static 'vector :x 0.5 :y 100.0 :z 0.0166 :w -1.0) + :dma-ref (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref))) + :dma-end (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id end))) + :wind-const (new 'static 'vector :x 0.5 :y 100.0 :z 0.0166 :w -1.0) :constants (new 'static 'vector :x 128.0 :y 1.0) - :color-constant - (new 'static 'vector4w :x #x47000000 :y #x47000000 :z #x47000000) - :start-bank - (new 'static 'array uint8 20 #x0 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + :color-constant (new 'static 'vector4w :x #x47000000 :y #x47000000 :z #x47000000) + :start-bank (new 'static 'array uint8 20 #x0 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) ) ) diff --git a/test/decompiler/reference/engine/gfx/sky/sky-tng_REF.gc b/test/decompiler/reference/engine/gfx/sky/sky-tng_REF.gc index a2863e6c62..1b81498e64 100644 --- a/test/decompiler/reference/engine/gfx/sky/sky-tng_REF.gc +++ b/test/decompiler/reference/engine/gfx/sky/sky-tng_REF.gc @@ -3,52 +3,35 @@ ;; definition for symbol *sky-work*, type sky-work (define *sky-work* (new 'static 'sky-work - :adgif-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + :adgif-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x1000000000008005 #xe) + :gif (new 'static 'array uint64 2 #x1000000000008005 #xe) ) - :draw-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + :draw-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x508b400000008001 #x43431) + :gif (new 'static 'array uint64 2 #x508b400000008001 #x43431) ) - :blend-tmpl - (new 'static 'dma-gif-packet - :dma-vif - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + :blend-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) ) - :gif - (new 'static 'array uint64 2 #x50ab400000008001 #x43431) + :gif (new 'static 'array uint64 2 #x50ab400000008001 #x43431) ) - :sky-data - (new 'static 'inline-array qword 5 + :sky-data (new 'static 'inline-array qword 5 (new 'static 'qword :data (new 'static 'array uint32 4 #x0 #x0 #x0 #x80)) (new 'static 'qword) (new 'static 'qword :data (new 'static 'array uint32 4 #x0 #x0 #xffffff #x0)) (new 'static 'qword :data (new 'static 'array uint32 4 #x200 #x200 #x0 #x0)) (new 'static 'qword :data (new 'static 'array uint32 4 #x200 #x200 #xffffff #x0)) ) - :cloud-data - (new 'static 'inline-array qword 5 + :cloud-data (new 'static 'inline-array qword 5 (new 'static 'qword :data (new 'static 'array uint32 4 #x0 #x0 #x0 #x80)) (new 'static 'qword) (new 'static 'qword :data (new 'static 'array uint32 4 #x0 #x200 #xffffff #x0)) @@ -189,63 +172,51 @@ (define sky-base-polygons (new 'static 'inline-array sky-vertex 12 (new 'static 'sky-vertex :pos (new 'static 'vector :z -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :x 40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :y -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :x 40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :z 40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :y -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :z 40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :x -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :y -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :x -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :z -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :y -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) ) ) ) @@ -255,80 +226,62 @@ (new 'static 'sky-vertex :pos (new 'static 'vector :z -40960000.0) :stq (new 'static 'vector :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :x 40960000.0) :stq (new 'static 'vector :x 1.0 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :y 10240000.0) - :stq - (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + :stq (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :x 40960000.0) :stq (new 'static 'vector :x 1.0 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :z 40960000.0) - :stq - (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + :stq (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :y 10240000.0) - :stq - (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + :stq (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :z 40960000.0) - :stq - (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + :stq (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :x -40960000.0) :stq (new 'static 'vector :y 1.0 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :y 10240000.0) - :stq - (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + :stq (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :x -40960000.0) :stq (new 'static 'vector :y 1.0 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :z -40960000.0) :stq (new 'static 'vector :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) ) (new 'static 'sky-vertex :pos (new 'static 'vector :y 10240000.0) - :stq - (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + :stq (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) ) ) ) diff --git a/test/decompiler/reference/engine/gfx/texture-h_REF.gc b/test/decompiler/reference/engine/gfx/texture-h_REF.gc index 560c642ad6..38e9757701 100644 --- a/test/decompiler/reference/engine/gfx/texture-h_REF.gc +++ b/test/decompiler/reference/engine/gfx/texture-h_REF.gc @@ -70,9 +70,9 @@ (add-tex-to-dma! (_type_ level int) none 14) (allocate-vram-words! (_type_ int) int 15) (allocate-segment! (_type_ texture-pool-segment int) texture-pool-segment 16) - (dummy-17 () none 17) - (dummy-18 () none 18) - (dummy-19 () none 19) + (unused-17 () none 17) + (unused-18 () none 18) + (unused-19 () none 19) (unload! (_type_ texture-page) int 20) (upload-one-common! (_type_ level) symbol 21) (lookup-boot-common-id (_type_ int) int 22) @@ -187,7 +187,7 @@ (relocate (_type_ kheap (pointer uint8)) none :replace 7) (remove-from-heap (_type_ kheap) _type_ 9) (get-leftover-block-count (_type_ int int) int 10) - (dummy-11 () none 11) + (unused-11 () none 11) (relocate-dests! (_type_ int int) none 12) (add-to-dma-buffer (_type_ dma-buffer int) int 13) (upload-now! (_type_ int) none 14) diff --git a/test/decompiler/reference/engine/gfx/texture_REF.gc b/test/decompiler/reference/engine/gfx/texture_REF.gc index a885914237..7300c860b3 100644 --- a/test/decompiler/reference/engine/gfx/texture_REF.gc +++ b/test/decompiler/reference/engine/gfx/texture_REF.gc @@ -144,10 +144,7 @@ ) ;; definition for symbol ct32-24-block-table, type (array int32) -(define ct32-24-block-table (the-as (array int32) (new - 'static - 'boxed-array - :type int32 :length 32 :allocated-length 32 +(define ct32-24-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 0 1 4 @@ -185,10 +182,7 @@ ) ;; definition for symbol mz32-24-block-table, type (array int32) -(define mz32-24-block-table (the-as (array int32) (new - 'static - 'boxed-array - :type int32 :length 32 :allocated-length 32 +(define mz32-24-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 16 17 20 @@ -226,10 +220,7 @@ ) ;; definition for symbol ct16-block-table, type (array int32) -(define ct16-block-table (the-as (array int32) (new - 'static - 'boxed-array - :type int32 :length 32 :allocated-length 32 +(define ct16-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 0 2 8 @@ -267,10 +258,7 @@ ) ;; definition for symbol ct16s-block-table, type (array int32) -(define ct16s-block-table (the-as (array int32) (new - 'static - 'boxed-array - :type int32 :length 32 :allocated-length 32 +(define ct16s-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 0 2 16 @@ -308,10 +296,7 @@ ) ;; definition for symbol mz16-block-table, type (array int32) -(define mz16-block-table (the-as (array int32) (new - 'static - 'boxed-array - :type int32 :length 32 :allocated-length 32 +(define mz16-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 16 18 24 @@ -349,10 +334,7 @@ ) ;; definition for symbol mz16s-block-table, type (array int32) -(define mz16s-block-table (the-as (array int32) (new - 'static - 'boxed-array - :type int32 :length 32 :allocated-length 32 +(define mz16s-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 16 18 0 @@ -390,10 +372,7 @@ ) ;; definition for symbol mt8-block-table, type (array int32) -(define mt8-block-table (the-as (array int32) (new - 'static - 'boxed-array - :type int32 :length 32 :allocated-length 32 +(define mt8-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 0 1 4 @@ -431,10 +410,7 @@ ) ;; definition for symbol mt4-block-table, type (array int32) -(define mt4-block-table (the-as (array int32) (new - 'static - 'boxed-array - :type int32 :length 32 :allocated-length 32 +(define mt4-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 0 2 8 @@ -1603,7 +1579,7 @@ (dotimes (v1-0 32) (let ((a2-0 (-> obj common-page v1-0))) (when (and (nonzero? a2-0) (logtest? (-> obj common-page-mask) (ash 1 v1-0))) - (upload-vram-pages obj (-> obj segment-common) a2-0 -2 (bucket-id pre-sprite-textures)) + (upload-vram-pages obj (-> obj segment-common) a2-0 -2 (bucket-id common-page-tex)) (return #f) ) ) @@ -2506,8 +2482,7 @@ (b! (< (the-as int (- (the-as uint shader) (the-as uint mem-start))) 0) cfg-7 - :delay - (set! dist-past-end (- (the-as uint shader) mem-end)) + :delay (set! dist-past-end (- (the-as uint shader) mem-end)) ) (b! (>= (the-as int dist-past-end) 0) cfg-7 :delay (nop!)) (let ((t4-2 (-> shader next))) diff --git a/test/decompiler/reference/engine/gfx/tfrag/tfrag-methods_REF.gc b/test/decompiler/reference/engine/gfx/tfrag/tfrag-methods_REF.gc index 2f47ddb2be..760a484ebb 100644 --- a/test/decompiler/reference/engine/gfx/tfrag/tfrag-methods_REF.gc +++ b/test/decompiler/reference/engine/gfx/tfrag/tfrag-methods_REF.gc @@ -11,7 +11,7 @@ (dotimes (s3-0 (/ (-> s4-0 length) 2)) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s4-0 data (* s3-0 2)) (-> s4-0 data (+ (* s3-0 2) 1)) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) @@ -284,7 +284,7 @@ ;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1] (defun draw-drawable-tree-trans-tfrag ((arg0 drawable-tree-trans-tfrag)) (local-vars (a0-18 int) (a0-20 int) (a0-35 int) (a0-37 int) (sv-16 (pointer uint8))) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (let ((s5-0 (+ (-> arg0 length) -1))) (when (nonzero? s5-0) (dotimes (s4-0 s5-0) @@ -497,7 +497,7 @@ ;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1] (defun draw-drawable-tree-dirt-tfrag ((arg0 drawable-tree-dirt-tfrag)) (local-vars (a0-18 int) (a0-20 int) (a0-35 int) (a0-37 int) (sv-16 (pointer uint8))) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (let ((s5-0 (+ (-> arg0 length) -1))) (when (nonzero? s5-0) (dotimes (s4-0 s5-0) @@ -692,7 +692,7 @@ ;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1] (defun draw-drawable-tree-ice-tfrag ((arg0 drawable-tree-ice-tfrag)) (local-vars (a0-18 int) (a0-20 int) (a0-35 int) (a0-37 int) (sv-16 (pointer uint8))) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (let ((s5-0 (+ (-> arg0 length) -1))) (when (nonzero? s5-0) (dotimes (s4-0 s5-0) @@ -993,12 +993,12 @@ ;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none. ;; Used lq/sq (defmethod collect-stats drawable-tree-trans-tfrag ((obj drawable-tree-trans-tfrag)) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) - (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag))) + (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) ) (set! (-> *tfrag-work* vu1-enable-tfrag-near) - (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag))) + (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) ) (set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* trans-tfrag)) (set! (-> *tfrag-work* tr-stat-tfrag-near) (-> *terrain-stats* trans-tfrag-near)) @@ -1016,12 +1016,12 @@ ;; INFO: Return type mismatch drawable-tree-lowres-trans-tfrag vs none. ;; Used lq/sq (defmethod collect-stats drawable-tree-lowres-trans-tfrag ((obj drawable-tree-lowres-trans-tfrag)) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) - (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag))) + (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) ) (set! (-> *tfrag-work* vu1-enable-tfrag-near) - (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag))) + (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) ) (set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* trans-tfrag)) (set! (-> *tfrag-work* tr-stat-tfrag-near) (-> *terrain-stats* trans-tfrag-near)) @@ -1039,12 +1039,12 @@ ;; INFO: Return type mismatch drawable-tree-dirt-tfrag vs none. ;; Used lq/sq (defmethod collect-stats drawable-tree-dirt-tfrag ((obj drawable-tree-dirt-tfrag)) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) - (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag))) + (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) ) (set! (-> *tfrag-work* vu1-enable-tfrag-near) - (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag))) + (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) ) (set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* trans-tfrag)) (set! (-> *tfrag-work* tr-stat-tfrag-near) (-> *terrain-stats* trans-tfrag-near)) @@ -1062,12 +1062,12 @@ ;; INFO: Return type mismatch drawable-tree-ice-tfrag vs none. ;; Used lq/sq (defmethod collect-stats drawable-tree-ice-tfrag ((obj drawable-tree-ice-tfrag)) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) - (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag))) + (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) ) (set! (-> *tfrag-work* vu1-enable-tfrag-near) - (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-frag))) + (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) ) (set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* trans-tfrag)) (set! (-> *tfrag-work* tr-stat-tfrag-near) (-> *terrain-stats* trans-tfrag-near)) @@ -1099,7 +1099,7 @@ ;; definition for method 14 of type drawable-inline-array-trans-tfrag ;; INFO: Return type mismatch drawable-inline-array-trans-tfrag vs none. (defmethod collect-stats drawable-inline-array-trans-tfrag ((obj drawable-inline-array-trans-tfrag)) - (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag)) + (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (dotimes (s5-0 (-> obj length)) (let ((s4-0 (-> obj data s5-0))) (if (vis-cull (-> s4-0 id)) diff --git a/test/decompiler/reference/engine/gfx/tfrag/tfrag-work_REF.gc b/test/decompiler/reference/engine/gfx/tfrag/tfrag-work_REF.gc index 70effb6172..11b44df13a 100644 --- a/test/decompiler/reference/engine/gfx/tfrag/tfrag-work_REF.gc +++ b/test/decompiler/reference/engine/gfx/tfrag/tfrag-work_REF.gc @@ -3,42 +3,26 @@ ;; definition for symbol *tfrag-work*, type tfrag-work (define *tfrag-work* (new 'static 'tfrag-work - :base-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :base-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) ) - :level-0-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :level-0-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) ) - :common-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :common-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) ) - :level-1-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) + :level-1-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) ) - :color-tmpl - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :imm #x102 :cmd (vif-cmd stcycl)) - :vif1 - (new 'static 'vif-tag :imm #xc000 :cmd (vif-cmd unpack-v4-8)) + :color-tmpl (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :imm #x102 :cmd (vif-cmd stcycl)) + :vif1 (new 'static 'vif-tag :imm #xc000 :cmd (vif-cmd unpack-v4-8)) ) :max-dist (new 'static 'vector :z 4095996000.0) ) diff --git a/test/decompiler/reference/engine/gfx/tie/tie-methods_REF.gc b/test/decompiler/reference/engine/gfx/tie/tie-methods_REF.gc index 05364a1195..4f20b69213 100644 --- a/test/decompiler/reference/engine/gfx/tie/tie-methods_REF.gc +++ b/test/decompiler/reference/engine/gfx/tie/tie-methods_REF.gc @@ -391,7 +391,7 @@ (let ((t9-2 draw-inline-array-instance-tie) (a3-1 s3-1) ) - (t9-2 s0-0 (the-as drawable s1-0) sv-16 a3-1) + (t9-2 s0-0 s1-0 sv-16 a3-1) ) (let ((v1-35 (-> *perf-stats* data 9))) (b! (zero? (-> v1-35 ctrl)) cfg-14 :delay (nop!)) diff --git a/test/decompiler/reference/engine/gfx/tie/tie-near_REF.gc b/test/decompiler/reference/engine/gfx/tie/tie-near_REF.gc index 433fa50812..94420e3ef8 100644 --- a/test/decompiler/reference/engine/gfx/tie/tie-near_REF.gc +++ b/test/decompiler/reference/engine/gfx/tie/tie-near_REF.gc @@ -418,7 +418,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/engine/gfx/tie/tie-work_REF.gc b/test/decompiler/reference/engine/gfx/tie/tie-work_REF.gc index 16653940e1..44f93abf18 100644 --- a/test/decompiler/reference/engine/gfx/tie/tie-work_REF.gc +++ b/test/decompiler/reference/engine/gfx/tie/tie-work_REF.gc @@ -3,51 +3,32 @@ ;; definition for symbol *instance-tie-work*, type instance-tie-work (define *instance-tie-work* (new 'static 'instance-tie-work - :wind-const - (new 'static 'vector :x 0.5 :y 100.0 :z 0.0166 :w -1.0) - :constant - (new 'static 'vector :x 4096.0 :y 128.0) + :wind-const (new 'static 'vector :x 0.5 :y 100.0 :z 0.0166 :w -1.0) + :constant (new 'static 'vector :x 4096.0 :y 128.0) :far-morph (new 'static 'vector :x 1.0 :w 256.0) - :upload-color-0 - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x80c6 :num #x6 :cmd (vif-cmd unpack-v4-32)) + :upload-color-0 (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x80c6 :num #x6 :cmd (vif-cmd unpack-v4-32)) ) - :upload-color-1 - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :cmd (vif-cmd stmod)) - :vif1 - (new 'static 'vif-tag :imm #xc0cc :cmd (vif-cmd unpack-v4-8)) + :upload-color-1 (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod)) + :vif1 (new 'static 'vif-tag :imm #xc0cc :cmd (vif-cmd unpack-v4-8)) ) - :upload-color-2 - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id next)) - :vif0 - (new 'static 'vif-tag :cmd (vif-cmd stmod)) + :upload-color-2 (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id next)) + :vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod)) ) - :upload-color-ret - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ret)) - :vif0 - (new 'static 'vif-tag :cmd (vif-cmd stmod)) + :upload-color-ret (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ret)) + :vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod)) ) - :generic-color-0 - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id ref)) + :generic-color-0 (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id ref)) :vif0 (new 'static 'vif-tag :imm #x3) ) - :generic-color-1 - (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref))) - :generic-color-end - (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id end))) + :generic-color-1 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref))) + :generic-color-end (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id end))) :refl-fade-fac -0.000625 :refl-fade-end 409600.0 ) @@ -61,103 +42,62 @@ ;; definition for symbol *prototype-tie-work*, type prototype-tie-work (define *prototype-tie-work* (new 'static 'prototype-tie-work - :upload-palette-0 - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1) + :upload-palette-0 (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1) ) - :upload-palette-1 - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x20 :id (dma-tag-id cnt)) - :vif0 - (new 'static 'vif-tag :imm #x1 :cmd (vif-cmd stmod)) - :vif1 - (new 'static 'vif-tag :imm #x4346 :num #x80 :cmd (vif-cmd unpack-v4-8)) + :upload-palette-1 (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x20 :id (dma-tag-id cnt)) + :vif0 (new 'static 'vif-tag :imm #x1 :cmd (vif-cmd stmod)) + :vif1 (new 'static 'vif-tag :imm #x4346 :num #x80 :cmd (vif-cmd unpack-v4-8)) ) - :upload-model-0 - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :cmd (vif-cmd stmod)) - :vif1 - (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32)) + :upload-model-0 (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod)) + :vif1 (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32)) ) - :upload-model-1 - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x4000 :cmd (vif-cmd unpack-v4-8)) + :upload-model-1 (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x4000 :cmd (vif-cmd unpack-v4-8)) ) - :upload-model-2 - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x32 :cmd (vif-cmd unpack-v4-16)) + :upload-model-2 (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x32 :cmd (vif-cmd unpack-v4-16)) ) - :upload-model-3 - (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id call))) - :upload-model-near-0 - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif0 - (new 'static 'vif-tag :cmd (vif-cmd stmod)) - :vif1 - (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32)) + :upload-model-3 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id call))) + :upload-model-near-0 (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod)) + :vif1 (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32)) ) - :upload-model-near-1 - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x4000 :cmd (vif-cmd unpack-v4-8)) + :upload-model-near-1 (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x4000 :cmd (vif-cmd unpack-v4-8)) ) - :upload-model-near-2 - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x1e :cmd (vif-cmd unpack-v4-8)) + :upload-model-near-2 (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x1e :cmd (vif-cmd unpack-v4-8)) ) - :upload-model-near-3 - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) - :vif1 - (new 'static 'vif-tag :imm #x32 :cmd (vif-cmd unpack-v4-16)) + :upload-model-near-3 (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) + :vif1 (new 'static 'vif-tag :imm #x32 :cmd (vif-cmd unpack-v4-16)) ) - :upload-model-near-4 - (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id call))) - :generic-envmap-shader - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id ref)) + :upload-model-near-4 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id call))) + :generic-envmap-shader (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id ref)) :vif0 (new 'static 'vif-tag :imm #x1) ) - :generic-palette - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :qwc #x20 :id (dma-tag-id cnt)) + :generic-palette (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x20 :id (dma-tag-id cnt)) :vif0 (new 'static 'vif-tag :imm #x1) ) - :generic-model-0 - (new 'static 'dma-packet - :dma - (new 'static 'dma-tag :id (dma-tag-id ref)) + :generic-model-0 (new 'static 'dma-packet + :dma (new 'static 'dma-tag :id (dma-tag-id ref)) :vif0 (new 'static 'vif-tag :imm #x2) ) - :generic-model-1 - (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref))) - :generic-model-2 - (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref))) - :generic-model-next - (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id next))) + :generic-model-1 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref))) + :generic-model-2 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref))) + :generic-model-next (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id next))) :clamp #x8000ff00ff00ff ) ) diff --git a/test/decompiler/reference/engine/gfx/time-of-day_REF.gc b/test/decompiler/reference/engine/gfx/time-of-day_REF.gc index 9525f7e8e1..61e5439354 100644 --- a/test/decompiler/reference/engine/gfx/time-of-day_REF.gc +++ b/test/decompiler/reference/engine/gfx/time-of-day_REF.gc @@ -80,9 +80,8 @@ ;; failed to figure out what this is: (defstate time-of-day-tick (time-of-day-proc) - :code - (behavior () - (while #t + :code (behavior () + (loop (+! (-> self frame) (the int (* (-> self time-ratio) (-> *display* time-adjust-ratio)))) (when (>= (-> self frame) 300) (while (>= (-> self frame) 300) @@ -138,8 +137,7 @@ ) (none) ) - :post - time-of-day-update + :post time-of-day-update ) ;; definition for function init-time-of-day @@ -171,19 +169,7 @@ ;; INFO: Return type mismatch (pointer process) vs none. (defun start-time-of-day () (kill-by-name 'time-of-day-proc *active-pool*) - (let ((gp-0 (get-process *default-dead-pool* time-of-day-proc #x4000))) - (set! *time-of-day-proc* - (the-as (pointer time-of-day-proc) - (when gp-0 - (let ((t9-2 (method-of-type time-of-day-proc activate))) - (t9-2 (the-as time-of-day-proc gp-0) *default-pool* 'time-of-day-proc (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 init-time-of-day) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! *time-of-day-proc* (process-spawn time-of-day-proc :init init-time-of-day)) (none) ) diff --git a/test/decompiler/reference/engine/gfx/water/water-h_REF.gc b/test/decompiler/reference/engine/gfx/water/water-h_REF.gc index 5fd6e2d09e..7ea656adf6 100644 --- a/test/decompiler/reference/engine/gfx/water/water-h_REF.gc +++ b/test/decompiler/reference/engine/gfx/water/water-h_REF.gc @@ -3,7 +3,7 @@ ;; definition of type water-control (deftype water-control (basic) - ((flags uint32 :offset-assert 4) + ((flags water-flags :offset-assert 4) (process process-drawable :offset-assert 8) (joint-index int32 :offset-assert 12) (top-y-offset float :offset-assert 16) @@ -96,7 +96,7 @@ ;; definition for method 14 of type water-control (defmethod display-water-marks? water-control ((obj water-control)) - (and *display-water-marks* (logtest? (-> obj flags) 1)) + (and *display-water-marks* (logtest? (-> obj flags) (water-flags wt00))) ) ;; definition for method 0 of type water-control @@ -122,13 +122,13 @@ ;; definition of type water-vol (deftype water-vol (process-drawable) - ((water-height meters :offset-assert 176) - (wade-height meters :offset-assert 180) - (swim-height meters :offset-assert 184) - (bottom-height meters :offset-assert 188) - (attack-event symbol :offset-assert 192) - (target handle :offset-assert 200) - (flags uint32 :offset-assert 208) + ((water-height meters :offset-assert 176) + (wade-height meters :offset-assert 180) + (swim-height meters :offset-assert 184) + (bottom-height meters :offset-assert 188) + (attack-event symbol :offset-assert 192) + (target handle :offset-assert 200) + (flags water-flags :offset-assert 208) ) :heap-base #x70 :method-count-assert 30 @@ -140,11 +140,11 @@ (TODO-RENAME-22 (_type_) none 22) (reset-root! (_type_) none 23) (set-stack-size! (_type_) none 24) - (TODO-RENAME-25 (_type_) object 25) + (TODO-RENAME-25 (_type_) none 25) (TODO-RENAME-26 (_type_) none 26) (dummy-27 (_type_) none 27) (get-ripple-height (_type_ vector) float 28) - (TODO-RENAME-29 (_type_) uint 29) + (TODO-RENAME-29 (_type_) none 29) ) ) diff --git a/test/decompiler/reference/engine/gfx/water/water_REF.gc b/test/decompiler/reference/engine/gfx/water/water_REF.gc index b1566cb7d3..65420bf0a5 100644 --- a/test/decompiler/reference/engine/gfx/water/water_REF.gc +++ b/test/decompiler/reference/engine/gfx/water/water_REF.gc @@ -3,8 +3,7 @@ ;; failed to figure out what this is: (defpart 108 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 360.0) 1.0) @@ -24,8 +23,7 @@ ;; failed to figure out what this is: (defpart 109 - :init-specs - ((sp-flt spt-fade-a -0.2)) + :init-specs ((sp-flt spt-fade-a -0.2)) ) ;; definition for function birth-func-y->userdata @@ -51,7 +49,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! s5-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 (the-as symbol s5-0)) + (sound-play "water-drop" :position (the-as symbol s5-0)) (sp-launch-particles-var *sp-particle-system-3d* (-> *part-id-table* 108) @@ -84,8 +82,7 @@ ;; failed to figure out what this is: (defpart 110 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.05) (meters 0.1) 1.0) @@ -110,8 +107,7 @@ ;; failed to figure out what this is: (defpart 111 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-flt spt-y (meters 0.15)) @@ -136,8 +132,7 @@ ;; failed to figure out what this is: (defpart 112 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) @@ -160,20 +155,17 @@ ;; failed to figure out what this is: (defpart 113 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 114)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 114)) ) ;; failed to figure out what this is: (defpart 114 - :init-specs - ((sp-flt spt-fade-a -0.7111111)) + :init-specs ((sp-flt spt-fade-a -0.7111111)) ) ;; failed to figure out what this is: (defpart 115 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-rnd-flt spt-num 0.04 0.03 1.0) (sp-rnd-flt spt-x (meters -0.2) (meters 0.4) 1.0) (sp-rnd-flt spt-z (meters -0.2) (meters 0.4) 1.0) @@ -196,8 +188,7 @@ ;; failed to figure out what this is: (defpart 116 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.006666667)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.006666667)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a 0.0) (sp-int spt-next-time 150) @@ -207,14 +198,12 @@ ;; failed to figure out what this is: (defpart 117 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.005)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.32)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.005)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.32)) ) ;; failed to figure out what this is: (defpart 118 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-x (meters 10)) (sp-rnd-flt spt-scale-x (meters 0.75) (meters 1.5) 1.0) @@ -239,20 +228,17 @@ ;; failed to figure out what this is: (defpart 119 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 90 119 1) (sp-launcher-by-id spt-next-launcher 120)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 90 119 1) (sp-launcher-by-id spt-next-launcher 120)) ) ;; failed to figure out what this is: (defpart 120 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: (defpart 121 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-rnd-flt spt-num 0.05 0.4 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-z (meters 0.5) (meters 1.5) 1.0) @@ -276,14 +262,12 @@ ;; failed to figure out what this is: (defpart 122 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 123)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 123)) ) ;; failed to figure out what this is: (defpart 123 - :init-specs - ((sp-flt spt-fade-a -0.7111111)) + :init-specs ((sp-flt spt-fade-a -0.7111111)) ) ;; failed to figure out what this is: @@ -292,8 +276,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 124 :flags (is-3d) :period 900 :length 63) + :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) (sp-item 125 :period 900 :length 15) (sp-item 126 :flags (is-3d) :period 900 :length 15) (sp-item 127 :flags (is-3d) :period 900 :length 15) @@ -332,8 +315,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 124 :flags (is-3d) :period 900 :length 63) + :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) (sp-item 125 :period 900 :length 15) (sp-item 126 :flags (is-3d) :period 900 :length 15) (sp-item 127 :flags (is-3d) :period 900 :length 15) @@ -354,8 +336,7 @@ ;; failed to figure out what this is: (defpart 129 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.2) (meters 0.4) 1.0) (sp-rnd-flt spt-y (meters -0.2) (meters 0.4) 1.0) @@ -377,8 +358,7 @@ ;; failed to figure out what this is: (defpart 133 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.2) (meters 0.4) 1.0) (sp-rnd-flt spt-y (meters -0.2) (meters 0.4) 1.0) @@ -400,8 +380,7 @@ ;; failed to figure out what this is: (defpart 131 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.3) (sp-rnd-flt spt-scale-x (meters 0.080000006) (meters 0.32000002) 1.0) (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 360.0) 1.0) @@ -422,8 +401,7 @@ ;; failed to figure out what this is: (defpart 132 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 3.2) (sp-rnd-flt spt-x (meters -0.2) (meters 0.4) 1.0) (sp-rnd-flt spt-y (meters -0.2) (meters 0.4) 1.0) @@ -450,8 +428,7 @@ ;; failed to figure out what this is: (defpart 130 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x10 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x10 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.24000001) (meters 0.71999997) 1.0) (sp-flt spt-rot-x 16384.0) @@ -472,8 +449,7 @@ ;; failed to figure out what this is: (defpart 136 - :init-specs - ((sp-flt spt-scalevel-y (meters 0.026666667)) + :init-specs ((sp-flt spt-scalevel-y (meters 0.026666667)) (sp-int spt-next-time 20) (sp-launcher-by-id spt-next-launcher 137) ) @@ -481,8 +457,7 @@ ;; failed to figure out what this is: (defpart 137 - :init-specs - ((sp-flt spt-scalevel-y (meters 0)) + :init-specs ((sp-flt spt-scalevel-y (meters 0)) (sp-flt spt-fade-a -0.64) (sp-int spt-next-time 20) (sp-launcher-by-id spt-next-launcher 138) @@ -491,8 +466,7 @@ ;; failed to figure out what this is: (defpart 138 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.0016666667)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.0016666667)) (sp-flt spt-scalevel-y (meters -0.026666667)) (sp-int spt-next-time 20) (sp-launcher-by-id spt-next-launcher 139) @@ -501,14 +475,12 @@ ;; failed to figure out what this is: (defpart 139 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.0033333334)) (sp-flt spt-scalevel-y (meters -0.053333335))) + :init-specs ((sp-flt spt-scalevel-x (meters 0.0033333334)) (sp-flt spt-scalevel-y (meters -0.053333335))) ) ;; failed to figure out what this is: (defpart 126 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2.4) (meters 1.6) 1.0) (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 360.0) 1.0) @@ -529,20 +501,17 @@ ;; failed to figure out what this is: (defpart 134 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 140)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 140)) ) ;; failed to figure out what this is: (defpart 140 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) ;; failed to figure out what this is: (defpart 127 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.4) (meters 0.8) 1.0) @@ -565,8 +534,7 @@ ;; failed to figure out what this is: (defpart 128 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 3.2) (sp-flt spt-x (meters 0.96000004)) (sp-rnd-flt spt-scale-x (meters 0.35) (meters 0.075) 1.0) @@ -592,14 +560,12 @@ ;; failed to figure out what this is: (defpart 135 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4)) ) ;; failed to figure out what this is: (defpart 125 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-x (meters 0.8)) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.05) 1.0) @@ -623,8 +589,7 @@ ;; failed to figure out what this is: (defpart 124 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x10 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x10 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters 0.96000004) (meters 0.16000001) 1.0) (sp-rnd-flt spt-scale-x (meters 0.32000002) (meters 0.96000004) 1.0) @@ -650,8 +615,7 @@ ;; failed to figure out what this is: (defpart 141 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-flt spt-rotvel-x (degrees 0.16666667)) (sp-flt spt-scalevel-y (meters 0.016666668)) (sp-int spt-next-time 20) @@ -661,8 +625,7 @@ ;; failed to figure out what this is: (defpart 142 - :init-specs - ((sp-flt spt-rotvel-x (degrees 0.13333334)) + :init-specs ((sp-flt spt-rotvel-x (degrees 0.13333334)) (sp-flt spt-scalevel-y (meters 0)) (sp-flt spt-fade-a -0.64) (sp-int spt-next-time 20) @@ -672,8 +635,7 @@ ;; failed to figure out what this is: (defpart 143 - :init-specs - ((sp-flt spt-rotvel-x (degrees 0.1)) + :init-specs ((sp-flt spt-rotvel-x (degrees 0.1)) (sp-flt spt-scalevel-y (meters -0.016666668)) (sp-int spt-next-time 20) (sp-launcher-by-id spt-next-launcher 144) @@ -682,14 +644,12 @@ ;; failed to figure out what this is: (defpart 144 - :init-specs - ((sp-flt spt-rotvel-x (degrees 0.06666667)) (sp-flt spt-scalevel-y (meters -0.033333335))) + :init-specs ((sp-flt spt-rotvel-x (degrees 0.06666667)) (sp-flt spt-scalevel-y (meters -0.033333335))) ) ;; failed to figure out what this is: (defpart 145 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.05) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -726,11 +686,13 @@ (with-pp (let ((s5-0 (-> obj flags))) (cond - ((zero? (logand (-> obj flags) 2)) - (set! (-> obj flags) (logand -97793 (-> obj flags))) + ((zero? (logand (-> obj flags) (water-flags wt01))) + (logclear! (-> obj flags) (water-flags wt09 wt10 wt11 wt12 wt13 wt14 wt16)) ) - ((and (logtest? #x200000 (-> obj flags)) (logtest? (-> obj process state-flags) 256)) - (set! (-> obj flags) (logior #x10000 (-> obj flags))) + ((and (logtest? (water-flags wt21) (-> obj flags)) + (logtest? (-> obj process state-flags) (state-flags grabbed)) + ) + (set! (-> obj flags) (logior (water-flags wt16) (-> obj flags))) ) ((begin (set! (-> obj top 1 quad) (-> obj top 0 quad)) @@ -738,28 +700,27 @@ (+! (-> obj top 0 y) (-> obj top-y-offset)) (set! (-> obj bottom 1 quad) (-> obj bottom 0 quad)) (set! (-> obj bottom 0 quad) (-> obj process root trans quad)) - (set! (-> obj flags) (logand -31745 (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt10 wt11 wt12 wt13 wt14)) (set! (-> obj bob-offset) (update! (-> obj bob))) (cond - ((and (logtest? (-> obj flags) 256) - (zero? - (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) - (collide-action ca-9) - ) - ) + ((and (logtest? (-> obj flags) (water-flags wt08)) + (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) + (collide-action ca-9) + ) + ) ) (set! (-> obj real-ocean-offset) (- (ocean-get-height (the-as vector (-> obj bottom))) (-> obj base-height))) - (if (zero? (logand (-> obj flags) 512)) + (if (zero? (logand (-> obj flags) (water-flags wt09))) (set! (-> obj ocean-offset) (-> obj real-ocean-offset)) (set! (-> obj ocean-offset) (lerp (-> obj ocean-offset) (-> obj real-ocean-offset) 0.2)) ) ) - ((logtest? #x100000 (-> obj flags)) + ((logtest? (water-flags wt20) (-> obj flags)) (let* ((a0-26 (-> obj volume process 0)) (f30-0 (ripple-find-height (the-as process-drawable a0-26) 0 (the-as vector (-> obj bottom)))) ) (set! (-> obj real-ocean-offset) (- f30-0 (-> obj base-height))) - (if (zero? (logand (-> obj flags) 512)) + (if (zero? (logand (-> obj flags) (water-flags wt09))) (set! (-> obj ocean-offset) (-> obj real-ocean-offset)) (set! (-> obj ocean-offset) (lerp (-> obj ocean-offset) (-> obj real-ocean-offset) 0.2)) ) @@ -786,13 +747,13 @@ (set! (-> obj swim-depth) (fmax 0.0 (- (- (-> obj surface-height) (-> obj swim-height)) (-> obj bottom 0 y)))) (>= (-> obj height) (-> obj bottom 0 y)) ) - (if (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 1024) + (if (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags on-water)) (set! (-> obj on-water-time) (-> *display* base-frame-counter)) ) (set! (-> obj drip-wetness) 1.0) (set! (-> obj drip-height) (fmax (- (-> obj surface-height) (-> obj bottom 0 y)) (-> obj drip-height))) (set! (-> obj drip-speed) 15.0) - (if (zero? (logand (-> obj flags) 512)) + (if (zero? (logand (-> obj flags) (water-flags wt09))) (TODO-RENAME-15 obj) ) (cond @@ -803,8 +764,8 @@ (set! (-> s4-0 y) (-> obj surface-height)) (when (and (logtest? (-> obj process draw status) (draw-status was-drawn)) (zero? (-> obj process draw cur-lod)) - (logtest? #x400000 (-> obj flags)) - (logtest? #x800000 (-> obj flags)) + (logtest? (water-flags wt22) (-> obj flags)) + (logtest? (water-flags wt23) (-> obj flags)) ) (let ((f30-1 (y-angle (-> obj process root))) (f28-0 (vector-xz-length (-> obj process root transv))) @@ -859,10 +820,10 @@ ) ) (else - (logior! (-> obj flags) 8192) + (logior! (-> obj flags) (water-flags wt13)) ) ) - (when (and (logtest? (-> obj flags) 32) (logtest? #x800000 (-> obj flags))) + (when (and (logtest? (-> obj flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> obj flags))) (let* ((v1-124 (rand-vu-int-range 3 (+ (-> obj process node-list length) -1))) (s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data v1-124))) ) @@ -907,22 +868,25 @@ ) ) ) - (if (and (logtest? (-> obj flags) 16) - (and s4-3 (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) 1024))) + (if (and (logtest? (-> obj flags) (water-flags wt04)) + (and s4-3 + (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags on-water)) + ) + ) ) (set! (-> obj bob amp) (* 0.8 (-> obj bob amp))) ) (cond - ((and (logtest? (-> obj flags) 8) - (or (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 1024) + ((and (logtest? (-> obj flags) (water-flags wt03)) + (or (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags on-water)) (>= f30-3 (-> obj bottom 0 y)) - (and (logtest? s5-0 2048) - (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 4) - (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) 1)) + (and (logtest? s5-0 (water-flags wt11)) + (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags tsurf)) + (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags onsurf))) (>= (+ 204.8 f30-3) (-> obj bottom 0 y)) ) ) - (or (logtest? s5-0 2048) + (or (logtest? s5-0 (water-flags wt11)) (< 12288.0 (vector-xz-length (-> obj process root transv))) (< (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> obj enter-water-time)) (>= (+ (- 204.8 (fmin 6144.0 (+ (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)))) f30-3) @@ -932,39 +896,39 @@ ) (set! (-> obj swim-time) (-> *display* base-frame-counter)) (send-event (-> obj process) 'swim) - (logior! (-> obj flags) 2048) - (if (zero? (logand s5-0 2048)) + (logior! (-> obj flags) (water-flags wt11)) + (if (zero? (logand s5-0 (water-flags wt11))) (set! (-> obj enter-swim-time) (-> *display* base-frame-counter)) ) (cond - ((and (logtest? (-> obj flags) 16) - (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 4) - (zero? (logand #x10000 (-> obj flags))) + ((and (logtest? (-> obj flags) (water-flags wt04)) + (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags tsurf)) + (zero? (logand (water-flags wt16) (-> obj flags))) ) (let ((v1-200 (new 'stack-no-clear 'vector))) (set! (-> v1-200 quad) (-> obj bottom 0 quad)) (set! (-> v1-200 y) (- (-> obj height) (-> obj swim-height))) (let ((s4-4 (-> obj process root))) - (when (and (zero? (logand (-> (the-as collide-shape-moving s4-4) status) 4096)) - (logtest? (-> obj flags) 2048) + (when (and (zero? (logand (-> (the-as collide-shape-moving s4-4) status) (cshape-moving-flags csmf12))) + (logtest? (-> obj flags) (water-flags wt11)) (zero? (logand (-> (the-as collide-shape-moving s4-4) root-prim prim-core action) (collide-action ca-9))) ) (let ((a1-27 (vector-! (new 'stack-no-clear 'vector) v1-200 (-> s4-4 trans)))) (vector-float*! a1-27 a1-27 (-> *display* frames-per-second)) (integrate-and-collide! (the-as collide-shape-moving s4-4) a1-27) ) - (logior! (-> (the-as collide-shape-moving s4-4) status) 1031) + (logior! (-> (the-as collide-shape-moving s4-4) status) (cshape-moving-flags onsurf onground tsurf on-water)) ) ) ) ) - ((and (< (-> obj bottom 0 y) f30-3) (zero? (logand #x10000 (-> obj flags)))) - (logior! (-> obj flags) 4096) + ((and (< (-> obj bottom 0 y) f30-3) (zero? (logand (water-flags wt16) (-> obj flags)))) + (logior! (-> obj flags) (water-flags wt12)) ) ) ) ((begin - (set! s4-3 (and (logtest? (-> obj flags) 4) + (set! s4-3 (and (logtest? (-> obj flags) (water-flags wt02)) (or (not (!= (-> obj bob amp) 0.0)) (>= (- (-> *display* base-frame-counter) (-> obj swim-time)) (seconds 0.05)) ) @@ -975,15 +939,15 @@ ) (set! (-> obj wade-time) (-> *display* base-frame-counter)) (send-event (-> obj process) 'wade) - (logior! (-> obj flags) 1024) + (logior! (-> obj flags) (water-flags wt10)) ) ) ) - (when (and (logtest? (-> obj flags) 8) + (when (and (logtest? (-> obj flags) (water-flags wt03)) (< (-> obj bottom 1 y) f30-3) - (and (< f30-3 (-> obj bottom 0 y)) (logtest? s5-0 4096)) + (and (< f30-3 (-> obj bottom 0 y)) (logtest? s5-0 (water-flags wt12))) ) - (logior! (-> obj flags) 2048) + (logior! (-> obj flags) (water-flags wt11)) (let ((a1-30 (new 'stack-no-clear 'vector))) (set! (-> a1-30 quad) (-> obj bottom 0 quad)) (let ((s5-1 (-> obj process root))) @@ -991,7 +955,7 @@ (when (zero? (logand (-> (the-as collide-shape-moving s5-1) root-prim prim-core action) (collide-action ca-9))) (let ((f30-4 (-> (the-as collide-shape-moving s5-1) ground-impact-vel))) (move-to-ground-point! (the-as collide-shape-moving s5-1) a1-30 (-> s5-1 transv) *up-vector*) - (logior! (-> (the-as collide-shape-moving s5-1) status) 1024) + (logior! (-> (the-as collide-shape-moving s5-1) status) (cshape-moving-flags on-water)) (set! (-> (the-as collide-shape-moving s5-1) ground-impact-vel) f30-4) ) ) @@ -999,33 +963,28 @@ ) ) ) - (when (and (logtest? #x20000 (-> obj flags)) (= (-> obj process type) target)) - (when (and (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 1025) + (when (and (logtest? (water-flags wt17) (-> obj flags)) (= (-> obj process type) target)) + (when (and (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) + (cshape-moving-flags onsurf on-water) + ) (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) (collide-action ca-9) ) ) ) (when (< (-> obj process root trans y) -409.6) - (send-event (-> obj process) 'no-look-around 450) + (send-event (-> obj process) 'no-look-around (seconds 1.5)) (when (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) (collide-action ca-14) ) ) (cond ((= (-> obj process type) target) - (let ((a1-32 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-32 from) pp) - (set! (-> a1-32 num-params) 2) - (set! (-> a1-32 message) 'attack) - (set! (-> a1-32 param 0) (the-as uint #f)) - (let ((v1-275 (new 'static 'attack-info :mask #xe0))) - (set! (-> v1-275 shove-up) 2048.0) - (set! (-> v1-275 shove-back) 0.0) - (set! (-> v1-275 mode) 'tar) - (set! (-> a1-32 param 1) (the-as uint v1-275)) - ) - (send-event-function (-> obj process) a1-32) + (send-event + (-> obj process) + 'attack + #f + (static-attack-info ((shove-up (meters 0.5)) (shove-back (meters 0)) (mode 'tar))) ) ) (else @@ -1055,17 +1014,19 @@ ) ) (else - (if (logtest? (-> obj flags) 512) + (if (logtest? (-> obj flags) (water-flags wt09)) (TODO-RENAME-16 obj) ) ) ) ) - (when (not - (or (zero? (logand (-> obj flags) 64)) (zero? (logand #x800000 (-> obj flags))) (= (-> obj drip-wetness) 0.0)) - ) + (when (not (or (zero? (logand (-> obj flags) (water-flags wt06))) + (zero? (logand (water-flags wt23) (-> obj flags))) + (= (-> obj drip-wetness) 0.0) + ) + ) (cond - ((logtest? (-> obj flags) #x8000) + ((logtest? (-> obj flags) (water-flags wt15)) (let ((a2-15 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data (-> obj drip-joint-index))) ) @@ -1086,8 +1047,8 @@ ) ) (set! (-> obj drip-time) (-> *display* base-frame-counter)) - (set! (-> obj flags) (logand -32769 (-> obj flags))) - (set! (-> obj drip-wetness) (seek (-> obj drip-wetness) 0.0 (* 0.001 (-> obj drip-speed)))) + (logclear! (-> obj flags) (water-flags wt15)) + (seek! (-> obj drip-wetness) 0.0 (* 0.001 (-> obj drip-speed))) (set! (-> obj drip-speed) (* 1.05 (-> obj drip-speed))) (if (= (-> obj drip-wetness) 0.0) (set! (-> obj drip-height) 0.0) @@ -1106,7 +1067,7 @@ ) (set! (-> obj drip-joint-index) s5-2) (set! (-> obj drip-old-pos quad) (-> v1-328 quad)) - (logior! (-> obj flags) #x8000) + (logior! (-> obj flags) (water-flags wt15)) ) ) ) @@ -1222,11 +1183,11 @@ ;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-15 water-control ((obj water-control)) (with-pp - (logior! (-> obj flags) 512) - (set! (-> obj flags) (logand -65537 (-> obj flags))) + (logior! (-> obj flags) (water-flags wt09)) + (logclear! (-> obj flags) (water-flags wt16)) (set! (-> obj enter-water-time) (-> *display* base-frame-counter)) (set-vector! (-> obj enter-water-pos) (-> obj bottom 0 x) (-> obj surface-height) (-> obj bottom 0 z) 1.0) - (when (and (logtest? (-> obj flags) 32) (logtest? #x800000 (-> obj flags))) + (when (and (logtest? (-> obj flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> obj flags))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) pp) (set! (-> a1-1 num-params) 1) @@ -1242,7 +1203,7 @@ ) ) ) - (if (logtest? #x20000 (-> obj flags)) + (if (logtest? (water-flags wt17) (-> obj flags)) (set! (-> obj swim-height) 2867.2) ) 0 @@ -1253,9 +1214,9 @@ ;; definition for method 16 of type water-control ;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-16 water-control ((obj water-control)) - (set! (-> obj flags) (logand -513 (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt09)) (set-zero! (-> obj bob)) - (if (logtest? #x20000 (-> obj flags)) + (if (logtest? (water-flags wt17) (-> obj flags)) (set! (-> obj swim-height) 2867.2) ) 0 @@ -1265,26 +1226,19 @@ ;; definition for function splash-spawn ;; INFO: Return type mismatch int vs none. (defun splash-spawn ((arg0 basic) (arg1 basic) (arg2 int)) - (let ((s4-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker s4-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) + (process-spawn + part-tracker + :init part-tracker-init + (if (zero? arg2) + (-> *part-group-id-table* 41) + (-> *part-group-id-table* 40) ) - (run-now-in-process - s4-0 - part-tracker-init - (if (zero? arg2) - (-> *part-group-id-table* 41) - (-> *part-group-id-table* 40) - ) - -1 - part-water-splash-callback - arg0 - #f - arg1 - ) - (-> s4-0 ppointer) - ) + -1 + part-water-splash-callback + arg0 + #f + arg1 + :to *entity-pool* ) 0 (none) @@ -1293,7 +1247,7 @@ ;; definition for method 13 of type water-control ;; INFO: Return type mismatch int vs none. (defmethod dummy-13 water-control ((obj water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector)) - (when (and (logtest? (-> obj flags) 32) (logtest? #x800000 (-> obj flags))) + (when (and (logtest? (-> obj flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> obj flags))) (let ((a1-3 (vector+float*! (new 'stack-no-clear 'vector) arg1 arg3 0.05))) (set! (-> a1-3 y) (-> obj surface-height)) (splash-spawn (the-as basic arg0) (the-as basic a1-3) arg2) @@ -1308,7 +1262,7 @@ (defmethod dummy-27 water-vol ((obj water-vol)) (when (handle->process (-> obj target)) (let ((v1-7 (-> (the-as target (-> obj target process 0)) water))) - (set! (-> v1-7 flags) (logand -129892623 (-> v1-7 flags))) + (logclear! (-> v1-7 flags) (water-flags wt01 wt02 wt03 wt08 wt17 wt18 wt19 wt20 wt21 wt23 wt24 wt25 wt26)) (set! (-> v1-7 volume) (the-as handle #f)) ) (set! (-> obj target) (the-as handle #f)) @@ -1331,56 +1285,34 @@ ;; definition for method 26 of type water-vol ;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-26 water-vol ((obj water-vol)) - (with-pp - (cond - ((handle->process (-> obj target)) - (cond - ((not (dummy-10 (-> obj vol) (-> (the-as target (-> obj target process 0)) control trans))) - (dummy-27 obj) - ) - (else - (let ((v1-15 (-> (the-as target (-> obj target process 0)) water))) - (when (and (logtest? #x80000 (-> obj flags)) - (logtest? (-> v1-15 flags) 512) - (>= (-> v1-15 surface-height) (-> v1-15 bottom 0 y)) - ) - (let ((v1-18 (-> obj attack-event))) - (case v1-18 - ((#f) - ) - (('heat) - (send-event (handle->process (-> obj target)) 'heat (* 10.0 (-> *display* seconds-per-frame))) - ) - (('drown-death 'lava 'dark-eco-pool) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) pp) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'attack-invinc) - (set! (-> a1-8 param 0) (the-as uint #f)) - (let ((a0-19 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-19 mode) v1-18) - (set! (-> a1-8 param 1) (the-as uint a0-19)) - ) - (if (send-event-function (handle->process (-> obj target)) a1-8) - (send-event obj 'notify 'attack) - ) + (cond + ((handle->process (-> obj target)) + (cond + ((not (dummy-10 (-> obj vol) (-> (the-as target (-> obj target process 0)) control trans))) + (dummy-27 obj) + ) + (else + (let ((v1-15 (-> (the-as target (-> obj target process 0)) water))) + (when (and (logtest? (water-flags wt19) (-> obj flags)) + (logtest? (-> v1-15 flags) (water-flags wt09)) + (>= (-> v1-15 surface-height) (-> v1-15 bottom 0 y)) ) - ) - (else - (let ((a1-10 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-10 from) pp) - (set! (-> a1-10 num-params) 2) - (set! (-> a1-10 message) 'attack) - (set! (-> a1-10 param 0) (the-as uint #f)) - (let ((a0-27 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-27 mode) v1-18) - (set! (-> a1-10 param 1) (the-as uint a0-27)) - ) - (if (send-event-function (handle->process (-> obj target)) a1-10) - (send-event obj 'notify 'attack) - ) + (let ((v1-18 (-> obj attack-event))) + (case v1-18 + ((#f) + ) + (('heat) + (send-event (handle->process (-> obj target)) 'heat (* 10.0 (-> *display* seconds-per-frame))) + ) + (('drown-death 'lava 'dark-eco-pool) + (if (send-event (handle->process (-> obj target)) 'attack-invinc #f (static-attack-info ((mode v1-18)))) + (send-event obj 'notify 'attack) + ) + ) + (else + (if (send-event (handle->process (-> obj target)) 'attack #f (static-attack-info ((mode v1-18)))) + (send-event obj 'notify 'attack) ) - ) ) ) ) @@ -1388,40 +1320,39 @@ ) ) ) - ((and *target* - (and (not (handle->process (-> *target* water volume))) (dummy-10 (-> obj vol) (-> *target* control trans))) - ) - (let ((s5-0 (-> *target* water))) - (process-entity-status! obj (entity-perm-status bit-3) #t) - (set! (-> s5-0 volume) (process->handle obj)) - (set! (-> obj target) (process->handle *target*)) - (logior! (-> s5-0 flags) 2) - (set! (-> s5-0 base-height) (-> obj water-height)) - (set! (-> s5-0 ocean-offset) 0.0) - (logior! (-> s5-0 flags) (-> obj flags)) - (if (< 0.0 (-> obj wade-height)) - (set! (-> s5-0 wade-height) (-> obj wade-height)) - ) - (if (< 0.0 (-> obj swim-height)) - (set! (-> s5-0 swim-height) (-> obj swim-height)) - ) - (if (< 0.0 (-> obj bottom-height)) - (set! (-> s5-0 bottom-height) (-> obj bottom-height)) - ) - (set-zero! (-> s5-0 bob)) - ) + ) + ((and *target* + (and (not (handle->process (-> *target* water volume))) (dummy-10 (-> obj vol) (-> *target* control trans))) + ) + (let ((s5-0 (-> *target* water))) + (process-entity-status! obj (entity-perm-status bit-3) #t) + (set! (-> s5-0 volume) (process->handle obj)) + (set! (-> obj target) (process->handle *target*)) + (logior! (-> s5-0 flags) (water-flags wt01)) + (set! (-> s5-0 base-height) (-> obj water-height)) + (set! (-> s5-0 ocean-offset) 0.0) + (logior! (-> s5-0 flags) (-> obj flags)) + (if (< 0.0 (-> obj wade-height)) + (set! (-> s5-0 wade-height) (-> obj wade-height)) + ) + (if (< 0.0 (-> obj swim-height)) + (set! (-> s5-0 swim-height) (-> obj swim-height)) + ) + (if (< 0.0 (-> obj bottom-height)) + (set! (-> s5-0 bottom-height) (-> obj bottom-height)) + ) + (set-zero! (-> s5-0 bob)) ) - ) - 0 - (none) + ) ) + 0 + (none) ) ;; failed to figure out what this is: (defstate water-vol-startup (water-vol) :virtual #t - :code - (behavior () + :code (behavior () (go-virtual water-vol-idle) (none) ) @@ -1430,8 +1361,7 @@ ;; failed to figure out what this is: (defstate water-vol-idle (water-vol) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'update) (TODO-RENAME-26 self) @@ -1439,18 +1369,15 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (dummy-27 self) (none) ) - :trans - (behavior () + :trans (behavior () (TODO-RENAME-26 self) (none) ) - :code - (the-as (function none :behavior water-vol) anim-loop) + :code (the-as (function none :behavior water-vol) anim-loop) ) ;; definition for method 24 of type water-vol @@ -1467,13 +1394,14 @@ ) ;; definition for method 25 of type water-vol -;; INFO: Return type mismatch int vs object. +;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-25 water-vol ((obj water-vol)) - (the-as object 0) + 0 + (none) ) ;; definition for method 29 of type water-vol -;; WARN: disable def twice: 85. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; INFO: Return type mismatch water-flags vs none. ;; Used lq/sq (defmethod TODO-RENAME-29 water-vol ((obj water-vol)) (local-vars (sv-16 res-tag)) @@ -1488,7 +1416,7 @@ ) ) ) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (logclear! (-> obj mask) (process-mask actor-pause)) (set! (-> obj vol) (new 'process 'vol-control obj)) (logior! (-> obj vol flags) 3) @@ -1512,30 +1440,27 @@ (set! (-> obj wade-height) (-> v1-8 1)) (set! (-> obj swim-height) (-> v1-8 2)) (if (>= (-> sv-16 elt-count) (the-as uint 4)) - (set! (-> obj flags) (the-as uint (the int (-> v1-8 3)))) + (set! (-> obj flags) (the-as water-flags (the int (-> v1-8 3)))) ) (if (>= (-> sv-16 elt-count) (the-as uint 5)) (set! (-> obj bottom-height) (-> v1-8 4)) ) ) ) - (set! (-> obj flags) (logior #x800000 (-> obj flags))) + (set! (-> obj flags) (logior (water-flags wt23) (-> obj flags))) (cond ((zero? (-> obj flags)) (if (< 0.0 (-> obj wade-height)) - (logior! (-> obj flags) 4) + (logior! (-> obj flags) (water-flags wt02)) ) - (when (< 0.0 (-> obj swim-height)) - (let ((v0-4 (logior (-> obj flags) 8))) - (set! (-> obj flags) v0-4) - v0-4 + (if (< 0.0 (-> obj swim-height)) + (logior! (-> obj flags) (water-flags wt03)) ) - ) ) (else - (the-as uint #f) ) ) + (none) ) ;; definition for method 22 of type water-vol @@ -1547,7 +1472,7 @@ ;; definition for function water-vol-init-by-other ;; INFO: Return type mismatch object vs none. -(defbehavior water-vol-init-by-other water-vol ((arg0 entity)) +(defbehavior water-vol-init-by-other water-vol ((arg0 entity-actor)) (set! (-> self entity) arg0) (set-stack-size! self) (reset-root! self) diff --git a/test/decompiler/reference/engine/gfx/wind-h_REF.gc b/test/decompiler/reference/engine/gfx/wind-h_REF.gc index ebd9bbd130..3a221c1aa0 100644 --- a/test/decompiler/reference/engine/gfx/wind-h_REF.gc +++ b/test/decompiler/reference/engine/gfx/wind-h_REF.gc @@ -20,10 +20,7 @@ ) ;; definition for symbol *wind-scales*, type (array uint8) -(define *wind-scales* (the-as (array uint8) (new - 'static - 'boxed-array - :type uint8 :length 32 :allocated-length 32 +(define *wind-scales* (the-as (array uint8) (new 'static 'boxed-array :type uint8 #x2 #x5 #x2 diff --git a/test/decompiler/reference/engine/level/level-h_REF.gc b/test/decompiler/reference/engine/level/level-h_REF.gc index 0ebb88c06a..c827abd0ec 100644 --- a/test/decompiler/reference/engine/level/level-h_REF.gc +++ b/test/decompiler/reference/engine/level/level-h_REF.gc @@ -139,47 +139,50 @@ ;; definition of type level (deftype level (basic) - ((name symbol :offset-assert 4) - (load-name symbol :offset-assert 8) - (nickname symbol :offset-assert 12) - (index int32 :offset-assert 16) - (status symbol :offset-assert 20) - (other level :offset-assert 24) - (heap kheap :inline :offset-assert 32) - (bsp bsp-header :offset-assert 48) - (art-group load-dir-art-group :offset-assert 52) - (info level-load-info :offset-assert 56) - (texture-page texture-page 9 :offset-assert 60) - (loaded-texture-page texture-page 16 :offset-assert 96) - (loaded-texture-page-count int32 :offset-assert 160) - (foreground-sink-group dma-foreground-sink-group 3 :inline :offset-assert 176) - (foreground-draw-engine engine 3 :offset-assert 272) - (entity entity-links-array :offset-assert 284) - (ambient entity-ambient-data-array :offset-assert 288) - (closest-object float 9 :offset-assert 292) - (upload-size int32 9 :offset-assert 328) - (level-distance meters :offset-assert 364) - (inside-sphere? symbol :offset-assert 368) - (inside-boxes? symbol :offset-assert 372) - (display? symbol :offset-assert 376) - (meta-inside? symbol :offset-assert 380) - (mood mood-context :offset-assert 384) - (mood-func (function mood-context float int none) :offset-assert 388) - (vis-bits pointer :offset-assert 392) - (all-visible? symbol :offset-assert 396) - (force-all-visible? symbol :offset-assert 400) - (linking basic :offset-assert 404) - (vis-info level-vis-info 8 :offset-assert 408) - (vis-self-index int32 :offset-assert 440) - (vis-adj-index int32 :offset-assert 444) - (vis-buffer uint8 2048 :offset-assert 448) - (mem-usage-block memory-usage-block :offset-assert 2496) - (mem-usage int32 :offset-assert 2500) - (code-memory-start pointer :offset-assert 2504) - (code-memory-end pointer :offset-assert 2508) - (texture-mask uint32 9 :offset-assert 2512) - (force-inside? symbol :offset-assert 2548) - (pad uint8 56 :offset-assert 2552) + ((name symbol :offset-assert 4) + (load-name symbol :offset-assert 8) + (nickname symbol :offset-assert 12) + (index int32 :offset-assert 16) + (status symbol :offset-assert 20) + (other level :offset-assert 24) + (heap kheap :inline :offset-assert 32) + (bsp bsp-header :offset-assert 48) + (art-group load-dir-art-group :offset-assert 52) + (info level-load-info :offset-assert 56) + (texture-page texture-page 9 :offset-assert 60) + (loaded-texture-page texture-page 16 :offset-assert 96) + (loaded-texture-page-count int32 :offset-assert 160) + (tfrag-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 176) + (pris-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 208) + (water-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 240) + (foreground-sink-group dma-foreground-sink-group 3 :inline :offset 176) + (foreground-draw-engine engine 3 :offset-assert 272) + (entity entity-links-array :offset-assert 284) + (ambient entity-ambient-data-array :offset-assert 288) + (closest-object float 9 :offset-assert 292) + (upload-size int32 9 :offset-assert 328) + (level-distance meters :offset-assert 364) + (inside-sphere? symbol :offset-assert 368) + (inside-boxes? symbol :offset-assert 372) + (display? symbol :offset-assert 376) + (meta-inside? symbol :offset-assert 380) + (mood mood-context :offset-assert 384) + (mood-func (function mood-context float int none) :offset-assert 388) + (vis-bits pointer :offset-assert 392) + (all-visible? symbol :offset-assert 396) + (force-all-visible? symbol :offset-assert 400) + (linking basic :offset-assert 404) + (vis-info level-vis-info 8 :offset-assert 408) + (vis-self-index int32 :offset-assert 440) + (vis-adj-index int32 :offset-assert 444) + (vis-buffer uint8 2048 :offset-assert 448) + (mem-usage-block memory-usage-block :offset-assert 2496) + (mem-usage int32 :offset-assert 2500) + (code-memory-start pointer :offset-assert 2504) + (code-memory-end pointer :offset-assert 2508) + (texture-mask uint32 9 :offset-assert 2512) + (force-inside? symbol :offset-assert 2548) + (pad uint8 56 :offset-assert 2552) ) :method-count-assert 29 :size-assert #xa30 @@ -197,7 +200,7 @@ (load-begin (_type_) _type_ 18) (login-begin (_type_) _type_ 19) (vis-load (_type_) uint 20) - (dummy-21 (_type_) none 21) + (unused-21 (_type_) none 21) (birth (_type_) _type_ 22) (level-status-set! (_type_ symbol) _type_ 23) (load-required-packages (_type_) _type_ 24) @@ -224,7 +227,7 @@ (format #t "~Ttexture-page[9] @ #x~X~%" (-> obj texture-page)) (format #t "~Tloaded-texture-page[16] @ #x~X~%" (-> obj loaded-texture-page)) (format #t "~Tloaded-texture-page-count: ~D~%" (-> obj loaded-texture-page-count)) - (format #t "~Tforeground-sink-group[3] @ #x~X~%" (-> obj foreground-sink-group)) + (format #t "~Tforeground-sink-group[3] @ #x~X~%" (-> obj tfrag-tex-foreground-sink-group)) (format #t "~Tforeground-draw-engine[3] @ #x~X~%" (-> obj foreground-draw-engine)) (format #t "~Tentity: ~A~%" (-> obj entity)) (format #t "~Tambient: ~A~%" (-> obj ambient)) @@ -330,39 +333,32 @@ :want-level #f :load-commands '() :play? #f - :level0 - (new 'static 'level + :level0 (new 'static 'level :name #f :status 'inactive - :foreground-sink-group - (new 'static 'inline-array dma-foreground-sink-group 3 - (new 'static 'dma-foreground-sink-group - :sink - (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink :bucket (bucket-id merc-tfrag-tex0)) - (new 'static 'generic-dma-foreground-sink :bucket (bucket-id gmerc-tfrag-tex) :foreground-output-bucket 1) + :tfrag-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group + :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-tfrag-tex0)) + (new 'static 'generic-dma-foreground-sink :bucket (bucket-id generic-tfrag-tex0) :foreground-output-bucket 1) + ) + ) + :pris-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group + :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-pris0) :foreground-texture-page 1) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-pris0) + :foreground-texture-page 1 + :foreground-output-bucket 1 ) ) - (new 'static 'dma-foreground-sink-group - :sink - (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink :bucket (bucket-id bucket-49) :foreground-texture-page 1) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id bucket-50) - :foreground-texture-page 1 - :foreground-output-bucket 1 - ) - ) - ) - (new 'static 'dma-foreground-sink-group - :sink - (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink :bucket (bucket-id bucket-58) :foreground-texture-page 2) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id bucket-59) - :foreground-texture-page 2 - :foreground-output-bucket 1 - ) + ) + :water-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group + :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-water0) :foreground-texture-page 2) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-water0) + :foreground-texture-page 2 + :foreground-output-bucket 1 ) ) ) @@ -370,104 +366,94 @@ :inside-boxes? #f :force-inside? #f ) - :level1 - (new 'static 'level + :level1 (new 'static 'level :name #f :index 1 :status 'inactive - :foreground-sink-group - (new 'static 'inline-array dma-foreground-sink-group 3 - (new 'static 'dma-foreground-sink-group - :sink - (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink :bucket (bucket-id merc-tfrag-tex1) :foreground-texture-level 1) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id gmerc-tfrag-tex1) - :foreground-texture-level 1 - :foreground-output-bucket 1 - ) + :tfrag-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group + :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-tfrag-tex1) :foreground-texture-level 1) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-tfrag-tex1) + :foreground-texture-level 1 + :foreground-output-bucket 1 ) ) - (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket (bucket-id bucket-52) - :foreground-texture-page 1 - :foreground-texture-level 1 - ) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id bucket-53) - :foreground-texture-page 1 - :foreground-texture-level 1 - :foreground-output-bucket 1 - ) - ) - ) - (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket (bucket-id bucket-61) - :foreground-texture-page 2 - :foreground-texture-level 1 - ) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id bucket-62) - :foreground-texture-page 2 - :foreground-texture-level 1 - :foreground-output-bucket 1 - ) - ) - ) ) + :pris-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink + :bucket (bucket-id merc-pris1) + :foreground-texture-page 1 + :foreground-texture-level 1 + ) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-pris1) + :foreground-texture-page 1 + :foreground-texture-level 1 + :foreground-output-bucket 1 + ) + ) + ) + :water-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink + :bucket (bucket-id merc-water1) + :foreground-texture-page 2 + :foreground-texture-level 1 + ) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-water1) + :foreground-texture-page 2 + :foreground-texture-level 1 + :foreground-output-bucket 1 + ) + ) + ) :inside-sphere? #f :inside-boxes? #f :force-inside? #f ) - :level-default - (new 'static 'level + :level-default (new 'static 'level :name 'default :index 2 :status 'reserved - :foreground-sink-group - (new 'static 'inline-array dma-foreground-sink-group 3 - (new 'static 'dma-foreground-sink-group - :sink - (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink :bucket (bucket-id bucket-45) :foreground-texture-level 2) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id bucket-46) - :foreground-texture-level 2 - :foreground-output-bucket 1 - ) + :tfrag-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group + :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-alpha-tex) :foreground-texture-level 2) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-alpha-tex) + :foreground-texture-level 2 + :foreground-output-bucket 1 ) ) - (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket (bucket-id bucket-55) - :foreground-texture-page 1 - :foreground-texture-level 2 - ) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id bucket-56) - :foreground-texture-page 1 - :foreground-texture-level 2 - :foreground-output-bucket 1 - ) - ) - ) - (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket (bucket-id bucket-58) - :foreground-texture-page 2 - :foreground-texture-level 2 - ) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id bucket-59) - :foreground-texture-page 2 - :foreground-texture-level 2 - :foreground-output-bucket 1 - ) - ) - ) ) + :pris-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink + :bucket (bucket-id merc-pris-common) + :foreground-texture-page 1 + :foreground-texture-level 2 + ) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-pris-common) + :foreground-texture-page 1 + :foreground-texture-level 2 + :foreground-output-bucket 1 + ) + ) + ) + :water-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink + :bucket (bucket-id merc-water0) + :foreground-texture-page 2 + :foreground-texture-level 2 + ) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-water0) + :foreground-texture-page 2 + :foreground-texture-level 2 + :foreground-output-bucket 1 + ) + ) + ) :inside-sphere? #f :inside-boxes? #f :force-inside? #f diff --git a/test/decompiler/reference/engine/level/level-info_REF.gc b/test/decompiler/reference/engine/level/level-info_REF.gc index e8de665da4..3a5c1d1ce9 100644 --- a/test/decompiler/reference/engine/level/level-info_REF.gc +++ b/test/decompiler/reference/engine/level/level-info_REF.gc @@ -2,8 +2,7 @@ (in-package goal) ;; definition for symbol training, type level-load-info -(define - training +(define training (new 'static 'level-load-info :index 1 :name 'training @@ -18,20 +17,14 @@ :ocean '*ocean-map-village1* :sky #t :sun-fade 1.0 - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "training-start" :level 'training - :trans - (new 'static 'vector :x -5393626.5 :y 28072.346 :z 4332472.5 :w 1.0) - :quat - (new 'static 'quaternion :y 0.9995 :w 0.0297) - :camera-trans - (new 'static 'vector :x -5426915.0 :y 45930.906 :z 4353156.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.5571 0.0 -0.8304 0.1264 0.9883 -0.0848 0.8207 -0.1522 -0.5506) - :load-commands - '((special "med-res-level-1" #t) + :trans (new 'static 'vector :x -5393626.5 :y 28072.346 :z 4332472.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.9995 :w 0.0297) + :camera-trans (new 'static 'vector :x -5426915.0 :y 45930.906 :z 4353156.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.5571 0.0 -0.8304 0.1264 0.9883 -0.0848 0.8207 -0.1522 -0.5506) + :load-commands '((special "med-res-level-1" #t) (special "med-res-level-2" #t) (special "med-res-level-4" #t) (special "med-res-level-6" #t) @@ -51,17 +44,12 @@ (new 'static 'continue-point :name "training-warp" :level 'training - :flags #x4 - :trans - (new 'static 'vector :x -5383524.0 :y 28019.098 :z 4360302.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.084 :w 0.9964) - :camera-trans - (new 'static 'vector :x -5366765.0 :y 45646.234 :z 4325889.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.9057 0.0 0.4238 -0.0666 0.9875 0.1424 -0.4186 -0.1572 0.8944) - :load-commands - '((special "med-res-level-1" #t) + :flags (continue-flags warp) + :trans (new 'static 'vector :x -5383524.0 :y 28019.098 :z 4360302.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.084 :w 0.9964) + :camera-trans (new 'static 'vector :x -5366765.0 :y 45646.234 :z 4325889.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9057 0.0 0.4238 -0.0666 0.9875 0.1424 -0.4186 -0.1572 0.8944) + :load-commands '((special "med-res-level-1" #t) (special "med-res-level-2" #t) (special "med-res-level-4" #t) (special "med-res-level-6" #t) @@ -81,17 +69,12 @@ (new 'static 'continue-point :name "game-start" :level 'training - :flags #x404 - :trans - (new 'static 'vector :x -5393740.5 :y 28259.533 :z 4360945.5 :w 1.0) - :quat - (new 'static 'quaternion :y 0.9993 :w 0.0359) - :camera-trans - (new 'static 'vector :x -5434444.5 :y 47050.344 :z 4372832.5 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.3536 0.0 -0.9353 0.1315 0.99 -0.0497 0.926 -0.1406 -0.35) - :load-commands - '((special "med-res-level-1" #t) + :flags (continue-flags warp game-start) + :trans (new 'static 'vector :x -5393740.5 :y 28259.533 :z 4360945.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.9993 :w 0.0359) + :camera-trans (new 'static 'vector :x -5434444.5 :y 47050.344 :z 4372832.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.3536 0.0 -0.9353 0.1315 0.99 -0.0497 0.926 -0.1406 -0.35) + :load-commands '((special "med-res-level-1" #t) (special "med-res-level-2" #t) (special "med-res-level-4" #t) (special "med-res-level-6" #t) @@ -114,8 +97,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x -5079040.0 :z 4055040.0 :w 1024000.0) + :bsphere (new 'static 'sphere :x -5079040.0 :z 4055040.0 :w 1024000.0) :buzzer 95 :bottom-height (meters -114) :run-packages '("common" "villagep") @@ -124,8 +106,7 @@ ) ;; definition for symbol village1, type level-load-info -(define - village1 +(define village1 (new 'static 'level-load-info :index 2 :name 'village1 @@ -140,18 +121,13 @@ :ocean '*ocean-map-village1* :sky #t :sun-fade 1.0 - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "village1-hut" :level 'village1 - :trans - (new 'static 'vector :x -638860.06 :y 139319.7 :z 769990.6 :w 1.0) - :quat - (new 'static 'quaternion :y -0.9889 :w -0.148) - :camera-trans - (new 'static 'vector :x -668114.1 :y 164536.31 :z 828633.06 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.8947 0.0 -0.4464 0.1082 0.9701 -0.2169 0.4331 -0.2424 -0.868) + :trans (new 'static 'vector :x -638860.06 :y 139319.7 :z 769990.6 :w 1.0) + :quat (new 'static 'quaternion :y -0.9889 :w -0.148) + :camera-trans (new 'static 'vector :x -668114.1 :y 164536.31 :z 828633.06 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.8947 0.0 -0.4464 0.1082 0.9701 -0.2169 0.4331 -0.2424 -0.868) :load-commands '() :vis-nick 'vi1 :lev0 'village1 @@ -162,15 +138,11 @@ (new 'static 'continue-point :name "village1-intro" :level 'village1 - :flags #x24 - :trans - (new 'static 'vector :x -518468.8 :y 189424.03 :z 868568.7 :w 1.0) - :quat - (new 'static 'quaternion :y 0.591 :w 0.8066) - :camera-trans - (new 'static 'vector :x -559109.3 :y 200461.92 :z 826073.06 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.7221 0.0 -0.6917 -0.0517 0.9972 -0.054 0.6897 0.0747 0.7201) + :flags (continue-flags warp sage-intro) + :trans (new 'static 'vector :x -518468.8 :y 189424.03 :z 868568.7 :w 1.0) + :quat (new 'static 'quaternion :y 0.591 :w 0.8066) + :camera-trans (new 'static 'vector :x -559109.3 :y 200461.92 :z 826073.06 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7221 0.0 -0.6917 -0.0517 0.9972 -0.054 0.6897 0.0747 0.7201) :load-commands '() :vis-nick 'vi1 :lev0 'village1 @@ -181,15 +153,11 @@ (new 'static 'continue-point :name "village1-warp" :level 'village1 - :flags #x804 - :trans - (new 'static 'vector :x -518468.8 :y 189424.03 :z 868568.7 :w 1.0) - :quat - (new 'static 'quaternion :y 0.591 :w 0.8066) - :camera-trans - (new 'static 'vector :x -559109.3 :y 200461.92 :z 826073.06 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.7221 0.0 -0.6917 -0.0517 0.9972 -0.054 0.6897 0.0747 0.7201) + :flags (continue-flags warp sage-ecorocks) + :trans (new 'static 'vector :x -518468.8 :y 189424.03 :z 868568.7 :w 1.0) + :quat (new 'static 'quaternion :y 0.591 :w 0.8066) + :camera-trans (new 'static 'vector :x -559109.3 :y 200461.92 :z 826073.06 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7221 0.0 -0.6917 -0.0517 0.9972 -0.054 0.6897 0.0747 0.7201) :load-commands '() :vis-nick 'vi1 :lev0 'village1 @@ -200,15 +168,11 @@ (new 'static 'continue-point :name "village1-demo-convo" :level 'village1 - :flags #x40 - :trans - (new 'static 'vector :x -542529.1 :y 189424.03 :z 847101.94 :w 1.0) - :quat - (new 'static 'quaternion :y -0.1717 :w -0.9851) - :camera-trans - (new 'static 'vector :x -559085.2 :y 202996.53 :z 826054.25 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.7868 0.0 -0.6171 0.0775 0.992 0.0989 0.6122 -0.1257 0.7806) + :flags (continue-flags sage-demo-convo) + :trans (new 'static 'vector :x -542529.1 :y 189424.03 :z 847101.94 :w 1.0) + :quat (new 'static 'quaternion :y -0.1717 :w -0.9851) + :camera-trans (new 'static 'vector :x -559085.2 :y 202996.53 :z 826054.25 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7868 0.0 -0.6171 0.0775 0.992 0.0989 0.6122 -0.1257 0.7806) :load-commands '() :vis-nick 'vi1 :lev0 'village1 @@ -219,17 +183,12 @@ (new 'static 'continue-point :name "intro-start" :level 'village1 - :flags #x10 - :trans - (new 'static 'vector :x 164316.78 :y 15128.576 :z 3390588.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.2339 :w 0.9722) - :camera-trans - (new 'static 'vector :x 204089.34 :y 36257.793 :z 3358341.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.6381 0.0 0.7699 -0.0938 0.9925 0.0777 -0.7642 -0.1218 0.6333) - :load-commands - '((special "med-res-level-1" #t) + :flags (continue-flags intro) + :trans (new 'static 'vector :x 164316.78 :y 15128.576 :z 3390588.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.2339 :w 0.9722) + :camera-trans (new 'static 'vector :x 204089.34 :y 36257.793 :z 3358341.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.6381 0.0 0.7699 -0.0938 0.9925 0.0777 -0.7642 -0.1218 0.6333) + :load-commands '((special "med-res-level-1" #t) (special "med-res-level-2" #t) (special "med-res-level-4" #t) (special "med-res-level-6" #t) @@ -252,11 +211,9 @@ :tasks '(10 11 12 13 14 75) :priority #xc8 :load-commands '() - :alt-load-commands - '(((display village1) (load misty)) ((special village1) (display misty)) ((display village1) (load beach))) + :alt-load-commands '(((display village1) (load misty)) ((special village1) (display misty)) ((display village1) (load beach))) :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x -444416.0 :y 133120.0 :z 360448.0 :w 843776.0) + :bsphere (new 'static 'sphere :x -444416.0 :y 133120.0 :z 360448.0 :w 843776.0) :buzzer 75 :bottom-height (meters -20) :run-packages '("common") @@ -265,8 +222,7 @@ ) ;; definition for symbol beach, type level-load-info -(define - beach +(define beach (new 'static 'level-load-info :index 3 :name 'beach @@ -281,18 +237,13 @@ :ocean '*ocean-map-village1* :sky #t :sun-fade 1.0 - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "beach-start" :level 'beach - :trans - (new 'static 'vector :x -504960.22 :y 9477.325 :z -223513.81 :w 1.0) - :quat - (new 'static 'quaternion :y 0.9486 :w -0.3163) - :camera-trans - (new 'static 'vector :x -487550.16 :y 28354.15 :z -184211.05 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9139 0.0 0.4058 -0.0551 0.9907 -0.1241 -0.4021 -0.1358 -0.9054) + :trans (new 'static 'vector :x -504960.22 :y 9477.325 :z -223513.81 :w 1.0) + :quat (new 'static 'quaternion :y 0.9486 :w -0.3163) + :camera-trans (new 'static 'vector :x -487550.16 :y 28354.15 :z -184211.05 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9139 0.0 0.4058 -0.0551 0.9907 -0.1241 -0.4021 -0.1358 -0.9054) :load-commands '() :vis-nick 'bea :lev0 'beach @@ -306,8 +257,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x -819200.0 :z -1556480.0 :w 1474560.0) + :bsphere (new 'static 'sphere :x -819200.0 :z -1556480.0 :w 1474560.0) :buzzer 20 :bottom-height (meters -20) :run-packages '("common") @@ -316,8 +266,7 @@ ) ;; definition for symbol jungle, type level-load-info -(define - jungle +(define jungle (new 'static 'level-load-info :index 4 :name 'jungle @@ -332,18 +281,13 @@ :ocean '*ocean-map-village1* :sky #t :sun-fade 1.0 - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "jungle-start" :level 'jungle - :trans - (new 'static 'vector :x 1057631.9 :y 86404.305 :z -647140.56 :w 1.0) - :quat - (new 'static 'quaternion :y -0.9009 :w -0.4339) - :camera-trans - (new 'static 'vector :x 1004424.8 :y 111181.82 :z -611527.9 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.5568 0.0 -0.8306 0.201 0.9702 -0.1347 0.8059 -0.2419 -0.5402) + :trans (new 'static 'vector :x 1057631.9 :y 86404.305 :z -647140.56 :w 1.0) + :quat (new 'static 'quaternion :y -0.9009 :w -0.4339) + :camera-trans (new 'static 'vector :x 1004424.8 :y 111181.82 :z -611527.9 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.5568 0.0 -0.8306 0.201 0.9702 -0.1347 0.8059 -0.2419 -0.5402) :load-commands '() :vis-nick 'jun :lev0 'jungle @@ -355,11 +299,9 @@ :tasks '(2 3 4 5 7 8 9) :priority 100 :load-commands '() - :alt-load-commands - '(((display jungle) (display jungleb)) ((display jungle) (display village1))) + :alt-load-commands '(((display jungle) (display jungleb)) ((display jungle) (display village1))) :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 1474560.0 :y 2519040.0 :z -983040.0 :w 2457600.0) + :bsphere (new 'static 'sphere :x 1474560.0 :y 2519040.0 :z -983040.0 :w 2457600.0) :buzzer 7 :bottom-height (meters -20) :run-packages '("common") @@ -368,8 +310,7 @@ ) ;; definition for symbol jungleb, type level-load-info -(define - jungleb +(define jungleb (new 'static 'level-load-info :index 5 :name 'jungleb @@ -383,18 +324,13 @@ :mood-func 'update-mood-jungleb :ocean 'none :sky #f - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "jungle-tower" :level 'jungleb - :trans - (new 'static 'vector :x 1469510.0 :y -204745.52 :z -959058.3 :w 1.0) - :quat - (new 'static 'quaternion :y -0.6194 :w -0.785) - :camera-trans - (new 'static 'vector :x 1485298.5 :y -189972.08 :z -936548.75 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.8614 0.0 0.5078 -0.1177 0.9727 -0.1997 -0.4939 -0.2318 -0.8379) + :trans (new 'static 'vector :x 1469510.0 :y -204745.52 :z -959058.3 :w 1.0) + :quat (new 'static 'quaternion :y -0.6194 :w -0.785) + :camera-trans (new 'static 'vector :x 1485298.5 :y -189972.08 :z -936548.75 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.8614 0.0 0.5078 -0.1177 0.9727 -0.1997 -0.4939 -0.2318 -0.8379) :load-commands '() :vis-nick 'jub :lev0 'jungle @@ -407,8 +343,7 @@ :priority 100 :load-commands '() :alt-load-commands '() - :bsphere - (new 'static 'sphere :x 1486848.0 :y -1269760.0 :z -1064960.0 :w 1228800.0) + :bsphere (new 'static 'sphere :x 1486848.0 :y -1269760.0 :z -1064960.0 :w 1228800.0) :buzzer 7 :bottom-height (meters -80) :run-packages '("common" "jungle") @@ -417,8 +352,7 @@ ) ;; definition for symbol misty, type level-load-info -(define - misty +(define misty (new 'static 'level-load-info :index 6 :name 'misty @@ -433,20 +367,14 @@ :ocean '*ocean-map-village1* :sky #t :sun-fade 0.25 - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "misty-start" :level 'misty - :trans - (new 'static 'vector :x 164316.78 :y 15128.576 :z 3390588.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.2339 :w 0.9722) - :camera-trans - (new 'static 'vector :x 204089.34 :y 36257.793 :z 3358341.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.6381 0.0 0.7699 -0.0938 0.9925 0.0777 -0.7642 -0.1218 0.6333) - :load-commands - '((special "med-res-level-1" #t) + :trans (new 'static 'vector :x 164316.78 :y 15128.576 :z 3390588.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.2339 :w 0.9722) + :camera-trans (new 'static 'vector :x 204089.34 :y 36257.793 :z 3358341.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.6381 0.0 0.7699 -0.0938 0.9925 0.0777 -0.7642 -0.1218 0.6333) + :load-commands '((special "med-res-level-1" #t) (special "med-res-level-2" #t) (special "med-res-level-4" #t) (special "med-res-level-6" #t) @@ -468,16 +396,11 @@ (new 'static 'continue-point :name "misty-silo" :level 'misty - :trans - (new 'static 'vector :x -672503.0 :y 82131.35 :z 3651465.8 :w 1.0) - :quat - (new 'static 'quaternion :y 0.0878 :w 0.9961) - :camera-trans - (new 'static 'vector :x -675754.0 :y 102028.91 :z 3604800.8 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.9975 0.0 -0.0704 0.0086 0.9924 0.1223 0.0698 -0.1226 0.9899) - :load-commands - '((special "med-res-level-1" #t) + :trans (new 'static 'vector :x -672503.0 :y 82131.35 :z 3651465.8 :w 1.0) + :quat (new 'static 'quaternion :y 0.0878 :w 0.9961) + :camera-trans (new 'static 'vector :x -675754.0 :y 102028.91 :z 3604800.8 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9975 0.0 -0.0704 0.0086 0.9924 0.1223 0.0698 -0.1226 0.9899) + :load-commands '((special "med-res-level-1" #t) (special "med-res-level-2" #t) (special "med-res-level-4" #t) (special "med-res-level-6" #t) @@ -499,16 +422,11 @@ (new 'static 'continue-point :name "misty-bike" :level 'misty - :trans - (new 'static 'vector :x 302533.44 :y 35901.848 :z 4138967.8 :w 1.0) - :quat - (new 'static 'quaternion :y -0.2809 :w 0.9597) - :camera-trans - (new 'static 'vector :x 338476.25 :y 55700.684 :z 4109729.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.6308 0.0 0.7759 -0.096 0.9923 0.078 -0.7699 -0.1237 0.6259) - :load-commands - '((special "med-res-level-1" #t) + :trans (new 'static 'vector :x 302533.44 :y 35901.848 :z 4138967.8 :w 1.0) + :quat (new 'static 'quaternion :y -0.2809 :w 0.9597) + :camera-trans (new 'static 'vector :x 338476.25 :y 55700.684 :z 4109729.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.6308 0.0 0.7759 -0.096 0.9923 0.078 -0.7699 -0.1237 0.6259) + :load-commands '((special "med-res-level-1" #t) (special "med-res-level-2" #t) (special "med-res-level-4" #t) (special "med-res-level-6" #t) @@ -530,16 +448,11 @@ (new 'static 'continue-point :name "misty-backside" :level 'misty - :trans - (new 'static 'vector :x -304192.72 :y 33270.99 :z 4646525.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.8443 :w -0.5357) - :camera-trans - (new 'static 'vector :x -346989.78 :y 54377.676 :z 4674685.5 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.5497 0.0 -0.8353 0.1009 0.9926 -0.0664 0.8291 -0.1208 -0.5457) - :load-commands - '((special "med-res-level-1" #t) + :trans (new 'static 'vector :x -304192.72 :y 33270.99 :z 4646525.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.8443 :w -0.5357) + :camera-trans (new 'static 'vector :x -346989.78 :y 54377.676 :z 4674685.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.5497 0.0 -0.8353 0.1009 0.9926 -0.0664 0.8291 -0.1208 -0.5457) + :load-commands '((special "med-res-level-1" #t) (special "med-res-level-2" #t) (special "med-res-level-4" #t) (special "med-res-level-6" #t) @@ -561,16 +474,11 @@ (new 'static 'continue-point :name "misty-silo2" :level 'misty - :trans - (new 'static 'vector :x -898000.06 :y 98038.17 :z 4162091.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.1102 :w 0.9938) - :camera-trans - (new 'static 'vector :x -931459.9 :y 118198.68 :z 4196081.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.6605 0.0 -0.7508 0.1086 0.9894 -0.0955 0.7429 -0.1447 -0.6535) - :load-commands - '((special "med-res-level-1" #t) + :trans (new 'static 'vector :x -898000.06 :y 98038.17 :z 4162091.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.1102 :w 0.9938) + :camera-trans (new 'static 'vector :x -931459.9 :y 118198.68 :z 4196081.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.6605 0.0 -0.7508 0.1086 0.9894 -0.0955 0.7429 -0.1447 -0.6535) + :load-commands '((special "med-res-level-1" #t) (special "med-res-level-2" #t) (special "med-res-level-4" #t) (special "med-res-level-6" #t) @@ -595,8 +503,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :z 4096000.0 :w 1269760.0) + :bsphere (new 'static 'sphere :z 4096000.0 :w 1269760.0) :buzzer 28 :bottom-height (meters -20) :run-packages '("common") @@ -605,8 +512,7 @@ ) ;; definition for symbol firecanyon, type level-load-info -(define - firecanyon +(define firecanyon (new 'static 'level-load-info :index 7 :name 'firecanyon @@ -620,18 +526,13 @@ :mood-func 'update-mood-firecanyon :ocean 'none :sky #t - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "firecanyon-start" :level 'firecanyon - :trans - (new 'static 'vector :x -87377.1 :y 126444.75 :z -681697.25 :w 1.0) - :quat - (new 'static 'quaternion :y 0.9921 :w -0.1246) - :camera-trans - (new 'static 'vector :x -84559.055 :y 144685.47 :z -641194.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9976 0.0 0.0688 -0.01 0.9893 -0.1452 -0.068 -0.1456 -0.9869) + :trans (new 'static 'vector :x -87377.1 :y 126444.75 :z -681697.25 :w 1.0) + :quat (new 'static 'quaternion :y 0.9921 :w -0.1246) + :camera-trans (new 'static 'vector :x -84559.055 :y 144685.47 :z -641194.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9976 0.0 0.0688 -0.01 0.9893 -0.1452 -0.068 -0.1456 -0.9869) :load-commands '() :vis-nick 'fic :lev0 'firecanyon @@ -642,14 +543,10 @@ (new 'static 'continue-point :name "firecanyon-end" :level 'firecanyon - :trans - (new 'static 'vector :x 1360576.1 :y 126976.0 :z -5839533.5 :w 1.0) - :quat - (new 'static 'quaternion :y 0.1666 :w 0.986) - :camera-trans - (new 'static 'vector :x 1378912.6 :y 144452.81 :z -5872527.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.8847 0.0 0.466 -0.0744 0.9871 0.1414 -0.46 -0.1598 0.8733) + :trans (new 'static 'vector :x 1360576.1 :y 126976.0 :z -5839533.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.1666 :w 0.986) + :camera-trans (new 'static 'vector :x 1378912.6 :y 144452.81 :z -5872527.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8847 0.0 0.466 -0.0744 0.9871 0.1414 -0.46 -0.1598 0.8733) :load-commands '() :vis-nick 'fic :lev0 'village2 @@ -663,8 +560,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 419840.0 :y 151552.0 :z -3006464.0 :w 2048000.0) + :bsphere (new 'static 'sphere :x 419840.0 :y 151552.0 :z -3006464.0 :w 2048000.0) :buzzer 68 :bottom-height (meters -20) :run-packages '("common") @@ -673,8 +569,7 @@ ) ;; definition for symbol village2, type level-load-info -(define - village2 +(define village2 (new 'static 'level-load-info :index 8 :name 'village2 @@ -688,18 +583,13 @@ :mood-func 'update-mood-village2 :ocean '*ocean-map-village2* :sky #t - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "village2-start" :level 'village2 - :trans - (new 'static 'vector :x 1460961.2 :y 108562.02 :z -6161391.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.9917 :w 0.1278) - :camera-trans - (new 'static 'vector :x 1468018.8 :y 133790.92 :z -6096227.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9941 0.0 0.1076 -0.0261 0.9699 -0.2418 -0.1044 -0.2432 -0.9643) + :trans (new 'static 'vector :x 1460961.2 :y 108562.02 :z -6161391.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9917 :w 0.1278) + :camera-trans (new 'static 'vector :x 1468018.8 :y 133790.92 :z -6096227.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9941 0.0 0.1076 -0.0261 0.9699 -0.2418 -0.1044 -0.2432 -0.9643) :load-commands '() :vis-nick 'vi2 :lev0 'village2 @@ -710,15 +600,11 @@ (new 'static 'continue-point :name "village2-warp" :level 'village2 - :flags #x4 - :trans - (new 'static 'vector :x 1592492.9 :y 91648.0 :z -6328677.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.7469 :w 0.6648) - :camera-trans - (new 'static 'vector :x 1555766.1 :y 103759.46 :z -6318964.5 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.2562 0.0 -0.9666 -0.0253 0.9996 0.0067 0.9662 0.0262 -0.2561) + :flags (continue-flags warp) + :trans (new 'static 'vector :x 1592492.9 :y 91648.0 :z -6328677.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7469 :w 0.6648) + :camera-trans (new 'static 'vector :x 1555766.1 :y 103759.46 :z -6318964.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.2562 0.0 -0.9666 -0.0253 0.9996 0.0067 0.9662 0.0262 -0.2561) :load-commands '() :vis-nick 'vi2 :lev0 'village2 @@ -729,14 +615,10 @@ (new 'static 'continue-point :name "village2-dock" :level 'village2 - :trans - (new 'static 'vector :x 1264346.8 :y 19451.494 :z -6833563.5 :w 1.0) - :quat - (new 'static 'quaternion :y 0.0258 :w 0.9996) - :camera-trans - (new 'static 'vector :x 1265547.2 :y 34647.656 :z -6862636.5 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.9991 0.0 0.0411 -0.0088 0.9764 0.2155 -0.0401 -0.2156 0.9756) + :trans (new 'static 'vector :x 1264346.8 :y 19451.494 :z -6833563.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.0258 :w 0.9996) + :camera-trans (new 'static 'vector :x 1265547.2 :y 34647.656 :z -6862636.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9991 0.0 0.0411 -0.0088 0.9764 0.2155 -0.0401 -0.2156 0.9756) :load-commands '() :vis-nick 'vi2 :lev0 'village2 @@ -750,8 +632,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 1392640.0 :y 81920.0 :z -6770688.0 :w 696320.0) + :bsphere (new 'static 'sphere :x 1392640.0 :y 81920.0 :z -6770688.0 :w 696320.0) :buzzer 76 :bottom-height (meters -20) :run-packages '("common") @@ -760,8 +641,7 @@ ) ;; definition for symbol sunken, type level-load-info -(define - sunken +(define sunken (new 'static 'level-load-info :index 9 :name 'sunken @@ -775,18 +655,13 @@ :mood-func 'update-mood-sunken :ocean '*ocean-map-sunken* :sky #f - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "sunken-start" :level 'sunken - :trans - (new 'static 'vector :x 2172095.2 :y -591749.94 :z -6721553.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.5083 :w 0.8611) - :camera-trans - (new 'static 'vector :x 2138871.5 :y -572296.4 :z -6751967.5 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.7575 0.0 -0.6527 0.0858 0.9913 0.0995 0.647 -0.1314 0.7509) + :trans (new 'static 'vector :x 2172095.2 :y -591749.94 :z -6721553.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.5083 :w 0.8611) + :camera-trans (new 'static 'vector :x 2138871.5 :y -572296.4 :z -6751967.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7575 0.0 -0.6527 0.0858 0.9913 0.0995 0.647 -0.1314 0.7509) :load-commands '() :vis-nick 'sun :lev0 'sunken @@ -797,14 +672,10 @@ (new 'static 'continue-point :name "sunken1" :level 'sunken - :trans - (new 'static 'vector :x 3062988.5 :y -536575.56 :z -6527484.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.5304 :w 0.8477) - :camera-trans - (new 'static 'vector :x 3015461.2 :y -515480.38 :z -6546573.5 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.3725 0.0 -0.928 0.1121 0.9926 0.045 0.9212 -0.1208 0.3697) + :trans (new 'static 'vector :x 3062988.5 :y -536575.56 :z -6527484.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.5304 :w 0.8477) + :camera-trans (new 'static 'vector :x 3015461.2 :y -515480.38 :z -6546573.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.3725 0.0 -0.928 0.1121 0.9926 0.045 0.9212 -0.1208 0.3697) :load-commands '() :vis-nick 'sun :lev0 'sunken @@ -815,14 +686,10 @@ (new 'static 'continue-point :name "sunken2" :level 'sunken - :trans - (new 'static 'vector :x 3133625.5 :y -569343.56 :z -6909587.5 :w 1.0) - :quat - (new 'static 'quaternion :y -0.9512 :w 0.3083) - :camera-trans - (new 'static 'vector :x 3170833.2 :y -548244.25 :z -6874378.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.6872 0.0 0.7263 -0.0878 0.9926 -0.0831 -0.721 -0.1209 -0.6822) + :trans (new 'static 'vector :x 3133625.5 :y -569343.56 :z -6909587.5 :w 1.0) + :quat (new 'static 'quaternion :y -0.9512 :w 0.3083) + :camera-trans (new 'static 'vector :x 3170833.2 :y -548244.25 :z -6874378.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.6872 0.0 0.7263 -0.0878 0.9926 -0.0831 -0.721 -0.1209 -0.6822) :load-commands '() :vis-nick 'sun :lev0 'sunken @@ -833,14 +700,10 @@ (new 'static 'continue-point :name "sunken-tube1" :level 'sunken - :trans - (new 'static 'vector :x 2649601.8 :y -569343.56 :z -7132970.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.9936 :w 0.1124) - :camera-trans - (new 'static 'vector :x 2636150.2 :y -555656.4 :z -7114732.5 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.8024 0.0 -0.5967 0.1721 0.9574 -0.2315 0.5713 -0.2885 -0.7683) + :trans (new 'static 'vector :x 2649601.8 :y -569343.56 :z -7132970.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9936 :w 0.1124) + :camera-trans (new 'static 'vector :x 2636150.2 :y -555656.4 :z -7114732.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.8024 0.0 -0.5967 0.1721 0.9574 -0.2315 0.5713 -0.2885 -0.7683) :load-commands '() :vis-nick 'sun :lev0 'sunken @@ -854,8 +717,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 2867200.0 :y -2048000.0 :z -6553600.0 :w 2048000.0) + :bsphere (new 'static 'sphere :x 2867200.0 :y -2048000.0 :z -6553600.0 :w 2048000.0) :buzzer 49 :bottom-height (meters -500) :run-packages '("common") @@ -864,8 +726,7 @@ ) ;; definition for symbol sunkenb, type level-load-info -(define - sunkenb +(define sunkenb (new 'static 'level-load-info :index 10 :name 'sunkenb @@ -879,18 +740,13 @@ :mood-func 'update-mood-sunken :ocean '*ocean-map-sunken* :sky #t - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "sunkenb-start" :level 'sunkenb - :trans - (new 'static 'vector :x 2229231.2 :y -1019912.2 :z -6788748.5 :w 1.0) - :quat - (new 'static 'quaternion :y 0.895 :w 0.446) - :camera-trans - (new 'static 'vector :x 2187840.0 :y -998915.7 :z -6759328.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.5786 0.0 -0.8155 0.0992 0.9925 -0.0704 0.8094 -0.1217 -0.5743) + :trans (new 'static 'vector :x 2229231.2 :y -1019912.2 :z -6788748.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.895 :w 0.446) + :camera-trans (new 'static 'vector :x 2187840.0 :y -998915.7 :z -6759328.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.5786 0.0 -0.8155 0.0992 0.9925 -0.0704 0.8094 -0.1217 -0.5743) :load-commands '((alive "exit-chamber-1")) :vis-nick 'sub :lev0 'sunken @@ -901,14 +757,10 @@ (new 'static 'continue-point :name "sunkenb-helix" :level 'sunkenb - :trans - (new 'static 'vector :x 2466572.8 :y -1838989.2 :z -7299582.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.8841 :w 0.4672) - :camera-trans - (new 'static 'vector :x 2515616.2 :y -1817888.4 :z -7284843.5 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.2889 0.0 0.9573 -0.1163 0.9925 -0.0351 -0.9502 -0.1214 -0.2867) + :trans (new 'static 'vector :x 2466572.8 :y -1838989.2 :z -7299582.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.8841 :w 0.4672) + :camera-trans (new 'static 'vector :x 2515616.2 :y -1817888.4 :z -7284843.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.2889 0.0 0.9573 -0.1163 0.9925 -0.0351 -0.9502 -0.1214 -0.2867) :load-commands '() :vis-nick 'sub :lev0 'sunken @@ -922,8 +774,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 2867200.0 :y -2048000.0 :z -6553600.0 :w 2048000.0) + :bsphere (new 'static 'sphere :x 2867200.0 :y -2048000.0 :z -6553600.0 :w 2048000.0) :buzzer 49 :bottom-height (meters -500) :run-packages '("common" "sunken") @@ -932,8 +783,7 @@ ) ;; definition for symbol swamp, type level-load-info -(define - swamp +(define swamp (new 'static 'level-load-info :index 11 :name 'swamp @@ -947,20 +797,14 @@ :mood-func 'update-mood-swamp :ocean '*ocean-map-village2* :sky #t - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "swamp-start" :level 'swamp - :trans - (new 'static 'vector :x 1842537.2 :y 21027.227 :z -7333297.5 :w 1.0) - :quat - (new 'static 'quaternion :y -0.9933 :w 0.1153) - :camera-trans - (new 'static 'vector :x 1862529.9 :y 44371.56 :z -7277995.5 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9403 0.0 0.3402 -0.0814 0.9708 -0.2252 -0.3303 -0.2394 -0.9129) - :load-commands - '((special "swamp-blimp-3" #t) + :trans (new 'static 'vector :x 1842537.2 :y 21027.227 :z -7333297.5 :w 1.0) + :quat (new 'static 'quaternion :y -0.9933 :w 0.1153) + :camera-trans (new 'static 'vector :x 1862529.9 :y 44371.56 :z -7277995.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9403 0.0 0.3402 -0.0814 0.9708 -0.2252 -0.3303 -0.2394 -0.9129) + :load-commands '((special "swamp-blimp-3" #t) (special "precursor-arm-3" #t) (special "swamp-tetherrock-13" #t) (special "swamp-tetherrock-14" #t) @@ -976,16 +820,11 @@ (new 'static 'continue-point :name "swamp-dock1" :level 'swamp - :trans - (new 'static 'vector :x 1360386.9 :y 5823.693 :z -8218890.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.585 :w -0.811) - :camera-trans - (new 'static 'vector :x 1314475.6 :y 26164.838 :z -8234152.5 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.3154 0.0 -0.9489 0.1134 0.9928 0.0376 0.9421 -0.1195 0.3131) - :load-commands - '((special "swamp-blimp-3" #t) + :trans (new 'static 'vector :x 1360386.9 :y 5823.693 :z -8218890.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.585 :w -0.811) + :camera-trans (new 'static 'vector :x 1314475.6 :y 26164.838 :z -8234152.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.3154 0.0 -0.9489 0.1134 0.9928 0.0376 0.9421 -0.1195 0.3131) + :load-commands '((special "swamp-blimp-3" #t) (special "precursor-arm-3" #t) (special "swamp-tetherrock-13" #t) (special "swamp-tetherrock-14" #t) @@ -1001,16 +840,11 @@ (new 'static 'continue-point :name "swamp-cave1" :level 'swamp - :trans - (new 'static 'vector :x 1553700.5 :y 1835.4176 :z -8258429.5 :w 1.0) - :quat - (new 'static 'quaternion :y -0.9871 :w -0.1599) - :camera-trans - (new 'static 'vector :x 1556873.2 :y 22715.598 :z -8208106.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9982 0.0 0.0596 -0.0072 0.9926 -0.1209 -0.0592 -0.1211 -0.9908) - :load-commands - '((special "swamp-blimp-3" #t) + :trans (new 'static 'vector :x 1553700.5 :y 1835.4176 :z -8258429.5 :w 1.0) + :quat (new 'static 'quaternion :y -0.9871 :w -0.1599) + :camera-trans (new 'static 'vector :x 1556873.2 :y 22715.598 :z -8208106.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9982 0.0 0.0596 -0.0072 0.9926 -0.1209 -0.0592 -0.1211 -0.9908) + :load-commands '((special "swamp-blimp-3" #t) (special "precursor-arm-3" #t) (special "swamp-tetherrock-13" #t) (special "swamp-tetherrock-14" #t) @@ -1026,16 +860,11 @@ (new 'static 'continue-point :name "swamp-dock2" :level 'swamp - :trans - (new 'static 'vector :x 1645872.4 :y 36495.77 :z -8427323.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.8294 :w -0.5586) - :camera-trans - (new 'static 'vector :x 1599338.9 :y 57590.168 :z -8405954.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.418 0.0 -0.9084 0.1106 0.9925 -0.0509 0.9016 -0.1218 -0.4149) - :load-commands - '((special "swamp-blimp-3" #t) + :trans (new 'static 'vector :x 1645872.4 :y 36495.77 :z -8427323.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.8294 :w -0.5586) + :camera-trans (new 'static 'vector :x 1599338.9 :y 57590.168 :z -8405954.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.418 0.0 -0.9084 0.1106 0.9925 -0.0509 0.9016 -0.1218 -0.4149) + :load-commands '((special "swamp-blimp-3" #t) (special "precursor-arm-3" #t) (special "swamp-tetherrock-13" #t) (special "swamp-tetherrock-14" #t) @@ -1051,16 +880,11 @@ (new 'static 'continue-point :name "swamp-cave2" :level 'swamp - :trans - (new 'static 'vector :x 2037539.2 :y 1103.872 :z -8560013.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.0559 :w 0.9984) - :camera-trans - (new 'static 'vector :x 1995208.2 :y 21832.908 :z -8586304.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.5516 0.0 -0.834 0.097 0.9932 0.0641 0.8283 -0.1163 0.5479) - :load-commands - '((special "swamp-blimp-3" #t) + :trans (new 'static 'vector :x 2037539.2 :y 1103.872 :z -8560013.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.0559 :w 0.9984) + :camera-trans (new 'static 'vector :x 1995208.2 :y 21832.908 :z -8586304.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.5516 0.0 -0.834 0.097 0.9932 0.0641 0.8283 -0.1163 0.5479) + :load-commands '((special "swamp-blimp-3" #t) (special "precursor-arm-3" #t) (special "swamp-tetherrock-13" #t) (special "swamp-tetherrock-14" #t) @@ -1076,16 +900,11 @@ (new 'static 'continue-point :name "swamp-game" :level 'swamp - :trans - (new 'static 'vector :x 2612289.2 :y -2047.5905 :z -8315907.5 :w 1.0) - :quat - (new 'static 'quaternion :y -0.6975 :w 0.7165) - :camera-trans - (new 'static 'vector :x 2661940.5 :y 20693.81 :z -8317980.5 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.0406 0.0 0.9991 -0.1452 0.9893 0.0059 -0.9885 -0.1453 0.0402) - :load-commands - '((special "swamp-blimp-3" #t) + :trans (new 'static 'vector :x 2612289.2 :y -2047.5905 :z -8315907.5 :w 1.0) + :quat (new 'static 'quaternion :y -0.6975 :w 0.7165) + :camera-trans (new 'static 'vector :x 2661940.5 :y 20693.81 :z -8317980.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.0406 0.0 0.9991 -0.1452 0.9893 0.0059 -0.9885 -0.1453 0.0402) + :load-commands '((special "swamp-blimp-3" #t) (special "precursor-arm-3" #t) (special "swamp-tetherrock-13" #t) (special "swamp-tetherrock-14" #t) @@ -1101,16 +920,11 @@ (new 'static 'continue-point :name "swamp-cave3" :level 'swamp - :trans - (new 'static 'vector :x 2011811.4 :y 3711.7952 :z -7923027.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.5269 :w 0.8499) - :camera-trans - (new 'static 'vector :x 2053120.4 :y 22242.51 :z -7927784.5 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.1145 0.0 0.9934 -0.1412 0.9898 0.0162 -0.9833 -0.1422 0.1134) - :load-commands - '((special "swamp-blimp-3" #t) + :trans (new 'static 'vector :x 2011811.4 :y 3711.7952 :z -7923027.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.5269 :w 0.8499) + :camera-trans (new 'static 'vector :x 2053120.4 :y 22242.51 :z -7927784.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.1145 0.0 0.9934 -0.1412 0.9898 0.0162 -0.9833 -0.1422 0.1134) + :load-commands '((special "swamp-blimp-3" #t) (special "precursor-arm-3" #t) (special "swamp-tetherrock-13" #t) (special "swamp-tetherrock-14" #t) @@ -1129,8 +943,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 1986560.0 :z -8417280.0 :w 1003520.0) + :bsphere (new 'static 'sphere :x 1986560.0 :z -8417280.0 :w 1003520.0) :buzzer 43 :bottom-height (meters -20) :run-packages '("common") @@ -1139,8 +952,7 @@ ) ;; definition for symbol rolling, type level-load-info -(define - rolling +(define rolling (new 'static 'level-load-info :index 12 :name 'rolling @@ -1154,18 +966,13 @@ :mood-func 'update-mood-rolling :ocean 'none :sky #t - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "rolling-start" :level 'rolling - :trans - (new 'static 'vector :x 432272.6 :y 42821.633 :z -6737529.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.545 :w 0.8383) - :camera-trans - (new 'static 'vector :x 494105.8 :y 67237.48 :z -6748524.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.1759 0.0 0.9843 -0.2371 0.9705 0.0423 -0.9553 -0.2409 0.1707) + :trans (new 'static 'vector :x 432272.6 :y 42821.633 :z -6737529.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.545 :w 0.8383) + :camera-trans (new 'static 'vector :x 494105.8 :y 67237.48 :z -6748524.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.1759 0.0 0.9843 -0.2371 0.9705 0.0423 -0.9553 -0.2409 0.1707) :load-commands '() :vis-nick 'rol :lev0 'rolling @@ -1179,8 +986,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x -753664.0 :y 131072.0 :z -6569984.0 :w 974848.0) + :bsphere (new 'static 'sphere :x -753664.0 :y 131072.0 :z -6569984.0 :w 974848.0) :buzzer 57 :bottom-height (meters -20) :run-packages '("common") @@ -1189,8 +995,7 @@ ) ;; definition for symbol ogre, type level-load-info -(define - ogre +(define ogre (new 'static 'level-load-info :index 13 :name 'ogre @@ -1204,18 +1009,13 @@ :mood-func 'update-mood-ogre :ocean 'none :sky #t - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "ogre-start" :level 'ogre - :trans - (new 'static 'vector :x 849775.8 :y 163962.88 :z -7301166.5 :w 1.0) - :quat - (new 'static 'quaternion :y -0.9931 :w 0.1166) - :camera-trans - (new 'static 'vector :x 848906.25 :y 185056.88 :z -7249962.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9998 0.0 -0.0159 0.0019 0.9925 -0.1215 0.0158 -0.1215 -0.9924) + :trans (new 'static 'vector :x 849775.8 :y 163962.88 :z -7301166.5 :w 1.0) + :quat (new 'static 'quaternion :y -0.9931 :w 0.1166) + :camera-trans (new 'static 'vector :x 848906.25 :y 185056.88 :z -7249962.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9998 0.0 -0.0159 0.0019 0.9925 -0.1215 0.0158 -0.1215 -0.9924) :load-commands '() :vis-nick 'ogr :lev0 'ogre @@ -1226,14 +1026,10 @@ (new 'static 'continue-point :name "ogre-race" :level 'ogre - :trans - (new 'static 'vector :x 841424.9 :y 163801.1 :z -8205419.5 :w 1.0) - :quat - (new 'static 'quaternion :y -0.9857 :w 0.168) - :camera-trans - (new 'static 'vector :x 860479.9 :y 183815.38 :z -8162368.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9145 0.0 0.4045 -0.0497 0.9924 -0.1125 -0.4015 -0.123 -0.9075) + :trans (new 'static 'vector :x 841424.9 :y 163801.1 :z -8205419.5 :w 1.0) + :quat (new 'static 'quaternion :y -0.9857 :w 0.168) + :camera-trans (new 'static 'vector :x 860479.9 :y 183815.38 :z -8162368.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9145 0.0 0.4045 -0.0497 0.9924 -0.1125 -0.4015 -0.123 -0.9075) :load-commands '() :vis-nick 'ogr :lev0 'ogre @@ -1244,14 +1040,10 @@ (new 'static 'continue-point :name "ogre-end" :level 'ogre - :trans - (new 'static 'vector :x 3971233.5 :y 141227.62 :z -13935735.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.8721 :w 0.4892) - :camera-trans - (new 'static 'vector :x 3997892.2 :y 159604.73 :z -13904449.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.7611 0.0 0.6485 -0.0932 0.9896 -0.1094 -0.6417 -0.1438 -0.7532) + :trans (new 'static 'vector :x 3971233.5 :y 141227.62 :z -13935735.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.8721 :w 0.4892) + :camera-trans (new 'static 'vector :x 3997892.2 :y 159604.73 :z -13904449.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.7611 0.0 0.6485 -0.0932 0.9896 -0.1094 -0.6417 -0.1438 -0.7532) :load-commands '() :vis-nick 'ogr :lev0 'village3 @@ -1265,8 +1057,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 2334720.0 :y 180224.0 :z -10653696.0 :w 3653632.0) + :bsphere (new 'static 'sphere :x 2334720.0 :y 180224.0 :z -10653696.0 :w 3653632.0) :buzzer 88 :bottom-height (meters -20) :run-packages '("common") @@ -1275,8 +1066,7 @@ ) ;; definition for symbol village3, type level-load-info -(define - village3 +(define village3 (new 'static 'level-load-info :index 14 :name 'village3 @@ -1290,18 +1080,13 @@ :mood-func 'update-mood-village3 :ocean #f :sky #t - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "village3-start" :level 'village3 - :trans - (new 'static 'vector :x 4468021.5 :y 186608.03 :z -14054268.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.9999 :w 0.005) - :camera-trans - (new 'static 'vector :x 4469439.5 :y 207701.2 :z -14003077.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9996 0.0 0.0268 -0.0032 0.9925 -0.1216 -0.0266 -0.1216 -0.9922) + :trans (new 'static 'vector :x 4468021.5 :y 186608.03 :z -14054268.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9999 :w 0.005) + :camera-trans (new 'static 'vector :x 4469439.5 :y 207701.2 :z -14003077.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9996 0.0 0.0268 -0.0032 0.9925 -0.1216 -0.0266 -0.1216 -0.9922) :load-commands '() :vis-nick 'vi3 :lev0 'village3 @@ -1312,15 +1097,11 @@ (new 'static 'continue-point :name "village3-warp" :level 'village3 - :flags #x4 - :trans - (new 'static 'vector :x 4549776.0 :y 215375.88 :z -14285922.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.681 :w 0.7322) - :camera-trans - (new 'static 'vector :x 4543255.0 :y 226776.67 :z -14313317.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.8563 0.0 -0.2763 0.0456 0.8875 0.1413 0.2725 -0.1485 0.8446) + :flags (continue-flags warp) + :trans (new 'static 'vector :x 4549776.0 :y 215375.88 :z -14285922.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.681 :w 0.7322) + :camera-trans (new 'static 'vector :x 4543255.0 :y 226776.67 :z -14313317.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8563 0.0 -0.2763 0.0456 0.8875 0.1413 0.2725 -0.1485 0.8446) :load-commands '() :vis-nick 'vi3 :lev0 'village3 @@ -1331,14 +1112,10 @@ (new 'static 'continue-point :name "village3-farside" :level 'village3 - :trans - (new 'static 'vector :x 4423744.0 :y 198723.58 :z -14530641.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.6611 :w 0.7502) - :camera-trans - (new 'static 'vector :x 4381844.0 :y 218599.83 :z -14551361.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.442 0.0 -0.8969 0.1099 0.9924 0.0541 0.8902 -0.1225 0.4387) + :trans (new 'static 'vector :x 4423744.0 :y 198723.58 :z -14530641.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.6611 :w 0.7502) + :camera-trans (new 'static 'vector :x 4381844.0 :y 218599.83 :z -14551361.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.442 0.0 -0.8969 0.1099 0.9924 0.0541 0.8902 -0.1225 0.4387) :load-commands '() :vis-nick 'vi3 :lev0 'village3 @@ -1352,8 +1129,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 4571136.0 :y 389120.0 :z -14323712.0 :w 409600.0) + :bsphere (new 'static 'sphere :x 4571136.0 :y 389120.0 :z -14323712.0 :w 409600.0) :buzzer 77 :bottom-height (meters -20) :run-packages '("common") @@ -1362,8 +1138,7 @@ ) ;; definition for symbol snow, type level-load-info -(define - snow +(define snow (new 'static 'level-load-info :index 15 :name 'snow @@ -1378,18 +1153,13 @@ :ocean #f :sky #t :sun-fade 0.5 - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "snow-start" :level 'snow - :trans - (new 'static 'vector :x 4256260.0 :y 983713.8 :z -14182752.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.7906 :w -0.6122) - :camera-trans - (new 'static 'vector :x 4303859.5 :y 1012363.7 :z -14156672.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.4804 0.0 0.877 -0.2049 0.9723 -0.1122 -0.8527 -0.2336 -0.4671) + :trans (new 'static 'vector :x 4256260.0 :y 983713.8 :z -14182752.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7906 :w -0.6122) + :camera-trans (new 'static 'vector :x 4303859.5 :y 1012363.7 :z -14156672.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.4804 0.0 0.877 -0.2049 0.9723 -0.1122 -0.8527 -0.2336 -0.4671) :load-commands '() :vis-nick 'sno :lev0 'snow @@ -1400,14 +1170,10 @@ (new 'static 'continue-point :name "snow-fort" :level 'snow - :trans - (new 'static 'vector :x 3430875.2 :y 897149.3 :z -13397581.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.0968 :w 0.9952) - :camera-trans - (new 'static 'vector :x 3428789.8 :y 918241.25 :z -13448724.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.9991 0.0 -0.0419 0.0051 0.9925 0.1216 0.0415 -0.1217 0.9916) + :trans (new 'static 'vector :x 3430875.2 :y 897149.3 :z -13397581.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.0968 :w 0.9952) + :camera-trans (new 'static 'vector :x 3428789.8 :y 918241.25 :z -13448724.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9991 0.0 -0.0419 0.0051 0.9925 0.1216 0.0415 -0.1217 0.9916) :load-commands '() :vis-nick 'sno :lev0 'snow @@ -1418,14 +1184,10 @@ (new 'static 'continue-point :name "snow-flut-flut" :level 'snow - :trans - (new 'static 'vector :x 2481850.0 :y 1054709.4 :z -13922438.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.8628 :w -0.5055) - :camera-trans - (new 'static 'vector :x 2497063.0 :y 1069339.9 :z -13900353.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.8224 0.0 0.5688 -0.135 0.9713 -0.1953 -0.5525 -0.2374 -0.7989) + :trans (new 'static 'vector :x 2481850.0 :y 1054709.4 :z -13922438.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.8628 :w -0.5055) + :camera-trans (new 'static 'vector :x 2497063.0 :y 1069339.9 :z -13900353.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.8224 0.0 0.5688 -0.135 0.9713 -0.1953 -0.5525 -0.2374 -0.7989) :load-commands '() :vis-nick 'sno :lev0 'snow @@ -1436,14 +1198,10 @@ (new 'static 'continue-point :name "snow-pass-to-fort" :level 'snow - :trans - (new 'static 'vector :x 3751044.8 :y 917612.1 :z -13828696.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.3387 :w -0.9408) - :camera-trans - (new 'static 'vector :x 3779776.0 :y 933972.8 :z -13845825.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.6061 0.0 0.7953 -0.1493 0.9822 0.1138 -0.7812 -0.1878 0.5953) + :trans (new 'static 'vector :x 3751044.8 :y 917612.1 :z -13828696.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.3387 :w -0.9408) + :camera-trans (new 'static 'vector :x 3779776.0 :y 933972.8 :z -13845825.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.6061 0.0 0.7953 -0.1493 0.9822 0.1138 -0.7812 -0.1878 0.5953) :load-commands '() :vis-nick 'sno :lev0 'snow @@ -1454,14 +1212,10 @@ (new 'static 'continue-point :name "snow-by-ice-lake" :level 'snow - :trans - (new 'static 'vector :x 3151164.5 :y 1049638.1 :z -14246464.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.6226 :w 0.7824) - :camera-trans - (new 'static 'vector :x 3203905.2 :y 1080037.8 :z -14270850.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.4189 0.0 0.9079 -0.2169 0.971 0.1001 -0.8816 -0.2389 0.4068) + :trans (new 'static 'vector :x 3151164.5 :y 1049638.1 :z -14246464.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.6226 :w 0.7824) + :camera-trans (new 'static 'vector :x 3203905.2 :y 1080037.8 :z -14270850.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.4189 0.0 0.9079 -0.2169 0.971 0.1001 -0.8816 -0.2389 0.4068) :load-commands '() :vis-nick 'sno :lev0 'snow @@ -1472,14 +1226,10 @@ (new 'static 'continue-point :name "snow-by-ice-lake-alt" :level 'snow - :trans - (new 'static 'vector :x 3053335.0 :y 1048927.9 :z -14058945.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.9997 :w 0.022) - :camera-trans - (new 'static 'vector :x 3045845.5 :y 1068868.0 :z -14012568.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.987 0.0 -0.1601 0.0195 0.9924 -0.1207 0.1589 -0.1223 -0.9796) + :trans (new 'static 'vector :x 3053335.0 :y 1048927.9 :z -14058945.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9997 :w 0.022) + :camera-trans (new 'static 'vector :x 3045845.5 :y 1068868.0 :z -14012568.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.987 0.0 -0.1601 0.0195 0.9924 -0.1207 0.1589 -0.1223 -0.9796) :load-commands '() :vis-nick 'sno :lev0 'snow @@ -1490,14 +1240,10 @@ (new 'static 'continue-point :name "snow-outside-fort" :level 'snow - :trans - (new 'static 'vector :x 3431014.0 :y 901474.7 :z -13600187.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.0954 :w -0.9954) - :camera-trans - (new 'static 'vector :x 3429969.0 :y 922565.44 :z -13651353.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.9998 0.0 -0.0196 0.0023 0.9926 0.1213 0.0195 -0.1213 0.9924) + :trans (new 'static 'vector :x 3431014.0 :y 901474.7 :z -13600187.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.0954 :w -0.9954) + :camera-trans (new 'static 'vector :x 3429969.0 :y 922565.44 :z -13651353.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9998 0.0 -0.0196 0.0023 0.9926 0.1213 0.0195 -0.1213 0.9924) :load-commands '() :vis-nick 'sno :lev0 'snow @@ -1508,14 +1254,10 @@ (new 'static 'continue-point :name "snow-outside-cave" :level 'snow - :trans - (new 'static 'vector :x 3200864.2 :y 907400.4 :z -13676660.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.5867 :w -0.8097) - :camera-trans - (new 'static 'vector :x 3247600.8 :y 928464.06 :z -13697606.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.4062 0.0 0.9137 -0.1107 0.9926 0.0492 -0.907 -0.1211 0.4032) + :trans (new 'static 'vector :x 3200864.2 :y 907400.4 :z -13676660.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.5867 :w -0.8097) + :camera-trans (new 'static 'vector :x 3247600.8 :y 928464.06 :z -13697606.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.4062 0.0 0.9137 -0.1107 0.9926 0.0492 -0.907 -0.1211 0.4032) :load-commands '() :vis-nick 'sno :lev0 'snow @@ -1526,14 +1268,10 @@ (new 'static 'continue-point :name "snow-across-from-flut" :level 'snow - :trans - (new 'static 'vector :x 2721898.5 :y 1049845.0 :z -13743428.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.7688 :w -0.6394) - :camera-trans - (new 'static 'vector :x 2712702.5 :y 1070288.5 :z -13791593.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.9554 0.0 -0.2951 0.0343 0.9932 0.1111 0.2931 -0.1163 0.9489) + :trans (new 'static 'vector :x 2721898.5 :y 1049845.0 :z -13743428.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.7688 :w -0.6394) + :camera-trans (new 'static 'vector :x 2712702.5 :y 1070288.5 :z -13791593.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9554 0.0 -0.2951 0.0343 0.9932 0.1111 0.2931 -0.1163 0.9489) :load-commands '() :vis-nick 'sno :lev0 'snow @@ -1547,8 +1285,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 3072000.0 :y 1142784.0 :z -14028800.0 :w 1290240.0) + :bsphere (new 'static 'sphere :x 3072000.0 :y 1142784.0 :z -14028800.0 :w 1290240.0) :buzzer 65 :bottom-height (meters 128) :run-packages '("common") @@ -1557,8 +1294,7 @@ ) ;; definition for symbol maincave, type level-load-info -(define - maincave +(define maincave (new 'static 'level-load-info :index 16 :name 'maincave @@ -1572,18 +1308,13 @@ :mood-func 'update-mood-maincave :ocean #f :sky #f - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "maincave-start" :level 'maincave - :trans - (new 'static 'vector :x 4420967.0 :y 33006.387 :z -13154230.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.0174 :w -0.9998) - :camera-trans - (new 'static 'vector :x 4428164.5 :y 54074.164 :z -13204933.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.99 0.0 0.1405 -0.0169 0.9927 0.1192 -0.1395 -0.1204 0.9828) + :trans (new 'static 'vector :x 4420967.0 :y 33006.387 :z -13154230.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.0174 :w -0.9998) + :camera-trans (new 'static 'vector :x 4428164.5 :y 54074.164 :z -13204933.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.99 0.0 0.1405 -0.0169 0.9927 0.1192 -0.1395 -0.1204 0.9828) :load-commands '() :vis-nick 'mai :lev0 'maincave @@ -1594,14 +1325,10 @@ (new 'static 'continue-point :name "maincave-to-darkcave" :level 'maincave - :trans - (new 'static 'vector :x 4172175.8 :y 154223.83 :z -12445165.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.2093 :w 0.9778) - :camera-trans - (new 'static 'vector :x 4193893.2 :y 175317.81 :z -12491520.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.9052 0.0 0.4248 -0.0514 0.9926 0.1096 -0.4217 -0.1211 0.8986) + :trans (new 'static 'vector :x 4172175.8 :y 154223.83 :z -12445165.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.2093 :w 0.9778) + :camera-trans (new 'static 'vector :x 4193893.2 :y 175317.81 :z -12491520.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9052 0.0 0.4248 -0.0514 0.9926 0.1096 -0.4217 -0.1211 0.8986) :load-commands '() :vis-nick 'mai :lev0 'maincave @@ -1612,14 +1339,10 @@ (new 'static 'continue-point :name "maincave-to-robocave" :level 'maincave - :trans - (new 'static 'vector :x 4760896.5 :y 44221.234 :z -12409880.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.548 :w 0.8364) - :camera-trans - (new 'static 'vector :x 4745230.0 :y 57869.926 :z -12426885.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.7343 0.0 -0.6788 0.1872 0.9611 0.2026 0.6524 -0.2759 0.7058) + :trans (new 'static 'vector :x 4760896.5 :y 44221.234 :z -12409880.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.548 :w 0.8364) + :camera-trans (new 'static 'vector :x 4745230.0 :y 57869.926 :z -12426885.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7343 0.0 -0.6788 0.1872 0.9611 0.2026 0.6524 -0.2759 0.7058) :load-commands '() :vis-nick 'mai :lev0 'maincave @@ -1633,8 +1356,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 4517888.0 :y 114688.0 :z -12484608.0 :w 655360.0) + :bsphere (new 'static 'sphere :x 4517888.0 :y 114688.0 :z -12484608.0 :w 655360.0) :buzzer 85 :bottom-height (meters -60) :run-packages '("common") @@ -1643,8 +1365,7 @@ ) ;; definition for symbol darkcave, type level-load-info -(define - darkcave +(define darkcave (new 'static 'level-load-info :index 17 :name 'darkcave @@ -1658,18 +1379,13 @@ :mood-func 'update-mood-darkcave :ocean #f :sky #f - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "darkcave-start" :level 'darkcave - :trans - (new 'static 'vector :x 3813246.2 :y 129487.664 :z -12114304.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.1439 :w 0.9895) - :camera-trans - (new 'static 'vector :x 3793301.0 :y 145573.48 :z -12139847.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.7892 0.0 -0.614 0.1178 0.9813 0.1515 0.6026 -0.1919 0.7745) + :trans (new 'static 'vector :x 3813246.2 :y 129487.664 :z -12114304.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.1439 :w 0.9895) + :camera-trans (new 'static 'vector :x 3793301.0 :y 145573.48 :z -12139847.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7892 0.0 -0.614 0.1178 0.9813 0.1515 0.6026 -0.1919 0.7745) :load-commands '() :vis-nick 'dar :lev0 'maincave @@ -1683,8 +1399,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 3620864.0 :y 266240.0 :z -11935744.0 :w 368640.0) + :bsphere (new 'static 'sphere :x 3620864.0 :y 266240.0 :z -11935744.0 :w 368640.0) :buzzer 85 :bottom-height (meters -60) :run-packages '("common" "maincave") @@ -1693,8 +1408,7 @@ ) ;; definition for symbol robocave, type level-load-info -(define - robocave +(define robocave (new 'static 'level-load-info :index 18 :name 'robocave @@ -1708,18 +1422,13 @@ :mood-func 'update-mood-robocave :ocean #f :sky #f - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "robocave-start" :level 'robocave - :trans - (new 'static 'vector :x 5208223.5 :y 69697.945 :z -11781496.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.3654 :w -0.9308) - :camera-trans - (new 'static 'vector :x 5171715.0 :y 90796.85 :z -11817413.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.7006 0.0 -0.7134 0.0864 0.9926 0.0849 0.7082 -0.1212 0.6954) + :trans (new 'static 'vector :x 5208223.5 :y 69697.945 :z -11781496.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.3654 :w -0.9308) + :camera-trans (new 'static 'vector :x 5171715.0 :y 90796.85 :z -11817413.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7006 0.0 -0.7134 0.0864 0.9926 0.0849 0.7082 -0.1212 0.6954) :load-commands '() :vis-nick 'rob :lev0 'maincave @@ -1730,14 +1439,10 @@ (new 'static 'continue-point :name "robocave-bottom" :level 'robocave - :trans - (new 'static 'vector :x 5435461.5 :y -97111.24 :z -11588379.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.1086 :w 0.994) - :camera-trans - (new 'static 'vector :x 5409966.5 :y -76017.664 :z -11632764.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.8662 0.0 -0.4996 0.0605 0.9926 0.105 0.4959 -0.1212 0.8598) + :trans (new 'static 'vector :x 5435461.5 :y -97111.24 :z -11588379.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.1086 :w 0.994) + :camera-trans (new 'static 'vector :x 5409966.5 :y -76017.664 :z -11632764.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8662 0.0 -0.4996 0.0605 0.9926 0.105 0.4959 -0.1212 0.8598) :load-commands '() :vis-nick 'rob :lev0 'maincave @@ -1751,8 +1456,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 5529600.0 :y 81920.0 :z -11468800.0 :w 512000.0) + :bsphere (new 'static 'sphere :x 5529600.0 :y 81920.0 :z -11468800.0 :w 512000.0) :buzzer 85 :bottom-height (meters -60) :run-packages '("common" "maincave") @@ -1761,8 +1465,7 @@ ) ;; definition for symbol lavatube, type level-load-info -(define - lavatube +(define lavatube (new 'static 'level-load-info :index 19 :name 'lavatube @@ -1776,18 +1479,13 @@ :mood-func 'update-mood-lavatube :ocean #f :sky #f - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "lavatube-start" :level 'lavatube - :trans - (new 'static 'vector :x 5511317.0 :y 159871.8 :z -14621239.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.3753 :w -0.9268) - :camera-trans - (new 'static 'vector :x 5510636.5 :y 197720.06 :z -14663128.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.9992 0.0 -0.0386 0.0178 0.8875 0.4603 0.0343 -0.4606 0.8868) + :trans (new 'static 'vector :x 5511317.0 :y 159871.8 :z -14621239.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.3753 :w -0.9268) + :camera-trans (new 'static 'vector :x 5510636.5 :y 197720.06 :z -14663128.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9992 0.0 -0.0386 0.0178 0.8875 0.4603 0.0343 -0.4606 0.8868) :load-commands '() :vis-nick 'lav :lev0 'lavatube @@ -1798,14 +1496,10 @@ (new 'static 'continue-point :name "lavatube-middle" :level 'lavatube - :trans - (new 'static 'vector :x 9081441.0 :y -3935.8464 :z -14056285.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.7002 :w -0.7139) - :camera-trans - (new 'static 'vector :x 9055362.0 :y 10606.592 :z -14050822.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.205 0.0 -0.9787 0.2321 0.9714 -0.0486 0.9508 -0.2371 -0.1991) + :trans (new 'static 'vector :x 9081441.0 :y -3935.8464 :z -14056285.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.7002 :w -0.7139) + :camera-trans (new 'static 'vector :x 9055362.0 :y 10606.592 :z -14050822.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.205 0.0 -0.9787 0.2321 0.9714 -0.0486 0.9508 -0.2371 -0.1991) :load-commands '() :vis-nick 'lav :lev0 'lavatube @@ -1816,14 +1510,10 @@ (new 'static 'continue-point :name "lavatube-after-ribbon" :level 'lavatube - :trans - (new 'static 'vector :x 9954895.0 :y 390513.06 :z -16548614.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.7485 :w -0.663) - :camera-trans - (new 'static 'vector :x 9923721.0 :y 406466.16 :z -16541633.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.2191 0.0 -0.9756 0.1906 0.9807 -0.0428 0.9568 -0.1953 -0.2149) + :trans (new 'static 'vector :x 9954895.0 :y 390513.06 :z -16548614.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.7485 :w -0.663) + :camera-trans (new 'static 'vector :x 9923721.0 :y 406466.16 :z -16541633.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.2191 0.0 -0.9756 0.1906 0.9807 -0.0428 0.9568 -0.1953 -0.2149) :load-commands '() :vis-nick 'lav :lev0 'lavatube @@ -1834,14 +1524,10 @@ (new 'static 'continue-point :name "lavatube-end" :level 'lavatube - :trans - (new 'static 'vector :x 11479892.0 :y -163656.5 :z -18266490.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.9589 :w -0.2836) - :camera-trans - (new 'static 'vector :x 11526721.0 :y -143482.47 :z -18257412.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.3027 0.0 0.953 -0.1235 0.9915 -0.0392 -0.945 -0.1296 -0.3001) + :trans (new 'static 'vector :x 11479892.0 :y -163656.5 :z -18266490.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9589 :w -0.2836) + :camera-trans (new 'static 'vector :x 11526721.0 :y -143482.47 :z -18257412.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.3027 0.0 0.953 -0.1235 0.9915 -0.0392 -0.945 -0.1296 -0.3001) :load-commands '() :vis-nick 'lav :lev0 'lavatube @@ -1855,8 +1541,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 8806400.0 :y 131072.0 :z -15564800.0 :w 3174400.0) + :bsphere (new 'static 'sphere :x 8806400.0 :y 131072.0 :z -15564800.0 :w 3174400.0) :buzzer 90 :bottom-height (meters -70) :run-packages '("common") @@ -1865,8 +1550,7 @@ ) ;; definition for symbol citadel, type level-load-info -(define - citadel +(define citadel (new 'static 'level-load-info :index 20 :name 'citadel @@ -1880,18 +1564,13 @@ :mood-func 'update-mood-citadel :ocean #f :sky #f - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "citadel-start" :level 'citadel - :trans - (new 'static 'vector :x 11442706.0 :y -142755.84 :z -18869044.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.9992 :w 0.0392) - :camera-trans - (new 'static 'vector :x 11441183.0 :y -122509.31 :z -18820882.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9991 0.0 -0.0411 0.005 0.9925 -0.122 0.0408 -0.1221 -0.9916) + :trans (new 'static 'vector :x 11442706.0 :y -142755.84 :z -18869044.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9992 :w 0.0392) + :camera-trans (new 'static 'vector :x 11441183.0 :y -122509.31 :z -18820882.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9991 0.0 -0.0411 0.005 0.9925 -0.122 0.0408 -0.1221 -0.9916) :load-commands '() :vis-nick 'cit :lev0 'citadel @@ -1902,14 +1581,10 @@ (new 'static 'continue-point :name "citadel-entrance" :level 'citadel - :trans - (new 'static 'vector :x 11443969.0 :y -154216.03 :z -18472782.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.9728 :w 0.2314) - :camera-trans - (new 'static 'vector :x 11436929.0 :y -134244.36 :z -18426254.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9898 0.0 -0.1424 0.0173 0.9925 -0.1207 0.1413 -0.1219 -0.9824) + :trans (new 'static 'vector :x 11443969.0 :y -154216.03 :z -18472782.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9728 :w 0.2314) + :camera-trans (new 'static 'vector :x 11436929.0 :y -134244.36 :z -18426254.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9898 0.0 -0.1424 0.0173 0.9925 -0.1207 0.1413 -0.1219 -0.9824) :load-commands '() :vis-nick 'cit :lev0 'citadel @@ -1920,15 +1595,11 @@ (new 'static 'continue-point :name "citadel-warp" :level 'citadel - :flags #x4 - :trans - (new 'static 'vector :x 11454895.0 :y -161791.6 :z -18204690.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.7511 :w 0.6601) - :camera-trans - (new 'static 'vector :x 11406872.0 :y -141278.0 :z -18194638.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.1989 0.0 -0.98 0.1179 0.9927 -0.0239 0.9728 -0.1203 -0.1974) + :flags (continue-flags warp) + :trans (new 'static 'vector :x 11454895.0 :y -161791.6 :z -18204690.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7511 :w 0.6601) + :camera-trans (new 'static 'vector :x 11406872.0 :y -141278.0 :z -18194638.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.1989 0.0 -0.98 0.1179 0.9927 -0.0239 0.9728 -0.1203 -0.1974) :load-commands '() :vis-nick 'cit :lev0 'citadel @@ -1939,14 +1610,10 @@ (new 'static 'continue-point :name "citadel-launch-start" :level 'citadel - :trans - (new 'static 'vector :x 10827551.0 :y -94047.02 :z -18946718.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.8377 :w -0.546) - :camera-trans - (new 'static 'vector :x 10862150.0 :y -75343.875 :z -18922316.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.5766 0.0 0.8169 -0.1125 0.9904 -0.0794 -0.8091 -0.1378 -0.5711) + :trans (new 'static 'vector :x 10827551.0 :y -94047.02 :z -18946718.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.8377 :w -0.546) + :camera-trans (new 'static 'vector :x 10862150.0 :y -75343.875 :z -18922316.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.5766 0.0 0.8169 -0.1125 0.9904 -0.0794 -0.8091 -0.1378 -0.5711) :load-commands '() :vis-nick 'cit :lev0 'citadel @@ -1957,14 +1624,10 @@ (new 'static 'continue-point :name "citadel-launch-end" :level 'citadel - :trans - (new 'static 'vector :x 11047507.0 :y -81514.086 :z -19495960.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.0292 :w 0.9995) - :camera-trans - (new 'static 'vector :x 11033498.0 :y -63027.2 :z -19534916.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.9413 0.0 -0.3373 0.0481 0.9897 0.1343 0.3339 -0.1427 0.9317) + :trans (new 'static 'vector :x 11047507.0 :y -81514.086 :z -19495960.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.0292 :w 0.9995) + :camera-trans (new 'static 'vector :x 11033498.0 :y -63027.2 :z -19534916.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9413 0.0 -0.3373 0.0481 0.9897 0.1343 0.3339 -0.1427 0.9317) :load-commands '() :vis-nick 'cit :lev0 'citadel @@ -1975,14 +1638,10 @@ (new 'static 'continue-point :name "citadel-plat-start" :level 'citadel - :trans - (new 'static 'vector :x 11443470.0 :y -120194.664 :z -19845628.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.9907 :w -0.1355) - :camera-trans - (new 'static 'vector :x 11443545.0 :y -99100.266 :z -19794374.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9999 0.0 0.0016 -0.0001 0.9926 -0.1207 -0.0015 -0.1207 -0.9926) + :trans (new 'static 'vector :x 11443470.0 :y -120194.664 :z -19845628.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9907 :w -0.1355) + :camera-trans (new 'static 'vector :x 11443545.0 :y -99100.266 :z -19794374.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9999 0.0 0.0016 -0.0001 0.9926 -0.1207 -0.0015 -0.1207 -0.9926) :load-commands '() :vis-nick 'cit :lev0 'citadel @@ -1993,14 +1652,10 @@ (new 'static 'continue-point :name "citadel-plat-end" :level 'citadel - :trans - (new 'static 'vector :x 11269726.0 :y -12132.352 :z -19614712.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.0419 :w 0.9991) - :camera-trans - (new 'static 'vector :x 11264449.0 :y 7920.8447 :z -19661710.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.9938 0.0 -0.1103 0.0134 0.9924 0.1215 0.1095 -0.1223 0.9864) + :trans (new 'static 'vector :x 11269726.0 :y -12132.352 :z -19614712.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.0419 :w 0.9991) + :camera-trans (new 'static 'vector :x 11264449.0 :y 7920.8447 :z -19661710.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9938 0.0 -0.1103 0.0134 0.9924 0.1215 0.1095 -0.1223 0.9864) :load-commands '() :vis-nick 'cit :lev0 'citadel @@ -2011,14 +1666,10 @@ (new 'static 'continue-point :name "citadel-generator-start" :level 'citadel - :trans - (new 'static 'vector :x 12138031.0 :y -36900.863 :z -18933304.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.7487 :w 0.6628) - :camera-trans - (new 'static 'vector :x 12101831.0 :y -19811.123 :z -18933632.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.0093 0.0 -0.9999 0.1678 0.9858 0.0015 0.9857 -0.1678 0.0092) + :trans (new 'static 'vector :x 12138031.0 :y -36900.863 :z -18933304.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7487 :w 0.6628) + :camera-trans (new 'static 'vector :x 12101831.0 :y -19811.123 :z -18933632.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.0093 0.0 -0.9999 0.1678 0.9858 0.0015 0.9857 -0.1678 0.0092) :load-commands '() :vis-nick 'cit :lev0 'citadel @@ -2029,14 +1680,10 @@ (new 'static 'continue-point :name "citadel-generator-end" :level 'citadel - :trans - (new 'static 'vector :x 11837483.0 :y -20177.715 :z -19506848.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.3564 :w 0.9342) - :camera-trans - (new 'static 'vector :x 11872697.0 :y 887.6032 :z -19544198.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.7296 0.0 0.6838 -0.0851 0.9922 0.0908 -0.6785 -0.1245 0.7239) + :trans (new 'static 'vector :x 11837483.0 :y -20177.715 :z -19506848.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.3564 :w 0.9342) + :camera-trans (new 'static 'vector :x 11872697.0 :y 887.6032 :z -19544198.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7296 0.0 0.6838 -0.0851 0.9922 0.0908 -0.6785 -0.1245 0.7239) :load-commands '() :vis-nick #f :lev0 'citadel @@ -2047,14 +1694,10 @@ (new 'static 'continue-point :name "citadel-elevator" :level 'citadel - :trans - (new 'static 'vector :x 11447961.0 :y 234055.27 :z -19169000.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.2351 :w 0.9719) - :camera-trans - (new 'static 'vector :x 11454465.0 :y 252947.66 :z -19126656.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.9932 0.0 0.1161 -0.017 0.9892 -0.1454 -0.1148 -0.1464 -0.9825) + :trans (new 'static 'vector :x 11447961.0 :y 234055.27 :z -19169000.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.2351 :w 0.9719) + :camera-trans (new 'static 'vector :x 11454465.0 :y 252947.66 :z -19126656.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9932 0.0 0.1161 -0.017 0.9892 -0.1454 -0.1148 -0.1464 -0.9825) :load-commands '() :vis-nick 'cit :lev0 'citadel @@ -2068,8 +1711,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 11436032.0 :y -462848.0 :z -19750912.0 :w 1228800.0) + :bsphere (new 'static 'sphere :x 11436032.0 :y -462848.0 :z -19750912.0 :w 1228800.0) :buzzer 91 :bottom-height (meters -114) :run-packages '("common") @@ -2078,8 +1720,7 @@ ) ;; definition for symbol finalboss, type level-load-info -(define - finalboss +(define finalboss (new 'static 'level-load-info :index 21 :name 'finalboss @@ -2094,20 +1735,14 @@ :ocean #f :sky #t :sun-fade 1.0 - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "finalboss-start" :level 'finalboss - :trans - (new 'static 'vector :x 11548456.0 :y 2215872.0 :z -19409498.0 :w 1.0) - :quat - (new 'static 'quaternion :y 0.7325 :w 0.6807) - :camera-trans - (new 'static 'vector :x 11513311.0 :y 2234999.5 :z -19435708.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.5883 0.0 -0.8085 0.1074 0.9911 0.0781 0.8014 -0.1328 0.5831) - :load-commands - '((special "citb-exit-plat-4" #t)) + :trans (new 'static 'vector :x 11548456.0 :y 2215872.0 :z -19409498.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7325 :w 0.6807) + :camera-trans (new 'static 'vector :x 11513311.0 :y 2234999.5 :z -19435708.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.5883 0.0 -0.8085 0.1074 0.9911 0.0781 0.8014 -0.1328 0.5831) + :load-commands '((special "citb-exit-plat-4" #t)) :vis-nick 'fin :lev0 'finalboss :disp0 'display @@ -2117,16 +1752,11 @@ (new 'static 'continue-point :name "finalboss-fight" :level 'finalboss - :trans - (new 'static 'vector :x 12288335.0 :y 1970461.9 :z -19848522.0 :w 1.0) - :quat - (new 'static 'quaternion :y -0.5359 :w -0.8442) - :camera-trans - (new 'static 'vector :x 12265366.0 :y 1984228.5 :z -19842574.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.243 0.0 -0.97 0.2594 0.9635 -0.065 0.9346 -0.2675 -0.2341) - :load-commands - '((special "citb-exit-plat-4" #t)) + :trans (new 'static 'vector :x 12288335.0 :y 1970461.9 :z -19848522.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.5359 :w -0.8442) + :camera-trans (new 'static 'vector :x 12265366.0 :y 1984228.5 :z -19842574.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.243 0.0 -0.97 0.2594 0.9635 -0.065 0.9346 -0.2675 -0.2341) + :load-commands '((special "citb-exit-plat-4" #t)) :vis-nick 'fin :lev0 'finalboss :disp0 'display @@ -2139,8 +1769,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x 11837440.0 :y 2129920.0 :z -19578880.0 :w 778240.0) + :bsphere (new 'static 'sphere :x 11837440.0 :y 2129920.0 :z -19578880.0 :w 778240.0) :buzzer 91 :bottom-height (meters -114) :run-packages '("common") @@ -2176,8 +1805,7 @@ ) ;; definition for symbol demo, type level-load-info -(define - demo +(define demo (new 'static 'level-load-info :index 23 :name 'demo @@ -2191,18 +1819,14 @@ :mood-func 'update-mood-default :ocean #f :sky #f - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "demo-start" :level 'demo - :flags #x8 - :trans - (new 'static 'vector :x 66396.16 :y 29782.016 :z -919973.5 :w 1.0) + :flags (continue-flags demo) + :trans (new 'static 'vector :x 66396.16 :y 29782.016 :z -919973.5 :w 1.0) :quat (new 'static 'quaternion :w 1.0) - :camera-trans - (new 'static 'vector :x 76871.68 :y 55061.707 :z -938752.0 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.8743 0.0 0.4852 -0.2117 0.8997 0.3816 -0.4365 -0.4364 0.7866) + :camera-trans (new 'static 'vector :x 76871.68 :y 55061.707 :z -938752.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8743 0.0 0.4852 -0.2117 0.8997 0.3816 -0.4365 -0.4364 0.7866) :load-commands '() :vis-nick 'dem :lev0 'demo @@ -2224,8 +1848,7 @@ ) ;; definition for symbol title, type level-load-info -(define - title +(define title (new 'static 'level-load-info :index 24 :name 'title @@ -2239,19 +1862,14 @@ :mood-func 'update-mood-village1 :ocean #f :sky #f - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "title-start" :level 'title - :flags #x80 - :trans - (new 'static 'vector :x -635598.9 :y 222551.66 :z 710496.25 :w 1.0) - :quat - (new 'static 'quaternion :y -0.3323 :w -0.9431) - :camera-trans - (new 'static 'vector :x -665644.25 :y 250803.0 :z 668470.9 :w 1.0) - :camera-rot - (new 'static 'array float 9 0.8129 0.0 -0.5823 0.0958 0.9863 0.1337 0.5744 -0.1645 0.8018) + :flags (continue-flags title) + :trans (new 'static 'vector :x -635598.9 :y 222551.66 :z 710496.25 :w 1.0) + :quat (new 'static 'quaternion :y -0.3323 :w -0.9431) + :camera-trans (new 'static 'vector :x -665644.25 :y 250803.0 :z 668470.9 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8129 0.0 -0.5823 0.0958 0.9863 0.1337 0.5744 -0.1645 0.8018) :load-commands '() :vis-nick 'tit :lev0 'title @@ -2265,8 +1883,7 @@ :load-commands '() :alt-load-commands '() :bsp-mask #xffffffffffffffff - :bsphere - (new 'static 'sphere :x -40960.0 :z 40960.0 :w 1126400.0) + :bsphere (new 'static 'sphere :x -40960.0 :z 40960.0 :w 1126400.0) :bottom-height (meters -10000000) :run-packages '("common") :wait-for-load #f @@ -2274,8 +1891,7 @@ ) ;; definition for symbol halfpipe, type level-load-info -(define - halfpipe +(define halfpipe (new 'static 'level-load-info :index 25 :name 'halfpipe @@ -2290,18 +1906,13 @@ :ocean #f :sky #t :sun-fade 1.0 - :continues - '((new 'static 'continue-point + :continues '((new 'static 'continue-point :name "halfpipe" :level 'halfpipe - :trans - (new 'static 'vector :x -1048.9856 :y -172047.97 :z -212555.78 :w 1.0) - :quat - (new 'static 'quaternion :y 0.061 :w 0.9981) - :camera-trans - (new 'static 'vector :x -9941.401 :y -150049.17 :z -159587.94 :w 1.0) - :camera-rot - (new 'static 'array float 9 -0.979 0.0 -0.2037 0.0545 0.9634 -0.2622 0.1963 -0.2678 -0.9432) + :trans (new 'static 'vector :x -1048.9856 :y -172047.97 :z -212555.78 :w 1.0) + :quat (new 'static 'quaternion :y 0.061 :w 0.9981) + :camera-trans (new 'static 'vector :x -9941.401 :y -150049.17 :z -159587.94 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.979 0.0 -0.2037 0.0545 0.9634 -0.2622 0.1963 -0.2678 -0.9432) :load-commands '() :vis-nick #f :lev0 'halfpipe diff --git a/test/decompiler/reference/engine/level/level_REF.gc b/test/decompiler/reference/engine/level/level_REF.gc index 7a15ccf1c1..2b41c115a8 100644 --- a/test/decompiler/reference/engine/level/level_REF.gc +++ b/test/decompiler/reference/engine/level/level_REF.gc @@ -1500,7 +1500,7 @@ (defmethod level-update level-group ((obj level-group)) (camera-pos) (new 'static 'boxed-array :type symbol :length 0 :allocated-length 2) - (update-per-frame-settings! *setting-control*) + (update *setting-control*) (update *art-control* #t) (clear-rec *art-control*) (dotimes (s5-0 2) diff --git a/test/decompiler/reference/engine/level/load-boundary-data_REF.gc b/test/decompiler/reference/engine/level/load-boundary-data_REF.gc index 830ef602ed..15dbf8f941 100644 --- a/test/decompiler/reference/engine/level/load-boundary-data_REF.gc +++ b/test/decompiler/reference/engine/level/load-boundary-data_REF.gc @@ -8,3476 +8,1710 @@ (define *load-boundary-list* (the-as load-boundary #f)) ;; definition for symbol *static-load-boundary-list*, type (array array) -(define *static-load-boundary-list* (new - 'static - 'boxed-array - :type array :length 168 :allocated-length 168 - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 2404087.0 - 1792990.9 - 11801113.0 - -19782276.0 - 12074740.0 - -19333410.0 - ) - '(6 "finalboss-fight" #f) - '(6 "finalboss-start" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 980265.2 - 890780.8 - 3118024.0 - -13706895.0 - 3079293.0 - -13672758.0 - ) - '(0 #f #f) - '(6 "snow-outside-cave" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 1050557.6 - 904951.44 - 3464265.8 - -13649148.0 - 3491810.2 - -13487760.0 - ) - '(0 #f #f) - '(6 "snow-outside-fort" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 1161083.5 - 1033513.1 - 3172378.2 - -14293381.0 - 3169853.0 - -14196348.0 - ) - '(0 #f #f) - '(6 "snow-by-ice-lake" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 155912.27 - -524288.0 - -302473.8 - -358921.62 - -189703.34 - -88103.32 - -213883.9 - -45797.734 - -569183.0 - -33546.773 - ) - '(3 beach display) - '(3 beach display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 164302.47 - -304623.5 - 11519060.0 - -18551140.0 - 11449090.0 - -18346224.0 - 11380415.0 - -18514332.0 - ) - '(6 "citadel-entrance" #f) - '(6 "citadel-entrance" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 272053.7 - -655558.1 - 4808600.0 - -12651164.0 - 4530877.0 - -12508498.0 - ) - '(6 "maincave-to-robocave" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 171371.14 - -524288.0 - -676129.1 - -6924696.0 - -680121.3 - -6757647.5 - ) - '(3 village2 display) - '(3 village2 special-vis) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 36361.89 - -36137.29 - 12126351.0 - -19001848.0 - 12122353.0 - -18877466.0 - ) - '(6 "citadel-generator-start" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - -198.1726 - -146531.1 - 11416193.0 - -19794980.0 - 11485550.0 - -19797886.0 - ) - '(6 "citadel-plat-start" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 39044.12 - -141510.19 - 10894763.0 - -18893140.0 - 10898940.0 - -18972940.0 - ) - '(6 "citadel-launch-start" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 376514.56 - -524288.0 - 418480.47 - -2126829.2 - 768319.25 - -2135490.8 - ) - '(3 village1 #f) - '(3 village1 display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 326689.0 - -524288.0 - 143748.83 - -3601507.8 - 179947.44 - -3912510.8 - ) - '(0 #f #f) - '(1 firecanyon village1) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 524288.0 - 265248.94 - 10092448.0 - -16790240.0 - 10078353.0 - -16477023.0 - ) - '(6 "lavatube-after-ribbon" #f) - '(6 "lavatube-after-ribbon" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 104778.336 - -257783.72 - 11326069.0 - -18525588.0 - 11278355.0 - -18072140.0 - ) - '(6 "lavatube-end" #f) - '(6 "lavatube-end" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 290551.75 - -524288.0 - 4047454.5 - -14186495.0 - 3804332.0 - -13805874.0 - ) - '(6 "ogre-end" #f) - '(6 "ogre-end" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 275555.12 - -524288.0 - 927462.1 - -7305133.0 - 763242.75 - -7308856.5 - ) - '(3 village2 display) - '(3 village2 special-vis) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 1) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - -28209.512 - -524288.0 - 4869388.0 - -12242570.0 - 4850643.0 - -12138500.0 - 4982147.0 - -12130348.0 - 5004734.0 - -12257655.0 - ) - '(3 maincave #f) - '(3 maincave display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 1) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 28870.227 - -524288.0 - 4869388.0 - -12242570.0 - 4850643.0 - -12138500.0 - 4982147.0 - -12130348.0 - 5004734.0 - -12257655.0 - ) - '(0 #f #f) - '(4 mai #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 1) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - -35278.418 - -524288.0 - 4869388.0 - -12242570.0 - 4850643.0 - -12138500.0 - 4982147.0 - -12130348.0 - 5004734.0 - -12257655.0 - ) - '(4 rob #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - -6276.127 - -424794.84 - 10794323.0 - -19184136.0 - 11542925.0 - -19117040.0 - 11854880.0 - -18949898.0 - ) - '(0 #f #f) - '(1 citadel lavatube) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 104778.336 - -424794.84 - 11251180.0 - -18687074.0 - 11606826.0 - -18673318.0 - ) - '(3 lavatube #f) - '(3 lavatube display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 275554.94 - 103589.16 - 769670.25 - -8183583.5 - 945858.75 - -8171829.5 - ) - '(6 "ogre-race" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 145672.28 - -274960.53 - 9277345.0 - -14277290.0 - 9266303.0 - -13929350.0 - ) - '(0 #f #f) - '(1 village3 lavatube) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 361505.03 - 141642.4 - 5280860.0 - -14529410.0 - 5363850.0 - -14811145.0 - ) - '(0 #f #f) - '(4 lav #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 361505.03 - 141642.4 - 5145395.0 - -14585060.0 - 4969281.0 - -14637079.0 - ) - '(3 lavatube #f) - '(3 lavatube display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 329926.2 - 114555.875 - 4630288.0 - -14662835.0 - 4776346.0 - -14281154.0 - 5078574.5 - -14217605.0 - ) - '(1 village3 lavatube) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 107354.85 - -647564.3 - -279364.62 - 131636.45 - -270673.44 - 160221.88 - ) - '(3 beach #f) - '(3 beach display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 404182.75 - -524288.0 - 4167032.0 - -13159265.0 - 4419089.0 - -12857725.0 - 4712033.0 - -13110535.0 - ) - '(3 village3 display) - '(3 village3 #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 561218.0 - -22197.672 - 5192028.0 - -12126635.0 - 4954258.5 - -11802688.0 - ) - '(4 rob #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 561218.0 - -15459.172 - 5076681.0 - -12251444.0 - 4974694.0 - -12024020.0 - ) - '(0 #f #f) - '(4 mai #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 297752.7 - -524288.0 - 53651.58 - -6363675.5 - 58039.688 - -6204528.0 - ) - '(3 village2 special-vis) - '(3 village2 #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 296695.72 - -524288.0 - -590053.06 - -6197793.0 - 39494.13 - -6504359.5 - ) - '(3 village2 display) - '(3 village2 special-vis) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 334675.1 - 183791.47 - -655431.8 - -7037484.5 - -667642.5 - -6660005.5 - ) - '(3 village2 display) - '(3 village2 special-vis) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 380333.4 - -40101.156 - 1818615.8 - -1094335.5 - 1622619.2 - -978791.7 - ) - '(3 village1 special-vis) - '(3 village1 #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 22 :allocated-length 22 - 401929.88 - -524288.0 - -363218.53 - -2089629.0 - -558766.7 - -1816698.6 - -769622.8 - -2043451.9 - -816882.1 - -2051455.1 - -950145.6 - -2013974.5 - -967790.6 - -1907695.0 - -1064691.2 - -1966847.9 - -1147540.0 - -1944348.2 - -1243268.9 - -2202510.2 - -1249669.5 - -2319393.8 - ) - '(3 village1 display) - '(3 village1 special-vis) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 285200.53 - -524288.0 - 4042240.5 - -12645708.0 - 4297681.5 - -12507810.0 - ) - '(0 #f #f) - '(1 maincave darkcave) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 272053.7 - -655558.1 - 4806917.0 - -12655241.0 - 4529194.0 - -12512575.0 - ) - '(1 maincave robocave) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 350009.84 - -524288.0 - 4421414.0 - -13636154.0 - 4589708.5 - -13556925.0 - ) - '(3 maincave #f) - '(3 maincave display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - -1761940.5 - -1946392.4 - 2518956.8 - -7372510.5 - 2450104.8 - -7215005.0 - ) - '(0 #f #f) - '(6 "sunkenb-helix" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 330190.47 - -524288.0 - 4536550.0 - -13960169.0 - 4678894.0 - -14351620.0 - 4428100.5 - -14425283.0 - 4353558.0 - -14051260.0 - ) - '(1 village3 ogre) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 253886.0 - -524288.0 - 4168931.0 - -14104075.0 - 4117809.5 - -13471865.0 - ) - '(4 vi3 #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 290551.75 - -524288.0 - 4130630.2 - -14104385.0 - 3887507.8 - -13723764.0 - ) - '(0 #f #f) - '(4 ogr #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 3) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - -632567.56 - -576346.5 - 2344408.2 - -7388373.0 - 2348460.5 - -7279539.0 - 2466947.8 - -7247920.5 - 2439049.2 - -7385641.0 - ) - '(0 #f #f) - '(4 sun #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - -467010.03 - -701076.44 - 3209649.0 - -6960872.0 - 3057429.0 - -6862769.0 - ) - '(6 "sunken1" #f) - '(6 "sunken2" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - -512925.12 - -681521.44 - 2371019.5 - -6795812.0 - 2389408.2 - -6532305.5 - ) - '(3 village2 #f) - '(3 village2 display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 110684.67 - -524288.0 - 1839143.8 - -7520194.5 - 1840360.8 - -7670893.0 - 1846512.6 - -7685321.0 - ) - '(6 "swamp-start" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 95661.45 - -524288.0 - 2672740.5 - -8278830.0 - 2639106.8 - -8402343.0 - ) - '(6 "swamp-game" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 112904.26 - -524288.0 - 1486306.8 - -8266304.5 - 1610530.4 - -8198038.0 - ) - '(6 "swamp-cave1" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 164830.97 - -524288.0 - -419912.5 - 3042100.0 - -133547.3 - 3439924.0 - -102430.38 - 3661115.2 - 428069.8 - 3364700.5 - ) - '(6 "misty-start" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 12 :allocated-length 12 - 321007.44 - -524288.0 - -907311.4 - 3456990.5 - -757819.7 - 3679705.0 - -638801.4 - 3763613.2 - -573459.2 - 3651802.5 - -883808.56 - 3444019.2 - ) - '(6 "misty-silo" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 1) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - -91155.664 - -524288.0 - 2079358.8 - -6774793.5 - 2079358.8 - -6569993.5 - 2284159.5 - -6569993.5 - 2284159.5 - -6774793.5 - ) - '(0 #f #f) - '(4 vi2 #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 1) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - -176048.66 - -524288.0 - 2079358.8 - -6774793.5 - 2079358.8 - -6569993.5 - 2284159.5 - -6569993.5 - 2284159.5 - -6774793.5 - ) - '(4 sun #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 263068.94 - -524288.0 - 1947299.0 - -7277401.0 - 1663485.5 - -7296843.5 - ) - '(4 vi2 #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 240937.31 - -524288.0 - 1655335.4 - -7355865.0 - 1914029.8 - -7344404.5 - ) - '(4 swa #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 192776.28 - -524288.0 - 1720459.0 - -7252616.5 - 1888000.6 - -7230796.5 - ) - '(3 swamp display) - '(3 swamp #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 524288.0 - -524288.0 - 1543607.5 - -7296055.0 - 1536684.1 - -6977798.0 - 1589661.2 - -6897839.0 - 1929451.4 - -7131590.5 - ) - '(1 village2 swamp) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 524288.0 - -524288.0 - 474877.1 - -6501738.5 - 641064.94 - -6682781.0 - 774879.44 - -6780504.5 - ) - '(4 rol #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 524288.0 - -524288.0 - 836810.7 - -6707271.0 - 673225.56 - -6637296.5 - 468429.44 - -6424190.5 - ) - '(4 vi2 #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 388789.16 - -524288.0 - -137499.97 - -464508.47 - -239475.86 - -332696.8 - ) - '(4 vi1 #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 18 :allocated-length 18 - 152569.25 - -524288.0 - -177363.28 - -182574.97 - -107676.53 - -61124.004 - -172878.95 - 81598.42 - -327656.6 - 227590.64 - -406536.56 - 216199.72 - -485581.56 - 261065.92 - -515573.0 - 191171.4 - -1338912.4 - 229231.64 - ) - '(3 beach #f) - '(3 beach display-no-wait) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 272530.25 - -524288.0 - -249675.55 - -391214.2 - -130347.68 - -500937.6 - ) - '(3 firecanyon display) - '(3 firecanyon #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 1) - (new - 'static - 'boxed-array - :type float :length 18 :allocated-length 18 - -87713.6 - -524288.0 - 1090401.8 - -1274678.5 - 1058803.0 - -1235478.5 - 1060181.1 - -1193262.0 - 1117220.8 - -1154488.0 - 1164595.1 - -1185104.8 - 1176762.0 - -1210675.4 - 1173468.1 - -1244727.8 - 1125869.1 - -1275753.6 - ) - '(0 #f #f) - '(4 jun #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 301122.1 - -524288.0 - 1525182.5 - 2034822.6 - 842849.06 - -804235.94 - ) - '(4 vi1 #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 325169.56 - -524288.0 - 894672.4 - -779382.3 - 1767576.5 - 1188691.0 - ) - '(4 jun #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 326953.3 - -524288.0 - 81844.7 - -727707.5 - 15797.286 - 118401.266 - 414386.16 - 120639.44 - 1232901.1 - 1021193.6 - ) - '(1 village1 jungle) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 166814.4 - -524288.0 - 401796.53 - -610932.7 - 350019.12 - -489639.75 - 470693.25 - -460100.72 - ) - '(3 jungle display-no-wait) - '(3 jungle #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 3) - (new - 'static - 'boxed-array - :type float :length 18 :allocated-length 18 - 375701.16 - -524288.0 - 1453916.1 - -987016.2 - 1461937.5 - -967184.75 - 1482761.0 - -957298.8 - 1505932.0 - -966185.4 - 1514189.1 - -989654.4 - 1503102.1 - -1010133.7 - 1481864.2 - -1017569.2 - 1464112.8 - -1010652.75 - ) - '(1 jungle jungleb) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 322236.66 - -524288.0 - -140670.9 - -353851.75 - 6646.948 - -375187.7 - -4327.104 - -433914.72 - ) - '(1 village1 firecanyon) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 12 :allocated-length 12 - 168425.08 - -524288.0 - -201897.2 - -213989.42 - -71567.484 - -81526.12 - -112773.18 - 78722.41 - -115380.56 - 447390.62 - -241892.22 - 711968.75 - ) - '(0 #f #f) - '(1 village1 beach) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 524288.0 - -524288.0 - 420024.44 - -4814527.0 - 420024.44 - -4609727.0 - ) - '(3 village2 display) - '(3 village2 #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 388393.3 - -524288.0 - -261189.34 - -3825337.5 - -50913.258 - -4000428.0 - ) - '(1 village2 firecanyon) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 388789.16 - -524288.0 - -269444.6 - -496662.28 - -126883.84 - -507940.1 - ) - '(4 fic #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 332899.12 - -524288.0 - -1124255.8 - -298838.28 - -351702.84 - -248529.5 - ) - '(4 bea #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 332899.12 - -524288.0 - -1208873.8 - -81858.37 - -319884.62 - -196373.8 - ) - '(0 #f #f) - '(4 vi1 #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 335013.2 - -524288.0 - 1300341.5 - -6072380.5 - 1543875.5 - -6043701.0 - ) - '(4 vi2 #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 370820.16 - -524288.0 - 1400421.9 - -5994967.5 - 1298001.9 - -5991312.0 - ) - '(4 fic #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 14 :allocated-length 14 - 313079.75 - -524288.0 - 823858.3 - -7076852.5 - 1476263.1 - -6966768.0 - 1548741.4 - -6505285.5 - 1380369.1 - -6357914.0 - 1125477.6 - -6285041.0 - 1188517.2 - -6036264.5 - ) - '(0 #f #f) - '(1 village2 rolling) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 12 :allocated-length 12 - 233141.69 - -524288.0 - 742218.2 - -6802828.0 - 1334365.1 - -6818752.0 - 1357111.0 - -6436508.0 - 1047644.1 - -6334948.5 - 643162.44 - -6208203.0 - ) - '(3 rolling #f) - '(3 rolling display-no-wait) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 431070.97 - -524288.0 - 974018.4 - -7117512.5 - 1070822.5 - -7081258.0 - 1526121.6 - -7123133.0 - 1541163.8 - -7418157.0 - ) - '(1 village2 ogre) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 396387.06 - 57211.875 - 1213439.8 - -7288315.5 - 1227811.9 - -7079770.5 - 912550.5 - -7099027.5 - ) - '(3 ogre #f) - '(3 ogre display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 336796.9 - -524288.0 - 825355.2 - -7235151.5 - 920252.2 - -7300986.5 - ) - '(4 ogr #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 292930.06 - -524288.0 - 998340.94 - -7272782.5 - 934710.06 - -7195729.5 - ) - '(4 vi2 #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 524288.0 - -168464.31 - 1927868.4 - -7085362.5 - 1605545.0 - -6870818.5 - 1615227.8 - -6471577.5 - 2177376.0 - -6131660.5 - ) - '(1 village2 sunken) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 360646.25 - -187424.25 - 2042524.0 - -7300480.5 - 1824194.5 - -6847887.0 - 1852328.8 - -6568462.5 - 2270167.8 - -6228972.5 - ) - '(3 sunken special) - '(3 sunken #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 3) - (new - 'static - 'boxed-array - :type float :length 18 :allocated-length 18 - 126432.83 - -524288.0 - 1453916.1 - -987016.2 - 1461937.5 - -967184.75 - 1482761.0 - -957298.8 - 1505932.0 - -966185.4 - 1514189.1 - -989654.4 - 1503102.1 - -1010133.7 - 1481864.2 - -1017569.2 - 1464112.8 - -1010652.75 - ) - '(3 jungleb display) - '(3 jungleb #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 3) - (new - 'static - 'boxed-array - :type float :length 18 :allocated-length 18 - 74968.55 - -616976.44 - 1453916.1 - -987016.2 - 1461937.5 - -967184.75 - 1482761.0 - -957298.8 - 1505932.0 - -966185.4 - 1514189.1 - -989654.4 - 1503102.1 - -1010133.7 - 1481864.2 - -1017569.2 - 1464112.8 - -1010652.75 - ) - '(4 jub #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 137771.25 - -524288.0 - 404573.2 - 4098422.0 - 236215.77 - 4114074.5 - ) - '(6 "misty-bike" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 145077.7 - -524288.0 - -376094.4 - 4543663.0 - -376094.4 - 4748463.0 - ) - '(6 "misty-backside" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 255537.56 - -524288.0 - -1005929.1 - 4193984.0 - -872937.2 - 4300299.0 - -756972.8 - 4208626.0 - -1025873.2 - 4087144.5 - ) - '(6 "misty-silo2" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 99096.8 - -524288.0 - 1975605.4 - -8630552.0 - 1975421.4 - -8528661.0 - ) - '(6 "swamp-cave2" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 141113.8 - -524288.0 - 1980493.5 - -7897138.0 - 2047652.4 - -7873304.0 - 2060152.6 - -7931657.5 - 1993817.2 - -7976457.0 - ) - '(6 "swamp-cave3" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 12 :allocated-length 12 - 262804.7 - -524288.0 - 2140291.2 - -6096639.0 - 1590722.8 - -6463647.0 - 1413458.0 - -6340959.0 - 1149150.8 - -6278411.0 - 1219588.5 - -6039556.5 - ) - '(1 firecanyon village2) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 206253.42 - -524288.0 - 1430296.9 - -5984384.0 - 1438999.2 - -6119296.0 - 1420048.6 - -6125594.0 - ) - '(3 firecanyon display) - '(3 firecanyon #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - -432061.9 - -714884.06 - 2715718.5 - -7342267.0 - 2815001.5 - -7150704.5 - ) - '(3 sunkenb display) - '(3 sunkenb #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - -899402.06 - -1098784.5 - 2282077.5 - -6677879.5 - 2080828.8 - -6613302.0 - ) - '(4 sun #f) - '(4 sub #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - -451749.12 - -610039.7 - 3063970.5 - -6604280.5 - 3000425.2 - -6456572.0 - ) - '(6 "sunken1" #f) - '(6 "sunken-start" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 3) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - -626555.75 - -524288.0 - 2344408.2 - -7388373.0 - 2348460.5 - -7279539.0 - 2466947.8 - -7247920.5 - 2439049.2 - -7385641.0 - ) - '(0 #f #f) - '(6 "sunken2" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 198788.14 - -524288.0 - 2287878.0 - -13944549.0 - 2434369.8 - -13646915.0 - ) - '(3 village3 display) - '(3 village3 #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 355162.84 - -524288.0 - 4346461.0 - -14010600.0 - 4474615.5 - -13949533.0 - ) - '(3 ogre #f) - '(3 ogre display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 331577.72 - -524288.0 - 4510445.5 - -13872985.0 - 4620850.5 - -14134173.0 - 4822450.0 - -13951485.0 - ) - '(0 #f #f) - '(1 village3 maincave) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 333031.2 - -77890.09 - 4321252.0 - -13451169.0 - 4538566.5 - -13427408.0 - ) - '(4 vi3 #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 289560.78 - -524288.0 - 4160078.2 - -13363984.0 - 4657438.0 - -13195000.0 - ) - '(0 #f #f) - '(4 mai #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 561218.0 - -20347.875 - 5015965.5 - -12265124.0 - 4969636.0 - -12062795.0 - ) - '(3 robocave display) - '(3 robocave #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 319289.8 - 97180.91 - 4060842.2 - -12186625.0 - 3956508.8 - -12221835.0 - ) - '(3 darkcave display) - '(3 darkcave #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 390797.47 - -106231.74 - 1625981.8 - -982050.1 - 1826157.5 - -984055.0 - 1963614.9 - -752705.06 - ) - '(3 village1 special-vis) - '(3 village1 display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 442784.28 - -39440.535 - 1899973.9 - -1546112.1 - 1741479.5 - -1291697.1 - 1490514.9 - -1133170.4 - ) - '(3 village1 #f) - '(3 village1 special-vis) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 449040.3 - -98105.81 - 1507840.9 - -1133057.6 - 1611146.1 - -1038699.56 - ) - '(3 village1 #f) - '(3 village1 display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 291779.53 - 185641.23 - -556363.7 - -6215175.0 - -677982.3 - -6112309.0 - -462479.25 - -5758803.0 - ) - '(3 village2 special-vis) - '(3 village2 #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 324244.66 - -524288.0 - -385887.97 - -7048725.0 - -652583.3 - -7045665.0 - ) - '(3 village2 display) - '(3 village2 special-vis) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 1) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 330785.0 - -783128.7 - 4214055.0 - -14490533.0 - 4245485.0 - -14027390.0 - 4509959.5 - -14260475.0 - 4466017.5 - -14619070.0 - ) - '(0 #f #f) - '(1 village3 snow) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 1) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 897222.0 - -455448.7 - 4214055.0 - -14490533.0 - 4286877.5 - -13964385.0 - 4509959.5 - -14260475.0 - 4466017.5 - -14619070.0 - ) - '(3 snow #f) - '(3 snow display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 401275.84 - -524288.0 - 3809930.2 - -13126660.0 - 4387680.5 - -12726350.0 - 4965741.5 - -12733760.0 - ) - '(1 village3 maincave) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 319289.8 - 97180.91 - 4037056.5 - -12145660.0 - 3932723.0 - -12180870.0 - ) - '(0 #f #f) - '(4 mai #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 319289.8 - 97180.91 - 3967407.0 - -12047450.0 - 3919676.8 - -12152098.0 - ) - '(4 dar #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 12 :allocated-length 12 - 415367.12 - -20612.129 - 1473631.5 - -1157821.2 - 1414393.4 - -1193464.1 - 1354583.2 - -1238710.8 - 1291658.0 - -1325844.0 - 1151230.6 - -1642343.9 - ) - '(3 village1 display) - '(3 village1 special-vis) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 12 :allocated-length 12 - 194295.77 - -524288.0 - 1993232.0 - -7776360.5 - 1646617.0 - -7919841.0 - 1546310.5 - -7956902.0 - 1497602.9 - -8055146.5 - 1350810.2 - -7725342.0 - ) - '(3 village2 display) - '(3 village2 special-vis) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 1275705.8 - 885660.7 - 4210123.5 - -14454620.0 - 4252965.5 - -14048015.0 - ) - '(0 #f #f) - '(4 sno #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 361505.03 - 141642.4 - 5145395.0 - -14585060.0 - 4969281.0 - -14637079.0 - ) - '(3 lavatube #f) - '(3 lavatube display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 361505.03 - 141642.4 - 5192246.0 - -14612985.0 - 4946641.5 - -14744985.0 - ) - '(4 vi3 #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 361505.03 - 141642.4 - 5280860.0 - -14529410.0 - 5363850.0 - -14811145.0 - ) - '(0 #f #f) - '(4 lav #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 320479.0 - -64214.67 - 6465568.5 - -14156115.0 - 6450754.5 - -13712894.0 - ) - '(3 village3 #f) - '(3 village3 display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 389780.5 - 201622.14 - 4218813.0 - -14413355.0 - 4331064.0 - -14524060.0 - ) - '(1 village3 maincave) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 1170068.4 - 988919.7 - 2574083.2 - -13973545.0 - 2427817.5 - -13884534.0 - ) - '(6 "snow-across-from-flut" #f) - '(6 "snow-flut-flut" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 3) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 810280.2 - -196608.0 - 3324084.2 - -13758485.0 - 3324084.2 - -13553685.0 - 3528884.2 - -13553685.0 - 3528884.2 - -13758485.0 - ) - '(0 #f #f) - '(6 "snow-outside-fort" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 303302.1 - -28407.746 - 1482670.0 - -13217540.0 - 1703776.4 - -13157055.0 - ) - '(1 ogre village3) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 104778.336 - -194295.75 - 11067174.0 - -18596720.0 - 11019460.0 - -18143272.0 - ) - '(3 citadel display) - '(3 citadel #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 104778.336 - -194295.75 - 11220495.0 - -18577436.0 - 11172783.0 - -18123988.0 - ) - '(0 #f #f) - '(4 lav #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 104778.336 - -424794.84 - 11261218.0 - -18621614.0 - 11616860.0 - -18607858.0 - ) - '(4 cit #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 532744.06 - 222822.31 - 10045198.0 - -16826564.0 - 10052340.0 - -16500909.0 - ) - '(1 lavatube citadel) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 1) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 30786.04 - -568353.0 - 10853810.0 - -19982956.0 - 10857980.0 - -18851744.0 - 11800185.0 - -18657540.0 - 12119948.0 - -19841458.0 - ) - '(0 #f #f) - '(1 citadel finalboss) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 1) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - -37128.273 - -568353.0 - 10635460.0 - -19261390.0 - 10641390.0 - -18641098.0 - 11673320.0 - -18631850.0 - 11992955.0 - -19068516.0 - ) - '(1 citadel lavatube) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 1) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 739722.7 - -524288.0 - 11253410.0 - -19459740.0 - 11298895.0 - -19163528.0 - 11606400.0 - -19156774.0 - 11646273.0 - -19462514.0 - ) - '(4 cit #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 1) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 1552977.4 - -524288.0 - 11253410.0 - -19459740.0 - 11298895.0 - -19163528.0 - 11606400.0 - -19156774.0 - 11646273.0 - -19462514.0 - ) - '(0 #f #f) - '(4 fin #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - -432061.9 - -714884.06 - 2624020.8 - -7238923.5 - 2730103.5 - -7108117.5 - ) - '(6 "sunken-tube1" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 237131.75 - 116405.63 - 4134430.0 - -12531289.0 - 4249137.0 - -12480849.0 - ) - '(0 #f #f) - '(6 "maincave-to-darkcave" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 108378.74 - -18630.201 - 1381972.9 - -8272129.5 - 1309181.4 - -8143856.5 - ) - '(6 "swamp-dock1" #f) - '(6 "swamp-start" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 164632.73 - -17573.172 - 1651940.5 - -8481208.0 - 1575238.2 - -8380055.5 - ) - '(6 "swamp-dock2" #f) - '(6 "swamp-cave1" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 321734.22 - 33164.38 - 1472616.8 - -5741056.5 - 1161522.8 - -5738810.0 - ) - '(6 "firecanyon-end" #f) - '(6 "firecanyon-end" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 339769.8 - -46839.75 - -211696.3 - -784710.75 - 49935.15 - -742140.3 - ) - '(6 "firecanyon-start" #f) - '(6 "firecanyon-start" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 482151.97 - 69896.25 - 869008.6 - -8462477.0 - 644078.75 - -8259235.5 - ) - '(6 "ogre-race" #f) - '(6 "ogre-race" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 322923.34 - 4096.0 - 5678575.5 - -14614474.0 - 5457999.0 - -14391688.0 - ) - '(6 "lavatube-start" #f) - '(6 "lavatube-start" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 178704.39 - -135168.0 - 8996384.0 - -14239175.0 - 9096633.0 - -13873403.0 - ) - '(6 "lavatube-middle" #f) - '(6 "lavatube-middle" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 247477.67 - -148711.25 - 5555559.5 - -11770044.0 - 5324678.0 - -11402115.0 - ) - '(6 "robocave-bottom" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - -451749.12 - -610039.7 - 3050601.8 - -6609894.0 - 2987056.5 - -6462185.5 - ) - '(1 sunken sunkenb) - '(1 sunken village2) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 66328.8 - -101805.46 - 11021305.0 - -19546492.0 - 10991630.0 - -19494320.0 - ) - '(6 "citadel-launch-end" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 87535.54 - -29596.91 - 11275635.0 - -19680194.0 - 11230883.0 - -19653924.0 - ) - '(6 "citadel-plat-end" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 60515.062 - -64214.72 - 11902198.0 - -19492924.0 - 11856455.0 - -19580640.0 - ) - '(6 "citadel-generator-end" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 1064497.0 - 893654.6 - 3369717.2 - -13470538.0 - 3489005.0 - -13470209.0 - ) - '(6 "snow-outside-fort" #f) - '(6 "snow-fort" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 276440.2 - -524288.0 - -1054117.4 - -7015874.0 - -1180891.2 - -6733353.5 - -911788.4 - -6482925.0 - ) - '(3 village2 special-vis) - '(3 village2 #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 263663.44 - 1585.5251 - -677970.94 - -6693857.0 - -802274.3 - -6692809.0 - ) - '(3 village2 #f) - '(3 village2 special-vis) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 363883.3 - -524288.0 - 710516.0 - -605717.3 - 777812.4 - -117024.52 - ) - '(3 jungle display) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 524288.0 - -524288.0 - 719872.1 - -6597869.0 - 1159159.1 - -6425164.5 - 1041836.25 - -6827792.0 - ) - '(3 rolling display) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 524288.0 - -524288.0 - 568817.3 - -9466220.0 - 1127492.5 - -9043683.0 - ) - '(0 #f #f) - '(1 ogre village2) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 12 :allocated-length 12 - 408146.53 - -227129.81 - 5624547.0 - -11755375.0 - 5604783.5 - -11539414.0 - 5326020.0 - -11550233.0 - 5180106.5 - -11499346.0 - 5148654.0 - -11322573.0 - ) - '(3 maincave special) - '(3 maincave display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 294119.2 - 213916.9 - 11495250.0 - -19186980.0 - 11398090.0 - -19190674.0 - ) - '(3 finalboss #f) - '(3 finalboss display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 1) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 1470264.6 - -524288.0 - 11253410.0 - -19459740.0 - 11298895.0 - -19163528.0 - 11606400.0 - -19156774.0 - 11646273.0 - -19462514.0 - ) - '(3 citadel display) - '(3 citadel special) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 104778.336 - -424794.84 - 11249043.0 - -18841486.0 - 11604685.0 - -18827730.0 - ) - '(6 "citadel-start" #f) - '(6 "citadel-start" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 1094292.4 - 858838.25 - 3677046.8 - -13838594.0 - 3773559.8 - -13867715.0 - 3837479.8 - -13675041.0 - 3663758.2 - -13804749.0 - ) - '(0 #f #f) - '(6 "snow-pass-to-fort" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 1220937.6 - 1035428.9 - 2930553.2 - -14107145.0 - 3128871.8 - -14038774.0 - ) - '(6 "snow-by-ice-lake-alt" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 1051944.6 - 888765.56 - 3366128.0 - -13638805.0 - 3362401.8 - -13489235.0 - ) - '(6 "snow-outside-fort" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 524288.0 - -524288.0 - 1123579.9 - -6421303.0 - 1006257.0 - -6823930.5 - ) - '(6 "village2-start" #f) - '(6 "village2-dock" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 1) - (new - 'static - 'boxed-array - :type float :length 10 :allocated-length 10 - 742498.56 - -727105.9 - 4214055.0 - -14490533.0 - 4286877.5 - -13964385.0 - 4509959.5 - -14260475.0 - 4466017.5 - -14619070.0 - ) - '(4 vi3 #f) - '(3 snow display) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 318034.56 - 119907.06 - 4952800.5 - -14636175.0 - 5113453.5 - -14560723.0 - ) - '(0 #f #f) - '(6 "village3-farside" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 383504.6 - 120699.85 - 4445610.0 - -14468618.0 - 4343087.0 - -14334280.0 - ) - '(0 #f #f) - '(6 "village3-farside" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 302707.6 - 144615.2 - 4420238.5 - -13645623.0 - 4595041.0 - -13553850.0 - ) - '(6 "village3-farside" #f) - '(0 #f #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - (the binteger 2) - (new - 'static - 'boxed-array - :type float :length 6 :allocated-length 6 - 335938.0 - 140849.53 - 4397294.5 - -14125599.0 - 4545135.5 - -14064108.0 - ) - '(0 #f #f) - '(6 "village3-start" #f) - ) - (new - 'static - 'boxed-array - :type object :length 4 :allocated-length 4 - 0 - (new - 'static - 'boxed-array - :type float :length 8 :allocated-length 8 - 404182.75 - -524288.0 - 4161991.8 - -13086341.0 - 4414040.5 - -12784800.0 - 4706984.5 - -13037610.0 - ) - '(6 "maincave-start" #f) - '(0 #f #f) - ) - ) +(define *static-load-boundary-list* + (new 'static 'boxed-array :type array + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 2404087.0 1792990.9 11801113.0 -19782276.0 12074740.0 -19333410.0) + '(6 "finalboss-fight" #f) + '(6 "finalboss-start" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 980265.2 890780.8 3118024.0 -13706895.0 3079293.0 -13672758.0) + '(0 #f #f) + '(6 "snow-outside-cave" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 1050557.6 904951.44 3464265.8 -13649148.0 3491810.2 -13487760.0) + '(0 #f #f) + '(6 "snow-outside-fort" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 1161083.5 1033513.1 3172378.2 -14293381.0 3169853.0 -14196348.0) + '(0 #f #f) + '(6 "snow-by-ice-lake" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 155912.27 + -524288.0 + -302473.8 + -358921.62 + -189703.34 + -88103.32 + -213883.9 + -45797.734 + -569183.0 + -33546.773 ) + '(3 beach display) + '(3 beach display) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 164302.47 + -304623.5 + 11519060.0 + -18551140.0 + 11449090.0 + -18346224.0 + 11380415.0 + -18514332.0 + ) + '(6 "citadel-entrance" #f) + '(6 "citadel-entrance" #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 272053.7 -655558.1 4808600.0 -12651164.0 4530877.0 -12508498.0) + '(6 "maincave-to-robocave" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 171371.14 -524288.0 -676129.1 -6924696.0 -680121.3 -6757647.5) + '(3 village2 display) + '(3 village2 special-vis) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 36361.89 -36137.29 12126351.0 -19001848.0 12122353.0 -18877466.0) + '(6 "citadel-generator-start" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float -198.1726 -146531.1 11416193.0 -19794980.0 11485550.0 -19797886.0) + '(6 "citadel-plat-start" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 39044.12 -141510.19 10894763.0 -18893140.0 10898940.0 -18972940.0) + '(6 "citadel-launch-start" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 376514.56 -524288.0 418480.47 -2126829.2 768319.25 -2135490.8) + '(3 village1 #f) + '(3 village1 display) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 326689.0 -524288.0 143748.83 -3601507.8 179947.44 -3912510.8) + '(0 #f #f) + '(1 firecanyon village1) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 524288.0 265248.94 10092448.0 -16790240.0 10078353.0 -16477023.0) + '(6 "lavatube-after-ribbon" #f) + '(6 "lavatube-after-ribbon" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 104778.336 -257783.72 11326069.0 -18525588.0 11278355.0 -18072140.0) + '(6 "lavatube-end" #f) + '(6 "lavatube-end" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 290551.75 -524288.0 4047454.5 -14186495.0 3804332.0 -13805874.0) + '(6 "ogre-end" #f) + '(6 "ogre-end" #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 275555.12 -524288.0 927462.1 -7305133.0 763242.75 -7308856.5) + '(3 village2 display) + '(3 village2 special-vis) + ) + (new 'static 'boxed-array :type object + (the binteger 1) + (new 'static 'boxed-array :type float + -28209.512 + -524288.0 + 4869388.0 + -12242570.0 + 4850643.0 + -12138500.0 + 4982147.0 + -12130348.0 + 5004734.0 + -12257655.0 + ) + '(3 maincave #f) + '(3 maincave display) + ) + (new 'static 'boxed-array :type object + (the binteger 1) + (new 'static 'boxed-array :type float + 28870.227 + -524288.0 + 4869388.0 + -12242570.0 + 4850643.0 + -12138500.0 + 4982147.0 + -12130348.0 + 5004734.0 + -12257655.0 + ) + '(0 #f #f) + '(4 mai #f) + ) + (new 'static 'boxed-array :type object + (the binteger 1) + (new 'static 'boxed-array :type float + -35278.418 + -524288.0 + 4869388.0 + -12242570.0 + 4850643.0 + -12138500.0 + 4982147.0 + -12130348.0 + 5004734.0 + -12257655.0 + ) + '(4 rob #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + -6276.127 + -424794.84 + 10794323.0 + -19184136.0 + 11542925.0 + -19117040.0 + 11854880.0 + -18949898.0 + ) + '(0 #f #f) + '(1 citadel lavatube) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 104778.336 -424794.84 11251180.0 -18687074.0 11606826.0 -18673318.0) + '(3 lavatube #f) + '(3 lavatube display) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 275554.94 103589.16 769670.25 -8183583.5 945858.75 -8171829.5) + '(6 "ogre-race" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 145672.28 -274960.53 9277345.0 -14277290.0 9266303.0 -13929350.0) + '(0 #f #f) + '(1 village3 lavatube) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 361505.03 141642.4 5280860.0 -14529410.0 5363850.0 -14811145.0) + '(0 #f #f) + '(4 lav #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 361505.03 141642.4 5145395.0 -14585060.0 4969281.0 -14637079.0) + '(3 lavatube #f) + '(3 lavatube display) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 329926.2 + 114555.875 + 4630288.0 + -14662835.0 + 4776346.0 + -14281154.0 + 5078574.5 + -14217605.0 + ) + '(1 village3 lavatube) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 107354.85 -647564.3 -279364.62 131636.45 -270673.44 160221.88) + '(3 beach #f) + '(3 beach display) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 404182.75 + -524288.0 + 4167032.0 + -13159265.0 + 4419089.0 + -12857725.0 + 4712033.0 + -13110535.0 + ) + '(3 village3 display) + '(3 village3 #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 561218.0 -22197.672 5192028.0 -12126635.0 4954258.5 -11802688.0) + '(4 rob #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 561218.0 -15459.172 5076681.0 -12251444.0 4974694.0 -12024020.0) + '(0 #f #f) + '(4 mai #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 297752.7 -524288.0 53651.58 -6363675.5 58039.688 -6204528.0) + '(3 village2 special-vis) + '(3 village2 #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 296695.72 -524288.0 -590053.06 -6197793.0 39494.13 -6504359.5) + '(3 village2 display) + '(3 village2 special-vis) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 334675.1 183791.47 -655431.8 -7037484.5 -667642.5 -6660005.5) + '(3 village2 display) + '(3 village2 special-vis) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 380333.4 -40101.156 1818615.8 -1094335.5 1622619.2 -978791.7) + '(3 village1 special-vis) + '(3 village1 #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 401929.88 + -524288.0 + -363218.53 + -2089629.0 + -558766.7 + -1816698.6 + -769622.8 + -2043451.9 + -816882.1 + -2051455.1 + -950145.6 + -2013974.5 + -967790.6 + -1907695.0 + -1064691.2 + -1966847.9 + -1147540.0 + -1944348.2 + -1243268.9 + -2202510.2 + -1249669.5 + -2319393.8 + ) + '(3 village1 display) + '(3 village1 special-vis) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 285200.53 -524288.0 4042240.5 -12645708.0 4297681.5 -12507810.0) + '(0 #f #f) + '(1 maincave darkcave) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 272053.7 -655558.1 4806917.0 -12655241.0 4529194.0 -12512575.0) + '(1 maincave robocave) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 350009.84 -524288.0 4421414.0 -13636154.0 4589708.5 -13556925.0) + '(3 maincave #f) + '(3 maincave display) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float -1761940.5 -1946392.4 2518956.8 -7372510.5 2450104.8 -7215005.0) + '(0 #f #f) + '(6 "sunkenb-helix" #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 330190.47 + -524288.0 + 4536550.0 + -13960169.0 + 4678894.0 + -14351620.0 + 4428100.5 + -14425283.0 + 4353558.0 + -14051260.0 + ) + '(1 village3 ogre) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 253886.0 -524288.0 4168931.0 -14104075.0 4117809.5 -13471865.0) + '(4 vi3 #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 290551.75 -524288.0 4130630.2 -14104385.0 3887507.8 -13723764.0) + '(0 #f #f) + '(4 ogr #f) + ) + (new 'static 'boxed-array :type object + (the binteger 3) + (new 'static 'boxed-array :type float + -632567.56 + -576346.5 + 2344408.2 + -7388373.0 + 2348460.5 + -7279539.0 + 2466947.8 + -7247920.5 + 2439049.2 + -7385641.0 + ) + '(0 #f #f) + '(4 sun #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float -467010.03 -701076.44 3209649.0 -6960872.0 3057429.0 -6862769.0) + '(6 "sunken1" #f) + '(6 "sunken2" #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float -512925.12 -681521.44 2371019.5 -6795812.0 2389408.2 -6532305.5) + '(3 village2 #f) + '(3 village2 display) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 110684.67 + -524288.0 + 1839143.8 + -7520194.5 + 1840360.8 + -7670893.0 + 1846512.6 + -7685321.0 + ) + '(6 "swamp-start" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 95661.45 -524288.0 2672740.5 -8278830.0 2639106.8 -8402343.0) + '(6 "swamp-game" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 112904.26 -524288.0 1486306.8 -8266304.5 1610530.4 -8198038.0) + '(6 "swamp-cave1" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 164830.97 + -524288.0 + -419912.5 + 3042100.0 + -133547.3 + 3439924.0 + -102430.38 + 3661115.2 + 428069.8 + 3364700.5 + ) + '(6 "misty-start" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 321007.44 + -524288.0 + -907311.4 + 3456990.5 + -757819.7 + 3679705.0 + -638801.4 + 3763613.2 + -573459.2 + 3651802.5 + -883808.56 + 3444019.2 + ) + '(6 "misty-silo" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 1) + (new 'static 'boxed-array :type float + -91155.664 + -524288.0 + 2079358.8 + -6774793.5 + 2079358.8 + -6569993.5 + 2284159.5 + -6569993.5 + 2284159.5 + -6774793.5 + ) + '(0 #f #f) + '(4 vi2 #f) + ) + (new 'static 'boxed-array :type object + (the binteger 1) + (new 'static 'boxed-array :type float + -176048.66 + -524288.0 + 2079358.8 + -6774793.5 + 2079358.8 + -6569993.5 + 2284159.5 + -6569993.5 + 2284159.5 + -6774793.5 + ) + '(4 sun #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 263068.94 -524288.0 1947299.0 -7277401.0 1663485.5 -7296843.5) + '(4 vi2 #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 240937.31 -524288.0 1655335.4 -7355865.0 1914029.8 -7344404.5) + '(4 swa #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 192776.28 -524288.0 1720459.0 -7252616.5 1888000.6 -7230796.5) + '(3 swamp display) + '(3 swamp #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 524288.0 + -524288.0 + 1543607.5 + -7296055.0 + 1536684.1 + -6977798.0 + 1589661.2 + -6897839.0 + 1929451.4 + -7131590.5 + ) + '(1 village2 swamp) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 524288.0 + -524288.0 + 474877.1 + -6501738.5 + 641064.94 + -6682781.0 + 774879.44 + -6780504.5 + ) + '(4 rol #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 524288.0 + -524288.0 + 836810.7 + -6707271.0 + 673225.56 + -6637296.5 + 468429.44 + -6424190.5 + ) + '(4 vi2 #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 388789.16 -524288.0 -137499.97 -464508.47 -239475.86 -332696.8) + '(4 vi1 #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 152569.25 + -524288.0 + -177363.28 + -182574.97 + -107676.53 + -61124.004 + -172878.95 + 81598.42 + -327656.6 + 227590.64 + -406536.56 + 216199.72 + -485581.56 + 261065.92 + -515573.0 + 191171.4 + -1338912.4 + 229231.64 + ) + '(3 beach #f) + '(3 beach display-no-wait) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 272530.25 -524288.0 -249675.55 -391214.2 -130347.68 -500937.6) + '(3 firecanyon display) + '(3 firecanyon #f) + ) + (new 'static 'boxed-array :type object + (the binteger 1) + (new 'static 'boxed-array :type float + -87713.6 + -524288.0 + 1090401.8 + -1274678.5 + 1058803.0 + -1235478.5 + 1060181.1 + -1193262.0 + 1117220.8 + -1154488.0 + 1164595.1 + -1185104.8 + 1176762.0 + -1210675.4 + 1173468.1 + -1244727.8 + 1125869.1 + -1275753.6 + ) + '(0 #f #f) + '(4 jun #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 301122.1 -524288.0 1525182.5 2034822.6 842849.06 -804235.94) + '(4 vi1 #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 325169.56 -524288.0 894672.4 -779382.3 1767576.5 1188691.0) + '(4 jun #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 326953.3 + -524288.0 + 81844.7 + -727707.5 + 15797.286 + 118401.266 + 414386.16 + 120639.44 + 1232901.1 + 1021193.6 + ) + '(1 village1 jungle) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 166814.4 + -524288.0 + 401796.53 + -610932.7 + 350019.12 + -489639.75 + 470693.25 + -460100.72 + ) + '(3 jungle display-no-wait) + '(3 jungle #f) + ) + (new 'static 'boxed-array :type object + (the binteger 3) + (new 'static 'boxed-array :type float + 375701.16 + -524288.0 + 1453916.1 + -987016.2 + 1461937.5 + -967184.75 + 1482761.0 + -957298.8 + 1505932.0 + -966185.4 + 1514189.1 + -989654.4 + 1503102.1 + -1010133.7 + 1481864.2 + -1017569.2 + 1464112.8 + -1010652.75 + ) + '(1 jungle jungleb) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 322236.66 + -524288.0 + -140670.9 + -353851.75 + 6646.948 + -375187.7 + -4327.104 + -433914.72 + ) + '(1 village1 firecanyon) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 168425.08 + -524288.0 + -201897.2 + -213989.42 + -71567.484 + -81526.12 + -112773.18 + 78722.41 + -115380.56 + 447390.62 + -241892.22 + 711968.75 + ) + '(0 #f #f) + '(1 village1 beach) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 524288.0 -524288.0 420024.44 -4814527.0 420024.44 -4609727.0) + '(3 village2 display) + '(3 village2 #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 388393.3 -524288.0 -261189.34 -3825337.5 -50913.258 -4000428.0) + '(1 village2 firecanyon) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 388789.16 -524288.0 -269444.6 -496662.28 -126883.84 -507940.1) + '(4 fic #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 332899.12 -524288.0 -1124255.8 -298838.28 -351702.84 -248529.5) + '(4 bea #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 332899.12 -524288.0 -1208873.8 -81858.37 -319884.62 -196373.8) + '(0 #f #f) + '(4 vi1 #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 335013.2 -524288.0 1300341.5 -6072380.5 1543875.5 -6043701.0) + '(4 vi2 #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 370820.16 -524288.0 1400421.9 -5994967.5 1298001.9 -5991312.0) + '(4 fic #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 313079.75 + -524288.0 + 823858.3 + -7076852.5 + 1476263.1 + -6966768.0 + 1548741.4 + -6505285.5 + 1380369.1 + -6357914.0 + 1125477.6 + -6285041.0 + 1188517.2 + -6036264.5 + ) + '(0 #f #f) + '(1 village2 rolling) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 233141.69 + -524288.0 + 742218.2 + -6802828.0 + 1334365.1 + -6818752.0 + 1357111.0 + -6436508.0 + 1047644.1 + -6334948.5 + 643162.44 + -6208203.0 + ) + '(3 rolling #f) + '(3 rolling display-no-wait) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 431070.97 + -524288.0 + 974018.4 + -7117512.5 + 1070822.5 + -7081258.0 + 1526121.6 + -7123133.0 + 1541163.8 + -7418157.0 + ) + '(1 village2 ogre) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 396387.06 + 57211.875 + 1213439.8 + -7288315.5 + 1227811.9 + -7079770.5 + 912550.5 + -7099027.5 + ) + '(3 ogre #f) + '(3 ogre display) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 336796.9 -524288.0 825355.2 -7235151.5 920252.2 -7300986.5) + '(4 ogr #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 292930.06 -524288.0 998340.94 -7272782.5 934710.06 -7195729.5) + '(4 vi2 #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 524288.0 + -168464.31 + 1927868.4 + -7085362.5 + 1605545.0 + -6870818.5 + 1615227.8 + -6471577.5 + 2177376.0 + -6131660.5 + ) + '(1 village2 sunken) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 360646.25 + -187424.25 + 2042524.0 + -7300480.5 + 1824194.5 + -6847887.0 + 1852328.8 + -6568462.5 + 2270167.8 + -6228972.5 + ) + '(3 sunken special) + '(3 sunken #f) + ) + (new 'static 'boxed-array :type object + (the binteger 3) + (new 'static 'boxed-array :type float + 126432.83 + -524288.0 + 1453916.1 + -987016.2 + 1461937.5 + -967184.75 + 1482761.0 + -957298.8 + 1505932.0 + -966185.4 + 1514189.1 + -989654.4 + 1503102.1 + -1010133.7 + 1481864.2 + -1017569.2 + 1464112.8 + -1010652.75 + ) + '(3 jungleb display) + '(3 jungleb #f) + ) + (new 'static 'boxed-array :type object + (the binteger 3) + (new 'static 'boxed-array :type float + 74968.55 + -616976.44 + 1453916.1 + -987016.2 + 1461937.5 + -967184.75 + 1482761.0 + -957298.8 + 1505932.0 + -966185.4 + 1514189.1 + -989654.4 + 1503102.1 + -1010133.7 + 1481864.2 + -1017569.2 + 1464112.8 + -1010652.75 + ) + '(4 jub #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 137771.25 -524288.0 404573.2 4098422.0 236215.77 4114074.5) + '(6 "misty-bike" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 145077.7 -524288.0 -376094.4 4543663.0 -376094.4 4748463.0) + '(6 "misty-backside" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 255537.56 + -524288.0 + -1005929.1 + 4193984.0 + -872937.2 + 4300299.0 + -756972.8 + 4208626.0 + -1025873.2 + 4087144.5 + ) + '(6 "misty-silo2" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 99096.8 -524288.0 1975605.4 -8630552.0 1975421.4 -8528661.0) + '(6 "swamp-cave2" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 141113.8 + -524288.0 + 1980493.5 + -7897138.0 + 2047652.4 + -7873304.0 + 2060152.6 + -7931657.5 + 1993817.2 + -7976457.0 + ) + '(6 "swamp-cave3" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 262804.7 + -524288.0 + 2140291.2 + -6096639.0 + 1590722.8 + -6463647.0 + 1413458.0 + -6340959.0 + 1149150.8 + -6278411.0 + 1219588.5 + -6039556.5 + ) + '(1 firecanyon village2) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 206253.42 + -524288.0 + 1430296.9 + -5984384.0 + 1438999.2 + -6119296.0 + 1420048.6 + -6125594.0 + ) + '(3 firecanyon display) + '(3 firecanyon #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float -432061.9 -714884.06 2715718.5 -7342267.0 2815001.5 -7150704.5) + '(3 sunkenb display) + '(3 sunkenb #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float -899402.06 -1098784.5 2282077.5 -6677879.5 2080828.8 -6613302.0) + '(4 sun #f) + '(4 sub #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float -451749.12 -610039.7 3063970.5 -6604280.5 3000425.2 -6456572.0) + '(6 "sunken1" #f) + '(6 "sunken-start" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 3) + (new 'static 'boxed-array :type float + -626555.75 + -524288.0 + 2344408.2 + -7388373.0 + 2348460.5 + -7279539.0 + 2466947.8 + -7247920.5 + 2439049.2 + -7385641.0 + ) + '(0 #f #f) + '(6 "sunken2" #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 198788.14 -524288.0 2287878.0 -13944549.0 2434369.8 -13646915.0) + '(3 village3 display) + '(3 village3 #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 355162.84 -524288.0 4346461.0 -14010600.0 4474615.5 -13949533.0) + '(3 ogre #f) + '(3 ogre display) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 331577.72 + -524288.0 + 4510445.5 + -13872985.0 + 4620850.5 + -14134173.0 + 4822450.0 + -13951485.0 + ) + '(0 #f #f) + '(1 village3 maincave) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 333031.2 -77890.09 4321252.0 -13451169.0 4538566.5 -13427408.0) + '(4 vi3 #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 289560.78 -524288.0 4160078.2 -13363984.0 4657438.0 -13195000.0) + '(0 #f #f) + '(4 mai #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 561218.0 -20347.875 5015965.5 -12265124.0 4969636.0 -12062795.0) + '(3 robocave display) + '(3 robocave #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 319289.8 97180.91 4060842.2 -12186625.0 3956508.8 -12221835.0) + '(3 darkcave display) + '(3 darkcave #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 390797.47 + -106231.74 + 1625981.8 + -982050.1 + 1826157.5 + -984055.0 + 1963614.9 + -752705.06 + ) + '(3 village1 special-vis) + '(3 village1 display) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 442784.28 + -39440.535 + 1899973.9 + -1546112.1 + 1741479.5 + -1291697.1 + 1490514.9 + -1133170.4 + ) + '(3 village1 #f) + '(3 village1 special-vis) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 449040.3 -98105.81 1507840.9 -1133057.6 1611146.1 -1038699.56) + '(3 village1 #f) + '(3 village1 display) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 291779.53 + 185641.23 + -556363.7 + -6215175.0 + -677982.3 + -6112309.0 + -462479.25 + -5758803.0 + ) + '(3 village2 special-vis) + '(3 village2 #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 324244.66 -524288.0 -385887.97 -7048725.0 -652583.3 -7045665.0) + '(3 village2 display) + '(3 village2 special-vis) + ) + (new 'static 'boxed-array :type object + (the binteger 1) + (new 'static 'boxed-array :type float + 330785.0 + -783128.7 + 4214055.0 + -14490533.0 + 4245485.0 + -14027390.0 + 4509959.5 + -14260475.0 + 4466017.5 + -14619070.0 + ) + '(0 #f #f) + '(1 village3 snow) + ) + (new 'static 'boxed-array :type object + (the binteger 1) + (new 'static 'boxed-array :type float + 897222.0 + -455448.7 + 4214055.0 + -14490533.0 + 4286877.5 + -13964385.0 + 4509959.5 + -14260475.0 + 4466017.5 + -14619070.0 + ) + '(3 snow #f) + '(3 snow display) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 401275.84 + -524288.0 + 3809930.2 + -13126660.0 + 4387680.5 + -12726350.0 + 4965741.5 + -12733760.0 + ) + '(1 village3 maincave) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 319289.8 97180.91 4037056.5 -12145660.0 3932723.0 -12180870.0) + '(0 #f #f) + '(4 mai #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 319289.8 97180.91 3967407.0 -12047450.0 3919676.8 -12152098.0) + '(4 dar #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 415367.12 + -20612.129 + 1473631.5 + -1157821.2 + 1414393.4 + -1193464.1 + 1354583.2 + -1238710.8 + 1291658.0 + -1325844.0 + 1151230.6 + -1642343.9 + ) + '(3 village1 display) + '(3 village1 special-vis) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 194295.77 + -524288.0 + 1993232.0 + -7776360.5 + 1646617.0 + -7919841.0 + 1546310.5 + -7956902.0 + 1497602.9 + -8055146.5 + 1350810.2 + -7725342.0 + ) + '(3 village2 display) + '(3 village2 special-vis) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 1275705.8 885660.7 4210123.5 -14454620.0 4252965.5 -14048015.0) + '(0 #f #f) + '(4 sno #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 361505.03 141642.4 5145395.0 -14585060.0 4969281.0 -14637079.0) + '(3 lavatube #f) + '(3 lavatube display) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 361505.03 141642.4 5192246.0 -14612985.0 4946641.5 -14744985.0) + '(4 vi3 #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 361505.03 141642.4 5280860.0 -14529410.0 5363850.0 -14811145.0) + '(0 #f #f) + '(4 lav #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 320479.0 -64214.67 6465568.5 -14156115.0 6450754.5 -13712894.0) + '(3 village3 #f) + '(3 village3 display) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 389780.5 201622.14 4218813.0 -14413355.0 4331064.0 -14524060.0) + '(1 village3 maincave) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 1170068.4 988919.7 2574083.2 -13973545.0 2427817.5 -13884534.0) + '(6 "snow-across-from-flut" #f) + '(6 "snow-flut-flut" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 3) + (new 'static 'boxed-array :type float + 810280.2 + -196608.0 + 3324084.2 + -13758485.0 + 3324084.2 + -13553685.0 + 3528884.2 + -13553685.0 + 3528884.2 + -13758485.0 + ) + '(0 #f #f) + '(6 "snow-outside-fort" #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 303302.1 -28407.746 1482670.0 -13217540.0 1703776.4 -13157055.0) + '(1 ogre village3) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 104778.336 -194295.75 11067174.0 -18596720.0 11019460.0 -18143272.0) + '(3 citadel display) + '(3 citadel #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 104778.336 -194295.75 11220495.0 -18577436.0 11172783.0 -18123988.0) + '(0 #f #f) + '(4 lav #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 104778.336 -424794.84 11261218.0 -18621614.0 11616860.0 -18607858.0) + '(4 cit #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 532744.06 222822.31 10045198.0 -16826564.0 10052340.0 -16500909.0) + '(1 lavatube citadel) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 1) + (new 'static 'boxed-array :type float + 30786.04 + -568353.0 + 10853810.0 + -19982956.0 + 10857980.0 + -18851744.0 + 11800185.0 + -18657540.0 + 12119948.0 + -19841458.0 + ) + '(0 #f #f) + '(1 citadel finalboss) + ) + (new 'static 'boxed-array :type object + (the binteger 1) + (new 'static 'boxed-array :type float + -37128.273 + -568353.0 + 10635460.0 + -19261390.0 + 10641390.0 + -18641098.0 + 11673320.0 + -18631850.0 + 11992955.0 + -19068516.0 + ) + '(1 citadel lavatube) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 1) + (new 'static 'boxed-array :type float + 739722.7 + -524288.0 + 11253410.0 + -19459740.0 + 11298895.0 + -19163528.0 + 11606400.0 + -19156774.0 + 11646273.0 + -19462514.0 + ) + '(4 cit #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 1) + (new 'static 'boxed-array :type float + 1552977.4 + -524288.0 + 11253410.0 + -19459740.0 + 11298895.0 + -19163528.0 + 11606400.0 + -19156774.0 + 11646273.0 + -19462514.0 + ) + '(0 #f #f) + '(4 fin #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float -432061.9 -714884.06 2624020.8 -7238923.5 2730103.5 -7108117.5) + '(6 "sunken-tube1" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 237131.75 116405.63 4134430.0 -12531289.0 4249137.0 -12480849.0) + '(0 #f #f) + '(6 "maincave-to-darkcave" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 108378.74 -18630.201 1381972.9 -8272129.5 1309181.4 -8143856.5) + '(6 "swamp-dock1" #f) + '(6 "swamp-start" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 164632.73 -17573.172 1651940.5 -8481208.0 1575238.2 -8380055.5) + '(6 "swamp-dock2" #f) + '(6 "swamp-cave1" #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 321734.22 33164.38 1472616.8 -5741056.5 1161522.8 -5738810.0) + '(6 "firecanyon-end" #f) + '(6 "firecanyon-end" #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 339769.8 -46839.75 -211696.3 -784710.75 49935.15 -742140.3) + '(6 "firecanyon-start" #f) + '(6 "firecanyon-start" #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 482151.97 69896.25 869008.6 -8462477.0 644078.75 -8259235.5) + '(6 "ogre-race" #f) + '(6 "ogre-race" #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 322923.34 4096.0 5678575.5 -14614474.0 5457999.0 -14391688.0) + '(6 "lavatube-start" #f) + '(6 "lavatube-start" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 178704.39 -135168.0 8996384.0 -14239175.0 9096633.0 -13873403.0) + '(6 "lavatube-middle" #f) + '(6 "lavatube-middle" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 247477.67 -148711.25 5555559.5 -11770044.0 5324678.0 -11402115.0) + '(6 "robocave-bottom" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float -451749.12 -610039.7 3050601.8 -6609894.0 2987056.5 -6462185.5) + '(1 sunken sunkenb) + '(1 sunken village2) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 66328.8 -101805.46 11021305.0 -19546492.0 10991630.0 -19494320.0) + '(6 "citadel-launch-end" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 87535.54 -29596.91 11275635.0 -19680194.0 11230883.0 -19653924.0) + '(6 "citadel-plat-end" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 60515.062 -64214.72 11902198.0 -19492924.0 11856455.0 -19580640.0) + '(6 "citadel-generator-end" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 1064497.0 893654.6 3369717.2 -13470538.0 3489005.0 -13470209.0) + '(6 "snow-outside-fort" #f) + '(6 "snow-fort" #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 276440.2 + -524288.0 + -1054117.4 + -7015874.0 + -1180891.2 + -6733353.5 + -911788.4 + -6482925.0 + ) + '(3 village2 special-vis) + '(3 village2 #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 263663.44 1585.5251 -677970.94 -6693857.0 -802274.3 -6692809.0) + '(3 village2 #f) + '(3 village2 special-vis) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 363883.3 -524288.0 710516.0 -605717.3 777812.4 -117024.52) + '(3 jungle display) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 524288.0 + -524288.0 + 719872.1 + -6597869.0 + 1159159.1 + -6425164.5 + 1041836.25 + -6827792.0 + ) + '(3 rolling display) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 524288.0 -524288.0 568817.3 -9466220.0 1127492.5 -9043683.0) + '(0 #f #f) + '(1 ogre village2) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 408146.53 + -227129.81 + 5624547.0 + -11755375.0 + 5604783.5 + -11539414.0 + 5326020.0 + -11550233.0 + 5180106.5 + -11499346.0 + 5148654.0 + -11322573.0 + ) + '(3 maincave special) + '(3 maincave display) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 294119.2 213916.9 11495250.0 -19186980.0 11398090.0 -19190674.0) + '(3 finalboss #f) + '(3 finalboss display) + ) + (new 'static 'boxed-array :type object + (the binteger 1) + (new 'static 'boxed-array :type float + 1470264.6 + -524288.0 + 11253410.0 + -19459740.0 + 11298895.0 + -19163528.0 + 11606400.0 + -19156774.0 + 11646273.0 + -19462514.0 + ) + '(3 citadel display) + '(3 citadel special) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 104778.336 -424794.84 11249043.0 -18841486.0 11604685.0 -18827730.0) + '(6 "citadel-start" #f) + '(6 "citadel-start" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float + 1094292.4 + 858838.25 + 3677046.8 + -13838594.0 + 3773559.8 + -13867715.0 + 3837479.8 + -13675041.0 + 3663758.2 + -13804749.0 + ) + '(0 #f #f) + '(6 "snow-pass-to-fort" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 1220937.6 1035428.9 2930553.2 -14107145.0 3128871.8 -14038774.0) + '(6 "snow-by-ice-lake-alt" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 1051944.6 888765.56 3366128.0 -13638805.0 3362401.8 -13489235.0) + '(6 "snow-outside-fort" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float 524288.0 -524288.0 1123579.9 -6421303.0 1006257.0 -6823930.5) + '(6 "village2-start" #f) + '(6 "village2-dock" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 1) + (new 'static 'boxed-array :type float + 742498.56 + -727105.9 + 4214055.0 + -14490533.0 + 4286877.5 + -13964385.0 + 4509959.5 + -14260475.0 + 4466017.5 + -14619070.0 + ) + '(4 vi3 #f) + '(3 snow display) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 318034.56 119907.06 4952800.5 -14636175.0 5113453.5 -14560723.0) + '(0 #f #f) + '(6 "village3-farside" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 383504.6 120699.85 4445610.0 -14468618.0 4343087.0 -14334280.0) + '(0 #f #f) + '(6 "village3-farside" #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 302707.6 144615.2 4420238.5 -13645623.0 4595041.0 -13553850.0) + '(6 "village3-farside" #f) + '(0 #f #f) + ) + (new 'static 'boxed-array :type object + (the binteger 2) + (new 'static 'boxed-array :type float 335938.0 140849.53 4397294.5 -14125599.0 4545135.5 -14064108.0) + '(0 #f #f) + '(6 "village3-start" #f) + ) + (new 'static 'boxed-array :type object + 0 + (new 'static 'boxed-array :type float + 404182.75 + -524288.0 + 4161991.8 + -13086341.0 + 4414040.5 + -12784800.0 + 4706984.5 + -13037610.0 + ) + '(6 "maincave-start" #f) + '(0 #f #f) + ) + ) + ) ;; failed to figure out what this is: (let* ((gp-0 (-> *static-load-boundary-list* length)) diff --git a/test/decompiler/reference/engine/level/load-boundary_REF.gc b/test/decompiler/reference/engine/level/load-boundary_REF.gc index b5b75d2057..d7744ed144 100644 --- a/test/decompiler/reference/engine/level/load-boundary_REF.gc +++ b/test/decompiler/reference/engine/level/load-boundary_REF.gc @@ -418,7 +418,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-2) ) @@ -494,10 +494,10 @@ (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> s5-0 data (-> gp-0 vertex) quad)) (set! (-> s2-0 y) (-> s5-0 top-plane)) - (add-debug-sphere #t (bucket-id debug-draw1) s2-0 8192.0 (new 'static 'rgba :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s2-0 8192.0 (new 'static 'rgba :a #x80)) (when (zero? (logand (-> s5-0 flags) (load-boundary-flags closed))) (set! (-> s2-0 y) (-> s5-0 bot-plane)) - (add-debug-sphere #t (bucket-id debug-draw1) s2-0 8192.0 (new 'static 'rgba :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s2-0 8192.0 (new 'static 'rgba :a #x80)) ) ) ) @@ -1144,7 +1144,7 @@ ) (set! (-> s5-0 v1-7 v2) (the-as uint 1)) ) - (while #t + (loop (let ((a1-11 -1)) (let ((f0-0 268435460.0)) (dotimes (v1-10 (the-as int s4-0)) @@ -1255,7 +1255,7 @@ ;; WARN: Expression building failed: Function split-monotone-polygon has a return type of none, but the expression builder found a return statement. (defun split-monotone-polygon ((arg0 load-boundary) (arg1 int)) (let ((s5-0 *triangulation-buffer*)) - (while #t + (loop (when (= (-> s5-0 (-> s5-0 (-> s5-0 arg1 v0) v0) v0) arg1) (let ((v1-10 (-> arg0 tri-cnt))) (set! (-> arg0 data v1-10 v0) (the-as uint arg1)) @@ -2062,17 +2062,10 @@ ) ) ((= v1-4 'setting-reset) - (set-setting! - *setting-control* - pp - (the-as symbol (command-get-param (car gp-0) #f)) - (the-as symbol (command-get-param (car (cdr gp-0)) #f)) - 0.0 - 0 - ) + (set-setting! (the-as symbol (command-get-param (car gp-0) #f)) (command-get-param (car (cdr gp-0)) #f) 0.0 0) ) ((= v1-4 'setting-unset) - (clear-pending-settings-from-process *setting-control* pp (the-as symbol (command-get-param (car gp-0) #f))) + (remove-setting! (the-as symbol (command-get-param (car gp-0) #f))) ) ((= v1-4 'blackout) (set-blackout-frames (the-as time-frame (the int (* 5.0000005 (the float (command-get-int (car gp-0) 0)))))) diff --git a/test/decompiler/reference/engine/load/decomp_REF.gc b/test/decompiler/reference/engine/load/decomp_REF.gc index 61bc8621ac..b0e575c839 100644 --- a/test/decompiler/reference/engine/load/decomp_REF.gc +++ b/test/decompiler/reference/engine/load/decomp_REF.gc @@ -6,8 +6,8 @@ (defun unpack-comp-rle ((out (pointer int8)) (in (pointer int8))) (local-vars (current-input int) (copy-length int)) (nop!) - (while #t - (while #t + (loop + (loop (set! current-input (-> in 0)) (set! in (&-> in 1)) (b! (<= current-input 0) cfg-5 :delay (nop!)) diff --git a/test/decompiler/reference/engine/load/loader-h_REF.gc b/test/decompiler/reference/engine/load/loader-h_REF.gc index 662456e752..83e9f74916 100644 --- a/test/decompiler/reference/engine/load/loader-h_REF.gc +++ b/test/decompiler/reference/engine/load/loader-h_REF.gc @@ -3,7 +3,7 @@ ;; definition of type load-dir (deftype load-dir (basic) - ((unknown basic :offset-assert 4) + ((lev level :offset-assert 4) (string-array (array string) :offset-assert 8) (data-array (array basic) :offset-assert 12) ) @@ -11,7 +11,7 @@ :size-assert #x10 :flag-assert #xb00000010 (:methods - (new (symbol type int basic) _type_ 0) + (new (symbol type int level) _type_ 0) (load-to-heap-by-name (_type_ string symbol kheap int) art-group 9) (set-loaded-art (_type_ art-group) art-group 10) ) @@ -25,14 +25,14 @@ :size-assert #x10 :flag-assert #xb00000010 (:methods - (new (symbol type int basic) _type_ 0) + (new (symbol type int level) _type_ 0) ) ) ;; definition for method 0 of type load-dir -(defmethod new load-dir ((allocation symbol) (type-to-make type) (length int) (unk basic)) +(defmethod new load-dir ((allocation symbol) (type-to-make type) (length int) (unk level)) (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj unknown) unk) + (set! (-> obj lev) unk) (set! (-> obj string-array) (the-as (array string) ((method-of-type array new) allocation array string length)) ) @@ -45,7 +45,7 @@ ;; definition for method 0 of type load-dir-art-group ;; INFO: Return type mismatch load-dir vs load-dir-art-group. -(defmethod new load-dir-art-group ((allocation symbol) (type-to-make type) (length int) (unk basic)) +(defmethod new load-dir-art-group ((allocation symbol) (type-to-make type) (length int) (unk level)) (let ((obj ((method-of-type load-dir new) allocation type-to-make length unk))) (set! (-> obj data-array content-type) art-group) (the-as load-dir-art-group obj) diff --git a/test/decompiler/reference/engine/load/loader_REF.gc b/test/decompiler/reference/engine/load/loader_REF.gc index 1fc2148813..45a74b83ed 100644 --- a/test/decompiler/reference/engine/load/loader_REF.gc +++ b/test/decompiler/reference/engine/load/loader_REF.gc @@ -6,7 +6,7 @@ (defmethod inspect load-dir ((obj load-dir)) (local-vars (sv-16 basic)) (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlevel: ~A~%" (-> obj unknown)) + (format #t "~Tlevel: ~A~%" (-> obj lev)) (format #t "~Tallocated-length: ~D~%" (-> obj string-array allocated-length)) (format #t "~Tlength: ~D~%" (-> obj string-array length)) (dotimes (s5-0 (-> obj string-array length)) @@ -824,24 +824,17 @@ (set! sv-56 0) (set! spool-sound (new-sound-id)) (backup-load-state-and-set-cmds *load-state* (-> arg0 command-list)) - (set-setting! *setting-control* self 'spooling (the-as symbol (process->ppointer self)) 0.0 0) + (set-setting! 'spooling (process->ppointer self) 0.0 0) (logior! (-> self skel status) (janim-status inited drawn done)) (kill-current-level-hint '() '() 'die) (level-hint-surpress!) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (when (or (handle->process (-> *art-control* spool-lock)) (!= *master-mode* 'game)) (cond (arg1 - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - arg1 - ) - (ja-channel-push! 1 15) - (let ((s2-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! s2-0 arg1 num-func-identity) - (set! (-> s2-0 frame-num) 0.0) - ) + (when (!= (ja-group) arg1) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! arg1 :num! min) ) ) (else @@ -855,12 +848,9 @@ ) (spool-push *art-control* (-> arg0 name) spool-part self -9.0) (suspend) - (when arg1 - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-loop!) + (if arg1 + (ja :num! (loop!)) ) - ) ) ) (let ((v1-46 (process->ppointer self))) @@ -876,16 +866,9 @@ (when (!= (file-status *art-control* (-> arg0 name) spool-part) 'active) (cond (arg1 - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - arg1 - ) + (when (!= (ja-group) arg1) (ja-channel-set! 1) - (let ((s2-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! s2-2 arg1 num-func-identity) - (set! (-> s2-2 frame-num) 0.0) - ) + (ja :group! arg1 :num! min) ) ) (else @@ -899,12 +882,9 @@ (spool-push *art-control* (-> arg0 name) spool-part self -20.0) (format #t "WARNING: ---------------------> loader stall on art ~S ~D~%" (-> arg0 name) spool-part) (suspend) - (when arg1 - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 param 0) 1.0) - (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-loop!) + (if arg1 + (ja :num! (loop!)) ) - ) ) ) (spool-push *art-control* (-> arg0 name) spool-part self -20.0) @@ -912,13 +892,7 @@ (cond (s2-4 (ja-channel-set! 1) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 frame-group) s2-4) - (set! (-> a0-42 param 0) (the float (+ (-> s2-4 data 0 length) -1))) - (set! (-> a0-42 param 1) 1.0) - (set! (-> a0-42 frame-num) 0.0) - (joint-control-channel-group! a0-42 s2-4 num-func-seek!) - ) + (ja-no-eval :group! s2-4 :num! (seek!) :frame-num 0.0) (when (zero? spool-part) (str-play-async (-> arg0 name) spool-sound) (set! (-> *art-control* active-stream) (-> arg0 name)) @@ -956,13 +930,8 @@ (set! sv-32 sv-72) (set! sv-48 (the-as int (-> *display* base-frame-counter))) (suspend) - (let ((f0-14 (* (- (the float (current-str-pos spool-sound)) sv-24) f30-0)) - (a0-69 (-> self skel root-channel 0)) - ) - (set! (-> a0-69 param 0) (the float (+ (-> a0-69 frame-group data 0 length) -1))) - (set! (-> a0-69 param 1) 1.0) - (set! (-> a0-69 frame-num) f0-14) - (joint-control-channel-group! a0-69 (the-as art-joint-anim #f) num-func-seek!) + (let ((f0-14 (* (- (the float (current-str-pos spool-sound)) sv-24) f30-0))) + (ja-no-eval :num! (seek!) :frame-num f0-14) ) (set! v0-39 (current-str-pos spool-sound)) (set! sv-72 v0-39) @@ -994,19 +963,15 @@ (if (zero? (logand (-> self skel status) (janim-status inited))) (logclear! (-> self skel status) (janim-status inited)) ) - (clear-pending-settings-from-process *setting-control* self 'spooling) + (remove-setting! 'spooling) (cond ((and arg1 (>= arg2 0)) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (set! (-> self skel root-channel 0 frame-group) arg1) (while (!= (-> self skel root-channel 0) (-> self skel channel)) (spool-push *art-control* (-> arg0 name) arg2 self -20.0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else diff --git a/test/decompiler/reference/engine/math/euler-h_REF.gc b/test/decompiler/reference/engine/math/euler-h_REF.gc index ffb8842332..b1c8e96fc0 100644 --- a/test/decompiler/reference/engine/math/euler-h_REF.gc +++ b/test/decompiler/reference/engine/math/euler-h_REF.gc @@ -2,16 +2,10 @@ (in-package goal) ;; definition for symbol EulSafe, type (array int32) -(define - EulSafe - (the-as (array int32) (new 'static 'boxed-array :type int32 :length 4 :allocated-length 4 0 1 2 0)) - ) +(define EulSafe (the-as (array int32) (new 'static 'boxed-array :type int32 0 1 2 0))) ;; definition for symbol EulNext, type (array int32) -(define - EulNext - (the-as (array int32) (new 'static 'boxed-array :type int32 :length 4 :allocated-length 4 1 2 0 1)) - ) +(define EulNext (the-as (array int32) (new 'static 'boxed-array :type int32 1 2 0 1))) ;; definition of type euler-angles (deftype euler-angles (vector) diff --git a/test/decompiler/reference/engine/math/transformq-h_REF.gc b/test/decompiler/reference/engine/math/transformq-h_REF.gc index 546d8a71d0..dd6cc1c3e1 100644 --- a/test/decompiler/reference/engine/math/transformq-h_REF.gc +++ b/test/decompiler/reference/engine/math/transformq-h_REF.gc @@ -71,7 +71,7 @@ (global-y-angle-to-point (_type_ vector) float 23) (relative-y-angle-to-point (_type_ vector) float 24) (roll-relative-to-gravity (_type_) float 25) - (TODO-RENAME-26 (_type_ int vector float) trsqv 26) + (set-and-limit-velocity (_type_ int vector float) trsqv 26) (get-quaternion (_type_) quaternion 27) ) ) diff --git a/test/decompiler/reference/engine/math/trigonometry_REF.gc b/test/decompiler/reference/engine/math/trigonometry_REF.gc index 62e7c065ed..3bbf79decb 100644 --- a/test/decompiler/reference/engine/math/trigonometry_REF.gc +++ b/test/decompiler/reference/engine/math/trigonometry_REF.gc @@ -81,10 +81,7 @@ ) ;; definition for symbol binary-table, type (array float) -(define binary-table (the-as (array float) (new - 'static - 'boxed-array - :type float :length 32 :allocated-length 32 +(define binary-table (the-as (array float) (new 'static 'boxed-array :type float 1.0 0.5 0.25 @@ -122,10 +119,7 @@ ) ;; definition for symbol sincos-table, type (array float) -(define sincos-table (the-as (array float) (new - 'static - 'boxed-array - :type float :length 32 :allocated-length 32 +(define sincos-table (the-as (array float) (new 'static 'boxed-array :type float 0.7853982 0.4636476 0.24497867 @@ -211,8 +205,7 @@ ) ;; definition for symbol *sin-poly-vec*, type vector -(define - *sin-poly-vec* +(define *sin-poly-vec* (new 'static 'vector :x -0.16666014 :y 0.008326521 :z -0.0001956241 :w 0.0000023042373) ) diff --git a/test/decompiler/reference/engine/nav/navigate-h_REF.gc b/test/decompiler/reference/engine/nav/navigate-h_REF.gc index 8c8eb2be1a..c24b040ec6 100644 --- a/test/decompiler/reference/engine/nav/navigate-h_REF.gc +++ b/test/decompiler/reference/engine/nav/navigate-h_REF.gc @@ -438,49 +438,44 @@ ;; definition for function nav-mesh-connect ;; Used lq/sq -(defun nav-mesh-connect ((proc process) (trans trsqv) (nav-cont nav-control)) +(defbehavior nav-mesh-connect process ((proc process) (trans trsqv) (nav-cont nav-control)) (local-vars (sv-16 type) (sv-32 symbol)) - (with-pp - (let ((ent (-> proc entity))) - (when (zero? (-> (the-as entity-actor ent) nav-mesh)) - (let ((lookup-entity (entity-actor-lookup (the-as entity-actor ent) 'nav-mesh-actor 0))) - (if lookup-entity - (set! ent lookup-entity) - ) - ) - ) - (let ((entity-nav-mesh (-> (the-as entity-actor ent) nav-mesh))) - (cond - ((nonzero? entity-nav-mesh) - (when (zero? (-> entity-nav-mesh user-list)) - (set! process-level-heap (-> (the-as entity-links (-> (the-as entity (-> pp entity)) extra)) level heap)) - (let ((s1-0 (method-of-type engine new)) - (s0-0 'process-level-heap) - ) - (set! sv-16 engine) - (set! sv-32 'nav-engine) - (let ((a3-1 (res-lump-value ent 'nav-max-users uint128 :default (the-as uint128 32)))) - (set! (-> entity-nav-mesh user-list) (s1-0 s0-0 sv-16 sv-32 (the-as int a3-1))) - ) - ) - (initialize-mesh! entity-nav-mesh) - (update-route-table entity-nav-mesh) - ) - (add-connection (-> entity-nav-mesh user-list) proc nothing proc nav-cont trans) - ) - (else - (if (and nav-cont (-> proc entity)) - (logior! - (-> (the-as entity-links (-> (the-as entity (-> proc entity)) extra)) perm status) - (entity-perm-status bit-1) - ) - ) - (set! entity-nav-mesh *default-nav-mesh*) + (let ((ent (-> proc entity))) + (when (zero? (-> ent nav-mesh)) + (let ((lookup-entity (entity-actor-lookup ent 'nav-mesh-actor 0))) + (if lookup-entity + (set! ent lookup-entity) ) - ) - entity-nav-mesh ) ) + (let ((entity-nav-mesh (-> ent nav-mesh))) + (cond + ((nonzero? entity-nav-mesh) + (when (zero? (-> entity-nav-mesh user-list)) + (set! process-level-heap (-> self entity extra level heap)) + (let ((s1-0 (method-of-type engine new)) + (s0-0 'process-level-heap) + ) + (set! sv-16 engine) + (set! sv-32 'nav-engine) + (let ((a3-1 (res-lump-value ent 'nav-max-users uint128 :default (the-as uint128 32)))) + (set! (-> entity-nav-mesh user-list) (s1-0 s0-0 sv-16 sv-32 (the-as int a3-1))) + ) + ) + (initialize-mesh! entity-nav-mesh) + (update-route-table entity-nav-mesh) + ) + (add-connection (-> entity-nav-mesh user-list) proc nothing proc nav-cont trans) + ) + (else + (if (and nav-cont (-> proc entity)) + (logior! (-> proc entity extra perm status) (entity-perm-status bit-1)) + ) + (set! entity-nav-mesh *default-nav-mesh*) + ) + ) + entity-nav-mesh + ) ) ) @@ -499,7 +494,7 @@ (goto cfg-4) ) (set! (-> obj max-spheres) sphere-count) - (set! (-> obj flags) (nav-control-flags bit8 bit13)) + (set! (-> obj flags) (nav-control-flags navcf8 navcf13)) (set! (-> obj mesh) (nav-mesh-connect (-> shape process) shape obj)) (let ((ent (-> shape process entity))) (set! (-> obj nearest-y-threshold) diff --git a/test/decompiler/reference/engine/nav/navigate_REF.gc b/test/decompiler/reference/engine/nav/navigate_REF.gc index 89fa53b84c..d9048b3af3 100644 --- a/test/decompiler/reference/engine/nav/navigate_REF.gc +++ b/test/decompiler/reference/engine/nav/navigate_REF.gc @@ -175,37 +175,28 @@ ;; definition for symbol *default-nav-mesh*, type nav-mesh (define *default-nav-mesh* (new 'static 'nav-mesh - :bounds - (new 'static 'sphere :x 12288.0 :y -200704.0 :z 12288.0 :w 20480.0) - :origin - (new 'static 'vector :y -200704.0 :w 1.0) + :bounds (new 'static 'sphere :x 12288.0 :y -200704.0 :z 12288.0 :w 20480.0) + :origin (new 'static 'vector :y -200704.0 :w 1.0) :vertex-count 4 - :vertex - (new 'static 'inline-array nav-vertex 4 + :vertex (new 'static 'inline-array nav-vertex 4 (new 'static 'nav-vertex :z 16384.0 :w 1.0) (new 'static 'nav-vertex :z 8192.0 :w 1.0) (new 'static 'nav-vertex :x 8192.0 :z 8192.0 :w 1.0) (new 'static 'nav-vertex :x 8192.0 :w 1.0) ) :poly-count 2 - :poly - (new 'static 'inline-array nav-poly 2 + :poly (new 'static 'inline-array nav-poly 2 (new 'static 'nav-poly - :vertex - (new 'static 'array uint8 3 #x0 #x2 #x1) - :adj-poly - (new 'static 'array uint8 3 #xff #x1 #xff) + :vertex (new 'static 'array uint8 3 #x0 #x2 #x1) + :adj-poly (new 'static 'array uint8 3 #xff #x1 #xff) ) (new 'static 'nav-poly :id #x1 - :vertex - (new 'static 'array uint8 3 #x1 #x2 #x3) - :adj-poly - (new 'static 'array uint8 3 #x0 #xff #xff) + :vertex (new 'static 'array uint8 3 #x1 #x2 #x3) + :adj-poly (new 'static 'array uint8 3 #x0 #xff #xff) ) ) - :route - (new 'static 'inline-array vector4ub 4 + :route (new 'static 'inline-array vector4ub 4 (new 'static 'vector4ub :data (new 'static 'array uint8 4 #xcb #x0 #x0 #x0)) (new 'static 'vector4ub) (new 'static 'vector4ub) @@ -236,7 +227,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! gp-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 0)))) (vector+! s4-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 1)))) arg1 @@ -245,7 +236,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! gp-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 1)))) (vector+! s4-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 2)))) arg1 @@ -254,7 +245,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! gp-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 2)))) (vector+! s4-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 0)))) arg1 @@ -288,22 +279,13 @@ ) ;; definition for symbol *edge-vert0-table*, type (array int8) -(define - *edge-vert0-table* - (the-as (array int8) (new 'static 'boxed-array :type int8 :length 3 :allocated-length 3 1 2 0)) - ) +(define *edge-vert0-table* (the-as (array int8) (new 'static 'boxed-array :type int8 1 2 0))) ;; definition for symbol *edge-vert1-table*, type (array int8) -(define - *edge-vert1-table* - (the-as (array int8) (new 'static 'boxed-array :type int8 :length 3 :allocated-length 3 2 0 1)) - ) +(define *edge-vert1-table* (the-as (array int8) (new 'static 'boxed-array :type int8 2 0 1))) ;; definition for symbol *edge-mask-table*, type (array int8) -(define - *edge-mask-table* - (the-as (array int8) (new 'static 'boxed-array :type int8 :length 3 :allocated-length 3 1 2 4)) - ) +(define *edge-mask-table* (the-as (array int8) (new 'static 'boxed-array :type int8 1 2 4))) ;; definition for function inc-mod3 (defun inc-mod3 ((arg0 int)) @@ -1271,14 +1253,14 @@ (let ((v1-1 (find-poly-fast obj arg0 arg1))) (when v1-1 (if arg2 - (set! (-> arg2 0) (logior (nav-control-flags bit20) (-> arg2 0))) + (set! (-> arg2 0) (logior (nav-control-flags navcf20) (-> arg2 0))) ) (set! s3-1 v1-1) (goto cfg-14) ) ) (if arg2 - (logclear! (-> arg2 0) (nav-control-flags bit20)) + (logclear! (-> arg2 0) (nav-control-flags navcf20)) ) (let ((s2-0 (new 'stack-no-clear 'inline-array 'nav-vertex 3))) (set! s3-1 (the-as nav-poly #f)) @@ -1750,19 +1732,19 @@ (when #t (set! (-> s5-0 debug-time) (the-as uint (-> *display* actual-frame-counter))) (add-debug-sphere - (logtest? (-> obj flags) (nav-control-flags bit1)) - (bucket-id debug-draw0) + (logtest? (-> obj flags) (nav-control-flags navcf1)) + (bucket-id debug) (-> s5-0 bounds) (-> s5-0 bounds w) (new 'static 'rgba :r #xff :g #xff :a #x20) ) - (add-debug-vector #t (bucket-id debug-draw1) (-> s5-0 origin) *x-vector* (meters 1.0) *color-red*) - (add-debug-vector #t (bucket-id debug-draw1) (-> s5-0 origin) *z-vector* (meters 1.0) *color-blue*) - (when (logtest? (-> obj flags) (nav-control-flags bit2)) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *x-vector* (meters 1.0) *color-red*) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *z-vector* (meters 1.0) *color-blue*) + (when (logtest? (-> obj flags) (nav-control-flags navcf2)) (dotimes (s3-0 (-> s5-0 vertex-count)) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! s4-0 (-> s5-0 origin) (the-as vector (-> s5-0 vertex s3-0))) *color-green* ) @@ -1798,9 +1780,9 @@ (set! (-> s0-0 x) (- (-> a0-15 x) (-> v1-20 x))) (set! (-> s0-0 y) (+ (-> a0-15 y) (-> v1-20 y))) (set! (-> s0-0 z) (+ (-> a0-15 z) (-> v1-20 z))) - (add-debug-line #t (bucket-id debug-draw1) sv-192 s2-0 (the-as rgba sv-208) #f (the-as rgba -1)) - (add-debug-line #t (bucket-id debug-draw1) s2-0 s1-0 (the-as rgba sv-208) #f (the-as rgba -1)) - (add-debug-line #t (bucket-id debug-draw1) s1-0 s0-0 (the-as rgba sv-208) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) sv-192 s2-0 (the-as rgba sv-208) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) s2-0 s1-0 (the-as rgba sv-208) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) s1-0 s0-0 (the-as rgba sv-208) #f (the-as rgba -1)) (let ((t9-7 add-debug-line) (a0-19 #t) (a1-13 68) @@ -1813,7 +1795,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit3)) + (when (logtest? (-> obj flags) (nav-control-flags navcf3)) (dotimes (s3-2 (-> s5-0 poly-count)) (let ((s2-1 (-> s5-0 poly s3-2))) (debug-draw-poly s5-0 s2-1 (the-as rgba (cond @@ -1838,7 +1820,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit4)) + (when (logtest? (-> obj flags) (nav-control-flags navcf4)) (let ((s1-1 add-debug-text-3d) (s0-1 #t) ) @@ -1862,7 +1844,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit5)) + (when (logtest? (-> obj flags) (nav-control-flags navcf5)) (if (-> obj next-poly) (debug-draw-poly s5-0 (-> obj next-poly) *color-cyan*) ) @@ -1873,10 +1855,10 @@ (debug-draw-poly s5-0 (-> obj current-poly) *color-red*) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit7)) + (when (logtest? (-> obj flags) (nav-control-flags navcf7)) (dotimes (s3-3 (the-as int (-> s5-0 static-sphere-count))) (let ((s2-2 (-> s5-0 static-sphere s3-3))) - (add-debug-sphere #t (bucket-id debug-draw0) (the-as vector s2-2) (-> s2-2 trans w) *color-blue*) + (add-debug-sphere #t (bucket-id debug) (the-as vector s2-2) (-> s2-2 trans w) *color-blue*) (let ((s1-2 add-debug-text-3d) (s0-2 #t) ) @@ -1906,7 +1888,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit6)) + (when (logtest? (-> obj flags) (nav-control-flags navcf6)) (when (and (-> obj portal 0) (-> obj portal 1)) (let ((v1-80 (-> s5-0 origin)) (a2-22 (new 'stack-no-clear 'vector)) @@ -1914,7 +1896,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! a2-22 v1-80 (the-as vector (-> obj portal 0))) (vector+! a3-13 v1-80 (the-as vector (-> obj portal 1))) (new 'static 'rgba :r #xff :g #x80 :b #x40 :a #x80) @@ -1925,7 +1907,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj shape trans) (-> obj travel) (meters 0.00024414062) @@ -1933,7 +1915,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! (new 'stack-no-clear 'vector) (-> obj shape trans) (new 'static 'vector :y 4096.0 :w 1.0)) (-> obj old-travel) (meters 0.00024414062) @@ -1941,15 +1923,15 @@ ) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! (new 'stack-no-clear 'vector) (-> obj shape trans) (-> obj travel)) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit7)) + (when (logtest? (-> obj flags) (nav-control-flags navcf7)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> obj shape root-prim prim-core)) (-> obj shape nav-radius) (new 'static 'rgba :g #xff :b #xff :a #x20) @@ -1959,7 +1941,7 @@ (vector+! s4-0 (-> s5-0 origin) (the-as vector (&-> v1-95 x))) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 (- (-> v1-95 w) (-> obj shape nav-radius)) (new 'static 'rgba :g #xff :b #xff :a #x20) @@ -2012,7 +1994,7 @@ ;; INFO: Return type mismatch int vs none. (defmethod set-current-poly! nav-control ((obj nav-control) (arg0 nav-poly)) (set! (-> obj current-poly) arg0) - (logior! (-> obj flags) (nav-control-flags bit9)) + (logior! (-> obj flags) (nav-control-flags navcf9)) 0 (none) ) @@ -2066,7 +2048,7 @@ ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (defun add-collide-shape-spheres ((arg0 nav-control) (arg1 collide-shape) (arg2 vector)) - (when (logtest? (-> arg1 nav-flags) 1) + (when (logtest? (-> arg1 nav-flags) (nav-flags navf0)) (set! (-> arg2 quad) (-> arg1 root-prim prim-core world-sphere quad)) (set! (-> arg2 w) (-> arg1 nav-radius)) (let ((s4-0 arg0) @@ -2088,7 +2070,7 @@ ) 0 ) - (when (logtest? (-> arg1 nav-flags) 2) + (when (logtest? (-> arg1 nav-flags) (nav-flags navf1)) (let ((s5-1 (-> arg1 process nav extra-nav-sphere))) (when (< (-> arg0 num-spheres) (-> arg0 max-spheres)) (let* ((s4-1 (-> arg0 sphere (-> arg0 num-spheres))) @@ -2127,13 +2109,17 @@ (s3-0 (new 'stack-no-clear 'vector)) ) (when (and *target* - (or (logtest? (-> obj flags) (nav-control-flags bit11)) (logtest? (-> *target* state-flags) #x80f8)) + (or (logtest? (-> obj flags) (nav-control-flags navcf11)) + (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) ) (let ((s2-0 obj) (s1-0 (-> *target* control)) ) (let ((s0-0 s3-0)) - (when (logtest? (-> s1-0 nav-flags) 1) + (when (logtest? (-> s1-0 nav-flags) (nav-flags navf0)) (set! (-> s0-0 quad) (-> s1-0 root-prim prim-core world-sphere quad)) (set! (-> s0-0 w) (-> s1-0 nav-radius)) (set! sv-32 s2-0) @@ -2153,7 +2139,7 @@ 0 ) ) - (when (logtest? (-> s1-0 nav-flags) 2) + (when (logtest? (-> s1-0 nav-flags) (nav-flags navf1)) (let ((s1-1 (-> s1-0 process nav extra-nav-sphere))) (when (< (-> s2-0 num-spheres) (-> s2-0 max-spheres)) (let* ((s0-1 (-> s2-0 sphere (-> s2-0 num-spheres))) @@ -2173,7 +2159,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit13)) + (when (logtest? (-> obj flags) (nav-control-flags navcf13)) (countdown (s2-1 (-> obj mesh static-sphere-count)) (let ((s1-2 obj) (s0-2 (-> obj mesh static-sphere s2-1)) @@ -2203,7 +2189,7 @@ (when (not (or (= s0-3 (-> obj shape)) (zero? (logand arg0 (-> s0-3 root-prim prim-core collide-as))))) (let ((s1-3 obj)) (set! sv-112 s3-0) - (when (logtest? (-> s0-3 nav-flags) 1) + (when (logtest? (-> s0-3 nav-flags) (nav-flags navf0)) (set! (-> sv-112 quad) (-> s0-3 root-prim prim-core world-sphere quad)) (set! (-> sv-112 w) (-> s0-3 nav-radius)) (set! sv-80 s1-3) @@ -2226,7 +2212,7 @@ ) 0 ) - (when (logtest? (-> s0-3 nav-flags) 2) + (when (logtest? (-> s0-3 nav-flags) (nav-flags navf1)) (let ((s0-4 (-> s0-3 process nav extra-nav-sphere))) (when (< (-> s1-3 num-spheres) (-> s1-3 max-spheres)) (set! sv-128 (-> s1-3 sphere (-> s1-3 num-spheres))) @@ -2662,7 +2648,7 @@ (set! (-> obj blocked-travel quad) (-> obj travel quad)) (let ((f0-0 (vector-xz-length (-> obj travel)))) (when (and (>= f30-0 f0-0) (< f0-0 204.8)) - (set! (-> obj flags) (logior (nav-control-flags bit17) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf17) (-> obj flags))) (set! (-> obj block-time) (-> *display* base-frame-counter)) (set! (-> obj block-count) (+ 1.0 (-> obj block-count))) (if (-> obj block-event) @@ -2709,21 +2695,21 @@ ) (cond ((or (vector= arg2 (-> obj target-pos)) (< (fabs f28-0) 364.0889)) - (set! (-> obj flags) (logior (nav-control-flags bit21) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf21) (-> obj flags))) (set! (-> arg0 quad) (-> arg2 quad)) ) (else (let ((s2-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg1 quat)))) (vector-rotate-y! s2-1 s2-1 (fmax (fmin f28-0 f30-0) (- f30-0))) (vector-normalize! s2-1 819.2) - (logclear! (-> obj flags) (nav-control-flags bit21)) + (logclear! (-> obj flags) (nav-control-flags navcf21)) (vector+! arg0 (-> arg1 trans) s2-1) ) (when (or (not (dummy-16 obj arg0)) - (logtest? (nav-control-flags bit17) (-> obj flags)) - (zero? (logand (-> obj flags) (nav-control-flags bit10))) + (logtest? (nav-control-flags navcf17) (-> obj flags)) + (zero? (logand (-> obj flags) (nav-control-flags navcf10))) ) - (set! (-> obj flags) (logior (nav-control-flags bit21) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf21) (-> obj flags))) (vector-! (-> obj travel) arg2 (-> arg1 trans)) (set! (-> arg0 quad) (-> arg2 quad)) ) @@ -2938,7 +2924,7 @@ v1-0 (-> obj current-poly) (-> obj travel) - (zero? (logand (-> obj flags) (nav-control-flags bit12))) + (zero? (logand (-> obj flags) (nav-control-flags navcf12))) arg0 arg1 ) @@ -3149,7 +3135,7 @@ sv-84 sv-88 (-> obj travel) - (zero? (logand (-> obj flags) (nav-control-flags bit12))) + (zero? (logand (-> obj flags) (nav-control-flags navcf12))) 204.8 s5-1 ) @@ -3253,10 +3239,10 @@ (defmethod dummy-11 nav-control ((obj nav-control) (arg0 vector)) (set! (-> obj old-travel quad) (-> obj travel quad)) (-> obj block-count) - (set! (-> obj block-count) (seek (-> obj block-count) 0.0 0.016666668)) - (logclear! (-> obj flags) (nav-control-flags bit9 bit17 bit18 bit19)) + (seek! (-> obj block-count) 0.0 0.016666668) + (logclear! (-> obj flags) (nav-control-flags navcf9 navcf17 navcf18 navcf19)) (TODO-RENAME-27 obj) - (if (logtest? (-> obj flags) (nav-control-flags bit8)) + (if (logtest? (-> obj flags) (nav-control-flags navcf8)) (TODO-RENAME-28 obj (collide-kind background cak-1 @@ -3331,7 +3317,7 @@ (let ((s5-1 (new 'stack-no-clear 'nav-gap-info))) (when (< (vector-xz-length (-> obj travel)) 204.8) (cond - ((logtest? (nav-control-flags bit17) (-> obj flags)) + ((logtest? (nav-control-flags navcf17) (-> obj flags)) ) ((-> obj next-poly) (cond @@ -3349,7 +3335,7 @@ ) ) (else - (set! (-> obj flags) (logior (nav-control-flags bit19) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf19) (-> obj flags))) ) ) ) diff --git a/test/decompiler/reference/engine/nav/path_REF.gc b/test/decompiler/reference/engine/nav/path_REF.gc index 50a6f7e52d..502a980024 100644 --- a/test/decompiler/reference/engine/nav/path_REF.gc +++ b/test/decompiler/reference/engine/nav/path_REF.gc @@ -31,7 +31,7 @@ (if (and (logtest? (-> obj flags) (path-control-flag draw-line)) (< s5-1 (+ (-> obj curve num-cverts) -1))) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-1 (-> obj cverts (+ s5-1 1)) (new 'static 'rgba :r #xff :g #x80 :a #x80) @@ -40,7 +40,7 @@ ) ) (if (logtest? (-> obj flags) (path-control-flag draw-point)) - (add-debug-x #t (bucket-id debug-draw1) s4-1 (new 'static 'rgba :r #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-1 (new 'static 'rgba :r #xff :a #x80)) ) (when (logtest? (-> obj flags) (path-control-flag draw-text)) (let ((s3-1 add-debug-text-3d) @@ -308,7 +308,7 @@ (if (and (logtest? (-> obj flags) (path-control-flag draw-line)) (> (-> obj curve num-cverts) 0)) (add-debug-curve2 #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as curve (&-> obj cverts)) (new 'static 'rgba :r #xff :g #x80 :a #x80) #f @@ -317,7 +317,7 @@ (dotimes (s5-1 (-> obj curve num-cverts)) (let ((s4-1 (-> obj cverts s5-1))) (if (logtest? (-> obj flags) (path-control-flag draw-point)) - (add-debug-x #t (bucket-id debug-draw1) s4-1 (new 'static 'rgba :r #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-1 (new 'static 'rgba :r #xff :a #x80)) ) (when (logtest? (-> obj flags) (path-control-flag draw-text)) (let ((s3-1 add-debug-text-3d) diff --git a/test/decompiler/reference/engine/physics/dynamics-h_REF.gc b/test/decompiler/reference/engine/physics/dynamics-h_REF.gc index 17c0139d81..27ab2512d9 100644 --- a/test/decompiler/reference/engine/physics/dynamics-h_REF.gc +++ b/test/decompiler/reference/engine/physics/dynamics-h_REF.gc @@ -53,8 +53,7 @@ :name 'standard :gravity-max (meters 40) :gravity-length (meters 60) - :gravity - (new 'static 'vector :y 245760.0 :w 1.0) + :gravity (new 'static 'vector :y 245760.0 :w 1.0) :gravity-normal (new 'static 'vector :y 1.0 :w 1.0) :walk-distance (meters 2) :run-distance (meters 5) diff --git a/test/decompiler/reference/engine/physics/trajectory_REF.gc b/test/decompiler/reference/engine/physics/trajectory_REF.gc index c92a12838c..9ec801bf4e 100644 --- a/test/decompiler/reference/engine/physics/trajectory_REF.gc +++ b/test/decompiler/reference/engine/physics/trajectory_REF.gc @@ -99,7 +99,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) prev-pos pos (new 'static 'rgba :r #xff :a #x80) diff --git a/test/decompiler/reference/engine/sound/gsound-h_REF.gc b/test/decompiler/reference/engine/sound/gsound-h_REF.gc index e52aae617e..23a4788c30 100644 --- a/test/decompiler/reference/engine/sound/gsound-h_REF.gc +++ b/test/decompiler/reference/engine/sound/gsound-h_REF.gc @@ -8,7 +8,7 @@ :size-assert #x4 :flag-assert #xa00000004 (:methods - (dummy-9 () none 9) + (unused-9 () none 9) ) ) @@ -50,16 +50,16 @@ ;; definition of type sound-play-parms (deftype sound-play-parms (structure) - ((mask uint16 :offset-assert 0) - (pitch-mod int16 :offset-assert 2) - (bend int16 :offset-assert 4) - (fo-min int16 :offset-assert 6) - (fo-max int16 :offset-assert 8) - (fo-curve int8 :offset-assert 10) - (priority int8 :offset-assert 11) - (volume int32 :offset-assert 12) - (trans vector3w :inline :offset-assert 16) - (group uint8 :offset-assert 28) + ((mask sound-mask :offset-assert 0) + (pitch-mod int16 :offset-assert 2) + (bend int16 :offset-assert 4) + (fo-min int16 :offset-assert 6) + (fo-max int16 :offset-assert 8) + (fo-curve int8 :offset-assert 10) + (priority int8 :offset-assert 11) + (volume int32 :offset-assert 12) + (trans vector3w :inline :offset-assert 16) + (group sound-group :offset-assert 28) ) :pack-me :method-count-assert 9 @@ -122,7 +122,7 @@ ;; definition of type sound-rpc-group-cmd (deftype sound-rpc-group-cmd (sound-rpc-cmd) - ((group uint8 :offset-assert 4) + ((group sound-group :offset-assert 4) ) :method-count-assert 9 :size-assert #x5 @@ -636,21 +636,21 @@ ;; definition of type sound-spec (deftype sound-spec (basic) - ((mask uint16 :offset-assert 4) - (num float :offset-assert 8) - (group uint8 :offset-assert 12) - (sound-name sound-name :offset 16) - (sound-name-char uint8 16 :offset 16) - (trans float 4 :offset-assert 32) - (volume int32 :offset-assert 48) - (pitch-mod int32 :offset-assert 52) - (bend int32 :offset-assert 56) - (fo-min int16 :offset-assert 60) - (fo-max int16 :offset-assert 62) - (fo-curve int8 :offset-assert 64) - (priority int8 :offset-assert 65) - (auto-time int32 :offset-assert 68) - (auto-from int32 :offset-assert 72) + ((mask sound-mask :offset-assert 4) + (num float :offset-assert 8) + (group sound-group :offset-assert 12) + (sound-name-char uint8 16 :offset 16) + (sound-name sound-name :offset 16) + (trans float 4 :offset-assert 32) + (volume int32 :offset-assert 48) + (pitch-mod int32 :offset-assert 52) + (bend int32 :offset-assert 56) + (fo-min int16 :offset-assert 60) + (fo-max int16 :offset-assert 62) + (fo-curve int8 :offset-assert 64) + (priority int8 :offset-assert 65) + (auto-time int32 :offset-assert 68) + (auto-from int32 :offset-assert 72) ) :method-count-assert 9 :size-assert #x4c diff --git a/test/decompiler/reference/engine/sound/gsound_REF.gc b/test/decompiler/reference/engine/sound/gsound_REF.gc index cb6acfa28d..c079d8deb4 100644 --- a/test/decompiler/reference/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/engine/sound/gsound_REF.gc @@ -406,7 +406,7 @@ ) ;; definition for function sound-set-volume -(defun sound-set-volume ((arg0 uint) (arg1 float)) +(defun sound-set-volume ((arg0 sound-group) (arg1 float)) (let ((cmd (the-as sound-rpc-set-master-volume (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command set-master-volume)) (set! (-> cmd group) arg0) @@ -440,8 +440,8 @@ ;; definition for function sound-play-by-name ;; Used lq/sq -(defun sound-play-by-name ((name sound-name) (id sound-id) (vol int) (pitch int) (bend int) (group int) (trans symbol)) - (local-vars (sv-16 int)) +(defun sound-play-by-name ((name sound-name) (id sound-id) (vol int) (pitch int) (bend int) (group sound-group) (trans symbol)) + (local-vars (sv-16 sound-group)) (with-pp (set! sv-16 group) (let ((sound-trans (the-as structure trans))) @@ -450,8 +450,8 @@ (set! (-> cmd command) (sound-command play)) (set! (-> cmd id) id) (set! (-> cmd name) name) - (set! (-> cmd parms mask) (the-as uint 0)) - (set! (-> cmd parms group) (the-as uint sv-16)) + (set! (-> cmd parms mask) (sound-mask)) + (set! (-> cmd parms group) sv-16) (set! (-> cmd parms volume) vol) (set! (-> cmd parms pitch-mod) pitch) (set! (-> cmd parms bend) bend) @@ -532,7 +532,7 @@ ) ;; definition for function sound-group-pause -(defun sound-group-pause ((arg0 uint)) +(defun sound-group-pause ((arg0 sound-group)) (let ((cmd (the-as sound-rpc-pause-group (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command pause-group)) (set! (-> cmd group) arg0) @@ -541,7 +541,7 @@ ) ;; definition for function sound-group-stop -(defun sound-group-stop ((arg0 uint)) +(defun sound-group-stop ((arg0 sound-group)) (let ((cmd (the-as sound-rpc-stop-group (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command stop-group)) (set! (-> cmd group) arg0) @@ -550,7 +550,7 @@ ) ;; definition for function sound-group-continue -(defun sound-group-continue ((arg0 uint)) +(defun sound-group-continue ((arg0 sound-group)) (let ((cmd (the-as sound-rpc-continue-group (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command continue-group)) (set! (-> cmd group) arg0) @@ -593,12 +593,10 @@ ;; definition for function sound-volume-off (defun sound-volume-off () - (with-pp - (set-setting! *setting-control* pp 'music-volume 'abs 0.0 0) - (set-setting! *setting-control* pp 'sfx-volume 'abs 0.0 0) - (set-setting! *setting-control* pp 'ambient-volume 'abs 0.0 0) - 0 - ) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) + 0 ) ;; definition for symbol *ambient-spec*, type sound-spec @@ -688,10 +686,10 @@ (set! (-> obj volume) 1024) (set! (-> obj pitch) 0) (when (and sv-16 (!= sv-16 *ambient-spec*)) - (if (logtest? (-> (the-as sound-spec sv-16) mask) 1) + (if (logtest? (-> (the-as sound-spec sv-16) mask) (sound-mask volume)) (set! (-> obj volume) (-> (the-as sound-spec sv-16) volume)) ) - (if (logtest? (-> (the-as sound-spec sv-16) mask) 2) + (if (logtest? (-> (the-as sound-spec sv-16) mask) (sound-mask pitch)) (set! (-> obj pitch) (-> (the-as sound-spec sv-16) pitch-mod)) ) ) @@ -738,7 +736,7 @@ (set! (-> spec bend) 0) (set! (-> spec sound-name) (-> obj name)) (set! (-> spec fo-max) (-> obj falloff-far)) - (set! (-> spec mask) (the-as uint 0)) + (set! (-> spec mask) (sound-mask)) (if (-> obj params) (effect-param->sound-spec spec (-> obj params) (-> obj param-count)) ) @@ -772,7 +770,7 @@ (-> obj volume) (-> obj pitch) 0 - 1 + (sound-group sfx) (the-as symbol (-> obj trans)) ) ) @@ -786,7 +784,7 @@ (-> obj volume) (-> obj pitch) 0 - 1 + (sound-group sfx) (the-as symbol (-> obj trans)) ) ) @@ -827,7 +825,7 @@ ) ) (sound-trans-convert (-> cmd parms trans) arg0) - (set! (-> cmd parms mask) (the-as uint 32)) + (set! (-> cmd parms mask) (sound-mask trans)) (-> cmd id) ) ) @@ -842,7 +840,7 @@ (set! (-> cmd command) (sound-command set-param)) (set! (-> cmd id) (-> obj playing-id)) (set! (-> cmd parms volume) (the int (* 10.24 (the float arg0)))) - (set! (-> cmd parms mask) (the-as uint 1)) + (set! (-> cmd parms mask) (sound-mask volume)) (-> cmd id) ) ) diff --git a/test/decompiler/reference/engine/sparticle/sparticle-launcher-h_REF.gc b/test/decompiler/reference/engine/sparticle/sparticle-launcher-h_REF.gc index 562fec8e98..b0377e2b59 100644 --- a/test/decompiler/reference/engine/sparticle/sparticle-launcher-h_REF.gc +++ b/test/decompiler/reference/engine/sparticle/sparticle-launcher-h_REF.gc @@ -13,7 +13,7 @@ (random-mult int32 :offset 12) (sym symbol :offset 4) (func symbol :offset 4) - (tex uint32 :offset 4) + (tex texture-id :offset 4) (pntr pointer :offset 4) (sound sound-spec :offset 4) ) diff --git a/test/decompiler/reference/engine/sparticle/sparticle-launcher_REF.gc b/test/decompiler/reference/engine/sparticle/sparticle-launcher_REF.gc index 26fa91aab3..e9017ccedd 100644 --- a/test/decompiler/reference/engine/sparticle/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/engine/sparticle/sparticle-launcher_REF.gc @@ -273,14 +273,12 @@ ) ;; definition for symbol *part-id-table*, type (array sparticle-launcher) -(define - *part-id-table* +(define *part-id-table* (the-as (array sparticle-launcher) (new 'global 'boxed-array sparticle-launcher 3584)) ) ;; definition for symbol *part-group-id-table*, type (array sparticle-launch-group) -(define - *part-group-id-table* +(define *part-group-id-table* (the-as (array sparticle-launch-group) (new 'global 'boxed-array sparticle-launch-group 1024)) ) @@ -924,9 +922,7 @@ (set! (-> obj local-clock) 0) (set! (-> obj fade) 1.0) (set! (-> obj matrix) 0) - (set! (-> obj last-spawn-frame) - (the-as int (+ (-> *display* real-actual-frame-counter) (seconds -0.006666667))) - ) + (set! (-> obj last-spawn-frame) (the-as int (+ (-> *display* real-actual-frame-counter) (seconds -0.007)))) (set! (-> obj last-spawn-time) 0) (dotimes (s3-0 (-> arg0 length)) (let* ((a0-2 (-> arg0 launcher s3-0)) @@ -1027,13 +1023,7 @@ (let ((gp-1 (vector+! (new 'stack-no-clear 'vector) arg0 (the-as vector (-> v1-0 bounds))))) (set! (-> gp-1 w) f0-0) (if (and *display-actor-vis* (or (not *display-actor-anim*) (name= *display-actor-anim* (-> obj proc name)))) - (add-debug-sphere - *display-actor-vis* - (bucket-id debug-draw0) - gp-1 - (-> gp-1 w) - (new 'static 'rgba :g #xff :a #x80) - ) + (add-debug-sphere *display-actor-vis* (bucket-id debug) gp-1 (-> gp-1 w) (new 'static 'rgba :g #xff :a #x80)) ) (sphere-in-view-frustum? (the-as sphere gp-1)) ) diff --git a/test/decompiler/reference/engine/sparticle/sparticle_REF.gc b/test/decompiler/reference/engine/sparticle/sparticle_REF.gc index 5f1ba5c726..cae7b8b322 100644 --- a/test/decompiler/reference/engine/sparticle/sparticle_REF.gc +++ b/test/decompiler/reference/engine/sparticle/sparticle_REF.gc @@ -86,14 +86,12 @@ ) ;; definition for symbol *sp-particle-system-2d*, type sparticle-system -(define - *sp-particle-system-2d* +(define *sp-particle-system-2d* (new 'global 'sparticle-system 1920 128 #f (-> *sprite-array-2d* vec-data) (-> *sprite-array-2d* adgif-data)) ) ;; definition for symbol *sp-particle-system-3d*, type sparticle-system -(define - *sp-particle-system-3d* +(define *sp-particle-system-3d* (new 'global 'sparticle-system 256 0 #t (-> *sprite-array-3d* vec-data) (-> *sprite-array-3d* adgif-data)) ) @@ -243,9 +241,7 @@ ) ) (let ((t0-5 (+ t0-4 a2-8))) - (set! (-> arg0 alloc-table (+ v1-0 a3-0)) - (logxor (-> arg0 alloc-table (+ v1-0 a3-0)) (the-as uint (ash 1 a2-8))) - ) + (logxor! (-> arg0 alloc-table (+ v1-0 a3-0)) (the-as uint (ash 1 a2-8))) (+! (-> arg0 num-alloc arg1) 1) (let ((v1-9 (-> arg0 cpuinfo-table t0-5))) (set! (-> v1-9 valid) #t) diff --git a/test/decompiler/reference/engine/target/joint-mod-h_REF.gc b/test/decompiler/reference/engine/target/joint-mod-h_REF.gc index b01bc96353..8528058592 100644 --- a/test/decompiler/reference/engine/target/joint-mod-h_REF.gc +++ b/test/decompiler/reference/engine/target/joint-mod-h_REF.gc @@ -66,7 +66,7 @@ ;; definition (debug) for function joint-mod-debug-draw ;; INFO: Return type mismatch int vs none. (defun-debug joint-mod-debug-draw ((mod joint-mod)) - (add-debug-matrix #t (bucket-id debug-draw1) (-> mod joint bone transform)) + (add-debug-matrix #t (bucket-id debug-no-zbuf) (-> mod joint bone transform)) 0 (none) ) @@ -381,7 +381,7 @@ (if (and (= (-> gp-0 process type) target) (!= (-> gp-0 blend) 0.0)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 target) 819.2 "look" @@ -486,7 +486,7 @@ (if (and (= (-> gp-0 process type) target) (!= (-> gp-0 blend) 0.0)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 target) 819.2 "look" diff --git a/test/decompiler/reference/engine/target/logic-target_REF.gc b/test/decompiler/reference/engine/target/logic-target_REF.gc index 71392b3565..a98c1fa118 100644 --- a/test/decompiler/reference/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/engine/target/logic-target_REF.gc @@ -19,7 +19,7 @@ ) (let ((s5-0 (new-stack-vector0))) (vector-z-quaternion! s5-0 (-> self control unknown-quaternion00)) - (when (logtest? (-> self control unknown-surface00 flags) 2) + (when (logtest? (-> self control unknown-surface00 flags) (surface-flags dive)) (vector-flatten! s5-0 s5-0 (-> self control dynam gravity-normal)) (vector-normalize! s5-0 1.0) ) @@ -50,13 +50,12 @@ ) ;; definition for function reverse-conversions +;; INFO: Return type mismatch cshape-moving-flags vs none. (defbehavior reverse-conversions target ((arg0 vector)) (set! (-> self control unknown-float01) (vector-xz-length (-> self control unknown-vector00))) (vector-matrix*! arg0 (-> self control unknown-vector00) (-> self control unknown-matrix01)) - (let ((v0-2 (-> self control status))) - (set! (-> self control old-status) v0-2) - v0-2 - ) + (set! (-> self control old-status) (-> self control status)) + (none) ) ;; definition (debug) for function draw-history @@ -93,7 +92,7 @@ (let ((s2-0 (-> arg0 history-data (logand (+ (-> arg0 unknown-halfword00) s4-0) 127)))) (add-debug-line (logtest? s5-0 2) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> v1-19 trans) (-> s2-0 trans) (the-as rgba (+ #xffff00 (shl s4-0 24))) @@ -102,16 +101,16 @@ ) (add-debug-vector (logtest? s5-0 4) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 trans) (-> s2-0 transv) (meters 0.000024414063) (the-as rgba (+ #x408040 (shl s4-0 24))) ) - (when (zero? (logand (-> s2-0 status) 256)) + (when (zero? (logand (-> s2-0 status) (cshape-moving-flags csmf08))) (add-debug-line (logtest? s5-0 1) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s1-0 intersect) (-> s2-0 intersect) (the-as rgba (+ #xffffff (shl s4-0 24))) @@ -124,7 +123,7 @@ ) (add-debug-vector (logtest? s5-0 32) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 intersect) (-> s2-0 surface-normal) (meters 1.0) @@ -132,7 +131,7 @@ ) (add-debug-vector (logtest? s5-0 16) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 intersect) (-> s2-0 local-normal) (meters 1.0) @@ -141,7 +140,7 @@ ) (add-debug-vector (logtest? s5-0 8) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 trans) (-> s2-0 transv-out) (meters 0.000024414063) @@ -168,7 +167,7 @@ #t "~6D ~8S #x~8X " (-> s4-0 time) - (if (logtest? (-> s4-0 status) 256) + (if (logtest? (-> s4-0 status) (cshape-moving-flags csmf08)) "air" (-> *pat-mode-info* (-> s4-0 pat mode) name) ) @@ -177,19 +176,19 @@ (format #t "~C~C~C~C~C~C" - (if (zero? (logand s3-0 1)) + (if (zero? (logand s3-0 (cshape-reaction-flags csrf00))) 103 87 ) - (if (zero? (logand s3-0 2)) + (if (zero? (logand s3-0 (cshape-reaction-flags csrf01))) 103 87 ) (cond - ((logtest? s3-0 2048) + ((logtest? s3-0 (cshape-reaction-flags csrf11)) 71 ) - ((zero? (logand s3-0 4)) + ((zero? (logand s3-0 (cshape-reaction-flags csrf02))) 103 ) (else @@ -197,21 +196,21 @@ ) ) (cond - ((logtest? s3-0 512) + ((logtest? s3-0 (cshape-reaction-flags csrf09)) 66 ) - ((logtest? s3-0 8) + ((logtest? s3-0 (cshape-reaction-flags csrf03)) 76 ) (else 99 ) ) - (if (zero? (logand s3-0 16)) + (if (zero? (logand s3-0 (cshape-reaction-flags csrf04))) 110 66 ) - (if (zero? (logand s3-0 32)) + (if (zero? (logand s3-0 (cshape-reaction-flags csrf05))) 103 65 ) @@ -219,18 +218,18 @@ (format #t "~C~C " - (if (logtest? s3-0 64) + (if (logtest? s3-0 (cshape-reaction-flags csrf06)) 78 95 ) (cond - ((logtest? s3-0 1024) + ((logtest? s3-0 (cshape-reaction-flags csrf10)) 76 ) - ((logtest? s3-0 256) + ((logtest? s3-0 (cshape-reaction-flags csrf08)) 67 ) - ((logtest? s3-0 128) + ((logtest? s3-0 (cshape-reaction-flags csrf07)) 108 ) (else @@ -306,11 +305,11 @@ (let ((s4-2 format) (s3-2 arg1) (s2-2 "~0kwall:~6X mode:~-8S material:~-10S event:~S~%") - (s1-2 (-> arg0 control unknown-int60)) - (s0-2 (pat-mode->string (the-as pat-surface (-> arg0 control unknown-int60)))) + (s1-2 (-> arg0 control wall-pat)) + (s0-2 (pat-mode->string (-> arg0 control wall-pat))) ) - (set! sv-96 (pat-material->string (the-as pat-surface (-> arg0 control unknown-int60)))) - (let ((t1-2 (pat-event->string (the-as pat-surface (-> arg0 control unknown-int60))))) + (set! sv-96 (pat-material->string (-> arg0 control wall-pat))) + (let ((t1-2 (pat-event->string (-> arg0 control wall-pat)))) (s4-2 s3-2 s2-2 s1-2 s0-2 sv-96 t1-2) ) ) @@ -329,31 +328,31 @@ (format arg1 "~0k~9S ~9S ~9S ~9S ~9S ~9S~%" - (if (logtest? (-> arg0 control status) 1) + (if (logtest? (-> arg0 control status) (cshape-moving-flags onsurf)) "on-surface" "" ) - (if (logtest? (-> arg0 control status) 2) + (if (logtest? (-> arg0 control status) (cshape-moving-flags onground)) "on-ground" "" ) - (if (logtest? (-> arg0 control status) 4) + (if (logtest? (-> arg0 control status) (cshape-moving-flags tsurf)) "t-surface" "" ) - (if (logtest? (-> arg0 control status) 8) + (if (logtest? (-> arg0 control status) (cshape-moving-flags twall)) "t-wall" "" ) - (if (logtest? (-> arg0 control status) 32) + (if (logtest? (-> arg0 control status) (cshape-moving-flags t-act)) "t-act" "" ) (cond - ((logtest? (-> arg0 control status) 16) + ((logtest? (-> arg0 control status) (cshape-moving-flags t-ciel)) "t-ceil" ) - ((logtest? (-> arg0 control status) 1024) + ((logtest? (-> arg0 control status) (cshape-moving-flags on-water)) "on-water" ) (else @@ -368,24 +367,24 @@ "in water ~A at ~M ~5S ~5S ~5S ~5S " (-> v1-49 name) (-> arg0 water height) - (if (logtest? (-> arg0 water flags) 512) + (if (logtest? (-> arg0 water flags) (water-flags wt09)) "water" "" ) - (if (logtest? (-> arg0 water flags) 1024) + (if (logtest? (-> arg0 water flags) (water-flags wt10)) "wade" "" ) - (if (logtest? (-> arg0 water flags) 2048) + (if (logtest? (-> arg0 water flags) (water-flags wt11)) "swim" "" ) - (if (logtest? (-> arg0 water flags) 4096) + (if (logtest? (-> arg0 water flags) (water-flags wt12)) "under" "" ) ) - (format arg1 "~2S~%" (if (logtest? (-> arg0 water flags) 16) + (format arg1 "~2S~%" (if (logtest? (-> arg0 water flags) (water-flags wt04)) "sg" "" ) @@ -569,7 +568,7 @@ (let ((f1-1 (* 0.0625 f1-0))) (set! (-> self control unknown-int10) a0-3) (set! (-> self control unknown-float100) f1-1) - (if (logtest? (-> self control unknown-surface01 flags) 8) + (if (logtest? (-> self control unknown-surface01 flags) (surface-flags no-turn-around)) (set! (-> v1-6 0) (the-as uint (-> *display* base-frame-counter))) ) (and (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> v1-6 0)))) (the-as uint 300)) @@ -578,7 +577,7 @@ (< 0.7 (-> self control unknown-float20)) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword20)) (seconds 0.3)) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword21)) (seconds 0.3)) - (logtest? (-> self control status) 1) + (logtest? (-> self control status) (cshape-moving-flags onsurf)) (and (< 0.7 (-> self control surface-angle)) #t) ) ) @@ -651,7 +650,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "target" @@ -770,7 +769,9 @@ ) (vector-matrix*! s2-3 s3-3 (-> self control unknown-matrix01)) (let ((f28-2 (vector-vector-xz-distance s3-3 s4-0))) - (when (and (zero? (logand (-> self control status) 4)) (< (vector-xz-length gp-0) (vector-xz-length s3-3))) + (when (and (zero? (logand (-> self control status) (cshape-moving-flags tsurf))) + (< (vector-xz-length gp-0) (vector-xz-length s3-3)) + ) (let ((f0-50 (lerp-scale 163840.0 0.0 f28-2 0.0 20480.0))) (if (and (< f28-2 20480.0) (< (-> s4-0 z) 0.0)) (set! f0-50 (* 2.0 f0-50)) @@ -780,9 +781,9 @@ ) ) ) - (if (and (zero? (logand (-> self control status) 8)) - (logtest? (-> self control old-status) 8) - (logtest? (-> self control unknown-surface00 flags) 2048) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags twall))) + (logtest? (-> self control old-status) (cshape-moving-flags twall)) + (logtest? (-> self control unknown-surface00 flags) (surface-flags jump)) (< 0.0 (-> gp-0 y)) (< 0.0 (vector-dot (-> self control dynam gravity-normal) @@ -799,9 +800,9 @@ (if (< (- (-> *display* base-frame-counter) (-> self control unknown-dword70)) (seconds 0.2)) (set! f30-4 (+ 204800.0 f30-4)) ) - (if (and (zero? (logand (-> self control status) 8)) - (and (logtest? (-> self control old-status) 8) - (logtest? (-> self control unknown-surface00 flags) 2048) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags twall))) + (and (logtest? (-> self control old-status) (cshape-moving-flags twall)) + (logtest? (-> self control unknown-surface00 flags) (surface-flags jump)) (< 0.0 (-> gp-0 y)) (< (-> gp-0 z) 0.0) ) @@ -829,7 +830,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "ltransv" @@ -840,7 +841,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "btransv" @@ -925,15 +926,16 @@ (defbehavior do-rotations2 target () (let ((gp-0 (vector-z-quaternion! (new-stack-vector0) (-> self control dir-targ))) (s5-0 - (if (and (or (zero? (logand (logior (-> self control status) (-> self control old-status)) 5)) + (if (and (or (zero? (logand (logior (-> self control status) (-> self control old-status)) (cshape-moving-flags onsurf tsurf)) + ) (< (- (-> *display* base-frame-counter) (-> self control unknown-dword20)) (seconds 0.5)) (!= (-> self next-state name) 'target-walk) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) (< (- (-> *display* base-frame-counter) (-> self control unknown-dword21)) (seconds 0.5)) - (logtest? (-> self control unknown-surface01 flags) 16) + (logtest? (-> self control unknown-surface01 flags) (surface-flags no-rotate-toward-transv)) (!= (-> self control unknown-float41) 0.0) ) - (zero? (logand (-> self control unknown-surface01 flags) 32)) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags always-rotate-toward-transv))) ) (-> self control unknown-vector20) (-> self control transv) @@ -961,7 +963,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) gp-0 (meters 2.0) @@ -969,7 +971,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s5-0 (meters 2.0) @@ -978,7 +980,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control unknown-matrix01 vector 2) (meters 2.0) @@ -1025,12 +1027,12 @@ (set! (-> self control unknown-vector10 quad) (-> self control transv quad)) ((-> self control unknown-surface01 active-hook)) (cond - ((logtest? (-> self control status) 1) + ((logtest? (-> self control status) (cshape-moving-flags onsurf)) (set! (-> self control unknown-dword11) (-> *display* base-frame-counter)) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) (if (and (>= (-> self control coverage) 1.0) - (zero? (logand (-> self control status) 1056)) - (logtest? (-> self control status) 2) + (zero? (logand (-> self control status) (cshape-moving-flags t-act on-water))) + (logtest? (-> self control status) (cshape-moving-flags onground)) ) (set! (-> self control last-known-safe-ground quad) (-> self control trans quad)) ) @@ -1038,7 +1040,7 @@ ) (else (let ((v1-25 (-> self control trans))) - (when (logtest? (-> self control old-status) 1) + (when (logtest? (-> self control old-status) (cshape-moving-flags onsurf)) (set! (-> self control unknown-vector110 quad) (-> self control unknown-vector52 quad)) (set! (-> self control unknown-vector111 quad) (-> self control unknown-vector52 quad)) ) @@ -1060,10 +1062,9 @@ (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie))) ) (if (and (= (-> self cam-user-mode) 'normal) - (logtest? (-> self control unknown-surface00 flags) 1) - (zero? - (logand (-> self control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) - ) + (logtest? (-> self control unknown-surface00 flags) (surface-flags allow-look-around)) + (zero? (logand (-> self control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) + ) (-> *setting-control* current allow-look-around) (>= (- (-> *display* base-frame-counter) (-> self no-look-around-wait)) (seconds 0.05)) (not (and (= (-> self control ground-pat material) (pat-material ice)) @@ -1077,7 +1078,7 @@ (when (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2) (not *pause-lock*) - (zero? (logand (-> self state-flags) 768)) + (zero? (logand (-> self state-flags) (state-flags grabbed first-person-mode))) ) (if (!= (-> self next-state name) 'target-falling) (send-event self 'change-mode 'falling) @@ -1122,8 +1123,10 @@ (set! (-> self control surf) *standard-ground-surface*) ) (let ((f0-17 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - (if (and (or (logtest? (-> self control unknown-surface01 flags) 1024) - (and (= (-> self next-state name) 'target-walk) (zero? (logand (-> self control status) 1))) + (if (and (or (logtest? (-> self control unknown-surface01 flags) (surface-flags allow-edge-grab)) + (and (= (-> self next-state name) 'target-walk) + (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + ) ) (< f0-17 0.0) (or (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) @@ -1144,24 +1147,14 @@ ) ) (let ((v1-146 (-> self current-level))) - (when (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 2)) - (and v1-146 - (< (-> self control trans y) (-> v1-146 info bottom-height)) - (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) - ) - ) - (let ((a1-32 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-32 from) self) - (set! (-> a1-32 num-params) 2) - (set! (-> a1-32 message) 'attack-invinc) - (set! (-> a1-32 param 0) (the-as uint #f)) - (let ((a0-102 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-102 mode) 'endlessfall) - (set! (-> a1-32 param 1) (the-as uint a0-102)) - ) - (send-event-function self a1-32) + (if (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 2)) + (and v1-146 + (< (-> self control trans y) (-> v1-146 info bottom-height)) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) + ) + ) + (send-event self 'attack-invinc #f (static-attack-info ((mode 'endlessfall)))) ) - ) ) 0 (none) @@ -1170,10 +1163,10 @@ ;; definition for function post-flag-setup ;; INFO: Return type mismatch int vs none. (defbehavior post-flag-setup target () - (if (logtest? (-> self control status) 40) + (if (logtest? (-> self control status) (cshape-moving-flags twall t-act)) (set! (-> self control unknown-dword20) (-> *display* base-frame-counter)) ) - (when (logtest? (-> self state-flags) 32) + (when (logtest? (-> self state-flags) (state-flags timed-invulnerable)) (if (< (logand (- (-> *display* base-frame-counter) (-> self control unknown-dword80)) 3) 1) (logior! (-> self draw status) (draw-status hidden)) (logclear! (-> self draw status) (draw-status hidden)) @@ -1190,24 +1183,25 @@ ;; definition for function bend-gravity ;; Used lq/sq (defbehavior bend-gravity target () - (set! (-> self control unknown-float82) (if (logtest? (-> self control status) 1) + (set! (-> self control unknown-float82) (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) 32.0 2.0 ) ) - (let ((f0-2 (if (and (logtest? (-> self control status) 8) (zero? (logand (-> self control status) 1))) - 0.0 - (-> self control unknown-float81) - ) + (let ((f0-2 + (if (and (logtest? (-> self control status) (cshape-moving-flags twall)) + (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + ) + 0.0 + (-> self control unknown-float81) ) - ) - (set! (-> self control unknown-float80) - (seek - (-> self control unknown-float80) - f0-2 - (* (-> self control unknown-float82) (-> *display* seconds-per-frame)) - ) ) + ) + (seek! + (-> self control unknown-float80) + f0-2 + (* (-> self control unknown-float82) (-> *display* seconds-per-frame)) + ) ) (vector-deg-slerp (-> self control dynam gravity-normal) @@ -1234,7 +1228,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control ground-poly-normal) (meters 2.0) @@ -1242,7 +1236,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control local-normal) (meters 2.0) @@ -1250,7 +1244,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control unknown-dynamics00 gravity-normal) (meters 2.5) @@ -1258,7 +1252,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control dynam gravity-normal) (meters 3.0) @@ -1389,7 +1383,7 @@ (when *display-edge-collision-marks* (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> (the-as swingpole s4-0) root trans) (the-as vector (&-> s4-0 stack 16)) (meters 3.0) @@ -1397,21 +1391,21 @@ ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> (the-as swingpole s4-0) root trans) (-> (the-as swingpole s4-0) range) (new 'static 'rgba :r #xff :g #xff :a #x80) ) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (-> self control unknown-vector90) 819.2 (new 'static 'rgba :r #xff :a #x80) ) - (add-debug-sphere #t (bucket-id debug-draw1) s3-0 819.2 (new 'static 'rgba :g #xff :a #x80)) - (add-debug-sphere #t (bucket-id debug-draw1) s2-0 819.2 (new 'static 'rgba :g #xff :b #x40 :a #x80)) - (add-debug-sphere #t (bucket-id debug-draw1) s5-0 819.2 (new 'static 'rgba :b #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s3-0 819.2 (new 'static 'rgba :g #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s2-0 819.2 (new 'static 'rgba :g #xff :b #x40 :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s5-0 819.2 (new 'static 'rgba :b #xff :a #x80)) ) ) (let ((s4-2 (vector-! (new-stack-vector0) s5-0 (-> self control unknown-vector90)))) @@ -1464,17 +1458,20 @@ (else (let ((v1-11 (-> self water flags))) (cond - ((and (logtest? v1-11 512) (logtest? v1-11 6144)) + ((and (logtest? v1-11 (water-flags wt09)) (logtest? v1-11 (water-flags wt11 wt12))) (vector<-cspace! (the-as vector (&-> (-> self control) unknown-qword00)) (the-as cspace (-> self node-list data)) ) - (if (not (and (logtest? (-> self water flags) 4096) (zero? (logand (-> self water flags) 16)))) + (if (not (and (logtest? (-> self water flags) (water-flags wt12)) + (zero? (logand (-> self water flags) (water-flags wt04))) + ) + ) (set! (-> self control unknown-float30) (- (-> self water base-height) (-> self water swim-height))) ) (&-> (-> self control) unknown-qword00) ) - ((and (logtest? (-> self water flags) 512) (logtest? #x40000 (-> self water flags))) + ((and (logtest? (-> self water flags) (water-flags wt09)) (logtest? (water-flags wt18) (-> self water flags))) (vector<-cspace! (the-as vector (&-> (-> self control) unknown-qword00)) (the-as cspace (-> self node-list data)) @@ -1515,7 +1512,7 @@ (cond ((logtest? (-> self control root-prim prim-core action) (collide-action ca-9 ca-13)) ) - ((logtest? (-> self water flags) 1024) + ((logtest? (-> self water flags) (water-flags wt10)) (let ((f30-0 (- (- (-> self control trans y) (- (-> self water height) (-> self water wade-height)))))) (set! (-> *wade-surface* alignv) (lerp-scale 1.0 0.5 f30-0 0.0 (- (-> self water swim-height) (-> self water wade-height))) @@ -1528,10 +1525,10 @@ ) (set! (-> self control surf) *wade-surface*) ) - ((logtest? (-> self water flags) 2048) + ((logtest? (-> self water flags) (water-flags wt11)) (set! (-> self control surf) *swim-surface*) ) - ((and (logtest? (-> self water flags) 512) (logtest? #x40000 (-> self water flags))) + ((and (logtest? (-> self water flags) (water-flags wt09)) (logtest? (water-flags wt18) (-> self water flags))) (set! (-> self control surf) *quicksand-surface*) ) ) @@ -1559,8 +1556,8 @@ ) ) (target-calc-camera-pos) - (when (logtest? (-> self state-flags) #x4000) - (set! (-> self state-flags) (logand -28673 (-> self state-flags))) + (when (logtest? (-> self state-flags) (state-flags remove-prevents)) + (logclear! (-> self state-flags) (state-flags prevent-attack prevent-duck remove-prevents)) (set! (-> self control unknown-float41) 0.0) ) (set! (-> self control unknown-int00) 0) @@ -1674,7 +1671,7 @@ ) ;; definition for function target-post -(defun target-post () +(defbehavior target-post target () (target-real-post) (none) ) @@ -1967,7 +1964,7 @@ ) (target-exit) (target-timed-invulnerable-off self) - (set! (-> self control status) (the-as uint 0)) + (set! (-> self control status) (cshape-moving-flags)) (set! (-> self control unknown-dynamics00) *standard-dynamics*) (set! (-> self control surf) *standard-ground-surface*) (set! (-> self control unknown-vector02 quad) (-> self control unknown-dynamics00 gravity-normal quad)) @@ -1988,9 +1985,9 @@ ;; INFO: Return type mismatch object vs none. ;; Used lq/sq (defbehavior init-target target ((arg0 continue-point)) - (set-setting! *setting-control* self 'allow-pause #f 0.0 0) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) - (copy-settings-from-target! *setting-control*) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (apply-settings *setting-control*) (if (not arg0) (set! arg0 (get-or-create-continue! *game-info*)) ) @@ -2094,23 +2091,12 @@ (activate-hud self) (set! (-> self fp-hud) (the-as handle #f)) (set! (-> self water) (new 'process 'water-control self 9 0.0 8192.0 2048.0)) - (set! (-> self water flags) (the-as uint #x4000f0)) + (set! (-> self water flags) (water-flags wt04 wt05 wt06 wt07 wt22)) (reset-target-state #t) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) (set! (-> self control unknown-vector52 y) (+ -819200.0 (-> self control unknown-vector52 y))) (set! (-> self align) (new 'process 'align-control self)) - (let ((s5-1 (get-process *16k-dead-pool* sidekick #x4000))) - (set! (-> self sidekick) - (the-as (pointer sidekick) (when s5-1 - (let ((t9-37 (method-of-type sidekick activate))) - (t9-37 (the-as sidekick s5-1) self 'sidekick (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 init-sidekick) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> self sidekick) (process-spawn sidekick :init init-sidekick :from *16k-dead-pool* :to self)) (set! (-> self manipy) (the-as (pointer manipy) #f)) (set! (-> self event-hook) target-generic-event-handler) (set! (-> self current-level) #f) @@ -2141,16 +2127,16 @@ (set! (-> *level* border?) #f) (set! (-> *setting-control* default border-mode) #f) (stop arg0) - (let* ((s5-0 (get-process *target-dead-pool* target #x4000)) - (v1-3 (when s5-0 - (let ((t9-2 (method-of-type target activate))) - (t9-2 (the-as target s5-0) *target-pool* 'target (&-> *dram-stack* 14336)) - ) - (run-now-in-process s5-0 init-target arg1) - (-> s5-0 ppointer) - ) - ) - ) + (let ((v1-3 (process-spawn + target + :init init-target + arg1 + :from *target-dead-pool* + :to *target-pool* + :stack *kernel-dram-stack* + ) + ) + ) (if v1-3 (set! *target* (the-as target (-> v1-3 0 self))) (set! *target* #f) diff --git a/test/decompiler/reference/engine/target/pat-h_REF.gc b/test/decompiler/reference/engine/target/pat-h_REF.gc index b1289089f7..0e3e62fad2 100644 --- a/test/decompiler/reference/engine/target/pat-h_REF.gc +++ b/test/decompiler/reference/engine/target/pat-h_REF.gc @@ -199,18 +199,14 @@ (new 'static 'pat-mode-info :name "obstacle" :wall-angle 0.82 - :color - (new 'static 'rgba :r #x7f :b #x7f :a #x40) - :hilite-color - (new 'static 'rgba :r #xff :b #xff :a #x80) + :color (new 'static 'rgba :r #x7f :b #x7f :a #x40) + :hilite-color (new 'static 'rgba :r #xff :b #xff :a #x80) ) (new 'static 'pat-mode-info :name "pole" :wall-angle 2.0 - :color - (new 'static 'rgba :r #x7f :g #x7f :a #x40) - :hilite-color - (new 'static 'rgba :r #xff :g #xff :a #x80) + :color (new 'static 'rgba :r #x7f :g #x7f :a #x40) + :hilite-color (new 'static 'rgba :r #xff :g #xff :a #x80) ) ) ) diff --git a/test/decompiler/reference/engine/target/sidekick_REF.gc b/test/decompiler/reference/engine/target/sidekick_REF.gc index 313b95d8fa..014c25b6e3 100644 --- a/test/decompiler/reference/engine/target/sidekick_REF.gc +++ b/test/decompiler/reference/engine/target/sidekick_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/sidekick-ag.gc") + ;; definition for symbol *sidekick-remap*, type pair (define *sidekick-remap* '(("run-to-stance-left" "run-to-stance") ("run-to-stance-loop-left" "run-to-stance-loop") @@ -59,8 +61,7 @@ ;; failed to figure out what this is: (defstate sidekick-clone (sidekick) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('matrix) @@ -116,10 +117,8 @@ ) ) ) - :code - (the-as (function none :behavior sidekick) looping-code) - :post - (behavior () + :code (the-as (function none :behavior sidekick) looping-code) + :post (behavior () (let ((v1-0 'process-drawable-art-error) (a0-0 (-> self parent-override)) ) @@ -173,28 +172,28 @@ (debug-print-channels (-> self skel) (the-as symbol *stdcon*)) (add-debug-sphere *display-sidekick-stats* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self parent-override 0 control unknown-cspace10 parent bone transform vector 3) 409.6 (new 'static 'rgba :g #xff :a #x80) ) (add-debug-sphere *display-sidekick-stats* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self node-list data 3 bone transform vector 3) 409.6 (new 'static 'rgba :r #xff :g #xff :a #x80) ) (add-debug-sphere *display-sidekick-stats* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self draw origin) 409.6 (new 'static 'rgba :r #xff :g #x80 :a #x80) ) ) (set! (-> self draw shadow) (the-as shadow-geo (if (and (movie?) (-> self shadow-in-movie?)) - (-> self draw art-group data 2) + sidekick-shadow-mg ) ) ) @@ -214,16 +213,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *sidekick-sg* sidekick - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 1) - :shadow 2 - :texture-level 2 - :sort 1 - ) +(defskelgroup *sidekick-sg* sidekick sidekick-lod0-jg -1 + ((sidekick-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :longest-edge (meters 1) + :shadow sidekick-shadow-mg + :texture-level 2 + :sort 1 + ) ;; definition for function init-sidekick ;; INFO: Return type mismatch object vs none. diff --git a/test/decompiler/reference/engine/target/surface-h_REF.gc b/test/decompiler/reference/engine/target/surface-h_REF.gc index 2641b138cd..85765ddc03 100644 --- a/test/decompiler/reference/engine/target/surface-h_REF.gc +++ b/test/decompiler/reference/engine/target/surface-h_REF.gc @@ -31,7 +31,7 @@ (impact-hook function :offset-assert 136) (mult-hook (function surface surface surface int none) :offset-assert 140) (mode symbol :offset-assert 144) - (flags uint32 :offset-assert 148) + (flags surface-flags :offset-assert 148) (data float 30 :offset 8) (hook function 4 :offset 128) (dataw uint32 2 :offset 144) @@ -200,7 +200,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :flags #x1 + :flags (surface-flags allow-look-around) ) ) @@ -278,7 +278,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :flags #x2000 + :flags (surface-flags ducking) ) ) ) @@ -310,7 +310,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags #x3000 + :flags (surface-flags attacking ducking) ) ) @@ -340,7 +340,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #xc00 + :flags (surface-flags allow-edge-grab jump) ) ) @@ -370,7 +370,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #xc00 + :flags (surface-flags allow-edge-grab jump) ) ) @@ -400,7 +400,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #xc00 + :flags (surface-flags allow-edge-grab jump) ) ) @@ -430,7 +430,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #xc00 + :flags (surface-flags allow-edge-grab jump) ) ) @@ -460,7 +460,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #xc80 + :flags (surface-flags prevent-attacks-during-launch-jump allow-edge-grab jump) ) ) @@ -490,7 +490,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #xc00 + :flags (surface-flags allow-edge-grab jump) ) ) @@ -520,7 +520,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #xc00 + :flags (surface-flags allow-edge-grab jump) ) ) @@ -550,7 +550,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #xc00 + :flags (surface-flags allow-edge-grab jump) ) ) @@ -580,7 +580,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #xc00 + :flags (surface-flags allow-edge-grab jump) ) ) @@ -608,7 +608,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags #x1000 + :flags (surface-flags attacking) ) ) @@ -637,7 +637,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x1c00 + :flags (surface-flags allow-edge-grab jump attacking) ) ) @@ -666,7 +666,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x1c00 + :flags (surface-flags allow-edge-grab jump attacking) ) ) ) @@ -695,7 +695,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags #x1018 + :flags (surface-flags no-turn-around no-rotate-toward-transv attacking) ) ) @@ -723,7 +723,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags #x1000 + :flags (surface-flags attacking) ) ) @@ -748,7 +748,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags #x1c00 + :flags (surface-flags allow-edge-grab jump attacking) ) ) @@ -774,7 +774,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags #x1800 + :flags (surface-flags jump attacking) ) ) @@ -804,7 +804,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x800 + :flags (surface-flags jump) ) ) ) @@ -838,7 +838,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'wade - :flags #x1 + :flags (surface-flags allow-look-around) ) ) @@ -891,7 +891,7 @@ :alignv 1.0 :align-speed 1.0 :mode 'dive - :flags #x2 + :flags (surface-flags dive) ) ) @@ -921,28 +921,28 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'dive - :flags #x2 + :flags (surface-flags dive) ) ) ;; failed to figure out what this is: (let ((a0-7 (copy *walk-mods* 'global))) (set! (-> a0-7 name) 'pole) - (set! (-> a0-7 flags) (the-as uint 0)) + (set! (-> a0-7 flags) (surface-flags)) (set! *pole-mods* a0-7) ) ;; failed to figure out what this is: (let ((a0-9 (copy *walk-mods* 'global))) (set! (-> a0-9 name) 'grab) - (set! (-> a0-9 flags) (the-as uint 0)) + (set! (-> a0-9 flags) (surface-flags)) (set! *grab-mods* a0-9) ) ;; failed to figure out what this is: (let ((a0-11 (copy *walk-mods* 'global))) (set! (-> a0-11 name) 'edge-grab) - (set! (-> a0-11 flags) (the-as uint 0)) + (set! (-> a0-11 flags) (surface-flags)) (set! *edge-grab-mods* a0-11) ) @@ -1211,7 +1211,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :flags #x18 + :flags (surface-flags no-turn-around no-rotate-toward-transv) ) ) ) diff --git a/test/decompiler/reference/engine/target/target-death_REF.gc b/test/decompiler/reference/engine/target/target-death_REF.gc index b68f9ffe3a..0cd02afaf1 100644 --- a/test/decompiler/reference/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/engine/target/target-death_REF.gc @@ -1,15 +1,14 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/deathcam-ag.gc") + ;; failed to figure out what this is: -(defskelgroup *deathcam-sg* deathcam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *deathcam-sg* deathcam deathcam-lod0-jg deathcam-idle-ja + ((deathcam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :texture-level 2 + ) ;; definition for symbol *auto-continue*, type symbol (define *auto-continue* #f) @@ -40,41 +39,38 @@ ;; failed to figure out what this is: (defstate target-continue (target) - :event - target-generic-event-handler - :exit - (behavior () + :event target-generic-event-handler + :exit (behavior () (set! (-> *load-boundary-target* 0 quad) (-> (camera-pos) quad)) (set! (-> *load-boundary-target* 1 quad) (-> (target-pos 0) quad)) (set! (-> *load-boundary-target* 2 quad) (-> *load-boundary-target* 0 quad)) (set! (-> *load-boundary-target* 3 quad) (-> *load-boundary-target* 1 quad)) - (when (zero? (logand (-> *game-info* current-continue flags) 176)) + (when (zero? (logand (-> *game-info* current-continue flags) (continue-flags intro sage-intro title))) (set! (-> *level* border?) (-> *level* play?)) (set! (-> *setting-control* default border-mode) (-> *level* play?)) ) - (clear-pending-settings-from-process *setting-control* self 'allow-pause) - (clear-pending-settings-from-process *setting-control* self 'allow-progress) - (clear-pending-settings-from-process *setting-control* self 'bg-a) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) - (clear-pending-settings-from-process *setting-control* self 'ambient-volume) - (clear-pending-settings-from-process *setting-control* self 'music) + (remove-setting! 'allow-pause) + (remove-setting! 'allow-progress) + (remove-setting! 'bg-a) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) + (remove-setting! 'music) (none) ) - :code - (behavior ((arg0 continue-point)) + :code (behavior ((arg0 continue-point)) (set! (-> self state-time) (-> *display* base-frame-counter)) (if (-> *art-control* reserve-buffer) (reserve-free *art-control* (-> *art-control* reserve-buffer heap)) ) - (push-setting! *setting-control* self 'bg-a 'abs 1.0 0) + (add-setting! 'bg-a 'abs 1.0 0) (set! (-> *setting-control* current bg-a) 1.0) - (set-setting! *setting-control* self 'sfx-volume 'abs (the-as float 0.0) 0) - (set-setting! *setting-control* self 'ambient-volume 'abs (the-as float 0.0) 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) (let ((v1-20 (lookup-level-info (-> arg0 level)))) (when v1-20 - (set-setting! *setting-control* self 'music (-> v1-20 music-bank) (the-as float 0.0) 0) - (set-setting! *setting-control* self 'music-volume 'abs (the-as float 0.0) 0) + (set-setting! 'music (-> v1-20 music-bank) 0.0 0) + (set-setting! 'music-volume 'abs 0.0 0) ) ) (set! (-> *level* border?) #f) @@ -110,17 +106,16 @@ (set! (-> *load-state* want 1 force-vis?) #f) (set! (-> *load-state* want 1 force-inside?) #f) (when (not (string= (-> arg0 name) "default")) - (while (not - (and (or (not (-> arg0 lev0)) (not (-> arg0 disp0)) (= (level-status *level* (-> arg0 lev0)) 'active)) - (or (not (-> arg0 lev1)) (not (-> arg0 disp1)) (= (level-status *level* (-> arg0 lev1)) 'active)) - ) - ) + (while (not (and (or (not (-> arg0 lev0)) (not (-> arg0 disp0)) (= (level-status *level* (-> arg0 lev0)) 'active)) + (or (not (-> arg0 lev1)) (not (-> arg0 disp1)) (= (level-status *level* (-> arg0 lev1)) 'active)) + ) + ) (let ((v1-52 (lookup-level-info (-> arg0 level)))) (if (and v1-52 (= (-> *setting-control* current music) (-> v1-52 music-bank)) - (zero? (logand (-> arg0 flags) 160)) + (zero? (logand (-> arg0 flags) (continue-flags sage-intro title))) ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) + (remove-setting! 'music-volume) ) ) (suspend) @@ -195,13 +190,13 @@ (set! (-> *ACTOR-bank* birth-max) 1000) (set-blackout-frames (seconds 0.1)) (cond - ((logtest? (-> arg0 flags) 128) + ((logtest? (-> arg0 flags) (continue-flags title)) (go target-title) ) - ((logtest? (-> arg0 flags) 16) + ((logtest? (-> arg0 flags) (continue-flags intro)) (start-sequence-a) ) - ((logtest? (-> arg0 flags) 32) + ((logtest? (-> arg0 flags) (continue-flags sage-intro)) (let ((s5-3 (entity-by-name "sage-23"))) (when s5-3 (set-blackout-frames (seconds 100)) @@ -216,7 +211,7 @@ ) ) ) - ((and (logtest? (-> arg0 flags) 2048) + ((and (logtest? (-> arg0 flags) (continue-flags sage-ecorocks)) (or (= (get-task-status (game-task beach-ecorocks)) (task-status need-hint)) (= (get-task-status (game-task beach-ecorocks)) (task-status need-introduction)) ) @@ -236,53 +231,45 @@ ) ) ) - ((logtest? (-> arg0 flags) 8) + ((logtest? (-> arg0 flags) (continue-flags demo)) (go target-demo) ) - ((logtest? (-> arg0 flags) 64) + ((logtest? (-> arg0 flags) (continue-flags sage-demo-convo)) (set-blackout-frames (seconds 1)) - (let ((s5-5 (get-process *default-dead-pool* process #x4000))) - (when s5-5 - (let ((t9-60 (method-of-type process activate))) - (t9-60 s5-5 *default-pool* 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process - s5-5 - (lambda () - (local-vars (v1-10 basic)) - (let ((gp-0 (entity-by-name "sage-23"))) - (when gp-0 - (set-blackout-frames (seconds 100)) - (entity-birth-no-kill gp-0) - (suspend) - (suspend) - (send-event - (if gp-0 - (-> gp-0 extra process) - ) - 'play-anim + (process-spawn-function + process + (lambda () + (local-vars (v1-10 basic)) + (let ((gp-0 (entity-by-name "sage-23"))) + (when gp-0 + (set-blackout-frames (seconds 100)) + (entity-birth-no-kill gp-0) + (suspend) + (suspend) + (send-event + (if gp-0 + (-> gp-0 extra process) ) - ) + 'play-anim ) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 2)) - (suspend) - ) - ) - (until (not v1-10) - (suspend) - (set! v1-10 (and *target* (logtest? (-> *target* state-flags) 256))) - ) - (set! (-> *cpad-list* cpads 0 change-time) (-> *display* base-frame-counter)) - (reset-actors 'dead) - (start 'play (get-continue-by-name *game-info* "misty-start")) ) ) - (-> s5-5 ppointer) + (let ((gp-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 2)) + (suspend) + ) + ) + (until (not v1-10) + (suspend) + (set! v1-10 (and *target* (logtest? (-> *target* state-flags) (state-flags grabbed)))) + ) + (set! (-> *cpad-list* cpads 0 change-time) (-> *display* base-frame-counter)) + (reset-actors 'dead) + (start 'play (get-continue-by-name *game-info* "misty-start")) ) ) ) - ((logtest? (-> arg0 flags) 4) + ((logtest? (-> arg0 flags) (continue-flags warp)) (let ((s5-6 (new 'static 'vector))) (cond ((string= (-> arg0 name) "village1-warp") @@ -321,7 +308,7 @@ (set-continue! *game-info* "village1-hut") ) ((or (string= (-> arg0 name) "training-warp") (string= (-> arg0 name) "game-start")) - (if (logtest? (-> arg0 flags) 1024) + (if (logtest? (-> arg0 flags) (continue-flags game-start)) (close-specific-task! (game-task intro) (task-status need-resolution)) ) (set! (-> s5-6 quad) (-> (entity-by-name "training-part-1") extra trans quad)) @@ -456,29 +443,18 @@ (when (and s5-8 (not (null? (-> s5-8 continues)))) (format 0 "~A ~A ~A~%" (-> arg0 level) (-> s5-8 name) (car (-> s5-8 continues))) (inspect global) - (let ((gp-1 (get-process *default-dead-pool* process #x4000))) - (when gp-1 - (let ((t9-104 (method-of-type process activate))) - (t9-104 gp-1 *default-pool* 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process gp-1 (lambda ((arg0 continue-point)) (start 'play arg0)) (car (-> s5-8 continues))) - (-> gp-1 ppointer) - ) - ) + (process-spawn-function process (lambda ((arg0 continue-point)) (start 'play arg0)) (car (-> s5-8 continues))) ) ) ) (ja-channel-set! 1) - (let ((v1-264 (-> self skel root-channel 0))) - (set! (-> v1-264 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) + (ja :group! eichar-stance-loop-ja) (suspend) - (logior! (-> self control status) 7) + (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (go target-stance) (none) ) - :post - target-no-move-post + :post target-no-move-post ) ;; definition for symbol *smack-mods*, type surface @@ -504,8 +480,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :mult-hook - (lambda :behavior target + :mult-hook (lambda :behavior target ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) (when (= arg3 1) (let ((f30-0 (-> self control unknown-float40)) @@ -521,13 +496,12 @@ (none) ) :mode 'air - :flags #x800 + :flags (surface-flags jump) ) ) ;; definition for symbol *smack-up-mods*, type surface -(define - *smack-up-mods* +(define *smack-up-mods* (new 'static 'surface :name 'jump :turnv 131072.0 @@ -552,8 +526,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :mult-hook - (lambda :behavior target + :mult-hook (lambda :behavior target ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) (when (= arg3 1) (let ((f30-0 (-> self control unknown-float40)) @@ -569,7 +542,7 @@ (none) ) :mode 'air - :flags #x818 + :flags (surface-flags no-turn-around no-rotate-toward-transv jump) ) ) @@ -592,26 +565,19 @@ ;; definition for function target-hit-effect ;; INFO: Return type mismatch int vs none. (defbehavior target-hit-effect target ((arg0 attack-info)) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker s5-0) self 'part-tracker (the-as pointer #x70004000)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1) + -1 + #f + #f + #f + (if (logtest? (-> arg0 mask) (attack-mask intersection)) + (-> arg0 intersection) + (-> self control root-prim prim-core) ) - (run-now-in-process - s5-0 - part-tracker-init - (-> *part-group-id-table* 1) - -1 - #f - #f - #f - (if (logtest? (-> arg0 mask) 4) - (-> arg0 intersection) - (-> self control root-prim prim-core) - ) - ) - (-> s5-0 ppointer) - ) + :to self ) (let ((v1-9 (-> arg0 mode))) (cond @@ -624,27 +590,19 @@ (= v1-13 'up) ) ) - (sound-play-by-name (static-sound-name "hit-up") (new-sound-id) 1024 0 0 1 #t) + (sound-play "hit-up") ) (else - (sound-play-by-name (static-sound-name "oof") (new-sound-id) 1024 0 0 1 #t) + (sound-play "oof") ) ) ) (case (-> arg0 mode) (('burn 'burnup) - (let ((gp-1 (get-process *default-dead-pool* process #x4000))) - (when gp-1 - (let ((t9-10 (method-of-type process activate))) - (t9-10 gp-1 self 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process gp-1 process-drawable-burn-effect 1200) - (-> gp-1 ppointer) - ) - ) + (process-spawn-function process process-drawable-burn-effect 1200 :to self) ) (('tar) - (sound-play-by-name (static-sound-name "get-burned") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-burned") ) ) 0 @@ -669,8 +627,9 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) + (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -696,7 +655,7 @@ ) #t ) - (logior! (-> self control status) 1) + (logior! (-> self control status) (cshape-moving-flags onsurf)) (return (the-as object 'stuck)) ) (let ((s1-0 (new-stack-vector0))) @@ -722,7 +681,7 @@ (let ((s5-0 #f)) (if (and (!= (-> arg0 angle) 'front) (!= (-> arg0 angle) 'shove) - (logtest? (-> arg0 mask) 2) + (logtest? (-> arg0 mask) (attack-mask vector)) (!= (-> arg0 shove-back) 0.0) ) (forward-up-nopitch->quaternion (-> self control dir-targ) arg1 (-> self control dynam gravity-normal)) @@ -735,7 +694,7 @@ (set! (-> self control unknown-surface00) *smack-up-mods*) ) (('front) - (if (and (logtest? (-> arg0 mask) 2) (!= (-> arg0 shove-back) 0.0)) + (if (and (logtest? (-> arg0 mask) (attack-mask vector)) (!= (-> arg0 shove-back) 0.0)) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-negate! (new 'stack-no-clear 'vector) arg1) @@ -757,19 +716,10 @@ (defbehavior target-hit-setup-anim target ((arg0 attack-info)) (case (-> arg0 angle) (('back) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 74) - ) - ) - (ja-channel-push! 1 22) + (when (not (ja-group? eichar-hit-from-back-ja)) + (ja-channel-push! 1 (seconds 0.075)) (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 74)) - num-func-identity - ) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim eichar-hit-from-back-ja) num-func-identity) (let ((f0-0 0.0)) (set! (-> gp-1 frame-num) f0-0) f0-0 @@ -778,19 +728,10 @@ ) ) (('up 'up-forward) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 75) - ) - ) - (ja-channel-push! 1 22) + (when (not (ja-group? eichar-hit-up-ja)) + (ja-channel-push! 1 (seconds 0.075)) (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 75)) - num-func-identity - ) + (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim eichar-hit-up-ja) num-func-identity) (let ((f0-1 0.0)) (set! (-> gp-2 frame-num) f0-1) f0-1 @@ -799,49 +740,24 @@ ) ) (('air 'jump) - (ja-channel-push! 1 15) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) - (set! (-> a0-21 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1)) - ) - (set! (-> a0-21 param 1) 1.0) - (set! (-> a0-21 frame-num) 0.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! eichar-jump-ja :num! (seek!) :frame-num 0.0) (when (= (-> arg0 angle) 'air) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + (sound-play "smack-surface") (dummy-10 (-> self skel effect) 'group-smack-surface (the-as float 0.0) 5) (dummy-10 (-> self skel effect) 'group-smack-surface-dizzy (the-as float 0.0) 8) ) ) (('shove) - (ja-channel-push! 1 15) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> self draw art-group data 78))) - (set! (-> a0-30 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 78)) data 0 length) -1)) - ) - (set! (-> a0-30 param 1) 1.0) - (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> self draw art-group data 78)) num-func-seek!) - ) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! eichar-smack-surface-ja :num! (seek!) :frame-num 0.0) + (sound-play "smack-surface") ) (else - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 73) - ) - ) - (ja-channel-push! 1 22) + (when (not (ja-group? eichar-hit-from-front-ja)) + (ja-channel-push! 1 (seconds 0.075)) (let ((gp-5 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-5 - (the-as art-joint-anim (-> self draw art-group data 73)) - num-func-identity - ) + (joint-control-channel-group-eval! gp-5 (the-as art-joint-anim eichar-hit-from-front-ja) num-func-identity) (let ((f0-10 0.0)) (set! (-> gp-5 frame-num) f0-10) f0-10 @@ -881,39 +797,20 @@ ) (set-quaternion! (-> self control) (-> self control dir-targ)) #t - (let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - (ja-step 0) - ) - ) - ) - ) - ) + (let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (ja-group) data 0 length) -1)) (ja-step 0)))))) (until v1-40 (+! f30-1 (* (-> arg0 shove-back) f28-1 (-> *display* seconds-per-frame))) (set! s2-1 (target-hit-push s3-1 s1-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) - (set! v1-40 (or (ja-done? 0) (and arg1 (logtest? (-> self control status) 1)))) + (ja :num! (seek!)) + (set! v1-40 (or (ja-done? 0) (and arg1 (logtest? (-> self control status) (cshape-moving-flags onsurf))))) ) - (while (and (or (zero? (logand (-> self control status) 1)) s2-1) (!= s2-1 'stuck)) + (while (and (or (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) s2-1) (!= s2-1 'stuck)) (arg2) (+! f30-1 (* (-> arg0 shove-back) f28-1 (-> *display* seconds-per-frame))) (set! s2-1 (target-hit-push s3-1 s1-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) (if (not s2-1) - (set! (-> self state-flags) (logand -9 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags being-attacked)) ) (suspend) ) @@ -926,10 +823,8 @@ ;; failed to figure out what this is: (defstate target-hit (target) - :event - target-standard-event-handler - :exit - (behavior () + :event target-standard-event-handler + :exit (behavior () (let ((gp-0 (new-stack-vector0)) (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) @@ -949,13 +844,12 @@ ) ) (if (!= (-> self next-state name) 'target-death) - (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags being-attacked dying)) ) (target-exit) (none) ) - :trans - (behavior () + :trans (behavior () (when (= *cheat-mode* 'debug) (when (and (not *pause-lock*) (cpad-hold? (-> self control unknown-cpad-info00 number) r2)) (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) @@ -964,9 +858,8 @@ ) (none) ) - :code - (behavior ((arg0 symbol) (arg1 attack-info)) - (set! (-> self water flags) (logand -65537 (-> self water flags))) + :code (behavior ((arg0 symbol) (arg1 attack-info)) + (logclear! (-> self water flags) (water-flags wt16)) (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 (-> self attack-info))) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -990,7 +883,7 @@ ) ) (combine! gp-0 arg1) - (when (zero? (logand (-> gp-0 mask) 2)) + (when (zero? (logand (-> gp-0 mask) (attack-mask vector))) (vector-z-quaternion! (-> gp-0 vector) (-> self control unknown-quaternion00)) (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) (set! (-> gp-0 vector y) (-> gp-0 shove-up)) @@ -1011,7 +904,7 @@ ) ) (when (= arg0 'attack) - (logior! (-> self state-flags) 8) + (logior! (-> self state-flags) (state-flags being-attacked)) (set! (-> self game hit-time) (-> *display* base-frame-counter)) (case (-> gp-0 mode) (('endlessfall) @@ -1094,18 +987,13 @@ (go target-hit-ground #f) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; definition for symbol *death-spool-array*, type (array spool-anim) -(define - *death-spool-array* +(define *death-spool-array* (the-as (array spool-anim) - (new - 'static - 'boxed-array - :type spool-anim :length 11 :allocated-length 11 + (new 'static 'boxed-array :type spool-anim (new 'static 'spool-anim :name "death-0181" :index 3 :parts 1 :command-list '()) (new 'static 'spool-anim :name "death-0182" :index 4 :parts 1 :command-list '()) (new 'static 'spool-anim :name "death-0184" :index 5 :parts 1 :command-list '()) @@ -1143,34 +1031,22 @@ ;; INFO: Return type mismatch int vs none. (defbehavior target-death-anim target ((arg0 spool-anim)) (set! (-> self control unknown-surface00) *neutral-mods*) - (ja-channel-push! 1 30) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 76))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 76)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 76)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! eichar-deatha-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if arg0 (spool-push *art-control* (-> arg0 name) 0 self (the-as float -99.0)) ) (send-event *camera* 'joystick 0.0 -1.0) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (when (zero? (logand (-> self align flags) 1)) + (when (zero? (logand (-> self align flags) (align-flags disabled))) (vector-matrix*! s5-0 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (vector-float*! (-> self control transv) s5-0 (-> *display* frames-per-second)) ) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) 0 (none) @@ -1178,39 +1054,29 @@ ;; failed to figure out what this is: (defstate target-death (target) - :exit - (behavior () - (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags being-attacked dying)) (target-exit) - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (clear-pending-settings-from-process *setting-control* self 'allow-progress) + (remove-setting! 'process-mask) + (remove-setting! 'allow-progress) (restore-collide-with-as (-> self control)) - (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (none) ) - :trans - (-> target-hit trans) - :code - (behavior ((arg0 symbol)) + :trans (-> target-hit trans) + :code (behavior ((arg0 symbol)) (set! (-> self control unknown-uint20) (the-as uint #f)) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'target) - (set! (-> a1-0 param 0) (the-as uint 'die)) - (set! (-> a1-0 param 1) (the-as uint arg0)) - (set! (-> self control unknown-int21) - (the-as int (send-event-function (handle->process (-> self attack-info attacker)) a1-0)) - ) - ) + (set! (-> self control unknown-int21) + (the-as int (send-event (handle->process (-> self attack-info attacker)) 'target 'die arg0)) + ) (set! (-> self neck flex-blend) 0.0) (target-timed-invulnerable-off self) - (set-setting! *setting-control* self 'process-mask 'set (the-as float 0.0) #x14a0000) - (copy-settings-from-target! *setting-control*) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) + (apply-settings *setting-control*) (set! (-> self control transv quad) (the-as uint128 0)) - (logior! (-> self state-flags) #x8000) + (logior! (-> self state-flags) (state-flags dying)) (case arg0 (('none 'instant-death) ) @@ -1226,22 +1092,22 @@ ) ) (('drown 'drown-death) - (sound-play-by-name (static-sound-name "death-drown") (new-sound-id) 1024 0 0 1 #t) - (set! (-> self water flags) (logand -17 (-> self water flags))) + (sound-play "death-drown") + (logclear! (-> self water flags) (water-flags wt04)) (clear-collide-with-as (-> self control)) (set! (-> self control unknown-surface00) *dive-mods*) (set! (-> self control dynam gravity-max) 6144.0) (set! (-> self control dynam gravity-length) 6144.0) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (let ((f30-0 0.7) (gp-3 (-> self skel root-channel 0)) ) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 93))) + (set! (-> gp-3 frame-group) (the-as art-joint-anim eichar-swim-walk-to-down-ja)) (set! (-> gp-3 param 0) (ja-aframe (the-as float 73.0) 0)) (let ((f30-1 (seek f30-0 (the-as float 0.05) (* 1.5 (-> *display* seconds-per-frame))))) (set! (-> gp-3 param 1) f30-1) (set! (-> gp-3 frame-num) 0.0) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 93)) num-func-seek!) + (joint-control-channel-group! gp-3 (the-as art-joint-anim eichar-swim-walk-to-down-ja) num-func-seek!) (until (ja-done? 0) (suspend) (let ((gp-4 (-> self skel root-channel 0))) @@ -1259,33 +1125,37 @@ (when (if (and (nonzero? s5-1) (type-type? (-> s5-1 type) water-vol)) s5-1 ) - (set! (-> self state-flags) (logior #x80000 (-> self state-flags))) + (set! (-> self state-flags) (logior (state-flags falling-into-pool-of-bad) (-> self state-flags))) (set! (-> self alt-cam-pos y) (+ 4096.0 (-> self water height))) ) ) (cond ((= arg0 'dark-eco-pool) - (sound-play-by-name (static-sound-name "death-darkeco") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-6 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-6 - (let ((t9-21 (method-of-type part-tracker activate))) - (t9-21 (the-as part-tracker gp-6) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-6 part-tracker-init (-> *part-group-id-table* 31) -1 #f #f #f (-> self control trans)) - (-> gp-6 ppointer) - ) + (sound-play "death-darkeco") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 31) + -1 + #f + #f + #f + (-> self control trans) + :to *entity-pool* ) ) ((or (= arg0 'lava) (= arg0 'melt)) - (sound-play-by-name (static-sound-name "death-melt") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-8 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-8 - (let ((t9-26 (method-of-type part-tracker activate))) - (t9-26 (the-as part-tracker gp-8) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-8 part-tracker-init (-> *part-group-id-table* 32) -1 #f #f #f (-> self control trans)) - (-> gp-8 ppointer) - ) + (sound-play "death-melt") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 32) + -1 + #f + #f + #f + (-> self control trans) + :to *entity-pool* ) ) ) @@ -1300,10 +1170,10 @@ ) ) (('endlessfall) - (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-fall") (camera-change-to (the-as string cam-endlessfall) 30 #f) (set! (-> self control pat-ignore-mask unknown-bit) 1) - (set! (-> self water flags) (logand -17 (-> self water flags))) + (logclear! (-> self water flags) (water-flags wt04)) (let ((f30-2 (fmin -4096.0 (- (-> self control ground-impact-vel))))) (set! (-> self control unknown-uint20) (the-as uint f30-2)) (let ((gp-11 (new-stack-vector0))) @@ -1352,25 +1222,12 @@ (none) ) ) - (target-falling-anim (seconds 0.1) 99) - (ja-channel-push! 1 90) - (let ((a0-75 (-> self skel root-channel 0))) - (set! (-> a0-75 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) - (set! (-> a0-75 param 0) 0.5) - (set! (-> a0-75 frame-num) 0.0) - (joint-control-channel-group! a0-75 (the-as art-joint-anim (-> self draw art-group data 43)) num-func-loop!) - ) + (target-falling-anim (seconds 0.1) (seconds 0.33)) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! eichar-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) (let ((gp-12 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-12) (seconds 0.8)) - (let ((a0-76 (-> self skel root-channel 0))) - (set! (-> a0-76 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) - (set! (-> a0-76 param 0) 0.5) - (joint-control-channel-group-eval! - a0-76 - (the-as art-joint-anim (-> self draw art-group data 43)) - num-func-loop! - ) - ) + (ja :group! eichar-launch-jump-loop-ja :num! (loop! 0.5)) (suspend) ) ) @@ -1378,23 +1235,11 @@ ) (('target-hit-ground-hard) (set! (-> self control unknown-surface00) *neutral-mods*) - (ja-channel-push! 1 30) - (let ((a0-81 (-> self skel root-channel 0))) - (set! (-> a0-81 frame-group) (the-as art-joint-anim (-> self draw art-group data 77))) - (set! (-> a0-81 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 77)) data 0 length) -1)) - ) - (set! (-> a0-81 param 1) 1.0) - (set! (-> a0-81 frame-num) 0.0) - (joint-control-channel-group! a0-81 (the-as art-joint-anim (-> self draw art-group data 77)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! eichar-death-painful-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-82 (-> self skel root-channel 0))) - (set! (-> a0-82 param 0) (the float (+ (-> a0-82 frame-group data 0 length) -1))) - (set! (-> a0-82 param 1) 1.0) - (joint-control-channel-group-eval! a0-82 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (('sharkey) @@ -1446,30 +1291,23 @@ ) ) (('burn 'burnup) - (let ((gp-15 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-15 - (let ((t9-52 (method-of-type part-tracker activate))) - (t9-52 (the-as part-tracker gp-15) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-15 - part-tracker-init - (-> *part-group-id-table* 708) - -1 - #f - #f - #f - (-> self control trans) - ) - (-> gp-15 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 708) + -1 + #f + #f + #f + (-> self control trans) + :to *entity-pool* ) (target-death-anim (the-as spool-anim #f)) ) (else (case arg0 (('tar) - (sound-play-by-name (static-sound-name "death-drown") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-drown") ) ) (+! (-> *game-info* death-movie-tick) 1) @@ -1482,10 +1320,10 @@ (-> *death-spool-array* (death-movie-remap (-> *game-info* death-movie-tick) (-> *death-spool-array* length))) ) ) - (set-setting! *setting-control* self 'allow-progress #f (the-as float 0.0) 0) + (set-setting! 'allow-progress #f 0.0 0) (target-death-anim gp-18) (when (and (< (rand-vu-int-count (-> *game-info* death-movie-tick)) (* (-> *death-spool-array* length) 2)) - (zero? (logand (-> self water flags) 512)) + (zero? (logand (-> self water flags) (water-flags wt09))) (!= (-> self control ground-pat material) 9) (!= (-> self control ground-pat material) 10) ) @@ -1510,19 +1348,11 @@ (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (send-event (ppointer->process (-> self sidekick)) 'shadow #f) (send-event self 'blend-shape #t) - (let* ((s5-7 (get-process *default-dead-pool* pov-camera #x4000)) - (s5-8 - (ppointer->handle - (when s5-7 - (let ((t9-68 (method-of-type pov-camera activate))) - (t9-68 (the-as pov-camera s5-7) *target-pool* 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process s5-7 pov-camera-init-by-other (-> self control trans) *deathcam-sg* gp-18 4 self '()) - (-> s5-7 ppointer) - ) - ) - ) - ) + (let ((s5-8 (ppointer->handle + (process-spawn pov-camera (-> self control trans) *deathcam-sg* gp-18 4 self '() :to *target-pool*) + ) + ) + ) (send-event (handle->process s5-8) 'music-movie-volume 0.0) (send-event (handle->process s5-8) 'sfx-movie-volume 50.0) (set! (-> self post-hook) target-no-ja-move-post) @@ -1550,6 +1380,5 @@ (anim-loop) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) diff --git a/test/decompiler/reference/engine/target/target-h_REF.gc b/test/decompiler/reference/engine/target/target-h_REF.gc index 150ff9f9a5..55670afd8a 100644 --- a/test/decompiler/reference/engine/target/target-h_REF.gc +++ b/test/decompiler/reference/engine/target/target-h_REF.gc @@ -29,11 +29,12 @@ (fp-hud handle :offset-assert 560) (no-load-wait time-frame :offset-assert 568) (no-look-around-wait time-frame :offset-assert 576) + (burn-proc handle :offset-assert 584) ) :heap-base #x1e0 :method-count-assert 21 - :size-assert #x248 - :flag-assert #x1501e00248 + :size-assert #x250 + :flag-assert #x1501e00250 (:methods (find-edge-grabs! (_type_ collide-cache) object 20) ) @@ -131,7 +132,7 @@ target-title-wait target-tube (target-tube-death symbol) - (target-tube-hit handle attack-info) + (target-tube-hit symbol attack-info) (target-tube-jump float float) (target-tube-start handle) target-turn-around diff --git a/test/decompiler/reference/engine/target/target-handler_REF.gc b/test/decompiler/reference/engine/target/target-handler_REF.gc index c4004fb1f1..51b01c8f6a 100644 --- a/test/decompiler/reference/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/engine/target/target-handler_REF.gc @@ -35,14 +35,14 @@ object (cond ((= v1-0 'get-pickup) - (when (zero? (logand (-> self state-flags) #x8000)) + (when (zero? (logand (-> self state-flags) (state-flags dying))) (let ((s4-0 (-> arg3 param 0)) (f28-0 (the-as float (-> arg3 param 1))) ) (if (!= (pickup-collectable! (-> self fact-info-target) (the-as pickup-type s4-0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as handle #f) ) (pickup-collectable! (-> self fact-info-target) (the-as pickup-type s4-0) f28-0 (process->handle arg0)) @@ -115,7 +115,7 @@ (pickup-collectable! (-> self fact-info-target) (the-as pickup-type (-> arg3 param 1)) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as handle #f) ) ) @@ -128,24 +128,24 @@ (case (-> arg3 param 0) (('save) (set! (-> self alt-cam-pos quad) (-> self control trans quad)) - (set! (-> self state-flags) (logior #x20000 (-> self state-flags))) + (set! (-> self state-flags) (logior (state-flags has-saved-position) (-> self state-flags))) (mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48) ) (('restore) - (set! (-> self state-flags) (logand -131073 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags has-saved-position)) (let ((gp-1 (-> arg3 param 1))) (move-to-point! (-> self control) (the-as vector (+ gp-1 0))) (quaternion-copy! (-> self control quat) (the-as quaternion (+ gp-1 16))) ) (rot->dir-targ! (-> self control)) - (logior! (-> self control status) 7) + (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! v0-0 (the-as none (-> *display* base-frame-counter))) (set! (-> self control unknown-dword11) (the-as time-frame v0-0)) v0-0 ) (('reset) - (set! v0-0 (the-as none (logand -131073 (-> self state-flags)))) - (set! (-> self state-flags) (the-as uint v0-0)) + (set! v0-0 (the-as none (logclear (-> self state-flags) (state-flags has-saved-position)))) + (set! (-> self state-flags) (the-as state-flags v0-0)) v0-0 ) ) @@ -168,13 +168,13 @@ (set! (-> self neck flex-blend) (the-as float (-> arg3 param 0))) (cond ((-> arg3 param 1) - (set! (-> self state-flags) (logior #x40000 (-> self state-flags))) + (set! (-> self state-flags) (logior (state-flags looking-at-enemy) (-> self state-flags))) (set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) (look-at-enemy! (-> self neck) (-> self alt-neck-pos) 'force arg0) ) (else - (set! v0-0 (the-as none (logand -262145 (-> self state-flags)))) - (set! (-> self state-flags) (the-as uint v0-0)) + (set! v0-0 (the-as none (logclear (-> self state-flags) (state-flags looking-at-enemy)))) + (set! (-> self state-flags) (the-as state-flags v0-0)) v0-0 ) ) @@ -225,13 +225,13 @@ (cond ((-> arg3 param 0) (let ((v1-108 (-> self draw shadow-ctrl))) - (set! (-> v1-108 settings flags) (logand -33 (-> v1-108 settings flags))) + (logclear! (-> v1-108 settings flags) (shadow-flags disable-draw)) ) 0 ) (else (let ((v1-110 (-> self draw shadow-ctrl))) - (logior! (-> v1-110 settings flags) 32) + (logior! (-> v1-110 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -312,12 +312,13 @@ (set! (-> s5-0 attacker) (process->handle arg2)) (set! (-> s5-0 shove-back) arg0) (set! (-> s5-0 shove-up) arg1) - (set! (-> s5-0 angle) (if (zero? (logand (logior (-> self control status) (-> self control old-status)) 1)) - 'air - 'shove - ) + (set! (-> s5-0 angle) + (if (zero? (logand (logior (-> self control status) (-> self control old-status)) (cshape-moving-flags onsurf))) + 'air + 'shove + ) ) - (set! (-> s5-0 mask) (the-as uint 2248)) + (set! (-> s5-0 mask) (attack-mask attacker shove-back shove-up angle)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) (go arg3 'shove s5-0) ) @@ -336,16 +337,16 @@ ) ;; definition for function target-attacked -(defbehavior target-attacked target ((arg0 symbol) (arg1 attack-info) (arg2 process) (arg3 process) (arg4 (state handle attack-info target))) - (when (zero? (logand (-> self state-flags) 8)) +(defbehavior target-attacked target ((arg0 symbol) (arg1 attack-info) (arg2 process) (arg3 process) (arg4 (state symbol attack-info target))) + (when (zero? (logand (-> self state-flags) (state-flags being-attacked))) (cond - ((or (logtest? (-> self state-flags) 112) - (and (logtest? (-> arg1 mask) 32) + ((or (logtest? (-> self state-flags) (state-flags invulnerable timed-invulnerable invuln-powerup)) + (and (logtest? (-> arg1 mask) (attack-mask mode)) (= (-> arg1 mode) 'darkeco) (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) (>= (-> self fact-info-target eco-level) 1.0) ) - (logtest? #x100002 (-> self state-flags)) + (logtest? (state-flags dangerous flop-hit-ground) (-> self state-flags)) ) ) ) @@ -379,18 +380,18 @@ ) (when a1-2 (get-intersect-point (-> self attack-info-rec intersection) a1-2 (-> self control) arg3) - (logior! (-> self attack-info-rec mask) 4) + (logior! (-> self attack-info-rec mask) (attack-mask intersection)) ) ) ) (set! (-> self attack-info-rec prev-state) (-> self state)) - (logior! (-> self attack-info-rec mask) 8192) - (when (zero? (logand (-> self attack-info-rec mask) 8)) + (logior! (-> self attack-info-rec mask) (attack-mask atki13)) + (when (zero? (logand (-> self attack-info-rec mask) (attack-mask attacker))) (set! (-> self attack-info-rec attacker) (process->handle arg2)) - (logior! (-> self attack-info-rec mask) 8) + (logior! (-> self attack-info-rec mask) (attack-mask attacker)) ) (cond - ((and (logtest? (-> self attack-info-rec mask) 32) + ((and (logtest? (-> self attack-info-rec mask) (attack-mask mode)) (and (= (-> self attack-info-rec mode) 'damage) (not (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact-info-target health)))) ) @@ -401,44 +402,37 @@ (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) ) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker gp-1) self 'part-tracker (the-as pointer #x70004000)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1) + -1 + #f + #f + #f + (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection)) + (-> self attack-info-rec intersection) + (-> self control root-prim prim-core) ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 1) - -1 - #f - #f - #f - (if (logtest? (-> self attack-info-rec mask) 4) - (-> self attack-info-rec intersection) - (-> self control root-prim prim-core) - ) - ) - (-> gp-1 ppointer) - ) + :to self ) (target-timed-invulnerable - (if (logtest? (-> self attack-info-rec mask) 16) + (if (logtest? (-> self attack-info-rec mask) (attack-mask invinc-time)) (-> self attack-info-rec invinc-time) (-> *TARGET-bank* hit-invulnerable-timeout) ) self ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.5)) - (sound-play-by-name (static-sound-name "oof") (new-sound-id) 1024 0 0 1 #t) + (sound-play "oof") #t ) (else - (logior! (-> self state-flags) 8) + (logior! (-> self state-flags) (state-flags being-attacked)) (if (and (= (-> self game mode) 'play) (and (>= 1.0 (-> self fact-info-target health)) (= arg0 'attack))) - (logior! (-> self state-flags) #x8000) + (logior! (-> self state-flags) (state-flags dying)) ) - (go arg4 (the-as handle arg0) (-> self attack-info-rec)) + (go arg4 arg0 (-> self attack-info-rec)) ) ) ) @@ -774,8 +768,8 @@ ;; definition for function target-apply-tongue (defbehavior target-apply-tongue target ((arg0 vector)) - (when (zero? (logand (-> self state-flags) 8)) - (logior! (-> self state-flags) #x7000) + (when (zero? (logand (-> self state-flags) (state-flags being-attacked))) + (logior! (-> self state-flags) (state-flags prevent-attack prevent-duck remove-prevents)) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> self control trans)))) (set! (-> self control unknown-float41) (lerp-scale (-> *TARGET-bank* tongue-pull-speed-min) @@ -807,15 +801,15 @@ (the-as attack-info (-> arg3 param 1)) arg0 (the-as process (-> arg3 param 0)) - (the-as (state handle attack-info target) target-hit) + target-hit ) ) (('shove) (when (!= (-> self next-state name) 'target-hit) (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 104) - (when (zero? (logand (-> self attack-info-rec mask) 8)) + (when (zero? (logand (-> self attack-info-rec mask) (attack-mask attacker))) (set! (-> self attack-info-rec attacker) (process->handle arg0)) - (logior! (-> self attack-info-rec mask) 8) + (logior! (-> self attack-info-rec mask) (attack-mask attacker)) ) (go target-hit 'shove (-> self attack-info-rec)) ) @@ -833,15 +827,16 @@ ) ) (('loading) - (if (not - (or (and (logtest? (-> self control unknown-surface00 flags) 2048) (zero? (logand (-> self control status) 1))) - (or (logtest? (-> self water flags) 512) - (logtest? (-> self state-flags) #x830e) - (logtest? (-> self control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) - (>= (-> self no-load-wait) (-> *display* base-frame-counter)) - ) - ) - ) + (if (not (or (and (logtest? (-> self control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + ) + (or (logtest? (-> self water flags) (water-flags wt09)) + (logtest? (-> self state-flags) (state-flags dangerous sf02 being-attacked grabbed first-person-mode dying)) + (logtest? (-> self control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) + (>= (-> self no-load-wait) (-> *display* base-frame-counter)) + ) + ) + ) (go target-load-wait) ) ) @@ -869,12 +864,14 @@ (go target-snowball-start (process->handle (the-as process (-> arg3 param 1)))) ) (('tube) - (if (and (logtest? (-> self control status) 1) (zero? (logand (-> self water flags) 512))) + (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) + (zero? (logand (-> self water flags) (water-flags wt09))) + ) (go target-tube-start (process->handle (the-as process (-> arg3 param 1)))) ) ) (('periscope) - (if (logtest? (-> self control status) 1) + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-periscope (process->handle (the-as process (-> arg3 param 1)))) ) ) @@ -908,7 +905,7 @@ (if (not (or (= (-> self control unknown-surface00 mode) 'swim) (= (-> self control unknown-surface00 mode) 'dive) (= (-> self next-state name) 'target-hit) - (logtest? (-> self state-flags) 8) + (logtest? (-> self state-flags) (state-flags being-attacked)) ) ) (go target-swim-stance) @@ -958,7 +955,7 @@ (the-as attack-info (-> arg3 param 1)) arg0 (the-as process (-> arg3 param 0)) - (the-as (state handle attack-info target) target-hit) + target-hit ) ) (else @@ -1021,7 +1018,7 @@ (-> self control unknown-dword50) (-> self control unknown-dword51) ) - (zero? (logand (-> self state-flags) #x8008)) + (zero? (logand (-> self state-flags) (state-flags being-attacked dying))) ) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) (target-timed-invulnerable (seconds 0.1) self) @@ -1032,7 +1029,7 @@ #f ) ((= arg2 'jump) - (sound-play-by-name (static-sound-name "jump-long") (new-sound-id) 1024 0 0 1 #t) + (sound-play "jump-long") (go target-jump (the-as float (-> arg3 param 0)) @@ -1094,16 +1091,26 @@ target-standard-event-handler (set! (-> self control unknown-vector11 quad) (the-as uint128 0)) (set! (-> self control unknown-float41) 0.0) (set! (-> self control unknown-float81) 0.0) - (set! (-> self state-flags) (logand -1835917 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags + sf02 + being-attacked + do-not-notice + grabbed + first-person-mode + looking-at-enemy + falling-into-pool-of-bad + flop-hit-ground + ) + ) (target-danger-set! 'harmless #f) - (logior! (-> self water flags) 16) - (set! (-> self water flags) (logand -65537 (-> self water flags))) + (logior! (-> self water flags) (water-flags wt04)) + (logclear! (-> self water flags) (water-flags wt16)) (set! (-> self water drip-mult) 1.0) (set! (-> self neck flex-blend) 1.0) (set! (-> self control unknown-float91) 0.0) (logclear! (-> self draw status) (draw-status hidden)) (logclear! (-> self skel status) (janim-status spool)) - (set! (-> self control status) (logand -16385 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags csmf14)) 0 (none) ) diff --git a/test/decompiler/reference/engine/target/target-part_REF.gc b/test/decompiler/reference/engine/target/target-part_REF.gc index 676edd1a22..1c4631d9e7 100644 --- a/test/decompiler/reference/engine/target/target-part_REF.gc +++ b/test/decompiler/reference/engine/target/target-part_REF.gc @@ -43,7 +43,7 @@ (collide-kind background cak-1 cak-2 cak-3 water powerup crate enemy wall-object ground-object mother-spider) s5-0 s3-0 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -196,14 +196,12 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 56) (sp-item 57)) + :parts ((sp-item 56) (sp-item 57)) ) ;; failed to figure out what this is: (defpart 56 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -225,14 +223,12 @@ ;; failed to figure out what this is: (defpart 58 - :init-specs - ((sp-flt spt-fade-a -0.64)) + :init-specs ((sp-flt spt-fade-a -0.64)) ) ;; failed to figure out what this is: (defpart 57 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 12)) (sp-flt spt-rot-z (degrees 0.0)) @@ -254,14 +250,12 @@ :duration 10 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 59) (sp-item 60)) + :parts ((sp-item 59) (sp-item 60)) ) ;; failed to figure out what this is: (defpart 59 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 24.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -290,8 +284,7 @@ ;; failed to figure out what this is: (defpart 60 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) @@ -320,14 +313,12 @@ :duration 10 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 62) (sp-item 63) (sp-item 64)) + :parts ((sp-item 62) (sp-item 63) (sp-item 64)) ) ;; failed to figure out what this is: (defpart 62 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -354,14 +345,12 @@ ;; failed to figure out what this is: (defpart 61 - :init-specs - ((sp-flt spt-fade-r -0.7111111) (sp-flt spt-fade-g 0.7111111) (sp-flt spt-fade-b 0.35555556)) + :init-specs ((sp-flt spt-fade-r -0.7111111) (sp-flt spt-fade-g 0.7111111) (sp-flt spt-fade-b 0.35555556)) ) ;; failed to figure out what this is: (defpart 63 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.66) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -384,8 +373,7 @@ ;; failed to figure out what this is: (defpart 64 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -406,8 +394,7 @@ :duration 10 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 65) (sp-item 66)) + :parts ((sp-item 65) (sp-item 66)) ) ;; failed to figure out what this is: @@ -416,14 +403,12 @@ :duration 10 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 65) (sp-item 66)) + :parts ((sp-item 65) (sp-item 66)) ) ;; failed to figure out what this is: (defpart 65 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 0.75)) (sp-flt spt-scale-x (meters 3)) @@ -448,14 +433,12 @@ ;; failed to figure out what this is: (defpart 67 - :init-specs - ((sp-flt spt-fade-a -2.1333334)) + :init-specs ((sp-flt spt-fade-a -2.1333334)) ) ;; failed to figure out what this is: (defpart 66 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 3)) @@ -476,8 +459,7 @@ :duration 10 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 68) + :parts ((sp-item 68) (sp-item 69) (sp-item 72 :binding 71) (sp-item 71 :flags (start-dead launch-asap)) @@ -505,8 +487,7 @@ ;; failed to figure out what this is: (defpart 68 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-func spt-birth-func 'birth-func-copy-target-y-rot) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) @@ -532,8 +513,7 @@ ;; failed to figure out what this is: (defpart 69 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-func spt-birth-func 'birth-func-copy-target-y-rot) (sp-flt spt-num 8.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) @@ -559,8 +539,7 @@ ;; failed to figure out what this is: (defpart 72 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 12.0 8.0 1.0) (sp-flt spt-scale-x (meters 1)) (sp-copy-from-other spt-scale-y -4) @@ -575,8 +554,7 @@ ;; failed to figure out what this is: (defpart 71 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-rnd-flt spt-y (meters -1.3333334) (meters 2.6666667) 1.0) @@ -603,14 +581,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 73) (sp-item 74) (sp-item 75)) + :parts ((sp-item 73) (sp-item 74) (sp-item 75)) ) ;; failed to figure out what this is: (defpart 73 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -635,8 +611,7 @@ ;; failed to figure out what this is: (defpart 74 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -661,8 +636,7 @@ ;; failed to figure out what this is: (defpart 75 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -690,14 +664,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2371) (sp-item 2372) (sp-item 2370)) + :parts ((sp-item 2371) (sp-item 2372) (sp-item 2370)) ) ;; failed to figure out what this is: (defpart 2371 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -722,8 +694,7 @@ ;; failed to figure out what this is: (defpart 2372 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -748,8 +719,7 @@ ;; failed to figure out what this is: (defpart 2370 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -777,14 +747,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 76) (sp-item 77) (sp-item 78)) + :parts ((sp-item 76) (sp-item 77) (sp-item 78)) ) ;; failed to figure out what this is: (defpart 76 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -809,8 +777,7 @@ ;; failed to figure out what this is: (defpart 77 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -835,8 +802,7 @@ ;; failed to figure out what this is: (defpart 78 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -864,8 +830,7 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 76) (sp-item 77) (sp-item 78)) + :parts ((sp-item 76) (sp-item 77) (sp-item 78)) ) ;; failed to figure out what this is: @@ -874,14 +839,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 79) (sp-item 80) (sp-item 81)) + :parts ((sp-item 79) (sp-item 80) (sp-item 81)) ) ;; failed to figure out what this is: (defpart 79 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -906,8 +869,7 @@ ;; failed to figure out what this is: (defpart 80 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -932,8 +894,7 @@ ;; failed to figure out what this is: (defpart 81 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -962,14 +923,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 82) (sp-item 83)) + :parts ((sp-item 82) (sp-item 83)) ) ;; failed to figure out what this is: (defpart 82 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -994,8 +953,7 @@ ;; failed to figure out what this is: (defpart 83 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1024,8 +982,7 @@ :duration 5 :linger-duration 750 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 82) (sp-item 83) (sp-item 84) (sp-item 84)) + :parts ((sp-item 82) (sp-item 83) (sp-item 84) (sp-item 84)) ) ;; failed to figure out what this is: @@ -1034,14 +991,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 85) (sp-item 86)) + :parts ((sp-item 85) (sp-item 86)) ) ;; failed to figure out what this is: (defpart 85 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1066,8 +1021,7 @@ ;; failed to figure out what this is: (defpart 86 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1096,14 +1050,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2373) (sp-item 2374)) + :parts ((sp-item 2373) (sp-item 2374)) ) ;; failed to figure out what this is: (defpart 2373 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1126,8 +1078,7 @@ ;; failed to figure out what this is: (defpart 2374 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1156,8 +1107,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 87)) + :parts ((sp-item 87)) ) ;; failed to figure out what this is: @@ -1166,14 +1116,12 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 87)) + :parts ((sp-item 87)) ) ;; failed to figure out what this is: (defpart 87 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1197,8 +1145,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2375) (sp-item 2376 :flags (is-3d))) + :parts ((sp-item 2375) (sp-item 2376 :flags (is-3d))) ) ;; failed to figure out what this is: @@ -1207,8 +1154,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2375)) + :parts ((sp-item 2375)) ) ;; failed to figure out what this is: @@ -1217,14 +1163,12 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2376 :flags (is-3d))) + :parts ((sp-item 2376 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 2376 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) (sp-func spt-birth-func 'birth-func-target-orient) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.25)) @@ -1242,8 +1186,7 @@ ;; failed to figure out what this is: (defpart 2375 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1267,8 +1210,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2375)) + :parts ((sp-item 2375)) ) ;; failed to figure out what this is: @@ -1277,8 +1219,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2375)) + :parts ((sp-item 2375)) ) ;; failed to figure out what this is: @@ -1287,8 +1228,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 89) (sp-item 89) (sp-item 84)) + :parts ((sp-item 89) (sp-item 89) (sp-item 84)) ) ;; failed to figure out what this is: @@ -1297,14 +1237,12 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 88)) + :parts ((sp-item 88)) ) ;; failed to figure out what this is: (defpart 84 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-flt spt-y (meters -1)) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) @@ -1330,14 +1268,12 @@ ;; failed to figure out what this is: (defpart 90 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 150 149 1) (sp-launcher-by-id spt-next-launcher 91)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 150 149 1) (sp-launcher-by-id spt-next-launcher 91)) ) ;; failed to figure out what this is: (defpart 91 - :init-specs - ((sp-flt spt-fade-a -0.08)) + :init-specs ((sp-flt spt-fade-a -0.08)) ) ;; failed to figure out what this is: @@ -1346,8 +1282,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 89)) + :parts ((sp-item 89)) ) ;; failed to figure out what this is: @@ -1356,14 +1291,12 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 89)) + :parts ((sp-item 89)) ) ;; failed to figure out what this is: (defpart 89 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1387,8 +1320,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2377)) + :parts ((sp-item 2377)) ) ;; failed to figure out what this is: @@ -1397,14 +1329,12 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2377)) + :parts ((sp-item 2377)) ) ;; failed to figure out what this is: (defpart 2377 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1428,8 +1358,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 92) (sp-item 93 :flags (is-3d))) + :parts ((sp-item 92) (sp-item 93 :flags (is-3d))) ) ;; failed to figure out what this is: @@ -1438,8 +1367,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 92)) + :parts ((sp-item 92)) ) ;; failed to figure out what this is: @@ -1448,14 +1376,12 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 93 :flags (is-3d))) + :parts ((sp-item 93 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 92 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1475,8 +1401,7 @@ ;; failed to figure out what this is: (defpart 93 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) (sp-func spt-birth-func 'birth-func-target-orient) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.25)) @@ -1498,8 +1423,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 88) (sp-item 94 :flags (is-3d))) + :parts ((sp-item 88) (sp-item 94 :flags (is-3d))) ) ;; failed to figure out what this is: @@ -1508,8 +1432,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 88)) + :parts ((sp-item 88)) ) ;; failed to figure out what this is: @@ -1518,14 +1441,12 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 94 :flags (is-3d))) + :parts ((sp-item 94 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 88 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1545,8 +1466,7 @@ ;; failed to figure out what this is: (defpart 94 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) (sp-func spt-birth-func 'birth-func-target-orient) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.25)) @@ -1568,8 +1488,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2378)) + :parts ((sp-item 2378)) ) ;; failed to figure out what this is: @@ -1578,8 +1497,7 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2378)) + :parts ((sp-item 2378)) ) ;; failed to figure out what this is: @@ -1588,14 +1506,12 @@ :duration 5 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2379 :flags (is-3d))) + :parts ((sp-item 2379 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 2378 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1615,8 +1531,7 @@ ;; failed to figure out what this is: (defpart 2379 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xe :page #x2)) (sp-func spt-birth-func 'birth-func-target-orient) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.25)) @@ -1634,8 +1549,7 @@ ;; failed to figure out what this is: (defpart 95 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 6.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1658,8 +1572,7 @@ ;; failed to figure out what this is: (defpart 2253 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 6.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1682,8 +1595,7 @@ ;; failed to figure out what this is: (defpart 96 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 0.0 2.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1707,8 +1619,7 @@ ;; failed to figure out what this is: (defpart 2250 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 6.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1747,14 +1658,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 100) (sp-item 101)) + :parts ((sp-item 100) (sp-item 101)) ) ;; failed to figure out what this is: (defpart 100 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 6.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1779,8 +1688,7 @@ ;; failed to figure out what this is: (defpart 101 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1808,14 +1716,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2380) (sp-item 2381)) + :parts ((sp-item 2380) (sp-item 2381)) ) ;; failed to figure out what this is: (defpart 2380 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 6.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1840,8 +1746,7 @@ ;; failed to figure out what this is: (defpart 2381 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1869,14 +1774,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 102) (sp-item 103)) + :parts ((sp-item 102) (sp-item 103)) ) ;; failed to figure out what this is: (defpart 102 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 6.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1901,8 +1804,7 @@ ;; failed to figure out what this is: (defpart 103 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 0.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -1931,14 +1833,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 104)) + :parts ((sp-item 104)) ) ;; failed to figure out what this is: (defpart 104 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 6.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1967,14 +1867,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2382)) + :parts ((sp-item 2382)) ) ;; failed to figure out what this is: (defpart 2382 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 6.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -2003,14 +1901,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2383)) + :parts ((sp-item 2383)) ) ;; failed to figure out what this is: (defpart 2383 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 6.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -2039,8 +1935,7 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2383)) + :parts ((sp-item 2383)) ) ;; failed to figure out what this is: @@ -2049,14 +1944,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 105)) + :parts ((sp-item 105)) ) ;; failed to figure out what this is: (defpart 105 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 6.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -2085,14 +1978,12 @@ :duration 5 :linger-duration 750 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 105)) + :parts ((sp-item 105)) ) ;; failed to figure out what this is: (defpart 106 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -2112,8 +2003,7 @@ ;; failed to figure out what this is: (defpart 2265 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -2133,8 +2023,7 @@ ;; failed to figure out what this is: (defpart 2262 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -2154,8 +2043,7 @@ ;; failed to figure out what this is: (defpart 107 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 0.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -2180,8 +2068,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) + :parts ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) (sp-item 296 :flags (start-dead launch-asap) :binding 297) (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) (sp-item 296 :flags (start-dead launch-asap) :binding 297) @@ -2226,8 +2113,7 @@ :duration 75 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2003) (sp-item 2004) (sp-item 2005) (sp-item 2006)) + :parts ((sp-item 2003) (sp-item 2004) (sp-item 2005) (sp-item 2006)) ) ;; failed to figure out what this is: @@ -2236,14 +2122,12 @@ :duration 150 :linger-duration 600 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2003)) + :parts ((sp-item 2003)) ) ;; failed to figure out what this is: (defpart 2006 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -2264,8 +2148,7 @@ ;; failed to figure out what this is: (defpart 2003 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-x (meters 0) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 3) 1.0) @@ -2292,8 +2175,7 @@ ;; failed to figure out what this is: (defpart 2004 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters 0.5) (meters 2) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 0.5) 1.0) @@ -2320,8 +2202,7 @@ ;; failed to figure out what this is: (defpart 2005 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 3) 1.0) @@ -2353,14 +2234,12 @@ ;; failed to figure out what this is: (defpart 2007 - :init-specs - ((sp-flt spt-fade-a -0.08)) + :init-specs ((sp-flt spt-fade-a -0.08)) ) ;; failed to figure out what this is: (defpart 2002 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -2384,14 +2263,13 @@ ;; failed to figure out what this is: (defpart 2008 - :init-specs - ((sp-flt spt-fade-a -0.28444445)) + :init-specs ((sp-flt spt-fade-a -0.28444445)) ) ;; definition for function process-drawable-burn-effect ;; Used lq/sq (defbehavior process-drawable-burn-effect target ((arg0 time-frame)) - (sound-play-by-name (static-sound-name "get-burned") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-burned") (let ((s5-1 (new 'stack 'rgbaf)) (s3-0 (-> *display* base-frame-counter)) (s4-1 (-> self parent)) @@ -2444,8 +2322,7 @@ ;; failed to figure out what this is: (defpart 2391 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) (sp-func spt-birth-func 'birth-func-target-orient) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.02)) @@ -2469,8 +2346,7 @@ :id 611 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2474 :flags (launch-asap))) + :parts ((sp-item 2474 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -2478,8 +2354,7 @@ :id 612 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2475 :flags (launch-asap))) + :parts ((sp-item 2475 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -2487,14 +2362,12 @@ :id 613 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2476 :flags (launch-asap))) + :parts ((sp-item 2476 :flags (launch-asap))) ) ;; failed to figure out what this is: (defpart 2474 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3.5)) (sp-flt spt-scale-y (meters 13)) @@ -2510,8 +2383,7 @@ ;; failed to figure out what this is: (defpart 2475 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3.5)) (sp-flt spt-rot-z (degrees 180.0)) @@ -2528,8 +2400,7 @@ ;; failed to figure out what this is: (defpart 2476 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-copy-from-other spt-scale-y -4) diff --git a/test/decompiler/reference/engine/target/target-util_REF.gc b/test/decompiler/reference/engine/target/target-util_REF.gc index e487227bf4..085a75f5c1 100644 --- a/test/decompiler/reference/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/engine/target/target-util_REF.gc @@ -1,26 +1,23 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/eichar-ag.gc") + ;; failed to figure out what this is: -(defskelgroup *jchar-sg* eichar - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 3) - :longest-edge (meters 1) - :shadow 2 - :texture-level 2 - :sort 1 - ) +(defskelgroup *jchar-sg* eichar eichar-lod0-jg -1 + ((eichar-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3) + :longest-edge (meters 1) + :shadow eichar-shadow-mg + :texture-level 2 + :sort 1 + ) ;; definition for symbol *target-shadow-control*, type shadow-control -(define - *target-shadow-control* +(define *target-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #x2)) - :shadow-dir - (new 'static 'vector :x -0.4226 :y -0.9063 :w 409600.0) + :flags (shadow-flags disable-fade) + :shadow-dir (new 'static 'vector :x -0.4226 :y -0.9063 :w 409600.0) :bot-plane (new 'static 'plane :y 1.0 :w 37683.2) :top-plane (new 'static 'plane :y 1.0 :w 4096.0) ) @@ -265,8 +262,7 @@ :root-offset (new 'static 'vector :y 4915.2 :w 1.0) :body-radius (meters 0.7) :edge-radius (meters 0.35) - :edge-offset - (new 'static 'vector :y 4915.2 :z 4096.0 :w 1.0) + :edge-offset (new 'static 'vector :y 4915.2 :z 4096.0 :w 1.0) :head-radius (meters 0.7) :head-height (meters 1.4) :head-offset (new 'static 'vector :y 4915.2 :w 1.0) @@ -320,7 +316,7 @@ (-> *TARGET-bank* root-radius) ) (set! (-> self control unknown-symbol30) arg0) - (set! (-> self state-flags) (logand -3 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 transform-index) -2) (set! (-> s4-0 prim-core collide-as) (collide-kind)) (set! (-> s4-0 collide-with) (collide-kind)) @@ -347,7 +343,7 @@ (new 'static 'vector :y 6553.6 :w 1.0) 9830.4 ) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -364,7 +360,7 @@ (new 'static 'vector :y 6553.6 :w 1.0) 10649.6 ) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -382,7 +378,7 @@ (set! (-> s5-0 transform-index) 32) ) (('duck-slide) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -400,7 +396,7 @@ (set! (-> s5-0 transform-index) 28) ) (('wheel-solid) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -422,7 +418,7 @@ (set! (-> self control unknown-symbol30) 'roll) ) (('flip) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -449,7 +445,7 @@ (new 'static 'vector :y 6553.6 :w 1.0) 11878.4 ) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -472,7 +468,7 @@ (new 'static 'vector :y 6553.6 :w 1.0) 11878.4 ) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -499,7 +495,7 @@ ) ) (('flop) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -516,7 +512,7 @@ (set! (-> self control unknown-symbol30) 'flop) ) (('flop-down) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -549,7 +545,7 @@ (new 'static 'vector :y 6553.6 :w 1.0) 12288.0 ) - (logior! (-> self state-flags) 2) + (logior! (-> self state-flags) (state-flags dangerous)) (set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack)) (set! (-> s4-0 collide-with) (collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider) @@ -752,40 +748,42 @@ ;; definition for method 16 of type target ;; INFO: Return type mismatch control-info vs collide-shape. ;; Used lq/sq -(defmethod apply-alignment target ((obj target) (arg0 int) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment target ((obj target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> arg2 quad)) (set! (-> s2-0 z) (target-align-vel-z-adjust (-> s2-0 z))) - (when (logtest? arg0 7) + (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) (let* ((s3-0 (-> obj control unknown-matrix01)) (s0-0 (-> obj control unknown-matrix00)) (s1-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj control dynam gravity) s0-0)) (a1-3 (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj control transv) s0-0)) ) - (if (logtest? arg0 2048) + (if (logtest? arg0 (align-opts no-gravity)) (set-vector! s1-0 0.0 0.0 0.0 1.0) ) - (when (logtest? arg0 1) + (when (logtest? arg0 (align-opts adjust-x-vel)) (set! (-> a1-3 x) (+ (* (-> arg1 trans x) (-> s2-0 x) (-> *display* frames-per-second)) (* (-> s1-0 x) (-> *display* seconds-per-frame)) ) ) - (if (zero? (logand arg0 12)) + (if (zero? (logand arg0 (align-opts adjust-xz-vel keep-other-velocities))) (set! (-> a1-3 z) 0.0) ) ) - (if (and (logtest? arg0 2) (not (and (logtest? arg0 4096) (= (-> arg1 trans y) 0.0)))) + (if (and (logtest? arg0 (align-opts adjust-y-vel)) + (not (and (logtest? arg0 (align-opts ignore-y-if-zero)) (= (-> arg1 trans y) 0.0))) + ) (set! (-> a1-3 y) (+ (* (-> arg1 trans y) (-> s2-0 y) (-> *display* frames-per-second)) (* (-> s1-0 y) (-> *display* seconds-per-frame)) ) ) ) - (when (logtest? arg0 4) + (when (logtest? arg0 (align-opts adjust-xz-vel)) (set! (-> a1-3 z) (+ (* (-> arg1 trans z) (-> s2-0 z) (-> *display* frames-per-second)) (* (-> s1-0 z) (-> *display* seconds-per-frame)) ) ) - (if (zero? (logand arg0 9)) + (if (zero? (logand arg0 (align-opts adjust-x-vel keep-other-velocities))) (set! (-> a1-3 x) 0.0) ) ) @@ -793,7 +791,7 @@ ) ) ) - (if (logtest? arg0 16) + (if (logtest? arg0 (align-opts adjust-quat)) (quaternion-normalize! (quaternion*! (-> obj control unknown-quaternion00) (-> obj control unknown-quaternion00) (-> arg1 quat)) ) @@ -825,19 +823,21 @@ (not (-> *setting-control* current spooling)) (not (-> *setting-control* current movie)) (not (-> *setting-control* current hint)) - (zero? (logand (-> self control status) 32)) - (zero? (logand (-> self water flags) 512)) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + (zero? (logand (-> self water flags) (water-flags wt09))) ) ) ;; definition for function can-jump? (defbehavior can-jump? target ((arg0 symbol)) - (and (or (logtest? (-> self control status) 1) + (and (or (logtest? (-> self control status) (cshape-moving-flags onsurf)) (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) - (and (logtest? (-> self control status) 1) (< 0.866 (-> self control surface-angle))) + (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) + (< 0.866 (-> self control surface-angle)) + ) ) - (and (zero? (logand (-> self control unknown-surface01 flags) 64)) - (zero? (logand (-> self state-flags) 2048)) + (and (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-jump))) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) (case arg0 (('target-wheel-flip) (>= 0.5 (-> self control unknown-float61)) @@ -863,14 +863,10 @@ ;; definition for function fall-test ;; INFO: Return type mismatch object vs none. (defbehavior fall-test target () - (when (and (zero? (logand (-> self control status) 1)) + (when (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-15 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-15 (ja-group))) (or (not (or (= v1-15 (-> self draw art-group data 59)) (= v1-15 (-> self draw art-group data 60)) (= v1-15 (-> self draw art-group data 61)) @@ -881,7 +877,7 @@ ) ) (when (and (< (- (-> *display* base-frame-counter) (-> self control rider-time)) (-> *TARGET-bank* ground-timeout)) - (logtest? (-> self control unknown-surface01 flags) #x4000) + (logtest? (-> self control unknown-surface01 flags) (surface-flags moving-ground)) ) (+! (-> self control transv x) (-> self control rider-last-move x)) (+! (-> self control transv z) (-> self control rider-last-move z)) @@ -894,9 +890,9 @@ ;; definition for function slide-down-test ;; INFO: Return type mismatch object vs none. (defbehavior slide-down-test target () - (if (and (zero? (logand (-> self control status) 129)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf csmf07))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) - (logtest? (-> self control status) 4) + (logtest? (-> self control status) (cshape-moving-flags tsurf)) (< 0.5 (-> self control surface-angle)) ) (go target-slide-down) @@ -906,28 +902,33 @@ ;; definition for function smack-surface? (defbehavior smack-surface? target ((arg0 symbol)) - (and (< 0.7 (-> self control touch-angle)) (and (< (-> self control surface-angle) 0.3) - (logtest? (-> self control status) 8) - (or arg0 (zero? (logand (-> self control status) 32))) - ) + (and (< 0.7 (-> self control touch-angle)) + (and (< (-> self control surface-angle) 0.3) + (logtest? (-> self control status) (cshape-moving-flags twall)) + (or arg0 (zero? (logand (-> self control status) (cshape-moving-flags t-act)))) + ) ) ) ;; definition for function can-wheel? (defbehavior can-wheel? target () - (and (logtest? (-> self control status) 1) - (or (zero? (logand (-> self control status) 8)) (>= 0.7 (-> self control touch-angle))) - (and (< (-> self control unknown-float61) 0.7) (zero? (logand (-> self state-flags) 8192))) + (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) + (or (zero? (logand (-> self control status) (cshape-moving-flags twall))) + (>= 0.7 (-> self control touch-angle)) + ) + (and (< (-> self control unknown-float61) 0.7) + (zero? (logand (-> self state-flags) (state-flags prevent-duck))) + ) ) ) ;; definition for function can-duck? (defbehavior can-duck? target () - (and (logtest? (-> self control status) 1) + (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (>= (-> self control unknown-float60) 0.7) - (zero? (logand (-> self water flags) 6144)) - (zero? (logand (-> self state-flags) 8192)) - (or (zero? (logand (-> self water flags) 1024)) + (zero? (logand (-> self water flags) (water-flags wt11 wt12))) + (zero? (logand (-> self state-flags) (state-flags prevent-duck))) + (or (zero? (logand (-> self water flags) (water-flags wt10))) (< (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) ) ) @@ -952,7 +953,7 @@ (set! (-> gp-0 num-spheres) (the-as uint 2)) (set! (-> gp-0 collide-with) (-> self control root-prim collide-with)) (set! (-> gp-0 proc) #f) - (set! (-> gp-0 ignore-pat) (the-as uint 1)) + (set! (-> gp-0 ignore-pat) (new 'static 'pat-surface :noentity #x1)) (set! (-> gp-0 solid-only) #t) (if (fill-and-probe-using-spheres *collide-cache* gp-0) #f @@ -968,15 +969,15 @@ (pad-buttons square) ) ) - (or (and (logtest? (-> self state-flags) 4096) - (or (zero? (logand (-> self state-flags) #x4000)) + (or (and (logtest? (-> self state-flags) (state-flags prevent-attack)) + (or (zero? (logand (-> self state-flags) (state-flags remove-prevents))) (not (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) (>= (-> self fact-info-target eco-level) 1.0) ) ) ) ) - (logtest? (-> self control unknown-surface01 flags) 384) + (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) ) #f @@ -1009,7 +1010,9 @@ ;; definition for function can-feet? (defbehavior can-feet? target () (cond - ((or (logtest? (-> self state-flags) 4096) (logtest? (-> self control unknown-surface01 flags) 640)) + ((or (logtest? (-> self state-flags) (state-flags prevent-attack)) + (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf09)) + ) #f ) ((>= (- (-> *display* base-frame-counter) (-> *TARGET-bank* attack-timeout)) (-> self control unknown-dword33)) @@ -1097,7 +1100,7 @@ ;; definition for function target-timed-invulnerable ;; INFO: Return type mismatch int vs none. (defun target-timed-invulnerable ((arg0 time-frame) (arg1 target)) - (logior! (-> arg1 state-flags) 32) + (logior! (-> arg1 state-flags) (state-flags timed-invulnerable)) (set! (-> arg1 control unknown-dword80) (-> *display* base-frame-counter)) (set! (-> arg1 control unknown-dword81) arg0) (set-collide-kinds (-> arg1 control) 2 (collide-kind target-attack) (collide-kind)) @@ -1109,7 +1112,7 @@ ;; INFO: Return type mismatch int vs none. (defun target-timed-invulnerable-off ((arg0 target)) (logclear! (-> arg0 draw status) (draw-status hidden)) - (set! (-> arg0 state-flags) (logand -33 (-> arg0 state-flags))) + (logclear! (-> arg0 state-flags) (state-flags timed-invulnerable)) (set-collide-kinds (-> arg0 control) 2 (collide-kind) (collide-kind target-attack)) 0 (none) @@ -1122,41 +1125,41 @@ (with-pp (let ((s4-0 (-> arg0 mask))) (set! (-> obj mask) (-> arg0 mask)) - (if (logtest? s4-0 8) + (if (logtest? s4-0 (attack-mask attacker)) (set! (-> obj attacker) (-> arg0 attacker)) ) - (if (logtest? s4-0 32) + (if (logtest? s4-0 (attack-mask mode)) (set! (-> obj mode) (-> arg0 mode)) ) - (if (logtest? s4-0 2048) + (if (logtest? s4-0 (attack-mask angle)) (set! (-> obj angle) (-> arg0 angle)) ) - (if (logtest? s4-0 512) + (if (logtest? s4-0 (attack-mask dist)) (set! (-> obj dist) (-> arg0 dist)) ) - (if (logtest? s4-0 1024) + (if (logtest? s4-0 (attack-mask control)) (set! (-> obj control) (-> arg0 control)) ) - (if (logtest? s4-0 256) + (if (logtest? s4-0 (attack-mask speed)) (set! (-> obj speed) (-> arg0 speed)) ) - (if (logtest? s4-0 64) + (if (logtest? s4-0 (attack-mask shove-back)) (set! (-> obj shove-back) (-> arg0 shove-back)) ) - (if (logtest? s4-0 128) + (if (logtest? s4-0 (attack-mask shove-up)) (set! (-> obj shove-up) (-> arg0 shove-up)) ) - (if (logtest? s4-0 16) + (if (logtest? s4-0 (attack-mask invinc-time)) (set! (-> obj invinc-time) (-> arg0 invinc-time)) ) - (if (logtest? s4-0 4096) + (if (logtest? s4-0 (attack-mask rotate-to)) (set! (-> obj rotate-to) (-> arg0 rotate-to)) ) - (if (logtest? s4-0 4) + (if (logtest? s4-0 (attack-mask intersection)) (set! (-> obj intersection quad) (-> arg0 intersection quad)) ) (cond - ((zero? (logand s4-0 2)) + ((zero? (logand s4-0 (attack-mask vector))) (let* ((s3-0 pp) (s2-0 (handle->process (-> obj attacker))) (v1-39 (if (and (nonzero? s2-0) (type-type? (-> s2-0 type) process-drawable)) @@ -1171,7 +1174,7 @@ (-> (the-as process-drawable s3-0) root trans) (-> (the-as process-drawable v1-39) root trans) ) - (logior! (-> obj mask) 2) + (logior! (-> obj mask) (attack-mask vector)) ) ) ) @@ -1187,18 +1190,18 @@ ) ) (set! (-> obj vector quad) (-> arg0 vector quad)) - (if (zero? (logand s4-0 64)) + (if (zero? (logand s4-0 (attack-mask shove-back))) (set! (-> obj shove-back) (vector-xz-length (-> obj vector))) ) - (if (zero? (logand s4-0 128)) + (if (zero? (logand s4-0 (attack-mask shove-up))) (set! (-> obj shove-up) (-> obj vector y)) ) ) ) - (if (zero? (logand (-> obj mask) 512)) + (if (zero? (logand (-> obj mask) (attack-mask dist))) (set! (-> obj dist) (fabs (-> obj shove-back))) ) - (if (logtest? s4-0 1) + (if (logtest? s4-0 (attack-mask trans)) (set! (-> obj trans quad) (-> arg0 trans quad)) ) ) @@ -1215,11 +1218,7 @@ (set! (-> arg0 group 4) arg6) (dotimes (s3-0 3) (set! (-> arg0 chan s3-0) (+ arg1 s3-0)) - (let ((s2-0 (-> self skel root-channel (-> arg0 chan s3-0)))) - (set! (-> s2-0 frame-interp) (fabs (-> arg0 blend s3-0))) - (joint-control-channel-group-eval! s2-0 (the-as art-joint-anim arg2) num-func-identity) - (set! (-> s2-0 frame-num) 0.0) - ) + (ja :chan (-> arg0 chan s3-0) :group! arg2 :num! min :frame-interp (fabs (-> arg0 blend s3-0))) ) arg0 ) @@ -1237,34 +1236,14 @@ (set! (-> arg0 blend 2) (seek (the-as float (-> arg0 blend 2)) f30-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-7))))) ) ) - (cond - ((>= (-> arg0 blend 1) 0.0) - (let ((v1-4 (-> self skel root-channel (-> arg0 chan 1)))) - (set! (-> v1-4 frame-interp) (fabs (-> arg0 blend 1))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> arg0 group 1))) - ) - ) - (else - (let ((v1-7 (-> self skel root-channel (-> arg0 chan 1)))) - (set! (-> v1-7 frame-interp) (fabs (-> arg0 blend 1))) - (set! (-> v1-7 frame-group) (the-as art-joint-anim (-> arg0 group 2))) - ) + (if (>= (-> arg0 blend 1) 0.0) + (ja :chan (-> arg0 chan 1) :group! (-> arg0 group 1) :frame-interp (fabs (-> arg0 blend 1))) + (ja :chan (-> arg0 chan 1) :group! (-> arg0 group 2) :frame-interp (fabs (-> arg0 blend 1))) ) - ) - (cond - ((>= (-> arg0 blend 2) 0.0) - (let ((v1-10 (-> self skel root-channel (-> arg0 chan 2)))) - (set! (-> v1-10 frame-interp) (fabs (-> arg0 blend 2))) - (set! (-> v1-10 frame-group) (the-as art-joint-anim (-> arg0 group 4))) - ) - ) - (else - (let ((v1-13 (-> self skel root-channel (-> arg0 chan 2)))) - (set! (-> v1-13 frame-interp) (fabs (-> arg0 blend 2))) - (set! (-> v1-13 frame-group) (the-as art-joint-anim (-> arg0 group 3))) - ) + (if (>= (-> arg0 blend 2) 0.0) + (ja :chan (-> arg0 chan 2) :group! (-> arg0 group 4) :frame-interp (fabs (-> arg0 blend 2))) + (ja :chan (-> arg0 chan 2) :group! (-> arg0 group 3) :frame-interp (fabs (-> arg0 blend 2))) ) - ) 0 (none) ) @@ -1297,33 +1276,33 @@ ((not gp-0) (camera-pos) ) - ((logtest? (-> gp-0 state-flags) 1024) + ((logtest? (-> gp-0 state-flags) (state-flags use-alt-cam-pos)) (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 alt-cam-pos) 819.2 (new 'static 'rgba :r #xff :a #x80) ) (-> gp-0 alt-cam-pos) ) - ((logtest? #x20000 (-> gp-0 state-flags)) + ((logtest? (state-flags has-saved-position) (-> gp-0 state-flags)) (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 alt-cam-pos) 819.2 (new 'static 'rgba :r #xff :a #x80) ) (-> gp-0 alt-cam-pos) ) - ((logtest? #x80000 (-> gp-0 state-flags)) + ((logtest? (state-flags falling-into-pool-of-bad) (-> gp-0 state-flags)) (let ((s5-0 (the-as object (new 'static 'vector)))) (set! (-> (the-as vector s5-0) quad) (-> (&-> (-> gp-0 control) unknown-qword00) 0)) (set! (-> (the-as vector s5-0) y) (fmax (-> (the-as vector s5-0) y) (-> gp-0 alt-cam-pos y))) (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector s5-0) 819.2 (new 'static 'rgba :r #xff :a #x80) @@ -1334,7 +1313,7 @@ (else (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (&-> (-> gp-0 control) unknown-qword00)) 819.2 (new 'static 'rgba :r #xff :a #x80) diff --git a/test/decompiler/reference/engine/target/target2_REF.gc b/test/decompiler/reference/engine/target/target2_REF.gc index 8340ab6c21..ee59a37837 100644 --- a/test/decompiler/reference/engine/target/target2_REF.gc +++ b/test/decompiler/reference/engine/target/target2_REF.gc @@ -3,8 +3,7 @@ ;; failed to figure out what this is: (defstate target-load-wait (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('loading) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -15,92 +14,48 @@ ) ) ) - :exit - target-exit - :code - (behavior () + :exit target-exit + :code (behavior () (set! (-> self control unknown-surface00) *walk-no-turn-mods*) (set! (-> self state-time) (-> *display* base-frame-counter)) (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) - (ja-channel-push! 1 30) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 112))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 112)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 112)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! eichar-trip-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) - (send-event *camera* 'joystick (-> (new 'static 'array int32 1 0) 0) (-> (new 'static 'array int32 1 0) 0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-xz-vel) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (send-event *camera* 'joystick 0.0 0.0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-0 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.3)) (suspend) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 param 0) (ja-aframe (the-as float 19.0) 0)) - (set! (-> s5-0 param 1) 0.05) - (joint-control-channel-group-eval! s5-0 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 19.0) 0) 0.05)) (suspend) ) ) - (ja-channel-push! 1 90) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 36))) - (set! (-> gp-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 36)) data 0 length) -1)) - ) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) (ja-aframe (the-as float 40.0) 0)) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 36)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! eichar-painful-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 40.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 37))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 37)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 37)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! eichar-painful-land-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (go target-stance) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-stance-ambient (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('movie) (go target-stance) @@ -110,8 +65,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self neck flex-blend) 0.0) ((-> target-stance enter)) (let ((v1-2 (rand-vu-int-count 4))) @@ -141,28 +95,19 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-0 (-> self control unknown-spoolanim00))) (when a0-0 (ja-abort-spooled-anim a0-0 (the-as art-joint-anim #f) -1) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! eichar-stance-loop-ja :num! min) ) ) ((-> target-stance exit)) (target-exit) (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* (-> self control unknown-spoolanim00 name) 0 self (the-as float -99.0)) (if (or (cpad-hold? (-> self control unknown-cpad-info00 number) start l1 r1 triangle circle x square) *progress-process* @@ -171,37 +116,26 @@ ) (none) ) - :code - (behavior () + :code (behavior () (while (let ((v1-13 (file-status *art-control* (-> self control unknown-spoolanim00 name) 0))) (not (or (= v1-13 'locked) (= v1-13 'active))) ) (suspend) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((a0-1 (-> self skel root-channel 1))) - (set! (-> a0-1 param 0) 0.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-2 (-> self skel root-channel 2))) - (set! (-> a0-2 param 0) 0.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (loop!)) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) ) (ja-play-spooled-anim (-> self control unknown-spoolanim00) - (the-as art-joint-anim (-> self draw art-group data 5)) - (the-as art-joint-anim (-> self draw art-group data 5)) + (the-as art-joint-anim eichar-stance-loop-ja) + (the-as art-joint-anim eichar-stance-loop-ja) (the-as (function process-drawable symbol) (lambda () (!= (-> *cpad-list* cpads 0 stick0-speed) 0.0))) ) (set! (-> self control unknown-uint20) (the-as uint #f)) (go target-stance) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; definition of type first-person-hud @@ -359,28 +293,25 @@ ;; failed to figure out what this is: (defstate hud-waiting (first-person-hud) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('go-away) (go hud-going-out) ) ) ) - :enter - (behavior () + :enter (behavior () (disable-hud (the-as int (-> *hud-parts* power))) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (dotimes (gp-0 (-> self nb-of-particles)) (if (= (-> self particles gp-0 part matrix) -1) (set! (-> self particles gp-0 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set-setting! *setting-control* self 'common-page 'set (the-as float (-> (new 'static 'array int32 1 0) 0)) 1) + (set-setting! 'common-page 'set 0.0 1) (suspend) (go hud-coming-in) (suspend) @@ -391,14 +322,10 @@ ;; failed to figure out what this is: (defstate hud-coming-in (first-person-hud) - :event - (-> hud-waiting event) - :code - (behavior () - (while #t - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 0 (the int (* 350.0 (-> *display* time-adjust-ratio)))) - ) + :event (-> hud-waiting event) + :code (behavior () + (loop + (seekl! (-> self in-out-position) 0 (the int (* 350.0 (-> *display* time-adjust-ratio)))) (if (zero? (-> self in-out-position)) (go hud-normal) ) @@ -406,8 +333,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (dumb-15 self) (none) ) @@ -415,21 +341,15 @@ ;; failed to figure out what this is: (defstate hud-normal (first-person-hud) - :event - (-> hud-waiting event) - :code - (behavior () - (while #t + :event (-> hud-waiting event) + :code (behavior () + (loop (if (or (not *progress-process*) (= (-> *progress-process* 0 next-state name) 'progress-going-out) (= (-> *progress-process* 0 next-state name) 'progress-gone) ) - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 0 (the int (* 150.0 (-> *display* time-adjust-ratio)))) - ) - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 4096 (the int (* 200.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self in-out-position) 0 (the int (* 150.0 (-> *display* time-adjust-ratio)))) + (seekl! (-> self in-out-position) 4096 (the int (* 200.0 (-> *display* time-adjust-ratio)))) ) (suspend) ) @@ -439,12 +359,9 @@ ;; failed to figure out what this is: (defstate hud-going-out (first-person-hud) - :code - (behavior () - (while #t - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 4096 (the int (* 350.0 (-> *display* time-adjust-ratio)))) - ) + :code (behavior () + (loop + (seekl! (-> self in-out-position) 4096 (the int (* 350.0 (-> *display* time-adjust-ratio)))) (if (= (-> self in-out-position) 4096) (deactivate self) ) @@ -452,8 +369,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (dumb-15 self) (none) ) @@ -535,22 +451,17 @@ ;; failed to figure out what this is: (defstate target-stance-look-around (target) - :event - target-standard-event-handler - :enter - (-> target-stance enter) - :exit - (-> target-stance exit) - :trans - (-> target-stance trans) - :code - (behavior () + :event target-standard-event-handler + :enter (-> target-stance enter) + :exit (-> target-stance exit) + :trans (-> target-stance trans) + :code (behavior () (while (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'dist-from-interp-src) (and (< (send-event-function *camera* a1-0) 4915.2) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (the-as time-frame 21)) + (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.07)) (zero? (ja-group-size)) ) ) @@ -563,14 +474,12 @@ ((the-as (function none :behavior target) (-> target-stance code))) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-look-around (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) (-> self state name) @@ -588,11 +497,10 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self cam-user-mode) 'look-around) (set! (-> self control unknown-surface00) *duck-mods*) - (logior! (-> self state-flags) 512) + (logior! (-> self state-flags) (state-flags first-person-mode)) (send-event *camera* 'blend-from-as-fixed) (send-event *camera* 'no-intro) (camera-change-to (the-as string 'cam-eye) 60 #f) @@ -601,23 +509,12 @@ (deactivate a0-5) ) ) - (let ((gp-0 (get-process *default-dead-pool* first-person-hud #x4000))) - (set! (-> self fp-hud) - (ppointer->handle - (when gp-0 - (let ((t9-5 (method-of-type first-person-hud activate))) - (t9-5 (the-as first-person-hud gp-0) *dproc* 'first-person-hud (&+ *fp-hud-stack* #x3800)) - ) - (run-now-in-process gp-0 first-person-hud-init-by-other) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self fp-hud) + (ppointer->handle (process-spawn first-person-hud :to *dproc* :stack (&+ *fp-hud-stack* #x3800))) + ) (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self fp-hud)))) (if a0-1 (send-event a0-1 'go-away) @@ -625,22 +522,15 @@ ) (set! (-> self cam-user-mode) 'normal) (target-exit) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 1) - (set! (-> a1-2 message) 'query-state) - (set! (-> a1-2 param 0) (the-as uint cam-eye)) - (when (send-event-function *camera* a1-2) - (send-event *camera* 'no-intro) - (send-event *camera* 'force-blend 60) - (send-event *camera* 'clear-entity) - (camera-change-to (the-as string 'base) 60 #f) - ) + (when (send-event *camera* 'query-state cam-eye) + (send-event *camera* 'no-intro) + (send-event *camera* 'force-blend (seconds 0.2)) + (send-event *camera* 'clear-entity) + (camera-change-to (the-as string 'base) 60 #f) ) (none) ) - :trans - (behavior () + :trans (behavior () (local-vars (sv-48 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -726,15 +616,9 @@ (none) ) ) - :code - (behavior () - (while (let ((f30-0 8192.0) - (a1-0 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 0) - (set! (-> a1-0 message) 'dist-from-interp-dest) - (< f30-0 (send-event-function *camera* a1-0)) + :code (behavior () + (while (let ((f30-0 8192.0)) + (< f30-0 (send-event *camera* 'dist-from-interp-dest)) ) (if (!= (-> self cam-user-mode) 'look-around) (go target-stance) @@ -743,7 +627,7 @@ ) (ja-channel-set! 0) (set! (-> self control transv quad) (the-as uint128 0)) - (while #t + (loop (if (!= (-> self cam-user-mode) 'look-around) (go target-stance-look-around) ) @@ -751,14 +635,12 @@ ) (none) ) - :post - target-no-move-post + :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-billy-game (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) (-> self state name) @@ -773,11 +655,10 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self neck flex-blend) 0.0) (set! (-> self control unknown-surface00) *duck-mods*) - (logior! (-> self state-flags) 512) + (logior! (-> self state-flags) (state-flags first-person-mode)) (send-event *camera* 'blend-from-as-fixed) (send-event *camera* 'clear-entity) (send-event *camera* 'no-intro) @@ -787,44 +668,26 @@ (deactivate a0-6) ) ) - (let ((gp-0 (get-process *default-dead-pool* first-person-hud #x4000))) - (set! (-> self fp-hud) - (ppointer->handle - (when gp-0 - (let ((t9-6 (method-of-type first-person-hud activate))) - (t9-6 (the-as first-person-hud gp-0) *dproc* 'first-person-hud (&+ *fp-hud-stack* #x3800)) - ) - (run-now-in-process gp-0 first-person-hud-init-by-other) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self fp-hud) + (ppointer->handle (process-spawn first-person-hud :to *dproc* :stack (&+ *fp-hud-stack* #x3800))) + ) (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self fp-hud)))) (if a0-1 (send-event a0-1 'go-away) ) ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 1) - (set! (-> a1-2 message) 'query-state) - (set! (-> a1-2 param 0) (the-as uint cam-billy)) - (when (send-event-function *camera* a1-2) - (send-event *camera* 'no-intro) - (send-event *camera* 'force-blend 0) - (camera-change-to (the-as string 'base) 0 #f) - ) + (when (send-event *camera* 'query-state cam-billy) + (send-event *camera* 'no-intro) + (send-event *camera* 'force-blend 0) + (camera-change-to (the-as string 'base) 0 #f) ) (target-exit) (none) ) - :trans - (behavior () + :trans (behavior () (local-vars (sv-48 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -899,21 +762,18 @@ (none) ) ) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (set! (-> self control transv quad) (the-as uint128 0)) (anim-loop) (none) ) - :post - target-no-move-post + :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-grab (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) (-> self state name) @@ -950,39 +810,32 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self control unknown-surface00) *grab-mods*) (set! (-> self neck flex-blend) 0.0) - (logior! (-> self state-flags) 272) + (logior! (-> self state-flags) (state-flags invulnerable grabbed)) (set! (-> self control unknown-uint20) (the-as uint 'stance)) (none) ) - :exit - (behavior () - (set! (-> self state-flags) (logand -17 (-> self state-flags))) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags invulnerable)) (target-exit) (none) ) - :code - (behavior () - (set-forward-vel (the-as float (-> (new 'static 'array int32 1 0) 0))) + :code (behavior () + (set-forward-vel (the-as float 0.0)) (let ((gp-0 0)) - (while (zero? (logand (-> self control status) 1)) + (while (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (target-falling-anim-trans) (+! gp-0 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) (suspend) ) - (if (or (> gp-0 0) (let ((v1-11 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-11 (-> self draw art-group data 34)) - (= v1-11 (-> self draw art-group data 38)) - (= v1-11 (-> self draw art-group data 42)) - (= v1-11 (-> self draw art-group data 43)) - (= v1-11 (-> self draw art-group data 41)) + (if (or (> gp-0 0) (let ((v1-11 (ja-group))) + (or (= v1-11 eichar-jump-ja) + (= v1-11 eichar-jump-loop-ja) + (= v1-11 eichar-launch-jump-ja) + (= v1-11 eichar-launch-jump-loop-ja) + (= v1-11 eichar-duck-high-jump-ja) ) ) ) @@ -990,142 +843,69 @@ ) ) (-> self control unknown-spoolanim00) - (while #t + (loop (let ((gp-1 (-> self control unknown-spoolanim00))) (case gp-1 (('stance) (cond - ((or (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) - (< 0.5 (-> self skel root-channel 6 frame-interp)) - ) - (let ((v1-32 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-32 (-> self draw art-group data 28)) - (= v1-32 (-> self draw art-group data 29)) - (= v1-32 (-> self draw art-group data 54)) - (= v1-32 (-> self draw art-group data 55)) + ((or (and (ja-group? eichar-walk-ja) (< 0.5 (-> self skel root-channel 6 frame-interp))) + (let ((v1-32 (ja-group))) + (or (= v1-32 eichar-run-squash-ja) + (= v1-32 eichar-run-squash-weak-ja) + (= v1-32 eichar-attack-from-stance-run-end-ja) + (= v1-32 eichar-attack-from-stance-run-alt-end-ja) ) ) ) - (ja-channel-push! 1 45) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-39 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-39 param 1) 1.0) - (set! (-> a0-39 frame-num) 0.0) - (joint-control-channel-group! a0-39 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! eichar-run-to-stance-loop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) (the float (+ (-> a0-40 frame-group data 0 length) -1))) - (set! (-> a0-40 param 1) 1.0) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-42 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-42 param 1) 1.0) - (set! (-> a0-42 frame-num) 0.0) - (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! eichar-run-to-stance-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) (the float (+ (-> a0-43 frame-group data 0 length) -1))) - (set! (-> a0-43 param 1) 1.0) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) ) - ((let ((v1-87 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (and (or (= v1-87 (-> self draw art-group data 39)) (= v1-87 (-> self draw art-group data 35))) - (not (ja-max? 0)) - ) - ) - (let ((a0-54 (-> self skel root-channel 0))) - (set! (-> a0-54 param 0) (the float (+ (-> a0-54 frame-group data 0 length) -1))) - (set! (-> a0-54 param 1) 1.0) - (joint-control-channel-group! a0-54 (the-as art-joint-anim #f) num-func-seek!) + ((let ((v1-87 (ja-group))) + (and (or (= v1-87 eichar-jump-short-land-ja) (= v1-87 eichar-jump-land-ja)) (not (ja-max? 0))) ) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) ) - ((not (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (= (ja-group-size) 1) - ) - ) - (ja-channel-push! 1 22) + ((not (and (ja-group? eichar-stance-loop-ja) (= (ja-group-size) 1))) + (ja-channel-push! 1 (seconds 0.075)) ) ) - (while #t - (let ((a0-63 (-> self skel root-channel 0))) - (set! (-> a0-63 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-63 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-63 param 1) 1.0) - (set! (-> a0-63 frame-num) 0.0) - (joint-control-channel-group! a0-63 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (loop + (ja-no-eval :group! eichar-stance-loop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94) ) (suspend) - (let ((a0-64 (-> self skel root-channel 0))) - (set! (-> a0-64 param 0) (the float (+ (-> a0-64 frame-group data 0 length) -1))) - (set! (-> a0-64 param 1) 1.0) - (joint-control-channel-group-eval! a0-64 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (('shock-in) - (ja-channel-push! 1 60) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 88))) - (set! (-> s5-0 param 0) (ja-aframe (the-as float 18.0) 0)) - (set! (-> s5-0 param 1) 1.0) - (set! (-> s5-0 frame-num) 0.0) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 88)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! eichar-shocked-ja :num! (seek! (ja-aframe (the-as float 18.0) 0)) :frame-num 0.0) (until (ja-done? 0) (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94) ) (suspend) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 param 0) (ja-aframe (the-as float 18.0) 0)) - (set! (-> s5-1 param 1) 1.0) - (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 18.0) 0))) ) - (while #t + (loop (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94) ) @@ -1133,33 +913,16 @@ ) ) (('shock-out) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 88) - ) - ) - (ja-channel-push! 1 60) + (if (not (ja-group? eichar-shocked-ja)) + (ja-channel-push! 1 (seconds 0.2)) ) - (let ((s5-2 (-> self skel root-channel 0))) - (set! (-> s5-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 88))) - (set! (-> s5-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 88)) data 0 length) -1)) - ) - (set! (-> s5-2 param 1) 1.0) - (set! (-> s5-2 frame-num) (ja-aframe (the-as float 18.0) 0)) - (joint-control-channel-group! s5-2 (the-as art-joint-anim (-> self draw art-group data 88)) num-func-seek!) - ) + (ja-no-eval :group! eichar-shocked-ja :num! (seek!) :frame-num (ja-aframe (the-as float 18.0) 0)) (until (ja-done? 0) (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94) ) (suspend) - (let ((a0-82 (-> self skel root-channel 0))) - (set! (-> a0-82 param 0) (the float (+ (-> a0-82 frame-group data 0 length) -1))) - (set! (-> a0-82 param 1) 1.0) - (joint-control-channel-group-eval! a0-82 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self control unknown-uint20) (the-as uint 'stance)) ) @@ -1169,9 +932,8 @@ ) (none) ) - :post - (behavior () - (if (logtest? (-> self control status) 1) + :post (behavior () + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (set! (-> self control transv quad) (the-as uint128 0)) ) (target-no-stick-post) @@ -1181,35 +943,31 @@ ;; failed to figure out what this is: (defstate target-pole-cycle (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (= arg2 'query) (= (-> arg3 param 0) 'mode)) (-> self state name) (target-standard-event-handler arg0 arg1 arg2 arg3) ) ) - :enter - (behavior ((arg0 handle)) + :enter (behavior ((arg0 handle)) (set! (-> self control unknown-handle10) arg0) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *pole-mods*) (logior! (-> self control root-prim prim-core action) (collide-action ca-8)) - (target-collide-set! 'pole (the-as float (-> (new 'static 'array int32 1 0) 0))) + (target-collide-set! 'pole (the-as float 0.0)) (set! (-> self control unknown-vector102 quad) (-> self control transv quad)) (set! (-> self control transv quad) (the-as uint128 0)) (send-event *camera* 'ease-in) (set! (-> self control unknown-int21) (the-as int #f)) (none) ) - :exit - (behavior () - (target-collide-set! 'normal (the-as float (-> (new 'static 'array int32 1 0) 0))) + :exit (behavior () + (target-collide-set! 'normal (the-as float 0.0)) (logclear! (-> self control root-prim prim-core action) (collide-action ca-8)) (set! (-> self control unknown-handle10) (the-as handle #f)) (none) ) - :trans - (behavior () + :trans (behavior () (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) ) @@ -1217,7 +975,7 @@ ) (pad-buttons x) ) - (zero? (logand (-> self state-flags) 2048)) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) ) (set! (-> self control transv quad) (the-as uint128 0)) @@ -1240,7 +998,7 @@ ) ) ) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (go target-falling 'target-pole-cycle) ) ((>= (ja-aframe-num 0) 14.0) @@ -1255,8 +1013,7 @@ ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (target-compute-pole) (set! (-> self control unknown-uint20) (the-as uint (vector-dot @@ -1266,248 +1023,148 @@ ) ) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 83) - ) + ((ja-group? (-> self draw art-group data 83)) (while (not (-> self control unknown-int21)) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (suspend) ) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 num-func) num-func-identity) - (set! (-> gp-1 frame-num) (ja-aframe (the-as float 37.0) 0)) - ) + (ja :num-func num-func-identity :frame-num (ja-aframe (the-as float 37.0) 0)) ) (else (while (not (-> self control unknown-int21)) (suspend) ) (suspend) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) ) ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 80))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 80)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 80)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 80) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (set! (-> self anim-seed) (the-as uint (if (rand-vu-percent? (the-as float 0.1)) 0 1 ) ) ) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 80))) - (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 80)) data 0 length) -1)) - ) - (set! (-> a0-13 param 1) 1.0) - (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> self draw art-group data 80)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 80) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - target-no-move-post + :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-pole-flip-up (target) - :event - target-standard-event-handler - :exit - (-> target-pole-cycle exit) - :code - (behavior ((arg0 object) (arg1 object) (arg2 float)) - (let ((s3-0 (-> self skel root-channel 0))) - (set! (-> s3-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 81))) - (set! (-> s3-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 81)) data 0 length) -1)) - ) - (set! (-> s3-0 param 1) 1.0) - (set! (-> s3-0 frame-num) (ja-aframe (+ 1.0 (fmin 17.0 (ja-aframe-num 0))) 0)) - (joint-control-channel-group! s3-0 (the-as art-joint-anim (-> self draw art-group data 81)) num-func-seek!) - ) + :event target-standard-event-handler + :exit (-> target-pole-cycle exit) + :code (behavior ((arg0 object) (arg1 object) (arg2 float)) + (ja-no-eval :group! (-> self draw art-group data 81) + :num! (seek!) + :frame-num (ja-aframe (+ 1.0 (fmin 17.0 (ja-aframe-num 0))) 0) + ) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set-forward-vel arg2) (go target-pole-flip-up-jump (the-as float arg0) (the-as float arg1)) (none) ) - :post - target-no-move-post + :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-pole-flip-up-jump (target) - :event - target-standard-event-handler - :enter - (-> target-jump-forward enter) - :exit - target-exit - :trans - (behavior () + :event target-standard-event-handler + :enter (-> target-jump-forward enter) + :exit target-exit + :trans (behavior () ((-> target-jump-forward trans)) (vector-flatten! (-> self control transv) (-> self control transv) (-> self control unknown-vector100)) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 0 0 1 #t) + :code (behavior ((arg0 float) (arg1 float)) + (sound-play "jump") (send-event *camera* 'damp-up) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 83)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 83) :num! min) (let ((f0-1 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) (while (not (and (< (fabs (/ f0-1 (* 0.0033333334 f1-1))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (set! f0-1 (target-height-above-ground)) (set! f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) ) - (ja-channel-push! 1 75) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-9 param 0) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-loop!) - ) - (while #t + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! eichar-jump-loop-ja :num! (loop!) :frame-num 0.0) + (loop (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-10 param 0) 1.0) - (joint-control-channel-group-eval! - a0-10 - (the-as art-joint-anim (-> self draw art-group data 38)) - num-func-loop! - ) - ) + (ja :group! eichar-jump-loop-ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-pole-flip-forward (target) - :event - target-standard-event-handler - :exit - (-> target-pole-cycle exit) - :code - (behavior ((arg0 float) (arg1 float) (arg2 float)) - (let ((s3-0 (-> self skel root-channel 0))) - (set! (-> s3-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 82))) - (set! (-> s3-0 param 0) (ja-aframe (the-as float 16.0) 0)) - (set! (-> s3-0 param 1) 1.0) - (set! (-> s3-0 frame-num) (ja-aframe (+ 1.0 (ja-aframe-num 0)) 0)) - (joint-control-channel-group! s3-0 (the-as art-joint-anim (-> self draw art-group data 82)) num-func-seek!) - ) + :event target-standard-event-handler + :exit (-> target-pole-cycle exit) + :code (behavior ((arg0 float) (arg1 float) (arg2 float)) + (ja-no-eval :group! (-> self draw art-group data 82) + :num! (seek! (ja-aframe (the-as float 16.0) 0)) + :frame-num (ja-aframe (+ 1.0 (ja-aframe-num 0)) 0) + ) (until (ja-done? 0) (suspend) - (let ((s3-1 (-> self skel root-channel 0))) - (set! (-> s3-1 param 0) (ja-aframe (the-as float 16.0) 0)) - (set! (-> s3-1 param 1) 1.0) - (joint-control-channel-group-eval! s3-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 16.0) 0))) ) (set-forward-vel arg2) (go target-pole-flip-forward-jump arg0 arg1) (none) ) - :post - target-no-move-post + :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-pole-flip-forward-jump (target) - :event - target-standard-event-handler - :enter - (behavior ((arg0 float) (arg1 float)) + :event target-standard-event-handler + :enter (behavior ((arg0 float) (arg1 float)) ((-> target-jump enter) arg0 arg1 (the-as surface #f)) (set! (-> self control unknown-surface00) *forward-pole-jump-mods*) (none) ) - :exit - target-exit - :trans - (behavior () + :exit target-exit + :trans (behavior () ((-> target-jump-forward trans)) (vector-flatten! (-> self control transv) (-> self control transv) (-> self control unknown-vector100)) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 0 0 1 #t) + :code (behavior ((arg0 float) (arg1 float)) + (sound-play "jump") (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ((the-as (function none :behavior target) (-> target-pole-flip-up-jump code))) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-edge-grab (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('end-mode) (go target-falling 'target-edge-grab) @@ -1517,8 +1174,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *edge-grab-mods*) (set! (-> self control unknown-dword41) (-> *display* base-frame-counter)) @@ -1528,16 +1184,14 @@ (send-event *camera* 'ease-in) (none) ) - :exit - (behavior () + :exit (behavior () (when (logtest? (-> self control root-prim prim-core action) (collide-action ca-7)) (logclear! (-> self control root-prim prim-core action) (collide-action ca-3 ca-7)) (send-event *camera* 'damp-up) ) (none) ) - :trans - (behavior () + :trans (behavior () (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) @@ -1546,7 +1200,7 @@ ) (pad-buttons x) ) - (zero? (logand (-> self state-flags) 2048)) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) ) (cond ((or (< -0.2 (local-pad-angle)) @@ -1557,7 +1211,7 @@ (set! (-> a1-2 num-spheres) (the-as uint 6)) (set! (-> a1-2 collide-with) (-> self control root-prim collide-with)) (set! (-> a1-2 proc) #f) - (set! (-> a1-2 ignore-pat) (the-as uint 1)) + (set! (-> a1-2 ignore-pat) (new 'static 'pat-surface :noentity #x1)) (set! (-> a1-2 solid-only) #t) (when (not (fill-and-probe-using-spheres *collide-cache* a1-2)) (remove-exit) @@ -1577,8 +1231,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (target-compute-edge) (set! (-> self control unknown-uint20) (the-as uint (vector-dot @@ -1588,113 +1241,50 @@ ) ) (while (< 0.0 (-> self control unknown-float110)) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) - ) - (ja-channel-push! 1 45) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 38)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (when (not (ja-group? eichar-jump-loop-ja)) + (ja-channel-push! 1 (seconds 0.15)) + (ja :group! eichar-jump-loop-ja :num! min) ) (suspend) ) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) (cond ((< (the-as float (-> self control unknown-uint20)) -0.3) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 48)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) + (ja :group! eichar-edge-grab-swing-right-ja :num! min) ) ((< 0.3 (the-as float (-> self control unknown-uint20))) - (let ((gp-3 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-3 - (the-as art-joint-anim (-> self draw art-group data 47)) - num-func-identity - ) - (set! (-> gp-3 frame-num) 0.0) - ) + (ja :group! eichar-edge-grab-swing-left-ja :num! min) ) (else - (let ((gp-4 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-4 - (the-as art-joint-anim (-> self draw art-group data 46)) - num-func-identity - ) - (set! (-> gp-4 frame-num) 0.0) - ) + (ja :group! eichar-falling-to-edge-grab-ja :num! min) ) ) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (ja-channel-set! 1) - (while #t - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 44))) - (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 44)) data 0 length) -1)) - ) - (set! (-> a0-14 param 1) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!) - ) + (loop + (ja-no-eval :group! eichar-edge-grab-stance0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) 1.0) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (+! (-> self anim-seed) 1) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 45))) - (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 45)) data 0 length) -1)) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 45)) num-func-seek!) - ) + (ja-no-eval :group! eichar-edge-grab-stance1-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - target-no-move-post + :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-edge-grab-jump (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('end-mode) (go target-falling 'target-edge-grab) @@ -1704,37 +1294,23 @@ ) ) ) - :exit - (-> target-edge-grab exit) - :code - (behavior ((arg0 float) (arg1 float)) + :exit (-> target-edge-grab exit) + :code (behavior ((arg0 float) (arg1 float)) (ja-channel-set! 1) (set-quaternion! (-> self control) (-> self control dir-targ)) (logclear! (-> self control root-prim prim-core action) (collide-action ca-3 ca-7)) (set! (-> self control transv quad) (the-as uint128 0)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 49))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 49)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 49)) num-func-seek!) - ) + (ja-no-eval :group! eichar-edge-grab-to-jump-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (target-compute-edge-rider) - (TODO-RENAME-9 (-> self align)) - (when (zero? (logand (-> self align flags) 1)) + (compute-alignment! (-> self align)) + (when (zero? (logand (-> self align flags) (align-flags disabled))) (vector-matrix*! s4-0 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (move-by-vector! (-> self control) s4-0) ) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (set! (-> self control transv quad) (the-as uint128 0)) @@ -1744,48 +1320,34 @@ (go target-jump-forward arg0 arg1) (none) ) - :post - target-no-move-post + :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-edge-grab-off (target) - :event - target-standard-event-handler - :exit - (-> target-edge-grab exit) - :code - (behavior () + :event target-standard-event-handler + :exit (-> target-edge-grab exit) + :code (behavior () (ja-channel-set! 1) (set-quaternion! (-> self control) (-> self control dir-targ)) (send-event *camera* 'damp-up) (let ((gp-0 (new 'stack-no-clear 'vector))) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 50))) - (set! (-> s5-0 param 0) (ja-aframe (the-as float 191.0) 0)) - (set! (-> s5-0 param 1) 1.0) - (set! (-> s5-0 frame-num) 0.0) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 50)) num-func-seek!) - ) + (ja-no-eval :group! eichar-edge-grab-off-ja :num! (seek! (ja-aframe (the-as float 191.0) 0)) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (when (zero? (logand (-> self align flags) 1)) + (compute-alignment! (-> self align)) + (when (zero? (logand (-> self align flags) (align-flags disabled))) (vector-matrix*! gp-0 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (move-by-vector! (-> self control) gp-0) ) (suspend) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 param 0) (ja-aframe (the-as float 191.0) 0)) - (set! (-> s5-1 param 1) 1.0) - (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 191.0) 0))) ) ) (set! (-> self control transv quad) (the-as uint128 0)) (logclear! (-> self control root-prim prim-core action) (collide-action ca-3 ca-7)) (vector-float*! (-> self control transv) (-> self control unknown-vector101) -40960.0) (when (and (< (- (-> *display* base-frame-counter) (-> self control rider-time)) (seconds 0.2)) - (or (logtest? (-> self control unknown-surface01 flags) #x4000) + (or (logtest? (-> self control unknown-surface01 flags) (surface-flags moving-ground)) (= (-> self control poly-pat material) (pat-material rotate)) ) ) @@ -1795,16 +1357,13 @@ (go target-falling 'target-edge-grab) (none) ) - :post - target-no-move-post + :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-yellow-blast (target) - :event - (-> target-running-attack event) - :enter - (behavior () + :event (-> target-running-attack event) + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *run-attack-mods*) (set! (-> *run-attack-mods* turnv) 655360.0) @@ -1834,18 +1393,16 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> *run-attack-mods* turnv) 0.0) (set! (-> *run-attack-mods* turnvv) 0.0) (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) (target-exit) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (the-as handle #f))) - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) (level-hint-spawn (game-text-id daxter-you-can-shoot-with-yellow-eco) "sksp0145" @@ -1864,23 +1421,16 @@ ) ) ) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 84))) - (set! (-> s5-0 param 0) (ja-aframe (the-as float 9.0) 0)) - (set! (-> s5-0 param 1) 1.0) - (set! (-> s5-0 frame-num) 0.0) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 84)) num-func-seek!) - ) + (ja-no-eval :group! eichar-yellow-running-blast-ja + :num! (seek! (ja-aframe (the-as float 9.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (set! (-> *run-attack-mods* turnvv) 0.0) ) (suspend) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 param 0) (ja-aframe (the-as float 9.0) 0)) - (set! (-> s5-1 param 1) 1.0) - (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 9.0) 0))) ) (let ((s5-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)))) (set! (-> s5-2 y) 0.0) @@ -1914,15 +1464,7 @@ (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) ) ) - (let ((s5-3 (-> self skel root-channel 0))) - (set! (-> s5-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 84))) - (set! (-> s5-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 84)) data 0 length) -1)) - ) - (set! (-> s5-3 param 1) 1.0) - (set! (-> s5-3 frame-num) (ja-aframe (the-as float 9.0) 0)) - (joint-control-channel-group! s5-3 (the-as art-joint-anim (-> self draw art-group data 84)) num-func-seek!) - ) + (ja-no-eval :group! eichar-yellow-running-blast-ja :num! (seek!) :frame-num (ja-aframe (the-as float 9.0) 0)) (until (ja-done? 0) (if (or (< (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) (the-as uint 30) @@ -1932,21 +1474,16 @@ (send-event (handle->process gp-0) 'die) ) (suspend) - (let ((a0-32 (-> self skel root-channel 0))) - (set! (-> a0-32 param 0) (the float (+ (-> a0-32 frame-group data 0 length) -1))) - (set! (-> a0-32 param 1) 1.0) - (joint-control-channel-group-eval! a0-32 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (if (logtest? (-> self control status) 1) + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-stance) (go target-falling #f) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; definition for symbol *yellow-jump-mods*, type surface @@ -1970,16 +1507,14 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x800 + :flags (surface-flags jump) ) ) ;; failed to figure out what this is: (defstate target-yellow-jump-blast (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () (set! (-> self control unknown-surface00) *yellow-jump-mods*) (let ((gp-0 (new-stack-vector0))) (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) @@ -1999,30 +1534,21 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (rot->dir-targ! (-> self control)) (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) (target-exit) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 86))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 15.0) 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 86)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! eichar-yellow-jumping-blast-ja + :num! (seek! (ja-aframe (the-as float 15.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 15.0) 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 15.0) 0))) ) (suspend) (let ((gp-2 (new-stack-vector0))) @@ -2041,34 +1567,23 @@ ) ) ) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((gp-3 (get-process *default-dead-pool* projectile-yellow #x4000))) - (when gp-3 - (let ((t9-9 (method-of-type projectile-yellow activate))) - (t9-9 (the-as projectile-yellow gp-3) self 'projectile-yellow (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-3 - projectile-init-by-other - (-> self entity) - (-> self control unknown-vector90) - (vector-float*! - (new 'stack-no-clear 'vector) - (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) - (the-as float (-> *TARGET-bank* yellow-projectile-speed)) - ) - (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) - 16 - 0 - ) - #f - ) - (-> gp-3 ppointer) + (ja :num! (seek!)) + (process-spawn + projectile-yellow + :init projectile-init-by-other + (-> self entity) + (-> self control unknown-vector90) + (vector-float*! + (new 'stack-no-clear 'vector) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) + (the-as float (-> *TARGET-bank* yellow-projectile-speed)) ) + (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + 16 + 0 + ) + #f + :to self ) (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) (let ((gp-4 (-> *display* base-frame-counter))) @@ -2076,75 +1591,52 @@ (suspend) ) ) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 86))) - (set! (-> gp-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 86)) data 0 length) -1)) - ) - (set! (-> gp-5 param 1) 1.0) - (set! (-> gp-5 frame-num) (ja-frame-num 0)) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 86)) num-func-seek!) - ) + (ja-no-eval :group! eichar-yellow-jumping-blast-ja :num! (seek!) :frame-num (ja-frame-num 0)) (until (ja-done? 0) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) (the float (+ (-> a0-22 frame-group data 0 length) -1))) - (set! (-> a0-22 param 1) 1.0) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (if (logtest? (-> self control status) 1) + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-stance) (go target-falling #f) ) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-eco-powerup (target) - :event - target-standard-event-handler - :exit - target-exit - :trans - (behavior () + :event target-standard-event-handler + :exit target-exit + :trans (behavior () (slide-down-test) (none) ) - :code - (behavior ((arg0 object) (arg1 float)) + :code (behavior ((arg0 object) (arg1 float)) (set! (-> self neck flex-blend) 0.0) (set! (-> self state-time) (-> *display* base-frame-counter)) (if (= arg1 (-> *FACT-bank* eco-full-inc)) (set! (-> self control unknown-surface00) *double-jump-mods*) (set! (-> self control unknown-surface00) *walk-mods*) ) - (ja-channel-push! 1 15) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 87))) - (set! (-> s5-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 87)) data 0 length) -1)) - ) - (set! (-> s5-0 param 1) (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) - 2.0 - 3.0 - ) - ) - ) - (set! (-> s5-0 frame-num) (ja-aframe - (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) - (-> (new 'static 'array int32 1 0) 0) - 6.0 - ) - ) - 0 - ) - ) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 87)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! eichar-powerup-ja + :num! (seek! max (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) + 2.0 + 3.0 + ) + ) + ) + :frame-num (ja-aframe + (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) + 0.0 + 6.0 + ) + ) + 0 + ) + ) (until (ja-done? 0) (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) @@ -2153,8 +1645,8 @@ ) (pad-buttons x) ) - (zero? (logand (-> self water flags) 512)) - (zero? (logand (-> self state-flags) 2048)) + (zero? (logand (-> self water flags) (water-flags wt09))) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) @@ -2169,10 +1661,10 @@ (go target-running-attack) ) ) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 + (compute-alignment! (-> self align)) + (align! (-> self align) - 2 + (align-opts adjust-y-vel) (the-as float 1.0) (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) 2.0 @@ -2182,37 +1674,30 @@ (the-as float 1.0) ) (suspend) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 param 0) (the float (+ (-> a0-30 frame-group data 0 length) -1))) - (set! (-> a0-30 param 1) (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) - 2.0 - 3.0 - ) - ) - ) - (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) + 2.0 + 3.0 + ) + ) + ) + ) ) (go target-falling 'target-eco-powerup) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-wade-stance (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *wade-mods*) (set-zero! (-> self water bob)) (none) ) - :exit - (behavior () + :exit (behavior () (target-state-hook-exit) (target-exit) (let ((v1-1 (-> self skel effect))) @@ -2221,13 +1706,12 @@ 0 (none) ) - :trans - (behavior () + :trans (behavior () ((-> self state-hook)) - (when (and (zero? (logand (-> self water flags) 1024)) + (when (and (zero? (logand (-> self water flags) (water-flags wt10))) (>= (- (-> *display* base-frame-counter) (-> self water wade-time)) (seconds 0.05)) ) - (if (logtest? (-> self water flags) 2048) + (if (logtest? (-> self water flags) (water-flags wt11)) (go target-swim-stance) (go target-stance) ) @@ -2250,7 +1734,7 @@ (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) - (sound-play-by-name (static-sound-name "swim-stroke") (new-sound-id) 1024 0 0 1 #t) + (sound-play "swim-stroke") (dummy-13 (-> self water) (the-as float 1.4) (-> self control trans) 0 (-> self control transv)) (go target-attack) ) @@ -2259,27 +1743,21 @@ ) (none) ) - :code - (-> target-stance code) - :post - (the-as (function none :behavior target) target-post) + :code (-> target-stance code) + :post target-post ) ;; failed to figure out what this is: (defstate target-wade-walk (target) - :event - target-standard-event-handler - :enter - (-> target-wade-stance enter) - :exit - (-> target-wade-stance exit) - :trans - (behavior () + :event target-standard-event-handler + :enter (-> target-wade-stance enter) + :exit (-> target-wade-stance exit) + :trans (behavior () ((-> self state-hook)) - (when (and (zero? (logand (-> self water flags) 1024)) + (when (and (zero? (logand (-> self water flags) (water-flags wt10))) (>= (- (-> *display* base-frame-counter) (-> self water wade-time)) (seconds 0.1)) ) - (if (logtest? (-> self water flags) 2048) + (if (logtest? (-> self water flags) (water-flags wt11)) (go target-swim-stance) (go target-stance) ) @@ -2302,7 +1780,7 @@ (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) - (sound-play-by-name (static-sound-name "swim-stroke") (new-sound-id) 1024 0 0 1 #t) + (sound-play "swim-stroke") (dummy-13 (-> self water) (the-as float 1.4) (-> self control trans) 0 (-> self control transv)) (go target-attack) ) @@ -2311,97 +1789,58 @@ ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 105) (f30-0 0.0) ) - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-2 (ja-group))) (cond - ((or (= v1-2 (-> self draw art-group data 23)) (= v1-2 (-> self draw art-group data 18))) + ((or (= v1-2 eichar-walk-ja) (= v1-2 eichar-run-ja)) (set! gp-0 15) (set! f30-0 (ja-frame-num 0)) ) - ((let ((v1-9 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-9 (-> self draw art-group data 34)) (= v1-9 (-> self draw art-group data 38))) + ((let ((v1-9 (ja-group))) + (or (= v1-9 eichar-jump-ja) (= v1-9 eichar-jump-loop-ja)) ) (set! gp-0 30) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 92) - ) + ((ja-group? eichar-swim-walk-ja) (set! gp-0 120) ) ) ) (cond - ((and (= (ja-group-size) 6) (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 89) - ) - ) + ((and (= (ja-group-size) 6) (ja-group? eichar-wade-shallow-walk-ja)) ) (else - (ja-channel-push! 6 gp-0) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 dist) (-> *TARGET-bank* wade-shallow-walk-cycle-dist)) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 89)) - num-func-identity + (ja-channel-push! 6 (the-as time-frame gp-0)) + (ja :group! eichar-wade-shallow-walk-ja + :num! (identity f30-0) + :dist (-> *TARGET-bank* wade-shallow-walk-cycle-dist) ) - (set! (-> gp-1 frame-num) f30-0) - ) - (let ((gp-2 (-> self skel root-channel 1))) - (set! (-> gp-2 dist) (-> *TARGET-bank* wade-deep-walk-cycle-dist)) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 90)) - num-func-identity + (ja :chan 1 + :group! eichar-wade-deep-walk-ja + :num! (identity f30-0) + :dist (-> *TARGET-bank* wade-deep-walk-cycle-dist) ) - (set! (-> gp-2 frame-num) f30-0) - ) - (let ((gp-3 (-> self skel root-channel 2))) - (set! (-> gp-3 frame-interp) 0.0) - (set! (-> gp-3 dist) (-> *TARGET-bank* walk-cycle-dist)) - (joint-control-channel-group-eval! - gp-3 - (the-as art-joint-anim (-> self draw art-group data 23)) - num-func-identity + (ja :chan 2 + :group! eichar-walk-ja + :num! (identity f30-0) + :frame-interp 0.0 + :dist (-> *TARGET-bank* walk-cycle-dist) ) - (set! (-> gp-3 frame-num) f30-0) - ) - (let ((gp-4 (-> self skel root-channel 3))) - (set! (-> gp-4 frame-interp) 0.0) - (set! (-> gp-4 dist) (-> *TARGET-bank* walk-down-cycle-dist)) - (joint-control-channel-group-eval! - gp-4 - (the-as art-joint-anim (-> self draw art-group data 25)) - num-func-identity + (ja :chan 3 + :group! eichar-walk-down-ja + :num! (identity f30-0) + :frame-interp 0.0 + :dist (-> *TARGET-bank* walk-down-cycle-dist) ) - (set! (-> gp-4 frame-num) f30-0) - ) - (let ((gp-5 (-> self skel root-channel 4))) - (set! (-> gp-5 frame-interp) 0.0) - (set! (-> gp-5 dist) (-> *TARGET-bank* walk-side-cycle-dist)) - (joint-control-channel-group-eval! - gp-5 - (the-as art-joint-anim (-> self draw art-group data 27)) - num-func-identity + (ja :chan 4 + :group! eichar-walk-left-ja + :num! (identity f30-0) + :frame-interp 0.0 + :dist (-> *TARGET-bank* walk-side-cycle-dist) ) - (set! (-> gp-5 frame-num) f30-0) - ) ) ) ) @@ -2411,7 +1850,7 @@ (f28-0 0.0) (f26-0 (lerp-scale (the-as float 1.0) - (the-as float (-> (new 'static 'array int32 1 0) 0)) + (the-as float 0.0) (-> self control unknown-float01) (the-as float 16384.0) (the-as float 32768.0) @@ -2419,7 +1858,7 @@ ) (gp-6 0) ) - (while #t + (loop (let ((f0-10 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control unknown-float61))))) (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control unknown-float62))))) ) @@ -2430,45 +1869,30 @@ (set! f28-0 (seek f28-0 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-14))))) ) ) - (let ((v1-84 (-> self skel root-channel 3))) - (set! (-> v1-84 dist) (-> *TARGET-bank* walk-down-cycle-dist)) - (set! (-> v1-84 frame-group) (the-as art-joint-anim (-> self draw art-group data 25))) - ) - (cond - ((>= f30-1 0.0) - (let ((v1-87 (-> self skel root-channel 3))) - (set! (-> v1-87 frame-interp) (fabs f30-1)) - (set! (-> v1-87 dist) (-> *TARGET-bank* walk-up-cycle-dist)) - (set! (-> v1-87 frame-group) (the-as art-joint-anim (-> self draw art-group data 24))) - ) - ) - (else - (let ((v1-90 (-> self skel root-channel 3))) - (set! (-> v1-90 frame-interp) (fabs f30-1)) - (set! (-> v1-90 dist) (-> *TARGET-bank* walk-down-cycle-dist)) - (set! (-> v1-90 frame-group) (the-as art-joint-anim (-> self draw art-group data 25))) - ) + (ja :chan 3 :group! eichar-walk-down-ja :dist (-> *TARGET-bank* walk-down-cycle-dist)) + (if (>= f30-1 0.0) + (ja :chan 3 :group! eichar-walk-up-ja :frame-interp (fabs f30-1) :dist (-> *TARGET-bank* walk-up-cycle-dist)) + (ja :chan 3 + :group! eichar-walk-down-ja + :frame-interp (fabs f30-1) + :dist (-> *TARGET-bank* walk-down-cycle-dist) + ) ) - ) - (cond - ((>= f28-0 0.0) - (let ((v1-93 (-> self skel root-channel 4))) - (set! (-> v1-93 frame-interp) (fabs f28-0)) - (set! (-> v1-93 dist) (-> *TARGET-bank* walk-side-cycle-dist)) - (set! (-> v1-93 frame-group) (the-as art-joint-anim (-> self draw art-group data 26))) - ) - ) - (else - (let ((v1-96 (-> self skel root-channel 4))) - (set! (-> v1-96 frame-interp) (fabs f28-0)) - (set! (-> v1-96 dist) (-> *TARGET-bank* walk-side-cycle-dist)) - (set! (-> v1-96 frame-group) (the-as art-joint-anim (-> self draw art-group data 27))) - ) + (if (>= f28-0 0.0) + (ja :chan 4 + :group! eichar-walk-right-ja + :frame-interp (fabs f28-0) + :dist (-> *TARGET-bank* walk-side-cycle-dist) + ) + (ja :chan 4 + :group! eichar-walk-left-ja + :frame-interp (fabs f28-0) + :dist (-> *TARGET-bank* walk-side-cycle-dist) + ) ) - ) (let* ((f0-30 (- (-> self water height) (-> self control trans y))) (f24-1 (lerp-scale - (the-as float (-> (new 'static 'array int32 1 0) 0)) + (the-as float 0.0) (the-as float 1.0) f0-30 (lerp (-> self water wade-height) (-> self water swim-height) (the-as float 0.25)) @@ -2488,7 +1912,7 @@ f26-0 (lerp-scale (the-as float 1.0) - (the-as float (-> (new 'static 'array int32 1 0) 0)) + (the-as float 0.0) (-> self control unknown-float01) (the-as float 16384.0) (the-as float 32768.0) @@ -2497,33 +1921,17 @@ ) ) (set! (-> self skel root-channel 1 frame-interp) f24-1) - (let ((s5-2 (-> self skel root-channel 0))) - (set! (-> s5-2 param 0) (/ (-> self control unknown-float01) - (* 60.0 (/ (dummy-9 (-> self skel)) (-> *TARGET-bank* run-cycle-length))) - ) - ) - (joint-control-channel-group-eval! s5-2 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((s5-3 (-> self skel root-channel 5))) - (set! (-> s5-3 frame-interp) (lerp f26-0 (the-as float (-> (new 'static 'array int32 1 0) 0)) f24-1)) - ) - ) - (let ((a0-66 (-> self skel root-channel 1))) - (set! (-> a0-66 param 0) 0.0) - (joint-control-channel-group-eval! a0-66 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-67 (-> self skel root-channel 2))) - (set! (-> a0-67 param 0) 0.0) - (joint-control-channel-group-eval! a0-67 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-68 (-> self skel root-channel 3))) - (set! (-> a0-68 param 0) 0.0) - (joint-control-channel-group-eval! a0-68 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-69 (-> self skel root-channel 4))) - (set! (-> a0-69 param 0) 0.0) - (joint-control-channel-group-eval! a0-69 (the-as art-joint-anim #f) num-func-chan) + (ja :num! (loop! (/ (-> self control unknown-float01) + (* 60.0 (/ (current-cycle-distance (-> self skel)) (-> *TARGET-bank* run-cycle-length))) + ) + ) + ) + (ja :chan 5 :frame-interp (lerp f26-0 (the-as float 0.0) f24-1)) ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + (ja :chan 3 :num! (chan 0)) + (ja :chan 4 :num! (chan 0)) (when (and (>= (- (-> *display* base-frame-counter) (the-as time-frame gp-6)) (seconds 0.2)) (< (- (-> self water height) (-> self control trans y)) 4096.0) ) @@ -2555,8 +1963,7 @@ ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; definition for function target-swim-tilt @@ -2567,13 +1974,11 @@ (fmin 1.0 (* arg0 (/ (-> self control unknown-float01) (-> self control unknown-surface01 target-speed)))) ) ) - (set! (-> self control unknown-float130) - (seek - (-> self control unknown-float130) - (fmax (fmin (* (+ f0-1 arg2) (fmax 0.5 (+ 0.5 (vector-dot gp-0 v1-2)))) arg3) (- arg3)) - (* arg1 (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self control unknown-float130) + (fmax (fmin (* (+ f0-1 arg2) (fmax 0.5 (+ 0.5 (vector-dot gp-0 v1-2)))) arg3) (- arg3)) + (* arg1 (-> *display* seconds-per-frame)) + ) ) (let ((a2-2 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)))) (forward-up-nopitch->quaternion (-> self control unknown-quaternion01) gp-0 a2-2) @@ -2590,15 +1995,8 @@ ) (set! (-> self control unknown-float00) (fabs (-> self control unknown-float130))) (if (= (-> self next-state name) 'target-swim-down) - (set! (-> self control unknown-float131) - (seek (-> self control unknown-float131) (the-as float -6144.0) (* 4096.0 (-> *display* seconds-per-frame))) - ) - (set! (-> self control unknown-float131) (seek - (-> self control unknown-float131) - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (* 2048.0 (-> *display* seconds-per-frame)) - ) - ) + (seek! (-> self control unknown-float131) (the-as float -6144.0) (* 4096.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-float131) (the-as float 0.0) (* 2048.0 (-> *display* seconds-per-frame))) ) (let ((f0-20 (-> self control unknown-float131))) (set! (-> self control unknown-vector11 y) f0-20) @@ -2608,17 +2006,14 @@ ;; failed to figure out what this is: (defstate target-swim-stance (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *swim-mods*) - (logior! (-> self water flags) 16) + (logior! (-> self water flags) (water-flags wt04)) (none) ) - :exit - (behavior () + :exit (behavior () (target-state-hook-exit) (set! (-> self control unknown-surface00 target-speed) 28672.0) (target-exit) @@ -2633,16 +2028,17 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () ((-> self state-hook)) - (if (and (logtest? (-> self control status) 1) (zero? (logand (-> self control status) 1024))) + (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) + (zero? (logand (-> self control status) (cshape-moving-flags on-water))) + ) (set-zero! (-> self water bob)) ) - (when (and (zero? (logand (-> self water flags) 2048)) + (when (and (zero? (logand (-> self water flags) (water-flags wt11))) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) ) - (if (logtest? (-> self water flags) 1024) + (if (logtest? (-> self water flags) (water-flags wt10)) (go target-wade-stance) (go target-stance) ) @@ -2671,13 +2067,9 @@ (go target-swim-down) ) (if (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (let ((gp-0 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((gp-0 (ja-group))) (ja-aframe-num 0) - (if (or (and (= gp-0 (-> self draw art-group data 96)) #t) (and (= gp-0 (-> self draw art-group data 95)) #t)) + (if (or (and (= gp-0 eichar-swim-up-ja) #t) (and (= gp-0 eichar-swim-down-to-up-ja) #t)) #f #t ) @@ -2685,39 +2077,25 @@ ) (go target-swim-walk) ) - (target-swim-tilt - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (the-as float 2.0) - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (the-as float 1.0) - ) + (target-swim-tilt (the-as float 0.0) (the-as float 2.0) (the-as float 0.0) (the-as float 1.0)) (none) ) - :code - (behavior () - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + :code (behavior () + (let ((v1-2 (ja-group))) (cond - ((or (= v1-2 (-> self draw art-group data 96)) (= v1-2 (-> self draw art-group data 95))) - (ja-channel-push! 1 22) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 97))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 97)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) - (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - 1.0 - 2.0 - ) - ) - ) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 97)) num-func-seek!) - ) + ((or (= v1-2 eichar-swim-up-ja) (= v1-2 eichar-swim-down-to-up-ja)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! eichar-swim-up-to-stance-ja + :num! (seek! + max + (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + 1.0 + 2.0 + ) + ) + ) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) (let ((a0-9 (-> self skel root-channel 0))) @@ -2734,67 +2112,49 @@ ) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 92) - ) - (ja-channel-push! 1 249) + ((ja-group? eichar-swim-walk-ja) + (ja-channel-push! 1 (seconds 0.83)) ) (else - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) ) ) ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 91)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (loop + (ja :group! eichar-swim-stance-ja :num! min) (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) (suspend) - (when (= (-> self skel root-channel 0) (-> self skel channel)) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) ) - ) ) ) (none) ) - :post - target-swim-post + :post target-swim-post ) ;; failed to figure out what this is: (defstate target-swim-walk (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () ((-> target-swim-stance enter)) (die-on-next-update! (-> self water bob)) (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) (none) ) - :exit - (-> target-swim-stance exit) - :trans - (behavior () + :exit (-> target-swim-stance exit) + :trans (behavior () ((-> self state-hook)) - (if (and (logtest? (-> self control status) 1) (zero? (logand (-> self control status) 1024))) + (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) + (zero? (logand (-> self control status) (cshape-moving-flags on-water))) + ) (set-zero! (-> self water bob)) ) - (when (and (zero? (logand (-> self water flags) 2048)) + (when (and (zero? (logand (-> self water flags) (water-flags wt11))) (>= (- (-> *display* base-frame-counter) (-> self water swim-time)) (seconds 0.1)) ) - (if (logtest? (-> self water flags) 1024) + (if (logtest? (-> self water flags) (water-flags wt10)) (go target-wade-stance) (go target-stance) ) @@ -2834,107 +2194,64 @@ (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) ) ) - (target-swim-tilt - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (the-as float 2.0) - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (the-as float 1.0) - ) + (target-swim-tilt (the-as float 0.0) (the-as float 2.0) (the-as float 0.0) (the-as float 1.0)) (none) ) - :code - (behavior () - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + :code (behavior () + (let ((v1-2 (ja-group))) (cond - ((or (= v1-2 (-> self draw art-group data 96)) - (= v1-2 (-> self draw art-group data 95)) - (= v1-2 (-> self draw art-group data 97)) - ) - (ja-channel-push! 1 90) + ((or (= v1-2 eichar-swim-up-ja) (= v1-2 eichar-swim-down-to-up-ja) (= v1-2 eichar-swim-up-to-stance-ja)) + (ja-channel-push! 1 (seconds 0.3)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 97) - ) - (ja-channel-push! 1 45) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 92))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 92)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe (the-as float 19.0) 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 92)) num-func-seek!) - ) + ((ja-group? eichar-swim-up-to-stance-ja) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! eichar-swim-walk-ja :num! (seek!) :frame-num (ja-aframe (the-as float 19.0) 0)) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (if (zero? (logand (-> self align flags) 1)) + (compute-alignment! (-> self align)) + (if (zero? (logand (-> self align flags) (align-flags disabled))) (set! (-> self control unknown-surface00 target-speed) (* (-> self align delta trans z) (-> self control unknown-surface01 alignv) (-> *display* frames-per-second)) ) ) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) ) ) ) - (while #t - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 92))) - (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 92)) data 0 length) -1)) - ) - (set! (-> a0-22 param 1) 1.0) - (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 92)) num-func-seek!) - ) + (loop + (ja-no-eval :group! eichar-swim-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (if (zero? (logand (-> self align flags) 1)) + (compute-alignment! (-> self align)) + (if (zero? (logand (-> self align flags) (align-flags disabled))) (set! (-> self control unknown-surface00 target-speed) (* (-> self align delta trans z) (-> self control unknown-surface01 alignv) (-> *display* frames-per-second)) ) ) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) 1.0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - target-swim-post + :post target-swim-post ) ;; failed to figure out what this is: (defstate target-swim-down (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack 'attack-invinc) (let ((v1-2 (the-as attack-info (-> arg3 param 1)))) - (when (or (zero? (logand (-> v1-2 mask) 32)) (= (-> v1-2 mode) 'generic) (= (-> v1-2 mode) 'drown)) + (when (or (zero? (logand (-> v1-2 mask) (attack-mask mode))) (= (-> v1-2 mode) 'generic) (= (-> v1-2 mode) 'drown)) (set! (-> v1-2 mode) 'damage) (if (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact-info-target health))) (set! (-> v1-2 mode) 'drown-death) ) - (logior! (-> v1-2 mask) 32) + (logior! (-> v1-2 mask) (attack-mask mode)) (set! (-> self control unknown-uint20) (the-as uint #t)) ) ) @@ -2942,10 +2259,9 @@ ) (target-standard-event-handler arg0 arg1 arg2 arg3) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self water flags) (logand -17 (-> self water flags))) + (logclear! (-> self water flags) (water-flags wt04)) (set! (-> self control unknown-surface00) *dive-mods*) (set! (-> self control dynam gravity-max) 16384.0) (set! (-> self control dynam gravity-length) 16384.0) @@ -2956,8 +2272,7 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (target-exit) @@ -2972,8 +2287,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self water swim-time)) (seconds 0.5)) (go target-stance) ) @@ -2981,111 +2295,63 @@ ((>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.1)) (set! (-> self control unknown-surface00) *dive-mods*) (if (= (-> self next-state name) 'target-swim-down) - (target-swim-tilt - (the-as float -0.9) - (the-as float 1.0) - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (the-as float 0.5) - ) + (target-swim-tilt (the-as float -0.9) (the-as float 1.0) (the-as float 0.0) (the-as float 0.5)) ) ) (else (set! (-> self control unknown-surface00) *dive-bottom-mods*) (if (or (= (-> self next-state name) 'target-swim-down) (= (-> self next-state name) 'target-swim-stance)) - (target-swim-tilt - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (the-as float 2.0) - (the-as float -1.0) - (the-as float 1.0) - ) + (target-swim-tilt (the-as float 0.0) (the-as float 2.0) (the-as float -1.0) (the-as float 1.0)) ) ) ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 60) (s5-0 3000) (f30-0 0.0) ) - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-2 (ja-group))) (set! f30-0 (cond - ((or (= v1-2 (-> self draw art-group data 91)) - (= v1-2 (-> self draw art-group data 92)) - (= v1-2 (-> self draw art-group data 97)) - (= v1-2 (-> self draw art-group data 96)) - (= v1-2 (-> self draw art-group data 95)) + ((or (= v1-2 eichar-swim-stance-ja) + (= v1-2 eichar-swim-walk-ja) + (= v1-2 eichar-swim-up-to-stance-ja) + (= v1-2 eichar-swim-up-ja) + (= v1-2 eichar-swim-down-to-up-ja) ) - (ja-channel-push! 1 22) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 93))) - (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 93)) data 0 length) -1)) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 93)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! eichar-swim-walk-to-down-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 6 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (compute-alignment! (-> self align)) + (align! + (-> self align) + (align-opts adjust-y-vel adjust-xz-vel) + (the-as float 1.0) + (the-as float 1.0) + (the-as float 1.0) + ) (if (= (ja-aframe-num 0) 73.0) (dummy-13 (-> self water) (the-as float 0.7) (-> self control trans) 1 *null-vector*) ) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) (the float (+ (-> a0-22 frame-group data 0 length) -1))) - (set! (-> a0-22 param 1) 1.0) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((s4-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-0 - (the-as art-joint-anim (-> self draw art-group data 94)) - num-func-identity - ) - (set! (-> s4-0 frame-num) 0.0) + (ja :num! (seek!)) ) + (ja :group! eichar-swim-down-ja :num! min) f30-0 ) (else - (case (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (((-> self draw art-group data 63) - (-> self draw art-group data 66) - (-> self draw art-group data 64) - (-> self draw art-group data 67) - ) - (ja-channel-push! 1 22) + (case (ja-group) + ((eichar-flop-down-ja eichar-moving-flop-down-ja eichar-flop-down-loop-ja eichar-moving-flop-down-loop-ja) + (ja-channel-push! 1 (seconds 0.075)) (set! gp-0 120) - (let ((s4-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-1 - (the-as art-joint-anim (-> self draw art-group data 94)) - num-func-identity - ) - (set! (-> s4-1 frame-num) (ja-aframe (the-as float 124.0) 0)) - ) + (ja :group! eichar-swim-down-ja :num! (identity (ja-aframe (the-as float 124.0) 0))) -16384.0 ) (else - (ja-channel-push! 1 22) - (let ((s4-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-2 - (the-as art-joint-anim (-> self draw art-group data 94)) - num-func-identity - ) - (set! (-> s4-2 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! eichar-swim-down-ja :num! min) f30-0 ) ) @@ -3093,7 +2359,7 @@ ) ) ) - (while #t + (loop (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons square) ) @@ -3105,7 +2371,7 @@ (go target-swim-up) ) (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) s5-0) - (and (logtest? (-> self control status) 1) + (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (and (< (-> self water swim-depth) 8192.0) (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) ) @@ -3122,9 +2388,7 @@ (f26-0 f28-0) (f24-1 (+ f24-0 f30-0)) ) - (set! f30-0 - (seek f30-0 (the-as float (-> (new 'static 'array int32 1 0) 0)) (* 32768.0 (-> *display* seconds-per-frame))) - ) + (set! f30-0 (seek f30-0 (the-as float 0.0) (* 32768.0 (-> *display* seconds-per-frame)))) (vector+! (-> self control transv) (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f24-1) @@ -3133,38 +2397,31 @@ ) ) (suspend) - (let ((s4-4 (-> self skel root-channel 0))) - (set! (-> s4-4 param 0) (lerp-scale - (the-as float 0.4) - (the-as float 1.0) - (vector-length (-> self control transv)) - (the-as float (-> (new 'static 'array int32 1 0) 0)) - (the-as float 16384.0) - ) - ) - (joint-control-channel-group-eval! s4-4 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! (lerp-scale + (the-as float 0.4) + (the-as float 1.0) + (vector-length (-> self control transv)) + (the-as float 0.0) + (the-as float 16384.0) + ) + ) + ) ) ) (none) ) - :post - target-swim-post + :post target-swim-post ) ;; failed to figure out what this is: (defstate target-swim-up (target) - :event - (-> target-swim-down event) - :enter - (-> target-swim-down enter) - :exit - (-> target-swim-down exit) - :trans - (behavior () + :event (-> target-swim-down event) + :enter (-> target-swim-down enter) + :exit (-> target-swim-down exit) + :trans (behavior () (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) - (zero? (logand (-> self state-flags) 2048)) - (zero? (logand (-> self water flags) #x6000)) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (zero? (logand (-> self water flags) (water-flags wt13 wt14))) ) (go target-swim-jump-jump @@ -3173,50 +2430,31 @@ (the-as surface #f) ) ) - (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 10)) - (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) - ) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'attack) - (set! (-> a1-1 param 0) (the-as uint #f)) - (let ((a0-8 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-8 mode) 'drown-death) - (set! (-> a1-1 param 1) (the-as uint a0-8)) - ) - (send-event-function self a1-1) + (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 10)) + (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + ) + (send-event self 'attack #f (static-attack-info ((mode 'drown-death)))) ) - ) ((-> target-swim-down trans)) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) (let ((f30-0 1.0)) (let ((gp-0 #t)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 95))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 95)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 95)) num-func-seek!) - ) + (ja-no-eval :group! eichar-swim-down-to-up-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (target-swim-tilt (the-as float (if (< 8192.0 (-> self water swim-depth)) 0.5 - (-> (new 'static 'array int32 1 0) 0) + 0.0 ) ) (the-as float 1.0) - (the-as float (-> (new 'static 'array int32 1 0) 0)) + (the-as float 0.0) (the-as float 0.1) ) - (if (and (zero? (logand (-> self water flags) 4096)) + (if (and (zero? (logand (-> self water flags) (water-flags wt12))) (or (>= (ja-aframe-num 0) 222.0) (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (>= (ja-aframe-num 0) 200.0) @@ -3225,86 +2463,67 @@ ) (goto cfg-37) ) - (TODO-RENAME-9 (-> self align)) - (when (zero? (logand (-> self water flags) 4096)) - (logior! (-> self water flags) 16) + (compute-alignment! (-> self align)) + (when (zero? (logand (-> self water flags) (water-flags wt12))) + (logior! (-> self water flags) (water-flags wt04)) (set! gp-0 #f) ) (if gp-0 - (TODO-RENAME-10 (-> self align) 2 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (align! (-> self align) (align-opts adjust-y-vel) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 96)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) - (while #t + (ja :group! eichar-swim-up-ja :num! min) + (loop (target-swim-tilt (the-as float (if (< 8192.0 (-> self water swim-depth)) 0.3 - (-> (new 'static 'array int32 1 0) 0) + 0.0 ) ) (the-as float 1.0) - (the-as float (-> (new 'static 'array int32 1 0) 0)) + (the-as float 0.0) (the-as float 0.1) ) - (if (zero? (logand (-> self water flags) 4096)) + (if (zero? (logand (-> self water flags) (water-flags wt12))) (goto cfg-37) ) (if (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (set! f30-0 2.0) ) - (TODO-RENAME-9 (-> self align)) - (when (logtest? (-> self water flags) 4096) - (TODO-RENAME-10 (-> self align) 2 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (compute-alignment! (-> self align)) + (when (logtest? (-> self water flags) (water-flags wt12)) + (align! (-> self align) (align-opts adjust-y-vel) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) (set! (-> self control transv y) (+ 8192.0 (* 8192.0 f30-0))) ) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) f30-0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) (set! f30-0 (seek f30-0 (the-as float 1.0) (-> *display* seconds-per-frame))) ) ) (label cfg-37) - (logior! (-> self water flags) 16) + (logior! (-> self water flags) (water-flags wt04)) (set! (-> self water swim-time) (-> *display* base-frame-counter)) (start-bobbing! (-> self water) (the-as float -4096.0) 600 1500) (set! (-> self water bob start-time) (+ (-> *display* base-frame-counter) (seconds -0.05))) (go target-swim-stance) (none) ) - :post - target-swim-post + :post target-swim-post ) ;; failed to figure out what this is: (defstate target-swim-jump-jump (target) - :event - (-> target-jump event) - :enter - (-> target-jump enter) - :exit - target-exit - :trans - (behavior () + :event (-> target-jump event) + :enter (-> target-jump enter) + :exit target-exit + :trans (behavior () (cond ((< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (set! (-> self water flags) (logior #x10000 (-> self water flags))) - (set! (-> self control status) (logand -8 (-> self control status))) + (set! (-> self water flags) (logior (water-flags wt16) (-> self water flags))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) ) (else (set! (-> self trans-hook) (-> target-jump trans)) @@ -3313,51 +2532,34 @@ ((-> target-jump trans)) (none) ) - :code - (-> target-jump code) - :post - (the-as (function none :behavior target) target-post) + :code (-> target-jump code) + :post target-post ) ;; failed to figure out what this is: (defstate target-swim-jump (target) - :event - target-standard-event-handler - :enter - (-> target-swim-stance enter) - :exit - (behavior () + :event target-standard-event-handler + :enter (-> target-swim-stance enter) + :exit (behavior () ((-> target-swim-stance exit)) (die-on-next-update! (-> self water bob)) (set! (-> self water align-offset) 0.0) - (set! (-> self water flags) (logior #x10000 (-> self water flags))) + (set! (-> self water flags) (logior (water-flags wt16) (-> self water flags))) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) + :code (behavior ((arg0 float) (arg1 float)) (die-on-next-update! (-> self water bob)) - (ja-channel-push! 1 15) - (let ((s4-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-0 - (the-as art-joint-anim (-> self draw art-group data 98)) - num-func-identity - ) - (set! (-> s4-0 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! eichar-swim-jump-ja :num! min) (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) - (TODO-RENAME-9 (-> self align)) - (if (zero? (logand (-> self align flags) 1)) + (compute-alignment! (-> self align)) + (if (zero? (logand (-> self align flags) (align-flags disabled))) (+! (-> self water align-offset) (* 0.6 (-> self align delta trans y))) ) (suspend) - (when (= (-> self skel root-channel 0) (-> self skel channel)) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 2.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek! max 2.0)) ) - ) ) (let ((f30-0 (fmax 0.0 (- (-> self water bob-offset))))) (let ((s4-1 (new-stack-vector0))) @@ -3380,24 +2582,20 @@ ) (none) ) - :post - target-swim-post + :post target-swim-post ) ;; failed to figure out what this is: (defstate target-hit-ground-hard (target) - :event - target-standard-event-handler - :enter - (behavior ((arg0 float)) + :event target-standard-event-handler + :enter (behavior ((arg0 float)) (set! (-> self control unknown-dword31) 0) (set! (-> self control unknown-dword33) 0) - (set-forward-vel (the-as float (-> (new 'static 'array int32 1 0) 0))) + (set-forward-vel (the-as float 0.0)) (set! (-> self control unknown-surface00) *walk-mods*) (none) ) - :code - (behavior ((arg0 float)) + :code (behavior ((arg0 float)) (when (!= arg0 0.0) (let ((f0-5 (the float (the int (+ 1.0 (/ (- arg0 (-> *TARGET-bank* fall-far)) (-> *TARGET-bank* fall-far-inc)))))) ) @@ -3420,175 +2618,128 @@ (else (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) (ja-channel-push! 1 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 36)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! eichar-painful-land-ja :num! min) (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) (suspend) - (when (= (-> self skel root-channel 0) (-> self skel channel)) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) ) - ) - ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 37)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) ) + (ja :group! eichar-painful-land-end-ja :num! min) (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) (suspend) - (when (= (-> self skel root-channel 0) (-> self skel channel)) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) ) - ) ) (go target-stance) ) ) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-launch (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (= arg2 'query) (= (-> arg3 param 0) 'mode)) 'target-launch (target-standard-event-handler arg0 arg1 arg2 arg3) ) ) - :code - (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) + :code (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *turn-around-mods*) - (ja-channel-push! 1 45) - (set-forward-vel (the-as float (-> (new 'static 'array int32 1 0) 0))) - (let ((s2-0 (-> self skel root-channel 0))) - (set! (-> s2-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 31))) - (set! (-> s2-0 param 0) (ja-aframe (the-as float 15.0) 0)) - (set! (-> s2-0 param 1) 3.0) - (set! (-> s2-0 frame-num) 0.0) - (joint-control-channel-group! s2-0 (the-as art-joint-anim (-> self draw art-group data 31)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.15)) + (set-forward-vel (the-as float 0.0)) + (ja-no-eval :group! eichar-duck-stance-ja :num! (seek! (ja-aframe (the-as float 15.0) 0) 3.0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((s2-1 (-> self skel root-channel 0))) - (set! (-> s2-1 param 0) (ja-aframe (the-as float 15.0) 0)) - (set! (-> s2-1 param 1) 3.0) - (joint-control-channel-group-eval! s2-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 15.0) 0) 3.0)) ) (if arg1 - (send-event *camera* 'change-state arg1 180) + (send-event *camera* 'change-state arg1 (seconds 0.6)) ) - (when (nonzero? arg3) - (let ((s3-1 (get-process *default-dead-pool* process #x4000))) - (when s3-1 - (let ((t9-9 (method-of-type process activate))) - (t9-9 s3-1 self 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process - s3-1 - (lambda :behavior target - ((arg0 vector) (arg1 time-frame) (arg2 float)) - (local-vars (sv-32 time-frame) (sv-40 vector) (sv-44 symbol)) - (set! sv-32 (-> *display* base-frame-counter)) - (let ((v1-2 (new-stack-vector0))) - (set! (-> v1-2 quad) (-> arg0 quad)) - (set! sv-40 v1-2) - ) - (set! sv-44 #t) - (until (>= (- (-> *display* base-frame-counter) sv-32) arg1) - (let ((s4-0 (ppointer->process (-> self parent)))) - (cond - ((and sv-44 - (< (- (-> (the-as target s4-0) control trans y) (-> (the-as target s4-0) control unknown-vector52 y)) arg2) - ) - (vector-xz-normalize! - (-> (the-as target s4-0) control transv) - (the-as float (-> (new 'static 'array int32 1 0) 0)) - ) - (case (-> (the-as target s4-0) current-level name) - (('jungleb) - (let ((v1-16 (vector-! (new-stack-vector0) (-> (the-as target s4-0) control trans) sv-40))) - (set! (-> (the-as target s4-0) control trans x) (+ (-> sv-40 x) (fmax -4096.0 (fmin 4096.0 (-> v1-16 x))))) - (set! (-> (the-as target s4-0) control trans z) (+ (-> sv-40 z) (fmax -4096.0 (fmin 4096.0 (-> v1-16 z))))) - ) + (if (nonzero? arg3) + (process-spawn-function + process + (lambda :behavior process + ((arg0 vector) (arg1 time-frame) (arg2 float)) + (local-vars (sv-32 time-frame) (sv-40 vector) (sv-44 symbol)) + (set! sv-32 (-> *display* base-frame-counter)) + (let ((v1-2 (new-stack-vector0))) + (set! (-> v1-2 quad) (-> arg0 quad)) + (set! sv-40 v1-2) + ) + (set! sv-44 #t) + (until (>= (- (-> *display* base-frame-counter) sv-32) arg1) + (let ((s4-0 (ppointer->process (-> self parent)))) + (cond + ((and sv-44 + (< (- (-> (the-as target s4-0) control trans y) (-> (the-as target s4-0) control unknown-vector52 y)) arg2) ) - ) + (vector-xz-normalize! (-> (the-as target s4-0) control transv) (the-as float 0.0)) + (case (-> (the-as target s4-0) current-level name) + (('jungleb) + (let ((v1-16 (vector-! (new-stack-vector0) (-> (the-as target s4-0) control trans) sv-40))) + (set! (-> (the-as target s4-0) control trans x) (+ (-> sv-40 x) (fmax -4096.0 (fmin 4096.0 (-> v1-16 x))))) + (set! (-> (the-as target s4-0) control trans z) (+ (-> sv-40 z) (fmax -4096.0 (fmin 4096.0 (-> v1-16 z))))) + ) + ) ) - (else - (if sv-44 - (set! sv-32 (-> *display* base-frame-counter)) - ) - (set! sv-44 (the-as symbol #f)) - (when (or (= (-> (the-as target s4-0) next-state name) 'target-duck-high-jump-jump) - (= (-> (the-as target s4-0) next-state name) 'target-falling) - ) - (let ((v1-30 (-> (the-as target s4-0) control trans)) - (s3-0 (-> (the-as target s4-0) control transv)) + ) + (else + (if sv-44 + (set! sv-32 (-> *display* base-frame-counter)) + ) + (set! sv-44 (the-as symbol #f)) + (when (or (= (-> (the-as target s4-0) next-state name) 'target-duck-high-jump-jump) + (= (-> (the-as target s4-0) next-state name) 'target-falling) ) - (set! (-> s3-0 x) (- (-> sv-40 x) (-> v1-30 x))) - (set! (-> s3-0 z) (- (-> sv-40 z) (-> v1-30 z))) - (let ((f30-0 (vector-xz-length s3-0))) - (if (< 122880.0 f30-0) - (vector-xz-normalize! s3-0 (the-as float 122880.0)) - ) - (if (< 4096.0 f30-0) - (forward-up-nopitch->quaternion - (-> (the-as target s4-0) control dir-targ) - (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 (the-as float 1.0)) - (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> (the-as target s4-0) control quat)) - ) - ) + (let ((v1-30 (-> (the-as target s4-0) control trans)) + (s3-0 (-> (the-as target s4-0) control transv)) ) + (set! (-> s3-0 x) (- (-> sv-40 x) (-> v1-30 x))) + (set! (-> s3-0 z) (- (-> sv-40 z) (-> v1-30 z))) + (let ((f30-0 (vector-xz-length s3-0))) + (if (< 122880.0 f30-0) + (vector-xz-normalize! s3-0 (the-as float 122880.0)) + ) + (if (< 4096.0 f30-0) + (forward-up-nopitch->quaternion + (-> (the-as target s4-0) control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 (the-as float 1.0)) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> (the-as target s4-0) control quat)) + ) + ) ) ) ) ) ) - (suspend) - 0 ) - #f + (suspend) + 0 ) - arg2 - arg3 - (-> (new 'static 'array float 1 143360.0) 0) + #f ) - (-> s3-1 ppointer) + arg2 + arg3 + 143360.0 + :to self ) ) - ) - (sound-play-by-name (static-sound-name "launch-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "launch-fire") (go target-high-jump arg0 arg0 'launch) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-periscope (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('change-mode) #f @@ -3604,19 +2755,17 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (target-exit) (set! (-> self cam-user-mode) 'normal) - (logior! (-> self state-flags) 256) - (set! (-> self state-flags) (logand -17 (-> self state-flags))) + (logior! (-> self state-flags) (state-flags grabbed)) + (logclear! (-> self state-flags) (state-flags invulnerable)) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (set! (-> self neck flex-blend) 0.0) (target-exit) - (logior! (-> self state-flags) 144) + (logior! (-> self state-flags) (state-flags invulnerable do-not-notice)) (let ((v1-4 (handle->process arg0))) (if v1-4 (quaterion<-rotate-y-vector (-> self control dir-targ) (vector-! @@ -3628,58 +2777,31 @@ ) ) (set! (-> self control unknown-uint20) (the-as uint #t)) - (ja-channel-push! 1 30) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 101))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 101)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 101)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! eichar-periscope-grab-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event (handle->process arg0) 'change-mode) (while (-> self control unknown-spoolanim00) (suspend) ) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 101))) - (set! (-> a0-16 param 0) 0.0) - (set! (-> a0-16 param 1) 2.0) - (set! (-> a0-16 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 101)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 101)) num-func-seek!) - ) + (ja-no-eval :group! eichar-periscope-grab-ja :num! (seek! 0.0 2.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) 0.0) - (set! (-> a0-17 param 1) 2.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0 2.0)) ) (go target-stance) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-play-anim (target) - :event - target-generic-event-handler - :enter - (behavior ((arg0 string) (arg1 handle)) + :event target-generic-event-handler + :enter (behavior ((arg0 string) (arg1 handle)) (set! (-> self control unknown-handle10) arg1) (move-to-ground (-> self control) @@ -3688,36 +2810,24 @@ #f (-> self control root-prim collide-with) ) - (logior! (-> self state-flags) 256) + (logior! (-> self state-flags) (state-flags grabbed)) (set! (-> self neck flex-blend) 0.0) (none) ) - :exit - (behavior () + :exit (behavior () (send-event (handle->process (-> self control unknown-handle10)) 'end-mode) (target-exit) (none) ) - :code - (behavior ((arg0 string) (arg1 handle)) + :code (behavior ((arg0 string) (arg1 handle)) (let ((gp-0 (the-as art-joint-anim (lookup-art (-> self draw art-group) arg0 art-joint-anim)))) (when gp-0 (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (ja-channel-set! 1) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) gp-0) - (set! (-> a0-4 param 0) (the float (+ (-> gp-0 data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 gp-0 num-func-seek!) - ) + (ja-no-eval :group! gp-0 :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) ) @@ -3725,33 +2835,29 @@ (go target-stance) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-clone-anim (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (= arg2 'trans) (= (-> arg3 param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) ((-> target-grab event) arg0 arg1 arg2 arg3) ) - :enter - (behavior ((arg0 handle)) + :enter (behavior ((arg0 handle)) (set! (-> self control unknown-handle10) arg0) (set! (-> self control unknown-vector102 quad) (-> self control trans quad)) (set! (-> self control unknown-uint20) (the-as uint #t)) (quaternion-copy! (the-as quaternion (-> self control unknown-vector103)) (-> self control quat)) - (logior! (-> self state-flags) 256) + (logior! (-> self state-flags) (state-flags grabbed)) (vector-reset! (-> self control transv)) (set! (-> self neck flex-blend) 0.0) (send-event (ppointer->process (-> self sidekick)) 'shadow #t) (none) ) - :exit - (behavior () + :exit (behavior () (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) (send-event (ppointer->process (-> self sidekick)) 'shadow #t) (let ((gp-0 (-> self node-list data 3)) @@ -3771,7 +2877,7 @@ #t (-> self control root-prim collide-with) ) - (when (logtest? (-> self control status) 1024) + (when (logtest? (-> self control status) (cshape-moving-flags on-water)) (let ((a1-6 (new-stack-vector0))) (set! (-> a1-6 x) (-> self control trans x)) (set! (-> a1-6 y) (-> self water height)) @@ -3789,19 +2895,17 @@ ) ) (rot->dir-targ! (-> self control)) - (logior! (-> self control status) 7) + (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-dword11) (-> *display* base-frame-counter)) (ja-channel-set! 0) (ja-post) (target-exit) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (clone-anim arg0 (the-as int (-> self draw origin-joint-index)) #t "") (go target-stance) (none) ) - :post - target-no-ja-move-post + :post target-no-ja-move-post ) diff --git a/test/decompiler/reference/engine/target/target_REF.gc b/test/decompiler/reference/engine/target/target_REF.gc index bc685e9c87..ec4936225d 100644 --- a/test/decompiler/reference/engine/target/target_REF.gc +++ b/test/decompiler/reference/engine/target/target_REF.gc @@ -2,109 +2,50 @@ (in-package goal) ;; definition for function target-falling-anim -(defbehavior target-falling-anim target ((arg0 time-frame) (arg1 int)) - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) +(defbehavior target-falling-anim target ((arg0 time-frame) (arg1 time-frame)) + (let ((v1-2 (ja-group))) (cond - ((or (= v1-2 (-> self draw art-group data 38)) (= v1-2 (-> self draw art-group data 62))) + ((or (= v1-2 eichar-jump-loop-ja) (= v1-2 eichar-attack-uppercut-ja)) ) - ((let ((v1-8 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-8 (-> self draw art-group data 44)) (= v1-8 (-> self draw art-group data 45))) - ) - (ja-channel-push! 1 45) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 50))) - (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 50)) data 0 length) -1)) - ) - (set! (-> a0-16 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 50)) num-func-seek!) + ((let ((v1-8 (ja-group))) + (or (= v1-8 eichar-edge-grab-stance0-ja) (= v1-8 eichar-edge-grab-stance1-ja)) ) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! eichar-edge-grab-off-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 50) - ) + ((ja-group? eichar-edge-grab-off-ja) (until (ja-done? 0) (suspend) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 86) - ) - (ja-channel-push! 1 45) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) - (set! (-> s5-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1)) - ) - (set! (-> s5-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> s5-0 frame-num) (ja-aframe (the-as float 20.0) 0)) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-seek!) - ) + ((ja-group? eichar-yellow-jumping-blast-ja) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! eichar-jump-ja :num! (seek!) :frame-num (ja-aframe (the-as float 20.0) 0)) (until (ja-done? 0) - (let ((a0-33 (-> self skel root-channel 0))) - (set! (-> a0-33 param 0) (the float (+ (-> a0-33 frame-group data 0 length) -1))) - (set! (-> a0-33 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-33 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (suspend) ) ) (else (ja-channel-push! 1 arg1) - (let ((v1-82 (-> self skel root-channel 0))) - (set! (-> v1-82 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - ) + (ja :group! eichar-jump-loop-ja) (while (!= (-> self skel root-channel 0) (-> self skel channel)) (suspend) ) ) ) ) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-42 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-42 frame-num) 0.0) - (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-loop!) - ) + (ja-no-eval :group! eichar-jump-loop-ja :num! (loop!) :frame-num 0.0) (let ((s5-1 (-> *display* base-frame-counter))) (while (or (= arg0 -1) (< (- (-> *display* base-frame-counter) s5-1) arg0)) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-43 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! - a0-43 - (the-as art-joint-anim (-> self draw art-group data 38)) - num-func-loop! - ) - ) + (ja :group! eichar-jump-loop-ja :num! (loop!)) ) ) #f @@ -113,57 +54,23 @@ ;; definition for function target-falling-anim-trans ;; INFO: Return type mismatch int vs none. (defbehavior target-falling-anim-trans target () - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (b! - (or (= v1-2 (-> self draw art-group data 38)) (= v1-2 (-> self draw art-group data 35))) - cfg-7 - :delay - (empty-form) - ) - ) - (ja-channel-push! 1 99) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) + (let ((v1-2 (ja-group))) + (b! (or (= v1-2 eichar-jump-loop-ja) (= v1-2 eichar-jump-land-ja)) cfg-7 :delay (empty-form)) ) + (ja-channel-push! 1 (seconds 0.33)) + (ja :group! eichar-jump-loop-ja) (b! #t cfg-23 :delay (nop!)) (label cfg-7) (cond - ((and (logtest? (-> self control status) 1) (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) - ) - ) - (ja-channel-push! 1 6) - (let ((v1-21 (-> self skel root-channel 0))) - (set! (-> v1-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - ) + ((and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (not (ja-group? eichar-jump-land-ja))) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! eichar-jump-land-ja) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-loop!) - ) + ((ja-group? eichar-jump-loop-ja) + (ja :num! (loop!)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? eichar-jump-land-ja) + (ja :num! (seek!)) ) ) (label cfg-23) @@ -185,14 +92,14 @@ ) (pad-buttons x) ) - (zero? (logand (-> self water flags) 512)) + (zero? (logand (-> self water flags) (water-flags wt09))) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) - (zero? (logand (-> self state-flags) 2048)) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) ) - (if (logtest? (-> self control status) 1) + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-hit-ground #f) ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) @@ -202,7 +109,7 @@ ) #t ) - (logior! (-> self control status) 1) + (logior! (-> self control status) (cshape-moving-flags onsurf)) (go target-hit-ground 'stuck) ) (if (!= (-> self state-time) (-> *display* base-frame-counter)) @@ -214,38 +121,35 @@ ;; definition for function target-hit-ground-anim (defbehavior target-hit-ground-anim target ((arg0 symbol)) - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-2 (ja-group))) (cond - ((or (= v1-2 (-> self draw art-group data 63)) - (= v1-2 (-> self draw art-group data 64)) - (= v1-2 (-> self draw art-group data 66)) - (= v1-2 (-> self draw art-group data 67)) + ((or (= v1-2 eichar-flop-down-ja) + (= v1-2 eichar-flop-down-loop-ja) + (= v1-2 eichar-moving-flop-down-ja) + (= v1-2 eichar-moving-flop-down-loop-ja) ) (let ((gp-0 (or (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (< (-> self control unknown-float01) (-> (new 'static 'array float 1 61440.0) 0)) + (< (-> self control unknown-float01) 61440.0) ) ) - (f30-0 (if (= arg0 'swim) - (-> (new 'static 'array float 1 0.4) 0) - (-> (new 'static 'array float 1 1.0) 0) - ) + (f30-0 (the-as float (if (= arg0 'swim) + 0.4 + 1.0 + ) + ) ) ) (ja-channel-set! 1) (let ((s5-0 (-> self skel root-channel 0))) (set! (-> s5-0 frame-group) (the-as art-joint-anim (if gp-0 - (-> self draw art-group data 65) - (-> self draw art-group data 68) + eichar-flop-down-land-ja + eichar-moving-flop-down-land-ja ) ) ) (set! (-> s5-0 param 0) (the float (+ (-> (the-as art-joint-anim (if gp-0 - (-> self draw art-group data 65) - (-> self draw art-group data 68) + eichar-flop-down-land-ja + eichar-moving-flop-down-land-ja ) ) data @@ -256,28 +160,29 @@ ) ) ) - (let ((f30-1 (seek f30-0 (-> (new 'static 'array float 1 1.0) 0) (* 0.5 (-> *display* seconds-per-frame))))) + (let ((f30-1 (seek f30-0 (the-as float 1.0) (* 0.5 (-> *display* seconds-per-frame))))) (set! (-> s5-0 param 1) f30-1) (set! (-> s5-0 frame-num) 0.0) (joint-control-channel-group! s5-0 (the-as art-joint-anim (if gp-0 - (-> self draw art-group data 65) - (-> self draw art-group data 68) + eichar-flop-down-land-ja + eichar-moving-flop-down-land-ja ) ) num-func-seek! ) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 + (compute-alignment! (-> self align)) + (align! (-> self align) - (if gp-0 - 2 - 6 - ) - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as align-opts (if gp-0 + 2 + 6 + ) + ) + (the-as float 1.0) + (the-as float 1.0) (the-as float 1.5) ) (when (and (>= 25.0 (ja-aframe-num 0)) (and (>= (ja-aframe-num 0) 21.0) @@ -302,7 +207,7 @@ (suspend) (let ((s5-1 (-> self skel root-channel 0))) (set! (-> s5-1 param 0) (the float (+ (-> s5-1 frame-group data 0 length) -1))) - (set! f30-1 (seek f30-1 (-> (new 'static 'array float 1 1.0) 0) (* 0.5 (-> *display* seconds-per-frame)))) + (set! f30-1 (seek f30-1 (the-as float 1.0) (* 0.5 (-> *display* seconds-per-frame)))) (set! (-> s5-1 param 1) f30-1) (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) ) @@ -317,232 +222,94 @@ ) #f ) - ((let ((v1-95 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (or (= v1-95 (-> self draw art-group data 38)) - (= v1-95 (-> self draw art-group data 42)) - (= v1-95 (-> self draw art-group data 43)) - ) - (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - (>= (ja-aframe-num 0) 38.0) - ) + ((let ((v1-95 (ja-group))) + (or (or (= v1-95 eichar-jump-loop-ja) (= v1-95 eichar-launch-jump-ja) (= v1-95 eichar-launch-jump-loop-ja)) + (and (ja-group? eichar-jump-ja) (>= (ja-aframe-num 0) 38.0)) ) ) - (ja-channel-push! 1 6) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> a0-35 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) - ) - (set! (-> a0-35 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-35 frame-num) 0.0) - (joint-control-channel-group! a0-35 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.02)) + (ja-no-eval :group! eichar-jump-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1))) - (set! (-> a0-36 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) - ((and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - (>= (ja-aframe-num 0) 35.0) - ) + ((and (ja-group? eichar-jump-ja) (>= (ja-aframe-num 0) 35.0)) (ja-channel-set! 1) - (let ((a0-44 (-> self skel root-channel 0))) - (set! (-> a0-44 frame-group) (the-as art-joint-anim (-> self draw art-group data 39))) - (set! (-> a0-44 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 39)) data 0 length) -1)) - ) - (set! (-> a0-44 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-44 frame-num) 0.0) - (joint-control-channel-group! a0-44 (the-as art-joint-anim (-> self draw art-group data 39)) num-func-seek!) - ) + (ja-no-eval :group! eichar-jump-short-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-45 (-> self skel root-channel 0))) - (set! (-> a0-45 param 0) (the float (+ (-> a0-45 frame-group data 0 length) -1))) - (set! (-> a0-45 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-45 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> gp-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) - ) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-1 frame-num) (ja-aframe (the-as float 50.0) 0)) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! eichar-jump-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 50.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-49 (-> self skel root-channel 0))) - (set! (-> a0-49 param 0) (the float (+ (-> a0-49 frame-group data 0 length) -1))) - (set! (-> a0-49 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-49 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) - ((let ((v1-187 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-187 (-> self draw art-group data 34)) (= v1-187 (-> self draw art-group data 41))) + ((let ((v1-187 (ja-group))) + (or (= v1-187 eichar-jump-ja) (= v1-187 eichar-duck-high-jump-ja)) ) (ja-channel-set! 1) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 39))) - (set! (-> gp-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 39)) data 0 length) -1)) - ) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-2 frame-num) (ja-aframe (the-as float 38.0) 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 39)) num-func-seek!) - ) + (ja-no-eval :group! eichar-jump-short-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 38.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-61 (-> self skel root-channel 0))) - (set! (-> a0-61 param 0) (the float (+ (-> a0-61 frame-group data 0 length) -1))) - (set! (-> a0-61 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-61 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> gp-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) - ) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-3 frame-num) (ja-aframe (the-as float 50.0) 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! eichar-jump-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 50.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-65 (-> self skel root-channel 0))) - (set! (-> a0-65 param 0) (the float (+ (-> a0-65 frame-group data 0 length) -1))) - (set! (-> a0-65 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-65 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) - ((let ((v1-242 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-242 (-> self draw art-group data 73)) (= v1-242 (-> self draw art-group data 74))) + ((let ((v1-242 (ja-group))) + (or (= v1-242 eichar-hit-from-front-ja) (= v1-242 eichar-hit-from-back-ja)) ) - (let ((f30-2 (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 74) - ) - (-> (new 'static 'array float 1 24576.0) 0) - (-> (new 'static 'array float 1 -24576.0) 0) - ) + (let ((f30-2 (the-as float (if (ja-group? eichar-hit-from-back-ja) + 24576.0 + -24576.0 + ) + ) ) ) - (ja-channel-push! 1 12) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 39))) - (set! (-> gp-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 39)) data 0 length) -1)) - ) - (set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-4 frame-num) (ja-aframe (the-as float 38.0) 0)) - (joint-control-channel-group! gp-4 (the-as art-joint-anim (-> self draw art-group data 39)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! eichar-jump-short-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 38.0) 0)) (until (ja-done? 0) (set-forward-vel f30-2) (suspend) - (let ((a0-82 (-> self skel root-channel 0))) - (set! (-> a0-82 param 0) (the float (+ (-> a0-82 frame-group data 0 length) -1))) - (set! (-> a0-82 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-82 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> gp-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) - ) - (set! (-> gp-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-5 frame-num) (ja-aframe (the-as float 50.0) 0)) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) - ) + (ja-no-eval :group! eichar-jump-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 50.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-86 (-> self skel root-channel 0))) - (set! (-> a0-86 param 0) (the float (+ (-> a0-86 frame-group data 0 length) -1))) - (set! (-> a0-86 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-86 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) - ((let ((v1-305 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-305 (-> self draw art-group data 34)) - (= v1-305 (-> self draw art-group data 56)) - (= v1-305 (-> self draw art-group data 57)) - (= v1-305 (-> self draw art-group data 58)) - (= v1-305 (-> self draw art-group data 68)) - (= v1-305 (-> self draw art-group data 65)) - (= v1-305 (-> self draw art-group data 62)) + ((let ((v1-305 (ja-group))) + (or (= v1-305 eichar-jump-ja) + (= v1-305 eichar-attack-from-jump-ja) + (= v1-305 eichar-attack-from-jump-loop-ja) + (= v1-305 eichar-attack-from-jump-end-ja) + (= v1-305 eichar-moving-flop-down-land-ja) + (= v1-305 eichar-flop-down-land-ja) + (= v1-305 eichar-attack-uppercut-ja) ) ) - (ja-channel-push! 1 12) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> gp-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) - ) - (set! (-> gp-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-6 frame-num) (ja-aframe (the-as float 42.0) 0)) - (joint-control-channel-group! gp-6 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! eichar-jump-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 42.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-113 (-> self skel root-channel 0))) - (set! (-> a0-113 param 0) (the float (+ (-> a0-113 frame-group data 0 length) -1))) - (set! (-> a0-113 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-113 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) - (let ((a0-119 (-> self skel root-channel 0))) - (set! (-> a0-119 param 0) (the float (+ (-> a0-119 frame-group data 0 length) -1))) - (set! (-> a0-119 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-119 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? eichar-jump-land-ja) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) @@ -555,39 +322,32 @@ ;; failed to figure out what this is: (defstate target-startup (target) - :event - target-standard-event-handler - :code - (behavior () + :event target-standard-event-handler + :code (behavior () (suspend) (suspend) (go target-stance) (none) ) - :post - target-no-move-post + :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-stance (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () (set! (-> self control unknown-surface00) *walk-mods*) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control unknown-float81) 0.0) (target-state-hook-exit) (none) ) - :trans - (behavior () + :trans (behavior () ((-> self state-hook)) - (if (logtest? (-> self water flags) 1024) + (if (logtest? (-> self water flags) (water-flags wt10)) (go target-wade-stance) ) (when (= (-> self control ground-pat material) (pat-material ice)) @@ -634,375 +394,172 @@ (fall-test) (none) ) - :code - (behavior () + :code (behavior () (let ((s5-0 22) (gp-0 (new 'stack 'ground-tween-info)) ) - (let ((v1-3 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-3 (ja-group))) (cond - ((or (= v1-3 (-> self draw art-group data 89)) (= v1-3 (-> self draw art-group data 90))) + ((or (= v1-3 eichar-wade-shallow-walk-ja) (= v1-3 eichar-wade-deep-walk-ja)) (set! s5-0 45) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 71) - ) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 72))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 72)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 72)) num-func-seek!) - ) + ((ja-group? eichar-wheel-flip-ja) + (ja-no-eval :group! eichar-wheel-flip-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 51) - ) + ((ja-group? eichar-attack-from-stance-ja) (cond ((rand-vu-percent? (the-as float 0.3)) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 53))) - (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 53)) data 0 length) -1)) - ) - (set! (-> a0-20 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> self draw art-group data 53)) num-func-seek!) - ) + (ja-no-eval :group! eichar-attack-from-stance-alt-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 52))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 52)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 52)) num-func-seek!) - ) + (ja-no-eval :group! eichar-attack-from-stance-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 78) - ) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> self draw art-group data 79))) - (set! (-> a0-30 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 79)) data 0 length) -1)) - ) - (set! (-> a0-30 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> self draw art-group data 79)) num-func-seek!) - ) + ((ja-group? eichar-smack-surface-ja) + (ja-no-eval :group! eichar-smack-surface-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 param 0) (the float (+ (-> a0-31 frame-group data 0 length) -1))) - (set! (-> a0-31 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-31 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 84) - ) - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> self draw art-group data 85))) - (set! (-> a0-37 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 85)) data 0 length) -1)) - ) - (set! (-> a0-37 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-37 frame-num) 0.0) - (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> self draw art-group data 85)) num-func-seek!) - ) + ((ja-group? eichar-yellow-running-blast-ja) + (ja-no-eval :group! eichar-yellow-running-blast-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 param 0) (the float (+ (-> a0-38 frame-group data 0 length) -1))) - (set! (-> a0-38 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-38 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! s5-0 0) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 59) - ) + ((ja-group? eichar-attack-punch-ja) (set! (-> self control unknown-float81) (-> self control unknown-float80)) (set! (-> self control unknown-surface00) *walk-no-turn-mods*) - (let ((s4-0 (-> self skel root-channel 0))) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (if (rand-vu-percent? (the-as float 0.3)) - (-> self draw art-group data 61) - (-> self draw art-group data 60) - ) - ) - ) - (set! (-> s4-0 param 0) (the float (+ (-> (the-as art-joint-anim (if (rand-vu-percent? (the-as float 0.3)) - (-> self draw art-group data 61) - (-> self draw art-group data 60) - ) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> s4-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> s4-0 frame-num) 0.0) - (joint-control-channel-group! - s4-0 - (the-as art-joint-anim (if (rand-vu-percent? (the-as float 0.3)) - (-> self draw art-group data 61) - (-> self draw art-group data 60) - ) + (ja-no-eval :group! (if (rand-vu-percent? (the-as float 0.3)) + eichar-attack-punch-alt-end-ja + eichar-attack-punch-end-ja + ) + :num! (seek!) + :frame-num 0.0 ) - num-func-seek! - ) - ) (until (ja-done? 0) - (set! (-> self control unknown-float81) - (seek - (-> self control unknown-float81) - (-> (new 'static 'array float 1 0.0) 0) - (-> *display* seconds-per-frame) - ) - ) + (seek! (-> self control unknown-float81) (the-as float 0.0) (-> *display* seconds-per-frame)) (suspend) - (let ((a0-50 (-> self skel root-channel 0))) - (set! (-> a0-50 param 0) (the float (+ (-> a0-50 frame-group data 0 length) -1))) - (set! (-> a0-50 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-50 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self control unknown-surface00) *walk-mods*) (set! (-> self control unknown-float81) 0.0) (rot->dir-targ! (-> self control)) ) - ((let ((v1-206 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-206 (-> self draw art-group data 31)) (= v1-206 (-> self draw art-group data 32))) - ) - (ja-channel-push! 1 12) - (let ((a0-62 (-> self skel root-channel 0))) - (set! (-> a0-62 frame-group) (the-as art-joint-anim (-> self draw art-group data 30))) - (set! (-> a0-62 param 0) 0.0) - (set! (-> a0-62 param 1) 1.2) - (set! (-> a0-62 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-62 (the-as art-joint-anim (-> self draw art-group data 30)) num-func-seek!) + ((let ((v1-206 (ja-group))) + (or (= v1-206 eichar-duck-stance-ja) (= v1-206 eichar-duck-walk-ja)) ) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! eichar-stance-to-duck-ja :num! (seek! 0.0 1.2) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-63 (-> self skel root-channel 0))) - (set! (-> a0-63 param 0) 0.0) - (set! (-> a0-63 param 1) 1.2) - (joint-control-channel-group-eval! a0-63 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0 1.2)) ) (set! s5-0 12) ) - ((or (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) - (begin (set! s5-0 45) (< 0.5 (-> self skel root-channel 6 frame-interp))) - ) - (let ((v1-243 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-243 (-> self draw art-group data 28)) - (= v1-243 (-> self draw art-group data 29)) - (= v1-243 (-> self draw art-group data 54)) - (= v1-243 (-> self draw art-group data 55)) + ((or (and (ja-group? eichar-walk-ja) (begin (set! s5-0 45) (< 0.5 (-> self skel root-channel 6 frame-interp)))) + (let ((v1-243 (ja-group))) + (or (= v1-243 eichar-run-squash-ja) + (= v1-243 eichar-run-squash-weak-ja) + (= v1-243 eichar-attack-from-stance-run-end-ja) + (= v1-243 eichar-attack-from-stance-run-alt-end-ja) ) ) ) - (let ((f30-1 (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) - (let ((f0-57 (+ 50.0 (* 0.8333333 (+ -25.0 (ja-aframe-num 0)))))) - (- f0-57 (* (the float (the int (/ f0-57 50.0))) 50.0)) - ) - ) - (else - (-> (new 'static 'array float 1 0.0) 0) - ) - ) + (let ((f30-1 (the-as float (cond + ((ja-group? eichar-walk-ja) + (let ((f0-57 (+ 50.0 (* 0.8333333 (+ -25.0 (ja-aframe-num 0)))))) + (- f0-57 (* (the float (the int (/ f0-57 50.0))) 50.0)) + ) + ) + (else + 0.0 + ) + ) + ) ) ) (set! s5-0 45) - (ja-channel-push! 3 s5-0) + (ja-channel-push! 3 (the-as time-frame s5-0)) (ground-tween-initialize gp-0 (the-as uint 0) - (the-as uint (-> self draw art-group data 4)) - (the-as uint (-> self draw art-group data 13)) - (the-as uint (-> self draw art-group data 16)) - (the-as uint (-> self draw art-group data 7)) - (the-as uint (-> self draw art-group data 10)) - ) - (let ((s4-1 (-> self skel root-channel 0))) - (set! (-> s4-1 num-func) num-func-identity) - (set! (-> s4-1 frame-num) (ja-aframe f30-1 0)) + (the-as uint eichar-run-to-stance-loop-ja) + (the-as uint eichar-run-to-stance-loop-up-ja) + (the-as uint eichar-run-to-stance-loop-down-ja) + (the-as uint eichar-run-to-stance-loop-left-ja) + (the-as uint eichar-run-to-stance-loop-right-ja) ) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-1 0)) ) - (let ((a0-89 (-> self skel root-channel 1))) - (set! (-> a0-89 param 0) 0.0) - (joint-control-channel-group-eval! a0-89 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-90 (-> self skel root-channel 2))) - (set! (-> a0-90 param 0) 0.0) - (joint-control-channel-group-eval! a0-90 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) (dotimes (s4-2 3) (until (ja-done? 0) (ground-tween-update gp-0 (-> self control unknown-float61) (-> self control unknown-float62)) (suspend) - (let ((a0-92 (-> self skel root-channel 0))) - (set! (-> a0-92 param 0) (the float (+ (-> a0-92 frame-group data 0 length) -1))) - (set! (-> a0-92 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-92 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((a0-93 (-> self skel root-channel 1))) - (set! (-> a0-93 param 0) 0.0) - (joint-control-channel-group-eval! a0-93 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-94 (-> self skel root-channel 2))) - (set! (-> a0-94 param 0) 0.0) - (joint-control-channel-group-eval! a0-94 (the-as art-joint-anim #f) num-func-chan) - ) - ) - (let ((v1-298 (-> self skel root-channel 0))) - (set! (-> v1-298 num-func) num-func-identity) - (set! (-> v1-298 frame-num) 0.0) + (ja :num! (seek!)) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) ) + (ja :num-func num-func-identity :frame-num 0.0) ) (ground-tween-initialize gp-0 (the-as uint 0) - (the-as uint (-> self draw art-group data 3)) - (the-as uint (-> self draw art-group data 12)) - (the-as uint (-> self draw art-group data 15)) - (the-as uint (-> self draw art-group data 6)) - (the-as uint (-> self draw art-group data 9)) + (the-as uint eichar-run-to-stance-ja) + (the-as uint eichar-run-to-stance-up-ja) + (the-as uint eichar-run-to-stance-down-ja) + (the-as uint eichar-run-to-stance-left-ja) + (the-as uint eichar-run-to-stance-right-ja) ) (until (ja-done? 0) (ground-tween-update gp-0 (-> self control unknown-float61) (-> self control unknown-float62)) (suspend) - (let ((a0-99 (-> self skel root-channel 0))) - (set! (-> a0-99 param 0) (the float (+ (-> a0-99 frame-group data 0 length) -1))) - (set! (-> a0-99 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-99 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((a0-100 (-> self skel root-channel 1))) - (set! (-> a0-100 param 0) 0.0) - (joint-control-channel-group-eval! a0-100 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-101 (-> self skel root-channel 2))) - (set! (-> a0-101 param 0) 0.0) - (joint-control-channel-group-eval! a0-101 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (seek!)) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) ) ) - ((and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) - (>= (-> self control unknown-float01) 5734.4) - ) + ((and (ja-group? eichar-walk-ja) (>= (-> self control unknown-float01) 5734.4)) (set! s5-0 45) ) ) ) - (if (not (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (= (ja-group-size) 3) - ) - ) - (ja-channel-push! 3 s5-0) + (if (not (and (ja-group? eichar-stance-loop-ja) (= (ja-group-size) 3))) + (ja-channel-push! 3 (the-as time-frame s5-0)) ) (ground-tween-initialize gp-0 (the-as uint 0) - (the-as uint (-> self draw art-group data 5)) - (the-as uint (-> self draw art-group data 14)) - (the-as uint (-> self draw art-group data 17)) - (the-as uint (-> self draw art-group data 8)) - (the-as uint (-> self draw art-group data 11)) + (the-as uint eichar-stance-loop-ja) + (the-as uint eichar-stance-loop-up-ja) + (the-as uint eichar-stance-loop-down-ja) + (the-as uint eichar-stance-loop-left-ja) + (the-as uint eichar-stance-loop-right-ja) ) - (while #t + (loop (ground-tween-update gp-0 (-> self control unknown-float61) (-> self control unknown-float62)) (suspend) - (let ((a0-115 (-> self skel root-channel 0))) - (set! (-> a0-115 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-115 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((a0-116 (-> self skel root-channel 1))) - (set! (-> a0-116 param 0) 0.0) - (joint-control-channel-group-eval! a0-116 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-117 (-> self skel root-channel 2))) - (set! (-> a0-117 param 0) 0.0) - (joint-control-channel-group-eval! a0-117 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (loop!)) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) (if (can-play-stance-amibent?) (go target-stance-ambient) ) @@ -1010,28 +567,23 @@ ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-walk (target) - :event - target-walk-event-handler - :enter - (behavior () + :event target-walk-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *walk-mods*) (none) ) - :exit - (behavior () + :exit (behavior () (target-effect-exit) (target-state-hook-exit) (none) ) - :trans - (behavior () + :trans (behavior () ((-> self state-hook)) (when (= (-> self control ground-pat material) (pat-material ice)) (target-effect-exit) @@ -1090,309 +642,182 @@ (set! (-> self control transv quad) (-> self control unknown-vector-array10 (-> self control unknown-int10) quad) ) - (set! (-> self control transv w) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> self control transv w) 1.0) (go target-turn-around) ) (slide-down-test) (fall-test) (none) ) - :code - (behavior () + :code (behavior () (let ((f28-0 0.0) - (f30-0 (fmax 0.0 (fmin - (-> (new 'static 'array float 1 1.0) 0) - (* 0.000048828126 (+ -16384.0 (-> self control unknown-float01))) - ) - ) - ) + (f30-0 (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control unknown-float01)))))) (gp-0 #f) ) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 33) - ) - (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) - (ja-channel-push! 7 15) + ((ja-group? eichar-turn-around-ja) + (set! f30-0 1.0) + (ja-channel-push! 7 (seconds 0.05)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 69) - ) - (ja-channel-push! 7 22) - (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) + ((ja-group? eichar-duck-roll-ja) + (ja-channel-push! 7 (seconds 0.075)) + (set! f30-0 1.0) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 51) - ) - (let ((f30-1 - (fmax 0.8 (fmin (-> (new 'static 'array float 1 1.0) 0) (* 0.000048828126 (-> self control unknown-float01)))) - ) - ) + ((ja-group? eichar-attack-from-stance-ja) + (let ((f30-1 (fmax 0.8 (fmin 1.0 (* 0.000048828126 (-> self control unknown-float01)))))) (cond ((and (rand-vu-percent? (the-as float 0.3)) (< 20480.0 (-> self control unknown-float01))) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 53))) - (set! (-> s5-0 param 0) (ja-aframe (the-as float 29.0) 0)) - (set! (-> s5-0 param 1) f30-1) - (set! (-> s5-0 frame-num) 0.0) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 53)) num-func-seek!) - ) + (ja-no-eval :group! eichar-attack-from-stance-alt-end-ja + :num! (seek! (ja-aframe (the-as float 29.0) 0) f30-1) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 param 0) (ja-aframe (the-as float 29.0) 0)) - (set! (-> s5-1 param 1) f30-1) - (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 55))) - (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 55)) data 0 length) -1)) - ) - (set! (-> a0-20 param 1) f30-1) - (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> self draw art-group data 55)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 29.0) 0) f30-1)) ) + (ja-no-eval :group! eichar-attack-from-stance-run-alt-end-ja :num! (seek! max f30-1) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) f30-1) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-1)) ) ) (else - (let ((s5-2 (-> self skel root-channel 0))) - (set! (-> s5-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 52))) - (set! (-> s5-2 param 0) (ja-aframe (the-as float 29.0) 0)) - (set! (-> s5-2 param 1) f30-1) - (set! (-> s5-2 frame-num) 0.0) - (joint-control-channel-group! s5-2 (the-as art-joint-anim (-> self draw art-group data 52)) num-func-seek!) - ) + (ja-no-eval :group! eichar-attack-from-stance-end-ja + :num! (seek! (ja-aframe (the-as float 29.0) 0) f30-1) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((s5-3 (-> self skel root-channel 0))) - (set! (-> s5-3 param 0) (ja-aframe (the-as float 29.0) 0)) - (set! (-> s5-3 param 1) f30-1) - (joint-control-channel-group-eval! s5-3 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 54))) - (set! (-> a0-28 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 54)) data 0 length) -1)) - ) - (set! (-> a0-28 param 1) f30-1) - (set! (-> a0-28 frame-num) 0.0) - (joint-control-channel-group! a0-28 (the-as art-joint-anim (-> self draw art-group data 54)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 29.0) 0) f30-1)) ) + (ja-no-eval :group! eichar-attack-from-stance-run-end-ja :num! (seek! max f30-1) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1))) - (set! (-> a0-29 param 1) f30-1) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-1)) ) ) ) ) - (ja-channel-push! 7 15) - (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) + (ja-channel-push! 7 (seconds 0.05)) + (set! f30-0 1.0) (set! f28-0 30.0) ) (else - (let ((v1-108 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-108 (ja-group))) (cond - ((or (= v1-108 (-> self draw art-group data 59)) (= v1-108 (-> self draw art-group data 60))) - (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) + ((or (= v1-108 eichar-attack-punch-ja) (= v1-108 eichar-attack-punch-end-ja)) + (set! f30-0 1.0) (set! f28-0 30.0) - (ja-channel-push! 7 45) + (ja-channel-push! 7 (seconds 0.15)) ) - ((let ((v1-116 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-116 (-> self draw art-group data 84)) (= v1-116 (-> self draw art-group data 85))) + ((let ((v1-116 (ja-group))) + (or (= v1-116 eichar-yellow-running-blast-ja) (= v1-116 eichar-yellow-running-blast-end-ja)) ) - (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) + (set! f30-0 1.0) (set! f28-0 26.0) - (ja-channel-push! 7 30) + (ja-channel-push! 7 (seconds 0.1)) ) - ((and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) + ((and (ja-group? eichar-walk-ja) (= (-> self skel root-channel 0) (-> self skel channel))) (set! f28-0 (ja-aframe-num 0)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 102) - ) + ((ja-group? (-> self draw art-group data 102)) (set! f28-0 (ja-aframe-num 0)) - (ja-channel-push! 7 30) + (ja-channel-push! 7 (seconds 0.1)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 89) - ) + ((ja-group? eichar-wade-shallow-walk-ja) (set! f28-0 (ja-aframe-num 0)) - (ja-channel-push! 7 15) + (ja-channel-push! 7 (seconds 0.05)) ) - ((let ((v1-146 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (and (or (or (= v1-146 (-> self draw art-group data 38)) - (= v1-146 (-> self draw art-group data 71)) - (= v1-146 (-> self draw art-group data 58)) - (= v1-146 (-> self draw art-group data 62)) - (= v1-146 (-> self draw art-group data 65)) - (= v1-146 (-> self draw art-group data 68)) + ((let ((v1-146 (ja-group))) + (and (or (or (= v1-146 eichar-jump-loop-ja) + (= v1-146 eichar-wheel-flip-ja) + (= v1-146 eichar-attack-from-jump-end-ja) + (= v1-146 eichar-attack-uppercut-ja) + (= v1-146 eichar-flop-down-land-ja) + (= v1-146 eichar-moving-flop-down-land-ja) ) - (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - (< 30.0 (ja-aframe-num 0)) - ) + (and (ja-group? eichar-jump-ja) (< 30.0 (ja-aframe-num 0))) ) (< 12288.0 (-> self control unknown-float01)) ) ) - (let ((s5-4 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) + (let ((s5-4 (ja-group)) (f30-2 (-> self control ground-impact-vel)) ) - (case (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (((-> self draw art-group data 71) (-> self draw art-group data 58)) - (ja-channel-push! 1 15) + (case (ja-group) + ((eichar-wheel-flip-ja eichar-attack-from-jump-end-ja) + (ja-channel-push! 1 (seconds 0.05)) ) (else (ja-channel-set! 1) ) ) (cond - ((< (if (= s5-4 (-> self draw art-group data 34)) - (-> (new 'static 'array float 1 77824.0) 0) - (-> (new 'static 'array float 1 102400.0) 0) - ) + ((< (the-as float (if (= s5-4 eichar-jump-ja) + 77824.0 + 102400.0 + ) + ) f30-2 ) - (let ((s5-5 (-> self skel root-channel 0))) - (set! (-> s5-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 28))) - (set! (-> s5-5 param 0) (ja-aframe (-> (new 'static 'array float 1 3.0) 0) 0)) - (set! (-> s5-5 param 1) 1.00001) - (set! (-> s5-5 frame-num) 0.0) - (joint-control-channel-group! s5-5 (the-as art-joint-anim (-> self draw art-group data 28)) num-func-seek!) - ) + (ja-no-eval :group! eichar-run-squash-ja + :num! (seek! (ja-aframe (the-as float 3.0) 0) 1.00001) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((s5-6 (-> self skel root-channel 0))) - (set! (-> s5-6 param 0) (ja-aframe (-> (new 'static 'array float 1 3.0) 0) 0)) - (set! (-> s5-6 param 1) 1.00001) - (joint-control-channel-group-eval! s5-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 3.0) 0) 1.00001)) ) ) - ((< (if (= s5-4 (-> self draw art-group data 34)) - (-> (new 'static 'array float 1 61440.0) 0) - (-> (new 'static 'array float 1 102400.0) 0) - ) + ((< (the-as float (if (= s5-4 eichar-jump-ja) + 61440.0 + 102400.0 + ) + ) f30-2 ) - (let ((s5-7 (-> self skel root-channel 0))) - (set! (-> s5-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 28))) - (set! (-> s5-7 param 0) (ja-aframe (-> (new 'static 'array float 1 3.0) 0) 0)) - (set! (-> s5-7 param 1) 1.00001) - (set! (-> s5-7 frame-num) (ja-aframe (-> (new 'static 'array float 1 -1.0) 0) 0)) - (joint-control-channel-group! s5-7 (the-as art-joint-anim (-> self draw art-group data 28)) num-func-seek!) - ) + (ja-no-eval :group! eichar-run-squash-ja + :num! (seek! (ja-aframe (the-as float 3.0) 0) 1.00001) + :frame-num (ja-aframe (the-as float -1.0) 0) + ) (until (ja-done? 0) (suspend) - (let ((s5-8 (-> self skel root-channel 0))) - (set! (-> s5-8 param 0) (ja-aframe (-> (new 'static 'array float 1 3.0) 0) 0)) - (set! (-> s5-8 param 1) 1.00001) - (joint-control-channel-group-eval! s5-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 3.0) 0) 1.00001)) ) ) (else - (let ((s5-9 (-> self skel root-channel 0))) - (set! (-> s5-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 29))) - (set! (-> s5-9 param 0) (ja-aframe (the-as float 4.0) 0)) - (set! (-> s5-9 param 1) 1.00001) - (set! (-> s5-9 frame-num) 0.0) - (joint-control-channel-group! s5-9 (the-as art-joint-anim (-> self draw art-group data 29)) num-func-seek!) - ) + (ja-no-eval :group! eichar-run-squash-weak-ja + :num! (seek! (ja-aframe (the-as float 4.0) 0) 1.00001) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((s5-10 (-> self skel root-channel 0))) - (set! (-> s5-10 param 0) (ja-aframe (the-as float 4.0) 0)) - (set! (-> s5-10 param 1) 1.00001) - (joint-control-channel-group-eval! s5-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 4.0) 0) 1.00001)) ) ) ) ) (until (ja-done? 0) (suspend) - (let ((a0-116 (-> self skel root-channel 0))) - (set! (-> a0-116 param 0) (the float (+ (-> a0-116 frame-group data 0 length) -1))) - (set! (-> a0-116 param 1) - (/ (* (fmax 20480.0 (-> self control unknown-float01)) (-> *display* seconds-per-frame)) - (/ (-> *TARGET-bank* run-up-cycle-dist) (-> *TARGET-bank* run-cycle-length)) - ) - ) - (joint-control-channel-group-eval! a0-116 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (/ (* (fmax 20480.0 (-> self control unknown-float01)) (-> *display* seconds-per-frame)) + (/ (-> *TARGET-bank* run-up-cycle-dist) (-> *TARGET-bank* run-cycle-length)) + ) + ) + ) ) (set! f28-0 30.0) - (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) + (set! f30-0 1.0) (ja-channel-set! 7) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - (ja-channel-push! 7 15) + ((ja-group? eichar-jump-ja) + (ja-channel-push! 7 (seconds 0.05)) (set! gp-0 #t) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 78) - ) - (ja-channel-push! 7 45) + ((ja-group? eichar-smack-surface-ja) + (ja-channel-push! 7 (seconds 0.15)) ) (else - (ja-channel-push! 7 15) + (ja-channel-push! 7 (seconds 0.05)) ) ) ) @@ -1400,93 +825,50 @@ ) (set! (-> self skel root-channel 3 command) 'push) (set! (-> self skel root-channel 6 command) 'stack) - (let ((v1-265 (-> self skel root-channel 0))) - (set! (-> v1-265 frame-group) (the-as art-joint-anim (-> self draw art-group data 23))) - ) + (ja :group! eichar-walk-ja) (let ((f28-1 (ja-aframe f28-0 0))) - (let ((s5-11 (-> self skel root-channel 0))) - (set! (-> s5-11 frame-interp) 0.0) - (set! (-> s5-11 dist) (-> *TARGET-bank* walk-cycle-dist)) - (joint-control-channel-group-eval! - s5-11 - (the-as art-joint-anim (-> self draw art-group data 23)) - num-func-identity + (ja :group! eichar-walk-ja :num! (identity f28-1) :frame-interp 0.0 :dist (-> *TARGET-bank* walk-cycle-dist)) + (ja :chan 1 + :group! eichar-walk-down-ja + :num! (identity f28-1) + :frame-interp 0.0 + :dist (-> *TARGET-bank* walk-down-cycle-dist) ) - (set! (-> s5-11 frame-num) f28-1) - ) - (let ((s5-12 (-> self skel root-channel 1))) - (set! (-> s5-12 frame-interp) 0.0) - (set! (-> s5-12 dist) (-> *TARGET-bank* walk-down-cycle-dist)) - (joint-control-channel-group-eval! - s5-12 - (the-as art-joint-anim (-> self draw art-group data 25)) - num-func-identity + (ja :chan 2 + :group! eichar-walk-left-ja + :num! (identity f28-1) + :frame-interp 0.0 + :dist (-> *TARGET-bank* walk-side-cycle-dist) ) - (set! (-> s5-12 frame-num) f28-1) - ) - (let ((s5-13 (-> self skel root-channel 2))) - (set! (-> s5-13 frame-interp) 0.0) - (set! (-> s5-13 dist) (-> *TARGET-bank* walk-side-cycle-dist)) - (joint-control-channel-group-eval! - s5-13 - (the-as art-joint-anim (-> self draw art-group data 27)) - num-func-identity + (ja :chan 4 + :group! eichar-run-down-ja + :num! (identity f28-1) + :frame-interp 0.0 + :dist (-> *TARGET-bank* run-down-cycle-dist) ) - (set! (-> s5-13 frame-num) f28-1) - ) - (let ((s5-14 (-> self skel root-channel 4))) - (set! (-> s5-14 frame-interp) 0.0) - (set! (-> s5-14 dist) (-> *TARGET-bank* run-down-cycle-dist)) - (joint-control-channel-group-eval! - s5-14 - (the-as art-joint-anim (-> self draw art-group data 20)) - num-func-identity + (ja :chan 5 + :group! eichar-run-left-ja + :num! (identity f28-1) + :frame-interp 0.0 + :dist (-> *TARGET-bank* run-side-cycle-dist) ) - (set! (-> s5-14 frame-num) f28-1) - ) - (let ((s5-15 (-> self skel root-channel 5))) - (set! (-> s5-15 frame-interp) 0.0) - (set! (-> s5-15 dist) (-> *TARGET-bank* run-side-cycle-dist)) - (joint-control-channel-group-eval! - s5-15 - (the-as art-joint-anim (-> self draw art-group data 22)) - num-func-identity + (ja :chan 3 + :group! eichar-run-ja + :num! (identity f28-1) + :frame-interp 0.0 + :dist (-> *TARGET-bank* run-cycle-dist) ) - (set! (-> s5-15 frame-num) f28-1) - ) - (let ((s5-16 (-> self skel root-channel 3))) - (set! (-> s5-16 frame-interp) 0.0) - (set! (-> s5-16 dist) (-> *TARGET-bank* run-cycle-dist)) - (joint-control-channel-group-eval! - s5-16 - (the-as art-joint-anim (-> self draw art-group data 18)) - num-func-identity - ) - (set! (-> s5-16 frame-num) f28-1) - ) ) (let ((f28-2 0.0) (f26-1 0.0) ) - (while #t - (let ((f22-0 (fmax - (-> (new 'static 'array float 1 -1.0) 0) - (fmin (-> (new 'static 'array float 1 1.0) 0) (* 2.0 (-> self control unknown-float61))) - ) - ) - (f24-0 (fmax - (-> (new 'static 'array float 1 -1.0) 0) - (fmin (-> (new 'static 'array float 1 1.0) 0) (* 1.6 (-> self control unknown-float62))) - ) - ) + (loop + (let ((f22-0 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control unknown-float61))))) + (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control unknown-float62))))) ) (set! f30-0 (seek f30-0 - (fmax 0.0 (fmin - (-> (new 'static 'array float 1 1.0) 0) - (* 0.000048828126 (+ -16384.0 (-> self control unknown-float01))) - ) - ) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control unknown-float01))))) (* 2.0 (-> *display* seconds-per-frame)) ) ) @@ -1507,84 +889,59 @@ ) (cond ((>= f28-2 0.0) - (let ((v1-329 (-> self skel root-channel 1))) - (set! (-> v1-329 frame-interp) (fabs f28-2)) - (set! (-> v1-329 dist) (-> *TARGET-bank* walk-up-cycle-dist)) - (set! (-> v1-329 frame-group) (the-as art-joint-anim (-> self draw art-group data 24))) - ) - (let ((v1-332 (-> self skel root-channel 4))) - (set! (-> v1-332 frame-interp) (fabs f28-2)) - (set! (-> v1-332 dist) (-> *TARGET-bank* run-up-cycle-dist)) - (set! (-> v1-332 frame-group) (the-as art-joint-anim (-> self draw art-group data 19))) - ) + (ja :chan 1 :group! eichar-walk-up-ja :frame-interp (fabs f28-2) :dist (-> *TARGET-bank* walk-up-cycle-dist)) + (ja :chan 4 :group! eichar-run-up-ja :frame-interp (fabs f28-2) :dist (-> *TARGET-bank* run-up-cycle-dist)) ) (else - (let ((v1-335 (-> self skel root-channel 1))) - (set! (-> v1-335 frame-interp) (fabs f28-2)) - (set! (-> v1-335 dist) (-> *TARGET-bank* walk-down-cycle-dist)) - (set! (-> v1-335 frame-group) (the-as art-joint-anim (-> self draw art-group data 25))) - ) - (let ((v1-338 (-> self skel root-channel 4))) - (set! (-> v1-338 frame-interp) (fabs f28-2)) - (set! (-> v1-338 dist) (-> *TARGET-bank* run-down-cycle-dist)) - (set! (-> v1-338 frame-group) (the-as art-joint-anim (-> self draw art-group data 20))) - ) + (ja :chan 1 + :group! eichar-walk-down-ja + :frame-interp (fabs f28-2) + :dist (-> *TARGET-bank* walk-down-cycle-dist) + ) + (ja :chan 4 + :group! eichar-run-down-ja + :frame-interp (fabs f28-2) + :dist (-> *TARGET-bank* run-down-cycle-dist) + ) ) ) (cond ((>= f26-1 0.0) - (let ((v1-341 (-> self skel root-channel 2))) - (set! (-> v1-341 frame-interp) (fabs f26-1)) - (set! (-> v1-341 dist) (-> *TARGET-bank* walk-side-cycle-dist)) - (set! (-> v1-341 frame-group) (the-as art-joint-anim (-> self draw art-group data 26))) - ) - (let ((v1-344 (-> self skel root-channel 5))) - (set! (-> v1-344 frame-interp) (fabs f26-1)) - (set! (-> v1-344 dist) (-> *TARGET-bank* run-side-cycle-dist)) - (set! (-> v1-344 frame-group) (the-as art-joint-anim (-> self draw art-group data 21))) - ) + (ja :chan 2 + :group! eichar-walk-right-ja + :frame-interp (fabs f26-1) + :dist (-> *TARGET-bank* walk-side-cycle-dist) + ) + (ja :chan 5 + :group! eichar-run-right-ja + :frame-interp (fabs f26-1) + :dist (-> *TARGET-bank* run-side-cycle-dist) + ) ) (else - (let ((v1-347 (-> self skel root-channel 2))) - (set! (-> v1-347 frame-interp) (fabs f26-1)) - (set! (-> v1-347 dist) (-> *TARGET-bank* walk-side-cycle-dist)) - (set! (-> v1-347 frame-group) (the-as art-joint-anim (-> self draw art-group data 27))) - ) - (let ((v1-350 (-> self skel root-channel 5))) - (set! (-> v1-350 frame-interp) (fabs f26-1)) - (set! (-> v1-350 dist) (-> *TARGET-bank* run-side-cycle-dist)) - (set! (-> v1-350 frame-group) (the-as art-joint-anim (-> self draw art-group data 22))) - ) + (ja :chan 2 + :group! eichar-walk-left-ja + :frame-interp (fabs f26-1) + :dist (-> *TARGET-bank* walk-side-cycle-dist) + ) + (ja :chan 5 + :group! eichar-run-left-ja + :frame-interp (fabs f26-1) + :dist (-> *TARGET-bank* run-side-cycle-dist) + ) ) ) (set! (-> self skel root-channel 6 frame-interp) f30-0) - (let* ((f1-19 (dummy-9 (-> self skel))) + (let* ((f1-19 (current-cycle-distance (-> self skel))) (f0-92 (/ (-> self control unknown-float01) (* 60.0 (/ f1-19 (-> *TARGET-bank* run-cycle-length))))) - (a0-182 (-> self skel root-channel 0)) ) - (set! (-> a0-182 param 0) f0-92) - (joint-control-channel-group-eval! a0-182 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((a0-183 (-> self skel root-channel 1))) - (set! (-> a0-183 param 0) 0.0) - (joint-control-channel-group-eval! a0-183 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-184 (-> self skel root-channel 2))) - (set! (-> a0-184 param 0) 0.0) - (joint-control-channel-group-eval! a0-184 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-185 (-> self skel root-channel 3))) - (set! (-> a0-185 param 0) 0.0) - (joint-control-channel-group-eval! a0-185 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-186 (-> self skel root-channel 4))) - (set! (-> a0-186 param 0) 0.0) - (joint-control-channel-group-eval! a0-186 (the-as art-joint-anim #f) num-func-chan) - ) - (let ((a0-187 (-> self skel root-channel 5))) - (set! (-> a0-187 param 0) 0.0) - (joint-control-channel-group-eval! a0-187 (the-as art-joint-anim #f) num-func-chan) + (ja :num! (loop! f0-92)) ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + (ja :chan 3 :num! (chan 0)) + (ja :chan 4 :num! (chan 0)) + (ja :chan 5 :num! (chan 0)) (if (and gp-0 (!= (-> self skel root-channel 0) (-> self skel channel))) (ja-blend-eval) ) @@ -1594,32 +951,27 @@ ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-turn-around (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () (vector-turn-to (-> self control transv)) (set! (-> self control unknown-surface00) *turn-around-mods*) - (set! (-> self control unknown-float81) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> self control unknown-float81) 1.0) (none) ) - :exit - (behavior () + :exit (behavior () (target-state-hook-exit) - (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + (set-forward-vel (the-as float 0.0)) (set! (-> self control unknown-float01) 0.0) (set-quaternion! (-> self control) (-> self control dir-targ)) (set! (-> self control unknown-float81) 0.0) (none) ) - :trans - (behavior () + :trans (behavior () ((-> self state-hook)) (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) @@ -1638,7 +990,7 @@ (if (can-hands? #t) (go target-running-attack) ) - (if (and (zero? (logand (-> self control status) 1)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.08)) ) (go target-falling #f) @@ -1646,34 +998,16 @@ (slide-down-test) (none) ) - :code - (behavior () - (ja-channel-push! 1 12) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 33)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! eichar-turn-around-ja :num! min) (quaternion-rotate-y! (-> self control dir-targ) (-> self control dir-targ) (the-as float 32768.0)) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 2.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 - (-> self align) - 16 - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - ) + (ja :num! (seek! max 2.0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) ) (remove-exit) (set! (-> self control unknown-float81) 0.0) @@ -1683,75 +1017,51 @@ (go target-walk) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-slide-down (target) - :event - target-walk-event-handler - :enter - (behavior () + :event target-walk-event-handler + :enter (behavior () (set! (-> self control unknown-surface00) *jump-mods*) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control unknown-dword35) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () - (when (or (logtest? (-> self control status) 1) + :trans (behavior () + (when (or (logtest? (-> self control status) (cshape-moving-flags onsurf)) (if (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) #t ) ) - (logior! (-> self control status) 1) + (logior! (-> self control status) (cshape-moving-flags onsurf)) (go target-duck-stance) ) (none) ) - :code - (behavior () - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 31) - ) - ) - (ja-channel-push! 1 30) - ) - (while #t - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 31))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 31)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 31)) num-func-seek!) + :code (behavior () + (if (not (ja-group? eichar-duck-stance-ja)) + (ja-channel-push! 1 (seconds 0.1)) ) + (loop + (ja-no-eval :group! eichar-duck-stance-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; definition for function init-var-jump ;; Used lq/sq (defbehavior init-var-jump target ((arg0 float) (arg1 float) (arg2 vector) (arg3 vector) (arg4 vector)) - (set! (-> self control status) (logand -16385 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags csmf14)) (delete-back-vel) (when (< (- (-> *display* base-frame-counter) (-> self control rider-time)) (seconds 0.05)) (let ((f0-1 @@ -1764,7 +1074,7 @@ (set! arg0 (+ arg0 f0-1)) (set! arg1 (+ arg1 f0-1)) ) - (when (or (logtest? (-> self control unknown-surface01 flags) #x4000) + (when (or (logtest? (-> self control unknown-surface01 flags) (surface-flags moving-ground)) (= (-> self control poly-pat material) (pat-material rotate)) ) (+! (-> self control transv x) (-> self control rider-last-move x)) @@ -1819,8 +1129,8 @@ (local-vars (v0-2 vector)) (let ((f30-0 (* 0.033333335 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) (cond - ((or (< (-> (new 'static 'array float 1 1.0) 0) f30-0) (< (-> self control unknown-float123) 0.0) (not arg2)) - (set! (-> self control unknown-float123) (-> (new 'static 'array float 1 -1.0) 0)) + ((or (< 1.0 f30-0) (< (-> self control unknown-float123) 0.0) (not arg2)) + (set! (-> self control unknown-float123) -1.0) ) (else (set! (-> self control unknown-float123) f30-0) @@ -1843,8 +1153,8 @@ (the-as float (-> self control unknown-uint20)) (the-as float (-> self control unknown-uint30)) f30-0 - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 0.0) + (the-as float 1.0) ) (vector-dot (-> self control dynam gravity-normal) s3-1) ) @@ -1866,31 +1176,8 @@ ) ) 0 - (when (and arg1 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (and (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - extra - ) - #t - ) - ) - (let ((v1-57 (res-lump-struct - (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - extra - ) - 'collide-offset - vector - :time - (ja-frame-num 0) - ) - ) - ) + (when (and arg1 (ja-group) (and (-> (ja-group) extra) #t)) + (let ((v1-57 (res-lump-struct (-> (ja-group) extra) 'collide-offset vector :time (ja-frame-num 0)))) (cond (v1-57 (set! v0-2 (-> self control unknown-vector13)) @@ -1908,17 +1195,14 @@ ;; failed to figure out what this is: (defstate target-duck-stance (target) - :event - target-standard-event-handler - :enter - (behavior () - (set! (-> self control unknown-float81) (-> (new 'static 'array float 1 1.0) 0)) + :event target-standard-event-handler + :enter (behavior () + (set! (-> self control unknown-float81) 1.0) (set! (-> self control unknown-surface00) *duck-mods*) - (target-collide-set! 'duck (-> (new 'static 'array float 1 1.0) 0)) + (target-collide-set! 'duck (the-as float 1.0)) (none) ) - :exit - (behavior () + :exit (behavior () (if (not (or (= (-> self next-state name) 'target-duck-walk) (= (-> self next-state name) 'target-duck-stance) (= (-> self next-state name) 'target-walk) @@ -1929,25 +1213,17 @@ (target-state-hook-exit) ) (target-exit) - (target-collide-set! 'normal (-> (new 'static 'array float 1 0.0) 0)) + (target-collide-set! 'normal (the-as float 0.0)) (none) ) - :trans - (behavior () + :trans (behavior () ((-> self state-hook)) - (if (and (or (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) - (logtest? (-> self state-flags) 8192) + (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) + ) + (logtest? (-> self state-flags) (state-flags prevent-duck)) ) - (let ((v1-13 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (and (not (or (= v1-13 (-> self draw art-group data 70)) (= v1-13 (-> self draw art-group data 69)))) - (can-exit-duck?) - ) + (let ((v1-13 (ja-group))) + (and (not (or (= v1-13 eichar-duck-roll-end-ja) (= v1-13 eichar-duck-roll-ja))) (can-exit-duck?)) ) ) (go target-stance) @@ -1980,121 +1256,59 @@ (slide-down-test) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 69) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 70))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 70)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 70)) num-func-seek!) - ) + ((ja-group? eichar-duck-roll-ja) + (ja-no-eval :group! eichar-duck-roll-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 31) - ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) + ((and (ja-group? eichar-duck-stance-ja) (= (-> self skel root-channel 0) (-> self skel channel))) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 32) - ) - (ja-channel-push! 1 30) + ((ja-group? eichar-duck-walk-ja) + (ja-channel-push! 1 (seconds 0.1)) ) (else - (ja-channel-push! 1 12) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 30))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 30)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! eichar-stance-to-duck-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (while #t - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 31))) - (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 31)) data 0 length) -1)) - ) - (set! (-> a0-22 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 31)) num-func-seek!) - ) + (loop + (ja-no-eval :group! eichar-duck-stance-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-duck-walk (target) - :event - target-standard-event-handler - :enter - (behavior () - (set! (-> self control unknown-float81) (-> (new 'static 'array float 1 1.0) 0)) - (target-collide-set! 'duck (-> (new 'static 'array float 1 1.0) 0)) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 69) - ) - ) + :event target-standard-event-handler + :enter (behavior () + (set! (-> self control unknown-float81) 1.0) + (target-collide-set! 'duck (the-as float 1.0)) + (if (not (ja-group? eichar-duck-roll-ja)) (set! (-> self control unknown-surface00) *duck-mods*) ) (none) ) - :exit - (-> target-duck-stance exit) - :trans - (behavior () + :exit (-> target-duck-stance exit) + :trans (behavior () ((-> self state-hook)) - (if (and (or (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) - (logtest? (-> self state-flags) 8192) - (and (logtest? (-> self water flags) 1024) + (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) + ) + (logtest? (-> self state-flags) (state-flags prevent-duck)) + (and (logtest? (-> self water flags) (water-flags wt10)) (>= (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) ) ) @@ -2130,73 +1344,40 @@ (slide-down-test) (none) ) - :code - (behavior () + :code (behavior () (cond - ((and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 32) - ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) + ((and (ja-group? eichar-duck-walk-ja) (= (-> self skel root-channel 0) (-> self skel channel))) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 31) - ) - (ja-channel-push! 1 135) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 32)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + ((ja-group? eichar-duck-stance-ja) + (ja-channel-push! 1 (seconds 0.45)) + (ja :group! eichar-duck-walk-ja :num! min) ) (else - (ja-channel-push! 1 30) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 32)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! eichar-duck-walk-ja :num! min) ) ) - (while #t + (loop (if (= (-> self skel root-channel 0) (-> self skel channel)) (set! (-> self control unknown-surface00) *duck-mods*) ) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) - (fmin - (-> (new 'static 'array float 1 1.0) 0) - (/ (-> self control unknown-float01) - (* 60.0 (/ (-> *TARGET-bank* duck-walk-cycle-dist) (-> *TARGET-bank* run-cycle-length))) - ) - ) - ) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! (fmin 1.0 (/ (-> self control unknown-float01) + (* 60.0 (/ (-> *TARGET-bank* duck-walk-cycle-dist) (-> *TARGET-bank* run-cycle-length))) + ) + ) + ) + ) (suspend) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-jump (target) - :event - target-jump-event-handler - :enter - (behavior ((arg0 float) (arg1 float) (arg2 surface)) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 surface)) (when (= (-> self control unknown-symbol40) 'launch) (level-hint-spawn (game-text-id daxter-screaming-jump) @@ -2240,9 +1421,9 @@ ) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 716 0 0 1 #t) + (sound-play "jump" :vol 70) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! arg2 (cond (arg2 (empty) @@ -2255,38 +1436,22 @@ ) (set! (-> self control unknown-surface00) arg2) (set! (-> self control unknown-float123) - (fmax - 0.0 - (fmin - (-> (new 'static 'array float 1 1.0) 0) - (* 0.00004359654 (+ -11468.8 (-> self control unknown-float01))) - ) - ) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float01))))) ) (set! (-> self control unknown-float122) - (fmax 0.0 (fmin - (-> (new 'static 'array float 1 1.0) 0) - (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))) - ) - ) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) ) (none) ) - :exit - target-exit - :trans - (behavior () + :exit target-exit + :trans (behavior () (set! (-> self control unknown-float123) (fmax (-> self control unknown-float123) (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) ) ) - (target-falling-trans #f (the-as time-frame (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) + (target-falling-trans #f (the-as time-frame (if (ja-group? eichar-jump-loop-ja) 15 -1 ) @@ -2295,8 +1460,8 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 12288.0) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (zero? (logand (-> self water flags) 512)) - (zero? (logand (-> self state-flags) 2048)) + (zero? (logand (-> self water flags) (water-flags wt09))) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) ) ) (go target-double-jump (-> *TARGET-bank* double-jump-height-min) (-> *TARGET-bank* double-jump-height-max)) @@ -2307,8 +1472,9 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) + (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -2316,7 +1482,7 @@ (the-as float 65502.96) (the-as float -163840.0) (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (-> (new 'static 'array float 1 0.0) 0) + 0.0 68812.8 ) ) @@ -2324,56 +1490,20 @@ ) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) (slide-down-test) - (set! (-> self control unknown-float122) - (seek - (-> self control unknown-float122) - (fmax 0.0 (fmin - (-> (new 'static 'array float 1 1.0) 0) - (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))) - ) - ) - (-> *display* seconds-per-frame) - ) - ) + (seek! + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) (none) ) - :code - (behavior ((arg0 float) (arg1 float) (arg2 surface)) - (ja-channel-push! 2 15) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 34)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-3 (-> self skel root-channel 1))) - (set! (-> a0-3 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 40))) - (set! (-> a0-3 param 0) 0.0) - (joint-control-channel-group-eval! - a0-3 - (the-as art-joint-anim (-> self draw art-group data 40)) - num-func-chan - ) - ) + :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) + (ja-channel-push! 2 (seconds 0.05)) + (ja :group! eichar-jump-ja :num! min) + (ja :chan 1 :group! eichar-jump-forward-ja :num! (chan 0) :frame-interp (-> self control unknown-float122)) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) - (set! (-> a0-4 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-+!) - ) - (let ((a0-5 (-> self skel root-channel 1))) - (set! (-> a0-5 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 40))) - (set! (-> a0-5 param 0) 0.0) - (joint-control-channel-group-eval! - a0-5 - (the-as art-joint-anim (-> self draw art-group data 40)) - num-func-chan - ) - ) + (ja :group! eichar-jump-ja :num! (+!)) + (ja :chan 1 :group! eichar-jump-forward-ja :num! (chan 0) :frame-interp (-> self control unknown-float122)) (suspend) (until (ja-done? 0) (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -2382,96 +1512,59 @@ ) (set! (-> gp-1 param 0) (the float (+ (-> gp-1 frame-group data 0 length) -1))) (let ((v1-45 (and (< 0.0 f30-0) (< 0.0 f0-8)))) - (set! (-> gp-1 param 1) (if v1-45 - (fmin - (fmin (-> (new 'static 'array float 1 3.0) 0) f0-8) - (/ (* 5.0 f0-8) (the float (time-to-apex f30-0 (the-as float -245760.0)))) - ) - (-> (new 'static 'array float 1 1.0) 0) - ) + (set! (-> gp-1 param 1) + (the-as + float + (if v1-45 + (fmin (fmin 3.0 f0-8) (/ (* 5.0 f0-8) (the float (time-to-apex f30-0 (the-as float -245760.0))))) + 1.0 + ) + ) ) ) (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) ) - (let ((a0-10 (-> self skel root-channel 1))) - (set! (-> a0-10 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-10 param 0) 0.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) (suspend) ) - (target-falling-anim -1 60) + (target-falling-anim -1 (seconds 0.2)) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-jump-forward (target) - :event - target-jump-event-handler - :enter - (behavior ((arg0 float) (arg1 float)) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float)) ((-> target-jump enter) arg0 arg1 (the-as surface #f)) (set! (-> self control unknown-surface00) *forward-jump-mods*) (none) ) - :exit - target-exit - :trans - (-> target-jump trans) - :code - (behavior ((arg0 float) (arg1 float)) + :exit target-exit + :trans (-> target-jump trans) + :code (behavior ((arg0 float) (arg1 float)) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) (ja-aframe (-> (new 'static 'array float 1 3.0) 0) 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-seek!) - ) + (ja-no-eval :group! eichar-jump-ja :num! (seek!) :frame-num (ja-aframe (the-as float 3.0) 0)) (until (ja-done? 0) (set! (-> self control unknown-dword70) 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-6 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-loop!) - ) - (while #t + (ja-no-eval :group! eichar-jump-loop-ja :num! (loop!) :frame-num 0.0) + (loop (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-7 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! - a0-7 - (the-as art-joint-anim (-> self draw art-group data 38)) - num-func-loop! - ) - ) + (ja :group! eichar-jump-loop-ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-double-jump (target) - :event - target-jump-event-handler - :enter - (behavior ((arg0 float) (arg1 float)) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float)) (when (= (-> self control unknown-symbol40) 'launch) enter-state (let ((a0-3 (-> self control unknown-dword60)) @@ -2484,19 +1577,13 @@ ) (set! (-> self state-time) (-> *display* base-frame-counter)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *double-jump-mods*) (none) ) - :exit - target-exit - :trans - (behavior () - (target-falling-trans #f (the-as time-frame (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) + :exit target-exit + :trans (behavior () + (target-falling-trans #f (the-as time-frame (if (ja-group? eichar-jump-loop-ja) 15 -1 ) @@ -2508,8 +1595,9 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) + (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -2517,7 +1605,7 @@ (the-as float 33775.48) (the-as float -122880.0) (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (-> (new 'static 'array float 1 0.0) 0) + 0.0 68812.8 ) ) @@ -2526,67 +1614,33 @@ (if (!= (-> self state-time) (-> *display* base-frame-counter)) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) ) - (set! (-> self control unknown-float122) - (seek - (-> self control unknown-float122) - (fmax 0.0 (fmin - (-> (new 'static 'array float 1 1.0) 0) - (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))) - ) - ) - (-> *display* seconds-per-frame) - ) - ) + (seek! + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (ja-channel-push! 2 15) - (dummy-10 (-> self skel effect) 'jump-double (-> (new 'static 'array float 1 -1.0) 0) -1) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) (ja-aframe (the-as float 5.0) 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-seek!) - ) - (let ((a0-5 (-> self skel root-channel 1))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 40))) - (set! (-> a0-5 param 0) 0.0) - (joint-control-channel-group-eval! - a0-5 - (the-as art-joint-anim (-> self draw art-group data 40)) - num-func-chan - ) - ) + :code (behavior ((arg0 float) (arg1 float)) + (ja-channel-push! 2 (seconds 0.05)) + (dummy-10 (-> self skel effect) 'jump-double (the-as float -1.0) -1) + (ja-no-eval :group! eichar-jump-ja :num! (seek!) :frame-num (ja-aframe (the-as float 5.0) 0)) + (ja :chan 1 :group! eichar-jump-forward-ja :num! (chan 0)) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((a0-7 (-> self skel root-channel 1))) - (set! (-> a0-7 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-7 param 0) 0.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (seek!)) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) ) - (target-falling-anim -1 60) + (target-falling-anim -1 (seconds 0.2)) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-high-jump (target) - :event - target-jump-event-handler - :enter - (behavior ((arg0 float) (arg1 float) (arg2 basic)) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 basic)) (when (and (= (-> self control unknown-symbol40) 'launch) (!= arg2 'launch)) enter-state (let ((a0-3 (-> self control unknown-dword60)) @@ -2602,8 +1656,8 @@ (go target-duck-high-jump arg0 arg1 (the-as symbol arg2)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self control status) (logand -8 (-> self control status))) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 457 0 1 #t) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) + (sound-play "jump" :pitch 0.3) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (set! (-> self control unknown-surface00) (cond ((= arg2 'flip) @@ -2622,15 +1676,9 @@ ) (none) ) - :exit - target-exit - :trans - (behavior () - (target-falling-trans #f (the-as time-frame (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) + :exit target-exit + :trans (behavior () + (target-falling-trans #f (the-as time-frame (if (ja-group? eichar-jump-loop-ja) 15 -1 ) @@ -2648,8 +1696,9 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) + (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -2657,109 +1706,68 @@ (the-as float 33775.48) (the-as float -122880.0) (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (-> (new 'static 'array float 1 0.0) 0) + 0.0 68812.8 ) ) ) ) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) - (set! (-> self control unknown-float122) - (seek - (-> self control unknown-float122) - (fmax - 0.0 - (fmin (-> (new 'static 'array float 1 1.0) 0) (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01)))) - ) - (-> *display* seconds-per-frame) - ) - ) + (seek! + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) (none) ) - :code - (-> target-jump code) - :post - (the-as (function none :behavior target) target-post) + :code (-> target-jump code) + :post target-post ) ;; failed to figure out what this is: (defstate target-duck-high-jump (target) - :event - target-standard-event-handler - :enter - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + :event target-standard-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *turn-around-mods*) (none) ) - :exit - target-exit - :code - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) - (if (not (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 31) - ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) - ) - (ja-channel-push! 1 12) + :exit target-exit + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (if (not (and (ja-group? eichar-duck-stance-ja) (= (-> self skel root-channel 0) (-> self skel channel)))) + (ja-channel-push! 1 (seconds 0.04)) ) (case arg2 (('launch) - (let ((s3-0 (-> self skel root-channel 0))) - (set! (-> s3-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 42))) - (set! (-> s3-0 param 0) (ja-aframe (the-as float 16.0) 0)) - (set! (-> s3-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> s3-0 frame-num) 0.0) - (joint-control-channel-group! s3-0 (the-as art-joint-anim (-> self draw art-group data 42)) num-func-seek!) - ) + (ja-no-eval :group! eichar-launch-jump-ja :num! (seek! (ja-aframe (the-as float 16.0) 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((s3-1 (-> self skel root-channel 0))) - (set! (-> s3-1 param 0) (ja-aframe (the-as float 16.0) 0)) - (set! (-> s3-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! s3-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 16.0) 0))) ) ) (else - (let ((s3-2 (-> self skel root-channel 0))) - (set! (-> s3-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> s3-2 param 0) (ja-aframe (the-as float 16.0) 0)) - (set! (-> s3-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> s3-2 frame-num) 0.0) - (joint-control-channel-group! s3-2 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) - ) + (ja-no-eval :group! eichar-duck-high-jump-ja :num! (seek! (ja-aframe (the-as float 16.0) 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((s3-3 (-> self skel root-channel 0))) - (set! (-> s3-3 param 0) (ja-aframe (the-as float 16.0) 0)) - (set! (-> s3-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! s3-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 16.0) 0))) ) ) ) (go target-duck-high-jump-jump arg0 arg1 arg2) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-duck-high-jump-jump (target) - :event - target-jump-event-handler - :enter - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 819 -609 0 1 #t) + (sound-play "jump" :vol 80 :pitch -0.4) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (cond ((= arg2 'launch) (set! (-> self neck flex-blend) 0.0) @@ -2771,28 +1779,21 @@ ) (none) ) - :exit - target-exit - :trans - (-> target-high-jump trans) - :code - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + :exit target-exit + :trans (-> target-high-jump trans) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((f30-0 (the-as float (if (= arg2 'launch) 110.0 35.0 ) ) ) - (f28-0 (-> (new 'static 'array float 1 1.0) 0)) + (f28-0 1.0) ) (until (ja-done? 0) (let* ((f24-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (f26-0 (- f30-0 (ja-aframe-num 0))) - (f22-1 (fmin - (fmin (-> (new 'static 'array float 1 3.0) 0) f26-0) - (/ (* 5.0 f26-0) (the float (time-to-apex f24-0 (the-as float -245760.0)))) - ) - ) + (f22-1 (fmin (fmin 3.0 f26-0) (/ (* 5.0 f26-0) (the float (time-to-apex f24-0 (the-as float -245760.0)))))) (s5-0 (-> self skel root-channel 0)) ) (set! (-> s5-0 param 0) (the float (+ (-> s5-0 frame-group data 0 length) -1))) @@ -2817,43 +1818,17 @@ ) (cond ((= arg2 'launch) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) - (set! (-> a0-7 param 0) f28-0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 43)) num-func-loop!) - ) - (while #t + (ja-no-eval :group! eichar-launch-jump-loop-ja :num! (loop! f28-0) :frame-num 0.0) + (loop (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) - (set! (-> a0-8 param 0) f28-0) - (joint-control-channel-group-eval! - a0-8 - (the-as art-joint-anim (-> self draw art-group data 43)) - num-func-loop! - ) - ) + (ja :group! eichar-launch-jump-loop-ja :num! (loop! f28-0)) ) ) (else - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-9 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-loop!) - ) - (while #t + (ja-no-eval :group! eichar-jump-loop-ja :num! (loop!) :frame-num 0.0) + (loop (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-10 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! - a0-10 - (the-as art-joint-anim (-> self draw art-group data 38)) - num-func-loop! - ) - ) + (ja :group! eichar-jump-loop-ja :num! (loop!)) ) ) ) @@ -2861,23 +1836,19 @@ (the-as none 0) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-falling (target) - :event - target-jump-event-handler - :enter - (behavior ((arg0 symbol)) + :event target-jump-event-handler + :enter (behavior ((arg0 symbol)) (set! (-> self control unknown-surface00) *jump-mods*) (set! (-> self control unknown-uint20) (the-as uint arg0)) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (target-falling-trans (-> self control unknown-spoolanim00) (the-as time-frame (if (= (-> self control unknown-spoolanim00) #f) @@ -2888,32 +1859,24 @@ ) (none) ) - :code - (behavior ((arg0 symbol)) - (target-falling-anim -1 99) + :code (behavior ((arg0 symbol)) + (target-falling-anim -1 (seconds 0.33)) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-hit-ground (target) - :event - target-walk-event-handler - :enter - (behavior ((arg0 symbol)) + :event target-walk-event-handler + :enter (behavior ((arg0 symbol)) (cond ((= arg0 'stuck) ) - ((let ((v1-4 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-4 (-> self draw art-group data 42)) (= v1-4 (-> self draw art-group data 43))) + ((let ((v1-4 (ja-group))) + (or (= v1-4 eichar-launch-jump-ja) (= v1-4 eichar-launch-jump-loop-ja)) ) - (dummy-10 (-> self skel effect) 'group-blue-hit-ground-effect (-> (new 'static 'array float 1 0.0) 0) -1) + (dummy-10 (-> self skel effect) 'group-blue-hit-ground-effect (the-as float 0.0) -1) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) ) (else @@ -2923,7 +1886,9 @@ ) ) ) - (if (and (< (-> *TARGET-bank* fall-far) f0-1) (zero? (logand (-> self control status) 1024))) + (if (and (< (-> *TARGET-bank* fall-far) f0-1) + (zero? (logand (-> self control status) (cshape-moving-flags on-water))) + ) (go target-hit-ground-hard f0-1) ) ) @@ -2939,7 +1904,7 @@ (set! (-> self control unknown-dword31) 0) (set! (-> self control unknown-dword33) 0) (if (>= (-> self control ground-impact-vel) (-> *TARGET-bank* fall-stumble-threshold)) - (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + (set-forward-vel (the-as float 0.0)) ) (if (!= (-> self control ground-pat material) (pat-material ice)) (delete-back-vel) @@ -2948,19 +1913,18 @@ (start-bobbing! (-> self water) (lerp-scale - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as float 4096.0) (-> self control ground-impact-vel) (the-as float 40960.0) - (-> (new 'static 'array float 1 102400.0) 0) + (the-as float 102400.0) ) 600 1500 ) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) ) @@ -2976,7 +1940,7 @@ (go target-duck-stance) ) (when (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (if (logtest? (-> self water flags) 1024) + (if (logtest? (-> self water flags) (water-flags wt10)) (go target-wade-walk) (go target-walk) ) @@ -2994,22 +1958,18 @@ (slide-down-test) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (target-hit-ground-anim #f) (go target-stance) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-attack (target) - :event - target-dangerous-event-handler - :enter - (behavior () + :event target-dangerous-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (target-start-attack) (target-danger-set! 'spin #f) @@ -3018,27 +1978,20 @@ (set! (-> self neck flex-blend) 0.0) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control unknown-dword33) (-> *display* base-frame-counter)) (target-exit) (none) ) - :code - (behavior () - (ja-channel-push! 1 15) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 51))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 51)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) (-> self control unknown-surface01 align-speed)) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 51)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! eichar-attack-from-stance-ja + :num! (seek! max (-> self control unknown-surface01 align-speed)) + :frame-num 0.0 + ) (until (ja-done? 0) (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (dummy-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 74) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) @@ -3062,23 +2015,17 @@ (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) (-> self control unknown-surface01 align-speed)) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self control unknown-surface01 align-speed))) ) (go target-stance) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-running-attack (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touched) (cond @@ -3138,10 +2085,9 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (if (or (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (< (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 1.5)) ) @@ -3157,12 +2103,11 @@ (target-start-attack) (target-danger-set! 'punch #f) (if (or (< (fabs (-> self control unknown-float62)) 0.3) (< 0.3 (fabs (-> self control unknown-float61)))) - (set! (-> self control unknown-float81) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> self control unknown-float81) 1.0) ) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> *run-attack-mods* turnv) 0.0) @@ -3171,11 +2116,12 @@ (target-exit) (none) ) - :trans - (behavior () + :trans (behavior () (when (!= (-> self state-time) (-> *display* base-frame-counter)) (if (and (or (smack-surface? #t) - (and (>= (-> self control unknown-float63) 0.7) (zero? (logand (-> self control status) 32))) + (and (>= (-> self control unknown-float63) 0.7) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + ) ) (begin (set! (-> self control unknown-int21) (the-as int (-> *display* base-frame-counter))) @@ -3215,14 +2161,13 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (and (< 4096.0 (-> self control unknown-float01)) (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons square) - ) - ) + (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons square) + ) + ) ) - (zero? (logand (-> self state-flags) 6144)) - (zero? (logand (-> self control unknown-surface01 flags) 128)) + (zero? (logand (-> self state-flags) (state-flags prevent-jump prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump))) ) ) (go @@ -3231,7 +2176,7 @@ (-> *TARGET-bank* attack-jump-height-max) ) ) - (if (and (logtest? (-> self water flags) 512) + (if (and (logtest? (-> self water flags) (water-flags wt09)) (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) ) (dummy-13 @@ -3243,7 +2188,7 @@ ) ) (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (dummy-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 23) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) @@ -3258,45 +2203,32 @@ ) (none) ) - :code - (behavior () - (if (logtest? (-> self water flags) 512) - (sound-play-by-name (static-sound-name "swim-stroke") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (if (logtest? (-> self water flags) (water-flags wt09)) + (sound-play "swim-stroke") ) - (ja-channel-push! 1 6) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 59)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! eichar-attack-punch-ja :num! min) (set! (-> self control dynam gravity-max) 368640.0) (set! (-> self control dynam gravity-length) 368640.0) (let ((f28-0 0.0) - (f30-0 (-> (new 'static 'array float 1 1.0) 0)) + (f30-0 1.0) (gp-2 0) ) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (when (not (ja-min? 0)) (cond ((and (>= (ja-aframe-num 0) 20.0) - (and (and (zero? (logand (-> self control status) 1)) + (and (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-39 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (not - (or (= v1-39 (-> self draw art-group data 59)) - (= v1-39 (-> self draw art-group data 60)) - (= v1-39 (-> self draw art-group data 61)) - ) - ) + (let ((v1-39 (ja-group))) + (or (not (or (= v1-39 eichar-attack-punch-ja) + (= v1-39 eichar-attack-punch-end-ja) + (= v1-39 eichar-attack-punch-alt-end-ja) + ) + ) (< 4096.0 (target-height-above-ground)) ) ) @@ -3313,7 +2245,7 @@ (the-as uint 12) ) ) - (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + (set-forward-vel (the-as float 0.0)) ) ((and (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons square) @@ -3343,31 +2275,23 @@ (vector-matrix*! (-> self control unknown-vector120) s5-1 (-> self control unknown-matrix01)) ) (suspend) - (let ((a0-44 (-> self skel root-channel 0))) - (set! (-> a0-44 param 0) (the float (+ (-> a0-44 frame-group data 0 length) -1))) - (set! (-> a0-44 param 1) (-> self control unknown-surface01 align-speed)) - (joint-control-channel-group-eval! a0-44 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self control unknown-surface01 align-speed))) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (set! (-> *run-attack-mods* turnvv) 0.0) ) (if (< 2 gp-2) - (set! f30-0 (* f30-0 (fmin (-> (new 'static 'array float 1 1.0) 0) (-> self control unknown-float140)))) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float140)))) ) (+! gp-2 1) ) ) - (if (and (zero? (logand (-> self control status) 1)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-121 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (not (or (= v1-121 (-> self draw art-group data 59)) - (= v1-121 (-> self draw art-group data 60)) - (= v1-121 (-> self draw art-group data 61)) + (let ((v1-121 (ja-group))) + (or (not (or (= v1-121 eichar-attack-punch-ja) + (= v1-121 eichar-attack-punch-end-ja) + (= v1-121 eichar-attack-punch-alt-end-ja) ) ) (< 4096.0 (target-height-above-ground)) @@ -3379,14 +2303,12 @@ (go target-stance) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-attack-air (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v0-0 (target-bonk-event-handler arg0 arg1 arg2 arg3))) (cond (v0-0 @@ -3399,10 +2321,9 @@ ) ) ) - :enter - (behavior ((arg0 symbol)) + :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (target-start-attack) (target-danger-set! 'spin-air #f) (set! (-> self control unknown-surface00) *jump-attack-mods*) @@ -3430,11 +2351,7 @@ (let* ((f1-5 (/ f0-1 (* (-> self control dynam gravity-length) (-> *display* seconds-per-frame)))) (f30-0 (* 0.5 f1-5 (-> *display* seconds-per-frame) f0-1)) ) - (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 62) - ) + (if (ja-group? eichar-attack-uppercut-ja) (set! f30-0 (fmax 0.0 @@ -3471,26 +2388,23 @@ (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) ((-> target-attack exit)) (none) ) - :trans - (behavior () - (when (logtest? (-> self control status) 1) + :trans (behavior () + (when (logtest? (-> self control status) (cshape-moving-flags onsurf)) (set-quaternion! (-> self control) (-> self control dir-targ)) (go target-hit-ground #f) ) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (set! (-> self control dynam gravity-length) (seek - (-> self control dynam gravity-length) - (-> self control unknown-dynamics00 gravity-length) - (* 245760.0 (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self control dynam gravity-length) + (-> self control unknown-dynamics00 gravity-length) + (* 245760.0 (-> *display* seconds-per-frame)) + ) ) (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) (< (vector-dot (-> self control dynam gravity-normal) (-> self control unknown-vector10)) @@ -3501,7 +2415,7 @@ (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) ) (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (dummy-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 70) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) @@ -3515,74 +2429,36 @@ ) (none) ) - :code - (behavior ((arg0 symbol)) - (ja-channel-push! 1 22) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 56))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 56)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 56)) num-func-seek!) - ) + :code (behavior ((arg0 symbol)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! eichar-attack-from-jump-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 - (-> self align) - 16 - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - ) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 57)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) + (ja :num! (seek!)) ) + (ja :group! eichar-attack-from-jump-loop-ja :num! min) (let ((f30-0 393216.0)) (let ((f0-8 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (while (not - (or (and (< (fabs (/ f0-8 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.7)) - ) - ) + (while (not (or (and (< (fabs (/ f0-8 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.7)) + ) + ) (quaternion-rotate-y! (-> self control unknown-quaternion00) (-> self control unknown-quaternion00) (* f30-0 (-> *display* seconds-per-frame)) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (set! f0-8 (target-height-above-ground)) (set! f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) ) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 58))) - (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 58)) data 0 length) -1)) - ) - (set! (-> a0-13 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> self draw art-group data 58)) num-func-seek!) - ) + (ja-no-eval :group! eichar-attack-from-jump-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (cond ((< (ja-aframe-num 0) 32.0) @@ -3609,75 +2485,51 @@ ) ) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (go target-falling #f) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-attack-uppercut (target) - :event - target-dangerous-event-handler - :enter - (behavior ((arg0 float) (arg1 float)) + :event target-dangerous-event-handler + :enter (behavior ((arg0 float) (arg1 float)) (set! (-> self state-time) (-> *display* base-frame-counter)) (target-start-attack) (target-danger-set! 'uppercut #f) (set! (-> self control unknown-surface00) *turn-around-mods*) (none) ) - :exit - target-exit - :code - (behavior ((arg0 float) (arg1 float)) - (let ((s3-0 (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 31) - ) - ) - (s4-0 (-> self skel root-channel 0)) - ) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 62))) - (set! (-> s4-0 param 0) (ja-aframe (the-as float 7.0) 0)) - (set! (-> s4-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> s4-0 frame-num) (if s3-0 + :exit target-exit + :code (behavior ((arg0 float) (arg1 float)) + (let ((s3-0 (ja-group? eichar-duck-stance-ja))) + (ja-no-eval :group! eichar-attack-uppercut-ja + :num! (seek! (ja-aframe (the-as float 7.0) 0)) + :frame-num (the-as float (if s3-0 (ja-aframe (the-as float 5.0) 0) - (-> (new 'static 'array float 1 0.0) 0) + 0.0 ) - ) - (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> self draw art-group data 62)) num-func-seek!) + ) + ) ) (until (ja-done? 0) (suspend) - (let ((s4-1 (-> self skel root-channel 0))) - (set! (-> s4-1 param 0) (ja-aframe (the-as float 7.0) 0)) - (set! (-> s4-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 7.0) 0))) ) (go target-attack-uppercut-jump arg0 arg1) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-attack-uppercut-jump (target) - :event - target-dangerous-event-handler - :enter - (behavior ((arg0 float) (arg1 float)) + :event target-dangerous-event-handler + :enter (behavior ((arg0 float) (arg1 float)) (if (and (= (-> self control ground-pat material) (pat-material ice)) (< 32768.0 (-> self control unknown-float01)) ) @@ -3685,17 +2537,15 @@ ) (set! (-> self state-time) (-> *display* base-frame-counter)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *uppercut-jump-mods*) (target-start-attack) (target-danger-set! 'uppercut #f) (none) ) - :exit - target-exit - :trans - (behavior () - (if (logtest? (-> self control status) 1) + :exit target-exit + :trans (behavior () + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-hit-ground #f) ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) @@ -3704,8 +2554,9 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) + (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (set-quaternion! (-> self control) (-> self control dir-targ)) @@ -3715,7 +2566,7 @@ (the-as float 65502.96) (the-as float -163840.0) (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (-> (new 'static 'array float 1 0.0) 0) + 0.0 68812.8 ) ) @@ -3723,18 +2574,14 @@ ) (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 62) - ) + (ja-group? eichar-attack-uppercut-ja) (>= (ja-aframe-num 0) 12.0) ) (go target-attack-air 'uppercut) ) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (dummy-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 23) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) @@ -3747,19 +2594,14 @@ (slide-down-test) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (TODO-RENAME-9 (-> self align)) + :code (behavior ((arg0 float) (arg1 float)) + (compute-alignment! (-> self align)) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 0.9) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) - (TODO-RENAME-9 (-> self align)) + (ja :num! (seek! max 0.9)) + (compute-alignment! (-> self align)) (let* ((gp-0 (-> self align)) - (s5-0 (method-of-object gp-0 TODO-RENAME-10)) + (s5-0 (method-of-object gp-0 align!)) (a1-2 (cond ((>= 30.0 (ja-aframe-num 0)) 18 @@ -3774,26 +2616,18 @@ ) ) ) - (s5-0 - gp-0 - a1-2 - (-> (new 'static 'array float 1 1.0) 0) - (the-as float 0.95) - (-> (new 'static 'array float 1 1.0) 0) - ) + (s5-0 gp-0 (the-as align-opts a1-2) (the-as float 1.0) (the-as float 0.95) (the-as float 1.0)) ) ) (go target-falling #f) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-flop (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v0-0 (target-bonk-event-handler arg0 arg1 arg2 arg3))) (cond (v0-0 @@ -3805,7 +2639,7 @@ ) (cond ((< 6144.0 (target-height-above-ground)) - (dummy-10 (-> self skel effect) 'swim-flop (-> (new 'static 'array float 1 -1.0) 0) -1) + (dummy-10 (-> self skel effect) 'swim-flop (the-as float -1.0) -1) (let ((t9-3 enter-state)) (set! (-> self next-state) target-swim-down) ((the-as (function object :behavior target) t9-3)) @@ -3827,10 +2661,9 @@ ) ) ) - :enter - (behavior ((arg0 float) (arg1 float) (arg2 float)) + :enter (behavior ((arg0 float) (arg1 float) (arg2 float)) (if (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (go target-yellow-jump-blast) ) @@ -3839,7 +2672,7 @@ (set-forward-vel (-> self control unknown-float01)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flop-mods*) (set! (-> self control unknown-uint20) (the-as uint 0)) (set! (-> self control dynam gravity-max) 245760.0) @@ -3862,30 +2695,24 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (target-danger-set! 'harmless #f) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) (none) ) - :trans - (behavior () + :trans (behavior () (delete-back-vel) - (let ((gp-1 (logtest? (-> self control status) 1))) - (when (and (not gp-1) (let ((v1-6 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-6 (-> self draw art-group data 64)) (= v1-6 (-> self draw art-group data 66))) + (let ((gp-1 (logtest? (-> self control status) (cshape-moving-flags onsurf)))) + (when (and (not gp-1) (let ((v1-6 (ja-group))) + (or (= v1-6 eichar-flop-down-loop-ja) (= v1-6 eichar-moving-flop-down-ja)) ) ) (when (and (or (< (target-move-dist (seconds 0.1)) 1638.4) - (and (logtest? (-> self control status) 8) (< 0.7 (-> self control poly-angle))) + (and (logtest? (-> self control status) (cshape-moving-flags twall)) (< 0.7 (-> self control poly-angle))) ) - (zero? (logand (-> self control status) 32)) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) (>= (-> self control unknown-uint20) (the-as uint 2)) ) (set! (-> self control unknown-dword36) (-> *display* base-frame-counter)) @@ -3893,22 +2720,13 @@ ) ) (when gp-1 - (logior! (-> self control status) 1) + (logior! (-> self control status) (cshape-moving-flags onsurf)) (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) (dummy-10 (-> self skel effect) 'group-red-eco-strike-ground (ja-frame-num 0) 0) - (let* ((s4-1 (get-process *default-dead-pool* touch-tracker #x4000)) - (s5-1 (when s4-1 - (let ((t9-6 (method-of-type touch-tracker activate))) - (t9-6 (the-as touch-tracker s4-1) self 'touch-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 touch-tracker-init (-> self control trans) 4096.0 30) - (-> s4-1 ppointer) - ) - ) - ) + (let ((s5-1 (process-spawn touch-tracker :init touch-tracker-init (-> self control trans) 4096.0 30 :to self))) (send-event (ppointer->process s5-1) 'event 'attack 'flop) (send-event (ppointer->process s5-1) @@ -3931,7 +2749,7 @@ ) ) (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (dummy-10 (-> self skel effect) @@ -3944,82 +2762,34 @@ ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) ) - (when (and (not (-> self control unknown-symbol30)) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 63) - ) - (>= (ja-aframe-num 0) 8.0) - ) + (when (and (not (-> self control unknown-symbol30)) (ja-group? eichar-flop-down-ja) (>= (ja-aframe-num 0) 8.0)) (target-start-attack) (target-danger-set! 'flop #f) ) (none) ) - :code - (behavior ((arg0 float) (arg1 float) (arg2 float)) + :code (behavior ((arg0 float) (arg1 float) (arg2 float)) (ja-channel-set! 2) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 63))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 63)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 63)) num-func-seek!) - ) - (let ((a0-3 (-> self skel root-channel 1))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 66))) - (set! (-> a0-3 param 0) 0.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group-eval! - a0-3 - (the-as art-joint-anim (-> self draw art-group data 66)) - num-func-chan - ) - ) + (ja-no-eval :group! eichar-flop-down-ja :num! (seek!) :frame-num 0.0) + (ja :chan 1 :group! eichar-moving-flop-down-ja :num! (chan 0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((gp-0 (-> self skel root-channel 1))) - (set! (-> gp-0 frame-interp) (lerp-scale - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (-> self control unknown-float01) - (-> (new 'static 'array float 1 0.0) 0) - (the-as float 40960.0) - ) - ) - (set! (-> gp-0 param 0) (the float (+ (-> gp-0 frame-group data 0 length) -1))) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) + (ja :chan 1 :num! (seek!) :frame-interp (lerp-scale + (the-as float 0.0) + (the-as float 1.0) + (-> self control unknown-float01) + (the-as float 0.0) + (the-as float 40960.0) + ) + ) ) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) (target-danger-set! 'flop-down #f) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 64)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) - (let ((gp-2 (-> self skel root-channel 1))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 67)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) - (let ((f30-0 (-> (new 'static 'array float 1 1.0) 0))) + (ja :group! eichar-flop-down-loop-ja :num! min) + (ja :chan 1 :group! eichar-moving-flop-down-loop-ja :num! min) + (let ((f30-0 1.0)) (let ((gp-3 (new-stack-vector0))) (let ((f0-18 (vector-dot (-> self control dynam gravity-normal) (-> self control unknown-vector120)))) 0.0 @@ -4057,25 +2827,18 @@ ) ) (suspend) - (while #t + (loop (+! (-> self control unknown-uint20) 1) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-+!) - ) - (let ((gp-5 (-> self skel root-channel 1))) - (set! (-> gp-5 frame-interp) (lerp-scale - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (-> self control unknown-float01) - (-> (new 'static 'array float 1 0.0) 0) - (the-as float 40960.0) - ) - ) - (set! (-> gp-5 param 0) 0.0) - (joint-control-channel-group-eval! gp-5 (the-as art-joint-anim #f) num-func-chan) - ) - (set! f30-0 (* f30-0 (fmin (-> (new 'static 'array float 1 1.0) 0) (-> self control unknown-float140)))) + (ja :num! (+!)) + (ja :chan 1 :num! (chan 0) :frame-interp (lerp-scale + (the-as float 0.0) + (the-as float 1.0) + (-> self control unknown-float01) + (the-as float 0.0) + (the-as float 40960.0) + ) + ) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float140)))) (let ((gp-6 (new-stack-vector0)) (f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) @@ -4105,14 +2868,12 @@ ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-flop-hit-ground (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('swim) #f @@ -4122,8 +2883,7 @@ ) ) ) - :enter - (behavior ((arg0 symbol)) + :enter (behavior ((arg0 symbol)) (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector111) (-> self control trans)) @@ -4138,23 +2898,21 @@ (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-uint20) (the-as uint arg0)) - (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + (set-forward-vel (the-as float 0.0)) (set! (-> self control unknown-surface00) *flop-land-mods*) - (set! (-> *flop-land-mods* flags) (logand -1025 (-> *flop-land-mods* flags))) - (set! (-> self state-flags) (logior #x100000 (-> self state-flags))) + (logclear! (-> *flop-land-mods* flags) (surface-flags allow-edge-grab)) + (set! (-> self state-flags) (logior (state-flags flop-hit-ground) (-> self state-flags))) (none) ) - :exit - target-exit - :trans - (behavior () + :exit target-exit + :trans (behavior () (when (!= (-> self control unknown-spoolanim00) 'stuck) (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) (go target-attack-air 'flop) ) ) (when (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + (>= (-> self fact-info-target eco-level) 1.0) ) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) ) @@ -4169,41 +2927,33 @@ ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) ) - (let ((v1-33 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (if (and (or (= v1-33 (-> self draw art-group data 65)) (= v1-33 (-> self draw art-group data 68))) + (let ((v1-33 (ja-group))) + (if (and (or (= v1-33 eichar-flop-down-land-ja) (= v1-33 eichar-moving-flop-down-land-ja)) (>= (ja-aframe-num 0) 28.0) ) - (logior! (-> *flop-land-mods* flags) 1024) + (logior! (-> *flop-land-mods* flags) (surface-flags allow-edge-grab)) ) ) (slide-down-test) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (target-hit-ground-anim arg0) (go target-falling #f) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-wheel (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (= arg2 'touched) (send-event arg0 'roll) ) (target-standard-event-handler arg0 arg1 arg2 arg3) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *wheel-mods*) (+! (-> self control unknown-int50) 1) @@ -4213,15 +2963,14 @@ ) ) (if (or (< (fabs (-> self control unknown-float62)) 0.3) (< 0.3 (fabs (-> self control unknown-float61)))) - (set! (-> self control unknown-float81) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> self control unknown-float81) 1.0) ) (set! (-> self control unknown-uint20) (the-as uint 0)) (set! (-> self control unknown-int21) 0) 0 (none) ) - :exit - (behavior () + :exit (behavior () (when (!= (-> self next-state name) 'target-wheel) (set! (-> self control unknown-int50) 0) (set! (-> self control unknown-dword30) (-> *display* base-frame-counter)) @@ -4229,22 +2978,14 @@ (target-exit) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 0)) 0 (let ((s5-0 0) - (f30-0 (-> (new 'static 'array float 1 1.0) 0)) + (f30-0 1.0) ) - (ja-channel-push! 1 12) - (let ((s4-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-0 - (the-as art-joint-anim (-> self draw art-group data 69)) - num-func-identity - ) - (set! (-> s4-0 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! eichar-duck-roll-ja :num! min) (until (ja-done? 0) (if (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (set! gp-0 (the-as int (-> *display* base-frame-counter))) @@ -4270,18 +3011,12 @@ (if (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (-> *display* base-frame-counter) ) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (cond ((nonzero? s5-0) ) (else - (TODO-RENAME-10 - (-> self align) - 4 - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - f30-0 - ) + (align! (-> self align) (align-opts adjust-xz-vel) (the-as float 1.0) (the-as float 1.0) f30-0) (let ((s4-1 (new-stack-vector0))) (vector-matrix*! s4-1 (-> self control transv) (-> self control unknown-matrix00)) (set! (-> s4-1 y) 0.0) @@ -4290,12 +3025,8 @@ ) ) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) - (set! f30-0 (* f30-0 (fmin (-> (new 'static 'array float 1 1.0) 0) (-> self control unknown-float140)))) + (ja :num! (seek!)) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float140)))) ) ) (if (and (or (< (- (-> *display* base-frame-counter) (the-as time-frame gp-0)) (-> *TARGET-bank* wheel-jump-pre-window)) @@ -4334,23 +3065,18 @@ (go target-duck-stance) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-wheel-flip (target) - :event - target-standard-event-handler - :enter - (behavior ((arg0 float) (arg1 float)) + :event target-standard-event-handler + :enter (behavior ((arg0 float) (arg1 float)) (set! (-> self control unknown-surface00) *wheel-flip-mods*) (none) ) - :exit - target-exit - :trans - (behavior () + :exit target-exit + :trans (behavior () (if (and (or (smack-surface? #f) (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) ) @@ -4365,50 +3091,38 @@ ) (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?) - (and (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) + (and (ja-group? eichar-jump-loop-ja) (= (-> self skel root-channel 0) (-> self skel channel))) ) (go target-attack-air #f) ) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (ja-channel-push! 1 12) - (let ((s4-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-0 - (the-as art-joint-anim (-> self draw art-group data 71)) - num-func-identity - ) - (set! (-> s4-0 frame-num) 0.0) - ) - (let ((f30-0 (-> (new 'static 'array float 1 1.0) 0))) - (until (or (ja-max? 0) (and (>= (ja-aframe-num 0) 4.0) (logtest? (-> self control status) 1))) - (when (and (>= (ja-aframe-num 0) (-> (new 'static 'array float 1 3.0) 0)) (not (-> self control unknown-symbol30))) + :code (behavior ((arg0 float) (arg1 float)) + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! eichar-wheel-flip-ja :num! min) + (let ((f30-0 1.0)) + (until (or (ja-max? 0) + (and (>= (ja-aframe-num 0) 4.0) (logtest? (-> self control status) (cshape-moving-flags onsurf))) + ) + (when (and (>= (ja-aframe-num 0) 3.0) (not (-> self control unknown-symbol30))) (set! (-> self event-hook) target-dangerous-event-handler) (target-start-attack) (target-danger-set! 'flip #f) ) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (if (not (ja-max? 0)) - (TODO-RENAME-10 + (align! (-> self align) - 6 - (-> (new 'static 'array float 1 1.0) 0) + (align-opts adjust-y-vel adjust-xz-vel) + (the-as float 1.0) (/ arg0 (-> *TARGET-bank* wheel-flip-art-height)) (* f30-0 (/ arg1 (-> *TARGET-bank* wheel-flip-art-dist))) ) - (TODO-RENAME-10 + (align! (-> self align) - 4 - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (align-opts adjust-xz-vel) + (the-as float 1.0) + (the-as float 1.0) (* f30-0 (/ arg1 (-> *TARGET-bank* wheel-flip-art-dist))) ) ) @@ -4418,32 +3132,16 @@ (vector-matrix*! (-> self control unknown-vector120) s4-1 (-> self control unknown-matrix01)) ) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) - (set! f30-0 (* f30-0 (fmin (-> (new 'static 'array float 1 1.0) 0) (-> self control unknown-float140)))) + (ja :num! (seek!)) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float140)))) ) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while (zero? (logand (-> self control status) 1)) + (while (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.01)) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) - ) - (ja-channel-push! 1 30) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 38)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (when (not (ja-group? eichar-jump-loop-ja)) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! eichar-jump-loop-ja :num! min) ) ) (let ((gp-2 (new-stack-vector0)) @@ -4463,24 +3161,10 @@ ) ) (suspend) - (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-35 (the-as art-joint-anim #f) num-func-loop!) - ) - ) - (else - (let ((v1-85 (-> self skel root-channel 0))) - (set! (-> v1-85 num-func) num-func-identity) - (set! (-> v1-85 frame-num) (the float (+ (-> v1-85 frame-group data 0 length) -1))) - ) + (if (ja-group? eichar-jump-loop-ja) + (ja :num! (loop!)) + (ja :num-func num-func-identity :frame-num max) ) - ) ) (target-land-effect) (set! (-> self state-hook-time) (-> *display* base-frame-counter)) @@ -4508,16 +3192,11 @@ (none) ) ) - (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) + (if (ja-group? eichar-jump-loop-ja) (go target-hit-ground #f) (go target-stance) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) diff --git a/test/decompiler/reference/engine/ui/credits_REF.gc b/test/decompiler/reference/engine/ui/credits_REF.gc index 51b5b7b1a2..97c8e4eda9 100644 --- a/test/decompiler/reference/engine/ui/credits_REF.gc +++ b/test/decompiler/reference/engine/ui/credits_REF.gc @@ -30,20 +30,10 @@ ) ;; definition for symbol *title-credits-scale*, type (array float) -(define - *title-credits-scale* - (the-as (array float) - (new 'static 'boxed-array :type float :length 8 :allocated-length 8 0.9 0.9 0.6 0.6 1.0 0.9 1.1 0.9) - ) - ) +(define *title-credits-scale* (new 'static 'boxed-array :type float 0.9 0.9 0.6 0.6 1.0 0.9 1.1 0.9)) ;; definition for symbol *title-credits-spacing*, type (array int32) -(define - *title-credits-spacing* - (the-as (array int32) - (new 'static 'boxed-array :type int32 :length 8 :allocated-length 8 15 20 15 15 20 15 20 15) - ) - ) +(define *title-credits-spacing* (new 'static 'boxed-array :type int32 15 20 15 15 20 15 20 15)) ;; definition for function draw-title-credits ;; INFO: Return type mismatch int vs none. diff --git a/test/decompiler/reference/engine/ui/hud-classes_REF.gc b/test/decompiler/reference/engine/ui/hud-classes_REF.gc index bd0a1d035e..b11c9b30b7 100644 --- a/test/decompiler/reference/engine/ui/hud-classes_REF.gc +++ b/test/decompiler/reference/engine/ui/hud-classes_REF.gc @@ -1,13 +1,14 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/fuelcell-naked-ag.gc") + ;; failed to figure out what this is: (defpartgroup group-part-hud-pickup :id 75 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 303 :flags (launch-asap) :binding 304) + :parts ((sp-item 303 :flags (launch-asap) :binding 304) (sp-item 304 :flags (start-dead launch-asap) :binding 305) (sp-item 305 :flags (start-dead launch-asap) :binding 306) (sp-item 306 :flags (start-dead launch-asap) :binding 307) @@ -23,8 +24,7 @@ ;; failed to figure out what this is: (defpart 303 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-copy-from-other spt-scale-y -4) @@ -38,8 +38,7 @@ ;; failed to figure out what this is: (defpart 304 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 0.03)) @@ -61,8 +60,7 @@ ;; failed to figure out what this is: (defpart 305 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 0.065)) @@ -84,8 +82,7 @@ ;; failed to figure out what this is: (defpart 306 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 0.12)) @@ -105,8 +102,7 @@ ;; failed to figure out what this is: (defpart 307 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-scale-x (meters 0.35)) (sp-copy-from-other spt-scale-y -4) @@ -127,8 +123,7 @@ ;; failed to figure out what this is: (defpart 308 - :init-specs - ((sp-flt spt-fade-r 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0)) ) ;; definition of type hud-pickups @@ -150,8 +145,8 @@ ;; definition for method 15 of type hud-pickups ;; INFO: Return type mismatch int vs none. -(defmethod dummy-15 hud-pickups ((obj hud-pickups)) - (let ((t9-0 (method-of-type hud dummy-15))) +(defmethod draw-hud hud-pickups ((obj hud-pickups)) + (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 obj) ) (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) @@ -181,7 +176,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) @@ -193,9 +188,9 @@ ;; definition for method 19 of type hud-pickups ;; INFO: Return type mismatch int vs none. -(defmethod TODO-RENAME-19 hud-pickups ((obj hud-pickups)) +(defmethod hud-update hud-pickups ((obj hud-pickups)) (if *target* - (TODO-RENAME-16 obj (the int (+ 0.5 (-> *target* fact-info-target eco-pill))) 0) + (tally-value obj (the int (+ 0.5 (-> *target* fact-info-target eco-pill))) 0) ) 0 (none) @@ -234,8 +229,7 @@ :id 76 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 309 :flags (launch-asap))) + :parts ((sp-item 309 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -243,8 +237,7 @@ :id 77 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 310 :flags (launch-asap))) + :parts ((sp-item 310 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -252,14 +245,12 @@ :id 78 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 311 :flags (launch-asap))) + :parts ((sp-item 311 :flags (launch-asap))) ) ;; failed to figure out what this is: (defpart 309 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2d :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.7)) (sp-copy-from-other spt-scale-y -4) @@ -275,8 +266,7 @@ ;; failed to figure out what this is: (defpart 310 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.7)) (sp-copy-from-other spt-scale-y -4) @@ -292,8 +282,7 @@ ;; failed to figure out what this is: (defpart 311 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2f :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.7)) (sp-copy-from-other spt-scale-y -4) @@ -391,17 +380,17 @@ ;; definition for method 15 of type hud-health ;; INFO: Return type mismatch int vs none. -(defmethod dummy-15 hud-health ((obj hud-health)) - ((method-of-type hud dummy-15) obj) +(defmethod draw-hud hud-health ((obj hud-health)) + ((method-of-type hud draw-hud) obj) 0 (none) ) ;; definition for method 19 of type hud-health ;; INFO: Return type mismatch int vs none. -(defmethod TODO-RENAME-19 hud-health ((obj hud-health)) +(defmethod hud-update hud-health ((obj hud-health)) (if *target* - (TODO-RENAME-16 + (tally-value obj (the int (-> *target* fact-info-target health)) (the-as int (-> *target* fact-info-target health-pickup-time)) @@ -452,7 +441,7 @@ (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) ) ) - (animate! obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) (set! (-> obj x-sgn) -1) (set! (-> obj y-sgn) -1) (set! (-> obj friend) 0) @@ -462,7 +451,7 @@ ;; definition for method 24 of type hud-health ;; INFO: Return type mismatch int vs none. -(defmethod animate! hud-health ((obj hud-health) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-health ((obj hud-health) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> obj particles 0 init-pos x) 65.0) @@ -492,14 +481,12 @@ :id 705 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 2964 :flags (launch-asap))) + :parts ((sp-item 2964 :flags (launch-asap))) ) ;; failed to figure out what this is: (defpart 2964 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2.4)) (sp-copy-from-other spt-scale-y -4) @@ -543,8 +530,8 @@ ;; definition for method 15 of type hud-money-all ;; INFO: Return type mismatch int vs none. -(defmethod dummy-15 hud-money-all ((obj hud-money-all)) - (let ((t9-0 (method-of-type hud dummy-15))) +(defmethod draw-hud hud-money-all ((obj hud-money-all)) + (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 obj) ) 0 @@ -619,7 +606,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-1 (the-as (pointer dma-tag) a3-12) ) @@ -632,7 +619,7 @@ ;; definition for method 19 of type hud-money-all ;; INFO: Return type mismatch int vs none. -(defmethod TODO-RENAME-19 hud-money-all ((obj hud-money-all)) +(defmethod hud-update hud-money-all ((obj hud-money-all)) (when *target* (hide-bottom-hud) (when (!= *master-mode* 'pause) @@ -650,7 +637,7 @@ ) (if (>= (+ (-> *display* base-frame-counter) (seconds -5)) (-> obj start-time)) (set! (-> obj deactivate-when-hidden) #t) - (TODO-RENAME-16 obj (the-as int (-> *display* base-frame-counter)) 0) + (tally-value obj (the-as int (-> *display* base-frame-counter)) 0) ) ) 0 @@ -663,16 +650,7 @@ (when (< (-> obj nb-of-icons) 6) (let ((s4-0 (-> obj nb-of-icons))) (set! (-> obj icons s4-0) (new 'static 'hud-icon)) - (let* ((s2-0 (get-process *default-dead-pool* manipy #x4000)) - (s3-0 (when s2-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy s2-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 manipy-init (new 'static 'vector :w 1.0) #f *money-sg* #f) - (-> s2-0 ppointer) - ) - ) - ) + (let ((s3-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *money-sg* #f :to obj))) (when s3-0 (set! (-> (the-as process-drawable (-> s3-0 0)) draw dma-add-func) dma-add-process-drawable-hud) (set-vector! (-> (the-as process-drawable (-> s3-0 0)) root trans) 0.0 0.0 0.0 1.0) @@ -707,7 +685,7 @@ ) (+! (-> obj nb-of-particles) 1) ) - (animate! obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) (dotimes (s4-3 (-> obj nb-of-particles)) (if (= (-> obj particles s4-3 part matrix) -1) (set! (-> obj particles s4-3 part matrix) (sprite-allocate-user-hvdf)) @@ -750,14 +728,14 @@ ) ) (set! (-> obj start-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "get-all-orbs") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-all-orbs") 0 (none) ) ;; definition for method 24 of type hud-money-all ;; INFO: Return type mismatch int vs none. -(defmethod animate! hud-money-all ((obj hud-money-all) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-money-all ((obj hud-money-all) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> obj x-scale) 0.01845) @@ -788,14 +766,12 @@ :id 79 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 312 :flags (launch-asap))) + :parts ((sp-item 312 :flags (launch-asap))) ) ;; failed to figure out what this is: (defpart 312 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.6)) (sp-copy-from-other spt-scale-y -4) @@ -833,8 +809,8 @@ ;; definition for method 15 of type hud-money ;; INFO: Return type mismatch int vs none. -(defmethod dummy-15 hud-money ((obj hud-money)) - (let ((t9-0 (method-of-type hud dummy-15))) +(defmethod draw-hud hud-money ((obj hud-money)) + (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 obj) ) (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) @@ -864,7 +840,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) @@ -876,7 +852,7 @@ ;; definition for method 19 of type hud-money ;; INFO: Return type mismatch int vs none. -(defmethod TODO-RENAME-19 hud-money ((obj hud-money)) +(defmethod hud-update hud-money ((obj hud-money)) (when *target* (when (!= *master-mode* 'pause) (when (and (!= (-> obj icons 0) 0) (-> obj icons 0 icon)) @@ -891,7 +867,7 @@ ) ) ) - (TODO-RENAME-16 obj (the int (+ 0.5 (-> *target* game money))) 0) + (tally-value obj (the int (+ 0.5 (-> *target* game money))) 0) ) 0 (none) @@ -903,16 +879,7 @@ (when (< (-> obj nb-of-icons) 6) (let ((s5-0 (-> obj nb-of-icons))) (set! (-> obj icons s5-0) (new 'static 'hud-icon)) - (let* ((s3-0 (get-process *default-dead-pool* manipy #x4000)) - (s4-0 (when s3-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy s3-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 manipy-init (new 'static 'vector :w 1.0) #f *money-sg* #f) - (-> s3-0 ppointer) - ) - ) - ) + (let ((s4-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *money-sg* #f :to obj))) (when s4-0 (set! (-> (the-as process-drawable (-> s4-0 0)) draw dma-add-func) dma-add-process-drawable-hud) (set-vector! (-> (the-as process-drawable (-> s4-0 0)) root trans) 0.0 0.0 0.0 1.0) @@ -947,7 +914,7 @@ ) (+! (-> obj nb-of-particles) 1) ) - (animate! obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) (dotimes (s5-3 (-> obj nb-of-particles)) (if (= (-> obj particles s5-3 part matrix) -1) (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) @@ -964,7 +931,7 @@ ;; definition for method 24 of type hud-money ;; INFO: Return type mismatch int vs none. -(defmethod animate! hud-money ((obj hud-money) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-money ((obj hud-money) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> obj x-scale) 0.0123) @@ -993,39 +960,35 @@ ) ;; definition for method 21 of type hud-money -(defmethod first-icon-x hud-money ((obj hud-money)) +(defmethod get-icon-pos-x hud-money ((obj hud-money)) (-> obj icons 0 icon-x) ) ;; definition for method 22 of type hud-money -(defmethod first-icon-y hud-money ((obj hud-money)) +(defmethod get-icon-pos-y hud-money ((obj hud-money)) (-> obj icons 0 icon-y) ) ;; definition for method 25 of type hud-money -(defmethod inc-value hud-money ((obj hud-money)) +(defmethod get-icon-scale-x hud-money ((obj hud-money)) 0.01 ) ;; definition for method 26 of type hud-money -(defmethod dec-value hud-money ((obj hud-money)) +(defmethod get-icon-scale-y hud-money ((obj hud-money)) -0.011 ) ;; failed to figure out what this is: -(defskelgroup *fuelcell-naked-sg* fuelcell-naked - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *fuelcell-naked-sg* fuelcell-naked fuelcell-naked-lod0-jg fuelcell-naked-idle-ja + ((fuelcell-naked-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2 + ) ;; failed to figure out what this is: (defpart 313 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.4)) (sp-copy-from-other spt-scale-y -4) @@ -1042,8 +1005,7 @@ ;; failed to figure out what this is: (defpart 314 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.4)) (sp-copy-from-other spt-scale-y -4) @@ -1060,8 +1022,7 @@ ;; failed to figure out what this is: (defpart 315 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.4)) (sp-copy-from-other spt-scale-y -4) @@ -1078,8 +1039,7 @@ ;; failed to figure out what this is: (defpart 316 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.4)) (sp-copy-from-other spt-scale-y -4) @@ -1096,8 +1056,7 @@ ;; failed to figure out what this is: (defpart 317 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.2)) (sp-copy-from-other spt-scale-y -4) @@ -1114,8 +1073,7 @@ ;; failed to figure out what this is: (defpart 318 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x30 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x30 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.8)) (sp-copy-from-other spt-scale-y -4) @@ -1134,8 +1092,7 @@ :id 80 :flags (use-local-clock screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 318 :flags (launch-asap)) + :parts ((sp-item 318 :flags (launch-asap)) (sp-item 319 :fade-after (meters 35)) (sp-item 320 :fade-after (meters 20)) (sp-item 321 :flags (launch-asap) :period 3600 :length 5) @@ -1150,14 +1107,12 @@ ;; failed to figure out what this is: (defpart 323 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) ;; failed to figure out what this is: (defpart 319 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-z (meters 22.5)) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.5) 1.0) @@ -1181,8 +1136,7 @@ ;; failed to figure out what this is: (defpart 320 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-z (meters 22.5)) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.5) 1.0) @@ -1205,8 +1159,7 @@ ;; failed to figure out what this is: (defpart 321 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters 22.5)) (sp-flt spt-scale-x (meters 3.3)) @@ -1225,8 +1178,7 @@ ;; failed to figure out what this is: (defpart 322 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters 22.5)) (sp-flt spt-scale-x (meters 3.8)) @@ -1276,8 +1228,8 @@ ;; definition for method 15 of type hud-fuel-cell ;; INFO: Return type mismatch int vs none. -(defmethod dummy-15 hud-fuel-cell ((obj hud-fuel-cell)) - (let ((t9-0 (method-of-type hud dummy-15))) +(defmethod draw-hud hud-fuel-cell ((obj hud-fuel-cell)) + (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 obj) ) (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) @@ -1307,7 +1259,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) @@ -1371,7 +1323,7 @@ ;; definition for method 19 of type hud-fuel-cell ;; INFO: Return type mismatch int vs none. -(defmethod TODO-RENAME-19 hud-fuel-cell ((obj hud-fuel-cell)) +(defmethod hud-update hud-fuel-cell ((obj hud-fuel-cell)) (when *target* (when (!= *master-mode* 'pause) (let ((a0-2 (-> obj icons 0 icon 0 root))) @@ -1382,7 +1334,7 @@ ) ) (set! (-> obj icons 0 icon-y) (-> obj icon-pos-y)) - (TODO-RENAME-16 obj (the int (+ 0.5 (-> *target* game fuel))) 0) + (tally-value obj (the int (+ 0.5 (-> *target* game fuel))) 0) (let ((s5-1 (new 'stack-no-clear 'vector))) (vector<-cspace! s5-1 (-> obj icons 0 icon 0 node-list data 3)) (set! (-> obj particles 0 pos x) (-> s5-1 x)) @@ -1416,16 +1368,7 @@ (when (< (-> obj nb-of-icons) 6) (let ((s5-2 (-> obj nb-of-icons))) (set! (-> obj icons s5-2) (new 'static 'hud-icon)) - (let* ((s3-0 (get-process *default-dead-pool* manipy #x4000)) - (s4-0 (when s3-0 - (let ((t9-3 (method-of-type manipy activate))) - (t9-3 (the-as manipy s3-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 manipy-init (new 'static 'vector :w 1.0) #f *fuelcell-naked-sg* #f) - (-> s3-0 ppointer) - ) - ) - ) + (let ((s4-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *fuelcell-naked-sg* #f :to obj))) (when s4-0 (set! (-> (the-as process-drawable (-> s4-0 0)) draw dma-add-func) dma-add-process-drawable-hud) (set-vector! (-> (the-as process-drawable (-> s4-0 0)) root trans) 0.0 0.0 0.0 1.0) @@ -1455,7 +1398,7 @@ (set! (-> obj y-sgn) -1) (set! (-> obj increment-on-event) #t) (set! (-> obj skip-particle) -2) - (animate! obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) (let ((s5-4 (new 'stack-no-clear 'quaternion))) (quaternion-axis-angle! s5-4 0.0 1.0 0.0 16384.0) (quaternion*! (-> obj icons 0 icon 0 root quat) s5-4 (-> obj icons 0 icon 0 root quat)) @@ -1466,7 +1409,7 @@ ;; definition for method 24 of type hud-fuel-cell ;; INFO: Return type mismatch int vs none. -(defmethod animate! hud-fuel-cell ((obj hud-fuel-cell) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-fuel-cell ((obj hud-fuel-cell) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> obj scale-starburst-3-x) 10240.0) @@ -1505,14 +1448,12 @@ :id 81 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 324 :flags (launch-asap) :binding 325) (sp-item 325 :flags (start-dead launch-asap))) + :parts ((sp-item 324 :flags (launch-asap) :binding 325) (sp-item 325 :flags (start-dead launch-asap))) ) ;; failed to figure out what this is: (defpart 324 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2.2)) (sp-copy-from-other spt-scale-y -4) @@ -1527,8 +1468,7 @@ ;; failed to figure out what this is: (defpart 325 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 1.3333334)) @@ -1581,8 +1521,8 @@ ;; definition for method 15 of type hud-buzzers ;; INFO: Return type mismatch int vs none. -(defmethod dummy-15 hud-buzzers ((obj hud-buzzers)) - (let ((t9-0 (method-of-type hud dummy-15))) +(defmethod draw-hud hud-buzzers ((obj hud-buzzers)) + (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 obj) ) (set! (-> obj text-y) (+ (if (nonzero? (-> obj next-y-offset)) @@ -1619,7 +1559,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) @@ -1631,9 +1571,9 @@ ;; definition for method 19 of type hud-buzzers ;; INFO: Return type mismatch int vs none. -(defmethod TODO-RENAME-19 hud-buzzers ((obj hud-buzzers)) +(defmethod hud-update hud-buzzers ((obj hud-buzzers)) (if *target* - (TODO-RENAME-16 obj (the int (+ 0.5 (-> *target* fact-info-target buzzer))) 0) + (tally-value obj (the int (+ 0.5 (-> *target* fact-info-target buzzer))) 0) ) 0 (none) @@ -1658,7 +1598,7 @@ (set! (-> obj particles s5-1 part matrix) (sprite-allocate-user-hvdf)) ) ) - (animate! obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) (set! (-> obj text-x) 85) (set! (-> obj text-y) 362) (set! (-> obj x-sgn) -1) @@ -1670,12 +1610,12 @@ ) ;; definition for method 21 of type hud-buzzers -(defmethod first-icon-x hud-buzzers ((obj hud-buzzers)) +(defmethod get-icon-pos-x hud-buzzers ((obj hud-buzzers)) (-> obj text-x) ) ;; definition for method 22 of type hud-buzzers -(defmethod first-icon-y hud-buzzers ((obj hud-buzzers)) +(defmethod get-icon-pos-y hud-buzzers ((obj hud-buzzers)) (+ (if (= (-> *setting-control* current video-mode) 'pal) (+ (-> obj text-y) 120) (+ (-> obj text-y) 50) @@ -1685,18 +1625,18 @@ ) ;; definition for method 25 of type hud-buzzers -(defmethod inc-value hud-buzzers ((obj hud-buzzers)) +(defmethod get-icon-scale-x hud-buzzers ((obj hud-buzzers)) 0.008 ) ;; definition for method 26 of type hud-buzzers -(defmethod dec-value hud-buzzers ((obj hud-buzzers)) +(defmethod get-icon-scale-y hud-buzzers ((obj hud-buzzers)) -0.008 ) ;; definition for method 24 of type hud-buzzers ;; INFO: Return type mismatch int vs none. -(defmethod animate! hud-buzzers ((obj hud-buzzers) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-buzzers ((obj hud-buzzers) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> obj scale) 6553.6) @@ -1717,8 +1657,7 @@ :id 82 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 327 :flags (launch-asap))) + :parts ((sp-item 327 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -1726,14 +1665,12 @@ :id 83 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 328 :flags (launch-asap))) + :parts ((sp-item 328 :flags (launch-asap))) ) ;; failed to figure out what this is: (defpart 327 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3.2)) (sp-copy-from-other spt-scale-y -4) @@ -1749,8 +1686,7 @@ ;; failed to figure out what this is: (defpart 328 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2.5)) (sp-copy-from-other spt-scale-y -4) @@ -1769,14 +1705,12 @@ :id 84 :flags (use-local-clock screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 329 :flags (launch-asap)) (sp-item 330 :flags (launch-asap)) (sp-item 331 :flags (launch-asap))) + :parts ((sp-item 329 :flags (launch-asap)) (sp-item 330 :flags (launch-asap)) (sp-item 331 :flags (launch-asap))) ) ;; failed to figure out what this is: (defpart 329 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-copy-from-other spt-scale-y -4) @@ -1792,8 +1726,7 @@ ;; failed to figure out what this is: (defpart 330 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-copy-from-other spt-scale-y -4) @@ -1809,8 +1742,7 @@ ;; failed to figure out what this is: (defpart 331 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-copy-from-other spt-scale-y -4) @@ -2051,9 +1983,9 @@ ;; definition for method 19 of type hud-power ;; INFO: Return type mismatch int vs none. -(defmethod TODO-RENAME-19 hud-power ((obj hud-power)) +(defmethod hud-update hud-power ((obj hud-power)) (if *target* - (TODO-RENAME-16 + (tally-value obj (max 0 @@ -2115,7 +2047,7 @@ (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) ) ) - (animate! obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) (set! (-> obj x-sgn) 1) (set! (-> obj y-sgn) 1) 0 @@ -2124,7 +2056,7 @@ ;; definition for method 24 of type hud-power ;; INFO: Return type mismatch int vs none. -(defmethod animate! hud-power ((obj hud-power) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-power ((obj hud-power) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> obj scale-blue) 7168.0) @@ -2144,86 +2076,12 @@ ;; definition for function activate-hud ;; INFO: Return type mismatch int vs none. (defun activate-hud ((arg0 process)) - (let ((s5-0 (get-process *default-dead-pool* hud-pickups #x4000))) - (set! (-> *hud-parts* pickups) - (the-as - (pointer hud-pickups) - (when s5-0 - (let ((t9-1 (method-of-type hud-pickups activate))) - (t9-1 (the-as hud-pickups s5-0) arg0 'hud-pickups (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 hud-init-by-other 0) - (-> s5-0 ppointer) - ) - ) - ) - ) - (let ((s5-1 (get-process *default-dead-pool* hud-money #x4000))) - (set! (-> *hud-parts* money) - (the-as (pointer hud-money) (when s5-1 - (let ((t9-4 (method-of-type hud-money activate))) - (t9-4 (the-as hud-money s5-1) arg0 'hud-money (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 hud-init-by-other 0) - (-> s5-1 ppointer) - ) - ) - ) - ) - (let ((s5-2 (get-process *default-dead-pool* hud-fuel-cell #x4000))) - (set! (-> *hud-parts* fuel-cell) - (the-as - (pointer hud-fuel-cell) - (when s5-2 - (let ((t9-7 (method-of-type hud-fuel-cell activate))) - (t9-7 (the-as hud-fuel-cell s5-2) arg0 'hud-fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 hud-init-by-other 0) - (-> s5-2 ppointer) - ) - ) - ) - ) - (let ((s5-3 (get-process *default-dead-pool* hud-health #x4000))) - (set! (-> *hud-parts* health) - (the-as - (pointer hud-health) - (when s5-3 - (let ((t9-10 (method-of-type hud-health activate))) - (t9-10 (the-as hud-health s5-3) arg0 'hud-health (the-as pointer #x70004000)) - ) - (run-now-in-process s5-3 hud-init-by-other 0) - (-> s5-3 ppointer) - ) - ) - ) - ) - (let ((s5-4 (get-process *default-dead-pool* hud-buzzers #x4000))) - (set! (-> *hud-parts* buzzers) - (the-as - (pointer hud-buzzers) - (when s5-4 - (let ((t9-13 (method-of-type hud-buzzers activate))) - (t9-13 (the-as hud-buzzers s5-4) arg0 'hud-buzzers (the-as pointer #x70004000)) - ) - (run-now-in-process s5-4 hud-init-by-other 0) - (-> s5-4 ppointer) - ) - ) - ) - ) - (let ((s5-5 (get-process *default-dead-pool* hud-power #x4000))) - (set! (-> *hud-parts* power) - (the-as (pointer hud-power) (when s5-5 - (let ((t9-16 (method-of-type hud-power activate))) - (t9-16 (the-as hud-power s5-5) arg0 'hud-power (the-as pointer #x70004000)) - ) - (run-now-in-process s5-5 hud-init-by-other 0) - (-> s5-5 ppointer) - ) - ) - ) - ) + (set! (-> *hud-parts* pickups) (process-spawn hud-pickups :init hud-init-by-other 0 :to arg0)) + (set! (-> *hud-parts* money) (process-spawn hud-money :init hud-init-by-other 0 :to arg0)) + (set! (-> *hud-parts* fuel-cell) (process-spawn hud-fuel-cell :init hud-init-by-other 0 :to arg0)) + (set! (-> *hud-parts* health) (process-spawn hud-health :init hud-init-by-other 0 :to arg0)) + (set! (-> *hud-parts* buzzers) (process-spawn hud-buzzers :init hud-init-by-other 0 :to arg0)) + (set! (-> *hud-parts* power) (process-spawn hud-power :init hud-init-by-other 0 :to arg0)) (set! (-> *hud-parts* bike-speed) (the-as (pointer hud-bike-speed) #f)) (set! (-> *hud-parts* bike-heat) (the-as (pointer hud-bike-heat) #f)) (set! (-> *hud-parts* money-all) (the-as (pointer hud-money-all) #f)) @@ -2331,7 +2189,7 @@ (when *target* (dotimes (s4-0 9) (if (-> *hud-parts* parts s4-0) - (animate! (-> (the-as (pointer hud) (-> *hud-parts* parts s4-0)) 0) gp-0 s5-0) + (set-pos-and-scale (-> (the-as (pointer hud) (-> *hud-parts* parts s4-0)) 0) gp-0 s5-0) ) ) ) @@ -2348,7 +2206,7 @@ (set! gp-0 #t) (dotimes (s5-0 9) (when (-> *hud-parts* parts s5-0) - (if (not (dummy-14 (-> (the-as (pointer hud) (-> *hud-parts* parts s5-0)) 0))) + (if (not (hidden? (-> (the-as (pointer hud) (-> *hud-parts* parts s5-0)) 0))) (set! gp-0 #f) ) ) @@ -2369,7 +2227,7 @@ (set! gp-0 #t) (dotimes (s5-0 4) (when (-> *hud-parts* parts (+ s5-0 4)) - (if (not (dummy-14 (-> (the-as (pointer hud) (-> *hud-parts* parts (+ s5-0 4))) 0))) + (if (not (hidden? (-> (the-as (pointer hud) (-> *hud-parts* parts (+ s5-0 4))) 0))) (set! gp-0 #f) ) ) @@ -2384,28 +2242,15 @@ ;; definition for function activate-orb-all (defun activate-orb-all ((arg0 int)) - (when (not (-> *hud-parts* money-all)) - (let ((s5-0 (get-process *default-dead-pool* hud-money-all #x4000))) - (set! (-> *hud-parts* money-all) - (the-as - (pointer hud-money-all) - (when s5-0 - (let ((t9-1 (method-of-type hud-money-all activate))) - (t9-1 (the-as hud-money-all s5-0) *target* 'hud-money-all (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 hud-init-by-other arg0) - (-> s5-0 ppointer) - ) - ) - ) + (if (not (-> *hud-parts* money-all)) + (set! (-> *hud-parts* money-all) (process-spawn hud-money-all :init hud-init-by-other arg0 :to *target*)) ) - ) 0 ) ;; definition for function convert-to-hud-object ;; INFO: Return type mismatch int vs none. -(defbehavior convert-to-hud-object hud ((arg0 process-drawable) (arg1 hud)) +(defbehavior convert-to-hud-object process-drawable ((arg0 process-drawable) (arg1 hud)) (when arg1 (logclear! (-> arg0 mask) (process-mask actor-pause)) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -2415,7 +2260,7 @@ ) (set! (-> arg0 root trans z) 9999999.0) (set! (-> arg0 root trans w) 1.0) - (set-vector! (-> arg0 root scale) (inc-value arg1) (dec-value arg1) (inc-value arg1) 1.0) + (set-vector! (-> arg0 root scale) (get-icon-scale-x arg1) (get-icon-scale-y arg1) (get-icon-scale-x arg1) 1.0) (set! (-> arg0 draw dma-add-func) dma-add-process-drawable-hud) (go hud-collecting (process->handle arg1)) ) diff --git a/test/decompiler/reference/engine/ui/hud-h_REF.gc b/test/decompiler/reference/engine/ui/hud-h_REF.gc index 6f5b0892a2..a6ae4662de 100644 --- a/test/decompiler/reference/engine/ui/hud-h_REF.gc +++ b/test/decompiler/reference/engine/ui/hud-h_REF.gc @@ -83,19 +83,19 @@ :size-assert #x118 :flag-assert #x1b00b00118 (:methods - (dummy-14 (_type_) symbol 14) - (dummy-15 (_type_) none 15) - (TODO-RENAME-16 (_type_ int int) none 16) - (dummy-17 (_type_) none 17) - (dummy-18 (_type_) none 18) - (TODO-RENAME-19 (_type_) none 19) + (hidden? (_type_) symbol 14) + (draw-hud (_type_) none 15) + (tally-value (_type_ int int) none 16) + (draw-icons (_type_) none 17) + (draw-particles (_type_) none 18) + (hud-update (_type_) none 19) (init-particles! (_type_ int) none 20) - (first-icon-x (_type_) int 21) - (first-icon-y (_type_) int 22) + (get-icon-pos-x (_type_) int 21) + (get-icon-pos-y (_type_) int 22) (dummy-23 (_type_) none 23) - (animate! (_type_ symbol symbol) none 24) - (inc-value (_type_) float 25) - (dec-value (_type_) float 26) + (set-pos-and-scale (_type_ symbol symbol) none 24) + (get-icon-scale-x (_type_) float 25) + (get-icon-scale-y (_type_) float 26) ) (:states hud-arriving @@ -150,7 +150,7 @@ (bike-speed (pointer hud-bike-speed) :offset-assert 24) (bike-heat (pointer hud-bike-heat) :offset-assert 28) (money-all (pointer hud-money-all) :offset-assert 32) - (parts (pointer process) 9 :offset 0) + (parts (pointer hud) 9 :offset 0) ) :method-count-assert 9 :size-assert #x24 diff --git a/test/decompiler/reference/engine/ui/hud_REF.gc b/test/decompiler/reference/engine/ui/hud_REF.gc index d25744e0dc..f50a78c6a6 100644 --- a/test/decompiler/reference/engine/ui/hud_REF.gc +++ b/test/decompiler/reference/engine/ui/hud_REF.gc @@ -16,7 +16,7 @@ (defmethod deactivate hud ((obj hud)) (dotimes (v1-0 9) (if (and (-> *hud-parts* parts v1-0) (= (ppointer->process (-> *hud-parts* parts v1-0)) obj)) - (set! (-> *hud-parts* parts v1-0) (the-as (pointer process) #f)) + (set! (-> *hud-parts* parts v1-0) (the-as (pointer hud) #f)) ) ) (dotimes (s5-0 (-> obj nb-of-particles)) @@ -29,8 +29,8 @@ ;; definition for method 15 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod dummy-15 hud ((obj hud)) - (when (and (not (dummy-14 obj)) (not (paused?))) +(defmethod draw-hud hud ((obj hud)) + (when (and (not (hidden? obj)) (not (paused?))) (dotimes (s5-0 (-> obj nb-of-particles)) (when (!= s5-0 (-> obj skip-particle)) (if (or (!= (-> obj particles 0 pos x) 0.0) (!= (-> obj particles 0 pos y) 0.0)) @@ -45,7 +45,7 @@ ;; definition for method 16 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod TODO-RENAME-16 hud ((obj hud) (arg0 int) (arg1 int)) +(defmethod tally-value hud ((obj hud) (arg0 int) (arg1 int)) (if (= arg0 (-> obj target-value)) (set! (-> obj last-target-equal-time) (-> *display* base-frame-counter)) ) @@ -54,7 +54,7 @@ (not (movie?)) (>= (- (-> *display* base-frame-counter) (-> *game-info* letterbox-time)) (seconds 0.1)) (>= (- (-> *display* base-frame-counter) (-> *game-info* blackout-time)) (seconds 0.1)) - (not (and *target* (logtest? (-> *target* state-flags) 256))) + (not (and *target* (logtest? (-> *target* state-flags) (state-flags grabbed)))) ) ) (when (or (!= (-> obj value) arg0) @@ -74,7 +74,7 @@ (when (and (!= (-> obj value) (-> obj target-value)) (>= (- (-> *display* base-frame-counter) (-> obj last-increment-time)) (seconds 0.1)) ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (+! (-> obj value) 1) (set! (-> obj last-increment-time) (-> *display* base-frame-counter)) ) @@ -107,7 +107,7 @@ ;; definition for method 17 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod dummy-17 hud ((obj hud)) +(defmethod draw-icons hud ((obj hud)) (dotimes (v1-0 (-> obj nb-of-icons)) (set-vector! (-> obj icons v1-0 icon 0 root scale) @@ -138,7 +138,7 @@ ;; definition for method 18 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod dummy-18 hud ((obj hud)) +(defmethod draw-particles hud ((obj hud)) (dotimes (s5-0 (-> obj nb-of-particles)) (when (!= (-> obj skip-particle) -2) (set! (-> obj particles s5-0 pos x) @@ -173,7 +173,7 @@ ;; definition for method 19 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod TODO-RENAME-19 hud ((obj hud)) +(defmethod hud-update hud ((obj hud)) 0 (none) ) @@ -186,41 +186,40 @@ ) ;; definition for method 21 of type hud -(defmethod first-icon-x hud ((obj hud)) +(defmethod get-icon-pos-x hud ((obj hud)) 0 ) ;; definition for method 22 of type hud -(defmethod first-icon-y hud ((obj hud)) +(defmethod get-icon-pos-y hud ((obj hud)) 0 ) ;; definition for method 25 of type hud -(defmethod inc-value hud ((obj hud)) +(defmethod get-icon-scale-x hud ((obj hud)) 0.0 ) ;; definition for method 26 of type hud -(defmethod dec-value hud ((obj hud)) +(defmethod get-icon-scale-y hud ((obj hud)) 0.0 ) ;; definition for method 24 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod animate! hud ((obj hud) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud ((obj hud) (arg0 symbol) (arg1 symbol)) 0 (none) ) ;; definition for method 14 of type hud -(defmethod dummy-14 hud ((obj hud)) +(defmethod hidden? hud ((obj hud)) (= (-> obj next-state name) 'hud-hidden) ) ;; failed to figure out what this is: (defstate hud-hidden (hud) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('show) @@ -259,11 +258,10 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self offset) 128) - (dummy-17 self) - (dummy-18 self) + (draw-icons self) + (draw-particles self) (let ((gp-0 (-> self child))) (while gp-0 (send-event (ppointer->process gp-0) 'draw #f) @@ -276,42 +274,38 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self y-offset) (-> self next-y-offset)) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) - (while #t + (loop (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (if (-> self deactivate-when-hidden) (deactivate self) ) - (TODO-RENAME-19 self) + (hud-update self) (none) ) ) ;; failed to figure out what this is: (defstate hud-arriving (hud) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-3 object)) (case arg2 (('hide-quick) (set! (-> self last-hide-time) (-> *display* base-frame-counter)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) - (dummy-18 self) - (dummy-17 self) - (TODO-RENAME-19 self) + (draw-particles self) + (draw-icons self) + (hud-update self) (go hud-hidden) ) (('hide) @@ -345,8 +339,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (let ((gp-0 (-> self child))) (while gp-0 (send-event (ppointer->process gp-0) 'draw #t) @@ -360,13 +353,12 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (not (paused?)) - (set! (-> self offset) (seekl (-> self offset) 0 (the int (* 15.0 (-> *display* time-adjust-ratio))))) + (seekl! (-> self offset) 0 (the int (* 15.0 (-> *display* time-adjust-ratio)))) ) - (dummy-17 self) + (draw-icons self) (if (<= (-> self offset) 0) (go hud-in) ) @@ -374,72 +366,64 @@ (set! (-> self last-hide-time) (-> *display* base-frame-counter)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) - (dummy-18 self) - (dummy-17 self) - (TODO-RENAME-19 self) + (draw-particles self) + (draw-icons self) + (hud-update self) (go hud-hidden) ) (suspend) ) (none) ) - :post - (behavior () - (TODO-RENAME-19 self) - (dummy-18 self) - (dummy-15 self) + :post (behavior () + (hud-update self) + (draw-particles self) + (draw-hud self) (none) ) ) ;; failed to figure out what this is: (defstate hud-in (hud) - :event - (-> hud-arriving event) - :code - (behavior () + :event (-> hud-arriving event) + :code (behavior () (set! (-> self trigger-time) (-> *display* base-frame-counter)) (while (and (< (- (-> *display* base-frame-counter) (-> self trigger-time)) (seconds 2)) (not (movie?))) (set! (-> self offset) 0) - (dummy-17 self) + (draw-icons self) (suspend) ) (when (movie?) (set! (-> self last-hide-time) (-> *display* base-frame-counter)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) - (dummy-18 self) - (dummy-17 self) - (TODO-RENAME-19 self) + (draw-particles self) + (draw-icons self) + (hud-update self) (go hud-hidden) ) (go hud-leaving 5) (none) ) - :post - (-> hud-arriving post) + :post (-> hud-arriving post) ) ;; failed to figure out what this is: (defstate hud-leaving (hud) - :event - (-> hud-arriving event) - :code - (behavior ((arg0 int)) - (while #t + :event (-> hud-arriving event) + :code (behavior ((arg0 int)) + (loop (if (not (paused?)) - (set! (-> self offset) - (seekl (-> self offset) 128 (the int (* (the float arg0) (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self offset) 128 (the int (* (the float arg0) (-> *display* time-adjust-ratio)))) ) - (dummy-17 self) + (draw-icons self) (when (movie?) (set! (-> self last-hide-time) (-> *display* base-frame-counter)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) - (dummy-18 self) - (dummy-17 self) - (TODO-RENAME-19 self) + (draw-particles self) + (draw-icons self) + (hud-update self) (go hud-hidden) ) (if (>= (-> self offset) 128) @@ -449,8 +433,7 @@ ) (none) ) - :post - (-> hud-arriving post) + :post (-> hud-arriving post) ) ;; definition for function hud-init-by-other @@ -474,8 +457,8 @@ (logior! (-> self mask) (process-mask menu)) (logclear! (-> self mask) (process-mask pause progress)) (init-particles! self arg0) - (dummy-17 self) - (dummy-18 self) + (draw-icons self) + (draw-particles self) (go hud-hidden) (none) ) @@ -488,9 +471,8 @@ ) ;; failed to figure out what this is: -(defstate hud-collecting (collectable) - :trans - (behavior () +(defstate hud-collecting (process-drawable) + :trans (behavior () (case (-> self type) ((fuel-cell) (fuel-cell-animate) @@ -498,23 +480,21 @@ ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (handle->process arg0))) - (set! (-> s5-0 x) (- (the float (+ (first-icon-x (the-as hud s4-0)) -256)) (-> self root-override trans x))) - (set! (-> s5-0 y) (- (the float (- (first-icon-y (the-as hud s4-0)) (-> *video-parms* screen-sy))) - (-> self root-override trans y) - ) + (set! (-> s5-0 x) (- (the float (+ (get-icon-pos-x (the-as hud s4-0)) -256)) (-> self root trans x))) + (set! (-> s5-0 y) + (- (the float (- (get-icon-pos-y (the-as hud s4-0)) (-> *video-parms* screen-sy))) (-> self root trans y)) ) ) (let ((f30-0 4.0) (f26-0 0.0) - (f28-0 (-> self root-override scale x)) - (f24-0 (-> self root-override scale y)) - (f22-0 (-> self root-override scale z)) + (f28-0 (-> self root scale x)) + (f24-0 (-> self root scale y)) + (f22-0 (-> self root scale z)) ) - (while #t + (loop (let ((f0-7 (* f30-0 (-> *display* seconds-per-frame)))) (+! f26-0 f0-7) (when (< 1.0 f26-0) @@ -523,17 +503,17 @@ ) (set! f26-0 1.0) ) - (+! (-> self root-override trans x) (* f0-7 (-> s5-0 x))) - (+! (-> self root-override trans y) (* f0-7 (-> s5-0 y))) + (+! (-> self root trans x) (* f0-7 (-> s5-0 x))) + (+! (-> self root trans y) (* f0-7 (-> s5-0 y))) ) (set-vector! - (-> self root-override scale) + (-> self root scale) (* f28-0 (-> *video-parms* relative-x-scale)) (* f24-0 (-> *video-parms* relative-y-scale) (-> *video-parms* relative-y-scale)) (* f22-0 (-> *video-parms* relative-x-scale)) 1.0 ) - (let ((a0-12 (-> self root-override))) + (let ((a0-12 (-> self root))) (set-yaw-angle-clear-roll-pitch! a0-12 (- (y-angle a0-12) (* 182.04445 (* 8.0 (-> *display* time-adjust-ratio)))) @@ -549,6 +529,5 @@ ) (none) ) - :post - (the-as (function none :behavior collectable) ja-post) + :post ja-post ) diff --git a/test/decompiler/reference/engine/ui/progress-h_REF.gc b/test/decompiler/reference/engine/ui/progress-h_REF.gc index 0360733354..f9350cb6d5 100644 --- a/test/decompiler/reference/engine/ui/progress-h_REF.gc +++ b/test/decompiler/reference/engine/ui/progress-h_REF.gc @@ -84,13 +84,13 @@ ;; definition of type game-option (deftype game-option (basic) - ((option-type uint64 :offset-assert 8) - (name game-text-id :offset-assert 16) - (scale basic :offset-assert 20) - (param1 float :offset-assert 24) - (param2 float :offset-assert 28) - (param3 int32 :offset-assert 32) - (value-to-modify pointer :offset-assert 36) + ((option-type game-option-type :offset-assert 8) + (name game-text-id :offset-assert 16) + (scale symbol :offset-assert 20) + (param1 float :offset-assert 24) + (param2 float :offset-assert 28) + (param3 game-option-menu :offset-assert 32) + (value-to-modify pointer :offset-assert 36) ) :method-count-assert 9 :size-assert #x28 @@ -130,8 +130,8 @@ (force-transition basic :offset-assert 180) (stat-transition basic :offset-assert 184) (level-transition int32 :offset-assert 188) - (language-selection uint64 :offset-assert 192) - (language-direction basic :offset-assert 200) + (language-selection language-enum :offset-assert 192) + (language-direction symbol :offset-assert 200) (language-transition basic :offset-assert 204) (language-x-offset int32 :offset-assert 208) (sides-x-scale float :offset-assert 212) @@ -172,12 +172,12 @@ :size-assert #x2dc :flag-assert #x3b027002dc (:methods - (dummy-14 (_type_) none 14) - (dummy-15 (_type_) none 15) - (dummy-16 (_type_) none 16) + (progress-dummy-14 (_type_) none 14) + (progress-dummy-15 (_type_) none 15) + (progress-dummy-16 (_type_) none 16) (draw-progress (_type_) none 17) - (dummy-18 () none 18) - (dummy-19 (_type_) symbol 19) + (progress-dummy-18 () none 18) + (visible? (_type_) symbol 19) (hidden? (_type_) symbol 20) (adjust-sprites (_type_) none 21) (adjust-icons (_type_) none 22) @@ -187,10 +187,10 @@ (draw-buzzer-screen (_type_ int) none 26) (draw-notice-screen (_type_) none 27) (draw-options (_type_ int int float) none 28) - (dummy-29 (_type_) none 29) + (respond-common (_type_) none 29) (respond-progress (_type_) none 30) - (dummy-31 (_type_) none 31) - (dummy-32 (_type_) symbol 32) + (respond-memcard (_type_) none 31) + (can-go-back? (_type_) symbol 32) (initialize-icons (_type_) none 33) (initialize-particles (_type_) none 34) (draw-memcard-storage-error (_type_ font-context) none 35) @@ -202,16 +202,16 @@ (draw-memcard-auto-save-error (_type_ font-context) none 41) (draw-memcard-removed (_type_ font-context) none 42) (draw-memcard-error (_type_ font-context) none 43) - (dummy-44 (_type_) none 44) + (progress-dummy-44 (_type_) none 44) (push! (_type_) none 45) (pop! (_type_) none 46) - (dummy-47 (_type_) none 47) + (progress-dummy-47 (_type_) none 47) (enter! (_type_ progress-screen int) none 48) (draw-memcard-format (_type_ font-context) none 49) (draw-auto-save (_type_ font-context) none 50) (set-transition-progress! (_type_ int) none 51) (set-transition-speed! (_type_) none 52) - (dummy-53 (_type_ progress-screen) progress-screen 53) + (set-memcard-screen (_type_ progress-screen) progress-screen 53) (draw-pal-change-to-60hz (_type_ font-context) none 54) (draw-pal-now-60hz (_type_ font-context) none 55) (draw-no-disc (_type_ font-context) none 56) diff --git a/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc index 081bd9e4dd..1c208602ea 100644 --- a/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc @@ -1501,12 +1501,12 @@ ;; definition for function draw-percent-bar ;; INFO: Return type mismatch int vs none. -(defun draw-percent-bar ((arg0 int) (arg1 int) (arg2 float) (arg3 int)) +(defun draw-percent-bar ((arg0 int) (arg1 int) (arg2 float) (arg3 rgba)) (let* ((s2-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-0 (-> s2-0 base)) ) (draw-sprite2d-xy s2-0 arg0 arg1 255 14 (new 'static 'rgba :a #x60)) - (draw-sprite2d-xy s2-0 arg0 (+ arg1 2) (the int (* 255.0 arg2)) 10 (the-as rgba arg3)) + (draw-sprite2d-xy s2-0 arg0 (+ arg1 2) (the int (* 255.0 arg2)) 10 arg3) (let ((a3-3 (-> s2-0 base))) (let ((v1-3 (the-as dma-packet (-> s2-0 base)))) (set! (-> v1-3 dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -1579,7 +1579,7 @@ (sv-464 int) (sv-480 int) (sv-496 int) - (sv-512 uint) + (sv-512 int) (sv-528 (function _varargs_ object)) (sv-544 string) (sv-560 string) @@ -1629,7 +1629,7 @@ (set! sv-144 s2-1) (let ((v1-18 (-> s3-0 s0-0 option-type))) (cond - ((= v1-18 7) + ((= v1-18 (game-option-type yes-no)) (cond ((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) (set! sv-160 format) @@ -1655,7 +1655,7 @@ ) ) ) - ((or (= v1-18 6) (= v1-18 8)) + ((or (= v1-18 (game-option-type menu)) (= v1-18 (game-option-type button))) (cond ((nonzero? (-> s3-0 s0-0 name)) (set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) @@ -1673,7 +1673,7 @@ ) (set! (-> sv-112 origin x) (the float (- sv-128 (-> obj left-x-offset)))) (case (-> s3-0 s0-0 option-type) - ((3) + (((game-option-type center-screen)) (set! (-> sv-112 origin y) (the float (+ s2-1 -20))) ) (else @@ -1693,7 +1693,7 @@ (sv-288 a0-23 a1-11 a2-10 a3-4 t0-1) ) (case (-> s3-0 s0-0 option-type) - ((3) + (((game-option-type center-screen)) (set! sv-144 (+ s2-1 3)) sv-144 ) @@ -1702,243 +1702,241 @@ sv-144 ) ) - (let ((v1-81 (-> s3-0 s0-0 option-type))) - (cond - ((zero? v1-81) - (let* ((v1-82 (the-as uint #x8000ffff)) - (f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) - (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) - (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) - ) - (draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as int a3-5)) - ) - (set! sv-304 format) - (let ((a0-42 (clear *temp-string*)) - (a1-13 "~D") - (a2-12 (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) - ) - (sv-304 a0-42 a1-13 a2-12) - ) - (set! sv-912 *temp-string*) - (set! sv-128 (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100)) - sv-128 - ) - ((= v1-81 2) - (cond - ((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (set! sv-320 format) - (set! sv-336 (clear *temp-string*)) - (set! sv-352 "~30L~S~0L ~S") - (set! sv-368 (lookup-text! *common-text* (game-text-id on) #f)) - (let ((a3-6 (lookup-text! *common-text* (game-text-id off) #f))) - (sv-320 sv-336 sv-352 sv-368 a3-6) + (case (-> s3-0 s0-0 option-type) + (((game-option-type slider)) + (let* ((v1-82 (the-as uint #x8000ffff)) + (f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) + (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) + (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-384 format) - (set! sv-400 (clear *temp-string*)) - (set! sv-416 "~0L~S ~30L~S~1L") - (set! sv-432 (lookup-text! *common-text* (game-text-id on) #f)) - (let ((a3-7 (lookup-text! *common-text* (game-text-id off) #f))) - (sv-384 sv-400 sv-416 sv-432 a3-7) - ) - (set! sv-912 *temp-string*) - sv-912 + (draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as rgba a3-5)) + ) + (set! sv-304 format) + (let ((a0-42 (clear *temp-string*)) + (a1-13 "~D") + (a2-12 (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) ) + (sv-304 a0-42 a1-13 a2-12) + ) + (set! sv-912 *temp-string*) + (set! sv-128 (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100)) + sv-128 + ) + (((game-option-type on-off)) + (cond + ((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) + (set! sv-320 format) + (set! sv-336 (clear *temp-string*)) + (set! sv-352 "~30L~S~0L ~S") + (set! sv-368 (lookup-text! *common-text* (game-text-id on) #f)) + (let ((a3-6 (lookup-text! *common-text* (game-text-id off) #f))) + (sv-320 sv-336 sv-352 sv-368 a3-6) + ) + (set! sv-912 *temp-string*) + sv-912 + ) + (else + (set! sv-384 format) + (set! sv-400 (clear *temp-string*)) + (set! sv-416 "~0L~S ~30L~S~1L") + (set! sv-432 (lookup-text! *common-text* (game-text-id on) #f)) + (let ((a3-7 (lookup-text! *common-text* (game-text-id off) #f))) + (sv-384 sv-400 sv-416 sv-432 a3-7) + ) + (set! sv-912 *temp-string*) + sv-912 ) ) - ((= v1-81 1) - (set! sv-512 (-> obj language-selection)) - (set! sv-448 (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) - (if (and (zero? (scf-get-territory)) - (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) - ) - (set! sv-464 5) - (set! sv-464 6) - ) - (if (-> obj language-transition) - (set! (-> obj language-x-offset) - (seekl (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio)))) - ) - ) - (when (>= (-> obj language-x-offset) 100) - (set! (-> obj language-selection) sv-448) - (set! sv-512 sv-448) - (set! (-> obj language-transition) #f) - (set! (-> obj language-x-offset) 0) - 0 + ) + (((game-option-type language)) + (set! sv-512 (the-as int (-> obj language-selection))) + (set! sv-448 (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) + (if (and (zero? (scf-get-territory)) + (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) + ) + (set! sv-464 5) + (set! sv-464 6) ) - (set! (-> sv-112 origin y) (the float (+ s2-1 3))) - (let ((a0-62 sv-112)) - (set! (-> a0-62 color) (font-color lighter-lighter-blue)) + (if (-> obj language-transition) + (seekl! (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio)))) ) + (when (>= (-> obj language-x-offset) 100) + (set! (-> obj language-selection) (the-as language-enum sv-448)) + (set! sv-512 (the-as int sv-448)) + (set! (-> obj language-transition) #f) + (set! (-> obj language-x-offset) 0) 0 - (set! sv-480 (mod (the-as int (+ sv-512 1)) sv-464)) - (let ((a0-66 (mod (+ sv-464 -1 sv-512) sv-464)) - (v1-153 (mod (the-as int (+ sv-512 2)) sv-464)) - ) - (set! sv-496 (mod (+ sv-464 -2 sv-512) sv-464)) - (cond - ((-> obj language-direction) - (let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100)))) - (print-language-name a0-66 sv-112 a2-22 #f) - ) - (let ((a2-23 (+ (-> obj language-x-offset) 100))) - (cond - ((< a2-23 150) - (let ((t9-27 print-language-name) - (a1-30 sv-112) - (a3-9 #t) - ) - (t9-27 sv-480 a1-30 a2-23 a3-9) - ) + ) + (set! (-> sv-112 origin y) (the float (+ s2-1 3))) + (let ((a0-62 sv-112)) + (set! (-> a0-62 color) (font-color lighter-lighter-blue)) + ) + 0 + (set! sv-480 (mod (+ sv-512 1) sv-464)) + (let ((a0-66 (mod (+ sv-464 -1 sv-512) sv-464)) + (v1-153 (mod (+ sv-512 2) sv-464)) + ) + (set! sv-496 (mod (+ sv-464 -2 sv-512) sv-464)) + (cond + ((-> obj language-direction) + (let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100)))) + (print-language-name a0-66 sv-112 a2-22 #f) + ) + (let ((a2-23 (+ (-> obj language-x-offset) 100))) + (cond + ((< a2-23 150) + (let ((t9-27 print-language-name) + (a1-30 sv-112) + (a3-9 #t) + ) + (t9-27 sv-480 a1-30 a2-23 a3-9) ) - (else - (let ((a2-24 (- 200 (-> obj language-x-offset))) - (t9-28 print-language-name) - (a1-31 sv-112) - (a3-10 #f) - ) - (t9-28 sv-496 a1-31 a2-24 a3-10) - ) + ) + (else + (let ((a2-24 (- 200 (-> obj language-x-offset))) + (t9-28 print-language-name) + (a1-31 sv-112) + (a3-10 #f) + ) + (t9-28 sv-496 a1-31 a2-24 a3-10) ) ) ) ) - (else - (let ((a2-25 (+ (-> obj language-x-offset) 100))) - (cond - ((< a2-25 150) - (print-language-name a0-66 sv-112 a2-25 #f) - ) - (else - (let ((a2-26 (- 200 (-> obj language-x-offset)))) - (print-language-name v1-153 sv-112 a2-26 #t) - ) + ) + (else + (let ((a2-25 (+ (-> obj language-x-offset) 100))) + (cond + ((< a2-25 150) + (print-language-name a0-66 sv-112 a2-25 #f) + ) + (else + (let ((a2-26 (- 200 (-> obj language-x-offset)))) + (print-language-name v1-153 sv-112 a2-26 #t) ) ) ) - (let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100)))) - (print-language-name sv-480 sv-112 a2-27 #t) - ) + ) + (let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100)))) + (print-language-name sv-480 sv-112 a2-27 #t) ) ) ) - (when (not (-> obj language-transition)) - (let ((a0-75 sv-112)) - (set! (-> a0-75 color) (font-color yellow-green-2)) + ) + (when (not (-> obj language-transition)) + (let ((a0-75 sv-112)) + (set! (-> a0-75 color) (font-color yellow-green-2)) + ) + ) + (let ((t9-32 print-language-name) + (a1-37 sv-112) + (a2-28 (-> obj language-x-offset)) + (a3-14 (-> obj language-direction)) ) - ) - (let ((t9-32 print-language-name) - (a1-37 sv-112) - (a2-28 (-> obj language-x-offset)) - (a3-14 (-> obj language-direction)) - ) - (t9-32 (the-as int sv-512) a1-37 a2-28 (the-as symbol a3-14)) - ) + (t9-32 sv-512 a1-37 a2-28 a3-14) ) - ((= v1-81 3) - (set! sv-912 (lookup-text! *common-text* (game-text-id move-dpad) #f)) - sv-912 - ) - ((= v1-81 4) - (cond - ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'aspect4x3) - (set! sv-528 format) - (set! sv-544 (clear *temp-string*)) - (set! sv-560 "~30L~S~0L ~S") - (set! sv-576 (lookup-text! *common-text* (game-text-id 4x3) #f)) - (let ((a3-15 (lookup-text! *common-text* (game-text-id 16x9) #f))) - (sv-528 sv-544 sv-560 sv-576 a3-15) - ) - (set! sv-912 *temp-string*) - sv-912 + ) + (((game-option-type center-screen)) + (set! sv-912 (lookup-text! *common-text* (game-text-id move-dpad) #f)) + sv-912 + ) + (((game-option-type aspect-ratio)) + (cond + ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'aspect4x3) + (set! sv-528 format) + (set! sv-544 (clear *temp-string*)) + (set! sv-560 "~30L~S~0L ~S") + (set! sv-576 (lookup-text! *common-text* (game-text-id 4x3) #f)) + (let ((a3-15 (lookup-text! *common-text* (game-text-id 16x9) #f))) + (sv-528 sv-544 sv-560 sv-576 a3-15) ) - (else - (set! sv-592 format) - (set! sv-608 (clear *temp-string*)) - (set! sv-624 "~0L~S ~30L~S~1L") - (set! sv-640 (lookup-text! *common-text* (game-text-id 4x3) #f)) - (let ((a3-16 (lookup-text! *common-text* (game-text-id 16x9) #f))) - (sv-592 sv-608 sv-624 sv-640 a3-16) - ) - (set! sv-912 *temp-string*) - sv-912 + (set! sv-912 *temp-string*) + sv-912 + ) + (else + (set! sv-592 format) + (set! sv-608 (clear *temp-string*)) + (set! sv-624 "~0L~S ~30L~S~1L") + (set! sv-640 (lookup-text! *common-text* (game-text-id 4x3) #f)) + (let ((a3-16 (lookup-text! *common-text* (game-text-id 16x9) #f))) + (sv-592 sv-608 sv-624 sv-640 a3-16) ) + (set! sv-912 *temp-string*) + sv-912 ) ) - ((= v1-81 5) - (cond - ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'ntsc) - (set! sv-656 format) - (set! sv-672 (clear *temp-string*)) - (set! sv-688 "~0L~S ~30L~S~1L") - (set! sv-704 (lookup-text! *common-text* (game-text-id 50hz) #f)) - (let ((a3-17 (lookup-text! *common-text* (game-text-id 60hz) #f))) - (sv-656 sv-672 sv-688 sv-704 a3-17) - ) - (set! sv-912 *temp-string*) - sv-912 + ) + (((game-option-type video-mode)) + (cond + ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'ntsc) + (set! sv-656 format) + (set! sv-672 (clear *temp-string*)) + (set! sv-688 "~0L~S ~30L~S~1L") + (set! sv-704 (lookup-text! *common-text* (game-text-id 50hz) #f)) + (let ((a3-17 (lookup-text! *common-text* (game-text-id 60hz) #f))) + (sv-656 sv-672 sv-688 sv-704 a3-17) ) - (else - (set! sv-720 format) - (set! sv-736 (clear *temp-string*)) - (set! sv-752 "~30L~S~0L ~S") - (set! sv-768 (lookup-text! *common-text* (game-text-id 50hz) #f)) - (let ((a3-18 (lookup-text! *common-text* (game-text-id 60hz) #f))) - (sv-720 sv-736 sv-752 sv-768 a3-18) - ) - (set! sv-912 *temp-string*) - sv-912 + (set! sv-912 *temp-string*) + sv-912 + ) + (else + (set! sv-720 format) + (set! sv-736 (clear *temp-string*)) + (set! sv-752 "~30L~S~0L ~S") + (set! sv-768 (lookup-text! *common-text* (game-text-id 50hz) #f)) + (let ((a3-18 (lookup-text! *common-text* (game-text-id 60hz) #f))) + (sv-720 sv-736 sv-752 sv-768 a3-18) ) + (set! sv-912 *temp-string*) + sv-912 ) ) - ) + ) ) ) (else - (let ((v1-195 (-> s3-0 s0-0 option-type))) - (cond - ((or (zero? v1-195) (= v1-195 3) (= v1-195 4) (= v1-195 5)) - (set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - sv-912 - ) - ((= v1-195 2) - (set! sv-784 format) - (set! sv-800 (clear *temp-string*)) - (set! sv-816 "~S: ~S") - (set! sv-832 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - (let ((a3-19 (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (lookup-text! *common-text* (game-text-id on) #f) - (lookup-text! *common-text* (game-text-id off) #f) - ) - ) - ) - (sv-784 sv-800 sv-816 sv-832 a3-19) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - ((= v1-195 1) - (set! sv-848 format) - (set! sv-864 (clear *temp-string*)) - (set! sv-880 "~S: ~S") - (set! sv-896 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - (let ((a3-20 (lookup-text! - *common-text* - (-> *language-name-remap* (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) - #f - ) - ) - ) - (sv-848 sv-864 sv-880 sv-896 a3-20) - ) - (set! sv-912 *temp-string*) - sv-912 - ) + (case (-> s3-0 s0-0 option-type) + (((game-option-type slider) + (game-option-type center-screen) + (game-option-type aspect-ratio) + (game-option-type video-mode) ) + (set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) + sv-912 + ) + (((game-option-type on-off)) + (set! sv-784 format) + (set! sv-800 (clear *temp-string*)) + (set! sv-816 "~S: ~S") + (set! sv-832 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) + (let ((a3-19 (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) + (lookup-text! *common-text* (game-text-id on) #f) + (lookup-text! *common-text* (game-text-id off) #f) + ) + ) + ) + (sv-784 sv-800 sv-816 sv-832 a3-19) + ) + (set! sv-912 *temp-string*) + sv-912 + ) + (((game-option-type language)) + (set! sv-848 format) + (set! sv-864 (clear *temp-string*)) + (set! sv-880 "~S: ~S") + (set! sv-896 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) + (let ((a3-20 (lookup-text! + *common-text* + (-> *language-name-remap* (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) + #f + ) + ) + ) + (sv-848 sv-864 sv-880 sv-896 a3-20) + ) + (set! sv-912 *temp-string*) + sv-912 + ) ) ) ) @@ -2047,7 +2045,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-4) ) @@ -2156,7 +2154,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-4 (the-as (pointer dma-tag) a3-9) ) diff --git a/test/decompiler/reference/engine/ui/progress/progress-part_REF.gc b/test/decompiler/reference/engine/ui/progress/progress-part_REF.gc index 3870baf976..fafe46b3a7 100644 --- a/test/decompiler/reference/engine/ui/progress/progress-part_REF.gc +++ b/test/decompiler/reference/engine/ui/progress/progress-part_REF.gc @@ -188,8 +188,7 @@ :id 85 :flags (use-local-clock screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 332 :flags (launch-asap))) + :parts ((sp-item 332 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -197,8 +196,7 @@ :id 86 :flags (use-local-clock screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 333 :flags (launch-asap))) + :parts ((sp-item 333 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -206,8 +204,7 @@ :id 87 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 334 :flags (launch-asap))) + :parts ((sp-item 334 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -215,8 +212,7 @@ :id 88 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 335 :flags (launch-asap))) + :parts ((sp-item 335 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -224,8 +220,7 @@ :id 89 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 336 :flags (launch-asap))) + :parts ((sp-item 336 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -233,8 +228,7 @@ :id 90 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 337 :flags (launch-asap))) + :parts ((sp-item 337 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -242,8 +236,7 @@ :id 91 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2190 :flags (launch-asap)) (sp-item 2191 :flags (launch-asap)) (sp-item 2192 :flags (launch-asap))) + :parts ((sp-item 2190 :flags (launch-asap)) (sp-item 2191 :flags (launch-asap)) (sp-item 2192 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -251,8 +244,7 @@ :id 570 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2336 :flags (launch-asap))) + :parts ((sp-item 2336 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -260,8 +252,7 @@ :id 571 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2337 :flags (launch-asap))) + :parts ((sp-item 2337 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -269,8 +260,7 @@ :id 572 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2338 :flags (launch-asap))) + :parts ((sp-item 2338 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -278,8 +268,7 @@ :id 573 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2339 :flags (launch-asap))) + :parts ((sp-item 2339 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -287,8 +276,7 @@ :id 92 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2142 :flags (launch-asap))) + :parts ((sp-item 2142 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -296,8 +284,7 @@ :id 93 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2143 :flags (launch-asap))) + :parts ((sp-item 2143 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -305,8 +292,7 @@ :id 94 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2144 :flags (launch-asap))) + :parts ((sp-item 2144 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -314,8 +300,7 @@ :id 95 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2145 :flags (launch-asap))) + :parts ((sp-item 2145 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -323,14 +308,12 @@ :id 96 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 338 :flags (launch-asap))) + :parts ((sp-item 338 :flags (launch-asap))) ) ;; failed to figure out what this is: (defpart 337 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 15)) (sp-flt spt-scale-y (meters 11.5)) @@ -346,8 +329,7 @@ ;; failed to figure out what this is: (defpart 2190 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6e :page #x1cf)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6e :page #x1cf)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.8)) (sp-copy-from-other spt-scale-y -4) @@ -363,8 +345,7 @@ ;; failed to figure out what this is: (defpart 2191 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6d :page #x1cf)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6d :page #x1cf)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 1.05)) (sp-flt spt-scale-x (meters 0.8)) @@ -381,8 +362,7 @@ ;; failed to figure out what this is: (defpart 2192 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6c :page #x1cf)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6c :page #x1cf)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2.3)) (sp-flt spt-scale-x (meters 0.8)) @@ -399,8 +379,7 @@ ;; failed to figure out what this is: (defpart 2336 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.6)) (sp-copy-from-other spt-scale-y -4) @@ -416,8 +395,7 @@ ;; failed to figure out what this is: (defpart 2337 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.6)) (sp-copy-from-other spt-scale-y -4) @@ -433,8 +411,7 @@ ;; failed to figure out what this is: (defpart 2338 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x7 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.6)) (sp-copy-from-other spt-scale-y -4) @@ -450,8 +427,7 @@ ;; failed to figure out what this is: (defpart 2339 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.6)) (sp-copy-from-other spt-scale-y -4) @@ -467,8 +443,7 @@ ;; failed to figure out what this is: (defpart 2142 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 9.2)) (sp-flt spt-scale-y (meters 2)) @@ -484,8 +459,7 @@ ;; failed to figure out what this is: (defpart 2143 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 9.2)) (sp-flt spt-scale-y (meters 2)) @@ -501,8 +475,7 @@ ;; failed to figure out what this is: (defpart 2144 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 9.2)) (sp-flt spt-scale-y (meters 2)) @@ -518,8 +491,7 @@ ;; failed to figure out what this is: (defpart 2145 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 9.2)) (sp-flt spt-scale-y (meters 2)) @@ -535,8 +507,7 @@ ;; failed to figure out what this is: (defpart 332 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.2)) (sp-copy-from-other spt-scale-y -4) @@ -551,8 +522,7 @@ ;; failed to figure out what this is: (defpart 333 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.2)) (sp-copy-from-other spt-scale-y -4) @@ -567,8 +537,7 @@ ;; failed to figure out what this is: (defpart 334 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.8)) (sp-copy-from-other spt-scale-y -4) @@ -583,8 +552,7 @@ ;; failed to figure out what this is: (defpart 335 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3.5)) (sp-flt spt-scale-y (meters 13)) @@ -600,8 +568,7 @@ ;; failed to figure out what this is: (defpart 336 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x408)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x408)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 6)) (sp-flt spt-scale-y (meters 13)) @@ -617,8 +584,7 @@ ;; failed to figure out what this is: (defpart 339 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.3)) (sp-copy-from-other spt-scale-y -4) @@ -635,8 +601,7 @@ ;; failed to figure out what this is: (defpart 340 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.3)) (sp-copy-from-other spt-scale-y -4) @@ -653,8 +618,7 @@ ;; failed to figure out what this is: (defpart 341 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.3)) (sp-copy-from-other spt-scale-y -4) @@ -671,8 +635,7 @@ ;; failed to figure out what this is: (defpart 342 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.3)) (sp-copy-from-other spt-scale-y -4) @@ -689,8 +652,7 @@ ;; failed to figure out what this is: (defpart 343 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.2)) (sp-copy-from-other spt-scale-y -4) @@ -707,8 +669,7 @@ ;; failed to figure out what this is: (defpart 338 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x30 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x30 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.2)) (sp-copy-from-other spt-scale-y -4) @@ -725,14 +686,12 @@ ;; failed to figure out what this is: (defpart 344 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) ;; failed to figure out what this is: (defpart 345 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-z (meters 0.52734375)) (sp-flt spt-scale-x (meters 0.25)) @@ -758,8 +717,7 @@ ;; failed to figure out what this is: (defpart 346 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-z (meters 0.52734375)) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.25) 1.0) @@ -784,8 +742,7 @@ ;; failed to figure out what this is: (defpart 347 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters 0.52734375)) (sp-flt spt-scale-x (meters 2)) @@ -805,8 +762,7 @@ ;; failed to figure out what this is: (defpart 348 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters 0.52734375)) (sp-flt spt-scale-x (meters 2.4)) @@ -829,8 +785,7 @@ :id 97 :flags (use-local-clock screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 338 :flags (launch-asap)) + :parts ((sp-item 338 :flags (launch-asap)) (sp-item 347 :flags (launch-asap) :period 3600 :length 5) (sp-item 348 :flags (launch-asap) :period 3600 :length 5) (sp-item 343 :flags (launch-asap)) @@ -846,14 +801,12 @@ :id 98 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 1982 :flags (launch-asap) :binding 1981) (sp-item 1981 :flags (start-dead launch-asap))) + :parts ((sp-item 1982 :flags (launch-asap) :binding 1981) (sp-item 1981 :flags (start-dead launch-asap))) ) ;; failed to figure out what this is: (defpart 1982 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2.2)) (sp-copy-from-other spt-scale-y -4) @@ -868,8 +821,7 @@ ;; failed to figure out what this is: (defpart 1981 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 1.3333334)) @@ -893,14 +845,12 @@ :id 99 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 1983 :flags (launch-asap))) + :parts ((sp-item 1983 :flags (launch-asap))) ) ;; failed to figure out what this is: (defpart 1983 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2.2)) (sp-copy-from-other spt-scale-y -4) @@ -918,14 +868,12 @@ :id 100 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 1985 :flags (launch-asap) :binding 1984) (sp-item 1984 :flags (start-dead launch-asap))) + :parts ((sp-item 1985 :flags (launch-asap) :binding 1984) (sp-item 1984 :flags (start-dead launch-asap))) ) ;; failed to figure out what this is: (defpart 1985 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-copy-from-other spt-scale-y -4) @@ -940,8 +888,7 @@ ;; failed to figure out what this is: (defpart 1984 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2a :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 1.3333334)) @@ -966,14 +913,12 @@ :id 101 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 1986 :flags (launch-asap))) + :parts ((sp-item 1986 :flags (launch-asap))) ) ;; failed to figure out what this is: (defpart 1986 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.3)) (sp-copy-from-other spt-scale-y -4) @@ -992,14 +937,12 @@ :id 615 :flags (screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 2478 :flags (launch-asap))) + :parts ((sp-item 2478 :flags (launch-asap))) ) ;; failed to figure out what this is: (defpart 2478 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6b :page #x1cf)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6b :page #x1cf)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1.8)) (sp-copy-from-other spt-scale-y -4) diff --git a/test/decompiler/reference/engine/ui/progress/progress-static_REF.gc b/test/decompiler/reference/engine/ui/progress/progress-static_REF.gc index 056b2d9ff9..15312828f3 100644 --- a/test/decompiler/reference/engine/ui/progress/progress-static_REF.gc +++ b/test/decompiler/reference/engine/ui/progress/progress-static_REF.gc @@ -2,297 +2,287 @@ (in-package goal) ;; definition for symbol *main-options*, type (array game-option) -(define - *main-options* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 7 :allocated-length 7 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x6 :name (game-text-id load-game) :scale #t :param3 16) - (new 'static 'game-option :option-type #x6 :name (game-text-id save-game) :scale #t :param3 17) - (new 'static 'game-option :option-type #x6 :name (game-text-id quit-game) :scale #t :param3 34) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) +(define *main-options* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id game-options) + :scale #t + :param3 (game-option-menu game-settings) ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id graphic-options) + :scale #t + :param3 (game-option-menu graphic-settings) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id sound-options) + :scale #t + :param3 (game-option-menu sound-settings) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id load-game) + :scale #t + :param3 (game-option-menu load-game) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id save-game) + :scale #t + :param3 (game-option-menu save-game) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id quit-game) + :scale #t + :param3 (game-option-menu quit) + ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *title*, type (array game-option) -(define - *title* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id new-game) :scale #t :param3 18) - (new 'static 'game-option :option-type #x6 :name (game-text-id load-game) :scale #t :param3 16) - (new 'static 'game-option :option-type #x6 :name (game-text-id options) :scale #t :param3 28) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) +(define *title* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id new-game) + :scale #t + :param3 (game-option-menu save-game-title) ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id load-game) + :scale #t + :param3 (game-option-menu load-game) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id options) + :scale #t + :param3 (game-option-menu settings-title) + ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *options*, type (array game-option) -(define - *options* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) +(define *options* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id game-options) + :scale #t + :param3 (game-option-menu game-settings) ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id graphic-options) + :scale #t + :param3 (game-option-menu graphic-settings) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id sound-options) + :scale #t + :param3 (game-option-menu sound-settings) + ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *main-options-demo*, type (array game-option) -(define - *main-options-demo* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) +(define *main-options-demo* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id game-options) + :scale #t + :param3 (game-option-menu game-settings) ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id graphic-options) + :scale #t + :param3 (game-option-menu graphic-settings) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id sound-options) + :scale #t + :param3 (game-option-menu sound-settings) + ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *main-options-demo-shared*, type (array game-option) -(define - *main-options-demo-shared* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id exit-demo) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) +(define *main-options-demo-shared* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id game-options) + :scale #t + :param3 (game-option-menu game-settings) ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id graphic-options) + :scale #t + :param3 (game-option-menu graphic-settings) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id sound-options) + :scale #t + :param3 (game-option-menu sound-settings) + ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id exit-demo) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *game-options*, type (array game-option) -(define - *game-options* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x1 :name (game-text-id language) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) +(define *game-options* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) + (new 'static 'game-option :option-type (game-option-type language) :name (game-text-id language) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *game-options-japan*, type (array game-option) -(define - *game-options-japan* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 3 :allocated-length 3 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) +(define *game-options-japan* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *game-options-demo*, type (array game-option) -(define - *game-options-demo* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 3 :allocated-length 3 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) +(define *game-options-demo* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *graphic-options*, type (array game-option) -(define - *graphic-options* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 3 :allocated-length 3 - (new 'static 'game-option :option-type #x3 :name (game-text-id center-screen) :scale #t) - (new 'static 'game-option :option-type #x4 :name (game-text-id aspect-ratio) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) +(define *graphic-options* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option + :option-type (game-option-type center-screen) + :name (game-text-id center-screen) + :scale #t ) + (new 'static 'game-option + :option-type (game-option-type aspect-ratio) + :name (game-text-id aspect-ratio) + :scale #t + ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *graphic-title-options-pal*, type (array game-option) -(define - *graphic-title-options-pal* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x3 :name (game-text-id center-screen) :scale #t) - (new 'static 'game-option :option-type #x5 :name (game-text-id video-mode) :scale #t) - (new 'static 'game-option :option-type #x4 :name (game-text-id aspect-ratio) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) +(define *graphic-title-options-pal* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option + :option-type (game-option-type center-screen) + :name (game-text-id center-screen) + :scale #t ) + (new 'static 'game-option + :option-type (game-option-type video-mode) + :name (game-text-id video-mode) + :scale #t + ) + (new 'static 'game-option + :option-type (game-option-type aspect-ratio) + :name (game-text-id aspect-ratio) + :scale #t + ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *sound-options*, type (array game-option) -(define - *sound-options* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :name (game-text-id sfx-volume) :scale #t :param2 100.0) - (new 'static 'game-option :name (game-text-id music-volume) :scale #t :param2 100.0) - (new 'static 'game-option :name (game-text-id speech-volume) :scale #t :param2 100.0) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) +(define *sound-options* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :name (game-text-id sfx-volume) :scale #t :param2 100.0) + (new 'static 'game-option :name (game-text-id music-volume) :scale #t :param2 100.0) + (new 'static 'game-option :name (game-text-id speech-volume) :scale #t :param2 100.0) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *yes-no-options*, type (array game-option) -(define *yes-no-options* (the-as (array game-option) (new - 'static - 'boxed-array - :type game-option :length 1 :allocated-length 1 - (new 'static 'game-option :option-type #x7 :scale #f) - ) - ) +(define *yes-no-options* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type yes-no) :scale #f) + ) ) ;; definition for symbol *ok-options*, type (array game-option) -(define - *ok-options* - (the-as (array game-option) (new - 'static - 'boxed-array - :type game-option :length 1 :allocated-length 1 - (new 'static 'game-option :option-type #x8 :name (game-text-id ok) :scale #f) - ) - ) +(define *ok-options* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id ok) :scale #f) + ) ) ;; definition for symbol *load-options*, type (array game-option) -(define - *load-options* - (the-as (array game-option) (new - 'static - 'boxed-array - :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) - ) +(define *load-options* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #f) + ) ) ;; definition for symbol *save-options*, type (array game-option) -(define - *save-options* - (the-as (array game-option) (new - 'static - 'boxed-array - :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) - ) +(define *save-options* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #f) + ) ) ;; definition for symbol *save-options-title*, type (array game-option) -(define - *save-options-title* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 6 :allocated-length 6 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id continue-without-saving) :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) +(define *save-options-title* + (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option + :option-type (game-option-type button) + :name (game-text-id continue-without-saving) + :scale #f ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #f) ) ) ;; definition for symbol *options-remap*, type (array (array game-option)) -(define - *options-remap* - (the-as (array (array game-option)) (new 'static 'boxed-array :type array :length 0 :allocated-length 35)) - ) +(define *options-remap* (new 'static 'boxed-array :type (array game-option) :length 0 :allocated-length 35)) ;; definition for symbol *level-task-data-remap*, type (array int32) -(define *level-task-data-remap* (the-as (array int32) (new - 'static - 'boxed-array - :type int32 :length 23 :allocated-length 23 - 0 - 1 - 2 - 3 - 3 - 4 - 5 - 6 - 7 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 13 - 13 - 14 - 15 - 15 - 4 - 4 - ) - ) - ) +(define *level-task-data-remap* + (new 'static 'boxed-array :type int32 0 1 2 3 3 4 5 6 7 7 8 9 10 11 12 13 13 13 14 15 15 4 4) + ) ;; definition for symbol *language-name-remap*, type (array game-text-id) -(define *language-name-remap* (new - 'static - 'boxed-array - :type game-text-id :length 6 :allocated-length 6 +(define *language-name-remap* (new 'static 'boxed-array :type game-text-id (game-text-id english) (game-text-id french) (game-text-id german) @@ -303,1179 +293,1051 @@ ) ;; definition for symbol *level-task-data*, type (array level-tasks-info) -(define - *level-task-data* - (the-as (array level-tasks-info) (new - 'static - 'boxed-array - :type level-tasks-info :length 16 :allocated-length 16 - (new 'static 'level-tasks-info - :level-name-id (game-text-id training-level-name) - :text-group-index 1 - :nb-of-tasks 4 - :buzzer-task-index 3 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task training-gimmie) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-gimmie-task-name) - (game-text-id training-gimmie-task-name) - (game-text-id training-gimmie-task-name) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task training-door) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-door-task-name) - (game-text-id training-door-task-name) - (game-text-id training-door-task-name) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task training-climb) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-climb-task-name) - (game-text-id training-climb-task-name) - (game-text-id training-climb-task-name) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task training-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-buzzer-task-name) - (game-text-id training-buzzer-task-name) - (game-text-id training-buzzer-task-name) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id village1-level-name) - :text-group-index 1 - :nb-of-tasks 6 - :buzzer-task-index 5 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task village1-mayor-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-mayor-money) - (game-text-id village1-mayor-money) - (game-text-id village1-mayor-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-uncle-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id vollage1-uncle-money) - (game-text-id vollage1-uncle-money) - (game-text-id vollage1-uncle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-yakow) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-yakow-herd) - (game-text-id village1-yakow-herd) - (game-text-id village1-yakow-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-oracle-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-oracle-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id beach-level-name) - :text-group-index 1 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task beach-ecorocks) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-ecorocks) - (game-text-id beach-ecorocks) - (game-text-id beach-ecorocks) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-flutflut) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-flutflut-push) - (game-text-id beach-flutflut-push) - (game-text-id beach-flutflut-meet) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-pelican) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-pelican) - (game-text-id beach-pelican) - (game-text-id beach-pelican) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-seagull) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-seagull) - (game-text-id beach-seagull) - (game-text-id beach-seagull-get) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-cannon) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-cannon) - (game-text-id beach-cannon) - (game-text-id beach-cannon) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-gimmie) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-gimmie) - (game-text-id beach-gimmie) - (game-text-id beach-gimmie) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-sentinel) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-sentinel) - (game-text-id beach-sentinel) - (game-text-id beach-sentinel) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id jungle-level-name) - :text-group-index 1 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task jungle-lurkerm) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-lurkerm-unblock) - (game-text-id jungle-lurkerm-connect) - (game-text-id jungle-lurkerm-return) - (game-text-id zero) - ) - :text-index-when-resolved 1 - ) - (new 'static 'task-info-data - :task-id (game-task jungle-tower) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-tower) - (game-text-id jungle-tower) - (game-text-id jungle-tower) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-eggtop) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-eggtop) - (game-text-id jungle-eggtop) - (game-text-id jungle-eggtop) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-plant) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-plant) - (game-text-id jungle-plant) - (game-text-id jungle-plant) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-fishgame) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-fishgame) - (game-text-id jungle-fishgame) - (game-text-id jungle-fishgame) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-canyon-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-canyon-end) - (game-text-id jungle-canyon-end) - (game-text-id jungle-canyon-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-temple-door) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-temple-door) - (game-text-id jungle-temple-door) - (game-text-id jungle-temple-door) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id misty-level-name) - :text-group-index 1 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task misty-muse) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-muse-catch) - (game-text-id misty-muse-catch) - (game-text-id misty-muse-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-boat) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-boat) - (game-text-id misty-boat) - (game-text-id misty-boat) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-cannon) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-cannon) - (game-text-id misty-cannon) - (game-text-id misty-cannon) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-warehouse) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-return-to-pool) - (game-text-id misty-return-to-pool) - (game-text-id misty-return-to-pool) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-bike) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-find-transpad) - (game-text-id misty-balloon-lurkers) - (game-text-id misty-find-transpad) - (game-text-id zero) - ) - :text-index-when-resolved 1 - ) - (new 'static 'task-info-data - :task-id (game-task misty-bike-jump) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-bike-jump) - (game-text-id misty-bike-jump) - (game-text-id misty-bike-jump) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-eco-challenge) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-eco-challenge) - (game-text-id misty-eco-challenge) - (game-text-id misty-eco-challenge) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id fire-canyon-level-name) - :text-group-index 5 - :nb-of-tasks 2 - :buzzer-task-index 1 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task firecanyon-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id fire-canyon-end) - (game-text-id fire-canyon-end) - (game-text-id fire-canyon-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task firecanyon-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id fire-canyon-buzzer) - (game-text-id fire-canyon-buzzer) - (game-text-id fire-canyon-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id village2-level-name) - :text-group-index 2 - :nb-of-tasks 6 - :buzzer-task-index 5 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task village2-gambler-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-gambler-money) - (game-text-id village2-gambler-money) - (game-text-id village2-gambler-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-geologist-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-geologist-money) - (game-text-id village2-geologist-money) - (game-text-id village2-geologist-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-warrior-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-warrior-money) - (game-text-id village2-warrior-money) - (game-text-id village2-warrior-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-oracle-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-oracle-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id sunken-level-name) - :text-group-index 2 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task sunken-room) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-elevator-raise) - (game-text-id sunken-elevator-raise) - (game-text-id sunken-elevator-get-to-roof) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-pipe) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-pipe) - (game-text-id sunken-pipe) - (game-text-id sunken-pipe) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-slide) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-bottom) - (game-text-id sunken-bottom) - (game-text-id sunken-bottom) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-sharks) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-pool) - (game-text-id sunken-pool) - (game-text-id sunken-pool) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-platforms) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-platforms) - (game-text-id sunken-platforms) - (game-text-id sunken-platforms) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-top-of-helix) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-climb-tube) - (game-text-id sunken-climb-tube) - (game-text-id sunken-climb-tube) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-spinning-room) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id reach-center) - (game-text-id reach-center) - (game-text-id reach-center) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id swamp-level-name) - :text-group-index 2 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task swamp-flutflut) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-flutflut) - (game-text-id swamp-flutflut) - (game-text-id swamp-flutflut) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-billy) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-billy) - (game-text-id swamp-billy) - (game-text-id swamp-billy) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-battle) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-battle) - (game-text-id swamp-battle) - (game-text-id swamp-battle) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-4) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-3) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id rolling-level-name) - :text-group-index 2 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task rolling-moles) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-moles) - (game-text-id rolling-moles) - (game-text-id rolling-moles-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-robbers) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-robbers) - (game-text-id rolling-robbers) - (game-text-id rolling-robbers) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-race) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-race) - (game-text-id rolling-race) - (game-text-id rolling-race-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-lake) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-lake) - (game-text-id rolling-lake) - (game-text-id rolling-lake) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-plants) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-plants) - (game-text-id rolling-plants) - (game-text-id rolling-plants) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-ring-chase-1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-ring-chase-1) - (game-text-id rolling-ring-chase-1) - (game-text-id rolling-ring-chase-1) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-ring-chase-2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-ring-chase-2) - (game-text-id rolling-ring-chase-2) - (game-text-id rolling-ring-chase-2) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id ogre-level-name) - :text-group-index 6 - :nb-of-tasks 4 - :buzzer-task-index 3 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task ogre-boss) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id ogre-boss) - (game-text-id ogre-boss) - (game-text-id ogre-boss) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task ogre-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id ogre-end) - (game-text-id ogre-end) - (game-text-id ogre-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task ogre-secret) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task ogre-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id ogre-buzzer) - (game-text-id ogre-buzzer) - (game-text-id ogre-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id village3-level-name) - :text-group-index 3 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task village3-miner-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-miner-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-miner-money3) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-miner-money4) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-oracle-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-oracle-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-extra1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id snowy-level-name) - :text-group-index 3 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task snow-eggtop) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-eggtop) - (game-text-id snow-eggtop) - (game-text-id snow-eggtop) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-ram) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-ram-3-left) - (game-text-id snow-ram-2-left) - (game-text-id snow-ram-1-left) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-bumpers) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-bumpers) - (game-text-id snow-bumpers) - (game-text-id snow-bumpers) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-cage) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-frozen-crate) - (game-text-id snow-frozen-crate) - (game-text-id snow-frozen-crate) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-fort) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-fort) - (game-text-id snow-fort) - (game-text-id snow-fort) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-ball) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-open-door) - (game-text-id snow-open-door) - (game-text-id snow-open-door) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-bunnies) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-bunnies) - (game-text-id snow-bunnies) - (game-text-id snow-bunnies) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id cave-level-name) - :text-group-index 3 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task cave-gnawers) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-gnawers) - (game-text-id cave-gnawers) - (game-text-id cave-gnawers) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-dark-crystals) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-dark-crystals) - (game-text-id cave-dark-crystals) - (game-text-id cave-dark-crystals) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-dark-climb) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-dark-climb) - (game-text-id cave-dark-climb) - (game-text-id cave-dark-climb) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-robot-climb) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-robot-climb) - (game-text-id cave-robot-climb) - (game-text-id cave-robot-climb) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-swing-poles) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-swing-poles) - (game-text-id cave-swing-poles) - (game-text-id cave-swing-poles) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-spider-tunnel) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-spider-tunnel) - (game-text-id cave-spider-tunnel) - (game-text-id cave-spider-tunnel) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-platforms) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-platforms) - (game-text-id cave-platforms) - (game-text-id cave-platforms) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id lavatube-level-name) - :text-group-index 3 - :nb-of-tasks 2 - :buzzer-task-index 1 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task lavatube-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id lavatube-end) - (game-text-id lavatube-end) - (game-text-id lavatube-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task lavatube-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id lavatube-buzzer) - (game-text-id lavatube-buzzer) - (game-text-id lavatube-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id citadel-level-name) - :text-group-index 4 - :nb-of-tasks 5 - :buzzer-task-index 4 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task citadel-sage-blue) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-blue) - (game-text-id citadel-sage-blue) - (game-text-id citadel-sage-blue) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-sage-red) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-red) - (game-text-id citadel-sage-red) - (game-text-id citadel-sage-red) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-sage-yellow) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-yellow) - (game-text-id citadel-sage-yellow) - (game-text-id citadel-sage-yellow) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-sage-green) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-green) - (game-text-id citadel-sage-green) - (game-text-id citadel-sage-green) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-buzzer) - (game-text-id citadel-buzzer) - (game-text-id citadel-buzzer) - (game-text-id zero) - ) - ) - ) - ) - ) - ) - ) +(define *level-task-data* (new 'static 'boxed-array :type level-tasks-info + (new 'static 'level-tasks-info + :level-name-id (game-text-id training-level-name) + :text-group-index 1 + :nb-of-tasks 4 + :buzzer-task-index 3 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task training-gimmie) + :task-name (new 'static 'array game-text-id 4 + (game-text-id training-gimmie-task-name) + (game-text-id training-gimmie-task-name) + (game-text-id training-gimmie-task-name) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task training-door) + :task-name (new 'static 'array game-text-id 4 + (game-text-id training-door-task-name) + (game-text-id training-door-task-name) + (game-text-id training-door-task-name) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task training-climb) + :task-name (new 'static 'array game-text-id 4 + (game-text-id training-climb-task-name) + (game-text-id training-climb-task-name) + (game-text-id training-climb-task-name) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task training-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id training-buzzer-task-name) + (game-text-id training-buzzer-task-name) + (game-text-id training-buzzer-task-name) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id village1-level-name) + :text-group-index 1 + :nb-of-tasks 6 + :buzzer-task-index 5 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task village1-mayor-money) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village1-mayor-money) + (game-text-id village1-mayor-money) + (game-text-id village1-mayor-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village1-uncle-money) + :task-name (new 'static 'array game-text-id 4 + (game-text-id vollage1-uncle-money) + (game-text-id vollage1-uncle-money) + (game-text-id vollage1-uncle-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village1-yakow) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village1-yakow-herd) + (game-text-id village1-yakow-herd) + (game-text-id village1-yakow-return) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village1-oracle-money1) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village1-oracle) + (game-text-id village1-oracle) + (game-text-id village1-oracle) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village1-oracle-money2) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village1-oracle) + (game-text-id village1-oracle) + (game-text-id village1-oracle) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village1-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id beach-level-name) + :text-group-index 1 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task beach-ecorocks) + :task-name (new 'static 'array game-text-id 4 + (game-text-id beach-ecorocks) + (game-text-id beach-ecorocks) + (game-text-id beach-ecorocks) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task beach-flutflut) + :task-name (new 'static 'array game-text-id 4 + (game-text-id beach-flutflut-push) + (game-text-id beach-flutflut-push) + (game-text-id beach-flutflut-meet) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task beach-pelican) + :task-name (new 'static 'array game-text-id 4 + (game-text-id beach-pelican) + (game-text-id beach-pelican) + (game-text-id beach-pelican) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task beach-seagull) + :task-name (new 'static 'array game-text-id 4 + (game-text-id beach-seagull) + (game-text-id beach-seagull) + (game-text-id beach-seagull-get) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task beach-cannon) + :task-name (new 'static 'array game-text-id 4 + (game-text-id beach-cannon) + (game-text-id beach-cannon) + (game-text-id beach-cannon) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task beach-gimmie) + :task-name (new 'static 'array game-text-id 4 + (game-text-id beach-gimmie) + (game-text-id beach-gimmie) + (game-text-id beach-gimmie) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task beach-sentinel) + :task-name (new 'static 'array game-text-id 4 + (game-text-id beach-sentinel) + (game-text-id beach-sentinel) + (game-text-id beach-sentinel) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task beach-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id jungle-level-name) + :text-group-index 1 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task jungle-lurkerm) + :task-name (new 'static 'array game-text-id 4 + (game-text-id jungle-lurkerm-unblock) + (game-text-id jungle-lurkerm-connect) + (game-text-id jungle-lurkerm-return) + (game-text-id zero) + ) + :text-index-when-resolved 1 + ) + (new 'static 'task-info-data + :task-id (game-task jungle-tower) + :task-name (new 'static 'array game-text-id 4 + (game-text-id jungle-tower) + (game-text-id jungle-tower) + (game-text-id jungle-tower) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task jungle-eggtop) + :task-name (new 'static 'array game-text-id 4 + (game-text-id jungle-eggtop) + (game-text-id jungle-eggtop) + (game-text-id jungle-eggtop) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task jungle-plant) + :task-name (new 'static 'array game-text-id 4 + (game-text-id jungle-plant) + (game-text-id jungle-plant) + (game-text-id jungle-plant) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task jungle-fishgame) + :task-name (new 'static 'array game-text-id 4 + (game-text-id jungle-fishgame) + (game-text-id jungle-fishgame) + (game-text-id jungle-fishgame) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task jungle-canyon-end) + :task-name (new 'static 'array game-text-id 4 + (game-text-id jungle-canyon-end) + (game-text-id jungle-canyon-end) + (game-text-id jungle-canyon-end) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task jungle-temple-door) + :task-name (new 'static 'array game-text-id 4 + (game-text-id jungle-temple-door) + (game-text-id jungle-temple-door) + (game-text-id jungle-temple-door) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task jungle-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id misty-level-name) + :text-group-index 1 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task misty-muse) + :task-name (new 'static 'array game-text-id 4 + (game-text-id misty-muse-catch) + (game-text-id misty-muse-catch) + (game-text-id misty-muse-return) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task misty-boat) + :task-name (new 'static 'array game-text-id 4 + (game-text-id misty-boat) + (game-text-id misty-boat) + (game-text-id misty-boat) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task misty-cannon) + :task-name (new 'static 'array game-text-id 4 + (game-text-id misty-cannon) + (game-text-id misty-cannon) + (game-text-id misty-cannon) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task misty-warehouse) + :task-name (new 'static 'array game-text-id 4 + (game-text-id misty-return-to-pool) + (game-text-id misty-return-to-pool) + (game-text-id misty-return-to-pool) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task misty-bike) + :task-name (new 'static 'array game-text-id 4 + (game-text-id misty-find-transpad) + (game-text-id misty-balloon-lurkers) + (game-text-id misty-find-transpad) + (game-text-id zero) + ) + :text-index-when-resolved 1 + ) + (new 'static 'task-info-data + :task-id (game-task misty-bike-jump) + :task-name (new 'static 'array game-text-id 4 + (game-text-id misty-bike-jump) + (game-text-id misty-bike-jump) + (game-text-id misty-bike-jump) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task misty-eco-challenge) + :task-name (new 'static 'array game-text-id 4 + (game-text-id misty-eco-challenge) + (game-text-id misty-eco-challenge) + (game-text-id misty-eco-challenge) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task misty-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id fire-canyon-level-name) + :text-group-index 5 + :nb-of-tasks 2 + :buzzer-task-index 1 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task firecanyon-end) + :task-name (new 'static 'array game-text-id 4 + (game-text-id fire-canyon-end) + (game-text-id fire-canyon-end) + (game-text-id fire-canyon-end) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task firecanyon-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id fire-canyon-buzzer) + (game-text-id fire-canyon-buzzer) + (game-text-id fire-canyon-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id village2-level-name) + :text-group-index 2 + :nb-of-tasks 6 + :buzzer-task-index 5 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task village2-gambler-money) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village2-gambler-money) + (game-text-id village2-gambler-money) + (game-text-id village2-gambler-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village2-geologist-money) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village2-geologist-money) + (game-text-id village2-geologist-money) + (game-text-id village2-geologist-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village2-warrior-money) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village2-warrior-money) + (game-text-id village2-warrior-money) + (game-text-id village2-warrior-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village2-oracle-money1) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village2-oracle-money) + (game-text-id village2-oracle-money) + (game-text-id village2-oracle-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village2-oracle-money2) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village2-oracle-money) + (game-text-id village2-oracle-money) + (game-text-id village2-oracle-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village2-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id sunken-level-name) + :text-group-index 2 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task sunken-room) + :task-name (new 'static 'array game-text-id 4 + (game-text-id sunken-elevator-raise) + (game-text-id sunken-elevator-raise) + (game-text-id sunken-elevator-get-to-roof) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task sunken-pipe) + :task-name (new 'static 'array game-text-id 4 + (game-text-id sunken-pipe) + (game-text-id sunken-pipe) + (game-text-id sunken-pipe) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task sunken-slide) + :task-name (new 'static 'array game-text-id 4 + (game-text-id sunken-bottom) + (game-text-id sunken-bottom) + (game-text-id sunken-bottom) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task sunken-sharks) + :task-name (new 'static 'array game-text-id 4 + (game-text-id sunken-pool) + (game-text-id sunken-pool) + (game-text-id sunken-pool) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task sunken-platforms) + :task-name (new 'static 'array game-text-id 4 + (game-text-id sunken-platforms) + (game-text-id sunken-platforms) + (game-text-id sunken-platforms) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task sunken-top-of-helix) + :task-name (new 'static 'array game-text-id 4 + (game-text-id sunken-climb-tube) + (game-text-id sunken-climb-tube) + (game-text-id sunken-climb-tube) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task sunken-spinning-room) + :task-name (new 'static 'array game-text-id 4 + (game-text-id reach-center) + (game-text-id reach-center) + (game-text-id reach-center) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task sunken-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id swamp-level-name) + :text-group-index 2 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task swamp-flutflut) + :task-name (new 'static 'array game-text-id 4 + (game-text-id swamp-flutflut) + (game-text-id swamp-flutflut) + (game-text-id swamp-flutflut) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task swamp-billy) + :task-name (new 'static 'array game-text-id 4 + (game-text-id swamp-billy) + (game-text-id swamp-billy) + (game-text-id swamp-billy) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task swamp-battle) + :task-name (new 'static 'array game-text-id 4 + (game-text-id swamp-battle) + (game-text-id swamp-battle) + (game-text-id swamp-battle) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task swamp-tether-4) + :task-name (new 'static 'array game-text-id 4 + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task swamp-tether-1) + :task-name (new 'static 'array game-text-id 4 + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task swamp-tether-2) + :task-name (new 'static 'array game-text-id 4 + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task swamp-tether-3) + :task-name (new 'static 'array game-text-id 4 + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task swamp-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id rolling-level-name) + :text-group-index 2 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task rolling-moles) + :task-name (new 'static 'array game-text-id 4 + (game-text-id rolling-moles) + (game-text-id rolling-moles) + (game-text-id rolling-moles-return) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task rolling-robbers) + :task-name (new 'static 'array game-text-id 4 + (game-text-id rolling-robbers) + (game-text-id rolling-robbers) + (game-text-id rolling-robbers) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task rolling-race) + :task-name (new 'static 'array game-text-id 4 + (game-text-id rolling-race) + (game-text-id rolling-race) + (game-text-id rolling-race-return) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task rolling-lake) + :task-name (new 'static 'array game-text-id 4 + (game-text-id rolling-lake) + (game-text-id rolling-lake) + (game-text-id rolling-lake) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task rolling-plants) + :task-name (new 'static 'array game-text-id 4 + (game-text-id rolling-plants) + (game-text-id rolling-plants) + (game-text-id rolling-plants) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task rolling-ring-chase-1) + :task-name (new 'static 'array game-text-id 4 + (game-text-id rolling-ring-chase-1) + (game-text-id rolling-ring-chase-1) + (game-text-id rolling-ring-chase-1) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task rolling-ring-chase-2) + :task-name (new 'static 'array game-text-id 4 + (game-text-id rolling-ring-chase-2) + (game-text-id rolling-ring-chase-2) + (game-text-id rolling-ring-chase-2) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task rolling-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id ogre-level-name) + :text-group-index 6 + :nb-of-tasks 4 + :buzzer-task-index 3 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task ogre-boss) + :task-name (new 'static 'array game-text-id 4 + (game-text-id ogre-boss) + (game-text-id ogre-boss) + (game-text-id ogre-boss) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task ogre-end) + :task-name (new 'static 'array game-text-id 4 + (game-text-id ogre-end) + (game-text-id ogre-end) + (game-text-id ogre-end) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task ogre-secret) + :task-name (new 'static 'array game-text-id 4 + (game-text-id hidden-power-cell) + (game-text-id hidden-power-cell) + (game-text-id hidden-power-cell) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task ogre-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id ogre-buzzer) + (game-text-id ogre-buzzer) + (game-text-id ogre-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id village3-level-name) + :text-group-index 3 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task village3-miner-money1) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village3-miner-money2) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village3-miner-money3) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village3-miner-money4) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village3-oracle-money1) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village3-oracle-money) + (game-text-id village3-oracle-money) + (game-text-id village3-oracle-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village3-oracle-money2) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village3-oracle-money) + (game-text-id village3-oracle-money) + (game-text-id village3-oracle-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village3-extra1) + :task-name (new 'static 'array game-text-id 4 + (game-text-id hidden-power-cell) + (game-text-id hidden-power-cell) + (game-text-id hidden-power-cell) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village3-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village3-buzzer) + (game-text-id village3-buzzer) + (game-text-id village3-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id snowy-level-name) + :text-group-index 3 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task snow-eggtop) + :task-name (new 'static 'array game-text-id 4 + (game-text-id snow-eggtop) + (game-text-id snow-eggtop) + (game-text-id snow-eggtop) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task snow-ram) + :task-name (new 'static 'array game-text-id 4 + (game-text-id snow-ram-3-left) + (game-text-id snow-ram-2-left) + (game-text-id snow-ram-1-left) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task snow-bumpers) + :task-name (new 'static 'array game-text-id 4 + (game-text-id snow-bumpers) + (game-text-id snow-bumpers) + (game-text-id snow-bumpers) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task snow-cage) + :task-name (new 'static 'array game-text-id 4 + (game-text-id snow-frozen-crate) + (game-text-id snow-frozen-crate) + (game-text-id snow-frozen-crate) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task snow-fort) + :task-name (new 'static 'array game-text-id 4 + (game-text-id snow-fort) + (game-text-id snow-fort) + (game-text-id snow-fort) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task snow-ball) + :task-name (new 'static 'array game-text-id 4 + (game-text-id snow-open-door) + (game-text-id snow-open-door) + (game-text-id snow-open-door) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task snow-bunnies) + :task-name (new 'static 'array game-text-id 4 + (game-text-id snow-bunnies) + (game-text-id snow-bunnies) + (game-text-id snow-bunnies) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task snow-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village3-buzzer) + (game-text-id village3-buzzer) + (game-text-id village3-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id cave-level-name) + :text-group-index 3 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task cave-gnawers) + :task-name (new 'static 'array game-text-id 4 + (game-text-id cave-gnawers) + (game-text-id cave-gnawers) + (game-text-id cave-gnawers) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task cave-dark-crystals) + :task-name (new 'static 'array game-text-id 4 + (game-text-id cave-dark-crystals) + (game-text-id cave-dark-crystals) + (game-text-id cave-dark-crystals) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task cave-dark-climb) + :task-name (new 'static 'array game-text-id 4 + (game-text-id cave-dark-climb) + (game-text-id cave-dark-climb) + (game-text-id cave-dark-climb) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task cave-robot-climb) + :task-name (new 'static 'array game-text-id 4 + (game-text-id cave-robot-climb) + (game-text-id cave-robot-climb) + (game-text-id cave-robot-climb) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task cave-swing-poles) + :task-name (new 'static 'array game-text-id 4 + (game-text-id cave-swing-poles) + (game-text-id cave-swing-poles) + (game-text-id cave-swing-poles) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task cave-spider-tunnel) + :task-name (new 'static 'array game-text-id 4 + (game-text-id cave-spider-tunnel) + (game-text-id cave-spider-tunnel) + (game-text-id cave-spider-tunnel) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task cave-platforms) + :task-name (new 'static 'array game-text-id 4 + (game-text-id cave-platforms) + (game-text-id cave-platforms) + (game-text-id cave-platforms) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task cave-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id village3-buzzer) + (game-text-id village3-buzzer) + (game-text-id village3-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id lavatube-level-name) + :text-group-index 3 + :nb-of-tasks 2 + :buzzer-task-index 1 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task lavatube-end) + :task-name (new 'static 'array game-text-id 4 + (game-text-id lavatube-end) + (game-text-id lavatube-end) + (game-text-id lavatube-end) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task lavatube-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id lavatube-buzzer) + (game-text-id lavatube-buzzer) + (game-text-id lavatube-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id citadel-level-name) + :text-group-index 4 + :nb-of-tasks 5 + :buzzer-task-index 4 + :task-info (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task citadel-sage-blue) + :task-name (new 'static 'array game-text-id 4 + (game-text-id citadel-sage-blue) + (game-text-id citadel-sage-blue) + (game-text-id citadel-sage-blue) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task citadel-sage-red) + :task-name (new 'static 'array game-text-id 4 + (game-text-id citadel-sage-red) + (game-text-id citadel-sage-red) + (game-text-id citadel-sage-red) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task citadel-sage-yellow) + :task-name (new 'static 'array game-text-id 4 + (game-text-id citadel-sage-yellow) + (game-text-id citadel-sage-yellow) + (game-text-id citadel-sage-yellow) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task citadel-sage-green) + :task-name (new 'static 'array game-text-id 4 + (game-text-id citadel-sage-green) + (game-text-id citadel-sage-green) + (game-text-id citadel-sage-green) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task citadel-buzzer) + :task-name (new 'static 'array game-text-id 4 + (game-text-id citadel-buzzer) + (game-text-id citadel-buzzer) + (game-text-id citadel-buzzer) + (game-text-id zero) + ) + ) + ) + ) + ) + ) ;; definition for symbol *task-egg-starting-x*, type (array int32) -(define - *task-egg-starting-x* - (the-as (array int32) - (new 'static 'boxed-array :type int32 :length 9 :allocated-length 9 #xda #xc2 #xab #x93 #x7c 100 77 53 30) - ) - ) +(define *task-egg-starting-x* (new 'static 'boxed-array :type int32 #xda #xc2 #xab #x93 #x7c 100 77 53 30)) ;; definition for symbol *game-counts*, type game-count-info (define *game-counts* (the-as game-count-info #f)) diff --git a/test/decompiler/reference/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/engine/ui/progress/progress_REF.gc index 8d459e890b..31740517b5 100644 --- a/test/decompiler/reference/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/engine/ui/progress/progress_REF.gc @@ -10,7 +10,7 @@ (starting-state progress-screen :offset-assert 24) (last-slot-saved int32 :offset-assert 32) (slider-backup float :offset-assert 36) - (language-backup int64 :offset-assert 40) + (language-backup language-enum :offset-assert 40) (on-off-backup symbol :offset-assert 48) (center-x-backup int32 :offset-assert 52) (center-y-backup int32 :offset-assert 56) @@ -51,30 +51,23 @@ ;; definition for function progress-allowed? (defun progress-allowed? () - (with-pp - (not (or (-> *setting-control* current talking) - (-> *setting-control* current movie) - (movie?) - (handle->process (-> *game-info* pov-camera-handle)) - (handle->process (-> *game-info* other-camera-handle)) - (< (-> *display* base-frame-counter) (-> *game-info* letterbox-time)) - (< (-> *display* base-frame-counter) (-> *game-info* blackout-time)) - (!= (-> *setting-control* current bg-a) 0.0) - (!= (-> *setting-control* current bg-a-force) 0.0) - (not (-> *setting-control* current allow-progress)) - (or (and (handle->process (-> *game-info* auto-save-proc)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 0) - (set! (-> a1-3 message) 'progress-allowed?) - (not (send-event-function (handle->process (-> *game-info* auto-save-proc)) a1-3)) - ) - ) - (not *target*) - ) - ) - ) - ) + (not (or (-> *setting-control* current talking) + (-> *setting-control* current movie) + (movie?) + (handle->process (-> *game-info* pov-camera-handle)) + (handle->process (-> *game-info* other-camera-handle)) + (< (-> *display* base-frame-counter) (-> *game-info* letterbox-time)) + (< (-> *display* base-frame-counter) (-> *game-info* blackout-time)) + (!= (-> *setting-control* current bg-a) 0.0) + (!= (-> *setting-control* current bg-a-force) 0.0) + (not (-> *setting-control* current allow-progress)) + (or (and (handle->process (-> *game-info* auto-save-proc)) + (not (send-event (handle->process (-> *game-info* auto-save-proc)) 'progress-allowed?)) + ) + (not *target*) + ) + ) + ) ) ;; definition for function pause-allowed? @@ -820,18 +813,7 @@ (make-levels-with-tasks-available-to-progress) (disable-level-text-file-loading) (set! (-> *progress-state* starting-state) screen) - (let ((s4-0 (get-process *default-dead-pool* progress #x4000))) - (set! *progress-process* - (the-as (pointer progress) (when s4-0 - (let ((t9-5 (method-of-type progress activate))) - (t9-5 (the-as progress s4-0) creator 'progress (&-> *progress-stack* 14336)) - ) - (run-now-in-process s4-0 progress-init-by-other) - (-> s4-0 ppointer) - ) - ) - ) - ) + (set! *progress-process* (process-spawn progress :to creator :stack (&-> *progress-stack* 14336))) (let ((s5-1 *progress-process*)) (set! (-> s5-1 0 completion-percentage) (calculate-completion (-> s5-1 0))) (set! *master-mode* 'progress) @@ -875,7 +857,7 @@ ;; INFO: Return type mismatch int vs none. (defun deactivate-progress () (when (and *progress-process* (= (-> *progress-process* 0 next-state name) 'progress-gone)) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (dotimes (gp-0 (-> *progress-process* 0 nb-of-particles)) (kill-and-free-particles (-> *progress-process* 0 particles gp-0 part)) (set! (-> *progress-process* 0 particles gp-0 part matrix) -1) @@ -1065,7 +1047,7 @@ ) ;; definition for method 32 of type progress -(defmethod dummy-32 progress ((obj progress)) +(defmethod can-go-back? progress ((obj progress)) (let ((v1-2 (-> *progress-process* 0 display-state)) (a1-1 (-> *progress-state* starting-state)) ) @@ -1095,7 +1077,7 @@ ;; definition for method 19 of type progress ;; INFO: Return type mismatch object vs symbol. -(defmethod dummy-19 progress ((obj progress)) +(defmethod visible? progress ((obj progress)) (the-as symbol (and *progress-process* (zero? (-> *progress-process* 0 in-out-position)))) ) @@ -1106,24 +1088,22 @@ ;; failed to figure out what this is: (defstate progress-waiting (progress) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('go-away) (go progress-gone) ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (hud-hidden?) (dotimes (gp-0 (-> self nb-of-particles)) (if (= (-> self particles gp-0 part matrix) -1) (set! (-> self particles gp-0 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set-setting! *setting-control* self 'common-page 'set (the-as float 0.0) 1) + (set-setting! 'common-page 'set 0.0 1) (suspend) (go progress-coming-in) ) @@ -1135,10 +1115,9 @@ ;; failed to figure out what this is: (defstate progress-gone (progress) - :code - (behavior () - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (copy-settings-from-target! *setting-control*) + :code (behavior () + (remove-setting! 'process-mask) + (apply-settings *setting-control*) (logior! (-> self mask) (process-mask sleep)) (suspend) 0 @@ -1147,7 +1126,7 @@ ) ;; definition for method 53 of type progress -(defmethod dummy-53 progress ((obj progress) (arg0 progress-screen)) +(defmethod set-memcard-screen progress ((obj progress) (arg0 progress-screen)) (let ((s4-0 (-> obj card-info)) (gp-0 arg0) ) @@ -1250,7 +1229,7 @@ ;; definition for method 31 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod dummy-31 progress ((obj progress)) +(defmethod respond-memcard progress ((obj progress)) (let ((s5-0 (-> obj card-info))) (when (and s5-0 (not (-> obj in-transition))) (when (or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) @@ -1263,13 +1242,13 @@ (cond ((< (-> obj option-index) 4) (when (nonzero? (-> s5-0 file (-> obj option-index) present)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *progress-state* which) (-> obj option-index)) (set! (-> obj next-display-state) (progress-screen memcard-loading)) ) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1277,7 +1256,7 @@ (((progress-screen save-game) (progress-screen save-game-title)) (cond ((< (-> obj option-index) 4) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *progress-state* which) (-> obj option-index)) (if (zero? (-> s5-0 file (-> obj option-index) present)) (set! (-> obj next-display-state) (progress-screen memcard-saving)) @@ -1285,47 +1264,45 @@ ) ) ((and (= (-> obj display-state) (progress-screen save-game-title)) (= (-> obj option-index) 4)) - (sound-play-by-name (static-sound-name "starts-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "starts-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) ) (((progress-screen memcard-insert)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen memcard-data-exists)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-saving)) ) - ((begin - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (= (-> obj display-state-stack 0) (progress-screen title)) - ) - (set! (-> obj next-display-state) (progress-screen save-game-title)) - ) (else - (set! (-> obj next-display-state) (progress-screen save-game)) + (sound-play "cursor-options") + (if (= (-> obj display-state-stack 0) (progress-screen title)) + (set! (-> obj next-display-state) (progress-screen save-game-title)) + (set! (-> obj next-display-state) (progress-screen save-game)) + ) ) ) ) (((progress-screen memcard-no-data)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-creating)) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") @@ -1339,18 +1316,18 @@ ) (cond ((= (-> obj display-state-stack 0) (progress-screen title)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) ((nonzero? (-> obj display-state-stack 0)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1363,19 +1340,19 @@ (progress-screen memcard-removed) (progress-screen auto-save) ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen pal-change-to-60hz)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) (set! (-> obj video-mode-timeout) (-> *display* real-frame-counter)) (set! (-> obj next-display-state) (progress-screen pal-now-60hz)) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> *progress-state* video-mode-choice) 'pal) (set! (-> obj next-display-state) (progress-screen invalid)) ) @@ -1386,30 +1363,30 @@ ((not (-> *progress-state* yes-no-choice)) (set! (-> *progress-state* video-mode-choice) 'pal) (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") ) (else - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") ) ) (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen no-disc) (progress-screen bad-disc)) (when (is-cd-in?) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) (((progress-screen quit)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "title-start") ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1417,18 +1394,18 @@ (((progress-screen memcard-format)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-formatting)) ) ((= (-> obj display-state-stack 0) (progress-screen title)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1443,7 +1420,7 @@ ;; definition for method 29 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod dummy-29 progress ((obj progress)) +(defmethod respond-common progress ((obj progress)) (mc-get-slot-info 0 *progress-save-info*) (set! (-> obj card-info) *progress-save-info*) (let ((s5-0 (-> *options-remap* (-> obj display-state)))) @@ -1454,7 +1431,7 @@ ((cpad-pressed? 0 up) (when (not (-> obj selected-option)) (if (!= (length s5-0) 1) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") ) (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) (if (> (-> obj option-index) 0) @@ -1467,7 +1444,7 @@ (when (-> obj selected-option) (let ((v1-34 #f)) (case (-> s5-0 (-> obj option-index) option-type) - ((3) + (((game-option-type center-screen)) (when (< -48 (-> *setting-control* current screeny)) (set! v1-34 #t) (+! (-> *setting-control* default screeny) -1) @@ -1477,7 +1454,7 @@ (when v1-34 (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) 1024 0 0 1 #t) + (sound-play "slider2001") ) ) ) @@ -1490,7 +1467,7 @@ ((cpad-pressed? 0 down) (when (not (-> obj selected-option)) (if (!= (length s5-0) 1) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") ) (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) (cond @@ -1508,7 +1485,7 @@ (when (-> obj selected-option) (let ((v1-69 #f)) (case (-> s5-0 (-> obj option-index) option-type) - ((3) + (((game-option-type center-screen)) (when (< (-> *setting-control* current screeny) 48) (set! v1-69 #t) (+! (-> *setting-control* default screeny) 1) @@ -1518,7 +1495,7 @@ (when v1-69 (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) 1024 0 0 1 #t) + (sound-play "slider2001") ) ) ) @@ -1529,10 +1506,10 @@ ((cpad-hold? 0 left) (cond ((cpad-pressed? 0 left) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) 7)) + (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no))) (let ((s4-5 #f)) (case (-> s5-0 (-> obj option-index) option-type) - ((2 7) + (((game-option-type on-off) (game-option-type yes-no)) (when (not (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) (set! s4-5 #t) (if (= (-> s5-0 (-> obj option-index) value-to-modify) (&-> *setting-control* current vibration)) @@ -1541,15 +1518,15 @@ ) (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) #t) ) - ((4) + (((game-option-type aspect-ratio)) (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect16x9)) (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect4x3) ) - ((5) + (((game-option-type video-mode)) (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc)) (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'pal) ) - ((1) + (((game-option-type language)) (if (> (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) 0) (+! (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify))) -1) (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) @@ -1567,7 +1544,7 @@ ) ) (if s4-5 - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -1575,35 +1552,33 @@ (else (when (-> obj selected-option) (let ((v1-157 #f)) - (let ((a0-101 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? a0-101) - (cond - ((>= (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ 1.0 (-> s5-0 (-> obj option-index) param1)) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (cond + ((>= (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (+ 1.0 (-> s5-0 (-> obj option-index) param1)) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (+ -1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ -1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - (set! v1-157 #t) - ) - ((< (-> s5-0 (-> obj option-index) param1) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param1) - ) - (set! v1-157 #t) - ) - ) + (set! v1-157 #t) + ) + ((< (-> s5-0 (-> obj option-index) param1) + (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> s5-0 (-> obj option-index) param1) + ) + (set! v1-157 #t) + ) ) - ((= a0-101 3) - (when (< -96 (-> *setting-control* default screenx)) - (set! v1-157 #t) - (+! (-> *setting-control* default screenx) -1) - ) + ) + (((game-option-type center-screen)) + (when (< -96 (-> *setting-control* default screenx)) + (set! v1-157 #t) + (+! (-> *setting-control* default screenx) -1) ) - ) + ) ) (when v1-157 (let ((f30-0 100.0)) @@ -1614,7 +1589,7 @@ ) (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 f30-0)) 0 0 1 #t) + (sound-play "slider2001" :vol f30-0) ) ) ) @@ -1626,22 +1601,22 @@ ((cpad-hold? 0 right) (cond ((cpad-pressed? 0 right) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) 7)) + (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no))) (let ((v1-217 (the-as object #f))) (case (-> s5-0 (-> obj option-index) option-type) - ((2 7) + (((game-option-type on-off) (game-option-type yes-no)) (set! v1-217 (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) #f) ) - ((4) + (((game-option-type aspect-ratio)) (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect4x3)) (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect16x9) ) - ((5) + (((game-option-type video-mode)) (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'pal)) (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc) ) - ((1) + (((game-option-type language)) (let ((v1-243 (if (and (zero? (scf-get-territory)) (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) ) @@ -1666,7 +1641,7 @@ ) ) (if v1-217 - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -1674,35 +1649,33 @@ (else (when (-> obj selected-option) (let ((v1-263 #f)) - (let ((a0-177 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? a0-177) - (cond - ((>= (+ -1.0 (-> s5-0 (-> obj option-index) param2)) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (cond + ((>= (+ -1.0 (-> s5-0 (-> obj option-index) param2)) + (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (+ 1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ 1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - (set! v1-263 #t) - ) - ((< (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) - ) - (set! v1-263 #t) - ) - ) + (set! v1-263 #t) + ) + ((< (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> s5-0 (-> obj option-index) param2) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> s5-0 (-> obj option-index) param2) + ) + (set! v1-263 #t) + ) ) - ((= a0-177 3) - (when (< (-> *setting-control* default screenx) 96) - (set! v1-263 #t) - (+! (-> *setting-control* default screenx) 1) - ) + ) + (((game-option-type center-screen)) + (when (< (-> *setting-control* default screenx) 96) + (set! v1-263 #t) + (+! (-> *setting-control* default screenx) 1) ) - ) + ) ) (when v1-263 (let ((f30-1 100.0)) @@ -1713,7 +1686,7 @@ ) (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 f30-1)) 0 0 1 #t) + (sound-play "slider2001" :vol f30-1) ) ) ) @@ -1725,38 +1698,36 @@ ((or (cpad-pressed? 0 square) (cpad-pressed? 0 triangle)) (cond ((-> obj selected-option) - (let ((v1-319 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? v1-319) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* slider-backup) - ) - ) - ((= v1-319 1) - (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* language-backup) - ) - ) - ((= v1-319 2) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) - (-> *progress-state* on-off-backup) - ) - ) - ((= v1-319 3) - (set! (-> *setting-control* default screenx) (-> *progress-state* center-x-backup)) - (set! (-> *setting-control* default screeny) (-> *progress-state* center-y-backup)) - ) - ((or (= v1-319 4) (= v1-319 5)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) - (-> *progress-state* aspect-ratio-backup) - ) - ) - ) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> *progress-state* slider-backup) + ) + ) + (((game-option-type language)) + (set! (-> (the-as (pointer language-enum) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (-> *progress-state* language-backup) + ) + ) + (((game-option-type on-off)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (-> *progress-state* on-off-backup) + ) + ) + (((game-option-type center-screen)) + (set! (-> *setting-control* default screenx) (-> *progress-state* center-x-backup)) + (set! (-> *setting-control* default screeny) (-> *progress-state* center-y-backup)) + ) + (((game-option-type aspect-ratio) (game-option-type video-mode)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (-> *progress-state* aspect-ratio-backup) + ) + ) ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj selected-option) #f) ) - ((or (dummy-32 obj) + ((or (can-go-back? obj) (= (-> obj display-state) (progress-screen load-game)) (= (-> obj display-state) (progress-screen save-game)) (= (-> obj display-state) (progress-screen save-game-title)) @@ -1766,8 +1737,8 @@ (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) (if (= (-> obj display-state) (progress-screen settings)) - (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "menu-stats") + (sound-play "cursor-options") ) (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) (set! (-> obj next-display-state) (progress-screen invalid)) @@ -1778,21 +1749,21 @@ (cond ((not (-> obj selected-option)) (cond - ((= (-> s5-0 (-> obj option-index) option-type) 6) + ((= (-> s5-0 (-> obj option-index) option-type) (game-option-type menu)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) (push! obj) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (the-as progress-screen (-> s5-0 (-> obj option-index) param3))) (case (-> obj next-display-state) (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) - (set! (-> obj next-display-state) (dummy-53 obj (-> obj next-display-state))) + (set! (-> obj next-display-state) (set-memcard-screen obj (-> obj next-display-state))) ) ) ) - ((= (-> s5-0 (-> obj option-index) option-type) 8) + ((= (-> s5-0 (-> obj option-index) option-type) (game-option-type button)) (cond ((= (-> s5-0 (-> obj option-index) name) (game-text-id exit-demo)) (set! *master-exit* 'force) @@ -1800,51 +1771,49 @@ ) ((= (-> s5-0 (-> obj option-index) name) (game-text-id back)) (if (= (-> obj display-state) (progress-screen settings)) - (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "menu-stats") + (sound-play "cursor-options") ) (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) (set! (-> obj next-display-state) (progress-screen invalid)) ) ) ) - ((!= (-> s5-0 (-> obj option-index) option-type) 7) - (let ((v1-427 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? v1-427) - (set! (-> *progress-state* slider-backup) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - ) - ) - ((= v1-427 1) - (set! (-> *progress-state* language-backup) - (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ((= v1-427 2) - (set! (-> *progress-state* on-off-backup) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ((= v1-427 3) - (set! (-> *progress-state* center-x-backup) (-> *setting-control* default screenx)) - (set! (-> *progress-state* center-y-backup) (-> *setting-control* default screeny)) - ) - ((or (= v1-427 4) (= v1-427 5)) - (set! (-> *progress-state* aspect-ratio-backup) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ) + ((!= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no)) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (set! (-> *progress-state* slider-backup) + (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ) + ) + (((game-option-type language)) + (set! (-> *progress-state* language-backup) + (the-as language-enum (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) + ) + ) + (((game-option-type on-off)) + (set! (-> *progress-state* on-off-backup) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + ) + ) + (((game-option-type center-screen)) + (set! (-> *progress-state* center-x-backup) (-> *setting-control* default screenx)) + (set! (-> *progress-state* center-y-backup) (-> *setting-control* default screeny)) + ) + (((game-option-type aspect-ratio) (game-option-type video-mode)) + (set! (-> *progress-state* aspect-ratio-backup) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + ) + ) ) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) (set! (-> obj selected-option) #t) - (when (= (-> s5-0 (-> obj option-index) option-type) 1) - (set! (-> obj language-selection) (the-as uint (-> *setting-control* current language))) + (when (= (-> s5-0 (-> obj option-index) option-type) (game-option-type language)) + (set! (-> obj language-selection) (-> *setting-control* current language)) (set! (-> obj language-direction) #t) (set! (-> obj language-transition) #f) (set! (-> obj language-x-offset) 0) @@ -1854,15 +1823,15 @@ ) ) (else - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj selected-option) #f) (case (-> s5-0 (-> obj option-index) option-type) - ((4) + (((game-option-type aspect-ratio)) (set! (-> *setting-control* default aspect-ratio) (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) ) ) - ((5) + (((game-option-type video-mode)) (case (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))) (('pal) (set! (-> *setting-control* default video-mode) @@ -1875,7 +1844,7 @@ ) ) ) - ((1) + (((game-option-type language)) (if (not (-> obj language-transition)) (load-level-text-files (-> obj display-level-index)) ) @@ -1900,7 +1869,7 @@ (let ((s5-0 (-> obj display-level-index))) (set! (-> obj next-level-index) (get-next-level-down s5-0)) (when (!= s5-0 (-> obj next-level-index)) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! (-> obj level-transition) 2) ) ) @@ -1909,28 +1878,28 @@ (let ((s5-2 (-> obj next-level-index))) (set! (-> obj next-level-index) (get-next-level-up s5-2)) (when (!= s5-2 (-> obj next-level-index)) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! (-> obj level-transition) 1) ) ) ) ((cpad-pressed? 0 square) (when (nonzero? (-> obj display-state)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (progress-screen fuel-cell)) (set! (-> obj stat-transition) #t) ) ) ((cpad-pressed? 0 x) (when (!= (-> obj display-state) (progress-screen money)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (progress-screen money)) (set! (-> obj stat-transition) #t) ) ) ((cpad-pressed? 0 triangle) (when (!= (-> obj display-state) (progress-screen buzzer)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (progress-screen buzzer)) (set! (-> obj stat-transition) #t) ) @@ -1938,7 +1907,7 @@ ((cpad-pressed? 0 circle) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (push! obj) (set! (-> obj next-display-state) (progress-screen settings)) ) @@ -1948,7 +1917,7 @@ (let ((s5-8 (-> obj task-index))) (set! (-> obj task-index) (get-next-task-down (-> obj task-index) (-> obj display-level-index))) (if (!= s5-8 (-> obj task-index)) - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -1956,7 +1925,7 @@ (let ((s5-10 (-> obj task-index))) (set! (-> obj task-index) (get-next-task-up (-> obj task-index) (-> obj display-level-index))) (if (!= s5-10 (-> obj task-index)) - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -1970,8 +1939,7 @@ ;; failed to figure out what this is: (defstate progress-normal (progress) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 none)) (let ((v1-0 arg2)) (the-as object (cond @@ -2130,9 +2098,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (and (cpad-hold? 0 l1) (cpad-hold? 0 r1) *cheat-mode*) (when (and (< (-> self task-index) (-> *level-task-data* (-> self display-level-index) nb-of-tasks)) (>= (-> self task-index) 0) @@ -2146,30 +2113,26 @@ (if (and (= (-> self display-state) (-> self next-display-state)) (= (-> self display-level-index) (-> self next-level-index)) ) - (set! (-> self transition-offset) - (seekl - (-> self transition-offset) - 0 - (* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - (if (or (-> self stat-transition) (nonzero? (-> self level-transition))) - 2 - 1 - ) - ) - ) - ) - (set! (-> self transition-offset) - (seekl - (-> self transition-offset) - 512 - (* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - (if (or (-> self stat-transition) (nonzero? (-> self level-transition))) - 2 - 1 - ) - ) - ) - ) + (seekl! + (-> self transition-offset) + 0 + (* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) + (if (or (-> self stat-transition) (nonzero? (-> self level-transition))) + 2 + 1 + ) + ) + ) + (seekl! + (-> self transition-offset) + 512 + (* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) + (if (or (-> self stat-transition) (nonzero? (-> self level-transition))) + 2 + 1 + ) + ) + ) ) (set-transition-progress! self (-> self transition-offset)) (set! (-> self in-transition) (or (-> self force-transition) (nonzero? (-> self transition-offset)))) @@ -2238,8 +2201,8 @@ ) ) ) - (dummy-29 self) - (set! (-> self next-display-state) (dummy-53 self (-> self next-display-state))) + (respond-common self) + (set! (-> self next-display-state) (set-memcard-screen self (-> self next-display-state))) (let ((v1-74 (-> self display-state))) (cond ((or (= v1-74 (progress-screen fuel-cell)) @@ -2270,7 +2233,7 @@ (= v1-74 (progress-screen bad-disc)) (= v1-74 (progress-screen quit)) ) - (dummy-31 self) + (respond-memcard self) ) ) ) @@ -2278,8 +2241,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (let* ((a1-0 (-> self display-level-index)) (gp-0 (-> *level-task-data* a1-0)) ) @@ -2451,32 +2413,26 @@ ;; failed to figure out what this is: (defstate progress-coming-in (progress) - :event - (-> progress-waiting event) - :enter - (behavior () - (sound-group-pause (the-as uint 255)) + :event (-> progress-waiting event) + :enter (behavior () + (sound-group-pause (sound-group sfx music dialog sog3 ambient sog5 sog6 sog7)) (logclear! (-> *setting-control* default process-mask) (process-mask pause menu)) - (push-setting! *setting-control* self 'process-mask 'set 0.0 16) - (copy-settings-from-target! *setting-control*) - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) + (add-setting! 'process-mask 'set 0.0 (process-mask progress)) + (apply-settings *setting-control*) + (sound-play "select-menu") (set-blackout-frames 0) (set! *pause-lock* #f) (none) ) - :code - (behavior () - (while #t - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 0 (the int (* 170.0 (-> *display* time-adjust-ratio)))) - ) + :code (behavior () + (loop + (seekl! (-> self in-out-position) 0 (the int (* 170.0 (-> *display* time-adjust-ratio)))) (when (< (-> self in-out-position) 2867) - (set! (-> self transition-offset) (seekl - (-> self transition-offset) - 0 - (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - ) - ) + (seekl! + (-> self transition-offset) + 0 + (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) + ) (set-transition-progress! self (-> self transition-offset)) ) (if (zero? (-> self in-out-position)) @@ -2486,15 +2442,13 @@ ) (none) ) - :post - (-> progress-normal post) + :post (-> progress-normal post) ) ;; failed to figure out what this is: (defstate progress-going-out (progress) - :enter - (behavior () - (sound-play-by-name (static-sound-name "menu-close") (new-sound-id) 1024 0 0 1 #t) + :enter (behavior () + (sound-play "menu-close") (hide-progress-icons) (set! (-> self particles 3 init-pos x) -320.0) (set! (-> self particles 4 init-pos x) -320.0) @@ -2505,20 +2459,16 @@ ) (none) ) - :code - (behavior () - (while #t - (set! (-> self transition-offset) (seekl - (-> self transition-offset) - 512 - (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - ) - ) + :code (behavior () + (loop + (seekl! + (-> self transition-offset) + 512 + (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) + ) (set-transition-progress! self (-> self transition-offset)) (when (< 153 (-> self transition-offset)) - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 4096 (the int (* 170.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self in-out-position) 4096 (the int (* 170.0 (-> *display* time-adjust-ratio)))) (if (= (-> self in-out-position) 4096) (go progress-gone) ) @@ -2527,23 +2477,20 @@ ) (none) ) - :post - (-> progress-normal post) + :post (-> progress-normal post) ) ;; failed to figure out what this is: (defstate progress-debug (progress) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('go-away) (go progress-going-out) ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (cond ((cpad-pressed? 0 left) (if (> (-> self current-debug-string) 0) @@ -2590,8 +2537,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-0 (-> s5-0 base)) ) @@ -2644,7 +2590,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-4) ) @@ -2666,7 +2612,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-1 (the-as (pointer dma-tag) a3-6) ) @@ -2688,7 +2634,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-2 (the-as (pointer dma-tag) a3-8) ) @@ -2710,7 +2656,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-3 (the-as (pointer dma-tag) a3-10) ) diff --git a/test/decompiler/reference/engine/ui/text-h_REF.gc b/test/decompiler/reference/engine/ui/text-h_REF.gc index c8de1a6002..079e18108b 100644 --- a/test/decompiler/reference/engine/ui/text-h_REF.gc +++ b/test/decompiler/reference/engine/ui/text-h_REF.gc @@ -47,10 +47,7 @@ ) ;; definition for symbol *text-group-names*, type (array string) -(define - *text-group-names* - (the-as (array string) (new 'static 'boxed-array :type string :length 1 :allocated-length 1 "common")) - ) +(define *text-group-names* (the-as (array string) (new 'static 'boxed-array :type string "common"))) ;; definition for symbol *common-text-heap*, type kheap (define *common-text-heap* (new 'global 'kheap)) diff --git a/test/decompiler/reference/engine/ui/text_REF.gc b/test/decompiler/reference/engine/ui/text_REF.gc index 283a948276..763553336b 100644 --- a/test/decompiler/reference/engine/ui/text_REF.gc +++ b/test/decompiler/reference/engine/ui/text_REF.gc @@ -136,8 +136,7 @@ ) ) cfg-13 - :delay - (nop!) + :delay (nop!) ) ) (label cfg-16) @@ -243,16 +242,16 @@ (set-vector! s5-0 128 128 128 128) (add-debug-line2d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> gp-0 vector)) (-> gp-0 vector 1) (the-as vector s5-0) ) - (add-debug-line2d #t (bucket-id debug-draw1) (-> gp-0 vector 1) (-> gp-0 vector 2) (the-as vector s5-0)) - (add-debug-line2d #t (bucket-id debug-draw1) (-> gp-0 vector 2) (-> gp-0 vector 3) (the-as vector s5-0)) + (add-debug-line2d #t (bucket-id debug-no-zbuf) (-> gp-0 vector 1) (-> gp-0 vector 2) (the-as vector s5-0)) + (add-debug-line2d #t (bucket-id debug-no-zbuf) (-> gp-0 vector 2) (-> gp-0 vector 3) (the-as vector s5-0)) (add-debug-line2d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 vector 3) (the-as vector (-> gp-0 vector)) (the-as vector s5-0) @@ -522,7 +521,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s2-1 (the-as (pointer dma-tag) a3-3) ) diff --git a/test/decompiler/reference/engine/util/glist_REF.gc b/test/decompiler/reference/engine/util/glist_REF.gc new file mode 100644 index 0000000000..1490de39a8 --- /dev/null +++ b/test/decompiler/reference/engine/util/glist_REF.gc @@ -0,0 +1,243 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +;; definition for function glst-num-elements +(defun glst-num-elements ((arg0 glst-list)) + (-> arg0 numelem) + ) + +;; definition for function glst-remove +(defun glst-remove ((arg0 glst-list) (arg1 glst-node)) + (let ((v1-0 arg1)) + "return the previous node in the list" + (let ((v1-1 (-> v1-0 prev)) + (a2-1 arg1) + ) + "return the next node in the list" + (let ((a2-2 (-> a2-1 next))) + (set! (-> v1-1 next) a2-2) + (set! (-> a2-2 prev) v1-1) + ) + ) + ) + (+! (-> arg0 numelem) -1) + arg1 + ) + +;; definition for function glst-remove-tail +(defun glst-remove-tail ((arg0 glst-list)) + (let ((v1-0 arg0)) + "return the tail of the list" + (let* ((a1-1 (-> v1-0 tailpred)) + (v1-1 a1-1) + ) + "is this node the start of the list. #t = start" + (if (not (not (-> v1-1 prev))) + (glst-remove arg0 a1-1) + (the-as glst-node #f) + ) + ) + ) + ) + +;; definition for function glst-remove-head +(defun glst-remove-head ((arg0 glst-list)) + (let ((v1-0 arg0)) + "return the start of the list" + (let* ((a1-1 (-> v1-0 head)) + (v1-1 a1-1) + ) + "is this node the end of the list. #t = end" + (if (not (not (-> v1-1 next))) + (glst-remove arg0 a1-1) + (the-as glst-node #f) + ) + ) + ) + ) + +;; definition for function glst-insert-before +(defun glst-insert-before ((arg0 glst-list) (arg1 glst-node) (arg2 glst-node)) + (let ((v1-0 arg1)) + "return the previous node in the list" + (let ((v1-1 (-> v1-0 prev))) + (set! (-> arg2 prev) v1-1) + (set! (-> arg2 next) arg1) + (set! (-> v1-1 next) arg2) + ) + ) + (set! (-> arg1 prev) arg2) + (+! (-> arg0 numelem) 1) + arg2 + ) + +;; definition for function glst-insert-after +(defun glst-insert-after ((arg0 glst-list) (arg1 glst-node) (arg2 glst-node)) + (let ((v1-0 arg1)) + "return the next node in the list" + (let ((v1-1 (-> v1-0 next))) + (set! (-> arg2 prev) arg1) + (set! (-> arg2 next) v1-1) + (set! (-> v1-1 prev) arg2) + ) + ) + (set! (-> arg1 next) arg2) + (+! (-> arg0 numelem) 1) + arg2 + ) + +;; definition for function glst-add-tail +(defun glst-add-tail ((arg0 glst-list) (arg1 glst-node)) + (glst-insert-before arg0 (the-as glst-node (&-> arg0 tail)) arg1) + arg1 + ) + +;; definition for function glst-add-head +(defun glst-add-head ((arg0 glst-list) (arg1 glst-node)) + (glst-insert-after arg0 (the-as glst-node arg0) arg1) + arg1 + ) + +;; definition for function glst-init-list! +(defun glst-init-list! ((arg0 glst-list)) + (set! (-> arg0 head) (the-as glst-node (&-> arg0 tail))) + (set! (-> arg0 tail) #f) + (set! (-> arg0 tailpred) (the-as glst-node (&-> arg0 head))) + (set! (-> arg0 numelem) 0) + arg0 + ) + +;; definition for function glst-find-node-by-name +;; WARN: Type Propagation failed: Failed type prop at op 7 ((set! a0 (l.wu (+ v1 8)))): Could not get type of load: (set! a0 (l.wu (+ v1 8))). +;; WARN: Type Propagation failed: Type analysis failed +(defun glst-find-node-by-name ((a0-0 glst-list) (a1-0 string)) + (local-vars + (v0-0 none) + (v0-1 symbol) + (v1-0 glst-list) + (v1-1 glst-node) + (v1-4 none) + (v1-5 none) + (v1-6 glst-node) + (v1-7 glst-node) + (v1-8 symbol) + (a0-1 string) + (a0-2 none) + (a0-3 string) + (s5-0 glst-node) + (t9-0 (function basic basic symbol)) + ) + (set! v1-0 a0-0) + (set! a0-1 L41) + (set! s5-0 (-> v1-0 head)) + (while (begin (set! v1-6 s5-0) (set! a0-3 L40) (set! v1-7 (-> v1-6 next)) (set! v1-8 (not v1-7)) (not v1-8)) + (if (begin + (set! t9-0 name=) + (set! v1-1 s5-0) + (set! a0-2 (the-as none (l.wu (+ v1-1 8)))) + (set! a1-1 (the-as none a1-0)) + (set! v0-0 (the-as none (call!))) + v0-0 + ) + (return (set! v0-1 (the-as symbol s5-0))) + ) + (set! v1-4 (the-as none L44)) + (set! v1-5 (the-as none (l.wu s5-0))) + (set! s5-0 (the-as glst-node v1-5)) + ) + (set! v0-1 #f) + (ret-value v0-1) + ) + +;; definition for function glst-get-node-by-index +(defun glst-get-node-by-index ((arg0 glst-list) (arg1 int)) + (when (and (< arg1 (glst-num-elements arg0)) (>= arg1 0)) + "return the start of the list" + (let ((v1-3 (-> arg0 head))) + (dotimes (a0-3 arg1) + (nop!) + (nop!) + (nop!) + (nop!) + "return the next node in the list" + (set! v1-3 (-> v1-3 next)) + ) + (return v1-3) + ) + ) + (the-as glst-node #f) + ) + +;; definition for function glst-length-of-longest-name +;; WARN: Type Propagation failed: Failed type prop at op 6 ((set! a0 (l.wu (+ v1 8)))): Could not get type of load: (set! a0 (l.wu (+ v1 8))). +;; WARN: Type Propagation failed: Type analysis failed +(defun glst-length-of-longest-name ((a0-0 glst-list)) + (local-vars + (v0-0 none) + (v0-1 int) + (v1-0 glst-list) + (v1-1 glst-node) + (v1-2 none) + (v1-3 none) + (v1-4 none) + (v1-5 none) + (v1-6 glst-node) + (v1-7 glst-node) + (v1-8 symbol) + (a0-1 string) + (a0-2 none) + (a0-5 string) + (s5-0 glst-node) + (t9-0 none) + (gp-0 int) + ) + (set! gp-0 0) + (set! v1-0 a0-0) + (set! a0-1 L41) + (set! s5-0 (-> v1-0 head)) + (while (begin (set! v1-6 s5-0) (set! a0-5 L40) (set! v1-7 (-> v1-6 next)) (set! v1-8 (not v1-7)) (not v1-8)) + (when (begin + (set! v1-1 s5-0) + (set! a0-2 (the-as none (l.wu (+ v1-1 8)))) + (set! v1-2 (the-as none string)) + (set! t9-0 (the-as none (l.wu (+ v1-2 32)))) + (set! v0-0 (the-as none (call!))) + (set! v1-3 (the-as none v0-0)) + (<.si gp-0 v1-3) + ) + (set! gp-0 (the-as int v1-3)) + (set! a0-4 (the-as none gp-0)) + ) + (set! v1-4 (the-as none L44)) + (set! v1-5 (the-as none (l.wu s5-0))) + (set! s5-0 (the-as glst-node v1-5)) + ) + (set! v0-1 gp-0) + (ret-value v0-1) + ) + +;; definition for function glst-get-node-index +(defun glst-get-node-index ((arg0 glst-list) (arg1 glst-node)) + (let ((v1-0 0)) + "return the start of the list" + (let ((a0-1 (-> arg0 head))) + (while (let ((a2-3 a0-1)) + "is this node the end of the list. #t = end" + (not (not (-> a2-3 next))) + ) + (if (= a0-1 arg1) + (return v1-0) + ) + (+! v1-0 1) + "return the next node in the list" + (set! a0-1 (-> a0-1 next)) + ) + ) + ) + -1 + ) + +) diff --git a/test/decompiler/reference/kernel/gkernel_REF.gc b/test/decompiler/reference/kernel/gkernel_REF.gc index 399974426a..e4cbfbf999 100644 --- a/test/decompiler/reference/kernel/gkernel_REF.gc +++ b/test/decompiler/reference/kernel/gkernel_REF.gc @@ -36,7 +36,7 @@ ;; definition for function load-package (defun load-package ((arg0 string) (arg1 kheap)) (when (not (nmember arg0 *kernel-packages*)) - (dgo-load arg0 arg1 15 #x200000) + (dgo-load arg0 arg1 (link-flag output-load-msg output-load-true-msg execute-login print-login) #x200000) (let ((v0-1 (cons arg0 *kernel-packages*))) (set! *kernel-packages* v0-1) v0-1 @@ -1361,12 +1361,11 @@ ;; failed to figure out what this is: (defstate dead-state (process) - :code - (the-as (function none :behavior process) nothing) + :code (the-as (function none :behavior process) nothing) ) -;; definition for symbol entity-deactivate-handler, type (function process entity none) -(define entity-deactivate-handler (the-as (function process entity none) nothing)) +;; definition for symbol entity-deactivate-handler, type (function process entity-actor none) +(define entity-deactivate-handler (the-as (function process entity-actor none) nothing)) ;; definition for method 10 of type process ;; INFO: Return type mismatch int vs none. diff --git a/test/decompiler/reference/kernel/gstate_REF.gc b/test/decompiler/reference/kernel/gstate_REF.gc index 7a63251a2e..bcfbff2833 100644 --- a/test/decompiler/reference/kernel/gstate_REF.gc +++ b/test/decompiler/reference/kernel/gstate_REF.gc @@ -141,7 +141,7 @@ ;; INFO: Return type mismatch none vs symbol. ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 2] (defun looping-code () - (while #t + (loop (suspend) ) (the-as symbol #f) diff --git a/test/decompiler/reference/levels/beach/beach-obs_REF.gc b/test/decompiler/reference/levels/beach/beach-obs_REF.gc index 83fe42fc34..aa85a83081 100644 --- a/test/decompiler/reference/levels/beach/beach-obs_REF.gc +++ b/test/decompiler/reference/levels/beach/beach-obs_REF.gc @@ -1,14 +1,21 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/ecoventrock-ag.gc") +(import "goal_src/import/beachcam-ag.gc") +(import "goal_src/import/windmill-one-ag.gc") +(import "goal_src/import/kickrock-ag.gc") +(import "goal_src/import/harvester-ag.gc") +(import "goal_src/import/flutflutegg-ag.gc") +(import "goal_src/import/grottopole-ag.gc") +(import "goal_src/import/flutflut-ag.gc") +(import "goal_src/import/bladeassm-ag.gc") + ;; failed to figure out what this is: -(defskelgroup *beachcam-sg* beachcam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 60) - :longest-edge (meters 0) - ) +(defskelgroup *beachcam-sg* beachcam beachcam-lod0-jg beachcam-anim-ja + ((beachcam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 60) + ) ;; definition of type windmill-one (deftype windmill-one (process-drawable) @@ -34,56 +41,38 @@ ) ;; failed to figure out what this is: -(defskelgroup *windmill-one-sg* windmill-one - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem -12 -8 -1 16) - :longest-edge (meters 7.5) - ) +(defskelgroup *windmill-one-sg* windmill-one windmill-one-lod0-jg windmill-one-idle-ja + ((windmill-one-lod0-mg (meters 20)) (windmill-one-lod1-mg (meters 40)) (windmill-one-lod2-mg (meters 999999))) + :bounds (static-spherem -12 -8 -1 16) + :longest-edge (meters 7.5) + ) ;; failed to figure out what this is: (defstate windmill-one-idle (windmill-one) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self sound-id)) (none) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (let ((t2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)))) (if (!= (+ (-> t2-0 x) (-> t2-0 y) (-> t2-0 z)) 0.0) - (sound-play-by-name (static-sound-name "gears-rumble") (-> self sound-id) 1024 0 0 1 (the-as symbol t2-0)) + (sound-play "gears-rumble" :id (-> self sound-id) :position (the-as symbol t2-0)) ) ) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 0.5) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max 0.5) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 0.5) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.5)) ) ) (none) ) - :post - (the-as (function none :behavior windmill-one) rider-post) + :post (the-as (function none :behavior windmill-one) rider-post) ) ;; definition for method 11 of type windmill-one @@ -142,8 +131,7 @@ :id 155 :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 539 :period 1500 :length 15) + :parts ((sp-item 539 :period 1500 :length 15) (sp-item 539 :period 1500 :length 30) (sp-item 539 :period 1500 :length 45) (sp-item 539 :period 1500 :length 75) @@ -155,8 +143,7 @@ ;; failed to figure out what this is: (defpart 539 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -9) (meters 18) 1.0) (sp-flt spt-y (meters -6)) @@ -180,8 +167,7 @@ ;; failed to figure out what this is: (defpart 540 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-flt spt-y (meters -7)) (sp-rnd-flt spt-scale-x (meters 3) (meters 4.5) 1.0) @@ -207,14 +193,12 @@ ;; failed to figure out what this is: (defpart 541 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 450 239 1) (sp-launcher-by-id spt-next-launcher 542)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 450 239 1) (sp-launcher-by-id spt-next-launcher 542)) ) ;; failed to figure out what this is: (defpart 542 - :init-specs - ((sp-flt spt-fade-a -0.14222223)) + :init-specs ((sp-flt spt-fade-a -0.14222223)) ) ;; definition of type grottopole @@ -251,18 +235,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *grottopole-sg* grottopole - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 -8 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *grottopole-sg* grottopole grottopole-lod0-jg grottopole-idle-ja + ((grottopole-lod0-mg (meters 20)) (grottopole-lod1-mg (meters 999999))) + :bounds (static-spherem 0 -8 0 9) + ) ;; failed to figure out what this is: (defstate grottopole-idle (grottopole) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (= (-> arg0 type) target) (case arg2 (('attack) @@ -279,8 +259,8 @@ (the-as uint 2) ) ) - (sound-play-by-name (static-sound-name "grotto-pole-hit") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "dirt-crumble") (new-sound-id) 1024 0 0 1 #t) + (sound-play "grotto-pole-hit") + (sound-play "dirt-crumble") (increment-success-for-hint (game-text-id beach-grottopole-increment)) (go grottopole-moving-up) ) @@ -294,8 +274,8 @@ (the-as uint 1) ) ) - (sound-play-by-name (static-sound-name "grotto-pole-hit") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "dirt-crumble") (new-sound-id) 1024 0 0 1 #t) + (sound-play "grotto-pole-hit") + (sound-play "dirt-crumble") (go grottopole-moving-down) ) ) @@ -306,20 +286,12 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 3) :num! min) (transform-post) (suspend) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -372,8 +344,7 @@ ;; failed to figure out what this is: (defstate grottopole-moving-up (grottopole) - :code - (behavior () + :code (behavior () (+! (-> self position) 1) (let ((v1-4 (-> self entity extra perm))) (logior! (-> v1-4 status) (entity-perm-status user-set-from-cstage)) @@ -383,14 +354,12 @@ (go grottopole-idle) (none) ) - :post - (the-as (function none :behavior grottopole) transform-post) + :post (the-as (function none :behavior grottopole) transform-post) ) ;; failed to figure out what this is: (defstate grottopole-moving-down (grottopole) - :code - (behavior () + :code (behavior () (+! (-> self position) -1) (let ((v1-4 (-> self entity extra perm))) (logior! (-> v1-4 status) (entity-perm-status user-set-from-cstage)) @@ -400,8 +369,7 @@ (go grottopole-idle) (none) ) - :post - (the-as (function none :behavior grottopole) transform-post) + :post (the-as (function none :behavior grottopole) transform-post) ) ;; definition for method 11 of type grottopole @@ -482,13 +450,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *ecoventrock-sg* ecoventrock - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 1 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *ecoventrock-sg* ecoventrock ecoventrock-lod0-jg ecoventrock-idle-ja + ((ecoventrock-lod0-mg (meters 20)) (ecoventrock-lod1-mg (meters 999999))) + :bounds (static-spherem 0 1 0 3) + ) ;; failed to figure out what this is: (defpartgroup group-beach-harvester-rock-explosion @@ -496,8 +461,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 543 :period 1500 :length 5) + :parts ((sp-item 543 :period 1500 :length 5) (sp-item 544 :period 1500 :length 5) (sp-item 545 :period 1500 :length 5) (sp-item 546 :period 1500 :length 5) @@ -508,8 +472,7 @@ ;; failed to figure out what this is: (defpart 547 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 15)) (sp-copy-from-other spt-scale-y -4) @@ -525,8 +488,7 @@ ;; failed to figure out what this is: (defpart 543 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 4.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -550,8 +512,7 @@ ;; failed to figure out what this is: (defpart 544 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 4.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -575,8 +536,7 @@ ;; failed to figure out what this is: (defpart 545 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 4.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -600,8 +560,7 @@ ;; failed to figure out what this is: (defpart 549 - :init-specs - ((sp-flt spt-vel-y (meters 0.026666667)) + :init-specs ((sp-flt spt-vel-y (meters 0.026666667)) (sp-rnd-int-flt spt-rotvel-z (degrees -1.2) 1 436.90668) (sp-flt spt-fade-a -1.0666667) ) @@ -609,8 +568,7 @@ ;; failed to figure out what this is: (defpart 548 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -635,26 +593,23 @@ ;; failed to figure out what this is: (defpart 550 - :init-specs - ((sp-flt spt-fade-a -0.2)) + :init-specs ((sp-flt spt-fade-a -0.2)) ) ;; failed to figure out what this is: (defstate ecoventrock-idle (ecoventrock) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) - (sound-play-by-name (static-sound-name "cannon-shot") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cannon-shot") (increment-success-for-hint (game-text-id beach-eco-rock-increment)) (go ecoventrock-break #f) ) ) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -664,18 +619,15 @@ ;; failed to figure out what this is: (defstate ecoventrock-break (ecoventrock) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior ecoventrock) process-drawable-fuel-cell-handler ) - :enter - (behavior ((arg0 symbol)) + :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (local-vars (sv-128 symbol)) (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) @@ -690,23 +642,16 @@ ) ) (when (not arg0) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker s5-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - part-tracker-init - (-> *part-group-id-table* 156) - -1 - #f - #f - #f - (-> self root-override root-prim prim-core) - ) - (-> s5-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 156) + -1 + #f + #f + #f + (-> self root-override root-prim prim-core) + :to *entity-pool* ) (let* ((s5-1 (-> self root-override trans)) (v1-14 (target-pos 0)) @@ -766,24 +711,8 @@ ) (else (ambient-hint-spawn "gamcam10" (the-as vector #f) *entity-pool* 'camera) - (let ((gp-2 (get-process *default-dead-pool* pov-camera #x4000))) - (ppointer->handle (when gp-2 - (let ((t9-23 (method-of-type pov-camera activate))) - (t9-23 (the-as pov-camera gp-2) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - pov-camera-init-by-other - (-> self root-override trans) - *beachcam-sg* - (-> self name) - 0 - #f - '() - ) - (-> gp-2 ppointer) - ) - ) + (ppointer->handle + (process-spawn pov-camera (-> self root-override trans) *beachcam-sg* (-> self name) 0 #f '() :to self) ) ) ) @@ -860,30 +789,25 @@ ) ;; failed to figure out what this is: -(defskelgroup *kickrock-sg* kickrock - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *kickrock-sg* kickrock kickrock-lod0-jg kickrock-idle-ja + ((kickrock-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) ;; failed to figure out what this is: (defstate flying-rock-rolling (flying-rock) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 #f) (f30-0 0.99) (s5-0 0) ) (while (< s5-0 2) (cond - ((logtest? (-> self root-override status) 1) + ((logtest? (-> self root-override status) (cshape-moving-flags onsurf)) (when (not gp-0) (+! s5-0 1) (set! f30-0 0.8) @@ -917,7 +841,7 @@ ) (while (< 2048.0 (vector-length (-> self root-override transv))) (cond - ((logtest? (-> self root-override status) 1) + ((logtest? (-> self root-override status) (cshape-moving-flags onsurf)) (vector-float*! (-> self root-override transv) (-> self root-override transv) 0.8) ) (else @@ -950,8 +874,7 @@ (go flying-rock-idle) (none) ) - :post - (behavior () + :post (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) (go flying-rock-idle) ) @@ -962,8 +885,7 @@ ;; failed to figure out what this is: (defstate flying-rock-idle (flying-rock) - :code - (behavior () + :code (behavior () (clear-collide-with-as (-> self root-override)) (while (or (logtest? (-> self draw status) (draw-status was-drawn)) (and *target* @@ -975,14 +897,13 @@ (deactivate self) (none) ) - :post - (the-as (function none :behavior flying-rock) ja-post) + :post (the-as (function none :behavior flying-rock) ja-post) ) ;; definition for function flying-rock-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior flying-rock-init-by-other flying-rock ((arg0 vector) (arg1 vector) (arg2 float) (arg3 entity)) +(defbehavior flying-rock-init-by-other flying-rock ((arg0 vector) (arg1 vector) (arg2 float) (arg3 entity-actor)) (set! (-> self entity) arg3) (let ((s3-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) (set! (-> s3-0 dynam) (copy *standard-dynamics* 'process)) @@ -1026,15 +947,7 @@ ;; definition for function spawn-flying-rock ;; INFO: Return type mismatch int vs none. (defun spawn-flying-rock ((arg0 vector) (arg1 vector) (arg2 float) (arg3 entity)) - (let ((s2-0 (get-process *default-dead-pool* flying-rock #x4000))) - (when s2-0 - (let ((t9-1 (method-of-type flying-rock activate))) - (t9-1 (the-as flying-rock s2-0) *entity-pool* 'flying-rock (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 flying-rock-init-by-other arg0 arg1 arg2 arg3) - (-> s2-0 ppointer) - ) - ) + (process-spawn flying-rock arg0 arg1 arg2 arg3 :to *entity-pool*) 0 (none) ) @@ -1063,19 +976,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *bladeassm-sg* bladeassm - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 10) - ) +(defskelgroup *bladeassm-sg* bladeassm bladeassm-lod0-jg bladeassm-idle-ja + ((bladeassm-lod0-mg (meters 20)) (bladeassm-lod1-mg (meters 40)) (bladeassm-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :longest-edge (meters 10) + ) ;; failed to figure out what this is: (defstate bladeassm-idle (bladeassm) - :code - (behavior () - (while #t + :code (behavior () + (loop (+! (-> self angle) (* 3640.889 (-> *display* seconds-per-frame))) (set! (-> self angle) (the float (sar (shl (the int (-> self angle)) 48) 48))) (pusher-post) @@ -1175,22 +1085,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *flutflutegg-sg* flutflutegg - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 3.5 0 3.5) - :longest-edge (meters 0) - ) +(defskelgroup *flutflutegg-sg* flutflutegg flutflutegg-lod0-jg flutflutegg-idle-ja + ((flutflutegg-lod0-mg (meters 20)) (flutflutegg-lod1-mg (meters 40)) (flutflutegg-lod2-mg (meters 999999))) + :bounds (static-spherem 0 3.5 0 3.5) + ) ;; failed to figure out what this is: -(defskelgroup *flutflut-naked-sg* flutflut - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *flutflut-naked-sg* flutflut flutflut-lod0-jg flutflut-flutflut-idle-ja + ((flutflut-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; definition for method 7 of type flutflutegg ;; INFO: Return type mismatch process-drawable vs flutflutegg. @@ -1221,7 +1125,7 @@ ;; definition for function flutflutegg-hit-sounds ;; INFO: Return type mismatch int vs none. (defbehavior flutflutegg-hit-sounds flutflutegg () - (sound-play-by-name (static-sound-name "egg-hit") (new-sound-id) 1024 0 0 1 #t) + (sound-play "egg-hit") (cond ((not (task-closed? (game-task beach-flutflut) (task-status need-introduction))) ) @@ -1241,8 +1145,7 @@ ;; failed to figure out what this is: (defstate flutflutegg-idle (flutflutegg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (and (= arg2 'attack) (or (= (-> arg3 param 1) 'punch) (= (-> arg3 param 1) 'spin) (= (-> arg3 param 1) 'spin-air)) (!= (-> self incomming-attack-id) (-> arg3 param 2)) @@ -1267,8 +1170,7 @@ (go flutflutegg-physics) ) ) - :trans - (behavior () + :trans (behavior () (let* ((gp-0 (TODO-RENAME-10 (-> self ambient) (new 'stack-no-clear 'vector) (seconds 3) 368640.0 self)) (v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-3 (the-as number (logior #x3f800000 v1-2))) @@ -1326,10 +1228,9 @@ ) (none) ) - :code - (behavior () + :code (behavior () (ja-post) - (while #t + (loop (suspend) ) (none) @@ -1338,8 +1239,7 @@ ;; failed to figure out what this is: (defstate flutflutegg-physics (flutflutegg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (the-as object (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) @@ -1367,10 +1267,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (+! (-> self pos) (* (-> self vel) (-> *display* seconds-per-frame))) (set! (-> self vel) (* 0.95 (-> self vel))) (move! (-> self wobbler)) @@ -1395,49 +1294,40 @@ ) (none) ) - :post - (the-as (function none :behavior flutflutegg) ja-post) + :post (the-as (function none :behavior flutflutegg) ja-post) ) ;; failed to figure out what this is: (defstate flutflutegg-physics-fall (flutflutegg) - :code - (behavior () + :code (behavior () (local-vars (v1-25 symbol)) - (let ((gp-0 (get-process *default-dead-pool* camera-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type camera-tracker activate))) - (t9-1 (the-as camera-tracker gp-0) self 'camera-tracker (the-as pointer #x70004000)) + (process-spawn + camera-tracker + :init camera-tracker-init + (lambda :behavior camera-tracker + () + (while (not (process-grab? *target*)) + (suspend) ) - (run-now-in-process - gp-0 - camera-tracker-init - (lambda :behavior camera-tracker - () - (while (not (process-grab? *target*)) - (suspend) - ) - (camera-change-to "camera-135" 0 #f) - (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 9)) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 4)) - (suspend) - ) - ) - (while (not (process-release? (handle->process (-> self grab-target)))) - (suspend) - ) - (camera-look-at (the-as pair *target*) (the-as uint 0)) - (send-event *camera* 'blend-from-as-fixed) - (camera-change-to (the-as string 'base) 75 #f) - (none) + (camera-change-to "camera-135" 0 #f) + (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 9)) + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 4)) + (suspend) ) ) - (-> gp-0 ppointer) + (while (not (process-release? (handle->process (-> self grab-target)))) + (suspend) + ) + (camera-look-at (the-as pair *target*) (the-as uint 0)) + (send-event *camera* 'blend-from-as-fixed) + (camera-change-to (the-as string 'base) 75 #f) + (none) ) + :to self ) (close-specific-task! (game-task beach-flutflut) (task-status need-reminder)) - (while #t + (loop (vector-float*! (-> self root-override transv) (-> self dir) (-> self vel)) (set! (-> self state-time) (-> *display* base-frame-counter)) (until v1-25 @@ -1461,23 +1351,21 @@ ) (suspend) (set! v1-25 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (logtest? (-> self root-override status) 1) + (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) ) ) ) - (sound-play-by-name (static-sound-name "sack-land") (new-sound-id) 2048 0 0 1 #t) + (sound-play "sack-land" :vol 200) (go flutflutegg-break #f) ) (none) ) - :post - (the-as (function none :behavior flutflutegg) ja-post) + :post (the-as (function none :behavior flutflutegg) ja-post) ) ;; failed to figure out what this is: (defstate flutflutegg-break (flutflutegg) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (when arg0 (set-vector! (-> self root-override trans) -231190.94 64559.105 -1164727.5 1.0) (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 -18204.445) @@ -1485,34 +1373,13 @@ (suspend) (update-transforms! (-> self root-override)) (when (not arg0) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - ) + (ja :group! (-> self draw art-group data 5) :num! max) (while (and (not (task-closed? (game-task beach-flutflut) (task-status need-reward-speech))) (zero? (logand (-> self ambients-played) 1024)) ) @@ -1542,24 +1409,14 @@ (ja-channel-set! 1) (set-vector! (-> self root-override trans) -231190.94 64559.105 -1164727.5 1.0) (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 0.0) - (let ((gp-3 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-3 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-3 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - ) - (while #t + (ja :group! (-> self draw art-group data 6) :num! max) + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) (none) ) - :post - (the-as (function none :behavior flutflutegg) ja-post) + :post (the-as (function none :behavior flutflutegg) ja-post) ) ;; definition for method 11 of type flutflutegg @@ -1644,18 +1501,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *harvester-sg* harvester - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 7 0 11) - :longest-edge (meters 0) - ) +(defskelgroup *harvester-sg* harvester harvester-lod0-jg harvester-idle-ja + ((harvester-lod0-mg (meters 20)) (harvester-lod1-mg (meters 40)) (harvester-lod2-mg (meters 999999))) + :bounds (static-spherem 0 7 0 11) + ) ;; failed to figure out what this is: (defstate harvester-idle (harvester) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('update) (if (and (-> self alt-actor) (logtest? (-> self alt-actor extra perm status) (entity-perm-status complete))) @@ -1664,21 +1517,13 @@ ) ) ) - :code - (behavior () + :code (behavior () (if (and (-> self alt-actor) (logtest? (-> self alt-actor extra perm status) (entity-perm-status complete))) (go harvester-inflate #t) ) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) (ja-aframe 1.0 0)) - ) + (ja :group! (-> self draw art-group data 5) :num! (identity (ja-aframe 1.0 0))) (ja-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -1688,50 +1533,24 @@ ;; failed to figure out what this is: (defstate harvester-inflate (harvester) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (when (not arg0) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (while #t - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior harvester) ja-post) + :post (the-as (function none :behavior harvester) ja-post) ) ;; definition for method 11 of type harvester @@ -1849,38 +1668,23 @@ (with-pp (let ((gp-0 (entity-actor-lookup (-> pp entity) 'alt-actor 0))) (when gp-0 - (let* ((s5-0 (get-process *default-dead-pool* pov-camera #x4000)) - (gp-1 - (ppointer->handle - (when s5-0 - (let ((t9-2 (method-of-type pov-camera activate))) - (t9-2 (the-as pov-camera s5-0) pp 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> gp-0 extra trans) - *beachcam-sg* - (new 'static 'spool-anim :name "beachcam-cannon" :index 3 :parts 1 :command-list '()) - 0 - #f - '() - ) - (-> s5-0 ppointer) - ) - ) - ) - (s5-1 (get-process *default-dead-pool* fuel-cell #x4000)) - (s5-2 - (ppointer->handle (when s5-1 - (let ((t9-5 (method-of-type fuel-cell activate))) - (t9-5 (the-as fuel-cell s5-1) pp 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 fuel-cell-init-as-clone gp-1 (-> pp entity extra perm task)) - (-> s5-1 ppointer) + (let* ((gp-1 + (ppointer->handle (process-spawn + pov-camera + (-> gp-0 extra trans) + *beachcam-sg* + (new 'static 'spool-anim :name "beachcam-cannon" :index 3 :parts 1 :command-list '()) + 0 + #f + '() + :to pp ) ) ) + (s5-2 (ppointer->handle + (process-spawn fuel-cell :init fuel-cell-init-as-clone gp-1 (-> pp entity extra perm task) :to pp) + ) + ) ) (let ((v1-13 (handle->process gp-1))) (if v1-13 diff --git a/test/decompiler/reference/levels/beach/beach-part_REF.gc b/test/decompiler/reference/levels/beach/beach-part_REF.gc index 643d9df7dd..d67d3679c8 100644 --- a/test/decompiler/reference/levels/beach/beach-part_REF.gc +++ b/test/decompiler/reference/levels/beach/beach-part_REF.gc @@ -23,8 +23,7 @@ ;; failed to figure out what this is: (defpart 666 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.01) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 15) (meters 5) 1.0) @@ -52,14 +51,12 @@ ;; failed to figure out what this is: (defpart 667 - :init-specs - ((sp-flt spt-fade-a -0.02)) + :init-specs ((sp-flt spt-fade-a -0.02)) ) ;; failed to figure out what this is: (defpart 668 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-flt spt-num 0.03 0.2 1.0) (sp-flt spt-y (meters -4)) (sp-flt spt-scale-x (meters 0.18)) @@ -82,8 +79,7 @@ ;; failed to figure out what this is: (defpart 669 - :init-specs - ((sp-flt spt-scalevel-y (meters 0.0024414062)) + :init-specs ((sp-flt spt-scalevel-y (meters 0.0024414062)) (sp-flt spt-fade-a 0.0) (sp-flt spt-accel-y -8.192) (sp-int spt-next-time 210) @@ -93,15 +89,13 @@ ;; failed to figure out what this is: (defpart 670 - :init-specs - ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150) (sp-func spt-func 'check-water-level-drop)) + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150) (sp-func spt-func 'check-water-level-drop)) ) ;; failed to figure out what this is: (defstate beach-part-grotto-1 (beach-part) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (is-visible? self) (let* ((gp-0 (camera-pos)) (f0-0 (vector-vector-distance (-> self root trans) gp-0)) @@ -134,8 +128,7 @@ ;; failed to figure out what this is: (defpart 671 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-flt spt-num 0.3 0.4 1.0) (sp-rnd-flt spt-x (meters -23) (meters 55) 1.0) (sp-flt spt-z (meters 0.5)) @@ -161,14 +154,12 @@ (defpartgroup group-beach-grotto-2 :id 161 :bounds (static-bspherem 0 -5 0 15) - :parts - ((sp-item 671 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 671 :fade-after (meters 80) :falloff-to (meters 80))) ) ;; failed to figure out what this is: (defpart 672 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-x (meters -10) (meters 4) 1.0) (sp-flt spt-y (meters 103)) @@ -195,8 +186,7 @@ ;; failed to figure out what this is: (defpart 673 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.8 0.8 1.0) (sp-rnd-flt spt-x (meters -9) (meters 3.5) 1.0) (sp-flt spt-y (meters 103)) @@ -224,8 +214,7 @@ ;; failed to figure out what this is: (defpart 674 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.9) (sp-rnd-flt spt-x (meters -10) (meters 4) 1.0) (sp-flt spt-y (meters 103)) @@ -252,8 +241,7 @@ ;; failed to figure out what this is: (defpart 675 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.04) (sp-rnd-flt spt-x (meters 6) (meters 6) 1.0) (sp-flt spt-y (meters 6.5)) @@ -284,14 +272,12 @@ ;; failed to figure out what this is: (defpart 676 - :init-specs - ((sp-flt spt-fade-a -0.14222223)) + :init-specs ((sp-flt spt-fade-a -0.14222223)) ) ;; failed to figure out what this is: (defpart 677 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters 2) (meters 10) 1.0) (sp-flt spt-y (meters 8)) @@ -323,8 +309,7 @@ :id 162 :flags (always-draw unknown-bit-01) :bounds (static-bspherem 0 55 0 55) - :parts - ((sp-item 677 :fade-after (meters 200) :falloff-to (meters 200)) + :parts ((sp-item 677 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 675) (sp-item 675 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 672) @@ -339,70 +324,61 @@ (defpartgroup group-beach-24 :id 163 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 678 :fade-after (meters 50) :period 2400 :length 1500 :offset 1200)) + :parts ((sp-item 678 :fade-after (meters 50) :period 2400 :length 1500 :offset 1200)) ) ;; failed to figure out what this is: (defpartgroup group-beach-23 :id 164 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 679 :fade-after (meters 50) :period 2400 :length 1500 :offset 600)) + :parts ((sp-item 679 :fade-after (meters 50) :period 2400 :length 1500 :offset 600)) ) ;; failed to figure out what this is: (defpartgroup group-beach-22 :id 165 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 680 :fade-after (meters 80) :period 2400 :length 1500)) + :parts ((sp-item 680 :fade-after (meters 80) :period 2400 :length 1500)) ) ;; failed to figure out what this is: (defpartgroup group-beach-18 :id 166 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 681 :fade-after (meters 100) :period 2400 :length 1500 :offset 1200)) + :parts ((sp-item 681 :fade-after (meters 100) :period 2400 :length 1500 :offset 1200)) ) ;; failed to figure out what this is: (defpartgroup group-beach-17 :id 167 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 682 :fade-after (meters 50) :period 2400 :length 1500 :offset 600)) + :parts ((sp-item 682 :fade-after (meters 50) :period 2400 :length 1500 :offset 600)) ) ;; failed to figure out what this is: (defpartgroup group-beach-16 :id 168 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 683 :fade-after (meters 50) :period 2400 :length 1500)) + :parts ((sp-item 683 :fade-after (meters 50) :period 2400 :length 1500)) ) ;; failed to figure out what this is: (defpartgroup group-beach-15 :id 169 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 684 :fade-after (meters 50) :period 2400 :length 1500 :offset 64936)) + :parts ((sp-item 684 :fade-after (meters 50) :period 2400 :length 1500 :offset 64936)) ) ;; failed to figure out what this is: (defpartgroup group-beach-14 :id 170 :bounds (static-bspherem 0 3 0 50) - :parts - ((sp-item 685 :fade-after (meters 50) :period 2400 :length 1500 :offset 64336)) + :parts ((sp-item 685 :fade-after (meters 50) :period 2400 :length 1500 :offset 64336)) ) ;; failed to figure out what this is: (defpart 678 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.01 0.01 1.0) (sp-rnd-flt spt-x (meters -85) (meters 60) 1.0) (sp-flt spt-y (meters 13)) @@ -427,14 +403,12 @@ ;; failed to figure out what this is: (defpart 686 - :init-specs - ((sp-flt spt-fade-a -0.07111111)) + :init-specs ((sp-flt spt-fade-a -0.07111111)) ) ;; failed to figure out what this is: (defpart 679 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.01 0.01 1.0) (sp-rnd-flt spt-x (meters -65) (meters 60) 1.0) (sp-flt spt-y (meters 8)) @@ -459,14 +433,12 @@ ;; failed to figure out what this is: (defpart 687 - :init-specs - ((sp-flt spt-fade-a -0.07111111)) + :init-specs ((sp-flt spt-fade-a -0.07111111)) ) ;; failed to figure out what this is: (defpart 680 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.01 0.01 1.0) (sp-rnd-flt spt-x (meters -50) (meters 20) 1.0) (sp-flt spt-y (meters 0)) @@ -492,14 +464,12 @@ ;; failed to figure out what this is: (defpart 688 - :init-specs - ((sp-flt spt-fade-a -0.08533333)) + :init-specs ((sp-flt spt-fade-a -0.08533333)) ) ;; failed to figure out what this is: (defpart 681 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.03 0.04 1.0) (sp-rnd-flt spt-x (meters -40) (meters 20) 1.0) (sp-flt spt-y (meters 1)) @@ -525,14 +495,12 @@ ;; failed to figure out what this is: (defpart 689 - :init-specs - ((sp-flt spt-fade-a -0.07111111)) + :init-specs ((sp-flt spt-fade-a -0.07111111)) ) ;; failed to figure out what this is: (defpart 682 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.015 0.02 1.0) (sp-flt spt-x (meters -10)) (sp-flt spt-y (meters 1)) @@ -557,14 +525,12 @@ ;; failed to figure out what this is: (defpart 690 - :init-specs - ((sp-flt spt-fade-a -0.017777778)) + :init-specs ((sp-flt spt-fade-a -0.017777778)) ) ;; failed to figure out what this is: (defpart 683 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.015 0.02 1.0) (sp-flt spt-x (meters -25)) (sp-flt spt-y (meters 1)) @@ -589,14 +555,12 @@ ;; failed to figure out what this is: (defpart 691 - :init-specs - ((sp-flt spt-fade-a -0.013333334)) + :init-specs ((sp-flt spt-fade-a -0.013333334)) ) ;; failed to figure out what this is: (defpart 684 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.015 0.015 1.0) (sp-flt spt-x (meters -35)) (sp-flt spt-y (meters 1)) @@ -621,14 +585,12 @@ ;; failed to figure out what this is: (defpart 692 - :init-specs - ((sp-flt spt-fade-a -0.016410256)) + :init-specs ((sp-flt spt-fade-a -0.016410256)) ) ;; failed to figure out what this is: (defpart 685 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.015 0.015 1.0) (sp-flt spt-x (meters -25)) (sp-flt spt-y (meters 14)) @@ -653,22 +615,17 @@ ;; failed to figure out what this is: (defpart 693 - :init-specs - ((sp-flt spt-fade-a -0.014222222)) + :init-specs ((sp-flt spt-fade-a -0.014222222)) ) ;; definition for symbol sound-beach-waterfall, type sound-spec -(define - sound-beach-waterfall - (new 'static 'sound-spec :num 1.0 :group #x1 :sound-name (static-sound-name "waterfall") :volume #x400) - ) +(define sound-beach-waterfall (static-sound-spec "waterfall")) ;; failed to figure out what this is: (defpartgroup group-beach-butterflies :id 171 :bounds (static-bspherem 0 0 0 30) - :parts - ((sp-item 696 :fade-after (meters 120) :period 4903 :length 5 :hour-mask #b111111100000000000111111 :binding 694) + :parts ((sp-item 696 :fade-after (meters 120) :period 4903 :length 5 :hour-mask #b111111100000000000111111 :binding 694) (sp-item 696 :fade-after (meters 120) :period 6637 :length 5 :hour-mask #b111111100000000000111111 :binding 694) (sp-item 696 :fade-after (meters 120) :period 9846 :length 5 :hour-mask #b111111100000000000111111 :binding 694) (sp-item 694 :flags (start-dead launch-asap) :binding 695) @@ -686,8 +643,7 @@ ;; failed to figure out what this is: (defpart 696 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 7.5) 1.0) (sp-rnd-flt spt-y (meters 14) (meters 3) 1.0) @@ -707,8 +663,7 @@ ;; failed to figure out what this is: (defpart 697 - :init-specs - ((sp-flt spt-accel-y 0.0) + :init-specs ((sp-flt spt-accel-y 0.0) (sp-int-plain-rnd spt-next-time 2700 1499 1) (sp-launcher-by-id spt-next-launcher 698) ) @@ -716,14 +671,12 @@ ;; failed to figure out what this is: (defpart 698 - :init-specs - ((sp-flt spt-accel-y 1.3653333)) + :init-specs ((sp-flt spt-accel-y 1.3653333)) ) ;; failed to figure out what this is: (defpart 694 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -747,8 +700,7 @@ ;; failed to figure out what this is: (defpart 699 - :init-specs - ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) (sp-rnd-flt spt-vel-y (meters -0.0074074077) (meters 0.0148148155) 1.0) (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) (sp-int-plain-rnd spt-next-time 150 449 1) @@ -758,8 +710,7 @@ ;; failed to figure out what this is: (defpart 695 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 0.9)) @@ -779,8 +730,7 @@ (defpartgroup group-beach-moth :id 172 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 702 :fade-after (meters 120) :flags (bit1) :period 18030 :length 5 :hour-mask #b1111111110000000 :binding 700) + :parts ((sp-item 702 :fade-after (meters 120) :flags (bit1) :period 18030 :length 5 :hour-mask #b1111111110000000 :binding 700) (sp-item 700 :flags (start-dead launch-asap) :binding 701) (sp-item 701 :flags (is-3d start-dead)) ) @@ -788,8 +738,7 @@ ;; failed to figure out what this is: (defpart 702 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.1)) (sp-copy-from-other spt-scale-y -4) @@ -803,8 +752,7 @@ ;; failed to figure out what this is: (defpart 700 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 1.5)) @@ -828,8 +776,7 @@ ;; failed to figure out what this is: (defpart 703 - :init-specs - ((sp-rnd-flt spt-vel-x (meters -0.035555556) (meters 0.07111111) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters -0.035555556) (meters 0.07111111) 1.0) (sp-rnd-flt spt-vel-y (meters -0.0148148155) (meters 0.029629631) 1.0) (sp-rnd-flt spt-rotvel-z (degrees -0.4) (degrees 0.8) 1.0) (sp-int-plain-rnd spt-next-time 150 449 1) @@ -839,8 +786,7 @@ ;; failed to figure out what this is: (defpart 701 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 0.4)) diff --git a/test/decompiler/reference/levels/beach/beach-rocks_REF.gc b/test/decompiler/reference/levels/beach/beach-rocks_REF.gc index 41f9dd6b35..e051ae3992 100644 --- a/test/decompiler/reference/levels/beach/beach-rocks_REF.gc +++ b/test/decompiler/reference/levels/beach/beach-rocks_REF.gc @@ -1,14 +1,14 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/lrocklrg-ag.gc") + ;; failed to figure out what this is: -(defskelgroup *lrocklrg-sg* lrocklrg - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 11) - ) +(defskelgroup *lrocklrg-sg* lrocklrg lrocklrg-lod0-jg lrocklrg-idle-ja + ((lrocklrg-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :longest-edge (meters 11) + ) ;; failed to figure out what this is: (defpartgroup group-beach-rocks-start @@ -16,8 +16,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2340 :period 75 :length 10) + :parts ((sp-item 2340 :period 75 :length 10) (sp-item 2341 :period 75 :length 10) (sp-item 2289 :period 75 :length 10) ) @@ -25,8 +24,7 @@ ;; failed to figure out what this is: (defpart 2341 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 3.0 6.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters -4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.25) (meters 1) 1.0) @@ -52,8 +50,7 @@ ;; failed to figure out what this is: (defpart 2340 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters -4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) @@ -80,8 +77,7 @@ ;; failed to figure out what this is: (defpart 2289 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 3.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters -4) 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 2) 1.0) @@ -114,14 +110,12 @@ :id 554 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2290 :period 15 :length 5)) + :parts ((sp-item 2290 :period 15 :length 5)) ) ;; failed to figure out what this is: (defpart 2290 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 3.0 3.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters -4) 1.0) (sp-rnd-flt spt-scale-x (meters 7) (meters 9) 1.0) @@ -155,8 +149,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2342 :period 900 :length 40) + :parts ((sp-item 2342 :period 900 :length 40) (sp-item 2343 :period 900 :length 40) (sp-item 2291 :period 900 :length 40) ) @@ -164,8 +157,7 @@ ;; failed to figure out what this is: (defpart 2343 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-flt spt-y (meters -3)) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.3) 1.0) @@ -187,8 +179,7 @@ ;; failed to figure out what this is: (defpart 2342 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 64.0 64.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters -4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) @@ -215,8 +206,7 @@ ;; failed to figure out what this is: (defpart 2291 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 32.0 32.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters -4) 1.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 8) 1.0) @@ -305,8 +295,7 @@ ;; failed to figure out what this is: (defstate idle (beach-rock) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (set! (-> self trigger) #t) @@ -317,14 +306,13 @@ ) ) ) - :code - (behavior () + :code (behavior () (if (-> self trigger) (go-virtual falling) ) (ja-channel-set! 0) (ja-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -335,11 +323,9 @@ ;; failed to figure out what this is: (defstate loading (beach-rock) :virtual #t - :event - (-> (the-as state (method-of-type beach-rock idle)) event) - :code - (behavior () - (while #t + :event (-> (the-as state (method-of-type beach-rock idle)) event) + :code (behavior () + (loop (spool-push *art-control* "lrocklrg-falling" 0 self -1.0) (suspend) ) @@ -350,8 +336,7 @@ ;; failed to figure out what this is: (defstate falling (beach-rock) :virtual #t - :trans - (behavior () + :trans (behavior () (set! (-> self draw bounds w) 819200.0) (let ((f30-0 (ja-aframe-num 0))) (when (and (< -50.0 f30-0) (< f30-0 158.0)) @@ -382,8 +367,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (v1-3 symbol) (v1-49 symbol)) (until v1-3 (spool-push *art-control* "lrocklrg-falling" 0 self -1.0) @@ -392,37 +376,18 @@ ) (logclear! (-> self draw status) (draw-status hidden)) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let* ((gp-1 (get-process *default-dead-pool* othercam #x4000)) - (gp-2 (ppointer->handle (when gp-1 - (let ((t9-5 (method-of-type othercam activate))) - (t9-5 (the-as othercam gp-1) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 othercam-init-by-other self 7 #f #t) - (-> gp-1 ppointer) - ) - ) - ) - (s5-0 (get-process *default-dead-pool* fuel-cell #x4000)) - (s5-1 - (ppointer->handle - (when s5-0 - (let ((t9-8 (method-of-type fuel-cell activate))) - (t9-8 (the-as fuel-cell s5-0) self 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 fuel-cell-init-as-clone (process->handle self) (-> self entity extra perm task)) - (-> s5-0 ppointer) - ) - ) - ) - ) + (ja :group! (-> self draw art-group data 2) :num! min) + (let ((gp-2 (ppointer->handle (process-spawn othercam self 7 #f #t :to self))) + (s5-1 (ppointer->handle (process-spawn + fuel-cell + :init fuel-cell-init-as-clone + (process->handle self) + (-> self entity extra perm task) + :to self + ) + ) + ) + ) (close-specific-task! (-> self entity extra perm task) (task-status need-reminder)) (set! (-> self movie-start) (-> *display* base-frame-counter)) (spool-push *art-control* "lrocklrg-falling" 0 self -1.0) @@ -431,8 +396,7 @@ :name "lrocklrg-falling" :index 4 :parts 4 - :command-list - '((-150 blackout 100) (-116 blackout 0)) + :command-list '((-150 blackout 100) (-116 blackout 0)) ) (the-as art-joint-anim (-> self draw art-group data 2)) (the-as art-joint-anim (-> self draw art-group data 3)) @@ -460,15 +424,13 @@ (go-virtual fallen) (none) ) - :post - (the-as (function none :behavior beach-rock) transform-post) + :post (the-as (function none :behavior beach-rock) transform-post) ) ;; failed to figure out what this is: (defstate fallen (beach-rock) :virtual #t - :code - (behavior () + :code (behavior () (level-hint-spawn (game-text-id beach-seagulls-avalanche) "sksp0025" @@ -476,10 +438,8 @@ *entity-pool* (game-task none) ) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (TODO-RENAME-9 (-> self align)) + (ja :group! (-> self draw art-group data 3)) + (compute-alignment! (-> self align)) (let ((v1-6 (first-transform (-> self align)))) (set! (-> self root-override trans quad) (-> self entity extra trans quad)) (+! (-> self root-override trans y) (-> v1-6 trans y)) @@ -491,8 +451,7 @@ 0 (none) ) - :post - (the-as (function none :behavior beach-rock) ja-post) + :post (the-as (function none :behavior beach-rock) ja-post) ) ;; definition for method 11 of type beach-rock diff --git a/test/decompiler/reference/levels/beach/bird-lady-beach_REF.gc b/test/decompiler/reference/levels/beach/bird-lady-beach_REF.gc index d6fc166c84..cb05e50b39 100644 --- a/test/decompiler/reference/levels/beach/bird-lady-beach_REF.gc +++ b/test/decompiler/reference/levels/beach/bird-lady-beach_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/bird-lady-beach-ag.gc") + ;; definition of type bird-lady-beach (deftype bird-lady-beach (process-taskable) ((flutflut handle :offset-assert 384) @@ -23,20 +25,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *bird-lady-beach-sg* bird-lady-beach - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *bird-lady-beach-sg* bird-lady-beach bird-lady-beach-lod0-jg bird-lady-beach-idle-ja + ((bird-lady-beach-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow bird-lady-beach-shadow-mg + ) ;; failed to figure out what this is: (defstate idle (bird-lady-beach) :virtual #t - :enter - (behavior () + :enter (behavior () (when (not (should-display? self)) (let ((a0-2 (handle->process (-> self flutflut)))) (if a0-2 @@ -62,42 +60,21 @@ (when arg0 (set! (-> obj cell-for-task) (current-task (-> obj tasks))) (close-current! (-> obj tasks)) - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj flutflut) - (ppointer->handle - (when s5-1 - (let ((t9-4 (method-of-type manipy activate))) - (t9-4 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *flutflut-naked-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> obj flutflut) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *flutflut-naked-sg* #f :to obj)) + ) (send-event (handle->process (-> obj flutflut)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj flutflut)) 'blend-shape #t) - (let ((s5-2 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj egg) - (ppointer->handle - (when s5-2 - (let ((t9-9 (method-of-type manipy activate))) - (t9-9 (the-as manipy s5-2) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 manipy-init (-> obj root-override trans) (-> obj entity) *flutflutegg-sg* #f) - (-> s5-2 ppointer) - ) - ) - ) - ) + (set! (-> obj egg) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *flutflutegg-sg* #f :to obj)) + ) (send-event (handle->process (-> obj egg)) 'anim-mode 'clone-anim) ) (new 'static 'spool-anim :name "bird-lady-beach-resolution" :index 4 :parts 10 - :command-list - '((141 joint "cameraB") (535 joint "camera") (696 joint "cameraB") (758 joint "camera") (813 joint "cameraB")) + :command-list '((141 joint "cameraB") (535 joint "camera") (696 joint "cameraB") (758 joint "camera") (813 joint "cameraB")) ) ) (else diff --git a/test/decompiler/reference/levels/beach/bird-lady_REF.gc b/test/decompiler/reference/levels/beach/bird-lady_REF.gc index 01a1526956..552df8f6aa 100644 --- a/test/decompiler/reference/levels/beach/bird-lady_REF.gc +++ b/test/decompiler/reference/levels/beach/bird-lady_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/bird-lady-ag.gc") + ;; definition of type bird-lady (deftype bird-lady (process-taskable) () @@ -19,17 +21,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *bird-lady-sg* bird-lady - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 1 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *bird-lady-sg* bird-lady bird-lady-lod0-jg bird-lady-idle-ja + ((bird-lady-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 2.5) + :shadow bird-lady-shadow-mg + ) ;; definition for method 52 of type bird-lady -;; INFO: Return type mismatch int vs none. +;; INFO: Return type mismatch shadow-flags vs none. (defmethod dummy-52 bird-lady ((obj bird-lady)) (let ((v1-1 (-> obj draw shadow-ctrl))) (when v1-1 @@ -43,7 +42,7 @@ ) ) 0 - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) ) ) (none) @@ -58,14 +57,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -84,8 +83,7 @@ :name "bird-lady-introduction" :index 4 :parts 11 - :command-list - '((0 want-levels village1 beach) + :command-list '((0 want-levels village1 beach) (49 joint "cameraB") (101 display-level beach special) (101 kill "yakow-8") @@ -147,10 +145,7 @@ ;; definition for method 43 of type bird-lady (defmethod TODO-RENAME-43 bird-lady ((obj bird-lady)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.66 f0-2) (play-ambient (-> obj ambient) "BIR-LO02" #f (-> obj root-override trans)) diff --git a/test/decompiler/reference/levels/beach/lurkercrab_REF.gc b/test/decompiler/reference/levels/beach/lurkercrab_REF.gc index 6c52171b24..f6a8690611 100644 --- a/test/decompiler/reference/levels/beach/lurkercrab_REF.gc +++ b/test/decompiler/reference/levels/beach/lurkercrab_REF.gc @@ -1,20 +1,20 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/lurkercrab-ag.gc") + ;; failed to figure out what this is: (defpartgroup group-lurkercrab-slide :id 159 :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 663 :fade-after (meters 40) :falloff-to (meters 40)) + :parts ((sp-item 663 :fade-after (meters 40) :falloff-to (meters 40)) (sp-item 664 :fade-after (meters 40) :falloff-to (meters 40)) ) ) ;; failed to figure out what this is: (defpart 663 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-flt spt-y (meters -2)) (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) @@ -34,8 +34,7 @@ ;; failed to figure out what this is: (defpart 664 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-flt spt-y (meters -2)) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) @@ -78,18 +77,15 @@ ) ;; failed to figure out what this is: -(defskelgroup *lurkercrab-sg* lurkercrab - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - ) +(defskelgroup *lurkercrab-sg* lurkercrab lurkercrab-lod0-jg lurkercrab-idle-ja + ((lurkercrab-lod0-mg (meters 20)) (lurkercrab-lod1-mg (meters 40)) (lurkercrab-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + ) ;; definition for method 44 of type lurkercrab ;; INFO: Return type mismatch symbol vs object. (defmethod dummy-44 lurkercrab ((obj lurkercrab) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) 64) + (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) (-> obj collide-info) @@ -106,7 +102,7 @@ 6144.0 16384.0 ) - (the-as object (if (zero? (logand (-> obj nav-enemy-flags) 256)) + (the-as object (if (zero? (logand (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8))) (do-push-aways! (-> obj collide-info)) ) ) @@ -125,7 +121,7 @@ ) ((= v1-1 'punch) (cond - ((logtest? (-> obj nav-enemy-flags) 32) + ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) (logclear! (-> obj mask) (process-mask actor-pause)) (go (method-of-object obj nav-enemy-die)) ) @@ -147,7 +143,7 @@ ) ) ) - ((logtest? (-> obj nav-enemy-flags) 32) + ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) (logclear! (-> obj mask) (process-mask actor-pause)) (go (method-of-object obj nav-enemy-die)) ) @@ -178,7 +174,7 @@ nav-enemy-default-event-handler ;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-37 lurkercrab ((obj lurkercrab)) (when (-> obj orient) - (if (logtest? (nav-control-flags bit19) (-> obj nav flags)) + (if (logtest? (nav-control-flags navcf19) (-> obj nav flags)) (seek-to-point-toward-point! (-> obj collide-info) (-> obj nav target-pos) @@ -218,73 +214,40 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-idle (lurkercrab) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :exit - (behavior () + :exit (behavior () (set! (-> self draw force-lod) -1) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self target-speed) 0.0) (set! (-> self draw force-lod) 2) - (ja-channel-push! 1 22) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> gp-0 frame-num) (ja-aframe 1.0 0)) - ) + (ja-channel-push! 1 (seconds 0.075)) + (loop + (ja :group! lurkercrab-idle-ja :num! (identity (ja-aframe 1.0 0))) (let ((gp-1 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 3)) (suspend) ) ) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> gp-2 param 0) (ja-aframe 19.0 0)) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) (ja-aframe 1.0 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! lurkercrab-idle-ja :num! (seek! (ja-aframe 19.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 19.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 num-func) num-func-identity) - (set! (-> gp-4 frame-num) (ja-aframe 19.0 0)) + (ja :num! (seek! (ja-aframe 19.0 0))) ) + (ja :num-func num-func-identity :frame-num (ja-aframe 19.0 0)) (let ((gp-5 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 1)) (suspend) ) ) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> gp-6 param 0) (ja-aframe 1.0 0)) - (set! (-> gp-6 param 1) 1.0) - (set! (-> gp-6 frame-num) (ja-aframe 19.0 0)) - (joint-control-channel-group! gp-6 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! lurkercrab-idle-ja :num! (seek! (ja-aframe 1.0 0)) :frame-num (ja-aframe 19.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-7 (-> self skel root-channel 0))) - (set! (-> gp-7 param 0) (ja-aframe 1.0 0)) - (set! (-> gp-7 param 1) 1.0) - (joint-control-channel-group-eval! gp-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 1.0 0))) ) ) (none) @@ -293,7 +256,7 @@ nav-enemy-default-event-handler ;; definition for function lurkercrab-invulnerable (defbehavior lurkercrab-invulnerable lurkercrab () - (set! (-> self nav-enemy-flags) (logand -33 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (let ((v1-3 (find-prim-by-id (-> self collide-info) (the-as uint 2)))) (when v1-3 (let ((v0-1 4)) @@ -306,7 +269,7 @@ nav-enemy-default-event-handler ;; definition for function lurkercrab-vulnerable (defbehavior lurkercrab-vulnerable lurkercrab () - (logior! (-> self nav-enemy-flags) 32) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (let ((v1-3 (find-prim-by-id (-> self collide-info) (the-as uint 2)))) (when v1-3 (let ((v0-1 1)) @@ -320,156 +283,73 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-patrol (lurkercrab) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :exit - (behavior () + :exit (behavior () (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 8) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (none) ) - :code - (behavior () - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 4) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (when (ja-group? lurkercrab-idle-ja) + (ja-no-eval :group! lurkercrab-idle-to-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (ja-channel-push! 1 22) - (while #t + (ja-channel-push! 1 (seconds 0.075)) + (loop (dotimes (gp-0 6) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! lurkercrab-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (when (nav-enemy-rnd-go-idle? 0.2) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) 1.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 180) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (nav-enemy-rnd-int-range 2 6) (until (not (nav-enemy-rnd-go-idle? 0.2)) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> gp-1 frame-num) (ja-aframe 1.0 0)) - ) + (ja :group! lurkercrab-idle-ja :num! (identity (ja-aframe 1.0 0))) (let ((gp-2 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 2)) (suspend) ) ) ) - (logior! (-> self nav-enemy-flags) 8) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (ja-no-eval :group! lurkercrab-idle-to-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> gp-3 param 0) (ja-aframe 30.0 0)) - (set! (-> gp-3 param 1) 1.0) - (set! (-> gp-3 frame-num) (ja-aframe 1.0 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! lurkercrab-peek-ja :num! (seek! (ja-aframe 30.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 param 0) (ja-aframe 30.0 0)) - (set! (-> gp-4 param 1) 1.0) - (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 30.0 0))) ) (lurkercrab-vulnerable) - (logior! (-> self nav-enemy-flags) 64) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (dotimes (gp-5 2) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> s5-0 param 0) (ja-aframe 60.0 0)) - (set! (-> s5-0 param 1) 1.0) - (set! (-> s5-0 frame-num) (ja-aframe 30.0 0)) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! lurkercrab-peek-ja :num! (seek! (ja-aframe 60.0 0)) :frame-num (ja-aframe 30.0 0)) (until (ja-done? 0) (suspend) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 param 0) (ja-aframe 60.0 0)) - (set! (-> s5-1 param 1) 1.0) - (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 60.0 0))) ) ) (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> gp-6 param 0) (ja-aframe 90.0 0)) - (set! (-> gp-6 param 1) 1.0) - (set! (-> gp-6 frame-num) (ja-aframe 60.0 0)) - (joint-control-channel-group! gp-6 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) + (ja-no-eval :group! lurkercrab-peek-to-walk-ja :num! (seek! (ja-aframe 90.0 0)) :frame-num (ja-aframe 60.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-7 (-> self skel root-channel 0))) - (set! (-> gp-7 param 0) (ja-aframe 90.0 0)) - (set! (-> gp-7 param 1) 1.0) - (joint-control-channel-group-eval! gp-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 90.0 0))) ) ) (none) @@ -479,13 +359,11 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-notice (lurkercrab) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-chase) (none) ) @@ -494,20 +372,19 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-chase (lurkercrab) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :exit - (behavior () + :exit (behavior () (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (none) ) - :trans - (behavior () - (if (logtest? (-> *target* state-flags) #x80f8) + :trans (behavior () + (if (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) (go-virtual nav-enemy-victory) ) (if (< (ja-aframe-num 0) 2.0) @@ -515,140 +392,53 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (logior! (-> self nav-enemy-flags) 8) - (ja-channel-push! 1 22) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + :code (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (ja-channel-push! 1 (seconds 0.075)) + (loop + (ja-no-eval :group! lurkercrab-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (lurkercrab-vulnerable) - (logior! (-> self nav-enemy-flags) 64) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> gp-0 param 0) (ja-aframe 30.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 1.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) + (ja-no-eval :group! lurkercrab-peek-ja :num! (seek! (ja-aframe 30.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 30.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> gp-2 param 0) (ja-aframe 120.0 0)) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) (ja-aframe 30.0 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) + (ja :num! (seek! (ja-aframe 30.0 0))) ) + (ja-no-eval :group! lurkercrab-snip-ja :num! (seek! (ja-aframe 120.0 0)) :frame-num (ja-aframe 30.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 120.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> gp-4 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-4 param 1) 1.0) - (set! (-> gp-4 frame-num) (ja-aframe 30.0 0)) - (joint-control-channel-group! gp-4 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) + (ja :num! (seek! (ja-aframe 120.0 0))) ) + (ja-no-eval :group! lurkercrab-peek-ja :num! (seek! (ja-aframe 60.0 0)) :frame-num (ja-aframe 30.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-5 param 1) 1.0) - (joint-control-channel-group-eval! gp-5 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> gp-6 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-6 param 1) 1.0) - (set! (-> gp-6 frame-num) (ja-aframe 30.0 0)) - (joint-control-channel-group! gp-6 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) + (ja :num! (seek! (ja-aframe 60.0 0))) ) + (ja-no-eval :group! lurkercrab-peek-ja :num! (seek! (ja-aframe 60.0 0)) :frame-num (ja-aframe 30.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-7 (-> self skel root-channel 0))) - (set! (-> gp-7 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-7 param 1) 1.0) - (joint-control-channel-group-eval! gp-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 60.0 0))) ) (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) - (let ((gp-8 (-> self skel root-channel 0))) - (set! (-> gp-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> gp-8 param 0) (ja-aframe 90.0 0)) - (set! (-> gp-8 param 1) 1.0) - (set! (-> gp-8 frame-num) (ja-aframe 60.0 0)) - (joint-control-channel-group! gp-8 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) + (ja-no-eval :group! lurkercrab-peek-to-walk-ja :num! (seek! (ja-aframe 90.0 0)) :frame-num (ja-aframe 60.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-9 (-> self skel root-channel 0))) - (set! (-> gp-9 param 0) (ja-aframe 90.0 0)) - (set! (-> gp-9 param 1) 1.0) - (joint-control-channel-group-eval! gp-9 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-35 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-35 param 1) 1.0) - (set! (-> a0-35 frame-num) 0.0) - (joint-control-channel-group! a0-35 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) + (ja :num! (seek! (ja-aframe 90.0 0))) ) + (ja-no-eval :group! lurkercrab-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1))) - (set! (-> a0-36 param 1) 1.0) - (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-38 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-38 param 1) 1.0) - (set! (-> a0-38 frame-num) 0.0) - (joint-control-channel-group! a0-38 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! lurkercrab-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 param 0) (the float (+ (-> a0-39 frame-group data 0 length) -1))) - (set! (-> a0-39 param 1) 1.0) - (joint-control-channel-group-eval! a0-39 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) @@ -658,13 +448,11 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-stop-chase (lurkercrab) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-patrol) (none) ) @@ -673,13 +461,11 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-stare (lurkercrab) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-patrol) (none) ) @@ -688,25 +474,16 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-victory (lurkercrab) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (ja-channel-push! 1 22) - (let ((v1-4 (-> self skel root-channel 0))) - (set! (-> v1-4 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - ) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! (-> self draw art-group data (-> self nav-info victory-anim))) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) - (let ((v1-7 (-> self skel root-channel 0))) - (set! (-> v1-7 num-func) num-func-identity) - (set! (-> v1-7 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) (go-virtual nav-enemy-patrol) @@ -716,35 +493,22 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate lurkercrab-pushed (lurkercrab) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkercrab) nav-enemy-default-event-handler ) - :exit - (behavior () + :exit (behavior () (set! (-> self orient) #t) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self momentum-speed) 57344.0) (set! (-> self target-speed) 0.0) (set! (-> self orient) #f) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> gp-0 param 0) (ja-aframe 18.0 0)) - (set! (-> gp-0 param 1) 0.75) - (set! (-> gp-0 frame-num) (ja-aframe 1.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! lurkercrab-kickback-ja :num! (seek! (ja-aframe 18.0 0) 0.75) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 18.0 0)) - (set! (-> gp-1 param 1) 0.75) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 18.0 0) 0.75)) ) (let ((gp-2 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.25)) @@ -759,8 +523,7 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-chase) (none) ) - :post - (behavior () + :post (behavior () (let ((a0-0 (-> self part)) (a1-0 (-> self collide-info root-prim prim-core)) ) @@ -819,7 +582,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -874,7 +637,7 @@ nav-enemy-default-event-handler (TODO-RENAME-45 obj *lurkercrab-nav-enemy-info*) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 159) obj)) (set! (-> obj orient) #t) - (set! (-> obj nav-enemy-flags) (logand -97 (-> obj nav-enemy-flags))) + (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5 navenmf6)) (set! (-> obj target-speed) 0.0) (set! (-> obj momentum-speed) 0.0) (set! (-> obj draw force-lod) 2) diff --git a/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc b/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc index 6057850018..23794ed792 100644 --- a/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc +++ b/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/lurkerpuppy-ag.gc") + ;; definition of type lurkerpuppy (deftype lurkerpuppy (nav-enemy) () @@ -19,14 +21,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *lurkerpuppy-sg* lurkerpuppy - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *lurkerpuppy-sg* lurkerpuppy lurkerpuppy-lod0-jg lurkerpuppy-idle-ja + ((lurkerpuppy-lod0-mg (meters 20)) (lurkerpuppy-lod1-mg (meters 40)) (lurkerpuppy-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :shadow lurkerpuppy-shadow-mg + ) ;; failed to figure out what this is: nav-enemy-default-event-handler @@ -34,35 +33,18 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-notice (lurkerpuppy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkerpuppy) nav-enemy-default-event-handler ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 51) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.17)) + (ja-no-eval :group! lurkerpuppy-celebrate-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-chase) (none) @@ -72,66 +54,36 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-chase (lurkerpuppy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkerpuppy) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 10) - ) - (ja-channel-push! 1 51) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 4.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + ((ja-group? lurkerpuppy-jump-land-ja) + (ja-channel-push! 1 (seconds 0.17)) + (ja-no-eval :group! lurkerpuppy-run-ja :num! (seek!) :frame-num (ja-aframe 4.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (ja-channel-push! 1 51) + (ja-channel-push! 1 (seconds 0.17)) ) ) (let ((f30-0 (rand-vu-float-range 0.9 1.1))) - (while #t + (loop (if (rand-vu-percent? 0.25) - (sound-play-by-name (static-sound-name "puppy-bark") (new-sound-id) 1024 0 0 1 #t) + (sound-play "puppy-bark") ) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-14 param 1) f30-0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! lurkerpuppy-run-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-attack) ) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) f30-0) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -142,62 +94,39 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-stare (lurkerpuppy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkerpuppy) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 1456355.5) (set! (-> self turn-time) (seconds 0.1)) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) - (while #t - (logior! (-> self nav-enemy-flags) 16) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> gp-0 param 0) (ja-aframe 12.0 0)) - (set! (-> gp-0 param 1) f30-0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (loop + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! lurkerpuppy-celebrate-ja :num! (seek! (ja-aframe 12.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (let ((f0-3 (ja-aframe-num 0))) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (if (and (>= f0-3 2.5) (>= 7.5 f0-3)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) ) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 12.0 0)) - (set! (-> gp-1 param 1) f30-0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) 1.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 30) - (let ((v1-31 (-> self skel root-channel 0))) - (set! (-> v1-31 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) - (let ((v1-34 (-> self skel root-channel 0))) - (set! (-> v1-34 num-func) num-func-identity) - (set! (-> v1-34 frame-num) 0.0) + (ja :num! (seek! (ja-aframe 12.0 0) f30-0)) ) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! lurkerpuppy-idle-ja) + (ja :num-func num-func-identity :frame-num 0.0) (let ((gp-2 (rand-vu-int-range 750 900)) (s5-0 (-> *display* base-frame-counter)) ) (until (>= (- (-> *display* base-frame-counter) s5-0) gp-2) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (ja-blend-eval) (suspend) ) @@ -211,44 +140,22 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-give-up (lurkerpuppy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkerpuppy) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 218453.33) (set! (-> self turn-time) (seconds 0.5)) - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! lurkerpuppy-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.4) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! lurkerpuppy-idle-ja :num! (seek! max 1.4) :frame-num 0.0) (until (ja-done? 0) (seek-to-point-toward-point! (-> self collide-info) @@ -257,11 +164,7 @@ nav-enemy-default-event-handler (-> self turn-time) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.4) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 1.4)) ) (go-virtual nav-enemy-patrol) (none) @@ -271,14 +174,12 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-attack (lurkerpuppy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkerpuppy) nav-enemy-default-event-handler ) - :code - (behavior () - (sound-play-by-name (static-sound-name "head-butt") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (sound-play "head-butt") (go-virtual nav-enemy-victory) (none) ) @@ -287,50 +188,34 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-victory (lurkerpuppy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkerpuppy) nav-enemy-default-event-handler ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 16) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (none) ) - :code - (behavior () - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) - (ja-channel-push! 1 22) + :code (behavior () + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-channel-push! 1 (seconds 0.075)) (dotimes (gp-0 4) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! lurkerpuppy-celebrate-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f0-4 (ja-aframe-num 0))) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (if (and (>= f0-4 2.5) (>= 7.5 f0-4)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) ) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (go-virtual nav-enemy-chase) (none) ) - :post - (the-as (function none :behavior lurkerpuppy) nav-enemy-face-player-post) + :post (the-as (function none :behavior lurkerpuppy) nav-enemy-face-player-post) ) ;; definition for symbol *lurkerpuppy-nav-enemy-info*, type nav-enemy-info @@ -382,7 +267,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/test/decompiler/reference/levels/beach/lurkerworm_REF.gc b/test/decompiler/reference/levels/beach/lurkerworm_REF.gc index af2c9871cf..1690fc68fc 100644 --- a/test/decompiler/reference/levels/beach/lurkerworm_REF.gc +++ b/test/decompiler/reference/levels/beach/lurkerworm_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/lurkerworm-ag.gc") + ;; definition of type lurkerworm (deftype lurkerworm (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -66,21 +68,18 @@ ) ;; failed to figure out what this is: -(defskelgroup *lurkerworm-sg* lurkerworm - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 6.5) - :longest-edge (meters 1.5) - ) +(defskelgroup *lurkerworm-sg* lurkerworm lurkerworm-lod0-jg lurkerworm-idle-ja + ((lurkerworm-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 6.5) + :longest-edge (meters 1.5) + ) ;; failed to figure out what this is: (defpartgroup group-beach-sandworm :id 157 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 656 :fade-after (meters 90) :period 900 :length 300) + :parts ((sp-item 656 :fade-after (meters 90) :period 900 :length 300) (sp-item 657 :fade-after (meters 100) :period 900 :length 390) (sp-item 658 :fade-after (meters 150) :period 900 :length 420 :offset 120) (sp-item 659 :fade-after (meters 60) :period 900 :length 420 :offset 120) @@ -92,8 +91,7 @@ :id 158 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 656 :fade-after (meters 90) :period 900 :length 300) + :parts ((sp-item 656 :fade-after (meters 90) :period 900 :length 300) (sp-item 658 :fade-after (meters 150) :period 900 :length 420 :offset 120) (sp-item 659 :fade-after (meters 60) :period 900 :length 420 :offset 120) ) @@ -101,8 +99,7 @@ ;; failed to figure out what this is: (defpart 656 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters 3) (meters 5) 1.0) (sp-flt spt-y (meters 1)) @@ -127,14 +124,12 @@ ;; failed to figure out what this is: (defpart 660 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: (defpart 658 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) @@ -157,8 +152,7 @@ ;; failed to figure out what this is: (defpart 659 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.6) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -181,8 +175,7 @@ ;; failed to figure out what this is: (defpart 657 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.4) 1.0) @@ -204,8 +197,7 @@ ;; failed to figure out what this is: (defpart 661 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) @@ -229,8 +221,7 @@ ;; failed to figure out what this is: (defpart 662 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) ;; definition for method 20 of type lurkerworm @@ -243,7 +234,7 @@ (let* ((f0-5 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z))))) (f0-6 (atan (-> s5-0 y) f0-5)) ) - (set! (-> obj head-tilt) (seek (-> obj head-tilt) f0-6 (* 5461.3335 (-> *display* seconds-per-frame)))) + (seek! (-> obj head-tilt) f0-6 (* 5461.3335 (-> *display* seconds-per-frame))) ) ) (set! (-> obj head-tilt) (fmin 8192.0 (fmax -5461.3335 (-> obj head-tilt)))) @@ -253,10 +244,10 @@ ;; definition for function lurkerworm-prebind-function ;; INFO: Return type mismatch int vs none. -(defbehavior lurkerworm-prebind-function lurkerworm ((arg0 process) (arg1 int) (arg2 lurkerworm)) +(defbehavior lurkerworm-prebind-function lurkerworm ((arg0 pointer) (arg1 int) (arg2 lurkerworm)) (let ((v1-0 arg2) (s5-0 (new 'stack-no-clear 'quaternion)) - (gp-0 (&-> arg0 stack 324)) + (gp-0 (&+ arg0 432)) ) (quaternion-axis-angle! s5-0 -1.0 0.0 0.0 (-> v1-0 head-tilt)) (quaternion*! (the-as quaternion gp-0) (the-as quaternion gp-0) s5-0) @@ -358,17 +349,14 @@ lurkerworm-default-post-behavior ;; failed to figure out what this is: (defstate lurkerworm-idle (lurkerworm) - :event - lurkerworm-default-event-handler - :enter - (behavior () + :event lurkerworm-default-event-handler + :enter (behavior () (ja-channel-set! 0) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) *target* (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) @@ -379,24 +367,20 @@ lurkerworm-default-post-behavior ) (none) ) - :post - lurkerworm-default-post-behavior + :post lurkerworm-default-post-behavior ) ;; failed to figure out what this is: (defstate lurkerworm-spot (lurkerworm) - :event - lurkerworm-default-event-handler - :enter - (behavior () + :event lurkerworm-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "worm-rise1") (new-sound-id) 1024 0 0 1 #t) + (sound-play "worm-rise1") (none) ) - :code - (behavior () + :code (behavior () (set! (-> self part local-clock) 0) - (while #t + (loop (spawn (-> self part) (-> self root-override trans)) (particle-effect self) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -409,66 +393,45 @@ lurkerworm-default-post-behavior ) (none) ) - :post - lurkerworm-default-post-behavior + :post lurkerworm-default-post-behavior ) ;; failed to figure out what this is: (defstate lurkerworm-rise (lurkerworm) - :event - lurkerworm-default-event-handler - :enter - (behavior () + :event lurkerworm-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior () + :code (behavior () (ja-channel-set! 1) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! lurkerworm-rise-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (spawn (-> self part) (-> self root-override trans)) (particle-effect self) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self strike-count) 3) (go lurkerworm-rest) (none) ) - :post - lurkerworm-default-post-behavior + :post lurkerworm-default-post-behavior ) ;; failed to figure out what this is: (defstate lurkerworm-rest (lurkerworm) - :event - lurkerworm-default-event-handler - :enter - (behavior () + :event lurkerworm-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self vulnerable) #t) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self vulnerable) #f) (none) ) - :code - (behavior () + :code (behavior () (let* ((f30-0 10.0) (f28-0 100.0) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -479,15 +442,7 @@ lurkerworm-default-post-behavior (if gp-1 (+! (-> self strike-count) -1) ) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! lurkerworm-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (particle-effect self) @@ -503,10 +458,8 @@ lurkerworm-default-post-behavior ) ) (f30-2 (* 0.2 f0-13)) - (v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-32 (the-as number (logior #x3f800000 v1-31))) ) - (if (< (+ -1.0 (the-as float v1-32)) f30-2) + (if (< (rand-float-gen) f30-2) (go lurkerworm-strike) ) ) @@ -519,11 +472,7 @@ lurkerworm-default-post-behavior ) ) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (if gp-1 (go lurkerworm-strike) @@ -532,125 +481,73 @@ lurkerworm-default-post-behavior ) (none) ) - :post - lurkerworm-default-post-behavior + :post lurkerworm-default-post-behavior ) ;; failed to figure out what this is: (defstate lurkerworm-strike (lurkerworm) - :event - lurkerworm-default-event-handler - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 40) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> gp-0 param 0) (ja-aframe 13.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + :event lurkerworm-default-event-handler + :code (behavior () + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.135)) + (ja-no-eval :group! lurkerworm-chomp-ja :num! (seek! (ja-aframe 13.0 0)) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (particle-effect self) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 13.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 13.0 0))) ) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 40) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.135)) (go lurkerworm-rest) (none) ) - :post - lurkerworm-default-post-behavior + :post lurkerworm-default-post-behavior ) ;; failed to figure out what this is: (defstate lurkerworm-sink (lurkerworm) - :event - lurkerworm-default-event-handler - :enter - (behavior () + :event lurkerworm-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! lurkerworm-sink-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (spawn (-> self part2) (-> self root-override trans)) (particle-effect self) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go lurkerworm-idle) (none) ) - :post - lurkerworm-default-post-behavior + :post lurkerworm-default-post-behavior ) ;; failed to figure out what this is: (defstate lurkerworm-die (lurkerworm) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior lurkerworm) process-drawable-death-event-handler ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (let ((v1-3 (-> self root-override root-prim))) (set! (-> v1-3 collide-with) (collide-kind)) (set! (-> v1-3 prim-core collide-as) (collide-kind)) ) 0 - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! lurkerworm-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (cleanup-for-death self) (none) ) - :post - lurkerworm-default-post-behavior + :post lurkerworm-default-post-behavior ) ;; definition for method 11 of type lurkerworm @@ -739,9 +636,7 @@ lurkerworm-default-post-behavior (set! (-> obj twister) (new 'process 'twister 3 15 1092.2667 72.81778 0.25 0.001)) (TODO-RENAME-9 (-> obj twister) 3 9 910.2222) (set! (-> obj head-tilt) 0.0) - (set! (-> obj skel prebind-function) - (the-as (function pointer int process-drawable none) lurkerworm-prebind-function) - ) + (set! (-> obj skel prebind-function) lurkerworm-prebind-function) (set! (-> obj skel postbind-function) lurkerworm-joint-callback) (set! (-> obj root-override nav-radius) 12288.0) (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) diff --git a/test/decompiler/reference/levels/beach/mayor_REF.gc b/test/decompiler/reference/levels/beach/mayor_REF.gc index ab46994fea..d3729fdfee 100644 --- a/test/decompiler/reference/levels/beach/mayor_REF.gc +++ b/test/decompiler/reference/levels/beach/mayor_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/mayor-ag.gc") + ;; definition of type mayor (deftype mayor (process-taskable) () @@ -19,14 +21,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *mayor-sg* mayor - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *mayor-sg* mayor mayor-lod0-jg mayor-idle-ja + ((mayor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow mayor-shadow-mg + ) ;; definition for method 52 of type mayor ;; INFO: Return type mismatch int vs none. @@ -55,14 +54,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (set! (-> v1-14 settings flags) (logior (the-as int (-> v1-14 settings flags)) 32)) + (set! (-> v1-14 settings flags) (the-as shadow-flags (logior (the-as int (-> v1-14 settings flags)) 32))) ) 0 ) @@ -99,8 +98,7 @@ :name "mayor-introduction" :index 4 :parts 16 - :command-list - '((0 kill "villagea-part-65") + :command-list '((0 kill "villagea-part-65") (0 kill "villagea-part-70") (0 kill "med-res-level-2") (0 kill "med-res-level-3") @@ -191,8 +189,7 @@ :name "mayor-reminder-donation" :index 6 :parts 3 - :command-list - '((0 kill "villagea-part-65") + :command-list '((0 kill "villagea-part-65") (0 kill "villagea-part-70") (0 kill "med-res-level-2") (0 kill "med-res-level-3") @@ -275,8 +272,7 @@ :name "mayor-reminder-beams" :index 5 :parts 3 - :command-list - '((0 kill "villagea-part-65") + :command-list '((0 kill "villagea-part-65") (0 kill "villagea-part-70") (0 kill "med-res-level-2") (0 kill "med-res-level-3") @@ -362,8 +358,7 @@ :name "mayor-reminder-beams" :index 5 :parts 3 - :command-list - '((0 kill "villagea-part-65") + :command-list '((0 kill "villagea-part-65") (0 kill "villagea-part-70") (0 kill "med-res-level-2") (0 kill "med-res-level-3") @@ -449,8 +444,7 @@ :name "mayor-reminder-donation" :index 6 :parts 3 - :command-list - '((0 kill "villagea-part-65") + :command-list '((0 kill "villagea-part-65") (0 kill "villagea-part-70") (0 kill "med-res-level-2") (0 kill "med-res-level-3") @@ -553,8 +547,7 @@ :name "mayor-resolution-donation" :index 8 :parts 5 - :command-list - '((0 kill "villagea-part-65") + :command-list '((0 kill "villagea-part-65") (0 kill "villagea-part-70") (0 kill "med-res-level-2") (0 kill "med-res-level-3") @@ -664,10 +657,7 @@ ;; definition for method 43 of type mayor (defmethod TODO-RENAME-43 mayor ((obj mayor)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.8888889 f0-2) (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) @@ -716,16 +706,14 @@ ;; failed to figure out what this is: (defstate idle (mayor) :virtual #t - :trans - (behavior () + :trans (behavior () (if (not (should-display? self)) (go-virtual hidden) ) ((-> (method-of-type process-taskable idle) trans)) (none) ) - :post - (behavior () + :post (behavior () (let ((t9-0 (-> (method-of-type process-taskable idle) post))) (if t9-0 ((the-as (function none) t9-0)) diff --git a/test/decompiler/reference/levels/beach/pelican_REF.gc b/test/decompiler/reference/levels/beach/pelican_REF.gc index e870c9f181..6b11c1319b 100644 --- a/test/decompiler/reference/levels/beach/pelican_REF.gc +++ b/test/decompiler/reference/levels/beach/pelican_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/pelican-ag.gc") + ;; definition of type pelican-bank (deftype pelican-bank (basic) ((circle-speed meters :offset-assert 4) @@ -146,18 +148,15 @@ ) ;; failed to figure out what this is: -(defskelgroup *pelican-sg* pelican - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 3 0 5) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *pelican-sg* pelican pelican-lod0-jg pelican-fly-ja + ((pelican-lod0-mg (meters 20)) (pelican-lod1-mg (meters 40)) (pelican-lod2-mg (meters 999999))) + :bounds (static-spherem 0 3 0 5) + :shadow pelican-shadow-mg + ) ;; definition for function pelican-path-update (defbehavior pelican-path-update pelican ((arg0 float) (arg1 int) (arg2 float) (arg3 float) (arg4 symbol)) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (let ((s3-0 (new 'stack-no-clear 'vector))) (let* ((f0-1 (+ (-> self path-pos) (* (-> self align align trans z) arg3))) (f1-2 (-> self path-max)) @@ -177,95 +176,47 @@ ;; definition for function pelican-fly (defbehavior pelican-fly pelican ((arg0 (function pelican int)) (arg1 (function pelican int))) - (while #t + (loop (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? pelican-fly-ja) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) ) (else - (ja-channel-push! 1 75) + (ja-channel-push! 1 (seconds 0.25)) ) ) (let ((s4-0 (arg0 self))) (dotimes (s3-0 s4-0) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! pelican-fly-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (let ((s4-1 (arg1 self))) (when (> s4-1 0) - (let ((s3-1 (-> self skel root-channel 0))) - (set! (-> s3-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> s3-1 param 0) (ja-aframe 12.0 0)) - (set! (-> s3-1 param 1) 1.0) - (set! (-> s3-1 frame-num) 0.0) - (joint-control-channel-group! s3-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! pelican-fly-ja :num! (seek! (ja-aframe 12.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((s3-2 (-> self skel root-channel 0))) - (set! (-> s3-2 param 0) (ja-aframe 12.0 0)) - (set! (-> s3-2 param 1) 1.0) - (joint-control-channel-group-eval! s3-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 12.0 0))) ) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) 0.25) - (joint-control-channel-group! a0-18 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 300) + (ja-no-eval :num! (loop! 0.25)) + (ja-channel-push! 1 (seconds 1)) (dotimes (s3-3 s4-1) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-20 param 1) 1.0) - (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! pelican-glide-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) 1.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja-no-eval :num! (loop!)) ) ) ) @@ -280,8 +231,7 @@ ;; failed to figure out what this is: (defstate pelican-circle (pelican) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -305,8 +255,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (while (-> self child) (deactivate (-> self child 0)) ) @@ -314,17 +263,7 @@ (let ((gp-0 (-> self path-vector))) (eval-path-curve-div! (-> self path-dive0) gp-0 4.5 'interp) (set! (-> gp-0 y) (+ -4505.6 (-> gp-0 y))) - (let* ((s5-0 (get-process *default-dead-pool* manipy #x4000)) - (v1-8 - (when s5-0 - (let ((t9-3 (method-of-type manipy activate))) - (t9-3 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init gp-0 (-> self entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2)) - (-> s5-0 ppointer) - ) - ) - ) + (let ((v1-8 (manipy-spawn gp-0 (-> self entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to self))) (set! (-> self fuel-cell) (ppointer->handle v1-8)) (if v1-8 (send-event @@ -348,8 +287,7 @@ (set-roll-to-grav-2! (-> self root-override) -2730.6667) (none) ) - :trans - (behavior () + :trans (behavior () (pelican-path-update 728177.75 30 1.0 (/ (-> self path-max) (path-distance (-> self path))) #f) (let ((f0-3 (+ (-> self path-pos) (* (-> self path-speed) (-> *display* seconds-per-frame)))) (f1-2 (-> self path-max)) @@ -359,60 +297,53 @@ (when (and (and *target* (>= 81920.0 (vector-vector-xz-distance (-> self path-vector) (-> *target* control trans)))) (not (handle->process (-> self cam-tracker))) ) - (let ((gp-1 (get-process *default-dead-pool* camera-tracker #x4000))) - (set! (-> self cam-tracker) - (ppointer->handle (when gp-1 - (let ((t9-4 (method-of-type camera-tracker activate))) - (t9-4 (the-as camera-tracker gp-1) self 'camera-tracker (the-as pointer #x70004000)) + (set! (-> self cam-tracker) + (ppointer->handle (process-spawn + camera-tracker + :init camera-tracker-init + (lambda :behavior camera-tracker + () + (local-vars + (a0-6 process-tree) + (a1-5 event-message-block) + (t9-6 (function process-tree event-message-block object)) ) - (run-now-in-process - gp-1 - camera-tracker-init - (lambda :behavior camera-tracker - () - (local-vars - (a0-6 process-tree) - (a1-5 event-message-block) - (t9-6 (function process-tree event-message-block object)) - ) - (while (not (process-grab? *target*)) - (suspend) - ) - (send-event (ppointer->process (-> self parent)) 'position 4.0) - (send-event (ppointer->process (-> self parent)) 'dive) - (suspend) - (suspend) - (send-event *camera* 'blend-from-as-fixed) - (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 0)) - (camera-change-to "camera-215" 0 #f) - (until (t9-6 a0-6 a1-5) - (suspend) - (set! a1-5 (new 'stack-no-clear 'event-message-block)) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 0) - (set! (-> a1-5 message) 'got-cell?) - (set! t9-6 send-event-function) - (set! a0-6 (ppointer->process (-> self parent))) - ) - (send-event *camera* 'point-of-interest #f) - (while (!= (-> self message) 'release) - (suspend) - ) - (set! (-> self message) #f) - (while (not (process-release? (handle->process (-> self grab-target)))) - (suspend) - ) - (send-event *camera* 'blend-from-as-fixed) - (camera-look-at (the-as pair *target*) (the-as uint 0)) - (camera-change-to (the-as string 'base) 150 #f) - (none) - ) + (while (not (process-grab? *target*)) + (suspend) ) - (-> gp-1 ppointer) + (send-event (ppointer->process (-> self parent)) 'position 4.0) + (send-event (ppointer->process (-> self parent)) 'dive) + (suspend) + (suspend) + (send-event *camera* 'blend-from-as-fixed) + (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 0)) + (camera-change-to "camera-215" 0 #f) + (until (t9-6 a0-6 a1-5) + (suspend) + (set! a1-5 (new 'stack-no-clear 'event-message-block)) + (set! (-> a1-5 from) self) + (set! (-> a1-5 num-params) 0) + (set! (-> a1-5 message) 'got-cell?) + (set! t9-6 send-event-function) + (set! a0-6 (ppointer->process (-> self parent))) + ) + (send-event *camera* 'point-of-interest #f) + (while (!= (-> self message) 'release) + (suspend) + ) + (set! (-> self message) #f) + (while (not (process-release? (handle->process (-> self grab-target)))) + (suspend) + ) + (send-event *camera* 'blend-from-as-fixed) + (camera-look-at (the-as pair *target*) (the-as uint 0)) + (camera-change-to (the-as string 'base) 150 #f) + (none) ) + :to self ) - ) - ) + ) + ) (set! (-> self draw force-lod) 0) 0 ) @@ -425,8 +356,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (suspend) (send-event (-> self fuel-cell process 0) 'trans-hook fuel-cell-animate) (pelican-fly @@ -435,14 +365,12 @@ ) (none) ) - :post - pelican-post + :post pelican-post ) ;; failed to figure out what this is: (defstate pelican-dive (pelican) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'got-cell?) @@ -455,8 +383,7 @@ ) ) ) - :enter - (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame)) + :enter (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame)) (init! (-> self query) (the-as string #f) 40 150 25 #t (the-as string #f)) (set! (-> self state-object) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -484,46 +411,28 @@ 0 (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self draw force-lod) -1) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (handle->process (-> self fuel-cell))) (go pelican-fly-to-end (-> self path-to-nest2) (-> *PELICAN-bank* run-away-time)) ) (pelican-path-update 364088.88 30 0.0 0.0 #t) - (set! (-> self path-pos) - (seek (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-to-nest (-> self path-cache) (the-as int (-> self time-cache))) ) (none) ) - :code - (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame)) - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> gp-0 param 0) (ja-aframe 48.0 0)) - (set! (-> gp-0 param 1) 0.5) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + :code (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame)) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! pelican-swoop-ja :num! (seek! (ja-aframe 48.0 0) 0.5) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (let ((gp-1 (handle->process (-> self fuel-cell)))) - (when (and gp-1 (>= (-> self path-pos) 3.8) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 1) - (set! (-> a1-5 message) 'query) - (set! (-> a1-5 param 0) (the-as uint 'grab)) - (not (send-event-function gp-1 a1-5)) - ) - ) + (when (and gp-1 (>= (-> self path-pos) 3.8) (not (send-event gp-1 'query 'grab))) (level-hint-spawn (game-text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) (send-event gp-1 'grab self) (send-event gp-1 'draw #f) @@ -532,65 +441,39 @@ ) ) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe 48.0 0)) - (set! (-> gp-2 param 1) 0.5) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) 1.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 60) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) + (ja :num! (seek! (ja-aframe 48.0 0) 0.5)) ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! pelican-fly-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (anim-loop) (none) ) - :post - pelican-post + :post pelican-post ) ;; failed to figure out what this is: (defstate pelican-to-nest (pelican) - :enter - (behavior ((arg0 path-control) (arg1 int)) + :enter (behavior ((arg0 path-control) (arg1 int)) (set! (-> self path) arg0) (set! (-> self path-pos) 0.0) (set! (-> self path-max) (the float (+ (-> self path curve num-cverts) -1))) (set! (-> self path-speed) (/ (* 300.0 (-> self path-max)) (the float arg1))) (none) ) - :trans - (behavior () + :trans (behavior () (pelican-path-update 546133.3 30 0.0 0.0 #f) - (set! (-> self path-pos) - (seek (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-wait-at-nest #f) ) (none) ) - :code - (behavior ((arg0 path-control) (arg1 int)) + :code (behavior ((arg0 path-control) (arg1 int)) (pelican-fly (the-as (function pelican int) (lambda () 1)) (lambda ((arg0 pelican)) (if (and (>= (-> arg0 path-pos) 4.0) (>= 6.0 (-> arg0 path-pos))) @@ -601,14 +484,12 @@ ) (none) ) - :post - pelican-post + :post pelican-post ) ;; failed to figure out what this is: (defstate pelican-wait-at-nest (pelican) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -659,8 +540,7 @@ ) ) ) - :enter - (behavior ((arg0 symbol)) + :enter (behavior ((arg0 symbol)) (set! (-> self path) (-> self path-from-nest0)) (set! (-> self path-pos) 0.0) (set! (-> self path-max) (the float (+ (-> self path curve num-cverts) -1))) @@ -692,15 +572,13 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (if (nonzero? (-> self neck)) (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((a1-0 (-> self state-vector)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -713,94 +591,47 @@ (spool-push *art-control* "pelican-spit-ext" 0 self -99.0) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (cond (arg0 (ja-channel-set! 1) ) (else - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) 0.25) - (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 75) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :num! (loop! 0.25)) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! pelican-fly-down-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (until (vector= (-> self root-override trans) (-> self state-vector)) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-loop!) - ) - ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) 1.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim #f) num-func-loop!) + (ja :num! (loop!)) ) + (ja-no-eval :num! (loop!)) (set! (-> self state-float 0) (* 4.0 (-> self state-float 0))) - (ja-channel-push! 1 15) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! pelican-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 150) + (ja-channel-push! 1 (seconds 0.5)) ) ) (send-event (handle->process (-> self cam-tracker)) 'message 'release) - (while #t - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (loop + (ja-no-eval :group! pelican-sleep-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (behavior () + :post (behavior () (when *target* (if *target* (look-at-enemy! (-> *target* neck) (the-as vector (-> self root-override root-prim prim-core)) 'nothing self) @@ -816,24 +647,13 @@ ;; failed to figure out what this is: (defstate pelican-spit (pelican) - :event - (-> pelican-circle event) - :code - (behavior () + :event (-> pelican-circle event) + :code (behavior () (local-vars (v1-21 symbol) (v1-31 symbol)) - (let* ((gp-0 (get-process *default-dead-pool* manipy #x4000)) - (gp-1 - (ppointer->handle - (when gp-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy gp-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 manipy-init (-> self entity extra trans) (-> self entity) *beachcam-sg* #f) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 + (ppointer->handle (manipy-spawn (-> self entity extra trans) (-> self entity) *beachcam-sg* #f :to self)) + ) + ) (let ((s5-0 (get-process *default-dead-pool* othercam #x4000))) (ppointer->handle (when s5-0 (let ((t9-4 (method-of-type othercam activate))) @@ -844,18 +664,11 @@ ) ) ) - (let* ((s5-1 (get-process *default-dead-pool* fuel-cell #x4000)) - (s4-0 (ppointer->handle (when s5-1 - (let ((t9-7 (method-of-type fuel-cell activate))) - (t9-7 (the-as fuel-cell s5-1) self 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 fuel-cell-init-as-clone (process->handle self) 0) - (-> s5-1 ppointer) - ) - ) - ) - (s5-2 (new 'stack-no-clear 'quaternion)) - ) + (let ((s4-0 + (ppointer->handle (process-spawn fuel-cell :init fuel-cell-init-as-clone (process->handle self) 0 :to self)) + ) + (s5-2 (new 'stack-no-clear 'quaternion)) + ) (quaternion-copy! s5-2 (-> self root-override quat)) (until v1-21 (suspend) @@ -867,10 +680,9 @@ :name "pelican-spit-ext" :index 11 :parts 2 - :command-list - '((10 send-event camera 'teleport-to-vector-start-string (static-vectorm -179 16 -421))) + :command-list '((10 send-event camera 'teleport-to-vector-start-string (static-vectorm -179 16 -421))) ) - (the-as art-joint-anim (-> self draw art-group data 10)) + (the-as art-joint-anim pelican-sleep-ja) (the-as art-joint-anim #f) (the-as (function process-drawable symbol) false-func) ) @@ -887,31 +699,26 @@ (quaternion-copy! (-> self root-override quat) s5-2) ) ) - (let ((gp-2 (get-process *default-dead-pool* process #x4000))) - (when gp-2 - (let ((t9-18 (method-of-type process activate))) - (t9-18 gp-2 self 'process (the-as pointer #x70004000)) + (process-spawn-function + process + (lambda :behavior pelican + () + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current movie) + (-> *setting-control* current hint) + ) + (suspend) ) - (run-next-time-in-process gp-2 (lambda :behavior pelican - () - (while (or (-> *setting-control* current ambient) - (-> *setting-control* current movie) - (-> *setting-control* current hint) - ) - (suspend) - ) - (level-hint-spawn - (game-text-id beach-pelican-quick-get-cell) - "sksp0027" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (none) - ) - ) - (-> gp-2 ppointer) + (level-hint-spawn + (game-text-id beach-pelican-quick-get-cell) + "sksp0027" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + (none) ) + :to self ) (let ((gp-3 (handle->process (-> self fuel-cell)))) (when gp-3 @@ -958,14 +765,8 @@ (go pelican-from-nest) (none) ) - :post - (behavior () - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 10) - ) - ) + :post (behavior () + (if (not (ja-group? pelican-sleep-ja)) (quaternion-identity! (-> self root-override quat)) ) (pelican-post) @@ -975,38 +776,31 @@ ;; failed to figure out what this is: (defstate pelican-from-nest (pelican) - :enter - (behavior () + :enter (behavior () (set! (-> self path-pos) 1.5) (none) ) - :trans - (behavior () + :trans (behavior () (pelican-path-update 131072.0 150 0.0 0.0 #f) - (set! (-> self path-pos) - (seek (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-dive (-> self path-dive1) (-> self path-to-nest1) (-> *PELICAN-bank* to-nest1-time)) ) (none) ) - :code - (behavior () + :code (behavior () (pelican-fly (the-as (function pelican int) (lambda () (rand-vu-int-range 2 4))) (the-as (function pelican int) zero-func) ) (none) ) - :post - pelican-post + :post pelican-post ) ;; failed to figure out what this is: (defstate pelican-fly-to-end (pelican) - :enter - (behavior ((arg0 path-control) (arg1 time-frame)) + :enter (behavior ((arg0 path-control) (arg1 time-frame)) (process-entity-status! self (entity-perm-status complete) #t) (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) @@ -1025,12 +819,9 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (pelican-path-update 546133.3 30 0.0 0.0 #f) - (set! (-> self path-pos) - (seek (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-wait-at-end #f) ) @@ -1047,8 +838,7 @@ ) (none) ) - :code - (behavior ((arg0 path-control) (arg1 time-frame)) + :code (behavior ((arg0 path-control) (arg1 time-frame)) (pelican-fly (the-as (function pelican int) (lambda () 1)) (lambda ((arg0 pelican)) (if (and (>= (-> arg0 path-pos) 4.0) (>= 6.0 (-> arg0 path-pos))) @@ -1059,14 +849,12 @@ ) (none) ) - :post - pelican-post + :post pelican-post ) ;; failed to figure out what this is: (defstate pelican-wait-at-end (pelican) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (cleanup-for-death self) (none) ) @@ -1074,31 +862,23 @@ ;; failed to figure out what this is: (defstate pelican-explode (pelican) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-2 user-int8 0) 5) ) (when (not arg0) - (sound-play-by-name (static-sound-name "scrate-break") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 71) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (sound-play "scrate-break") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 71) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) ) (let ((gp-2 (new-stack-vector0))) @@ -1130,8 +910,7 @@ (anim-loop) (none) ) - :post - (the-as (function none :behavior pelican) ja-post) + :post (the-as (function none :behavior pelican) ja-post) ) ;; definition for method 11 of type pelican @@ -1186,23 +965,15 @@ (go pelican-wait-at-nest #t) ) ((2) - (let* ((s4-1 (get-process *default-dead-pool* manipy #x4000)) - (s5-2 (when s4-1 - (let ((t9-15 (method-of-type manipy activate))) - (t9-15 (the-as manipy s4-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-1 - manipy-init - (-> obj root-override trans) - (-> obj entity) - *fuel-cell-sg* - (new 'static 'vector :w 4915.2) - ) - (-> s4-1 ppointer) - ) - ) - ) + (let ((s5-2 (manipy-spawn + (-> obj root-override trans) + (-> obj entity) + *fuel-cell-sg* + (new 'static 'vector :w 4915.2) + :to obj + ) + ) + ) (set! (-> obj fuel-cell) (the-as handle (if s5-2 (ppointer->handle s5-2) (the-as int #f) diff --git a/test/decompiler/reference/levels/beach/sculptor_REF.gc b/test/decompiler/reference/levels/beach/sculptor_REF.gc index 959c288884..5b0c5f59d6 100644 --- a/test/decompiler/reference/levels/beach/sculptor_REF.gc +++ b/test/decompiler/reference/levels/beach/sculptor_REF.gc @@ -1,6 +1,9 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/sculptor-muse-ag.gc") +(import "goal_src/import/sculptor-ag.gc") + ;; definition of type sculptor (deftype sculptor (process-taskable) ((muse handle :offset-assert 384) @@ -21,23 +24,17 @@ ) ;; failed to figure out what this is: -(defskelgroup *sculptor-muse-sg* sculptor-muse - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - ) +(defskelgroup *sculptor-muse-sg* sculptor-muse sculptor-muse-lod0-jg sculptor-muse-idle-ja + ((sculptor-muse-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + ) ;; failed to figure out what this is: -(defskelgroup *sculptor-sg* sculptor - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *sculptor-sg* sculptor sculptor-lod0-jg sculptor-sigh-ja + ((sculptor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow sculptor-shadow-mg + ) ;; definition for method 52 of type sculptor ;; INFO: Return type mismatch int vs none. @@ -66,14 +63,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -83,21 +80,11 @@ ;; definition for function muse-to-idle (defbehavior muse-to-idle sculptor ((arg0 muse)) - (when (not (handle->process (-> arg0 incomming-attack-id))) - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) + (if (not (handle->process (-> arg0 incomming-attack-id))) (set! (-> arg0 incomming-attack-id) - (ppointer->handle - (when s5-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy s5-0) arg0 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> arg0 collide-info trans) (-> arg0 entity) *sculptor-muse-sg* #f) - (-> s5-0 ppointer) - ) - ) + (ppointer->handle (manipy-spawn (-> arg0 collide-info trans) (-> arg0 entity) *sculptor-muse-sg* #f :to arg0)) ) ) - ) (let ((v1-11 (handle->process (-> arg0 incomming-attack-id)))) (if v1-11 (set! (-> (the-as muse v1-11) draw light-index) (the-as uint 3)) @@ -112,8 +99,7 @@ ;; failed to figure out what this is: (defstate give-cell (sculptor) :virtual #t - :enter - (behavior () + :enter (behavior () (muse-to-idle (the-as muse self)) (none) ) @@ -130,8 +116,7 @@ :name "sculptor-introduction" :index 16 :parts 14 - :command-list - '((0 display-level beach special) + :command-list '((0 display-level beach special) (0 kill "med-res-level-2") (0 kill "med-res-level-4") (0 kill "med-res-level-6") @@ -159,19 +144,9 @@ (when arg0 (set! (-> obj cell-for-task) (current-task (-> obj tasks))) (close-current! (-> obj tasks)) - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj muse) - (ppointer->handle - (when s5-1 - (let ((t9-5 (method-of-type manipy activate))) - (t9-5 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *sculptor-muse-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> obj muse) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *sculptor-muse-sg* #f :to obj)) + ) (let ((v1-18 (handle->process (-> obj muse)))) (if v1-18 (set! (-> (the-as muse v1-18) draw light-index) (the-as uint 3)) @@ -184,8 +159,7 @@ :name "sculptor-resolution" :index 18 :parts 4 - :command-list - '((51 joint "cameraB") (87 joint "camera")) + :command-list '((51 joint "cameraB") (87 joint "camera")) ) ) (else @@ -217,10 +191,7 @@ ;; definition for method 43 of type sculptor (defmethod TODO-RENAME-43 sculptor ((obj sculptor)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) (play-ambient (-> obj ambient) "SCU-LO01" #f (-> obj root-override trans)) @@ -251,241 +222,95 @@ ;; failed to figure out what this is: (defstate idle (sculptor) :virtual #t - :code - (behavior () - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) - ) - ) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim #f) num-func-seek!) + :code (behavior () + (when (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (get-art-elem self)) ) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) (case (current-status (-> self tasks)) (((task-status invalid) (task-status need-resolution)) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-from-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (muse-to-idle (the-as muse self)) ) ) - (while #t + (loop (let ((v1-43 (current-status (-> self tasks)))) (cond ((or (= v1-43 (task-status invalid)) (= v1-43 (task-status need-resolution))) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-to-small-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let* ((f30-0 4.0) (v1-68 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-69 (the-as number (logior #x3f800000 v1-68))) ) (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-69)))) 4)) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) 1.0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-small-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) 1.0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let* ((v1-97 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-98 (the-as number (logior #x3f800000 v1-97))) - (f30-1 (+ -1.0 (the-as float v1-98))) - ) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-28 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-28 param 1) 1.0) - (set! (-> a0-28 frame-num) 0.0) - (joint-control-channel-group! a0-28 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (let ((f30-1 (rand-float-gen))) + (ja-no-eval :group! sculptor-small-to-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1))) - (set! (-> a0-29 param 1) 1.0) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-31 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-31 param 1) 1.0) - (set! (-> a0-31 frame-num) 0.0) - (joint-control-channel-group! a0-31 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! sculptor-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-32 (-> self skel root-channel 0))) - (set! (-> a0-32 param 0) (the float (+ (-> a0-32 frame-group data 0 length) -1))) - (set! (-> a0-32 param 1) 1.0) - (joint-control-channel-group-eval! a0-32 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-34 (-> self skel root-channel 0))) - (set! (-> a0-34 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-34 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-34 param 1) 1.0) - (set! (-> a0-34 frame-num) 0.0) - (joint-control-channel-group! a0-34 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! sculptor-from-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 param 0) (the float (+ (-> a0-35 frame-group data 0 length) -1))) - (set! (-> a0-35 param 1) 1.0) - (joint-control-channel-group-eval! a0-35 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (when (< f30-1 0.5) - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> a0-37 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 13)) data 0 length) -1)) - ) - (set! (-> a0-37 param 1) 1.0) - (set! (-> a0-37 frame-num) 0.0) - (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-to-huge-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 param 0) (the float (+ (-> a0-38 frame-group data 0 length) -1))) - (set! (-> a0-38 param 1) 1.0) - (joint-control-channel-group-eval! a0-38 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let* ((f30-2 2.0) (v1-190 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-191 (the-as number (logior #x3f800000 v1-190))) ) (countdown (gp-2 (+ (the int (* f30-2 (+ -1.0 (the-as float v1-191)))) 2)) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> self draw art-group data 14))) - (set! (-> a0-42 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 14)) data 0 length) -1)) - ) - (set! (-> a0-42 param 1) 1.0) - (set! (-> a0-42 frame-num) 0.0) - (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> self draw art-group data 14)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-huge-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) (the float (+ (-> a0-43 frame-group data 0 length) -1))) - (set! (-> a0-43 param 1) 1.0) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let ((a0-45 (-> self skel root-channel 0))) - (set! (-> a0-45 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - (set! (-> a0-45 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 15)) data 0 length) -1)) - ) - (set! (-> a0-45 param 1) 1.0) - (set! (-> a0-45 frame-num) 0.0) - (joint-control-channel-group! a0-45 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-huge-to-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-46 (-> self skel root-channel 0))) - (set! (-> a0-46 param 0) (the float (+ (-> a0-46 frame-group data 0 length) -1))) - (set! (-> a0-46 param 1) 1.0) - (joint-control-channel-group-eval! a0-46 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-48 (-> self skel root-channel 0))) - (set! (-> a0-48 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-48 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-48 param 1) 1.0) - (set! (-> a0-48 frame-num) 0.0) - (joint-control-channel-group! a0-48 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! sculptor-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-49 (-> self skel root-channel 0))) - (set! (-> a0-49 param 0) (the float (+ (-> a0-49 frame-group data 0 length) -1))) - (set! (-> a0-49 param 1) 1.0) - (joint-control-channel-group-eval! a0-49 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-51 (-> self skel root-channel 0))) - (set! (-> a0-51 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-51 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-51 param 1) 1.0) - (set! (-> a0-51 frame-num) 0.0) - (joint-control-channel-group! a0-51 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! sculptor-from-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-52 (-> self skel root-channel 0))) - (set! (-> a0-52 param 0) (the float (+ (-> a0-52 frame-group data 0 length) -1))) - (set! (-> a0-52 param 1) 1.0) - (joint-control-channel-group-eval! a0-52 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -497,100 +322,36 @@ (v1-288 (the-as number (logior #x3f800000 v1-287))) ) (countdown (gp-3 (+ (the int (* f30-3 (+ -1.0 (the-as float v1-288)))) 4)) - (let ((a0-57 (-> self skel root-channel 0))) - (set! (-> a0-57 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-57 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-57 param 1) 1.0) - (set! (-> a0-57 frame-num) 0.0) - (joint-control-channel-group! a0-57 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-58 (-> self skel root-channel 0))) - (set! (-> a0-58 param 0) (the float (+ (-> a0-58 frame-group data 0 length) -1))) - (set! (-> a0-58 param 1) 1.0) - (joint-control-channel-group-eval! a0-58 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let* ((v1-316 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-317 (the-as number (logior #x3f800000 v1-316))) - ) - (< (+ -1.0 (the-as float v1-317)) 0.5) - ) - ) - (let ((a0-62 (-> self skel root-channel 0))) - (set! (-> a0-62 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-62 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-62 param 1) 1.0) - (set! (-> a0-62 frame-num) 0.0) - (joint-control-channel-group! a0-62 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + (< (rand-float-gen) 0.5) ) + (ja-no-eval :group! sculptor-sigh-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-63 (-> self skel root-channel 0))) - (set! (-> a0-63 param 0) (the float (+ (-> a0-63 frame-group data 0 length) -1))) - (set! (-> a0-63 param 1) 1.0) - (joint-control-channel-group-eval! a0-63 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-65 (-> self skel root-channel 0))) - (set! (-> a0-65 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-65 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-65 param 1) 1.0) - (set! (-> a0-65 frame-num) 0.0) - (joint-control-channel-group! a0-65 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! sculptor-strikestart-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-66 (-> self skel root-channel 0))) - (set! (-> a0-66 param 0) (the float (+ (-> a0-66 frame-group data 0 length) -1))) - (set! (-> a0-66 param 1) 1.0) - (joint-control-channel-group-eval! a0-66 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-68 (-> self skel root-channel 0))) - (set! (-> a0-68 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-68 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-68 param 1) 1.0) - (set! (-> a0-68 frame-num) 0.0) - (joint-control-channel-group! a0-68 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! sculptor-strikemiddle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-69 (-> self skel root-channel 0))) - (set! (-> a0-69 param 0) (the float (+ (-> a0-69 frame-group data 0 length) -1))) - (set! (-> a0-69 param 1) 1.0) - (joint-control-channel-group-eval! a0-69 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-71 (-> self skel root-channel 0))) - (set! (-> a0-71 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-71 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-71 param 1) 1.0) - (set! (-> a0-71 frame-num) 0.0) - (joint-control-channel-group! a0-71 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! sculptor-strikeend-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-72 (-> self skel root-channel 0))) - (set! (-> a0-72 param 0) (the float (+ (-> a0-72 frame-group data 0 length) -1))) - (set! (-> a0-72 param 1) 1.0) - (joint-control-channel-group-eval! a0-72 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) diff --git a/test/decompiler/reference/levels/beach/seagull_REF.gc b/test/decompiler/reference/levels/beach/seagull_REF.gc index 1ed9cf861a..3850b8ac21 100644 --- a/test/decompiler/reference/levels/beach/seagull_REF.gc +++ b/test/decompiler/reference/levels/beach/seagull_REF.gc @@ -1,18 +1,18 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/seagull-ag.gc") + ;; failed to figure out what this is: (defpartgroup group-seagull-takeoff :id 160 :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 663 :fade-after (meters 20))) + :parts ((sp-item 663 :fade-after (meters 20))) ) ;; failed to figure out what this is: (defpart 665 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -27,10 +27,7 @@ ) ;; definition for symbol sound-seagull-squall, type sound-spec -(define - sound-seagull-squall - (new 'static 'sound-spec :num 1.0 :group #x1 :sound-name (static-sound-name "seagulls-2") :volume #x400) - ) +(define sound-seagull-squall (static-sound-spec "seagulls-2")) ;; definition of type seagull (deftype seagull (process-drawable) @@ -175,8 +172,7 @@ ) ;; definition for symbol *seagull-boxes*, type (inline-array air-box) -(define - *seagull-boxes* +(define *seagull-boxes* (new 'static 'inline-array air-box 10 (new 'static 'air-box :vecs (new 'static 'inline-array vector 2 (new 'static 'vector :x -1146880.0 :y 143360.0 :z -1638400.0 :w -0.6427) @@ -232,13 +228,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *seagull-sg* seagull - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *seagull-sg* seagull seagull-lod0-jg seagull-idle-ja + ((seagull-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) ;; definition for method 25 of type seagull ;; INFO: Return type mismatch int vs none. @@ -385,8 +378,7 @@ ;; failed to figure out what this is: (defstate seagull-idle (seagull) - :enter - (behavior () + :enter (behavior () (let* ((v1-0 (-> self flock)) (f30-0 (dummy-16 (if v1-0 @@ -397,17 +389,14 @@ ) (f28-0 21845.334) (f26-0 -0.5) - (v1-5 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-6 (the-as number (logior #x3f800000 v1-5))) ) (set! (-> self heading) - (the float (sar (shl (the int (+ f30-0 (* f28-0 (+ f26-0 (+ -1.0 (the-as float v1-6)))))) 48) 48)) + (the float (sar (shl (the int (+ f30-0 (* f28-0 (+ f26-0 (rand-float-gen))))) 48) 48)) ) ) (none) ) - :trans - (behavior () + :trans (behavior () (when (nonzero? (-> self scared)) (+! (-> self scared) -1) (when (zero? (-> self scared)) @@ -431,21 +420,13 @@ ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self root-override trans y) (+ 20480.0 (-> self root-override trans y))) (move-to-ground (-> self root-override) 40960.0 40960.0 #t (collide-kind background)) (update-transforms! (-> self root-override)) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) (ja-aframe 0.0 0)) - ) - (while #t + (ja :group! seagull-idle-ja :num! (identity (ja-aframe 0.0 0))) + (loop (let* ((f30-0 4.0) (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-15 (the-as number (logior #x3f800000 v1-14))) @@ -462,20 +443,10 @@ ) (cond ((zero? gp-1) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-2 param 0) (ja-aframe 4.0 0)) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) (ja-aframe 0.0 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! seagull-idle-ja :num! (seek! (ja-aframe 4.0 0)) :frame-num (ja-aframe 0.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 4.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 4.0 0))) ) (let* ((f30-2 60.0) (v1-37 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -486,20 +457,10 @@ (suspend) ) ) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-5 param 0) (ja-aframe 10.0 0)) - (set! (-> gp-5 param 1) 1.0) - (set! (-> gp-5 frame-num) (ja-aframe 4.0 0)) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! seagull-idle-ja :num! (seek! (ja-aframe 10.0 0)) :frame-num (ja-aframe 4.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 param 0) (ja-aframe 10.0 0)) - (set! (-> gp-6 param 1) 1.0) - (joint-control-channel-group-eval! gp-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 10.0 0))) ) (let* ((f30-3 60.0) (v1-55 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -510,71 +471,31 @@ (suspend) ) ) - (let ((gp-8 (-> self skel root-channel 0))) - (set! (-> gp-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-8 param 0) (ja-aframe 14.0 0)) - (set! (-> gp-8 param 1) 1.0) - (set! (-> gp-8 frame-num) (ja-aframe 10.0 0)) - (joint-control-channel-group! gp-8 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! seagull-idle-ja :num! (seek! (ja-aframe 14.0 0)) :frame-num (ja-aframe 10.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-9 (-> self skel root-channel 0))) - (set! (-> gp-9 param 0) (ja-aframe 14.0 0)) - (set! (-> gp-9 param 1) 1.0) - (joint-control-channel-group-eval! gp-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 14.0 0))) ) ) ((= gp-1 2) - (let ((gp-10 (-> self skel root-channel 0))) - (set! (-> gp-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-10 param 0) (ja-aframe 4.0 0)) - (set! (-> gp-10 param 1) 1.0) - (set! (-> gp-10 frame-num) (ja-aframe 0.0 0)) - (joint-control-channel-group! gp-10 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! seagull-peck-ja :num! (seek! (ja-aframe 4.0 0)) :frame-num (ja-aframe 0.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-11 (-> self skel root-channel 0))) - (set! (-> gp-11 param 0) (ja-aframe 4.0 0)) - (set! (-> gp-11 param 1) 1.0) - (joint-control-channel-group-eval! gp-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 4.0 0))) ) ) ((= gp-1 3) - (let ((gp-12 (-> self skel root-channel 0))) - (set! (-> gp-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-12 param 0) (ja-aframe 8.0 0)) - (set! (-> gp-12 param 1) 1.0) - (set! (-> gp-12 frame-num) (ja-aframe 4.0 0)) - (joint-control-channel-group! gp-12 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! seagull-peck-ja :num! (seek! (ja-aframe 8.0 0)) :frame-num (ja-aframe 4.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-13 (-> self skel root-channel 0))) - (set! (-> gp-13 param 0) (ja-aframe 8.0 0)) - (set! (-> gp-13 param 1) 1.0) - (joint-control-channel-group-eval! gp-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 8.0 0))) ) ) ((= gp-1 4) - (let ((gp-14 (-> self skel root-channel 0))) - (set! (-> gp-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-14 param 0) (ja-aframe 12.0 0)) - (set! (-> gp-14 param 1) 1.0) - (set! (-> gp-14 frame-num) (ja-aframe 8.0 0)) - (joint-control-channel-group! gp-14 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! seagull-peck-ja :num! (seek! (ja-aframe 12.0 0)) :frame-num (ja-aframe 8.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-15 (-> self skel root-channel 0))) - (set! (-> gp-15 param 0) (ja-aframe 12.0 0)) - (set! (-> gp-15 param 1) 1.0) - (joint-control-channel-group-eval! gp-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 12.0 0))) ) ) ) @@ -582,8 +503,7 @@ ) (none) ) - :post - seagull-post + :post seagull-post ) ;; definition for method 20 of type seagull @@ -611,26 +531,20 @@ ;; definition for method 26 of type seagull (defmethod dummy-26 seagull ((obj seagull)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (let* ((f30-0 -4096.0) - (f28-0 8192.0) - (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (set! (-> s5-0 x) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-2))) (-> obj flock 0 target x))) + (let ((f30-0 -4096.0) + (f28-0 8192.0) + ) + (set! (-> s5-0 x) (+ f30-0 (* f28-0 (rand-float-gen)) (-> obj flock 0 target x))) ) - (let* ((f30-1 -4096.0) - (f28-1 8192.0) - (v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-8 (the-as number (logior #x3f800000 v1-7))) - ) - (set! (-> s5-0 y) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-8))) (-> obj flock 0 target y))) + (let ((f30-1 -4096.0) + (f28-1 8192.0) + ) + (set! (-> s5-0 y) (+ f30-1 (* f28-1 (rand-float-gen)) (-> obj flock 0 target y))) ) - (let* ((f30-2 -4096.0) - (f28-2 8192.0) - (v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-14 (the-as number (logior #x3f800000 v1-13))) - ) - (set! (-> s5-0 z) (+ f30-2 (* f28-2 (+ -1.0 (the-as float v1-14))) (-> obj flock 0 target z))) + (let ((f30-2 -4096.0) + (f28-2 8192.0) + ) + (set! (-> s5-0 z) (+ f30-2 (* f28-2 (rand-float-gen)) (-> obj flock 0 target z))) ) (vector-! s5-0 s5-0 (-> obj root-override trans)) (vector-float*! s5-0 s5-0 0.9) @@ -709,24 +623,16 @@ ;; failed to figure out what this is: (defstate seagull-takeoff (seagull) - :trans - (behavior () + :trans (behavior () (when (< (+ (-> *display* base-frame-counter) (seconds -2)) (-> self part-time)) (-> self part) (-> self root-override root-prim prim-core) ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self part-time) (-> *display* base-frame-counter)) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> gp-0 param 0) (ja-aframe 4.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 1.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! seagull-takeoff-ja :num! (seek! (ja-aframe 4.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (when (and (>= (ja-frame-num 0) (ja-aframe 2.0 0)) (>= (ja-aframe 3.0 0) (ja-frame-num 0))) (let* ((v1-13 self) @@ -760,49 +666,30 @@ ) (dummy-27 self) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe 4.0 0)) - (set! (-> gp-2 param 1) 1.0) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 4.0 0))) ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 20) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.067)) (go seagull-flying) (none) ) - :post - seagull-post + :post seagull-post ) ;; failed to figure out what this is: (defstate seagull-flying (seagull) - :trans - (behavior () + :trans (behavior () (when (< (+ (-> *display* base-frame-counter) (seconds -2)) (-> self part-time)) (-> self part) (-> self root-override root-prim prim-core) ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self max-tilt) 1820.4445) (let ((gp-0 0)) - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (loop + (ja-no-eval :group! seagull-fly-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (when (-> self teleport) @@ -955,11 +842,7 @@ 0 (dummy-27 self) (suspend) - (let ((a0-64 (-> self skel root-channel 0))) - (set! (-> a0-64 param 0) (the float (+ (-> a0-64 frame-group data 0 length) -1))) - (set! (-> a0-64 param 1) 1.0) - (joint-control-channel-group-eval! a0-64 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (+! gp-0 1) (when (>= gp-0 0) @@ -983,34 +866,23 @@ ) (none) ) - :post - seagull-post + :post seagull-post ) ;; failed to figure out what this is: (defstate seagull-soaring (seagull) - :trans - (behavior () + :trans (behavior () (when (< (+ (-> *display* base-frame-counter) (seconds -2)) (-> self part-time)) (-> self part) (-> self root-override root-prim prim-core) ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self max-tilt) 4551.1113) - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (loop + (ja-no-eval :group! seagull-slowfly-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (when (-> self teleport) @@ -1151,23 +1023,17 @@ ) ) (suspend) - (let ((a0-54 (-> self skel root-channel 0))) - (set! (-> a0-54 param 0) (the float (+ (-> a0-54 frame-group data 0 length) -1))) - (set! (-> a0-54 param 1) 1.0) - (joint-control-channel-group-eval! a0-54 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - seagull-post + :post seagull-post ) ;; failed to figure out what this is: (defstate seagull-landing (seagull) - :code - (behavior ((arg0 float)) + :code (behavior ((arg0 float)) (let ((s5-0 (new 'stack 'collide-tri-result))) 0.0 (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -1181,7 +1047,7 @@ (collide-kind background) self s5-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -1231,27 +1097,12 @@ ) 0 ) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 40) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-1 frame-num) (ja-aframe 0.0 0)) - ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.135)) + (ja :group! seagull-land-ja :num! (identity (ja-aframe 0.0 0))) (while (< 0.0 f30-0) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1))) - (set! (-> a0-29 param 1) 1.0) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! f30-0 (- f30-0 (-> *display* seconds-per-frame))) (fill-cache-integrate-and-collide! (-> self root-override) @@ -1295,11 +1146,7 @@ ) (while (not (ja-done? 0)) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) (the float (+ (-> a0-43 frame-group data 0 length) -1))) - (set! (-> a0-43 param 1) 1.0) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (let* ((v1-59 self) (f1-23 (the float (sar (shl (the int (- (-> self heading) (-> v1-59 heading))) 48) 48))) (f0-47 (- (-> v1-59 tilt))) @@ -1335,12 +1182,11 @@ (go seagull-idle) (none) ) - :post - seagull-post + :post seagull-post ) ;; definition for function seagull-reaction -;; INFO: Return type mismatch int vs uint. +;; INFO: Return type mismatch int vs cshape-moving-flags. (defun seagull-reaction ((arg0 collide-shape-moving) (arg1 collide-shape-intersect) (arg2 vector) (arg3 vector)) (let ((s5-0 0)) (let ((a1-1 (new 'stack-no-clear 'vector))) @@ -1361,8 +1207,8 @@ (set! (-> (the-as seagull s4-1) temp-heading-time) 300) ) (let ((v0-2 (logior s5-0 3))) - (set! (-> arg0 status) (the-as uint v0-2)) - (the-as uint v0-2) + (set! (-> arg0 status) (the-as cshape-moving-flags v0-2)) + (the-as cshape-moving-flags v0-2) ) ) ) @@ -1396,12 +1242,10 @@ (set! (-> self flock) (the-as (pointer seagullflock) (process->ppointer arg2))) (set! (-> self heading) 0.0) (set! (-> self tilt) 0.0) - (let* ((f30-0 51200.0) - (f28-0 20480.0) - (v1-23 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-24 (the-as number (logior #x3f800000 v1-23))) - ) - (set! (-> self thrust) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-24))))) + (let ((f30-0 51200.0) + (f28-0 20480.0) + ) + (set! (-> self thrust) (+ f30-0 (* f28-0 (rand-float-gen)))) ) (set! (-> self teleport) #f) (go seagull-idle) @@ -1485,7 +1329,7 @@ (if (>= (-> obj targetnum) 4) (set! (-> obj teleport-frames) 1500) ) - (sound-play-by-name (static-sound-name "seagull-takeoff") (new-sound-id) 1024 0 0 1 #t) + (sound-play "seagull-takeoff") (set! (-> obj alert-time) (-> *display* base-frame-counter)) ) (none) @@ -1502,8 +1346,7 @@ ;; failed to figure out what this is: (defstate seagullflock-at-waterfall (seagullflock) - :code - (behavior () + :code (behavior () (local-vars (a0-2 process) (a1-0 event-message-block) @@ -1562,9 +1405,8 @@ ;; failed to figure out what this is: (defstate seagullflock-idle (seagullflock) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (> (-> self teleport-frames) 0) (go seagullflock-at-waterfall) ) @@ -1629,16 +1471,7 @@ (if (= (-> obj birds) 64) (return (the-as (pointer process) #f)) ) - (let* ((s4-0 (get-process *default-dead-pool* seagull #x4000)) - (v0-0 (when s4-0 - (let ((t9-1 (method-of-type seagull activate))) - (t9-1 (the-as seagull s4-0) obj 'seagull (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 seagull-init-by-other arg0 (-> obj birds) obj) - (-> s4-0 ppointer) - ) - ) - ) + (let ((v0-0 (process-spawn seagull arg0 (-> obj birds) obj :to obj))) (set! (-> obj bird (-> obj birds)) (the-as (pointer seagull) v0-0)) (+! (-> obj birds) 1) v0-0 diff --git a/test/decompiler/reference/levels/citadel/assistant-citadel_REF.gc b/test/decompiler/reference/levels/citadel/assistant-citadel_REF.gc index 1829cecfe2..071c464428 100644 --- a/test/decompiler/reference/levels/citadel/assistant-citadel_REF.gc +++ b/test/decompiler/reference/levels/citadel/assistant-citadel_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/assistant-lavatube-end-ag.gc") + ;; definition of type assistant-lavatube-end (deftype assistant-lavatube-end (process-taskable) () @@ -19,14 +21,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *assistant-lavatube-end-sg* assistant-lavatube-end - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *assistant-lavatube-end-sg* assistant-lavatube-end assistant-lavatube-end-lod0-jg assistant-lavatube-end-idle-ja + ((assistant-lavatube-end-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow assistant-lavatube-end-shadow-mg + ) ;; definition for method 32 of type assistant-lavatube-end (defmethod play-anim! assistant-lavatube-end ((obj assistant-lavatube-end) (arg0 symbol)) @@ -42,8 +41,7 @@ :name "assistant-lavatube-end-resolution" :index 4 :parts 11 - :command-list - '((61 joint "cameraB") + :command-list '((61 joint "cameraB") (151 joint "camera") (226 joint "cameraB") (273 joint "camera") @@ -81,8 +79,7 @@ ;; failed to figure out what this is: (defstate hidden (assistant-lavatube-end) :virtual #t - :trans - (behavior () + :trans (behavior () (dummy-33 self) ((-> (method-of-type process-taskable hidden) trans)) (when (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) @@ -96,8 +93,7 @@ ;; failed to figure out what this is: (defstate idle (assistant-lavatube-end) :virtual #t - :enter - (behavior () + :enter (behavior () ((-> (method-of-type process-taskable idle) enter)) (case (get-task-status (game-task village4-button)) (((task-status need-reward-speech)) @@ -106,52 +102,16 @@ ) (none) ) - :code - (behavior () - (while #t - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - ) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-10 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! - a0-10 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + :code (behavior () + (loop + (when (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 3)) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) diff --git a/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc b/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc index 27a2c609e6..26941b813c 100644 --- a/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc +++ b/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc @@ -1,6 +1,18 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/citb-generator-ag.gc") +(import "goal_src/import/citb-launcher-ag.gc") +(import "goal_src/import/citb-button-ag.gc") +(import "goal_src/import/citadelcam-ag.gc") +(import "goal_src/import/citb-hose-ag.gc") +(import "goal_src/import/citb-robotboss-ag.gc") +(import "goal_src/import/citb-coil-ag.gc") +(import "goal_src/import/citb-arm-shoulder-ag.gc") +(import "goal_src/import/citb-iris-door-ag.gc") +(import "goal_src/import/citb-disc-ag.gc") +(import "goal_src/import/citb-arm-ag.gc") + ;; definition of type citb-arm-section (deftype citb-arm-section (process-drawable) ((sync sync-info :inline :offset-assert 176) @@ -34,68 +46,55 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-arm-a-sg* citb-arm - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 14) - :longest-edge (meters 9) - ) +(defskelgroup *citb-arm-a-sg* citb-arm citb-arm-a-lod0-jg citb-arm-a-idle-ja + ((citb-arm-a-lod0-mg (meters 20)) (citb-arm-a-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 14) + :longest-edge (meters 9) + ) ;; failed to figure out what this is: -(defskelgroup *citb-arm-b-sg* citb-arm - 4 - 7 - ((5 (meters 20)) (6 (meters 999999))) - :bounds (static-spherem 0 0 0 20) - :longest-edge (meters 10) - ) +(defskelgroup *citb-arm-b-sg* citb-arm citb-arm-b-lod0-jg citb-arm-b-idle-ja + ((citb-arm-b-lod0-mg (meters 20)) (citb-arm-b-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + :longest-edge (meters 10) + ) ;; failed to figure out what this is: -(defskelgroup *citb-arm-c-sg* citb-arm - 8 - 11 - ((9 (meters 20)) (10 (meters 999999))) - :bounds (static-spherem 0 0 0 25) - :longest-edge (meters 11) - ) +(defskelgroup *citb-arm-c-sg* citb-arm citb-arm-c-lod0-jg citb-arm-c-idle-ja + ((citb-arm-c-lod0-mg (meters 20)) (citb-arm-c-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + :longest-edge (meters 11) + ) ;; failed to figure out what this is: -(defskelgroup *citb-arm-d-sg* citb-arm - 12 - 15 - ((13 (meters 20)) (14 (meters 999999))) - :bounds (static-spherem 0 0 0 29) - :longest-edge (meters 8) - ) +(defskelgroup *citb-arm-d-sg* citb-arm citb-arm-d-lod0-jg citb-arm-d-idle-ja + ((citb-arm-d-lod0-mg (meters 20)) (citb-arm-d-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 29) + :longest-edge (meters 8) + ) ;; failed to figure out what this is: -(defskelgroup *citb-arm-shoulder-a-sg* citb-arm-shoulder - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 22) - :longest-edge (meters 10) - ) +(defskelgroup *citb-arm-shoulder-a-sg* citb-arm-shoulder citb-arm-shoulder-a-lod0-jg citb-arm-shoulder-a-idle-ja + ((citb-arm-shoulder-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 22) + :longest-edge (meters 10) + ) ;; failed to figure out what this is: -(defskelgroup *citb-arm-shoulder-b-sg* citb-arm-shoulder - 3 - 5 - ((4 (meters 999999))) - :bounds (static-spherem 0 0 0 22) - :longest-edge (meters 10) - ) +(defskelgroup *citb-arm-shoulder-b-sg* citb-arm-shoulder citb-arm-shoulder-b-lod0-jg citb-arm-shoulder-b-idle-ja + ((citb-arm-shoulder-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 22) + :longest-edge (meters 10) + ) ;; failed to figure out what this is: (defstate idle (citb-arm-section) :virtual #t - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (while #t + (loop (cond ((< (- (-> (target-pos 0) y) (-> self root trans y)) -122880.0) (set! (-> self draw force-lod) 1) @@ -122,8 +121,7 @@ ) (none) ) - :post - (the-as (function none :behavior citb-arm-section) ja-post) + :post (the-as (function none :behavior citb-arm-section) ja-post) ) ;; definition for method 20 of type citb-arm-section @@ -188,10 +186,8 @@ ;; failed to figure out what this is: (defstate idle (citb-arm) :virtual #t - :trans - (the-as (function none :behavior citb-arm) rider-trans) - :post - (behavior () + :trans (the-as (function none :behavior citb-arm) rider-trans) + :post (behavior () (if (logtest? (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self root-override)) (restore-collide-with-as (-> self root-override)) @@ -428,40 +424,32 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-disc-a-sg* citb-disc - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 12) - :longest-edge (meters 7.5) - ) +(defskelgroup *citb-disc-a-sg* citb-disc citb-disc-a-lod0-jg citb-disc-a-idle-ja + ((citb-disc-a-lod0-mg (meters 20)) (citb-disc-a-lod1-mg (meters 40)) (citb-disc-a-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + :longest-edge (meters 7.5) + ) ;; failed to figure out what this is: -(defskelgroup *citb-disc-b-sg* citb-disc - 5 - 9 - ((6 (meters 20)) (7 (meters 40)) (8 (meters 999999))) - :bounds (static-spherem 0 0 0 12) - :longest-edge (meters 7.5) - ) +(defskelgroup *citb-disc-b-sg* citb-disc citb-disc-b-lod0-jg citb-disc-b-idle-ja + ((citb-disc-b-lod0-mg (meters 20)) (citb-disc-b-lod1-mg (meters 40)) (citb-disc-b-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + :longest-edge (meters 7.5) + ) ;; failed to figure out what this is: -(defskelgroup *citb-disc-c-sg* citb-disc - 10 - 14 - ((11 (meters 20)) (12 (meters 40)) (13 (meters 999999))) - :bounds (static-spherem 0 0 0 12) - :longest-edge (meters 11) - ) +(defskelgroup *citb-disc-c-sg* citb-disc citb-disc-c-lod0-jg citb-disc-c-idle-ja + ((citb-disc-c-lod0-mg (meters 20)) (citb-disc-c-lod1-mg (meters 40)) (citb-disc-c-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + :longest-edge (meters 11) + ) ;; failed to figure out what this is: -(defskelgroup *citb-disc-d-sg* citb-disc - 15 - 19 - ((16 (meters 20)) (17 (meters 40)) (18 (meters 999999))) - :bounds (static-spherem 0 0 0 12) - :longest-edge (meters 8) - ) +(defskelgroup *citb-disc-d-sg* citb-disc citb-disc-d-lod0-jg citb-disc-d-idle-ja + ((citb-disc-d-lod0-mg (meters 20)) (citb-disc-d-lod1-mg (meters 40)) (citb-disc-d-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + :longest-edge (meters 8) + ) ;; definition of type citb-disc (deftype citb-disc (process-drawable) @@ -494,21 +482,18 @@ ;; failed to figure out what this is: (defstate citb-disc-idle (citb-disc) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'touch) - (send-event arg0 'no-look-around 75) + (send-event arg0 'no-look-around (seconds 0.25)) #f ) ) ) ) - :trans - (the-as (function none :behavior citb-disc) rider-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior citb-disc) rider-trans) + :code (behavior () + (loop (update! (-> self sound)) (quaternion-axis-angle! (-> self root-override quat) @@ -521,8 +506,7 @@ ) (none) ) - :post - (the-as (function none :behavior citb-disc) rider-post) + :post (the-as (function none :behavior citb-disc) rider-post) ) ;; definition for method 20 of type citb-disc @@ -578,19 +562,8 @@ ) ) (dummy-21 obj) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "rotate-plat") - :volume #x400 - :fo-max 20 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> obj root-override trans)) ) (logior! (-> obj skel status) (janim-status inited)) (go citb-disc-idle) @@ -715,13 +688,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-iris-door-sg* citb-iris-door - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *citb-iris-door-sg* citb-iris-door citb-iris-door-lod0-jg citb-iris-door-idle-ja + ((citb-iris-door-lod0-mg (meters 20)) (citb-iris-door-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; definition for method 24 of type citb-iris-door ;; INFO: Return type mismatch int vs none. @@ -758,13 +728,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-button-sg* citb-button - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *citb-button-sg* citb-button citb-button-lod0-jg citb-button-idle-ja + ((citb-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; definition of type citb-button (deftype citb-button (basebutton) @@ -866,8 +833,7 @@ ;; failed to figure out what this is: (defstate plat-path-active (citb-launcher) :virtual #t - :post - (behavior () + :post (behavior () (let ((t9-0 (-> (method-of-type plat plat-path-active) post))) (if t9-0 ((the-as (function none :behavior citb-launcher) t9-0)) @@ -879,13 +845,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-launcher-sg* citb-launcher - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *citb-launcher-sg* citb-launcher citb-launcher-lod0-jg citb-launcher-idle-ja + ((citb-launcher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; definition for method 23 of type citb-launcher (defmethod get-unlit-skel citb-launcher ((obj citb-launcher)) @@ -897,20 +860,8 @@ (defmethod dummy-26 citb-launcher ((obj citb-launcher)) (let ((f30-0 (res-lump-float (-> obj entity) 'spring-height :default 163840.0)) (s5-0 (res-lump-value (-> obj entity) 'mode uint128)) - (s4-0 (get-process *default-dead-pool* launcher #x4000)) ) - (set! (-> obj launcher) - (the-as - (pointer launcher) - (when s4-0 - (let ((t9-3 (method-of-type launcher activate))) - (t9-3 (the-as launcher s4-0) obj 'launcher (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 launcher-init-by-other (-> obj root-override trans) f30-0 s5-0 81920.0) - (-> s4-0 ppointer) - ) - ) - ) + (set! (-> obj launcher) (process-spawn launcher (-> obj root-override trans) f30-0 s5-0 81920.0 :to obj)) ) (set! (-> obj root-override root-prim local-sphere w) 18432.0) (logclear! (-> obj mask) (process-mask actor-pause)) @@ -919,85 +870,66 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-robotboss-sg* citb-robotboss - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 17 0 18) - :longest-edge (meters 6) - ) +(defskelgroup *citb-robotboss-sg* citb-robotboss citb-robotboss-lod0-jg citb-robotboss-idle-ja + ((citb-robotboss-lod0-mg (meters 999999))) + :bounds (static-spherem 0 17 0 18) + :longest-edge (meters 6) + ) ;; failed to figure out what this is: -(defskelgroup *citb-robotboss-head-sg* citb-robotboss - 6 - 8 - ((7 (meters 999999))) - :bounds (static-spherem 0 30 10 12) - :longest-edge (meters 2) - ) +(defskelgroup *citb-robotboss-head-sg* citb-robotboss citb-robotboss-head-lod0-jg citb-robotboss-head-idle-ja + ((citb-robotboss-head-lod0-mg (meters 999999))) + :bounds (static-spherem 0 30 10 12) + :longest-edge (meters 2) + ) ;; failed to figure out what this is: -(defskelgroup *citb-robotboss-nose-sg* citb-robotboss - 3 - 5 - ((4 (meters 999999))) - :bounds (static-spherem 0 10 20 15) - :longest-edge (meters 0) - ) +(defskelgroup *citb-robotboss-nose-sg* citb-robotboss citb-robotboss-nose-lod0-jg citb-robotboss-nose-idle-ja + ((citb-robotboss-nose-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 20 15) + ) ;; failed to figure out what this is: -(defskelgroup *citb-robotboss-gun-sg* citb-robotboss - 9 - 11 - ((10 (meters 999999))) - :bounds (static-spherem 0 28 -10 14) - :longest-edge (meters 5) - ) +(defskelgroup *citb-robotboss-gun-sg* citb-robotboss citb-robotboss-gun-lod0-jg citb-robotboss-gun-idle-ja + ((citb-robotboss-gun-lod0-mg (meters 999999))) + :bounds (static-spherem 0 28 -10 14) + :longest-edge (meters 5) + ) ;; failed to figure out what this is: -(defskelgroup *citb-robotboss-leftshoulder-sg* citb-robotboss - 12 - 14 - ((13 (meters 999999))) - :bounds (static-spherem 17 27 0 14) - :longest-edge (meters 6) - ) +(defskelgroup *citb-robotboss-leftshoulder-sg* citb-robotboss citb-robotboss-leftshoulder-lod0-jg citb-robotboss-leftshoulder-idle-ja + ((citb-robotboss-leftshoulder-lod0-mg (meters 999999))) + :bounds (static-spherem 17 27 0 14) + :longest-edge (meters 6) + ) ;; failed to figure out what this is: -(defskelgroup *citb-robotboss-rightshoulder-sg* citb-robotboss - 15 - 17 - ((16 (meters 999999))) - :bounds (static-spherem -17 27 0 14) - :longest-edge (meters 6) - ) +(defskelgroup *citb-robotboss-rightshoulder-sg* citb-robotboss citb-robotboss-rightshoulder-lod0-jg citb-robotboss-rightshoulder-idle-ja + ((citb-robotboss-rightshoulder-lod0-mg (meters 999999))) + :bounds (static-spherem -17 27 0 14) + :longest-edge (meters 6) + ) ;; failed to figure out what this is: -(defskelgroup *citb-robotboss-leftarm-sg* citb-robotboss - 18 - 20 - ((19 (meters 999999))) - :bounds (static-spherem 15 5 -10 20) - :longest-edge (meters 9) - ) +(defskelgroup *citb-robotboss-leftarm-sg* citb-robotboss citb-robotboss-leftarm-lod0-jg citb-robotboss-leftarm-idle-ja + ((citb-robotboss-leftarm-lod0-mg (meters 999999))) + :bounds (static-spherem 15 5 -10 20) + :longest-edge (meters 9) + ) ;; failed to figure out what this is: -(defskelgroup *citb-robotboss-rightarm-sg* citb-robotboss - 21 - 23 - ((22 (meters 999999))) - :bounds (static-spherem -15 0 -8 16) - :longest-edge (meters 3) - ) +(defskelgroup *citb-robotboss-rightarm-sg* citb-robotboss citb-robotboss-rightarm-lod0-jg citb-robotboss-rightarm-idle-ja + ((citb-robotboss-rightarm-lod0-mg (meters 999999))) + :bounds (static-spherem -15 0 -8 16) + :longest-edge (meters 3) + ) ;; failed to figure out what this is: -(defskelgroup *citb-robotboss-belly-sg* citb-robotboss - 24 - 26 - ((25 (meters 999999))) - :bounds (static-spherem 0 -2 3 10) - :longest-edge (meters 3) - ) +(defskelgroup *citb-robotboss-belly-sg* citb-robotboss citb-robotboss-belly-lod0-jg citb-robotboss-belly-idle-ja + ((citb-robotboss-belly-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -2 3 10) + :longest-edge (meters 3) + ) ;; definition of type citb-robotboss (deftype citb-robotboss (process-drawable) @@ -1025,229 +957,103 @@ ;; failed to figure out what this is: (defstate citb-robotboss-idle (citb-robotboss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (sv-96 int) (sv-112 int)) - (the-as object (cond - ((= arg2 'shield-off) - (stop! (-> self sound)) - (if (-> self shield-on) - (sound-play-by-name (static-sound-name "robotcage-off") (new-sound-id) 1024 0 0 1 #t) - ) - (set! (-> self shield-on) #f) - #f - ) - ((= arg2 'shield-on) - (let ((v0-3 #t)) - (set! (-> self shield-on) v0-3) - v0-3 - ) - ) - ((= arg2 'die) - (cleanup-for-death self) - (the-as symbol (deactivate self)) - ) - ((or (= arg2 'touch) (= arg2 'attack)) - (let ((s4-0 sound-play-by-name) - (s3-0 (make-u128 #x7061 (the-as uint #x7a2d646c65696873))) - (s2-0 (new-sound-id)) - (s1-0 1024) - (s0-0 0) - ) - (set! sv-96 0) - (set! sv-112 1) - (let ((t2-1 (target-pos 0))) - (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-96 sv-112 (the-as symbol t2-1)) - ) - ) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'shove) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((v1-21 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-21 shove-up) 8192.0) - (set! (-> v1-21 shove-back) 12288.0) - (set! (-> a1-3 param 1) (the-as uint v1-21)) - ) - (the-as symbol (send-event-function arg0 a1-3)) - ) - ) - ) - ) - ) - :code - (behavior () - (let* ((s5-0 (get-process *default-dead-pool* manipy #x4000)) - (gp-0 (when s5-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-nose-sg* - #f - ) - (-> s5-0 ppointer) - ) - ) + (the-as + object + (cond + ((= arg2 'shield-off) + (stop! (-> self sound)) + (if (-> self shield-on) + (sound-play "robotcage-off") + ) + (set! (-> self shield-on) #f) + #f + ) + ((= arg2 'shield-on) + (let ((v0-3 #t)) + (set! (-> self shield-on) v0-3) + v0-3 ) + ) + ((= arg2 'die) + (cleanup-for-death self) + (the-as symbol (deactivate self)) + ) + ((or (= arg2 'touch) (= arg2 'attack)) + (let ((s4-0 sound-play-by-name) + (s3-0 (make-u128 #x7061 (the-as uint #x7a2d646c65696873))) + (s2-0 (new-sound-id)) + (s1-0 1024) + (s0-0 0) + ) + (set! sv-96 0) + (set! sv-112 1) + (let ((t2-1 (target-pos 0))) + (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-96 (the-as sound-group sv-112) (the-as symbol t2-1)) + ) + ) + (the-as symbol (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) + ) + ) + ) + ) + ) + ) + :code (behavior () + (let ((gp-0 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-nose-sg* #f :to self))) (send-event (ppointer->process gp-0) 'anim-mode 'loop) (send-event (ppointer->process gp-0) 'art-joint-anim "citb-robotboss-nose-idle" 0) (send-event (ppointer->process gp-0) 'draw #t) ) - (let* ((s5-1 (get-process *default-dead-pool* manipy #x4000)) - (gp-1 (when s5-1 - (let ((t9-7 (method-of-type manipy activate))) - (t9-7 (the-as manipy s5-1) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-head-sg* - #f - ) - (-> s5-1 ppointer) - ) - ) - ) + (let ((gp-1 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-head-sg* #f :to self))) (send-event (ppointer->process gp-1) 'anim-mode 'loop) (send-event (ppointer->process gp-1) 'art-joint-anim "citb-robotboss-head-idle" 0) (send-event (ppointer->process gp-1) 'draw #t) ) - (let* ((s5-2 (get-process *default-dead-pool* manipy #x4000)) - (gp-2 (when s5-2 - (let ((t9-13 (method-of-type manipy activate))) - (t9-13 (the-as manipy s5-2) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-2 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-gun-sg* - #f - ) - (-> s5-2 ppointer) - ) - ) - ) + (let ((gp-2 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-gun-sg* #f :to self))) (send-event (ppointer->process gp-2) 'anim-mode 'loop) (send-event (ppointer->process gp-2) 'art-joint-anim "citb-robotboss-gun-idle" 0) (send-event (ppointer->process gp-2) 'draw #t) ) - (let* ((s5-3 (get-process *default-dead-pool* manipy #x4000)) - (gp-3 (when s5-3 - (let ((t9-19 (method-of-type manipy activate))) - (t9-19 (the-as manipy s5-3) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-3 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-leftshoulder-sg* - #f - ) - (-> s5-3 ppointer) - ) - ) - ) + (let ((gp-3 + (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-leftshoulder-sg* #f :to self) + ) + ) (send-event (ppointer->process gp-3) 'anim-mode 'loop) (send-event (ppointer->process gp-3) 'art-joint-anim "citb-robotboss-leftshoulder-idle" 0) (send-event (ppointer->process gp-3) 'draw #t) ) - (let* ((s5-4 (get-process *default-dead-pool* manipy #x4000)) - (gp-4 (when s5-4 - (let ((t9-25 (method-of-type manipy activate))) - (t9-25 (the-as manipy s5-4) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-4 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-rightshoulder-sg* - #f - ) - (-> s5-4 ppointer) - ) - ) - ) + (let ((gp-4 + (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-rightshoulder-sg* #f :to self) + ) + ) (send-event (ppointer->process gp-4) 'anim-mode 'loop) (send-event (ppointer->process gp-4) 'art-joint-anim "citb-robotboss-rightshoulder-idle" 0) (send-event (ppointer->process gp-4) 'draw #t) ) - (let* ((s5-5 (get-process *default-dead-pool* manipy #x4000)) - (gp-5 (when s5-5 - (let ((t9-31 (method-of-type manipy activate))) - (t9-31 (the-as manipy s5-5) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-5 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-leftarm-sg* - #f - ) - (-> s5-5 ppointer) - ) - ) - ) + (let ((gp-5 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-leftarm-sg* #f :to self))) (send-event (ppointer->process gp-5) 'anim-mode 'loop) (send-event (ppointer->process gp-5) 'art-joint-anim "citb-robotboss-leftarm-idle" 0) (send-event (ppointer->process gp-5) 'draw #t) ) - (let* ((s5-6 (get-process *default-dead-pool* manipy #x4000)) - (gp-6 (when s5-6 - (let ((t9-37 (method-of-type manipy activate))) - (t9-37 (the-as manipy s5-6) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-6 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-rightarm-sg* - #f - ) - (-> s5-6 ppointer) - ) - ) - ) + (let ((gp-6 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-rightarm-sg* #f :to self)) + ) (send-event (ppointer->process gp-6) 'anim-mode 'loop) (send-event (ppointer->process gp-6) 'art-joint-anim "citb-robotboss-rightarm-idle" 0) (send-event (ppointer->process gp-6) 'draw #t) ) - (let* ((s5-7 (get-process *default-dead-pool* manipy #x4000)) - (gp-7 (when s5-7 - (let ((t9-43 (method-of-type manipy activate))) - (t9-43 (the-as manipy s5-7) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-7 - manipy-init - (-> self root-override trans) - (-> self entity) - *citb-robotboss-belly-sg* - #f - ) - (-> s5-7 ppointer) - ) - ) - ) + (let ((gp-7 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-belly-sg* #f :to self))) (send-event (ppointer->process gp-7) 'anim-mode 'loop) (send-event (ppointer->process gp-7) 'art-joint-anim "citb-robotboss-belly-idle" 0) (send-event (ppointer->process gp-7) 'draw #t) ) (update-transforms! (-> self root-override)) - (while #t + (loop (when (-> self shield-on) (update! (-> self sound)) (spawn (-> self part) (-> self root-override trans)) @@ -1257,14 +1063,12 @@ ) (none) ) - :post - (the-as (function none :behavior citb-robotboss) ja-post) + :post (the-as (function none :behavior citb-robotboss) ja-post) ) ;; failed to figure out what this is: (defstate citb-robotboss-die (citb-robotboss) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (deactivate self) (none) @@ -1293,19 +1097,8 @@ (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 601) obj)) (logclear! (-> obj mask) (process-mask actor-pause)) (set! (-> obj shield-on) #t) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "robotcage-lp") - :volume #x400 - :fo-max #x96 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "robotcage-lp" :fo-max 150) (-> obj root-override trans)) ) (if (= (get-task-status (-> obj entity extra perm task)) (task-status invalid)) (go citb-robotboss-die) @@ -1315,13 +1108,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-coil-sg* citb-coil - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *citb-coil-sg* citb-coil citb-coil-lod0-jg citb-coil-idle-ja + ((citb-coil-lod0-mg (meters 20)) (citb-coil-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; definition of type citb-coil (deftype citb-coil (process-drawable) @@ -1367,56 +1157,24 @@ ;; failed to figure out what this is: (defstate citb-coil-idle (citb-coil) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go citb-coil-break) ) ) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (behavior () + :post (behavior () (spawn (-> self part) (-> self root trans)) (ja-post) (none) @@ -1425,63 +1183,35 @@ ;; failed to figure out what this is: (defstate citb-coil-break (citb-coil) - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (ja-channel-push! 1 30) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go citb-coil-broken) (none) ) - :post - (the-as (function none :behavior citb-coil) ja-post) + :post (the-as (function none :behavior citb-coil) ja-post) ) ;; failed to figure out what this is: (defstate citb-coil-broken (citb-coil) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (spawn (-> self part-off) (-> self root trans)) (suspend) ) (none) ) - :post - (the-as (function none :behavior citb-coil) ja-post) + :post (the-as (function none :behavior citb-coil) ja-post) ) ;; definition for method 11 of type citb-coil @@ -1492,8 +1222,8 @@ (initialize-skeleton obj *citb-coil-sg* '()) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 596) obj)) (set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 602) obj)) - (let ((v1-9 (the-as entity (entity-actor-lookup (-> obj entity) 'state-actor 0)))) - (if (not (the-as entity-actor v1-9)) + (let ((v1-9 (entity-actor-lookup (-> obj entity) 'state-actor 0))) + (if (not v1-9) (set! v1-9 (-> obj entity)) ) (if (logtest? (-> v1-9 extra perm status) (entity-perm-status complete)) @@ -1505,13 +1235,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-hose-sg* citb-hose - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *citb-hose-sg* citb-hose citb-hose-lod0-jg citb-hose-idle-ja + ((citb-hose-lod0-mg (meters 20)) (citb-hose-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) ;; definition of type citb-hose (deftype citb-hose (process-drawable) @@ -1549,96 +1276,51 @@ ;; failed to figure out what this is: (defstate citb-hose-idle (citb-hose) - :event - citb-hose-event-handler - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :event citb-hose-event-handler + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior citb-hose) ja-post) + :post (the-as (function none :behavior citb-hose) ja-post) ) ;; failed to figure out what this is: (defstate citb-hose-spawn (citb-hose) - :event - citb-hose-event-handler - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :event citb-hose-event-handler + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go citb-hose-idle) (none) ) - :post - (the-as (function none :behavior citb-hose) ja-post) + :post (the-as (function none :behavior citb-hose) ja-post) ) ;; failed to figure out what this is: (defstate citb-hose-die (citb-hose) - :event - citb-hose-event-handler - :code - (behavior () + :event citb-hose-event-handler + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (ja-channel-push! 1 30) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (anim-loop) (none) ) - :post - (the-as (function none :behavior citb-hose) ja-post) + :post (the-as (function none :behavior citb-hose) ja-post) ) ;; definition for method 11 of type citb-hose @@ -1647,8 +1329,8 @@ (set! (-> obj root) (new 'process 'trsqv)) (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *citb-hose-sg* '()) - (let ((v1-3 (the-as entity (entity-actor-lookup (-> obj entity) 'state-actor 0)))) - (if (not (the-as entity-actor v1-3)) + (let ((v1-3 (entity-actor-lookup (-> obj entity) 'state-actor 0))) + (if (not v1-3) (set! v1-3 (-> obj entity)) ) (if (logtest? (-> v1-3 extra perm status) (entity-perm-status complete)) @@ -1700,22 +1382,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-generator-sg* citb-generator - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *citb-generator-sg* citb-generator citb-generator-lod0-jg citb-generator-idle-ja + ((citb-generator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) ;; failed to figure out what this is: -(defskelgroup *citb-generator-broken-sg* citb-generator - 2 - 4 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *citb-generator-broken-sg* citb-generator citb-generator-broken-lod0-jg citb-generator-idle-ja + ((citb-generator-broken-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) ;; definition of type citb-generator (deftype citb-generator (process-drawable) @@ -1863,8 +1539,7 @@ ;; failed to figure out what this is: (defstate citb-generator-idle (citb-generator) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (if (-> self mushroom) @@ -1878,16 +1553,14 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (none) ) - :code - (behavior () + :code (behavior () (lods-assign! (-> self draw) (-> self normal-look)) (update-transforms! (-> self root-override)) - (while #t + (loop (spawn (-> self part) (-> self root-override trans)) (update! (-> self sound)) (if (-> self mushroom) @@ -1918,14 +1591,12 @@ ) (none) ) - :post - (the-as (function none :behavior citb-generator) ja-post) + :post (the-as (function none :behavior citb-generator) ja-post) ) ;; failed to figure out what this is: (defstate citb-generator-break (citb-generator) - :code - (behavior () + :code (behavior () (let ((gp-0 (entity-actor-count (-> self entity) 'open-actor))) (dotimes (s5-0 gp-0) (let ((s4-0 (entity-actor-lookup (-> self entity) 'open-actor s5-0)) @@ -1958,36 +1629,27 @@ ) ) (process-entity-status! self (entity-perm-status complete) #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 598) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 598) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) - (sound-play-by-name (static-sound-name "sagecage-open") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sagecage-open") (go citb-generator-broken) (none) ) - :post - (the-as (function none :behavior citb-generator) ja-post) + :post (the-as (function none :behavior citb-generator) ja-post) ) ;; failed to figure out what this is: (defstate citb-generator-broken (citb-generator) - :code - (behavior () + :code (behavior () (lods-assign! (-> self draw) (-> self broken-look)) (update-transforms! (-> self root-override)) (cond @@ -2007,8 +1669,7 @@ (anim-loop) (none) ) - :post - (behavior () + :post (behavior () (spawn (-> self part-broken) (-> self root-override trans)) (ja-post) (none) @@ -2076,19 +1737,8 @@ (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 600) obj)) (set! (-> obj part-broken) (create-launch-control (-> *part-group-id-table* 597) obj)) (set! (-> obj part-mushroom) (create-launch-control (-> *part-group-id-table* 599) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "mushroom-gen") - :volume #x400 - :fo-max 20 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "mushroom-gen" :fo-max 20) (-> obj root-override trans)) ) 0 (none) @@ -2100,8 +1750,8 @@ (init! obj) (process-drawable-from-entity! obj arg0) (dummy-21 obj) - (let ((v1-4 (the-as entity (entity-actor-lookup (-> obj entity) 'state-actor 0)))) - (if (not (the-as entity-actor v1-4)) + (let ((v1-4 (entity-actor-lookup (-> obj entity) 'state-actor 0))) + (if (not v1-4) (set! v1-4 (-> obj entity)) ) (if (logtest? (-> v1-4 extra perm status) (entity-perm-status complete)) @@ -2113,13 +1763,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *citadelcam-sg* citadelcam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 20) - :longest-edge (meters 0) - ) +(defskelgroup *citadelcam-sg* citadelcam citadelcam-lod0-jg citadelcam-idle-ja + ((citadelcam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) ;; definition of type citadelcam (deftype citadelcam (process-drawable) @@ -2144,8 +1791,7 @@ ;; failed to figure out what this is: (defstate citadelcam-idle (citadelcam) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (when (and (task-complete? *game-info* (game-task citadel-sage-blue)) @@ -2158,8 +1804,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask actor-pause)) (anim-loop) (none) @@ -2168,8 +1813,7 @@ ;; failed to figure out what this is: (defstate citadelcam-stair-plats (citadelcam) - :code - (behavior () + :code (behavior () (let ((gp-0 (entity-actor-count (-> self entity) 'trigger-actor))) (dotimes (s5-0 gp-0) (let ((s4-0 (entity-actor-lookup (-> self entity) 'trigger-actor s5-0)) @@ -2201,28 +1845,12 @@ ) ) ) - (let* ((gp-1 (get-process *default-dead-pool* pov-camera #x4000)) - (gp-2 - (ppointer->handle - (when gp-1 - (let ((t9-6 (method-of-type pov-camera activate))) - (t9-6 (the-as pov-camera gp-1) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (-> self root trans) - *citadelcam-sg* - "citadelcam-stair-plats" - 0 - #f - '() - ) - (-> gp-1 ppointer) - ) - ) - ) - ) + (let ((gp-2 + (ppointer->handle + (process-spawn pov-camera (-> self root trans) *citadelcam-sg* "citadelcam-stair-plats" 0 #f '() :to self) + ) + ) + ) (while (handle->process (the-as handle gp-2)) (suspend) ) @@ -2269,8 +1897,7 @@ ;; failed to figure out what this is: (defstate battlecontroller-play-intro-camera (citb-battlecontroller) :virtual #t - :code - (behavior () + :code (behavior () (level-hint-spawn (game-text-id citadel-lurker-bunny-alert) "sksp0383" @@ -2279,29 +1906,22 @@ (game-task none) ) (suspend) - (let* ((gp-0 (get-process *default-dead-pool* pov-camera #x4000)) - (gp-1 (ppointer->handle (when gp-0 - (let ((t9-2 (method-of-type pov-camera activate))) - (t9-2 (the-as pov-camera gp-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> (entity-by-name "citadelcam-1") extra trans) - *citadelcam-sg* - "citadel-bunnies" - 0 - #f - '() - ) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 (ppointer->handle (process-spawn + pov-camera + (-> (entity-by-name "citadelcam-1") extra trans) + *citadelcam-sg* + "citadel-bunnies" + 0 + #f + '() + :to self + ) + ) + ) + ) (send-event (handle->process (the-as handle gp-1)) 'mask 2048) (while (handle->process (the-as handle gp-1)) - (set! (-> *target* state-flags) (logand -17 (-> *target* state-flags))) + (logclear! (-> *target* state-flags) (state-flags invulnerable)) (suspend) ) ) @@ -2313,8 +1933,7 @@ ;; failed to figure out what this is: (defstate battlecontroller-die (citb-battlecontroller) :virtual #t - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) (let ((t9-2 (-> (the-as (state battlecontroller) (find-parent-method citb-battlecontroller 26)) code))) (if t9-2 diff --git a/test/decompiler/reference/levels/citadel/citadel-part_REF.gc b/test/decompiler/reference/levels/citadel/citadel-part_REF.gc index 41fdbf9f61..2cd9576e5a 100644 --- a/test/decompiler/reference/levels/citadel/citadel-part_REF.gc +++ b/test/decompiler/reference/levels/citadel/citadel-part_REF.gc @@ -23,14 +23,12 @@ :id 685 :flags (use-local-clock) :bounds (static-bspherem 0 -8 0 8) - :parts - ((sp-item 2879) (sp-item 2880)) + :parts ((sp-item 2879) (sp-item 2880)) ) ;; failed to figure out what this is: (defpart 2880 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 8.0 1.0) (sp-rnd-flt spt-x (meters 0) (meters 2.5) 1.0) (sp-flt spt-y (meters -13)) @@ -62,8 +60,7 @@ ;; failed to figure out what this is: (defpart 2881 - :init-specs - ((sp-flt spt-userdata 409600.0)) + :init-specs ((sp-flt spt-userdata 409600.0)) ) ;; definition for function check-drop-level-firehose-pops @@ -95,8 +92,7 @@ ;; failed to figure out what this is: (defpart 2883 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -113,8 +109,7 @@ ;; failed to figure out what this is: (defpart 2882 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 4.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -137,8 +132,7 @@ ;; failed to figure out what this is: (defpart 2879 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters 0) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -2) (meters -1) 1.0) @@ -157,8 +151,7 @@ ;; failed to figure out what this is: (defpart 2541 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-func spt-birth-func 'birth-func-set-quat) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -11)) @@ -179,8 +172,7 @@ :id 599 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12.5) - :parts - ((sp-item 2408 :fade-after (meters 200) :falloff-to (meters 200)) + :parts ((sp-item 2408 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 2409 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 2410 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 2411 :fade-after (meters 200) :falloff-to (meters 200) :binding 2407) @@ -211,8 +203,7 @@ :id 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12.5) - :parts - ((sp-item 2413 :fade-after (meters 300) :falloff-to (meters 300)) + :parts ((sp-item 2413 :fade-after (meters 300) :falloff-to (meters 300)) (sp-item 2414 :fade-after (meters 200) :falloff-to (meters 200) :binding 2412) (sp-item 2412 :flags (bit1 start-dead launch-asap)) (sp-item 2412 :flags (bit1 start-dead launch-asap)) @@ -245,8 +236,7 @@ ;; failed to figure out what this is: (defpart 2411 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-y (meters 4.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 10.4) (meters 6) 1.0) @@ -263,8 +253,7 @@ ;; failed to figure out what this is: (defpart 2407 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-flt spt-y (meters 0)) @@ -290,8 +279,7 @@ ;; failed to figure out what this is: (defpart 2408 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-flt spt-y (meters 5)) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 6.5) 1.0) @@ -313,8 +301,7 @@ ;; failed to figure out what this is: (defpart 2409 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-flt spt-y (meters 5)) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 5.5) 1.0) @@ -336,8 +323,7 @@ ;; failed to figure out what this is: (defpart 2410 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-flt spt-y (meters 5)) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 4.5) 1.0) @@ -359,8 +345,7 @@ ;; failed to figure out what this is: (defpart 2413 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.75)) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) @@ -378,8 +363,7 @@ ;; failed to figure out what this is: (defpart 2414 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-y (meters 0.2) (meters 1.4) 1.0) (sp-flt spt-scale-x (meters 0.4)) @@ -393,8 +377,7 @@ ;; failed to figure out what this is: (defpart 2412 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-flt spt-y (meters 0)) @@ -420,14 +403,12 @@ ;; failed to figure out what this is: (defpart 2415 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 2416)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 2416)) ) ;; failed to figure out what this is: (defpart 2416 - :init-specs - ((sp-flt spt-fade-a -0.8)) + :init-specs ((sp-flt spt-fade-a -0.8)) ) ;; failed to figure out what this is: @@ -437,8 +418,7 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 2423 :period 600 :length 5) + :parts ((sp-item 2423 :period 600 :length 5) (sp-item 2424 :fade-after (meters 80) :falloff-to (meters 80) :period 600 :length 40) (sp-item 2425 :period 600 :length 20) (sp-item 2426 :fade-after (meters 120) :falloff-to (meters 120) :period 600 :length 20) @@ -447,8 +427,7 @@ ;; failed to figure out what this is: (defpart 2424 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.4) 1.0) @@ -477,14 +456,12 @@ ;; failed to figure out what this is: (defpart 2427 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) ) ;; failed to figure out what this is: (defpart 2426 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 0.2)) @@ -506,8 +483,7 @@ ;; failed to figure out what this is: (defpart 2423 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 16)) @@ -527,8 +503,7 @@ ;; failed to figure out what this is: (defpart 2425 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -560,16 +535,14 @@ :id 597 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 2417 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 2417 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 2418 :fade-after (meters 60) :falloff-to (meters 60)) ) ) ;; failed to figure out what this is: (defpart 2417 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters -0.5) (meters 1.1) 1.0) (sp-flt spt-y (meters 0.75)) @@ -598,8 +571,7 @@ ;; failed to figure out what this is: (defpart 2418 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters 0.2)) (sp-flt spt-y (meters 1.75)) (sp-int spt-rot-x 8) @@ -619,8 +591,7 @@ ;; failed to figure out what this is: (defpart 2419 - :init-specs - ((sp-flt spt-fade-b -1.3653333)) + :init-specs ((sp-flt spt-fade-b -1.3653333)) ) ;; definition for function birth-func-random-rot @@ -688,14 +659,12 @@ :id 601 :flags (use-local-clock) :bounds (static-bspherem 0 23 0 34) - :parts - ((sp-item 2420 :fade-after (meters 220) :falloff-to (meters 250) :flags (is-3d))) + :parts ((sp-item 2420 :fade-after (meters 220) :falloff-to (meters 250) :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 2420 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xc :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc :page #x2)) (sp-func spt-birth-func 'birth-func-random-rot) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 23)) @@ -717,8 +686,7 @@ ;; failed to figure out what this is: (defpart 2421 - :init-specs - ((sp-rnd-flt spt-g 32.0 32.0 1.0) + :init-specs ((sp-rnd-flt spt-g 32.0 32.0 1.0) (sp-flt spt-a 96.0) (sp-flt spt-fade-a 0.0) (sp-int spt-next-time 5) @@ -728,8 +696,7 @@ ;; failed to figure out what this is: (defpart 2422 - :init-specs - ((sp-rnd-flt spt-g 0.0 32.0 1.0) (sp-flt spt-a 64.0) (sp-flt spt-fade-a -0.85333335)) + :init-specs ((sp-rnd-flt spt-g 0.0 32.0 1.0) (sp-flt spt-a 64.0) (sp-flt spt-fade-a -0.85333335)) ) ;; failed to figure out what this is: @@ -737,8 +704,7 @@ :id 596 :flags (use-local-clock) :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 2429 :fade-after (meters 100) :falloff-to (meters 100) :flags (is-3d)) + :parts ((sp-item 2429 :fade-after (meters 100) :falloff-to (meters 100) :flags (is-3d)) (sp-item 2430 :fade-after (meters 100) :falloff-to (meters 100) :flags (is-3d)) (sp-item 2431 :fade-after (meters 100) :falloff-to (meters 100) :flags (is-3d)) (sp-item 2432 :fade-after (meters 100) :falloff-to (meters 100) :flags (is-3d)) @@ -779,8 +745,7 @@ ;; failed to figure out what this is: (defpart 2434 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.1)) (sp-flt spt-y (meters 1.0025)) @@ -801,8 +766,7 @@ ;; failed to figure out what this is: (defpart 2433 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.1)) (sp-flt spt-y (meters 3.9)) @@ -823,8 +787,7 @@ ;; failed to figure out what this is: (defpart 2432 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 3.2897)) @@ -845,8 +808,7 @@ ;; failed to figure out what this is: (defpart 2431 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 0.8025)) @@ -867,8 +829,7 @@ ;; failed to figure out what this is: (defpart 2430 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.2)) (sp-flt spt-y (meters 0.8025)) @@ -888,8 +849,7 @@ ;; failed to figure out what this is: (defpart 2429 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.2)) (sp-flt spt-y (meters 3.7)) @@ -909,8 +869,7 @@ ;; failed to figure out what this is: (defpart 2438 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-y (meters 0.5) (meters 4) 1.0) (sp-flt spt-scale-x (meters 0.4)) @@ -924,8 +883,7 @@ ;; failed to figure out what this is: (defpart 2428 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-flt spt-y (meters 0)) @@ -951,20 +909,17 @@ ;; failed to figure out what this is: (defpart 2439 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 2440)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 360) (sp-launcher-by-id spt-next-launcher 2440)) ) ;; failed to figure out what this is: (defpart 2440 - :init-specs - ((sp-flt spt-fade-a -0.8)) + :init-specs ((sp-flt spt-fade-a -0.8)) ) ;; failed to figure out what this is: (defpart 2437 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.2 0.5 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 4) 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 2.5) 1.0) @@ -984,8 +939,7 @@ ;; failed to figure out what this is: (defpart 2435 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 4) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 0.5) 1.0) @@ -1006,8 +960,7 @@ ;; failed to figure out what this is: (defpart 2436 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 4) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 0.5) 1.0) @@ -1031,16 +984,14 @@ :id 602 :flags (use-local-clock) :bounds (static-bspherem 0 6 0 8) - :parts - ((sp-item 2441 :fade-after (meters 120) :falloff-to (meters 120)) + :parts ((sp-item 2441 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 2442 :fade-after (meters 120) :falloff-to (meters 120)) ) ) ;; failed to figure out what this is: (defpart 2442 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.06125) (sp-rnd-flt spt-x (meters 1.5) (meters 0.5) 1.0) (sp-flt spt-y (meters 4.5)) @@ -1073,8 +1024,7 @@ ;; failed to figure out what this is: (defpart 2443 - :init-specs - ((sp-flt spt-fade-r 0.0) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.035555556) @@ -1084,8 +1034,7 @@ ;; failed to figure out what this is: (defpart 2441 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 1.5) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 3) 1.0) @@ -1117,8 +1066,7 @@ :id 603 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 34) - :parts - ((sp-item 2447 :fade-after (meters 140) :falloff-to (meters 140) :binding 2444) + :parts ((sp-item 2447 :fade-after (meters 140) :falloff-to (meters 140) :binding 2444) (sp-item 2444 :flags (bit1 start-dead launch-asap) :binding 2445) (sp-item 2444 :flags (bit1 start-dead launch-asap) :binding 2446) (sp-item 2444 :flags (bit1 start-dead launch-asap) :binding 2445) @@ -1151,14 +1099,12 @@ :id 607 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 2451 :flags (is-3d))) + :parts ((sp-item 2451 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 2451 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) @@ -1177,8 +1123,7 @@ ;; failed to figure out what this is: (defpart 2447 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.025) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1199,8 +1144,7 @@ ;; failed to figure out what this is: (defpart 2444 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1223,8 +1167,7 @@ ;; failed to figure out what this is: (defpart 2445 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1244,8 +1187,7 @@ ;; failed to figure out what this is: (defpart 2446 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1265,8 +1207,7 @@ ;; failed to figure out what this is: (defpart 2448 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-y (meters 0.6) (meters 0.8) 1.0) @@ -1287,8 +1228,7 @@ ;; failed to figure out what this is: (defpart 2450 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1309,8 +1249,7 @@ ;; failed to figure out what this is: (defpart 2449 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1330,8 +1269,7 @@ :id 604 :flags (use-local-clock) :bounds (static-bspherem 0 23 0 34) - :parts - ((sp-item 2454 :fade-after (meters 140) :falloff-to (meters 140) :binding 2452) + :parts ((sp-item 2454 :fade-after (meters 140) :falloff-to (meters 140) :binding 2452) (sp-item 2452 :flags (bit1 start-dead launch-asap) :binding 2453) (sp-item 2452 :flags (bit1 start-dead launch-asap) :binding 2453) (sp-item 2452 :flags (bit1 start-dead launch-asap) :binding 2453) @@ -1364,14 +1302,12 @@ :id 608 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 2458 :flags (is-3d))) + :parts ((sp-item 2458 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 2458 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) @@ -1390,8 +1326,7 @@ ;; failed to figure out what this is: (defpart 2454 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1411,8 +1346,7 @@ ;; failed to figure out what this is: (defpart 2452 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1435,8 +1369,7 @@ ;; failed to figure out what this is: (defpart 2453 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1461,8 +1394,7 @@ ;; failed to figure out what this is: (defpart 2455 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-scale-y (meters 1.5) (meters 0.75) 1.0) @@ -1483,8 +1415,7 @@ ;; failed to figure out what this is: (defpart 2457 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1504,8 +1435,7 @@ ;; failed to figure out what this is: (defpart 2456 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1525,8 +1455,7 @@ :id 605 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 34) - :parts - ((sp-item 2461 :fade-after (meters 140) :falloff-to (meters 140) :binding 2459) + :parts ((sp-item 2461 :fade-after (meters 140) :falloff-to (meters 140) :binding 2459) (sp-item 2459 :flags (bit1 start-dead launch-asap) :binding 2460) (sp-item 2459 :flags (bit1 start-dead launch-asap) :binding 2460) (sp-item 2459 :flags (bit1 start-dead launch-asap) :binding 2460) @@ -1563,14 +1492,12 @@ :id 609 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 2465 :flags (is-3d))) + :parts ((sp-item 2465 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 2465 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) @@ -1589,8 +1516,7 @@ ;; failed to figure out what this is: (defpart 2461 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.025) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1611,8 +1537,7 @@ ;; failed to figure out what this is: (defpart 2459 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1635,8 +1560,7 @@ ;; failed to figure out what this is: (defpart 2460 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1656,8 +1580,7 @@ ;; failed to figure out what this is: (defpart 2462 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-y (meters 0.6) (meters 0.8) 1.0) @@ -1678,8 +1601,7 @@ ;; failed to figure out what this is: (defpart 2464 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1700,8 +1622,7 @@ ;; failed to figure out what this is: (defpart 2463 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1721,8 +1642,7 @@ :id 606 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 34) - :parts - ((sp-item 2468 :binding 2466) + :parts ((sp-item 2468 :binding 2466) (sp-item 2466 :flags (bit1 start-dead launch-asap) :binding 2467) (sp-item 2466 :flags (bit1 start-dead launch-asap) :binding 2467) (sp-item 2466 :flags (bit1 start-dead launch-asap) :binding 2467) @@ -1759,14 +1679,12 @@ :id 610 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 2472 :flags (is-3d))) + :parts ((sp-item 2472 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 2472 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) @@ -1785,8 +1703,7 @@ ;; failed to figure out what this is: (defpart 2468 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.025) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1807,8 +1724,7 @@ ;; failed to figure out what this is: (defpart 2466 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1831,8 +1747,7 @@ ;; failed to figure out what this is: (defpart 2467 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1851,8 +1766,7 @@ ;; failed to figure out what this is: (defpart 2469 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-y (meters 0.6) (meters 0.8) 1.0) @@ -1873,8 +1787,7 @@ ;; failed to figure out what this is: (defpart 2471 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1895,8 +1808,7 @@ ;; failed to figure out what this is: (defpart 2470 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1913,8 +1825,7 @@ ;; failed to figure out what this is: (defpart 2473 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xc :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc :page #x2)) (sp-func spt-birth-func 'birth-func-set-quat) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.25) 1.0) @@ -1932,8 +1843,7 @@ (defpartgroup group-citadel-warpgate :id 662 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2689 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 2689 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 2690 :fade-after (meters 60) :falloff-to (meters 100) :binding 2687) (sp-item 2687 :flags (bit1 start-dead launch-asap)) (sp-item 2687 :flags (bit1 start-dead launch-asap)) @@ -2110,8 +2020,7 @@ ;; failed to figure out what this is: (defpart 2692 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-x (meters 0)) (sp-flt spt-scale-x (meters 5)) @@ -2129,8 +2038,7 @@ ;; failed to figure out what this is: (defpart 2691 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters -2)) (sp-flt spt-scale-x (meters 0.25)) @@ -2146,8 +2054,7 @@ ;; failed to figure out what this is: (defpart 2688 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4.3555555)) (sp-flt spt-y (meters 4)) @@ -2171,8 +2078,7 @@ ;; failed to figure out what this is: (defpart 2689 - :init-specs - ((sp-rnd-flt spt-num 3.0 3.0 1.0) + :init-specs ((sp-rnd-flt spt-num 3.0 3.0 1.0) (sp-flt spt-x (meters -0.5)) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) @@ -2190,8 +2096,7 @@ ;; failed to figure out what this is: (defpart 2690 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.25)) (sp-copy-from-other spt-scale-y -4) @@ -2206,8 +2111,7 @@ ;; failed to figure out what this is: (defpart 2687 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4.3555555)) (sp-flt spt-y (meters 4)) @@ -2234,8 +2138,7 @@ (defpartgroup group-part-citadel-torch :id 683 :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 2832 :fade-after (meters 180) :falloff-to (meters 200)) + :parts ((sp-item 2832 :fade-after (meters 180) :falloff-to (meters 200)) (sp-item 2833 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 2834 :fade-after (meters 50) :falloff-to (meters 50) :period 600 :length 90) (sp-item 2835 :fade-after (meters 50) :falloff-to (meters 50) :period 369 :length 69) @@ -2246,8 +2149,7 @@ ;; failed to figure out what this is: (defpart 2837 - :init-specs - ((sp-flt spt-num 0.3) + :init-specs ((sp-flt spt-num 0.3) (sp-flt spt-x (meters 0.2)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-int spt-rot-x 5) @@ -2266,14 +2168,12 @@ ;; failed to figure out what this is: (defpart 2838 - :init-specs - ((sp-flt spt-fade-b -6.826667)) + :init-specs ((sp-flt spt-fade-b -6.826667)) ) ;; failed to figure out what this is: (defpart 2832 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1069547520 1 1.0) (sp-rnd-flt spt-x (meters -0.35) (meters 0.7) 1.0) (sp-rnd-flt spt-z (meters -0.35) (meters 0.7) 1.0) @@ -2296,14 +2196,12 @@ ;; failed to figure out what this is: (defpart 2839 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) ;; failed to figure out what this is: (defpart 2834 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters 1)) @@ -2327,8 +2225,7 @@ ;; failed to figure out what this is: (defpart 2835 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.2) (meters 0.6) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2352,8 +2249,7 @@ ;; failed to figure out what this is: (defpart 2836 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 0.2) 1.0) (sp-flt spt-y (meters 0.6)) @@ -2377,8 +2273,7 @@ ;; failed to figure out what this is: (defpart 2833 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.3)) diff --git a/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc b/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc index 8c1bb026d3..d9bb2f503d 100644 --- a/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc +++ b/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc @@ -1,14 +1,19 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/green-sagecage-ag.gc") +(import "goal_src/import/yellowsage-ag.gc") +(import "goal_src/import/redsage-ag.gc") +(import "goal_src/import/evilbro-citadel-ag.gc") +(import "goal_src/import/evilsis-citadel-ag.gc") +(import "goal_src/import/citb-sagecage-ag.gc") +(import "goal_src/import/bluesage-ag.gc") + ;; failed to figure out what this is: -(defskelgroup *citb-sagecage-sg* citb-sagecage - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 -6 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *citb-sagecage-sg* citb-sagecage citb-sagecage-lod0-jg citb-sagecage-redsage-idle-ja + ((citb-sagecage-lod0-mg (meters 20)) (citb-sagecage-lod1-mg (meters 999999))) + :bounds (static-spherem 0 -6 0 7) + ) ;; definition of type citb-sagecage (deftype citb-sagecage (process-drawable) @@ -100,14 +105,13 @@ ;; failed to figure out what this is: (defstate citb-sagecage-idle (citb-sagecage) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-3 none)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'disable-bars) (stop! (-> self sound)) - (sound-play-by-name (static-sound-name "sagecage-off") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sagecage-off") (set! (-> self bars-on) #f) (citb-sagecage-update-collision) ) @@ -132,11 +136,9 @@ ) ) ) - :trans - (the-as (function none :behavior citb-sagecage) rider-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior citb-sagecage) rider-trans) + :code (behavior () + (loop (cond ((-> self cloning) (let ((gp-0 (ppointer->process (-> self parent-override)))) @@ -154,18 +156,14 @@ ) ) (else - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) ) (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (rider-post) (when (-> self bars-on) (update! (-> self sound)) @@ -228,19 +226,8 @@ (set-vector! (-> obj bar-array 10) 0.0 f0-1 f1-0 1.0) (set-vector! (-> obj bar-array 11) f2-0 f0-1 f1-0 1.0) ) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "sagecage-gen") - :volume #x400 - :fo-max 20 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "sagecage-gen" :fo-max 20) (-> obj root-override trans)) ) (set! (-> obj bars-on) (not (task-complete? *game-info* (-> obj entity extra perm task)))) (citb-sagecage-update-collision) @@ -263,64 +250,46 @@ ) ;; failed to figure out what this is: -(defskelgroup *redsage-sg* redsage - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - :shadow 3 - ) +(defskelgroup *redsage-sg* redsage redsage-lod0-jg redsage-redsage-idle-ja + ((redsage-lod0-mg (meters 20)) (redsage-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow redsage-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *bluesage-sg* bluesage - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 3 - ) +(defskelgroup *bluesage-sg* bluesage bluesage-lod0-jg bluesage-bluesage-idle-ja + ((bluesage-lod0-mg (meters 20)) (bluesage-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow bluesage-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *yellowsage-sg* yellowsage - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - :shadow 3 - ) +(defskelgroup *yellowsage-sg* yellowsage yellowsage-lod0-jg yellowsage-yellowsage-idle-ja + ((yellowsage-lod0-mg (meters 20)) (yellowsage-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow yellowsage-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *green-sagecage-sg* green-sagecage - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 3 - ) +(defskelgroup *green-sagecage-sg* green-sagecage green-sagecage-lod0-jg green-sagecage-green-sagecage-idle-ja + ((green-sagecage-lod0-mg (meters 20)) (green-sagecage-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow green-sagecage-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *evilbro-citadel-sg* evilbro-citadel - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *evilbro-citadel-sg* evilbro-citadel evilbro-citadel-lod0-jg evilbro-citadel-idle-ja + ((evilbro-citadel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :shadow evilbro-citadel-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *evilsis-citadel-sg* evilsis-citadel - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *evilsis-citadel-sg* evilsis-citadel evilsis-citadel-lod0-jg evilsis-citadel-idle-ja + ((evilsis-citadel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :shadow evilsis-citadel-shadow-mg + ) ;; definition of type citb-sage (deftype citb-sage (process-taskable) @@ -395,18 +364,7 @@ ;; Used lq/sq (defmethod play-reminder citb-sage ((obj citb-sage)) (set! (-> obj root-override pause-adjust-distance) 409600.0) - (let ((s5-0 (get-process *default-dead-pool* citb-sagecage #x4000))) - (set! (-> obj cage) - (ppointer->handle (when s5-0 - (let ((t9-1 (method-of-type citb-sagecage activate))) - (t9-1 (the-as citb-sagecage s5-0) obj 'citb-sagecage (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 citb-sagecage-init-by-other obj) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> obj cage) (ppointer->handle (process-spawn citb-sagecage obj :to obj))) (set! (-> obj beam-on) #f) (set! (-> obj sound-id) (new-sound-id)) (if (zero? (-> obj sound-name)) @@ -482,8 +440,7 @@ ;; failed to figure out what this is: (defstate hidden (citb-sage) :virtual #t - :enter - (behavior () + :enter (behavior () (send-event (handle->process (-> self cage)) 'disable-bars) (send-event (handle->process (-> self cage)) 'stop-cloning) ((-> (method-of-type process-taskable hidden) enter)) @@ -501,7 +458,7 @@ 1024 0 0 - 1 + (sound-group sfx) (the-as symbol (-> self spawn-pos)) ) ) @@ -517,8 +474,7 @@ ;; failed to figure out what this is: (defstate play-anim (citb-sage) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('disable-bars) (send-event (handle->process (-> self cage)) 'disable-bars) @@ -533,8 +489,7 @@ ;; failed to figure out what this is: (defstate idle (citb-sage) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('open) (send-event (handle->process (-> self cage)) 'disable-bars) @@ -544,16 +499,14 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (not (should-display? self)) (go-virtual hidden) ) ((-> (method-of-type process-taskable idle) trans)) (none) ) - :post - (behavior () + :post (behavior () ((the-as (function none :behavior citb-sage) (-> (method-of-type process-taskable idle) post))) (if (-> self beam-on) (citb-sage-draw-beam) @@ -580,7 +533,7 @@ ) ;; definition for method 52 of type red-sagecage -;; INFO: Return type mismatch int vs none. +;; INFO: Return type mismatch shadow-flags vs none. (defmethod dummy-52 red-sagecage ((obj red-sagecage)) (let ((v1-1 (-> obj draw shadow-ctrl))) (when v1-1 @@ -592,7 +545,7 @@ (set! (-> a0-3 settings top-plane w) (- 4096.0)) ) 0 - (set! (-> v1-1 settings flags) (logand -13 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf02 shdf03)) ) ) (none) @@ -607,14 +560,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -647,8 +600,7 @@ :name "redsage-resolution" :index 7 :parts 9 - :command-list - '((15 send-event self disable-bars) + :command-list '((15 send-event self disable-bars) (45 joint "cameraB") (216 joint "camera") (435 joint "cameraB") @@ -667,10 +619,7 @@ (return #f) ) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-7 (the-as number (logior #x3f800000 v1-6))) - (f0-2 (+ -1.0 (the-as float v1-7))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) (play-ambient (-> obj ambient) "RED-AM01" #f (-> obj root-override trans)) @@ -714,7 +663,7 @@ ) ;; definition for method 52 of type blue-sagecage -;; INFO: Return type mismatch int vs none. +;; INFO: Return type mismatch shadow-flags vs none. (defmethod dummy-52 blue-sagecage ((obj blue-sagecage)) (let ((v1-1 (-> obj draw shadow-ctrl))) (when v1-1 @@ -726,7 +675,7 @@ (set! (-> a0-3 settings top-plane w) (- 4096.0)) ) 0 - (set! (-> v1-1 settings flags) (logand -13 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf02 shdf03)) ) ) (none) @@ -741,14 +690,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -781,8 +730,7 @@ :name "bluesage-resolution" :index 7 :parts 9 - :command-list - '((15 send-event self disable-bars) + :command-list '((15 send-event self disable-bars) (45 joint "cameraB") (74 shadow self #f) (185 joint "camera") @@ -806,10 +754,7 @@ (return #f) ) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-7 (the-as number (logior #x3f800000 v1-6))) - (f0-2 (+ -1.0 (the-as float v1-7))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) (play-ambient (-> obj ambient) "BLU-AM01" #f (-> obj root-override trans)) @@ -853,7 +798,7 @@ ) ;; definition for method 52 of type yellow-sagecage -;; INFO: Return type mismatch int vs none. +;; INFO: Return type mismatch shadow-flags vs none. (defmethod dummy-52 yellow-sagecage ((obj yellow-sagecage)) (let ((v1-1 (-> obj draw shadow-ctrl))) (when v1-1 @@ -865,7 +810,7 @@ (set! (-> a0-3 settings top-plane w) (- 4096.0)) ) 0 - (set! (-> v1-1 settings flags) (logand -13 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf02 shdf03)) ) ) (none) @@ -880,14 +825,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -920,8 +865,7 @@ :name "yellowsage-resolution" :index 7 :parts 6 - :command-list - '((15 send-event self disable-bars) + :command-list '((15 send-event self disable-bars) (45 joint "cameraB") (256 joint "camera") (314 joint "cameraB") @@ -940,10 +884,7 @@ (return #f) ) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-7 (the-as number (logior #x3f800000 v1-6))) - (f0-2 (+ -1.0 (the-as float v1-7))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) (play-ambient (-> obj ambient) "YEL-AM01" #f (-> obj root-override trans)) @@ -1021,8 +962,7 @@ :name "green-sagecage-resolution" :index 6 :parts 12 - :command-list - '((33 joint "cameraB") + :command-list '((33 joint "cameraB") (156 joint "camera") (405 joint "cameraB") (576 joint "camera") @@ -1054,8 +994,7 @@ :name "green-sagecage-introduction" :index 5 :parts 12 - :command-list - '((71 joint "cameraB") + :command-list '((71 joint "cameraB") (207 joint "camera") (343 joint "cameraB") (574 joint "camera") @@ -1076,35 +1015,15 @@ (when arg0 (+! (-> obj which-movie) 1) (set! (-> obj draw bounds w) 40960.0) - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj evilbro) - (ppointer->handle - (when s5-1 - (let ((t9-8 (method-of-type manipy activate))) - (t9-8 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *evilbro-citadel-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> obj evilbro) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilbro-citadel-sg* #f :to obj)) + ) (send-event (handle->process (-> obj evilbro)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj evilbro)) 'blend-shape #t) (send-event (handle->process (-> obj evilbro)) 'center-joint 3) - (let ((s5-2 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj evilsis) - (ppointer->handle - (when s5-2 - (let ((t9-14 (method-of-type manipy activate))) - (t9-14 (the-as manipy s5-2) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 manipy-init (-> obj root-override trans) (-> obj entity) *evilsis-citadel-sg* #f) - (-> s5-2 ppointer) - ) - ) - ) - ) + (set! (-> obj evilsis) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilsis-citadel-sg* #f :to obj)) + ) (send-event (handle->process (-> obj evilsis)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj evilsis)) 'blend-shape #t) (send-event (handle->process (-> obj evilsis)) 'center-joint 3) @@ -1116,8 +1035,7 @@ :name "green-sagecage-outro-preboss" :index 7 :parts 22 - :command-list - '((0 blackout 0) + :command-list '((0 blackout 0) (0 want-levels citadel finalboss) (0 display-level finalboss special) (0 send-event "citb-robotboss-1" 'die) @@ -1214,26 +1132,15 @@ ;; failed to figure out what this is: (defstate play-anim (green-sagecage) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('spawn-robot) (let ((gp-0 (entity-by-name "robotboss-3"))) (format 0 "robotboss ent ~A~%" gp-0) (when gp-0 - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self robotboss) - (ppointer->handle - (when s5-0 - (let ((t9-3 (method-of-type manipy activate))) - (t9-3 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> self root-override trans) gp-0 *robotboss-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> self robotboss) + (ppointer->handle (manipy-spawn (-> self root-override trans) gp-0 *robotboss-sg* #f :to self)) + ) (send-event (handle->process (-> self robotboss)) 'anim-mode 'clone-anim) (send-event (handle->process (-> self robotboss)) 'center-joint 3) (send-event (handle->process (-> self robotboss)) 'origin-joint-index 3) @@ -1254,8 +1161,7 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self evilbro)))) (if a0-1 (deactivate a0-1) @@ -1305,8 +1211,7 @@ ((-> (method-of-type process-taskable play-anim) exit)) (none) ) - :trans - (behavior () + :trans (behavior () (case (-> self which-movie) ((1) (spool-push *art-control* "green-sagecage-outro-preboss" 0 self -1.0) @@ -1345,8 +1250,7 @@ ;; failed to figure out what this is: (defstate idle (green-sagecage) :virtual #t - :trans - (behavior () + :trans (behavior () (cond ((and *target* (and (< (-> (target-pos 0) z) -18821530.0) (= (current-status (-> self tasks)) (task-status need-hint))) diff --git a/test/decompiler/reference/levels/citadel/citb-bunny_REF.gc b/test/decompiler/reference/levels/citadel/citb-bunny_REF.gc index 0a72302986..b975f2f08f 100644 --- a/test/decompiler/reference/levels/citadel/citb-bunny_REF.gc +++ b/test/decompiler/reference/levels/citadel/citb-bunny_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/citb-bunny-ag.gc") + ;; definition of type citb-bunny (deftype citb-bunny (snow-bunny) () @@ -22,13 +24,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-bunny-sg* citb-bunny - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0.25 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *citb-bunny-sg* citb-bunny citb-bunny-lod0-jg citb-bunny-idle-ja + ((citb-bunny-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0.25 0 2) + ) ;; definition for symbol *citb-bunny-nav-enemy-info*, type nav-enemy-info (define *citb-bunny-nav-enemy-info* (new 'static 'nav-enemy-info @@ -77,7 +76,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -97,7 +96,7 @@ (defmethod TODO-RENAME-48 citb-bunny ((obj citb-bunny) (arg0 object)) (dummy-60 obj) (TODO-RENAME-45 obj *citb-bunny-nav-enemy-info*) - (set! (-> obj draw shadow-ctrl settings flags) (logand -9 (-> obj draw shadow-ctrl settings flags))) + (logclear! (-> obj draw shadow-ctrl settings flags) (shadow-flags shdf03)) (cond ((zero? (res-lump-value (-> obj entity) 'mode uint128)) (set! (-> obj defense) (the-as uint 1)) diff --git a/test/decompiler/reference/levels/citadel/citb-drop-plat_REF.gc b/test/decompiler/reference/levels/citadel/citb-drop-plat_REF.gc index 3fa37cd5a6..5fa6a8d8d3 100644 --- a/test/decompiler/reference/levels/citadel/citb-drop-plat_REF.gc +++ b/test/decompiler/reference/levels/citadel/citb-drop-plat_REF.gc @@ -1,50 +1,37 @@ ;;-*-Lisp-*- (in-package goal) -;; failed to figure out what this is: -(defskelgroup *citb-drop-plat-sg* citb-drop-plat - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(import "goal_src/import/citb-drop-plat-ag.gc") ;; failed to figure out what this is: -(defskelgroup *citb-drop-plat-red-sg* citb-drop-plat - 4 - 7 - ((5 (meters 20)) (6 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *citb-drop-plat-sg* citb-drop-plat citb-drop-plat-lod0-jg citb-drop-plat-idle-ja + ((citb-drop-plat-lod0-mg (meters 20)) (citb-drop-plat-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; failed to figure out what this is: -(defskelgroup *citb-drop-plat-green-sg* citb-drop-plat - 8 - 11 - ((9 (meters 20)) (10 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *citb-drop-plat-red-sg* citb-drop-plat citb-drop-plat-red-lod0-jg citb-drop-plat-red-idle-ja + ((citb-drop-plat-red-lod0-mg (meters 20)) (citb-drop-plat-red-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; failed to figure out what this is: -(defskelgroup *citb-drop-plat-blue-sg* citb-drop-plat - 12 - 15 - ((13 (meters 20)) (14 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *citb-drop-plat-green-sg* citb-drop-plat citb-drop-plat-green-lod0-jg citb-drop-plat-green-idle-ja + ((citb-drop-plat-green-lod0-mg (meters 20)) (citb-drop-plat-green-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; failed to figure out what this is: -(defskelgroup *citb-drop-plat-yellow-sg* citb-drop-plat - 16 - 19 - ((17 (meters 20)) (18 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *citb-drop-plat-blue-sg* citb-drop-plat citb-drop-plat-blue-lod0-jg citb-drop-plat-blue-idle-ja + ((citb-drop-plat-blue-lod0-mg (meters 20)) (citb-drop-plat-blue-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) + +;; failed to figure out what this is: +(defskelgroup *citb-drop-plat-yellow-sg* citb-drop-plat citb-drop-plat-yellow-lod0-jg citb-drop-plat-yellow-idle-ja + ((citb-drop-plat-yellow-lod0-mg (meters 20)) (citb-drop-plat-yellow-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; definition of type drop-plat (deftype drop-plat (process-drawable) @@ -91,27 +78,25 @@ ;; failed to figure out what this is: (defstate drop-plat-idle (drop-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('drop) (logclear! (-> self mask) (process-mask actor-pause)) (go drop-plat-drop) ) (('touch 'attack) - (send-event *target* 'no-look-around 300) + (send-event *target* 'no-look-around (seconds 1)) (send-event (ppointer->process (-> self parent)) 'player-stepped (-> self color)) #f ) ) ) - :code - (behavior () + :code (behavior () (suspend) (update-transforms! (-> self root-override)) (set! (-> self state-time) (-> *display* base-frame-counter)) (logior! (-> self mask) (process-mask actor-pause)) - (while #t + (loop (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self duration)) (go drop-plat-drop) ) @@ -119,8 +104,7 @@ ) (none) ) - :post - (the-as (function none :behavior drop-plat) ja-post) + :post (the-as (function none :behavior drop-plat) ja-post) ) ;; definition for function drop-plat-set-fade @@ -142,23 +126,21 @@ ;; failed to figure out what this is: (defstate drop-plat-spawn (drop-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('drop) (go drop-plat-die) ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self root-override trans y) (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y)) ) (logior! (-> self draw status) (draw-status hidden)) (ja-post) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay)) (let ((v1-14 (logclear (-> self draw status) (draw-status hidden))) (a0-5 (-> self draw)) @@ -175,16 +157,14 @@ ;; failed to figure out what this is: (defstate drop-plat-rise (drop-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('drop) (go drop-plat-drop) ) ) ) - :code - (behavior ((arg0 draw-control)) + :code (behavior ((arg0 draw-control)) (set! (-> self interp) 1.0) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self spin-angle) 0.0) @@ -196,7 +176,7 @@ ) (set! (-> gp-0 quad) (-> self root-override trans quad)) (set! (-> gp-0 y) (-> (the-as process-drawable (-> self parent 0)) root trans y)) - (while #t + (loop (let ((f0-6 (fmax 0.0 (- 1.0 (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) ) @@ -208,7 +188,7 @@ ) (when (and (not s5-0) (< (-> self interp) 0.05)) (set! s5-0 #t) - (sound-play-by-name (static-sound-name "bridge-piece-up") (new-sound-id) 1024 0 0 1 (the-as symbol gp-0)) + (sound-play "bridge-piece-up" :position (the-as symbol gp-0)) ) (set! (-> self spin-angle) (* 10.0 (-> self spin-speed) (-> self interp))) (if (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) @@ -219,8 +199,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-vector-angle! gp-0 (-> self spin-axis) (-> self spin-angle)) (quaternion*! (-> self root-override quat) (-> (the-as process-drawable (-> self parent 0)) root quat) gp-0) @@ -233,11 +212,10 @@ ;; failed to figure out what this is: (defstate drop-plat-drop (drop-plat) - :code - (behavior () + :code (behavior () (when (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "bridge-piece-dn") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bridge-piece-dn") (let ((gp-1 (the int (* 300.0 (rand-vu-float-range 0.2 0.3))))) (while (< (- (-> *display* base-frame-counter) (-> self state-time)) gp-1) (set! (-> self interp) @@ -248,7 +226,7 @@ ) ) ) - (while #t + (loop (vector-v++! (-> self root-override transv) (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0) @@ -264,8 +242,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-vector-angle! gp-0 (-> self spin-axis) (-> self spin-angle)) (quaternion*! (-> self root-override quat) (-> (the-as process-drawable (-> self parent 0)) root quat) gp-0) @@ -278,8 +255,7 @@ ;; failed to figure out what this is: (defstate drop-plat-die (drop-plat) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (none) ) @@ -551,18 +527,16 @@ ;; failed to figure out what this is: (defstate citb-drop-plat-idle (citb-drop-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go citb-drop-plat-active) ) ) ) - :code - (behavior () + :code (behavior () (citb-drop-plat-drop-all-children) - (while #t + (loop (suspend) ) (none) @@ -571,8 +545,7 @@ ;; failed to figure out what this is: (defstate citb-drop-plat-active (citb-drop-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'player-stepped) @@ -588,11 +561,10 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (citb-drop-plat-spawn-children) - (while #t + (loop (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (+ (-> self duration) (seconds 2))) (or (not *target*) (< (-> self idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) diff --git a/test/decompiler/reference/levels/citadel/citb-plat_REF.gc b/test/decompiler/reference/levels/citadel/citb-plat_REF.gc index 915144eed3..d940438865 100644 --- a/test/decompiler/reference/levels/citadel/citb-plat_REF.gc +++ b/test/decompiler/reference/levels/citadel/citb-plat_REF.gc @@ -1,41 +1,44 @@ ;;-*-Lisp-*- (in-package goal) -;; failed to figure out what this is: -(defskelgroup *plat-citb-sg* plat-citb - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(import "goal_src/import/citb-exit-plat-ag.gc") +(import "goal_src/import/plat-eco-citb-ag.gc") +(import "goal_src/import/plat-citb-ag.gc") +(import "goal_src/import/citb-stopbox-ag.gc") +(import "goal_src/import/citb-firehose-ag.gc") +(import "goal_src/import/citb-rotatebox-ag.gc") +(import "goal_src/import/citb-chain-plat-ag.gc") +(import "goal_src/import/citb-donut-ag.gc") ;; failed to figure out what this is: -(defskelgroup *plat-eco-citb-unlit-sg* plat-eco-citb - 0 - 8 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *plat-citb-sg* plat-citb plat-citb-lod0-jg plat-citb-idle-ja + ((plat-citb-lod0-mg (meters 20)) (plat-citb-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; failed to figure out what this is: -(defskelgroup *plat-eco-citb-lit-sg* plat-eco-citb - 4 - 8 - ((5 (meters 20)) (6 (meters 40)) (7 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *plat-eco-citb-unlit-sg* plat-eco-citb plat-eco-citb-lod0-jg plat-eco-citb-idle-ja + ((plat-eco-citb-lod0-mg (meters 20)) + (plat-eco-citb-lod1-mg (meters 40)) + (plat-eco-citb-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 3) + ) ;; failed to figure out what this is: -(defskelgroup *citb-chain-plat-sg* citb-chain-plat - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *plat-eco-citb-lit-sg* plat-eco-citb plat-eco-citb-lit-lod0-jg plat-eco-citb-idle-ja + ((plat-eco-citb-lit-lod0-mg (meters 20)) + (plat-eco-citb-lit-lod1-mg (meters 40)) + (plat-eco-citb-lit-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 3) + ) + +;; failed to figure out what this is: +(defskelgroup *citb-chain-plat-sg* citb-chain-plat citb-chain-plat-lod0-jg citb-chain-plat-idle-ja + ((citb-chain-plat-lod0-mg (meters 20)) (citb-chain-plat-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) ;; definition of type citb-base-plat (deftype citb-base-plat (process-drawable) @@ -67,8 +70,7 @@ ;; failed to figure out what this is: (defstate citb-base-plat-idle (citb-base-plat) :virtual #t - :trans - (behavior () + :trans (behavior () (if (and *target* (>= (-> self idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -77,17 +79,14 @@ ) (none) ) - :code - (the-as (function none :behavior citb-base-plat) anim-loop) - :post - (the-as (function none :behavior citb-base-plat) ja-post) + :code (the-as (function none :behavior citb-base-plat) anim-loop) + :post (the-as (function none :behavior citb-base-plat) ja-post) ) ;; failed to figure out what this is: (defstate citb-base-plat-active (citb-base-plat) :virtual #t - :trans - (behavior () + :trans (behavior () (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -97,10 +96,8 @@ (rider-trans) (none) ) - :code - (the-as (function none :behavior citb-base-plat) anim-loop) - :post - (the-as (function none :behavior citb-base-plat) rider-post) + :code (the-as (function none :behavior citb-base-plat) anim-loop) + :post (the-as (function none :behavior citb-base-plat) rider-post) ) ;; definition for method 21 of type citb-base-plat @@ -241,8 +238,7 @@ ;; failed to figure out what this is: (defstate plat-path-active (citb-plat) :virtual #t - :trans - (behavior () + :trans (behavior () (set! (-> self path-pos) (if (logtest? (-> self fact options) (fact-options wrap-phase)) (get-current-phase (-> self sync)) (get-current-phase-with-mirror (-> self sync)) @@ -251,15 +247,7 @@ (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (vector+! (-> self basetrans) (-> self basetrans) (-> self trans-offset)) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) (none) @@ -355,8 +343,7 @@ ;; failed to figure out what this is: (defstate citb-base-plat-idle (citb-stair-plat) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'trigger) (logclear! (-> self mask) (process-mask actor-pause)) @@ -368,10 +355,8 @@ ) ) ) - :trans - (the-as (function none :behavior citb-stair-plat) #f) - :code - (behavior () + :trans (the-as (function none :behavior citb-stair-plat) #f) + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (while (not (-> self rise)) (suspend) @@ -384,7 +369,7 @@ (suspend) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (let ((f30-0 (- 1.0 (* 0.0011111111 (the float (- (-> *display* base-frame-counter) (-> self state-time))))))) (when (< f30-0 0.0) (set! (-> self root-override trans y) (-> self rise-height)) @@ -402,17 +387,14 @@ ) (none) ) - :post - (the-as (function none :behavior citb-stair-plat) #f) + :post (the-as (function none :behavior citb-stair-plat) #f) ) ;; failed to figure out what this is: (defstate citb-base-plat-active (citb-stair-plat) :virtual #t - :trans - (the-as (function none :behavior citb-stair-plat) #f) - :code - (behavior () + :trans (the-as (function none :behavior citb-stair-plat) #f) + :code (behavior () (set! (-> self root-override trans y) (-> self rise-height)) (suspend) (update-transforms! (-> self root-override)) @@ -420,8 +402,7 @@ (anim-loop) (none) ) - :post - (the-as (function none :behavior citb-stair-plat) ja-post) + :post (the-as (function none :behavior citb-stair-plat) ja-post) ) ;; definition for method 22 of type citb-stair-plat @@ -560,74 +541,62 @@ ;; failed to figure out what this is: (defstate rigid-body-platform-idle (citb-chain-plat) :virtual #t - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (set! (-> self state-time) (-> *display* base-frame-counter)) (if (and (and *target* (>= (-> self info idle-distance) (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) ) ) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) (go-virtual rigid-body-platform-float) ) ) (none) ) - :code - (behavior () + :code (behavior () (anim-loop) (none) ) - :post - (the-as (function none :behavior citb-chain-plat) ja-post) + :post (the-as (function none :behavior citb-chain-plat) ja-post) ) ;; failed to figure out what this is: (defstate rigid-body-platform-float (citb-chain-plat) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior citb-chain-plat) rigid-body-platform-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (none) ) - :trans - (behavior () + :trans (behavior () (cond - ((and (and *target* - (>= (-> self info idle-distance) - (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) - ) + ((and (and *target* (>= (-> self info idle-distance) + (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) + ) ) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) (when (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (if (rand-vu-percent? 0.05) (spawn-projectile-blue *target*) ) ) - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) (-> self float-offset) (* 8192.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) (-> self float-offset) (* 8192.0 (-> *display* seconds-per-frame))) (draw-eco-beam (-> self root-overlay trans) (-> self beam-end)) (update-trans! (-> self sound) (-> self root-overlay trans)) (update! (-> self sound)) ) (else - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) (-> self idle-offset) (* 16384.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) (-> self idle-offset) (* 16384.0 (-> *display* seconds-per-frame))) (stop! (-> self sound)) (if (= (-> self float-height-offset) (-> self idle-offset)) (go citb-chain-plat-settle) @@ -636,21 +605,17 @@ ) (none) ) - :code - (behavior () + :code (behavior () (anim-loop) (none) ) - :post - (the-as (function none :behavior citb-chain-plat) rigid-body-platform-post) + :post (the-as (function none :behavior citb-chain-plat) rigid-body-platform-post) ) ;; failed to figure out what this is: (defstate citb-chain-plat-settle (citb-chain-plat) - :trans - (the-as (function none :behavior citb-chain-plat) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior citb-chain-plat) rider-trans) + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'quaternion)) ) @@ -678,8 +643,7 @@ (go-virtual rigid-body-platform-idle) (none) ) - :post - (the-as (function none :behavior citb-chain-plat) rider-post) + :post (the-as (function none :behavior citb-chain-plat) rider-post) ) ;; definition for method 30 of type citb-chain-plat @@ -722,19 +686,8 @@ (set! (-> obj idle-offset) 0.0) (set! (-> obj float-offset) (res-lump-float (-> obj entity) 'height-info :default 4096.0)) (set! (-> obj float-height-offset) (-> obj idle-offset)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "eco-plat-hover") - :volume #x400 - :fo-max 50 - ) - (-> obj root-overlay trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "eco-plat-hover" :fo-max 50) (-> obj root-overlay trans)) ) (let ((s5-0 (-> obj info control-point-count))) (dotimes (s4-0 s5-0) @@ -753,13 +706,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-rotatebox-sg* citb-rotatebox - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -5 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *citb-rotatebox-sg* citb-rotatebox citb-rotatebox-lod0-jg citb-rotatebox-idle-ja + ((citb-rotatebox-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -5 0 10) + ) ;; definition of type citb-rotatebox (deftype citb-rotatebox (citb-base-plat) @@ -781,44 +731,13 @@ ;; failed to figure out what this is: (defstate citb-base-plat-active (citb-rotatebox) :virtual #t - :trans - (the-as (function none :behavior citb-rotatebox) rider-trans) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :trans (the-as (function none :behavior citb-rotatebox) rider-trans) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) @@ -867,13 +786,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-donut-sg* citb-donut - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *citb-donut-sg* citb-donut citb-donut-lod0-jg citb-donut-idle-ja + ((citb-donut-lod0-mg (meters 20)) (citb-donut-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) ;; definition of type citb-donut (deftype citb-donut (citb-base-plat) @@ -897,8 +813,7 @@ ;; failed to figure out what this is: (defstate citb-base-plat-active (citb-donut) :virtual #t - :post - (behavior () + :post (behavior () (update! (-> self sound)) (quaternion-axis-angle! (-> self root-override quat) @@ -944,19 +859,8 @@ (defmethod dummy-22 citb-donut ((obj citb-donut)) (initialize-skeleton obj *citb-donut-sg* '()) (setup-params! (-> obj sync) (the-as uint 9000) 0.0 0.15 0.15) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "rotate-plat") - :volume #x400 - :fo-max 20 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> obj root-override trans)) ) (logclear! (-> obj mask) (process-mask actor-pause)) 0 @@ -964,13 +868,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-stopbox-sg* citb-stopbox - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 -2 0 5.5) - :longest-edge (meters 0) - ) +(defskelgroup *citb-stopbox-sg* citb-stopbox citb-stopbox-lod0-jg citb-stopbox-idle-ja + ((citb-stopbox-lod0-mg (meters 20)) (citb-stopbox-lod1-mg (meters 999999))) + :bounds (static-spherem 0 -2 0 5.5) + ) ;; definition of type citb-stopbox (deftype citb-stopbox (plat) @@ -992,20 +893,11 @@ ;; failed to figure out what this is: (defstate plat-path-active (citb-stopbox) :virtual #t - :trans - (behavior () + :trans (behavior () (set! (-> self path-pos) (get-current-phase (-> self sync))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) (none) @@ -1085,18 +977,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-firehose-sg* citb-firehose - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 3 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *citb-firehose-sg* citb-firehose citb-firehose-lod0-jg citb-firehose-idle-ja + ((citb-firehose-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3 0 15) + ) ;; failed to figure out what this is: (defstate citb-firehose-idle (citb-firehose) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= (-> self idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -1105,21 +993,18 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior citb-firehose) ja-post) + :post (the-as (function none :behavior citb-firehose) ja-post) ) ;; failed to figure out what this is: (defstate citb-firehose-active (citb-firehose) - :trans - (behavior () + :trans (behavior () (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -1136,15 +1021,13 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior citb-firehose) ja-post) + :post (the-as (function none :behavior citb-firehose) ja-post) ) ;; definition for function citb-firehose-blast-particles @@ -1170,101 +1053,47 @@ ;; failed to figure out what this is: (defstate citb-firehose-blast (citb-firehose) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (let ((v1-4 (new 'static 'attack-info :mask #xe0))) - (set! (-> v1-4 mode) 'damage) - (set! (-> v1-4 shove-back) 24576.0) - (set! (-> v1-4 shove-up) 12288.0) - (set! (-> a1-2 param 1) (the-as uint v1-4)) - ) - (send-event-function arg0 a1-2) + (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((mode 'damage) (shove-back (meters 6)) (shove-up (meters 3)))) ) ) ) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (restore-collide-with-as (-> self root-override)) - (sound-play-by-name - (static-sound-name "eco-torch") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self blast-pos)) - ) + (sound-play "eco-torch" :position (the-as symbol (-> self blast-pos))) (dotimes (gp-1 2) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (set! (-> self blast-pos quad) (-> self node-list data 5 bone transform vector 3 quad)) (citb-firehose-blast-particles) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (clear-collide-with-as (-> self root-override)) - (ja-channel-push! 1 30) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go citb-firehose-active) (none) ) - :post - (the-as (function none :behavior citb-firehose) transform-post) + :post (the-as (function none :behavior citb-firehose) transform-post) ) ;; definition for method 11 of type citb-firehose @@ -1314,13 +1143,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *citb-exit-plat-sg* citb-exit-plat - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *citb-exit-plat-sg* citb-exit-plat citb-exit-plat-lod0-jg citb-exit-plat-idle-ja + ((citb-exit-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) ;; definition of type citb-exit-plat (deftype citb-exit-plat (plat-button) @@ -1351,8 +1177,7 @@ ;; failed to figure out what this is: (defstate citb-exit-plat-idle (citb-exit-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (let ((v1-3 (-> self entity extra perm))) @@ -1363,11 +1188,10 @@ ) ) ) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self root-override)) - (while #t + (loop (suspend) ) (none) @@ -1376,14 +1200,12 @@ ;; failed to figure out what this is: (defstate citb-exit-plat-rise (citb-exit-plat) - :trans - (the-as (function none :behavior citb-exit-plat) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior citb-exit-plat) rider-trans) + :code (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self root-override)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (let ((f30-0 (- 1.0 (* 0.0016666667 (the float (- (-> *display* base-frame-counter) (-> self state-time))))))) (when (< f30-0 0.0) (set! (-> self root-override trans y) (-> self rise-height)) @@ -1395,8 +1217,7 @@ ) (none) ) - :post - (the-as (function none :behavior citb-exit-plat) rider-post) + :post (the-as (function none :behavior citb-exit-plat) rider-post) ) ;; definition for function citb-exit-plat-move-player @@ -1424,8 +1245,7 @@ ;; failed to figure out what this is: (defstate plat-button-move-downward (citb-exit-plat) :virtual #t - :trans - (behavior () + :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self root-override trans quad)) (let ((t9-1 (-> (the-as (state plat-button) (find-parent-method citb-exit-plat 23)) trans))) @@ -1437,15 +1257,13 @@ ) (none) ) - :post - (the-as (function none :behavior citb-exit-plat) transform-post) + :post (the-as (function none :behavior citb-exit-plat) transform-post) ) ;; failed to figure out what this is: (defstate plat-button-move-upward (citb-exit-plat) :virtual #t - :trans - (behavior () + :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self root-override trans quad)) (let ((t9-1 (-> (the-as (state plat-button) (find-parent-method citb-exit-plat 24)) trans))) @@ -1457,8 +1275,7 @@ ) (none) ) - :post - (the-as (function none :behavior citb-exit-plat) transform-post) + :post (the-as (function none :behavior citb-exit-plat) transform-post) ) ;; definition for method 26 of type citb-exit-plat diff --git a/test/decompiler/reference/levels/common/babak_REF.gc b/test/decompiler/reference/levels/common/babak_REF.gc index c50a3e2f3b..c5563de16a 100644 --- a/test/decompiler/reference/levels/common/babak_REF.gc +++ b/test/decompiler/reference/levels/common/babak_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/babak-ag.gc") + ;; definition of type babak (deftype babak (nav-enemy) () @@ -22,47 +24,28 @@ ) ;; failed to figure out what this is: -(defskelgroup *babak-sg* babak - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 2 0 3) - :longest-edge (meters 1) - :shadow 4 - ) +(defskelgroup *babak-sg* babak babak-lod0-jg -1 + ((babak-lod0-mg (meters 20)) (babak-lod1-mg (meters 40)) (babak-lod2-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3) + :longest-edge (meters 1) + :shadow babak-shadow-mg + ) ;; failed to figure out what this is: (defstate nav-enemy-patrol (babak) :virtual #t - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 10) - ) - (ja-channel-push! 1 45) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 12.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + ((ja-group? babak-give-up-hop-ja) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! babak-walk-ja :num! (seek!) :frame-num (ja-aframe 12.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) ) ) ((the-as (function none) (-> (method-of-type nav-enemy nav-enemy-patrol) code))) @@ -73,65 +56,31 @@ ;; failed to figure out what this is: (defstate nav-enemy-chase (babak) :virtual #t - :code - (behavior () + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 14) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 51) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim)))) - (set! (-> a0-7 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-7 param 1) f30-0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! - a0-7 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - num-func-seek! - ) - ) + ((ja-group? babak-jump-land-ja) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.17)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info run-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (else - (ja-channel-push! 1 60) - (let ((v1-42 (-> self skel root-channel 0))) - (set! (-> v1-42 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - ) - ) - (let ((v1-45 (-> self skel root-channel 0))) - (set! (-> v1-45 num-func) num-func-identity) - (set! (-> v1-45 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) ) ) - (while #t + (loop (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) f30-0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) @@ -141,96 +90,47 @@ ;; failed to figure out what this is: (defstate nav-enemy-stare (babak) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self turn-time) (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or (logtest? (-> self nav-enemy-flags) 256) + (when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) ) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> gp-0 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-0 param 1) f30-0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! babak-win-ja :num! (seek! (ja-aframe 68.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-1 param 1) f30-0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 68.0 0) f30-0)) ) ) - (while #t + (loop (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) 1.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 60) - (let ((v1-25 (-> self skel root-channel 0))) - (set! (-> v1-25 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - ) - (let ((v1-28 (-> self skel root-channel 0))) - (set! (-> v1-28 num-func) num-func-identity) - (set! (-> v1-28 frame-num) 0.0) - ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! babak-turn-ja) + (ja :num-func num-func-identity :frame-num 0.0) (until (nav-enemy-facing-player? 1820.4445) (ja-blend-eval) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) 0.75) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! 0.75)) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - ) - (ja-channel-push! 1 60) + (if (not (ja-group? babak-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) f30-0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! babak-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) f30-0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (when (nav-enemy-rnd-percent? 0.3) - (ja-channel-push! 1 30) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> gp-2 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-2 param 1) f30-0) - (set! (-> gp-2 frame-num) 0.0) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! babak-win-ja :num! (seek! (ja-aframe 68.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-3 param 1) f30-0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 68.0 0) f30-0)) ) ) ) @@ -242,11 +142,10 @@ ;; failed to figure out what this is: (defstate nav-enemy-give-up (babak) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 218453.33) (set! (-> self turn-time) (seconds 0.5)) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) (let ((s4-0 (-> self collide-info)) (s5-0 (target-pos 0)) ) @@ -255,36 +154,16 @@ ) 12743.111 ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! babak-give-up-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! babak-give-up-hop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek-to-point-toward-point! (-> self collide-info) @@ -293,11 +172,7 @@ (-> self turn-time) ) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) (none) @@ -307,35 +182,17 @@ ;; failed to figure out what this is: (defstate nav-enemy-jump-land (babak) :virtual #t - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 22) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - ) - (set! (-> gp-0 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-0 param 1) 0.5) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info jump-land-anim)) + :num! (seek! (ja-aframe 32.0 0) 0.5) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-1 param 1) 0.5) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) ) (go-virtual nav-enemy-chase) (none) @@ -392,7 +249,7 @@ :use-proximity-notice #t :use-jump-blocked #t :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/test/decompiler/reference/levels/common/basebutton_REF.gc b/test/decompiler/reference/levels/common/basebutton_REF.gc index a28cc018fc..1942505f2d 100644 --- a/test/decompiler/reference/levels/common/basebutton_REF.gc +++ b/test/decompiler/reference/levels/common/basebutton_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/generic-button-ag.gc") + ;; definition of type basebutton (deftype basebutton (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -60,13 +62,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *generic-button-sg* generic-button - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *generic-button-sg* generic-button generic-button-lod0-jg generic-button-idle-ja + ((generic-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; definition for method 30 of type basebutton ;; Used lq/sq @@ -85,8 +84,7 @@ ;; failed to figure out what this is: (defstate basebutton-startup (basebutton) :virtual #t - :code - (behavior () + :code (behavior () (if (-> self down?) (go-virtual basebutton-down-idle) (go-virtual basebutton-up-idle) @@ -98,20 +96,19 @@ ;; failed to figure out what this is: (defstate basebutton-up-idle (basebutton) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (case (-> arg3 param 1) (('flop) (TODO-RENAME-29 self (-> self event-going-down) (-> self notify-actor)) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-down) ) ) ) (('trigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-down) ) (('move-to) @@ -119,22 +116,18 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (press! self #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self move-to?) (rider-trans) ) (none) ) - :code - (the-as (function none :behavior basebutton) anim-loop) - :post - (behavior () + :code (the-as (function none :behavior basebutton) anim-loop) + :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) (set! (-> self root-override trans quad) (-> self move-to-pos quad)) @@ -148,11 +141,10 @@ ;; failed to figure out what this is: (defstate basebutton-going-down (basebutton) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('untrigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-up) ) (('move-to) @@ -160,34 +152,22 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (press! self #t) (none) ) - :trans - (the-as (function none :behavior basebutton) rider-trans) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) (-> self anim-speed)) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :trans (the-as (function none :behavior basebutton) rider-trans) + :code (behavior () + (ja-no-eval :num! (seek! max (-> self anim-speed))) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) (TODO-RENAME-29 self (-> self event-down) (-> self notify-actor)) (go-virtual basebutton-down-idle) (none) ) - :post - (behavior () + :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) (set! (-> self root-override trans quad) (-> self move-to-pos quad)) @@ -201,11 +181,10 @@ ;; failed to figure out what this is: (defstate basebutton-down-idle (basebutton) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('untrigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-up) ) (('move-to) @@ -213,20 +192,17 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (press! self #t) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self move-to?) (rider-trans) ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (cond ((= (-> self timeout) 0.0) @@ -237,14 +213,13 @@ (suspend) ) (TODO-RENAME-29 self (-> self event-going-up) (-> self notify-actor)) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-up) ) ) (none) ) - :post - (behavior () + :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) (set! (-> self root-override trans quad) (-> self move-to-pos quad)) @@ -258,46 +233,33 @@ ;; failed to figure out what this is: (defstate basebutton-going-up (basebutton) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('move-to) (move-to-vec-or-quat! self (the-as vector (-> arg3 param 0)) (the-as quaternion (-> arg3 param 1))) ) (('trigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-down) ) ) ) - :enter - (behavior () + :enter (behavior () (press! self #f) (none) ) - :trans - (the-as (function none :behavior basebutton) rider-trans) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 0.0) - (set! (-> a0-0 param 1) (-> self anim-speed)) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :trans (the-as (function none :behavior basebutton) rider-trans) + :code (behavior () + (ja-no-eval :num! (seek! 0.0 (-> self anim-speed))) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 0.0) - (set! (-> a0-1 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0 (-> self anim-speed))) ) (TODO-RENAME-29 self (-> self event-up) (-> self notify-actor)) (go-virtual basebutton-up-idle) (none) ) - :post - (behavior () + :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) (set! (-> self root-override trans quad) (-> self move-to-pos quad)) @@ -496,7 +458,7 @@ ;; definition for function basebutton-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior basebutton-init-by-other basebutton ((arg0 basebutton) (arg1 vector) (arg2 quaternion) (arg3 entity-actor) (arg4 symbol) (arg5 float)) +(defbehavior basebutton-init-by-other basebutton ((arg0 entity-actor) (arg1 vector) (arg2 quaternion) (arg3 entity-actor) (arg4 symbol) (arg5 float)) (reset! self) (set! (-> self spawned-by-other?) #t) (set! (-> self button-id) -1) @@ -504,7 +466,7 @@ (set! (-> self notify-actor) arg3) (set! (-> self timeout) arg5) (if arg0 - (set! (-> self entity) (the-as entity arg0)) + (set! (-> self entity) arg0) ) (TODO-RENAME-27 self) (set! (-> self root-override trans quad) (-> arg1 quad)) @@ -517,10 +479,7 @@ ) ;; definition for symbol *warp-info*, type (array string) -(define *warp-info* (the-as (array string) (new - 'static - 'boxed-array - :type string :length 5 :allocated-length 5 +(define *warp-info* (the-as (array string) (new 'static 'boxed-array :type string "training-warp" "village1-warp" "village2-warp" @@ -564,13 +523,11 @@ ;; failed to figure out what this is: (defstate use (warp-gate) :virtual #t - :trans - (behavior () + :trans (behavior () (send-event *camera* 'joystick 0.0 0.0) (none) ) - :code - (behavior ((arg0 int) (arg1 level)) + :code (behavior ((arg0 int) (arg1 level)) (set! (-> self state-time) (-> *display* base-frame-counter)) (when (not arg1) (process-release? *target*) @@ -633,14 +590,13 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x20 + :flags (surface-flags always-rotate-toward-transv) ) ) ;; failed to figure out what this is: (defstate target-warp-out (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('death-end) (let ((v0-0 (the-as object (logior (-> self draw status) (draw-status hidden))))) @@ -653,43 +609,30 @@ ) ) ) - :enter - (behavior ((arg0 vector) (arg1 vector)) + :enter (behavior ((arg0 vector) (arg1 vector)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *warp-jump-mods*) (set! (-> self control unknown-vector102 quad) (-> arg0 quad)) (set! (-> self control unknown-vector103 quad) (-> arg1 quad)) (set! (-> self control unknown-vector102 y) (+ -4096.0 (-> self control unknown-vector102 y))) (set! (-> self control unknown-uint20) (the-as uint #f)) (vector-reset! (-> self control transv)) - (logior! (-> self state-flags) 1024) + (logior! (-> self state-flags) (state-flags use-alt-cam-pos)) (set! (-> self alt-cam-pos quad) (-> arg1 quad)) (none) ) - :exit - (behavior () - (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) (none) ) - :code - (behavior ((arg0 vector) (arg1 vector)) + :code (behavior ((arg0 vector) (arg1 vector)) (send-event *camera* 'change-state cam-fixed 0) - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> gp-0 param 0) (ja-aframe 16.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! eichar-duck-high-jump-ja :num! (seek! (ja-aframe 16.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 16.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 16.0 0))) ) (vector-! (-> self control transv) (-> self control unknown-vector102) (-> self control trans)) (vector-xz-normalize! (-> self control transv) 32768.0) @@ -764,24 +707,13 @@ ) ) ) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> gp-3 param 0) (ja-aframe 40.0 0)) - (set! (-> gp-3 param 1) 1.0) - (set! (-> gp-3 frame-num) (ja-aframe 16.0 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) - ) + (ja-no-eval :group! eichar-duck-high-jump-ja :num! (seek! (ja-aframe 40.0 0)) :frame-num (ja-aframe 16.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 param 0) (ja-aframe 40.0 0)) - (set! (-> gp-4 param 1) 1.0) - (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 40.0 0))) ) (anim-loop) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) diff --git a/test/decompiler/reference/levels/common/baseplat_REF.gc b/test/decompiler/reference/levels/common/baseplat_REF.gc index d08a43d82a..cf631b7687 100644 --- a/test/decompiler/reference/levels/common/baseplat_REF.gc +++ b/test/decompiler/reference/levels/common/baseplat_REF.gc @@ -62,7 +62,7 @@ (suspend) (transform-post) (suspend) - (while #t + (loop (when (not (-> self bouncing)) (logior! (-> self mask) (process-mask sleep)) (suspend) @@ -133,18 +133,18 @@ ;; definition of type eco-door (deftype eco-door (process-drawable) - ((root-override collide-shape :offset 112) - (speed float :offset-assert 176) - (open-distance float :offset-assert 180) - (close-distance float :offset-assert 184) - (out-dir vector :inline :offset-assert 192) - (open-sound sound-name :offset-assert 208) - (close-sound sound-name :offset-assert 224) - (state-actor entity-actor :offset-assert 240) - (flags int32 :offset-assert 244) - (locked symbol :offset-assert 248) - (auto-close symbol :offset-assert 252) - (one-way symbol :offset-assert 256) + ((root-override collide-shape :offset 112) + (speed float :offset-assert 176) + (open-distance float :offset-assert 180) + (close-distance float :offset-assert 184) + (out-dir vector :inline :offset-assert 192) + (open-sound sound-name :offset-assert 208) + (close-sound sound-name :offset-assert 224) + (state-actor entity-actor :offset-assert 240) + (flags eco-door-flags :offset-assert 244) + (locked symbol :offset-assert 248) + (auto-close symbol :offset-assert 252) + (one-way symbol :offset-assert 256) ) :heap-base #xa0 :method-count-assert 27 @@ -190,11 +190,11 @@ (cond ((-> self locked) (if (= (-> self next-state name) 'door-closed) - (sound-play-by-name (static-sound-name "door-lock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "door-lock") ) ) (else - (sound-play-by-name (static-sound-name "door-unlock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "door-unlock") ) ) #t @@ -209,18 +209,13 @@ eco-door-event-handler ;; failed to figure out what this is: (defstate door-closed (eco-door) :virtual #t - :event - eco-door-event-handler - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) 0.0) - ) + :event eco-door-event-handler + :code (behavior () + (ja :num-func num-func-identity :frame-num 0.0) (suspend) (update-transforms! (-> self root-override)) (ja-post) - (while #t + (loop (when (and *target* (>= (-> self open-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -228,14 +223,7 @@ eco-door-event-handler (dummy-26 self) (if (and (not (-> self locked)) (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'powerup)) - (set! (-> a1-1 param 1) (the-as uint 3)) - (send-event-function *target* a1-1) - ) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) (and (-> self one-way) (< (vector4-dot (-> self out-dir) (target-pos 0)) -8192.0)) ) ) @@ -252,35 +240,21 @@ eco-door-event-handler ;; failed to figure out what this is: (defstate door-opening (eco-door) :virtual #t - :event - eco-door-event-handler - :code - (behavior () + :event eco-door-event-handler + :code (behavior () (let ((gp-0 (and (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) ) (if gp-0 - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) ) - (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) (clear-collide-with-as (-> self root-override)) (until (ja-done? 0) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) (-> self speed)) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self speed))) (if (and gp-0 (rand-vu-percent? 0.5)) (spawn-projectile-blue *target*) ) @@ -290,29 +264,23 @@ eco-door-event-handler (go-virtual door-open) (none) ) - :post - (the-as (function none :behavior eco-door) transform-post) + :post (the-as (function none :behavior eco-door) transform-post) ) ;; failed to figure out what this is: (defstate door-open (eco-door) :virtual #t - :event - eco-door-event-handler - :code - (behavior () + :event eco-door-event-handler + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (process-entity-status! self (entity-perm-status complete) #t) (clear-collide-with-as (-> self root-override)) - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 num-func) num-func-identity) - (set! (-> v1-6 frame-num) (the float (+ (-> v1-6 frame-group data 0 length) -1))) - ) + (ja :num-func num-func-identity :frame-num max) (logior! (-> self draw status) (draw-status hidden)) (suspend) (update-transforms! (-> self root-override)) (ja-post) - (while #t + (loop (let ((f30-0 (vector4-dot (-> self out-dir) (target-pos 0))) (f28-0 (vector4-dot (-> self out-dir) (camera-pos))) ) @@ -336,10 +304,8 @@ eco-door-event-handler ;; failed to figure out what this is: (defstate door-closing (eco-door) :virtual #t - :event - eco-door-event-handler - :code - (behavior () + :event eco-door-event-handler + :code (behavior () (restore-collide-with-as (-> self root-override)) (logclear! (-> self draw status) (draw-status hidden)) (let ((gp-0 (new 'stack 'overlaps-others-params))) @@ -349,23 +315,18 @@ eco-door-event-handler (suspend) ) ) - (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) (until (ja-done? 0) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) 0.0) - (set! (-> a0-7 param 1) (-> self speed)) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0 (-> self speed))) (suspend) ) (if (-> self locked) - (sound-play-by-name (static-sound-name "door-lock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "door-lock") ) (go-virtual door-closed) (none) ) - :post - (the-as (function none :behavior eco-door) transform-post) + :post (the-as (function none :behavior eco-door) transform-post) ) ;; definition for method 26 of type eco-door @@ -373,8 +334,8 @@ eco-door-event-handler (defmethod dummy-26 eco-door ((obj eco-door)) (when (-> obj state-actor) (if (logtest? (-> obj state-actor extra perm status) (entity-perm-status complete)) - (set! (-> obj locked) (logtest? (-> obj flags) 2)) - (set! (-> obj locked) (logtest? (-> obj flags) 1)) + (set! (-> obj locked) (logtest? (-> obj flags) (eco-door-flags ecdf01))) + (set! (-> obj locked) (logtest? (-> obj flags) (eco-door-flags ecdf00))) ) ) 0 @@ -427,10 +388,10 @@ eco-door-event-handler ) ) (set! (-> obj locked) #f) - (set! (-> obj flags) (res-lump-value arg0 'flags int)) + (set! (-> obj flags) (res-lump-value arg0 'flags eco-door-flags)) (dummy-26 obj) - (set! (-> obj auto-close) (logtest? (-> obj flags) 4)) - (set! (-> obj one-way) (logtest? (-> obj flags) 8)) + (set! (-> obj auto-close) (logtest? (-> obj flags) (eco-door-flags auto-close))) + (set! (-> obj one-way) (logtest? (-> obj flags) (eco-door-flags one-way))) (vector-z-quaternion! (-> obj out-dir) (-> obj root-override quat)) (set! (-> obj out-dir w) (- (vector-dot (-> obj out-dir) (-> obj root-override trans)))) (update-transforms! (-> obj root-override)) diff --git a/test/decompiler/reference/levels/common/battlecontroller_REF.gc b/test/decompiler/reference/levels/common/battlecontroller_REF.gc index 019ddbc45b..0ae034ef0c 100644 --- a/test/decompiler/reference/levels/common/battlecontroller_REF.gc +++ b/test/decompiler/reference/levels/common/battlecontroller_REF.gc @@ -208,7 +208,7 @@ battlecontroller-default-event-handler (let* ((s5-0 (-> self spawner-array gp-0)) (s4-0 (handle->process (-> s5-0 creature))) ) - (when (and s4-0 (logtest? (-> (the-as nav-enemy s4-0) nav-enemy-flags) 2048)) + (when (and s4-0 (logtest? (-> (the-as nav-enemy s4-0) nav-enemy-flags) (nav-enemy-flags navenmf11))) (cond ((< (-> s5-0 state) (-> s5-0 path curve num-cverts)) (when (or (-> self noticed-player) (= (-> s5-0 state) 1)) @@ -216,7 +216,7 @@ battlecontroller-default-event-handler (eval-path-curve-div! (-> s5-0 path) s3-0 (the float (-> s5-0 state)) 'interp) (send-event s4-0 'cue-jump-to-point s3-0) ) - (if (zero? (logand (-> (the-as nav-enemy s4-0) nav-enemy-flags) 2048)) + (if (zero? (logand (-> (the-as nav-enemy s4-0) nav-enemy-flags) (nav-enemy-flags navenmf11))) (+! (-> s5-0 state) 1) ) ) @@ -266,7 +266,7 @@ battlecontroller-default-event-handler (when (the-as (pointer nav-enemy) gp-0) (logclear! (-> (the-as (pointer nav-enemy) gp-0) 0 mask) (process-mask actor-pause)) (if (-> self misty-ambush-collision-hack) - (logior! (-> (the-as (pointer nav-enemy) gp-0) 0 nav-enemy-flags) #x8000) + (logior! (-> (the-as (pointer nav-enemy) gp-0) 0 nav-enemy-flags) (nav-enemy-flags navenmf15)) ) (+! (-> self spawn-count) 1) (-> self fact pickup-type) @@ -391,7 +391,7 @@ battlecontroller-default-event-handler ;; definition for function battlecontroller-battle-begin ;; INFO: Return type mismatch int vs none. (defbehavior battlecontroller-battle-begin battlecontroller () - (set-setting! *setting-control* self 'music 'danger 0.0 0) + (set-setting! 'music 'danger 0.0 0) (let ((gp-0 (entity-actor-count (-> self entity) 'kill-actor))) (dotimes (s5-0 gp-0) (let ((v1-2 (entity-actor-lookup (-> self entity) 'kill-actor s5-0))) @@ -428,7 +428,7 @@ battlecontroller-default-event-handler ;; definition for function battlecontroller-off ;; INFO: Return type mismatch int vs none. (defbehavior battlecontroller-off battlecontroller () - (clear-pending-settings-from-process *setting-control* self 'music) + (remove-setting! 'music) (let ((gp-0 (entity-actor-count (-> self entity) 'kill-actor))) (dotimes (s5-0 gp-0) (let ((v1-2 (entity-actor-lookup (-> self entity) 'kill-actor s5-0))) @@ -462,20 +462,17 @@ battlecontroller-default-event-handler ;; failed to figure out what this is: (defstate battlecontroller-idle (battlecontroller) :virtual #t - :event - battlecontroller-default-event-handler - :trans - (behavior () + :event battlecontroller-default-event-handler + :trans (behavior () 0 (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (if (-> self prespawn) (battlecontroller-fill-all-spawners) ) - (while #t + (loop (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (set! (-> self state-time) (-> *display* base-frame-counter)) (when (and *target* @@ -495,27 +492,22 @@ battlecontroller-default-event-handler ) (none) ) - :post - (the-as (function none :behavior battlecontroller) #f) + :post (the-as (function none :behavior battlecontroller) #f) ) ;; failed to figure out what this is: (defstate battlecontroller-play-intro-camera (battlecontroller) :virtual #t - :event - battlecontroller-default-event-handler - :enter - (behavior () + :event battlecontroller-default-event-handler + :enter (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) (none) ) - :exit - (behavior () + :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :code - (behavior () + :code (behavior () (go-virtual battlecontroller-active) (none) ) @@ -534,10 +526,8 @@ battlecontroller-default-event-handler ;; failed to figure out what this is: (defstate battlecontroller-active (battlecontroller) :virtual #t - :event - battlecontroller-default-event-handler - :trans - (behavior () + :event battlecontroller-default-event-handler + :trans (behavior () (if (and *target* (>= (-> self activate-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) @@ -547,11 +537,10 @@ battlecontroller-default-event-handler (battlecontroller-update-spawners) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (battlecontroller-camera-on) - (while #t + (loop (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 0)) @@ -580,8 +569,7 @@ battlecontroller-default-event-handler ) (none) ) - :post - (the-as (function none :behavior battlecontroller) #f) + :post (the-as (function none :behavior battlecontroller) #f) ) ;; definition for function battlecontroller-special-contents? @@ -624,14 +612,12 @@ battlecontroller-default-event-handler ;; failed to figure out what this is: (defstate battlecontroller-die (battlecontroller) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior battlecontroller) process-drawable-fuel-cell-handler ) - :code - (behavior () - (sound-play-by-name (static-sound-name "money-pickup") (new-sound-id) 1024 -2286 0 1 #f) + :code (behavior () + (sound-play "money-pickup" :pitch -1.5 :position #f) (battlecontroller-battle-end) (battlecontroller-camera-off) (battlecontroller-set-task-completed) @@ -694,8 +680,7 @@ battlecontroller-default-event-handler (process-entity-status! self (entity-perm-status dead) #t) (none) ) - :post - (the-as (function none :behavior battlecontroller) #f) + :post (the-as (function none :behavior battlecontroller) #f) ) ;; definition for method 7 of type battlecontroller diff --git a/test/decompiler/reference/levels/common/blocking-plane_REF.gc b/test/decompiler/reference/levels/common/blocking-plane_REF.gc index 7b4e75a6fe..e60e602151 100644 --- a/test/decompiler/reference/levels/common/blocking-plane_REF.gc +++ b/test/decompiler/reference/levels/common/blocking-plane_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/ef-plane-ag.gc") + ;; definition of type blocking-plane (deftype blocking-plane (process-drawable) () @@ -22,20 +24,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *ef-plane-sg* ef-plane - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *ef-plane-sg* ef-plane ef-plane-lod0-jg ef-plane-idle-ja + ((ef-plane-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) ;; failed to figure out what this is: (defstate blocking-plane-idle (blocking-plane) - :code - (behavior () + :code (behavior () (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -96,33 +94,23 @@ ;; definition for function blocking-plane-spawn ;; INFO: Return type mismatch int vs none. -(defun blocking-plane-spawn ((arg0 curve-control)) - (with-pp - (cond - ((or (not arg0) (logtest? (-> arg0 flags) (path-control-flag not-found))) - ) - (else - (let ((s5-0 (the int (the float (+ (-> arg0 curve num-cverts) -1)))) - (s4-0 0) - ) - (while (< s4-0 s5-0) - (let ((s3-0 (get-process *default-dead-pool* blocking-plane #x4000))) - (when s3-0 - (let ((t9-1 (method-of-type blocking-plane activate))) - (t9-1 (the-as blocking-plane s3-0) pp 'blocking-plane (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 blocking-plane-init-by-other arg0 s4-0) - (-> s3-0 ppointer) - ) - ) - (+! s4-0 2) +(defbehavior blocking-plane-spawn process ((arg0 curve-control)) + (cond + ((or (not arg0) (logtest? (-> arg0 flags) (path-control-flag not-found))) + ) + (else + (let ((s5-0 (the int (the float (+ (-> arg0 curve num-cverts) -1)))) + (s4-0 0) ) + (while (< s4-0 s5-0) + (process-spawn blocking-plane arg0 s4-0 :to self) + (+! s4-0 2) ) ) ) - 0 - (none) ) + 0 + (none) ) ;; definition for function blocking-plane-destroy diff --git a/test/decompiler/reference/levels/common/dark-eco-pool_REF.gc b/test/decompiler/reference/levels/common/dark-eco-pool_REF.gc index d3e4969b14..9b6712a26e 100644 --- a/test/decompiler/reference/levels/common/dark-eco-pool_REF.gc +++ b/test/decompiler/reference/levels/common/dark-eco-pool_REF.gc @@ -23,8 +23,7 @@ :count 3 :converted #f :normal-scale 3.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 2 :speed 0.5) (new 'static 'ripple-wave :scale 15.0 :xdiv -2 :zdiv 2 :speed 2.0) (new 'static 'ripple-wave :scale 3.0 :xdiv 5 :zdiv 3 :speed 2.0) @@ -34,14 +33,12 @@ ) ;; definition for symbol ripple-for-maincave-dark-eco-pool, type ripple-wave-set -(define - ripple-for-maincave-dark-eco-pool +(define ripple-for-maincave-dark-eco-pool (new 'static 'ripple-wave-set :count 3 :converted #f :normal-scale 8.57 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 14.0 :xdiv 1 :speed 1.0) (new 'static 'ripple-wave :scale 5.25 :xdiv -1 :zdiv 1 :speed 4.0) (new 'static 'ripple-wave :scale 0.7 :xdiv 5 :zdiv 3 :speed 2.0) @@ -51,14 +48,12 @@ ) ;; definition for symbol ripple-for-finalboss-dark-eco-pool, type ripple-wave-set -(define - ripple-for-finalboss-dark-eco-pool +(define ripple-for-finalboss-dark-eco-pool (new 'static 'ripple-wave-set :count 3 :converted #f :normal-scale 4.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 25.0 :xdiv 2 :speed -2.0) (new 'static 'ripple-wave :scale 15.0 :xdiv -2 :zdiv 2 :speed 3.0) (new 'static 'ripple-wave :scale 4.0 :xdiv 5 :zdiv 3 :speed 4.0) @@ -72,8 +67,7 @@ :count 3 :converted #f :normal-scale 3.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.0) (new 'static 'ripple-wave :scale 15.0 :xdiv -1 :zdiv 1 :speed 4.0) (new 'static 'ripple-wave :scale 2.0 :xdiv 5 :zdiv 3 :speed 2.0) @@ -83,14 +77,12 @@ ) ;; definition for symbol ripple-for-sunken-dark-eco-helix-room, type ripple-wave-set -(define - ripple-for-sunken-dark-eco-helix-room +(define ripple-for-sunken-dark-eco-helix-room (new 'static 'ripple-wave-set :count 3 :converted #f :normal-scale 8.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 15.0 :xdiv 1 :speed 1.0) (new 'static 'ripple-wave :scale 5.625 :xdiv -1 :zdiv 1 :speed 4.0) (new 'static 'ripple-wave :scale 0.75 :xdiv 5 :zdiv 3 :speed 2.0) @@ -100,29 +92,29 @@ ) ;; definition for method 25 of type dark-eco-pool +;; INFO: Return type mismatch object vs none. (defmethod TODO-RENAME-25 dark-eco-pool ((obj dark-eco-pool)) (let ((t9-0 (method-of-type water-anim TODO-RENAME-25))) (t9-0 obj) ) - (set! (-> obj flags) (logand -8388609 (-> obj flags))) - (set! (-> obj flags) (logior #x1000000 (-> obj flags))) - (let ((v0-1 ((the-as - (function res-lump symbol symbol float structure (pointer res-tag) pointer object) - (method-of-type res-lump get-property-struct) - ) - (-> obj entity) - 'attack-event - 'interp - -1000000000.0 - 'dark-eco-pool - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (logclear! (-> obj flags) (water-flags wt23)) + (set! (-> obj flags) (logior (water-flags wt24) (-> obj flags))) + (set! (-> obj attack-event) + (the-as symbol ((the-as + (function res-lump symbol symbol float structure (pointer res-tag) pointer object) + (method-of-type res-lump get-property-struct) + ) + (-> obj entity) + 'attack-event + 'interp + -1000000000.0 + 'dark-eco-pool + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) ) - (set! (-> obj attack-event) (the-as symbol v0-1)) - v0-1 - ) + (none) ) ;; definition for method 22 of type dark-eco-pool @@ -161,14 +153,12 @@ :id 444 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2020 :fade-after (meters 50))) + :parts ((sp-item 2020 :fade-after (meters 50))) ) ;; failed to figure out what this is: (defpart 2020 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 1) (meters 4) 1.0) @@ -189,8 +179,7 @@ ;; failed to figure out what this is: (defpart 2021 - :init-specs - ((sp-flt spt-r 255.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) (sp-flt spt-b 0.0) (sp-flt spt-fade-a -1.28)) + :init-specs ((sp-flt spt-r 255.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) (sp-flt spt-b 0.0) (sp-flt spt-fade-a -1.28)) ) ;; failed to figure out what this is: @@ -200,8 +189,7 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2056 :fade-after (meters 100) :period 600 :length 5) + :parts ((sp-item 2056 :fade-after (meters 100) :period 600 :length 5) (sp-item 2057 :fade-after (meters 100) :period 600 :length 5 :binding 2052) (sp-item 2052 :flags (start-dead launch-asap) :binding 2053) (sp-item 2053 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) @@ -225,8 +213,7 @@ ;; failed to figure out what this is: (defpart 2056 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 8)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -243,8 +230,7 @@ ;; failed to figure out what this is: (defpart 2057 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 6.0 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 0.1)) @@ -262,8 +248,7 @@ ;; failed to figure out what this is: (defpart 2052 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.3) (meters 0.3) 1.0) @@ -288,8 +273,7 @@ ;; failed to figure out what this is: (defpart 2053 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -310,8 +294,7 @@ ;; failed to figure out what this is: (defpart 2058 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 6.0 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 0.1)) @@ -329,8 +312,7 @@ ;; failed to figure out what this is: (defpart 2054 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.3) (meters 0.3) 1.0) @@ -355,8 +337,7 @@ ;; failed to figure out what this is: (defpart 2055 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -378,8 +359,7 @@ ;; failed to figure out what this is: (defstate water-vol-idle (dark-eco-pool) :virtual #t - :trans - (behavior () + :trans (behavior () (let ((t9-0 (-> (method-of-type water-anim water-vol-idle) trans))) (if t9-0 (t9-0) @@ -396,15 +376,17 @@ (set! (-> s5-0 vertex-skip) 256) (when (zero? (rand-vu-int-range 0 15)) (when (and (nonzero? (-> s5-0 vertex-count)) (< #x32000 (memory-free *nk-dead-pool*))) - (let ((s3-0 (rand-vu-int-range 0 (+ (-> s5-0 vertex-count) -1))) - (s4-1 (get-process *default-dead-pool* part-tracker #x4000)) - ) - (when s4-1 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker s4-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 part-tracker-init (-> *part-group-id-table* 445) -1 #f #f #f (-> s5-0 data s3-0)) - (-> s4-1 ppointer) + (let ((s3-0 (rand-vu-int-range 0 (+ (-> s5-0 vertex-count) -1)))) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 445) + -1 + #f + #f + #f + (-> s5-0 data s3-0) + :to *entity-pool* ) ) ) diff --git a/test/decompiler/reference/levels/common/joint-exploder_REF.gc b/test/decompiler/reference/levels/common/joint-exploder_REF.gc index 5280ae892c..11d7c05930 100644 --- a/test/decompiler/reference/levels/common/joint-exploder_REF.gc +++ b/test/decompiler/reference/levels/common/joint-exploder_REF.gc @@ -505,7 +505,7 @@ (-> arg0 bbox) (collide-kind background) obj - (new 'static 'pat-surface :skip #x1 :noentity #x1) + (new 'static 'pat-surface :noentity #x1) ) (let ((gp-1 (-> obj joints)) (v1-2 (-> arg0 head)) @@ -517,7 +517,15 @@ (s3-0 (new 'stack-no-clear 'collide-tri-result)) ) (vector-! a2-1 s4-0 (-> s5-1 prev-pos)) - (when (>= (probe-using-line-sphere *collide-cache* (-> s5-1 prev-pos) a2-1 40.96 (collide-kind background) s3-0 1) + (when (>= (probe-using-line-sphere + *collide-cache* + (-> s5-1 prev-pos) + a2-1 + 40.96 + (collide-kind background) + s3-0 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (set! (-> s4-0 quad) (-> s3-0 intersect quad)) @@ -543,13 +551,11 @@ ;; failed to figure out what this is: (defstate joint-exploder-shatter (joint-exploder) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (let* ((f1-0 (the float (- (-> *display* base-frame-counter) (-> self state-time)))) (f0-2 (- 1.0 (/ f1-0 (the float (-> self tuning duration))))) (f1-2 (- 1.0 (/ f1-0 (* 0.75 (the float (-> self tuning duration)))))) @@ -606,20 +612,15 @@ 0 (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self tuning duration)) (suspend) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior joint-exploder) ja-post) + :post (the-as (function none :behavior joint-exploder) ja-post) ) ;; definition for method 23 of type joint-exploder @@ -753,10 +754,7 @@ (logior! (-> self skel status) (janim-status inited)) (set! (-> self anim) (the-as art-joint-anim (-> self draw art-group data arg1))) (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! gp-1 (-> self anim) num-func-identity) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! (-> self anim) :num! min) (ja-post) (TODO-RENAME-23 self) (set! (-> self die-if-below-y) (+ -102400.0 (-> self root trans y))) diff --git a/test/decompiler/reference/levels/common/launcherdoor_REF.gc b/test/decompiler/reference/levels/common/launcherdoor_REF.gc index 6d0a345c4e..5465a5cc9f 100644 --- a/test/decompiler/reference/levels/common/launcherdoor_REF.gc +++ b/test/decompiler/reference/levels/common/launcherdoor_REF.gc @@ -1,6 +1,9 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/launcherdoor-maincave-ag.gc") +(import "goal_src/import/launcherdoor-ag.gc") + ;; definition of type launcherdoor (deftype launcherdoor (process-drawable) ((root-override collide-shape :offset 112) @@ -34,63 +37,45 @@ ) ;; failed to figure out what this is: -(defskelgroup *launcherdoor-sg* launcherdoor - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *launcherdoor-sg* launcherdoor launcherdoor-geo-jg -1 + ((launcherdoor-geo-mg (meters 20)) (launcherdoor-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; failed to figure out what this is: -(defskelgroup *launcherdoor-maincave-sg* launcherdoor-maincave - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *launcherdoor-maincave-sg* launcherdoor-maincave launcherdoor-maincave-geo-jg -1 + ((launcherdoor-maincave-geo-mg (meters 20)) (launcherdoor-maincave-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; failed to figure out what this is: (defstate launcherdoor-closed (launcherdoor) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (if (not arg0) - (sound-play-by-name (static-sound-name "ldoor-close") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ldoor-close") ) (when *target* (case (-> *target* current-level name) (('jungle 'jungleb) - (send-event *target* 'no-load-wait 6000) + (send-event *target* 'no-load-wait (seconds 20)) ) ) ) (restore-collide-with-as (-> self root-override)) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) 0.0) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek! 0.0)) (when arg0 - (let ((v1-22 (-> self skel root-channel 0))) - (set! (-> v1-22 num-func) num-func-identity) - (set! (-> v1-22 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (set! (-> self draw force-lod) 1) ) (suspend) - (while #t + (loop (if (and *target* (= (-> *target* control unknown-surface00 name) 'launch-jump) (< (-> *target* control trans y) (-> self thresh-y)) ) (go launcherdoor-open #f) ) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) 0.0) - (set! (-> a0-13 param 1) (-> self close-speed)) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0 (-> self close-speed))) (suspend) (when (ja-done? 0) (set! (-> self draw force-lod) 1) @@ -123,31 +108,22 @@ ) (none) ) - :post - (the-as (function none :behavior launcherdoor) ja-post) + :post (the-as (function none :behavior launcherdoor) ja-post) ) ;; failed to figure out what this is: (defstate launcherdoor-open (launcherdoor) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (if (not arg0) - (sound-play-by-name (static-sound-name "ldoor-open") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ldoor-open") ) (set! (-> self draw force-lod) 0) (clear-collide-with-as (-> self root-override)) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) - (when arg0 - (let ((v1-16 (-> self skel root-channel 0))) - (set! (-> v1-16 num-func) num-func-identity) - (set! (-> v1-16 frame-num) (the float (+ (-> v1-16 frame-group data 0 length) -1))) + (ja-no-eval :num! (seek!)) + (if arg0 + (ja :num-func num-func-identity :frame-num max) ) - ) - (while #t + (loop (when (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump) (< (+ 4096.0 (-> self root-override trans y)) (-> *target* control trans y)) @@ -164,17 +140,12 @@ ) (go launcherdoor-closed #f) ) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) (-> self open-speed)) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self open-speed))) (suspend) ) (none) ) - :post - (the-as (function none :behavior launcherdoor) ja-post) + :post (the-as (function none :behavior launcherdoor) ja-post) ) ;; definition for method 11 of type launcherdoor diff --git a/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc b/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc index a86789d0b5..40dc649660 100644 --- a/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc +++ b/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc @@ -3,57 +3,57 @@ ;; definition of type nav-enemy-info (deftype nav-enemy-info (basic) - ((idle-anim int32 :offset-assert 4) - (walk-anim int32 :offset-assert 8) - (turn-anim int32 :offset-assert 12) - (notice-anim int32 :offset-assert 16) - (run-anim int32 :offset-assert 20) - (jump-anim int32 :offset-assert 24) - (jump-land-anim int32 :offset-assert 28) - (victory-anim int32 :offset-assert 32) - (taunt-anim int32 :offset-assert 36) - (die-anim int32 :offset-assert 40) - (neck-joint int32 :offset-assert 44) - (player-look-at-joint int32 :offset-assert 48) - (run-travel-speed meters :offset-assert 52) - (run-rotate-speed degrees :offset-assert 56) - (run-acceleration meters :offset-assert 60) - (run-turn-time seconds :offset-assert 64) - (walk-travel-speed meters :offset-assert 72) - (walk-rotate-speed degrees :offset-assert 76) - (walk-acceleration meters :offset-assert 80) - (walk-turn-time seconds :offset-assert 88) - (attack-shove-back meters :offset-assert 96) - (attack-shove-up meters :offset-assert 100) - (shadow-size meters :offset-assert 104) - (notice-nav-radius meters :offset-assert 108) - (nav-nearest-y-threshold meters :offset-assert 112) - (notice-distance meters :offset-assert 116) - (proximity-notice-distance meters :offset-assert 120) - (stop-chase-distance meters :offset-assert 124) - (frustration-distance meters :offset-assert 128) - (frustration-time time-frame :offset-assert 136) - (die-anim-hold-frame float :offset-assert 144) - (jump-anim-start-frame float :offset-assert 148) - (jump-land-anim-end-frame float :offset-assert 152) - (jump-height-min meters :offset-assert 156) - (jump-height-factor float :offset-assert 160) - (jump-start-anim-speed float :offset-assert 164) - (shadow-max-y meters :offset-assert 168) - (shadow-min-y meters :offset-assert 172) - (shadow-locus-dist meters :offset-assert 176) - (use-align symbol :offset-assert 180) - (draw-shadow symbol :offset-assert 184) - (move-to-ground symbol :offset-assert 188) - (hover-if-no-ground symbol :offset-assert 192) - (use-momentum symbol :offset-assert 196) - (use-flee symbol :offset-assert 200) - (use-proximity-notice symbol :offset-assert 204) - (use-jump-blocked symbol :offset-assert 208) - (use-jump-patrol symbol :offset-assert 212) - (gnd-collide-with uint64 :offset-assert 216) - (debug-draw-neck symbol :offset-assert 224) - (debug-draw-jump symbol :offset-assert 228) + ((idle-anim int32 :offset-assert 4) + (walk-anim int32 :offset-assert 8) + (turn-anim int32 :offset-assert 12) + (notice-anim int32 :offset-assert 16) + (run-anim int32 :offset-assert 20) + (jump-anim int32 :offset-assert 24) + (jump-land-anim int32 :offset-assert 28) + (victory-anim int32 :offset-assert 32) + (taunt-anim int32 :offset-assert 36) + (die-anim int32 :offset-assert 40) + (neck-joint int32 :offset-assert 44) + (player-look-at-joint int32 :offset-assert 48) + (run-travel-speed meters :offset-assert 52) + (run-rotate-speed degrees :offset-assert 56) + (run-acceleration meters :offset-assert 60) + (run-turn-time seconds :offset-assert 64) + (walk-travel-speed meters :offset-assert 72) + (walk-rotate-speed degrees :offset-assert 76) + (walk-acceleration meters :offset-assert 80) + (walk-turn-time seconds :offset-assert 88) + (attack-shove-back meters :offset-assert 96) + (attack-shove-up meters :offset-assert 100) + (shadow-size meters :offset-assert 104) + (notice-nav-radius meters :offset-assert 108) + (nav-nearest-y-threshold meters :offset-assert 112) + (notice-distance meters :offset-assert 116) + (proximity-notice-distance meters :offset-assert 120) + (stop-chase-distance meters :offset-assert 124) + (frustration-distance meters :offset-assert 128) + (frustration-time time-frame :offset-assert 136) + (die-anim-hold-frame float :offset-assert 144) + (jump-anim-start-frame float :offset-assert 148) + (jump-land-anim-end-frame float :offset-assert 152) + (jump-height-min meters :offset-assert 156) + (jump-height-factor float :offset-assert 160) + (jump-start-anim-speed float :offset-assert 164) + (shadow-max-y meters :offset-assert 168) + (shadow-min-y meters :offset-assert 172) + (shadow-locus-dist meters :offset-assert 176) + (use-align symbol :offset-assert 180) + (draw-shadow symbol :offset-assert 184) + (move-to-ground symbol :offset-assert 188) + (hover-if-no-ground symbol :offset-assert 192) + (use-momentum symbol :offset-assert 196) + (use-flee symbol :offset-assert 200) + (use-proximity-notice symbol :offset-assert 204) + (use-jump-blocked symbol :offset-assert 208) + (use-jump-patrol symbol :offset-assert 212) + (gnd-collide-with collide-kind :offset-assert 216) + (debug-draw-neck symbol :offset-assert 224) + (debug-draw-jump symbol :offset-assert 228) ) :method-count-assert 9 :size-assert #xe8 @@ -141,7 +141,7 @@ (state-timeout time-frame :offset-assert 352) (free-time time-frame :offset-assert 360) (touch-time time-frame :offset-assert 368) - (nav-enemy-flags uint32 :offset-assert 376) + (nav-enemy-flags nav-enemy-flags :offset-assert 376) (incomming-attack-id handle :offset-assert 384) (jump-return-state (state process) :offset-assert 392) (rand-gen random-generator :offset-assert 396) diff --git a/test/decompiler/reference/levels/common/nav-enemy_REF.gc b/test/decompiler/reference/levels/common/nav-enemy_REF.gc index 103119cac7..89e9076527 100644 --- a/test/decompiler/reference/levels/common/nav-enemy_REF.gc +++ b/test/decompiler/reference/levels/common/nav-enemy_REF.gc @@ -79,14 +79,18 @@ ;; definition for method 39 of type nav-enemy ;; INFO: Return type mismatch int vs none. (defmethod common-post nav-enemy ((obj nav-enemy)) - (when (and (logtest? (-> obj nav-enemy-flags) 256) - (or (not *target*) (and (zero? (logand (-> *target* state-flags) #x80f8)) - (>= (- (-> *display* base-frame-counter) (-> obj touch-time)) (seconds 0.05)) + (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)) + (or (not *target*) + (and (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) + ) + (>= (- (-> *display* base-frame-counter) (-> obj touch-time)) (seconds 0.05)) + ) ) ) (set-collide-offense (-> obj collide-info) 2 (collide-offense touch)) - (set! (-> obj nav-enemy-flags) (logand -257 (-> obj nav-enemy-flags))) + (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)) ) (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) (when *target* @@ -94,13 +98,13 @@ (look-at-enemy! (-> *target* neck) (the-as vector (-> obj collide-info root-prim prim-core)) - (if (logtest? (-> obj nav-enemy-flags) 4) + (if (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf2)) 'attacking ) obj ) ) - (if (and (nonzero? (-> obj neck)) (logtest? (-> obj nav-enemy-flags) #x4000)) + (if (and (nonzero? (-> obj neck)) (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf14))) (set-target! (-> obj neck) (target-pos (-> obj nav-info player-look-at-joint))) ) ) @@ -116,11 +120,12 @@ ;; definition for method 44 of type nav-enemy (defmethod dummy-44 nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) ) @@ -128,11 +133,12 @@ ;; definition for method 72 of type nav-enemy (defmethod nav-enemy-touch-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) ) @@ -150,7 +156,7 @@ ;; definition for method 43 of type nav-enemy (defmethod dummy-43 nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) (cond - ((logtest? (-> obj nav-enemy-flags) 32) + ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) (send-event arg0 'get-attack-count 1) (logclear! (-> obj mask) (process-mask actor-pause attackable)) (go (method-of-object obj nav-enemy-die)) @@ -164,23 +170,20 @@ ;; definition for function nav-enemy-send-attack ;; INFO: Return type mismatch symbol vs object. (defbehavior nav-enemy-send-attack nav-enemy ((arg0 process) (arg1 touching-shapes-entry) (arg2 symbol)) - (let ((v1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-0 from) self) - (set! (-> v1-0 num-params) 2) - (set! (-> v1-0 message) 'attack) - (set! (-> v1-0 param 0) (the-as uint arg1)) - (let ((a1-1 (new 'static 'attack-info :mask #xe0))) - (set! (-> a1-1 shove-back) (-> self nav-info attack-shove-back)) - (set! (-> a1-1 shove-up) (-> self nav-info attack-shove-up)) - (set! (-> a1-1 mode) arg2) - (set! (-> v1-0 param 1) (the-as uint a1-1)) - ) - (the-as object (when (send-event-function arg0 v1-0) - (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) 256) - #t - ) + (the-as + object + (when (send-event + arg0 + 'attack + arg1 + (static-attack-info + ((shove-back (-> self nav-info attack-shove-back)) (shove-up (-> self nav-info attack-shove-up)) (mode arg2)) + ) ) + (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) + #t + ) ) ) @@ -215,9 +218,9 @@ ) ) (('cue-jump-to-point) - (when (logtest? (-> self nav-enemy-flags) 2048) + (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) (set! (-> self event-param-point quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> self nav-enemy-flags) (logand -2049 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) ) ) (('cue-chase) @@ -273,7 +276,7 @@ nav-enemy-default-event-handler ;; definition for function nav-enemy-simple-post ;; INFO: Return type mismatch int vs none. (defbehavior nav-enemy-simple-post nav-enemy () - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (nav-enemy-common-post) (update-transforms! (-> self collide-info)) 0 @@ -294,9 +297,9 @@ nav-enemy-default-event-handler (defmethod dummy-41 nav-enemy ((obj nav-enemy)) (cond ((-> obj nav-info use-align) - (TODO-RENAME-11 + (align-vel-and-quat-only! (-> obj align) - 4 + (align-opts adjust-xz-vel) (-> obj nav travel) (the-as int 1.0) 1.0 @@ -344,8 +347,10 @@ nav-enemy-default-event-handler ;; definition for method 37 of type nav-enemy ;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-37 nav-enemy ((obj nav-enemy)) - (when (logtest? (-> obj nav-enemy-flags) 16) - (if (or (logtest? (-> obj nav-enemy-flags) 128) (logtest? (nav-control-flags bit19) (-> obj nav flags))) + (when (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags enable-travel)) + (if (or (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf7)) + (logtest? (nav-control-flags navcf19) (-> obj nav flags)) + ) (seek-to-point-toward-point! (-> obj collide-info) (-> obj nav target-pos) @@ -366,11 +371,11 @@ nav-enemy-default-event-handler (integrate-for-enemy-with-move-to-ground! (-> obj collide-info) (-> obj collide-info transv) - (the-as collide-kind (-> obj nav-info gnd-collide-with)) + (-> obj nav-info gnd-collide-with) 8192.0 #f (-> obj nav-info hover-if-no-ground) - (logtest? (-> obj nav-enemy-flags) #x8000) + (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf15)) ) (dummy-58 (-> obj collide-info) (-> obj collide-info transv)) ) @@ -382,8 +387,8 @@ nav-enemy-default-event-handler ;; INFO: Return type mismatch int vs none. (defbehavior nav-enemy-travel-post nav-enemy () (cond - ((logtest? (-> self nav-enemy-flags) 8) - (TODO-RENAME-9 (-> self align)) + ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (compute-alignment! (-> self align)) (dummy-40 self) (dummy-41 self) (TODO-RENAME-37 self) @@ -415,9 +420,9 @@ nav-enemy-default-event-handler ;; definition for function nav-enemy-patrol-post ;; INFO: Return type mismatch int vs none. (defbehavior nav-enemy-patrol-post nav-enemy () - (when (or (logtest? (nav-control-flags bit19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) + (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) (set! (-> self nav block-count) 2.0) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (nav-enemy-get-new-patrol-point) ) (dummy-19 @@ -427,8 +432,8 @@ nav-enemy-default-event-handler (-> self nav destination-pos) (-> self rotate-speed) ) - (if (logtest? (nav-control-flags bit21) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit10)) + (if (logtest? (nav-control-flags navcf21) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (nav-enemy-travel-post) 0 @@ -467,7 +472,7 @@ nav-enemy-default-event-handler ;; definition for function nav-enemy-face-player-post ;; INFO: Return type mismatch int vs none. (defbehavior nav-enemy-face-player-post nav-enemy () - (if (and *target* (logtest? (-> self nav-enemy-flags) 16)) + (if (and *target* (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))) (seek-to-point-toward-point! (-> self collide-info) (target-pos 0) (-> self rotate-speed) (-> self turn-time)) ) (nav-enemy-simple-post) @@ -510,7 +515,7 @@ nav-enemy-default-event-handler ;; definition for function nav-enemy-neck-control-look-at ;; INFO: Return type mismatch int vs none. (defbehavior nav-enemy-neck-control-look-at nav-enemy () - (logior! (-> self nav-enemy-flags) #x4000) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf14)) (if (nonzero? (-> self neck)) (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) ) @@ -521,8 +526,8 @@ nav-enemy-default-event-handler ;; definition for function nav-enemy-neck-control-inactive ;; INFO: Return type mismatch int vs none. (defbehavior nav-enemy-neck-control-inactive nav-enemy () - (when (and (nonzero? (-> self neck)) (logtest? (-> self nav-enemy-flags) #x4000)) - (set! (-> self nav-enemy-flags) (logand -16385 (-> self nav-enemy-flags))) + (when (and (nonzero? (-> self neck)) (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf14))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf14)) (shut-down! (-> self neck)) ) 0 @@ -532,14 +537,25 @@ nav-enemy-default-event-handler ;; definition for function nav-enemy-player-vulnerable? ;; INFO: Return type mismatch basic vs symbol. (defun nav-enemy-player-vulnerable? () - (the-as symbol (and *target* (zero? (logand (-> *target* state-flags) #x80f8)))) + (the-as + symbol + (and *target* + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + ) + ) ) ;; definition for method 46 of type nav-enemy (defmethod TODO-RENAME-46 nav-enemy ((obj nav-enemy) (arg0 float)) (and *target* - (zero? (logand (-> *target* state-flags) #x80f8)) - (and (or (zero? (logand (-> obj nav-enemy-flags) 4096)) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + (and (or (zero? (logand (-> obj nav-enemy-flags) (nav-enemy-flags navenmf12))) (< (vector-vector-distance (target-pos 0) (-> obj collide-info trans)) arg0) ) (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos)) @@ -551,10 +567,10 @@ nav-enemy-default-event-handler (defbehavior nav-enemy-notice-player? nav-enemy () (let ((gp-0 #f)) (cond - ((logtest? (-> self nav-enemy-flags) 1) + ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (when (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (-> self reaction-time)) (set! gp-0 #t) - (set! (-> self nav-enemy-flags) (logand -2 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) ) ) (else @@ -566,7 +582,7 @@ nav-enemy-default-event-handler ) ) ) - (logior! (-> self nav-enemy-flags) 1) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (set! (-> self notice-time) (-> *display* base-frame-counter)) ) ) @@ -716,19 +732,16 @@ nav-enemy-default-event-handler (vector-xz-normalize! (-> self hit-from-dir) 1.0) ) (set! (-> self collide-info transv y) 65502.96) - (let ((v1-14 (-> self skel root-channel 0))) - (set! (-> v1-14 num-func) num-func-identity) - (set! (-> v1-14 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self collide-info status) (logand -8 (-> self collide-info status))) + (logclear! (-> self collide-info status) (cshape-moving-flags onsurf onground tsurf)) (until (ja-done? 0) (cond ((nonzero? (-> self align)) (when (not s4-1) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 4098 1.0 arg1 1.0) - (when (zero? (logand (-> self align flags) 1)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel ignore-y-if-zero) 1.0 arg1 1.0) + (when (zero? (logand (-> self align flags) (align-flags disabled))) (let ((f0-6 (* (- (-> self align delta trans z)) (-> *display* frames-per-second)))) (set! (-> self collide-info transv x) (* (-> self hit-from-dir x) f0-6)) (set! (-> self collide-info transv z) (* (-> self hit-from-dir z) f0-6)) @@ -744,11 +757,7 @@ nav-enemy-default-event-handler ) ) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) arg2) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max arg2)) ) ) ) @@ -761,22 +770,12 @@ nav-enemy-default-event-handler (defbehavior nav-enemy-turn-to-face-dir nav-enemy ((arg0 vector) (arg1 float)) (local-vars (v1-16 symbol)) (let ((s4-0 (-> *display* base-frame-counter))) - (let ((v1-3 (-> self skel root-channel 0))) - (set! (-> v1-3 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info turn-anim))) - ) - ) - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 num-func) num-func-identity) - (set! (-> v1-6 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data (-> self nav-info turn-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (until v1-16 (seek-toward-heading-vec! (-> self collide-info) arg0 (-> self rotate-speed) (-> self turn-time)) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) 0.75) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! 0.75)) (set! v1-16 (or (>= (- (-> *display* base-frame-counter) s4-0) (seconds 10)) (nav-enemy-facing-direction? arg0 arg1)) ) @@ -820,30 +819,21 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-idle (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (nav-enemy-neck-control-inactive) (set! (-> self state-time) (-> *display* base-frame-counter)) (if (-> self nav-info move-to-ground) - (move-to-ground - (-> self collide-info) - 40960.0 - 40960.0 - #t - (the-as collide-kind (-> self nav-info gnd-collide-with)) - ) + (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (-> self nav-info gnd-collide-with)) ) - (set! (-> self nav-enemy-flags) (logand -7 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1 navenmf2)) (set! (-> self state-timeout) (seconds 1)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (and *target* (>= (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) @@ -856,49 +846,35 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! (-> self draw art-group data (-> self nav-info idle-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (let ((f30-0 (nav-enemy-rnd-float-range 0.75 1.25))) - (while #t + (loop (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) ) - :post - (the-as (function none :behavior nav-enemy) ja-post) + :post (the-as (function none :behavior nav-enemy) ja-post) ) ;; failed to figure out what this is: (defstate nav-enemy-patrol (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self nav flags) - (the-as nav-control-flags (the-as int (logior (nav-control-flags bit19) (-> self nav flags)))) + (the-as nav-control-flags (the-as int (logior (nav-control-flags navcf19) (-> self nav flags)))) ) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 8) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (set! (-> self state-timeout) (seconds 1)) (set! (-> self target-speed) (-> self nav-info walk-travel-speed)) (set! (-> self acceleration) (-> self nav-info walk-acceleration)) @@ -906,13 +882,11 @@ nav-enemy-default-event-handler (set! (-> self turn-time) (-> self nav-info walk-turn-time)) (none) ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 8) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status was-drawn))) @@ -932,14 +906,8 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (let ((gp-0 'racer) - (a1-2 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 1) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'mode)) - (= gp-0 (send-event-function *target* a1-2)) + (let ((gp-0 'racer)) + (= gp-0 (send-event *target* 'query 'mode)) ) ) ) @@ -951,152 +919,74 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-1 param 1) f30-0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) f30-0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (when (nav-enemy-rnd-go-idle? 0.2) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 180) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - (set! (-> a0-8 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-8 param 1) f30-0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! - a0-8 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-seek! - ) - ) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) f30-0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (until (not (nav-enemy-rnd-go-idle? 0.2)) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - (set! (-> a0-11 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-11 param 1) f30-0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! - a0-11 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) f30-0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - ) - (logior! (-> self nav-enemy-flags) 8) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) 1.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 180) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-17 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-17 param 1) f30-0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! - a0-17 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! + (ja :num! (seek! max f30-0)) ) ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) f30-0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) ) (none) ) - :post - nav-enemy-patrol-post + :post nav-enemy-patrol-post ) ;; failed to figure out what this is: (defstate nav-enemy-notice (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () - (logior! (-> self nav-enemy-flags) 4) + :enter (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-neck-control-look-at) - (if (logtest? (-> self nav-enemy-flags) 2) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-chase) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (let ((gp-0 (-> self nav)) (v1-10 (target-pos 0)) ) @@ -1107,27 +997,13 @@ nav-enemy-default-event-handler (set! (-> self turn-time) (-> self nav-info run-turn-time)) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - ) - (set! (-> a0-2 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info notice-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (seek-toward-heading-vec! (-> self collide-info) @@ -1136,57 +1012,39 @@ nav-enemy-default-event-handler (-> self turn-time) ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) f30-0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (go-virtual nav-enemy-chase) (none) ) - :post - nav-enemy-simple-post + :post nav-enemy-simple-post ) ;; definition for function ja-group-index? (defbehavior ja-group-index? nav-enemy ((arg0 int)) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data arg0) - ) + (ja-group? (-> self draw art-group data arg0)) ) ;; failed to figure out what this is: (defstate nav-enemy-flee (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-time)) (if (or (or (not *target*) (< (-> self nav-info stop-chase-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (let ((gp-0 'racer) - (a1-1 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'mode)) - (!= gp-0 (send-event-function *target* a1-1)) + (let ((gp-0 'racer)) + (!= gp-0 (send-event *target* 'query 'mode)) ) ) (go-virtual nav-enemy-patrol) @@ -1194,75 +1052,39 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (ja-channel-push! 1 60) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - ) - (set! (-> a0-2 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info notice-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) - (ja-channel-push! 1 60) - (while #t - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - (set! (-> a0-6 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-6 param 1) f30-0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.2)) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) f30-0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) (none) ) - :post - nav-enemy-face-player-post + :post nav-enemy-face-player-post ) ;; definition for function nav-enemy-reset-frustration ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (defbehavior nav-enemy-reset-frustration nav-enemy () - (set! (-> self nav-enemy-flags) (logand -8193 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) (if *target* (set! (-> self frustration-point quad) (-> *target* control shadow-pos quad)) ) @@ -1280,23 +1102,23 @@ nav-enemy-default-event-handler ;; definition for function nav-enemy-frustrated? (defbehavior nav-enemy-frustrated? nav-enemy () - (and (logtest? (-> self nav-enemy-flags) 8192) (nav-enemy-player-at-frustration-point?)) + (and (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) + (nav-enemy-player-at-frustration-point?) + ) ) ;; failed to figure out what this is: (defstate nav-enemy-chase (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (nav-enemy-neck-control-look-at) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self free-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (set! (-> self target-speed) (-> self nav-info run-travel-speed)) (set! (-> self acceleration) (-> self nav-info run-acceleration)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) @@ -1304,12 +1126,11 @@ nav-enemy-default-event-handler (nav-enemy-reset-frustration) (none) ) - :trans - (behavior () - (if (logtest? (-> *target* state-flags) 128) + :trans (behavior () + (if (logtest? (-> *target* state-flags) (state-flags do-not-notice)) (go-virtual nav-enemy-patrol) ) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory) ) (if (or (not (nav-enemy-player-at-frustration-point?)) @@ -1323,15 +1144,15 @@ nav-enemy-default-event-handler (if (>= (- (-> *display* base-frame-counter) (-> self frustration-time)) (+ (-> self reaction-time) (-> self nav-info frustration-time)) ) - (logior! (-> self nav-enemy-flags) 8192) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) ) (if (or (not (TODO-RENAME-46 self (-> self nav-info stop-chase-distance))) - (logtest? (-> self nav-enemy-flags) 8192) + (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) ) (go-virtual nav-enemy-stop-chase) ) (cond - ((logtest? (nav-control-flags bit17) (-> self nav flags)) + ((logtest? (nav-control-flags navcf17) (-> self nav flags)) (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 1)) (go-virtual nav-enemy-patrol) ) @@ -1343,41 +1164,29 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim)))) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (while #t + (loop (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) ) - :post - nav-enemy-chase-post + :post nav-enemy-chase-post ) ;; failed to figure out what this is: (defstate nav-enemy-stop-chase (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (let* ((f30-0 (vector-vector-distance (-> self collide-info trans) (target-pos 0))) (gp-1 (the int (+ (lerp-scale 600.0 1800.0 f30-0 32768.0 122880.0) (nav-enemy-rnd-float-range 0.0 30.0)))) @@ -1393,10 +1202,9 @@ nav-enemy-default-event-handler (set! (-> self turn-time) (-> self nav-info walk-turn-time)) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (if (logtest? (-> *target* state-flags) 128) + (if (logtest? (-> *target* state-flags) (state-flags do-not-notice)) (go-virtual nav-enemy-patrol) ) (if (and (TODO-RENAME-46 self (-> self nav-info notice-distance)) (not (nav-enemy-frustrated?))) @@ -1406,7 +1214,7 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (logtest? (nav-control-flags bit17) (-> self nav flags)) + (logtest? (nav-control-flags navcf17) (-> self nav flags)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) ) (go-virtual nav-enemy-stare) @@ -1414,45 +1222,31 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self nav-info walk-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (while #t + (loop (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) ) - :post - nav-enemy-chase-post + :post nav-enemy-chase-post ) ;; failed to figure out what this is: (defstate nav-enemy-stare (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((f0-0 (vector-vector-distance (-> self collide-info trans) (target-pos 0)))) (set! (-> self state-timeout) (the-as @@ -1466,15 +1260,13 @@ nav-enemy-default-event-handler (set! (-> self collide-info transv quad) (-> *null-vector* quad)) (none) ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 16) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (if (logtest? (-> *target* state-flags) 128) + (if (logtest? (-> *target* state-flags) (state-flags do-not-notice)) (go-virtual nav-enemy-patrol) ) (cond @@ -1489,17 +1281,16 @@ nav-enemy-default-event-handler (set! (-> self notice-time) (-> *display* base-frame-counter)) ) ) - (when (not - (or (and *target* (>= 40960.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) - (and (-> self nav-info use-proximity-notice) - *target* - (>= (-> self nav-info proximity-notice-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) - ) - ) - ) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) + (when (not (or (and *target* (>= 40960.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) + (and (-> self nav-info use-proximity-notice) + *target* + (>= (-> self nav-info proximity-notice-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) + ) + ) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) (go-virtual nav-enemy-give-up) ) @@ -1508,39 +1299,34 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (logtest? (nav-control-flags bit17) (-> self nav flags)) + (logtest? (nav-control-flags navcf17) (-> self nav flags)) ) (go-virtual nav-enemy-give-up) ) ) (none) ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-give-up) (none) ) - :post - nav-enemy-face-player-post + :post nav-enemy-face-player-post ) ;; failed to figure out what this is: (defstate nav-enemy-give-up (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (nav-enemy-neck-control-inactive) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (if (TODO-RENAME-46 self (-> self nav-info notice-distance)) (go-virtual nav-enemy-chase) @@ -1548,100 +1334,69 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-patrol) (none) ) - :post - nav-enemy-simple-post + :post nav-enemy-simple-post ) ;; failed to figure out what this is: (defstate nav-enemy-attack (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-victory) (none) ) - :post - nav-enemy-simple-post + :post nav-enemy-simple-post ) ;; failed to figure out what this is: (defstate nav-enemy-victory (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self collide-info transv quad) (-> *null-vector* quad)) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - ) - (set! (-> a0-2 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) data 0 length) - -1 - ) - ) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info victory-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (go-virtual nav-enemy-stare) (none) ) - :post - nav-enemy-simple-post + :post nav-enemy-simple-post ) ;; failed to figure out what this is: (defstate nav-enemy-die (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) process-drawable-death-event-handler ) - :enter - (behavior () + :enter (behavior () (send-event (ppointer->process (-> self parent)) 'child-die) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (clear-collide-with-as (-> self collide-info)) (nav-enemy-fall-and-play-death-anim (the-as art-joint-anim (-> self draw art-group data (-> self nav-info die-anim))) @@ -1660,20 +1415,17 @@ nav-enemy-default-event-handler (cleanup-for-death self) (none) ) - :post - nav-enemy-death-post + :post nav-enemy-death-post ) ;; failed to figure out what this is: (defstate nav-enemy-fuel-cell (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) process-drawable-fuel-cell-handler ) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self collide-info)) (ja-post) @@ -1705,7 +1457,7 @@ nav-enemy-default-event-handler ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (defbehavior nav-enemy-jump-post nav-enemy () - (if (logtest? (-> self nav-enemy-flags) 16) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (seek-to-point-toward-point! (-> self collide-info) (-> self jump-dest) @@ -1713,7 +1465,7 @@ nav-enemy-default-event-handler (-> self turn-time) ) ) - (when (logtest? (-> self nav-enemy-flags) 8) + (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((f30-0 (the float (- (-> *display* base-frame-counter) (-> self jump-time))))) (let ((v1-12 (eval-position! (-> self jump-trajectory) f30-0 (new 'stack-no-clear 'vector)))) (set! (-> self collide-info trans quad) (-> v1-12 quad)) @@ -1744,24 +1496,24 @@ nav-enemy-default-event-handler (set! (-> s2-2 y) 0.0) (vector-xz-normalize! s1-1 1.0) (vector-xz-normalize! s2-2 1.0) - (set! (-> self nav-enemy-flags) (logand -1537 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump drop-jump)) (if (or (>= (* 0.5 (-> self nav-info run-travel-speed)) f24-0) (>= (cos 3640.889) (vector-dot s1-1 s2-2))) - (logior! (-> self nav-enemy-flags) 512) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) ) ) (if (or (and (< f26-0 0.0) (< f28-0 (fabs f26-0))) (and (< (fabs f26-0) 12288.0) (< f28-0 20480.0))) - (logior! (-> self nav-enemy-flags) 1024) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) ) ) - (when (and arg1 (logtest? (-> self nav-enemy-flags) 1024)) - (set! (-> self nav-enemy-flags) (logand -513 (-> self nav-enemy-flags))) + (when (and arg1 (logtest? (-> self nav-enemy-flags) (nav-enemy-flags drop-jump))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) (set! f30-0 2048.0) ) (setup-from-to-height! (-> self jump-trajectory) s4-0 arg0 f30-0 (* 0.000011111111 arg4)) ) (set! (-> self nav extra-nav-sphere quad) (-> arg0 quad)) (set! (-> self nav extra-nav-sphere w) (-> self collide-info nav-radius)) - (logior! (-> self collide-info nav-flags) 2) + (logior! (-> self collide-info nav-flags) (nav-flags navf1)) 0 (none) ) @@ -1784,87 +1536,48 @@ nav-enemy-default-event-handler ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (defbehavior nav-enemy-execute-custom-jump nav-enemy ((arg0 int) (arg1 float) (arg2 float)) - (when (logtest? (-> self nav-enemy-flags) 512) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 1.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 30) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) - (let ((s3-0 (-> self skel root-channel 0))) - (set! (-> s3-0 frame-group) (the-as art-joint-anim (-> self draw art-group data arg0))) - (set! (-> s3-0 param 0) (ja-aframe arg1 0)) - (set! (-> s3-0 param 1) arg2) - (set! (-> s3-0 frame-num) 0.0) - (joint-control-channel-group! s3-0 (the-as art-joint-anim (-> self draw art-group data arg0)) num-func-seek!) - ) + (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.1)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (ja-no-eval :group! (-> self draw art-group data arg0) :num! (seek! (ja-aframe arg1 0) arg2) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((s3-1 (-> self skel root-channel 0))) - (set! (-> s3-1 param 0) (ja-aframe arg1 0)) - (set! (-> s3-1 param 1) arg2) - (joint-control-channel-group-eval! s3-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe arg1 0) arg2)) ) ) - (set! (-> self collide-info status) (logand -8 (-> self collide-info status))) + (logclear! (-> self collide-info status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self jump-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 8) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (cond - ((logtest? (-> self nav-enemy-flags) 1024) + ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data (-> self nav-info run-anim)) - ) + ((ja-group? (-> self draw art-group data (-> self nav-info run-anim))) ) (else - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) 1.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 30) - (let ((v1-39 (-> self skel root-channel 0))) - (set! (-> v1-39 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - ) - ) - (let ((v1-42 (-> self skel root-channel 0))) - (set! (-> v1-42 num-func) num-func-identity) - (set! (-> v1-42 frame-num) 0.0) - ) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) ) ) ) (else - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 param 0) 1.0) - (joint-control-channel-group! a0-30 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 30) - (let ((v1-49 (-> self skel root-channel 0))) - (set! (-> v1-49 frame-group) (the-as art-joint-anim (-> self draw art-group data arg0))) - ) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 num-func) num-func-identity) - (set! (-> s5-1 frame-num) (ja-aframe arg1 0)) - ) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data arg0)) + (ja :num-func num-func-identity :frame-num (ja-aframe arg1 0)) ) ) (while (< (the float (- (-> *display* base-frame-counter) (-> self jump-time))) (-> self jump-trajectory time)) (suspend) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1))) - (set! (-> a0-36 param 1) 1.0) - (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (ja-blend-eval) ) (set! (-> self collide-info trans quad) (-> self jump-dest quad)) (set! (-> self collide-info transv y) 0.0) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) 0 (none) ) @@ -1884,39 +1597,16 @@ nav-enemy-default-event-handler ;; definition for function nav-enemy-jump-land-anim ;; INFO: Return type mismatch int vs none. (defbehavior nav-enemy-jump-land-anim nav-enemy () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 22) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - ) - (set! (-> a0-2 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) data 0 length) - -1 - ) - ) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - num-func-seek! - ) - ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info jump-land-anim)) + :num! (seek!) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) 0 (none) @@ -1925,10 +1615,8 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-jump (nav-enemy) :virtual #t - :event - nav-enemy-jump-event-handler - :enter - (behavior () + :event nav-enemy-jump-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (if (and (-> self nav-info use-jump-blocked) (TODO-RENAME-50 self (-> self event-param-point))) (go-virtual nav-enemy-jump-blocked) @@ -1936,13 +1624,11 @@ nav-enemy-default-event-handler (nav-enemy-initialize-jump (-> self event-param-point)) (none) ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 24) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) - :code - (behavior () + :code (behavior () (nav-enemy-execute-jump) (let ((a1-0 (-> self nav user-poly))) (if (not a1-0) @@ -1955,16 +1641,15 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-jump-land) (none) ) - :post - nav-enemy-jump-post + :post nav-enemy-jump-post ) ;; definition for function nav-enemy-jump-land-post ;; Used lq/sq (defbehavior nav-enemy-jump-land-post nav-enemy () - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (dummy-11 (-> self nav) (-> self nav target-pos)) - (set! (-> self target-speed) (seek (-> self target-speed) (-> self nav-info run-travel-speed) 2048.0)) + (seek! (-> self target-speed) (-> self nav-info run-travel-speed) 2048.0) (set! (-> self momentum-speed) (-> self target-speed)) (let* ((f0-7 (fmin @@ -1977,7 +1662,9 @@ nav-enemy-default-event-handler (set! (-> self collide-info transv x) (-> v1-9 x)) (set! (-> self collide-info transv z) (-> v1-9 z)) ) - (if (or (logtest? (-> self nav-enemy-flags) 128) (logtest? (nav-control-flags bit19) (-> self nav flags))) + (if (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf7)) + (logtest? (nav-control-flags navcf19) (-> self nav flags)) + ) (seek-to-point-toward-point! (-> self collide-info) (-> self nav target-pos) @@ -1998,7 +1685,7 @@ nav-enemy-default-event-handler (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) - (the-as collide-kind (-> self nav-info gnd-collide-with)) + (-> self nav-info gnd-collide-with) 8192.0 #f (-> self nav-info hover-if-no-ground) @@ -2011,15 +1698,13 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-jump-land (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logclear! (-> self nav flags) (nav-control-flags bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self collide-info transv quad)) (set! (-> gp-0 y) 0.0) @@ -2030,130 +1715,82 @@ nav-enemy-default-event-handler ) (none) ) - :trans - (behavior () + :trans (behavior () (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (logtest? (nav-control-flags bit19) (-> self nav flags)) + (logtest? (nav-control-flags navcf19) (-> self nav flags)) ) (go-virtual nav-enemy-chase) ) (none) ) - :code - (behavior () + :code (behavior () (nav-enemy-jump-land-anim) (go (-> self jump-return-state)) (none) ) - :post - nav-enemy-jump-land-post + :post nav-enemy-jump-land-post ) ;; failed to figure out what this is: (defstate nav-enemy-jump-blocked (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) (go (-> self jump-return-state)) ) (none) ) - :code - (behavior () - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data (-> self nav-info idle-anim)) - ) - ) - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-identity + :code (behavior () + (when (not (ja-group? (-> self draw art-group data (-> self nav-info idle-anim)))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) ) - (set! (-> gp-0 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - ) ) (let ((f30-0 (nav-enemy-rnd-float-range 0.75 1.25))) - (while #t + (loop (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) f30-0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) ) - :post - nav-enemy-simple-post + :post nav-enemy-simple-post ) ;; failed to figure out what this is: (defstate nav-enemy-wait-for-cue (nav-enemy) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior nav-enemy) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 2048) - (ja-channel-push! 1 30) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) + (ja-channel-push! 1 (seconds 0.1)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - ) - (let ((v1-9 (-> self skel root-channel 0))) - (set! (-> v1-9 num-func) num-func-identity) - (set! (-> v1-9 frame-num) 0.0) - ) - (while (logtest? (-> self nav-enemy-flags) 2048) + (ja :group! (-> self draw art-group data (-> self nav-info idle-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (while (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (nav-enemy-turn-to-face-point (-> self event-param-point) 910.2222) (let ((gp-0 (nav-enemy-rnd-int-range 0 150)) (s5-0 (-> *display* base-frame-counter)) ) (until (>= (- (-> *display* base-frame-counter) s5-0) gp-0) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) f30-0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) (suspend) ) ) @@ -2161,55 +1798,46 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-jump-to-point) (none) ) - :post - nav-enemy-simple-post + :post nav-enemy-simple-post ) ;; failed to figure out what this is: (defstate nav-enemy-jump-to-point (nav-enemy) :virtual #t - :event - nav-enemy-jump-event-handler - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 24) + :event nav-enemy-jump-event-handler + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) - :trans - (behavior () + :trans (behavior () 0 (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (nav-enemy-initialize-jump (-> self event-param-point)) (nav-enemy-neck-control-look-at) - (logior! (-> self nav-enemy-flags) 16) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (when (not (nav-enemy-facing-point? (-> self jump-dest) 5461.3335)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (nav-enemy-jump-land-anim) (go-virtual nav-enemy-wait-for-cue) (none) ) - :post - nav-enemy-jump-post + :post nav-enemy-jump-post ) ;; definition for symbol *nav-enemy-dummy-shadow-control*, type shadow-control -(define - *nav-enemy-dummy-shadow-control* +(define *nav-enemy-dummy-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #x28)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 614400.0) + :flags (shadow-flags shdf03 disable-draw) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) :bot-plane (new 'static 'plane :y 1.0 :w 4096.0) :top-plane (new 'static 'plane :y 1.0 :w -4096.0) ) @@ -2239,7 +1867,7 @@ nav-enemy-default-event-handler ) (set! (-> obj align) (new 'process 'align-control obj)) (set! (-> obj nav) (new 'process 'nav-control (-> obj collide-info) 16 (-> arg0 nav-nearest-y-threshold))) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav gap-event) 'jump) (TODO-RENAME-26 (-> obj nav)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) @@ -2249,7 +1877,7 @@ nav-enemy-default-event-handler ) (set! (-> obj reaction-time) (nav-enemy-rnd-int-range (seconds 0.1) (seconds 0.8))) (set! (-> obj speed-scale) 1.0) - (logior! (-> obj nav-enemy-flags) 4216) + (logior! (-> obj nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel navenmf5 navenmf6 navenmf12)) 0 (none) ) @@ -2291,8 +1919,8 @@ nav-enemy-default-event-handler (vector-identity! (-> self collide-info scale)) (set! (-> self entity) (-> arg0 entity)) (TODO-RENAME-48 self) - (set! (-> self nav-enemy-flags) (logand -4097 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 2) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf12)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-wait-for-cue) (none) ) diff --git a/test/decompiler/reference/levels/common/orb-cache_REF.gc b/test/decompiler/reference/levels/common/orb-cache_REF.gc index 8c9651bcf7..cdb80d8835 100644 --- a/test/decompiler/reference/levels/common/orb-cache_REF.gc +++ b/test/decompiler/reference/levels/common/orb-cache_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/orb-cache-top-ag.gc") + ;; definition of type orb-cache-top (deftype orb-cache-top (baseplat) ((active-distance float :offset-assert 228) @@ -46,18 +48,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *orb-cache-top-sg* orb-cache-top - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *orb-cache-top-sg* orb-cache-top orb-cache-top-lod0-jg orb-cache-top-idle-ja + ((orb-cache-top-lod0-mg (meters 20)) (orb-cache-top-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; failed to figure out what this is: (defstate orb-cache-top-idle (orb-cache-top) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('eco-blue) (process-entity-status! self (entity-perm-status complete) #t) @@ -72,17 +70,9 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'powerup)) - (set! (-> a1-1 param 1) (the-as uint 3)) - (not (send-event-function *target* a1-1)) - ) + (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (level-hint-spawn (game-text-id sidekick-hint-orb-cache-top) @@ -94,10 +84,9 @@ ) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (if (and (not arg0) (-> self child)) - (sound-play-by-name (static-sound-name "close-orb-cash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "close-orb-cash") ) (dotimes (gp-1 (-> self money)) (let ((a0-4 (handle->process (-> self money-list gp-1)))) @@ -107,14 +96,7 @@ ) ) (process-entity-status! self (entity-perm-status complete) #f) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> gp-2 frame-num) (ja-aframe 0.0 0)) - ) + (ja :group! (-> self draw art-group data 3) :num! (identity (ja-aframe 0.0 0))) (transform-post) (anim-loop) (none) @@ -198,9 +180,7 @@ ) (set! s3-0 #f) ) - (set! (-> obj basetrans y) - (seek (-> obj basetrans y) (+ (-> obj root-pos) f30-0) (* 40960.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> obj basetrans y) (+ (-> obj root-pos) f30-0) (* 40960.0 (-> *display* seconds-per-frame))) (if (not (= (-> obj basetrans y) (+ (-> obj root-pos) f30-0))) (set! s5-1 #f) ) @@ -209,12 +189,11 @@ (set! (-> s4-1 quad) (-> (the-as process-drawable (handle->process (-> obj money-list s2-0))) root trans quad) ) - (set! (-> obj money-pos-actual s2-0) (seek - (-> obj money-pos-actual s2-0) - (-> obj money-pos-list s2-0) - (* 40960.0 (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> obj money-pos-actual s2-0) + (-> obj money-pos-list s2-0) + (* 40960.0 (-> *display* seconds-per-frame)) + ) (if (not (= (-> obj money-pos-actual s2-0) (-> obj money-pos-list s2-0))) (set! s5-1 #f) ) @@ -235,124 +214,97 @@ ;; failed to figure out what this is: (defstate orb-cache-top-activate (orb-cache-top) - :event - (the-as (function process int symbol event-message-block object :behavior orb-cache-top) plat-event) - :exit - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior orb-cache-top) plat-event) + :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :trans - (the-as (function none :behavior orb-cache-top) plat-trans) - :code - (behavior ((arg0 symbol)) + :trans (the-as (function none :behavior orb-cache-top) plat-trans) + :code (behavior ((arg0 symbol)) (process-entity-status! self (entity-perm-status bit-3) #t) (calculate-pos self arg0) (if arg0 (set! (-> self basetrans y) (-> self platform-pos)) - (sound-play-by-name (static-sound-name "open-orb-cash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "open-orb-cash") ) (dotimes (s5-1 (-> self money)) (let ((s4-1 (new 'stack-no-clear 'vector))) (set! (-> s4-1 quad) (-> self basetrans quad)) (set! (-> s4-1 y) (-> self money-pos-list s5-1)) (set! (-> self money-pos-actual s5-1) (-> s4-1 y)) - (let ((s3-0 (get-process *default-dead-pool* money #x4000))) - (set! (-> self money-list s5-1) - (ppointer->handle - (when s3-0 - (let ((t9-5 (method-of-type money activate))) - (t9-5 (the-as money s3-0) self 'money (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 money-init-by-other-no-bob s4-1 *null-vector* 5 1.0 (-> self entity)) - (-> s3-0 ppointer) - ) - ) + (set! (-> self money-list s5-1) + (ppointer->handle + (process-spawn money :init money-init-by-other-no-bob s4-1 *null-vector* 5 1.0 (-> self entity) :to self) ) - ) + ) ) ) - (while #t + (loop (calculate-pos self #t) - (while (not - (or (not *target*) (< (-> self inactive-distance) - (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) - ) + (while (not (or (not *target*) (< (-> self inactive-distance) + (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + ) (pos-logic self #t) (suspend) ) (calculate-pos self #f) - (while (and (not - (and (and *target* (>= (-> self active-distance) - (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) - ) + (while (and (not (and (and *target* (>= (-> self active-distance) + (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + (let ((a1-11 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-11 from) self) + (set! (-> a1-11 num-params) 2) + (set! (-> a1-11 message) 'query) + (set! (-> a1-11 param 0) (the-as uint 'powerup)) + (set! (-> a1-11 param 1) (the-as uint 3)) + (or (send-event-function *target* a1-11) (-> self activated)) ) - (let ((a1-11 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-11 from) self) - (set! (-> a1-11 num-params) 2) - (set! (-> a1-11 message) 'query) - (set! (-> a1-11 param 0) (the-as uint 'powerup)) - (set! (-> a1-11 param 1) (the-as uint 3)) - (or (send-event-function *target* a1-11) (-> self activated)) - ) - ) - ) + ) + ) (not (pos-logic self #f)) ) (suspend) ) - (if (not - (and (and *target* (>= (-> self active-distance) - (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (not (and (and *target* (>= (-> self active-distance) + (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + (let ((a1-14 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-14 from) self) + (set! (-> a1-14 num-params) 2) + (set! (-> a1-14 message) 'query) + (set! (-> a1-14 param 0) (the-as uint 'powerup)) + (set! (-> a1-14 param 1) (the-as uint 3)) + (or (send-event-function *target* a1-14) (-> self activated)) ) - (let ((a1-14 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-14 from) self) - (set! (-> a1-14 num-params) 2) - (set! (-> a1-14 message) 'query) - (set! (-> a1-14 param 0) (the-as uint 'powerup)) - (set! (-> a1-14 param 1) (the-as uint 3)) - (or (send-event-function *target* a1-14) (-> self activated)) - ) - ) - ) + ) + ) (go orb-cache-top-idle arg0) ) ) (none) ) - :post - (the-as (function none :behavior orb-cache-top) plat-post) + :post (the-as (function none :behavior orb-cache-top) plat-post) ) ;; failed to figure out what this is: (defstate orb-cache-top-complete (orb-cache-top) - :event - (the-as (function process int symbol event-message-block object :behavior orb-cache-top) plat-event) - :trans - (the-as (function none :behavior orb-cache-top) plat-trans) - :code - (behavior ((arg0 symbol)) + :event (the-as (function process int symbol event-message-block object :behavior orb-cache-top) plat-event) + :trans (the-as (function none :behavior orb-cache-top) plat-trans) + :code (behavior ((arg0 symbol)) (if (not arg0) - (sound-play-by-name (static-sound-name "close-orb-cash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "close-orb-cash") ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> gp-1 frame-num) (ja-aframe 0.0 0)) - ) + (ja :group! (-> self draw art-group data 3) :num! (identity (ja-aframe 0.0 0))) (new 'stack-no-clear 'vector) (set! (-> self basetrans y) (+ 2048.0 (-> self root-pos))) (anim-loop) (none) ) - :post - (the-as (function none :behavior orb-cache-top) plat-post) + :post (the-as (function none :behavior orb-cache-top) plat-post) ) ;; definition for method 11 of type orb-cache-top diff --git a/test/decompiler/reference/levels/common/plat-button_REF.gc b/test/decompiler/reference/levels/common/plat-button_REF.gc index 3a429e3a95..fa35e2c824 100644 --- a/test/decompiler/reference/levels/common/plat-button_REF.gc +++ b/test/decompiler/reference/levels/common/plat-button_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/plat-button-ag.gc") + ;; definition of type plat-button (deftype plat-button (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -53,13 +55,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *plat-button-sg* plat-button - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -1 0 6.6) - :longest-edge (meters 0) - ) +(defskelgroup *plat-button-sg* plat-button plat-button-geo-jg plat-button-pressed-ja + ((plat-button-geo-mg (meters 999999))) + :bounds (static-spherem 0 -1 0 6.6) + ) ;; definition for method 30 of type plat-button (defmethod should-teleport? plat-button ((obj plat-button)) @@ -74,8 +73,7 @@ ;; failed to figure out what this is: (defstate plat-button-idle (plat-button) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) (when (can-activate? self) @@ -96,67 +94,30 @@ ) ) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (can-activate? self))) - (cond - (gp-0 - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 0.0) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (if gp-0 + (ja-no-eval :num! (seek! 0.0)) + (ja-no-eval :num! (seek!)) ) - (else - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - ) - (while #t + (loop (if (should-teleport? self) (go-virtual plat-button-teleport-to-other-end) ) (let ((s5-0 (can-activate? self))) (when (!= s5-0 gp-0) (set! gp-0 s5-0) - (cond - (s5-0 - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 0.0) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (if s5-0 + (ja-no-eval :num! (seek! 0.0)) + (ja-no-eval :num! (seek!)) ) - (else - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - ) ) (when (not (ja-done? 0)) (rider-trans) - (cond - (s5-0 - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) 0.0) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (if s5-0 + (ja :num! (seek! 0.0)) + (ja :num! (seek!)) ) - (else - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - ) (rider-post) ) ) @@ -170,8 +131,7 @@ ;; failed to figure out what this is: (defstate plat-button-teleport-to-other-end (plat-button) :virtual #t - :code - (behavior () + :code (behavior () (let ((f0-0 1.0)) (if (>= (-> self path-pos) 0.5) (set! f0-0 0.0) @@ -192,22 +152,12 @@ ;; failed to figure out what this is: (defstate plat-button-pressed (plat-button) :virtual #t - :trans - (the-as (function none :behavior plat-button) rider-trans) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :trans (the-as (function none :behavior plat-button) rider-trans) + :code (behavior () + (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self go-back-if-lost-player?) #t) (process-entity-status! self (entity-perm-status complete) #t) @@ -217,8 +167,7 @@ ) (none) ) - :post - (the-as (function none :behavior plat-button) rider-post) + :post (the-as (function none :behavior plat-button) rider-post) ) ;; definition for function plat-button-camera-on @@ -244,41 +193,38 @@ ;; failed to figure out what this is: (defstate plat-button-move-downward (plat-button) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (the-as object (when (or (= arg2 'touch) (= arg2 'attack)) (set! (-> self state-time) (-> *display* base-frame-counter)) #f ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (process-entity-status! self (entity-perm-status bit-3) #t) (plat-button-camera-on) - (set-setting! *setting-control* self 'allow-look-around #f 0.0 0) + (set-setting! 'allow-look-around #f 0.0 0) (none) ) - :exit - (behavior () + :exit (behavior () (plat-button-camera-off) - (clear-pending-settings-from-process *setting-control* self 'allow-look-around) + (remove-setting! 'allow-look-around) (none) ) - :trans - (behavior () + :trans (behavior () (if (= (-> self path-pos) 1.0) (go-virtual plat-button-at-end) ) (rider-trans) (when (-> self go-back-if-lost-player?) - (when (or (not *target*) (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) - (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) - ) + (when (or (not *target*) + (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) + (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + ) + ) + ) ) (set! (-> self go-back-if-lost-player?) #f) (go-virtual plat-button-move-upward) @@ -292,7 +238,7 @@ (move-to-point! (-> self root-override) gp-0) ) ) - (sound-play-by-name (static-sound-name "elev-loop") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "elev-loop" :id (-> self sound-id)) (let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-1 command) (sound-command set-param)) (set! (-> gp-1 id) (-> self sound-id)) @@ -307,7 +253,7 @@ ) (sound-trans-convert (-> gp-1 parms trans) a1-6) ) - (set! (-> gp-1 parms mask) (the-as uint 32)) + (set! (-> gp-1 parms mask) (sound-mask trans)) (-> gp-1 id) ) (if (and (-> self grab-player?) (< 0.2 (-> self path-pos))) @@ -315,50 +261,45 @@ ) (none) ) - :code - (the-as (function none :behavior plat-button) anim-loop) - :post - (the-as (function none :behavior plat-button) rider-post) + :code (the-as (function none :behavior plat-button) anim-loop) + :post (the-as (function none :behavior plat-button) rider-post) ) ;; failed to figure out what this is: (defstate plat-button-move-upward (plat-button) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (the-as object (when (or (= arg2 'touch) (= arg2 'attack)) (set! (-> self state-time) (-> *display* base-frame-counter)) #f ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (process-entity-status! self (entity-perm-status bit-3) #t) (plat-button-camera-on) - (set-setting! *setting-control* self 'allow-look-around #f 0.0 0) + (set-setting! 'allow-look-around #f 0.0 0) (none) ) - :exit - (behavior () + :exit (behavior () (plat-button-camera-off) - (clear-pending-settings-from-process *setting-control* self 'allow-look-around) + (remove-setting! 'allow-look-around) (none) ) - :trans - (behavior () + :trans (behavior () (if (= (-> self path-pos) 0.0) (go-virtual plat-button-at-end) ) (rider-trans) (when (-> self go-back-if-lost-player?) - (when (or (not *target*) (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) - (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) - ) + (when (or (not *target*) + (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) + (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + ) + ) + ) ) (set! (-> self go-back-if-lost-player?) #f) (go-virtual plat-button-move-downward) @@ -372,7 +313,7 @@ (move-to-point! (-> self root-override) gp-0) ) ) - (sound-play-by-name (static-sound-name "elev-loop") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "elev-loop" :id (-> self sound-id)) (let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-1 command) (sound-command set-param)) (set! (-> gp-1 id) (-> self sound-id)) @@ -387,7 +328,7 @@ ) (sound-trans-convert (-> gp-1 parms trans) a1-6) ) - (set! (-> gp-1 parms mask) (the-as uint 32)) + (set! (-> gp-1 parms mask) (sound-mask trans)) (-> gp-1 id) ) (if (and (-> self grab-player?) (< (-> self path-pos) 0.8)) @@ -395,23 +336,20 @@ ) (none) ) - :code - (the-as (function none :behavior plat-button) anim-loop) - :post - (the-as (function none :behavior plat-button) rider-post) + :code (the-as (function none :behavior plat-button) anim-loop) + :post (the-as (function none :behavior plat-button) rider-post) ) ;; failed to figure out what this is: (defstate plat-button-at-end (plat-button) :virtual #t - :code - (behavior () + :code (behavior () (if (-> self allow-auto-kill) (process-entity-status! self (entity-perm-status bit-3) #f) ) (sound-stop (-> self sound-id)) - (sound-play-by-name (static-sound-name "elev-land") (new-sound-id) 1024 0 0 1 #t) - (while #t + (sound-play "elev-land") + (loop (if (or (not *target*) (< 268435460.0 (vector-vector-xz-distance-squared (-> self root-override trans) (target-pos 0))) ) diff --git a/test/decompiler/reference/levels/common/plat-eco_REF.gc b/test/decompiler/reference/levels/common/plat-eco_REF.gc index 32de234beb..e4b8af0465 100644 --- a/test/decompiler/reference/levels/common/plat-eco_REF.gc +++ b/test/decompiler/reference/levels/common/plat-eco_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/plat-eco-ag.gc") + ;; definition of type plat-eco (deftype plat-eco (plat) ((notice-dist float :offset-assert 264) @@ -36,28 +38,21 @@ ) ;; failed to figure out what this is: -(defskelgroup *plat-eco-unlit-sg* plat-eco - 0 - 8 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *plat-eco-unlit-sg* plat-eco plat-eco-lod0-jg plat-eco-idle-ja + ((plat-eco-lod0-mg (meters 20)) (plat-eco-lod1-mg (meters 40)) (plat-eco-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; failed to figure out what this is: -(defskelgroup *plat-eco-lit-sg* plat-eco - 0 - 8 - ((5 (meters 20)) (6 (meters 40)) (7 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *plat-eco-lit-sg* plat-eco plat-eco-lod0-jg plat-eco-idle-ja + ((plat-eco-lit-lod0-mg (meters 20)) (plat-eco-lit-lod1-mg (meters 40)) (plat-eco-lit-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; failed to figure out what this is: (defstate plat-idle (plat-eco) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('wake) (go-virtual plat-path-active (the-as plat #f)) @@ -66,31 +61,22 @@ (go-virtual notice-blue (process->handle arg0)) ) (('ridden 'edge-grabbed) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'query) - (set! (-> a1-6 param 0) (the-as uint 'powerup)) - (set! (-> a1-6 param 1) (the-as uint 3)) - (when (send-event-function *target* a1-6) - (send-to-all (-> self link) 'wake) - (go-virtual plat-path-active (the-as plat #f)) - ) + (when (send-event *target* 'query 'powerup (pickup-type eco-blue)) + (send-to-all (-> self link) 'wake) + (go-virtual plat-path-active (the-as plat #f)) ) ) ) ) - :enter - (behavior () + :enter (behavior () (lods-assign! (-> self draw) (-> self unlit-look)) (none) ) - :trans - (behavior () + :trans (behavior () (when (and (and *target* (>= (-> self notice-dist) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) (send-to-all (-> self link) 'wake) (go-virtual plat-path-active (the-as plat #f)) @@ -108,52 +94,33 @@ ) (none) ) - :code - (behavior () + :code (behavior () (ja-post) (update-transforms! (-> self root-override)) (anim-loop) (none) ) - :post - (the-as (function none :behavior plat-eco) ja-post) + :post (the-as (function none :behavior plat-eco) ja-post) ) ;; failed to figure out what this is: (defstate notice-blue (plat-eco) :virtual override - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('wake) - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) (go-virtual plat-path-active (the-as plat #f)) ) (('ridden 'edge-grabbed) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'powerup)) - (set! (-> a1-3 param 1) (the-as uint 3)) - (when (send-event-function *target* a1-3) - (send-to-all (-> self link) 'wake) - (go-virtual plat-path-active (the-as plat #f)) - ) + (when (send-event *target* 'query 'powerup (pickup-type eco-blue)) + (send-to-all (-> self link) 'wake) + (go-virtual plat-path-active (the-as plat #f)) ) ) ) ) - :trans - (behavior () + :trans (behavior () ((-> (method-of-object self plat-idle) trans)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) @@ -169,10 +136,9 @@ ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (set! (-> self target) arg0) - (while #t + (loop (let* ((gp-0 (handle->process (-> self target))) (v1-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) gp-0 @@ -224,8 +190,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (plat-trans) (plat-post) (none) @@ -235,8 +200,7 @@ ;; failed to figure out what this is: (defstate plat-path-active (plat-eco) :virtual #t - :enter - (behavior ((arg0 plat)) + :enter (behavior ((arg0 plat)) (lods-assign! (-> self draw) (-> self lit-look)) (sync-now! (-> self sync) (-> self sync-linear-val)) (set! (-> self sync-offset-faux) (-> self sync offset)) @@ -266,12 +230,9 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (when (!= (-> self sync-offset-faux) (-> self sync-offset-dest)) - (set! (-> self sync-offset-faux) - (seek (-> self sync-offset-faux) (-> self sync-offset-dest) (* 12.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self sync-offset-faux) (-> self sync-offset-dest) (* 12.0 (-> *display* seconds-per-frame))) (let* ((f0-7 (the float (-> self sync period))) (f1-3 (+ (-> self sync-offset-faux) f0-7)) ) @@ -361,7 +322,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/levels/common/plat_REF.gc b/test/decompiler/reference/levels/common/plat_REF.gc index 29265a1ce0..8aada5fcbf 100644 --- a/test/decompiler/reference/levels/common/plat_REF.gc +++ b/test/decompiler/reference/levels/common/plat_REF.gc @@ -1,20 +1,22 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/plat-sunken-ag.gc") +(import "goal_src/import/plat-ag.gc") +(import "goal_src/import/plat-jungleb-ag.gc") + ;; failed to figure out what this is: (defpartgroup group-standard-plat :id 107 :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 363 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 363 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 364 :fade-after (meters 160) :falloff-to (meters 160)) ) ) ;; failed to figure out what this is: (defpart 363 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-flt spt-y (meters 1)) (sp-int spt-rot-x 5) (sp-flt spt-r 5324.8) @@ -32,8 +34,7 @@ ;; failed to figure out what this is: (defpart 364 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-y (meters 1.5)) (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) @@ -86,31 +87,22 @@ ) ;; failed to figure out what this is: -(defskelgroup *plat-sg* plat - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 -0.5 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *plat-sg* plat plat-lod0-jg plat-idle-ja + ((plat-lod0-mg (meters 20)) (plat-lod1-mg (meters 40)) (plat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 -0.5 0 3) + ) ;; failed to figure out what this is: -(defskelgroup *plat-jungleb-sg* plat-jungleb - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 -0.5 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *plat-jungleb-sg* plat-jungleb plat-jungleb-lod0-jg plat-jungleb-idle-ja + ((plat-jungleb-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -0.5 0 3) + ) ;; failed to figure out what this is: -(defskelgroup *plat-sunken-sg* plat-sunken - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 -0.5 0 3.2) - :longest-edge (meters 0) - ) +(defskelgroup *plat-sunken-sg* plat-sunken plat-sunken-lod0-jg plat-sunken-idle-ja + ((plat-sunken-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -0.5 0 3.2) + ) ;; definition for method 23 of type plat (defmethod get-unlit-skel plat ((obj plat)) @@ -206,8 +198,7 @@ ;; failed to figure out what this is: (defstate plat-startup (plat) :virtual #t - :code - (behavior ((arg0 plat)) + :code (behavior ((arg0 plat)) (cond ((logtest? (-> self path flags) (path-control-flag not-found)) (go-virtual plat-idle) @@ -226,19 +217,16 @@ ;; failed to figure out what this is: (defstate plat-idle (plat) :virtual #t - :event - (the-as (function process int symbol event-message-block object :behavior plat) plat-event) - :trans - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior plat) plat-event) + :trans (behavior () (dummy-20 self) (none) ) - :code - (behavior () + :code (behavior () (plat-trans) (rider-post) (suspend) - (while #t + (loop (when (not (-> self bouncing)) (plat-trans) (rider-post) @@ -259,15 +247,12 @@ ;; failed to figure out what this is: (defstate plat-path-active (plat) :virtual #t - :event - (the-as (function process int symbol event-message-block object :behavior plat) plat-event) - :exit - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior plat) plat-event) + :exit (behavior () (sound-stop (-> self sound-id)) (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self path-pos) (if (logtest? (-> self fact options) (fact-options wrap-phase)) (get-current-phase (-> self sync)) (get-current-phase-with-mirror (-> self sync)) @@ -275,23 +260,13 @@ ) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) (none) ) - :code - (the-as (function plat none :behavior plat) anim-loop) - :post - (the-as (function none :behavior plat) plat-post) + :code (the-as (function plat none :behavior plat) anim-loop) + :post (the-as (function none :behavior plat) plat-post) ) ;; definition for method 11 of type plat diff --git a/test/decompiler/reference/levels/common/rigid-body_REF.gc b/test/decompiler/reference/levels/common/rigid-body_REF.gc index 5bdc34e25b..0e555a39fd 100644 --- a/test/decompiler/reference/levels/common/rigid-body_REF.gc +++ b/test/decompiler/reference/levels/common/rigid-body_REF.gc @@ -699,7 +699,15 @@ (set! (-> self rbody lin-momentum-damping-factor) (-> self info linear-damping)) (set! (-> self rbody ang-momentum-damping-factor) (-> self info angular-damping)) (if (-> self player-impulse) - (sound-play-by-name (string->sound-name (-> self info sound-name)) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name + (string->sound-name (-> self info sound-name)) + (new-sound-id) + 1024 + 0 + 0 + (sound-group sfx) + #t + ) ) (TODO-RENAME-28 self) (quaternion-copy! (-> self root-overlay quat) (-> self rbody rotation)) @@ -713,8 +721,7 @@ ;; failed to figure out what this is: (defstate rigid-body-platform-idle (rigid-body-platform) :virtual #t - :trans - (behavior () + :trans (behavior () (if (and *target* (>= (-> self info idle-distance) (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) ) @@ -723,24 +730,20 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior rigid-body-platform) ja-post) + :post (the-as (function none :behavior rigid-body-platform) ja-post) ) ;; failed to figure out what this is: (defstate rigid-body-platform-float (rigid-body-platform) :virtual #t - :event - rigid-body-platform-event-handler - :trans - (behavior () + :event rigid-body-platform-event-handler + :trans (behavior () (if (or (not *target*) (< (-> self info idle-distance) (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) ) @@ -749,15 +752,13 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior rigid-body-platform) rigid-body-platform-post) + :post (the-as (function none :behavior rigid-body-platform) rigid-body-platform-post) ) ;; definition for method 29 of type rigid-body-platform diff --git a/test/decompiler/reference/levels/common/ropebridge_REF.gc b/test/decompiler/reference/levels/common/ropebridge_REF.gc index c853354dcd..6056629afd 100644 --- a/test/decompiler/reference/levels/common/ropebridge_REF.gc +++ b/test/decompiler/reference/levels/common/ropebridge_REF.gc @@ -1,6 +1,13 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/vil3-bridge-36-ag.gc") +(import "goal_src/import/ropebridge-36-ag.gc") +(import "goal_src/import/ropebridge-32-ag.gc") +(import "goal_src/import/ropebridge-52-ag.gc") +(import "goal_src/import/snow-bridge-36-ag.gc") +(import "goal_src/import/ropebridge-70-ag.gc") + ;; definition of type ropebridge-tuning (deftype ropebridge-tuning (structure) ((num-springs int32 :offset-assert 0) @@ -169,14 +176,12 @@ ) ;; definition for symbol *ropebridge-tunings*, type (inline-array ropebridge-tuning) -(define - *ropebridge-tunings* +(define *ropebridge-tunings* (new 'static 'inline-array ropebridge-tuning 6 (new 'static 'ropebridge-tuning :num-springs 16 :num-spring-points 17 - :col-mesh-indexes - (new 'static 'array uint8 16 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3) + :col-mesh-indexes (new 'static 'array uint8 16 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3) :view-frustum-radius 81920.0 :root-prim-radius 81920.0 :desired-spring-len 4096.0 @@ -197,8 +202,7 @@ (new 'static 'ropebridge-tuning :num-springs 18 :num-spring-points 19 - :col-mesh-indexes - (new 'static 'array uint8 32 + :col-mesh-indexes (new 'static 'array uint8 32 #x3 #x3 #x3 @@ -252,8 +256,7 @@ (new 'static 'ropebridge-tuning :num-springs 26 :num-spring-points 27 - :col-mesh-indexes - (new 'static 'array uint8 32 + :col-mesh-indexes (new 'static 'array uint8 32 #x3 #x3 #x3 @@ -307,8 +310,7 @@ (new 'static 'ropebridge-tuning :num-springs 35 :num-spring-points 36 - :col-mesh-indexes - (new 'static 'array uint8 48 + :col-mesh-indexes (new 'static 'array uint8 48 #x3 #x3 #x3 @@ -378,8 +380,7 @@ (new 'static 'ropebridge-tuning :num-springs 18 :num-spring-points 19 - :col-mesh-indexes - (new 'static 'array uint8 32 + :col-mesh-indexes (new 'static 'array uint8 32 #x3 #x3 #x3 @@ -433,8 +434,7 @@ (new 'static 'ropebridge-tuning :num-springs 18 :num-spring-points 19 - :col-mesh-indexes - (new 'static 'array uint8 32 + :col-mesh-indexes (new 'static 'array uint8 32 #x3 #x3 #x3 @@ -568,63 +568,50 @@ ) ;; failed to figure out what this is: -(defskelgroup *ropebridge-32-sg* ropebridge-32 - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 4) - ) +(defskelgroup *ropebridge-32-sg* ropebridge-32 ropebridge-32-lod0-jg ropebridge-32-idle-ja + ((ropebridge-32-lod0-mg (meters 20)) (ropebridge-32-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 4) + ) ;; failed to figure out what this is: -(defskelgroup *snow-bridge-36-sg* snow-bridge-36 - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 3.8) - ) +(defskelgroup *snow-bridge-36-sg* snow-bridge-36 snow-bridge-36-lod0-jg snow-bridge-36-idle-ja + ((snow-bridge-36-lod0-mg (meters 20)) (snow-bridge-36-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 3.8) + ) ;; failed to figure out what this is: -(defskelgroup *ropebridge-52-sg* ropebridge-52 - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 3.6) - ) +(defskelgroup *ropebridge-52-sg* ropebridge-52 ropebridge-52-lod0-jg ropebridge-52-idle-ja + ((ropebridge-52-lod0-mg (meters 20)) (ropebridge-52-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 3.6) + ) ;; failed to figure out what this is: -(defskelgroup *ropebridge-70-sg* ropebridge-70 - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 3.6) - ) +(defskelgroup *ropebridge-70-sg* ropebridge-70 ropebridge-70-lod0-jg ropebridge-70-idle-ja + ((ropebridge-70-lod0-mg (meters 20)) (ropebridge-70-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 3.6) + ) ;; failed to figure out what this is: -(defskelgroup *ropebridge-36-sg* ropebridge-36 - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 4) - ) +(defskelgroup *ropebridge-36-sg* ropebridge-36 ropebridge-36-lod0-jg ropebridge-36-idle-ja + ((ropebridge-36-lod0-mg (meters 20)) (ropebridge-36-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 4) + ) ;; failed to figure out what this is: -(defskelgroup *vil3-bridge-36-sg* vil3-bridge-36 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 3.6) - ) +(defskelgroup *vil3-bridge-36-sg* vil3-bridge-36 vil3-bridge-36-lod0-jg vil3-bridge-36-idle-ja + ((vil3-bridge-36-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 3.6) + ) ;; failed to figure out what this is: (defstate ropebridge-idle (ropebridge) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((f0-0 -1.0)) (cond ((= arg2 'bonk) @@ -675,9 +662,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) (detect-riders! (-> self root-override)) (when (-> self do-physics?) @@ -688,8 +674,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (let ((gp-0 (-> self root-override))) (update-transforms! gp-0) @@ -707,7 +692,7 @@ ;; INFO: Return type mismatch symbol vs none. ;; WARN: Expression building failed: Function (method 20 ropebridge) has a return type of none, but the expression builder found a return statement. (defmethod set-vel-from-impact ropebridge ((obj ropebridge) (arg0 uint) (arg1 vector) (arg2 int) (arg3 float)) - (while #t + (loop (let ((f0-2 (fabs (- (-> arg1 z) (-> obj spring-point (the-as int arg0) local-pos z))))) (if (< (-> obj tuning max-bonk-influence-dist) f0-2) (return #f) @@ -781,7 +766,7 @@ ;; INFO: Return type mismatch symbol vs none. ;; WARN: Expression building failed: Function (method 22 ropebridge) has a return type of none, but the expression builder found a return statement. (defmethod set-vel-from-rider ropebridge ((obj ropebridge) (arg0 uint) (arg1 vector) (arg2 int)) - (while #t + (loop (let ((f0-0 (vector-vector-distance arg1 (the-as vector (-> obj spring-point (the-as int arg0)))))) (if (< (-> obj tuning max-influence-dist) f0-0) (return #f) @@ -935,7 +920,7 @@ ) (countdown (s3-0 (-> obj tuning num-spring-points)) (vector-matrix*! s4-0 (-> s5-0 local-pos) gp-0) - (add-debug-sphere #t (bucket-id debug-draw0) s4-0 2048.0 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40)) + (add-debug-sphere #t (bucket-id debug) s4-0 2048.0 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40)) (&+! s5-0 48) ) ) diff --git a/test/decompiler/reference/levels/common/sharkey_REF.gc b/test/decompiler/reference/levels/common/sharkey_REF.gc index 58ac7002e9..7626a8f1db 100644 --- a/test/decompiler/reference/levels/common/sharkey_REF.gc +++ b/test/decompiler/reference/levels/common/sharkey_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/sharkey-ag.gc") + ;; failed to figure out what this is: (defpartgroup group-sharkey-splash :id 106 @@ -8,8 +10,7 @@ :linger-duration 780 :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 124 :flags (is-3d) :period 900 :length 63) + :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) (sp-item 125 :period 900 :length 15) (sp-item 126 :flags (is-3d) :period 900 :length 15) (sp-item 127 :flags (is-3d) :period 900 :length 15) @@ -76,13 +77,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *sharkey-sg* sharkey - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *sharkey-sg* sharkey sharkey-lod0-jg sharkey-idle-ja + ((sharkey-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) ;; definition for method 44 of type sharkey ;; INFO: Return type mismatch symbol vs object. @@ -193,14 +191,8 @@ nav-enemy-default-event-handler (defbehavior sharkey-notice-player? sharkey () (if *target* (and (< (- (-> *target* control trans y) (-> self y-max)) 0.0) - (let ((gp-0 'racer) - (a1-0 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'mode)) - (!= gp-0 (send-event-function *target* a1-0)) + (let ((gp-0 'racer)) + (!= gp-0 (send-event *target* 'query 'mode)) ) (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos)) ) @@ -265,24 +257,20 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-idle (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self nav-enemy-flags) (logand -2 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (cond ((-> self enable-patrol) (if (and (and *target* (>= (-> self enemy-info idle-distance) @@ -295,8 +283,8 @@ nav-enemy-default-event-handler ) ) ((sharkey-notice-player?) - (when (zero? (logand (-> self nav-enemy-flags) 1)) - (logior! (-> self nav-enemy-flags) 1) + (when (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf0))) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (set! (-> self notice-time) (-> *display* base-frame-counter)) ) (let ((a0-4 (dummy-16 (-> self nav) (-> *target* control trans)))) @@ -313,33 +301,20 @@ nav-enemy-default-event-handler ) (else (if (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (seconds 10)) - (set! (-> self nav-enemy-flags) (logand -2 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) ) ) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! (-> self draw art-group data (-> self nav-info idle-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (until (= (-> self collide-info trans y) (-> self y-min)) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-loop!) - ) - (set! (-> self anim-speed) (seek (-> self anim-speed) 1.0 0.05)) - (set! (-> self collide-info trans y) - (seek (-> self collide-info trans y) (-> self y-min) (* (-> self y-speed) (-> *display* seconds-per-frame))) - ) + (ja :num! (loop! (-> self anim-speed))) + (seek! (-> self anim-speed) 1.0 0.05) + (seek! (-> self collide-info trans y) (-> self y-min) (* (-> self y-speed) (-> *display* seconds-per-frame))) (dummy-10 (-> self water)) (ja-post) (suspend) @@ -348,54 +323,35 @@ nav-enemy-default-event-handler (anim-loop) (none) ) - :post - (the-as (function none :behavior sharkey) #f) + :post (the-as (function none :behavior sharkey) #f) ) ;; failed to figure out what this is: (defstate nav-enemy-patrol (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :trans - (behavior () + :trans (behavior () (if (sharkey-notice-player?) (go-virtual nav-enemy-chase) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (set! (-> self nav target-pos quad) (-> self spawn-point quad)) - (while #t - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-3 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-3 param 1) (-> self anim-speed)) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! - a0-3 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max (-> self anim-speed)) + :frame-num 0.0 + ) (until (ja-done? 0) - (set! (-> self anim-speed) (seek (-> self anim-speed) 1.0 0.05)) + (seek! (-> self anim-speed) 1.0 0.05) (cond ((-> self enable-patrol) - (set! (-> self collide-info trans y) - (seek (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) ) (else (if (< (- (-> self collide-info trans y) (-> self y-min)) 409.6) @@ -404,17 +360,12 @@ nav-enemy-default-event-handler ) ) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (none) ) - :post - (behavior () + :post (behavior () (nav-enemy-travel-post) (none) ) @@ -423,18 +374,15 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-notice (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (go-virtual nav-enemy-chase) (none) ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-chase) (none) ) @@ -453,108 +401,73 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-attack (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) (-> *display* base-frame-counter) - (sound-play-by-name (static-sound-name "bigshark-bite") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bigshark-bite") (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> gp-0 quad) (-> self collide-info trans quad)) - (ja-channel-push! 1 30) - (let ((s4-1 (-> self skel root-channel 0))) - (set! (-> s4-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> s4-1 param 0) (ja-aframe 3.0 0)) - (set! (-> s4-1 param 1) 2.0) - (set! (-> s4-1 frame-num) 0.0) - (joint-control-channel-group! s4-1 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! sharkey-chomp-ja :num! (seek! (ja-aframe 3.0 0) 2.0) :frame-num 0.0) (until (ja-done? 0) (sharkey-get-player-position s5-0) (setup-from-to-duration! (-> self jump-trajectory) gp-0 s5-0 3.0 -291.27112) (set! (-> self attack-time) (ja-aframe-num 0)) (sharkey-follow-trajectory (-> self attack-time)) (suspend) - (let ((s4-2 (-> self skel root-channel 0))) - (set! (-> s4-2 param 0) (ja-aframe 3.0 0)) - (set! (-> s4-2 param 1) 2.0) - (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 3.0 0) 2.0)) ) ) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'attack-invinc) - (set! (-> a1-7 param 0) (the-as uint #f)) - (let ((a0-15 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-15 mode) 'sharkey) - (set! (-> a1-7 param 1) (the-as uint a0-15)) - ) - (when (send-event-function *target* a1-7) - (logclear! (-> self mask) (process-mask enemy)) - (vector-float*! (-> self collide-info transv) (-> self collide-info transv) 8.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((f30-0 -409600.0) - (f28-0 (-> self collide-info transv y)) - (f26-0 (-> self collide-info trans y)) + (when (send-event *target* 'attack-invinc #f (static-attack-info ((mode 'sharkey)))) + (logclear! (-> self mask) (process-mask enemy)) + (vector-float*! (-> self collide-info transv) (-> self collide-info transv) 8.0) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (let ((f30-0 -409600.0) + (f28-0 (-> self collide-info transv y)) + (f26-0 (-> self collide-info trans y)) + ) + (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (ja-no-eval :group! sharkey-chomp-ja :num! (seek!) :frame-num (ja-aframe 3.0 0)) + (until (ja-done? 0) + (+! f28-0 (* f30-0 (-> *display* seconds-per-frame))) + (+! f26-0 (* f28-0 (-> *display* seconds-per-frame))) + (set! (-> self collide-info transv y) f28-0) + (when (< (-> self collide-info trans y) (-> self water height)) + (set! f28-0 (* 0.9 f28-0)) + (vector-float*! (-> self collide-info transv) (-> self collide-info transv) 0.9) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) (ja-aframe 3.0 0)) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) - (until (ja-done? 0) - (+! f28-0 (* f30-0 (-> *display* seconds-per-frame))) - (+! f26-0 (* f28-0 (-> *display* seconds-per-frame))) - (set! (-> self collide-info transv y) f28-0) - (when (< (-> self collide-info trans y) (-> self water height)) - (set! f28-0 (* 0.9 f28-0)) - (vector-float*! (-> self collide-info transv) (-> self collide-info transv) 0.9) - ) - (vector-normalize-copy! (-> self dir) (-> self collide-info transv) 1.0) - (forward-up->quaternion (-> self collide-info quat) (-> self dir) *up-vector*) - (integrate-for-enemy-with-move-to-ground! - (-> self collide-info) - (-> self collide-info transv) - (collide-kind background) - 8192.0 - #t - #f - #f - ) - (set! (-> self collide-info trans y) f26-0) - (suspend) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1))) - (set! (-> a0-27 param 1) 1.0) - (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-seek!) - ) + (vector-normalize-copy! (-> self dir) (-> self collide-info transv) 1.0) + (forward-up->quaternion (-> self collide-info quat) (-> self dir) *up-vector*) + (integrate-for-enemy-with-move-to-ground! + (-> self collide-info) + (-> self collide-info transv) + (collide-kind background) + 8192.0 + #t + #f + #f ) + (set! (-> self collide-info trans y) f26-0) + (suspend) + (ja :num! (seek!)) ) ) - (send-event *target* 'end-mode) - (set! (-> self mask) (logior (process-mask enemy) (-> self mask))) ) + (send-event *target* 'end-mode) + (set! (-> self mask) (logior (process-mask enemy) (-> self mask))) ) (sharkey-reset-position) (logior! (-> self draw status) (draw-status hidden)) (go-virtual nav-enemy-idle) (none) ) - :post - (behavior () + :post (behavior () (nav-enemy-simple-post) (none) ) @@ -563,18 +476,15 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-chase (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self sound-id)) (none) ) - :trans - (behavior () + :trans (behavior () (if (not *target*) (go-virtual nav-enemy-patrol) ) @@ -591,8 +501,8 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-patrol) ) ) - (when (logtest? (-> *target* control status) 2) - (set! (-> self player-in-water) (logtest? (-> *target* control status) 1024)) + (when (logtest? (-> *target* control status) (cshape-moving-flags onground)) + (set! (-> self player-in-water) (logtest? (-> *target* control status) (cshape-moving-flags on-water))) (if (-> self player-in-water) (set! (-> self player-water-time) (-> *display* base-frame-counter)) ) @@ -624,55 +534,35 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self player-water-time) (-> *display* base-frame-counter)) - (ja-channel-push! 1 51) - (sound-play-by-name (static-sound-name "bigshark-idle") (new-sound-id) 1024 0 0 1 #t) - (while #t - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim)))) - (set! (-> a0-3 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-3 param 1) (-> self anim-speed)) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! - a0-3 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.17)) + (sound-play "bigshark-idle") + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info run-anim)) + :num! (seek! max (-> self anim-speed)) + :frame-num 0.0 + ) (until (ja-done? 0) - (set! (-> self anim-speed) (seek (-> self anim-speed) 1.0 (* 3.0 (-> *display* seconds-per-frame)))) + (seek! (-> self anim-speed) 1.0 (* 3.0 (-> *display* seconds-per-frame))) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (none) ) - :post - (behavior () + :post (behavior () (sharkey-get-player-position (-> self nav target-pos)) (nav-enemy-travel-post) (let* ((f3-0 (vector-vector-distance (-> self collide-info trans) (-> self nav target-pos))) (f1-2 (fmax 0.0 (fmin 1.0 (- 1.0 (/ (+ -24576.0 f3-0) (+ -24576.0 (-> self spawn-distance))))))) (f0-2 (+ 0.5 (* 1.5 f1-2))) ) - (sound-play-by-name - (static-sound-name "bigshark-alert") - (-> self sound-id) - 1024 - (the int (* 1524.0 f0-2)) - 0 - 1 - (the-as symbol (-> self collide-info trans)) + (sound-play + "bigshark-alert" + :id (-> self sound-id) + :pitch f0-2 + :position (the-as symbol (-> self collide-info trans)) ) ) (none) @@ -682,43 +572,22 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-stop-chase (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 51) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-1 param 1) (-> self anim-speed)) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.17)) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max (-> self anim-speed)) + :frame-num 0.0 + ) (until (ja-done? 0) - (set! (-> self anim-speed) (seek (-> self anim-speed) 1.0 0.05)) - (set! (-> self collide-info trans y) - (seek (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> self anim-speed) 1.0 0.05) + (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (none) @@ -728,13 +597,11 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-stare (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :trans - (behavior () + :trans (behavior () (if (TODO-RENAME-46 self (-> self nav-info notice-distance)) (go-virtual nav-enemy-chase) ) @@ -743,27 +610,14 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 51) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) - (while #t - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-loop!) - ) - (set! (-> self anim-speed) (seek (-> self anim-speed) 1.0 0.05)) - (set! (-> self collide-info trans y) - (seek (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.17)) + (ja :group! (-> self draw art-group data (-> self nav-info idle-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (loop + (ja :num! (loop! (-> self anim-speed))) + (seek! (-> self anim-speed) 1.0 0.05) + (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) (suspend) ) (none) @@ -773,41 +627,20 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-victory (sharkey) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior sharkey) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (dotimes (gp-0 3) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - ) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) data 0 length) - -1 - ) - ) - ) - (set! (-> a0-1 param 1) (-> self anim-speed)) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info victory-anim)) + :num! (seek! max (-> self anim-speed)) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (go-virtual nav-enemy-stare) @@ -863,7 +696,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -896,7 +729,7 @@ nav-enemy-default-event-handler (TODO-RENAME-45 obj *sharkey-nav-enemy-info*) (logclear! (-> obj mask) (process-mask actor-pause)) (set! (-> obj water) (new 'process 'water-control obj 3 12288.0 8192.0 2048.0)) - (set! (-> obj water flags) (the-as uint #xc00002)) + (set! (-> obj water flags) (water-flags wt01 wt22 wt23)) (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) (set! (-> obj water ripple-size) 20480.0) (set! (-> obj spawn-point quad) (-> obj collide-info trans quad)) diff --git a/test/decompiler/reference/levels/common/ticky_REF.gc b/test/decompiler/reference/levels/common/ticky_REF.gc index afeb1a65f0..3255c7dd83 100644 --- a/test/decompiler/reference/levels/common/ticky_REF.gc +++ b/test/decompiler/reference/levels/common/ticky_REF.gc @@ -57,7 +57,7 @@ ) (when (>= (- (-> *display* base-frame-counter) (-> obj last-tick-time)) v1-7) (set! (-> obj last-tick-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "stopwatch") (new-sound-id) 1024 0 0 1 #t) + (sound-play "stopwatch") ) ) ) diff --git a/test/decompiler/reference/levels/common/water-anim_REF.gc b/test/decompiler/reference/levels/common/water-anim_REF.gc index afcc0eb497..d786cc15a9 100644 --- a/test/decompiler/reference/levels/common/water-anim_REF.gc +++ b/test/decompiler/reference/levels/common/water-anim_REF.gc @@ -1,6 +1,23 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/water-anim-maincave-ag.gc") +(import "goal_src/import/water-anim-village3-ag.gc") +(import "goal_src/import/water-anim-finalboss-ag.gc") +(import "goal_src/import/water-anim-maincave-water-ag.gc") +(import "goal_src/import/water-anim-sunken-ag.gc") +(import "goal_src/import/water-anim-lavatube-ag.gc") +(import "goal_src/import/water-anim-robocave-ag.gc") +(import "goal_src/import/water-anim-jungle-ag.gc") +(import "goal_src/import/water-anim-ogre-ag.gc") +(import "goal_src/import/water-anim-training-ag.gc") +(import "goal_src/import/water-anim-darkcave-ag.gc") +(import "goal_src/import/water-anim-village1-ag.gc") +(import "goal_src/import/water-anim-rolling-ag.gc") +(import "goal_src/import/water-anim-misty-ag.gc") +(import "goal_src/import/water-anim-sunken-dark-eco-ag.gc") +(import "goal_src/import/water-anim-village2-ag.gc") + ;; definition of type water-anim (deftype water-anim (water-vol) ((ppointer-water-anim (pointer water-anim) :offset 24) @@ -24,436 +41,292 @@ ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-dark-eco-qbert-sg* water-anim-sunken-dark-eco - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 40) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-dark-eco-qbert-sg* water-anim-sunken-dark-eco water-anim-sunken-dark-eco-qbert-lod0-jg -1 + ((water-anim-sunken-dark-eco-qbert-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 40) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-dark-eco-platform-room-sg* water-anim-sunken-dark-eco - 2 - -1 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 22) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-dark-eco-platform-room-sg* water-anim-sunken-dark-eco water-anim-sunken-dark-eco-platform-room-lod0-jg -1 + ((water-anim-sunken-dark-eco-platform-room-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 22) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-dark-eco-helix-room-sg* water-anim-sunken-dark-eco - 4 - -1 - ((5 (meters 999999))) - :bounds (static-spherem 0 0 0 21) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-dark-eco-helix-room-sg* water-anim-sunken-dark-eco water-anim-sunken-dark-eco-helix-room-lod0-jg -1 + ((water-anim-sunken-dark-eco-helix-room-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 21) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-big-room-sg* water-anim-sunken - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 15 0 -36 70) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-big-room-sg* water-anim-sunken water-anim-sunken-big-room-lod0-jg -1 + ((water-anim-sunken-big-room-lod0-mg (meters 999999))) + :bounds (static-spherem 15 0 -36 70) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-first-room-from-entrance-sg* water-anim-sunken - 2 - -1 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 50) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-first-room-from-entrance-sg* water-anim-sunken water-anim-sunken-first-room-from-entrance-lod0-jg -1 + ((water-anim-sunken-first-room-from-entrance-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-qbert-room-sg* water-anim-sunken - 4 - -1 - ((5 (meters 999999))) - :bounds (static-spherem 0 0 0 48) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-qbert-room-sg* water-anim-sunken water-anim-sunken-qbert-room-lod0-jg -1 + ((water-anim-sunken-qbert-room-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 48) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-first-right-branch-sg* water-anim-sunken - 6 - -1 - ((7 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-first-right-branch-sg* water-anim-sunken water-anim-sunken-first-right-branch-lod0-jg -1 + ((water-anim-sunken-first-right-branch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-circular-with-bullys-sg* water-anim-sunken - 8 - -1 - ((9 (meters 999999))) - :bounds (static-spherem 0 0 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-circular-with-bullys-sg* water-anim-sunken water-anim-sunken-circular-with-bullys-lod0-jg -1 + ((water-anim-sunken-circular-with-bullys-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-hall-with-one-whirlpool-sg* water-anim-sunken - 10 - -1 - ((11 (meters 999999))) - :bounds (static-spherem 0 0 0 27) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-hall-with-one-whirlpool-sg* water-anim-sunken water-anim-sunken-hall-with-one-whirlpool-lod0-jg -1 + ((water-anim-sunken-hall-with-one-whirlpool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 27) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-hall-with-three-whirlpools-sg* water-anim-sunken - 12 - -1 - ((13 (meters 999999))) - :bounds (static-spherem 0 0 0 26) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-hall-with-three-whirlpools-sg* water-anim-sunken water-anim-sunken-hall-with-three-whirlpools-lod0-jg -1 + ((water-anim-sunken-hall-with-three-whirlpools-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 26) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-start-of-helix-slide-sg* water-anim-sunken - 14 - -1 - ((15 (meters 999999))) - :bounds (static-spherem 0 0 0 25) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-start-of-helix-slide-sg* water-anim-sunken water-anim-sunken-start-of-helix-slide-lod0-jg -1 + ((water-anim-sunken-start-of-helix-slide-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-room-above-exit-chamber-sg* water-anim-sunken - 16 - -1 - ((17 (meters 999999))) - :bounds (static-spherem 0 0 0 45) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-room-above-exit-chamber-sg* water-anim-sunken water-anim-sunken-room-above-exit-chamber-lod0-jg -1 + ((water-anim-sunken-room-above-exit-chamber-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 45) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-hall-before-big-room-sg* water-anim-sunken - 18 - -1 - ((19 (meters 999999))) - :bounds (static-spherem 5 0 -3 24) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-hall-before-big-room-sg* water-anim-sunken water-anim-sunken-hall-before-big-room-lod0-jg -1 + ((water-anim-sunken-hall-before-big-room-lod0-mg (meters 999999))) + :bounds (static-spherem 5 0 -3 24) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-short-piece-sg* water-anim-sunken - 20 - -1 - ((21 (meters 999999))) - :bounds (static-spherem 0 0 0 20) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-short-piece-sg* water-anim-sunken water-anim-sunken-short-piece-lod0-jg -1 + ((water-anim-sunken-short-piece-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-sunken-big-room-upper-water-sg* water-anim-sunken - 22 - -1 - ((23 (meters 999999))) - :bounds (static-spherem 0 0 0 27) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-sunken-big-room-upper-water-sg* water-anim-sunken water-anim-sunken-big-room-upper-water-lod0-jg -1 + ((water-anim-sunken-big-room-upper-water-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 27) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-maincave-center-pool-sg* water-anim-maincave - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 70) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-maincave-center-pool-sg* water-anim-maincave water-anim-maincave-center-pool-lod0-jg -1 + ((water-anim-maincave-center-pool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 70) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-maincave-lower-right-pool-sg* water-anim-maincave - 2 - -1 - ((3 (meters 999999))) - :bounds (static-spherem 6 0 5 61) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-maincave-lower-right-pool-sg* water-anim-maincave water-anim-maincave-lower-right-pool-lod0-jg -1 + ((water-anim-maincave-lower-right-pool-lod0-mg (meters 999999))) + :bounds (static-spherem 6 0 5 61) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-maincave-mid-right-pool-sg* water-anim-maincave - 4 - -1 - ((5 (meters 999999))) - :bounds (static-spherem 0 0 0 37) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-maincave-mid-right-pool-sg* water-anim-maincave water-anim-maincave-mid-right-pool-lod0-jg -1 + ((water-anim-maincave-mid-right-pool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 37) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-maincave-lower-left-pool-sg* water-anim-maincave - 6 - -1 - ((7 (meters 999999))) - :bounds (static-spherem -1 0 0 20) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-maincave-lower-left-pool-sg* water-anim-maincave water-anim-maincave-lower-left-pool-lod0-jg -1 + ((water-anim-maincave-lower-left-pool-lod0-mg (meters 999999))) + :bounds (static-spherem -1 0 0 20) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-maincave-mid-left-pool-sg* water-anim-maincave - 8 - -1 - ((9 (meters 999999))) - :bounds (static-spherem 0 0 0 51) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-maincave-mid-left-pool-sg* water-anim-maincave water-anim-maincave-mid-left-pool-lod0-jg -1 + ((water-anim-maincave-mid-left-pool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 51) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-maincave-water-with-crystal-sg* water-anim-maincave-water - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 -3 22) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-maincave-water-with-crystal-sg* water-anim-maincave-water water-anim-maincave-water-with-crystal-lod0-jg -1 + ((water-anim-maincave-water-with-crystal-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -3 22) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-robocave-main-pool-sg* water-anim-robocave - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 54) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-robocave-main-pool-sg* water-anim-robocave water-anim-robocave-main-pool-lod0-jg -1 + ((water-anim-robocave-main-pool-lod0-mg (meters 20)) (water-anim-robocave-main-pool-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 54) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-misty-mud-by-arena-sg* water-anim-misty - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 -2.5 19) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-by-arena-sg* water-anim-misty water-anim-misty-mud-by-arena-lod0-jg -1 + ((water-anim-misty-mud-by-arena-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -2.5 19) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-misty-mud-above-skeleton-sg* water-anim-misty - 2 - -1 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 14) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-above-skeleton-sg* water-anim-misty water-anim-misty-mud-above-skeleton-lod0-jg -1 + ((water-anim-misty-mud-above-skeleton-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 14) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-misty-mud-behind-skeleton-sg* water-anim-misty - 4 - -1 - ((5 (meters 999999))) - :bounds (static-spherem 0 0 4 25) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-behind-skeleton-sg* water-anim-misty water-anim-misty-mud-behind-skeleton-lod0-jg -1 + ((water-anim-misty-mud-behind-skeleton-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 4 25) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-misty-mud-above-skull-back-sg* water-anim-misty - 6 - -1 - ((7 (meters 999999))) - :bounds (static-spherem 0 0 0 14) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-above-skull-back-sg* water-anim-misty water-anim-misty-mud-above-skull-back-lod0-jg -1 + ((water-anim-misty-mud-above-skull-back-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 14) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-misty-mud-above-skull-front-sg* water-anim-misty - 8 - -1 - ((9 (meters 999999))) - :bounds (static-spherem 0 0 0 16) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-above-skull-front-sg* water-anim-misty water-anim-misty-mud-above-skull-front-lod0-jg -1 + ((water-anim-misty-mud-above-skull-front-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 16) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-misty-mud-other-near-skull-sg* water-anim-misty - 10 - -1 - ((11 (meters 999999))) - :bounds (static-spherem 0 0 0 13) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-other-near-skull-sg* water-anim-misty water-anim-misty-mud-other-near-skull-lod0-jg -1 + ((water-anim-misty-mud-other-near-skull-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 13) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-misty-mud-near-skull-sg* water-anim-misty - 12 - -1 - ((13 (meters 999999))) - :bounds (static-spherem 0 0 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-near-skull-sg* water-anim-misty water-anim-misty-mud-near-skull-lod0-jg -1 + ((water-anim-misty-mud-near-skull-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-misty-mud-under-spine-sg* water-anim-misty - 14 - -1 - ((15 (meters 999999))) - :bounds (static-spherem 0 0 0 16) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-under-spine-sg* water-anim-misty water-anim-misty-mud-under-spine-lod0-jg -1 + ((water-anim-misty-mud-under-spine-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 16) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-misty-mud-by-dock-sg* water-anim-misty - 16 - -1 - ((17 (meters 999999))) - :bounds (static-spherem 0 0 0 21) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-by-dock-sg* water-anim-misty water-anim-misty-mud-by-dock-lod0-jg -1 + ((water-anim-misty-mud-by-dock-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 21) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-misty-mud-island-near-dock-sg* water-anim-misty - 18 - -1 - ((19 (meters 999999))) - :bounds (static-spherem -1 0 -1 15) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-island-near-dock-sg* water-anim-misty water-anim-misty-mud-island-near-dock-lod0-jg -1 + ((water-anim-misty-mud-island-near-dock-lod0-mg (meters 999999))) + :bounds (static-spherem -1 0 -1 15) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-misty-mud-lonely-island-sg* water-anim-misty - 20 - -1 - ((21 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-mud-lonely-island-sg* water-anim-misty water-anim-misty-mud-lonely-island-lod0-jg -1 + ((water-anim-misty-mud-lonely-island-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-misty-dark-eco-pool-sg* water-anim-misty - 22 - -1 - ((23 (meters 999999))) - :bounds (static-spherem 0 0 0 17) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-misty-dark-eco-pool-sg* water-anim-misty water-anim-misty-dark-eco-pool-lod0-jg -1 + ((water-anim-misty-dark-eco-pool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 17) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-ogre-lava-sg* water-anim-ogre - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 112) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-ogre-lava-sg* water-anim-ogre water-anim-ogre-lava-lod0-jg -1 + ((water-anim-ogre-lava-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 112) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-jungle-river-sg* water-anim-jungle - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 91) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-jungle-river-sg* water-anim-jungle water-anim-jungle-river-lod0-jg -1 + ((water-anim-jungle-river-lod0-mg (meters 20)) (water-anim-jungle-river-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 91) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-village3-lava-sg* water-anim-village3 - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 15 0 10 163) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-village3-lava-sg* water-anim-village3 water-anim-village3-lava-lod0-jg -1 + ((water-anim-village3-lava-lod0-mg (meters 20)) (water-anim-village3-lava-lod1-mg (meters 999999))) + :bounds (static-spherem 15 0 10 163) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-training-lake-sg* water-anim-training - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem -18 0 0 52) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-training-lake-sg* water-anim-training water-anim-training-lake-lod0-jg -1 + ((water-anim-training-lake-lod0-mg (meters 999999))) + :bounds (static-spherem -18 0 0 52) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-darkcave-water-with-crystal-sg* water-anim-darkcave - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 19) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-darkcave-water-with-crystal-sg* water-anim-darkcave water-anim-darkcave-water-with-crystal-lod0-jg -1 + ((water-anim-darkcave-water-with-crystal-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 19) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-rolling-water-back-sg* water-anim-rolling - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem -10 0 0 70) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-rolling-water-back-sg* water-anim-rolling water-anim-rolling-water-back-lod0-jg -1 + ((water-anim-rolling-water-back-lod0-mg (meters 999999))) + :bounds (static-spherem -10 0 0 70) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-rolling-water-front-sg* water-anim-rolling - 2 - -1 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 70) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-rolling-water-front-sg* water-anim-rolling water-anim-rolling-water-front-lod0-jg -1 + ((water-anim-rolling-water-front-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 70) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-finalboss-dark-eco-pool-sg* water-anim-finalboss - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 19) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-finalboss-dark-eco-pool-sg* water-anim-finalboss water-anim-finalboss-dark-eco-pool-lod0-jg -1 + ((water-anim-finalboss-dark-eco-pool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 19) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-lavatube-energy-lava-sg* water-anim-lavatube - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 -7 0 25) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-lavatube-energy-lava-sg* water-anim-lavatube water-anim-lavatube-energy-lava-lod0-jg -1 + ((water-anim-lavatube-energy-lava-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -7 0 25) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-village1-rice-paddy-sg* water-anim-village1 - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem -15 0 0 27) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-village1-rice-paddy-sg* water-anim-village1 water-anim-village1-rice-paddy-lod0-jg -1 + ((water-anim-village1-rice-paddy-lod0-mg (meters 999999))) + :bounds (static-spherem -15 0 0 27) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-village1-fountain-sg* water-anim-village1 - 6 - -1 - ((7 (meters 999999))) - :bounds (static-spherem 0 0 0 4.5) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-village1-fountain-sg* water-anim-village1 water-anim-village1-fountain-lod0-jg -1 + ((water-anim-village1-fountain-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.5) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-village1-rice-paddy-mid-sg* water-anim-village1 - 2 - -1 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 35) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-village1-rice-paddy-mid-sg* water-anim-village1 water-anim-village1-rice-paddy-mid-lod0-jg -1 + ((water-anim-village1-rice-paddy-mid-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 35) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-village1-rice-paddy-top-sg* water-anim-village1 - 4 - -1 - ((5 (meters 999999))) - :bounds (static-spherem 6 0 -17 20) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-village1-rice-paddy-top-sg* water-anim-village1 water-anim-village1-rice-paddy-top-lod0-jg -1 + ((water-anim-village1-rice-paddy-top-lod0-mg (meters 999999))) + :bounds (static-spherem 6 0 -17 20) + ) ;; failed to figure out what this is: -(defskelgroup *water-anim-village2-bucket-sg* water-anim-village2 - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 0.7) - :longest-edge (meters 0) - ) +(defskelgroup *water-anim-village2-bucket-sg* water-anim-village2 water-anim-village2-bucket-lod0-jg -1 + ((water-anim-village2-bucket-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.7) + ) ;; definition of type water-anim-look (deftype water-anim-look (structure) @@ -476,340 +349,137 @@ ) ;; definition for symbol *water-anim-look*, type (array water-anim-look) -(define - *water-anim-look* +(define *water-anim-look* (the-as (array water-anim-look) - (new - 'static - 'boxed-array - :type water-anim-look :length 48 :allocated-length 48 + (new 'static 'boxed-array :type water-anim-look (new 'static 'water-anim-look :skel-group '*water-anim-sunken-big-room-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 70 - :fo-max 80 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 70 :fo-max 80) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-first-room-from-entrance-sg* + :skel-group '*water-anim-sunken-first-room-from-entrance-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 50 - :fo-max 60 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 50 :fo-max 60) ) (new 'static 'water-anim-look :skel-group '*water-anim-sunken-qbert-room-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 48 - :fo-max 58 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 48 :fo-max 58) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-first-right-branch-sg* + :skel-group '*water-anim-sunken-first-right-branch-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 30 - :fo-max 40 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 30 :fo-max 40) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-circular-with-bullys-sg* + :skel-group '*water-anim-sunken-circular-with-bullys-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 15 - :fo-max 25 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 15 :fo-max 25) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-hall-with-one-whirlpool-sg* + :skel-group '*water-anim-sunken-hall-with-one-whirlpool-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 27 - :fo-max 37 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 27 :fo-max 37) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-hall-with-three-whirlpools-sg* + :skel-group '*water-anim-sunken-hall-with-three-whirlpools-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 26 - :fo-max 36 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 26 :fo-max 36) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-start-of-helix-slide-sg* + :skel-group '*water-anim-sunken-start-of-helix-slide-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 25 - :fo-max 35 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 25 :fo-max 35) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-room-above-exit-chamber-sg* + :skel-group '*water-anim-sunken-room-above-exit-chamber-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 45 - :fo-max 55 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 45 :fo-max 55) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-hall-before-big-room-sg* + :skel-group '*water-anim-sunken-hall-before-big-room-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 20 - :fo-max 30 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 20 :fo-max 30) ) (new 'static 'water-anim-look :skel-group '*water-anim-sunken-dark-eco-qbert-sg* :anim 6 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 40 - :fo-max 50 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 40 :fo-max 50) ) (new 'static 'water-anim-look :skel-group '*water-anim-sunken-short-piece-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 20 - :fo-max 30 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 20 :fo-max 30) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-big-room-upper-water-sg* + :skel-group '*water-anim-sunken-big-room-upper-water-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "water-loop") - :volume #x400 - :fo-min 27 - :fo-max 37 - ) + :ambient-sound-spec (static-sound-spec "water-loop" :fo-min 27 :fo-max 37) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-dark-eco-platform-room-sg* + :skel-group '*water-anim-sunken-dark-eco-platform-room-sg* :anim 6 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 22 - :fo-max 32 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 22 :fo-max 32) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-maincave-water-with-crystal-sg* + :skel-group '*water-anim-maincave-water-with-crystal-sg* :anim 2 :ambient-sound-spec #f ) (new 'static 'water-anim-look :skel-group '*water-anim-maincave-center-pool-sg* :anim 10 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 70 - :fo-max 80 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 70 :fo-max 80) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-maincave-lower-right-pool-sg* + :skel-group '*water-anim-maincave-lower-right-pool-sg* :anim 10 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 40 - :fo-max 50 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 40 :fo-max 50) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-maincave-mid-right-pool-sg* + :skel-group '*water-anim-maincave-mid-right-pool-sg* :anim 10 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 37 - :fo-max 47 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 37 :fo-max 47) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-maincave-lower-left-pool-sg* + :skel-group '*water-anim-maincave-lower-left-pool-sg* :anim 10 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 20 - :fo-max 30 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 20 :fo-max 30) ) (new 'static 'water-anim-look :skel-group '*water-anim-maincave-mid-left-pool-sg* :anim 10 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 51 - :fo-max 61 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 51 :fo-max 61) ) (new 'static 'water-anim-look :skel-group '*water-anim-robocave-main-pool-sg* :anim 3 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 54 - :fo-max 64 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 54 :fo-max 64) ) (new 'static 'water-anim-look :skel-group '*water-anim-misty-mud-by-arena-sg* :anim 24 :ambient-sound-spec #f) (new 'static 'water-anim-look - :skel-group - '*water-anim-misty-mud-above-skeleton-sg* + :skel-group '*water-anim-misty-mud-above-skeleton-sg* :anim 24 :ambient-sound-spec #f ) (new 'static 'water-anim-look - :skel-group - '*water-anim-misty-mud-behind-skeleton-sg* + :skel-group '*water-anim-misty-mud-behind-skeleton-sg* :anim 24 :ambient-sound-spec #f ) (new 'static 'water-anim-look - :skel-group - '*water-anim-misty-mud-above-skull-back-sg* + :skel-group '*water-anim-misty-mud-above-skull-back-sg* :anim 24 :ambient-sound-spec #f ) (new 'static 'water-anim-look - :skel-group - '*water-anim-misty-mud-above-skull-front-sg* + :skel-group '*water-anim-misty-mud-above-skull-front-sg* :anim 24 :ambient-sound-spec #f ) (new 'static 'water-anim-look - :skel-group - '*water-anim-misty-mud-other-near-skull-sg* + :skel-group '*water-anim-misty-mud-other-near-skull-sg* :anim 24 :ambient-sound-spec #f ) @@ -825,72 +495,40 @@ ) (new 'static 'water-anim-look :skel-group '*water-anim-misty-mud-by-dock-sg* :anim 24 :ambient-sound-spec #f) (new 'static 'water-anim-look - :skel-group - '*water-anim-misty-mud-island-near-dock-sg* + :skel-group '*water-anim-misty-mud-island-near-dock-sg* :anim 24 :ambient-sound-spec #f ) (new 'static 'water-anim-look - :skel-group - '*water-anim-misty-mud-lonely-island-sg* + :skel-group '*water-anim-misty-mud-lonely-island-sg* :anim 24 :ambient-sound-spec #f ) (new 'static 'water-anim-look :skel-group '*water-anim-misty-dark-eco-pool-sg* :anim 24 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 17 - :fo-max 27 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 17 :fo-max 27) ) (new 'static 'water-anim-look :skel-group '*water-anim-ogre-lava-sg* :anim 2 :ambient-sound-spec #f) (new 'static 'water-anim-look :skel-group '*water-anim-jungle-river-sg* :anim 3 :ambient-sound-spec #f) (new 'static 'water-anim-look :skel-group '*water-anim-village3-lava-sg* :anim 3 :ambient-sound-spec #f) (new 'static 'water-anim-look :skel-group '*water-anim-training-lake-sg* :anim 2 :ambient-sound-spec #f) (new 'static 'water-anim-look - :skel-group - '*water-anim-darkcave-water-with-crystal-sg* + :skel-group '*water-anim-darkcave-water-with-crystal-sg* :anim 2 :ambient-sound-spec #f ) (new 'static 'water-anim-look :skel-group '*water-anim-rolling-water-back-sg* :anim 4 :ambient-sound-spec #f) (new 'static 'water-anim-look :skel-group '*water-anim-rolling-water-front-sg* :anim 4 :ambient-sound-spec #f) (new 'static 'water-anim-look - :skel-group - '*water-anim-sunken-dark-eco-helix-room-sg* + :skel-group '*water-anim-sunken-dark-eco-helix-room-sg* :anim 6 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "helix-dark-eco") - :volume #x400 - :fo-min #x78 - :fo-max #x82 - ) + :ambient-sound-spec (static-sound-spec "helix-dark-eco" :fo-min 120 :fo-max 130) ) (new 'static 'water-anim-look - :skel-group - '*water-anim-finalboss-dark-eco-pool-sg* + :skel-group '*water-anim-finalboss-dark-eco-pool-sg* :anim 2 - :ambient-sound-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "darkeco-pool") - :volume #x400 - :fo-min 19 - :fo-max 29 - ) + :ambient-sound-spec (static-sound-spec "darkeco-pool" :fo-min 19 :fo-max 29) ) (new 'static 'water-anim-look :skel-group '*water-anim-lavatube-energy-lava-sg* @@ -900,14 +538,12 @@ (new 'static 'water-anim-look :skel-group '*water-anim-village1-rice-paddy-sg* :anim 8 :ambient-sound-spec #f) (new 'static 'water-anim-look :skel-group '*water-anim-village1-fountain-sg* :anim 8 :ambient-sound-spec #f) (new 'static 'water-anim-look - :skel-group - '*water-anim-village1-rice-paddy-mid-sg* + :skel-group '*water-anim-village1-rice-paddy-mid-sg* :anim 8 :ambient-sound-spec #f ) (new 'static 'water-anim-look - :skel-group - '*water-anim-village1-rice-paddy-top-sg* + :skel-group '*water-anim-village1-rice-paddy-top-sg* :anim 8 :ambient-sound-spec #f ) @@ -919,8 +555,7 @@ ;; failed to figure out what this is: (defstate water-vol-idle (water-anim) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'move-to) (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) @@ -936,8 +571,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (let ((t9-0 (-> (method-of-type water-vol water-vol-idle) trans))) (if t9-0 (t9-0) @@ -952,9 +586,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (ja-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -975,7 +608,7 @@ ) ;; definition for method 25 of type water-anim -;; INFO: Return type mismatch quaternion vs object. +;; INFO: Return type mismatch quaternion vs none. ;; Used lq/sq (defmethod TODO-RENAME-25 water-anim ((obj water-anim)) (local-vars (sv-16 res-tag)) @@ -990,11 +623,11 @@ ) ) (let ((f0-6 (res-lump-float (-> obj entity) 'rotoffset))) - (the-as object (if (!= f0-6 0.0) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-6) - ) - ) + (if (!= f0-6 0.0) + (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-6) + ) ) + (none) ) ;; definition for method 22 of type water-anim diff --git a/test/decompiler/reference/levels/darkcave/darkcave-obs_REF.gc b/test/decompiler/reference/levels/darkcave/darkcave-obs_REF.gc index 77f60f3a27..f3787e726c 100644 --- a/test/decompiler/reference/levels/darkcave/darkcave-obs_REF.gc +++ b/test/decompiler/reference/levels/darkcave/darkcave-obs_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/cavecrystal-ag.gc") + ;; definition of type cavecrystal (deftype cavecrystal (process-drawable) ((root-override collide-shape :offset 112) @@ -58,13 +60,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *cavecrystal-sg* cavecrystal - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 4.7 0 5.4) - :longest-edge (meters 0) - ) +(defskelgroup *cavecrystal-sg* cavecrystal cavecrystal-lod0-jg -1 + ((cavecrystal-lod0-mg (meters 20)) (cavecrystal-lod1-mg (meters 999999))) + :bounds (static-spherem 0 4.7 0 5.4) + ) ;; definition for method 20 of type cavecrystal ;; INFO: Return type mismatch int vs none. @@ -92,13 +91,13 @@ (f30-1 (* 0.1 (cos (* 65536.0 f0-2)))) ) (cond - ((>= (seconds 0.06666667) gp-1) + ((>= (seconds 0.067) gp-1) (let ((v1-11 (* 0.05 (the float gp-1)))) (fmax 0.0 (fmin 2.0 (+ (* 2.0 v1-11) (* v1-11 f30-1)))) ) ) ((>= (seconds 0.6) gp-1) - (let ((a2-0 (* 0.00625 (the float (+ gp-1 (seconds -0.06666667)))))) + (let ((a2-0 (* 0.00625 (the float (+ gp-1 (seconds -0.067)))))) (fmin 2.0 (+ (lerp 2.0 1.0 a2-0) f30-1)) ) ) @@ -116,16 +115,14 @@ ;; failed to figure out what this is: (defstate cavecrystal-idle (cavecrystal) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (go cavecrystal-active) ) ) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (level-hint-spawn (game-text-id darkcave-light-crystal-hint) @@ -138,8 +135,7 @@ (update-connected-crystals! self) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -149,8 +145,7 @@ ;; failed to figure out what this is: (defstate cavecrystal-active (cavecrystal) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'attack) (let ((v1-1 (-> arg3 param 2))) @@ -169,23 +164,20 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self activated-time) (-> *display* game-frame-counter)) (set! (-> self prev-compute-glow-time) (-> *display* game-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (if (not (-> self is-master?)) (logior! (-> self mask) (process-mask actor-pause)) ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (compute-glow self))) (set! (-> self glow-u) f30-0) (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -224,8 +216,7 @@ (update! (-> self sound)) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -295,19 +286,8 @@ (ja-post) (update-transforms! (-> obj root-override)) (TODO-RENAME-9 *cavecrystal-light-control* (-> obj crystal-id) 0.0 obj) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "crystal-on") - :volume #x400 - :fo-max 80 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "crystal-on" :fo-max 80) (-> obj root-override trans)) ) (go cavecrystal-idle) (none) diff --git a/test/decompiler/reference/levels/demo/demo-obs_REF.gc b/test/decompiler/reference/levels/demo/demo-obs_REF.gc index 8a2497dd53..93bfa22b37 100644 --- a/test/decompiler/reference/levels/demo/demo-obs_REF.gc +++ b/test/decompiler/reference/levels/demo/demo-obs_REF.gc @@ -3,33 +3,64 @@ ;; failed to figure out what this is: (defstate target-demo (target) - :event - target-generic-event-handler - :code - (behavior () + :event target-generic-event-handler + :code (behavior () (if *time-of-day-proc* (set! (-> *time-of-day-proc* 0 hour) 12) ) - (set-setting! *setting-control* self 'allow-pause #f 0.0 0) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) - (copy-settings-from-target! *setting-control*) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (apply-settings *setting-control*) (ja-channel-set! 0) (ja-post) (load-state-want-levels 'demo 'village1) (load-state-want-vis 'vi1) (case (scf-get-territory) ((2) - (let ((gp-0 (ppointer->handle (static-screen-spawn 6 #x27c00000 #x27c00100 #x27c00200 1500 #f self)))) + (let ((gp-0 (ppointer->handle (static-screen-spawn + 6 + (new 'static 'texture-id :page #x27c) + (new 'static 'texture-id :index #x1 :page #x27c) + (new 'static 'texture-id :index #x2 :page #x27c) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-0) (suspend) ) ) - (let ((gp-1 (ppointer->handle (static-screen-spawn 7 #x27d00000 #x27d00100 #x27d00200 1500 #f self)))) + (let ((gp-1 (ppointer->handle (static-screen-spawn + 7 + (new 'static 'texture-id :page #x27d) + (new 'static 'texture-id :index #x1 :page #x27d) + (new 'static 'texture-id :index #x2 :page #x27d) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-1) (suspend) ) ) - (let ((gp-2 (ppointer->handle (static-screen-spawn 8 #x2f000000 #x2f000100 #x2f000200 #x4650 #t self)))) + (let ((gp-2 (ppointer->handle (static-screen-spawn + 8 + (new 'static 'texture-id :page #x2f0) + (new 'static 'texture-id :index #x1 :page #x2f0) + (new 'static 'texture-id :index #x2 :page #x2f0) + (seconds 60) + #t + self + ) + ) + ) + ) (while (handle->process gp-2) (suspend) ) @@ -38,77 +69,198 @@ ((1) (case (-> *setting-control* current language) (((language-enum french)) - (let ((gp-3 (ppointer->handle (static-screen-spawn 10 #x63f00000 #x63f00100 #x63f00200 1500 #f self)))) + (let ((gp-3 (ppointer->handle (static-screen-spawn + 10 + (new 'static 'texture-id :page #x63f) + (new 'static 'texture-id :index #x1 :page #x63f) + (new 'static 'texture-id :index #x2 :page #x63f) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-3) (suspend) ) ) ) (((language-enum german)) - (let ((gp-4 (ppointer->handle (static-screen-spawn 11 #x64000000 #x64000100 #x64000200 1500 #f self)))) + (let ((gp-4 (ppointer->handle (static-screen-spawn + 11 + (new 'static 'texture-id :page #x640) + (new 'static 'texture-id :index #x1 :page #x640) + (new 'static 'texture-id :index #x2 :page #x640) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-4) (suspend) ) ) ) (((language-enum italian)) - (let ((gp-5 (ppointer->handle (static-screen-spawn 12 #x64100000 #x64100100 #x64100200 1500 #f self)))) + (let ((gp-5 (ppointer->handle (static-screen-spawn + 12 + (new 'static 'texture-id :page #x641) + (new 'static 'texture-id :index #x1 :page #x641) + (new 'static 'texture-id :index #x2 :page #x641) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-5) (suspend) ) ) ) (((language-enum spanish)) - (let ((gp-6 (ppointer->handle (static-screen-spawn 13 #x64200000 #x64200100 #x64200200 1500 #f self)))) + (let ((gp-6 (ppointer->handle (static-screen-spawn + 13 + (new 'static 'texture-id :page #x642) + (new 'static 'texture-id :index #x1 :page #x642) + (new 'static 'texture-id :index #x2 :page #x642) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-6) (suspend) ) ) ) (else - (let ((gp-7 (ppointer->handle (static-screen-spawn 2 #x5cd00000 #x5cd00100 #x5cd00200 1500 #f self)))) + (let ((gp-7 (ppointer->handle (static-screen-spawn + 2 + (new 'static 'texture-id :page #x5cd) + (new 'static 'texture-id :index #x1 :page #x5cd) + (new 'static 'texture-id :index #x2 :page #x5cd) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-7) (suspend) ) ) ) ) - (let ((gp-8 (ppointer->handle (static-screen-spawn 3 #x5ce00000 #x5ce00100 #x5ce00200 1500 #f self)))) + (let ((gp-8 (ppointer->handle (static-screen-spawn + 3 + (new 'static 'texture-id :page #x5ce) + (new 'static 'texture-id :index #x1 :page #x5ce) + (new 'static 'texture-id :index #x2 :page #x5ce) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-8) (suspend) ) ) (case (-> *setting-control* current language) (((language-enum french)) - (let ((gp-9 (ppointer->handle (static-screen-spawn 15 #x64400000 #x64400100 #x64400200 #x4650 #t self)))) + (let ((gp-9 (ppointer->handle (static-screen-spawn + 15 + (new 'static 'texture-id :page #x644) + (new 'static 'texture-id :index #x1 :page #x644) + (new 'static 'texture-id :index #x2 :page #x644) + (seconds 60) + #t + self + ) + ) + ) + ) (while (handle->process gp-9) (suspend) ) ) ) (((language-enum german)) - (let ((gp-10 (ppointer->handle (static-screen-spawn 16 #x64500000 #x64500100 #x64500200 #x4650 #t self)))) + (let ((gp-10 (ppointer->handle (static-screen-spawn + 16 + (new 'static 'texture-id :page #x645) + (new 'static 'texture-id :index #x1 :page #x645) + (new 'static 'texture-id :index #x2 :page #x645) + (seconds 60) + #t + self + ) + ) + ) + ) (while (handle->process gp-10) (suspend) ) ) ) (((language-enum italian)) - (let ((gp-11 (ppointer->handle (static-screen-spawn 17 #x64600000 #x64600100 #x64600200 #x4650 #t self)))) + (let ((gp-11 (ppointer->handle (static-screen-spawn + 17 + (new 'static 'texture-id :page #x646) + (new 'static 'texture-id :index #x1 :page #x646) + (new 'static 'texture-id :index #x2 :page #x646) + (seconds 60) + #t + self + ) + ) + ) + ) (while (handle->process gp-11) (suspend) ) ) ) (((language-enum spanish)) - (let ((gp-12 (ppointer->handle (static-screen-spawn 18 #x64700000 #x64700100 #x64700200 #x4650 #t self)))) + (let ((gp-12 (ppointer->handle (static-screen-spawn + 18 + (new 'static 'texture-id :page #x647) + (new 'static 'texture-id :index #x1 :page #x647) + (new 'static 'texture-id :index #x2 :page #x647) + (seconds 60) + #t + self + ) + ) + ) + ) (while (handle->process gp-12) (suspend) ) ) ) (else - (let ((gp-13 (ppointer->handle (static-screen-spawn 14 #x64300000 #x64300100 #x64300200 #x4650 #t self)))) + (let ((gp-13 (ppointer->handle (static-screen-spawn + 14 + (new 'static 'texture-id :page #x643) + (new 'static 'texture-id :index #x1 :page #x643) + (new 'static 'texture-id :index #x2 :page #x643) + (seconds 60) + #t + self + ) + ) + ) + ) (while (handle->process gp-13) (suspend) ) @@ -117,45 +269,65 @@ ) ) (else - (let ((gp-14 (ppointer->handle (static-screen-spawn 2 #x5cd00000 #x5cd00100 #x5cd00200 1500 #f self)))) + (let ((gp-14 (ppointer->handle (static-screen-spawn + 2 + (new 'static 'texture-id :page #x5cd) + (new 'static 'texture-id :index #x1 :page #x5cd) + (new 'static 'texture-id :index #x2 :page #x5cd) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-14) (suspend) ) ) - (let ((gp-15 (ppointer->handle (static-screen-spawn 3 #x5ce00000 #x5ce00100 #x5ce00200 1500 #f self)))) + (let ((gp-15 (ppointer->handle (static-screen-spawn + 3 + (new 'static 'texture-id :page #x5ce) + (new 'static 'texture-id :index #x1 :page #x5ce) + (new 'static 'texture-id :index #x2 :page #x5ce) + (seconds 5) + #f + self + ) + ) + ) + ) (while (handle->process gp-15) (suspend) ) ) - (let ((gp-16 (ppointer->handle (static-screen-spawn 4 #x5cf00000 #x5cf00100 #x5cf00200 #x4650 #t self)))) + (let ((gp-16 (ppointer->handle (static-screen-spawn + 4 + (new 'static 'texture-id :page #x5cf) + (new 'static 'texture-id :index #x1 :page #x5cf) + (new 'static 'texture-id :index #x2 :page #x5cf) + (seconds 60) + #t + self + ) + ) + ) + ) (while (handle->process gp-16) (suspend) ) ) ) ) - (let ((gp-17 (get-process *default-dead-pool* process #x4000))) - (when gp-17 - (let ((t9-26 (method-of-type process activate))) - (t9-26 gp-17 *default-pool* 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process gp-17 (lambda () - (set! (-> *setting-control* default bg-a) 0.0) - (start 'play (get-continue-by-name *game-info* "village1-demo-convo")) - ) - ) - (-> gp-17 ppointer) - ) - ) - (while #t + (process-spawn-function process (lambda () + (set! (-> *setting-control* default bg-a) 0.0) + (start 'play (get-continue-by-name *game-info* "village1-demo-convo")) + ) + ) + (loop (suspend) ) (none) ) - :post - target-no-move-post + :post target-no-move-post ) - - - - diff --git a/test/decompiler/reference/levels/demo/static-screen_REF.gc b/test/decompiler/reference/levels/demo/static-screen_REF.gc index 2e8ad27cd0..8ca811c2b1 100644 --- a/test/decompiler/reference/levels/demo/static-screen_REF.gc +++ b/test/decompiler/reference/levels/demo/static-screen_REF.gc @@ -57,8 +57,7 @@ ;; failed to figure out what this is: (defpart 2966 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x5c6)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x5c6)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1.18)) (sp-flt spt-scale-x (meters 15)) @@ -74,8 +73,7 @@ ;; failed to figure out what this is: (defpart 2967 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x5c6)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x5c6)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -1.264)) (sp-flt spt-scale-x (meters 15)) @@ -91,8 +89,7 @@ ;; failed to figure out what this is: (defpart 2968 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x5c6)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x5c6)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -2.482)) (sp-flt spt-scale-x (meters 15)) @@ -111,29 +108,25 @@ :id 707 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2966 :flags (launch-asap)) (sp-item 2967 :flags (launch-asap)) (sp-item 2968 :flags (launch-asap))) + :parts ((sp-item 2966 :flags (launch-asap)) (sp-item 2967 :flags (launch-asap)) (sp-item 2968 :flags (launch-asap))) ) ;; failed to figure out what this is: (defstate idle (static-screen) :virtual #t - :enter - (behavior ((arg0 int) (arg1 time-frame) (arg2 symbol)) + :enter (behavior ((arg0 int) (arg1 time-frame) (arg2 symbol)) (set! (-> *setting-control* current bg-a) 1.0) (set! (-> *setting-control* default bg-a) 0.0) - (push-setting! *setting-control* self 'common-page 'set 0.0 (ash 1 (+ arg0 1))) + (add-setting! 'common-page 'set 0.0 (ash 1 (+ arg0 1))) (none) ) - :trans - (behavior () + :trans (behavior () (hide-hud-quick) (spawn (-> self part 0) *zero-vector*) 0 (none) ) - :code - (behavior ((arg0 int) (arg1 time-frame) (arg2 symbol)) + :code (behavior ((arg0 int) (arg1 time-frame) (arg2 symbol)) (local-vars (v1-6 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (until v1-6 @@ -150,7 +143,7 @@ (while (!= (-> *setting-control* current bg-a) (-> *setting-control* default bg-a)) (suspend) ) - (clear-pending-settings-from-process *setting-control* self 'common-page) + (remove-setting! 'common-page) (suspend) 0 (none) @@ -159,7 +152,7 @@ ;; definition for function static-screen-init-by-other ;; INFO: Return type mismatch int vs none. -(defbehavior static-screen-init-by-other static-screen ((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 time-frame) (arg5 symbol)) +(defbehavior static-screen-init-by-other static-screen ((arg0 int) (arg1 texture-id) (arg2 texture-id) (arg3 texture-id) (arg4 time-frame) (arg5 symbol)) (let ((s3-0 (lookup-part-group-by-name "group-part-screen1"))) (when (and s3-0 (nonzero? s3-0) (type-type? (-> s3-0 type) sparticle-launch-group)) (set! (-> *part-id-table* 2966 init-specs 0 initial-valuef) (the-as float arg1)) @@ -174,15 +167,26 @@ ) ;; definition for function static-screen-spawn +;; INFO: Return type mismatch (pointer process) vs (pointer static-screen). ;; Used lq/sq -(defun static-screen-spawn ((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 symbol) (arg6 target)) +(defun static-screen-spawn ((arg0 int) + (arg1 texture-id) + (arg2 texture-id) + (arg3 texture-id) + (arg4 time-frame) + (arg5 symbol) + (arg6 process-tree) + ) (local-vars (sv-16 process)) (set! sv-16 (get-process *default-dead-pool* static-screen #x4000)) - (when sv-16 - (let ((t9-1 (method-of-type static-screen activate))) - (t9-1 (the-as static-screen sv-16) arg6 'static-screen (the-as pointer #x70004000)) + (the-as + (pointer static-screen) + (when sv-16 + (let ((t9-1 (method-of-type static-screen activate))) + (t9-1 (the-as static-screen sv-16) arg6 'static-screen (the-as pointer #x70004000)) + ) + (run-now-in-process sv-16 static-screen-init-by-other arg0 arg1 arg2 arg3 arg4 arg5) + (-> sv-16 ppointer) ) - (run-now-in-process sv-16 static-screen-init-by-other arg0 arg1 arg2 arg3 arg4 arg5) - (-> sv-16 ppointer) ) ) diff --git a/test/decompiler/reference/levels/finalboss/final-door_REF.gc b/test/decompiler/reference/levels/finalboss/final-door_REF.gc index 2f1d4e0bf3..3ec6d518f6 100644 --- a/test/decompiler/reference/levels/finalboss/final-door_REF.gc +++ b/test/decompiler/reference/levels/finalboss/final-door_REF.gc @@ -1,6 +1,10 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/power-left-ag.gc") +(import "goal_src/import/power-right-ag.gc") +(import "goal_src/import/powercellalt-ag.gc") + ;; definition of type fin-door (deftype fin-door (process-hidden) () @@ -64,45 +68,34 @@ ) ;; failed to figure out what this is: -(defskelgroup *power-left-sg* power-left - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 11 0 12) - :longest-edge (meters 0) - ) +(defskelgroup *power-left-sg* power-left power-left-lod0-jg power-left-idle-ja + ((power-left-lod0-mg (meters 999999))) + :bounds (static-spherem 0 11 0 12) + ) ;; failed to figure out what this is: -(defskelgroup *power-right-sg* power-right - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 11 0 12) - :longest-edge (meters 0) - ) +(defskelgroup *power-right-sg* power-right power-right-lod0-jg power-right-idle-ja + ((power-right-lod0-mg (meters 999999))) + :bounds (static-spherem 0 11 0 12) + ) ;; failed to figure out what this is: -(defskelgroup *powercellalt-sg* powercellalt - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *powercellalt-sg* powercellalt powercellalt-lod0-jg powercellalt-idle-ja + ((powercellalt-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) ;; failed to figure out what this is: (defstate idle (final-door) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('open) (go-virtual open #f) ) ) ) - :code - (behavior () + :code (behavior () (transform-post) (logior! (-> self mask) (process-mask sleep)) (suspend) @@ -114,8 +107,7 @@ ;; failed to figure out what this is: (defstate open (final-door) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'brightness) (let ((f0-0 (the-as float (-> arg3 param 0))) @@ -134,47 +126,22 @@ ) ) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (case (-> self type) ((power-left) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 0.353) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! max 0.353) :frame-num 0.0) (until (ja-done? 0) (transform-post) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 0.353) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.353)) ) ) (else - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 0.353) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! max 0.353) :frame-num 0.0) (until (ja-done? 0) (transform-post) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 0.353) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.353)) ) ) ) @@ -251,12 +218,11 @@ ;; failed to figure out what this is: (defstate idle (power-left) :virtual #t - :code - (behavior () + :code (behavior () (ja-post) - (while #t + (loop (if (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (and (zero? (logand (-> *target* state-flags) 256)) + (and (zero? (logand (-> *target* state-flags) (state-flags grabbed))) (and (>= (-> *game-info* fuel) 100.0) (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (= (get-task-status (game-task finalboss-movies)) (task-status need-reward-speech)) @@ -326,9 +292,8 @@ ;; failed to figure out what this is: (defstate jump (powercellalt) :virtual #t - :code - (behavior () - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (sound-play "cell-prize") (let ((gp-1 (new 'stack 'trajectory))) (set! (-> self base y) (-> self jump-pos y)) (setup-from-to-duration! gp-1 (-> self root-override trans) (-> self jump-pos) 300.0 -2.2755556) @@ -340,35 +305,25 @@ (transform-post) (spawn (-> self part) (the-as vector (-> self root-override root-prim prim-core))) (suspend) - (when (nonzero? (-> self skel)) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) 0.5) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-loop!) + (if (nonzero? (-> self skel)) + (ja :num! (loop! 0.5)) ) - ) ) ) (set! (-> self root-override trans quad) (-> self jump-pos quad)) (set! (-> self base quad) (-> self root-override trans quad)) (transform-post) - (sound-play-by-name (static-sound-name "land-pcmetal") (new-sound-id) 1024 3048 0 1 #t) - (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-3 - (let ((t9-12 (method-of-type part-tracker activate))) - (t9-12 (the-as part-tracker gp-3) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-3 - part-tracker-init - (-> *part-group-id-table* 4) - -1 - #f - #f - #f - (-> self root-override root-prim prim-core) - ) - (-> gp-3 ppointer) - ) + (sound-play "land-pcmetal" :pitch 2) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 4) + -1 + #f + #f + #f + (-> self root-override root-prim prim-core) + :to *entity-pool* ) (go-virtual idle) (none) @@ -378,9 +333,8 @@ ;; failed to figure out what this is: (defstate idle (powercellalt) :virtual #t - :code - (behavior () - (while #t + :code (behavior () + (loop (vector<-cspace! (-> self root-override trans) (-> (the-as process-drawable (-> self parent 0)) node-list data (-> self index)) @@ -395,7 +349,7 @@ ;; definition for function powercellalt-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior powercellalt-init-by-other powercellalt ((arg0 entity) (arg1 vector) (arg2 vector) (arg3 int)) +(defbehavior powercellalt-init-by-other powercellalt ((arg0 entity-actor) (arg1 vector) (arg2 vector) (arg3 int)) (set! (-> self entity) arg0) (let ((s3-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) (set! (-> s3-0 dynam) (copy *standard-dynamics* 'process)) @@ -428,33 +382,28 @@ ;; failed to figure out what this is: (defstate target-final-door (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) ((-> target-grab event) arg0 arg1 arg2 arg3) ) - :enter - (behavior ((arg0 basic) (arg1 handle)) + :enter (behavior ((arg0 basic) (arg1 handle)) (send-event *camera* 'change-to-entity-by-name "camera-403") (set! (-> self control unknown-surface00) *empty-mods*) - (logior! (-> self state-flags) 272) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) + (logior! (-> self state-flags) (state-flags invulnerable grabbed)) + (set-setting! 'allow-progress #f 0.0 0) (none) ) - :exit - (behavior () - (send-event *camera* 'change-state *camera-base-mode* 60) - (set! (-> self state-flags) (logand -273 (-> self state-flags))) + :exit (behavior () + (send-event *camera* 'change-state *camera-base-mode* (seconds 0.2)) + (logclear! (-> self state-flags) (state-flags invulnerable grabbed)) (target-exit) - (clear-pending-settings-from-process *setting-control* self 'allow-progress) + (remove-setting! 'allow-progress) (none) ) - :trans - (behavior () - (set-letterbox-frames (seconds 0.016666668)) + :trans (behavior () + (set-letterbox-frames (seconds 0.017)) (none) ) - :code - (behavior ((arg0 basic) (arg1 handle)) + :code (behavior ((arg0 basic) (arg1 handle)) (local-vars (sv-144 process) (sv-160 vector) (sv-176 process) (sv-192 vector)) (let ((a0-2 (get-task-control (game-task finalboss-movies)))) (save-reminder a0-2 (logior (get-reminder a0-2 0) 2) 0) @@ -463,21 +412,11 @@ (set-quaternion! (-> self control) (the-as quaternion (new 'static 'vector :y -0.8472 :w 0.5312))) (rot->dir-targ! (-> self control)) (transform-post) - (ja-channel-push! 1 60) - (let ((s4-1 (-> self skel root-channel 0))) - (set! (-> s4-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 88))) - (set! (-> s4-1 param 0) (ja-aframe 18.0 0)) - (set! (-> s4-1 param 1) 1.0) - (set! (-> s4-1 frame-num) 0.0) - (joint-control-channel-group! s4-1 (the-as art-joint-anim (-> self draw art-group data 88)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 88) :num! (seek! (ja-aframe 18.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((s4-2 (-> self skel root-channel 0))) - (set! (-> s4-2 param 0) (ja-aframe 18.0 0)) - (set! (-> s4-2 param 1) 1.0) - (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 18.0 0))) ) (let ((s4-3 (-> (handle->process (the-as handle arg0)) entity)) (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 7))) @@ -552,6 +491,5 @@ (go target-stance) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) diff --git a/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc b/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc index 76c068bd70..db8c0277af 100644 --- a/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc +++ b/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/green-eco-lurker-ag.gc") + ;; definition of type green-eco-lurker (deftype green-eco-lurker (nav-enemy) ((played-sound? symbol :offset-assert 400) @@ -62,14 +64,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *green-eco-lurker-sg* green-eco-lurker - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5.95) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *green-eco-lurker-sg* green-eco-lurker green-eco-lurker-lod0-jg -1 + ((green-eco-lurker-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.95) + :shadow green-eco-lurker-shadow-mg + ) ;; definition for symbol *green-eco-lurker-nav-enemy-info*, type nav-enemy-info (define *green-eco-lurker-nav-enemy-info* (new 'static 'nav-enemy-info @@ -120,7 +119,7 @@ :use-proximity-notice #f :use-jump-blocked #t :use-jump-patrol #f - :gnd-collide-with #x805 + :gnd-collide-with (collide-kind background cak-2 ground-object) :debug-draw-neck #f :debug-draw-jump #f ) @@ -132,8 +131,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2585 :fade-after (meters 100) :period 600 :length 5 :binding 2583) + :parts ((sp-item 2585 :fade-after (meters 100) :period 600 :length 5 :binding 2583) (sp-item 2583 :flags (start-dead launch-asap) :binding 2584) (sp-item 2584 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) (sp-item 2583 :flags (start-dead launch-asap) :binding 2584) @@ -175,8 +173,7 @@ ;; failed to figure out what this is: (defpart 2587 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -201,14 +198,12 @@ ;; failed to figure out what this is: (defpart 2590 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) ) ;; failed to figure out what this is: (defpart 2589 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-scale-x (meters 0.2)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) @@ -226,8 +221,7 @@ ;; failed to figure out what this is: (defpart 2586 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 16)) (sp-copy-from-other spt-scale-y -4) @@ -243,8 +237,7 @@ ;; failed to figure out what this is: (defpart 2588 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -269,8 +262,7 @@ ;; failed to figure out what this is: (defpart 2585 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 0.1)) @@ -288,8 +280,7 @@ ;; failed to figure out what this is: (defpart 2583 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.3) (meters 0.3) 1.0) @@ -314,8 +305,7 @@ ;; failed to figure out what this is: (defpart 2584 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -367,11 +357,12 @@ ;; definition for method 44 of type green-eco-lurker (defmethod dummy-44 green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) - (when (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) @@ -381,11 +372,12 @@ ;; definition for method 72 of type green-eco-lurker (defmethod nav-enemy-touch-handler green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) - (when (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) @@ -431,44 +423,37 @@ ;; failed to figure out what this is: (defstate green-eco-lurker-tune-spheres (green-eco-lurker) - :trans - (behavior () + :trans (behavior () 0 (none) ) - :code - (behavior () + :code (behavior () 0 (none) ) - :post - (the-as (function none :behavior green-eco-lurker) transform-post) + :post (the-as (function none :behavior green-eco-lurker) transform-post) ) ;; failed to figure out what this is: (defstate green-eco-lurker-wait-to-appear (green-eco-lurker) - :enter - (behavior () + :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self collide-info)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self collide-info)) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-52 self (-> self appear-dest)) (go green-eco-lurker-appear) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -488,7 +473,7 @@ (v1-7 (-> obj draw shadow-ctrl)) ) (let ((a0-1 v1-7)) - (set! (-> a0-1 settings flags) (logand -33 (-> a0-1 settings flags))) + (logclear! (-> a0-1 settings flags) (shadow-flags disable-draw)) ) 0 (let ((a0-3 v1-7)) @@ -501,7 +486,7 @@ ) (else (let ((v1-9 (-> obj draw shadow-ctrl))) - (logior! (-> v1-9 settings flags) 32) + (logior! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -511,8 +496,7 @@ ;; failed to figure out what this is: (defstate green-eco-lurker-appear (green-eco-lurker) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self played-sound?) #f) (set! (-> self sound-delay) (nav-enemy-rnd-int-range 30 150)) @@ -521,21 +505,23 @@ (+ (-> (the-as green-eco-lurker-gen (-> self parent 0)) root trans x) (fmax -32768.0 (fmin 32768.0 f0-1))) ) ) - (logior! (-> self collide-info nav-flags) 2) + (logior! (-> self collide-info nav-flags) (nav-flags navf1)) (set! (-> self nav extra-nav-sphere quad) (-> self appear-dest quad)) (set! (-> self nav extra-nav-sphere w) 8192.0) (setup-from-to-duration! (-> self traj) (-> self collide-info trans) (-> self appear-dest) 225.0 -9.102222) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self collide-info trans quad)) (set! (-> gp-0 y) (+ 8192.0 (-> gp-0 y))) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker s5-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 part-tracker-init (-> *part-group-id-table* 643) -1 #f #f #f gp-0) - (-> s5-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 643) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (let ((gp-1 (new 'stack-no-clear 'vector))) @@ -546,13 +532,12 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (fmin (the float (- (-> *display* base-frame-counter) (-> self state-time))) (-> self traj time)))) (eval-position! (-> self traj) f30-0 (-> self collide-info trans)) (when (= f30-0 (-> self traj time)) - (logior! (-> self collide-info nav-flags) 1) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logior! (-> self collide-info nav-flags) (nav-flags navf0)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (go green-eco-lurker-appear-land) ) ) @@ -560,101 +545,49 @@ (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self sound-delay)) ) (set! (-> self played-sound?) #t) - (sound-play-by-name - (static-sound-name "blob-jump") - (new-sound-id) - 1024 - (the int (* 1524.0 (nav-enemy-rnd-float-range -0.5 0.5))) - 0 - 1 - #t - ) + (sound-play "blob-jump" :pitch (nav-enemy-rnd-float-range -0.5 0.5)) ) (dummy-53 self) 0 (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (sound-play-by-name - (static-sound-name "blob-out") - (new-sound-id) - 1024 - (the int (* 1524.0 (nav-enemy-rnd-float-range -1.0 1.0))) - 0 - 1 - #t - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (sound-play "blob-out" :pitch (nav-enemy-rnd-float-range -1.0 1.0)) (cond ((zero? (nav-enemy-rnd-int-count 2)) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! green-eco-lurker-jump-with-flip-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! green-eco-lurker-jump-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior green-eco-lurker) transform-post) + :post (the-as (function none :behavior green-eco-lurker) transform-post) ) ;; failed to figure out what this is: (defstate green-eco-lurker-appear-land (green-eco-lurker) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior green-eco-lurker) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (activate! *camera-smush-control* 409.6 37 150 1.0 0.99) - (sound-play-by-name - (static-sound-name "blob-land") - (new-sound-id) - 1024 - (the int (* 1524.0 (nav-enemy-rnd-float-range -1.0 1.0))) - 0 - 1 - #t - ) + (sound-play "blob-land" :pitch (nav-enemy-rnd-float-range -1.0 1.0)) (let ((v1-4 (-> self draw shadow-ctrl))) (let ((a0-4 v1-4)) (set! (-> a0-4 settings bot-plane w) (- -7168.0)) @@ -664,43 +597,29 @@ (set! (-> a0-6 settings top-plane w) (- 2048.0)) ) 0 - (set! (-> v1-4 settings flags) (logand -9 (-> v1-4 settings flags))) - (set! (-> v1-4 settings flags) (logand -5 (-> v1-4 settings flags))) - (set! (-> v1-4 settings flags) (logand -33 (-> v1-4 settings flags))) + (logclear! (-> v1-4 settings flags) (shadow-flags shdf03)) + (logclear! (-> v1-4 settings flags) (shadow-flags shdf02)) + (logclear! (-> v1-4 settings flags) (shadow-flags disable-draw)) ) 0 - (ja-channel-push! 1 60) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! green-eco-lurker-jump-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-chase) (none) ) - :post - (the-as (function none :behavior green-eco-lurker) transform-post) + :post (the-as (function none :behavior green-eco-lurker) transform-post) ) ;; failed to figure out what this is: (defstate nav-enemy-patrol (green-eco-lurker) :virtual #t - :code - (behavior () - (ja-channel-push! 1 60) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-patrol) code))) (if t9-1 ((the-as (function none) t9-1)) @@ -713,65 +632,31 @@ ;; failed to figure out what this is: (defstate nav-enemy-chase (green-eco-lurker) :virtual #t - :code - (behavior () + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 8) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 60) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim)))) - (set! (-> a0-7 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-7 param 1) f30-0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! - a0-7 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - num-func-seek! - ) - ) + ((ja-group? green-eco-lurker-jump-land-ja) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info run-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (else - (ja-channel-push! 1 60) - (let ((v1-42 (-> self skel root-channel 0))) - (set! (-> v1-42 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - ) - ) - (let ((v1-45 (-> self skel root-channel 0))) - (set! (-> v1-45 num-func) num-func-identity) - (set! (-> v1-45 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) ) ) - (while #t + (loop (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) f30-0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) @@ -781,35 +666,17 @@ ;; failed to figure out what this is: (defstate nav-enemy-jump-land (green-eco-lurker) :virtual #t - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 22) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - ) - (set! (-> gp-0 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-0 param 1) 0.5) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info jump-land-anim)) + :num! (seek! (ja-aframe 32.0 0) 0.5) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-1 param 1) 0.5) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) ) (go-virtual nav-enemy-chase) (none) @@ -819,31 +686,23 @@ ;; failed to figure out what this is: (defstate nav-enemy-die (green-eco-lurker) :virtual #t - :enter - (behavior () + :enter (behavior () (send-event (ppointer->process (-> self parent)) 'blob-died) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-2 (method-of-type part-tracker activate))) - (t9-2 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 643) - -1 - #f - #f - #f - (-> self collide-info trans) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 643) + -1 + #f + #f + #f + (-> self collide-info trans) + :to *entity-pool* ) - (sound-play-by-name (static-sound-name "blob-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "blob-explode") (activate! *camera-smush-control* 409.6 37 150 1.0 0.99) (let ((v1-14 (-> self draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 (let ((t9-7 (-> (method-of-type nav-enemy nav-enemy-die) enter))) @@ -942,9 +801,9 @@ (defmethod TODO-RENAME-48 green-eco-lurker ((obj green-eco-lurker)) (initialize-skeleton obj *green-eco-lurker-sg* '()) (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (set! (-> obj collide-info nav-flags) (logand -2 (-> obj collide-info nav-flags))) + (logclear! (-> obj collide-info nav-flags) (nav-flags navf0)) (TODO-RENAME-45 obj *green-eco-lurker-nav-enemy-info*) - (logior! (-> obj draw shadow-ctrl settings flags) 4) + (logior! (-> obj draw shadow-ctrl settings flags) (shadow-flags shdf02)) (set! (-> obj neck up) (the-as uint 0)) (set! (-> obj neck nose) (the-as uint 1)) (set! (-> obj neck ear) (the-as uint 2)) @@ -955,7 +814,7 @@ ;; definition for function green-eco-lurker-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior green-eco-lurker-init-by-other green-eco-lurker ((arg0 entity) (arg1 green-eco-lurker-gen) (arg2 vector)) +(defbehavior green-eco-lurker-init-by-other green-eco-lurker ((arg0 entity-actor) (arg1 green-eco-lurker-gen) (arg2 vector)) (initialize-collision self) (set! (-> self collide-info trans quad) (-> arg2 quad)) (vector-identity! (-> self collide-info scale)) @@ -969,8 +828,7 @@ ;; failed to figure out what this is: (defstate spawn-minions (green-eco-lurker-gen) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('blob-died) (set! (-> self num-alive) (max 0 (+ (-> self num-alive) -1))) @@ -981,8 +839,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (while (< (-> self num-spawned) (-> self num-to-spawn)) (when (< (-> self num-alive) 3) (when (nonzero? (-> self num-spawned)) @@ -994,15 +851,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self root trans quad)) (set! (-> gp-0 y) (+ -16384.0 (-> gp-0 y))) - (let ((s5-0 (get-process *default-dead-pool* green-eco-lurker #x4000))) - (when s5-0 - (let ((t9-1 (method-of-type green-eco-lurker activate))) - (t9-1 (the-as green-eco-lurker s5-0) self 'green-eco-lurker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 green-eco-lurker-init-by-other (-> self entity) self gp-0) - (-> s5-0 ppointer) - ) - ) + (process-spawn green-eco-lurker (-> self entity) self gp-0 :to self) ) (+! (-> self num-spawned) 1) (+! (-> self num-alive) 1) @@ -1025,7 +874,7 @@ ;; definition for function green-eco-lurker-gen-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior green-eco-lurker-gen-init-by-other green-eco-lurker-gen ((arg0 entity) (arg1 vector) (arg2 int)) +(defbehavior green-eco-lurker-gen-init-by-other green-eco-lurker-gen ((arg0 entity-actor) (arg1 vector) (arg2 int)) (set! (-> self num-to-spawn) arg2) (set! (-> self num-spawned) 0) (set! (-> self num-alive) 0) diff --git a/test/decompiler/reference/levels/finalboss/light-eco_REF.gc b/test/decompiler/reference/levels/finalboss/light-eco_REF.gc index b818a14689..4107c6d9d3 100644 --- a/test/decompiler/reference/levels/finalboss/light-eco_REF.gc +++ b/test/decompiler/reference/levels/finalboss/light-eco_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/light-eco-ag.gc") + ;; definition of type light-eco-child (deftype light-eco-child (process-drawable) ((root-override collide-shape :offset 112) @@ -82,36 +84,28 @@ ) ;; failed to figure out what this is: -(defskelgroup *light-eco-big-sg* light-eco - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *light-eco-big-sg* light-eco light-eco-big-lod0-jg -1 + ((light-eco-big-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 9) + ) ;; failed to figure out what this is: -(defskelgroup *light-eco-small-sg* light-eco - 3 - -1 - ((4 (meters 999999))) - :bounds (static-spherem 0 0 0 1.5) - :longest-edge (meters 0) - ) +(defskelgroup *light-eco-small-sg* light-eco light-eco-small-lod0-jg -1 + ((light-eco-small-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.5) + ) ;; failed to figure out what this is: (defpartgroup group-light-eco-mother-growing :id 690 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 32) - :parts - ((sp-item 2902) (sp-item 2900) (sp-item 2897) (sp-item 2898)) + :parts ((sp-item 2902) (sp-item 2900) (sp-item 2897) (sp-item 2898)) ) ;; failed to figure out what this is: (defpart 2897 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-scale-x (meters 10.5) (meters 4.5) 1.0) (sp-int spt-rot-x 4) @@ -134,14 +128,12 @@ ;; failed to figure out what this is: (defpart 2899 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) ;; failed to figure out what this is: (defpart 2898 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-scale-x (meters 20) (meters 4.5) 1.0) (sp-int spt-rot-x 4) @@ -163,8 +155,7 @@ ;; failed to figure out what this is: (defpart 2900 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -0.001) (meters 0.002) 1.0) (sp-rnd-flt spt-y (meters -0.001) (meters 0.002) 1.0) @@ -190,14 +181,12 @@ ;; failed to figure out what this is: (defpart 2901 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: (defpart 2902 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 8.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -224,8 +213,7 @@ ;; failed to figure out what this is: (defpart 2903 - :init-specs - ((sp-flt spt-userdata 2252800.0)) + :init-specs ((sp-flt spt-userdata 2252800.0)) ) ;; definition for function check-drop-level-lighteco-big-pops @@ -257,8 +245,7 @@ ;; failed to figure out what this is: (defpart 2905 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -275,8 +262,7 @@ ;; failed to figure out what this is: (defpart 2904 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 4.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -299,8 +285,7 @@ :id 691 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 32) - :parts - ((sp-item 2902) (sp-item 2900) (sp-item 2897) (sp-item 2898)) + :parts ((sp-item 2902) (sp-item 2900) (sp-item 2897) (sp-item 2898)) ) ;; failed to figure out what this is: @@ -308,14 +293,12 @@ :id 692 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 2906) (sp-item 2907)) + :parts ((sp-item 2906) (sp-item 2907)) ) ;; failed to figure out what this is: (defpart 2907 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.025 0.025 1.0) (sp-rnd-flt spt-x (meters -0.001) (meters 0.002) 1.0) (sp-rnd-flt spt-y (meters -0.001) (meters 0.002) 1.0) @@ -341,14 +324,12 @@ ;; failed to figure out what this is: (defpart 2908 - :init-specs - ((sp-flt spt-fade-a -0.85333335)) + :init-specs ((sp-flt spt-fade-a -0.85333335)) ) ;; failed to figure out what this is: (defpart 2906 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -374,8 +355,7 @@ ;; failed to figure out what this is: (defpart 2909 - :init-specs - ((sp-flt spt-userdata 2048000.0)) + :init-specs ((sp-flt spt-userdata 2048000.0)) ) ;; definition for function check-drop-level-lighteco-pops @@ -407,8 +387,7 @@ ;; failed to figure out what this is: (defpart 2911 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -425,8 +404,7 @@ ;; failed to figure out what this is: (defpart 2910 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 4.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -480,15 +458,12 @@ ;; failed to figure out what this is: (defstate light-eco-child-appear (light-eco-child) - :event - light-eco-child-default-event-handler - :enter - (behavior () + :event light-eco-child-default-event-handler + :enter (behavior () (set! (-> self falling-start-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (fmin (the float (- (-> *display* base-frame-counter) (-> self falling-start-time))) (-> self traj time)) ) @@ -501,32 +476,24 @@ (common-trans self) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior light-eco-child) transform-post) + :post (the-as (function none :behavior light-eco-child) transform-post) ) ;; failed to figure out what this is: (defstate light-eco-child-hit-ground (light-eco-child) - :event - light-eco-child-default-event-handler - :enter - (behavior () + :event light-eco-child-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (+ (-> self root-override transv y) (* -544768.0 (-> *display* seconds-per-frame))))) (when (and (< f30-0 0.0) (>= (-> self ground-y) (-> self root-override trans y))) (if (>= 4096.0 (fabs f30-0)) @@ -559,57 +526,43 @@ (common-trans self) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior light-eco-child) transform-post) + :post (the-as (function none :behavior light-eco-child) transform-post) ) ;; failed to figure out what this is: (defstate light-eco-child-idle (light-eco-child) - :event - light-eco-child-default-event-handler - :enter - (behavior () + :event light-eco-child-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) (go light-eco-child-die) ) (common-trans self) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior light-eco-child) transform-post) + :post (the-as (function none :behavior light-eco-child) transform-post) ) ;; failed to figure out what this is: (defstate light-eco-child-die (light-eco-child) - :code - (behavior () + :code (behavior () (send-event (ppointer->process (-> self parent)) 'untrigger (-> self angle-bit)) (clear-collide-with-as (-> self root-override)) (logior! (-> self draw status) (draw-status hidden)) @@ -623,8 +576,7 @@ ;; failed to figure out what this is: (defstate light-eco-child-grabbed (light-eco-child) - :code - (behavior () + :code (behavior () (suspend) 0 (none) @@ -634,7 +586,7 @@ ;; definition for function light-eco-child-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior light-eco-child-init-by-other light-eco-child ((arg0 entity) (arg1 vector) (arg2 vector) (arg3 int)) +(defbehavior light-eco-child-init-by-other light-eco-child ((arg0 entity-actor) (arg1 vector) (arg2 vector) (arg3 int)) (set! (-> self entity) arg0) (set! (-> self angle-bit) arg3) (set! (-> self ground-y) (-> arg2 y)) @@ -678,19 +630,8 @@ (logclear! (-> self mask) (process-mask actor-pause)) (initialize-skeleton self *light-eco-small-sg* '()) (ja-channel-set! 1) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja-no-eval :num! (seek!)) + (ja :group! light-eco-small-idle-ja :num! min) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 692) self)) (transform-post) (go light-eco-child-appear) @@ -719,7 +660,7 @@ ) ) (cond - ((and *target* (logtest? (-> *target* state-flags) 256)) + ((and *target* (logtest? (-> *target* state-flags) (state-flags grabbed))) (set! (-> obj last-spawned-time) (-> *display* base-frame-counter)) (set! (-> obj delay-til-spawn) 2400) ) @@ -753,15 +694,7 @@ (set! (-> s4-0 y) 1974272.0) (when (or (not *target*) (>= (vector-vector-xz-distance s4-0 (target-pos 0)) 49152.0)) (logior! (-> obj angle-mask) (ash 1 gp-0)) - (let ((s3-1 (get-process *default-dead-pool* light-eco-child #x4000))) - (when s3-1 - (let ((t9-7 (method-of-type light-eco-child activate))) - (t9-7 (the-as light-eco-child s3-1) obj 'light-eco-child (the-as pointer #x70004000)) - ) - (run-now-in-process s3-1 light-eco-child-init-by-other (-> obj entity) (-> obj root trans) s4-0 gp-0) - (-> s3-1 ppointer) - ) - ) + (process-spawn light-eco-child (-> obj entity) (-> obj root trans) s4-0 gp-0 :to obj) (return #t) ) ) @@ -775,113 +708,90 @@ ;; INFO: Return type mismatch object vs int. (defbehavior light-eco-mother-default-event-handler light-eco-mother ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) - (the-as int (cond - ((= v1-0 'untrigger) - (the-as int (when (= (-> arg0 type) light-eco-child) - (let* ((a1-3 (-> arg3 param 0)) - (v0-0 (logxor (-> self angle-mask) (ash 1 a1-3))) - ) - (set! (-> self angle-mask) v0-0) - v0-0 - ) - ) - ) - ) - ((= v1-0 'trigger) - (the-as int (when (not (-> self player-got-eco?)) - (set! (-> self player-got-eco?) #t) - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 0) - (set! (-> a1-5 message) 'white-eco-picked-up) - (the-as int (send-event-function (ppointer->process (-> self parent)) a1-5)) - ) - ) - ) - ) - ((= v1-0 'beam-off) - (the-as int (go light-eco-mother-discipate)) - ) - ) - ) + (the-as + int + (cond + ((= v1-0 'untrigger) + (the-as int (when (= (-> arg0 type) light-eco-child) + (let* ((a1-3 (-> arg3 param 0)) + (v0-0 (logxor (-> self angle-mask) (ash 1 a1-3))) + ) + (set! (-> self angle-mask) v0-0) + v0-0 + ) + ) + ) + ) + ((= v1-0 'trigger) + (the-as int (when (not (-> self player-got-eco?)) + (set! (-> self player-got-eco?) #t) + (the-as int (send-event (ppointer->process (-> self parent)) 'white-eco-picked-up)) + ) + ) + ) + ((= v1-0 'beam-off) + (the-as int (go light-eco-mother-discipate)) + ) + ) + ) ) ) ;; failed to figure out what this is: (defstate light-eco-mother-appear (light-eco-mother) - :event - light-eco-mother-default-event-handler - :trans - (behavior () + :event light-eco-mother-default-event-handler + :trans (behavior () (common-trans self) (spawn (-> self part2) (-> self root trans)) (none) ) - :code - (behavior () + :code (behavior () (while (!= (-> self root scale x) 12.0) (let ((f0-3 (seek-with-smooth (-> self root scale x) 12.0 (* 6.0 (-> *display* seconds-per-frame)) 0.25 0.001))) (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) ) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (go light-eco-mother-active) (none) ) - :post - (the-as (function none :behavior light-eco-mother) ja-post) + :post (the-as (function none :behavior light-eco-mother) ja-post) ) ;; failed to figure out what this is: (defstate light-eco-mother-active (light-eco-mother) - :event - light-eco-mother-default-event-handler - :trans - (behavior () + :event light-eco-mother-default-event-handler + :trans (behavior () (common-trans self) (spawn (-> self part) (-> self root trans)) 0 (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior light-eco-mother) ja-post) + :post (the-as (function none :behavior light-eco-mother) ja-post) ) ;; failed to figure out what this is: (defstate light-eco-mother-discipate (light-eco-mother) - :event - light-eco-mother-default-event-handler - :trans - (behavior () + :event light-eco-mother-default-event-handler + :trans (behavior () (common-trans self) (none) ) - :code - (behavior () + :code (behavior () (while (!= (-> self root scale x) 0.0) (let ((f0-3 (seek-with-smooth (-> self root scale x) 0.0 (* 12.0 (-> *display* seconds-per-frame)) 0.5 0.001))) (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) ) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (logior! (-> self draw status) (draw-status hidden)) (until (not (-> self child)) @@ -889,8 +799,7 @@ ) (none) ) - :post - (the-as (function none :behavior light-eco-mother) ja-post) + :post (the-as (function none :behavior light-eco-mother) ja-post) ) ;; definition for method 10 of type light-eco-mother @@ -914,7 +823,7 @@ ;; definition for function light-eco-mother-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior light-eco-mother-init-by-other light-eco-mother ((arg0 entity) (arg1 vector)) +(defbehavior light-eco-mother-init-by-other light-eco-mother ((arg0 entity-actor) (arg1 vector)) (set! (-> self entity) arg0) (set! (-> self last-update-time) 0) (set! (-> self last-spawned-time) (-> *display* base-frame-counter)) @@ -928,35 +837,12 @@ (logclear! (-> self mask) (process-mask actor-pause)) (initialize-skeleton self *light-eco-big-sg* '()) (ja-channel-set! 1) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja-no-eval :num! (seek!)) + (ja :group! light-eco-big-idle-ja :num! min) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 691) self)) (set! (-> self part2) (create-launch-control (-> *part-group-id-table* 690) self)) - (set! (-> self sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "white-eco-lp") - :volume #x400 - :fo-min #x12c - :fo-max #x190 - ) - (-> self root trans) - ) + (set! (-> self sound) + (new 'process 'ambient-sound (static-sound-spec "white-eco-lp" :fo-min 300 :fo-max 400) (-> self root trans)) ) (ja-post) (let ((f0-4 0.0)) diff --git a/test/decompiler/reference/levels/finalboss/robotboss-h_REF.gc b/test/decompiler/reference/levels/finalboss/robotboss-h_REF.gc index 5725e6bdfc..8c354e403e 100644 --- a/test/decompiler/reference/levels/finalboss/robotboss-h_REF.gc +++ b/test/decompiler/reference/levels/finalboss/robotboss-h_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/robotboss-ag.gc") + ;; definition of type robotboss-dda (deftype robotboss-dda (structure) ((blue-bomb-time float :offset-assert 0) @@ -178,26 +180,16 @@ ;; definition for function target-has-all-the-cells? ;; INFO: Return type mismatch basic vs symbol. -(defun target-has-all-the-cells? () - (with-pp - (the-as symbol (and *target* (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 6)) - (>= (the int (the-as float (send-event-function *target* a1-0))) 100) - ) - ) - ) +(defbehavior target-has-all-the-cells? process () + (the-as + symbol + (and *target* (>= (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 100)) ) ) ;; failed to figure out what this is: -(defskelgroup *robotboss-sg* robotboss - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -10 0 80) - :longest-edge (meters 19.9) - ) +(defskelgroup *robotboss-sg* robotboss robotboss-basic-lod0-jg robotboss-idle-ja + ((robotboss-basic-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10 0 80) + :longest-edge (meters 19.9) + ) diff --git a/test/decompiler/reference/levels/finalboss/robotboss-misc_REF.gc b/test/decompiler/reference/levels/finalboss/robotboss-misc_REF.gc index c325a635c6..ef1a30f04b 100644 --- a/test/decompiler/reference/levels/finalboss/robotboss-misc_REF.gc +++ b/test/decompiler/reference/levels/finalboss/robotboss-misc_REF.gc @@ -1,19 +1,20 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/silodoor-ag.gc") +(import "goal_src/import/ecoclaw-ag.gc") +(import "goal_src/import/finalbosscam-ag.gc") + ;; failed to figure out what this is: -(defskelgroup *med-res-snow1-sg* medres-snowback - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -360 100 100 380) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-snow1-sg* medres-snowback 0 2 + ((1 (meters 999999))) + :bounds (static-spherem -360 100 100 380) + :longest-edge (meters 0.01) + ) ;; failed to figure out what this is: (defstate cam-robotboss (camera-slave) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('set-pivot) (let ((v0-0 (the-as object (-> self pivot-pt)))) @@ -29,8 +30,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (cond ((-> self enter-has-run) ) @@ -44,17 +44,15 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (when (zero? (logand (-> *camera* master-options) 2)) (set! *camera-base-mode* cam-string) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when #t (let ((a2-0 (new-stack-vector0))) (vector-! a2-0 (-> *camera* tpos-curr-adj) (-> self pivot-pt)) @@ -130,13 +128,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *ecoclaw-sg* ecoclaw - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *ecoclaw-sg* ecoclaw ecoclaw-lod0-jg ecoclaw-idle-ja + ((ecoclaw-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 9) + ) ;; definition for function ecoclaw-beam-particle-callback ;; INFO: Return type mismatch int vs none. @@ -248,10 +243,8 @@ ;; failed to figure out what this is: (defstate ecoclaw-activate (ecoclaw) - :event - ecoclaw-handler - :trans - (behavior () + :event ecoclaw-handler + :trans (behavior () (if (-> self particles 1 kind) (draw-eco-beam (the-as vector (&-> self stack 112)) (the-as vector (&-> self stack 144))) ) @@ -263,84 +256,43 @@ ) ) ((-> self particles gp-0 kind) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self particles gp-0 tracker) - (ppointer->handle (when s5-0 - (let ((t9-2 (method-of-type part-tracker activate))) - (t9-2 (the-as part-tracker s5-0) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - part-tracker-init - (-> self particles gp-0 kind) - -1 - ecoclaw-beam-particle-callback - (-> self ppointer) - #f - (&+ (&-> self stack 80) (* gp-0 32)) - ) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> self particles gp-0 tracker) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> self particles gp-0 kind) + -1 + ecoclaw-beam-particle-callback + (-> self ppointer) + #f + (&+ (&-> self stack 80) (* gp-0 32)) + :to self + ) + ) + ) ) ) ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior ecoclaw) ja-post) + :post (the-as (function none :behavior ecoclaw) ja-post) ) ;; failed to figure out what this is: (defstate ecoclaw-idle (ecoclaw) - :event - ecoclaw-handler - :code - (behavior () - (while #t + :event ecoclaw-handler + :code (behavior () + (loop (if (-> self particles 0 kind) (go ecoclaw-activate) ) @@ -348,8 +300,7 @@ ) (none) ) - :post - (the-as (function none :behavior ecoclaw) ja-post) + :post (the-as (function none :behavior ecoclaw) ja-post) ) ;; definition for method 11 of type ecoclaw @@ -391,19 +342,15 @@ ) ;; failed to figure out what this is: -(defskelgroup *silodoor-sg* silodoor - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 25) - :longest-edge (meters 0) - ) +(defskelgroup *silodoor-sg* silodoor silodoor-lod0-jg silodoor-idle-ja + ((silodoor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) ;; failed to figure out what this is: (defstate idle (silodoor) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('open) (let ((f0-0 (the-as float (-> arg3 param 0)))) @@ -416,17 +363,11 @@ ) ) ) - :trans - (the-as (function none :behavior silodoor) rider-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior silodoor) rider-trans) + :code (behavior () + (loop (when (not (movie?)) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 param 0) (* (-> self part-opened) (the float (ja-num-frames 0)))) - (set! (-> gp-0 param 1) 0.01) - (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (* (-> self part-opened) (the float (ja-num-frames 0))) 0.01)) (cond ((< 0.01 (fabs (- (* (-> self part-opened) (the float (ja-num-frames 0))) (ja-aframe-num 0)))) (if (nonzero? (-> self sound)) @@ -442,8 +383,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (if (and (< (vector-vector-xz-distance (target-pos 0) (-> self root trans)) 57344.0) (not (ja-min? 0))) (rider-post) (transform-post) @@ -455,8 +395,7 @@ ;; failed to figure out what this is: (defstate hidden (silodoor) :virtual #t - :code - (behavior () + :code (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) @@ -466,10 +405,7 @@ (suspend) ) (logclear! (-> self draw status) (draw-status hidden)) - (let ((v1-12 (-> self skel root-channel 0))) - (set! (-> v1-12 num-func) num-func-identity) - (set! (-> v1-12 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (set! (-> self part-opened) 0.0) (go-virtual idle) (none) @@ -538,19 +474,8 @@ (initialize-skeleton obj *silodoor-sg* '()) (logior! (-> obj skel status) (janim-status inited)) (set! (-> obj root pause-adjust-distance) 1228800.0) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "silo-moves") - :volume #x400 - :fo-max 80 - ) - (-> obj root trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "silo-moves" :fo-max 80) (-> obj root trans)) ) (logclear! (-> obj mask) (process-mask actor-pause crate enemy attackable)) (set! (-> obj part-opened) 0.0) @@ -578,13 +503,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *finalbosscam-sg* finalbosscam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *finalbosscam-sg* finalbosscam finalbosscam-lod0-jg finalbosscam-idle-ja + ((finalbosscam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; definition for function robotboss-manipy-trans-hook ;; INFO: Return type mismatch int vs none. @@ -601,19 +523,9 @@ ;; INFO: Return type mismatch spool-anim vs basic. (defmethod play-anim! finalbosscam ((obj finalbosscam) (arg0 symbol)) (when arg0 - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj robotboss) - (ppointer->handle - (when s5-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy s5-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> obj root-override trans) (-> obj entity) *robotboss-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> obj robotboss) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *robotboss-sg* #f :to obj)) + ) (send-event (handle->process (-> obj robotboss)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj robotboss)) 'center-joint 3) (send-event (handle->process (-> obj robotboss)) 'origin-joint-index 3) @@ -649,8 +561,7 @@ ;; failed to figure out what this is: (defstate play-anim (finalbosscam) :virtual #t - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self robotboss)))) (if a0-1 (deactivate a0-1) @@ -663,7 +574,7 @@ ;; definition for function finalbosscam-init-by-other ;; INFO: Return type mismatch object vs none. -(defbehavior finalbosscam-init-by-other finalbosscam ((arg0 entity)) +(defbehavior finalbosscam-init-by-other finalbosscam ((arg0 entity-actor)) (set! (-> self entity) arg0) (dummy-40 self arg0 *finalbosscam-sg* 4 4 (new 'static 'vector :w 4096.0) 4) (set! (-> self tasks) (get-task-control (game-task finalboss-movies))) diff --git a/test/decompiler/reference/levels/finalboss/robotboss-part_REF.gc b/test/decompiler/reference/levels/finalboss/robotboss-part_REF.gc index 8ddd9a1744..6328ac4d86 100644 --- a/test/decompiler/reference/levels/finalboss/robotboss-part_REF.gc +++ b/test/decompiler/reference/levels/finalboss/robotboss-part_REF.gc @@ -6,8 +6,7 @@ :id 636 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 34) - :parts - ((sp-item 2680) + :parts ((sp-item 2680) (sp-item 2545 :binding 2542) (sp-item 2542 :flags (bit1 start-dead launch-asap) :binding 2543) (sp-item 2542 :flags (bit1 start-dead launch-asap) :binding 2544) @@ -41,8 +40,7 @@ :id 637 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 34) - :parts - ((sp-item 2681) + :parts ((sp-item 2681) (sp-item 2682 :period 336 :length 5) (sp-item 2682 :period 140 :length 5) (sp-item 2682 :period 61 :length 5) @@ -53,8 +51,7 @@ ;; failed to figure out what this is: (defpart 2681 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 0.1 1.0) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) @@ -76,8 +73,7 @@ ;; failed to figure out what this is: (defpart 2683 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters -2.5) (meters 1) 1.0) @@ -111,14 +107,12 @@ ;; failed to figure out what this is: (defpart 2684 - :init-specs - ((sp-flt spt-fade-a -0.07111111)) + :init-specs ((sp-flt spt-fade-a -0.07111111)) ) ;; failed to figure out what this is: (defpart 2549 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-scale-x (meters 5) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -135,8 +129,7 @@ ;; failed to figure out what this is: (defpart 2682 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 2.0 6.0 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.5) 1.0) @@ -163,8 +156,7 @@ ;; failed to figure out what this is: (defpart 2545 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.025) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -185,8 +177,7 @@ ;; failed to figure out what this is: (defpart 2542 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -209,8 +200,7 @@ ;; failed to figure out what this is: (defpart 2543 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -230,8 +220,7 @@ ;; failed to figure out what this is: (defpart 2544 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -251,8 +240,7 @@ ;; failed to figure out what this is: (defpart 2546 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) (sp-rnd-flt spt-scale-y (meters 0.3) (meters 0.4) 1.0) @@ -273,8 +261,7 @@ ;; failed to figure out what this is: (defpart 2548 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.25) (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) (sp-rnd-flt spt-scale-y (meters 4) (meters 3) 1.0) @@ -295,8 +282,7 @@ ;; failed to figure out what this is: (defpart 2547 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 5) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -313,8 +299,7 @@ ;; failed to figure out what this is: (defpart 2680 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -333,8 +318,7 @@ :id 644 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2591 :period 600 :length 5) + :parts ((sp-item 2591 :period 600 :length 5) (sp-item 2592 :period 600 :length 40) (sp-item 2593 :period 600 :length 40) (sp-item 2594 :period 600 :length 40) @@ -343,8 +327,7 @@ ;; failed to figure out what this is: (defpart 2592 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.8) (meters 1.6) 1.0) @@ -373,14 +356,12 @@ ;; failed to figure out what this is: (defpart 2595 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2594 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 0.8)) @@ -402,8 +383,7 @@ ;; failed to figure out what this is: (defpart 2591 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 64)) @@ -420,8 +400,7 @@ ;; failed to figure out what this is: (defpart 2593 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -449,8 +428,7 @@ ;; failed to figure out what this is: (defpart 2596 - :init-specs - ((sp-flt spt-fade-r -2.1333334) + :init-specs ((sp-flt spt-fade-r -2.1333334) (sp-flt spt-fade-g -1.0666667) (sp-flt spt-fade-b 0.0) (sp-int spt-next-time 60) @@ -460,8 +438,7 @@ ;; failed to figure out what this is: (defpart 2597 - :init-specs - ((sp-flt spt-fade-r 0.0) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g -0.28444445) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.42666668) @@ -472,8 +449,7 @@ ;; failed to figure out what this is: (defpart 2598 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: @@ -481,8 +457,7 @@ :id 645 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2685 :period 36 :length 5) + :parts ((sp-item 2685 :period 36 :length 5) (sp-item 2685 :period 140 :length 5) (sp-item 2685 :period 61 :length 5) (sp-item 2599 :period 15 :length 5) @@ -492,8 +467,7 @@ ;; failed to figure out what this is: (defpart 2686 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 4) (meters 16) 1.0) @@ -510,8 +484,7 @@ ;; failed to figure out what this is: (defpart 2599 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -538,8 +511,7 @@ ;; failed to figure out what this is: (defpart 2685 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-int spt-num 0 1 8.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1) 1.0) @@ -571,14 +543,12 @@ :id 638 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2600 :period 600 :length 5) (sp-item 2602 :period 600 :length 40)) + :parts ((sp-item 2600 :period 600 :length 5) (sp-item 2602 :period 600 :length 40)) ) ;; failed to figure out what this is: (defpart 2600 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 64)) @@ -595,8 +565,7 @@ ;; failed to figure out what this is: (defpart 2602 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 8.0 1.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -626,8 +595,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2753) + :parts ((sp-item 2753) (sp-item 2754) (sp-item 2755 :fade-after (meters 120) :falloff-to (meters 140) :binding 2752) (sp-item 2752 :flags (bit1 start-dead launch-asap) :binding 2671) @@ -650,8 +618,7 @@ ;; failed to figure out what this is: (defpart 2755 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -668,8 +635,7 @@ ;; failed to figure out what this is: (defpart 2752 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters 2.25)) (sp-rnd-flt spt-scale-x (meters 4) (meters 1) 1.0) @@ -690,8 +656,7 @@ ;; failed to figure out what this is: (defpart 2753 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-flt spt-y (meters 4)) (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) @@ -709,8 +674,7 @@ ;; failed to figure out what this is: (defpart 2754 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-flt spt-y (meters -3)) (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) @@ -733,14 +697,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2756) (sp-item 2757) (sp-item 2758) (sp-item 2759)) + :parts ((sp-item 2756) (sp-item 2757) (sp-item 2758) (sp-item 2759)) ) ;; failed to figure out what this is: (defpart 2759 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 10) (meters 16) 1.0) @@ -758,8 +720,7 @@ ;; failed to figure out what this is: (defpart 2758 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 16) (meters 6) 1.0) @@ -780,8 +741,7 @@ ;; failed to figure out what this is: (defpart 2757 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 16) (meters 6) 1.0) @@ -802,8 +762,7 @@ ;; failed to figure out what this is: (defpart 2756 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 16) (meters 6) 1.0) @@ -827,8 +786,7 @@ :id 619 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2500 :flags (is-3d) :period 900 :length 5) + :parts ((sp-item 2500 :flags (is-3d) :period 900 :length 5) (sp-item 2501 :period 900 :length 5) (sp-item 2502 :period 900 :length 40) (sp-item 2503 :period 900 :length 20 :binding 2499) @@ -855,8 +813,7 @@ ;; failed to figure out what this is: (defpart 2503 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) @@ -882,8 +839,7 @@ ;; failed to figure out what this is: (defpart 2499 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -905,14 +861,12 @@ ;; failed to figure out what this is: (defpart 2506 - :init-specs - ((sp-flt spt-fade-r -0.14222223) (sp-flt spt-fade-g -0.14222223) (sp-flt spt-fade-b -0.14222223)) + :init-specs ((sp-flt spt-fade-r -0.14222223) (sp-flt spt-fade-g -0.14222223) (sp-flt spt-fade-b -0.14222223)) ) ;; failed to figure out what this is: (defpart 2502 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 64.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 2.6) (meters 2) 1.0) @@ -941,14 +895,12 @@ ;; failed to figure out what this is: (defpart 2507 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: (defpart 2505 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.2) 1.0) @@ -970,8 +922,7 @@ ;; failed to figure out what this is: (defpart 2501 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 160)) @@ -989,8 +940,7 @@ ;; failed to figure out what this is: (defpart 2504 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 32.0) (sp-flt spt-y (meters 10)) (sp-rnd-flt spt-scale-x (meters 20) (meters 16) 1.0) @@ -1018,8 +968,7 @@ ;; failed to figure out what this is: (defpart 2508 - :init-specs - ((sp-flt spt-fade-r -1.6) + :init-specs ((sp-flt spt-fade-r -1.6) (sp-flt spt-fade-g -1.6) (sp-flt spt-fade-b -1.0666667) (sp-int spt-next-time 60) @@ -1029,8 +978,7 @@ ;; failed to figure out what this is: (defpart 2509 - :init-specs - ((sp-flt spt-fade-r -0.26666668) + :init-specs ((sp-flt spt-fade-r -0.26666668) (sp-flt spt-fade-g -0.26666668) (sp-flt spt-fade-b -0.17777778) (sp-flt spt-fade-a -0.16) @@ -1041,14 +989,12 @@ ;; failed to figure out what this is: (defpart 2510 - :init-specs - ((sp-flt spt-fade-r -0.114285715) (sp-flt spt-fade-g -0.114285715) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r -0.114285715) (sp-flt spt-fade-g -0.114285715) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: (defpart 2500 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 10)) (sp-flt spt-scale-x (meters 30)) @@ -1069,8 +1015,7 @@ ;; failed to figure out what this is: (defpart 2511 - :init-specs - ((sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-a -1.4222223)) ) ;; failed to figure out what this is: @@ -1078,8 +1023,7 @@ :id 640 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2799 :period 600 :length 10) + :parts ((sp-item 2799 :period 600 :length 10) (sp-item 2800 :period 600 :length 10) (sp-item 2801 :period 600 :length 20) (sp-item 2802 :period 600 :length 10) @@ -1088,8 +1032,7 @@ ;; failed to figure out what this is: (defpart 2800 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 32) (meters 128) 1.0) (sp-int spt-rot-x 4) @@ -1112,14 +1055,12 @@ ;; failed to figure out what this is: (defpart 2803 - :init-specs - ((sp-flt spt-fade-a -1.6)) + :init-specs ((sp-flt spt-fade-a -1.6)) ) ;; failed to figure out what this is: (defpart 2801 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 32) (meters 32) 1.0) (sp-int spt-rot-x 4) @@ -1141,8 +1082,7 @@ ;; failed to figure out what this is: (defpart 2802 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 100)) (sp-flt spt-rot-z (degrees 0.0)) @@ -1162,8 +1102,7 @@ ;; failed to figure out what this is: (defpart 2799 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 6)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1187,8 +1126,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2769 :binding 2766) + :parts ((sp-item 2769 :binding 2766) (sp-item 2766 :flags (bit1 start-dead launch-asap) :binding 2767) (sp-item 2767 :flags (start-dead) :binding 2768) (sp-item 2768 :flags (start-dead launch-asap)) @@ -1242,8 +1180,7 @@ ;; failed to figure out what this is: (defpart 2769 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 0.1)) @@ -1258,8 +1195,7 @@ ;; failed to figure out what this is: (defpart 2766 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1283,8 +1219,7 @@ ;; failed to figure out what this is: (defpart 2770 - :init-specs - ((sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) + :init-specs ((sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) @@ -1297,8 +1232,7 @@ ;; failed to figure out what this is: (defpart 2767 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1324,14 +1258,12 @@ ;; failed to figure out what this is: (defpart 2771 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: (defpart 2768 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 5.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1363,14 +1295,12 @@ :id 646 :duration 900 :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2699) (sp-item 2700) (sp-item 2701)) + :parts ((sp-item 2699) (sp-item 2700) (sp-item 2701)) ) ;; failed to figure out what this is: (defpart 2699 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -1393,14 +1323,12 @@ ;; failed to figure out what this is: (defpart 2703 - :init-specs - ((sp-flt spt-fade-a -1.4222221)) + :init-specs ((sp-flt spt-fade-a -1.4222221)) ) ;; failed to figure out what this is: (defpart 2700 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 32) 1.0) (sp-int spt-rot-x 4) @@ -1422,8 +1350,7 @@ ;; failed to figure out what this is: (defpart 2701 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1445,8 +1372,7 @@ :id 641 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2805 :period 600 :length 10) + :parts ((sp-item 2805 :period 600 :length 10) (sp-item 2806 :period 600 :length 10) (sp-item 2807 :period 600 :length 20) (sp-item 2808 :period 600 :length 10) @@ -1455,8 +1381,7 @@ ;; failed to figure out what this is: (defpart 2806 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 32) (meters 128) 1.0) (sp-int spt-rot-x 4) @@ -1479,14 +1404,12 @@ ;; failed to figure out what this is: (defpart 2809 - :init-specs - ((sp-flt spt-fade-a -1.6)) + :init-specs ((sp-flt spt-fade-a -1.6)) ) ;; failed to figure out what this is: (defpart 2807 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 32) (meters 32) 1.0) (sp-int spt-rot-x 4) @@ -1508,8 +1431,7 @@ ;; failed to figure out what this is: (defpart 2808 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 100)) (sp-flt spt-rot-z (degrees 0.0)) @@ -1529,8 +1451,7 @@ ;; failed to figure out what this is: (defpart 2805 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 6)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1554,14 +1475,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2709) (sp-item 2710) (sp-item 2711)) + :parts ((sp-item 2709) (sp-item 2710) (sp-item 2711)) ) ;; failed to figure out what this is: (defpart 2710 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.4) 1.0) @@ -1578,8 +1497,7 @@ ;; failed to figure out what this is: (defpart 2711 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 6) (meters 0.8) 1.0) @@ -1596,8 +1514,7 @@ ;; failed to figure out what this is: (defpart 2709 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 0.6)) @@ -1625,14 +1542,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2712) (sp-item 2713) (sp-item 2714 :period 45 :length 5)) + :parts ((sp-item 2712) (sp-item 2713) (sp-item 2714 :period 45 :length 5)) ) ;; failed to figure out what this is: (defpart 2714 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 10) (meters 5) 1.0) @@ -1655,8 +1570,7 @@ ;; failed to figure out what this is: (defpart 2712 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 8.0 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) @@ -1679,8 +1593,7 @@ ;; failed to figure out what this is: (defpart 2713 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-rnd-flt spt-num 2.0 16.0 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) @@ -1708,14 +1621,12 @@ :id 648 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2626 :flags (is-3d))) + :parts ((sp-item 2626 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 2626 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 10)) (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 360.0) 1.0) @@ -1736,14 +1647,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2772)) + :parts ((sp-item 2772)) ) ;; failed to figure out what this is: (defpart 2772 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1765,8 +1674,7 @@ :id 649 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2629 :period 600 :length 5) + :parts ((sp-item 2629 :period 600 :length 5) (sp-item 2630 :period 600 :length 40) (sp-item 2631 :period 600 :length 40) (sp-item 2632 :period 600 :length 40) @@ -1775,8 +1683,7 @@ ;; failed to figure out what this is: (defpart 2630 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.8) (meters 1.6) 1.0) @@ -1805,14 +1712,12 @@ ;; failed to figure out what this is: (defpart 2633 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2632 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 0.8)) @@ -1834,8 +1739,7 @@ ;; failed to figure out what this is: (defpart 2629 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 64)) @@ -1852,8 +1756,7 @@ ;; failed to figure out what this is: (defpart 2631 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1881,8 +1784,7 @@ ;; failed to figure out what this is: (defpart 2634 - :init-specs - ((sp-flt spt-fade-r 0.0) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g -1.0666667) (sp-flt spt-fade-b -2.1333334) (sp-int spt-next-time 60) @@ -1892,8 +1794,7 @@ ;; failed to figure out what this is: (defpart 2635 - :init-specs - ((sp-flt spt-fade-r 0.0) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g -0.28444445) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.42666668) @@ -1904,8 +1805,7 @@ ;; failed to figure out what this is: (defpart 2636 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: @@ -1913,8 +1813,7 @@ :id 650 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2776 :period 36 :length 5) + :parts ((sp-item 2776 :period 36 :length 5) (sp-item 2776 :period 140 :length 5) (sp-item 2776 :period 61 :length 5) (sp-item 2637 :period 15 :length 5) @@ -1924,8 +1823,7 @@ ;; failed to figure out what this is: (defpart 2777 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0) (meters 4) 1.0) @@ -1942,8 +1840,7 @@ ;; failed to figure out what this is: (defpart 2637 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 4) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1967,8 +1864,7 @@ ;; failed to figure out what this is: (defpart 2776 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-int spt-num 0 1 8.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1) 1.0) @@ -2000,8 +1896,7 @@ :id 642 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2778 :period 600 :length 10) + :parts ((sp-item 2778 :period 600 :length 10) (sp-item 2779 :period 600 :length 10) (sp-item 2780 :period 600 :length 20) (sp-item 2781 :period 600 :length 10) @@ -2010,8 +1905,7 @@ ;; failed to figure out what this is: (defpart 2779 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 32) (meters 128) 1.0) (sp-int spt-rot-x 4) @@ -2034,14 +1928,12 @@ ;; failed to figure out what this is: (defpart 2782 - :init-specs - ((sp-flt spt-fade-a -1.6)) + :init-specs ((sp-flt spt-fade-a -1.6)) ) ;; failed to figure out what this is: (defpart 2780 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 32) (meters 32) 1.0) (sp-int spt-rot-x 4) @@ -2063,8 +1955,7 @@ ;; failed to figure out what this is: (defpart 2781 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 100)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2084,8 +1975,7 @@ ;; failed to figure out what this is: (defpart 2778 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 6)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -2109,14 +1999,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2811) (sp-item 2812) (sp-item 2813)) + :parts ((sp-item 2811) (sp-item 2812) (sp-item 2813)) ) ;; failed to figure out what this is: (defpart 2811 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-scale-x (meters 16) (meters 1) 1.0) (sp-int spt-rot-x 4) @@ -2139,14 +2027,12 @@ ;; failed to figure out what this is: (defpart 2814 - :init-specs - ((sp-flt spt-fade-a -1.4222221)) + :init-specs ((sp-flt spt-fade-a -1.4222221)) ) ;; failed to figure out what this is: (defpart 2812 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 32) 1.0) (sp-int spt-rot-x 4) @@ -2168,8 +2054,7 @@ ;; failed to figure out what this is: (defpart 2813 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 10) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -2192,14 +2077,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2815) (sp-item 2816) (sp-item 2817) (sp-item 2818) (sp-item 2819)) + :parts ((sp-item 2815) (sp-item 2816) (sp-item 2817) (sp-item 2818) (sp-item 2819)) ) ;; failed to figure out what this is: (defpart 2816 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -2222,8 +2105,7 @@ ;; failed to figure out what this is: (defpart 2819 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 8.0 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0) @@ -2245,8 +2127,7 @@ ;; failed to figure out what this is: (defpart 2815 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-rnd-flt spt-num 2.0 16.0 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) @@ -2272,8 +2153,7 @@ ;; failed to figure out what this is: (defpart 2817 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 5) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -2293,8 +2173,7 @@ ;; failed to figure out what this is: (defpart 2818 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 10) (meters 1.6) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -2313,8 +2192,7 @@ :id 653 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2648 :period 600 :length 5) + :parts ((sp-item 2648 :period 600 :length 5) (sp-item 2649 :period 600 :length 40) (sp-item 2650 :period 600 :length 40) (sp-item 2651 :period 600 :length 40) @@ -2323,8 +2201,7 @@ ;; failed to figure out what this is: (defpart 2649 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 1) (meters 2) 1.0) @@ -2353,14 +2230,12 @@ ;; failed to figure out what this is: (defpart 2652 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2651 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 0.8)) @@ -2382,8 +2257,7 @@ ;; failed to figure out what this is: (defpart 2648 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 128)) @@ -2400,8 +2274,7 @@ ;; failed to figure out what this is: (defpart 2650 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 16) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -2429,8 +2302,7 @@ ;; failed to figure out what this is: (defpart 2653 - :init-specs - ((sp-flt spt-fade-r 0.0) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g -1.0666667) (sp-flt spt-fade-b -2.1333334) (sp-int spt-next-time 60) @@ -2440,8 +2312,7 @@ ;; failed to figure out what this is: (defpart 2654 - :init-specs - ((sp-flt spt-fade-r -0.28444445) + :init-specs ((sp-flt spt-fade-r -0.28444445) (sp-flt spt-fade-g -0.28444445) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.42666668) @@ -2452,8 +2323,7 @@ ;; failed to figure out what this is: (defpart 2655 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: @@ -2461,8 +2331,7 @@ :id 654 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2820 :period 36 :length 5) + :parts ((sp-item 2820 :period 36 :length 5) (sp-item 2820 :period 140 :length 5) (sp-item 2820 :period 61 :length 5) (sp-item 2656 :period 15 :length 5) @@ -2472,8 +2341,7 @@ ;; failed to figure out what this is: (defpart 2821 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0) (meters 4) 1.0) @@ -2490,8 +2358,7 @@ ;; failed to figure out what this is: (defpart 2656 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -2515,8 +2382,7 @@ ;; failed to figure out what this is: (defpart 2820 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-int spt-num 0 2 8.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1) 1.0) @@ -2548,8 +2414,7 @@ ;; failed to figure out what this is: (defpart 2852 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-int spt-rot-x 16) (sp-flt spt-r 4096.0) (sp-flt spt-g 3276.8) @@ -2565,8 +2430,7 @@ ;; failed to figure out what this is: (defpart 2657 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) (sp-int spt-rot-x 4) @@ -2590,14 +2454,12 @@ ;; failed to figure out what this is: (defpart 2661 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) ;; failed to figure out what this is: (defpart 2658 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-int spt-rot-x 4) @@ -2620,8 +2482,7 @@ ;; failed to figure out what this is: (defpart 2659 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.0) (sp-flt spt-scale-x (meters 3.5)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2639,8 +2500,7 @@ ;; failed to figure out what this is: (defpart 2660 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.0) (sp-flt spt-scale-x (meters 4)) (sp-flt spt-rot-z (degrees 0.0)) @@ -2661,8 +2521,7 @@ :id 666 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2719 :binding 2716) + :parts ((sp-item 2719 :binding 2716) (sp-item 2716 :flags (bit1 start-dead launch-asap) :binding 2717) (sp-item 2716 :flags (bit1 start-dead launch-asap) :binding 2718) (sp-item 2716 :flags (bit1 start-dead launch-asap) :binding 2717) @@ -2684,14 +2543,12 @@ :id 667 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 2723 :flags (is-3d))) + :parts ((sp-item 2723 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 2723 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) @@ -2710,8 +2567,7 @@ ;; failed to figure out what this is: (defpart 2719 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.01) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -2732,8 +2588,7 @@ ;; failed to figure out what this is: (defpart 2716 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -2756,8 +2611,7 @@ ;; failed to figure out what this is: (defpart 2717 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -2777,8 +2631,7 @@ ;; failed to figure out what this is: (defpart 2718 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -2798,8 +2651,7 @@ ;; failed to figure out what this is: (defpart 2720 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.85) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-y (meters 2.5) (meters 1.5) 1.0) @@ -2820,8 +2672,7 @@ ;; failed to figure out what this is: (defpart 2722 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -2842,8 +2693,7 @@ ;; failed to figure out what this is: (defpart 2721 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 4) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -2863,8 +2713,7 @@ :id 668 :flags (use-local-clock) :bounds (static-bspherem 0 23 0 64) - :parts - ((sp-item 2726 :binding 2724) + :parts ((sp-item 2726 :binding 2724) (sp-item 2724 :flags (bit1 start-dead launch-asap) :binding 2725) (sp-item 2724 :flags (bit1 start-dead launch-asap) :binding 2725) (sp-item 2724 :flags (bit1 start-dead launch-asap) :binding 2725) @@ -2882,8 +2731,7 @@ ;; failed to figure out what this is: (defpart 2730 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) @@ -2902,8 +2750,7 @@ ;; failed to figure out what this is: (defpart 2726 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.02) (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -2923,8 +2770,7 @@ ;; failed to figure out what this is: (defpart 2724 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -2947,8 +2793,7 @@ ;; failed to figure out what this is: (defpart 2725 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -2973,8 +2818,7 @@ ;; failed to figure out what this is: (defpart 2727 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.85) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-y (meters 2.5) (meters 1.5) 1.0) @@ -2995,8 +2839,7 @@ ;; failed to figure out what this is: (defpart 2729 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -3016,8 +2859,7 @@ ;; failed to figure out what this is: (defpart 2728 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 4) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -3037,8 +2879,7 @@ :id 670 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2733 :binding 2731) + :parts ((sp-item 2733 :binding 2731) (sp-item 2731 :flags (bit1 start-dead launch-asap) :binding 2732) (sp-item 2731 :flags (bit1 start-dead launch-asap) :binding 2732) (sp-item 2731 :flags (bit1 start-dead launch-asap) :binding 2732) @@ -3061,14 +2902,12 @@ :id 671 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 2737 :flags (is-3d))) + :parts ((sp-item 2737 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 2737 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) @@ -3087,8 +2926,7 @@ ;; failed to figure out what this is: (defpart 2733 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.025) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -3109,8 +2947,7 @@ ;; failed to figure out what this is: (defpart 2731 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -3133,8 +2970,7 @@ ;; failed to figure out what this is: (defpart 2732 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -3154,8 +2990,7 @@ ;; failed to figure out what this is: (defpart 2734 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.85) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-y (meters 2.5) (meters 1.5) 1.0) @@ -3176,8 +3011,7 @@ ;; failed to figure out what this is: (defpart 2736 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.7) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -3198,8 +3032,7 @@ ;; failed to figure out what this is: (defpart 2735 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.7) (sp-rnd-flt spt-scale-x (meters 4) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -3219,8 +3052,7 @@ :id 672 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2740 :binding 2738) + :parts ((sp-item 2740 :binding 2738) (sp-item 2738 :flags (bit1 start-dead launch-asap) :binding 2739) (sp-item 2738 :flags (bit1 start-dead launch-asap) :binding 2739) (sp-item 2738 :flags (bit1 start-dead launch-asap) :binding 2739) @@ -3243,14 +3075,12 @@ :id 673 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 2744 :flags (is-3d))) + :parts ((sp-item 2744 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 2744 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 24) 1.0) (sp-flt spt-rot-x 16384.0) @@ -3269,8 +3099,7 @@ ;; failed to figure out what this is: (defpart 2740 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.025) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -3291,8 +3120,7 @@ ;; failed to figure out what this is: (defpart 2738 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -3315,8 +3143,7 @@ ;; failed to figure out what this is: (defpart 2739 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -3335,8 +3162,7 @@ ;; failed to figure out what this is: (defpart 2741 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.85) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-y (meters 2.5) (meters 1.5) 1.0) @@ -3357,8 +3183,7 @@ ;; failed to figure out what this is: (defpart 2743 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-scale-x (meters 4) (meters 1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -3379,8 +3204,7 @@ ;; failed to figure out what this is: (defpart 2742 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 4) (meters 8) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -3401,8 +3225,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2324)) + :parts ((sp-item 2324)) ) ;; failed to figure out what this is: @@ -3411,8 +3234,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2324)) + :parts ((sp-item 2324)) ) ;; failed to figure out what this is: @@ -3421,8 +3243,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2324)) + :parts ((sp-item 2324)) ) ;; failed to figure out what this is: @@ -3431,8 +3252,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2324)) + :parts ((sp-item 2324)) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc b/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc index 50f353dd5b..674985b8c0 100644 --- a/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc +++ b/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc @@ -1,6 +1,10 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/darkecobomb-ag.gc") +(import "goal_src/import/greenshot-ag.gc") +(import "goal_src/import/redring-ag.gc") + ;; definition of type torus (deftype torus (structure) ((origin vector :inline :offset-assert 0) @@ -244,15 +248,13 @@ ;; failed to figure out what this is: (defstate arcing-shot-debug-trajectory (arcing-shot) - :trans - (behavior () + :trans (behavior () (arcing-shot-setup (camera-pos) (-> self entity extra trans) 40960.0) (arcing-shot-draw) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (format *stdcon* "debug trajectory~%") (suspend) ) @@ -292,39 +294,28 @@ ) ;; failed to figure out what this is: -(defskelgroup *darkecobomb-sg* darkecobomb - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 3.5 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *darkecobomb-sg* darkecobomb darkecobomb-lod0-jg darkecobomb-idle-ja + ((darkecobomb-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3.5 0 6) + ) ;; failed to figure out what this is: (defstate darkecobomb-explode (darkecobomb) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (send-event *target* 'reset-pickup 'eco) - (sound-play-by-name (static-sound-name "explod-bomb") (new-sound-id) 1024 0 0 1 #f) + (sound-play "explod-bomb" :position #f) (activate! *camera-smush-control* 819.2 37 600 1.0 0.995) (send-event (ppointer->process (-> self parent)) 'flash 255.0) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - part-tracker-init - (-> *part-group-id-table* 619) - 900 - #f - #f - #f - (-> self root-override trans) - ) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 619) + 900 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (logior! (-> self draw status) (draw-status hidden)) (cond @@ -344,17 +335,7 @@ (if *target* (logclear! (-> *target* mask) (process-mask sleep)) ) - (let ((a1-12 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-12 from) self) - (set! (-> a1-12 num-params) 2) - (set! (-> a1-12 message) 'attack-invinc) - (set! (-> a1-12 param 0) (the-as uint #f)) - (let ((a0-21 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-21 mode) 'instant-death) - (set! (-> a1-12 param 1) (the-as uint a0-21)) - ) - (send-event-function *target* a1-12) - ) + (send-event *target* 'attack-invinc #f (static-attack-info ((mode 'instant-death)))) ) (else (send-event (ppointer->process (-> self parent)) 'bomb-done) @@ -363,8 +344,7 @@ (deactivate self) (none) ) - :post - (the-as (function none :behavior darkecobomb) ja-post) + :post (the-as (function none :behavior darkecobomb) ja-post) ) ;; definition for function darkecobomb-handler @@ -387,21 +367,17 @@ ;; failed to figure out what this is: (defstate darkecobomb-countdown (darkecobomb) - :event - darkecobomb-handler - :enter - (behavior () + :event darkecobomb-handler + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (set! (-> self next-tick) 0.9) (none) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (none) ) - :trans - (behavior () + :trans (behavior () (darkecobomb-explode-if-player-high-enough) (let ((f0-1 (fmax @@ -416,36 +392,25 @@ (set! (-> self anim-speed) (+ 1.0 f1-5)) ) (when (< (cos (* 16384.0 (- 1.0 f0-1))) (-> self next-tick)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 663) - 150 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 663) + 150 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (set! (-> self next-tick) (+ -0.06 (-> self next-tick))) - (sound-play-by-name (static-sound-name "robo-warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "robo-warning") ) ) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (the int (-> self countdown-time))) (go darkecobomb-explode #f) ) - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) + (when (ja-group? (-> self draw art-group data 5)) (let ((gp-2 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-2 (-> self node-list data 5)) (spawn (-> self part) gp-2) @@ -453,115 +418,66 @@ ) (none) ) - :code - (behavior () - (sound-play-by-name (static-sound-name "bomb-open") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (sound-play "bomb-open") + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) (-> self anim-speed)) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (update! (-> self sound)) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (none) ) - :post - (the-as (function none :behavior darkecobomb) transform-post) + :post (the-as (function none :behavior darkecobomb) transform-post) ) ;; failed to figure out what this is: (defstate darkecobomb-land (darkecobomb) - :event - darkecobomb-handler - :enter - (behavior () + :event darkecobomb-handler + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) 0 (none) ) - :trans - (behavior () + :trans (behavior () (darkecobomb-explode-if-player-high-enough) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 0.5)) (go darkecobomb-countdown) ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (while #t - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior darkecobomb) transform-post) + :post (the-as (function none :behavior darkecobomb) transform-post) ) ;; failed to figure out what this is: (defstate darkecobomb-idle (darkecobomb) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (arcing-shot-calculate (-> self root-override trans) (/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time))) @@ -571,48 +487,22 @@ ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior darkecobomb) transform-post) + :post (the-as (function none :behavior darkecobomb) transform-post) ) ;; definition for function darkecobomb-init-by-other @@ -645,20 +535,7 @@ (arcing-shot-setup arg0 arg1 arg2) (set! (-> self countdown-time) arg4) (set! (-> self flight-time) arg3) - (set! (-> self sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "bomb-spin") - :volume #x400 - :fo-max 80 - ) - (-> self to) - ) - ) + (set! (-> self sound) (new 'process 'ambient-sound (static-sound-spec "bomb-spin" :fo-max 80) (-> self to))) (go darkecobomb-idle) (none) ) @@ -686,23 +563,18 @@ ) ;; failed to figure out what this is: -(defskelgroup *greenshot-sg* greenshot - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *greenshot-sg* greenshot greenshot-lod0-jg greenshot-idle-ja + ((greenshot-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; failed to figure out what this is: (defstate greenshot-idle (greenshot) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (arcing-shot-calculate (-> self root-override trans) (/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time))) @@ -713,48 +585,17 @@ (spawn (-> self part) (-> self root-override trans)) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior greenshot) transform-post) + :post (the-as (function none :behavior greenshot) transform-post) ) ;; definition for function greenshot-init-by-other @@ -862,13 +703,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *redring-sg* redring - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 40) - :longest-edge (meters 0) - ) +(defskelgroup *redring-sg* redring redring-lod0-jg redring-idle-ja + ((redring-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 40) + ) ;; definition for function redshot-trans ;; INFO: Return type mismatch object vs none. @@ -890,58 +728,38 @@ ;; failed to figure out what this is: (defstate redshot-explode (redshot) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (sound-play-by-name (static-sound-name "red-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "red-explode") (logclear! (-> self draw status) (draw-status hidden)) (quaternion-identity! (-> self root-override quat)) (set! (-> self ring radius-secondary) 3072.0) (set! (-> self ring origin quad) (-> self root-override trans quad)) (+! (-> self ring origin y) (-> self ring radius-secondary)) (set-vector! (-> self ring axis) 0.0 1.0 0.0 1.0) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 648) - -1 - redshot-particle-callback - (-> self ppointer) - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) - ) - ) - ) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 648) + -1 + redshot-particle-callback + (-> self ppointer) + #f + (-> self root-override trans) + :to self + ) + ) + ) (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self ring radius-primary) (* 204.8 (the float (- (-> *display* game-frame-counter) (-> self state-time)))) ) (let ((gp-0 (new 'stack-no-clear 'vector))) (when (dummy-11 (-> self ring) gp-0) (vector-normalize! gp-0 16384.0) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack) - (set! (-> a1-2 param 0) (the-as uint #f)) - (let ((v1-8 (new 'static 'attack-info :mask #x2))) - (set! (-> v1-8 vector quad) (-> gp-0 quad)) - (set! (-> a1-2 param 1) (the-as uint v1-8)) - ) - (send-event-function *target* a1-2) - ) + (send-event *target* 'attack #f (static-attack-info ((vector gp-0)))) (send-event (ppointer->process (-> self parent)) 'hit-jak) ) ) @@ -966,19 +784,14 @@ ) (none) ) - :code - (behavior () - (while #t - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) (* 0.000016276043 (-> self ring radius-primary))) - ) + :code (behavior () + (loop + (ja :num-func num-func-identity :frame-num (* 0.000016276043 (-> self ring radius-primary))) (suspend) ) (none) ) - :post - (the-as (function none :behavior redshot) transform-post) + :post (the-as (function none :behavior redshot) transform-post) ) ;; definition for function redshot-handler @@ -992,15 +805,12 @@ ;; failed to figure out what this is: (defstate redshot-wait (redshot) - :event - redshot-handler - :enter - (behavior () + :event redshot-handler + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (redshot-trans (- (-> self stall-time) (- (-> *display* game-frame-counter) (-> self state-time)))) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self stall-time)) (go redshot-explode) @@ -1008,28 +818,23 @@ (spawn (-> self shot-particle) (-> self root-override trans)) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior redshot) transform-post) + :post (the-as (function none :behavior redshot) transform-post) ) ;; failed to figure out what this is: (defstate redshot-idle (redshot) - :event - redshot-handler - :enter - (behavior () + :event redshot-handler + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (redshot-trans (seconds 5)) (arcing-shot-calculate (-> self root-override trans) @@ -1041,15 +846,13 @@ (spawn (-> self shot-particle) (-> self root-override trans)) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior redshot) transform-post) + :post (the-as (function none :behavior redshot) transform-post) ) ;; definition for function redshot-init-by-other @@ -1086,19 +889,8 @@ (set! (-> self shot-particle) (create-launch-control (-> *part-group-id-table* 665) self)) (set! (-> self test-particle) (create-launch-control (-> *part-group-id-table* 679) self)) (logior! (-> self draw status) (draw-status hidden)) - (set! (-> self sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "red-fireball") - :volume #x400 - :fo-max 80 - ) - (-> self root-override trans) - ) + (set! (-> self sound) + (new 'process 'ambient-sound (static-sound-spec "red-fireball" :fo-max 80) (-> self root-override trans)) ) (go redshot-idle) (none) @@ -1128,34 +920,21 @@ ;; failed to figure out what this is: (defstate yellowshot-idle (yellowshot) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (when (= (-> arg0 type) target) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((a0-2 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-2 mode) 'generic) - (set! (-> a1-3 param 1) (the-as uint a0-2)) - ) - (send-event-function *target* a1-3) - ) + (send-event *target* 'attack (-> arg3 param 0) (static-attack-info ((mode 'generic)))) (send-event (ppointer->process (-> self parent)) 'hit-jak) ) ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (arcing-shot-calculate (-> self root-override trans) (/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time))) @@ -1167,15 +946,13 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior yellowshot) transform-post) + :post (the-as (function none :behavior yellowshot) transform-post) ) ;; definition for function yellowshot-init-by-other diff --git a/test/decompiler/reference/levels/finalboss/robotboss_REF.gc b/test/decompiler/reference/levels/finalboss/robotboss_REF.gc index a793375441..41a54c85d0 100644 --- a/test/decompiler/reference/levels/finalboss/robotboss_REF.gc +++ b/test/decompiler/reference/levels/finalboss/robotboss_REF.gc @@ -1,43 +1,38 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/robotboss-redeco-ag.gc") +(import "goal_src/import/robotboss-blueeco-ag.gc") +(import "goal_src/import/robotboss-yelloweco-ag.gc") + ;; definition for method 20 of type robotboss (defmethod ease-loc-t robotboss ((obj robotboss)) (parameter-ease-sin-clamp (-> obj loc-t)) ) ;; failed to figure out what this is: -(defskelgroup *robotboss-blueeco-sg* robotboss-blueeco - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 200) - :longest-edge (meters 0) - ) +(defskelgroup *robotboss-blueeco-sg* robotboss-blueeco robotboss-blueeco-lod0-jg robotboss-blueeco-idle-ja + ((robotboss-blueeco-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 200) + ) ;; failed to figure out what this is: -(defskelgroup *robotboss-redeco-sg* robotboss-redeco - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 200) - :longest-edge (meters 0) - ) +(defskelgroup *robotboss-redeco-sg* robotboss-redeco robotboss-redeco-lod0-jg robotboss-redeco-idle-ja + ((robotboss-redeco-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 200) + ) ;; failed to figure out what this is: -(defskelgroup *robotboss-yelloweco-sg* robotboss-yelloweco - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 200) - :longest-edge (meters 0) - ) +(defskelgroup *robotboss-yelloweco-sg* robotboss-yelloweco robotboss-yelloweco-lod0-jg robotboss-yelloweco-idle-ja + ((robotboss-yelloweco-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 200) + ) ;; definition for function robotboss-cut-cam-exit ;; INFO: Return type mismatch symbol vs none. (defbehavior robotboss-cut-cam-exit robotboss () (set! (-> self valid-frames) 0) - (if (and *target* (logtest? (-> *target* state-flags) 256)) + (if (and *target* (logtest? (-> *target* state-flags) (state-flags grabbed))) (process-release? *target*) ) (logclear! (-> self skel status) (janim-status inited)) @@ -50,19 +45,11 @@ (defbehavior robotboss-cut-cam robotboss ((arg0 float) (arg1 float) (arg2 int)) (let ((f0-0 (ja-aframe-num 0))) (cond - ((or (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - arg2 - ) - ) - (< f0-0 arg0) - (< arg1 f0-0) - ) + ((or (not (ja-group? arg2)) (< f0-0 arg0) (< arg1 f0-0)) (robotboss-cut-cam-exit) ) - ((or (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + ((or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) (-> self skip-cut) ) @@ -95,7 +82,7 @@ (hide-hud-quick) (set! *camera-look-through-other* 2) (when (< (-> self valid-frames) 2) - (set-blackout-frames (seconds 0.033333335)) + (set-blackout-frames (seconds 0.035)) (+! (-> self valid-frames) 1) ) ) @@ -169,18 +156,16 @@ (b! #t cfg-66 :delay (nop!)) (label cfg-19) (b! - (not - (and (-> self des-cam-entity) - (or (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 188416.0) - (and *target* - (>= 290816.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) - ) - ) - ) + (not (and (-> self des-cam-entity) + (or (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 188416.0) + (and *target* + (>= 290816.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) + ) + ) + ) + ) cfg-37 - :delay - (empty-form) + :delay (empty-form) ) (if (or (not (-> *camera* cam-entity)) (not (string= @@ -194,26 +179,18 @@ (b! #t cfg-66 :delay (nop!)) (label cfg-37) (b! - (not - (or (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 73728.0) - (and *target* - (>= 290816.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) - ) - ) + (not (or (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 73728.0) + (and *target* + (>= 290816.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) + ) + ) + ) cfg-49 - :delay - (empty-form) + :delay (empty-form) ) - (let ((a1-18 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-18 from) self) - (set! (-> a1-18 num-params) 1) - (set! (-> a1-18 message) 'query-state) - (set! (-> a1-18 param 0) (the-as uint cam-robotboss)) - (when (not (send-event-function *camera* a1-18)) - (send-event *camera* 'change-state cam-robotboss 300) - (send-event *camera* 'clear-entity) - ) + (when (not (send-event *camera* 'query-state cam-robotboss)) + (send-event *camera* 'change-state cam-robotboss (seconds 1)) + (send-event *camera* 'clear-entity) ) (b! #t cfg-66 :delay (nop!)) (label cfg-49) @@ -224,35 +201,23 @@ ) ) ) - (let ((a1-24 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-24 from) self) - (set! (-> a1-24 num-params) 1) - (set! (-> a1-24 message) 'query-state) - (set! (-> a1-24 param 0) (the-as uint cam-string)) - (when (not (send-event-function *camera* a1-24)) - (send-event *camera* 'point-of-interest #f) - (send-event *camera* 'force-blend 300) - (send-event *camera* 'clear-entity) - (send-event *camera* 'change-state cam-string 300) - ) + (when (not (send-event *camera* 'query-state cam-string)) + (send-event *camera* 'point-of-interest #f) + (send-event *camera* 'force-blend (seconds 1)) + (send-event *camera* 'clear-entity) + (send-event *camera* 'change-state cam-string (seconds 1)) ) ) (label cfg-66) - (let ((a1-29 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-29 from) self) - (set! (-> a1-29 num-params) 1) - (set! (-> a1-29 message) 'query-state) - (set! (-> a1-29 param 0) (the-as uint cam-string)) - (cond - ((send-event-function *camera* a1-29) + (cond + ((send-event *camera* 'query-state cam-string) + ) + ((-> self use-interesting) + (let ((s5-10 (new 'stack-no-clear 'vector))) + (vector<-cspace! s5-10 (-> self node-list data 87)) + (send-event *camera* 'point-of-interest s5-10) ) - ((-> self use-interesting) - (let ((s5-10 (new 'stack-no-clear 'vector))) - (vector<-cspace! s5-10 (-> self node-list data 87)) - (send-event *camera* 'point-of-interest s5-10) - ) - ) - ) + ) ) (when (and arg0 *debug-segment* (cpad-pressed? 1 x)) (logclear! (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons x)) @@ -279,19 +244,9 @@ (set! (-> self vulnerable) arg0) (let ((gp-0 (new 'stack 'sphere))) (set! (-> gp-0 w) 4096.0) - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self shot-attractor) - (ppointer->handle - (when s5-0 - (let ((t9-2 (method-of-type manipy activate))) - (t9-2 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> self root-override trans) (-> self entity) *redring-sg* gp-0) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> self shot-attractor) + (ppointer->handle (manipy-spawn (-> self root-override trans) (-> self entity) *redring-sg* gp-0 :to self)) + ) ) (send-event (handle->process (-> self shot-attractor)) 'attackable #t) (send-event (handle->process (-> self shot-attractor)) 'draw #f) @@ -321,31 +276,14 @@ ;; definition for function robotboss-anim-blend-loop (defbehavior robotboss-anim-blend-loop robotboss ((arg0 art-joint-anim)) - (let ((s5-0 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((s5-0 (ja-group))) (ja-channel-push! 2 0) - (let ((s4-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! s4-0 arg0 num-func-identity) - (set! (-> s4-0 frame-num) 0.0) - ) - (let ((gp-1 (-> self skel root-channel 1))) - (joint-control-channel-group-eval! gp-1 s5-0 num-func-identity) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! arg0 :num! min) + (ja :chan 1 :group! s5-0 :num! min) ) - (while #t - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((gp-2 (-> self skel root-channel 1))) - (set! (-> gp-2 frame-interp) (- 1.0 (ease-loc-t self))) - (set! (-> gp-2 param 0) 0.0) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-chan) - ) + (loop + (ja :num! (loop!)) + (ja :chan 1 :num! (chan 0) :frame-interp (- 1.0 (ease-loc-t self))) (suspend) ) (none) @@ -402,6 +340,7 @@ ) ;; definition for function robotboss-darkecobomb +;; INFO: Return type mismatch (pointer process) vs (pointer part-tracker). ;; Used lq/sq (defbehavior robotboss-darkecobomb robotboss ((arg0 vector) (arg1 float)) (+! (-> self children-spawned) 1) @@ -410,24 +349,18 @@ (vector<-cspace! gp-0 (-> self node-list data 60)) (set! (-> s4-0 quad) (-> self entity extra trans quad)) (vector+! s4-0 s4-0 arg0) - (let ((s3-1 (get-process *default-dead-pool* darkecobomb #x4000))) - (when s3-1 - (let ((t9-2 (method-of-type darkecobomb activate))) - (t9-2 (the-as darkecobomb s3-1) self 'darkecobomb (the-as pointer #x70004000)) - ) - (run-now-in-process s3-1 darkecobomb-init-by-other gp-0 s4-0 61440.0 300 arg1) - (-> s3-1 ppointer) - ) - ) + (process-spawn darkecobomb gp-0 s4-0 61440.0 300 arg1 :to self) ) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 638) 300 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 638) + 300 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) ) @@ -514,8 +447,7 @@ ;; failed to figure out what this is: (defstate robotboss-yellow-dark-bomb-wait (robotboss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'white-eco-picked-up) @@ -546,15 +478,13 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (set! (-> self children-spawned) 0) 0 (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self des-cam-entity) #f) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) @@ -619,178 +549,52 @@ (send-event (handle->process (-> self white-eco)) 'beam-off) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans (the-as (state robotboss) #f)) (spool-push *art-control* "green-sagecage-outro-beat-boss-a" 0 self (the-as float -1.0)) (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 30) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 32))) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-dark-shoot-no-yellow-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (>= (ja-frame-num 0) 15.0) (< (-> self children-spawned) 1)) (robotboss-darkecobomb (new 'static 'vector :y 40960.0 :z 81920.0) (-> self dda yellow-bomb-time)) (play-ambient (-> self ambient) "GOL-AM20" #t (the-as vector #f)) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (ja-channel-push! 1 30) - (let ((v1-52 (-> self skel root-channel 0))) - (set! (-> v1-52 frame-group) (the-as art-joint-anim (-> self draw art-group data 32))) - ) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-16 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! - a0-16 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (ja :num! (seek!)) ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-dark-shoot-no-yellow-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (and (>= (ja-frame-num 0) 15.0) (< (-> self children-spawned) 2)) (robotboss-darkecobomb (new 'static 'vector :y 40960.0 :z -81920.0) (+ -150.0 (-> self dda yellow-bomb-time))) ) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (ja-channel-push! 1 30) - (let ((v1-93 (-> self skel root-channel 0))) - (set! (-> v1-93 frame-group) (the-as art-joint-anim (-> self draw art-group data 32))) - ) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-25 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-25 param 1) 1.0) - (set! (-> a0-25 frame-num) 0.0) - (joint-control-channel-group! - a0-25 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (ja :num! (seek!)) ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-dark-shoot-no-yellow-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (and (>= (ja-frame-num 0) 15.0) (< (-> self children-spawned) 3)) (robotboss-darkecobomb (new 'static 'vector :x 81920.0 :y 40960.0) (+ -300.0 (-> self dda yellow-bomb-time))) ) (suspend) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (ja-channel-push! 1 30) - (let ((v1-134 (-> self skel root-channel 0))) - (set! (-> v1-134 frame-group) (the-as art-joint-anim (-> self draw art-group data 32))) - ) - (let ((a0-34 (-> self skel root-channel 0))) - (set! (-> a0-34 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-34 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-34 param 1) 1.0) - (set! (-> a0-34 frame-num) 0.0) - (joint-control-channel-group! - a0-34 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (ja :num! (seek!)) ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-dark-shoot-no-yellow-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (>= (ja-frame-num 0) 15.0) (< (-> self children-spawned) 4)) (robotboss-darkecobomb (new 'static 'vector :x -81920.0 :y 40960.0) (+ -450.0 (-> self dda yellow-bomb-time))) @@ -798,69 +602,27 @@ (set! (-> self des-cam-entity) "camera-365") ) (suspend) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 param 0) (the float (+ (-> a0-38 frame-group data 0 length) -1))) - (set! (-> a0-38 param 1) 1.0) - (joint-control-channel-group-eval! a0-38 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 30) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-183 (-> self skel root-channel 0))) - (set! (-> v1-183 frame-group) (the-as art-joint-anim (-> self draw art-group data 30))) - ) - ) - (let ((a0-48 (-> self skel root-channel 0))) - (set! (-> a0-48 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-48 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-48 param 1) 1.0) - (set! (-> a0-48 frame-num) 0.0) - (joint-control-channel-group! - a0-48 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (loop + (when (not (ja-group? robotboss-idle-hover-no-yellow-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-yellow-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-49 (-> self skel root-channel 0))) - (set! (-> a0-49 param 0) (the float (+ (-> a0-49 frame-group data 0 length) -1))) - (set! (-> a0-49 param 1) 1.0) - (joint-control-channel-group-eval! a0-49 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) ;; failed to figure out what this is: (defstate robotboss-daxter-sacrifice-movie (robotboss) - :code - (behavior () + :code (behavior () (set-blackout-frames (seconds 100)) (entity-birth-no-kill (-> self alts 5)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -890,21 +652,18 @@ ;; failed to figure out what this is: (defstate robotboss-white-eco-movie (robotboss) - :enter - (behavior () + :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (set! (-> self children-spawned) 0) (set! (-> self state-time) (-> *display* base-frame-counter)) (ja-post) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "green-sagecage-daxter-sacrifice" 0 self (the-as float -1.0)) (when (and (< (-> self children-spawned) 1) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.95)) @@ -913,25 +672,12 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self entity extra trans quad)) (set! (-> gp-0 y) (+ 81920.0 (-> gp-0 y))) - (let ((s5-0 (get-process *default-dead-pool* light-eco-mother #x4000))) - (set! (-> self white-eco) - (ppointer->handle - (when s5-0 - (let ((t9-2 (method-of-type light-eco-mother activate))) - (t9-2 (the-as light-eco-mother s5-0) self 'light-eco-mother (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 light-eco-mother-init-by-other (-> self entity) gp-0) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> self white-eco) (ppointer->handle (process-spawn light-eco-mother (-> self entity) gp-0 :to self))) ) ) (none) ) - :code - (behavior () + :code (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) (set! (-> a1-0 num-params) 1) @@ -1068,17 +814,7 @@ ) ) ) - (let* ((gp-0 (get-process *default-dead-pool* finalbosscam #x4000)) - (gp-1 (ppointer->handle (when gp-0 - (let ((t9-9 (method-of-type finalbosscam activate))) - (t9-9 (the-as finalbosscam gp-0) self 'finalbosscam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 finalbosscam-init-by-other (-> self entity)) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 (ppointer->handle (process-spawn finalbosscam (-> self entity) :to self)))) (send-event (handle->process gp-1) 'play-anim) (suspend) (while (movie?) @@ -1104,8 +840,7 @@ ;; failed to figure out what this is: (defstate robotboss-yellow-dark-bomb (robotboss) - :enter - (behavior () + :enter (behavior () (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 16384.0 -81920.0 716800.0 1.0) (set! (-> self loc-t) 0.0) @@ -1115,8 +850,7 @@ (play-ambient (-> self ambient) "GOL-AM01" #t (the-as vector #f)) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans (the-as (state robotboss) #f)) (spool-push *art-control* "finalbosscam-white-eco" 0 self (the-as float -1.0)) (if (>= (-> self loc-t) 1.0) @@ -1125,97 +859,28 @@ (robotboss-position) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 31))) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! - a0-4 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-dark-reveal-no-yellow-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 30) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-41 (-> self skel root-channel 0))) - (set! (-> v1-41 frame-group) (the-as art-joint-anim (-> self draw art-group data 30))) - ) + (when (not (ja-group? robotboss-idle-hover-no-yellow-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-yellow-ja) ) - (while #t - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! - a0-15 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) ;; definition for function robotboss-yellowshot @@ -1235,44 +900,28 @@ (vector-! s5-0 s5-0 gp-0) (vector-normalize! s5-0 (the-as float 819200.0)) (vector+! s5-0 s5-0 gp-0) - (let ((s4-1 (get-process *default-dead-pool* yellowshot #x4000))) - (when s4-1 - (let ((t9-4 (method-of-type yellowshot activate))) - (t9-4 (the-as yellowshot s4-1) self 'yellowshot (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 yellowshot-init-by-other gp-0 s5-0 0.0 750) - (-> s4-1 ppointer) - ) - ) + (process-spawn yellowshot gp-0 s5-0 0.0 750 :to self) ) (send-event self 'flash 255.0) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-8 (method-of-type part-tracker activate))) - (t9-8 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 642) 300 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 642) + 300 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) - (sound-play-by-name (static-sound-name "bfg-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bfg-fire") (none) ) ;; definition for function robotboss-is-yellow-hit (defbehavior robotboss-is-yellow-hit robotboss () - (or (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 28) - ) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) - ) + (or (ja-group? robotboss-yellow-hit-ja) (ja-group? robotboss-yellow-last-hit-ja)) ) ;; definition for function robotboss-time-to-shoot-yellow @@ -1282,14 +931,10 @@ ;; failed to figure out what this is: (defstate robotboss-yellow-wait (robotboss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hit-jak) - (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-3 (the-as number (logior #x3f800000 v1-2))) - (f0-2 (+ -1.0 (the-as float v1-3))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.75 f0-2) (play-ambient (-> self ambient) "GOL-AM10" #t (the-as vector #f)) @@ -1307,10 +952,7 @@ ) ) (('missed-jak) - (let* ((v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-14 (the-as number (logior #x3f800000 v1-13))) - (f0-5 (+ -1.0 (the-as float v1-14))) - ) + (let ((f0-5 (rand-float-gen))) (if (< 0.5 f0-5) (play-ambient (-> self ambient) "GOL-AM14" #t (the-as vector #f)) (play-ambient (-> self ambient) "MAI-AM02" #t (the-as vector #f)) @@ -1322,8 +964,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self hits-to-go) -1) (set! (-> self state-time) (-> *display* game-frame-counter)) (set! (-> self till-next-shot) 300) @@ -1331,8 +972,7 @@ (set! (-> self keep-charging) #f) (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) (if a0-1 (deactivate a0-1) @@ -1386,8 +1026,7 @@ (stop! (-> self looping-sound 3)) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-yellow-dark-bomb) (robotboss-shooting-trans 21) (cond @@ -1397,40 +1036,24 @@ (robotboss-yellow-eco-off) (set! (-> self took-hit) #f) (+! (-> self hits-to-go) -1) - (ja-channel-push! 1 30) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-yellow-last-hit-ja) (set! (-> self yellow-smoke) #t) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (-> self node-list data 27)) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker s5-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 part-tracker-init (-> *part-group-id-table* 653) 300 #f #f #f gp-0) - (-> s5-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 653) + 300 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) - (let* ((s5-1 (get-process *default-dead-pool* manipy #x4000)) - (gp-1 (when s5-1 - (let ((t9-10 (method-of-type manipy activate))) - (t9-10 (the-as manipy s5-1) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - manipy-init - (-> self root-override trans) - (-> self entity) - *robotboss-yelloweco-sg* - #f - ) - (-> s5-1 ppointer) - ) - ) - ) + (let ((gp-1 (manipy-spawn (-> self root-override trans) (-> self entity) *robotboss-yelloweco-sg* #f :to self))) (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-1) 'anim-mode 'play1) (send-event (ppointer->process gp-1) 'rot-quat (-> self root-override quat)) @@ -1442,14 +1065,12 @@ (play-ambient (-> self ambient) "MAI-AM06" #t (the-as vector #f)) ) (set! (-> self took-hit) #f) - (ja-channel-push! 1 30) - (let ((v1-54 (-> self skel root-channel 0))) - (set! (-> v1-54 frame-group) (the-as art-joint-anim (-> self draw art-group data 28))) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-yellow-hit-ja) ) ) (robotboss-position) - (robotboss-cut-cam (the-as float 5.0) (the-as float 50.0) (the-as int (-> self draw art-group data 29))) + (robotboss-cut-cam (the-as float 5.0) (the-as float 50.0) (the-as int robotboss-yellow-roar-ja)) (when (and (-> self keep-charging) (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) ) @@ -1461,13 +1082,8 @@ ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) @@ -1476,121 +1092,39 @@ (if (nonzero? (-> self yellow-gun)) (set-mode! (-> self yellow-gun) (joint-mod-handler-mode look-at)) ) - (while #t + (loop (when (not (robotboss-time-to-shoot-yellow)) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 26) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-23 (-> self skel root-channel 0))) - (set! (-> v1-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 26))) - ) + (when (not (ja-group? robotboss-yellow-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-yellow-idle-ja) ) - (when (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) - (let ((v1-30 (-> self skel root-channel 0))) - (set! (-> v1-30 num-func) num-func-identity) - (set! (-> v1-30 frame-num) 15.0) + (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) + (ja :num-func num-func-identity :frame-num 15.0) ) - ) (while (not (or (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) + (ja-group? robotboss-yellow-last-hit-ja) ) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 26) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-40 (-> self skel root-channel 0))) - (set! (-> v1-40 frame-group) (the-as art-joint-anim (-> self draw art-group data 26))) - ) - ) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-24 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! - a0-24 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (when (not (ja-group? robotboss-yellow-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-yellow-idle-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (robotboss-is-yellow-hit) (goto cfg-36) ) (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (label cfg-36) (when (not (robotboss-is-yellow-hit)) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 26) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-93 (-> self skel root-channel 0))) - (set! (-> v1-93 frame-group) (the-as art-joint-anim (-> self draw art-group data 26))) - ) - ) - (let ((a0-41 (-> self skel root-channel 0))) - (set! (-> a0-41 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-41 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-41 param 1) 1.0) - (set! (-> a0-41 frame-num) 0.0) - (joint-control-channel-group! - a0-41 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (when (not (ja-group? robotboss-yellow-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-yellow-idle-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (robotboss-is-yellow-hit) (goto cfg-55) @@ -1599,46 +1133,24 @@ (set! (-> self keep-charging) #t) ) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) (the float (+ (-> a0-43 frame-group data 0 length) -1))) - (set! (-> a0-43 param 1) 1.0) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (label cfg-55) - (when (and (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) - ) - (or (robotboss-time-to-shoot-yellow) (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 28) - ) - ) - ) + (when (and (not (ja-group? robotboss-yellow-last-hit-ja)) + (or (robotboss-time-to-shoot-yellow) (not (ja-group? robotboss-yellow-hit-ja))) ) (set! (-> self state-time) (-> *display* game-frame-counter)) - (let* ((f30-1 (-> self dda yellow-shot-time-min)) - (f28-0 (-> self dda yellow-shot-time-rnd)) - (v1-147 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-148 (the-as number (logior #x3f800000 v1-147))) - ) - (set! (-> self till-next-shot) - (the int (+ f30-1 (the float (the int (* f28-0 (+ -1.0 (the-as float v1-148))))))) - ) + (let ((f30-1 (-> self dda yellow-shot-time-min)) + (f28-0 (-> self dda yellow-shot-time-rnd)) + ) + (set! (-> self till-next-shot) (the int (+ f30-1 (the float (the int (* f28-0 (rand-float-gen))))))) ) (stop! (-> self looping-sound 3)) (robotboss-yellowshot) (robotboss-yellow-eco-on) - (let* ((v1-154 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-155 (the-as number (logior #x3f800000 v1-154))) - (f0-29 (+ -1.0 (the-as float v1-155))) - ) + (let ((f0-29 (rand-float-gen))) (cond ((< 0.8333333 f0-29) (play-ambient (-> self ambient) "GOL-AM04" #t (the-as vector #f)) @@ -1660,74 +1172,26 @@ ) ) ) - (ja-channel-push! 1 15) - (let ((v1-176 (-> self skel root-channel 0))) - (set! (-> v1-176 frame-group) (the-as art-joint-anim (-> self draw art-group data 27))) - ) - ) - (let ((a0-70 (-> self skel root-channel 0))) - (set! (-> a0-70 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-70 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-70 param 1) 1.0) - (set! (-> a0-70 frame-num) 0.0) - (joint-control-channel-group! - a0-70 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! robotboss-yellow-blast-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-71 (-> self skel root-channel 0))) - (set! (-> a0-71 param 0) (the float (+ (-> a0-71 frame-group data 0 length) -1))) - (set! (-> a0-71 param 1) 1.0) - (joint-control-channel-group-eval! a0-71 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) - (let ((a0-77 (-> self skel root-channel 0))) - (set! (-> a0-77 frame-group) (the-as art-joint-anim (-> self draw art-group data 29))) - (set! (-> a0-77 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 29)) data 0 length) -1)) - ) - (set! (-> a0-77 param 1) 1.0) - (set! (-> a0-77 frame-num) 0.0) - (joint-control-channel-group! a0-77 (the-as art-joint-anim (-> self draw art-group data 29)) num-func-seek!) - ) + (when (ja-group? robotboss-yellow-last-hit-ja) + (ja-no-eval :group! robotboss-yellow-roar-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-78 (-> self skel root-channel 0))) - (set! (-> a0-78 param 0) (the float (+ (-> a0-78 frame-group data 0 length) -1))) - (set! (-> a0-78 param 1) 1.0) - (joint-control-channel-group-eval! a0-78 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go robotboss-yellow-dark-bomb) ) ) (none) ) - :post - (behavior () + :post (behavior () (when *target* (if (nonzero? (-> self yellow-gun)) (set-target! (-> self yellow-gun) (target-pos 5)) @@ -1740,10 +1204,8 @@ ;; failed to figure out what this is: (defstate robotboss-yellow (robotboss) - :event - robotboss-handler - :enter - (behavior () + :event robotboss-handler + :enter (behavior () (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 13653.333 77824.0 491520.0 1.0) (set! (-> self loc-t) 0.0) @@ -1752,8 +1214,7 @@ (set! (-> self desired-pool-y) -18432.0) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-yellow-wait) (if (>= (-> self loc-t) 1.0) (go robotboss-yellow-wait) @@ -1761,142 +1222,58 @@ (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 60) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 25))) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-dark-return-after-red-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (cond ((and *target* (< (+ 81920.0 (-> self entity extra trans y)) (-> (target-pos 0) y))) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) - ) - (ja-channel-push! 1 240) - (let ((v1-55 (-> self skel root-channel 0))) - (set! (-> v1-55 frame-group) (the-as art-joint-anim (-> self draw art-group data 23))) - ) + (when (not (ja-group? robotboss-idle-hover-lookup-no-red-ja)) + (ja-channel-push! 1 (seconds 0.8)) + (ja :group! robotboss-idle-hover-lookup-no-red-ja) ) ) - ((not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 21) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-64 (-> self skel root-channel 0))) - (set! (-> v1-64 frame-group) (the-as art-joint-anim (-> self draw art-group data 21))) - ) + ((not (ja-group? robotboss-idle-hover-no-red-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-red-ja) ) ) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-27 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-27 param 1) 1.0) - (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! - a0-27 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) ;; failed to figure out what this is: (defstate robotboss-red-dark-bomb-wait (robotboss) - :event - robotboss-bomb-handler - :enter - (behavior () + :event robotboss-bomb-handler + :enter (behavior () (set! (-> self children-spawned) 0) (logior! (-> self alts 11 extra perm status) (entity-perm-status bit-3)) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self ignore-camera) #f) (set! (-> self des-cam-entity) #f) (logclear! (-> self alts 11 extra perm status) (entity-perm-status bit-3)) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-yellow) (if (and (< (-> self children-spawned) 0) (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump)) @@ -1906,116 +1283,42 @@ (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 30) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 24))) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-dark-shoot-no-red-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (>= (ja-frame-num 0) 15.0) (< (-> self children-spawned) 1)) (robotboss-darkecobomb (new 'static 'vector :y 32768.0) (-> self dda red-bomb-time)) (set! (-> self des-cam-entity) "camera-365") ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 21) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-57 (-> self skel root-channel 0))) - (set! (-> v1-57 frame-group) (the-as art-joint-anim (-> self draw art-group data 21))) - ) - ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-19 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! - a0-19 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (loop + (when (not (ja-group? robotboss-idle-hover-no-red-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-red-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) ;; failed to figure out what this is: (defstate robotboss-red-dark-bomb (robotboss) - :enter - (behavior () + :enter (behavior () (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 0.0 -81920.0 716800.0 1.0) (set! (-> self loc-t) 0.0) @@ -2024,8 +1327,7 @@ (set! (-> self desired-pool-y) -20480.0) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-red-dark-bomb-wait) (robotboss-position) (if (>= (-> self loc-t) 1.0) @@ -2033,97 +1335,28 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 22))) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! - a0-4 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-dark-reveal-no-red-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 21) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-41 (-> self skel root-channel 0))) - (set! (-> v1-41 frame-group) (the-as art-joint-anim (-> self draw art-group data 21))) - ) + (when (not (ja-group? robotboss-idle-hover-no-red-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-red-ja) ) - (while #t - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! - a0-15 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) ;; definition of type redshot-launch-info @@ -2173,20 +1406,16 @@ 0.0 (dotimes (s3-0 6) (let ((s1-0 (-> arg0 info s3-0))) - (let* ((f30-0 -40960.0) - (f28-0 81920.0) - (v1-4 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-5 (the-as number (logior #x3f800000 v1-4))) - ) - (set! (-> s1-0 dest x) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-5))))) + (let ((f30-0 -40960.0) + (f28-0 81920.0) + ) + (set! (-> s1-0 dest x) (+ f30-0 (* f28-0 (rand-float-gen)))) ) (set! (-> s1-0 dest y) 0.0) - (let* ((f30-1 -40960.0) - (f28-1 81920.0) - (v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-11 (the-as number (logior #x3f800000 v1-10))) - ) - (set! (-> s1-0 dest z) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-11))))) + (let ((f30-1 -40960.0) + (f28-1 81920.0) + ) + (set! (-> s1-0 dest z) (+ f30-1 (* f28-1 (rand-float-gen)))) ) (set! (-> s1-0 dest w) 1.0) ) @@ -2212,14 +1441,10 @@ (the-as time-frame (+ (the int (* f30-2 (+ -1.0 (the-as float v1-28)))) 180)) ) ) - (let* ((s1-3 (max 150 (- (the-as time-frame s2-0) (-> arg0 info s3-0 flight-time)))) - (f30-3 60.0) - (v1-38 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-39 (the-as number (logior #x3f800000 v1-38))) - ) - (set! (-> arg0 info s3-0 stall-time) - (the-as time-frame (+ (the int (* f30-3 (+ -1.0 (the-as float v1-39)))) 300 s1-3)) - ) + (let ((s1-3 (max 150 (- (the-as time-frame s2-0) (-> arg0 info s3-0 flight-time)))) + (f30-3 60.0) + ) + (set! (-> arg0 info s3-0 stall-time) (the-as time-frame (+ (the int (* f30-3 (rand-float-gen))) 300 s1-3))) ) (set! s2-0 (the-as int (+ (-> arg0 info s3-0 flight-time) (-> arg0 info s3-0 stall-time)))) ) @@ -2227,7 +1452,7 @@ (vector-! s5-0 (-> self entity extra trans) s5-0) (dotimes (v1-53 6) (vector+! (the-as vector (-> arg0 info v1-53)) (the-as vector (-> arg0 info v1-53)) s5-0) - (set! (-> arg0 info v1-53 dest y) (+ (-> (new 'static 'array float 1 2048.0) 0) (-> arg0 info v1-53 dest y))) + (set! (-> arg0 info v1-53 dest y) (+ 2048.0 (-> arg0 info v1-53 dest y))) ) ) (none) @@ -2254,12 +1479,10 @@ (s0-0 gp-0) ) (set! sv-48 (-> sv-32 dest)) - (let* ((f30-0 20480.0) - (f28-0 12288.0) - (v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-11 (the-as number (logior #x3f800000 v1-10))) - ) - (set! sv-64 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-11))))) + (let ((f30-0 20480.0) + (f28-0 12288.0) + ) + (set! sv-64 (+ f30-0 (* f28-0 (rand-float-gen)))) ) (set! sv-80 (-> sv-32 flight-time)) (set! sv-96 (-> sv-32 stall-time)) @@ -2284,16 +1507,18 @@ ) ) (when s5-0 - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 641) 300 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 641) + 300 + #f + #f + #f + gp-0 + :to *entity-pool* ) - (sound-play-by-name (static-sound-name "red-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "red-fire") ) ) ) @@ -2301,29 +1526,15 @@ ;; definition for function robotboss-is-red-hit (defbehavior robotboss-is-red-hit robotboss () - (or (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 19) - ) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - ) + (or (ja-group? robotboss-red-hit-ja) (ja-group? robotboss-red-last-hit-ja)) ) ;; failed to figure out what this is: (defstate robotboss-red-wait (robotboss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hit-jak) - (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-3 (the-as number (logior #x3f800000 v1-2))) - (f0-2 (+ -1.0 (the-as float v1-3))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.75 f0-2) (play-ambient (-> self ambient) "GOL-AM10" #t (the-as vector #f)) @@ -2341,10 +1552,7 @@ ) ) (('missed-jak) - (let* ((v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-14 (the-as number (logior #x3f800000 v1-13))) - (f0-5 (+ -1.0 (the-as float v1-14))) - ) + (let ((f0-5 (rand-float-gen))) (if (< 0.5 f0-5) (play-ambient (-> self ambient) "GOL-AM14" #t (the-as vector #f)) (play-ambient (-> self ambient) "MAI-AM01" #t (the-as vector #f)) @@ -2356,8 +1564,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self hits-to-go) -1) (set! (-> self des-cam-entity) "camera-390") (set! (-> self use-interesting) #t) @@ -2366,8 +1573,7 @@ 0 (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) (if a0-1 (deactivate a0-1) @@ -2431,8 +1637,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-red-dark-bomb) (robotboss-shooting-trans 40) (cond @@ -2455,34 +1660,24 @@ ) (set! (-> self took-hit) #f) (+! (-> self hits-to-go) -1) - (ja-channel-push! 1 30) - (let ((v1-10 (-> self skel root-channel 0))) - (set! (-> v1-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-red-last-hit-ja) (set! (-> self red-smoke) #t) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (-> self node-list data 51)) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker s5-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 part-tracker-init (-> *part-group-id-table* 649) 300 #f #f #f gp-0) - (-> s5-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 649) + 300 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) - (let* ((s5-1 (get-process *default-dead-pool* manipy #x4000)) - (gp-1 - (when s5-1 - (let ((t9-10 (method-of-type manipy activate))) - (t9-10 (the-as manipy s5-1) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> self root-override trans) (-> self entity) *robotboss-redeco-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) + (let ((gp-1 (manipy-spawn (-> self root-override trans) (-> self entity) *robotboss-redeco-sg* #f :to self))) (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-1) 'anim-mode 'play1) (send-event (ppointer->process gp-1) 'rot-quat (-> self root-override quat)) @@ -2494,123 +1689,46 @@ (play-ambient (-> self ambient) "MAI-AM06" #t (the-as vector #f)) ) (set! (-> self took-hit) #f) - (ja-channel-push! 1 30) - (let ((v1-56 (-> self skel root-channel 0))) - (set! (-> v1-56 frame-group) (the-as art-joint-anim (-> self draw art-group data 19))) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-red-hit-ja) ) ) (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) (robotboss-setup-for-hits 1 5) - (while #t + (loop (until (or (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) + (ja-group? robotboss-red-last-hit-ja) ) - (ja-channel-push! 1 60) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - ) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-7 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! - a0-7 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-red-idle-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) + (if (ja-group? robotboss-red-last-hit-ja) (goto cfg-24) ) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (label cfg-24) (set! (-> self state-time) (-> *display* game-frame-counter)) - (let* ((f30-0 (-> self dda red-shot-time-min)) - (f28-0 (-> self dda red-shot-time-rnd)) - (v1-65 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-66 (the-as number (logior #x3f800000 v1-65))) - ) - (set! (-> self till-next-shot) - (the int (+ f30-0 (the float (the int (* f28-0 (+ -1.0 (the-as float v1-66))))))) - ) + (let ((f30-0 (-> self dda red-shot-time-min)) + (f28-0 (-> self dda red-shot-time-rnd)) + ) + (set! (-> self till-next-shot) (the int (+ f30-0 (the float (the int (* f28-0 (rand-float-gen))))))) ) (when (not (robotboss-is-red-hit)) - (ja-channel-push! 1 60) - (let ((v1-72 (-> self skel root-channel 0))) - (set! (-> v1-72 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - ) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-27 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-27 param 1) 1.0) - (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! - a0-27 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-red-charge-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (update! (-> self looping-sound 2)) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -2621,27 +1739,16 @@ (goto cfg-37) ) (suspend) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 param 0) (the float (+ (-> a0-31 frame-group data 0 length) -1))) - (set! (-> a0-31 param 1) 1.0) - (joint-control-channel-group-eval! a0-31 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (label cfg-37) (stop! (-> self looping-sound 2)) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - ) - (let* ((v1-120 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-121 (the-as number (logior #x3f800000 v1-120))) - (f30-1 (+ -1.0 (the-as float v1-121))) - (gp-1 (new 'stack-no-clear 'redshot-launch-array)) - (s5-0 (-> self dda red-shots-min)) - ) + (when (not (ja-group? robotboss-red-last-hit-ja)) + (let ((f30-1 (rand-float-gen)) + (gp-1 (new 'stack-no-clear 'redshot-launch-array)) + (s5-0 (-> self dda red-shots-min)) + ) (robotboss-yellow-eco-on) (robotboss-redshot-fill-array gp-1) (robotboss-redshot (the-as redshot-launch-info (-> gp-1 info)) #t) @@ -2655,10 +1762,7 @@ ) ) (when (not (robotboss-is-red-hit)) - (let* ((v1-135 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-136 (the-as number (logior #x3f800000 v1-135))) - (f0-33 (+ -1.0 (the-as float v1-136))) - ) + (let ((f0-33 (rand-float-gen))) (cond ((< 0.8333333 f0-33) (play-ambient (-> self ambient) "GOL-AM04" #t (the-as vector #f)) @@ -2680,92 +1784,41 @@ ) ) ) - (let ((v1-157 (-> self skel root-channel 0))) - (set! (-> v1-157 frame-group) (the-as art-joint-anim (-> self draw art-group data 18))) - ) - ) - (let ((a0-56 (-> self skel root-channel 0))) - (set! (-> a0-56 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-56 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-56 param 1) 1.0) - (set! (-> a0-56 frame-num) 0.0) - (joint-control-channel-group! - a0-56 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (ja :group! robotboss-red-blast-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-57 (-> self skel root-channel 0))) - (set! (-> a0-57 param 0) (the float (+ (-> a0-57 frame-group data 0 length) -1))) - (set! (-> a0-57 param 1) 1.0) - (joint-control-channel-group-eval! a0-57 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - (let ((a0-63 (-> self skel root-channel 0))) - (set! (-> a0-63 frame-group) (the-as art-joint-anim (-> self draw art-group data 20))) - (set! (-> a0-63 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 20)) data 0 length) -1)) - ) - (set! (-> a0-63 param 1) 1.0) - (set! (-> a0-63 frame-num) 0.0) - (joint-control-channel-group! a0-63 (the-as art-joint-anim (-> self draw art-group data 20)) num-func-seek!) - ) + (when (ja-group? robotboss-red-last-hit-ja) + (ja-no-eval :group! robotboss-red-roar-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-64 (-> self skel root-channel 0))) - (set! (-> a0-64 param 0) (the float (+ (-> a0-64 frame-group data 0 length) -1))) - (set! (-> a0-64 param 1) 1.0) - (joint-control-channel-group-eval! a0-64 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go robotboss-red-dark-bomb) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) ;; failed to figure out what this is: (defstate robotboss-red (robotboss) - :event - robotboss-handler - :enter - (behavior () + :event robotboss-handler + :enter (behavior () (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 8192.0 -40960.0 327680.0 1.0) (set! (-> self loc-t) 0.0) (set! (-> self loc-t-start) (-> *display* game-frame-counter)) (set! (-> self loc-t-duration) (seconds 3)) (set! (-> self desired-pool-y) -22528.0) - (set-setting! *setting-control* self 'sound-flava #f (the-as float 40.0) 48) + (set-setting! 'sound-flava #f 40.0 (music-flava finalboss-end)) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-red-wait) (if (>= (-> self loc-t) 1.0) (go robotboss-red-wait) @@ -2773,126 +1826,49 @@ (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 60) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-dark-return-after-green-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-50 (-> self skel root-channel 0))) - (set! (-> v1-50 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) - ) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-17 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! - a0-17 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (loop + (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) ;; failed to figure out what this is: (defstate robotboss-green-dark-bomb-wait (robotboss) - :event - robotboss-bomb-handler - :enter - (behavior () + :event robotboss-bomb-handler + :enter (behavior () (set! (-> self children-spawned) 0) 0 (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self ignore-camera) #f) (set! (-> self des-cam-entity) #f) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-red) (if (and (< (-> self children-spawned) 0) (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump)) @@ -2902,47 +1878,15 @@ (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 30) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-dark-shoot-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (>= (ja-frame-num 0) 15.0) (< (-> self children-spawned) 1)) (robotboss-darkecobomb (new 'static 'vector :y 32768.0) (-> self dda green-bomb-time)) @@ -2950,69 +1894,27 @@ (play-ambient (-> self ambient) "GOL-AM11" #t (the-as vector #f)) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-59 (-> self skel root-channel 0))) - (set! (-> v1-59 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) - ) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-20 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-20 param 1) 1.0) - (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! - a0-20 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (loop + (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) ;; failed to figure out what this is: (defstate robotboss-green-dark-bomb (robotboss) - :enter - (behavior () + :enter (behavior () (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 16384.0 -81920.0 716800.0 1.0) (set! (-> self loc-t) 0.0) @@ -3022,8 +1924,7 @@ (play-ambient (-> self ambient) "MAI-AM01" #t (the-as vector #f)) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-green-dark-bomb-wait) (robotboss-position) (if (>= (-> self loc-t) 1.0) @@ -3031,97 +1932,28 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 14))) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! - a0-4 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-dark-reveal-green-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-41 (-> self skel root-channel 0))) - (set! (-> v1-41 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) + (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja) ) - (while #t - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! - a0-15 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) ;; definition for function robotboss-greenshot @@ -3135,27 +1967,21 @@ (set! (-> s2-0 quad) (-> self entity extra trans quad)) (set! (-> s2-0 y) (+ -40960.0 (-> s2-0 y))) (vector+! s2-0 s2-0 arg0) - (let ((s1-1 (get-process *default-dead-pool* greenshot #x4000))) - (when s1-1 - (let ((t9-2 (method-of-type greenshot activate))) - (t9-2 (the-as greenshot s1-1) self 'greenshot (the-as pointer #x70004000)) - ) - (run-now-in-process s1-1 greenshot-init-by-other gp-0 s2-0 arg1 arg2) - (-> s1-1 ppointer) - ) - ) + (process-spawn greenshot gp-0 s2-0 arg1 arg2 :to self) ) (when arg3 - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 640) 300 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 640) + 300 + #f + #f + #f + gp-0 + :to *entity-pool* ) - (sound-play-by-name (static-sound-name "green-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "green-fire") ) ) (none) @@ -3163,14 +1989,11 @@ ;; failed to figure out what this is: (defstate robotboss-green-wait (robotboss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) - (ja-channel-push! 1 60) - (let ((v1-3 (-> self skel root-channel 0))) - (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-green-roar-ja) (robotboss-yellow-eco-off) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) self) @@ -3189,10 +2012,7 @@ ) ) (('hit-jak) - (let* ((v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-9 (the-as number (logior #x3f800000 v1-8))) - (f0-2 (+ -1.0 (the-as float v1-9))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.75 f0-2) (play-ambient (-> self ambient) "GOL-AM10" #t (the-as vector #f)) @@ -3210,10 +2030,7 @@ ) ) (('blob-died) - (let* ((v1-19 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-20 (the-as number (logior #x3f800000 v1-19))) - (f0-5 (+ -1.0 (the-as float v1-20))) - ) + (let ((f0-5 (rand-float-gen))) (cond ((< 0.75 f0-5) (play-ambient (-> self ambient) "MAI-AM02" #t (the-as vector #f)) @@ -3235,16 +2052,14 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (set! (-> self children-spawned) 0) (robotboss-setup-for-hits 2 5) (set! (-> self des-cam-entity) "camera-385") (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) (if a0-1 (deactivate a0-1) @@ -3307,28 +2122,23 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-green-dark-bomb) (cond ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 0.4)) (< (-> self children-spawned) 1) ) (robotboss-greenshot (new 'static 'vector) (the-as float 24576.0) 600 #t) - (ja-channel-push! 1 60) - (let ((v1-9 (-> self skel root-channel 0))) - (set! (-> v1-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-green-spawn-ja) ) ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 1.2)) (< (-> self children-spawned) 3) ) (robotboss-greenshot (new 'static 'vector :x 8192.0) (the-as float 16384.0) 600 #t) (robotboss-greenshot (new 'static 'vector :z 8192.0) (the-as float 32768.0) 660 #f) - (ja-channel-push! 1 60) - (let ((v1-20 (-> self skel root-channel 0))) - (set! (-> v1-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-green-spawn-ja) ) ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 2.6)) (< (-> self children-spawned) 6) @@ -3336,48 +2146,34 @@ (robotboss-greenshot (new 'static 'vector :z 12288.0) (the-as float 20480.0) 600 #t) (robotboss-greenshot (new 'static 'vector :x 8192.0) (the-as float 8192.0) 660 #f) (robotboss-greenshot (new 'static 'vector) (the-as float 36864.0) 720 #f) - (ja-channel-push! 1 60) - (let ((v1-32 (-> self skel root-channel 0))) - (set! (-> v1-32 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-green-spawn-ja) ) ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 4)) (< (-> self children-spawned) 7) ) (robotboss-greenshot (new 'static 'vector) (the-as float 24576.0) 600 #t) - (ja-channel-push! 1 60) - (let ((v1-42 (-> self skel root-channel 0))) - (set! (-> v1-42 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-green-spawn-ja) ) ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 5.5)) (< (-> self children-spawned) 9) ) (robotboss-greenshot (new 'static 'vector) (the-as float 12288.0) 600 #t) (robotboss-greenshot (new 'static 'vector :x 4096.0 :z 12288.0) (the-as float 32768.0) 600 #f) - (ja-channel-push! 1 60) - (let ((v1-53 (-> self skel root-channel 0))) - (set! (-> v1-53 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-green-spawn-ja) ) ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 8)) (< (-> self children-spawned) 10) ) (+! (-> self children-spawned) 1) - (let ((gp-0 (get-process *default-dead-pool* green-eco-lurker-gen #x4000))) - (when gp-0 - (let ((t9-16 (method-of-type green-eco-lurker-gen activate))) - (t9-16 (the-as green-eco-lurker-gen gp-0) self 'green-eco-lurker-gen (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - green-eco-lurker-gen-init-by-other - (-> self entity) - (-> self entity extra trans) - (-> self dda num-blobs) - ) - (-> gp-0 ppointer) - ) + (process-spawn + green-eco-lurker-gen + (-> self entity) + (-> self entity extra trans) + (-> self dda num-blobs) + :to self ) (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 24576.0 0.0 655360.0 1.0) @@ -3396,85 +2192,37 @@ (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (while #t + (loop (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 13) - ) + ((ja-group? robotboss-green-roar-ja) (go robotboss-green-dark-bomb) ) - ((not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-25 (-> self skel root-channel 0))) - (set! (-> v1-25 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) + ((not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja) ) ) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-14 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-14 param 1) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! - a0-14 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) 1.0) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) ;; failed to figure out what this is: (defstate robotboss-green (robotboss) - :event - robotboss-handler - :enter - (behavior () + :event robotboss-handler + :enter (behavior () (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 24576.0 0.0 245760.0 1.0) (set! (-> self loc-t) 0.0) @@ -3482,11 +2230,10 @@ (set! (-> self loc-t-duration) (seconds 3)) (set! (-> self desired-pool-y) -26624.0) (play-ambient (-> self ambient) "GOL-AM01" #t (the-as vector #f)) - (set-setting! *setting-control* self 'sound-flava #f (the-as float 40.0) 47) + (set-setting! 'sound-flava #f 40.0 (music-flava finalboss-middle)) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-green-wait) (if (>= (-> self loc-t) 1.0) (go robotboss-green-wait) @@ -3494,126 +2241,49 @@ (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 60) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-dark-return-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-50 (-> self skel root-channel 0))) - (set! (-> v1-50 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) - ) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-17 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! - a0-17 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (loop + (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) ;; failed to figure out what this is: (defstate robotboss-blue-dark-bomb-wait (robotboss) - :event - robotboss-bomb-handler - :enter - (behavior () + :event robotboss-bomb-handler + :enter (behavior () (set! (-> self children-spawned) 0) 0 (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self ignore-camera) #f) (set! (-> self des-cam-entity) #f) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-green) (if (and (< (-> self children-spawned) 0) (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump)) @@ -3623,47 +2293,15 @@ (robotboss-position) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (ja-channel-push! 1 30) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-dark-shoot-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (>= (ja-frame-num 0) 15.0) (< (-> self children-spawned) 1)) (robotboss-darkecobomb (new 'static 'vector :y 32768.0) (the-as float 3600.0)) @@ -3671,84 +2309,35 @@ (play-ambient (-> self ambient) "MAI-AM04" #t (the-as vector #f)) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (cond ((and *target* (< (+ 81920.0 (-> self entity extra trans y)) (-> (target-pos 0) y))) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - ) - (ja-channel-push! 1 240) - (let ((v1-64 (-> self skel root-channel 0))) - (set! (-> v1-64 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) + (when (not (ja-group? robotboss-idle-hover-lookup-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.8)) + (ja :group! robotboss-idle-hover-lookup-no-blue-ja) ) ) - ((not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-73 (-> self skel root-channel 0))) - (set! (-> v1-73 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) + ((not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja) ) ) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-30 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-30 param 1) 1.0) - (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! - a0-30 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 param 0) (the float (+ (-> a0-31 frame-group data 0 length) -1))) - (set! (-> a0-31 param 1) 1.0) - (joint-control-channel-group-eval! a0-31 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) ;; failed to figure out what this is: (defstate robotboss-blue-dark-bomb (robotboss) - :enter - (behavior () + :enter (behavior () (set! (-> self old-loc quad) (-> self desired-loc quad)) (set-vector! (-> self desired-loc) 16384.0 -118784.0 614400.0 1.0) (set! (-> self loc-t) 0.0) @@ -3757,8 +2346,7 @@ (set! (-> self desired-pool-y) -28672.0) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-blue-dark-bomb-wait) (robotboss-position) (if (>= (-> self loc-t) 1.0) @@ -3766,97 +2354,28 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! - a0-4 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-dark-reveal-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-41 (-> self skel root-channel 0))) - (set! (-> v1-41 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) + (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja) ) - (while #t - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! - a0-15 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) ;; definition for function robotboss-blue-beam @@ -3883,45 +2402,35 @@ ) (cond ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 0.4)) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) - ) + (ja-group? robotboss-idle-blue-ja) ) (spawn (-> self particle 0) s4-0) (when (and arg1 (nonzero? (-> self looping-sound 0))) (update! (-> self looping-sound 0)) - (when (and *target* (zero? (logand (-> *target* state-flags) #x80f8))) + (when (and *target* + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + ) (let ((t2-0 (new 'stack-no-clear 'collide-tri-result)) (a2-0 (new 'stack-no-clear 'vector)) ) (vector-! a2-0 gp-0 s4-0) - (when (>= (fill-and-probe-using-line-sphere - *collide-cache* - s4-0 - a2-0 - (the-as float 4096.0) - (collide-kind target) - self - t2-0 - 1 - ) - 0.0 + (if (>= (fill-and-probe-using-line-sphere + *collide-cache* + s4-0 + a2-0 + (the-as float 4096.0) + (collide-kind target) + self + t2-0 + (new 'static 'pat-surface :noentity #x1) ) - (let ((a1-13 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-13 from) self) - (set! (-> a1-13 num-params) 2) - (set! (-> a1-13 message) 'attack) - (set! (-> a1-13 param 0) (the-as uint #f)) - (let ((v1-50 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-50 shove-up) 10240.0) - (set! (-> v1-50 shove-back) 30720.0) - (set! (-> a1-13 param 1) (the-as uint v1-50)) - ) - (send-event-function *target* a1-13) + 0.0 + ) + (send-event *target* 'attack #f (static-attack-info ((shove-up (meters 2.5)) (shove-back (meters 7.5))))) ) - ) ) ) ) @@ -3932,33 +2441,20 @@ ) (cond ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 1.4)) - (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - ) + (not (ja-group? robotboss-blue-roar-ja)) ) (spawn (-> self particle 1) gp-0) (when (and arg1 (nonzero? (-> self looping-sound 1))) (update! (-> self looping-sound 1)) - (when (and *target* - (zero? (logand (-> *target* state-flags) #x80f8)) - (>= 8192.0 (vector-vector-distance gp-0 (target-pos 0))) - ) - (let ((a1-16 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-16 from) self) - (set! (-> a1-16 num-params) 2) - (set! (-> a1-16 message) 'attack) - (set! (-> a1-16 param 0) (the-as uint #f)) - (let ((v1-80 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-80 shove-up) 10240.0) - (set! (-> v1-80 shove-back) 30720.0) - (set! (-> a1-16 param 1) (the-as uint v1-80)) - ) - (send-event-function *target* a1-16) + (if (and *target* + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + (>= 8192.0 (vector-vector-distance gp-0 (target-pos 0))) + ) + (send-event *target* 'attack #f (static-attack-info ((shove-up (meters 2.5)) (shove-back (meters 7.5))))) ) - ) ) ) ((nonzero? (-> self looping-sound 1)) @@ -3975,7 +2471,7 @@ 0 (let ((gp-0 (-> self entity extra perm))) (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) - (set! (-> gp-0 user-int8 0) (seekl (-> gp-0 user-int8 0) 255 1)) + (seekl! (-> gp-0 user-int8 0) 255 1) (let ((v1-5 (-> gp-0 user-int8 0))) (set! (-> self dda) (cond ((< 15 v1-5) @@ -4063,10 +2559,8 @@ ;; failed to figure out what this is: (defstate robotboss-blue-wait (robotboss) - :event - robotboss-handler - :enter - (behavior () + :event robotboss-handler + :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (robotboss-setup-for-hits 4 5) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -4089,8 +2583,7 @@ (robotboss-yellow-eco-on) (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self shot-attractor)))) (if a0-1 (deactivate a0-1) @@ -4147,8 +2640,7 @@ (robotboss-cut-cam-exit) (none) ) - :trans - (behavior () + :trans (behavior () (robotboss-always-trans robotboss-blue-dark-bomb) (robotboss-shooting-trans 9) (cond @@ -4157,35 +2649,25 @@ (robotboss-blue-done) (set! (-> self took-hit) #f) (+! (-> self hits-to-go) -1) - (ja-channel-push! 1 30) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 33))) - ) - (sound-play-by-name (static-sound-name "explod-eye") (new-sound-id) 1024 0 0 1 #t) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-blue-last-hit-ja) + (sound-play "explod-eye") (set! (-> self blue-smoke) #t) (let ((gp-1 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-1 (-> self node-list data 7)) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-9 (method-of-type part-tracker activate))) - (t9-9 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 644) 300 #f #f #f gp-1) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 644) + 300 + #f + #f + #f + gp-1 + :to *entity-pool* ) ) - (let* ((s5-2 (get-process *default-dead-pool* manipy #x4000)) - (gp-2 - (when s5-2 - (let ((t9-12 (method-of-type manipy activate))) - (t9-12 (the-as manipy s5-2) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 manipy-init (-> self root-override trans) (-> self entity) *robotboss-blueeco-sg* #f) - (-> s5-2 ppointer) - ) - ) - ) + (let ((gp-2 (manipy-spawn (-> self root-override trans) (-> self entity) *robotboss-blueeco-sg* #f :to self))) (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-2) 'anim-mode 'play1) (send-event (ppointer->process gp-2) 'rot-quat (-> self root-override quat)) @@ -4197,32 +2679,16 @@ (play-ambient (-> self ambient) "MAI-AM06" #t (the-as vector #f)) ) (set! (-> self took-hit) #f) - (ja-channel-push! 1 30) - (let ((v1-54 (-> self skel root-channel 0))) - (set! (-> v1-54 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-blue-hit-ja) ) ) - (when (not (or (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 33) - ) - ) - ) + (when (not (or (ja-group? robotboss-blue-roar-ja) (ja-group? robotboss-blue-last-hit-ja))) ) (robotboss-blue-beam 8 #t) (robotboss-blue-beam 9 #f) (when (TODO-RENAME-10 (-> self ambient) (new 'stack-no-clear 'vector) (seconds 10) (the-as float 327680.0) self) - (let* ((v1-73 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-74 (the-as number (logior #x3f800000 v1-73))) - (f0-2 (+ -1.0 (the-as float v1-74))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.8 f0-2) (play-ambient (-> self ambient) "GOL-AM02" #t (the-as vector #f)) @@ -4243,74 +2709,25 @@ ) ) (robotboss-position) - (robotboss-cut-cam (the-as float 5.0) (the-as float 50.0) (the-as int (-> self draw art-group data 5))) + (robotboss-cut-cam (the-as float 5.0) (the-as float 50.0) (the-as int robotboss-blue-roar-ja)) (none) ) - :code - (behavior () - (ja-channel-push! 1 120) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.4)) + (ja-no-eval :group! robotboss-idle-blue-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-32 (-> self skel root-channel 0))) - (set! (-> v1-32 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - ) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-12 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! - a0-12 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (loop + (when (not (ja-group? robotboss-idle-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-blue-ja) ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (when (<= (-> self hits-to-go) 0) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) @@ -4329,51 +2746,19 @@ ) ) ) - (ja-channel-push! 1 30) - (let ((v1-74 (-> self skel root-channel 0))) - (set! (-> v1-74 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-20 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-20 param 1) 1.0) - (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! - a0-20 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! robotboss-blue-roar-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go robotboss-blue-dark-bomb) ) ) (none) ) - :post - (the-as (function none :behavior robotboss) transform-post) + :post (the-as (function none :behavior robotboss) transform-post) ) ;; definition for method 11 of type robotboss @@ -4574,8 +2959,8 @@ (initialize-skeleton obj *robotboss-sg* '()) (aybabtu 2) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 (the-as float 40960.0))) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) - (set! (-> obj root-override nav-flags) (logand -2 (-> obj root-override nav-flags))) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) (set! (-> obj path) (new 'process 'path-control obj 'path (the-as float 0.0))) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (logclear! (-> obj mask) (process-mask actor-pause)) @@ -4606,61 +2991,17 @@ (set! (-> obj particle 4) (create-launch-control (-> *part-group-id-table* 654) obj)) (set! (-> obj particle 5) (create-launch-control (-> *part-group-id-table* 646) obj)) (set! (-> obj particle 6) (create-launch-control (-> *part-group-id-table* 651) obj)) - (set! (-> obj looping-sound 0) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "robo-blue-lp") - :volume #x400 - :fo-max 80 - ) - (-> obj root-override trans) - ) + (set! (-> obj looping-sound 0) + (new 'process 'ambient-sound (static-sound-spec "robo-blue-lp" :fo-max 80) (-> obj root-override trans)) ) - (set! (-> obj looping-sound 1) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "eco-torch") - :volume #x400 - :fo-max 80 - ) - (-> obj root-override trans) - ) + (set! (-> obj looping-sound 1) + (new 'process 'ambient-sound (static-sound-spec "eco-torch" :fo-max 80) (-> obj root-override trans)) ) - (set! (-> obj looping-sound 2) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "red-buzz") - :volume #x400 - :fo-max 80 - ) - (-> obj root-override trans) - ) + (set! (-> obj looping-sound 2) + (new 'process 'ambient-sound (static-sound-spec "red-buzz" :fo-max 80) (-> obj root-override trans)) ) - (set! (-> obj looping-sound 3) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "bfg-buzz") - :volume #x400 - :fo-max 80 - ) - (-> obj root-override trans) - ) + (set! (-> obj looping-sound 3) + (new 'process 'ambient-sound (static-sound-spec "bfg-buzz" :fo-max 80) (-> obj root-override trans)) ) (set! (-> obj blue-smoke) #f) (set! (-> obj red-smoke) #f) diff --git a/test/decompiler/reference/levels/finalboss/sage-finalboss-part_REF.gc b/test/decompiler/reference/levels/finalboss/sage-finalboss-part_REF.gc index 876252cc4c..d7349af379 100644 --- a/test/decompiler/reference/levels/finalboss/sage-finalboss-part_REF.gc +++ b/test/decompiler/reference/levels/finalboss/sage-finalboss-part_REF.gc @@ -6,8 +6,7 @@ :id 682 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2825 :period 300 :length 5 :binding 2823) + :parts ((sp-item 2825 :period 300 :length 5 :binding 2823) (sp-item 2823 :flags (start-dead launch-asap) :binding 2824) (sp-item 2823 :flags (start-dead launch-asap) :binding 2824) (sp-item 2824 :flags (start-dead)) @@ -20,8 +19,7 @@ ;; failed to figure out what this is: (defpart 2825 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2.5) (meters 5) 1.0) (sp-rnd-flt spt-y (meters -1.5) (meters 3) 1.0) @@ -38,8 +36,7 @@ ;; failed to figure out what this is: (defpart 2823 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -63,8 +60,7 @@ ;; failed to figure out what this is: (defpart 2824 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -84,8 +80,7 @@ ;; failed to figure out what this is: (defpart 2827 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters -3.90625)) (sp-flt spt-scale-x (meters 15)) @@ -101,8 +96,7 @@ ;; failed to figure out what this is: (defpart 2826 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.3) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters -3) (meters 6) 1.0) @@ -127,8 +121,7 @@ ;; failed to figure out what this is: (defpart 2828 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 300 299 1) (sp-launcher-by-id spt-next-launcher 2829) ) @@ -136,8 +129,7 @@ ;; failed to figure out what this is: (defpart 2829 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: @@ -146,8 +138,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2921) + :parts ((sp-item 2921) (sp-item 2922 :flags (is-3d)) (sp-item 2923 :flags (is-3d)) (sp-item 2924 :flags (is-3d)) @@ -158,8 +149,7 @@ ;; failed to figure out what this is: (defpart 2921 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-flt spt-x (meters 2.5)) (sp-flt spt-y (meters -0.5)) (sp-int spt-rot-x 8) @@ -177,14 +167,12 @@ ;; failed to figure out what this is: (defpart 2927 - :init-specs - ((sp-flt spt-fade-b -4.551111)) + :init-specs ((sp-flt spt-fade-b -4.551111)) ) ;; failed to figure out what this is: (defpart 2924 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 2) 1.0) (sp-flt spt-y (meters 0.1)) @@ -205,8 +193,7 @@ ;; failed to figure out what this is: (defpart 2922 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 2) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -228,8 +215,7 @@ ;; failed to figure out what this is: (defpart 2923 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-x (meters 1.8) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) @@ -250,8 +236,7 @@ ;; failed to figure out what this is: (defpart 2925 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 3.0 1.0) (sp-rnd-flt spt-x (meters 0) (meters 5.5) 1.0) (sp-flt spt-y (meters -0.5)) @@ -276,8 +261,7 @@ ;; failed to figure out what this is: (defpart 2926 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 3.0 1.0) (sp-rnd-flt spt-x (meters 0) (meters 5) 1.0) (sp-flt spt-y (meters -0.5)) @@ -304,8 +288,7 @@ ;; failed to figure out what this is: (defpart 2928 - :init-specs - ((sp-flt spt-fade-a -0.18)) + :init-specs ((sp-flt spt-fade-a -0.18)) ) ;; failed to figure out what this is: @@ -314,14 +297,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2929) (sp-item 2930)) + :parts ((sp-item 2929) (sp-item 2930)) ) ;; failed to figure out what this is: (defpart 2930 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.2 1.0) (sp-rnd-flt spt-x (meters -0.001) (meters 0.002) 1.0) (sp-rnd-flt spt-y (meters -0.001) (meters 0.002) 1.0) @@ -348,14 +329,12 @@ ;; failed to figure out what this is: (defpart 2931 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) ;; failed to figure out what this is: (defpart 2929 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 8.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -381,8 +360,7 @@ ;; failed to figure out what this is: (defpart 2932 - :init-specs - ((sp-flt spt-userdata 2048000.0)) + :init-specs ((sp-flt spt-userdata 2048000.0)) ) ;; definition for function check-drop-level-eichar-lighteco-pops @@ -414,8 +392,7 @@ ;; failed to figure out what this is: (defpart 2934 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -432,8 +409,7 @@ ;; failed to figure out what this is: (defpart 2933 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 4.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -457,14 +433,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2892)) + :parts ((sp-item 2892)) ) ;; failed to figure out what this is: (defpart 2892 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 4.0 3.0 1.0) (sp-rnd-flt spt-x (meters -0.2) (meters -0.1) 1.0) (sp-rnd-flt spt-z (meters 0.2) (meters 0.1) 1.0) @@ -492,14 +466,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2893) (sp-item 2935)) + :parts ((sp-item 2893) (sp-item 2935)) ) ;; failed to figure out what this is: (defpart 2935 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters -0.2) (meters -0.1) 1.0) (sp-rnd-flt spt-z (meters 0.2) (meters 0.1) 1.0) @@ -519,8 +491,7 @@ ;; failed to figure out what this is: (defpart 2893 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.2) (meters -0.1) 1.0) (sp-rnd-flt spt-z (meters 0.2) (meters 0.1) 1.0) @@ -546,8 +517,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2936 :period 36 :length 5) + :parts ((sp-item 2936 :period 36 :length 5) (sp-item 2936 :period 140 :length 5) (sp-item 2936 :period 61 :length 5) (sp-item 2894 :period 15 :length 5) @@ -557,8 +527,7 @@ ;; failed to figure out what this is: (defpart 2937 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 4) (meters 16) 1.0) @@ -575,8 +544,7 @@ ;; failed to figure out what this is: (defpart 2894 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -603,8 +571,7 @@ ;; failed to figure out what this is: (defpart 2936 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-int spt-num 0 1 8.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1) 1.0) @@ -637,8 +604,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2939 :period 1200 :length 20 :binding 2938) + :parts ((sp-item 2939 :period 1200 :length 20 :binding 2938) (sp-item 2940 :period 1200 :length 5) (sp-item 2941 :period 1200 :length 40) (sp-item 2942 :period 1200 :length 20) @@ -666,8 +632,7 @@ ;; failed to figure out what this is: (defpart 2939 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) @@ -693,8 +658,7 @@ ;; failed to figure out what this is: (defpart 2938 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 4) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -716,14 +680,12 @@ ;; failed to figure out what this is: (defpart 2946 - :init-specs - ((sp-flt spt-fade-g -0.14222223) (sp-flt spt-fade-b -0.14222223)) + :init-specs ((sp-flt spt-fade-g -0.14222223) (sp-flt spt-fade-b -0.14222223)) ) ;; failed to figure out what this is: (defpart 2945 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 10)) (sp-rnd-flt spt-scale-x (meters 8) (meters 60) 1.0) @@ -745,14 +707,12 @@ ;; failed to figure out what this is: (defpart 2947 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: (defpart 2941 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 128.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 4) (meters 1) 1.0) @@ -776,14 +736,12 @@ ;; failed to figure out what this is: (defpart 2948 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2944 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) @@ -802,8 +760,7 @@ ;; failed to figure out what this is: (defpart 2940 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 256)) @@ -820,8 +777,7 @@ ;; failed to figure out what this is: (defpart 2942 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters -8) (meters 16) 1.0) (sp-rnd-flt spt-scale-x (meters 20) (meters 40) 1.0) @@ -848,8 +804,7 @@ ;; failed to figure out what this is: (defpart 2943 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 20.0) (sp-rnd-flt spt-y (meters -8) (meters 16) 1.0) (sp-rnd-flt spt-scale-x (meters 40) (meters 40) 1.0) @@ -880,14 +835,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2949) (sp-item 2950)) + :parts ((sp-item 2949) (sp-item 2950)) ) ;; failed to figure out what this is: (defpart 2950 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 128.0) (sp-rnd-flt spt-x (meters 0) (meters 5) 1.0) (sp-flt spt-y (meters -8)) @@ -915,14 +868,12 @@ ;; failed to figure out what this is: (defpart 2951 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: (defpart 2949 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-x (meters 0) (meters 10) 1.0) (sp-flt spt-y (meters -10)) @@ -949,8 +900,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2952 :flags (is-3d)) + :parts ((sp-item 2952 :flags (is-3d)) (sp-item 2953 :flags (is-3d)) (sp-item 2954 :flags (is-3d)) (sp-item 2955) @@ -962,8 +912,7 @@ ;; failed to figure out what this is: (defpart 2952 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.1) (sp-flt spt-y (meters 10)) (sp-flt spt-z (meters 4)) @@ -986,14 +935,12 @@ ;; failed to figure out what this is: (defpart 2959 - :init-specs - ((sp-flt spt-fade-a -0.16)) + :init-specs ((sp-flt spt-fade-a -0.16)) ) ;; failed to figure out what this is: (defpart 2953 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.1) (sp-flt spt-y (meters 10)) (sp-flt spt-z (meters 4)) @@ -1016,8 +963,7 @@ ;; failed to figure out what this is: (defpart 2954 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.1) (sp-flt spt-y (meters 0.5)) (sp-flt spt-z (meters 4)) @@ -1041,8 +987,7 @@ ;; failed to figure out what this is: (defpart 2955 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-flt spt-y (meters 10)) (sp-flt spt-z (meters 8)) @@ -1067,8 +1012,7 @@ ;; failed to figure out what this is: (defpart 2956 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 10)) (sp-flt spt-z (meters 8)) @@ -1093,8 +1037,7 @@ ;; failed to figure out what this is: (defpart 2957 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters 10) (meters 40) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 20) 1.0) @@ -1116,14 +1059,12 @@ ;; failed to figure out what this is: (defpart 2960 - :init-specs - ((sp-flt spt-fade-a -0.85333335)) + :init-specs ((sp-flt spt-fade-a -0.85333335)) ) ;; failed to figure out what this is: (defpart 2958 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 10) (meters 30) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 20) 1.0) @@ -1147,8 +1088,7 @@ ;; failed to figure out what this is: (defpart 2961 - :init-specs - ((sp-flt spt-userdata 4096000.0)) + :init-specs ((sp-flt spt-userdata 4096000.0)) ) ;; definition for function check-drop-level-bigdoor-open-pops @@ -1180,8 +1120,7 @@ ;; failed to figure out what this is: (defpart 2963 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1198,8 +1137,7 @@ ;; failed to figure out what this is: (defpart 2962 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 4.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1222,14 +1160,12 @@ :id 706 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2965)) + :parts ((sp-item 2965)) ) ;; failed to figure out what this is: (defpart 2965 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters -3.90625)) (sp-flt spt-scale-x (meters 15)) diff --git a/test/decompiler/reference/levels/finalboss/sage-finalboss_REF.gc b/test/decompiler/reference/levels/finalboss/sage-finalboss_REF.gc index c9a7f16286..01a9c0ae7b 100644 --- a/test/decompiler/reference/levels/finalboss/sage-finalboss_REF.gc +++ b/test/decompiler/reference/levels/finalboss/sage-finalboss_REF.gc @@ -1,41 +1,40 @@ ;;-*-Lisp-*- (in-package goal) -;; failed to figure out what this is: -(defskelgroup *robotboss-cinematic-sg* robotboss-cinematic - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -10 0 2000) - :longest-edge (meters 0) - ) +(import "goal_src/import/plat-eco-finalboss-ag.gc") +(import "goal_src/import/green-sagecage-ag.gc") +(import "goal_src/import/jak-white-ag.gc") +(import "goal_src/import/robotboss-cinematic-ag.gc") ;; failed to figure out what this is: -(defskelgroup *jak-white-sg* jak-white - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *robotboss-cinematic-sg* robotboss-cinematic robotboss-cinematic-lod0-jg robotboss-cinematic-idle-ja + ((robotboss-cinematic-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10 0 2000) + ) ;; failed to figure out what this is: -(defskelgroup *plat-eco-finalboss-unlit-sg* plat-eco-finalboss - 0 - 8 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *jak-white-sg* jak-white jak-white-lod0-jg jak-white-idle-ja + ((jak-white-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; failed to figure out what this is: -(defskelgroup *plat-eco-finalboss-lit-sg* plat-eco-finalboss - 4 - 8 - ((5 (meters 20)) (6 (meters 40)) (7 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *plat-eco-finalboss-unlit-sg* plat-eco-finalboss plat-eco-finalboss-lod0-jg plat-eco-finalboss-idle-ja + ((plat-eco-finalboss-lod0-mg (meters 20)) + (plat-eco-finalboss-lod1-mg (meters 40)) + (plat-eco-finalboss-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 3) + ) + +;; failed to figure out what this is: +(defskelgroup *plat-eco-finalboss-lit-sg* plat-eco-finalboss plat-eco-finalboss-lit-lod0-jg plat-eco-finalboss-idle-ja + ((plat-eco-finalboss-lit-lod0-mg (meters 20)) + (plat-eco-finalboss-lit-lod1-mg (meters 40)) + (plat-eco-finalboss-lit-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 3) + ) ;; definition of type plat-eco-finalboss (deftype plat-eco-finalboss (plat-eco) @@ -89,8 +88,7 @@ ;; failed to figure out what this is: (defstate plat-path-active (plat-eco-finalboss) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('target) (process-entity-status! self (entity-perm-status complete) #t) @@ -123,8 +121,7 @@ ) ) ) - :enter - (behavior ((arg0 plat)) + :enter (behavior ((arg0 plat)) (set! (-> self state-time) (-> *display* base-frame-counter)) (lods-assign! (-> self draw) (-> self lit-look)) (process-entity-status! self (entity-perm-status complete) #t) @@ -139,8 +136,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((s5-0 (eval-path-curve! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp)) (gp-0 (eval-path-curve! (-> self path) (new 'stack-no-clear 'vector) 1.0 'interp)) ) @@ -167,32 +163,15 @@ (if (= (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self path-pos) (-> self dest)) ) - (set! (-> self path-pos) - (seek (-> self path-pos) (-> self dest) (* (-> self speed) (-> *display* seconds-per-frame))) - ) + (seek! (-> self path-pos) (-> self dest) (* (-> self speed) (-> *display* seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) self) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'query) - (set! (-> a1-8 param 0) (the-as uint 'powerup)) - (set! (-> a1-8 param 1) (the-as uint 1)) - (when (send-event-function *target* a1-8) - (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> self force-dest) 0.0) - ) + (when (send-event *target* 'query 'powerup (pickup-type eco-yellow)) + (process-entity-status! self (entity-perm-status complete) #t) + (set! (-> self force-dest) 0.0) ) (none) ) @@ -302,32 +281,20 @@ ) ;; failed to figure out what this is: -(defskelgroup *sage-finalboss-sg* green-sagecage - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 3 - ) +(defskelgroup *sage-finalboss-sg* green-sagecage green-sagecage-lod0-jg green-sagecage-green-sagecage-idle-ja + ((green-sagecage-lod0-mg (meters 20)) (green-sagecage-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow green-sagecage-shadow-mg + ) ;; definition for method 44 of type sage-finalboss ;; INFO: Return type mismatch object vs symbol. (defmethod play-reminder sage-finalboss ((obj sage-finalboss)) (let ((s5-0 (entity-by-name "red-sagecage-1"))) (when s5-0 - (let ((s4-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj redsage) - (ppointer->handle (when s4-0 - (let ((t9-2 (method-of-type manipy activate))) - (t9-2 (the-as manipy s4-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 manipy-init (-> obj root-override trans) s5-0 *redsage-sg* #f) - (-> s4-0 ppointer) - ) - ) - ) - ) + (set! (-> obj redsage) + (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-0 *redsage-sg* #f :to obj)) + ) (send-event (handle->process (-> obj redsage)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj redsage)) 'blend-shape #t) (send-event (handle->process (-> obj redsage)) 'center-joint 3) @@ -336,18 +303,9 @@ ) (let ((s5-1 (entity-by-name "blue-sagecage-1"))) (when s5-1 - (let ((s4-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj bluesage) - (ppointer->handle (when s4-1 - (let ((t9-10 (method-of-type manipy activate))) - (t9-10 (the-as manipy s4-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 manipy-init (-> obj root-override trans) s5-1 *bluesage-sg* #f) - (-> s4-1 ppointer) - ) - ) - ) - ) + (set! (-> obj bluesage) + (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-1 *bluesage-sg* #f :to obj)) + ) (send-event (handle->process (-> obj bluesage)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj bluesage)) 'blend-shape #t) (send-event (handle->process (-> obj bluesage)) 'center-joint 3) @@ -358,19 +316,9 @@ (the-as symbol (when s5-2 - (let ((s4-2 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj yellowsage) - (ppointer->handle - (when s4-2 - (let ((t9-18 (method-of-type manipy activate))) - (t9-18 (the-as manipy s4-2) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s4-2 manipy-init (-> obj root-override trans) s5-2 *yellowsage-sg* #f) - (-> s4-2 ppointer) - ) - ) - ) - ) + (set! (-> obj yellowsage) + (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-2 *yellowsage-sg* #f :to obj)) + ) (send-event (handle->process (-> obj yellowsage)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj yellowsage)) 'blend-shape #t) (send-event (handle->process (-> obj yellowsage)) 'center-joint 3) @@ -387,19 +335,9 @@ (the-as symbol (when s5-0 - (let ((s4-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj assistant) - (ppointer->handle - (when s4-0 - (let ((t9-2 (method-of-type manipy activate))) - (t9-2 (the-as manipy s4-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 manipy-init (-> obj root-override trans) s5-0 *assistant-lavatube-end-sg* #f) - (-> s4-0 ppointer) - ) - ) - ) - ) + (set! (-> obj assistant) + (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-0 *assistant-lavatube-end-sg* #f :to obj)) + ) (let ((s5-1 (handle->process (-> obj assistant)))) (if (the-as manipy s5-1) (set! (-> (the-as manipy s5-1) draw level-index) (the-as uint (-> (level-get *level* 'finalboss) index))) @@ -417,294 +355,241 @@ ;; definition for method 32 of type sage-finalboss ;; Used lq/sq (defmethod play-anim! sage-finalboss ((obj sage-finalboss) (arg0 symbol)) - (with-pp - (case (current-status (-> obj tasks)) - (((task-status unknown)) - (when arg0 - (close-current! (-> obj tasks)) - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) - ) - (new 'static 'spool-anim - :name "green-sagecage-daxter-sacrifice" - :index 8 - :parts 6 - :command-list - '((1 blackout 0) (236 joint "cameraB") (439 joint "camera")) - ) + (case (current-status (-> obj tasks)) + (((task-status unknown)) + (when arg0 + (close-current! (-> obj tasks)) + (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) ) - (((task-status need-introduction)) - (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) - (close-current! (-> obj tasks)) - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj jak-white) - (ppointer->handle - (when s5-1 - (let ((t9-6 (method-of-type manipy activate))) - (t9-6 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *jak-white-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) - (send-event - (handle->process (-> obj jak-white)) - 'eval - (lambda :behavior sage-finalboss () (set-vector! (-> self draw color-emissive) 0.5 0.5 0.5 0.0) (none)) - ) - (send-event (handle->process (-> obj jak-white)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj jak-white)) 'origin-joint-index 3) - (send-event (handle->process (-> obj jak-white)) 'blend-shape #t) - (let ((s5-2 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj robotboss) - (ppointer->handle - (when s5-2 - (let ((t9-13 (method-of-type manipy activate))) - (t9-13 (the-as manipy s5-2) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 manipy-init (-> obj root-override trans) (-> obj entity) *robotboss-cinematic-sg* #f) - (-> s5-2 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj robotboss)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj robotboss)) 'origin-joint-index 3) - (let ((v1-67 (handle->process (-> obj robotboss)))) - (if (the-as manipy v1-67) - (set! (-> (the-as manipy v1-67) draw bounds w) 2048000.0) - ) - ) - (let ((s5-3 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj silodoor) - (ppointer->handle - (when s5-3 - (let ((t9-18 (method-of-type manipy activate))) - (t9-18 (the-as manipy s5-3) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-3 manipy-init (-> obj root-override trans) (-> obj entity) *silodoor-sg* #f) - (-> s5-3 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj silodoor)) 'anim-mode 'clone-anim) - (let ((v1-84 (handle->process (-> obj silodoor)))) - (if (the-as manipy v1-84) - (set! (-> (the-as silodoor v1-84) draw bounds w) 2048000.0) - ) - ) - (send-event (process-by-name "silodoor-5" *active-pool*) 'hide) - (set-setting! *setting-control* pp 'music #f 0.0 0) - (set-setting! *setting-control* pp 'allow-progress #f 0.0 0) - ) - (new 'static 'spool-anim - :name "green-sagecage-outro-beat-boss-a" - :index 9 - :parts 8 - :command-list - '((0 send-event self activate-particle 0) - (0 send-event self activate-particle 1) - (0 send-event self activate-particle 7) - (1 blackout 0) - (61 joint "cameraB") - (71 send-event self activate-particle 2) - (156 joint "camera") - (216 joint "cameraB") - (259 send-event self deactivate-particle 2) - (259 send-event self activate-particle 3) - (268 send-event self activate-particle 4) - (270 send-event self deactivate-particle 3) - (270 send-event self deactivate-particle 0) - (270 send-event self deactivate-particle 1) - (271 joint "camera") - (269 send-event self activate-particle 5) - (272 send-event self flash) - (272 eval (lambda :behavior sage-finalboss - () - (let ((a0-1 (get-task-control (game-task finalboss-movies)))) - (save-reminder a0-1 (logior (get-reminder a0-1 0) 1) 0) - ) - (none) - ) - ) - (273 send-event self deactivate-particle 5) - (333 joint "cameraB") - (395 joint "camera") - (453 joint "cameraB") - (478 send-event self deactivate-particle 4) - (478 send-event self activate-particle 6) - (482 send-event self deactivate-particle 6) - (583 joint "camera") - (640 send-event self deactivate-particle 7) - ) - ) + (new 'static 'spool-anim + :name "green-sagecage-daxter-sacrifice" + :index 8 + :parts 6 + :command-list '((1 blackout 0) (236 joint "cameraB") (439 joint "camera")) ) - (((task-status need-reminder-a)) - (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) - (close-current! (-> obj tasks)) - (play-reminder obj) - (dummy-45 obj) - (set! (-> obj kick-the-credits) #t) - (let ((s5-5 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj robotplat) - (ppointer->handle - (when s5-5 - (let ((t9-30 (method-of-type manipy activate))) - (t9-30 (the-as manipy s5-5) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-5 - manipy-init - (-> obj root-override trans) - (-> obj entity) - *plat-eco-finalboss-lit-sg* - #f - ) - (-> s5-5 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj robotplat)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj robotplat)) 'origin-joint-index 3) - (set! (-> obj old-target-pos trans quad) - (-> (new 'static 'vector :x 11368946.0 :y 2215900.2 :z -19405602.0 :w 1.0) quad) + ) + (((task-status need-introduction)) + (when arg0 + (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) + (close-current! (-> obj tasks)) + (set! (-> obj jak-white) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *jak-white-sg* #f :to obj)) + ) + (send-event + (handle->process (-> obj jak-white)) + 'eval + (lambda :behavior sage-finalboss () (set-vector! (-> self draw color-emissive) 0.5 0.5 0.5 0.0) (none)) + ) + (send-event (handle->process (-> obj jak-white)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj jak-white)) 'origin-joint-index 3) + (send-event (handle->process (-> obj jak-white)) 'blend-shape #t) + (set! (-> obj robotboss) + (ppointer->handle + (manipy-spawn (-> obj root-override trans) (-> obj entity) *robotboss-cinematic-sg* #f :to obj) ) - (quaternion-copy! (-> obj old-target-pos quat) (new 'static 'quaternion :y -0.8472 :w 0.5312)) - (set-setting! *setting-control* pp 'music #f 0.0 0) - (set-setting! *setting-control* pp 'sfx-volume 'abs 0.0 0) - (set-setting! *setting-control* pp 'ambient-volume 'abs 0.0 0) - (set-setting! *setting-control* pp 'allow-progress #f 0.0 0) + ) + (send-event (handle->process (-> obj robotboss)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj robotboss)) 'origin-joint-index 3) + (let ((v1-67 (handle->process (-> obj robotboss)))) + (if (the-as manipy v1-67) + (set! (-> (the-as manipy v1-67) draw bounds w) 2048000.0) + ) ) - (new 'static 'spool-anim - :name "green-sagecage-outro-beat-boss-b" - :index 10 - :parts 27 - :command-list - '((0 kill "crate-3250") - (0 kill "crate-3251") - (0 kill "crate-3252") - (0 kill "crate-3253") - (0 kill "crate-3254") - (0 kill "crate-3255") - (0 kill "crate-3256") - (0 kill "crate-3257") - (0 kill "crate-3258") - (0 kill "crate-3259") - (0 kill "plat-eco-finalboss-1") - (1 blackout 0) - (61 joint "cameraB") - (136 joint "camera") - (510 joint "cameraB") - (641 joint "camera") - (751 joint "cameraB") - (1096 joint "camera") - (1321 joint "cameraB") - (1521 joint "camera") - (1636 joint "cameraB") - (1751 joint "camera") - (1916 joint "cameraB") - (1996 joint "camera") - (2256 joint "cameraB") - ) + (set! (-> obj silodoor) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *silodoor-sg* #f :to obj)) + ) + (send-event (handle->process (-> obj silodoor)) 'anim-mode 'clone-anim) + (let ((v1-84 (handle->process (-> obj silodoor)))) + (if (the-as manipy v1-84) + (set! (-> (the-as silodoor v1-84) draw bounds w) 2048000.0) + ) ) + (send-event (process-by-name "silodoor-5" *active-pool*) 'hide) + (set-setting! 'music #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) ) - (((task-status need-reminder)) - (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) -13116.667) - (close-current! (-> obj tasks)) - (dummy-45 obj) - (send-event *camera* 'teleport) - (set-setting! *setting-control* pp 'allow-progress #f 0.0 0) - ) - (cond - ((target-has-all-the-cells?) - (new 'static 'spool-anim - :name - "green-sagecage-outro-beat-boss-enough-cells" - :index 12 - :parts 6 - :command-list - '((0 send-event self fade) - (1 blackout 0) - (65 joint "cameraB") - (104 joint "camera") - (134 joint "cameraB") - (165 joint "camera") - (292 joint "cameraB") - (488 joint "camera") - (488 auto-save auto-save) + (new 'static 'spool-anim + :name "green-sagecage-outro-beat-boss-a" + :index 9 + :parts 8 + :command-list '((0 send-event self activate-particle 0) + (0 send-event self activate-particle 1) + (0 send-event self activate-particle 7) + (1 blackout 0) + (61 joint "cameraB") + (71 send-event self activate-particle 2) + (156 joint "camera") + (216 joint "cameraB") + (259 send-event self deactivate-particle 2) + (259 send-event self activate-particle 3) + (268 send-event self activate-particle 4) + (270 send-event self deactivate-particle 3) + (270 send-event self deactivate-particle 0) + (270 send-event self deactivate-particle 1) + (271 joint "camera") + (269 send-event self activate-particle 5) + (272 send-event self flash) + (272 eval (lambda :behavior sage-finalboss + () + (let ((a0-1 (get-task-control (game-task finalboss-movies)))) + (save-reminder a0-1 (logior (get-reminder a0-1 0) 1) 0) + ) + (none) + ) ) + (273 send-event self deactivate-particle 5) + (333 joint "cameraB") + (395 joint "camera") + (453 joint "cameraB") + (478 send-event self deactivate-particle 4) + (478 send-event self activate-particle 6) + (482 send-event self deactivate-particle 6) + (583 joint "camera") + (640 send-event self deactivate-particle 7) + ) + ) + ) + (((task-status need-reminder-a)) + (when arg0 + (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) + (close-current! (-> obj tasks)) + (play-reminder obj) + (dummy-45 obj) + (set! (-> obj kick-the-credits) #t) + (set! (-> obj robotplat) + (ppointer->handle + (manipy-spawn (-> obj root-override trans) (-> obj entity) *plat-eco-finalboss-lit-sg* #f :to obj) + ) + ) + (send-event (handle->process (-> obj robotplat)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj robotplat)) 'origin-joint-index 3) + (set! (-> obj old-target-pos trans quad) + (-> (new 'static 'vector :x 11368946.0 :y 2215900.2 :z -19405602.0 :w 1.0) quad) + ) + (quaternion-copy! (-> obj old-target-pos quat) (new 'static 'quaternion :y -0.8472 :w 0.5312)) + (set-setting! 'music #f 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + ) + (new 'static 'spool-anim + :name "green-sagecage-outro-beat-boss-b" + :index 10 + :parts 27 + :command-list '((0 kill "crate-3250") + (0 kill "crate-3251") + (0 kill "crate-3252") + (0 kill "crate-3253") + (0 kill "crate-3254") + (0 kill "crate-3255") + (0 kill "crate-3256") + (0 kill "crate-3257") + (0 kill "crate-3258") + (0 kill "crate-3259") + (0 kill "plat-eco-finalboss-1") + (1 blackout 0) + (61 joint "cameraB") + (136 joint "camera") + (510 joint "cameraB") + (641 joint "camera") + (751 joint "cameraB") + (1096 joint "camera") + (1321 joint "cameraB") + (1521 joint "camera") + (1636 joint "cameraB") + (1751 joint "camera") + (1916 joint "cameraB") + (1996 joint "camera") + (2256 joint "cameraB") + ) + ) + ) + (((task-status need-reminder)) + (when arg0 + (set-yaw-angle-clear-roll-pitch! (-> obj root-override) -13116.667) + (close-current! (-> obj tasks)) + (dummy-45 obj) + (send-event *camera* 'teleport) + (set-setting! 'allow-progress #f 0.0 0) + ) + (cond + ((target-has-all-the-cells?) + (new 'static 'spool-anim + :name "green-sagecage-outro-beat-boss-enough-cells" + :index 12 + :parts 6 + :command-list '((0 send-event self fade) + (1 blackout 0) + (65 joint "cameraB") + (104 joint "camera") + (134 joint "cameraB") + (165 joint "camera") + (292 joint "cameraB") + (488 joint "camera") + (488 auto-save auto-save) ) ) - (else - (if arg0 - (set-setting! *setting-control* pp 'allow-progress #f 0.0 0) - ) - (new 'static 'spool-anim - :name - "green-sagecage-outro-beat-boss-need-cells" - :index 11 - :parts 8 - :command-list - '((0 send-event self fade) - (1 blackout 0) - (65 joint "cameraB") - (104 joint "camera") - (134 joint "cameraB") - (165 joint "camera") - (292 joint "cameraB") - (488 joint "camera") - (488 auto-save auto-save) - ) + ) + (else + (if arg0 + (set-setting! 'allow-progress #f 0.0 0) + ) + (new 'static 'spool-anim + :name "green-sagecage-outro-beat-boss-need-cells" + :index 11 + :parts 8 + :command-list '((0 send-event self fade) + (1 blackout 0) + (65 joint "cameraB") + (104 joint "camera") + (134 joint "cameraB") + (165 joint "camera") + (292 joint "cameraB") + (488 joint "camera") + (488 auto-save auto-save) ) ) ) ) - (((task-status need-reward-speech)) - (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) -13116.667) - (close-current! (-> obj tasks)) - (dummy-45 obj) - (set! (-> obj left-door) (the-as entity-actor (entity-by-name "power-left-2"))) - (set! (-> obj right-door) (the-as entity-actor (entity-by-name "power-right-2"))) - (set-setting! *setting-control* pp 'allow-progress #f 0.0 0) - ) - (new 'static 'spool-anim - :name "green-sagecage-outro-big-finish" - :index 13 - :parts 7 - :command-list - '((1 blackout 0) - (61 joint "cameraB") - (102 joint "camera") - (145 joint "cameraB") - (220 send-event "power-left-2" open) - (220 send-event "power-right-2" open) - (235 joint "camera") - (243 send-event self activate-particle 8) - (322 joint "cameraB") - (428 joint "camera") - (519 joint "cameraB") - (602 joint "camera") - ) + ) + (((task-status need-reward-speech)) + (when arg0 + (set-yaw-angle-clear-roll-pitch! (-> obj root-override) -13116.667) + (close-current! (-> obj tasks)) + (dummy-45 obj) + (set! (-> obj left-door) (the-as entity-actor (entity-by-name "power-left-2"))) + (set! (-> obj right-door) (the-as entity-actor (entity-by-name "power-right-2"))) + (set-setting! 'allow-progress #f 0.0 0) + ) + (new 'static 'spool-anim + :name "green-sagecage-outro-big-finish" + :index 13 + :parts 7 + :command-list '((1 blackout 0) + (61 joint "cameraB") + (102 joint "camera") + (145 joint "cameraB") + (220 send-event "power-left-2" open) + (220 send-event "power-right-2" open) + (235 joint "camera") + (243 send-event self activate-particle 8) + (322 joint "cameraB") + (428 joint "camera") + (519 joint "cameraB") + (602 joint "camera") ) ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) ) - (-> obj draw art-group data 4) - ) + ) + (-> obj draw art-group data 4) ) ) ) @@ -747,8 +632,7 @@ ;; failed to figure out what this is: (defstate play-anim (sage-finalboss) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('fade) (let ((f0-0 1.0)) @@ -774,14 +658,12 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self credit-fade) 0.0) ((-> (method-of-type process-taskable play-anim) enter)) (none) ) - :exit - (behavior () + :exit (behavior () (when (= (current-status (-> self tasks)) (task-status invalid)) (cond ((not (-> self credits-played)) @@ -892,8 +774,7 @@ ((-> (method-of-type process-taskable play-anim) exit)) (none) ) - :trans - (behavior () + :trans (behavior () (local-vars (f28-0 float)) (when (-> self left-door) (let ((f30-0 (ja-aframe-num 0))) @@ -1068,32 +949,30 @@ ;; failed to figure out what this is: (defstate sage-finalboss-credits (sage-finalboss) - :exit - (behavior () + :exit (behavior () (when (= (current-status (-> self tasks)) (task-status invalid)) (set-blackout-frames 0) (initialize! *game-info* 'game (the-as game-save #f) "title-start") ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (s5-0 symbol)) (set! (-> self credits-played) #t) (set-blackout-frames 0) (set-blackout-frames (seconds 0.05)) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) - (clear-pending-settings-from-process *setting-control* self 'ambient-volume) - (set-setting! *setting-control* self 'allow-pause #f 0.0 0) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) - (set-setting! *setting-control* self 'music 'ogreboss 0.0 0) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'music 'ogreboss 0.0 0) (set! (-> self state-time) (-> *display* game-frame-counter)) (logior! (-> self draw status) (draw-status hidden)) (let ((gp-0 (-> self mask))) (load-state-want-display-level 'finalboss 'special) (logclear! (-> self mask) (process-mask pause progress)) - (push-setting! *setting-control* self 'process-mask 'set 0.0 8212) - (copy-settings-from-target! *setting-control*) + (add-setting! 'process-mask 'set 0.0 (process-mask pause progress target)) + (apply-settings *setting-control*) (let ((f30-0 0.0) (f28-0 0.5) ) @@ -1123,11 +1002,11 @@ (set! (-> self mask) gp-0) ) (load-state-want-display-level 'finalboss 'display) - (clear-pending-settings-from-process *setting-control* self 'allow-pause) - (clear-pending-settings-from-process *setting-control* self 'allow-progress) - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (clear-pending-settings-from-process *setting-control* self 'music) - (copy-settings-from-target! *setting-control*) + (remove-setting! 'allow-pause) + (remove-setting! 'allow-progress) + (remove-setting! 'process-mask) + (remove-setting! 'music) + (apply-settings *setting-control*) (set-blackout-frames (seconds 0.05)) (let ((gp-1 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 0.05)) @@ -1182,15 +1061,13 @@ ;; failed to figure out what this is: (defstate hidden (sage-finalboss) :virtual #t - :enter - (behavior () + :enter (behavior () (sage-finalboss-extra-enter) ((-> (method-of-type process-taskable hidden) enter)) - (clear-pending-settings-from-process *setting-control* self 'allow-progress) + (remove-setting! 'allow-progress) (none) ) - :trans - (behavior () + :trans (behavior () (sage-finalboss-extra-trans) ((-> (method-of-type process-taskable hidden) trans)) (none) @@ -1200,14 +1077,12 @@ ;; failed to figure out what this is: (defstate idle (sage-finalboss) :virtual #t - :enter - (behavior () + :enter (behavior () (sage-finalboss-extra-enter) ((-> (method-of-type process-taskable idle) enter)) (none) ) - :trans - (behavior () + :trans (behavior () (sage-finalboss-extra-trans) ((-> (method-of-type process-taskable idle) trans)) (none) diff --git a/test/decompiler/reference/levels/firecanyon/assistant-firecanyon_REF.gc b/test/decompiler/reference/levels/firecanyon/assistant-firecanyon_REF.gc index ecbedaa3be..9553cc3346 100644 --- a/test/decompiler/reference/levels/firecanyon/assistant-firecanyon_REF.gc +++ b/test/decompiler/reference/levels/firecanyon/assistant-firecanyon_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/assistant-firecanyon-ag.gc") + ;; definition of type assistant-firecanyon (deftype assistant-firecanyon (process-taskable) () @@ -19,14 +21,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *assistant-firecanyon-sg* assistant-firecanyon - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *assistant-firecanyon-sg* assistant-firecanyon assistant-firecanyon-lod0-jg assistant-firecanyon-idle-twist-ja + ((assistant-firecanyon-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow assistant-firecanyon-shadow-mg + ) ;; definition for method 32 of type assistant-firecanyon (defmethod play-anim! assistant-firecanyon ((obj assistant-firecanyon) (arg0 symbol)) @@ -39,8 +38,7 @@ :name "assistant-firecanyon-resolution" :index 13 :parts 11 - :command-list - '((0 want-levels village1 firecanyon) + :command-list '((0 want-levels village1 firecanyon) (151 joint "cameraB") (346 joint "camera") (346 shadow self #f) @@ -81,8 +79,7 @@ ;; failed to figure out what this is: (defstate hidden (assistant-firecanyon) :virtual #t - :trans - (behavior () + :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) (when (and (cond ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) @@ -139,382 +136,117 @@ ;; failed to figure out what this is: (defstate idle (assistant-firecanyon) :virtual #t - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) ) - (while #t + (loop (let ((gp-0 #t)) (cond ((= (current-status (-> self tasks)) (task-status invalid)) - (let* ((v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-9 (the-as number (logior #x3f800000 v1-8))) - ) - (when (< (+ -1.0 (the-as float v1-9)) 0.5) - (let ((v1-14 (-> self skel root-channel 0))) - (set! (-> v1-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - ) - (let* ((f30-0 2.0) - (v1-16 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-17 (the-as number (logior #x3f800000 v1-16))) - ) - (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-17)))) 3)) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! - a0-15 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) - ) + (when (< (rand-float-gen) 0.5) + (ja :group! assistant-firecanyon-idle-a-ja) + (let* ((f30-0 2.0) + (v1-16 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-17 (the-as number (logior #x3f800000 v1-16))) + ) + (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-17)))) 3)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) ) ) - (set! gp-0 #f) ) + (set! gp-0 #f) ) - (when (or gp-0 (let* ((v1-53 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-54 (the-as number (logior #x3f800000 v1-53))) - ) - (< (+ -1.0 (the-as float v1-54)) 0.5) - ) - ) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-20 param 1) 1.0) - (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (when (or gp-0 (< (rand-float-gen) 0.5)) + (ja-no-eval :group! assistant-firecanyon-idle-to-b-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((v1-81 (-> self skel root-channel 0))) - (set! (-> v1-81 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) + (ja :num! (seek!)) ) + (ja :group! assistant-firecanyon-idle-b-ja) (let* ((f30-1 2.0) (v1-83 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-84 (the-as number (logior #x3f800000 v1-83))) ) (countdown (gp-2 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-84)))) 3)) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-28 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-28 param 1) 1.0) - (set! (-> a0-28 frame-num) 0.0) - (joint-control-channel-group! - a0-28 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1))) - (set! (-> a0-29 param 1) 1.0) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-31 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-31 param 1) 1.0) - (set! (-> a0-31 frame-num) 0.0) - (joint-control-channel-group! a0-31 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! assistant-firecanyon-idle-to-a-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-32 (-> self skel root-channel 0))) - (set! (-> a0-32 param 0) (the float (+ (-> a0-32 frame-group data 0 length) -1))) - (set! (-> a0-32 param 1) 1.0) - (joint-control-channel-group-eval! a0-32 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let* ((v1-140 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-141 (the-as number (logior #x3f800000 v1-140))) - ) - (when (< (+ -1.0 (the-as float v1-141)) 0.25) - (let ((v1-146 (-> self skel root-channel 0))) - (set! (-> v1-146 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - ) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-39 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-39 param 1) 1.0) - (set! (-> a0-39 frame-num) 0.0) - (joint-control-channel-group! - a0-39 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) (the float (+ (-> a0-40 frame-group data 0 length) -1))) - (set! (-> a0-40 param 1) 1.0) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) - ) + (when (< (rand-float-gen) 0.25) + (ja :group! assistant-firecanyon-idle-wipe-brow-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) ) ) ) (else - (let* ((v1-176 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-177 (the-as number (logior #x3f800000 v1-176))) - ) - (when (< (+ -1.0 (the-as float v1-177)) 0.8) - (let ((v1-182 (-> self skel root-channel 0))) - (set! (-> v1-182 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (let* ((f30-2 4.0) - (v1-184 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-185 (the-as number (logior #x3f800000 v1-184))) - ) - (countdown (gp-3 (+ (the int (* f30-2 (+ -1.0 (the-as float v1-185)))) 8)) - (let ((a0-49 (-> self skel root-channel 0))) - (set! (-> a0-49 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-49 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-49 param 1) 1.0) - (set! (-> a0-49 frame-num) 0.0) - (joint-control-channel-group! - a0-49 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-50 (-> self skel root-channel 0))) - (set! (-> a0-50 param 0) (the float (+ (-> a0-50 frame-group data 0 length) -1))) - (set! (-> a0-50 param 1) 1.0) - (joint-control-channel-group-eval! a0-50 (the-as art-joint-anim #f) num-func-seek!) - ) - ) + (when (< (rand-float-gen) 0.8) + (ja :group! assistant-firecanyon-idle-twist-ja) + (let* ((f30-2 4.0) + (v1-184 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-185 (the-as number (logior #x3f800000 v1-184))) + ) + (countdown (gp-3 (+ (the int (* f30-2 (+ -1.0 (the-as float v1-185)))) 8)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) ) ) - (set! gp-0 #f) ) + (set! gp-0 #f) ) - (when (or gp-0 (let* ((v1-221 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-222 (the-as number (logior #x3f800000 v1-221))) - ) - (< (+ -1.0 (the-as float v1-222)) 0.5) - ) - ) - (let ((a0-54 (-> self skel root-channel 0))) - (set! (-> a0-54 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-54 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-54 param 1) 1.0) - (set! (-> a0-54 frame-num) 0.0) - (joint-control-channel-group! a0-54 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (when (or gp-0 (< (rand-float-gen) 0.5)) + (ja-no-eval :group! assistant-firecanyon-idle-down-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-55 (-> self skel root-channel 0))) - (set! (-> a0-55 param 0) (the float (+ (-> a0-55 frame-group data 0 length) -1))) - (set! (-> a0-55 param 1) 1.0) - (joint-control-channel-group-eval! a0-55 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((v1-249 (-> self skel root-channel 0))) - (set! (-> v1-249 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) + (ja :num! (seek!)) ) + (ja :group! assistant-firecanyon-idle-examine-ja) (let* ((f30-3 2.0) (v1-251 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-252 (the-as number (logior #x3f800000 v1-251))) ) (countdown (gp-4 (+ (the int (* f30-3 (+ -1.0 (the-as float v1-252)))) 3)) - (let ((a0-62 (-> self skel root-channel 0))) - (set! (-> a0-62 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-62 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-62 param 1) 1.0) - (set! (-> a0-62 frame-num) 0.0) - (joint-control-channel-group! - a0-62 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-63 (-> self skel root-channel 0))) - (set! (-> a0-63 param 0) (the float (+ (-> a0-63 frame-group data 0 length) -1))) - (set! (-> a0-63 param 1) 1.0) - (joint-control-channel-group-eval! a0-63 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let ((a0-65 (-> self skel root-channel 0))) - (set! (-> a0-65 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-65 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-65 param 1) 1.0) - (set! (-> a0-65 frame-num) 0.0) - (joint-control-channel-group! a0-65 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! assistant-firecanyon-idle-up-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-66 (-> self skel root-channel 0))) - (set! (-> a0-66 param 0) (the float (+ (-> a0-66 frame-group data 0 length) -1))) - (set! (-> a0-66 param 1) 1.0) - (joint-control-channel-group-eval! a0-66 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let* ((v1-308 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-309 (the-as number (logior #x3f800000 v1-308))) - ) - (when (< (+ -1.0 (the-as float v1-309)) 0.5) - (let ((v1-314 (-> self skel root-channel 0))) - (set! (-> v1-314 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) - (let* ((f30-4 2.0) - (v1-316 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-317 (the-as number (logior #x3f800000 v1-316))) - ) - (countdown (gp-5 (+ (the int (* f30-4 (+ -1.0 (the-as float v1-317)))) 3)) - (let ((a0-75 (-> self skel root-channel 0))) - (set! (-> a0-75 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-75 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-75 param 1) 1.0) - (set! (-> a0-75 frame-num) 0.0) - (joint-control-channel-group! - a0-75 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-76 (-> self skel root-channel 0))) - (set! (-> a0-76 param 0) (the float (+ (-> a0-76 frame-group data 0 length) -1))) - (set! (-> a0-76 param 1) 1.0) - (joint-control-channel-group-eval! a0-76 (the-as art-joint-anim #f) num-func-seek!) - ) - ) + (when (< (rand-float-gen) 0.5) + (ja :group! assistant-firecanyon-idle-fiddle-ja) + (let* ((f30-4 2.0) + (v1-316 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-317 (the-as number (logior #x3f800000 v1-316))) + ) + (countdown (gp-5 (+ (the int (* f30-4 (+ -1.0 (the-as float v1-317)))) 3)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) ) ) ) diff --git a/test/decompiler/reference/levels/firecanyon/firecanyon-obs_REF.gc b/test/decompiler/reference/levels/firecanyon/firecanyon-obs_REF.gc index 3c9679af31..2c66093dc5 100644 --- a/test/decompiler/reference/levels/firecanyon/firecanyon-obs_REF.gc +++ b/test/decompiler/reference/levels/firecanyon/firecanyon-obs_REF.gc @@ -1,6 +1,9 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/crate-darkeco-cluster-ag.gc") +(import "goal_src/import/spike-ag.gc") + ;; definition of type balloon (deftype balloon (process-drawable) ((root-override collide-shape :offset 112) @@ -28,14 +31,12 @@ :id 227 :duration 5 :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 1006) (sp-item 1007) (sp-item 1008)) + :parts ((sp-item 1006) (sp-item 1007) (sp-item 1008)) ) ;; failed to figure out what this is: (defpart 1007 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 2) 1.0) @@ -56,8 +57,7 @@ ;; failed to figure out what this is: (defpart 1008 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-y (meters 2)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) @@ -81,8 +81,7 @@ ;; failed to figure out what this is: (defpart 1006 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 12)) @@ -100,29 +99,21 @@ ;; failed to figure out what this is: (defstate balloon-popping (balloon) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "cool-balloon") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 227) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (sound-play "cool-balloon") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 227) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (suspend) (cleanup-for-death self) @@ -133,8 +124,7 @@ ;; failed to figure out what this is: (defstate balloon-idle (balloon) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (send-event arg0 'heat -10.0) @@ -142,49 +132,18 @@ ) ) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior balloon) ja-post) + :post (the-as (function none :behavior balloon) ja-post) ) ;; definition for method 11 of type balloon @@ -235,18 +194,15 @@ ) ;; failed to figure out what this is: -(defskelgroup *spike-sg* spike - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 8 0 10.2) - :longest-edge (meters 5) - ) +(defskelgroup *spike-sg* spike spike-lod0-jg spike-idle-ja + ((spike-lod0-mg (meters 20)) (spike-lod1-mg (meters 999999))) + :bounds (static-spherem 0 8 0 10.2) + :longest-edge (meters 5) + ) ;; failed to figure out what this is: (defstate spike-up (spike) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'go-spike-up) #t @@ -254,26 +210,20 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (nonzero? (-> self num-alts)) (let ((s5-0 (/ (-> self num-alts) 2)) (gp-0 #t) ) (while (< s5-0 (+ (-> self num-alts) -1)) (let ((v1-2 (entity-actor-lookup (-> self entity) 'alt-actor s5-0))) - (if (and v1-2 (-> v1-2 extra process) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'go-spike-up) - (not (send-event-function - (if v1-2 - (-> v1-2 extra process) - ) - a1-1 - ) + (if (and v1-2 (-> v1-2 extra process) (not (send-event + (if v1-2 + (-> v1-2 extra process) + ) + 'go-spike-up ) - ) + ) ) (set! gp-0 #f) ) @@ -288,44 +238,14 @@ ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (transform-post) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (suspend) ) (none) @@ -334,8 +254,7 @@ ;; failed to figure out what this is: (defstate spike-down (spike) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'go-spike-up) (go spike-up) @@ -344,26 +263,20 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (nonzero? (-> self num-alts)) (let ((s5-0 0) (gp-0 #t) ) (while (< s5-0 (/ (-> self num-alts) 2)) (let ((v1-1 (entity-actor-lookup (-> self entity) 'alt-actor s5-0))) - (if (and v1-1 (-> v1-1 extra process) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'go-spike-up) - (not (send-event-function - (if v1-1 - (-> v1-1 extra process) - ) - a1-1 - ) + (if (and v1-1 (-> v1-1 extra process) (not (send-event + (if v1-1 + (-> v1-1 extra process) + ) + 'go-spike-up ) - ) + ) ) (set! gp-0 #f) ) @@ -378,10 +291,9 @@ ) (none) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t + (loop (suspend) ) (none) @@ -390,30 +302,19 @@ ;; failed to figure out what this is: (defstate spike-idle (spike) - :trans - (behavior () + :trans (behavior () (when (and *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'mode)) - (= (send-event-function *target* a1-0) 'racer) - ) + (= (send-event *target* 'query 'mode) 'racer) (< (vector-vector-distance (-> self root-override trans) (target-pos 0)) 225280.0) ) - (sound-play-by-name (static-sound-name "magma-rock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "magma-rock") (let ((v1-8 (entity-actor-count (-> self entity) 'alt-actor))) 0 (cond ((>= 1 v1-8) (go spike-up) ) - ((let* ((v1-11 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-12 (the-as number (logior #x3f800000 v1-11))) - ) - (< (+ -1.0 (the-as float v1-12)) 0.5) - ) + ((< (rand-float-gen) 0.5) (go spike-down) ) (else @@ -424,10 +325,9 @@ ) (none) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t + (loop (suspend) ) (none) @@ -499,13 +399,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *crate-darkeco-cluster-sg* crate-darkeco-cluster - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 1.6 0 3.3) - :longest-edge (meters 0) - ) +(defskelgroup *crate-darkeco-cluster-sg* crate-darkeco-cluster crate-darkeco-cluster-lod0-jg crate-darkeco-cluster-idle-ja + ((crate-darkeco-cluster-lod0-mg (meters 20)) (crate-darkeco-cluster-lod1-mg (meters 999999))) + :bounds (static-spherem 0 1.6 0 3.3) + ) ;; definition of type crate-darkeco-cluster (deftype crate-darkeco-cluster (process-drawable) @@ -535,8 +432,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2100 :period 600 :length 5) + :parts ((sp-item 2100 :period 600 :length 5) (sp-item 2101 :period 600 :length 40) (sp-item 2102 :period 600 :length 20) (sp-item 2103 :period 600 :length 20) @@ -610,8 +506,7 @@ ;; failed to figure out what this is: (defpart 2104 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 2) 1.0) @@ -631,8 +526,7 @@ ;; failed to figure out what this is: (defpart 2101 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -658,14 +552,12 @@ ;; failed to figure out what this is: (defpart 2105 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2103 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-flt spt-scale-x (meters 0.3)) @@ -684,8 +576,7 @@ ;; failed to figure out what this is: (defpart 2100 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 24)) @@ -702,8 +593,7 @@ ;; failed to figure out what this is: (defpart 2102 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -731,29 +621,21 @@ ;; failed to figure out what this is: (defstate die (crate-darkeco-cluster) :virtual #t - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 228) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (sound-play "dcrate-break") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 228) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (suspend) (cleanup-for-death self) @@ -765,27 +647,15 @@ ;; failed to figure out what this is: (defstate idle (crate-darkeco-cluster) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack 'touch) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((a2-2 (new 'static 'attack-info :mask #x20))) - (set! (-> a2-2 mode) 'darkeco) - (set! (-> a1-3 param 1) (the-as uint a2-2)) - ) - (send-event-function arg0 a1-3) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'darkeco)))) (go-virtual die) ) ) ) - :code - (behavior () + :code (behavior () (transform-post) (logior! (-> self mask) (process-mask sleep)) (suspend) diff --git a/test/decompiler/reference/levels/firecanyon/firecanyon-part_REF.gc b/test/decompiler/reference/levels/firecanyon/firecanyon-part_REF.gc index 6df91d8ac4..679c1fab7a 100644 --- a/test/decompiler/reference/levels/firecanyon/firecanyon-part_REF.gc +++ b/test/decompiler/reference/levels/firecanyon/firecanyon-part_REF.gc @@ -22,8 +22,7 @@ (defpartgroup group-firecanyon-lava-1 :id 229 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1011 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1011 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1012 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1013 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -39,8 +38,7 @@ ;; failed to figure out what this is: (defpart 1012 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -9) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) @@ -66,8 +64,7 @@ ;; failed to figure out what this is: (defpart 1014 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -8) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) @@ -88,8 +85,7 @@ ;; failed to figure out what this is: (defpart 1013 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.03 0.03 1.0) (sp-rnd-flt spt-x (meters -8) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) @@ -112,8 +108,7 @@ ;; failed to figure out what this is: (defpart 1011 - :init-specs - ((sp-flt spt-num 0.5) + :init-specs ((sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -9) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -7) (meters 6) 1.0) @@ -134,8 +129,7 @@ (defpartgroup group-firecanyon-lava-2 :id 230 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1017 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1017 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1018 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1019 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -151,8 +145,7 @@ ;; failed to figure out what this is: (defpart 1018 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -10) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) @@ -178,8 +171,7 @@ ;; failed to figure out what this is: (defpart 1020 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -9) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) @@ -200,8 +192,7 @@ ;; failed to figure out what this is: (defpart 1019 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -9) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) @@ -224,8 +215,7 @@ ;; failed to figure out what this is: (defpart 1017 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -5) (meters 12) 1.0) @@ -246,8 +236,7 @@ (defpartgroup group-firecanyon-lava-3 :id 231 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1021 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1021 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1022 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1023 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -263,8 +252,7 @@ ;; failed to figure out what this is: (defpart 1022 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -10.5) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) @@ -290,8 +278,7 @@ ;; failed to figure out what this is: (defpart 1024 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -9.5) (meters 18) 1.0) (sp-flt spt-y (meters 0.5)) @@ -312,8 +299,7 @@ ;; failed to figure out what this is: (defpart 1023 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -9.5) (meters 18) 1.0) (sp-flt spt-y (meters 0.5)) @@ -336,8 +322,7 @@ ;; failed to figure out what this is: (defpart 1021 - :init-specs - ((sp-flt spt-num 1.6) + :init-specs ((sp-flt spt-num 1.6) (sp-rnd-flt spt-x (meters -10.5) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -20) (meters 36) 1.0) @@ -358,8 +343,7 @@ (defpartgroup group-firecanyon-lava-5 :id 232 :bounds (static-bspherem -2 0 -2 14) - :parts - ((sp-item 1025 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1025 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1026 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1027 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -375,8 +359,7 @@ ;; failed to figure out what this is: (defpart 1028 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -6) (meters 13) 1.0) (sp-flt spt-y (meters 0)) @@ -397,8 +380,7 @@ ;; failed to figure out what this is: (defpart 1010 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -418,8 +400,7 @@ ;; failed to figure out what this is: (defpart 1027 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -6) (meters 13) 1.0) (sp-flt spt-y (meters 0)) @@ -442,8 +423,7 @@ ;; failed to figure out what this is: (defpart 1009 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -461,8 +441,7 @@ ;; failed to figure out what this is: (defpart 1025 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -8) (meters 16) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -13) (meters 20) 1.0) @@ -481,14 +460,12 @@ ;; failed to figure out what this is: (defpart 1016 - :init-specs - ((sp-flt spt-fade-b -6.826667)) + :init-specs ((sp-flt spt-fade-b -6.826667)) ) ;; failed to figure out what this is: (defpart 1026 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -8) (meters 16) 1.0) (sp-flt spt-y (meters -0.5)) @@ -514,14 +491,12 @@ ;; failed to figure out what this is: (defpart 1015 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 1029)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 1029)) ) ;; failed to figure out what this is: (defpart 1029 - :init-specs - ((sp-flt spt-fade-r -0.8) + :init-specs ((sp-flt spt-fade-r -0.8) (sp-flt spt-fade-b 0.8) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 1030) @@ -530,16 +505,14 @@ ;; failed to figure out what this is: (defpart 1030 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.14222223)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.14222223)) ) ;; failed to figure out what this is: (defpartgroup group-firecanyon-lava-6 :id 233 :bounds (static-bspherem 2 0 2 14) - :parts - ((sp-item 1031 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1031 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1032 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1033 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -555,8 +528,7 @@ ;; failed to figure out what this is: (defpart 1034 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -5) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) @@ -577,8 +549,7 @@ ;; failed to figure out what this is: (defpart 1032 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -6) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) @@ -604,8 +575,7 @@ ;; failed to figure out what this is: (defpart 1033 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -5) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) @@ -628,8 +598,7 @@ ;; failed to figure out what this is: (defpart 1031 - :init-specs - ((sp-flt spt-num 1.3) + :init-specs ((sp-flt spt-num 1.3) (sp-rnd-flt spt-x (meters -6) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -6.5) (meters 15) 1.0) @@ -650,8 +619,7 @@ (defpartgroup group-firecanyon-lava-7 :id 234 :bounds (static-bspherem 0 0 0 14) - :parts - ((sp-item 1035 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1035 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1036 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1037 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -667,8 +635,7 @@ ;; failed to figure out what this is: (defpart 1036 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -6.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) @@ -694,8 +661,7 @@ ;; failed to figure out what this is: (defpart 1038 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -5.5) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -716,8 +682,7 @@ ;; failed to figure out what this is: (defpart 1037 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -5.5) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -740,8 +705,7 @@ ;; failed to figure out what this is: (defpart 1035 - :init-specs - ((sp-flt spt-num 1.1) + :init-specs ((sp-flt spt-num 1.1) (sp-rnd-flt spt-x (meters -6.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -1.5) (meters 15) 1.0) @@ -762,8 +726,7 @@ (defpartgroup group-firecanyon-lava-8 :id 235 :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 1039 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1039 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1040 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1041 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -779,8 +742,7 @@ ;; failed to figure out what this is: (defpart 1040 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -9.5) (meters 14) 1.0) (sp-flt spt-y (meters 0.5)) @@ -806,8 +768,7 @@ ;; failed to figure out what this is: (defpart 1042 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -8.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) @@ -828,8 +789,7 @@ ;; failed to figure out what this is: (defpart 1041 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -8.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) @@ -852,8 +812,7 @@ ;; failed to figure out what this is: (defpart 1039 - :init-specs - ((sp-flt spt-num 1.4) + :init-specs ((sp-flt spt-num 1.4) (sp-rnd-flt spt-x (meters -9.5) (meters 14) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -13) (meters 28) 1.0) @@ -874,8 +833,7 @@ (defpartgroup group-firecanyon-lava-9 :id 236 :bounds (static-bspherem 0 0 0 9) - :parts - ((sp-item 1043 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1043 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1044 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1045 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -891,8 +849,7 @@ ;; failed to figure out what this is: (defpart 1044 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.08) (sp-rnd-flt spt-x (meters -3.5) (meters 7) 1.0) (sp-flt spt-y (meters 0.5)) @@ -918,8 +875,7 @@ ;; failed to figure out what this is: (defpart 1046 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.6) (sp-rnd-flt spt-x (meters -2.5) (meters 5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -940,8 +896,7 @@ ;; failed to figure out what this is: (defpart 1045 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.03 0.03 1.0) (sp-rnd-flt spt-x (meters -2.5) (meters 5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -964,8 +919,7 @@ ;; failed to figure out what this is: (defpart 1043 - :init-specs - ((sp-flt spt-num 0.6) + :init-specs ((sp-flt spt-num 0.6) (sp-rnd-flt spt-x (meters -3.5) (meters 7) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -7) (meters 15) 1.0) @@ -986,8 +940,7 @@ (defpartgroup group-firecanyon-lava-10 :id 237 :bounds (static-bspherem -4 0 0 15) - :parts - ((sp-item 1047 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1047 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1048 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1049 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1003,8 +956,7 @@ ;; failed to figure out what this is: (defpart 1048 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -13.5) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1030,8 +982,7 @@ ;; failed to figure out what this is: (defpart 1050 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -12.5) (meters 18) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1052,8 +1003,7 @@ ;; failed to figure out what this is: (defpart 1049 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -12.5) (meters 18) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1076,8 +1026,7 @@ ;; failed to figure out what this is: (defpart 1047 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -13.5) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -14) (meters 22) 1.0) @@ -1098,8 +1047,7 @@ (defpartgroup group-firecanyon-lava-11 :id 238 :bounds (static-bspherem -4 0 0 12) - :parts - ((sp-item 1051 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1051 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1052 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1053 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1115,8 +1063,7 @@ ;; failed to figure out what this is: (defpart 1052 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -10.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1142,8 +1089,7 @@ ;; failed to figure out what this is: (defpart 1054 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -9.5) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1164,8 +1110,7 @@ ;; failed to figure out what this is: (defpart 1053 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -9.5) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1188,8 +1133,7 @@ ;; failed to figure out what this is: (defpart 1051 - :init-specs - ((sp-flt spt-num 0.7) + :init-specs ((sp-flt spt-num 0.7) (sp-rnd-flt spt-x (meters -10.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -11) (meters 14) 1.0) @@ -1210,8 +1154,7 @@ (defpartgroup group-firecanyon-lava-14 :id 239 :bounds (static-bspherem -4 0 0 15) - :parts - ((sp-item 1055 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1055 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1056 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1057 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1227,8 +1170,7 @@ ;; failed to figure out what this is: (defpart 1056 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -17.5) (meters 25) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1254,8 +1196,7 @@ ;; failed to figure out what this is: (defpart 1058 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -16.5) (meters 23) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1276,8 +1217,7 @@ ;; failed to figure out what this is: (defpart 1057 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -16.5) (meters 23) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1300,8 +1240,7 @@ ;; failed to figure out what this is: (defpart 1055 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -17.5) (meters 25) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -12) (meters 24) 1.0) @@ -1322,8 +1261,7 @@ (defpartgroup group-firecanyon-lava-15 :id 240 :bounds (static-bspherem -4 0 0 12) - :parts - ((sp-item 1059 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1059 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1060 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1061 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1339,8 +1277,7 @@ ;; failed to figure out what this is: (defpart 1060 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -10.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1366,8 +1303,7 @@ ;; failed to figure out what this is: (defpart 1062 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -9.5) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1388,8 +1324,7 @@ ;; failed to figure out what this is: (defpart 1061 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.04 0.04 1.0) (sp-rnd-flt spt-x (meters -9.5) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1412,8 +1347,7 @@ ;; failed to figure out what this is: (defpart 1059 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10.5) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -11) (meters 24) 1.0) @@ -1434,8 +1368,7 @@ (defpartgroup group-firecanyon-lava-16 :id 241 :bounds (static-bspherem 0 0 0 14) - :parts - ((sp-item 1063 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1063 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1064 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1065 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1451,8 +1384,7 @@ ;; failed to figure out what this is: (defpart 1064 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -9.5) (meters 16) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1478,8 +1410,7 @@ ;; failed to figure out what this is: (defpart 1066 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -8.5) (meters 14) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1500,8 +1431,7 @@ ;; failed to figure out what this is: (defpart 1065 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -8.5) (meters 14) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1524,8 +1454,7 @@ ;; failed to figure out what this is: (defpart 1063 - :init-specs - ((sp-flt spt-num 1.1) + :init-specs ((sp-flt spt-num 1.1) (sp-rnd-flt spt-x (meters -9.5) (meters 16) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -12) (meters 26) 1.0) @@ -1546,8 +1475,7 @@ (defpartgroup group-firecanyon-lava-18 :id 242 :bounds (static-bspherem -4 0 -4 26) - :parts - ((sp-item 1067 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1067 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1068 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1069 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1563,8 +1491,7 @@ ;; failed to figure out what this is: (defpart 1068 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -11) (meters 24) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1590,8 +1517,7 @@ ;; failed to figure out what this is: (defpart 1070 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -10) (meters 22) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1612,8 +1538,7 @@ ;; failed to figure out what this is: (defpart 1069 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.07 0.07 1.0) (sp-rnd-flt spt-x (meters -10) (meters 22) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1636,8 +1561,7 @@ ;; failed to figure out what this is: (defpart 1067 - :init-specs - ((sp-flt spt-num 1.9) + :init-specs ((sp-flt spt-num 1.9) (sp-rnd-flt spt-x (meters -11) (meters 24) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -28) (meters 42) 1.0) @@ -1658,8 +1582,7 @@ (defpartgroup group-firecanyon-lava-19 :id 243 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1071 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1071 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1072 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1073 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1675,8 +1598,7 @@ ;; failed to figure out what this is: (defpart 1072 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.3) (sp-rnd-flt spt-x (meters -10) (meters 23) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1702,8 +1624,7 @@ ;; failed to figure out what this is: (defpart 1074 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -9) (meters 21) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1724,8 +1645,7 @@ ;; failed to figure out what this is: (defpart 1073 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -9) (meters 21) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1748,8 +1668,7 @@ ;; failed to figure out what this is: (defpart 1071 - :init-specs - ((sp-flt spt-num 1.4) + :init-specs ((sp-flt spt-num 1.4) (sp-rnd-flt spt-x (meters -10) (meters 23) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -18) (meters 28) 1.0) @@ -1770,8 +1689,7 @@ (defpartgroup group-firecanyon-lava-21 :id 244 :bounds (static-bspherem -4 0 4 22) - :parts - ((sp-item 1075 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1075 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1076 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1077 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1787,8 +1705,7 @@ ;; failed to figure out what this is: (defpart 1076 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.17) (sp-rnd-flt spt-x (meters -23) (meters 32) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1814,8 +1731,7 @@ ;; failed to figure out what this is: (defpart 1078 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-x (meters -22) (meters 30) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1836,8 +1752,7 @@ ;; failed to figure out what this is: (defpart 1077 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.03 0.03 1.0) (sp-rnd-flt spt-x (meters -22) (meters 30) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1860,8 +1775,7 @@ ;; failed to figure out what this is: (defpart 1075 - :init-specs - ((sp-flt spt-num 0.7) + :init-specs ((sp-flt spt-num 0.7) (sp-rnd-flt spt-x (meters -23) (meters 32) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -5) (meters 4) 1.0) @@ -1882,8 +1796,7 @@ (defpartgroup group-firecanyon-lava-22 :id 245 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1079 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1079 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1080 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1081 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -1899,8 +1812,7 @@ ;; failed to figure out what this is: (defpart 1080 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -7) (meters 25) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1926,8 +1838,7 @@ ;; failed to figure out what this is: (defpart 1082 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -6) (meters 23) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1948,8 +1859,7 @@ ;; failed to figure out what this is: (defpart 1081 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -6) (meters 23) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1972,8 +1882,7 @@ ;; failed to figure out what this is: (defpart 1079 - :init-specs - ((sp-flt spt-num 0.5) + :init-specs ((sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -7) (meters 25) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -4) (meters 6) 1.0) @@ -1994,8 +1903,7 @@ (defpartgroup group-firecanyon-lava-60 :id 246 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1083 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1083 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1084 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1085 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -2011,8 +1919,7 @@ ;; failed to figure out what this is: (defpart 1084 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -11) (meters 21) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2038,8 +1945,7 @@ ;; failed to figure out what this is: (defpart 1086 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.3) (sp-rnd-flt spt-x (meters -10) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2060,8 +1966,7 @@ ;; failed to figure out what this is: (defpart 1085 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters -10) (meters 19) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2084,8 +1989,7 @@ ;; failed to figure out what this is: (defpart 1083 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -11) (meters 21) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -17) (meters 30) 1.0) @@ -2106,8 +2010,7 @@ (defpartgroup group-firecanyon-lava-62 :id 247 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1087 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1087 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1088 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1089 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -2123,8 +2026,7 @@ ;; failed to figure out what this is: (defpart 1088 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -9) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2150,8 +2052,7 @@ ;; failed to figure out what this is: (defpart 1090 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -8) (meters 15) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2172,8 +2073,7 @@ ;; failed to figure out what this is: (defpart 1089 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.04 0.04 1.0) (sp-rnd-flt spt-x (meters -8) (meters 15) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2196,8 +2096,7 @@ ;; failed to figure out what this is: (defpart 1087 - :init-specs - ((sp-flt spt-num 0.7) + :init-specs ((sp-flt spt-num 0.7) (sp-rnd-flt spt-x (meters -9) (meters 17) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -8) (meters 14) 1.0) @@ -2218,8 +2117,7 @@ (defpartgroup group-firecanyon-lava-63 :id 248 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1091 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1091 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1092 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1093 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -2235,8 +2133,7 @@ ;; failed to figure out what this is: (defpart 1092 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -8) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2262,8 +2159,7 @@ ;; failed to figure out what this is: (defpart 1094 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -7) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2284,8 +2180,7 @@ ;; failed to figure out what this is: (defpart 1093 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.04 0.04 1.0) (sp-rnd-flt spt-x (meters -7) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2308,8 +2203,7 @@ ;; failed to figure out what this is: (defpart 1091 - :init-specs - ((sp-flt spt-num 0.7) + :init-specs ((sp-flt spt-num 0.7) (sp-rnd-flt spt-x (meters -8) (meters 12) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -10) (meters 16) 1.0) @@ -2330,8 +2224,7 @@ (defpartgroup group-firecanyon-lava-64 :id 249 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1095 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1095 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1096 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 1097 :fade-after (meters 100) :falloff-to (meters 100) :binding 1009) (sp-item 1009 :flags (start-dead)) @@ -2347,8 +2240,7 @@ ;; failed to figure out what this is: (defpart 1096 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -3) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2374,8 +2266,7 @@ ;; failed to figure out what this is: (defpart 1098 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.6) (sp-rnd-flt spt-x (meters -2) (meters 8) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2396,8 +2287,7 @@ ;; failed to figure out what this is: (defpart 1097 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.02 0.02 1.0) (sp-rnd-flt spt-x (meters -2) (meters 8) 1.0) (sp-flt spt-y (meters 0.5)) @@ -2420,8 +2310,7 @@ ;; failed to figure out what this is: (defpart 1095 - :init-specs - ((sp-flt spt-num 0.4) + :init-specs ((sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -3) (meters 10) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -5) (meters 9) 1.0) @@ -2442,16 +2331,14 @@ (defpartgroup group-firecanyon-heat-44 :id 250 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1099 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1099 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1100 :fade-after (meters 150) :falloff-to (meters 150)) ) ) ;; failed to figure out what this is: (defpart 1100 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters 0) (meters 14) 1.0) (sp-flt spt-y (meters -6)) @@ -2478,8 +2365,7 @@ ;; failed to figure out what this is: (defpart 1099 - :init-specs - ((sp-flt spt-num 1.25) + :init-specs ((sp-flt spt-num 1.25) (sp-rnd-flt spt-x (meters 0) (meters 14) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -16) (meters 18) 1.0) @@ -2500,16 +2386,14 @@ (defpartgroup group-firecanyon-heat-45 :id 251 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1101 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1101 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1102 :fade-after (meters 150) :falloff-to (meters 150)) ) ) ;; failed to figure out what this is: (defpart 1102 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters 0) (meters 12) 1.0) (sp-flt spt-y (meters -6)) @@ -2536,8 +2420,7 @@ ;; failed to figure out what this is: (defpart 1101 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 12) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -4) (meters 16) 1.0) @@ -2558,16 +2441,14 @@ (defpartgroup group-firecanyon-heat-46 :id 252 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1103 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1103 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1104 :fade-after (meters 150) :falloff-to (meters 150)) ) ) ;; failed to figure out what this is: (defpart 1104 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -3) (meters 5) 1.0) (sp-flt spt-y (meters -6)) @@ -2594,8 +2475,7 @@ ;; failed to figure out what this is: (defpart 1103 - :init-specs - ((sp-flt spt-num 0.5) + :init-specs ((sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -3) (meters 5) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters 0) (meters 14) 1.0) @@ -2616,16 +2496,14 @@ (defpartgroup group-firecanyon-heat-47 :id 253 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1105 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1105 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1106 :fade-after (meters 150) :falloff-to (meters 150)) ) ) ;; failed to figure out what this is: (defpart 1106 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.08) (sp-rnd-flt spt-x (meters 2) (meters 5) 1.0) (sp-flt spt-y (meters -6)) @@ -2652,8 +2530,7 @@ ;; failed to figure out what this is: (defpart 1105 - :init-specs - ((sp-flt spt-num 0.4) + :init-specs ((sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters 2) (meters 5) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -12) (meters 14) 1.0) @@ -2674,16 +2551,14 @@ (defpartgroup group-firecanyon-heat-48 :id 254 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1107 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1107 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1108 :fade-after (meters 150) :falloff-to (meters 150)) ) ) ;; failed to figure out what this is: (defpart 1108 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -13) (meters 17) 1.0) (sp-flt spt-y (meters -6)) @@ -2710,8 +2585,7 @@ ;; failed to figure out what this is: (defpart 1107 - :init-specs - ((sp-flt spt-num 2.0) + :init-specs ((sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -13) (meters 17) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -19) (meters 23) 1.0) @@ -2732,16 +2606,14 @@ (defpartgroup group-firecanyon-heat-50 :id 255 :bounds (static-bspherem 0 0 0 14) - :parts - ((sp-item 1109 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1109 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1110 :fade-after (meters 150) :falloff-to (meters 150)) ) ) ;; failed to figure out what this is: (defpart 1110 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -6) (meters 1) 1.0) (sp-flt spt-y (meters -6)) @@ -2768,8 +2640,7 @@ ;; failed to figure out what this is: (defpart 1109 - :init-specs - ((sp-flt spt-num 0.7) + :init-specs ((sp-flt spt-num 0.7) (sp-rnd-flt spt-x (meters -6) (meters 1) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters 0) (meters 18) 1.0) @@ -2790,16 +2661,14 @@ (defpartgroup group-firecanyon-heat-52 :id 256 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1111 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1111 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1112 :fade-after (meters 150) :falloff-to (meters 150)) ) ) ;; failed to figure out what this is: (defpart 1112 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -12) (meters 18) 1.0) (sp-flt spt-y (meters -6)) @@ -2826,8 +2695,7 @@ ;; failed to figure out what this is: (defpart 1111 - :init-specs - ((sp-flt spt-num 0.75) + :init-specs ((sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters -12) (meters 18) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -12) (meters 16) 1.0) @@ -2848,16 +2716,14 @@ (defpartgroup group-firecanyon-heat-53 :id 257 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1113 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1113 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1114 :fade-after (meters 150) :falloff-to (meters 150)) ) ) ;; failed to figure out what this is: (defpart 1114 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -10) (meters 18) 1.0) (sp-flt spt-y (meters -6)) @@ -2884,8 +2750,7 @@ ;; failed to figure out what this is: (defpart 1113 - :init-specs - ((sp-flt spt-num 0.75) + :init-specs ((sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters -10) (meters 18) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -3) (meters 16) 1.0) @@ -2906,16 +2771,14 @@ (defpartgroup group-firecanyon-heat-54 :id 258 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1115 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1115 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1116 :fade-after (meters 150) :falloff-to (meters 150)) ) ) ;; failed to figure out what this is: (defpart 1116 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.3) (sp-rnd-flt spt-x (meters -10) (meters 13) 1.0) (sp-flt spt-y (meters -6)) @@ -2942,8 +2805,7 @@ ;; failed to figure out what this is: (defpart 1115 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -10) (meters 13) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -18) (meters 20) 1.0) @@ -2964,16 +2826,14 @@ (defpartgroup group-firecanyon-heat-55 :id 259 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1117 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1117 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1118 :fade-after (meters 150) :falloff-to (meters 150)) ) ) ;; failed to figure out what this is: (defpart 1118 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.35) (sp-rnd-flt spt-x (meters -3) (meters 10) 1.0) (sp-flt spt-y (meters -6)) @@ -3000,8 +2860,7 @@ ;; failed to figure out what this is: (defpart 1117 - :init-specs - ((sp-flt spt-num 1.9) + :init-specs ((sp-flt spt-num 1.9) (sp-rnd-flt spt-x (meters -3) (meters 10) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -3) (meters 32) 1.0) @@ -3022,16 +2881,14 @@ (defpartgroup group-firecanyon-heat-56 :id 260 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1119 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1119 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1120 :fade-after (meters 150) :falloff-to (meters 150)) ) ) ;; failed to figure out what this is: (defpart 1120 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -7) (meters 16) 1.0) (sp-flt spt-y (meters -6)) @@ -3058,8 +2915,7 @@ ;; failed to figure out what this is: (defpart 1119 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -7) (meters 16) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -8) (meters 15) 1.0) @@ -3080,16 +2936,14 @@ (defpartgroup group-firecanyon-heat-57 :id 261 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1121 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1121 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1122 :fade-after (meters 150) :falloff-to (meters 150)) ) ) ;; failed to figure out what this is: (defpart 1122 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -6) (meters 8) 1.0) (sp-flt spt-y (meters -6)) @@ -3116,8 +2970,7 @@ ;; failed to figure out what this is: (defpart 1121 - :init-specs - ((sp-flt spt-num 0.75) + :init-specs ((sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters -6) (meters 8) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -2) (meters 20) 1.0) @@ -3138,16 +2991,14 @@ (defpartgroup group-firecanyon-heat-58 :id 262 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1123 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1123 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1124 :fade-after (meters 150) :falloff-to (meters 150)) ) ) ;; failed to figure out what this is: (defpart 1124 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -1) (meters 8) 1.0) (sp-flt spt-y (meters -6)) @@ -3174,8 +3025,7 @@ ;; failed to figure out what this is: (defpart 1123 - :init-specs - ((sp-flt spt-num 0.75) + :init-specs ((sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters -1) (meters 8) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -18) (meters 20) 1.0) @@ -3196,16 +3046,14 @@ (defpartgroup group-firecanyon-heat-59 :id 263 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1125 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1125 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1126 :fade-after (meters 150) :falloff-to (meters 150)) ) ) ;; failed to figure out what this is: (defpart 1126 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters -6)) @@ -3232,8 +3080,7 @@ ;; failed to figure out what this is: (defpart 1125 - :init-specs - ((sp-flt spt-num 0.75) + :init-specs ((sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters -6)) (sp-rnd-flt spt-z (meters -4) (meters 20) 1.0) diff --git a/test/decompiler/reference/levels/flut_common/flut-part_REF.gc b/test/decompiler/reference/levels/flut_common/flut-part_REF.gc index da13a206c7..b8e8b5baa1 100644 --- a/test/decompiler/reference/levels/flut_common/flut-part_REF.gc +++ b/test/decompiler/reference/levels/flut_common/flut-part_REF.gc @@ -5,8 +5,7 @@ (defpartgroup group-flut-trans-pad :id 120 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 746 :fade-after (meters 160)) + :parts ((sp-item 746 :fade-after (meters 160)) (sp-item 747 :fade-after (meters 160)) (sp-item 748 :fade-after (meters 60) :falloff-to (meters 60) :flags (is-3d)) ) @@ -14,8 +13,7 @@ ;; failed to figure out what this is: (defpart 746 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 7)) (sp-rnd-flt spt-scale-x (meters 14) (meters 1) 1.0) @@ -31,8 +29,7 @@ ;; failed to figure out what this is: (defpart 747 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 4)) (sp-rnd-flt spt-scale-x (meters 7) (meters 1) 1.0) @@ -49,8 +46,7 @@ ;; failed to figure out what this is: (defpart 748 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0.75) (meters 0.1) 1.0) (sp-flt spt-scale-x (meters 0)) @@ -78,14 +74,12 @@ :duration 10 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 749) (sp-item 750)) + :parts ((sp-item 749) (sp-item 750)) ) ;; failed to figure out what this is: (defpart 749 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 24.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -114,8 +108,7 @@ ;; failed to figure out what this is: (defpart 750 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) diff --git a/test/decompiler/reference/levels/flut_common/flutflut_REF.gc b/test/decompiler/reference/levels/flut_common/flutflut_REF.gc index b8f442bb63..f8bf862176 100644 --- a/test/decompiler/reference/levels/flut_common/flutflut_REF.gc +++ b/test/decompiler/reference/levels/flut_common/flutflut_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/flut-saddle-ag.gc") + ;; failed to figure out what this is: (if (not (nmember "flutp" *kernel-packages*)) (set! *kernel-packages* (cons "flutp" *kernel-packages*)) @@ -60,13 +62,10 @@ ) ;; definition for symbol *flutflut-shadow-control*, type shadow-control -(define - *flutflut-shadow-control* +(define *flutflut-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #xa)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 614400.0) + :flags (shadow-flags disable-fade shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) :bot-plane (new 'static 'plane :y 1.0 :w 81920.0) :top-plane (new 'static 'plane :y 1.0 :w -2867.2) ) @@ -74,15 +73,12 @@ ) ;; failed to figure out what this is: -(defskelgroup *flutflut-sg* flut-saddle - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3.5) - :longest-edge (meters 0) - :shadow 2 - :sort 1 - ) +(defskelgroup *flutflut-sg* flut-saddle flut-saddle-lod0-jg -1 + ((flut-saddle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + :shadow flut-saddle-shadow-mg + :sort 1 + ) ;; definition for function flutflut-effect ;; INFO: Return type mismatch int vs none. @@ -96,8 +92,7 @@ ;; failed to figure out what this is: (defstate wait-for-start (flutflut) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -119,16 +114,14 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (set! (-> self root-override root-prim prim-core action) (collide-action)) (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) 0 (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((v1-0 (-> self condition))) (cond ((or (zero? v1-0) (= v1-0 1)) @@ -202,25 +195,19 @@ ;; failed to figure out what this is: (defstate idle (flutflut) :virtual #t - :event - (-> (method-of-type flutflut wait-for-start) event) - :enter - (behavior () + :event (-> (method-of-type flutflut wait-for-start) event) + :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (the-as curve-control (-> self path-target))) (none) ) - :exit - (-> (method-of-type flutflut wait-for-start) exit) - :code - (behavior () + :exit (-> (method-of-type flutflut wait-for-start) exit) + :code (behavior () (ja-channel-set! 1) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) (set! (-> self root-override root-prim prim-core action) (collide-action solid ca-11)) (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) - (while #t + (loop (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-14))) (go-virtual wait-for-return) ) @@ -264,28 +251,21 @@ ) (flutflut-effect) (suspend) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 param 0) 1.0) - (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior flutflut) ja-post) + :post (the-as (function none :behavior flutflut) ja-post) ) ;; failed to figure out what this is: (defstate pickup (flutflut) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('draw) (ja-channel-set! 1) - (let ((v1-3 (-> self skel root-channel 0))) - (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) (set! (-> self root-override root-prim prim-core action) (collide-action solid ca-11)) (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) (transform-post) @@ -298,13 +278,11 @@ ) ) ) - :enter - (behavior ((arg0 (state flutflut))) + :enter (behavior ((arg0 (state flutflut))) ((-> arg0 enter)) (none) ) - :code - (behavior ((arg0 (state flutflut))) + :code (behavior ((arg0 (state flutflut))) (ja-channel-set! 0) (ja-post) (while (zero? (ja-group-size)) @@ -334,8 +312,7 @@ ;; failed to figure out what this is: (defstate wait-for-return (flutflut) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (or (= arg2 'touch) (= arg2 'attack)) (send-event *target* 'end-mode)) (go-virtual pickup (method-of-object self idle)) ) @@ -346,17 +323,15 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (the-as curve-control (-> self path-flut))) (none) ) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (ja-post) - (while #t + (loop (if (not (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-14)))) (go-virtual idle) ) @@ -421,19 +396,8 @@ ) ) ) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "zoom-teleport") - :volume #x400 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> obj root-override trans)) ) (go (method-of-object obj wait-for-start)) (none) diff --git a/test/decompiler/reference/levels/flut_common/target-flut_REF.gc b/test/decompiler/reference/levels/flut_common/target-flut_REF.gc index 8257d2c2eb..7f45d51622 100644 --- a/test/decompiler/reference/levels/flut_common/target-flut_REF.gc +++ b/test/decompiler/reference/levels/flut_common/target-flut_REF.gc @@ -3,12 +3,12 @@ ;; definition of type flut-info (deftype flut-info (basic) - ((entity basic :offset-assert 4) - (flut-trans vector :inline :offset-assert 16) - (flut-quat vector :inline :offset-assert 32) - (flut-scale vector :inline :offset-assert 48) - (stick-lock basic :offset-assert 64) - (flap-sound-id sound-id :offset-assert 68) + ((entity entity-actor :offset-assert 4) + (flut-trans vector :inline :offset-assert 16) + (flut-quat vector :inline :offset-assert 32) + (flut-scale vector :inline :offset-assert 48) + (stick-lock basic :offset-assert 64) + (flap-sound-id sound-id :offset-assert 68) ) :method-count-assert 9 :size-assert #x48 @@ -89,7 +89,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :flags #x8 + :flags (surface-flags no-turn-around) ) ) @@ -119,7 +119,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x800 + :flags (surface-flags jump) ) ) @@ -149,7 +149,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x800 + :flags (surface-flags jump) ) ) @@ -174,7 +174,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags #x1018 + :flags (surface-flags no-turn-around no-rotate-toward-transv attacking) ) ) @@ -200,7 +200,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags #x1800 + :flags (surface-flags jump attacking) ) ) @@ -230,57 +230,29 @@ ;; definition for function target-flut-falling-anim-trans ;; INFO: Return type mismatch int vs none. (defbehavior target-flut-falling-anim-trans target () - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-2 (ja-group))) (b! (or (= v1-2 (-> self draw art-group data 144)) (= v1-2 (-> self draw art-group data 145))) cfg-7 - :delay - (empty-form) + :delay (empty-form) ) ) - (ja-channel-push! 1 99) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) - ) + (ja-channel-push! 1 (seconds 0.33)) + (ja :group! (-> self draw art-group data 144)) (b! #t cfg-23 :delay (nop!)) (label cfg-7) (cond - ((and (logtest? (-> self control status) 1) (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 145) - ) - ) + ((and (logtest? (-> self control status) (cshape-moving-flags onsurf)) + (not (ja-group? (-> self draw art-group data 145))) ) - (ja-channel-push! 1 6) - (let ((v1-21 (-> self skel root-channel 0))) - (set! (-> v1-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 145))) - ) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! (-> self draw art-group data 145)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 144) - ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) 1.0) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-loop!) - ) + ((ja-group? (-> self draw art-group data 144)) + (ja :num! (loop!)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 145) - ) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 145)) + (ja :num! (seek!)) ) ) (label cfg-23) @@ -291,105 +263,44 @@ ;; definition for function target-flut-hit-ground-anim (defbehavior target-flut-hit-ground-anim target () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 144) - ) + ((ja-group? (-> self draw art-group data 144)) (if (!= (-> self skel root-channel 0) (-> self skel channel)) - (ja-channel-push! 2 15) + (ja-channel-push! 2 (seconds 0.05)) (ja-channel-set! 2) ) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 145)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((gp-1 (-> self skel root-channel 1))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 148)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 145) :num! min) + (ja :chan 1 :group! (-> self draw art-group data 148) :num! min) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((a0-12 (-> self skel root-channel 1))) - (set! (-> a0-12 param 0) 0.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (seek!)) + (ja :chan 1 :num! (chan 0)) ) #f ) - ((let ((v1-33 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + ((let ((v1-33 (ja-group))) (or (= v1-33 (-> self draw art-group data 143)) (= v1-33 (-> self draw art-group data 145))) ) #f ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 149) - ) + ((ja-group? (-> self draw art-group data 149)) (ja-channel-set! 1) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> self draw art-group data 145))) - (set! (-> a0-26 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 145)) data 0 length) -1)) - ) - (set! (-> a0-26 param 1) 1.0) - (set! (-> a0-26 frame-num) 0.0) - (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> self draw art-group data 145)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 145) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1))) - (set! (-> a0-27 param 1) 1.0) - (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) - ((let ((v1-68 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + ((let ((v1-68 (ja-group))) (or (= v1-68 (-> self draw art-group data 152)) (= v1-68 (-> self draw art-group data 153))) ) (ja-channel-set! 1) - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> self draw art-group data 154))) - (set! (-> a0-37 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 154)) data 0 length) -1)) - ) - (set! (-> a0-37 param 1) 1.0) - (set! (-> a0-37 frame-num) 0.0) - (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> self draw art-group data 154)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 154) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-xz-vel) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) (the float (+ (-> a0-40 frame-group data 0 length) -1))) - (set! (-> a0-40 param 1) 1.0) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) @@ -414,15 +325,15 @@ (the-as attack-info (-> arg3 param 1)) arg0 (the-as process (-> arg3 param 0)) - (the-as (state handle attack-info target) target-flut-hit) + target-flut-hit ) ) (('shove) (when (!= (-> self next-state name) 'target-hit) (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 104) - (when (zero? (logand (-> self attack-info-rec mask) 8)) + (when (zero? (logand (-> self attack-info-rec mask) (attack-mask attacker))) (set! (-> self attack-info-rec attacker) (process->handle arg0)) - (logior! (-> self attack-info-rec mask) 8) + (logior! (-> self attack-info-rec mask) (attack-mask attacker)) ) (go target-flut-hit 'shove (-> self attack-info-rec)) ) @@ -435,30 +346,23 @@ (('swim) (let* ((gp-1 (-> self control last-known-safe-ground)) (s3-1 (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans))) - (f30-1 (fmax (-> (new 'static 'array float 1 8192.0) 0) (fmin 40960.0 (vector-xz-length s3-1)))) + (f30-1 (fmax 8192.0 (fmin 40960.0 (vector-xz-length s3-1)))) ) (vector-xz-normalize! s3-1 f30-1) - (let ((s5-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> s5-0 from) self) - (set! (-> s5-0 num-params) 2) - (set! (-> s5-0 message) 'shove) - (set! (-> s5-0 param 0) (the-as uint #f)) - (let ((s4-0 (new 'static 'attack-info :mask #x882))) - (set! (-> s4-0 vector quad) (-> s3-1 quad)) - (set! (-> s4-0 shove-up) (+ (lerp-scale - (the-as float 4096.0) - (-> (new 'static 'array float 1 16384.0) 0) - f30-1 - (the-as float 4096.0) - (the-as float 40960.0) - ) - (fmax 0.0 (- (-> gp-1 y) (-> self control trans y))) - ) + (send-event + self + 'shove + #f + (static-attack-info + ((vector s3-1) + (shove-up + (+ (lerp-scale (the-as float 4096.0) (the-as float 16384.0) f30-1 (the-as float 4096.0) (the-as float 40960.0)) + (fmax 0.0 (- (-> gp-1 y) (-> self control trans y))) ) - (set! (-> s4-0 angle) 'up) - (set! (-> s5-0 param 1) (the-as uint s4-0)) + ) + (angle 'up) + ) ) - (send-event-function self s5-0) ) ) ) @@ -505,7 +409,7 @@ (the-as attack-info (-> arg3 param 1)) arg0 (the-as process (-> arg3 param 0)) - (the-as (state handle attack-info target) target-flut-hit) + target-flut-hit ) ) (else @@ -516,10 +420,8 @@ ;; failed to figure out what this is: (defstate target-flut-start (target) - :event - target-flut-standard-event-handler - :exit - (behavior () + :event target-flut-standard-event-handler + :exit (behavior () (when (not (or (= (-> self next-state name) 'target-flut-stance) (= (-> self next-state name) 'target-flut-walk) (= (-> self next-state name) 'target-flut-jump) @@ -546,23 +448,22 @@ ) (logclear! (-> self control root-prim prim-core action) (collide-action ca-14)) (set! (-> self control unknown-surface00) *walk-mods*) - (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) - (target-collide-set! 'normal (-> (new 'static 'array float 1 0.0) 0)) + (target-collide-set! 'normal (the-as float 0.0)) (set! (-> self control reaction) target-collision-reaction) (set! (-> self control unknown-vector12 quad) (the-as uint128 0)) - (clear-pending-settings-from-process *setting-control* self 'sound-flava) + (remove-setting! 'sound-flava) (target-exit) ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (target-exit) (set! *display-profile* #f) (set! *display-entity-errors* #f) - (set-setting! *setting-control* self 'sound-flava #f (the-as float 30.0) 2) + (set-setting! 'sound-flava #f 30.0 (music-flava flutflut)) (if (zero? (-> self flut)) (set! (-> self flut) (new 'process 'flut-info)) ) @@ -574,31 +475,15 @@ (set! (-> self flut entity) (-> v1-11 entity)) ) ) - (target-collide-set! 'flut (-> (new 'static 'array float 1 0.0) 0)) + (target-collide-set! 'flut (the-as float 0.0)) (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self control unknown-float01) 0.0) (logior! (-> self control root-prim prim-core action) (collide-action ca-14)) (let ((s5-0 (-> self entity))) - (set! (-> self entity) (the-as entity (-> self flut entity))) - (let ((s4-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self manipy) - (the-as (pointer manipy) (when s4-0 - (let ((t9-6 (method-of-type manipy activate))) - (t9-6 (the-as manipy s4-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-0 - manipy-init - (-> self control trans) - (-> self entity) - *flutflut-sg* - 'collide-shape-moving - ) - (-> s4-0 ppointer) - ) - ) - ) - ) + (set! (-> self entity) (-> self flut entity)) + (set! (-> self manipy) + (manipy-spawn (-> self control trans) (-> self entity) *flutflut-sg* 'collide-shape-moving :to self) + ) (set! (-> self entity) s5-0) ) (when (-> self manipy) @@ -634,12 +519,7 @@ ) ) (send-event (ppointer->process (-> self manipy)) 'anim-mode 'loop) - (send-event - (ppointer->process (-> self manipy)) - 'art-joint-anim - "flut-get-on" - (-> (new 'static 'array float 1 0.0) 0) - ) + (send-event (ppointer->process (-> self manipy)) 'art-joint-anim "flut-get-on" 0.0) (send-event (ppointer->process (-> self manipy)) 'blend-shape #t) (send-event (ppointer->process (-> self manipy)) @@ -661,23 +541,18 @@ (go target-flut-get-on arg0) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-flut-stance (target) - :event - target-flut-standard-event-handler - :enter - (behavior () + :event target-flut-standard-event-handler + :enter (behavior () (set! (-> self control unknown-surface00) *flut-walk-mods*) (none) ) - :exit - (-> target-flut-start exit) - :trans - (behavior () + :exit (-> target-flut-start exit) + :trans (behavior () (if (move-legs?) (go target-flut-walk) ) @@ -695,14 +570,10 @@ (if (can-hands? #t) (go target-flut-running-attack) ) - (if (and (zero? (logand (-> self control status) 1)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-37 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-37 (ja-group))) (or (not (or (= v1-37 (-> self draw art-group data 59)) (= v1-37 (-> self draw art-group data 60)) (= v1-37 (-> self draw art-group data 61)) @@ -717,127 +588,67 @@ ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 22)) - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-2 (ja-group))) (cond ((or (= v1-2 (-> self draw art-group data 141)) (= v1-2 (-> self draw art-group data 161))) (set! gp-0 60) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 155) - ) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 155)) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 158) - ) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 159))) - (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 159)) data 0 length) -1)) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 159)) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 158)) + (ja-no-eval :group! (-> self draw art-group data 159) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 150) - ) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 151))) - (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 151)) data 0 length) -1)) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 151)) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 150)) + (ja-no-eval :group! (-> self draw art-group data 151) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) ) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 140) - ) - ) - (ja-channel-push! 1 gp-0) + (if (not (ja-group? (-> self draw art-group data 140))) + (ja-channel-push! 1 (the-as time-frame gp-0)) ) ) - (let ((v1-91 (-> self skel root-channel 0))) - (set! (-> v1-91 frame-group) (the-as art-joint-anim (-> self draw art-group data 140))) - ) - (while #t + (ja :group! (-> self draw art-group data 140)) + (loop (suspend) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 param 0) 1.0) - (joint-control-channel-group-eval! a0-35 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - target-flut-post + :post target-flut-post ) ;; failed to figure out what this is: (defstate target-flut-walk (target) - :event - target-flut-standard-event-handler - :enter - (behavior () + :event target-flut-standard-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *flut-walk-mods*) (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-surface00 turnv))) (set! (-> self control unknown-int21) (the-as int (-> self control unknown-surface00 target-speed))) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control unknown-surface00 turnv) (the-as float (-> self control unknown-uint20))) (set! (-> self control unknown-surface00 target-speed) (the-as float (-> self control unknown-uint30))) ((-> target-flut-start exit)) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (move-legs?)) (go target-flut-stance) ) @@ -855,14 +666,10 @@ (if (can-hands? #t) (go target-flut-running-attack) ) - (if (and (zero? (logand (-> self control status) 1)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-37 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-37 (ja-group))) (or (not (or (= v1-37 (-> self draw art-group data 59)) (= v1-37 (-> self draw art-group data 60)) (= v1-37 (-> self draw art-group data 61)) @@ -880,117 +687,76 @@ (the-as float (-> self control unknown-uint20)) (* 4.0 (the-as float (-> self control unknown-uint20))) f30-1 - (-> (new 'static 'array float 1 8192.0) 0) + (the-as float 8192.0) (the-as float 21845.334) ) ) - (if (and (= (-> self control surf name) '*tar-surface*) (< (-> (new 'static 'array float 1 8192.0) 0) f30-1)) - (set! (-> self control unknown-surface00 target-speed) (seek - (-> self control unknown-surface00 target-speed) - (the-as float 4096.0) - (* 245760.0 (-> *display* seconds-per-frame)) - ) - ) - (set! (-> self control unknown-surface00 target-speed) (seek - (-> self control unknown-surface00 target-speed) - (the-as float (-> self control unknown-uint30)) - (* 81920.0 (-> *display* seconds-per-frame)) - ) - ) + (if (and (= (-> self control surf name) '*tar-surface*) (< 8192.0 f30-1)) + (seek! + (-> self control unknown-surface00 target-speed) + (the-as float 4096.0) + (* 245760.0 (-> *display* seconds-per-frame)) + ) + (seek! + (-> self control unknown-surface00 target-speed) + (the-as float (-> self control unknown-uint30)) + (* 81920.0 (-> *display* seconds-per-frame)) + ) ) ) (none) ) - :code - (behavior () + :code (behavior () (let ((f28-0 0.0) (f30-0 0.0) ) (let ((gp-0 22)) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 140) - ) + ((ja-group? (-> self draw art-group data 140)) (set! gp-0 60) ) - ((let ((v1-9 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + ((let ((v1-9 (ja-group))) (or (= v1-9 (-> self draw art-group data 143)) (= v1-9 (-> self draw art-group data 144)) (= v1-9 (-> self draw art-group data 152)) (= v1-9 (-> self draw art-group data 154)) ) ) - (ja-channel-push! 1 24) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 161))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 161)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 161)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 161) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (set! f30-0 (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 161) - ) + ((ja-group? (-> self draw art-group data 161)) (ja-channel-set! 2) 1.0 ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 141) - ) + ((ja-group? (-> self draw art-group data 141)) (set! f28-0 (ja-frame-num 0)) (-> self skel root-channel 1 frame-interp) ) (else - (ja-channel-push! 2 gp-0) + (ja-channel-push! 2 (the-as time-frame gp-0)) f30-0 ) ) ) ) - (let ((a0-32 (-> self skel root-channel 0))) - (set! (-> a0-32 dist) 49152.0) - (set! (-> a0-32 frame-group) (the-as art-joint-anim (-> self draw art-group data 141))) - (set! (-> a0-32 param 0) 1.0) - (set! (-> a0-32 frame-num) f28-0) - (joint-control-channel-group! a0-32 (the-as art-joint-anim (-> self draw art-group data 141)) num-func-loop!) - ) - (let ((gp-1 (-> self skel root-channel 1))) - (set! (-> gp-1 frame-interp) f30-0) - (set! (-> gp-1 dist) 40960.0) - (joint-control-channel-group! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 142)) - num-func-identity - ) - (set! (-> gp-1 frame-num) (* 0.5 f28-0)) - ) - (while #t + (ja-no-eval :group! (-> self draw art-group data 141) :num! (loop!) :dist 49152.0 :frame-num f28-0) + (ja-no-eval :chan 1 + :group! (-> self draw art-group data 142) + :num! (identity (* 0.5 f28-0)) + :frame-interp f30-0 + :dist 40960.0 + ) + (loop (suspend) (let ((f0-13 (lerp-scale - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (the-as float 1.0) (-> self control unknown-float01) (the-as float 49152.0) @@ -1001,21 +767,15 @@ (set! f30-0 (seek f30-0 f0-13 (* 4.0 (-> *display* seconds-per-frame)))) ) (set! (-> self skel root-channel 1 frame-interp) f30-0) - (let* ((f0-16 (dummy-9 (-> self skel))) + (let* ((f0-16 (current-cycle-distance (-> self skel))) (f0-18 (/ (* 58.0 (-> self control unknown-float01)) (* 60.0 f0-16))) ) (if (= (-> self control surf name) '*tar-surface*) (set! f0-18 (* 0.4 (-> self control unknown-float12))) ) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) f0-18) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-loop!) - ) - ) - (let ((gp-2 (-> self skel root-channel 1))) - (set! (-> gp-2 num-func) num-func-identity) - (set! (-> gp-2 frame-num) (* 0.5 (ja-frame-num 0))) + (ja :num! (loop! f0-18)) ) + (ja :chan 1 :num-func num-func-identity :frame-num (* 0.5 (ja-frame-num 0))) (let ((f0-22 (ja-aframe-num 0))) (cond ((and (>= (-> self skel effect last-frame-num) 20.0) (< f0-22 20.0)) @@ -1030,14 +790,12 @@ ) (none) ) - :post - target-flut-post + :post target-flut-post ) ;; failed to figure out what this is: (defstate target-flut-jump (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (and (= arg2 'touched) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) @@ -1070,12 +828,11 @@ ) ) ) - :enter - (behavior ((arg0 float) (arg1 float)) + :enter (behavior ((arg0 float) (arg1 float)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 -762 0 1 #t) + (sound-play "jump" :pitch -0.5) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flut-jump-mods*) (set! (-> self control unknown-float123) (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float01))))) @@ -1085,27 +842,25 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (target-exit) ((-> target-flut-start exit)) (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self control unknown-float123) (fmax (-> self control unknown-float123) (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) ) ) - (if (logtest? (-> self control status) 1) + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-flut-hit-ground) ) (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 40960.0) - (and (zero? (logand (-> self water flags) 512)) - (zero? (logand (-> self state-flags) 2048)) + (and (zero? (logand (-> self water flags) (water-flags wt09))) + (zero? (logand (-> self state-flags) (state-flags prevent-jump))) (< 4096.0 (target-height-above-ground)) ) ) @@ -1117,8 +872,9 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) + (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) @@ -1130,58 +886,34 @@ ) #t ) - (logior! (-> self control status) 1) + (logior! (-> self control status) (cshape-moving-flags onsurf)) enter-state 'stuck (go target-flut-hit-ground) ) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) - (set! (-> self control unknown-float122) - (seek - (-> self control unknown-float122) - (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) - ) - ) + (seek! + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (ja-channel-push! 2 36) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 143)) - num-func-identity + :code (behavior ((arg0 float) (arg1 float)) + (ja-channel-push! 2 (seconds 0.12)) + (ja :group! (-> self draw art-group data 143) :num! min) + (ja :chan 1 + :group! (-> self draw art-group data 146) + :num! (chan 0) + :frame-interp (-> self control unknown-float122) ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-3 (-> self skel root-channel 1))) - (set! (-> a0-3 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 146))) - (set! (-> a0-3 param 0) 0.0) - (joint-control-channel-group-eval! - a0-3 - (the-as art-joint-anim (-> self draw art-group data 146)) - num-func-chan - ) - ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 143))) - (set! (-> a0-4 param 0) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim (-> self draw art-group data 143)) num-func-+!) - ) - (let ((a0-5 (-> self skel root-channel 1))) - (set! (-> a0-5 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 146))) - (set! (-> a0-5 param 0) 0.0) - (joint-control-channel-group-eval! - a0-5 - (the-as art-joint-anim (-> self draw art-group data 146)) - num-func-chan + (ja :group! (-> self draw art-group data 143) :num! (+!)) + (ja :chan 1 + :group! (-> self draw art-group data 146) + :num! (chan 0) + :frame-interp (-> self control unknown-float122) ) - ) (suspend) (until (ja-done? 0) (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -1202,82 +934,50 @@ ) (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) ) - (let ((a0-12 (-> self skel root-channel 1))) - (set! (-> a0-12 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-12 param 0) 0.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) (suspend) ) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) - (set! (-> a0-14 param 0) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 144)) num-func-loop!) - ) - (let ((a0-15 (-> self skel root-channel 1))) - (set! (-> a0-15 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 147))) - (set! (-> a0-15 param 0) 0.0) - (joint-control-channel-group-eval! - a0-15 - (the-as art-joint-anim (-> self draw art-group data 147)) - num-func-chan + (ja-no-eval :group! (-> self draw art-group data 144) :num! (loop!) :frame-num 0.0) + (ja :chan 1 + :group! (-> self draw art-group data 147) + :num! (chan 0) + :frame-interp (-> self control unknown-float122) ) - ) - (while #t + (loop (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) - (set! (-> a0-16 param 0) 1.0) - (joint-control-channel-group-eval! - a0-16 - (the-as art-joint-anim (-> self draw art-group data 144)) - num-func-loop! + (ja :group! (-> self draw art-group data 144) :num! (loop!)) + (ja :chan 1 + :group! (-> self draw art-group data 147) + :num! (chan 0) + :frame-interp (-> self control unknown-float122) ) - ) - (let ((a0-17 (-> self skel root-channel 1))) - (set! (-> a0-17 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 147))) - (set! (-> a0-17 param 0) 0.0) - (joint-control-channel-group-eval! - a0-17 - (the-as art-joint-anim (-> self draw art-group data 147)) - num-func-chan - ) - ) ) (none) ) - :post - target-flut-post + :post target-flut-post ) ;; failed to figure out what this is: (defstate target-flut-double-jump (target) - :event - (-> target-flut-jump event) - :enter - (behavior ((arg0 float) (arg1 float)) + :event (-> target-flut-jump event) + :enter (behavior ((arg0 float) (arg1 float)) (set! (-> self state-time) (-> *display* base-frame-counter)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (set! (-> self control dynam gravity-max) 40960.0) (set! (-> self control dynam gravity-length) 245760.0) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flut-double-jump-mods*) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (target-exit) ((-> target-flut-start exit)) (none) ) - :trans - (behavior () - (if (logtest? (-> self control status) 1) + :trans (behavior () + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-flut-hit-ground) ) (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) @@ -1287,8 +987,9 @@ ) (pad-buttons square) ) - (and (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) + (and (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) @@ -1300,143 +1001,86 @@ (if (!= (-> self state-time) (-> *display* base-frame-counter)) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) ) - (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 149) - ) - (sound-play-by-name (static-sound-name "flut-flap") (-> self flut flap-sound-id) 1024 0 0 1 #t) + (if (ja-group? (-> self draw art-group data 149)) + (sound-play "flut-flap" :id (-> self flut flap-sound-id)) ) - (set! (-> self control unknown-float122) - (seek - (-> self control unknown-float122) - (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) - ) - ) + (seek! + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (ja-channel-push! 1 15) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 149))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 149)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 149)) num-func-seek!) - ) + :code (behavior ((arg0 float) (arg1 float)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 149) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 3 (seconds 0.1)) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self control unknown-surface00) *flut-jump-mods*) (dotimes (gp-0 1) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 149))) - (set! (-> s5-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 149)) data 0 length) -1)) - ) - (set! (-> s5-0 param 1) 1.0) - (set! (-> s5-0 frame-num) (ja-aframe (the-as float 14.0) 0)) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 149)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 149) + :num! (seek!) + :frame-num (ja-aframe (the-as float 14.0) 0) + ) (until (ja-done? 0) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 3 (seconds 0.1)) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (while (< (-> (new 'static 'array float 1 8192.0) 0) (target-height-above-ground)) + (while (< 8192.0 (target-height-above-ground)) (suspend) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 3 (seconds 0.1)) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-loop!) - ) - (when (< (ja-aframe-num 0) 14.0) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 num-func) num-func-identity) - (set! (-> gp-1 frame-num) (ja-aframe (the-as float 14.0) 0)) + (ja :num! (loop!)) + (if (< (ja-aframe-num 0) 14.0) + (ja :num-func num-func-identity :frame-num (ja-aframe (the-as float 14.0) 0)) ) + (seek! + (-> self control dynam gravity-max) + (-> self control unknown-dynamics00 gravity-max) + (* 163840.0 (-> *display* seconds-per-frame)) + ) + (seek! + (-> self control dynam gravity-length) + (-> self control unknown-dynamics00 gravity-length) + (* 163840.0 (-> *display* seconds-per-frame)) ) - (set! (-> self control dynam gravity-max) (seek - (-> self control dynam gravity-max) - (-> self control unknown-dynamics00 gravity-max) - (* 163840.0 (-> *display* seconds-per-frame)) - ) - ) - (set! (-> self control dynam gravity-length) (seek - (-> self control dynam gravity-length) - (-> self control unknown-dynamics00 gravity-length) - (* 163840.0 (-> *display* seconds-per-frame)) - ) - ) ) (-> *display* base-frame-counter) - (ja-channel-push! 2 30) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) - (set! (-> a0-19 param 0) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 144)) num-func-loop!) - ) - (let ((gp-2 (-> self skel root-channel 1))) - (set! (-> gp-2 frame-interp) (-> self control unknown-float122)) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 147)) - num-func-identity + (ja-channel-push! 2 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 144) :num! (loop!) :frame-num 0.0) + (ja :chan 1 + :group! (-> self draw art-group data 147) + :num! min + :frame-interp (-> self control unknown-float122) ) - (set! (-> gp-2 frame-num) 0.0) - ) - (while #t + (loop (suspend) - (set! (-> self control dynam gravity-max) (seek - (-> self control dynam gravity-max) - (-> self control unknown-dynamics00 gravity-max) - (* 163840.0 (-> *display* seconds-per-frame)) - ) - ) - (set! (-> self control dynam gravity-length) (seek - (-> self control dynam gravity-length) - (-> self control unknown-dynamics00 gravity-length) - (* 163840.0 (-> *display* seconds-per-frame)) - ) - ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-loop!) + (seek! + (-> self control dynam gravity-max) + (-> self control unknown-dynamics00 gravity-max) + (* 163840.0 (-> *display* seconds-per-frame)) ) - (let ((a0-24 (-> self skel root-channel 1))) - (set! (-> a0-24 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-24 param 0) 0.0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-chan) + (seek! + (-> self control dynam gravity-length) + (-> self control unknown-dynamics00 gravity-length) + (* 163840.0 (-> *display* seconds-per-frame)) ) + (ja :num! (loop! max)) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) ) (none) ) - :post - target-flut-post + :post target-flut-post ) ;; failed to figure out what this is: (defstate target-flut-hit-ground (target) - :event - target-flut-standard-event-handler - :enter - (behavior () + :event target-flut-standard-event-handler + :enter (behavior () (target-land-effect) (if (< 40960.0 (-> self control ground-impact-vel)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.2)) @@ -1446,10 +1090,8 @@ (set! (-> self control unknown-surface00) *flut-walk-mods*) (none) ) - :exit - (-> target-flut-start exit) - :trans - (behavior () + :exit (-> target-flut-start exit) + :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) ) @@ -1464,14 +1106,10 @@ (if (move-legs?) (go target-flut-walk) ) - (if (and (zero? (logand (-> self control status) 1)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-34 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-34 (ja-group))) (or (not (or (= v1-34 (-> self draw art-group data 59)) (= v1-34 (-> self draw art-group data 60)) (= v1-34 (-> self draw art-group data 61)) @@ -1486,33 +1124,27 @@ ) (none) ) - :code - (behavior () + :code (behavior () (let ((t9-0 target-flut-hit-ground-anim)) (t9-0) ) (go target-flut-stance) (none) ) - :post - target-flut-post + :post target-flut-post ) ;; failed to figure out what this is: (defstate target-flut-falling (target) - :event - (-> target-flut-jump event) - :enter - (behavior ((arg0 symbol)) + :event (-> target-flut-jump event) + :enter (behavior ((arg0 symbol)) (set! (-> self control unknown-surface00) *flut-jump-mods*) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (-> target-flut-start exit) - :trans - (behavior () - (when (or (logtest? (-> self control status) 1) + :exit (-> target-flut-start exit) + :trans (behavior () + (when (or (logtest? (-> self control status) (cshape-moving-flags onsurf)) (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (/ (the-as int (-> *TARGET-bank* stuck-time)) 2) @@ -1523,75 +1155,46 @@ #t ) ) - (logior! (-> self control status) 1) + (logior! (-> self control status) (cshape-moving-flags onsurf)) (go target-flut-hit-ground) ) - (set! (-> self control unknown-float122) - (seek - (-> self control unknown-float122) - (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) - ) - ) + (seek! + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 144) - ) + ((ja-group? (-> self draw art-group data 144)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 149) - ) - (ja-channel-push! 2 60) + ((ja-group? (-> self draw art-group data 149)) + (ja-channel-push! 2 (seconds 0.2)) ) (else - (ja-channel-push! 2 150) + (ja-channel-push! 2 (seconds 0.5)) ) ) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) - (set! (-> a0-11 param 0) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 144)) num-func-loop!) - ) - (let ((gp-0 (-> self skel root-channel 1))) - (set! (-> gp-0 frame-interp) (-> self control unknown-float122)) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 147)) - num-func-identity + (ja-no-eval :group! (-> self draw art-group data 144) :num! (loop!) :frame-num 0.0) + (ja :chan 1 + :group! (-> self draw art-group data 147) + :num! min + :frame-interp (-> self control unknown-float122) ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (loop (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((a0-14 (-> self skel root-channel 1))) - (set! (-> a0-14 frame-interp) (-> self control unknown-float122)) - (set! (-> a0-14 param 0) 0.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (loop! max)) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) ) (none) ) - :post - target-flut-post + :post target-flut-post ) ;; failed to figure out what this is: (defstate target-flut-running-attack (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touched) (cond @@ -1652,8 +1255,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-uint20) (the-as uint 0)) (set! (-> self control unknown-int21) 0) @@ -1674,33 +1276,25 @@ (set! (-> gp-0 y) 0.0) (vector-normalize! gp-0 (+ 81920.0 (-> *TARGET-bank* yellow-projectile-speed))) (vector+! gp-0 gp-0 (-> self control transv)) - (let ((s4-0 (get-process *default-dead-pool* projectile-yellow #x4000))) - (when s4-0 - (let ((t9-6 (method-of-type projectile-yellow activate))) - (t9-6 (the-as projectile-yellow s4-0) self 'projectile-yellow (the-as pointer #x70004000)) + (process-spawn + projectile-yellow + :init projectile-init-by-other + (-> self entity) + s5-0 + gp-0 + (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + 281 + 265 ) - (run-now-in-process - s4-0 - projectile-init-by-other - (-> self entity) - s5-0 - gp-0 - (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) - 281 - 265 - ) - #f - ) - (-> s4-0 ppointer) - ) + #f + :to self ) ) (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) ) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> *run-attack-mods* turnv) 0.0) @@ -1709,11 +1303,12 @@ (target-exit) (none) ) - :trans - (behavior () + :trans (behavior () (when (!= (-> self state-time) (-> *display* base-frame-counter)) (if (and (or (smack-surface? #t) - (and (>= (-> self control unknown-float63) 0.7) (zero? (logand (-> self control status) 32))) + (and (>= (-> self control unknown-float63) 0.7) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + ) ) (begin (set! (-> self control unknown-int21) (the-as int (-> *display* base-frame-counter))) @@ -1743,14 +1338,9 @@ ) (!= (-> self control unknown-uint31) 1) ) - (target-shoved - (-> (new 'static 'array float 1 8192.0) 0) - (-> *TARGET-bank* smack-surface-height) - (the-as process #f) - target-flut-hit - ) + (target-shoved (meters 2.0) (-> *TARGET-bank* smack-surface-height) (the-as process #f) target-flut-hit) ) - (if (and (logtest? (-> self water flags) 512) + (if (and (logtest? (-> self water flags) (water-flags wt09)) (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) ) (dummy-13 @@ -1764,18 +1354,10 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 6) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 150)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.02)) + (sound-play "flut-hit") + (ja :group! (-> self draw art-group data 150) :num! min) (set! (-> self control dynam gravity-max) 368640.0) (set! (-> self control dynam gravity-length) 368640.0) (let ((f28-0 0.0) @@ -1787,24 +1369,19 @@ ) ) (until (or (ja-done? 0) (< f30-0 0.05)) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (when (not (ja-min? 0)) (cond ((and (>= (ja-aframe-num 0) 20.0) - (and (and (zero? (logand (-> self control status) 1)) + (and (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-39 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or (not - (or (= v1-39 (-> self draw art-group data 59)) - (= v1-39 (-> self draw art-group data 60)) - (= v1-39 (-> self draw art-group data 61)) - ) - ) + (let ((v1-39 (ja-group))) + (or (not (or (= v1-39 (-> self draw art-group data 59)) + (= v1-39 (-> self draw art-group data 60)) + (= v1-39 (-> self draw art-group data 61)) + ) + ) (< 4096.0 (target-height-above-ground)) ) ) @@ -1821,7 +1398,7 @@ (the-as uint 12) ) ) - (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + (set-forward-vel (the-as float 0.0)) (set! f30-0 0.0) ) ((ja-done? 0) @@ -1841,11 +1418,7 @@ (vector-matrix*! (-> self control unknown-vector120) gp-2 (-> self control unknown-matrix01)) ) (suspend) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1))) - (set! (-> a0-36 param 1) (-> self control unknown-surface01 align-speed)) - (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self control unknown-surface01 align-speed))) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (set! (-> *flut-run-attack-mods* turnvv) 0.0) ) @@ -1853,14 +1426,10 @@ (set! f30-0 (* f30-0 (the-as float (fmin 1.0 (the-as float (-> self control unknown-float140)))))) ) ) - (if (and (zero? (logand (-> self control status) 1)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-105 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-105 (ja-group))) (or (not (or (= v1-105 (-> self draw art-group data 59)) (= v1-105 (-> self draw art-group data 60)) (= v1-105 (-> self draw art-group data 61)) @@ -1875,40 +1444,26 @@ (when (!= f30-0 0.0) (set! (-> self trans-hook) (-> target-flut-hit-ground trans)) (if (not (ja-done? 0)) - (ja-channel-push! 1 15) + (ja-channel-push! 1 (seconds 0.05)) ) - (let ((a0-59 (-> self skel root-channel 0))) - (set! (-> a0-59 frame-group) (the-as art-joint-anim (-> self draw art-group data 151))) - (set! (-> a0-59 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 151)) data 0 length) -1)) - ) - (set! (-> a0-59 param 1) 1.0) - (set! (-> a0-59 frame-num) 0.0) - (joint-control-channel-group! a0-59 (the-as art-joint-anim (-> self draw art-group data 151)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 151) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) f30-0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-xz-vel) (the-as float 1.0) (the-as float 1.0) f30-0) (suspend) - (let ((a0-62 (-> self skel root-channel 0))) - (set! (-> a0-62 param 0) (the float (+ (-> a0-62 frame-group data 0 length) -1))) - (set! (-> a0-62 param 1) 1.0) - (joint-control-channel-group-eval! a0-62 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go target-flut-stance) (none) ) - :post - target-flut-post + :post target-flut-post ) ;; failed to figure out what this is: (defstate target-flut-air-attack (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (= arg2 'touched) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) @@ -1933,11 +1488,10 @@ ) ) ) - :enter - (behavior ((arg0 float)) + :enter (behavior ((arg0 float)) (set-forward-vel arg0) (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flut-air-attack-mods*) (target-start-attack) (target-danger-set! 'flut-attack #f) @@ -1959,16 +1513,14 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (target-danger-set! 'harmless #f) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) (none) ) - :trans - (behavior () + :trans (behavior () (let ((s5-0 (new-stack-vector0))) (vector-z-quaternion! s5-0 (-> self control unknown-quaternion00)) (let ((gp-0 (new-stack-vector0)) @@ -1990,8 +1542,8 @@ ) ) ) - (when (logtest? (-> self control status) 1) - (logior! (-> self control status) 1) + (when (logtest? (-> self control status) (cshape-moving-flags onsurf)) + (logior! (-> self control status) (cshape-moving-flags onsurf)) (remove-exit) (go target-flut-air-attack-hit-ground) ) @@ -2002,176 +1554,125 @@ ) #t ) - (logior! (-> self control status) 1) + (logior! (-> self control status) (cshape-moving-flags onsurf)) (go target-flut-hit-ground) ) (none) ) - :code - (behavior ((arg0 float)) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 -762 0 1 #t) - (ja-channel-push! 1 15) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 152))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 8.0) 0)) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) 0.0) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 152)) num-func-seek!) - ) + :code (behavior ((arg0 float)) + (sound-play "flut-hit" :pitch -0.5) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 152) + :num! (seek! (ja-aframe (the-as float 8.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 6 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) - (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe (the-as float 8.0) 0)) - (set! (-> gp-2 param 1) 1.0) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) + (compute-alignment! (-> self align)) + (align! + (-> self align) + (align-opts adjust-y-vel adjust-xz-vel) + (the-as float 1.0) + (the-as float 1.0) + (the-as float 1.0) ) + (suspend) + (ja :num! (seek! (ja-aframe (the-as float 8.0) 0))) ) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 152))) - (set! (-> gp-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 152)) data 0 length) -1)) - ) - (set! (-> gp-3 param 1) 1.0) - (set! (-> gp-3 frame-num) (ja-aframe (the-as float 8.0) 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 152)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 152) + :num! (seek!) + :frame-num (ja-aframe (the-as float 8.0) 0) + ) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 6 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (compute-alignment! (-> self align)) + (align! + (-> self align) + (align-opts adjust-y-vel adjust-xz-vel) + (the-as float 1.0) + (the-as float 1.0) + (the-as float 1.0) + ) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (let ((gp-4 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-4 - (the-as art-joint-anim (-> self draw art-group data 153)) - num-func-identity - ) - (set! (-> gp-4 frame-num) 0.0) - ) - (while #t + (ja :group! (-> self draw art-group data 153) :num! min) + (loop (suspend) ) (none) ) - :post - target-flut-post + :post target-flut-post ) ;; failed to figure out what this is: (defstate target-flut-air-attack-hit-ground (target) - :event - target-flut-standard-event-handler - :enter - (behavior () + :event target-flut-standard-event-handler + :enter (behavior () (target-land-effect) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.4)) (set! (-> self control unknown-dword31) 0) (set! (-> self control unknown-dword33) 0) (set! (-> self control unknown-surface00) *flut-air-attack-mods*) - (sound-play-by-name (static-sound-name "flop-land") (new-sound-id) 1024 -609 0 1 #t) + (sound-play "flop-land" :pitch -0.4) (dummy-10 (-> self skel effect) 'group-flut-attack-strike-ground (ja-frame-num 0) 0) - (let* ((s5-2 (get-process *default-dead-pool* touch-tracker #x4000)) - (gp-2 (when s5-2 - (let ((t9-7 (method-of-type touch-tracker activate))) - (t9-7 (the-as touch-tracker s5-2) self 'touch-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 touch-tracker-init (-> self control trans) 4096.0 30) - (-> s5-2 ppointer) - ) - ) - ) + (let ((gp-2 (process-spawn touch-tracker :init touch-tracker-init (-> self control trans) 4096.0 30 :to self))) (send-event (ppointer->process gp-2) 'event 'attack 'flut-attack) - (send-event - (ppointer->process gp-2) - 'function - (lambda :behavior target - ((arg0 nav-enemy)) - (set! (-> arg0 collide-info root-prim local-sphere w) (seek - (-> arg0 collide-info root-prim local-sphere w) - (the-as float 28672.0) - (* 286720.0 (-> *display* seconds-per-frame)) - ) - ) - (update-transforms! (-> arg0 collide-info)) - (none) - ) - ) + (send-event (ppointer->process gp-2) 'function (lambda :behavior target + ((arg0 nav-enemy)) + (seek! + (-> arg0 collide-info root-prim local-sphere w) + (the-as float 28672.0) + (* 286720.0 (-> *display* seconds-per-frame)) + ) + (update-transforms! (-> arg0 collide-info)) + (none) + ) + ) ) (none) ) - :exit - (-> target-flut-air-attack exit) - :trans - (-> target-flut-hit-ground trans) - :code - (behavior () + :exit (-> target-flut-air-attack exit) + :trans (-> target-flut-hit-ground trans) + :code (behavior () (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 154))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 22.0) 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 154)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 154) + :num! (seek! (ja-aframe (the-as float 22.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-xz-vel) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 22.0) 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 22.0) 0))) ) (target-danger-set! 'harmless #f) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 154))) - (set! (-> gp-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 154)) data 0 length) -1)) - ) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) (ja-aframe (the-as float 22.0) 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 154)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 154) + :num! (seek!) + :frame-num (ja-aframe (the-as float 22.0) 0) + ) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) - (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-xz-vel) (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go target-flut-stance) (none) ) - :post - target-flut-post + :post target-flut-post ) ;; failed to figure out what this is: (defstate target-flut-hit (target) - :event - target-flut-standard-event-handler - :exit - (behavior () + :event target-flut-standard-event-handler + :exit (behavior () (if (!= (-> self next-state name) 'target-flut-death) - (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags being-attacked dying)) ) (target-exit) ((-> target-flut-start exit)) (none) ) - :trans - (behavior () + :trans (behavior () (when (= *cheat-mode* 'debug) (when (and (not *pause-lock*) (cpad-hold? (-> self control unknown-cpad-info00 number) r2)) (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) @@ -2180,8 +1681,7 @@ ) (none) ) - :code - (behavior ((arg0 symbol) (arg1 attack-info)) + :code (behavior ((arg0 symbol) (arg1 attack-info)) (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 (-> self attack-info))) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -2205,7 +1705,7 @@ ) ) (combine! gp-0 arg1) - (when (zero? (logand (-> gp-0 mask) 2)) + (when (zero? (logand (-> gp-0 mask) (attack-mask vector))) (vector-z-quaternion! (-> gp-0 vector) (-> self control unknown-quaternion00)) (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) (set! (-> gp-0 vector y) (-> gp-0 shove-up)) @@ -2226,7 +1726,7 @@ ) ) (when (= arg0 'attack) - (logior! (-> self state-flags) 8) + (logior! (-> self state-flags) (state-flags being-attacked)) (set! (-> self game hit-time) (-> *display* base-frame-counter)) (case (-> gp-0 mode) (('endlessfall) @@ -2286,47 +1786,23 @@ ) ) (target-hit-effect gp-0) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 -1524 0 1 #t) + (sound-play "flut-hit" :pitch -1) ) (set! (-> self control unknown-surface00) *smack-mods*) (let ((f30-0 1.0)) (case (-> gp-0 angle) (('shove) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 158) - ) - ) + (when (not (ja-group? (-> self draw art-group data 158))) (ja-channel-set! 1) - (let ((s4-3 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-3 - (the-as art-joint-anim (-> self draw art-group data 158)) - num-func-identity - ) - (set! (-> s4-3 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 158) :num! min) ) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 1524 0 1 #t) + (sound-play "smack-surface") + (sound-play "flut-hit" :pitch 1) ) (else - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 157) - ) - ) - (ja-channel-push! 1 22) - (let ((s4-6 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-6 - (the-as art-joint-anim (-> self draw art-group data 157)) - num-func-identity - ) - (set! (-> s4-6 frame-num) 0.0) - ) + (when (not (ja-group? (-> self draw art-group data 157))) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! (-> self draw art-group data 157) :num! min) ) ) ) @@ -2340,42 +1816,37 @@ (go target-flut-hit-ground) (none) ) - :post - target-flut-post + :post target-flut-post ) ;; failed to figure out what this is: (defstate target-flut-death (target) - :event - (-> target-death event) - :exit - (behavior () - (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + :event (-> target-death event) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags being-attacked dying)) (target-exit) - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (copy-settings-from-target! *setting-control*) + (remove-setting! 'process-mask) + (apply-settings *setting-control*) (none) ) - :trans - (-> target-hit trans) - :code - (behavior ((arg0 symbol)) + :trans (-> target-hit trans) + :code (behavior ((arg0 symbol)) (local-vars (v1-104 symbol)) - (logior! (-> self state-flags) #x8000) + (logior! (-> self state-flags) (state-flags dying)) (set! (-> self neck flex-blend) 0.0) (target-timed-invulnerable-off self) - (push-setting! *setting-control* self 'process-mask 'set (-> (new 'static 'array float 1 0.0) 0) #x14a0000) - (copy-settings-from-target! *setting-control*) + (add-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) + (apply-settings *setting-control*) (set! (-> self control transv quad) (the-as uint128 0)) (cond ((or (= arg0 'none) (= arg0 'water-vol) (= arg0 'sharkey)) ) ((= arg0 'endlessfall) - (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 716 -2133 0 1 #t) + (sound-play "death-fall") + (sound-play "flut-hit" :vol 70 :pitch -1.4) (camera-change-to (the-as string cam-endlessfall) 30 #f) (set! (-> self control pat-ignore-mask unknown-bit) 1) - (set! (-> self water flags) (logand -17 (-> self water flags))) + (logclear! (-> self water flags) (water-flags wt04)) (let ((f30-0 (fmin -4096.0 (- (-> self control ground-impact-vel))))) (set! (-> self control unknown-uint20) (the-as uint f30-0)) (let ((gp-3 (new-stack-vector0))) @@ -2428,30 +1899,18 @@ ) (else (set! (-> self control unknown-surface00) *neutral-mods*) - (ja-channel-push! 1 30) - (let ((a0-33 (-> self skel root-channel 0))) - (set! (-> a0-33 frame-group) (the-as art-joint-anim (-> self draw art-group data 160))) - (set! (-> a0-33 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 160)) data 0 length) -1)) - ) - (set! (-> a0-33 param 1) 1.0) - (set! (-> a0-33 frame-num) 0.0) - (joint-control-channel-group! a0-33 (the-as art-joint-anim (-> self draw art-group data 160)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 160) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (let ((gp-5 (new 'stack-no-clear 'vector))) - (when (zero? (logand (-> self align flags) 1)) + (when (zero? (logand (-> self align flags) (align-flags disabled))) (vector-matrix*! gp-5 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (vector-float*! (-> self control transv) gp-5 (-> *display* frames-per-second)) ) ) (suspend) - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 param 0) (the float (+ (-> a0-37 frame-group data 0 length) -1))) - (set! (-> a0-37 param 1) 1.0) - (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -2465,21 +1924,17 @@ (go target-flut-stance) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-flut-get-on (target) - :event - target-generic-event-handler - :exit - (-> target-flut-start exit) - :code - (behavior ((arg0 handle)) + :event target-generic-event-handler + :exit (-> target-flut-start exit) + :code (behavior ((arg0 handle)) (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self alt-cam-pos quad) (-> (&-> (-> self control) unknown-qword00) 0)) - (logior! (-> self state-flags) 1024) + (logior! (-> self state-flags) (state-flags use-alt-cam-pos)) (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control trans quad)) @@ -2508,15 +1963,12 @@ ) ) (let ((gp-1 #f)) - (sound-play-by-name (static-sound-name "uppercut") (new-sound-id) 1024 0 0 1 #t) - (ja-channel-push! 1 15) - (let ((s5-2 (-> self skel root-channel 0))) - (set! (-> s5-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 155))) - (set! (-> s5-2 param 0) (ja-aframe (the-as float 24.0) 0)) - (set! (-> s5-2 param 1) 1.0) - (set! (-> s5-2 frame-num) 0.0) - (joint-control-channel-group! s5-2 (the-as art-joint-anim (-> self draw art-group data 155)) num-func-seek!) - ) + (sound-play "uppercut") + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 155) + :num! (seek! (ja-aframe (the-as float 24.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (when (and (not gp-1) (= (-> self skel root-channel 0) (-> self skel channel))) (send-event (ppointer->process (-> self manipy)) 'anim-mode 'clone-anim) @@ -2524,23 +1976,18 @@ ) (set! (-> self control transv quad) (the-as uint128 0)) (suspend) - (let ((s5-3 (-> self skel root-channel 0))) - (set! (-> s5-3 param 0) (ja-aframe (the-as float 24.0) 0)) - (set! (-> s5-3 param 1) 1.0) - (joint-control-channel-group-eval! s5-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 24.0) 0))) ) ) - (sound-play-by-name (static-sound-name "flut-coo") (new-sound-id) 1024 0 0 1 #t) - (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + (sound-play "flut-coo") + (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) (set! (-> self control transv quad) (the-as uint128 0)) (quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00)) (rot->dir-targ! (-> self control)) (go target-flut-stance) (none) ) - :post - (behavior () + :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (f30-0 (fmin 1.0 (* 0.0044444446 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) ) @@ -2573,15 +2020,12 @@ ;; failed to figure out what this is: (defstate target-flut-get-off (target) - :event - target-generic-event-handler - :exit - (-> target-flut-start exit) - :code - (behavior ((arg0 handle)) - (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + :event target-generic-event-handler + :exit (-> target-flut-start exit) + :code (behavior ((arg0 handle)) + (set-forward-vel (the-as float 0.0)) (let ((s5-0 0)) - (while (zero? (logand (-> self control status) 1)) + (while (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (target-flut-falling-anim-trans) (+! s5-0 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) (suspend) @@ -2590,8 +2034,7 @@ (go target-flut-get-off-jump arg0) (none) ) - :post - (behavior () + :post (behavior () (target-no-stick-post) (target-flut-post-post) (none) @@ -2600,12 +2043,9 @@ ;; failed to figure out what this is: (defstate target-flut-get-off-jump (target) - :event - target-generic-event-handler - :exit - (-> target-flut-start exit) - :code - (behavior ((arg0 handle)) + :event target-generic-event-handler + :exit (-> target-flut-start exit) + :code (behavior ((arg0 handle)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control transv quad) (the-as uint128 0)) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -2637,24 +2077,12 @@ (set! (-> self control unknown-vector102 quad) (-> gp-0 quad)) (set! (-> self control unknown-vector103 quad) (-> s4-0 quad)) ) - (sound-play-by-name (static-sound-name "flut-coo") (new-sound-id) 921 -762 0 1 #t) - (ja-channel-push! 1 15) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 156))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 156)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) 1.0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 156)) num-func-seek!) - ) + (sound-play "flut-coo" :vol 90 :pitch -0.5) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 156) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) 1.0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event (handle->process arg0) 'draw) (set-yaw-angle-clear-roll-pitch! @@ -2672,8 +2100,7 @@ (go target-flut-get-off-hit-ground #f) (none) ) - :post - (behavior () + :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (f30-0 (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) @@ -2712,47 +2139,32 @@ ;; failed to figure out what this is: (defstate target-flut-get-off-hit-ground (target) - :event - target-standard-event-handler - :enter - (-> target-hit-ground enter) - :trans - (behavior () - (logior! (-> self control status) 7) + :event target-standard-event-handler + :enter (-> target-hit-ground enter) + :trans (behavior () + (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) ((-> target-hit-ground trans)) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe (the-as float 42.0) 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 35) + :num! (seek!) + :frame-num (ja-aframe (the-as float 42.0) 0) + ) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go target-stance) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-flut-grab (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) (-> self state name) @@ -2772,24 +2184,20 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self control unknown-surface00) *grab-mods*) (set! (-> self neck flex-blend) 0.0) - (logior! (-> self state-flags) 272) + (logior! (-> self state-flags) (state-flags invulnerable grabbed)) (none) ) - :exit - (behavior () - (set! (-> self state-flags) (logand -273 (-> self state-flags))) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags invulnerable grabbed)) (target-exit) ((-> target-flut-start exit)) (none) ) - :code - (-> target-flut-stance code) - :post - (behavior () + :code (-> target-flut-stance code) + :post (behavior () (target-no-stick-post) (target-flut-post-post) (none) @@ -2798,31 +2206,26 @@ ;; failed to figure out what this is: (defstate target-flut-clone-anim (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (= arg2 'trans) (= (-> arg3 param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) ((-> target-flut-grab event) arg0 arg1 arg2 arg3) ) - :enter - (-> target-clone-anim enter) - :exit - (behavior () + :enter (-> target-clone-anim enter) + :exit (behavior () (send-event (ppointer->process (-> self sidekick)) 'matrix #f) ((-> target-clone-anim exit)) ((-> target-flut-start exit)) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) (clone-anim arg0 33 #t "") (go target-flut-stance) (none) ) - :post - (behavior () + :post (behavior () (target-no-ja-move-post) (target-flut-post-post) (none) diff --git a/test/decompiler/reference/levels/intro/evilbro_REF.gc b/test/decompiler/reference/levels/intro/evilbro_REF.gc index 08fbbf57ae..ee12c1a4be 100644 --- a/test/decompiler/reference/levels/intro/evilbro_REF.gc +++ b/test/decompiler/reference/levels/intro/evilbro_REF.gc @@ -1,9 +1,12 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/evilbro-ag.gc") +(import "goal_src/import/evilsis-ag.gc") + ;; definition of type evilbro (deftype evilbro (process-taskable) - ((evilsis entity :offset-assert 380) + ((evilsis entity-actor :offset-assert 380) ) :heap-base #x110 :method-count-assert 53 @@ -21,14 +24,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *evilbro-intro-sg* evilbro - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *evilbro-intro-sg* evilbro evilbro-lod0-jg evilbro-idle-ja + ((evilbro-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow evilbro-shadow-mg + ) ;; definition for method 32 of type evilbro ;; INFO: Return type mismatch spool-anim vs basic. @@ -53,8 +53,7 @@ ;; failed to figure out what this is: (defstate play-anim (evilbro) :virtual #t - :exit - (behavior () + :exit (behavior () (send-event (-> self evilsis extra process) 'end-mode) ((-> (method-of-type process-taskable play-anim) exit)) (none) @@ -64,79 +63,39 @@ ;; failed to figure out what this is: (defstate idle (evilbro) :virtual #t - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) - ) - (while #t - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) ) + (loop + (ja-no-eval :group! evilbro-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-0 (-> *display* base-frame-counter))) - (while (let* ((s5-0 (-> *display* base-frame-counter)) - (f30-0 300.0) - (f28-0 0.16) - (f26-0 0.17000002) - (v1-29 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-30 (the-as number (logior #x3f800000 v1-29))) - ) - (< (- s5-0 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-30)))))))) gp-0) + (while (let ((s5-0 (-> *display* base-frame-counter)) + (f30-0 300.0) + (f28-0 0.16) + (f26-0 0.17000002) + ) + (< (- s5-0 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (rand-float-gen))))))) gp-0) ) (suspend) ) ) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> gp-1 param 0) (ja-aframe 0.0 0)) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) (ja-aframe 16.0 0)) - (joint-control-channel-group! - gp-1 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 0.0 0)) :frame-num (ja-aframe 16.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe 0.0 0)) - (set! (-> gp-2 param 1) 1.0) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 0.0 0))) ) (let ((gp-3 (-> *display* base-frame-counter))) - (while (let* ((s5-1 (-> *display* base-frame-counter)) - (f30-1 300.0) - (f28-1 0.16) - (f26-1 0.17000002) - (v1-54 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-55 (the-as number (logior #x3f800000 v1-54))) - ) - (< (- s5-1 (the-as time-frame (the int (* f30-1 (+ f28-1 (* f26-1 (+ -1.0 (the-as float v1-55)))))))) gp-3) + (while (let ((s5-1 (-> *display* base-frame-counter)) + (f30-1 300.0) + (f28-1 0.16) + (f26-1 0.17000002) + ) + (< (- s5-1 (the-as time-frame (the int (* f30-1 (+ f28-1 (* f26-1 (rand-float-gen))))))) gp-3) ) (suspend) ) @@ -173,14 +132,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *evilsis-intro-sg* evilsis - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *evilsis-intro-sg* evilsis evilsis-lod0-jg evilsis-idle-ja + ((evilsis-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow evilsis-shadow-mg + ) ;; definition for method 32 of type evilsis ;; INFO: Return type mismatch art-element vs basic. @@ -204,8 +160,7 @@ ;; failed to figure out what this is: (defstate idle (evilsis) :virtual #t - :trans - (behavior () + :trans (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) (none) diff --git a/test/decompiler/reference/levels/jungle/bouncer_REF.gc b/test/decompiler/reference/levels/jungle/bouncer_REF.gc index 8be4b45375..f478c03956 100644 --- a/test/decompiler/reference/levels/jungle/bouncer_REF.gc +++ b/test/decompiler/reference/levels/jungle/bouncer_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/bounceytarp-ag.gc") + ;; definition of type springbox (deftype springbox (process-drawable) ((spring-height meters :offset-assert 176) @@ -31,31 +33,19 @@ (method-set! springbox 12 (method-of-type process run-logic?)) ;; failed to figure out what this is: -(defskelgroup *bouncer-sg* bounceytarp - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *bouncer-sg* bounceytarp bounceytarp-lod0-jg bounceytarp-idle-ja + ((bounceytarp-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; failed to figure out what this is: (defstate bouncer-wait (springbox) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('bonk) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 3) - (set! (-> a1-3 message) 'jump) - (set! (-> a1-3 param 0) (the-as uint (-> self spring-height))) - (set! (-> a1-3 param 1) (the-as uint (-> self spring-height))) - (set! (-> a1-3 param 2) (the-as uint #f)) - (when (send-event-function arg0 a1-3) - (sound-play-by-name (static-sound-name "trampoline") (new-sound-id) 1024 0 0 1 #t) - (go bouncer-fire) - ) + (when (send-event arg0 'jump (-> self spring-height) (-> self spring-height) #f) + (sound-play "trampoline") + (go bouncer-fire) ) ) (('touch) @@ -71,18 +61,10 @@ ) ) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 2) :num! min) (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -92,8 +74,7 @@ ;; failed to figure out what this is: (defstate bouncer-smush (springbox) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -104,34 +85,24 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self smush) 0.0) - (while #t - (cond - ((>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 0.0) - (set! (-> a0-1 param 1) 0.1) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (else - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 param 0) (lerp-scale - (ja-aframe 6.0 0) - (ja-aframe 2.0 0) - (vector-vector-xz-distance (target-pos 0) (-> self root trans)) - 0.0 - 4096.0 - ) - ) - (set! (-> gp-0 param 1) 0.2) - (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-seek!) - ) + (loop + (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (ja :num! (seek! 0.0 0.1)) + (ja :num! (seek! + (lerp-scale + (ja-aframe 6.0 0) + (ja-aframe 2.0 0) + (vector-vector-xz-distance (target-pos 0) (-> self root trans)) + 0.0 + 4096.0 + ) + 0.2 + ) + ) ) - ) (suspend) (if (ja-min? 0) (go bouncer-wait) @@ -139,37 +110,22 @@ ) (none) ) - :post - (the-as (function none :behavior springbox) transform-post) + :post (the-as (function none :behavior springbox) transform-post) ) ;; failed to figure out what this is: (defstate bouncer-fire (springbox) - :code - (behavior () + :code (behavior () (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.1)) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 6.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num (ja-aframe 6.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go bouncer-wait) (none) ) - :post - (the-as (function none :behavior springbox) transform-post) + :post (the-as (function none :behavior springbox) transform-post) ) ;; definition for method 11 of type springbox diff --git a/test/decompiler/reference/levels/jungle/darkvine_REF.gc b/test/decompiler/reference/levels/jungle/darkvine_REF.gc index f50c3ffbe6..cde0b31a3e 100644 --- a/test/decompiler/reference/levels/jungle/darkvine_REF.gc +++ b/test/decompiler/reference/levels/jungle/darkvine_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/darkvine-ag.gc") + ;; definition of type darkvine (deftype darkvine (process-drawable) ((root-override collide-shape :offset 112) @@ -54,13 +56,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *darkvine-sg* darkvine - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 2 0 3.5) - :longest-edge (meters 0) - ) +(defskelgroup *darkvine-sg* darkvine darkvine-lod0-jg darkvine-idle-ja + ((darkvine-lod0-mg (meters 20)) (darkvine-lod1-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3.5) + ) ;; failed to figure out what this is: (defpartgroup group-darkvine-puffs @@ -68,14 +67,12 @@ :duration 150 :flags (use-local-clock) :bounds (static-bspherem 0 2 0 3) - :parts - ((sp-item 800) (sp-item 801) (sp-item 802)) + :parts ((sp-item 800) (sp-item 801) (sp-item 802)) ) ;; failed to figure out what this is: (defpart 800 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-x (meters 0) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -98,8 +95,7 @@ ;; failed to figure out what this is: (defpart 802 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0) (sp-rnd-flt spt-scale-x (meters 0.025) (meters 0.2) 1.0) @@ -121,8 +117,7 @@ ;; failed to figure out what this is: (defpart 801 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.4) 1.0) @@ -152,16 +147,9 @@ ((= v1-0 'touch) (do-push-aways! (-> self root-override)) (when (-> self dangerous) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'attack) - (set! (-> a1-1 param 0) (-> arg3 param 0)) - (set! (-> a1-1 param 1) (the-as uint (new 'static 'attack-info))) - (if (send-event-function arg0 a1-1) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) - ) - ) + (if (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) + ) ) ) ((= v1-0 'attack) @@ -187,36 +175,22 @@ ;; failed to figure out what this is: (defstate darkvine-idle (darkvine) - :event - darkvine-event-handler - :code - (behavior () + :event darkvine-event-handler + :code (behavior () (set! (-> self dangerous) #t) (set! (-> self vulnerable) #t) (let ((f30-0 0.0)) - (while #t + (loop (if (logtest? (get-reminder (get-task-control (game-task jungle-plant)) 0) 1) (go darkvine-die #f) ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) (-> self speed)) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! darkvine-idle-ja :num! (seek! max (-> self speed)) :frame-num 0.0) (until (ja-done? 0) (if (and (>= (ja-aframe-num 0) 120.0) (>= 180.0 (ja-aframe-num 0))) (seek-toward-yaw-angle! (-> self root-override) f30-0 32768.0 (seconds 0.5)) ) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) (-> self speed)) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self speed))) ) (set! f30-0 (if (rand-vu-percent? 0.5) (+ 16384.0 f30-0) @@ -227,8 +201,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (when (and (-> self hit-player) (or (not *target*) (>= (- (-> *display* base-frame-counter) (-> self touch-time)) (seconds 0.05))) ) @@ -250,24 +223,14 @@ ;; failed to figure out what this is: (defstate darkvine-retreat (darkvine) - :event - darkvine-event-handler - :code - (behavior () + :event darkvine-event-handler + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self dangerous) #f) (set! (-> self vulnerable) #f) (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 45) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! darkvine-retreat-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (sp-launch-particles-var *sp-particle-system-2d* @@ -278,11 +241,7 @@ 1.0 ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (ja-channel-set! 0) (let ((gp-0 (-> *display* base-frame-counter))) @@ -290,23 +249,16 @@ (suspend) ) ) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 175) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 175) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (let ((gp-2 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.5)) @@ -316,48 +268,27 @@ (set! (-> self dangerous) #t) (logior! (-> self mask) (process-mask actor-pause)) (ja-channel-set! 1) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! darkvine-pushup-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go darkvine-idle) (none) ) - :post - (-> darkvine-idle post) + :post (-> darkvine-idle post) ) ;; failed to figure out what this is: (defstate darkvine-die (darkvine) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (logclear! (-> self mask) (process-mask actor-pause)) (if arg0 (ja-channel-set! 1) - (ja-channel-push! 1 150) + (ja-channel-push! 1 (seconds 0.5)) ) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! darkvine-dead-ja :num! min) (while (!= (-> self skel root-channel 0) (-> self skel channel)) (suspend) ) @@ -365,8 +296,7 @@ (anim-loop) (none) ) - :post - (-> darkvine-idle post) + :post (-> darkvine-idle post) ) ;; definition for method 11 of type darkvine diff --git a/test/decompiler/reference/levels/jungle/fisher_REF.gc b/test/decompiler/reference/levels/jungle/fisher_REF.gc index 6a3f2f2dfe..c1719ed3f0 100644 --- a/test/decompiler/reference/levels/jungle/fisher_REF.gc +++ b/test/decompiler/reference/levels/jungle/fisher_REF.gc @@ -1,6 +1,12 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/fish-net-ag.gc") +(import "goal_src/import/fisher-ag.gc") +(import "goal_src/import/catch-fisha-ag.gc") +(import "goal_src/import/catch-fishb-ag.gc") +(import "goal_src/import/catch-fishc-ag.gc") + ;; definition of type fisher-bank (deftype fisher-bank (basic) ((width meters :offset-assert 4) @@ -24,8 +30,7 @@ ) ;; definition for symbol *FISHER-bank*, type fisher-bank -(define - *FISHER-bank* +(define *FISHER-bank* (new 'static 'fisher-bank :width (meters 3.3) :net-radius (meters 0.7) :max-caught #xc8 :max-missed 20) ) @@ -36,14 +41,12 @@ :linger-duration 450 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 828) (sp-item 2013)) + :parts ((sp-item 828) (sp-item 2013)) ) ;; failed to figure out what this is: (defpart 828 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-y (meters 0.2)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) @@ -64,14 +67,12 @@ ;; failed to figure out what this is: (defpart 829 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: (defpart 2013 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-x (meters -0.7) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.1) (meters 0.2) 1.0) @@ -95,14 +96,12 @@ :linger-duration 450 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2001)) + :parts ((sp-item 2001)) ) ;; failed to figure out what this is: (defpart 2001 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -126,14 +125,12 @@ :linger-duration 1200 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 830) (sp-item 831)) + :parts ((sp-item 830) (sp-item 831)) ) ;; failed to figure out what this is: (defpart 831 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-scale-x (meters 5) (meters 1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -148,8 +145,7 @@ ;; failed to figure out what this is: (defpart 830 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) (sp-int spt-rot-x 4) @@ -173,8 +169,7 @@ ;; failed to figure out what this is: (defpart 832 - :init-specs - ((sp-flt spt-fade-a -0.8)) + :init-specs ((sp-flt spt-fade-a -0.8)) ) ;; definition of type fisher-params @@ -211,10 +206,7 @@ ) ;; definition for symbol *fisher-params*, type (array (inline-array fisher-params)) -(define *fisher-params* (new - 'static - 'boxed-array - :type (inline-array fisher-params) :length 6 :allocated-length 6 +(define *fisher-params* (new 'static 'boxed-array :type (inline-array fisher-params) (new 'static 'inline-array fisher-params 16 (new 'static 'fisher-params :timeout (seconds 2)) (new 'static 'fisher-params @@ -328,7 +320,7 @@ :vel 0.6 :swing-min (seconds 0.5) :swing-max (seconds 2) - :period #x9e + :period (seconds 0.527) :fish-vel 1.6 :bad-percent 0.083 :powerup-percent 0.1 @@ -416,7 +408,7 @@ :vel 1.83 :swing-min (seconds 0.5) :swing-max (seconds 2) - :period #xa8 + :period (seconds 0.56) :fish-vel 1.6 :bad-percent 0.066 :powerup-percent 0.1 @@ -438,7 +430,7 @@ :vel 0.8 :swing-min (seconds 0.5) :swing-max (seconds 2) - :period (seconds 0.5133333) + :period (seconds 0.515) :fish-vel 1.7 :bad-percent 0.066 :powerup-percent 0.1 @@ -558,7 +550,7 @@ :timeout (seconds 3) :vel 0.6 :swing-min (seconds 333.33) - :swing-max (seconds 0.33333334) + :swing-max (seconds 0.335) :period (seconds 0.5) :fish-vel 1.3 :powerup-percent 0.5 @@ -577,7 +569,7 @@ :timeout (seconds 3) :vel 0.6 :swing-min (seconds 333.33) - :swing-max (seconds 0.33333334) + :swing-max (seconds 0.335) :period (seconds 0.5) :fish-vel 1.3 :powerup-percent 0.5 @@ -607,7 +599,7 @@ :timeout (seconds 3) :vel 0.6 :swing-min (seconds 333.33) - :swing-max (seconds 0.33333334) + :swing-max (seconds 0.335) :period (seconds 0.5) :fish-vel 1.3 :powerup-percent 0.5 @@ -626,7 +618,7 @@ :timeout (seconds 3) :vel 0.6 :swing-min (seconds 333.33) - :swing-max (seconds 0.33333334) + :swing-max (seconds 0.335) :period (seconds 0.5) :fish-vel 1.3 :powerup-percent 0.5 @@ -859,53 +851,38 @@ ) ;; failed to figure out what this is: -(defskelgroup *catch-fisha-sg* catch-fisha - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *catch-fisha-sg* catch-fisha catch-fisha-lod0-jg catch-fisha-idle-ja + ((catch-fisha-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; failed to figure out what this is: -(defskelgroup *catch-fishb-sg* catch-fishb - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *catch-fishb-sg* catch-fishb catch-fishb-lod0-jg catch-fishb-idle-ja + ((catch-fishb-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; failed to figure out what this is: -(defskelgroup *catch-fishc-sg* catch-fishc - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *catch-fishc-sg* catch-fishc catch-fishc-lod0-jg catch-fishc-idle-ja + ((catch-fishc-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; failed to figure out what this is: -(defskelgroup *fish-net-sg* fish-net - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *fish-net-sg* fish-net fish-net-lod0-jg fish-net-fishing-ja + ((fish-net-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; failed to figure out what this is: -(defskelgroup *fisher-sg* fisher - 0 - 6 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 -6 0 14) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *fisher-sg* fisher fisher-lod0-jg fisher-idle-more-often-ja + ((fisher-lod0-mg (meters 20)) (fisher-lod1-mg (meters 40)) (fisher-lod2-mg (meters 999999))) + :bounds (static-spherem 0 -6 0 14) + :shadow fisher-shadow-mg + ) ;; definition for method 52 of type fisher -;; INFO: Return type mismatch int vs none. +;; INFO: Return type mismatch shadow-flags vs none. (defmethod dummy-52 fisher ((obj fisher)) (let ((v1-1 (-> obj draw shadow-ctrl))) (when v1-1 @@ -919,7 +896,7 @@ ) ) 0 - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) ) ) (none) @@ -934,14 +911,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -1002,39 +979,13 @@ ;; failed to figure out what this is: (defstate fisher-fish-fall (fisher-fish) - :code - (behavior () + :code (behavior () (set-heading-vec! (-> self root) (TODO-RENAME-12 (-> (the-as fisher (-> self parent 0)) path) (-> self dir) (-> self pos)) ) - (while #t - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-2 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (fisher-fish-move) (if (< (vector-vector-xz-distance (-> self root trans) (-> (the-as fisher (-> self parent 0)) paddle-pos)) @@ -1048,53 +999,51 @@ (go fisher-fish-die) ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior fisher-fish) ja-post) + :post (the-as (function none :behavior fisher-fish) ja-post) ) ;; failed to figure out what this is: (defstate fisher-fish-caught (fisher-fish) - :code - (behavior () + :code (behavior () (case (-> self mode) (('deadly 'bad) - (sound-play-by-name (static-sound-name "caught-eel") (new-sound-id) 1024 0 0 1 #t) + (sound-play "caught-eel") (ambient-hint-spawn "sksp0a42" (-> self root trans) *entity-pool* 'ambient) (send-event (ppointer->process (-> self parent)) 'deadly) ) (('powerup) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 179) -1 #f #f #f (-> self root trans)) - (-> gp-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 179) + -1 + #f + #f + #f + (-> self root trans) + :to *entity-pool* ) - (sound-play-by-name (static-sound-name "get-big-fish") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-big-fish") (send-event (ppointer->process (-> self parent)) 'fisher-fish-caught 5) ) (else - (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-3 - (let ((t9-11 (method-of-type part-tracker activate))) - (t9-11 (the-as part-tracker gp-3) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-3 part-tracker-init (-> *part-group-id-table* 179) -1 #f #f #f (-> self root trans)) - (-> gp-3 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 179) + -1 + #f + #f + #f + (-> self root trans) + :to *entity-pool* ) - (sound-play-by-name (static-sound-name "get-small-fish") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-small-fish") (send-event (ppointer->process (-> self parent)) 'fisher-fish-caught 1) ) ) @@ -1105,10 +1054,7 @@ (vector-float*! (-> self root scale) (-> self root scale) 0.93) (ja-post) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) 1.0) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) @@ -1116,8 +1062,7 @@ ;; failed to figure out what this is: (defstate fisher-fish-die (fisher-fish) - :code - (behavior () + :code (behavior () (case (-> self mode) (('deadly 'bad) ) @@ -1129,10 +1074,7 @@ *entity-pool* (game-task none) ) - (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-3 (the-as number (logior #x3f800000 v1-2))) - (f0-2 (+ -1.0 (the-as float v1-3))) - ) + (let ((f0-2 (rand-float-gen))) (if (< 0.5 f0-2) (play-ambient (-> (the-as fisher (-> self parent 0)) ambient) "FIS-TA04" #t (-> self root trans)) (play-ambient (-> (the-as fisher (-> self parent 0)) ambient) "FIS-TA05" #t (-> self root trans)) @@ -1141,10 +1083,7 @@ (send-event (ppointer->process (-> self parent)) 'fisher-fish-die 5) ) (else - (let* ((v1-21 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-22 (the-as number (logior #x3f800000 v1-21))) - (f0-5 (+ -1.0 (the-as float v1-22))) - ) + (let ((f0-5 (rand-float-gen))) (cond ((and (< 0.8333 f0-5) (< (-> (the-as fisher (-> self parent 0)) paddle-pos z) (-> self root trans z))) (play-ambient (-> (the-as fisher (-> self parent 0)) ambient) "FIS-TA01" #t (-> self root trans)) @@ -1278,8 +1217,7 @@ :name "fisher-introduction" :index 8 :parts 9 - :command-list - '((0 want-levels village1 jungle) + :command-list '((0 want-levels village1 jungle) (0 alive "jungle-part-1") (130 blackout 10) (130 display-level village1 movie) @@ -1324,8 +1262,7 @@ :name "fisher-resolution" :index 9 :parts 4 - :command-list - '((188 blackout 10) (199 blackout 0)) + :command-list '((188 blackout 10) (199 blackout 0)) ) ) (else @@ -1376,8 +1313,7 @@ :name "fisher-accept" :index 12 :parts 6 - :command-list - '((0 send-event self emissive-on) (700 send-event self emissive-off)) + :command-list '((0 send-event self emissive-on) (700 send-event self emissive-off)) ) ) @@ -1388,8 +1324,7 @@ ;; failed to figure out what this is: (defstate fisher-done (fisher) - :enter - (behavior () + :enter (behavior () (init! (-> self query) (lookup-text! *common-text* (game-text-id play-again?) #f) @@ -1400,9 +1335,7 @@ (lookup-text! *common-text* (game-text-id quit) #f) ) (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (get-art-elem self))) - ) + (ja :group! (get-art-elem self)) (set! (-> self state-time) (-> *display* base-frame-counter)) (while (-> self child) (deactivate (-> self child 0)) @@ -1493,40 +1426,30 @@ (-> gp-2 user-uint8 6) ) ) - (let ((gp-3 (get-process *default-dead-pool* process #x4000))) - (when gp-3 - (let ((t9-15 (method-of-type process activate))) - (t9-15 gp-3 *default-pool* 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process gp-3 (lambda :behavior process - () - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) - (suspend) - ) - ) - (ambient-hint-spawn "st-lose" (the-as vector #f) *entity-pool* 'stinger) - (none) - ) - ) - (-> gp-3 ppointer) - ) - ) + (process-spawn-function process (lambda :behavior process + () + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) + (suspend) + ) + ) + (ambient-hint-spawn "st-lose" (the-as vector #f) *entity-pool* 'stinger) + (none) + ) + ) (send-event *target* 'lose) ) ) (none) ) - :exit - (behavior () + :exit (behavior () (when (and *target* (the-as target #f)) (send-event *target* 'end-mode) (process-grab? *target*) ) (none) ) - :trans - (behavior () + :trans (behavior () (set! *camera-look-through-other* 2) (cond ((>= (-> self caught) (-> *FISHER-bank* max-caught)) @@ -1555,7 +1478,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-1) ) @@ -1578,19 +1501,14 @@ (spool-push *art-control* "fisher-reject" 0 self -99.0) (none) ) - :code - (the-as (function none :behavior fisher) process-taskable-anim-loop) - :post - (the-as (function none :behavior fisher) ja-post) + :code (the-as (function none :behavior fisher) process-taskable-anim-loop) + :post (the-as (function none :behavior fisher) ja-post) ) ;; definition for function fisher-spawn-ambient ;; INFO: Return type mismatch time-frame vs none. (defbehavior fisher-spawn-ambient fisher () - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - (f0-2 (+ -1.0 (the-as float v1-2))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((and (< 0.3 f0-2) (< (+ (-> *FISHER-bank* max-caught) -30) (-> self caught))) (if (and (>= (- (-> *display* base-frame-counter) (-> self ambient-almost)) (seconds 10)) @@ -1683,23 +1601,15 @@ ) (set! (-> self spawner-last) (-> self spawner)) (set! (-> self spawn-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "fish-spawn") (new-sound-id) 716 0 0 1 #t) + (sound-play "fish-spawn" :vol 70) (fisher-spawn-ambient) - (let ((s5-1 (get-process *default-dead-pool* fisher-fish #x4000))) - (when s5-1 - (let ((t9-10 (method-of-type fisher-fish activate))) - (t9-10 (the-as fisher-fish s5-1) self 'fisher-fish (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 fisher-fish-init-by-other gp-0 (-> self spawner) (* 1.85 (-> self params fish-vel))) - (-> s5-1 ppointer) - ) - ) + (process-spawn fisher-fish gp-0 (-> self spawner) (* 1.85 (-> self params fish-vel)) :to self) ) ) (let ((f1-14 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 32.0 110.0 28.0))) (+! (-> self paddle-vel) (* f1-14 (-> *display* seconds-per-frame))) ) - (set! (-> self paddle-vel) (seek (-> self paddle-vel) 0.0 (* 15.0 (-> *display* seconds-per-frame)))) + (seek! (-> self paddle-vel) 0.0 (* 15.0 (-> *display* seconds-per-frame))) (set! (-> self paddle-vel) (fmax -2.0 (fmin 2.0 (-> self paddle-vel)))) (+! (-> self paddle) (* (-> self paddle-vel) (-> *display* seconds-per-frame))) (set! (-> self paddle) (fmax 0.0 (fmin 1.0 (-> self paddle)))) @@ -1715,12 +1625,11 @@ ;; failed to figure out what this is: (defstate fisher-playing (fisher) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-2 object)) (case arg2 (('fisher-fish-die) - (sound-play-by-name (static-sound-name "fish-miss") (new-sound-id) 1024 0 0 1 #t) + (sound-play "fish-miss") (set! v0-2 (+ (-> self missed) (-> arg3 param 0))) (set! (-> self missed) (the-as int v0-2)) v0-2 @@ -1741,37 +1650,30 @@ ) ) ) - :enter - (behavior () - (set-setting! *setting-control* self 'ambient-volume 'rel 50.0 0) + :enter (behavior () + (set-setting! 'ambient-volume 'rel 50.0 0) (send-event *target* 'reset-pickup 'eco) (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (get-process *default-dead-pool* process #x4000))) - (when gp-0 - (let ((t9-5 (method-of-type process activate))) - (t9-5 gp-0 self 'process (the-as pointer #x70004000)) + (process-spawn-function + process + (lambda :behavior fisher-fish + () + (logclear! (-> self mask) (process-mask pause)) + (loop + (fisher-draw-display (the-as fisher (ppointer->process (-> self parent)))) + (suspend) ) - (run-next-time-in-process gp-0 (lambda :behavior fisher-fish - () - (logclear! (-> self mask) (process-mask pause)) - (while #t - (fisher-draw-display (the-as fisher (ppointer->process (-> self parent)))) - (suspend) - ) - (none) - ) - ) - (-> gp-0 ppointer) + (none) ) + :to self ) (send-event *camera* 'change-to-entity-by-name "camera-152") (init! (-> self query) (the-as string #f) 40 150 25 #t (lookup-text! *common-text* (game-text-id quit) #f)) (none) ) - :exit - (behavior () - (clear-pending-settings-from-process *setting-control* self 'ambient-volume) + :exit (behavior () + (remove-setting! 'ambient-volume) (let* ((v1-2 *camera-other-matrix*) (a3-0 (-> *camera-combiner* inv-camera-rot)) (a0-2 (-> a3-0 vector 0 quad)) @@ -1794,14 +1696,12 @@ 0 (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "fisher-resolution" 0 self -99.0) (spool-push *art-control* "fisher-reject" 0 self -99.0) (none) ) - :code - (behavior () + :code (behavior () (set! *display-profile* #f) (set! (-> self paddle) 0.5) (set! (-> self paddle-vel) 0.0) @@ -1823,7 +1723,7 @@ (set! (-> self ambient-steady) 0) (set! (-> self ambient-sagging) 0) (set! (-> self ambient-almost) 0) - (while #t + (loop (hide-hud-quick) (fisher-game-update) (if (or (zero? (-> self params timeout)) @@ -1836,8 +1736,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (none) ) @@ -1846,19 +1745,11 @@ ;; failed to figure out what this is: (defstate enter-playing (fisher) :virtual #t - :trans - (behavior () - (set-blackout-frames (seconds 0.016666668)) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'change-mode) - (set! (-> a1-0 param 0) (the-as uint 'fishing)) - (set! (-> a1-0 param 1) (the-as uint self)) - (if (send-event-function *target* a1-0) - (go fisher-playing) - ) - ) + :trans (behavior () + (set-blackout-frames (seconds 0.017)) + (if (send-event *target* 'change-mode 'fishing self) + (go fisher-playing) + ) (none) ) ) @@ -1866,8 +1757,7 @@ ;; failed to figure out what this is: (defstate query (fisher) :virtual #t - :enter - (behavior () + :enter (behavior () (init! (-> self query) (lookup-text! *common-text* (game-text-id fish?) #f) @@ -1886,10 +1776,7 @@ (cond ((closed? (-> obj tasks) (game-task jungle-fishgame) (task-status need-reminder)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 1) 122880.0 obj) - (let* ((v1-5 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-6 (the-as number (logior #x3f800000 v1-5))) - (f0-2 (+ -1.0 (the-as float v1-6))) - ) + (let ((f0-2 (rand-float-gen))) (if (< 0.5 f0-2) (play-ambient (-> obj ambient) "FIS-LO03" #f (-> obj root-override trans)) (play-ambient (-> obj ambient) "FIS-LO05" #f (-> obj root-override trans)) @@ -1899,10 +1786,7 @@ ) (else (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-16 (the-as number (logior #x3f800000 v1-15))) - (f0-5 (+ -1.0 (the-as float v1-16))) - ) + (let ((f0-5 (rand-float-gen))) (cond ((< 0.875 f0-5) (play-ambient (-> obj ambient) "FIS-LO01" #f (-> obj root-override trans)) @@ -1938,8 +1822,7 @@ ;; failed to figure out what this is: (defstate play-accept (fisher) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 rgbaf)) (let ((v1-0 arg2)) (the-as object (cond @@ -1965,8 +1848,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (-> self training) (let ((gp-0 (new-stack-vector0))) (vector<-cspace! gp-0 (-> self node-list data 74)) @@ -2021,8 +1903,7 @@ ;; failed to figure out what this is: (defstate idle (fisher) :virtual #t - :trans - (behavior () + :trans (behavior () (let ((t9-1 (-> (the-as state (find-parent-method fisher 30)) trans))) (if t9-1 (t9-1) @@ -2142,83 +2023,31 @@ ) (none) ) - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 60) - ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.2)) ) + (loop + (ja :group! (get-art-elem self)) (let* ((f30-0 5.0) (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-10 (the-as number (logior #x3f800000 v1-9))) ) (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-10)))) 5)) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-10 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! - a0-10 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (TODO-RENAME-43 self) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (when (ja-group? fisher-idle-more-often-ja) + (ja-no-eval :group! fisher-idle-less-often-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (TODO-RENAME-43 self) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -2295,8 +2124,7 @@ ;; failed to figure out what this is: (defstate target-fishing (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((= arg2 'bounce) (set-zero! (-> self control unknown-smush00)) @@ -2311,17 +2139,15 @@ ) ) ) - :enter - (behavior ((arg0 handle)) + :enter (behavior ((arg0 handle)) (set! (-> self control unknown-surface00) *empty-mods*) - (logior! (-> self state-flags) 16) + (logior! (-> self state-flags) (state-flags invulnerable)) (set-zero! (-> self control unknown-smush00)) (set! (-> self control unknown-uint20) (the-as uint #f)) (none) ) - :exit - (behavior () - (set! (-> self state-flags) (logand -17 (-> self state-flags))) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags invulnerable)) (let ((v1-2 (-> self manipy))) (when v1-2 (deactivate (-> v1-2 0)) @@ -2331,8 +2157,7 @@ (-> target-periscope exit) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (let ((v1-1 (handle->process arg0))) (when (and v1-1 (type-type? (-> v1-1 type) fisher)) (set-vector! (-> self control trans) 1067827.2 9420.8 -955596.8 1.0) @@ -2359,7 +2184,7 @@ a2-2 (if v1-16 (-> v1-16 entity) - (the-as entity #f) + (the-as entity-actor #f) ) *fish-net-sg* #f @@ -2388,35 +2213,15 @@ (set! (-> v1-35 0 param2) (the-as basic (-> self control quat))) ) ) - (let ((s5-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 99)) - num-func-identity - ) - (set! (-> s5-1 frame-num) (ja-aframe 15.0 0)) - ) + (ja :group! (-> self draw art-group data 99) :num! (identity (ja-aframe 15.0 0))) (let ((s5-2 (new 'stack-no-clear 'vector))) (until (-> self control unknown-spoolanim00) (let ((v1-42 (handle->process arg0))) (when v1-42 - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (* (fmax 0.0 (- 1.0 (-> (the-as fisher v1-42) paddle))) - (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! + (* (fmax 0.0 (- 1.0 (-> (the-as fisher v1-42) paddle))) (the float (+ (-> (ja-group) data 0 length) -1))) + ) + ) (when (-> self manipy) (let ((s2-0 (new-stack-vector0)) (s4-0 (new-stack-vector0)) @@ -2440,29 +2245,16 @@ ) (case (-> self control unknown-spoolanim00) (('lose) - (ja-channel-push! 1 30) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 frame-group) (the-as art-joint-anim (-> self draw art-group data 100))) - (set! (-> a0-38 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 100)) data 0 length) -1)) - ) - (set! (-> a0-38 param 1) 1.0) - (set! (-> a0-38 frame-num) 0.0) - (joint-control-channel-group! a0-38 (the-as art-joint-anim (-> self draw art-group data 100)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 100) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 param 0) (the float (+ (-> a0-39 frame-group data 0 length) -1))) - (set! (-> a0-39 param 1) 1.0) - (joint-control-channel-group-eval! a0-39 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (anim-loop) ) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) diff --git a/test/decompiler/reference/levels/jungle/hopper_REF.gc b/test/decompiler/reference/levels/jungle/hopper_REF.gc index c9a34325aa..760ae2e06d 100644 --- a/test/decompiler/reference/levels/jungle/hopper_REF.gc +++ b/test/decompiler/reference/levels/jungle/hopper_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/hopper-ag.gc") + ;; definition of type hopper (deftype hopper (nav-enemy) ((jump-length float :offset-assert 400) @@ -23,14 +25,12 @@ ) ;; failed to figure out what this is: -(defskelgroup *hopper-sg* hopper - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 1) - :shadow 4 - ) +(defskelgroup *hopper-sg* hopper hopper-lod0-jg hopper-idle-ja + ((hopper-lod0-mg (meters 20)) (hopper-lod1-mg (meters 40)) (hopper-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :longest-edge (meters 1) + :shadow hopper-shadow-mg + ) ;; failed to figure out what this is: nav-enemy-default-event-handler @@ -57,9 +57,16 @@ nav-enemy-default-event-handler ) (set! (-> s5-0 quad) (-> arg0 quad)) (set! (-> s5-0 y) (+ 20480.0 (-> s5-0 y))) - (let ((f0-2 - (fill-and-probe-using-y-probe *collide-cache* s5-0 f30-0 (collide-kind background) self t1-0 (the-as uint 1)) - ) + (let ((f0-2 (fill-and-probe-using-y-probe + *collide-cache* + s5-0 + f30-0 + (collide-kind background) + self + t1-0 + (new 'static 'pat-surface :noentity #x1) + ) + ) ) (if (< f0-2 0.0) (return (the-as object #f)) @@ -88,18 +95,18 @@ nav-enemy-default-event-handler (-> self nav-info jump-height-factor) -409600.0 ) - (set! (-> self nav-enemy-flags) (logand -513 (-> self nav-enemy-flags))) - (set! (-> self nav-enemy-flags) (logand -1025 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 16) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (when (not (nav-enemy-facing-point? (-> self jump-dest) 5461.3335)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) (set! (-> self shadow-min-y) (+ (-> self collide-info trans y) (-> self nav-info shadow-min-y))) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (nav-enemy-jump-land-anim) 0 (none) @@ -121,50 +128,24 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-idle (hopper) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior hopper) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 22) - (while #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (loop (dotimes (gp-0 3) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! hopper-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! hopper-burp-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) @@ -174,98 +155,53 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-patrol (hopper) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior hopper) nav-enemy-jump-event-handler ) - :trans - (behavior () - (if (zero? (logand (-> self nav-enemy-flags) 8)) + :trans (behavior () + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) ((-> (method-of-type nav-enemy nav-enemy-patrol) trans)) ) (none) ) - :code - (behavior () + :code (behavior () (vector-reset! (-> self collide-info transv)) (set! (-> self jump-length) 16384.0) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) - (while #t + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (loop (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - (ja-channel-push! 1 20) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + ((ja-group? hopper-jump-long-ja) + (ja-channel-push! 1 (seconds 0.067)) + (ja-no-eval :group! hopper-jump-long-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 9) - ) - (ja-channel-push! 1 30) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + ((ja-group? hopper-jump-short-ja) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! hopper-jump-short-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) (else - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) ) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! hopper-idle-ja :num! min) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) - (when (or (logtest? (nav-control-flags bit19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) + (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) (set! (-> self nav block-count) 0.0) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (nav-enemy-get-new-patrol-point) (set! (-> self nav target-pos quad) (-> self nav destination-pos quad)) ) @@ -273,20 +209,17 @@ nav-enemy-default-event-handler ) (none) ) - :post - (the-as (function none :behavior hopper) nav-enemy-jump-post) + :post (the-as (function none :behavior hopper) nav-enemy-jump-post) ) ;; failed to figure out what this is: (defstate nav-enemy-notice (hopper) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior hopper) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-chase) (none) ) @@ -295,114 +228,66 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-chase (hopper) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior hopper) nav-enemy-jump-event-handler ) - :trans - (behavior () - (if (zero? (logand (-> self nav-enemy-flags) 8)) + :trans (behavior () + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) ) (none) ) - :code - (behavior () + :code (behavior () (vector-reset! (-> self collide-info transv)) (set! (-> self jump-length) 32768.0) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) - (while #t + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (loop (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - (ja-channel-push! 1 20) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + ((ja-group? hopper-jump-long-ja) + (ja-channel-push! 1 (seconds 0.067)) + (ja-no-eval :group! hopper-jump-long-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 9) - ) - (ja-channel-push! 1 30) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + ((ja-group? hopper-jump-short-ja) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! hopper-jump-short-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) (else - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) ) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! hopper-idle-ja :num! min) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (set! (-> self nav target-pos quad) (-> (target-pos 0) quad)) (hopper-do-jump) ) (none) ) - :post - (the-as (function none :behavior hopper) nav-enemy-jump-post) + :post (the-as (function none :behavior hopper) nav-enemy-jump-post) ) ;; failed to figure out what this is: (defstate nav-enemy-stop-chase (hopper) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior hopper) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-stare) (none) ) @@ -457,7 +342,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #t ) diff --git a/test/decompiler/reference/levels/jungle/jungle-elevator_REF.gc b/test/decompiler/reference/levels/jungle/jungle-elevator_REF.gc index 8877fb8452..c3477be3b7 100644 --- a/test/decompiler/reference/levels/jungle/jungle-elevator_REF.gc +++ b/test/decompiler/reference/levels/jungle/jungle-elevator_REF.gc @@ -32,8 +32,7 @@ ;; failed to figure out what this is: (defstate plat-button-move-downward (jungle-elevator) :virtual #t - :enter - (behavior () + :enter (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-move-downward) enter))) (if t9-0 (t9-0) @@ -45,8 +44,7 @@ (send-event *target* 'reset-pickup 'eco) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> jungle bottom-height) (-> self bottom-height)) (let ((t9-0 (-> (method-of-type plat-button plat-button-move-downward) exit))) (if t9-0 @@ -55,8 +53,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -82,8 +79,7 @@ ;; failed to figure out what this is: (defstate plat-button-move-upward (jungle-elevator) :virtual #t - :enter - (behavior () + :enter (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) enter))) (if t9-0 (t9-0) @@ -95,8 +91,7 @@ (set! (-> self grab-player?) (process-grab? *target*)) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> jungle bottom-height) (-> self bottom-height)) (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) exit))) (if t9-0 @@ -105,8 +100,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) trans))) (if t9-0 (t9-0) @@ -122,8 +116,7 @@ ;; failed to figure out what this is: (defstate plat-button-at-end (jungle-elevator) :virtual #t - :code - (behavior () + :code (behavior () (cond ((!= (-> self path-pos) 0.0) (set! (-> self draw light-index) (the-as uint 1)) diff --git a/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc b/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc index 9ba3e0bf18..55505b8be0 100644 --- a/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc +++ b/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc @@ -1,13 +1,15 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/periscope-ag.gc") +(import "goal_src/import/reflector-mirror-ag.gc") + ;; failed to figure out what this is: (defpartgroup group-jungle-binoculars :id 176 :flags (screen-space) :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 803) + :parts ((sp-item 803) (sp-item 804) (sp-item 805) (sp-item 806) @@ -33,8 +35,7 @@ ;; failed to figure out what this is: (defpart 823 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x28 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x28 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-z (degrees -45.0)) @@ -52,8 +53,7 @@ ;; failed to figure out what this is: (defpart 815 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees -15.0)) @@ -71,8 +71,7 @@ ;; failed to figure out what this is: (defpart 816 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees 15.0)) @@ -90,8 +89,7 @@ ;; failed to figure out what this is: (defpart 817 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees 75.0)) @@ -109,8 +107,7 @@ ;; failed to figure out what this is: (defpart 818 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees 105.0)) @@ -128,8 +125,7 @@ ;; failed to figure out what this is: (defpart 819 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees 165.0)) @@ -147,8 +143,7 @@ ;; failed to figure out what this is: (defpart 820 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees 195.0)) @@ -166,8 +161,7 @@ ;; failed to figure out what this is: (defpart 821 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees 255.0)) @@ -185,8 +179,7 @@ ;; failed to figure out what this is: (defpart 822 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-z (degrees 285.0)) @@ -204,8 +197,7 @@ ;; failed to figure out what this is: (defpart 811 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.75)) (sp-flt spt-rot-z (degrees 0.0)) @@ -223,8 +215,7 @@ ;; failed to figure out what this is: (defpart 812 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.75)) (sp-flt spt-rot-z (degrees 90.0)) @@ -242,8 +233,7 @@ ;; failed to figure out what this is: (defpart 813 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.75)) (sp-flt spt-rot-z (degrees 180.0)) @@ -261,8 +251,7 @@ ;; failed to figure out what this is: (defpart 814 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x27 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.75)) (sp-flt spt-rot-z (degrees 270.0)) @@ -280,8 +269,7 @@ ;; failed to figure out what this is: (defpart 803 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.9)) (sp-flt spt-y (meters 2.1)) @@ -298,8 +286,7 @@ ;; failed to figure out what this is: (defpart 804 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 1.11)) (sp-flt spt-y (meters 2.1)) @@ -316,8 +303,7 @@ ;; failed to figure out what this is: (defpart 805 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.11)) (sp-flt spt-y (meters 2.1)) @@ -335,8 +321,7 @@ ;; failed to figure out what this is: (defpart 806 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2.9)) (sp-flt spt-y (meters 2.1)) @@ -354,8 +339,7 @@ ;; failed to figure out what this is: (defpart 807 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.9)) (sp-flt spt-y (meters -2.1)) @@ -373,8 +357,7 @@ ;; failed to figure out what this is: (defpart 808 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 1.11)) (sp-flt spt-y (meters -2.1)) @@ -392,8 +375,7 @@ ;; failed to figure out what this is: (defpart 809 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.11)) (sp-flt spt-y (meters -2.1)) @@ -411,8 +393,7 @@ ;; failed to figure out what this is: (defpart 810 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x25 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2.9)) (sp-flt spt-y (meters -2.1)) @@ -432,14 +413,12 @@ (defpartgroup group-jungle-binoculars-aligned :id 689 :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 2840) (sp-item 2863) (sp-item 2864) (sp-item 2865)) + :parts ((sp-item 2840) (sp-item 2863) (sp-item 2864) (sp-item 2865)) ) ;; failed to figure out what this is: (defpart 2865 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 5.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -464,14 +443,12 @@ ;; failed to figure out what this is: (defpart 2866 - :init-specs - ((sp-flt spt-fade-a -0.85333335)) + :init-specs ((sp-flt spt-fade-a -0.85333335)) ) ;; failed to figure out what this is: (defpart 2864 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -495,14 +472,12 @@ ;; failed to figure out what this is: (defpart 2867 - :init-specs - ((sp-flt spt-fade-a -4.266667)) + :init-specs ((sp-flt spt-fade-a -4.266667)) ) ;; failed to figure out what this is: (defpart 2863 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -521,8 +496,7 @@ ;; failed to figure out what this is: (defpart 2840 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 13) (meters 5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -707,47 +681,35 @@ ) ;; failed to figure out what this is: -(defskelgroup *periscope-base-sg* periscope - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 23.5 0 24) - :longest-edge (meters 4.5) - ) +(defskelgroup *periscope-base-sg* periscope periscope-base-lod0-jg periscope-base-idle-ja + ((periscope-base-lod0-mg (meters 20)) (periscope-base-lod1-mg (meters 999999))) + :bounds (static-spherem 0 23.5 0 24) + :longest-edge (meters 4.5) + ) ;; failed to figure out what this is: -(defskelgroup *periscope-mirror-sg* periscope - 4 - 7 - ((5 (meters 20)) (6 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *periscope-mirror-sg* periscope periscope-mirror-lod0-jg periscope-mirror-idle-ja + ((periscope-mirror-lod0-mg (meters 20)) (periscope-mirror-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) ;; failed to figure out what this is: -(defskelgroup *reflector-mirror-sg* reflector-mirror - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 9 0 9) - :longest-edge (meters 3) - ) +(defskelgroup *reflector-mirror-sg* reflector-mirror reflector-mirror-lod0-jg reflector-mirror-idle-ja + ((reflector-mirror-lod0-mg (meters 999999))) + :bounds (static-spherem 0 9 0 9) + :longest-edge (meters 3) + ) ;; failed to figure out what this is: -(defskelgroup *reflector-mirror-break-sg* reflector-mirror - 4 - 6 - ((5 (meters 999999))) - :bounds (static-spherem 0 9 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *reflector-mirror-break-sg* reflector-mirror reflector-mirror-break-lod0-jg reflector-mirror-break-break-ja + ((reflector-mirror-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 9 0 9) + ) ;; failed to figure out what this is: (defstate cam-periscope (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) (let ((v1-2 (-> self change-event-from))) @@ -764,22 +726,20 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (sv-32 int) (sv-48 int)) (let* ((gp-0 (-> self change-event-from)) (f28-0 (the-as float (-> (the-as periscope (-> gp-0 0)) tilt))) (f30-0 (the-as float (-> (the-as periscope (-> gp-0 0)) turn))) (s5-0 (new 'stack-no-clear 'vector)) ) - (while #t + (loop (when (not (or (paused?) (-> (the-as periscope (-> self change-event-from 0)) aligned?))) (vector-reset! s5-0) (when *camera-read-analog* @@ -816,7 +776,10 @@ (set! sv-32 0) (set! sv-48 1) (let ((t2-0 (target-pos 0))) - (the-as int (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-32 sv-48 (the-as symbol t2-0))) + (the-as + int + (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-32 (the-as sound-group sv-48) (the-as symbol t2-0)) + ) ) ) ) @@ -852,10 +815,9 @@ ;; failed to figure out what this is: (defstate reflector-idle (reflector) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) - (while #t + (loop (set! (-> gp-0 x) (-> self parent-override 0 tilt)) (set! (-> gp-0 y) (-> self parent-override 0 turn)) (set! (-> gp-0 z) 0.0) @@ -933,15 +895,7 @@ ) (when (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (sound-stop (-> self sound-id)) - (sound-play-by-name - (static-sound-name "beam-connect") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (target-pos 0)) - ) + (sound-play "beam-connect" :position (the-as symbol (target-pos 0))) ) (process-entity-status! self (entity-perm-status complete) #t) (set! gp-0 #t) @@ -1031,8 +985,7 @@ ;; failed to figure out what this is: (defpart 825 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 4.5) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1236,127 +1189,79 @@ (gp-0 (cond ((name= arg0 "reflector-mirror-2") - (let ((s5-1 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-1 - (let ((t9-3 (method-of-type pov-camera activate))) - (t9-3 (the-as pov-camera s5-1) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - pov-camera-init-by-other - (-> gp-0 extra trans) - *junglecam-sg* - "tower1" - 0 - #f - '((0 ambient camera "gamcam14")) - ) - (-> s5-1 ppointer) - ) + (process-spawn + pov-camera + (-> gp-0 extra trans) + *junglecam-sg* + "tower1" + 0 + #f + '((0 ambient camera "gamcam14")) + :to self ) ) ((name= arg0 "periscope-11") - (let ((s5-2 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-2 - (let ((t9-7 (method-of-type pov-camera activate))) - (t9-7 (the-as pov-camera s5-2) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-2 - pov-camera-init-by-other - (-> gp-0 extra trans) - *junglecam-sg* - "tower2" - 0 - #f - '((0 ambient camera "gamcam15") (0 want-force-vis jungle #t) (0 want-force-vis village1 #t)) - ) - (-> s5-2 ppointer) - ) + (process-spawn + pov-camera + (-> gp-0 extra trans) + *junglecam-sg* + "tower2" + 0 + #f + '((0 ambient camera "gamcam15") (0 want-force-vis jungle #t) (0 want-force-vis village1 #t)) + :to self ) ) ((name= arg0 "periscope-12") - (let ((s5-3 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-3 - (let ((t9-11 (method-of-type pov-camera activate))) - (t9-11 (the-as pov-camera s5-3) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-3 - pov-camera-init-by-other - (-> gp-0 extra trans) - *junglecam-sg* - "tower3" - 0 - #f - '((0 ambient camera "gamcam16")) - ) - (-> s5-3 ppointer) - ) + (process-spawn + pov-camera + (-> gp-0 extra trans) + *junglecam-sg* + "tower3" + 0 + #f + '((0 ambient camera "gamcam16")) + :to self ) ) ((name= arg0 "periscope-13") - (let ((s5-4 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-4 - (let ((t9-15 (method-of-type pov-camera activate))) - (t9-15 (the-as pov-camera s5-4) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-4 - pov-camera-init-by-other - (-> gp-0 extra trans) - *junglecam-sg* - "tower4" - 0 - #f - '((0 ambient camera "gamcam17")) - ) - (-> s5-4 ppointer) - ) + (process-spawn + pov-camera + (-> gp-0 extra trans) + *junglecam-sg* + "tower4" + 0 + #f + '((0 ambient camera "gamcam17")) + :to self ) ) ((name= arg0 "periscope-14") - (let ((s5-5 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-5 - (let ((t9-19 (method-of-type pov-camera activate))) - (t9-19 (the-as pov-camera s5-5) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-5 - pov-camera-init-by-other - (-> gp-0 extra trans) - *junglecam-sg* - "tower5" - 0 - #f - '((0 ambient camera "gamcam18") (0 want-force-vis jungle #t) (0 want-force-vis village1 #t)) - ) - (-> s5-5 ppointer) - ) + (process-spawn + pov-camera + (-> gp-0 extra trans) + *junglecam-sg* + "tower5" + 0 + #f + '((0 ambient camera "gamcam18") (0 want-force-vis jungle #t) (0 want-force-vis village1 #t)) + :to self ) ) ((name= arg0 "periscope-15") - (let ((s5-6 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-6 - (let ((t9-23 (method-of-type pov-camera activate))) - (t9-23 (the-as pov-camera s5-6) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-6 - pov-camera-init-by-other - (-> gp-0 extra trans) - *junglecam-sg* - "beamcam" - 0 - #f - '((0 ambient camera "gamcam19") - (0 want-force-vis jungle #t) - (0 want-force-vis village1 #t) - (0 display-level village1 movie) - ) - ) - (-> s5-6 ppointer) + (process-spawn + pov-camera + (-> gp-0 extra trans) + *junglecam-sg* + "beamcam" + 0 + #f + '((0 ambient camera "gamcam19") + (0 want-force-vis jungle #t) + (0 want-force-vis village1 #t) + (0 display-level village1 movie) ) + :to self ) ) (else @@ -1381,8 +1286,7 @@ ;; failed to figure out what this is: (defstate periscope-idle (periscope) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('activate) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1390,21 +1294,17 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (clear-collide-with-as (-> self root-override)) (none) ) - :exit - (behavior () + :exit (behavior () (restore-collide-with-as (-> self root-override)) (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - periscope-debug-trans - :code - (behavior () + :trans periscope-debug-trans + :code (behavior () (logior! (-> self mask) (process-mask actor-pause)) (set! (-> self raised?) #f) (set! (-> self y-offset) 0.0) @@ -1416,7 +1316,7 @@ (suspend) (update-transforms! (-> self root-override)) (logior! (-> self draw status) (draw-status hidden)) - (while #t + (loop (suspend) ) (none) @@ -1425,24 +1325,13 @@ ;; failed to figure out what this is: (defstate periscope-activate (periscope) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self rise-sound-id)) - (sound-play-by-name - (static-sound-name "eco-tower-stop") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self base)) - ) + (sound-play "eco-tower-stop" :position (the-as symbol (-> self base))) (none) ) - :trans - periscope-debug-trans - :code - (behavior () + :trans periscope-debug-trans + :code (behavior () (local-vars (v1-13 symbol)) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1454,24 +1343,10 @@ (set! (-> self turn) (+ 18204.445 (-> self target-turn))) ) (until (and v1-13 (= (-> self turn) (-> self target-turn)) (= (-> self tilt) (-> self target-tilt))) - (sound-play-by-name - (static-sound-name "eco-tower-rise") - (-> self rise-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self base)) - ) - (set! (-> self y-offset) - (seek (-> self y-offset) (-> self height) (* 16384.0 (-> *display* seconds-per-frame))) - ) - (set! (-> self turn) - (seek (-> self turn) (-> self target-turn) (* 7281.778 (-> *display* seconds-per-frame))) - ) - (set! (-> self tilt) - (seek (-> self tilt) (-> self target-tilt) (* 7281.778 (-> *display* seconds-per-frame))) - ) + (sound-play "eco-tower-rise" :id (-> self rise-sound-id) :position (the-as symbol (-> self base))) + (seek! (-> self y-offset) (-> self height) (* 16384.0 (-> *display* seconds-per-frame))) + (seek! (-> self turn) (-> self target-turn) (* 7281.778 (-> *display* seconds-per-frame))) + (seek! (-> self tilt) (-> self target-tilt) (* 7281.778 (-> *display* seconds-per-frame))) (set! (-> self raised?) (< (+ -12288.0 (-> self height)) (-> self y-offset))) (periscope-update-joints) (suspend) @@ -1481,28 +1356,24 @@ (go periscope-wait-for-power-input) (none) ) - :post - periscope-post + :post periscope-post ) ;; failed to figure out what this is: (defstate periscope-wait-for-power-input (periscope) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self raised?) #t) (let ((f30-0 (+ -20480.0 (-> self height)))) (until (= (-> self y-offset-grips) f30-0) - (set! (-> self y-offset-grips) - (seek (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) (periscope-update-joints) (suspend) ) ) (update-transforms! (-> self root-override)) (set! (-> self y-offset) (-> self height)) - (while #t + (loop (if (periscope-has-power-input?) (go periscope-wait-for-player) ) @@ -1510,8 +1381,7 @@ ) (none) ) - :post - (the-as (function none :behavior periscope) ja-post) + :post (the-as (function none :behavior periscope) ja-post) ) ;; definition for function target-close-to-point? @@ -1522,12 +1392,11 @@ ;; failed to figure out what this is: (defstate periscope-wait-for-player (periscope) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) @@ -1555,13 +1424,11 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self grips-sound-id)) (none) ) - :code - (behavior () + :code (behavior () (hide-hud) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self raised?) #t) @@ -1573,18 +1440,8 @@ (if (nonzero? gp-0) (level-hint-spawn (game-text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) ) - (sound-play-by-name - (static-sound-name "site-moves") - (-> self grips-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self grips transform)) - ) - (set! (-> self y-offset-grips) - (seek (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) - ) + (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) + (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) (periscope-update-joints) (suspend) ) @@ -1596,17 +1453,15 @@ (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) - (while #t + (loop (set! (-> s5-0 quad) (-> self node-list data 4 bone transform vector 3 quad)) (let ((a0-10 s5-0) (f30-1 81920.0) ) (when (and *target* (>= f30-1 (vector-vector-distance a0-10 (-> *target* control trans)))) - (when (logtest? (-> *target* control status) 1) + (when (logtest? (-> *target* control status) (cshape-moving-flags onsurf)) (let ((f0-7 (fmax 4096.0 (fmin 12288.0 (+ (- 5120.0 (-> self base y)) (-> *target* control trans y)))))) - (set! (-> self y-offset-grips) - (seek (-> self y-offset-grips) f0-7 (* 16384.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self y-offset-grips) f0-7 (* 16384.0 (-> *display* seconds-per-frame))) ) ) (vector-! gp-1 (target-pos 0) (-> self base)) @@ -1642,7 +1497,7 @@ ) (when (cpad-pressed? 0 circle) (set! (-> self grips-moving?) #f) - (while #t + (loop (send-event *target* 'change-mode 'periscope self) (hide-hud) (suspend) @@ -1662,18 +1517,9 @@ ) (none) ) - :post - (behavior () + :post (behavior () (if (-> self grips-moving?) - (sound-play-by-name - (static-sound-name "site-moves") - (-> self grips-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self grips transform)) - ) + (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) (sound-stop (-> self grips-sound-id)) ) (periscope-draw-beam-impact) @@ -1684,21 +1530,18 @@ ;; failed to figure out what this is: (defstate periscope-player-control (periscope) - :exit - (behavior () + :exit (behavior () (logclear! (-> self reflector 0 draw status) (draw-status hidden)) (periscope-find-reflection-angles) (set! (-> self turn) (-> self target-turn)) (set! (-> self tilt) (-> self target-tilt)) (none) ) - :trans - (behavior () + :trans (behavior () (hide-hud) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self lock-time) (-> *display* base-frame-counter)) (link-to-next-and-prev-actor (-> self link)) (periscope-find-next) @@ -1805,7 +1648,7 @@ (send-event *camera* 'change-state cam-periscope 0) (logior! (-> self reflector 0 draw status) (draw-status hidden)) (suspend) - (while #t + (loop (if (not (-> self aligned?)) (set! (-> self lock-time) (-> *display* base-frame-counter)) ) @@ -1817,93 +1660,81 @@ (if (periscope-test-task-complete?) (close-specific-task! (game-task jungle-lurkerm) (task-status need-reminder)) ) - (while #t - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 0) - (set! (-> a1-6 message) 'end-mode) - (when (send-event-function *target* a1-6) - (cond - ((and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) - (let ((gp-1 (ppointer->handle (peri-beamcam-init-by-other (the-as string (-> self name)))))) + (loop + (when (send-event *target* 'end-mode) + (cond + ((and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) + (let ((gp-1 (ppointer->handle (peri-beamcam-init-by-other (the-as string (-> self name)))))) + (suspend) + (while (and *target* (= (-> *target* next-state name) 'target-periscope)) + (periscope-crosshair) (suspend) - (while (and *target* (= (-> *target* next-state name) 'target-periscope)) - (periscope-crosshair) - (suspend) - ) - (logclear! (-> self reflector 0 draw status) (draw-status hidden)) - (periscope-find-reflection-angles) - (set! (-> self turn) (-> self target-turn)) - (set! (-> self tilt) (-> self target-tilt)) - (set! *camera-init-mat* (-> self old-camera-matrix)) - (send-event *camera* 'change-state *camera-base-mode* 0) - (set! *camera-init-mat* #f) - (while (handle->process (the-as handle gp-1)) - (suspend) - ) ) - (let ((gp-2 (get-process *default-dead-pool* process #x4000))) - (when gp-2 - (let ((t9-18 (method-of-type process activate))) - (t9-18 gp-2 self 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process - gp-2 - (lambda ((arg0 string)) - (while (or (-> *setting-control* current ambient) - (-> *setting-control* current movie) - (-> *setting-control* current hint) - ) - (suspend) - ) - (cond - ((name= arg0 "periscope-11") - (level-hint-spawn - (game-text-id jungle-mirrors-follow-the-beam) - "sksp0053" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((name= arg0 "periscope-12") - (level-hint-spawn - (game-text-id jungle-mirrors-go-to-the-next-tower) - "sksp0052" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((name= arg0 "periscope-15") - (level-hint-spawn - (game-text-id jungle-mirrors-completion-talk-to-mayor) - "sksp0018" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ) - (none) - ) - (-> self name) - ) - (-> gp-2 ppointer) - ) + (logclear! (-> self reflector 0 draw status) (draw-status hidden)) + (periscope-find-reflection-angles) + (set! (-> self turn) (-> self target-turn)) + (set! (-> self tilt) (-> self target-tilt)) + (set! *camera-init-mat* (-> self old-camera-matrix)) + (send-event *camera* 'change-state *camera-base-mode* 0) + (set! *camera-init-mat* #f) + (while (handle->process (the-as handle gp-1)) + (suspend) ) ) - (else - (set! *camera-init-mat* (-> self old-camera-matrix)) - (send-event *camera* 'change-state *camera-base-mode* 0) - (set! *camera-init-mat* #f) - ) + (process-spawn-function + process + (lambda ((arg0 string)) + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current movie) + (-> *setting-control* current hint) + ) + (suspend) + ) + (cond + ((name= arg0 "periscope-11") + (level-hint-spawn + (game-text-id jungle-mirrors-follow-the-beam) + "sksp0053" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((name= arg0 "periscope-12") + (level-hint-spawn + (game-text-id jungle-mirrors-go-to-the-next-tower) + "sksp0052" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((name= arg0 "periscope-15") + (level-hint-spawn + (game-text-id jungle-mirrors-completion-talk-to-mayor) + "sksp0018" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ) + (none) + ) + (-> self name) + :to self + ) + ) + (else + (set! *camera-init-mat* (-> self old-camera-matrix)) + (send-event *camera* 'change-state *camera-base-mode* 0) + (set! *camera-init-mat* #f) ) - (if (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) - (go periscope-power-on) - (go periscope-wait-for-player) - ) ) + (if (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) + (go periscope-power-on) + (go periscope-wait-for-player) + ) ) (suspend) ) @@ -1912,8 +1743,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (periscope-draw-beam) (periscope-update-joints) (ja-post) @@ -1923,10 +1753,8 @@ ;; failed to figure out what this is: (defstate periscope-power-on (periscope) - :trans - periscope-debug-trans - :code - (behavior () + :trans periscope-debug-trans + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self y-offset) (-> self height)) (link-to-next-and-prev-actor (-> self link)) @@ -1935,31 +1763,20 @@ (set! (-> self tilt) (-> self target-tilt)) (let ((f30-0 (+ -20480.0 (-> self height)))) (until (= (-> self y-offset-grips) f30-0) - (set! (-> self y-offset-grips) - (seek (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) (periscope-update-joints) - (sound-play-by-name - (static-sound-name "site-moves") - (-> self grips-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self grips transform)) - ) + (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) (suspend) ) ) (sound-stop (-> self grips-sound-id)) (ja-post) - (while #t + (loop (suspend) ) (none) ) - :post - periscope-post + :post periscope-post ) ;; definition for method 11 of type periscope @@ -2013,18 +1830,7 @@ (set! (-> obj base quad) (-> obj root-override trans quad)) (set! (-> obj reflector-trans quad) (-> obj base quad)) (+! (-> obj reflector-trans y) (-> obj height)) - (let ((s5-1 (get-process *default-dead-pool* reflector #x4000))) - (set! (-> obj reflector) - (the-as (pointer reflector) (when s5-1 - (let ((t9-14 (method-of-type reflector activate))) - (t9-14 (the-as reflector s5-1) obj 'reflector (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 reflector-init-by-other (-> obj reflector-trans)) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> obj reflector) (process-spawn reflector (-> obj reflector-trans) :to obj)) (set! (-> obj link) (new 'process 'actor-link-info obj)) (periscope-find-next) (initialize-skeleton obj *periscope-base-sg* '()) @@ -2038,19 +1844,8 @@ (periscope-update-joints) (set! (-> obj grips-moving?) #f) (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "eco-beam") - :volume #x400 - :fo-max 50 - ) - (-> obj reflector-trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "eco-beam" :fo-max 50) (-> obj reflector-trans)) ) (set! (-> obj rise-sound-id) (new-sound-id)) (set! (-> obj grips-sound-id) (new-sound-id)) @@ -2085,8 +1880,7 @@ ;; failed to figure out what this is: (defstate reflector-origin-idle (reflector-origin) - :code - (behavior () + :code (behavior () (reflector-origin-update (-> self blocker)) (while (zero? (logand (-> self blocker extra perm status) (entity-perm-status complete))) (suspend) @@ -2125,13 +1919,12 @@ ) (process-entity-status! self (entity-perm-status complete) #t) (reflector-origin-update (-> self link next)) - (while #t + (loop (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (draw-power-beam (-> self reflector-trans) (-> self next-reflector-trans)) (none) ) @@ -2153,26 +1946,23 @@ ;; failed to figure out what this is: (defstate reflector-mirror-idle (reflector-mirror) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) - (sound-play-by-name (static-sound-name "mirror-smash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "mirror-smash") (go reflector-mirror-broken #f) ) ) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (new-stack-vector0))) (set! (-> gp-0 quad) (-> self root-override trans quad)) (set! (-> gp-0 y) (+ 49152.0 (-> gp-0 y))) - (while #t + (loop (draw-power-beam gp-0 (-> self beam-end)) (update! (-> self sound)) (when (logtest? (-> self draw status) (draw-status was-drawn)) @@ -2200,14 +1990,12 @@ ) (none) ) - :post - (the-as (function none :behavior reflector-mirror) ja-post) + :post (the-as (function none :behavior reflector-mirror) ja-post) ) ;; failed to figure out what this is: (defstate reflector-mirror-broken (reflector-mirror) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) @@ -2235,23 +2023,8 @@ ) (when (not arg0) (ambient-hint-spawn "gamcam21" (the-as vector #f) *entity-pool* 'camera) - (let* ((gp-1 (get-process *default-dead-pool* manipy #x4000)) - (v1-11 (when gp-1 - (let ((t9-8 (method-of-type manipy activate))) - (t9-8 (the-as manipy gp-1) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - manipy-init - (-> self root-override trans) - (-> self entity) - *reflector-mirror-break-sg* - #f - ) - (-> gp-1 ppointer) - ) - ) - ) + (let ((v1-11 (manipy-spawn (-> self root-override trans) (-> self entity) *reflector-mirror-break-sg* #f :to self)) + ) (send-event (ppointer->process v1-11) 'anim-mode 'play1) ) (let ((gp-2 (-> *display* base-frame-counter))) @@ -2272,7 +2045,7 @@ ) ) (logior! (-> self mask) (process-mask actor-pause)) - (while #t + (loop (suspend) ) (none) @@ -2324,19 +2097,8 @@ (set! (-> obj link) (new 'process 'actor-link-info obj)) (initialize-skeleton obj *reflector-mirror-sg* '()) (set-vector! (-> obj beam-end) 1805721.6 167936.0 -932659.2 1.0) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "eco-beam") - :volume #x400 - :fo-max 50 - ) - (-> obj beam-end) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "eco-beam" :fo-max 50) (-> obj beam-end)) ) (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) (go reflector-mirror-broken #t) @@ -2361,7 +2123,7 @@ (collide-kind target) (the-as process #f) t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc b/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc index fe01798b50..d2b98859fa 100644 --- a/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc +++ b/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc @@ -1,24 +1,30 @@ ;;-*-Lisp-*- (in-package goal) -;; failed to figure out what this is: -(defskelgroup *med-res-firecanyon-sg* medres-firecanyon - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -200 0 -440 530) - :longest-edge (meters 0.01) - ) +(import "goal_src/import/maindoor-ag.gc") +(import "goal_src/import/junglecam-ag.gc") +(import "goal_src/import/precurbridge-ag.gc") +(import "goal_src/import/sidedoor-ag.gc") +(import "goal_src/import/towertop-ag.gc") +(import "goal_src/import/logtrap-ag.gc") +(import "goal_src/import/lurkerm-tall-sail-ag.gc") +(import "goal_src/import/medres-firecanyon-ag.gc") +(import "goal_src/import/lurkerm-piston-ag.gc") +(import "goal_src/import/accordian-ag.gc") ;; failed to figure out what this is: -(defskelgroup *jungle-camera-sg* jungle-camera - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :texture-level 2 - ) +(defskelgroup *med-res-firecanyon-sg* medres-firecanyon medres-firecanyon-lod0-jg medres-firecanyon-idle-ja + ((medres-firecanyon-lod0-mg (meters 999999))) + :bounds (static-spherem -200 0 -440 530) + :longest-edge (meters 0.01) + ) + +;; failed to figure out what this is: +(defskelgroup *jungle-camera-sg* jungle-camera 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :texture-level 2 + ) ;; definition of type logtrap (deftype logtrap (process-drawable) @@ -42,37 +48,25 @@ ) ;; failed to figure out what this is: -(defskelgroup *logtrap-sg* logtrap - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 8 0 13) - :longest-edge (meters 6) - :shadow 3 - ) +(defskelgroup *logtrap-sg* logtrap logtrap-lod0-jg logtrap-idle-ja + ((logtrap-lod0-mg (meters 20)) (logtrap-lod1-mg (meters 999999))) + :bounds (static-spherem 0 8 0 13) + :longest-edge (meters 6) + :shadow logtrap-shadow-mg + ) ;; failed to figure out what this is: (defstate idle (logtrap) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (or (= arg2 'touch) (= arg2 'attack)) (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) ) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (logtest? (-> self draw status) (draw-status was-drawn)) (cond @@ -88,11 +82,7 @@ ) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) @@ -151,41 +141,24 @@ ) ;; failed to figure out what this is: -(defskelgroup *towertop-sg* towertop - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *towertop-sg* towertop towertop-lod0-jg towertop-idle-ja + ((towertop-lod0-mg (meters 20)) (towertop-lod1-mg (meters 40)) (towertop-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) ;; failed to figure out what this is: (defstate towertop-idle (towertop) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 0.4) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max 0.4) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 0.4) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.4)) ) ) (none) ) - :post - (the-as (function none :behavior towertop) ja-post) + :post (the-as (function none :behavior towertop) ja-post) ) ;; definition for method 11 of type towertop @@ -226,18 +199,18 @@ ) ;; failed to figure out what this is: -(defskelgroup *lurkerm-tall-sail-sg* lurkerm-tall-sail - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 5 0 7) - :longest-edge (meters 4) - ) +(defskelgroup *lurkerm-tall-sail-sg* lurkerm-tall-sail lurkerm-tall-sail-lod0-jg lurkerm-tall-sail-idle-ja + ((lurkerm-tall-sail-lod0-mg (meters 20)) + (lurkerm-tall-sail-lod1-mg (meters 40)) + (lurkerm-tall-sail-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 5 0 7) + :longest-edge (meters 4) + ) ;; failed to figure out what this is: (defstate lurkerm-tall-sail-idle (lurkerm-tall-sail) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'stop) (process-entity-status! self (entity-perm-status complete) #t) @@ -249,20 +222,10 @@ ) ) ) - :trans - (the-as (function none :behavior lurkerm-tall-sail) rider-trans) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) (* 0.5 (-> self speed))) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :trans (the-as (function none :behavior lurkerm-tall-sail) rider-trans) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-local-y! (-> self root-override quat) @@ -270,17 +233,12 @@ (* 12743.111 (-> *display* seconds-per-frame) (-> self speed)) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) (* 0.5 (-> self speed))) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (* 0.5 (-> self speed)))) ) ) (none) ) - :post - (the-as (function none :behavior lurkerm-tall-sail) rider-post) + :post (the-as (function none :behavior lurkerm-tall-sail) rider-post) ) ;; definition for method 11 of type lurkerm-tall-sail @@ -354,18 +312,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *lurkerm-short-sail-sg* lurkerm-short-sail - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 5 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *lurkerm-short-sail-sg* lurkerm-short-sail 0 4 + ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) + :bounds (static-spherem 0 5 0 9) + ) ;; failed to figure out what this is: (defstate lurkerm-short-sail-idle (lurkerm-short-sail) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'stop) (process-entity-status! self (entity-perm-status complete) #t) @@ -377,20 +331,10 @@ ) ) ) - :trans - (the-as (function none :behavior lurkerm-short-sail) rider-trans) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) (* 0.5 (-> self speed))) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :trans (the-as (function none :behavior lurkerm-short-sail) rider-trans) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-local-y! (-> self root-override quat) @@ -398,17 +342,12 @@ (* -12743.111 (-> *display* seconds-per-frame) (-> self speed)) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) (* 0.5 (-> self speed))) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (* 0.5 (-> self speed)))) ) ) (none) ) - :post - (the-as (function none :behavior lurkerm-short-sail) rider-post) + :post (the-as (function none :behavior lurkerm-short-sail) rider-post) ) ;; definition for method 11 of type lurkerm-short-sail @@ -505,18 +444,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *lurkerm-piston-sg* lurkerm-piston - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *lurkerm-piston-sg* lurkerm-piston lurkerm-piston-geo-jg lurkerm-piston-idle-ja + ((lurkerm-piston-geo-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) ;; failed to figure out what this is: (defstate lurkerm-piston-idle (lurkerm-piston) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'stop) (process-entity-status! self (entity-perm-status complete) #t) @@ -528,20 +463,10 @@ ) ) ) - :trans - (the-as (function none :behavior lurkerm-piston) rider-trans) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) (-> self speed)) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + :trans (the-as (function none :behavior lurkerm-piston) rider-trans) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! max (-> self speed)) :frame-num 0.0) (until (ja-done? 0) (let ((gp-0 (new-stack-vector0))) (set! (-> gp-0 quad) (-> self base quad)) @@ -549,17 +474,12 @@ (move-to-point! (-> self root-override) gp-0) ) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) (-> self speed)) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self speed))) ) ) (none) ) - :post - (the-as (function none :behavior lurkerm-piston) rider-post) + :post (the-as (function none :behavior lurkerm-piston) rider-post) ) ;; definition for method 11 of type lurkerm-piston @@ -653,18 +573,15 @@ ) ;; failed to figure out what this is: -(defskelgroup *accordian-sg* accordian - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem -7 0 23 25) - :longest-edge (meters 4) - ) +(defskelgroup *accordian-sg* accordian accordian-lod0-jg accordian-idle-ja + ((accordian-lod0-mg (meters 20)) (accordian-lod1-mg (meters 999999))) + :bounds (static-spherem -7 0 23 25) + :longest-edge (meters 4) + ) ;; failed to figure out what this is: (defstate accordian-idle (accordian) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'stop) (process-entity-status! self (entity-perm-status complete) #t) @@ -676,21 +593,13 @@ ) ) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + :code (behavior () + (ja-no-eval :num! (loop!) :frame-num 0.0) (ja-post) - (while #t + (loop (suspend) (when (logtest? (-> self draw status) (draw-status was-drawn)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (-> self speed)) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! (-> self speed))) (ja-post) ) ) @@ -715,13 +624,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *junglecam-sg* junglecam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 80) - :longest-edge (meters 0) - ) +(defskelgroup *junglecam-sg* junglecam junglecam-lod0-jg junglecam-beamcam-ja + ((junglecam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) ;; definition of type junglecam (deftype junglecam (process-hidden) @@ -783,33 +689,16 @@ ;; failed to figure out what this is: (defstate pov-camera-playing (precurbridgecam) :virtual #t - :code - (behavior () + :code (behavior () (ambient-hint-spawn "gamcam30" (the-as vector #f) *entity-pool* 'camera) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - ) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> gp-0 param 0) (ja-aframe 0.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja :group! (-> self draw art-group data 8)) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek! (ja-aframe 0.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 0.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 0.0 0))) ) (send-event (ppointer->process (-> self parent)) 'go) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) @@ -865,89 +754,64 @@ ) ;; failed to figure out what this is: -(defskelgroup *precurbridge-sg* precurbridge - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 40) - :longest-edge (meters 3.6) - ) +(defskelgroup *precurbridge-sg* precurbridge precurbridge-geo-jg precurbridge-idle-ja + ((precurbridge-geo-mg (meters 20)) (precurbridge-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 40) + :longest-edge (meters 3.6) + ) ;; failed to figure out what this is: (defstate precurbridge-idle (precurbridge) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('go) (go precurbridge-activate) ) ) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 3) :num! min) (transform-post) - (while #t + (loop (when (and *target* (< (vector-vector-xz-distance (-> self activation-point) (-> *target* control trans)) 49152.0) (< (-> self activation-point y) (-> *target* control trans y)) (< (-> *target* control trans y) (+ 20480.0 (-> self activation-point y))) (not (-> self child)) ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'powerup)) - (set! (-> a1-2 param 1) (the-as uint 3)) - (cond - ((send-event-function *target* a1-2) - (logclear! (-> self mask) (process-mask actor-pause)) - (logclear! (-> self mask) (process-mask platform)) - (let ((gp-1 (entity-by-name "junglecam-1"))) - (cond - (gp-1 - (let ((s5-0 (get-process *default-dead-pool* precurbridgecam #x4000))) - (when s5-0 - (let ((t9-6 (method-of-type precurbridgecam activate))) - (t9-6 (the-as precurbridgecam s5-0) self 'precurbridgecam (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> gp-1 extra trans) - *junglecam-sg* - "precurbridgecam" - 0 - #f - '() - ) - (-> s5-0 ppointer) - ) - ) - ) - (else - (format #t "ERROR: position for precursor bridge camera not found~%") - (go precurbridge-activate) + (cond + ((send-event *target* 'query 'powerup (pickup-type eco-blue)) + (logclear! (-> self mask) (process-mask actor-pause)) + (logclear! (-> self mask) (process-mask platform)) + (let ((gp-1 (entity-by-name "junglecam-1"))) + (cond + (gp-1 + (process-spawn + precurbridgecam + :init pov-camera-init-by-other + (-> gp-1 extra trans) + *junglecam-sg* + "precurbridgecam" + 0 + #f + '() + :to self ) ) + (else + (format #t "ERROR: position for precursor bridge camera not found~%") + (go precurbridge-activate) + ) ) ) - (else - (level-hint-spawn - (game-text-id jungle-precursorbridge-hint) - "sksp0039" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + ) + (else + (level-hint-spawn + (game-text-id jungle-precursorbridge-hint) + "sksp0039" + (the-as entity #f) + *entity-pool* + (game-task none) ) ) ) @@ -956,62 +820,36 @@ ) (none) ) - :post - (the-as (function none :behavior precurbridge) ja-post) + :post (the-as (function none :behavior precurbridge) ja-post) ) ;; failed to figure out what this is: (defstate precurbridge-activate (precurbridge) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (the-as (function none :behavior precurbridge) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior precurbridge) rider-trans) + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 0.25) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.25) :frame-num 0.0) (until (ja-done? 0) (if (rand-vu-percent? 0.1) (spawn-projectile-blue *target*) ) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 0.25) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.25)) ) (go precurbridge-active #f) (none) ) - :post - (the-as (function none :behavior precurbridge) rider-post) + :post (the-as (function none :behavior precurbridge) rider-post) ) ;; failed to figure out what this is: (defstate precurbridge-active (precurbridge) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -1028,78 +866,41 @@ ) ) ) - :trans - (the-as (function none :behavior precurbridge) rider-trans) - :code - (behavior ((arg0 symbol)) + :trans (the-as (function none :behavior precurbridge) rider-trans) + :code (behavior ((arg0 symbol)) (set! (-> self draw bounds w) 81920.0) (when arg0 (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 4) :num! min) ) (ja-post) (update-transforms! (-> self root-override)) (logior! (-> self mask) (process-mask actor-pause)) - (while #t + (loop (if (not (movie?)) (set! (-> self mask) (logior (process-mask platform) (-> self mask))) ) (cond ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - ) - (ja-channel-push! 1 60) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (when (not (ja-group? (-> self draw art-group data 5))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 5) :num! min) ) ) (else - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 4) - ) - ) - (ja-channel-push! 1 60) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) + (when (not (ja-group? (-> self draw art-group data 4))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 4) :num! min) ) ) ) (update! (-> self sound)) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) 0.4) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! 0.4)) (suspend) ) (none) ) - :post - (the-as (function none :behavior precurbridge) rider-post) + :post (the-as (function none :behavior precurbridge) rider-post) ) ;; definition for method 11 of type precurbridge @@ -1316,45 +1117,30 @@ ) ;; failed to figure out what this is: -(defskelgroup *maindoor-sg* maindoor - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *maindoor-sg* maindoor maindoor-lod0-jg maindoor-idle-ja + ((maindoor-lod0-mg (meters 20)) (maindoor-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + ) ;; failed to figure out what this is: (defstate maindoor-closed (maindoor) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (set! (-> self draw force-lod) 1) (logclear! (-> self draw status) (draw-status hidden)) - (when arg0 - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 num-func) num-func-identity) - (set! (-> v1-6 frame-num) 0.0) + (if arg0 + (ja :num-func num-func-identity :frame-num 0.0) ) - ) (suspend) (update-transforms! (-> self root-override)) - (while #t + (loop (when (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) (and (and *target* (>= (-> self thresh w) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) (go maindoor-open #f) ) (if (and *target* @@ -1372,11 +1158,7 @@ (set! (-> self root-override root-prim prim-core action) (collide-action solid)) (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) 0.0) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) (ja-post) (suspend) ) @@ -1386,38 +1168,29 @@ ;; failed to figure out what this is: (defstate maindoor-open (maindoor) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (set! (-> self draw force-lod) 0) (logclear! (-> self draw status) (draw-status hidden)) (process-entity-status! self (entity-perm-status complete) #t) - (when arg0 - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 num-func) num-func-identity) - (set! (-> v1-6 frame-num) (the float (+ (-> v1-6 frame-group data 0 length) -1))) + (if arg0 + (ja :num-func num-func-identity :frame-num max) ) - ) (set! (-> self root-override root-prim prim-core action) (collide-action)) (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) (while (not (ja-max? 0)) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 2.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 2.0)) (if (and (not arg0) (rand-vu-percent? 0.2)) (spawn-projectile-blue *target*) ) (suspend) ) (logior! (-> self draw status) (draw-status hidden)) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior maindoor) ja-post) + :post (the-as (function none :behavior maindoor) ja-post) ) ;; definition for method 11 of type maindoor @@ -1445,7 +1218,7 @@ (and (and *target* (>= (-> obj thresh w) (vector-vector-distance (-> obj root-override trans) (-> *target* control trans))) ) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) (go maindoor-open #t) @@ -1472,13 +1245,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *sidedoor-sg* sidedoor - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *sidedoor-sg* sidedoor sidedoor-geo-jg sidedoor-idle-ja + ((sidedoor-geo-mg (meters 20)) (sidedoor-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; definition for method 24 of type sidedoor ;; INFO: Return type mismatch int vs none. @@ -1551,25 +1321,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *jngpusher-sg* jngpusher - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *jngpusher-sg* jngpusher 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 10)) ;; failed to figure out what this is: (defstate jngpusher-idle (jngpusher) - :trans - (the-as (function none :behavior jngpusher) rider-trans) - :code - (behavior () - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 num-func) num-func-identity) - (set! (-> gp-0 frame-num) (get-current-value-with-mirror (-> self sync) (the float (ja-num-frames 0)))) - ) + :trans (the-as (function none :behavior jngpusher) rider-trans) + :code (behavior () + (loop + (ja :num-func num-func-identity + :frame-num (get-current-value-with-mirror (-> self sync) (the float (ja-num-frames 0))) + ) (cond ((< (ja-frame-num 0) (the float (/ (ja-num-frames 0) 3))) (set! (-> self back-prim prim-core collide-as) (collide-kind)) @@ -1585,8 +1346,7 @@ ) (none) ) - :post - (the-as (function none :behavior jngpusher) rider-post) + :post (the-as (function none :behavior jngpusher) rider-post) ) ;; definition for method 11 of type jngpusher @@ -1659,8 +1419,7 @@ :count 3 :converted #f :normal-scale 1.5 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 30.0 :xdiv -2 :speed 4.0) (new 'static 'ripple-wave :scale 30.0 :xdiv 1 :zdiv -1 :speed 4.0) (new 'static 'ripple-wave :scale 10.0 :xdiv -5 :zdiv -3 :speed 2.0) diff --git a/test/decompiler/reference/levels/jungle/jungle-part_REF.gc b/test/decompiler/reference/levels/jungle/jungle-part_REF.gc index d07dbc8c3d..9fea6821fe 100644 --- a/test/decompiler/reference/levels/jungle/jungle-part_REF.gc +++ b/test/decompiler/reference/levels/jungle/jungle-part_REF.gc @@ -20,8 +20,7 @@ ;; failed to figure out what this is: (defpart 833 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.9 0.9 1.0) (sp-rnd-flt spt-x (meters -8) (meters 4) 1.0) (sp-flt spt-y (meters 47.5)) @@ -47,8 +46,7 @@ ;; failed to figure out what this is: (defpart 834 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters 6) (meters 6) 1.0) (sp-flt spt-y (meters -6.5)) @@ -76,8 +74,7 @@ ;; failed to figure out what this is: (defpart 835 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 1) 1.0) @@ -103,8 +100,7 @@ ;; failed to figure out what this is: (defpart 836 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -8) (meters 4) 1.0) (sp-flt spt-y (meters 47.5)) @@ -131,8 +127,7 @@ ;; failed to figure out what this is: (defpart 837 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.4 1.0) (sp-rnd-flt spt-x (meters -7) (meters 3.5) 1.0) (sp-flt spt-y (meters 47.5)) @@ -159,8 +154,7 @@ ;; failed to figure out what this is: (defpart 838 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.8 0.8 1.0) (sp-rnd-flt spt-x (meters -10) (meters 4) 1.0) (sp-flt spt-y (meters 20)) @@ -187,8 +181,7 @@ ;; failed to figure out what this is: (defpart 839 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.6 0.4 1.0) (sp-rnd-flt spt-x (meters -9) (meters 3.5) 1.0) (sp-flt spt-y (meters 20)) @@ -216,8 +209,7 @@ ;; failed to figure out what this is: (defpart 840 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 4) 1.0) (sp-flt spt-y (meters 20)) @@ -245,8 +237,7 @@ ;; failed to figure out what this is: (defpart 841 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters 0) (meters 6) 1.0) (sp-flt spt-y (meters -4.5)) @@ -275,8 +266,7 @@ ;; failed to figure out what this is: (defpart 842 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters 1) (meters 7) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 1) 1.0) @@ -303,8 +293,7 @@ ;; failed to figure out what this is: (defpart 843 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 1.0 0.6 1.0) (sp-rnd-flt spt-x (meters -9) (meters 4) 1.0) (sp-flt spt-y (meters 20)) @@ -331,8 +320,7 @@ ;; failed to figure out what this is: (defpart 844 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.9 0.4 1.0) (sp-rnd-flt spt-x (meters -8) (meters 3.5) 1.0) (sp-flt spt-y (meters 20)) @@ -360,8 +348,7 @@ ;; failed to figure out what this is: (defpart 845 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -9) (meters 4) 1.0) (sp-flt spt-y (meters 20)) @@ -389,8 +376,7 @@ ;; failed to figure out what this is: (defpart 846 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters 0) (meters 6) 1.0) (sp-flt spt-y (meters -3.4)) @@ -419,8 +405,7 @@ ;; failed to figure out what this is: (defpart 847 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 7) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 1) 1.0) @@ -447,8 +432,7 @@ ;; failed to figure out what this is: (defpart 848 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.8 0.8 1.0) (sp-rnd-flt spt-x (meters -12) (meters 4) 1.0) (sp-flt spt-y (meters 25)) @@ -475,8 +459,7 @@ ;; failed to figure out what this is: (defpart 849 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.6 0.4 1.0) (sp-rnd-flt spt-x (meters -11) (meters 3.5) 1.0) (sp-flt spt-y (meters 25)) @@ -504,8 +487,7 @@ ;; failed to figure out what this is: (defpart 850 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -12) (meters 4) 1.0) (sp-flt spt-y (meters 25)) @@ -533,8 +515,7 @@ ;; failed to figure out what this is: (defpart 851 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters -3) (meters 6) 1.0) (sp-flt spt-y (meters -4.5)) @@ -563,8 +544,7 @@ ;; failed to figure out what this is: (defpart 852 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2) (meters 7) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 1) 1.0) @@ -594,8 +574,7 @@ :id 180 :flags (always-draw) :bounds (static-bspherem 0 25 0 100) - :parts - ((sp-item 833) + :parts ((sp-item 833) (sp-item 833 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 834) (sp-item 834 :fade-after (meters 120) :falloff-to (meters 120)) @@ -610,8 +589,7 @@ :id 181 :flags (always-draw) :bounds (static-bspherem 2 9 4 90) - :parts - ((sp-item 838) + :parts ((sp-item 838) (sp-item 838 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 841) (sp-item 841 :fade-after (meters 120) :falloff-to (meters 120)) @@ -626,8 +604,7 @@ :id 182 :flags (always-draw) :bounds (static-bspherem 0 8 0 90) - :parts - ((sp-item 843) + :parts ((sp-item 843) (sp-item 843 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 846) (sp-item 846 :fade-after (meters 120) :falloff-to (meters 120)) @@ -642,8 +619,7 @@ :id 183 :flags (always-draw) :bounds (static-bspherem 0 10 8 90) - :parts - ((sp-item 848) + :parts ((sp-item 848) (sp-item 848 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 851) (sp-item 851 :fade-after (meters 120) :falloff-to (meters 120)) @@ -655,8 +631,7 @@ ;; failed to figure out what this is: (defpart 853 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -70) (meters 100) 1.0) (sp-rnd-flt spt-y (meters 3.5) (meters 4) 1.0) @@ -680,8 +655,7 @@ ;; failed to figure out what this is: (defpart 854 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) @@ -694,8 +668,7 @@ ;; failed to figure out what this is: (defpart 855 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0023333333)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0023333333)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r -0.64) (sp-flt spt-fade-g -0.85333335) @@ -707,8 +680,7 @@ ;; failed to figure out what this is: (defpart 856 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) @@ -719,8 +691,7 @@ ;; failed to figure out what this is: (defpart 857 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.0023333333)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.0023333333)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.64) (sp-flt spt-fade-g 0.85333335) @@ -731,8 +702,7 @@ ;; failed to figure out what this is: (defpart 858 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) @@ -745,8 +715,7 @@ ;; failed to figure out what this is: (defpart 859 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0023333333)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0023333333)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r -0.64) (sp-flt spt-fade-g -0.85333335) @@ -758,8 +727,7 @@ ;; failed to figure out what this is: (defpart 860 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) @@ -770,8 +738,7 @@ ;; failed to figure out what this is: (defpart 861 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.0023333333)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.0023333333)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.64) (sp-flt spt-fade-g 0.85333335) @@ -782,8 +749,7 @@ ;; failed to figure out what this is: (defpart 862 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) @@ -796,8 +762,7 @@ ;; failed to figure out what this is: (defpart 863 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) @@ -807,8 +772,7 @@ ;; failed to figure out what this is: (defpart 864 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.02) (sp-rnd-flt spt-x (meters -55) (meters 75) 1.0) (sp-flt spt-y (meters 28)) @@ -835,16 +799,14 @@ ;; failed to figure out what this is: (defpart 865 - :init-specs - ((sp-flt spt-fade-a -0.02)) + :init-specs ((sp-flt spt-fade-a -0.02)) ) ;; failed to figure out what this is: (defpartgroup group-jungle-dapple-light-1 :id 184 :bounds (static-bspherem 0 0 0 55) - :parts - ((sp-item 864 :hour-mask #b111111100000000000111111) + :parts ((sp-item 864 :hour-mask #b111111100000000000111111) (sp-item 853 :fade-after (meters 130) :falloff-to (meters 160) :hour-mask #b11111111111000000) ) ) @@ -853,8 +815,7 @@ (defpartgroup group-jungle-tower-spewer :id 185 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 866 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 866 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 866 :fade-after (meters 50) :falloff-to (meters 50)) (sp-item 867 :fade-after (meters 300) :falloff-to (meters 300)) (sp-item 868 :fade-after (meters 400) :falloff-to (meters 400)) @@ -863,8 +824,7 @@ ;; failed to figure out what this is: (defpart 866 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.25 1.0 1.0) (sp-rnd-flt spt-y (meters 1.6) (meters 2) 1.0) (sp-rnd-flt spt-scale-x (meters 5) (meters 1) 1.0) @@ -888,8 +848,7 @@ ;; failed to figure out what this is: (defpart 869 - :init-specs - ((sp-flt spt-r 64.0) + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) (sp-flt spt-fade-r -0.4) (sp-flt spt-fade-g -0.4) @@ -899,8 +858,7 @@ ;; failed to figure out what this is: (defpart 867 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 1.0 2.5 1.0) (sp-flt spt-y (meters 0.75)) (sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) @@ -920,8 +878,7 @@ ;; failed to figure out what this is: (defpart 868 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.1 1.25 1.0) (sp-flt spt-y (meters 0.75)) (sp-rnd-flt spt-scale-x (meters 3.5) (meters 2) 1.0) @@ -943,8 +900,7 @@ ;; failed to figure out what this is: (defpart 870 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 0.75)) (sp-flt spt-scale-x (meters 4)) @@ -969,16 +925,14 @@ ;; failed to figure out what this is: (defpart 871 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) ;; failed to figure out what this is: (defpartgroup group-jungle-lurkermachine-3 :id 186 :bounds (static-bspherem 0 6 6 16) - :parts - ((sp-item 872 :fade-after (meters 140) :falloff-to (meters 160) :period 300 :length 258) + :parts ((sp-item 872 :fade-after (meters 140) :falloff-to (meters 160) :period 300 :length 258) (sp-item 872 :fade-after (meters 140) :falloff-to (meters 160) :period 202 :length 36) (sp-item 872 :fade-after (meters 100) :falloff-to (meters 120) :period 450 :length 38) (sp-item 872 :fade-after (meters 100) :falloff-to (meters 120) :period 857 :length 106) @@ -1038,8 +992,7 @@ ;; failed to figure out what this is: (defpart 894 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters 3.8)) (sp-flt spt-y (meters 4.5)) @@ -1069,8 +1022,7 @@ ;; failed to figure out what this is: (defpart 893 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters 3.8)) (sp-flt spt-y (meters 4.5)) @@ -1101,8 +1053,7 @@ ;; failed to figure out what this is: (defpart 892 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 4.7)) @@ -1133,8 +1084,7 @@ ;; failed to figure out what this is: (defpart 891 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 4.7)) @@ -1166,8 +1116,7 @@ ;; failed to figure out what this is: (defpart 890 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters -6.5)) (sp-flt spt-y (meters 2.3)) @@ -1198,8 +1147,7 @@ ;; failed to figure out what this is: (defpart 889 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters -6.5)) (sp-flt spt-y (meters 2.3)) @@ -1233,8 +1181,7 @@ ;; failed to figure out what this is: (defpart 888 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters -6.3)) (sp-flt spt-y (meters 6.8)) @@ -1264,8 +1211,7 @@ ;; failed to figure out what this is: (defpart 887 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters -6.3)) (sp-flt spt-y (meters 6.8)) @@ -1296,8 +1242,7 @@ ;; failed to figure out what this is: (defpart 886 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters 8.7)) (sp-flt spt-y (meters 6.8)) @@ -1328,8 +1273,7 @@ ;; failed to figure out what this is: (defpart 885 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters 8.7)) (sp-flt spt-y (meters 6.8)) @@ -1361,8 +1305,7 @@ ;; failed to figure out what this is: (defpart 884 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters 6.9)) (sp-flt spt-y (meters 5.3)) @@ -1392,8 +1335,7 @@ ;; failed to figure out what this is: (defpart 883 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters 6.9)) (sp-flt spt-y (meters 5.3)) @@ -1424,8 +1366,7 @@ ;; failed to figure out what this is: (defpart 882 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters 2.9)) (sp-flt spt-y (meters 8.9)) @@ -1456,8 +1397,7 @@ ;; failed to figure out what this is: (defpart 881 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters 2.9)) (sp-flt spt-y (meters 8.9)) @@ -1489,8 +1429,7 @@ ;; failed to figure out what this is: (defpart 880 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters -7.7)) (sp-flt spt-y (meters 2.3)) @@ -1521,8 +1460,7 @@ ;; failed to figure out what this is: (defpart 879 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters -7.7)) (sp-flt spt-y (meters 2.3)) @@ -1556,14 +1494,12 @@ ;; failed to figure out what this is: (defpart 895 - :init-specs - ((sp-flt spt-vel-y (meters 0))) + :init-specs ((sp-flt spt-vel-y (meters 0))) ) ;; failed to figure out what this is: (defpart 878 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters -4.2)) (sp-flt spt-y (meters 10.9)) @@ -1593,8 +1529,7 @@ ;; failed to figure out what this is: (defpart 877 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters -4.2)) (sp-flt spt-y (meters 10.9)) @@ -1625,8 +1560,7 @@ ;; failed to figure out what this is: (defpart 876 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-flt spt-x (meters -8.2)) (sp-flt spt-y (meters 6.8)) @@ -1657,8 +1591,7 @@ ;; failed to figure out what this is: (defpart 875 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters -8.2)) (sp-flt spt-y (meters 6.8)) @@ -1690,8 +1623,7 @@ ;; failed to figure out what this is: (defpart 872 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters -2.2) (meters 2.4) 1.0) (sp-rnd-flt spt-y (meters 5.5) (meters 1.3) 1.0) @@ -1723,8 +1655,7 @@ ;; failed to figure out what this is: (defpart 873 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters -3.75) (meters 2.4) 1.0) (sp-rnd-flt spt-y (meters 8.5) (meters 1.3) 1.0) @@ -1756,8 +1687,7 @@ ;; failed to figure out what this is: (defpart 874 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-rnd-flt spt-x (meters -10.5) (meters 0.8) 1.0) (sp-flt spt-y (meters 1.3)) @@ -1791,8 +1721,7 @@ (defpartgroup group-jungle-lurkermachine-1 :id 187 :bounds (static-bspherem 0 10 0 12) - :parts - ((sp-item 896 :fade-after (meters 140) :falloff-to (meters 160) :period 300 :length 258) + :parts ((sp-item 896 :fade-after (meters 140) :falloff-to (meters 160) :period 300 :length 258) (sp-item 896 :fade-after (meters 140) :falloff-to (meters 160) :period 202 :length 36) (sp-item 896 :fade-after (meters 100) :falloff-to (meters 120) :period 450 :length 38) (sp-item 896 :fade-after (meters 100) :falloff-to (meters 120) :period 857 :length 106) @@ -1812,8 +1741,7 @@ ;; failed to figure out what this is: (defpart 896 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters 1) (meters 2.2) 1.0) (sp-rnd-flt spt-y (meters 9.4) (meters 1.3) 1.0) @@ -1845,8 +1773,7 @@ ;; failed to figure out what this is: (defpart 897 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters -1.2) (meters 2.4) 1.0) (sp-rnd-flt spt-y (meters 8.5) (meters 1.3) 1.0) @@ -1878,8 +1805,7 @@ ;; failed to figure out what this is: (defpart 898 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-flt spt-x (meters 4.4)) (sp-rnd-flt spt-y (meters 8.5) (meters 1.3) 1.0) diff --git a/test/decompiler/reference/levels/jungle/junglefish_REF.gc b/test/decompiler/reference/levels/jungle/junglefish_REF.gc index db0883cbf0..9e70ff6ce3 100644 --- a/test/decompiler/reference/levels/jungle/junglefish_REF.gc +++ b/test/decompiler/reference/levels/jungle/junglefish_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/junglefish-ag.gc") + ;; definition of type junglefish (deftype junglefish (nav-enemy) () @@ -19,13 +21,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *junglefish-sg* junglefish - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 1.5) - :longest-edge (meters 0) - ) +(defskelgroup *junglefish-sg* junglefish junglefish-lod0-jg junglefish-swim-ja + ((junglefish-lod0-mg (meters 20)) (junglefish-lod1-mg (meters 40)) (junglefish-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.5) + ) ;; failed to figure out what this is: nav-enemy-default-event-handler @@ -42,137 +41,60 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-patrol (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :exit - (behavior () + :exit (behavior () (set! (-> self target-speed) (-> self nav-info walk-travel-speed)) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (while #t - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-2 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (when (nav-enemy-rnd-go-idle? 0.2) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) 1.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 180) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) (set! (-> self target-speed) 0.0) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - (set! (-> a0-8 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-8 param 1) f30-0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! - a0-8 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) f30-0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (until (not (nav-enemy-rnd-go-idle? 0.2)) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - (set! (-> a0-11 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-11 param 1) f30-0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! - a0-11 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) f30-0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (set! (-> self target-speed) (-> self nav-info walk-travel-speed)) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) 1.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 180) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-17 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-17 param 1) f30-0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! - a0-17 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! - ) - ) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) f30-0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -184,13 +106,11 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-notice (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-chase) (none) ) @@ -199,13 +119,11 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-chase (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :trans - (behavior () + :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) (if (and *target* (>= 8192.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (go-virtual nav-enemy-attack) @@ -217,13 +135,11 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-stop-chase (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-patrol) (none) ) @@ -232,13 +148,11 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-stare (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-patrol) (none) ) @@ -247,13 +161,11 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-give-up (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (go-virtual nav-enemy-patrol) (none) ) @@ -262,82 +174,41 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-attack (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! junglefish-chomp-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-chase) (none) ) - :post - (the-as (function none :behavior junglefish) nav-enemy-chase-post) + :post (the-as (function none :behavior junglefish) nav-enemy-chase-post) ) ;; failed to figure out what this is: (defstate nav-enemy-victory (junglefish) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglefish) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 2.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! junglefish-swim-ja :num! (seek! max 2.0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 2.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 2.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + (ja :num! (seek! max 2.0)) ) + (ja-no-eval :group! junglefish-swim-ja :num! (seek! max 2.0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 2.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 2.0)) ) (go-virtual nav-enemy-patrol) (none) @@ -392,7 +263,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -423,7 +294,7 @@ nav-enemy-default-event-handler (initialize-skeleton obj *junglefish-sg* '()) (TODO-RENAME-45 obj *junglefish-nav-enemy-info*) (set! (-> obj water) (new 'process 'water-control obj 7 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (the-as uint 2)) + (set! (-> obj water flags) (water-flags wt01)) (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) (set! (-> obj water ripple-size) 5734.4) (set! (-> obj collide-info trans y) (+ -4096.0 (-> obj water height))) diff --git a/test/decompiler/reference/levels/jungle/junglesnake_REF.gc b/test/decompiler/reference/levels/jungle/junglesnake_REF.gc index 5ad287d246..d1dab83b2d 100644 --- a/test/decompiler/reference/levels/jungle/junglesnake_REF.gc +++ b/test/decompiler/reference/levels/jungle/junglesnake_REF.gc @@ -1,28 +1,26 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/junglesnake-ag.gc") + ;; failed to figure out what this is: -(defskelgroup *junglesnake-sg* junglesnake - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 14 0 18) - :longest-edge (meters 2.5) - ) +(defskelgroup *junglesnake-sg* junglesnake junglesnake-lod0-jg junglesnake-idle-ja + ((junglesnake-lod0-mg (meters 999999))) + :bounds (static-spherem 0 14 0 18) + :longest-edge (meters 2.5) + ) ;; failed to figure out what this is: (defpartgroup group-junglesnake-dropping-down :id 173 :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 799 :period 300 :length 150)) + :parts ((sp-item 799 :period 300 :length 150)) ) ;; failed to figure out what this is: (defpart 799 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -9) (meters 18) 1.0) (sp-flt spt-y (meters -6)) @@ -153,34 +151,26 @@ ) ) (cond - ((and (-> self is-lethal?) (zero? (logand (-> *target* state-flags) #x80f8))) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (set! (-> a1-2 param 1) (the-as uint (new 'static 'attack-info))) - (when (send-event-function arg0 a1-2) - (let ((v0-1 (the-as object #t))) - (set! (-> self hit-player) (the-as symbol v0-1)) - v0-1 - ) + ((and (-> self is-lethal?) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + ) + (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + (let ((v0-1 (the-as object #t))) + (set! (-> self hit-player) (the-as symbol v0-1)) + v0-1 ) ) ) (else (do-push-aways! (-> self root-override)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'shove) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((v1-17 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-17 shove-back) 8192.0) - (set! (-> v1-17 shove-up) 2048.0) - (set! (-> a1-3 param 1) (the-as uint v1-17)) - ) - (send-event-function arg0 a1-3) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-back (meters 2)) (shove-up (meters 0.5)))) ) ) ) @@ -377,10 +367,8 @@ junglesnake-default-event-handler ;; failed to figure out what this is: (defstate junglesnake-sleeping (junglesnake) - :event - junglesnake-default-event-handler - :enter - (behavior () + :event junglesnake-default-event-handler + :enter (behavior () (set! (-> self skel postbind-function) #f) (set! (-> self track-player-ry) #f) (set! (-> self track-player-tilt) #f) @@ -389,8 +377,7 @@ junglesnake-default-event-handler (logior! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (when *target* (let* ((a0-1 (target-pos 0)) (f0-1 (- (-> a0-1 y) (-> self root-override trans y))) @@ -402,8 +389,7 @@ junglesnake-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -413,10 +399,8 @@ junglesnake-default-event-handler ;; failed to figure out what this is: (defstate junglesnake-wake (junglesnake) - :event - junglesnake-default-event-handler - :enter - (behavior () + :event junglesnake-default-event-handler + :enter (behavior () (logclear! (-> self draw status) (draw-status hidden)) (set! (-> self track-player-ry) #f) (set! (-> self track-player-tilt) #f) @@ -425,8 +409,7 @@ junglesnake-default-event-handler 0 (none) ) - :trans - (behavior () + :trans (behavior () (dummy-20 self) (when *target* (if *target* @@ -440,48 +423,34 @@ junglesnake-default-event-handler ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 0.85) - (set! (-> a0-0 frame-num) 0.5) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! junglesnake-drop-down-ja :num! (seek! max 0.85) :frame-num 0.5) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 0.85) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.85)) ) (go junglesnake-tracking) (none) ) - :post - (the-as (function none :behavior junglesnake) transform-post) + :post (the-as (function none :behavior junglesnake) transform-post) ) ;; failed to figure out what this is: (defstate junglesnake-tracking (junglesnake) - :event - junglesnake-default-event-handler - :enter - (behavior () + :event junglesnake-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self track-player-ry) #t) (set! (-> self track-player-tilt) #t) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self refractory-delay)) - (zero? (logand (-> *target* state-flags) #x80f8)) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) ) (go junglesnake-attack) ) @@ -507,68 +476,42 @@ junglesnake-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 2) - ) + ((ja-group? junglesnake-idle-ja) (while (not (ja-done? 0)) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) ) ) - (while #t - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (loop + (ja-no-eval :group! junglesnake-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior junglesnake) transform-post) + :post (the-as (function none :behavior junglesnake) transform-post) ) ;; failed to figure out what this is: (defstate junglesnake-attack (junglesnake) - :event - junglesnake-default-event-handler - :enter - (behavior () + :event junglesnake-default-event-handler + :enter (behavior () (set! (-> self hit-player) #f) (none) ) - :exit - (behavior () + :exit (behavior () (dummy-24 self) (none) ) - :trans - (behavior () + :trans (behavior () (dummy-20 self) (when *target* (if *target* @@ -582,30 +525,15 @@ junglesnake-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self track-player-ry) #t) (set! (-> self track-player-tilt) #t) - (ja-channel-push! 2 45) + (ja-channel-push! 2 (seconds 0.15)) (dummy-23 self) (let ((f30-0 (lerp-scale 0.0 1.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)) 0.0 24576.0)) ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.25) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) - (let ((a0-6 (-> self skel root-channel 1))) - (set! (-> a0-6 frame-interp) f30-0) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-6 param 0) 0.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-chan) - ) + (ja-no-eval :group! junglesnake-strike-close-ja :num! (seek! max 1.25) :frame-num 0.0) + (ja-no-eval :chan 1 :group! junglesnake-strike-far-ja :num! (chan 0) :frame-interp f30-0 :frame-num 0.0) (until (ja-done? 0) (suspend) (set! f30-0 @@ -615,16 +543,8 @@ junglesnake-default-event-handler (* 2.0 (-> *display* seconds-per-frame)) ) ) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.25) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((a0-12 (-> self skel root-channel 1))) - (set! (-> a0-12 frame-interp) f30-0) - (set! (-> a0-12 param 0) 0.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (seek! max 1.25)) + (ja :chan 1 :num! (chan 0) :frame-interp f30-0) (let ((f0-12 (ja-aframe-num 0))) (cond ((and (>= f0-12 22.0) (< f0-12 44.0)) @@ -648,16 +568,13 @@ junglesnake-default-event-handler (go junglesnake-tracking) (none) ) - :post - (the-as (function none :behavior junglesnake) transform-post) + :post (the-as (function none :behavior junglesnake) transform-post) ) ;; failed to figure out what this is: (defstate junglesnake-give-up (junglesnake) - :event - junglesnake-default-event-handler - :enter - (behavior () + :event junglesnake-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self track-player-ry) #f) (set! (-> self track-player-tilt) #f) @@ -665,34 +582,21 @@ junglesnake-default-event-handler (set! (-> self des-tilt) (-> self tilt)) (none) ) - :trans - (behavior () + :trans (behavior () (dummy-20 self) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self root-override trans quad)) (set! (-> s5-0 quad) (-> gp-0 quad)) (set! (-> s5-0 y) (+ 131072.0 (-> s5-0 y))) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 0.5) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! junglesnake-give-up-ja :num! (seek! max 0.5) :frame-num 0.0) (until (ja-done? 0) (let* ((f0-6 (ja-frame-num 0)) - (v1-18 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) + (v1-18 (ja-group)) (f0-7 (/ f0-6 (the float (+ (-> v1-18 data 0 length) -1)))) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -701,11 +605,7 @@ junglesnake-default-event-handler (move-to-point! (-> self root-override) s4-0) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 0.5) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.5)) ) ) (move-to-point! (-> self root-override) gp-0) @@ -714,44 +614,28 @@ junglesnake-default-event-handler (go junglesnake-sleeping) (none) ) - :post - (the-as (function none :behavior junglesnake) transform-post) + :post (the-as (function none :behavior junglesnake) transform-post) ) ;; failed to figure out what this is: (defstate junglesnake-die (junglesnake) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior junglesnake) process-drawable-death-event-handler ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) - (ja-channel-push! 1 45) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! junglesnake-death-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior junglesnake) ja-post) + :post (the-as (function none :behavior junglesnake) ja-post) ) ;; definition for method 23 of type junglesnake diff --git a/test/decompiler/reference/levels/jungleb/aphid_REF.gc b/test/decompiler/reference/levels/jungleb/aphid_REF.gc index 4fbaa44517..357b72936d 100644 --- a/test/decompiler/reference/levels/jungleb/aphid_REF.gc +++ b/test/decompiler/reference/levels/jungleb/aphid_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/aphid-lurker-ag.gc") + ;; definition of type aphid (deftype aphid (nav-enemy) ((try int32 :offset-assert 400) @@ -21,25 +23,22 @@ ) ;; failed to figure out what this is: -(defskelgroup *aphid-sg* aphid-lurker - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 2) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *aphid-sg* aphid-lurker aphid-lurker-lod0-jg -1 + ((aphid-lurker-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 2) + :shadow aphid-lurker-shadow-mg + ) ;; definition for function aphid-invulnerable (defbehavior aphid-invulnerable aphid () - (set! (-> self nav-enemy-flags) (logand -33 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (set-collide-offense (-> self collide-info) 2 (collide-offense indestructible)) (none) ) ;; definition for function aphid-vulnerable (defbehavior aphid-vulnerable aphid () - (logior! (-> self nav-enemy-flags) 32) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (set-collide-offense (-> self collide-info) 2 (collide-offense touch)) (none) ) @@ -47,7 +46,9 @@ ;; definition for method 43 of type aphid (defmethod dummy-43 aphid ((obj aphid) (arg0 process) (arg1 event-message-block)) (cond - ((or (logtest? (-> obj nav-enemy-flags) 32) (= arg0 (ppointer->process (-> obj parent)))) + ((or (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) + (= arg0 (ppointer->process (-> obj parent))) + ) (send-event arg0 'get-attack-count 1) (logclear! (-> obj mask) (process-mask actor-pause attackable)) (go (method-of-object obj nav-enemy-die)) @@ -61,10 +62,8 @@ ;; failed to figure out what this is: (defstate nav-enemy-chase (aphid) :virtual #t - :exit - aphid-vulnerable - :code - (behavior () + :exit aphid-vulnerable + :code (behavior () (let ((gp-0 (cond ((>= (-> self try) 15) 450 @@ -81,87 +80,45 @@ ) ) ) - (while #t - (ja-channel-push! 1 15) - (sound-play-by-name (static-sound-name "aphid-spike-out") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (loop + (ja-channel-push! 1 (seconds 0.05)) + (sound-play "aphid-spike-out") + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (aphid-invulnerable) - (ja-channel-push! 1 30) - (let ((v1-28 (-> self skel root-channel 0))) - (set! (-> v1-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) - (let ((v1-31 (-> self skel root-channel 0))) - (set! (-> v1-31 num-func) num-func-identity) - (set! (-> v1-31 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 5)) + (ja :num-func num-func-identity :frame-num 0.0) (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1)) (s5-1 (-> *display* base-frame-counter)) (s4-1 (- (the int (nav-enemy-rnd-float-range 900.0 1440.0)) gp-0)) ) (until (>= (- (-> *display* base-frame-counter) s5-1) s4-1) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) f30-0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (aphid-vulnerable) - (ja-channel-push! 1 15) - (sound-play-by-name (static-sound-name "aphid-spike-in") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-17 param 0) 0.0) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (sound-play "aphid-spike-in") + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) 0.0) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (ja-channel-push! 1 30) - (let ((v1-63 (-> self skel root-channel 0))) - (set! (-> v1-63 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - ) - ) - (let ((v1-66 (-> self skel root-channel 0))) - (set! (-> v1-66 num-func) num-func-identity) - (set! (-> v1-66 frame-num) 0.0) + (ja :num! (seek! 0.0)) ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (let ((f30-1 (nav-enemy-rnd-float-range 0.9 1.1)) (s5-3 (-> *display* base-frame-counter)) (s4-3 (+ (the int (nav-enemy-rnd-float-range 660.0 900.0)) gp-0)) ) (until (>= (- (-> *display* base-frame-counter) s5-3) s4-3) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) f30-1) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-1)) ) ) ) @@ -173,82 +130,41 @@ ;; failed to figure out what this is: (defstate nav-enemy-stare (aphid) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self turn-time) (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or (logtest? (-> self nav-enemy-flags) 256) + (when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) ) - (ja-channel-push! 1 30) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) f30-0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) f30-0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) - (while #t + (loop (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) 1.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 60) - (let ((v1-35 (-> self skel root-channel 0))) - (set! (-> v1-35 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) - (let ((v1-38 (-> self skel root-channel 0))) - (set! (-> v1-38 num-func) num-func-identity) - (set! (-> v1-38 frame-num) 0.0) - ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 4)) + (ja :num-func num-func-identity :frame-num 0.0) (until (nav-enemy-facing-player? 1820.4445) (ja-blend-eval) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) 0.75) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! 0.75)) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) (when (nav-enemy-rnd-percent? 0.3) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 10) - ) - ) - (ja-channel-push! 1 30) + (if (not (ja-group? (-> self draw art-group data 10))) + (ja-channel-push! 1 (seconds 0.1)) ) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-22 param 1) f30-0) - (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) f30-0) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -260,11 +176,10 @@ ;; failed to figure out what this is: (defstate nav-enemy-give-up (aphid) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 218453.33) (set! (-> self turn-time) (seconds 0.5)) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) (let ((s4-0 (-> self collide-info)) (s5-0 (target-pos 0)) ) @@ -273,36 +188,16 @@ ) 12743.111 ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek-to-point-toward-point! (-> self collide-info) @@ -311,11 +206,7 @@ (-> self turn-time) ) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) (none) @@ -371,7 +262,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -431,13 +322,8 @@ (vector-identity! (-> self collide-info scale)) (set! (-> self entity) (-> arg0 entity)) (TODO-RENAME-48 self) - (set! (-> self nav-enemy-flags) (logand -4097 (-> self nav-enemy-flags))) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 0) - (set! (-> a1-3 message) 'try) - (set! (-> self try) (the-as int (send-event-function (ppointer->process (-> self parent)) a1-3))) - ) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf12)) + (set! (-> self try) (the-as int (send-event (ppointer->process (-> self parent)) 'try))) (go-virtual nav-enemy-chase) (none) ) diff --git a/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc b/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc index 02fa37c1f7..a9916d350e 100644 --- a/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc +++ b/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc @@ -1,6 +1,9 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/eggtop-ag.gc") +(import "goal_src/import/jng-iris-door-ag.gc") + ;; definition of type eggtop (deftype eggtop (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -28,20 +31,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *eggtop-sg* eggtop - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -4.5 0 4.5) - :longest-edge (meters 0) - ) +(defskelgroup *eggtop-sg* eggtop eggtop-lod0-jg eggtop-idle-ja + ((eggtop-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -4.5 0 4.5) + ) ;; failed to figure out what this is: (defpartgroup group-jungle-blue-eco-room-open :id 189 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 899 :fade-after (meters 110)) + :parts ((sp-item 899 :fade-after (meters 110)) (sp-item 900 :fade-after (meters 110)) (sp-item 901 :fade-after (meters 110)) (sp-item 902 :fade-after (meters 110)) @@ -54,14 +53,12 @@ :id 190 :duration 900 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 903) (sp-item 903) (sp-item 904 :flags (bit1) :period 1200 :length 15)) + :parts ((sp-item 903) (sp-item 903) (sp-item 904 :flags (bit1) :period 1200 :length 15)) ) ;; failed to figure out what this is: (defpart 904 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 30.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 20) (meters 10) 1.0) @@ -83,20 +80,17 @@ ;; failed to figure out what this is: (defpart 905 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 225) (sp-launcher-by-id spt-next-launcher 906)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 225) (sp-launcher-by-id spt-next-launcher 906)) ) ;; failed to figure out what this is: (defpart 906 - :init-specs - ((sp-flt spt-fade-a -0.14222223)) + :init-specs ((sp-flt spt-fade-a -0.14222223)) ) ;; failed to figure out what this is: (defpart 899 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 10) (meters 2) 1.0) @@ -112,8 +106,7 @@ ;; failed to figure out what this is: (defpart 900 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) @@ -129,8 +122,7 @@ ;; failed to figure out what this is: (defpart 901 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) @@ -151,8 +143,7 @@ ;; failed to figure out what this is: (defpart 907 - :init-specs - ((sp-flt spt-r 64.0) + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) (sp-flt spt-fade-r -1.0) (sp-flt spt-fade-g -1.0) @@ -162,8 +153,7 @@ ;; failed to figure out what this is: (defpart 902 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) @@ -184,8 +174,7 @@ ;; failed to figure out what this is: (defpart 903 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-y (meters -6.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 2) 1.0) @@ -209,8 +198,7 @@ ;; failed to figure out what this is: (defstate eggtop-idle (eggtop) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'notify) (case (-> arg3 param 0) @@ -224,128 +212,96 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self sound-id)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (not (-> self child)) (task-complete? *game-info* (-> self entity extra perm task))) (go eggtop-close #f) ) (spawn (-> self part) (-> self root-override trans)) - (sound-play-by-name (static-sound-name "electric-loop") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "electric-loop" :id (-> self sound-id)) (none) ) - :code - (behavior () + :code (behavior () (suspend) (update-transforms! (-> self root-override)) (anim-loop) (none) ) - :post - (the-as (function none :behavior eggtop) ja-post) + :post (the-as (function none :behavior eggtop) ja-post) ) ;; failed to figure out what this is: (defstate eggtop-close (eggtop) - :trans - (behavior () + :trans (behavior () (rider-trans) (hide-hud-quick) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (when (not arg0) - (sound-play-by-name (static-sound-name "vent-switch") (new-sound-id) 2048 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 190) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (sound-play "vent-switch" :vol 200) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 190) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) - (let ((gp-2 (get-process *default-dead-pool* camera-tracker #x4000))) - (set! (-> self cam-tracker) - (ppointer->handle (when gp-2 - (let ((t9-6 (method-of-type camera-tracker activate))) - (t9-6 (the-as camera-tracker gp-2) self 'camera-tracker (the-as pointer #x70004000)) + (set! (-> self cam-tracker) + (ppointer->handle (process-spawn + camera-tracker + :init camera-tracker-init + (lambda :behavior camera-tracker + () + (while (not (process-grab? *target*)) + (suspend) ) - (run-now-in-process - gp-2 - camera-tracker-init - (lambda :behavior camera-tracker - () - (while (not (process-grab? *target*)) - (suspend) - ) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) - (suspend) - ) - ) - (send-event *camera* 'blend-from-as-fixed) - (camera-look-at (the-as pair "ecovent-171") (the-as uint 0)) - (camera-change-to "camera-223" 0 #f) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 3)) - (suspend) - ) - ) - (while (not (process-release? (handle->process (-> self grab-target)))) - (suspend) - ) - (send-event *camera* 'blend-from-as-fixed) - (level-hint-spawn - (game-text-id jungleb-eco-vents-opened) - "asstvb02" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (camera-look-at (the-as pair *target*) (the-as uint 0)) - (camera-change-to (the-as string 'base) 150 #f) - (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'show) - (none) + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) + (suspend) ) ) - (-> gp-2 ppointer) + (send-event *camera* 'blend-from-as-fixed) + (camera-look-at (the-as pair "ecovent-171") (the-as uint 0)) + (camera-change-to "camera-223" 0 #f) + (let ((gp-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 3)) + (suspend) + ) + ) + (while (not (process-release? (handle->process (-> self grab-target)))) + (suspend) + ) + (send-event *camera* 'blend-from-as-fixed) + (level-hint-spawn + (game-text-id jungleb-eco-vents-opened) + "asstvb02" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + (camera-look-at (the-as pair *target*) (the-as uint 0)) + (camera-change-to (the-as string 'base) 150 #f) + (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'show) + (none) ) + :to self ) - ) - ) + ) + ) (save-reminder (get-task-control (-> self entity extra perm task)) 2 0) - (sound-play-by-name (static-sound-name "jngb-eggtop-seq") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (sound-play "jngb-eggtop-seq") + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (process-entity-status! self (entity-perm-status complete) #t) @@ -354,24 +310,14 @@ (entity-task-complete-on a0-20) ) ) - (let ((gp-4 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-4 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-4 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - ) + (ja :group! (-> self draw art-group data 2) :num! max) (suspend) (logior! (-> self mask) (process-mask sleep)) (suspend) 0 (none) ) - :post - (the-as (function none :behavior eggtop) rider-post) + :post (the-as (function none :behavior eggtop) rider-post) ) ;; definition for method 11 of type eggtop @@ -440,13 +386,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *jng-iris-door-sg* jng-iris-door - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *jng-iris-door-sg* jng-iris-door jng-iris-door-lod0-jg jng-iris-door-idle-ja + ((jng-iris-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; definition for method 24 of type jng-iris-door ;; INFO: Return type mismatch int vs none. diff --git a/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc b/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc index 68233674c9..6fe0d2977d 100644 --- a/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc +++ b/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/plant-boss-ag.gc") + ;; definition of type plant-boss (deftype plant-boss (process-drawable) ((root-override collide-shape :offset 112) @@ -39,12 +41,7 @@ plant-boss-idle plant-boss-intro (plant-boss-reset int) - (plant-boss-root-die symbol) - plant-boss-root-idle plant-boss-spawn - (plant-boss-vine-die symbol) - (plant-boss-vine-hit basic) - plant-boss-vine-idle plant-boss-vulnerable ) ) @@ -116,6 +113,11 @@ (plant-boss-back-arms-die symbol) (plant-boss-back-arms-hit symbol) plant-boss-back-arms-idle + (plant-boss-root-die symbol) + plant-boss-root-idle + (plant-boss-vine-die symbol) + (plant-boss-vine-hit basic) + plant-boss-vine-idle ) ) @@ -161,71 +163,50 @@ ) ;; failed to figure out what this is: -(defskelgroup *plant-boss-sg* plant-boss - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 10 20) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *plant-boss-sg* plant-boss plant-boss-main-lod0-jg plant-boss-main-idle-ja + ((plant-boss-main-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 10 20) + :shadow plant-boss-main-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *plant-boss-arm-sg* plant-boss - 22 - 25 - ((23 (meters 999999))) - :bounds (static-spherem 0 0 0 20) - :longest-edge (meters 0) - :shadow 24 - ) +(defskelgroup *plant-boss-arm-sg* plant-boss plant-boss-arms-lod0-jg plant-boss-arms-idle-ja + ((plant-boss-arms-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + :shadow plant-boss-arms-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *plant-boss-leaf-sg* plant-boss - 37 - 42 - ((38 (meters 999999))) - :bounds (static-spherem 0 0 0 6) - :longest-edge (meters 0) - :shadow 39 - ) +(defskelgroup *plant-boss-leaf-sg* plant-boss plant-boss-leaf-lod0-jg plant-boss-leaf-idle-left-ja + ((plant-boss-leaf-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + :shadow plant-boss-leaf-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *plant-boss-back-arms-sg* plant-boss - 30 - 33 - ((31 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - :shadow 32 - ) +(defskelgroup *plant-boss-back-arms-sg* plant-boss plant-boss-back-arms-lod0-jg plant-boss-back-arms-idle-ja + ((plant-boss-back-arms-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + :shadow plant-boss-back-arms-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *plant-boss-vine-sg* plant-boss - 48 - 50 - ((49 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *plant-boss-vine-sg* plant-boss plant-boss-vine-lod0-jg plant-boss-vine-idle-ja + ((plant-boss-vine-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) ;; failed to figure out what this is: -(defskelgroup *plant-boss-root-sg* plant-boss - 53 - 55 - ((54 (meters 999999))) - :bounds (static-spherem 0 20 0 20) - :longest-edge (meters 0) - ) +(defskelgroup *plant-boss-root-sg* plant-boss plant-boss-root-lod0-jg plant-boss-root-idle-ja + ((plant-boss-root-lod0-mg (meters 999999))) + :bounds (static-spherem 0 20 0 20) + ) ;; definition for symbol *plant-boss-shadow-control*, type shadow-control -(define - *plant-boss-shadow-control* +(define *plant-boss-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #x2)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 409600.0) + :flags (shadow-flags disable-fade) + :shadow-dir (new 'static 'vector :y -1.0 :w 409600.0) :bot-plane (new 'static 'plane :y 1.0 :w 37683.2) :top-plane (new 'static 'plane :y 1.0 :w 4096.0) ) @@ -282,12 +263,7 @@ (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) - (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 13) - ) - ) + (not (ja-group? plant-boss-main-vulnerable2idle-ja)) ) (send-event arg0 'attack-or-shove (-> arg3 param 0) (new 'static 'attack-info)) ) @@ -313,8 +289,7 @@ ;; failed to figure out what this is: (defstate plant-boss-arm-idle (plant-boss-arm) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hide 'die) (go plant-boss-arm-die (the-as symbol (-> arg3 param 0))) @@ -324,97 +299,46 @@ ) ) ) - :code - (behavior () + :code (behavior () (ja-channel-set! 2) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 25)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((gp-1 (-> self skel root-channel 1))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 26)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) - (while #t - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((v1-16 (-> self skel root-channel 1))) - (set! (-> v1-16 frame-interp) (- (-> (new 'static 'array float 1 1.0) 0) (-> self parent-override 0 energy))) - ) + (ja :group! plant-boss-arms-idle-ja :num! min) + (ja :chan 1 :group! plant-boss-arms-still-ja :num! min) + (loop + (ja :num! (loop!)) + (ja :chan 1 :frame-interp (- 1.0 (-> self parent-override 0 energy))) (suspend) ) (none) ) - :post - (the-as (function none :behavior plant-boss-arm) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) ;; failed to figure out what this is: (defstate plant-boss-arm-hit (plant-boss-arm) - :event - (-> plant-boss-arm-idle event) - :code - (behavior ((arg0 basic)) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 29))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 90.0) 0)) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 29)) num-func-seek!) - ) + :event (-> plant-boss-arm-idle event) + :code (behavior ((arg0 basic)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! plant-boss-arms-hit-ja :num! (seek! (ja-aframe (the-as float 90.0) 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 90.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 75) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 25))) - (set! (-> gp-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 25)) data 0 length) -1)) - ) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-2 frame-num) (ja-aframe (the-as float 90.0) 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 25)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 90.0) 0))) ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-arms-idle-ja :num! (seek!) :frame-num (ja-aframe (the-as float 90.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go plant-boss-arm-idle) (none) ) - :post - (the-as (function none :behavior plant-boss-arm) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) ;; failed to figure out what this is: (defstate plant-boss-arm-die (plant-boss-arm) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (let ((a0-1 (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0))) (set! (-> self root-override root-prim local-sphere w) 81920.0) (set! (-> (the-as collide-shape-prim-mesh a0-1) local-sphere w) 69632.0) @@ -436,48 +360,23 @@ (ja-channel-set! 1) ) (else - (ja-channel-push! 1 75) - (let ((f30-0 (rand-vu-float-range (-> (new 'static 'array float 1 0.8) 0) (-> (new 'static 'array float 1 1.0) 0))) - ) + (ja-channel-push! 1 (seconds 0.25)) + (let ((f30-0 (rand-vu-float-range (the-as float 0.8) (the-as float 1.0)))) (case (-> self side) ((1) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 28))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 28)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) f30-0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 28)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-arms-die-right-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) f30-0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (else - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 27))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 27)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) f30-0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 27)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-arms-die-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) f30-0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -486,28 +385,10 @@ ) (case (-> self side) ((1) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 28)) - num-func-identity - ) - (set! (-> gp-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 28)) data 0 length) -1)) - ) - ) + (ja :group! plant-boss-arms-die-right-ja :num! max) ) (else - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 27)) - num-func-identity - ) - (set! (-> gp-2 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 27)) data 0 length) -1)) - ) - ) + (ja :group! plant-boss-arms-die-ja :num! max) ) ) (set! (-> (find-prim-by-id (-> self root-override) (the-as uint 1)) prim-core action) (collide-action)) @@ -515,20 +396,18 @@ (set! (-> (find-prim-by-id (-> self root-override) (the-as uint 2)) prim-core action) (collide-action)) 0 (update-transforms! (-> self root-override)) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) (none) ) - :post - (the-as (function none :behavior plant-boss-arm) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) ;; failed to figure out what this is: (defstate plant-boss-back-arms-idle (plant-boss-arm) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (or (= arg2 'touch) (= arg2 'attack)) (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) ) @@ -541,160 +420,89 @@ ) ) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 33))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 33)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 33)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! plant-boss-back-arms-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior plant-boss-arm) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) ;; failed to figure out what this is: (defstate plant-boss-back-arms-hit (plant-boss-arm) - :event - (-> plant-boss-back-arms-idle event) - :code - (behavior ((arg0 symbol)) - (ja-channel-push! 1 30) + :event (-> plant-boss-back-arms-idle event) + :code (behavior ((arg0 symbol)) + (ja-channel-push! 1 (seconds 0.1)) (cond ((or (= arg0 'spin) (= arg0 'spin-air)) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 36))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 45.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-1 frame-num) 0.0) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 36)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-back-arms-hit-kick-ja + :num! (seek! (ja-aframe (the-as float 45.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe (the-as float 45.0) 0)) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 45.0) 0))) ) ) (else - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> gp-3 param 0) (ja-aframe (the-as float 45.0) 0)) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-3 frame-num) 0.0) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-back-arms-hit-ja + :num! (seek! (ja-aframe (the-as float 45.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 param 0) (ja-aframe (the-as float 45.0) 0)) - (set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 45.0) 0))) ) ) ) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 75) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 33))) - (set! (-> gp-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 33)) data 0 length) -1)) - ) - (set! (-> gp-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-5 frame-num) (ja-aframe (the-as float 45.0) 0)) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 33)) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-back-arms-idle-ja :num! (seek!) :frame-num (ja-aframe (the-as float 45.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go plant-boss-back-arms-idle) (none) ) - :post - (the-as (function none :behavior plant-boss-arm) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) ;; failed to figure out what this is: (defstate plant-boss-back-arms-die (plant-boss-arm) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (cond (arg0 (ja-channel-set! 1) ) (else - (ja-channel-push! 1 75) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-back-arms-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 34)) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1)) - ) - ) - (while #t + (ja :group! plant-boss-back-arms-die-ja :num! max) + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior plant-boss-arm) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) ;; failed to figure out what this is: -(defstate plant-boss-vine-idle (plant-boss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defstate plant-boss-vine-idle (plant-boss-arm) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hide 'die) (go plant-boss-vine-die (the-as symbol (-> arg3 param 0))) @@ -704,172 +512,96 @@ ) ) ) - :code - (behavior () + :code (behavior () (let ((f30-0 (rand-vu-float-range (the-as float 0.9) (the-as float 1.1)))) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 50))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 50)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) f30-0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 50)) num-func-seek!) - ) + (loop + (ja-no-eval :group! plant-boss-vine-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) f30-0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) (none) ) - :post - (the-as (function none :behavior plant-boss) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) ;; failed to figure out what this is: -(defstate plant-boss-vine-hit (plant-boss) - :event - (-> plant-boss-vine-idle event) - :code - (behavior ((arg0 basic)) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 52))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 45.0) 0)) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 52)) num-func-seek!) - ) +(defstate plant-boss-vine-hit (plant-boss-arm) + :event (-> plant-boss-vine-idle event) + :code (behavior ((arg0 basic)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! plant-boss-vine-hit-ja :num! (seek! (ja-aframe (the-as float 45.0) 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 45.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 75) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 50))) - (set! (-> gp-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 50)) data 0 length) -1)) - ) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-2 frame-num) (ja-aframe (the-as float 45.0) 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 50)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 45.0) 0))) ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-vine-idle-ja :num! (seek!) :frame-num (ja-aframe (the-as float 45.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go plant-boss-vine-idle) (none) ) - :post - (the-as (function none :behavior plant-boss) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) ;; failed to figure out what this is: -(defstate plant-boss-vine-die (plant-boss) - :code - (behavior ((arg0 symbol)) +(defstate plant-boss-vine-die (plant-boss-arm) + :code (behavior ((arg0 symbol)) (when (not arg0) - (let ((f30-0 (rand-vu-float-range (-> (new 'static 'array float 1 0.0) 0) (-> (new 'static 'array float 1 1.0) 0))) + (let ((f30-0 (rand-vu-float-range (the-as float 0.0) (the-as float 1.0))) (gp-0 (-> *display* base-frame-counter)) ) (until (>= (- (-> *display* base-frame-counter) gp-0) (the int (* 300.0 f30-0))) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) ) - (ja-channel-push! 1 75) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 51))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 51)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 51)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-vine-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior plant-boss) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) ;; failed to figure out what this is: -(defstate plant-boss-root-idle (plant-boss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defstate plant-boss-root-idle (plant-boss-arm) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hide 'die) (go plant-boss-root-die (the-as symbol (-> arg3 param 0))) ) ) ) - :code - (behavior () + :code (behavior () (let ((f30-0 (rand-vu-float-range (the-as float 0.9) (the-as float 1.1)))) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 55))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 55)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) f30-0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 55)) num-func-seek!) - ) + (loop + (ja-no-eval :group! plant-boss-root-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) f30-0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) (none) ) - :post - (the-as (function none :behavior plant-boss) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) ;; failed to figure out what this is: -(defstate plant-boss-root-die (plant-boss) - :code - (behavior ((arg0 symbol)) +(defstate plant-boss-root-die (plant-boss-arm) + :code (behavior ((arg0 symbol)) (when (not arg0) (let ((gp-0 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 4)) @@ -880,8 +612,7 @@ ) (none) ) - :post - (the-as (function none :behavior plant-boss) ja-post) + :post (the-as (function none :behavior plant-boss-arm) ja-post) ) ;; definition for function plant-boss-arm-init @@ -985,7 +716,7 @@ (defbehavior plant-boss-vine-init plant-boss-arm ((arg0 vector) (arg1 vector) (arg2 float) (arg3 int)) (stack-size-set! (-> self main-thread) 128) (set! (-> self root-override) (the-as collide-shape (new 'process 'trsqv))) - (set-vector! (-> self root-override scale) arg2 arg2 arg2 (-> (new 'static 'array float 1 1.0) 0)) + (set-vector! (-> self root-override scale) arg2 arg2 arg2 1.0) (set! (-> self root-override trans quad) (-> arg0 quad)) (quaternion-zxy! (-> self root-override quat) arg1) (set! (-> self side) arg3) @@ -1011,8 +742,7 @@ ;; failed to figure out what this is: (defstate plant-boss-leaf-idle (plant-boss-leaf) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go plant-boss-leaf-open (the-as symbol (-> arg3 param 0))) @@ -1022,49 +752,24 @@ ) ) ) - :code - (behavior ((arg0 symbol)) - (while #t + :code (behavior ((arg0 symbol)) + (loop (case (-> self side) ((1) (dotimes (gp-0 4) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 43)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 43)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-leaf-stubby-right-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (else (dotimes (gp-1 5) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 40))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 40)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 40)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-leaf-stubby-left-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -1072,14 +777,12 @@ ) (none) ) - :post - (the-as (function none :behavior plant-boss-leaf) ja-post) + :post (the-as (function none :behavior plant-boss-leaf) ja-post) ) ;; failed to figure out what this is: (defstate plant-boss-leaf-open (plant-boss-leaf) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('kill) (go plant-boss-leaf-close) @@ -1089,100 +792,55 @@ ) ) ) - :trans - (the-as (function none :behavior plant-boss-leaf) rider-trans) - :code - (behavior ((arg0 symbol)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 30) + :trans (the-as (function none :behavior plant-boss-leaf) rider-trans) + :code (behavior ((arg0 symbol)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.1)) (case (-> self side) ((1) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 44))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 30.0) 0)) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-leaf-grow-right-ja + :num! (seek! (ja-aframe (the-as float 30.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 30.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 44))) - (set! (-> gp-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 44)) data 0 length) -1)) - ) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-3 frame-num) (ja-aframe (the-as float 30.0) 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 30.0) 0))) ) + (sound-play "plant-leaf") + (ja-no-eval :group! plant-boss-leaf-grow-right-ja :num! (seek!) :frame-num (ja-aframe (the-as float 30.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> gp-4 param 0) (ja-aframe (the-as float 30.0) 0)) - (set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-4 frame-num) 0.0) - (joint-control-channel-group! gp-4 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-leaf-grow-left-ja + :num! (seek! (ja-aframe (the-as float 30.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 param 0) (ja-aframe (the-as float 30.0) 0)) - (set! (-> gp-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-5 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-7 (-> self skel root-channel 0))) - (set! (-> gp-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> gp-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 41)) data 0 length) -1)) - ) - (set! (-> gp-7 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-7 frame-num) (ja-aframe (the-as float 30.0) 0)) - (joint-control-channel-group! gp-7 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 30.0) 0))) ) + (sound-play "plant-leaf") + (ja-no-eval :group! plant-boss-leaf-grow-left-ja :num! (seek!) :frame-num (ja-aframe (the-as float 30.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 param 0) (the float (+ (-> a0-26 frame-group data 0 length) -1))) - (set! (-> a0-26 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go plant-boss-leaf-open-idle #f) (none) ) - :post - (the-as (function none :behavior plant-boss-leaf) rider-post) + :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) ;; failed to figure out what this is: (defstate plant-boss-leaf-open-idle (plant-boss-leaf) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('kill) (set! (-> self state-object) #t) @@ -1201,50 +859,37 @@ ) ) ) - :trans - (the-as (function none :behavior plant-boss-leaf) rider-trans) - :code - (behavior ((arg0 symbol)) + :trans (the-as (function none :behavior plant-boss-leaf) rider-trans) + :code (behavior ((arg0 symbol)) (local-vars (v1-19 symbol)) (set! (-> self state-object) arg0) - (case (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (((-> self draw art-group data 47) (-> self draw art-group data 46)) - (ja-channel-push! 1 30) + (case (ja-group) + ((plant-boss-leaf-right-bounce-ja plant-boss-leaf-left-bounce-ja) + (ja-channel-push! 1 (seconds 0.1)) ) ) (case (-> self side) ((1) - (let ((v1-10 (-> self skel root-channel 0))) - (set! (-> v1-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 45))) - ) + (ja :group! plant-boss-leaf-idle-right-ja) ) (else - (let ((v1-13 (-> self skel root-channel 0))) - (set! (-> v1-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 42))) - ) + (ja :group! plant-boss-leaf-idle-left-ja) ) ) (until v1-19 (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (set! v1-19 (and (-> self state-object) (< (-> self state-time-frame) (-> *display* base-frame-counter)))) ) (go plant-boss-leaf-close) (none) ) - :post - (the-as (function none :behavior plant-boss-leaf) rider-post) + :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) ;; failed to figure out what this is: (defstate plant-boss-leaf-bounce (plant-boss-leaf) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('kill) (set! (-> self state-object) #t) @@ -1258,135 +903,78 @@ ) ) ) - :trans - (the-as (function none :behavior plant-boss-leaf) rider-trans) - :code - (behavior () - (ja-channel-push! 1 30) + :trans (the-as (function none :behavior plant-boss-leaf) rider-trans) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) (case (-> self side) ((1) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 47))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 47)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 47)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-leaf-right-bounce-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 46))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 46)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 46)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-leaf-left-bounce-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go plant-boss-leaf-open-idle (-> self state-object)) (none) ) - :post - (the-as (function none :behavior plant-boss-leaf) rider-post) + :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) ;; failed to figure out what this is: (defstate plant-boss-leaf-close (plant-boss-leaf) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('die) (go plant-boss-leaf-die (the-as basic (-> arg3 param 0))) ) ) ) - :trans - (the-as (function none :behavior plant-boss-leaf) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior plant-boss-leaf) rider-trans) + :code (behavior () (case (-> self side) ((1) - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 44))) - (set! (-> a0-4 param 0) 0.0) - (set! (-> a0-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-4 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 44)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!) - ) + (sound-play "plant-leaf") + (ja-no-eval :group! plant-boss-leaf-grow-right-ja :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 0.0) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) ) (else - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> a0-10 param 0) 0.0) - (set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-10 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 41)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) - ) + (sound-play "plant-leaf") + (ja-no-eval :group! plant-boss-leaf-grow-left-ja :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) 0.0) - (set! (-> a0-11 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) ) ) (go plant-boss-leaf-idle #f) (none) ) - :post - (the-as (function none :behavior plant-boss-leaf) rider-post) + :post (the-as (function none :behavior plant-boss-leaf) rider-post) ) ;; failed to figure out what this is: (defstate plant-boss-leaf-die (plant-boss-leaf) - :code - (behavior ((arg0 basic)) - (while #t + :code (behavior ((arg0 basic)) + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) (none) ) - :post - (the-as (function none :behavior plant-boss-leaf) ja-post) + :post (the-as (function none :behavior plant-boss-leaf) ja-post) ) ;; definition for function plant-boss-leaf-init @@ -1425,9 +1013,8 @@ ;; failed to figure out what this is: (defstate plant-boss-far-idle (plant-boss) - :code - (behavior () - (clear-pending-settings-from-process *setting-control* self 'music) + :code (behavior () + (remove-setting! 'music) (let ((gp-0 (-> self child))) (while gp-0 (let ((s5-0 (ppointer->process gp-0))) @@ -1449,18 +1036,10 @@ (set-mode! (-> self body) (joint-mod-handler-mode flex-blend)) (set! (-> self body flex-blend) 0.0) (ja-channel-set! 1) - (while #t - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (loop + (ja-no-eval :group! plant-boss-main-initial-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (set! (-> self energy) (seek (-> self energy) (the-as float 0.25) (-> *display* seconds-per-frame))) + (seek! (-> self energy) (the-as float 0.25) (-> *display* seconds-per-frame)) (if (and (and *target* (>= 245760.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -1469,43 +1048,28 @@ (go plant-boss-intro) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior plant-boss) ja-post) + :post (the-as (function none :behavior plant-boss) ja-post) ) ;; failed to figure out what this is: (defstate plant-boss-intro (plant-boss) - :code - (behavior () - (set-setting! *setting-control* self 'music 'danger (-> (new 'static 'array float 1 0.0) 0) 0) + :code (behavior () + (set-setting! 'music 'danger 0.0 0) (send-event *target* 'reset-pickup 'eco) (let ((v1-9 (-> self entity extra perm))) (logior! (-> v1-9 status) (entity-perm-status user-set-from-cstage)) (b! (zero? (-> v1-9 user-int8 2)) cfg-5 :delay (empty-form)) ) - (ja-channel-push! 1 150) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 10)) - num-func-identity - ) - (set! (-> gp-0 frame-num) (ja-aframe (the-as float 510.0) 0)) - ) + (ja-channel-push! 1 (seconds 0.5)) + (ja :group! plant-boss-main-intro-ja :num! (identity (ja-aframe (the-as float 510.0) 0))) (b! #t cfg-3 :delay (nop!)) (label cfg-2) - (set! (-> self energy) - (seek (-> self energy) (-> (new 'static 'array float 1 1.0) 0) (* 2.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self energy) (the-as float 1.0) (* 2.0 (-> *display* seconds-per-frame))) (suspend) (label cfg-3) (let ((v1-22 (-> self skel channel))) @@ -1515,54 +1079,42 @@ (set-mode! (-> self body) (joint-mod-handler-mode world-look-at)) (b! #t cfg-17 :delay (nop!)) (label cfg-5) - (when (not (handle->process (-> self cam-tracker))) - (let ((gp-1 (get-process *default-dead-pool* camera-tracker #x4000))) + (if (not (handle->process (-> self cam-tracker))) (set! (-> self cam-tracker) - (ppointer->handle (when gp-1 - (let ((t9-9 (method-of-type camera-tracker activate))) - (t9-9 (the-as camera-tracker gp-1) self 'camera-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - camera-tracker-init - (lambda :behavior camera-tracker - () - (while (not (process-grab? *target*)) - (suspend) - ) - (ambient-hint-spawn "gamcam28" (the-as vector #f) *entity-pool* 'ambient) - (send-event *camera* 'blend-from-as-fixed) - (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 13)) - (camera-change-to "camera-220" 0 #f) - (while (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 0) - (set! (-> a1-4 message) 'intro-done?) - (not (send-event-function *camera* a1-4)) - ) - (suspend) - ) - (camera-change-to "camera-222" 600 #f) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 2)) - (suspend) - ) - ) - (while (not (process-release? (handle->process (-> self grab-target)))) - (suspend) - ) - (send-event *camera* 'blend-from-as-fixed) - (camera-look-at (the-as pair *target*) (the-as uint 0)) - (camera-change-to (the-as string 'base) 150 #f) - (none) + (ppointer->handle (process-spawn + camera-tracker + :init camera-tracker-init + (lambda :behavior camera-tracker + () + (while (not (process-grab? *target*)) + (suspend) ) + (ambient-hint-spawn "gamcam28" (the-as vector #f) *entity-pool* 'ambient) + (send-event *camera* 'blend-from-as-fixed) + (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 13)) + (camera-change-to "camera-220" 0 #f) + (while (not (send-event *camera* 'intro-done?)) + (suspend) + ) + (camera-change-to "camera-222" 600 #f) + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 2)) + (suspend) + ) + ) + (while (not (process-release? (handle->process (-> self grab-target)))) + (suspend) + ) + (send-event *camera* 'blend-from-as-fixed) + (camera-look-at (the-as pair *target*) (the-as uint 0)) + (camera-change-to (the-as string 'base) 150 #f) + (none) ) - (-> gp-1 ppointer) + :to self ) ) ) ) - ) (let ((v1-37 (-> self neck))) (set! (-> v1-37 blend) 0.0) ) @@ -1572,35 +1124,16 @@ (set-mode! (-> self neck) (joint-mod-handler-mode world-look-at)) (set-mode! (-> self body) (joint-mod-handler-mode world-look-at)) (set! (-> self body flex-blend) 0.0) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-25 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 150) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> gp-2 param 0) (ja-aframe (the-as float 510.0) 0)) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-2 frame-num) 0.0) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.5)) + (ja-no-eval :group! plant-boss-main-intro-ja :num! (seek! (ja-aframe (the-as float 510.0) 0)) :frame-num 0.0) (until (ja-done? 0) - (set! (-> self energy) - (seek (-> self energy) (-> (new 'static 'array float 1 1.0) 0) (* 0.2 (-> *display* seconds-per-frame))) - ) + (seek! (-> self energy) (the-as float 1.0) (* 0.2 (-> *display* seconds-per-frame))) (ja-blend-eval) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe (the-as float 510.0) 0)) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-33 (-> self skel root-channel 0))) - (set! (-> a0-33 param 0) (the float (+ (-> a0-33 frame-group data 0 length) -1))) - (set! (-> a0-33 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-33 (the-as art-joint-anim #f) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 510.0) 0))) ) + (ja-no-eval :num! (seek!)) (let ((v1-77 (-> self entity extra perm))) (logior! (-> v1-77 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-77 user-int8 2) 1) @@ -1611,24 +1144,20 @@ (go plant-boss-reset 0) (none) ) - :post - (the-as (function none :behavior plant-boss) ja-post) + :post (the-as (function none :behavior plant-boss) ja-post) ) ;; failed to figure out what this is: (defstate plant-boss-idle (plant-boss) - :event - plant-boss-default-event-handler - :enter - (behavior () - (set-setting! *setting-control* self 'music 'danger (-> (new 'static 'array float 1 0.0) 0) 0) + :event plant-boss-default-event-handler + :enter (behavior () + (set-setting! 'music 'danger 0.0 0) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self body flex-blend) 0.0) - (set! (-> self neck flex-blend) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> self neck flex-blend) 1.0) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) (if (< 409600.0 f30-0) (go plant-boss-far-idle) @@ -1650,176 +1179,88 @@ ) ) *target* - (zero? (logand (-> *target* state-flags) #x80f8)) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) ) (go plant-boss-attack 1) ) ) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - (ja-channel-push! 1 150) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) (ja-aframe (the-as float 60.0) 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + ((ja-group? plant-boss-main-reset-ja) + (ja-channel-push! 1 (seconds 0.5)) + (ja-no-eval :group! plant-boss-main-idle-ja :num! (seek!) :frame-num (ja-aframe (the-as float 60.0) 0)) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 12) - ) - (ja-channel-push! 1 75) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 75.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-1 frame-num) 0.0) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + ((ja-group? plant-boss-main-vulnerable-ja) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-main-vulnerable2idle-ja + :num! (seek! (ja-aframe (the-as float 75.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe (the-as float 75.0) 0)) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 75) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-3 frame-num) (ja-aframe (the-as float 75.0) 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 75.0) 0))) ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-main-idle-ja :num! (seek!) :frame-num (ja-aframe (the-as float 75.0) 0)) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 10) - ) + ((ja-group? plant-boss-main-intro-ja) ) (else - (ja-channel-push! 1 75) + (ja-channel-push! 1 (seconds 0.25)) ) ) - (while #t + (loop (when (or (and *cheat-mode* (cpad-hold? 1 r3)) (zero? (-> self aphid-count))) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-35 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-35 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-35 frame-num) 0.0) - (joint-control-channel-group! a0-35 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-idle-ja :num! (seek!) :frame-num 0.0) (go plant-boss-vulnerable) ) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-36 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-36 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-36 frame-num) 0.0) - (joint-control-channel-group! a0-36 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 param 0) (the float (+ (-> a0-37 frame-group data 0 length) -1))) - (set! (-> a0-37 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (when (and *cheat-mode* (cpad-hold? 1 r3)) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-43 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-43 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-43 frame-num) 0.0) - (joint-control-channel-group! a0-43 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-idle-ja :num! (seek!) :frame-num 0.0) (go plant-boss-vulnerable) ) (when (rand-vu-percent? (the-as float 0.2)) - (let ((a0-45 (-> self skel root-channel 0))) - (set! (-> a0-45 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-45 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-45 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-45 frame-num) 0.0) - (joint-control-channel-group! a0-45 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-idle-alt-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-46 (-> self skel root-channel 0))) - (set! (-> a0-46 param 0) (the float (+ (-> a0-46 frame-group data 0 length) -1))) - (set! (-> a0-46 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-46 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (none) ) - :post - plant-boss-post + :post plant-boss-post ) ;; failed to figure out what this is: (defstate plant-boss-spawn (plant-boss) - :event - plant-boss-default-event-handler - :enter - (behavior () + :event plant-boss-default-event-handler + :enter (behavior () (when (not (-> self try-inc)) (let ((gp-0 (-> self entity extra perm))) (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) - (set! (-> gp-0 user-int8 0) (seekl (-> gp-0 user-int8 0) 255 1)) + (seekl! (-> gp-0 user-int8 0) 255 1) (set! (-> self try) (-> gp-0 user-int8 0)) ) (set! (-> self try-inc) #t) @@ -1828,7 +1269,7 @@ (+! (-> self cycle-count) 1) (set! (-> self snap-count) 0) (set! (-> self body flex-blend) 0.0) - (set! (-> self neck flex-blend) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> self neck flex-blend) 1.0) (set! (-> self want-aphid-count) (min (- 4 (the int (-> self health))) (cond ((>= (-> self try) 15) 1 @@ -1844,8 +1285,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) (if (< 409600.0 f0-0) (go plant-boss-far-idle) @@ -1870,33 +1310,22 @@ ) ) ((>= (- (-> *display* base-frame-counter) (-> self aphid-spawn-time)) (seconds 1.4)) - (let ((gp-1 (get-process *default-dead-pool* aphid #x4000))) - (when (when gp-1 - (let ((t9-5 (method-of-type aphid activate))) - (t9-5 (the-as aphid gp-1) self 'aphid (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 aphid-init-by-other self (-> self root-override trans) (target-pos 0)) - (-> gp-1 ppointer) - ) - (+! (-> self aphid-count) 1) - (set! (-> self want-aphid-count) (seekl (-> self want-aphid-count) 0 1)) - (set! (-> self aphid-spawn-time) (-> *display* base-frame-counter)) - ) + (when (process-spawn aphid self (-> self root-override trans) (target-pos 0) :to self) + (+! (-> self aphid-count) 1) + (seekl! (-> self want-aphid-count) 0 1) + (set! (-> self aphid-spawn-time) (-> *display* base-frame-counter)) ) ) ) (none) ) - :code - (-> plant-boss-idle code) - :post - plant-boss-post + :code (-> plant-boss-idle code) + :post plant-boss-post ) ;; failed to figure out what this is: (defstate plant-boss-vulnerable (plant-boss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (when ((method-of-type touching-shapes-entry prims-touching?) @@ -1904,17 +1333,11 @@ (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'shove) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (let ((v1-6 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-6 shove-up) (-> (new 'static 'array float 1 8192.0) 0)) - (set! (-> v1-6 shove-back) 24576.0) - (set! (-> a1-2 param 1) (the-as uint v1-6)) - ) - (send-event-function arg0 a1-2) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 2)) (shove-back (meters 6)))) ) (go plant-boss-hit (the-as symbol (-> arg3 param 1))) ) @@ -1924,8 +1347,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self body flex-blend) 0.0) (set! (-> self neck flex-blend) 0.0) @@ -1934,8 +1356,7 @@ (logior! (-> self attack-prim 0 prim-core action) (collide-action solid)) (none) ) - :exit - (behavior () + :exit (behavior () (send-event (ppointer->process (-> self leaf 1)) 'kill 0) (send-event (ppointer->process (-> self leaf 0)) 'kill 150) (set! (-> self attack-prim 0 local-sphere w) 16384.0) @@ -1943,58 +1364,34 @@ (logclear! (-> self attack-prim 0 prim-core action) (collide-action solid)) (none) ) - :code - (behavior () - (ja-channel-push! 1 75) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 60.0) 0)) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-main-idle2vulnerable-ja + :num! (seek! (ja-aframe (the-as float 60.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 60.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 60.0) 0))) ) (send-event (ppointer->process (-> self leaf 1)) 'trigger) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> gp-2 param 0) (ja-aframe (the-as float 120.0) 0)) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-2 frame-num) (ja-aframe (the-as float 60.0) 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-idle2vulnerable-ja + :num! (seek! (ja-aframe (the-as float 120.0) 0)) + :frame-num (ja-aframe (the-as float 60.0) 0) + ) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe (the-as float 120.0) 0)) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 120.0) 0))) ) (send-event (ppointer->process (-> self leaf 0)) 'trigger) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> gp-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-4 frame-num) (ja-aframe (the-as float 120.0) 0)) - (joint-control-channel-group! gp-4 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-idle2vulnerable-ja + :num! (seek!) + :frame-num (ja-aframe (the-as float 120.0) 0) + ) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-5 (cond ((>= (-> self try) 15) @@ -2013,36 +1410,22 @@ ) ) (while (< (- (-> *display* base-frame-counter) (-> self state-time)) gp-5) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-vulnerable-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go plant-boss-spawn) (none) ) - :post - plant-boss-post + :post plant-boss-post ) ;; failed to figure out what this is: (defstate plant-boss-attack (plant-boss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (when (and ((method-of-type touching-shapes-entry prims-touching?) @@ -2050,27 +1433,12 @@ (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) - (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 13) - ) - ) + (not (ja-group? plant-boss-main-vulnerable2idle-ja)) ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack-or-shove) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (let ((a0-8 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-8 mode) 'plant-boss) - (set! (-> a1-2 param 1) (the-as uint a0-8)) - ) - (when (send-event-function arg0 a1-2) - (let ((v0-1 (the-as object #t))) - (set! (-> self ate) (the-as symbol v0-1)) - v0-1 - ) + (when (send-event arg0 'attack-or-shove (-> arg3 param 0) (static-attack-info ((mode 'plant-boss)))) + (let ((v0-1 (the-as object #t))) + (set! (-> self ate) (the-as symbol v0-1)) + v0-1 ) ) ) @@ -2080,51 +1448,26 @@ ) ) ) - :code - (behavior ((arg0 int)) + :code (behavior ((arg0 int)) (local-vars (v1-64 symbol)) (+! (-> self snap-count) 1) (set! (-> self ate) #f) (set! (-> self interp) 0.0) (let ((s5-0 #f)) - (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) + (if (ja-group? plant-boss-main-reset-ja) (set! s5-0 #t) ) - (ja-channel-push! 2 75) - (let ((s4-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> s4-0 frame-num) 0.0) - ) - (let ((s4-1 (-> self skel root-channel 1))) - (joint-control-channel-group-eval! - s4-1 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> s4-1 frame-num) 0.0) - ) + (ja-channel-push! 2 (seconds 0.25)) + (ja :group! plant-boss-main-attack-ja :num! min) + (ja :chan 1 :group! plant-boss-main-attack-close-ja :num! min) (when s5-0 - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 num-func) num-func-identity) - (set! (-> s5-1 frame-num) (ja-aframe (the-as float 100.0) 0)) - ) - (let ((s5-2 (-> self skel root-channel 1))) - (set! (-> s5-2 num-func) num-func-identity) - (set! (-> s5-2 frame-num) (ja-aframe (the-as float 100.0) 0)) - ) + (ja :num-func num-func-identity :frame-num (ja-aframe (the-as float 100.0) 0)) + (ja :chan 1 :num-func num-func-identity :frame-num (ja-aframe (the-as float 100.0) 0)) ) ) (let ((f30-0 (lerp-scale - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 0.0) + (the-as float 1.0) (vector-vector-distance (target-pos 0) (-> self root-override trans)) (the-as float 26624.0) (the-as float 86016.0) @@ -2132,23 +1475,13 @@ ) ) (until (or v1-64 (ja-done? 0)) - (set! (-> self body flex-blend) (seek - (-> self body flex-blend) - (-> (new 'static 'array float 1 1.0) 0) - (* 2.0 (-> *display* seconds-per-frame)) - ) - ) - (set! (-> self neck flex-blend) (seek - (-> self neck flex-blend) - (-> (new 'static 'array float 1 0.0) 0) - (* 2.0 (-> *display* seconds-per-frame)) - ) - ) + (seek! (-> self body flex-blend) (the-as float 1.0) (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self neck flex-blend) (the-as float 0.0) (* 2.0 (-> *display* seconds-per-frame))) (set! f30-0 (seek f30-0 (lerp-scale - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 1.0) + (the-as float 0.0) (vector-vector-distance (target-pos 0) (-> self root-override trans)) (the-as float 26624.0) (the-as float 86016.0) @@ -2157,16 +1490,8 @@ ) ) (set! (-> self interp) f30-0) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((a0-20 (-> self skel root-channel 1))) - (set! (-> a0-20 frame-interp) f30-0) - (set! (-> a0-20 param 0) 0.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (seek!)) + (ja :chan 1 :num! (chan 0) :frame-interp f30-0) (suspend) (set! v1-64 (>= (ja-aframe-num 0) 149.0)) ) @@ -2174,16 +1499,13 @@ (go plant-boss-reset arg0) (none) ) - :post - plant-boss-post + :post plant-boss-post ) ;; failed to figure out what this is: (defstate plant-boss-eat (plant-boss) - :event - plant-boss-generic-event-handler - :exit - (behavior () + :event plant-boss-generic-event-handler + :exit (behavior () (logclear! (-> self skel status) (janim-status spool)) (let ((a0-4 (handle->process (-> self camera)))) (if a0-4 @@ -2192,56 +1514,30 @@ ) (none) ) - :code - (behavior () - (let ((f30-1 (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (fmax (-> (new 'static 'array float 1 129.0) 0) (ja-aframe-num 0)) - (-> (new 'static 'array float 1 129.0) 0) - ) + :code (behavior () + (let ((f30-1 (the-as float (if (ja-group? plant-boss-main-attack-ja) + (fmax 129.0 (ja-aframe-num 0)) + 129.0 + ) + ) ) (gp-0 0) ) (send-event *camera* 'change-state cam-lookat 0) (logior! (-> self skel status) (janim-status inited)) - (ja-channel-push! 2 30) - (let ((s5-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data 18)) - num-func-identity + (ja-channel-push! 2 (seconds 0.1)) + (ja :group! (-> self draw art-group data 18) :num! (identity (ja-aframe f30-1 0))) + (ja :chan 1 + :group! (-> self draw art-group data 19) + :num! (identity (ja-aframe f30-1 0)) + :frame-interp (-> self interp) ) - (set! (-> s5-0 frame-num) (ja-aframe f30-1 0)) - ) - (let ((s5-1 (-> self skel root-channel 1))) - (set! (-> s5-1 frame-interp) (-> self interp)) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 19)) - num-func-identity - ) - (set! (-> s5-1 frame-num) (ja-aframe f30-1 0)) - ) (until (>= (ja-aframe-num 0) 285.0) (try-preload-stream *art-control* "$GAMCAM29" 0 self (the-as float -99.0)) - (set! (-> self energy) (seek (-> self energy) (the-as float 0.5) (* 0.2 (-> *display* seconds-per-frame)))) + (seek! (-> self energy) (the-as float 0.5) (* 0.2 (-> *display* seconds-per-frame))) (when (and (>= (ja-aframe-num 0) 175.0) (zero? gp-0)) (set! gp-0 1) - (let ((s5-2 (get-process *default-dead-pool* othercam #x4000))) - (set! (-> self camera) - (ppointer->handle (when s5-2 - (let ((t9-11 (method-of-type othercam activate))) - (t9-11 (the-as othercam s5-2) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 othercam-init-by-other self 28 #f #t) - (-> s5-2 ppointer) - ) - ) - ) - ) + (set! (-> self camera) (ppointer->handle (process-spawn othercam self 28 #f #t :to self))) (logior! (-> self skel status) (janim-status spool)) (ambient-hint-spawn "gamcam29" (the-as vector #f) *entity-pool* 'ambient) ) @@ -2249,129 +1545,66 @@ (set! gp-0 2) (send-event (handle->process (-> self camera)) 'joint "camera2") ) - (set! (-> self body flex-blend) - (seek (-> self body flex-blend) (-> (new 'static 'array float 1 0.0) 0) (-> *display* seconds-per-frame)) - ) - (set! (-> self interp) - (seek (-> self interp) (-> (new 'static 'array float 1 0.0) 0) (-> *display* seconds-per-frame)) - ) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 param 0) (the float (+ (-> a0-31 frame-group data 0 length) -1))) - (set! (-> a0-31 param 1) 0.66) - (joint-control-channel-group-eval! a0-31 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((a0-32 (-> self skel root-channel 1))) - (set! (-> a0-32 frame-interp) (-> self interp)) - (set! (-> a0-32 param 0) 0.0) - (joint-control-channel-group-eval! a0-32 (the-as art-joint-anim #f) num-func-chan) - ) + (seek! (-> self body flex-blend) (the-as float 0.0) (-> *display* seconds-per-frame)) + (seek! (-> self interp) (the-as float 0.0) (-> *display* seconds-per-frame)) + (ja :num! (seek! max 0.66)) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self interp)) (suspend) ) ) - (ja-channel-push! 1 75) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 frame-group) (the-as art-joint-anim (-> self draw art-group data 20))) - (set! (-> a0-35 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 20)) data 0 length) -1)) - ) - (set! (-> a0-35 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-35 frame-num) 0.0) - (joint-control-channel-group! a0-35 (the-as art-joint-anim (-> self draw art-group data 20)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! plant-boss-main-swallow-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1))) - (set! (-> a0-36 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event *target* 'end-mode) (logclear! (-> self skel status) (janim-status inited)) (go plant-boss-idle) (none) ) - :post - plant-boss-post + :post plant-boss-post ) ;; failed to figure out what this is: (defstate plant-boss-reset (plant-boss) - :event - (-> plant-boss-eat event) - :code - (behavior ((arg0 int)) + :event (-> plant-boss-eat event) + :code (behavior ((arg0 int)) (let ((gp-0 #f)) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 10) - ) + ((ja-group? plant-boss-main-intro-ja) (set! gp-0 #t) - (ja-channel-push! 1 150) + (ja-channel-push! 1 (seconds 0.5)) ) (else - (ja-channel-push! 1 300) + (ja-channel-push! 1 (seconds 1)) ) ) - (let ((s4-0 (-> self skel root-channel 0))) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> s4-0 param 0) (ja-aframe (the-as float 210.0) 0)) - (set! (-> s4-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> s4-0 frame-num) 0.0) - (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-reset-ja :num! (seek! (ja-aframe (the-as float 210.0) 0)) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) - (set! (-> self body flex-blend) - (seek (-> self body flex-blend) (-> (new 'static 'array float 1 0.0) 0) (-> *display* seconds-per-frame)) - ) + (seek! (-> self body flex-blend) (the-as float 0.0) (-> *display* seconds-per-frame)) (if (>= 1 arg0) - (set! (-> self neck flex-blend) - (seek (-> self neck flex-blend) (-> (new 'static 'array float 1 1.0) 0) (-> *display* seconds-per-frame)) - ) + (seek! (-> self neck flex-blend) (the-as float 1.0) (-> *display* seconds-per-frame)) ) (suspend) - (let ((s4-1 (-> self skel root-channel 0))) - (set! (-> s4-1 param 0) (ja-aframe (the-as float 210.0) 0)) - (set! (-> s4-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 210.0) 0))) ) (if (< 1 arg0) (go plant-boss-attack (+ arg0 -1)) ) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> s5-1 param 0) (ja-aframe (the-as float 240.0) 0)) - (set! (-> s5-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> s5-1 frame-num) (ja-aframe (the-as float 210.0) 0)) - (joint-control-channel-group! s5-1 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-reset-ja + :num! (seek! (ja-aframe (the-as float 240.0) 0)) + :frame-num (ja-aframe (the-as float 210.0) 0) + ) (until (ja-done? 0) - (set! (-> self body flex-blend) - (seek (-> self body flex-blend) (-> (new 'static 'array float 1 0.0) 0) (-> *display* seconds-per-frame)) - ) - (set! (-> self neck flex-blend) (seek - (-> self neck flex-blend) - (-> (new 'static 'array float 1 1.0) 0) - (* 2.0 (-> *display* seconds-per-frame)) - ) - ) + (seek! (-> self body flex-blend) (the-as float 0.0) (-> *display* seconds-per-frame)) + (seek! (-> self neck flex-blend) (the-as float 1.0) (* 2.0 (-> *display* seconds-per-frame))) (suspend) - (let ((s5-2 (-> self skel root-channel 0))) - (set! (-> s5-2 param 0) (ja-aframe (the-as float 240.0) 0)) - (set! (-> s5-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! s5-2 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-23 (the-as art-joint-anim #f) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 240.0) 0))) ) + (ja-no-eval :num! (seek!)) (if gp-0 (go plant-boss-spawn) (go plant-boss-idle) @@ -2379,96 +1612,60 @@ ) (none) ) - :post - plant-boss-post + :post plant-boss-post ) ;; failed to figure out what this is: (defstate plant-boss-hit (plant-boss) - :event - (-> plant-boss-eat event) - :code - (behavior ((arg0 symbol)) + :event (-> plant-boss-eat event) + :code (behavior ((arg0 symbol)) (let ((s5-0 (-> self child))) (while s5-0 (send-event (ppointer->process s5-0) 'hit arg0) (set! s5-0 (-> s5-0 0 brother)) ) ) - (set! (-> self health) - (seek (-> self health) (-> (new 'static 'array float 1 0.0) 0) (-> (new 'static 'array float 1 1.0) 0)) - ) + (seek! (-> self health) (the-as float 0.0) (the-as float 1.0)) (send-event (ppointer->process (-> self leaf 1)) 'kill 0) (send-event (ppointer->process (-> self leaf 0)) 'kill 0) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 60) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) (cond ((= arg0 'spin) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 20.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-1 frame-num) 0.0) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-hit-kick-ja + :num! (seek! (ja-aframe (the-as float 20.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe (the-as float 20.0) 0)) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 20.0) 0))) ) ) ((= arg0 'spin-air) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> gp-3 param 0) (ja-aframe (the-as float 20.0) 0)) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-3 frame-num) 0.0) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-hit-jumpkick-ja + :num! (seek! (ja-aframe (the-as float 20.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 param 0) (ja-aframe (the-as float 20.0) 0)) - (set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 20.0) 0))) ) ) (else - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 14))) - (set! (-> gp-5 param 0) (ja-aframe (the-as float 20.0) 0)) - (set! (-> gp-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-5 frame-num) 0.0) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 14)) num-func-seek!) - ) + (ja-no-eval :group! plant-boss-main-hit-ja :num! (seek! (ja-aframe (the-as float 20.0) 0)) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 param 0) (ja-aframe (the-as float 20.0) 0)) - (set! (-> gp-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 20.0) 0))) ) ) ) (if (= (-> self health) 0.0) (go plant-boss-dead #f) ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) @@ -2476,16 +1673,13 @@ (go plant-boss-spawn) (none) ) - :post - plant-boss-post + :post plant-boss-post ) ;; failed to figure out what this is: (defstate plant-boss-dead (plant-boss) - :event - plant-boss-generic-event-handler - :code - (behavior ((arg0 symbol)) + :event plant-boss-generic-event-handler + :code (behavior ((arg0 symbol)) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self neck flex-blend) 0.0) (set! (-> self body flex-blend) 0.0) @@ -2497,16 +1691,7 @@ (cond (arg0 (ja-channel-set! 1) - (let ((s5-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 17)) - num-func-identity - ) - (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - ) + (ja :group! plant-boss-main-die-ja :num! max) (suspend) (if (not (task-complete? *game-info* (-> self entity extra perm task))) (birth-pickup-at-point @@ -2523,21 +1708,9 @@ (let ((s4-0 #f) (s5-2 #f) ) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 150) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.5)) + (ja-no-eval :group! plant-boss-main-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (when (< 100.0 (ja-aframe-num 0)) @@ -2568,11 +1741,7 @@ ) ) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) (the float (+ (-> a0-22 frame-group data 0 length) -1))) - (set! (-> a0-22 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -2596,12 +1765,11 @@ (set! (-> (find-prim-by-id (-> self root-override) (the-as uint 16)) prim-core action) (collide-action)) 0 (logior! (-> self mask) (process-mask actor-pause)) - (clear-pending-settings-from-process *setting-control* self 'music) + (remove-setting! 'music) (go plant-boss-dead-idle) (none) ) - :post - (behavior () + :post (behavior () (plant-boss-post) (do-push-aways! (-> self root-override)) (none) @@ -2610,13 +1778,12 @@ ;; failed to figure out what this is: (defstate plant-boss-dead-idle (plant-boss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('bonk) (go plant-boss-dead-bounce (lerp-scale (the-as float 0.1) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 1.0) (the-as float (-> arg3 param 1)) (the-as float 40960.0) (the-as float 81920.0) @@ -2628,19 +1795,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 17)) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - ) + (ja :group! plant-boss-main-die-ja :num! max) (let ((gp-1 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 5)) (transform-post) @@ -2648,7 +1805,7 @@ (suspend) ) ) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -2658,18 +1815,15 @@ ;; failed to figure out what this is: (defstate plant-boss-dead-bounce (plant-boss) - :event - plant-boss-generic-event-handler - :trans - (the-as (function none :behavior plant-boss) rider-trans) - :code - (behavior ((arg0 float)) + :event plant-boss-generic-event-handler + :trans (the-as (function none :behavior plant-boss) rider-trans) + :code (behavior ((arg0 float)) (let ((v1-2 (-> self entity extra perm))) (if (and (< 0.3 arg0) (and (not (handle->process (-> self money))) (< (-> v1-2 user-int8 1) 5))) (set! (-> self money) (ppointer->handle (birth-pickup-at-point (-> self node-list data 42 bone transform vector 3) (pickup-type money) - (-> (new 'static 'array float 1 1.0) 0) + (the-as float 1.0) #t self (the-as fact-info #f) @@ -2679,43 +1833,17 @@ ) ) (ja-channel-set! 2) - (let ((s5-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data 21)) - num-func-identity - ) - (set! (-> s5-0 frame-num) 0.0) - ) - (let ((s5-1 (-> self skel root-channel 1))) - (set! (-> s5-1 frame-interp) (- (-> (new 'static 'array float 1 1.0) 0) arg0)) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 17)) - num-func-identity - ) - (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - ) + (ja :group! plant-boss-main-bounce-ja :num! min) + (ja :chan 1 :group! plant-boss-main-die-ja :num! max :frame-interp (- 1.0 arg0)) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) - (let ((v1-39 (-> self skel root-channel 1))) - (set! (-> v1-39 frame-interp) (- (-> (new 'static 'array float 1 1.0) 0) arg0)) - (set! (-> v1-39 num-func) num-func-identity) - (set! (-> v1-39 frame-num) (the float (+ (-> v1-39 frame-group data 0 length) -1))) - ) + (ja :num! (seek!)) + (ja :chan 1 :frame-interp (- 1.0 arg0) :num-func num-func-identity :frame-num max) ) (go plant-boss-dead-idle) (none) ) - :post - (the-as (function none :behavior plant-boss) rider-post) + :post (the-as (function none :behavior plant-boss) rider-post) ) ;; definition for method 11 of type plant-boss @@ -2752,7 +1880,7 @@ (set! (-> s2-2 collide-with) (collide-kind target)) (set! (-> s2-2 prim-core offense) (collide-offense no-offense)) (set! (-> s2-2 transform-index) 13) - (set-vector! (-> s2-2 local-sphere) 0.0 (-> (new 'static 'array float 1 8192.0) 0) 0.0 16384.0) + (set-vector! (-> s2-2 local-sphere) 0.0 8192.0 0.0 16384.0) (append-prim s3-0 s2-2) (set! (-> obj attack-prim 0) s2-2) ) @@ -2761,7 +1889,7 @@ (set! (-> s2-3 collide-with) (collide-kind)) (set! (-> s2-3 prim-core offense) (collide-offense no-offense)) (set! (-> s2-3 transform-index) 13) - (set-vector! (-> s2-3 local-sphere) 0.0 (-> (new 'static 'array float 1 8192.0) 0) 0.0 16384.0) + (set-vector! (-> s2-3 local-sphere) 0.0 8192.0 0.0 16384.0) (append-prim s3-0 s2-3) (set! (-> obj death-prim 0) s2-3) ) @@ -2782,211 +1910,120 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *plant-boss-sg* '()) (set! (-> obj draw shadow-ctrl) *plant-boss-shadow-control*) - (let ((s5-1 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-1 - (let ((t9-18 (method-of-type plant-boss-arm activate))) - (t9-18 (the-as plant-boss-arm s5-1) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - plant-boss-arm-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -24576.0 :z 8192.0 :w 1.0)) - (-> (new 'static 'array float 1 -8192.0) 0) - 1 - ) - (-> s5-1 ppointer) - ) + (process-spawn + plant-boss-arm + :init plant-boss-arm-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -24576.0 :z 8192.0 :w 1.0)) + -8192.0 + 1 + :to obj ) - (let ((s5-2 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-2 - (let ((t9-21 (method-of-type plant-boss-arm activate))) - (t9-21 (the-as plant-boss-arm s5-2) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-2 - plant-boss-arm-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 24576.0 :z 8192.0 :w 1.0)) - (-> (new 'static 'array float 1 8192.0) 0) - 0 - ) - (-> s5-2 ppointer) - ) + (process-spawn + plant-boss-arm + :init plant-boss-arm-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 24576.0 :z 8192.0 :w 1.0)) + 8192.0 + 0 + :to obj ) - (let ((s5-3 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-3 - (let ((t9-24 (method-of-type plant-boss-arm activate))) - (t9-24 (the-as plant-boss-arm s5-3) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-3 - plant-boss-back-arms-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :w 1.0)) - (-> (new 'static 'array float 1 0.0) 0) - 2 - ) - (-> s5-3 ppointer) - ) + (process-spawn + plant-boss-arm + :init plant-boss-back-arms-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :w 1.0)) + 0.0 + 2 + :to obj ) - (let ((s5-4 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-4 - (let ((t9-27 (method-of-type plant-boss-arm activate))) - (t9-27 (the-as plant-boss-arm s5-4) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-4 - plant-boss-vine-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 38912.0 :z 8192.0 :w 1.0)) - (new 'static 'vector :y 14563.556) - (-> (new 'static 'array float 1 1.0) 0) - 3 - ) - (-> s5-4 ppointer) - ) + (process-spawn + plant-boss-arm + :init plant-boss-vine-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 38912.0 :z 8192.0 :w 1.0)) + (new 'static 'vector :y 14563.556) + 1.0 + 3 + :to obj ) - (let ((s5-5 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-5 - (let ((t9-30 (method-of-type plant-boss-arm activate))) - (t9-30 (the-as plant-boss-arm s5-5) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-5 - plant-boss-vine-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -40960.0 :z 8192.0 :w 1.0)) - (new 'static 'vector :y -5461.3335) - (-> (new 'static 'array float 1 1.0) 0) - 3 - ) - (-> s5-5 ppointer) - ) + (process-spawn + plant-boss-arm + :init plant-boss-vine-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -40960.0 :z 8192.0 :w 1.0)) + (new 'static 'vector :y -5461.3335) + 1.0 + 3 + :to obj ) - (let ((s5-6 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-6 - (let ((t9-33 (method-of-type plant-boss-arm activate))) - (t9-33 (the-as plant-boss-arm s5-6) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-6 - plant-boss-vine-init - (vector+! - (new-stack-vector0) - (-> obj root-override trans) - (new 'static 'vector :x -29491.2 :z -7168.0 :w 1.0) + (process-spawn + plant-boss-arm + :init plant-boss-vine-init + (vector+! + (new-stack-vector0) + (-> obj root-override trans) + (new 'static 'vector :x -29491.2 :z -7168.0 :w 1.0) + ) + (new 'static 'vector :x -1820.4445 :y -11286.756) + 0.8 + 3 + :to obj + ) + (process-spawn + plant-boss-arm + :init plant-boss-vine-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 32768.0 :z -3072.0 :w 1.0)) + (new 'static 'vector :x -910.2222 :y 22755.555) + 0.8 + 3 + :to obj + ) + (process-spawn + plant-boss-arm + :init plant-boss-root-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 18841.6 :z 4096.0 :w 1.0)) + (new 'static 'vector :y -4096.0) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + 4 + :to obj + ) + (process-spawn + plant-boss-arm + :init plant-boss-root-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -18841.6 :z 4096.0 :w 1.0)) + (new 'static 'vector :x 364.0889 :y 4096.0) + (new 'static 'vector :x 1.0 :y 1.25 :z 1.0) + 4 + :to obj + ) + (process-spawn + plant-boss-arm + :init plant-boss-root-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :z -2048.0 :w 1.0)) + (new 'static 'vector :x 1820.4445) + (new 'static 'vector :x 0.9 :y 1.5 :z 1.0) + 4 + :to obj + ) + (set! (-> obj leaf 0) + (process-spawn + plant-boss-leaf + :init plant-boss-leaf-init + (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :w 1.0)) + 0.0 + 0 + :to obj ) - (new 'static 'vector :x -1820.4445 :y -11286.756) - (-> (new 'static 'array float 1 0.8) 0) - 3 ) - (-> s5-6 ppointer) - ) - ) - (let ((s5-7 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-7 - (let ((t9-36 (method-of-type plant-boss-arm activate))) - (t9-36 (the-as plant-boss-arm s5-7) obj 'plant-boss-arm (the-as pointer #x70004000)) + (set! (-> obj leaf 1) (process-spawn + plant-boss-leaf + :init plant-boss-leaf-init + (vector+! + (new-stack-vector0) + (-> obj root-override trans) + (new 'static 'vector :x -13189.12 :y 2838.528 :z 12288.0 :w 1.0) + ) + 0.0 + 1 + :to obj + ) ) - (run-now-in-process - s5-7 - plant-boss-vine-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 32768.0 :z -3072.0 :w 1.0)) - (new 'static 'vector :x -910.2222 :y 22755.555) - (-> (new 'static 'array float 1 0.8) 0) - 3 - ) - (-> s5-7 ppointer) - ) - ) - (let ((s5-8 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-8 - (let ((t9-39 (method-of-type plant-boss-arm activate))) - (t9-39 (the-as plant-boss-arm s5-8) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-8 - plant-boss-root-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 18841.6 :z 4096.0 :w 1.0)) - (new 'static 'vector :y -4096.0) - (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) - 4 - ) - (-> s5-8 ppointer) - ) - ) - (let ((s5-9 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-9 - (let ((t9-42 (method-of-type plant-boss-arm activate))) - (t9-42 (the-as plant-boss-arm s5-9) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-9 - plant-boss-root-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -18841.6 :z 4096.0 :w 1.0)) - (new 'static 'vector :x 364.0889 :y 4096.0) - (new 'static 'vector :x 1.0 :y 1.25 :z 1.0) - 4 - ) - (-> s5-9 ppointer) - ) - ) - (let ((s5-10 (get-process *default-dead-pool* plant-boss-arm #x4000))) - (when s5-10 - (let ((t9-45 (method-of-type plant-boss-arm activate))) - (t9-45 (the-as plant-boss-arm s5-10) obj 'plant-boss-arm (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-10 - plant-boss-root-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :z -2048.0 :w 1.0)) - (new 'static 'vector :x 1820.4445) - (new 'static 'vector :x 0.9 :y 1.5 :z 1.0) - 4 - ) - (-> s5-10 ppointer) - ) - ) - (let ((s5-11 (get-process *default-dead-pool* plant-boss-leaf #x4000))) - (set! (-> obj leaf 0) - (the-as - (pointer plant-boss-leaf) - (when s5-11 - (let ((t9-48 (method-of-type plant-boss-leaf activate))) - (t9-48 (the-as plant-boss-leaf s5-11) obj 'plant-boss-leaf (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-11 - plant-boss-leaf-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :w 1.0)) - (-> (new 'static 'array float 1 0.0) 0) - 0 - ) - (-> s5-11 ppointer) - ) - ) - ) - ) - (let ((s5-12 (get-process *default-dead-pool* plant-boss-leaf #x4000))) - (set! (-> obj leaf 1) - (the-as - (pointer plant-boss-leaf) - (when s5-12 - (let ((t9-51 (method-of-type plant-boss-leaf activate))) - (t9-51 (the-as plant-boss-leaf s5-12) obj 'plant-boss-leaf (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-12 - plant-boss-leaf-init - (vector+! - (new-stack-vector0) - (-> obj root-override trans) - (new 'static 'vector :x -13189.12 :y 2838.528 :z 12288.0 :w 1.0) - ) - (-> (new 'static 'array float 1 0.0) 0) - 1 - ) - (-> s5-12 ppointer) - ) - ) - ) - ) (set! (-> obj energy) 0.25) (set! (-> obj health) 3.0) (set! (-> obj cam-tracker) (the-as handle #f)) @@ -2994,24 +2031,12 @@ (set! (-> obj money) (the-as handle #f)) (set! (-> obj try-inc) #f) (set! (-> obj neck) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj 13)) - (set-vector! - (-> obj neck twist-max) - 3640.889 - (-> (new 'static 'array float 1 8192.0) 0) - 0.0 - (-> (new 'static 'array float 1 1.0) 0) - ) + (set-vector! (-> obj neck twist-max) 3640.889 8192.0 0.0 1.0) (set! (-> obj neck up) (the-as uint 0)) (set! (-> obj neck nose) (the-as uint 1)) (set! (-> obj neck ear) (the-as uint 2)) (set! (-> obj body) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj 4)) - (set-vector! - (-> obj body twist-max) - 0.0 - (-> (new 'static 'array float 1 8192.0) 0) - 0.0 - (-> (new 'static 'array float 1 1.0) 0) - ) + (set-vector! (-> obj body twist-max) 0.0 8192.0 0.0 1.0) (set! (-> obj body up) (the-as uint 1)) (set! (-> obj body nose) (the-as uint 0)) (set! (-> obj body ear) (the-as uint 2)) diff --git a/test/decompiler/reference/levels/jungleb/plat-flip_REF.gc b/test/decompiler/reference/levels/jungleb/plat-flip_REF.gc index a269260c8f..b0de0b306a 100644 --- a/test/decompiler/reference/levels/jungleb/plat-flip_REF.gc +++ b/test/decompiler/reference/levels/jungleb/plat-flip_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/plat-flip-ag.gc") + ;; definition of type plat-flip (deftype plat-flip (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -41,100 +43,66 @@ ) ;; failed to figure out what this is: -(defskelgroup *plat-flip-sg* plat-flip - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *plat-flip-sg* plat-flip plat-flip-geo-jg plat-flip-turn-down-ja + ((plat-flip-geo-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; failed to figure out what this is: (defstate plat-flip-idle (plat-flip) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'bonk) (activate! (-> self smush) -1.0 90 300 1.0 1.0) ) ((= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) (the-as smush-control #f) ) ) ) ) ) - :trans - (the-as (function none :behavior plat-flip) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior plat-flip) rider-trans) + :code (behavior () (local-vars (f30-0 float) (f30-1 float)) (let ((gp-0 #f)) - (while #t + (loop (let ((f0-1 (get-current-value (-> self sync) (-> self total-time)))) (cond ((< f0-1 (-> self before-turn-down-time)) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! plat-flip-turn-down-ja :num! min) (set! gp-0 #f) ) ((begin (set! f30-0 (- f0-1 (-> self before-turn-down-time))) (< f30-0 (-> self turn-down-time))) (when (not gp-0) (set! gp-0 #t) - (sound-play-by-name (static-sound-name "plat-flip") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plat-flip") ) - (let ((s5-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity + (ja :group! plat-flip-turn-down-ja + :num! (identity (/ (* f30-0 (the float (+ (-> (the-as art-joint-anim plat-flip-turn-down-ja) data 0 length) -1))) + (-> self turn-down-time) + ) + ) ) - (set! (-> s5-1 frame-num) - (/ (* f30-0 (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1))) - (-> self turn-down-time) - ) - ) - ) ) ((begin (set! f30-1 (- f30-0 (-> self turn-down-time))) (< f30-1 (-> self before-turn-up-time))) (set! gp-0 #f) - (let ((s5-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-2 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> s5-2 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - ) + (ja :group! plat-flip-turn-down-ja :num! max) ) (else (when (not gp-0) (set! gp-0 #t) - (sound-play-by-name (static-sound-name "plat-flip") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plat-flip") ) - (let ((f30-2 (- f30-1 (-> self before-turn-up-time))) - (s5-4 (-> self skel root-channel 0)) + (let ((f30-2 (- f30-1 (-> self before-turn-up-time)))) + (ja :group! plat-flip-turn-up-ja + :num! (identity (/ (* f30-2 (the float (+ (-> (the-as art-joint-anim plat-flip-turn-up-ja) data 0 length) -1))) + (-> self turn-up-time) + ) + ) ) - (joint-control-channel-group-eval! - s5-4 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> s5-4 frame-num) - (/ (* f30-2 (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1))) - (-> self turn-up-time) - ) - ) ) ) ) @@ -149,8 +117,7 @@ ) (none) ) - :post - (the-as (function none :behavior plat-flip) rider-post) + :post (the-as (function none :behavior plat-flip) rider-post) ) ;; definition for method 11 of type plat-flip diff --git a/test/decompiler/reference/levels/lavatube/assistant-lavatube_REF.gc b/test/decompiler/reference/levels/lavatube/assistant-lavatube_REF.gc index 8ee6a066d8..30ff5e2639 100644 --- a/test/decompiler/reference/levels/lavatube/assistant-lavatube_REF.gc +++ b/test/decompiler/reference/levels/lavatube/assistant-lavatube_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/assistant-lavatube-start-ag.gc") + ;; definition of type assistant-lavatube-start (deftype assistant-lavatube-start (process-taskable) () @@ -19,14 +21,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *assistant-lavatube-start-sg* assistant-lavatube-start - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *assistant-lavatube-start-sg* assistant-lavatube-start assistant-lavatube-start-lod0-jg assistant-lavatube-start-idle-ja + ((assistant-lavatube-start-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow assistant-lavatube-start-shadow-mg + ) ;; definition for method 32 of type assistant-lavatube-start (defmethod play-anim! assistant-lavatube-start ((obj assistant-lavatube-start) (arg0 symbol)) @@ -39,8 +38,7 @@ :name "assistant-lavatube-start-resolution" :index 5 :parts 11 - :command-list - '((232 joint "cameraB") (491 joint "camera") (866 joint "cameraB") (1061 joint "camera")) + :command-list '((232 joint "cameraB") (491 joint "camera") (866 joint "cameraB") (1061 joint "camera")) ) ) (else @@ -65,8 +63,7 @@ ;; failed to figure out what this is: (defstate hidden (assistant-lavatube-start) :virtual #t - :trans - (behavior () + :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) (when (and (cond ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) @@ -123,77 +120,29 @@ ;; failed to figure out what this is: (defstate idle (assistant-lavatube-start) :virtual #t - :code - (behavior () - (while #t - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + :code (behavior () + (loop + (when (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 3)) ) (let* ((f30-0 2.0) (v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-8 (the-as number (logior #x3f800000 v1-7))) ) (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-8)))) 2)) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-12 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! - a0-12 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (ja-channel-push! 1 15) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) diff --git a/test/decompiler/reference/levels/lavatube/lavatube-energy_REF.gc b/test/decompiler/reference/levels/lavatube/lavatube-energy_REF.gc index f020e2f82f..bda9eaf67a 100644 --- a/test/decompiler/reference/levels/lavatube/lavatube-energy_REF.gc +++ b/test/decompiler/reference/levels/lavatube/lavatube-energy_REF.gc @@ -1,18 +1,22 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/energyball-ag.gc") +(import "goal_src/import/energybase-ag.gc") +(import "goal_src/import/energyhub-ag.gc") +(import "goal_src/import/energyarm-ag.gc") +(import "goal_src/import/energydoor-ag.gc") + ;; failed to figure out what this is: (defpartgroup group-energyarm :id 544 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1931 :fade-after (meters 120)) (sp-item 2167 :fade-after (meters 60) :falloff-to (meters 60))) + :parts ((sp-item 1931 :fade-after (meters 120)) (sp-item 2167 :fade-after (meters 60) :falloff-to (meters 60))) ) ;; failed to figure out what this is: (defpart 1931 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -31,8 +35,7 @@ ;; failed to figure out what this is: (defpart 2167 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 8.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -59,8 +62,7 @@ (defpartgroup group-energyball-always :id 545 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2168 :fade-after (meters 80) :falloff-to (meters 80)) + :parts ((sp-item 2168 :fade-after (meters 80) :falloff-to (meters 80)) (sp-item 2169 :fade-after (meters 120)) (sp-item 2170 :fade-after (meters 120)) (sp-item 2171 :fade-after (meters 120) :flags (is-3d)) @@ -73,8 +75,7 @@ ;; failed to figure out what this is: (defpart 2168 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-y (meters -5.5)) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) @@ -100,8 +101,7 @@ ;; failed to figure out what this is: (defpart 2176 - :init-specs - ((sp-flt spt-scale-x (meters 1.2)) + :init-specs ((sp-flt spt-scale-x (meters 1.2)) (sp-copy-from-other spt-scale-y -4) (sp-flt spt-a 48.0) (sp-int spt-timer 5) @@ -110,8 +110,7 @@ ;; failed to figure out what this is: (defpart 2177 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -135,8 +134,7 @@ ;; failed to figure out what this is: (defpart 2169 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -5.5)) (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0) @@ -152,8 +150,7 @@ ;; failed to figure out what this is: (defpart 2170 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -5.5)) (sp-rnd-flt spt-scale-x (meters 12) (meters 8) 1.0) @@ -170,8 +167,7 @@ ;; failed to figure out what this is: (defpart 2171 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -5)) (sp-rnd-flt spt-scale-x (meters 12) (meters 8) 1.0) @@ -191,8 +187,7 @@ ;; failed to figure out what this is: (defpart 2172 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-y (meters -5.5)) (sp-flt spt-scale-x (meters 0.5)) @@ -213,8 +208,7 @@ ;; failed to figure out what this is: (defpart 2173 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 6) 1.0) (sp-int spt-rot-x 4) @@ -234,14 +228,12 @@ ;; failed to figure out what this is: (defpart 2178 - :init-specs - ((sp-flt spt-b 0.0) (sp-flt spt-a 64.0) (sp-flt spt-fade-g -4.266667)) + :init-specs ((sp-flt spt-b 0.0) (sp-flt spt-a 64.0) (sp-flt spt-fade-g -4.266667)) ) ;; failed to figure out what this is: (defpart 2174 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0) (sp-int spt-rot-x 4) @@ -261,8 +253,7 @@ ;; failed to figure out what this is: (defpart 2175 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0) (sp-int spt-rot-x 4) @@ -285,8 +276,7 @@ :id 546 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 45) - :parts - ((sp-item 2179 :period 600 :length 5) + :parts ((sp-item 2179 :period 600 :length 5) (sp-item 2180 :period 600 :length 40) (sp-item 2181 :period 600 :length 20) (sp-item 2182 :period 600 :length 20) @@ -295,8 +285,7 @@ ;; failed to figure out what this is: (defpart 2180 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) @@ -322,14 +311,12 @@ ;; failed to figure out what this is: (defpart 2183 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2182 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 0.4)) @@ -348,8 +335,7 @@ ;; failed to figure out what this is: (defpart 2179 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 40)) @@ -366,8 +352,7 @@ ;; failed to figure out what this is: (defpart 2181 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters -2) (meters 4) 1.0) @@ -422,13 +407,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *energydoor-sg* energydoor - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 14 0 35) - :longest-edge (meters 0) - ) +(defskelgroup *energydoor-sg* energydoor energydoor-lod0-jg energydoor-idle-ja + ((energydoor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 14 0 35) + ) ;; definition for function energydoor-player-dist (defbehavior energydoor-player-dist energydoor () @@ -466,43 +448,12 @@ ;; failed to figure out what this is: (defstate energydoor-closing (energydoor) - :event - energydoor-closed-handler - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) 0.0) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :event energydoor-closed-handler + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 0.0) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) (if (or (task-closed? (-> self entity extra perm task) (task-status need-resolution)) (< (energydoor-player-dist) 0.0) @@ -512,16 +463,13 @@ ) (none) ) - :post - (the-as (function none :behavior energydoor) transform-post) + :post (the-as (function none :behavior energydoor) transform-post) ) ;; failed to figure out what this is: (defstate energydoor-opened (energydoor) - :event - energydoor-open-handler - :trans - (behavior () + :event energydoor-open-handler + :trans (behavior () (let ((f30-0 (energydoor-player-dist))) (cond ((< f30-0 -450560.0) @@ -552,14 +500,10 @@ ) (none) ) - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) (the float (+ (-> v1-2 frame-group data 0 length) -1))) - ) + :code (behavior () + (ja :num-func num-func-identity :frame-num max) (transform-post) - (while #t + (loop (suspend) ) (none) @@ -568,57 +512,23 @@ ;; failed to figure out what this is: (defstate energydoor-opening (energydoor) - :event - energydoor-open-handler - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :event energydoor-open-handler + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go energydoor-opened) (none) ) - :post - (the-as (function none :behavior energydoor) transform-post) + :post (the-as (function none :behavior energydoor) transform-post) ) ;; failed to figure out what this is: (defstate energydoor-closed-till-task (energydoor) - :event - energydoor-closed-handler - :trans - (behavior () + :event energydoor-closed-handler + :trans (behavior () (cond ((task-closed? (-> self entity extra perm task) (task-status need-resolution)) (go energydoor-opening) @@ -643,14 +553,10 @@ ) (none) ) - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) 0.0) - ) + :code (behavior () + (ja :num-func num-func-identity :frame-num 0.0) (transform-post) - (while #t + (loop (suspend) ) (none) @@ -659,23 +565,17 @@ ;; failed to figure out what this is: (defstate energydoor-closed-till-near (energydoor) - :event - energydoor-closed-handler - :trans - (behavior () + :event energydoor-closed-handler + :trans (behavior () (if (< -409600.0 (energydoor-player-dist)) (go energydoor-opening) ) (none) ) - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) 0.0) - ) + :code (behavior () + (ja :num-func num-func-identity :frame-num 0.0) (transform-post) - (while #t + (loop (suspend) ) (none) @@ -771,20 +671,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *energybase-sg* energybase - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 40 0 40) - :longest-edge (meters 0) - ) +(defskelgroup *energybase-sg* energybase energybase-lod0-jg energybase-idle-ja + ((energybase-lod0-mg (meters 999999))) + :bounds (static-spherem 0 40 0 40) + ) ;; failed to figure out what this is: (defstate energybase-stopped (energybase) - :code - (behavior () + :code (behavior () (ja-post) - (while #t + (loop (suspend) ) (none) @@ -793,69 +689,36 @@ ;; failed to figure out what this is: (defstate energybase-stopping (energybase) - :code - (behavior () + :code (behavior () (let ((f30-0 1.0)) - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) f30-0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (set! f30-0 (- f30-0 (* 0.002 (-> *display* time-adjust-ratio)))) (if (< f30-0 0.0) (go energybase-stopped) ) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) f30-0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) (none) ) - :post - (the-as (function none :behavior energybase) ja-post) + :post (the-as (function none :behavior energybase) ja-post) ) ;; failed to figure out what this is: (defstate energybase-idle (energybase) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('stop) (go energybase-stopping) ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (and *target* (>= 307200.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (game-text-id lavatube-shoot-the-spheres) @@ -865,45 +728,15 @@ (game-task none) ) ) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-2 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior energybase) ja-post) + :post (the-as (function none :behavior energybase) ja-post) ) ;; definition for method 11 of type energybase @@ -1027,52 +860,38 @@ ) ;; failed to figure out what this is: -(defskelgroup *energyball-sg* energyball - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *energyball-sg* energyball energyball-lod0-jg energyball-idle-ja + ((energyball-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) ;; failed to figure out what this is: (defstate energyball-idle (energyball) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) - (the-as - object - (when (= v1-0 'attack) - (when (and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow)) - (increment-success-for-hint (game-text-id lavatube-shoot-the-spheres)) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 546) - 600 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (the-as object (when (= v1-0 'attack) + (when (and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow)) + (increment-success-for-hint (game-text-id lavatube-shoot-the-spheres)) + (sound-play "dcrate-break") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 546) + 600 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* + ) + (cleanup-for-death self) + (deactivate self) + ) + ) ) - (cleanup-for-death self) - (deactivate self) - ) - ) - ) ) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (spawn (-> self part) (-> self root-override trans)) (let* ((v1-3 (-> self parent-overide)) @@ -1100,48 +919,17 @@ ) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior energyball) rider-post) + :post (the-as (function none :behavior energyball) rider-post) ) ;; definition for function energyball-init @@ -1181,13 +969,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *energyarm-sg* energyarm - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 -20 17) - :longest-edge (meters 0) - ) +(defskelgroup *energyarm-sg* energyarm energyarm-lod0-jg energyarm-idle-ja + ((energyarm-lod0-mg (meters 20)) (energyarm-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 -20 17) + ) ;; definition for function energyarm-trans (defbehavior energyarm-trans energyarm () @@ -1230,79 +1015,43 @@ ;; failed to figure out what this is: (defstate energyarm-stop (energyarm) - :enter - (behavior () + :enter (behavior () '() (none) ) - :trans - (behavior () + :trans (behavior () (update! (-> self x-rotation) 0.0) (update! (-> self y-chatter-rotation) 0.0) (energyarm-trans) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior energyarm) rider-post) + :post (the-as (function none :behavior energyarm) rider-post) ) ;; failed to figure out what this is: (defstate energyarm-no-ball (energyarm) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('stop) (go energyarm-stop) ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self y-chatter-rotation osc target) 1.0) (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self x-correction) (fmax -1.0 (+ -0.1 (-> self x-correction)))) (update! (-> self x-rotation) 0.0) (when (at-min? (-> self x-rotation)) @@ -1328,59 +1077,26 @@ (energyarm-trans) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior energyarm) rider-post) + :post (the-as (function none :behavior energyarm) rider-post) ) ;; failed to figure out what this is: (defstate energyarm-fall (energyarm) - :enter - (behavior () + :enter (behavior () (set! (-> self x-fall-rotation osc target) 1.0) (none) ) - :trans - (behavior () + :trans (behavior () (update! (-> self x-fall-rotation) 0.0) (update! (-> self y-chatter-rotation) 0.0) (when (at-max? (-> self x-fall-rotation)) @@ -1393,62 +1109,29 @@ (energyarm-trans) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior energyarm) rider-post) + :post (the-as (function none :behavior energyarm) rider-post) ) ;; failed to figure out what this is: (defstate energyarm-idle (energyarm) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('stop) (go energyarm-stop) ) ) ) - :trans - (behavior () + :trans (behavior () (update! (-> self x-rotation) 0.0) (when (at-min? (-> self x-rotation)) (let* ((f30-0 0.15) @@ -1486,33 +1169,25 @@ ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (-> self skel root-channel 0))) (set! (-> gp-0 num-func) num-func-identity) - (let* ((v1-4 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-5 (the-as number (logior #x3f800000 v1-4))) - ) - (set! (-> gp-0 frame-num) (* (+ -1.0 (the-as float v1-5)) (the float (ja-num-frames 0)))) - ) + (set! (-> gp-0 frame-num) (* (rand-float-gen) (the float (ja-num-frames 0)))) ) - (while #t + (loop (suspend) (let* ((f30-1 0.25) (f28-0 0.25) (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-10 (the-as number (logior #x3f800000 v1-9))) (f0-9 (+ f30-1 (* f28-0 (+ -1.0 (the-as float v1-10))))) - (a0-5 (-> self skel root-channel 0)) ) - (set! (-> a0-5 param 0) f0-9) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-loop!) + (ja :num! (loop! f0-9)) ) ) (none) ) - :post - (the-as (function none :behavior energyarm) rider-post) + :post (the-as (function none :behavior energyarm) rider-post) ) ;; definition for function energyarm-init @@ -1576,18 +1251,7 @@ (go energyarm-stop) ) (else - (let ((gp-1 (get-process *default-dead-pool* energyball #x4000))) - (set! (-> self ball) - (ppointer->handle (when gp-1 - (let ((t9-10 (method-of-type energyball activate))) - (t9-10 (the-as energyball gp-1) self 'energyball (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 energyball-init-by-other (-> self root-override trans)) - (-> gp-1 ppointer) - ) - ) - ) - ) + (set! (-> self ball) (ppointer->handle (process-spawn energyball (-> self root-override trans) :to self))) (go energyarm-idle) ) ) @@ -1595,13 +1259,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *energyhub-sg* energyhub - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *energyhub-sg* energyhub energyhub-lod0-jg energyhub-idle-ja + ((energyhub-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 10) + ) ;; definition for function energyhub-trans (defbehavior energyhub-trans energyhub () @@ -1662,8 +1323,7 @@ ;; failed to figure out what this is: (defstate energyhub-stopped (energyhub) - :enter - (behavior () + :enter (behavior () (set! (-> self rotation-speed target) 0.0) (set! (-> self rotation-speed accel) 0.0005) (dotimes (gp-0 5) @@ -1674,38 +1334,32 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (update! (-> self rotation-speed) 0.0) (energyhub-trans) (energyhub-set-lava-height -122880.0) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) (let* ((f30-0 1.0) (f28-0 0.25) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-2 (the-as number (logior #x3f800000 v1-1))) (f0-4 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-2))))) - (a0-2 (-> self skel root-channel 0)) ) - (set! (-> a0-2 param 0) f0-4) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) + (ja :num! (loop! f0-4)) ) ) (none) ) - :post - (the-as (function none :behavior energyhub) ja-post) + :post (the-as (function none :behavior energyhub) ja-post) ) ;; failed to figure out what this is: (defstate energyhub-stop (energyhub) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'flash) (let ((f0-0 1.9921875)) @@ -1716,8 +1370,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self rotation-speed target) 0.0) (set! (-> self rotation-speed accel) 0.0005) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -1763,8 +1416,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (update! (-> self rotation-speed) 0.0) (energyhub-trans) (energyhub-set-lava-height -122880.0) @@ -1773,31 +1425,26 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) (let* ((f30-0 1.0) (f28-0 0.25) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-2 (the-as number (logior #x3f800000 v1-1))) (f0-4 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-2))))) - (a0-2 (-> self skel root-channel 0)) ) - (set! (-> a0-2 param 0) f0-4) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) + (ja :num! (loop! f0-4)) ) ) (none) ) - :post - (the-as (function none :behavior energyhub) ja-post) + :post (the-as (function none :behavior energyhub) ja-post) ) ;; failed to figure out what this is: (defstate energyhub-idle (energyhub) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'flash) (let ((f0-0 1.9921875)) @@ -1808,8 +1455,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (nonzero? (-> self sound)) (update! (-> self sound)) ) @@ -1858,25 +1504,21 @@ (energyhub-trans) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) (let* ((f30-0 1.0) (f28-0 0.25) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-2 (the-as number (logior #x3f800000 v1-1))) (f0-4 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-2))))) - (a0-2 (-> self skel root-channel 0)) ) - (set! (-> a0-2 param 0) f0-4) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) + (ja :num! (loop! f0-4)) ) ) (none) ) - :post - (the-as (function none :behavior energyhub) ja-post) + :post (the-as (function none :behavior energyhub) ja-post) ) ;; definition for method 11 of type energyhub @@ -1899,18 +1541,7 @@ (set-vector! s5-2 0.0 2457.6 -24576.0 1.0) (matrix-rotate-y! s4-1 f30-0) (dotimes (s3-0 5) - (let ((s2-0 (get-process *default-dead-pool* energyarm #x4000))) - (set! (-> obj arm s3-0) - (ppointer->handle (when s2-0 - (let ((t9-9 (method-of-type energyarm activate))) - (t9-9 (the-as energyarm s2-0) obj 'energyarm (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 energyarm-init-by-other s5-2 (* (the float s3-0) f30-0)) - (-> s2-0 ppointer) - ) - ) - ) - ) + (set! (-> obj arm s3-0) (ppointer->handle (process-spawn energyarm s5-2 (* (the float s3-0) f30-0) :to obj))) (vector-matrix*! s5-2 s5-2 s4-1) ) ) @@ -1954,58 +1585,21 @@ ) ;; failed to figure out what this is: -(defskelgroup *energylava-sg* energylava - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 120) - :longest-edge (meters 0) - ) +(defskelgroup *energylava-sg* energylava 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 120)) ;; failed to figure out what this is: (defstate energylava-idle (energylava) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior energylava) ja-post) + :post (the-as (function none :behavior energylava) ja-post) ) ;; definition for method 11 of type energylava diff --git a/test/decompiler/reference/levels/lavatube/lavatube-obs_REF.gc b/test/decompiler/reference/levels/lavatube/lavatube-obs_REF.gc index 21308075f6..92e9cc3c55 100644 --- a/test/decompiler/reference/levels/lavatube/lavatube-obs_REF.gc +++ b/test/decompiler/reference/levels/lavatube/lavatube-obs_REF.gc @@ -1,6 +1,16 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/lavafallsewerb-ag.gc") +(import "goal_src/import/lavashortcut-ag.gc") +(import "goal_src/import/lavabase-ag.gc") +(import "goal_src/import/lavafallsewera-ag.gc") +(import "goal_src/import/chainmine-ag.gc") +(import "goal_src/import/lavafall-ag.gc") +(import "goal_src/import/lavaballoon-ag.gc") +(import "goal_src/import/darkecobarrel-ag.gc") +(import "goal_src/import/lavayellowtarp-ag.gc") + ;; definition of type lavabase (deftype lavabase (process-drawable) () @@ -22,58 +32,25 @@ ) ;; failed to figure out what this is: -(defskelgroup *lavabase-sg* lavabase - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 22) - :longest-edge (meters 9.4) - ) +(defskelgroup *lavabase-sg* lavabase lavabase-lod0-jg lavabase-idle-ja + ((lavabase-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 22) + :longest-edge (meters 9.4) + ) ;; failed to figure out what this is: (defstate lavabase-idle (lavabase) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior lavabase) ja-post) + :post (the-as (function none :behavior lavabase) ja-post) ) ;; definition for method 11 of type lavabase @@ -107,58 +84,25 @@ ) ;; failed to figure out what this is: -(defskelgroup *lavafall-sg* lavafall - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 10 0 13) - :longest-edge (meters 5.4) - ) +(defskelgroup *lavafall-sg* lavafall lavafall-lod0-jg lavafall-idle-ja + ((lavafall-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 13) + :longest-edge (meters 5.4) + ) ;; failed to figure out what this is: (defstate lavafall-idle (lavafall) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior lavafall) ja-post) + :post (the-as (function none :behavior lavafall) ja-post) ) ;; definition for method 11 of type lavafall @@ -192,58 +136,25 @@ ) ;; failed to figure out what this is: -(defskelgroup *lavashortcut-sg* lavashortcut - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -34 0 105) - :longest-edge (meters 11.9) - ) +(defskelgroup *lavashortcut-sg* lavashortcut lavashortcut-lod0-jg lavashortcut-idle-ja + ((lavashortcut-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -34 0 105) + :longest-edge (meters 11.9) + ) ;; failed to figure out what this is: (defstate lavashortcut-idle (lavashortcut) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior lavashortcut) ja-post) + :post (the-as (function none :behavior lavashortcut) ja-post) ) ;; definition for method 11 of type lavashortcut @@ -261,14 +172,12 @@ :id 540 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1932 :period 15 :length 5)) + :parts ((sp-item 1932 :period 15 :length 5)) ) ;; failed to figure out what this is: (defpart 1932 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 2) 1.0) @@ -297,8 +206,7 @@ :id 541 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2125 :period 600 :length 5) + :parts ((sp-item 2125 :period 600 :length 5) (sp-item 2126 :period 600 :length 40) (sp-item 2127 :period 600 :length 20) (sp-item 2128 :period 600 :length 20) @@ -372,8 +280,7 @@ ;; failed to figure out what this is: (defpart 2166 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters -2) (meters 4) 1.0) @@ -393,8 +300,7 @@ ;; failed to figure out what this is: (defpart 2126 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -420,14 +326,12 @@ ;; failed to figure out what this is: (defpart 2129 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2128 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 0.4)) @@ -446,8 +350,7 @@ ;; failed to figure out what this is: (defpart 2125 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 32)) @@ -464,8 +367,7 @@ ;; failed to figure out what this is: (defpart 2127 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 2) 1.0) @@ -605,13 +507,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *darkecobarrel-sg* darkecobarrel - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -7.75 0 8.6) - :longest-edge (meters 2.8) - ) +(defskelgroup *darkecobarrel-sg* darkecobarrel darkecobarrel-lod0-jg darkecobarrel-idle-ja + ((darkecobarrel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -7.75 0 8.6) + :longest-edge (meters 2.8) + ) ;; definition for function darkecobarrel-base-time (defbehavior darkecobarrel-base-time darkecobarrel-base () @@ -689,23 +589,24 @@ ;; failed to figure out what this is: (defstate darkecobarrel-mover-die (darkecobarrel-mover) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root-override trans quad)) (set! (-> gp-1 y) (+ -49152.0 (-> gp-1 y))) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 541) 600 #f #f #f gp-1) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 541) + 600 + #f + #f + #f + gp-1 + :to *entity-pool* ) ) (suspend) @@ -721,8 +622,7 @@ ;; failed to figure out what this is: (defstate darkecobarrel-mover-move (darkecobarrel-mover) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (cond @@ -734,17 +634,7 @@ (-> self root-override) (the-as uint 1) ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack-invinc) - (set! (-> a1-2 param 0) s5-0) - (let ((a0-4 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-4 mode) 'death) - (set! (-> a1-2 param 1) (the-as uint a0-4)) - ) - (send-event-function arg0 a1-2) - ) + (send-event arg0 'attack-invinc s5-0 (static-attack-info ((mode 'death)))) ) (go darkecobarrel-mover-die) ) @@ -794,8 +684,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (update! (-> self y-offset) 0.0) (if (and (at-min? (-> self y-offset)) (< (-> self y-offset osc vel) 0.03)) (set! (-> self y-offset osc vel) (fabs (update! (-> self y-offset-tgt)))) @@ -804,34 +693,23 @@ (darkecobarrel-mover-pos) (none) ) - :code - (behavior () - (let* ((f30-0 0.9) - (f28-0 0.25) - (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-2)))) + :code (behavior () + (let ((f30-0 0.9) + (f28-0 0.25) + ) + (+ f30-0 (* f28-0 (rand-float-gen))) ) (let ((gp-0 (-> self skel root-channel 0))) (set! (-> gp-0 num-func) num-func-identity) - (let* ((v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-9 (the-as number (logior #x3f800000 v1-8))) - ) - (set! (-> gp-0 frame-num) (* (+ -1.0 (the-as float v1-9)) (the float (ja-num-frames 0)))) - ) + (set! (-> gp-0 frame-num) (* (rand-float-gen) (the float (ja-num-frames 0)))) ) - (while #t - (let ((v1-14 (-> self skel root-channel 0))) - (set! (-> v1-14 num-func) num-func-identity) - (set! (-> v1-14 frame-num) 0.0) - ) + (loop + (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) (none) ) - :post - (the-as (function none :behavior darkecobarrel-mover) pusher-post) + :post (the-as (function none :behavior darkecobarrel-mover) pusher-post) ) ;; definition for function darkecobarrel-mover-init-by-other @@ -908,29 +786,20 @@ ;; failed to figure out what this is: (defstate darkecobarrel-spawner (darkecobarrel) - :trans - (behavior () + :trans (behavior () (let ((gp-1 (mod (darkecobarrel-base-time) (darkecobarrel-cycle-time)))) (if (and (> (-> self cur-spawn) 0) (< gp-1 (-> self spawn-array (+ (-> self cur-spawn) -1)))) (+! gp-1 (darkecobarrel-cycle-time)) ) (let ((gp-2 (- gp-1 (-> self spawn-array (-> self cur-spawn))))) (when (>= gp-2 0) - (let ((s5-0 (get-process *default-dead-pool* darkecobarrel-mover #x4000))) - (when s5-0 - (let ((t9-4 (method-of-type darkecobarrel-mover activate))) - (t9-4 (the-as darkecobarrel-mover s5-0) self 'darkecobarrel-mover (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - darkecobarrel-mover-init-by-other - (-> self entity) - (-> self speed) - (- (darkecobarrel-base-time) (the-as time-frame gp-2)) - (-> self sync) - ) - (-> s5-0 ppointer) - ) + (process-spawn + darkecobarrel-mover + (-> self entity) + (-> self speed) + (- (darkecobarrel-base-time) (the-as time-frame gp-2)) + (-> self sync) + :to self ) (darkecobarrel-advance-curspawn) ) @@ -941,42 +810,12 @@ ) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) @@ -991,19 +830,7 @@ (set! (-> obj root-override) (the-as collide-shape-moving (new 'process 'trsqv))) (darkecobarrel-base-init arg0) (set! (-> obj sound) - (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "lav-dark-eco") - :volume #x400 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (new 'process 'ambient-sound (static-sound-spec "lav-dark-eco" :fo-max 30) (-> obj root-override trans)) ) (logior! (-> obj draw status) (draw-status hidden)) (set! (-> obj speed) (/ 300.0 (res-lump-float (-> obj entity) 'speed :default 61440.0))) @@ -1050,15 +877,7 @@ (s5-4 (- (darkecobarrel-base-time) (the-as time-frame (- s5-3 (-> obj spawn-array (-> obj cur-spawn)))))) ) (until (darkecobarrel-base-done? (darkecobarrel-base-pos s5-4)) - (let ((s3-0 (get-process *default-dead-pool* darkecobarrel-mover #x4000))) - (when s3-0 - (let ((t9-14 (method-of-type darkecobarrel-mover activate))) - (t9-14 (the-as darkecobarrel-mover s3-0) obj 'darkecobarrel-mover (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 darkecobarrel-mover-init-by-other (-> obj entity) (-> obj speed) s5-4 (-> obj sync)) - (-> s3-0 ppointer) - ) - ) + (process-spawn darkecobarrel-mover (-> obj entity) (-> obj speed) s5-4 (-> obj sync) :to obj) (set! s5-4 (- s5-4 (the-as time-frame (-> obj spawn-array s4-0)))) (+! s4-0 -1) (if (< s4-0 0) @@ -1094,58 +913,24 @@ ) ;; failed to figure out what this is: -(defskelgroup *lavafallsewera-sg* lavafallsewera - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -15 0 -5 185) - :longest-edge (meters 0) - ) +(defskelgroup *lavafallsewera-sg* lavafallsewera lavafallsewera-lod0-jg lavafallsewera-idle-ja + ((lavafallsewera-lod0-mg (meters 999999))) + :bounds (static-spherem -15 0 -5 185) + ) ;; failed to figure out what this is: (defstate lavafallsewera-idle (lavafallsewera) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior lavafallsewera) ja-post) + :post (the-as (function none :behavior lavafallsewera) ja-post) ) ;; definition for method 11 of type lavafallsewera @@ -1179,58 +964,24 @@ ) ;; failed to figure out what this is: -(defskelgroup *lavafallsewerb-sg* lavafallsewerb - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 120) - :longest-edge (meters 0) - ) +(defskelgroup *lavafallsewerb-sg* lavafallsewerb lavafallsewerb-lod0-jg lavafallsewerb-idle-ja + ((lavafallsewerb-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 120) + ) ;; failed to figure out what this is: (defstate lavafallsewerb-idle (lavafallsewerb) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior lavafallsewerb) ja-post) + :post (the-as (function none :behavior lavafallsewerb) ja-post) ) ;; definition for method 11 of type lavafallsewerb @@ -1270,8 +1021,7 @@ :id 542 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2132 :period 600 :length 5) + :parts ((sp-item 2132 :period 600 :length 5) (sp-item 2133 :period 600 :length 40) (sp-item 2134 :period 600 :length 20) (sp-item 2135 :period 600 :length 20) @@ -1280,8 +1030,7 @@ ;; failed to figure out what this is: (defpart 2133 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -1309,14 +1058,12 @@ ;; failed to figure out what this is: (defpart 2136 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2135 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 0.4)) @@ -1337,8 +1084,7 @@ ;; failed to figure out what this is: (defpart 2132 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 32)) @@ -1355,8 +1101,7 @@ ;; failed to figure out what this is: (defpart 2134 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1384,8 +1129,7 @@ ;; failed to figure out what this is: (defpart 2137 - :init-specs - ((sp-flt spt-fade-r -1.0666667) + :init-specs ((sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g -1.0666667) (sp-flt spt-fade-b -2.1166666) (sp-int spt-next-time 60) @@ -1395,8 +1139,7 @@ ;; failed to figure out what this is: (defpart 2138 - :init-specs - ((sp-flt spt-fade-r -0.5688889) + :init-specs ((sp-flt spt-fade-r -0.5688889) (sp-flt spt-fade-g -0.28444445) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334) @@ -1407,39 +1150,37 @@ ;; failed to figure out what this is: (defpart 2139 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: -(defskelgroup *chainmine-sg* chainmine - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -10.75 0 12.75) - :longest-edge (meters 2.4) - ) +(defskelgroup *chainmine-sg* chainmine chainmine-lod0-jg chainmine-idle-ja + ((chainmine-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10.75 0 12.75) + :longest-edge (meters 2.4) + ) ;; failed to figure out what this is: (defstate die (chainmine) :virtual #t - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root-override trans quad)) (set! (-> gp-1 y) (+ -73728.0 (-> gp-1 y))) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 542) 600 #f #f #f gp-1) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 542) + 600 + #f + #f + #f + gp-1 + :to *entity-pool* ) ) (suspend) @@ -1456,70 +1197,28 @@ ;; failed to figure out what this is: (defstate idle (chainmine) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack 'touch) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((a2-2 (new 'static 'attack-info :mask #x20))) - (set! (-> a2-2 mode) 'deadly) - (set! (-> a1-3 param 1) (the-as uint a2-2)) - ) - (send-event-function arg0 a1-3) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'deadly)))) (go-virtual die) ) ) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (nonzero? (-> self sound)) (update! (-> self sound)) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior chainmine) ja-post) + :post (the-as (function none :behavior chainmine) ja-post) ) ;; definition for method 11 of type chainmine @@ -1547,32 +1246,18 @@ ) (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *chainmine-sg* '()) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "lava-mine-chain") - :volume #x400 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "lava-mine-chain" :fo-max 30) (-> obj root-override trans)) ) (go (method-of-object obj idle)) (none) ) ;; failed to figure out what this is: -(defskelgroup *lavaballoon-sg* lavaballoon - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0.8 0 3.8) - :longest-edge (meters 0) - ) +(defskelgroup *lavaballoon-sg* lavaballoon lavaballoon-lod0-jg lavaballoon-idle-ja + ((lavaballoon-lod0-mg (meters 20)) (lavaballoon-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0.8 0 3.8) + ) ;; definition of type lavaballoon (deftype lavaballoon (process-drawable) @@ -1603,14 +1288,12 @@ :id 543 :duration 5 :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 1987) (sp-item 1988) (sp-item 1989)) + :parts ((sp-item 1987) (sp-item 1988) (sp-item 1989)) ) ;; failed to figure out what this is: (defpart 1988 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 2) 1.0) @@ -1631,8 +1314,7 @@ ;; failed to figure out what this is: (defpart 1989 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-y (meters 2)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) @@ -1656,8 +1338,7 @@ ;; failed to figure out what this is: (defpart 1987 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 12)) @@ -1676,29 +1357,21 @@ ;; failed to figure out what this is: (defstate die (lavaballoon) :virtual #t - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "cool-balloon") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 543) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (sound-play "cool-balloon") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 543) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (suspend) (cleanup-for-death self) @@ -1710,8 +1383,7 @@ ;; failed to figure out what this is: (defstate idle (lavaballoon) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (send-event arg0 'heat -10.0) @@ -1719,8 +1391,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (zero? (logand (-> self path flags) (path-control-flag not-found))) (let ((f0-4 (* 0.5 (+ 1.0 (sin (* (-> self move-per-tick) (the float (-> *display* base-frame-counter)))))))) (eval-path-curve! (-> self path) (-> self root-override trans) f0-4 'interp) @@ -1728,48 +1399,17 @@ ) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior lavaballoon) transform-post) + :post (the-as (function none :behavior lavaballoon) transform-post) ) ;; definition for method 11 of type lavaballoon @@ -1823,8 +1463,7 @@ (define ripple-for-lavatube-lava (new 'static 'ripple-wave-set :count 2 :converted #f - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 2 :speed 3.0) (new 'static 'ripple-wave :scale 40.0 :xdiv -2 :zdiv 2 :speed 1.8) (new 'static 'ripple-wave) @@ -1836,8 +1475,7 @@ ;; failed to figure out what this is: (defstate water-vol-idle (lavatube-lava) :virtual #t - :post - (behavior () + :post (behavior () (let ((t9-0 (-> (method-of-type water-anim water-vol-idle) post))) (if t9-0 ((the-as (function none :behavior lavatube-lava) t9-0)) @@ -1859,8 +1497,8 @@ (set! (-> v1-2 global-scale) 2048.0) (set! (-> v1-2 waveform) ripple-for-lavatube-lava) ) - (set! (-> obj flags) (logand -8388609 (-> obj flags))) - (set! (-> obj flags) (logior #x2000000 (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt23)) + (set! (-> obj flags) (logior (water-flags wt25) (-> obj flags))) (set! (-> obj attack-event) 'heat) (none) ) @@ -1886,58 +1524,24 @@ ) ;; failed to figure out what this is: -(defskelgroup *lavayellowtarp-sg* lavayellowtarp - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *lavayellowtarp-sg* lavayellowtarp lavayellowtarp-lod0-jg lavayellowtarp-idle-ja + ((lavayellowtarp-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) ;; failed to figure out what this is: (defstate lavayellowtarp-idle (lavayellowtarp) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior lavayellowtarp) ja-post) + :post (the-as (function none :behavior lavayellowtarp) ja-post) ) ;; definition for method 11 of type lavayellowtarp diff --git a/test/decompiler/reference/levels/lavatube/lavatube-part_REF.gc b/test/decompiler/reference/levels/lavatube/lavatube-part_REF.gc index 1aecbb608e..13e47c5acb 100644 --- a/test/decompiler/reference/levels/lavatube/lavatube-part_REF.gc +++ b/test/decompiler/reference/levels/lavatube/lavatube-part_REF.gc @@ -22,22 +22,19 @@ (defpartgroup group-lavatube-crust-20x20 :id 616 :bounds (static-bspherem 0 0 0 14) - :parts - ((sp-item 2489 :fade-after (meters 140) :falloff-to (meters 140))) + :parts ((sp-item 2489 :fade-after (meters 140) :falloff-to (meters 140))) ) ;; failed to figure out what this is: (defpartgroup group-lavatube-lowlava-20x20 :id 617 :bounds (static-bspherem 0 12 0 48) - :parts - ((sp-item 2490 :fade-after (meters 190) :falloff-to (meters 190))) + :parts ((sp-item 2490 :fade-after (meters 190) :falloff-to (meters 190))) ) ;; failed to figure out what this is: (defpart 2490 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 3)) @@ -64,14 +61,12 @@ ;; failed to figure out what this is: (defpart 2491 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 2492)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 2492)) ) ;; failed to figure out what this is: (defpart 2492 - :init-specs - ((sp-flt spt-fade-r -1.28) + :init-specs ((sp-flt spt-fade-r -1.28) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.42666668) (sp-int spt-next-time 150) @@ -81,14 +76,12 @@ ;; failed to figure out what this is: (defpart 2493 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.035555556)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.035555556)) ) ;; failed to figure out what this is: (defpart 2489 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0)) @@ -115,14 +108,12 @@ ;; failed to figure out what this is: (defpart 2494 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 2496)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 2496)) ) ;; failed to figure out what this is: (defpart 2496 - :init-specs - ((sp-flt spt-fade-r -0.85333335) + :init-specs ((sp-flt spt-fade-r -0.85333335) (sp-flt spt-fade-g -0.42666668) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2497) @@ -131,30 +122,26 @@ ;; failed to figure out what this is: (defpart 2497 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a -0.026666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a -0.026666667)) ) ;; failed to figure out what this is: (defpartgroup group-lavatube-crust-40x40 :id 629 :bounds (static-bspherem 0 0 0 32) - :parts - ((sp-item 2529 :fade-after (meters 180) :falloff-to (meters 180))) + :parts ((sp-item 2529 :fade-after (meters 180) :falloff-to (meters 180))) ) ;; failed to figure out what this is: (defpartgroup group-lavatube-lowlava-40x40 :id 630 :bounds (static-bspherem 0 12 0 32) - :parts - ((sp-item 2530 :fade-after (meters 200) :falloff-to (meters 200))) + :parts ((sp-item 2530 :fade-after (meters 200) :falloff-to (meters 200))) ) ;; failed to figure out what this is: (defpart 2530 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters 3)) @@ -181,8 +168,7 @@ ;; failed to figure out what this is: (defpart 2529 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters 0)) @@ -211,8 +197,7 @@ (defpartgroup group-lavatube-green-smoke-down-1 :id 621 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) + :parts ((sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) (sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 770 :length 96) (sp-item 2516 :fade-after (meters 140) :falloff-to (meters 160) :period 936 :length 60) (sp-item 2517 :fade-after (meters 100) :falloff-to (meters 100)) @@ -223,8 +208,7 @@ (defpartgroup group-lavatube-green-smoke-down-2 :id 622 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 1536 :length 75) + :parts ((sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 1536 :length 75) (sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 596 :length 96) (sp-item 2516 :fade-after (meters 140) :falloff-to (meters 160) :period 1070 :length 60) (sp-item 2517 :fade-after (meters 100) :falloff-to (meters 100)) @@ -235,8 +219,7 @@ (defpartgroup group-lavatube-green-smoke-down-3 :id 623 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 1161 :length 75) + :parts ((sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 1161 :length 75) (sp-item 2516 :fade-after (meters 100) :falloff-to (meters 120) :period 869 :length 96) (sp-item 2516 :fade-after (meters 140) :falloff-to (meters 160) :period 1029 :length 60) (sp-item 2517 :fade-after (meters 100) :falloff-to (meters 100)) @@ -245,8 +228,7 @@ ;; failed to figure out what this is: (defpart 2517 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-rnd-flt spt-x (meters 0) (meters 3) 1.0) (sp-flt spt-y (meters -1)) @@ -275,23 +257,14 @@ ;; failed to figure out what this is: (defpart 2518 - :init-specs - ((sp-flt spt-fade-a -0.47407407)) + :init-specs ((sp-flt spt-fade-a -0.47407407)) ) ;; failed to figure out what this is: (defpart 2516 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.7 0.6 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "steam-release") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "steam-release" :num 0.05 :volume 100.0)) (sp-rnd-flt spt-x (meters 0) (meters 3) 1.0) (sp-flt spt-y (meters -1)) (sp-rnd-flt spt-scale-x (meters 6) (meters 4) 1.0) @@ -323,8 +296,7 @@ (defpartgroup group-lavatube-green-smoke-angle-1 :id 624 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 1050 :length 75) + :parts ((sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 1050 :length 75) (sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 886 :length 96) (sp-item 2519 :fade-after (meters 140) :falloff-to (meters 160) :period 1276 :length 60) (sp-item 2520 :fade-after (meters 100) :falloff-to (meters 100)) @@ -335,8 +307,7 @@ (defpartgroup group-lavatube-green-smoke-angle-2 :id 625 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 1830 :length 75) + :parts ((sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 1830 :length 75) (sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 970 :length 96) (sp-item 2519 :fade-after (meters 140) :falloff-to (meters 160) :period 1102 :length 60) (sp-item 2520 :fade-after (meters 100) :falloff-to (meters 100)) @@ -347,8 +318,7 @@ (defpartgroup group-lavatube-green-smoke-angle-3 :id 626 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 1530 :length 75) + :parts ((sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 1530 :length 75) (sp-item 2519 :fade-after (meters 100) :falloff-to (meters 120) :period 1189 :length 96) (sp-item 2519 :fade-after (meters 140) :falloff-to (meters 160) :period 862 :length 60) (sp-item 2520 :fade-after (meters 100) :falloff-to (meters 100)) @@ -357,8 +327,7 @@ ;; failed to figure out what this is: (defpart 2520 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.5 1.0) (sp-rnd-flt spt-scale-x (meters 5) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -385,17 +354,9 @@ ;; failed to figure out what this is: (defpart 2519 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.4 0.3 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "steam-release") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "steam-release" :num 0.05 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 6) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -424,16 +385,14 @@ (defpartgroup group-lavatube-fountain :id 627 :bounds (static-bspherem 0 -10 0 12) - :parts - ((sp-item 2521 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 2521 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 2522 :fade-after (meters 100) :falloff-to (meters 100)) ) ) ;; failed to figure out what this is: (defpart 2522 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-y (meters -0.75) (meters 0.25) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -458,8 +417,7 @@ ;; failed to figure out what this is: (defpart 2521 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.1 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -485,8 +443,7 @@ ;; failed to figure out what this is: (defpart 2523 - :init-specs - ((sp-flt spt-fade-r -0.64) + :init-specs ((sp-flt spt-fade-r -0.64) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.21333334) (sp-flt spt-fade-a -0.08) @@ -497,22 +454,19 @@ ;; failed to figure out what this is: (defpart 2524 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: (defpartgroup group-lavatube-vents :id 628 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2525 :fade-after (meters 160) :falloff-to (meters 160))) + :parts ((sp-item 2525 :fade-after (meters 160) :falloff-to (meters 160))) ) ;; failed to figure out what this is: (defpart 2525 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.3 1.0) (sp-flt spt-y (meters -1)) (sp-rnd-flt spt-scale-x (meters 8) (meters 6) 1.0) @@ -539,8 +493,7 @@ ;; failed to figure out what this is: (defpart 2526 - :init-specs - ((sp-flt spt-fade-r -1.28) + :init-specs ((sp-flt spt-fade-r -1.28) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.42666668) (sp-flt spt-fade-a -0.10666667) @@ -551,22 +504,19 @@ ;; failed to figure out what this is: (defpart 2527 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: (defpartgroup group-lavatube-heavy-smoke :id 631 :bounds (static-bspherem 0 10 0 22) - :parts - ((sp-item 2531 :fade-after (meters 140) :falloff-to (meters 140))) + :parts ((sp-item 2531 :fade-after (meters 140) :falloff-to (meters 140))) ) ;; failed to figure out what this is: (defpart 2531 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 0.4 1.0) (sp-rnd-flt spt-x (meters -16) (meters 32) 1.0) (sp-rnd-flt spt-z (meters -16) (meters 32) 1.0) @@ -592,8 +542,7 @@ ;; failed to figure out what this is: (defpart 2532 - :init-specs - ((sp-flt spt-fade-r -0.64) + :init-specs ((sp-flt spt-fade-r -0.64) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.21333334) (sp-flt spt-fade-a -0.08) @@ -604,24 +553,21 @@ ;; failed to figure out what this is: (defpart 2533 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: (defpartgroup group-lavatube-heavy-smoke-start :id 632 :bounds (static-bspherem 0 10 0 22) - :parts - ((sp-item 2534 :fade-after (meters 140) :falloff-to (meters 140)) + :parts ((sp-item 2534 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 2535 :fade-after (meters 200) :falloff-to (meters 200)) ) ) ;; failed to figure out what this is: (defpart 2534 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 5.0 1.0) (sp-rnd-flt spt-x (meters -14) (meters 28) 1.0) (sp-rnd-flt spt-y (meters 8) (meters 8) 1.0) @@ -647,8 +593,7 @@ ;; failed to figure out what this is: (defpart 2535 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.4 0.8 1.0) (sp-rnd-flt spt-x (meters -16) (meters 32) 1.0) (sp-rnd-flt spt-y (meters -14) (meters 30) 1.0) @@ -677,16 +622,14 @@ (defpartgroup group-lavatube-heavy-smoke-end :id 633 :bounds (static-bspherem 0 10 0 22) - :parts - ((sp-item 2536 :fade-after (meters 140) :falloff-to (meters 140)) + :parts ((sp-item 2536 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 2537 :fade-after (meters 200) :falloff-to (meters 200)) ) ) ;; failed to figure out what this is: (defpart 2536 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 3.0 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 8) 1.0) @@ -712,8 +655,7 @@ ;; failed to figure out what this is: (defpart 2537 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.4 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-rnd-flt spt-y (meters -22) (meters 30) 1.0) diff --git a/test/decompiler/reference/levels/maincave/baby-spider_REF.gc b/test/decompiler/reference/levels/maincave/baby-spider_REF.gc index c4a5d034a1..70bd01b4f5 100644 --- a/test/decompiler/reference/levels/maincave/baby-spider_REF.gc +++ b/test/decompiler/reference/levels/maincave/baby-spider_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/baby-spider-ag.gc") + ;; definition of type baby-spider-spawn-params (deftype baby-spider-spawn-params (structure) ((hatched? symbol :offset-assert 0) @@ -89,14 +91,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *baby-spider-sg* baby-spider - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 2.25) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *baby-spider-sg* baby-spider baby-spider-lod0-jg -1 + ((baby-spider-lod0-mg (meters 20)) (baby-spider-lod1-mg (meters 40)) (baby-spider-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 2.25) + :shadow baby-spider-shadow-mg + ) ;; definition for symbol *baby-spider-nav-enemy-info*, type nav-enemy-info (define *baby-spider-nav-enemy-info* (new 'static 'nav-enemy-info @@ -114,11 +113,11 @@ :run-travel-speed (meters 7) :run-rotate-speed (degrees 7999.9995) :run-acceleration (meters 1) - :run-turn-time (seconds 0.07333333) + :run-turn-time (seconds 0.075) :walk-travel-speed (meters 2) :walk-rotate-speed (degrees 7999.9995) :walk-acceleration (meters 1) - :walk-turn-time (seconds 0.07333333) + :walk-turn-time (seconds 0.075) :attack-shove-back (meters 3) :attack-shove-up (meters 2) :shadow-size (meters 1) @@ -146,7 +145,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -168,11 +167,11 @@ :run-travel-speed (meters 7) :run-rotate-speed (degrees 7999.9995) :run-acceleration (meters 1) - :run-turn-time (seconds 0.07333333) + :run-turn-time (seconds 0.075) :walk-travel-speed (meters 2) :walk-rotate-speed (degrees 7999.9995) :walk-acceleration (meters 1) - :walk-turn-time (seconds 0.07333333) + :walk-turn-time (seconds 0.075) :attack-shove-back (meters 3) :attack-shove-up (meters 2) :shadow-size (meters 1) @@ -200,7 +199,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -267,7 +266,7 @@ baby-spider-default-event-handler ;; definition for method 39 of type baby-spider ;; Used lq/sq (defmethod common-post baby-spider ((obj baby-spider)) - (when (logtest? (-> obj collide-info status) 1) + (when (logtest? (-> obj collide-info status) (cshape-moving-flags onsurf)) (vector-deg-seek (-> obj up-vector) (-> obj up-vector) (-> obj collide-info surface-normal) 910.2222) (vector-normalize! (-> obj up-vector) 1.0) ) @@ -352,44 +351,27 @@ baby-spider-default-event-handler ;; failed to figure out what this is: (defstate baby-spider-hatching (baby-spider) - :event - baby-spider-default-event-handler - :code - (behavior () + :event baby-spider-default-event-handler + :code (behavior () (ja-channel-push! 1 0) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! baby-spider-birth-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (dummy-53 self) (go baby-spider-die-fast) ) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go baby-spider-resume) (none) ) - :post - (the-as (function none :behavior baby-spider) nav-enemy-simple-post) + :post (the-as (function none :behavior baby-spider) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate baby-spider-resume (baby-spider) - :event - baby-spider-default-event-handler - :code - (behavior () + :event baby-spider-default-event-handler + :code (behavior () (cond ((not *target*) (go-virtual nav-enemy-idle) @@ -416,10 +398,8 @@ baby-spider-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-idle (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :enter - (behavior () + :event baby-spider-default-event-handler + :enter (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self collide-info trans quad)) (let ((t9-0 (-> (method-of-type nav-enemy nav-enemy-idle) enter))) @@ -433,8 +413,7 @@ baby-spider-default-event-handler ) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -445,8 +424,7 @@ baby-spider-default-event-handler ) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (none) ) @@ -455,10 +433,8 @@ baby-spider-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-patrol (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -469,34 +445,16 @@ baby-spider-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-1 param 1) f30-0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) f30-0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -507,10 +465,8 @@ baby-spider-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-notice (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -521,36 +477,16 @@ baby-spider-default-event-handler ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 51) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.17)) + (ja-no-eval :group! baby-spider-notice-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :num! (seek!)) (go-virtual nav-enemy-chase) (none) ) @@ -559,10 +495,8 @@ baby-spider-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-chase (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -576,36 +510,24 @@ baby-spider-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self target-nav-time) (-> *display* base-frame-counter)) (set! (-> self wiggle-time) (+ (-> *display* base-frame-counter) (seconds -10))) (set! (-> self wiggle-angle) 0.0) (set! (-> self chase-rest-time) (rand-vu-int-range (seconds 1) (seconds 4))) - (ja-channel-push! 1 51) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 7)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (ja-channel-push! 1 (seconds 0.17)) + (ja :group! baby-spider-run-ja :num! min) + (loop (when (>= (- (-> *display* base-frame-counter) (-> self wiggle-time)) (seconds 1)) (set! (-> self wiggle-time) (-> *display* base-frame-counter)) (dummy-51 self) ) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (behavior () + :post (behavior () (dummy-52 self (target-pos 0)) (nav-enemy-travel-post) (none) @@ -615,10 +537,8 @@ baby-spider-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-stop-chase (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -629,17 +549,14 @@ baby-spider-default-event-handler ) (none) ) - :code - (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) + :code (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) ) ;; failed to figure out what this is: (defstate nav-enemy-stare (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -650,44 +567,25 @@ baby-spider-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 1456355.5) - (set! (-> self turn-time) (seconds 0.07333333)) + (set! (-> self turn-time) (seconds 0.075)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) - (while #t - (logior! (-> self nav-enemy-flags) 16) - (ja-channel-push! 1 30) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (loop + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! baby-spider-celebrate-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (ja-no-eval :num! (loop!)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((gp-0 (rand-vu-int-range 300 600)) (s5-0 (-> *display* base-frame-counter)) ) (until (>= (- (-> *display* base-frame-counter) s5-0) gp-0) - (let ((v1-33 (-> self skel root-channel 0))) - (set! (-> v1-33 num-func) num-func-identity) - (set! (-> v1-33 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (ja-blend-eval) (suspend) (suspend) @@ -702,10 +600,8 @@ baby-spider-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-give-up (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -716,37 +612,16 @@ baby-spider-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! baby-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! baby-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek-to-point-toward-point! (-> self collide-info) @@ -755,11 +630,7 @@ baby-spider-default-event-handler (-> self turn-time) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) (none) @@ -769,10 +640,8 @@ baby-spider-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-attack (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -783,25 +652,12 @@ baby-spider-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! baby-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-victory) (none) @@ -811,10 +667,8 @@ baby-spider-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-victory (baby-spider) :virtual #t - :event - baby-spider-default-event-handler - :trans - (behavior () + :event baby-spider-default-event-handler + :trans (behavior () (if (dummy-53 self) (go baby-spider-die-fast) ) @@ -825,20 +679,17 @@ baby-spider-default-event-handler ) (none) ) - :code - (-> (method-of-type nav-enemy nav-enemy-victory) code) + :code (-> (method-of-type nav-enemy nav-enemy-victory) code) ) ;; failed to figure out what this is: (defstate nav-enemy-die (baby-spider) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior baby-spider) process-drawable-death-event-handler ) - :enter - (behavior () + :enter (behavior () (let ((v1-0 (-> self event-death))) (if v1-0 (send-event (ppointer->process (-> self parent)) v1-0) @@ -857,10 +708,8 @@ baby-spider-default-event-handler ;; failed to figure out what this is: (defstate baby-spider-die-fast (baby-spider) - :event - baby-spider-default-event-handler - :code - (behavior () + :event baby-spider-default-event-handler + :code (behavior () (cleanup-for-death self) (let ((v1-2 (-> self event-death))) (if v1-2 @@ -907,7 +756,7 @@ baby-spider-default-event-handler (TODO-RENAME-45 obj *baby-spider-nav-enemy-info*) ) (let ((v1-11 (-> obj draw shadow-ctrl settings))) - (set! (-> v1-11 flags) (logand -9 (-> v1-11 flags))) + (logclear! (-> v1-11 flags) (shadow-flags shdf03)) (set! (-> v1-11 fade-dist) 98304.0) ) (vector-float*! (-> obj collide-info scale) *identity-vector* 0.63) @@ -976,7 +825,7 @@ baby-spider-default-event-handler (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) (logior! (-> obj mask) (process-mask actor-pause)) (set! (-> obj nav) (new 'process 'nav-control (-> obj collide-info) 24 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (create-connection! diff --git a/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc b/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc index f83b223ed9..73f5c78e8e 100644 --- a/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc +++ b/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/dark-crystal-ag.gc") + ;; definition of type dark-crystal (deftype dark-crystal (process-drawable) ((root-override collide-shape :offset 112) @@ -44,40 +46,26 @@ ) ;; failed to figure out what this is: -(defskelgroup *dark-crystal-sg* dark-crystal - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 3.4 0 3.8) - :longest-edge (meters 0) - ) +(defskelgroup *dark-crystal-sg* dark-crystal dark-crystal-lod0-jg -1 + ((dark-crystal-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3.4 0 3.8) + ) ;; failed to figure out what this is: -(defskelgroup *dark-crystal-explode-sg* dark-crystal - 3 - -1 - ((4 (meters 999999))) - :bounds (static-spherem 0 -15 0 50) - :longest-edge (meters 0) - ) +(defskelgroup *dark-crystal-explode-sg* dark-crystal dark-crystal-explode-lod0-jg -1 + ((dark-crystal-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -15 0 50) + ) ;; definition for symbol *dark-crystal-flash-delays*, type (array int32) -(define - *dark-crystal-flash-delays* - (the-as (array int32) - (new 'static 'boxed-array :type int32 :length 9 :allocated-length 9 #xb4 #x96 #x78 90 60 30 15 7 3) - ) +(define *dark-crystal-flash-delays* + (the-as (array int32) (new 'static 'boxed-array :type int32 #xb4 #x96 #x78 90 60 30 15 7 3)) ) ;; definition for symbol *dark-crystal-exploder-params*, type joint-exploder-static-params -(define - *dark-crystal-exploder-params* +(define *dark-crystal-exploder-params* (new 'static 'joint-exploder-static-params - :joints - (new - 'static - 'boxed-array - :type joint-exploder-static-joint-params :length 15 :allocated-length 15 + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) @@ -103,8 +91,7 @@ :duration 75 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 2153 :fade-after (meters 100) :period 600 :length 5 :binding 296) + :parts ((sp-item 2153 :fade-after (meters 100) :period 600 :length 5 :binding 296) (sp-item 296 :flags (start-dead launch-asap) :binding 297) (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) (sp-item 296 :flags (start-dead launch-asap) :binding 297) @@ -178,8 +165,7 @@ ;; failed to figure out what this is: (defpart 2153 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 2) 1.0) @@ -199,8 +185,7 @@ ;; failed to figure out what this is: (defpart 2155 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 24.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -226,14 +211,12 @@ ;; failed to figure out what this is: (defpart 2158 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2157 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-flt spt-scale-x (meters 0.3)) @@ -252,8 +235,7 @@ ;; failed to figure out what this is: (defpart 2154 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 24)) @@ -270,8 +252,7 @@ ;; failed to figure out what this is: (defpart 2156 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -303,8 +284,7 @@ :linger-duration 12000 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 2159 :period 600 :length 5) + :parts ((sp-item 2159 :period 600 :length 5) (sp-item 2160 :period 600 :length 40) (sp-item 2161 :period 600 :length 20) (sp-item 2162 :period 600 :length 20) @@ -315,8 +295,7 @@ ;; failed to figure out what this is: (defpart 2160 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 24.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -343,8 +322,7 @@ ;; failed to figure out what this is: (defpart 2162 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-flt spt-scale-x (meters 0.3)) @@ -365,8 +343,7 @@ ;; failed to figure out what this is: (defpart 2159 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 24)) @@ -384,8 +361,7 @@ ;; failed to figure out what this is: (defpart 2161 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -415,8 +391,7 @@ ;; failed to figure out what this is: (defpart 2163 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 6) 1.0) @@ -441,14 +416,12 @@ ;; failed to figure out what this is: (defpart 2165 - :init-specs - ((sp-flt spt-fade-a 0.0)) + :init-specs ((sp-flt spt-fade-a 0.0)) ) ;; failed to figure out what this is: (defpart 2164 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 6) 1.0) @@ -473,8 +446,7 @@ ;; failed to figure out what this is: (defstate dark-crystal-idle (dark-crystal) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (if (= (-> arg0 type) target) @@ -491,9 +463,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -503,11 +474,10 @@ ;; failed to figure out what this is: (defstate dark-crystal-activate (dark-crystal) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (dotimes (gp-0 (-> *dark-crystal-flash-delays* length)) - (sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warning") (set! (-> self draw color-mult quad) (-> self lit-color-mult quad)) (set! (-> self draw color-emissive quad) (-> self lit-color-emissive quad)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -530,8 +500,7 @@ ;; failed to figure out what this is: (defstate dark-crystal-explode (dark-crystal) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) @@ -543,22 +512,7 @@ (set-vector! (-> gp-0 fountain-rand-transv-lo) -40960.0 20480.0 -40960.0 1.0) (set-vector! (-> gp-0 fountain-rand-transv-hi) 40960.0 49152.0 40960.0 1.0) ) - (let ((s5-0 (get-process *default-dead-pool* joint-exploder #x4000))) - (when s5-0 - (let ((t9-3 (method-of-type joint-exploder activate))) - (t9-3 (the-as joint-exploder s5-0) self 'joint-exploder (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - joint-exploder-init-by-other - *dark-crystal-explode-sg* - 5 - gp-0 - *dark-crystal-exploder-params* - ) - (-> s5-0 ppointer) - ) - ) + (process-spawn joint-exploder *dark-crystal-explode-sg* 5 gp-0 *dark-crystal-exploder-params* :to self) ) (activate! *camera-smush-control* 819.2 37 210 1.0 0.995) (let ((gp-1 (dummy-21 self))) @@ -568,29 +522,22 @@ (logior! (-> self draw status) (draw-status hidden)) (dummy-20 self) (if (-> self underwater?) - (sound-play-by-name (static-sound-name "water-explosion") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "crystal-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-explosion") + (sound-play "crystal-explode") ) - (let ((s5-3 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-3 - (let ((t9-15 (method-of-type part-tracker activate))) - (t9-15 (the-as part-tracker s5-3) *entity-pool* 'part-tracker (the-as pointer #x70004000)) + (process-spawn + part-tracker + :init part-tracker-init + (if (-> self underwater?) + (-> *part-group-id-table* 323) + (-> *part-group-id-table* 322) ) - (run-now-in-process - s5-3 - part-tracker-init - (if (-> self underwater?) - (-> *part-group-id-table* 323) - (-> *part-group-id-table* 322) - ) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> s5-3 ppointer) - ) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (let ((s5-4 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) s5-4) (seconds 0.25)) @@ -611,13 +558,11 @@ ;; failed to figure out what this is: (defstate dark-crystal-spawn-fuel-cell (dark-crystal) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior dark-crystal) process-drawable-fuel-cell-handler ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) (level-hint-spawn @@ -666,7 +611,16 @@ (when (>= (-> obj explode-danger-radius) (vector-vector-distance s5-0 s3-0)) (vector-! s4-0 s3-0 s5-0) (let ((t2-0 (new 'stack-no-clear 'collide-tri-result))) - (if (< (fill-and-probe-using-line-sphere *collide-cache* s5-0 s4-0 819.2 (collide-kind background) obj t2-0 1) + (if (< (fill-and-probe-using-line-sphere + *collide-cache* + s5-0 + s4-0 + 819.2 + (collide-kind background) + obj + t2-0 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (send-event *target* 'attack #f (new 'static 'attack-info)) diff --git a/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc b/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc index 6b923248c4..5f4cde9285 100644 --- a/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc +++ b/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/driller-lurker-ag.gc") + ;; definition of type driller-lurker (deftype driller-lurker (process-drawable) ((root-overeride collide-shape-moving :offset 112) @@ -88,23 +90,21 @@ ) ;; failed to figure out what this is: -(defskelgroup *driller-lurker-sg* driller-lurker - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1.5 0 7.75) - :longest-edge (meters 2.3) - :shadow 4 - ) +(defskelgroup *driller-lurker-sg* driller-lurker driller-lurker-lod0-jg -1 + ((driller-lurker-lod0-mg (meters 20)) + (driller-lurker-lod1-mg (meters 40)) + (driller-lurker-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 1.5 0 7.75) + :longest-edge (meters 2.3) + :shadow driller-lurker-shadow-mg + ) ;; definition for symbol *driller-lurker-shadow-control*, type shadow-control -(define - *driller-lurker-shadow-control* +(define *driller-lurker-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #x9)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 614400.0) + :flags (shadow-flags shdf00 shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) :bot-plane (new 'static 'plane :y 1.0 :w 4096.0) :top-plane (new 'static 'plane :y 1.0 :w -2048.0) :fade-dist 245760.0 @@ -117,8 +117,7 @@ :id 331 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 728 :fade-after (meters 80) :falloff-to (meters 80)) + :parts ((sp-item 728 :fade-after (meters 80) :falloff-to (meters 80)) (sp-item 2075 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 2076 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 2077 :fade-after (meters 40) :falloff-to (meters 40)) @@ -127,8 +126,7 @@ ;; failed to figure out what this is: (defpart 728 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -156,8 +154,7 @@ ;; failed to figure out what this is: (defpart 2075 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -185,8 +182,7 @@ ;; failed to figure out what this is: (defpart 2076 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -213,14 +209,12 @@ ;; failed to figure out what this is: (defpart 2078 - :init-specs - ((sp-flt spt-fade-a -1.7066667)) + :init-specs ((sp-flt spt-fade-a -1.7066667)) ) ;; failed to figure out what this is: (defpart 2077 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 8.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -295,25 +289,19 @@ ) (cond ((or s2-0 (not s3-0)) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'attack) - (set! (-> a1-6 param 0) (-> arg3 param 0)) - (let ((v1-34 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-34 shove-up) 8192.0) - (set! (-> v1-34 shove-back) 12288.0) - (set! (-> a1-6 param 1) (the-as uint v1-34)) - ) - (when (send-event-function arg0 a1-6) - (set! (-> self hit-player?) #t) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) - (set-collide-offense (-> self root-overeride) 2 (collide-offense no-offense)) - (let ((v1-39 (-> self mode))) - (if (or (zero? v1-39) (= v1-39 1) (= v1-39 2)) - (go driller-lurker-chase #t) - ) - ) + (when (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) + ) + (set! (-> self hit-player?) #t) + (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-collide-offense (-> self root-overeride) 2 (collide-offense no-offense)) + (let ((v1-39 (-> self mode))) + (if (or (zero? v1-39) (= v1-39 1) (= v1-39 2)) + (go driller-lurker-chase #t) + ) ) ) ) @@ -344,25 +332,19 @@ ) ((= arg2 'touch) (when (= (-> arg0 type) target) - (let ((a1-11 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-11 from) self) - (set! (-> a1-11 num-params) 2) - (set! (-> a1-11 message) 'attack) - (set! (-> a1-11 param 0) (-> arg3 param 0)) - (let ((v1-57 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-57 shove-up) 8192.0) - (set! (-> v1-57 shove-back) 12288.0) - (set! (-> a1-11 param 1) (the-as uint v1-57)) - ) - (when (send-event-function arg0 a1-11) - (set! (-> self hit-player?) #t) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) - (set-collide-offense (-> self root-overeride) 2 (collide-offense no-offense)) - (let ((v1-62 (-> self mode))) - (if (or (zero? v1-62) (= v1-62 1) (= v1-62 2)) - (go driller-lurker-chase #t) - ) - ) + (when (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) + ) + (set! (-> self hit-player?) #t) + (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-collide-offense (-> self root-overeride) 2 (collide-offense no-offense)) + (let ((v1-62 (-> self mode))) + (if (or (zero? v1-62) (= v1-62 1) (= v1-62 2)) + (go driller-lurker-chase #t) + ) ) ) ) @@ -555,9 +537,13 @@ ) ) (when (and (-> obj hit-player?) - (or (not *target*) (and (zero? (logand (-> *target* state-flags) #x80f8)) - (>= (- (-> *display* base-frame-counter) (-> obj hit-player-time)) (seconds 0.05)) + (or (not *target*) + (and (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) + ) + (>= (- (-> *display* base-frame-counter) (-> obj hit-player-time)) (seconds 0.05)) + ) ) ) (set-collide-offense (-> obj root-overeride) 2 (collide-offense touch)) @@ -679,121 +665,73 @@ ;; failed to figure out what this is: (defstate driller-lurker-debug-play-anims (driller-lurker) - :code - (behavior () + :code (behavior () 0 (none) ) - :post - (the-as (function none :behavior driller-lurker) transform-post) + :post (the-as (function none :behavior driller-lurker) transform-post) ) ;; failed to figure out what this is: (defstate driller-lurker-idle-drilling (driller-lurker) - :event - driller-lurker-default-event-handler - :enter - (behavior () + :event driller-lurker-default-event-handler + :enter (behavior () (set! (-> self mode) (the-as uint 1)) (set! (-> self targ-path-speed) 0.0) (set! (-> self path-speed) 0.0) (shut-down! (-> self neck)) (none) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound2)) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-25 self) (go driller-lurker-chase #t) ) (dummy-20 self #t (the-as target #f)) (none) ) - :code - (behavior () + :code (behavior () (update-trans! (-> self sound2) (-> self root-overeride trans)) - (while #t + (loop (set! (-> self timeout) (rand-vu-int-range 4 8)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (dotimes (gp-0 (-> self timeout)) (let ((f30-0 (rand-vu-float-range 1.0 1.8))) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 15)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) f30-0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!) - ) + (ja-no-eval :group! driller-lurker-idle-drilling-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (update! (-> self sound2)) (if (and (>= (ja-aframe-num 0) 7.0) (>= 13.0 (ja-aframe-num 0))) (dummy-27 self) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) f30-0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) (stop! (-> self sound2)) - (ja-channel-push! 1 60) - (cond - ((zero? (rand-vu-int-count 2)) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) - ) - (else - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 7)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.2)) + (if (zero? (rand-vu-int-count 2)) + (ja :group! driller-lurker-idle-look-left-ja :num! min) + (ja :group! driller-lurker-idle-look-right-ja :num! min) ) - ) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior driller-lurker) transform-post) + :post (the-as (function none :behavior driller-lurker) transform-post) ) ;; failed to figure out what this is: (defstate driller-lurker-patrol (driller-lurker) - :event - driller-lurker-default-event-handler - :enter - (behavior () + :event driller-lurker-default-event-handler + :enter (behavior () (set! (-> self mode) (the-as uint 2)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self timeout) (rand-vu-int-range 900 3600)) @@ -804,85 +742,55 @@ (shut-down! (-> self neck)) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-25 self) (go driller-lurker-chase #t) ) (dummy-20 self #t (the-as target #f)) (none) ) - :code - (behavior () - (ja-channel-push! 2 60) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 8)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-2 (-> self skel root-channel 1))) - (set! (-> a0-2 frame-interp) (-> self up-blend)) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-2 param 0) 0.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-chan) - ) - (while #t + :code (behavior () + (ja-channel-push! 2 (seconds 0.2)) + (ja :group! driller-lurker-walk-ja :num! min) + (ja :chan 1 :group! driller-lurker-walk-up-ja :num! (chan 0) :frame-interp (-> self up-blend)) + (loop (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) - (when (= (ja-group-size) 2) - (let ((a0-4 (-> self skel root-channel 1))) - (set! (-> a0-4 frame-interp) (-> self up-blend)) - (set! (-> a0-4 param 0) 0.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-chan) + (ja :num! (seek!)) + (if (= (ja-group-size) 2) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self up-blend)) ) - ) (when (ja-done? 0) (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self timeout)) (>= 546.13336 (fabs (deg- (-> self path-ry) (-> self facing-ry)))) ) (go driller-lurker-patrol-pause) ) - (let ((v1-34 (-> self skel root-channel 0))) - (set! (-> v1-34 num-func) num-func-identity) - (set! (-> v1-34 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) ) ) (none) ) - :post - (the-as (function none :behavior driller-lurker) transform-post) + :post (the-as (function none :behavior driller-lurker) transform-post) ) ;; failed to figure out what this is: (defstate driller-lurker-patrol-pause (driller-lurker) - :event - driller-lurker-default-event-handler - :enter - (behavior () + :event driller-lurker-default-event-handler + :enter (behavior () (set! (-> self mode) (the-as uint 2)) (set! (-> self path-speed) 0.0) (set! (-> self targ-path-speed) 0.0) (shut-down! (-> self neck)) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-25 self) (go driller-lurker-chase #t) ) (dummy-20 self #t (the-as target #f)) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self timeout) (rand-vu-int-range 2 4)) (let ((s5-0 -1)) (dotimes (gp-0 (-> self timeout)) @@ -893,89 +801,42 @@ (set! s5-0 v1-0) (cond ((zero? v1-0) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - ) - (ja-channel-push! 1 60) + (if (not (ja-group? driller-lurker-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) ) - (let ((s4-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> s4-0 frame-num) 0.0) - ) + (ja :group! driller-lurker-idle-ja :num! min) ) ((= v1-0 1) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 60) + (if (not (ja-group? driller-lurker-idle-look-left-ja)) + (ja-channel-push! 1 (seconds 0.2)) ) - (let ((s4-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-1 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> s4-1 frame-num) 0.0) - ) + (ja :group! driller-lurker-idle-look-left-ja :num! min) ) ((= v1-0 2) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - ) - (ja-channel-push! 1 60) + (if (not (ja-group? driller-lurker-idle-look-right-ja)) + (ja-channel-push! 1 (seconds 0.2)) ) - (let ((s4-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s4-2 - (the-as art-joint-anim (-> self draw art-group data 7)) - num-func-identity - ) - (set! (-> s4-2 frame-num) 0.0) - ) + (ja :group! driller-lurker-idle-look-right-ja :num! min) ) ) ) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1))) - (set! (-> a0-27 param 1) 1.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go driller-lurker-patrol) (none) ) - :post - (the-as (function none :behavior driller-lurker) transform-post) + :post (the-as (function none :behavior driller-lurker) transform-post) ) ;; failed to figure out what this is: (defstate driller-lurker-chase (driller-lurker) - :event - driller-lurker-default-event-handler - :enter - (behavior ((arg0 symbol)) + :event driller-lurker-default-event-handler + :enter (behavior ((arg0 symbol)) (if arg0 (set! (-> self started-chasing-time) (-> *display* base-frame-counter)) ) @@ -984,8 +845,7 @@ (set! (-> self targ-path-speed) 23552.0) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-24 self) (go driller-lurker-attack) ) @@ -1021,68 +881,36 @@ (dummy-20 self #f (the-as target #t)) (none) ) - :code - (behavior ((arg0 symbol)) - (ja-channel-push! 2 60) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 11)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-3 (-> self skel root-channel 1))) - (set! (-> a0-3 frame-interp) (-> self up-blend)) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-3 param 0) 0.0) - (joint-control-channel-group-eval! - a0-3 - (the-as art-joint-anim (-> self draw art-group data 12)) - num-func-chan - ) - ) - (while #t + :code (behavior ((arg0 symbol)) + (ja-channel-push! 2 (seconds 0.2)) + (ja :group! driller-lurker-run-ja :num! min) + (ja :chan 1 :group! driller-lurker-run-up-ja :num! (chan 0) :frame-interp (-> self up-blend)) + (loop (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) - (when (= (ja-group-size) 2) - (let ((a0-5 (-> self skel root-channel 1))) - (set! (-> a0-5 frame-interp) (-> self up-blend)) - (set! (-> a0-5 param 0) 0.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-chan) + (ja :num! (seek!)) + (if (= (ja-group-size) 2) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self up-blend)) ) - ) - (when (ja-done? 0) - (let ((v1-27 (-> self skel root-channel 0))) - (set! (-> v1-27 num-func) num-func-identity) - (set! (-> v1-27 frame-num) 0.0) + (if (ja-done? 0) + (ja :num-func num-func-identity :frame-num 0.0) ) - ) ) (none) ) - :post - (the-as (function none :behavior driller-lurker) transform-post) + :post (the-as (function none :behavior driller-lurker) transform-post) ) ;; failed to figure out what this is: (defstate driller-lurker-attack (driller-lurker) - :event - driller-lurker-default-event-handler - :enter - (behavior () + :event driller-lurker-default-event-handler + :enter (behavior () (set! (-> self mode) (the-as uint 4)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self path-speed) 0.0) (set! (-> self targ-path-speed) 0.0) (none) ) - :trans - (behavior () + :trans (behavior () (cond ((dummy-24 self) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1099,90 +927,45 @@ (dummy-20 self #f (the-as target #t)) (none) ) - :code - (behavior () - (ja-channel-push! 2 60) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 13)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-2 (-> self skel root-channel 1))) - (set! (-> a0-2 frame-interp) (-> self up-blend)) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 14))) - (set! (-> a0-2 param 0) 0.0) - (joint-control-channel-group-eval! - a0-2 - (the-as art-joint-anim (-> self draw art-group data 14)) - num-func-chan - ) - ) - (while #t + :code (behavior () + (ja-channel-push! 2 (seconds 0.2)) + (ja :group! driller-lurker-attack-ja :num! min) + (ja :chan 1 :group! driller-lurker-attack-up-ja :num! (chan 0) :frame-interp (-> self up-blend)) + (loop (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) - (when (= (ja-group-size) 2) - (let ((a0-4 (-> self skel root-channel 1))) - (set! (-> a0-4 frame-interp) (-> self up-blend)) - (set! (-> a0-4 param 0) 0.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-chan) + (ja :num! (seek!)) + (if (= (ja-group-size) 2) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self up-blend)) ) - ) - (when (ja-done? 0) - (let ((v1-27 (-> self skel root-channel 0))) - (set! (-> v1-27 num-func) num-func-identity) - (set! (-> v1-27 frame-num) 0.0) + (if (ja-done? 0) + (ja :num-func num-func-identity :frame-num 0.0) ) - ) ) (none) ) - :post - (the-as (function none :behavior driller-lurker) transform-post) + :post (the-as (function none :behavior driller-lurker) transform-post) ) ;; failed to figure out what this is: (defstate driller-lurker-jammed-standing (driller-lurker) - :event - driller-lurker-default-event-handler - :enter - (behavior () + :event driller-lurker-default-event-handler + :enter (behavior () (set! (-> self mode) (the-as uint 5)) (set! (-> self path-speed) 0.0) (set! (-> self targ-path-speed) 0.0) (shut-down! (-> self neck)) (none) ) - :trans - (behavior () + :trans (behavior () (dummy-20 self #f (the-as target #f)) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! driller-lurker-drill-jams-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self started-chasing-time) (-> *display* base-frame-counter)) (cond @@ -1197,39 +980,24 @@ ) (none) ) - :post - (the-as (function none :behavior driller-lurker) transform-post) + :post (the-as (function none :behavior driller-lurker) transform-post) ) ;; failed to figure out what this is: (defstate driller-lurker-die (driller-lurker) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior driller-lurker) process-drawable-death-event-handler ) - :code - (behavior () + :code (behavior () (shut-down! (-> self neck)) (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (clear-collide-with-as (-> self root-overeride)) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + (ja-no-eval :group! driller-lurker-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event self 'death-end) (while (-> self child) @@ -1238,8 +1006,7 @@ (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior driller-lurker) ja-post) + :post (the-as (function none :behavior driller-lurker) ja-post) ) ;; definition for method 7 of type driller-lurker @@ -1364,34 +1131,10 @@ ) (set! (-> obj draw shadow-ctrl) *driller-lurker-shadow-control*) (set! (-> obj sound) - (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "drill-idle") - :volume #x400 - :fo-max 40 - ) - (-> obj root-overeride trans) - ) + (new 'process 'ambient-sound (static-sound-spec "drill-idle" :fo-max 40) (-> obj root-overeride trans)) ) (set! (-> obj sound2) - (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "drill-idle2") - :volume #x400 - :fo-max 60 - ) - (-> obj root-overeride trans) - ) + (new 'process 'ambient-sound (static-sound-spec "drill-idle2" :fo-max 60) (-> obj root-overeride trans)) ) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 331) obj)) (let ((f0-34 (path-distance (-> obj path)))) @@ -1408,8 +1151,7 @@ arg0 'driller-lurker (pointer float) - :tag-ptr - (the-as (pointer res-tag) (new 'stack-no-clear 'vector)) + :tag-ptr (the-as (pointer res-tag) (new 'stack-no-clear 'vector)) ) ) ) diff --git a/test/decompiler/reference/levels/maincave/gnawer_REF.gc b/test/decompiler/reference/levels/maincave/gnawer_REF.gc index f3cb2e0684..a5575782de 100644 --- a/test/decompiler/reference/levels/maincave/gnawer_REF.gc +++ b/test/decompiler/reference/levels/maincave/gnawer_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/gnawer-ag.gc") + ;; definition of type gnawer-falling-segment (deftype gnawer-falling-segment (process-drawable) ((transv vector :inline :offset-assert 176) @@ -179,67 +181,53 @@ ) ;; failed to figure out what this is: -(defskelgroup *gnawer-sg* gnawer - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0.5 0 8) - :longest-edge (meters 0.8) - ) +(defskelgroup *gnawer-sg* gnawer gnawer-lod0-jg -1 + ((gnawer-lod0-mg (meters 20)) (gnawer-lod1-mg (meters 40)) (gnawer-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0.5 0 8) + :longest-edge (meters 0.8) + ) ;; failed to figure out what this is: -(defskelgroup *gnawer-segment-sg* gnawer - 14 - -1 - ((15 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *gnawer-segment-sg* gnawer gnawer-segment-lod0-jg -1 + ((gnawer-segment-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) ;; definition for symbol *gnawer-segment-infos*, type (inline-array gnawer-segment-info) -(define - *gnawer-segment-infos* +(define *gnawer-segment-infos* (new 'static 'inline-array gnawer-segment-info 10 (new 'static 'gnawer-segment-info :num-joints 8 - :joint-index - (new 'static 'array int8 8 4 #x1f #xd #x20 #x21 #x22 #x23 #x24) + :joint-index (new 'static 'array int8 8 4 #x1f #xd #x20 #x21 #x22 #x23 #x24) ) (new 'static 'gnawer-segment-info :num-joints 3 :joint-index (new 'static 'array int8 8 5 #xe #xf 0 0 0 0 0)) (new 'static 'gnawer-segment-info :num-joints 3 - :joint-index - (new 'static 'array int8 8 #x6 #x10 #x11 0 0 0 0 0) + :joint-index (new 'static 'array int8 8 #x6 #x10 #x11 0 0 0 0 0) ) (new 'static 'gnawer-segment-info :num-joints 3 - :joint-index - (new 'static 'array int8 8 #x7 #x12 #x13 0 0 0 0 0) + :joint-index (new 'static 'array int8 8 #x7 #x12 #x13 0 0 0 0 0) ) (new 'static 'gnawer-segment-info :num-joints 3 - :joint-index - (new 'static 'array int8 8 #x8 #x14 #x15 0 0 0 0 0) + :joint-index (new 'static 'array int8 8 #x8 #x14 #x15 0 0 0 0 0) ) (new 'static 'gnawer-segment-info :num-joints 3 - :joint-index - (new 'static 'array int8 8 #x9 #x16 #x17 0 0 0 0 0) + :joint-index (new 'static 'array int8 8 #x9 #x16 #x17 0 0 0 0 0) ) (new 'static 'gnawer-segment-info :num-joints 3 - :joint-index - (new 'static 'array int8 8 #xa #x18 #x19 0 0 0 0 0) + :joint-index (new 'static 'array int8 8 #xa #x18 #x19 0 0 0 0 0) ) (new 'static 'gnawer-segment-info :num-joints 3 - :joint-index - (new 'static 'array int8 8 #xb #x1a #x1b 0 0 0 0 0) + :joint-index (new 'static 'array int8 8 #xb #x1a #x1b 0 0 0 0 0) ) (new 'static 'gnawer-segment-info :num-joints 3 - :joint-index - (new 'static 'array int8 8 #xc #x1c #x1d 0 0 0 0 0) + :joint-index (new 'static 'array int8 8 #xc #x1c #x1d 0 0 0 0 0) ) (new 'static 'gnawer-segment-info :num-joints 1 :joint-index (new 'static 'array int8 8 #x1e 0 0 0 0 0 0 0)) ) @@ -250,8 +238,7 @@ :id 329 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 727 :binding 2309) + :parts ((sp-item 727 :binding 2309) (sp-item 2309 :flags (start-dead)) (sp-item 2309 :flags (start-dead)) (sp-item 2309 :flags (start-dead)) @@ -332,8 +319,7 @@ ;; failed to figure out what this is: (defpart 2310 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 16)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -350,8 +336,7 @@ ;; failed to figure out what this is: (defpart 727 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 16.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.25) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -375,8 +360,7 @@ ;; failed to figure out what this is: (defpart 2309 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) (sp-rnd-flt spt-num 0.25 0.5 1.0) (sp-rnd-flt spt-scale-x (meters 0.7) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -398,14 +382,12 @@ :id 330 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2141 :fade-after (meters 60) :falloff-to (meters 60))) + :parts ((sp-item 2141 :fade-after (meters 60) :falloff-to (meters 60))) ) ;; failed to figure out what this is: (defpart 2141 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.35) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -428,8 +410,7 @@ ;; failed to figure out what this is: (defstate falling (gnawer-falling-segment) :virtual #t - :trans - (behavior () + :trans (behavior () (+! (-> self transv y) (* -409600.0 (-> *display* seconds-per-frame))) (vector-v+! (-> self root trans) (-> self root trans) (-> self transv)) (+! (-> self facing-rot x) (* (-> self facing-rotv x) (-> *display* seconds-per-frame))) @@ -437,54 +418,28 @@ (deg-seek (-> self facing-rot z) 16384.0 (* (-> self facing-rotv z) (-> *display* seconds-per-frame))) ) (quaternion-zxy! (-> self root quat) (-> self facing-rot)) - (set! (-> self root scale x) (seek (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame)))) + (seek! (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame))) (set! (-> self root scale y) (-> self root scale x)) (set! (-> self root scale z) (-> self root scale x)) (none) ) - :code - (behavior () + :code (behavior () (ja-channel-push! 1 0) (dotimes (gp-0 1) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + (ja-no-eval :group! gnawer-segment-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!) - ) + (ja-no-eval :group! gnawer-segment-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (none) ) - :post - (the-as (function none :behavior gnawer-falling-segment) ja-post) + :post (the-as (function none :behavior gnawer-falling-segment) ja-post) ) ;; definition for function gnawer-falling-segment-init-by-other @@ -835,15 +790,7 @@ (vector-! s1-0 s2-0 (-> obj root-override trans)) (set! (-> s1-0 y) 0.0) (vector-normalize! s1-0 1.0) - (let ((s0-0 (get-process *default-dead-pool* gnawer-falling-segment #x4000))) - (when s0-0 - (let ((t9-2 (method-of-type gnawer-falling-segment activate))) - (t9-2 (the-as gnawer-falling-segment s0-0) obj 'gnawer-falling-segment (the-as pointer #x70004000)) - ) - (run-now-in-process s0-0 gnawer-falling-segment-init-by-other obj s2-0 s1-0) - (-> s0-0 ppointer) - ) - ) + (process-spawn gnawer-falling-segment obj s2-0 s1-0 :to obj) ) (set! (-> s3-0 place) -1) ) @@ -975,166 +922,78 @@ ;; failed to figure out what this is: (defstate gnawer-chewing-on-post (gnawer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (when (= (-> arg0 type) target) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'shove) - (set! (-> a1-4 param 0) (-> arg3 param 0)) - (let ((v1-6 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-6 shove-up) 6144.0) - (set! (-> v1-6 shove-back) 10240.0) - (set! (-> a1-4 param 1) (the-as uint v1-6)) + (if (= (-> arg0 type) target) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) ) - (send-event-function arg0 a1-4) ) - ) (go gnawer-retreat-into-post) ) (('attack) - (sound-play-by-name (static-sound-name "gnawer-dies") (new-sound-id) 1024 -381 0 1 #t) + (sound-play "gnawer-dies" :pitch -0.25) (go gnawer-retreat-into-post) ) ) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound2)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 81920.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) (go gnawer-retreat-into-post) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (cond - ((zero? (rand-vu-int-count 2)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 8)) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - ) - ) - (else - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 9)) - num-func-identity + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (if (zero? (rand-vu-int-count 2)) + (ja :group! gnawer-tear-side-to-side-ja + :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) + ) + (ja :group! gnawer-tug-ja + :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) ) - (set! (-> gp-1 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - ) ) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (let ((gp-2 (rand-vu-int-range 1 2)) (s4-0 (rand-vu-int-range 1 2)) ) (dotimes (s5-0 gp-2) (dotimes (s3-0 s4-0) (set! (-> self anim-speed) (rand-vu-float-range 0.8 1.0)) - (ja-channel-push! 1 22) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-13 param 1) (-> self anim-speed)) - (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! gnawer-tear-side-to-side-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (set! s4-0 (rand-vu-int-range 1 2)) (dotimes (s3-1 s4-0) (set! (-> self anim-speed) (rand-vu-float-range 0.8 1.0)) - (ja-channel-push! 1 22) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) (-> self anim-speed)) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! gnawer-tug-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) ) ) - (ja-channel-push! 1 22) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) 1.0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! gnawer-up-to-chew-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((gp-3 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-3 (-> self node-list data 34)) @@ -1145,25 +1004,13 @@ (spawn (-> self part2) gp-4) ) (suspend) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-5 (rand-vu-int-range 1 4))) (set! (-> self anim-speed) (rand-vu-float-range 0.8 1.0)) (dotimes (s5-1 gp-5) - (ja-channel-push! 1 22) - (let ((a0-33 (-> self skel root-channel 0))) - (set! (-> a0-33 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-33 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-33 param 1) (-> self anim-speed)) - (set! (-> a0-33 frame-num) 0.0) - (joint-control-channel-group! a0-33 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! gnawer-chew-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (let ((s4-1 (new 'stack-no-clear 'vector))) (vector<-cspace! s4-1 (-> self node-list data 34)) @@ -1175,79 +1022,46 @@ ) (update! (-> self sound2)) (suspend) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 param 0) (the float (+ (-> a0-39 frame-group data 0 length) -1))) - (set! (-> a0-39 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-39 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) ) (stop! (-> self sound2)) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> a0-42 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 13)) data 0 length) -1)) - ) - (set! (-> a0-42 param 1) 1.0) - (set! (-> a0-42 frame-num) 0.0) - (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + (ja-no-eval :group! gnawer-down-from-chew-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) (the float (+ (-> a0-43 frame-group data 0 length) -1))) - (set! (-> a0-43 param 1) 1.0) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior gnawer) transform-post) + :post (the-as (function none :behavior gnawer) transform-post) ) ;; failed to figure out what this is: (defstate gnawer-retreat-into-post (gnawer) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 22) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! gnawer-notice-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (quaternion-identity! (-> self root-override quat)) (go gnawer-wait-to-run) (none) ) - :post - (the-as (function none :behavior gnawer) transform-post) + :post (the-as (function none :behavior gnawer) transform-post) ) ;; failed to figure out what this is: (defstate gnawer-wait-to-run (gnawer) - :code - (behavior () + :code (behavior () (set! (-> self draw origin-joint-index) (the-as uint 0)) (dummy-23 self) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1263,40 +1077,27 @@ ;; failed to figure out what this is: (defstate gnawer-run (gnawer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('touch) - (when (= (-> arg0 type) target) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'shove) - (set! (-> a1-4 param 0) (-> arg3 param 0)) - (let ((v1-5 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-5 shove-up) 6144.0) - (set! (-> v1-5 shove-back) 10240.0) - (set! (-> a1-4 param 1) (the-as uint v1-5)) + (if (= (-> arg0 type) target) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) ) - (send-event-function arg0 a1-4) ) - ) ) (('attack) (cond ((= (-> arg0 type) target) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'attack) - (set! (-> a1-7 param 0) (-> arg3 param 0)) - (let ((v1-10 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-10 shove-up) 6144.0) - (set! (-> v1-10 shove-back) 10240.0) - (set! (-> a1-7 param 1) (the-as uint v1-10)) - ) - (send-event-function arg0 a1-7) + (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) ) ) (else @@ -1326,8 +1127,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self route-dist) 0.0) (dummy-24 self) @@ -1335,14 +1135,12 @@ (dummy-26 self) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (stop! (-> self sound)) (none) ) - :trans - (behavior () + :trans (behavior () (+! (-> self route-dist) (* (-> self speed) (-> *display* seconds-per-frame))) (if (dummy-22 self (-> self route-dist)) (go gnawer-wait-to-run) @@ -1350,76 +1148,40 @@ (update! (-> self sound)) (none) ) - :code - (behavior () + :code (behavior () (local-vars (v1-19 symbol) (v1-35 symbol)) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) - (while #t + (ja :group! gnawer-run-ja :num! min) + (ja-no-eval :num! (seek!)) + (loop (until v1-19 (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-19 (or (ja-done? 0) (-> self show-damage?))) ) (when (-> self show-damage?) (until (not (-> self show-damage?)) (set! (-> self show-damage?) #f) - (ja-channel-push! 1 30) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! gnawer-takes-hit-ja :num! min) (until v1-35 (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-35 (or (ja-done? 0) (-> self show-damage?))) ) ) - (ja-channel-push! 1 30) - ) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) + (ja-channel-push! 1 (seconds 0.1)) ) + (ja :group! gnawer-run-ja :num! min) ) (none) ) - :post - (the-as (function none :behavior gnawer) transform-post) + :post (the-as (function none :behavior gnawer) transform-post) ) ;; failed to figure out what this is: (defstate gnawer-die (gnawer) - :enter - (behavior () + :enter (behavior () (let ((v1-0 (-> self segments))) (set! (-> self fall-trans quad) (-> v1-0 0 world-pos quad)) (vector-! (-> self root-override transv) (-> v1-0 0 world-pos) (-> self post-trans)) @@ -1430,8 +1192,7 @@ (vector-normalize! (-> self root-override transv) 32768.0) (none) ) - :trans - (behavior () + :trans (behavior () (+! (-> self root-override transv y) (* -409600.0 (-> *display* seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self fall-trans quad)) @@ -1447,40 +1208,25 @@ (spool-push *art-control* "maincavecam-gnawer-fuel-cell" 0 self -1.0) (none) ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (clear-collide-with-as (-> self root-override)) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! gnawer-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go gnawer-dying-give-pickups) (none) ) - :post - (the-as (function none :behavior gnawer) ja-post) + :post (the-as (function none :behavior gnawer) ja-post) ) ;; failed to figure out what this is: (defstate gnawer-dying-give-pickups (gnawer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'notify) (if (and (= (-> arg0 type) money) (= (-> arg3 param 0) 'pickup)) @@ -1490,13 +1236,11 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "maincavecam-gnawer-fuel-cell" 0 self -1.0) (none) ) - :code - (behavior () + :code (behavior () (local-vars (sv-128 symbol)) (clear-collide-with-as (-> self root-override)) (set! (-> self skel postbind-function) #f) @@ -1554,8 +1298,7 @@ ;; failed to figure out what this is: (defstate gnawer-give-fuel-cell (gnawer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'notify) (cond @@ -1574,8 +1317,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (when (not (task-complete? *game-info* (-> self entity extra perm task))) (spool-push *art-control* "maincavecam-gnawer-fuel-cell" 0 self -1.0) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1611,7 +1353,7 @@ ) ) 0 - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") (until (not (-> self child)) (suspend) ) @@ -1625,8 +1367,7 @@ ;; failed to figure out what this is: (defstate gnawer-put-items-at-dest (gnawer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'notify) (if (and (= (-> arg0 type) money) (= (-> arg3 param 0) 'pickup)) @@ -1636,8 +1377,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self draw origin-joint-index) (the-as uint 0)) (clear-collide-with-as (-> self root-override)) (set! (-> self skel postbind-function) #f) @@ -1878,34 +1618,16 @@ ) ) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 329) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "gnawer-crawl") - :volume #x400 - :fo-min 30 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new + 'process + 'ambient-sound + (static-sound-spec "gnawer-crawl" :fo-min 30 :fo-max 30) + (-> obj root-override trans) + ) ) - (set! (-> obj sound2) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "gnawer-chew") - :volume #x400 - :fo-max 40 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound2) + (new 'process 'ambient-sound (static-sound-spec "gnawer-chew" :fo-max 40) (-> obj root-override trans)) ) (dotimes (v1-110 10) (let ((a0-59 (-> obj segments v1-110))) diff --git a/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc b/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc index b6d4a6cc74..a682c32741 100644 --- a/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc +++ b/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc @@ -1,6 +1,13 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/caveelevator-ag.gc") +(import "goal_src/import/cavespatulatwo-ag.gc") +(import "goal_src/import/cavetrapdoor-ag.gc") +(import "goal_src/import/maincavecam-ag.gc") +(import "goal_src/import/cavecrusher-ag.gc") +(import "goal_src/import/cavespatula-darkcave-ag.gc") + ;; definition of type maincavecam (deftype maincavecam (pov-camera) ((seq uint64 :offset-assert 224) @@ -21,13 +28,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *maincavecam-sg* maincavecam - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *maincavecam-sg* maincavecam maincavecam-lod0-jg -1 + ((maincavecam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) ;; definition for method 29 of type maincavecam (defmethod set-stack-size! maincavecam ((obj maincavecam)) @@ -38,23 +42,21 @@ ;; failed to figure out what this is: (defstate pov-camera-playing (maincavecam) :virtual #t - :code - (behavior () + :code (behavior () (cond ((zero? (-> self seq)) - (let* ((gp-0 (get-process *default-dead-pool* fuel-cell #x4000)) - (gp-1 - (ppointer->handle - (when gp-0 - (let ((t9-1 (method-of-type fuel-cell activate))) - (t9-1 (the-as fuel-cell gp-0) (ppointer->process (-> self parent)) 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 fuel-cell-init-as-clone (process->handle self) (-> self entity extra perm task)) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 + (ppointer->handle + (process-spawn + fuel-cell + :init fuel-cell-init-as-clone + (process->handle self) + (-> self entity extra perm task) + :to (ppointer->process (-> self parent)) + ) + ) + ) + ) (ja-play-spooled-anim (new 'static 'spool-anim :name "maincavecam-gnawer-fuel-cell" :index 3 :parts 1 :command-list '()) (the-as art-joint-anim #f) @@ -100,8 +102,7 @@ :count 3 :converted #f :normal-scale 1.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 40.0 :xdiv -1 :zdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75) @@ -153,18 +154,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *cavecrusher-sg* cavecrusher - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *cavecrusher-sg* cavecrusher cavecrusher-lod0-jg -1 + ((cavecrusher-lod0-mg (meters 20)) (cavecrusher-lod1-mg (meters 40)) (cavecrusher-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; failed to figure out what this is: (defstate cavecrusher-idle (cavecrusher) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) (when (= (-> arg0 type) target) @@ -181,32 +178,18 @@ ) ) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (update! (-> self sound)) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior cavecrusher) ja-post) + :post (the-as (function none :behavior cavecrusher) ja-post) ) ;; definition for method 11 of type cavecrusher @@ -228,19 +211,8 @@ ) (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *cavecrusher-sg* '()) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "crush-click") - :volume #x400 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "crush-click" :fo-max 30) (-> obj root-override trans)) ) (ja-channel-push! 1 0) (let ((s5-1 (-> obj skel root-channel 0))) @@ -282,49 +254,33 @@ ) ;; failed to figure out what this is: -(defskelgroup *cavetrapdoor-sg* cavetrapdoor - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 5.7) - ) +(defskelgroup *cavetrapdoor-sg* cavetrapdoor cavetrapdoor-lod0-jg -1 + ((cavetrapdoor-lod0-mg (meters 20)) (cavetrapdoor-lod1-mg (meters 40)) (cavetrapdoor-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 5.7) + ) ;; failed to figure out what this is: (defstate idle (cavetrapdoor) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) (when (= (-> arg0 type) target) (when (>= (- (-> (target-pos 0) y) (-> self root-override trans y)) 409.6) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) (go-virtual trigger) ) ) ) ) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (transform-post) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (anim-loop) (none) @@ -334,53 +290,26 @@ ;; failed to figure out what this is: (defstate trigger (cavetrapdoor) :virtual #t - :code - (behavior () + :code (behavior () (when (nonzero? (-> self delay-before-wiggle)) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay-before-wiggle)) (suspend) ) ) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> gp-0 param 0) (ja-aframe 290.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek! (ja-aframe 290.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 290.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 290.0 0))) ) (restore-collide-with-as (-> self root-override)) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) @@ -388,71 +317,42 @@ (until (or (or (not *target*) (< 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - (and (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) ) (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-7))) ) ) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-14 param 1) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) 1.0) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (label cfg-14) ) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-27 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-27 param 1) 1.0) - (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (and *target* (>= 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (or (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-7)) ) ) (while (not (ja-min? 0)) (suspend) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 param 0) 0.0) - (set! (-> a0-38 param 1) 1.0) - (joint-control-channel-group-eval! a0-38 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) (goto cfg-14) ) (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) (the float (+ (-> a0-40 frame-group data 0 length) -1))) - (set! (-> a0-40 param 1) 1.0) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual idle) (none) ) - :post - (the-as (function none :behavior cavetrapdoor) pusher-post) + :post (the-as (function none :behavior cavetrapdoor) pusher-post) ) ;; definition for method 11 of type cavetrapdoor @@ -549,8 +449,7 @@ ;; failed to figure out what this is: (defpart 704 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-rnd-flt spt-rot-z (degrees -180.0) (degrees 360.0) 1.0) @@ -573,8 +472,7 @@ ;; failed to figure out what this is: (defpart 705 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-rnd-flt spt-rot-z (degrees -180.0) (degrees 360.0) 1.0) @@ -597,8 +495,7 @@ ;; failed to figure out what this is: (defstate caveflamepots-active (caveflamepots) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (when (= (-> arg0 type) target) @@ -610,51 +507,36 @@ ) (let ((s4-0 (new 'stack 'attack-info))) (dummy-41 (-> self root-override) s4-0 (-> self shove-up)) - (cond - ((or (= (-> *target* control unknown-surface00 mode) 'air) - (>= (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> *target* control unknown-dword11)) - (< 0.75 (-> *target* control poly-normal y)) - ) - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 2) - (set! (-> a1-5 message) 'attack-or-shove) - (set! (-> a1-5 param 0) (-> arg3 param 0)) - (let ((v1-22 (new 'static 'attack-info :mask #xa2))) - (set! (-> v1-22 mode) 'burn) - (set! (-> v1-22 vector quad) (-> s4-0 vector quad)) - (set! (-> v1-22 shove-up) (-> s4-0 shove-up)) - (set! (-> a1-5 param 1) (the-as uint v1-22)) - ) - (send-event-function arg0 a1-5) - ) - ) - (else - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'attack-or-shove) - (set! (-> a1-6 param 0) (-> arg3 param 0)) - (let ((v1-26 (new 'static 'attack-info :mask #x8e2))) - (set! (-> v1-26 mode) 'burn) - (set! (-> v1-26 shove-up) 0.0) - (set! (-> v1-26 shove-back) 8192.0) - (set! (-> v1-26 vector quad) (-> *target* control poly-normal quad)) - (set! (-> v1-26 angle) 'shove) - (set! (-> a1-6 param 1) (the-as uint v1-26)) + (if (or (= (-> *target* control unknown-surface00 mode) 'air) + (>= (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> *target* control unknown-dword11)) + (< 0.75 (-> *target* control poly-normal y)) ) - (send-event-function arg0 a1-6) + (send-event + arg0 + 'attack-or-shove + (-> arg3 param 0) + (static-attack-info ((mode 'burn) (vector (-> s4-0 vector)) (shove-up (-> s4-0 shove-up)))) + ) + (send-event + arg0 + 'attack-or-shove + (-> arg3 param 0) + (static-attack-info ((mode 'burn) + (shove-up (meters 0)) + (shove-back (meters 2)) + (vector (-> *target* control poly-normal)) + (angle 'shove) + ) + ) ) ) - ) ) ) ) ) ) ) - :trans - (behavior () + :trans (behavior () (let* ((v1-0 (-> self cycle-speed)) (a0-1 (- v1-0 (-> self cycle-pause))) (gp-0 (mod (+ (-> *display* base-frame-counter) (the-as time-frame (-> self cycle-offset))) v1-0)) @@ -681,7 +563,7 @@ ) (when (-> self should-play-sound?) (set! (-> self should-play-sound?) #f) - (sound-play-by-name (static-sound-name "hot-flame") (new-sound-id) 1024 0 0 1 #t) + (sound-play "hot-flame") ) (cond ((< gp-0 30) @@ -713,9 +595,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -878,27 +759,20 @@ ) ;; failed to figure out what this is: -(defskelgroup *cavespatula-sg* cavespatula - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 -1 0 18) - :longest-edge (meters 0) - ) +(defskelgroup *cavespatula-sg* cavespatula 0 -1 + ((1 (meters 20)) (2 (meters 999999))) + :bounds (static-spherem 0 -1 0 18) + ) ;; failed to figure out what this is: -(defskelgroup *cavespatula-darkcave-sg* cavespatula-darkcave - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 -1 0 18) - :longest-edge (meters 0) - ) +(defskelgroup *cavespatula-darkcave-sg* cavespatula-darkcave cavespatula-darkcave-lod0-jg -1 + ((cavespatula-darkcave-lod0-mg (meters 20)) (cavespatula-darkcave-lod1-mg (meters 999999))) + :bounds (static-spherem 0 -1 0 18) + ) ;; failed to figure out what this is: (defstate cavespatula-idle (cavespatula) - :trans - (behavior () + :trans (behavior () (rider-trans) (update! (-> self sound)) (let ((f0-0 (get-current-phase (-> self sync)))) @@ -906,16 +780,14 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior cavespatula) rider-post) + :post (the-as (function none :behavior cavespatula) rider-post) ) ;; definition for method 11 of type cavespatula @@ -944,20 +816,7 @@ ) (process-drawable-from-entity! obj arg0) (set! (-> obj sound) - (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "spatula") - :volume #x400 - :fo-min 25 - :fo-max 50 - ) - (-> obj root-override trans) - ) + (new 'process 'ambient-sound (static-sound-spec "spatula" :fo-min 25 :fo-max 50) (-> obj root-override trans)) ) (case (-> (if (-> obj entity) (-> obj entity extra level) @@ -1030,18 +889,15 @@ ) ;; failed to figure out what this is: -(defskelgroup *cavespatulatwo-sg* cavespatulatwo - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 2.5 0 21) - :longest-edge (meters 8.7) - ) +(defskelgroup *cavespatulatwo-sg* cavespatulatwo cavespatulatwo-lod0-jg -1 + ((cavespatulatwo-lod0-mg (meters 20)) (cavespatulatwo-lod1-mg (meters 999999))) + :bounds (static-spherem 0 2.5 0 21) + :longest-edge (meters 8.7) + ) ;; failed to figure out what this is: (defstate cavespatulatwo-idle (cavespatulatwo) - :trans - (behavior () + :trans (behavior () (rider-trans) (update! (-> self sound)) (let ((f0-0 (get-current-phase (-> self sync)))) @@ -1049,16 +905,14 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior cavespatulatwo) rider-post) + :post (the-as (function none :behavior cavespatulatwo) rider-post) ) ;; definition for method 11 of type cavespatulatwo @@ -1100,20 +954,8 @@ (set! (-> s5-1 frame-num) 0.0) ) (transform-post) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "spatula") - :volume #x400 - :fo-min 25 - :fo-max 50 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "spatula" :fo-min 25 :fo-max 50) (-> obj root-override trans)) ) (go cavespatulatwo-idle) (none) @@ -1167,13 +1009,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *caveelevator-sg* caveelevator - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4.25) - :longest-edge (meters 0) - ) +(defskelgroup *caveelevator-sg* caveelevator caveelevator-lod0-jg -1 + ((caveelevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.25) + ) ;; definition for function cavecrystal-light-control-caveelevator-callback ;; Used lq/sq @@ -1229,8 +1068,7 @@ ;; failed to figure out what this is: (defstate caveelevator-cycle-active (caveelevator) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'bonk) (activate! (-> self smush) -1.0 60 150 1.0 1.0) @@ -1238,49 +1076,33 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (TODO-RENAME-20 self) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((f30-1 (* (get-current-phase (-> self sync)) (the float (ja-num-frames 0))))) - (cond - ((< (-> self prev-frame-num) f30-1) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) f30-1) - (set! (-> a0-2 param 1) 10000.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (else - (let ((v1-7 (-> self skel root-channel 0))) - (set! (-> v1-7 num-func) num-func-identity) - (set! (-> v1-7 frame-num) f30-1) - ) + (if (< (-> self prev-frame-num) f30-1) + (ja :num! (seek! f30-1 10000.0)) + (ja :num-func num-func-identity :frame-num f30-1) ) - ) (set! (-> self prev-frame-num) f30-1) ) (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (rider-post) (TODO-RENAME-21 self) (none) @@ -1289,8 +1111,7 @@ ;; failed to figure out what this is: (defstate caveelevator-one-way-idle-start (caveelevator) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('bonk) (activate! (-> self smush) -1.0 60 150 1.0 1.0) @@ -1305,34 +1126,23 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (TODO-RENAME-20 self) (none) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as - art-joint-anim - (-> (the-as art-joint-anim (+ (* (-> self anim 0) 4) (the-as int (-> self draw art-group)))) - master-art-group-name - ) - ) - num-func-identity + :code (behavior () + (ja :group! (-> (the-as art-joint-anim (+ (* (-> self anim 0) 4) (the-as int (-> self draw art-group)))) + master-art-group-name + ) + :num! min ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (loop (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (rider-post) (TODO-RENAME-21 self) (none) @@ -1341,8 +1151,7 @@ ;; failed to figure out what this is: (defstate caveelevator-one-way-travel-to-end (caveelevator) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'bonk) (activate! (-> self smush) -1.0 60 150 1.0 1.0) @@ -1350,50 +1159,30 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (TODO-RENAME-20 self) (none) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self anim 0))) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja :group! (-> self draw art-group data (-> self anim 0)) :num! min) + (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go caveelevator-one-way-idle-end) (none) ) - :post - (behavior () + :post (behavior () (rider-post) (TODO-RENAME-21 self) (none) @@ -1402,8 +1191,7 @@ ;; failed to figure out what this is: (defstate caveelevator-one-way-idle-end (caveelevator) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'bonk) (activate! (-> self smush) -1.0 60 150 1.0 1.0) @@ -1411,13 +1199,11 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (cond ((zero? (-> self root-override riders num-riders)) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) @@ -1432,25 +1218,14 @@ (TODO-RENAME-20 self) (none) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self anim 0))) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self anim 0))) data 0 length) -1)) - ) - ) - (while #t + :code (behavior () + (ja :group! (-> self draw art-group data (-> self anim 0)) :num! max) + (loop (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (rider-post) (TODO-RENAME-21 self) (none) @@ -1459,8 +1234,7 @@ ;; failed to figure out what this is: (defstate caveelevator-one-way-travel-to-start (caveelevator) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'bonk) (activate! (-> self smush) -1.0 60 150 1.0 1.0) @@ -1468,50 +1242,30 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (TODO-RENAME-20 self) (none) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self anim 1))) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja :group! (-> self draw art-group data (-> self anim 1)) :num! min) + (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go caveelevator-one-way-idle-start) (none) ) - :post - (behavior () + :post (behavior () (rider-post) (TODO-RENAME-21 self) (none) diff --git a/test/decompiler/reference/levels/maincave/maincave-part_REF.gc b/test/decompiler/reference/levels/maincave/maincave-part_REF.gc index f1e9b9525f..cdd3f2ac6c 100644 --- a/test/decompiler/reference/levels/maincave/maincave-part_REF.gc +++ b/test/decompiler/reference/levels/maincave/maincave-part_REF.gc @@ -39,8 +39,7 @@ (defpartgroup group-part-maincave-torch :id 318 :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 706 :fade-after (meters 200) :falloff-to (meters 220)) + :parts ((sp-item 706 :fade-after (meters 200) :falloff-to (meters 220)) (sp-item 707 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 708 :fade-after (meters 50) :falloff-to (meters 50) :period 600 :length 90) (sp-item 709 :fade-after (meters 50) :falloff-to (meters 50) :period 369 :length 69) @@ -51,8 +50,7 @@ ;; failed to figure out what this is: (defpart 711 - :init-specs - ((sp-flt spt-num 0.3) + :init-specs ((sp-flt spt-num 0.3) (sp-flt spt-x (meters 0.2)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-int spt-rot-x 5) @@ -71,14 +69,12 @@ ;; failed to figure out what this is: (defpart 712 - :init-specs - ((sp-flt spt-fade-b -6.826667)) + :init-specs ((sp-flt spt-fade-b -6.826667)) ) ;; failed to figure out what this is: (defpart 706 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1069547520 1 1.0) (sp-rnd-flt spt-x (meters -0.35) (meters 0.7) 1.0) (sp-rnd-flt spt-z (meters -0.35) (meters 0.7) 1.0) @@ -101,14 +97,12 @@ ;; failed to figure out what this is: (defpart 713 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) ;; failed to figure out what this is: (defpart 708 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters 1)) @@ -132,8 +126,7 @@ ;; failed to figure out what this is: (defpart 709 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.2) (meters 0.6) 1.0) (sp-flt spt-y (meters 0.5)) @@ -157,8 +150,7 @@ ;; failed to figure out what this is: (defpart 710 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 0.2) 1.0) (sp-flt spt-y (meters 0.6)) @@ -182,8 +174,7 @@ ;; failed to figure out what this is: (defpart 707 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.3)) @@ -217,8 +208,7 @@ (defpartgroup group-cave-cavedrip-1 :id 319 :bounds (static-bspherem 0 8 0 8.25) - :parts - ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 369 :length 5) + :parts ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 369 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 768 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 1167 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 1701 :length 5) @@ -231,8 +221,7 @@ (defpartgroup group-cave-cavedrip-2 :id 320 :bounds (static-bspherem 0 8 0 8.25) - :parts - ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 467 :length 5) + :parts ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 467 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 834 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 984 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 2237 :length 5) @@ -245,8 +234,7 @@ (defpartgroup group-cave-cavedrip-3 :id 321 :bounds (static-bspherem 0 8 0 8.25) - :parts - ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 801 :length 5) + :parts ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 801 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 867 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 1269 :length 5) (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 1983 :length 5) @@ -257,8 +245,7 @@ ;; failed to figure out what this is: (defpart 2231 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-flt spt-num 3.0 4.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -278,8 +265,7 @@ ;; failed to figure out what this is: (defpart 2232 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.02)) (sp-flt spt-scale-x (meters 0.5)) @@ -299,8 +285,7 @@ ;; failed to figure out what this is: (defpart 2230 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-func spt-birth-func 'birth-func-y->userdata) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 24)) @@ -323,8 +308,7 @@ ;; failed to figure out what this is: (defpart 2233 - :init-specs - ((sp-flt spt-fade-a 0.0)) + :init-specs ((sp-flt spt-fade-a 0.0)) ) ;; definition for function check-drop-level-maincave-drip @@ -332,13 +316,9 @@ (when (< (-> arg2 y) (-> arg1 user-float)) (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (if (< (+ -1.0 (the-as float v1-2)) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) - ) - ) + (if (< (rand-float-gen) 0.25) + (sound-play "water-drop") + ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var *sp-particle-system-2d* diff --git a/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc b/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc index 3ed33f301f..694e91eb18 100644 --- a/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc +++ b/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/spider-egg-ag.gc") + ;; definition of type mother-spider-egg (deftype mother-spider-egg (process-drawable) ((parent-override (pointer mother-spider) :offset 12) @@ -49,23 +51,23 @@ ) ;; failed to figure out what this is: -(defskelgroup *mother-spider-egg-unbroken-sg* spider-egg - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 2) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *mother-spider-egg-unbroken-sg* spider-egg spider-egg-unbroken-lod0-jg -1 + ((spider-egg-unbroken-lod0-mg (meters 20)) + (spider-egg-unbroken-lod1-mg (meters 40)) + (spider-egg-unbroken-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 1 0 2) + :shadow spider-egg-unbroken-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *mother-spider-egg-broken-sg* spider-egg - 5 - -1 - ((6 (meters 20)) (7 (meters 40)) (8 (meters 999999))) - :bounds (static-spherem 0 1 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *mother-spider-egg-broken-sg* spider-egg spider-egg-broken-lod0-jg -1 + ((spider-egg-broken-lod0-mg (meters 20)) + (spider-egg-broken-lod1-mg (meters 40)) + (spider-egg-broken-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 1 0 2) + ) ;; failed to figure out what this is: (defpartgroup group-spider-egg-hatches @@ -74,16 +76,14 @@ :linger-duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2018 :fade-after (meters 50) :falloff-to (meters 50)) + :parts ((sp-item 2018 :fade-after (meters 50) :falloff-to (meters 50)) (sp-item 2071 :fade-after (meters 50) :falloff-to (meters 50)) ) ) ;; failed to figure out what this is: (defpart 2071 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-y (meters 0.5)) (sp-flt spt-scale-x (meters 0.1)) @@ -103,8 +103,7 @@ ;; failed to figure out what this is: (defpart 2072 - :init-specs - ((sp-flt spt-scale-x (meters 0.1)) + :init-specs ((sp-flt spt-scale-x (meters 0.1)) (sp-flt spt-scale-y (meters 2)) (sp-flt spt-scalevel-y (meters 0.2)) (sp-flt spt-fade-a -1.4222223) @@ -113,8 +112,7 @@ ;; failed to figure out what this is: (defpart 2018 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters 0.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) @@ -142,8 +140,7 @@ ;; failed to figure out what this is: (defpart 2073 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: @@ -153,14 +150,12 @@ :linger-duration 375 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2074 :fade-after (meters 50) :falloff-to (meters 50))) + :parts ((sp-item 2074 :fade-after (meters 50) :falloff-to (meters 50))) ) ;; failed to figure out what this is: (defpart 2074 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters 0.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 2) 1.0) @@ -200,11 +195,20 @@ (set! (-> a1-1 y) (+ 1228.8 (-> a1-1 y))) (set-vector! a2-1 0.0 -61440.0 0.0 1.0) (cond - ((>= (fill-and-probe-using-line-sphere *collide-cache* a1-1 a2-1 7372.8 (collide-kind background) obj s5-0 1) + ((>= (fill-and-probe-using-line-sphere + *collide-cache* + a1-1 + a2-1 + 7372.8 + (collide-kind background) + obj + s5-0 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (let ((v1-11 (-> obj draw shadow-ctrl))) - (set! (-> v1-11 settings flags) (logand -33 (-> v1-11 settings flags))) + (logclear! (-> v1-11 settings flags) (shadow-flags disable-draw)) ) 0 (let ((v1-14 (-> obj draw shadow-ctrl))) @@ -219,7 +223,7 @@ ) (else (let ((v1-22 (-> obj draw shadow-ctrl))) - (logior! (-> v1-22 settings flags) 32) + (logior! (-> v1-22 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -228,7 +232,7 @@ ) (else (let ((v1-25 (-> obj draw shadow-ctrl))) - (logior! (-> v1-25 settings flags) 32) + (logior! (-> v1-25 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -238,21 +242,18 @@ ;; failed to figure out what this is: (defstate mother-spider-egg-falling (mother-spider-egg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (go mother-spider-egg-die-while-falling) ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self falling-start-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (fmin (the float (- (-> *display* base-frame-counter) (-> self falling-start-time))) (-> self traj time)) ) @@ -264,45 +265,30 @@ ) ) (when (= f30-0 (-> self traj time)) - (sound-play-by-name (static-sound-name "eggs-lands") (new-sound-id) 1024 0 0 1 #t) + (sound-play "eggs-lands") (go mother-spider-egg-on-ground) ) ) (draw-egg-shadow self (-> self shadow-pos) #t) (none) ) - :code - (behavior () + :code (behavior () (ja-channel-push! 1 0) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) (-> self anim-speed)) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 9) :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (none) ) - :post - (the-as (function none :behavior mother-spider-egg) transform-post) + :post (the-as (function none :behavior mother-spider-egg) transform-post) ) ;; failed to figure out what this is: (defstate mother-spider-egg-on-ground (mother-spider-egg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'touch) @@ -322,25 +308,22 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (if (not (draw-egg-shadow self (-> self shadow-pos) #t)) (set! (-> self shadow-pos quad) (-> self fall-dest quad)) ) (none) ) - :trans - (behavior () + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) (go mother-spider-egg-hatch) ) (draw-egg-shadow self (-> self shadow-pos) #f) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) (let ((gp-0 (new 'stack-no-clear 'quaternion)) (s5-0 (new 'stack-no-clear 'quaternion)) ) @@ -354,62 +337,33 @@ (quaternion-from-two-vectors! s5-0 s4-0 s3-0) ) (quaternion*! s5-0 s5-0 gp-0) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.3) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 11) :num! (seek! max 1.3) :frame-num 0.0) (until (ja-done? 0) (let* ((f0-8 (ja-frame-num 0)) - (v1-19 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) + (v1-19 (ja-group)) (f0-9 (/ f0-8 (the float (+ (-> v1-19 data 0 length) -1)))) ) (quaternion-slerp! (-> self root-override quat) gp-0 s5-0 f0-9) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.3) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 1.3)) ) ) - (while #t - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) (-> self anim-speed)) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 9) :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (none) ) - :post - (the-as (function none :behavior mother-spider-egg) transform-post) + :post (the-as (function none :behavior mother-spider-egg) transform-post) ) ;; failed to figure out what this is: (defstate mother-spider-egg-hatch (mother-spider-egg) - :trans - (behavior () + :trans (behavior () (when (and (zero? (-> self draw cur-lod)) (logtest? (-> self draw status) (draw-status was-drawn))) (let ((a1-0 (new 'stack-no-clear 'vector))) (set! (-> a1-0 quad) (-> self fall-dest quad)) @@ -425,116 +379,73 @@ ) (none) ) - :code - (behavior () + :code (behavior () (send-event (ppointer->process (-> self parent-override)) 'trigger) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 324) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 324) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) - (ja-channel-push! 1 60) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((v1-37 (-> self draw shadow-ctrl))) - (logior! (-> v1-37 settings flags) 32) + (logior! (-> v1-37 settings flags) (shadow-flags disable-draw)) ) 0 (go mother-spider-egg-die-exit) (none) ) - :post - (the-as (function none :behavior mother-spider-egg) transform-post) + :post (the-as (function none :behavior mother-spider-egg) transform-post) ) ;; failed to figure out what this is: (defstate mother-spider-egg-die (mother-spider-egg) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (let ((v1-3 (-> self draw shadow-ctrl))) - (logior! (-> v1-3 settings flags) 32) + (logior! (-> v1-3 settings flags) (shadow-flags disable-draw)) ) 0 (lods-assign! (-> self draw) (-> self broken-look)) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 325) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) - ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 325) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) + (ja-no-eval :group! (-> self draw art-group data 12) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go mother-spider-egg-die-exit) (none) ) - :post - (the-as (function none :behavior mother-spider-egg) ja-post) + :post (the-as (function none :behavior mother-spider-egg) ja-post) ) ;; failed to figure out what this is: (defstate mother-spider-egg-die-while-falling (mother-spider-egg) - :trans - (behavior () + :trans (behavior () (let ((f0-2 (fmin (the float (- (-> *display* base-frame-counter) (-> self falling-start-time))) (-> self traj time)) ) @@ -543,70 +454,48 @@ ) (none) ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) (let ((v1-5 (-> self draw shadow-ctrl))) - (logior! (-> v1-5 settings flags) 32) + (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) 0 - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-2 (method-of-type part-tracker activate))) - (t9-2 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 325) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 325) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) - (ja-channel-push! 1 30) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 12) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go mother-spider-egg-die-exit) (none) ) - :post - (the-as (function none :behavior mother-spider-egg) ja-post) + :post (the-as (function none :behavior mother-spider-egg) ja-post) ) ;; failed to figure out what this is: (defstate mother-spider-egg-die-exit (mother-spider-egg) - :code - (behavior () + :code (behavior () (send-event (ppointer->process (-> self parent-override)) 'untrigger) (logior! (-> self draw status) (draw-status hidden)) (let ((v1-8 (-> self draw shadow-ctrl))) - (logior! (-> v1-8 settings flags) 32) + (logior! (-> v1-8 settings flags) (shadow-flags disable-draw)) ) 0 - (set! (-> self root-override nav-flags) (logand -2 (-> self root-override nav-flags))) - (set! (-> self root-override nav-flags) (logand -3 (-> self root-override nav-flags))) + (logclear! (-> self root-override nav-flags) (nav-flags navf0)) + (logclear! (-> self root-override nav-flags) (nav-flags navf1)) (clear-collide-with-as (-> self root-override)) (until (not (-> self child)) (suspend) @@ -618,7 +507,7 @@ ;; definition for function mother-spider-egg-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior mother-spider-egg-init-by-other mother-spider-egg ((arg0 entity) (arg1 vector) (arg2 vector) (arg3 vector)) +(defbehavior mother-spider-egg-init-by-other mother-spider-egg ((arg0 entity-actor) (arg1 vector) (arg2 vector) (arg3 vector)) (set! (-> self entity) arg0) (set! (-> self anim-speed) (rand-vu-float-range 0.8 1.2)) (set! (-> self falling-start-time) (-> *display* base-frame-counter)) @@ -652,9 +541,9 @@ (setup-lods! (-> self broken-look) *mother-spider-egg-broken-sg* (-> self draw art-group) (-> self entity)) (set! (-> self draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) (set! (-> self nav) (new 'process 'nav-control (-> self root-override) 16 40960.0)) - (logior! (-> self nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) - (set! (-> self root-override nav-flags) (logand -2 (-> self root-override nav-flags))) - (logior! (-> self root-override nav-flags) 2) + (logior! (-> self nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (logclear! (-> self root-override nav-flags) (nav-flags navf0)) + (logior! (-> self root-override nav-flags) (nav-flags navf1)) (set! (-> self nav extra-nav-sphere quad) (-> self fall-dest quad)) (set! (-> self nav extra-nav-sphere w) 4096.0) (setup-from-to-height! (-> self traj) (-> self root-override trans) arg2 4096.0 -4.551111) diff --git a/test/decompiler/reference/levels/maincave/mother-spider-proj_REF.gc b/test/decompiler/reference/levels/maincave/mother-spider-proj_REF.gc index 01dd1b9570..9384ccc538 100644 --- a/test/decompiler/reference/levels/maincave/mother-spider-proj_REF.gc +++ b/test/decompiler/reference/levels/maincave/mother-spider-proj_REF.gc @@ -26,8 +26,7 @@ :id 326 :duration 300 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 718 :flags (launch-asap) :binding 716) + :parts ((sp-item 718 :flags (launch-asap) :binding 716) (sp-item 716 :flags (start-dead) :binding 717) (sp-item 717 :flags (start-dead launch-asap)) (sp-item 717 :flags (start-dead launch-asap)) @@ -80,8 +79,7 @@ ;; failed to figure out what this is: (defpart 718 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.01)) (sp-copy-from-other spt-scale-y -4) @@ -94,8 +92,7 @@ ;; failed to figure out what this is: (defpart 716 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -121,14 +118,12 @@ ;; failed to figure out what this is: (defpart 720 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: (defpart 717 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 5.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -161,14 +156,12 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 722) (sp-item 723) (sp-item 724)) + :parts ((sp-item 722) (sp-item 723) (sp-item 724)) ) ;; failed to figure out what this is: (defpart 722 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 64.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -196,8 +189,7 @@ ;; failed to figure out what this is: (defpart 724 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -222,8 +214,7 @@ ;; failed to figure out what this is: (defpart 723 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -244,8 +235,7 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 722)) + :parts ((sp-item 722)) ) ;; definition for method 24 of type mother-spider-proj @@ -266,7 +256,7 @@ ) (sound-trans-convert (-> s5-0 parms trans) a1-1) ) - (set! (-> s5-0 parms mask) (the-as uint 32)) + (set! (-> s5-0 parms mask) (sound-mask trans)) (-> s5-0 id) ) (let ((f0-5 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (-> *display* base-frame-counter) 75))))))))) @@ -275,7 +265,7 @@ (the-as vector #f) f0-5 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -294,7 +284,7 @@ (s4-0 (new 'stack-no-clear 'vector)) (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0)) ) - (if (logtest? (-> arg0 root-override status) 4) + (if (logtest? (-> arg0 root-override status) (cshape-moving-flags tsurf)) (vector-flatten! s3-1 s3-1 (-> arg0 root-override local-normal)) ) (vector-normalize-copy! s4-0 s3-1 1.0) @@ -363,8 +353,8 @@ (set! (-> obj target quad) (-> (target-pos 0) quad)) (set! (-> obj target y) (+ 4915.2 (-> obj target y))) (set! (-> obj target-base quad) (-> obj target quad)) - (set! (-> obj sound-id) (sound-play-by-name (static-sound-name "mother-track") (new-sound-id) 1024 0 0 1 #t)) - (sound-play-by-name (static-sound-name "mother-fire") (new-sound-id) 1024 0 0 1 #t) + (set! (-> obj sound-id) (sound-play "mother-track")) + (sound-play "mother-fire") (none) ) @@ -372,7 +362,12 @@ ;; INFO: Return type mismatch vector vs none. ;; Used lq/sq (defmethod dummy-28 mother-spider-proj ((obj mother-spider-proj)) - (when (and *target* (zero? (logand (-> *target* state-flags) #x80f8))) + (when (and *target* + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + ) (let ((gp-0 (-> obj target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) (set! (-> gp-0 y) (+ 4915.2 (-> gp-0 y))) @@ -396,30 +391,22 @@ ;; failed to figure out what this is: (defstate projectile-impact (mother-spider-proj) :virtual #t - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 327) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 327) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "mother-hit") (new-sound-id) 1024 0 0 1 #t) + (sound-play "mother-hit") (suspend) (go-virtual projectile-die) (none) @@ -429,25 +416,17 @@ ;; failed to figure out what this is: (defstate projectile-dissipate (mother-spider-proj) :virtual #t - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 328) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 328) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) diff --git a/test/decompiler/reference/levels/maincave/mother-spider_REF.gc b/test/decompiler/reference/levels/maincave/mother-spider_REF.gc index 48075121c7..b3b3853982 100644 --- a/test/decompiler/reference/levels/maincave/mother-spider_REF.gc +++ b/test/decompiler/reference/levels/maincave/mother-spider_REF.gc @@ -1,28 +1,26 @@ ;;-*-Lisp-*- (in-package goal) -;; failed to figure out what this is: -(defskelgroup *mother-spider-sg* mother-spider - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - :shadow 4 - ) +(import "goal_src/import/mother-spider-ag.gc") ;; failed to figure out what this is: -(defskelgroup *mother-spider-leg-sg* mother-spider - 13 - -1 - ((14 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *mother-spider-sg* mother-spider mother-spider-lod0-jg -1 + ((mother-spider-lod0-mg (meters 20)) + (mother-spider-lod1-mg (meters 40)) + (mother-spider-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 8) + :shadow mother-spider-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup *mother-spider-leg-sg* mother-spider mother-spider-leg-lod0-jg -1 + ((mother-spider-leg-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; definition for symbol *mother-spider-threads*, type (inline-array mother-spider-thread) -(define - *mother-spider-threads* +(define *mother-spider-threads* (new 'static 'inline-array mother-spider-thread 9 (new 'static 'mother-spider-thread :joint-index 27) (new 'static 'mother-spider-thread :trans-u (the-as float #x1a) :swing-arc-u 0.35) @@ -37,8 +35,7 @@ ) ;; definition for symbol *mother-spider-leg-infos*, type (inline-array mother-spider-leg-info) -(define - *mother-spider-leg-infos* +(define *mother-spider-leg-infos* (new 'static 'inline-array mother-spider-leg-info 8 (new 'static 'mother-spider-leg-info :joint-index0 13 :joint-index1 14 :cprim-index 8) (new 'static 'mother-spider-leg-info :joint-index0 7 :joint-index1 8 :cprim-index 5) @@ -56,14 +53,12 @@ :id 614 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2477)) + :parts ((sp-item 2477)) ) ;; failed to figure out what this is: (defpart 2477 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.35) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -84,8 +79,7 @@ ;; failed to figure out what this is: (defstate mother-spider-leg-flying (mother-spider-leg) - :trans - (behavior () + :trans (behavior () (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -114,7 +108,7 @@ (collide-kind background) self gp-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -141,72 +135,44 @@ (deg-seek (-> self facing-rot z) 16384.0 (* (-> self facing-rotv z) (-> *display* seconds-per-frame))) ) (quaternion-zxy! (-> self root quat) (-> self facing-rot)) - (set! (-> self root scale x) (seek (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame)))) + (seek! (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame))) (set! (-> self root scale y) (-> self root scale x)) (set! (-> self root scale z) (-> self root scale x)) (none) ) ) - :code - (behavior () + :code (behavior () (ja-channel-push! 1 0) (let ((f30-0 (rand-vu-float-range 0.2 0.7))) (dotimes (gp-0 3) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 15)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!) - ) + (ja-no-eval :group! mother-spider-leg-twitching-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (spawn (-> self part) (-> self root trans)) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) f30-0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) f30-0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + (ja-no-eval :group! mother-spider-leg-die-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) f30-0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (none) ) - :post - (the-as (function none :behavior mother-spider-leg) ja-post) + :post (the-as (function none :behavior mother-spider-leg) ja-post) ) ;; failed to figure out what this is: (defstate wait-for-children (mother-spider) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (until (not (-> self child)) (suspend) ) (none) ) - :post - (the-as (function none :behavior mother-spider) ja-post) + :post (the-as (function none :behavior mother-spider) ja-post) ) ;; definition for function mother-spider-leg-init-by-other @@ -248,14 +214,12 @@ :id 618 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2498 :period 90 :length 30)) + :parts ((sp-item 2498 :period 90 :length 30)) ) ;; failed to figure out what this is: (defpart 2498 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.35) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -321,26 +285,20 @@ ) (('touch) (when (= (-> arg0 type) target) - (let ((a1-15 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-15 from) self) - (set! (-> a1-15 num-params) 2) - (set! (-> a1-15 message) 'attack) - (set! (-> a1-15 param 0) (-> arg3 param 0)) - (let ((v1-18 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-18 shove-up) 2048.0) - (set! (-> v1-18 shove-back) 8192.0) - (set! (-> a1-15 param 1) (the-as uint v1-18)) - ) - (when (send-event-function arg0 a1-15) - (let ((gp-2 (new 'stack-no-clear 'vector))) - (let ((v1-20 (target-pos 0))) - (vector-! gp-2 (-> self root-override trans) v1-20) + (when (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 0.5)) (shove-back (meters 2)))) ) - (set! (-> gp-2 y) 0.0) - (vector-normalize! gp-2 1.0) - (set! (-> self thread-vel) (+ -8192.0 (-> self thread-vel))) - (TODO-RENAME-21 self gp-2 40960.0 #f) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (let ((v1-20 (target-pos 0))) + (vector-! gp-2 (-> self root-override trans) v1-20) ) + (set! (-> gp-2 y) 0.0) + (vector-normalize! gp-2 1.0) + (set! (-> self thread-vel) (+ -8192.0 (-> self thread-vel))) + (TODO-RENAME-21 self gp-2 40960.0 #f) ) ) ) @@ -400,15 +358,7 @@ (let ((s3-0 (new 'stack-no-clear 'baby-spider-spawn-params))) (init! s3-0 arg2 #f #t #f 7 1 'untrigger) (set-delay! s3-0 (seconds 9)) - (let ((s2-0 (get-process *default-dead-pool* baby-spider #x4000))) - (when s2-0 - (let ((t9-3 (method-of-type baby-spider activate))) - (t9-3 (the-as baby-spider s2-0) obj 'baby-spider (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 baby-spider-init-by-other obj arg0 arg1 s3-0) - (-> s2-0 ppointer) - ) - ) + (process-spawn baby-spider obj arg0 arg1 s3-0 :to obj) ) (let ((v0-5 (+ (-> obj baby-count) 1))) (set! (-> obj baby-count) v0-5) @@ -418,8 +368,8 @@ ;; definition for method 31 of type mother-spider (defmethod is-player-stuck? mother-spider ((obj mother-spider)) - (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) @@ -465,11 +415,20 @@ (set-vector! a2-0 0.0 -81920.0 0.0 1.0) (set! (-> a1-0 y) (+ -8192.0 (-> a1-0 y))) (cond - ((>= (fill-and-probe-using-line-sphere *collide-cache* a1-0 a2-0 8192.0 (collide-kind background) obj s5-0 1) + ((>= (fill-and-probe-using-line-sphere + *collide-cache* + a1-0 + a2-0 + 8192.0 + (collide-kind background) + obj + s5-0 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (let ((v1-11 (-> obj draw shadow-ctrl))) - (set! (-> v1-11 settings flags) (logand -33 (-> v1-11 settings flags))) + (logclear! (-> v1-11 settings flags) (shadow-flags disable-draw)) ) 0 (let ((v1-14 (-> obj draw shadow-ctrl))) @@ -490,7 +449,7 @@ ) (else (let ((v1-23 (-> obj draw shadow-ctrl))) - (logior! (-> v1-23 settings flags) 32) + (logior! (-> v1-23 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -499,7 +458,7 @@ ) (else (let ((v1-25 (-> obj draw shadow-ctrl))) - (logior! (-> v1-25 settings flags) 32) + (logior! (-> v1-25 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -652,7 +611,7 @@ (when (logtest? s4-1 1) (cond ((>= (+ (-> *display* base-frame-counter) (seconds -1)) (-> obj leg-socket-part-time s3-0)) - (set! (-> obj leg-socket-part-mask) (logxor (-> obj leg-socket-part-mask) (ash 1 s3-0))) + (logxor! (-> obj leg-socket-part-mask) (ash 1 s3-0)) ) (else (let ((v1-20 (-> *mother-spider-leg-infos* s3-0)) @@ -774,7 +733,7 @@ (collide-kind background) obj (the-as collide-tri-result s5-1) - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -832,7 +791,7 @@ (let ((f0-44 (+ (-> obj orient-rot y) (* (-> obj spin-vel) (-> *display* seconds-per-frame))))) (set! (-> obj orient-rot y) (- f0-44 (* (the float (the int (/ f0-44 65536.0))) 65536.0))) ) - (set! (-> obj spin-vel) (seek (-> obj spin-vel) 0.0 (* 91022.22 (-> *display* seconds-per-frame)))) + (seek! (-> obj spin-vel) 0.0 (* 91022.22 (-> *display* seconds-per-frame))) (when (< (fabs (-> obj spin-vel)) 69176.89) (if (>= (-> obj spin-vel) 0.0) (set! (-> obj spin-vel) 69176.89) @@ -874,10 +833,9 @@ ;; failed to figure out what this is: (defstate mother-spider-idle (mother-spider) - :enter - (behavior () + :enter (behavior () (let ((v1-1 (-> self draw shadow-ctrl))) - (logior! (-> v1-1 settings flags) 32) + (logior! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) 0 (set! (-> self mode) (the-as uint 0)) @@ -888,24 +846,21 @@ (logior! (-> self draw status) (draw-status hidden)) (none) ) - :exit - (behavior () + :exit (behavior () (restore-collide-with-as (-> self root-override)) (set! (-> self skel postbind-function) mother-spider-full-joint-callback) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (if (grab-player? self) (go mother-spider-traveling (the-as uint 1)) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -915,10 +870,8 @@ ;; failed to figure out what this is: (defstate mother-spider-traveling (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior ((arg0 uint)) + :event mother-spider-default-event-handler + :enter (behavior ((arg0 uint)) (is-player-stuck? self) (let ((v1-2 arg0)) (cond @@ -955,8 +908,7 @@ (set! (-> self going-up?) (< (-> self targ-dist-from-anchor) (-> self dist-from-anchor))) (none) ) - :trans - (behavior () + :trans (behavior () (let ((gp-0 (is-player-stuck? self)) (v1-1 (-> self mode)) ) @@ -1011,103 +963,56 @@ (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior ((arg0 uint)) + :code (behavior ((arg0 uint)) (local-vars (v1-12 symbol) (v1-28 symbol)) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 7)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! mother-spider-lowering-ja :num! min) + (loop (until v1-12 (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-12 (or (ja-done? 0) (-> self hit?))) ) (when (-> self hit?) (until (not (-> self hit?)) (set! (-> self hit?) #f) - (ja-channel-push! 1 60) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 9)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! mother-spider-takes-hit-ja :num! min) (until v1-28 (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-28 (or (ja-done? 0) (-> self hit?))) ) ) - (ja-channel-push! 1 60) - ) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 7)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) + (ja-channel-push! 1 (seconds 0.2)) ) + (ja :group! mother-spider-lowering-ja :num! min) ) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) ;; failed to figure out what this is: (defstate mother-spider-stop-traveling (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior () + :event mother-spider-default-event-handler + :enter (behavior () (set! (-> self hit?) #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-tracking) ) (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! mother-spider-stopped-lowering-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((v1-22 (-> self mode))) (cond @@ -1126,23 +1031,19 @@ ) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) ;; failed to figure out what this is: (defstate mother-spider-tracking (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior () + :event mother-spider-default-event-handler + :enter (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self last-player-in-air-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-tracking) ) @@ -1151,7 +1052,11 @@ ) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (-> self node-list data 6)) - (if (or (logtest? (-> *target* state-flags) #x80f8) (< (vector-vector-distance gp-0 (camera-pos)) 8192.0)) + (if (or (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + (< (vector-vector-distance gp-0 (camera-pos)) 8192.0) + ) (go mother-spider-traveling (the-as uint 2)) ) ) @@ -1167,8 +1072,8 @@ ) ) ) - (if (or (not *target*) (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (if (or (not *target*) (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) ) (set! (-> self last-player-in-air-time) (-> *display* base-frame-counter)) @@ -1203,64 +1108,39 @@ (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? mother-spider-idle-ja) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) ) (else - (ja-channel-push! 1 75) + (ja-channel-push! 1 (seconds 0.25)) ) ) - (while #t - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (loop + (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) ;; failed to figure out what this is: (defstate mother-spider-hit-while-tracking (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior () + :event mother-spider-default-event-handler + :enter (behavior () (set! (-> self hit?) #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-tracking) ) @@ -1271,83 +1151,45 @@ (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! mother-spider-takes-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) - (while #t - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (loop + (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) ;; failed to figure out what this is: (defstate mother-spider-spit (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior () + :event mother-spider-default-event-handler + :enter (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-tracking) ) (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior () - (ja-channel-push! 1 75) + :code (behavior () + (ja-channel-push! 1 (seconds 0.25)) (let ((gp-0 #f)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.5) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! mother-spider-spit-ja :num! (seek! max 1.5) :frame-num 0.0) (until (ja-done? 0) (when (and (not gp-0) (>= (ja-aframe-num 0) 6.0) (>= 8.0 (ja-aframe-num 0))) (when *target* @@ -1369,14 +1211,15 @@ (vector-normalize! s5-0 1.0) (vector-deg-seek s5-0 s2-0 s5-0 6371.5557) (vector-normalize-copy! s3-0 s5-0 32768.0) - (let ((gp-1 (get-process *default-dead-pool* mother-spider-proj #x4000))) - (when gp-1 - (let ((t9-12 (method-of-type mother-spider-proj activate))) - (t9-12 (the-as mother-spider-proj gp-1) self 'mother-spider-proj (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 projectile-init-by-other (-> self entity) s4-0 s3-0 0 (process->handle *target*)) - (-> gp-1 ppointer) - ) + (process-spawn + mother-spider-proj + :init projectile-init-by-other + (-> self entity) + s4-0 + s3-0 + 0 + (process->handle *target*) + :to self ) (set! gp-0 #t) (set! (-> self last-spit-time) (-> *display* base-frame-counter)) @@ -1394,11 +1237,7 @@ ) ) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.5) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 1.5)) ) ) (if (> (-> self spit-counter) 0) @@ -1407,22 +1246,18 @@ ) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) ;; failed to figure out what this is: (defstate mother-spider-birthing (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior () + :event mother-spider-default-event-handler + :enter (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-birthing) ) @@ -1430,14 +1265,20 @@ (go mother-spider-traveling (the-as uint 0)) ) (if (and (>= (- (-> *display* base-frame-counter) (-> self started-birthing-time)) (seconds 6)) - (zero? (logand (-> *target* state-flags) #x80f8)) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) ) (go mother-spider-traveling (the-as uint 1)) ) (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) (> (-> self birthing-counter) 0) (and (>= 49152.0 (- (-> self max-dist-from-anchor) (-> self dist-from-anchor))) - (zero? (logand (-> *target* state-flags) #x80f8)) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) (TODO-RENAME-21 (-> self nav) (-> self root-override trans)) ) ) @@ -1446,65 +1287,40 @@ (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? mother-spider-idle-ja) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) ) (else - (ja-channel-push! 1 75) + (ja-channel-push! 1 (seconds 0.25)) ) ) - (while #t - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (loop + (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) ;; failed to figure out what this is: (defstate mother-spider-birth-baby (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior () + :event mother-spider-default-event-handler + :enter (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-birthing) ) @@ -1517,19 +1333,10 @@ (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior () - (ja-channel-push! 1 75) + :code (behavior () + (ja-channel-push! 1 (seconds 0.25)) (let ((gp-0 #f)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.4) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! mother-spider-birth-ja :num! (seek! max 1.4) :frame-num 0.0) (until (ja-done? 0) (when (and (not gp-0) (>= (ja-aframe-num 0) 10.0)) (set! gp-0 #t) @@ -1537,41 +1344,21 @@ (s4-0 (new 'stack-no-clear 'vector)) ) (when (TODO-RENAME-20 self s5-0 s4-0) - (let ((s3-0 (get-process *default-dead-pool* mother-spider-egg #x4000))) - (when s3-0 - (let ((t9-5 (method-of-type mother-spider-egg activate))) - (t9-5 (the-as mother-spider-egg s3-0) self 'mother-spider-egg (the-as pointer #x70004000)) - ) - (run-now-in-process - s3-0 - mother-spider-egg-init-by-other - (-> self entity) - (-> self root-override trans) - s5-0 - s4-0 - ) - (-> s3-0 ppointer) - ) - ) + (process-spawn mother-spider-egg (-> self entity) (-> self root-override trans) s5-0 s4-0 :to self) (+! (-> self baby-count) 1) (+! (-> self birthing-counter) -1) - (sound-play-by-name (static-sound-name "lay-eggs") (new-sound-id) 1024 0 0 1 #t) + (sound-play "lay-eggs") ) ) ) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.4) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 1.4)) ) ) (go mother-spider-birthing) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) ;; definition for method 20 of type mother-spider @@ -1674,7 +1461,7 @@ (collide-kind background) obj s2-2 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -1708,7 +1495,7 @@ (collide-kind background) obj s3-2 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -1726,15 +1513,12 @@ ;; failed to figure out what this is: (defstate mother-spider-hit-while-birthing (mother-spider) - :event - mother-spider-default-event-handler - :enter - (behavior () + :event mother-spider-default-event-handler + :enter (behavior () (set! (-> self hit?) #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (-> self hit?) (go mother-spider-hit-while-birthing) ) @@ -1744,58 +1528,30 @@ (TODO-RENAME-29 self #t #t) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! mother-spider-takes-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) - (while #t - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (loop + (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior mother-spider) transform-post) + :post (the-as (function none :behavior mother-spider) transform-post) ) ;; failed to figure out what this is: (defstate mother-spider-die-from-uppercut (mother-spider) - :event - mother-spider-death-event-handler - :enter - (behavior () + :event mother-spider-death-event-handler + :enter (behavior () (shut-down! (-> self neck)) (set! (-> self thread-speed) 122880.0) (set! (-> self targ-dist-from-anchor) (+ -24576.0 (-> self dist-from-anchor))) @@ -1817,15 +1573,7 @@ (set! (-> s1-0 quad) (-> s2-0 quad)) (set! (-> s1-0 y) (+ 0.3 (-> s1-0 y))) (vector-normalize! s1-0 1.0) - (let ((s0-1 (get-process *default-dead-pool* mother-spider-leg #x4000))) - (when s0-1 - (let ((t9-6 (method-of-type mother-spider-leg activate))) - (t9-6 (the-as mother-spider-leg s0-1) self 'mother-spider-leg (the-as pointer #x70004000)) - ) - (run-now-in-process s0-1 mother-spider-leg-init-by-other self s3-0 s2-0 s1-0) - (-> s0-1 ppointer) - ) - ) + (process-spawn mother-spider-leg self s3-0 s2-0 s1-0 :to self) ) (+! s5-0 1) ) @@ -1833,93 +1581,60 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (TODO-RENAME-29 self #f #f) (none) ) - :code - (behavior () + :code (behavior () (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-2 user-int8 0) 1) ) (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (clear-collide-with-as (-> self root-override)) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-no-eval :group! mother-spider-die-from-uppercut-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go mother-spider-die-wait-for-children) (none) ) - :post - (the-as (function none :behavior mother-spider) ja-post) + :post (the-as (function none :behavior mother-spider) ja-post) ) ;; failed to figure out what this is: (defstate mother-spider-die (mother-spider) - :event - mother-spider-death-event-handler - :trans - (behavior () + :event mother-spider-death-event-handler + :trans (behavior () (TODO-RENAME-29 self #f #f) (none) ) - :code - (behavior () + :code (behavior () (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-2 user-int8 0) 1) ) (shut-down! (-> self neck)) (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (clear-collide-with-as (-> self root-override)) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! mother-spider-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go mother-spider-die-wait-for-children) (none) ) - :post - (the-as (function none :behavior mother-spider) ja-post) + :post (the-as (function none :behavior mother-spider) ja-post) ) ;; failed to figure out what this is: (defstate mother-spider-die-wait-for-children (mother-spider) - :event - mother-spider-death-event-handler - :code - (behavior () + :event mother-spider-death-event-handler + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) (set! (-> self skel postbind-function) #f) @@ -2150,10 +1865,10 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *mother-spider-sg* '()) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav nearest-y-threshold) 409600.0) - (set! (-> obj root-override nav-flags) (logand -2 (-> obj root-override nav-flags))) - (set! (-> obj root-override nav-flags) (logand -3 (-> obj root-override nav-flags))) + (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) + (logclear! (-> obj root-override nav-flags) (nav-flags navf1)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (set! (-> obj fact) diff --git a/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc b/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc index b70c7b66dc..65fe25d035 100644 --- a/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc +++ b/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/spiderwebs-ag.gc") + ;; definition for symbol *spider-jump-mods*, type surface (define *spider-jump-mods* (new 'static 'surface :name 'jump @@ -27,7 +29,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #xc00 + :flags (surface-flags allow-edge-grab jump) ) ) @@ -55,29 +57,18 @@ ) ;; failed to figure out what this is: -(defskelgroup *spiderwebs-sg* spiderwebs - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3.5) - :longest-edge (meters 0) - ) +(defskelgroup *spiderwebs-sg* spiderwebs spiderwebs-good-lod0-jg -1 + ((spiderwebs-good-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + ) ;; definition for function spiderwebs-default-event-handler (defbehavior spiderwebs-default-event-handler spiderwebs ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('bonk) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 3) - (set! (-> a1-1 message) 'jump) - (set! (-> a1-1 param 0) (the-as uint (-> self spring-height))) - (set! (-> a1-1 param 1) (the-as uint (-> self spring-height))) - (set! (-> a1-1 param 2) (the-as uint *spider-jump-mods*)) - (if (send-event-function arg0 a1-1) - (go spiderwebs-bounce) - ) - ) + (if (send-event arg0 'jump (-> self spring-height) (-> self spring-height) *spider-jump-mods*) + (go spiderwebs-bounce) + ) ) (('touch) (when (= (-> arg0 type) target) @@ -107,21 +98,12 @@ ;; failed to figure out what this is: (defstate spiderwebs-idle (spiderwebs) - :event - spiderwebs-default-event-handler - :code - (behavior () + :event spiderwebs-default-event-handler + :code (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! spiderwebs-bounce-ja :num! min) (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -131,48 +113,24 @@ ;; failed to figure out what this is: (defstate spiderwebs-bounce (spiderwebs) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (sound-play-by-name (static-sound-name "web-tramp") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-1 param 0) (ja-aframe 10.0 0)) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) 0.0) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (sound-play "web-tramp") + (ja-no-eval :group! spiderwebs-bounce-ja :num! (seek! (ja-aframe 10.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe 10.0 0)) - (set! (-> gp-2 param 1) 1.0) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 10.0 0))) ) (set! (-> self event-hook) (-> spiderwebs-idle event)) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> gp-3 param 1) 1.0) - (set! (-> gp-3 frame-num) (ja-aframe 10.0 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! spiderwebs-bounce-ja :num! (seek!) :frame-num (ja-aframe 10.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go spiderwebs-idle) (none) ) - :post - (the-as (function none :behavior spiderwebs) transform-post) + :post (the-as (function none :behavior spiderwebs) transform-post) ) ;; definition for method 11 of type spiderwebs diff --git a/test/decompiler/reference/levels/misty/babak-with-cannon_REF.gc b/test/decompiler/reference/levels/misty/babak-with-cannon_REF.gc index 6025751ac4..be0920e535 100644 --- a/test/decompiler/reference/levels/misty/babak-with-cannon_REF.gc +++ b/test/decompiler/reference/levels/misty/babak-with-cannon_REF.gc @@ -33,13 +33,11 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-idle (babak-with-cannon) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak-with-cannon) nav-enemy-default-event-handler ) - :trans - (behavior () + :trans (behavior () (if (and (and *target* (>= (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) @@ -50,52 +48,28 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-post) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (anim-loop) (none) ) - :post - (the-as (function none :behavior babak-with-cannon) #f) + :post (the-as (function none :behavior babak-with-cannon) #f) ) ;; failed to figure out what this is: (defstate nav-enemy-patrol (babak-with-cannon) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak-with-cannon) nav-enemy-default-event-handler ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (let ((f30-0 (- (-> (target-pos 0) y) (-> self collide-info trans y)))) (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) @@ -122,60 +96,42 @@ nav-enemy-default-event-handler ) (none) ) - :code - (-> (method-of-type babak nav-enemy-patrol) code) + :code (-> (method-of-type babak nav-enemy-patrol) code) ) ;; failed to figure out what this is: (defstate babak-run-to-cannon (babak) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self nav destination-pos quad) (-> self entity extra trans quad)) (set! (-> self nav target-pos quad) (-> self entity extra trans quad)) (none) ) - :trans - (behavior () + :trans (behavior () (if (nav-enemy-notice-player?) (go-virtual nav-enemy-chase) ) - (if (logtest? (nav-control-flags bit19) (-> self nav flags)) + (if (logtest? (nav-control-flags navcf19) (-> self nav flags)) (go babak-with-cannon-jump-onto-cannon) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (loop + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (behavior () + :post (behavior () (nav-enemy-travel-post) (none) ) @@ -236,22 +192,19 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate babak-with-cannon-jump-onto-cannon (babak-with-cannon) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak-with-cannon) nav-enemy-jump-event-handler ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 24) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) - (set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (nav-enemy-neck-control-inactive) (let* ((v1-7 (-> self cannon-ent)) (gp-0 (if v1-7 @@ -274,12 +227,12 @@ nav-enemy-default-event-handler ) ) (when (not (nav-enemy-facing-point? (-> self jump-dest) 5461.3335)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) - (set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (let* ((v1-20 (-> self cannon-ent)) (gp-1 (if v1-20 (-> v1-20 extra process) @@ -293,78 +246,50 @@ nav-enemy-default-event-handler (when a0-9 (let ((gp-2 (babak-with-cannon-compute-cannon-dir (the-as mistycannon a0-9) (new 'stack-no-clear 'vector)))) (when (not (nav-enemy-facing-direction? gp-2 1820.4445)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (nav-enemy-turn-to-face-dir gp-2 182.04445) (forward-up->quaternion (-> self collide-info quat) gp-2 *y-vector*) ) ) ) ) - (ja-channel-push! 1 30) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 17) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go babak-with-cannon-shooting) (none) ) - :post - (the-as (function none :behavior babak-with-cannon) nav-enemy-jump-post) + :post (the-as (function none :behavior babak-with-cannon) nav-enemy-jump-post) ) ;; failed to figure out what this is: (defstate babak-with-cannon-jump-off-cannon (babak-with-cannon) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak-with-cannon) nav-enemy-jump-event-handler ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 24) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (nav-enemy-initialize-jump (-> self entity extra trans)) (nav-enemy-neck-control-look-at) - (set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags))) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - (set! (-> a0-2 param 0) 0.0) - (set! (-> a0-2 param 1) 2.0) - (set! (-> a0-2 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!) - ) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) + (ja-no-eval :group! (-> self draw art-group data 17) :num! (seek! 0.0 2.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) 0.0) - (set! (-> a0-3 param 1) 2.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0 2.0)) ) (when (not (nav-enemy-facing-point? (-> self jump-dest) 5461.3335)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) (let ((a1-6 (dummy-16 (-> self nav) (-> self jump-dest)))) (set-current-poly! (-> self nav) a1-6) @@ -372,19 +297,16 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-jump-land) (none) ) - :post - (the-as (function none :behavior babak-with-cannon) nav-enemy-jump-post) + :post (the-as (function none :behavior babak-with-cannon) nav-enemy-jump-post) ) ;; failed to figure out what this is: (defstate babak-with-cannon-shooting (babak-with-cannon) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak-with-cannon) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((v1-2 (entity-actor-lookup (-> self entity) 'alt-actor 0))) (if v1-2 @@ -393,8 +315,7 @@ nav-enemy-default-event-handler ) (none) ) - :exit - (behavior () + :exit (behavior () (let ((v1-0 (entity-actor-lookup (-> self entity) 'alt-actor 0))) (if v1-0 (logclear! (-> v1-0 extra perm status) (entity-perm-status complete)) @@ -402,8 +323,7 @@ nav-enemy-default-event-handler ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f0-1 (- (-> (target-pos 0) y) (-> self collide-info trans y)))) (if (and (< -40960.0 f0-1) (and (and *target* @@ -417,27 +337,23 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - babak-with-cannon-ride-cannon-post + :post babak-with-cannon-ride-cannon-post ) ;; failed to figure out what this is: (defstate nav-enemy-die (babak-with-cannon) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak-with-cannon) nav-enemy-default-event-handler ) - :trans - (behavior () + :trans (behavior () (if (and *target* (= (-> *target* current-level name) 'beach)) (spool-push *art-control* "beachcam-cannon" 0 self -1.0) ) @@ -456,13 +372,11 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-fuel-cell (babak-with-cannon) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior babak-with-cannon) process-drawable-fuel-cell-handler ) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self collide-info)) (ja-post) diff --git a/test/decompiler/reference/levels/misty/balloonlurker_REF.gc b/test/decompiler/reference/levels/misty/balloonlurker_REF.gc index 177e5e5d87..fd2b0cdbf7 100644 --- a/test/decompiler/reference/levels/misty/balloonlurker_REF.gc +++ b/test/decompiler/reference/levels/misty/balloonlurker_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/balloonlurker-ag.gc") + ;; failed to figure out what this is: (defpartgroup group-balloonlurker-pilot-death :id 203 @@ -8,14 +10,12 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2015)) + :parts ((sp-item 2015)) ) ;; failed to figure out what this is: (defpart 2015 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 16)) @@ -37,8 +37,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 964 :period 1200 :length 30) + :parts ((sp-item 964 :period 1200 :length 30) (sp-item 965 :fade-after (meters 60) :period 1200 :length 15) (sp-item 966 :period 1200 :length 15 :offset 15) (sp-item 967 :period 1200 :length 15) @@ -64,8 +63,7 @@ ;; failed to figure out what this is: (defpart 964 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-y (meters 0.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -93,14 +91,12 @@ ;; failed to figure out what this is: (defpart 969 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.32)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.32)) ) ;; failed to figure out what this is: (defpart 965 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0.75)) (sp-rnd-flt spt-scale-x (meters 8) (meters 8) 1.0) @@ -125,14 +121,12 @@ ;; failed to figure out what this is: (defpart 970 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) ;; failed to figure out what this is: (defpart 966 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 24) (meters 16) 1.0) @@ -149,8 +143,7 @@ ;; failed to figure out what this is: (defpart 967 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 24) (meters 16) 1.0) @@ -167,8 +160,7 @@ ;; failed to figure out what this is: (defpart 968 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 5.0 10.0 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) @@ -196,8 +188,7 @@ ;; failed to figure out what this is: (defpart 971 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0033333334)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0033333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r -4.266667) (sp-flt spt-fade-g 0.7111111) @@ -208,8 +199,7 @@ ;; failed to figure out what this is: (defpart 963 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.25) (meters 0.5) 1.0) @@ -316,7 +306,7 @@ (explosion-joint-index-bytes int8 4 :offset 772) (vulnerable symbol :offset-assert 776) (water-y float :offset-assert 780) - (propeller joint-mod-set-local :offset-assert 784) + (propeller joint-mod-spinner :offset-assert 784) (rudder joint-mod-set-local :offset-assert 788) (mine joint-mod-set-world 2 :offset-assert 792) (buoyancy-factor float :offset-assert 800) @@ -352,7 +342,7 @@ (format #t "~T~Texplosion-force-position: #~%" (-> obj explosion-force-position)) (format #t "~T~Texplosion-force: #~%" (-> obj explosion-force)) (format #t "~T~Texplosion: ~A~%" (-> obj explosion)) - (format #t "~T~Texplosion-joint-index[2] @ #x~X~%" (-> obj explosion-joint-index)) + (format #t "~T~Texplosion-joint-index[2] @ #x~X~%" (-> obj explosion-joint-index-bytes)) (format #t "~T~Tvulnerable: ~A~%" (-> obj vulnerable)) (format #t "~T~Twater-y: ~f~%" (-> obj water-y)) (format #t "~T~Tpropeller: ~A~%" (-> obj propeller)) @@ -402,22 +392,22 @@ ) ;; failed to figure out what this is: -(defskelgroup *balloonlurker-sg* balloonlurker - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 12 0 17) - :longest-edge (meters 0) - ) +(defskelgroup *balloonlurker-sg* balloonlurker balloonlurker-lod0-jg balloonlurker-idle-ja + ((balloonlurker-lod0-mg (meters 20)) + (balloonlurker-lod1-mg (meters 40)) + (balloonlurker-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 12 0 17) + ) ;; failed to figure out what this is: -(defskelgroup *balloonlurker-pilot-sg* balloonlurker - 6 - 10 - ((7 (meters 20)) (8 (meters 40)) (9 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *balloonlurker-pilot-sg* balloonlurker balloonlurker-pilot-lod0-jg balloonlurker-pilot-idle-ja + ((balloonlurker-pilot-lod0-mg (meters 20)) + (balloonlurker-pilot-lod1-mg (meters 40)) + (balloonlurker-pilot-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 4) + ) ;; definition for function balloonlurker-get-path-point ;; INFO: Return type mismatch int vs none. @@ -512,17 +502,11 @@ (the-as uint 1) ) (do-push-aways! (-> self root-overlay)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'shove) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((v1-9 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-9 shove-back) 8192.0) - (set! (-> v1-9 shove-up) 2048.0) - (set! (-> a1-3 param 1) (the-as uint v1-9)) - ) - (send-event-function arg0 a1-3) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-back (meters 2)) (shove-up (meters 0.5)))) ) ) (dotimes (s4-0 2) @@ -540,25 +524,15 @@ (let ((a0-10 (find-prim-by-id (-> self root-overlay) (the-as uint s3-0)))) (when a0-10 (set! (-> self explosion-force-position quad) (-> a0-10 prim-core world-sphere quad)) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'attack) - (set! (-> a1-6 param 0) (-> arg3 param 0)) - (let ((a0-13 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-13 mode) 'balloonlurker) - (set! (-> a1-6 param 1) (the-as uint a0-13)) - ) - (if (send-event-function arg0 a1-6) - (level-hint-spawn - (game-text-id misty-daxter-hit-lurkers-not-mines) - "sksp0063" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + (if (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'balloonlurker)))) + (level-hint-spawn + (game-text-id misty-daxter-hit-lurkers-not-mines) + "sksp0063" + (the-as entity #f) + *entity-pool* + (game-task none) ) - ) + ) (go balloonlurker-mine-explode s4-0) ) ) @@ -689,25 +663,15 @@ (f1-2 100.0) (f0-3 (* 3.0 f0-2)) ) - (sound-play-by-name - (static-sound-name "propeller") - (-> self engine-sound-id) - (the int (* 10.24 f1-2)) - (the int (* 1524.0 f0-3)) - 0 - 1 - (the-as symbol (-> self node-list data 4 bone transform vector 3)) + (sound-play + "propeller" + :id (-> self engine-sound-id) + :vol f1-2 + :pitch f0-3 + :position (the-as symbol (-> self node-list data 4 bone transform vector 3)) ) ) - (sound-play-by-name - (static-sound-name "pedals") - (-> self pedal-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-overlay trans)) - ) + (sound-play "pedals" :id (-> self pedal-sound-id) :position (the-as symbol (-> self root-overlay trans))) ) ) (else @@ -744,12 +708,11 @@ (let ((f0-4 (- (vector-dot s4-0 (-> self dest-point)) (vector-dot s4-0 gp-0))) (f2-2 (- (vector-dot (the-as vector s5-0) (-> self dest-point)) (vector-dot (the-as vector s5-0) gp-0))) ) - (set! (-> self rudder-control) (seek - (-> self rudder-control) - (fmax -1.0 (fmin 1.0 (/ f2-2 (fmax 4096.0 f0-4)))) - (* 4.0 (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self rudder-control) + (fmax -1.0 (fmin 1.0 (/ f2-2 (fmax 4096.0 f0-4)))) + (* 4.0 (-> *display* seconds-per-frame)) + ) ) (let ((f0-12 0.0) (f1-7 1.0) @@ -763,28 +726,25 @@ ) (else (let ((f0-14 (analog-input (the-as int (-> *cpad-list* cpads 1 leftx)) 128.0 48.0 110.0 -1.0))) - (set! (-> self rudder-control) (seek (-> self rudder-control) f0-14 (* 2.0 (-> *display* seconds-per-frame)))) + (seek! (-> self rudder-control) f0-14 (* 2.0 (-> *display* seconds-per-frame))) ) (if (cpad-hold? 1 x) - (set! (-> self throttle-control) (seek (-> self throttle-control) 1.0 (-> *display* seconds-per-frame))) - (set! (-> self throttle-control) - (seek (-> self throttle-control) 0.0 (* 0.25 (-> *display* seconds-per-frame))) - ) + (seek! (-> self throttle-control) 1.0 (-> *display* seconds-per-frame)) + (seek! (-> self throttle-control) 0.0 (* 0.25 (-> *display* seconds-per-frame))) ) ) ) - (set! (-> self engine-thrust) (seek - (-> self engine-thrust) - (* (-> self throttle-control) (-> *BALLOONLURKER-bank* max-engine-thrust)) - (* 0.005 (-> *BALLOONLURKER-bank* max-engine-thrust)) - ) - ) + (seek! + (-> self engine-thrust) + (* (-> self throttle-control) (-> *BALLOONLURKER-bank* max-engine-thrust)) + (* 0.005 (-> *BALLOONLURKER-bank* max-engine-thrust)) + ) (let ((f0-31 60.0) (f1-14 1820.4445) (f2-6 6735.6445) (f3-6 (-> *BALLOONLURKER-bank* max-engine-thrust)) ) - (set! (-> self propeller transform quat y) (* f0-31 (+ f1-14 (* f2-6 (/ 1.0 f3-6) (-> self engine-thrust))))) + (set! (-> self propeller spin-rate) (* f0-31 (+ f1-14 (* f2-6 (/ 1.0 f3-6) (-> self engine-thrust))))) ) (let ((f0-34 (* (-> *BALLOONLURKER-bank* max-rudder-deflection-angle) (-> self rudder-control))) (gp-1 (new 'stack-no-clear 'quaternion)) @@ -816,80 +776,51 @@ ;; failed to figure out what this is: (defstate balloonlurker-patrol (balloonlurker) - :event - balloonlurker-event-handler - :trans - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) + :event balloonlurker-event-handler + :trans (behavior () + (ja :num! (loop!)) (set! (-> self anim-frame) (ja-frame-num 0)) (none) ) - :code - (behavior () - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 4) - ) - ) - (ja-channel-push! 1 21) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) - (let ((v1-11 (-> self skel root-channel 0))) - (set! (-> v1-11 num-func) num-func-identity) - (set! (-> v1-11 frame-num) 0.0) - ) + :code (behavior () + (when (not (ja-group? balloonlurker-idle-ja)) + (ja-channel-push! 1 (seconds 0.07)) + (ja :group! balloonlurker-idle-ja) + (ja :num-func num-func-identity :frame-num 0.0) ) (ja-post) (anim-loop) (none) ) - :post - balloonlurker-post + :post balloonlurker-post ) ;; failed to figure out what this is: (defstate balloonlurker-mine-explode (balloonlurker) - :event - balloonlurker-event-handler - :code - (behavior ((arg0 int)) + :event balloonlurker-event-handler + :code (behavior ((arg0 int)) (set! (-> self explosion-force-position quad) (-> self node-list data (-> self explosion-joint-index-bytes arg0) bone transform vector 3 quad) ) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker s5-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - part-tracker-init - (-> *part-group-id-table* 204) - -1 - #f - #f - #f - (-> self explosion-force-position) - ) - (-> s5-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 204) + -1 + #f + #f + #f + (-> self explosion-force-position) + :to *entity-pool* ) - (sound-play-by-name (static-sound-name "explosion") (new-sound-id) 1024 0 0 1 #t) + (sound-play "explosion") (set! (-> self explosion) #t) (vector-! (-> self explosion-force) (-> self rbody position) (-> self explosion-force-position)) (set! (-> self explosion-force y) (* 2.0 (-> self explosion-force y))) (vector-length (-> self explosion-force)) (vector-normalize! (-> self explosion-force) (-> *BALLOONLURKER-bank* explosion-force)) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (let ((v1-16 (-> self mine arg0))) (set! (-> v1-16 enable) #t) (set-vector! (-> v1-16 transform scale) 0.0 0.0 0.0 1.0) @@ -900,23 +831,19 @@ ) (none) ) - :post - balloonlurker-post + :post balloonlurker-post ) ;; failed to figure out what this is: (defstate balloonlurker-die (balloonlurker) - :event - (the-as (function process int symbol event-message-block object :behavior balloonlurker) #f) - :enter - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior balloonlurker) #f) + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self vulnerable) #f) (set! (-> self dead) #t) (none) ) - :code - (behavior () + :code (behavior () (local-vars (v1-27 symbol) (sv-16 symbol) (sv-20 (pointer process-tree)) (sv-24 entity-actor)) (process-entity-status! self (entity-perm-status bit-4) #t) (process-entity-status! self (entity-perm-status dead) #t) @@ -957,10 +884,7 @@ (set! (-> self buoyancy-factor) (* 4.0 (-> self buoyancy-factor))) (until v1-27 (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (set! v1-27 (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 30)) (< 819200.0 (- (-> self root-overlay trans y) (-> self water-y))) ) @@ -972,8 +896,7 @@ ) (none) ) - :post - balloonlurker-post + :post balloonlurker-post ) ;; definition for method 7 of type balloonlurker @@ -999,8 +922,7 @@ ;; failed to figure out what this is: (defstate balloonlurker-pilot-idle (balloonlurker-pilot) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (send-event (ppointer->process (-> self parent-override)) 'die) @@ -1008,27 +930,17 @@ ) ) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) - (while #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! balloonlurker-pilot-idle-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (loop (suspend) - (let ((v1-9 (-> self skel root-channel 0))) - (set! (-> v1-9 num-func) num-func-identity) - (set! (-> v1-9 frame-num) (-> self parent-override 0 anim-frame)) - ) + (ja :num-func num-func-identity :frame-num (-> self parent-override 0 anim-frame)) ) (none) ) - :post - (behavior () + :post (behavior () (set! (-> self root-override trans quad) (-> self parent-override 0 root-overlay trans quad)) (quaternion-copy! (-> self root-override quat) (-> self parent-override 0 root-overlay quat)) (update-transforms! (-> self root-override)) @@ -1039,30 +951,21 @@ ;; failed to figure out what this is: (defstate balloonlurker-pilot-die (balloonlurker-pilot) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior balloonlurker-pilot) process-drawable-death-event-handler ) - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 203) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 203) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (TODO-RENAME-17 (-> self parent-override 0 rbody) @@ -1070,29 +973,16 @@ (-> self root-override transv) ) (clear-collide-with-as (-> self root-override)) - (ja-channel-push! 1 30) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! balloonlurker-pilot-death-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (cleanup-for-death self) (none) ) - :post - (behavior () + :post (behavior () (vector-v++! (-> self root-override transv) (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0) @@ -1264,17 +1154,12 @@ (set! (-> obj vulnerable) #t) (set! (-> obj dead) #f) (set! (-> obj explosion) #f) - (set! (-> obj propeller) - (the-as - joint-mod-set-local - (new 'process 'joint-mod-spinner obj 4 (new 'static 'vector :z -1.0 :w 1.0) 8192.0) - ) - ) + (set! (-> obj propeller) (new 'process 'joint-mod-spinner obj 4 (new 'static 'vector :z -1.0 :w 1.0) 8192.0)) (set! (-> obj rudder) (new 'process 'joint-mod-set-local obj 12 #f #t #f)) (set! (-> obj mine 0) (new 'process 'joint-mod-set-world obj 8 #f)) (set! (-> obj mine 1) (new 'process 'joint-mod-set-world obj 5 #f)) - (set! (-> obj stack 660) (the-as uint 10)) - (set! (-> obj stack 661) (the-as uint 7)) + (set! (-> obj explosion-joint-index-bytes 0) 10) + (set! (-> obj explosion-joint-index-bytes 1) 7) (set! (-> obj engine-sound-id) (new 'static 'sound-id)) (set! (-> obj pedal-sound-id) (new 'static 'sound-id)) (set! (-> obj player-force quad) (-> *null-vector* quad)) @@ -1299,15 +1184,7 @@ (return #f) ) (else - (let ((s5-1 (get-process *default-dead-pool* balloonlurker-pilot #x4000))) - (when s5-1 - (let ((t9-6 (method-of-type balloonlurker-pilot activate))) - (t9-6 (the-as balloonlurker-pilot s5-1) obj 'balloonlurker-pilot (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 balloonlurker-pilot-init-by-other obj) - (-> s5-1 ppointer) - ) - ) + (process-spawn balloonlurker-pilot obj :to obj) (go balloonlurker-patrol) ) ) diff --git a/test/decompiler/reference/levels/misty/bonelurker_REF.gc b/test/decompiler/reference/levels/misty/bonelurker_REF.gc index 9c0d936f20..4e6563cb35 100644 --- a/test/decompiler/reference/levels/misty/bonelurker_REF.gc +++ b/test/decompiler/reference/levels/misty/bonelurker_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/bonelurker-ag.gc") + ;; definition of type bonelurker (deftype bonelurker (nav-enemy) ((bump-player-time time-frame :offset-assert 400) @@ -24,14 +26,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *bonelurker-sg* bonelurker - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 2 0 6) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *bonelurker-sg* bonelurker bonelurker-lod0-jg bonelurker-idle-ja + ((bonelurker-lod0-mg (meters 20)) (bonelurker-lod1-mg (meters 40)) (bonelurker-lod2-mg (meters 999999))) + :bounds (static-spherem 0 2 0 6) + :shadow bonelurker-shadow-mg + ) ;; definition for function bonelurker-set-small-bounds-sphere ;; INFO: Return type mismatch int vs none. @@ -52,20 +51,19 @@ ;; definition for method 44 of type bonelurker ;; INFO: Return type mismatch symbol vs object. (defmethod dummy-44 bonelurker ((obj bonelurker) (arg0 process) (arg1 event-message-block)) - (the-as - object - (when (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) - ) - (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (set! (-> obj speed-scale) 0.5) - #t - ) - ) - ) + (the-as object (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) + ) + (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) + (set! (-> obj speed-scale) 0.5) + #t + ) + ) + ) ) ;; definition for method 43 of type bonelurker @@ -94,17 +92,7 @@ (-> obj collide-info) (the-as uint 2) ) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'shove) - (set! (-> a1-3 param 0) (-> arg1 param 0)) - (let ((v1-19 (new 'static 'attack-info :mask #x40))) - (set! (-> v1-19 shove-back) 16384.0) - (set! (-> a1-3 param 1) (the-as uint v1-19)) - ) - (send-event-function arg0 a1-3) - ) + (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) (go bonelurker-stun) #t ) @@ -122,19 +110,9 @@ (or (= v1-30 (-> obj draw art-group data 9)) (= v1-30 (-> obj draw art-group data 10))) ) ) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) pp) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'shove) - (set! (-> a1-6 param 0) (-> arg1 param 0)) - (let ((v1-36 (new 'static 'attack-info :mask #x40))) - (set! (-> v1-36 shove-back) 16384.0) - (set! (-> a1-6 param 1) (the-as uint v1-36)) - ) - (send-event-function arg0 a1-6) - ) + (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) (set! (-> obj bump-player-time) (-> *display* base-frame-counter)) - (set! (-> obj nav-enemy-flags) (logand -65 (-> obj nav-enemy-flags))) + (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) 'push ) ) @@ -168,11 +146,11 @@ nav-enemy-default-event-handler ;; definition for function bonelurker-push-post ;; Used lq/sq (defbehavior bonelurker-push-post bonelurker () - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (dummy-11 (-> self nav) (-> self nav target-pos)) - (TODO-RENAME-11 + (align-vel-and-quat-only! (-> self align) - 4 + (align-opts adjust-xz-vel) (-> self nav travel) (the-as int 1.0) 1.0 @@ -182,7 +160,7 @@ nav-enemy-default-event-handler (-> self collide-info transv) (compute-acc-due-to-gravity (-> self collide-info) (new-stack-vector0) 0.0) ) - (TODO-RENAME-10 (-> self align) 16 1.0 1.0 1.0) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) @@ -199,18 +177,15 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-idle (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :exit - (behavior () + :exit (behavior () (bonelurker-set-large-bounds-sphere) (none) ) - :code - (behavior () + :code (behavior () (bonelurker-set-small-bounds-sphere) ((the-as (function none :behavior bonelurker) (-> (method-of-type nav-enemy nav-enemy-idle) code))) (none) @@ -220,14 +195,12 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-patrol (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 60) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) ((the-as (function none :behavior bonelurker) (-> (method-of-type nav-enemy nav-enemy-patrol) code))) (none) ) @@ -236,172 +209,87 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-notice (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :code - (-> (method-of-type nav-enemy nav-enemy-notice) code) + :code (-> (method-of-type nav-enemy nav-enemy-notice) code) ) ;; failed to figure out what this is: (defstate nav-enemy-chase (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :trans - (behavior () + :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) - (if (and (zero? (logand (-> self nav-enemy-flags) 64)) + (if (and (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf6))) (>= (- (-> *display* base-frame-counter) (-> self bump-player-time)) (seconds 0.5)) ) - (logior! (-> self nav-enemy-flags) 64) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 524288.0) (set! (-> self turn-time) (seconds 0.1)) (set! (-> self speed-scale) 1.0) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 13) - ) - (ja-channel-push! 1 90) + ((ja-group? bonelurker-win-ja) + (ja-channel-push! 1 (seconds 0.3)) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 15) - ) - (ja-channel-push! 1 60) + ((ja-group? bonelurker-stun-ja) + (ja-channel-push! 1 (seconds 0.2)) ) (else - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) ) ) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) f30-0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! bonelurker-charge-left-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) f30-0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) f30-0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) + (ja :num! (seek! max f30-0)) ) + (ja-no-eval :group! bonelurker-charge-right-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) f30-0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) - (while #t + (loop (cond ((or (not *target*) (< 36864.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) f30-0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! bonelurker-charge-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) f30-0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (else - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-22 param 1) f30-0) - (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! bonelurker-charge-left-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) f30-0) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory) ) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-25 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-25 param 1) f30-0) - (set! (-> a0-25 frame-num) 0.0) - (joint-control-channel-group! a0-25 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! bonelurker-charge-right-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 param 0) (the float (+ (-> a0-26 frame-group data 0 length) -1))) - (set! (-> a0-26 param 1) f30-0) - (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory) ) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-28 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-28 param 1) f30-0) - (set! (-> a0-28 frame-num) 0.0) - (joint-control-channel-group! a0-28 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! bonelurker-charge-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1))) - (set! (-> a0-29 param 1) f30-0) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -414,105 +302,58 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-stop-chase (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :code - (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) + :code (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) ) ;; failed to figure out what this is: (defstate nav-enemy-stare (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 524288.0) (set! (-> self turn-time) (seconds 0.2)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) (when (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> gp-0 param 0) (ja-aframe 48.0 0)) - (set! (-> gp-0 param 1) f30-0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! bonelurker-win-ja :num! (seek! (ja-aframe 48.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 48.0 0)) - (set! (-> gp-1 param 1) f30-0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 48.0 0) f30-0)) ) ) - (while #t + (loop (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) - (ja-channel-push! 1 60) - (let ((v1-20 (-> self skel root-channel 0))) - (set! (-> v1-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - ) - (let ((v1-23 (-> self skel root-channel 0))) - (set! (-> v1-23 num-func) num-func-identity) - (set! (-> v1-23 frame-num) 0.0) - ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! bonelurker-turn-ja) + (ja :num-func num-func-identity :frame-num 0.0) (until (nav-enemy-facing-player? 1820.4445) (ja-blend-eval) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) - ) - (ja-channel-push! 1 75) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) f30-0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! bonelurker-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) f30-0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) 1.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim #f) num-func-loop!) + (ja :num! (seek! max f30-0)) ) + (ja-no-eval :num! (loop!)) (when (rand-vu-percent? 0.15) - (ja-channel-push! 1 30) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> gp-2 param 0) (ja-aframe 48.0 0)) - (set! (-> gp-2 param 1) f30-0) - (set! (-> gp-2 frame-num) 0.0) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! bonelurker-win-ja :num! (seek! (ja-aframe 48.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 48.0 0)) - (set! (-> gp-3 param 1) f30-0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 48.0 0) f30-0)) ) ) ) @@ -524,16 +365,14 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-give-up (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 524288.0) (set! (-> self turn-time) (seconds 0.1)) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) (let ((s4-0 (-> self collide-info)) (s5-0 (target-pos 0)) ) @@ -542,70 +381,26 @@ nav-enemy-default-event-handler ) 12743.111 ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! bonelurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! bonelurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! bonelurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! bonelurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek-to-point-toward-point! (-> self collide-info) @@ -614,11 +409,7 @@ nav-enemy-default-event-handler (-> self turn-time) ) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) (none) @@ -628,59 +419,40 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-victory (bonelurker) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bonelurker) nav-enemy-default-event-handler ) - :code - (-> (method-of-type nav-enemy nav-enemy-victory) code) + :code (-> (method-of-type nav-enemy nav-enemy-victory) code) ) ;; failed to figure out what this is: (defstate bonelurker-stun (bonelurker) - :event - bonelurker-stunned-event-handler - :enter - (behavior () + :event bonelurker-stunned-event-handler + :enter (behavior () (nav-enemy-neck-control-inactive) (none) ) - :exit - (behavior () + :exit (behavior () (nav-enemy-neck-control-look-at) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-normalize-copy! gp-0 (-> self hit-from-dir) 16384.0) (vector+! gp-0 (-> self collide-info trans) gp-0) (set! (-> self nav target-pos quad) (-> gp-0 quad)) ) - (ja-channel-push! 1 30) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 15)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! bonelurker-stun-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-chase) (none) ) - :post - bonelurker-push-post + :post bonelurker-push-post ) ;; definition for symbol *bonelurker-nav-enemy-info*, type nav-enemy-info @@ -732,7 +504,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #t :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc b/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc index c27f9d330f..a9fb874dfc 100644 --- a/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc @@ -1,6 +1,10 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/keg-conveyor-ag.gc") +(import "goal_src/import/keg-conveyor-paddle-ag.gc") +(import "goal_src/import/keg-ag.gc") + ;; failed to figure out what this is: (defpartgroup group-keg-bounce :id 197 @@ -8,14 +12,12 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2014 :fade-after (meters 100) :falloff-to (meters 100))) + :parts ((sp-item 2014 :fade-after (meters 100) :falloff-to (meters 100))) ) ;; failed to figure out what this is: (defpart 2014 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-x (meters -3) (meters 6) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -136,32 +138,23 @@ ) ;; failed to figure out what this is: -(defskelgroup *keg-conveyor-sg* keg-conveyor - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -6 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *keg-conveyor-sg* keg-conveyor keg-conveyor-lod0-jg keg-conveyor-idle-ja + ((keg-conveyor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -6 0 8) + ) ;; failed to figure out what this is: -(defskelgroup *keg-conveyor-paddle-sg* keg-conveyor-paddle - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -6 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *keg-conveyor-paddle-sg* keg-conveyor-paddle keg-conveyor-paddle-lod0-jg keg-conveyor-paddle-idle-ja + ((keg-conveyor-paddle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -6 0 8) + ) ;; failed to figure out what this is: -(defskelgroup *keg-sg* keg - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *keg-sg* keg keg-lod0-jg keg-idle-ja + ((keg-lod0-mg (meters 20)) (keg-lod1-mg (meters 40)) (keg-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow keg-shadow-mg + ) ;; definition for function keg-update-smush ;; INFO: Return type mismatch int vs none. @@ -177,41 +170,25 @@ ;; INFO: Return type mismatch none vs object. (defbehavior keg-event-handler keg ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) - (the-as - object - (when (or (= v1-0 'touch) (= v1-0 'attack)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (set! (-> a1-3 param 1) (the-as uint (new 'static 'attack-info))) - (when (send-event-function arg0 a1-3) - (sound-play-by-name (static-sound-name "icrate-break") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 71) - 20 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) - ) - (sound-stop (-> self sound-id)) - (deactivate self) + (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) + (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + (sound-play "icrate-break") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 71) + 20 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* + ) + (sound-stop (-> self sound-id)) + (deactivate self) + ) + ) ) - ) - ) - ) ) ) @@ -222,15 +199,7 @@ ) (else (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 163840.0) - (sound-play-by-name - (static-sound-name "barrel-roll") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "barrel-roll" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) ) ) @@ -239,22 +208,17 @@ ;; failed to figure out what this is: (defstate keg-on-paddle (keg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('detach) (go keg-paddle-to-path) ) ) ) - :code - (behavior () + :code (behavior () (set! (-> (the-as keg (-> self parent 0)) sync-offset) (the-as float (process->ppointer self))) - (let ((v1-3 (-> self skel root-channel 0))) - (set! (-> v1-3 num-func) num-func-identity) - (set! (-> v1-3 frame-num) 0.0) - ) - (while #t + (ja :num-func num-func-identity :frame-num 0.0) + (loop (let ((gp-0 (-> (the-as process-drawable (-> self parent 0)) node-list data 4))) (matrix->quaternion (-> self root-override quat) (-> gp-0 bone transform)) (vector<-cspace! (-> self root-override trans) gp-0) @@ -265,16 +229,13 @@ ) (none) ) - :post - (the-as (function none :behavior keg) keg-post) + :post (the-as (function none :behavior keg) keg-post) ) ;; failed to figure out what this is: (defstate keg-paddle-to-path (keg) - :event - keg-event-handler - :code - (behavior () + :event keg-event-handler + :code (behavior () (let ((gp-0 (new-stack-vector0))) (set! (-> gp-0 quad) (-> self root-override trans quad)) (let ((s5-0 @@ -288,7 +249,7 @@ 0.0 0.0 (forward-up-nopitch->quaternion s3-0 a1-3 (new 'static 'vector :y 1.0 :w 1.0)) - (while #t + (loop (if (>= (the float (- (-> *display* base-frame-counter) (-> self state-time))) f30-0) (go keg-on-path) ) @@ -297,26 +258,20 @@ (set! (-> self path-position quad) (-> self root-override trans quad)) (quaternion-slerp! (-> self root-override quat) s4-0 s3-0 f28-0) ) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) ) ) (none) ) - :post - (the-as (function none :behavior keg) keg-post) + :post (the-as (function none :behavior keg) keg-post) ) ;; failed to figure out what this is: (defstate keg-on-path (keg) - :event - keg-event-handler - :code - (behavior () + :event keg-event-handler + :code (behavior () (local-vars (sv-48 float) (sv-64 float) (sv-80 float) (sv-96 float) (sv-112 float)) (let ((gp-0 (new-stack-vector0)) (s5-0 (new 'stack 'vector3s)) @@ -336,7 +291,7 @@ (set! sv-48 0.0) (set! sv-64 0.0) (set! sv-80 (- (-> *standard-dynamics* gravity-length))) - (while #t + (loop (let ((f0-13 (+ (get-current-phase (-> (the-as keg-conveyor-paddle (-> self parent 0)) sync)) f26-1))) (set! sv-96 (- f0-13 (the float (the int f0-13)))) ) @@ -358,7 +313,7 @@ (cond ((>= (vector4-dot (camera-pos) (-> self shadow-enable-plane)) 0.0) (let ((v1-32 (-> self draw shadow-ctrl))) - (set! (-> v1-32 settings flags) (logand -33 (-> v1-32 settings flags))) + (logclear! (-> v1-32 settings flags) (shadow-flags disable-draw)) ) 0 (let ((v1-35 (-> self draw shadow-ctrl))) @@ -372,7 +327,7 @@ ) (else (let ((v1-41 (-> self draw shadow-ctrl))) - (logior! (-> v1-41 settings flags) 32) + (logior! (-> v1-41 settings flags) (shadow-flags disable-draw)) ) 0 (let ((v1-44 (-> self draw shadow-ctrl))) @@ -396,24 +351,17 @@ (set! sv-48 0.0) (activate! (-> self smush) -0.15 90 150 1.0 1.0) (set! sv-64 f24-0) - (sound-play-by-name (static-sound-name "barrel-bounce") (new-sound-id) 819 0 0 1 #t) - (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-1 - (let ((t9-12 (method-of-type part-tracker activate))) - (t9-12 (the-as part-tracker s4-1) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-1 - part-tracker-init - (-> *part-group-id-table* 197) - -1 - keg-bounce-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root-override trans) - ) - (-> s4-1 ppointer) - ) + (sound-play "barrel-bounce" :vol 80) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 197) + -1 + keg-bounce-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root-override trans) + :to self ) ) (let ((f0-39 (update! (-> self smush)))) @@ -424,10 +372,7 @@ (set! (-> s5-0 y) 1.0) (set! (-> s5-0 z) 0.0) ) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) ) @@ -437,16 +382,13 @@ ) (none) ) - :post - (the-as (function none :behavior keg) keg-post) + :post (the-as (function none :behavior keg) keg-post) ) ;; failed to figure out what this is: (defstate keg-in-chute (keg) - :event - keg-event-handler - :code - (behavior () + :event keg-event-handler + :code (behavior () (let ((gp-0 (TODO-RENAME-12 (-> (the-as process-drawable (-> self parent 0)) path) (new-stack-vector0) @@ -459,13 +401,13 @@ (f26-0 (- (-> *standard-dynamics* gravity-length))) ) (let ((v1-10 (-> self draw shadow-ctrl))) - (logior! (-> v1-10 settings flags) 32) + (logior! (-> v1-10 settings flags) (shadow-flags disable-draw)) ) 0 (clear-collide-with-as (-> self root-override)) (vector-normalize! gp-0 1.0) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (go keg-die) ) @@ -475,31 +417,24 @@ (+! f28-0 (* f26-0 (-> *display* seconds-per-frame))) (vector+! v1-23 v1-23 s5-0) ) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) ) (none) ) - :post - (the-as (function none :behavior keg) keg-post) + :post (the-as (function none :behavior keg) keg-post) ) ;; failed to figure out what this is: (defstate keg-die (keg) - :event - (the-as (function process int symbol event-message-block object :behavior keg) #f) - :code - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior keg) #f) + :code (behavior () (sound-stop (-> self sound-id)) (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior keg) transform-post) + :post (the-as (function none :behavior keg) transform-post) ) ;; definition for function keg-init-by-other @@ -529,7 +464,7 @@ (initialize-skeleton self *keg-sg* '()) (set! (-> self draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) (let ((v1-25 (-> self draw shadow-ctrl))) - (logior! (-> v1-25 settings flags) 32) + (logior! (-> v1-25 settings flags) (shadow-flags disable-draw)) ) 0 (let ((s5-1 (new 'static 'vector :x -514715.0 :y 226968.0 :z 3906894.8 :w 1.0))) @@ -558,64 +493,43 @@ ) ;; definition for function keg-conveyor-spawn-keg +;; INFO: Return type mismatch (pointer process) vs (pointer keg). (defun keg-conveyor-spawn-keg ((arg0 keg-conveyor)) - (let ((s5-0 (get-process *default-dead-pool* keg #x4000))) - (when s5-0 - (let ((t9-1 (method-of-type keg activate))) - (t9-1 (the-as keg s5-0) arg0 'keg (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 keg-init-by-other arg0 0) - (-> s5-0 ppointer) - ) - ) + (process-spawn keg arg0 0 :to arg0) ) ;; definition for function keg-conveyor-spawn-bouncing-keg +;; INFO: Return type mismatch (pointer process) vs (pointer keg). (defun keg-conveyor-spawn-bouncing-keg ((arg0 keg-conveyor)) - (let ((s5-0 (get-process *default-dead-pool* keg #x4000))) - (when s5-0 - (let ((t9-1 (method-of-type keg activate))) - (t9-1 (the-as keg s5-0) arg0 'keg (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 keg-init-by-other arg0 1) - (-> s5-0 ppointer) - ) - ) + (process-spawn keg arg0 1 :to arg0) ) ;; definition for symbol *keg-conveyor-keg-spawn-table*, type (array int8) -(define - *keg-conveyor-keg-spawn-table* - (the-as (array int8) (new 'static 'boxed-array :type int8 :length 6 :allocated-length 6 1 2 1 1 2 1)) +(define *keg-conveyor-keg-spawn-table* + (the-as (array int8) (new 'static 'boxed-array :type int8 1 2 1 1 2 1)) ) ;; failed to figure out what this is: (defstate keg-conveyor-idle (keg-conveyor) - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) 0.0) - ) + :code (behavior () + (ja :num-func num-func-identity :frame-num 0.0) 0.0 - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior keg-conveyor) ja-post) + :post (the-as (function none :behavior keg-conveyor) ja-post) ) ;; failed to figure out what this is: (defstate keg-conveyor-paddle-idle (keg-conveyor-paddle) - :code - (behavior () + :code (behavior () (let ((f30-0 57.0) (gp-0 0) (s5-0 (length *keg-conveyor-keg-spawn-table*)) ) - (while #t + (loop (let ((s4-0 #f)) (when (or (not *target*) (< 102400.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) @@ -641,32 +555,7 @@ (if (>= gp-0 s5-0) (set! gp-0 0) ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! - a0-6 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (not s4-0) (>= (ja-aframe-num 0) f30-0)) (set! s4-0 #t) @@ -690,19 +579,14 @@ ) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) ) (none) ) - :post - (the-as (function none :behavior keg-conveyor-paddle) transform-post) + :post (the-as (function none :behavior keg-conveyor-paddle) transform-post) ) ;; definition for function keg-conveyor-paddle-init-by-other @@ -780,15 +664,7 @@ ) (vector+! (-> obj root trans) (-> obj root trans) s5-1) ) - (let ((s5-2 (get-process *default-dead-pool* keg-conveyor-paddle #x4000))) - (when s5-2 - (let ((t9-11 (method-of-type keg-conveyor-paddle activate))) - (t9-11 (the-as keg-conveyor-paddle s5-2) obj 'keg-conveyor-paddle (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 keg-conveyor-paddle-init-by-other obj) - (-> s5-2 ppointer) - ) - ) + (process-spawn keg-conveyor-paddle obj :to obj) (go keg-conveyor-idle) (none) ) diff --git a/test/decompiler/reference/levels/misty/misty-obs_REF.gc b/test/decompiler/reference/levels/misty/misty-obs_REF.gc index cd81af3d69..e538664a10 100644 --- a/test/decompiler/reference/levels/misty/misty-obs_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-obs_REF.gc @@ -1,12 +1,20 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/breakaway-right-ag.gc") +(import "goal_src/import/boatpaddle-ag.gc") +(import "goal_src/import/breakaway-mid-ag.gc") +(import "goal_src/import/mis-bone-platform-ag.gc") +(import "goal_src/import/breakaway-left-ag.gc") +(import "goal_src/import/windturbine-ag.gc") +(import "goal_src/import/mistycam-ag.gc") +(import "goal_src/import/mis-bone-bridge-ag.gc") + ;; failed to figure out what this is: (defpartgroup group-windturbine-particles :id 191 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 908 :fade-after (meters 60) :period 1212 :length 10) + :parts ((sp-item 908 :fade-after (meters 60) :period 1212 :length 10) (sp-item 908 :fade-after (meters 60) :period 5790 :length 10) (sp-item 908 :fade-after (meters 60) :period 4988 :length 10) (sp-item 908 :fade-after (meters 60) :period 3510 :length 10) @@ -27,8 +35,7 @@ ;; failed to figure out what this is: (defpart 910 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.066 0.066 1.0) (sp-flt spt-x (meters -4)) (sp-rnd-flt spt-y (meters -2) (meters 0.5) 1.0) @@ -53,14 +60,12 @@ ;; failed to figure out what this is: (defpart 912 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 240) (sp-launcher-by-id spt-next-launcher 913)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 240) (sp-launcher-by-id spt-next-launcher 913)) ) ;; failed to figure out what this is: (defpart 913 - :init-specs - ((sp-flt spt-vel-x (meters -0.06666667)) + :init-specs ((sp-flt spt-vel-x (meters -0.06666667)) (sp-flt spt-vel-y (meters 0.0033333334)) (sp-flt spt-scalevel-x (meters 0.016666668)) (sp-copy-from-other spt-scalevel-y -4) @@ -71,8 +76,7 @@ ;; failed to figure out what this is: (defpart 911 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.066 0.066 1.0) (sp-flt spt-x (meters -4)) (sp-rnd-flt spt-y (meters -2) (meters 0.5) 1.0) @@ -97,8 +101,7 @@ ;; failed to figure out what this is: (defpart 908 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 8.0 24.0 1.0) (sp-flt spt-x (meters -4)) (sp-rnd-flt spt-y (meters -4.5) (meters 1) 1.0) @@ -126,8 +129,7 @@ ;; failed to figure out what this is: (defpart 909 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 8.0 24.0 1.0) (sp-flt spt-x (meters -4)) (sp-rnd-flt spt-y (meters -4.5) (meters 1) 1.0) @@ -159,8 +161,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 24) - :parts - ((sp-item 914 :period 780 :length 15) + :parts ((sp-item 914 :period 780 :length 15) (sp-item 915 :period 780 :length 15) (sp-item 916 :period 780 :length 64) (sp-item 917 :period 780 :length 32 :offset 65131) @@ -173,8 +174,7 @@ ;; failed to figure out what this is: (defpart 921 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -203,8 +203,7 @@ ;; failed to figure out what this is: (defpart 920 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-x (meters 2.5)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) @@ -232,8 +231,7 @@ ;; failed to figure out what this is: (defpart 919 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -262,8 +260,7 @@ ;; failed to figure out what this is: (defpart 918 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -293,14 +290,12 @@ ;; failed to figure out what this is: (defpart 922 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 917 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters -1) (meters 1.5) 1.0) (sp-rnd-flt spt-z (meters -5) (meters 10) 1.0) @@ -325,8 +320,7 @@ ;; failed to figure out what this is: (defpart 914 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) @@ -353,8 +347,7 @@ ;; failed to figure out what this is: (defpart 915 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.2) 1.0) @@ -381,14 +374,12 @@ ;; failed to figure out what this is: (defpart 923 - :init-specs - ((sp-flt spt-fade-a -3.2)) + :init-specs ((sp-flt spt-fade-a -3.2)) ) ;; failed to figure out what this is: (defpart 916 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -3.5) (meters 4.5) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 12) 1.0) @@ -416,8 +407,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 24) - :parts - ((sp-item 914 :period 780 :length 15) + :parts ((sp-item 914 :period 780 :length 15) (sp-item 915 :period 780 :length 15) (sp-item 924 :period 780 :length 64) (sp-item 925 :period 780 :length 32 :offset 65131) @@ -430,8 +420,7 @@ ;; failed to figure out what this is: (defpart 929 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -460,8 +449,7 @@ ;; failed to figure out what this is: (defpart 928 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-x (meters 2.5)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) @@ -489,8 +477,7 @@ ;; failed to figure out what this is: (defpart 927 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -519,8 +506,7 @@ ;; failed to figure out what this is: (defpart 926 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -550,8 +536,7 @@ ;; failed to figure out what this is: (defpart 925 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters -1) (meters 1.5) 1.0) (sp-rnd-flt spt-z (meters -5) (meters 10) 1.0) @@ -576,8 +561,7 @@ ;; failed to figure out what this is: (defpart 924 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -3.5) (meters 4.5) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 12) 1.0) @@ -605,8 +589,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 24) - :parts - ((sp-item 914 :period 780 :length 15) + :parts ((sp-item 914 :period 780 :length 15) (sp-item 915 :period 780 :length 15) (sp-item 930 :period 780 :length 64) (sp-item 931 :period 780 :length 32 :offset 65131) @@ -619,8 +602,7 @@ ;; failed to figure out what this is: (defpart 935 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -649,8 +631,7 @@ ;; failed to figure out what this is: (defpart 934 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-x (meters 2.5)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) @@ -678,8 +659,7 @@ ;; failed to figure out what this is: (defpart 933 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -708,8 +688,7 @@ ;; failed to figure out what this is: (defpart 932 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -739,8 +718,7 @@ ;; failed to figure out what this is: (defpart 931 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters -1) (meters 1.5) 1.0) (sp-rnd-flt spt-z (meters -5) (meters 10) 1.0) @@ -765,8 +743,7 @@ ;; failed to figure out what this is: (defpart 930 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -3.5) (meters 4.5) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 12) 1.0) @@ -794,8 +771,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 24) - :parts - ((sp-item 914 :period 780 :length 15) + :parts ((sp-item 914 :period 780 :length 15) (sp-item 915 :period 780 :length 15) (sp-item 936 :period 780 :length 64) (sp-item 937 :period 780 :length 32 :offset 65131) @@ -808,8 +784,7 @@ ;; failed to figure out what this is: (defpart 941 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -838,8 +813,7 @@ ;; failed to figure out what this is: (defpart 940 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-x (meters 2.5)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) @@ -867,8 +841,7 @@ ;; failed to figure out what this is: (defpart 939 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -897,8 +870,7 @@ ;; failed to figure out what this is: (defpart 938 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) @@ -928,8 +900,7 @@ ;; failed to figure out what this is: (defpart 937 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters -1) (meters 1.5) 1.0) (sp-rnd-flt spt-z (meters -5) (meters 10) 1.0) @@ -954,8 +925,7 @@ ;; failed to figure out what this is: (defpart 936 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -3.5) (meters 4.5) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 12) 1.0) @@ -981,14 +951,12 @@ (defpartgroup group-misty-boat-paddle :id 196 :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 944 :fade-after (meters 100))) + :parts ((sp-item 944 :fade-after (meters 100))) ) ;; failed to figure out what this is: (defpart 944 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-x (meters -11) (meters 22) 1.0) (sp-flt spt-y (meters 0)) @@ -1013,14 +981,12 @@ ;; failed to figure out what this is: (defpart 945 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) ;; failed to figure out what this is: (defpart 943 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-x (meters -9) (meters 18) 1.0) (sp-flt spt-scale-x (meters 0.5)) @@ -1046,14 +1012,12 @@ ;; failed to figure out what this is: (defpart 946 - :init-specs - ((sp-flt spt-fade-a -2.0)) + :init-specs ((sp-flt spt-fade-a -2.0)) ) ;; failed to figure out what this is: (defpart 942 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -11) (meters 22) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1079,14 +1043,12 @@ ;; failed to figure out what this is: (defpart 947 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 60) (sp-launcher-by-id spt-next-launcher 948)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 60) (sp-launcher-by-id spt-next-launcher 948)) ) ;; failed to figure out what this is: (defpart 948 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) ;; definition of type boatpaddle @@ -1110,20 +1072,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *boatpaddle-sg* boatpaddle - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 18) - :longest-edge (meters 0) - ) +(defskelgroup *boatpaddle-sg* boatpaddle boatpaddle-lod0-jg boatpaddle-idle-ja + ((boatpaddle-lod0-mg (meters 20)) (boatpaddle-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 18) + ) ;; failed to figure out what this is: (defstate boatpaddle-idle (boatpaddle) - :code - (behavior () + :code (behavior () (local-vars (s4-0 int)) - (while #t + (loop (quaternion-rotate-local-x! (-> self root quat) (-> self root quat) @@ -1135,17 +1093,7 @@ (let ((f30-0 1274.3112) (f28-0 (the float s4-0)) ) - (set! s4-0 (/ (the int (* 65536.0 (ja-frame-num 0))) (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) + (set! s4-0 (/ (the int (* 65536.0 (ja-frame-num 0))) (+ (-> (ja-group) data 0 length) -1))) (set! (-> *part-id-table* 943 init-specs 17 initial-valuef) (+ f30-0 (- f28-0 (* (the float (the int (/ (the float s4-0) 8192.0))) 8192.0))) ) @@ -1156,8 +1104,7 @@ ) (none) ) - :post - (the-as (function none :behavior boatpaddle) ja-post) + :post (the-as (function none :behavior boatpaddle) ja-post) ) ;; definition for method 11 of type boatpaddle @@ -1198,19 +1145,15 @@ ) ;; failed to figure out what this is: -(defskelgroup *windturbine-sg* windturbine - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 3 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *windturbine-sg* windturbine windturbine-lod0-jg windturbine-idle-ja + ((windturbine-lod0-mg (meters 20)) (windturbine-lod1-mg (meters 40)) (windturbine-lod2-mg (meters 999999))) + :bounds (static-spherem 0 3 0 7) + ) ;; failed to figure out what this is: (defstate windturbine-idle (windturbine) - :code - (behavior () - (while #t + :code (behavior () + (loop (let* ((a0-0 (-> self root trans)) (f2-0 (-> *wind-work* @@ -1234,8 +1177,7 @@ ) (none) ) - :post - (the-as (function none :behavior windturbine) ja-post) + :post (the-as (function none :behavior windturbine) ja-post) ) ;; definition for method 11 of type windturbine @@ -1287,13 +1229,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *mis-bone-bridge-sg* mis-bone-bridge - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 1 0 20) - :longest-edge (meters 0) - ) +(defskelgroup *mis-bone-bridge-sg* mis-bone-bridge mis-bone-bridge-lod0-jg mis-bone-bridge-idle-ja + ((mis-bone-bridge-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 20) + ) ;; definition for function mis-bone-bridge-event-handler ;; Used lq/sq @@ -1314,17 +1253,10 @@ ) (cond ((and (< 0.0 f1-1) (< (fabs (* 0.5 f0-3)) f1-1)) - (let ((a1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-9 from) self) - (set! (-> a1-9 num-params) 2) - (set! (-> a1-9 message) 'query) - (set! (-> a1-9 param 0) (the-as uint 'powerup)) - (set! (-> a1-9 param 1) (the-as uint 2)) - (if (send-event-function *target* a1-9) - (go mis-bone-bridge-fall #f) - (go mis-bone-bridge-hit) - ) - ) + (if (send-event *target* 'query 'powerup (pickup-type eco-red)) + (go mis-bone-bridge-fall #f) + (go mis-bone-bridge-hit) + ) ) (else (go mis-bone-bridge-bump) @@ -1340,15 +1272,10 @@ ;; failed to figure out what this is: (defstate mis-bone-bridge-idle (mis-bone-bridge) - :event - mis-bone-bridge-event-handler - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) 0.0) - ) - (while #t + :event mis-bone-bridge-event-handler + :code (behavior () + (ja :num-func num-func-identity :frame-num 0.0) + (loop (if (and *target* (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (level-hint-spawn (game-text-id misty-bone-bridge-hint) @@ -1362,144 +1289,77 @@ ) (none) ) - :post - (the-as (function none :behavior mis-bone-bridge) transform-post) + :post (the-as (function none :behavior mis-bone-bridge) transform-post) ) ;; failed to figure out what this is: (defstate mis-bone-bridge-bump (mis-bone-bridge) - :event - mis-bone-bridge-event-handler - :trans - (the-as (function none :behavior mis-bone-bridge) rider-trans) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + :event mis-bone-bridge-event-handler + :trans (the-as (function none :behavior mis-bone-bridge) rider-trans) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go mis-bone-bridge-idle) (none) ) - :post - (the-as (function none :behavior mis-bone-bridge) rider-post) + :post (the-as (function none :behavior mis-bone-bridge) rider-post) ) ;; failed to figure out what this is: (defstate mis-bone-bridge-hit (mis-bone-bridge) - :event - mis-bone-bridge-event-handler - :trans - (the-as (function none :behavior mis-bone-bridge) rider-trans) - :code - (behavior () + :event mis-bone-bridge-event-handler + :trans (the-as (function none :behavior mis-bone-bridge) rider-trans) + :code (behavior () (+! (-> self hit-points) -1) (if (zero? (-> self hit-points)) (go mis-bone-bridge-fall #f) ) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go mis-bone-bridge-idle) (none) ) - :post - (the-as (function none :behavior mis-bone-bridge) rider-post) + :post (the-as (function none :behavior mis-bone-bridge) rider-post) ) ;; failed to figure out what this is: (defstate mis-bone-bridge-fall (mis-bone-bridge) - :trans - (the-as (function none :behavior mis-bone-bridge) rider-trans) - :code - (behavior ((arg0 symbol)) + :trans (the-as (function none :behavior mis-bone-bridge) rider-trans) + :code (behavior ((arg0 symbol)) (process-entity-status! self (entity-perm-status complete) #t) (when (not arg0) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-2 (method-of-type part-tracker activate))) - (t9-2 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 part-tracker-init (-> self particle-group) -1 #f #f #f (-> self root-override trans)) - (-> gp-1 ppointer) - ) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self fall-anim-index)))) - (set! (-> a0-5 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self fall-anim-index))) data 0 length) -1) - ) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! - a0-5 - (the-as art-joint-anim (-> self draw art-group data (-> self fall-anim-index))) - num-func-seek! - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> self particle-group) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) + (ja-no-eval :group! (-> self draw art-group data (-> self fall-anim-index)) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data (-> self fall-anim-index))) - num-func-identity + (ja :group! (-> self draw art-group data (-> self fall-anim-index)) + :num! (identity (the float (+ (-> (ja-group) data 0 length) -1))) ) - (set! (-> gp-2 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior mis-bone-bridge) rider-post) + :post (the-as (function none :behavior mis-bone-bridge) rider-post) ) ;; definition for method 11 of type mis-bone-bridge @@ -1607,19 +1467,16 @@ ;; failed to figure out what this is: (defstate breakaway-idle (breakaway) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) (go breakaway-about-to-fall) ) ) ) - :code - (the-as (function none :behavior breakaway) anim-loop) - :post - (the-as (function none :behavior breakaway) transform-post) + :code (the-as (function none :behavior breakaway) anim-loop) + :post (the-as (function none :behavior breakaway) transform-post) ) ;; definition for function actor-wait-for-period @@ -1634,9 +1491,8 @@ ;; failed to figure out what this is: (defstate breakaway-about-to-fall (breakaway) - :code - (behavior () - (sound-play-by-name (static-sound-name "falling-bones") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (sound-play "falling-bones") (sp-launch-particles-var *sp-particle-system-2d* (-> *part-id-table* 281) @@ -1648,23 +1504,8 @@ (let ((gp-1 #f) (s5-1 (-> *display* base-frame-counter)) ) - (while #t - (let ((s4-0 (-> self skel root-channel 0))) - (set! (-> s4-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> s4-0 param 0) (ja-aframe 15.0 0)) - (set! (-> s4-0 param 1) 1.0) - (set! (-> s4-0 frame-num) (ja-aframe 1.0 0)) - (joint-control-channel-group! - s4-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 15.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (when (and (not gp-1) (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.15))) (set! gp-1 #t) @@ -1674,61 +1515,35 @@ (go breakaway-fall) ) (suspend) - (let ((s4-1 (-> self skel root-channel 0))) - (set! (-> s4-1 param 0) (ja-aframe 15.0 0)) - (set! (-> s4-1 param 1) 1.0) - (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 15.0 0))) ) ) ) (none) ) - :post - (the-as (function none :behavior breakaway) rider-post) + :post (the-as (function none :behavior breakaway) rider-post) ) ;; failed to figure out what this is: (defstate breakaway-fall (breakaway) - :code - (behavior () + :code (behavior () (let ((f30-0 0.0) (f28-0 0.0) (f26-0 (* 0.1 (- (-> *standard-dynamics* gravity-length)))) ) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> gp-0 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-0 param 1) 0.4) - (set! (-> gp-0 frame-num) (ja-aframe 16.0 0)) - (joint-control-channel-group! - gp-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 32.0 0) 0.4) :frame-num (ja-aframe 16.0 0)) (until (ja-done? 0) (+! f30-0 (* f28-0 (-> *display* seconds-per-frame))) (+! f28-0 (* f26-0 (-> *display* seconds-per-frame))) (+! (-> self root-override trans y) f30-0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-1 param 1) 0.4) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 32.0 0) 0.4)) ) ) (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior breakaway) rider-post) + :post (the-as (function none :behavior breakaway) rider-post) ) ;; definition for method 20 of type breakaway @@ -1818,31 +1633,22 @@ ) ;; failed to figure out what this is: -(defskelgroup *breakaway-right-sg* breakaway-right - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *breakaway-right-sg* breakaway-right breakaway-right-lod0-jg breakaway-right-idle-ja + ((breakaway-right-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + ) ;; failed to figure out what this is: -(defskelgroup *breakaway-mid-sg* breakaway-mid - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *breakaway-mid-sg* breakaway-mid breakaway-mid-lod0-jg breakaway-mid-idle-ja + ((breakaway-mid-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + ) ;; failed to figure out what this is: -(defskelgroup *breakaway-left-sg* breakaway-left - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *breakaway-left-sg* breakaway-left breakaway-left-lod0-jg breakaway-left-idle-ja + ((breakaway-left-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + ) ;; definition for method 11 of type breakaway-right (defmethod init-from-entity! breakaway-right ((obj breakaway-right) (arg0 entity-actor)) @@ -1916,13 +1722,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *mis-bone-platform-sg* mis-bone-platform - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *mis-bone-platform-sg* mis-bone-platform mis-bone-platform-lod0-jg mis-bone-platform-idle-ja + ((mis-bone-platform-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; definition for method 27 of type bone-platform ;; INFO: Return type mismatch int vs none. @@ -1958,32 +1761,27 @@ ;; failed to figure out what this is: (defstate rigid-body-platform-idle (bone-platform) :virtual #t - :enter - (behavior () + :enter (behavior () (ja-channel-set! 0) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior bone-platform) ja-post) + :post (the-as (function none :behavior bone-platform) ja-post) ) ;; failed to figure out what this is: (defstate rigid-body-platform-float (bone-platform) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior bone-platform) rigid-body-platform-event-handler ) - :trans - (behavior () + :trans (behavior () (-> self entity extra trans y) (cond ((or (not *target*) (< (-> self info idle-distance) @@ -1991,39 +1789,28 @@ ) ) (let ((f30-1 -4096.0)) - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) (if (= (-> self float-height-offset) f30-1) (go-virtual rigid-body-platform-idle) ) ) ) (else - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) ) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) - (while #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 2)) + (ja :num-func num-func-identity :frame-num 0.0) + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior bone-platform) rigid-body-platform-post) + :post (the-as (function none :behavior bone-platform) rigid-body-platform-post) ) ;; definition for method 30 of type bone-platform @@ -2121,13 +1908,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *mistycam-sg* mistycam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 20) - :longest-edge (meters 0) - ) +(defskelgroup *mistycam-sg* mistycam mistycam-lod0-jg mistycam-anim-ja + ((mistycam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) ;; definition for function mistycam-spawn ;; INFO: Return type mismatch int vs none. @@ -2135,38 +1919,23 @@ (with-pp (let ((gp-0 (entity-actor-lookup (-> pp entity) 'alt-actor 0))) (when gp-0 - (let* ((s5-0 (get-process *default-dead-pool* pov-camera #x4000)) - (gp-1 - (ppointer->handle - (when s5-0 - (let ((t9-2 (method-of-type pov-camera activate))) - (t9-2 (the-as pov-camera s5-0) pp 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> gp-0 extra trans) - *mistycam-sg* - (new 'static 'spool-anim :name "mistycam-cannon" :index 5 :parts 1 :command-list '()) - 0 - #f - '() - ) - (-> s5-0 ppointer) - ) - ) - ) - (s5-1 (get-process *default-dead-pool* fuel-cell #x4000)) - (s5-2 - (ppointer->handle (when s5-1 - (let ((t9-5 (method-of-type fuel-cell activate))) - (t9-5 (the-as fuel-cell s5-1) pp 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 fuel-cell-init-as-clone gp-1 (-> pp entity extra perm task)) - (-> s5-1 ppointer) + (let* ((gp-1 + (ppointer->handle (process-spawn + pov-camera + (-> gp-0 extra trans) + *mistycam-sg* + (new 'static 'spool-anim :name "mistycam-cannon" :index 5 :parts 1 :command-list '()) + 0 + #f + '() + :to pp ) ) ) + (s5-2 (ppointer->handle + (process-spawn fuel-cell :init fuel-cell-init-as-clone gp-1 (-> pp entity extra perm task) :to pp) + ) + ) ) (let ((v1-13 (handle->process gp-1))) (if v1-13 @@ -2205,21 +1974,12 @@ ;; failed to figure out what this is: (defstate battlecontroller-play-intro-camera (misty-battlecontroller) :virtual #t - :code - (behavior () - (let* ((gp-0 (get-process *default-dead-pool* pov-camera #x4000)) - (gp-1 - (ppointer->handle - (when gp-0 - (let ((t9-1 (method-of-type pov-camera activate))) - (t9-1 (the-as pov-camera gp-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 pov-camera-init-by-other (-> self root trans) *mistycam-sg* "lurkerattack" 0 #f '()) - (-> gp-0 ppointer) - ) - ) - ) - ) + :code (behavior () + (let ((gp-1 (ppointer->handle + (process-spawn pov-camera (-> self root trans) *mistycam-sg* "lurkerattack" 0 #f '() :to self) + ) + ) + ) (while (handle->process (the-as handle gp-1)) (suspend) ) @@ -2307,8 +2067,7 @@ ;; failed to figure out what this is: (defstate boat-fuelcell-idle (boat-fuelcell) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('task-complete) (set! (-> self play-cutscene?) #t) @@ -2317,42 +2076,25 @@ ) ) ) - :code - (the-as (function none :behavior boat-fuelcell) anim-loop) + :code (the-as (function none :behavior boat-fuelcell) anim-loop) ) ;; failed to figure out what this is: (defstate boat-fuelcell-spawn (boat-fuelcell) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior boat-fuelcell) process-drawable-fuel-cell-handler ) - :code - (behavior () + :code (behavior () (process-drawable-birth-fuel-cell (the-as entity #f) (the-as vector #f) #f) (when (and *target* (-> self play-cutscene?)) (ambient-hint-spawn "gamcam02" (the-as vector #f) *entity-pool* 'camera) - (let* ((gp-0 (get-process *default-dead-pool* pov-camera #x4000)) - (gp-1 (ppointer->handle (when gp-0 - (let ((t9-3 (method-of-type pov-camera activate))) - (t9-3 (the-as pov-camera gp-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> self root trans) - *mistycam-sg* - "mistycam-balloon-fuel-cell" - 0 - #f - '() - ) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 + (ppointer->handle + (process-spawn pov-camera (-> self root trans) *mistycam-sg* "mistycam-balloon-fuel-cell" 0 #f '() :to self) + ) + ) + ) (while (handle->process (the-as handle gp-1)) (suspend) ) @@ -2368,8 +2110,7 @@ ;; failed to figure out what this is: (defstate boat-fuelcell-die (boat-fuelcell) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (none) ) diff --git a/test/decompiler/reference/levels/misty/misty-part_REF.gc b/test/decompiler/reference/levels/misty/misty-part_REF.gc index 67207b7b1b..8906a25e28 100644 --- a/test/decompiler/reference/levels/misty/misty-part_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-part_REF.gc @@ -20,8 +20,7 @@ ;; failed to figure out what this is: (defpart 972 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 1)) @@ -48,8 +47,7 @@ ;; failed to figure out what this is: (defpart 973 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 3.0 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 1)) @@ -78,8 +76,7 @@ (defpartgroup group-misty-ship-steam :id 205 :bounds (static-bspherem 0 0.5 0 4.5) - :parts - ((sp-item 972 :fade-after (meters 175) :falloff-to (meters 175) :period 1500 :length 300) + :parts ((sp-item 972 :fade-after (meters 175) :falloff-to (meters 175) :period 1500 :length 300) (sp-item 972 :fade-after (meters 175) :falloff-to (meters 175) :period 2928 :length 360) (sp-item 972 :fade-after (meters 175) :falloff-to (meters 175) :period 4602 :length 180) (sp-item 973 :fade-after (meters 125) :falloff-to (meters 125) :period 180 :length 45) @@ -90,8 +87,7 @@ (defpartgroup group-part-misty-torch :id 206 :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 974 :fade-after (meters 180) :falloff-to (meters 200)) + :parts ((sp-item 974 :fade-after (meters 180) :falloff-to (meters 200)) (sp-item 975 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 976 :fade-after (meters 50) :falloff-to (meters 50) :period 600 :length 90) (sp-item 977 :fade-after (meters 50) :falloff-to (meters 50) :period 369 :length 69) @@ -102,8 +98,7 @@ ;; failed to figure out what this is: (defpart 979 - :init-specs - ((sp-flt spt-num 0.3) + :init-specs ((sp-flt spt-num 0.3) (sp-flt spt-x (meters 0.2)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-int spt-rot-x 5) @@ -122,14 +117,12 @@ ;; failed to figure out what this is: (defpart 980 - :init-specs - ((sp-flt spt-fade-b -6.826667)) + :init-specs ((sp-flt spt-fade-b -6.826667)) ) ;; failed to figure out what this is: (defpart 974 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1069547520 1 1.0) (sp-rnd-flt spt-x (meters -0.35) (meters 0.7) 1.0) (sp-rnd-flt spt-z (meters -0.35) (meters 0.7) 1.0) @@ -152,14 +145,12 @@ ;; failed to figure out what this is: (defpart 981 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) ;; failed to figure out what this is: (defpart 976 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters 1)) @@ -183,8 +174,7 @@ ;; failed to figure out what this is: (defpart 977 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.2) (meters 0.6) 1.0) (sp-flt spt-y (meters 0.5)) @@ -208,8 +198,7 @@ ;; failed to figure out what this is: (defpart 978 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 0.2) 1.0) (sp-flt spt-y (meters 0.6)) @@ -233,8 +222,7 @@ ;; failed to figure out what this is: (defpart 975 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.3)) @@ -268,14 +256,12 @@ (defpartgroup group-misty-fog :id 207 :bounds (static-bspherem 64 7 0 96) - :parts - ((sp-item 982 :flags (is-3d))) + :parts ((sp-item 982 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 982 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x7 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7 :page #x2)) (sp-flt spt-num 0.06125) (sp-rnd-flt spt-x (meters 0) (meters 128) 1.0) (sp-rnd-flt spt-y (meters 5.5) (meters 1.5) 1.0) @@ -304,8 +290,7 @@ ;; failed to figure out what this is: (defpart 983 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 1200 299 1) (sp-launcher-by-id spt-next-launcher 984) ) @@ -313,22 +298,19 @@ ;; failed to figure out what this is: (defpart 984 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: (defpartgroup group-misty-lurkermachine-vent-316 :id 208 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 985 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 985 :fade-after (meters 80) :falloff-to (meters 80))) ) ;; failed to figure out what this is: (defpart 985 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -361,14 +343,12 @@ (defpartgroup group-misty-lurkermachine-vent-313 :id 209 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 986 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 986 :fade-after (meters 80) :falloff-to (meters 80))) ) ;; failed to figure out what this is: (defpart 986 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -401,14 +381,12 @@ (defpartgroup group-misty-lurkermachine-vent-308 :id 210 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 987 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 987 :fade-after (meters 80) :falloff-to (meters 80))) ) ;; failed to figure out what this is: (defpart 987 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -441,14 +419,12 @@ (defpartgroup group-misty-lurkermachine-vent-307 :id 211 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 988 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 988 :fade-after (meters 80) :falloff-to (meters 80))) ) ;; failed to figure out what this is: (defpart 988 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -481,14 +457,12 @@ (defpartgroup group-misty-lurkermachine-vent-305 :id 212 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 989 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 989 :fade-after (meters 80) :falloff-to (meters 80))) ) ;; failed to figure out what this is: (defpart 989 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -521,14 +495,12 @@ (defpartgroup group-misty-lurkermachine-vent-309 :id 213 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 990 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 990 :fade-after (meters 80) :falloff-to (meters 80))) ) ;; failed to figure out what this is: (defpart 990 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -561,14 +533,12 @@ (defpartgroup group-misty-lurkermachine-vent-2 :id 214 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 991 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 991 :fade-after (meters 80) :falloff-to (meters 80))) ) ;; failed to figure out what this is: (defpart 991 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -601,14 +571,12 @@ (defpartgroup group-misty-lurkermachine-vent-328 :id 215 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 992 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 992 :fade-after (meters 80) :falloff-to (meters 80))) ) ;; failed to figure out what this is: (defpart 992 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -641,14 +609,12 @@ (defpartgroup group-misty-lurkermachine-vent-325 :id 216 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 993 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 993 :fade-after (meters 80) :falloff-to (meters 80))) ) ;; failed to figure out what this is: (defpart 993 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -0.8) (meters 1.6) 1.0) (sp-rnd-flt spt-y (meters -0.3) (meters 0.6) 1.0) @@ -681,14 +647,12 @@ (defpartgroup group-misty-lurkermachine-vent-320 :id 217 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 994 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 994 :fade-after (meters 80) :falloff-to (meters 80))) ) ;; failed to figure out what this is: (defpart 994 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -0.8) (meters 1.6) 1.0) (sp-rnd-flt spt-y (meters -0.3) (meters 0.6) 1.0) @@ -721,14 +685,12 @@ (defpartgroup group-misty-lurkermachine-vent-324 :id 218 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 995 :fade-after (meters 80) :falloff-to (meters 80))) + :parts ((sp-item 995 :fade-after (meters 80) :falloff-to (meters 80))) ) ;; failed to figure out what this is: (defpart 995 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.45 0.8 1.0) (sp-rnd-flt spt-x (meters -0.8) (meters 1.6) 1.0) (sp-rnd-flt spt-y (meters -0.3) (meters 0.6) 1.0) @@ -761,8 +723,7 @@ (defpartgroup group-misty-fort-steam :id 219 :bounds (static-bspherem 0 0.5 0 4.5) - :parts - ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1500 :length 300) + :parts ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1500 :length 300) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 2928 :length 360) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 4602 :length 180) (sp-item 997 :fade-after (meters 125) :falloff-to (meters 125) :period 180 :length 45) @@ -773,8 +734,7 @@ (defpartgroup group-misty-fort-steam2 :id 220 :bounds (static-bspherem 0 0.5 0 4.5) - :parts - ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1230 :length 300) + :parts ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1230 :length 300) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 2550 :length 360) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 6102 :length 180) (sp-item 997 :fade-after (meters 125) :falloff-to (meters 125) :period 210 :length 45) @@ -785,8 +745,7 @@ (defpartgroup group-misty-fort-steam3 :id 221 :bounds (static-bspherem 0 0.5 0 4.5) - :parts - ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1800 :length 300) + :parts ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1800 :length 300) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 2559 :length 360) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 5202 :length 180) (sp-item 997 :fade-after (meters 125) :falloff-to (meters 125) :period 240 :length 45) @@ -797,8 +756,7 @@ (defpartgroup group-misty-fort-steam4 :id 222 :bounds (static-bspherem 0 0.5 0 4.5) - :parts - ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1560 :length 300) + :parts ((sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 1560 :length 300) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 2601 :length 360) (sp-item 996 :fade-after (meters 175) :falloff-to (meters 175) :period 4848 :length 180) (sp-item 997 :fade-after (meters 125) :falloff-to (meters 125) :period 270 :length 45) @@ -807,8 +765,7 @@ ;; failed to figure out what this is: (defpart 996 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.6 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 1)) @@ -835,8 +792,7 @@ ;; failed to figure out what this is: (defpart 997 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-flt spt-y (meters 0)) (sp-flt spt-scale-x (meters 1)) @@ -865,8 +821,7 @@ (defpartgroup group-misty-lurkermachine-spout-314 :id 223 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 998 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) + :parts ((sp-item 998 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) (sp-item 998 :fade-after (meters 100) :falloff-to (meters 120) :period 770 :length 96) (sp-item 998 :fade-after (meters 140) :falloff-to (meters 160) :period 936 :length 60) (sp-item 999 :fade-after (meters 100) :falloff-to (meters 100)) @@ -875,8 +830,7 @@ ;; failed to figure out what this is: (defpart 999 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -898,17 +852,9 @@ ;; failed to figure out what this is: (defpart 998 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.6 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "steam-release") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "steam-release" :num 0.05 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -933,8 +879,7 @@ (defpartgroup group-misty-lurkermachine-spout-310 :id 224 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1000 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) + :parts ((sp-item 1000 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) (sp-item 1000 :fade-after (meters 100) :falloff-to (meters 120) :period 770 :length 96) (sp-item 1000 :fade-after (meters 140) :falloff-to (meters 160) :period 936 :length 60) (sp-item 1001 :fade-after (meters 100) :falloff-to (meters 100)) @@ -943,8 +888,7 @@ ;; failed to figure out what this is: (defpart 1001 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -967,17 +911,9 @@ ;; failed to figure out what this is: (defpart 1000 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.6 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "steam-release") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "steam-release" :num 0.05 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1003,8 +939,7 @@ (defpartgroup group-misty-lurkermachine-spout-311 :id 225 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1002 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) + :parts ((sp-item 1002 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) (sp-item 1002 :fade-after (meters 100) :falloff-to (meters 120) :period 770 :length 96) (sp-item 1002 :fade-after (meters 140) :falloff-to (meters 160) :period 936 :length 60) (sp-item 1003 :fade-after (meters 100) :falloff-to (meters 100)) @@ -1013,8 +948,7 @@ ;; failed to figure out what this is: (defpart 1003 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1037,17 +971,9 @@ ;; failed to figure out what this is: (defpart 1002 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.6 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "steam-release") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "steam-release" :num 0.05 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1073,8 +999,7 @@ (defpartgroup group-misty-lurkermachine-spout-312 :id 226 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1004 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) + :parts ((sp-item 1004 :fade-after (meters 100) :falloff-to (meters 120) :period 1260 :length 75) (sp-item 1004 :fade-after (meters 100) :falloff-to (meters 120) :period 770 :length 96) (sp-item 1004 :fade-after (meters 140) :falloff-to (meters 160) :period 936 :length 60) (sp-item 1005 :fade-after (meters 100) :falloff-to (meters 100)) @@ -1083,8 +1008,7 @@ ;; failed to figure out what this is: (defpart 1005 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1107,17 +1031,9 @@ ;; failed to figure out what this is: (defpart 1004 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.6 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "steam-release") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "steam-release" :num 0.05 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) diff --git a/test/decompiler/reference/levels/misty/misty-teetertotter_REF.gc b/test/decompiler/reference/levels/misty/misty-teetertotter_REF.gc index e39fb2fd78..c067b59d0f 100644 --- a/test/decompiler/reference/levels/misty/misty-teetertotter_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-teetertotter_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/teetertotter-ag.gc") + ;; definition of type teetertotter (deftype teetertotter (process-drawable) ((launched-player basic :offset-assert 176) @@ -30,13 +32,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *teetertotter-sg* teetertotter - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *teetertotter-sg* teetertotter teetertotter-lod0-jg teetertotter-idle-ja + ((teetertotter-lod0-mg (meters 20)) (teetertotter-lod1-mg (meters 40)) (teetertotter-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; definition for function target-on-end-of-teetertotter? ;; Used lq/sq @@ -50,8 +49,7 @@ ;; failed to figure out what this is: (defstate teetertotter-idle (teetertotter) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (case (-> arg3 param 1) @@ -78,93 +76,58 @@ ) ) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + :code (behavior () + (ja :group! (-> self draw art-group data 4) :num! min) + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior teetertotter) transform-post) + :post (the-as (function none :behavior teetertotter) transform-post) ) ;; failed to figure out what this is: (defstate teetertotter-launch (teetertotter) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (the-as object (when (= arg2 'touch) - (when (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root)) - (the-as uint 1) - ) - (-> self rock-is-dangerous) - ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (let ((a0-2 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-2 mode) 'deadly) - (set! (-> a1-2 param 1) (the-as uint a0-2)) - ) - (send-event-function arg0 a1-2) - ) - ) - (when (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root)) - (the-as uint 2) - ) - (target-on-end-of-teetertotter? self) - (not (-> self launched-player)) - (-> self in-launch-window) - ) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'shove) - (set! (-> a1-4 param 0) (the-as uint #f)) - (let ((v1-16 (new 'static 'attack-info :mask #xcc0))) - (set! (-> v1-16 shove-back) 0.0) - (set! (-> v1-16 shove-up) 53248.0) - (set! (-> v1-16 angle) 'jump) - (set! (-> v1-16 control) 1.0) - (set! (-> a1-4 param 1) (the-as uint v1-16)) - ) - (when (send-event-function arg0 a1-4) - (let ((v0-0 #t)) - (set! (-> self launched-player) v0-0) - v0-0 - ) - ) - ) - ) - ) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (the-as + object + (when (= arg2 'touch) + (if (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root)) + (the-as uint 1) + ) + (-> self rock-is-dangerous) + ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'deadly)))) ) - ) - :code - (behavior () - (set! (-> self launched-player) #f) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) + (when (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root)) + (the-as uint 2) + ) + (target-on-end-of-teetertotter? self) + (not (-> self launched-player)) + (-> self in-launch-window) + ) + (when (send-event + arg0 + 'shove + #f + (static-attack-info ((shove-back (meters 0)) (shove-up (meters 13)) (angle 'jump) (control 1.0))) + ) + (let ((v0-0 #t)) + (set! (-> self launched-player) v0-0) + v0-0 + ) ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + ) + ) ) + ) + :code (behavior () + (set! (-> self launched-player) #f) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f0-4 (ja-aframe-num 0))) (set! (-> self in-launch-window) (and (>= f0-4 76.0) (>= 82.0 f0-4))) @@ -173,45 +136,26 @@ ) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go teetertotter-idle) (none) ) - :post - (the-as (function none :behavior teetertotter) rider-post) + :post (the-as (function none :behavior teetertotter) rider-post) ) ;; failed to figure out what this is: (defstate teetertotter-bend (teetertotter) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go teetertotter-idle) (none) ) - :post - (the-as (function none :behavior teetertotter) rider-post) + :post (the-as (function none :behavior teetertotter) rider-post) ) ;; definition for method 11 of type teetertotter diff --git a/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc b/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc index abd526d122..4baf00f137 100644 --- a/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc @@ -1,6 +1,9 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/silostep-ag.gc") +(import "goal_src/import/rounddoor-ag.gc") + ;; definition of type silostep (deftype silostep (process-drawable) ((anim-limit float :offset-assert 176) @@ -28,18 +31,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *silostep-sg* silostep - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *silostep-sg* silostep silostep-lod0-jg silostep-idle-ja + ((silostep-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 8) + ) ;; failed to figure out what this is: (defstate silostep-idle (silostep) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go silostep-camera) @@ -49,68 +48,51 @@ ) ) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 2) :num! min) (transform-post) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior silostep) ja-post) + :post (the-as (function none :behavior silostep) ja-post) ) ;; definition for function misty-camera-view ;; INFO: Return type mismatch int vs none. (defbehavior misty-camera-view silostep () - (let ((gp-0 (get-process *default-dead-pool* camera-tracker #x4000))) - (set! (-> self cam-tracker) - (ppointer->handle (when gp-0 - (let ((t9-1 (method-of-type camera-tracker activate))) - (t9-1 (the-as camera-tracker gp-0) self 'camera-tracker (the-as pointer #x70004000)) + (set! (-> self cam-tracker) + (ppointer->handle (process-spawn + camera-tracker + :init camera-tracker-init + (lambda :behavior camera-tracker + () + (while (not (process-grab? *target*)) + (suspend) ) - (run-now-in-process - gp-0 - camera-tracker-init - (lambda :behavior camera-tracker - () - (while (not (process-grab? *target*)) - (suspend) - ) - (camera-change-to "camera-160" 150 #f) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 3)) - (suspend) - ) - ) - (while (not (process-release? (handle->process (-> self grab-target)))) - (suspend) - ) - (camera-change-to (the-as string 'base) 150 #f) - (none) + (camera-change-to "camera-160" 150 #f) + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 3)) + (suspend) ) ) - (-> gp-0 ppointer) + (while (not (process-release? (handle->process (-> self grab-target)))) + (suspend) + ) + (camera-change-to (the-as string 'base) 150 #f) + (none) ) + :to self ) - ) - ) + ) + ) (none) ) ;; failed to figure out what this is: (defstate silostep-camera (silostep) - :code - (behavior () + :code (behavior () (misty-camera-view) (let* ((gp-0 (get-task-control (game-task misty-warehouse))) (v1-1 (get-reminder gp-0 0)) @@ -123,56 +105,36 @@ (suspend) ) ) - (sound-play-by-name (static-sound-name "arena-steps") (new-sound-id) 1024 0 0 1 #t) + (sound-play "arena-steps") (send-to-all-after (-> self link) 'trigger-rise) (go silostep-rise #f) (none) ) - :post - (the-as (function none :behavior silostep) ja-post) + :post (the-as (function none :behavior silostep) ja-post) ) ;; failed to figure out what this is: (defstate silostep-rise (silostep) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (process-entity-status! self (entity-perm-status complete) #t) (when (not arg0) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-2 param 0) (-> self anim-limit)) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! (-> self anim-limit)) :frame-num 0.0) (until (ja-done? 0) (rider-trans) (rider-post) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (-> self anim-limit)) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (-> self anim-limit))) ) ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-1 frame-num) (-> self anim-limit)) - ) + (ja :group! (-> self draw art-group data 2) :num! (identity (-> self anim-limit))) (rider-post) - (while #t + (loop (ja-post) (suspend) ) (none) ) - :post - (the-as (function none :behavior silostep) #f) + :post (the-as (function none :behavior silostep) #f) ) ;; definition for method 11 of type silostep @@ -215,13 +177,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *rounddoor-sg* rounddoor - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *rounddoor-sg* rounddoor rounddoor-lod0-jg rounddoor-idle-ja + ((rounddoor-lod0-mg (meters 20)) (rounddoor-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; definition of type rounddoor (deftype rounddoor (eco-door) diff --git a/test/decompiler/reference/levels/misty/mistycannon_REF.gc b/test/decompiler/reference/levels/misty/mistycannon_REF.gc index 44f4914c24..64441cdb5d 100644 --- a/test/decompiler/reference/levels/misty/mistycannon_REF.gc +++ b/test/decompiler/reference/levels/misty/mistycannon_REF.gc @@ -1,6 +1,9 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/sack-ag.gc") +(import "goal_src/import/mistycannon-ag.gc") + ;; definition of type angle-tracker (deftype angle-tracker (structure) ((value float :offset-assert 0) @@ -155,8 +158,7 @@ (defpartgroup group-beach-sack-fuse :id 117 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 517 :fade-after (meters 30)) + :parts ((sp-item 517 :fade-after (meters 30)) (sp-item 518 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 519 :fade-after (meters 80) :falloff-to (meters 80)) ) @@ -164,8 +166,7 @@ ;; failed to figure out what this is: (defpart 517 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-scale-x (meters 0.1)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -187,8 +188,7 @@ ;; failed to figure out what this is: (defpart 518 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.25) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -204,8 +204,7 @@ ;; failed to figure out what this is: (defpart 519 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-scale-x (meters 0.2)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -231,8 +230,7 @@ :id 118 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 520 :period 1200 :length 30) + :parts ((sp-item 520 :period 1200 :length 30) (sp-item 521 :fade-after (meters 60) :period 1200 :length 15) (sp-item 522 :period 1200 :length 15 :offset 15) (sp-item 523 :period 1200 :length 15) @@ -258,8 +256,7 @@ ;; failed to figure out what this is: (defpart 520 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-y (meters 0.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -287,14 +284,12 @@ ;; failed to figure out what this is: (defpart 526 - :init-specs - ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.32)) + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.32)) ) ;; failed to figure out what this is: (defpart 521 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0.75)) (sp-rnd-flt spt-scale-x (meters 8) (meters 8) 1.0) @@ -319,14 +314,12 @@ ;; failed to figure out what this is: (defpart 527 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) ;; failed to figure out what this is: (defpart 522 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 24) (meters 16) 1.0) @@ -343,8 +336,7 @@ ;; failed to figure out what this is: (defpart 523 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 24) (meters 16) 1.0) @@ -361,8 +353,7 @@ ;; failed to figure out what this is: (defpart 524 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 5.0 10.0 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) @@ -390,8 +381,7 @@ ;; failed to figure out what this is: (defpart 528 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0033333334)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0033333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r -4.266667) (sp-flt spt-fade-g 0.7111111) @@ -402,8 +392,7 @@ ;; failed to figure out what this is: (defpart 525 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.25) (meters 0.5) 1.0) @@ -429,8 +418,7 @@ :id 119 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 24) - :parts - ((sp-item 529 :fade-after (meters 200) :falloff-to (meters 200) :period 1200 :length 30) + :parts ((sp-item 529 :fade-after (meters 200) :falloff-to (meters 200) :period 1200 :length 30) (sp-item 530 :fade-after (meters 100) :falloff-to (meters 100) :period 1200 :length 15) (sp-item 531 :fade-after (meters 40) :falloff-to (meters 40) :period 1200 :length 15) (sp-item 532 :period 1200 :length 15 :offset 15) @@ -465,8 +453,7 @@ ;; failed to figure out what this is: (defpart 529 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -496,8 +483,7 @@ ;; failed to figure out what this is: (defpart 536 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.006666667)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.006666667)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -0.16) ) @@ -505,8 +491,7 @@ ;; failed to figure out what this is: (defpart 530 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -535,8 +520,7 @@ ;; failed to figure out what this is: (defpart 531 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters 0.75)) (sp-rnd-flt spt-scale-x (meters 16) (meters 16) 1.0) @@ -560,14 +544,12 @@ ;; failed to figure out what this is: (defpart 537 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) ;; failed to figure out what this is: (defpart 532 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 24) (meters 16) 1.0) @@ -584,8 +566,7 @@ ;; failed to figure out what this is: (defpart 533 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 24) (meters 16) 1.0) @@ -602,8 +583,7 @@ ;; failed to figure out what this is: (defpart 534 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 5.0 10.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -630,8 +610,7 @@ ;; failed to figure out what this is: (defpart 538 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0033333334)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0033333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r -0.6) (sp-flt spt-fade-g -1.8) @@ -641,8 +620,7 @@ ;; failed to figure out what this is: (defpart 535 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.25) (meters 0.5) 1.0) @@ -722,13 +700,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *mistycannon-missile-sg* sack - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *mistycannon-missile-sg* sack sack-lod0-jg sack-idle-ja + ((sack-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; definition for method 20 of type mistycannon-missile ;; INFO: Return type mismatch int vs none. @@ -744,42 +719,35 @@ ;; failed to figure out what this is: (defstate mistycannon-missile-idle (mistycannon-missile) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (go mistycannon-missile-explode) ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self sfx) (the-as uint 0)) 0 (none) ) - :trans - (behavior () + :trans (behavior () (if (< (-> self root-override trans y) (-> self water-height)) (go mistycannon-missile-in-water) ) (none) ) - :code - (behavior () + :code (behavior () (clear-collide-with-as (-> self root-override)) (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (the int (* 300.0 (-> self muzzle-time)))) (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) (suspend) - (let ((f0-1 - (fmin - 1.0 - (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) - (the float (the int (* 300.0 (-> self muzzle-time)))) - ) - ) - ) + (let ((f0-1 (fmin 1.0 (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) + (the float (the int (* 300.0 (-> self muzzle-time)))) + ) + ) + ) ) (set! (-> self root-override scale x) (* 0.6 f0-1)) (set! (-> self root-override scale y) (* 0.6 f0-1)) @@ -788,7 +756,7 @@ ) (restore-collide-with-as (-> self root-override)) (set-vector! (-> self root-override scale) 0.6 0.6 0.6 1.0) - (while (zero? (logand (-> self root-override status) 1)) + (while (zero? (logand (-> self root-override status) (cshape-moving-flags onsurf))) (if (and (zero? (-> self sfx)) (< (if *target* (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) @@ -798,18 +766,7 @@ ) ) (set! (-> self sfx) - (the-as - uint - (sound-play-by-name - (static-sound-name "sack-incoming") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) - ) + (the-as uint (sound-play "sack-incoming" :position (the-as symbol (-> self root-override trans)))) ) ) (when (nonzero? (-> self sfx)) @@ -827,7 +784,7 @@ ) (sound-trans-convert (-> gp-1 parms trans) a1-3) ) - (set! (-> gp-1 parms mask) (the-as uint 32)) + (set! (-> gp-1 parms mask) (sound-mask trans)) (-> gp-1 id) ) ) @@ -842,54 +799,21 @@ 0 ) (set! (-> self ground-time) (-> *display* base-frame-counter)) - (sound-play-by-name - (static-sound-name "sack-land") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (sound-play "sack-land" :position (the-as symbol (-> self root-override trans))) + (ja-no-eval :group! sack-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-21 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-21 param 1) 1.0) - (set! (-> a0-21 frame-num) 0.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! sack-fuse-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) (the float (+ (-> a0-22 frame-group data 0 length) -1))) - (set! (-> a0-22 param 1) 1.0) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go mistycannon-missile-explode) (none) ) - :post - (behavior () + :post (behavior () (vector-v++! (-> self root-override transv) (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 1.0) @@ -903,7 +827,7 @@ (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) (spawn-part self) (when (and (zero? (-> self draw cur-lod)) (logtest? (-> self draw status) (draw-status was-drawn))) - (if (logtest? (-> self root-override status) 1) + (if (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) (draw-shadow (-> self root-override shadow-pos) (-> self root-override shadow-pos) @@ -917,7 +841,7 @@ (-> self root-override shadow-pos) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -930,8 +854,7 @@ ;; failed to figure out what this is: (defstate mistycannon-missile-in-water (mistycannon-missile) - :code - (behavior () + :code (behavior () (when (nonzero? (-> self sfx)) (sound-stop (the-as sound-id (-> self sfx))) (set! (-> self sfx) (the-as uint 0)) @@ -956,15 +879,9 @@ (-> self root-override transv) (-> self root-override root-prim collide-with) ) - (set! (-> self root-override scale x) - (seek (-> self root-override scale x) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - ) - (set! (-> self root-override scale y) - (seek (-> self root-override scale y) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - ) - (set! (-> self root-override scale z) - (seek (-> self root-override scale z) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - ) + (seek! (-> self root-override scale x) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) + (seek! (-> self root-override scale y) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) + (seek! (-> self root-override scale z) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) (when (< 0.05 (-> self root-override scale x)) (suspend) (goto cfg-3) @@ -972,14 +889,12 @@ (ja-channel-set! 0) (none) ) - :post - (the-as (function none :behavior mistycannon-missile) ja-post) + :post (the-as (function none :behavior mistycannon-missile) ja-post) ) ;; failed to figure out what this is: (defstate mistycannon-missile-explode (mistycannon-missile) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touched) (let* ((s4-0 arg0) @@ -1005,23 +920,13 @@ (collide-kind background) self t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) (cond ((= (-> arg0 type) target) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((a0-8 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-8 mode) 'explode) - (set! (-> a1-3 param 1) (the-as uint a0-8)) - ) - (send-event-function arg0 a1-3) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'explode)))) ) (else (let ((a1-4 (new 'stack-no-clear 'event-message-block))) @@ -1046,27 +951,10 @@ ) ) ) - :code - (behavior () + :code (behavior () (if (and *target* (= (-> *target* next-state name) 'target-periscope)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "explosion") - :volume #x400 - :fo-min #xc8 - :fo-max #x190 - ) - (new-sound-id) - (the-as vector #t) - ) - (sound-play-by-spec - (new 'static 'sound-spec :num 1.0 :group #x1 :sound-name (static-sound-name "explosion") :volume #x400) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "explosion" :fo-min 200 :fo-max 400) (new-sound-id) (the-as vector #t)) + (sound-play-by-spec (static-sound-spec "explosion") (new-sound-id) (the-as vector #t)) ) (spawn (-> self part2) (-> self root-override trans)) (ja-channel-set! 0) @@ -1094,12 +982,11 @@ (deactivate self) (none) ) - :post - (the-as (function none :behavior mistycannon-missile) ja-post) + :post (the-as (function none :behavior mistycannon-missile) ja-post) ) ;; definition for function mistycannon-collision-reaction -;; INFO: Return type mismatch int vs uint. +;; INFO: Return type mismatch int vs cshape-moving-flags. (defun mistycannon-collision-reaction ((arg0 collide-shape-moving) (arg1 collide-shape-intersect) (arg2 vector) (arg3 vector)) (let ((s5-0 0)) (let ((a1-1 (new 'stack-no-clear 'vector))) @@ -1115,7 +1002,7 @@ (vector-float*! (-> arg0 transv) (-> arg0 transv) 0.15) (let ((v0-1 (logior s5-0 7))) (logior! (-> arg0 status) v0-1) - (the-as uint v0-1) + (the-as cshape-moving-flags v0-1) ) ) ) @@ -1149,7 +1036,7 @@ ;; definition for function mistycannon-missile-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior mistycannon-missile-init-by-other mistycannon-missile ((arg0 mistycannon-init-data) (arg1 entity)) +(defbehavior mistycannon-missile-init-by-other mistycannon-missile ((arg0 mistycannon-init-data) (arg1 entity-actor)) (set! (-> self mask) (logior (process-mask projectile) (-> self mask))) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self entity) arg1) @@ -1209,15 +1096,7 @@ (set! (-> s5-0 flight-time) arg4) (set! (-> s5-0 muzzle-time) arg5) (set! (-> s5-0 blast-radius) arg6) - (let ((s3-0 (get-process *default-dead-pool* mistycannon-missile #x4000))) - (when s3-0 - (let ((t9-1 (method-of-type mistycannon-missile activate))) - (t9-1 (the-as mistycannon-missile s3-0) arg0 'mistycannon-missile (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 mistycannon-missile-init-by-other s5-0 arg7) - (-> s3-0 ppointer) - ) - ) + (process-spawn mistycannon-missile s5-0 arg7 :to arg0) ) 0 (none) @@ -1292,6 +1171,7 @@ ) ;; definition for function mistycannon-pick-random-target-point +;; INFO: Return type mismatch float vs none. (defbehavior mistycannon-pick-random-target-point mistycannon () (let ((f30-0 (* (sqrtf (rand-vu)) (-> self center-point w))) (f28-1 (* 65536.0 (rand-vu))) @@ -1301,10 +1181,8 @@ (set! (-> self at-point z) (+ (-> self center-point z) (* f30-0 (sin f28-1)))) ) (set! (-> self at-point w) 1.0) - (let ((f0-11 (rand-vu-float-range 2730.6667 12743.111))) - (set! (-> self target-theta) f0-11) - f0-11 - ) + (set! (-> self target-theta) (rand-vu-float-range 2730.6667 12743.111)) + (none) ) ;; definition for method 20 of type mistycannon @@ -1347,7 +1225,7 @@ (vector+! (-> obj hellmouth) (-> obj hellmouth) s3-0) (spawn-mistycannon-missile obj s3-0 s2-0 f30-0 arg1 f28-0 arg2 (-> obj entity)) ) - (sound-play-by-name (static-sound-name "cannon-shot") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cannon-shot") (set! (-> obj part local-clock) 0) (set! (-> obj part-timer) (-> *display* base-frame-counter)) (mistycannon-pick-random-target-point) @@ -1402,19 +1280,17 @@ ) ;; failed to figure out what this is: -(defskelgroup *mistycannon-sg* mistycannon - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 5 0 9) - :longest-edge (meters 4) - ) +(defskelgroup *mistycannon-sg* mistycannon mistycannon-lod0-jg mistycannon-idle-ja + ((mistycannon-lod0-mg (meters 20)) (mistycannon-lod1-mg (meters 999999))) + :bounds (static-spherem 0 5 0 9) + :longest-edge (meters 4) + ) ;; definition for function mistycannon-prebind-function ;; INFO: Return type mismatch int vs none. -(defun mistycannon-prebind-function ((arg0 mistycannon) (arg1 int) (arg2 mistycannon)) +(defun mistycannon-prebind-function ((arg0 pointer) (arg1 int) (arg2 mistycannon)) (let ((t9-0 quaternion-axis-angle!) - (a0-1 (&-> arg0 link)) + (a0-1 (&+ arg0 144)) (a1-1 0.0) (a2-1 1.0) (a3-0 0.0) @@ -1429,7 +1305,7 @@ ) ) (let ((t9-1 quaternion-axis-angle!) - (a0-2 (&-> arg0 tilt min)) + (a0-2 (&+ arg0 192)) (a1-2 -1.0) (a2-2 0.0) (a3-1 0.0) @@ -1456,10 +1332,10 @@ (the float (sar (shl (the int (+ (-> v1-19 min) (-> v1-19 value))) 48) 48)) ) ) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 stack 324)) -1.0 0.0 0.0 (-> arg2 front-wheel)) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 stack 276)) 1.0 0.0 0.0 (-> arg2 front-wheel)) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 goggles y)) -1.0 0.0 0.0 (-> arg2 rear-wheel)) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 at-point y)) 1.0 0.0 0.0 (-> arg2 rear-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 432)) -1.0 0.0 0.0 (-> arg2 front-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 384)) 1.0 0.0 0.0 (-> arg2 front-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 288)) -1.0 0.0 0.0 (-> arg2 rear-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 336)) 1.0 0.0 0.0 (-> arg2 rear-wheel)) 0 (none) ) @@ -1481,8 +1357,7 @@ ;; failed to figure out what this is: (defstate mistycannon-idle (mistycannon) - :trans - (behavior () + :trans (behavior () (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (go mistycannon-waiting-for-player) ) @@ -1497,16 +1372,14 @@ (rider-trans) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (dummy-23 self) (suspend) ) (none) ) - :post - (the-as (function none :behavior mistycannon) rider-post) + :post (the-as (function none :behavior mistycannon) rider-post) ) ;; definition of type quadratic-solution @@ -1698,13 +1571,11 @@ ;; failed to figure out what this is: (defstate mistycannon-aim-at-player (mistycannon) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (go mistycannon-waiting-for-player) ) @@ -1718,9 +1589,8 @@ (rider-trans) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (< (vector-vector-xz-distance (target-pos 0) (-> self center-point)) (-> self center-point w)) (mistycannon-do-aim (-> *target* control trans) (-> *target* control transv)) (mistycannon-do-aim (-> self at-point) (new-stack-vector0)) @@ -1730,14 +1600,12 @@ ) (none) ) - :post - (the-as (function none :behavior mistycannon) rider-post) + :post (the-as (function none :behavior mistycannon) rider-post) ) ;; failed to figure out what this is: (defstate mistycannon-waiting-for-player (mistycannon) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) (when ((method-of-type touching-shapes-entry prims-touching?) @@ -1756,18 +1624,16 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) (go mistycannon-aim-at-player) ) (rider-trans) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self player-touching-grips?) #f) - (while #t + (loop (let ((f0-0 2730.6667) (v1-0 (-> self tilt)) ) @@ -1796,7 +1662,7 @@ (print-game-text (lookup-text! *common-text* (game-text-id press-to-use) #f) gp-0 #f 128 22) ) (when (cpad-pressed? 0 circle) - (while #t + (loop (send-event *target* 'change-mode 'periscope self) (suspend) (suspend) @@ -1808,32 +1674,27 @@ ) (none) ) - :post - (the-as (function none :behavior mistycannon) rider-post) + :post (the-as (function none :behavior mistycannon) rider-post) ) ;; failed to figure out what this is: (defstate cam-mistycannon (camera-slave) - :event - cam-standard-event-handler - :enter - (behavior () + :event cam-standard-event-handler + :enter (behavior () (when (not (-> self enter-has-run)) (set! (-> self blend-from-type) (the-as uint 1)) (set! (-> self blend-to-type) (the-as uint 1)) ) (none) ) - :trans - (behavior () + :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((v1-0 (-> self change-event-from))) (set! (-> self trans quad) (-> (the-as mistycannon (-> v1-0 0)) goggles quad)) (let ((t9-0 matrix-rotate-yx!) @@ -1851,35 +1712,31 @@ ;; failed to figure out what this is: (defstate mistycannon-player-control (mistycannon) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('change-mode) (send-event *camera* 'change-state cam-mistycannon 0) ) ) ) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self sound-id)) (sound-stop (-> self aim-sound-id)) (none) ) - :trans - (behavior () + :trans (behavior () (dummy-23 self) (rider-trans) (none) ) - :code - (behavior () + :code (behavior () (send-event *camera* 'change-state cam-mistycannon 0) (suspend) (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 0) (s5-0 0) ) - (while #t + (loop (when *camera-read-analog* (let ((f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0)) (f28-0 (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0)) @@ -1887,7 +1744,7 @@ (rotate! self f30-0) (tilt! self (- f28-0)) (if (or (!= f30-0 0.0) (!= f28-0 0.0)) - (sound-play-by-name (static-sound-name "telescope") (-> self aim-sound-id) 1024 0 0 1 #t) + (sound-play "telescope" :id (-> self aim-sound-id)) (sound-stop (-> self aim-sound-id)) ) ) @@ -1897,16 +1754,11 @@ (sound-stop (-> self sound-id)) (send-event *camera* 'change-to-entity-by-name "camera-111") (suspend) - (while #t - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) self) - (set! (-> a1-8 num-params) 0) - (set! (-> a1-8 message) 'end-mode) - (when (send-event-function *target* a1-8) - (send-event *camera* 'change-state *camera-base-mode* 0) - (process-entity-status! self (entity-perm-status bit-3) #f) - (go mistycannon-waiting-for-player-to-fuck-off) - ) + (loop + (when (send-event *target* 'end-mode) + (send-event *camera* 'change-state *camera-base-mode* 0) + (process-entity-status! self (entity-perm-status bit-3) #f) + (go mistycannon-waiting-for-player-to-fuck-off) ) (suspend) ) @@ -1917,15 +1769,7 @@ (set! gp-0 (seekl gp-0 300 (the-as int (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)))) ) - (sound-play-by-name - (static-sound-name "cannon-charge") - (-> self sound-id) - 1024 - (the int (* 1524.0 (* 0.008 (the float gp-0)))) - 0 - 1 - #t - ) + (sound-play "cannon-charge" :id (-> self sound-id) :pitch (* 0.008 (the float gp-0))) ) (when (or (= gp-0 300) (and (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))) (nonzero? gp-0)) @@ -1942,7 +1786,7 @@ (if (nonzero? gp-0) (debug-percent-bar #t - (bucket-id debug-draw0) + (bucket-id debug) 192 160 (* 0.0033333334 (the float gp-0)) @@ -1959,14 +1803,12 @@ ) (none) ) - :post - (the-as (function none :behavior mistycannon) rider-post) + :post (the-as (function none :behavior mistycannon) rider-post) ) ;; failed to figure out what this is: (defstate mistycannon-waiting-for-player-to-fuck-off (mistycannon) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'touch) (when ((method-of-type touching-shapes-entry prims-touching?) @@ -1983,16 +1825,13 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (the-as (function none :behavior mistycannon) rider-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior mistycannon) rider-trans) + :code (behavior () + (loop (suspend) (dummy-23 self) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -2001,8 +1840,7 @@ ) (none) ) - :post - (the-as (function none :behavior mistycannon) rider-post) + :post (the-as (function none :behavior mistycannon) rider-post) ) ;; definition for method 11 of type mistycannon @@ -2052,9 +1890,7 @@ (initialize-skeleton obj *mistycannon-sg* '()) (logior! (-> obj skel status) (janim-status inited)) (update-transforms! (-> obj root-override)) - (set! (-> obj skel prebind-function) - (the-as (function pointer int process-drawable none) mistycannon-prebind-function) - ) + (set! (-> obj skel prebind-function) mistycannon-prebind-function) (set! (-> obj skel postbind-function) mistycannon-postbind-function) (set! (-> obj fact-info-override) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) diff --git a/test/decompiler/reference/levels/misty/mud_REF.gc b/test/decompiler/reference/levels/misty/mud_REF.gc index 5a2a103313..cd33374c30 100644 --- a/test/decompiler/reference/levels/misty/mud_REF.gc +++ b/test/decompiler/reference/levels/misty/mud_REF.gc @@ -23,8 +23,7 @@ :count 3 :converted #f :normal-scale 1.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 40.0 :xdiv -1 :zdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75) @@ -38,8 +37,7 @@ :count 3 :converted #f :normal-scale 1.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 20.0 :xdiv 2 :speed 0.5) (new 'static 'ripple-wave :scale 20.0 :xdiv -2 :zdiv 2 :speed 0.5) (new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75) @@ -54,8 +52,8 @@ (let ((t9-0 (method-of-type water-anim TODO-RENAME-22))) (t9-0 obj) ) - (set! (-> obj flags) (logand -8388609 (-> obj flags))) - (set! (-> obj flags) (logior #x40000 (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt23)) + (set! (-> obj flags) (logior (water-flags wt18) (-> obj flags))) (let ((gp-0 (new 'process 'ripple-control))) (set! (-> obj draw ripple) gp-0) (set! (-> gp-0 global-scale) 3072.0) diff --git a/test/decompiler/reference/levels/misty/muse_REF.gc b/test/decompiler/reference/levels/misty/muse_REF.gc index 3558eb1971..2c381abd12 100644 --- a/test/decompiler/reference/levels/misty/muse_REF.gc +++ b/test/decompiler/reference/levels/misty/muse_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/muse-ag.gc") + ;; definition of type muse (deftype muse (nav-enemy) ((root-override collide-shape-moving :offset 112) @@ -205,14 +207,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *muse-sg* muse - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 3) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *muse-sg* muse muse-lod0-jg muse-idle-ja + ((muse-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3) + :shadow muse-shadow-mg + ) ;; definition for method 44 of type muse (defmethod dummy-44 muse ((obj muse) (arg0 process) (arg1 event-message-block)) @@ -229,16 +228,12 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate muse-idle (muse) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior muse) nav-enemy-default-event-handler ) - :trans - (behavior () - (set! (-> self sprint-distance) - (seek (-> self sprint-distance) 61440.0 (* 8192.0 (-> *display* seconds-per-frame))) - ) + :trans (behavior () + (seek! (-> self sprint-distance) 61440.0 (* 8192.0 (-> *display* seconds-per-frame))) (if (and *target* (>= 102400.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (level-hint-spawn (game-text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) ) @@ -247,79 +242,43 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 4) - ) - (ja-channel-push! 1 30) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + :code (behavior () + (when (ja-group? muse-run-ja) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :num! (loop!)) + (ja-no-eval :group! muse-run-to-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (while #t - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (loop + (ja-no-eval :group! muse-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (spool-push *art-control* (-> self anim name) 0 self -99.0) (dummy-51 self) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior muse) ja-post) + :post (the-as (function none :behavior muse) ja-post) ) ;; failed to figure out what this is: (defstate nav-enemy-chase (muse) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior muse) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (cond ((or (not *target*) (< 102400.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) @@ -329,10 +288,9 @@ nav-enemy-default-event-handler (go muse-idle) ) ) - ((or (not *target*) - (< (-> self sprint-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) + ((or (not *target*) (< (-> self sprint-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) ) (set! (-> self target-speed) 40960.0) ) @@ -340,67 +298,34 @@ nav-enemy-default-event-handler (set! (-> self target-speed) 61440.0) ) ) - (set! (-> self sprint-distance) - (seek (-> self sprint-distance) 0.0 (* 4096.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self sprint-distance) 0.0 (* 4096.0 (-> *display* seconds-per-frame))) (muse-check-dest-point) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) - ) - (ja-channel-push! 1 30) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + ((ja-group? muse-idle-ja) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :num! (loop!)) + (ja-no-eval :group! muse-idle-to-run-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) ) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (ja :group! muse-run-ja :num! min) + (loop (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (* 0.000016276043 (-> self momentum-speed))) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! (* 0.000016276043 (-> self momentum-speed)))) ) (none) ) - :post - (behavior () + :post (behavior () (set! (-> self nav destination-pos quad) (-> self dest-point quad)) (dummy-19 (-> self nav) @@ -409,8 +334,8 @@ nav-enemy-default-event-handler (-> self nav destination-pos) 546133.3 ) - (if (logtest? (nav-control-flags bit21) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit10)) + (if (logtest? (nav-control-flags navcf21) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (nav-enemy-travel-post) (none) @@ -420,54 +345,33 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-jump (muse) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior muse) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () ((-> (method-of-type nav-enemy nav-enemy-jump) enter)) - (set! (-> self nav-enemy-flags) (logand -513 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) (none) ) - :code - (-> (method-of-type nav-enemy nav-enemy-jump) code) + :code (-> (method-of-type nav-enemy nav-enemy-jump) code) ) ;; failed to figure out what this is: (defstate nav-enemy-jump-land (muse) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior muse) nav-enemy-default-event-handler ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 22) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 0.8) - (set! (-> gp-0 frame-num) (ja-aframe 6.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! muse-run-ja :num! (seek! max 0.8) :frame-num (ja-aframe 6.0 0)) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 0.8) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.8)) ) (go-virtual nav-enemy-chase) (none) @@ -476,114 +380,89 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate muse-caught (muse) - :event - (the-as (function process int symbol event-message-block object :behavior muse) #f) - :trans - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior muse) #f) + :trans (behavior () (spool-push *art-control* (-> self anim name) 0 self -1.0) (none) ) - :code - (behavior () - (sound-play-by-name (static-sound-name "money-pickup") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (sound-play "money-pickup") (close-specific-task! (game-task misty-muse) (task-status need-reminder)) (process-entity-status! self (entity-perm-status dead) #t) (suspend) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 1) - (set! (-> a1-3 message) 'clone-anim) - (set! (-> a1-3 param 0) (the-as uint self)) - (when (send-event-function *target* a1-3) - (set-blackout-frames (seconds 10)) - (let ((gp-1 (res-lump-struct (-> self entity) 'movie-pos vector))) - (cond - (gp-1 - (move-to-point! (-> self collide-info) gp-1) - (set-yaw-angle-clear-roll-pitch! (-> self collide-info) (-> gp-1 w)) - ) - (else - (move-to-point! (-> self collide-info) (-> *target* control trans)) - (quaternion-copy! (-> self collide-info quat) (-> *target* control quat)) - (move-to-ground (-> self collide-info) 40960.0 40960.0 #f (collide-kind background)) - ) - ) - ) - (send-event *target* 'trans 'save (-> self old-target-pos)) - (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) - (send-event *target* 'blend-shape #t) - (if (!= *kernel-boot-message* 'play) - (set! (-> self trans-hook) - (lambda :behavior muse () (spool-push *art-control* (-> self victory-anim name) 0 self -1.0) (none)) - ) - ) - (push-setting! *setting-control* self 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) - (push-setting! *setting-control* self 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) - (push-setting! - *setting-control* - self - 'ambient-volume - 'rel - (-> *setting-control* current ambient-volume-movie) - 0 - ) - (logclear! (-> self mask) (process-mask enemy)) - (let ((gp-2 (get-process *default-dead-pool* othercam #x4000))) - (when gp-2 - (let ((t9-19 (method-of-type othercam activate))) - (t9-19 (the-as othercam gp-2) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-2 othercam-init-by-other self 3 #f #t) - (-> gp-2 ppointer) - ) - ) - (auto-save-command 'auto-save 0 0 *default-pool*) - (ja-play-spooled-anim - (-> self anim) - (the-as art-joint-anim (-> self draw art-group data 3)) - (the-as art-joint-anim (-> self draw art-group data 3)) - (the-as (function process-drawable symbol) false-func) - ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) - (clear-pending-settings-from-process *setting-control* self 'ambient-volume) - (send-event *target* 'blend-shape #f) + (when (send-event *target* 'clone-anim self) + (set-blackout-frames (seconds 10)) + (let ((gp-1 (res-lump-struct (-> self entity) 'movie-pos vector))) (cond - ((!= *kernel-boot-message* 'play) - (set-blackout-frames 0) - (ja-channel-set! 0) - (ja-post) - (clear-collide-with-as (-> self collide-info)) - (send-event *target* 'trans 'reset) - (let ((gp-4 (ppointer->handle (birth-pickup-at-point - (target-pos 0) - (pickup-type fuel-cell) - (the float (-> self entity extra perm task)) - #f - self - (the-as fact-info #f) - ) + (gp-1 + (move-to-point! (-> self collide-info) gp-1) + (set-yaw-angle-clear-roll-pitch! (-> self collide-info) (-> gp-1 w)) + ) + (else + (move-to-point! (-> self collide-info) (-> *target* control trans)) + (quaternion-copy! (-> self collide-info quat) (-> *target* control quat)) + (move-to-ground (-> self collide-info) 40960.0 40960.0 #f (collide-kind background)) + ) + ) + ) + (send-event *target* 'trans 'save (-> self old-target-pos)) + (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) + (send-event *target* 'blend-shape #t) + (if (!= *kernel-boot-message* 'play) + (set! (-> self trans-hook) + (lambda :behavior muse () (spool-push *art-control* (-> self victory-anim name) 0 self -1.0) (none)) + ) + ) + (add-setting! 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) + (add-setting! 'ambient-volume 'rel (-> *setting-control* current ambient-volume-movie) 0) + (logclear! (-> self mask) (process-mask enemy)) + (process-spawn othercam self 3 #f #t :to self) + (auto-save-command 'auto-save 0 0 *default-pool*) + (ja-play-spooled-anim + (-> self anim) + (the-as art-joint-anim muse-idle-ja) + (the-as art-joint-anim muse-idle-ja) + (the-as (function process-drawable symbol) false-func) + ) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) + (send-event *target* 'blend-shape #f) + (cond + ((!= *kernel-boot-message* 'play) + (set-blackout-frames 0) + (ja-channel-set! 0) + (ja-post) + (clear-collide-with-as (-> self collide-info)) + (send-event *target* 'trans 'reset) + (let ((gp-4 (ppointer->handle (birth-pickup-at-point + (target-pos 0) + (pickup-type fuel-cell) + (the float (-> self entity extra perm task)) + #f + self + (the-as fact-info #f) ) - ) - ) - (send-event (handle->process (the-as handle gp-4)) 'pickup) - (while (handle->process (the-as handle gp-4)) - (suspend) + ) + ) ) + (send-event (handle->process (the-as handle gp-4)) 'pickup) + (while (handle->process (the-as handle gp-4)) + (suspend) ) ) - (else - (send-event *target* 'trans 'restore (-> self old-target-pos)) - (set-blackout-frames 0) - (set-blackout-frames (seconds 0.1)) - ) + ) + (else + (send-event *target* 'trans 'restore (-> self old-target-pos)) + (set-blackout-frames 0) + (set-blackout-frames (seconds 0.1)) ) ) ) (none) ) - :post - (behavior () + :post (behavior () (dummy-51 self) (level-hint-surpress!) (kill-current-level-hint '() '() 'exit) @@ -641,7 +520,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -693,8 +572,7 @@ nav-enemy-default-event-handler :name "muse-victory" :index 9 :parts 2 - :command-list - '((1 blackout 0) (219 blackout 60)) + :command-list '((1 blackout 0) (219 blackout 60)) ) ) (set! (-> obj victory-anim) (fuel-cell-pick-anim obj)) diff --git a/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc b/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc index 4333127f5f..c88b5388ca 100644 --- a/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc +++ b/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc @@ -1,12 +1,13 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/quicksandlurker-ag.gc") + ;; failed to figure out what this is: (defpartgroup group-quicksandlurker-missile :id 198 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 2481 :flags (launch-asap) :binding 2479) + :parts ((sp-item 2481 :flags (launch-asap) :binding 2479) (sp-item 2479 :flags (start-dead) :binding 2480) (sp-item 2480 :flags (start-dead launch-asap)) (sp-item 2480 :flags (start-dead launch-asap)) @@ -59,8 +60,7 @@ ;; failed to figure out what this is: (defpart 2481 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.01)) (sp-copy-from-other spt-scale-y -4) @@ -73,8 +73,7 @@ ;; failed to figure out what this is: (defpart 2479 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 1)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -100,14 +99,12 @@ ;; failed to figure out what this is: (defpart 2482 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: (defpart 2480 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 5.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -139,14 +136,12 @@ :id 199 :duration 5 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 2483)) + :parts ((sp-item 2483)) ) ;; failed to figure out what this is: (defpart 2483 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -177,14 +172,12 @@ :id 200 :duration 10 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 2484) (sp-item 2485) (sp-item 2486)) + :parts ((sp-item 2484) (sp-item 2485) (sp-item 2486)) ) ;; failed to figure out what this is: (defpart 2484 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 64.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -212,8 +205,7 @@ ;; failed to figure out what this is: (defpart 2486 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -238,8 +230,7 @@ ;; failed to figure out what this is: (defpart 2485 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -260,8 +251,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 124 :flags (is-3d) :period 900 :length 63) + :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) (sp-item 125 :period 900 :length 15) (sp-item 126 :flags (is-3d) :period 900 :length 15) (sp-item 127 :flags (is-3d) :period 900 :length 15) @@ -286,8 +276,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) - :parts - ((sp-item 124 :flags (is-3d) :period 900 :length 63) + :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) (sp-item 125 :period 900 :length 15) (sp-item 126 :flags (is-3d) :period 900 :length 15) (sp-item 127 :flags (is-3d) :period 900 :length 15) @@ -330,23 +319,12 @@ ;; failed to figure out what this is: (defstate quicksandlurker-missile-idle (quicksandlurker-missile) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touched) (when (cond ((= (-> arg0 type) target) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((a2-1 (new 'static 'attack-info :mask #x20))) - (set! (-> a2-1 mode) 'explode) - (set! (-> a1-3 param 1) (the-as uint a2-1)) - ) - (send-event-function arg0 a1-3) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'explode)))) ) (else (let ((a1-4 (new 'stack-no-clear 'event-message-block))) @@ -370,20 +348,18 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior () + :code (behavior () (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) (fill-cache-integrate-and-collide! (-> self root-override) (-> self root-override transv) (-> self root-override root-prim collide-with) ) - (if (or (logtest? (-> self root-override status) 8) + (if (or (logtest? (-> self root-override status) (cshape-moving-flags twall)) (< (vector-vector-distance (-> self root-override trans) (the-as vector (-> self root-override trans-old))) 40.96 ) @@ -396,7 +372,7 @@ (the-as vector #f) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -405,8 +381,7 @@ (cleanup-for-death self) (none) ) - :post - (behavior () + :post (behavior () (update-transforms! (-> self root-override)) (none) ) @@ -414,34 +389,18 @@ ;; failed to figure out what this is: (defstate quicksandlurker-missile-impact (quicksandlurker-missile) - :code - (behavior () - (sound-play-by-name - (static-sound-name "sack-land") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 200) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + :code (behavior () + (sound-play "sack-land" :position (the-as symbol (-> self root-override trans))) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 200) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -473,7 +432,7 @@ ;; definition for function quicksandlurker-missile-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior quicksandlurker-missile-init-by-other quicksandlurker-missile ((arg0 quicksandlurker-missile-init-data) (arg1 entity)) +(defbehavior quicksandlurker-missile-init-by-other quicksandlurker-missile ((arg0 quicksandlurker-missile-init-data) (arg1 entity-actor)) (set! (-> self entity) arg1) (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -510,19 +469,11 @@ ;; definition for function spawn-quicksandlurker-missile ;; INFO: Return type mismatch int vs none. -(defun spawn-quicksandlurker-missile ((arg0 process) (arg1 vector) (arg2 vector) (arg3 entity)) +(defun spawn-quicksandlurker-missile ((arg0 process) (arg1 vector) (arg2 vector) (arg3 entity-actor)) (let ((s5-0 (new 'stack-no-clear 'quicksandlurker-missile-init-data))) (set! (-> s5-0 position) arg1) (set! (-> s5-0 velocity) arg2) - (let ((s3-0 (get-process *default-dead-pool* quicksandlurker-missile #x4000))) - (when s3-0 - (let ((t9-1 (method-of-type quicksandlurker-missile activate))) - (t9-1 (the-as quicksandlurker-missile s3-0) arg0 'quicksandlurker-missile (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 quicksandlurker-missile-init-by-other s5-0 arg3) - (-> s3-0 ppointer) - ) - ) + (process-spawn quicksandlurker-missile s5-0 arg3 :to arg0) ) 0 (none) @@ -570,13 +521,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *quicksandlurker-sg* quicksandlurker - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *quicksandlurker-sg* quicksandlurker quicksandlurker-lod0-jg quicksandlurker-idle-ja + ((quicksandlurker-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) ;; definition for function orient-to-face-target (defbehavior orient-to-face-target quicksandlurker () @@ -676,20 +624,16 @@ ;; failed to figure out what this is: (defstate quicksandlurker-idle (quicksandlurker) - :event - (the-as (function process int symbol event-message-block object :behavior quicksandlurker) #f) - :enter - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior quicksandlurker) #f) + :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -697,23 +641,19 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior quicksandlurker) ja-post) + :post (the-as (function none :behavior quicksandlurker) ja-post) ) ;; failed to figure out what this is: (defstate quicksandlurker-wait (quicksandlurker) - :event - quicksandlurker-default-event-handler - :trans - (behavior () + :event quicksandlurker-default-event-handler + :trans (behavior () (cond ((and *target* (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (set! (-> self y-offset) 1228.8) @@ -722,120 +662,72 @@ ((or (not *target*) (< 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - (set! (-> self y-offset) (seek (-> self y-offset) -6553.6 (* 20480.0 (-> *display* seconds-per-frame)))) + (seek! (-> self y-offset) -6553.6 (* 20480.0 (-> *display* seconds-per-frame))) (if (= (-> self y-offset) -6553.6) (go quicksandlurker-idle) ) ) (else - (set! (-> self y-offset) (seek (-> self y-offset) 1228.8 (* 20480.0 (-> *display* seconds-per-frame)))) + (seek! (-> self y-offset) 1228.8 (* 20480.0 (-> *display* seconds-per-frame))) ) ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 1.5 2.0)))) (s5-0 5) (s4-0 0) ) - (ja-channel-push! 1 30) - (while #t + (ja-channel-push! 1 (seconds 0.1)) + (loop (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! quicksandlurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (+! s4-0 1) (when (< s5-0 s4-0) (set! s4-0 0) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! quicksandlurker-yawn-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (orient-to-face-target) - (let ((v1-55 (-> self skel root-channel 0))) - (set! (-> v1-55 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - ) - (let ((v1-58 (-> self skel root-channel 0))) - (set! (-> v1-58 num-func) num-func-identity) - (set! (-> v1-58 frame-num) 0.0) - ) + (ja :group! quicksandlurker-idle-ja) + (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) ) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) ;; failed to figure out what this is: (defstate quicksandlurker-yawn (quicksandlurker) - :event - quicksandlurker-default-event-handler - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :event quicksandlurker-default-event-handler + :code (behavior () + (ja-no-eval :group! quicksandlurker-yawn-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go quicksandlurker-wait) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) ;; failed to figure out what this is: (defstate quicksandlurker-track (quicksandlurker) - :event - quicksandlurker-default-event-handler - :trans - (behavior () + :event quicksandlurker-default-event-handler + :trans (behavior () (if (or (not *target*) (< 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -844,31 +736,18 @@ (quicksandlurker-check-hide-transition) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 0.8 1.2)))) (s5-0 1) (s4-0 0) ) - (while #t + (loop (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! quicksandlurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (+! s4-0 1) @@ -879,23 +758,18 @@ ) ) (orient-to-face-target) - (let ((v1-39 (-> self skel root-channel 0))) - (set! (-> v1-39 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - ) - (let ((v1-42 (-> self skel root-channel 0))) - (set! (-> v1-42 num-func) num-func-identity) - (set! (-> v1-42 frame-num) 0.0) - ) + (ja :group! quicksandlurker-idle-ja) + (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) ) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) ;; definition for function quicksandlurker-spit +;; INFO: Return type mismatch (pointer process) vs (pointer part-tracker). ;; Used lq/sq (defbehavior quicksandlurker-spit quicksandlurker () (let ((gp-0 (new-stack-vector0))) @@ -908,38 +782,29 @@ (vector-normalize! s5-0 49152.0) (spawn-quicksandlurker-missile self gp-0 s5-0 (-> self entity)) ) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 199) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 199) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) ) ;; failed to figure out what this is: (defstate quicksandlurker-attack (quicksandlurker) - :event - quicksandlurker-default-event-handler - :trans - quicksandlurker-check-hide-transition - :code - (behavior () + :event quicksandlurker-default-event-handler + :trans quicksandlurker-check-hide-transition + :code (behavior () (let ((gp-0 #f) (f30-0 51.0) ) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! quicksandlurker-spit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (orient-to-face-target) (when (and (not gp-0) (>= (ja-aframe-num 0) f30-0)) @@ -947,92 +812,55 @@ (quicksandlurker-spit) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (go quicksandlurker-track) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) ;; failed to figure out what this is: (defstate quicksandlurker-victory (quicksandlurker) - :event - quicksandlurker-default-event-handler - :trans - quicksandlurker-check-hide-transition - :code - (behavior () - (ja-channel-push! 1 60) + :event quicksandlurker-default-event-handler + :trans quicksandlurker-check-hide-transition + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) (cond ((rand-vu-percent? 0.5) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! quicksandlurker-victory-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! quicksandlurker-victory2-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go quicksandlurker-track) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) ;; failed to figure out what this is: (defstate quicksandlurker-hide (quicksandlurker) - :event - quicksandlurker-default-event-handler - :enter - (behavior () + :event quicksandlurker-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (restore-collide-with-as (-> self root-override)) (none) ) - :trans - (behavior () + :trans (behavior () (if (not *target*) (go quicksandlurker-wait) ) @@ -1056,137 +884,79 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 0.75) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! quicksandlurker-hide-ja :num! (seek! max 0.75) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 0.75) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.75)) ) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 201) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 201) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (clear-collide-with-as (-> self root-override)) - (while #t + (loop (orient-to-face-target) (suspend) ) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) ;; failed to figure out what this is: (defstate quicksandlurker-popup (quicksandlurker) - :trans - quicksandlurker-check-hide-transition - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 202) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) - ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) + :trans quicksandlurker-check-hide-transition + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 202) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) + (ja-no-eval :group! quicksandlurker-popup-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (orient-to-face-target) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go quicksandlurker-track) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) ;; failed to figure out what this is: (defstate quicksandlurker-die (quicksandlurker) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior quicksandlurker) process-drawable-death-event-handler ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 60) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! quicksandlurker-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (cleanup-for-death self) (none) ) - :post - quicksandlurker-post + :post quicksandlurker-post ) ;; definition for method 11 of type quicksandlurker @@ -1240,7 +1010,7 @@ (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (rand-vu-float-range 0.0 65536.0)) (initialize-skeleton obj *quicksandlurker-sg* '()) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj fact) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) diff --git a/test/decompiler/reference/levels/misty/sidekick-human_REF.gc b/test/decompiler/reference/levels/misty/sidekick-human_REF.gc index 740289266f..ef6666bf3d 100644 --- a/test/decompiler/reference/levels/misty/sidekick-human_REF.gc +++ b/test/decompiler/reference/levels/misty/sidekick-human_REF.gc @@ -1,6 +1,11 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/darkecocan-ag.gc") +(import "goal_src/import/sidekick-human-ag.gc") +(import "goal_src/import/evilbro-ag.gc") +(import "goal_src/import/evilsis-ag.gc") + ;; definition of type sequenceA (deftype sequenceA (process-hidden) () @@ -46,8 +51,7 @@ :id 657 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2665 :period 300 :length 5 :binding 2663) + :parts ((sp-item 2665 :period 300 :length 5 :binding 2663) (sp-item 2663 :flags (start-dead launch-asap) :binding 2664) (sp-item 2663 :flags (start-dead launch-asap) :binding 2664) (sp-item 2664 :flags (start-dead)) @@ -60,8 +64,7 @@ ;; failed to figure out what this is: (defpart 2665 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2.5) (meters 5) 1.0) (sp-rnd-flt spt-y (meters -1.5) (meters 3) 1.0) @@ -78,8 +81,7 @@ ;; failed to figure out what this is: (defpart 2663 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -103,8 +105,7 @@ ;; failed to figure out what this is: (defpart 2664 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -124,8 +125,7 @@ ;; failed to figure out what this is: (defpart 2667 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters -3.90625)) (sp-flt spt-scale-x (meters 15)) @@ -141,8 +141,7 @@ ;; failed to figure out what this is: (defpart 2666 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.3) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters -3) (meters 6) 1.0) @@ -167,8 +166,7 @@ ;; failed to figure out what this is: (defpart 2668 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 300 299 1) (sp-launcher-by-id spt-next-launcher 2669) ) @@ -176,8 +174,7 @@ ;; failed to figure out what this is: (defpart 2669 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: @@ -186,8 +183,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2345 :period 1500 :length 20 :offset 1500) + :parts ((sp-item 2345 :period 1500 :length 20 :offset 1500) (sp-item 2346 :period 1500 :length 20 :offset 1500) (sp-item 2347 :period 1500 :length 5 :offset 1500) (sp-item 2348 :period 1500 :length 20 :offset 1500) @@ -449,8 +445,7 @@ ;; failed to figure out what this is: (defpart 2349 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 0) (meters 0.1) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 4) 1.0) @@ -472,14 +467,12 @@ ;; failed to figure out what this is: (defpart 2353 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: (defpart 2350 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 0) (meters 0.1) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 4) 1.0) @@ -504,8 +497,7 @@ ;; failed to figure out what this is: (defpart 2351 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 0) (meters 0.3) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 2) 1.0) @@ -530,8 +522,7 @@ ;; failed to figure out what this is: (defpart 2352 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 0) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) @@ -556,8 +547,7 @@ ;; failed to figure out what this is: (defpart 2344 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -585,14 +575,12 @@ ;; failed to figure out what this is: (defpart 2354 - :init-specs - ((sp-flt spt-fade-a -3.2)) + :init-specs ((sp-flt spt-fade-a -3.2)) ) ;; failed to figure out what this is: (defpart 2345 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-y (meters 1) (meters 2) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.2) 1.0) @@ -621,14 +609,12 @@ ;; failed to figure out what this is: (defpart 2355 - :init-specs - ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a 0.0)) ) ;; failed to figure out what this is: (defpart 2346 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-y (meters 0) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.4) 1.0) @@ -657,8 +643,7 @@ ;; failed to figure out what this is: (defpart 2347 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-rnd-flt spt-scale-x (meters 28) (meters 4) 1.0) @@ -676,8 +661,7 @@ ;; failed to figure out what this is: (defpart 2348 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-y (meters 0.5) (meters 2) 1.0) (sp-rnd-flt spt-scale-x (meters 0.25) (meters 0.1) 1.0) @@ -701,8 +685,7 @@ :id 558 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2386 :binding 2385) + :parts ((sp-item 2386 :binding 2385) (sp-item 2385 :flags (bit1 start-dead launch-asap) :binding 2384) (sp-item 2385 :flags (bit1 start-dead launch-asap) :binding 2384) (sp-item 2385 :flags (bit1 start-dead launch-asap) :binding 2384) @@ -786,8 +769,7 @@ ;; failed to figure out what this is: (defpart 2386 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) @@ -802,8 +784,7 @@ ;; failed to figure out what this is: (defpart 2385 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-flt spt-y (meters 0)) @@ -832,14 +813,12 @@ ;; failed to figure out what this is: (defpart 2388 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2389)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2389)) ) ;; failed to figure out what this is: (defpart 2389 - :init-specs - ((sp-flt spt-vel-z (meters -0.008333334)) + :init-specs ((sp-flt spt-vel-z (meters -0.008333334)) (sp-flt spt-scalevel-x (meters -0.00041666668)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -1.0666667) @@ -848,8 +827,7 @@ ;; failed to figure out what this is: (defpart 2384 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -874,14 +852,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2298)) + :parts ((sp-item 2298)) ) ;; failed to figure out what this is: (defpart 2298 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.25) (meters 0.5) 1.0) @@ -907,8 +883,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2785 :period 1800 :length 5) + :parts ((sp-item 2785 :period 1800 :length 5) (sp-item 2786 :period 1800 :length 40) (sp-item 2787 :period 1800 :length 20) (sp-item 2788 :period 1800 :length 20) @@ -982,8 +957,7 @@ ;; failed to figure out what this is: (defpart 2830 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 2) 1.0) @@ -1003,8 +977,7 @@ ;; failed to figure out what this is: (defpart 2786 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-y (meters -1.5) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -1030,14 +1003,12 @@ ;; failed to figure out what this is: (defpart 2789 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2788 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 12.0) (sp-flt spt-scale-x (meters 0.3)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) @@ -1055,8 +1026,7 @@ ;; failed to figure out what this is: (defpart 2785 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 24)) (sp-copy-from-other spt-scale-y -4) @@ -1072,8 +1042,7 @@ ;; failed to figure out what this is: (defpart 2787 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters -1.5) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -1104,8 +1073,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) + :parts ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) (sp-item 296 :flags (start-dead launch-asap) :binding 297) (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) (sp-item 296 :flags (start-dead launch-asap) :binding 297) @@ -1151,14 +1119,12 @@ :linger-duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2790)) + :parts ((sp-item 2790)) ) ;; failed to figure out what this is: (defpart 2790 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1186,8 +1152,7 @@ ;; failed to figure out what this is: (defpart 2822 - :init-specs - ((sp-flt spt-fade-a -0.1)) + :init-specs ((sp-flt spt-fade-a -0.1)) ) ;; definition of type sequenceB @@ -1239,50 +1204,35 @@ ) ;; failed to figure out what this is: -(defskelgroup *sidekick-human-sg* sidekick-human - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *sidekick-human-sg* sidekick-human sidekick-human-lod0-jg sidekick-human-idle-ja + ((sidekick-human-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow sidekick-human-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *darkecocan-sg* darkecocan - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - ) +(defskelgroup *darkecocan-sg* darkecocan darkecocan-lod0-jg darkecocan-idle-ja + ((darkecocan-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) ;; failed to figure out what this is: -(defskelgroup *darkecocan-glow-sg* darkecocan - 2 - 4 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - ) +(defskelgroup *darkecocan-glow-sg* darkecocan darkecocan-glow-lod0-jg darkecocan-idle-ja + ((darkecocan-glow-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) ;; failed to figure out what this is: -(defskelgroup *evilbro-sg* evilbro - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - ) +(defskelgroup *evilbro-sg* evilbro evilbro-lod0-jg evilbro-idle-ja + ((evilbro-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) ;; failed to figure out what this is: -(defskelgroup *evilsis-sg* evilsis - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - ) +(defskelgroup *evilsis-sg* evilsis evilsis-lod0-jg evilsis-idle-ja + ((evilsis-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) ;; definition of type army-info (deftype army-info (structure) @@ -1307,69 +1257,56 @@ ) ;; definition for symbol *lurker-army*, type (array army-info) -(define - *lurker-army* - (the-as (array army-info) (new - 'static - 'boxed-array - :type army-info :length 9 :allocated-length 9 +(define *lurker-army* + (the-as (array army-info) (new 'static 'boxed-array :type army-info (new 'static 'army-info - :pos - (new 'static 'vector :x -920633.4 :y 83546.11 :z 4210409.5) + :pos (new 'static 'vector :x -920633.4 :y 83546.11 :z 4210409.5) :rot 28556.04 :skel 'babak ) (new 'static 'army-info - :pos - (new 'static 'vector :x -873488.4 :y 86441.984 :z 4225454.0) + :pos (new 'static 'vector :x -873488.4 :y 86441.984 :z 4225454.0) :rot 37861.24 :start-frame 5.0 :skel 'babak ) (new 'static 'army-info - :pos - (new 'static 'vector :x -905871.4 :y 83132.414 :z 4231934.0) + :pos (new 'static 'vector :x -905871.4 :y 83132.414 :z 4231934.0) :rot 32054.021 :start-frame 10.0 :skel 'babak ) (new 'static 'army-info - :pos - (new 'static 'vector :x -926765.06 :y 83496.96 :z 4236230.5) + :pos (new 'static 'vector :x -926765.06 :y 83496.96 :z 4236230.5) :rot 30001.652 :start-frame 15.0 :skel 'babak ) (new 'static 'army-info - :pos - (new 'static 'vector :x -893345.8 :y 83517.44 :z 4212961.5) + :pos (new 'static 'vector :x -893345.8 :y 83517.44 :z 4212961.5) :rot 32755.074 :start-frame 20.0 :skel 'babak ) (new 'static 'army-info - :pos - (new 'static 'vector :x -842797.06 :y 84041.73 :z 4218855.5) + :pos (new 'static 'vector :x -842797.06 :y 84041.73 :z 4218855.5) :rot 43916.402 :skel 'bonelurker ) (new 'static 'army-info - :pos - (new 'static 'vector :x -839274.5 :y 82644.99 :z 4248723.5) + :pos (new 'static 'vector :x -839274.5 :y 82644.99 :z 4248723.5) :rot 40510.715 :start-frame 6.0 :skel 'bonelurker ) (new 'static 'army-info - :pos - (new 'static 'vector :x -871485.44 :y 85909.51 :z 4243181.5) + :pos (new 'static 'vector :x -871485.44 :y 85909.51 :z 4243181.5) :rot 37046.043 :start-frame 12.0 :skel 'bonelurker ) (new 'static 'army-info - :pos - (new 'static 'vector :x -947523.56 :y 85835.77 :z 4219314.0) + :pos (new 'static 'vector :x -947523.56 :y 85835.77 :z 4219314.0) :rot 26980.078 :start-frame 18.0 :skel 'bonelurker @@ -1389,14 +1326,16 @@ ;; INFO: Return type mismatch int vs none. (defbehavior evilsib-trans-hook-wait evilbro () (when (>= (ja-aframe-num 0) 425.0) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-2 (method-of-type part-tracker activate))) - (t9-2 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 part-tracker-init (-> *part-group-id-table* 557) -1 #f #f #f (-> self draw origin)) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 557) + -1 + #f + #f + #f + (-> self draw origin) + :to *entity-pool* ) (send-event self 'trans-hook evilsib-trans-hook-hover) ) @@ -1406,182 +1345,151 @@ ;; definition for method 32 of type sequenceB (defmethod play-anim! sequenceB ((obj sequenceB) (arg0 symbol)) - (with-pp - (cond - (arg0 - (send-event *target* 'sidekick #f) - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj bonelurker) - (ppointer->handle - (when s5-0 - (let ((t9-2 (method-of-type manipy activate))) - (t9-2 (the-as manipy s5-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> obj root-override trans) (-> obj entity) *bonelurker-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj bonelurker)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj bonelurker)) 'center-joint 3) - (set-setting! *setting-control* pp 'music-volume-movie 'abs (the-as float 0.0) 0) - (set-setting! *setting-control* pp 'sfx-volume-movie 'abs (the-as float 0.0) 0) - (set-setting! *setting-control* pp 'ambient-volume-movie 'abs (the-as float 0.0) 0) - (dotimes (s5-1 9) - (let ((s4-0 (-> *lurker-army* s5-1))) - (cond - ((= (-> s4-0 skel) 'bonelurker) - (let ((s3-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj lurker-army s5-1) - (ppointer->handle (when s3-0 - (let ((t9-10 (method-of-type manipy activate))) - (t9-10 (the-as manipy s3-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 manipy-init (-> s4-0 pos) (-> obj entity) *bonelurker-sg* #f) - (-> s3-0 ppointer) - ) - ) - ) - ) - (let ((s3-1 (handle->process (-> obj lurker-army s5-1)))) - (when s3-1 - (set! (-> (the-as babak s3-1) draw light-index) (the-as uint 1)) - (set! (-> (the-as babak s3-1) draw level-index) (the-as uint (-> (level-get *level* 'misty) index))) + (cond + (arg0 + (send-event *target* 'sidekick #f) + (set! (-> obj bonelurker) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *bonelurker-sg* #f :to obj)) + ) + (send-event (handle->process (-> obj bonelurker)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj bonelurker)) 'center-joint 3) + (set-setting! 'music-volume-movie 'abs 0.0 0) + (set-setting! 'sfx-volume-movie 'abs 0.0 0) + (set-setting! 'ambient-volume-movie 'abs 0.0 0) + (dotimes (s5-1 9) + (let ((s4-0 (-> *lurker-army* s5-1))) + (cond + ((= (-> s4-0 skel) 'bonelurker) + (set! (-> obj lurker-army s5-1) + (ppointer->handle (manipy-spawn (-> s4-0 pos) (-> obj entity) *bonelurker-sg* #f :to obj)) ) + (let ((s3-1 (handle->process (-> obj lurker-army s5-1)))) + (when s3-1 + (set! (-> (the-as babak s3-1) draw light-index) (the-as uint 1)) + (set! (-> (the-as babak s3-1) draw level-index) (the-as uint (-> (level-get *level* 'misty) index))) ) ) - (else - (let ((s3-2 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj lurker-army s5-1) - (ppointer->handle (when s3-2 - (let ((t9-14 (method-of-type manipy activate))) - (t9-14 (the-as manipy s3-2) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s3-2 manipy-init (-> s4-0 pos) (-> obj entity) *babak-sg* #f) - (-> s3-2 ppointer) - ) - ) - ) - ) - (let ((s3-3 (handle->process (-> obj lurker-army s5-1)))) - (when s3-3 - (set! (-> (the-as babak s3-3) draw light-index) (the-as uint 1)) - (set! (-> (the-as babak s3-3) draw level-index) (the-as uint (-> (level-get *level* 'misty) index))) + ) + (else + (set! (-> obj lurker-army s5-1) + (ppointer->handle (manipy-spawn (-> s4-0 pos) (-> obj entity) *babak-sg* #f :to obj)) ) + (let ((s3-3 (handle->process (-> obj lurker-army s5-1)))) + (when s3-3 + (set! (-> (the-as babak s3-3) draw light-index) (the-as uint 1)) + (set! (-> (the-as babak s3-3) draw level-index) (the-as uint (-> (level-get *level* 'misty) index))) ) - (send-event (handle->process (-> obj lurker-army s5-1)) 'art-joint-anim "idle" 0) ) + (send-event (handle->process (-> obj lurker-army s5-1)) 'art-joint-anim "idle" 0) ) - (send-event (handle->process (-> obj lurker-army s5-1)) 'rot (-> s4-0 rot)) ) + (send-event (handle->process (-> obj lurker-army s5-1)) 'rot (-> s4-0 rot)) ) ) - ((!= (level-status *level* 'intro) 'active) - (return (get-art-elem obj)) - ) ) - (new 'static 'spool-anim - :name "sidekick-human-intro-sequence-b" - :index 5 - :parts 11 - :command-list - '((0 blackout 0) - (0 setting-reset ocean-off near) - (0 want-levels misty intro) - (0 display-level intro special) - (0 kill "money-1404") - (0 kill "money-1405") - (0 kill "money-1406") - (0 kill "money-1407") - (0 kill "money-1551") - (0 kill "money-1552") - (0 kill "money-1553") - (0 kill "balloonlurker-9") - (0 kill "balloonlurker-10") - (0 kill "balloonlurker-11") - (0 kill "balloonlurker-12") - (0 kill "balloonlurker-13") - (0 kill "balloonlurker-14") - (0 kill "keg-conveyor-8") - (0 kill "mistycannon-8") - (0 kill "muse-2") - (0 kill "mud-1") - (0 kill "mud-2") - (0 kill "mud-3") - (0 kill "mud-4") - (0 kill "mud-5") - (0 kill "mud-6") - (0 kill "mud-7") - (0 kill "mud-8") - (0 kill "mud-9") - (0 kill "mud-10") - (0 kill "mud-11") - (0 kill "dark-eco-pool-11") - (0 kill "sharkey-32") - (0 kill "sharkey-34") - (0 kill "sharkey-39") - (0 kill "sharkey-41") - (0 kill "bonelurker-14") - (0 kill "bonelurker-15") - (0 kill "bonelurker-16") - (0 kill "bonelurker-17") - (0 kill "bonelurker-18") - (0 kill "bonelurker-19") - (0 kill "bonelurker-20") - (0 kill "bonelurker-21") - (0 kill "bonelurker-22") - (0 kill "bonelurker-23") - (0 kill "bonelurker-24") - (0 kill "bonelurker-26") - (0 kill "babak-with-cannon-5") - (0 kill "babak-200") - (0 kill "babak-201") - (0 kill "babak-202") - (0 kill "babak-203") - (0 kill "babak-204") - (0 kill "babak-205") - (0 kill "babak-206") - (0 kill "babak-207") - (0 kill "babak-208") - (0 kill "babak-209") - (0 kill "babak-212") - (0 kill "quicksandlurker-5") - (0 kill "boatpaddle-4") - (0 kill "silostep-7") - (0 kill "silostep-8") - (0 kill "silostep-9") - (0 kill "silostep-10") - (0 kill "orb-cache-top-15") - (0 kill "windturbine-11") - (0 kill "teetertotter-5") - (0 kill "bone-platform-4") - (0 kill "misty-battle-controller-1") - (30 send-event self offset-army) - (196 joint "cameraB") - (196 shadow target #f) - (196 shadow self #f) - (380 send-event self evilbro) - (385 send-event "evilbro" draw #t) - (385 send-event "evilsis" draw #t) - (397 joint "camera") - (410 setting-reset ocean-off #t) - (456 joint "cameraB") - (546 joint "camera") - (701 joint "cameraB") - (701 setting-reset ocean-off near) - (776 joint "camera") - (776 setting-reset ocean-off #t) - (937 joint "cameraB") - (1027 joint "camera") - (1122 joint "cameraB") - (1221 joint "cameraB") - (1221 setting-reset ocean-off near) - (1280 alive "sequenceC-1") - (1281 save) - (1281 shadow target #t) - (1281 setting-unset ocean-off) - ) + ((!= (level-status *level* 'intro) 'active) + (return (get-art-elem obj)) + ) + ) + (new 'static 'spool-anim + :name "sidekick-human-intro-sequence-b" + :index 5 + :parts 11 + :command-list '((0 blackout 0) + (0 setting-reset ocean-off near) + (0 want-levels misty intro) + (0 display-level intro special) + (0 kill "money-1404") + (0 kill "money-1405") + (0 kill "money-1406") + (0 kill "money-1407") + (0 kill "money-1551") + (0 kill "money-1552") + (0 kill "money-1553") + (0 kill "balloonlurker-9") + (0 kill "balloonlurker-10") + (0 kill "balloonlurker-11") + (0 kill "balloonlurker-12") + (0 kill "balloonlurker-13") + (0 kill "balloonlurker-14") + (0 kill "keg-conveyor-8") + (0 kill "mistycannon-8") + (0 kill "muse-2") + (0 kill "mud-1") + (0 kill "mud-2") + (0 kill "mud-3") + (0 kill "mud-4") + (0 kill "mud-5") + (0 kill "mud-6") + (0 kill "mud-7") + (0 kill "mud-8") + (0 kill "mud-9") + (0 kill "mud-10") + (0 kill "mud-11") + (0 kill "dark-eco-pool-11") + (0 kill "sharkey-32") + (0 kill "sharkey-34") + (0 kill "sharkey-39") + (0 kill "sharkey-41") + (0 kill "bonelurker-14") + (0 kill "bonelurker-15") + (0 kill "bonelurker-16") + (0 kill "bonelurker-17") + (0 kill "bonelurker-18") + (0 kill "bonelurker-19") + (0 kill "bonelurker-20") + (0 kill "bonelurker-21") + (0 kill "bonelurker-22") + (0 kill "bonelurker-23") + (0 kill "bonelurker-24") + (0 kill "bonelurker-26") + (0 kill "babak-with-cannon-5") + (0 kill "babak-200") + (0 kill "babak-201") + (0 kill "babak-202") + (0 kill "babak-203") + (0 kill "babak-204") + (0 kill "babak-205") + (0 kill "babak-206") + (0 kill "babak-207") + (0 kill "babak-208") + (0 kill "babak-209") + (0 kill "babak-212") + (0 kill "quicksandlurker-5") + (0 kill "boatpaddle-4") + (0 kill "silostep-7") + (0 kill "silostep-8") + (0 kill "silostep-9") + (0 kill "silostep-10") + (0 kill "orb-cache-top-15") + (0 kill "windturbine-11") + (0 kill "teetertotter-5") + (0 kill "bone-platform-4") + (0 kill "misty-battle-controller-1") + (30 send-event self offset-army) + (196 joint "cameraB") + (196 shadow target #f) + (196 shadow self #f) + (380 send-event self evilbro) + (385 send-event "evilbro" draw #t) + (385 send-event "evilsis" draw #t) + (397 joint "camera") + (410 setting-reset ocean-off #t) + (456 joint "cameraB") + (546 joint "camera") + (701 joint "cameraB") + (701 setting-reset ocean-off near) + (776 joint "camera") + (776 setting-reset ocean-off #t) + (937 joint "cameraB") + (1027 joint "camera") + (1122 joint "cameraB") + (1221 joint "cameraB") + (1221 setting-reset ocean-off near) + (1280 alive "sequenceC-1") + (1281 save) + (1281 shadow target #t) + (1281 setting-unset ocean-off) ) ) ) @@ -1594,8 +1502,7 @@ ;; failed to figure out what this is: (defstate play-anim (sequenceB) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('offset-army) (dotimes (gp-0 9) @@ -1609,18 +1516,9 @@ (when (= (level-status *level* 'intro) 'active) (let ((gp-2 (entity-by-name "evilbro-2"))) (when gp-2 - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self evilbro) - (ppointer->handle (when s5-0 - (let ((t9-4 (method-of-type manipy activate))) - (t9-4 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> self root-override trans) gp-2 *evilbro-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> self evilbro) + (ppointer->handle (manipy-spawn (-> self root-override trans) gp-2 *evilbro-sg* #f :to self)) + ) (let ((gp-3 (handle->process (-> self evilbro)))) (when gp-3 (set! (-> (the-as evilbro gp-3) draw light-index) (the-as uint 1)) @@ -1645,18 +1543,9 @@ ) (let ((gp-4 (entity-by-name "evilsis-2"))) (when gp-4 - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self evilsis) - (ppointer->handle (when s5-1 - (let ((t9-15 (method-of-type manipy activate))) - (t9-15 (the-as manipy s5-1) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> self root-override trans) gp-4 *evilsis-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> self evilsis) + (ppointer->handle (manipy-spawn (-> self root-override trans) gp-4 *evilsis-sg* #f :to self)) + ) (let ((gp-5 (handle->process (-> self evilsis)))) (when gp-5 (set! (-> (the-as evilsis gp-5) draw light-index) (the-as uint 1)) @@ -1683,8 +1572,7 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (send-event *target* 'sidekick #t) (let ((a0-2 (handle->process (-> self bonelurker)))) (if a0-2 @@ -1722,8 +1610,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "sidekick-human-intro-sequence-c" 0 self (the-as float -1.0)) ((-> (method-of-type process-taskable play-anim) trans)) (none) @@ -1757,14 +1644,16 @@ (spawn (-> self part) gp-0) ) (when (>= (ja-aframe-num 0) 1590.0) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 561) -1 #f #f #f (-> self draw origin)) - (-> gp-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 561) + -1 + #f + #f + #f + (-> self draw origin) + :to *entity-pool* ) (send-event self 'trans-hook nothing) ) @@ -1787,119 +1676,96 @@ ;; definition for method 32 of type sequenceC ;; INFO: Return type mismatch spool-anim vs basic. (defmethod play-anim! sequenceC ((obj sequenceC) (arg0 symbol)) - (with-pp - (when arg0 - (set-setting! *setting-control* pp 'music-volume-movie 'abs (the-as float 0.0) 0) - (set-setting! *setting-control* pp 'sfx-volume-movie 'abs (the-as float 0.0) 0) - (set-setting! *setting-control* pp 'ambient-volume-movie 'abs (the-as float 0.0) 0) - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj bonelurker) - (ppointer->handle - (when s5-0 - (let ((t9-4 (method-of-type manipy activate))) - (t9-4 (the-as manipy s5-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> obj root-override trans) (-> obj entity) *bonelurker-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj bonelurker)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj bonelurker)) 'center-joint 3) - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj darkecocan) - (ppointer->handle - (when s5-1 - (let ((t9-9 (method-of-type manipy activate))) - (t9-9 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *darkecocan-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj darkecocan)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj darkecocan)) 'center-joint 3) - (send-event (handle->process (-> obj darkecocan)) 'trans-hook sequenceC-can-trans-hook) - (send-event - (handle->process (-> obj darkecocan)) - 'eval - (lambda :behavior sequenceC - () - ((method-of-type lod-set setup-lods!) - (the-as lod-set (&-> (the-as process-taskable (-> self parent 0)) stack 288)) - *darkecocan-glow-sg* - (-> self draw art-group) - (-> (the-as process-taskable (-> self parent 0)) entity) - ) - (let ((v0-1 (create-launch-control (-> *part-group-id-table* 560) self))) - (set! (-> self part) v0-1) - v0-1 - ) + (when arg0 + (set-setting! 'music-volume-movie 'abs 0.0 0) + (set-setting! 'sfx-volume-movie 'abs 0.0 0) + (set-setting! 'ambient-volume-movie 'abs 0.0 0) + (set! (-> obj bonelurker) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *bonelurker-sg* #f :to obj)) + ) + (send-event (handle->process (-> obj bonelurker)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj bonelurker)) 'center-joint 3) + (set! (-> obj darkecocan) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *darkecocan-sg* #f :to obj)) + ) + (send-event (handle->process (-> obj darkecocan)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj darkecocan)) 'center-joint 3) + (send-event (handle->process (-> obj darkecocan)) 'trans-hook sequenceC-can-trans-hook) + (send-event + (handle->process (-> obj darkecocan)) + 'eval + (lambda :behavior sequenceC + () + ((method-of-type lod-set setup-lods!) + (the-as lod-set (&-> (the-as process-taskable (-> self parent 0)) stack 288)) + *darkecocan-glow-sg* + (-> self draw art-group) + (-> (the-as process-taskable (-> self parent 0)) entity) + ) + (let ((v0-1 (create-launch-control (-> *part-group-id-table* 560) self))) + (set! (-> self part) v0-1) + v0-1 ) ) ) - (the-as basic (new 'static 'spool-anim - :name "sidekick-human-intro-sequence-c" - :index 6 - :parts 22 - :command-list - '((0 blackout 0) - (0 kill "fuel-cell-11") - (0 kill "fuel-cell-50") - (0 kill "money-1561") - (0 kill "money-1562") - (0 kill "money-1563") - (0 kill "money-1564") - (0 kill "money-1565") - (5 alive "dark-eco-pool-11") - (151 joint "cameraB") - (200 want-levels misty village1) - (236 joint "camera") - (301 joint "cameraB") - (421 joint "camera") - (460 shadow self #f) - (470 shadow self #t) - (496 joint "cameraB") - (611 joint "camera") - (721 joint "cameraB") - (1176 joint "camera") - (1271 joint "cameraB") - (1331 joint "camera") - (1386 joint "cameraB") - (1461 joint "camera") - (1524 joint "cameraB") - (1558 joint "camera") - (1602 joint "cameraB") - (1628 joint "camera") - (1676 joint "cameraB") - (1728 joint "camera") - (1791 joint "cameraB") - (1831 joint "camera") - (1942 joint "cameraB") - (2000 display-level village1 special) - (2028 joint "camera") - (2096 joint "cameraB") - (2154 joint "camera") - (2226 joint "cameraB") - (2266 joint "camera") - (2307 joint "cameraB") - (2431 joint "camera") - (2476 joint "cameraB") - (2530 display-level misty movie) - (2530 want-force-vis misty #t) - (2530 dead "dark-eco-pool-11") - (2534 display-level village1 display) - (2535 want-vis vi1) - (2536 joint "camera") - (2580 alive "sage-23") - (2596 save) - ) - ) - ) ) + (the-as basic (new 'static 'spool-anim + :name "sidekick-human-intro-sequence-c" + :index 6 + :parts 22 + :command-list '((0 blackout 0) + (0 kill "fuel-cell-11") + (0 kill "fuel-cell-50") + (0 kill "money-1561") + (0 kill "money-1562") + (0 kill "money-1563") + (0 kill "money-1564") + (0 kill "money-1565") + (5 alive "dark-eco-pool-11") + (151 joint "cameraB") + (200 want-levels misty village1) + (236 joint "camera") + (301 joint "cameraB") + (421 joint "camera") + (460 shadow self #f) + (470 shadow self #t) + (496 joint "cameraB") + (611 joint "camera") + (721 joint "cameraB") + (1176 joint "camera") + (1271 joint "cameraB") + (1331 joint "camera") + (1386 joint "cameraB") + (1461 joint "camera") + (1524 joint "cameraB") + (1558 joint "camera") + (1602 joint "cameraB") + (1628 joint "camera") + (1676 joint "cameraB") + (1728 joint "camera") + (1791 joint "cameraB") + (1831 joint "camera") + (1942 joint "cameraB") + (2000 display-level village1 special) + (2028 joint "camera") + (2096 joint "cameraB") + (2154 joint "camera") + (2226 joint "cameraB") + (2266 joint "camera") + (2307 joint "cameraB") + (2431 joint "camera") + (2476 joint "cameraB") + (2530 display-level misty movie) + (2530 want-force-vis misty #t) + (2530 dead "dark-eco-pool-11") + (2534 display-level village1 display) + (2535 want-vis vi1) + (2536 joint "camera") + (2580 alive "sage-23") + (2596 save) + ) + ) + ) ) ;; definition for method 31 of type sequenceC @@ -1910,8 +1776,7 @@ ;; failed to figure out what this is: (defstate play-anim (sequenceC) :virtual #t - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self bonelurker)))) (if a0-1 (deactivate a0-1) @@ -1926,8 +1791,7 @@ (start 'play (get-continue-by-name *game-info* "village1-intro")) (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "sage-intro-sequence-d1" 0 self (the-as float -1.0)) ((-> (method-of-type process-taskable play-anim) trans)) (none) @@ -1945,14 +1809,16 @@ (when (>= (ja-aframe-num 0) 1655.0) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (-> self node-list data 3)) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker s5-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 part-tracker-init (-> *part-group-id-table* 562) -1 #f #f #f gp-0) - (-> s5-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 562) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (set! (-> self cur-trans-hook) nothing) diff --git a/test/decompiler/reference/levels/ogre/flying-lurker_REF.gc b/test/decompiler/reference/levels/ogre/flying-lurker_REF.gc index 983b2834ca..c13593f241 100644 --- a/test/decompiler/reference/levels/ogre/flying-lurker_REF.gc +++ b/test/decompiler/reference/levels/ogre/flying-lurker_REF.gc @@ -1,14 +1,15 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/ogrecam-ag.gc") +(import "goal_src/import/plunger-lurker-ag.gc") +(import "goal_src/import/flying-lurker-ag.gc") + ;; failed to figure out what this is: -(defskelgroup *ogrecam-sg* ogrecam - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *ogrecam-sg* ogrecam ogrecam-lod0-jg -1 + ((ogrecam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 6) + ) ;; definition of type plunger-lurker (deftype plunger-lurker (process-drawable) @@ -38,40 +39,30 @@ ) ;; failed to figure out what this is: -(defskelgroup *plunger-lurker-sg* plunger-lurker - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 2 4 0 12) - :longest-edge (meters 0) - ) +(defskelgroup *plunger-lurker-sg* plunger-lurker plunger-lurker-lod0-jg plunger-lurker-idle-ja + ((plunger-lurker-lod0-mg (meters 20)) + (plunger-lurker-lod1-mg (meters 40)) + (plunger-lurker-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 2 4 0 12) + ) ;; failed to figure out what this is: (defstate plunger-lurker-plunge (plunger-lurker) - :code - (behavior () - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) + :code (behavior () + (set-setting! 'allow-progress #f 0.0 0) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) - (while (or (not *target*) (logtest? (-> *target* state-flags) #x8008)) + (while (or (not *target*) (logtest? (-> *target* state-flags) (state-flags being-attacked dying))) (suspend) ) (while (not (process-grab? *target*)) (suspend) ) - (let* ((gp-0 (get-process *default-dead-pool* manipy #x4000)) - (gp-1 - (ppointer->handle - (when gp-0 - (let ((t9-4 (method-of-type manipy activate))) - (t9-4 (the-as manipy gp-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 manipy-init (-> self entity extra trans) (-> self entity) *ogrecam-sg* #f) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 + (ppointer->handle (manipy-spawn (-> self entity extra trans) (-> self entity) *ogrecam-sg* #f :to self)) + ) + ) (let ((s5-0 (the-as othercam (get-process *default-dead-pool* othercam #x4000)))) (ppointer->handle (when s5-0 (let ((t9-7 (method-of-type othercam activate))) @@ -114,8 +105,7 @@ :name "plunger-lurker-blowup" :index 7 :parts 4 - :command-list - '((200 alive "tntbarrel-223") + :command-list '((200 alive "tntbarrel-223") (200 alive "tntbarrel-222") (200 alive "tntbarrel-221") (200 alive "tntbarrel-220") @@ -144,7 +134,7 @@ ) ) (the-as art-joint-anim #f) - (the-as art-joint-anim (-> self draw art-group data 4)) + (the-as art-joint-anim plunger-lurker-idle-ja) (the-as (function process-drawable symbol) false-func) ) (if (handle->process gp-1) @@ -169,61 +159,20 @@ (process-release? *target*) (suspend) 0 - (let ((a1-15 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-15 from) self) - (set! (-> a1-15 num-params) 2) - (set! (-> a1-15 message) 'attack-invinc) - (set! (-> a1-15 param 0) (the-as uint #f)) - (let ((a0-37 (new 'static 'array uint32 26 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x20 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - #x0 - ) - ) - ) - (set! (-> a0-37 17) (the-as uint 'instant-death)) - (set! (-> a1-15 param 1) (the-as uint a0-37)) - ) - (send-event-function *target* a1-15) - ) + (send-event *target* 'attack-invinc #f (static-attack-info ((mode 'instant-death)))) (cleanup-for-death self) (deactivate self) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior plunger-lurker) ja-post) + :post (the-as (function none :behavior plunger-lurker) ja-post) ) ;; failed to figure out what this is: (defstate plunger-lurker-flee (plunger-lurker) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'attack) (let ((v0-0 #t)) @@ -234,8 +183,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (-> self got-hit) (close-specific-task! (game-task plunger-lurker-hit) (task-status need-hint)) (process-entity-status! self (entity-perm-status complete) #t) @@ -246,69 +194,44 @@ *entity-pool* (game-task none) ) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 part-tracker-init (-> *part-group-id-table* 474) -1 #f #f #f (-> self root trans)) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 474) + -1 + #f + #f + #f + (-> self root trans) + :to *entity-pool* ) (cleanup-for-death self) (deactivate self) ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! plunger-lurker-notice-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! plunger-lurker-death-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior plunger-lurker) ja-post) + :post (the-as (function none :behavior plunger-lurker) ja-post) ) ;; failed to figure out what this is: (defstate plunger-lurker-idle (plunger-lurker) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('plunge) (logclear! (-> self mask) (process-mask actor-pause)) @@ -316,8 +239,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "plunger-lurker-blowup" 0 self -99.0) (when (and *target* (< (vector-vector-distance-squared (-> self root trans) (target-pos 0)) 6710886400.0)) (logclear! (-> self mask) (process-mask actor-pause)) @@ -325,37 +247,22 @@ ) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! plunger-lurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior plunger-lurker) ja-post) + :post (the-as (function none :behavior plunger-lurker) ja-post) ) ;; failed to figure out what this is: (defstate plunger-lurker-die (plunger-lurker) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (deactivate self) (suspend) @@ -461,14 +368,15 @@ ) ;; failed to figure out what this is: -(defskelgroup *flying-lurker-sg* flying-lurker - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 2 0 6) - :longest-edge (meters 2.3) - :shadow 4 - ) +(defskelgroup *flying-lurker-sg* flying-lurker flying-lurker-lod0-jg flying-lurker-fly-ja + ((flying-lurker-lod0-mg (meters 20)) + (flying-lurker-lod1-mg (meters 40)) + (flying-lurker-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 2 0 6) + :longest-edge (meters 2.3) + :shadow flying-lurker-shadow-mg + ) ;; definition for method 20 of type flying-lurker ;; INFO: Return type mismatch int vs none. @@ -489,7 +397,16 @@ (set! (-> a1-1 quad) (-> obj root trans quad)) (set! (-> a1-1 y) (+ -8192.0 (-> a1-1 y))) (set-vector! a2-0 0.0 -81920.0 0.0 1.0) - (when (>= (fill-and-probe-using-line-sphere *collide-cache* a1-1 a2-0 8192.0 (collide-kind background) pp s3-1 1) + (when (>= (fill-and-probe-using-line-sphere + *collide-cache* + a1-1 + a2-0 + 8192.0 + (collide-kind background) + pp + s3-1 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (set! (-> s3-1 intersect w) 8192.0) @@ -498,7 +415,7 @@ ) (set! s4-0 #t) (let ((v1-17 s5-0)) - (set! (-> v1-17 settings flags) (logand -33 (-> v1-17 settings flags))) + (logclear! (-> v1-17 settings flags) (shadow-flags disable-draw)) ) 0 (let ((v1-19 s5-0)) @@ -536,7 +453,7 @@ ) ) (when (not s4-0) - (logior! (-> s5-0 settings flags) 32) + (logior! (-> s5-0 settings flags) (shadow-flags disable-draw)) 0 (set! (-> obj draw bounds quad) (-> obj default-bounds quad)) (set! (-> obj draw origin-joint-index) (the-as uint 4)) @@ -553,7 +470,7 @@ (set! (-> self try-counted) #t) (let ((gp-0 (-> self entity extra perm))) (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) - (set! (-> gp-0 user-int8 0) (seekl (-> gp-0 user-int8 0) 255 1)) + (seekl! (-> gp-0 user-int8 0) 255 1) (set! (-> self try-count) (the-as uint (-> gp-0 user-int8 0))) ) ) @@ -568,8 +485,7 @@ ;; failed to figure out what this is: (defstate flying-lurker-die (flying-lurker) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (deactivate self) (none) @@ -578,11 +494,10 @@ ;; failed to figure out what this is: (defstate flying-lurker-sleep (flying-lurker) - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self draw status) (draw-status hidden)) - (while #t + (loop (suspend) ) (none) @@ -726,8 +641,7 @@ ;; failed to figure out what this is: (defstate flying-lurker-fly (flying-lurker) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'clone-and-kill-links) @@ -828,14 +742,12 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (dummy-20 self) (when (not (movie?)) (flying-lurker-calc-speed (meters 15.0) (meters 30.0) (meters 0.11666667) (meters 0.083333336)) @@ -867,43 +779,20 @@ ) (none) ) - :code - (behavior () - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) - ) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 param 0) (flying-lurker-calc-anim-speed)) - (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-loop!) + :code (behavior () + (loop + (when (not (ja-group? flying-lurker-fly-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! flying-lurker-fly-ja) ) + (ja :num! (loop! (flying-lurker-calc-anim-speed))) (suspend) (when (>= (- (-> *display* base-frame-counter) (-> self last-look-time)) (-> self time-to-next-look)) - (ja-channel-push! 1 60) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! flying-lurker-look-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self last-look-time) (-> *display* base-frame-counter)) (let* ((f30-0 300.0) @@ -918,8 +807,7 @@ ) (none) ) - :post - (the-as (function none :behavior flying-lurker) ja-post) + :post (the-as (function none :behavior flying-lurker) ja-post) ) ;; definition for function flying-lurker-handler @@ -1015,8 +903,8 @@ (logclear! (-> self mask) (process-mask actor-pause)) (close-specific-task! (game-task plunger-lurker-hit) (task-status unknown)) (while (and *target* - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) (suspend) ) @@ -1034,19 +922,10 @@ (suspend) (kill-current-level-hint '() '() 'die) (suspend) - (let* ((gp-0 (get-process *default-dead-pool* manipy #x4000)) - (gp-1 - (ppointer->handle - (when gp-0 - (let ((t9-5 (method-of-type manipy activate))) - (t9-5 (the-as manipy gp-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 manipy-init (-> self entity extra trans) (-> self entity) *ogrecam-sg* #f) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 + (ppointer->handle (manipy-spawn (-> self entity extra trans) (-> self entity) *ogrecam-sg* #f :to self)) + ) + ) (let ((s5-0 (the-as othercam (get-process *default-dead-pool* othercam #x4000)))) (ppointer->handle (when s5-0 (let ((t9-8 (method-of-type othercam activate))) @@ -1096,54 +975,44 @@ ) ) (process-release? *target*) - (let ((gp-2 (get-process *default-dead-pool* process #x4000))) - (when gp-2 - (let ((t9-18 (method-of-type process activate))) - (t9-18 gp-2 self 'process (the-as pointer #x70004000)) + (process-spawn-function + process + (lambda :behavior process + () + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) + (suspend) + ) ) - (run-next-time-in-process gp-2 (lambda :behavior process - () - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) - (suspend) - ) - ) - (level-hint-spawn - (game-text-id assistant-voicebox-intro-ogre-race) - "asstvb24" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (none) - ) - ) - (-> gp-2 ppointer) + (level-hint-spawn + (game-text-id assistant-voicebox-intro-ogre-race) + "asstvb24" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + (none) ) + :to self ) (none) ) ;; failed to figure out what this is: (defstate flying-lurker-start (flying-lurker) - :event - flying-lurker-handler - :exit - (behavior () - (clear-pending-settings-from-process *setting-control* self 'allow-progress) + :event flying-lurker-handler + :exit (behavior () + (remove-setting! 'allow-progress) (none) ) - :code - (behavior () + :code (behavior () (when (play-movie?) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (flying-lurker-play-intro) ) (flying-lurker-inc-try-count) (ja-channel-set! 1) - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) + (ja :group! flying-lurker-fly-ja) (let* ((v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-9 (the-as float (logior #x3f800000 v1-8))) (f0-2 (+ -1.0 v1-9)) @@ -1171,14 +1040,12 @@ ) (none) ) - :post - (the-as (function none :behavior flying-lurker) ja-post) + :post (the-as (function none :behavior flying-lurker) ja-post) ) ;; failed to figure out what this is: (defstate flying-lurker-clone (flying-lurker) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'die) @@ -1264,13 +1131,11 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (ja-channel-set! 0) (none) ) - :code - (behavior ((arg0 handle) (arg1 string)) + :code (behavior ((arg0 handle) (arg1 string)) (clone-anim arg0 3 #t arg1) (none) ) @@ -1278,8 +1143,7 @@ ;; failed to figure out what this is: (defstate flying-lurker-idle (flying-lurker) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('saw-player) (set! (-> self take-off) #t) @@ -1344,21 +1208,18 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "flying-lurker-intro" 0 self -99.0) (if (and (-> self take-off) (first?)) (go flying-lurker-start) ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (gp-0 int) (f30-0 float)) 1.0 0 @@ -1376,7 +1237,7 @@ (set! gp-0 11) ) ) - (while #t + (loop (cond ((play-movie?) (ja-channel-set! 0) @@ -1397,28 +1258,14 @@ 0 ) (else - (let ((v1-27 (-> self skel root-channel 0))) - (set! (-> v1-27 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) f30-0) - (set! (-> a0-9 frame-num) (the float gp-0)) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja :group! flying-lurker-fly-ja) + (ja-no-eval :group! flying-lurker-fly-ja :num! (seek! max f30-0) :frame-num (the float gp-0)) (until (ja-done? 0) (if (and *target* (>= 172032.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (send-event self 'saw-player) ) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) f30-0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (set! gp-0 0) ) @@ -1426,8 +1273,7 @@ ) (none) ) - :post - (the-as (function none :behavior flying-lurker) ja-post) + :post (the-as (function none :behavior flying-lurker) ja-post) ) ;; definition for method 11 of type flying-lurker @@ -1467,7 +1313,7 @@ (new 'process 'shadow-control 131072.0 151552.0 614400.0 (the-as float 60) 409600.0) ) (let ((v1-27 (-> obj draw shadow-ctrl))) - (set! (-> v1-27 settings flags) (logand -33 (-> v1-27 settings flags))) + (logclear! (-> v1-27 settings flags) (shadow-flags disable-draw)) ) 0 (set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) diff --git a/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc b/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc index d971ac5507..92b59956cb 100644 --- a/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc +++ b/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc @@ -1,22 +1,26 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/ogre-step-ag.gc") +(import "goal_src/import/tntbarrel-ag.gc") +(import "goal_src/import/ogre-bridge-ag.gc") +(import "goal_src/import/shortcut-boulder-ag.gc") +(import "goal_src/import/medres-snow-ag.gc") +(import "goal_src/import/ogre-bridgeend-ag.gc") +(import "goal_src/import/ogre-isle-ag.gc") + ;; failed to figure out what this is: -(defskelgroup *med-res-snow-sg* medres-snow - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -390 150 70 410) - :longest-edge (meters 0) - ) +(defskelgroup *med-res-snow-sg* medres-snow medres-snow-lod0-jg medres-snow-idle-ja + ((medres-snow-lod0-mg (meters 999999))) + :bounds (static-spherem -390 150 70 410) + ) ;; failed to figure out what this is: (defpartgroup group-tntbarrel-BIG-explosion :id 473 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2234 :period 3000 :length 5) + :parts ((sp-item 2234 :period 3000 :length 5) (sp-item 2235 :period 3000 :length 5) (sp-item 2236 :period 3000 :length 40) (sp-item 2237 :period 3000 :length 40) @@ -26,8 +30,7 @@ ;; failed to figure out what this is: (defpart 2236 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 2.4) (meters 1.8) 1.0) @@ -55,14 +58,12 @@ ;; failed to figure out what this is: (defpart 2239 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2238 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-flt spt-scale-x (meters 0.5)) @@ -83,8 +84,7 @@ ;; failed to figure out what this is: (defpart 2234 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 128)) @@ -100,8 +100,7 @@ ;; failed to figure out what this is: (defpart 2235 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 32)) @@ -117,8 +116,7 @@ ;; failed to figure out what this is: (defpart 2237 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 48.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 16) (meters 10) 1.0) @@ -147,8 +145,7 @@ ;; failed to figure out what this is: (defpart 2240 - :init-specs - ((sp-flt spt-fade-r -0.26666668) + :init-specs ((sp-flt spt-fade-r -0.26666668) (sp-flt spt-fade-g -0.26666668) (sp-flt spt-fade-b -0.52916664) (sp-int spt-next-time 240) @@ -158,8 +155,7 @@ ;; failed to figure out what this is: (defpart 2241 - :init-specs - ((sp-flt spt-fade-r -0.24380952) + :init-specs ((sp-flt spt-fade-r -0.24380952) (sp-flt spt-fade-g -0.12190476) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.09142857) @@ -170,8 +166,7 @@ ;; failed to figure out what this is: (defpart 2242 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: @@ -180,8 +175,7 @@ :duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2079 :period 600 :length 5) + :parts ((sp-item 2079 :period 600 :length 5) (sp-item 2080 :period 600 :length 40) (sp-item 2081 :period 600 :length 20) (sp-item 2082 :period 600 :length 20) @@ -190,8 +184,7 @@ ;; failed to figure out what this is: (defpart 2080 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -219,14 +212,12 @@ ;; failed to figure out what this is: (defpart 2083 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2082 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-flt spt-scale-x (meters 0.3)) @@ -247,8 +238,7 @@ ;; failed to figure out what this is: (defpart 2079 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 24)) @@ -265,8 +255,7 @@ ;; failed to figure out what this is: (defpart 2081 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -295,8 +284,7 @@ ;; failed to figure out what this is: (defpart 2084 - :init-specs - ((sp-flt spt-fade-r -1.0666667) + :init-specs ((sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g -1.0666667) (sp-flt spt-fade-b -2.1166666) (sp-int spt-next-time 60) @@ -306,8 +294,7 @@ ;; failed to figure out what this is: (defpart 2085 - :init-specs - ((sp-flt spt-fade-r -0.5688889) + :init-specs ((sp-flt spt-fade-r -0.5688889) (sp-flt spt-fade-g -0.28444445) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334) @@ -318,18 +305,14 @@ ;; failed to figure out what this is: (defpart 2086 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: -(defskelgroup *tntbarrel-sg* tntbarrel - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 2 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *tntbarrel-sg* tntbarrel tntbarrel-lod0-jg tntbarrel-idle-ja + ((tntbarrel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 4) + ) ;; definition of type tntbarrel (deftype tntbarrel (process-drawable) @@ -356,54 +339,35 @@ ;; failed to figure out what this is: (defstate die (tntbarrel) :virtual #t - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) - (cond - (arg0 - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-6 (method-of-type part-tracker activate))) - (t9-6 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 473) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + (sound-play "dcrate-break") + (if arg0 + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 473) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* + ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 474) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) ) - (else - (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-2 - (let ((t9-9 (method-of-type part-tracker activate))) - (t9-9 (the-as part-tracker gp-2) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - part-tracker-init - (-> *part-group-id-table* 474) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-2 ppointer) - ) - ) - ) - ) (suspend) (cleanup-for-death self) (deactivate self) @@ -414,8 +378,7 @@ ;; failed to figure out what this is: (defstate idle (tntbarrel) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('die-big) (go-virtual die #t) @@ -424,23 +387,12 @@ (go-virtual die #f) ) (('attack 'touch) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'attack-invinc) - (set! (-> a1-7 param 0) (-> arg3 param 0)) - (let ((a2-2 (new 'static 'attack-info :mask #x20))) - (set! (-> a2-2 mode) 'death) - (set! (-> a1-7 param 1) (the-as uint a2-2)) - ) - (send-event-function arg0 a1-7) - ) + (send-event arg0 'attack-invinc (-> arg3 param 0) (static-attack-info ((mode 'death)))) (go-virtual die #f) ) ) ) - :code - (behavior () + :code (behavior () (transform-post) (logior! (-> self mask) (process-mask sleep)) (suspend) @@ -474,67 +426,46 @@ ) ;; failed to figure out what this is: -(defskelgroup *ogre-step-a-sg* ogre-step - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 3 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-step-a-sg* ogre-step ogre-step-a-lod0-jg ogre-step-a-idle-ja + ((ogre-step-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3 0 5) + ) ;; failed to figure out what this is: -(defskelgroup *ogre-step-b-sg* ogre-step - 3 - 5 - ((4 (meters 999999))) - :bounds (static-spherem 0 3 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-step-b-sg* ogre-step ogre-step-b-lod0-jg ogre-step-b-idle-ja + ((ogre-step-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3 0 5) + ) ;; failed to figure out what this is: -(defskelgroup *ogre-step-c-sg* ogre-step - 6 - 8 - ((7 (meters 999999))) - :bounds (static-spherem 0 3 0 6.5) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-step-c-sg* ogre-step ogre-step-c-lod0-jg ogre-step-c-idle-ja + ((ogre-step-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3 0 6.5) + ) ;; failed to figure out what this is: -(defskelgroup *ogre-isle-a-sg* ogre-isle - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-isle-a-sg* ogre-isle ogre-isle-a-lod0-jg ogre-isle-a-idle-ja + ((ogre-isle-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; failed to figure out what this is: -(defskelgroup *ogre-isle-b-sg* ogre-isle - 3 - 5 - ((4 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-isle-b-sg* ogre-isle ogre-isle-b-lod0-jg ogre-isle-b-idle-ja + ((ogre-isle-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; failed to figure out what this is: -(defskelgroup *ogre-isle-c-sg* ogre-isle - 6 - 8 - ((7 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-isle-c-sg* ogre-isle ogre-isle-c-lod0-jg ogre-isle-c-idle-ja + ((ogre-isle-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; failed to figure out what this is: -(defskelgroup *ogre-isle-d-sg* ogre-isle - 9 - 11 - ((10 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-isle-d-sg* ogre-isle ogre-isle-d-lod0-jg ogre-isle-d-idle-ja + ((ogre-isle-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; definition of type ogre-plat (deftype ogre-plat (rigid-body-platform) @@ -577,8 +508,7 @@ ;; failed to figure out what this is: (defstate rigid-body-platform-idle (ogre-plat) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'trigger) (set! (-> self triggered) (the-as entity-actor #t)) @@ -591,8 +521,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (cond ((-> self active) (when (and *target* (>= (-> self info idle-distance) @@ -600,7 +529,7 @@ ) ) (if (-> self triggered) - (sound-play-by-name (static-sound-name "rock-in-lava") (new-sound-id) 1024 0 0 1 #t) + (sound-play "rock-in-lava") ) (go-virtual rigid-body-platform-float) ) @@ -613,60 +542,50 @@ ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior ogre-plat) ja-post) + :post (the-as (function none :behavior ogre-plat) ja-post) ) ;; failed to figure out what this is: (defstate rigid-body-platform-float (ogre-plat) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior ogre-plat) rigid-body-platform-event-handler ) - :trans - (behavior () + :trans (behavior () (cond ((or (not *target*) (< (-> self info idle-distance) (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) ) ) (let ((f30-1 (-> self idle-y-offset))) - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) (if (= (-> self float-height-offset) f30-1) (go-virtual rigid-body-platform-idle) ) ) ) (else - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) (-> self float-y-offset) (* 32768.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) (-> self float-y-offset) (* 32768.0 (-> *display* seconds-per-frame))) ) ) (none) ) - :code - (behavior () + :code (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior ogre-plat) rigid-body-platform-post) + :post (the-as (function none :behavior ogre-plat) rigid-body-platform-post) ) ;; definition for method 30 of type ogre-plat @@ -1045,13 +964,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *ogre-bridge-sg* ogre-bridge - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 52) - :longest-edge (meters 4.5) - ) +(defskelgroup *ogre-bridge-sg* ogre-bridge ogre-bridge-lod0-jg ogre-bridge-idle-ja + ((ogre-bridge-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 52) + :longest-edge (meters 4.5) + ) ;; definition of type ogre-bridge (deftype ogre-bridge (process-drawable) @@ -1113,27 +1030,24 @@ ;; failed to figure out what this is: (defstate ogre-bridge-idle (ogre-bridge) - :exit - (behavior () + :exit (behavior () (ogre-bridge-update-joints) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (and *target* (>= 286720.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) (go ogre-bridge-activate) ) 0 (none) ) - :code - (behavior () + :code (behavior () (ja-post) - (while #t + (loop (suspend) ) (none) @@ -1142,58 +1056,38 @@ ;; failed to figure out what this is: (defstate ogre-bridge-activate (ogre-bridge) - :code - (behavior () + :code (behavior () (let ((v1-0 (entity-actor-lookup (-> self entity) 'alt-actor 0))) - (when (when v1-0 - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'next-stage) - (not (send-event-function + (when (if v1-0 + (not (send-event (if v1-0 (-> v1-0 extra process) ) - a1-1 + 'next-stage ) ) ) - ) (suspend) 0 ) ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (rand-vu-percent? 0.2) (spawn-projectile-blue *target*) ) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ogre-bridge-activated) (none) ) - :post - (the-as (function none :behavior ogre-bridge) rider-post) + :post (the-as (function none :behavior ogre-bridge) rider-post) ) ;; failed to figure out what this is: (defstate ogre-bridge-activated (ogre-bridge) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('break) (+! (-> self dead-joint-count) 4) @@ -1208,89 +1102,60 @@ ) ) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 3) :num! max) (transform-post) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior ogre-bridge) ja-post) + :post (the-as (function none :behavior ogre-bridge) ja-post) ) ;; failed to figure out what this is: (defstate ogre-bridge-break (ogre-bridge) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) - (the-as - object - (when (= v1-0 'effect) - (when (= (-> arg3 param 0) 'splash) - (let ((gp-0 (new 'stack-no-clear 'vector))) - (let ((a1-1 (-> arg3 param 2))) - (set! (-> gp-0 quad) (-> self node-list data a1-1 bone transform vector 3 quad)) - ) - (set! (-> gp-0 y) 118784.0) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker s5-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 part-tracker-init (-> *part-group-id-table* 466) -1 #f #f #f gp-0) - (-> s5-0 ppointer) - ) - ) + (the-as object (when (= v1-0 'effect) + (when (= (-> arg3 param 0) 'splash) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((a1-1 (-> arg3 param 2))) + (set! (-> gp-0 quad) (-> self node-list data a1-1 bone transform vector 3 quad)) + ) + (set! (-> gp-0 y) 118784.0) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 466) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* + ) + ) + ) + ) ) - ) - ) - ) ) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ogre-bridge-idle) (none) ) - :post - (the-as (function none :behavior ogre-bridge) rider-post) + :post (the-as (function none :behavior ogre-bridge) rider-post) ) ;; definition for symbol *ogre-bridge-joint-array*, type (array uint8) -(define - *ogre-bridge-joint-array* - (the-as (array uint8) - (new 'static 'boxed-array :type uint8 :length 8 :allocated-length 8 #x4 #x9 #xc #x11 #x7 #xa #xf #x12) - ) +(define *ogre-bridge-joint-array* + (the-as (array uint8) (new 'static 'boxed-array :type uint8 #x4 #x9 #xc #x11 #x7 #xa #xf #x12)) ) ;; definition for method 11 of type ogre-bridge @@ -1494,13 +1359,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *ogre-bridgeend-sg* ogre-bridgeend - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 -3 8.2) - :longest-edge (meters 0) - ) +(defskelgroup *ogre-bridgeend-sg* ogre-bridgeend ogre-bridgeend-lod0-jg ogre-bridgeend-idle-ja + ((ogre-bridgeend-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -3 8.2) + ) ;; definition of type ogre-bridgeend (deftype ogre-bridgeend (process-drawable) @@ -1525,8 +1387,7 @@ ;; failed to figure out what this is: (defstate ogre-bridgeend-idle (ogre-bridgeend) - :code - (behavior () + :code (behavior () (transform-post) (anim-loop) (none) @@ -1580,8 +1441,7 @@ ;; failed to figure out what this is: (defstate water-vol-idle (ogre-lava) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('submerge1) (set! (-> self anim) 3) @@ -1608,63 +1468,30 @@ ) ) ) - :code - (behavior () - (ja-channel-push! 2 30) - (let ((gp-0 (-> self skel root-channel 1))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self idle-anim))) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self anim)))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self anim))) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 0.5) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 2 (seconds 0.1)) + (ja :chan 1 :group! (-> self draw art-group data (-> self idle-anim)) :num! min) + (ja-no-eval :group! (-> self draw art-group data (-> self anim)) :num! (seek! max 0.5) :frame-num 0.0) (until (ja-done? 0) - (let ((v1-25 (-> self skel root-channel 1))) - (set! (-> v1-25 frame-interp) 0.5) - ) + (ja :chan 1 :frame-interp 0.5) (ja-post) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 0.5) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.5)) ) - (let ((v1-37 (-> self skel root-channel 0))) - (set! (-> v1-37 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self idle-anim)))) - ) - (let ((v1-40 (-> self skel root-channel 0))) - (set! (-> v1-40 num-func) num-func-identity) - (set! (-> v1-40 frame-num) 0.0) - ) - (while #t + (ja :group! (-> self draw art-group data (-> self idle-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior ogre-lava) #f) + :post (the-as (function none :behavior ogre-lava) #f) ) ;; failed to figure out what this is: (defstate water-vol-startup (ogre-lava) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self idle-anim) 2) (set! (-> self anim) (-> self idle-anim)) (go-virtual water-vol-idle) @@ -1676,8 +1503,7 @@ (define ripple-for-ogre-lava (new 'static 'ripple-wave-set :count 2 :converted #f - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 2 :speed 3.0) (new 'static 'ripple-wave :scale 40.0 :xdiv -2 :zdiv 2 :speed 1.8) (new 'static 'ripple-wave) @@ -1697,8 +1523,8 @@ (set! (-> v1-2 global-scale) 2048.0) (set! (-> v1-2 waveform) ripple-for-ogre-lava) ) - (set! (-> obj flags) (logand -8388609 (-> obj flags))) - (set! (-> obj flags) (logior #x2000000 (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt23)) + (set! (-> obj flags) (logior (water-flags wt25) (-> obj flags))) (set! (-> obj attack-event) 'lava) (none) ) @@ -1728,22 +1554,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *shortcut-boulder-whole-sg* shortcut-boulder - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 5.5 0 7.5) - :longest-edge (meters 0) - ) +(defskelgroup *shortcut-boulder-whole-sg* shortcut-boulder shortcut-boulder-whole-lod0-jg shortcut-boulder-idle-ja + ((shortcut-boulder-whole-lod0-mg (meters 999999))) + :bounds (static-spherem 0 5.5 0 7.5) + ) ;; failed to figure out what this is: -(defskelgroup *shortcut-boulder-broken-sg* shortcut-boulder - 2 - 4 - ((3 (meters 999999))) - :bounds (static-spherem 0 5.5 0 20) - :longest-edge (meters 0) - ) +(defskelgroup *shortcut-boulder-broken-sg* shortcut-boulder shortcut-boulder-broken-lod0-jg shortcut-boulder-idle-ja + ((shortcut-boulder-broken-lod0-mg (meters 999999))) + :bounds (static-spherem 0 5.5 0 20) + ) ;; failed to figure out what this is: (defpartgroup group-shortcut-boulder-explosion @@ -1751,8 +1571,7 @@ :duration 300 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2149 :period 1500 :length 5) + :parts ((sp-item 2149 :period 1500 :length 5) (sp-item 2150 :period 1500 :length 5) (sp-item 2151 :period 1500 :length 15) ) @@ -1760,8 +1579,7 @@ ;; failed to figure out what this is: (defpart 2150 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 15)) (sp-copy-from-other spt-scale-y -4) @@ -1777,8 +1595,7 @@ ;; failed to figure out what this is: (defpart 2149 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 16.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1802,8 +1619,7 @@ ;; failed to figure out what this is: (defpart 2151 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -1828,80 +1644,40 @@ ;; failed to figure out what this is: (defpart 2152 - :init-specs - ((sp-flt spt-fade-a -0.2)) + :init-specs ((sp-flt spt-fade-a -0.2)) ) ;; failed to figure out what this is: (defstate shortcut-boulder-break (shortcut-boulder) - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) (lods-assign! (-> self draw) (-> self broken-look)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 475) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-5 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! - a0-5 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 475) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (cleanup-for-death self) (deactivate self) (none) ) - :post - (the-as (function none :behavior shortcut-boulder) ja-post) + :post (the-as (function none :behavior shortcut-boulder) ja-post) ) ;; failed to figure out what this is: (defstate shortcut-boulder-idle (shortcut-boulder) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (if (and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow)) @@ -1910,10 +1686,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) diff --git a/test/decompiler/reference/levels/ogre/ogre-part_REF.gc b/test/decompiler/reference/levels/ogre/ogre-part_REF.gc index 551bcc3e3a..6f8042e6e7 100644 --- a/test/decompiler/reference/levels/ogre/ogre-part_REF.gc +++ b/test/decompiler/reference/levels/ogre/ogre-part_REF.gc @@ -8,8 +8,7 @@ :linger-duration 3000 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2193 :period 1500 :length 5) + :parts ((sp-item 2193 :period 1500 :length 5) (sp-item 2194 :period 1500 :length 40) (sp-item 2195 :period 1500 :length 20) (sp-item 2196 :period 1500 :length 20) @@ -18,8 +17,7 @@ ;; failed to figure out what this is: (defpart 2194 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters -5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1.2) 1.0) @@ -47,14 +45,12 @@ ;; failed to figure out what this is: (defpart 2197 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2196 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters -5) (meters 1) 1.0) (sp-flt spt-scale-x (meters 0.6)) @@ -75,8 +71,7 @@ ;; failed to figure out what this is: (defpart 2193 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -4)) (sp-flt spt-scale-x (meters 44)) @@ -93,8 +88,7 @@ ;; failed to figure out what this is: (defpart 2195 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 24.0) (sp-rnd-flt spt-y (meters -5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 5) (meters 2.5) 1.0) @@ -123,8 +117,7 @@ ;; failed to figure out what this is: (defpart 2198 - :init-specs - ((sp-flt spt-fade-r -0.21333334) + :init-specs ((sp-flt spt-fade-r -0.21333334) (sp-flt spt-fade-g -0.21333334) (sp-flt spt-fade-b 0.0) (sp-int spt-next-time 150) @@ -134,8 +127,7 @@ ;; failed to figure out what this is: (defpart 2199 - :init-specs - ((sp-flt spt-fade-r -0.021333333) + :init-specs ((sp-flt spt-fade-r -0.021333333) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.08533333) @@ -146,8 +138,7 @@ ;; failed to figure out what this is: (defpart 2200 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: @@ -157,14 +148,12 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2023)) + :parts ((sp-item 2023)) ) ;; failed to figure out what this is: (defpart 2023 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) @@ -189,14 +178,12 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2108) (sp-item 2109) (sp-item 2110) (sp-item 2111)) + :parts ((sp-item 2108) (sp-item 2109) (sp-item 2110) (sp-item 2111)) ) ;; failed to figure out what this is: (defpart 2111 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 4.0 1.0) (sp-flt spt-y (meters -3)) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.75) 1.0) @@ -218,8 +205,7 @@ ;; failed to figure out what this is: (defpart 2108 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 0) (meters 2) 1.0) (sp-flt spt-y (meters -3)) @@ -246,8 +232,7 @@ ;; failed to figure out what this is: (defpart 2109 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 3) (meters 4) 1.0) (sp-flt spt-y (meters -3)) @@ -274,8 +259,7 @@ ;; failed to figure out what this is: (defpart 2110 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters 0) (meters 3) 1.0) (sp-rnd-flt spt-y (meters -3) (meters 1) 1.0) @@ -307,8 +291,7 @@ ;; failed to figure out what this is: (defpart 2112 - :init-specs - ((sp-flt spt-fade-a -0.08)) + :init-specs ((sp-flt spt-fade-a -0.08)) ) ;; failed to figure out what this is: @@ -318,14 +301,12 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 2201) (sp-item 2202) (sp-item 2203) (sp-item 2204)) + :parts ((sp-item 2201) (sp-item 2202) (sp-item 2203) (sp-item 2204)) ) ;; failed to figure out what this is: (defpart 2203 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) @@ -353,8 +334,7 @@ ;; failed to figure out what this is: (defpart 2205 - :init-specs - ((sp-flt spt-fade-r -0.85333335) + :init-specs ((sp-flt spt-fade-r -0.85333335) (sp-flt spt-fade-g -0.42666668) (sp-flt spt-fade-b -0.42666668) (sp-flt spt-fade-a -0.85333335) @@ -363,8 +343,7 @@ ;; failed to figure out what this is: (defpart 2204 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0) @@ -384,8 +363,7 @@ ;; failed to figure out what this is: (defpart 2201 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-rnd-flt spt-scale-x (meters 28) (meters 4) 1.0) @@ -402,8 +380,7 @@ ;; failed to figure out what this is: (defpart 2202 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-rnd-flt spt-scale-x (meters 16) (meters 4) 1.0) @@ -423,14 +400,12 @@ (defpartgroup group-ogreboss-missile :id 469 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 1933) (sp-item 1934)) + :parts ((sp-item 1933) (sp-item 1934)) ) ;; failed to figure out what this is: (defpart 1934 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.3 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 2) 1.0) @@ -458,8 +433,7 @@ ;; failed to figure out what this is: (defpart 1933 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.3 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 2) 1.0) @@ -489,8 +463,7 @@ :linger-duration 600 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 2079 :period 600 :length 5) + :parts ((sp-item 2079 :period 600 :length 5) (sp-item 2206 :period 600 :length 40) (sp-item 2206 :period 600 :length 40) (sp-item 2206 :period 600 :length 30) @@ -503,8 +476,7 @@ ;; failed to figure out what this is: (defpart 2206 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -537,8 +509,7 @@ :duration 300 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 2079 :period 600 :length 5) + :parts ((sp-item 2079 :period 600 :length 5) (sp-item 2080 :period 600 :length 40) (sp-item 2148 :period 600 :length 20) (sp-item 2082 :period 600 :length 20) @@ -549,8 +520,7 @@ (defpartgroup group-ogre-lava-lava-20x20 :id 472 :bounds (static-bspherem 0 0 0 14) - :parts - ((sp-item 2030 :fade-after (meters 40) :falloff-to (meters 40)) + :parts ((sp-item 2030 :fade-after (meters 40) :falloff-to (meters 40)) (sp-item 2031 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 2032 :fade-after (meters 80) :falloff-to (meters 80) :binding 2028) (sp-item 2028 :flags (start-dead)) @@ -570,8 +540,7 @@ ;; failed to figure out what this is: (defpart 2031 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) @@ -598,8 +567,7 @@ ;; failed to figure out what this is: (defpart 2033 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0)) @@ -620,8 +588,7 @@ ;; failed to figure out what this is: (defpart 2032 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.02 0.02 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0)) @@ -644,8 +611,7 @@ ;; failed to figure out what this is: (defpart 2030 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -10) (meters 20) 1.0) @@ -667,20 +633,17 @@ ;; failed to figure out what this is: (defpart 2035 - :init-specs - ((sp-flt spt-fade-b 16.384)) + :init-specs ((sp-flt spt-fade-b 16.384)) ) ;; failed to figure out what this is: (defpart 2034 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 2036)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 2036)) ) ;; failed to figure out what this is: (defpart 2036 - :init-specs - ((sp-flt spt-fade-r -0.85333335) + :init-specs ((sp-flt spt-fade-r -0.85333335) (sp-flt spt-fade-g -0.42666668) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2037) @@ -689,14 +652,12 @@ ;; failed to figure out what this is: (defpart 2037 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a -0.10666667)) ) ;; failed to figure out what this is: (defpart 2028 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.7) (sp-rnd-flt spt-scale-x (meters 0.75) (meters 0.25) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -714,8 +675,7 @@ ;; failed to figure out what this is: (defpart 2029 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) diff --git a/test/decompiler/reference/levels/ogre/ogreboss_REF.gc b/test/decompiler/reference/levels/ogre/ogreboss_REF.gc index 0eaeb00ec5..2a13424ffd 100644 --- a/test/decompiler/reference/levels/ogre/ogreboss_REF.gc +++ b/test/decompiler/reference/levels/ogre/ogreboss_REF.gc @@ -1,98 +1,69 @@ ;;-*-Lisp-*- (in-package goal) -;; failed to figure out what this is: -(defskelgroup *ogreboss-sg* ogreboss - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 20) - :longest-edge (meters 0) - ) +(import "goal_src/import/ogreboss-ag.gc") ;; failed to figure out what this is: -(defskelgroup *ogreboss-cam-sg* ogreboss - 25 - 27 - ((26 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *ogreboss-sg* ogreboss ogreboss-lod0-jg ogreboss-idle-ja + ((ogreboss-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) ;; failed to figure out what this is: -(defskelgroup *ogreboss-shoot-boulder-sg* ogreboss - 29 - 32 - ((30 (meters 999999))) - :bounds (static-spherem 0 0 0 300) - :longest-edge (meters 0) - :shadow 31 - ) +(defskelgroup *ogreboss-cam-sg* ogreboss ogreboss-cam-lod0-jg ogreboss-cam-idle-ja + ((ogreboss-cam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; failed to figure out what this is: -(defskelgroup *ogreboss-shoot-boulder-break-sg* ogreboss - 33 - 35 - ((34 (meters 999999))) - :bounds (static-spherem 0 0 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *ogreboss-shoot-boulder-sg* ogreboss ogreboss-shoot-boulder-lod0-jg ogreboss-shoot-boulder-idle-ja + ((ogreboss-shoot-boulder-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 300) + :shadow ogreboss-shoot-boulder-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *ogreboss-bounce-boulder-sg* ogreboss - 36 - 38 - ((37 (meters 999999))) - :bounds (static-spherem 0 0 0 50) - :longest-edge (meters 0) - ) +(defskelgroup *ogreboss-shoot-boulder-break-sg* ogreboss ogreboss-shoot-boulder-break-lod0-jg ogreboss-shoot-boulder-break-idle-ja + ((ogreboss-shoot-boulder-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) ;; failed to figure out what this is: -(defskelgroup *ogreboss-super-boulder-sg* ogreboss - 39 - 41 - ((40 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *ogreboss-bounce-boulder-sg* ogreboss ogreboss-bounce-boulder-lod0-jg ogreboss-bounce-boulder-idle-ja + ((ogreboss-bounce-boulder-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + ) ;; failed to figure out what this is: -(defskelgroup *ogreboss-column-sg* ogreboss - 45 - 47 - ((46 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *ogreboss-super-boulder-sg* ogreboss ogreboss-super-boulder-lod0-jg ogreboss-super-boulder-idle-ja + ((ogreboss-super-boulder-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; failed to figure out what this is: +(defskelgroup *ogreboss-column-sg* ogreboss ogreboss-column-lod0-jg ogreboss-column-idle-ja + ((ogreboss-column-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) ;; definition for symbol *ogreboss-missile-shadow-control*, type shadow-control -(define - *ogreboss-missile-shadow-control* +(define *ogreboss-missile-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #xe)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 614400.0) - :bot-plane - (new 'static 'plane :y 1.0 :w -102400.0) - :top-plane - (new 'static 'plane :y 1.0 :w -143360.0) + :flags (shadow-flags disable-fade shdf02 shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) + :bot-plane (new 'static 'plane :y 1.0 :w -102400.0) + :top-plane (new 'static 'plane :y 1.0 :w -143360.0) ) ) ) ;; definition for symbol *ogreboss-shadow-control*, type shadow-control -(define - *ogreboss-shadow-control* +(define *ogreboss-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #xc)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 614400.0) - :bot-plane - (new 'static 'plane :y 1.0 :w -102400.0) - :top-plane - (new 'static 'plane :y 1.0 :w -143360.0) + :flags (shadow-flags shdf02 shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) + :bot-plane (new 'static 'plane :y 1.0 :w -102400.0) + :top-plane (new 'static 'plane :y 1.0 :w -143360.0) :fade-dist 819200.0 ) ) @@ -138,13 +109,11 @@ ;; failed to figure out what this is: (defstate ogreboss-missile-idle (ogreboss-missile) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'collide-tri-result)) @@ -162,7 +131,7 @@ (-> self root-override root-prim collide-with) (-> self parent-override 0) s4-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -185,14 +154,12 @@ (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior ogreboss-missile) transform-post) + :post (the-as (function none :behavior ogreboss-missile) transform-post) ) ;; failed to figure out what this is: (defstate ogreboss-missile-seek (ogreboss-missile) - :post - (behavior () + :post (behavior () (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) (transform-post) (none) @@ -203,39 +170,25 @@ ;; INFO: Return type mismatch int vs handle. (defun ogreboss-rock-explosion-effect ((arg0 basic)) (with-pp - (sound-play-by-name (static-sound-name "ogre-explode") (new-sound-id) 1024 0 0 1 (the-as symbol arg0)) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 471) -1 #f #f #f arg0) - (-> gp-1 ppointer) - ) + (sound-play "ogre-explode" :position (the-as symbol arg0)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 471) + -1 + #f + #f + #f + arg0 + :to *entity-pool* ) - (activate! - *camera-smush-control* - (the-as float 819.2) - 37 - 600 - (-> (new 'static 'array float 1 1.0) 0) - (the-as float 0.995) - ) - (let* ((s4-1 (get-process *default-dead-pool* manipy #x4000)) - (gp-2 (when s4-1 - (let ((t9-7 (method-of-type manipy activate))) - (t9-7 (the-as manipy s4-1) pp 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 manipy-init arg0 (-> pp entity) *ogreboss-shoot-boulder-break-sg* #f) - (-> s4-1 ppointer) - ) - ) - ) + (activate! *camera-smush-control* (the-as float 819.2) 37 600 (the-as float 1.0) (the-as float 0.995)) + (let ((gp-2 (manipy-spawn arg0 (-> pp entity) *ogreboss-shoot-boulder-break-sg* #f :to pp))) (quaternion-axis-angle! (-> (the-as manipy (-> gp-2 0)) root quat) - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) + (the-as float 1.0) + (the-as float 0.0) (* 65536.0 (rand-vu)) ) (send-event (ppointer->process gp-2) 'anim-mode 'play1) @@ -249,15 +202,9 @@ (defun ogreboss-missile-scale-explosion ((arg0 handle)) (let* ((gp-0 (handle->process arg0)) (f0-0 (-> (the-as process-drawable gp-0) root scale x)) - (f0-2 (seek f0-0 (-> (new 'static 'array float 1 0.0) 0) (-> *display* seconds-per-frame))) + (f0-2 (seek f0-0 (the-as float 0.0) (-> *display* seconds-per-frame))) ) - (set-vector! - (-> (the-as process-drawable gp-0) root scale) - f0-2 - f0-2 - f0-2 - (-> (new 'static 'array float 1 1.0) 0) - ) + (set-vector! (-> (the-as process-drawable gp-0) root scale) f0-2 f0-2 f0-2 1.0) ) 0 (none) @@ -265,25 +212,14 @@ ;; failed to figure out what this is: (defstate ogreboss-missile-impact (ogreboss-missile) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touched) (cond (#f (cond ((= (-> arg0 type) target) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'attack) - (set! (-> a1-1 param 0) (-> arg3 param 0)) - (let ((a0-3 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-3 mode) 'explode) - (set! (-> a1-1 param 1) (the-as uint a0-3)) - ) - (send-event-function arg0 a1-1) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'explode)))) ) (else (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -321,7 +257,7 @@ 0.0 (set! (-> s4-1 quad) (-> (the-as target t1-0) control trans quad)) (set! (-> s4-1 y) (+ 4096.0 (-> s4-1 y))) - (set-vector! s3-0 0.0 (- 118784.0 (-> s4-1 y)) 0.0 (-> (new 'static 'array float 1 1.0) 0)) + (set-vector! s3-0 0.0 (- 118784.0 (-> s4-1 y)) 0.0 1.0) (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* @@ -331,30 +267,20 @@ (-> self root-override root-prim collide-with) t1-0 t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-1 s3-0 - (-> (new 'static 'array float 1 1.0) 0) + (meters 0.00024414062) (the-as rgba (new 'static 'rgba :g #xff :a #x80)) ) (when (>= f30-0 0.0) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'attack) - (set! (-> a1-7 param 0) (-> arg3 param 0)) - (let ((a0-16 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-16 mode) 'damage) - (set! (-> a1-7 param 1) (the-as uint a0-16)) - ) - (send-event-function arg0 a1-7) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'damage)))) (send-event (ppointer->process (-> self parent-override)) 'victory) ) ) @@ -362,7 +288,7 @@ ) (else (let ((v1-37 (new 'stack-no-clear 'vector))) - (set-vector! v1-37 0.0 -12288000.0 0.0 (-> (new 'static 'array float 1 1.0) 0)) + (set-vector! v1-37 0.0 -12288000.0 0.0 1.0) (send-event arg0 'impulse v1-37) ) ) @@ -373,8 +299,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask enemy projectile)) (ogreboss-rock-explosion-effect (the-as basic (-> self root-override trans))) (when (nonzero? (-> self pickup-type)) @@ -410,8 +335,7 @@ (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior ogreboss-missile) ja-post) + :post (the-as (function none :behavior ogreboss-missile) ja-post) ) ;; definition of type ogreboss-missile-init-data @@ -443,7 +367,7 @@ ;; definition for function ogreboss-missile-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior ogreboss-missile-init-by-other ogreboss-missile ((arg0 ogreboss-missile-init-data) (arg1 entity)) +(defbehavior ogreboss-missile-init-by-other ogreboss-missile ((arg0 ogreboss-missile-init-data) (arg1 entity-actor)) (set! (-> self entity) arg1) (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -496,19 +420,13 @@ (quaternion-axis-angle! (-> self tumble-quat) (cos f30-1) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (sin f30-1) (the-as float 2730.6667) ) ) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 469) self)) - (set-vector! - (-> self draw color-emissive) - (-> (new 'static 'array float 1 0.125) 0) - (-> (new 'static 'array float 1 0.0625) 0) - 0.0 - 0.0 - ) + (set-vector! (-> self draw color-emissive) 0.125 0.0625 0.0 0.0) (go ogreboss-missile-idle) (none) ) @@ -573,17 +491,7 @@ (the-as uint 1) ) ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (let ((a0-4 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-4 mode) 'ogreboss-super-boulder) - (set! (-> a1-2 param 1) (the-as uint a0-4)) - ) - (send-event-function arg0 a1-2) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'ogreboss-super-boulder)))) (go ogreboss-super-boulder-killed-player) ) ) @@ -616,8 +524,7 @@ ;; failed to figure out what this is: (defstate ogreboss-super-boulder-idle (ogreboss-super-boulder) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('speedup) (let ((f0-1 (* 1.3 (-> self speed)))) @@ -626,7 +533,7 @@ ) ) (('grow-faster) - (let ((f0-2 (-> (new 'static 'array float 1 1.0) 0))) + (let ((f0-2 1.0)) (set! (-> self grow-rate) f0-2) f0-2 ) @@ -642,25 +549,16 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self sound-id)) (none) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 41)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! ogreboss-super-boulder-idle-ja :num! min) (set! (-> self joint enable) #t) - (set! (-> self joint blend) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> self joint blend) 1.0) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (quaternion-vector-angle! (-> self tumble-quat) (-> self spin-axis) @@ -668,65 +566,43 @@ ) (quaternion*! (-> self joint transform quat) (-> self joint transform quat) (-> self tumble-quat)) (+! (-> self size) (* (-> self grow-rate) (-> *display* seconds-per-frame))) - (set! (-> self size) (fmin (-> (new 'static 'array float 1 1.0) 0) (-> self size))) + (set! (-> self size) (fmin 1.0 (-> self size))) (let* ((f0-10 (sqrtf (-> self size))) (f28-0 (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> self state-time))))) (f30-0 (* 116508.445 f28-0 (-> self speed))) ) - (set-vector! (-> self joint transform scale) f0-10 f0-10 f0-10 (-> (new 'static 'array float 1 1.0) 0)) + (set-vector! (-> self joint transform scale) f0-10 f0-10 f0-10 1.0) (let ((gp-1 (-> self joint transform))) (set! (-> gp-1 trans x) (* 4096.0 (sin f30-0))) (set! (-> gp-1 trans y) (+ 122880.0 (* 12288.0 (sin (* 98304.0 f28-0))))) (set! (-> gp-1 trans z) (* 4096.0 (cos f30-0))) - (set! (-> gp-1 trans w) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> gp-1 trans w) 1.0) ) ) (spawn (-> self part) (-> self node-list data 3 bone transform vector 3)) - (sound-play-by-name - (static-sound-name "ogre-rock") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self joint transform)) - ) + (sound-play "ogre-rock" :id (-> self sound-id) :position (the-as symbol (-> self joint transform))) (suspend) ) (none) ) - :post - (the-as (function none :behavior ogreboss-super-boulder) transform-post) + :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) ;; definition for function ogreboss-super-boulder-impact-effect ;; INFO: Return type mismatch int vs none. (defbehavior ogreboss-super-boulder-impact-effect ogreboss-super-boulder () - (sound-play-by-name - (static-sound-name "ogre-boulder") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self draw origin)) - ) - (activate! - *camera-smush-control* - (the-as float 819.2) - 37 - 600 - (-> (new 'static 'array float 1 1.0) 0) - (the-as float 0.995) - ) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 471) -1 #f #f #f (-> self draw origin)) - (-> gp-1 ppointer) - ) + (sound-play "ogre-boulder" :position (the-as symbol (-> self draw origin))) + (activate! *camera-smush-control* (the-as float 819.2) 37 600 (the-as float 1.0) (the-as float 0.995)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 471) + -1 + #f + #f + #f + (-> self draw origin) + :to *entity-pool* ) 0 (none) @@ -737,102 +613,66 @@ ;; Used lq/sq (defbehavior ogreboss-super-boulder-play-hit-anim ogreboss-super-boulder () (set! (-> self src-pos quad) (-> self root-override trans quad)) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 43)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 43)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-super-boulder-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (set! (-> self joint blend) - (seek (-> self joint blend) (-> (new 'static 'array float 1 0.0) 0) (* 5.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (-> *display* seconds-per-frame))) (let* ((f1-1 (/ (- (ja-frame-num 0) (ja-aframe (the-as float 54.0) 0)) (- (the float (ja-num-frames 0)) (ja-aframe (the-as float 54.0) 0)) ) ) - (f0-13 (fmax 0.0 (fmin (-> (new 'static 'array float 1 1.0) 0) f1-1))) + (f0-13 (fmax 0.0 (fmin 1.0 f1-1))) ) (vector-lerp! (-> self root-override trans) (-> self src-pos) (-> self orig-pos) f0-13) ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (the-as object 0) ) ;; failed to figure out what this is: (defstate ogreboss-super-boulder-throw (ogreboss-super-boulder) - :event - ogreboss-super-boulder-event-handler - :code - (behavior () + :event ogreboss-super-boulder-event-handler + :code (behavior () (set! (-> self hit-boss) #f) (set! (-> self src-pos quad) (-> self root-override trans quad)) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 42))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 42)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 42)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-super-boulder-throw-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (set! (-> self joint blend) - (seek (-> self joint blend) (-> (new 'static 'array float 1 0.0) 0) (* 5.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (-> *display* seconds-per-frame))) (let* ((f1-1 (/ (- (ja-frame-num 0) (ja-aframe (the-as float 32.0) 0)) (- (the float (ja-num-frames 0)) (ja-aframe (the-as float 32.0) 0)) ) ) - (f0-13 (fmax 0.0 (fmin (-> (new 'static 'array float 1 1.0) 0) f1-1))) + (f0-13 (fmax 0.0 (fmin 1.0 f1-1))) ) (vector-lerp! (-> self root-override trans) (-> self src-pos) (-> self orig-pos) f0-13) ) 0 (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ogreboss-super-boulder-land) (none) ) - :post - (the-as (function none :behavior ogreboss-super-boulder) transform-post) + :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) ;; failed to figure out what this is: (defstate ogreboss-super-boulder-hit (ogreboss-super-boulder) - :event - ogreboss-super-boulder-event-handler - :code - (behavior () + :event ogreboss-super-boulder-event-handler + :code (behavior () (set! (-> self hit-boss) #t) (ogreboss-super-boulder-play-hit-anim) (go ogreboss-super-boulder-land) (none) ) - :post - (the-as (function none :behavior ogreboss-super-boulder) transform-post) + :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) ;; failed to figure out what this is: (defstate ogreboss-super-boulder-die (ogreboss-super-boulder) - :event - ogreboss-super-boulder-event-handler - :code - (behavior () + :event ogreboss-super-boulder-event-handler + :code (behavior () (ogreboss-super-boulder-play-hit-anim) (ogreboss-rock-explosion-effect (the-as basic (-> self draw origin))) (ogreboss-rock-explosion-effect (the-as basic (-> self draw origin))) @@ -843,45 +683,34 @@ (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior ogreboss-super-boulder) transform-post) + :post (the-as (function none :behavior ogreboss-super-boulder) transform-post) ) ;; failed to figure out what this is: (defstate ogreboss-super-boulder-land (ogreboss-super-boulder) - :event - ogreboss-super-boulder-event-handler - :code - (behavior () + :event ogreboss-super-boulder-event-handler + :code (behavior () (set! (-> self root-override trans quad) (-> self orig-pos quad)) (ogreboss-super-boulder-impact-effect) (set! (-> self joint enable) #f) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 44))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 100.0) 0)) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-super-boulder-roll-ja + :num! (seek! (ja-aframe (the-as float 100.0) 0)) + :frame-num 0.0 + ) (until (ja-done? 0) (when (< 81920.0 (vector-vector-distance (the-as vector (-> self root-override root-prim prim-core)) (target-pos 0)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (go ogreboss-super-boulder-roll) ) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe (the-as float 100.0) 0)) - (set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 100.0) 0))) ) (go ogreboss-super-boulder-roll) (none) ) - :post - (behavior () + :post (behavior () (transform-post) 0 (none) @@ -890,25 +719,16 @@ ;; failed to figure out what this is: (defstate ogreboss-super-boulder-roll (ogreboss-super-boulder) - :event - ogreboss-super-boulder-event-handler - :code - (behavior () + :event ogreboss-super-boulder-event-handler + :code (behavior () (ogreboss-super-boulder-impact-effect) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 44))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 162.0) 0)) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) (ja-aframe (the-as float 100.0) 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-super-boulder-roll-ja + :num! (seek! (ja-aframe (the-as float 162.0) 0)) + :frame-num (ja-aframe (the-as float 100.0) 0) + ) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 162.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 162.0) 0))) ) (set! (-> self root-override root-prim local-sphere w) 28672.0) (cond @@ -953,28 +773,18 @@ ) ) ) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 44))) - (set! (-> gp-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 44)) data 0 length) -1)) - ) - (set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-4 frame-num) (ja-aframe (the-as float 162.0) 0)) - (joint-control-channel-group! gp-4 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-super-boulder-roll-ja + :num! (seek!) + :frame-num (ja-aframe (the-as float 162.0) 0) + ) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (cleanup-for-death self) (none) ) - :post - (behavior () + :post (behavior () (transform-post) 0 (none) @@ -998,11 +808,10 @@ ;; failed to figure out what this is: (defstate ogreboss-super-boulder-killed-player (ogreboss-super-boulder) - :code - (behavior () + :code (behavior () (clear-collide-with-as (-> self root-override)) (ja-post) - (while #t + (loop (suspend) ) (none) @@ -1012,7 +821,7 @@ ;; definition for function ogreboss-super-boulder-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior ogreboss-super-boulder-init-by-other ogreboss-super-boulder ((arg0 vector) (arg1 float) (arg2 entity)) +(defbehavior ogreboss-super-boulder-init-by-other ogreboss-super-boulder ((arg0 vector) (arg1 float) (arg2 entity-actor)) (set! (-> self entity) arg2) (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -1046,21 +855,15 @@ (quaternion-axis-angle! (-> self tumble-quat) (cos f30-1) - (-> (new 'static 'array float 1 0.0) 0) + (the-as float 0.0) (sin f30-1) (the-as float 2730.6667) ) ) (set! (-> self joint) (new 'process 'joint-mod-blend-local self 3 #f)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 468) self)) - (set-vector! - (-> self draw color-emissive) - (-> (new 'static 'array float 1 0.125) 0) - (-> (new 'static 'array float 1 0.0625) 0) - 0.0 - 0.0 - ) - (set! (-> self speed) (-> (new 'static 'array float 1 1.0) 0)) + (set-vector! (-> self draw color-emissive) 0.125 0.0625 0.0 0.0) + (set! (-> self speed) 1.0) (set! (-> self size) 0.0) (set! (-> self grow-rate) (/ 300.0 arg1)) (set! (-> self sound-id) (new-sound-id)) @@ -1118,60 +921,37 @@ ;; failed to figure out what this is: (defstate ogreboss-bounce-boulder-idle (ogreboss-bounce-boulder) - :event - ogreboss-bounce-boulder-event-handler - :code - (behavior () + :event ogreboss-bounce-boulder-event-handler + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((f30-0 (-> (new 'static 'array float 1 2.0) 0))) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 40.0) 0)) - (set! (-> gp-0 param 1) f30-0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-seek!) - ) + (let ((f30-0 2.0)) + (ja-no-eval :group! ogreboss-bounce-boulder-idle-ja + :num! (seek! (ja-aframe (the-as float 40.0) 0) f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (set! (-> self side-pos) - (* (fmin (-> (new 'static 'array float 1 1.0) 0) (/ (ja-frame-num 0) (ja-aframe (the-as float 40.0) 0))) - (-> self dest-pos) - ) + (* (fmin 1.0 (/ (ja-frame-num 0) (ja-aframe (the-as float 40.0) 0))) (-> self dest-pos)) ) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 40.0) 0)) - (set! (-> gp-1 param 1) f30-0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> gp-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 38)) data 0 length) -1)) - ) - (set! (-> gp-2 param 1) f30-0) - (set! (-> gp-2 frame-num) (ja-aframe (the-as float 40.0) 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-seek!) + (ja :num! (seek! (ja-aframe (the-as float 40.0) 0) f30-0)) ) + (ja-no-eval :group! ogreboss-bounce-boulder-idle-ja + :num! (seek! max f30-0) + :frame-num (ja-aframe (the-as float 40.0) 0) + ) (until (ja-done? 0) (if (>= (ja-frame-num 0) (ja-aframe (the-as float 235.0) 0)) - (set! (-> self side-pos) - (seek (-> self side-pos) (-> (new 'static 'array float 1 0.0) 0) (* 20480.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self side-pos) (the-as float 0.0) (* 20480.0 (-> *display* seconds-per-frame))) ) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) f30-0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (cleanup-for-death self) (none) ) - :post - (behavior () + :post (behavior () (vector+*! (-> self root-override trans) (-> self src-pos) (-> self side-dir) (-> self side-pos)) (transform-post) (find-ground-and-draw-shadow @@ -1179,8 +959,8 @@ (the-as vector #f) (the-as float 49152.0) (collide-kind background) - (the-as process #f) - (-> (new 'static 'array float 1 0.0) 0) + (the-as process-drawable #f) + (the-as float 0.0) (the-as float 409600.0) ) (none) @@ -1190,7 +970,7 @@ ;; definition for function ogreboss-bounce-boulder-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior ogreboss-bounce-boulder-init-by-other ogreboss-bounce-boulder ((arg0 int) (arg1 entity)) +(defbehavior ogreboss-bounce-boulder-init-by-other ogreboss-bounce-boulder ((arg0 int) (arg1 entity-actor)) (set! (-> self entity) arg1) (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1219,7 +999,7 @@ (set! (-> self side-pos) 0.0) (set! (-> self dest-pos) (the-as float (cond ((zero? arg0) - (-> (new 'static 'array float 1 0.0) 0) + 0.0 ) ((= arg0 1) -20480.0 @@ -1228,7 +1008,7 @@ 20480.0 ) (else - (-> (new 'static 'array float 1 0.0) 0) + 0.0 ) ) ) @@ -1237,13 +1017,7 @@ (initialize-skeleton self *ogreboss-bounce-boulder-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self draw origin-joint-index) (the-as uint 3)) - (set-vector! - (-> self draw color-emissive) - (-> (new 'static 'array float 1 0.125) 0) - (-> (new 'static 'array float 1 0.0625) 0) - 0.0 - 0.0 - ) + (set-vector! (-> self draw color-emissive) 0.125 0.0625 0.0 0.0) (go ogreboss-bounce-boulder-idle) (none) ) @@ -1339,7 +1113,7 @@ (set! (-> self try-counted) #t) (let ((gp-0 (-> self entity extra perm))) (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) - (set! (-> gp-0 user-int8 0) (seekl (-> gp-0 user-int8 0) 255 1)) + (seekl! (-> gp-0 user-int8 0) 255 1) (set! (-> self try-count) (the-as uint (-> gp-0 user-int8 0))) ) ) @@ -1375,106 +1149,53 @@ ;; definition for function ogreboss-idle-loop (defbehavior ogreboss-idle-loop ogreboss () - (while #t - (ja-channel-push! 1 30) + (loop + (ja-channel-push! 1 (seconds 0.1)) (let ((v1-0 (rand-vu-int-range 0 2))) (cond ((zero? v1-0) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-0 param 0) (ja-aframe (the-as float 140.0) 0)) - (set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-idle-ja :num! (seek! (ja-aframe (the-as float 140.0) 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe (the-as float 140.0) 0)) - (set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 140.0) 0))) ) (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.16666667)) + (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.167)) (suspend) ) ) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-3 param 0) (ja-aframe (the-as float 168.0) 0)) - (set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-3 frame-num) (ja-aframe (the-as float 140.0) 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-idle-ja + :num! (seek! (ja-aframe (the-as float 168.0) 0)) + :frame-num (ja-aframe (the-as float 140.0) 0) + ) (until (ja-done? 0) (suspend) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 param 0) (ja-aframe (the-as float 168.0) 0)) - (set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 168.0) 0))) ) (let ((gp-5 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 0.16666667)) + (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 0.167)) (suspend) ) ) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> gp-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> gp-6 frame-num) (ja-aframe (the-as float 168.0) 0)) - (joint-control-channel-group! gp-6 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-idle-ja :num! (seek!) :frame-num (ja-aframe (the-as float 168.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((= v1-0 1) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-idle-alt-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else (dotimes (gp-7 4) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-21 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-21 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-21 frame-num) 0.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-idle-bored-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) (the float (+ (-> a0-22 frame-group data 0 length) -1))) - (set! (-> a0-22 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -1487,20 +1208,9 @@ ;; failed to figure out what this is: (defstate ogreboss-idle (ogreboss) - :enter - (behavior () + :enter (behavior () (when (zero? (-> self try-count)) - (let* ((s5-0 (get-process *default-dead-pool* manipy #x4000)) - (gp-0 - (when s5-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> self root-override trans) (-> self entity) *ogreboss-column-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) + (let ((gp-0 (manipy-spawn (-> self root-override trans) (-> self entity) *ogreboss-column-sg* #f :to self))) (set! (-> self column) (ppointer->handle gp-0)) (send-event (ppointer->process gp-0) 'anim-mode 'loop) (send-event (ppointer->process gp-0) 'art-joint-anim "ogreboss-column-idle" 0) @@ -1509,8 +1219,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (try-preload-stream *art-control* "$GAMCAM23" 0 self (the-as float -99.0)) (when *target* (let ((gp-0 (-> *target* control trans))) @@ -1524,20 +1233,17 @@ ) (none) ) - :code - (behavior () + :code (behavior () (ogreboss-reset-camera) (ogreboss-idle-loop) (none) ) - :post - (the-as (function none :behavior ogreboss) ja-post) + :post (the-as (function none :behavior ogreboss) ja-post) ) ;; failed to figure out what this is: (defstate ogreboss-intro (ogreboss) - :code - (behavior () + :code (behavior () (when (zero? (-> self try-count)) (process-drawable-delay-player (seconds 1)) (let ((gp-0 (get-process *default-dead-pool* pov-camera #x4000))) @@ -1561,40 +1267,26 @@ ) (send-event (handle->process (-> self column)) 'anim-mode 'play1) (send-event (handle->process (-> self column)) 'art-joint-anim "ogreboss-column-intro" 0) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 24))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 24)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 24)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-intro-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (close-specific-task! (game-task ogre-boss) (task-status need-hint)) (suspend) (send-event *target* 'continue (get-continue-by-name *game-info* "ogre-start")) (ogreboss-inc-try-count) ) - (set-setting! *setting-control* self 'music 'ogreboss (-> (new 'static 'array float 1 0.0) 0) 0) + (set-setting! 'music 'ogreboss 0.0 0) (go ogreboss-wait-for-player) (none) ) - :post - (the-as (function none :behavior ogreboss) ja-post) + :post (the-as (function none :behavior ogreboss) ja-post) ) ;; failed to figure out what this is: (defstate ogreboss-wait-for-player (ogreboss) - :trans - (behavior () + :trans (behavior () (when *target* (if (ogreboss-player-inside-range? (the-as float 614400.0)) (go ogreboss-stage1) @@ -1605,13 +1297,11 @@ ) (none) ) - :code - (behavior () + :code (behavior () (ogreboss-idle-loop) (none) ) - :post - (the-as (function none :behavior ogreboss) ja-post) + :post (the-as (function none :behavior ogreboss) ja-post) ) ;; definition for function ogreboss-debug-adjust-difficulty @@ -1659,19 +1349,14 @@ ;; definition for function ogreboss-shoot-boulder ;; INFO: Return type mismatch int vs none. ;; Used lq/sq -(defbehavior ogreboss-shoot-boulder ogreboss ((arg0 int)) +(defbehavior ogreboss-shoot-boulder ogreboss ((arg0 pickup-type)) (let ((gp-0 (new 'stack-no-clear 'ogreboss-missile-init-data))) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 src) (-> self node-list data 52 bone transform vector 3)) (set! (-> gp-0 duration) - (the-as - time-frame - (the int - (* 300.0 (+ 1.25 (* -0.25 (-> self level)) (/ (-> (new 'static 'array float 1 0.5) 0) (-> self difficulty)))) - ) - ) + (the-as time-frame (the int (* 300.0 (+ 1.25 (* -0.25 (-> self level)) (/ 0.5 (-> self difficulty)))))) ) - (set! (-> gp-0 pickup-type) (the-as pickup-type arg0)) + (set! (-> gp-0 pickup-type) arg0) (set! (-> gp-0 blast-radius) 32768.0) (cond (*target* @@ -1697,33 +1382,19 @@ ) (set! (-> gp-0 dest) s5-0) ) - (sound-play-by-name - (static-sound-name "ogre-fires") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) - (let ((s5-2 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-2 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-2) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 part-tracker-init (-> *part-group-id-table* 470) -1 #f #f #f (-> gp-0 src)) - (-> s5-2 ppointer) - ) - ) - (let ((s5-3 (get-process *default-dead-pool* ogreboss-missile #x4000))) - (when s5-3 - (let ((t9-8 (method-of-type ogreboss-missile activate))) - (t9-8 (the-as ogreboss-missile s5-3) self 'ogreboss-missile (the-as pointer #x70004000)) - ) - (run-now-in-process s5-3 ogreboss-missile-init-by-other gp-0 (-> self entity)) - (-> s5-3 ppointer) - ) + (sound-play "ogre-fires" :position (the-as symbol (-> self root-override trans))) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 470) + -1 + #f + #f + #f + (-> gp-0 src) + :to *entity-pool* ) + (process-spawn ogreboss-missile gp-0 (-> self entity) :to self) ) 0 (none) @@ -1734,36 +1405,18 @@ (defbehavior ogreboss-submerge ogreboss ((arg0 time-frame) (arg1 float)) (when (not (-> self submerged)) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 13) - ) + ((ja-group? ogreboss-dive-ja) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) arg1) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max arg1)) ) ) (else - (ja-channel-push! 1 30) - (let ((s4-0 (-> self skel root-channel 0))) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> s4-0 param 0) (ja-aframe (the-as float 22.0) 0)) - (set! (-> s4-0 param 1) arg1) - (set! (-> s4-0 frame-num) 0.0) - (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ogreboss-dive-ja :num! (seek! (ja-aframe (the-as float 22.0) 0) arg1) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((s4-1 (-> self skel root-channel 0))) - (set! (-> s4-1 param 0) (ja-aframe (the-as float 22.0) 0)) - (set! (-> s4-1 param 1) arg1) - (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe (the-as float 22.0) 0) arg1)) ) (cond ((-> self at-near-spot) @@ -1801,22 +1454,10 @@ ) ) ) - (let ((s4-2 (-> self skel root-channel 0))) - (set! (-> s4-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> s4-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 13)) data 0 length) -1)) - ) - (set! (-> s4-2 param 1) arg1) - (set! (-> s4-2 frame-num) (ja-aframe (the-as float 22.0) 0)) - (joint-control-channel-group! s4-2 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-dive-ja :num! (seek! max arg1) :frame-num (ja-aframe (the-as float 22.0) 0)) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) arg1) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max arg1)) ) ) ) @@ -1874,22 +1515,10 @@ ) ) ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 14))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 14)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) arg0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 14)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-rise-ja :num! (seek! max arg0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) arg0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max arg0)) ) ) 0 @@ -1935,8 +1564,7 @@ ;; failed to figure out what this is: (defstate ogreboss-stage1 (ogreboss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('next-stage) (set! (-> self bridge-assembled) #t) @@ -1944,13 +1572,11 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (-> self bridge-assembled) (ogreboss-player-inside-range? (the-as float 524288.0)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) @@ -1959,89 +1585,48 @@ ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self mask) (logior (process-mask enemy) (-> self mask))) (ogreboss-set-stage1-camera) - (ogreboss-move-near (seconds 3) (-> (new 'static 'array float 1 1.0) 0)) + (ogreboss-move-near (seconds 3) (the-as float 1.0)) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 16) - ) - (ja-channel-push! 1 30) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + ((ja-group? ogreboss-victory-ja) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ogreboss-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (ja-channel-push! 1 30) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ogreboss-roar-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (let* ((gp-0 (the int (* (-> self difficulty) (+ 8.0 (* 4.0 (-> self level)))))) - (f0-17 (-> (new 'static 'array float 1 1.0) 0)) + (f0-17 1.0) (f1-2 0.15) (f2-2 (-> self difficulty)) (f30-0 (+ f0-17 (* f1-2 (* f2-2 f2-2) (-> self level)))) ) - (ja-channel-push! 1 30) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) f30-0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ogreboss-attack2-start-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) f30-0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (countdown (gp-1 (+ gp-0 -1)) - (let ((s5-0 0)) + (let ((boulder-pickup (pickup-type none))) (let ((f28-0 0.0)) (cond - ((>= (-> (new 'static 'array float 1 1.0) 0) (-> *target* fact-info-target health)) + ((>= 1.0 (-> *target* fact-info-target health)) (set! f28-0 0.1) ) - ((>= (-> (new 'static 'array float 1 2.0) 0) (-> *target* fact-info-target health)) + ((>= 2.0 (-> *target* fact-info-target health)) (set! f28-0 0.05) ) ) @@ -2050,7 +1635,7 @@ (* 0.0 f28-0) ) ((< (-> self try-count) (the-as uint 10)) - (* (-> (new 'static 'array float 1 0.5) 0) f28-0) + (* 0.5 f28-0) ) (else (empty) @@ -2059,87 +1644,42 @@ ) ) (if (and *target* (< (rand-vu) f28-0)) - (set! s5-0 4) + (set! boulder-pickup (pickup-type eco-green)) ) ) - (ogreboss-shoot-boulder s5-0) - ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) f30-0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) + (ogreboss-shoot-boulder (the-as pickup-type boulder-pickup)) ) + (ja-no-eval :group! ogreboss-attack2-loop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) f30-0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (ogreboss-inc-try-count) ) - (ogreboss-shoot-boulder 3) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) f30-0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ogreboss-shoot-boulder (pickup-type eco-blue)) + (ja-no-eval :group! ogreboss-attack2-last-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) f30-0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) - (ogreboss-move-far (seconds 2) (-> (new 'static 'array float 1 1.0) 0)) - (ja-channel-push! 1 30) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-28 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-28 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-28 frame-num) 0.0) - (joint-control-channel-group! a0-28 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + (ogreboss-move-far (seconds 2) (the-as float 1.0)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ogreboss-victory-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1))) - (set! (-> a0-29 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ogreboss-stage1) (none) ) - :post - ogreboss-post + :post ogreboss-post ) ;; definition for function ogreboss-roll-boulder ;; INFO: Return type mismatch int vs none. (defbehavior ogreboss-roll-boulder ogreboss () - (sound-play-by-name - (static-sound-name "ogre-fires") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-fires" :position (the-as symbol (-> self root-override trans))) (+! (-> self roll-boulder) (rand-vu-int-range 1 2)) (if (>= (-> self roll-boulder) 3) (+! (-> self roll-boulder) -3) @@ -2147,37 +1687,13 @@ (let ((v1-7 (-> self roll-boulder))) (cond ((zero? v1-7) - (let ((gp-2 (get-process *default-dead-pool* ogreboss-bounce-boulder #x4000))) - (when gp-2 - (let ((t9-4 (method-of-type ogreboss-bounce-boulder activate))) - (t9-4 (the-as ogreboss-bounce-boulder gp-2) self 'ogreboss-bounce-boulder (the-as pointer #x70004000)) - ) - (run-now-in-process gp-2 ogreboss-bounce-boulder-init-by-other 2 (-> self entity)) - (-> gp-2 ppointer) - ) - ) + (process-spawn ogreboss-bounce-boulder 2 (-> self entity) :to self) ) ((= v1-7 1) - (let ((gp-3 (get-process *default-dead-pool* ogreboss-bounce-boulder #x4000))) - (when gp-3 - (let ((t9-7 (method-of-type ogreboss-bounce-boulder activate))) - (t9-7 (the-as ogreboss-bounce-boulder gp-3) self 'ogreboss-bounce-boulder (the-as pointer #x70004000)) - ) - (run-now-in-process gp-3 ogreboss-bounce-boulder-init-by-other 1 (-> self entity)) - (-> gp-3 ppointer) - ) - ) + (process-spawn ogreboss-bounce-boulder 1 (-> self entity) :to self) ) (else - (let ((gp-4 (get-process *default-dead-pool* ogreboss-bounce-boulder #x4000))) - (when gp-4 - (let ((t9-10 (method-of-type ogreboss-bounce-boulder activate))) - (t9-10 (the-as ogreboss-bounce-boulder gp-4) self 'ogreboss-bounce-boulder (the-as pointer #x70004000)) - ) - (run-now-in-process gp-4 ogreboss-bounce-boulder-init-by-other 0 (-> self entity)) - (-> gp-4 ppointer) - ) - ) + (process-spawn ogreboss-bounce-boulder 0 (-> self entity) :to self) ) ) ) @@ -2193,11 +1709,8 @@ ) (let ((f30-0 (the float (- (-> *display* base-frame-counter) (-> self hit-time))))) (when (and (> (-> self hit-count) 0) (>= 45.0 f30-0)) - (set! f0-0 (+ (ja-aframe (-> (new 'static 'array float 1 0.0) 0) 1) - (* 0.022222223 - f30-0 - (- (ja-aframe (the-as float 8.0) 1) (ja-aframe (-> (new 'static 'array float 1 0.0) 0) 1)) - ) + (set! f0-0 (+ (ja-aframe (the-as float 0.0) 1) + (* 0.022222223 f30-0 (- (ja-aframe (the-as float 8.0) 1) (ja-aframe (the-as float 0.0) 1))) ) ) (set! f1-0 (cond @@ -2214,11 +1727,7 @@ ) ) ) - (let ((v1-22 (-> self skel root-channel 1))) - (set! (-> v1-22 frame-interp) f1-0) - (set! (-> v1-22 num-func) num-func-identity) - (set! (-> v1-22 frame-num) f0-0) - ) + (ja :chan 1 :frame-interp f1-0 :num-func num-func-identity :frame-num f0-0) ) 0 (none) @@ -2252,69 +1761,25 @@ (let ((v1-0 arg2)) (the-as object (when (= v1-0 'attack) (when (-> self vulnerable) - (cond - (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 128) - ) - (let ((gp-0 (-> self skel root-channel 1))) - (set! (-> gp-0 frame-interp) 0.0) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 11)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) + (if ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 128) ) - ) - (else - (let ((gp-1 (-> self skel root-channel 1))) - (set! (-> gp-1 frame-interp) 0.0) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 10)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :chan 1 :group! ogreboss-hit-crotch-ja :num! min :frame-interp 0.0) + (ja :chan 1 :group! ogreboss-hit-chest-ja :num! min :frame-interp 0.0) ) - ) (set! (-> self hit-time) (-> *display* base-frame-counter)) (let ((v1-17 (rand-vu-int-range 0 2))) (cond ((zero? v1-17) - (sound-play-by-name - (static-sound-name "ogre-grunt1") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-grunt1" :position (the-as symbol (-> self root-override trans))) ) ((= v1-17 1) - (sound-play-by-name - (static-sound-name "ogre-grunt2") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-grunt2" :position (the-as symbol (-> self root-override trans))) ) (else - (sound-play-by-name - (static-sound-name "ogre-grunt3") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-grunt3" :position (the-as symbol (-> self root-override trans))) ) ) ) @@ -2332,41 +1797,25 @@ ;; failed to figure out what this is: (defstate ogreboss-stage2 (ogreboss) - :event - ogreboss-attack-event-handler - :enter - (behavior () + :event ogreboss-attack-event-handler + :enter (behavior () (set! (-> self boulder) (the-as handle #f)) (none) ) - :trans - (behavior () + :trans (behavior () 0 (none) ) - :code - (behavior () + :code (behavior () (ogreboss-set-stage2-camera) - (ogreboss-move-far (seconds 0.1) (-> (new 'static 'array float 1 2.0) 0)) + (ogreboss-move-far (seconds 0.1) (the-as float 2.0)) (let ((f30-0 (* 0.75 (-> self difficulty)))) (let ((gp-0 #f)) - (ja-channel-push! 1 60) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.5) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! ogreboss-attack2-start-ja :num! (seek! max 1.5) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.5) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 1.5)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (while (not gp-0) @@ -2377,86 +1826,45 @@ (ogreboss-player-inside-range? (the-as float 409600.0)) ) ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) f30-0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-attack2-loop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (if gp-0 0 ) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) f30-0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) (ogreboss-roll-boulder) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) f30-0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-attack2-last-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) f30-0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (go ogreboss-stage3-shuffle) (none) ) - :post - ogreboss-post + :post ogreboss-post ) ;; definition for function ogreboss-spawn-super-boulder ;; INFO: Return type mismatch int vs none. (defbehavior ogreboss-spawn-super-boulder ogreboss () - (let ((gp-0 (get-process *default-dead-pool* ogreboss-super-boulder #x4000))) - (set! (-> self boulder) - (ppointer->handle - (when gp-0 - (let ((t9-1 (method-of-type ogreboss-super-boulder activate))) - (t9-1 (the-as ogreboss-super-boulder gp-0) self 'ogreboss-super-boulder (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - ogreboss-super-boulder-init-by-other - (-> self far-pos) - (-> self grow-time) - (-> self entity) - ) - (-> gp-0 ppointer) - ) - ) + (set! (-> self boulder) + (ppointer->handle + (process-spawn ogreboss-super-boulder (-> self far-pos) (-> self grow-time) (-> self entity) :to self) ) - ) + ) 0 (none) ) ;; failed to figure out what this is: (defstate ogreboss-stage3-shuffle (ogreboss) - :event - ogreboss-attack-event-handler - :enter - (behavior () + :event ogreboss-attack-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self hit-count) 0) (set! (-> self max-hit-count) (the int (* 6.0 (-> self difficulty)))) @@ -2464,16 +1872,14 @@ (set! (-> self boulder) (the-as handle #f)) (none) ) - :exit - (behavior () + :exit (behavior () (send-event *camera* 'point-of-interest #f) (set! (-> self vulnerable) #f) (none) ) - :trans - (behavior () + :trans (behavior () (let ((v1-1 (handle->process (-> self boulder)))) - (if (and v1-1 (>= (-> (the-as ogreboss-super-boulder v1-1) size) (-> (new 'static 'array float 1 1.0) 0))) + (if (and v1-1 (>= (-> (the-as ogreboss-super-boulder v1-1) size) 1.0)) (go ogreboss-stage3-throw) ) ) @@ -2486,51 +1892,27 @@ 0 (none) ) - :code - (behavior () + :code (behavior () (set! (-> self shuffle-pos) 0.0) - (let ((f30-0 (+ (-> (new 'static 'array float 1 1.0) 0) - (* (-> (new 'static 'array float 1 0.25) 0) (-> self difficulty) (-> self level)) - ) - ) - (gp-0 (if (rand-vu-percent? (-> (new 'static 'array float 1 0.5) 0)) + (let ((f30-0 (+ 1.0 (* 0.25 (-> self difficulty) (-> self level)))) + (gp-0 (if (rand-vu-percent? (the-as float 0.5)) 0 1 ) ) ) - (ja-channel-push! 1 60) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! ogreboss-shuffle-prepare-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (ogreboss-spawn-super-boulder) (set! (-> self state-time) (-> *display* base-frame-counter)) - (ja-channel-push! 2 15) - (let ((s5-0 (-> self skel root-channel 1))) - (set! (-> s5-0 frame-interp) 0.0) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data 10)) - num-func-identity - ) - (set! (-> s5-0 frame-num) 0.0) - ) + (ja-channel-push! 2 (seconds 0.05)) + (ja :chan 1 :group! ogreboss-hit-chest-ja :num! min :frame-interp 0.0) (set! (-> self vulnerable) #t) - (while #t + (loop (if (>= -61440.0 (-> self shuffle-pos)) (set! gp-0 1) ) @@ -2540,128 +1922,56 @@ (cond ((zero? gp-0) (set! gp-0 1) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 18))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 18)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) f30-0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 18)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-shuffle-right-start-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (let ((s5-1 (rand-vu-int-range 1 5))) (while (and (> s5-1 0) (< -61440.0 (-> self shuffle-pos))) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 19))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 19)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) f30-0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 19)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-shuffle-right-loop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) (set! (-> self shuffle-pos) (- (-> self shuffle-pos) (* 16384.0 (-> *display* seconds-per-frame) f30-0))) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) f30-0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (+! s5-1 -1) ) ) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 20))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 20)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) f30-0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 20)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-shuffle-right-stop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) f30-0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (else (set! gp-0 0) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 21))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 21)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) f30-0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 21)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-shuffle-left-start-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) f30-0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (let ((s5-2 (rand-vu-int-range 1 5))) (while (and (> s5-2 0) (< (-> self shuffle-pos) 61440.0)) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 22))) - (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 22)) data 0 length) -1)) - ) - (set! (-> a0-22 param 1) f30-0) - (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 22)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-shuffle-left-loop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) (+! (-> self shuffle-pos) (* 16384.0 (-> *display* seconds-per-frame) f30-0)) (suspend) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) f30-0) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (+! s5-2 -1) ) ) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> self draw art-group data 23))) - (set! (-> a0-26 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 23)) data 0 length) -1)) - ) - (set! (-> a0-26 param 1) f30-0) - (set! (-> a0-26 frame-num) 0.0) - (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> self draw art-group data 23)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-shuffle-left-stop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) (suspend) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1))) - (set! (-> a0-27 param 1) f30-0) - (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -2669,8 +1979,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (vector+*! (-> self root-override trans) (-> self far-pos) (-> self side-dir) (-> self shuffle-pos)) (ogreboss-post) (none) @@ -2679,46 +1988,21 @@ ;; failed to figure out what this is: (defstate ogreboss-stage3-throw (ogreboss) - :code - (behavior () - (ja-channel-push! 1 30) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) (send-event (handle->process (-> self boulder)) 'go-throw) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! ogreboss-attack3-throw-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (ja-channel-push! 1 30) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ogreboss-victory-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ogreboss-submerge (seconds 1) (-> (new 'static 'array float 1 1.0) 0)) + (ogreboss-submerge (seconds 1) (the-as float 1.0)) (while (handle->process (-> self boulder)) (suspend) ) @@ -2726,36 +2010,22 @@ (go ogreboss-stage1) (none) ) - :post - (the-as (function none :behavior ogreboss) transform-post) + :post (the-as (function none :behavior ogreboss) transform-post) ) ;; failed to figure out what this is: (defstate ogreboss-stage3-hit (ogreboss) - :code - (behavior () - (set! (-> self level) (+ (-> (new 'static 'array float 1 1.0) 0) (-> self level))) - (if (< (-> (new 'static 'array float 1 2.0) 0) (-> self level)) + :code (behavior () + (set! (-> self level) (+ 1.0 (-> self level))) + (if (< 2.0 (-> self level)) (go ogreboss-die) ) (send-event (handle->process (-> self boulder)) 'go-hit) - (ja-channel-push! 1 60) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! ogreboss-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self bridge-assembled) #f) (set! (-> self submerged) #t) @@ -2765,8 +2035,7 @@ (go ogreboss-stage1) (none) ) - :post - (the-as (function none :behavior ogreboss) transform-post) + :post (the-as (function none :behavior ogreboss) transform-post) ) ;; definition for function ogreboss-trigger-steps @@ -2798,28 +2067,15 @@ ;; failed to figure out what this is: (defstate ogreboss-die (ogreboss) - :code - (behavior () + :code (behavior () (ogreboss-reset-camera) (send-event (handle->process (-> self boulder)) 'go-die) - (ja-channel-push! 1 60) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! ogreboss-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (transform-post) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0)) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (ogreboss-trigger-steps) (go ogreboss-dead) @@ -2829,14 +2085,12 @@ ;; failed to figure out what this is: (defstate ogreboss-dead (ogreboss) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior ogreboss) process-drawable-fuel-cell-handler ) - :code - (behavior () - (clear-pending-settings-from-process *setting-control* self 'music) + :code (behavior () + (remove-setting! 'music) (ogreboss-reset-camera) (let ((gp-0 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-0 from) self) @@ -2860,8 +2114,8 @@ (ja-post) (when (not (task-complete? *game-info* (-> self entity extra perm task))) (let ((gp-1 (new 'stack-no-clear 'vector))) - (let ((a0-9 (the-as entity (entity-actor-lookup (-> self entity) 'trigger-actor 2)))) - (if (not (the-as entity-actor a0-9)) + (let ((a0-9 (entity-actor-lookup (-> self entity) 'trigger-actor 2))) + (if (not a0-9) (set! a0-9 (-> self entity)) ) (set! (-> gp-1 quad) (-> a0-9 extra trans quad)) @@ -2898,9 +2152,9 @@ ) (set! (-> self target-count) gp-1) ) - (set-vector! (-> self target-offset-array 0) 0.0 16384.0 0.0 (-> (new 'static 'array float 1 1.0) 0)) - (set-vector! (-> self target-offset-array-2) 0.0 16384.0 0.0 (-> (new 'static 'array float 1 1.0) 0)) - (set-vector! (-> self target-offset-array-3) 0.0 16384.0 0.0 (-> (new 'static 'array float 1 1.0) 0)) + (set-vector! (-> self target-offset-array 0) 0.0 16384.0 0.0 1.0) + (set-vector! (-> self target-offset-array-2) 0.0 16384.0 0.0 1.0) + (set-vector! (-> self target-offset-array-3) 0.0 16384.0 0.0 1.0) (set! (-> self target-blast-radius-array 0) 24576.0) (set! (-> self target-blast-radius-array 1) 24576.0) (set! (-> self target-blast-radius-array 2) 24576.0) @@ -2987,7 +2241,7 @@ (set! (-> obj try-count) (-> obj entity extra perm user-uint8 0)) (cond ((< (-> obj try-count) (the-as uint 5)) - (set! (-> obj difficulty) (-> (new 'static 'array float 1 1.0) 0)) + (set! (-> obj difficulty) 1.0) ) ((< (-> obj try-count) (the-as uint 10)) (set! (-> obj difficulty) 0.83334) @@ -2996,7 +2250,7 @@ (set! (-> obj difficulty) 0.66667) ) (else - (set! (-> obj difficulty) (-> (new 'static 'array float 1 0.5) 0)) + (set! (-> obj difficulty) 0.5) ) ) (set! (-> obj lava) (entity-actor-lookup (-> obj entity) 'water-actor 0)) @@ -3009,8 +2263,8 @@ (set! (-> obj z-plane w) (- (vector-dot (-> obj z-plane) (-> obj root-override trans)))) (vector-x-quaternion! (-> obj side-dir) (-> obj root-override quat)) (set! (-> obj far-pos quad) (-> obj root-override trans quad)) - (let ((f0-38 (-> (new 'static 'array float 1 1.0) 0))) - (set-vector! (-> obj root-override scale) f0-38 f0-38 f0-38 (-> (new 'static 'array float 1 1.0) 0)) + (let ((f0-38 1.0)) + (set-vector! (-> obj root-override scale) f0-38 f0-38 f0-38 1.0) ) (vector+*! (-> obj near-pos) (-> obj far-pos) (-> obj z-plane) (the-as float 348160.0)) (set! (-> obj at-near-spot) #t) diff --git a/test/decompiler/reference/levels/racer_common/collide-reaction-racer_REF.gc b/test/decompiler/reference/levels/racer_common/collide-reaction-racer_REF.gc index d31c97d269..268182c2fb 100644 --- a/test/decompiler/reference/levels/racer_common/collide-reaction-racer_REF.gc +++ b/test/decompiler/reference/levels/racer_common/collide-reaction-racer_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for function racer-collision-reaction -;; INFO: Return type mismatch int vs uint. +;; INFO: Return type mismatch int vs cshape-moving-flags. ;; Used lq/sq (defun racer-collision-reaction ((arg0 control-info) (arg1 collide-shape-intersect) (arg2 vector) (arg3 vector)) (local-vars (sv-80 vector) (sv-84 vector) (sv-88 (inline-array vector)) (sv-96 int) (sv-104 int)) @@ -58,7 +58,7 @@ (if s3-1 (set! sv-104 (logior sv-104 2)) ) - (when (zero? (logand (-> arg0 prev-status) 1)) + (when (zero? (logand (-> arg0 prev-status) (cshape-moving-flags onsurf))) (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) (set! sv-96 (logior sv-96 2048)) (when (not s3-1) @@ -110,22 +110,21 @@ (set! (-> arg0 cur-pat mode) 1) (set! (-> arg0 unknown-vector70 quad) (-> arg1 best-tri intersect quad)) (set! (-> arg0 unknown-vector71 quad) (-> arg0 poly-normal quad)) - (set! (-> arg0 unknown-int60) (the-as uint (-> arg1 best-tri pat))) + (set! (-> arg0 wall-pat) (-> arg1 best-tri pat)) (vector-reflect-flat-above! arg2 (-> sv-88 0) sv-84) (cond - ((not - (and (>= (-> arg1 best-from-prim local-sphere w) - (vector-dot - (-> arg0 ground-poly-normal) - (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-tri intersect) (-> arg0 ground-touch-point)) - ) - ) - (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) - (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) (seconds 0.3)) - (zero? (logand sv-104 32)) - ) - ) - ) + ((not (and (>= (-> arg1 best-from-prim local-sphere w) + (vector-dot + (-> arg0 ground-poly-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-tri intersect) (-> arg0 ground-touch-point)) + ) + ) + (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) + (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) (seconds 0.3)) + (zero? (logand sv-104 32)) + ) + ) + ) ) (else (set! sv-104 (logior sv-104 256)) @@ -180,7 +179,7 @@ ) ) (logior! (-> arg0 status) sv-96) - (set! (-> arg0 reaction-flag) (the-as uint sv-104)) + (set! (-> arg0 reaction-flag) (the-as cshape-reaction-flags sv-104)) (update! (-> arg0 history-data (-> arg0 unknown-halfword00)) arg0 @@ -189,5 +188,5 @@ arg2 ) (set! (-> arg0 unknown-halfword00) (logand (+ (-> arg0 unknown-halfword00) 1) 127)) - (the-as uint sv-96) + (the-as cshape-moving-flags sv-96) ) diff --git a/test/decompiler/reference/levels/racer_common/racer-part_REF.gc b/test/decompiler/reference/levels/racer_common/racer-part_REF.gc index 921682b503..d397e38775 100644 --- a/test/decompiler/reference/levels/racer_common/racer-part_REF.gc +++ b/test/decompiler/reference/levels/racer_common/racer-part_REF.gc @@ -50,8 +50,7 @@ :id 108 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 740 :flags (launch-asap))) + :parts ((sp-item 740 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -59,8 +58,7 @@ :id 109 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 741 :flags (launch-asap))) + :parts ((sp-item 741 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -68,14 +66,12 @@ :id 110 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 1999 :flags (launch-asap))) + :parts ((sp-item 1999 :flags (launch-asap))) ) ;; failed to figure out what this is: (defpart 741 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x45f)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x45f)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3)) (sp-int spt-rot-x 4) @@ -91,8 +87,7 @@ ;; failed to figure out what this is: (defpart 740 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x45f)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x45f)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-int spt-rot-x 4) @@ -110,8 +105,7 @@ ;; failed to figure out what this is: (defpart 1999 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x7 :page #x45f)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7 :page #x45f)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.8)) (sp-int spt-rot-x 4) @@ -212,8 +206,7 @@ :id 111 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 737 :flags (launch-asap))) + :parts ((sp-item 737 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -221,8 +214,7 @@ :id 112 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 738 :flags (launch-asap))) + :parts ((sp-item 738 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -230,8 +222,7 @@ :id 113 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 739 :flags (launch-asap))) + :parts ((sp-item 739 :flags (launch-asap))) ) ;; failed to figure out what this is: @@ -239,14 +230,12 @@ :id 114 :flags (use-local-clock screen-space) :bounds (static-bspherem 0 0 0 100) - :parts - ((sp-item 2010 :flags (launch-asap)) (sp-item 2011 :flags (launch-asap)) (sp-item 2012 :flags (launch-asap))) + :parts ((sp-item 2010 :flags (launch-asap)) (sp-item 2011 :flags (launch-asap)) (sp-item 2012 :flags (launch-asap))) ) ;; failed to figure out what this is: (defpart 739 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x45f)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x45f)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3)) (sp-int spt-rot-x 4) @@ -262,8 +251,7 @@ ;; failed to figure out what this is: (defpart 737 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x45f)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x45f)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3.5)) (sp-int spt-rot-x 4) @@ -279,8 +267,7 @@ ;; failed to figure out what this is: (defpart 738 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x45f)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x45f)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.9)) (sp-int spt-rot-x 4) @@ -297,8 +284,7 @@ ;; failed to figure out what this is: (defpart 2010 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-copy-from-other spt-scale-y -4) @@ -314,8 +300,7 @@ ;; failed to figure out what this is: (defpart 2011 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-copy-from-other spt-scale-y -4) @@ -331,8 +316,7 @@ ;; failed to figure out what this is: (defpart 2012 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 2)) (sp-copy-from-other spt-scale-y -4) @@ -365,9 +349,9 @@ ;; definition for method 19 of type hud-bike-heat ;; INFO: Return type mismatch int vs none. -(defmethod TODO-RENAME-19 hud-bike-heat ((obj hud-bike-heat)) +(defmethod hud-update hud-bike-heat ((obj hud-bike-heat)) (if *target* - (TODO-RENAME-16 obj (the int (-> *target* racer heat)) 0) + (tally-value obj (the int (-> *target* racer heat)) 0) ) 0 (none) @@ -376,63 +360,61 @@ ;; definition for method 20 of type hud-bike-heat ;; INFO: Return type mismatch int vs none. (defmethod init-particles! hud-bike-heat ((obj hud-bike-heat) (arg0 int)) - (with-pp - (push-setting! *setting-control* pp 'common-page 'set 0.0 2) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 111) obj)) - (set! (-> obj particles s5-0 init-pos x) 13.0) - (set! (-> obj particles s5-0 init-pos y) 370.0) - (set! (-> obj particles s5-0 init-pos z) 10.0) - (set! (-> obj particles s5-0 part matrix) -1) - ) - (+! (-> obj nb-of-particles) 1) + (add-setting! 'common-page 'set 0.0 2) + (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) + (let ((s5-0 (-> obj nb-of-particles))) + (set! (-> obj particles s5-0) (new 'static 'hud-particle)) + (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 111) obj)) + (set! (-> obj particles s5-0 init-pos x) 13.0) + (set! (-> obj particles s5-0 init-pos y) 370.0) + (set! (-> obj particles s5-0 init-pos z) 10.0) + (set! (-> obj particles s5-0 part matrix) -1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 112) obj)) - (set! (-> obj particles s5-1 init-pos x) 70.0) - (set! (-> obj particles s5-1 init-pos y) 370.0) - (set! (-> obj particles s5-1 init-pos z) 6.0) - (set! (-> obj particles s5-1 part matrix) -1) - ) - (+! (-> obj nb-of-particles) 1) - ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-2 (-> obj nb-of-particles))) - (set! (-> obj particles s5-2) (new 'static 'hud-particle)) - (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 113) obj)) - (set! (-> obj particles s5-2 init-pos x) 20.0) - (set! (-> obj particles s5-2 init-pos y) 370.0) - (set! (-> obj particles s5-2 init-pos z) 1.0) - (set! (-> obj particles s5-2 part matrix) -1) - ) - (+! (-> obj nb-of-particles) 1) - ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-3 (-> obj nb-of-particles))) - (set! (-> obj particles s5-3) (new 'static 'hud-particle)) - (set! (-> obj particles s5-3 part) (create-launch-control (-> *part-group-id-table* 114) obj)) - (set! (-> obj particles s5-3 init-pos x) 70.0) - (set! (-> obj particles s5-3 init-pos y) 370.0) - (set! (-> obj particles s5-3 init-pos z) 7.0) - (set! (-> obj particles s5-3 part matrix) -1) - ) - (+! (-> obj nb-of-particles) 1) - ) - (dotimes (s5-4 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-4 part matrix) -1) - (set! (-> obj particles s5-4 part matrix) (sprite-allocate-user-hvdf)) - ) - ) - (set! (-> obj x-sgn) -1) - (set! (-> obj y-sgn) 1) - (set! (-> obj force-on-screen) #t) - 0 - (none) + (+! (-> obj nb-of-particles) 1) ) + (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) + (let ((s5-1 (-> obj nb-of-particles))) + (set! (-> obj particles s5-1) (new 'static 'hud-particle)) + (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 112) obj)) + (set! (-> obj particles s5-1 init-pos x) 70.0) + (set! (-> obj particles s5-1 init-pos y) 370.0) + (set! (-> obj particles s5-1 init-pos z) 6.0) + (set! (-> obj particles s5-1 part matrix) -1) + ) + (+! (-> obj nb-of-particles) 1) + ) + (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) + (let ((s5-2 (-> obj nb-of-particles))) + (set! (-> obj particles s5-2) (new 'static 'hud-particle)) + (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 113) obj)) + (set! (-> obj particles s5-2 init-pos x) 20.0) + (set! (-> obj particles s5-2 init-pos y) 370.0) + (set! (-> obj particles s5-2 init-pos z) 1.0) + (set! (-> obj particles s5-2 part matrix) -1) + ) + (+! (-> obj nb-of-particles) 1) + ) + (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) + (let ((s5-3 (-> obj nb-of-particles))) + (set! (-> obj particles s5-3) (new 'static 'hud-particle)) + (set! (-> obj particles s5-3 part) (create-launch-control (-> *part-group-id-table* 114) obj)) + (set! (-> obj particles s5-3 init-pos x) 70.0) + (set! (-> obj particles s5-3 init-pos y) 370.0) + (set! (-> obj particles s5-3 init-pos z) 7.0) + (set! (-> obj particles s5-3 part matrix) -1) + ) + (+! (-> obj nb-of-particles) 1) + ) + (dotimes (s5-4 (-> obj nb-of-particles)) + (if (= (-> obj particles s5-4 part matrix) -1) + (set! (-> obj particles s5-4 part matrix) (sprite-allocate-user-hvdf)) + ) + ) + (set! (-> obj x-sgn) -1) + (set! (-> obj y-sgn) 1) + (set! (-> obj force-on-screen) #t) + 0 + (none) ) ;; definition of type hud-bike-speed @@ -454,9 +436,9 @@ ;; definition for method 19 of type hud-bike-speed ;; INFO: Return type mismatch int vs none. -(defmethod TODO-RENAME-19 hud-bike-speed ((obj hud-bike-speed)) +(defmethod hud-update hud-bike-speed ((obj hud-bike-speed)) (if *target* - (TODO-RENAME-16 obj (the int (-> *target* control unknown-float01)) 0) + (tally-value obj (the int (-> *target* control unknown-float01)) 0) ) 0 (none) @@ -465,60 +447,57 @@ ;; definition for method 20 of type hud-bike-speed ;; INFO: Return type mismatch int vs none. (defmethod init-particles! hud-bike-speed ((obj hud-bike-speed) (arg0 int)) - (with-pp - (push-setting! *setting-control* pp 'common-page 'set 0.0 2) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 108) obj)) - (set! (-> obj particles s5-0 init-pos x) 433.0) - (set! (-> obj particles s5-0 init-pos y) 370.0) - (set! (-> obj particles s5-0 init-pos z) 3.0) - (set! (-> obj particles s5-0 part matrix) -1) - ) - (+! (-> obj nb-of-particles) 1) + (add-setting! 'common-page 'set 0.0 2) + (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) + (let ((s5-0 (-> obj nb-of-particles))) + (set! (-> obj particles s5-0) (new 'static 'hud-particle)) + (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 108) obj)) + (set! (-> obj particles s5-0 init-pos x) 433.0) + (set! (-> obj particles s5-0 init-pos y) 370.0) + (set! (-> obj particles s5-0 init-pos z) 3.0) + (set! (-> obj particles s5-0 part matrix) -1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 109) obj)) - (set! (-> obj particles s5-1 init-pos x) 378.0) - (set! (-> obj particles s5-1 init-pos y) 370.0) - (set! (-> obj particles s5-1 init-pos z) 5.0) - (set! (-> obj particles s5-1 part matrix) -1) - ) - (+! (-> obj nb-of-particles) 1) - ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-2 (-> obj nb-of-particles))) - (set! (-> obj particles s5-2) (new 'static 'hud-particle)) - (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 110) obj)) - (set! (-> obj particles s5-2 init-pos x) 415.0) - (set! (-> obj particles s5-2 init-pos y) 370.0) - (set! (-> obj particles s5-2 init-pos z) 1.0) - (set! (-> obj particles s5-2 part matrix) -1) - ) - (+! (-> obj nb-of-particles) 1) - ) - (dotimes (s5-3 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-3 part matrix) -1) - (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) - ) - ) - (set! (-> obj x-sgn) 1) - (set! (-> obj y-sgn) 1) - (set! (-> obj force-on-screen) #t) - 0 - (none) + (+! (-> obj nb-of-particles) 1) ) + (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) + (let ((s5-1 (-> obj nb-of-particles))) + (set! (-> obj particles s5-1) (new 'static 'hud-particle)) + (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 109) obj)) + (set! (-> obj particles s5-1 init-pos x) 378.0) + (set! (-> obj particles s5-1 init-pos y) 370.0) + (set! (-> obj particles s5-1 init-pos z) 5.0) + (set! (-> obj particles s5-1 part matrix) -1) + ) + (+! (-> obj nb-of-particles) 1) + ) + (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) + (let ((s5-2 (-> obj nb-of-particles))) + (set! (-> obj particles s5-2) (new 'static 'hud-particle)) + (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 110) obj)) + (set! (-> obj particles s5-2 init-pos x) 415.0) + (set! (-> obj particles s5-2 init-pos y) 370.0) + (set! (-> obj particles s5-2 init-pos z) 1.0) + (set! (-> obj particles s5-2 part matrix) -1) + ) + (+! (-> obj nb-of-particles) 1) + ) + (dotimes (s5-3 (-> obj nb-of-particles)) + (if (= (-> obj particles s5-3 part matrix) -1) + (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) + ) + ) + (set! (-> obj x-sgn) 1) + (set! (-> obj y-sgn) 1) + (set! (-> obj force-on-screen) #t) + 0 + (none) ) ;; failed to figure out what this is: (defpartgroup group-racer-trans-pad :id 115 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 742 :fade-after (meters 160)) + :parts ((sp-item 742 :fade-after (meters 160)) (sp-item 743 :fade-after (meters 160)) (sp-item 744 :fade-after (meters 60) :falloff-to (meters 60) :flags (is-3d)) ) @@ -526,8 +505,7 @@ ;; failed to figure out what this is: (defpart 742 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 7)) (sp-rnd-flt spt-scale-x (meters 14) (meters 1) 1.0) @@ -543,8 +521,7 @@ ;; failed to figure out what this is: (defpart 743 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 4)) (sp-rnd-flt spt-scale-x (meters 7) (meters 1) 1.0) @@ -561,8 +538,7 @@ ;; failed to figure out what this is: (defpart 744 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0.75) (meters 0.1) 1.0) (sp-flt spt-scale-x (meters 0)) @@ -586,8 +562,7 @@ ;; failed to figure out what this is: (defpart 2211 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -610,8 +585,7 @@ ;; failed to figure out what this is: (defpart 2207 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -636,8 +610,7 @@ ;; failed to figure out what this is: (defpart 2221 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.35) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -660,8 +633,7 @@ ;; failed to figure out what this is: (defpart 2208 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -686,8 +658,7 @@ ;; failed to figure out what this is: (defpart 2218 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -711,8 +682,7 @@ ;; failed to figure out what this is: (defpart 2215 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -737,8 +707,7 @@ ;; failed to figure out what this is: (defpart 2216 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -763,8 +732,7 @@ ;; failed to figure out what this is: (defpart 2831 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -789,8 +757,7 @@ ;; failed to figure out what this is: (defpart 2214 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -815,8 +782,7 @@ ;; failed to figure out what this is: (defpart 2220 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.025) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -840,8 +806,7 @@ ;; failed to figure out what this is: (defpart 2213 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -866,8 +831,7 @@ ;; failed to figure out what this is: (defpart 2275 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-x (meters 10)) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 3) 1.0) @@ -892,8 +856,7 @@ ;; failed to figure out what this is: (defpart 2276 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-rnd-flt spt-num 0.04 0.03 1.0) (sp-rnd-flt spt-x (meters -0.2) (meters 0.4) 1.0) (sp-rnd-flt spt-z (meters -0.2) (meters 0.4) 1.0) @@ -916,8 +879,7 @@ ;; failed to figure out what this is: (defpart 2212 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-func spt-birth-func 'birth-func-vector-orient) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 4) (meters -0.5) 1.0) @@ -937,8 +899,7 @@ ;; failed to figure out what this is: (defpart 2225 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x2)) (sp-rnd-flt spt-num 4.0 16.0 1.0) (sp-flt spt-x (meters 0.9)) (sp-flt spt-y (meters 0.05)) @@ -968,8 +929,7 @@ ;; failed to figure out what this is: (defpart 2226 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x2)) (sp-rnd-flt spt-num 4.0 16.0 1.0) (sp-flt spt-x (meters 0.9)) (sp-flt spt-y (meters 0.05)) @@ -999,8 +959,7 @@ ;; failed to figure out what this is: (defpart 2227 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1024,8 +983,7 @@ ;; failed to figure out what this is: (defpart 2277 - :init-specs - ((sp-flt spt-fade-r -5.0) + :init-specs ((sp-flt spt-fade-r -5.0) (sp-flt spt-fade-g -1.6) (sp-flt spt-fade-b 1.6) (sp-flt spt-fade-a 0.0) @@ -1036,8 +994,7 @@ ;; failed to figure out what this is: (defpart 2278 - :init-specs - ((sp-flt spt-fade-r -0.2) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-r -0.2) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: @@ -1047,8 +1004,7 @@ :linger-duration 3000 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2279 :period 600 :length 5) + :parts ((sp-item 2279 :period 600 :length 5) (sp-item 2280 :period 600 :length 40) (sp-item 2281 :period 600 :length 20) (sp-item 2282 :period 600 :length 20) @@ -1057,8 +1013,7 @@ ;; failed to figure out what this is: (defpart 2280 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0) @@ -1086,14 +1041,12 @@ ;; failed to figure out what this is: (defpart 2283 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2282 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-flt spt-scale-x (meters 0.3)) @@ -1114,8 +1067,7 @@ ;; failed to figure out what this is: (defpart 2279 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 24)) @@ -1132,8 +1084,7 @@ ;; failed to figure out what this is: (defpart 2281 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -1162,8 +1113,7 @@ ;; failed to figure out what this is: (defpart 2284 - :init-specs - ((sp-flt spt-fade-r -1.0666667) + :init-specs ((sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g -1.0666667) (sp-flt spt-fade-b -2.1166666) (sp-int spt-next-time 60) @@ -1173,8 +1123,7 @@ ;; failed to figure out what this is: (defpart 2285 - :init-specs - ((sp-flt spt-fade-r -0.5688889) + :init-specs ((sp-flt spt-fade-r -0.5688889) (sp-flt spt-fade-g -0.28444445) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.21333334) @@ -1185,14 +1134,12 @@ ;; failed to figure out what this is: (defpart 2286 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: (defpart 2229 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) (sp-copy-from-other spt-scale-y -4) diff --git a/test/decompiler/reference/levels/racer_common/racer-states_REF.gc b/test/decompiler/reference/levels/racer_common/racer-states_REF.gc index ca1a6064ac..2741aa2a5a 100644 --- a/test/decompiler/reference/levels/racer_common/racer-states_REF.gc +++ b/test/decompiler/reference/levels/racer_common/racer-states_REF.gc @@ -3,8 +3,7 @@ ;; failed to figure out what this is: (defstate target-racing-start (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) 'racer @@ -29,13 +28,14 @@ ) (('attack 'attack-or-shove 'attack-invinc) (let ((v1-27 (the-as attack-info (-> arg3 param 1)))) - (if (not (and (logtest? (-> v1-27 mask) 32) (or (= (-> v1-27 mode) 'burn) (= (-> v1-27 mode) 'burnup)))) + (if (not (and (logtest? (-> v1-27 mask) (attack-mask mode)) (or (= (-> v1-27 mode) 'burn) (= (-> v1-27 mode) 'burnup))) + ) (target-attacked arg2 (the-as attack-info (-> arg3 param 1)) arg0 (the-as process (-> arg3 param 0)) - target-racing-hit + (the-as (state symbol attack-info target) target-racing-hit) ) ) ) @@ -48,10 +48,8 @@ ) ) (('boost) - (sound-play-by-name (static-sound-name "get-blue-eco") (new-sound-id) 1024 0 0 1 #t) - (set! (-> self racer boost-sound-id) - (sound-play-by-name (static-sound-name "zoom-boost") (new-sound-id) 1024 0 0 1 #t) - ) + (sound-play "get-blue-eco") + (set! (-> self racer boost-sound-id) (sound-play "zoom-boost")) (set! (-> self racer boost-time) (-> *display* base-frame-counter)) (let ((f0-12 (seek (-> self racer boost-level) @@ -87,8 +85,7 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (when (not (or (= (-> self next-state name) 'target-racing) (= (-> self next-state name) 'target-racing-jump) (= (-> self next-state name) 'target-racing-bounce) @@ -127,7 +124,7 @@ (set! (-> *hud-parts* power 0 y-sgn) 1) (logclear! (-> self control root-prim prim-core action) (collide-action ca-9 ca-16)) (set! (-> self control unknown-surface00) *walk-mods*) - (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) (send-event *camera* 'clear-slave-option #x6000) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) @@ -141,17 +138,16 @@ (sound-stop (-> self racer engine-sound-id)) (set! (-> self racer engine-sound-id) (new 'static 'sound-id)) (set! (-> self control unknown-vector12 quad) (the-as uint128 0)) - (clear-pending-settings-from-process *setting-control* self 'sound-flava) + (remove-setting! 'sound-flava) (target-exit) ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (target-exit) (set! *display-profile* #f) (set! *display-entity-errors* #f) - (set-setting! *setting-control* self 'sound-flava #f 30.0 1) + (set-setting! 'sound-flava #f 30.0 (music-flava racer)) (if (zero? (-> self racer)) (set! (-> self racer) (new 'process 'racer-info)) ) @@ -177,7 +173,7 @@ (set! (-> self racer entity) #f) (let ((v1-28 (handle->process arg0))) (if v1-28 - (set! (-> self racer entity) (the-as entity-actor (-> v1-28 entity))) + (set! (-> self racer entity) (-> v1-28 entity)) ) ) (set! (-> self control surf) *race-track-surface*) @@ -237,20 +233,9 @@ (set! (-> self racer surface-y) (-> self control trans y)) (let ((s5-0 (-> self entity))) (set! (-> self entity) (-> self racer entity)) - (let ((s4-0 (get-process *8k-dead-pool* manipy #x4000))) - (set! (-> self manipy) - (the-as - (pointer manipy) - (when s4-0 - (let ((t9-9 (method-of-type manipy activate))) - (t9-9 (the-as manipy s4-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 manipy-init (-> self control trans) (-> self entity) *racer-sg* #f) - (-> s4-0 ppointer) - ) - ) - ) - ) + (set! (-> self manipy) + (manipy-spawn (-> self control trans) (-> self entity) *racer-sg* #f :from *8k-dead-pool* :to self) + ) (set! (-> self entity) s5-0) ) (when (-> self manipy) @@ -312,8 +297,7 @@ (go target-racing-get-on arg0) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; definition for function target-racing-smack-check @@ -321,7 +305,7 @@ ;; Used lq/sq (defbehavior target-racing-smack-check target () (if (and (< 20480.0 (-> self control unknown-float01)) - (and (logtest? (-> self control status) 8) + (and (logtest? (-> self control status) (cshape-moving-flags twall)) (< (-> self control surface-angle) 0.5) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector70) (-> self control trans))) (s5-0 (new 'stack-no-clear 'vector)) @@ -342,21 +326,17 @@ ;; failed to figure out what this is: (defstate target-racing (target) - :event - (-> target-racing-start event) - :enter - (behavior () + :event (-> target-racing-start event) + :enter (behavior () (set! (-> self control unknown-surface00) *racer-mods*) (none) ) - :exit - (behavior () + :exit (behavior () (target-racing-center-anim) ((-> target-racing-start exit)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) ) @@ -384,7 +364,7 @@ ) ) ) - (if (and (zero? (logand (-> self control status) 1)) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) (or (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (* (-> *TARGET-bank* ground-timeout) 2) ) @@ -400,29 +380,16 @@ (racer-buzz (+ 0.45 (* 1.7 (fabs (-> self racer slide-shift-x))))) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 138) - ) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 138)) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) ) - ((let ((v1-16 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + ((let ((v1-16 (ja-group))) (or (or (= v1-16 (-> self draw art-group data 130)) (= v1-16 (-> self draw art-group data 131))) (> (-> self racer bounce) 0) ) @@ -492,55 +459,19 @@ ) (when (!= (-> self racer slide-shift-x) 0.0) (if (rand-vu-percent? 0.5) - (sound-play-by-name (static-sound-name "zoomer-rev1") (new-sound-id) 819 0 0 1 #t) - (sound-play-by-name (static-sound-name "zoomer-rev2") (new-sound-id) 819 0 0 1 #t) + (sound-play "zoomer-rev1" :vol 80) + (sound-play "zoomer-rev2" :vol 80) ) ) (set! (-> self racer bounce) 0) - (while #t + (loop (let ((gp-3 (-> *display* base-frame-counter))) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 123) - ) - ) - (ja-channel-push! 4 30) - (let ((s5-3 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-3 - (the-as art-joint-anim (-> self draw art-group data 123)) - num-func-identity - ) - (set! (-> s5-3 frame-num) (ja-aframe (-> self racer turn-anim-frame) 0)) - ) - (let ((a0-43 (-> self skel root-channel 1))) - (set! (-> a0-43 frame-group) (the-as art-joint-anim (-> self draw art-group data 124))) - (set! (-> a0-43 param 0) 0.0) - (joint-control-channel-group-eval! - a0-43 - (the-as art-joint-anim (-> self draw art-group data 124)) - num-func-chan - ) - ) - (let ((a0-44 (-> self skel root-channel 2))) - (set! (-> a0-44 frame-group) (the-as art-joint-anim (-> self draw art-group data 125))) - (set! (-> a0-44 param 0) 0.0) - (joint-control-channel-group-eval! - a0-44 - (the-as art-joint-anim (-> self draw art-group data 125)) - num-func-chan - ) - ) - (let ((a0-45 (-> self skel root-channel 3))) - (set! (-> a0-45 frame-group) (the-as art-joint-anim (-> self draw art-group data 126))) - (set! (-> a0-45 param 0) 0.0) - (joint-control-channel-group-eval! - a0-45 - (the-as art-joint-anim (-> self draw art-group data 126)) - num-func-chan - ) - ) + (when (not (ja-group? (-> self draw art-group data 123))) + (ja-channel-push! 4 (seconds 0.1)) + (ja :group! (-> self draw art-group data 123) :num! (identity (ja-aframe (-> self racer turn-anim-frame) 0))) + (ja :chan 1 :group! (-> self draw art-group data 124) :num! (chan 0)) + (ja :chan 2 :group! (-> self draw art-group data 125) :num! (chan 0)) + (ja :chan 3 :group! (-> self draw art-group data 126) :num! (chan 0)) ) (while (< (- (-> *display* base-frame-counter) gp-3) (seconds 1)) (if (or (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) @@ -554,21 +485,9 @@ (suspend) ) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 133) - ) - ) - (ja-channel-push! 1 120) - (let ((gp-4 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-4 - (the-as art-joint-anim (-> self draw art-group data 133)) - num-func-identity - ) - (set! (-> gp-4 frame-num) 0.0) - ) + (when (not (ja-group? (-> self draw art-group data 133))) + (ja-channel-push! 1 (seconds 0.4)) + (ja :group! (-> self draw art-group data 133) :num! min) ) (while (not (or (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (or (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1 x) @@ -577,16 +496,12 @@ ) ) (suspend) - (let ((a0-54 (-> self skel root-channel 0))) - (set! (-> a0-54 param 0) 1.0) - (joint-control-channel-group-eval! a0-54 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) ) (none) ) - :post - (behavior () + :post (behavior () (if (= (-> self next-state name) 'target-racing) (set! (-> self racer racing-time) (-> *display* base-frame-counter)) ) @@ -597,12 +512,10 @@ ;; failed to figure out what this is: (defstate target-racing-jump (target) - :event - (-> target-racing-start event) - :enter - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + :event (-> target-racing-start event) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (set! (-> self racer shock-offsetv) 0.0) - (sound-play-by-name (static-sound-name "zoomer-jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-jump") (set! (-> self state-time) (-> *display* base-frame-counter)) (when arg2 (when (>= (-> self racer hill-ground-value) 0.11) @@ -610,14 +523,14 @@ (vector-normalize! (-> self control transv) (+ (-> self control unknown-float01) (-> self racer hill-boost))) ) ) - (if (and (logtest? (-> self control status) 1) (< 16384.0 (-> self control transv y))) + (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (< 16384.0 (-> self control transv y))) (set! (-> self racer hop?) #f) (set! (-> self racer hop?) arg2) ) (set! (-> self racer hop-start-y) (-> self control trans y)) (racer-calc-gravity) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *racer-air-mods*) (set! (-> self control unknown-float123) (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float01))))) @@ -633,15 +546,13 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self control root-prim prim-core action) (collide-action ca-15)) (set! (-> self racer hop?) #f) ((-> target-racing-start exit)) (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self control unknown-float123) (fmax (-> self control unknown-float123) @@ -652,9 +563,8 @@ ((cpad-pressed? (-> self control unknown-cpad-info00 number) l1 r1) (set! (-> self racer slide-down-time 0) (-> *display* base-frame-counter)) ) - ((zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) + ((zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) + ) (set! (-> self racer slide-down-time 0) 0) 0 ) @@ -688,7 +598,7 @@ ) ) ) - (if (and (logtest? (-> self control status) 1) + (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) ) (go target-racing) @@ -711,46 +621,40 @@ (racer-buzz 0.4) (none) ) - :code - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((a0-1 (if (< 0.1 (-> self racer hill-value)) 'jump ) ) ) - (target-racing-jump-anim a0-1 60) + (target-racing-jump-anim a0-1 (seconds 0.2)) ) (none) ) - :post - (-> target-racing post) + :post (-> target-racing post) ) ;; failed to figure out what this is: (defstate target-racing-bounce (target) - :event - (-> target-racing-start event) - :enter - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + :event (-> target-racing-start event) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (logior! (-> self control root-prim prim-core action) (collide-action ca-15)) - (sound-play-by-name (static-sound-name "zoomer-jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-jump") (set! (-> self state-time) (-> *display* base-frame-counter)) (racer-calc-gravity) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-float123) (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float01))))) ) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self control root-prim prim-core action) (collide-action ca-15)) ((-> target-racing-start exit)) (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self control unknown-float123) (fmax (-> self control unknown-float123) @@ -775,7 +679,7 @@ ) (go target-racing-jump 2048.0 5324.8 #t) ) - (if (and (logtest? (-> self control status) 1) + (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) ) (go target-racing) @@ -785,69 +689,29 @@ (racer-buzz 0.4) (none) ) - :code - (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (target-racing-land-anim arg2) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 123) - ) - ) - (ja-channel-push! 4 30) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 123)) - num-func-identity - ) - (set! (-> gp-0 frame-num) (ja-aframe (-> self racer turn-anim-frame) 0)) - ) - (let ((a0-9 (-> self skel root-channel 1))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 124))) - (set! (-> a0-9 param 0) 0.0) - (joint-control-channel-group-eval! - a0-9 - (the-as art-joint-anim (-> self draw art-group data 124)) - num-func-chan - ) - ) - (let ((a0-10 (-> self skel root-channel 2))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 125))) - (set! (-> a0-10 param 0) 0.0) - (joint-control-channel-group-eval! - a0-10 - (the-as art-joint-anim (-> self draw art-group data 125)) - num-func-chan - ) - ) - (let ((a0-11 (-> self skel root-channel 3))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 126))) - (set! (-> a0-11 param 0) 0.0) - (joint-control-channel-group-eval! - a0-11 - (the-as art-joint-anim (-> self draw art-group data 126)) - num-func-chan - ) - ) + (when (not (ja-group? (-> self draw art-group data 123))) + (ja-channel-push! 4 (seconds 0.1)) + (ja :group! (-> self draw art-group data 123) :num! (identity (ja-aframe (-> self racer turn-anim-frame) 0))) + (ja :chan 1 :group! (-> self draw art-group data 124) :num! (chan 0)) + (ja :chan 2 :group! (-> self draw art-group data 125) :num! (chan 0)) + (ja :chan 3 :group! (-> self draw art-group data 126) :num! (chan 0)) ) - (while #t + (loop (target-racing-turn-anim) (suspend) ) (none) ) - :post - (-> target-racing post) + :post (-> target-racing post) ) ;; failed to figure out what this is: (defstate target-racing-smack (target) - :event - (-> target-racing-start event) - :enter - (behavior ((arg0 float) (arg1 symbol)) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + :event (-> target-racing-start event) + :enter (behavior ((arg0 float) (arg1 symbol)) + (sound-play "smack-surface") (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) (set! (-> self racer heavy) arg1) (vector-! (-> self control transv) (-> self control unknown-vector70) (-> self control trans)) @@ -865,72 +729,49 @@ 0 (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self racer heavy) #f) ((-> target-racing-start exit)) (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self racer turn-anim-targ) 0.0) (none) ) - :code - (behavior ((arg0 float) (arg1 symbol)) - (sound-play-by-name (static-sound-name "zoomer-crash-2") (new-sound-id) 1024 0 0 1 #t) - (ja-channel-push! 2 15) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 136))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 136)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 136)) num-func-seek!) - ) - (let ((s5-1 (-> self skel root-channel 1))) - (set! (-> s5-1 frame-interp) (lerp-scale 1.0 0.25 arg0 0.0 122880.0)) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 122)) - num-func-identity + :code (behavior ((arg0 float) (arg1 symbol)) + (sound-play "zoomer-crash-2") + (ja-channel-push! 2 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 136) :num! (seek!)) + (ja :chan 1 + :group! (-> self draw art-group data 122) + :num! (identity (ja-aframe 0.0 0)) + :frame-interp (lerp-scale 1.0 0.25 arg0 0.0 122880.0) ) - (set! (-> s5-1 frame-num) (ja-aframe 0.0 0)) - ) (until (ja-done? 0) (suspend) - (let ((s5-2 (-> self skel root-channel 0))) - (set! (-> s5-2 param 0) (the float (+ (-> s5-2 frame-group data 0 length) -1))) - (set! (-> s5-2 param 1) (lerp-scale 2.0 1.0 arg0 0.0 163840.0)) - (joint-control-channel-group-eval! s5-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (lerp-scale 2.0 1.0 arg0 0.0 163840.0))) ) (go target-racing) (none) ) - :post - (-> target-racing post) + :post (-> target-racing post) ) ;; failed to figure out what this is: (defstate target-racing-falling (target) - :event - (-> target-racing-start event) - :enter - (behavior () + :event (-> target-racing-start event) + :enter (behavior () (set! (-> self control unknown-surface00) *racer-air-mods*) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self control root-prim prim-core action) (collide-action ca-15)) ((-> target-racing-start exit)) (none) ) - :trans - (behavior () - (if (logtest? (-> self control status) 1) + :trans (behavior () + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-racing) ) (target-racing-smack-check) @@ -940,21 +781,17 @@ ) (none) ) - :code - (behavior () - (target-racing-jump-anim #f 30) + :code (behavior () + (target-racing-jump-anim #f (seconds 0.1)) (none) ) - :post - (-> target-racing post) + :post (-> target-racing post) ) ;; failed to figure out what this is: (defstate target-racing-hit (target) - :event - target-generic-event-handler - :enter - (behavior ((arg0 handle) (arg1 attack-info)) + :event target-generic-event-handler + :enter (behavior ((arg0 handle) (arg1 attack-info)) (let ((v1-0 (-> self attack-info))) (set! (-> v1-0 attacker) arg0) (set! (-> v1-0 mode) 'generic) @@ -979,24 +816,22 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (if (!= (-> self next-state name) 'target-racing-death) - (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags being-attacked dying)) ) ((-> target-racing-start exit)) (none) ) - :code - (behavior ((arg0 handle) (arg1 attack-info)) + :code (behavior ((arg0 handle) (arg1 attack-info)) (target-timed-invulnerable (-> *TARGET-bank* hit-invulnerable-timeout) self) (when (!= (-> self attack-info mode) 'endlessfall) (dummy-10 (-> self skel effect) 'group-target-hit -1.0 -1) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) - (sound-play-by-name (static-sound-name "oof") (new-sound-id) 1024 0 0 1 #t) + (sound-play "oof") ) (set! (-> self game hit-time) (-> *display* base-frame-counter)) - (logior! (-> self state-flags) 8) + (logior! (-> self state-flags) (state-flags being-attacked)) (set! (-> self racer boost-curve) 0.0) (set! (-> self racer boost-level) 0.0) (set! (-> self racer boost-target) 0.0) @@ -1036,71 +871,57 @@ ) (else (set! (-> self post-hook) target-racing-post) - (ja-channel-push! 1 15) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 136))) - (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 136)) data 0 length) -1)) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 136)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 136) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go target-racing) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) ;; failed to figure out what this is: (defstate target-racing-death (target) - :event - (-> target-death event) - :exit - (behavior () - (set! (-> self state-flags) (logand -32769 (-> self state-flags))) + :event (-> target-death event) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags dying)) (send-event (ppointer->process (-> self manipy)) 'draw #t) (send-event (ppointer->process (-> self manipy)) 'anim-mode 'clone-anim) (target-timed-invulnerable-off self) - (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) (restore-collide-with-as (-> self control)) ((-> target-racing-start exit)) (target-exit) (set! (-> self racer stick-off) #f) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (local-vars (v1-154 symbol)) (set! (-> self racer stick-off) #t) (set! (-> self neck flex-blend) 0.0) (target-timed-invulnerable-off self) - (logior! (-> self state-flags) #x8000) + (logior! (-> self state-flags) (state-flags dying)) (case (-> self attack-info mode) (('explode 'darkeco 'heat 'death 'deadly 'balloonlurker) ((-> target-racing-start exit)) (send-event (ppointer->process (-> self manipy)) 'anim-mode 'loop) (send-event (ppointer->process (-> self manipy)) 'draw #f) - (sound-play-by-name (static-sound-name "zoomer-explode") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 116) -1 #f #f #f (-> self control trans)) - (-> gp-1 ppointer) - ) + (sound-play "zoomer-explode") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 116) + -1 + #f + #f + #f + (-> self control trans) + :to *entity-pool* ) (send-event (ppointer->process (-> self manipy)) @@ -1122,113 +943,77 @@ (vector-normalize! (-> gp-0 fountain-rand-transv-lo) (* 12288.0 f30-0)) ) (vector+! (-> gp-0 fountain-rand-transv-lo) (-> gp-0 fountain-rand-transv-lo) (-> s5-0 0 control trans)) - (let ((s5-1 (get-process *default-dead-pool* joint-exploder #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type joint-exploder activate))) - (t9-5 (the-as joint-exploder s5-1) self 'joint-exploder (the-as pointer #x70004000)) + (process-spawn + joint-exploder + *racer-explode-sg* + 24 + gp-0 + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) ) - (run-now-in-process - s5-1 - joint-exploder-init-by-other - *racer-explode-sg* - 24 - gp-0 - (new 'static 'joint-exploder-static-params - :joints - (new - 'static - 'boxed-array - :type joint-exploder-static-joint-params :length 16 :allocated-length 16 - (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) - (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) - ) - ) - ) - (-> s5-1 ppointer) ) + :to self ) ) ) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (fmax -182044.44 (fmin 182044.44 (* -40.0 (-> self racer rot z)))) (case (-> self attack-info mode) (('balloonlurker) (dummy-13 (-> self water) 2.0 (-> self control trans) 1 (-> self control transv)) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 139))) - (set! (-> gp-2 param 0) (ja-aframe 240.0 0)) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) 0.0) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 139)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 139) :num! (seek! (ja-aframe 240.0 0)) :frame-num 0.0) (until (ja-done? 0) (set! (-> self racer stick-lock) #t) - (set! (-> self control unknown-vector11 y) - (seek (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (-> *display* seconds-per-frame))) (send-event *camera* 'joystick 0.0 1.0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 240.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 240.0 0))) ) ) (else - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> self draw art-group data 139))) - (set! (-> a0-30 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 139)) data 0 length) -1)) - ) - (set! (-> a0-30 param 1) 1.0) - (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> self draw art-group data 139)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 139) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (set! (-> self racer stick-lock) #t) (send-event *camera* 'joystick 0.0 1.0) - (set! (-> self control unknown-vector11 y) - (seek (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (-> *display* seconds-per-frame))) (if (>= (ja-aframe-num 0) 245.0) (set-forward-vel (* 0.5 (-> self control unknown-float01))) ) (suspend) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1))) - (set! (-> a0-36 param 1) 1.0) - (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) ) (('melt) - (sound-play-by-name (static-sound-name "zoomer-melt") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-5 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-5 - (let ((t9-29 (method-of-type part-tracker activate))) - (t9-29 (the-as part-tracker gp-5) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-5 part-tracker-init (-> *part-group-id-table* 32) -1 #f #f #f (-> self control trans)) - (-> gp-5 ppointer) - ) + (sound-play "zoomer-melt") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 32) + -1 + #f + #f + #f + (-> self control trans) + :to *entity-pool* ) (clear-collide-with-as (-> self control)) (set! (-> self post-hook) target-no-ja-move-post) @@ -1241,7 +1026,7 @@ ) ) (('endlessfall) - (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-fall") (camera-change-to (the-as string cam-endlessfall) 30 #f) (set! (-> self control pat-ignore-mask unknown-bit) 1) (let ((f30-0 (fmin -4096.0 (- (-> self control ground-impact-vel))))) @@ -1305,21 +1090,17 @@ (go target-stance) (none) ) - :post - target-racing-post + :post target-racing-post ) ;; failed to figure out what this is: (defstate target-racing-get-on (target) - :event - target-generic-event-handler - :exit - (-> target-racing-start exit) - :code - (behavior ((arg0 handle)) + :event target-generic-event-handler + :exit (-> target-racing-start exit) + :code (behavior ((arg0 handle)) (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self alt-cam-pos quad) (-> (&-> (-> self control) unknown-qword00) 0)) - (logior! (-> self state-flags) 1024) + (logior! (-> self state-flags) (state-flags use-alt-cam-pos)) (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control trans quad)) @@ -1350,14 +1131,8 @@ (let ((s5-1 #f) (gp-1 #f) ) - (ja-channel-push! 1 15) - (let ((s4-2 (-> self skel root-channel 0))) - (set! (-> s4-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 138))) - (set! (-> s4-2 param 0) (ja-aframe 77.0 0)) - (set! (-> s4-2 param 1) 1.0) - (set! (-> s4-2 frame-num) 0.0) - (joint-control-channel-group! s4-2 (the-as art-joint-anim (-> self draw art-group data 138)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 138) :num! (seek! (ja-aframe 77.0 0)) :frame-num 0.0) (until (ja-done? 0) (when (and (not s5-1) (= (-> self skel root-channel 0) (-> self skel channel))) (send-event (ppointer->process (-> self manipy)) 'anim-mode 'clone-anim) @@ -1366,7 +1141,7 @@ (set! (-> self control transv quad) (the-as uint128 0)) (when (< 50.0 (ja-aframe-num 0)) (when (not gp-1) - (sound-play-by-name (static-sound-name "zoomer-start") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-start") (set! gp-1 #t) ) (set! (-> self racer front-rotv) 65536.0) @@ -1386,14 +1161,10 @@ (set-twist! (-> self racer bottom-blade) (the-as float #f) (the-as float #f) (- (-> self racer bottom-rot))) ) (suspend) - (let ((s4-4 (-> self skel root-channel 0))) - (set! (-> s4-4 param 0) (ja-aframe 77.0 0)) - (set! (-> s4-4 param 1) 1.0) - (joint-control-channel-group-eval! s4-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 77.0 0))) ) ) - (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) (send-event *camera* 'set-slave-option #x6000) (set! (-> self control transv quad) (the-as uint128 0)) (quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00)) @@ -1404,38 +1175,12 @@ (= (-> *target* current-level name) 'firecanyon) (= (-> *target* current-level name) 'citadel) ) - (let ((gp-3 (get-process *default-dead-pool* hud-bike-heat #x4000))) - (set! (-> *hud-parts* bike-heat) - (the-as - (pointer hud-bike-heat) - (when gp-3 - (let ((t9-23 (method-of-type hud-bike-heat activate))) - (t9-23 (the-as hud-bike-heat gp-3) self 'hud-bike-heat (the-as pointer #x70004000)) - ) - (run-now-in-process gp-3 hud-init-by-other 0) - (-> gp-3 ppointer) - ) - ) - ) - ) + (set! (-> *hud-parts* bike-heat) (process-spawn hud-bike-heat :init hud-init-by-other 0 :to self)) (set! (-> *hud-parts* buzzers 0 next-y-offset) -120) (set! (-> *hud-parts* buzzers 0 y-sgn) 0) 0 ) - (let ((gp-4 (get-process *default-dead-pool* hud-bike-speed #x4000))) - (set! (-> *hud-parts* bike-speed) - (the-as - (pointer hud-bike-speed) - (when gp-4 - (let ((t9-26 (method-of-type hud-bike-speed activate))) - (t9-26 (the-as hud-bike-speed gp-4) self 'hud-bike-speed (the-as pointer #x70004000)) - ) - (run-now-in-process gp-4 hud-init-by-other 0) - (-> gp-4 ppointer) - ) - ) - ) - ) + (set! (-> *hud-parts* bike-speed) (process-spawn hud-bike-speed :init hud-init-by-other 0 :to self)) (set! (-> *hud-parts* power 0 next-y-offset) -120) (set! (-> *hud-parts* power 0 y-sgn) 0) 0 @@ -1443,8 +1188,7 @@ (go target-racing) (none) ) - :post - (behavior () + :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (f30-0 (fmin 1.0 (* 0.0044444446 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) ) @@ -1495,12 +1239,9 @@ ;; failed to figure out what this is: (defstate target-racing-get-off (target) - :event - target-generic-event-handler - :exit - (-> target-racing-start exit) - :code - (behavior ((arg0 handle)) + :event target-generic-event-handler + :exit (-> target-racing-start exit) + :code (behavior ((arg0 handle)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *racer-mods*) (let ((a0-2 (-> *hud-parts* bike-speed))) @@ -1513,48 +1254,12 @@ (set! (-> a0-4 0 deactivate-when-hidden) #t) ) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 123) - ) - ) - (ja-channel-push! 4 30) - (let ((s5-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data 123)) - num-func-identity - ) - (set! (-> s5-0 frame-num) (ja-aframe (-> self racer turn-anim-frame) 0)) - ) - (let ((a0-13 (-> self skel root-channel 1))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 124))) - (set! (-> a0-13 param 0) 0.0) - (joint-control-channel-group-eval! - a0-13 - (the-as art-joint-anim (-> self draw art-group data 124)) - num-func-chan - ) - ) - (let ((a0-14 (-> self skel root-channel 2))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 125))) - (set! (-> a0-14 param 0) 0.0) - (joint-control-channel-group-eval! - a0-14 - (the-as art-joint-anim (-> self draw art-group data 125)) - num-func-chan - ) - ) - (let ((a0-15 (-> self skel root-channel 3))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 126))) - (set! (-> a0-15 param 0) 0.0) - (joint-control-channel-group-eval! - a0-15 - (the-as art-joint-anim (-> self draw art-group data 126)) - num-func-chan - ) - ) + (when (not (ja-group? (-> self draw art-group data 123))) + (ja-channel-push! 4 (seconds 0.1)) + (ja :group! (-> self draw art-group data 123) :num! (identity (ja-aframe (-> self racer turn-anim-frame) 0))) + (ja :chan 1 :group! (-> self draw art-group data 124) :num! (chan 0)) + (ja :chan 2 :group! (-> self draw art-group data 125) :num! (chan 0)) + (ja :chan 3 :group! (-> self draw art-group data 126) :num! (chan 0)) ) (let ((s5-1 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.5)) @@ -1563,28 +1268,22 @@ (set! (-> self racer turn-anim-targ) 0.0) (set! (-> self racer turn-anim-targ) 0.0) (target-racing-turn-anim) - (set! (-> self control unknown-vector11 y) - (seek (-> self control unknown-vector11 y) 6144.0 (* 3.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 3.0 (-> *display* seconds-per-frame))) (suspend) ) ) (go target-racing-get-off-jump arg0) (none) ) - :post - target-racing-post + :post target-racing-post ) ;; failed to figure out what this is: (defstate target-racing-get-off-jump (target) - :event - target-generic-event-handler - :exit - (-> target-racing-start exit) - :code - (behavior ((arg0 handle)) - (sound-play-by-name (static-sound-name "zoomer-stop") (new-sound-id) 1024 0 0 1 #t) + :event target-generic-event-handler + :exit (-> target-racing-start exit) + :code (behavior ((arg0 handle)) + (sound-play "zoomer-stop") (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control transv quad) (the-as uint128 0)) (let ((gp-1 (new 'stack-no-clear 'vector))) @@ -1613,23 +1312,11 @@ (set! (-> self control unknown-vector102 quad) (-> gp-1 quad)) (set! (-> self control unknown-vector103 quad) (-> s4-1 quad)) ) - (ja-channel-push! 1 15) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 137))) - (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 137)) data 0 length) -1)) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 137)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 137) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event (handle->process arg0) 'draw) (set-yaw-angle-clear-roll-pitch! @@ -1647,8 +1334,7 @@ (go target-racing-get-off-hit-ground #f) (none) ) - :post - (behavior () + :post (behavior () (let* ((f0-2 (deg-diff (-> self racer front-rot) (-> *RACER-bank* default-front-blade))) (f0-5 (if (< 0.0 f0-2) (fmax 5461.3335 (* 4.0 f0-2)) @@ -1656,9 +1342,7 @@ ) ) ) - (set! (-> self racer front-rotv) - (seek (-> self racer front-rotv) f0-5 (* 54613.332 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer front-rotv) f0-5 (* 54613.332 (-> *display* seconds-per-frame))) ) (set! (-> self racer front-rot) (the float @@ -1728,41 +1412,24 @@ ;; failed to figure out what this is: (defstate target-racing-get-off-hit-ground (target) - :event - target-standard-event-handler - :enter - (-> target-hit-ground enter) - :trans - (behavior () - (logior! (-> self control status) 7) + :event target-standard-event-handler + :enter (-> target-hit-ground enter) + :trans (behavior () + (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) ((-> target-hit-ground trans)) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 42.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 35) :num! (seek!) :frame-num (ja-aframe 42.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go target-stance) (none) ) - :post - (behavior () + :post (behavior () (hide-hud) (target-post) (none) @@ -1771,8 +1438,7 @@ ;; failed to figure out what this is: (defstate target-racing-grab (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) (-> self state name) @@ -1792,91 +1458,48 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self control unknown-surface00) *grab-mods*) (set! (-> self neck flex-blend) 0.0) - (logior! (-> self state-flags) 272) + (logior! (-> self state-flags) (state-flags invulnerable grabbed)) (set! (-> self racer stick-off) #t) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self racer stick-off) #f) - (set! (-> self state-flags) (logand -273 (-> self state-flags))) - (set! (-> self water flags) (logand -65537 (-> self water flags))) + (logclear! (-> self state-flags) (state-flags invulnerable grabbed)) + (logclear! (-> self water flags) (water-flags wt16)) ((-> target-racing-start exit)) (none) ) - :code - (behavior () - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 123) - ) - ) - (ja-channel-push! 4 30) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 123)) - num-func-identity - ) - (set! (-> gp-0 frame-num) (ja-aframe (-> self racer turn-anim-frame) 0)) - ) - (let ((a0-7 (-> self skel root-channel 1))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 124))) - (set! (-> a0-7 param 0) 0.0) - (joint-control-channel-group-eval! - a0-7 - (the-as art-joint-anim (-> self draw art-group data 124)) - num-func-chan - ) - ) - (let ((a0-8 (-> self skel root-channel 2))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 125))) - (set! (-> a0-8 param 0) 0.0) - (joint-control-channel-group-eval! - a0-8 - (the-as art-joint-anim (-> self draw art-group data 125)) - num-func-chan - ) - ) - (let ((a0-9 (-> self skel root-channel 3))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 126))) - (set! (-> a0-9 param 0) 0.0) - (joint-control-channel-group-eval! - a0-9 - (the-as art-joint-anim (-> self draw art-group data 126)) - num-func-chan - ) - ) + :code (behavior () + (when (not (ja-group? (-> self draw art-group data 123))) + (ja-channel-push! 4 (seconds 0.1)) + (ja :group! (-> self draw art-group data 123) :num! (identity (ja-aframe (-> self racer turn-anim-frame) 0))) + (ja :chan 1 :group! (-> self draw art-group data 124) :num! (chan 0)) + (ja :chan 2 :group! (-> self draw art-group data 125) :num! (chan 0)) + (ja :chan 3 :group! (-> self draw art-group data 126) :num! (chan 0)) ) - (while #t + (loop (target-racing-turn-anim) (set-forward-vel 0.0) (suspend) ) (none) ) - :post - target-racing-post + :post target-racing-post ) ;; failed to figure out what this is: (defstate target-racing-clone-anim (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (= arg2 'trans) (= (-> arg3 param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) ((-> target-racing-grab event) arg0 arg1 arg2 arg3) ) - :enter - (-> target-clone-anim enter) - :exit - (behavior () + :enter (-> target-clone-anim enter) + :exit (behavior () (set! (-> self control unknown-vector11 y) (the-as float (-> self control unknown-uint20))) (set! (-> self control unknown-vector12 y) (-> self control unknown-vector11 y)) (send-event (ppointer->process (-> self sidekick)) 'matrix #f) @@ -1885,8 +1508,7 @@ (vector-reset! (-> self control transv)) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-vector11 y))) (set! (-> self control unknown-vector11 y) 0.0) (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) @@ -1894,12 +1516,9 @@ (go target-racing) (none) ) - :post - (behavior () + :post (behavior () (racer-sounds) - (set! (-> self racer heat) - (seek (-> self racer heat) 0.0 (* (-> *RACER-bank* surface-heat-inc) (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer heat) 0.0 (* (-> *RACER-bank* surface-heat-inc) (-> *display* seconds-per-frame))) (vector+! (-> self racer bike-trans) (-> self control trans) (-> self control unknown-vector12)) (quaternion-copy! (the-as quaternion (-> self racer bike-quat)) (-> self control quat)) (set! (-> self racer bike-scale quad) (-> self control scale quad)) diff --git a/test/decompiler/reference/levels/racer_common/racer_REF.gc b/test/decompiler/reference/levels/racer_common/racer_REF.gc index b04cbe46bd..fb27c72f22 100644 --- a/test/decompiler/reference/levels/racer_common/racer_REF.gc +++ b/test/decompiler/reference/levels/racer_common/racer_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/racer-ag.gc") + ;; failed to figure out what this is: (if (not (nmember "racerp" *kernel-packages*)) (set! *kernel-packages* (cons "racerp" *kernel-packages*)) @@ -59,33 +61,24 @@ ) ;; failed to figure out what this is: -(defskelgroup *racer-sg* racer - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3.5) - :longest-edge (meters 0) - :shadow 2 - :sort 1 - ) +(defskelgroup *racer-sg* racer racer-geo-jg 3 + ((racer-geo-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + :shadow racer-shadow-mg + :sort 1 + ) ;; failed to figure out what this is: -(defskelgroup *racer-explode-sg* racer - 22 - 24 - ((23 (meters 999999))) - :bounds (static-spherem 0 0 0 3.5) - :longest-edge (meters 0) - ) +(defskelgroup *racer-explode-sg* racer racer-explode-lod0-jg racer-explode-idle-ja + ((racer-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + ) ;; definition for symbol *racer-shadow-control*, type shadow-control -(define - *racer-shadow-control* +(define *racer-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #xa)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 614400.0) + :flags (shadow-flags disable-fade shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) :bot-plane (new 'static 'plane :y 1.0 :w 81920.0) :top-plane (new 'static 'plane :y 1.0 :w 2048.0) ) @@ -106,8 +99,7 @@ ;; failed to figure out what this is: (defstate wait-for-start (racer) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-1 structure)) (let ((v1-0 arg2)) (the-as @@ -138,15 +130,13 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (set! (-> self root-override root-prim prim-core action) (collide-action)) (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) 0 (none) ) - :code - (behavior () + :code (behavior () (label cfg-0) (case (-> self condition) ((2) @@ -158,9 +148,7 @@ (case (current-status gp-0) (((task-status need-reward-speech)) (ja-channel-set! 1) - (let ((v1-15 (-> self skel root-channel 0))) - (set! (-> v1-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) (set! (-> self root-override root-prim prim-core action) (collide-action solid ca-11)) (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) (ja-post) @@ -239,22 +227,16 @@ ;; failed to figure out what this is: (defstate idle (racer) :virtual #t - :event - (-> (method-of-type racer wait-for-start) event) - :enter - (behavior () + :event (-> (method-of-type racer wait-for-start) event) + :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (-> self path-target)) (none) ) - :exit - (-> (method-of-type racer wait-for-start) exit) - :code - (behavior () + :exit (-> (method-of-type racer wait-for-start) exit) + :code (behavior () (ja-channel-set! 1) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) (set! (-> self root-override root-prim prim-core action) (collide-action solid ca-11)) (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) 0.0 @@ -264,7 +246,7 @@ ) ) ) - (while #t + (loop (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9))) (go-virtual wait-for-return) ) @@ -299,21 +281,17 @@ ) (none) ) - :post - (the-as (function none :behavior racer) ja-post) + :post (the-as (function none :behavior racer) ja-post) ) ;; failed to figure out what this is: (defstate pickup (racer) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('draw) (ja-channel-set! 1) - (let ((v1-3 (-> self skel root-channel 0))) - (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) (set! (-> self root-override root-prim prim-core action) (collide-action solid ca-11)) (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) (transform-post) @@ -340,13 +318,11 @@ ) ) ) - :enter - (behavior ((arg0 (state collectable))) + :enter (behavior ((arg0 (state collectable))) ((the-as (function none :behavior racer) (-> arg0 enter))) (none) ) - :code - (behavior ((arg0 (state collectable))) + :code (behavior ((arg0 (state collectable))) (ja-channel-set! 0) (ja-post) (while (zero? (ja-group-size)) @@ -390,8 +366,7 @@ ;; failed to figure out what this is: (defstate wait-for-return (racer) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (if (and (or (= arg2 'touch) (= arg2 'attack)) (and (!= (-> self condition) 4) (send-event *target* 'end-mode))) (go-virtual pickup (the-as (state collectable) (method-of-object self idle))) ) @@ -418,17 +393,15 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (blocking-plane-destroy) (blocking-plane-spawn (the-as curve-control (-> self path-racer))) (none) ) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (ja-post) - (while #t + (loop (if (not (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9)))) (go-virtual idle) ) @@ -497,19 +470,8 @@ ) ) ) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "zoom-teleport") - :volume #x400 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> obj root-override trans)) ) (go (method-of-object obj wait-for-start)) (none) diff --git a/test/decompiler/reference/levels/racer_common/target-racer-h_REF.gc b/test/decompiler/reference/levels/racer_common/target-racer-h_REF.gc index 266a70db08..9f2fe9cc62 100644 --- a/test/decompiler/reference/levels/racer_common/target-racer-h_REF.gc +++ b/test/decompiler/reference/levels/racer_common/target-racer-h_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/balloon-ag.gc") + ;; definition of type racer-info (deftype racer-info (basic) ((entity entity-actor :offset-assert 4) @@ -262,10 +264,7 @@ ) ;; failed to figure out what this is: -(defskelgroup *balloon-sg* balloon - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 1.7 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *balloon-sg* balloon balloon-lod0-jg balloon-idle-ja + ((balloon-lod0-mg (meters 20)) (balloon-lod1-mg (meters 999999))) + :bounds (static-spherem 0 1.7 0 3) + ) diff --git a/test/decompiler/reference/levels/racer_common/target-racer_REF.gc b/test/decompiler/reference/levels/racer_common/target-racer_REF.gc index e342c9b1c1..2b8fca0fc0 100644 --- a/test/decompiler/reference/levels/racer_common/target-racer_REF.gc +++ b/test/decompiler/reference/levels/racer_common/target-racer_REF.gc @@ -25,7 +25,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :flags #x1 + :flags (surface-flags allow-look-around) ) ) @@ -54,7 +54,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x801 + :flags (surface-flags allow-look-around jump) ) ) @@ -89,7 +89,7 @@ ;; definition for function racer-on-ground? (defbehavior racer-on-ground? racer () - (logtest? (-> self root-override status) 1) + (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) ) ;; definition for function racer-calc-gravity @@ -129,16 +129,14 @@ (let ((v1-1 (-> self racer slide-mode))) (cond ((zero? v1-1) - (if (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) + (if (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) + ) (set! (-> self racer slide-mode) -1) ) ) ((= v1-1 1) - (if (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) + (if (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) + ) (set! (-> self racer slide-mode) -1) ) ) @@ -155,7 +153,7 @@ ) ) ) - (set! (-> self racer slide-amp) (seek (-> self racer slide-amp) 0.0 (* 0.3 (-> *display* seconds-per-frame)))) + (seek! (-> self racer slide-amp) 0.0 (* 0.3 (-> *display* seconds-per-frame))) (if (= (-> self racer slide-amp) 0.0) (set! (-> self racer slide-mode) -1) ) @@ -168,7 +166,7 @@ ;; Used lq/sq (defbehavior racer-xz target ((arg0 float) (arg1 float)) (set! (-> self racer slide-shift-x) arg1) - (set! (-> self racer slide-interp) (seek (-> self racer slide-interp) 0.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer slide-interp) 0.0 (-> *display* seconds-per-frame)) (let ((f30-1 (if (or (< (* arg1 arg0) 0.0) (not (racer-on-ground?))) 1.0 @@ -182,9 +180,7 @@ (lerp-scale 91022.22 236657.78 (-> self control unknown-float01) 0.0 (* 0.125 (-> self racer transv-max))) ) ) - (set! (-> self racer rotv y) - (seek (-> self racer rotv y) (* arg0 f30-1 (- f28-1)) (* f0-18 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer rotv y) (* arg0 f30-1 (- f28-1)) (* f0-18 (-> *display* seconds-per-frame))) ) (set! (-> self racer rotv y) (* (-> self racer rotv y) @@ -199,15 +195,13 @@ (set! (-> self racer slide-grip-mult) 1.0) ) (s5-1 - (set! (-> self racer slide-grip-mult) - (seek (-> self racer slide-grip-mult) 1.0 (-> *display* seconds-per-frame)) - ) + (seek! (-> self racer slide-grip-mult) 1.0 (-> *display* seconds-per-frame)) ) ) (let ((f30-4 (* (deg-diff f30-3 0.0) (-> self racer slide-grip-mult)))) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control transv) (meters 0.000061035156) @@ -234,7 +228,7 @@ (vector-float*! gp-1 gp-1 0.5) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) gp-1 (meters 0.00024414062) @@ -243,7 +237,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "ltransv" @@ -254,7 +248,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "nose" @@ -288,13 +282,11 @@ (+! (-> self control unknown-vector00 z) (* f1-4 (-> *display* seconds-per-frame))) ) ) - (set! (-> self racer front-rotv) - (seek - (-> self racer front-rotv) - (+ 65536.0 (* 364088.88 (+ f0-0 (* 0.1 arg1)))) - (* 364088.88 (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self racer front-rotv) + (+ 65536.0 (* 364088.88 (+ f0-0 (* 0.1 arg1)))) + (* 364088.88 (-> *display* seconds-per-frame)) + ) ) (set! (-> self racer front-rot) (the float @@ -312,11 +304,10 @@ ) (set! f0-13 (cond - ((and (not - (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) - ) + ((and (not (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) + (>= (-> self fact-info-target eco-level) 1.0) + ) + ) (cpad-hold? (-> self control unknown-cpad-info00 number) square) ) (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) x) @@ -363,13 +354,11 @@ (defbehavior racer-cushion target ((arg0 float)) (let ((f30-0 (-> self racer bob-period))) (let ((f28-0 1.0)) - (set! (-> self racer bob-meta-timer) - (seek - (-> self racer bob-meta-timer) - (-> self racer bob-meta-meta-timer) - (* 4.0 (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self racer bob-meta-timer) + (-> self racer bob-meta-meta-timer) + (* 4.0 (-> *display* seconds-per-frame)) + ) (let* ((f0-8 (sin (/ (* 65536.0 (-> self racer bob-timer)) f30-0))) (f0-9 (* 1228.8 (-> self racer bob-mult-trans) f28-0 f0-8)) ) @@ -382,7 +371,7 @@ (+! (-> a2-1 y) (-> self racer cushion-bob)) (add-debug-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) a2-1 819.2 (new 'static 'rgba :r #xff :b #xff :a #x80) @@ -412,9 +401,7 @@ (set! (-> self racer hill-offset) (lerp (-> self racer hill-offset) 0.0 0.05)) ) ) - (set! (-> self racer hill-boost) - (seek (-> self racer hill-boost) 0.0 (* 81920.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer hill-boost) 0.0 (* 81920.0 (-> *display* seconds-per-frame))) (set! (-> self racer hill-offset) 0.0) 0 (none) @@ -460,21 +447,23 @@ ((< (-> self racer shock-offset) -8192.0) (set! (-> self racer shock-offset) -8192.0) (set! (-> self racer shock-offsetv) 0.0) - (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-0 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker s5-0) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 part-tracker-init (-> *part-group-id-table* 13) -1 #f #f #f (-> self control trans)) - (-> s5-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 13) + -1 + #f + #f + #f + (-> self control trans) + :to self ) (dummy-10 (-> self skel effect) 'effect-land -1.0 -1) ) ) (deg-diff (vector-y-angle gp-0) (vector-y-angle (-> self control transv))) (let ((f30-2 (vector-xz-length gp-0))) - (when (and (logtest? (-> self control status) 8) + (when (and (logtest? (-> self control status) (cshape-moving-flags twall)) (< 20480.0 f30-2) (and (< (fabs (-> self racer mod-x)) 0.5) (!= (-> self next-state name) 'target-racing-smack)) ) @@ -558,21 +547,21 @@ ) ) (let ((f0-2 - (if (or (and (logtest? (-> self control status) 8) (zero? (logand (-> self control status) 1))) - (logtest? (-> self state-flags) #x8000) + (if (or (and (logtest? (-> self control status) (cshape-moving-flags twall)) + (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + ) + (logtest? (-> self state-flags) (state-flags dying)) ) 0.0 (-> self control unknown-float81) ) ) ) - (set! (-> self control unknown-float80) - (seek - (-> self control unknown-float80) - f0-2 - (* (-> self control unknown-float82) (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self control unknown-float80) + f0-2 + (* (-> self control unknown-float82) (-> *display* seconds-per-frame)) + ) ) (vector-deg-slerp (-> self control dynam gravity-normal) @@ -598,11 +587,10 @@ 100.0 (let ((f0-6 (+ (* 2.0 f0-1) - (if (< 4096.0 - (vector-dot - (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) - ) + (if (< 4096.0 (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) + ) ) 0.7 0.0 @@ -614,50 +602,38 @@ (if (< 2.5 f0-6) (set! f0-6 2.5) ) - (set! (-> self racer engine-sound-pitch) - (seek (-> self racer engine-sound-pitch) f0-6 (* 4.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer engine-sound-pitch) f0-6 (* 4.0 (-> *display* seconds-per-frame))) ) ) (let ((f0-11 (lerp-scale 100.0 60.0 (-> self racer engine-sound-pitch) 0.8 2.0))) - (sound-play-by-name - (static-sound-name "zoomer-loop") - (-> self racer engine-sound-id) - (the int (* 10.24 f0-11)) - (the int (* 1524.0 (-> self racer engine-sound-pitch))) - 0 - 1 - (the-as symbol (-> self control trans)) + (sound-play + "zoomer-loop" + :id (-> self racer engine-sound-id) + :vol f0-11 + :pitch (-> self racer engine-sound-pitch) + :position (the-as symbol (-> self control trans)) ) ) (cond ((and (!= (-> self current-level name) 'ogre) (!= (-> self current-level name) 'lavatube)) #f ) - ((or (logtest? (-> self control status) 2) (< 12288.0 (vector-length (-> self control transv)))) + ((or (logtest? (-> self control status) (cshape-moving-flags onground)) + (< 12288.0 (vector-length (-> self control transv))) + ) (let ((v0-5 (the-as object (-> *display* base-frame-counter)))) (set! (-> self racer unstuck-time) (the-as time-frame v0-5)) v0-5 ) ) ((>= (- (-> *display* base-frame-counter) (-> self racer unstuck-time)) (seconds 5)) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'attack) - (set! (-> a1-6 param 0) (the-as uint #f)) - (let ((a0-12 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-12 mode) 'heat) - (set! (-> a1-6 param 1) (the-as uint a0-12)) - ) - (send-event-function self a1-6) - ) + (send-event self 'attack #f (static-attack-info ((mode 'heat)))) ) ((and (>= (- (-> *display* base-frame-counter) (-> self racer unstuck-time)) (seconds 3)) (>= (- (-> *display* base-frame-counter) (-> self racer heat-sound-time)) (seconds 1)) ) (set! (-> self racer heat-sound-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warning") ) ) ) @@ -731,73 +707,72 @@ (let* ((gp-4 #f) (s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 10))) (v1-61 (-> self control ground-pat material)) - (a1-13 - (cond - ((= v1-61 (pat-material waterbottom)) - (when (and (logtest? (-> self draw status) (draw-status was-drawn)) (zero? (-> self draw cur-lod))) - (let ((f1-3 (y-angle (-> self control))) - (f0-17 (-> self control unknown-float01)) - (s4-2 s5-2) - ) - (set! (-> s4-2 y) (-> self water height)) - (set! (-> *part-id-table* 2275 init-specs 4 initial-valuef) (+ 24576.0 f1-3)) - (set! (-> *part-id-table* 2275 init-specs 19 initial-valuef) (+ 49152.0 f1-3)) - (set! (-> *part-id-table* 2275 init-specs 1 initial-valuef) (* 0.0000036621095 f0-17)) - (set! (-> *part-id-table* 2275 init-specs 2 initial-valuef) (* 0.1 f0-17)) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2275) - s4-2 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2276) - s4-2 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 + (a1-13 (cond + ((= v1-61 (pat-material waterbottom)) + (when (and (logtest? (-> self draw status) (draw-status was-drawn)) (zero? (-> self draw cur-lod))) + (let ((f1-3 (y-angle (-> self control))) + (f0-17 (-> self control unknown-float01)) + (s4-2 s5-2) + ) + (set! (-> s4-2 y) (-> self water height)) + (set! (-> *part-id-table* 2275 init-specs 4 initial-valuef) (+ 24576.0 f1-3)) + (set! (-> *part-id-table* 2275 init-specs 19 initial-valuef) (+ 49152.0 f1-3)) + (set! (-> *part-id-table* 2275 init-specs 1 initial-valuef) (* 0.0000036621095 f0-17)) + (set! (-> *part-id-table* 2275 init-specs 2 initial-valuef) (* 0.1 f0-17)) + (sp-launch-particles-var + *sp-particle-system-3d* + (-> *part-id-table* 2275) + s4-2 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + (sp-launch-particles-var + *sp-particle-system-3d* + (-> *part-id-table* 2276) + s4-2 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + (-> *part-id-table* 2208) + ) + ((= v1-61 (pat-material lava)) + (-> *part-id-table* 2213) + ) + ((= v1-61 (pat-material hotcoals)) + (-> *part-id-table* 2214) + ) + ((or (= v1-61 (pat-material pcmetal)) + (= v1-61 (pat-material metal)) + (= v1-61 (pat-material tube)) + (= v1-61 (pat-material rotate)) + ) + (-> *part-id-table* 2215) + ) + ((= v1-61 (pat-material grass)) + (-> *part-id-table* 2207) + ) + ((or (= v1-61 (pat-material dirt)) + (= v1-61 (pat-material sand)) + (= v1-61 (pat-material straw)) + (= v1-61 (pat-material gravel)) + ) + (-> *part-id-table* 2216) + ) + ((or (= v1-61 (pat-material wood)) (= v1-61 (pat-material crwood))) + (-> *part-id-table* 2217) + ) + ((= v1-61 (pat-material stone)) + (-> *part-id-table* 2831) + ) + (else + (-> *part-id-table* 2211) ) ) ) - (-> *part-id-table* 2208) - ) - ((= v1-61 (pat-material lava)) - (-> *part-id-table* 2213) - ) - ((= v1-61 (pat-material hotcoals)) - (-> *part-id-table* 2214) - ) - ((or (= v1-61 (pat-material pcmetal)) - (= v1-61 (pat-material metal)) - (= v1-61 (pat-material tube)) - (= v1-61 (pat-material rotate)) - ) - (-> *part-id-table* 2215) - ) - ((= v1-61 (pat-material grass)) - (-> *part-id-table* 2207) - ) - ((or (= v1-61 (pat-material dirt)) - (= v1-61 (pat-material sand)) - (= v1-61 (pat-material straw)) - (= v1-61 (pat-material gravel)) - ) - (-> *part-id-table* 2216) - ) - ((or (= v1-61 (pat-material wood)) (= v1-61 (pat-material crwood))) - (-> *part-id-table* 2217) - ) - ((= v1-61 (pat-material stone)) - (-> *part-id-table* 2831) - ) - (else - (-> *part-id-table* 2211) - ) - ) - ) ) (set! (-> s5-2 y) (-> self control shadow-pos y)) (if (nonzero? a1-13) @@ -857,7 +832,7 @@ ) (cpad-pressed? (-> self control unknown-cpad-info00 number) circle square) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 0.25)) - (zero? (logand (-> self state-flags) #x8008)) + (zero? (logand (-> self state-flags) (state-flags being-attacked dying))) ) (let ((gp-6 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat))) (s5-4 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 4))) @@ -865,25 +840,18 @@ (set! (-> gp-6 y) 0.0) (vector-normalize! gp-6 (-> *RACER-bank* yellow-projectile-speed)) (vector+! gp-6 gp-6 (-> self control transv)) - (let ((s4-3 (get-process *default-dead-pool* projectile-yellow #x4000))) - (when s4-3 - (let ((t9-22 (method-of-type projectile-yellow activate))) - (t9-22 (the-as projectile-yellow s4-3) self 'projectile-yellow (the-as pointer #x70004000)) + (process-spawn + projectile-yellow + :init projectile-init-by-other + (-> self entity) + s5-4 + gp-6 + (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + 152 + 136 ) - (run-now-in-process - s4-3 - projectile-init-by-other - (-> self entity) - s5-4 - gp-6 - (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) - 152 - 136 - ) - #f - ) - (-> s4-3 ppointer) - ) + #f + :to self ) ) (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) @@ -909,46 +877,30 @@ ) (case (-> self control poly-pat material) (((pat-material hotcoals)) - (set! (-> self racer heat) - (seek (-> self racer heat) (-> *RACER-bank* heat-max) (* f22-1 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f22-1 (-> *display* seconds-per-frame))) ) (((pat-material lava)) (if (racer-on-ground?) - (set! (-> self racer heat) - (seek (-> self racer heat) (-> *RACER-bank* heat-max) (* f24-1 (-> *display* seconds-per-frame))) - ) - (set! (-> self racer heat) - (seek (-> self racer heat) (-> *RACER-bank* heat-max) (* f28-2 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f24-1 (-> *display* seconds-per-frame))) + (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f28-2 (-> *display* seconds-per-frame))) ) ) (else (if (not (racer-on-ground?)) - (set! (-> self racer heat) (seek (-> self racer heat) 0.0 (* f26-0 (-> *display* seconds-per-frame)))) + (seek! (-> self racer heat) 0.0 (* f26-0 (-> *display* seconds-per-frame))) ) ) ) ) (let ((v1-189 (- (-> *display* base-frame-counter) (-> self control unknown-dword11)))) (if (and (>= v1-189 (seconds 0.9)) (>= (seconds 3) v1-189)) - (set! (-> self racer heat) (seek (-> self racer heat) 0.0 (* f30-2 (-> *display* seconds-per-frame)))) + (seek! (-> self racer heat) 0.0 (* f30-2 (-> *display* seconds-per-frame))) ) ) ) - (when (and (>= (-> self racer heat) (-> *RACER-bank* heat-max)) (= (-> self game mode) 'play)) - (let ((a1-43 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-43 from) self) - (set! (-> a1-43 num-params) 2) - (set! (-> a1-43 message) 'attack) - (set! (-> a1-43 param 0) (the-as uint #f)) - (let ((a0-68 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-68 mode) 'heat) - (set! (-> a1-43 param 1) (the-as uint a0-68)) - ) - (send-event-function self a1-43) + (if (and (>= (-> self racer heat) (-> *RACER-bank* heat-max)) (= (-> self game mode) 'play)) + (send-event self 'attack #f (static-attack-info ((mode 'heat)))) ) - ) (if (and *cheat-mode* *debug-segment* (cpad-pressed? 0 l2)) (send-event self 'boost 1.0) ) @@ -962,9 +914,8 @@ (set! (-> self racer boost-curve) 0.0) ) ) - (when (or (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) - ) + (when (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) + ) (< (-> self control unknown-float01) 4096.0) (= (-> self racer boost-level) 0.0) ) @@ -975,7 +926,7 @@ (set! (-> v1-241 parms volume) -4) (set! (-> v1-241 auto-time) 120) (set! (-> v1-241 auto-from) 2) - (set! (-> v1-241 parms mask) (the-as uint 17)) + (set! (-> v1-241 parms mask) (sound-mask volume time)) (-> v1-241 id) ) (set! (-> self racer boost-sound-id) (new 'static 'sound-id)) @@ -984,9 +935,7 @@ (set! (-> self racer boost-level) 0.0) ) (set! (-> self racer boost-target) (+ (-> self racer boost-curve) (-> self racer boost-level))) - (set! (-> self racer boost-output) - (seek (-> self racer boost-output) (-> self racer boost-target) (* 40960.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer boost-output) (-> self racer boost-target) (* 40960.0 (-> *display* seconds-per-frame))) (when (!= (-> self racer boost-output) 0.0) (dotimes (gp-7 8) (let ((v1-258 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) @@ -1002,12 +951,12 @@ ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 1 (seconds 0.1)) ) - (when (logtest? (-> self control status) 8) + (when (logtest? (-> self control status) (cshape-moving-flags twall)) (let* ((gp-8 (racer-find-prop-point (new 'stack-no-clear 'vector) (-> self control unknown-vector70))) - (v1-274 (shr (shl (-> self control unknown-int60) 52) 58)) + (v1-274 (-> self control wall-pat material)) (a1-54 (cond - ((or (= v1-274 16) (= v1-274 8)) + ((or (= v1-274 (pat-material metal)) (= v1-274 (pat-material pcmetal))) (set! (-> *part-id-table* 2226 init-specs 1 initial-valuef) (lerp-scale 0.2 10.0 (-> self control unknown-float01) 0.0 (-> self racer transv-max)) ) @@ -1033,12 +982,12 @@ ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 51 (seconds 0.05)) (sound-play-by-name - (sound-name-with-material 'zoom-hit (the-as pat-surface (-> self control unknown-int60)) "") + (sound-name-with-material 'zoom-hit (-> self control wall-pat) "") (-> self racer scrape-sound-id) 1024 0 0 - 1 + (sound-group sfx) #t ) ) @@ -1050,7 +999,7 @@ ) ) (set! (-> self racer heat-sound-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warning") ) (when (rand-vu-percent? (/ (-> self racer heat) (-> *RACER-bank* heat-max))) (let ((a2-28 @@ -1191,15 +1140,8 @@ (* -273.06668 (-> self racer tail-anim-frame)) ) (let ((f30-2 (fmin 1.0 (* 2.0 (fabs (-> self racer slide-shift-x)))))) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 num-func) num-func-identity) - (set! (-> gp-1 frame-num) (ja-aframe (-> self racer turn-anim-frame) 0)) - ) - (let ((a0-9 (-> self skel root-channel 1))) - (set! (-> a0-9 frame-interp) (+ 0.5 (* 0.025 (-> self racer tail-anim-frame)))) - (set! (-> a0-9 param 0) 0.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num-func num-func-identity :frame-num (ja-aframe (-> self racer turn-anim-frame) 0)) + (ja :chan 1 :num! (chan 0) :frame-interp (+ 0.5 (* 0.025 (-> self racer tail-anim-frame)))) (let ((gp-2 (-> self skel root-channel 2))) (let ((f0-82 (lerp (-> self racer slide-interp) f30-2 0.125))) (set! (-> self racer slide-interp) f0-82) @@ -1209,19 +1151,16 @@ (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-chan) ) ) - (let ((a0-12 (-> self skel root-channel 3))) - (set! (-> a0-12 frame-interp) - (* (-> self racer slide-interp) (+ 0.5 (* 0.025 (-> self racer tail-anim-frame)))) - ) - (set! (-> a0-12 param 0) 0.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :chan 3 + :num! (chan 0) + :frame-interp (* (-> self racer slide-interp) (+ 0.5 (* 0.025 (-> self racer tail-anim-frame)))) + ) 0 (none) ) ;; definition for function target-racing-jump-anim -(defbehavior target-racing-jump-anim target ((arg0 basic) (arg1 int)) +(defbehavior target-racing-jump-anim target ((arg0 basic) (arg1 time-frame)) (let ((s4-0 'nothing) (f30-0 0.0) ) @@ -1235,17 +1174,9 @@ (when (!= s5-0 s4-0) (if (= s4-0 'nothing) (ja-channel-push! 1 arg1) - (ja-channel-push! 1 37) + (ja-channel-push! 1 (seconds 0.125)) ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 130))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 130)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) f30-0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 130)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 130) :num! (seek!) :frame-num f30-0) (set! s4-0 s5-0) ) ) @@ -1254,35 +1185,17 @@ (if (= (-> self next-state name) 'target-racing-falling) (set! f0-4 (* 0.5 f0-4)) ) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) f0-4) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f0-4)) ) (set! f30-0 (ja-aframe-num 0)) (ja-blend-eval) ) ) (ja-channel-set! 2) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 131)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) - (let ((gp-2 (-> self skel root-channel 1))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 132)) - num-func-identity - ) - (set! (-> gp-2 frame-num) (ja-aframe 44.0 0)) - ) + (ja :group! (-> self draw art-group data 131) :num! min) + (ja :chan 1 :group! (-> self draw art-group data 132) :num! (identity (ja-aframe 44.0 0))) (let ((f30-1 0.0)) - (while #t + (loop (suspend) (let ((gp-3 (-> self skel root-channel 1))) (set! f30-1 (seek f30-1 1.0 (-> *display* seconds-per-frame))) @@ -1300,72 +1213,36 @@ (if (>= (-> self racer slide-mode) 0) (goto cfg-23) ) - (ja-channel-push! 1 21) + (ja-channel-push! 1 (seconds 0.07)) (cond ((= arg0 'high-jump) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 135))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 135)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 135)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 135) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (>= (-> self racer slide-mode) 0) (goto cfg-23) ) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((= arg0 'jump) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 129))) - (set! (-> gp-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 129)) data 0 length) -1)) - ) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) (ja-aframe 44.0 0)) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 129)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 129) :num! (seek!) :frame-num (ja-aframe 44.0 0)) (until (ja-done? 0) (if (>= (-> self racer slide-mode) 0) (goto cfg-23) ) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 132))) - (set! (-> gp-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 132)) data 0 length) -1)) - ) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) (ja-aframe 44.0 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 132)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 132) :num! (seek!) :frame-num (ja-aframe 44.0 0)) (until (ja-done? 0) (if (>= (-> self racer slide-mode) 0) (goto cfg-23) ) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -1496,10 +1373,8 @@ ) (cond ((racer-on-ground?) - (set! (-> self control unknown-float81) - (seek (-> self control unknown-float81) 1.0 (* 8.0 (-> *display* seconds-per-frame))) - ) - (set! (-> self racer mult-rotx) (seek (-> self racer mult-rotx) 0.0 (* 2.0 (-> *display* seconds-per-frame)))) + (seek! (-> self control unknown-float81) 1.0 (* 8.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer mult-rotx) 0.0 (* 2.0 (-> *display* seconds-per-frame))) (set! (-> self racer targ-rotx) 0.0) (set! (-> self racer hill-rotx) 0.0) (set! (-> self racer speed-rotx) 0.25) @@ -1512,9 +1387,9 @@ (when (!= (the int (/ f0-52 (* 0.5 (-> self racer bob-period)))) (the int (/ (-> self racer bob-timer) (* 0.5 (-> self racer bob-period)))) ) - (set! (-> self racer bob-mult-trans) (seek (-> self racer bob-mult-trans) 1.0 0.75)) + (seek! (-> self racer bob-mult-trans) 1.0 0.75) (if (< 1.5 (-> self racer bob-meta-meta-timer)) - (set! (-> self racer bob-meta-meta-timer) (seek (-> self racer bob-meta-meta-timer) 1.0 0.5)) + (seek! (-> self racer bob-meta-meta-timer) 1.0 0.5) ) (when (>= (- (-> *display* base-frame-counter) (-> self racer bob-meta-time)) (seconds 2.2)) (set! (-> self racer bob-meta-time) (-> *display* base-frame-counter)) @@ -1523,9 +1398,7 @@ ) ) (let ((f0-63 (lerp-scale -1.0 -0.33 (-> self control unknown-float01) 0.0 (-> self racer transv-max)))) - (set! (-> self racer bob-mult-rot) - (seek (-> self racer bob-mult-rot) f0-63 (* 8.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer bob-mult-rot) f0-63 (* 8.0 (-> *display* seconds-per-frame))) ) (if (< 0.0 f30-1) (set! f30-1 0.0) @@ -1533,12 +1406,8 @@ (set! (-> self racer stick-lock) #f) ) (else - (set! (-> self control unknown-float81) - (seek (-> self control unknown-float81) 0.0 (* 2.0 (-> *display* seconds-per-frame))) - ) - (set! (-> self racer mult-rotx) - (seek (-> self racer mult-rotx) 1.0 (* 16.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self control unknown-float81) 0.0 (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer mult-rotx) 1.0 (* 16.0 (-> *display* seconds-per-frame))) (let ((f0-77 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (the-as vector (-> self control trans-old))) (let* ((v1-128 (-> self racer bounce)) @@ -1573,9 +1442,7 @@ ) (set! (-> self racer speed-rotx) 0.5) (when (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.1)) - (set! (-> self racer hill-rotx) - (seek (-> self racer hill-rotx) 0.0 (* 65536.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer hill-rotx) 0.0 (* 65536.0 (-> *display* seconds-per-frame))) (set! (-> self racer speed-rotx) 0.6) ) ) @@ -1583,9 +1450,7 @@ (set! (-> self racer speed-rotx) 0.25) ) ) - (set! (-> self racer mult-rotx) - (seek (-> self racer mult-rotx) 1.0 (* 64.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer mult-rotx) 1.0 (* 64.0 (-> *display* seconds-per-frame))) ) (else (set! (-> self racer speed-rotx) 0.025) @@ -1597,12 +1462,8 @@ ) (set! (-> self racer bob-timer) (- f0-91 (* (the float (the int (/ f0-91 f1-44))) f1-44))) ) - (set! (-> self racer bob-mult-rot) - (seek (-> self racer bob-mult-rot) 0.0 (* 16.0 (-> *display* seconds-per-frame))) - ) - (set! (-> self racer bob-mult-trans) - (seek (-> self racer bob-mult-trans) 0.0 (* 16.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self racer bob-mult-rot) 0.0 (* 16.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer bob-mult-trans) 0.0 (* 16.0 (-> *display* seconds-per-frame))) (set! f30-1 (lerp-scale f30-1 @@ -1613,7 +1474,7 @@ ) ) (cond - ((and (logtest? (-> self control status) 8) + ((and (logtest? (-> self control status) (cshape-moving-flags twall)) (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.1)) (or (-> self racer stick-lock) (< (target-move-dist (-> *TARGET-bank* stuck-time)) 4096.0)) (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) diff --git a/test/decompiler/reference/levels/robocave/cave-trap_REF.gc b/test/decompiler/reference/levels/robocave/cave-trap_REF.gc index 6560ed7c7d..c74c70a9f8 100644 --- a/test/decompiler/reference/levels/robocave/cave-trap_REF.gc +++ b/test/decompiler/reference/levels/robocave/cave-trap_REF.gc @@ -61,8 +61,7 @@ ;; failed to figure out what this is: (defstate spider-vent-idle (spider-vent) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('can-spawn?) @@ -76,8 +75,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -151,68 +149,61 @@ ;; definition for method 20 of type cave-trap ;; Used lq/sq (defmethod TODO-RENAME-20 cave-trap ((obj cave-trap)) - (with-pp - (set! (-> obj last-spawn-time) (-> *display* base-frame-counter)) - (set! (-> obj spawn-delay) (rand-vu-int-range (seconds 0.1) (seconds 0.5))) - (let ((s5-0 (new 'stack-no-clear 'spawn-baby-spider-work))) - (let ((s4-0 (new 'stack-no-clear 'vector))) - (dotimes (v1-2 4) - (set! (-> s5-0 best v1-2 index) -1) - ) - (set! (-> s4-0 quad) (-> (matrix-local->world #f #f) vector 2 quad)) - (set! (-> s4-0 y) 0.0) - (vector-normalize! s4-0 102400.0) - (vector+! s4-0 s4-0 (camera-pos)) - (set! (-> s4-0 y) (-> (target-pos 0) y)) - (dotimes (s3-2 (-> obj alt-actors length)) - (let* ((v1-10 (-> obj alt-actors s3-2)) - (s1-0 (if v1-10 - (-> v1-10 extra process) - ) - ) - (s2-2 (if (and (nonzero? s1-0) (type-type? (-> s1-0 type) process-drawable)) - s1-0 - ) - ) - ) - (when s2-2 - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) pp) - (set! (-> a1-6 num-params) 0) - (set! (-> a1-6 message) 'can-spawn?) - (when (send-event-function s2-2 a1-6) - (let ((f30-0 (vector-vector-distance s4-0 (-> (the-as process-drawable s2-2) root trans))) - (a0-12 (new 'stack-no-clear 'sphere)) - ) - (let ((v1-16 (-> s5-0 best 3))) - (when (or (< (-> v1-16 index) 0) (< f30-0 (-> v1-16 dist))) - (set! (-> v1-16 index) s3-2) - (set! (-> v1-16 dist) f30-0) + (set! (-> obj last-spawn-time) (-> *display* base-frame-counter)) + (set! (-> obj spawn-delay) (rand-vu-int-range (seconds 0.1) (seconds 0.5))) + (let ((s5-0 (new 'stack-no-clear 'spawn-baby-spider-work))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (dotimes (v1-2 4) + (set! (-> s5-0 best v1-2 index) -1) + ) + (set! (-> s4-0 quad) (-> (matrix-local->world #f #f) vector 2 quad)) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 102400.0) + (vector+! s4-0 s4-0 (camera-pos)) + (set! (-> s4-0 y) (-> (target-pos 0) y)) + (dotimes (s3-2 (-> obj alt-actors length)) + (let* ((v1-10 (-> obj alt-actors s3-2)) + (s1-0 (if v1-10 + (-> v1-10 extra process) + ) + ) + (s2-2 (if (and (nonzero? s1-0) (type-type? (-> s1-0 type) process-drawable)) + s1-0 + ) + ) + ) + (when s2-2 + (when (send-event s2-2 'can-spawn?) + (let ((f30-0 (vector-vector-distance s4-0 (-> (the-as process-drawable s2-2) root trans))) + (a0-12 (new 'stack-no-clear 'sphere)) + ) + (let ((v1-16 (-> s5-0 best 3))) + (when (or (< (-> v1-16 index) 0) (< f30-0 (-> v1-16 dist))) + (set! (-> v1-16 index) s3-2) + (set! (-> v1-16 dist) f30-0) + ) + ) + (set! (-> a0-12 quad) (-> (the-as process-drawable s2-2) root trans quad)) + (set! (-> a0-12 w) 4096.0) + (when (sphere-in-view-frustum? a0-12) + (let ((v1-18 (-> s5-0 best 2))) + (when (or (< (-> v1-18 index) 0) (< f30-0 (-> v1-18 dist))) + (set! (-> v1-18 index) s3-2) + (set! (-> v1-18 dist) f30-0) + ) + ) + (when (>= 40960.0 f30-0) + (let ((v1-19 (-> s5-0 best 1))) + (when (or (< (-> v1-19 index) 0) (< f30-0 (-> v1-19 dist))) + (set! (-> v1-19 index) s3-2) + (set! (-> v1-19 dist) f30-0) ) ) - (set! (-> a0-12 quad) (-> (the-as process-drawable s2-2) root trans quad)) - (set! (-> a0-12 w) 4096.0) - (when (sphere-in-view-frustum? a0-12) - (let ((v1-18 (-> s5-0 best 2))) - (when (or (< (-> v1-18 index) 0) (< f30-0 (-> v1-18 dist))) - (set! (-> v1-18 index) s3-2) - (set! (-> v1-18 dist) f30-0) - ) - ) - (when (>= 40960.0 f30-0) - (let ((v1-19 (-> s5-0 best 1))) - (when (or (< (-> v1-19 index) 0) (< f30-0 (-> v1-19 dist))) - (set! (-> v1-19 index) s3-2) - (set! (-> v1-19 dist) f30-0) - ) - ) - (when (= (-> s2-2 type) spider-egg) - (let ((v1-21 (-> s5-0 best))) - (when (or (< (-> v1-21 0 index) 0) (< f30-0 (-> v1-21 0 dist))) - (set! (-> v1-21 0 index) s3-2) - (set! (-> v1-21 0 dist) f30-0) - ) - ) + (when (= (-> s2-2 type) spider-egg) + (let ((v1-21 (-> s5-0 best))) + (when (or (< (-> v1-21 0 index) 0) (< f30-0 (-> v1-21 0 dist))) + (set! (-> v1-21 0 index) s3-2) + (set! (-> v1-21 0 dist) f30-0) ) ) ) @@ -223,63 +214,45 @@ ) ) ) - (dotimes (s4-1 4) - (let ((v1-29 (-> s5-0 best s4-1 index))) - (when (>= v1-29 0) - (let* ((v1-32 (-> obj alt-actors v1-29)) - (s2-3 (if v1-32 - (-> v1-32 extra process) - ) - ) - (s3-3 (if (and (nonzero? s2-3) (type-type? (-> s2-3 type) process-drawable)) - s2-3 - ) - ) - (s2-4 (new 'stack-no-clear 'vector)) - (s1-1 (new 'stack-no-clear 'baby-spider-spawn-params)) - ) - (vector-! s2-4 (target-pos 0) (-> (the-as process-drawable s3-3) root trans)) - (vector-normalize! s2-4 1.0) - (init! s1-1 (= (-> s3-3 type) spider-egg) #t #t #t 7 1 'untrigger) - (let* ((s0-2 (get-process *default-dead-pool* baby-spider #x4000)) - (v1-40 (when s0-2 - (let ((t9-14 (method-of-type baby-spider activate))) - (t9-14 (the-as baby-spider s0-2) obj 'baby-spider (the-as pointer #x70004000)) - ) - (run-now-in-process - s0-2 - baby-spider-init-by-other - obj - (-> (the-as process-drawable s3-3) root trans) - s2-4 - s1-1 - ) - (-> s0-2 ppointer) - ) - ) - ) - (when v1-40 - (set! (-> (the-as baby-spider (-> v1-40 0)) die-if-not-visible?) #t) - (+! (-> obj spider-count) 1) - (send-event s3-3 'notify-spawned) - (return #f) - ) + ) + (dotimes (s4-1 4) + (let ((v1-29 (-> s5-0 best s4-1 index))) + (when (>= v1-29 0) + (let* ((v1-32 (-> obj alt-actors v1-29)) + (s2-3 (if v1-32 + (-> v1-32 extra process) + ) + ) + (s3-3 (if (and (nonzero? s2-3) (type-type? (-> s2-3 type) process-drawable)) + s2-3 + ) + ) + (s2-4 (new 'stack-no-clear 'vector)) + (s1-1 (new 'stack-no-clear 'baby-spider-spawn-params)) + ) + (vector-! s2-4 (target-pos 0) (-> (the-as process-drawable s3-3) root trans)) + (vector-normalize! s2-4 1.0) + (init! s1-1 (= (-> s3-3 type) spider-egg) #t #t #t 7 1 'untrigger) + (let ((v1-40 (process-spawn baby-spider obj (-> (the-as process-drawable s3-3) root trans) s2-4 s1-1 :to obj))) + (when v1-40 + (set! (-> (the-as baby-spider (-> v1-40 0)) die-if-not-visible?) #t) + (+! (-> obj spider-count) 1) + (send-event s3-3 'notify-spawned) + (return #f) ) ) ) ) ) ) - #f ) + #f ) ;; failed to figure out what this is: (defstate cave-trap-idle (cave-trap) - :event - cave-trap-default-event-handler - :trans - (behavior () + :event cave-trap-default-event-handler + :trans (behavior () (when *target* (let* ((gp-0 (target-pos 0)) (f0-0 (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) @@ -287,7 +260,7 @@ ) (when (and (>= 61440.0 f1-1) (>= f1-1 -16384.0)) (when (>= 274432.0 f0-0) - (when (or (>= 188416.0 f0-0) (send-event *target* 'query 'powerup 1)) + (when (or (>= 188416.0 f0-0) (send-event *target* 'query 'powerup (pickup-type eco-yellow))) (level-hint-spawn (game-text-id cave-trap-nest-hint) "sksp0341" @@ -304,8 +277,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -315,15 +287,12 @@ ;; failed to figure out what this is: (defstate cave-trap-active (cave-trap) - :event - cave-trap-default-event-handler - :enter - (behavior () + :event cave-trap-default-event-handler + :enter (behavior () (set! (-> self spawn-delay) (seconds 0.5)) (none) ) - :trans - (behavior () + :trans (behavior () (cond (*target* (let* ((gp-0 (target-pos 0)) @@ -347,8 +316,7 @@ 0 (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -358,10 +326,8 @@ ;; failed to figure out what this is: (defstate cave-trap-give-up (cave-trap) - :event - cave-trap-default-event-handler - :code - (behavior () + :event cave-trap-default-event-handler + :code (behavior () (suspend) (go cave-trap-idle) (none) @@ -398,9 +364,9 @@ ) (process-drawable-from-entity! obj arg0) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav nearest-y-threshold) 409600.0) - (set! (-> obj root-override nav-flags) (logand -2 (-> obj root-override nav-flags))) + (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((s4-1 (entity-actor-count arg0 'alt-actor))) diff --git a/test/decompiler/reference/levels/robocave/robocave-part_REF.gc b/test/decompiler/reference/levels/robocave/robocave-part_REF.gc index 6c7904c3d9..5e766a7c9b 100644 --- a/test/decompiler/reference/levels/robocave/robocave-part_REF.gc +++ b/test/decompiler/reference/levels/robocave/robocave-part_REF.gc @@ -22,8 +22,7 @@ (defpartgroup group-part-robocave-torch :id 506 :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 729 :fade-after (meters 150) :falloff-to (meters 180)) + :parts ((sp-item 729 :fade-after (meters 150) :falloff-to (meters 180)) (sp-item 730 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 731 :fade-after (meters 40) :falloff-to (meters 40) :period 600 :length 90) (sp-item 732 :fade-after (meters 40) :falloff-to (meters 40) :period 369 :length 69) @@ -34,8 +33,7 @@ ;; failed to figure out what this is: (defpart 734 - :init-specs - ((sp-flt spt-num 0.3) + :init-specs ((sp-flt spt-num 0.3) (sp-flt spt-x (meters 0.2)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-int spt-rot-x 5) @@ -54,14 +52,12 @@ ;; failed to figure out what this is: (defpart 735 - :init-specs - ((sp-flt spt-fade-b -6.826667)) + :init-specs ((sp-flt spt-fade-b -6.826667)) ) ;; failed to figure out what this is: (defpart 729 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1068708659 1 0.5) (sp-rnd-flt spt-x (meters -0.35) (meters 0.7) 1.0) (sp-rnd-flt spt-z (meters -0.35) (meters 0.7) 1.0) @@ -84,14 +80,12 @@ ;; failed to figure out what this is: (defpart 736 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) ;; failed to figure out what this is: (defpart 731 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters 1)) @@ -115,8 +109,7 @@ ;; failed to figure out what this is: (defpart 732 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.2) (meters 0.6) 1.0) (sp-flt spt-y (meters 0.5)) @@ -140,8 +133,7 @@ ;; failed to figure out what this is: (defpart 733 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 0.2) 1.0) (sp-flt spt-y (meters 0.6)) @@ -165,8 +157,7 @@ ;; failed to figure out what this is: (defpart 730 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.3)) diff --git a/test/decompiler/reference/levels/robocave/spider-egg_REF.gc b/test/decompiler/reference/levels/robocave/spider-egg_REF.gc index 758604a35c..4bab2056b9 100644 --- a/test/decompiler/reference/levels/robocave/spider-egg_REF.gc +++ b/test/decompiler/reference/levels/robocave/spider-egg_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/spider-egg-ag.gc") + ;; definition of type spider-egg (deftype spider-egg (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -29,27 +31,26 @@ ) ;; failed to figure out what this is: -(defskelgroup *spider-egg-unbroken-sg* spider-egg - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *spider-egg-unbroken-sg* spider-egg spider-egg-unbroken-lod0-jg -1 + ((spider-egg-unbroken-lod0-mg (meters 20)) + (spider-egg-unbroken-lod1-mg (meters 40)) + (spider-egg-unbroken-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 1 0 2) + ) ;; failed to figure out what this is: -(defskelgroup *spider-egg-broken-sg* spider-egg - 5 - -1 - ((6 (meters 20)) (7 (meters 40)) (8 (meters 999999))) - :bounds (static-spherem 0 1 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *spider-egg-broken-sg* spider-egg spider-egg-broken-lod0-jg -1 + ((spider-egg-broken-lod0-mg (meters 20)) + (spider-egg-broken-lod1-mg (meters 40)) + (spider-egg-broken-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 1 0 2) + ) ;; failed to figure out what this is: (defstate spider-egg-idle (spider-egg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 none)) (let ((v1-0 arg2)) (the-as object (cond @@ -77,104 +78,55 @@ ) ) ) - :enter - (behavior ((arg0 symbol)) + :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) (cond (arg0 (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> gp-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> gp-1 param 1) f30-0) - (set! (-> gp-1 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! spider-egg-idle-ja + :num! (seek! max f30-0) + :frame-num (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1))) + ) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) f30-0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (else - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) ) ) - (while #t + (loop (let ((gp-2 (rand-vu-int-range 2 6))) (dotimes (s5-0 gp-2) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) f30-0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! spider-egg-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) f30-0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) - (ja-channel-push! 1 30) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 13)) data 0 length) -1)) - ) - (set! (-> a0-13 param 1) 1.0) - (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! spider-egg-twitch-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) ) (none) ) - :post - (the-as (function none :behavior spider-egg) ja-post) + :post (the-as (function none :behavior spider-egg) ja-post) ) ;; failed to figure out what this is: (defstate spider-egg-hatch (spider-egg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 symbol)) (case arg2 (('can-spawn?) @@ -183,47 +135,27 @@ ) ) ) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 324) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 324) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) - (ja-channel-push! 1 60) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! spider-egg-crack-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (logior! (-> self draw status) (draw-status hidden)) (until (not (-> self child)) @@ -231,14 +163,12 @@ ) (none) ) - :post - (the-as (function none :behavior spider-egg) ja-post) + :post (the-as (function none :behavior spider-egg) ja-post) ) ;; failed to figure out what this is: (defstate spider-egg-die (spider-egg) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 symbol)) (case arg2 (('can-spawn?) @@ -247,8 +177,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (logclear! (-> self mask) (process-mask actor-pause)) (when (-> self notify-actor) @@ -269,43 +198,24 @@ ) ) ) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 325) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 325) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (clear-collide-with-as (-> self root-override)) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-no-eval :group! spider-egg-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (logior! (-> self draw status) (draw-status hidden)) (until (not (-> self child)) @@ -313,8 +223,7 @@ ) (none) ) - :post - (the-as (function none :behavior spider-egg) ja-post) + :post (the-as (function none :behavior spider-egg) ja-post) ) ;; definition for method 11 of type spider-egg diff --git a/test/decompiler/reference/levels/rolling/rolling-lightning-mole_REF.gc b/test/decompiler/reference/levels/rolling/rolling-lightning-mole_REF.gc index afa746e30f..e7bd98e07b 100644 --- a/test/decompiler/reference/levels/rolling/rolling-lightning-mole_REF.gc +++ b/test/decompiler/reference/levels/rolling/rolling-lightning-mole_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/lightning-mole-ag.gc") + ;; definition for function find-adjacent-bounds-one ;; Used lq/sq (defun find-adjacent-bounds-one ((arg0 nav-mesh) (arg1 nav-poly) (arg2 int) (arg3 (array int8)) (arg4 (array int8)) (arg5 vector)) @@ -423,53 +425,32 @@ ;; failed to figure out what this is: (defstate nav-enemy-patrol (fleeing-nav-enemy) :virtual #t - :enter - (-> (method-of-type nav-enemy nav-enemy-patrol) enter) - :exit - (-> (method-of-type nav-enemy nav-enemy-patrol) exit) - :trans - (behavior () + :enter (-> (method-of-type nav-enemy nav-enemy-patrol) enter) + :exit (-> (method-of-type nav-enemy nav-enemy-patrol) exit) + :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-patrol) trans)) (fleeing-nav-enemy-adjust-nav-info) (none) ) - :code - (-> (method-of-type nav-enemy nav-enemy-patrol) code) - :post - (-> (method-of-type nav-enemy nav-enemy-patrol) post) + :code (-> (method-of-type nav-enemy nav-enemy-patrol) code) + :post (-> (method-of-type nav-enemy nav-enemy-patrol) post) ) ;; failed to figure out what this is: (defstate nav-enemy-notice (fleeing-nav-enemy) :virtual #t - :enter - (-> (method-of-type nav-enemy nav-enemy-notice) enter) - :trans - (behavior () + :enter (-> (method-of-type nav-enemy nav-enemy-notice) enter) + :trans (behavior () (fleeing-nav-enemy-adjust-nav-info) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (let ((f30-0 (nav-enemy-rnd-float-range 1.0 1.2))) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - ) - (set! (-> a0-2 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info notice-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (seek-toward-heading-vec! (-> self collide-info) @@ -484,75 +465,59 @@ (go-virtual nav-enemy-chase) ) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) f30-0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (go-virtual nav-enemy-chase) (none) ) - :post - (-> (method-of-type nav-enemy nav-enemy-notice) post) + :post (-> (method-of-type nav-enemy nav-enemy-notice) post) ) ;; failed to figure out what this is: (defstate nav-enemy-chase (fleeing-nav-enemy) :virtual #t - :enter - (behavior () - (logior! (-> self nav flags) (nav-control-flags bit12)) + :enter (behavior () + (logior! (-> self nav flags) (nav-control-flags navcf12)) ((-> (method-of-type nav-enemy nav-enemy-chase) enter)) (none) ) - :exit - (behavior () - (logclear! (-> self nav flags) (nav-control-flags bit12)) + :exit (behavior () + (logclear! (-> self nav flags) (nav-control-flags navcf12)) (none) ) - :trans - (behavior () + :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) (fleeing-nav-enemy-adjust-nav-info) (none) ) - :code - (-> (method-of-type nav-enemy nav-enemy-chase) code) - :post - (-> (method-of-type nav-enemy nav-enemy-chase) post) + :code (-> (method-of-type nav-enemy nav-enemy-chase) code) + :post (-> (method-of-type nav-enemy nav-enemy-chase) post) ) ;; failed to figure out what this is: (defstate nav-enemy-stop-chase (fleeing-nav-enemy) :virtual #t - :enter - (-> (method-of-type nav-enemy nav-enemy-stop-chase) enter) - :trans - (behavior () + :enter (-> (method-of-type nav-enemy nav-enemy-stop-chase) enter) + :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-stop-chase) trans)) (fleeing-nav-enemy-adjust-nav-info) (none) ) - :code - (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) - :post - (-> (method-of-type nav-enemy nav-enemy-stop-chase) post) + :code (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) + :post (-> (method-of-type nav-enemy nav-enemy-stop-chase) post) ) ;; failed to figure out what this is: (defstate fleeing-nav-enemy-debug (fleeing-nav-enemy) - :enter - (-> (method-of-type nav-enemy nav-enemy-chase) enter) - :code - (behavior () + :enter (-> (method-of-type nav-enemy nav-enemy-chase) enter) + :code (behavior () (let ((gp-0 (new-stack-vector0)) (s5-0 (new-stack-vector0)) ) (set! (-> gp-0 x) 1.0) (set! (-> s5-0 x) 1.0) - (while #t + (loop (when (cpad-pressed? 1 r3) (suspend) (go fleeing-nav-enemy-debug) @@ -587,8 +552,7 @@ ) (none) ) - :post - (the-as (function none :behavior fleeing-nav-enemy) nav-enemy-travel-post) + :post (the-as (function none :behavior fleeing-nav-enemy) nav-enemy-travel-post) ) ;; definition for symbol *lightning-mole-hole*, type vector @@ -625,14 +589,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *lightning-mole-sg* lightning-mole - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *lightning-mole-sg* lightning-mole lightning-mole-lod0-jg lightning-mole-idle-ja + ((lightning-mole-lod0-mg (meters 20)) + (lightning-mole-lod1-mg (meters 40)) + (lightning-mole-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 8) + :shadow lightning-mole-shadow-mg + ) ;; definition for function lightning-mole-task-complete? (defbehavior lightning-mole-task-complete? lightning-mole () @@ -644,31 +608,26 @@ (cond (sv-16 (close-specific-task! (-> self entity extra perm task) (task-status need-reminder)) - (let ((gp-0 (get-process *default-dead-pool* process #x4000))) - (when gp-0 - (let ((t9-4 (method-of-type process activate))) - (t9-4 gp-0 self 'process (the-as pointer #x70004000)) + (process-spawn-function + process + (lambda :behavior lightning-mole + () + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current movie) + (-> *setting-control* current hint) + ) + (suspend) ) - (run-next-time-in-process gp-0 (lambda :behavior lightning-mole - () - (while (or (-> *setting-control* current ambient) - (-> *setting-control* current movie) - (-> *setting-control* current hint) - ) - (suspend) - ) - (level-hint-spawn - (game-text-id rolling-lightning-moles-completion) - "sksp0112" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (none) - ) - ) - (-> gp-0 ppointer) + (level-hint-spawn + (game-text-id rolling-lightning-moles-completion) + "sksp0112" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + (none) ) + :to self ) (format #t "lightning-mole task is complete~%") ) @@ -691,21 +650,12 @@ ;; definition for function lightning-mole-run-code (defbehavior lightning-mole-run-code lightning-mole () - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - (ja-channel-push! 1 60) - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) + (when (!= (ja-group) (-> self draw art-group data 7)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 7)) ) - (while #t - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (-> self speed-adjust)) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-loop!) - ) + (loop + (ja :num! (loop! (-> self speed-adjust))) (suspend) ) (none) @@ -713,8 +663,7 @@ ;; failed to figure out what this is: (defstate lightning-mole-debug-blend (lightning-mole) - :trans - (behavior () + :trans (behavior () (let ((gp-0 (new-stack-vector0))) (let ((a1-0 (new-stack-vector0))) (clmf-input gp-0 a1-0 1) @@ -724,24 +673,20 @@ (set! (-> self speed-adjust) 1.0) (none) ) - :code - lightning-mole-run-code - :post - (the-as (function none :behavior lightning-mole) ja-post) + :code lightning-mole-run-code + :post (the-as (function none :behavior lightning-mole) ja-post) ) ;; failed to figure out what this is: (defstate lightning-mole-debug-run (lightning-mole) - :enter - (behavior () + :enter (behavior () (set! (-> self speed-adjust) 1.0) (set-vector! (-> self debug-vector) 0.0 0.0 1.0 1.0) (set! (-> self saved-travel quad) (-> self debug-vector quad)) ((-> (method-of-type nav-enemy nav-enemy-chase) enter)) (none) ) - :trans - (behavior () + :trans (behavior () (when (cpad-pressed? 1 r3) (logclear! (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons r3)) (logclear! (-> *cpad-list* cpads 1 button0-rel 0) (pad-buttons r3)) @@ -749,10 +694,8 @@ ) (none) ) - :code - lightning-mole-run-code - :post - (behavior () + :code lightning-mole-run-code + :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (new-stack-vector0)) (a1-0 (new-stack-vector0)) @@ -795,8 +738,7 @@ ;; failed to figure out what this is: (defstate lightning-mole-gone (lightning-mole) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (ja-channel-set! 0) (ja-post) @@ -810,27 +752,22 @@ ;; failed to figure out what this is: (defstate lightning-mole-hiding (lightning-mole) - :enter - (behavior () + :enter (behavior () (ja-channel-set! 0) (clear-collide-with-as (-> self collide-info)) (none) ) - :trans - (behavior () + :trans (behavior () (when (task-closed? (-> self entity extra perm task) (task-status need-introduction)) (ja-channel-set! 1) - (let ((v1-4 (-> self skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) + (ja :group! (-> self draw art-group data 5)) (restore-collide-with-as (-> self collide-info)) (go-virtual nav-enemy-idle) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) @@ -839,8 +776,7 @@ ;; failed to figure out what this is: (defstate lightning-mole-dive (lightning-mole) - :trans - (behavior () + :trans (behavior () (when (< (vector-vector-xz-distance *lightning-mole-hole* (-> self collide-info trans)) 61440.0) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) @@ -860,8 +796,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -871,16 +806,8 @@ (logior! (-> *target* mask) (process-mask sleep)) ) (ambient-hint-spawn "gamcam20" (the-as vector #f) *entity-pool* 'camera) - (ja-channel-push! 1 60) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) f30-0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 12) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> *camera-other-fov* data) 11650.845) @@ -892,11 +819,7 @@ (set! (-> *camera-other-root* quad) (-> *lightning-mole-hole* quad)) (set! *camera-look-through-other* 2) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) f30-0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (lightning-mole-task-complete?) @@ -906,19 +829,16 @@ (go lightning-mole-gone) (none) ) - :post - lightning-mole-hole-post + :post lightning-mole-hole-post ) ;; failed to figure out what this is: (defstate lightning-mole-head-for-hole (lightning-mole) - :enter - (behavior () + :enter (behavior () (clear-collide-with-as (-> self collide-info)) (none) ) - :trans - (behavior () + :trans (behavior () (when (< (vector-vector-xz-distance *lightning-mole-hole* (-> self collide-info trans)) 61440.0) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) @@ -941,78 +861,55 @@ ) (none) ) - :code - (-> (method-of-type fleeing-nav-enemy nav-enemy-chase) code) - :post - lightning-mole-hole-post + :code (-> (method-of-type fleeing-nav-enemy nav-enemy-chase) code) + :post lightning-mole-hole-post ) ;; failed to figure out what this is: (defstate lightning-mole-yelp (lightning-mole) - :enter - (behavior () + :enter (behavior () (clear-collide-with-as (-> self collide-info)) ((-> (method-of-type fleeing-nav-enemy nav-enemy-chase) enter)) (none) ) - :exit - (behavior () + :exit (behavior () (restore-collide-with-as (-> self collide-info)) (none) ) - :trans - (-> (method-of-type fleeing-nav-enemy nav-enemy-chase) trans) - :code - (behavior () - (ja-channel-push! 1 60) + :trans (-> (method-of-type fleeing-nav-enemy nav-enemy-chase) trans) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (go-virtual nav-enemy-chase) (none) ) - :post - (the-as (function none :behavior lightning-mole) nav-enemy-simple-post) + :post (the-as (function none :behavior lightning-mole) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate nav-enemy-stop-chase (lightning-mole) :virtual #t - :code - lightning-mole-run-code - :post - (the-as (function none :behavior lightning-mole) fleeing-nav-enemy-chase-post) + :code lightning-mole-run-code + :post (the-as (function none :behavior lightning-mole) fleeing-nav-enemy-chase-post) ) ;; failed to figure out what this is: (defstate nav-enemy-chase (lightning-mole) :virtual #t - :enter - (behavior () + :enter (behavior () (set! (-> self speed-adjust) 1.0) (set! (-> self run-blend-interp) 0.0) (vector-! (-> self saved-travel) (-> self collide-info trans) (target-pos 0)) ((-> (method-of-type fleeing-nav-enemy nav-enemy-chase) enter)) (none) ) - :trans - (behavior () + :trans (behavior () (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) @@ -1068,10 +965,8 @@ ((-> (method-of-type fleeing-nav-enemy nav-enemy-chase) trans)) (none) ) - :code - lightning-mole-run-code - :post - (the-as (function none :behavior lightning-mole) fleeing-nav-enemy-chase-post) + :code lightning-mole-run-code + :post (the-as (function none :behavior lightning-mole) fleeing-nav-enemy-chase-post) ) ;; definition for method 43 of type lightning-mole @@ -1143,7 +1038,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -1173,7 +1068,7 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *lightning-mole-sg* '()) (TODO-RENAME-45 obj *lightning-mole-nav-enemy-info*) - (logclear! (-> obj nav flags) (nav-control-flags bit5 bit6 bit7)) + (logclear! (-> obj nav flags) (nav-control-flags navcf5 navcf6 navcf7)) (set! (-> obj draw origin-joint-index) (the-as uint 3)) (set! (-> obj reaction-time) (seconds 0.05)) (set! (-> obj last-reflection-time) 0) @@ -1217,14 +1112,12 @@ :id 456 :duration 5 :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 1768) (sp-item 1769 :period 120 :length 30) (sp-item 1770 :period 120 :length 60)) + :parts ((sp-item 1768) (sp-item 1769 :period 120 :length 30) (sp-item 1770 :period 120 :length 60)) ) ;; failed to figure out what this is: (defpart 1768 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters -2)) @@ -1250,8 +1143,7 @@ ;; failed to figure out what this is: (defpart 1769 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters -2)) @@ -1276,8 +1168,7 @@ ;; failed to figure out what this is: (defpart 1770 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0)) @@ -1304,8 +1195,7 @@ ;; failed to figure out what this is: (defpart 1771 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.05) 1.0) @@ -1330,8 +1220,7 @@ ;; failed to figure out what this is: (defpart 1772 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.05) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1375,13 +1264,9 @@ (when (< (-> arg2 y) (-> arg1 user-float)) (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (if (< (+ -1.0 (the-as float v1-2)) 0.05) - (sound-play-by-name (static-sound-name "land-grass") (new-sound-id) 1024 0 0 1 #t) - ) - ) + (if (< (rand-float-gen) 0.05) + (sound-play "land-grass") + ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var *sp-particle-system-2d* @@ -1421,8 +1306,7 @@ ;; failed to figure out what this is: (defstate peeper-wait (peeper) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'hide) (let ((v0-0 (-> *display* base-frame-counter))) @@ -1433,16 +1317,14 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (not (and *target* (>= 81920.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans))))) ) @@ -1450,30 +1332,23 @@ ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior peeper) ja-post) + :post (the-as (function none :behavior peeper) ja-post) ) ;; failed to figure out what this is: (defstate peeper-hide (peeper) - :code - (behavior () + :code (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 2.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek! max 2.0)) (while (not (ja-done? 0)) (suspend) (ja-eval) @@ -1482,29 +1357,25 @@ (go peeper-wait) (none) ) - :post - (the-as (function none :behavior peeper) ja-post) + :post (the-as (function none :behavior peeper) ja-post) ) ;; failed to figure out what this is: (defstate peeper-down (peeper) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hide) (go peeper-wait) ) ) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 61440.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go peeper-wait) ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) @@ -1535,61 +1406,43 @@ (go peeper-up) (none) ) - :post - (the-as (function none :behavior peeper) ja-post) + :post (the-as (function none :behavior peeper) ja-post) ) ;; failed to figure out what this is: (defstate peeper-up (peeper) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hide) (go peeper-hide) ) ) ) - :enter - (behavior () + :enter (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 61440.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go peeper-hide) ) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 13)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 13) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go peeper-down) ) (none) ) - :post - (the-as (function none :behavior peeper) ja-post) + :post (the-as (function none :behavior peeper) ja-post) ) ;; definition for method 11 of type peeper diff --git a/test/decompiler/reference/levels/rolling/rolling-obs_REF.gc b/test/decompiler/reference/levels/rolling/rolling-obs_REF.gc index 8640f0a8cf..ae2e0532b1 100644 --- a/test/decompiler/reference/levels/rolling/rolling-obs_REF.gc +++ b/test/decompiler/reference/levels/rolling/rolling-obs_REF.gc @@ -1,6 +1,12 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/rollingcam-ag.gc") +(import "goal_src/import/pusher-ag.gc") +(import "goal_src/import/happy-plant-ag.gc") +(import "goal_src/import/dark-plant-ag.gc") +(import "goal_src/import/rolling-start-ag.gc") + ;; definition of type rolling-part (deftype rolling-part (part-spawner) ((root-override basic :offset 112) @@ -60,13 +66,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *rollingcam-sg* rollingcam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *rollingcam-sg* rollingcam rollingcam-lod0-jg rollingcam-anim-ja + ((rollingcam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) ;; definition of type pusher-base (deftype pusher-base (process-drawable) @@ -135,13 +138,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *pusher-sg* pusher - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *pusher-sg* pusher pusher-lod0-jg pusher-idle-ja + ((pusher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) ;; definition for function pusher-base-init (defbehavior pusher-base-init pusher-base () @@ -178,11 +178,9 @@ ;; failed to figure out what this is: (defstate pusher-idle (pusher) - :trans - (the-as (function none :behavior pusher) rider-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior pusher) rider-trans) + :code (behavior () + (loop (let ((f0-0 -1.0)) (when (and *target* *camera*) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -190,29 +188,16 @@ (set! f0-0 (ray-capsule-intersect (-> self cyl) (camera-pos) gp-0)) ) ) - (cond - ((< f0-0 0.0) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (get-current-value-with-mirror (-> self sync) (-> self max-frame))) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (else - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) 0.0) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (if (< f0-0 0.0) + (ja :num! (seek! (get-current-value-with-mirror (-> self sync) (-> self max-frame)))) + (ja :num! (seek! 0.0)) ) - ) ) (suspend) ) (none) ) - :post - (the-as (function none :behavior pusher) rider-post) + :post (the-as (function none :behavior pusher) rider-post) ) ;; definition for method 11 of type pusher @@ -235,33 +220,18 @@ ;; failed to figure out what this is: (defstate gorge-pusher-idle (gorge-pusher) - :trans - (the-as (function none :behavior gorge-pusher) rider-trans) - :code - (behavior () - (while #t - (cond - ((task-closed? (game-task rolling-race) (task-status need-introduction)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (-> self min-frame)) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (else - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (-> self max-frame)) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + :trans (the-as (function none :behavior gorge-pusher) rider-trans) + :code (behavior () + (loop + (if (task-closed? (game-task rolling-race) (task-status need-introduction)) + (ja :num! (seek! (-> self min-frame))) + (ja :num! (seek! (-> self max-frame))) ) - ) (suspend) ) (none) ) - :post - (the-as (function none :behavior gorge-pusher) rider-post) + :post (the-as (function none :behavior gorge-pusher) rider-post) ) ;; definition for method 11 of type gorge-pusher @@ -321,19 +291,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *dark-plant-sg* dark-plant - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 2.25 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *dark-plant-sg* dark-plant dark-plant-lod0-jg dark-plant-idle-ja + ((dark-plant-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2.25 0 6) + ) ;; definition for function dark-plant-check-target ;; INFO: Return type mismatch object vs symbol. (defun dark-plant-check-target ((arg0 dark-plant)) (the-as symbol (and *target* (and (< (vector-vector-distance (-> arg0 root trans) (target-pos 0)) 16384.0) - (send-event *target* 'query 'powerup 4) + (send-event *target* 'query 'powerup (pickup-type eco-green)) ) ) ) @@ -350,7 +317,7 @@ ;; definition for function dark-plants-all-done (defun dark-plants-all-done ((arg0 dark-plant)) - (while #t + (loop (if (!= (-> arg0 state) dark-plant-gone) (return #f) ) @@ -393,41 +360,25 @@ ;; failed to figure out what this is: (defstate dark-plant-sprout (dark-plant) - :trans - dark-plant-trans - :code - (behavior () + :trans dark-plant-trans + :code (behavior () (dark-plant-randomize self) (logclear! (-> self draw status) (draw-status hidden)) - (sound-play-by-name (static-sound-name "darkvine-grow") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (sound-play "darkvine-grow") + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go dark-plant-idle) (none) ) - :post - (the-as (function none :behavior dark-plant) ja-post) + :post (the-as (function none :behavior dark-plant) ja-post) ) ;; failed to figure out what this is: (defstate dark-plant-gone (dark-plant) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (let* ((f30-0 1500.0) (v1-4 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -435,7 +386,7 @@ (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-5)))) 3000)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (when (and (!= (get-task-status (game-task rolling-plants)) (task-status invalid)) (!= (get-task-status (game-task rolling-plants)) 7) ) @@ -458,54 +409,37 @@ ) (none) ) - :post - (the-as (function none :behavior dark-plant) ja-post) + :post (the-as (function none :behavior dark-plant) ja-post) ) ;; failed to figure out what this is: (defstate dark-plant-death (dark-plant) - :code - (behavior () + :code (behavior () (spawn (-> self part) (-> self root trans)) - (ja-channel-push! 1 60) - (sound-play-by-name (static-sound-name "darkvine-kill") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (sound-play "darkvine-kill") + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go dark-plant-gone) (none) ) - :post - (the-as (function none :behavior dark-plant) ja-post) + :post (the-as (function none :behavior dark-plant) ja-post) ) ;; failed to figure out what this is: (defstate dark-plant-idle (dark-plant) - :trans - dark-plant-trans - :code - (behavior () - (while #t + :trans dark-plant-trans + :code (behavior () + (loop (when (and (logtest? (-> self draw status) (draw-status was-drawn)) *target* (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (if (rand-vu-percent? 0.3) - (sound-play-by-name (static-sound-name "darkvine-move") (new-sound-id) 1024 0 0 1 #t) + (sound-play "darkvine-move") ) (when (task-closed? (game-task rolling-plants) (task-status need-hint)) (level-hint-spawn @@ -515,22 +449,15 @@ *entity-pool* (game-task none) ) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'query) - (set! (-> a1-4 param 0) (the-as uint 'powerup)) - (set! (-> a1-4 param 1) (the-as uint 4)) - (if (not (send-event-function *target* a1-4)) - (level-hint-spawn - (game-text-id rolling-dark-plants-hint) - "sksp0114" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + (if (not (send-event *target* 'query 'powerup (pickup-type eco-green))) + (level-hint-spawn + (game-text-id rolling-dark-plants-hint) + "sksp0114" + (the-as entity #f) + *entity-pool* + (game-task none) ) - ) + ) ) ) (let ((gp-1 (-> self skel root-channel 0))) @@ -538,12 +465,10 @@ (set! (-> gp-1 param 0) (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) ) - (let* ((f30-1 0.9) - (f28-0 0.25) - (v1-32 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-33 (the-as number (logior #x3f800000 v1-32))) - ) - (set! (-> gp-1 param 1) (+ f30-1 (* f28-0 (+ -1.0 (the-as float v1-33))))) + (let ((f30-1 0.9) + (f28-0 0.25) + ) + (set! (-> gp-1 param 1) (+ f30-1 (* f28-0 (rand-float-gen)))) ) (set! (-> gp-1 frame-num) 0.0) (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) @@ -552,12 +477,10 @@ (suspend) (let ((gp-2 (-> self skel root-channel 0))) (set! (-> gp-2 param 0) (the float (+ (-> gp-2 frame-group data 0 length) -1))) - (let* ((f30-2 0.9) - (f28-1 0.25) - (v1-45 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-46 (the-as number (logior #x3f800000 v1-45))) - ) - (set! (-> gp-2 param 1) (+ f30-2 (* f28-1 (+ -1.0 (the-as float v1-46))))) + (let ((f30-2 0.9) + (f28-1 0.25) + ) + (set! (-> gp-2 param 1) (+ f30-2 (* f28-1 (rand-float-gen)))) ) (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) ) @@ -565,42 +488,30 @@ ) (none) ) - :post - (the-as (function none :behavior dark-plant) ja-post) + :post (the-as (function none :behavior dark-plant) ja-post) ) ;; failed to figure out what this is: (defstate dark-plant-startup (dark-plant) - :trans - dark-plant-trans - :code - (behavior () + :trans dark-plant-trans + :code (behavior () (let ((gp-0 (-> self skel root-channel 0))) (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) (set! (-> gp-0 param 0) (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) ) (set! (-> gp-0 param 1) 1.0) - (let* ((v1-12 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-13 (the-as number (logior #x3f800000 v1-12))) - ) - (set! (-> gp-0 frame-num) (* (+ -1.0 (the-as float v1-13)) (the float (ja-num-frames 0)))) - ) + (set! (-> gp-0 frame-num) (* (rand-float-gen) (the float (ja-num-frames 0)))) (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) ) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go dark-plant-idle) (none) ) - :post - (the-as (function none :behavior dark-plant) ja-post) + :post (the-as (function none :behavior dark-plant) ja-post) ) ;; failed to figure out what this is: @@ -609,14 +520,12 @@ :duration 42 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 1764) (sp-item 2356)) + :parts ((sp-item 1764) (sp-item 2356)) ) ;; failed to figure out what this is: (defpart 2356 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 12)) @@ -635,8 +544,7 @@ ;; failed to figure out what this is: (defpart 1764 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 128.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.4) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -711,47 +619,29 @@ ) ;; failed to figure out what this is: -(defskelgroup *happy-plant-sg* happy-plant - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 2.25 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *happy-plant-sg* happy-plant happy-plant-lod0-jg happy-plant-init-ja + ((happy-plant-lod0-mg (meters 20)) (happy-plant-lod1-mg (meters 999999))) + :bounds (static-spherem 0 2.25 0 6) + ) ;; failed to figure out what this is: (defstate happy-plant-opened (happy-plant) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior happy-plant) ja-post) + :post (the-as (function none :behavior happy-plant) ja-post) ) ;; failed to figure out what this is: (defstate happy-plant-opening (happy-plant) - :exit - (behavior () + :exit (behavior () (when *target* (logclear! (-> *target* mask) (process-mask sleep)) (process-entity-status! self (entity-perm-status bit-3) #f) @@ -759,27 +649,17 @@ ) (none) ) - :code - (behavior () + :code (behavior () (close-specific-task! (game-task rolling-plants) (task-status need-reminder)) (process-entity-status! self (entity-perm-status bit-3) #t) (logclear! (-> self mask) (process-mask actor-pause)) (while (and *target* (< (vector-vector-distance (-> self root-override trans) (target-pos 0)) 24576.0)) (suspend) ) - (let* ((gp-1 (get-process *default-dead-pool* manipy #x4000)) - (gp-2 - (ppointer->handle - (when gp-1 - (let ((t9-5 (method-of-type manipy activate))) - (t9-5 (the-as manipy gp-1) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 manipy-init (-> self entity extra trans) (-> self entity) *rollingcam-sg* #f) - (-> gp-1 ppointer) - ) - ) - ) - ) + (let ((gp-2 + (ppointer->handle (manipy-spawn (-> self entity extra trans) (-> self entity) *rollingcam-sg* #f :to self)) + ) + ) (let ((s5-1 (get-process *default-dead-pool* othercam #x4000))) (ppointer->handle (when s5-1 (let ((t9-8 (method-of-type othercam activate))) @@ -790,17 +670,10 @@ ) ) ) - (let* ((s5-2 (get-process *default-dead-pool* fuel-cell #x4000)) - (s5-3 (ppointer->handle (when s5-2 - (let ((t9-11 (method-of-type fuel-cell activate))) - (t9-11 (the-as fuel-cell s5-2) self 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 fuel-cell-init-as-clone (process->handle self) 55) - (-> s5-2 ppointer) - ) - ) - ) - ) + (let ((s5-3 + (ppointer->handle (process-spawn fuel-cell :init fuel-cell-init-as-clone (process->handle self) 55 :to self)) + ) + ) (if *target* (logior! (-> *target* mask) (process-mask sleep)) ) @@ -810,17 +683,14 @@ :name "happy-plant-open" :index 5 :parts 2 - :command-list - '((0 send-event target draw #f) (10000 send-event target draw #t)) + :command-list '((0 send-event target draw #f) (10000 send-event target draw #t)) ) (the-as art-joint-anim #f) (the-as art-joint-anim (-> self draw art-group data 4)) (the-as (function process-drawable symbol) false-func) ) (ja-channel-set! 1) - (let ((v1-39 (-> self skel root-channel 0))) - (set! (-> v1-39 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) + (ja :group! (-> self draw art-group data 4)) (if (handle->process (the-as int gp-2)) (deactivate (-> gp-2 process 0)) ) @@ -839,14 +709,12 @@ (go happy-plant-opened) (none) ) - :post - (the-as (function none :behavior happy-plant) transform-post) + :post (the-as (function none :behavior happy-plant) transform-post) ) ;; failed to figure out what this is: (defstate happy-plant-init (happy-plant) - :trans - (behavior () + :trans (behavior () (when (-> self alt-actor) (spool-push *art-control* "happy-plant-open" 0 self -99.0) (let* ((gp-0 (-> self alt-actor extra process)) @@ -864,49 +732,18 @@ ) (none) ) - :code - (behavior () + :code (behavior () (clear-collide-with-as (-> self root-override)) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-1 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior happy-plant) ja-post) + :post (the-as (function none :behavior happy-plant) ja-post) ) ;; definition for method 11 of type happy-plant @@ -982,6 +819,7 @@ ) ;; definition for function seconds->race-time +;; INFO: Return type mismatch int vs none. (defun seconds->race-time ((arg0 race-time) (arg1 time-frame)) (let* ((v1-1 (max 0 (min #x2bf1d arg1))) (f0-1 (* 0.0033333334 (the float v1-1))) @@ -993,16 +831,14 @@ (set! (-> arg0 digit 2) (the int f0-3)) (let ((f0-4 (- f0-3 (the float (-> arg0 digit 2))))) (set! (-> arg0 digit 3) (the int (* 10.0 f0-4))) - (let* ((f0-5 (- f0-4 (* 0.1 (the float (-> arg0 digit 3))))) - (v0-0 (the int (* 100.0 f0-5))) - ) - (set! (-> arg0 digit 4) v0-0) - v0-0 + (let ((f0-5 (- f0-4 (* 0.1 (the float (-> arg0 digit 3)))))) + (set! (-> arg0 digit 4) (the int (* 100.0 f0-5))) ) ) ) ) ) + (none) ) ;; definition for function race-time->seconds @@ -1035,45 +871,52 @@ ) ;; definition for function race-time-save -(defun race-time-save ((arg0 race-time) (arg1 int) (arg2 task-control)) - (dotimes (s3-0 5) - (save-reminder arg2 (-> arg0 digit s3-0) (+ arg1 s3-0)) +;; WARN: Type Propagation failed: Failed type prop at op 6 ((set! v1 (l.wu (+ a0 -4)))): Could not get type of load: (set! v1 (l.wu (+ a0 -4))). +;; WARN: Type Propagation failed: Type analysis failed +;; WARN: Function may read a register that is not set: a2 +(defun race-time-save ((a0-0 race-time) (a1-0 task-control)) + (local-vars + (v0-0 none) + (v0-1 symbol) + (v1-0 none) + (v1-1 none) + (a0-1 none) + (a1-1 none) + (a2-0 none) + (a2-1 none) + (s3-0 int) + (t9-0 none) ) - #f + (set! s3-0 0) + (while (<.si s3-0 5) + (set! a0-1 a2-0) + (set! v1-0 (the-as none (l.wu (+ a0-1 -4)))) + (set! t9-0 (the-as none (l.wu (+ v1-0 84)))) + (set! v1-1 (the-as none (+ s3-0 a0-0))) + (set! a1-1 (the-as none (l.b v1-1))) + (set! a2-1 (the-as none (+ a1-0 s3-0))) + (call!) + (set! v1-2 (the-as none v0-0)) + (set! s3-0 (the-as int (+ s3-0 1))) + ) + (set! v0-1 #f) + (ret-value v0-1) ) ;; definition for function race-time-read -;; INFO: Return type mismatch int vs symbol. -(defun race-time-read ((arg0 race-time) (arg1 int) (arg2 task-control) (arg3 time-frame)) - (dotimes (s2-0 5) - (set! (-> arg0 digit s2-0) (get-reminder arg2 (+ arg1 s2-0))) - ) - (let ((a1-3 (new 'stack 'race-time))) - (set! (-> a1-3 digit 4) 1) - (the-as symbol (if (race-time-less-than arg0 a1-3) - (seconds->race-time arg0 arg3) - ) - ) - ) - ) +;; ERROR: function was not converted to expressions. Cannot decompile. ;; failed to figure out what this is: -(defskelgroup *rolling-start-whole-sg* rolling-start - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *rolling-start-whole-sg* rolling-start rolling-start-whole-lod0-jg rolling-start-idle-ja + ((rolling-start-whole-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) ;; failed to figure out what this is: -(defskelgroup *rolling-start-broken-sg* rolling-start - 2 - 4 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *rolling-start-broken-sg* rolling-start rolling-start-broken-lod0-jg rolling-start-idle-ja + ((rolling-start-broken-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) ;; definition of type rolling-start (deftype rolling-start (process-drawable) @@ -1102,68 +945,30 @@ ;; failed to figure out what this is: (defstate rolling-start-break (rolling-start) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('unbreak) (go rolling-start-whole) ) ) ) - :code - (behavior ((arg0 symbol)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior ((arg0 symbol)) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (lods-assign! (-> self draw) (-> self broken-look)) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (if arg0 (deactivate self) @@ -1171,17 +976,15 @@ ) (none) ) - :post - (the-as (function none :behavior rolling-start) ja-post) + :post (the-as (function none :behavior rolling-start) ja-post) ) ;; failed to figure out what this is: (defstate rolling-start-whole (rolling-start) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('break) - (sound-play-by-name (static-sound-name "cool-rolling-st") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cool-rolling-st") (go rolling-start-break #f) ) (('break-and-die) @@ -1189,32 +992,18 @@ ) ) ) - :code - (behavior () + :code (behavior () (lods-assign! (-> self draw) (-> self whole-look)) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior rolling-start) ja-post) + :post (the-as (function none :behavior rolling-start) ja-post) ) ;; definition for function rolling-start-init-by-other @@ -1395,11 +1184,9 @@ ;; failed to figure out what this is: (defstate gorge-abort-idle (gorge-abort) - :trans - (the-as (function none :behavior gorge-abort) gorge-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior gorge-abort) gorge-trans) + :code (behavior () + (loop (suspend) (if (gorge-behind self) (send-event (ppointer->process (-> self parent)) 'aborted) @@ -1422,11 +1209,9 @@ ;; failed to figure out what this is: (defstate gorge-finish-idle (gorge-finish) - :trans - (the-as (function none :behavior gorge-finish) gorge-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior gorge-finish) gorge-trans) + :code (behavior () + (loop (suspend) (if (gorge-in-front self) (send-event (ppointer->process (-> self parent)) 'finished) @@ -1558,7 +1343,13 @@ *entity-pool* (game-task none) ) - (race-time-save (-> self this-time) 1 (-> self tasks)) + (let ((t9-14 race-time-save) + (a0-20 (-> self this-time)) + (a1-13 1) + ) + (-> self tasks) + (t9-14 a0-20 (the-as task-control a1-13)) + ) ) ) (else @@ -1587,49 +1378,32 @@ ;; INFO: Return type mismatch int vs handle. ;; Used lq/sq (defbehavior gorge-start-launch-start-banner gorge-start () - (the-as - handle - (when (task-closed? (game-task rolling-race) (task-status need-introduction)) - (when (not (handle->process (-> self start-banner))) - (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) - (let* ((s5-0 (get-process *default-dead-pool* rolling-start #x4000)) - (v0-1 - (ppointer->handle (when s5-0 - (let ((t9-2 (method-of-type rolling-start activate))) - (t9-2 (the-as rolling-start s5-0) self 'rolling-start (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 rolling-start-init-by-other gp-0 0.0) - (-> s5-0 ppointer) - ) - ) + (the-as handle (when (task-closed? (game-task rolling-race) (task-status need-introduction)) + (when (not (handle->process (-> self start-banner))) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root-override trans quad)) + (let ((v0-1 (ppointer->handle (process-spawn rolling-start gp-0 0.0 :to self)))) + (set! (-> self start-banner) (the-as handle v0-1)) + v0-1 + ) + ) + ) ) - ) - (set! (-> self start-banner) (the-as handle v0-1)) - v0-1 - ) ) - ) - ) - ) ) ;; failed to figure out what this is: (defstate gorge-start-race-finished (gorge-start) - :trans - (behavior () + :trans (behavior () (gorge-trans) (none) ) - :code - (behavior () + :code (behavior () (gorge-start-draw-time #t #t) (suspend) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) - (set! (-> self timer-pos-offset) - (seekl (-> self timer-pos-offset) 100 (the int (* 3.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self timer-pos-offset) 100 (the int (* 3.0 (-> *display* time-adjust-ratio)))) (when (= (-> self timer-pos-offset) 100) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) (send-event (ppointer->process (-> *hud-parts* money)) 'enable) @@ -1647,18 +1421,14 @@ ;; failed to figure out what this is: (defstate gorge-start-race-aborted (gorge-start) - :trans - (behavior () + :trans (behavior () (gorge-trans) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) - (set! (-> self timer-pos-offset) - (seekl (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) (when (= (-> self timer-pos-offset) 100) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) (send-event (ppointer->process (-> *hud-parts* money)) 'enable) @@ -1707,8 +1477,7 @@ ;; failed to figure out what this is: (defstate gorge-start-racing (gorge-start) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('finished) (go gorge-start-race-finished) @@ -1718,112 +1487,65 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (send-event (handle->process (-> self start-banner)) 'break) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'disable) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'hide) (send-event (ppointer->process (-> *hud-parts* money)) 'disable) (send-event (ppointer->process (-> *hud-parts* money)) 'hide) - (race-time-read (-> self record-time) 1 (-> self tasks) (seconds 45)) - (let ((gp-0 (get-process *default-dead-pool* rolling-start #x4000))) - (set! (-> self end-banner) - (ppointer->handle (when gp-0 - (let ((t9-7 (method-of-type rolling-start activate))) - (t9-7 (the-as rolling-start gp-0) self 'rolling-start (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - rolling-start-init-by-other - (new 'static 'vector :x -86016.0 :y 112640.0 :z -6309888.0) - 16384.0 - ) - (-> gp-0 ppointer) - ) - ) + (let ((t9-5 race-time-read) + (a0-8 (-> self record-time)) + (a1-5 1) + (a2-1 (-> self tasks)) + ) + #x34bc + (t9-5 a0-8 (the-as task-control a1-5) (the-as time-frame a2-1)) + ) + (set! (-> self end-banner) + (ppointer->handle + (process-spawn rolling-start (new 'static 'vector :x -86016.0 :y 112640.0 :z -6309888.0) 16384.0 :to self) ) + ) + (process-spawn + gorge-finish + (new 'static 'vector :x -86016.0 :y 114688.0 :z -6303744.0) + (new 'static 'vector :x -1.0) + 57344.0 + :to self ) - (let ((gp-1 (get-process *default-dead-pool* gorge-finish #x4000))) - (when gp-1 - (let ((t9-10 (method-of-type gorge-finish activate))) - (t9-10 (the-as gorge-finish gp-1) self 'gorge-finish (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - gorge-finish-init-by-other - (new 'static 'vector :x -86016.0 :y 114688.0 :z -6303744.0) - (new 'static 'vector :x -1.0) - 57344.0 - ) - (-> gp-1 ppointer) - ) + (process-spawn + gorge-abort + (new 'static 'vector :x -696320.0 :y 122880.0 :z -6828032.0) + (new 'static 'vector :x -0.707 :y 0.707) + 163840.0 + :to self ) - (let ((gp-2 (get-process *default-dead-pool* gorge-abort #x4000))) - (when gp-2 - (let ((t9-13 (method-of-type gorge-abort activate))) - (t9-13 (the-as gorge-abort gp-2) self 'gorge-abort (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - gorge-abort-init-by-other - (new 'static 'vector :x -696320.0 :y 122880.0 :z -6828032.0) - (new 'static 'vector :x -0.707 :y 0.707) - 163840.0 - ) - (-> gp-2 ppointer) - ) + (process-spawn + gorge-abort + (new 'static 'vector :x -847872.0 :y 143360.0 :z -6828032.0) + (new 'static 'vector :x 0.707 :y 0.707) + 163840.0 + :to self ) - (let ((gp-3 (get-process *default-dead-pool* gorge-abort #x4000))) - (when gp-3 - (let ((t9-16 (method-of-type gorge-abort activate))) - (t9-16 (the-as gorge-abort gp-3) self 'gorge-abort (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-3 - gorge-abort-init-by-other - (new 'static 'vector :x -847872.0 :y 143360.0 :z -6828032.0) - (new 'static 'vector :x 0.707 :y 0.707) - 163840.0 - ) - (-> gp-3 ppointer) - ) + (process-spawn + gorge-abort + (new 'static 'vector :x -417792.0 :y 143360.0 :z -6004736.0) + (new 'static 'vector :x -0.5 :y 0.707 :z 0.3) + 266240.0 + :to self ) - (let ((gp-4 (get-process *default-dead-pool* gorge-abort #x4000))) - (when gp-4 - (let ((t9-19 (method-of-type gorge-abort activate))) - (t9-19 (the-as gorge-abort gp-4) self 'gorge-abort (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-4 - gorge-abort-init-by-other - (new 'static 'vector :x -417792.0 :y 143360.0 :z -6004736.0) - (new 'static 'vector :x -0.5 :y 0.707 :z 0.3) - 266240.0 - ) - (-> gp-4 ppointer) - ) - ) - (let ((gp-5 (get-process *default-dead-pool* gorge-abort #x4000))) - (when gp-5 - (let ((t9-22 (method-of-type gorge-abort activate))) - (t9-22 (the-as gorge-abort gp-5) self 'gorge-abort (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-5 - gorge-abort-init-by-other - (new 'static 'vector :x -647168.0 :y 143360.0 :z -6025216.0) - (new 'static 'vector :x 0.5 :y 0.707 :z -0.3) - 163840.0 - ) - (-> gp-5 ppointer) - ) + (process-spawn + gorge-abort + (new 'static 'vector :x -647168.0 :y 143360.0 :z -6025216.0) + (new 'static 'vector :x 0.5 :y 0.707 :z -0.3) + 163840.0 + :to self ) (sleep (-> self ticker) (seconds 6000)) - (set-setting! *setting-control* self 'sound-flava #f 40.0 42) + (set-setting! 'sound-flava #f 40.0 (music-flava rolling-gorge)) (none) ) - :exit - (behavior () + :exit (behavior () (let* ((v1-0 (-> self child)) (gp-0 (-> v1-0 0 brother)) ) @@ -1837,19 +1559,15 @@ ) (send-event (handle->process (-> self end-banner)) 'break-and-die) (send-event (handle->process (-> self start-banner)) 'unbreak) - (clear-pending-settings-from-process *setting-control* self 'sound-flava) + (remove-setting! 'sound-flava) (none) ) - :trans - (the-as (function none :behavior gorge-start) gorge-trans) - :code - (behavior () + :trans (the-as (function none :behavior gorge-start) gorge-trans) + :code (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (while #t + (loop (seconds->race-time (-> self this-time) (- (-> *display* game-frame-counter) (-> self state-time))) - (set! (-> self timer-pos-offset) - (seekl (-> self timer-pos-offset) 0 (the int (* 5.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self timer-pos-offset) 0 (the int (* 5.0 (-> *display* time-adjust-ratio)))) (completed? (-> self ticker)) (gorge-start-draw-time #f #f) (suspend) @@ -1863,15 +1581,11 @@ ;; failed to figure out what this is: (defstate gorge-start-ready (gorge-start) - :trans - (the-as (function none :behavior gorge-start) gorge-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior gorge-start) gorge-trans) + :code (behavior () + (loop (suspend) - (set! (-> self timer-pos-offset) - (seekl (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) (when (= (-> self timer-pos-offset) 100) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) (send-event (ppointer->process (-> *hud-parts* money)) 'enable) @@ -1894,31 +1608,25 @@ ;; failed to figure out what this is: (defstate gorge-start-idle (gorge-start) - :enter - (behavior () + :enter (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) (none) ) - :trans - (behavior () + :trans (behavior () (gorge-start-launch-start-banner) (gorge-trans) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) - (set! (-> self timer-pos-offset) - (seekl (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) - ) + (seekl! (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) (when (= (-> self timer-pos-offset) 100) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) (send-event (ppointer->process (-> *hud-parts* money)) 'enable) @@ -1968,14 +1676,12 @@ ) ;; definition for symbol ripple-for-rolling-water, type object -(define - ripple-for-rolling-water +(define ripple-for-rolling-water (the-as object (new 'static 'ripple-wave-set :count 3 :converted #f :normal-scale 1.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 40.0 :xdiv -1 :zdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75) @@ -1986,7 +1692,7 @@ ) ;; definition for method 22 of type rolling-water -;; INFO: Return type mismatch uint vs none. +;; INFO: Return type mismatch water-flags vs none. (defmethod TODO-RENAME-22 rolling-water ((obj rolling-water)) (let ((t9-0 (method-of-type water-anim TODO-RENAME-22))) (t9-0 obj) @@ -1999,6 +1705,6 @@ (set! (-> v1-2 far-fade-dist) 245760.0) (set! (-> v1-2 waveform) (the-as ripple-wave-set ripple-for-rolling-water)) ) - (set! (-> obj flags) (logand -8388609 (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt23)) (none) ) diff --git a/test/decompiler/reference/levels/rolling/rolling-race-ring_REF.gc b/test/decompiler/reference/levels/rolling/rolling-race-ring_REF.gc index 9cb2649661..94e21c8a71 100644 --- a/test/decompiler/reference/levels/rolling/rolling-race-ring_REF.gc +++ b/test/decompiler/reference/levels/rolling/rolling-race-ring_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/race-ring-ag.gc") + ;; definition of type race-ring (deftype race-ring (process-drawable) ((rot-y float :offset-assert 176) @@ -46,8 +48,7 @@ :id 457 :linger-duration 0 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1773 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 1773 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1774 :fade-after (meters 80)) (sp-item 1775 :flags (is-3d)) (sp-item 1776 :flags (is-3d)) @@ -56,8 +57,7 @@ ;; failed to figure out what this is: (defpart 1773 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 2.0 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -78,8 +78,7 @@ ;; failed to figure out what this is: (defpart 1774 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -100,8 +99,7 @@ ;; failed to figure out what this is: (defpart 1775 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 10)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -120,8 +118,7 @@ ;; failed to figure out what this is: (defpart 1776 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 12)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -143,8 +140,7 @@ :duration 5 :linger-duration 141 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1777 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 1777 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1778 :flags (is-3d)) (sp-item 1779 :flags (is-3d)) ) @@ -152,8 +148,7 @@ ;; failed to figure out what this is: (defpart 1777 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -176,8 +171,7 @@ ;; failed to figure out what this is: (defpart 1780 - :init-specs - ((sp-rnd-int spt-r 1115684864 1 64.0) + :init-specs ((sp-rnd-int spt-r 1115684864 1 64.0) (sp-flt spt-g 0.0) (sp-rnd-int spt-b 1115684864 1 64.0) (sp-rnd-int spt-a 0 63 1.0) @@ -188,8 +182,7 @@ ;; failed to figure out what this is: (defpart 1778 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -211,8 +204,7 @@ ;; failed to figure out what this is: (defpart 1781 - :init-specs - ((sp-rnd-int spt-r 1124073472 1 127.0) + :init-specs ((sp-rnd-int spt-r 1124073472 1 127.0) (sp-flt spt-g 0.0) (sp-rnd-int spt-b 1124073472 1 127.0) (sp-rnd-flt spt-a 32.0 32.0 1.0) @@ -223,8 +215,7 @@ ;; failed to figure out what this is: (defpart 1779 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -246,8 +237,7 @@ ;; failed to figure out what this is: (defpart 1782 - :init-specs - ((sp-rnd-int spt-r 1124073472 1 127.0) + :init-specs ((sp-rnd-int spt-r 1124073472 1 127.0) (sp-flt spt-g 0.0) (sp-rnd-int spt-b 1124073472 1 127.0) (sp-rnd-flt spt-a 32.0 32.0 1.0) @@ -262,14 +252,12 @@ :duration 5 :linger-duration 150 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1783 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1784 :flags (is-3d))) + :parts ((sp-item 1783 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1784 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 1783 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 64.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -292,8 +280,7 @@ ;; failed to figure out what this is: (defpart 1784 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 10)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -335,8 +322,7 @@ :id 460 :linger-duration 0 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1785 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 1785 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1786 :fade-after (meters 80)) (sp-item 1787 :flags (is-3d)) (sp-item 1788 :flags (is-3d)) @@ -345,8 +331,7 @@ ;; failed to figure out what this is: (defpart 1785 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 2.0 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -367,8 +352,7 @@ ;; failed to figure out what this is: (defpart 1786 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -389,8 +373,7 @@ ;; failed to figure out what this is: (defpart 1787 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 10)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -409,8 +392,7 @@ ;; failed to figure out what this is: (defpart 1788 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 12)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -432,8 +414,7 @@ :duration 5 :linger-duration 141 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1789 :fade-after (meters 100) :falloff-to (meters 100)) + :parts ((sp-item 1789 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1790 :flags (is-3d)) (sp-item 1791 :flags (is-3d)) ) @@ -441,8 +422,7 @@ ;; failed to figure out what this is: (defpart 1789 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -465,8 +445,7 @@ ;; failed to figure out what this is: (defpart 1792 - :init-specs - ((sp-flt spt-r 0.0) + :init-specs ((sp-flt spt-r 0.0) (sp-rnd-int spt-g 1115684864 1 64.0) (sp-rnd-int spt-b 1115684864 1 64.0) (sp-rnd-int spt-a 0 63 1.0) @@ -477,8 +456,7 @@ ;; failed to figure out what this is: (defpart 1790 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -500,8 +478,7 @@ ;; failed to figure out what this is: (defpart 1793 - :init-specs - ((sp-flt spt-r 0.0) + :init-specs ((sp-flt spt-r 0.0) (sp-rnd-int spt-g 1124073472 1 127.0) (sp-rnd-int spt-b 1124073472 1 127.0) (sp-rnd-flt spt-a 32.0 32.0 1.0) @@ -512,8 +489,7 @@ ;; failed to figure out what this is: (defpart 1791 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -535,8 +511,7 @@ ;; failed to figure out what this is: (defpart 1794 - :init-specs - ((sp-flt spt-r 0.0) + :init-specs ((sp-flt spt-r 0.0) (sp-rnd-int spt-g 1124073472 1 127.0) (sp-rnd-int spt-b 1124073472 1 127.0) (sp-rnd-flt spt-a 32.0 32.0 1.0) @@ -551,14 +526,12 @@ :duration 5 :linger-duration 150 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1795 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1796 :flags (is-3d))) + :parts ((sp-item 1795 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1796 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 1795 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 64.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -581,8 +554,7 @@ ;; failed to figure out what this is: (defpart 1796 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 10)) (sp-rnd-flt spt-rot-x 0.0 65536.0 1.0) @@ -620,13 +592,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *race-ring-sg* race-ring - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *race-ring-sg* race-ring race-ring-lod0-jg race-ring-race-ring-idle-ja + ((race-ring-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; definition for function first-ring? (defun first-ring? ((arg0 race-ring)) @@ -640,8 +609,7 @@ ;; failed to figure out what this is: (defstate race-ring-active (race-ring) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 symbol)) (let ((v1-0 arg2)) (the-as @@ -650,52 +618,36 @@ (when (and (= (-> arg3 param 0) 'die) (= arg0 (-> self part-track process 0))) (cond ((= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 460) - -1 - race-ring-blue-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 460) + -1 + race-ring-blue-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) (set! v0-0 #t) (set! (-> self keep-part-track-alive) v0-0) ) (else - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 457) - -1 - race-ring-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-1 ppointer) - ) - ) - ) - ) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 457) + -1 + race-ring-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) (set! v0-0 #t) (set! (-> self keep-part-track-alive) v0-0) ) @@ -706,8 +658,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (cond ((first-ring? self) (logior! (-> self mask) (process-mask actor-pause)) @@ -719,115 +670,74 @@ ) ) (set! (-> self keep-part-track-alive) #f) - (cond - ((= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-0 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-0) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 461) - -1 - race-ring-blue-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-0 ppointer) - ) - ) - ) - ) - ) - (else - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-1 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker gp-1) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 458) - -1 - race-ring-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-1 ppointer) - ) - ) - ) - ) + (if (= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 461) + -1 + race-ring-blue-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 458) + -1 + race-ring-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) ) - ) (set! (-> self old-hips quad) (-> (target-pos 26) quad)) (set! (-> self old-hips x) (+ 1.0 (-> self old-hips x))) (set! (-> self state-time) (-> *display* game-frame-counter)) (none) ) - :exit - (behavior () - (sound-play-by-name (static-sound-name "close-racering") (new-sound-id) 1024 0 0 1 #t) + :exit (behavior () + (sound-play "close-racering") (let ((a0-3 (handle->process (-> self part-track)))) (if a0-3 (deactivate a0-3) ) ) - (cond - ((= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 462) - -1 - race-ring-blue-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-1 ppointer) - ) - ) - ) - ) - ) - (else - (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-2 - (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker gp-2) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - part-tracker-init - (-> *part-group-id-table* 459) - -1 - race-ring-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-2 ppointer) - ) - ) - ) - ) + (if (= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 462) + -1 + race-ring-blue-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 459) + -1 + race-ring-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) ) - ) (cond ((first-ring? self) (logclear! (-> self mask) (process-mask actor-pause)) @@ -840,8 +750,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (nonzero? (-> self sound)) (update! (-> self sound)) ) @@ -852,51 +761,35 @@ ) ) ((= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-0 - (let ((t9-2 (method-of-type part-tracker activate))) - (t9-2 (the-as part-tracker gp-0) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 460) - -1 - race-ring-blue-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 460) + -1 + race-ring-blue-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) (set! (-> self keep-part-track-alive) #t) ) (else - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self part-track) - (ppointer->handle (when gp-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker gp-1) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 457) - -1 - race-ring-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root trans) - ) - (-> gp-1 ppointer) - ) - ) - ) - ) + (set! (-> self part-track) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 457) + -1 + race-ring-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root trans) + :to self + ) + ) + ) (set! (-> self keep-part-track-alive) #t) ) ) @@ -912,9 +805,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) (cond ((first-ring? self) @@ -989,29 +881,17 @@ ) ) ((last-ring? self) - (let* ((gp-1 (get-process *default-dead-pool* othercam #x4000)) - (gp-2 (ppointer->handle (when gp-1 - (let ((t9-15 (method-of-type othercam activate))) - (t9-15 (the-as othercam gp-1) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 othercam-init-by-other self 4 #f #t) - (-> gp-1 ppointer) - ) - ) - ) - (s5-1 (get-process *default-dead-pool* fuel-cell #x4000)) - (s5-2 - (ppointer->handle - (when s5-1 - (let ((t9-18 (method-of-type fuel-cell activate))) - (t9-18 (the-as fuel-cell s5-1) self 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 fuel-cell-init-as-clone (process->handle self) (-> self entity extra perm task)) - (-> s5-1 ppointer) - ) - ) - ) - ) + (let ((gp-2 (ppointer->handle (process-spawn othercam self 4 #f #t :to self))) + (s5-2 (ppointer->handle (process-spawn + fuel-cell + :init fuel-cell-init-as-clone + (process->handle self) + (-> self entity extra perm task) + :to self + ) + ) + ) + ) (if *target* (logior! (-> *target* mask) (process-mask sleep)) ) @@ -1077,18 +957,16 @@ ) (none) ) - :post - (the-as (function none :behavior race-ring) ja-post) + :post (the-as (function none :behavior race-ring) ja-post) ) ;; failed to figure out what this is: (defstate race-ring-wait (race-ring) - :code - (behavior () + :code (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (while #t + (loop (suspend) (when (= (get-task-status (the-as game-task (-> self alt-task))) (task-status invalid)) (close-specific-task! (-> self entity extra perm task) (task-status need-hint)) @@ -1102,8 +980,7 @@ ;; failed to figure out what this is: (defstate race-ring-idle (race-ring) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('activate) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1111,12 +988,11 @@ ) ) ) - :code - (behavior () + :code (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (while #t + (loop (suspend) ) (none) @@ -1139,19 +1015,8 @@ (set! (-> obj part-track) (the-as handle #f)) (set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) (logior! (-> obj draw status) (draw-status hidden)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "loop-racering") - :volume #x400 - :fo-max 40 - ) - (-> obj root trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "loop-racering" :fo-max 40) (-> obj root trans)) ) (let ((f0-1 (res-lump-float arg0 'timeout))) (set! (-> obj timeout) (the-as time-frame (the int (* 300.0 f0-1)))) diff --git a/test/decompiler/reference/levels/rolling/rolling-robber_REF.gc b/test/decompiler/reference/levels/rolling/rolling-robber_REF.gc index 55532cb449..cb4297efea 100644 --- a/test/decompiler/reference/levels/rolling/rolling-robber_REF.gc +++ b/test/decompiler/reference/levels/rolling/rolling-robber_REF.gc @@ -1,16 +1,14 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/robber-ag.gc") + ;; failed to figure out what this is: (defstate fuel-cell-spline-slider (fuel-cell) - :trans - (the-as (function none :behavior fuel-cell) hide-hud-quick) - :code - (behavior ((arg0 handle) (arg1 float) (arg2 float)) + :trans (the-as (function none :behavior fuel-cell) hide-hud-quick) + :code (behavior ((arg0 handle) (arg1 float) (arg2 float)) (logclear! (-> self mask) (process-mask actor-pause)) - (let ((v1-4 (-> self skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - ) + (ja :group! (-> self draw art-group data 2)) (if *target* (process-grab? *target*) ) @@ -20,7 +18,7 @@ (set! (-> *camera-other-trans* quad) (-> *math-camera* trans quad)) (set! (-> *camera-other-root* quad) (-> *math-camera* trans quad)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (dotimes (v1-14 (the int (-> *display* time-adjust-ratio))) (set! arg2 (* 0.95 arg2)) ) @@ -51,12 +49,9 @@ (forward-down->inv-matrix *camera-other-matrix* s4-0 (new 'static 'vector :y -1.0 :w 1.0)) ) (set! *camera-look-through-other* 2) - (set-letterbox-frames (seconds 0.033333335)) + (set-letterbox-frames (seconds 0.035)) (suspend) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) 0.5) - (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! 0.5)) ) (none) ) @@ -136,14 +131,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *robber-sg* robber - 0 - 10 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *robber-sg* robber robber-lod0-jg robber-idle-hover-ja + ((robber-lod0-mg (meters 20)) (robber-lod1-mg (meters 40)) (robber-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow robber-shadow-mg + ) ;; definition for function robber-event-handler (defbehavior robber-event-handler robber ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) @@ -188,7 +180,7 @@ (collide-kind background) self t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) (v1-5 (new 'stack-no-clear 'vector)) @@ -330,35 +322,9 @@ ;; failed to figure out what this is: (defstate robber-debug (robber) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (new 'stack-no-clear 'vector))) @@ -380,23 +346,17 @@ (robber-rotate (the-as target #f) 1820.4445) (robber-find-ground) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robber) ja-post) + :post (the-as (function none :behavior robber) ja-post) ) ;; failed to figure out what this is: (defstate robber-dead (robber) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (deactivate self) (none) @@ -405,13 +365,11 @@ ;; failed to figure out what this is: (defstate robber-die (robber) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior robber) process-drawable-death-event-handler ) - :code - (behavior () + :code (behavior () (let ((gp-0 #t)) (when (robber-task-complete?) (let ((v1-3 (-> self entity extra perm))) @@ -425,21 +383,15 @@ -163840.0 ) ) - (s5-0 (get-process *default-dead-pool* fuel-cell #x4000)) ) - (when s5-0 - (let ((t9-2 (method-of-type fuel-cell activate))) - (t9-2 (the-as fuel-cell s5-0) self 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - fuel-cell-init-as-spline-slider - (process->handle self) - (-> self curve-position) - f30-0 - (-> self entity extra perm task) - ) - (-> s5-0 ppointer) + (process-spawn + fuel-cell + :init fuel-cell-init-as-spline-slider + (process->handle self) + (-> self curve-position) + f30-0 + (-> self entity extra perm task) + :to self ) ) ) @@ -463,25 +415,13 @@ ) ) (when gp-0 - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (robber-calc-speed 4096.0 8192.0 122880.0 122880.0 #f) (robber-move) (robber-rotate (the-as target #f) 1820.4445) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) 1.0) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -491,16 +431,13 @@ (go robber-dead) (none) ) - :post - (the-as (function none :behavior robber) transform-post) + :post (the-as (function none :behavior robber) transform-post) ) ;; failed to figure out what this is: (defstate robber-got-away (robber) - :event - robber-event-handler - :trans - (behavior () + :event robber-event-handler + :trans (behavior () (if (and (not (and *target* (>= 204800.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -516,24 +453,13 @@ ) (none) ) - :code - (behavior () - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) + :code (behavior () + (when (not (ja-group? (-> self draw art-group data 7))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 7)) ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 param 0) (robber-calc-anim-speed)) - (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-loop!) - ) + (loop + (ja :num! (loop! (robber-calc-anim-speed))) (if (< 27.306667 (fabs (-> self speed))) (set! (-> self speed) (* 0.95 (-> self speed))) ) @@ -543,26 +469,21 @@ ) (none) ) - :post - (the-as (function none :behavior robber) transform-post) + :post (the-as (function none :behavior robber) transform-post) ) ;; failed to figure out what this is: (defstate robber-tired (robber) - :event - robber-event-handler - :enter - (behavior () + :event robber-event-handler + :enter (behavior () (set! (-> self y-offset-desired) -12288.0) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self y-offset-desired) 0.0) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (and *target* (>= 163840.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -571,49 +492,26 @@ ) (none) ) - :code - (behavior () - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) - ) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 param 0) (robber-calc-anim-speed)) - (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-loop!) + :code (behavior () + (loop + (when (not (ja-group? (-> self draw art-group data 7))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 7)) ) + (ja :num! (loop! (robber-calc-anim-speed))) (robber-calc-speed 32768.0 122880.0 122060.8 20480.0 #f) (robber-move) (robber-rotate (the-as target #f) 1820.4445) (suspend) (when (>= (- (-> *display* base-frame-counter) (-> self last-ambient-time)) (-> self time-to-next-ambient)) - (ja-channel-push! 1 60) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-14 param 1) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 11) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (robber-calc-speed 32768.0 122880.0 122060.8 20480.0 #f) (robber-move) (robber-rotate (the-as target #f) 1820.4445) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self last-ambient-time) (-> *display* base-frame-counter)) (let* ((f30-0 300.0) @@ -630,23 +528,19 @@ ) (none) ) - :post - (the-as (function none :behavior robber) transform-post) + :post (the-as (function none :behavior robber) transform-post) ) ;; failed to figure out what this is: (defstate robber-flee (robber) - :event - robber-event-handler - :enter - (behavior () + :event robber-event-handler + :enter (behavior () (set! (-> self near-timer) 3000) (set! (-> self far-time) (-> *display* base-frame-counter)) (set! (-> self y-offset-desired) 0.0) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (and *target* (>= 163840.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -670,49 +564,26 @@ ) (none) ) - :code - (behavior () - (while #t - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - ) - (ja-channel-push! 1 60) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) - ) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 param 0) (robber-calc-anim-speed)) - (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-loop!) + :code (behavior () + (loop + (when (not (ja-group? (-> self draw art-group data 7))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 7)) ) + (ja :num! (loop! (robber-calc-anim-speed))) (robber-calc-speed 61440.0 122880.0 204800.0 16384.0 #t) (robber-move) (robber-rotate (the-as target #f) 1820.4445) (suspend) (when (>= (- (-> *display* base-frame-counter) (-> self last-ambient-time)) (-> self time-to-next-ambient)) - (ja-channel-push! 1 60) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-14 param 1) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 11) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (robber-calc-speed 61440.0 122880.0 204800.0 16384.0 #t) (robber-move) (robber-rotate (the-as target #f) 1820.4445) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self last-ambient-time) (-> *display* base-frame-counter)) (let* ((f30-0 300.0) @@ -729,21 +600,17 @@ ) (none) ) - :post - (the-as (function none :behavior robber) transform-post) + :post (the-as (function none :behavior robber) transform-post) ) ;; failed to figure out what this is: (defstate robber-idle (robber) - :event - robber-event-handler - :enter - (behavior () + :event robber-event-handler + :enter (behavior () (set! (-> self speed) 0.0) (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -753,40 +620,24 @@ (robber-move) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (loop + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robber) transform-post) + :post (the-as (function none :behavior robber) transform-post) ) ;; failed to figure out what this is: (defstate robber-initial-notice (robber) - :event - robber-event-handler - :trans - (behavior () + :event robber-event-handler + :trans (behavior () (when (logtest? (-> self draw status) (draw-status was-drawn)) (if (and *target* (>= 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) @@ -807,8 +658,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (TODO-RENAME-14 (-> self path) (-> self tangent) (-> self curve-position)) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root-override trans) (target-pos 0))) (f0-1 6.826667) @@ -819,46 +669,30 @@ ) (set! (-> self speed) f0-1) ) - (ja-channel-push! 1 60) - (while #t - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 2.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (loop + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek! max 2.0) :frame-num 0.0) (until (ja-done? 0) (robber-calc-speed 61440.0 122880.0 2048.0 2048.0 #t) (robber-rotate (the-as target #f) 1820.4445) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 2.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 2.0)) ) (go robber-flee) ) (none) ) - :post - (the-as (function none :behavior robber) transform-post) + :post (the-as (function none :behavior robber) transform-post) ) ;; failed to figure out what this is: (defstate robber-initial (robber) - :event - robber-event-handler - :enter - (behavior () + :event robber-event-handler + :enter (behavior () (set! (-> self speed) 0.0) (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -867,32 +701,18 @@ (robber-move) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (loop + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior robber) transform-post) + :post (the-as (function none :behavior robber) transform-post) ) ;; definition for method 11 of type robber diff --git a/test/decompiler/reference/levels/snow/ice-cube_REF.gc b/test/decompiler/reference/levels/snow/ice-cube_REF.gc index 8d6eb1430a..c7681adafc 100644 --- a/test/decompiler/reference/levels/snow/ice-cube_REF.gc +++ b/test/decompiler/reference/levels/snow/ice-cube_REF.gc @@ -1,14 +1,14 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/ice-cube-ag.gc") +(import "goal_src/import/ice-cube-break-ag.gc") + ;; failed to figure out what this is: -(defskelgroup *ice-cube-break-sg* ice-cube-break - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 -15 0 50) - :longest-edge (meters 0) - ) +(defskelgroup *ice-cube-break-sg* ice-cube-break ice-cube-break-lod0-jg -1 + ((ice-cube-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -15 0 50) + ) ;; definition of type ice-cube (deftype ice-cube (nav-enemy) @@ -77,14 +77,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *ice-cube-sg* ice-cube - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 3 0 3.6) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *ice-cube-sg* ice-cube ice-cube-lod0-jg -1 + ((ice-cube-lod0-mg (meters 20)) (ice-cube-lod1-mg (meters 40)) (ice-cube-lod2-mg (meters 999999))) + :bounds (static-spherem 0 3 0 3.6) + :shadow ice-cube-shadow-mg + ) ;; definition for symbol *ice-cube-nav-enemy-info*, type nav-enemy-info (define *ice-cube-nav-enemy-info* (new 'static 'nav-enemy-info @@ -135,7 +132,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -146,16 +143,14 @@ :id 507 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 1887 :fade-after (meters 70) :falloff-to (meters 70)) + :parts ((sp-item 1887 :fade-after (meters 70) :falloff-to (meters 70)) (sp-item 1888 :fade-after (meters 70) :falloff-to (meters 70)) ) ) ;; failed to figure out what this is: (defpart 1888 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) @@ -180,8 +175,7 @@ ;; failed to figure out what this is: (defpart 1887 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) @@ -212,14 +206,12 @@ :id 508 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 1889 :fade-after (meters 70) :falloff-to (meters 70))) + :parts ((sp-item 1889 :fade-after (meters 70) :falloff-to (meters 70))) ) ;; failed to figure out what this is: (defpart 1889 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -246,14 +238,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2325) (sp-item 2326) (sp-item 2327)) + :parts ((sp-item 2325) (sp-item 2326) (sp-item 2327)) ) ;; failed to figure out what this is: (defpart 2325 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -278,8 +268,7 @@ ;; failed to figure out what this is: (defpart 2326 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -304,8 +293,7 @@ ;; failed to figure out what this is: (defpart 2327 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -332,14 +320,12 @@ :id 509 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 1890) (sp-item 1891) (sp-item 1892)) + :parts ((sp-item 1890) (sp-item 1891) (sp-item 1892)) ) ;; failed to figure out what this is: (defpart 1892 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 64.0) (sp-flt spt-y (meters 1)) (sp-rnd-flt spt-scale-x (meters 0.24) (meters 0.24) 1.0) @@ -361,8 +347,7 @@ ;; failed to figure out what this is: (defpart 1891 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters 1)) @@ -390,8 +375,7 @@ ;; failed to figure out what this is: (defpart 1890 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters 1)) @@ -431,14 +415,7 @@ (cond ((and (= (-> arg0 type) target) (= (-> self cprims-type) 2) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'powerup)) - (set! (-> a1-1 param 1) (the-as uint 2)) - (not (send-event-function *target* a1-1)) - ) + (not (send-event *target* 'query 'powerup (pickup-type eco-red))) ) (when (and (cond ((= (-> arg0 type) target) @@ -463,7 +440,7 @@ (= (-> arg0 type) target) ) (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) 256) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (level-hint-spawn (game-text-id ice-cube-hint) "sksp0350" (the-as entity #f) *entity-pool* (game-task none)) ) ) @@ -497,8 +474,8 @@ (= (-> arg0 type) target) ) (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (let ((v0-3 (the-as none (logior (-> self nav-enemy-flags) 256)))) - (set! (-> self nav-enemy-flags) (the-as uint v0-3)) + (let ((v0-3 (the-as none (logior (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))))) + (set! (-> self nav-enemy-flags) (the-as nav-enemy-flags v0-3)) v0-3 ) ) @@ -507,17 +484,7 @@ (when (!= (-> arg0 type) target) (cond ((= (-> arg0 type) target) - (let ((a1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-9 from) self) - (set! (-> a1-9 num-params) 2) - (set! (-> a1-9 message) 'attack) - (set! (-> a1-9 param 0) (-> arg3 param 0)) - (let ((v1-49 (new 'static 'attack-info :mask #x20))) - (set! (-> v1-49 mode) #f) - (set! (-> a1-9 param 1) (the-as uint v1-49)) - ) - (send-event-function arg0 a1-9) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode #f)))) ) (else (let ((a1-10 (new 'stack-no-clear 'event-message-block))) @@ -642,7 +609,7 @@ ;; definition for method 48 of type ice-cube ;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-48 ice-cube ((obj ice-cube)) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (initialize-skeleton obj *ice-cube-sg* '()) (TODO-RENAME-45 obj *ice-cube-nav-enemy-info*) (set! (-> obj neck up) (the-as uint 0)) @@ -744,7 +711,7 @@ (collide-kind background) (-> obj collide-info process) s4-0 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -812,7 +779,7 @@ (collide-kind background) obj s3-1 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -841,22 +808,19 @@ ;; failed to figure out what this is: (defstate ice-cube-trying-to-appear (ice-cube) - :enter - (behavior () + :enter (behavior () (ja-channel-set! 0) (ja-post) (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self collide-info)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self collide-info)) (none) ) - :trans - (behavior () + :trans (behavior () (when (and *target* (>= 163840.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) @@ -871,8 +835,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -882,10 +845,8 @@ ;; failed to figure out what this is: (defstate ice-cube-appear (ice-cube) - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (dummy-57 self) (set! (-> self ground-y) (-> self collide-info trans y)) (spawn (-> self part) (-> self collide-info trans)) @@ -895,8 +856,7 @@ (set! (-> self collide-info transv y) (rand-vu-float-range 102400.0 114688.0)) (none) ) - :trans - (behavior () + :trans (behavior () (when (and (< (-> self collide-info trans y) (-> self ground-y)) (< (-> self collide-info transv y) 0.0)) (set! (-> self collide-info trans y) (-> self ground-y)) (set! (-> self collide-info transv quad) (-> *null-vector* quad)) @@ -911,64 +871,36 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! ice-cube-appear-jump-up-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior ice-cube) nav-enemy-falling-post) + :post (the-as (function none :behavior ice-cube) nav-enemy-falling-post) ) ;; failed to figure out what this is: (defstate ice-cube-appear-land (ice-cube) - :event - ice-cube-default-event-handler - :code - (behavior () + :event ice-cube-default-event-handler + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (-> self node-list data 29)) (spawn (-> self part4) gp-0) (vector<-cspace! gp-0 (-> self node-list data 25)) (spawn (-> self part4) gp-0) ) - (ja-channel-push! 1 30) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ice-cube-appear-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (if (TODO-RENAME-46 self (-> self nav-info notice-distance)) (go ice-cube-become-mean) @@ -976,17 +908,14 @@ ) (none) ) - :post - (the-as (function none :behavior ice-cube) ja-post) + :post (the-as (function none :behavior ice-cube) ja-post) ) ;; failed to figure out what this is: (defstate nav-enemy-idle (ice-cube) :virtual #t - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (let ((t9-0 (-> (method-of-type nav-enemy nav-enemy-idle) enter))) (if t9-0 (t9-0) @@ -1001,10 +930,8 @@ ;; failed to figure out what this is: (defstate nav-enemy-patrol (ice-cube) :virtual #t - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (let ((t9-0 (-> (method-of-type nav-enemy nav-enemy-patrol) enter))) (if t9-0 (t9-0) @@ -1014,9 +941,8 @@ (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-patrol) code))) (if t9-1 ((the-as (function none) t9-1)) @@ -1029,36 +955,31 @@ ;; failed to figure out what this is: (defstate nav-enemy-notice (ice-cube) :virtual #t - :enter - (the-as (function none :behavior ice-cube) #f) - :exit - (the-as (function none :behavior ice-cube) #f) - :trans - (the-as (function none :behavior ice-cube) #f) - :code - (behavior () + :enter (the-as (function none :behavior ice-cube) #f) + :exit (the-as (function none :behavior ice-cube) #f) + :trans (the-as (function none :behavior ice-cube) #f) + :code (behavior () (dummy-57 self) - (set! (-> self nav-enemy-flags) (logand -3 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (logclear! (-> self mask) (process-mask actor-pause)) (go ice-cube-face-player) (none) ) - :post - (the-as (function none :behavior ice-cube) #f) + :post (the-as (function none :behavior ice-cube) #f) ) ;; failed to figure out what this is: (defstate ice-cube-face-player (ice-cube) - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (dummy-57 self) (logclear! (-> self mask) (process-mask actor-pause)) (if (or (not *target*) - (logtest? (-> *target* state-flags) #x80f8) + (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) (not (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos))) ) (go-virtual nav-enemy-patrol) @@ -1069,19 +990,10 @@ (set-vector! (-> self collide-info transv) 0.0 114688.0 0.0 1.0) (none) ) - :code - (behavior () + :code (behavior () (local-vars (gp-0 symbol)) - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! ice-cube-appear-jump-up-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f30-0 (-> self collide-info transv y))) (integrate-for-enemy-with-move-to-ground! @@ -1099,19 +1011,20 @@ ) (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) (let* ((v1-26 (>= 0.0 (-> self collide-info transv y))) - (v1-27 (and v1-26 (logtest? (-> self collide-info status) 1))) + (v1-27 (and v1-26 (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)))) ) (set! gp-0 (dummy-60 self (not v1-27))) ) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (let ((s5-0 (and (>= 0.0 (-> self collide-info transv y)) (logtest? (-> self collide-info status) 1)))) + (loop + (let ((s5-0 + (and (>= 0.0 (-> self collide-info transv y)) + (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)) + ) + ) + ) (set! gp-0 (and s5-0 gp-0)) (if gp-0 (goto cfg-26) @@ -1137,72 +1050,43 @@ (vector<-cspace! gp-1 (-> self node-list data 25)) (spawn (-> self part4) gp-1) ) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! ice-cube-appear-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ice-cube-become-mean) (none) ) - :post - (the-as (function none :behavior ice-cube) nav-enemy-simple-post) + :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate ice-cube-become-mean (ice-cube) - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (set! (-> self draw force-lod) 0) (logclear! (-> self mask) (process-mask actor-pause)) (dummy-57 self) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (let ((gp-0 #f)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! ice-cube-extend-spikes-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (not gp-0) (>= (ja-aframe-num 0) 8.0)) (set! gp-0 #t) (dummy-58 self) ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (go ice-cube-mean-turn-to-charge) (none) ) - :post - (the-as (function none :behavior ice-cube) nav-enemy-simple-post) + :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) ;; definition for method 54 of type ice-cube @@ -1228,15 +1112,15 @@ ;; failed to figure out what this is: (defstate ice-cube-mean-turn-to-charge (ice-cube) - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (dummy-58 self) (if (or (not *target*) - (logtest? (-> *target* state-flags) #x80f8) + (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) (not (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos))) ) (go ice-cube-retract-spikes) @@ -1247,19 +1131,10 @@ (set-vector! (-> self collide-info transv) 0.0 114688.0 0.0 1.0) (none) ) - :code - (behavior () + :code (behavior () (local-vars (gp-0 symbol)) - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! ice-cube-turn-on-player-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f30-0 (-> self collide-info transv y))) (integrate-for-enemy-with-move-to-ground! @@ -1277,19 +1152,20 @@ ) (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) (let* ((v1-26 (>= 0.0 (-> self collide-info transv y))) - (v1-27 (and v1-26 (logtest? (-> self collide-info status) 1))) + (v1-27 (and v1-26 (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)))) ) (set! gp-0 (dummy-60 self (not v1-27))) ) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t - (let ((s5-0 (and (>= 0.0 (-> self collide-info transv y)) (logtest? (-> self collide-info status) 1)))) + (loop + (let ((s5-0 + (and (>= 0.0 (-> self collide-info transv y)) + (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)) + ) + ) + ) (set! gp-0 (and s5-0 gp-0)) (if gp-0 (goto cfg-26) @@ -1315,42 +1191,29 @@ (vector<-cspace! gp-1 (-> self node-list data 25)) (spawn (-> self part4) gp-1) ) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! ice-cube-turn-on-player-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ice-cube-mean-charge) (none) ) - :post - (the-as (function none :behavior ice-cube) nav-enemy-simple-post) + :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate ice-cube-mean-charge (ice-cube) - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (dummy-58 self) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (set! (-> self next-skid-sound-time) (-> *display* base-frame-counter)) (if (or (not *target*) - (logtest? (-> *target* state-flags) #x80f8) + (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) (not (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos))) ) (go ice-cube-retract-spikes) @@ -1359,7 +1222,7 @@ (set! (-> self acceleration) (-> self nav-info run-acceleration)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) - (logclear! (-> self nav flags) (nav-control-flags bit8)) + (logclear! (-> self nav flags) (nav-control-flags navcf8)) (set-root-prim-collide-with! (-> self collide-info) (collide-kind cak-2 cak-3 target crate enemy)) (set! (-> self track-target?) #t) (set! (-> self slow-down?) #f) @@ -1371,15 +1234,13 @@ (set! (-> self charge-angle) (quaternion-y-angle (-> self collide-info quat))) (none) ) - :exit - (behavior () - (logior! (-> self nav flags) (nav-control-flags bit8)) + :exit (behavior () + (logior! (-> self nav flags) (nav-control-flags navcf8)) (set-root-prim-collide-with! (-> self collide-info) (collide-kind target)) (none) ) - :trans - (behavior () - (when (or (not *target*) (logtest? (-> *target* state-flags) 128)) + :trans (behavior () + (when (or (not *target*) (logtest? (-> *target* state-flags) (state-flags do-not-notice))) (cond ((= (-> self speed) 0.0) (go ice-cube-mean-charge-done) @@ -1451,15 +1312,7 @@ ) (when (>= (-> *display* base-frame-counter) (-> self next-skid-sound-time)) (set! (-> self next-skid-sound-time) (+ (-> *display* base-frame-counter) (nav-enemy-rnd-int-range 60 120))) - (sound-play-by-name - (static-sound-name "ice-stop") - (new-sound-id) - (the int (* 10.24 (the float (the int (* 0.0012207031 (-> self speed)))))) - 0 - 0 - 1 - #t - ) + (sound-play "ice-stop" :vol (the float (the int (* 0.0012207031 (-> self speed))))) ) ) (let ((f30-1 (* (vector-xz-length (-> self nav travel)) (-> *display* frames-per-second)))) @@ -1491,67 +1344,30 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 12)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! ice-cube-invuln-run-ja :num! min) (until (-> self slow-down?) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) - (ja-channel-push! 2 21) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 17)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) - (let ((a0-5 (-> self skel root-channel 1))) - (set! (-> a0-5 frame-interp) (-> self anim-blend)) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) - (set! (-> a0-5 param 0) 0.0) - (joint-control-channel-group-eval! - a0-5 - (the-as art-joint-anim (-> self draw art-group data 13)) - num-func-chan - ) - ) - (while #t + (ja-channel-push! 2 (seconds 0.07)) + (ja :group! ice-cube-invuln-stopping-upright-ja :num! min) + (ja :chan 1 :group! ice-cube-invuln-stopping-ja :num! (chan 0) :frame-interp (-> self anim-blend)) + (loop (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-loop!) - ) - (let ((a0-7 (-> self skel root-channel 1))) - (set! (-> a0-7 frame-interp) (-> self anim-blend)) - (set! (-> a0-7 param 0) 0.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-chan) - ) + (ja :num! (loop!)) + (ja :chan 1 :num! (chan 0) :frame-interp (-> self anim-blend)) ) (none) ) - :post - (the-as (function none :behavior ice-cube) nav-enemy-simple-post) + :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate ice-cube-mean-charge-done (ice-cube) - :event - ice-cube-default-event-handler - :code - (behavior () + :event ice-cube-default-event-handler + :code (behavior () (dummy-58 self) (nav-enemy-neck-control-inactive) (go ice-cube-retract-spikes) @@ -1561,54 +1377,36 @@ ;; failed to figure out what this is: (defstate ice-cube-retract-spikes (ice-cube) - :event - ice-cube-default-event-handler - :code - (behavior () + :event ice-cube-default-event-handler + :code (behavior () (dummy-58 self) (nav-enemy-neck-control-inactive) - (ja-channel-push! 1 21) + (ja-channel-push! 1 (seconds 0.07)) (let ((gp-0 #f)) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 14))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 14)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 14)) num-func-seek!) - ) + (ja-no-eval :group! ice-cube-retract-spikes-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (not gp-0) (>= (ja-aframe-num 0) 3.0)) (set! gp-0 #t) (dummy-57 self) ) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (go ice-cube-tired) (none) ) - :post - (the-as (function none :behavior ice-cube) nav-enemy-simple-post) + :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate ice-cube-tired (ice-cube) - :event - ice-cube-default-event-handler - :enter - (behavior () + :event ice-cube-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) (cond ((or (not *target*) (< (-> self enemy-info idle-distance) @@ -1627,56 +1425,29 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! ice-cube-head-wipe-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 60) - (while #t - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 15)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (loop + (ja-no-eval :group! ice-cube-breathing-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior ice-cube) nav-enemy-simple-post) + :post (the-as (function none :behavior ice-cube) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate ice-cube-shatter (ice-cube) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (-> self node-list data 3)) @@ -1689,53 +1460,41 @@ (set! (-> gp-1 duration) (seconds 3)) (set! (-> gp-1 gravity) -327680.0) (set! (-> gp-1 fountain-rand-transv-lo quad) (-> (target-pos 0) quad)) - (let ((s5-1 (get-process *default-dead-pool* joint-exploder #x4000))) - (when s5-1 - (let ((t9-8 (method-of-type joint-exploder activate))) - (t9-8 (the-as joint-exploder s5-1) self 'joint-exploder (the-as pointer #x70004000)) + (process-spawn + joint-exploder + *ice-cube-break-sg* + 2 + gp-1 + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 28) + (new 'static 'joint-exploder-static-joint-params :joint-index 23) + (new 'static 'joint-exploder-static-joint-params :joint-index 8) + (new 'static 'joint-exploder-static-joint-params :joint-index 7) + (new 'static 'joint-exploder-static-joint-params :joint-index 26) + (new 'static 'joint-exploder-static-joint-params :joint-index 21) + (new 'static 'joint-exploder-static-joint-params :joint-index 24) + (new 'static 'joint-exploder-static-joint-params :joint-index 29) + (new 'static 'joint-exploder-static-joint-params :joint-index 11) + (new 'static 'joint-exploder-static-joint-params :joint-index 4) + (new 'static 'joint-exploder-static-joint-params :joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 15) + (new 'static 'joint-exploder-static-joint-params :joint-index 16) + (new 'static 'joint-exploder-static-joint-params :joint-index 17) + (new 'static 'joint-exploder-static-joint-params :joint-index 18) + (new 'static 'joint-exploder-static-joint-params :joint-index 19) + (new 'static 'joint-exploder-static-joint-params :joint-index 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 20) ) - (run-now-in-process - s5-1 - joint-exploder-init-by-other - *ice-cube-break-sg* - 2 - gp-1 - (new 'static 'joint-exploder-static-params - :joints - (new - 'static - 'boxed-array - :type joint-exploder-static-joint-params :length 22 :allocated-length 22 - (new 'static 'joint-exploder-static-joint-params :joint-index 28) - (new 'static 'joint-exploder-static-joint-params :joint-index 23) - (new 'static 'joint-exploder-static-joint-params :joint-index 8) - (new 'static 'joint-exploder-static-joint-params :joint-index 7) - (new 'static 'joint-exploder-static-joint-params :joint-index 26) - (new 'static 'joint-exploder-static-joint-params :joint-index 21) - (new 'static 'joint-exploder-static-joint-params :joint-index 24) - (new 'static 'joint-exploder-static-joint-params :joint-index 29) - (new 'static 'joint-exploder-static-joint-params :joint-index 11) - (new 'static 'joint-exploder-static-joint-params :joint-index 4) - (new 'static 'joint-exploder-static-joint-params :joint-index 6) - (new 'static 'joint-exploder-static-joint-params :joint-index 5) - (new 'static 'joint-exploder-static-joint-params :joint-index 12) - (new 'static 'joint-exploder-static-joint-params :joint-index 13) - (new 'static 'joint-exploder-static-joint-params :joint-index 14) - (new 'static 'joint-exploder-static-joint-params :joint-index 15) - (new 'static 'joint-exploder-static-joint-params :joint-index 16) - (new 'static 'joint-exploder-static-joint-params :joint-index 17) - (new 'static 'joint-exploder-static-joint-params :joint-index 18) - (new 'static 'joint-exploder-static-joint-params :joint-index 19) - (new 'static 'joint-exploder-static-joint-params :joint-index 3) - (new 'static 'joint-exploder-static-joint-params :joint-index 20) - ) - ) - ) - (-> s5-1 ppointer) ) + :to self ) ) - (sound-play-by-name (static-sound-name "ice-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ice-explode") (suspend) (ja-channel-set! 0) (ja-post) diff --git a/test/decompiler/reference/levels/snow/snow-ball_REF.gc b/test/decompiler/reference/levels/snow/snow-ball_REF.gc index fc41b05228..65d83f8060 100644 --- a/test/decompiler/reference/levels/snow/snow-ball_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-ball_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/snow-ball-ag.gc") + ;; definition of type snow-ball-shadow (deftype snow-ball-shadow (process-drawable) () @@ -147,32 +149,23 @@ ) ;; failed to figure out what this is: -(defskelgroup *snow-ball-sg* snow-ball - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *snow-ball-sg* snow-ball snow-ball-lod0-jg snow-ball-idle-ja + ((snow-ball-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; failed to figure out what this is: -(defskelgroup *snow-ball-shadow-sg* snow-ball - 3 - -1 - ((4 (meters 999999))) - :bounds (static-spherem 0 -1.5 0 2) - :longest-edge (meters 0) - :shadow 5 - ) +(defskelgroup *snow-ball-shadow-sg* snow-ball snow-ball-shadow-lod0-jg -1 + ((snow-ball-shadow-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -1.5 0 2) + :shadow snow-ball-shadow-shadow-mg + ) ;; definition for symbol *snow-ball-shadow-control*, type shadow-control -(define - *snow-ball-shadow-control* +(define *snow-ball-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #xa)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 245760.0) + :flags (shadow-flags disable-fade shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 245760.0) :bot-plane (new 'static 'plane :y 1.0 :w 26624.0) :top-plane (new 'static 'plane :y 1.0) :fade-dist 819200.0 @@ -182,23 +175,20 @@ ;; failed to figure out what this is: (defstate snow-ball-shadow-idle (snow-ball-shadow) - :trans - (behavior () + :trans (behavior () (set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) (update-direction-from-time-of-day (-> self draw shadow-ctrl)) 0 (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior snow-ball-shadow) ja-post) + :post (the-as (function none :behavior snow-ball-shadow) ja-post) ) ;; definition for function snow-ball-shadow-init-by-other @@ -213,14 +203,7 @@ (vector-identity! (-> self root scale)) (initialize-skeleton self *snow-ball-shadow-sg* '()) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! snow-ball-shadow-idle-ja :num! min) (set! (-> self draw shadow-ctrl) *snow-ball-shadow-control*) (go snow-ball-shadow-idle) (none) @@ -283,7 +266,7 @@ ;; definition for method 21 of type snow-ball-roller (defmethod play-landing-sound snow-ball-roller ((obj snow-ball-roller) (arg0 float)) (let ((f30-0 (* 0.0018780049 (fmin 53248.0 (fmax 0.0 (+ -4096.0 (fabs arg0))))))) - (sound-play-by-name (static-sound-name "snowball-land") (new-sound-id) (the int (* 10.24 f30-0)) 0 0 1 #t) + (sound-play "snowball-land" :vol f30-0) ) ) @@ -376,27 +359,16 @@ (cond ((zero? (-> self rolling-sound-id)) (if (and v1-54 (-> self rolling-sound-enabled?)) - (set! (-> self rolling-sound-id) (sound-play-by-name - (static-sound-name "snowball-roll") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (set! (-> self rolling-sound-id) + (sound-play "snowball-roll" :position (the-as symbol (-> self root-override trans))) ) ) ) ((and v1-54 (-> self rolling-sound-enabled?)) - (sound-play-by-name - (static-sound-name "snowball-roll") - (-> self rolling-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) + (sound-play + "snowball-roll" + :id (-> self rolling-sound-id) + :position (the-as symbol (-> self root-override trans)) ) ) (else @@ -413,75 +385,60 @@ ;; INFO: Return type mismatch object vs none. ;; Used lq/sq (defmethod dummy-22 snow-ball-roller ((obj snow-ball-roller) (arg0 process-drawable)) - (with-pp - (cond - ((< (+ 4096.0 (-> arg0 root trans y)) (-> obj root-override trans y)) - (let ((f0-2 81920.0)) - (+! (-> obj root-override transv y) f0-2) - (play-landing-sound obj f0-2) - ) + (cond + ((< (+ 4096.0 (-> arg0 root trans y)) (-> obj root-override trans y)) + (let ((f0-2 81920.0)) + (+! (-> obj root-override transv y) f0-2) + (play-landing-sound obj f0-2) ) - (else - (let ((f0-3 24576.0)) - (+! (-> obj root-override transv y) f0-3) - (play-landing-sound obj f0-3) - ) + ) + (else + (let ((f0-3 24576.0)) + (+! (-> obj root-override transv y) f0-3) + (play-landing-sound obj f0-3) ) ) - (let ((s4-0 (new 'stack-no-clear 'vector))) - (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 (-> arg0 root trans) (-> obj root-override trans)) - (set! (-> s4-0 y) 0.0) - (vector-normalize! s4-0 1.0) - (TODO-RENAME-14 (-> obj path) s3-0 (-> obj path-u)) - (set! (-> s3-0 y) 0.0) - (vector-normalize! s3-0 1.0) - (let* ((f28-0 (atan (-> s4-0 x) (-> s4-0 z))) - (f30-0 (atan (-> s3-0 x) (-> s3-0 z))) - (f0-11 (deg- f28-0 f30-0)) - ) - (when (< (fabs f0-11) 10922.667) - (let ((f30-1 (+ f30-0 (if (>= f0-11 0.0) - 10922.667 - -10922.667 - ) - ) - ) - ) - (set-vector! s4-0 (sin f30-1) 0.0 (cos f30-1) 1.0) - ) - ) - ) - ) - (vector-normalize! s4-0 25600.0) - (vector+! s4-0 s4-0 (-> obj root-override trans)) - (vector-! s4-0 s4-0 (-> arg0 root trans)) - (set! (-> s4-0 y) 0.0) - (let ((f30-2 (vector-length s4-0))) - (vector-normalize! s4-0 1.0) - (let ((a1-17 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-17 from) pp) - (set! (-> a1-17 num-params) 2) - (set! (-> a1-17 message) 'attack) - (set! (-> a1-17 param 0) (the-as uint #f)) - (let ((v1-20 (new 'static 'attack-info :mask #xc2))) - (set! (-> v1-20 vector quad) (-> s4-0 quad)) - (set! (-> v1-20 shove-up) 12288.0) - (set! (-> v1-20 shove-back) f30-2) - (set! (-> a1-17 param 1) (the-as uint v1-20)) - ) - (send-event-function arg0 a1-17) - ) - ) - ) - (none) ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 root trans) (-> obj root-override trans)) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (TODO-RENAME-14 (-> obj path) s3-0 (-> obj path-u)) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (let* ((f28-0 (atan (-> s4-0 x) (-> s4-0 z))) + (f30-0 (atan (-> s3-0 x) (-> s3-0 z))) + (f0-11 (deg- f28-0 f30-0)) + ) + (when (< (fabs f0-11) 10922.667) + (let ((f30-1 (+ f30-0 (if (>= f0-11 0.0) + 10922.667 + -10922.667 + ) + ) + ) + ) + (set-vector! s4-0 (sin f30-1) 0.0 (cos f30-1) 1.0) + ) + ) + ) + ) + (vector-normalize! s4-0 25600.0) + (vector+! s4-0 s4-0 (-> obj root-override trans)) + (vector-! s4-0 s4-0 (-> arg0 root trans)) + (set! (-> s4-0 y) 0.0) + (let ((f30-2 (vector-length s4-0))) + (vector-normalize! s4-0 1.0) + (send-event arg0 'attack #f (static-attack-info ((vector s4-0) (shove-up (meters 3)) (shove-back f30-2)))) + ) + ) + (none) ) ;; failed to figure out what this is: (defstate snow-ball-roller-idle (snow-ball-roller) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) (when (= (-> arg0 type) target) @@ -495,14 +452,12 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self last-bounce-time) (-> *display* base-frame-counter)) (snow-ball-roller-path-init) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self rolling-sound-enabled?) #f) (when (nonzero? (-> self rolling-sound-id)) (sound-stop (-> self rolling-sound-id)) @@ -511,21 +466,18 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (snow-ball-roller-path-update) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior snow-ball-roller) transform-post) + :post (the-as (function none :behavior snow-ball-roller) transform-post) ) ;; definition for function snow-ball-roller-init-by-other @@ -579,15 +531,7 @@ ) ) (set! (-> self delay-til-bounce) (rand-vu-int-range 900 2100)) - (let ((gp-1 (get-process *default-dead-pool* snow-ball-shadow #x4000))) - (when gp-1 - (let ((t9-11 (method-of-type snow-ball-shadow activate))) - (t9-11 (the-as snow-ball-shadow gp-1) self 'snow-ball-shadow (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 snow-ball-shadow-init-by-other) - (-> gp-1 ppointer) - ) - ) + (process-spawn snow-ball-shadow :to self) (go snow-ball-roller-idle) (none) ) @@ -643,8 +587,7 @@ ;; failed to figure out what this is: (defstate snow-ball-idle (snow-ball) - :code - (behavior () + :code (behavior () (local-vars (gp-0 int)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self delay-til-next) 0) @@ -666,19 +609,11 @@ (let ((s4-0 0) (s5-0 (new 'stack-no-clear 'inline-array 'snow-ball-junction 4)) ) - (while #t + (loop (let ((s3-0 (/ (+ 98304.0 (rand-vu-float-range 0.0 32768.0)) (path-distance (-> self path gp-0))))) (dummy-14 self s5-0 s3-0 gp-0) (when (dummy-15 self s5-0 gp-0) - (let ((s4-1 (get-process *default-dead-pool* snow-ball-roller #x4000))) - (when s4-1 - (let ((t9-6 (method-of-type snow-ball-roller activate))) - (t9-6 (the-as snow-ball-roller s4-1) self 'snow-ball-roller (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 snow-ball-roller-init-by-other (-> self entity) self s3-0 gp-0 s5-0) - (-> s4-1 ppointer) - ) - ) + (process-spawn snow-ball-roller (-> self entity) self s3-0 gp-0 s5-0 :to self) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self delay-til-next) (rand-vu-int-range 450 1650)) (cond diff --git a/test/decompiler/reference/levels/snow/snow-bumper_REF.gc b/test/decompiler/reference/levels/snow/snow-bumper_REF.gc index 53385dbfd7..de9689d3a7 100644 --- a/test/decompiler/reference/levels/snow/snow-bumper_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-bumper_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/snow-bumper-ag.gc") + ;; definition of type snow-bumper (deftype snow-bumper (process-drawable) ((bumper-id int32 :offset-assert 176) @@ -40,27 +42,22 @@ ) ;; failed to figure out what this is: -(defskelgroup *snow-bumper-sg* snow-bumper - 0 - -1 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 2.2 0 3.4) - :longest-edge (meters 0) - ) +(defskelgroup *snow-bumper-sg* snow-bumper snow-bumper-lod0-jg -1 + ((snow-bumper-lod0-mg (meters 20)) (snow-bumper-lod1-mg (meters 999999))) + :bounds (static-spherem 0 2.2 0 3.4) + ) ;; failed to figure out what this is: (defpartgroup group-snow-bumper-idle :id 519 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1893 :fade-after (meters 90) :falloff-to (meters 90) :period 25 :length 10)) + :parts ((sp-item 1893 :fade-after (meters 90) :falloff-to (meters 90) :period 25 :length 10)) ) ;; failed to figure out what this is: (defpart 1893 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 15.0) (sp-flt spt-y (meters 1.5)) (sp-flt spt-z (meters 0)) @@ -88,14 +85,12 @@ :id 520 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1895)) + :parts ((sp-item 1895)) ) ;; failed to figure out what this is: (defpart 1895 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 16.0) (sp-flt spt-x (meters 5.5)) (sp-flt spt-y (meters 1.5)) @@ -120,74 +115,58 @@ ;; INFO: Return type mismatch time-frame vs none. ;; Used lq/sq (defmethod shove-player snow-bumper ((obj snow-bumper) (arg0 process-drawable)) - (with-pp - (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (-> arg0 root trans) (-> obj root trans)) - (set! (-> s5-0 y) 0.0) - (vector-normalize! s5-0 1.0) - (let* ((f0-3 (atan (-> s5-0 x) (-> s5-0 z))) - (f30-0 (-> obj base-shove-ry)) - (f28-0 (-> obj max-shove-diff-ry)) - (f0-4 (deg- f0-3 f30-0)) - ) - (when (< f28-0 (fabs f0-4)) - (let ((f30-1 (if (>= f0-4 0.0) - (+ f30-0 f28-0) - (- f30-0 f28-0) - ) - ) - ) - (set-vector! s5-0 (sin f30-1) 0.0 (cos f30-1) 1.0) - ) - ) - ) - (let ((f0-12 (+ -16384.0 (atan (-> s5-0 x) (-> s5-0 z))))) - (set! (-> *part-id-table* 1895 init-specs 17 initial-valuef) (+ -4096.0 f0-12)) - ) - (spawn (-> obj part2) (-> obj root trans)) - (let ((s3-1 (new 'stack-no-clear 'vector))) - (vector-normalize-copy! s3-1 s5-0 32768.0) - (vector+! s3-1 s3-1 (-> obj root trans)) - (vector-! s5-0 s3-1 (-> arg0 root trans)) - ) - (let ((f30-3 (vector-xz-length s5-0))) - (vector-normalize! s5-0 1.0) - (let ((a1-12 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-12 from) pp) - (set! (-> a1-12 num-params) 2) - (set! (-> a1-12 message) 'shove) - (set! (-> a1-12 param 0) (the-as uint #f)) - (let ((v1-16 (new 'static 'attack-info :mask #xc2))) - (set! (-> v1-16 vector quad) (-> s5-0 quad)) - (set! (-> v1-16 shove-up) 4096.0) - (set! (-> v1-16 shove-back) f30-3) - (set! (-> a1-12 param 1) (the-as uint v1-16)) - ) - (if (send-event-function *target* a1-12) - (set! (-> obj last-shoved-player-time) (-> *display* base-frame-counter)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 (-> arg0 root trans) (-> obj root trans)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (let* ((f0-3 (atan (-> s5-0 x) (-> s5-0 z))) + (f30-0 (-> obj base-shove-ry)) + (f28-0 (-> obj max-shove-diff-ry)) + (f0-4 (deg- f0-3 f30-0)) + ) + (when (< f28-0 (fabs f0-4)) + (let ((f30-1 (if (>= f0-4 0.0) + (+ f30-0 f28-0) + (- f30-0 f28-0) + ) + ) ) + (set-vector! s5-0 (sin f30-1) 0.0 (cos f30-1) 1.0) ) ) ) - (none) + (let ((f0-12 (+ -16384.0 (atan (-> s5-0 x) (-> s5-0 z))))) + (set! (-> *part-id-table* 1895 init-specs 17 initial-valuef) (+ -4096.0 f0-12)) + ) + (spawn (-> obj part2) (-> obj root trans)) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (vector-normalize-copy! s3-1 s5-0 32768.0) + (vector+! s3-1 s3-1 (-> obj root trans)) + (vector-! s5-0 s3-1 (-> arg0 root trans)) + ) + (let ((f30-3 (vector-xz-length s5-0))) + (vector-normalize! s5-0 1.0) + (if (send-event *target* 'shove #f (static-attack-info ((vector s5-0) (shove-up (meters 1)) (shove-back f30-3)))) + (set! (-> obj last-shoved-player-time) (-> *display* base-frame-counter)) + ) + ) ) + (none) ) ;; failed to figure out what this is: (defstate snow-bumper-active-far-idle (snow-bumper) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 135895450000.0 (vector-vector-xz-distance-squared (-> self root trans) (target-pos 0)))) (go snow-bumper-active-close-idle) ) 0 (none) ) - :code - (behavior () + :code (behavior () (transform-post) (suspend) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -197,8 +176,7 @@ ;; failed to figure out what this is: (defstate snow-bumper-active-close-idle (snow-bumper) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack 'bonk) (when (= (-> arg0 type) target) @@ -218,8 +196,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (cond (*target* (let* ((gp-0 (target-pos 0)) @@ -246,11 +223,10 @@ (update! (-> self sound)) (none) ) - :code - (behavior () + :code (behavior () (transform-post) (suspend) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -260,59 +236,32 @@ ;; failed to figure out what this is: (defstate snow-bumper-deactivate (snow-bumper) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (the-as (function none :behavior snow-bumper) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior snow-bumper) rider-trans) + :code (behavior () (local-vars (sv-16 symbol)) (logclear! (-> self mask) (process-mask actor-pause)) - (sound-play-by-name (static-sound-name "bumper-pwr-dwn") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 0.05) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (sound-play "bumper-pwr-dwn") + (ja-no-eval :group! snow-bumper-button-ja :num! (seek! max 0.05) :frame-num 0.0) (until (ja-done? 0) (spawn (-> self part) (-> self root trans)) (update! (-> self sound)) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 0.05) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.05)) ) (stop! (-> self sound)) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) (suspend) ) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-10 param 1) 0.02) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! snow-bumper-collapse-ja :num! (seek! max 0.02) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 0.02) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.02)) ) (process-entity-status! self (entity-perm-status complete) #t) (set! sv-16 (the-as symbol #f)) @@ -324,25 +273,14 @@ (go snow-bumper-inactive-idle) (none) ) - :post - (the-as (function none :behavior snow-bumper) rider-post) + :post (the-as (function none :behavior snow-bumper) rider-post) ) ;; failed to figure out what this is: (defstate snow-bumper-spawn-fuel-cell (snow-bumper) - :code - (behavior () + :code (behavior () (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - ) + (ja :group! snow-bumper-collapse-ja :num! max) (transform-post) (if (not (task-complete? *game-info* (-> self entity extra perm task))) (birth-pickup-at-point @@ -364,20 +302,10 @@ ;; failed to figure out what this is: (defstate snow-bumper-inactive-idle (snow-bumper) - :code - (behavior () + :code (behavior () (set! (-> self root nav-radius) 6963.2) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - ) + (ja :group! snow-bumper-collapse-ja :num! max) (transform-post) (suspend) (logior! (-> self mask) (process-mask sleep-code)) @@ -456,19 +384,8 @@ (nav-mesh-connect obj (-> obj root) (the-as nav-control #f)) (set! (-> obj link) (new 'process 'actor-link-info obj)) (set! (-> obj bumper-id) (+ (actor-count-before (-> obj link)) 1)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "snow-bumper") - :volume #x400 - :fo-max 40 - ) - (-> obj root trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "snow-bumper" :fo-max 40) (-> obj root trans)) ) (ja-channel-set! 1) (let ((s5-1 (-> obj skel root-channel 0))) diff --git a/test/decompiler/reference/levels/snow/snow-bunny_REF.gc b/test/decompiler/reference/levels/snow/snow-bunny_REF.gc index dc6544ad27..0c58a9219b 100644 --- a/test/decompiler/reference/levels/snow/snow-bunny_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-bunny_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/snow-bunny-ag.gc") + ;; definition of type snow-bunny (deftype snow-bunny (nav-enemy) ((patrol-rand-distraction int32 :offset-assert 400) @@ -67,14 +69,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *snow-bunny-sg* snow-bunny - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0.25 0 2) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *snow-bunny-sg* snow-bunny snow-bunny-lod0-jg snow-bunny-idle-ja + ((snow-bunny-lod0-mg (meters 20)) (snow-bunny-lod1-mg (meters 40)) (snow-bunny-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0.25 0 2) + :shadow snow-bunny-shadow-mg + ) ;; definition for symbol *snow-bunny-nav-enemy-info*, type nav-enemy-info (define *snow-bunny-nav-enemy-info* (new 'static 'nav-enemy-info @@ -123,7 +122,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -138,18 +137,11 @@ (go-virtual nav-enemy-die) ) (('touch) - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 2) - (set! (-> a1-5 message) 'attack) - (set! (-> a1-5 param 0) (-> arg3 param 0)) - (set! (-> a1-5 param 1) (the-as uint (new 'static 'attack-info))) - (when (send-event-function arg0 a1-5) - (set! (-> self touch-time) (-> *display* base-frame-counter)) - (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) 256) - (go-virtual snow-bunny-attack) - ) + (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + (set! (-> self touch-time) (-> *display* base-frame-counter)) + (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) + (go-virtual snow-bunny-attack) ) ) (('jump) @@ -241,7 +233,7 @@ (defmethod TODO-RENAME-48 snow-bunny ((obj snow-bunny)) (dummy-60 obj) (TODO-RENAME-45 obj *snow-bunny-nav-enemy-info*) - (set! (-> obj draw shadow-ctrl settings flags) (logand -9 (-> obj draw shadow-ctrl settings flags))) + (logclear! (-> obj draw shadow-ctrl settings flags) (shadow-flags shdf03)) (cond ((zero? (res-lump-value (-> obj entity) 'mode uint128)) (set! (-> obj defense) (the-as uint 1)) @@ -282,7 +274,7 @@ ;; definition for method 58 of type snow-bunny ;; INFO: Return type mismatch time-frame vs none. (defmethod dummy-58 snow-bunny ((obj snow-bunny)) - (if (zero? (logand (-> *target* state-flags) 2)) + (if (zero? (logand (-> *target* state-flags) (state-flags dangerous))) (set! (-> obj last-nondangerous-time) (-> *display* base-frame-counter)) ) (none) @@ -292,8 +284,8 @@ ;; INFO: Return type mismatch int vs none. (defbehavior snow-bunny-initialize-jump snow-bunny ((arg0 vector)) (nav-enemy-initialize-custom-jump arg0 #f (-> self jump-height-min) (-> self jump-height-factor) -307200.0) - (set! (-> self nav-enemy-flags) (logand -1025 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 512) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) 0 (none) ) @@ -336,7 +328,7 @@ ;; definition for method 57 of type snow-bunny (defmethod dummy-57 snow-bunny ((obj snow-bunny)) - (if (or (not *target*) (zero? (logand (-> *target* state-flags) 2))) + (if (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags dangerous)))) (return #f) ) (let ((f0-0 (vector-vector-xz-distance (target-pos 0) (-> obj collide-info trans)))) @@ -366,20 +358,17 @@ ;; failed to figure out what this is: (defstate snow-bunny-tune-spheres (snow-bunny) :virtual override - :code - (behavior () + :code (behavior () 0 (none) ) - :post - (the-as (function none :behavior snow-bunny) transform-post) + :post (the-as (function none :behavior snow-bunny) transform-post) ) ;; failed to figure out what this is: (defstate nav-enemy-idle (snow-bunny) :virtual #t - :enter - (behavior () + :enter (behavior () (dummy-76 self #f) (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-idle) enter))) (if t9-1 @@ -388,36 +377,15 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-identity + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) ) - (set! (-> gp-0 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - ) (let ((f30-0 (nav-enemy-rnd-float-range 0.75 1.25))) - (while #t + (loop (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) f30-0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) @@ -427,12 +395,9 @@ ;; failed to figure out what this is: (defstate nav-enemy-patrol (snow-bunny) :virtual #t - :enter - (the-as (function none :behavior snow-bunny) #f) - :trans - (the-as (function none :behavior snow-bunny) #f) - :code - (behavior () + :enter (the-as (function none :behavior snow-bunny) #f) + :trans (the-as (function none :behavior snow-bunny) #f) + :code (behavior () (go-virtual snow-bunny-nav-resume) (none) ) @@ -441,8 +406,7 @@ ;; failed to figure out what this is: (defstate snow-bunny-nav-resume (snow-bunny) :virtual override - :code - (behavior () + :code (behavior () (cond (*target* (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans)))) @@ -473,20 +437,17 @@ ;; failed to figure out what this is: (defstate snow-bunny-patrol-idle (snow-bunny) :virtual override - :event - snow-bunny-default-event-handler - :enter - (behavior () + :event snow-bunny-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (dummy-76 self #f) - (set! (-> self nav flags) (logior (nav-control-flags bit19) (-> self nav flags))) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 8) + (set! (-> self nav flags) (logior (nav-control-flags navcf19) (-> self nav flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (set! (-> self state-timeout) (seconds 0.1)) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-57 self) (go-virtual snow-bunny-defend) ) @@ -506,8 +467,7 @@ (dummy-58 self) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (nav-enemy-rnd-int-count 3))) (when (and (not (-> self patrol-hop-failed?)) (zero? gp-0)) (if (dummy-53 self) @@ -516,35 +476,15 @@ ) (set! (-> self patrol-hop-failed?) #f) (let ((gp-2 (min gp-0 (nav-enemy-rnd-int-count 3)))) - (ja-channel-push! 1 30) - (let ((s5-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-identity + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self nav-info idle-anim)) + :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) ) - (set! (-> s5-0 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - ) - (while #t + (loop (let ((s5-1 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) s5-1) (seconds 2.52)) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) ) (cond @@ -562,8 +502,7 @@ ) (none) ) - :post - (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) + :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) ;; definition for method 51 of type snow-bunny @@ -583,7 +522,7 @@ (collide-kind background) (-> obj collide-info process) s4-0 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -698,10 +637,8 @@ ;; failed to figure out what this is: (defstate snow-bunny-patrol-hop (snow-bunny) :virtual override - :event - snow-bunny-default-event-handler - :enter - (behavior () + :event snow-bunny-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (when (not (dummy-54 self)) (set! (-> self patrol-hop-failed?) #t) @@ -717,19 +654,16 @@ (set! (-> self turn-time) (seconds 0.1)) (none) ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 24) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (none) ) - :trans - (behavior () + :trans (behavior () (dummy-58 self) (none) ) - :code - (behavior () + :code (behavior () (snow-bunny-execute-jump) (if (-> self using-jump-event?) (set-current-poly! (-> self nav) (dummy-16 (-> self nav) (-> self collide-info trans))) @@ -742,65 +676,42 @@ ) (none) ) - :post - (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) + :post (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) ) ;; failed to figure out what this is: (defstate nav-enemy-notice (snow-bunny) :virtual #t - :event - snow-bunny-default-event-handler - :enter - (behavior () - (logior! (-> self nav-enemy-flags) 4) + :event snow-bunny-default-event-handler + :enter (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-neck-control-look-at) - (if (logtest? (-> self nav-enemy-flags) 2) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-chase) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (dummy-76 self #t) (set-vector! (-> self collide-info transv) 0.0 (nav-enemy-rnd-float-range 102400.0 131072.0) 0.0 1.0) (none) ) - :exit - (the-as (function none :behavior snow-bunny) #f) - :trans - (behavior () + :exit (the-as (function none :behavior snow-bunny) #f) + :trans (behavior () (dummy-58 self) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - ) - (set! (-> gp-0 param 0) (ja-aframe 8.0 0)) - (set! (-> gp-0 param 1) f30-0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info notice-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info notice-anim)) + :num! (seek! (ja-aframe 8.0 0) f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 8.0 0)) - (set! (-> gp-1 param 1) f30-0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 8.0 0) f30-0)) ) - (until (logtest? (-> self collide-info status) 1) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) f30-0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (until (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)) + (ja :num! (seek! max f30-0)) (+! (-> self collide-info transv y) (* -546119.7 (-> *display* seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) @@ -819,54 +730,33 @@ ) (suspend) ) - (ja-channel-push! 1 22) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self notice-land-anim)))) - (set! (-> a0-18 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self notice-land-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-18 param 1) f30-0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! - a0-18 - (the-as art-joint-anim (-> self draw art-group data (-> self notice-land-anim))) - num-func-seek! - ) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data (-> self notice-land-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) f30-0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (go-virtual nav-enemy-chase) (none) ) - :post - (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) + :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate nav-enemy-chase (snow-bunny) :virtual #t - :event - (the-as (function process int symbol event-message-block object :behavior snow-bunny) #f) - :exit - (the-as (function none :behavior snow-bunny) #f) - :trans - (the-as (function none :behavior snow-bunny) #f) - :code - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior snow-bunny) #f) + :exit (the-as (function none :behavior snow-bunny) #f) + :trans (the-as (function none :behavior snow-bunny) #f) + :code (behavior () (go-virtual snow-bunny-chase-hop) (none) ) - :post - (the-as (function none :behavior snow-bunny) #f) + :post (the-as (function none :behavior snow-bunny) #f) ) ;; definition for method 52 of type snow-bunny @@ -942,13 +832,11 @@ ;; failed to figure out what this is: (defstate snow-bunny-chase-hop (snow-bunny) :virtual override - :event - snow-bunny-default-event-handler - :enter - (behavior () + :event snow-bunny-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self should-retreat?) #f) - (if (or (not *target*) (logtest? (-> *target* state-flags) 128)) + (if (or (not *target*) (logtest? (-> *target* state-flags) (state-flags do-not-notice))) (go-virtual nav-enemy-patrol) ) (if (not (TODO-RENAME-46 self (-> self nav-info stop-chase-distance))) @@ -958,7 +846,7 @@ (go-virtual snow-bunny-defend) ) (when (not (dummy-52 self)) - (set! (-> self nav-enemy-flags) (logand -3 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-notice) ) (set-jump-height-factor! self 1) @@ -968,22 +856,19 @@ (set! (-> self turn-time) (seconds 0.1)) (none) ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 24) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-57 self) (set! (-> self should-retreat?) #t) ) (dummy-58 self) (none) ) - :code - (behavior () + :code (behavior () (snow-bunny-execute-jump) (if (-> self using-jump-event?) (set-current-poly! (-> self nav) (dummy-16 (-> self nav) (-> self collide-info trans))) @@ -994,15 +879,13 @@ (go-virtual snow-bunny-chase-hop) (none) ) - :post - (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) + :post (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) ) ;; failed to figure out what this is: (defstate snow-bunny-defend (snow-bunny) :virtual override - :code - (behavior () + :code (behavior () (if (= (-> self defense) 1) (go-virtual snow-bunny-retreat-hop) (go-virtual snow-bunny-lunge) @@ -1230,16 +1113,14 @@ ;; failed to figure out what this is: (defstate snow-bunny-retreat-hop (snow-bunny) :virtual override - :event - snow-bunny-default-event-handler - :enter - (behavior () + :event snow-bunny-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (if (not *target*) (go-virtual nav-enemy-patrol) ) (let ((v1-8 (>= 73728.0 (vector-vector-xz-distance (target-pos 0) (-> self collide-info trans))))) - (when (or (-> self should-retreat?) (and v1-8 (logtest? (-> *target* state-flags) 2))) + (when (or (-> self should-retreat?) (and v1-8 (logtest? (-> *target* state-flags) (state-flags dangerous)))) (set! (-> self retreat-timeout-time) (+ (-> *display* base-frame-counter) (the int (* 300.0 (-> self retreat-timeout)))) ) @@ -1247,7 +1128,7 @@ ) (when (or (>= (-> *display* base-frame-counter) (-> self retreat-timeout-time)) (not v1-8)) (if (or (not *target*) - (logtest? (-> *target* state-flags) 128) + (logtest? (-> *target* state-flags) (state-flags do-not-notice)) (not (TODO-RENAME-46 self (-> self nav-info stop-chase-distance))) ) (go-virtual nav-enemy-patrol) @@ -1266,19 +1147,16 @@ (set! (-> self turn-time) (seconds 0.1)) (none) ) - :exit - (behavior () - (logior! (-> self nav-enemy-flags) 24) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + :exit (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (none) ) - :trans - (behavior () + :trans (behavior () (dummy-58 self) (none) ) - :code - (behavior () + :code (behavior () (snow-bunny-execute-jump) (if (-> self using-jump-event?) (set-current-poly! (-> self nav) (dummy-16 (-> self nav) (-> self collide-info trans))) @@ -1286,23 +1164,19 @@ (go-virtual snow-bunny-retreat-hop) (none) ) - :post - (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) + :post (the-as (function none :behavior snow-bunny) nav-enemy-jump-post) ) ;; failed to figure out what this is: (defstate snow-bunny-lunge (snow-bunny) :virtual override - :event - snow-bunny-default-event-handler - :enter - (behavior () + :event snow-bunny-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (dummy-76 self #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (not *target*) (go-virtual nav-enemy-patrol) ) @@ -1312,64 +1186,41 @@ (go-virtual snow-bunny-chase-hop) ) ) - (if (not (logtest? (-> *target* state-flags) 2)) + (if (not (logtest? (-> *target* state-flags) (state-flags dangerous))) (go-virtual snow-bunny-chase-hop) ) - (if (and (logtest? (-> *target* state-flags) 2) (not (TODO-RENAME-46 self (-> self nav-info notice-distance)))) + (if (and (logtest? (-> *target* state-flags) (state-flags dangerous)) + (not (TODO-RENAME-46 self (-> self nav-info notice-distance))) + ) (go-virtual snow-bunny-retreat-hop) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - ) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) + :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate snow-bunny-attack (snow-bunny) :virtual override - :event - snow-bunny-default-event-handler - :enter - (behavior () + :event snow-bunny-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set-vector! (-> self collide-info transv) 0.0 0.0 0.0 1.0) (dummy-76 self #t) (none) ) - :trans - (behavior () + :trans (behavior () (when *target* (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 (target-pos 0) (-> self collide-info trans)) @@ -1388,38 +1239,18 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self attack-anim)))) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self attack-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self attack-anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data (-> self attack-anim)) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (until (logtest? (-> self collide-info status) 1) + (until (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)) (suspend) ) (go-virtual snow-bunny-retreat-hop) (none) ) - :post - (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) + :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) diff --git a/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc b/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc index 1f069c46c5..553bf2380b 100644 --- a/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc @@ -1,6 +1,11 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/snow-button-ag.gc") +(import "goal_src/import/flutflut-plat-med-ag.gc") +(import "goal_src/import/flutflut-plat-small-ag.gc") +(import "goal_src/import/flutflut-plat-large-ag.gc") + ;; definition of type flutflut-plat (deftype flutflut-plat (plat) ((has-path? symbol :offset-assert 264) @@ -53,12 +58,13 @@ ;; definition of type snow-button (deftype snow-button (process-drawable) - ((root-override collide-shape-moving :offset 112) - (wiggled? symbol :offset-assert 176) - (timeout time-frame :offset-assert 184) - (delay-til-wiggle time-frame :offset-assert 192) - (prev-button entity-actor :offset-assert 200) - (ticker ticky :inline :offset-assert 208) + ((root-override collide-shape-moving :offset 112) + (wiggled? symbol :offset-assert 176) + (trying-for-fuel-cell? symbol :offset-assert 180) + (timeout time-frame :offset-assert 184) + (delay-til-wiggle time-frame :offset-assert 192) + (prev-button entity-actor :offset-assert 200) + (ticker ticky :inline :offset-assert 208) ) :heap-base #x80 :method-count-assert 20 @@ -85,56 +91,42 @@ ) ;; failed to figure out what this is: -(defskelgroup *flutflut-plat-small-sg* flutflut-plat-small - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -0.5 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *flutflut-plat-small-sg* flutflut-plat-small flutflut-plat-small-lod0-jg flutflut-plat-small-idle-ja + ((flutflut-plat-small-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -0.5 0 4) + ) ;; failed to figure out what this is: -(defskelgroup *flutflut-plat-med-sg* flutflut-plat-med - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -1 0 6.75) - :longest-edge (meters 0) - ) +(defskelgroup *flutflut-plat-med-sg* flutflut-plat-med flutflut-plat-med-lod0-jg flutflut-plat-med-idle-ja + ((flutflut-plat-med-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -1 0 6.75) + ) ;; failed to figure out what this is: -(defskelgroup *flutflut-plat-large-sg* flutflut-plat-large - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *flutflut-plat-large-sg* flutflut-plat-large flutflut-plat-large-lod0-jg flutflut-plat-large-idle-ja + ((flutflut-plat-large-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 9) + ) ;; failed to figure out what this is: -(defskelgroup *snow-button-sg* snow-button - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4.3) - :longest-edge (meters 0) - ) +(defskelgroup *snow-button-sg* snow-button snow-button-lod0-jg -1 + ((snow-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.3) + ) ;; failed to figure out what this is: (defpartgroup group-flutflut-plat-small :id 516 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2087 :fade-after (meters 50) :falloff-to (meters 50)) + :parts ((sp-item 2087 :fade-after (meters 50) :falloff-to (meters 50)) (sp-item 2088 :fade-after (meters 120) :falloff-to (meters 120)) ) ) ;; failed to figure out what this is: (defpart 2087 - :init-specs - ((sp-flt spt-num 1.5) + :init-specs ((sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters -1)) (sp-rnd-flt spt-z (meters -2) (meters 4) 1.0) @@ -152,8 +144,7 @@ ;; failed to figure out what this is: (defpart 2088 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-x (meters -3) (meters 6) 1.0) (sp-flt spt-y (meters -1.25)) @@ -179,16 +170,14 @@ :id 517 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2089 :fade-after (meters 50) :falloff-to (meters 50)) + :parts ((sp-item 2089 :fade-after (meters 50) :falloff-to (meters 50)) (sp-item 2090 :fade-after (meters 120) :falloff-to (meters 120)) ) ) ;; failed to figure out what this is: (defpart 2089 - :init-specs - ((sp-flt spt-num 3.0) + :init-specs ((sp-flt spt-num 3.0) (sp-flt spt-y (meters -2.5)) (sp-int spt-rot-x 5) (sp-flt spt-r 5324.8) @@ -206,8 +195,7 @@ ;; failed to figure out what this is: (defpart 2090 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-flt spt-y (meters -2.25)) (sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) @@ -233,16 +221,14 @@ :id 518 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2091 :fade-after (meters 50) :falloff-to (meters 50)) + :parts ((sp-item 2091 :fade-after (meters 50) :falloff-to (meters 50)) (sp-item 2092 :fade-after (meters 120) :falloff-to (meters 120)) ) ) ;; failed to figure out what this is: (defpart 2091 - :init-specs - ((sp-flt spt-num 4.0) + :init-specs ((sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters -1.5)) (sp-rnd-flt spt-z (meters -6) (meters 12) 1.0) @@ -260,8 +246,7 @@ ;; failed to figure out what this is: (defpart 2092 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-flt spt-y (meters -1.25)) @@ -284,8 +269,7 @@ ;; failed to figure out what this is: (defstate snow-button-up-idle (snow-button) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-2 object)) (case arg2 (('touch 'attack 'bonk) @@ -305,16 +289,8 @@ ) ) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 2) :num! min) (transform-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -325,8 +301,7 @@ ;; failed to figure out what this is: (defstate snow-button-activate (snow-button) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('untrigger) @@ -338,8 +313,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self wiggled?) #f) (sleep (-> self ticker) (-> self timeout)) @@ -358,8 +332,7 @@ (send-to-all-after (-> self link) 'trigger) (none) ) - :trans - (behavior () + :trans (behavior () (if (completed? (-> self ticker)) (go snow-button-deactivate) ) @@ -372,39 +345,24 @@ (rider-trans) (none) ) - :code - (behavior () - (sound-play-by-name (static-sound-name "prec-button1") (new-sound-id) 1024 -1524 0 1 #t) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + :code (behavior () + (sound-play "prec-button1" :pitch -1) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 (none) ) - :post - (the-as (function none :behavior snow-button) rider-post) + :post (the-as (function none :behavior snow-button) rider-post) ) ;; failed to figure out what this is: (defstate snow-button-deactivate (snow-button) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 symbol)) (case arg2 (('query) @@ -413,43 +371,27 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :trans - (the-as (function none :behavior snow-button) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior snow-button) rider-trans) + :code (behavior () (send-to-all-after (-> self link) 'untrigger) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.6)) (suspend) ) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go snow-button-up-idle) (none) ) - :post - (the-as (function none :behavior snow-button) rider-post) + :post (the-as (function none :behavior snow-button) rider-post) ) ;; definition for method 11 of type snow-button @@ -590,8 +532,7 @@ ;; failed to figure out what this is: (defstate plat-startup (flutflut-plat) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (when (or (!= (-> self plat-type) 1) @@ -603,8 +544,7 @@ ) ) ) - :code - (behavior ((arg0 plat)) + :code (behavior ((arg0 plat)) (cond ((and (= (-> self plat-type) 1) (-> self entity) @@ -640,8 +580,7 @@ ;; failed to figure out what this is: (defstate flutflut-plat-hidden-idle (flutflut-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (logclear! (-> self mask) (process-mask actor-pause)) @@ -649,15 +588,13 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (and (= (-> self plat-type) 1) (get-lit-skel self)) (go flutflut-plat-appear) ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self root-override)) (set! (-> self root-override trans quad) (-> self appear-trans-top quad)) @@ -671,8 +608,7 @@ ;; failed to figure out what this is: (defstate flutflut-plat-appear (flutflut-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (or (= v1-0 'bonk) (= v1-0 'bounce)) (dummy-22 self) @@ -680,8 +616,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) @@ -699,13 +634,11 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (behavior () + :trans (behavior () (plat-trans) (let* ((f0-1 (fmin @@ -745,17 +678,14 @@ (dummy-20 self) (none) ) - :code - (the-as (function none :behavior flutflut-plat) anim-loop) - :post - (the-as (function none :behavior flutflut-plat) rider-post) + :code (the-as (function none :behavior flutflut-plat) anim-loop) + :post (the-as (function none :behavior flutflut-plat) rider-post) ) ;; failed to figure out what this is: (defstate plat-idle (flutflut-plat) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((or (= v1-0 'bonk) (= v1-0 'bounce)) @@ -768,8 +698,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (let ((t9-0 (-> (method-of-type plat plat-idle) enter))) (if t9-0 (t9-0) @@ -778,8 +707,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (let ((t9-0 (-> (method-of-type plat plat-idle) exit))) (if t9-0 @@ -788,8 +716,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((t9-0 (-> (method-of-type plat plat-idle) trans))) (if t9-0 (t9-0) @@ -805,8 +732,7 @@ ;; failed to figure out what this is: (defstate plat-path-active (flutflut-plat) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((or (= v1-0 'bonk) (= v1-0 'bounce)) @@ -819,8 +745,7 @@ ) ) ) - :enter - (behavior ((arg0 plat)) + :enter (behavior ((arg0 plat)) (let ((t9-0 (-> (method-of-type plat plat-path-active) enter))) (if t9-0 (t9-0 arg0) @@ -833,8 +758,7 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (let ((t9-0 (-> (method-of-type plat plat-path-active) exit))) (if t9-0 @@ -847,8 +771,7 @@ ;; failed to figure out what this is: (defstate flutflut-plat-hide (flutflut-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'bonk) (dummy-22 self) @@ -856,8 +779,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self root-override root-prim prim-core action) (collide-action ca-1)) @@ -874,14 +796,12 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self root-override root-prim prim-core action) (collide-action ca-1)) (none) ) - :trans - (behavior () + :trans (behavior () (plat-trans) (let* ((f0-1 (fmin @@ -904,16 +824,13 @@ (dummy-20 self) (none) ) - :code - (the-as (function none :behavior flutflut-plat) anim-loop) - :post - (the-as (function none :behavior flutflut-plat) rider-post) + :code (the-as (function none :behavior flutflut-plat) anim-loop) + :post (the-as (function none :behavior flutflut-plat) rider-post) ) ;; failed to figure out what this is: (defstate elevator-idle-at-cave (flutflut-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -935,28 +852,23 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self path-pos) 0.0) (eval-path-curve! (-> self path) (-> self basetrans) 0.0 'interp) (none) ) - :trans - (behavior () + :trans (behavior () (plat-trans) (dummy-20 self) (none) ) - :code - (the-as (function none :behavior flutflut-plat) anim-loop) - :post - (the-as (function none :behavior flutflut-plat) plat-post) + :code (the-as (function none :behavior flutflut-plat) anim-loop) + :post (the-as (function none :behavior flutflut-plat) plat-post) ) ;; failed to figure out what this is: (defstate elevator-travel-to-fort (flutflut-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (or (= v1-0 'bonk) (= v1-0 'bounce)) (dummy-22 self) @@ -964,28 +876,24 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (= (-> self path-pos) 1.0) (dummy-22 self) (go elevator-idle-at-fort) ) - (set! (-> self path-pos) (seek (-> self path-pos) 1.0 (* 0.06666667 (-> *display* seconds-per-frame)))) + (seek! (-> self path-pos) 1.0 (* 0.06666667 (-> *display* seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (plat-trans) (dummy-20 self) (none) ) - :code - (the-as (function none :behavior flutflut-plat) anim-loop) - :post - (the-as (function none :behavior flutflut-plat) plat-post) + :code (the-as (function none :behavior flutflut-plat) anim-loop) + :post (the-as (function none :behavior flutflut-plat) plat-post) ) ;; failed to figure out what this is: (defstate elevator-idle-at-fort (flutflut-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (or (= v1-0 'bonk) (= v1-0 'bounce)) (dummy-22 self) @@ -993,18 +901,16 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self path-pos) 1.0) (eval-path-curve! (-> self path) (-> self basetrans) 1.0 'interp) (none) ) - :trans - (behavior () + :trans (behavior () (when *target* (if (and (>= 798720.0 (-> (target-pos 0) y)) - (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) @@ -1015,16 +921,13 @@ (dummy-20 self) (none) ) - :code - (the-as (function none :behavior flutflut-plat) anim-loop) - :post - (the-as (function none :behavior flutflut-plat) plat-post) + :code (the-as (function none :behavior flutflut-plat) anim-loop) + :post (the-as (function none :behavior flutflut-plat) plat-post) ) ;; failed to figure out what this is: (defstate elevator-travel-to-cave (flutflut-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (or (= v1-0 'bonk) (= v1-0 'bounce)) (dummy-22 self) @@ -1032,22 +935,19 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (= (-> self path-pos) 0.0) (dummy-22 self) (go elevator-idle-at-cave) ) - (set! (-> self path-pos) (seek (-> self path-pos) 0.0 (* 0.06666667 (-> *display* seconds-per-frame)))) + (seek! (-> self path-pos) 0.0 (* 0.06666667 (-> *display* seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (plat-trans) (dummy-20 self) (none) ) - :code - (the-as (function none :behavior flutflut-plat) anim-loop) - :post - (the-as (function none :behavior flutflut-plat) plat-post) + :code (the-as (function none :behavior flutflut-plat) anim-loop) + :post (the-as (function none :behavior flutflut-plat) plat-post) ) ;; definition of type flutflut-plat-small diff --git a/test/decompiler/reference/levels/snow/snow-obs_REF.gc b/test/decompiler/reference/levels/snow/snow-obs_REF.gc index 0a80ae234c..e3a62795c3 100644 --- a/test/decompiler/reference/levels/snow/snow-obs_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-obs_REF.gc @@ -1,6 +1,15 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/snowcam-ag.gc") +(import "goal_src/import/snow-fort-gate-ag.gc") +(import "goal_src/import/snow-eggtop-ag.gc") +(import "goal_src/import/snow-spatula-ag.gc") +(import "goal_src/import/snow-switch-ag.gc") +(import "goal_src/import/snow-gears-ag.gc") +(import "goal_src/import/snowpusher-ag.gc") +(import "goal_src/import/snow-log-ag.gc") + ;; definition of type snowcam (deftype snowcam (pov-camera) ((seq uint64 :offset-assert 224) @@ -21,13 +30,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *snowcam-sg* snowcam - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *snowcam-sg* snowcam snowcam-lod0-jg -1 + ((snowcam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) ;; definition for method 29 of type snowcam (defmethod set-stack-size! snowcam ((obj snowcam)) @@ -38,61 +44,24 @@ ;; failed to figure out what this is: (defstate pov-camera-playing (snowcam) :virtual #t - :code - (behavior () + :code (behavior () (let ((v1-0 (-> self seq))) (cond ((zero? v1-0) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 0.2) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! max 0.2) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 0.2) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 0.25) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) + (ja :num! (seek! max 0.2)) ) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.25) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 0.25) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + (ja :num! (seek! max 0.25)) ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-0 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 4.5)) @@ -101,29 +70,28 @@ ) ) ((= v1-0 1) - (let* ((gp-1 (get-process *default-dead-pool* fuel-cell #x4000)) - (gp-2 - (ppointer->handle - (when gp-1 - (let ((t9-10 (method-of-type fuel-cell activate))) - (t9-10 (the-as fuel-cell gp-1) (ppointer->process (-> self parent)) 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 fuel-cell-init-as-clone (process->handle self) (-> self entity extra perm task)) - (-> gp-1 ppointer) - ) - ) - ) - ) - (push-setting! *setting-control* self 'music-volume 'abs 0.0 0) - (push-setting! *setting-control* self 'sfx-volume 'rel 50.0 0) + (let ((gp-2 + (ppointer->handle + (process-spawn + fuel-cell + :init fuel-cell-init-as-clone + (process->handle self) + (-> self entity extra perm task) + :to (ppointer->process (-> self parent)) + ) + ) + ) + ) + (add-setting! 'music-volume 'abs 0.0 0) + (add-setting! 'sfx-volume 'rel 50.0 0) (ja-play-spooled-anim (the-as spool-anim (-> self anim-name)) (the-as art-joint-anim #f) (the-as art-joint-anim #f) (the-as (function process-drawable symbol) false-func) ) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) (let ((a0-21 (handle->process gp-2))) (if a0-21 (send-event a0-21 'stop-cloning) @@ -132,40 +100,16 @@ ) ) ((= v1-0 2) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event (handle->process (-> self notify-handle)) 'notify 'cut) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-31 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-31 param 1) 1.0) - (set! (-> a0-31 frame-num) 0.0) - (joint-control-channel-group! a0-31 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-32 (-> self skel root-channel 0))) - (set! (-> a0-32 param 0) (the float (+ (-> a0-32 frame-group data 0 length) -1))) - (set! (-> a0-32 param 1) 1.0) - (joint-control-channel-group-eval! a0-32 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else @@ -207,20 +151,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *snow-eggtop-sg* snow-eggtop - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *snow-eggtop-sg* snow-eggtop snow-eggtop-lod0-jg snow-eggtop-idle-ja + ((snow-eggtop-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; failed to figure out what this is: (defpartgroup group-snow-yellow-eco-room-open :id 510 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 1990 :fade-after (meters 110)) + :parts ((sp-item 1990 :fade-after (meters 110)) (sp-item 1991 :fade-after (meters 110)) (sp-item 1992 :fade-after (meters 110)) (sp-item 1993 :fade-after (meters 110)) @@ -233,14 +173,12 @@ :id 511 :duration 900 :bounds (static-bspherem 0 -6 0 8) - :parts - ((sp-item 1994) (sp-item 1994) (sp-item 1995 :flags (bit1) :period 1200 :length 15)) + :parts ((sp-item 1994) (sp-item 1994) (sp-item 1995 :flags (bit1) :period 1200 :length 15)) ) ;; failed to figure out what this is: (defpart 1995 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 30.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 20) (meters 10) 1.0) @@ -262,20 +200,17 @@ ;; failed to figure out what this is: (defpart 1996 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 225) (sp-launcher-by-id spt-next-launcher 1997)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 225) (sp-launcher-by-id spt-next-launcher 1997)) ) ;; failed to figure out what this is: (defpart 1997 - :init-specs - ((sp-flt spt-fade-a -0.14222223)) + :init-specs ((sp-flt spt-fade-a -0.14222223)) ) ;; failed to figure out what this is: (defpart 1990 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 10) (meters 2) 1.0) @@ -291,8 +226,7 @@ ;; failed to figure out what this is: (defpart 1991 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) @@ -308,8 +242,7 @@ ;; failed to figure out what this is: (defpart 1992 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) @@ -330,8 +263,7 @@ ;; failed to figure out what this is: (defpart 1998 - :init-specs - ((sp-flt spt-r 64.0) + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) (sp-flt spt-fade-r -1.0) (sp-flt spt-fade-g -1.0) @@ -341,8 +273,7 @@ ;; failed to figure out what this is: (defpart 1993 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-flt spt-y (meters -4)) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) @@ -363,8 +294,7 @@ ;; failed to figure out what this is: (defpart 1994 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-y (meters -6.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 2) 1.0) @@ -388,8 +318,7 @@ ;; failed to figure out what this is: (defstate snow-eggtop-idle-up (snow-eggtop) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'notify) (case (-> arg3 param 0) @@ -403,8 +332,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (and (not (-> self child)) (task-complete? *game-info* (-> self entity extra perm task))) (go snow-eggtop-activate) ) @@ -412,19 +340,11 @@ (update! (-> self sound)) (none) ) - :code - (behavior () + :code (behavior () (ja-channel-push! 1 0) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 2) :num! min) (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -434,8 +354,7 @@ ;; failed to figure out what this is: (defstate snow-eggtop-activate (snow-eggtop) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notify) (when (= (-> arg0 type) snowcam) @@ -456,85 +375,56 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) (set! (-> self play-sound?) #t) (none) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :trans - (the-as (function none :behavior snow-eggtop) rider-trans) - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 511) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + :trans (the-as (function none :behavior snow-eggtop) rider-trans) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 511) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) - (let* ((gp-1 (get-process *default-dead-pool* snowcam #x4000)) - (v1-7 - (when gp-1 - (let ((t9-4 (method-of-type snowcam activate))) - (t9-4 (the-as snowcam gp-1) self 'snowcam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (-> self spawn-trans) - *snowcam-sg* - "gearstart" - 0 - self - '((0 ambient camera "gamcam38") (10 alive "ecovent-278")) - ) - (-> gp-1 ppointer) - ) - ) - ) + (let ((v1-7 + (process-spawn + snowcam + :init pov-camera-init-by-other + (-> self spawn-trans) + *snowcam-sg* + "gearstart" + 0 + self + '((0 ambient camera "gamcam38") (10 alive "ecovent-278")) + :to self + ) + ) + ) (set! (-> (the-as snowcam (-> v1-7 0)) seq) (the-as uint 2)) ) (change-sound! (-> self sound) (static-sound-name "snw-eggtop-seq")) (save-reminder (get-task-control (-> self entity extra perm task)) 2 4) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (-> self play-sound?) (update! (-> self sound)) ) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (level-hint-spawn (game-text-id snowy-turned-on-yellow-vents) @@ -557,7 +447,7 @@ ) ) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'show) - (while #t + (loop (if (-> self play-sound?) (update! (-> self sound)) ) @@ -565,14 +455,12 @@ ) (none) ) - :post - (the-as (function none :behavior snow-eggtop) rider-post) + :post (the-as (function none :behavior snow-eggtop) rider-post) ) ;; failed to figure out what this is: (defstate snow-eggtop-idle-down (snow-eggtop) - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) (let ((a0-1 (-> self entity))) (if (and a0-1 (= self (-> a0-1 extra process))) @@ -580,16 +468,7 @@ ) ) (ja-channel-push! 1 0) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - ) + (ja :group! (-> self draw art-group data 2) :num! max) (transform-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -629,19 +508,8 @@ (set! (-> obj root-override trans y) (+ -2662.4 (-> obj root-override trans y))) (update-transforms! (-> obj root-override)) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 510) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "electric-loop") - :volume #x400 - :fo-max 40 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "electric-loop" :fo-max 40) (-> obj root-override trans)) ) (cond ((task-complete? *game-info* (-> obj entity extra perm task)) @@ -697,35 +565,27 @@ ) ;; failed to figure out what this is: -(defskelgroup *snowpusher-sg* snowpusher - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *snowpusher-sg* snowpusher snowpusher-lod0-jg snowpusher-idle-ja + ((snowpusher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) ;; failed to figure out what this is: (defstate snowpusher-idle (snowpusher) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) #f ) ) ) ) - :code - (behavior () + :code (behavior () (let ((gp-0 #f)) - (while #t + (loop (let ((f0-0 (get-current-phase-with-mirror (-> self sync)))) - (let ((v1-4 (-> self skel root-channel 0))) - (set! (-> v1-4 num-func) num-func-identity) - (set! (-> v1-4 frame-num) (* f0-0 (-> self max-frame))) - ) + (ja :num-func num-func-identity :frame-num (* f0-0 (-> self max-frame))) (cond ((or (= f0-0 0.0) (= f0-0 1.0)) (set! gp-0 #f) @@ -734,8 +594,8 @@ (when (not gp-0) (set! gp-0 #t) (if (>= f0-0 0.5) - (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) + (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) ) ) ) @@ -746,8 +606,7 @@ ) (none) ) - :post - (the-as (function none :behavior snowpusher) pusher-post) + :post (the-as (function none :behavior snowpusher) pusher-post) ) ;; definition for method 11 of type snowpusher @@ -842,34 +701,29 @@ ) ;; failed to figure out what this is: -(defskelgroup *snow-spatula-sg* snow-spatula - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 10 0 10) - :longest-edge (meters 9.4) - ) +(defskelgroup *snow-spatula-sg* snow-spatula snow-spatula-lod0-jg snow-spatula-idle-ja + ((snow-spatula-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 10) + :longest-edge (meters 9.4) + ) ;; failed to figure out what this is: (defstate snow-spatula-idle (snow-spatula) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'bonk) (dummy-22 self) - (sound-play-by-name (static-sound-name "snow-spat-short") (new-sound-id) 768 1143 0 1 #t) + (sound-play "snow-spat-short" :vol 75 :pitch 0.75) ) ) ) ) - :trans - (the-as (function none :behavior snow-spatula) plat-trans) - :code - (behavior () + :trans (the-as (function none :behavior snow-spatula) plat-trans) + :code (behavior () (let ((f28-0 0.0) (gp-0 1) ) - (while #t + (loop (let ((f30-0 (get-current-phase-with-mirror (-> self sync)))) (when (!= f30-0 f28-0) (let ((v1-3 1)) @@ -880,26 +734,10 @@ (set! gp-0 v1-3) (cond ((> v1-3 0) - (sound-play-by-name - (static-sound-name "snow-spat-long") - (new-sound-id) - 1024 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-long" :pitch (rand-vu-float-range -0.2 0.2)) ) (1 - (sound-play-by-name - (static-sound-name "snow-spat-short") - (new-sound-id) - 1024 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-short" :pitch (rand-vu-float-range -0.2 0.2)) ) ) ) @@ -917,8 +755,7 @@ ) (none) ) - :post - (the-as (function none :behavior snow-spatula) plat-post) + :post (the-as (function none :behavior snow-spatula) plat-post) ) ;; definition for method 11 of type snow-spatula @@ -987,27 +824,23 @@ ) ;; failed to figure out what this is: -(defskelgroup *snow-fort-gate-sg* snow-fort-gate - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 15 0 24) - :longest-edge (meters 12.8) - ) +(defskelgroup *snow-fort-gate-sg* snow-fort-gate snow-fort-gate-lod0-jg -1 + ((snow-fort-gate-lod0-mg (meters 999999))) + :bounds (static-spherem 0 15 0 24) + :longest-edge (meters 12.8) + ) ;; failed to figure out what this is: (defpartgroup group-snow-fort-gate-coming-down :id 512 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1896)) + :parts ((sp-item 1896)) ) ;; failed to figure out what this is: (defpart 1896 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) @@ -1034,8 +867,7 @@ ;; failed to figure out what this is: (defpart 1897 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: @@ -1043,14 +875,12 @@ :id 513 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1898)) + :parts ((sp-item 1898)) ) ;; failed to figure out what this is: (defpart 1898 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 64.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) @@ -1078,16 +908,14 @@ ;; failed to figure out what this is: (defpart 1899 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) ;; failed to figure out what this is: (defpartgroup group-snow-fort-gate-snowdrops :id 514 :bounds (static-bspherem 0 -16 0 32) - :parts - ((sp-item 2271 :fade-after (meters 100) :falloff-to (meters 130) :period 1200 :length 150) + :parts ((sp-item 2271 :fade-after (meters 100) :falloff-to (meters 130) :period 1200 :length 150) (sp-item 2271 :fade-after (meters 100) :falloff-to (meters 130) :period 1200 :length 100) (sp-item 2271 :fade-after (meters 100) :falloff-to (meters 130) :period 1200 :length 60) (sp-item 2271 :fade-after (meters 100) :falloff-to (meters 130) :period 1200 :length 30) @@ -1107,8 +935,7 @@ ;; failed to figure out what this is: (defpart 2271 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) @@ -1131,14 +958,12 @@ ;; failed to figure out what this is: (defpart 2274 - :init-specs - ((sp-flt spt-fade-a -0.42666668)) + :init-specs ((sp-flt spt-fade-a -0.42666668)) ) ;; failed to figure out what this is: (defpart 2272 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 1)) @@ -1162,8 +987,7 @@ ;; failed to figure out what this is: (defpart 2273 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 1)) @@ -1184,16 +1008,14 @@ ;; failed to figure out what this is: (defstate snow-fort-gate-idle-closed (snow-fort-gate) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notice) (go snow-fort-gate-activate) ) ) ) - :trans - (behavior () + :trans (behavior () (when (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (level-hint-spawn (game-text-id snow-fort-reminder) @@ -1206,20 +1028,12 @@ ) (none) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 2) :num! min) (set! (-> self root-override trans quad) (-> self closed-trans quad)) (transform-post) (suspend) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -1229,21 +1043,18 @@ ;; failed to figure out what this is: (defstate snow-fort-gate-activate (snow-fort-gate) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 #f)) - (while #t + (loop (let ((a1-0 (new 'stack-no-clear 'vector))) (set! (-> a1-0 quad) (-> self closed-trans quad)) (set! (-> a1-0 y) (+ -12288.0 (-> a1-0 y))) @@ -1263,7 +1074,7 @@ ) ) (when (>= 1677.7216 f30-0) - (sound-play-by-name (static-sound-name "lodge-close") (new-sound-id) 1024 0 0 1 #t) + (sound-play "lodge-close") (activate! *camera-smush-control* 819.2 37 150 1.0 0.99) (go snow-fort-gate-idle-open) ) @@ -1284,27 +1095,18 @@ ) (none) ) - :post - (the-as (function none :behavior snow-fort-gate) transform-post) + :post (the-as (function none :behavior snow-fort-gate) transform-post) ) ;; failed to figure out what this is: (defstate snow-fort-gate-idle-open (snow-fort-gate) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 2) :num! min) (set! (-> self root-override trans quad) (-> self open-trans quad)) (transform-post) (suspend) (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -1366,19 +1168,8 @@ (set! (-> obj closed-trans quad) (-> obj open-trans quad)) (set! (-> obj open-trans y) (+ -141312.0 (-> obj open-trans y))) (set! (-> obj open-trans z) (+ 32768.0 (-> obj open-trans z))) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "lodge-door-mov") - :volume #x400 - :fo-max 80 - ) - (-> obj open-trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "lodge-door-mov" :fo-max 80) (-> obj open-trans)) ) (ja-channel-push! 1 0) (let ((s5-1 (-> obj skel root-channel 0))) @@ -1431,27 +1222,23 @@ ) ;; failed to figure out what this is: -(defskelgroup *snow-gears-sg* snow-gears - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 60) - :longest-edge (meters 12.1) - ) +(defskelgroup *snow-gears-sg* snow-gears snow-gears-lod0-jg snow-gears-idle-ja + ((snow-gears-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 60) + :longest-edge (meters 12.1) + ) ;; failed to figure out what this is: (defpartgroup group-snow-gears-dripping :id 515 :flags (use-local-clock) :bounds (static-bspherem 0 -4 0 16) - :parts - ((sp-item 1900) (sp-item 1901)) + :parts ((sp-item 1900) (sp-item 1901)) ) ;; failed to figure out what this is: (defpart 1900 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -9) (meters 18) 1.0) (sp-flt spt-y (meters -6)) @@ -1475,8 +1262,7 @@ ;; failed to figure out what this is: (defpart 1901 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -7)) (sp-rnd-flt spt-scale-x (meters 3) (meters 4.5) 1.0) @@ -1502,8 +1288,7 @@ ;; failed to figure out what this is: (defpart 1902 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 450 239 1) (sp-launcher-by-id spt-next-launcher 1903) ) @@ -1511,8 +1296,7 @@ ;; failed to figure out what this is: (defpart 1903 - :init-specs - ((sp-flt spt-fade-a -0.14222223)) + :init-specs ((sp-flt spt-fade-a -0.14222223)) ) ;; definition for method 20 of type snow-gears @@ -1529,8 +1313,7 @@ ;; failed to figure out what this is: (defstate snow-gears-idle (snow-gears) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notice) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1539,18 +1322,10 @@ ) ) ) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + :code (behavior () + (ja :group! (-> self draw art-group data 2) :num! min) (ja-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -1560,58 +1335,25 @@ ;; failed to figure out what this is: (defstate snow-gears-activate (snow-gears) - :trans - (behavior () + :trans (behavior () (TODO-RENAME-20 self) (none) ) - :code - (behavior () - (sound-play-by-name (static-sound-name "eng-start-up") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 0.85) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :code (behavior () + (sound-play "eng-start-up") + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.85) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 0.85) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 0.35) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + (ja :num! (seek! max 0.85)) ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max 0.35) :frame-num 0.0) (until (ja-done? 0) (update! (-> self sound)) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 0.35) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.35)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 2) :num! min) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) (update! (-> self sound)) (suspend) @@ -1619,75 +1361,45 @@ (go snow-gears-halt) (none) ) - :post - (the-as (function none :behavior snow-gears) ja-post) + :post (the-as (function none :behavior snow-gears) ja-post) ) ;; failed to figure out what this is: (defstate snow-gears-halt (snow-gears) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (none) ) - :trans - (behavior () + :trans (behavior () (TODO-RENAME-20 self) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 0.35) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max 0.35) :frame-num 0.0) (until (ja-done? 0) (update! (-> self sound)) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 0.35) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.35)) ) (stop! (-> self sound)) - (sound-play-by-name (static-sound-name "eng-shut-down") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 0.85) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (sound-play "eng-shut-down") + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek! max 0.85) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 0.85) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.85)) ) (go snow-gears-stopped) (none) ) - :post - (the-as (function none :behavior snow-gears) ja-post) + :post (the-as (function none :behavior snow-gears) ja-post) ) ;; failed to figure out what this is: (defstate snow-gears-stopped (snow-gears) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -1702,19 +1414,8 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *snow-gears-sg* '()) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 515) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "snow-engine") - :volume #x400 - :fo-max #x12c - ) - (-> obj root trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "snow-engine" :fo-max 300) (-> obj root trans)) ) (go snow-gears-idle) (none) @@ -1750,13 +1451,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *snow-switch-sg* snow-switch - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *snow-switch-sg* snow-switch snow-switch-lod0-jg snow-switch-idle-ja + ((snow-switch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) ;; definition for function snow-switch-event-handler (defbehavior snow-switch-event-handler snow-switch ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) @@ -1788,11 +1486,9 @@ ;; failed to figure out what this is: (defstate snow-switch-idle-up (snow-switch) - :event - snow-switch-event-handler - :code - (behavior () - (while #t + :event snow-switch-event-handler + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -1802,24 +1498,20 @@ ;; failed to figure out what this is: (defstate snow-switch-activate (snow-switch) - :event - snow-switch-event-handler - :exit - (behavior () + :event snow-switch-event-handler + :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (the-as (function none :behavior snow-switch) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior snow-switch) rider-trans) + :code (behavior () (local-vars (v1-1 symbol)) (until v1-1 (suspend) - (set! v1-1 (or (not *target*) (zero? (logand (-> *target* state-flags) 256)))) + (set! v1-1 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) ) - (sound-play-by-name (static-sound-name "prec-button1") (new-sound-id) 1024 -1524 0 1 #t) + (sound-play "prec-button1" :pitch -1) (let ((gp-1 (get-process *default-dead-pool* snowcam #x4000))) (set! (-> (the-as snowcam (-> (when gp-1 (let ((t9-3 (method-of-type snowcam activate))) @@ -1847,7 +1539,7 @@ ) 0 (let ((gp-2 #f)) - (while #t + (loop (let ((s5-1 (new 'stack-no-clear 'vector)) (f0-1 (+ -1433.6 (-> self orig-trans y))) ) @@ -1872,21 +1564,18 @@ ) (none) ) - :post - (the-as (function none :behavior snow-switch) rider-post) + :post (the-as (function none :behavior snow-switch) rider-post) ) ;; failed to figure out what this is: (defstate snow-switch-idle-down (snow-switch) - :event - snow-switch-event-handler - :code - (behavior () + :event snow-switch-event-handler + :code (behavior () (set! (-> self pressed?) #t) (set! (-> self root-override trans quad) (-> self orig-trans quad)) (set! (-> self root-override trans y) (+ -1433.6 (-> self root-override trans y))) (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -1988,27 +1677,22 @@ ) ;; failed to figure out what this is: -(defskelgroup *snow-log-sg* snow-log - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 5 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *snow-log-sg* snow-log snow-log-lod0-jg -1 + ((snow-log-lod0-mg (meters 999999))) + :bounds (static-spherem 0 5 0 9) + ) ;; failed to figure out what this is: (defstate snow-log-wait-for-master (snow-log) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go snow-log-activate) ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (while (let ((v1-0 (-> self master))) (not (if v1-0 (-> v1-0 extra process) @@ -2025,19 +1709,14 @@ ) ) (when a0-1 - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 0) - (set! (-> a1-0 message) 'query) - (cond - ((send-event-function a0-1 a1-0) - (logclear! (-> self mask) (process-mask actor-pause)) - (process-entity-status! self (entity-perm-status bit-3) #t) - (go snow-log-active) - ) - (else - (go snow-log-hidden) - ) + (cond + ((send-event a0-1 'query) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-entity-status! self (entity-perm-status bit-3) #t) + (go snow-log-active) + ) + (else + (go snow-log-hidden) ) ) ) @@ -2049,8 +1728,7 @@ ;; failed to figure out what this is: (defstate snow-log-hidden (snow-log) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (logclear! (-> self mask) (process-mask actor-pause)) @@ -2059,17 +1737,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (ja-channel-push! 1 0) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 2) :num! min) (transform-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -2080,123 +1750,75 @@ ;; failed to figure out what this is: (defstate snow-log-activate (snow-log) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :trans - (the-as (function none :behavior snow-log) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior snow-log) rider-trans) + :code (behavior () (activate! *camera-smush-control* 819.2 37 150 1.0 0.99) (ja-channel-push! 1 0) (let ((gp-0 #f)) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (not gp-0) (>= (ja-frame-num 0) 5.0)) (set! gp-0 #t) - (sound-play-by-name (static-sound-name "explosion") (new-sound-id) 409 1371 0 1 #t) - (sound-play-by-name (static-sound-name "snow-spat-short") (new-sound-id) 1024 381 0 1 #t) + (sound-play "explosion" :vol 40 :pitch 0.9) + (sound-play "snow-spat-short" :pitch 0.25) ) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (go snow-log-active) (none) ) - :post - (the-as (function none :behavior snow-log) rider-post) + :post (the-as (function none :behavior snow-log) rider-post) ) ;; failed to figure out what this is: (defstate snow-log-active (snow-log) - :trans - (the-as (function none :behavior snow-log) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior snow-log) rider-trans) + :code (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) (logclear! (-> self draw status) (draw-status hidden)) - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) (let ((gp-0 #t) (s5-0 #t) ) - (while #t - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 0.25) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.25) :frame-num 0.0) (until (ja-done? 0) (let ((f0-4 (ja-aframe-num 0))) (cond ((and gp-0 (< f0-4 1.0)) (set! gp-0 #f) (set! s5-0 #t) - (sound-play-by-name - (static-sound-name "snow-spat-long") - (new-sound-id) - 870 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-long" :vol 85 :pitch (rand-vu-float-range -0.2 0.2)) ) ((and s5-0 (>= f0-4 11.0)) (set! s5-0 #f) (set! gp-0 #t) - (sound-play-by-name - (static-sound-name "snow-spat-short") - (new-sound-id) - 870 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-short" :vol 85 :pitch (rand-vu-float-range -0.2 0.2)) ) ) ) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 0.25) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.25)) ) ) ) (none) ) - :post - (the-as (function none :behavior snow-log) rider-post) + :post (the-as (function none :behavior snow-log) rider-post) ) ;; definition for method 11 of type snow-log @@ -2296,11 +1918,9 @@ ;; failed to figure out what this is: (defstate snow-log-button-idle-up (snow-log-button) - :event - snow-log-button-event-handler - :code - (behavior () - (while #t + :event snow-log-button-event-handler + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -2310,20 +1930,16 @@ ;; failed to figure out what this is: (defstate snow-log-button-activate (snow-log-button) - :event - snow-log-button-event-handler - :exit - (behavior () + :event snow-log-button-event-handler + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :trans - (the-as (function none :behavior snow-log-button) rider-trans) - :code - (behavior () - (sound-play-by-name (static-sound-name "prec-button1") (new-sound-id) 1024 0 0 1 #t) - (while #t + :trans (the-as (function none :behavior snow-log-button) rider-trans) + :code (behavior () + (sound-play "prec-button1") + (loop (let ((f30-0 (+ -1433.6 (-> self orig-trans y)))) (when (= (-> self root-override trans y) f30-0) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -2356,20 +1972,17 @@ ) (none) ) - :post - (the-as (function none :behavior snow-log-button) rider-post) + :post (the-as (function none :behavior snow-log-button) rider-post) ) ;; failed to figure out what this is: (defstate snow-log-button-idle-down (snow-log-button) - :event - snow-log-button-event-handler - :code - (behavior () + :event snow-log-button-event-handler + :code (behavior () (set! (-> self root-override trans quad) (-> self orig-trans quad)) (set! (-> self root-override trans y) (+ -1433.6 (-> self root-override trans y))) (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) diff --git a/test/decompiler/reference/levels/snow/snow-part_REF.gc b/test/decompiler/reference/levels/snow/snow-part_REF.gc index 83e06d68b9..79a2317029 100644 --- a/test/decompiler/reference/levels/snow/snow-part_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-part_REF.gc @@ -22,8 +22,7 @@ (defpartgroup group-snow-snowdrops1 :id 528 :bounds (static-bspherem 0 -16 0 32) - :parts - ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 2700 :length 150) + :parts ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 2700 :length 150) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 2700 :length 100) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 2700 :length 60) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 2700 :length 30) @@ -45,8 +44,7 @@ (defpartgroup group-snow-snowdrops2 :id 529 :bounds (static-bspherem 0 -16 0 32) - :parts - ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3068 :length 150 :offset 900) + :parts ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3068 :length 150 :offset 900) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3068 :length 100 :offset 900) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3068 :length 60 :offset 900) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3068 :length 30 :offset 900) @@ -68,8 +66,7 @@ (defpartgroup group-snow-snowdrops3 :id 530 :bounds (static-bspherem 0 -16 0 32) - :parts - ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3345 :length 150 :offset 1800) + :parts ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3345 :length 150 :offset 1800) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3345 :length 100 :offset 1800) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3345 :length 60 :offset 1800) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 3345 :length 30 :offset 1800) @@ -91,8 +88,7 @@ (defpartgroup group-snow-snowdrops4 :id 531 :bounds (static-bspherem 0 -16 0 32) - :parts - ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 4035 :length 150 :offset 300) + :parts ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 4035 :length 150 :offset 300) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 4035 :length 100 :offset 300) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 4035 :length 60 :offset 300) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 4035 :length 30 :offset 300) @@ -114,8 +110,7 @@ (defpartgroup group-snow-snowdrops5 :id 532 :bounds (static-bspherem 0 -16 0 32) - :parts - ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 5385 :length 150 :offset 1200) + :parts ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 5385 :length 150 :offset 1200) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 5385 :length 100 :offset 1200) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 5385 :length 60 :offset 1200) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 5385 :length 30 :offset 1200) @@ -137,8 +132,7 @@ (defpartgroup group-snow-snowdrops6 :id 533 :bounds (static-bspherem 0 -16 0 32) - :parts - ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 6129 :length 150 :offset 2100) + :parts ((sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 6129 :length 150 :offset 2100) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 6129 :length 100 :offset 2100) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 6129 :length 60 :offset 2100) (sp-item 1924 :fade-after (meters 100) :falloff-to (meters 130) :period 6129 :length 30 :offset 2100) @@ -158,8 +152,7 @@ ;; failed to figure out what this is: (defpart 1924 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) @@ -182,14 +175,12 @@ ;; failed to figure out what this is: (defpart 1927 - :init-specs - ((sp-flt spt-fade-a -0.42666668)) + :init-specs ((sp-flt spt-fade-a -0.42666668)) ) ;; failed to figure out what this is: (defpart 1925 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 1)) @@ -213,8 +204,7 @@ ;; failed to figure out what this is: (defpart 1926 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 1)) @@ -237,8 +227,7 @@ (defpartgroup group-part-snow-torch :id 534 :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 2041 :fade-after (meters 200) :falloff-to (meters 220)) + :parts ((sp-item 2041 :fade-after (meters 200) :falloff-to (meters 220)) (sp-item 2042 :fade-after (meters 140) :falloff-to (meters 1400)) (sp-item 2043 :fade-after (meters 50) :falloff-to (meters 50) :period 600 :length 90) (sp-item 2044 :fade-after (meters 50) :falloff-to (meters 50) :period 369 :length 69) @@ -249,8 +238,7 @@ ;; failed to figure out what this is: (defpart 2046 - :init-specs - ((sp-flt spt-num 0.3) + :init-specs ((sp-flt spt-num 0.3) (sp-flt spt-x (meters 0.2)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-int spt-rot-x 5) @@ -269,14 +257,12 @@ ;; failed to figure out what this is: (defpart 2047 - :init-specs - ((sp-flt spt-fade-b -6.826667)) + :init-specs ((sp-flt spt-fade-b -6.826667)) ) ;; failed to figure out what this is: (defpart 2041 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1069547520 1 1.0) (sp-rnd-flt spt-x (meters -0.35) (meters 0.7) 1.0) (sp-rnd-flt spt-z (meters -0.35) (meters 0.7) 1.0) @@ -299,14 +285,12 @@ ;; failed to figure out what this is: (defpart 2048 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) ;; failed to figure out what this is: (defpart 2043 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters 1)) @@ -330,8 +314,7 @@ ;; failed to figure out what this is: (defpart 2044 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.2) (meters 0.6) 1.0) (sp-flt spt-y (meters 0.5)) @@ -355,8 +338,7 @@ ;; failed to figure out what this is: (defpart 2045 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 0.2) 1.0) (sp-flt spt-y (meters 0.6)) @@ -380,8 +362,7 @@ ;; failed to figure out what this is: (defpart 2042 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.3)) @@ -416,8 +397,7 @@ ;; failed to figure out what this is: (defpart 2093 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-rnd-flt spt-y (meters -30) (meters 20) 1.0) @@ -444,16 +424,14 @@ ;; failed to figure out what this is: (defpart 2094 - :init-specs - ((sp-flt spt-fade-a -0.035555556)) + :init-specs ((sp-flt spt-fade-a -0.035555556)) ) ;; failed to figure out what this is: (defpartgroup group-snow-door-torch :id 536 :bounds (static-bspherem 0 5 0 6) - :parts - ((sp-item 2113 :fade-after (meters 240) :falloff-to (meters 240)) + :parts ((sp-item 2113 :fade-after (meters 240) :falloff-to (meters 240)) (sp-item 2114 :fade-after (meters 40) :falloff-to (meters 40) :period 492 :length 60) (sp-item 2115 :fade-after (meters 240) :falloff-to (meters 240)) (sp-item 2116 :fade-after (meters 40) :falloff-to (meters 40) :period 369 :length 219) @@ -466,8 +444,7 @@ ;; failed to figure out what this is: (defpart 2120 - :init-specs - ((sp-flt spt-num 0.6) + :init-specs ((sp-flt spt-num 0.6) (sp-rnd-flt spt-x (meters 0) (meters 2) 1.0) (sp-flt spt-y (meters 2)) (sp-int spt-rot-x 5) @@ -486,14 +463,12 @@ ;; failed to figure out what this is: (defpart 2121 - :init-specs - ((sp-flt spt-fade-b -10.922667)) + :init-specs ((sp-flt spt-fade-b -10.922667)) ) ;; failed to figure out what this is: (defpart 2113 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.75 0.6 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -521,8 +496,7 @@ ;; failed to figure out what this is: (defpart 2114 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1058642330 1 1.3) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -550,8 +524,7 @@ ;; failed to figure out what this is: (defpart 2115 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.6 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 1)) @@ -581,8 +554,7 @@ ;; failed to figure out what this is: (defpart 2123 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.2 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 1)) @@ -612,8 +584,7 @@ ;; failed to figure out what this is: (defpart 2122 - :init-specs - ((sp-flt spt-fade-g 0.26666668) + :init-specs ((sp-flt spt-fade-g 0.26666668) (sp-flt spt-fade-b 0.53333336) (sp-int spt-next-time 120) (sp-launcher-by-id spt-next-launcher 2124) @@ -622,14 +593,12 @@ ;; failed to figure out what this is: (defpart 2124 - :init-specs - ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: (defpart 2116 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.6 0.7 1.0) (sp-rnd-flt spt-x (meters -1.2) (meters 2.4) 1.0) (sp-flt spt-y (meters 0.5)) @@ -657,8 +626,7 @@ ;; failed to figure out what this is: (defpart 2117 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1056964608 1 0.9) (sp-rnd-flt spt-x (meters -1.2) (meters 1) 1.0) (sp-flt spt-y (meters 1.25)) @@ -686,8 +654,7 @@ ;; failed to figure out what this is: (defpart 2118 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.75 1.2 1.0) (sp-rnd-flt spt-x (meters -1.2) (meters 2.4) 1.0) (sp-flt spt-y (meters 0.5)) @@ -715,8 +682,7 @@ ;; failed to figure out what this is: (defpart 2119 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1060320051 1 1.6) (sp-rnd-flt spt-x (meters -0.5) (meters 1.5) 1.0) (sp-flt spt-y (meters 1.25)) @@ -746,8 +712,7 @@ (defpartgroup group-snow-birds :id 537 :bounds (static-bspherem 0 8 0 45) - :parts - ((sp-item 2245 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 2243) + :parts ((sp-item 2245 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 2243) (sp-item 2245 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 2243) (sp-item 2245 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 2243) (sp-item 2245 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 2243) @@ -813,8 +778,7 @@ ;; failed to figure out what this is: (defpart 2245 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-func spt-birth-func 'birth-func-random-next-time) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -70) (meters 140) 1.0) @@ -841,8 +805,7 @@ ;; failed to figure out what this is: (defpart 2243 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-func spt-birth-func 'birth-func-copy-omega-to-z) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) @@ -868,8 +831,7 @@ ;; failed to figure out what this is: (defpart 2246 - :init-specs - ((sp-flt spt-scale-x (meters 8)) + :init-specs ((sp-flt spt-scale-x (meters 8)) (sp-flt spt-scalevel-x (meters -0.08)) (sp-int spt-timer 600) (sp-int spt-next-time 100) @@ -879,8 +841,7 @@ ;; failed to figure out what this is: (defpart 2247 - :init-specs - ((sp-flt spt-scale-x (meters 0)) + :init-specs ((sp-flt spt-scale-x (meters 0)) (sp-flt spt-scalevel-x (meters -0.04)) (sp-int spt-timer 600) (sp-int spt-next-time 199) @@ -890,8 +851,7 @@ ;; failed to figure out what this is: (defpart 2244 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-func spt-birth-func 'birth-func-copy2-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 4)) diff --git a/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc b/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc index 289f3ba9f1..71a16fae12 100644 --- a/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/ram-boss-ag.gc") + ;; definition of type ram-boss-proj (deftype ram-boss-proj (projectile) ((parent-override (pointer ram-boss) :offset 12) @@ -101,13 +103,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *ram-boss-sg* ram-boss - 0 - 13 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 4.4) - :longest-edge (meters 1.2) - ) +(defskelgroup *ram-boss-sg* ram-boss ram-boss-lod0-jg ram-boss-far-idle-ja + ((ram-boss-lod0-mg (meters 20)) (ram-boss-lod1-mg (meters 40)) (ram-boss-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 4.4) + :longest-edge (meters 1.2) + ) ;; definition for symbol *ram-boss-nav-enemy-info*, type nav-enemy-info (define *ram-boss-nav-enemy-info* (new 'static 'nav-enemy-info @@ -157,7 +157,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -211,7 +211,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -222,14 +222,12 @@ :id 521 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1904) (sp-item 1905) (sp-item 2487)) + :parts ((sp-item 1904) (sp-item 1905) (sp-item 2487)) ) ;; failed to figure out what this is: (defpart 2487 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -249,8 +247,7 @@ ;; failed to figure out what this is: (defpart 1904 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -273,8 +270,7 @@ ;; failed to figure out what this is: (defpart 1905 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -297,8 +293,7 @@ :id 522 :duration 300 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 1910 :flags (launch-asap) :binding 1908) + :parts ((sp-item 1910 :flags (launch-asap) :binding 1908) (sp-item 1908 :flags (start-dead) :binding 1909) (sp-item 1909 :flags (start-dead launch-asap)) (sp-item 1909 :flags (start-dead launch-asap)) @@ -351,8 +346,7 @@ ;; failed to figure out what this is: (defpart 1910 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.01)) (sp-copy-from-other spt-scale-y -4) @@ -365,8 +359,7 @@ ;; failed to figure out what this is: (defpart 1908 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -392,14 +385,12 @@ ;; failed to figure out what this is: (defpart 1912 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: (defpart 1909 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 5.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -432,14 +423,12 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1914) (sp-item 1915) (sp-item 1916)) + :parts ((sp-item 1914) (sp-item 1915) (sp-item 1916)) ) ;; failed to figure out what this is: (defpart 1914 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 64.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -465,8 +454,7 @@ ;; failed to figure out what this is: (defpart 1916 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -491,8 +479,7 @@ ;; failed to figure out what this is: (defpart 1915 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -513,8 +500,7 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1914)) + :parts ((sp-item 1914)) ) ;; definition for method 24 of type ram-boss-proj @@ -537,7 +523,7 @@ (the-as vector #f) f0-9 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -559,7 +545,7 @@ ) (sound-trans-convert (-> s5-0 parms trans) a1-4) ) - (set! (-> s5-0 parms mask) (the-as uint 32)) + (set! (-> s5-0 parms mask) (sound-mask trans)) (-> s5-0 id) ) (none) @@ -576,7 +562,7 @@ (s4-0 (new 'stack-no-clear 'vector)) (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0)) ) - (if (logtest? (-> arg0 root-override status) 4) + (if (logtest? (-> arg0 root-override status) (cshape-moving-flags tsurf)) (vector-flatten! s3-1 s3-1 (-> arg0 root-override local-normal)) ) (vector-normalize-copy! s4-0 s3-1 1.0) @@ -649,7 +635,7 @@ (set! (-> obj attack-mode) 'snow-ram-proj) (set! (-> obj launch-time) (-> *display* base-frame-counter)) (set! (-> obj timeout) (seconds 4)) - (set! (-> obj sound-id) (sound-play-by-name (static-sound-name "ramboss-track") (new-sound-id) 1024 0 0 1 #t)) + (set! (-> obj sound-id) (sound-play "ramboss-track")) (let ((v1-12 (-> obj parent-override))) (set! (-> v1-12 0 proj-stoked) #t) (set! (-> v1-12 0 proj-status) (the-as uint 1)) @@ -679,7 +665,12 @@ ;; INFO: Return type mismatch vector vs none. ;; Used lq/sq (defmethod dummy-28 ram-boss-proj ((obj ram-boss-proj)) - (when (and *target* (zero? (logand (-> *target* state-flags) #x80f8))) + (when (and *target* + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + ) (let ((gp-0 (-> obj target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) (set! (-> gp-0 y) (+ 4915.2 (-> gp-0 y))) @@ -702,8 +693,7 @@ ;; failed to figure out what this is: (defstate ram-boss-proj-growing (ram-boss-proj) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('launch) (let ((v1-1 (-> self parent-override))) @@ -715,12 +705,9 @@ ) ) ) - :code - (behavior () - (set! (-> self charge-sound-id) - (sound-play-by-name (static-sound-name "ramboss-charge") (new-sound-id) 1024 0 0 1 #t) - ) - (while #t + :code (behavior () + (set! (-> self charge-sound-id) (sound-play "ramboss-charge")) + (loop (let ((gp-1 (-> self parent-override))) (when (-> gp-1 0 dead?) (set! (-> gp-1 0 proj-stoked) #f) @@ -762,9 +749,8 @@ ;; failed to figure out what this is: (defstate ram-boss-proj-launch (ram-boss-proj) - :code - (behavior () - (sound-play-by-name (static-sound-name "ramboss-fire") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (sound-play "ramboss-fire") (set! (-> self launched?) #t) (set! (-> self growth) 1.0) (logior! (-> self root-override root-prim prim-core action) (collide-action solid)) @@ -781,30 +767,22 @@ ;; failed to figure out what this is: (defstate projectile-impact (ram-boss-proj) :virtual #t - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 523) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 523) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "ramboss-hit") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ramboss-hit") (suspend) (go-virtual projectile-die) (none) @@ -814,25 +792,17 @@ ;; failed to figure out what this is: (defstate projectile-dissipate (ram-boss-proj) :virtual #t - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 524) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 524) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) @@ -848,14 +818,12 @@ :id 525 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1919)) + :parts ((sp-item 1919)) ) ;; failed to figure out what this is: (defpart 1919 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -884,14 +852,12 @@ :duration 5 :linger-duration 450 :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2367) (sp-item 2368) (sp-item 2369)) + :parts ((sp-item 2367) (sp-item 2368) (sp-item 2369)) ) ;; failed to figure out what this is: (defpart 2367 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -916,8 +882,7 @@ ;; failed to figure out what this is: (defpart 2368 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -942,8 +907,7 @@ ;; failed to figure out what this is: (defpart 2369 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0) @@ -973,76 +937,38 @@ (('attack 'bonk 'roll) (cond ((-> self has-shield?) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'powerup)) - (set! (-> a1-3 param 1) (the-as uint 2)) - (cond - ((send-event-function *target* a1-3) - (nav-enemy-set-hit-from-direction arg0) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'shove) - (set! (-> a1-4 param 0) (the-as uint #f)) - (let ((v1-9 (new 'static 'attack-info :mask #x40))) - (set! (-> v1-9 shove-back) 8192.0) - (set! (-> a1-4 param 1) (the-as uint v1-9)) + (cond + ((send-event *target* 'query 'powerup (pickup-type eco-red)) + (nav-enemy-set-hit-from-direction arg0) + (send-event arg0 'shove #f (static-attack-info ((shove-back (meters 2))))) + (go ram-boss-lose-shield) + (return #t) + v0-4 + ) + ((begin + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))) + (do-push-aways! (-> self collide-info)) ) - (send-event-function arg0 a1-4) + (level-hint-spawn + (game-text-id ram-boss-red-eco-hint) + "sksp0346" + (the-as entity #f) + *entity-pool* + (game-task none) ) - (go ram-boss-lose-shield) - (return #t) - v0-4 + (>= (- (-> (target-pos 0) y) (-> self collide-info trans y)) 9420.8) ) - ((begin - (if (zero? (logand (-> self nav-enemy-flags) 256)) - (do-push-aways! (-> self collide-info)) - ) - (level-hint-spawn - (game-text-id ram-boss-red-eco-hint) - "sksp0346" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (>= (- (-> (target-pos 0) y) (-> self collide-info trans y)) 9420.8) - ) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'shove) - (set! (-> a1-6 param 0) (the-as uint #f)) - (let ((v1-22 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-22 shove-back) 16384.0) - (set! (-> v1-22 shove-up) 8192.0) - (set! (-> a1-6 param 1) (the-as uint v1-22)) - ) - (send-event-function arg0 a1-6) - ) - (go ram-boss-up-defend-block) - (return #t) - v0-4 - ) - (else - (when (= arg2 'attack) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'shove) - (set! (-> a1-7 param 0) (the-as uint #f)) - (let ((v1-30 (new 'static 'attack-info :mask #x40))) - (set! (-> v1-30 shove-back) 16384.0) - (set! (-> a1-7 param 1) (the-as uint v1-30)) - ) - (send-event-function arg0 a1-7) - ) - (go ram-boss-forward-defend-block) - (return #t) - v0-4 - ) + (send-event arg0 'shove #f (static-attack-info ((shove-back (meters 4)) (shove-up (meters 2))))) + (go ram-boss-up-defend-block) + (return #t) + v0-4 + ) + (else + (when (= arg2 'attack) + (send-event arg0 'shove #f (static-attack-info ((shove-back (meters 4))))) + (go ram-boss-forward-defend-block) + (return #t) + v0-4 ) ) ) @@ -1055,24 +981,18 @@ ) ) (('touch) - (if (zero? (logand (-> self nav-enemy-flags) 256)) + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))) (do-push-aways! (-> self collide-info)) ) (cond ((-> self has-shield?) (cond ((>= (- (-> (target-pos 0) y) (-> self collide-info trans y)) 9420.8) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) self) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'shove) - (set! (-> a1-8 param 0) (-> arg3 param 0)) - (let ((v1-49 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-49 shove-back) 16384.0) - (set! (-> v1-49 shove-up) 8192.0) - (set! (-> a1-8 param 1) (the-as uint v1-49)) - ) - (send-event-function arg0 a1-8) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-back (meters 4)) (shove-up (meters 2)))) ) (go ram-boss-up-defend-block) (return #t) @@ -1080,17 +1000,7 @@ ) (else (when (= arg2 'attack) - (let ((a1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-9 from) self) - (set! (-> a1-9 num-params) 2) - (set! (-> a1-9 message) 'shove) - (set! (-> a1-9 param 0) (-> arg3 param 0)) - (let ((v1-58 (new 'static 'attack-info :mask #x40))) - (set! (-> v1-58 shove-back) 16384.0) - (set! (-> a1-9 param 1) (the-as uint v1-58)) - ) - (send-event-function arg0 a1-9) - ) + (send-event arg0 'shove (-> arg3 param 0) (static-attack-info ((shove-back (meters 4))))) (go ram-boss-forward-defend-block) (return #t) v0-4 @@ -1320,7 +1230,7 @@ ) (else (ja-post) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go ram-boss-idle) ) ) @@ -1361,7 +1271,7 @@ (collide-kind background cak-2 ground-object) obj t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -1403,24 +1313,18 @@ (set! (-> obj proj-stoked) #t) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (the-as uint128 0)) - (let* ((s4-0 (the-as ram-boss-proj (get-process *default-dead-pool* ram-boss-proj #x4000))) - (v1-9 (when s4-0 - (let ((t9-1 (method-of-type ram-boss-proj activate))) - (t9-1 s4-0 obj 'ram-boss-proj (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-0 - projectile-init-by-other - (-> obj entity) - (-> obj collide-info trans) - s5-0 - 0 - (process->handle *target*) - ) - (-> s4-0 ppointer) - ) - ) - ) + (let ((v1-9 (process-spawn + ram-boss-proj + :init projectile-init-by-other + (-> obj entity) + (-> obj collide-info trans) + s5-0 + 0 + (process->handle *target*) + :to obj + ) + ) + ) (set! (-> (the-as (pointer ram-boss-proj) v1-9) 0 notify-handle) (process->handle obj)) ) ) @@ -1436,24 +1340,20 @@ ;; failed to figure out what this is: (defstate ram-boss-show-anims (ram-boss) - :trans - (behavior () + :trans (behavior () 0 (none) ) - :code - (behavior () + :code (behavior () 0 (none) ) - :post - (the-as (function none :behavior ram-boss) transform-post) + :post (the-as (function none :behavior ram-boss) transform-post) ) ;; failed to figure out what this is: (defstate ram-boss-idle (ram-boss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('jump) (go ram-boss-jump-down arg0) @@ -1463,17 +1363,15 @@ ) ) ) - :enter - (behavior () + :enter (behavior () ((-> (method-of-type nav-enemy nav-enemy-idle) enter)) (set! (-> self frustration) 0) 0 (none) ) - :code - (behavior () - (logior! (-> self nav-enemy-flags) 4) - (while #t + :code (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) + (loop (clone-anim-once (ppointer->handle (-> self parent-override)) (the-as int (-> self draw origin-joint-index)) @@ -1502,18 +1400,16 @@ ;; failed to figure out what this is: (defstate ram-boss-jump-down (ram-boss) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 'generic) ) ) ) - :enter - (behavior ((arg0 basic)) + :enter (behavior ((arg0 basic)) (dummy-52 self) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (-> self node-list data 0 bone transform)) ) @@ -1539,8 +1435,7 @@ (set! (-> self collide-info transv y) 102400.0) (none) ) - :trans - (behavior () + :trans (behavior () (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) @@ -1551,23 +1446,14 @@ #f #f ) - (if (logtest? (-> self collide-info status) 1) + (if (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)) (go ram-boss-jump-down-hit-ground) ) (none) ) - :code - (behavior ((arg0 basic)) - (ja-channel-push! 1 240) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + :code (behavior ((arg0 basic)) + (ja-channel-push! 1 (seconds 0.8)) + (ja-no-eval :group! (-> self draw art-group data 16) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 (target-pos 0) (-> self collide-info trans)) @@ -1575,59 +1461,38 @@ (seek-toward-heading-vec! (-> self collide-info) gp-0 182044.44 (seconds 0.01)) ) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior ram-boss) nav-enemy-simple-post) + :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate ram-boss-jump-down-hit-ground (ram-boss) - :event - (-> ram-boss-jump-down event) - :code - (behavior () - (logior! (-> self nav-enemy-flags) 4) + :event (-> ram-boss-jump-down event) + :code (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (activate! *camera-smush-control* 409.6 37 150 1.0 0.99) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 17) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go ram-boss-nav-start) (none) ) - :post - (the-as (function none :behavior ram-boss) nav-enemy-simple-post) + :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate ram-boss-already-down (ram-boss) - :code - (behavior ((arg0 basic)) - (logior! (-> self nav-enemy-flags) 4) + :code (behavior ((arg0 basic)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (dummy-52 self) (let ((a1-0 (new 'stack-no-clear 'vector)) (a2-0 (-> self parent-override 0 node-list data 0 bone transform)) @@ -1648,8 +1513,7 @@ ;; failed to figure out what this is: (defstate ram-boss-nav-start (ram-boss) - :code - (behavior () + :code (behavior () (let ((a1-1 (dummy-16 (-> self nav) (-> self collide-info trans)))) (when (not a1-1) (go process-drawable-art-error "not on nav mesh") @@ -1664,8 +1528,7 @@ ;; failed to figure out what this is: (defstate ram-boss-nav-resume (ram-boss) - :code - (behavior () + :code (behavior () (set! (-> self frustration) 0) (when *target* (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans)))) @@ -1696,18 +1559,15 @@ ;; failed to figure out what this is: (defstate nav-enemy-patrol (ram-boss) :virtual #t - :event - ram-boss-on-ground-event-handler - :enter - (behavior () + :event ram-boss-on-ground-event-handler + :enter (behavior () ((-> (method-of-type nav-enemy nav-enemy-patrol) enter)) (set! (-> self state-timeout) (-> self nav-enemy-patrol-timeout)) (set! (-> self nav-enemy-patrol-timeout) (seconds 1)) - (ja-channel-push! 1 90) + (ja-channel-push! 1 (seconds 0.3)) (none) ) - :trans - (behavior () + :trans (behavior () (when *target* (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans)))) (if (>= 18432.0 f0-0) @@ -1723,10 +1583,8 @@ ;; failed to figure out what this is: (defstate nav-enemy-chase (ram-boss) :virtual #t - :event - ram-boss-on-ground-event-handler - :enter - (behavior () + :event ram-boss-on-ground-event-handler + :enter (behavior () (let ((t9-0 (-> (method-of-type nav-enemy nav-enemy-chase) enter))) (if t9-0 (t9-0) @@ -1734,8 +1592,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans)))) (if (>= 18432.0 f30-0) (go ram-boss-tracking) @@ -1750,7 +1607,7 @@ ) ) (cond - ((logtest? (nav-control-flags bit17) (-> self nav flags)) + ((logtest? (nav-control-flags navcf17) (-> self nav flags)) (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 1)) (go-virtual nav-enemy-patrol) ) @@ -1767,12 +1624,9 @@ ;; failed to figure out what this is: (defstate nav-enemy-attack (ram-boss) :virtual #t - :event - ram-boss-on-ground-event-handler - :trans - (the-as (function none :behavior ram-boss) #f) - :code - (behavior () + :event ram-boss-on-ground-event-handler + :trans (the-as (function none :behavior ram-boss) #f) + :code (behavior () (go ram-boss-tracking) (none) ) @@ -1806,17 +1660,14 @@ ;; failed to figure out what this is: (defstate ram-boss-tracking (ram-boss) - :event - ram-boss-on-ground-event-handler - :enter - (behavior () + :event ram-boss-on-ground-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self facing-y) (quaternion-y-angle (-> self collide-info quat))) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) - :trans - (behavior () + :trans (behavior () (set-jump-height-factor! self (the-as int (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.75))) @@ -1869,7 +1720,10 @@ ) ) (when (and (= (-> self proj-status) 2) - (zero? (logand (-> *target* state-flags) #x80f8)) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) ) (let ((gp-2 (new 'stack-no-clear 'vector)) @@ -1888,222 +1742,111 @@ 0 (none) ) - :code - (behavior () + :code (behavior () (let ((f30-0 -1.0)) - (while #t + (loop (set! f30-0 (dummy-57 self f30-0)) (cond ((< 5461.3335 (-> self last-turn-speed)) (cond ((-> self has-shield?) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - ) - (ja-channel-push! 2 60) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 7)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (let ((a0-7 (-> self skel root-channel 1))) - (set! (-> a0-7 frame-interp) f30-0) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 22))) - (set! (-> a0-7 param 0) 0.0) - (joint-control-channel-group-eval! - a0-7 - (the-as art-joint-anim (-> self draw art-group data 22)) - num-func-chan - ) - ) + (when (not (ja-group? (-> self draw art-group data 7))) + (ja-channel-push! 2 (seconds 0.2)) + (ja :group! (-> self draw art-group data 7) :num! min) + (ja :chan 1 :group! (-> self draw art-group data 22) :num! (chan 0) :frame-interp f30-0) ) ) (else - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 20) - ) - ) - (ja-channel-push! 1 60) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 20)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (when (not (ja-group? (-> self draw art-group data 20))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 20) :num! min) ) ) ) ) ((-> self has-shield?) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 2 60) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) - (let ((a0-20 (-> self skel root-channel 1))) - (set! (-> a0-20 frame-interp) f30-0) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 21))) - (set! (-> a0-20 param 0) 0.0) - (joint-control-channel-group-eval! - a0-20 - (the-as art-joint-anim (-> self draw art-group data 21)) - num-func-chan - ) - ) + (when (not (ja-group? (-> self draw art-group data 6))) + (ja-channel-push! 2 (seconds 0.2)) + (ja :group! (-> self draw art-group data 6) :num! min) + (ja :chan 1 :group! (-> self draw art-group data 21) :num! (chan 0) :frame-interp f30-0) ) ) (else - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 24) - ) - ) - (ja-channel-push! 1 60) - (let ((gp-3 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-3 - (the-as art-joint-anim (-> self draw art-group data 24)) - num-func-identity - ) - (set! (-> gp-3 frame-num) 0.0) - ) + (when (not (ja-group? (-> self draw art-group data 24))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 24) :num! min) ) ) ) (suspend) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) 1.0) - (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-loop!) - ) - (when (= (ja-group-size) 2) - (let ((a0-28 (-> self skel root-channel 1))) - (set! (-> a0-28 frame-interp) f30-0) - (set! (-> a0-28 param 0) 0.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-chan) + (ja :num! (loop!)) + (if (= (ja-group-size) 2) + (ja :chan 1 :num! (chan 0) :frame-interp f30-0) ) - ) ) ) (none) ) - :post - (the-as (function none :behavior ram-boss) nav-enemy-simple-post) + :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate ram-boss-forward-defend-block (ram-boss) - :enter - (behavior () + :enter (behavior () (set! (-> self frustration) 0) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) - :trans - (behavior () + :trans (behavior () (set-jump-height-factor! self (the-as int #t)) 0 (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ram-boss-tracking) (none) ) - :post - (the-as (function none :behavior ram-boss) nav-enemy-simple-post) + :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate ram-boss-up-defend-block (ram-boss) - :enter - (behavior () + :enter (behavior () (set! (-> self frustration) 0) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) - :trans - (behavior () + :trans (behavior () (set-jump-height-factor! self (the-as int #t)) 0 (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 9) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ram-boss-tracking) (none) ) - :post - (the-as (function none :behavior ram-boss) nav-enemy-simple-post) + :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate nav-enemy-victory (ram-boss) :virtual #t - :event - ram-boss-on-ground-event-handler - :enter - (the-as (function none :behavior ram-boss) #f) - :exit - (the-as (function none :behavior ram-boss) #f) - :trans - (behavior () + :event ram-boss-on-ground-event-handler + :enter (the-as (function none :behavior ram-boss) #f) + :exit (the-as (function none :behavior ram-boss) #f) + :trans (behavior () (when *target* (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans)))) (if (and (>= 18432.0 f0-0) (-> self has-shield?)) @@ -2113,53 +1856,30 @@ ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self frustration) 0) - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - ) - (set! (-> a0-2 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) data 0 length) - -1 - ) - ) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! - a0-2 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info victory-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (go-virtual nav-enemy-attack) (none) ) - :post - (the-as (function none :behavior ram-boss) nav-enemy-simple-post) + :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate nav-enemy-stare (ram-boss) :virtual #t - :event - ram-boss-on-ground-event-handler - :enter - (behavior () + :event ram-boss-on-ground-event-handler + :enter (behavior () (go ram-boss-nav-resume) (none) ) @@ -2167,11 +1887,9 @@ ;; failed to figure out what this is: (defstate ram-boss-throw (ram-boss) - :event - ram-boss-on-ground-event-handler - :enter - (behavior () - (logior! (-> self nav-enemy-flags) 4) + :event ram-boss-on-ground-event-handler + :enter (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (let ((gp-0 (-> self child))) (while gp-0 (send-event (ppointer->process gp-0) 'launch) @@ -2181,74 +1899,45 @@ (set! (-> self proj-last-thrown-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (set-jump-height-factor! self (the-as int #t)) 0 (none) ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (cond ((-> self has-shield?) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 23))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 23)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 23)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 23) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go ram-boss-tracking) (none) ) - :post - (the-as (function none :behavior ram-boss) nav-enemy-simple-post) + :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate ram-boss-lose-shield (ram-boss) - :enter - (behavior () - (logior! (-> self nav-enemy-flags) 4) + :enter (behavior () + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-neck-control-inactive) (dummy-53 self) (TODO-RENAME-49 self *ram-boss-nav-enemy-info-no-shield*) (none) ) - :exit - (behavior () + :exit (behavior () (nav-enemy-neck-control-look-at) (set! (-> self has-shield?) #f) (let ((v1-2 (-> self entity extra perm))) @@ -2261,45 +1950,31 @@ ) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-normalize-copy! gp-0 (-> self hit-from-dir) 16384.0) (vector+! gp-0 (-> self collide-info trans) gp-0) (set! (-> self nav target-pos quad) (-> gp-0 quad)) ) - (ja-channel-push! 1 30) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 18))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 18)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 18)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 18) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((gp-1 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-1 (-> self node-list data 32)) (spawn (-> self part) gp-1) ) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ram-boss-tracking) (none) ) - :post - (behavior () - (TODO-RENAME-9 (-> self align)) + :post (behavior () + (compute-alignment! (-> self align)) (dummy-11 (-> self nav) (-> self nav target-pos)) - (TODO-RENAME-11 + (align-vel-and-quat-only! (-> self align) - 4 + (align-opts adjust-xz-vel) (-> self nav travel) (the-as int 1.0) 1.0 @@ -2309,7 +1984,7 @@ (-> self collide-info transv) (compute-acc-due-to-gravity (-> self collide-info) (new-stack-vector0) 0.0) ) - (TODO-RENAME-10 (-> self align) 16 1.0 1.0 1.0) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) @@ -2327,9 +2002,8 @@ ;; failed to figure out what this is: (defstate nav-enemy-die (ram-boss) :virtual #t - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (clear-collide-with-as (-> self collide-info)) (nav-enemy-fall-and-play-death-anim (the-as art-joint-anim (-> self draw art-group data (-> self nav-info die-anim))) diff --git a/test/decompiler/reference/levels/snow/snow-ram_REF.gc b/test/decompiler/reference/levels/snow/snow-ram_REF.gc index 6f5d5592e7..c6eba93e3e 100644 --- a/test/decompiler/reference/levels/snow/snow-ram_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-ram_REF.gc @@ -1,28 +1,26 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/ram-ag.gc") + ;; failed to figure out what this is: -(defskelgroup *ram-sg* ram - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 5 0 8.5) - :longest-edge (meters 7.7) - ) +(defskelgroup *ram-sg* ram ram-lod0-jg ram-cock-ja + ((ram-lod0-mg (meters 20)) (ram-lod1-mg (meters 40)) (ram-lod2-mg (meters 999999))) + :bounds (static-spherem 0 5 0 8.5) + :longest-edge (meters 7.7) + ) ;; failed to figure out what this is: (defpartgroup group-ram-hit-wall :id 526 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1921) (sp-item 1922 :fade-after (meters 60) :falloff-to (meters 60))) + :parts ((sp-item 1921) (sp-item 1922 :fade-after (meters 60) :falloff-to (meters 60))) ) ;; failed to figure out what this is: (defpart 1920 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 64.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -44,8 +42,7 @@ ;; failed to figure out what this is: (defpart 1922 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -68,8 +65,7 @@ ;; failed to figure out what this is: (defpart 1921 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -89,14 +85,12 @@ :id 527 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1923 :fade-after (meters 70) :falloff-to (meters 70))) + :parts ((sp-item 1923 :fade-after (meters 70) :falloff-to (meters 70))) ) ;; failed to figure out what this is: (defpart 1923 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) @@ -191,79 +185,49 @@ ;; failed to figure out what this is: (defstate ram-idle (ram) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) - (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self root-override) - (the-as uint 1) - ) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'attack) - (set! (-> a1-3 param 0) (-> arg3 param 0)) - (let ((v1-7 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-7 shove-up) 2048.0) - (set! (-> v1-7 shove-back) 8192.0) - (set! (-> a1-3 param 1) (the-as uint v1-7)) + (if ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self root-override) + (the-as uint 1) + ) + (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 0.5)) (shove-back (meters 2)))) ) - (send-event-function arg0 a1-3) ) - ) ) ) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (if (-> self give-fuel-cell-anim) (spool-push *art-control* (-> self give-fuel-cell-anim name) 0 self -99.0) ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (sv-16 symbol)) - (ja-channel-push! 1 22) - (while #t - (sound-play-by-name (static-sound-name "set-ram") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (loop + (sound-play "set-ram") + (ja-no-eval :group! ram-cock-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-1 #f)) - (sound-play-by-name (static-sound-name "slam-crash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "slam-crash") (logclear! (-> self mask) (process-mask actor-pause)) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! ram-release-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f30-0 (ja-aframe-num 0))) (when (and (not gp-1) (>= f30-0 61.0)) @@ -275,11 +239,7 @@ ) ) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (logior! (-> self mask) (process-mask actor-pause)) @@ -296,14 +256,12 @@ ) (none) ) - :post - (the-as (function none :behavior ram) rider-post) + :post (the-as (function none :behavior ram) rider-post) ) ;; failed to figure out what this is: (defstate ram-fun-idle (ram) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notify) (when (= (-> arg0 type) ram-boss) @@ -314,27 +272,18 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (-> self give-fuel-cell-anim) (spool-push *art-control* (-> self give-fuel-cell-anim name) 0 self -99.0) ) (none) ) - :code - (behavior () + :code (behavior () (if (-> self give-fuel-cell?) (go ram-give-fuel-cell) ) (ja-channel-push! 1 0) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! ram-idle-ja :num! min) (transform-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -345,8 +294,7 @@ ;; failed to figure out what this is: (defstate ram-give-fuel-cell (ram) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notify) (if (and (= (-> arg0 type) snowcam) (= (-> arg3 param 0) 'die)) @@ -355,50 +303,35 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self give-fuel-cell?) #f) (ja-channel-push! 1 0) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja :group! ram-idle-ja :num! min) (transform-post) (when (and (not (task-complete? *game-info* (-> self entity extra perm task))) (-> self give-fuel-cell-anim)) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) - (let* ((gp-1 (the-as snowcam (get-process *default-dead-pool* snowcam #x4000))) - (v1-14 (when gp-1 - (let ((t9-6 (method-of-type snowcam activate))) - (t9-6 gp-1 self 'snowcam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (-> self root-override trans) - *snowcam-sg* - (-> self give-fuel-cell-anim) - 0 - self - '() - ) - (-> gp-1 ppointer) - ) - ) - ) + (let ((v1-14 (process-spawn + snowcam + :init pov-camera-init-by-other + (-> self root-override trans) + *snowcam-sg* + (-> self give-fuel-cell-anim) + 0 + self + '() + :to self + ) + ) + ) (set! (-> (the-as (pointer snowcam) v1-14) 0 seq) (the-as uint 1)) ) - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -535,27 +468,11 @@ ((and (not s3-1) (has-nav-mesh? arg0)) (cond (s4-1 - (let ((s5-1 (get-process *default-dead-pool* ram-boss #x4000))) - (when s5-1 - (let ((t9-28 (method-of-type ram-boss activate))) - (t9-28 (the-as ram-boss s5-1) obj 'ram-boss (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 ram-boss-init-by-other (-> obj entity) obj #t) - (-> s5-1 ppointer) - ) - ) + (process-spawn ram-boss (-> obj entity) obj #t :to obj) (go ram-fun-idle) ) (else - (let ((s5-2 (get-process *default-dead-pool* ram-boss #x4000))) - (when s5-2 - (let ((t9-32 (method-of-type ram-boss activate))) - (t9-32 (the-as ram-boss s5-2) obj 'ram-boss (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 ram-boss-init-by-other (-> obj entity) obj #f) - (-> s5-2 ppointer) - ) - ) + (process-spawn ram-boss (-> obj entity) obj #f :to obj) (go ram-idle) ) ) diff --git a/test/decompiler/reference/levels/snow/target-ice_REF.gc b/test/decompiler/reference/levels/snow/target-ice_REF.gc index a216271e14..956bc6e364 100644 --- a/test/decompiler/reference/levels/snow/target-ice_REF.gc +++ b/test/decompiler/reference/levels/snow/target-ice_REF.gc @@ -3,17 +3,13 @@ ;; failed to figure out what this is: (defstate target-ice-stance (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () (set! (-> self control unknown-surface00) *walk-mods*) (none) ) - :exit - target-state-hook-exit - :trans - (behavior () + :exit target-state-hook-exit + :trans (behavior () ((-> self state-hook)) (if (!= (-> self control ground-pat material) (pat-material ice)) (go target-stance) @@ -55,212 +51,80 @@ (fall-test) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 60)) - (let ((v1-2 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-2 (ja-group))) (cond ((or (= v1-2 (-> self draw art-group data 34)) (= v1-2 (-> self draw art-group data 38))) (set! gp-0 21) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 71) - ) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 72))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 72)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 72)) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 71)) + (ja-no-eval :group! (-> self draw art-group data 72) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 51) - ) + ((ja-group? (-> self draw art-group data 51)) (cond ((rand-vu-percent? 0.3) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 53))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 53)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 53)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 53) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 52))) - (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 52)) data 0 length) -1)) - ) - (set! (-> a0-22 param 1) 1.0) - (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 52)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 52) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) - (set! (-> a0-23 param 1) 1.0) - (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 78) - ) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> self draw art-group data 79))) - (set! (-> a0-29 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 79)) data 0 length) -1)) - ) - (set! (-> a0-29 param 1) 1.0) - (set! (-> a0-29 frame-num) 0.0) - (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> self draw art-group data 79)) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 78)) + (ja-no-eval :group! (-> self draw art-group data 79) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 param 0) (the float (+ (-> a0-30 frame-group data 0 length) -1))) - (set! (-> a0-30 param 1) 1.0) - (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 84) - ) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 frame-group) (the-as art-joint-anim (-> self draw art-group data 85))) - (set! (-> a0-36 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 85)) data 0 length) -1)) - ) - (set! (-> a0-36 param 1) 1.0) - (set! (-> a0-36 frame-num) 0.0) - (joint-control-channel-group! a0-36 (the-as art-joint-anim (-> self draw art-group data 85)) num-func-seek!) - ) + ((ja-group? (-> self draw art-group data 84)) + (ja-no-eval :group! (-> self draw art-group data 85) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 param 0) (the float (+ (-> a0-37 frame-group data 0 length) -1))) - (set! (-> a0-37 param 1) 1.0) - (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! gp-0 0) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 59) - ) + ((ja-group? (-> self draw art-group data 59)) (set! (-> self control unknown-float81) (-> self control unknown-float80)) (set! (-> self control unknown-surface00) *walk-no-turn-mods*) - (let ((s5-0 (-> self skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (if (rand-vu-percent? 0.3) - (-> self draw art-group data 61) - (-> self draw art-group data 60) - ) - ) - ) - (set! (-> s5-0 param 0) (the float (+ (-> (the-as art-joint-anim (if (rand-vu-percent? 0.3) - (-> self draw art-group data 61) - (-> self draw art-group data 60) - ) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> s5-0 param 1) 1.0) - (set! (-> s5-0 frame-num) 0.0) - (joint-control-channel-group! - s5-0 - (the-as art-joint-anim (if (rand-vu-percent? 0.3) - (-> self draw art-group data 61) - (-> self draw art-group data 60) - ) + (ja-no-eval :group! (if (rand-vu-percent? 0.3) + (-> self draw art-group data 61) + (-> self draw art-group data 60) + ) + :num! (seek!) + :frame-num 0.0 ) - num-func-seek! - ) - ) (until (ja-done? 0) - (set! (-> self control unknown-float81) - (seek (-> self control unknown-float81) 0.0 (-> *display* seconds-per-frame)) - ) + (seek! (-> self control unknown-float81) 0.0 (-> *display* seconds-per-frame)) (suspend) - (let ((a0-49 (-> self skel root-channel 0))) - (set! (-> a0-49 param 0) (the float (+ (-> a0-49 frame-group data 0 length) -1))) - (set! (-> a0-49 param 1) 1.0) - (joint-control-channel-group-eval! a0-49 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self control unknown-surface00) *walk-mods*) (set! (-> self control unknown-float81) 0.0) (rot->dir-targ! (-> self control)) ) - ((let ((v1-188 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + ((let ((v1-188 (ja-group))) (or (= v1-188 (-> self draw art-group data 31)) (= v1-188 (-> self draw art-group data 32))) ) - (ja-channel-push! 1 12) - (let ((a0-61 (-> self skel root-channel 0))) - (set! (-> a0-61 frame-group) (the-as art-joint-anim (-> self draw art-group data 30))) - (set! (-> a0-61 param 0) 0.0) - (set! (-> a0-61 param 1) 1.2) - (set! (-> a0-61 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-61 (the-as art-joint-anim (-> self draw art-group data 30)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! (-> self draw art-group data 30) :num! (seek! 0.0 1.2) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-62 (-> self skel root-channel 0))) - (set! (-> a0-62 param 0) 0.0) - (set! (-> a0-62 param 1) 1.2) - (joint-control-channel-group-eval! a0-62 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0 1.2)) ) (set! gp-0 60) ) @@ -268,69 +132,45 @@ ) (while (< 16384.0 (-> self control unknown-float01)) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 103) - ) + ((ja-group? (-> self draw art-group data 103)) ) (else - (ja-channel-push! 1 gp-0) + (ja-channel-push! 1 (the-as time-frame gp-0)) (set! gp-0 150) - (let ((v1-219 (-> self skel root-channel 0))) - (set! (-> v1-219 frame-group) (the-as art-joint-anim (-> self draw art-group data 103))) - ) + (ja :group! (-> self draw art-group data 103)) ) ) (suspend) - (let ((a0-72 (-> self skel root-channel 0))) - (set! (-> a0-72 param 0) 1.0) - (joint-control-channel-group-eval! a0-72 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 104) - ) - ) - (ja-channel-push! 1 gp-0) - (let ((v1-233 (-> self skel root-channel 0))) - (set! (-> v1-233 frame-group) (the-as art-joint-anim (-> self draw art-group data 104))) - ) + (when (not (ja-group? (-> self draw art-group data 104))) + (ja-channel-push! 1 (the-as time-frame gp-0)) + (ja :group! (-> self draw art-group data 104)) ) ) - (while #t + (loop (suspend) - (let ((a0-81 (-> self skel root-channel 0))) - (set! (-> a0-81 param 0) 1.0) - (joint-control-channel-group-eval! a0-81 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-ice-walk (target) - :event - target-standard-event-handler - :enter - (behavior () + :event target-standard-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control unknown-surface00) *walk-mods*) (none) ) - :exit - (behavior () + :exit (behavior () (target-effect-exit) (target-state-hook-exit) (none) ) - :trans - (behavior () + :trans (behavior () ((-> self state-hook)) (when (!= (-> self control ground-pat material) (pat-material ice)) (remove-exit) @@ -354,10 +194,7 @@ (remove-exit) (go target-duck-stance) ) - (when (and (not (move-legs?)) (let ((gp-0 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) + (when (and (not (move-legs?)) (let ((gp-0 (ja-group)) (f0-1 (ja-aframe-num 0)) ) (if (and (= gp-0 (-> self draw art-group data 102)) (>= f0-1 30.0) (>= 35.0 f0-1)) @@ -398,113 +235,59 @@ (fall-test) (none) ) - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) + ((ja-group? (-> self draw art-group data 23)) (let ((f30-0 (ja-aframe-num 0))) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 102)) - num-func-identity - ) - (set! (-> gp-0 frame-num) f30-0) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 102) :num! (identity f30-0)) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 102) - ) + ((ja-group? (-> self draw art-group data 102)) ) (else - (let ((v1-18 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) + (let ((v1-18 (ja-group))) (cond ((or (= v1-18 (-> self draw art-group data 60)) (= v1-18 (-> self draw art-group data 61))) (set! (-> self control unknown-float81) (-> self control unknown-float80)) (set! (-> self control unknown-surface00) *walk-no-turn-mods*) (while (< (ja-aframe-num 0) 42.0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self control unknown-surface00) *walk-mods*) (set! (-> self control unknown-float81) 0.0) - (ja-channel-push! 1 30) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 102)) - num-func-identity - ) - (set! (-> gp-1 frame-num) (ja-aframe 34.0 0)) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 102) :num! (identity (ja-aframe 34.0 0))) (while (!= (-> self skel root-channel 0) (-> self skel channel)) (suspend) ) ) - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 59) - ) + ((ja-group? (-> self draw art-group data 59)) (set! (-> self control unknown-float81) (-> self control unknown-float80)) (set! (-> self control unknown-surface00) *walk-no-turn-mods*) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 60))) - (set! (-> gp-2 param 0) (ja-aframe 42.0 0)) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) 0.0) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 60)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 60) :num! (seek! (ja-aframe 42.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 42.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 42.0 0))) ) (set! (-> self control unknown-surface00) *walk-mods*) (set! (-> self control unknown-float81) 0.0) - (ja-channel-push! 1 30) - (let ((gp-4 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-4 - (the-as art-joint-anim (-> self draw art-group data 102)) - num-func-identity - ) - (set! (-> gp-4 frame-num) (ja-aframe 34.0 0)) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 102) :num! (identity (ja-aframe 34.0 0))) (while (!= (-> self skel root-channel 0) (-> self skel channel)) (suspend) ) ) (else - (ja-channel-push! 1 15) - (let ((v1-74 (-> self skel root-channel 0))) - (set! (-> v1-74 frame-group) (the-as art-joint-anim (-> self draw art-group data 102))) - ) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 102)) ) ) ) ) ) - (while #t + (loop (suspend) (let* ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control unknown-vector01) 1.0)) (gp-6 (vector-float*! @@ -514,25 +297,23 @@ ) ) (f0-18 (fmax -1.0 (fmin 1.0 (vector-dot s5-0 gp-6)))) - (gp-7 (-> self skel root-channel 0)) ) - (set! (-> gp-7 param 0) (cond - ((< f0-18 0.0) - (lerp-scale 2.0 1.0 f0-18 -1.0 0.5) - ) - ((< 0.5 f0-18) - (lerp-scale 1.0 0.75 f0-18 0.5 1.0) - ) - (else - (lerp-scale 1.33 1.0 f0-18 0.0 0.5) - ) - ) - ) - (joint-control-channel-group-eval! gp-7 (the-as art-joint-anim #f) num-func-loop!) + (ja :num! (loop! (cond + ((< f0-18 0.0) + (lerp-scale 2.0 1.0 f0-18 -1.0 0.5) + ) + ((< 0.5 f0-18) + (lerp-scale 1.0 0.75 f0-18 0.5 1.0) + ) + (else + (lerp-scale 1.33 1.0 f0-18 0.0 0.5) + ) + ) + ) + ) ) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) diff --git a/test/decompiler/reference/levels/snow/target-snowball_REF.gc b/test/decompiler/reference/levels/snow/target-snowball_REF.gc index e375917475..9bc6ac0a99 100644 --- a/test/decompiler/reference/levels/snow/target-snowball_REF.gc +++ b/test/decompiler/reference/levels/snow/target-snowball_REF.gc @@ -59,8 +59,7 @@ ;; failed to figure out what this is: (defstate target-snowball-start (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) 'snowball @@ -80,8 +79,7 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (when (!= (-> self next-state name) 'target-snowball) (let ((v1-1 (-> self manipy))) (when v1-1 @@ -99,8 +97,7 @@ ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (target-exit) (set! *display-profile* #f) (set! *display-entity-errors* #f) @@ -119,37 +116,25 @@ (move-by-vector! (-> self control) (new 'static 'vector :y 4096.0 :w 1.0)) (logior! (-> self control root-prim prim-core action) (collide-action ca-12)) (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 5) :num! min) (remove-exit) (go target-snowball) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-snowball (target) - :event - (-> target-snowball-start event) - :exit - (-> target-snowball-start exit) - :code - (behavior () - (while #t + :event (-> target-snowball-start event) + :exit (-> target-snowball-start exit) + :code (behavior () + (loop (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (target-snowball-post) (none) ) diff --git a/test/decompiler/reference/levels/snow/yeti_REF.gc b/test/decompiler/reference/levels/snow/yeti_REF.gc index 791f9cc3e2..48bc94ae0e 100644 --- a/test/decompiler/reference/levels/snow/yeti_REF.gc +++ b/test/decompiler/reference/levels/snow/yeti_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/yeti-ag.gc") + ;; definition of type yeti-slave (deftype yeti-slave (nav-enemy) ((ground-y float :offset-assert 400) @@ -65,13 +67,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *yeti-sg* yeti - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0.75 0 3.9) - :longest-edge (meters 1.3) - ) +(defskelgroup *yeti-sg* yeti yeti-lod0-jg -1 + ((yeti-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0.75 0 3.9) + :longest-edge (meters 1.3) + ) ;; definition for symbol *yeti-nav-enemy-info*, type nav-enemy-info (define *yeti-nav-enemy-info* (new 'static 'nav-enemy-info @@ -122,7 +122,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -133,16 +133,14 @@ :id 538 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 1928 :fade-after (meters 70) :falloff-to (meters 70)) + :parts ((sp-item 1928 :fade-after (meters 70) :falloff-to (meters 70)) (sp-item 1929 :fade-after (meters 70) :falloff-to (meters 70)) ) ) ;; failed to figure out what this is: (defpart 1929 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) @@ -167,8 +165,7 @@ ;; failed to figure out what this is: (defpart 1928 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) @@ -199,14 +196,12 @@ :id 539 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 1930 :fade-after (meters 70) :falloff-to (meters 70))) + :parts ((sp-item 1930 :fade-after (meters 70) :falloff-to (meters 70))) ) ;; failed to figure out what this is: (defpart 1930 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -242,16 +237,14 @@ ;; failed to figure out what this is: (defstate yeti-slave-appear-jump-up (yeti-slave) - :event - yeti-slave-default-event-handler - :enter - (behavior () + :event yeti-slave-default-event-handler + :enter (behavior () (nav-enemy-neck-control-inactive) (set! (-> self state-time) (-> *display* base-frame-counter)) (if (-> self nav-info move-to-ground) (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background)) ) - (set! (-> self nav-enemy-flags) (logand -7 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1 navenmf2)) (set! (-> self state-timeout) (seconds 1)) (set! (-> self ground-y) (-> self collide-info trans y)) (spawn (-> self part) (-> self collide-info trans)) @@ -260,8 +253,7 @@ (set! (-> self collide-info transv y) (rand-vu-float-range 102400.0 114688.0)) (none) ) - :trans - (behavior () + :trans (behavior () (when (and (< (-> self collide-info trans y) (-> self ground-y)) (< (-> self collide-info transv y) 0.0)) (set! (-> self collide-info trans y) (-> self ground-y)) (set! (-> self collide-info transv quad) (-> *null-vector* quad)) @@ -276,58 +268,30 @@ ) (none) ) - :code - (behavior () - (ja-channel-push! 1 22) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 10.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! yeti-jump-ja :num! (seek!) :frame-num (ja-aframe 10.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior yeti-slave) nav-enemy-falling-post) + :post (the-as (function none :behavior yeti-slave) nav-enemy-falling-post) ) ;; failed to figure out what this is: (defstate yeti-slave-appear-land (yeti-slave) - :event - yeti-slave-default-event-handler - :code - (behavior () - (ja-channel-push! 1 15) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 0.5) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + :event yeti-slave-default-event-handler + :code (behavior () + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! yeti-jump-land-ja :num! (seek! max 0.5) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 0.5) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.5)) ) (if (TODO-RENAME-46 self (-> self nav-info notice-distance)) (go-virtual nav-enemy-chase) @@ -335,130 +299,67 @@ ) (none) ) - :post - (the-as (function none :behavior yeti-slave) ja-post) + :post (the-as (function none :behavior yeti-slave) ja-post) ) ;; failed to figure out what this is: (defstate yeti-slave-show-anims (yeti-slave) - :trans - (behavior () + :trans (behavior () 0 (none) ) - :code - (behavior () + :code (behavior () 0 (none) ) - :post - (the-as (function none :behavior yeti-slave) transform-post) + :post (the-as (function none :behavior yeti-slave) transform-post) ) ;; failed to figure out what this is: (defstate nav-enemy-patrol (yeti-slave) :virtual #t - :code - (behavior () + :code (behavior () (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - (ja-channel-push! 1 45) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 12.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + ((ja-group? yeti-give-up-hop-ja) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! yeti-walk-ja :num! (seek!) :frame-num (ja-aframe 12.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) ) ) - (while #t - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (loop + (ja-no-eval :group! yeti-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (when (nav-enemy-rnd-percent? 0.2) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) 1.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 180) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((gp-1 (nav-enemy-rnd-int-range 2 6))) (dotimes (s5-0 gp-1) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! yeti-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (logior! (-> self nav-enemy-flags) 8) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) 1.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 180) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) 1.0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (ja-no-eval :group! yeti-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) 1.0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -469,65 +370,31 @@ ;; failed to figure out what this is: (defstate nav-enemy-chase (yeti-slave) :virtual #t - :code - (behavior () + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) (cond - ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 11) - ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 51) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim)))) - (set! (-> a0-7 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-7 param 1) f30-0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! - a0-7 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - num-func-seek! - ) - ) + ((ja-group? yeti-jump-land-ja) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.17)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info run-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) f30-0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (else - (ja-channel-push! 1 60) - (let ((v1-42 (-> self skel root-channel 0))) - (set! (-> v1-42 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info run-anim))) - ) - ) - (let ((v1-45 (-> self skel root-channel 0))) - (set! (-> v1-45 num-func) num-func-identity) - (set! (-> v1-45 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) ) ) - (while #t + (loop (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) f30-0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f30-0)) ) ) (none) @@ -537,96 +404,47 @@ ;; failed to figure out what this is: (defstate nav-enemy-stare (yeti-slave) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self turn-time) (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or (logtest? (-> self nav-enemy-flags) 256) + (when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) ) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> gp-0 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-0 param 1) f30-0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! yeti-win-ja :num! (seek! (ja-aframe 68.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-1 param 1) f30-0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 68.0 0) f30-0)) ) ) - (while #t + (loop (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) 1.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 60) - (let ((v1-25 (-> self skel root-channel 0))) - (set! (-> v1-25 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - ) - (let ((v1-28 (-> self skel root-channel 0))) - (set! (-> v1-28 num-func) num-func-identity) - (set! (-> v1-28 frame-num) 0.0) - ) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! yeti-turn-ja) + (ja :num-func num-func-identity :frame-num 0.0) (until (nav-enemy-facing-player? 1820.4445) (ja-blend-eval) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) 0.75) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! 0.75)) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 2) - ) - ) - (ja-channel-push! 1 60) + (if (not (ja-group? yeti-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) ) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) f30-0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! yeti-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) - (set! (-> a0-24 param 1) f30-0) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) (when (nav-enemy-rnd-percent? 0.3) - (ja-channel-push! 1 30) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> gp-2 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-2 param 1) f30-0) - (set! (-> gp-2 frame-num) 0.0) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! yeti-win-ja :num! (seek! (ja-aframe 68.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 68.0 0)) - (set! (-> gp-3 param 1) f30-0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 68.0 0) f30-0)) ) ) ) @@ -638,11 +456,10 @@ ;; failed to figure out what this is: (defstate nav-enemy-give-up (yeti-slave) :virtual #t - :code - (behavior () + :code (behavior () (set! (-> self rotate-speed) 218453.33) (set! (-> self turn-time) (seconds 0.5)) - (ja-channel-push! 1 45) + (ja-channel-push! 1 (seconds 0.15)) (let ((s4-0 (-> self collide-info)) (s5-0 (target-pos 0)) ) @@ -651,36 +468,16 @@ ) 12743.111 ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! yeti-give-up-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! yeti-give-up-hop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek-to-point-toward-point! (-> self collide-info) @@ -689,11 +486,7 @@ (-> self turn-time) ) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) (none) @@ -703,35 +496,17 @@ ;; failed to figure out what this is: (defstate nav-enemy-jump-land (yeti-slave) :virtual #t - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-channel-push! 1 22) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - ) - (set! (-> gp-0 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-0 param 1) 0.5) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! - gp-0 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info jump-land-anim))) - num-func-seek! - ) - ) + :code (behavior () + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info jump-land-anim)) + :num! (seek! (ja-aframe 32.0 0) 0.5) + :frame-num 0.0 + ) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 32.0 0)) - (set! (-> gp-1 param 1) 0.5) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) ) (go-virtual nav-enemy-chase) (none) @@ -892,9 +667,8 @@ ;; failed to figure out what this is: (defstate yeti-first-time-start (yeti) - :code - (behavior () - (while #t + :code (behavior () + (loop (when *target* (when (>= (-> self first-time-spawn-dist) (vector-vector-xz-distance (target-pos 0) (-> self root trans))) (process-entity-status! self (entity-perm-status complete) #t) @@ -909,8 +683,7 @@ ;; failed to figure out what this is: (defstate yeti-resuming-start (yeti) - :code - (behavior () + :code (behavior () (let ((gp-0 0)) (let ((v1-0 (the-as (pointer process-tree) (-> self child-process)))) (while v1-0 @@ -927,15 +700,7 @@ (if (not (TODO-RENAME-20 self s5-0 s4-0)) (go yeti-idle) ) - (let ((s3-0 (get-process *default-dead-pool* yeti-slave #x4000))) - (when s3-0 - (let ((t9-3 (method-of-type yeti-slave activate))) - (t9-3 (the-as yeti-slave s3-0) self 'yeti-slave (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 yeti-slave-init-by-other (-> self entity) self s5-0 s4-0 #t) - (-> s3-0 ppointer) - ) - ) + (process-spawn yeti-slave (-> self entity) self s5-0 s4-0 #t :to self) ) (+! gp-0 1) ) @@ -947,9 +712,8 @@ ;; failed to figure out what this is: (defstate yeti-idle (yeti) - :code - (behavior () - (while #t + :code (behavior () + (loop (cond ((zero? (-> self spawn-delay)) (let ((v1-1 0)) @@ -973,15 +737,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (when (TODO-RENAME-20 self gp-0 s5-0) - (let ((s4-0 (get-process *default-dead-pool* yeti-slave #x4000))) - (when s4-0 - (let ((t9-3 (method-of-type yeti-slave activate))) - (t9-3 (the-as yeti-slave s4-0) self 'yeti-slave (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 yeti-slave-init-by-other (-> self entity) self gp-0 s5-0 #f) - (-> s4-0 ppointer) - ) - ) + (process-spawn yeti-slave (-> self entity) self gp-0 s5-0 #f :to self) (set! (-> self spawn-delay) 0) 0 ) diff --git a/test/decompiler/reference/levels/sunken/bully_REF.gc b/test/decompiler/reference/levels/sunken/bully_REF.gc index 4d57d2274e..05f782ab2c 100644 --- a/test/decompiler/reference/levels/sunken/bully_REF.gc +++ b/test/decompiler/reference/levels/sunken/bully_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/bully-ag.gc") + ;; definition of type bully-broken-cage (deftype bully-broken-cage (process-drawable) ((parent-override (pointer bully) :offset 12) @@ -78,32 +80,23 @@ ) ;; failed to figure out what this is: -(defskelgroup *bully-sg* bully - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1.5 0 3) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *bully-sg* bully bully-lod0-jg bully-idle-ja + ((bully-lod0-mg (meters 20)) (bully-lod1-mg (meters 40)) (bully-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 3) + :shadow bully-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *bully-broken-cage-sg* bully - 14 - -1 - ((15 (meters 999999))) - :bounds (static-spherem 0 2 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *bully-broken-cage-sg* bully bully-broken-cage-lod0-jg -1 + ((bully-broken-cage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 6) + ) ;; definition for symbol *bully-shadow-control*, type shadow-control -(define - *bully-shadow-control* +(define *bully-shadow-control* (new 'static 'shadow-control :settings (new 'static 'shadow-settings - :center - (new 'static 'vector :w (the-as float #x9)) - :shadow-dir - (new 'static 'vector :y -1.0 :w 614400.0) + :flags (shadow-flags shdf00 shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) :bot-plane (new 'static 'plane :y 1.0 :w 10240.0) :top-plane (new 'static 'plane :y 1.0 :w -2048.0) :fade-dist 245760.0 @@ -116,14 +109,12 @@ :id 454 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2871) (sp-item 2872) (sp-item 2873) (sp-item 2874) (sp-item 2875)) + :parts ((sp-item 2871) (sp-item 2872) (sp-item 2873) (sp-item 2874) (sp-item 2875)) ) ;; failed to figure out what this is: (defpart 2871 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0.5) (meters 2) 1.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -147,14 +138,12 @@ ;; failed to figure out what this is: (defpart 2876 - :init-specs - ((sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2872 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 1.5)) (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) @@ -179,14 +168,12 @@ ;; failed to figure out what this is: (defpart 2877 - :init-specs - ((sp-flt spt-fade-a -2.1333334)) + :init-specs ((sp-flt spt-fade-a -2.1333334)) ) ;; failed to figure out what this is: (defpart 2873 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1.5)) (sp-flt spt-scale-x (meters 12)) @@ -203,8 +190,7 @@ ;; failed to figure out what this is: (defpart 2874 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) @@ -233,8 +219,7 @@ ;; failed to figure out what this is: (defpart 2878 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0033333334)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0033333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -3.4) ) @@ -242,8 +227,7 @@ ;; failed to figure out what this is: (defpart 2875 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) (sp-flt spt-num 16.5) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 0.25) (meters 1.5) 1.0) @@ -272,36 +256,22 @@ ;; failed to figure out what this is: (defstate bully-broken-cage-explode (bully-broken-cage) - :code - (behavior () + :code (behavior () (ja-channel-push! 1 0) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + (ja-no-eval :group! bully-broken-cage-explode-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (none) ) - :post - (the-as (function none :behavior bully-broken-cage) ja-post) + :post (the-as (function none :behavior bully-broken-cage) ja-post) ) ;; definition for function bully-broken-cage-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior bully-broken-cage-init-by-other bully-broken-cage ((arg0 entity)) +(defbehavior bully-broken-cage-init-by-other bully-broken-cage ((arg0 entity-actor)) (set! (-> self entity) arg0) (set! (-> self root) (new 'process 'trsqv)) (set! (-> self root trans quad) (-> self parent-override 0 root-override trans quad)) @@ -366,46 +336,29 @@ ) (set-vector! s4-0 (* (sin f26-0) f28-0) 0.0 (* (cos f26-0) f28-0) 1.0) ) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) self) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'shove) - (set! (-> a1-8 param 0) (-> arg3 param 0)) - (let ((v1-23 (new 'static 'attack-info :mask #x82))) - (set! (-> v1-23 shove-up) f30-0) - (set! (-> v1-23 vector quad) (-> s4-0 quad)) - (set! (-> a1-8 param 1) (the-as uint v1-23)) - ) - (when (send-event-function arg0 a1-8) - (level-hint-spawn - (game-text-id sunken-bully-dive-hint) - "sksp0131" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (set! (-> self bounced?) #t) - (set! v0-0 (the-as none 100)) - (set! (-> self bounce-volume) (the-as int v0-0)) - v0-0 + (when (send-event arg0 'shove (-> arg3 param 0) (static-attack-info ((shove-up f30-0) (vector s4-0)))) + (level-hint-spawn + (game-text-id sunken-bully-dive-hint) + "sksp0131" + (the-as entity #f) + *entity-pool* + (game-task none) ) + (set! (-> self bounced?) #t) + (set! v0-0 (the-as none 100)) + (set! (-> self bounce-volume) (the-as int v0-0)) + v0-0 ) ) ) (else - (let ((f0-21 (fmax 0.6 (* 0.000023935356 (-> self travel-speed)))) - (a1-10 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-10 from) self) - (set! (-> a1-10 num-params) 2) - (set! (-> a1-10 message) 'attack) - (set! (-> a1-10 param 0) (-> arg3 param 0)) - (let ((v1-29 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-29 shove-up) (* 12288.0 f0-21)) - (set! (-> v1-29 shove-back) (* 16384.0 f0-21)) - (set! (-> a1-10 param 1) (the-as uint v1-29)) - ) - (when (send-event-function arg0 a1-10) + (let ((f0-21 (fmax 0.6 (* 0.000023935356 (-> self travel-speed))))) + (when (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (* 12288.0 f0-21)) (shove-back (* 16384.0 f0-21)))) + ) (level-hint-spawn (game-text-id sunken-bully-dive-hint) "sksp0131" @@ -429,17 +382,7 @@ (when (= arg2 'touched) (cond ((= (-> arg0 type) target) - (let ((a1-13 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-13 from) self) - (set! (-> a1-13 num-params) 2) - (set! (-> a1-13 message) 'attack) - (set! (-> a1-13 param 0) (-> arg3 param 0)) - (let ((a0-26 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-26 mode) 'explode) - (set! (-> a1-13 param 1) (the-as uint a0-26)) - ) - (send-event-function arg0 a1-13) - ) + (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'explode)))) ) (else (let ((a1-14 (new 'stack-no-clear 'event-message-block))) @@ -469,9 +412,13 @@ ;; INFO: Return type mismatch int vs none. (defbehavior bully-post bully () (when (and (-> self hit-player?) - (or (not *target*) (and (zero? (logand (-> *target* state-flags) #x80f8)) - (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) + (or (not *target*) + (and (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) + ) + (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) + ) ) ) (set-collide-offense (-> self root-override) 2 (collide-offense normal-attack)) @@ -559,30 +506,26 @@ ;; failed to figure out what this is: (defstate bully-idle (bully) - :event - bully-default-event-handler - :enter - (behavior ((arg0 symbol)) + :event bully-default-event-handler + :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self reaction-delay) (rand-vu-int-range 0 (seconds 0.35))) (set! (-> self travel-speed) 0.0) (shut-down! (-> self neck)) (let ((v1-5 (-> self draw shadow-ctrl))) - (logior! (-> v1-5 settings flags) 32) + (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) 0 (none) ) - :exit - (behavior () + :exit (behavior () (let ((v1-1 (-> self draw shadow-ctrl))) - (set! (-> v1-1 settings flags) (logand -33 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) 0 (none) ) - :trans - (behavior () + :trans (behavior () (when (and (and *target* (>= (-> self fact-override idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -594,62 +537,27 @@ ) (none) ) - :code - (behavior ((arg0 symbol)) - (ja-channel-push! 1 22) - (cond - (arg0 - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity + :code (behavior ((arg0 symbol)) + (ja-channel-push! 1 (seconds 0.075)) + (if arg0 + (ja :group! bully-idle-ja + :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) ) - (set! (-> gp-1 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - ) + (ja :group! bully-idle-ja :num! min) ) - (else - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) - ) - ) - (while #t + (loop (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - bully-post + :post bully-post ) ;; failed to figure out what this is: (defstate bully-notice (bully) - :event - bully-default-event-handler - :trans - (behavior () + :event bully-default-event-handler + :trans (behavior () (when *target* (if *target* (look-at-enemy! @@ -663,32 +571,17 @@ ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self travel-speed) 0.0) - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) (set-vector! (-> self root-override transv) 0.0 (rand-vu-float-range 61440.0 90112.0) 0.0 1.0) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> gp-1 param 0) (ja-aframe 13.0 0)) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) 0.0) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! bully-notice-jump-up-ja :num! (seek! (ja-aframe 13.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe 13.0 0)) - (set! (-> gp-2 param 1) 1.0) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 13.0 0))) ) - (until (logtest? (-> self root-override status) 1) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (until (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) + (ja :num! (seek!)) (+! (-> self root-override transv y) (* -545996.8 (-> *display* seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! (-> self root-override) @@ -708,36 +601,21 @@ ) (suspend) ) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-14 param 1) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! bully-notice-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) 1.0) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go bully-start-spinning) (none) ) - :post - bully-post + :post bully-post ) ;; failed to figure out what this is: (defstate bully-start-spinning (bully) - :event - bully-default-event-handler - :enter - (behavior () + :event bully-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self start-spin-time) (-> *display* base-frame-counter)) (set! (-> self slow-down) (rand-vu-int-range (seconds 4) (seconds 8))) @@ -753,8 +631,7 @@ (+! (-> self travel-ry) (rand-vu-float-range -910.2222 910.2222)) (none) ) - :trans - (behavior () + :trans (behavior () (when *target* (if *target* (look-at-enemy! @@ -768,13 +645,13 @@ ) (cond ((>= (- (-> *display* base-frame-counter) (-> self start-spin-time)) (-> self slow-down)) - (set! (-> self speed-u) (seek (-> self speed-u) 0.0 (* 0.5555556 (-> *display* seconds-per-frame)))) + (seek! (-> self speed-u) 0.0 (* 0.5555556 (-> *display* seconds-per-frame))) (if (= (-> self speed-u) 0.0) (go bully-stop-spinning) ) ) (else - (set! (-> self speed-u) (seek (-> self speed-u) 1.0 (* 0.5555556 (-> *display* seconds-per-frame)))) + (seek! (-> self speed-u) 1.0 (* 0.5555556 (-> *display* seconds-per-frame))) ) ) (set! (-> self spin-vel) (* 196608.0 (-> self speed-u))) @@ -794,109 +671,55 @@ (TODO-RENAME-27 (-> self nav)) (none) ) - :code - (behavior () + :code (behavior () (local-vars (v1-34 symbol) (v1-52 symbol)) - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! bully-start-spin-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self bounced?) #f) - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 9)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! bully-spin-ja :num! min) + (loop (until v1-34 (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-34 (or (ja-done? 0) (-> self bounced?))) ) (when (-> self bounced?) - (sound-play-by-name - (static-sound-name "bully-bounce") - (new-sound-id) - (the int (* 10.24 (the float (-> self bounce-volume)))) - 0 - 0 - 1 - #t - ) + (sound-play "bully-bounce" :vol (the float (-> self bounce-volume))) (until (not (-> self bounced?)) (set! (-> self bounced?) #f) - (ja-channel-push! 1 60) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 11)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! bully-idle-bounced-ja :num! min) (until v1-52 (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-52 (or (ja-done? 0) (-> self bounced?))) ) ) - (ja-channel-push! 1 60) - ) - (let ((gp-3 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-3 - (the-as art-joint-anim (-> self draw art-group data 9)) - num-func-identity - ) - (set! (-> gp-3 frame-num) 0.0) + (ja-channel-push! 1 (seconds 0.2)) ) + (ja :group! bully-spin-ja :num! min) ) (none) ) - :post - bully-post + :post bully-post ) ;; failed to figure out what this is: (defstate bully-stop-spinning (bully) - :event - bully-default-event-handler - :enter - (behavior () + :event bully-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self reaction-delay) (rand-vu-int-range (seconds 2) (seconds 3))) (set! (-> self travel-speed) 0.0) (set! (-> self bounced?) #f) (none) ) - :trans - (behavior () + :trans (behavior () (when *target* (if *target* (look-at-enemy! @@ -910,77 +733,39 @@ ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (v1-17 symbol) (v1-35 symbol)) (let ((gp-0 2)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-delay)) (cond ((>= gp-0 0) (+! gp-0 -1) - (let ((s5-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data 13)) - num-func-identity - ) - (set! (-> s5-0 frame-num) 0.0) - ) + (ja :group! bully-dizzy-ja :num! min) ) (else - (let ((s5-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> s5-1 frame-num) 0.0) - ) + (ja :group! bully-idle-ja :num! min) ) ) (until v1-17 (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-17 (or (ja-done? 0) (-> self bounced?))) ) (when (-> self bounced?) - (sound-play-by-name - (static-sound-name "bully-bounce") - (new-sound-id) - (the int (* 10.24 (the float (-> self bounce-volume)))) - 0 - 0 - 1 - #t - ) + (sound-play "bully-bounce" :vol (the float (-> self bounce-volume))) (set! gp-0 0) (until (not (-> self bounced?)) (set! (-> self bounced?) #f) - (ja-channel-push! 1 60) - (let ((s5-3 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-3 - (the-as art-joint-anim (-> self draw art-group data 11)) - num-func-identity - ) - (set! (-> s5-3 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! bully-idle-bounced-ja :num! min) (until v1-35 (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) (set! v1-35 (or (ja-done? 0) (-> self bounced?))) ) ) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) ) ) ) @@ -993,46 +778,24 @@ (go bully-start-spinning) (none) ) - :post - bully-post + :post bully-post ) ;; failed to figure out what this is: (defstate bully-die (bully) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (shut-down! (-> self neck)) (logclear! (-> self mask) (process-mask actor-pause)) - (let ((gp-0 (get-process *default-dead-pool* bully-broken-cage #x4000))) - (when gp-0 - (let ((t9-3 (method-of-type bully-broken-cage activate))) - (t9-3 (the-as bully-broken-cage gp-0) self 'bully-broken-cage (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 bully-broken-cage-init-by-other (-> self entity)) - (-> gp-0 ppointer) - ) - ) + (process-spawn bully-broken-cage (-> self entity) :to self) (spawn (-> self part) (-> self root-override trans)) (clear-collide-with-as (-> self root-override)) (drop-pickup (-> self fact-override) #t *entity-pool* (-> self fact-override) 0) - (ja-channel-push! 1 22) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! bully-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (increment-success-for-hint (game-text-id sunken-bully-dive-hint)) (logior! (-> self draw status) (draw-status hidden)) @@ -1041,8 +804,7 @@ ) (none) ) - :post - (the-as (function none :behavior bully) transform-post) + :post (the-as (function none :behavior bully) transform-post) ) ;; definition for method 7 of type bully @@ -1106,7 +868,7 @@ (initialize-skeleton obj *bully-sg* '()) (set! (-> obj draw shadow-ctrl) *bully-shadow-control*) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 454) obj)) (set! (-> obj fact-override) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) diff --git a/test/decompiler/reference/levels/sunken/double-lurker_REF.gc b/test/decompiler/reference/levels/sunken/double-lurker_REF.gc index ee679e5862..907e3b6469 100644 --- a/test/decompiler/reference/levels/sunken/double-lurker_REF.gc +++ b/test/decompiler/reference/levels/sunken/double-lurker_REF.gc @@ -1,6 +1,9 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/double-lurker-ag.gc") +(import "goal_src/import/double-lurker-top-ag.gc") + ;; definition of type double-lurker-top (deftype double-lurker-top (nav-enemy) ((parent-process (pointer double-lurker) :offset 12) @@ -68,24 +71,26 @@ ) ;; failed to figure out what this is: -(defskelgroup *double-lurker-sg* double-lurker - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 4.5) - :longest-edge (meters 1) - :shadow 4 - ) +(defskelgroup *double-lurker-sg* double-lurker double-lurker-lod0-jg double-lurker-both-idle-ja + ((double-lurker-lod0-mg (meters 20)) + (double-lurker-lod1-mg (meters 40)) + (double-lurker-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 1 0 4.5) + :longest-edge (meters 1) + :shadow double-lurker-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *double-lurker-top-sg* double-lurker-top - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0.5 0 4.5) - :longest-edge (meters 1) - :shadow 4 - ) +(defskelgroup *double-lurker-top-sg* double-lurker-top double-lurker-top-lod0-jg -1 + ((double-lurker-top-lod0-mg (meters 20)) + (double-lurker-top-lod1-mg (meters 40)) + (double-lurker-top-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0.5 0 4.5) + :longest-edge (meters 1) + :shadow double-lurker-top-shadow-mg + ) ;; definition for symbol *double-lurker-top-nav-enemy-info*, type nav-enemy-info (define *double-lurker-top-nav-enemy-info* (new 'static 'nav-enemy-info @@ -136,7 +141,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -191,7 +196,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -246,7 +251,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -254,8 +259,7 @@ ;; failed to figure out what this is: (defstate double-lurker-top-on-shoulders (double-lurker-top) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (let ((v1-1 (-> self fall-dest)) @@ -279,9 +283,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (clone-anim-once (ppointer->handle (-> self parent-process)) (the-as int (-> self draw origin-joint-index)) @@ -297,77 +300,47 @@ ;; failed to figure out what this is: (defstate double-lurker-top-on-shoulders-die (double-lurker-top) - :code - (behavior () + :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 30) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 18))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 18)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) 1.0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 18)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! double-lurker-bottom-take-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (none) ) - :post - (the-as (function none :behavior double-lurker-top) ja-post) + :post (the-as (function none :behavior double-lurker-top) ja-post) ) ;; failed to figure out what this is: (defstate double-lurker-top-knocked-down (double-lurker-top) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'shove) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (let ((v1-4 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-4 shove-up) 12288.0) - (set! (-> v1-4 shove-back) 8192.0) - (set! (-> a1-2 param 1) (the-as uint v1-4)) - ) - (send-event-function arg0 a1-2) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 3)) (shove-back (meters 2)))) ) ) ) ) - :code - (behavior ((arg0 object) (arg1 vector) (arg2 vector)) + :code (behavior ((arg0 object) (arg1 vector) (arg2 vector)) (dummy-51 self) (let ((v1-3 (-> self draw shadow-ctrl))) - (set! (-> v1-3 settings flags) (logand -33 (-> v1-3 settings flags))) + (logclear! (-> v1-3 settings flags) (shadow-flags disable-draw)) ) 0 - (set! (-> self collide-info nav-flags) (logand -2 (-> self collide-info nav-flags))) - (logior! (-> self collide-info nav-flags) 2) + (logclear! (-> self collide-info nav-flags) (nav-flags navf0)) + (logior! (-> self collide-info nav-flags) (nav-flags navf1)) (set! (-> self nav extra-nav-sphere quad) (-> self fall-dest quad)) (set! (-> self nav extra-nav-sphere w) 9011.2) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self collide-info trans quad)) - (ja-channel-push! 1 30) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-14 param 1) 1.0) - (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! double-lurker-both-break-apart-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (vector-lerp! (-> self collide-info trans) @@ -376,27 +349,21 @@ (fmin 1.0 (/ (ja-frame-num 0) (ja-aframe 44.0 0))) ) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) - (logior! (-> self collide-info nav-flags) 1) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logior! (-> self collide-info nav-flags) (nav-flags navf0)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (TODO-RENAME-27 (-> self nav)) (go double-lurker-top-resume) (none) ) - :post - (the-as (function none :behavior double-lurker-top) transform-post) + :post (the-as (function none :behavior double-lurker-top) transform-post) ) ;; failed to figure out what this is: (defstate double-lurker-top-resume (double-lurker-top) - :code - (behavior () + :code (behavior () (cond ((not *target*) (go-virtual nav-enemy-idle) @@ -423,18 +390,10 @@ ;; failed to figure out what this is: (defstate nav-enemy-patrol (double-lurker-top) :virtual #t - :code - (behavior () - (ja-channel-push! 1 60) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info walk-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-patrol) code))) (if t9-1 ((the-as (function none) t9-1)) @@ -447,8 +406,7 @@ ;; failed to figure out what this is: (defstate nav-enemy-die (double-lurker-top) :virtual #t - :enter - (behavior () + :enter (behavior () (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-2 user-int8 1) 1) @@ -466,7 +424,7 @@ ;; definition for method 51 of type double-lurker-top (defmethod dummy-51 double-lurker-top ((obj double-lurker-top)) (restore-collide-with-as (-> obj collide-info)) - (logior! (-> obj collide-info nav-flags) 1) + (logior! (-> obj collide-info nav-flags) (nav-flags navf0)) (TODO-RENAME-27 (-> obj nav)) (none) ) @@ -543,7 +501,7 @@ ) ;; definition for method 48 of type double-lurker-top -;; INFO: Return type mismatch uint vs none. +;; INFO: Return type mismatch nav-flags vs none. ;; Used lq/sq (defmethod TODO-RENAME-48 double-lurker-top ((obj double-lurker-top)) (initialize-skeleton obj *double-lurker-top-sg* '()) @@ -554,7 +512,7 @@ (set-vector! (-> obj collide-info scale) 1.0 1.0 1.0 1.0) (quaternion-copy! (-> obj collide-info quat) (-> v1-5 0 collide-info quat)) ) - (set! (-> obj collide-info nav-flags) (logand -2 (-> obj collide-info nav-flags))) + (logclear! (-> obj collide-info nav-flags) (nav-flags navf0)) (none) ) @@ -569,31 +527,17 @@ (cond (arg2 (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! double-lurker-both-idle-ja :num! min) (transform-post) (let ((v1-13 (-> self draw shadow-ctrl))) - (logior! (-> v1-13 settings flags) 32) + (logior! (-> v1-13 settings flags) (shadow-flags disable-draw)) ) 0 (go double-lurker-top-on-shoulders) ) (else (ja-channel-set! 1) - (let ((gp-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-2 - (the-as art-joint-anim (-> self draw art-group data 12)) - num-func-identity - ) - (set! (-> gp-2 frame-num) 0.0) - ) + (ja :group! double-lurker-idle-ja :num! min) (transform-post) (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background)) (dummy-51 self) @@ -624,22 +568,16 @@ ((and (>= (-> s4-0 y) 8192.0) (>= 14563.556 (fabs (deg- (quaternion-y-angle (-> self collide-info quat)) (atan (-> s4-0 x) (-> s4-0 z))))) ) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'shove) - (set! (-> a1-4 param 0) (-> arg3 param 0)) - (let ((v1-13 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-13 shove-up) 12288.0) - (set! (-> v1-13 shove-back) 8192.0) - (set! (-> a1-4 param 1) (the-as uint v1-13)) - ) - (when (send-event-function arg0 a1-4) - (increment-success-for-hint (game-text-id sunken-double-lurker-hint)) - (go double-lurker-buddy-was-hit) - (return #f) - v0-0 - ) + (when (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 3)) (shove-back (meters 2)))) + ) + (increment-success-for-hint (game-text-id sunken-double-lurker-hint)) + (go double-lurker-buddy-was-hit) + (return #f) + v0-0 ) ) (else @@ -649,17 +587,11 @@ (collide-action solid) (collide-action) ) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'shove) - (set! (-> a1-6 param 0) (-> arg3 param 0)) - (let ((v1-23 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-23 shove-up) 12288.0) - (set! (-> v1-23 shove-back) 8192.0) - (set! (-> a1-6 param 1) (the-as uint v1-23)) - ) - (send-event-function arg0 a1-6) + (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 3)) (shove-back (meters 2)))) ) ) (level-hint-spawn @@ -689,24 +621,20 @@ ;; failed to figure out what this is: (defstate double-lurker-show-anims (double-lurker) - :trans - (behavior () + :trans (behavior () 0 (none) ) - :code - (behavior () + :code (behavior () 0 (none) ) - :post - (the-as (function none :behavior double-lurker) transform-post) + :post (the-as (function none :behavior double-lurker) transform-post) ) ;; failed to figure out what this is: (defstate double-lurker-resume (double-lurker) - :code - (behavior () + :code (behavior () (cond ((not *target*) (go-virtual nav-enemy-idle) @@ -733,27 +661,17 @@ ;; failed to figure out what this is: (defstate nav-enemy-idle (double-lurker) :virtual #t - :event - double-lurker-default-event-handler + :event double-lurker-default-event-handler ) ;; failed to figure out what this is: (defstate nav-enemy-patrol (double-lurker) :virtual #t - :event - double-lurker-default-event-handler - :code - (behavior () - (ja-channel-push! 1 60) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) + :event double-lurker-default-event-handler + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info walk-anim))) + (ja :num-func num-func-identity :frame-num 0.0) (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-patrol) code))) (if t9-1 ((the-as (function none) t9-1)) @@ -766,10 +684,8 @@ ;; failed to figure out what this is: (defstate nav-enemy-notice (double-lurker) :virtual #t - :event - double-lurker-default-event-handler - :enter - (behavior () + :event double-lurker-default-event-handler + :enter (behavior () (start-hint-timer (game-text-id sunken-double-lurker-hint)) (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-notice) enter))) (if t9-1 @@ -783,36 +699,31 @@ ;; failed to figure out what this is: (defstate nav-enemy-chase (double-lurker) :virtual #t - :event - double-lurker-default-event-handler + :event double-lurker-default-event-handler ) ;; failed to figure out what this is: (defstate nav-enemy-stop-chase (double-lurker) :virtual #t - :event - double-lurker-default-event-handler + :event double-lurker-default-event-handler ) ;; failed to figure out what this is: (defstate nav-enemy-stare (double-lurker) :virtual #t - :event - double-lurker-default-event-handler + :event double-lurker-default-event-handler ) ;; failed to figure out what this is: (defstate nav-enemy-victory (double-lurker) :virtual #t - :event - double-lurker-default-event-handler + :event double-lurker-default-event-handler ) ;; failed to figure out what this is: (defstate nav-enemy-die (double-lurker) :virtual #t - :enter - (behavior () + :enter (behavior () (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-2 user-int8 0) 1) @@ -829,13 +740,11 @@ ;; failed to figure out what this is: (defstate double-lurker-both-knocked-back (double-lurker) - :enter - (behavior () + :enter (behavior () (set! (-> self knocked-back-speed) 40960.0) (none) ) - :trans - (behavior () + :trans (behavior () (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -964,31 +873,17 @@ (none) ) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! double-lurker-both-take-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go double-lurker-resume) (none) ) - :post - (the-as (function none :behavior double-lurker) nav-enemy-simple-post) + :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post) ) ;; definition for method 52 of type double-lurker @@ -1081,7 +976,7 @@ (collide-kind background) obj s4-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -1095,8 +990,7 @@ ;; failed to figure out what this is: (defstate double-lurker-buddy-was-hit (double-lurker) - :code - (behavior () + :code (behavior () (set! (-> self buddy-on-shoulders?) #f) (let ((v1-2 (-> self entity extra perm))) (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) @@ -1117,43 +1011,26 @@ ;; failed to figure out what this is: (defstate double-lurker-break-apart (double-lurker) - :event - double-lurker-default-event-handler - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + :event double-lurker-default-event-handler + :code (behavior () + (ja-no-eval :group! double-lurker-both-break-apart-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go double-lurker-resume) (none) ) - :post - (the-as (function none :behavior double-lurker) nav-enemy-simple-post) + :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate double-lurker-knocked-back (double-lurker) - :enter - (behavior () + :enter (behavior () (set! (-> self knocked-back-speed) 40960.0) (none) ) - :trans - (behavior () + :trans (behavior () (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -1282,37 +1159,22 @@ (none) ) ) - :code - (behavior () - (ja-channel-push! 1 60) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 18))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 18)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 18)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! double-lurker-bottom-take-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go double-lurker-resume) (none) ) - :post - (the-as (function none :behavior double-lurker) nav-enemy-simple-post) + :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate double-lurker-waiting-to-die (double-lurker) - :code - (behavior () + :code (behavior () (clear-collide-with-as (-> self collide-info)) (logior! (-> self draw status) (draw-status hidden)) (until (not (-> self child)) @@ -1464,7 +1326,7 @@ ;; Used lq/sq (defmethod TODO-RENAME-48 double-lurker ((obj double-lurker)) (set! (-> obj buddy-handle) (the-as handle #f)) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (set! (-> obj align) (new 'process 'align-control obj)) (initialize-skeleton obj *double-lurker-sg* '()) (set! (-> obj draw origin-joint-index) (the-as uint 3)) @@ -1504,26 +1366,11 @@ (if (-> obj buddy-on-shoulders?) (set! (-> s5-0 quad) (-> obj collide-info trans quad)) ) - (let ((s4-0 (get-process *default-dead-pool* double-lurker-top #x4000))) - (set! (-> obj buddy-handle) - (ppointer->handle - (when s4-0 - (let ((t9-6 (method-of-type double-lurker-top activate))) - (t9-6 (the-as double-lurker-top s4-0) obj 'double-lurker-top (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-0 - double-lurker-top-init-by-other - (-> obj entity) - obj - (-> obj buddy-on-shoulders?) - s5-0 - ) - (-> s4-0 ppointer) - ) - ) + (set! (-> obj buddy-handle) + (ppointer->handle + (process-spawn double-lurker-top (-> obj entity) obj (-> obj buddy-on-shoulders?) s5-0 :to obj) ) - ) + ) ) ) (when (and (not (-> obj dead?)) (not (-> obj buddy-on-shoulders?))) diff --git a/test/decompiler/reference/levels/sunken/floating-launcher_REF.gc b/test/decompiler/reference/levels/sunken/floating-launcher_REF.gc index 74b1dfbb65..92a7f48754 100644 --- a/test/decompiler/reference/levels/sunken/floating-launcher_REF.gc +++ b/test/decompiler/reference/levels/sunken/floating-launcher_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/floating-launcher-ag.gc") + ;; definition of type floating-launcher (deftype floating-launcher (baseplat) ((trigger-height float :offset-assert 228) @@ -28,53 +30,45 @@ ) ;; failed to figure out what this is: -(defskelgroup *floating-launcher-sg* floating-launcher - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *floating-launcher-sg* floating-launcher floating-launcher-lod0-jg floating-launcher-idle-ja + ((floating-launcher-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) ;; failed to figure out what this is: (defstate floating-launcher-idle (floating-launcher) - :event - (the-as (function process int symbol event-message-block object :behavior floating-launcher) plat-event) - :trans - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior floating-launcher) plat-event) + :trans (behavior () (plat-trans) (when (< (vector-xz-length (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root-override trans))) 81920.0 ) - (if (and (>= (-> (target-pos 0) y) (-> self trigger-height)) (logtest? (-> *target* control status) 2)) + (if (and (>= (-> (target-pos 0) y) (-> self trigger-height)) + (logtest? (-> *target* control status) (cshape-moving-flags onground)) + ) (go floating-launcher-lowering) ) ) (none) ) - :code - (behavior () + :code (behavior () (transform-post) (suspend) (transform-post) (suspend) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior floating-launcher) plat-post) + :post (the-as (function none :behavior floating-launcher) plat-post) ) ;; failed to figure out what this is: (defstate floating-launcher-lowering (floating-launcher) - :event - (the-as (function process int symbol event-message-block object :behavior floating-launcher) plat-event) - :trans - (the-as (function none :behavior floating-launcher) plat-trans) - :code - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior floating-launcher) plat-event) + :trans (the-as (function none :behavior floating-launcher) plat-trans) + :code (behavior () (let ((a0-1 (entity-actor-lookup (-> self entity) 'alt-actor 0))) (if a0-1 (entity-birth-no-kill a0-1) @@ -95,20 +89,15 @@ (go floating-launcher-ready) (none) ) - :post - (the-as (function none :behavior floating-launcher) plat-post) + :post (the-as (function none :behavior floating-launcher) plat-post) ) ;; failed to figure out what this is: (defstate floating-launcher-ready (floating-launcher) - :event - (the-as (function process int symbol event-message-block object :behavior floating-launcher) plat-event) - :trans - (the-as (function none :behavior floating-launcher) plat-trans) - :code - (the-as (function none :behavior floating-launcher) plat-code) - :post - (the-as (function none :behavior floating-launcher) plat-post) + :event (the-as (function process int symbol event-message-block object :behavior floating-launcher) plat-event) + :trans (the-as (function none :behavior floating-launcher) plat-trans) + :code (the-as (function none :behavior floating-launcher) plat-code) + :post (the-as (function none :behavior floating-launcher) plat-post) ) ;; definition for method 11 of type floating-launcher @@ -139,21 +128,8 @@ (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (eval-path-curve-div! (-> obj path) (-> obj root-override trans) 1.0 'interp) - (let ((f30-0 (res-lump-float arg0 'spring-height :default 163840.0)) - (s4-1 (get-process *default-dead-pool* launcher #x4000)) - ) - (set! (-> obj launcher) - (the-as - (pointer launcher) - (when s4-1 - (let ((t9-11 (method-of-type launcher activate))) - (t9-11 (the-as launcher s4-1) obj 'launcher (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 launcher-init-by-other (-> obj root-override trans) f30-0 0 81920.0) - (-> s4-1 ppointer) - ) - ) - ) + (let ((f30-0 (res-lump-float arg0 'spring-height :default 163840.0))) + (set! (-> obj launcher) (process-spawn launcher (-> obj root-override trans) f30-0 0 81920.0 :to obj)) ) (initialize-skeleton obj *floating-launcher-sg* '()) (logior! (-> obj skel status) (janim-status inited)) diff --git a/test/decompiler/reference/levels/sunken/helix-water_REF.gc b/test/decompiler/reference/levels/sunken/helix-water_REF.gc index 88bd38bc84..c45fb7e719 100644 --- a/test/decompiler/reference/levels/sunken/helix-water_REF.gc +++ b/test/decompiler/reference/levels/sunken/helix-water_REF.gc @@ -1,6 +1,9 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/helix-slide-door-ag.gc") +(import "goal_src/import/helix-button-ag.gc") + ;; definition of type helix-slide-door (deftype helix-slide-door (process-drawable) ((root-override collide-shape :offset 112) @@ -25,13 +28,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *helix-slide-door-sg* helix-slide-door - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 12 0 18) - :longest-edge (meters 0) - ) +(defskelgroup *helix-slide-door-sg* helix-slide-door helix-slide-door-lod0-jg helix-slide-door-idle-ja + ((helix-slide-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 12 0 18) + ) ;; definition of type helix-button (deftype helix-button (process-drawable) @@ -69,13 +69,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *helix-button-sg* helix-button - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 3.5 0 5.4) - :longest-edge (meters 0) - ) +(defskelgroup *helix-button-sg* helix-button helix-button-lod0-jg helix-button-idle-ja + ((helix-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3.5 0 5.4) + ) ;; definition of type helix-dark-eco (deftype helix-dark-eco (dark-eco-pool) @@ -134,8 +131,7 @@ ;; failed to figure out what this is: (defstate water-vol-idle (helix-dark-eco) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (let ((a0-1 (-> self sound))) @@ -148,8 +144,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (let ((t9-0 (-> (method-of-type dark-eco-pool water-vol-idle) enter))) (if t9-0 (t9-0) @@ -161,8 +156,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((t9-0 (-> (method-of-type dark-eco-pool water-vol-idle) trans))) (if t9-0 (t9-0) @@ -171,8 +165,7 @@ (update! (-> self sound)) (none) ) - :post - (behavior () + :post (behavior () (let ((t9-0 (-> (method-of-type dark-eco-pool water-vol-idle) post))) (if t9-0 ((the-as (function none :behavior helix-dark-eco) t9-0)) @@ -185,17 +178,15 @@ ;; failed to figure out what this is: (defstate helix-slide-door-idle-open (helix-slide-door) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go helix-slide-door-close) ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) @@ -204,38 +195,23 @@ ;; failed to figure out what this is: (defstate helix-slide-door-close (helix-slide-door) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (transform-post) (go helix-slide-door-idle-closed) (none) ) - :post - (the-as (function none :behavior helix-slide-door) transform-post) + :post (the-as (function none :behavior helix-slide-door) transform-post) ) ;; failed to figure out what this is: (defstate helix-slide-door-idle-closed (helix-slide-door) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -281,8 +257,7 @@ ;; failed to figure out what this is: (defstate helix-button-startup (helix-button) - :code - (behavior () + :code (behavior () (when (not (task-complete? *game-info* (game-task sunken-slide))) (let ((a0-1 (new 'stack-no-clear 'vector))) (set! (-> a0-1 quad) (-> self root-override trans quad)) @@ -311,12 +286,11 @@ ;; failed to figure out what this is: (defstate helix-button-idle-up (helix-button) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) (when *target* - (when (logtest? (-> *target* control status) 1) + (when (logtest? (-> *target* control status) (cshape-moving-flags onsurf)) (cond ((and (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) (not (handle->process (-> self fcell-handle))) @@ -333,9 +307,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -345,41 +318,33 @@ ;; failed to figure out what this is: (defstate helix-button-activate (helix-button) - :trans - (the-as (function none :behavior helix-button) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior helix-button) rider-trans) + :code (behavior () (local-vars (v1-7 symbol)) (let ((a0-1 (handle->process (-> self fcell-handle)))) (when a0-1 (send-event a0-1 'pickup) (until v1-7 (suspend) - (set! v1-7 (or (not *target*) (zero? (logand (-> *target* state-flags) 256)))) + (set! v1-7 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) ) ) ) - (let* ((gp-0 (the-as sunkencam (get-process *default-dead-pool* sunkencam #x4000))) - (v1-11 - (when gp-0 - (let ((t9-2 (method-of-type sunkencam activate))) - (t9-2 gp-0 self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> self spawn-trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> gp-0 ppointer-override) - ) - ) - ) - (set! (-> v1-11 0 seq) (the-as uint 2)) + (let ((v1-11 + (process-spawn + sunkencam + :init pov-camera-init-by-other + (-> self spawn-trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + :to self + ) + ) + ) + (set! (-> (the-as (pointer sunkencam) v1-11) 0 seq) (the-as uint 2)) ) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) self) @@ -420,7 +385,7 @@ (game-task none) ) (send-event *target* 'play-anim 'shock-in) - (sound-play-by-name (static-sound-name "prec-button8") (new-sound-id) 1024 0 0 1 #t) + (sound-play "prec-button8") (set! (-> self root-override transv quad) (the-as uint128 0)) (let ((gp-3 5)) (until (<= gp-3 0) @@ -449,7 +414,7 @@ (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.25)) (suspend) ) - (sound-play-by-name (static-sound-name "maindoor") (new-sound-id) 1024 0 0 1 #t) + (sound-play "maindoor") (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.9)) (suspend) ) @@ -504,16 +469,13 @@ (go helix-button-idle-down) (none) ) - :post - (the-as (function none :behavior helix-button) rider-post) + :post (the-as (function none :behavior helix-button) rider-post) ) ;; failed to figure out what this is: (defstate helix-button-quick-activate (helix-button) - :trans - (the-as (function none :behavior helix-button) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior helix-button) rider-trans) + :code (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) (set! (-> a1-0 num-params) 0) @@ -529,8 +491,8 @@ ) ) ) - (sound-play-by-name (static-sound-name "prec-button8") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "maindoor") (new-sound-id) 1024 0 0 1 #t) + (sound-play "prec-button8") + (sound-play "maindoor") (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) self) (set! (-> a1-3 num-params) 0) @@ -588,15 +550,13 @@ (go helix-button-idle-down) (none) ) - :post - (the-as (function none :behavior helix-button) rider-post) + :post (the-as (function none :behavior helix-button) rider-post) ) ;; failed to figure out what this is: (defstate helix-button-idle-down (helix-button) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) @@ -699,56 +659,51 @@ ;; failed to figure out what this is: (defstate helix-water-idle (helix-water) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'trigger) (go helix-water-activated) ) ((= v1-0 'music) - (set-setting! *setting-control* self 'music 'danger 0.0 0) + (set-setting! 'music 'danger 0.0 0) ) ) ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self root trans y) (-> self start-y)) (set! (-> self last-alt-actor-consumed) -1) (set! (-> self transv-y) 9216.0) (suspend) (send-event (ppointer->process (-> self dark-eco)) 'move-to (-> self root trans)) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior helix-water) ja-post) + :post (the-as (function none :behavior helix-water) ja-post) ) ;; failed to figure out what this is: (defstate helix-water-activated (helix-water) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notify) (when (= (-> arg0 type) launcherdoor) - (clear-pending-settings-from-process *setting-control* self 'music) + (remove-setting! 'music) (go helix-water-idle) ) ) ) ) - :trans - (behavior () - (set! (-> self root scale y) (seek (-> self root scale y) 0.8 (* 0.667 (-> *display* seconds-per-frame)))) + :trans (behavior () + (seek! (-> self root scale y) 0.8 (* 0.667 (-> *display* seconds-per-frame))) (when *target* (let ((f0-4 (-> (target-pos 0) y))) - (when (zero? (logand (-> *target* state-flags) 256)) + (when (zero? (logand (-> *target* state-flags) (state-flags grabbed))) (let* ((f0-5 (- f0-4 (-> self root trans y))) (f0-6 (+ -40960.0 f0-5)) (f0-7 (* 0.000024414063 f0-6)) @@ -774,17 +729,15 @@ (dummy-21 self) (none) ) - :code - (behavior () + :code (behavior () (send-event (ppointer->process (-> self dark-eco)) 'trigger) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior helix-water) ja-post) + :post (the-as (function none :behavior helix-water) ja-post) ) ;; definition for method 7 of type helix-water @@ -816,20 +769,7 @@ ) ) (set! (-> obj root trans y) (-> obj start-y)) - (let ((s5-1 (get-process *default-dead-pool* helix-dark-eco #x4000))) - (set! (-> obj dark-eco) - (the-as - (pointer helix-dark-eco) - (when s5-1 - (let ((t9-6 (method-of-type helix-dark-eco activate))) - (t9-6 (the-as helix-dark-eco s5-1) obj 'helix-dark-eco (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 water-vol-init-by-other (-> obj entity)) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> obj dark-eco) (process-spawn helix-dark-eco :init water-vol-init-by-other (-> obj entity) :to obj)) (set! *helix-water* obj) (go helix-water-idle) (none) diff --git a/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc b/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc index 95433dd76d..c330d42703 100644 --- a/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc +++ b/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc @@ -1,6 +1,9 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/orbit-plat-ag.gc") +(import "goal_src/import/orbit-plat-bottom-ag.gc") + ;; definition of type orbit-plat-bottom (deftype orbit-plat-bottom (process-drawable) ((parent-override (pointer orbit-plat) :offset 12) @@ -28,13 +31,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *orbit-plat-bottom-sg* orbit-plat-bottom - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.8) - :longest-edge (meters 0) - ) +(defskelgroup *orbit-plat-bottom-sg* orbit-plat-bottom orbit-plat-bottom-lod0-jg orbit-plat-bottom-idle-ja + ((orbit-plat-bottom-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.8) + ) ;; definition of type orbit-plat (deftype orbit-plat (baseplat) @@ -80,20 +80,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *orbit-plat-sg* orbit-plat - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3.4) - :longest-edge (meters 0) - ) +(defskelgroup *orbit-plat-sg* orbit-plat orbit-plat-lod0-jg orbit-plat-idle-ja + ((orbit-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.4) + ) ;; failed to figure out what this is: (defpartgroup group-orbit-plat-jet :id 440 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1715 :fade-after (meters 100) :falloff-to (meters 120) :period 150 :length 75) + :parts ((sp-item 1715 :fade-after (meters 100) :falloff-to (meters 120) :period 150 :length 75) (sp-item 1715 :fade-after (meters 100) :falloff-to (meters 120) :period 75 :length 96) (sp-item 1715 :fade-after (meters 140) :falloff-to (meters 160) :period 90 :length 60) (sp-item 1716 :fade-after (meters 100) :falloff-to (meters 100)) @@ -102,8 +98,7 @@ ;; failed to figure out what this is: (defpart 1716 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -125,17 +120,9 @@ ;; failed to figure out what this is: (defpart 1715 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "steam-medium") - :volume #x333 - ) - ) + (sp-sound (static-sound-spec "steam-medium" :num 0.05 :volume 80.0)) (sp-rnd-flt spt-scale-x (meters 0.75) (meters 0.75) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -157,8 +144,7 @@ ;; failed to figure out what this is: (defpart 1717 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 3.0 1.0) (sp-rnd-flt spt-scale-x (meters 1.7) (meters 0.3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -204,9 +190,8 @@ ;; failed to figure out what this is: (defstate orbit-plat-bottom-idle (orbit-plat-bottom) - :code - (behavior () - (while #t + :code (behavior () + (loop (set! (-> self root trans quad) (-> self parent-override 0 root-override trans quad)) (set! (-> self root trans y) (+ -5324.8 (-> self root trans y))) (spawn (-> self part2) (-> self root trans)) @@ -276,8 +261,7 @@ ) (none) ) - :post - (the-as (function none :behavior orbit-plat-bottom) ja-post) + :post (the-as (function none :behavior orbit-plat-bottom) ja-post) ) ;; definition for method 7 of type orbit-plat-bottom @@ -301,7 +285,7 @@ ;; definition for function orbit-plat-bottom-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior orbit-plat-bottom-init-by-other orbit-plat-bottom ((arg0 entity) (arg1 orbit-plat)) +(defbehavior orbit-plat-bottom-init-by-other orbit-plat-bottom ((arg0 entity-actor) (arg1 orbit-plat)) (set! (-> self entity) arg0) (set! (-> self mask) (logior (process-mask platform) (-> self mask))) (set! (-> self root) (new 'process 'trsqv)) @@ -313,22 +297,14 @@ (set! (-> self part2) (create-launch-control (-> *part-group-id-table* 107) self)) (initialize-skeleton self *orbit-plat-bottom-sg* '()) (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! orbit-plat-idle-ja :num! min) (go orbit-plat-bottom-idle) (none) ) ;; failed to figure out what this is: (defstate orbit-plat-idle (orbit-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'bonk) @@ -364,28 +340,18 @@ ) ) ) - :trans - (the-as (function none :behavior orbit-plat) plat-trans) - :code - (behavior () + :trans (the-as (function none :behavior orbit-plat) plat-trans) + :code (behavior () (set! (-> self plat-status) (the-as uint 0)) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 0.0) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek! 0.0)) (dotimes (gp-0 2) (transform-post) (suspend) - (when (not (ja-done? 0)) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) 0.0) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) + (if (not (ja-done? 0)) + (ja :num! (seek! 0.0)) ) - ) ) - (while #t + (loop (when (nonzero? (-> self root-override riders num-riders)) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) self) @@ -405,13 +371,9 @@ (go orbit-plat-riding) ) (suspend) - (when (not (ja-done? 0)) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 0.0) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) + (if (not (ja-done? 0)) + (ja :num! (seek! 0.0)) ) - ) (when (not (-> self is-reset?)) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) self) @@ -432,8 +394,7 @@ ) (none) ) - :post - (the-as (function none :behavior orbit-plat) plat-post) + :post (the-as (function none :behavior orbit-plat) plat-post) ) ;; definition for method 28 of type orbit-plat @@ -459,8 +420,7 @@ ;; failed to figure out what this is: (defstate orbit-plat-still (orbit-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'bonk) @@ -473,17 +433,11 @@ ) ) ) - :trans - (the-as (function none :behavior orbit-plat) plat-trans) - :code - (behavior () + :trans (the-as (function none :behavior orbit-plat) plat-trans) + :code (behavior () (set! (-> self plat-status) (the-as uint 0)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 0.0) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek! 0.0)) (until (dummy-28 self) (when (nonzero? (-> self root-override riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -504,36 +458,24 @@ (go orbit-plat-riding) ) (suspend) - (when (not (ja-done? 0)) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) 0.0) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) + (if (not (ja-done? 0)) + (ja :num! (seek! 0.0)) ) - ) ) (go orbit-plat-idle) (none) ) - :post - (the-as (function none :behavior orbit-plat) plat-post) + :post (the-as (function none :behavior orbit-plat) plat-post) ) ;; failed to figure out what this is: (defstate orbit-plat-riding (orbit-plat) - :event - (the-as (function process int symbol event-message-block object :behavior orbit-plat) plat-event) - :trans - (the-as (function none :behavior orbit-plat) plat-trans) - :code - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior orbit-plat) plat-event) + :trans (the-as (function none :behavior orbit-plat) plat-trans) + :code (behavior () (set! (-> self plat-status) (the-as uint 1)) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) - (while #t + (ja-no-eval :num! (seek!)) + (loop (when (zero? (-> self root-override riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) @@ -553,18 +495,13 @@ (go orbit-plat-still) ) (suspend) - (when (not (ja-done? 0)) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) + (if (not (ja-done? 0)) + (ja :num! (seek!)) ) - ) ) (none) ) - :post - (the-as (function none :behavior orbit-plat) plat-post) + :post (the-as (function none :behavior orbit-plat) plat-post) ) ;; definition for function get-rotate-point! @@ -591,7 +528,7 @@ ;; Used lq/sq (defun get-nav-point! ((arg0 vector) (arg1 orbit-plat) (arg2 vector) (arg3 float)) (set! (-> arg1 nav target-pos quad) (-> arg2 quad)) - (logclear! (-> arg1 nav flags) (nav-control-flags bit19)) + (logclear! (-> arg1 nav flags) (nav-control-flags navcf19)) (dummy-11 (-> arg1 nav) (-> arg1 nav target-pos)) (let ((f0-0 (vector-length (-> arg1 nav travel)))) (if (< arg3 f0-0) @@ -607,8 +544,7 @@ ;; failed to figure out what this is: (defstate orbit-plat-rotating (orbit-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'bonk) @@ -621,10 +557,8 @@ ) ) ) - :trans - (the-as (function none :behavior orbit-plat) plat-trans) - :code - (behavior () + :trans (the-as (function none :behavior orbit-plat) plat-trans) + :code (behavior () (set! (-> self plat-status) (the-as uint 2)) (set! (-> self is-reset?) #f) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -648,11 +582,7 @@ (vector-! a0-0 (-> self basetrans) gp-0) (let ((f30-0 (vector-length a0-0))) (set! (-> self reset-length) f30-0) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 0.0) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja-no-eval :num! (seek! 0.0)) (label cfg-3) (dotimes (s4-0 2) (get-rotate-point! s5-0 gp-0 (-> self basetrans) (the-as vector f30-0) (-> self rot-dir) 40960.0) @@ -667,18 +597,13 @@ ) (label cfg-9) (suspend) - (when (not (ja-done? 0)) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) 0.0) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) + (if (not (ja-done? 0)) + (ja :num! (seek! 0.0)) ) - ) (b! #t cfg-3 :delay (nop!)) (none) ) - :post - (the-as (function none :behavior orbit-plat) plat-post) + :post (the-as (function none :behavior orbit-plat) plat-post) ) ;; definition for method 27 of type orbit-plat @@ -759,7 +684,7 @@ ) ) (when (>= 614.4 (vector-vector-xz-distance (-> obj basetrans) (-> obj reset-trans))) - (set! v0-11 (logior (nav-control-flags bit19) (-> obj nav flags))) + (set! v0-11 (logior (nav-control-flags navcf19) (-> obj nav flags))) (set! (-> obj nav flags) (the-as nav-control-flags v0-11)) v0-11 ) @@ -786,7 +711,7 @@ (vector-normalize! s5-2 (-> obj reset-length)) (vector+! s5-2 s5-2 s4-1) (when (not (dummy-16 (-> obj nav) s5-2)) - (logclear! (-> obj nav flags) (nav-control-flags bit19)) + (logclear! (-> obj nav flags) (nav-control-flags navcf19)) (get-rotate-point! s5-2 s4-1 (-> obj basetrans) (the-as vector (-> obj reset-length)) 0.0 40960.0) (when (not (dummy-16 (-> obj nav) s5-2)) (get-rotate-point! @@ -836,8 +761,7 @@ ;; failed to figure out what this is: (defstate orbit-plat-reset (orbit-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'bonk) @@ -850,18 +774,12 @@ ) ) ) - :trans - (the-as (function none :behavior orbit-plat) plat-trans) - :code - (behavior () + :trans (the-as (function none :behavior orbit-plat) plat-trans) + :code (behavior () (set! (-> self plat-status) (the-as uint 3)) - (logclear! (-> self nav flags) (nav-control-flags bit19)) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) 0.0) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) - (while (zero? (logand (nav-control-flags bit19) (-> self nav flags))) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) + (ja-no-eval :num! (seek! 0.0)) + (while (zero? (logand (nav-control-flags navcf19) (-> self nav flags))) (dummy-27 self) (when (nonzero? (-> self root-override riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -882,33 +800,23 @@ (go orbit-plat-riding) ) (suspend) - (when (not (ja-done? 0)) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) 0.0) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) + (if (not (ja-done? 0)) + (ja :num! (seek! 0.0)) ) - ) ) (set! (-> self is-reset?) #t) (go orbit-plat-idle) (none) ) - :post - (the-as (function none :behavior orbit-plat) plat-post) + :post (the-as (function none :behavior orbit-plat) plat-post) ) ;; failed to figure out what this is: (defstate orbit-plat-wait-for-other (orbit-plat) - :code - (behavior () + :code (behavior () (set! (-> self plat-status) (the-as uint 0)) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 0.0) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) - (while #t + (ja-no-eval :num! (seek! 0.0)) + (loop (let ((v1-3 (-> self other))) (when (if v1-3 (-> v1-3 extra process) @@ -918,18 +826,13 @@ ) ) (suspend) - (when (not (ja-done? 0)) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) 0.0) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) + (if (not (ja-done? 0)) + (ja :num! (seek! 0.0)) ) - ) ) (none) ) - :post - (the-as (function none :behavior orbit-plat) ja-post) + :post (the-as (function none :behavior orbit-plat) ja-post) ) ;; definition for method 11 of type orbit-plat @@ -974,7 +877,7 @@ (update-transforms! (-> obj root-override)) (dummy-21 obj) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav gap-event) 'blocked) (set! (-> obj other) (entity-actor-lookup arg0 'alt-actor 0)) (let ((f0-7 (res-lump-float arg0 'scale :default 1.0))) @@ -984,15 +887,7 @@ (set! (-> obj rot-dir) 1.0) (set! (-> obj reset-trans quad) (-> obj basetrans quad)) (set! (-> obj is-reset?) #t) - (let ((s5-1 (get-process *default-dead-pool* orbit-plat-bottom #x4000))) - (when s5-1 - (let ((t9-18 (method-of-type orbit-plat-bottom activate))) - (t9-18 (the-as orbit-plat-bottom s5-1) obj 'orbit-plat-bottom (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 orbit-plat-bottom-init-by-other (-> obj entity) obj) - (-> s5-1 ppointer) - ) - ) + (process-spawn orbit-plat-bottom (-> obj entity) obj :to obj) (go orbit-plat-wait-for-other) (none) ) diff --git a/test/decompiler/reference/levels/sunken/puffer_REF.gc b/test/decompiler/reference/levels/sunken/puffer_REF.gc index a205477759..9956cd48a2 100644 --- a/test/decompiler/reference/levels/sunken/puffer_REF.gc +++ b/test/decompiler/reference/levels/sunken/puffer_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/puffer-ag.gc") + ;; definition of type puffer (deftype puffer (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -95,24 +97,20 @@ ) ;; failed to figure out what this is: -(defskelgroup *puffer-sg* puffer - 0 - -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 5.25) - :longest-edge (meters 1.2) - :shadow 4 - ) +(defskelgroup *puffer-sg* puffer puffer-main-lod0-jg -1 + ((puffer-main-lod0-mg (meters 20)) (puffer-main-lod1-mg (meters 40)) (puffer-main-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 5.25) + :longest-edge (meters 1.2) + :shadow puffer-main-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *puffer-mean-sg* puffer - 5 - -1 - ((6 (meters 20)) (7 (meters 40)) (8 (meters 999999))) - :bounds (static-spherem 0 1 0 5.25) - :longest-edge (meters 1.2) - :shadow 4 - ) +(defskelgroup *puffer-mean-sg* puffer puffer-mean-lod0-jg -1 + ((puffer-mean-lod0-mg (meters 20)) (puffer-mean-lod1-mg (meters 40)) (puffer-mean-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 5.25) + :longest-edge (meters 1.2) + :shadow puffer-main-shadow-mg + ) ;; definition for function puffer-default-event-handler ;; INFO: Return type mismatch none vs object. @@ -144,21 +142,15 @@ (return (the-as object #t)) ) (when (= (-> arg0 type) target) - (let ((a1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-9 from) self) - (set! (-> a1-9 num-params) 2) - (set! (-> a1-9 message) 'attack) - (set! (-> a1-9 param 0) (-> arg3 param 0)) - (let ((v1-19 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-19 shove-up) 6144.0) - (set! (-> v1-19 shove-back) 10240.0) - (set! (-> a1-9 param 1) (the-as uint v1-19)) - ) - (when (send-event-function arg0 a1-9) - (set! (-> self hit-player?) #t) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) - ) + (when (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) + ) + (set! (-> self hit-player?) #t) + (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) ) ) ) @@ -170,9 +162,13 @@ ;; INFO: Return type mismatch int vs none. (defbehavior puffer-post puffer () (when (and (-> self hit-player?) - (or (not *target*) (and (zero? (logand (-> *target* state-flags) #x80f8)) - (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) + (or (not *target*) + (and (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) + ) + (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) + ) ) ) (set-collide-offense (-> self root-override) 2 (collide-offense normal-attack)) @@ -206,12 +202,12 @@ (collide-kind background cak-3 ground-object) obj s5-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) (let ((v1-11 (-> obj draw shadow-ctrl))) - (set! (-> v1-11 settings flags) (logand -33 (-> v1-11 settings flags))) + (logclear! (-> v1-11 settings flags) (shadow-flags disable-draw)) ) 0 (let ((v1-14 (-> obj draw shadow-ctrl))) @@ -225,7 +221,7 @@ ) (else (let ((v1-19 (-> obj draw shadow-ctrl))) - (logior! (-> v1-19 settings flags) 32) + (logior! (-> v1-19 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -234,7 +230,7 @@ ) (else (let ((v1-21 (-> obj draw shadow-ctrl))) - (logior! (-> v1-21 settings flags) 32) + (logior! (-> v1-21 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -272,7 +268,10 @@ (defmethod dummy-25 puffer ((obj puffer) (arg0 float)) (when *target* (let ((gp-0 (target-pos 0))) - (when (and (zero? (logand (-> *target* state-flags) #x80f8)) + (when (and (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) (dummy-24 obj gp-0) (>= (-> gp-0 y) (+ -14336.0 (-> obj attack-bottom-y))) (>= (+ 2048.0 (-> obj top-y)) (-> gp-0 y)) @@ -625,22 +624,19 @@ ;; failed to figure out what this is: (defstate puffer-idle (puffer) - :event - puffer-default-event-handler - :enter - (behavior () + :event puffer-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self attacking?) #f) (shut-down! (-> self neck)) (let ((v1-5 (-> self draw shadow-ctrl))) - (logior! (-> v1-5 settings flags) 32) + (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) 0 (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (and (and *target* (>= (-> self fact-info-override idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -655,16 +651,13 @@ ) (none) ) - :post - puffer-post + :post puffer-post ) ;; failed to figure out what this is: (defstate puffer-patrol (puffer) - :event - puffer-default-event-handler - :enter - (behavior () + :event puffer-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self attacking?) #f) (set! (-> self reaction-delay) (rand-vu-int-range (seconds 0.1) (seconds 0.35))) @@ -676,8 +669,7 @@ (set! (-> self last-on-screen-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (not (and *target* (>= (-> self fact-info-override idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -725,38 +717,32 @@ (dummy-28 self) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (dummy-26 self) (suspend) ) (none) ) - :post - puffer-post + :post puffer-post ) ;; failed to figure out what this is: (defstate puffer-attack (puffer) - :event - puffer-default-event-handler - :enter - (behavior () + :event puffer-default-event-handler + :enter (behavior () (set! (-> self attacking?) #t) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self travel-turn-speed) 21845.334) (none) ) - :exit - (behavior () + :exit (behavior () (shut-down! (-> self neck)) (set! (-> self attacking?) #f) (set! (-> self travel-turn-speed) 16384.0) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (dummy-25 self (-> self give-up-dist))) (go puffer-patrol) ) @@ -780,22 +766,19 @@ (dummy-28 self) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (dummy-26 self) (suspend) ) (none) ) - :post - puffer-post + :post puffer-post ) ;; failed to figure out what this is: (defstate puffer-die (puffer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as uint @@ -813,34 +796,20 @@ ) ) ) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (shut-down! (-> self neck)) (logclear! (-> self mask) (process-mask actor-pause)) - (ja-channel-push! 1 22) + (ja-channel-push! 1 (seconds 0.075)) (clear-collide-with-as (-> self root-override)) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 15))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 15)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!) - ) + (ja-no-eval :group! puffer-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (none) ) - :post - (the-as (function none :behavior puffer) ja-post) + :post (the-as (function none :behavior puffer) ja-post) ) ;; definition for method 21 of type puffer @@ -955,7 +924,7 @@ ) (cond ((-> obj attacking?) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (let ((s5-0 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! s5-0 @@ -997,7 +966,7 @@ ) (cond ((not (-> obj attacking?)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (let ((s5-1 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! s5-1 @@ -1039,7 +1008,7 @@ ) (cond ((ja-done? 0) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (cond ((-> obj attacking?) (let ((s5-2 (-> obj skel root-channel 0))) @@ -1078,7 +1047,7 @@ ) ) (else - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (let ((s5-4 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! s5-4 @@ -1102,7 +1071,7 @@ ) (cond ((-> obj attacking?) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (let ((s5-5 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! s5-5 @@ -1144,7 +1113,7 @@ ) (cond ((not (-> obj attacking?)) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (let ((s5-6 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! s5-6 @@ -1186,7 +1155,7 @@ ) (cond ((ja-done? 0) - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (let ((s5-7 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! s5-7 @@ -1211,7 +1180,7 @@ ) ) (else - (ja-channel-push! 1 60) + (ja-channel-push! 1 (seconds 0.2)) (let ((s5-8 (-> obj skel root-channel 0))) (joint-control-channel-group-eval! s5-8 @@ -1265,7 +1234,7 @@ (set! (-> obj look-mean?) #f) (set! (-> obj travel-turn-speed) 16384.0) (dummy-21 obj) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (initialize-skeleton obj *puffer-sg* '()) (set! (-> obj draw origin-joint-index) (the-as uint 3)) (logclear! (-> obj mask) (process-mask actor-pause)) @@ -1276,7 +1245,7 @@ (set! (-> obj notice-dist) (res-lump-float arg0 'notice-dist :default 57344.0)) (set! (-> obj give-up-dist) (+ 20480.0 (-> obj notice-dist))) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (TODO-RENAME-26 (-> obj nav)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) diff --git a/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc b/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc index ace3128bfa..14a74eaee5 100644 --- a/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc +++ b/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc @@ -1,6 +1,9 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/qbert-plat-ag.gc") +(import "goal_src/import/qbert-plat-on-ag.gc") + ;; definition of type qbert-plat-on (deftype qbert-plat-on (process-drawable) () @@ -19,13 +22,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *qbert-plat-on-sg* qbert-plat-on - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -2 0 4.5) - :longest-edge (meters 0) - ) +(defskelgroup *qbert-plat-on-sg* qbert-plat-on qbert-plat-on-lod0-jg qbert-plat-on-idle-ja + ((qbert-plat-on-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -2 0 4.5) + ) ;; definition of type qbert-plat (deftype qbert-plat (rigid-body-platform) @@ -60,13 +60,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *qbert-plat-sg* qbert-plat - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -2 0 4.5) - :longest-edge (meters 0) - ) +(defskelgroup *qbert-plat-sg* qbert-plat qbert-plat-lod0-jg qbert-plat-idle-ja + ((qbert-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -2 0 4.5) + ) ;; definition for symbol *qbert-plat-constants*, type rigid-body-platform-constants (define *qbert-plat-constants* (new 'static 'rigid-body-platform-constants @@ -144,18 +141,16 @@ ;; failed to figure out what this is: (defstate qbert-plat-on-mimic (qbert-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('die) (go qbert-plat-on-die) ) ) ) - :code - (behavior () + :code (behavior () (set-vector! (-> self draw color-emissive) 0.0 0.0 1.0 0.0) - (while #t + (loop (let ((gp-0 (-> self parent))) (set! (-> self root-overlay trans quad) (-> (the-as (pointer rigid-body-platform) gp-0) 0 root-overlay trans quad) @@ -172,14 +167,12 @@ ) (none) ) - :post - (the-as (function none :behavior qbert-plat) ja-post) + :post (the-as (function none :behavior qbert-plat) ja-post) ) ;; failed to figure out what this is: (defstate qbert-plat-on-die (qbert-plat) - :code - (behavior () + :code (behavior () '() (none) ) @@ -188,7 +181,7 @@ ;; definition for function qbert-plat-on-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior qbert-plat-on-init-by-other qbert-plat ((arg0 entity) (arg1 qbert-plat)) +(defbehavior qbert-plat-on-init-by-other qbert-plat ((arg0 entity-actor) (arg1 qbert-plat)) (set! (-> self entity) arg0) (set! (-> self mask) (logior (process-mask platform) (-> self mask))) (set! (-> self root-overlay) (the-as collide-shape-moving (new 'process 'trsqv))) @@ -198,14 +191,7 @@ (initialize-skeleton self *qbert-plat-on-sg* '()) (logior! (-> self skel status) (janim-status inited)) (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! qbert-plat-idle-ja :num! min) (go qbert-plat-on-mimic) (none) ) @@ -250,16 +236,8 @@ (set! (-> obj on?) v1-3) (cond (v1-3 - (let ((s5-0 (get-process *default-dead-pool* qbert-plat-on #x4000))) - (when s5-0 - (let ((t9-2 (method-of-type qbert-plat-on activate))) - (t9-2 (the-as qbert-plat-on s5-0) obj 'qbert-plat-on (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 qbert-plat-on-init-by-other (-> obj entity) obj) - (-> s5-0 ppointer) - ) - ) - (sound-play-by-name (static-sound-name "plat-light-on") (new-sound-id) 1024 0 0 1 #t) + (process-spawn qbert-plat-on (-> obj entity) obj :to obj) + (sound-play "plat-light-on") ) (else (let ((gp-2 (-> obj child))) @@ -268,7 +246,7 @@ (set! gp-2 (-> gp-2 0 brother)) ) ) - (sound-play-by-name (static-sound-name "plat-light-off") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plat-light-off") ) ) ) @@ -279,9 +257,8 @@ ;; failed to figure out what this is: (defstate qbert-plat-wait-for-master (qbert-plat) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((v1-0 (-> self master))) (when (if v1-0 (-> v1-0 extra process) @@ -296,40 +273,33 @@ ) (none) ) - :post - (the-as (function none :behavior qbert-plat) ja-post) + :post (the-as (function none :behavior qbert-plat) ja-post) ) ;; failed to figure out what this is: (defstate rigid-body-platform-idle (qbert-plat) :virtual #t - :event - qbert-plat-event-handler - :code - (behavior () - (while #t + :event qbert-plat-event-handler + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior qbert-plat) ja-post) + :post (the-as (function none :behavior qbert-plat) ja-post) ) ;; failed to figure out what this is: (defstate rigid-body-platform-float (qbert-plat) :virtual #t - :event - qbert-plat-event-handler - :exit - (behavior () + :event qbert-plat-event-handler + :exit (behavior () (if (-> self on?) (logior! (-> self draw status) (draw-status hidden)) ) (none) ) - :trans - (behavior () + :trans (behavior () (logclear! (-> self draw status) (draw-status hidden)) ((-> (method-of-type rigid-body-platform rigid-body-platform-float) trans)) (let* ((v1-5 (-> self root-overlay riders)) @@ -344,8 +314,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () ((the-as (function none :behavior qbert-plat) (-> (method-of-type rigid-body-platform rigid-body-platform-float) post) @@ -463,8 +432,7 @@ ;; failed to figure out what this is: (defstate qbert-plat-master-idle (qbert-plat-master) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (start-hint-timer (game-text-id sunken-qbert-plat-hint)) @@ -475,7 +443,7 @@ (set! (-> self last-plat-triggered) (the-as int v1-2)) (let ((s5-1 (= (-> self plat-states-needed-to-open-door) (-> self plat-states)))) (let ((v1-3 (ash 1 v1-2))) - (set! (-> self plat-states) (logxor (-> self plat-states) (the-as uint v1-3))) + (logxor! (-> self plat-states) (the-as uint v1-3)) (if (zero? (logand v1-3 (-> self plat-states))) (level-hint-spawn (game-text-id sunken-qbert-plat-hint) @@ -499,9 +467,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (not (-> self puzzle-beaten?)) (when (task-complete? *game-info* (game-task sunken-platforms)) (set! (-> self puzzle-beaten?) #t) @@ -542,7 +509,7 @@ ) (when (and *target* (not (-> self puzzle-beaten?))) (let ((gp-0 #f)) - (let ((s5-1 (logtest? (-> *target* water flags) 512))) + (let ((s5-1 (logtest? (-> *target* water flags) (water-flags wt09)))) (when s5-1 (when (not (-> self player-in-water?)) (set! gp-0 #t) @@ -557,7 +524,7 @@ ) (set! (-> self player-in-water?) s5-1) ) - (when (logtest? (-> *target* control status) 1) + (when (logtest? (-> *target* control status) (cshape-moving-flags onsurf)) (let ((s5-2 #t)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -627,8 +594,7 @@ ;; failed to figure out what this is: (defstate qbert-plat-master-do-door (qbert-plat-master) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (when (not (-> self play-door-cam?)) (cond (arg0 @@ -702,48 +668,14 @@ (cond (arg0 (ambient-hint-spawn "gamcam08" (the-as vector #f) *entity-pool* 'camera) - (let ((s5-0 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-0 - (let ((t9-7 (method-of-type pov-camera activate))) - (t9-7 (the-as pov-camera s5-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> s5-0 ppointer) - ) - ) + (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "qbert-show-door-open" 0 #f '() :to self) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.4)) (suspend) ) ) (else (ambient-hint-spawn "gamcam07" (the-as vector #f) *entity-pool* 'camera) - (let ((s5-1 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-1 - (let ((t9-11 (method-of-type pov-camera activate))) - (t9-11 (the-as pov-camera s5-1) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-close" - 0 - #f - '() - ) - (-> s5-1 ppointer) - ) - ) + (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "qbert-show-door-close" 0 #f '() :to self) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (suspend) ) @@ -823,9 +755,8 @@ ;; failed to figure out what this is: (defstate qbert-plat-master-wait-for-door (qbert-plat-master) - :code - (behavior () - (while #t + :code (behavior () + (loop (let* ((v1-0 (-> self door)) (gp-0 (if v1-0 (-> v1-0 extra process) diff --git a/test/decompiler/reference/levels/sunken/shover_REF.gc b/test/decompiler/reference/levels/sunken/shover_REF.gc index c12b11e3f8..3ac9d9bb30 100644 --- a/test/decompiler/reference/levels/sunken/shover_REF.gc +++ b/test/decompiler/reference/levels/sunken/shover_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/shover-ag.gc") + ;; definition of type shover (deftype shover (process-drawable) ((root-override collide-shape :offset 112) @@ -25,18 +27,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *shover-sg* shover - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *shover-sg* shover shover-lod0-jg shover-idle-ja + ((shover-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) ;; failed to figure out what this is: (defstate shover-idle (shover) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (when (= (-> arg0 type) target) @@ -55,51 +53,36 @@ *entity-pool* (game-task none) ) - (cond - ((or (= (-> *target* control unknown-surface00 mode) 'air) - (>= (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> *target* control unknown-dword11)) - (< 0.75 (-> *target* control poly-normal y)) - ) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'attack-or-shove) - (set! (-> a1-6 param 0) (-> arg3 param 0)) - (let ((v1-22 (new 'static 'attack-info :mask #xa2))) - (set! (-> v1-22 mode) 'burn) - (set! (-> v1-22 vector quad) (-> s4-0 vector quad)) - (set! (-> v1-22 shove-up) (-> s4-0 shove-up)) - (set! (-> a1-6 param 1) (the-as uint v1-22)) - ) - (send-event-function arg0 a1-6) - ) - ) - (else - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'attack-or-shove) - (set! (-> a1-7 param 0) (-> arg3 param 0)) - (let ((v1-26 (new 'static 'attack-info :mask #x8e2))) - (set! (-> v1-26 mode) 'burn) - (set! (-> v1-26 shove-up) 0.0) - (set! (-> v1-26 shove-back) 8192.0) - (set! (-> v1-26 vector quad) (-> *target* control poly-normal quad)) - (set! (-> v1-26 angle) 'shove) - (set! (-> a1-7 param 1) (the-as uint v1-26)) + (if (or (= (-> *target* control unknown-surface00 mode) 'air) + (>= (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> *target* control unknown-dword11)) + (< 0.75 (-> *target* control poly-normal y)) ) - (send-event-function arg0 a1-7) + (send-event + arg0 + 'attack-or-shove + (-> arg3 param 0) + (static-attack-info ((mode 'burn) (vector (-> s4-0 vector)) (shove-up (-> s4-0 shove-up)))) + ) + (send-event + arg0 + 'attack-or-shove + (-> arg3 param 0) + (static-attack-info ((mode 'burn) + (shove-up (meters 0)) + (shove-back (meters 2)) + (vector (-> *target* control poly-normal)) + (angle 'shove) + ) + ) ) ) - ) ) ) ) ) ) ) - :code - (the-as (function none :behavior shover) anim-loop) + :code (the-as (function none :behavior shover) anim-loop) ) ;; definition for method 11 of type shover diff --git a/test/decompiler/reference/levels/sunken/square-platform_REF.gc b/test/decompiler/reference/levels/sunken/square-platform_REF.gc index ec971af4f6..e6980b6234 100644 --- a/test/decompiler/reference/levels/sunken/square-platform_REF.gc +++ b/test/decompiler/reference/levels/sunken/square-platform_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/square-platform-ag.gc") + ;; definition of type square-platform (deftype square-platform (baseplat) ((plat-id int32 :offset-assert 228) @@ -48,13 +50,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *square-platform-sg* square-platform - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 -11 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *square-platform-sg* square-platform square-platform-lod0-jg square-platform-idle-ja + ((square-platform-lod0-mg (meters 20)) (square-platform-lod1-mg (meters 999999))) + :bounds (static-spherem 0 -11 0 8) + ) ;; definition of type square-platform-button (deftype square-platform-button (basebutton) @@ -117,14 +116,12 @@ :id 437 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2222 :flags (is-3d)) (sp-item 2315 :flags (is-3d))) + :parts ((sp-item 2222 :flags (is-3d)) (sp-item 2315 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 2222 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 0) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 3.5) (meters 3.5) 1.0) @@ -149,14 +146,12 @@ ;; failed to figure out what this is: (defpart 2316 - :init-specs - ((sp-flt spt-fade-a -0.17066666)) + :init-specs ((sp-flt spt-fade-a -0.17066666)) ) ;; failed to figure out what this is: (defpart 2315 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 3) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) @@ -184,14 +179,12 @@ :id 438 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2223)) + :parts ((sp-item 2223)) ) ;; failed to figure out what this is: (defpart 2223 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-z (meters -4) (meters 8) 1.0) @@ -215,8 +208,7 @@ ;; failed to figure out what this is: (defpart 2317 - :init-specs - ((sp-flt spt-fade-a 0.0)) + :init-specs ((sp-flt spt-fade-a 0.0)) ) ;; failed to figure out what this is: @@ -224,8 +216,7 @@ :id 439 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2222 :flags (is-3d)) (sp-item 2315 :flags (is-3d))) + :parts ((sp-item 2222 :flags (is-3d)) (sp-item 2315 :flags (is-3d))) ) ;; definition for method 27 of type square-platform @@ -278,7 +269,7 @@ (t1-0 1) (t2-0 #t) ) - (s2-0 (the-as sound-name s1-0) s0-0 sv-48 a3-0 t0-0 t1-0 t2-0) + (s2-0 (the-as sound-name s1-0) s0-0 sv-48 a3-0 t0-0 (the-as sound-group t1-0) t2-0) ) ) ) @@ -318,8 +309,7 @@ ;; failed to figure out what this is: (defstate square-platform-lowered (square-platform) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (if (and (= (-> arg0 type) square-platform-master) @@ -330,10 +320,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self pos-u) 0.0) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -343,8 +332,7 @@ ;; failed to figure out what this is: (defstate square-platform-rising (square-platform) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((or (= v1-0 'bonk) (= v1-0 'bounce)) @@ -357,15 +345,13 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self start-splash-time) 0) (set! (-> self splash-counter) 0) 0 (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self pos-u) (seek-with-smooth (-> self pos-u) 1.0 (/ 1.0 (* 0.75 (-> *display* frames-per-second))) 0.8 0.01) ) @@ -378,22 +364,19 @@ (TODO-RENAME-27 self #t) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior square-platform) plat-post) + :post (the-as (function none :behavior square-platform) plat-post) ) ;; failed to figure out what this is: (defstate square-platform-raised (square-platform) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((or (= v1-0 'bonk) (= v1-0 'bounce)) @@ -406,25 +389,21 @@ ) ) ) - :trans - (the-as (function none :behavior square-platform) plat-trans) - :code - (behavior () + :trans (the-as (function none :behavior square-platform) plat-trans) + :code (behavior () (set! (-> self pos-u) 1.0) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior square-platform) plat-post) + :post (the-as (function none :behavior square-platform) plat-post) ) ;; failed to figure out what this is: (defstate square-platform-lowering (square-platform) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((or (= v1-0 'bonk) (= v1-0 'bounce)) @@ -434,22 +413,20 @@ (go square-platform-rising) ) ((= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) #f ) ) ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self start-splash-time) 0) (set! (-> self splash-counter) 0) 0 (none) ) - :trans - (behavior () + :trans (behavior () (set! (-> self pos-u) (seek-with-smooth (-> self pos-u) 0.0 (/ 1.0 (* 0.75 (-> *display* frames-per-second))) 0.8 0.01) ) @@ -462,16 +439,14 @@ (TODO-RENAME-27 self #f) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (the-as (function none :behavior square-platform) plat-post) + :post (the-as (function none :behavior square-platform) plat-post) ) ;; definition for method 10 of type square-platform @@ -583,8 +558,7 @@ ;; failed to figure out what this is: (defstate square-platform-master-idle (square-platform-master) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (when (= (-> arg0 type) square-platform-button) @@ -596,8 +570,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 @@ -607,8 +580,7 @@ ;; failed to figure out what this is: (defstate square-platform-master-activate (square-platform-master) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self wiggled?) #f) (sleep (-> self ticker) (-> self timeout)) @@ -619,95 +591,71 @@ (let ((v1-7 (-> self button-id))) (cond ((zero? v1-7) - (let* ((s5-0 (get-process *default-dead-pool* sunkencam #x4000)) - (a0-4 (when s5-0 - (let ((t9-3 (method-of-type sunkencam activate))) - (t9-3 (the-as sunkencam s5-0) self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> s5-0 ppointer) - ) - ) - ) + (let ((a0-4 (process-spawn + sunkencam + :init pov-camera-init-by-other + (-> self root trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + :to self + ) + ) + ) (set! (-> (the-as sunkencam (-> a0-4 0)) seq) (the-as uint 3)) ) ) ((= v1-7 1) - (let* ((gp-1 (get-process *default-dead-pool* sunkencam #x4000)) - (v1-13 (when gp-1 - (let ((t9-6 (method-of-type sunkencam activate))) - (t9-6 (the-as sunkencam gp-1) self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> gp-1 ppointer) - ) - ) - ) + (let ((v1-13 (process-spawn + sunkencam + :init pov-camera-init-by-other + (-> self root trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + :to self + ) + ) + ) (set! (-> (the-as sunkencam (-> v1-13 0)) seq) (the-as uint 4)) ) (set! gp-0 -1) ) ((= v1-7 2) - (let* ((s5-1 (get-process *default-dead-pool* sunkencam #x4000)) - (a0-17 (when s5-1 - (let ((t9-9 (method-of-type sunkencam activate))) - (t9-9 (the-as sunkencam s5-1) self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> s5-1 ppointer) - ) - ) - ) + (let ((a0-17 (process-spawn + sunkencam + :init pov-camera-init-by-other + (-> self root trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + :to self + ) + ) + ) (set! (-> (the-as sunkencam (-> a0-17 0)) seq) (the-as uint 5)) ) ) ((= v1-7 3) - (let* ((gp-2 (get-process *default-dead-pool* sunkencam #x4000)) - (v1-24 (when gp-2 - (let ((t9-12 (method-of-type sunkencam activate))) - (t9-12 (the-as sunkencam gp-2) self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> gp-2 ppointer) - ) - ) - ) + (let ((v1-24 (process-spawn + sunkencam + :init pov-camera-init-by-other + (-> self root trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + :to self + ) + ) + ) (set! (-> (the-as sunkencam (-> v1-24 0)) seq) (the-as uint 6)) ) (set! gp-0 -1) @@ -721,14 +669,12 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :trans - (behavior () + :trans (behavior () (when (completed? (-> self ticker)) (send-to-all (-> self link) 'untrigger) (go square-platform-master-idle) @@ -745,7 +691,7 @@ (a0-5 (-> self plat-id-dir)) (a1-3 (-> self plat-mask)) ) - (while #t + (loop (+! v1-20 a0-5) (cond ((<= v1-20 0) @@ -769,8 +715,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 diff --git a/test/decompiler/reference/levels/sunken/steam-cap_REF.gc b/test/decompiler/reference/levels/sunken/steam-cap_REF.gc index 3138cc7a52..54bef1c7be 100644 --- a/test/decompiler/reference/levels/sunken/steam-cap_REF.gc +++ b/test/decompiler/reference/levels/sunken/steam-cap_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/steam-cap-ag.gc") + ;; definition of type steam-cap-control-pt (deftype steam-cap-control-pt (structure) ((trans vector :inline :offset-assert 0) @@ -70,8 +72,7 @@ (defpartgroup group-steam-cap-sides :id 441 :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 1718 :fade-after (meters 100) :falloff-to (meters 160) :period 180 :length 75) + :parts ((sp-item 1718 :fade-after (meters 100) :falloff-to (meters 160) :period 180 :length 75) (sp-item 1719 :fade-after (meters 100) :falloff-to (meters 160) :period 180 :length 75 :offset 60) (sp-item 1720 :fade-after (meters 100) :falloff-to (meters 160) :period 180 :length 75 :offset 120) (sp-item 1721 :fade-after (meters 100) :falloff-to (meters 160) :period 180 :length 75) @@ -83,8 +84,7 @@ ;; failed to figure out what this is: (defpart 1724 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) (sp-flt spt-g 2867.2) @@ -104,14 +104,12 @@ ;; failed to figure out what this is: (defpart 1725 - :init-specs - ((sp-flt spt-fade-b -2.7306666)) + :init-specs ((sp-flt spt-fade-b -2.7306666)) ) ;; failed to figure out what this is: (defpart 1718 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 2.0 1.0) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) @@ -140,8 +138,7 @@ ;; failed to figure out what this is: (defpart 1721 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 2.0 1.0) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) @@ -170,8 +167,7 @@ ;; failed to figure out what this is: (defpart 1719 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 2.0 1.0) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) @@ -200,8 +196,7 @@ ;; failed to figure out what this is: (defpart 1722 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 2.0 1.0) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) @@ -230,8 +225,7 @@ ;; failed to figure out what this is: (defpart 1720 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 2.0 1.0) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) @@ -260,8 +254,7 @@ ;; failed to figure out what this is: (defpart 1723 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.0 2.0 1.0) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) @@ -290,16 +283,14 @@ ;; failed to figure out what this is: (defpart 1726 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) ;; failed to figure out what this is: (defpartgroup group-steam-cap-plume :id 442 :bounds (static-bspherem 0 0 0 32) - :parts - ((sp-item 1727 :fade-after (meters 120) :falloff-to (meters 160)) + :parts ((sp-item 1727 :fade-after (meters 120) :falloff-to (meters 160)) (sp-item 1728 :fade-after (meters 120) :falloff-to (meters 160)) (sp-item 1729 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1730 :fade-after (meters 60) :falloff-to (meters 60) :flags (start-dead)) @@ -310,16 +301,14 @@ (defpartgroup group-steam-cap-plume-spread :id 443 :bounds (static-bspherem 0 0 0 32) - :parts - ((sp-item 1731 :fade-after (meters 120) :falloff-to (meters 160)) + :parts ((sp-item 1731 :fade-after (meters 120) :falloff-to (meters 160)) (sp-item 1732 :fade-after (meters 120) :falloff-to (meters 160)) ) ) ;; failed to figure out what this is: (defpart 1730 - :init-specs - ((sp-flt spt-num 0.4) + :init-specs ((sp-flt spt-num 0.4) (sp-int spt-rot-x 5) (sp-flt spt-r 6144.0) (sp-flt spt-g 2867.2) @@ -339,8 +328,7 @@ ;; failed to figure out what this is: (defpart 1732 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -368,8 +356,7 @@ ;; failed to figure out what this is: (defpart 1731 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters -0.5)) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -397,14 +384,12 @@ ;; failed to figure out what this is: (defpart 1735 - :init-specs - ((sp-flt spt-fade-a -0.32)) + :init-specs ((sp-flt spt-fade-a -0.32)) ) ;; failed to figure out what this is: (defpart 1727 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-flt spt-y (meters -1)) @@ -427,8 +412,7 @@ ;; failed to figure out what this is: (defpart 1728 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters 0) (meters 0.5) 1.0) (sp-flt spt-y (meters -1)) @@ -450,8 +434,7 @@ ;; failed to figure out what this is: (defpart 1729 - :init-specs - ((sp-flt spt-num 0.5) + :init-specs ((sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 0.5) (meters 0.5) 1.0) (sp-int spt-rot-x 5) (sp-flt spt-r 6144.0) @@ -465,61 +448,45 @@ ) ;; failed to figure out what this is: -(defskelgroup *steam-cap-sg* steam-cap - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *steam-cap-sg* steam-cap steam-cap-lod0-jg steam-cap-idle-ja + ((steam-cap-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; definition for method 20 of type steam-cap ;; INFO: Return type mismatch object vs none. (defmethod dummy-20 steam-cap ((obj steam-cap)) - (with-pp - (when *target* - (let* ((a1-0 (target-pos 0)) - (f0-0 (-> a1-0 y)) - ) - (when (and (>= f0-0 (+ -8192.0 (-> obj down y))) - (and (>= (+ -4096.0 (-> obj root-override trans y)) f0-0) (zero? (-> obj root-override riders num-riders))) - ) - (let ((f0-1 (vector-vector-xz-distance-squared (-> obj down) a1-0))) - (when (>= 104857600.0 f0-1) - (let ((s5-0 (>= 37748736.0 f0-1))) - (when (not s5-0) - (when (>= (- (-> obj root-override trans y) (-> obj down y)) 3072.0) - (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 x) (the-as float 1)) - (set! (-> a1-1 y) (the-as float #f)) - (if (find-overlapping-shapes (-> obj root-override) (the-as overlaps-others-params a1-1)) - (set! s5-0 #t) - ) - ) - ) - ) - (when s5-0 - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) pp) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'shove) - (set! (-> a1-2 param 0) (the-as uint #f)) - (let ((v1-16 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-16 shove-up) 2048.0) - (set! (-> v1-16 shove-back) 6144.0) - (set! (-> a1-2 param 1) (the-as uint v1-16)) - ) - (send-event-function *target* a1-2) + (when *target* + (let* ((a1-0 (target-pos 0)) + (f0-0 (-> a1-0 y)) + ) + (when (and (>= f0-0 (+ -8192.0 (-> obj down y))) + (and (>= (+ -4096.0 (-> obj root-override trans y)) f0-0) (zero? (-> obj root-override riders num-riders))) + ) + (let ((f0-1 (vector-vector-xz-distance-squared (-> obj down) a1-0))) + (when (>= 104857600.0 f0-1) + (let ((s5-0 (>= 37748736.0 f0-1))) + (when (not s5-0) + (when (>= (- (-> obj root-override trans y) (-> obj down y)) 3072.0) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 x) (the-as float 1)) + (set! (-> a1-1 y) (the-as float #f)) + (if (find-overlapping-shapes (-> obj root-override) (the-as overlaps-others-params a1-1)) + (set! s5-0 #t) + ) ) ) ) + (if s5-0 + (send-event *target* 'shove #f (static-attack-info ((shove-up (meters 0.5)) (shove-back (meters 1.5))))) + ) ) ) ) ) ) - (none) ) + (none) ) ;; definition for method 21 of type steam-cap @@ -561,7 +528,7 @@ (set! s5-0 #f) (set! (-> obj do-falling-sound?) #t) (when (-> obj do-burst?) - (sound-play-by-name (static-sound-name "sunk-top-rises") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sunk-top-rises") (set! (-> obj do-burst?) #f) (spawn (-> obj part) (-> obj down)) (spawn (-> obj part) (-> obj down)) @@ -582,7 +549,7 @@ (set! s5-0 #t) (when (-> obj do-falling-sound?) (set! (-> obj do-falling-sound?) #f) - (sound-play-by-name (static-sound-name "sunk-top-falls") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sunk-top-falls") ) ) ) @@ -612,7 +579,7 @@ (when (< (-> s3-3 y) (-> obj down y)) (when (-> obj do-landing-sound?) (set! (-> obj do-landing-sound?) #f) - (sound-play-by-name (static-sound-name "sunk-top-lands") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sunk-top-lands") ) (set! (-> s3-3 y) (-> obj down y)) (let ((f0-20 (-> s2-0 transv y))) @@ -620,7 +587,7 @@ (let ((f0-22 (* 0.3 (- f0-20)))) (set! (-> s2-0 transv y) f0-22) (if (< 7782.4 f0-22) - (sound-play-by-name (static-sound-name "sunk-top-lands") (new-sound-id) 614 0 0 1 #t) + (sound-play "sunk-top-lands" :vol 60) ) ) ) @@ -713,19 +680,16 @@ ;; failed to figure out what this is: (defstate steam-cap-idle (steam-cap) - :trans - (the-as (function none :behavior steam-cap) rider-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior steam-cap) rider-trans) + :code (behavior () + (loop (dummy-20 self) (dummy-21 self) (suspend) ) (none) ) - :post - (the-as (function none :behavior steam-cap) rider-post) + :post (the-as (function none :behavior steam-cap) rider-post) ) ;; definition for method 7 of type steam-cap diff --git a/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc b/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc index d80ec64280..f32bc5c2ad 100644 --- a/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc +++ b/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc @@ -1,6 +1,10 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/exit-chamber-ag.gc") +(import "goal_src/import/blue-eco-charger-ag.gc") +(import "goal_src/import/blue-eco-charger-orb-ag.gc") + ;; definition of type blue-eco-charger-orb (deftype blue-eco-charger-orb (process-drawable) ((parent-process (pointer blue-eco-charger) :offset 12) @@ -35,13 +39,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *blue-eco-charger-orb-sg* blue-eco-charger-orb - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1.1) - :longest-edge (meters 0) - ) +(defskelgroup *blue-eco-charger-orb-sg* blue-eco-charger-orb blue-eco-charger-orb-lod0-jg blue-eco-charger-orb-idle-ja + ((blue-eco-charger-orb-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.1) + ) ;; definition of type blue-eco-charger (deftype blue-eco-charger (process-drawable) @@ -78,13 +79,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *blue-eco-charger-sg* blue-eco-charger - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 1.9 0 2.7) - :longest-edge (meters 0) - ) +(defskelgroup *blue-eco-charger-sg* blue-eco-charger blue-eco-charger-lod0-jg blue-eco-charger-open-ja + ((blue-eco-charger-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.9 0 2.7) + ) ;; definition of type exit-chamber-items (deftype exit-chamber-items (structure) @@ -164,13 +162,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *exit-chamber-sg* exit-chamber - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 4 0 16.5) - :longest-edge (meters 0) - ) +(defskelgroup *exit-chamber-sg* exit-chamber exit-chamber-lod0-jg exit-chamber-idle-ja + ((exit-chamber-lod0-mg (meters 999999))) + :bounds (static-spherem 0 4 0 16.5) + ) ;; failed to figure out what this is: (defpartgroup group-exit-chamber-ripples @@ -178,14 +173,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2512 :flags (is-3d))) + :parts ((sp-item 2512 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 2513 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-func spt-birth-func 'birth-func-ocean-height) (sp-flt spt-num 0.25) (sp-rnd-flt spt-x (meters 5) (meters 3) 1.0) @@ -212,14 +205,12 @@ ;; failed to figure out what this is: (defpart 2514 - :init-specs - ((sp-flt spt-fade-a -0.094814815)) + :init-specs ((sp-flt spt-fade-a -0.094814815)) ) ;; failed to figure out what this is: (defpart 2512 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-func spt-birth-func 'birth-func-ocean-height) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters 6) (meters 4) 1.0) @@ -258,10 +249,9 @@ ;; failed to figure out what this is: (defstate blue-eco-charger-orb-idle (blue-eco-charger-orb) - :code - (behavior () + :code (behavior () (set! (-> self root trans quad) (-> self rest-pos quad)) - (while #t + (loop (let ((f0-0 (-> self parent-process 0 open-level))) (if (< 0.0 f0-0) (go blue-eco-charger-orb-active) @@ -271,14 +261,12 @@ ) (none) ) - :post - (the-as (function none :behavior blue-eco-charger-orb) ja-post) + :post (the-as (function none :behavior blue-eco-charger-orb) ja-post) ) ;; failed to figure out what this is: (defstate blue-eco-charger-orb-active (blue-eco-charger-orb) - :code - (behavior () + :code (behavior () (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -287,7 +275,7 @@ (init-vf0-vector) (dummy-20 self (-> self parent-process 0 open-level)) (vector-reset! (-> self orbit-rotv)) - (while #t + (loop (let ((f30-0 (-> self parent-process 0 open-level))) (if (>= 0.0 f30-0) (go blue-eco-charger-orb-idle) @@ -356,14 +344,13 @@ (none) ) ) - :post - (the-as (function none :behavior blue-eco-charger-orb) ja-post) + :post (the-as (function none :behavior blue-eco-charger-orb) ja-post) ) ;; definition for function blue-eco-charger-orb-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior blue-eco-charger-orb-init-by-other blue-eco-charger-orb ((arg0 entity) (arg1 blue-eco-charger-orb)) +(defbehavior blue-eco-charger-orb-init-by-other blue-eco-charger-orb ((arg0 entity-actor) (arg1 blue-eco-charger-orb)) (set! (-> self entity) arg0) (set! (-> self root) (new 'process 'trsqv)) (set! (-> self root trans quad) (-> arg1 root trans quad)) @@ -373,14 +360,7 @@ (set! (-> self rest-pos quad) (-> self root trans quad)) (initialize-skeleton self *blue-eco-charger-orb-sg* '()) (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-1 frame-num) 0.0) - ) + (ja :group! (-> self draw art-group data 2) :num! min) (set-vector! (-> self orbit-rot) 0.0 0.0 0.0 1.0) (go blue-eco-charger-orb-idle) (none) @@ -420,35 +400,20 @@ ;; definition for method 20 of type blue-eco-charger (defmethod dummy-20 blue-eco-charger ((obj blue-eco-charger)) (and (and *target* (>= 16384.0 (vector-vector-distance (-> obj root-override trans) (-> *target* control trans)))) - (send-event *target* 'query 'powerup 3) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) ;; failed to figure out what this is: (defstate blue-eco-charger-idle (blue-eco-charger) - :code - (behavior () + :code (behavior () (set! (-> self open-level) 0.0) (ja-channel-set! 1) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 2)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (ja :group! (-> self draw art-group data 2) :num! min) + (loop (when (logtest? (-> self draw status) (draw-status was-drawn)) (if (and (and *target* (>= 16384.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'powerup)) - (set! (-> a1-2 param 1) (the-as uint 3)) - (not (send-event-function *target* a1-2)) - ) + (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (level-hint-spawn (game-text-id sunken-blue-eco-charger-hint) @@ -470,58 +435,34 @@ ) (none) ) - :post - (the-as (function none :behavior blue-eco-charger) ja-post) + :post (the-as (function none :behavior blue-eco-charger) ja-post) ) ;; failed to figure out what this is: (defstate blue-eco-charger-open (blue-eco-charger) - :enter - (behavior ((arg0 symbol)) + :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (if arg0 - (sound-play-by-name (static-sound-name "blue-eco-start") (new-sound-id) 1024 0 0 1 #t) + (sound-play "blue-eco-start") ) (dummy-21 self #t) (none) ) - :trans - (behavior () + :trans (behavior () (if (dummy-20 self) (set! (-> self state-time) (-> *display* base-frame-counter)) ) (update! (-> self sound)) (none) ) - :code - (behavior ((arg0 symbol)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior ((arg0 symbol)) + (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) - (set! (-> self open-level) - (/ (ja-frame-num 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) + (ja :num! (seek!)) + (set! (-> self open-level) (/ (ja-frame-num 0) (the float (+ (-> (ja-group) data 0 length) -1)))) ) - (while #t + (loop (cond ((zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 20)) @@ -543,20 +484,17 @@ ) (none) ) - :post - (the-as (function none :behavior blue-eco-charger) ja-post) + :post (the-as (function none :behavior blue-eco-charger) ja-post) ) ;; failed to figure out what this is: (defstate blue-eco-charger-stuck-open (blue-eco-charger) - :trans - (behavior () + :trans (behavior () (update! (-> self sound)) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -566,18 +504,12 @@ ;; failed to figure out what this is: (defstate blue-eco-charger-close (blue-eco-charger) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 0.0) - (set! (-> a0-0 param 1) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek! 0.0)) (while (not (ja-done? 0)) (when (dummy-20 self) (increment-success-for-hint (game-text-id sunken-blue-eco-charger-hint)) @@ -588,31 +520,14 @@ ) (update! (-> self sound)) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) 0.0) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) - (set! (-> self open-level) - (/ (ja-frame-num 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) + (ja :num! (seek! 0.0)) + (set! (-> self open-level) (/ (ja-frame-num 0) (the float (+ (-> (ja-group) data 0 length) -1)))) ) (dummy-21 self #f) (go blue-eco-charger-idle) (none) ) - :post - (the-as (function none :behavior blue-eco-charger) ja-post) + :post (the-as (function none :behavior blue-eco-charger) ja-post) ) ;; definition for method 11 of type blue-eco-charger @@ -655,28 +570,9 @@ (set! (-> obj master) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> obj link) (new 'process 'actor-link-info obj)) (set! (-> obj charger-id) (+ (actor-count-before (-> obj link)) 1)) - (let ((s5-1 (get-process *default-dead-pool* blue-eco-charger-orb #x4000))) - (when s5-1 - (let ((t9-17 (method-of-type blue-eco-charger-orb activate))) - (t9-17 (the-as blue-eco-charger-orb s5-1) obj 'blue-eco-charger-orb (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 blue-eco-charger-orb-init-by-other (-> obj entity) obj) - (-> s5-1 ppointer) - ) - ) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "blue-eco-charg") - :volume #x400 - :fo-max 35 - ) - (-> obj root-override trans) - ) + (process-spawn blue-eco-charger-orb (-> obj entity) obj :to obj) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "blue-eco-charg" :fo-max 35) (-> obj root-override trans)) ) (if (zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) (go blue-eco-charger-idle) @@ -704,7 +600,7 @@ ;; definition for function exit-chamber-button-init-by-other (defbehavior exit-chamber-button-init-by-other exit-chamber-button ((arg0 vector) (arg1 quaternion) (arg2 entity-actor) (arg3 symbol)) - (basebutton-init-by-other (the-as basebutton #f) arg0 arg1 arg2 arg3 0.0) + (basebutton-init-by-other (the-as entity-actor #f) arg0 arg1 arg2 arg3 0.0) (none) ) @@ -722,8 +618,7 @@ ;; failed to figure out what this is: (defpart 2515 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.2) 1.0) (sp-rnd-flt spt-scale-y (meters 0.3) (meters 0.1) 1.0) @@ -829,8 +724,7 @@ ;; failed to figure out what this is: (defstate exit-chamber-charger-puzzle (exit-chamber) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('notify) @@ -863,14 +757,12 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root-override trans))) (logclear! (-> self draw status) (draw-status hidden)) (logior! (-> self draw status) (draw-status hidden)) @@ -879,31 +771,21 @@ ) (none) ) - :post - (the-as (function none :behavior exit-chamber) ja-post) + :post (the-as (function none :behavior exit-chamber) ja-post) ) ;; failed to figure out what this is: (defstate exit-chamber-charger-puzzle-beaten (exit-chamber) - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type pov-camera activate))) - (t9-1 (the-as pov-camera gp-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> self root-override trans) - *sunkencam-sg* - "exit-chamber-door-open" - 0 - #f - '() - ) - (-> gp-0 ppointer) - ) + :code (behavior () + (process-spawn + pov-camera + (-> self root-override trans) + *sunkencam-sg* + "exit-chamber-door-open" + 0 + #f + '() + :to self ) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2.5)) @@ -917,8 +799,7 @@ ;; failed to figure out what this is: (defstate exit-chamber-idle-in-sunken (exit-chamber) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-1 object)) (case arg2 (('trigger) @@ -941,13 +822,11 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :code - (behavior () + :code (behavior () (save-reminder (get-task-control (game-task sunken-room)) 1 0) (set! (-> self wave-scale) 0.0) (if (-> self door) @@ -956,7 +835,7 @@ (if (-> self button) (send-event (ppointer->process (-> self button)) 'untrigger) ) - (while #t + (loop (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root-override trans))) (logclear! (-> self draw status) (draw-status hidden)) (logior! (-> self draw status) (draw-status hidden)) @@ -969,20 +848,17 @@ ;; failed to figure out what this is: (defstate exit-chamber-rise (exit-chamber) - :enter - (behavior () + :enter (behavior () (set! (-> self move-player?) #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (-> self move-player?)) (rider-trans) ) (none) ) - :code - (behavior () + :code (behavior () (aybabtu 2) (let ((v1-1 (handle->process (-> self fcell-handle)))) (if v1-1 @@ -1020,82 +896,38 @@ (suspend) (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-1 #f)) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-13 param 1) 1.0) - (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (not gp-1) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.75)) (-> self door)) (set! gp-1 #t) (send-event (ppointer->process (-> self door)) 'untrigger) ) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (set! (-> self move-player?) #t) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (load-state-want-levels 'sunken 'village2) - (let ((a0-23 (-> self skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-23 param 1) 1.0) - (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (dummy-24 self 51200.0) (update-trans! (-> self sound) (-> self last-pos)) (update! (-> self sound)) (suspend) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1))) - (set! (-> a0-27 param 1) 1.0) - (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (stop! (-> self sound)) (load-state-want-display-level 'village2 'display) (load-state-want-display-level 'sunken 'special) (let ((gp-2 #f)) - (let ((a0-32 (-> self skel root-channel 0))) - (set! (-> a0-32 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-32 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-32 param 1) 1.0) - (set! (-> a0-32 frame-num) 0.0) - (joint-control-channel-group! a0-32 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (set! (-> self wave-scale) (seek (-> self wave-scale) 1.0 0.0016666667)) + (seek! (-> self wave-scale) 1.0 0.0016666667) (dummy-20 self (-> self wave-scale)) (if (and (-> self move-player?) (>= (ja-aframe-num 0) 310.0)) (set! (-> self move-player?) #f) @@ -1113,11 +945,7 @@ ) ) (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) (the float (+ (-> a0-40 frame-group data 0 length) -1))) - (set! (-> a0-40 param 1) 1.0) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (kill-and-free-particles (-> self part)) @@ -1130,7 +958,7 @@ ) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (set! (-> self wave-scale) (seek (-> self wave-scale) 1.0 0.0016666667)) + (seek! (-> self wave-scale) 1.0 0.0016666667) (dummy-20 self (-> self wave-scale)) (suspend) ) @@ -1139,15 +967,14 @@ ) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2.5)) - (set! (-> self wave-scale) (seek (-> self wave-scale) 1.0 0.0016666667)) + (seek! (-> self wave-scale) 1.0 0.0016666667) (dummy-20 self (-> self wave-scale)) (suspend) ) (go exit-chamber-idle-in-village #f) (none) ) - :post - (behavior () + :post (behavior () (if (-> self move-player?) (transform-post) (rider-post) @@ -1159,8 +986,7 @@ ;; failed to figure out what this is: (defstate exit-chamber-idle-in-village (exit-chamber) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go exit-chamber-lower) @@ -1180,19 +1006,16 @@ ) ) ) - :enter - (behavior ((arg0 symbol)) + :enter (behavior ((arg0 symbol)) (set! (-> self mask) (logior (process-mask platform) (-> self mask))) (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self mask) (process-mask platform)) (none) ) - :trans - (behavior () + :trans (behavior () (rider-trans) (when *target* (let ((f30-0 (vector-vector-xz-distance (target-pos 0) (-> self last-pos)))) @@ -1216,8 +1039,7 @@ ) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (set! (-> self move-player?) #f) (set! (-> self wave-scale) 1.0) (save-reminder (get-task-control (game-task sunken-room)) 2 0) @@ -1230,14 +1052,13 @@ (suspend) (logclear! (-> self draw status) (draw-status skip-bones)) ) - (while #t + (loop (dummy-20 self 1.0) (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (rider-post) (dummy-23 self #t) (if (and *target* (>= (vector-vector-xz-distance (target-pos 0) (-> self last-pos)) 40960.0)) @@ -1249,8 +1070,7 @@ ;; failed to figure out what this is: (defstate exit-chamber-lower (exit-chamber) - :enter - (behavior () + :enter (behavior () (set! (-> self move-player?) #t) (let ((v1-2 (handle->process (-> self fcell-handle)))) (if v1-2 @@ -1259,36 +1079,28 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (-> self move-player?)) (rider-trans) ) - (set! (-> self wave-scale) (seek (-> self wave-scale) 0.0 0.0016666667)) + (seek! (-> self wave-scale) 0.0 0.0016666667) (dummy-20 self (-> self wave-scale)) (none) ) - :code - (behavior () - (let* ((gp-0 (get-process *default-dead-pool* sunkencam #x4000)) - (v1-1 (when gp-0 - (let ((t9-1 (method-of-type sunkencam activate))) - (t9-1 (the-as sunkencam gp-0) self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> self root-override trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> gp-0 ppointer) - ) - ) - ) + :code (behavior () + (let ((v1-1 (process-spawn + sunkencam + :init pov-camera-init-by-other + (-> self root-override trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + :to self + ) + ) + ) (set! (-> (the-as sunkencam (-> v1-1 0)) seq) (the-as uint 1)) ) (load-state-want-display-level 'sunken 'display) @@ -1297,15 +1109,7 @@ (let ((gp-1 #f) (s5-0 #f) ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (and (not gp-1) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) (-> self door)) (set! gp-1 #t) @@ -1324,54 +1128,26 @@ (spawn (-> self part) (-> self last-pos)) ) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (load-state-want-levels 'sunken 'sunkenb) (kill-and-free-particles (-> self part)) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (dummy-24 self 47104.0) (update-trans! (-> self sound) (-> self last-pos)) (update! (-> self sound)) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (stop! (-> self sound)) (load-state-want-display-level 'sunkenb 'display) (load-state-want-vis 'sub) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 9) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self move-player?) #f) (if (-> self door) @@ -1390,8 +1166,7 @@ (go exit-chamber-idle-in-sunken) (none) ) - :post - (behavior () + :post (behavior () (if (-> self move-player?) (transform-post) (rider-post) @@ -1500,47 +1275,15 @@ ) ) ) - (let ((s0-1 (get-process *default-dead-pool* sun-iris-door #x4000))) - (set! (-> obj door) - (the-as - (pointer sun-iris-door) - (when s0-1 - (let ((t9-23 (method-of-type sun-iris-door activate))) - (t9-23 (the-as sun-iris-door s0-1) obj 'sun-iris-door (the-as pointer #x70004000)) - ) - (run-now-in-process s0-1 sun-iris-door-init-by-other (-> s3-1 vector) (-> s3-1 vector 1) s1-3) - (-> s0-1 ppointer) - ) - ) - ) - ) - ) - (let ((s1-4 (get-process *default-dead-pool* exit-chamber-button #x4000))) - (set! (-> obj button) - (the-as - (pointer exit-chamber-button) - (when s1-4 - (let ((t9-26 (method-of-type exit-chamber-button activate))) - (t9-26 (the-as exit-chamber-button s1-4) obj 'exit-chamber-button (the-as pointer #x70004000)) - ) - (run-now-in-process s1-4 exit-chamber-button-init-by-other (-> s3-1 vector 2) (-> s3-1 vector 3) arg0 #f) - (-> s1-4 ppointer) - ) - ) - ) + (set! (-> obj door) (process-spawn sun-iris-door (-> s3-1 vector) (-> s3-1 vector 1) s1-3 :to obj)) ) + (set! (-> obj button) + (process-spawn exit-chamber-button (-> s3-1 vector 2) (-> s3-1 vector 3) arg0 #f :to obj) + ) (set! (-> obj sound) (new 'process 'ambient-sound - (new 'static 'sound-spec - :mask #xc0 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "chamber-move") - :volume #x400 - :fo-min #x12c - :fo-max #x190 - ) + (static-sound-spec "chamber-move" :fo-min 300 :fo-max 400) (-> obj root-override trans) ) ) diff --git a/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc b/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc index 8c7feb520a..3c9a2eea0d 100644 --- a/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc +++ b/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/sun-iris-door-ag.gc") + ;; definition of type sun-iris-door (deftype sun-iris-door (process-drawable) ((root-override collide-shape :offset 112) @@ -50,13 +52,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *sun-iris-door-sg* sun-iris-door - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4.5) - :longest-edge (meters 0) - ) +(defskelgroup *sun-iris-door-sg* sun-iris-door sun-iris-door-lod0-jg sun-iris-door-idle-ja + ((sun-iris-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.5) + ) ;; definition for method 21 of type sun-iris-door (defmethod should-open? sun-iris-door ((obj sun-iris-door)) @@ -96,8 +95,7 @@ ;; failed to figure out what this is: (defstate sun-iris-door-closed (sun-iris-door) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go sun-iris-door-opening) @@ -109,8 +107,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (when (-> self proximity?) (if (should-open? self) (go sun-iris-door-opening) @@ -118,16 +115,14 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) (move-to-point! (-> self root-override) (-> self move-to-pos)) @@ -140,8 +135,7 @@ ;; failed to figure out what this is: (defstate sun-iris-door-opening (sun-iris-door) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('untrigger) (go sun-iris-door-closing) @@ -153,28 +147,18 @@ ) ) ) - :code - (behavior () - (sound-play-by-name (static-sound-name "irisdoor2") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (sound-play "irisdoor2") + (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (ja-post) (go sun-iris-door-open) (none) ) - :post - (behavior () + :post (behavior () (cond ((-> self move-to?) (set! (-> self move-to?) #f) @@ -245,8 +229,7 @@ ;; failed to figure out what this is: (defstate sun-iris-door-open (sun-iris-door) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (let ((v0-0 (the-as object (-> *display* base-frame-counter)))) @@ -264,21 +247,18 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (clear-collide-with-as (-> self root-override)) (logior! (-> self draw status) (draw-status hidden)) (none) ) - :exit - (behavior () + :exit (behavior () (restore-collide-with-as (-> self root-override)) (logclear! (-> self draw status) (draw-status hidden)) (none) ) - :trans - (behavior () + :trans (behavior () (when (-> self proximity?) (if (should-close? self) (go sun-iris-door-closing) @@ -291,16 +271,14 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) (move-to-point! (-> self root-override) (-> self move-to-pos)) @@ -313,8 +291,7 @@ ;; failed to figure out what this is: (defstate sun-iris-door-closing (sun-iris-door) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go sun-iris-door-opening) @@ -326,28 +303,18 @@ ) ) ) - :code - (behavior () - (sound-play-by-name (static-sound-name "irisdoor2") (new-sound-id) 1024 0 0 1 #t) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) 0.0) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (sound-play "irisdoor2") + (ja-no-eval :num! (seek! 0.0)) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) 0.0) - (set! (-> a0-3 param 1) 1.0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) (ja-post) (go sun-iris-door-closed) (none) ) - :post - (behavior () + :post (behavior () (cond ((-> self move-to?) (set! (-> self move-to?) #f) @@ -457,30 +424,10 @@ (set! (-> self proximity?) #f) (set! (-> self directional-proximity?) #f) (ja-channel-set! 1) - (cond - (arg2 - (let ((s5-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - ) + (if arg2 + (ja :group! sun-iris-door-idle-ja :num! max) + (ja :group! sun-iris-door-idle-ja :num! min) ) - (else - (let ((s5-2 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-2 - (the-as art-joint-anim (-> self draw art-group data 3)) - num-func-identity - ) - (set! (-> s5-2 frame-num) 0.0) - ) - ) - ) (transform-post) (if arg2 (go sun-iris-door-open) diff --git a/test/decompiler/reference/levels/sunken/sunken-fish_REF.gc b/test/decompiler/reference/levels/sunken/sunken-fish_REF.gc index ed6f37fa2f..3dbfe9b3f0 100644 --- a/test/decompiler/reference/levels/sunken/sunken-fish_REF.gc +++ b/test/decompiler/reference/levels/sunken/sunken-fish_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/sunkenfisha-ag.gc") + ;; definition of type sunkenfisha (deftype sunkenfisha (process-drawable) ((path-u float :offset-assert 176) @@ -60,31 +62,22 @@ ) ;; failed to figure out what this is: -(defskelgroup *sunkenfisha-red-yellow-sg* sunkenfisha - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 1.5 0 2.5) - :longest-edge (meters 0) - ) +(defskelgroup *sunkenfisha-red-yellow-sg* sunkenfisha sunkenfisha-red-yellow-lod0-jg -1 + ((sunkenfisha-red-yellow-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 2.5) + ) ;; failed to figure out what this is: -(defskelgroup *sunkenfisha-yellow-blue-sg* sunkenfisha - 2 - -1 - ((3 (meters 999999))) - :bounds (static-spherem 0 1.5 0 2.5) - :longest-edge (meters 0) - ) +(defskelgroup *sunkenfisha-yellow-blue-sg* sunkenfisha sunkenfisha-yellow-blue-lod0-jg -1 + ((sunkenfisha-yellow-blue-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 2.5) + ) ;; failed to figure out what this is: -(defskelgroup *sunkenfisha-yellow-eye-sg* sunkenfisha - 4 - -1 - ((5 (meters 999999))) - :bounds (static-spherem 0 1.5 0 2.5) - :longest-edge (meters 0) - ) +(defskelgroup *sunkenfisha-yellow-eye-sg* sunkenfisha sunkenfisha-yellow-eye-lod0-jg -1 + ((sunkenfisha-yellow-eye-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 2.5) + ) ;; definition for method 22 of type sunkenfisha ;; INFO: Return type mismatch int vs none. @@ -218,8 +211,7 @@ ;; failed to figure out what this is: (defstate sunkenfisha-idle (sunkenfisha) - :trans - (behavior () + :trans (behavior () (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -250,37 +242,23 @@ (none) ) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior sunkenfisha) ja-post) + :post (the-as (function none :behavior sunkenfisha) ja-post) ) ;; definition for method 26 of type sunkenfisha (defmethod TODO-RENAME-26 sunkenfisha ((obj sunkenfisha)) (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (set-vector! (-> obj root scale) 6.0 6.0 6.0 1.0) (let ((v1-3 (rand-vu-int-count 3))) (cond @@ -391,7 +369,7 @@ ;; definition for function sunkenfisha-init-by-other ;; INFO: Return type mismatch object vs none. -(defbehavior sunkenfisha-init-by-other sunkenfisha ((arg0 entity)) +(defbehavior sunkenfisha-init-by-other sunkenfisha ((arg0 entity-actor)) (set! (-> self entity) arg0) (TODO-RENAME-26 self) (TODO-RENAME-27 self) @@ -406,15 +384,7 @@ (TODO-RENAME-27 obj) (let ((s5-0 (+ (res-lump-value (-> obj entity) 'count uint128 :default (the-as uint128 1)) -1))) (while (> (the-as int s5-0) 0) - (let ((s4-0 (get-process *default-dead-pool* sunkenfisha #x4000))) - (when s4-0 - (let ((t9-4 (method-of-type sunkenfisha activate))) - (t9-4 (the-as sunkenfisha s4-0) obj 'sunkenfisha (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 sunkenfisha-init-by-other (-> obj entity)) - (-> s4-0 ppointer) - ) - ) + (process-spawn sunkenfisha (-> obj entity) :to obj) (+! s5-0 -1) ) ) diff --git a/test/decompiler/reference/levels/sunken/sunken-obs_REF.gc b/test/decompiler/reference/levels/sunken/sunken-obs_REF.gc index 597814caef..940a4a0a50 100644 --- a/test/decompiler/reference/levels/sunken/sunken-obs_REF.gc +++ b/test/decompiler/reference/levels/sunken/sunken-obs_REF.gc @@ -1,6 +1,10 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/seaweed-ag.gc") +(import "goal_src/import/sunkencam-ag.gc") +(import "goal_src/import/side-to-side-plat-ag.gc") + ;; definition of type water-vol-deadly (deftype water-vol-deadly (process-hidden) () @@ -61,29 +65,24 @@ ) ;; failed to figure out what this is: -(defskelgroup *side-to-side-plat-sg* side-to-side-plat - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 14) - :longest-edge (meters 0) - ) +(defskelgroup *side-to-side-plat-sg* side-to-side-plat side-to-side-plat-lod0-jg side-to-side-plat-idle-ja + ((side-to-side-plat-lod0-mg (meters 20)) (side-to-side-plat-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 14) + ) ;; failed to figure out what this is: (defpartgroup group-side-to-side-plat :id 436 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1713 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1713 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1714 :fade-after (meters 160) :falloff-to (meters 160)) ) ) ;; failed to figure out what this is: (defpart 1713 - :init-specs - ((sp-flt spt-num 4.0) + :init-specs ((sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters -11) (meters 22) 1.0) (sp-flt spt-y (meters 1)) (sp-int spt-rot-x 5) @@ -103,8 +102,7 @@ ;; failed to figure out what this is: (defpart 1714 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-x (meters -11) (meters 22) 1.0) (sp-flt spt-y (meters 1.5)) @@ -207,13 +205,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *sunkencam-sg* sunkencam - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *sunkencam-sg* sunkencam sunkencam-lod0-jg -1 + ((sunkencam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) ;; definition for method 29 of type sunkencam (defmethod set-stack-size! sunkencam ((obj sunkencam)) @@ -224,160 +219,74 @@ ;; failed to figure out what this is: (defstate pov-camera-playing (sunkencam) :virtual #t - :exit - (behavior () + :exit (behavior () (set! (-> *screen-filter* draw?) #f) (none) ) - :code - (behavior () + :code (behavior () (let ((v1-0 (-> self seq))) (cond ((zero? v1-0) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((v1-45 *screen-filter*)) (set! (-> v1-45 draw?) #t) (set! (-> v1-45 color) (new 'static 'rgba :g #x20 :b #x40 :a #x50)) ) (set-blackout-frames (seconds 0.1)) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set-blackout-frames (seconds 0.5)) (let ((gp-0 2)) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-13 param 1) 1.0) - (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (+! gp-0 -1) (if (zero? gp-0) (set! (-> *screen-filter* draw?) #f) ) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (set-blackout-frames (seconds 0.1)) ) ((= v1-0 1) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 9) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((v1-116 *screen-filter*)) (set! (-> v1-116 draw?) #t) (set! (-> v1-116 color) (new 'static 'rgba :g #x20 :b #x40 :a #x50)) ) (set-blackout-frames (seconds 0.1)) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set-blackout-frames (seconds 0.1)) (let ((gp-1 2)) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-28 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-28 param 1) 1.0) - (set! (-> a0-28 frame-num) 0.0) - (joint-control-channel-group! a0-28 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 11) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (+! gp-1 -1) (if (zero? gp-1) (set! (-> *screen-filter* draw?) #f) ) (suspend) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1))) - (set! (-> a0-29 param 1) 1.0) - (joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (let ((gp-2 *camera*)) @@ -391,39 +300,15 @@ ) ) ((= v1-0 2) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) - (set! (-> a0-36 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1)) - ) - (set! (-> a0-36 param 1) 1.0) - (set! (-> a0-36 frame-num) 0.0) - (joint-control-channel-group! a0-36 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 16) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-37 (-> self skel root-channel 0))) - (set! (-> a0-37 param 0) (the float (+ (-> a0-37 frame-group data 0 length) -1))) - (set! (-> a0-37 param 1) 1.0) - (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) - (set! (-> a0-39 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1)) - ) - (set! (-> a0-39 param 1) 0.67) - (set! (-> a0-39 frame-num) 0.0) - (joint-control-channel-group! a0-39 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!) + (ja :num! (seek!)) ) + (ja-no-eval :group! (-> self draw art-group data 17) :num! (seek! max 0.67) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) (the float (+ (-> a0-40 frame-group data 0 length) -1))) - (set! (-> a0-40 param 1) 0.67) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.67)) ) (pov-camera-play-and-reposition (the-as art-joint-anim (-> self draw art-group data 18)) @@ -501,50 +386,29 @@ ) ;; failed to figure out what this is: -(defskelgroup *seaweed-sg* seaweed - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 6 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *seaweed-sg* seaweed seaweed-lod0-jg -1 + ((seaweed-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6 0 7) + ) ;; failed to figure out what this is: (defstate seaweed-idle (seaweed) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) (the float (+ (-> a0-0 frame-group data 0 length) -1))) - (set! (-> a0-0 param 1) (-> self anim-speed)) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-seek!) - ) + :code (behavior () + (ja-no-eval :num! (seek! max (-> self anim-speed))) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (while #t - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) (-> self anim-speed)) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) (-> self anim-speed)) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max (-> self anim-speed))) ) ) (none) ) - :post - (the-as (function none :behavior seaweed) ja-post) + :post (the-as (function none :behavior seaweed) ja-post) ) ;; definition for method 11 of type seaweed diff --git a/test/decompiler/reference/levels/sunken/sunken-part2_REF.gc b/test/decompiler/reference/levels/sunken/sunken-part2_REF.gc index 0e1fd264a3..1c745fef2c 100644 --- a/test/decompiler/reference/levels/sunken/sunken-part2_REF.gc +++ b/test/decompiler/reference/levels/sunken/sunken-part2_REF.gc @@ -5,8 +5,7 @@ (defpartgroup group-sunken-window-bubbles-34 :id 353 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1495 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1495 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1495 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -59,8 +58,7 @@ ;; failed to figure out what this is: (defpart 1496 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -83,8 +81,7 @@ ;; failed to figure out what this is: (defpart 1495 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -104,8 +101,7 @@ (defpartgroup group-sunken-window-bubbles-36 :id 354 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1497 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1497 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1497 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -158,8 +154,7 @@ ;; failed to figure out what this is: (defpart 1498 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -182,8 +177,7 @@ ;; failed to figure out what this is: (defpart 1497 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -203,8 +197,7 @@ (defpartgroup group-sunken-window-bubbles-30 :id 355 :bounds (static-bspherem 0 4 0 30) - :parts - ((sp-item 1499 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1499 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1499 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -257,8 +250,7 @@ ;; failed to figure out what this is: (defpart 1500 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -281,8 +273,7 @@ ;; failed to figure out what this is: (defpart 1499 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -302,8 +293,7 @@ (defpartgroup group-sunken-window-bubbles-31 :id 356 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1501 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1501 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1501 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -356,8 +346,7 @@ ;; failed to figure out what this is: (defpart 1502 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -380,8 +369,7 @@ ;; failed to figure out what this is: (defpart 1501 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -401,8 +389,7 @@ (defpartgroup group-sunken-window-bubbles-29 :id 357 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1503 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1503 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1503 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -455,8 +442,7 @@ ;; failed to figure out what this is: (defpart 1504 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -479,8 +465,7 @@ ;; failed to figure out what this is: (defpart 1503 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -500,8 +485,7 @@ (defpartgroup group-sunken-window-bubbles-159 :id 358 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1505 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1505 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1505 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -554,8 +538,7 @@ ;; failed to figure out what this is: (defpart 1506 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -578,8 +561,7 @@ ;; failed to figure out what this is: (defpart 1505 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -599,8 +581,7 @@ (defpartgroup group-sunken-window-bubbles-161 :id 359 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1507 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1507 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1507 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -653,8 +634,7 @@ ;; failed to figure out what this is: (defpart 1508 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -677,8 +657,7 @@ ;; failed to figure out what this is: (defpart 1507 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -698,8 +677,7 @@ (defpartgroup group-sunken-window-bubbles-204 :id 360 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1509 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1509 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1509 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -752,8 +730,7 @@ ;; failed to figure out what this is: (defpart 1510 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -776,8 +753,7 @@ ;; failed to figure out what this is: (defpart 1509 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -797,8 +773,7 @@ (defpartgroup group-sunken-window-bubbles-205 :id 361 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1511 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1511 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1511 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -851,8 +826,7 @@ ;; failed to figure out what this is: (defpart 1512 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -875,8 +849,7 @@ ;; failed to figure out what this is: (defpart 1511 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -896,8 +869,7 @@ (defpartgroup group-sunken-window-bubbles-203 :id 362 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1513 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1513 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1513 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -950,8 +922,7 @@ ;; failed to figure out what this is: (defpart 1514 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters -2)) @@ -974,8 +945,7 @@ ;; failed to figure out what this is: (defpart 1513 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters -2)) @@ -995,8 +965,7 @@ (defpartgroup group-sunken-window-bubbles-42 :id 363 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1515 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1515 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1515 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1049,8 +1018,7 @@ ;; failed to figure out what this is: (defpart 1516 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -25) (meters 50) 1.0) (sp-flt spt-y (meters -2)) @@ -1073,8 +1041,7 @@ ;; failed to figure out what this is: (defpart 1515 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -25) (meters 50) 1.0) (sp-flt spt-y (meters -2)) @@ -1094,8 +1061,7 @@ (defpartgroup group-sunken-window-bubbles-41 :id 364 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1517 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1517 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1517 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1148,8 +1114,7 @@ ;; failed to figure out what this is: (defpart 1518 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1172,8 +1137,7 @@ ;; failed to figure out what this is: (defpart 1517 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1193,8 +1157,7 @@ (defpartgroup group-sunken-window-bubbles-206 :id 365 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1519 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1519 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1519 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1247,8 +1210,7 @@ ;; failed to figure out what this is: (defpart 1520 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1271,8 +1233,7 @@ ;; failed to figure out what this is: (defpart 1519 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1292,8 +1253,7 @@ (defpartgroup group-sunken-window-bubbles-201 :id 366 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1521 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1521 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1521 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1346,8 +1306,7 @@ ;; failed to figure out what this is: (defpart 1522 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1370,8 +1329,7 @@ ;; failed to figure out what this is: (defpart 1521 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1391,8 +1349,7 @@ (defpartgroup group-sunken-window-bubbles-3 :id 367 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1523 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1523 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1523 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1445,8 +1402,7 @@ ;; failed to figure out what this is: (defpart 1524 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1469,8 +1425,7 @@ ;; failed to figure out what this is: (defpart 1523 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1490,8 +1445,7 @@ (defpartgroup group-sunken-window-bubbles-2 :id 368 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1525 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1525 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1525 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1544,8 +1498,7 @@ ;; failed to figure out what this is: (defpart 1526 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1568,8 +1521,7 @@ ;; failed to figure out what this is: (defpart 1525 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1589,8 +1541,7 @@ (defpartgroup group-sunken-heatpipe-382 :id 369 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1528 :fade-after (meters 80) :falloff-to (meters 80) :binding 1527) + :parts ((sp-item 1528 :fade-after (meters 80) :falloff-to (meters 80) :binding 1527) (sp-item 1527 :flags (bit1 start-dead launch-asap)) (sp-item 1527 :flags (bit1 start-dead launch-asap)) (sp-item 1527 :flags (bit1 start-dead launch-asap)) @@ -1622,8 +1573,7 @@ ;; failed to figure out what this is: (defpart 1528 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -1642,8 +1592,7 @@ ;; failed to figure out what this is: (defpart 1527 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 6.2222223)) (sp-flt spt-y (meters 4)) @@ -1667,8 +1616,7 @@ ;; failed to figure out what this is: (defpart 1529 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -1691,8 +1639,7 @@ (defpartgroup group-sunken-heatpipe-381 :id 370 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1531 :fade-after (meters 80) :falloff-to (meters 80) :binding 1530) + :parts ((sp-item 1531 :fade-after (meters 80) :falloff-to (meters 80) :binding 1530) (sp-item 1530 :flags (bit1 start-dead launch-asap)) (sp-item 1530 :flags (bit1 start-dead launch-asap)) (sp-item 1530 :flags (bit1 start-dead launch-asap)) @@ -1724,8 +1671,7 @@ ;; failed to figure out what this is: (defpart 1531 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -1744,8 +1690,7 @@ ;; failed to figure out what this is: (defpart 1530 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 7.5555553)) (sp-flt spt-y (meters 4)) @@ -1769,8 +1714,7 @@ ;; failed to figure out what this is: (defpart 1532 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -1793,8 +1737,7 @@ (defpartgroup group-sunken-heatpipe-380 :id 371 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1534 :fade-after (meters 80) :falloff-to (meters 80) :binding 1533) + :parts ((sp-item 1534 :fade-after (meters 80) :falloff-to (meters 80) :binding 1533) (sp-item 1533 :flags (bit1 start-dead launch-asap)) (sp-item 1533 :flags (bit1 start-dead launch-asap)) (sp-item 1533 :flags (bit1 start-dead launch-asap)) @@ -1826,8 +1769,7 @@ ;; failed to figure out what this is: (defpart 1534 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -1846,8 +1788,7 @@ ;; failed to figure out what this is: (defpart 1533 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 6.2222223)) (sp-flt spt-y (meters 4)) @@ -1871,8 +1812,7 @@ ;; failed to figure out what this is: (defpart 1535 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -1895,8 +1835,7 @@ (defpartgroup group-sunken-heatpipe-379 :id 372 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1537 :fade-after (meters 80) :falloff-to (meters 80) :binding 1536) + :parts ((sp-item 1537 :fade-after (meters 80) :falloff-to (meters 80) :binding 1536) (sp-item 1536 :flags (bit1 start-dead launch-asap)) (sp-item 1536 :flags (bit1 start-dead launch-asap)) (sp-item 1536 :flags (bit1 start-dead launch-asap)) @@ -1928,8 +1867,7 @@ ;; failed to figure out what this is: (defpart 1537 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -1948,8 +1886,7 @@ ;; failed to figure out what this is: (defpart 1536 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 7.111111)) (sp-flt spt-y (meters 4)) @@ -1973,8 +1910,7 @@ ;; failed to figure out what this is: (defpart 1538 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -1997,8 +1933,7 @@ (defpartgroup group-sunken-heatpipe-378 :id 373 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1540 :fade-after (meters 80) :falloff-to (meters 80) :binding 1539) + :parts ((sp-item 1540 :fade-after (meters 80) :falloff-to (meters 80) :binding 1539) (sp-item 1539 :flags (bit1 start-dead launch-asap)) (sp-item 1539 :flags (bit1 start-dead launch-asap)) (sp-item 1539 :flags (bit1 start-dead launch-asap)) @@ -2030,8 +1965,7 @@ ;; failed to figure out what this is: (defpart 1540 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -2050,8 +1984,7 @@ ;; failed to figure out what this is: (defpart 1539 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.111111)) (sp-flt spt-y (meters 4)) @@ -2075,8 +2008,7 @@ ;; failed to figure out what this is: (defpart 1541 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -2099,8 +2031,7 @@ (defpartgroup group-sunken-window-bubbles-402 :id 374 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1542 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1542 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1542 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -2153,8 +2084,7 @@ ;; failed to figure out what this is: (defpart 1543 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -2177,8 +2107,7 @@ ;; failed to figure out what this is: (defpart 1542 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -2198,8 +2127,7 @@ (defpartgroup group-sunken-window-bubbles-401 :id 375 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1544 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1544 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1544 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -2252,8 +2180,7 @@ ;; failed to figure out what this is: (defpart 1545 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -2276,8 +2203,7 @@ ;; failed to figure out what this is: (defpart 1544 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -2297,8 +2223,7 @@ (defpartgroup group-sunken-window-bubbles-400 :id 376 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1546 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1546 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1546 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -2351,8 +2276,7 @@ ;; failed to figure out what this is: (defpart 1547 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -2375,8 +2299,7 @@ ;; failed to figure out what this is: (defpart 1546 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -2396,8 +2319,7 @@ (defpartgroup group-sunken-window-bubbles-399 :id 377 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1548 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1548 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1548 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -2450,8 +2372,7 @@ ;; failed to figure out what this is: (defpart 1549 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -2474,8 +2395,7 @@ ;; failed to figure out what this is: (defpart 1548 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) diff --git a/test/decompiler/reference/levels/sunken/sunken-part3_REF.gc b/test/decompiler/reference/levels/sunken/sunken-part3_REF.gc index d1fb8753f3..afa9efdb15 100644 --- a/test/decompiler/reference/levels/sunken/sunken-part3_REF.gc +++ b/test/decompiler/reference/levels/sunken/sunken-part3_REF.gc @@ -5,8 +5,7 @@ (defpartgroup group-sunken-heatpipe-383 :id 378 :bounds (static-bspherem 0 1 0 3) - :parts - ((sp-item 1551 :fade-after (meters 80) :falloff-to (meters 80) :binding 1550) + :parts ((sp-item 1551 :fade-after (meters 80) :falloff-to (meters 80) :binding 1550) (sp-item 1550 :flags (bit1 start-dead launch-asap)) (sp-item 1550 :flags (bit1 start-dead launch-asap)) (sp-item 1550 :flags (bit1 start-dead launch-asap)) @@ -38,8 +37,7 @@ ;; failed to figure out what this is: (defpart 1551 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -58,8 +56,7 @@ ;; failed to figure out what this is: (defpart 1550 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 4)) @@ -83,8 +80,7 @@ ;; failed to figure out what this is: (defpart 1552 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -107,8 +103,7 @@ (defpartgroup group-sunken-heatpipe-198 :id 379 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1554 :fade-after (meters 80) :falloff-to (meters 80) :binding 1553) + :parts ((sp-item 1554 :fade-after (meters 80) :falloff-to (meters 80) :binding 1553) (sp-item 1553 :flags (bit1 start-dead launch-asap)) (sp-item 1553 :flags (bit1 start-dead launch-asap)) (sp-item 1553 :flags (bit1 start-dead launch-asap)) @@ -140,8 +135,7 @@ ;; failed to figure out what this is: (defpart 1554 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -160,8 +154,7 @@ ;; failed to figure out what this is: (defpart 1553 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.3333334)) (sp-flt spt-y (meters 4)) @@ -185,8 +178,7 @@ ;; failed to figure out what this is: (defpart 1555 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -209,8 +201,7 @@ (defpartgroup group-sunken-heatpipe-189 :id 380 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1557 :fade-after (meters 80) :falloff-to (meters 80) :binding 1556) + :parts ((sp-item 1557 :fade-after (meters 80) :falloff-to (meters 80) :binding 1556) (sp-item 1556 :flags (bit1 start-dead launch-asap)) (sp-item 1556 :flags (bit1 start-dead launch-asap)) (sp-item 1556 :flags (bit1 start-dead launch-asap)) @@ -242,8 +233,7 @@ ;; failed to figure out what this is: (defpart 1557 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 0.7) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -262,8 +252,7 @@ ;; failed to figure out what this is: (defpart 1556 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-x (meters 1.1555556)) (sp-flt spt-y (meters 4)) @@ -287,8 +276,7 @@ ;; failed to figure out what this is: (defpart 1558 - :init-specs - ((sp-flt spt-num 0.05) + :init-specs ((sp-flt spt-num 0.05) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -311,8 +299,7 @@ (defpartgroup group-sunken-heatpipe-193 :id 381 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1560 :fade-after (meters 80) :falloff-to (meters 80) :binding 1559) + :parts ((sp-item 1560 :fade-after (meters 80) :falloff-to (meters 80) :binding 1559) (sp-item 1559 :flags (bit1 start-dead launch-asap)) (sp-item 1559 :flags (bit1 start-dead launch-asap)) (sp-item 1559 :flags (bit1 start-dead launch-asap)) @@ -345,8 +332,7 @@ ;; failed to figure out what this is: (defpart 1560 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 0.4) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters -1.4)) @@ -365,8 +351,7 @@ ;; failed to figure out what this is: (defpart 1559 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.1555556)) (sp-flt spt-y (meters 0)) @@ -390,8 +375,7 @@ ;; failed to figure out what this is: (defpart 1561 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -1.4) (meters 2.8) 1.0) (sp-int spt-rot-x 6) (sp-flt spt-r 3276.8) @@ -409,8 +393,7 @@ ;; failed to figure out what this is: (defpart 1562 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -1.4) (meters 2.8) 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) @@ -435,8 +418,7 @@ (defpartgroup group-sunken-heatpipe-207 :id 382 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1564 :fade-after (meters 80) :falloff-to (meters 80) :binding 1563) + :parts ((sp-item 1564 :fade-after (meters 80) :falloff-to (meters 80) :binding 1563) (sp-item 1563 :flags (bit1 start-dead launch-asap)) (sp-item 1563 :flags (bit1 start-dead launch-asap)) (sp-item 1563 :flags (bit1 start-dead launch-asap)) @@ -468,8 +450,7 @@ ;; failed to figure out what this is: (defpart 1564 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) @@ -488,8 +469,7 @@ ;; failed to figure out what this is: (defpart 1563 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.1555557)) (sp-flt spt-y (meters 4)) @@ -513,8 +493,7 @@ ;; failed to figure out what this is: (defpart 1565 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.4)) (sp-flt spt-y (meters 0)) (sp-int spt-rot-x 6) @@ -537,8 +516,7 @@ (defpartgroup group-sunken-window-bubbles-388 :id 383 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1566 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1566 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1566 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -591,8 +569,7 @@ ;; failed to figure out what this is: (defpart 1567 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -12) (meters 24) 1.0) (sp-flt spt-y (meters -2)) @@ -615,8 +592,7 @@ ;; failed to figure out what this is: (defpart 1566 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -12) (meters 24) 1.0) (sp-flt spt-y (meters -2)) @@ -636,8 +612,7 @@ (defpartgroup group-sunken-window-bubbles-387 :id 384 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1568 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1568 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1568 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -690,8 +665,7 @@ ;; failed to figure out what this is: (defpart 1569 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -714,8 +688,7 @@ ;; failed to figure out what this is: (defpart 1568 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -735,8 +708,7 @@ (defpartgroup group-sunken-window-bubbles-386 :id 385 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1570 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1570 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1570 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -789,8 +761,7 @@ ;; failed to figure out what this is: (defpart 1571 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -813,8 +784,7 @@ ;; failed to figure out what this is: (defpart 1570 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -834,8 +804,7 @@ (defpartgroup group-sunken-window-bubbles-384 :id 386 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1572 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1572 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1572 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -888,8 +857,7 @@ ;; failed to figure out what this is: (defpart 1573 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -12) (meters 24) 1.0) (sp-flt spt-y (meters -2)) @@ -912,8 +880,7 @@ ;; failed to figure out what this is: (defpart 1572 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -12) (meters 24) 1.0) (sp-flt spt-y (meters -2)) @@ -933,8 +900,7 @@ (defpartgroup group-sunken-window-bubbles-385 :id 387 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1574 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1574 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1574 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -987,8 +953,7 @@ ;; failed to figure out what this is: (defpart 1575 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1011,8 +976,7 @@ ;; failed to figure out what this is: (defpart 1574 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1032,8 +996,7 @@ (defpartgroup group-sunken-window-bubbles-394 :id 388 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1576 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1576 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1576 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1086,8 +1049,7 @@ ;; failed to figure out what this is: (defpart 1577 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1110,8 +1072,7 @@ ;; failed to figure out what this is: (defpart 1576 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1131,8 +1092,7 @@ (defpartgroup group-sunken-window-bubbles-390 :id 389 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1578 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1578 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1578 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1185,8 +1145,7 @@ ;; failed to figure out what this is: (defpart 1579 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1209,8 +1168,7 @@ ;; failed to figure out what this is: (defpart 1578 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1230,8 +1188,7 @@ (defpartgroup group-sunken-window-bubbles-393 :id 390 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1582 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1582 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1582 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1284,8 +1241,7 @@ ;; failed to figure out what this is: (defpart 1583 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters -2)) @@ -1308,8 +1264,7 @@ ;; failed to figure out what this is: (defpart 1582 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters -2)) @@ -1329,8 +1284,7 @@ (defpartgroup group-sunken-window-bubbles-392 :id 391 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1584 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1584 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1584 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1383,8 +1337,7 @@ ;; failed to figure out what this is: (defpart 1585 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1407,8 +1360,7 @@ ;; failed to figure out what this is: (defpart 1584 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1428,8 +1380,7 @@ (defpartgroup group-sunken-window-bubbles-38 :id 392 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1586 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1586 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1586 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1482,8 +1433,7 @@ ;; failed to figure out what this is: (defpart 1587 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1506,8 +1456,7 @@ ;; failed to figure out what this is: (defpart 1586 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1527,8 +1476,7 @@ (defpartgroup group-sunken-window-bubbles-200 :id 393 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1588 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1588 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1588 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1581,8 +1529,7 @@ ;; failed to figure out what this is: (defpart 1589 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -10) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1605,8 +1552,7 @@ ;; failed to figure out what this is: (defpart 1588 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1626,8 +1572,7 @@ (defpartgroup group-sunken-window-bubbles-391 :id 394 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1580 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1580 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1580 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1680,8 +1625,7 @@ ;; failed to figure out what this is: (defpart 1581 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) @@ -1704,8 +1648,7 @@ ;; failed to figure out what this is: (defpart 1580 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-flt spt-y (meters -2)) diff --git a/test/decompiler/reference/levels/sunken/sunken-part4_REF.gc b/test/decompiler/reference/levels/sunken/sunken-part4_REF.gc index e81bbfc504..edae40bec0 100644 --- a/test/decompiler/reference/levels/sunken/sunken-part4_REF.gc +++ b/test/decompiler/reference/levels/sunken/sunken-part4_REF.gc @@ -5,8 +5,7 @@ (defpartgroup group-sunken-heatpipe-282 :id 395 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1591 :fade-after (meters 80) :falloff-to (meters 80) :binding 1590) + :parts ((sp-item 1591 :fade-after (meters 80) :falloff-to (meters 80) :binding 1590) (sp-item 1590 :flags (bit1 start-dead launch-asap)) (sp-item 1590 :flags (bit1 start-dead launch-asap)) (sp-item 1590 :flags (bit1 start-dead launch-asap)) @@ -38,8 +37,7 @@ ;; failed to figure out what this is: (defpart 1591 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -58,8 +56,7 @@ ;; failed to figure out what this is: (defpart 1590 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.1111112)) (sp-flt spt-y (meters 3.3333333)) @@ -83,8 +80,7 @@ ;; failed to figure out what this is: (defpart 1592 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -107,8 +103,7 @@ (defpartgroup group-sunken-heatpipe-285 :id 396 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1594 :fade-after (meters 80) :falloff-to (meters 80) :binding 1593) + :parts ((sp-item 1594 :fade-after (meters 80) :falloff-to (meters 80) :binding 1593) (sp-item 1593 :flags (bit1 start-dead launch-asap)) (sp-item 1593 :flags (bit1 start-dead launch-asap)) (sp-item 1593 :flags (bit1 start-dead launch-asap)) @@ -140,8 +135,7 @@ ;; failed to figure out what this is: (defpart 1594 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -160,8 +154,7 @@ ;; failed to figure out what this is: (defpart 1593 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0.6666667)) (sp-flt spt-y (meters 3.3333333)) @@ -185,8 +178,7 @@ ;; failed to figure out what this is: (defpart 1595 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -209,8 +201,7 @@ (defpartgroup group-sunken-heatpipe-288 :id 397 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1597 :fade-after (meters 80) :falloff-to (meters 80) :binding 1596) + :parts ((sp-item 1597 :fade-after (meters 80) :falloff-to (meters 80) :binding 1596) (sp-item 1596 :flags (bit1 start-dead launch-asap)) (sp-item 1596 :flags (bit1 start-dead launch-asap)) (sp-item 1596 :flags (bit1 start-dead launch-asap)) @@ -242,8 +233,7 @@ ;; failed to figure out what this is: (defpart 1597 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -262,8 +252,7 @@ ;; failed to figure out what this is: (defpart 1596 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 3.3333333)) @@ -287,8 +276,7 @@ ;; failed to figure out what this is: (defpart 1598 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -311,8 +299,7 @@ (defpartgroup group-sunken-heatpipe-299 :id 398 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1600 :fade-after (meters 80) :falloff-to (meters 80) :binding 1599) + :parts ((sp-item 1600 :fade-after (meters 80) :falloff-to (meters 80) :binding 1599) (sp-item 1599 :flags (bit1 start-dead launch-asap)) (sp-item 1599 :flags (bit1 start-dead launch-asap)) (sp-item 1599 :flags (bit1 start-dead launch-asap)) @@ -344,8 +331,7 @@ ;; failed to figure out what this is: (defpart 1600 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -364,8 +350,7 @@ ;; failed to figure out what this is: (defpart 1599 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -1.1111112)) (sp-flt spt-y (meters 3.3333333)) @@ -389,8 +374,7 @@ ;; failed to figure out what this is: (defpart 1601 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -413,8 +397,7 @@ (defpartgroup group-sunken-heatpipe-302 :id 399 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1603 :fade-after (meters 80) :falloff-to (meters 80) :binding 1602) + :parts ((sp-item 1603 :fade-after (meters 80) :falloff-to (meters 80) :binding 1602) (sp-item 1602 :flags (bit1 start-dead launch-asap)) (sp-item 1602 :flags (bit1 start-dead launch-asap)) (sp-item 1602 :flags (bit1 start-dead launch-asap)) @@ -446,8 +429,7 @@ ;; failed to figure out what this is: (defpart 1603 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -466,8 +448,7 @@ ;; failed to figure out what this is: (defpart 1602 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -1.7777778)) (sp-flt spt-y (meters 3.3333333)) @@ -491,8 +472,7 @@ ;; failed to figure out what this is: (defpart 1604 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -515,8 +495,7 @@ (defpartgroup group-sunken-heatpipe-367 :id 400 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1606 :fade-after (meters 80) :falloff-to (meters 80) :binding 1605) + :parts ((sp-item 1606 :fade-after (meters 80) :falloff-to (meters 80) :binding 1605) (sp-item 1605 :flags (bit1 start-dead launch-asap)) (sp-item 1605 :flags (bit1 start-dead launch-asap)) (sp-item 1605 :flags (bit1 start-dead launch-asap)) @@ -548,8 +527,7 @@ ;; failed to figure out what this is: (defpart 1606 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -568,8 +546,7 @@ ;; failed to figure out what this is: (defpart 1605 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -2.6666667)) (sp-flt spt-y (meters 3.3333333)) @@ -593,8 +570,7 @@ ;; failed to figure out what this is: (defpart 1607 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -617,8 +593,7 @@ (defpartgroup group-sunken-heatpipe-371 :id 401 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1609 :fade-after (meters 80) :falloff-to (meters 80) :binding 1608) + :parts ((sp-item 1609 :fade-after (meters 80) :falloff-to (meters 80) :binding 1608) (sp-item 1608 :flags (bit1 start-dead launch-asap)) (sp-item 1608 :flags (bit1 start-dead launch-asap)) (sp-item 1608 :flags (bit1 start-dead launch-asap)) @@ -650,8 +625,7 @@ ;; failed to figure out what this is: (defpart 1609 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -670,8 +644,7 @@ ;; failed to figure out what this is: (defpart 1608 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -3.5555556)) (sp-flt spt-y (meters 3.3333333)) @@ -695,8 +668,7 @@ ;; failed to figure out what this is: (defpart 1610 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -719,8 +691,7 @@ (defpartgroup group-sunken-heatpipe-308 :id 402 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1612 :fade-after (meters 80) :falloff-to (meters 80) :binding 1611) + :parts ((sp-item 1612 :fade-after (meters 80) :falloff-to (meters 80) :binding 1611) (sp-item 1611 :flags (bit1 start-dead launch-asap)) (sp-item 1611 :flags (bit1 start-dead launch-asap)) (sp-item 1611 :flags (bit1 start-dead launch-asap)) @@ -752,8 +723,7 @@ ;; failed to figure out what this is: (defpart 1612 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.3)) @@ -772,8 +742,7 @@ ;; failed to figure out what this is: (defpart 1611 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 3.7777777)) @@ -797,8 +766,7 @@ ;; failed to figure out what this is: (defpart 1613 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -821,8 +789,7 @@ (defpartgroup group-sunken-heatpipe-312 :id 403 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1615 :fade-after (meters 80) :falloff-to (meters 80) :binding 1614) + :parts ((sp-item 1615 :fade-after (meters 80) :falloff-to (meters 80) :binding 1614) (sp-item 1614 :flags (bit1 start-dead launch-asap)) (sp-item 1614 :flags (bit1 start-dead launch-asap)) (sp-item 1614 :flags (bit1 start-dead launch-asap)) @@ -854,8 +821,7 @@ ;; failed to figure out what this is: (defpart 1615 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.3)) @@ -874,8 +840,7 @@ ;; failed to figure out what this is: (defpart 1614 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -4.4444447)) (sp-flt spt-y (meters 4.4444447)) @@ -899,8 +864,7 @@ ;; failed to figure out what this is: (defpart 1616 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -923,8 +887,7 @@ (defpartgroup group-sunken-heatpipe-316 :id 404 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1618 :fade-after (meters 80) :falloff-to (meters 80) :binding 1617) + :parts ((sp-item 1618 :fade-after (meters 80) :falloff-to (meters 80) :binding 1617) (sp-item 1617 :flags (bit1 start-dead launch-asap)) (sp-item 1617 :flags (bit1 start-dead launch-asap)) (sp-item 1617 :flags (bit1 start-dead launch-asap)) @@ -956,8 +919,7 @@ ;; failed to figure out what this is: (defpart 1618 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.3)) @@ -976,8 +938,7 @@ ;; failed to figure out what this is: (defpart 1617 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -3.1111112)) (sp-flt spt-y (meters 4.4444447)) @@ -1001,8 +962,7 @@ ;; failed to figure out what this is: (defpart 1619 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -1025,8 +985,7 @@ (defpartgroup group-sunken-heatpipe-320 :id 405 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1621 :fade-after (meters 80) :falloff-to (meters 80) :binding 1620) + :parts ((sp-item 1621 :fade-after (meters 80) :falloff-to (meters 80) :binding 1620) (sp-item 1620 :flags (bit1 start-dead launch-asap)) (sp-item 1620 :flags (bit1 start-dead launch-asap)) (sp-item 1620 :flags (bit1 start-dead launch-asap)) @@ -1058,8 +1017,7 @@ ;; failed to figure out what this is: (defpart 1621 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.3)) @@ -1078,8 +1036,7 @@ ;; failed to figure out what this is: (defpart 1620 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -0.6666667)) (sp-flt spt-y (meters 4.4444447)) @@ -1103,8 +1060,7 @@ ;; failed to figure out what this is: (defpart 1622 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -1127,8 +1083,7 @@ (defpartgroup group-sunken-heatpipe-324 :id 406 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1624 :fade-after (meters 80) :falloff-to (meters 80) :binding 1623) + :parts ((sp-item 1624 :fade-after (meters 80) :falloff-to (meters 80) :binding 1623) (sp-item 1623 :flags (bit1 start-dead launch-asap)) (sp-item 1623 :flags (bit1 start-dead launch-asap)) (sp-item 1623 :flags (bit1 start-dead launch-asap)) @@ -1160,8 +1115,7 @@ ;; failed to figure out what this is: (defpart 1624 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.2)) @@ -1180,8 +1134,7 @@ ;; failed to figure out what this is: (defpart 1623 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0.22222222)) (sp-flt spt-y (meters 4.2222223)) @@ -1205,8 +1158,7 @@ ;; failed to figure out what this is: (defpart 1625 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) (sp-int spt-rot-x 6) @@ -1229,8 +1181,7 @@ (defpartgroup group-sunken-heatpipe-328 :id 407 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1627 :fade-after (meters 80) :falloff-to (meters 80) :binding 1626) + :parts ((sp-item 1627 :fade-after (meters 80) :falloff-to (meters 80) :binding 1626) (sp-item 1626 :flags (bit1 start-dead launch-asap)) (sp-item 1626 :flags (bit1 start-dead launch-asap)) (sp-item 1626 :flags (bit1 start-dead launch-asap)) @@ -1262,8 +1213,7 @@ ;; failed to figure out what this is: (defpart 1627 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.2)) @@ -1282,8 +1232,7 @@ ;; failed to figure out what this is: (defpart 1626 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0.8888889)) (sp-flt spt-y (meters 4.2222223)) @@ -1307,8 +1256,7 @@ ;; failed to figure out what this is: (defpart 1628 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) (sp-int spt-rot-x 6) @@ -1331,8 +1279,7 @@ (defpartgroup group-sunken-heatpipe-332 :id 408 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1630 :fade-after (meters 80) :falloff-to (meters 80) :binding 1629) + :parts ((sp-item 1630 :fade-after (meters 80) :falloff-to (meters 80) :binding 1629) (sp-item 1629 :flags (bit1 start-dead launch-asap)) (sp-item 1629 :flags (bit1 start-dead launch-asap)) (sp-item 1629 :flags (bit1 start-dead launch-asap)) @@ -1364,8 +1311,7 @@ ;; failed to figure out what this is: (defpart 1630 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.4)) @@ -1384,8 +1330,7 @@ ;; failed to figure out what this is: (defpart 1629 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 3.3333333)) (sp-flt spt-y (meters 4.6666665)) @@ -1409,8 +1354,7 @@ ;; failed to figure out what this is: (defpart 1631 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.70000005)) (sp-int spt-rot-x 6) @@ -1433,8 +1377,7 @@ (defpartgroup group-sunken-heatpipe-333 :id 409 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1633 :fade-after (meters 80) :falloff-to (meters 80) :binding 1632) + :parts ((sp-item 1633 :fade-after (meters 80) :falloff-to (meters 80) :binding 1632) (sp-item 1632 :flags (bit1 start-dead launch-asap)) (sp-item 1632 :flags (bit1 start-dead launch-asap)) (sp-item 1632 :flags (bit1 start-dead launch-asap)) @@ -1466,8 +1409,7 @@ ;; failed to figure out what this is: (defpart 1633 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.9)) (sp-flt spt-y (meters 0.9)) @@ -1486,8 +1428,7 @@ ;; failed to figure out what this is: (defpart 1632 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.3333335)) (sp-flt spt-y (meters 5.111111)) @@ -1511,8 +1452,7 @@ ;; failed to figure out what this is: (defpart 1634 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.9)) (sp-flt spt-y (meters 1.2)) (sp-int spt-rot-x 6) @@ -1535,8 +1475,7 @@ (defpartgroup group-sunken-heatpipe-334 :id 410 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1636 :fade-after (meters 80) :falloff-to (meters 80) :binding 1635) + :parts ((sp-item 1636 :fade-after (meters 80) :falloff-to (meters 80) :binding 1635) (sp-item 1635 :flags (bit1 start-dead launch-asap)) (sp-item 1635 :flags (bit1 start-dead launch-asap)) (sp-item 1635 :flags (bit1 start-dead launch-asap)) @@ -1568,8 +1507,7 @@ ;; failed to figure out what this is: (defpart 1636 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.9)) (sp-flt spt-y (meters 0.7)) @@ -1588,8 +1526,7 @@ ;; failed to figure out what this is: (defpart 1635 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.111111)) (sp-flt spt-y (meters 5.111111)) @@ -1613,8 +1550,7 @@ ;; failed to figure out what this is: (defpart 1637 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -1.9)) (sp-flt spt-y (meters 1)) (sp-int spt-rot-x 6) @@ -1637,8 +1573,7 @@ (defpartgroup group-sunken-heatpipe-335 :id 411 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1639 :fade-after (meters 80) :falloff-to (meters 80) :binding 1638) + :parts ((sp-item 1639 :fade-after (meters 80) :falloff-to (meters 80) :binding 1638) (sp-item 1638 :flags (bit1 start-dead launch-asap)) (sp-item 1638 :flags (bit1 start-dead launch-asap)) (sp-item 1638 :flags (bit1 start-dead launch-asap)) @@ -1670,8 +1605,7 @@ ;; failed to figure out what this is: (defpart 1639 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -1690,8 +1624,7 @@ ;; failed to figure out what this is: (defpart 1638 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 4.4444447)) (sp-flt spt-y (meters 5.111111)) @@ -1715,8 +1648,7 @@ ;; failed to figure out what this is: (defpart 1640 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1739,8 +1671,7 @@ (defpartgroup group-sunken-heatpipe-336 :id 412 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1642 :fade-after (meters 80) :falloff-to (meters 80) :binding 1641) + :parts ((sp-item 1642 :fade-after (meters 80) :falloff-to (meters 80) :binding 1641) (sp-item 1641 :flags (bit1 start-dead launch-asap)) (sp-item 1641 :flags (bit1 start-dead launch-asap)) (sp-item 1641 :flags (bit1 start-dead launch-asap)) @@ -1772,8 +1703,7 @@ ;; failed to figure out what this is: (defpart 1642 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -1792,8 +1722,7 @@ ;; failed to figure out what this is: (defpart 1641 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 3.7777777)) (sp-flt spt-y (meters 5.111111)) @@ -1817,8 +1746,7 @@ ;; failed to figure out what this is: (defpart 1643 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1841,8 +1769,7 @@ (defpartgroup group-sunken-heatpipe-337 :id 413 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1645 :fade-after (meters 80) :falloff-to (meters 80) :binding 1644) + :parts ((sp-item 1645 :fade-after (meters 80) :falloff-to (meters 80) :binding 1644) (sp-item 1644 :flags (bit1 start-dead launch-asap)) (sp-item 1644 :flags (bit1 start-dead launch-asap)) (sp-item 1644 :flags (bit1 start-dead launch-asap)) @@ -1874,8 +1801,7 @@ ;; failed to figure out what this is: (defpart 1645 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -1894,8 +1820,7 @@ ;; failed to figure out what this is: (defpart 1644 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 2.4444444)) (sp-flt spt-y (meters 5.111111)) @@ -1919,8 +1844,7 @@ ;; failed to figure out what this is: (defpart 1646 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1943,8 +1867,7 @@ (defpartgroup group-sunken-heatpipe-338 :id 414 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1648 :fade-after (meters 80) :falloff-to (meters 80) :binding 1647) + :parts ((sp-item 1648 :fade-after (meters 80) :falloff-to (meters 80) :binding 1647) (sp-item 1647 :flags (bit1 start-dead launch-asap)) (sp-item 1647 :flags (bit1 start-dead launch-asap)) (sp-item 1647 :flags (bit1 start-dead launch-asap)) @@ -1976,8 +1899,7 @@ ;; failed to figure out what this is: (defpart 1648 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -1996,8 +1918,7 @@ ;; failed to figure out what this is: (defpart 1647 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.7777778)) (sp-flt spt-y (meters 5.111111)) @@ -2021,8 +1942,7 @@ ;; failed to figure out what this is: (defpart 1649 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -2045,8 +1965,7 @@ (defpartgroup group-sunken-heatpipe-339 :id 415 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1651 :fade-after (meters 80) :falloff-to (meters 80) :binding 1650) + :parts ((sp-item 1651 :fade-after (meters 80) :falloff-to (meters 80) :binding 1650) (sp-item 1650 :flags (bit1 start-dead launch-asap)) (sp-item 1650 :flags (bit1 start-dead launch-asap)) (sp-item 1650 :flags (bit1 start-dead launch-asap)) @@ -2078,8 +1997,7 @@ ;; failed to figure out what this is: (defpart 1651 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.3)) @@ -2098,8 +2016,7 @@ ;; failed to figure out what this is: (defpart 1650 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0.44444445)) (sp-flt spt-y (meters 4.4444447)) @@ -2123,8 +2040,7 @@ ;; failed to figure out what this is: (defpart 1652 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -2147,8 +2063,7 @@ (defpartgroup group-sunken-heatpipe-340 :id 416 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1654 :fade-after (meters 80) :falloff-to (meters 80) :binding 1653) + :parts ((sp-item 1654 :fade-after (meters 80) :falloff-to (meters 80) :binding 1653) (sp-item 1653 :flags (bit1 start-dead launch-asap)) (sp-item 1653 :flags (bit1 start-dead launch-asap)) (sp-item 1653 :flags (bit1 start-dead launch-asap)) @@ -2180,8 +2095,7 @@ ;; failed to figure out what this is: (defpart 1654 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.5)) @@ -2200,8 +2114,7 @@ ;; failed to figure out what this is: (defpart 1653 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 3.1111112)) (sp-flt spt-y (meters 3.5555556)) @@ -2225,8 +2138,7 @@ ;; failed to figure out what this is: (defpart 1655 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -2249,8 +2161,7 @@ (defpartgroup group-sunken-heatpipe-341 :id 417 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1657 :fade-after (meters 80) :falloff-to (meters 80) :binding 1656) + :parts ((sp-item 1657 :fade-after (meters 80) :falloff-to (meters 80) :binding 1656) (sp-item 1656 :flags (bit1 start-dead launch-asap)) (sp-item 1656 :flags (bit1 start-dead launch-asap)) (sp-item 1656 :flags (bit1 start-dead launch-asap)) @@ -2282,8 +2193,7 @@ ;; failed to figure out what this is: (defpart 1657 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.3)) @@ -2302,8 +2212,7 @@ ;; failed to figure out what this is: (defpart 1656 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 3.7777777)) (sp-flt spt-y (meters 3.5555556)) @@ -2327,8 +2236,7 @@ ;; failed to figure out what this is: (defpart 1658 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -2351,8 +2259,7 @@ (defpartgroup group-sunken-heatpipe-357 :id 418 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1660 :fade-after (meters 80) :falloff-to (meters 80) :binding 1659) + :parts ((sp-item 1660 :fade-after (meters 80) :falloff-to (meters 80) :binding 1659) (sp-item 1659 :flags (bit1 start-dead launch-asap)) (sp-item 1659 :flags (bit1 start-dead launch-asap)) (sp-item 1659 :flags (bit1 start-dead launch-asap)) @@ -2384,8 +2291,7 @@ ;; failed to figure out what this is: (defpart 1660 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.3)) @@ -2404,8 +2310,7 @@ ;; failed to figure out what this is: (defpart 1659 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.7777778)) (sp-flt spt-y (meters 3.5555556)) @@ -2429,8 +2334,7 @@ ;; failed to figure out what this is: (defpart 1661 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -2453,8 +2357,7 @@ (defpartgroup group-sunken-heatpipe-356 :id 419 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1663 :fade-after (meters 80) :falloff-to (meters 80) :binding 1662) + :parts ((sp-item 1663 :fade-after (meters 80) :falloff-to (meters 80) :binding 1662) (sp-item 1662 :flags (bit1 start-dead launch-asap)) (sp-item 1662 :flags (bit1 start-dead launch-asap)) (sp-item 1662 :flags (bit1 start-dead launch-asap)) @@ -2486,8 +2389,7 @@ ;; failed to figure out what this is: (defpart 1663 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.3)) @@ -2506,8 +2408,7 @@ ;; failed to figure out what this is: (defpart 1662 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.7777778)) (sp-flt spt-y (meters 4.4444447)) @@ -2531,8 +2432,7 @@ ;; failed to figure out what this is: (defpart 1664 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -2555,8 +2455,7 @@ (defpartgroup group-sunken-heatpipe-354 :id 420 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1666 :fade-after (meters 80) :falloff-to (meters 80) :binding 1665) + :parts ((sp-item 1666 :fade-after (meters 80) :falloff-to (meters 80) :binding 1665) (sp-item 1665 :flags (bit1 start-dead launch-asap)) (sp-item 1665 :flags (bit1 start-dead launch-asap)) (sp-item 1665 :flags (bit1 start-dead launch-asap)) @@ -2588,8 +2487,7 @@ ;; failed to figure out what this is: (defpart 1666 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.3)) @@ -2608,8 +2506,7 @@ ;; failed to figure out what this is: (defpart 1665 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 2.6666667)) (sp-flt spt-y (meters 4.4444447)) @@ -2633,8 +2530,7 @@ ;; failed to figure out what this is: (defpart 1667 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -2657,14 +2553,12 @@ (defpartgroup group-sunken-sheild :id 565 :bounds (static-bspherem 0 0 0 32) - :parts - ((sp-item 2311) (sp-item 2312 :flags (is-3d))) + :parts ((sp-item 2311) (sp-item 2312 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 2312 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-rnd-flt spt-num 0.1 0.6 1.0) (sp-rnd-flt spt-x (meters 0) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) @@ -2689,14 +2583,12 @@ ;; failed to figure out what this is: (defpart 2313 - :init-specs - ((sp-flt spt-fade-a 0.0)) + :init-specs ((sp-flt spt-fade-a 0.0)) ) ;; failed to figure out what this is: (defpart 2311 - :init-specs - ((sp-rnd-flt spt-num 4.0 2.0 1.0) + :init-specs ((sp-rnd-flt spt-num 4.0 2.0 1.0) (sp-rnd-flt spt-x (meters 2) (meters 17) 1.0) (sp-flt spt-y (meters -6)) (sp-int spt-rot-x 8) @@ -2715,6 +2607,5 @@ ;; failed to figure out what this is: (defpart 2314 - :init-specs - ((sp-flt spt-fade-b 32.768)) + :init-specs ((sp-flt spt-fade-b 32.768)) ) diff --git a/test/decompiler/reference/levels/sunken/sunken-part5_REF.gc b/test/decompiler/reference/levels/sunken/sunken-part5_REF.gc index c47b010de1..52fed3f6e5 100644 --- a/test/decompiler/reference/levels/sunken/sunken-part5_REF.gc +++ b/test/decompiler/reference/levels/sunken/sunken-part5_REF.gc @@ -5,8 +5,7 @@ (defpartgroup group-sunken-heatpipe-227 :id 421 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1669 :fade-after (meters 80) :falloff-to (meters 80) :binding 1668) + :parts ((sp-item 1669 :fade-after (meters 80) :falloff-to (meters 80) :binding 1668) (sp-item 1668 :flags (bit1 start-dead launch-asap)) (sp-item 1668 :flags (bit1 start-dead launch-asap)) (sp-item 1668 :flags (bit1 start-dead launch-asap)) @@ -38,8 +37,7 @@ ;; failed to figure out what this is: (defpart 1669 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) @@ -58,8 +56,7 @@ ;; failed to figure out what this is: (defpart 1668 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -1.7777778)) (sp-flt spt-y (meters 4.888889)) @@ -83,8 +80,7 @@ ;; failed to figure out what this is: (defpart 1670 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.90000004)) (sp-int spt-rot-x 6) @@ -107,8 +103,7 @@ (defpartgroup group-sunken-heatpipe-238 :id 422 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1672 :fade-after (meters 80) :falloff-to (meters 80) :binding 1671) + :parts ((sp-item 1672 :fade-after (meters 80) :falloff-to (meters 80) :binding 1671) (sp-item 1671 :flags (bit1 start-dead launch-asap)) (sp-item 1671 :flags (bit1 start-dead launch-asap)) (sp-item 1671 :flags (bit1 start-dead launch-asap)) @@ -140,8 +135,7 @@ ;; failed to figure out what this is: (defpart 1672 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) @@ -160,8 +154,7 @@ ;; failed to figure out what this is: (defpart 1671 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -0.44444445)) (sp-flt spt-y (meters 4.888889)) @@ -185,8 +178,7 @@ ;; failed to figure out what this is: (defpart 1673 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.90000004)) (sp-int spt-rot-x 6) @@ -209,8 +201,7 @@ (defpartgroup group-sunken-heatpipe-239 :id 423 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1675 :fade-after (meters 80) :falloff-to (meters 80) :binding 1674) + :parts ((sp-item 1675 :fade-after (meters 80) :falloff-to (meters 80) :binding 1674) (sp-item 1674 :flags (bit1 start-dead launch-asap)) (sp-item 1674 :flags (bit1 start-dead launch-asap)) (sp-item 1674 :flags (bit1 start-dead launch-asap)) @@ -242,8 +233,7 @@ ;; failed to figure out what this is: (defpart 1675 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) @@ -262,8 +252,7 @@ ;; failed to figure out what this is: (defpart 1674 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -1.1111112)) (sp-flt spt-y (meters 4.888889)) @@ -287,8 +276,7 @@ ;; failed to figure out what this is: (defpart 1676 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.90000004)) (sp-int spt-rot-x 6) @@ -311,8 +299,7 @@ (defpartgroup group-sunken-heatpipe-240 :id 424 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1678 :fade-after (meters 80) :falloff-to (meters 80) :binding 1677) + :parts ((sp-item 1678 :fade-after (meters 80) :falloff-to (meters 80) :binding 1677) (sp-item 1677 :flags (bit1 start-dead launch-asap)) (sp-item 1677 :flags (bit1 start-dead launch-asap)) (sp-item 1677 :flags (bit1 start-dead launch-asap)) @@ -344,8 +331,7 @@ ;; failed to figure out what this is: (defpart 1678 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) @@ -364,8 +350,7 @@ ;; failed to figure out what this is: (defpart 1677 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 4.888889)) @@ -389,8 +374,7 @@ ;; failed to figure out what this is: (defpart 1679 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.90000004)) (sp-int spt-rot-x 6) @@ -413,8 +397,7 @@ (defpartgroup group-sunken-heatpipe-241 :id 425 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1681 :fade-after (meters 80) :falloff-to (meters 80) :binding 1680) + :parts ((sp-item 1681 :fade-after (meters 80) :falloff-to (meters 80) :binding 1680) (sp-item 1680 :flags (bit1 start-dead launch-asap)) (sp-item 1680 :flags (bit1 start-dead launch-asap)) (sp-item 1680 :flags (bit1 start-dead launch-asap)) @@ -446,8 +429,7 @@ ;; failed to figure out what this is: (defpart 1681 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) @@ -466,8 +448,7 @@ ;; failed to figure out what this is: (defpart 1680 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -0.6666667)) (sp-flt spt-y (meters 4.888889)) @@ -491,8 +472,7 @@ ;; failed to figure out what this is: (defpart 1682 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.90000004)) (sp-int spt-rot-x 6) @@ -515,8 +495,7 @@ (defpartgroup group-sunken-heatpipe-242 :id 426 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1684 :fade-after (meters 80) :falloff-to (meters 80) :binding 1683) + :parts ((sp-item 1684 :fade-after (meters 80) :falloff-to (meters 80) :binding 1683) (sp-item 1683 :flags (bit1 start-dead launch-asap)) (sp-item 1683 :flags (bit1 start-dead launch-asap)) (sp-item 1683 :flags (bit1 start-dead launch-asap)) @@ -548,8 +527,7 @@ ;; failed to figure out what this is: (defpart 1684 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) @@ -568,8 +546,7 @@ ;; failed to figure out what this is: (defpart 1683 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 4.888889)) @@ -593,8 +570,7 @@ ;; failed to figure out what this is: (defpart 1685 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.90000004)) (sp-int spt-rot-x 6) @@ -617,8 +593,7 @@ (defpartgroup group-sunken-heatpipe-243 :id 427 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1687 :fade-after (meters 80) :falloff-to (meters 80) :binding 1686) + :parts ((sp-item 1687 :fade-after (meters 80) :falloff-to (meters 80) :binding 1686) (sp-item 1686 :flags (bit1 start-dead launch-asap)) (sp-item 1686 :flags (bit1 start-dead launch-asap)) (sp-item 1686 :flags (bit1 start-dead launch-asap)) @@ -650,8 +625,7 @@ ;; failed to figure out what this is: (defpart 1687 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.4)) @@ -670,8 +644,7 @@ ;; failed to figure out what this is: (defpart 1686 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -2.4444444)) (sp-flt spt-y (meters 4.4444447)) @@ -695,8 +668,7 @@ ;; failed to figure out what this is: (defpart 1688 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.70000005)) (sp-int spt-rot-x 6) @@ -719,8 +691,7 @@ (defpartgroup group-sunken-heatpipe-278 :id 428 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1690 :fade-after (meters 80) :falloff-to (meters 80) :binding 1689) + :parts ((sp-item 1690 :fade-after (meters 80) :falloff-to (meters 80) :binding 1689) (sp-item 1689 :flags (bit1 start-dead launch-asap)) (sp-item 1689 :flags (bit1 start-dead launch-asap)) (sp-item 1689 :flags (bit1 start-dead launch-asap)) @@ -752,8 +723,7 @@ ;; failed to figure out what this is: (defpart 1690 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.4)) @@ -772,8 +742,7 @@ ;; failed to figure out what this is: (defpart 1689 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -3.0222223)) (sp-flt spt-y (meters 4.6666665)) @@ -797,8 +766,7 @@ ;; failed to figure out what this is: (defpart 1691 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.70000005)) (sp-int spt-rot-x 6) @@ -821,8 +789,7 @@ (defpartgroup group-sunken-heatpipe-251 :id 429 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1693 :fade-after (meters 80) :falloff-to (meters 80) :binding 1692) + :parts ((sp-item 1693 :fade-after (meters 80) :falloff-to (meters 80) :binding 1692) (sp-item 1692 :flags (bit1 start-dead launch-asap)) (sp-item 1692 :flags (bit1 start-dead launch-asap)) (sp-item 1692 :flags (bit1 start-dead launch-asap)) @@ -854,8 +821,7 @@ ;; failed to figure out what this is: (defpart 1693 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.4)) @@ -874,8 +840,7 @@ ;; failed to figure out what this is: (defpart 1692 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -2.1333334)) (sp-flt spt-y (meters 4.6666665)) @@ -899,8 +864,7 @@ ;; failed to figure out what this is: (defpart 1694 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.70000005)) (sp-int spt-rot-x 6) @@ -923,8 +887,7 @@ (defpartgroup group-sunken-heatpipe-254 :id 430 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1696 :fade-after (meters 80) :falloff-to (meters 80) :binding 1695) + :parts ((sp-item 1696 :fade-after (meters 80) :falloff-to (meters 80) :binding 1695) (sp-item 1695 :flags (bit1 start-dead launch-asap)) (sp-item 1695 :flags (bit1 start-dead launch-asap)) (sp-item 1695 :flags (bit1 start-dead launch-asap)) @@ -956,8 +919,7 @@ ;; failed to figure out what this is: (defpart 1696 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.4)) @@ -976,8 +938,7 @@ ;; failed to figure out what this is: (defpart 1695 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -3.911111)) (sp-flt spt-y (meters 4.6666665)) @@ -1001,8 +962,7 @@ ;; failed to figure out what this is: (defpart 1697 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.70000005)) (sp-int spt-rot-x 6) @@ -1025,8 +985,7 @@ (defpartgroup group-sunken-heatpipe-264 :id 431 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1699 :fade-after (meters 80) :falloff-to (meters 80) :binding 1698) + :parts ((sp-item 1699 :fade-after (meters 80) :falloff-to (meters 80) :binding 1698) (sp-item 1698 :flags (bit1 start-dead launch-asap)) (sp-item 1698 :flags (bit1 start-dead launch-asap)) (sp-item 1698 :flags (bit1 start-dead launch-asap)) @@ -1058,8 +1017,7 @@ ;; failed to figure out what this is: (defpart 1699 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.4)) @@ -1078,8 +1036,7 @@ ;; failed to figure out what this is: (defpart 1698 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -4.6666665)) (sp-flt spt-y (meters 4.6666665)) @@ -1103,8 +1060,7 @@ ;; failed to figure out what this is: (defpart 1700 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.70000005)) (sp-int spt-rot-x 6) @@ -1127,8 +1083,7 @@ (defpartgroup group-sunken-heatpipe-265 :id 432 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1702 :fade-after (meters 80) :falloff-to (meters 80) :binding 1701) + :parts ((sp-item 1702 :fade-after (meters 80) :falloff-to (meters 80) :binding 1701) (sp-item 1701 :flags (bit1 start-dead launch-asap)) (sp-item 1701 :flags (bit1 start-dead launch-asap)) (sp-item 1701 :flags (bit1 start-dead launch-asap)) @@ -1160,8 +1115,7 @@ ;; failed to figure out what this is: (defpart 1702 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.4)) @@ -1180,8 +1134,7 @@ ;; failed to figure out what this is: (defpart 1701 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -5.3333335)) (sp-flt spt-y (meters 4.6666665)) @@ -1205,8 +1158,7 @@ ;; failed to figure out what this is: (defpart 1703 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.70000005)) (sp-int spt-rot-x 6) @@ -1229,8 +1181,7 @@ (defpartgroup group-sunken-heatpipe-266 :id 433 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1705 :fade-after (meters 80) :falloff-to (meters 80) :binding 1704) + :parts ((sp-item 1705 :fade-after (meters 80) :falloff-to (meters 80) :binding 1704) (sp-item 1704 :flags (bit1 start-dead launch-asap)) (sp-item 1704 :flags (bit1 start-dead launch-asap)) (sp-item 1704 :flags (bit1 start-dead launch-asap)) @@ -1262,8 +1213,7 @@ ;; failed to figure out what this is: (defpart 1705 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.6)) @@ -1282,8 +1232,7 @@ ;; failed to figure out what this is: (defpart 1704 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -6.4444447)) (sp-flt spt-y (meters 4.888889)) @@ -1307,8 +1256,7 @@ ;; failed to figure out what this is: (defpart 1706 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.90000004)) (sp-int spt-rot-x 6) @@ -1331,8 +1279,7 @@ (defpartgroup group-sunken-heatpipe-267 :id 434 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1708 :fade-after (meters 80) :falloff-to (meters 80) :binding 1707) + :parts ((sp-item 1708 :fade-after (meters 80) :falloff-to (meters 80) :binding 1707) (sp-item 1707 :flags (bit1 start-dead launch-asap)) (sp-item 1707 :flags (bit1 start-dead launch-asap)) (sp-item 1707 :flags (bit1 start-dead launch-asap)) @@ -1364,8 +1311,7 @@ ;; failed to figure out what this is: (defpart 1708 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.7)) @@ -1384,8 +1330,7 @@ ;; failed to figure out what this is: (defpart 1707 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -7.7777777)) (sp-flt spt-y (meters 5.111111)) @@ -1409,8 +1354,7 @@ ;; failed to figure out what this is: (defpart 1709 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 1)) (sp-int spt-rot-x 6) @@ -1433,8 +1377,7 @@ (defpartgroup group-sunken-heatpipe-268 :id 435 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1711 :fade-after (meters 80) :falloff-to (meters 80) :binding 1710) + :parts ((sp-item 1711 :fade-after (meters 80) :falloff-to (meters 80) :binding 1710) (sp-item 1710 :flags (bit1 start-dead launch-asap)) (sp-item 1710 :flags (bit1 start-dead launch-asap)) (sp-item 1710 :flags (bit1 start-dead launch-asap)) @@ -1466,8 +1409,7 @@ ;; failed to figure out what this is: (defpart 1711 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 0.7)) @@ -1486,8 +1428,7 @@ ;; failed to figure out what this is: (defpart 1710 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -9.333333)) (sp-flt spt-y (meters 4.6666665)) @@ -1511,8 +1452,7 @@ ;; failed to figure out what this is: (defpart 1712 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2)) (sp-flt spt-y (meters 1)) (sp-int spt-rot-x 6) diff --git a/test/decompiler/reference/levels/sunken/sunken-part_REF.gc b/test/decompiler/reference/levels/sunken/sunken-part_REF.gc index 0607161174..80f8dda5aa 100644 --- a/test/decompiler/reference/levels/sunken/sunken-part_REF.gc +++ b/test/decompiler/reference/levels/sunken/sunken-part_REF.gc @@ -22,8 +22,7 @@ (defpartgroup group-sunken-heatpipe-183 :id 332 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1420 :fade-after (meters 80) :falloff-to (meters 80) :binding 1419) + :parts ((sp-item 1420 :fade-after (meters 80) :falloff-to (meters 80) :binding 1419) (sp-item 1419 :flags (bit1 start-dead launch-asap)) (sp-item 1419 :flags (bit1 start-dead launch-asap)) (sp-item 1419 :flags (bit1 start-dead launch-asap)) @@ -55,8 +54,7 @@ ;; failed to figure out what this is: (defpart 1420 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.5)) (sp-flt spt-y (meters 0.2)) @@ -74,8 +72,7 @@ ;; failed to figure out what this is: (defpart 1419 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 4)) (sp-flt spt-y (meters 4.2222223)) @@ -99,14 +96,12 @@ ;; failed to figure out what this is: (defpart 1422 - :init-specs - ((sp-flt spt-fade-a -0.64)) + :init-specs ((sp-flt spt-fade-a -0.64)) ) ;; failed to figure out what this is: (defpart 1421 - :init-specs - ((sp-flt spt-num 0.25) + :init-specs ((sp-flt spt-num 0.25) (sp-flt spt-x (meters -2.5)) (sp-flt spt-y (meters 0.2)) (sp-int spt-rot-x 6) @@ -128,8 +123,7 @@ (defpartgroup group-sunken-tunnel-bubbles-27 :id 333 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1425 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1425 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1425 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1426 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1426 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) @@ -232,8 +226,7 @@ ;; failed to figure out what this is: (defpart 1427 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -37) (meters 64) 1.0) (sp-flt spt-y (meters -2)) @@ -256,8 +249,7 @@ ;; failed to figure out what this is: (defpart 1428 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -37) (meters 64) 1.0) (sp-flt spt-y (meters -2)) @@ -280,8 +272,7 @@ ;; failed to figure out what this is: (defpart 1425 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -37) (meters 64) 1.0) (sp-flt spt-y (meters -2)) @@ -299,8 +290,7 @@ ;; failed to figure out what this is: (defpart 1426 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -37) (meters 64) 1.0) (sp-flt spt-y (meters -2)) @@ -318,8 +308,7 @@ ;; failed to figure out what this is: (defpart 1429 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 1800 1799 1) (sp-launcher-by-id spt-next-launcher 1430) ) @@ -327,14 +316,12 @@ ;; failed to figure out what this is: (defpart 1430 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) ;; failed to figure out what this is: (defpart 1423 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -361,8 +348,7 @@ ;; failed to figure out what this is: (defpart 1431 - :init-specs - ((sp-flt spt-scale-x (meters 1.2)) + :init-specs ((sp-flt spt-scale-x (meters 1.2)) (sp-flt spt-scale-y (meters 1)) (sp-flt spt-scalevel-x (meters 0.010000001)) (sp-flt spt-scalevel-y (meters -0.0033333334)) @@ -374,8 +360,7 @@ ;; failed to figure out what this is: (defpart 1432 - :init-specs - ((sp-flt spt-scale-x (meters 1.5)) + :init-specs ((sp-flt spt-scale-x (meters 1.5)) (sp-flt spt-scale-y (meters 0.9)) (sp-flt spt-scalevel-x (meters -0.010000001)) (sp-flt spt-scalevel-y (meters 0.0033333334)) @@ -386,8 +371,7 @@ ;; failed to figure out what this is: (defpart 1433 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 0)) (sp-flt spt-z (meters 0)) @@ -406,8 +390,7 @@ ;; failed to figure out what this is: (defpart 1424 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -430,8 +413,7 @@ ;; failed to figure out what this is: (defpart 1434 - :init-specs - ((sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.0016666667) 1.0) + :init-specs ((sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.0016666667) 1.0) (sp-flt spt-accel-y -0.27306667) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 1435) @@ -440,16 +422,14 @@ ;; failed to figure out what this is: (defpart 1435 - :init-specs - ((sp-flt spt-fade-a -0.14222223)) + :init-specs ((sp-flt spt-fade-a -0.14222223)) ) ;; failed to figure out what this is: (defpartgroup group-sunken-tunnel-bubbles-32 :id 334 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1436 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1436 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1436 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1437 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1437 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) @@ -552,8 +532,7 @@ ;; failed to figure out what this is: (defpart 1438 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -24) (meters 48) 1.0) (sp-flt spt-y (meters -2)) @@ -576,8 +555,7 @@ ;; failed to figure out what this is: (defpart 1439 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.06) (sp-rnd-flt spt-x (meters -24) (meters 48) 1.0) (sp-flt spt-y (meters -2)) @@ -600,8 +578,7 @@ ;; failed to figure out what this is: (defpart 1436 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -24) (meters 48) 1.0) (sp-flt spt-y (meters -2)) @@ -619,8 +596,7 @@ ;; failed to figure out what this is: (defpart 1437 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -24) (meters 48) 1.0) (sp-flt spt-y (meters -2)) @@ -640,8 +616,7 @@ (defpartgroup group-sunken-tunnel-bubbles-33 :id 335 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1440 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1440 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1440 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1441 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1441 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) @@ -744,8 +719,7 @@ ;; failed to figure out what this is: (defpart 1442 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.02) (sp-rnd-flt spt-x (meters -13) (meters 25) 1.0) (sp-flt spt-y (meters -2)) @@ -768,8 +742,7 @@ ;; failed to figure out what this is: (defpart 1443 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.02) (sp-rnd-flt spt-x (meters -13) (meters 25) 1.0) (sp-flt spt-y (meters -2)) @@ -792,8 +765,7 @@ ;; failed to figure out what this is: (defpart 1440 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -13) (meters 25) 1.0) (sp-flt spt-y (meters -2)) @@ -811,8 +783,7 @@ ;; failed to figure out what this is: (defpart 1441 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -13) (meters 25) 1.0) (sp-flt spt-y (meters -2)) @@ -832,8 +803,7 @@ (defpartgroup group-sunken-tunnel-bubbles-199 :id 336 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1444 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1444 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1444 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1445 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1445 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) @@ -936,8 +906,7 @@ ;; failed to figure out what this is: (defpart 1446 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -25) (meters 36) 1.0) (sp-flt spt-y (meters -2)) @@ -960,8 +929,7 @@ ;; failed to figure out what this is: (defpart 1447 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -25) (meters 36) 1.0) (sp-flt spt-y (meters -2)) @@ -984,8 +952,7 @@ ;; failed to figure out what this is: (defpart 1444 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -25) (meters 36) 1.0) (sp-flt spt-y (meters -2)) @@ -1003,8 +970,7 @@ ;; failed to figure out what this is: (defpart 1445 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -25) (meters 36) 1.0) (sp-flt spt-y (meters -2)) @@ -1024,8 +990,7 @@ (defpartgroup group-sunken-tunnel-bubbles-281 :id 337 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1448 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1448 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1448 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1449 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1449 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) @@ -1128,8 +1093,7 @@ ;; failed to figure out what this is: (defpart 1450 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1152,8 +1116,7 @@ ;; failed to figure out what this is: (defpart 1451 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1176,8 +1139,7 @@ ;; failed to figure out what this is: (defpart 1448 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1195,8 +1157,7 @@ ;; failed to figure out what this is: (defpart 1449 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1216,8 +1177,7 @@ (defpartgroup group-sunken-tunnel-bubbles-202 :id 338 :bounds (static-bspherem 0 4 0 32) - :parts - ((sp-item 1452 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1452 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1452 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1453 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1453 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) @@ -1320,8 +1280,7 @@ ;; failed to figure out what this is: (defpart 1454 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -22) (meters 44) 1.0) (sp-flt spt-y (meters -2)) @@ -1344,8 +1303,7 @@ ;; failed to figure out what this is: (defpart 1455 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -22) (meters 44) 1.0) (sp-flt spt-y (meters -2)) @@ -1368,8 +1326,7 @@ ;; failed to figure out what this is: (defpart 1452 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -22) (meters 44) 1.0) (sp-flt spt-y (meters -2)) @@ -1387,8 +1344,7 @@ ;; failed to figure out what this is: (defpart 1453 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -22) (meters 44) 1.0) (sp-flt spt-y (meters -2)) @@ -1408,8 +1364,7 @@ (defpartgroup group-sunken-window-bubbles-35 :id 339 :bounds (static-bspherem 0 8 0 32) - :parts - ((sp-item 1456 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) + :parts ((sp-item 1456 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 5 :binding 1423) (sp-item 1456 :fade-after (meters 160) :falloff-to (meters 160) :period 600 :length 5 :binding 1423) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) (sp-item 1423 :flags (bit1 start-dead launch-asap) :binding 1424) @@ -1462,8 +1417,7 @@ ;; failed to figure out what this is: (defpart 1457 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1486,8 +1440,7 @@ ;; failed to figure out what this is: (defpart 1456 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) (sp-flt spt-y (meters -2)) @@ -1507,14 +1460,12 @@ (defpartgroup group-sunken-helix-bubbles-398 :id 340 :bounds (static-bspherem 0 4 0 40) - :parts - ((sp-item 1458 :fade-after (meters 100) :falloff-to (meters 100))) + :parts ((sp-item 1458 :fade-after (meters 100) :falloff-to (meters 100))) ) ;; failed to figure out what this is: (defpart 1458 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.75) (sp-rnd-flt spt-x (meters -5) (meters 10) 1.0) (sp-rnd-flt spt-y (meters -10) (meters 15) 1.0) @@ -1537,8 +1488,7 @@ ;; failed to figure out what this is: (defpart 1459 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 900 899 1) (sp-launcher-by-id spt-next-launcher 1460) ) @@ -1546,22 +1496,19 @@ ;; failed to figure out what this is: (defpart 1460 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) ;; failed to figure out what this is: (defpartgroup group-sunken-helix-bubbles-397 :id 341 :bounds (static-bspherem 0 4 0 40) - :parts - ((sp-item 1461 :fade-after (meters 100) :falloff-to (meters 100))) + :parts ((sp-item 1461 :fade-after (meters 100) :falloff-to (meters 100))) ) ;; failed to figure out what this is: (defpart 1461 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.75) (sp-rnd-flt spt-x (meters -5) (meters 10) 1.0) (sp-rnd-flt spt-y (meters -20) (meters 30) 1.0) @@ -1586,8 +1533,7 @@ (defpartgroup group-sunken-heatpipe-355 :id 342 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1463 :fade-after (meters 80) :falloff-to (meters 80) :binding 1462) + :parts ((sp-item 1463 :fade-after (meters 80) :falloff-to (meters 80) :binding 1462) (sp-item 1462 :flags (bit1 start-dead launch-asap)) (sp-item 1462 :flags (bit1 start-dead launch-asap)) (sp-item 1462 :flags (bit1 start-dead launch-asap)) @@ -1619,8 +1565,7 @@ ;; failed to figure out what this is: (defpart 1463 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -1639,8 +1584,7 @@ ;; failed to figure out what this is: (defpart 1462 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 2.6666667)) (sp-flt spt-y (meters 3.3333333)) @@ -1664,8 +1608,7 @@ ;; failed to figure out what this is: (defpart 1464 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1688,8 +1631,7 @@ (defpartgroup group-sunken-heatpipe-361 :id 343 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1466 :fade-after (meters 80) :falloff-to (meters 80) :binding 1465) + :parts ((sp-item 1466 :fade-after (meters 80) :falloff-to (meters 80) :binding 1465) (sp-item 1465 :flags (bit1 start-dead launch-asap)) (sp-item 1465 :flags (bit1 start-dead launch-asap)) (sp-item 1465 :flags (bit1 start-dead launch-asap)) @@ -1721,8 +1663,7 @@ ;; failed to figure out what this is: (defpart 1466 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -1741,8 +1682,7 @@ ;; failed to figure out what this is: (defpart 1465 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.5555553)) (sp-flt spt-y (meters 3.3333333)) @@ -1766,8 +1706,7 @@ ;; failed to figure out what this is: (defpart 1467 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1790,8 +1729,7 @@ (defpartgroup group-sunken-heatpipe-360 :id 344 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1469 :fade-after (meters 80) :falloff-to (meters 80) :binding 1468) + :parts ((sp-item 1469 :fade-after (meters 80) :falloff-to (meters 80) :binding 1468) (sp-item 1468 :flags (bit1 start-dead launch-asap)) (sp-item 1468 :flags (bit1 start-dead launch-asap)) (sp-item 1468 :flags (bit1 start-dead launch-asap)) @@ -1823,8 +1761,7 @@ ;; failed to figure out what this is: (defpart 1469 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -1843,8 +1780,7 @@ ;; failed to figure out what this is: (defpart 1468 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.5555553)) (sp-flt spt-y (meters 4.6666665)) @@ -1868,8 +1804,7 @@ ;; failed to figure out what this is: (defpart 1470 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1892,8 +1827,7 @@ (defpartgroup group-sunken-heatpipe-377 :id 345 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1472 :fade-after (meters 80) :falloff-to (meters 80) :binding 1471) + :parts ((sp-item 1472 :fade-after (meters 80) :falloff-to (meters 80) :binding 1471) (sp-item 1471 :flags (bit1 start-dead launch-asap)) (sp-item 1471 :flags (bit1 start-dead launch-asap)) (sp-item 1471 :flags (bit1 start-dead launch-asap)) @@ -1925,8 +1859,7 @@ ;; failed to figure out what this is: (defpart 1472 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -1945,8 +1878,7 @@ ;; failed to figure out what this is: (defpart 1471 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 4.6666665)) (sp-flt spt-y (meters 4.6666665)) @@ -1970,8 +1902,7 @@ ;; failed to figure out what this is: (defpart 1473 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -1994,8 +1925,7 @@ (defpartgroup group-sunken-heatpipe-376 :id 346 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1475 :fade-after (meters 80) :falloff-to (meters 80) :binding 1474) + :parts ((sp-item 1475 :fade-after (meters 80) :falloff-to (meters 80) :binding 1474) (sp-item 1474 :flags (bit1 start-dead launch-asap)) (sp-item 1474 :flags (bit1 start-dead launch-asap)) (sp-item 1474 :flags (bit1 start-dead launch-asap)) @@ -2027,8 +1957,7 @@ ;; failed to figure out what this is: (defpart 1475 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -2047,8 +1976,7 @@ ;; failed to figure out what this is: (defpart 1474 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 4.6666665)) (sp-flt spt-y (meters 3.3333333)) @@ -2072,8 +2000,7 @@ ;; failed to figure out what this is: (defpart 1476 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -2096,8 +2023,7 @@ (defpartgroup group-sunken-heatpipe-375 :id 347 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1478 :fade-after (meters 80) :falloff-to (meters 80) :binding 1477) + :parts ((sp-item 1478 :fade-after (meters 80) :falloff-to (meters 80) :binding 1477) (sp-item 1477 :flags (bit1 start-dead launch-asap)) (sp-item 1477 :flags (bit1 start-dead launch-asap)) (sp-item 1477 :flags (bit1 start-dead launch-asap)) @@ -2129,8 +2055,7 @@ ;; failed to figure out what this is: (defpart 1478 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -2149,8 +2074,7 @@ ;; failed to figure out what this is: (defpart 1477 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.3333335)) (sp-flt spt-y (meters 4.4444447)) @@ -2174,8 +2098,7 @@ ;; failed to figure out what this is: (defpart 1479 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -2198,8 +2121,7 @@ (defpartgroup group-sunken-heatpipe-374 :id 348 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1481 :fade-after (meters 80) :falloff-to (meters 80) :binding 1480) + :parts ((sp-item 1481 :fade-after (meters 80) :falloff-to (meters 80) :binding 1480) (sp-item 1480 :flags (bit1 start-dead launch-asap)) (sp-item 1480 :flags (bit1 start-dead launch-asap)) (sp-item 1480 :flags (bit1 start-dead launch-asap)) @@ -2231,8 +2153,7 @@ ;; failed to figure out what this is: (defpart 1481 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -2251,8 +2172,7 @@ ;; failed to figure out what this is: (defpart 1480 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 5.3333335)) (sp-flt spt-y (meters 3.5555556)) @@ -2276,8 +2196,7 @@ ;; failed to figure out what this is: (defpart 1482 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -2300,8 +2219,7 @@ (defpartgroup group-sunken-heatpipe-363 :id 349 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1484 :fade-after (meters 80) :falloff-to (meters 80) :binding 1483) + :parts ((sp-item 1484 :fade-after (meters 80) :falloff-to (meters 80) :binding 1483) (sp-item 1483 :flags (bit1 start-dead launch-asap)) (sp-item 1483 :flags (bit1 start-dead launch-asap)) (sp-item 1483 :flags (bit1 start-dead launch-asap)) @@ -2333,8 +2251,7 @@ ;; failed to figure out what this is: (defpart 1484 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.3)) @@ -2353,8 +2270,7 @@ ;; failed to figure out what this is: (defpart 1483 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.4222223)) (sp-flt spt-y (meters 4.4444447)) @@ -2378,8 +2294,7 @@ ;; failed to figure out what this is: (defpart 1485 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -2402,8 +2317,7 @@ (defpartgroup group-sunken-heatpipe-362 :id 350 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1487 :fade-after (meters 80) :falloff-to (meters 80) :binding 1486) + :parts ((sp-item 1487 :fade-after (meters 80) :falloff-to (meters 80) :binding 1486) (sp-item 1486 :flags (bit1 start-dead launch-asap)) (sp-item 1486 :flags (bit1 start-dead launch-asap)) (sp-item 1486 :flags (bit1 start-dead launch-asap)) @@ -2435,8 +2349,7 @@ ;; failed to figure out what this is: (defpart 1487 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -2455,8 +2368,7 @@ ;; failed to figure out what this is: (defpart 1486 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 1.4222223)) (sp-flt spt-y (meters 3.5555556)) @@ -2480,8 +2392,7 @@ ;; failed to figure out what this is: (defpart 1488 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) @@ -2504,8 +2415,7 @@ (defpartgroup group-sunken-heatpipe-364 :id 351 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1490 :fade-after (meters 80) :falloff-to (meters 80) :binding 1489) + :parts ((sp-item 1490 :fade-after (meters 80) :falloff-to (meters 80) :binding 1489) (sp-item 1489 :flags (bit1 start-dead launch-asap)) (sp-item 1489 :flags (bit1 start-dead launch-asap)) (sp-item 1489 :flags (bit1 start-dead launch-asap)) @@ -2537,8 +2447,7 @@ ;; failed to figure out what this is: (defpart 1490 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.3)) @@ -2557,8 +2466,7 @@ ;; failed to figure out what this is: (defpart 1489 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -0.9777778)) (sp-flt spt-y (meters 3.5555556)) @@ -2582,8 +2490,7 @@ ;; failed to figure out what this is: (defpart 1491 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.6)) (sp-int spt-rot-x 6) @@ -2606,8 +2513,7 @@ (defpartgroup group-sunken-heatpipe-365 :id 352 :bounds (static-bspherem 0 1 0 3.5) - :parts - ((sp-item 1493 :fade-after (meters 80) :falloff-to (meters 80) :binding 1492) + :parts ((sp-item 1493 :fade-after (meters 80) :falloff-to (meters 80) :binding 1492) (sp-item 1492 :flags (bit1 start-dead launch-asap)) (sp-item 1492 :flags (bit1 start-dead launch-asap)) (sp-item 1492 :flags (bit1 start-dead launch-asap)) @@ -2639,8 +2545,7 @@ ;; failed to figure out what this is: (defpart 1493 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.5)) @@ -2659,8 +2564,7 @@ ;; failed to figure out what this is: (defpart 1492 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters -1.1111112)) (sp-flt spt-y (meters 4.4444447)) @@ -2684,8 +2588,7 @@ ;; failed to figure out what this is: (defpart 1494 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-flt spt-x (meters -2.2)) (sp-flt spt-y (meters 0.8)) (sp-int spt-rot-x 6) diff --git a/test/decompiler/reference/levels/sunken/sunken-pipegame_REF.gc b/test/decompiler/reference/levels/sunken/sunken-pipegame_REF.gc index 564b8e5734..95f1912245 100644 --- a/test/decompiler/reference/levels/sunken/sunken-pipegame_REF.gc +++ b/test/decompiler/reference/levels/sunken/sunken-pipegame_REF.gc @@ -102,14 +102,12 @@ :id 448 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1741) (sp-item 1742) (sp-item 1743) (sp-item 1744 :flags (is-3d))) + :parts ((sp-item 1741) (sp-item 1742) (sp-item 1743) (sp-item 1744 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 1741 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 10.0) (sp-flt spt-y (meters 6)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -133,14 +131,12 @@ ;; failed to figure out what this is: (defpart 1745 - :init-specs - ((sp-flt spt-fade-a 0.0)) + :init-specs ((sp-flt spt-fade-a 0.0)) ) ;; failed to figure out what this is: (defpart 1742 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-y (meters 0) (meters 8) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -160,8 +156,7 @@ ;; failed to figure out what this is: (defpart 1743 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 4)) (sp-rnd-flt spt-scale-x (meters 7) (meters 1) 1.0) @@ -178,8 +173,7 @@ ;; failed to figure out what this is: (defpart 1744 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.3)) (sp-rnd-flt spt-scale-x (meters 5.5) (meters 2) 1.0) @@ -199,14 +193,12 @@ :id 449 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1746) (sp-item 1742) (sp-item 1747) (sp-item 1748 :flags (is-3d))) + :parts ((sp-item 1746) (sp-item 1742) (sp-item 1747) (sp-item 1748 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 1746 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 10.0) (sp-flt spt-y (meters 6)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -230,8 +222,7 @@ ;; failed to figure out what this is: (defpart 1747 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 4)) (sp-rnd-flt spt-scale-x (meters 7) (meters 1) 1.0) @@ -248,8 +239,7 @@ ;; failed to figure out what this is: (defpart 1748 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.3)) (sp-rnd-flt spt-scale-x (meters 5.5) (meters 2) 1.0) @@ -269,14 +259,12 @@ :id 450 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1749) (sp-item 1742) (sp-item 1750) (sp-item 1751 :flags (is-3d))) + :parts ((sp-item 1749) (sp-item 1742) (sp-item 1750) (sp-item 1751 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 1749 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 10.0) (sp-flt spt-y (meters 6)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -300,8 +288,7 @@ ;; failed to figure out what this is: (defpart 1750 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 4)) (sp-rnd-flt spt-scale-x (meters 7) (meters 1) 1.0) @@ -318,8 +305,7 @@ ;; failed to figure out what this is: (defpart 1751 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.3)) (sp-rnd-flt spt-scale-x (meters 5.5) (meters 2) 1.0) @@ -339,14 +325,12 @@ :id 451 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1752) (sp-item 1753) (sp-item 1754) (sp-item 1755 :flags (is-3d))) + :parts ((sp-item 1752) (sp-item 1753) (sp-item 1754) (sp-item 1755 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 1752 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -370,14 +354,12 @@ ;; failed to figure out what this is: (defpart 1756 - :init-specs - ((sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-a -1.4222223)) ) ;; failed to figure out what this is: (defpart 1753 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-y (meters 0) (meters -8) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -397,8 +379,7 @@ ;; failed to figure out what this is: (defpart 1754 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -3.5)) (sp-rnd-flt spt-scale-x (meters 3) (meters 0.5) 1.0) @@ -416,8 +397,7 @@ ;; failed to figure out what this is: (defpart 1755 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.3)) (sp-rnd-flt spt-scale-x (meters 5.5) (meters 2) 1.0) @@ -437,14 +417,12 @@ :id 452 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1757) (sp-item 1753) (sp-item 1758) (sp-item 1759 :flags (is-3d))) + :parts ((sp-item 1757) (sp-item 1753) (sp-item 1758) (sp-item 1759 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 1757 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -468,8 +446,7 @@ ;; failed to figure out what this is: (defpart 1758 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -3.5)) (sp-rnd-flt spt-scale-x (meters 3) (meters 0.5) 1.0) @@ -487,8 +464,7 @@ ;; failed to figure out what this is: (defpart 1759 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.3)) (sp-rnd-flt spt-scale-x (meters 5.5) (meters 2) 1.0) @@ -508,14 +484,12 @@ :id 453 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1760) (sp-item 1753) (sp-item 1761) (sp-item 1762 :flags (is-3d))) + :parts ((sp-item 1760) (sp-item 1753) (sp-item 1761) (sp-item 1762 :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 1760 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) @@ -539,8 +513,7 @@ ;; failed to figure out what this is: (defpart 1761 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -3.5)) (sp-rnd-flt spt-scale-x (meters 3) (meters 0.5) 1.0) @@ -558,8 +531,7 @@ ;; failed to figure out what this is: (defpart 1762 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.3)) (sp-rnd-flt spt-scale-x (meters 5.5) (meters 2) 1.0) @@ -576,7 +548,7 @@ ;; definition for function sunken-pipegame-button-init-by-other (defbehavior sunken-pipegame-button-init-by-other sunken-pipegame-button ((arg0 vector) (arg1 quaternion) (arg2 entity-actor) (arg3 symbol)) - (basebutton-init-by-other (the-as basebutton #f) arg0 arg1 arg2 arg3 0.0) + (basebutton-init-by-other (the-as entity-actor #f) arg0 arg1 arg2 arg3 0.0) (none) ) @@ -599,8 +571,7 @@ ;; failed to figure out what this is: (defstate sunken-pipegame-start-up (sunken-pipegame) - :code - (behavior () + :code (behavior () (suspend) (send-event (handle->process (-> self prize 0 actor-handle)) 'anim #f) (go sunken-pipegame-idle) @@ -610,8 +581,7 @@ ;; failed to figure out what this is: (defstate sunken-pipegame-idle (sunken-pipegame) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (when (= (-> arg0 type) sunken-pipegame-button) @@ -621,9 +591,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) @@ -632,8 +601,7 @@ ;; failed to figure out what this is: (defstate sunken-pipegame-begin-play (sunken-pipegame) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notify) (case (-> arg0 type) @@ -644,8 +612,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (dummy-21 self #f) (set! (-> self abort-audio-if-beaten?) #f) (dotimes (gp-0 3) @@ -657,8 +624,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (v1-112 symbol)) (let ((gp-0 (-> *display* base-frame-counter))) (if (not (handle->process (-> self prize (-> self challenge) actor-handle))) @@ -669,66 +635,15 @@ (cond ((zero? v1-10) (ambient-hint-spawn "gamcam27" (the-as vector #f) *entity-pool* 'camera) - (let ((s5-0 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-0 - (let ((t9-4 (method-of-type pov-camera activate))) - (t9-4 (the-as pov-camera s5-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "pipegame-left" - 0 - #f - '() - ) - (-> s5-0 ppointer) - ) - ) + (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "pipegame-left" 0 #f '() :to self) ) ((= v1-10 1) (ambient-hint-spawn "gamcam25" (the-as vector #f) *entity-pool* 'camera) - (let ((s5-1 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-1 - (let ((t9-8 (method-of-type pov-camera activate))) - (t9-8 (the-as pov-camera s5-1) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "pipegame-middle" - 0 - #f - '() - ) - (-> s5-1 ppointer) - ) - ) + (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "pipegame-middle" 0 #f '() :to self) ) ((= v1-10 2) (ambient-hint-spawn "gamcam26" (the-as vector #f) *entity-pool* 'camera) - (let ((s5-2 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-2 - (let ((t9-12 (method-of-type pov-camera activate))) - (t9-12 (the-as pov-camera s5-2) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-2 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "pipegame-right" - 0 - #f - '() - ) - (-> s5-2 ppointer) - ) - ) + (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "pipegame-right" 0 #f '() :to self) ) ) ) @@ -832,7 +747,7 @@ ) (until v1-112 (suspend) - (set! v1-112 (or (not *target*) (zero? (logand (-> *target* state-flags) 256)))) + (set! v1-112 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (sleep (-> self ticker) (-> self prize (-> self challenge) puzzle-delay)) @@ -967,8 +882,7 @@ ;; failed to figure out what this is: (defstate sunken-pipegame-beat-challenge (sunken-pipegame) - :code - (behavior () + :code (behavior () (logior! (-> self challenges-mask) (ash 1 (-> self challenge))) (if (-> self abort-audio-if-beaten?) (kill-current-level-hint '(camera) '() 'exit) @@ -980,14 +894,13 @@ ;; failed to figure out what this is: (defstate sunken-pipegame-end-play (sunken-pipegame) - :code - (behavior () + :code (behavior () (local-vars (v1-3 symbol)) (dummy-21 self #t) (set! (-> self abort-audio-if-beaten?) #f) (until v1-3 (suspend) - (set! v1-3 (or (not *target*) (zero? (logand (-> *target* state-flags) 256)))) + (set! v1-3 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) ) (if (not (handle->process (-> self prize (-> self challenge) actor-handle))) (logior! (-> self challenges-mask) (ash 1 (-> self challenge))) @@ -1200,17 +1113,7 @@ ) ) (vector+! s4-0 s4-0 (-> obj root trans)) - (let* ((s0-3 (get-process *default-dead-pool* sunken-pipegame-button #x4000)) - (v1-102 - (when s0-3 - (let ((t9-23 (method-of-type sunken-pipegame-button activate))) - (t9-23 (the-as sunken-pipegame-button s0-3) obj 'sunken-pipegame-button (the-as pointer #x70004000)) - ) - (run-now-in-process s0-3 sunken-pipegame-button-init-by-other s4-0 s3-0 arg0 s1-1) - (-> s0-3 ppointer) - ) - ) - ) + (let ((v1-102 (process-spawn sunken-pipegame-button s4-0 s3-0 arg0 s1-1 :to obj))) (set! (-> obj button s2-0) (the-as (pointer sunken-pipegame-button) v1-102)) (set! (-> (the-as (pointer sunken-pipegame-button) v1-102) 0 button-id) s2-0) ) diff --git a/test/decompiler/reference/levels/sunken/sunken-water_REF.gc b/test/decompiler/reference/levels/sunken/sunken-water_REF.gc index f6aa593dfa..bdb69652fe 100644 --- a/test/decompiler/reference/levels/sunken/sunken-water_REF.gc +++ b/test/decompiler/reference/levels/sunken/sunken-water_REF.gc @@ -44,8 +44,7 @@ :count 3 :converted #f :normal-scale 1.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 40.0 :xdiv -1 :zdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75) @@ -59,14 +58,12 @@ :id 446 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1736 :fade-after (meters 50))) + :parts ((sp-item 1736 :fade-after (meters 50))) ) ;; failed to figure out what this is: (defpart 1736 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 1) (meters 4) 1.0) @@ -87,8 +84,7 @@ ;; failed to figure out what this is: (defpart 2022 - :init-specs - ((sp-flt spt-r 255.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) (sp-flt spt-b 0.0) (sp-flt spt-fade-a -1.28)) + :init-specs ((sp-flt spt-r 255.0) (sp-rnd-flt spt-g 128.0 128.0 1.0) (sp-flt spt-b 0.0) (sp-flt spt-fade-a -1.28)) ) ;; definition for method 30 of type sunken-water @@ -116,12 +112,11 @@ ;; failed to figure out what this is: (defstate water-vol-idle (sunken-water) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('notify) (if (= (-> arg3 param 0) 'attack) - (sound-play-by-name (static-sound-name "get-shocked") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-shocked") ) ) (else @@ -129,8 +124,7 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (let ((t9-0 (-> (method-of-type water-anim water-vol-idle) trans))) (if t9-0 (t9-0) @@ -141,7 +135,7 @@ (cond ((< (get-current-phase (-> self sync)) (-> self deadly-time)) (when (!= (-> self deadly-fade) 1.0) - (set! (-> self deadly-fade) (seek (-> self deadly-fade) 1.0 (* 8.0 (-> *display* seconds-per-frame)))) + (seek! (-> self deadly-fade) 1.0 (* 8.0 (-> *display* seconds-per-frame))) (let ((f30-0 (-> self deadly-fade))) (vector-lerp! (-> self draw color-mult) (-> self safe-color-mult) (-> self deadly-color-mult) f30-0) (vector-lerp! @@ -152,21 +146,21 @@ ) (set! (-> self draw color-mult w) 0.5) (if (= f30-0 1.0) - (set! (-> self flags) (logior #x80000 (-> self flags))) + (set! (-> self flags) (logior (water-flags wt19) (-> self flags))) ) ) ) (draw-ripple self) (when (not (-> self playing-deadly-sound?)) (set! (-> self playing-deadly-sound?) #t) - (sound-play-by-name (static-sound-name "water-on") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-on") ) (update! (-> self sound)) ) (else - (set! (-> self flags) (logand -524289 (-> self flags))) + (logclear! (-> self flags) (water-flags wt19)) (when (!= (-> self deadly-fade) 0.0) - (set! (-> self deadly-fade) (seek (-> self deadly-fade) 0.0 (* 8.0 (-> *display* seconds-per-frame)))) + (seek! (-> self deadly-fade) 0.0 (* 8.0 (-> *display* seconds-per-frame))) (let ((f30-1 (-> self deadly-fade))) (vector-lerp! (-> self draw color-mult) (-> self safe-color-mult) (-> self deadly-color-mult) f30-1) (vector-lerp! @@ -177,14 +171,14 @@ ) (set! (-> self draw color-mult w) 0.5) (if (= f30-1 0.0) - (set! (-> self flags) (logand -524289 (-> self flags))) + (logclear! (-> self flags) (water-flags wt19)) ) ) ) (when (-> self playing-deadly-sound?) (set! (-> self playing-deadly-sound?) #f) (stop! (-> self sound)) - (sound-play-by-name (static-sound-name "water-off") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-off") ) ) ) @@ -197,7 +191,7 @@ ) ) (else - (when (logtest? #x80000 (-> self flags)) + (when (logtest? (water-flags wt19) (-> self flags)) (draw-ripple self) (update! (-> self sound)) (set! (-> self playing-deadly-sound?) #t) @@ -206,14 +200,12 @@ ) (none) ) - :post - (the-as (function none :behavior sunken-water) ja-post) + :post (the-as (function none :behavior sunken-water) ja-post) ) ;; definition for method 25 of type sunken-water -;; INFO: Return type mismatch uint vs object. +;; INFO: Return type mismatch uint vs none. (defmethod TODO-RENAME-25 sunken-water ((obj sunken-water)) - (local-vars (v0-3 uint)) (let ((t9-0 (method-of-type water-anim TODO-RENAME-25))) (t9-0 obj) ) @@ -229,7 +221,7 @@ (s5-0 0.5 ) - ((logtest? #x80000 (-> obj flags)) + ((logtest? (water-flags wt19) (-> obj flags)) 1.0 ) (else @@ -241,28 +233,21 @@ (when (and s5-0 (or (= f0-16 0.0) (= f0-16 1.0))) (set! s5-0 #f) (if (= f0-16 0.0) - (set! (-> obj flags) (logior #x80000 (-> obj flags))) - (set! (-> obj flags) (logand -524289 (-> obj flags))) + (set! (-> obj flags) (logior (water-flags wt19) (-> obj flags))) + (logclear! (-> obj flags) (water-flags wt19)) ) ) (set! (-> obj use-sync?) s5-0) (set! (-> obj deadly-time) f0-16) ) - (the-as object (when s5-0 - (cond - ((< (get-current-phase (-> obj sync)) (-> obj deadly-time)) - (set! v0-3 (logior (the-as uint #x80000) (-> obj flags))) - (set! (-> obj flags) v0-3) - ) - (else - (set! v0-3 (logand (the-as uint -524289) (-> obj flags))) - (set! (-> obj flags) v0-3) - ) - ) - v0-3 - ) - ) + (when s5-0 + (if (< (get-current-phase (-> obj sync)) (-> obj deadly-time)) + (set! (-> obj flags) (the-as water-flags (logior (water-flags wt19) (-> obj flags)))) + (set! (-> obj flags) (the-as water-flags (logclear (-> obj flags) (water-flags wt19)))) + ) + ) ) + (none) ) ;; definition for method 22 of type sunken-water @@ -274,7 +259,7 @@ ) (set! (-> obj play-ambient-sound?) #f) (cond - ((logtest? #x80000 (-> obj flags)) + ((logtest? (water-flags wt19) (-> obj flags)) (set! (-> obj draw color-mult quad) (-> obj deadly-color-mult quad)) (set! (-> obj draw color-emissive quad) (-> obj deadly-color-emissive quad)) (set! (-> obj deadly-fade) 1.0) diff --git a/test/decompiler/reference/levels/sunken/target-tube_REF.gc b/test/decompiler/reference/levels/sunken/target-tube_REF.gc index 5eac8c5e8c..1b46a886f8 100644 --- a/test/decompiler/reference/levels/sunken/target-tube_REF.gc +++ b/test/decompiler/reference/levels/sunken/target-tube_REF.gc @@ -54,7 +54,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags #x800 + :flags (surface-flags jump) ) ) @@ -105,7 +105,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :flags #x28 + :flags (surface-flags no-turn-around always-rotate-toward-transv) ) ) ) @@ -180,26 +180,23 @@ ;; definition for function tube-sounds (defbehavior tube-sounds target () - (set! (-> self tube tube-sound-vol) (seek - (-> self tube tube-sound-vol) - (if (logtest? (-> self control status) 1) - 100.0 - 0.0 - ) - (* 200.0 (-> *display* seconds-per-frame)) - ) + (seek! + (-> self tube tube-sound-vol) + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) + 100.0 + 0.0 ) + (* 200.0 (-> *display* seconds-per-frame)) + ) (let ((f30-0 (-> self tube tube-sound-vol)) (f0-5 (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 122880.0)) ) - (sound-play-by-name - (static-sound-name "slide-loop") - (-> self tube tube-sound-id) - (the int (* 10.24 f30-0)) - (the int (* 1524.0 f0-5)) - 0 - 1 - (the-as symbol (-> self control trans)) + (sound-play + "slide-loop" + :id (-> self tube tube-sound-id) + :vol f30-0 + :pitch f0-5 + :position (the-as symbol (-> self control trans)) ) ) ) @@ -213,7 +210,7 @@ (vector-flatten! s4-1 s4-1 (-> self control local-normal)) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s4-1 (meters 0.00024414062) @@ -225,7 +222,7 @@ (vector-normalize! s4-1 (-> self control unknown-surface01 target-speed)) ) (vector-v++! (-> self control unknown-vector00) s4-1) - (when (logtest? (-> self control status) 8) + (when (logtest? (-> self control status) (cshape-moving-flags twall)) (let ((s3-0 (-> self tube old-transv))) (-> self control unknown-vector00 y) (vector-reflect! s4-1 s3-0 (-> self control unknown-vector71)) @@ -281,7 +278,7 @@ (vector-flatten! s3-1 s3-1 (-> self control local-normal)) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s3-1 (meters 2.0) @@ -294,7 +291,7 @@ (vector-flatten! s4-2 s4-2 (-> self control local-normal)) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s4-2 (meters 2.0) @@ -331,7 +328,7 @@ (vector-float*! gp-1 gp-1 0.5) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) gp-1 (meters 0.00024414062) @@ -340,7 +337,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "ltransv" @@ -351,7 +348,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "nose" @@ -373,7 +370,7 @@ (set! (-> self tube old-transv quad) (-> self control transv quad)) (flag-setup) (build-conversions (-> self control transv)) - (if (logtest? (-> self state-flags) 32) + (if (logtest? (-> self state-flags) (state-flags timed-invulnerable)) (set! (-> self control unknown-surface01 turnv) (* 3.0 (-> self control unknown-surface01 turnv))) ) (forward-up-nopitch->quaternion @@ -459,8 +456,7 @@ ;; failed to figure out what this is: (defstate target-tube-start (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (cond ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) 'tube @@ -495,8 +491,7 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (when (not (or (= (-> self next-state name) 'target-tube) (= (-> self next-state name) 'target-tube-jump) (= (-> self next-state name) 'target-tube-hit) @@ -522,8 +517,7 @@ ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (send-event *camera* 'set-slave-option #x6000) (target-exit) (set! *display-profile* #f) @@ -547,33 +541,35 @@ (set! (-> self control unknown-float01) 0.0) (logior! (-> self control root-prim prim-core action) (collide-action ca-13)) (remove-exit) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) self) - (set! (-> a1-4 num-params) 4) - (set! (-> a1-4 message) 'update) - (set! (-> a1-4 param 0) (the-as uint (-> self tube centertube))) - (set! (-> a1-4 param 1) (the-as uint (-> self tube downtube))) - (set! (-> a1-4 param 2) (the-as uint (-> self tube sidetube))) - (set! (-> a1-4 param 3) (the-as uint (-> self tube foretube))) - (cond - ((< (the-as float (send-event-function (handle->process (-> self tube tube)) a1-4)) 0.5) - (vector-normalize-copy! (-> self control transv) (-> self tube downtube) 40960.0) - (forward-up-nopitch->quaternion - (-> self control dir-targ) - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) - (-> self control dynam gravity-normal) - ) - (go target-tube-jump (-> *TARGET-bank* tube-jump-height-min) (-> *TARGET-bank* tube-jump-height-max)) - ) - (else - (go target-tube) + (cond + ((< (the-as + float + (send-event + (handle->process (-> self tube tube)) + 'update + (-> self tube centertube) + (-> self tube downtube) + (-> self tube sidetube) + (-> self tube foretube) + ) + ) + 0.5 ) + (vector-normalize-copy! (-> self control transv) (-> self tube downtube) 40960.0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + (-> self control dynam gravity-normal) + ) + (go target-tube-jump (-> *TARGET-bank* tube-jump-height-min) (-> *TARGET-bank* tube-jump-height-max)) + ) + (else + (go target-tube) ) ) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; definition for function target-tube-turn-anim @@ -624,32 +620,21 @@ ) (set-time-ratios *display* (the float gp-0)) ) - (let ((gp-1 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-1 - (the-as art-joint-anim (-> self draw art-group data 105)) - num-func-identity - ) - (set! (-> gp-1 frame-num) (ja-aframe (-> self tube turn-anim-frame) 0)) - ) + (ja :group! (-> self draw art-group data 105) :num! (identity (ja-aframe (-> self tube turn-anim-frame) 0))) 0 (none) ) ;; failed to figure out what this is: (defstate target-tube (target) - :event - (-> target-tube-start event) - :enter - (behavior () + :event (-> target-tube-start event) + :enter (behavior () (set! (-> self control unknown-surface00) *tube-mods*) (set! (-> self control surf) *tube-surface*) (none) ) - :exit - (-> target-tube-start exit) - :trans - (behavior () + :exit (-> target-tube-start exit) + :trans (behavior () (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) ) @@ -663,45 +648,29 @@ ) (none) ) - :code - (behavior () - (case (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + :code (behavior () + (case (ja-group) (((-> self draw art-group data 41) (-> self draw art-group data 38)) - (ja-channel-push! 1 12) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 106))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 106)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 106)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! (-> self draw art-group data 106) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self tube turn-anim-frame) 0.0) ) (else - (ja-channel-push! 1 12) + (ja-channel-push! 1 (seconds 0.04)) ) ) - (while #t + (loop (set! (-> self tube turn-anim-targ) (* 20.0 (-> self tube mod-x))) (target-tube-turn-anim) (suspend) ) (none) ) - :post - (behavior () + :post (behavior () (target-tube-post) (none) ) @@ -709,44 +678,30 @@ ;; failed to figure out what this is: (defstate target-tube-jump (target) - :event - (-> target-tube-start event) - :enter - (behavior ((arg0 float) (arg1 float)) + :event (-> target-tube-start event) + :enter (behavior ((arg0 float) (arg1 float)) (set! (-> self state-time) (-> *display* base-frame-counter)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) - (set! (-> self control status) (logand -8 (-> self control status))) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *tube-jump-mods*) (none) ) - :exit - (-> target-tube-start exit) - :trans - (behavior () - (if (logtest? (-> self control status) 1) + :exit (-> target-tube-start exit) + :trans (behavior () + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-tube) ) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) - (set! (-> self control unknown-float122) - (seek - (-> self control unknown-float122) - (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) - ) - ) + (seek! + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) (none) ) - :code - (behavior ((arg0 float) (arg1 float)) - (ja-channel-push! 1 15) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 41)) - num-func-identity - ) - (set! (-> gp-0 frame-num) (ja-aframe 16.0 0)) - ) + :code (behavior ((arg0 float) (arg1 float)) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 41) :num! (identity (ja-aframe 16.0 0))) (let ((f30-0 35.0) (f28-0 1.0) ) @@ -769,36 +724,20 @@ (suspend) ) ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-9 param 0) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-loop!) - ) - (while #t + (ja-no-eval :group! (-> self draw art-group data 38) :num! (loop!) :frame-num 0.0) + (loop (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 38))) - (set! (-> a0-10 param 0) 1.0) - (joint-control-channel-group-eval! - a0-10 - (the-as art-joint-anim (-> self draw art-group data 38)) - num-func-loop! - ) - ) + (ja :group! (-> self draw art-group data 38) :num! (loop!)) ) (none) ) - :post - (-> target-tube post) + :post (-> target-tube post) ) ;; failed to figure out what this is: (defstate target-tube-hit (target) - :event - (-> target-tube-start event) - :enter - (behavior ((arg0 handle) (arg1 attack-info)) + :event (-> target-tube-start event) + :enter (behavior ((arg0 symbol) (arg1 attack-info)) (send-event (handle->process (-> self tube tube)) 'update @@ -809,22 +748,20 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (if (!= (-> self next-state name) 'target-tube-death) - (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags being-attacked dying)) ) - (set! (-> self state-flags) (logand -901 (-> self state-flags))) + (logclear! (-> self state-flags) (state-flags sf02 do-not-notice grabbed first-person-mode)) ((-> target-tube-start exit)) (none) ) - :code - (behavior ((arg0 handle) (arg1 attack-info)) + :code (behavior ((arg0 symbol) (arg1 attack-info)) (let ((gp-0 (-> self attack-info))) (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self state-flags) 8) + (logior! (-> self state-flags) (state-flags being-attacked)) (set! (-> self game hit-time) (-> *display* base-frame-counter)) - (when (zero? (logand (-> arg1 mask) 2)) + (when (zero? (logand (-> arg1 mask) (attack-mask vector))) (vector-! (-> arg1 vector) (vector+float*! (new 'stack-no-clear 'vector) (-> self tube foretube) (-> self tube downtube) 20480.0) @@ -848,11 +785,14 @@ ) ) ) - (logior! (-> arg1 mask) 2) + (logior! (-> arg1 mask) (attack-mask vector)) ) - (when (and (logtest? (-> arg1 mask) 32) (= (-> arg1 mode) 'darkeco) (zero? (logand (-> arg1 mask) 128))) + (when (and (logtest? (-> arg1 mask) (attack-mask mode)) + (= (-> arg1 mode) 'darkeco) + (zero? (logand (-> arg1 mask) (attack-mask shove-up))) + ) (set! (-> arg1 shove-up) 12288.0) - (logior! (-> arg1 mask) 128) + (logior! (-> arg1 mask) (attack-mask shove-up)) ) (let ((v1-30 gp-0)) (set! (-> v1-30 attacker) (the-as handle #f)) @@ -908,54 +848,40 @@ (go target-tube) (none) ) - :post - (the-as (function none :behavior target) target-post) + :post target-post ) ;; failed to figure out what this is: (defstate target-tube-death (target) - :event - (-> target-death event) - :exit - (behavior () - (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + :event (-> target-death event) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags being-attacked dying)) (target-exit) - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (copy-settings-from-target! *setting-control*) + (remove-setting! 'process-mask) + (apply-settings *setting-control*) ((-> target-tube-start exit)) (none) ) - :code - (behavior ((arg0 symbol)) + :code (behavior ((arg0 symbol)) (local-vars (v1-40 symbol)) (set! (-> self neck flex-blend) 0.0) (target-timed-invulnerable-off self) - (push-setting! *setting-control* self 'process-mask 'set 0.0 #x14a0000) - (copy-settings-from-target! *setting-control*) + (add-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) + (apply-settings *setting-control*) (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self control unknown-surface00) *neutral-mods*) - (ja-channel-push! 1 30) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 76))) - (set! (-> gp-1 param 0) (ja-aframe 134.0 0)) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) 0.0) - (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 76)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 76) :num! (seek! (ja-aframe 134.0 0)) :frame-num 0.0) (until (ja-done? 0) - (TODO-RENAME-9 (-> self align)) + (compute-alignment! (-> self align)) (let ((gp-2 (new 'stack-no-clear 'vector))) - (when (zero? (logand (-> self align flags) 1)) + (when (zero? (logand (-> self align flags) (align-flags disabled))) (vector-matrix*! gp-2 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (vector-float*! (-> self control transv) gp-2 (-> *display* frames-per-second)) ) ) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 134.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 134.0 0))) ) (set! (-> self control transv quad) (the-as uint128 0)) (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) @@ -967,8 +893,7 @@ (go target-tube) (none) ) - :post - target-no-stick-post + :post target-no-stick-post ) ;; definition of type slide-control @@ -1055,16 +980,14 @@ ;; failed to figure out what this is: (defstate slide-control-watch (slide-control) :virtual #t - :enter - (behavior () + :enter (behavior () (eval-path-curve-div! (-> self path) (-> self trans) 0.2 'interp) (eval-path-curve-div! (-> self path) (-> self root trans) 0.2 'interp) (TODO-RENAME-12 (-> self path) (-> self rot) 0.2) (set! (-> self pos) 0.2) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (and *target* (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (and (< 0.0 (vector-dot (vector-! (new 'stack-no-clear 'vector) (-> *target* control trans) (-> self trans)) @@ -1078,15 +1001,13 @@ ) (none) ) - :code - (the-as (function none :behavior slide-control) anim-loop) + :code (the-as (function none :behavior slide-control) anim-loop) ) ;; failed to figure out what this is: (defstate slide-control-ride (slide-control) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('end-mode) (go-virtual slide-control-watch) @@ -1113,21 +1034,18 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self pos) 0.0) (set! (-> self target) (process->handle *target*)) (process-entity-status! self (entity-perm-status bit-3) #t) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self target) (the-as handle #f)) (process-entity-status! self (entity-perm-status bit-3) #f) (none) ) - :trans - (behavior () + :trans (behavior () (let ((gp-0 (handle->process (-> self target)))) (cond ((if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) @@ -1141,8 +1059,7 @@ ) (none) ) - :code - (the-as (function none :behavior slide-control) anim-loop) + :code (the-as (function none :behavior slide-control) anim-loop) ) ;; definition for method 11 of type slide-control diff --git a/test/decompiler/reference/levels/sunken/wall-plat_REF.gc b/test/decompiler/reference/levels/sunken/wall-plat_REF.gc index c2826ddd49..d395b98519 100644 --- a/test/decompiler/reference/levels/sunken/wall-plat_REF.gc +++ b/test/decompiler/reference/levels/sunken/wall-plat_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/wall-plat-ag.gc") + ;; definition of type wall-plat (deftype wall-plat (process-drawable) ((root-override collide-shape-moving :offset 112) @@ -37,31 +39,26 @@ ) ;; failed to figure out what this is: -(defskelgroup *wall-plat-sg* wall-plat - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 1 -2 0 6.5) - :longest-edge (meters 0) - ) +(defskelgroup *wall-plat-sg* wall-plat wall-plat-lod0-jg -1 + ((wall-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 1 -2 0 6.5) + ) ;; failed to figure out what this is: (defstate wall-plat-retracted (wall-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (go wall-plat-extending) ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self extended-amount) 0.0) (move-to-point! (-> self root-override) (-> self in-trans)) (transform-post) (clear-collide-with-as (-> self root-override)) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -71,29 +68,25 @@ ;; failed to figure out what this is: (defstate wall-plat-extending (wall-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) #f ) ) ) ) - :enter - (behavior () - (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) + :enter (behavior () + (sound-play "wall-plat") (none) ) - :trans - (the-as (function none :behavior wall-plat) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior wall-plat) rider-trans) + :code (behavior () (restore-collide-with-as (-> self root-override)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t - (set! (-> self extended-amount) (seek (-> self extended-amount) 1.0 (* 2.5 (-> *display* seconds-per-frame)))) + (loop + (seek! (-> self extended-amount) 1.0 (* 2.5 (-> *display* seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) (move-to-point! (-> self root-override) gp-0) @@ -105,26 +98,23 @@ ) (none) ) - :post - (the-as (function none :behavior wall-plat) rider-post) + :post (the-as (function none :behavior wall-plat) rider-post) ) ;; failed to figure out what this is: (defstate wall-plat-extended (wall-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('untrigger) (go wall-plat-retracting) ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self extended-amount) 1.0) (move-to-point! (-> self root-override) (-> self out-trans)) (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) ) @@ -134,28 +124,24 @@ ;; failed to figure out what this is: (defstate wall-plat-retracting (wall-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) #f ) ) ) ) - :enter - (behavior () - (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) + :enter (behavior () + (sound-play "wall-plat") (none) ) - :trans - (the-as (function none :behavior wall-plat) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior wall-plat) rider-trans) + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t - (set! (-> self extended-amount) (seek (-> self extended-amount) 0.0 (* 2.5 (-> *display* seconds-per-frame)))) + (loop + (seek! (-> self extended-amount) 0.0 (* 2.5 (-> *display* seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) (move-to-point! (-> self root-override) gp-0) @@ -167,38 +153,32 @@ ) (none) ) - :post - (the-as (function none :behavior wall-plat) rider-post) + :post (the-as (function none :behavior wall-plat) rider-post) ) ;; failed to figure out what this is: (defstate wall-plat-sync-idle (wall-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) #f ) ) ) ) - :enter - (behavior () + :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (the-as (function none :behavior wall-plat) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior wall-plat) rider-trans) + :code (behavior () (let ((gp-0 #f)) - (while #t + (loop (let ((f30-0 (get-current-phase-with-mirror (-> self sync)))) (let ((s5-0 (new 'stack-no-clear 'vector))) (vector-lerp! s5-0 (-> self in-trans) (-> self out-trans) f30-0) @@ -215,7 +195,7 @@ ) (else (when (not gp-0) - (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) + (sound-play "wall-plat") (set! gp-0 #t) ) (restore-collide-with-as (-> self root-override)) @@ -227,8 +207,7 @@ ) (none) ) - :post - (the-as (function none :behavior wall-plat) rider-post) + :post (the-as (function none :behavior wall-plat) rider-post) ) ;; definition for method 11 of type wall-plat diff --git a/test/decompiler/reference/levels/sunken/wedge-plats_REF.gc b/test/decompiler/reference/levels/sunken/wedge-plats_REF.gc index f492fb0d30..1e82d285c6 100644 --- a/test/decompiler/reference/levels/sunken/wedge-plats_REF.gc +++ b/test/decompiler/reference/levels/sunken/wedge-plats_REF.gc @@ -1,6 +1,9 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/wedge-plat-outer-ag.gc") +(import "goal_src/import/wedge-plat-ag.gc") + ;; definition of type wedge-plat-master (deftype wedge-plat-master (process) ((center vector :inline :offset-assert 112) @@ -31,9 +34,8 @@ ;; failed to figure out what this is: (defstate wedge-plat-master-idle (wedge-plat-master) - :code - (behavior () - (while #t + :code (behavior () + (loop (set! (-> self rotate-inner) (the float (sar (shl (the int (+ (-> self rotate-inner) (* (-> self rotspeed) (-> *display* seconds-per-frame)))) 48) 48) @@ -96,13 +98,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *wedge-plat-sg* wedge-plat - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 6) - :longest-edge (meters 0) - ) +(defskelgroup *wedge-plat-sg* wedge-plat wedge-plat-lod0-jg wedge-plat-idle-ja + ((wedge-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) ;; definition for method 27 of type wedge-plat (defmethod dummy-27 wedge-plat ((obj wedge-plat)) @@ -141,8 +140,7 @@ ;; failed to figure out what this is: (defstate wedge-plat-idle (wedge-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'bonk) (dummy-22 self) @@ -150,15 +148,10 @@ ) ) ) - :trans - (the-as (function none :behavior wedge-plat) plat-trans) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 num-func) num-func-identity) - (set! (-> gp-0 frame-num) (ja-aframe 0.0 0)) - ) - (while #t + :trans (the-as (function none :behavior wedge-plat) plat-trans) + :code (behavior () + (ja :num-func num-func-identity :frame-num (ja-aframe 0.0 0)) + (loop (if (dummy-27 self) (go wedge-plat-tip) ) @@ -166,93 +159,64 @@ ) (none) ) - :post - (the-as (function none :behavior wedge-plat) plat-post) + :post (the-as (function none :behavior wedge-plat) plat-post) ) ;; failed to figure out what this is: (defstate wedge-plat-tip (wedge-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'bonk) (dummy-22 self) ) ((= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) #f ) ) ) ) ) - :trans - (the-as (function none :behavior wedge-plat) plat-trans) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-0 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 0.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :trans (the-as (function none :behavior wedge-plat) plat-trans) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (ja-aframe 60.0 0)) + :frame-num (ja-aframe 0.0 0) + ) (until (ja-done? 0) (dummy-27 self) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-2 param 0) (ja-aframe 100.0 0)) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) (ja-aframe 60.0 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) + (ja :num! (seek! (ja-aframe 60.0 0))) ) + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (ja-aframe 100.0 0)) + :frame-num (ja-aframe 60.0 0) + ) (until (ja-done? 0) (dummy-27 self) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 100.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 100.0 0))) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 num-func) num-func-identity) - (set! (-> gp-4 frame-num) (ja-aframe 100.0 0)) - ) + (ja :num-func num-func-identity :frame-num (ja-aframe 100.0 0)) (dummy-27 self) (suspend) ) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-5 param 0) (ja-aframe 153.0 0)) - (set! (-> gp-5 param 1) 1.0) - (set! (-> gp-5 frame-num) (ja-aframe 100.0 0)) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (ja-aframe 153.0 0)) + :frame-num (ja-aframe 100.0 0) + ) (until (ja-done? 0) (dummy-27 self) (suspend) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 param 0) (ja-aframe 153.0 0)) - (set! (-> gp-6 param 1) 1.0) - (joint-control-channel-group-eval! gp-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 153.0 0))) ) (go wedge-plat-idle) (none) ) - :post - (the-as (function none :behavior wedge-plat) plat-post) + :post (the-as (function none :behavior wedge-plat) plat-post) ) ;; definition for method 11 of type wedge-plat @@ -314,13 +278,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *wedge-plat-outer-sg* wedge-plat-outer - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *wedge-plat-outer-sg* wedge-plat-outer wedge-plat-outer-lod0-jg wedge-plat-outer-idle-ja + ((wedge-plat-outer-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; definition for method 27 of type wedge-plat-outer (defmethod dummy-27 wedge-plat-outer ((obj wedge-plat-outer)) @@ -359,8 +320,7 @@ ;; failed to figure out what this is: (defstate wedge-plat-outer-idle (wedge-plat-outer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'bonk) (dummy-22 self) @@ -368,15 +328,10 @@ ) ) ) - :trans - (the-as (function none :behavior wedge-plat-outer) plat-trans) - :code - (behavior () - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 num-func) num-func-identity) - (set! (-> gp-0 frame-num) (ja-aframe 0.0 0)) - ) + :trans (the-as (function none :behavior wedge-plat-outer) plat-trans) + :code (behavior () + (loop + (ja :num-func num-func-identity :frame-num (ja-aframe 0.0 0)) (if (dummy-27 self) (go wedge-plat-outer-tip) ) @@ -384,92 +339,63 @@ ) (none) ) - :post - (the-as (function none :behavior wedge-plat-outer) plat-post) + :post (the-as (function none :behavior wedge-plat-outer) plat-post) ) ;; failed to figure out what this is: (defstate wedge-plat-outer-tip (wedge-plat-outer) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'bonk) (dummy-22 self) ) ((= v1-0 'touch) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) ) ) ) ) ) - :trans - (the-as (function none :behavior wedge-plat-outer) plat-trans) - :code - (behavior () - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-0 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) (ja-aframe 0.0 0)) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + :trans (the-as (function none :behavior wedge-plat-outer) plat-trans) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (ja-aframe 60.0 0)) + :frame-num (ja-aframe 0.0 0) + ) (until (ja-done? 0) (dummy-27 self) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 60.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-2 param 0) (ja-aframe 100.0 0)) - (set! (-> gp-2 param 1) 1.0) - (set! (-> gp-2 frame-num) (ja-aframe 60.0 0)) - (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) + (ja :num! (seek! (ja-aframe 60.0 0))) ) + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (ja-aframe 100.0 0)) + :frame-num (ja-aframe 60.0 0) + ) (until (ja-done? 0) (dummy-27 self) (suspend) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 param 0) (ja-aframe 100.0 0)) - (set! (-> gp-3 param 1) 1.0) - (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 100.0 0))) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 num-func) num-func-identity) - (set! (-> gp-4 frame-num) (ja-aframe 100.0 0)) - ) + (ja :num-func num-func-identity :frame-num (ja-aframe 100.0 0)) (dummy-27 self) (suspend) ) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> gp-5 param 0) (ja-aframe 153.0 0)) - (set! (-> gp-5 param 1) 1.0) - (set! (-> gp-5 frame-num) (ja-aframe 100.0 0)) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (ja-aframe 153.0 0)) + :frame-num (ja-aframe 100.0 0) + ) (until (ja-done? 0) (dummy-27 self) (suspend) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 param 0) (ja-aframe 153.0 0)) - (set! (-> gp-6 param 1) 1.0) - (joint-control-channel-group-eval! gp-6 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 153.0 0))) ) (go wedge-plat-outer-idle) (none) ) - :post - (the-as (function none :behavior wedge-plat-outer) plat-post) + :post (the-as (function none :behavior wedge-plat-outer) plat-post) ) ;; definition for method 11 of type wedge-plat-outer diff --git a/test/decompiler/reference/levels/sunken/whirlpool_REF.gc b/test/decompiler/reference/levels/sunken/whirlpool_REF.gc index 8d6ab0973b..0b5d49b9c3 100644 --- a/test/decompiler/reference/levels/sunken/whirlpool_REF.gc +++ b/test/decompiler/reference/levels/sunken/whirlpool_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/whirlpool-ag.gc") + ;; definition of type whirlpool (deftype whirlpool (process-drawable) ((root-override collide-shape :offset 112) @@ -14,7 +16,7 @@ :size-assert #xcc :flag-assert #x15006000cc (:methods - (dummy-20 (_type_ float) uint 20) + (dummy-20 (_type_ float) cshape-moving-flags 20) ) (:states whirlpool-idle @@ -34,21 +36,17 @@ ) ;; failed to figure out what this is: -(defskelgroup *whirlpool-sg* whirlpool - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0.6 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *whirlpool-sg* whirlpool whirlpool-lod0-jg whirlpool-idle-ja + ((whirlpool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0.6 0 3) + ) ;; failed to figure out what this is: (defpartgroup group-whirlpool-swirl :id 447 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1739 :fade-after (meters 60) :falloff-to (meters 60) :binding 1737) + :parts ((sp-item 1739 :fade-after (meters 60) :falloff-to (meters 60) :binding 1737) (sp-item 1737 :flags (bit1 start-dead launch-asap) :binding 1738) (sp-item 1737 :flags (bit1 start-dead launch-asap) :binding 1738) (sp-item 1737 :flags (bit1 start-dead launch-asap) :binding 1738) @@ -240,8 +238,7 @@ ;; failed to figure out what this is: (defpart 1739 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 6.6)) (sp-flt spt-scale-x (meters 0.2)) @@ -256,8 +253,7 @@ ;; failed to figure out what this is: (defpart 1737 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 0)) @@ -283,14 +279,12 @@ ;; failed to figure out what this is: (defpart 1740 - :init-specs - ((sp-flt spt-fade-a 0.0)) + :init-specs ((sp-flt spt-fade-a 0.0)) ) ;; failed to figure out what this is: (defpart 1738 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -339,8 +333,7 @@ ;; failed to figure out what this is: (defstate whirlpool-idle (whirlpool) - :trans - (behavior () + :trans (behavior () (let ((f30-0 (+ (* (get-current-phase-with-mirror (-> self sync)) (-> self spin-speed-delta)) (-> self spin-speed-idle)) ) @@ -354,7 +347,7 @@ ) (+! (-> self spin-ry) (* f30-0 (-> *display* seconds-per-frame))) (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (-> self spin-ry)) - (if (and *target* (logtest? (-> *target* water flags) 512)) + (if (and *target* (logtest? (-> *target* water flags) (water-flags wt09))) (dummy-20 self f30-0) ) (update! (-> self sound)) @@ -364,10 +357,8 @@ ) (none) ) - :code - (the-as (function none :behavior whirlpool) anim-loop) - :post - (the-as (function none :behavior whirlpool) ja-post) + :code (the-as (function none :behavior whirlpool) anim-loop) + :post (the-as (function none :behavior whirlpool) ja-post) ) ;; definition for method 10 of type whirlpool @@ -415,19 +406,8 @@ (set! (-> obj spin-speed-delta) (- f28-0 f30-0)) ) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 447) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "whirlpool") - :volume #x400 - :fo-max 55 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "whirlpool" :fo-max 55) (-> obj root-override trans)) ) (ja-channel-set! 1) (let ((s5-1 (-> obj skel root-channel 0))) diff --git a/test/decompiler/reference/levels/swamp/billy_REF.gc b/test/decompiler/reference/levels/swamp/billy_REF.gc index 6217dd4b08..c481e03565 100644 --- a/test/decompiler/reference/levels/swamp/billy_REF.gc +++ b/test/decompiler/reference/levels/swamp/billy_REF.gc @@ -1,6 +1,10 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/farthy-snack-ag.gc") +(import "goal_src/import/billy-ag.gc") +(import "goal_src/import/billy-sidekick-ag.gc") + ;; definition of type billy (deftype billy (process-taskable) ((child-override (pointer billy-snack) :offset 20) @@ -89,117 +93,49 @@ ) ;; failed to figure out what this is: -(defskelgroup *farthy-snack-sg* farthy-snack - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *farthy-snack-sg* farthy-snack farthy-snack-lod0-jg farthy-snack-idle-ja + ((farthy-snack-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; failed to figure out what this is: (defstate billy-snack-eat (billy-snack) - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-3 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! - a0-3 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja :group! farthy-snack-eat-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (deactivate self) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior billy-snack) ja-post) + :post (the-as (function none :behavior billy-snack) ja-post) ) ;; failed to figure out what this is: (defstate billy-snack-idle (billy-snack) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('eat) (go billy-snack-eat) ) ) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior billy-snack) ja-post) + :post (the-as (function none :behavior billy-snack) ja-post) ) ;; definition for function billy-snack-init-by-other @@ -252,20 +188,17 @@ ;; failed to figure out what this is: (defstate nav-enemy-idle (billy-rat) :virtual #t - :enter - (behavior () + :enter (behavior () (go-virtual nav-enemy-chase) (none) ) - :post - (the-as (function none :behavior billy-rat) nav-enemy-common-post) + :post (the-as (function none :behavior billy-rat) nav-enemy-common-post) ) ;; failed to figure out what this is: (defstate nav-enemy-die (billy-rat) :virtual #t - :code - (behavior () + :code (behavior () (nav-enemy-fall-and-play-death-anim (the-as art-joint-anim (-> self draw art-group data (-> self nav-info die-anim))) 1.0 @@ -281,101 +214,46 @@ ;; failed to figure out what this is: (defstate billy-rat-eat (billy-rat) - :trans - (behavior () + :trans (behavior () (seek-to-point-toward-point! (-> self collide-info) (-> self destination) 131072.0 (seconds 0.01)) (none) ) - :code - (behavior () + :code (behavior () (send-event (handle->process (-> self snack)) 'eat) - (sound-play-by-name (static-sound-name "rat-gulp") (new-sound-id) 1024 0 0 1 #t) - (ja-channel-push! 1 15) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-9 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! - a0-9 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (sound-play "rat-gulp") + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 12)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) - (logclear! (-> self nav flags) (nav-control-flags bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) (go-virtual nav-enemy-chase) (none) ) - :post - (the-as (function none :behavior billy-rat) nav-enemy-simple-post) + :post (the-as (function none :behavior billy-rat) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate billy-rat-salivate (billy-rat) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior billy-rat) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 22) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) (dotimes (gp-0 1) - (sound-play-by-name (static-sound-name "rat-eat") (new-sound-id) 1024 0 0 1 #t) + (sound-play "rat-eat") (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - ) - (set! (-> a0-3 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) data 0 length) - -1 - ) - ) - ) - (set! (-> a0-3 param 1) f30-0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! - a0-3 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) - num-func-seek! - ) - ) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info victory-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) f30-0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -386,22 +264,20 @@ ) (none) ) - :post - (the-as (function none :behavior billy-rat) nav-enemy-simple-post) + :post (the-as (function none :behavior billy-rat) nav-enemy-simple-post) ) ;; failed to figure out what this is: (defstate nav-enemy-victory (billy-rat) :virtual #t - :enter - (behavior () + :enter (behavior () (let ((t9-1 (-> (the-as (state nav-enemy) (find-parent-method billy-rat 33)) enter))) (if t9-1 (t9-1) ) ) - (when (logtest? (nav-control-flags bit19) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit19)) + (when (logtest? (nav-control-flags navcf19) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) (if (rat-about-to-eat? self (-> self billy 0)) (go billy-rat-salivate) (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) @@ -414,8 +290,7 @@ ;; failed to figure out what this is: (defstate nav-enemy-stare (billy-rat) :virtual #t - :enter - (behavior () + :enter (behavior () (go-virtual nav-enemy-chase) (none) ) @@ -424,18 +299,16 @@ ;; failed to figure out what this is: (defstate nav-enemy-chase (billy-rat) :virtual #t - :trans - (behavior () + :trans (behavior () (set! (-> self speed-scale) (-> self billy 0 rat-speed)) - (if (or (logtest? (nav-control-flags bit19) (-> self nav flags)) + (if (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self chase-rest-time)) ) (go-virtual nav-enemy-victory) ) (none) ) - :post - (behavior () + :post (behavior () (swamp-rat-update-wiggle-target (-> self destination)) (nav-enemy-travel-post) (none) @@ -458,23 +331,18 @@ ) ;; failed to figure out what this is: -(defskelgroup *billy-sg* billy - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 1) - :shadow 2 - ) +(defskelgroup *billy-sg* billy billy-lod0-jg billy-idle-breath-ja + ((billy-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :longest-edge (meters 1) + :shadow billy-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *billy-sidekick-sg* billy-sidekick - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *billy-sidekick-sg* billy-sidekick billy-sidekick-lod0-jg billy-sidekick-idle-ja + ((billy-sidekick-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; definition for function billy-kill-all-but-farthy (defbehavior billy-kill-all-but-farthy billy () @@ -504,15 +372,7 @@ (eval-path-curve-div! (-> obj path-snacks) s5-1 (the float s4-0) 'exact) (set! (-> s5-1 x) (+ -40960.0 (-> s5-1 x))) (set! (-> s5-1 z) (+ 20480.0 (-> s5-1 z))) - (let ((s3-0 (get-process *default-dead-pool* manipy #x4000))) - (when s3-0 - (let ((t9-4 (method-of-type manipy activate))) - (t9-4 (the-as manipy s3-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 manipy-init s5-1 (-> obj entity) *farthy-snack-sg* #f) - (-> s3-0 ppointer) - ) - ) + (manipy-spawn s5-1 (-> obj entity) *farthy-snack-sg* #f :to obj) ) ) ) @@ -520,8 +380,7 @@ :name "billy-introduction" :index 5 :parts 14 - :command-list - '((0 kill "swamp-blimp-3") + :command-list '((0 kill "swamp-blimp-3") (0 kill "swamp-tetherrock-14") (0 kill "swamp-tetherrock-15") (0 kill "flutflut-3") @@ -562,8 +421,7 @@ :name "billy-reminder-1" :index 8 :parts 2 - :command-list - '((0 kill "swamp-blimp-3") + :command-list '((0 kill "swamp-blimp-3") (0 kill "swamp-tetherrock-14") (0 kill "swamp-tetherrock-15") (0 kill "flutflut-3") @@ -597,8 +455,7 @@ :name "billy-resolution" :index 9 :parts 2 - :command-list - '((0 kill "swamp-blimp-3") + :command-list '((0 kill "swamp-blimp-3") (0 kill "swamp-tetherrock-14") (0 kill "swamp-tetherrock-15") (0 kill "flutflut-3") @@ -680,8 +537,7 @@ ;; failed to figure out what this is: (defstate billy-done (billy) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'billy-rat-needs-destination) (let* ((gp-0 arg0) @@ -699,8 +555,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (init! (-> self query) (lookup-text! *common-text* (game-text-id play-again?) #f) @@ -711,9 +566,7 @@ (lookup-text! *common-text* (game-text-id quit) #f) ) (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (get-art-elem self))) - ) + (ja :group! (get-art-elem self)) (send-event *target* 'end-mode) (when (and (handle->process (-> self offending-rat)) (zero? (-> self num-snacks))) (send-event *camera* 'change-target (handle->process (-> self offending-rat))) @@ -726,10 +579,7 @@ (let ((a0-24 (get-reminder (-> self tasks) 0))) (save-reminder (-> self tasks) (seekl a0-24 255 1) 0) ) - (let* ((v1-49 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-50 (the-as number (logior #x3f800000 v1-49))) - (f0-2 (+ -1.0 (the-as float v1-50))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.75 f0-2) (play-ambient (-> self ambient) "BIL-TA04" #t (the-as vector #f)) @@ -748,15 +598,13 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (billy-kill-all-but-farthy) (send-event *camera* 'change-target *target*) (send-event *camera* 'change-state *camera-base-mode* 0) (none) ) - :trans - (behavior () + :trans (behavior () (cond ((> (-> self num-snacks) 0) (when (process-grab? *target*) @@ -769,7 +617,7 @@ ) (else (process-grab? *target*) - (when (and *target* (logtest? (-> *target* state-flags) 256)) + (when (and *target* (logtest? (-> *target* state-flags) (state-flags grabbed))) (let ((gp-0 (get-response (-> self query)))) (cond ((and (= gp-0 'yes) (process-release? *target*)) @@ -786,10 +634,8 @@ (spool-push *art-control* "billy-reject" 0 self -99.0) (none) ) - :code - (the-as (function none :behavior billy) process-taskable-anim-loop) - :post - (behavior () + :code (the-as (function none :behavior billy) process-taskable-anim-loop) + :post (behavior () (ja-post) (none) ) @@ -972,17 +818,9 @@ ) (get-random-point (-> self path-starts) gp-0) (get-random-point (-> self path-waypts) s5-0) - (let ((s4-0 (get-process *default-dead-pool* billy-rat #x4000))) - (if (when s4-0 - (let ((t9-4 (method-of-type billy-rat activate))) - (t9-4 (the-as billy-rat s4-0) self 'billy-rat (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 billy-rat-init-by-other self gp-0 s5-0) - (-> s4-0 ppointer) - ) - (+! (-> self num-rats) 1) - ) - ) + (if (process-spawn billy-rat self gp-0 s5-0 :to self) + (+! (-> self num-rats) 1) + ) ) ) 0 @@ -991,14 +829,11 @@ ;; failed to figure out what this is: (defstate billy-playing (billy) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('billy-rat-die) (+! (-> self num-rats) -1) - (let* ((v1-4 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-5 (the-as number (logior #x3f800000 v1-4))) - (f0-2 (+ -1.0 (the-as float v1-5))) + (let* ((f0-2 (rand-float-gen)) (f0-3 (* 3.0 f0-2)) ) (cond @@ -1034,10 +869,7 @@ ) ) (when gp-0 - (let* ((v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-16 (the-as number (logior #x3f800000 v1-15))) - (f0-6 (+ -1.0 (the-as float v1-16))) - ) + (let ((f0-6 (rand-float-gen))) (cond ((< 0.75 f0-6) (play-ambient (-> self ambient) "BIL-TA01" #t (the-as vector #f)) @@ -1119,9 +951,8 @@ ) ) ) - :enter - (behavior () - (push-setting! *setting-control* self 'music 'danger 0.0 0) + :enter (behavior () + (add-setting! 'music 'danger 0.0 0) (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (init! (-> self query) (the-as string #f) 40 150 25 #t (lookup-text! *common-text* (game-text-id quit) #f)) @@ -1133,17 +964,9 @@ (let ((gp-1 (new 'stack-no-clear 'vector))) (dotimes (s5-1 (+ (the int (the float (+ (-> self path-snacks curve num-cverts) -1))) 1)) (eval-path-curve-div! (-> self path-snacks) gp-1 (the float s5-1) 'exact) - (let ((s4-1 (get-process *default-dead-pool* billy-snack #x4000))) - (if (when s4-1 - (let ((t9-7 (method-of-type billy-snack activate))) - (t9-7 (the-as billy-snack s4-1) self 'billy-snack (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 billy-snack-init-by-other gp-1) - (-> s4-1 ppointer) - ) - (+! (-> self num-snacks) 1) - ) - ) + (if (process-spawn billy-snack gp-1 :to self) + (+! (-> self num-snacks) 1) + ) ) ) (backup-load-state-and-set-cmds *load-state* '()) @@ -1181,23 +1004,20 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (restore-collide-with-as (-> self root-override)) (restore-load-state-and-cleanup *load-state*) (set! (-> *ACTOR-bank* birth-max) 1000) - (clear-pending-settings-from-process *setting-control* self 'music) + (remove-setting! 'music) (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "billy-resolution" 0 self -99.0) (spool-push *art-control* "billy-reject" 0 self -99.0) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (billy-game-update) (if (or (zero? (-> self num-snacks)) (and (zero? (-> self num-rats)) (-> self passed-last-stage)) @@ -1209,8 +1029,7 @@ ) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (none) ) @@ -1219,23 +1038,16 @@ ;; failed to figure out what this is: (defstate enter-playing (billy) :virtual #t - :trans - (behavior () - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'change-mode) - (set! (-> a1-0 param 0) (the-as uint 'billy)) - (when (send-event-function *target* a1-0) - (send-event *target* 'trans 'reset) - (let ((v1-8 (entity-actor-lookup (-> self entity) 'alt-actor 0))) - (cond - (v1-8 - (move-to-point! (-> *target* control) (-> v1-8 extra trans)) - (go billy-playing) - ) - (else - ) + :trans (behavior () + (when (send-event *target* 'change-mode 'billy) + (send-event *target* 'trans 'reset) + (let ((v1-8 (entity-actor-lookup (-> self entity) 'alt-actor 0))) + (cond + (v1-8 + (move-to-point! (-> *target* control) (-> v1-8 extra trans)) + (go billy-playing) + ) + (else ) ) ) @@ -1247,10 +1059,7 @@ ;; definition for method 43 of type billy (defmethod TODO-RENAME-43 billy ((obj billy)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f30-0 (+ -1.0 (the-as float v1-4))) - ) + (let ((f30-0 (rand-float-gen))) (cond ((< 0.9411765 f30-0) (play-ambient (-> obj ambient) "BIL-AM01" #f (-> obj root-override trans)) @@ -1314,8 +1123,7 @@ ;; failed to figure out what this is: (defstate play-anim (billy) :virtual #t - :exit - (behavior () + :exit (behavior () (billy-kill-all-but-farthy) ((-> (method-of-type process-taskable play-anim) exit)) (none) @@ -1325,82 +1133,30 @@ ;; failed to figure out what this is: (defstate idle (billy) :virtual #t - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 60) - ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.2)) ) + (loop + (ja :group! (get-art-elem self)) (let* ((f30-0 5.0) (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-10 (the-as number (logior #x3f800000 v1-9))) ) (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-10)))) 5)) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-10 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! - a0-10 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (TODO-RENAME-43 self) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) - ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (when (ja-group? billy-idle-breath-ja) + (ja-no-eval :group! billy-idle-shoo-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -1428,19 +1184,9 @@ ) ) (set! (-> obj path) (-> obj path-snacks)) - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj farthy) - (ppointer->handle - (when s5-1 - (let ((t9-4 (method-of-type manipy activate))) - (t9-4 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *billy-sidekick-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> obj farthy) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *billy-sidekick-sg* #f :to obj)) + ) (send-event (handle->process (-> obj farthy)) 'center-joint 3) (send-event (handle->process (-> obj farthy)) 'anim-mode 'clone-anim) (dummy-42 obj) diff --git a/test/decompiler/reference/levels/swamp/kermit_REF.gc b/test/decompiler/reference/levels/swamp/kermit_REF.gc index ad7429941b..a763b9a214 100644 --- a/test/decompiler/reference/levels/swamp/kermit_REF.gc +++ b/test/decompiler/reference/levels/swamp/kermit_REF.gc @@ -1,12 +1,13 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/kermit-ag.gc") + ;; failed to figure out what this is: (defpartgroup group-kermit-charging-up :id 298 :bounds (static-bspherem 0 5 0 5) - :parts - ((sp-item 1359 :fade-after (meters 140) :falloff-to (meters 140) :binding 1356) + :parts ((sp-item 1359 :fade-after (meters 140) :falloff-to (meters 140) :binding 1356) (sp-item 1359 :fade-after (meters 140) :falloff-to (meters 140) :binding 1357) (sp-item 1359 :fade-after (meters 140) :falloff-to (meters 140) :binding 1358) (sp-item 1360) @@ -26,8 +27,7 @@ ;; failed to figure out what this is: (defpart 1360 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -47,8 +47,7 @@ ;; failed to figure out what this is: (defpart 1359 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.05 0.1 1.0) (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) (sp-flt spt-y (meters 0.5)) @@ -68,17 +67,9 @@ ;; failed to figure out what this is: (defpart 1356 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-flt spt-num 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "eco-blue-spark1") - :volume #x2cc - ) - ) + (sp-sound (static-sound-spec "eco-blue-spark1" :num 0.05 :volume 70.0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -97,17 +88,9 @@ ;; failed to figure out what this is: (defpart 1357 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-flt spt-num 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.075 - :group #x1 - :sound-name (static-sound-name "eco-blue-spark2") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "eco-blue-spark2" :num 0.075 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -126,17 +109,9 @@ ;; failed to figure out what this is: (defpart 1358 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-flt spt-num 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 0.05 - :group #x1 - :sound-name (static-sound-name "eco-blue-spark3") - :volume #x2cc - ) - ) + (sp-sound (static-sound-spec "eco-blue-spark3" :num 0.05 :volume 70.0)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) (sp-int spt-rot-x 4) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -155,8 +130,7 @@ ;; failed to figure out what this is: (defpart 1361 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.1 0.5 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -179,8 +153,7 @@ ;; failed to figure out what this is: (defpart 1362 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.2 0.4 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -203,8 +176,7 @@ ;; failed to figure out what this is: (defpart 1363 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-rnd-flt spt-num 0.3 0.1 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.5)) @@ -227,8 +199,7 @@ ;; failed to figure out what this is: (defpart 1364 - :init-specs - ((sp-flt spt-r 64.0) + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) (sp-flt spt-fade-r -1.0) (sp-flt spt-fade-g -1.0) @@ -241,14 +212,12 @@ :id 299 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1365 :period 15 :length 5)) + :parts ((sp-item 1365 :period 15 :length 5)) ) ;; failed to figure out what this is: (defpart 1365 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -273,8 +242,7 @@ (defpartgroup group-kermit-pulse :id 300 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1368 :flags (launch-asap) :binding 1366) + :parts ((sp-item 1368 :flags (launch-asap) :binding 1366) (sp-item 1366 :flags (start-dead launch-asap) :binding 1367) (sp-item 1367 :flags (start-dead)) (sp-item 1367 :flags (start-dead)) @@ -283,8 +251,7 @@ ;; failed to figure out what this is: (defpart 1368 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 3)) (sp-copy-from-other spt-scale-y -4) @@ -302,8 +269,7 @@ ;; failed to figure out what this is: (defpart 1369 - :init-specs - ((sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) + :init-specs ((sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-a 100.0 28.0 1.0) (sp-int spt-next-time 5) @@ -313,8 +279,7 @@ ;; failed to figure out what this is: (defpart 1366 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-y (meters 4) (meters 16) 1.0) (sp-flt spt-z (meters 0)) @@ -337,14 +302,12 @@ ;; failed to figure out what this is: (defpart 1370 - :init-specs - ((sp-flt spt-vel-z (meters 0))) + :init-specs ((sp-flt spt-vel-z (meters 0))) ) ;; failed to figure out what this is: (defpart 1367 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.85)) (sp-copy-from-other spt-scale-y -4) @@ -366,14 +329,12 @@ :id 301 :duration 5 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 1371) (sp-item 1372)) + :parts ((sp-item 1371) (sp-item 1372)) ) ;; failed to figure out what this is: (defpart 1371 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters -0.1) (meters 0.2) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.2) 1.0) @@ -404,8 +365,7 @@ ;; failed to figure out what this is: (defpart 1373 - :init-specs - ((sp-flt spt-fade-r -3.2) + :init-specs ((sp-flt spt-fade-r -3.2) (sp-flt spt-fade-g 1.0) (sp-flt spt-fade-b 1.0) (sp-int spt-next-time 30) @@ -415,14 +375,12 @@ ;; failed to figure out what this is: (defpart 1374 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: (defpart 1372 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 32.0) (sp-rnd-flt spt-x (meters -0.1) (meters 0.2) 1.0) (sp-rnd-flt spt-y (meters -0.1) (meters 0.2) 1.0) @@ -613,8 +571,7 @@ ;; failed to figure out what this is: (defstate kermit-pulse-idle (kermit-pulse) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) @@ -622,35 +579,24 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self sound-id)) (none) ) - :code - (behavior () + :code (behavior () (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) - (sound-play-by-name - (static-sound-name "kermit-loop") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "kermit-loop" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) (spawn (-> self part) (-> self root-override trans)) (find-ground-and-draw-shadow (-> self root-override trans) (the-as vector #f) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -659,8 +605,7 @@ (cleanup-for-death self) (none) ) - :post - (behavior () + :post (behavior () (update-transforms! (-> self root-override)) (none) ) @@ -668,26 +613,18 @@ ;; failed to figure out what this is: (defstate kermit-pulse-impact (kermit-pulse) - :code - (behavior () - (sound-play-by-name (static-sound-name "get-shocked") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 301) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) + :code (behavior () + (sound-play "get-shocked") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 301) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (cleanup-for-death self) (none) @@ -697,7 +634,7 @@ ;; definition for function kermit-pulse-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior kermit-pulse-init-by-other kermit-pulse ((arg0 vector) (arg1 entity)) +(defbehavior kermit-pulse-init-by-other kermit-pulse ((arg0 vector) (arg1 entity-actor)) (logclear! (-> self mask) (process-mask enemy attackable)) (set! (-> self mask) (logior (process-mask projectile) (-> self mask))) (set! (-> self entity) arg1) @@ -732,15 +669,7 @@ ;; definition for function spawn-kermit-pulse ;; INFO: Return type mismatch int vs none. (defun spawn-kermit-pulse ((arg0 kermit) (arg1 vector) (arg2 entity)) - (let ((s3-0 (get-process *default-dead-pool* kermit-pulse #x4000))) - (when s3-0 - (let ((t9-1 (method-of-type kermit-pulse activate))) - (t9-1 (the-as kermit-pulse s3-0) arg0 'kermit-pulse (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 kermit-pulse-init-by-other arg1 arg2) - (-> s3-0 ppointer) - ) - ) + (process-spawn kermit-pulse arg1 arg2 :to arg0) 0 (none) ) @@ -812,13 +741,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *kermit-sg* kermit - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 -1 0 3) - :longest-edge (meters 2) - ) +(defskelgroup *kermit-sg* kermit kermit-lod0-jg kermit-idle-ja + ((kermit-lod0-mg (meters 20)) (kermit-lod1-mg (meters 40)) (kermit-lod2-mg (meters 999999))) + :bounds (static-spherem 0 -1 0 3) + :longest-edge (meters 2) + ) ;; definition for function kermit-enable-tongue ;; INFO: Return type mismatch int vs none. @@ -885,7 +812,7 @@ (collide-kind background cak-2 crate enemy wall-object projectile ground-object) self t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) (gp-1 (< f30-0 0.0)) @@ -934,15 +861,7 @@ ;; definition for function kermit-short-hop (defbehavior kermit-short-hop kermit () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! kermit-hop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f0-4 (ja-aframe-num 0))) (if (>= f0-4 4.0) @@ -953,26 +872,14 @@ ) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) ;; definition for function kermit-long-hop (defbehavior kermit-long-hop kermit () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! kermit-longhop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f0-4 (ja-aframe-num 0))) (if (>= f0-4 7.0) @@ -983,18 +890,14 @@ ) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) #f ) ;; definition for function kermit-hop (defbehavior kermit-hop kermit ((arg0 float)) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (set! (-> self rotate-speed) 1820444.5) (let ((f0-2 (fmin arg0 (vector-vector-distance (-> self collide-info trans) (-> self nav target-pos))))) (cond @@ -1016,7 +919,7 @@ ;; Used lq/sq (defbehavior kermit-set-rotate-dir-to-nav-target kermit () (cond - ((logtest? (nav-control-flags bit19) (-> self nav flags)) + ((logtest? (nav-control-flags navcf19) (-> self nav flags)) (vector-! (-> self rotate-dir) (-> self nav target-pos) (-> self collide-info trans)) ) (else @@ -1106,19 +1009,16 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate kermit-idle (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self notice-time) 0) 0 (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) @@ -1127,47 +1027,32 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (kermit-disable-tongue) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :group! kermit-idle-ja :num! min) + (loop + (ja :num! (loop!)) (suspend) ) (none) ) - :post - (the-as (function none :behavior kermit) ja-post) + :post (the-as (function none :behavior kermit) ja-post) ) ;; failed to figure out what this is: (defstate kermit-patrol (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) (kermit-get-new-patrol-point) (dummy-11 (-> self nav) (-> self nav target-pos)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (or (not *target*) (< (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) @@ -1180,98 +1065,73 @@ nav-enemy-default-event-handler (if (and (not (-> self airborne)) (nav-enemy-test-point-in-nav-mesh? (target-pos 0))) (go kermit-notice) ) - (if (logtest? (nav-control-flags bit19) (-> self nav flags)) + (if (logtest? (nav-control-flags navcf19) (-> self nav flags)) (kermit-get-new-patrol-point) ) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 3.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (loop + (ja-no-eval :group! kermit-idle-ja :num! (seek! max 3.0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 3.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 3.0)) ) (kermit-hop 20480.0) ) (none) ) - :post - kermit-post + :post kermit-post ) ;; failed to figure out what this is: (defstate kermit-notice (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) (none) ) - :trans - (behavior () + :trans (behavior () (kermit-set-rotate-dir-to-player) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) (kermit-hop 0.0) (go kermit-chase) (none) ) - :post - kermit-post + :post kermit-post ) ;; failed to figure out what this is: (defstate kermit-give-up (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) (none) ) - :code - (behavior () + :code (behavior () (go kermit-patrol) (none) ) - :post - kermit-simple-post + :post kermit-simple-post ) ;; failed to figure out what this is: (defstate kermit-chase-new-position (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self miss-count) 0) (let* ((a1-1 (kermit-get-head-dir-xz self (new 'stack-no-clear 'vector))) @@ -1296,11 +1156,10 @@ nav-enemy-default-event-handler (dummy-11 (-> self nav) (-> self nav target-pos)) (none) ) - :trans - (behavior () + :trans (behavior () (when (not (-> self airborne)) (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) - (and (logtest? (nav-control-flags bit19) (-> self nav flags)) + (and (logtest? (nav-control-flags navcf19) (-> self nav flags)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) ) ) @@ -1309,55 +1168,38 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 51) + :code (behavior () + (ja-channel-push! 1 (seconds 0.17)) (dotimes (gp-0 3) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 4.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! kermit-idle-ja :num! (seek! max 4.0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 4.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 4.0)) ) ) - (while #t + (loop (kermit-hop 81920.0) (nop!) ) (none) ) - :post - kermit-post + :post kermit-post ) ;; failed to figure out what this is: (defstate kermit-chase (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) (kermit-set-nav-mesh-target (-> self collide-info trans)) (dummy-11 (-> self nav) (-> self nav target-pos)) (none) ) - :trans - (behavior () + :trans (behavior () (kermit-set-nav-mesh-target (-> self collide-info trans)) (kermit-set-rotate-dir-to-player) (if (nav-enemy-test-point-in-nav-mesh? (target-pos 0)) @@ -1390,26 +1232,13 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 51) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 3.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.17)) + (loop + (ja-no-eval :group! kermit-idle-ja :num! (seek! max 3.0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 3.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 3.0)) ) (if (not (kermit-check-to-hit-player? 3640.889)) (kermit-hop 81920.0) @@ -1417,35 +1246,24 @@ nav-enemy-default-event-handler ) (none) ) - :post - kermit-post + :post kermit-post ) ;; failed to figure out what this is: (defstate kermit-attack (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :code - (behavior () - (ja-channel-push! 1 51) + :code (behavior () + (ja-channel-push! 1 (seconds 0.17)) (set! (-> self tongue-control forward-scale-control) 0.0) (kermit-enable-tongue) (let ((s5-0 #f) (gp-0 #f) ) (let ((f30-0 1.0)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! kermit-lash-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (set! (-> self tongue-control target-pos quad) (-> (kermit-player-target-pos) quad)) (when (and (not s5-0) (>= (ja-aframe-num 0) 14.0)) @@ -1459,16 +1277,10 @@ nav-enemy-default-event-handler (if (and (not gp-0) (= (-> self tongue-control forward-scale-control) f30-0)) (go kermit-retract-tongue) ) - (set! (-> self tongue-control forward-scale-control) - (seek (-> self tongue-control forward-scale-control) f30-0 0.25) - ) + (seek! (-> self tongue-control forward-scale-control) f30-0 0.25) ) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (cond @@ -1496,19 +1308,16 @@ nav-enemy-default-event-handler ) (none) ) - :post - kermit-simple-post + :post kermit-simple-post ) ;; failed to figure out what this is: (defstate kermit-tongue-stuck (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self miss-count) 0) (set! (-> self tongue-control forward-scale-control) 1.0) (kermit-enable-tongue) @@ -1516,8 +1325,7 @@ nav-enemy-default-event-handler (spawn-kermit-pulse self (kermit-tongue-pos self) (-> self entity)) (none) ) - :exit - (behavior () + :exit (behavior () (sound-stop (-> self sound-id)) (let ((v1-0 (-> self child-override))) (if v1-0 @@ -1526,8 +1334,7 @@ nav-enemy-default-event-handler ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((s5-0 (kermit-player-target-pos)) (gp-0 (kermit-tongue-pos self)) ) @@ -1536,9 +1343,7 @@ nav-enemy-default-event-handler ) (go kermit-retract-tongue) ) - (set! (-> self tongue-pulse-pos) - (seek (-> self tongue-pulse-pos) 1.0 (* 0.3 (-> *display* seconds-per-frame))) - ) + (seek! (-> self tongue-pulse-pos) 1.0 (* 0.3 (-> *display* seconds-per-frame))) (when (and (-> self child-override) (let ((v1-9 (-> self child-override))) (= (-> (if v1-9 (-> v1-9 0 self-override) @@ -1563,41 +1368,19 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (loop + (ja-no-eval :group! kermit-turn-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (sound-play-by-name - (static-sound-name "kermit-stretch") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self collide-info trans)) - ) + (sound-play "kermit-stretch" :id (-> self sound-id) :position (the-as symbol (-> self collide-info trans))) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (behavior () + :post (behavior () (seek-to-point-toward-point! (-> self collide-info) (target-pos 0) (-> self rotate-speed) (seconds 0.05)) (kermit-simple-post) (none) @@ -1606,26 +1389,22 @@ nav-enemy-default-event-handler ;; failed to figure out what this is: (defstate kermit-retract-tongue (kermit) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior kermit) nav-enemy-default-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self charged-up) #f) (+! (-> self miss-count) 1) (none) ) - :exit - (behavior () + :exit (behavior () (set! (-> self tongue-control forward-scale-control) 0.0) (kermit-disable-tongue) (none) ) - :trans - (behavior () + :trans (behavior () (kermit-set-nav-mesh-target (-> self collide-info trans)) (kermit-set-rotate-dir-to-player) (when (not (-> self airborne)) @@ -1637,58 +1416,30 @@ nav-enemy-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! kermit-miss-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (>= (ja-aframe-num 0) 3.0) - (set! (-> self tongue-control forward-scale-control) - (seek (-> self tongue-control forward-scale-control) 0.0 0.125) - ) + (seek! (-> self tongue-control forward-scale-control) 0.0 0.125) ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self tongue-control forward-scale-control) 0.0) (kermit-disable-tongue) - (while #t - (ja-channel-push! 1 30) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 4.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (loop + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! kermit-idle-ja :num! (seek! max 4.0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 4.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 4.0)) ) (kermit-hop 0.0) ) (none) ) - :post - kermit-post + :post kermit-post ) ;; definition for symbol *kermit-nav-enemy-info*, type nav-enemy-info @@ -1739,7 +1490,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/test/decompiler/reference/levels/swamp/swamp-bat_REF.gc b/test/decompiler/reference/levels/swamp/swamp-bat_REF.gc index b976410575..641891a78d 100644 --- a/test/decompiler/reference/levels/swamp/swamp-bat_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-bat_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/swamp-bat-ag.gc") + ;; definition of type swamp-bat-idle-path (deftype swamp-bat-idle-path (structure) ((origin vector :inline :offset-assert 0) @@ -183,16 +185,13 @@ swamp-bat-slave-event-handler (TODO-RENAME-12 s2-0 gp-0 f30-0) (vector-cross! s4-0 gp-0 s3-0) (vector-normalize! s4-0 1.0) - (let ((f0-4 - (fmax - (fmin (- (vector-dot (target-pos 0) s4-0) (vector-dot s5-0 s4-0)) (-> self strafe-envelope)) - (- (-> self strafe-envelope)) - ) - ) + (let ((f0-4 (fmax + (fmin (- (vector-dot (target-pos 0) s4-0) (vector-dot s5-0 s4-0)) (-> self strafe-envelope)) + (- (-> self strafe-envelope)) + ) + ) ) - (set! (-> self strafe-distance) - (seek (-> self strafe-distance) f0-4 (* 20480.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self strafe-distance) f0-4 (* 20480.0 (-> *display* seconds-per-frame))) ) (vector-float*! s4-0 s4-0 (-> self strafe-distance)) (vector+! (-> self root-override trans) s5-0 s4-0) @@ -202,13 +201,10 @@ swamp-bat-slave-event-handler ) ;; failed to figure out what this is: -(defskelgroup *swamp-bat-slave-sg* swamp-bat - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - ) +(defskelgroup *swamp-bat-slave-sg* swamp-bat swamp-bat-lod0-jg swamp-bat-idle-ja + ((swamp-bat-lod0-mg (meters 20)) (swamp-bat-lod1-mg (meters 40)) (swamp-bat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + ) ;; definition for function swamp-bat-slave-get-new-path ;; Used lq/sq @@ -240,16 +236,12 @@ swamp-bat-slave-event-handler ;; failed to figure out what this is: (defstate swamp-bat-slave-idle (swamp-bat-slave) - :event - swamp-bat-slave-event-handler - :code - (behavior () + :event swamp-bat-slave-event-handler + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self launch-ready) #f) - (ja-channel-push! 1 49) - (let ((v1-4 (-> self skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) + (ja-channel-push! 1 (seconds 0.165)) + (ja :group! swamp-bat-idle-ja) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> self root-override trans quad)) (let ((s4-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root-override quat))) @@ -265,7 +257,7 @@ swamp-bat-slave-event-handler (s3-0 (the int (* f0-0 (/ 1.0 f1-0) (vector-vector-distance s5-0 (-> self idle-position))))) ) (forward-up->quaternion gp-0 s2-0 (new 'static 'vector :y 1.0 :w 1.0)) - (while #t + (loop (let ((v1-17 (- (-> *display* base-frame-counter) (-> self state-time)))) (when (>= v1-17 s3-0) 0 @@ -280,10 +272,7 @@ swamp-bat-slave-event-handler (quaternion-slerp! (-> self root-override quat) s4-0 gp-0 f30-1) ) ) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (-> self idle-anim-speed)) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! (-> self idle-anim-speed))) (suspend) 0 ) @@ -297,7 +286,7 @@ swamp-bat-slave-event-handler (set! (-> self launch-ready) #t) (logior! (-> self mask) (process-mask actor-pause)) (let ((f30-2 0.0)) - (while #t + (loop (let ((f26-0 (cos f30-2)) (f28-0 (sin f30-2)) ) @@ -305,37 +294,29 @@ swamp-bat-slave-event-handler (vector+*! (-> self root-override trans) (-> self root-override trans) (-> self idle-path x-axis) f26-0) (vector+*! (-> self root-override trans) (-> self root-override trans) (-> self idle-path y-axis) f28-0) ) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 param 0) (-> self idle-anim-speed)) - (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! (-> self idle-anim-speed))) (suspend) (+! f30-2 (* 32768.0 (-> *display* seconds-per-frame) (-> self idle-anim-speed))) ) ) (none) ) - :post - (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) + :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) ) ;; failed to figure out what this is: (defstate swamp-bat-slave-launch (swamp-bat-slave) - :event - swamp-bat-slave-event-handler - :code - (behavior () + :event swamp-bat-slave-event-handler + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self launch-ready) #f) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) (let ((gp-0 (new-stack-vector0))) (set! (-> gp-0 quad) (-> self root-override trans quad)) (let ((s5-0 (new-stack-vector0))) (eval-path-curve-div! (-> self parent-process 0 path-list (-> self path-select)) s5-0 0.0 'interp) - (let ((v1-12 (-> self skel root-channel 0))) - (set! (-> v1-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) - (while #t + (ja :group! swamp-bat-idle-ja) + (loop (let ((s4-0 (- (-> *display* base-frame-counter) (-> self state-time)))) (if (>= s4-0 (seconds 0.3)) (go swamp-bat-slave-swoop) @@ -344,10 +325,7 @@ swamp-bat-slave-event-handler (vector-lerp! (-> self root-override trans) gp-0 s5-0 f0-1) ) ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (-> self idle-anim-speed)) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! (-> self idle-anim-speed))) (suspend) 0 ) @@ -355,100 +333,68 @@ swamp-bat-slave-event-handler ) (none) ) - :post - (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) + :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) ) ;; failed to figure out what this is: (defstate swamp-bat-slave-swoop (swamp-bat-slave) - :event - swamp-bat-slave-event-handler - :code - (behavior () + :event swamp-bat-slave-event-handler + :code (behavior () (set! (-> self strafe-envelope) 0.0) - (ja-channel-push! 1 30) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! swamp-bat-notice-ja :num! min) (until (ja-done? 0) (if (< (ja-aframe-num 0) 10.0) (sync-now! (-> self sync) 0.0) ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self strafe-envelope) 20480.0) - (ja-channel-push! 1 30) - (let ((v1-18 (-> self skel root-channel 0))) - (set! (-> v1-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) - (while #t + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! swamp-bat-swoop-ja) + (loop (if (>= (dummy-20 self) 2.0) (go swamp-bat-slave-strafe) ) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) (none) ) - :post - (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) + :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) ) ;; failed to figure out what this is: (defstate swamp-bat-slave-strafe (swamp-bat-slave) - :event - swamp-bat-slave-event-handler - :code - (behavior () + :event swamp-bat-slave-event-handler + :code (behavior () (set! (-> self strafe-envelope) 20480.0) - (ja-channel-push! 1 30) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) - (while #t + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! swamp-bat-strafe-ja) + (loop (if (>= (dummy-20 self) 6.0) (go swamp-bat-slave-return) ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) (none) ) - :post - (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) + :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) ) ;; failed to figure out what this is: (defstate swamp-bat-slave-return (swamp-bat-slave) - :event - swamp-bat-slave-event-handler - :code - (behavior () + :event swamp-bat-slave-event-handler + :code (behavior () (set! (-> self strafe-envelope) 0.0) - (ja-channel-push! 1 22) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! swamp-bat-strafe-ja) (let ((f30-0 (+ -1.0 (-> self path-point-count))) (gp-0 #t) ) - (while #t + (loop (let ((f28-0 (dummy-20 self))) (if (>= f28-0 f30-0) (go swamp-bat-slave-idle) @@ -461,29 +407,23 @@ swamp-bat-slave-event-handler ) ) ) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) ) (none) ) - :post - (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) + :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-path-post) ) ;; failed to figure out what this is: (defstate swamp-bat-slave-die (swamp-bat-slave) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior swamp-bat-slave) process-drawable-death-event-handler ) - :code - (behavior ((arg0 handle)) - (ja-channel-push! 1 21) + :code (behavior ((arg0 handle)) + (ja-channel-push! 1 (seconds 0.07)) (let ((gp-0 (new-stack-vector0))) (let ((v1-1 (handle->process arg0))) (if v1-1 @@ -492,24 +432,17 @@ swamp-bat-slave-event-handler ) (set! (-> gp-0 y) (+ -6144.0 (-> gp-0 y))) (vector-normalize! gp-0 98304.0) - (let ((v1-8 (-> self skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - ) + (ja :group! swamp-bat-die-ja) (until (ja-done? 0) (vector-v++! (-> self root-override trans) gp-0) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 0.5) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max 0.5)) (suspend) ) ) (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) + :post (the-as (function none :behavior swamp-bat-slave) swamp-bat-slave-post) ) ;; definition for function swamp-bat-slave-init-by-other @@ -644,15 +577,13 @@ swamp-bat-slave-event-handler ;; failed to figure out what this is: (defstate swamp-bat-idle (swamp-bat) - :trans - swamp-bat-debug - :code - (behavior () + :trans swamp-bat-debug + :code (behavior () (when (zero? (-> self path-count)) (process-entity-status! self (entity-perm-status dead) #t) (deactivate self) ) - (while #t + (loop (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) *target* (>= (-> self fact-override idle-distance) @@ -676,8 +607,7 @@ swamp-bat-slave-event-handler ) (none) ) - :post - (the-as (function none :behavior swamp-bat) #f) + :post (the-as (function none :behavior swamp-bat) #f) ) ;; definition for function swamp-bat-launch-slave @@ -700,12 +630,10 @@ swamp-bat-slave-event-handler ;; failed to figure out what this is: (defstate swamp-bat-launch-slaves (swamp-bat) - :trans - swamp-bat-debug - :code - (behavior () + :trans swamp-bat-debug + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (swamp-bat-update-path) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -717,8 +645,7 @@ swamp-bat-slave-event-handler ) (none) ) - :post - (the-as (function none :behavior swamp-bat) #f) + :post (the-as (function none :behavior swamp-bat) #f) ) ;; definition for method 11 of type swamp-bat @@ -763,15 +690,7 @@ swamp-bat-slave-event-handler (swamp-bat-setup-new-path 0) (swamp-bat-update-path) (dotimes (s5-1 (-> obj slave-count)) - (let ((s4-1 (get-process *default-dead-pool* swamp-bat-slave 4512))) - (when s4-1 - (let ((t9-16 (method-of-type swamp-bat-slave activate))) - (t9-16 (the-as swamp-bat-slave s4-1) obj 'swamp-bat-slave (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 swamp-bat-slave-init-by-other obj s5-1) - (-> s4-1 ppointer) - ) - ) + (process-spawn swamp-bat-slave obj s5-1 :to obj :stack-size 4512) ) (go swamp-bat-idle) (none) diff --git a/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc b/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc index 00b9e89ad9..39bd500c62 100644 --- a/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc @@ -1,14 +1,19 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/swamp-rock-ag.gc") +(import "goal_src/import/swamp-spike-ag.gc") +(import "goal_src/import/swampcam-ag.gc") +(import "goal_src/import/tar-plat-ag.gc") +(import "goal_src/import/balance-plat-ag.gc") + ;; failed to figure out what this is: (defpartgroup group-swamp-spike-up :id 289 :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1325 :fade-after (meters 120) :falloff-to (meters 120)) + :parts ((sp-item 1325 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1326 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1327 :fade-after (meters 60) :falloff-to (meters 60)) ) @@ -16,8 +21,7 @@ ;; failed to figure out what this is: (defpart 1325 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-int-flt spt-x (meters -2) 2 8192.0) (sp-flt spt-y (meters 0.75)) @@ -43,14 +47,12 @@ ;; failed to figure out what this is: (defpart 1328 - :init-specs - ((sp-flt spt-fade-a -0.32)) + :init-specs ((sp-flt spt-fade-a -0.32)) ) ;; failed to figure out what this is: (defpart 1326 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-int-flt spt-x (meters -2) 2 8192.0) (sp-flt spt-y (meters -0.75)) @@ -76,8 +78,7 @@ ;; failed to figure out what this is: (defpart 1327 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-int-flt spt-x (meters -2) 2 8192.0) (sp-flt spt-y (meters 0.25)) @@ -108,8 +109,7 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1325 :fade-after (meters 120) :falloff-to (meters 120)) + :parts ((sp-item 1325 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1326 :fade-after (meters 120) :falloff-to (meters 120)) ) ) @@ -145,13 +145,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *swamp-spike-sg* swamp-spike - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 5 0 6) - :longest-edge (meters 2.5) - ) +(defskelgroup *swamp-spike-sg* swamp-spike swamp-spike-lod0-jg swamp-spike-up-ja + ((swamp-spike-lod0-mg (meters 20)) (swamp-spike-lod1-mg (meters 999999))) + :bounds (static-spherem 0 5 0 6) + :longest-edge (meters 2.5) + ) ;; definition for function swamp-spike-default-event-handler (defbehavior swamp-spike-default-event-handler swamp-spike ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) @@ -200,25 +198,18 @@ ;; failed to figure out what this is: (defstate swamp-spike-idle (swamp-spike) - :event - swamp-spike-default-event-handler - :code - (behavior () + :event swamp-spike-default-event-handler + :code (behavior () (set! (-> self dangerous) #f) (let ((gp-0 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) (vector-z-quaternion! gp-0 (-> self root-override quat)) (set! (-> gp-0 w) (- (vector-dot gp-0 (-> self root-override trans)))) - (while #t + (loop (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((v1-10 (-> self skel root-channel 0))) - (set! (-> v1-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) (until (>= (get-current-phase (-> self sync)) 0.5) - (let ((v1-13 (-> self skel root-channel 0))) - (set! (-> v1-13 num-func) num-func-identity) - (set! (-> v1-13 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) (let ((s5-0 (or (not *target*) @@ -238,106 +229,53 @@ ) ) (else - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (when (logtest? (-> self draw status) (draw-status was-drawn)) - (let ((s5-3 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-3 - (let ((t9-11 (method-of-type part-tracker activate))) - (t9-11 (the-as part-tracker s5-3) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-3 - part-tracker-init - (-> *part-group-id-table* 289) - -1 - swamp-spike-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root-override trans) - ) - (-> s5-3 ppointer) + (if (logtest? (-> self draw status) (draw-status was-drawn)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 289) + -1 + swamp-spike-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root-override trans) + :to self ) ) - ) (set! (-> self dangerous) #t) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self dangerous) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((v1-96 (-> self skel root-channel 0))) - (set! (-> v1-96 num-func) num-func-identity) - (set! (-> v1-96 frame-num) (the float (+ (-> v1-96 frame-group data 0 length) -1))) - ) + (ja :num-func num-func-identity :frame-num max) (until (< (get-current-phase (-> self sync)) 0.5) (suspend) ) - (when (logtest? (-> self draw status) (draw-status was-drawn)) - (let ((s5-4 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-4 - (let ((t9-18 (method-of-type part-tracker activate))) - (t9-18 (the-as part-tracker s5-4) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-4 - part-tracker-init - (-> *part-group-id-table* 290) - -1 - swamp-spike-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root-override trans) - ) - (-> s5-4 ppointer) + (if (logtest? (-> self draw status) (draw-status was-drawn)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 290) + -1 + swamp-spike-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root-override trans) + :to self ) ) - ) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-29 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-29 param 1) 1.0) - (set! (-> a0-29 frame-num) 0.0) - (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 param 0) (the float (+ (-> a0-30 frame-group data 0 length) -1))) - (set! (-> a0-30 param 1) 1.0) - (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -346,14 +284,12 @@ ) (none) ) - :post - swamp-spike-post + :post swamp-spike-post ) ;; failed to figure out what this is: (defstate swamp-spike-gate-up (swampgate) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'trigger) (let ((v0-0 #t)) @@ -364,71 +300,43 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((v1-4 (-> self skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - ) + (ja :group! (-> self draw art-group data 4)) (until (-> self open-gate) - (let ((v1-7 (-> self skel root-channel 0))) - (set! (-> v1-7 num-func) num-func-identity) - (set! (-> v1-7 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) self 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 290) - -1 - swamp-spike-set-particle-rotation-callback - (-> self ppointer) - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) - ) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 290) + -1 + swamp-spike-set-particle-rotation-callback + (-> self ppointer) + #f + (-> self root-override trans) + :to self ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) 1.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go swamp-spike-gate-down) (none) ) - :post - (the-as (function none :behavior swampgate) swamp-spike-post) + :post (the-as (function none :behavior swampgate) swamp-spike-post) ) ;; failed to figure out what this is: (defstate swamp-spike-gate-down (swampgate) - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior swampgate) swamp-spike-post) + :post (the-as (function none :behavior swampgate) swamp-spike-post) ) ;; definition for method 20 of type swamp-spike @@ -463,7 +371,7 @@ (backup-collide-with-as s5-0) (set! (-> obj root-override) s5-0) ) - (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (process-drawable-from-entity! obj (-> obj entity)) (initialize-skeleton obj *swamp-spike-sg* '()) (set! (-> obj draw origin-joint-index) (the-as uint 3)) (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) @@ -546,18 +454,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *balance-plat-sg* balance-plat - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *balance-plat-sg* balance-plat balance-plat-lod0-jg balance-plat-idle-ja + ((balance-plat-lod0-mg (meters 20)) (balance-plat-lod1-mg (meters 40)) (balance-plat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) ;; failed to figure out what this is: (defstate balance-plat-idle (balance-plat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'grow) (let ((v0-0 #t)) @@ -568,17 +472,15 @@ ) ) ) - :trans - (the-as (function none :behavior balance-plat) rider-trans) - :code - (behavior () - (while #t + :trans (the-as (function none :behavior balance-plat) rider-trans) + :code (behavior () + (loop (let ((f30-0 (* -0.025 (+ (-> self y-offset) (-> self y-travel)))) (f28-0 (* -0.025 (- (-> self y-offset) (-> self y-travel)))) ) (cond ((and (-> self root-override riders) (nonzero? (-> self root-override riders num-riders))) - (send-event *target* 'no-look-around 75) + (send-event *target* 'no-look-around (seconds 0.25)) (set! (-> self y-accel) (fmin 4.096 (fmax -4.096 (+ -0.2048 (-> self y-accel))))) (set! (-> self y-vel) (fmin f28-0 (fmax f30-0 (+ (-> self y-vel) (-> self y-accel))))) (send-to-all-after (-> self link) 'grow) @@ -611,8 +513,7 @@ ) (none) ) - :post - (the-as (function none :behavior balance-plat) rider-post) + :post (the-as (function none :behavior balance-plat) rider-post) ) ;; definition for method 11 of type balance-plat @@ -680,8 +581,7 @@ :duration 300 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1330 :period 1500 :length 5) + :parts ((sp-item 1330 :period 1500 :length 5) (sp-item 1331 :period 1500 :length 5) (sp-item 1332 :period 1500 :length 15) ) @@ -689,8 +589,7 @@ ;; failed to figure out what this is: (defpart 1331 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 15)) (sp-copy-from-other spt-scale-y -4) @@ -706,8 +605,7 @@ ;; failed to figure out what this is: (defpart 1330 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 16.0 16.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -731,8 +629,7 @@ ;; failed to figure out what this is: (defpart 1332 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -757,46 +654,41 @@ ;; failed to figure out what this is: (defpart 1333 - :init-specs - ((sp-flt spt-fade-a -0.2)) + :init-specs ((sp-flt spt-fade-a -0.2)) ) ;; failed to figure out what this is: -(defskelgroup *swamp-rock-sg* swamp-rock - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *swamp-rock-sg* swamp-rock swamp-rock-lod0-jg swamp-rock-idle-ja + ((swamp-rock-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; failed to figure out what this is: (defstate swamp-rock-break (swamp-rock) - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (sound-play-by-name (static-sound-name "rock-break") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-1 - (let ((t9-4 (method-of-type part-tracker activate))) - (t9-4 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 291) -1 #f #f #f (-> self root trans)) - (-> gp-1 ppointer) - ) + (sound-play "rock-break") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 291) + -1 + #f + #f + #f + (-> self root trans) + :to *entity-pool* ) (cleanup-for-death self) (deactivate self) (none) ) - :post - (the-as (function none :behavior swamp-rock) ja-post) + :post (the-as (function none :behavior swamp-rock) ja-post) ) ;; failed to figure out what this is: (defstate swamp-rock-idle (swamp-rock) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (if (and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow)) @@ -805,10 +697,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t + (loop (logior! (-> self mask) (process-mask sleep)) (suspend) ) @@ -879,13 +770,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *tar-plat-sg* tar-plat - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *tar-plat-sg* tar-plat tar-plat-lod0-jg tar-plat-idle-ja + ((tar-plat-lod0-mg (meters 20)) (tar-plat-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) ;; definition for symbol *tar-plat-constants*, type rigid-body-platform-constants (define *tar-plat-constants* (new 'static 'rigid-body-platform-constants @@ -956,71 +844,55 @@ ;; failed to figure out what this is: (defstate rigid-body-platform-idle (tar-plat) :virtual #t - :enter - (behavior () + :enter (behavior () (ja-channel-set! 0) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior tar-plat) ja-post) + :post (the-as (function none :behavior tar-plat) ja-post) ) ;; failed to figure out what this is: (defstate rigid-body-platform-float (tar-plat) :virtual #t - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior tar-plat) rigid-body-platform-event-handler ) - :trans - (behavior () + :trans (behavior () (cond ((or (not *target*) (< (-> self info idle-distance) (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) ) ) (let ((f30-1 -2048.0)) - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) (if (= (-> self float-height-offset) f30-1) (go-virtual rigid-body-platform-idle) ) ) ) (else - (set! (-> self float-height-offset) - (seek (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) - ) + (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) ) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 30) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (let ((v1-5 (-> self skel root-channel 0))) - (set! (-> v1-5 num-func) num-func-identity) - (set! (-> v1-5 frame-num) 0.0) - ) - (while #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 3)) + (ja :num-func num-func-identity :frame-num 0.0) + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior tar-plat) rigid-body-platform-post) + :post (the-as (function none :behavior tar-plat) rigid-body-platform-post) ) ;; definition for method 30 of type tar-plat @@ -1137,13 +1009,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *swampcam-sg* swampcam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *swampcam-sg* swampcam swampcam-lod0-jg swampcam-anim-ja + ((swampcam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) ;; definition of type swamp-battlecontroller (deftype swamp-battlecontroller (battlecontroller) @@ -1165,23 +1034,14 @@ ;; failed to figure out what this is: (defstate battlecontroller-play-intro-camera (swamp-battlecontroller) :virtual #t - :code - (behavior () + :code (behavior () (suspend) (process-drawable-delay-player (seconds 1)) - (let* ((gp-0 (get-process *default-dead-pool* pov-camera #x4000)) - (gp-1 - (ppointer->handle - (when gp-0 - (let ((t9-2 (method-of-type pov-camera activate))) - (t9-2 (the-as pov-camera gp-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 pov-camera-init-by-other (-> self root trans) *swampcam-sg* "swamp-ambush" 0 #f '()) - (-> gp-0 ppointer) - ) - ) - ) - ) + (let ((gp-1 (ppointer->handle + (process-spawn pov-camera (-> self root trans) *swampcam-sg* "swamp-ambush" 0 #f '() :to self) + ) + ) + ) (while (handle->process (the-as handle gp-1)) (suspend) ) @@ -1194,8 +1054,7 @@ ;; failed to figure out what this is: (defstate battlecontroller-die (swamp-battlecontroller) :virtual #t - :code - (behavior () + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) ((the-as (function none :behavior battlecontroller) diff --git a/test/decompiler/reference/levels/swamp/swamp-part_REF.gc b/test/decompiler/reference/levels/swamp/swamp-part_REF.gc index 40462bb1a7..2580860600 100644 --- a/test/decompiler/reference/levels/swamp/swamp-part_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-part_REF.gc @@ -22,8 +22,7 @@ (defpartgroup group-swamp-bayou-billy-hut :id 302 :bounds (static-bspherem -4 -3 0 12) - :parts - ((sp-item 1377 :fade-after (meters 175) :falloff-to (meters 175) :period 1500 :length 300) + :parts ((sp-item 1377 :fade-after (meters 175) :falloff-to (meters 175) :period 1500 :length 300) (sp-item 1377 :fade-after (meters 175) :falloff-to (meters 175) :period 2928 :length 360) (sp-item 1377 :fade-after (meters 175) :falloff-to (meters 175) :period 4602 :length 180) (sp-item 1378 :fade-after (meters 175) :falloff-to (meters 175) :period 1500 :length 300) @@ -104,8 +103,7 @@ ;; failed to figure out what this is: (defpart 2305 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-x (meters 6)) (sp-flt spt-y (meters -13)) @@ -123,14 +121,12 @@ ;; failed to figure out what this is: (defpart 2308 - :init-specs - ((sp-int spt-timer 300) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2308)) + :init-specs ((sp-int spt-timer 300) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 2308)) ) ;; failed to figure out what this is: (defpart 2306 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-x (meters 5)) (sp-flt spt-y (meters -13.5)) @@ -148,8 +144,7 @@ ;; failed to figure out what this is: (defpart 2307 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 8.0) (sp-flt spt-x (meters 6.5)) (sp-flt spt-y (meters -12.5)) @@ -167,8 +162,7 @@ ;; failed to figure out what this is: (defpart 2303 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-int spt-num 1065353216 1 2.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 0.5) (meters 1) 1.0) @@ -191,8 +185,7 @@ ;; failed to figure out what this is: (defpart 2304 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 3.0) (sp-flt spt-scale-x (meters 0.075)) @@ -209,8 +202,7 @@ ;; failed to figure out what this is: (defpart 1384 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 15) (meters 30) 1.0) (sp-rnd-flt spt-y (meters 14) (meters 3) 1.0) @@ -232,8 +224,7 @@ ;; failed to figure out what this is: (defpart 1385 - :init-specs - ((sp-flt spt-g 128.0) + :init-specs ((sp-flt spt-g 128.0) (sp-flt spt-vel-x (meters 0)) (sp-flt spt-vel-y (meters 0)) (sp-flt spt-vel-z (meters 0)) @@ -247,8 +238,7 @@ ;; failed to figure out what this is: (defpart 1386 - :init-specs - ((sp-flt spt-b 128.0) + :init-specs ((sp-flt spt-b 128.0) (sp-rnd-int spt-accel-x -1070677186 1 5.4613333) (sp-rnd-int spt-accel-z -1070677186 1 5.4613333) ) @@ -256,8 +246,7 @@ ;; failed to figure out what this is: (defpart 1383 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 15) (meters 30) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 3) 1.0) @@ -279,8 +268,7 @@ ;; failed to figure out what this is: (defpart 1375 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -305,8 +293,7 @@ ;; failed to figure out what this is: (defpart 1387 - :init-specs - ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) (sp-rnd-flt spt-vel-y (meters -0.0074074077) (meters 0.0148148155) 1.0) (sp-rnd-flt spt-rotvel-z (degrees -0.4) (degrees 0.8) 1.0) (sp-int-plain-rnd spt-next-time 150 449 1) @@ -316,8 +303,7 @@ ;; failed to figure out what this is: (defpart 1376 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 4.0) (sp-flt spt-scale-x (meters 1)) @@ -335,8 +321,7 @@ ;; failed to figure out what this is: (defpart 1377 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-flt spt-y (meters -0.25)) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) @@ -368,8 +353,7 @@ ;; failed to figure out what this is: (defpart 1378 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.9 1.0) (sp-rnd-flt spt-scale-x (meters 0.75) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -398,8 +382,7 @@ ;; failed to figure out what this is: (defpart 1379 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-flt spt-y (meters -0.25)) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) @@ -431,8 +414,7 @@ ;; failed to figure out what this is: (defpart 1380 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -461,8 +443,7 @@ ;; failed to figure out what this is: (defpart 1381 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.9 1.0) (sp-flt spt-x (meters -7.8)) (sp-flt spt-y (meters -8.5)) @@ -493,8 +474,7 @@ ;; failed to figure out what this is: (defpart 1382 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-flt spt-x (meters -7.8)) (sp-flt spt-y (meters -8.5)) @@ -527,8 +507,7 @@ (defpartgroup group-swamp-bubbles-01 :id 303 :bounds (static-bspherem 0 0 -8 30) - :parts - ((sp-item 1390 :fade-after (meters 125) :period 150 :length 5 :binding 1388) + :parts ((sp-item 1390 :fade-after (meters 125) :period 150 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -583,8 +562,7 @@ ;; failed to figure out what this is: (defpart 1390 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 35) 1.0) (sp-rnd-flt spt-z (meters -35) (meters 55) 1.0) @@ -599,8 +577,7 @@ ;; failed to figure out what this is: (defpart 1388 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x20 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x20 :page #x2)) (sp-rnd-flt spt-num 0.05 0.1 1.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-z (meters -2) (meters 4) 1.0) @@ -622,20 +599,17 @@ ;; failed to figure out what this is: (defpart 1391 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 1050) (sp-launcher-by-id spt-next-launcher 1392)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 1050) (sp-launcher-by-id spt-next-launcher 1392)) ) ;; failed to figure out what this is: (defpart 1392 - :init-specs - ((sp-flt spt-g 0.0) (sp-flt spt-b 0.0) (sp-flt spt-a 0.0) (sp-int spt-timer 5)) + :init-specs ((sp-flt spt-g 0.0) (sp-flt spt-b 0.0) (sp-flt spt-a 0.0) (sp-int spt-timer 5)) ) ;; failed to figure out what this is: (defpart 1389 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -653,8 +627,7 @@ ;; failed to figure out what this is: (defpart 1393 - :init-specs - ((sp-rnd-flt spt-a 8.0 32.0 1.0) + :init-specs ((sp-rnd-flt spt-a 8.0 32.0 1.0) (sp-flt spt-scalevel-x (meters 0.04)) (sp-copy-from-other spt-scalevel-y -4) (sp-int spt-timer 5) @@ -665,8 +638,7 @@ (defpartgroup group-swamp-bubbles-02 :id 304 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1394 :fade-after (meters 125) :period 450 :length 5 :binding 1388) + :parts ((sp-item 1394 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -704,8 +676,7 @@ ;; failed to figure out what this is: (defpart 1394 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -8) (meters 16) 1.0) (sp-rnd-flt spt-z (meters -20) (meters 40) 1.0) @@ -723,8 +694,7 @@ (defpartgroup group-swamp-bubbles-03 :id 305 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1395 :fade-after (meters 125) :period 450 :length 5 :binding 1388) + :parts ((sp-item 1395 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -779,8 +749,7 @@ ;; failed to figure out what this is: (defpart 1395 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -4) (meters 12) 1.0) (sp-rnd-flt spt-z (meters -40) (meters 60) 1.0) @@ -798,8 +767,7 @@ (defpartgroup group-swamp-bubbles-04 :id 306 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1396 :fade-after (meters 125) :period 150 :length 5 :binding 1388) + :parts ((sp-item 1396 :fade-after (meters 125) :period 150 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -854,8 +822,7 @@ ;; failed to figure out what this is: (defpart 1396 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -35) (meters 60) 1.0) (sp-rnd-flt spt-z (meters -12) (meters 18) 1.0) @@ -873,8 +840,7 @@ (defpartgroup group-swamp-bubbles-05 :id 307 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1397 :fade-after (meters 125) :period 600 :length 5 :binding 1388) + :parts ((sp-item 1397 :fade-after (meters 125) :period 600 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1389 :flags (start-dead launch-asap)) @@ -898,8 +864,7 @@ ;; failed to figure out what this is: (defpart 1397 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) (sp-rnd-flt spt-z (meters -6) (meters 12) 1.0) @@ -917,8 +882,7 @@ (defpartgroup group-swamp-bubbles-06 :id 308 :bounds (static-bspherem 0 0 0 40) - :parts - ((sp-item 1398 :fade-after (meters 200) :period 120 :length 5 :binding 1388) + :parts ((sp-item 1398 :fade-after (meters 200) :period 120 :length 5 :binding 1388) (sp-item 1399 :fade-after (meters 200) :period 450 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -992,8 +956,7 @@ ;; failed to figure out what this is: (defpart 1398 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -45) (meters 80) 1.0) (sp-rnd-flt spt-z (meters -20) (meters 40) 1.0) @@ -1009,8 +972,7 @@ ;; failed to figure out what this is: (defpart 1399 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 40) 1.0) (sp-rnd-flt spt-z (meters 18) (meters 15) 1.0) @@ -1028,8 +990,7 @@ (defpartgroup group-swamp-bubbles-07 :id 309 :bounds (static-bspherem 0 0 0 40) - :parts - ((sp-item 1400 :fade-after (meters 125) :period 450 :length 5 :binding 1388) + :parts ((sp-item 1400 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1401 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1402 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1403 :fade-after (meters 125) :period 600 :length 5 :binding 1388) @@ -1105,8 +1066,7 @@ ;; failed to figure out what this is: (defpart 1400 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 15) 1.0) (sp-rnd-flt spt-z (meters -8) (meters 38) 1.0) @@ -1122,8 +1082,7 @@ ;; failed to figure out what this is: (defpart 1401 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -17.5) (meters 10) 1.0) (sp-rnd-flt spt-z (meters -15) (meters 50) 1.0) @@ -1139,8 +1098,7 @@ ;; failed to figure out what this is: (defpart 1402 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 45) 1.0) (sp-rnd-flt spt-z (meters 21) (meters 8) 1.0) @@ -1156,8 +1114,7 @@ ;; failed to figure out what this is: (defpart 1403 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -33) (meters 6) 1.0) (sp-rnd-flt spt-z (meters -25) (meters 25) 1.0) @@ -1176,8 +1133,7 @@ (defpartgroup group-swamp-bubbles-08 :id 310 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1404 :fade-after (meters 125) :period 150 :length 5 :binding 1388) + :parts ((sp-item 1404 :fade-after (meters 125) :period 150 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -1220,8 +1176,7 @@ ;; failed to figure out what this is: (defpart 1404 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -18) (meters 45) 1.0) (sp-rnd-flt spt-z (meters -25) (meters 40) 1.0) @@ -1239,8 +1194,7 @@ (defpartgroup group-swamp-bubbles-09 :id 311 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1405 :fade-after (meters 125) :period 450 :length 5 :binding 1388) + :parts ((sp-item 1405 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -1270,8 +1224,7 @@ ;; failed to figure out what this is: (defpart 1405 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -20) (meters 42) 1.0) (sp-rnd-flt spt-z (meters -10) (meters 18) 1.0) @@ -1289,8 +1242,7 @@ (defpartgroup group-swamp-bubbles-10 :id 312 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1406 :fade-after (meters 125) :period 450 :length 5 :binding 1388) + :parts ((sp-item 1406 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -1333,8 +1285,7 @@ ;; failed to figure out what this is: (defpart 1406 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -30) (meters 52) 1.0) (sp-rnd-flt spt-z (meters -10) (meters 18) 1.0) @@ -1352,8 +1303,7 @@ (defpartgroup group-swamp-bubbles-11 :id 313 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1407 :fade-after (meters 125) :period 450 :length 5 :binding 1388) + :parts ((sp-item 1407 :fade-after (meters 125) :period 450 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -1396,8 +1346,7 @@ ;; failed to figure out what this is: (defpart 1407 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -14) (meters 22) 1.0) (sp-rnd-flt spt-z (meters -13) (meters 30) 1.0) @@ -1415,8 +1364,7 @@ (defpartgroup group-swamp-bubbles-12 :id 314 :bounds (static-bspherem 0 0 0 40) - :parts - ((sp-item 1408 :fade-after (meters 125) :period 150 :length 5 :binding 1388) + :parts ((sp-item 1408 :fade-after (meters 125) :period 150 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -1446,8 +1394,7 @@ ;; failed to figure out what this is: (defpart 1408 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 33) 1.0) (sp-rnd-flt spt-z (meters -13) (meters 70) 1.0) @@ -1465,8 +1412,7 @@ (defpartgroup group-swamp-bubbles-13 :id 315 :bounds (static-bspherem 0 0 0 10) - :parts - ((sp-item 1409 :fade-after (meters 125) :period 600 :length 5 :binding 1388) + :parts ((sp-item 1409 :fade-after (meters 125) :period 600 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -1496,8 +1442,7 @@ ;; failed to figure out what this is: (defpart 1409 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -8) (meters 20) 1.0) (sp-rnd-flt spt-z (meters -8) (meters 20) 1.0) @@ -1515,8 +1460,7 @@ (defpartgroup group-swamp-bubbles-14 :id 316 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 1410 :fade-after (meters 125) :period 120 :length 5 :binding 1388) + :parts ((sp-item 1410 :fade-after (meters 125) :period 120 :length 5 :binding 1388) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) (sp-item 1388 :flags (start-dead) :binding 1389) @@ -1559,8 +1503,7 @@ ;; failed to figure out what this is: (defpart 1410 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -35) (meters 50) 1.0) (sp-rnd-flt spt-z (meters -40) (meters 55) 1.0) @@ -1578,8 +1521,7 @@ (defpartgroup group-swamp-torch :id 317 :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 1411 :fade-after (meters 200) :falloff-to (meters 220)) + :parts ((sp-item 1411 :fade-after (meters 200) :falloff-to (meters 220)) (sp-item 1412 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 1413 :fade-after (meters 50) :falloff-to (meters 50) :period 600 :length 90) (sp-item 1414 :fade-after (meters 50) :falloff-to (meters 50) :period 369 :length 69) @@ -1590,8 +1532,7 @@ ;; failed to figure out what this is: (defpart 1416 - :init-specs - ((sp-flt spt-num 0.3) + :init-specs ((sp-flt spt-num 0.3) (sp-flt spt-x (meters 0.2)) (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0) (sp-int spt-rot-x 5) @@ -1610,14 +1551,12 @@ ;; failed to figure out what this is: (defpart 1417 - :init-specs - ((sp-flt spt-fade-b -6.826667)) + :init-specs ((sp-flt spt-fade-b -6.826667)) ) ;; failed to figure out what this is: (defpart 1411 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1069547520 1 1.0) (sp-rnd-flt spt-x (meters -0.35) (meters 0.7) 1.0) (sp-rnd-flt spt-z (meters -0.35) (meters 0.7) 1.0) @@ -1640,14 +1579,12 @@ ;; failed to figure out what this is: (defpart 1418 - :init-specs - ((sp-flt spt-fade-a -1.3333334)) + :init-specs ((sp-flt spt-fade-a -1.3333334)) ) ;; failed to figure out what this is: (defpart 1413 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters 1)) @@ -1671,8 +1608,7 @@ ;; failed to figure out what this is: (defpart 1414 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -0.2) (meters 0.6) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1696,8 +1632,7 @@ ;; failed to figure out what this is: (defpart 1415 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 0.2) 1.0) (sp-flt spt-y (meters 0.6)) @@ -1721,8 +1656,7 @@ ;; failed to figure out what this is: (defpart 1412 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters 0.3)) diff --git a/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc b/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc index 13c281039b..f783602882 100644 --- a/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc @@ -1,14 +1,15 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/swamp-rat-nest-ag.gc") + ;; failed to figure out what this is: (defpartgroup group-swamp-rat-nest-a-explosion :id 292 :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1334) (sp-item 1335) (sp-item 1336) (sp-item 1337) (sp-item 1338) (sp-item 1339)) + :parts ((sp-item 1334) (sp-item 1335) (sp-item 1336) (sp-item 1337) (sp-item 1338) (sp-item 1339)) ) ;; failed to figure out what this is: @@ -17,8 +18,7 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1342) (sp-item 1339) (sp-item 1337) (sp-item 1334)) + :parts ((sp-item 1342) (sp-item 1339) (sp-item 1337) (sp-item 1334)) ) ;; failed to figure out what this is: @@ -27,8 +27,7 @@ :duration 5 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1335) (sp-item 1339) (sp-item 1337) (sp-item 1334)) + :parts ((sp-item 1335) (sp-item 1339) (sp-item 1337) (sp-item 1334)) ) ;; failed to figure out what this is: @@ -36,8 +35,7 @@ :id 295 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1346) (sp-item 1347) (sp-item 1348)) + :parts ((sp-item 1346) (sp-item 1347) (sp-item 1348)) ) ;; failed to figure out what this is: @@ -45,8 +43,7 @@ :id 296 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1350) (sp-item 1351)) + :parts ((sp-item 1350) (sp-item 1351)) ) ;; failed to figure out what this is: @@ -54,14 +51,12 @@ :id 297 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1353) (sp-item 1354)) + :parts ((sp-item 1353) (sp-item 1354)) ) ;; failed to figure out what this is: (defpart 1353 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 1.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -87,8 +82,7 @@ ;; failed to figure out what this is: (defpart 1354 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.05) 1.0) @@ -112,8 +106,7 @@ ;; failed to figure out what this is: (defpart 1355 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -4.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -139,8 +132,7 @@ ;; failed to figure out what this is: (defpart 1350 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -166,8 +158,7 @@ ;; failed to figure out what this is: (defpart 1351 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -1) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.05) 1.0) @@ -191,8 +182,7 @@ ;; failed to figure out what this is: (defpart 1352 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -10.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -218,8 +208,7 @@ ;; failed to figure out what this is: (defpart 1334 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 1)) (sp-flt spt-scale-x (meters 16)) @@ -237,8 +226,7 @@ ;; failed to figure out what this is: (defpart 1341 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -12)) (sp-flt spt-scale-x (meters 16)) @@ -256,8 +244,7 @@ ;; failed to figure out what this is: (defpart 1339 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 8.0 8.0 1.0) (sp-rnd-flt spt-y (meters -1) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.75) (meters 1) 1.0) @@ -284,8 +271,7 @@ ;; failed to figure out what this is: (defpart 1335 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 16.0 8.0 1.0) (sp-rnd-flt spt-y (meters -2) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -311,8 +297,7 @@ ;; failed to figure out what this is: (defpart 1340 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 10.0 5.0 1.0) (sp-rnd-flt spt-y (meters -12) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -338,8 +323,7 @@ ;; failed to figure out what this is: (defpart 1336 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 12.0 8.0 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 0.25) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -365,8 +349,7 @@ ;; failed to figure out what this is: (defpart 1337 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 8.0 16.0 1.0) (sp-rnd-flt spt-y (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.6) 1.0) @@ -391,8 +374,7 @@ ;; failed to figure out what this is: (defpart 1338 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 32.0 32.0 1.0) (sp-rnd-flt spt-y (meters 2) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.25) (meters 0.5) 1.0) @@ -417,8 +399,7 @@ ;; failed to figure out what this is: (defpart 1346 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -444,8 +425,7 @@ ;; failed to figure out what this is: (defpart 1349 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -12) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -471,8 +451,7 @@ ;; failed to figure out what this is: (defpart 1347 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.05) 1.0) @@ -496,8 +475,7 @@ ;; failed to figure out what this is: (defpart 1348 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x17 :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-y (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-x (meters 0.25) (meters 0.5) 1.0) @@ -521,8 +499,7 @@ ;; failed to figure out what this is: (defpart 1342 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 20.0 8.0 1.0) (sp-rnd-flt spt-y (meters -3.5) (meters 2.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -548,8 +525,7 @@ ;; failed to figure out what this is: (defpart 1343 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 16.0 5.0 1.0) (sp-rnd-flt spt-y (meters -10.5) (meters 2.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -575,8 +551,7 @@ ;; failed to figure out what this is: (defpart 1344 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num -5.0) (sp-flt spt-y (meters -12)) (sp-flt spt-scale-x (meters 16)) @@ -594,8 +569,7 @@ ;; failed to figure out what this is: (defpart 1345 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 12.0 4.0 1.0) (sp-rnd-flt spt-y (meters -4) (meters 1.5) 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 2.5) 1.0) @@ -761,7 +735,7 @@ (let* ((a0-0 (-> self spawn-joint-array gp-0)) (a2-0 (-> self node-list data a0-0 bone transform)) ) - (add-debug-matrix #t (bucket-id debug-draw1) a2-0) + (add-debug-matrix #t (bucket-id debug-no-zbuf) a2-0) ) ) #f @@ -796,7 +770,7 @@ ((and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow)) (swamp-rat-nest-dummy-take-damage 3) (if (< (vector-vector-distance (target-pos 0) (-> self top-sphere)) (-> self top-sphere w)) - (send-event *target* 'no-look-around 75) + (send-event *target* 'no-look-around (seconds 0.25)) ) (go swamp-rat-nest-dummy-hit) ) @@ -820,153 +794,73 @@ ;; failed to figure out what this is: (defstate swamp-rat-nest-dummy-idle (swamp-rat-nest-dummy) - :event - swamp-rat-nest-dummy-event-handler - :code - (behavior () - (while #t - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 num-func) num-func-identity) - (set! (-> v1-2 frame-num) (the float (+ (-> v1-2 frame-group data 0 length) -1))) - ) + :event swamp-rat-nest-dummy-event-handler + :code (behavior () + (loop + (ja :num-func num-func-identity :frame-num max) (suspend) ) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) + :post (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) ) ;; failed to figure out what this is: (defstate swamp-rat-nest-dummy-hit (swamp-rat-nest-dummy) - :event - swamp-rat-nest-dummy-event-handler - :enter - (behavior () + :event swamp-rat-nest-dummy-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (if (<= (-> self parent-process 0 hit-points) 0) (go swamp-rat-nest-dummy-die) ) (none) ) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (< (-> self parent-process 0 hit-points) 3) (spawn (-> self part) (-> self node-list data (-> self particle-spawn-joint) bone transform vector 3)) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go swamp-rat-nest-dummy-idle) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) + :post (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) ) ;; failed to figure out what this is: (defstate swamp-rat-nest-dummy-shake (swamp-rat-nest-dummy) - :event - swamp-rat-nest-dummy-event-handler - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :event swamp-rat-nest-dummy-event-handler + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go swamp-rat-nest-dummy-idle) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) + :post (the-as (function none :behavior swamp-rat-nest-dummy) transform-post) ) ;; failed to figure out what this is: (defstate swamp-rat-nest-dummy-die (swamp-rat-nest-dummy) - :event - (the-as (function process int symbol event-message-block object :behavior swamp-rat-nest-dummy) #f) - :code - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior swamp-rat-nest-dummy) #f) + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self parent-process 0 dummy) (the-as (pointer swamp-rat-nest-dummy) #f)) - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (when gp-0 - (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> self death-part) - -1 - #f - #f - #f - (-> self node-list data (-> self particle-spawn-joint) bone transform vector 3) - ) - (-> gp-0 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> self death-part) + -1 + #f + #f + #f + (-> self node-list data (-> self particle-spawn-joint) bone transform vector 3) + :to *entity-pool* ) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (suspend) @@ -987,14 +881,14 @@ (let ((gp-0 (-> arg0 entity))) (set! (-> self mask) (logior (process-mask enemy) (-> self mask))) (dummy-20 self) - (process-drawable-from-entity! self (the-as entity-actor gp-0)) + (process-drawable-from-entity! self gp-0) (set! (-> self top-sphere quad) (-> self root-override trans quad)) (set! (-> self top-sphere y) (+ 24576.0 (-> self top-sphere y))) (set! (-> self top-sphere w) 18432.0) (set! (-> self entity) gp-0) ) (set! (-> self nav) (new 'process 'nav-control (-> self root-override) 16 40960.0)) - (logior! (-> self nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> self nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set-current-poly! (-> self nav) (find-poly (-> self nav) (-> self root-override trans))) (+! (-> self parent-process 0 hit-points) 3) (dummy-21 self) @@ -1047,30 +941,27 @@ swamp-rat-nest-default-event-handler ) ;; definition for function swamp-rat-nest-spawn-rat +;; INFO: Return type mismatch (pointer process) vs (pointer swamp-rat). ;; WARN: Function may read a register that is not set: t2 ;; Used lq/sq (defbehavior swamp-rat-nest-spawn-rat swamp-rat-nest () (local-vars (t2-0 none)) - (when (and (-> self dummy) (> (-> self dummy 0 spawn-joint-count) 0)) - (let* ((v1-5 (swamp-rat-nest-pick-spawn-joint)) - (v1-8 (-> self dummy 0 node-list data v1-5 bone)) - (gp-0 (new 'stack-no-clear 'vector)) - ) - (set! (-> gp-0 quad) (-> v1-8 transform vector 3 quad)) - (let ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> v1-8 transform vector 1) 1.0)) - (s4-0 (if (= (-> self fact-override pickup-type) (pickup-type none)) - 0 - 9 - ) - ) - (s3-0 (get-process *default-dead-pool* swamp-rat #x4000)) - ) - (when s3-0 - (let ((t9-3 (method-of-type swamp-rat activate))) - (t9-3 (the-as swamp-rat s3-0) self 'swamp-rat (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 swamp-rat-init-by-other self gp-0 s5-0 s4-0 t2-0) - (-> s3-0 ppointer) + (the-as + (pointer swamp-rat) + (when (and (-> self dummy) (> (-> self dummy 0 spawn-joint-count) 0)) + (let* ((v1-5 (swamp-rat-nest-pick-spawn-joint)) + (v1-8 (-> self dummy 0 node-list data v1-5 bone)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> v1-8 transform vector 3 quad)) + (let ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> v1-8 transform vector 1) 1.0)) + (s4-0 (if (= (-> self fact-override pickup-type) (pickup-type none)) + 0 + 9 + ) + ) + ) + (process-spawn swamp-rat self gp-0 s5-0 s4-0 t2-0 :to self) ) ) ) @@ -1084,52 +975,19 @@ swamp-rat-nest-default-event-handler (let ((v1-1 (-> self dummy-type))) (cond ((zero? v1-1) - (let ((gp-0 (get-process *default-dead-pool* swamp-rat-nest-dummy-a #x4000))) - (set! (-> self dummy) - (the-as - (pointer swamp-rat-nest-dummy) - (when gp-0 - (let ((t9-1 (method-of-type swamp-rat-nest-dummy-a activate))) - (t9-1 (the-as swamp-rat-nest-dummy-a gp-0) self 'swamp-rat-nest-dummy-a (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 swamp-rat-nest-dummy-init-by-other self) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self dummy) + (process-spawn swamp-rat-nest-dummy-a :init swamp-rat-nest-dummy-init-by-other self :to self) + ) ) ((= v1-1 1) - (let ((gp-1 (get-process *default-dead-pool* swamp-rat-nest-dummy-b #x4000))) - (set! (-> self dummy) - (the-as - (pointer swamp-rat-nest-dummy) - (when gp-1 - (let ((t9-4 (method-of-type swamp-rat-nest-dummy-b activate))) - (t9-4 (the-as swamp-rat-nest-dummy-b gp-1) self 'swamp-rat-nest-dummy-b (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 swamp-rat-nest-dummy-init-by-other self) - (-> gp-1 ppointer) - ) - ) - ) - ) + (set! (-> self dummy) + (process-spawn swamp-rat-nest-dummy-b :init swamp-rat-nest-dummy-init-by-other self :to self) + ) ) ((= v1-1 2) - (let ((gp-2 (get-process *default-dead-pool* swamp-rat-nest-dummy-c #x4000))) - (set! (-> self dummy) - (the-as - (pointer swamp-rat-nest-dummy) - (when gp-2 - (let ((t9-7 (method-of-type swamp-rat-nest-dummy-c activate))) - (t9-7 (the-as swamp-rat-nest-dummy-c gp-2) self 'swamp-rat-nest-dummy-c (the-as pointer #x70004000)) - ) - (run-now-in-process gp-2 swamp-rat-nest-dummy-init-by-other self) - (-> gp-2 ppointer) - ) - ) - ) - ) + (set! (-> self dummy) + (process-spawn swamp-rat-nest-dummy-c :init swamp-rat-nest-dummy-init-by-other self :to self) + ) ) (else (go swamp-rat-nest-die) @@ -1144,21 +1002,18 @@ swamp-rat-nest-default-event-handler ;; failed to figure out what this is: (defstate swamp-rat-nest-idle (swamp-rat-nest) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hit) (go swamp-rat-nest-active) ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= (-> self fact-override idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)) ) @@ -1167,29 +1022,24 @@ swamp-rat-nest-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (swamp-rat-nest-check-dummy) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest) #f) + :post (the-as (function none :behavior swamp-rat-nest) #f) ) ;; failed to figure out what this is: (defstate swamp-rat-nest-active (swamp-rat-nest) - :event - swamp-rat-nest-default-event-handler - :enter - (behavior () + :event swamp-rat-nest-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (swamp-rat-nest-check-dummy) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self test-interval)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1210,28 +1060,23 @@ swamp-rat-nest-default-event-handler ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest) #f) + :post (the-as (function none :behavior swamp-rat-nest) #f) ) ;; failed to figure out what this is: (defstate swamp-rat-nest-gestate (swamp-rat-nest) - :event - swamp-rat-nest-default-event-handler - :enter - (behavior () + :event swamp-rat-nest-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (swamp-rat-nest-check-dummy) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the int (* (-> self spawn-period-scale) (-> self spawn-period))) @@ -1242,23 +1087,19 @@ swamp-rat-nest-default-event-handler ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest) #f) + :post (the-as (function none :behavior swamp-rat-nest) #f) ) ;; failed to figure out what this is: (defstate swamp-rat-nest-victory (swamp-rat-nest) - :event - (the-as (function process int symbol event-message-block object :behavior swamp-rat-nest) #f) - :code - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior swamp-rat-nest) #f) + :code (behavior () (let ((gp-0 (the-as (pointer process-tree) (-> self child-process)))) (while gp-0 (let* ((s5-0 (ppointer->process gp-0)) @@ -1277,16 +1118,13 @@ swamp-rat-nest-default-event-handler (go swamp-rat-nest-active) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest) #f) + :post (the-as (function none :behavior swamp-rat-nest) #f) ) ;; failed to figure out what this is: (defstate swamp-rat-nest-die (swamp-rat-nest) - :event - swamp-rat-nest-default-event-handler - :code - (behavior () + :event swamp-rat-nest-default-event-handler + :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) (process-entity-status! self (entity-perm-status dead) #t) (drop-pickup (-> self fact-override) #t *entity-pool* (-> self fact-override) 0) @@ -1295,8 +1133,7 @@ swamp-rat-nest-default-event-handler ) (none) ) - :post - (the-as (function none :behavior swamp-rat-nest) #f) + :post (the-as (function none :behavior swamp-rat-nest) #f) ) ;; definition for method 11 of type swamp-rat-nest @@ -1332,31 +1169,22 @@ swamp-rat-nest-default-event-handler ) ;; failed to figure out what this is: -(defskelgroup *swamp-rat-nest-dummy-a-sg* swamp-rat-nest - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *swamp-rat-nest-dummy-a-sg* swamp-rat-nest swamp-rat-nest-a-lod0-jg swamp-rat-nest-a-idle-ja + ((swamp-rat-nest-a-lod0-mg (meters 20)) (swamp-rat-nest-a-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; failed to figure out what this is: -(defskelgroup *swamp-rat-nest-dummy-b-sg* swamp-rat-nest - 4 - 7 - ((5 (meters 20)) (6 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *swamp-rat-nest-dummy-b-sg* swamp-rat-nest swamp-rat-nest-b-lod0-jg swamp-rat-nest-b-idle-ja + ((swamp-rat-nest-b-lod0-mg (meters 20)) (swamp-rat-nest-b-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; failed to figure out what this is: -(defskelgroup *swamp-rat-nest-dummy-c-sg* swamp-rat-nest - 8 - 11 - ((9 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *swamp-rat-nest-dummy-c-sg* swamp-rat-nest swamp-rat-nest-c-lod0-jg swamp-rat-nest-c-idle-ja + ((swamp-rat-nest-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) ;; definition for method 20 of type swamp-rat-nest-dummy-a (defmethod dummy-20 swamp-rat-nest-dummy-a ((obj swamp-rat-nest-dummy-a)) diff --git a/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc b/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc index 8809656567..5bc2b97256 100644 --- a/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/swamp-rat-ag.gc") + ;; definition of type swamp-rat (deftype swamp-rat (nav-enemy) ((up-vector vector :inline :offset-assert 400) @@ -44,13 +46,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *swamp-rat-sg* swamp-rat - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 1 0 4) - :longest-edge (meters 1) - ) +(defskelgroup *swamp-rat-sg* swamp-rat swamp-rat-lod0-jg swamp-rat-idle-ja + ((swamp-rat-lod0-mg (meters 20)) (swamp-rat-lod1-mg (meters 40)) (swamp-rat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 4) + :longest-edge (meters 1) + ) ;; definition for method 44 of type swamp-rat (defmethod dummy-44 swamp-rat ((obj swamp-rat) (arg0 process) (arg1 event-message-block)) @@ -94,7 +94,7 @@ swamp-rat-default-event-handler ;; definition for method 39 of type swamp-rat ;; Used lq/sq (defmethod common-post swamp-rat ((obj swamp-rat)) - (when (logtest? (-> obj collide-info status) 1) + (when (logtest? (-> obj collide-info status) (cshape-moving-flags onsurf)) (vector-deg-seek (-> obj up-vector) (-> obj up-vector) (-> obj collide-info surface-normal) 910.2222) (vector-normalize! (-> obj up-vector) 1.0) ) @@ -134,10 +134,8 @@ swamp-rat-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-idle (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :post - (behavior () + :event swamp-rat-default-event-handler + :post (behavior () (ja-post) (none) ) @@ -146,36 +144,17 @@ swamp-rat-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-patrol (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :code - (behavior () + :event swamp-rat-default-event-handler + :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - ) - (set! (-> a0-1 param 0) - (the float - (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) data 0 length) -1) - ) - ) - (set! (-> a0-1 param 1) f30-0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! - a0-1 - (the-as art-joint-anim (-> self draw art-group data (-> self nav-info walk-anim))) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) f30-0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) ) @@ -186,36 +165,17 @@ swamp-rat-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-notice (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 param 0) 1.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim #f) num-func-loop!) - ) - (ja-channel-push! 1 51) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> gp-0 param 0) (ja-aframe 30.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + :event swamp-rat-default-event-handler + :code (behavior () + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.17)) + (ja-no-eval :group! swamp-rat-notice-ja :num! (seek! (ja-aframe 30.0 0)) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 30.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-seek!) + (ja :num! (seek! (ja-aframe 30.0 0))) ) + (ja-no-eval :num! (seek!)) (go-virtual nav-enemy-chase) (none) ) @@ -261,46 +221,32 @@ swamp-rat-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-chase (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :trans - (behavior () + :event swamp-rat-default-event-handler + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self chase-rest-time)) (go-virtual nav-enemy-victory) ) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self target-nav-time) (-> *display* base-frame-counter)) (set! (-> self wiggle-time) (+ (-> *display* base-frame-counter) (seconds -10))) (set! (-> self wiggle-angle) 0.0) (set! (-> self chase-rest-time) (rand-vu-int-range (seconds 1) (seconds 4))) - (ja-channel-push! 1 51) - (let ((gp-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - gp-0 - (the-as art-joint-anim (-> self draw art-group data 9)) - num-func-identity - ) - (set! (-> gp-0 frame-num) 0.0) - ) - (while #t + (ja-channel-push! 1 (seconds 0.17)) + (ja :group! swamp-rat-run-ja :num! min) + (loop (when (>= (- (-> *display* base-frame-counter) (-> self wiggle-time)) (seconds 1)) (set! (-> self wiggle-time) (-> *display* base-frame-counter)) (swamp-rat-update-wiggle-params) ) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) (none) ) - :post - (behavior () + :post (behavior () (swamp-rat-update-wiggle-target (target-pos 0)) (nav-enemy-travel-post) (none) @@ -310,55 +256,33 @@ swamp-rat-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-stop-chase (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :code - (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) + :event swamp-rat-default-event-handler + :code (-> (method-of-type nav-enemy nav-enemy-stop-chase) code) ) ;; failed to figure out what this is: (defstate nav-enemy-stare (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :code - (behavior () + :event swamp-rat-default-event-handler + :code (behavior () (set! (-> self rotate-speed) 1456355.5) - (set! (-> self turn-time) (seconds 0.07333333)) + (set! (-> self turn-time) (seconds 0.075)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) - (while #t - (logior! (-> self nav-enemy-flags) 16) - (ja-channel-push! 1 30) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) data 0 length) -1)) - ) - (set! (-> a0-2 param 1) f30-0) - (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!) - ) + (loop + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! swamp-rat-celebrate-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1))) - (set! (-> a0-3 param 1) f30-0) - (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) 1.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) - ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (ja-no-eval :num! (loop!)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((gp-0 (rand-vu-int-range 300 600)) (s5-0 (-> *display* base-frame-counter)) ) (until (>= (- (-> *display* base-frame-counter) s5-0) gp-0) - (let ((v1-33 (-> self skel root-channel 0))) - (set! (-> v1-33 num-func) num-func-identity) - (set! (-> v1-33 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (ja-blend-eval) (suspend) (suspend) @@ -373,39 +297,17 @@ swamp-rat-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-give-up (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :code - (behavior () - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :event swamp-rat-default-event-handler + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! swamp-rat-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) 1.0) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! swamp-rat-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek-to-point-toward-point! (-> self collide-info) @@ -414,11 +316,7 @@ swamp-rat-default-event-handler (-> self turn-time) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-patrol) (none) @@ -428,27 +326,13 @@ swamp-rat-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-attack (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :code - (behavior () - (ja-channel-push! 1 22) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + :event swamp-rat-default-event-handler + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! swamp-rat-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go-virtual nav-enemy-victory) (none) @@ -458,18 +342,14 @@ swamp-rat-default-event-handler ;; failed to figure out what this is: (defstate nav-enemy-victory (swamp-rat) :virtual #t - :event - swamp-rat-default-event-handler - :code - (-> (method-of-type nav-enemy nav-enemy-victory) code) + :event swamp-rat-default-event-handler + :code (-> (method-of-type nav-enemy nav-enemy-victory) code) ) ;; failed to figure out what this is: (defstate swamp-rat-spawn (swamp-rat) - :event - swamp-rat-default-event-handler - :code - (behavior () + :event swamp-rat-default-event-handler + :code (behavior () (let ((gp-0 (new-stack-vector0))) (set! (-> gp-0 x) 0.0) (set! (-> gp-0 y) (- (-> *standard-dynamics* gravity-length))) @@ -477,15 +357,8 @@ swamp-rat-default-event-handler (set! (-> gp-0 w) 1.0) (let ((f30-0 0.125)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((s5-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data 5)) - num-func-identity - ) - (set! (-> s5-0 frame-num) 0.0) - ) - (while #t + (ja :group! swamp-rat-fall-ja :num! min) + (loop (set! f30-0 (seek f30-0 1.5 0.1)) (vector-v++! (-> self collide-info transv) gp-0) (integrate-for-enemy-with-move-to-ground! @@ -497,7 +370,7 @@ swamp-rat-default-event-handler #f #f ) - (when (or (logtest? (-> self collide-info status) 4) + (when (or (logtest? (-> self collide-info status) (cshape-moving-flags tsurf)) (or (< (-> self collide-info trans y) (-> self min-height)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) ) @@ -506,10 +379,7 @@ swamp-rat-default-event-handler (goto cfg-13) ) (vector-float*! (-> self collide-info scale) *identity-vector* f30-0) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) (suspend) ) ) @@ -520,22 +390,10 @@ swamp-rat-default-event-handler ) (set! (-> self collide-info transv quad) (-> *null-vector* quad)) (vector-float*! (-> self collide-info scale) *identity-vector* 1.5) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! swamp-rat-bounce-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (if (TODO-RENAME-46 self (-> self nav-info stop-chase-distance)) (go-virtual nav-enemy-chase) @@ -543,8 +401,7 @@ swamp-rat-default-event-handler ) (none) ) - :post - (the-as (function none :behavior swamp-rat) nav-enemy-simple-post) + :post (the-as (function none :behavior swamp-rat) nav-enemy-simple-post) ) ;; definition for symbol *swamp-rat-nav-enemy-info*, type nav-enemy-info @@ -563,11 +420,11 @@ swamp-rat-default-event-handler :run-travel-speed (meters 7) :run-rotate-speed (degrees 7999.9995) :run-acceleration (meters 1) - :run-turn-time (seconds 0.07333333) + :run-turn-time (seconds 0.075) :walk-travel-speed (meters 2) :walk-rotate-speed (degrees 7999.9995) :walk-acceleration (meters 1) - :walk-turn-time (seconds 0.07333333) + :walk-turn-time (seconds 0.075) :attack-shove-back (meters 3) :attack-shove-up (meters 2) :shadow-size (meters 1) @@ -595,7 +452,7 @@ swamp-rat-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -642,7 +499,7 @@ swamp-rat-default-event-handler (set! (-> obj reaction-time) (rand-vu-int-range (seconds 0.1) (seconds 0.8))) (set! (-> obj chase-rest-time) (seconds 1)) (set! (-> obj water) (new 'process 'water-control obj 7 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (the-as uint 2)) + (set! (-> obj water flags) (water-flags wt01)) (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) (set! (-> obj water ripple-size) 12288.0) (set! (-> obj min-height) (+ -2048.0 (-> obj water height))) diff --git a/test/decompiler/reference/levels/title/title-obs_REF.gc b/test/decompiler/reference/levels/title/title-obs_REF.gc index fbdcd9044e..33a3af4de0 100644 --- a/test/decompiler/reference/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/levels/title/title-obs_REF.gc @@ -1,6 +1,14 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/logo-cam-ag.gc") +(import "goal_src/import/logo-black-ag.gc") +(import "goal_src/import/logo-ag.gc") +(import "goal_src/import/logo-volumes-ag.gc") +(import "goal_src/import/ndi-cam-ag.gc") +(import "goal_src/import/ndi-ag.gc") +(import "goal_src/import/ndi-volumes-ag.gc") + ;; definition of type logo (deftype logo (process-drawable) ((camera handle :offset-assert 176) @@ -86,91 +94,63 @@ ) ;; failed to figure out what this is: -(defskelgroup *logo-sg* logo - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *logo-sg* logo logo-english-lod0-jg logo-idle-ja + ((logo-english-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) ;; failed to figure out what this is: -(defskelgroup *logo-japan-sg* logo - 2 - 4 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *logo-japan-sg* logo logo-japan-lod0-jg logo-idle-ja + ((logo-japan-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) ;; failed to figure out what this is: -(defskelgroup *logo-volumes-sg* logo-volumes - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5.5) - :longest-edge (meters 0) - ) +(defskelgroup *logo-volumes-sg* logo-volumes logo-volumes-english-lod0-jg logo-volumes-idle-ja + ((logo-volumes-english-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + ) ;; failed to figure out what this is: -(defskelgroup *logo-volumes-japan-sg* logo-volumes - 2 - 4 - ((3 (meters 999999))) - :bounds (static-spherem 0 0 0 5.5) - :longest-edge (meters 0) - ) +(defskelgroup *logo-volumes-japan-sg* logo-volumes logo-volumes-japan-lod0-jg logo-volumes-idle-ja + ((logo-volumes-japan-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + ) ;; failed to figure out what this is: -(defskelgroup *logo-black-sg* logo-black - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5.5) - :longest-edge (meters 0) - ) +(defskelgroup *logo-black-sg* logo-black logo-black-lod0-jg logo-black-idle-ja + ((logo-black-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + ) ;; failed to figure out what this is: -(defskelgroup *logo-cam-sg* logo-cam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5.5) - :longest-edge (meters 0) - ) +(defskelgroup *logo-cam-sg* logo-cam logo-cam-lod0-jg logo-cam-idle-ja + ((logo-cam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + ) ;; failed to figure out what this is: -(defskelgroup *ndi-sg* ndi - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 10 0 30) - :longest-edge (meters 0) - ) +(defskelgroup *ndi-sg* ndi ndi-lod0-jg ndi-idle-ja + ((ndi-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 30) + ) ;; failed to figure out what this is: -(defskelgroup *ndi-volumes-sg* ndi-volumes - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5.5) - :longest-edge (meters 0) - ) +(defskelgroup *ndi-volumes-sg* ndi-volumes ndi-volumes-lod0-jg ndi-volumes-idle-ja + ((ndi-volumes-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + ) ;; failed to figure out what this is: -(defskelgroup *ndi-cam-sg* ndi-cam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 5.5) - :longest-edge (meters 0) - ) +(defskelgroup *ndi-cam-sg* ndi-cam ndi-cam-lod0-jg ndi-cam-idle-ja + ((ndi-cam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + ) ;; failed to figure out what this is: (defstate idle (logo-slave) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 uint)) (let ((v1-0 arg2)) (the-as object (cond @@ -196,10 +176,9 @@ ) ) ) - :code - (behavior () + :code (behavior () (ja-post) - (while #t + (loop (clone-anim-once (ppointer->handle (-> self parent-process)) (the-as int (-> self draw origin-joint-index)) @@ -222,7 +201,7 @@ ;; definition for function logo-slave-init-by-other ;; INFO: Return type mismatch object vs none. -(defbehavior logo-slave-init-by-other logo-slave ((arg0 entity) (arg1 skeleton-group)) +(defbehavior logo-slave-init-by-other logo-slave ((arg0 entity-actor) (arg1 skeleton-group)) (set! (-> self entity) arg0) (set! (-> self root) (new 'process 'trsqv)) (initialize-skeleton self arg1 '()) @@ -245,17 +224,15 @@ ;; failed to figure out what this is: (defstate startup (logo) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'update) - (clear-pending-settings-from-process *setting-control* self 'process-mask) + (remove-setting! 'process-mask) ) ) ) ) - :exit - (behavior () + :exit (behavior () (let ((a0-0 (-> self anim))) (when (nonzero? a0-0) (ja-abort-spooled-anim a0-0 (the-as art-joint-anim #f) -1) @@ -270,8 +247,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (if (not (none-reserved? *art-control*)) (go-virtual hidden) ) @@ -280,84 +256,43 @@ ) (none) ) - :code - (behavior () + :code (behavior () (while (!= (file-status *art-control* (-> self next-anim name) 0) 'active) (set-blackout-frames (seconds 0.05)) (suspend) ) (set! (-> *setting-control* current bg-a) 1.0) - (set-setting! *setting-control* self 'bg-a 'abs 0.0 0) - (let ((gp-1 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self camera-anim) - (ppointer->handle (when gp-1 - (let ((t9-4 (method-of-type logo-slave activate))) - (t9-4 (the-as logo-slave gp-1) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 logo-slave-init-by-other (-> self entity) *logo-cam-sg*) - (-> gp-1 ppointer) - ) - ) - ) - ) - (let ((gp-2 (get-process *default-dead-pool* othercam #x4000))) - (set! (-> self camera) - (ppointer->handle - (when gp-2 - (let ((t9-7 (method-of-type othercam activate))) - (t9-7 (the-as othercam gp-2) (handle->process (-> self camera-anim)) 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-2 othercam-init-by-other (handle->process (-> self camera-anim)) 4 #t 'logo) - (-> gp-2 ppointer) - ) + (set-setting! 'bg-a 'abs 0.0 0) + (set! (-> self camera-anim) + (ppointer->handle (process-spawn logo-slave (-> self entity) *logo-cam-sg* :to self)) + ) + (set! (-> self camera) + (ppointer->handle + (process-spawn + othercam + (handle->process (-> self camera-anim)) + 4 + #t + 'logo + :to (handle->process (-> self camera-anim)) ) ) - ) + ) (send-event (handle->process (-> self camera)) 'mask 0) (case (scf-get-territory) ((2) - (let ((gp-3 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self volumes) - (ppointer->handle - (when gp-3 - (let ((t9-12 (method-of-type logo-slave activate))) - (t9-12 (the-as logo-slave gp-3) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-3 logo-slave-init-by-other (-> self entity) *logo-volumes-japan-sg*) - (-> gp-3 ppointer) - ) - ) - ) - ) + (set! (-> self volumes) + (ppointer->handle (process-spawn logo-slave (-> self entity) *logo-volumes-japan-sg* :to self)) + ) ) (else - (let ((gp-4 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self volumes) - (ppointer->handle (when gp-4 - (let ((t9-15 (method-of-type logo-slave activate))) - (t9-15 (the-as logo-slave gp-4) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-4 logo-slave-init-by-other (-> self entity) *logo-volumes-sg*) - (-> gp-4 ppointer) - ) - ) - ) - ) + (set! (-> self volumes) + (ppointer->handle (process-spawn logo-slave (-> self entity) *logo-volumes-sg* :to self)) + ) ) ) (send-event (handle->process (-> self volumes)) 'origin-joint-index 3) - (let ((gp-5 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self black) - (ppointer->handle (when gp-5 - (let ((t9-19 (method-of-type logo-slave activate))) - (t9-19 (the-as logo-slave gp-5) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-5 logo-slave-init-by-other (-> self entity) *logo-black-sg*) - (-> gp-5 ppointer) - ) - ) - ) - ) + (set! (-> self black) (ppointer->handle (process-spawn logo-slave (-> self entity) *logo-black-sg* :to self))) (send-event (handle->process (-> self black)) 'origin-joint-index 3) (set! (-> self anim) (-> self next-anim)) (set! (-> self next-anim) @@ -365,8 +300,7 @@ :name "logo-intro-2" :index 7 :parts 15 - :command-list - '((260 want-force-inside village1 #t) + :command-list '((260 want-force-inside village1 #t) (261 kill "sage-23") (261 kill "assistant-11") (261 kill "explorer-4") @@ -396,30 +330,18 @@ (the-as (function process-drawable symbol) false-func) ) (set! *spawn-actors* #f) - (push-setting! *setting-control* self 'process-mask 'set 0.0 16) - (copy-settings-from-target! *setting-control*) + (add-setting! 'process-mask 'set 0.0 (process-mask progress)) + (apply-settings *setting-control*) (deactivate (handle->process (-> self black))) (deactivate (handle->process (-> self volumes))) (send-event (ppointer->process (-> self parent)) 'wait) (send-event self 'update) (ja-channel-set! 1) - (let ((a0-60 (-> self skel root-channel 0))) - (set! (-> a0-60 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-60 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-60 param 1) 1.0) - (set! (-> a0-60 frame-num) 0.0) - (joint-control-channel-group! a0-60 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (logior! (-> self skel status) (janim-status spool)) (suspend) - (let ((a0-62 (-> self skel root-channel 0))) - (set! (-> a0-62 param 0) (the float (+ (-> a0-62 frame-group data 0 length) -1))) - (set! (-> a0-62 param 1) 1.0) - (joint-control-channel-group-eval! a0-62 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! (-> self anim) (-> self next-anim)) (set! (-> self next-anim) @@ -427,8 +349,7 @@ :name "logo-loop" :index 9 :parts 17 - :command-list - '((61 kill "sage-23") + :command-list '((61 kill "sage-23") (61 kill "assistant-11") (61 kill "explorer-4") ((new 'static 'bfloat :data 61.5) kill "farmer-3") @@ -456,8 +377,7 @@ (go-virtual idle) (none) ) - :post - (behavior () + :post (behavior () (if *progress-process* (logior! (-> self draw status) (draw-status skip-bones)) (logclear! (-> self draw status) (draw-status skip-bones)) @@ -496,48 +416,32 @@ ;; failed to figure out what this is: (defstate idle (logo) :virtual #t - :exit - (-> (method-of-type logo startup) exit) - :trans - (-> (method-of-type logo startup) trans) - :code - (behavior () - (while #t + :exit (-> (method-of-type logo startup) exit) + :trans (-> (method-of-type logo startup) trans) + :code (behavior () + (loop (set! (-> self anim) (-> self next-anim)) - (when (not (handle->process (-> self camera))) - (let ((gp-0 (get-process *default-dead-pool* othercam #x4000))) + (if (not (handle->process (-> self camera))) (set! (-> self camera) (ppointer->handle - (when gp-0 - (let ((t9-1 (method-of-type othercam activate))) - (t9-1 (the-as othercam gp-0) (handle->process (-> self camera-anim)) 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 othercam-init-by-other (handle->process (-> self camera-anim)) 4 #t 'logo) - (-> gp-0 ppointer) + (process-spawn + othercam + (handle->process (-> self camera-anim)) + 4 + #t + 'logo + :to (handle->process (-> self camera-anim)) ) ) ) ) - ) (set! *spawn-actors* #f) (ja-channel-set! 1) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (logior! (-> self skel status) (janim-status spool)) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (set! *spawn-actors* #t) (ja-play-spooled-anim @@ -549,22 +453,19 @@ ) (none) ) - :post - (-> (method-of-type logo startup) post) + :post (-> (method-of-type logo startup) post) ) ;; failed to figure out what this is: (defstate hidden (logo) :virtual #t - :trans - (behavior () + :trans (behavior () (if (nonzero? (-> self next-anim)) (spool-push *art-control* (-> self next-anim name) 0 self -1.0) ) (none) ) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) (ja-post) (let ((gp-0 *master-mode*)) @@ -572,7 +473,7 @@ (clear-rec *art-control*) (set! *master-mode* gp-0) ) - (while #t + (loop (when (and (none-reserved? *art-control*) (not (paused?))) (let ((gp-1 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 0.1)) @@ -592,19 +493,17 @@ ;; failed to figure out what this is: (defstate ndi (logo) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (if (= v1-0 'blackout) - (set-setting! *setting-control* self 'bg-a 'abs 1.0 0) + (set-setting! 'bg-a 'abs 1.0 0) ) ) ) ) - :enter - (behavior () - (set-setting! *setting-control* self 'bg-a 'abs 0.0 0) - (copy-settings-from-target! *setting-control*) + :enter (behavior () + (set-setting! 'bg-a 'abs 0.0 0) + (apply-settings *setting-control*) (set! (-> self state-time) (-> *display* base-frame-counter)) (if *time-of-day-proc* (set! (-> *time-of-day-proc* 0 hour) 12) @@ -612,20 +511,18 @@ (set! (-> self done?) #f) (none) ) - :exit - (behavior () + :exit (behavior () ((-> (method-of-type logo startup) exit)) - (set-blackout-frames (seconds 0.033333335)) + (set-blackout-frames (seconds 0.035)) (none) ) - :trans - (behavior () + :trans (behavior () ((-> (method-of-type logo startup) trans)) (if (and *debug-segment* (cpad-pressed? 0 start circle x) (member (level-status *level* 'village1) '(loaded active)) ) - (set-setting! *setting-control* self 'bg-a 'abs 1.0 0) + (set-setting! 'bg-a 'abs 1.0 0) ) (when (and (= (-> *setting-control* current bg-a) 1.0) (and (member (level-status *level* 'village1) '(active loaded)) @@ -653,78 +550,36 @@ ) (none) ) - :code - (behavior () + :code (behavior () (while (!= (file-status *art-control* (-> self next-anim name) 0) 'active) (set-blackout-frames (seconds 0.05)) (suspend) ) (set! (-> *setting-control* current bg-a) 1.0) - (let ((gp-1 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self camera-anim) - (ppointer->handle (when gp-1 - (let ((t9-3 (method-of-type logo-slave activate))) - (t9-3 (the-as logo-slave gp-1) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-1 logo-slave-init-by-other (-> self entity) *ndi-cam-sg*) - (-> gp-1 ppointer) - ) - ) - ) - ) - (let ((gp-2 (get-process *default-dead-pool* othercam #x4000))) - (set! (-> self camera) - (ppointer->handle - (when gp-2 - (let ((t9-6 (method-of-type othercam activate))) - (t9-6 (the-as othercam gp-2) (handle->process (-> self camera-anim)) 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-2 othercam-init-by-other (handle->process (-> self camera-anim)) 3 #t 'logo) - (-> gp-2 ppointer) - ) + (set! (-> self camera-anim) + (ppointer->handle (process-spawn logo-slave (-> self entity) *ndi-cam-sg* :to self)) + ) + (set! (-> self camera) + (ppointer->handle + (process-spawn + othercam + (handle->process (-> self camera-anim)) + 3 + #t + 'logo + :to (handle->process (-> self camera-anim)) ) ) - ) + ) (send-event (handle->process (-> self camera)) 'mask 0) - (let ((gp-3 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self volumes) - (ppointer->handle (when gp-3 - (let ((t9-10 (method-of-type logo-slave activate))) - (t9-10 (the-as logo-slave gp-3) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-3 logo-slave-init-by-other (-> self entity) *ndi-volumes-sg*) - (-> gp-3 ppointer) - ) - ) - ) - ) + (set! (-> self volumes) + (ppointer->handle (process-spawn logo-slave (-> self entity) *ndi-volumes-sg* :to self)) + ) (send-event (handle->process (-> self volumes)) 'origin-joint-index 3) - (let ((gp-4 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self target) - (ppointer->handle (when gp-4 - (let ((t9-14 (method-of-type logo-slave activate))) - (t9-14 (the-as logo-slave gp-4) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-4 logo-slave-init-by-other #f *jchar-sg*) - (-> gp-4 ppointer) - ) - ) - ) - ) + (set! (-> self target) (ppointer->handle (process-spawn logo-slave #f *jchar-sg* :to self))) (send-event (handle->process (-> self target)) 'blend-shape #t) (send-event (handle->process (-> self target)) 'origin-joint-index 33) - (let ((gp-5 (get-process *default-dead-pool* logo-slave #x4000))) - (set! (-> self sidekick) - (ppointer->handle (when gp-5 - (let ((t9-19 (method-of-type logo-slave activate))) - (t9-19 (the-as logo-slave gp-5) self 'logo-slave (the-as pointer #x70004000)) - ) - (run-now-in-process gp-5 logo-slave-init-by-other #f *sidekick-sg*) - (-> gp-5 ppointer) - ) - ) - ) - ) + (set! (-> self sidekick) (ppointer->handle (process-spawn logo-slave #f *sidekick-sg* :to self))) (send-event (handle->process (-> self sidekick)) 'blend-shape #t) (send-event (handle->process (-> self sidekick)) 'origin-joint-index 6) (set! (-> self anim) (-> self next-anim)) @@ -736,12 +591,11 @@ (the-as (function process-drawable symbol) false-func) ) (set! (-> self done?) #t) - (set-setting! *setting-control* self 'bg-a 'abs 1.0 0) + (set-setting! 'bg-a 'abs 1.0 0) (anim-loop) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (none) ) @@ -750,7 +604,7 @@ ;; definition for function logo-init-by-other ;; INFO: Return type mismatch object vs none. ;; Used lq/sq -(defbehavior logo-init-by-other logo ((arg0 entity) (arg1 vector) (arg2 symbol)) +(defbehavior logo-init-by-other logo ((arg0 entity-actor) (arg1 vector) (arg2 symbol)) (stack-size-set! (-> self main-thread) 512) (logclear! (-> self mask) (process-mask progress)) (set! (-> self entity) arg0) @@ -774,8 +628,7 @@ :name "logo-intro" :index 5 :parts 3 - :command-list - '((0 want-levels title village1) + :command-list '((0 want-levels title village1) (5 display-level village1 special) (5 want-vis vi1) (5 want-force-inside village1 #t) @@ -836,17 +689,15 @@ ;; failed to figure out what this is: (defstate target-title (target) - :event - target-generic-event-handler - :enter - (behavior () - (set-setting! *setting-control* self 'music-volume 'abs 0.0 0) - (set-setting! *setting-control* self 'sfx-volume 'abs 0.0 0) - (set-setting! *setting-control* self 'ambient-volume 'abs 0.0 0) - (set-setting! *setting-control* self 'allow-pause #f 0.0 0) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) - (set-setting! *setting-control* self 'border-mode #f 0.0 0) - (copy-settings-from-target! *setting-control*) + :event target-generic-event-handler + :enter (behavior () + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'border-mode #f 0.0 0) + (apply-settings *setting-control*) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self manipy) (the-as (pointer manipy) #f)) (ja-channel-set! 0) @@ -854,8 +705,7 @@ (send-event *camera* 'change-state cam-fixed 0) (none) ) - :exit - (behavior () + :exit (behavior () (when (not (or (= (-> self next-state name) 'target-title-play) (= (-> self next-state name) 'target-title-wait))) (if (-> self manipy) (deactivate (-> self manipy 0)) @@ -863,19 +713,27 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (hide-hud-quick) (spool-push *art-control* "ndi-intro" 0 self -1.0) - (sound-group-pause (the-as uint 2)) + (sound-group-pause (sound-group music)) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (the-as handle #f))) (case (scf-get-territory) ((2) - (set! gp-0 (ppointer->handle (static-screen-spawn 5 #x64900000 #x64900100 #x64900200 900 #f self))) + (set! gp-0 (ppointer->handle (static-screen-spawn + 5 + (new 'static 'texture-id :page #x649) + (new 'static 'texture-id :index #x1 :page #x649) + (new 'static 'texture-id :index #x2 :page #x649) + (seconds 3) + #f + self + ) + ) + ) ) (else (while (!= (file-status *art-control* "ndi-intro" 0) 'active) @@ -910,16 +768,16 @@ (if (zero? (-> s5-2 handle)) (set! gp-1 8) ) - (set-setting! *setting-control* self 'allow-progress #t 0.0 0) + (set-setting! 'allow-progress #t 0.0 0) (set-blackout-frames 0) (set! (-> *setting-control* default bg-a-force) 0.0) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (set! (-> *setting-control* current bg-a) 0.0) (set! (-> *setting-control* current bg-a-force) 0.0) (activate-progress *dproc* (the-as progress-screen gp-1)) ) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) - (copy-settings-from-target! *setting-control*) + (set-setting! 'allow-progress #f 0.0 0) + (apply-settings *setting-control*) (while *progress-process* (suspend) ) @@ -934,16 +792,7 @@ ) (label cfg-41) (let ((gp-3 (entity-by-name "logo-1"))) - (let* ((s5-3 (get-process *default-dead-pool* logo #x4000)) - (v1-53 (when s5-3 - (let ((t9-17 (method-of-type logo activate))) - (t9-17 (the-as logo s5-3) self 'logo (the-as pointer #x70004000)) - ) - (run-now-in-process s5-3 logo-init-by-other gp-3 (-> gp-3 extra trans) 'ndi) - (-> s5-3 ppointer) - ) - ) - ) + (let ((v1-53 (process-spawn logo gp-3 (-> gp-3 extra trans) 'ndi :to self))) (set! (-> self manipy) (the-as (pointer manipy) v1-53)) (let ((s5-4 (ppointer->handle v1-53))) (while (handle->process (the-as handle s5-4)) @@ -951,30 +800,19 @@ ) ) ) - (let ((s5-5 (get-process *default-dead-pool* logo #x4000))) - (set! (-> self manipy) - (the-as (pointer manipy) (when s5-5 - (let ((t9-20 (method-of-type logo activate))) - (t9-20 (the-as logo s5-5) self 'logo (the-as pointer #x70004000)) - ) - (run-now-in-process s5-5 logo-init-by-other gp-3 (-> gp-3 extra trans) 'logo) - (-> s5-5 ppointer) - ) - ) - ) - ) + (set! (-> self manipy) + (the-as (pointer manipy) (process-spawn logo gp-3 (-> gp-3 extra trans) 'logo :to self)) + ) ) (go target-title-play) (none) ) - :post - target-no-move-post + :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-title-play (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'wait) @@ -990,26 +828,20 @@ ) ) ) - :enter - (behavior () - (set-setting! *setting-control* self 'allow-pause #f 0.0 0) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) + :enter (behavior () + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (none) ) - :exit - (-> target-title exit) - :trans - (the-as (function none :behavior target) hide-hud-quick) - :code - (the-as (function none :behavior target) anim-loop) - :post - target-no-move-post + :exit (-> target-title exit) + :trans (the-as (function none :behavior target) hide-hud-quick) + :code (the-as (function none :behavior target) anim-loop) + :post target-no-move-post ) ;; failed to figure out what this is: (defstate target-title-wait (target) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'play) @@ -1025,31 +857,28 @@ ) ) ) - :enter - (behavior () - (clear-pending-settings-from-process *setting-control* self 'ambient-volume) - (clear-pending-settings-from-process *setting-control* self 'sfx-volume) - (clear-pending-settings-from-process *setting-control* self 'music-volume) - (clear-pending-settings-from-process *setting-control* self 'allow-progress) - (sound-group-continue (the-as uint 2)) + :enter (behavior () + (remove-setting! 'ambient-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'music-volume) + (remove-setting! 'allow-progress) + (sound-group-continue (sound-group music)) (when *time-of-day-proc* (set! (-> *time-of-day-proc* 0 time-ratio) 18000.0) (set! *time-of-day-fast* #t) ) (none) ) - :exit - (behavior () + :exit (behavior () (when *time-of-day-proc* (set! (-> *time-of-day-proc* 0 time-ratio) 300.0) (set! *time-of-day-fast* #f) ) - (clear-pending-settings-from-process *setting-control* self 'allow-pause) + (remove-setting! 'allow-pause) ((-> target-title exit)) (none) ) - :trans - (behavior () + :trans (behavior () (hide-hud-quick) (if (cpad-pressed? 0 start) (activate-progress *dproc* (progress-screen title)) @@ -1071,8 +900,6 @@ ) (none) ) - :code - (the-as (function none :behavior target) anim-loop) - :post - target-no-move-post + :code (the-as (function none :behavior target) anim-loop) + :post target-no-move-post ) diff --git a/test/decompiler/reference/levels/training/training-obs_REF.gc b/test/decompiler/reference/levels/training/training-obs_REF.gc index 0171005b4c..741801c6d4 100644 --- a/test/decompiler/reference/levels/training/training-obs_REF.gc +++ b/test/decompiler/reference/levels/training/training-obs_REF.gc @@ -1,6 +1,12 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/scarecrow-b-ag.gc") +(import "goal_src/import/pontoonfive-ag.gc") +(import "goal_src/import/trainingcam-ag.gc") +(import "goal_src/import/scarecrow-a-ag.gc") +(import "goal_src/import/jng-iris-door-ag.gc") + ;; definition of type training-water (deftype training-water (water-anim) () @@ -23,8 +29,7 @@ :count 3 :converted #f :normal-scale 1.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 40.0 :xdiv -1 :zdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75) @@ -51,13 +56,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *training-cam-sg* trainingcam - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 80) - :longest-edge (meters 0) - ) +(defskelgroup *training-cam-sg* trainingcam trainingcam-lod0-jg -1 + ((trainingcam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) ;; definition of type training-cam (deftype training-cam (process) @@ -99,9 +101,8 @@ ;; failed to figure out what this is: (defstate idle (training-cam) :virtual #t - :code - (behavior () - (while #t + :code (behavior () + (loop (when (and *target* (< (vector-vector-distance (target-pos 0) (-> self root trans)) (-> self range)) (-> *setting-control* current play-hints) @@ -113,8 +114,8 @@ ) (when (!= (-> self index) 6) (while (and *target* - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) (suspend) ) @@ -127,15 +128,15 @@ ) ) ) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (let* ((a0-15 *setting-control*) - (t9-6 (method-of-object a0-15 set-setting!)) + (t9-6 (method-of-object a0-15 set-setting)) (a2-3 'movie) (a3-1 (process->ppointer self)) ) - (t9-6 a0-15 self a2-3 (the-as symbol a3-1) 0.0 0) + (t9-6 a0-15 self a2-3 a3-1 0.0 0) ) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (dotimes (gp-1 2) (while (or (-> *setting-control* current talking) (-> *setting-control* current spooling) @@ -149,8 +150,8 @@ (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (suspend) ) - (clear-pending-settings-from-process *setting-control* self 'movie) - (copy-settings-from-target! *setting-control*) + (remove-setting! 'movie) + (apply-settings *setting-control*) (suspend) (suspend) ) @@ -167,24 +168,7 @@ *entity-pool* (game-task none) ) - (let ((gp-2 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-2 - (let ((t9-13 (method-of-type pov-camera activate))) - (t9-13 (the-as pov-camera gp-2) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - pov-camera-init-by-other - (-> self entity extra trans) - *training-cam-sg* - "orbcam" - 0 - #f - '() - ) - (-> gp-2 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "orbcam" 0 #f '() :to self) ) ((= v1-61 1) (level-hint-spawn @@ -194,24 +178,7 @@ *entity-pool* (game-task none) ) - (let ((gp-3 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-3 - (let ((t9-17 (method-of-type pov-camera activate))) - (t9-17 (the-as pov-camera gp-3) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-3 - pov-camera-init-by-other - (-> self entity extra trans) - *training-cam-sg* - "fuelcellcam" - 0 - #f - '() - ) - (-> gp-3 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "fuelcellcam" 0 #f '() :to self) ) ((= v1-61 2) (level-hint-spawn @@ -221,24 +188,7 @@ *entity-pool* (game-task none) ) - (let ((gp-4 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-4 - (let ((t9-21 (method-of-type pov-camera activate))) - (t9-21 (the-as pov-camera gp-4) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-4 - pov-camera-init-by-other - (-> self entity extra trans) - *training-cam-sg* - "ecocam" - 0 - #f - '() - ) - (-> gp-4 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "ecocam" 0 #f '() :to self) ) ((= v1-61 3) (level-hint-spawn @@ -248,24 +198,7 @@ *entity-pool* (game-task none) ) - (let ((gp-5 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-5 - (let ((t9-25 (method-of-type pov-camera activate))) - (t9-25 (the-as pov-camera gp-5) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-5 - pov-camera-init-by-other - (-> self entity extra trans) - *training-cam-sg* - "precursordoorcam" - 0 - #f - '() - ) - (-> gp-5 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "precursordoorcam" 0 #f '() :to self) ) ((= v1-61 4) (level-hint-spawn @@ -275,24 +208,7 @@ *entity-pool* (game-task none) ) - (let ((gp-6 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-6 - (let ((t9-29 (method-of-type pov-camera activate))) - (t9-29 (the-as pov-camera gp-6) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-6 - pov-camera-init-by-other - (-> self entity extra trans) - *training-cam-sg* - "ecoventcam" - 0 - #f - '() - ) - (-> gp-6 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "ecoventcam" 0 #f '() :to self) ) ((= v1-61 5) (level-hint-spawn @@ -302,24 +218,7 @@ *entity-pool* (game-task none) ) - (let ((gp-7 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-7 - (let ((t9-33 (method-of-type pov-camera activate))) - (t9-33 (the-as pov-camera gp-7) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-7 - pov-camera-init-by-other - (-> self entity extra trans) - *training-cam-sg* - "greenecocam" - 0 - #f - '() - ) - (-> gp-7 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "greenecocam" 0 #f '() :to self) ) ((= v1-61 6) (when (not (task-complete? *game-info* (game-task training-climb))) @@ -451,13 +350,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *tra-pontoon-sg* pontoonfive - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 0) - ) +(defskelgroup *tra-pontoon-sg* pontoonfive pontoonfive-lod0-jg pontoonfive-idle-ja + ((pontoonfive-lod0-mg (meters 20)) (pontoonfive-lod1-mg (meters 40)) (pontoonfive-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) ;; definition for method 30 of type tra-pontoon ;; INFO: Return type mismatch int vs none. @@ -542,13 +438,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *tra-iris-door-sg* jng-iris-door - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *tra-iris-door-sg* jng-iris-door jng-iris-door-lod0-jg jng-iris-door-idle-ja + ((jng-iris-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; definition for method 24 of type tra-iris-door ;; INFO: Return type mismatch int vs none. @@ -587,14 +480,12 @@ :id 143 :duration 15 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2912) (sp-item 2913) (sp-item 2914) (sp-item 2915) (sp-item 2916)) + :parts ((sp-item 2912) (sp-item 2913) (sp-item 2914) (sp-item 2915) (sp-item 2916)) ) ;; failed to figure out what this is: (defpart 2912 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 2.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.5) 1.0) @@ -621,20 +512,17 @@ ;; failed to figure out what this is: (defpart 2917 - :init-specs - ((sp-flt spt-fade-a -0.4) (sp-int-plain-rnd spt-next-time 30 29 1) (sp-launcher-by-id spt-next-launcher 2918)) + :init-specs ((sp-flt spt-fade-a -0.4) (sp-int-plain-rnd spt-next-time 30 29 1) (sp-launcher-by-id spt-next-launcher 2918)) ) ;; failed to figure out what this is: (defpart 2918 - :init-specs - ((sp-flt spt-fade-a -0.04)) + :init-specs ((sp-flt spt-fade-a -0.04)) ) ;; failed to figure out what this is: (defpart 2913 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x2)) (sp-flt spt-num 4.0) (sp-flt spt-y (meters 2.5)) (sp-rnd-flt spt-scale-x (meters 6) (meters 3) 1.0) @@ -659,14 +547,12 @@ ;; failed to figure out what this is: (defpart 2919 - :init-specs - ((sp-flt spt-fade-a -2.1333334)) + :init-specs ((sp-flt spt-fade-a -2.1333334)) ) ;; failed to figure out what this is: (defpart 2914 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 2.5) (sp-flt spt-y (meters 1.5)) (sp-flt spt-scale-x (meters 12)) @@ -683,8 +569,7 @@ ;; failed to figure out what this is: (defpart 2915 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6 :page #x2)) (sp-rnd-flt spt-num 8.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 2.5) (meters 1.5) 1.0) @@ -713,8 +598,7 @@ ;; failed to figure out what this is: (defpart 2920 - :init-specs - ((sp-flt spt-scalevel-x (meters -0.0033333334)) + :init-specs ((sp-flt spt-scalevel-x (meters -0.0033333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -3.4) ) @@ -722,8 +606,7 @@ ;; failed to figure out what this is: (defpart 2916 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x5 :page #x2)) (sp-rnd-flt spt-num 8.0 8.0 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 2.5) (meters 1.5) 1.0) @@ -755,8 +638,7 @@ :id 144 :duration 15 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2912)) + :parts ((sp-item 2912)) ) ;; failed to figure out what this is: @@ -764,8 +646,7 @@ :id 145 :duration 15 :bounds (static-bspherem 0 0 0 1) - :parts - ((sp-item 2913)) + :parts ((sp-item 2913)) ) ;; definition of type scarecrow-a @@ -821,28 +702,21 @@ ) ;; failed to figure out what this is: -(defskelgroup *scarecrow-a-sg* scarecrow-a - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 2.5 0 3) - :longest-edge (meters 0) - ) +(defskelgroup *scarecrow-a-sg* scarecrow-a scarecrow-a-lod0-jg scarecrow-a-idle-ja + ((scarecrow-a-lod0-mg (meters 20)) (scarecrow-a-lod1-mg (meters 40)) (scarecrow-a-lod2-mg (meters 999999))) + :bounds (static-spherem 0 2.5 0 3) + ) ;; failed to figure out what this is: -(defskelgroup *scarecrow-a-break-sg* scarecrow-a - 0 - 5 - ((4 (meters 999999))) - :bounds (static-spherem 0 -15 0 50) - :longest-edge (meters 0) - ) +(defskelgroup *scarecrow-a-break-sg* scarecrow-a scarecrow-a-lod0-jg scarecrow-a-idle-ja + ((scarecrow-a-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -15 0 50) + ) ;; failed to figure out what this is: (defstate idle (scarecrow-a) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -903,19 +777,21 @@ (get-middle-of-bsphere-overlap a0-24 (-> self intersection)) (target-pos 0) ) - (the-as symbol (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 2) - ) - (or (= (-> self type) scarecrow-a) - (and (= (-> arg0 type) target) - (logtest? (-> (the-as target arg0) control unknown-surface00 flags) 2048) - (zero? (logand (-> (the-as target arg0) control status) 1)) - ) - ) - ) + (the-as + symbol + (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 2) ) + (or (= (-> self type) scarecrow-a) + (and (= (-> arg0 type) target) + (logtest? (-> (the-as target arg0) control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> (the-as target arg0) control status) (cshape-moving-flags onsurf))) + ) + ) + ) + ) ) ) ) @@ -935,105 +811,53 @@ ) ) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (get-reminder (get-task-control (game-task training-gimmie)) 0) ) (none) ) - :code - (behavior () - (ja-channel-push! 1 36) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.12)) + (loop + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior scarecrow-a) ja-post) + :post (the-as (function none :behavior scarecrow-a) ja-post) ) ;; failed to figure out what this is: (defstate hit (scarecrow-a) :virtual #t - :code - (behavior ((arg0 float) (arg1 vector) (arg2 symbol)) + :code (behavior ((arg0 float) (arg1 vector) (arg2 symbol)) (when (not arg2) (dummy-10 (-> self skel effect) 'group-scarecrow-hit 4.0 -1) - (ja-channel-push! 1 21) + (ja-channel-push! 1 (seconds 0.07)) (cond ((< (fabs arg0) 8192.0) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((and (< 8192.0 arg0) (< arg0 24576.0)) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -1043,7 +867,7 @@ (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 12.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 20.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-explode 4.0 -1) - (sound-play-by-name (static-sound-name "break-dummy") (new-sound-id) 1024 0 0 1 #t) + (sound-play "break-dummy") (ja-channel-set! 0) (let ((s5-2 (new 'stack 'joint-exploder-tuning 1))) (set! (-> s5-2 duration) (seconds 1.5)) @@ -1053,38 +877,26 @@ (set! (-> s5-2 fountain-rand-transv-hi z) 20480.0) (set! (-> s5-2 fountain-rand-transv-hi w) 49152.0) (set! (-> s5-2 fountain-rand-transv-lo quad) (-> arg1 quad)) - (let ((gp-1 (get-process *default-dead-pool* joint-exploder #x4000))) - (when gp-1 - (let ((t9-21 (method-of-type joint-exploder activate))) - (t9-21 (the-as joint-exploder gp-1) self 'joint-exploder (the-as pointer #x70004000)) + (process-spawn + joint-exploder + *scarecrow-a-break-sg* + 5 + s5-2 + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 10) + (new 'static 'joint-exploder-static-joint-params :joint-index 20) + (new 'static 'joint-exploder-static-joint-params :joint-index 4) + (new 'static 'joint-exploder-static-joint-params :joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 11) + (new 'static 'joint-exploder-static-joint-params :joint-index 9) + (new 'static 'joint-exploder-static-joint-params :joint-index 7) + (new 'static 'joint-exploder-static-joint-params :joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 13) ) - (run-now-in-process - gp-1 - joint-exploder-init-by-other - *scarecrow-a-break-sg* - 5 - s5-2 - (new 'static 'joint-exploder-static-params - :joints - (new - 'static - 'boxed-array - :type joint-exploder-static-joint-params :length 10 :allocated-length 10 - (new 'static 'joint-exploder-static-joint-params :joint-index 12) - (new 'static 'joint-exploder-static-joint-params :joint-index 10) - (new 'static 'joint-exploder-static-joint-params :joint-index 20) - (new 'static 'joint-exploder-static-joint-params :joint-index 4) - (new 'static 'joint-exploder-static-joint-params :joint-index 5) - (new 'static 'joint-exploder-static-joint-params :joint-index 11) - (new 'static 'joint-exploder-static-joint-params :joint-index 9) - (new 'static 'joint-exploder-static-joint-params :joint-index 7) - (new 'static 'joint-exploder-static-joint-params :joint-index 14) - (new 'static 'joint-exploder-static-joint-params :joint-index 13) - ) - ) - ) - (-> gp-1 ppointer) ) + :to self ) ) (while (-> self child) @@ -1093,8 +905,7 @@ (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior scarecrow-a) ja-post) + :post (the-as (function none :behavior scarecrow-a) ja-post) ) ;; definition for method 11 of type scarecrow-a @@ -1135,120 +946,62 @@ ) ;; failed to figure out what this is: -(defskelgroup *scarecrow-b-sg* scarecrow-b - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 3.5 0 3.8) - :longest-edge (meters 0) - ) +(defskelgroup *scarecrow-b-sg* scarecrow-b scarecrow-b-lod0-jg scarecrow-b-idle-ja + ((scarecrow-b-lod0-mg (meters 20)) (scarecrow-b-lod1-mg (meters 40)) (scarecrow-b-lod2-mg (meters 999999))) + :bounds (static-spherem 0 3.5 0 3.8) + ) ;; failed to figure out what this is: -(defskelgroup *scarecrow-b-break-sg* scarecrow-b - 0 - 5 - ((4 (meters 999999))) - :bounds (static-spherem 0 -15 0 50) - :longest-edge (meters 0) - ) +(defskelgroup *scarecrow-b-break-sg* scarecrow-b scarecrow-b-lod0-jg scarecrow-b-idle-ja + ((scarecrow-b-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -15 0 50) + ) ;; failed to figure out what this is: (defstate idle (scarecrow-b) :virtual #t - :event - (-> (method-of-type scarecrow-a idle) event) - :code - (behavior () - (ja-channel-push! 1 36) - (while #t - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-1 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (set! (-> a0-1 frame-num) 0.0) - (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + :event (-> (method-of-type scarecrow-a idle) event) + :code (behavior () + (ja-channel-push! 1 (seconds 0.12)) + (loop + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior scarecrow-b) ja-post) + :post (the-as (function none :behavior scarecrow-b) ja-post) ) ;; failed to figure out what this is: (defstate hit (scarecrow-b) :virtual #t - :code - (behavior ((arg0 float) (arg1 vector) (arg2 symbol)) + :code (behavior ((arg0 float) (arg1 vector) (arg2 symbol)) (when (not arg2) (dummy-10 (-> self skel effect) 'group-scarecrow-hit 4.0 -1) - (ja-channel-push! 1 21) + (ja-channel-push! 1 (seconds 0.07)) (cond ((< (fabs arg0) 8192.0) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((and (< 8192.0 arg0) (< arg0 24576.0)) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) 1.0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -1258,7 +1011,7 @@ (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 12.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 21.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-explode 4.0 -1) - (sound-play-by-name (static-sound-name "break-dummy") (new-sound-id) 1024 0 0 1 #t) + (sound-play "break-dummy") (ja-channel-set! 0) (let ((s5-2 (new 'stack 'joint-exploder-tuning 1))) (set! (-> s5-2 duration) (seconds 1.5)) @@ -1267,42 +1020,30 @@ (set! (-> s5-2 fountain-rand-transv-hi z) 40960.0) (set! (-> s5-2 fountain-rand-transv-hi w) 102400.0) (set! (-> s5-2 fountain-rand-transv-lo quad) (-> arg1 quad)) - (let ((gp-1 (get-process *default-dead-pool* joint-exploder #x4000))) - (when gp-1 - (let ((t9-21 (method-of-type joint-exploder activate))) - (t9-21 (the-as joint-exploder gp-1) self 'joint-exploder (the-as pointer #x70004000)) + (process-spawn + joint-exploder + *scarecrow-b-break-sg* + 5 + s5-2 + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 10) + (new 'static 'joint-exploder-static-joint-params :joint-index 21) + (new 'static 'joint-exploder-static-joint-params :joint-index 4) + (new 'static 'joint-exploder-static-joint-params :joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 11) + (new 'static 'joint-exploder-static-joint-params :joint-index 9) + (new 'static 'joint-exploder-static-joint-params :joint-index 7) + (new 'static 'joint-exploder-static-joint-params :joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 16) + (new 'static 'joint-exploder-static-joint-params :joint-index 15) ) - (run-now-in-process - gp-1 - joint-exploder-init-by-other - *scarecrow-b-break-sg* - 5 - s5-2 - (new 'static 'joint-exploder-static-params - :joints - (new - 'static - 'boxed-array - :type joint-exploder-static-joint-params :length 14 :allocated-length 14 - (new 'static 'joint-exploder-static-joint-params :joint-index 12) - (new 'static 'joint-exploder-static-joint-params :joint-index 10) - (new 'static 'joint-exploder-static-joint-params :joint-index 21) - (new 'static 'joint-exploder-static-joint-params :joint-index 4) - (new 'static 'joint-exploder-static-joint-params :joint-index 5) - (new 'static 'joint-exploder-static-joint-params :joint-index 11) - (new 'static 'joint-exploder-static-joint-params :joint-index 9) - (new 'static 'joint-exploder-static-joint-params :joint-index 7) - (new 'static 'joint-exploder-static-joint-params :joint-index 14) - (new 'static 'joint-exploder-static-joint-params :joint-index 13) - (new 'static 'joint-exploder-static-joint-params :joint-index 14) - (new 'static 'joint-exploder-static-joint-params :joint-index 13) - (new 'static 'joint-exploder-static-joint-params :joint-index 16) - (new 'static 'joint-exploder-static-joint-params :joint-index 15) - ) - ) - ) - (-> gp-1 ppointer) ) + :to self ) ) (while (-> self child) @@ -1311,8 +1052,7 @@ (cleanup-for-death self) (none) ) - :post - (the-as (function none :behavior scarecrow-b) ja-post) + :post (the-as (function none :behavior scarecrow-b) ja-post) ) ;; definition for method 11 of type scarecrow-b diff --git a/test/decompiler/reference/levels/training/training-part_REF.gc b/test/decompiler/reference/levels/training/training-part_REF.gc index ad29af239e..acd025a6ae 100644 --- a/test/decompiler/reference/levels/training/training-part_REF.gc +++ b/test/decompiler/reference/levels/training/training-part_REF.gc @@ -23,8 +23,7 @@ :id 146 :flags (always-draw) :bounds (static-bspherem 0 32 0 70) - :parts - ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 4500) + :parts ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 4500) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1140 :offset 4530) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1080 :offset 4560) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1020 :offset 4590) @@ -58,8 +57,7 @@ :id 147 :flags (always-draw) :bounds (static-bspherem 0 32 0 70) - :parts - ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 900) + :parts ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 900) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1140 :offset 930) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1080 :offset 960) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1020 :offset 990) @@ -93,8 +91,7 @@ :id 149 :flags (always-draw) :bounds (static-bspherem 0 32 0 70) - :parts - ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 2100) + :parts ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 2100) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1140 :offset 2130) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1080 :offset 2160) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1020 :offset 2190) @@ -120,8 +117,7 @@ :id 148 :flags (always-draw) :bounds (static-bspherem 0 32 0 70) - :parts - ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 3300) + :parts ((sp-item 752 :falloff-to (meters 500) :period 4800 :length 1200 :offset 3300) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1140 :offset 3330) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1080 :offset 3360) (sp-item 752 :falloff-to (meters 500) :period 4800 :length 1020 :offset 3390) @@ -152,19 +148,9 @@ ;; failed to figure out what this is: (defpart 752 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.2) - (sp-sound (new 'static 'sound-spec - :mask #xc0 - :num 0.1 - :group #x1 - :sound-name (static-sound-name "geyser") - :volume #x400 - :fo-min 50 - :fo-max #xc8 - ) - ) + (sp-sound (static-sound-spec "geyser" :num 0.1 :fo-min 50 :fo-max 200)) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-flt spt-y (meters -8)) (sp-flt spt-scale-x (meters 8)) @@ -189,14 +175,12 @@ ;; failed to figure out what this is: (defpart 761 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.06666667)) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.06666667)) (sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 753 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 85) (meters 10) 1.0) @@ -229,8 +213,7 @@ ;; failed to figure out what this is: (defpart 762 - :init-specs - ((sp-flt spt-fade-a -0.03678161)) + :init-specs ((sp-flt spt-fade-a -0.03678161)) ) ;; definition for function check-drop-level-training-mist @@ -244,8 +227,7 @@ ;; failed to figure out what this is: (defpart 754 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.035) (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 85) (meters 10) 1.0) @@ -278,8 +260,7 @@ ;; failed to figure out what this is: (defpart 763 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-int spt-num 0 1 1.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -299,8 +280,7 @@ ;; failed to figure out what this is: (defpart 764 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.02)) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -324,13 +304,9 @@ (when (< (-> arg2 y) (-> arg1 user-float)) (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (if (< (+ -1.0 (the-as float v1-2)) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) - ) - ) + (if (< (rand-float-gen) 0.25) + (sound-play "water-drop") + ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var *sp-particle-system-2d* @@ -355,8 +331,7 @@ ;; failed to figure out what this is: (defpart 759 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 40) 1.0) (sp-rnd-flt spt-y (meters 10) (meters 20) 1.0) @@ -377,8 +352,7 @@ ;; failed to figure out what this is: (defpart 760 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters 0) (meters 40) 1.0) (sp-rnd-flt spt-y (meters 10) (meters 20) 1.0) @@ -397,8 +371,7 @@ ;; failed to figure out what this is: (defpart 757 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 40) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 8) 1.0) @@ -419,8 +392,7 @@ ;; failed to figure out what this is: (defpart 758 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters 0) (meters 40) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 10) 1.0) @@ -439,8 +411,7 @@ ;; failed to figure out what this is: (defpart 755 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 0) (meters 40) 1.0) (sp-rnd-flt spt-y (meters 10) (meters 10) 1.0) @@ -461,8 +432,7 @@ ;; failed to figure out what this is: (defpart 756 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 4.0) (sp-rnd-flt spt-x (meters 0) (meters 40) 1.0) (sp-rnd-flt spt-y (meters 10) (meters 20) 1.0) @@ -483,8 +453,7 @@ (defpartgroup group-training-warpgate :id 150 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 767 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 767 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 768 :fade-after (meters 60) :falloff-to (meters 100) :binding 765) (sp-item 765 :flags (bit1 start-dead launch-asap)) (sp-item 765 :flags (bit1 start-dead launch-asap)) @@ -661,8 +630,7 @@ ;; failed to figure out what this is: (defpart 770 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-x (meters 0)) (sp-flt spt-scale-x (meters 5)) @@ -680,8 +648,7 @@ ;; failed to figure out what this is: (defpart 769 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters -2)) (sp-flt spt-scale-x (meters 0.25)) @@ -697,8 +664,7 @@ ;; failed to figure out what this is: (defpart 766 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.6666667)) (sp-flt spt-y (meters 4)) @@ -722,8 +688,7 @@ ;; failed to figure out what this is: (defpart 767 - :init-specs - ((sp-rnd-flt spt-num 3.0 3.0 1.0) + :init-specs ((sp-rnd-flt spt-num 3.0 3.0 1.0) (sp-flt spt-x (meters -0.5)) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) @@ -741,8 +706,7 @@ ;; failed to figure out what this is: (defpart 768 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.25)) (sp-copy-from-other spt-scale-y -4) @@ -757,8 +721,7 @@ ;; failed to figure out what this is: (defpart 765 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.6666667)) (sp-flt spt-y (meters 4)) @@ -785,8 +748,7 @@ (defpartgroup group-training-butterflies :id 151 :bounds (static-bspherem 0 0 0 30) - :parts - ((sp-item 773 :fade-after (meters 120) :period 4903 :length 5 :hour-mask #b111111100000000000111111 :binding 771) + :parts ((sp-item 773 :fade-after (meters 120) :period 4903 :length 5 :hour-mask #b111111100000000000111111 :binding 771) (sp-item 773 :fade-after (meters 120) :period 6637 :length 5 :hour-mask #b111111100000000000111111 :binding 771) (sp-item 773 :fade-after (meters 120) :period 9846 :length 5 :hour-mask #b111111100000000000111111 :binding 771) (sp-item 771 :flags (start-dead launch-asap) :binding 772) @@ -804,8 +766,7 @@ ;; failed to figure out what this is: (defpart 773 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 7.5) 1.0) (sp-rnd-flt spt-y (meters 14) (meters 3) 1.0) @@ -825,8 +786,7 @@ ;; failed to figure out what this is: (defpart 774 - :init-specs - ((sp-flt spt-accel-y 0.0) + :init-specs ((sp-flt spt-accel-y 0.0) (sp-int-plain-rnd spt-next-time 2700 1499 1) (sp-launcher-by-id spt-next-launcher 775) ) @@ -834,14 +794,12 @@ ;; failed to figure out what this is: (defpart 775 - :init-specs - ((sp-flt spt-accel-y 1.3653333)) + :init-specs ((sp-flt spt-accel-y 1.3653333)) ) ;; failed to figure out what this is: (defpart 771 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -865,8 +823,7 @@ ;; failed to figure out what this is: (defpart 776 - :init-specs - ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) (sp-rnd-flt spt-vel-y (meters -0.0074074077) (meters 0.0148148155) 1.0) (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) (sp-int-plain-rnd spt-next-time 150 449 1) @@ -876,8 +833,7 @@ ;; failed to figure out what this is: (defpart 772 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 0.9)) @@ -897,8 +853,7 @@ (defpartgroup group-training-birds :id 152 :bounds (static-bspherem 0 8 0 45) - :parts - ((sp-item 779 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 777) + :parts ((sp-item 779 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 777) (sp-item 779 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 777) (sp-item 779 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 777) (sp-item 777 :flags (start-dead launch-asap) :binding 778) @@ -923,8 +878,7 @@ ;; failed to figure out what this is: (defpart 779 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-func spt-birth-func 'birth-func-random-next-time) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) @@ -951,8 +905,7 @@ ;; failed to figure out what this is: (defpart 777 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-func spt-birth-func 'birth-func-copy-omega-to-z) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) @@ -978,8 +931,7 @@ ;; failed to figure out what this is: (defpart 780 - :init-specs - ((sp-flt spt-scale-x (meters 8)) + :init-specs ((sp-flt spt-scale-x (meters 8)) (sp-flt spt-scalevel-x (meters -0.08)) (sp-int spt-timer 600) (sp-int spt-next-time 100) @@ -989,8 +941,7 @@ ;; failed to figure out what this is: (defpart 781 - :init-specs - ((sp-flt spt-scale-x (meters 0)) + :init-specs ((sp-flt spt-scale-x (meters 0)) (sp-flt spt-scalevel-x (meters -0.04)) (sp-int spt-timer 600) (sp-int spt-next-time 199) @@ -1000,8 +951,7 @@ ;; failed to figure out what this is: (defpart 778 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-func spt-birth-func 'birth-func-copy2-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 4)) @@ -1017,8 +967,7 @@ :id 153 :flags (always-draw) :bounds (static-bspherem 0 16 0 32) - :parts - ((sp-item 782 :fade-after (meters 160) :falloff-to (meters 160)) + :parts ((sp-item 782 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 783 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 784 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 785 :fade-after (meters 80) :falloff-to (meters 80)) @@ -1029,26 +978,22 @@ ;; failed to figure out what this is: (defpart 789 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) ;; failed to figure out what this is: (defpart 790 - :init-specs - ((sp-flt spt-fade-a -0.16)) + :init-specs ((sp-flt spt-fade-a -0.16)) ) ;; failed to figure out what this is: (defpart 791 - :init-specs - ((sp-flt spt-fade-a -2.6666667)) + :init-specs ((sp-flt spt-fade-a -2.6666667)) ) ;; failed to figure out what this is: (defpart 782 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.9) (sp-rnd-flt spt-x (meters -9) (meters 1) 1.0) (sp-flt spt-y (meters 47)) @@ -1077,8 +1022,7 @@ ;; failed to figure out what this is: (defpart 783 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.9) (sp-rnd-flt spt-x (meters -9) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 39) (meters 5) 1.0) @@ -1107,8 +1051,7 @@ ;; failed to figure out what this is: (defpart 784 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2) (meters 3) 1.0) (sp-rnd-flt spt-y (meters 24) (meters 6) 1.0) @@ -1136,8 +1079,7 @@ ;; failed to figure out what this is: (defpart 785 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -9) (meters 1) 1.0) (sp-flt spt-y (meters 47)) @@ -1164,8 +1106,7 @@ ;; failed to figure out what this is: (defpart 786 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.4 1.0) (sp-rnd-flt spt-x (meters -7) (meters 3.5) 1.0) (sp-flt spt-y (meters 47)) @@ -1195,8 +1136,7 @@ ;; failed to figure out what this is: (defpart 787 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.133) (sp-rnd-flt spt-x (meters 0) (meters 6) 1.0) (sp-flt spt-y (meters -3.5)) @@ -1230,8 +1170,7 @@ :id 154 :flags (always-draw) :bounds (static-bspherem 0 12 0 12) - :parts - ((sp-item 792 :fade-after (meters 160) :falloff-to (meters 160)) + :parts ((sp-item 792 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 793 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 794 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 795 :fade-after (meters 160) :falloff-to (meters 160)) @@ -1242,8 +1181,7 @@ ;; failed to figure out what this is: (defpart 792 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -6) (meters 1) 1.0) (sp-flt spt-y (meters 15.5)) @@ -1272,8 +1210,7 @@ ;; failed to figure out what this is: (defpart 793 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 1.4) (sp-rnd-flt spt-x (meters -4) (meters 1) 1.0) (sp-flt spt-y (meters 15.5)) @@ -1302,8 +1239,7 @@ ;; failed to figure out what this is: (defpart 794 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.4 1.0) (sp-rnd-flt spt-x (meters -6) (meters 1) 1.0) (sp-flt spt-y (meters 15.5)) @@ -1333,8 +1269,7 @@ ;; failed to figure out what this is: (defpart 795 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.4 1.0) (sp-rnd-flt spt-x (meters -4) (meters 1) 1.0) (sp-flt spt-y (meters 15.5)) @@ -1364,8 +1299,7 @@ ;; failed to figure out what this is: (defpart 796 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.133) (sp-rnd-flt spt-x (meters 0) (meters 6) 1.0) (sp-flt spt-y (meters -3.5)) @@ -1396,8 +1330,7 @@ ;; failed to figure out what this is: (defpart 797 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters 0) (meters 5) 1.0) (sp-rnd-flt spt-z (meters -8) (meters 8) 1.0) diff --git a/test/decompiler/reference/levels/village1/assistant_REF.gc b/test/decompiler/reference/levels/village1/assistant_REF.gc index bce0ed7dd5..178aa3b6b2 100644 --- a/test/decompiler/reference/levels/village1/assistant_REF.gc +++ b/test/decompiler/reference/levels/village1/assistant_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/assistant-ag.gc") + ;; definition of type assistant (deftype assistant (process-taskable) ((sound-id sound-id :offset-assert 380) @@ -21,17 +23,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *assistant-sg* assistant - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *assistant-sg* assistant assistant-lod0-jg assistant-idle-leaning-right-ja + ((assistant-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :shadow assistant-shadow-mg + ) ;; definition for method 52 of type assistant -;; INFO: Return type mismatch int vs none. +;; INFO: Return type mismatch shadow-flags vs none. (defmethod dummy-52 assistant ((obj assistant)) (let ((v1-1 (-> obj draw shadow-ctrl))) (when v1-1 @@ -45,7 +44,7 @@ ) ) 0 - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) ) ) (none) @@ -60,14 +59,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -77,113 +76,102 @@ ;; definition for method 32 of type assistant (defmethod play-anim! assistant ((obj assistant) (arg0 symbol)) - (with-pp - (case (current-status (-> obj tasks)) - (((task-status need-hint) (task-status need-introduction)) - (case (current-task (-> obj tasks)) - (((game-task jungle-eggtop)) - (when arg0 - (let* ((s5-1 (-> obj tasks)) - (s4-0 (method-of-object s5-1 save-reminder)) - (a1-3 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (s4-0 s5-1 (the int (the-as float (send-event-function *target* a1-3))) 1) - ) - (close-status! (-> obj tasks) (task-status need-introduction)) + (case (current-status (-> obj tasks)) + (((task-status need-hint) (task-status need-introduction)) + (case (current-task (-> obj tasks)) + (((game-task jungle-eggtop)) + (when arg0 + (let* ((s5-1 (-> obj tasks)) + (s4-0 (method-of-object s5-1 save-reminder)) + ) + (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (new 'static 'spool-anim - :name - "assistant-introduction-blue-eco-switch" - :index 10 - :parts 11 - :command-list - '((0 want-levels village1 beach) - (128 joint "cameraB") - (312 joint "camera") - (492 joint "cameraB") - (537 joint "camera") - (734 display-level beach movie) - (734 want-force-vis beach #t) - (735 alive "ecovent-48") - (742 blackout 10) - (743 joint "cameraB") - (745 blackout 0) - (839 alive "ecovent-200") - (841 joint "camera") - (842 dead "ecovent-48") - (942 blackout 10) - (944 joint "cameraB") - (945 blackout 0) - (945 dead "ecovent-200") - (945 display-level beach #f) - (1049 blackout 10) - (1051 joint "camera") - (1052 blackout 0) - (1135 blackout 10) - (1137 joint "cameraB") - (1138 blackout 0) - (1216 joint "camera") - ) + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "assistant-introduction-blue-eco-switch" + :index 10 + :parts 11 + :command-list '((0 want-levels village1 beach) + (128 joint "cameraB") + (312 joint "camera") + (492 joint "cameraB") + (537 joint "camera") + (734 display-level beach movie) + (734 want-force-vis beach #t) + (735 alive "ecovent-48") + (742 blackout 10) + (743 joint "cameraB") + (745 blackout 0) + (839 alive "ecovent-200") + (841 joint "camera") + (842 dead "ecovent-48") + (942 blackout 10) + (944 joint "cameraB") + (945 blackout 0) + (945 dead "ecovent-200") + (945 display-level beach #f) + (1049 blackout 10) + (1051 joint "camera") + (1052 blackout 0) + (1135 blackout 10) + (1137 joint "cameraB") + (1138 blackout 0) + (1216 joint "camera") ) ) - (else - (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name "assistant-introduction-race-bike" - :index 12 - :parts 6 - :command-list - '((0 want-levels village1 beach) (129 joint "cameraB") (319 joint "camera") (505 joint "cameraB")) - ) - ) - ) - ) - (((task-status need-reminder) (task-status need-reminder-a)) - (set! (-> obj skippable) #t) - (cond - ((= (current-task (-> obj tasks)) (game-task none)) - (new 'static 'spool-anim :name "assistant-reminder-1-generic" :index 14 :parts 2 :command-list '()) - ) - ((closed? (-> obj tasks) (game-task jungle-eggtop) (task-status need-resolution)) - (new 'static 'spool-anim :name "assistant-reminder-1-race-bike" :index 13 :parts 3 :command-list '()) - ) - ((or (closed? (-> obj tasks) (game-task misty-bike) (task-status need-resolution)) - (not (closed? (-> obj tasks) (game-task misty-bike) (task-status need-introduction))) - ) - (new 'static 'spool-anim :name "assistant-reminder-1-blue-eco-switch" :index 11 :parts 3 :command-list '()) - ) - ((zero? (get-reminder (-> obj tasks) 2)) - (if arg0 - (save-reminder (-> obj tasks) 1 2) - ) - (new 'static 'spool-anim :name "assistant-reminder-1-race-bike" :index 13 :parts 3 :command-list '()) - ) - (else - (if arg0 - (save-reminder (-> obj tasks) 0 2) - ) - (new 'static 'spool-anim :name "assistant-reminder-1-blue-eco-switch" :index 11 :parts 3 :command-list '()) - ) - ) - ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) - ) - (-> obj draw art-group data 3) ) + (else + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "assistant-introduction-race-bike" + :index 12 + :parts 6 + :command-list '((0 want-levels village1 beach) (129 joint "cameraB") (319 joint "camera") (505 joint "cameraB")) + ) + ) + ) + ) + (((task-status need-reminder) (task-status need-reminder-a)) + (set! (-> obj skippable) #t) + (cond + ((= (current-task (-> obj tasks)) (game-task none)) + (new 'static 'spool-anim :name "assistant-reminder-1-generic" :index 14 :parts 2 :command-list '()) + ) + ((closed? (-> obj tasks) (game-task jungle-eggtop) (task-status need-resolution)) + (new 'static 'spool-anim :name "assistant-reminder-1-race-bike" :index 13 :parts 3 :command-list '()) + ) + ((or (closed? (-> obj tasks) (game-task misty-bike) (task-status need-resolution)) + (not (closed? (-> obj tasks) (game-task misty-bike) (task-status need-introduction))) + ) + (new 'static 'spool-anim :name "assistant-reminder-1-blue-eco-switch" :index 11 :parts 3 :command-list '()) + ) + ((zero? (get-reminder (-> obj tasks) 2)) + (if arg0 + (save-reminder (-> obj tasks) 1 2) + ) + (new 'static 'spool-anim :name "assistant-reminder-1-race-bike" :index 13 :parts 3 :command-list '()) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 2) + ) + (new 'static 'spool-anim :name "assistant-reminder-1-blue-eco-switch" :index 11 :parts 3 :command-list '()) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) + ) + ) + (-> obj draw art-group data 3) ) ) ) @@ -197,10 +185,7 @@ (defmethod TODO-RENAME-43 assistant ((obj assistant)) (let ((s5-0 (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj))) (when s5-0 - (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-3 (the-as number (logior #x3f800000 v1-2))) - (f0-2 (+ -1.0 (the-as float v1-3))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 16384.0 (-> s5-0 y)) #f @@ -229,272 +214,80 @@ ;; failed to figure out what this is: (defstate idle (assistant) :virtual #t - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) - ) - (ja-channel-push! 1 60) + :code (behavior () + (if (!= (ja-group) assistant-idle-leaning-right-ja) + (ja-channel-push! 1 (seconds 0.2)) ) - (while #t + (loop (TODO-RENAME-43 self) - (let ((v1-9 (-> self skel root-channel 0))) - (set! (-> v1-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (let* ((v1-11 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-12 (the-as number (logior #x3f800000 v1-11))) - ) - (countdown (gp-0 (+ (the int (+ -1.0 (the-as float v1-12))) 2)) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-12 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! - a0-12 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) - ) + (ja :group! assistant-idle-leaning-right-ja) + (countdown (gp-0 (+ (the int (rand-float-gen)) 2)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) ) ) - (let* ((v1-46 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-47 (the-as number (logior #x3f800000 v1-46))) - ) - (cond - ((< (+ -1.0 (the-as float v1-47)) 0.66) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) + (cond + ((< (rand-float-gen) 0.66) + (ja-no-eval :group! assistant-idle-transition-to-welding-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sound-play "welding-loop" :id (-> self sound-id) :position (the-as symbol (target-pos 0))) + (ja :group! assistant-idle-welding-ja) + (let* ((f30-0 4.0) + (v1-76 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-77 (the-as number (logior #x3f800000 v1-76))) + ) + (countdown (gp-2 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-77)))) 4)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30))) + (suspend) + (ja :num! (seek!)) ) - ) - (sound-play-by-name - (static-sound-name "welding-loop") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (target-pos 0)) - ) - (let ((v1-74 (-> self skel root-channel 0))) - (set! (-> v1-74 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - ) - (let* ((f30-0 4.0) - (v1-76 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-77 (the-as number (logior #x3f800000 v1-76))) - ) - (countdown (gp-2 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-77)))) 4)) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-28 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-28 param 1) 1.0) - (set! (-> a0-28 frame-num) 0.0) - (joint-control-channel-group! - a0-28 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30))) - (suspend) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 param 0) (the float (+ (-> a0-31 frame-group data 0 length) -1))) - (set! (-> a0-31 param 1) 1.0) - (joint-control-channel-group-eval! a0-31 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-33 (-> self skel root-channel 0))) - (set! (-> a0-33 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-33 param 0) 0.0) - (set! (-> a0-33 param 1) 1.0) - (set! (-> a0-33 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-33 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30))) - (suspend) - (let ((a0-36 (-> self skel root-channel 0))) - (set! (-> a0-36 param 0) 0.0) - (set! (-> a0-36 param 1) 1.0) - (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - ) - ) - (sound-stop (-> self sound-id)) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-39 param 0) 0.0) - (set! (-> a0-39 param 1) 1.0) - (set! (-> a0-39 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-39 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) 0.0) - (set! (-> a0-40 param 1) 1.0) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let* ((v1-159 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-160 (the-as number (logior #x3f800000 v1-159))) - ) - (when (< (+ -1.0 (the-as float v1-160)) 0.66) - (let ((a0-44 (-> self skel root-channel 0))) - (set! (-> a0-44 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-44 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-44 param 1) 1.0) - (set! (-> a0-44 frame-num) 0.0) - (joint-control-channel-group! a0-44 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-45 (-> self skel root-channel 0))) - (set! (-> a0-45 param 0) (the float (+ (-> a0-45 frame-group data 0 length) -1))) - (set! (-> a0-45 param 1) 1.0) - (joint-control-channel-group-eval! a0-45 (the-as art-joint-anim #f) num-func-seek!) - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30))) + (suspend) + (ja :num! (seek! 0.0)) ) ) ) - (else - (let ((a0-47 (-> self skel root-channel 0))) - (set! (-> a0-47 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-47 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-47 param 1) 1.0) - (set! (-> a0-47 frame-num) 0.0) - (joint-control-channel-group! a0-47 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (sound-stop (-> self sound-id)) + (ja-no-eval :group! assistant-idle-transition-to-welding-ja :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + (when (< (rand-float-gen) 0.66) + (ja-no-eval :group! assistant-idle-wiping-brow-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (else + (ja-no-eval :group! assistant-idle-transition-right-to-left-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (countdown (gp-3 (+ (the int (rand-float-gen)) 1)) + (ja-no-eval :group! assistant-idle-leaning-left-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-48 (-> self skel root-channel 0))) - (set! (-> a0-48 param 0) (the float (+ (-> a0-48 frame-group data 0 length) -1))) - (set! (-> a0-48 param 1) 1.0) - (joint-control-channel-group-eval! a0-48 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let* ((v1-208 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-209 (the-as number (logior #x3f800000 v1-208))) - ) - (countdown (gp-3 (+ (the int (+ -1.0 (the-as float v1-209))) 1)) - (let ((a0-52 (-> self skel root-channel 0))) - (set! (-> a0-52 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-52 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-52 param 1) 1.0) - (set! (-> a0-52 frame-num) 0.0) - (joint-control-channel-group! a0-52 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-53 (-> self skel root-channel 0))) - (set! (-> a0-53 param 0) (the float (+ (-> a0-53 frame-group data 0 length) -1))) - (set! (-> a0-53 param 1) 1.0) - (joint-control-channel-group-eval! a0-53 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - ) - ) - (let ((a0-55 (-> self skel root-channel 0))) - (set! (-> a0-55 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-55 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-55 param 1) 1.0) - (set! (-> a0-55 frame-num) 0.0) - (joint-control-channel-group! a0-55 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-56 (-> self skel root-channel 0))) - (set! (-> a0-56 param 0) (the float (+ (-> a0-56 frame-group data 0 length) -1))) - (set! (-> a0-56 param 1) 1.0) - (joint-control-channel-group-eval! a0-56 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) + (ja-no-eval :group! assistant-idle-transition-left-to-right-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) ) ) ) @@ -506,16 +299,14 @@ (defpartgroup group-assistant-torch :id 122 :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 365 :fade-after (meters 30) :falloff-to (meters 30)) + :parts ((sp-item 365 :fade-after (meters 30) :falloff-to (meters 30)) (sp-item 366 :fade-after (meters 60) :falloff-to (meters 80)) ) ) ;; failed to figure out what this is: (defpart 365 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -532,8 +323,7 @@ ;; failed to figure out what this is: (defpart 366 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -559,8 +349,7 @@ ;; failed to figure out what this is: (defpart 367 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 3.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.075) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -582,13 +371,9 @@ (when (< (-> arg2 y) (-> arg1 user-float)) (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (if (< (+ -1.0 (the-as float v1-2)) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) - ) - ) + (if (< (rand-float-gen) 0.25) + (sound-play "water-drop") + ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var *sp-particle-system-2d* diff --git a/test/decompiler/reference/levels/village1/explorer_REF.gc b/test/decompiler/reference/levels/village1/explorer_REF.gc index 84f320a03b..c88ec98291 100644 --- a/test/decompiler/reference/levels/village1/explorer_REF.gc +++ b/test/decompiler/reference/levels/village1/explorer_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/explorer-ag.gc") + ;; definition of type explorer (deftype explorer (process-taskable) () @@ -19,17 +21,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *explorer-sg* explorer - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *explorer-sg* explorer explorer-lod0-jg explorer-idle-ja + ((explorer-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow explorer-shadow-mg + ) ;; definition for method 52 of type explorer -;; INFO: Return type mismatch int vs none. +;; INFO: Return type mismatch shadow-flags vs none. (defmethod dummy-52 explorer ((obj explorer)) (let ((v1-1 (-> obj draw shadow-ctrl))) (when v1-1 @@ -43,7 +42,7 @@ ) ) 0 - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) ) ) (none) @@ -58,14 +57,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -85,8 +84,7 @@ :name "explorer-introduction" :index 9 :parts 11 - :command-list - '((418 joint "cameraB") (695 shadow self #f) (695 joint "camera") (838 shadow self #t) (838 joint "cameraB")) + :command-list '((418 joint "cameraB") (695 shadow self #f) (695 joint "camera") (838 shadow self #t) (838 joint "cameraB")) ) ) (((task-status need-reminder)) @@ -100,8 +98,7 @@ :name "explorer-reminder-1" :index 10 :parts 5 - :command-list - '((0 send-event target draw #f) + :command-list '((0 send-event target draw #f) (148 send-event target draw #t) (148 joint "cameraB") (390 send-event target draw #f) @@ -134,8 +131,7 @@ :name "explorer-resolution" :index 12 :parts 5 - :command-list - '((167 joint "cameraB") (310 joint "camera")) + :command-list '((167 joint "cameraB") (310 joint "camera")) ) ) (else @@ -160,10 +156,7 @@ ;; definition for method 43 of type explorer (defmethod TODO-RENAME-43 explorer ((obj explorer)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) (play-ambient (-> obj ambient) "EXP-AM05" #f (-> obj root-override trans)) @@ -204,363 +197,149 @@ ;; failed to figure out what this is: (defstate idle (explorer) :virtual #t - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) - ) - (ja-channel-push! 1 60) + :code (behavior () + (if (!= (ja-group) explorer-idle-ja) + (ja-channel-push! 1 (seconds 0.2)) ) - (while #t + (loop (TODO-RENAME-43 self) - (let ((v1-9 (-> self skel root-channel 0))) - (set! (-> v1-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! explorer-idle-ja) (let* ((f30-0 2.0) (v1-11 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-12 (the-as number (logior #x3f800000 v1-11))) ) (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-12)))) 1)) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! explorer-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let* ((v1-40 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-41 (the-as number (logior #x3f800000 v1-40))) - ) - (cond - ((< (+ -1.0 (the-as float v1-41)) 0.5) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-17 param 1) 1.0) - (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + (cond + ((< (rand-float-gen) 0.5) + (ja-no-eval :group! explorer-idle2-look-at-map-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-1 (-> *display* base-frame-counter))) + (while (let ((s5-0 (-> *display* base-frame-counter)) + (f30-1 300.0) + (f28-0 0.5) + (f26-0 0.5) + ) + (< (- s5-0 (the-as time-frame (the int (* f30-1 (+ f28-0 (* f26-0 (rand-float-gen))))))) gp-1) + ) + (suspend) ) + ) + (when (< (rand-float-gen) 0.75) + (ja-no-eval :group! explorer-idle2-look-right-map-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (let ((gp-1 (-> *display* base-frame-counter))) - (while (let* ((s5-0 (-> *display* base-frame-counter)) - (f30-1 300.0) - (f28-0 0.5) - (f26-0 0.5) - (v1-68 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-69 (the-as number (logior #x3f800000 v1-68))) - ) - (< (- s5-0 (the-as time-frame (the int (* f30-1 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-69)))))))) gp-1) + (let ((gp-2 (-> *display* base-frame-counter))) + (while (let ((s5-1 (-> *display* base-frame-counter)) + (f30-2 300.0) + (f28-1 0.5) + (f26-1 0.5) + ) + (< (- s5-1 (the-as time-frame (the int (* f30-2 (+ f28-1 (* f26-1 (rand-float-gen))))))) gp-2) ) (suspend) ) ) - (let* ((v1-75 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-76 (the-as number (logior #x3f800000 v1-75))) - ) - (when (< (+ -1.0 (the-as float v1-76)) 0.75) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-24 param 1) 1.0) - (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-25 (-> self skel root-channel 0))) - (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) - (set! (-> a0-25 param 1) 1.0) - (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-2 (-> *display* base-frame-counter))) - (while (let* ((s5-1 (-> *display* base-frame-counter)) - (f30-2 300.0) - (f28-1 0.5) - (f26-1 0.5) - (v1-104 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-105 (the-as number (logior #x3f800000 v1-104))) - ) - (< (- s5-1 (the-as time-frame (the int (* f30-2 (+ f28-1 (* f26-1 (+ -1.0 (the-as float v1-105)))))))) gp-2) - ) - (suspend) - ) - ) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-29 param 0) 0.0) - (set! (-> a0-29 param 1) 1.0) - (set! (-> a0-29 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-29 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 param 0) 0.0) - (set! (-> a0-30 param 1) 1.0) - (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let* ((v1-135 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-136 (the-as number (logior #x3f800000 v1-135))) - ) - (when (< (+ -1.0 (the-as float v1-136)) 0.5) - (let ((a0-34 (-> self skel root-channel 0))) - (set! (-> a0-34 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-34 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-34 param 1) 1.0) - (set! (-> a0-34 frame-num) 0.0) - (joint-control-channel-group! a0-34 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 param 0) (the float (+ (-> a0-35 frame-group data 0 length) -1))) - (set! (-> a0-35 param 1) 1.0) - (joint-control-channel-group-eval! a0-35 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-3 (-> *display* base-frame-counter))) - (while (let* ((s5-2 (-> *display* base-frame-counter)) - (f30-3 300.0) - (f28-2 0.5) - (f26-2 0.5) - (v1-164 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-165 (the-as number (logior #x3f800000 v1-164))) - ) - (< (- s5-2 (the-as time-frame (the int (* f30-3 (+ f28-2 (* f26-2 (+ -1.0 (the-as float v1-165)))))))) gp-3) - ) - (suspend) - ) - ) - (let ((a0-39 (-> self skel root-channel 0))) - (set! (-> a0-39 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-39 param 0) 0.0) - (set! (-> a0-39 param 1) 1.0) - (set! (-> a0-39 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-39 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 param 0) 0.0) - (set! (-> a0-40 param 1) 1.0) - (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - ) - ) - ) - ) - (let ((a0-42 (-> self skel root-channel 0))) - (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-42 param 0) 0.0) - (set! (-> a0-42 param 1) 1.0) - (set! (-> a0-42 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) 0.0) - (set! (-> a0-43 param 1) 1.0) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) + (ja :num! (seek! 0.0)) + ) + (when (< (rand-float-gen) 0.5) + (ja-no-eval :group! explorer-idle2-look-right-map-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-3 (-> *display* base-frame-counter))) + (while (let ((s5-2 (-> *display* base-frame-counter)) + (f30-3 300.0) + (f28-2 0.5) + (f26-2 0.5) + ) + (< (- s5-2 (the-as time-frame (the int (* f30-3 (+ f28-2 (* f26-2 (rand-float-gen))))))) gp-3) + ) + (suspend) + ) + ) + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) ) ) ) - (else - (let ((a0-45 (-> self skel root-channel 0))) - (set! (-> a0-45 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-45 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-45 param 1) 1.0) - (set! (-> a0-45 frame-num) 0.0) - (joint-control-channel-group! a0-45 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) - (until (ja-done? 0) + (ja-no-eval :group! explorer-idle2-look-at-map-ja :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + (else + (ja-no-eval :group! explorer-idle3-step-right-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-4 (-> *display* base-frame-counter))) + (while (let ((s5-3 (-> *display* base-frame-counter)) + (f30-4 300.0) + (f28-3 0.5) + (f26-3 0.5) + ) + (< (- s5-3 (the-as time-frame (the int (* f30-4 (+ f28-3 (* f26-3 (rand-float-gen))))))) gp-4) + ) (suspend) - (let ((a0-46 (-> self skel root-channel 0))) - (set! (-> a0-46 param 0) (the float (+ (-> a0-46 frame-group data 0 length) -1))) - (set! (-> a0-46 param 1) 1.0) - (joint-control-channel-group-eval! a0-46 (the-as art-joint-anim #f) num-func-seek!) - ) ) - (let ((gp-4 (-> *display* base-frame-counter))) - (while (let* ((s5-3 (-> *display* base-frame-counter)) - (f30-4 300.0) - (f28-3 0.5) - (f26-3 0.5) - (v1-237 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-238 (the-as number (logior #x3f800000 v1-237))) - ) - (< (- s5-3 (the-as time-frame (the int (* f30-4 (+ f28-3 (* f26-3 (+ -1.0 (the-as float v1-238)))))))) gp-4) - ) - (suspend) - ) - ) - (let ((a0-50 (-> self skel root-channel 0))) - (set! (-> a0-50 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-50 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-50 param 1) 1.0) - (set! (-> a0-50 frame-num) 0.0) - (joint-control-channel-group! a0-50 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) - (until (ja-done? 0) + ) + (ja-no-eval :group! explorer-idle3-looking-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-5 (-> *display* base-frame-counter))) + (while (let ((s5-4 (-> *display* base-frame-counter)) + (f30-5 300.0) + (f28-4 0.5) + (f26-4 0.5) + ) + (< (- s5-4 (the-as time-frame (the int (* f30-5 (+ f28-4 (* f26-4 (rand-float-gen))))))) gp-5) + ) (suspend) - (let ((a0-51 (-> self skel root-channel 0))) - (set! (-> a0-51 param 0) (the float (+ (-> a0-51 frame-group data 0 length) -1))) - (set! (-> a0-51 param 1) 1.0) - (joint-control-channel-group-eval! a0-51 (the-as art-joint-anim #f) num-func-seek!) - ) ) - (let ((gp-5 (-> *display* base-frame-counter))) - (while (let* ((s5-4 (-> *display* base-frame-counter)) - (f30-5 300.0) - (f28-4 0.5) - (f26-4 0.5) - (v1-268 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-269 (the-as number (logior #x3f800000 v1-268))) - ) - (< (- s5-4 (the-as time-frame (the int (* f30-5 (+ f28-4 (* f26-4 (+ -1.0 (the-as float v1-269)))))))) gp-5) - ) - (suspend) - ) - ) - (let ((a0-55 (-> self skel root-channel 0))) - (set! (-> a0-55 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-55 param 0) 0.0) - (set! (-> a0-55 param 1) 1.0) - (set! (-> a0-55 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-55 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) + ) + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + (let ((gp-6 (-> *display* base-frame-counter))) + (while (let ((s5-5 (-> *display* base-frame-counter)) + (f30-6 300.0) + (f28-5 0.5) + (f26-5 0.5) + ) + (< (- s5-5 (the-as time-frame (the int (* f30-6 (+ f28-5 (* f26-5 (rand-float-gen))))))) gp-6) + ) (suspend) - (let ((a0-56 (-> self skel root-channel 0))) - (set! (-> a0-56 param 0) 0.0) - (set! (-> a0-56 param 1) 1.0) - (joint-control-channel-group-eval! a0-56 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((gp-6 (-> *display* base-frame-counter))) - (while (let* ((s5-5 (-> *display* base-frame-counter)) - (f30-6 300.0) - (f28-5 0.5) - (f26-5 0.5) - (v1-301 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-302 (the-as number (logior #x3f800000 v1-301))) - ) - (< (- s5-5 (the-as time-frame (the int (* f30-6 (+ f28-5 (* f26-5 (+ -1.0 (the-as float v1-302)))))))) gp-6) - ) - (suspend) - ) - ) - (let ((a0-60 (-> self skel root-channel 0))) - (set! (-> a0-60 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-60 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-60 param 1) 1.0) - (set! (-> a0-60 frame-num) 0.0) - (joint-control-channel-group! a0-60 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-61 (-> self skel root-channel 0))) - (set! (-> a0-61 param 0) (the float (+ (-> a0-61 frame-group data 0 length) -1))) - (set! (-> a0-61 param 1) 1.0) - (joint-control-channel-group-eval! a0-61 (the-as art-joint-anim #f) num-func-seek!) - ) ) ) + (ja-no-eval :group! explorer-idle3-step-left-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) ) ) ) diff --git a/test/decompiler/reference/levels/village1/farmer_REF.gc b/test/decompiler/reference/levels/village1/farmer_REF.gc index 324364aa26..0cf8506044 100644 --- a/test/decompiler/reference/levels/village1/farmer_REF.gc +++ b/test/decompiler/reference/levels/village1/farmer_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/farmer-ag.gc") + ;; definition of type farmer (deftype farmer (process-taskable) () @@ -19,14 +21,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *farmer-sg* farmer - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 3 - ) +(defskelgroup *farmer-sg* farmer farmer-lod0-jg farmer-sitting-cycle-ja + ((farmer-lod0-mg (meters 20)) (farmer-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow farmer-shadow-mg + ) ;; definition for method 32 of type farmer (defmethod play-anim! farmer ((obj farmer) (arg0 symbol)) @@ -90,10 +89,7 @@ ;; definition for method 43 of type farmer (defmethod TODO-RENAME-43 farmer ((obj farmer)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.8333333 f0-2) (play-ambient (-> obj ambient) "FAR-LO1A" #f (-> obj root-override trans)) diff --git a/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc b/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc index ca5c436f89..2bfafa80cc 100644 --- a/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc +++ b/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc @@ -1,6 +1,10 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/evilbro-ag.gc") +(import "goal_src/import/fishermans-boat-ag.gc") +(import "goal_src/import/evilsis-ag.gc") + ;; definition for symbol *fishermans-boat-constants*, type rigid-body-platform-constants (define *fishermans-boat-constants* (new 'static 'rigid-body-platform-constants :drag-factor 2.0 @@ -138,7 +142,7 @@ (set! (-> s3-0 w) 1.0) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 s3-0 (new 'static 'rgba :r #xff :g #xff :a #x80) @@ -147,7 +151,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 s5-0 (meters 0.00024414062) @@ -509,14 +513,14 @@ (debug-draw (-> obj path)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj dest-circle) (-> obj dest-circle w) (new 'static 'rgba :g #xff :a #x80) ) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj target-point) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) @@ -626,31 +630,23 @@ ) ;; failed to figure out what this is: -(defskelgroup *fishermans-boat-sg* fishermans-boat - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 3 0 15) - :longest-edge (meters 7.3) - ) +(defskelgroup *fishermans-boat-sg* fishermans-boat fishermans-boat-lod0-jg fishermans-boat-idle-ja + ((fishermans-boat-lod0-mg (meters 20)) (fishermans-boat-lod1-mg (meters 999999))) + :bounds (static-spherem 0 3 0 15) + :longest-edge (meters 7.3) + ) ;; failed to figure out what this is: -(defskelgroup *fb-evilbro-sg* evilbro - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - ) +(defskelgroup *fb-evilbro-sg* evilbro evilbro-lod0-jg evilbro-idle-ja + ((evilbro-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) ;; failed to figure out what this is: -(defskelgroup *fb-evilsis-sg* evilsis - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1) - :longest-edge (meters 0) - ) +(defskelgroup *fb-evilsis-sg* evilsis evilsis-lod0-jg evilsis-idle-ja + ((evilsis-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) ;; definition for method 23 of type fishermans-boat ;; INFO: Return type mismatch int vs none. @@ -773,8 +769,7 @@ ;; failed to figure out what this is: (defpart 2896 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xa :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-x (meters 10)) (sp-rnd-flt spt-scale-x (meters 1.5) (meters 3) 1.0) @@ -843,12 +838,8 @@ ;; INFO: Return type mismatch int vs none. (defbehavior fishermans-boat-play-sounds fishermans-boat () (if (-> self ignition) - (set! (-> self engine-sound-envelope) - (seek (-> self engine-sound-envelope) 1.0 (* 2.0 (-> *display* seconds-per-frame))) - ) - (set! (-> self engine-sound-envelope) - (seek (-> self engine-sound-envelope) 0.0 (-> *display* seconds-per-frame)) - ) + (seek! (-> self engine-sound-envelope) 1.0 (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self engine-sound-envelope) 0.0 (-> *display* seconds-per-frame)) ) (cond ((< 0.0 (-> self engine-sound-envelope)) @@ -861,14 +852,12 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (vector<-cspace! gp-0 (-> self node-list data 4)) - (sound-play-by-name - (static-sound-name "boat-engine") - (-> self engine-sound-id) - (the int (* 10.24 f30-0)) - (the int (* 1524.0 f28-0)) - 0 - 1 - (the-as symbol gp-0) + (sound-play + "boat-engine" + :id (-> self engine-sound-id) + :vol f30-0 + :pitch f28-0 + :position (the-as symbol gp-0) ) ) ) @@ -888,17 +877,7 @@ (defbehavior fishermans-boat-post fishermans-boat () (when (and *target* (-> self kill-player)) (set! (-> self kill-player) #f) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'attack) - (set! (-> a1-0 param 0) (the-as uint #f)) - (let ((a0-0 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-0 mode) 'endlessfall) - (set! (-> a1-0 param 1) (the-as uint a0-0)) - ) - (when (send-event-function *target* a1-0) - ) + (when (send-event *target* 'attack #f (static-attack-info ((mode 'endlessfall)))) ) ) (when (and *target* (-> self ignition)) @@ -910,15 +889,11 @@ (else (when (not (-> self measure-parameters)) (let ((f0-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0))) - (set! (-> self controller steering) - (seek (-> self controller steering) (fmax -1.0 (fmin 1.0 f0-0)) (-> *display* seconds-per-frame)) - ) + (seek! (-> self controller steering) (fmax -1.0 (fmin 1.0 f0-0)) (-> *display* seconds-per-frame)) ) (if (cpad-hold? 0 x) - (set! (-> self controller throttle) (seek (-> self controller throttle) 0.8 (-> *display* seconds-per-frame))) - (set! (-> self controller throttle) - (seek (-> self controller throttle) 0.0 (* 0.25 (-> *display* seconds-per-frame))) - ) + (seek! (-> self controller throttle) 0.8 (-> *display* seconds-per-frame)) + (seek! (-> self controller throttle) 0.0 (* 0.25 (-> *display* seconds-per-frame))) ) 0 ) @@ -939,9 +914,7 @@ ) ) (if (-> self ignition) - (set! (-> self engine-thrust) - (seek (-> self engine-thrust) (* 1228800.0 (-> self controller throttle)) 6144.0) - ) + (seek! (-> self engine-thrust) (* 1228800.0 (-> self controller throttle)) 6144.0) (set! (-> self engine-thrust) 0.0) ) (cond @@ -955,7 +928,7 @@ ) ) (else - (set! (-> self propeller spin-rate) (seek (-> self propeller spin-rate) 0.0 218.45334)) + (seek! (-> self propeller spin-rate) 0.0 218.45334) ) ) (TODO-RENAME-28 self) @@ -965,14 +938,14 @@ (dummy-16 (-> self controller)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> self boat-path)) 614400.0 (new 'static 'rgba :b #xff :a #x80) ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (&-> self stack 848)) 409600.0 (new 'static 'rgba :b #xff :a #x80) @@ -1045,18 +1018,15 @@ ;; failed to figure out what this is: (defstate fishermans-boat-docked-village (fishermans-boat) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior fishermans-boat) rigid-body-platform-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (fishermans-boat-leave-dock?) (go fishermans-boat-ride-to-misty) ) @@ -1066,14 +1036,12 @@ ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self anim) (new 'static 'spool-anim :name "fishermans-boat-ride-to-misty" :index 15 :parts 3 - :command-list - '((0 want-levels village1 misty) + :command-list '((0 want-levels village1 misty) (0 shadow target #f) (0 shadow sidekick #f) (250 display-level misty display) @@ -1092,14 +1060,12 @@ (anim-loop) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) ;; failed to figure out what this is: (defstate fishermans-boat-leaving-village (fishermans-boat) - :trans - (behavior () + :trans (behavior () (when (< 614400.0 (vector-vector-xz-distance (-> self root-overlay trans) (-> self dock-point))) (load-state-want-display-level 'village1 'special) (load-state-want-display-level 'misty 'display) @@ -1110,51 +1076,41 @@ (rider-trans) (none) ) - :code - (behavior () + :code (behavior () (load-state-want-levels 'village1 'misty) - (let ((gp-0 (get-process *default-dead-pool* camera-tracker #x4000))) - (set! (-> self cam-tracker) - (ppointer->handle (when gp-0 - (let ((t9-2 (method-of-type camera-tracker activate))) - (t9-2 (the-as camera-tracker gp-0) self 'camera-tracker (the-as pointer #x70004000)) + (set! (-> self cam-tracker) + (ppointer->handle (process-spawn + camera-tracker + :init camera-tracker-init + (lambda :behavior fishermans-boat + () + (camera-change-to "camera-282" 0 #f) + (while (!= (-> self rbody lin-momentum-damping-factor) 'release) + (suspend) ) - (run-now-in-process - gp-0 - camera-tracker-init - (lambda :behavior fishermans-boat - () - (camera-change-to "camera-282" 0 #f) - (while (!= (-> self rbody lin-momentum-damping-factor) 'release) - (suspend) - ) - (set! (-> self rbody lin-momentum-damping-factor) (the-as float #f)) - (camera-change-to (the-as string 'base) 0 #f) - (none) - ) - ) - (-> gp-0 ppointer) + (set! (-> self rbody lin-momentum-damping-factor) (the-as float #f)) + (camera-change-to (the-as string 'base) 0 #f) + (none) ) + :to self ) - ) - ) + ) + ) (send-event (handle->process (-> self cam-tracker)) 'border #t) (send-event (handle->process (-> self cam-tracker)) 'mask #x20800) (fishermans-boat-set-path-point 0) (fishermans-boat-next-path-point) - (while #t + (loop (suspend) ) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) ;; failed to figure out what this is: (defstate fishermans-boat-entering-village (fishermans-boat) - :trans - (behavior () + :trans (behavior () (when (fishermans-boat-enter-dock?) (set! (-> self waiting-for-player) #f) (when #t @@ -1169,8 +1125,7 @@ (rider-trans) (none) ) - :code - (behavior () + :code (behavior () (load-state-want-levels 'village1 'beach) (load-state-want-vis 'vi1) (fishermans-boat-set-dock-point 0) @@ -1178,24 +1133,20 @@ (anim-loop) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) ;; failed to figure out what this is: (defstate fishermans-boat-docked-misty (fishermans-boat) - :event - (the-as + :event (the-as (function process int symbol event-message-block object :behavior fishermans-boat) rigid-body-platform-event-handler ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (if (fishermans-boat-leave-dock?) (go fishermans-boat-ride-to-village1) ) @@ -1205,15 +1156,13 @@ ) (none) ) - :code - (behavior () + :code (behavior () (if #t (set! (-> self anim) (new 'static 'spool-anim :name "fishermans-boat-ride-to-village1" :index 16 :parts 3 - :command-list - '((0 want-levels village1 misty) + :command-list '((0 want-levels village1 misty) (0 shadow target #f) (0 shadow sidekick #f) (250 display-level village1 display) @@ -1231,8 +1180,7 @@ :name "fishermans-boat-ride-to-village1-alt" :index 17 :parts 12 - :command-list - '((0 want-levels village1 misty) + :command-list '((0 want-levels village1 misty) (105 want-levels village1 intro) (150 display-level intro display) (150 want-vis int) @@ -1258,14 +1206,12 @@ (anim-loop) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) ;; failed to figure out what this is: (defstate fishermans-boat-leaving-misty (fishermans-boat) - :trans - (behavior () + :trans (behavior () (when (< 409600.0 (vector-vector-xz-distance (-> self root-overlay trans) (-> self dock-point))) (load-state-want-force-vis 'village1 #t) (load-state-want-display-level 'village1 'display) @@ -1276,50 +1222,40 @@ (rider-trans) (none) ) - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* camera-tracker #x4000))) - (set! (-> self cam-tracker) - (ppointer->handle (when gp-0 - (let ((t9-1 (method-of-type camera-tracker activate))) - (t9-1 (the-as camera-tracker gp-0) self 'camera-tracker (the-as pointer #x70004000)) + :code (behavior () + (set! (-> self cam-tracker) + (ppointer->handle (process-spawn + camera-tracker + :init camera-tracker-init + (lambda :behavior fishermans-boat + () + (camera-change-to "camera-287" 0 #f) + (while (!= (-> self rbody lin-momentum-damping-factor) 'release) + (suspend) ) - (run-now-in-process - gp-0 - camera-tracker-init - (lambda :behavior fishermans-boat - () - (camera-change-to "camera-287" 0 #f) - (while (!= (-> self rbody lin-momentum-damping-factor) 'release) - (suspend) - ) - (set! (-> self rbody lin-momentum-damping-factor) (the-as float #f)) - (camera-change-to (the-as string 'base) 0 #f) - (none) - ) - ) - (-> gp-0 ppointer) + (set! (-> self rbody lin-momentum-damping-factor) (the-as float #f)) + (camera-change-to (the-as string 'base) 0 #f) + (none) ) + :to self ) - ) - ) + ) + ) (send-event (handle->process (-> self cam-tracker)) 'border #t) (send-event (handle->process (-> self cam-tracker)) 'mask #x20800) (fishermans-boat-set-path-point 4) (fishermans-boat-next-path-point) - (while #t + (loop (suspend) ) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) ;; failed to figure out what this is: (defstate fishermans-boat-entering-misty (fishermans-boat) - :trans - (behavior () + :trans (behavior () (when (fishermans-boat-enter-dock?) (set! (-> self waiting-for-player) #f) (level-hint-spawn @@ -1338,30 +1274,26 @@ (rider-trans) (none) ) - :code - (behavior () + :code (behavior () (set-continue! *game-info* "misty-start") (fishermans-boat-set-dock-point 4) (fishermans-boat-set-path-point 2) - (while #t + (loop (suspend) ) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) ;; failed to figure out what this is: (defstate fishermans-boat-player-control (fishermans-boat) - :exit - (behavior () + :exit (behavior () (send-event *camera* 'change-state *camera-base-mode* 0) (set! (-> self auto-pilot) #t) (none) ) - :trans - (behavior () + :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (nth-point (-> self boat-path) 0 gp-0) (if (< (vector-vector-xz-distance (-> self root-overlay trans) gp-0) 614400.0) @@ -1375,12 +1307,11 @@ 0 (none) ) - :code - (behavior () + :code (behavior () (send-event (handle->process (-> self cam-tracker)) 'message 'release) (suspend) (send-event *camera* 'change-state cam-stick 0) - (while #t + (loop (if (and (= *cheat-mode* 'debug) (cpad-pressed? 0 triangle)) (set! (-> self auto-pilot) #f) ) @@ -1388,8 +1319,7 @@ ) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) ;; definition for function fishermans-boat-set-throttle-by-speed @@ -1408,20 +1338,17 @@ ;; failed to figure out what this is: (defstate fishermans-boat-measurements (fishermans-boat) - :exit - (behavior () + :exit (behavior () (set! (-> self measure-parameters) #f) (none) ) - :trans - (behavior () + :trans (behavior () (if (cpad-pressed? 1 square) (go fishermans-boat-player-control) ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self auto-pilot) #f) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 1) @@ -1459,8 +1386,7 @@ (go fishermans-boat-player-control) (none) ) - :post - fishermans-boat-post + :post fishermans-boat-post ) ;; definition for method 7 of type fishermans-boat @@ -1660,106 +1586,82 @@ ;; failed to figure out what this is: (defstate fishermans-boat-ride-to-misty (fishermans-boat) - :code - (behavior () + :code (behavior () (set! (-> self propeller enable) #f) (quaternion-identity! (-> self root-overlay quat)) (set! (-> self root-overlay trans quad) (-> self entity extra trans quad)) (set! (-> self player-riding) #f) (set! (-> self auto-pilot) #f) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'clone-anim) - (set! (-> a1-0 param 0) (the-as uint self)) - (when (send-event-function *target* a1-0) - (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) - (send-event *target* 'blend-shape #t) - (let* ((gp-0 (get-process *default-dead-pool* othercam #x4000)) - (v1-20 (when gp-0 - (let ((t9-5 (method-of-type othercam activate))) - (t9-5 (the-as othercam gp-0) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 othercam-init-by-other self 5 #f #t) - (-> gp-0 ppointer) - ) - ) - ) - (send-event (ppointer->process v1-20) 'mask 2048) - ) - (set! (-> self draw force-lod) 0) - (ja-play-spooled-anim - (-> self anim) - (the-as art-joint-anim (-> self draw art-group data 3)) - (the-as art-joint-anim #f) - (the-as (function process-drawable symbol) false-func) - ) - (set! (-> self draw force-lod) -1) - (send-event *target* 'blend-shape #f) - (ja-channel-set! 1) - (let ((v1-33 (-> self skel root-channel 0))) - (set! (-> v1-33 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (vector<-cspace! (-> self root-overlay trans) (-> self node-list data 3)) - (matrix->quaternion (-> self root-overlay quat) (-> self node-list data 3 bone transform)) - (fishermans-boat-reset-physics) - (transform-post) - (when *target* - (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) - (send-event *target* 'trans 'restore (-> self old-target-pos)) - (send-event *target* 'end-mode) - (update-transforms! (-> self root-overlay)) - (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) - (logior! (-> *target* control status) 7) - (suspend) - (send-event *camera* 'teleport-to-other-start-string) - ) - (set-continue! *game-info* "misty-start") + (when (send-event *target* 'clone-anim self) + (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) + (send-event *target* 'blend-shape #t) + (let ((v1-20 (process-spawn othercam self 5 #f #t :to self))) + (send-event (ppointer->process v1-20) 'mask 2048) ) + (set! (-> self draw force-lod) 0) + (ja-play-spooled-anim + (-> self anim) + (the-as art-joint-anim fishermans-boat-idle-ja) + (the-as art-joint-anim #f) + (the-as (function process-drawable symbol) false-func) + ) + (set! (-> self draw force-lod) -1) + (send-event *target* 'blend-shape #f) + (ja-channel-set! 1) + (ja :group! fishermans-boat-idle-ja) + (vector<-cspace! (-> self root-overlay trans) (-> self node-list data 3)) + (matrix->quaternion (-> self root-overlay quat) (-> self node-list data 3 bone transform)) + (fishermans-boat-reset-physics) + (transform-post) + (when *target* + (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) + (send-event *target* 'trans 'restore (-> self old-target-pos)) + (send-event *target* 'end-mode) + (update-transforms! (-> self root-overlay)) + (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) + (logior! (-> *target* control status) (cshape-moving-flags onsurf onground tsurf)) + (suspend) + (send-event *camera* 'teleport-to-other-start-string) + ) + (set-continue! *game-info* "misty-start") ) (set! (-> self waiting-for-player) #t) (set! (-> self ignition) #f) (set! (-> self anchored) #t) (set! (-> self propeller enable) #t) (fishermans-boat-play-sounds) - (copy-settings-from-target! *setting-control*) - (let ((gp-1 (get-process *default-dead-pool* process #x4000))) - (when gp-1 - (let ((t9-25 (method-of-type process activate))) - (t9-25 gp-1 self 'process (the-as pointer #x70004000)) + (apply-settings *setting-control*) + (process-spawn-function + process + (lambda :behavior fishermans-boat + () + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) + (suspend) + ) ) - (run-next-time-in-process gp-1 (lambda :behavior fishermans-boat - () - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) - (suspend) - ) - ) - (while (or (-> *setting-control* current ambient) - (-> *setting-control* current hint) - (-> *setting-control* current movie) - ) - (suspend) - ) - (suspend) - (level-hint-spawn - (game-text-id misty-daxter-scared) - "sksp0060" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (none) - ) - ) - (-> gp-1 ppointer) + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current hint) + (-> *setting-control* current movie) + ) + (suspend) + ) + (suspend) + (level-hint-spawn + (game-text-id misty-daxter-scared) + "sksp0060" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + (none) ) + :to self ) (go fishermans-boat-docked-misty) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (fishermans-boat-spawn-particles 81920.0) (fishermans-boat-play-sounds) @@ -1769,8 +1671,7 @@ ;; failed to figure out what this is: (defstate fishermans-boat-ride-to-village1 (fishermans-boat) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object @@ -1779,19 +1680,9 @@ (when (= (level-status *level* 'intro) 'active) (let ((gp-1 (entity-by-name "evilbro-2"))) (when gp-1 - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self evilbro) - (ppointer->handle - (when s5-0 - (let ((t9-3 (method-of-type manipy activate))) - (t9-3 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> self root-overlay trans) gp-1 *fb-evilbro-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> self evilbro) + (ppointer->handle (manipy-spawn (-> self root-overlay trans) gp-1 *fb-evilbro-sg* #f :to self)) + ) (send-event (handle->process (-> self evilbro)) 'anim-mode 'clone-anim) (send-event (handle->process (-> self evilbro)) 'blend-shape #t) (send-event (handle->process (-> self evilbro)) 'center-joint 3) @@ -1799,19 +1690,9 @@ ) (let ((gp-2 (entity-by-name "evilsis-2"))) (when gp-2 - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self evilsis) - (ppointer->handle - (when s5-1 - (let ((t9-10 (method-of-type manipy activate))) - (t9-10 (the-as manipy s5-1) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> self root-overlay trans) gp-2 *fb-evilsis-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) + (set! (-> self evilsis) + (ppointer->handle (manipy-spawn (-> self root-overlay trans) gp-2 *fb-evilsis-sg* #f :to self)) + ) (send-event (handle->process (-> self evilsis)) 'anim-mode 'clone-anim) (send-event (handle->process (-> self evilsis)) 'blend-shape #t) (send-event (handle->process (-> self evilsis)) 'center-joint 3) @@ -1835,8 +1716,7 @@ ) ) ) - :code - (behavior () + :code (behavior () (set! (-> self propeller enable) #f) (set! (-> self evilbro) (the-as handle #f)) (set! (-> self evilsis) (the-as handle #f)) @@ -1844,55 +1724,38 @@ (set! (-> self root-overlay trans quad) (-> self entity extra trans quad)) (set! (-> self player-riding) #f) (set! (-> self auto-pilot) #f) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'clone-anim) - (set! (-> a1-0 param 0) (the-as uint self)) - (when (send-event-function *target* a1-0) - (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) - (send-event *target* 'blend-shape #t) - (let* ((gp-0 (get-process *default-dead-pool* othercam #x4000)) - (v1-20 (when gp-0 - (let ((t9-5 (method-of-type othercam activate))) - (t9-5 (the-as othercam gp-0) self 'othercam (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 othercam-init-by-other self 5 #f #t) - (-> gp-0 ppointer) - ) - ) - ) - (send-event (ppointer->process v1-20) 'mask 2048) - ) - (set! (-> self draw force-lod) 0) - (ja-play-spooled-anim - (-> self anim) - (the-as art-joint-anim (-> self draw art-group data 3)) - (the-as art-joint-anim #f) - (the-as (function process-drawable symbol) false-func) - ) - (set! (-> self draw force-lod) -1) - (send-event *target* 'blend-shape #f) - (ja-channel-set! 1) - (let ((v1-33 (-> self skel root-channel 0))) - (set! (-> v1-33 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (vector<-cspace! (-> self root-overlay trans) (-> self node-list data 3)) - (matrix->quaternion (-> self root-overlay quat) (-> self node-list data 3 bone transform)) - (fishermans-boat-reset-physics) - (transform-post) - (when *target* - (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) - (send-event *target* 'trans 'restore (-> self old-target-pos)) - (send-event *target* 'end-mode) - (update-transforms! (-> self root-overlay)) - (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) - (logior! (-> *target* control status) 7) - (suspend) - (send-event *camera* 'teleport-to-other-start-string) - ) - (set-continue! *game-info* "village1-hut") + (when (send-event *target* 'clone-anim self) + (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) + (send-event *target* 'blend-shape #t) + (let ((v1-20 (process-spawn othercam self 5 #f #t :to self))) + (send-event (ppointer->process v1-20) 'mask 2048) ) + (set! (-> self draw force-lod) 0) + (ja-play-spooled-anim + (-> self anim) + (the-as art-joint-anim fishermans-boat-idle-ja) + (the-as art-joint-anim #f) + (the-as (function process-drawable symbol) false-func) + ) + (set! (-> self draw force-lod) -1) + (send-event *target* 'blend-shape #f) + (ja-channel-set! 1) + (ja :group! fishermans-boat-idle-ja) + (vector<-cspace! (-> self root-overlay trans) (-> self node-list data 3)) + (matrix->quaternion (-> self root-overlay quat) (-> self node-list data 3 bone transform)) + (fishermans-boat-reset-physics) + (transform-post) + (when *target* + (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) + (send-event *target* 'trans 'restore (-> self old-target-pos)) + (send-event *target* 'end-mode) + (update-transforms! (-> self root-overlay)) + (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) + (logior! (-> *target* control status) (cshape-moving-flags onsurf onground tsurf)) + (suspend) + (send-event *camera* 'teleport-to-other-start-string) + ) + (set-continue! *game-info* "village1-hut") ) (set! (-> self waiting-for-player) #t) (set! (-> self ignition) #f) @@ -1903,8 +1766,7 @@ (go fishermans-boat-docked-village) (none) ) - :post - (behavior () + :post (behavior () (ja-post) (fishermans-boat-spawn-particles 81920.0) (fishermans-boat-play-sounds) diff --git a/test/decompiler/reference/levels/village1/sage_REF.gc b/test/decompiler/reference/levels/village1/sage_REF.gc index 15a083f0b1..7f57a35865 100644 --- a/test/decompiler/reference/levels/village1/sage_REF.gc +++ b/test/decompiler/reference/levels/village1/sage_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/sage-ag.gc") + ;; definition of type sage (deftype sage (process-taskable) ((reminder-played basic :offset-assert 380) @@ -23,346 +25,318 @@ ) ;; failed to figure out what this is: -(defskelgroup *sage-sg* sage - 0 - 4 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *sage-sg* sage sage-lod0-jg sage-idle-ecorocks-breathe-ja + ((sage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow sage-shadow-mg + ) ;; definition for method 32 of type sage (defmethod play-anim! sage ((obj sage) (arg0 symbol)) - (with-pp - (when (!= *kernel-boot-message* 'play) - (close-specific-task! (game-task intro) (task-status need-resolution)) - (return (new 'static 'spool-anim - :name "sage-introduction-misty-cannon" - :index 8 - :parts 12 - :command-list - '((1 blackout 0) - (100 want-levels village1 misty) - (261 joint "cameraB") - (521 joint "camera") - (776 joint "cameraB") - (810 joint "camera") - (1171 joint "cameraB") - (1235 joint "camera") - (1235 save) - (1418 blackout 30) - ) + (when (!= *kernel-boot-message* 'play) + (close-specific-task! (game-task intro) (task-status need-resolution)) + (return (new 'static 'spool-anim + :name "sage-introduction-misty-cannon" + :index 8 + :parts 12 + :command-list '((1 blackout 0) + (100 want-levels village1 misty) + (261 joint "cameraB") + (521 joint "camera") + (776 joint "cameraB") + (810 joint "camera") + (1171 joint "cameraB") + (1235 joint "camera") + (1235 save) + (1418 blackout 30) ) ) - ) - (case (current-status (-> obj tasks)) - (((task-status need-hint) (task-status need-introduction)) - (case (current-task (-> obj tasks)) - (((game-task intro)) - (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (set-setting! *setting-control* pp 'music-volume-movie 'abs 0.0 0) - (copy-settings-from-target! *setting-control*) ) - (new 'static 'spool-anim - :name "sage-intro-sequence-d1" - :index 16 - :parts 17 - :command-list - '((0 display-level misty #f) - (0 display-level village1 display) - (0 want-vis vi1) - (0 save) - (0 want-force-inside village1 #t) - (0 want-force-vis village1 #t) - (0 kill "assistant-11") - (0 kill "reflector-middle-2") - (0 kill "eco-11") - (0 kill "eco-10") - (0 kill "sharkey-12") - (0 kill "reflector-end-1") - (0 kill "water-vol-10") - (0 kill "water-vol-8") - (0 kill "water-vol-7") - (0 kill "fishermans-boat-2") - (0 kill "revcycleprop-2") - (0 kill "revcycle-8") - (0 kill "ropebridge-5") - (0 kill "ropebridge-4") - (0 kill "villagea-water-2") - (0 time-of-day 7) - (1 time-of-day -1) - (3 blackout 0) - (25 blackout 0) - (25 want-force-vis village1 #f) - (56 joint "cameraB") - (100 want-force-inside village1 #f) - (107 joint "camera") - (137 joint "cameraB") - (202 joint "camera") - (286 joint "cameraB") - (554 joint "camera") - (633 joint "cameraB") - (711 joint "camera") - (796 joint "cameraB") - (921 joint "camera") - (1021 shadow self #f) - (1021 joint "cameraB") - (1081 joint "camera") - (1183 joint "cameraB") - (1221 joint "camera") - (1496 shadow self #t) - (1496 joint "cameraB") - (1496 time-of-day 18) - (1721 joint "camera") - (1721 time-of-day 7) - (1722 time-of-day -1) - ) + ) + (case (current-status (-> obj tasks)) + (((task-status need-hint) (task-status need-introduction)) + (case (current-task (-> obj tasks)) + (((game-task intro)) + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (set-setting! 'music-volume-movie 'abs 0.0 0) + (apply-settings *setting-control*) + ) + (new 'static 'spool-anim + :name "sage-intro-sequence-d1" + :index 16 + :parts 17 + :command-list '((0 display-level misty #f) + (0 display-level village1 display) + (0 want-vis vi1) + (0 save) + (0 want-force-inside village1 #t) + (0 want-force-vis village1 #t) + (0 kill "assistant-11") + (0 kill "reflector-middle-2") + (0 kill "eco-11") + (0 kill "eco-10") + (0 kill "sharkey-12") + (0 kill "reflector-end-1") + (0 kill "water-vol-10") + (0 kill "water-vol-8") + (0 kill "water-vol-7") + (0 kill "fishermans-boat-2") + (0 kill "revcycleprop-2") + (0 kill "revcycle-8") + (0 kill "ropebridge-5") + (0 kill "ropebridge-4") + (0 kill "villagea-water-2") + (0 time-of-day 7) + (1 time-of-day -1) + (3 blackout 0) + (25 blackout 0) + (25 want-force-vis village1 #f) + (56 joint "cameraB") + (100 want-force-inside village1 #f) + (107 joint "camera") + (137 joint "cameraB") + (202 joint "camera") + (286 joint "cameraB") + (554 joint "camera") + (633 joint "cameraB") + (711 joint "camera") + (796 joint "cameraB") + (921 joint "camera") + (1021 shadow self #f) + (1021 joint "cameraB") + (1081 joint "camera") + (1183 joint "cameraB") + (1221 joint "camera") + (1496 shadow self #t) + (1496 joint "cameraB") + (1496 time-of-day 18) + (1721 joint "camera") + (1721 time-of-day 7) + (1722 time-of-day -1) ) ) - (((game-task beach-ecorocks)) - (when arg0 - (let* ((s5-1 (-> obj tasks)) - (s4-0 (method-of-object s5-1 save-reminder)) - (a1-6 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-6 from) pp) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'query) - (set! (-> a1-6 param 0) (the-as uint 'pickup)) - (set! (-> a1-6 param 1) (the-as uint 6)) - (s4-0 s5-1 (the int (the-as float (send-event-function *target* a1-6))) 1) - ) - (close-status! (-> obj tasks) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name "sage-intro-sequence-e" - :index 14 - :parts 13 - :command-list - '((0 want-levels village1 beach) - (0 blackout 0) - (197 joint "cameraB") - (361 joint "camera") - (660 joint "cameraB") - (937 display-level beach movie) - (937 want-force-vis beach #t) - (938 alive "ecoventrock-3") - (938 alive "ecoventrock-4") - (938 alive "ecoventrock-5") - (938 alive "ecoventrock-6") - (938 alive "ecoventrock-7") - (938 alive "harvester-87") - (938 alive "harvester-88") - (938 alive "harvester-89") - (938 alive "harvester-90") - (938 alive "harvester-91") - (940 joint "camera") - (1160 joint "cameraB") - (1162 dead "ecoventrock-3") - (1162 dead "ecoventrock-4") - (1162 dead "ecoventrock-5") - (1162 dead "ecoventrock-6") - (1162 dead "ecoventrock-7") - (1162 dead "harvester-87") - (1162 dead "harvester-88") - (1162 dead "harvester-89") - (1162 dead "harvester-90") - (1162 dead "harvester-91") - (1310 joint "camera") - (1313 want-force-vis beach #f) - (1313 display-level beach #f) - (1313 send-event "warp-gate-switch-3" 'hide) - ) - ) - ) - (else - (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name "sage-introduction-misty-cannon" - :index 8 - :parts 12 - :command-list - '((0 want-levels village1 beach) - (261 joint "cameraB") - (521 joint "camera") - (776 joint "cameraB") - (810 joint "camera") - (1171 joint "cameraB") - (1235 joint "camera") - ) - ) - ) - ) - ) - (((task-status need-reminder)) - (set! (-> obj skippable) #t) - (if arg0 - (set! (-> obj reminder-played) #t) - ) - (case (get-reminder (-> obj tasks) 0) - ((3) - (new 'static 'spool-anim :name "sage-reminder-2-generic" :index 13 :parts 4 :command-list '()) - ) - ((2) - (new 'static 'spool-anim :name "sage-reminder-1-generic" :index 12 :parts 3 :command-list '()) - ) - ((1) - (new 'static 'spool-anim - :name "sage-reminder-1-misty-cannon" - :index 9 - :parts 5 - :command-list - '((86 joint "cameraB") (320 joint "camera")) - ) - ) - (else - (new 'static 'spool-anim - :name "sage-reminder-1-ecorocks" - :index 11 - :parts 4 - :command-list - '((0 want-levels village1 beach) - (245 display-level beach movie) - (245 want-force-vis beach #t) - (246 alive "ecoventrock-3") - (246 alive "ecoventrock-4") - (246 alive "ecoventrock-5") - (246 alive "ecoventrock-6") - (246 alive "ecoventrock-7") - (246 alive "harvester-87") - (246 alive "harvester-88") - (246 alive "harvester-89") - (246 alive "harvester-90") - (246 alive "harvester-91") - (246 joint "cameraB") - (365 want-force-vis beach #f) - (365 display-level beach #f) - (366 joint "camera") - ) - ) - ) - ) - ) - (((task-status need-reward-speech)) - (when arg0 - (set-setting! *setting-control* pp 'music-volume-movie 'abs 0.0 0) - (copy-settings-from-target! *setting-control*) - (close-status! (-> obj tasks) (task-status need-reward-speech)) - (let ((s5-2 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj assistant) - (ppointer->handle - (when s5-2 - (let ((t9-15 (method-of-type manipy activate))) - (t9-15 (the-as manipy s5-2) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 manipy-init (-> obj root-override trans) (-> obj entity) *assistant-sg* #f) - (-> s5-2 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj assistant)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj assistant)) 'blend-shape #t) - (send-event (handle->process (-> obj assistant)) 'center-joint 3) - (let ((v1-68 (handle->process (-> obj assistant)))) - (if v1-68 - (set! (-> (the-as assistant v1-68) draw light-index) (the-as uint 1)) - ) - ) - (set! (-> obj draw bounds w) 40960.0) - ) - (new 'static 'spool-anim - :name "sage-intro-sequence-d2" - :index 15 - :parts 20 - :command-list - '((0 want-levels village1 beach) - (0 kill "assistant-11") - (0 kill "reflector-middle-2") - (0 kill "eco-11") - (0 kill "eco-10") - (0 kill "sharkey-12") - (0 kill "reflector-end-1") - (0 kill "water-vol-10") - (0 kill "water-vol-8") - (0 kill "water-vol-7") - (0 kill "fishermans-boat-2") - (0 kill "revcycleprop-2") - (0 kill "revcycle-8") - (113 joint "cameraB") - (232 joint "camera") - (289 joint "cameraB") - (338 joint "camera") - (405 joint "cameraB") - (560 joint "camera") - (660 joint "cameraB") - (699 joint "camera") - (837 joint "cameraB") - (837 shadow self #f) - (910 joint "camera") - (945 alive "farmer-3") - (945 alive "hutlamp-2") - (950 joint "cameraB") - (974 display-level beach movie) - (974 want-force-vis beach #t) - (1011 alive "bird-lady-4") - (1015 joint "camera") - (1018 dead "farmer-3") - (1018 dead "hutlamp-2") - (1075 alive "explorer-4") - (1080 joint "cameraB") - (1080 want-force-vis beach #f) - (1080 display-level beach #f) - (1082 dead "bird-lady-4") - (1133 joint "camera") - (1135 dead "explorer-4") - (1244 display-level beach movie) - (1244 want-force-vis beach #t) - (1245 alive "fuel-cell-42") - (1246 joint "cameraB") - (1369 joint "camera") - (1438 alive "fuel-cell-42") - (1438 want-force-vis beach #f) - (1438 dead "fuel-cell-42") - (1438 kill "villagea-water-2") - (1438 kill "crate-3147") - (1438 kill "crate-3146") - (1438 kill "crate-3143") - (1438 kill "sagesail-6") - (1438 kill "windmill-sail-4") - (1438 kill "ropebridge-4") - (1438 kill "ropebridge-5") - (1438 kill "windspinner-8") - (1438 kill "windspinner-9") - (1438 joint "cameraB") - (1439 want-levels village1 training) - (1439 save) - (1529 joint "camera") - (1691 joint "cameraB") - (1753 joint "camera") - (1874 joint "cameraB") - (2057 joint "camera") - (2176 joint "cameraB") - (2226 joint "camera") - (2226 shadow self #t) - ) - ) - ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) - ) - (get-art-elem obj) ) + (((game-task beach-ecorocks)) + (when arg0 + (let* ((s5-1 (-> obj tasks)) + (s4-0 (method-of-object s5-1 save-reminder)) + ) + (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) + ) + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "sage-intro-sequence-e" + :index 14 + :parts 13 + :command-list '((0 want-levels village1 beach) + (0 blackout 0) + (197 joint "cameraB") + (361 joint "camera") + (660 joint "cameraB") + (937 display-level beach movie) + (937 want-force-vis beach #t) + (938 alive "ecoventrock-3") + (938 alive "ecoventrock-4") + (938 alive "ecoventrock-5") + (938 alive "ecoventrock-6") + (938 alive "ecoventrock-7") + (938 alive "harvester-87") + (938 alive "harvester-88") + (938 alive "harvester-89") + (938 alive "harvester-90") + (938 alive "harvester-91") + (940 joint "camera") + (1160 joint "cameraB") + (1162 dead "ecoventrock-3") + (1162 dead "ecoventrock-4") + (1162 dead "ecoventrock-5") + (1162 dead "ecoventrock-6") + (1162 dead "ecoventrock-7") + (1162 dead "harvester-87") + (1162 dead "harvester-88") + (1162 dead "harvester-89") + (1162 dead "harvester-90") + (1162 dead "harvester-91") + (1310 joint "camera") + (1313 want-force-vis beach #f) + (1313 display-level beach #f) + (1313 send-event "warp-gate-switch-3" 'hide) + ) + ) + ) + (else + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "sage-introduction-misty-cannon" + :index 8 + :parts 12 + :command-list '((0 want-levels village1 beach) + (261 joint "cameraB") + (521 joint "camera") + (776 joint "cameraB") + (810 joint "camera") + (1171 joint "cameraB") + (1235 joint "camera") + ) + ) + ) + ) + ) + (((task-status need-reminder)) + (set! (-> obj skippable) #t) + (if arg0 + (set! (-> obj reminder-played) #t) + ) + (case (get-reminder (-> obj tasks) 0) + ((3) + (new 'static 'spool-anim :name "sage-reminder-2-generic" :index 13 :parts 4 :command-list '()) + ) + ((2) + (new 'static 'spool-anim :name "sage-reminder-1-generic" :index 12 :parts 3 :command-list '()) + ) + ((1) + (new 'static 'spool-anim + :name "sage-reminder-1-misty-cannon" + :index 9 + :parts 5 + :command-list '((86 joint "cameraB") (320 joint "camera")) + ) + ) + (else + (new 'static 'spool-anim + :name "sage-reminder-1-ecorocks" + :index 11 + :parts 4 + :command-list '((0 want-levels village1 beach) + (245 display-level beach movie) + (245 want-force-vis beach #t) + (246 alive "ecoventrock-3") + (246 alive "ecoventrock-4") + (246 alive "ecoventrock-5") + (246 alive "ecoventrock-6") + (246 alive "ecoventrock-7") + (246 alive "harvester-87") + (246 alive "harvester-88") + (246 alive "harvester-89") + (246 alive "harvester-90") + (246 alive "harvester-91") + (246 joint "cameraB") + (365 want-force-vis beach #f) + (365 display-level beach #f) + (366 joint "camera") + ) + ) + ) + ) + ) + (((task-status need-reward-speech)) + (when arg0 + (set-setting! 'music-volume-movie 'abs 0.0 0) + (apply-settings *setting-control*) + (close-status! (-> obj tasks) (task-status need-reward-speech)) + (set! (-> obj assistant) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *assistant-sg* #f :to obj)) + ) + (send-event (handle->process (-> obj assistant)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj assistant)) 'blend-shape #t) + (send-event (handle->process (-> obj assistant)) 'center-joint 3) + (let ((v1-68 (handle->process (-> obj assistant)))) + (if v1-68 + (set! (-> (the-as assistant v1-68) draw light-index) (the-as uint 1)) + ) + ) + (set! (-> obj draw bounds w) 40960.0) + ) + (new 'static 'spool-anim + :name "sage-intro-sequence-d2" + :index 15 + :parts 20 + :command-list '((0 want-levels village1 beach) + (0 kill "assistant-11") + (0 kill "reflector-middle-2") + (0 kill "eco-11") + (0 kill "eco-10") + (0 kill "sharkey-12") + (0 kill "reflector-end-1") + (0 kill "water-vol-10") + (0 kill "water-vol-8") + (0 kill "water-vol-7") + (0 kill "fishermans-boat-2") + (0 kill "revcycleprop-2") + (0 kill "revcycle-8") + (113 joint "cameraB") + (232 joint "camera") + (289 joint "cameraB") + (338 joint "camera") + (405 joint "cameraB") + (560 joint "camera") + (660 joint "cameraB") + (699 joint "camera") + (837 joint "cameraB") + (837 shadow self #f) + (910 joint "camera") + (945 alive "farmer-3") + (945 alive "hutlamp-2") + (950 joint "cameraB") + (974 display-level beach movie) + (974 want-force-vis beach #t) + (1011 alive "bird-lady-4") + (1015 joint "camera") + (1018 dead "farmer-3") + (1018 dead "hutlamp-2") + (1075 alive "explorer-4") + (1080 joint "cameraB") + (1080 want-force-vis beach #f) + (1080 display-level beach #f) + (1082 dead "bird-lady-4") + (1133 joint "camera") + (1135 dead "explorer-4") + (1244 display-level beach movie) + (1244 want-force-vis beach #t) + (1245 alive "fuel-cell-42") + (1246 joint "cameraB") + (1369 joint "camera") + (1438 alive "fuel-cell-42") + (1438 want-force-vis beach #f) + (1438 dead "fuel-cell-42") + (1438 kill "villagea-water-2") + (1438 kill "crate-3147") + (1438 kill "crate-3146") + (1438 kill "crate-3143") + (1438 kill "sagesail-6") + (1438 kill "windmill-sail-4") + (1438 kill "ropebridge-4") + (1438 kill "ropebridge-5") + (1438 kill "windspinner-8") + (1438 kill "windspinner-9") + (1438 joint "cameraB") + (1439 want-levels village1 training) + (1439 save) + (1529 joint "camera") + (1691 joint "cameraB") + (1753 joint "camera") + (1874 joint "cameraB") + (2057 joint "camera") + (2176 joint "cameraB") + (2226 joint "camera") + (2226 shadow self #t) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) + ) + ) + (get-art-elem obj) ) ) ) @@ -456,10 +430,7 @@ (defmethod TODO-RENAME-43 sage ((obj sage)) (let ((s5-0 (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj))) (when s5-0 - (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-3 (the-as number (logior #x3f800000 v1-2))) - (f0-2 (+ -1.0 (the-as float v1-3))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< (-> s5-0 y) -12288.0) #f @@ -488,8 +459,7 @@ ;; failed to figure out what this is: (defstate idle (sage) :virtual #t - :trans - (behavior () + :trans (behavior () (case (get-task-status (game-task intro)) (((task-status need-reward-speech)) (if (process-grab? *target*) @@ -500,51 +470,19 @@ ((-> (method-of-type process-taskable idle) trans)) (none) ) - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 60) - ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.2)) ) + (loop + (ja :group! (get-art-elem self)) (let* ((f30-0 3.0) (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-10 (the-as number (logior #x3f800000 v1-9))) ) (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-10)))) 5)) (TODO-RENAME-43 self) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-11 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! - a0-11 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (and (-> self reminder-played) (< 81920.0 (vector-vector-distance (-> self root-override trans) (camera-pos))) @@ -552,35 +490,15 @@ (go-virtual idle) ) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 4) - ) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-20 param 1) 1.0) - (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (when (ja-group? sage-idle-ecorocks-breathe-ja) + (ja-no-eval :group! sage-idle-ecorocks-peer-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) - (set! (-> a0-21 param 1) 1.0) - (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -591,8 +509,7 @@ ;; failed to figure out what this is: (defstate play-anim (sage) :virtual #t - :exit - (behavior () + :exit (behavior () (set! (-> self draw bounds w) 10240.0) (let ((a0-1 (handle->process (-> self assistant)))) (if a0-1 @@ -602,15 +519,14 @@ ((-> (method-of-type process-taskable play-anim) exit)) (case (get-task-status (game-task intro)) (((task-status need-resolution)) - (clear-pending-settings-from-process *setting-control* self 'music-volume-movie) + (remove-setting! 'music-volume-movie) (close-specific-task! (game-task intro) (task-status need-resolution)) (start 'play (get-continue-by-name *game-info* "game-start")) ) ) (none) ) - :trans - (behavior () + :trans (behavior () (case (get-task-status (game-task intro)) (((task-status need-reward-speech)) (spool-push *art-control* "sage-intro-sequence-d2" 0 self -1.0) diff --git a/test/decompiler/reference/levels/village1/sequence-a-village1_REF.gc b/test/decompiler/reference/levels/village1/sequence-a-village1_REF.gc index d90a8b35a7..350b22b1d5 100644 --- a/test/decompiler/reference/levels/village1/sequence-a-village1_REF.gc +++ b/test/decompiler/reference/levels/village1/sequence-a-village1_REF.gc @@ -7,14 +7,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2854 :period 900 :length 600)) + :parts ((sp-item 2854 :period 900 :length 600)) ) ;; failed to figure out what this is: (defpart 2854 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 128.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) @@ -43,14 +41,12 @@ :linger-duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2855)) + :parts ((sp-item 2855)) ) ;; failed to figure out what this is: (defpart 2855 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 5.0) (sp-rnd-flt spt-scale-x (meters 0.025) (meters 0.025) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -79,8 +75,7 @@ :id 688 :flags (screen-space) :bounds (static-bspherem 0 0 0 2) - :parts - ((sp-item 2858 :period 300 :length 5 :binding 2856) + :parts ((sp-item 2858 :period 300 :length 5 :binding 2856) (sp-item 2856 :flags (start-dead launch-asap) :binding 2857) (sp-item 2856 :flags (start-dead launch-asap) :binding 2857) (sp-item 2857 :flags (start-dead)) @@ -93,8 +88,7 @@ ;; failed to figure out what this is: (defpart 2858 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2.5) (meters 5) 1.0) (sp-rnd-flt spt-y (meters -1.5) (meters 3) 1.0) @@ -111,8 +105,7 @@ ;; failed to figure out what this is: (defpart 2856 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -136,8 +129,7 @@ ;; failed to figure out what this is: (defpart 2857 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -157,8 +149,7 @@ ;; failed to figure out what this is: (defpart 2860 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x36 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters -3.90625)) (sp-flt spt-scale-x (meters 15)) @@ -174,8 +165,7 @@ ;; failed to figure out what this is: (defpart 2859 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.3) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters -3) (meters 6) 1.0) @@ -200,8 +190,7 @@ ;; failed to figure out what this is: (defpart 2861 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 300 299 1) (sp-launcher-by-id spt-next-launcher 2862) ) @@ -209,8 +198,7 @@ ;; failed to figure out what this is: (defpart 2862 - :init-specs - ((sp-flt spt-fade-a -0.21333334)) + :init-specs ((sp-flt spt-fade-a -0.21333334)) ) ;; definition of type sequenceA-village1 @@ -245,19 +233,9 @@ (send-event *camera* 'force-blend 0) (send-event *camera* 'change-state cam-fixed 0) (send-event *target* 'sidekick #f) - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj boat) - (ppointer->handle - (when s5-0 - (let ((t9-6 (method-of-type manipy activate))) - (t9-6 (the-as manipy s5-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> obj root-override trans) (-> obj entity) *fishermans-boat-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> obj boat) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *fishermans-boat-sg* #f :to obj)) + ) (send-event (handle->process (-> obj boat)) 'anim-mode 'clone-anim) (send-event (handle->process (-> obj boat)) 'origin-joint-index 3) ) @@ -265,8 +243,7 @@ :name "sage-intro-sequence-a" :index 17 :parts 22 - :command-list - '((0 blackout 0) + :command-list '((0 blackout 0) (0 want-levels village1 misty) (1210 display-level misty display) (1210 want-vis mis) @@ -299,8 +276,7 @@ ;; failed to figure out what this is: (defstate play-anim (sequenceA-village1) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('sidekick-human) (format 0 "got sidekick-human~%") @@ -308,19 +284,9 @@ (let ((gp-1 (entity-by-name "sequenceA-1"))) (when gp-1 (format 0 "found entity for sidekick-human~%") - (let ((s5-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self side) - (ppointer->handle - (when s5-0 - (let ((t9-5 (method-of-type manipy activate))) - (t9-5 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 manipy-init (-> self root-override trans) gp-1 *sidekick-human-sg* #f) - (-> s5-0 ppointer) - ) - ) - ) - ) + (set! (-> self side) + (ppointer->handle (manipy-spawn (-> self root-override trans) gp-1 *sidekick-human-sg* #f :to self)) + ) (send-event (handle->process (-> self side)) 'anim-mode 'clone-anim) (send-event (handle->process (-> self side)) 'center-joint 3) (send-event (handle->process (-> self side)) 'blend-shape #t) @@ -330,8 +296,7 @@ ) ) ) - :exit - (behavior () + :exit (behavior () (send-event *target* 'sidekick #t) (let ((a0-2 (handle->process (-> self boat)))) (if a0-2 @@ -357,8 +322,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (spool-push *art-control* "sage-intro-sequence-b" 0 self -1.0) ((-> (method-of-type process-taskable play-anim) trans)) (none) @@ -406,7 +370,7 @@ ;; definition for function sequenceA-village1-init-by-other ;; INFO: Return type mismatch object vs none. -(defbehavior sequenceA-village1-init-by-other sequenceA-village1 ((arg0 entity)) +(defbehavior sequenceA-village1-init-by-other sequenceA-village1 ((arg0 entity-actor)) (set! (-> self entity) arg0) (dummy-40 self arg0 *sage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> self tasks) (get-task-control (game-task intro))) @@ -417,9 +381,9 @@ (set! (-> self cur-trans-hook) sequenceA-village1-trans-hook) (logclear! (-> self mask) (process-mask pause actor-pause)) (set! (-> self been-kicked) #t) - (set-setting! *setting-control* self 'music-volume-movie 'abs 0.0 0) - (set-setting! *setting-control* self 'sfx-volume-movie 'abs 0.0 0) - (set-setting! *setting-control* self 'ambient-volume-movie 'abs 0.0 0) + (set-setting! 'music-volume-movie 'abs 0.0 0) + (set-setting! 'sfx-volume-movie 'abs 0.0 0) + (set-setting! 'ambient-volume-movie 'abs 0.0 0) (go-virtual hidden) (none) ) @@ -428,15 +392,7 @@ ;; INFO: Return type mismatch int vs none. (defun start-sequence-a () (set-blackout-frames (seconds 100)) - (let ((gp-0 (get-process *default-dead-pool* sequenceA-village1 #x4000))) - (when gp-0 - (let ((t9-2 (method-of-type sequenceA-village1 activate))) - (t9-2 (the-as sequenceA-village1 gp-0) *entity-pool* 'sequenceA-village1 (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 sequenceA-village1-init-by-other (entity-by-name "sage-23")) - (-> gp-0 ppointer) - ) - ) + (process-spawn sequenceA-village1 (entity-by-name "sage-23") :to *entity-pool*) 0 (none) ) diff --git a/test/decompiler/reference/levels/village1/village-obs_REF.gc b/test/decompiler/reference/levels/village1/village-obs_REF.gc index 97686c851e..d0edc3414c 100644 --- a/test/decompiler/reference/levels/village1/village-obs_REF.gc +++ b/test/decompiler/reference/levels/village1/village-obs_REF.gc @@ -1,118 +1,115 @@ ;;-*-Lisp-*- (in-package goal) -;; failed to figure out what this is: -(defskelgroup *med-res-jungle-sg* medres-jungle - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -80 0 -80 240) - :longest-edge (meters 0.01) - ) +(import "goal_src/import/windmill-sail-ag.gc") +(import "goal_src/import/medres-beach3-ag.gc") +(import "goal_src/import/mayorgears-ag.gc") +(import "goal_src/import/medres-village11-ag.gc") +(import "goal_src/import/revcycleprop-ag.gc") +(import "goal_src/import/medres-jungle2-ag.gc") +(import "goal_src/import/revcycle-ag.gc") +(import "goal_src/import/medres-misty-ag.gc") +(import "goal_src/import/sagesail-ag.gc") +(import "goal_src/import/windspinner-ag.gc") +(import "goal_src/import/medres-jungle1-ag.gc") +(import "goal_src/import/medres-village12-ag.gc") +(import "goal_src/import/hutlamp-ag.gc") +(import "goal_src/import/medres-jungle-ag.gc") +(import "goal_src/import/medres-village13-ag.gc") +(import "goal_src/import/medres-beach2-ag.gc") +(import "goal_src/import/villa-starfish-ag.gc") +(import "goal_src/import/medres-training-ag.gc") +(import "goal_src/import/medres-beach-ag.gc") +(import "goal_src/import/reflector-middle-ag.gc") +(import "goal_src/import/medres-beach1-ag.gc") ;; failed to figure out what this is: -(defskelgroup *med-res-jungle1-sg* medres-jungle1 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 30 0 -40 230) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-jungle-sg* medres-jungle medres-jungle-lod0-jg medres-jungle-idle-ja + ((medres-jungle-lod0-mg (meters 999999))) + :bounds (static-spherem -80 0 -80 240) + :longest-edge (meters 0.01) + ) ;; failed to figure out what this is: -(defskelgroup *med-res-jungle2-sg* medres-jungle2 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 90 0 130 110) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-jungle1-sg* medres-jungle1 medres-jungle1-lod0-jg medres-jungle1-idle-ja + ((medres-jungle1-lod0-mg (meters 999999))) + :bounds (static-spherem 30 0 -40 230) + :longest-edge (meters 0.01) + ) ;; failed to figure out what this is: -(defskelgroup *med-res-beach-sg* medres-beach - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 -140 200) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-jungle2-sg* medres-jungle2 medres-jungle2-lod0-jg medres-jungle2-idle-ja + ((medres-jungle2-lod0-mg (meters 999999))) + :bounds (static-spherem 90 0 130 110) + :longest-edge (meters 0.01) + ) ;; failed to figure out what this is: -(defskelgroup *med-res-beach1-sg* medres-beach1 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 -360 200) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-beach-sg* medres-beach medres-beach-lod0-jg medres-beach-idle-ja + ((medres-beach-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -140 200) + :longest-edge (meters 0.01) + ) ;; failed to figure out what this is: -(defskelgroup *med-res-beach2-sg* medres-beach2 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -200 0 -450 180) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-beach1-sg* medres-beach1 medres-beach1-lod0-jg medres-beach1-idle-ja + ((medres-beach1-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -360 200) + :longest-edge (meters 0.01) + ) ;; failed to figure out what this is: -(defskelgroup *med-res-beach3-sg* medres-beach3 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 75 70 -480 100) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-beach2-sg* medres-beach2 medres-beach2-lod0-jg medres-beach2-idle-ja + ((medres-beach2-lod0-mg (meters 999999))) + :bounds (static-spherem -200 0 -450 180) + :longest-edge (meters 0.01) + ) ;; failed to figure out what this is: -(defskelgroup *med-res-misty-sg* medres-misty - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -40 0 -20 260) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-beach3-sg* medres-beach3 medres-beach3-lod0-jg medres-beach3-idle-ja + ((medres-beach3-lod0-mg (meters 999999))) + :bounds (static-spherem 75 70 -480 100) + :longest-edge (meters 0.01) + ) ;; failed to figure out what this is: -(defskelgroup *med-res-village11-sg* medres-village11 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -100 0 90 200) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-misty-sg* medres-misty medres-misty-lod0-jg medres-misty-idle-ja + ((medres-misty-lod0-mg (meters 999999))) + :bounds (static-spherem -40 0 -20 260) + :longest-edge (meters 0.01) + ) ;; failed to figure out what this is: -(defskelgroup *med-res-village12-sg* medres-village12 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 40 0 -50 155) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-village11-sg* medres-village11 medres-village11-lod0-jg medres-village11-idle-ja + ((medres-village11-lod0-mg (meters 999999))) + :bounds (static-spherem -100 0 90 200) + :longest-edge (meters 0.01) + ) ;; failed to figure out what this is: -(defskelgroup *med-res-village13-sg* medres-village13 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 180 -40 -40 180) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-village12-sg* medres-village12 medres-village12-lod0-jg medres-village12-idle-ja + ((medres-village12-lod0-mg (meters 999999))) + :bounds (static-spherem 40 0 -50 155) + :longest-edge (meters 0.01) + ) ;; failed to figure out what this is: -(defskelgroup *med-res-training-sg* medres-training - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 -60 220) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-village13-sg* medres-village13 medres-village13-lod0-jg medres-village13-idle-ja + ((medres-village13-lod0-mg (meters 999999))) + :bounds (static-spherem 180 -40 -40 180) + :longest-edge (meters 0.01) + ) + +;; failed to figure out what this is: +(defskelgroup *med-res-training-sg* medres-training medres-training-lod0-jg medres-training-idle-ja + ((medres-training-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -60 220) + :longest-edge (meters 0.01) + ) ;; failed to figure out what this is: (defpart 368 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 2.5) (sp-flt spt-x (meters 0.8)) (sp-flt spt-scale-x (meters 1.7)) @@ -134,8 +131,7 @@ ;; failed to figure out what this is: (defpart 369 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 3.0) (sp-flt spt-x (meters 4)) (sp-flt spt-scale-x (meters 0.5)) @@ -163,8 +159,7 @@ ;; failed to figure out what this is: (defpart 370 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 5.0) (sp-flt spt-x (meters 4)) (sp-flt spt-scale-x (meters 1.7)) @@ -191,8 +186,7 @@ ;; failed to figure out what this is: (defpart 371 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 3.8) (sp-flt spt-x (meters 5.5)) (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) @@ -266,20 +260,20 @@ ) ;; failed to figure out what this is: -(defskelgroup *windmill-sail-sg* windmill-sail - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 21) - :longest-edge (meters 14.9) - ) +(defskelgroup *windmill-sail-sg* windmill-sail windmill-sail-lod0-jg windmill-sail-idle-ja + ((windmill-sail-lod0-mg (meters 20)) + (windmill-sail-lod1-mg (meters 40)) + (windmill-sail-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 21) + :longest-edge (meters 14.9) + ) ;; failed to figure out what this is: (defpartgroup group-win-wind-mill :id 123 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 368 :fade-after (meters 100)) + :parts ((sp-item 368 :fade-after (meters 100)) (sp-item 369 :fade-after (meters 100)) (sp-item 370 :fade-after (meters 200)) (sp-item 371 :fade-after (meters 200)) @@ -290,14 +284,12 @@ (defpartgroup group-win-wind-mill-hires :id 124 :bounds (static-bspherem 0 0 0 20) - :parts - ((sp-item 368) (sp-item 369) (sp-item 370) (sp-item 371)) + :parts ((sp-item 368) (sp-item 369) (sp-item 370) (sp-item 371)) ) ;; failed to figure out what this is: (defstate windmill-sail-idle (windmill-sail) - :trans - (behavior () + :trans (behavior () (cond ((task-closed? (game-task jungle-lurkerm) (task-status need-reminder)) (let ((f30-0 (get-current-value (-> self sync) 65536.0))) @@ -348,10 +340,8 @@ ) (none) ) - :code - (the-as (function none :behavior windmill-sail) anim-loop) - :post - (the-as (function none :behavior windmill-sail) ja-post) + :code (the-as (function none :behavior windmill-sail) anim-loop) + :post (the-as (function none :behavior windmill-sail) ja-post) ) ;; definition for method 11 of type windmill-sail @@ -401,18 +391,15 @@ ) ;; failed to figure out what this is: -(defskelgroup *sagesail-sg* sagesail - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 25.5) - :longest-edge (meters 24.2) - ) +(defskelgroup *sagesail-sg* sagesail sagesail-lod0-jg sagesail-idle-ja + ((sagesail-lod0-mg (meters 20)) (sagesail-lod1-mg (meters 40)) (sagesail-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25.5) + :longest-edge (meters 24.2) + ) ;; failed to figure out what this is: (defstate sagesail-idle (sagesail) - :trans - (behavior () + :trans (behavior () (let ((f0-0 (get-current-value (-> self sync) 65536.0))) (quaternion-axis-angle! (-> self root-override quat) @@ -426,10 +413,8 @@ (quaternion-normalize! (-> self root-override quat)) (none) ) - :code - (the-as (function none :behavior sagesail) anim-loop) - :post - (the-as (function none :behavior sagesail) ja-post) + :code (the-as (function none :behavior sagesail) anim-loop) + :post (the-as (function none :behavior sagesail) ja-post) ) ;; definition for method 11 of type sagesail @@ -492,18 +477,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *windspinner-sg* windspinner - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 0 0 8) - :longest-edge (meters 0) - ) +(defskelgroup *windspinner-sg* windspinner windspinner-lod0-jg windspinner-idle-ja + ((windspinner-lod0-mg (meters 20)) (windspinner-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) ;; failed to figure out what this is: (defstate windspinner-idle (windspinner) - :trans - (behavior () + :trans (behavior () (let* ((f0-0 0.992) (f1-0 0.008090864) (a0-0 (-> self root trans)) @@ -539,10 +520,8 @@ (quaternion-normalize! (-> self root quat)) (none) ) - :code - (the-as (function none :behavior windspinner) anim-loop) - :post - (the-as (function none :behavior windspinner) ja-post) + :code (the-as (function none :behavior windspinner) anim-loop) + :post (the-as (function none :behavior windspinner) ja-post) ) ;; definition for method 11 of type windspinner @@ -585,39 +564,24 @@ ) ;; failed to figure out what this is: -(defskelgroup *mayorgears-sg* mayorgears - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4.5) - :longest-edge (meters 0) - ) +(defskelgroup *mayorgears-sg* mayorgears mayorgears-geo-jg mayorgears-idle-ja + ((mayorgears-geo-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.5) + ) ;; failed to figure out what this is: (defstate mayorgears-idle (mayorgears) - :code - (behavior () - (while #t - (cond - ((task-closed? (game-task jungle-lurkerm) (task-status need-reminder)) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-loop!) - ) - ) - (else - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) 0.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) - ) + :code (behavior () + (loop + (if (task-closed? (game-task jungle-lurkerm) (task-status need-reminder)) + (ja :num! (loop!)) + (ja :num! (loop! 0.0)) ) - ) (suspend) ) (none) ) - :post - (the-as (function none :behavior mayorgears) ja-post) + :post (the-as (function none :behavior mayorgears) ja-post) ) ;; definition for method 11 of type mayorgears @@ -657,28 +621,22 @@ ) ;; failed to figure out what this is: -(defskelgroup *reflector-middle-sg* reflector-middle - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 17 0 17) - :longest-edge (meters 0) - ) +(defskelgroup *reflector-middle-sg* reflector-middle reflector-middle-geo-jg reflector-middle-idle-ja + ((reflector-middle-geo-mg (meters 999999))) + :bounds (static-spherem 0 17 0 17) + ) ;; failed to figure out what this is: (defstate reflector-middle-idle (reflector-middle) - :trans - (behavior () + :trans (behavior () (when (task-closed? (game-task jungle-lurkerm) (task-status need-reminder)) (process-entity-status! self (entity-perm-status complete) #t) (draw-eco-beam (-> self reflector-trans) (-> self next-reflector-trans)) ) (none) ) - :code - (the-as (function none :behavior reflector-middle) anim-loop) - :post - (the-as (function none :behavior reflector-middle) ja-post) + :code (the-as (function none :behavior reflector-middle) anim-loop) + :post (the-as (function none :behavior reflector-middle) ja-post) ) ;; definition for method 11 of type reflector-middle @@ -725,8 +683,7 @@ ;; failed to figure out what this is: (defstate reflector-end-idle (reflector-end) - :code - (the-as (function none :behavior reflector-end) anim-loop) + :code (the-as (function none :behavior reflector-end) anim-loop) ) ;; definition for method 11 of type reflector-end @@ -761,13 +718,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *starfish-sg* villa-starfish - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - ) +(defskelgroup *starfish-sg* villa-starfish villa-starfish-lod0-jg villa-starfish-idle-ja + ((villa-starfish-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) ;; definition of type starfish (deftype starfish (nav-enemy) @@ -792,46 +746,39 @@ ;; failed to figure out what this is: (defstate starfish-idle (starfish) - :enter - (behavior () + :enter (behavior () (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background)) (set! (-> self state-time) (-> *display* base-frame-counter)) (ja-channel-set! 0) (none) ) - :exit - (behavior () + :exit (behavior () (ja-channel-set! 1) (none) ) - :trans - (behavior () + :trans (behavior () (if (and *target* (>= 163840.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (go starfish-patrol) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior starfish) ja-post) + :post (the-as (function none :behavior starfish) ja-post) ) ;; failed to figure out what this is: (defstate starfish-patrol (starfish) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self nav flags) (logior (nav-control-flags bit19) (-> self nav flags))) + (set! (-> self nav flags) (logior (nav-control-flags navcf19) (-> self nav flags))) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (if (or (not *target*) (< 204800.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) @@ -841,34 +788,20 @@ ) (none) ) - :code - (behavior () + :code (behavior () (set! (-> self target-speed) 4096.0) (set! (-> self rotate-speed) 12743.111) (set! (-> self turn-time) (seconds 0.5)) - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (loop + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior starfish) nav-enemy-patrol-post) + :post (the-as (function none :behavior starfish) nav-enemy-patrol-post) ) ;; definition for symbol *starfish-nav-enemy-info*, type nav-enemy-info @@ -918,7 +851,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -992,25 +925,15 @@ (defbehavior starfish-spawn-child starfish () (let ((gp-0 (new-stack-vector0))) (get-random-point (-> self path) gp-0) - (let ((s5-0 (get-process *default-dead-pool* starfish #x4000))) - (the-as (pointer starfish) (when s5-0 - (let ((t9-2 (method-of-type starfish activate))) - (t9-2 (the-as starfish s5-0) self 'starfish (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 starfish-init-by-other self gp-0) - (-> s5-0 ppointer) - ) - ) - ) + (process-spawn starfish self gp-0 :to self) ) ) ;; failed to figure out what this is: (defstate villa-starfish-idle (villa-starfish) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) (set! (-> self state-time) (-> *display* base-frame-counter)) (if (and (and *target* (>= 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) @@ -1023,8 +946,7 @@ ) (none) ) - :post - (the-as (function none :behavior villa-starfish) #f) + :post (the-as (function none :behavior villa-starfish) #f) ) ;; definition for method 11 of type villa-starfish @@ -1064,16 +986,14 @@ ;; failed to figure out what this is: (defstate village-fish-idle (village-fish) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (suspend) ) (none) ) - :post - (the-as (function none :behavior village-fish) #f) + :post (the-as (function none :behavior village-fish) #f) ) ;; definition for method 11 of type village-fish @@ -1191,19 +1111,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *hutlamp-sg* hutlamp - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 1 0 1.2) - :longest-edge (meters 0.7) - ) +(defskelgroup *hutlamp-sg* hutlamp hutlamp-lod0-jg hutlamp-idle-ja + ((hutlamp-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.2) + :longest-edge (meters 0.7) + ) ;; failed to figure out what this is: (defstate hutlamp-idle (hutlamp) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((f0-3 (* 1820.4445 (sin (* 65536.0 (update-clock (-> self clock))))))) (quaternion-vector-angle! (-> self pivot transform quat) *x-vector* f0-3) ) @@ -1211,8 +1128,7 @@ ) (none) ) - :post - (the-as (function none :behavior hutlamp) ja-post) + :post (the-as (function none :behavior hutlamp) ja-post) ) ;; definition for method 11 of type hutlamp @@ -1249,21 +1165,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *revcycleprop-sg* revcycleprop - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.2) - :longest-edge (meters 0) - ) +(defskelgroup *revcycleprop-sg* revcycleprop revcycleprop-lod0-jg revcycleprop-idle-ja + ((revcycleprop-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.2) + ) ;; failed to figure out what this is: (defstate idle (revcycleprop) :virtual #t - :code - (the-as (function none :behavior revcycleprop) anim-loop) - :post - (the-as (function none :behavior revcycleprop) ja-post) + :code (the-as (function none :behavior revcycleprop) anim-loop) + :post (the-as (function none :behavior revcycleprop) ja-post) ) ;; definition for method 11 of type revcycleprop @@ -1298,21 +1209,16 @@ ) ;; failed to figure out what this is: -(defskelgroup *revcycle-sg* revcycle - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3.2) - :longest-edge (meters 0) - ) +(defskelgroup *revcycle-sg* revcycle revcycle-geo-jg revcycle-idle-ja + ((revcycle-geo-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + ) ;; failed to figure out what this is: (defstate idle (revcycle) :virtual #t - :code - (the-as (function none :behavior revcycle) anim-loop) - :post - (the-as (function none :behavior revcycle) ja-post) + :code (the-as (function none :behavior revcycle) anim-loop) + :post (the-as (function none :behavior revcycle) ja-post) ) ;; definition for method 11 of type revcycle @@ -1348,8 +1254,7 @@ :count 3 :converted #f :normal-scale 4.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 10.0 :xdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 10.0 :xdiv -1 :zdiv 1 :speed 1.5) (new 'static 'ripple-wave :scale 5.0 :xdiv 5 :zdiv 3 :speed 0.75) diff --git a/test/decompiler/reference/levels/village1/village1-part2_REF.gc b/test/decompiler/reference/levels/village1/village1-part2_REF.gc index 529e56fa38..24f2127083 100644 --- a/test/decompiler/reference/levels/village1/village1-part2_REF.gc +++ b/test/decompiler/reference/levels/village1/village1-part2_REF.gc @@ -5,8 +5,7 @@ (defpartgroup group-village1-sagehut-rings :id 136 :bounds (static-bspherem 7 4 -4.5 12) - :parts - ((sp-item 480 :fade-after (meters 60) :flags (is-3d)) + :parts ((sp-item 480 :fade-after (meters 60) :flags (is-3d)) (sp-item 481 :fade-after (meters 60) :flags (is-3d)) (sp-item 482 :fade-after (meters 50) :binding 483) (sp-item 483 :fade-after (meters 50) :flags (start-dead launch-asap) :period 1200 :length 5) @@ -378,8 +377,7 @@ (defpartgroup group-village1-sagehut-rings-2 :id 137 :bounds (static-bspherem 7 4 -4.5 12) - :parts - ((sp-item 488 :fade-after (meters 50) :binding 489) + :parts ((sp-item 488 :fade-after (meters 50) :binding 489) (sp-item 489 :fade-after (meters 50) :flags (start-dead launch-asap) :period 1200 :length 5) (sp-item 489 :fade-after (meters 50) :flags (start-dead launch-asap) :period 1200 :length 5) (sp-item 489 :fade-after (meters 50) :flags (start-dead launch-asap) :period 1200 :length 5) @@ -749,8 +747,7 @@ (defpartgroup group-village1-sagehut-rings-3 :id 138 :bounds (static-bspherem 7 4 -4.5 12) - :parts - ((sp-item 494 :fade-after (meters 50) :binding 495) + :parts ((sp-item 494 :fade-after (meters 50) :binding 495) (sp-item 495 :fade-after (meters 50) :flags (start-dead launch-asap) :period 1200 :length 5) (sp-item 495 :fade-after (meters 50) :flags (start-dead launch-asap) :period 1200 :length 5) (sp-item 495 :fade-after (meters 50) :flags (start-dead launch-asap) :period 1200 :length 5) @@ -1118,8 +1115,7 @@ ;; failed to figure out what this is: (defpart 482 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters -0.049)) (sp-flt spt-y (meters 2.368)) @@ -1135,8 +1131,7 @@ ;; failed to figure out what this is: (defpart 483 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 1.3333334)) (sp-flt spt-y (meters 0.44444445)) @@ -1159,8 +1154,7 @@ ;; failed to figure out what this is: (defpart 480 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.5 1.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-flt spt-y (meters -0.55)) @@ -1187,8 +1181,7 @@ ;; failed to figure out what this is: (defpart 481 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-z (meters -0.26)) (sp-flt spt-scale-x (meters 6)) @@ -1206,8 +1199,7 @@ ;; failed to figure out what this is: (defpart 484 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters -0.094)) (sp-flt spt-y (meters 3.068)) @@ -1223,8 +1215,7 @@ ;; failed to figure out what this is: (defpart 485 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.5) (sp-flt spt-x (meters -1.3333334)) (sp-flt spt-y (meters 0.6666667)) @@ -1247,8 +1238,7 @@ ;; failed to figure out what this is: (defpart 486 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters -0.425)) (sp-flt spt-y (meters 3.792)) @@ -1264,8 +1254,7 @@ ;; failed to figure out what this is: (defpart 487 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.8888889)) (sp-flt spt-y (meters 1.3333334)) @@ -1288,8 +1277,7 @@ ;; failed to figure out what this is: (defpart 488 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters 2.893)) (sp-flt spt-y (meters 3.56)) @@ -1305,8 +1293,7 @@ ;; failed to figure out what this is: (defpart 489 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2.6666667)) (sp-flt spt-y (meters -1.3333334)) @@ -1329,8 +1316,7 @@ ;; failed to figure out what this is: (defpart 490 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters 2.482)) (sp-flt spt-y (meters 4.296)) @@ -1346,8 +1332,7 @@ ;; failed to figure out what this is: (defpart 491 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2.6666667)) (sp-flt spt-y (meters -0.44444445)) @@ -1370,8 +1355,7 @@ ;; failed to figure out what this is: (defpart 492 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters 2.538)) (sp-flt spt-y (meters 4.979)) @@ -1387,8 +1371,7 @@ ;; failed to figure out what this is: (defpart 493 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 0.22222222)) @@ -1411,8 +1394,7 @@ ;; failed to figure out what this is: (defpart 494 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters 11.611)) (sp-flt spt-y (meters 2.762)) @@ -1428,8 +1410,7 @@ ;; failed to figure out what this is: (defpart 495 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.6666667)) (sp-flt spt-y (meters -1.1111112)) @@ -1452,8 +1433,7 @@ ;; failed to figure out what this is: (defpart 496 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters 11.543)) (sp-flt spt-y (meters 2.356)) @@ -1469,8 +1449,7 @@ ;; failed to figure out what this is: (defpart 497 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4.888889)) (sp-flt spt-y (meters 0.9777778)) @@ -1493,8 +1472,7 @@ ;; failed to figure out what this is: (defpart 498 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.25 0.1 1.0) (sp-flt spt-x (meters 11.588)) (sp-flt spt-y (meters 6.887)) @@ -1510,8 +1488,7 @@ ;; failed to figure out what this is: (defpart 499 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.35555556)) (sp-flt spt-y (meters -1.3333334)) @@ -1536,8 +1513,7 @@ (defpartgroup group-village1-sagehut-drips :id 139 :bounds (static-bspherem 7 4 -4.5 12) - :parts - ((sp-item 500 :fade-after (meters 40) :period 673 :length 5) + :parts ((sp-item 500 :fade-after (meters 40) :period 673 :length 5) (sp-item 500 :fade-after (meters 50) :period 1036 :length 5) (sp-item 500 :fade-after (meters 60) :period 1572 :length 5) (sp-item 500 :fade-after (meters 40) :period 2158 :length 5) @@ -1556,17 +1532,9 @@ ;; failed to figure out what this is: (defpart 502 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-rnd-flt spt-num 2.0 6.0 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "drip-on-wood") - :volume #x200 - ) - ) + (sp-sound (static-sound-spec "drip-on-wood" :volume 50.0)) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-g 96.0 128.0 1.0) @@ -1584,8 +1552,7 @@ ;; failed to figure out what this is: (defpart 503 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.02)) (sp-flt spt-scale-x (meters 1)) @@ -1604,8 +1571,7 @@ ;; failed to figure out what this is: (defpart 500 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.9)) (sp-flt spt-y (meters 8.825)) @@ -1631,14 +1597,12 @@ ;; failed to figure out what this is: (defpart 504 - :init-specs - ((sp-flt spt-scalevel-y (meters 0.00033333333)) (sp-flt spt-accel-x 0.13653333) (sp-flt spt-accel-y -2.048)) + :init-specs ((sp-flt spt-scalevel-y (meters 0.00033333333)) (sp-flt spt-accel-x 0.13653333) (sp-flt spt-accel-y -2.048)) ) ;; failed to figure out what this is: (defpart 501 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -3.25)) (sp-flt spt-y (meters 5.55)) @@ -1662,8 +1626,7 @@ ;; failed to figure out what this is: (defpart 505 - :init-specs - ((sp-flt spt-accel-y -3.1402667)) + :init-specs ((sp-flt spt-accel-y -3.1402667)) ) ;; definition for function check-drop-level-sagehut @@ -1671,13 +1634,9 @@ (when (< (-> arg2 y) (-> arg1 user-float)) (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (if (< (+ -1.0 (the-as float v1-2)) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) - ) - ) + (if (< (rand-float-gen) 0.25) + (sound-play "water-drop") + ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var *sp-particle-system-2d* @@ -1704,8 +1663,7 @@ (defpartgroup group-village1-sagehut-warpgate :id 140 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1970 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1970 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1971 :fade-after (meters 60) :falloff-to (meters 100) :binding 1968) (sp-item 1968 :flags (bit1 start-dead launch-asap)) (sp-item 1968 :flags (bit1 start-dead launch-asap)) @@ -1882,8 +1840,7 @@ ;; failed to figure out what this is: (defpart 1973 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-x (meters 0)) (sp-flt spt-scale-x (meters 5)) @@ -1901,8 +1858,7 @@ ;; failed to figure out what this is: (defpart 1972 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters -2)) (sp-flt spt-scale-x (meters 0.25)) @@ -1918,8 +1874,7 @@ ;; failed to figure out what this is: (defpart 1969 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2.4444444)) (sp-flt spt-y (meters 4)) @@ -1943,8 +1898,7 @@ ;; failed to figure out what this is: (defpart 1970 - :init-specs - ((sp-rnd-flt spt-num 3.0 3.0 1.0) + :init-specs ((sp-rnd-flt spt-num 3.0 3.0 1.0) (sp-flt spt-x (meters -0.5)) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) @@ -1962,8 +1916,7 @@ ;; failed to figure out what this is: (defpart 1971 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.25)) (sp-copy-from-other spt-scale-y -4) @@ -1978,8 +1931,7 @@ ;; failed to figure out what this is: (defpart 1968 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2.4444444)) (sp-flt spt-y (meters 4)) @@ -2007,14 +1959,12 @@ :id 141 :flags (always-draw) :bounds (static-bspherem 0 10 0 260) - :parts - ((sp-item 511)) + :parts ((sp-item 511)) ) ;; failed to figure out what this is: (defpart 511 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.04) (sp-flt spt-y (meters 45)) (sp-rnd-flt spt-scale-x (meters 300) (meters 100) 1.0) @@ -2038,14 +1988,12 @@ ;; failed to figure out what this is: (defpart 512 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 450 149 1) (sp-launcher-by-id spt-next-launcher 513)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 450 149 1) (sp-launcher-by-id spt-next-launcher 513)) ) ;; failed to figure out what this is: (defpart 513 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) ;; failed to figure out what this is: @@ -2053,8 +2001,7 @@ :id 684 :flags (always-draw) :bounds (static-bspherem 0 10 0 12) - :parts - ((sp-item 2844 :period 4500 :length 1200) + :parts ((sp-item 2844 :period 4500 :length 1200) (sp-item 2845 :period 4500 :length 1200 :offset 4050) (sp-item 2846 :period 4500 :length 1200 :offset 1500) (sp-item 2847 :period 4500 :length 1200 :offset 1050) @@ -2065,8 +2012,7 @@ ;; failed to figure out what this is: (defpart 2848 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-x (meters 60)) (sp-flt spt-y (meters -8)) @@ -2093,8 +2039,7 @@ ;; failed to figure out what this is: (defpart 2849 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters 60)) (sp-rnd-flt spt-y (meters 95) (meters 20) 1.0) @@ -2125,8 +2070,7 @@ ;; failed to figure out what this is: (defpart 2846 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters -8)) @@ -2153,8 +2097,7 @@ ;; failed to figure out what this is: (defpart 2847 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters 0)) (sp-rnd-flt spt-y (meters 95) (meters 20) 1.0) @@ -2185,8 +2128,7 @@ ;; failed to figure out what this is: (defpart 2844 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.06) (sp-flt spt-x (meters -100)) (sp-flt spt-y (meters -8)) @@ -2213,14 +2155,12 @@ ;; failed to figure out what this is: (defpart 2850 - :init-specs - ((sp-flt spt-scalevel-x (meters 0.06666667)) (sp-flt spt-fade-a -1.0666667)) + :init-specs ((sp-flt spt-scalevel-x (meters 0.06666667)) (sp-flt spt-fade-a -1.0666667)) ) ;; failed to figure out what this is: (defpart 2845 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters -100)) (sp-rnd-flt spt-y (meters 95) (meters 20) 1.0) @@ -2251,16 +2191,14 @@ ;; failed to figure out what this is: (defpart 2851 - :init-specs - ((sp-flt spt-fade-a -0.03678161)) + :init-specs ((sp-flt spt-fade-a -0.03678161)) ) ;; failed to figure out what this is: (defpartgroup group-village1-trans-pad :id 142 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 514 :fade-after (meters 160)) + :parts ((sp-item 514 :fade-after (meters 160)) (sp-item 515 :fade-after (meters 160)) (sp-item 516 :fade-after (meters 60) :falloff-to (meters 60) :flags (is-3d)) ) @@ -2268,8 +2206,7 @@ ;; failed to figure out what this is: (defpart 514 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 5)) (sp-rnd-flt spt-scale-x (meters 10) (meters 1) 1.0) @@ -2285,8 +2222,7 @@ ;; failed to figure out what this is: (defpart 515 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.5) (sp-flt spt-y (meters 3)) (sp-rnd-flt spt-scale-x (meters 5) (meters 1) 1.0) @@ -2303,8 +2239,7 @@ ;; failed to figure out what this is: (defpart 516 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0.75) (meters 0.1) 1.0) (sp-flt spt-scale-x (meters 0)) diff --git a/test/decompiler/reference/levels/village1/village1-part_REF.gc b/test/decompiler/reference/levels/village1/village1-part_REF.gc index ede5e22a32..c32dcf745f 100644 --- a/test/decompiler/reference/levels/village1/village1-part_REF.gc +++ b/test/decompiler/reference/levels/village1/village1-part_REF.gc @@ -22,8 +22,7 @@ (defpartgroup group-village1-butterflies :id 127 :bounds (static-bspherem 0 0 0 30) - :parts - ((sp-item 380 :fade-after (meters 120) :period 4903 :length 5 :hour-mask #b111111100000000000111111 :binding 381) + :parts ((sp-item 380 :fade-after (meters 120) :period 4903 :length 5 :hour-mask #b111111100000000000111111 :binding 381) (sp-item 380 :fade-after (meters 120) :period 6637 :length 5 :hour-mask #b111111100000000000111111 :binding 381) (sp-item 380 :fade-after (meters 120) :period 9846 :length 5 :hour-mask #b111111100000000000111111 :binding 381) (sp-item 381 :flags (start-dead launch-asap) :binding 382) @@ -41,8 +40,7 @@ ;; failed to figure out what this is: (defpart 380 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 7.5) 1.0) (sp-rnd-flt spt-y (meters 14) (meters 3) 1.0) @@ -62,8 +60,7 @@ ;; failed to figure out what this is: (defpart 383 - :init-specs - ((sp-flt spt-accel-y 0.0) + :init-specs ((sp-flt spt-accel-y 0.0) (sp-int-plain-rnd spt-next-time 2700 1499 1) (sp-launcher-by-id spt-next-launcher 384) ) @@ -71,14 +68,12 @@ ;; failed to figure out what this is: (defpart 384 - :init-specs - ((sp-flt spt-accel-y 1.3653333)) + :init-specs ((sp-flt spt-accel-y 1.3653333)) ) ;; failed to figure out what this is: (defpart 381 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -102,8 +97,7 @@ ;; failed to figure out what this is: (defpart 385 - :init-specs - ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.035555556) 1.0) (sp-rnd-flt spt-vel-y (meters -0.0074074077) (meters 0.0148148155) 1.0) (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) (sp-int-plain-rnd spt-next-time 150 449 1) @@ -113,8 +107,7 @@ ;; failed to figure out what this is: (defpart 382 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 0.9)) @@ -134,8 +127,7 @@ (defpartgroup group-village1-moth :id 128 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 386 :fade-after (meters 120) :flags (bit1) :period 18030 :length 5 :hour-mask #b1111111110000000 :binding 387) + :parts ((sp-item 386 :fade-after (meters 120) :flags (bit1) :period 18030 :length 5 :hour-mask #b1111111110000000 :binding 387) (sp-item 387 :flags (start-dead launch-asap) :binding 388) (sp-item 388 :flags (is-3d start-dead)) ) @@ -143,8 +135,7 @@ ;; failed to figure out what this is: (defpart 386 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.1)) (sp-copy-from-other spt-scale-y -4) @@ -158,8 +149,7 @@ ;; failed to figure out what this is: (defpart 387 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 1.5)) @@ -183,8 +173,7 @@ ;; failed to figure out what this is: (defpart 389 - :init-specs - ((sp-rnd-flt spt-vel-x (meters -0.035555556) (meters 0.07111111) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters -0.035555556) (meters 0.07111111) 1.0) (sp-rnd-flt spt-vel-y (meters -0.0148148155) (meters 0.029629631) 1.0) (sp-rnd-flt spt-rotvel-z (degrees -0.4) (degrees 0.8) 1.0) (sp-int-plain-rnd spt-next-time 150 449 1) @@ -194,8 +183,7 @@ ;; failed to figure out what this is: (defpart 388 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 0.4)) @@ -214,8 +202,7 @@ (defpartgroup group-village1-hummingbird :id 129 :bounds (static-bspherem 0 3 0 4) - :parts - ((sp-item 390 :fade-after (meters 20) :flags (is-3d bit1) :period 6000 :length 5 :hour-mask #b111111100000000000111111) + :parts ((sp-item 390 :fade-after (meters 20) :flags (is-3d bit1) :period 6000 :length 5 :hour-mask #b111111100000000000111111) (sp-item 391 :fade-after (meters 20) :flags (is-3d bit1) :period 6000 :length 5) (sp-item 392 :fade-after (meters 20) :flags (is-3d bit1) :period 6000 :length 5) (sp-item 393 :fade-after (meters 20) :flags (is-3d bit1) :period 6000 :length 5) @@ -226,8 +213,7 @@ ;; failed to figure out what this is: (defpart 390 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -248,8 +234,7 @@ ;; failed to figure out what this is: (defpart 396 - :init-specs - ((sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.1) 1.0) + :init-specs ((sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.1) 1.0) (sp-rnd-int spt-a 1119879168 1 16.0) (sp-int spt-next-time 5) (sp-launcher-by-id spt-next-launcher 396) @@ -258,8 +243,7 @@ ;; failed to figure out what this is: (defpart 391 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -280,8 +264,7 @@ ;; failed to figure out what this is: (defpart 397 - :init-specs - ((sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.1) 1.0) + :init-specs ((sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.1) 1.0) (sp-rnd-int spt-a 1119879168 1 16.0) (sp-flt spt-accel-x 2.7306666) (sp-flt spt-accel-y 1.3653333) @@ -292,8 +275,7 @@ ;; failed to figure out what this is: (defpart 398 - :init-specs - ((sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.1) 1.0) + :init-specs ((sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.1) 1.0) (sp-rnd-int spt-a 1119879168 1 16.0) (sp-int spt-next-time 5) (sp-launcher-by-id spt-next-launcher 398) @@ -302,8 +284,7 @@ ;; failed to figure out what this is: (defpart 392 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -326,8 +307,7 @@ ;; failed to figure out what this is: (defpart 399 - :init-specs - ((sp-flt spt-rot-x 24576.0) + :init-specs ((sp-flt spt-rot-x 24576.0) (sp-flt spt-rot-y (degrees 90.0)) (sp-rnd-flt spt-rot-z (degrees -70.0) (degrees 140.0) 1.0) (sp-rnd-int spt-a 1107296256 1 32.0) @@ -338,8 +318,7 @@ ;; failed to figure out what this is: (defpart 393 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -362,8 +341,7 @@ ;; failed to figure out what this is: (defpart 400 - :init-specs - ((sp-flt spt-rot-x 24576.0) + :init-specs ((sp-flt spt-rot-x 24576.0) (sp-flt spt-rot-y (degrees 90.0)) (sp-rnd-flt spt-rot-z (degrees -70.0) (degrees 140.0) 1.0) (sp-rnd-int spt-a 1107296256 1 32.0) @@ -376,8 +354,7 @@ ;; failed to figure out what this is: (defpart 401 - :init-specs - ((sp-flt spt-rot-x 24576.0) + :init-specs ((sp-flt spt-rot-x 24576.0) (sp-flt spt-rot-y (degrees 90.0)) (sp-rnd-flt spt-rot-z (degrees -70.0) (degrees 140.0) 1.0) (sp-rnd-int spt-a 1107296256 1 32.0) @@ -388,8 +365,7 @@ ;; failed to figure out what this is: (defpart 394 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 8192.0) @@ -411,8 +387,7 @@ ;; failed to figure out what this is: (defpart 402 - :init-specs - ((sp-flt spt-rot-x 8192.0) + :init-specs ((sp-flt spt-rot-x 8192.0) (sp-flt spt-rot-y (degrees -90.0)) (sp-rnd-flt spt-rot-z (degrees -70.0) (degrees 140.0) 1.0) (sp-rnd-int spt-a 1107296256 1 32.0) @@ -423,8 +398,7 @@ ;; failed to figure out what this is: (defpart 395 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 8192.0) @@ -447,8 +421,7 @@ ;; failed to figure out what this is: (defpart 403 - :init-specs - ((sp-flt spt-rot-x 8192.0) + :init-specs ((sp-flt spt-rot-x 8192.0) (sp-flt spt-rot-y (degrees -90.0)) (sp-rnd-flt spt-rot-z (degrees -70.0) (degrees 140.0) 1.0) (sp-rnd-int spt-a 1107296256 1 32.0) @@ -461,8 +434,7 @@ ;; failed to figure out what this is: (defpart 404 - :init-specs - ((sp-flt spt-rot-x 8192.0) + :init-specs ((sp-flt spt-rot-x 8192.0) (sp-flt spt-rot-y (degrees -90.0)) (sp-rnd-flt spt-rot-z (degrees -70.0) (degrees 140.0) 1.0) (sp-rnd-int spt-a 1107296256 1 32.0) @@ -473,8 +445,7 @@ ;; failed to figure out what this is: (defpart 405 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.03) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 2.3)) @@ -502,8 +473,7 @@ ;; failed to figure out what this is: (defpart 406 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) @@ -526,8 +496,7 @@ ;; failed to figure out what this is: (defpart 407 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-flt spt-y (meters 1.2)) (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.15) 1.0) @@ -557,8 +526,7 @@ ;; failed to figure out what this is: (defpart 408 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.16) (sp-rnd-flt spt-x (meters -0.22) (meters 0.44) 1.0) (sp-flt spt-y (meters 0)) @@ -587,8 +555,7 @@ (defpartgroup group-village1-pot :id 130 :bounds (static-bspherem 0 2.5 0 2.5) - :parts - ((sp-item 405 :fade-after (meters 50) :falloff-to (meters 60)) + :parts ((sp-item 405 :fade-after (meters 50) :falloff-to (meters 60)) (sp-item 406 :fade-after (meters 50) :falloff-to (meters 60)) (sp-item 407 :fade-after (meters 60) :falloff-to (meters 80)) (sp-item 409 :fade-after (meters 60) :falloff-to (meters 80)) @@ -599,8 +566,7 @@ (defpartgroup group-village1-mayor-fire :id 131 :bounds (static-bspherem 0 2.5 0 2.5) - :parts - ((sp-item 410 :fade-after (meters 50) :falloff-to (meters 80)) + :parts ((sp-item 410 :fade-after (meters 50) :falloff-to (meters 80)) (sp-item 411 :fade-after (meters 40) :falloff-to (meters 40) :binding 2292) (sp-item 2292 :flags (bit1 start-dead launch-asap)) (sp-item 2292 :flags (bit1 start-dead launch-asap)) @@ -673,17 +639,9 @@ ;; failed to figure out what this is: (defpart 411 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "fire-pop") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "fire-pop" :volume 100.0)) (sp-rnd-flt spt-x (meters -0.6) (meters 1.3) 1.0) (sp-rnd-flt spt-y (meters 1) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -705,8 +663,7 @@ ;; failed to figure out what this is: (defpart 2292 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -734,14 +691,12 @@ ;; failed to figure out what this is: (defpart 2293 - :init-specs - ((sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g 1.0666667) (sp-flt spt-fade-b 1.0666667)) + :init-specs ((sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g 1.0666667) (sp-flt spt-fade-b 1.0666667)) ) ;; failed to figure out what this is: (defpart 410 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 4.0 10.0 1.0) (sp-rnd-flt spt-x (meters -1.2) (meters 2) 1.0) (sp-flt spt-y (meters 0)) @@ -766,8 +721,7 @@ ;; failed to figure out what this is: (defpart 412 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters 0)) @@ -796,8 +750,7 @@ ;; failed to figure out what this is: (defpart 413 - :init-specs - ((sp-flt spt-num 0.4) + :init-specs ((sp-flt spt-num 0.4) (sp-flt spt-x (meters 0.2)) (sp-int spt-rot-x 8) (sp-flt spt-r 3276.8) @@ -816,16 +769,14 @@ ;; failed to figure out what this is: (defpart 414 - :init-specs - ((sp-flt spt-fade-b -1.3653333)) + :init-specs ((sp-flt spt-fade-b -1.3653333)) ) ;; failed to figure out what this is: (defpartgroup group-village1-sagehut-seagulls :id 132 :bounds (static-bspherem 0 8 0 45) - :parts - ((sp-item 415 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 416) + :parts ((sp-item 415 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 416) (sp-item 415 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 416) (sp-item 415 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 416) (sp-item 415 :fade-after (meters 120) :flags (bit1 launch-asap) :binding 416) @@ -891,8 +842,7 @@ ;; failed to figure out what this is: (defpart 415 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-func spt-birth-func 'birth-func-random-next-time) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -15) (meters 30) 1.0) @@ -919,8 +869,7 @@ ;; failed to figure out what this is: (defpart 416 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-func spt-birth-func 'birth-func-copy-omega-to-z) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) @@ -946,8 +895,7 @@ ;; failed to figure out what this is: (defpart 418 - :init-specs - ((sp-flt spt-scale-x (meters 8)) + :init-specs ((sp-flt spt-scale-x (meters 8)) (sp-flt spt-scalevel-x (meters -0.08)) (sp-int spt-timer 600) (sp-int spt-next-time 100) @@ -957,8 +905,7 @@ ;; failed to figure out what this is: (defpart 419 - :init-specs - ((sp-flt spt-scale-x (meters 0)) + :init-specs ((sp-flt spt-scale-x (meters 0)) (sp-flt spt-scalevel-x (meters -0.04)) (sp-int spt-timer 600) (sp-int spt-next-time 199) @@ -968,8 +915,7 @@ ;; failed to figure out what this is: (defpart 417 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-func spt-birth-func 'birth-func-copy2-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 4)) @@ -984,16 +930,14 @@ (defpartgroup group-village1-butterfly-sitting :id 133 :bounds (static-bspherem 0 0.2 0 0.5) - :parts - ((sp-item 420 :fade-after (meters 60) :flags (is-3d bit1) :period 600 :length 5) + :parts ((sp-item 420 :fade-after (meters 60) :flags (is-3d bit1) :period 600 :length 5) (sp-item 421 :fade-after (meters 60) :flags (is-3d bit1) :period 600 :length 5) ) ) ;; failed to figure out what this is: (defpart 420 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.05)) (sp-flt spt-scale-x (meters 0.9)) @@ -1014,14 +958,12 @@ ;; failed to figure out what this is: (defpart 422 - :init-specs - ((sp-flt spt-rotvel-x (degrees -0.31666666))) + :init-specs ((sp-flt spt-rotvel-x (degrees -0.31666666))) ) ;; failed to figure out what this is: (defpart 421 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.05)) (sp-flt spt-scale-x (meters 0.9)) @@ -1042,16 +984,14 @@ ;; failed to figure out what this is: (defpart 423 - :init-specs - ((sp-flt spt-rotvel-x (degrees 0.31666666))) + :init-specs ((sp-flt spt-rotvel-x (degrees 0.31666666))) ) ;; failed to figure out what this is: (defpartgroup group-village1-fountain :id 134 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 424 :fade-after (meters 150) :falloff-to (meters 150)) + :parts ((sp-item 424 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 425 :fade-after (meters 150) :falloff-to (meters 150)) (sp-item 425 :fade-after (meters 150) :falloff-to (meters 150) :period 463 :length 139) (sp-item 426 :fade-after (meters 90) :falloff-to (meters 90) :period 526 :length 186) @@ -1065,8 +1005,7 @@ ;; failed to figure out what this is: (defpart 431 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 1.0 4.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1087,8 +1026,7 @@ ;; failed to figure out what this is: (defpart 430 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.9) (sp-rnd-flt spt-y (meters 0) (meters 0.4) 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) @@ -1114,14 +1052,12 @@ ;; failed to figure out what this is: (defpart 432 - :init-specs - ((sp-flt spt-fade-a -0.07111111)) + :init-specs ((sp-flt spt-fade-a -0.07111111)) ) ;; failed to figure out what this is: (defpart 426 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 2.0 4.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters 0.4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) @@ -1149,8 +1085,7 @@ ;; failed to figure out what this is: (defpart 428 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 2.0 4.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters 0.4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) @@ -1178,8 +1113,7 @@ ;; failed to figure out what this is: (defpart 427 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 2.0 4.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters 0.4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) @@ -1207,8 +1141,7 @@ ;; failed to figure out what this is: (defpart 425 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 3.0 4.0 1.0) (sp-rnd-flt spt-y (meters 0) (meters 0.4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) @@ -1236,8 +1169,7 @@ ;; failed to figure out what this is: (defpart 429 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-y (meters 0) (meters 0.4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) @@ -1265,8 +1197,7 @@ ;; failed to figure out what this is: (defpart 424 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 1.0 7.0 1.0) (sp-rnd-flt spt-y (meters -0.4) (meters 0.4) 1.0) (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.15) 1.0) @@ -1288,14 +1219,12 @@ ;; failed to figure out what this is: (defpart 433 - :init-specs - ((sp-flt spt-scalevel-y (meters 0.0023076923))) + :init-specs ((sp-flt spt-scalevel-y (meters 0.0023076923))) ) ;; failed to figure out what this is: (defpart 434 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1315,8 +1244,7 @@ ;; failed to figure out what this is: (defpart 435 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 0.02)) (sp-flt spt-scale-x (meters 1)) @@ -1379,8 +1307,7 @@ (defpartgroup group-village1-bird-lady-birds :id 135 :bounds (static-bspherem 0 0 6 18) - :parts - ((sp-item 436 :fade-after (meters 40) :period 900 :length 5 :binding 437) + :parts ((sp-item 436 :fade-after (meters 40) :period 900 :length 5 :binding 437) (sp-item 437 :flags (bit1 start-dead launch-asap) :binding 438) (sp-item 438 :flags (is-3d bit1 start-dead) :binding 439) (sp-item 439 :flags (is-3d bit1 start-dead) :binding 440) @@ -1451,8 +1378,7 @@ ;; failed to figure out what this is: (defpart 472 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0.8)) (sp-flt spt-y (meters 0.8)) @@ -1468,8 +1394,7 @@ ;; failed to figure out what this is: (defpart 473 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2)) (sp-flt spt-y (meters 1.0666667)) @@ -1489,8 +1414,7 @@ ;; failed to figure out what this is: (defpart 474 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -1507,8 +1431,7 @@ ;; failed to figure out what this is: (defpart 475 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1526,8 +1449,7 @@ ;; failed to figure out what this is: (defpart 476 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1545,8 +1467,7 @@ ;; failed to figure out what this is: (defpart 464 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 5.9)) (sp-flt spt-y (meters 2.4)) @@ -1566,8 +1487,7 @@ ;; failed to figure out what this is: (defpart 465 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -1583,8 +1503,7 @@ ;; failed to figure out what this is: (defpart 466 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1602,8 +1521,7 @@ ;; failed to figure out what this is: (defpart 467 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1621,8 +1539,7 @@ ;; failed to figure out what this is: (defpart 468 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -8)) (sp-flt spt-y (meters 3.7)) @@ -1642,8 +1559,7 @@ ;; failed to figure out what this is: (defpart 469 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -1659,8 +1575,7 @@ ;; failed to figure out what this is: (defpart 470 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1678,8 +1593,7 @@ ;; failed to figure out what this is: (defpart 471 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1697,8 +1611,7 @@ ;; failed to figure out what this is: (defpart 460 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 1)) (sp-flt spt-y (meters 0.4)) @@ -1718,14 +1631,12 @@ ;; failed to figure out what this is: (defpart 477 - :init-specs - ((sp-flt spt-accel-y 0.53248)) + :init-specs ((sp-flt spt-accel-y 0.53248)) ) ;; failed to figure out what this is: (defpart 461 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -1741,8 +1652,7 @@ ;; failed to figure out what this is: (defpart 462 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1760,8 +1670,7 @@ ;; failed to figure out what this is: (defpart 463 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -1779,8 +1688,7 @@ ;; failed to figure out what this is: (defpart 457 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -6)) (sp-flt spt-y (meters 1.9)) @@ -1801,8 +1709,7 @@ ;; failed to figure out what this is: (defpart 458 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -6)) (sp-flt spt-y (meters 1.9)) @@ -1826,8 +1733,7 @@ ;; failed to figure out what this is: (defpart 459 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -6)) (sp-flt spt-y (meters 1.9)) @@ -1851,8 +1757,7 @@ ;; failed to figure out what this is: (defpart 454 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -5.5)) (sp-flt spt-y (meters 4.5)) @@ -1873,8 +1778,7 @@ ;; failed to figure out what this is: (defpart 455 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -5.5)) (sp-flt spt-y (meters 4.5)) @@ -1898,8 +1802,7 @@ ;; failed to figure out what this is: (defpart 456 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -5.5)) (sp-flt spt-y (meters 4.5)) @@ -1923,8 +1826,7 @@ ;; failed to figure out what this is: (defpart 451 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2)) (sp-flt spt-y (meters 5)) @@ -1945,8 +1847,7 @@ ;; failed to figure out what this is: (defpart 452 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2)) (sp-flt spt-y (meters 5)) @@ -1970,14 +1871,12 @@ ;; failed to figure out what this is: (defpart 478 - :init-specs - ((sp-flt spt-rotvel-x (degrees -0.31666666))) + :init-specs ((sp-flt spt-rotvel-x (degrees -0.31666666))) ) ;; failed to figure out what this is: (defpart 453 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x8 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 2)) (sp-flt spt-y (meters 5)) @@ -2001,14 +1900,12 @@ ;; failed to figure out what this is: (defpart 479 - :init-specs - ((sp-flt spt-rotvel-x (degrees 0.31666666))) + :init-specs ((sp-flt spt-rotvel-x (degrees 0.31666666))) ) ;; failed to figure out what this is: (defpart 446 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -6.4)) (sp-flt spt-y (meters 4.8)) @@ -2024,8 +1921,7 @@ ;; failed to figure out what this is: (defpart 447 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.7111111)) (sp-flt spt-y (meters 4)) @@ -2045,8 +1941,7 @@ ;; failed to figure out what this is: (defpart 448 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -2063,8 +1958,7 @@ ;; failed to figure out what this is: (defpart 449 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -2082,8 +1976,7 @@ ;; failed to figure out what this is: (defpart 450 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -2101,8 +1994,7 @@ ;; failed to figure out what this is: (defpart 441 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.1)) (sp-flt spt-y (meters 3.7)) @@ -2118,8 +2010,7 @@ ;; failed to figure out what this is: (defpart 442 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters -1.8666667)) @@ -2139,8 +2030,7 @@ ;; failed to figure out what this is: (defpart 443 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -2157,8 +2047,7 @@ ;; failed to figure out what this is: (defpart 444 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -2176,8 +2065,7 @@ ;; failed to figure out what this is: (defpart 445 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -2195,8 +2083,7 @@ ;; failed to figure out what this is: (defpart 436 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -2.3)) (sp-flt spt-y (meters 4.6)) @@ -2212,8 +2099,7 @@ ;; failed to figure out what this is: (defpart 437 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 1.4222223)) @@ -2233,8 +2119,7 @@ ;; failed to figure out what this is: (defpart 438 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.5)) (sp-flt spt-rot-x 16384.0) @@ -2250,8 +2135,7 @@ ;; failed to figure out what this is: (defpart 439 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) @@ -2269,8 +2153,7 @@ ;; failed to figure out what this is: (defpart 440 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1c :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-flt spt-rot-x 24576.0) diff --git a/test/decompiler/reference/levels/village1/yakow_REF.gc b/test/decompiler/reference/levels/village1/yakow_REF.gc index 1405733244..02af99fbdf 100644 --- a/test/decompiler/reference/levels/village1/yakow_REF.gc +++ b/test/decompiler/reference/levels/village1/yakow_REF.gc @@ -1,31 +1,23 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/village1cam-ag.gc") +(import "goal_src/import/yakow-ag.gc") + ;; failed to figure out what this is: -(defskelgroup *village1cam-sg* village1cam - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *village1cam-sg* village1cam village1cam-lod0-jg village1cam-anim-ja + ((village1cam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; definition for function yakow-cam ;; INFO: Return type mismatch (pointer process) vs none. (defun yakow-cam () (with-pp (let ((gp-0 (entity-actor-lookup (-> pp entity) 'alt-actor 0))) - (when gp-0 - (let ((s5-0 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-0 - (let ((t9-2 (method-of-type pov-camera activate))) - (t9-2 (the-as pov-camera s5-0) pp 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process s5-0 pov-camera-init-by-other (-> gp-0 extra trans) *village1cam-sg* "anim" 0 #f '()) - (-> s5-0 ppointer) - ) + (if gp-0 + (process-spawn pov-camera (-> gp-0 extra trans) *village1cam-sg* "anim" 0 #f '() :to pp) ) - ) ) (none) ) @@ -189,14 +181,12 @@ ) ;; failed to figure out what this is: -(defskelgroup *yakow-sg* yakow - 0 - 4 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 0 2.5 0 4.4) - :longest-edge (meters 1.3) - :shadow 3 - ) +(defskelgroup *yakow-sg* yakow yakow-lod0-jg yakow-idle-ja + ((yakow-lod0-mg (meters 20)) (yakow-lod1-mg (meters 999999))) + :bounds (static-spherem 0 2.5 0 4.4) + :longest-edge (meters 1.3) + :shadow yakow-shadow-mg + ) ;; definition for function yakow-default-event-handler ;; INFO: Return type mismatch none vs object. @@ -333,13 +323,11 @@ yakow-default-event-handler ) ) ) - (set! (-> self walk-turn-blend) - (seek - (-> self walk-turn-blend) - f30-0 - (* (-> *YAKOW-bank* walk-turn-blend-rate) (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self walk-turn-blend) + f30-0 + (* (-> *YAKOW-bank* walk-turn-blend-rate) (-> *display* seconds-per-frame)) + ) ) (set! (-> self final-speed) (fmin (-> self travel-speed) (* (vector-length (-> self nav travel)) (-> *display* frames-per-second))) @@ -419,85 +407,33 @@ yakow-default-event-handler ;; definition for function yakow-blend-walk-run (defbehavior yakow-blend-walk-run yakow () (let ((gp-0 (-> *display* base-frame-counter))) - (while #t + (loop (let ((f30-0 (-> self final-speed))) (cond ((and (>= 409.6 (-> self final-speed)) (not (-> self rotating))) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 4) - ) - ) - (ja-channel-push! 1 45) + (if (not (ja-group? yakow-idle-ja)) + (ja-channel-push! 1 (seconds 0.15)) ) - (let ((s5-0 (-> self skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-identity - ) - (set! (-> s5-0 frame-num) 0.0) - ) + (ja :group! yakow-idle-ja :num! min) (while (or (< (- (-> *display* base-frame-counter) gp-0) (seconds 0.2)) (< (-> self final-speed) 409.6)) (suspend) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 param 0) 1.0) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop!)) ) ) (else (set! gp-0 (-> *display* base-frame-counter)) ) ) - (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 3 22) - (let ((s5-1 (-> self skel root-channel 0))) - (set! (-> s5-1 frame-interp) 0.0) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-identity - ) - (set! (-> s5-1 frame-num) 0.0) - ) - (let ((s5-2 (-> self skel root-channel 1))) - (set! (-> s5-2 frame-interp) 0.0) - (joint-control-channel-group-eval! - s5-2 - (the-as art-joint-anim (-> self draw art-group data 10)) - num-func-identity - ) - (set! (-> s5-2 frame-num) 0.0) - ) - (let ((s5-3 (-> self skel root-channel 2))) - (set! (-> s5-3 frame-interp) 0.0) - (joint-control-channel-group-eval! - s5-3 - (the-as art-joint-anim (-> self draw art-group data 7)) - num-func-identity - ) - (set! (-> s5-3 frame-num) 0.0) - ) + (when (not (ja-group? yakow-walk-ja)) + (ja-channel-push! 3 (seconds 0.075)) + (ja :group! yakow-walk-ja :num! min :frame-interp 0.0) + (ja :chan 1 :group! yakow-walk-left-ja :num! min :frame-interp 0.0) + (ja :chan 2 :group! yakow-run-ja :num! min :frame-interp 0.0) ) - (cond - ((< (-> self walk-turn-blend) 0.0) - (let ((v1-49 (-> self skel root-channel 1))) - (set! (-> v1-49 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - ) - ) - (else - (let ((v1-52 (-> self skel root-channel 1))) - (set! (-> v1-52 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - ) + (if (< (-> self walk-turn-blend) 0.0) + (ja :chan 1 :group! yakow-walk-left-ja) + (ja :chan 1 :group! yakow-walk-right-ja) ) - ) (cond ((< f30-0 (-> *YAKOW-bank* min-run-speed)) (set! (-> self run-mode) #f) @@ -507,19 +443,19 @@ yakow-default-event-handler ) ) (if (-> self run-mode) - (set! (-> self walk-run-blend) - (seek (-> self walk-run-blend) 1.0 (* (-> *YAKOW-bank* walk-run-blend-rate) (-> *display* seconds-per-frame))) - ) - (set! (-> self walk-run-blend) - (seek (-> self walk-run-blend) 0.0 (* (-> *YAKOW-bank* walk-run-blend-rate) (-> *display* seconds-per-frame))) - ) + (seek! + (-> self walk-run-blend) + 1.0 + (* (-> *YAKOW-bank* walk-run-blend-rate) (-> *display* seconds-per-frame)) + ) + (seek! + (-> self walk-run-blend) + 0.0 + (* (-> *YAKOW-bank* walk-run-blend-rate) (-> *display* seconds-per-frame)) + ) ) - (let ((v1-68 (-> self skel root-channel 1))) - (set! (-> v1-68 frame-interp) (fabs (-> self walk-turn-blend))) - ) - (let ((v1-72 (-> self skel root-channel 2))) - (set! (-> v1-72 frame-interp) (-> self walk-run-blend)) - ) + (ja :chan 1 :frame-interp (fabs (-> self walk-turn-blend))) + (ja :chan 2 :frame-interp (-> self walk-run-blend)) (let* ((f0-25 (* (-> *YAKOW-bank* walk-anim-speed) f30-0)) (f1-5 (-> *YAKOW-bank* walk-speed)) (f0-26 (* f0-25 (/ 1.0 f1-5))) @@ -537,20 +473,11 @@ yakow-default-event-handler (if (-> self rotating) (set! f0-26 (fmax (-> *YAKOW-bank* min-walk-anim-speed) f0-26)) ) - (let ((a0-24 (-> self skel root-channel 0))) - (set! (-> a0-24 param 0) f0-26) - (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! f0-26)) ) ) - (let ((s5-4 (-> self skel root-channel 1))) - (set! (-> s5-4 num-func) num-func-identity) - (set! (-> s5-4 frame-num) (ja-frame-num 0)) - ) - (let ((s5-5 (-> self skel root-channel 2))) - (set! (-> s5-5 num-func) num-func-identity) - (set! (-> s5-5 frame-num) (ja-frame-num 0)) - ) + (ja :chan 1 :num-func num-func-identity :frame-num (ja-frame-num 0)) + (ja :chan 2 :num-func num-func-identity :frame-num (ja-frame-num 0)) (suspend) 0 ) @@ -585,16 +512,13 @@ yakow-default-event-handler ;; failed to figure out what this is: (defstate yakow-idle (yakow) - :event - yakow-default-event-handler - :enter - (behavior () + :event yakow-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self travel-speed) 0.0) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> *YAKOW-bank* default-patrol-time)) (and *target* (>= (-> self fact-override idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) @@ -606,10 +530,9 @@ yakow-default-event-handler ) (none) ) - :code - (behavior () - (ja-channel-push! 1 45) - (while #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.15)) + (loop (cond ((rand-vu-percent? 0.2) (dummy-10 (-> self skel effect) 'yakow-1 0.0 -1) @@ -619,98 +542,67 @@ yakow-default-event-handler ) ) (let ((f30-0 (rand-vu-float-range 0.9 1.1))) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-6 param 1) f30-0) - (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! yakow-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) f30-0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-0)) ) ) (when (rand-vu-percent? 0.25) - (ja-channel-push! 1 30) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-11 param 1) 1.0) - (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! yakow-graze-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) ) (none) ) - :post - (the-as (function none :behavior yakow) ja-post) + :post (the-as (function none :behavior yakow) ja-post) ) ;; failed to figure out what this is: (defstate yakow-notice (yakow) - :event - yakow-default-event-handler - :enter - (behavior () + :event yakow-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self travel-speed) 0.0) (none) ) - :code - (behavior () + :code (behavior () (go yakow-run-away) (none) ) - :post - yakow-simple-post + :post yakow-simple-post ) ;; failed to figure out what this is: (defstate yakow-walk-to (yakow) - :event - yakow-default-event-handler - :enter - (behavior ((arg0 vector)) + :event yakow-default-event-handler + :enter (behavior ((arg0 vector)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (set! (-> self nav destination-pos quad) (-> arg0 quad)) (set! (-> self rotate-speed) (-> *YAKOW-bank* walk-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* walk-turn-time)) (none) ) - :trans - (behavior () + :trans (behavior () (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> *YAKOW-bank* default-patrol-time)) (not (-> self in-pen)) - (and *target* (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (and *target* + (>= (-> self fact-override idle-distance) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) ) (not (yakow-facing-player? 21845.334)) ) (go yakow-notice) ) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) - (when (or (logtest? (nav-control-flags bit19) (-> self nav flags)) + (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (< (vector-vector-xz-distance (-> self root-override trans) (-> self nav destination-pos)) 4096.0) ) (if (-> self in-pen) @@ -719,18 +611,15 @@ yakow-default-event-handler ) ) ) - (set! (-> self travel-speed) (seek - (-> self travel-speed) - (-> *YAKOW-bank* walk-speed) - (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self travel-speed) + (-> *YAKOW-bank* walk-speed) + (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame)) + ) (none) ) - :code - (the-as (function vector none :behavior yakow) yakow-blend-walk-run) - :post - (behavior () + :code (the-as (function vector none :behavior yakow) yakow-blend-walk-run) + :post (behavior () (dummy-19 (-> self nav) (-> self nav target-pos) @@ -738,8 +627,8 @@ yakow-default-event-handler (-> self nav destination-pos) 131072.0 ) - (if (logtest? (nav-control-flags bit21) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit10)) + (if (logtest? (nav-control-flags navcf21) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (yakow-post) (none) @@ -748,10 +637,8 @@ yakow-default-event-handler ;; failed to figure out what this is: (defstate yakow-graze (yakow) - :event - yakow-default-event-handler - :enter - (behavior () + :event yakow-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self travel-speed) 0.0) (set! (-> self grazing) #t) @@ -765,120 +652,63 @@ yakow-default-event-handler ) (none) ) - :code - (behavior () + :code (behavior () (while (< 546.13336 (fabs (deg-diff (-> self dest-rot) (y-angle (-> self root-override))))) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) - (ja-channel-push! 1 22) + (if (not (ja-group? yakow-walk-ja)) + (ja-channel-push! 1 (seconds 0.075)) ) (seek-toward-yaw-angle! (-> self root-override) (-> self dest-rot) 16384.0 (seconds 0.5)) - (let ((a0-6 (-> self skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-6 param 0) 1.0) - (joint-control-channel-group-eval! - a0-6 - (the-as art-joint-anim (-> self draw art-group data 6)) - num-func-loop! - ) - ) + (ja :group! yakow-walk-ja :num! (loop!)) (suspend) ) - (ja-channel-push! 1 45) - (while #t - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.15)) + (loop + (ja-no-eval :group! yakow-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (when (rand-vu-percent? 0.5) - (ja-channel-push! 1 30) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! yakow-graze-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1))) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (ja-channel-push! 1 30) + (ja-channel-push! 1 (seconds 0.1)) ) ) (none) ) - :post - yakow-simple-post + :post yakow-simple-post ) ;; failed to figure out what this is: (defstate yakow-graze-kicked (yakow) - :event - (the-as (function process int symbol event-message-block object :behavior yakow) #f) - :code - (behavior () - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + :event (the-as (function process int symbol event-message-block object :behavior yakow) #f) + :code (behavior () + (ja-no-eval :group! yakow-kicked-in-place-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go yakow-graze) (none) ) - :post - yakow-simple-post + :post yakow-simple-post ) ;; failed to figure out what this is: (defstate yakow-run-away (yakow) - :event - yakow-default-event-handler - :enter - (behavior () + :event yakow-default-event-handler + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (set! (-> self rotate-speed) (-> *YAKOW-bank* run-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* run-turn-time)) (none) ) - :trans - (behavior () + :trans (behavior () (when (or (not *target*) (< (-> *YAKOW-bank* safe-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -895,38 +725,31 @@ yakow-default-event-handler (vector-vector-distance (-> self root-override trans) (target-pos 0)) ) ) - (f30-2 - (lerp-scale - (-> *YAKOW-bank* run-speed) - (-> *YAKOW-bank* walk-speed) - f0-2 - (-> *YAKOW-bank* run-away-dist) - (-> *YAKOW-bank* walk-away-dist) - ) - ) + (f30-2 (lerp-scale + (-> *YAKOW-bank* run-speed) + (-> *YAKOW-bank* walk-speed) + f0-2 + (-> *YAKOW-bank* run-away-dist) + (-> *YAKOW-bank* walk-away-dist) + ) + ) ) (if (yakow-facing-player? 21845.334) (set! f30-2 0.0) ) (set! (-> self enable-turn-around) (< (-> *YAKOW-bank* run-speed) f30-2)) - (set! (-> self travel-speed) - (seek (-> self travel-speed) f30-2 (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame))) - ) + (seek! (-> self travel-speed) f30-2 (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame))) ) (none) ) - :code - yakow-blend-walk-run - :post - yakow-run-post + :code yakow-blend-walk-run + :post yakow-run-post ) ;; failed to figure out what this is: (defstate yakow-kicked (yakow) - :event - (the-as (function process int symbol event-message-block object :behavior yakow) #f) - :enter - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior yakow) #f) + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (if (-> self grazing) (go yakow-graze-kicked) @@ -939,39 +762,30 @@ yakow-default-event-handler ) (none) ) - :exit - (behavior () + :exit (behavior () '() (none) ) - :trans - (behavior () + :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) - (set! (-> self travel-speed) (seek - (-> self travel-speed) - (-> *YAKOW-bank* run-speed) - (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame)) - ) - ) + (seek! + (-> self travel-speed) + (-> *YAKOW-bank* run-speed) + (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame)) + ) ) 0 (none) ) - :code - (behavior () + :code (behavior () (set! (-> self enable-turn-around) #t) 1.0 (suspend) - (ja-channel-push! 1 15) + (ja-channel-push! 1 (seconds 0.05)) (cond ((< 40.96 (vector-length (-> self nav travel))) - (let ((v1-4 (-> self skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - ) - (let ((v1-7 (-> self skel root-channel 0))) - (set! (-> v1-7 num-func) num-func-identity) - (set! (-> v1-7 frame-num) 0.0) - ) + (ja :group! yakow-kicked-ja) + (ja :num-func num-func-identity :frame-num 0.0) (until (ja-done? 0) (suspend) (let* ((f0-3 0.75) @@ -983,50 +797,32 @@ yakow-default-event-handler ) ) ) - (a0-6 (-> self skel root-channel 0)) ) - (set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1))) - (set! (-> a0-6 param 1) f0-4) - (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!) + (ja :num! (seek! max f0-4)) ) ) ) (else - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! yakow-kicked-in-place-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (< 40.96 (-> self final-speed)) (go yakow-run-away) ) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) (go yakow-run-away) (none) ) - :post - yakow-run-post + :post yakow-run-post ) ;; failed to figure out what this is: (defstate yakow-die (yakow) - :event - (the-as (function process int symbol event-message-block object :behavior yakow) #f) - :code - (behavior () + :event (the-as (function process int symbol event-message-block object :behavior yakow) #f) + :code (behavior () (let ((v1-1 (-> self root-override root-prim))) (set! (-> v1-1 collide-with) (collide-kind)) (set! (-> v1-1 prim-core collide-as) (collide-kind)) @@ -1064,7 +860,7 @@ yakow-default-event-handler (process-drawable-from-entity! obj arg0) (set! (-> obj align) (new 'process 'align-control obj)) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav nearest-y-threshold) 409600.0) (set! (-> obj fact-override) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) @@ -1076,7 +872,7 @@ yakow-default-event-handler ) (set! (-> obj link) (new 'process 'actor-link-info obj)) (set! (-> obj water) (new 'process 'water-control obj 6 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (the-as uint 2)) + (set! (-> obj water flags) (water-flags wt01)) (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) (set! (-> obj water ripple-size) 12288.0) (set! (-> obj home-base quad) (-> obj root-override trans quad)) diff --git a/test/decompiler/reference/levels/village2/assistant-village2_REF.gc b/test/decompiler/reference/levels/village2/assistant-village2_REF.gc index 46a624c2f9..49bdb08148 100644 --- a/test/decompiler/reference/levels/village2/assistant-village2_REF.gc +++ b/test/decompiler/reference/levels/village2/assistant-village2_REF.gc @@ -1,6 +1,9 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/jaws-ag.gc") +(import "goal_src/import/assistant-village2-ag.gc") + ;; definition of type assistant-levitator (deftype assistant-levitator (process-taskable) ((boulder entity-actor :offset-assert 380) @@ -50,26 +53,23 @@ ) ;; failed to figure out what this is: -(defskelgroup *assistant-village2-sg* assistant-village2 - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 2) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *assistant-village2-sg* assistant-village2 assistant-village2-lod0-jg assistant-village2-idle-a-ja + ((assistant-village2-lod0-mg (meters 20)) + (assistant-village2-lod1-mg (meters 40)) + (assistant-village2-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 2) + :shadow assistant-village2-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *jaws-sg* jaws - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 0.25) - :longest-edge (meters 0) - ) +(defskelgroup *jaws-sg* jaws jaws-lod0-jg jaws-idle-ja + ((jaws-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.25) + ) ;; definition for method 52 of type assistant-levitator -;; INFO: Return type mismatch int vs none. +;; INFO: Return type mismatch shadow-flags vs none. (defmethod dummy-52 assistant-levitator ((obj assistant-levitator)) (let ((v1-1 (-> obj draw shadow-ctrl))) (when v1-1 @@ -83,7 +83,7 @@ ) ) 0 - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) ) ) (none) @@ -98,14 +98,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -115,326 +115,296 @@ ;; definition for method 32 of type assistant-bluehut (defmethod play-anim! assistant-bluehut ((obj assistant-bluehut) (arg0 symbol)) - (with-pp - (set! (-> obj talk-message) (game-text-id press-to-talk-to-assistant)) - (case (current-status (-> obj tasks)) - (((task-status unknown) (task-status need-hint) (task-status need-introduction)) - (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> obj talk-message) (game-text-id press-to-talk-to-assistant)) + (case (current-status (-> obj tasks)) + (((task-status unknown) (task-status need-hint) (task-status need-introduction)) + (if (not arg0) + (set! (-> obj will-talk) #t) + ) + (case (current-task (-> obj tasks)) + (((game-task village2-levitator)) + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (send-event (-> obj sage extra process) 'clone (process->handle obj)) + (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) + ) + (new 'static 'spool-anim + :name "assistant-village2-introduction" + :index 15 + :parts 16 + :command-list '((0 send-event target draw #f) + (0 kill "villageb-part-33") + (95 send-event target draw #t) + (95 joint "cameraB") + (131 send-event target draw #f) + (131 joint "camera") + (190 setting-reset ocean-off #t) + (190 kill "pontoonten-20") + (190 kill "pontoonten-19") + (190 kill "pontoonten-18") + (190 kill "pontoonten-17") + (190 kill "pontoonten-16") + (190 kill "pontoonten-15") + (190 kill "pontoonten-14") + (190 kill "pontoonten-13") + (190 kill "pontoonten-12") + (190 kill "pontoonten-11") + (190 kill "pontoonten-10") + (190 kill "pontoonten-9") + (190 kill "pontoonten-8") + (190 kill "pontoonten-7") + (190 kill "pontoonten-6") + (190 kill "pontoonfive-3") + (190 kill "pontoonfive-4") + (190 kill "pontoonfive-5") + (190 kill "pontoonfive-6") + (190 kill "pontoonfive-7") + (190 kill "pontoonfive-8") + (190 kill "pontoonfive-12") + (190 kill "pontoonfive-13") + (190 kill "pontoonfive-14") + (190 kill "pontoonfive-15") + (190 kill "pontoonfive-16") + (190 kill "pontoonfive-17") + (190 kill "pontoonfive-18") + (190 kill "pontoonfive-19") + (190 kill "pontoonfive-20") + (190 kill "allpontoons-1") + (190 kill "med-res-level-12") + (190 kill "med-res-level-13") + (190 kill "med-res-level-15") + (190 kill "swamp-blimp-3") + (190 kill "barrel-85") + (190 kill "barrel-86") + (190 kill "money-2844") + (190 kill "money-2845") + (190 kill "money-2846") + (190 kill "money-2847") + (190 kill "money-2848") + (190 kill "money-2849") + (190 kill "money-4923") + (190 kill "money-4924") + (190 kill "money-4925") + (190 kill "money-4926") + (190 kill "money-4927") + (190 kill "eco-27") + (190 kill "sharkey-25") + (190 kill "barrel-117") + (190 kill "barrel-118") + (190 kill "barrel-119") + (190 kill "barrel-120") + (190 kill "barrel-121") + (190 kill "barrel-122") + (190 kill "crate-3129") + (190 kill "crate-3132") + (190 kill "crate-3133") + (190 kill "villageb-part-32") + (190 kill "villageb-part-30") + (190 kill "exit-chamber-dummy-1") + (190 kill "villageb-part-34") + (191 send-event target draw #t) + (191 joint "cameraB") + (241 joint "camera") + (241 send-event target draw #f) + (241 setting-unset ocean-off) + (241 dead "pontoonten-20") + (241 dead "pontoonten-19") + (241 dead "pontoonten-18") + (241 dead "pontoonten-17") + (241 dead "pontoonten-16") + (241 dead "pontoonten-15") + (241 dead "pontoonten-14") + (241 dead "pontoonten-13") + (241 dead "pontoonten-12") + (241 dead "pontoonten-11") + (241 dead "pontoonten-10") + (241 dead "pontoonten-9") + (241 dead "pontoonten-8") + (241 dead "pontoonten-7") + (241 dead "pontoonten-6") + (241 dead "pontoonfive-3") + (241 dead "pontoonfive-4") + (241 dead "pontoonfive-5") + (241 dead "pontoonfive-6") + (241 dead "pontoonfive-7") + (241 dead "pontoonfive-8") + (241 dead "pontoonfive-12") + (241 dead "pontoonfive-13") + (241 dead "pontoonfive-14") + (241 dead "pontoonfive-15") + (241 dead "pontoonfive-16") + (241 dead "pontoonfive-17") + (241 dead "pontoonfive-18") + (241 dead "pontoonfive-19") + (241 dead "pontoonfive-20") + (241 dead "allpontoons-1") + (241 dead "med-res-level-12") + (241 dead "med-res-level-13") + (241 dead "med-res-level-15") + (241 dead "swamp-blimp-3") + (241 dead "barrel-85") + (241 dead "barrel-86") + (241 dead "money-2844") + (241 dead "money-2845") + (241 dead "money-2846") + (241 dead "money-2847") + (241 dead "money-2848") + (241 dead "money-2849") + (241 dead "money-4923") + (241 dead "money-4924") + (241 dead "money-4925") + (241 dead "money-4926") + (241 dead "money-4927") + (241 dead "eco-27") + (241 dead "sharkey-25") + (241 dead "barrel-117") + (241 dead "barrel-118") + (241 dead "barrel-119") + (241 dead "barrel-120") + (241 dead "barrel-121") + (241 dead "barrel-122") + (241 dead "crate-3129") + (241 dead "crate-3132") + (241 dead "crate-3133") + (241 dead "villageb-part-32") + (241 dead "villageb-part-30") + (321 joint "cameraB") + (352 joint "camera") + (383 joint "cameraB") + (411 joint "camera") + (501 joint "cameraB") + (501 send-event target draw #t) + (567 joint "camera") + (634 alive "fireboulder-6") + (635 joint "cameraB") + (701 joint "camera") + (741 joint "cameraB") + (784 joint "camera") + (936 joint "cameraB") + (1065 joint "camera") + (1145 joint "cameraB") + (1241 joint "camera") + ) + ) + ) + (((game-task sunken-room)) + (when arg0 + (let* ((s5-2 (-> obj tasks)) + (s4-0 (method-of-object s5-2 save-reminder)) + ) + (s4-0 s5-2 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) + ) + (close-status! (-> obj tasks) (task-status need-introduction)) + (set! (-> obj jaws) + (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *jaws-sg* #f :to obj)) + ) + (let ((v1-42 (handle->process (-> obj jaws)))) + (if v1-42 + (set! (-> (the-as manipy v1-42) draw light-index) (the-as uint 1)) + ) + ) + (send-event (handle->process (-> obj jaws)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj jaws)) 'center-joint 3) + (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) + ) + (new 'static 'spool-anim + :name "assistant-village2-introduction-room" + :index 21 + :parts 10 + :command-list '((197 joint "cameraB") + (351 joint "camera") + (431 joint "cameraB") + (553 joint "camera") + (631 joint "cameraB") + (842 joint "camera") + (900 joint "cameraB") + (1069 joint "camera") + ) + ) + ) + (((game-task rolling-robbers)) + (when arg0 + (let* ((s5-5 (-> obj tasks)) + (s4-1 (method-of-object s5-5 save-reminder)) + ) + (s4-1 s5-5 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) + ) + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "assistant-village2-introduction-robbers" + :index 17 + :parts 6 + :command-list '((55 joint "cameraB") (145 joint "camera") (207 joint "cameraB") (363 joint "camera")) + ) + ) + (else + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) ) - (case (current-task (-> obj tasks)) - (((game-task village2-levitator)) - (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (send-event (-> obj sage extra process) 'clone (process->handle obj)) - (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) - ) - (new 'static 'spool-anim - :name "assistant-village2-introduction" - :index 15 - :parts 16 - :command-list - '((0 send-event target draw #f) - (0 kill "villageb-part-33") - (95 send-event target draw #t) - (95 joint "cameraB") - (131 send-event target draw #f) - (131 joint "camera") - (190 setting-reset ocean-off #t) - (190 kill "pontoonten-20") - (190 kill "pontoonten-19") - (190 kill "pontoonten-18") - (190 kill "pontoonten-17") - (190 kill "pontoonten-16") - (190 kill "pontoonten-15") - (190 kill "pontoonten-14") - (190 kill "pontoonten-13") - (190 kill "pontoonten-12") - (190 kill "pontoonten-11") - (190 kill "pontoonten-10") - (190 kill "pontoonten-9") - (190 kill "pontoonten-8") - (190 kill "pontoonten-7") - (190 kill "pontoonten-6") - (190 kill "pontoonfive-3") - (190 kill "pontoonfive-4") - (190 kill "pontoonfive-5") - (190 kill "pontoonfive-6") - (190 kill "pontoonfive-7") - (190 kill "pontoonfive-8") - (190 kill "pontoonfive-12") - (190 kill "pontoonfive-13") - (190 kill "pontoonfive-14") - (190 kill "pontoonfive-15") - (190 kill "pontoonfive-16") - (190 kill "pontoonfive-17") - (190 kill "pontoonfive-18") - (190 kill "pontoonfive-19") - (190 kill "pontoonfive-20") - (190 kill "allpontoons-1") - (190 kill "med-res-level-12") - (190 kill "med-res-level-13") - (190 kill "med-res-level-15") - (190 kill "swamp-blimp-3") - (190 kill "barrel-85") - (190 kill "barrel-86") - (190 kill "money-2844") - (190 kill "money-2845") - (190 kill "money-2846") - (190 kill "money-2847") - (190 kill "money-2848") - (190 kill "money-2849") - (190 kill "money-4923") - (190 kill "money-4924") - (190 kill "money-4925") - (190 kill "money-4926") - (190 kill "money-4927") - (190 kill "eco-27") - (190 kill "sharkey-25") - (190 kill "barrel-117") - (190 kill "barrel-118") - (190 kill "barrel-119") - (190 kill "barrel-120") - (190 kill "barrel-121") - (190 kill "barrel-122") - (190 kill "crate-3129") - (190 kill "crate-3132") - (190 kill "crate-3133") - (190 kill "villageb-part-32") - (190 kill "villageb-part-30") - (190 kill "exit-chamber-dummy-1") - (190 kill "villageb-part-34") - (191 send-event target draw #t) - (191 joint "cameraB") - (241 joint "camera") - (241 send-event target draw #f) - (241 setting-unset ocean-off) - (241 dead "pontoonten-20") - (241 dead "pontoonten-19") - (241 dead "pontoonten-18") - (241 dead "pontoonten-17") - (241 dead "pontoonten-16") - (241 dead "pontoonten-15") - (241 dead "pontoonten-14") - (241 dead "pontoonten-13") - (241 dead "pontoonten-12") - (241 dead "pontoonten-11") - (241 dead "pontoonten-10") - (241 dead "pontoonten-9") - (241 dead "pontoonten-8") - (241 dead "pontoonten-7") - (241 dead "pontoonten-6") - (241 dead "pontoonfive-3") - (241 dead "pontoonfive-4") - (241 dead "pontoonfive-5") - (241 dead "pontoonfive-6") - (241 dead "pontoonfive-7") - (241 dead "pontoonfive-8") - (241 dead "pontoonfive-12") - (241 dead "pontoonfive-13") - (241 dead "pontoonfive-14") - (241 dead "pontoonfive-15") - (241 dead "pontoonfive-16") - (241 dead "pontoonfive-17") - (241 dead "pontoonfive-18") - (241 dead "pontoonfive-19") - (241 dead "pontoonfive-20") - (241 dead "allpontoons-1") - (241 dead "med-res-level-12") - (241 dead "med-res-level-13") - (241 dead "med-res-level-15") - (241 dead "swamp-blimp-3") - (241 dead "barrel-85") - (241 dead "barrel-86") - (241 dead "money-2844") - (241 dead "money-2845") - (241 dead "money-2846") - (241 dead "money-2847") - (241 dead "money-2848") - (241 dead "money-2849") - (241 dead "money-4923") - (241 dead "money-4924") - (241 dead "money-4925") - (241 dead "money-4926") - (241 dead "money-4927") - (241 dead "eco-27") - (241 dead "sharkey-25") - (241 dead "barrel-117") - (241 dead "barrel-118") - (241 dead "barrel-119") - (241 dead "barrel-120") - (241 dead "barrel-121") - (241 dead "barrel-122") - (241 dead "crate-3129") - (241 dead "crate-3132") - (241 dead "crate-3133") - (241 dead "villageb-part-32") - (241 dead "villageb-part-30") - (321 joint "cameraB") - (352 joint "camera") - (383 joint "cameraB") - (411 joint "camera") - (501 joint "cameraB") - (501 send-event target draw #t) - (567 joint "camera") - (634 alive "fireboulder-6") - (635 joint "cameraB") - (701 joint "camera") - (741 joint "cameraB") - (784 joint "camera") - (936 joint "cameraB") - (1065 joint "camera") - (1145 joint "cameraB") - (1241 joint "camera") - ) - ) - ) - (((game-task sunken-room)) - (when arg0 - (let* ((s5-2 (-> obj tasks)) - (s4-0 (method-of-object s5-2 save-reminder)) - (a1-7 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-7 from) pp) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'query) - (set! (-> a1-7 param 0) (the-as uint 'pickup)) - (set! (-> a1-7 param 1) (the-as uint 6)) - (s4-0 s5-2 (the int (the-as float (send-event-function *target* a1-7))) 1) - ) - (close-status! (-> obj tasks) (task-status need-introduction)) - (let ((s5-3 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj jaws) - (ppointer->handle - (when s5-3 - (let ((t9-10 (method-of-type manipy activate))) - (t9-10 (the-as manipy s5-3) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-3 manipy-init (-> obj root-override trans) (-> obj entity) *jaws-sg* #f) - (-> s5-3 ppointer) - ) - ) - ) - ) - (let ((v1-42 (handle->process (-> obj jaws)))) - (if v1-42 - (set! (-> (the-as manipy v1-42) draw light-index) (the-as uint 1)) - ) - ) - (send-event (handle->process (-> obj jaws)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj jaws)) 'center-joint 3) - (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) - ) - (new 'static 'spool-anim - :name "assistant-village2-introduction-room" - :index 21 - :parts 10 - :command-list - '((197 joint "cameraB") - (351 joint "camera") - (431 joint "cameraB") - (553 joint "camera") - (631 joint "cameraB") - (842 joint "camera") - (900 joint "cameraB") - (1069 joint "camera") - ) - ) - ) - (((game-task rolling-robbers)) - (when arg0 - (let* ((s5-5 (-> obj tasks)) - (s4-1 (method-of-object s5-5 save-reminder)) - (a1-17 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-17 from) pp) - (set! (-> a1-17 num-params) 2) - (set! (-> a1-17 message) 'query) - (set! (-> a1-17 param 0) (the-as uint 'pickup)) - (set! (-> a1-17 param 1) (the-as uint 6)) - (s4-1 s5-5 (the int (the-as float (send-event-function *target* a1-17))) 1) - ) - (close-status! (-> obj tasks) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name - "assistant-village2-introduction-robbers" - :index 17 - :parts 6 - :command-list - '((55 joint "cameraB") (145 joint "camera") (207 joint "cameraB") (363 joint "camera")) - ) - ) - (else - (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) - ) - (new 'static 'spool-anim - :name - "assistant-village2-introduction-flutflut" - :index 19 - :parts 8 - :command-list - '((71 joint "cameraB") (308 joint "camera") (426 joint "cameraB") (550 joint "camera") (644 joint "cameraB")) - ) + (new 'static 'spool-anim + :name "assistant-village2-introduction-flutflut" + :index 19 + :parts 8 + :command-list '((71 joint "cameraB") (308 joint "camera") (426 joint "cameraB") (550 joint "camera") (644 joint "cameraB")) ) ) ) - (((task-status need-reminder)) - (set! (-> obj skippable) #t) - (let ((s4-2 (+ (get-reminder (-> obj tasks) 0) 1))) - (if (< (the-as uint 2) (the-as uint s4-2)) - (set! s4-2 0) - ) - (countdown (s3-0 3) - (let ((v1-92 s4-2)) - (cond - ((zero? v1-92) - (if (!= (get-task-status (game-task sunken-room)) (task-status need-reminder)) - (set! s4-2 1) - ) - ) - ((= v1-92 1) - (if (!= (get-task-status (game-task rolling-robbers)) (task-status need-reminder)) - (set! s4-2 2) - ) - ) - (else - (if (!= (get-task-status (game-task swamp-flutflut)) (task-status need-reminder)) - (set! s4-2 0) - ) - ) + ) + (((task-status need-reminder)) + (set! (-> obj skippable) #t) + (let ((s4-2 (+ (get-reminder (-> obj tasks) 0) 1))) + (if (< (the-as uint 2) (the-as uint s4-2)) + (set! s4-2 0) + ) + (countdown (s3-0 3) + (let ((v1-92 s4-2)) + (cond + ((zero? v1-92) + (if (!= (get-task-status (game-task sunken-room)) (task-status need-reminder)) + (set! s4-2 1) + ) + ) + ((= v1-92 1) + (if (!= (get-task-status (game-task rolling-robbers)) (task-status need-reminder)) + (set! s4-2 2) + ) + ) + (else + (if (!= (get-task-status (game-task swamp-flutflut)) (task-status need-reminder)) + (set! s4-2 0) + ) ) ) ) - (if arg0 - (save-reminder (-> obj tasks) s4-2 2) - ) - (cond - ((zero? s4-2) - (new 'static 'spool-anim :name "assistant-village2-reminder-1-room" :index 22 :parts 3 :command-list '()) - ) - ((= s4-2 1) - (new 'static 'spool-anim :name "assistant-village2-reminder-1-robbers" :index 18 :parts 3 :command-list '()) - ) - (else - (new 'static 'spool-anim :name "assistant-village2-reminder-1-flutflut" :index 20 :parts 3 :command-list '()) - ) + ) + (if arg0 + (save-reminder (-> obj tasks) s4-2 2) + ) + (cond + ((zero? s4-2) + (new 'static 'spool-anim :name "assistant-village2-reminder-1-room" :index 22 :parts 3 :command-list '()) + ) + ((= s4-2 1) + (new 'static 'spool-anim :name "assistant-village2-reminder-1-robbers" :index 18 :parts 3 :command-list '()) + ) + (else + (new 'static 'spool-anim :name "assistant-village2-reminder-1-flutflut" :index 20 :parts 3 :command-list '()) ) ) ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) ) - (-> obj draw art-group data 5) - ) + ) + (-> obj draw art-group data 5) ) ) ) @@ -514,10 +484,7 @@ ;; definition for method 43 of type assistant-bluehut (defmethod TODO-RENAME-43 assistant-bluehut ((obj assistant-bluehut)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f30-0 (+ -1.0 (the-as float v1-4))) - ) + (let ((f30-0 (rand-float-gen))) (cond ((= (get-task-status (game-task village2-levitator)) (task-status invalid)) #f @@ -536,8 +503,7 @@ ;; failed to figure out what this is: (defstate idle (assistant-bluehut) :virtual #t - :trans - (behavior () + :trans (behavior () (case (get-task-status (game-task village2-levitator)) (((task-status need-hint) (task-status need-introduction)) (send-event self 'play-anim) @@ -546,262 +512,80 @@ ((-> (method-of-type process-taskable idle) trans)) (none) ) - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) - ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) - (set! (-> gp-0 param 0) (the float (+ (-> (the-as art-joint-anim (get-art-elem self)) data 0 length) -1))) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (get-art-elem self)) num-func-seek!) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) ) + (loop + (ja-no-eval :group! (get-art-elem self) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-11 (-> self skel root-channel 0))) - (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) - (set! (-> a0-11 param 1) 1.0) - (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (let* ((v1-24 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-25 (the-as number (logior #x3f800000 v1-24))) - (f0-9 (+ -1.0 (the-as float v1-25))) - ) + (let ((f0-9 (rand-float-gen))) (cond ((< f0-9 0.33333334) (TODO-RENAME-43 self) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) - (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1)) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!) - ) + (ja-no-eval :group! assistant-village2-idle-hut-look-right-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-1 (-> *display* base-frame-counter))) - (while (let* ((s5-1 (-> *display* base-frame-counter)) - (f30-0 300.0) - (f28-0 0.16) - (f26-0 0.17000002) - (v1-55 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-56 (the-as number (logior #x3f800000 v1-55))) - ) - (< (- s5-1 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-56)))))))) gp-1) + (while (let ((s5-1 (-> *display* base-frame-counter)) + (f30-0 300.0) + (f28-0 0.16) + (f26-0 0.17000002) + ) + (< (- s5-1 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (rand-float-gen))))))) gp-1) ) (suspend) ) ) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-21 param 0) 0.0) - (set! (-> a0-21 param 1) 1.0) - (set! (-> a0-21 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-21 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) 0.0) - (set! (-> a0-22 param 1) 1.0) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) ) ((< f0-9 0.6666667) - (sound-play-by-name - (static-sound-name "welding-loop") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (target-pos 0)) - ) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) - (set! (-> a0-27 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1)) - ) - (set! (-> a0-27 param 1) 1.0) - (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!) - ) + (sound-play "welding-loop" :id (-> self sound-id) :position (the-as symbol (target-pos 0))) + (ja-no-eval :group! assistant-village2-idle-hut-start-welding-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((v1-111 (-> self skel root-channel 0))) - (set! (-> v1-111 frame-group) (the-as art-joint-anim (-> self draw art-group data 13))) + (ja :num! (seek!)) ) + (ja :group! assistant-village2-idle-hut-welding-ja) (let* ((f30-1 2.0) (v1-113 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-114 (the-as number (logior #x3f800000 v1-113))) ) (countdown (gp-3 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-114)))) 4)) - (let ((a0-35 (-> self skel root-channel 0))) - (set! (-> a0-35 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-35 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-35 param 1) 1.0) - (set! (-> a0-35 frame-num) 0.0) - (joint-control-channel-group! - a0-35 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30))) (suspend) - (let ((a0-38 (-> self skel root-channel 0))) - (set! (-> a0-38 param 0) (the float (+ (-> a0-38 frame-group data 0 length) -1))) - (set! (-> a0-38 param 1) 1.0) - (joint-control-channel-group-eval! a0-38 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((a0-40 (-> self skel root-channel 0))) - (set! (-> a0-40 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-40 param 0) 0.0) - (set! (-> a0-40 param 1) 1.0) - (set! (-> a0-40 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-40 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) + (ja :num! (seek!)) ) + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30))) (suspend) - (let ((a0-43 (-> self skel root-channel 0))) - (set! (-> a0-43 param 0) 0.0) - (set! (-> a0-43 param 1) 1.0) - (joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) ) ) - (let ((a0-45 (-> self skel root-channel 0))) - (set! (-> a0-45 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-45 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-45 param 1) 1.0) - (set! (-> a0-45 frame-num) 0.0) - (joint-control-channel-group! - a0-45 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30))) (suspend) - (let ((a0-48 (-> self skel root-channel 0))) - (set! (-> a0-48 param 0) (the float (+ (-> a0-48 frame-group data 0 length) -1))) - (set! (-> a0-48 param 1) 1.0) - (joint-control-channel-group-eval! a0-48 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (sound-stop (-> self sound-id)) - (let ((a0-51 (-> self skel root-channel 0))) - (set! (-> a0-51 frame-group) (the-as art-joint-anim (-> self draw art-group data 14))) - (set! (-> a0-51 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 14)) data 0 length) -1)) - ) - (set! (-> a0-51 param 1) 1.0) - (set! (-> a0-51 frame-num) 0.0) - (joint-control-channel-group! a0-51 (the-as art-joint-anim (-> self draw art-group data 14)) num-func-seek!) - ) + (ja-no-eval :group! assistant-village2-idle-hut-stop-welding-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-52 (-> self skel root-channel 0))) - (set! (-> a0-52 param 0) (the float (+ (-> a0-52 frame-group data 0 length) -1))) - (set! (-> a0-52 param 1) 1.0) - (joint-control-channel-group-eval! a0-52 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -814,8 +598,7 @@ ;; failed to figure out what this is: (defstate play-anim (assistant-bluehut) :virtual #t - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self jaws)))) (if a0-1 (deactivate a0-1) @@ -827,8 +610,7 @@ (close-specific-task! (game-task village2-levitator) (task-status need-reminder-a)) (none) ) - :trans - (behavior () + :trans (behavior () '() (none) ) @@ -854,16 +636,14 @@ (defpartgroup group-assistant-bluehut-torch :id 288 :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 1322 :fade-after (meters 30) :falloff-to (meters 30)) + :parts ((sp-item 1322 :fade-after (meters 30) :falloff-to (meters 30)) (sp-item 1323 :fade-after (meters 60) :falloff-to (meters 80)) ) ) ;; failed to figure out what this is: (defpart 1322 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -880,8 +660,7 @@ ;; failed to figure out what this is: (defpart 1323 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -907,8 +686,7 @@ ;; failed to figure out what this is: (defpart 1324 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 3.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.075) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -930,13 +708,9 @@ (when (< (-> arg2 y) (-> arg1 user-float)) (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (if (< (+ -1.0 (the-as float v1-2)) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) - ) - ) + (if (< (rand-float-gen) 0.25) + (sound-play "water-drop") + ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var *sp-particle-system-2d* @@ -970,8 +744,7 @@ :id 658 :flags (use-local-clock) :bounds (static-bspherem -20 8 0 80) - :parts - ((sp-item 2673 :fade-after (meters 120) :falloff-to (meters 140) :binding 2670) + :parts ((sp-item 2673 :fade-after (meters 120) :falloff-to (meters 140) :binding 2670) (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2671) (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2672) (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2671) @@ -1003,8 +776,7 @@ ;; failed to figure out what this is: (defpart 2694 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.2 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1024,8 +796,7 @@ ;; failed to figure out what this is: (defpart 2693 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1045,8 +816,7 @@ ;; failed to figure out what this is: (defpart 2673 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.025 0.025 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1067,8 +837,7 @@ ;; failed to figure out what this is: (defpart 2670 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1091,8 +860,7 @@ ;; failed to figure out what this is: (defpart 2671 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1112,8 +880,7 @@ ;; failed to figure out what this is: (defpart 2672 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1133,8 +900,7 @@ ;; failed to figure out what this is: (defpart 2674 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-rnd-flt spt-scale-y (meters 0.6) (meters 0.8) 1.0) @@ -1155,8 +921,7 @@ ;; failed to figure out what this is: (defpart 2676 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1177,8 +942,7 @@ ;; failed to figure out what this is: (defpart 2675 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1198,14 +962,12 @@ :id 659 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 34) - :parts - ((sp-item 2695) (sp-item 2696 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 2677)) + :parts ((sp-item 2695) (sp-item 2696 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 2677)) ) ;; failed to figure out what this is: (defpart 2696 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 2.0 6.0 1.0) (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1) 1.0) @@ -1232,8 +994,7 @@ ;; failed to figure out what this is: (defpart 2695 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 4) 1.0) (sp-rnd-flt spt-rot-z (degrees 180.0) (degrees 360.0) 1.0) @@ -1253,8 +1014,7 @@ ;; failed to figure out what this is: (defpart 2677 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 6) (meters 6) 1.0) (sp-rnd-flt spt-rot-z (degrees 180.0) (degrees 360.0) 1.0) @@ -1278,8 +1038,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2751 :fade-after (meters 100) :falloff-to (meters 100) :binding 2750) + :parts ((sp-item 2751 :fade-after (meters 100) :falloff-to (meters 100) :binding 2750) (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2797) (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2798) (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2797) @@ -1322,8 +1081,7 @@ ;; failed to figure out what this is: (defpart 2678 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.001) (meters 0.002) 1.0) (sp-rnd-flt spt-y (meters -0.001) (meters 0.002) 1.0) @@ -1345,8 +1103,7 @@ ;; failed to figure out what this is: (defpart 2751 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1362,8 +1119,7 @@ ;; failed to figure out what this is: (defpart 2750 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -1386,8 +1142,7 @@ ;; failed to figure out what this is: (defpart 2797 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 0.2 0.4 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1407,8 +1162,7 @@ ;; failed to figure out what this is: (defpart 2798 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-rnd-flt spt-num 0.2 0.4 1.0) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -1432,14 +1186,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2679)) + :parts ((sp-item 2679)) ) ;; failed to figure out what this is: (defpart 2679 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.001) (meters 0.002) 1.0) (sp-rnd-flt spt-y (meters -0.001) (meters 0.002) 1.0) @@ -1492,31 +1244,20 @@ (vector-! s4-0 gp-0 s5-0) (let ((t2-0 (new 'stack-no-clear 'collide-tri-result))) 0.0 - (when (>= (fill-and-probe-using-line-sphere - *collide-cache* - s5-0 - s4-0 - 6144.0 - (collide-kind target) - (the-as process #f) - t2-0 - 1 - ) - 0.0 + (if (>= (fill-and-probe-using-line-sphere + *collide-cache* + s5-0 + s4-0 + 6144.0 + (collide-kind target) + (the-as process #f) + t2-0 + (new 'static 'pat-surface :noentity #x1) ) - (let ((a1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-7 from) self) - (set! (-> a1-7 num-params) 2) - (set! (-> a1-7 message) 'shove) - (set! (-> a1-7 param 0) (the-as uint #f)) - (let ((v1-13 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-13 shove-up) 8192.0) - (set! (-> v1-13 shove-back) 12288.0) - (set! (-> a1-7 param 1) (the-as uint v1-13)) - ) - (send-event-function *target* a1-7) + 0.0 + ) + (send-event *target* 'shove #f (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3))))) ) - ) ) (vector-normalize! s4-0 (+ -20480.0 (vector-length s4-0))) (vector+! gp-0 s5-0 s4-0) @@ -1565,8 +1306,7 @@ :name "assistant-village2-resolution" :index 16 :parts 7 - :command-list - '((196 joint "cameraB") + :command-list '((196 joint "cameraB") (241 joint "camera") (286 joint "cameraB") (436 joint "camera") @@ -1603,8 +1343,7 @@ ;; failed to figure out what this is: (defstate play-anim (assistant-levitator) :virtual #t - :exit - (behavior () + :exit (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) (set! (-> a1-0 num-params) 0) @@ -1623,8 +1362,7 @@ ((-> (method-of-type process-taskable play-anim) exit)) (none) ) - :trans - (behavior () + :trans (behavior () (assistant-levitator-blue-glow) (if (< 200.0 (ja-aframe-num 0)) (assistant-levitator-blue-beam) @@ -1637,8 +1375,7 @@ ;; failed to figure out what this is: (defstate hidden (assistant-levitator) :virtual #t - :trans - (behavior () + :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) (when (and (cond ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) @@ -1707,172 +1444,67 @@ ;; failed to figure out what this is: (defstate idle (assistant-levitator) :virtual #t - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) ((-> (method-of-type process-taskable idle) exit)) (none) ) - :trans - (behavior () + :trans (behavior () (assistant-levitator-blue-glow) (update! (-> self sound)) ((-> (method-of-type process-taskable idle) trans)) (none) ) - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) ) - (while #t + (loop (cond ((= (get-task-status (game-task village2-levitator)) (task-status invalid)) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!) - ) + (ja-no-eval :group! assistant-village2-idle-after-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (assistant-levitator-blue-beam) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else - (let ((v1-29 (-> self skel root-channel 0))) - (set! (-> v1-29 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) + (ja :group! assistant-village2-idle-a-ja) (let* ((f30-0 2.0) (v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-32 (the-as number (logior #x3f800000 v1-31))) ) (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-32)))) 3)) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-16 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! - a0-16 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1))) - (set! (-> a0-17 param 1) 1.0) - (joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-19 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-no-eval :group! assistant-village2-idle-to-b-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((v1-89 (-> self skel root-channel 0))) - (set! (-> v1-89 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) + (ja :num! (seek!)) ) + (ja :group! assistant-village2-idle-b-ja) (let* ((f30-1 2.0) (v1-91 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-92 (the-as number (logior #x3f800000 v1-91))) ) (countdown (gp-1 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-92)))) 3)) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-27 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-27 param 1) 1.0) - (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! - a0-27 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - (set! (-> a0-30 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1)) - ) - (set! (-> a0-30 param 1) 1.0) - (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) - ) + (ja-no-eval :group! assistant-village2-idle-to-a-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 param 0) (the float (+ (-> a0-31 frame-group data 0 length) -1))) - (set! (-> a0-31 param 1) 1.0) - (joint-control-channel-group-eval! a0-31 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) @@ -1890,10 +1522,9 @@ ;; failed to figure out what this is: (defstate just-particles (assistant-levitator) - :code - (behavior () + :code (behavior () (ja-channel-set! 0) - (while #t + (loop (assistant-levitator-blue-glow) (assistant-levitator-blue-beam) (update! (-> self sound)) @@ -1912,19 +1543,8 @@ (set! (-> obj particle 1) (create-launch-control (-> *part-group-id-table* 659) obj)) (set! (-> obj particle 2) (create-launch-control (-> *part-group-id-table* 660) obj)) (set! (-> obj particle 3) (create-launch-control (-> *part-group-id-table* 661) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "lev-mach-idle") - :volume #x400 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "lev-mach-idle" :fo-max 30) (-> obj root-override trans)) ) (if (= (get-task-status (game-task village2-levitator)) (task-status invalid)) (go just-particles) diff --git a/test/decompiler/reference/levels/village2/flutflut-bluehut_REF.gc b/test/decompiler/reference/levels/village2/flutflut-bluehut_REF.gc index 4983e0697d..5d90893691 100644 --- a/test/decompiler/reference/levels/village2/flutflut-bluehut_REF.gc +++ b/test/decompiler/reference/levels/village2/flutflut-bluehut_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/flutflut-bluehut-ag.gc") + ;; definition of type flutflut-bluehut (deftype flutflut-bluehut (process-taskable) () @@ -19,13 +21,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *flutflut-bluehut-sg* flutflut-bluehut - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 3.25) - :longest-edge (meters 0) - ) +(defskelgroup *flutflut-bluehut-sg* flutflut-bluehut flutflut-bluehut-lod0-jg flutflut-bluehut-idle-breathe-ja + ((flutflut-bluehut-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.25) + ) ;; definition for method 32 of type flutflut-bluehut ;; INFO: Return type mismatch art-element vs basic. @@ -57,102 +56,36 @@ ;; failed to figure out what this is: (defstate idle (flutflut-bluehut) :virtual #t - :trans - (behavior () + :trans (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) (none) ) - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) - ) - (while #t - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) ) + (loop + (ja :group! flutflut-bluehut-idle-breathe-ja) (let* ((f30-0 2.0) (v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-9 (the-as number (logior #x3f800000 v1-8))) ) (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-9)))) 1)) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-12 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-12 param 1) 1.0) - (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! - a0-12 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-13 (-> self skel root-channel 0))) - (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) - (set! (-> a0-13 param 1) 1.0) - (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((s5-0 (-> *display* base-frame-counter))) (while (< (+ (-> *display* base-frame-counter) (seconds -0.5)) s5-0) (suspend) ) ) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-15 param 0) 0.0) - (set! (-> a0-15 param 1) 1.0) - (set! (-> a0-15 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (joint-control-channel-group! - a0-15 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 param 0) 0.0) - (set! (-> a0-16 param 1) 1.0) - (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) (let ((s5-1 (-> *display* base-frame-counter))) (while (< (+ (-> *display* base-frame-counter) (seconds -0.5)) s5-1) @@ -161,83 +94,28 @@ ) ) ) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! flutflut-bluehut-idle-start-scratch-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) - ) - (let ((v1-100 (-> self skel root-channel 0))) - (set! (-> v1-100 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) + (ja :num! (seek!)) ) + (ja :group! flutflut-bluehut-idle-scratch-ja) (let* ((f30-1 2.0) (v1-102 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-103 (the-as number (logior #x3f800000 v1-102))) ) (countdown (gp-1 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-103)))) 6)) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-26 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-26 param 1) 1.0) - (set! (-> a0-26 frame-num) 0.0) - (joint-control-channel-group! - a0-26 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1))) - (set! (-> a0-27 param 1) 1.0) - (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (let ((a0-29 (-> self skel root-channel 0))) - (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-29 param 0) 0.0) - (set! (-> a0-29 param 1) 1.0) - (set! (-> a0-29 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! flutflut-bluehut-idle-start-scratch-ja :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) - (let ((a0-30 (-> self skel root-channel 0))) - (set! (-> a0-30 param 0) 0.0) - (set! (-> a0-30 param 1) 1.0) - (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! 0.0)) ) ) (none) diff --git a/test/decompiler/reference/levels/village2/gambler_REF.gc b/test/decompiler/reference/levels/village2/gambler_REF.gc index 0e8a8d19a0..e4824116f7 100644 --- a/test/decompiler/reference/levels/village2/gambler_REF.gc +++ b/test/decompiler/reference/levels/village2/gambler_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/gambler-ag.gc") + ;; definition of type gambler (deftype gambler (process-taskable) () @@ -19,14 +21,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *gambler-sg* gambler - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *gambler-sg* gambler gambler-lod0-jg gambler-idle-tiptoe-ja + ((gambler-lod0-mg (meters 20)) (gambler-lod1-mg (meters 40)) (gambler-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow gambler-shadow-mg + ) ;; definition for method 32 of type gambler (defmethod play-anim! gambler ((obj gambler) (arg0 symbol)) @@ -41,8 +40,7 @@ :name "gambler-introduction-1" :index 11 :parts 9 - :command-list - '((0 want-levels village2 rolling) + :command-list '((0 want-levels village2 rolling) (0 display-level rolling #f) (29 joint "cameraB") (103 joint "camera") @@ -134,10 +132,7 @@ ;; definition for method 43 of type gambler (defmethod TODO-RENAME-43 gambler ((obj gambler)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 61440.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.9230769 f0-2) (play-ambient (-> obj ambient) "GAM-AM01" #f (-> obj root-override trans)) @@ -188,88 +183,37 @@ ;; failed to figure out what this is: (defstate idle (gambler) :virtual #t - :code - (behavior () - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - (ja-channel-push! 1 60) - (let ((v1-6 (-> self skel root-channel 0))) - (set! (-> v1-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) + :code (behavior () + (when (!= (ja-group) gambler-idle-fidget-ja) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! gambler-idle-fidget-ja) ) - (while #t - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-9 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! - a0-9 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (TODO-RENAME-43 self) - (let* ((v1-38 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-39 (the-as number (logior #x3f800000 v1-38))) - (f0-9 (+ -1.0 (the-as float v1-39))) - ) + (let ((f0-9 (rand-float-gen))) (cond ((< f0-9 0.16666667) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - ) + (ja :group! gambler-idle-tiptoe-ja) ) ((< f0-9 0.33333334) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - ) + (ja :group! gambler-idle-look-1-ja) ) ((< f0-9 0.5) - (let ((a0-17 (-> self skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - ) + (ja :group! gambler-idle-fidget-ja) ) ((< f0-9 0.6666667) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) - ) + (ja :group! gambler-idle-scratch-1-ja) ) ((< f0-9 0.8333333) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) - ) + (ja :group! gambler-idle-look-2-ja) ) (else - (let ((a0-20 (-> self skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) - ) + (ja :group! gambler-idle-scratch-2-ja) ) ) ) diff --git a/test/decompiler/reference/levels/village2/geologist_REF.gc b/test/decompiler/reference/levels/village2/geologist_REF.gc index 55c4d58004..914a44a867 100644 --- a/test/decompiler/reference/levels/village2/geologist_REF.gc +++ b/test/decompiler/reference/levels/village2/geologist_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/geologist-ag.gc") + ;; definition of type geologist (deftype geologist (process-taskable) () @@ -19,14 +21,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *geologist-sg* geologist - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *geologist-sg* geologist geologist-lod0-jg geologist-idle-ja + ((geologist-lod0-mg (meters 20)) (geologist-lod1-mg (meters 40)) (geologist-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow geologist-shadow-mg + ) ;; definition for method 32 of type geologist (defmethod play-anim! geologist ((obj geologist) (arg0 symbol)) @@ -41,8 +40,7 @@ :name "geologist-introduction" :index 6 :parts 13 - :command-list - '((0 want-levels village2 rolling) + :command-list '((0 want-levels village2 rolling) (199 joint "cameraB") (325 joint "camera") (520 alive "racer-2") @@ -126,10 +124,7 @@ ;; definition for method 43 of type geologist (defmethod TODO-RENAME-43 geologist ((obj geologist)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.8888889 f0-2) (play-ambient (-> obj ambient) "GEO-AM01" #f (-> obj root-override trans)) diff --git a/test/decompiler/reference/levels/village2/sage-bluehut_REF.gc b/test/decompiler/reference/levels/village2/sage-bluehut_REF.gc index c0c3af5bf4..ad970867aa 100644 --- a/test/decompiler/reference/levels/village2/sage-bluehut_REF.gc +++ b/test/decompiler/reference/levels/village2/sage-bluehut_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/sage-bluehut-ag.gc") + ;; definition of type assistant-bluehut (deftype assistant-bluehut (process-taskable) ((sound-id sound-id :offset-assert 380) @@ -48,113 +50,98 @@ ) ;; failed to figure out what this is: -(defskelgroup *sage-bluehut-sg* sage-bluehut - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *sage-bluehut-sg* sage-bluehut sage-bluehut-lod0-jg sage-bluehut-idle-ja + ((sage-bluehut-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow sage-bluehut-shadow-mg + ) ;; definition for method 32 of type sage-bluehut (defmethod play-anim! sage-bluehut ((obj sage-bluehut) (arg0 symbol)) - (with-pp - (set! (-> obj talk-message) (game-text-id press-to-talk-to-sage)) - (case (current-status (-> obj tasks)) - (((task-status need-hint) (task-status need-introduction)) - (if (not arg0) - (set! (-> obj will-talk) #t) - ) - (case (current-task (-> obj tasks)) - (((game-task rolling-plants)) - (when arg0 - (let* ((s5-1 (-> obj tasks)) - (s4-0 (method-of-object s5-1 save-reminder)) - (a1-3 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (s4-0 s5-1 (the int (the-as float (send-event-function *target* a1-3))) 1) - ) - (close-status! (-> obj tasks) (task-status need-introduction)) - (let ((s5-2 (-> obj assistant extra process))) - (if (and s5-2 (should-display? (the-as assistant-bluehut s5-2))) - (send-event s5-2 'clone (process->handle obj)) - ) - ) - (set! (-> obj draw bounds w) 40960.0) - ) - (new 'static 'spool-anim - :name - "sage-bluehut-introduction-crop-dusting" - :index 8 - :parts 12 - :command-list - '((678 joint "cameraB") (1166 joint "camera") (1258 joint "cameraB")) - ) - ) - (else - (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (close-specific-task! (game-task swamp-tether-1) (task-status need-introduction)) - (close-specific-task! (game-task swamp-tether-2) (task-status need-introduction)) - (close-specific-task! (game-task swamp-tether-3) (task-status need-introduction)) - (close-specific-task! (game-task swamp-tether-4) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name "sage-bluehut-introduction-prec-arm" - :index 6 - :parts 8 - :command-list - '((141 joint "cameraB") - (214 joint "camera") - (308 joint "cameraB") - (686 joint "camera") - (786 joint "cameraB") - (843 joint "camera") - ) - ) - ) + (set! (-> obj talk-message) (game-text-id press-to-talk-to-sage)) + (case (current-status (-> obj tasks)) + (((task-status need-hint) (task-status need-introduction)) + (if (not arg0) + (set! (-> obj will-talk) #t) ) - ) - (((task-status need-reminder)) - (set! (-> obj skippable) #t) - (if arg0 - (set! (-> obj reminder-played) #t) - ) - (cond - ((zero? (get-reminder (-> obj tasks) 0)) - (new 'static 'spool-anim :name "sage-bluehut-reminder-1-crop-dusting" :index 9 :parts 3 :command-list '()) - ) - (else - (if arg0 - (set! (-> obj draw bounds w) 40960.0) - ) - (new 'static 'spool-anim - :name "sage-bluehut-reminder-1-prec-arm" - :index 7 - :parts 4 - :command-list - '((90 joint "cameraB") (259 joint "camera") (352 joint "cameraB")) - ) - ) - ) - ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) + (case (current-task (-> obj tasks)) + (((game-task rolling-plants)) + (when arg0 + (let* ((s5-1 (-> obj tasks)) + (s4-0 (method-of-object s5-1 save-reminder)) + ) + (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (get-art-elem obj) + (close-status! (-> obj tasks) (task-status need-introduction)) + (let ((s5-2 (-> obj assistant extra process))) + (if (and s5-2 (should-display? (the-as assistant-bluehut s5-2))) + (send-event s5-2 'clone (process->handle obj)) + ) + ) + (set! (-> obj draw bounds w) 40960.0) + ) + (new 'static 'spool-anim + :name "sage-bluehut-introduction-crop-dusting" + :index 8 + :parts 12 + :command-list '((678 joint "cameraB") (1166 joint "camera") (1258 joint "cameraB")) + ) ) + (else + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (close-specific-task! (game-task swamp-tether-1) (task-status need-introduction)) + (close-specific-task! (game-task swamp-tether-2) (task-status need-introduction)) + (close-specific-task! (game-task swamp-tether-3) (task-status need-introduction)) + (close-specific-task! (game-task swamp-tether-4) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "sage-bluehut-introduction-prec-arm" + :index 6 + :parts 8 + :command-list '((141 joint "cameraB") + (214 joint "camera") + (308 joint "cameraB") + (686 joint "camera") + (786 joint "cameraB") + (843 joint "camera") + ) + ) + ) + ) + ) + (((task-status need-reminder)) + (set! (-> obj skippable) #t) + (if arg0 + (set! (-> obj reminder-played) #t) + ) + (cond + ((zero? (get-reminder (-> obj tasks) 0)) + (new 'static 'spool-anim :name "sage-bluehut-reminder-1-crop-dusting" :index 9 :parts 3 :command-list '()) + ) + (else + (if arg0 + (set! (-> obj draw bounds w) 40960.0) + ) + (new 'static 'spool-anim + :name "sage-bluehut-reminder-1-prec-arm" + :index 7 + :parts 4 + :command-list '((90 joint "cameraB") (259 joint "camera") (352 joint "cameraB")) + ) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) + ) + ) + (get-art-elem obj) ) ) ) @@ -233,8 +220,7 @@ ;; failed to figure out what this is: (defstate play-anim (sage-bluehut) :virtual #t - :exit - (behavior () + :exit (behavior () (send-event (-> self assistant extra process) 'end-mode) (set! (-> self draw bounds w) 10240.0) ((-> (method-of-type process-taskable play-anim) exit)) @@ -275,10 +261,7 @@ ;; definition for method 43 of type sage-bluehut (defmethod TODO-RENAME-43 sage-bluehut ((obj sage-bluehut)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.8 f0-2) (play-ambient (-> obj ambient) "SAGELP20" #f (-> obj root-override trans)) @@ -303,18 +286,13 @@ ;; failed to figure out what this is: (defstate idle (sage-bluehut) :virtual #t - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((gp-0 (get-art-elem self))) (cond - ((= gp-0 (-> self draw art-group data 4)) - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - gp-0 - ) - (ja-channel-push! 1 60) + ((= gp-0 sage-bluehut-idle-stand-ja) + (if (!= (ja-group) gp-0) + (ja-channel-push! 1 (seconds 0.2)) ) (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) (let* ((f30-0 3.0) @@ -323,113 +301,39 @@ ) (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-16)))) 5)) (TODO-RENAME-43 self) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-5 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-5 param 1) 1.0) - (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! - a0-5 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (dummy-45 self) (go-virtual idle) ) (suspend) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1))) - (set! (-> a0-7 param 1) 1.0) - (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) - (ja-channel-push! 1 60) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! sage-bluehut-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (dummy-45 self) (go-virtual idle) ) (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else (TODO-RENAME-43 self) - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - gp-0 - ) - (ja-channel-push! 1 60) + (if (!= (ja-group) gp-0) + (ja-channel-push! 1 (seconds 0.2)) ) (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) - (let ((a0-16 (-> self skel root-channel 0))) - (set! (-> a0-16 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-16 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-16 param 1) 1.0) - (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! - a0-16 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (dummy-45 self) (go-virtual idle) ) (suspend) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) - (set! (-> a0-18 param 1) 1.0) - (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) diff --git a/test/decompiler/reference/levels/village2/sunken-elevator_REF.gc b/test/decompiler/reference/levels/village2/sunken-elevator_REF.gc index ec52be9158..9767c560ed 100644 --- a/test/decompiler/reference/levels/village2/sunken-elevator_REF.gc +++ b/test/decompiler/reference/levels/village2/sunken-elevator_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/sunken-elevator-ag.gc") + ;; definition of type sunken-elevator (deftype sunken-elevator (plat-button) ((play-at-top-going-up-camera? symbol :offset-assert 240) @@ -25,13 +27,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *sunken-elevator-sg* sunken-elevator - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -1 0 6.6) - :longest-edge (meters 0) - ) +(defskelgroup *sunken-elevator-sg* sunken-elevator sunken-elevator-lod0-jg sunken-elevator-pressed-ja + ((sunken-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -1 0 6.6) + ) ;; definition for method 30 of type sunken-elevator (defmethod should-teleport? sunken-elevator ((obj sunken-elevator)) @@ -55,8 +54,7 @@ ;; failed to figure out what this is: (defstate plat-button-pressed (sunken-elevator) :virtual #t - :enter - (behavior () + :enter (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-pressed) enter))) (if t9-0 (t9-0) @@ -93,25 +91,19 @@ 0 ) ((1.0) - (let* ((gp-1 (get-process *default-dead-pool* village2cam #x4000)) - (v1-10 (when gp-1 - (let ((t9-6 (method-of-type village2cam activate))) - (t9-6 (the-as village2cam gp-1) self 'village2cam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (-> self spawn-pos) - *village2cam-sg* - "elevator-at-top-going-down" - 0 - #f - '() - ) - (-> gp-1 ppointer) - ) - ) - ) + (let ((v1-10 (process-spawn + village2cam + :init pov-camera-init-by-other + (-> self spawn-pos) + *village2cam-sg* + "elevator-at-top-going-down" + 0 + #f + '() + :to self + ) + ) + ) (set! (-> (the-as village2cam (-> v1-10 0)) seq) (the-as uint 1)) ) ) @@ -123,8 +115,7 @@ ;; failed to figure out what this is: (defstate plat-button-move-upward (sunken-elevator) :virtual #t - :enter - (behavior () + :enter (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) enter))) (if t9-0 (t9-0) @@ -133,8 +124,7 @@ (set! (-> self play-at-top-going-up-camera?) #t) (none) ) - :trans - (behavior () + :trans (behavior () (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) trans))) (if t9-0 (t9-0) @@ -144,25 +134,19 @@ (set! *teleport* #t) (set! (-> self play-at-top-going-up-camera?) #f) (load-state-want-display-level 'sunken 'special) - (let* ((gp-0 (get-process *default-dead-pool* village2cam #x4000)) - (v1-8 (when gp-0 - (let ((t9-3 (method-of-type village2cam activate))) - (t9-3 (the-as village2cam gp-0) self 'village2cam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> self spawn-pos) - *village2cam-sg* - "elevator-at-top-going-down" - 0 - #f - '() - ) - (-> gp-0 ppointer) - ) - ) - ) + (let ((v1-8 (process-spawn + village2cam + :init pov-camera-init-by-other + (-> self spawn-pos) + *village2cam-sg* + "elevator-at-top-going-down" + 0 + #f + '() + :to self + ) + ) + ) (set! (-> (the-as village2cam (-> v1-8 0)) seq) (the-as uint 2)) ) ) @@ -173,8 +157,7 @@ ;; failed to figure out what this is: (defstate plat-button-move-downward (sunken-elevator) :virtual #t - :trans - (behavior () + :trans (behavior () (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) diff --git a/test/decompiler/reference/levels/village2/swamp-blimp_REF.gc b/test/decompiler/reference/levels/village2/swamp-blimp_REF.gc index 2b6eafc411..8cf7eff5ba 100644 --- a/test/decompiler/reference/levels/village2/swamp-blimp_REF.gc +++ b/test/decompiler/reference/levels/village2/swamp-blimp_REF.gc @@ -1,50 +1,43 @@ ;;-*-Lisp-*- (in-package goal) -;; failed to figure out what this is: -(defskelgroup *swamp-tetherrock-sg* swamp-tetherrock - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 4 0 6) - :longest-edge (meters 0) - ) +(import "goal_src/import/swamp-tetherrock-ag.gc") +(import "goal_src/import/swamp-rope-ag.gc") +(import "goal_src/import/swamp-tetherrock-explode-ag.gc") +(import "goal_src/import/precursor-arm-ag.gc") +(import "goal_src/import/swamp-blimp-ag.gc") ;; failed to figure out what this is: -(defskelgroup *swamp-tetherrock-explode-sg* swamp-tetherrock-explode - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 4 0 16) - :longest-edge (meters 0) - ) +(defskelgroup *swamp-tetherrock-sg* swamp-tetherrock swamp-tetherrock-lod0-jg swamp-tetherrock-idle-ja + ((swamp-tetherrock-lod0-mg (meters 999999))) + :bounds (static-spherem 0 4 0 6) + ) ;; failed to figure out what this is: -(defskelgroup *precursor-arm-sg* precursor-arm - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 15 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *swamp-tetherrock-explode-sg* swamp-tetherrock-explode swamp-tetherrock-explode-lod0-jg swamp-tetherrock-explode-idle-ja + ((swamp-tetherrock-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 4 0 16) + ) ;; failed to figure out what this is: -(defskelgroup *swamp-rope-sg* swamp-rope - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 300) - :longest-edge (meters 66) - ) +(defskelgroup *precursor-arm-sg* precursor-arm precursor-arm-lod0-jg precursor-arm-idle-ja + ((precursor-arm-lod0-mg (meters 999999))) + :bounds (static-spherem 0 15 0 15) + ) ;; failed to figure out what this is: -(defskelgroup *swamp-blimp-sg* swamp-blimp - 0 - 3 - ((1 (meters 20)) (2 (meters 999999))) - :bounds (static-spherem 10 60 0 95) - :longest-edge (meters 40) - ) +(defskelgroup *swamp-rope-sg* swamp-rope swamp-rope-lod0-jg swamp-rope-idle-ja + ((swamp-rope-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 300) + :longest-edge (meters 66) + ) + +;; failed to figure out what this is: +(defskelgroup *swamp-blimp-sg* swamp-blimp swamp-blimp-lod0-jg swamp-blimp-idle-ja + ((swamp-blimp-lod0-mg (meters 20)) (swamp-blimp-lod1-mg (meters 999999))) + :bounds (static-spherem 10 60 0 95) + :longest-edge (meters 40) + ) ;; failed to figure out what this is: (defpartgroup group-tetherrock-explode @@ -52,8 +45,7 @@ :duration 150 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 2065 :period 600 :length 5) + :parts ((sp-item 2065 :period 600 :length 5) (sp-item 2066 :period 600 :length 40) (sp-item 2067 :period 600 :length 20) (sp-item 2068 :period 600 :length 20) @@ -62,8 +54,7 @@ ;; failed to figure out what this is: (defpart 2066 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 0.33) (meters 0.66) 1.0) @@ -89,14 +80,12 @@ ;; failed to figure out what this is: (defpart 2069 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.4222223)) ) ;; failed to figure out what this is: (defpart 2068 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-flt spt-scale-x (meters 0.4)) @@ -115,8 +104,7 @@ ;; failed to figure out what this is: (defpart 2065 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters 2)) (sp-flt spt-scale-x (meters 32)) @@ -133,8 +121,7 @@ ;; failed to figure out what this is: (defpart 2067 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) @@ -163,14 +150,12 @@ ;; failed to figure out what this is: (defpart 2070 - :init-specs - ((sp-flt spt-fade-r -0.53333336) (sp-flt spt-fade-g -0.53333336) (sp-flt spt-fade-b -1.0583333)) + :init-specs ((sp-flt spt-fade-r -0.53333336) (sp-flt spt-fade-g -0.53333336) (sp-flt spt-fade-b -1.0583333)) ) ;; failed to figure out what this is: (defpart 2017 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.2) (sp-flt spt-y (meters 0.1)) (sp-flt spt-scale-x (meters 3)) @@ -194,14 +179,12 @@ :id 287 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1321 :period 15 :length 5)) + :parts ((sp-item 1321 :period 15 :length 5)) ) ;; failed to figure out what this is: (defpart 1321 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1d :page #x2)) (sp-rnd-flt spt-num 1.0 1.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.3) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -245,8 +228,7 @@ ) ;; definition for symbol *SWAMP_BLIMP-bank*, type swamp-blimp-bank -(define - *SWAMP_BLIMP-bank* +(define *SWAMP_BLIMP-bank* (new 'static 'swamp-blimp-bank :pause-before-dropping-arm #x4b0 :rise-per-break 16384.0 :arm-sink-wait 1500.0) ) @@ -787,8 +769,7 @@ ;; failed to figure out what this is: (defstate swamp-tetherrock-die (swamp-tetherrock) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (deactivate self) (suspend) @@ -799,11 +780,10 @@ ;; failed to figure out what this is: (defstate swamp-tetherrock-hide (swamp-tetherrock) - :code - (behavior () + :code (behavior () (clear-collide-with-as (-> self root-override)) (logior! (-> self draw status) (draw-status hidden)) - (while #t + (loop (when (= (get-task-status (-> self entity extra perm task)) (task-status invalid)) (if (not (-> self child)) (go swamp-tetherrock-die) @@ -817,21 +797,19 @@ ;; failed to figure out what this is: (defstate swamp-tetherrock-break (swamp-tetherrock) - :exit - (behavior () - (clear-pending-settings-from-process *setting-control* self 'movie) - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (copy-settings-from-target! *setting-control*) + :exit (behavior () + (remove-setting! 'movie) + (remove-setting! 'process-mask) + (apply-settings *setting-control*) (none) ) - :code - (behavior () + :code (behavior () (let ((gp-0 (tetherrock-get-info (-> self entity)))) (hide-hud-quick) (process-grab? *target*) - (set-setting! *setting-control* self 'movie (the-as symbol (process->ppointer self)) 0.0 0) - (set-setting! *setting-control* self 'process-mask 'set 0.0 #x80800) - (copy-settings-from-target! *setting-control*) + (set-setting! 'movie (process->ppointer self) 0.0 0) + (set-setting! 'process-mask 'set 0.0 (process-mask movie platform)) + (apply-settings *setting-control*) (let* ((s4-0 (get-task-control (game-task swamp-tether-1))) (s5-0 (+ (get-reminder s4-0 0) 1)) ) @@ -887,43 +865,28 @@ ) ) ) - (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s4-1 - (let ((t9-21 (method-of-type part-tracker activate))) - (t9-21 (the-as part-tracker s4-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-1 - part-tracker-init - (-> *part-group-id-table* 285) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> s4-1 ppointer) - ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 285) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* ) (logior! (-> self draw status) (draw-status skip-bones)) - (let* ((s4-2 (get-process *default-dead-pool* manipy #x4000)) - (s4-3 (ppointer->handle (when s4-2 - (let ((t9-24 (method-of-type manipy activate))) - (t9-24 (the-as manipy s4-2) *entity-pool* 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process - s4-2 - manipy-init - (-> self root-override trans) - (-> self entity) - *swamp-tetherrock-explode-sg* - #f - ) - (-> s4-2 ppointer) - ) - ) - ) - ) + (let ((s4-3 (ppointer->handle (manipy-spawn + (-> self root-override trans) + (-> self entity) + *swamp-tetherrock-explode-sg* + #f + :to *entity-pool* + ) + ) + ) + ) (send-event (handle->process (the-as handle s4-3)) 'anim-mode 'play1) (send-event (handle->process (the-as handle s4-3)) 'art-joint-anim "swamp-tetherrock-explode-explode" 0) (send-event (handle->process (the-as handle s4-3)) 'draw #t) @@ -965,64 +928,57 @@ ) ) (process-release? *target*) - (let ((gp-3 (get-process *default-dead-pool* process #x4000))) - (when gp-3 - (let ((t9-37 (method-of-type process activate))) - (t9-37 gp-3 self 'process (the-as pointer #x70004000)) + (process-spawn-function + process + (lambda ((arg0 int)) + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current hint) + (-> *setting-control* current movie) + ) + (suspend) ) - (run-next-time-in-process - gp-3 - (lambda ((arg0 int)) - (while (or (-> *setting-control* current ambient) - (-> *setting-control* current hint) - (-> *setting-control* current movie) - ) - (suspend) - ) - (cond - ((= arg0 3) - (level-hint-spawn - (game-text-id swamp-tethers-three-to-go) - "sksp0157" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 2) - (level-hint-spawn - (game-text-id swamp-tethers-two-to-go) - "sksp0158" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 1) - (level-hint-spawn - (game-text-id swamp-tethers-lefts-find-the-last) - "sksp0159" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((zero? arg0) - (level-hint-spawn - (game-text-id swamp-tethers-completion-sage-precursor-arm) - "sagevb04" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ) - (none) - ) - s5-2 + (cond + ((= arg0 3) + (level-hint-spawn + (game-text-id swamp-tethers-three-to-go) + "sksp0157" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 2) + (level-hint-spawn + (game-text-id swamp-tethers-two-to-go) + "sksp0158" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((= arg0 1) + (level-hint-spawn + (game-text-id swamp-tethers-lefts-find-the-last) + "sksp0159" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + ((zero? arg0) + (level-hint-spawn + (game-text-id swamp-tethers-completion-sage-precursor-arm) + "sagevb04" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) ) - (-> gp-3 ppointer) + (none) ) + s5-2 + :to self ) ) ) @@ -1030,14 +986,12 @@ (go swamp-tetherrock-hide) (none) ) - :post - (the-as (function none :behavior swamp-tetherrock) ja-post) + :post (the-as (function none :behavior swamp-tetherrock) ja-post) ) ;; failed to figure out what this is: (defstate swamp-tetherrock-idle (swamp-tetherrock) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (when (and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow)) @@ -1052,26 +1006,20 @@ s5-0 ) ) - (s5-1 (get-process *default-dead-pool* part-tracker #x4000)) ) - (when s5-1 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - part-tracker-init - (-> *part-group-id-table* 287) - 150 - #f - #f - #f - (if gp-0 - (-> (the-as process-drawable gp-0) root trans) - (-> self root-override trans) - ) - ) - (-> s5-1 ppointer) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 287) + 150 + #f + #f + #f + (if gp-0 + (-> (the-as process-drawable gp-0) root trans) + (-> self root-override trans) + ) + :to *entity-pool* ) ) ) @@ -1080,9 +1028,8 @@ ) ) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (let ((s4-0 (new 'static 'vector :y 1.0 :w 1.0)) (s3-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) @@ -1111,8 +1058,7 @@ ) (none) ) - :post - (the-as (function none :behavior swamp-tetherrock) transform-post) + :post (the-as (function none :behavior swamp-tetherrock) transform-post) ) ;; definition for method 11 of type swamp-tetherrock @@ -1174,11 +1120,10 @@ ;; failed to figure out what this is: (defstate precursor-arm-die (precursor-arm) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (deactivate self) - (while #t + (loop (suspend) ) (none) @@ -1187,8 +1132,7 @@ ;; failed to figure out what this is: (defstate precursor-arm-sink (precursor-arm) - :code - (behavior () + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the int (-> *SWAMP_BLIMP-bank* arm-sink-wait)) @@ -1197,7 +1141,7 @@ ) (close-specific-task! (-> self entity extra perm task) (task-status need-reminder)) (close-specific-task! (-> self entity extra perm task) (task-status need-resolution)) - (while #t + (loop (cond ((< -40960.0 (-> self y-offset)) (set! (-> self y-offset) (- (-> self y-offset) (* 409.6 (-> *display* time-adjust-ratio)))) @@ -1213,8 +1157,7 @@ ) (none) ) - :post - (the-as (function none :behavior precursor-arm) transform-post) + :post (the-as (function none :behavior precursor-arm) transform-post) ) ;; definition for function precursor-arm-slip @@ -1238,16 +1181,14 @@ ;; failed to figure out what this is: (defstate precursor-arm-idle (precursor-arm) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('arm-sink-evt) (go precursor-arm-sink) ) ) ) - :trans - (behavior () + :trans (behavior () (when (>= (-> self rot-t) 1.0) (+! (-> self rot-base) (-> self rot-dist)) (set! (-> self rot-dist) (rand-vu-float-range -16384.0 16384.0)) @@ -1281,9 +1222,8 @@ ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (set! (-> self tension) 1.5) (let* ((f26-0 (+ 225.0 (* 150.0 (sin (rand-vu-float-range 0.0 16384.0))))) (f0-5 (+ 4096.0 (* 8192.0 (sin (rand-vu-float-range 0.0 16384.0))))) @@ -1341,8 +1281,7 @@ ) (none) ) - :post - (the-as (function none :behavior precursor-arm) transform-post) + :post (the-as (function none :behavior precursor-arm) transform-post) ) ;; definition for method 11 of type precursor-arm @@ -1457,24 +1396,19 @@ ;; failed to figure out what this is: (defstate swamp-rope-break (swamp-rope) - :enter - (behavior () + :enter (behavior () (set! (-> self scale-base) (-> self root scale y)) (none) ) - :trans - (behavior () + :trans (behavior () (vector<-cspace! (-> self root trans) (-> self parent-override 0 node-list data (-> self parent-rp))) (none) ) - :code - (behavior () - (let* ((f30-0 18.204445) - (f28-0 9.102222) - (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (set! (-> self rot-speed) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-2))))) + :code (behavior () + (let ((f30-0 18.204445) + (f28-0 9.102222) + ) + (set! (-> self rot-speed) (+ f30-0 (* f28-0 (rand-float-gen)))) ) (let* ((f30-1 3000000.0) (v1-5 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -1482,38 +1416,25 @@ ) (set! (-> self state-time) (the-as time-frame (the int (* f30-1 (+ -1.0 (the-as float v1-6)))))) ) - (ja-channel-push! 1 150) - (while #t + (ja-channel-push! 1 (seconds 0.5)) + (loop (let* ((f30-2 0.3) (f28-1 0.25) (v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-11 (the-as number (logior #x3f800000 v1-10))) (f30-3 (+ f30-2 (* f28-1 (+ -1.0 (the-as float v1-11))))) ) - (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-7 param 1) f30-3) - (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max f30-3) :frame-num 0.0) (until (ja-done? 0) (swamp-rope-break-code) (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1))) - (set! (-> a0-8 param 1) f30-3) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! max f30-3)) ) ) ) (none) ) - :post - (behavior () + :post (behavior () (set! (-> self other-pos quad) (-> self root trans quad)) (set! (-> self other-pos y) (+ -245760.0 (-> self other-pos y))) (swamp-rope-post) @@ -1566,14 +1487,10 @@ ;; failed to figure out what this is: (defstate swamp-rope-idle-rock (swamp-rope) - :trans - swamp-rope-trans - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (while #t + :trans swamp-rope-trans + :code (behavior () + (ja :group! swamp-blimp-idle-ja) + (loop (let* ((f0-1 (* 2000.0 (- (-> self old-scale) (-> self root scale y)))) (f1-3 (+ 0.5 f0-1)) ) @@ -1591,28 +1508,20 @@ (set! (-> (the-as swamp-rope a0-4) frame vector-overlay quad) (-> self root trans quad)) ) ) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 num-func) num-func-identity) - (set! (-> gp-0 frame-num) (* (-> self frame value) (the float (ja-num-frames 0)))) - ) + (ja :num-func num-func-identity :frame-num (* (-> self frame value) (the float (ja-num-frames 0)))) (suspend) ) (none) ) - :post - swamp-rope-post + :post swamp-rope-post ) ;; failed to figure out what this is: (defstate swamp-rope-idle-arm (swamp-rope) - :trans - swamp-rope-trans - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (while #t + :trans swamp-rope-trans + :code (behavior () + (ja :group! swamp-blimp-idle-ja) + (loop (let* ((a0-3 (-> self other-entity)) (v1-3 (if a0-3 (-> a0-3 extra process) @@ -1624,16 +1533,12 @@ ) ) (TODO-RENAME-10 (-> self frame) 0.0) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 num-func) num-func-identity) - (set! (-> gp-0 frame-num) (* (-> self frame value) (the float (ja-num-frames 0)))) - ) + (ja :num-func num-func-identity :frame-num (* (-> self frame value) (the float (ja-num-frames 0)))) (suspend) ) (none) ) - :post - swamp-rope-post + :post swamp-rope-post ) ;; definition for function swamp-rope-init-by-other @@ -1725,8 +1630,7 @@ ;; failed to figure out what this is: (defstate swamp-blimp-bye-bye (swamp-blimp) - :enter - (behavior () + :enter (behavior () (let ((gp-0 (entity-actor-lookup (-> self entity) 'alt-actor (-> *SWAMP_BLIMP-bank* arm-index)))) (when gp-0 (entity-birth-no-kill gp-0) @@ -1741,14 +1645,12 @@ 0 (none) ) - :trans - (the-as (function none :behavior swamp-blimp) blimp-trans) - :code - (behavior () + :trans (the-as (function none :behavior swamp-blimp) blimp-trans) + :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-copy! gp-0 (-> self rot-at-init)) - (while #t + (loop (quaternion-vector-angle! (-> self rot-at-init) (new 'static 'vector :y 1.0 :w 1.0) @@ -1769,12 +1671,10 @@ ) (none) ) - :post - (the-as (function none :behavior swamp-blimp) transform-post) + :post (the-as (function none :behavior swamp-blimp) transform-post) ) ;; definition for function swamp-blimp-setup -;; INFO: Return type mismatch int vs none. (defbehavior swamp-blimp-setup swamp-blimp () (rlet ((vf0 :class vf)) (init-vf0-vector) @@ -1854,15 +1754,14 @@ (vector-normalize! (the-as vector (-> self gondola-tilt-oscillator)) 1.0) ) ) + gp-0 ) - (none) ) ) ;; failed to figure out what this is: (defstate swamp-blimp-idle (swamp-blimp) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'tetherrock-break-evt) (increment-success-for-hint (game-text-id swamp-tethers-advice-hint)) @@ -1871,14 +1770,10 @@ ) ) ) - :trans - (the-as (function none :behavior swamp-blimp) blimp-trans) - :code - (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) - (while #t + :trans (the-as (function none :behavior swamp-blimp) blimp-trans) + :code (behavior () + (ja :group! swamp-blimp-idle-ja) + (loop (when (< 300 (-> self arm-timer)) (set! (-> self arm-timer) (- (the-as time-frame (-> self arm-timer)) (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) @@ -1907,16 +1802,12 @@ (go swamp-blimp-bye-bye) ) ) - (let ((v1-28 (-> self skel root-channel 0))) - (set! (-> v1-28 num-func) num-func-identity) - (set! (-> v1-28 frame-num) 0.0) - ) + (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) (none) ) - :post - (the-as (function none :behavior swamp-blimp) transform-post) + :post (the-as (function none :behavior swamp-blimp) transform-post) ) ;; definition for method 11 of type swamp-blimp @@ -1967,20 +1858,11 @@ (let ((s5-2 (entity-actor-count (-> obj entity) 'alt-actor))) (dotimes (s4-1 s5-2) (let ((s3-1 (entity-actor-lookup (-> obj entity) 'alt-actor s4-1))) - (when s3-1 - (let ((s2-0 (get-process *default-dead-pool* swamp-rope #x4000))) + (if s3-1 (set! (-> obj the-ropes s4-1) - (ppointer->handle (when s2-0 - (let ((t9-19 (method-of-type swamp-rope activate))) - (t9-19 (the-as swamp-rope s2-0) obj 'swamp-rope (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 swamp-rope-init-by-other (-> obj trans-at-init) s3-1) - (-> s2-0 ppointer) - ) - ) + (ppointer->handle (process-spawn swamp-rope (-> obj trans-at-init) s3-1 :to obj)) ) ) - ) ) ) ) diff --git a/test/decompiler/reference/levels/village2/village2-obs_REF.gc b/test/decompiler/reference/levels/village2/village2-obs_REF.gc index ce87eb72a6..6cd2459fab 100644 --- a/test/decompiler/reference/levels/village2/village2-obs_REF.gc +++ b/test/decompiler/reference/levels/village2/village2-obs_REF.gc @@ -1,6 +1,18 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/pontoonfive-ag.gc") +(import "goal_src/import/allpontoons-ag.gc") +(import "goal_src/import/medres-village2-ag.gc") +(import "goal_src/import/exit-chamber-dummy-ag.gc") +(import "goal_src/import/village2cam-ag.gc") +(import "goal_src/import/fireboulder-ag.gc") +(import "goal_src/import/ogreboss-village2-ag.gc") +(import "goal_src/import/ceilingflag-ag.gc") +(import "goal_src/import/medres-rolling1-ag.gc") +(import "goal_src/import/medres-rolling-ag.gc") +(import "goal_src/import/pontoonten-ag.gc") + ;; definition of type village2cam (deftype village2cam (pov-camera) ((seq uint64 :offset-assert 224) @@ -21,13 +33,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *village2cam-sg* village2cam - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 10) - :longest-edge (meters 0) - ) +(defskelgroup *village2cam-sg* village2cam village2cam-lod0-jg -1 + ((village2cam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) ;; definition for method 29 of type village2cam (defmethod set-stack-size! village2cam ((obj village2cam)) @@ -38,46 +47,21 @@ ;; failed to figure out what this is: (defstate pov-camera-playing (village2cam) :virtual #t - :code - (behavior () + :code (behavior () (let ((v1-0 (-> self seq))) (cond ((zero? v1-0) - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> a0-0 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((= v1-0 1) - (let ((a0-4 (-> self skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-4 param 1) 1.0) - (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-5 (-> self skel root-channel 0))) - (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1))) - (set! (-> a0-5 param 1) 1.0) - (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((= v1-0 2) @@ -99,31 +83,25 @@ ) ;; failed to figure out what this is: -(defskelgroup *med-res-rolling-sg* medres-rolling - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -520 110 70 100) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-rolling-sg* medres-rolling medres-rolling-lod0-jg medres-rolling-idle-ja + ((medres-rolling-lod0-mg (meters 999999))) + :bounds (static-spherem -520 110 70 100) + :longest-edge (meters 0.01) + ) ;; failed to figure out what this is: -(defskelgroup *med-res-rolling1-sg* medres-rolling1 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -300 30 -20 120) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-rolling1-sg* medres-rolling1 medres-rolling1-lod0-jg medres-rolling1-idle-ja + ((medres-rolling1-lod0-mg (meters 999999))) + :bounds (static-spherem -300 30 -20 120) + :longest-edge (meters 0.01) + ) ;; failed to figure out what this is: -(defskelgroup *med-res-village2-sg* medres-village2 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem -60 65 0 90) - :longest-edge (meters 0.01) - ) +(defskelgroup *med-res-village2-sg* medres-village2 medres-village2-lod0-jg medres-village2-idle-ja + ((medres-village2-lod0-mg (meters 999999))) + :bounds (static-spherem -60 65 0 90) + :longest-edge (meters 0.01) + ) ;; definition of type pontoon (deftype pontoon (rigid-body-platform) @@ -154,28 +132,24 @@ ;; failed to figure out what this is: (defstate pontoon-hidden (pontoon) - :enter - (behavior () + :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self root-overlay)) (none) ) - :exit - (behavior () + :exit (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self root-overlay)) (none) ) - :trans - (behavior () + :trans (behavior () (if (task-closed? (the-as game-task (-> self task)) (task-status need-resolution)) (go-virtual rigid-body-platform-idle) ) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (suspend) ) (none) @@ -184,8 +158,7 @@ ;; failed to figure out what this is: (defstate pontoon-die (pontoon) - :code - (behavior () + :code (behavior () (cleanup-for-death self) (deactivate self) (none) @@ -195,8 +168,7 @@ ;; failed to figure out what this is: (defstate rigid-body-platform-float (pontoon) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'die) @@ -215,8 +187,7 @@ ;; failed to figure out what this is: (defstate rigid-body-platform-idle (pontoon) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'die) (cleanup-for-death self) @@ -356,22 +327,18 @@ ) ;; failed to figure out what this is: -(defskelgroup *pontoonfive-sg* pontoonfive - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 5) - :longest-edge (meters 3.5) - ) +(defskelgroup *pontoonfive-sg* pontoonfive pontoonfive-lod0-jg pontoonfive-idle-ja + ((pontoonfive-lod0-mg (meters 20)) (pontoonfive-lod1-mg (meters 40)) (pontoonfive-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :longest-edge (meters 3.5) + ) ;; failed to figure out what this is: -(defskelgroup *pontoonten-sg* pontoonten - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 7) - :longest-edge (meters 4) - ) +(defskelgroup *pontoonten-sg* pontoonten pontoonten-lod0-jg pontoonten-idle-ja + ((pontoonten-lod0-mg (meters 20)) (pontoonten-lod1-mg (meters 40)) (pontoonten-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + :longest-edge (meters 4) + ) ;; definition for method 30 of type pontoonfive ;; INFO: Return type mismatch int vs none. @@ -508,14 +475,12 @@ :id 563 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2841 :flags (is-3d) :period 900 :length 5) (sp-item 2842 :flags (is-3d) :period 900 :length 5)) + :parts ((sp-item 2841 :flags (is-3d) :period 900 :length 5) (sp-item 2842 :flags (is-3d) :period 900 :length 5)) ) ;; failed to figure out what this is: (defpart 2841 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 0) (meters 9) 1.0) (sp-flt spt-y (meters 0.1)) @@ -541,14 +506,12 @@ ;; failed to figure out what this is: (defpart 2843 - :init-specs - ((sp-flt spt-fade-a -0.094814815)) + :init-specs ((sp-flt spt-fade-a -0.094814815)) ) ;; failed to figure out what this is: (defpart 2842 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 8) (meters 8) 1.0) (sp-flt spt-y (meters 0.1)) @@ -596,18 +559,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *allpontoons-sg* allpontoons - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 32 0 -5 34) - :longest-edge (meters 0) - ) +(defskelgroup *allpontoons-sg* allpontoons allpontoons-lod0-jg allpontoons-idle-ja + ((allpontoons-lod0-mg (meters 999999))) + :bounds (static-spherem 32 0 -5 34) + ) ;; failed to figure out what this is: (defstate allpontoons-be-clone (allpontoons) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (= v1-0 'end-mode) (cleanup-for-death self) @@ -616,19 +575,16 @@ ) ) ) - :enter - (behavior ((arg0 handle)) + :enter (behavior ((arg0 handle)) (logclear! (-> self draw status) (draw-status hidden)) (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (ja-aframe-num 0) 500.0) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4))) @@ -639,8 +595,7 @@ ) (none) ) - :code - (behavior ((arg0 handle)) + :code (behavior ((arg0 handle)) (clone-anim arg0 3 #t "") (cleanup-for-death self) (deactivate self) @@ -650,22 +605,19 @@ ;; failed to figure out what this is: (defstate allpontoons-idle (allpontoons) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('clone) (go allpontoons-be-clone (the-as handle (-> arg3 param 0))) ) ) ) - :enter - (behavior () + :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (none) ) - :code - (behavior () - (while #t + :code (behavior () + (loop (when (and (nonzero? (-> self task)) (task-closed? (the-as game-task (-> self task)) (task-status need-resolution))) (cleanup-for-death self) (deactivate self) @@ -717,13 +669,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *fireboulder-sg* fireboulder - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 3.5 0 6) - :longest-edge (meters 3.5) - ) +(defskelgroup *fireboulder-sg* fireboulder fireboulder-lod0-jg fireboulder-idle-ja + ((fireboulder-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3.5 0 6) + :longest-edge (meters 3.5) + ) ;; definition for function fireboulder-disable-blocking-collision ;; INFO: Return type mismatch int vs none. @@ -790,13 +740,10 @@ ;; failed to figure out what this is: (defstate fireboulder-hover (fireboulder) - :enter - (behavior () + :enter (behavior () (fireboulder-disable-blocking-collision) (ja-channel-set! 1) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - ) + (ja :group! (-> self draw art-group data 3)) (logclear! (-> self draw status) (draw-status hidden)) (set! (-> self root-override trans quad) (-> self entity extra trans quad)) (vector-reset! (-> self draw origin)) @@ -810,46 +757,18 @@ (set! (-> self draw bounds w) 24576.0) (none) ) - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) (none) ) - :trans - (behavior () + :trans (behavior () (fireboulder-hover-stuff) (update! (-> self sound)) (none) ) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-y! (-> self root-override quat) @@ -857,44 +776,34 @@ (* 455.1111 (-> *display* time-adjust-ratio)) ) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1))) - (set! (-> a0-2 param 1) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior fireboulder) transform-post) + :post (the-as (function none :behavior fireboulder) transform-post) ) ;; failed to figure out what this is: (defstate fireboulder-be-clone (fireboulder) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('stop-cloning) (go fireboulder-hover) ) ) ) - :enter - (behavior ((arg0 handle)) + :enter (behavior ((arg0 handle)) (logclear! (-> self mask) (process-mask actor-pause)) (none) ) - :exit - (behavior () + :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) (logclear! (-> self skel status) (janim-status spool)) (none) ) - :trans - (the-as (function none :behavior fireboulder) fireboulder-hover-stuff) - :code - (behavior ((arg0 handle)) + :trans (the-as (function none :behavior fireboulder) fireboulder-hover-stuff) + :code (behavior ((arg0 handle)) (clone-anim arg0 3 #t "") (format 0 "ERROR: fireboulder-be-clone ended~%") (cleanup-for-death self) @@ -905,16 +814,14 @@ ;; failed to figure out what this is: (defstate fireboulder-idle (fireboulder) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('clone) (go fireboulder-be-clone (the-as handle (-> arg3 param 0))) ) ) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self tracker)))) (if a0-1 (deactivate a0-1) @@ -922,36 +829,10 @@ ) (none) ) - :code - (behavior () + :code (behavior () (transform-post) - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (cond ((zero? (-> self task)) @@ -962,42 +843,28 @@ ) ) (else - (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) - (set! (-> self tracker) - (ppointer->handle - (when gp-0 - (let ((t9-3 (method-of-type part-tracker activate))) - (t9-3 (the-as part-tracker gp-0) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - part-tracker-init - (-> *part-group-id-table* 271) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self tracker) (ppointer->handle (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 271) + -1 + #f + #f + #f + (-> self root-override trans) + :to *entity-pool* + ) + ) + ) ) ) (suspend) - (let ((a0-14 (-> self skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) - (set! (-> a0-14 param 1) 1.0) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior fireboulder) ja-post) + :post (the-as (function none :behavior fireboulder) ja-post) ) ;; definition for method 11 of type fireboulder @@ -1038,19 +905,8 @@ (cond ((name= (-> obj name) "fireboulder-6") (quaternion-axis-angle! (-> obj root-override quat) 0.0 1.0 0.0 16384.0) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "rock-hover") - :volume #x400 - :fo-max 30 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "rock-hover" :fo-max 30) (-> obj root-override trans)) ) ) (else @@ -1096,58 +952,24 @@ ) ;; failed to figure out what this is: -(defskelgroup *ceilingflag-sg* ceilingflag - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 -4 0 7) - :longest-edge (meters 0) - ) +(defskelgroup *ceilingflag-sg* ceilingflag ceilingflag-geo-jg ceilingflag-idle-ja + ((ceilingflag-geo-mg (meters 999999))) + :bounds (static-spherem 0 -4 0 7) + ) ;; failed to figure out what this is: (defstate ceilingflag-idle (ceilingflag) - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior ceilingflag) ja-post) + :post (the-as (function none :behavior ceilingflag) ja-post) ) ;; definition for method 11 of type ceilingflag @@ -1189,13 +1011,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *exit-chamber-dummy-sg* exit-chamber-dummy - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 5 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *exit-chamber-dummy-sg* exit-chamber-dummy exit-chamber-dummy-lod0-jg -1 + ((exit-chamber-dummy-lod0-mg (meters 999999))) + :bounds (static-spherem 0 5 0 15) + ) ;; definition for method 20 of type exit-chamber-dummy (defmethod skip-reminder? exit-chamber-dummy ((obj exit-chamber-dummy)) @@ -1213,8 +1032,7 @@ ;; failed to figure out what this is: (defstate exit-chamber-dummy-wait-to-appear (exit-chamber-dummy) - :code - (behavior () + :code (behavior () (logior! (-> self draw status) (draw-status hidden)) (while (not (skip-reminder? self)) (suspend) @@ -1236,8 +1054,7 @@ ;; failed to figure out what this is: (defstate exit-chamber-dummy-idle (exit-chamber-dummy) - :code - (behavior () + :code (behavior () (logclear! (-> self draw status) (draw-status hidden)) (let ((gp-0 0)) (while (< gp-0 2) @@ -1270,8 +1087,7 @@ (go exit-chamber-dummy-wait-to-appear) (none) ) - :post - (the-as (function none :behavior exit-chamber-dummy) ja-post) + :post (the-as (function none :behavior exit-chamber-dummy) ja-post) ) ;; definition for method 11 of type exit-chamber-dummy @@ -1323,29 +1139,24 @@ ) ;; failed to figure out what this is: -(defskelgroup *ogreboss-village2-sg* ogreboss-village2 - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 10 0 15) - :longest-edge (meters 0) - ) +(defskelgroup *ogreboss-village2-sg* ogreboss-village2 ogreboss-village2-lod0-jg ogreboss-village2-idle-ja + ((ogreboss-village2-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 15) + ) ;; failed to figure out what this is: (defpartgroup group-ogreboulder-trail :id 564 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 2319 :fade-after (meters 200) :falloff-to (meters 200)) + :parts ((sp-item 2319 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 2320 :fade-after (meters 200) :falloff-to (meters 200)) ) ) ;; failed to figure out what this is: (defpart 2320 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 2) 1.0) @@ -1373,8 +1184,7 @@ ;; failed to figure out what this is: (defpart 2319 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 2) 1.0) @@ -1405,14 +1215,12 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2287 :period 900 :length 40)) + :parts ((sp-item 2287 :period 900 :length 40)) ) ;; failed to figure out what this is: (defpart 2287 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 12.0) (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0) (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.1) 1.0) @@ -1435,8 +1243,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) - :parts - ((sp-item 2288 :period 900 :length 20) + :parts ((sp-item 2288 :period 900 :length 20) (sp-item 2321 :flags (is-3d) :period 900 :length 10) (sp-item 2322 :flags (is-3d) :period 900 :length 10) ) @@ -1444,8 +1251,7 @@ ;; failed to figure out what this is: (defpart 2321 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 0) (meters 9) 1.0) (sp-rnd-flt spt-scale-x (meters 16) (meters 8) 1.0) @@ -1470,14 +1276,12 @@ ;; failed to figure out what this is: (defpart 2323 - :init-specs - ((sp-flt spt-fade-a -0.094814815)) + :init-specs ((sp-flt spt-fade-a -0.094814815)) ) ;; failed to figure out what this is: (defpart 2322 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 8.0) (sp-rnd-flt spt-x (meters 8) (meters 8) 1.0) (sp-rnd-flt spt-scale-x (meters 4.5) (meters 3.5) 1.0) @@ -1502,8 +1306,7 @@ ;; failed to figure out what this is: (defpart 2288 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 16.0) (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) (sp-rnd-flt spt-scale-x (meters 12) (meters 6) 1.0) @@ -1546,15 +1349,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 552) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "boulder-splash") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 552) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook nothing) @@ -1572,15 +1377,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 552) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "boulder-splash") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 552) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook nothing) @@ -1598,15 +1405,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 551) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "v2ogre-boulder") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 551) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook boulder2-trans-2) @@ -1624,15 +1433,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 552) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "boulder-splash") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 552) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook nothing) @@ -1650,15 +1461,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 551) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "v2ogre-boulder") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 551) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook boulder3-trans-2) @@ -1676,15 +1489,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 552) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "boulder-splash") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 552) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook nothing) @@ -1702,15 +1517,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 551) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "v2ogre-boulder") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 551) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook boulder4-trans-3) @@ -1728,15 +1545,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) - (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) - (when s5-1 - (let ((t9-5 (method-of-type part-tracker activate))) - (t9-5 (the-as part-tracker s5-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 part-tracker-init (-> *part-group-id-table* 551) -1 #f #f #f gp-0) - (-> s5-1 ppointer) - ) + (sound-play "v2ogre-boulder") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 551) + -1 + #f + #f + #f + gp-0 + :to *entity-pool* ) ) (send-event self 'trans-hook boulder4-trans-2) @@ -1747,23 +1566,11 @@ ;; failed to figure out what this is: (defstate ogreboss-village2-throw (ogreboss-village2) - :trans - ogreboss-village2-trans - :code - (behavior () - (let ((gp-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> self boulder) - (ppointer->handle - (when gp-0 - (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy gp-0) self 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 manipy-init (-> self entity extra trans) (-> self entity) *fireboulder-sg* #f) - (-> gp-0 ppointer) - ) - ) - ) - ) + :trans ogreboss-village2-trans + :code (behavior () + (set! (-> self boulder) + (ppointer->handle (manipy-spawn (-> self entity extra trans) (-> self entity) *fireboulder-sg* #f :to self)) + ) (send-event (handle->process (-> self boulder)) 'anim-mode 'play1) (send-event (handle->process (-> self boulder)) 'art-joint-anim "fireboulder-pre-throw" 0) (send-event (handle->process (-> self boulder)) 'draw #t) @@ -1780,28 +1587,13 @@ ) ) ) - (ja-channel-push! 1 60) - (let ((a0-31 (-> self skel root-channel 0))) - (set! (-> a0-31 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) - (set! (-> a0-31 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1)) - ) - (set! (-> a0-31 param 1) 1.0) - (set! (-> a0-31 frame-num) 0.0) - (joint-control-channel-group! a0-31 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-32 (-> self skel root-channel 0))) - (set! (-> a0-32 param 0) (the float (+ (-> a0-32 frame-group data 0 length) -1))) - (set! (-> a0-32 param 1) 1.0) - (joint-control-channel-group-eval! a0-32 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (let* ((v1-72 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-73 (the-as number (logior #x3f800000 v1-72))) - (f0-9 (+ -1.0 (the-as float v1-73))) - ) + (let ((f0-9 (rand-float-gen))) (cond ((< 0.75 f0-9) (send-event (handle->process (-> self boulder)) 'art-joint-anim "fireboulder-boulder1" 0) @@ -1821,165 +1613,82 @@ ) ) ) - (ja-channel-push! 1 60) - (let ((a0-69 (-> self skel root-channel 0))) - (set! (-> a0-69 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) - (set! (-> a0-69 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) - ) - (set! (-> a0-69 param 1) 1.0) - (set! (-> a0-69 frame-num) 0.0) - (joint-control-channel-group! a0-69 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-70 (-> self skel root-channel 0))) - (set! (-> a0-70 param 0) (the float (+ (-> a0-70 frame-group data 0 length) -1))) - (set! (-> a0-70 param 1) 1.0) - (joint-control-channel-group-eval! a0-70 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (go ogreboss-village2-idle) (none) ) - :post - (the-as (function none :behavior ogreboss-village2) ja-post) + :post (the-as (function none :behavior ogreboss-village2) ja-post) ) ;; failed to figure out what this is: (defstate ogreboss-village2-idle (ogreboss-village2) - :trans - ogreboss-village2-trans - :code - (behavior () - (while #t - (ja-channel-push! 1 30) + :trans ogreboss-village2-trans + :code (behavior () + (loop + (ja-channel-push! 1 (seconds 0.1)) (let ((v1-0 (rand-vu-int-range 0 2))) (cond ((zero? v1-0) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-0 param 0) (ja-aframe 140.0 0)) - (set! (-> gp-0 param 1) 1.0) - (set! (-> gp-0 frame-num) 0.0) - (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! (ja-aframe 140.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 param 0) (ja-aframe 140.0 0)) - (set! (-> gp-1 param 1) 1.0) - (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 140.0 0))) ) (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.16666667)) + (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.167)) (suspend) ) ) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-3 param 0) (ja-aframe 168.0 0)) - (set! (-> gp-3 param 1) 1.0) - (set! (-> gp-3 frame-num) (ja-aframe 140.0 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) + :num! (seek! (ja-aframe 168.0 0)) + :frame-num (ja-aframe 140.0 0) + ) (until (ja-done? 0) (suspend) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 param 0) (ja-aframe 168.0 0)) - (set! (-> gp-4 param 1) 1.0) - (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 168.0 0))) ) (let ((gp-5 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 0.16666667)) + (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 0.167)) (suspend) ) ) - (let ((gp-6 (-> self skel root-channel 0))) - (set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 2))) - (set! (-> gp-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1)) - ) - (set! (-> gp-6 param 1) 1.0) - (set! (-> gp-6 frame-num) (ja-aframe 168.0 0)) - (joint-control-channel-group! gp-6 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num (ja-aframe 168.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-15 (-> self skel root-channel 0))) - (set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1))) - (set! (-> a0-15 param 1) 1.0) - (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((= v1-0 1) - (let ((a0-18 (-> self skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) - (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) - ) - (set! (-> a0-18 param 1) 1.0) - (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-19 (-> self skel root-channel 0))) - (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) - (set! (-> a0-19 param 1) 1.0) - (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (else (dotimes (gp-7 4) - (let ((a0-21 (-> self skel root-channel 0))) - (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-21 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-21 param 1) 1.0) - (set! (-> a0-21 frame-num) 0.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-22 (-> self skel root-channel 0))) - (set! (-> a0-22 param 0) (the float (+ (-> a0-22 frame-group data 0 length) -1))) - (set! (-> a0-22 param 1) 1.0) - (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ) ) ) - (let* ((v1-104 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-105 (the-as number (logior #x3f800000 v1-104))) - (f0-33 (+ -1.0 (the-as float v1-105))) - ) + (let ((f0-33 (rand-float-gen))) (cond ((< 0.6666667 f0-33) - (ja-channel-push! 1 60) - (let ((a0-27 (-> self skel root-channel 0))) - (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) - (set! (-> a0-27 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1)) - ) - (set! (-> a0-27 param 1) 1.0) - (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!) - ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group data 0 length) -1))) - (set! (-> a0-28 param 1) 1.0) - (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) ((not (handle->process (-> self boulder))) @@ -1990,8 +1699,7 @@ ) (none) ) - :post - (the-as (function none :behavior ogreboss-village2) ja-post) + :post (the-as (function none :behavior ogreboss-village2) ja-post) ) ;; definition for method 11 of type ogreboss-village2 @@ -2067,8 +1775,7 @@ :count 3 :converted #f :normal-scale 6.0 - :wave - (new 'static 'inline-array ripple-wave 4 + :wave (new 'static 'inline-array ripple-wave 4 (new 'static 'ripple-wave :scale 7.0 :xdiv 1 :speed 6.0) (new 'static 'ripple-wave :scale 7.0 :xdiv -1 :zdiv 1 :speed 6.0) (new 'static 'ripple-wave :scale 3.0 :xdiv 5 :zdiv 3 :speed 3.0) diff --git a/test/decompiler/reference/levels/village2/village2-part2_REF.gc b/test/decompiler/reference/levels/village2/village2-part2_REF.gc index d50fb2c6e1..599a12aede 100644 --- a/test/decompiler/reference/levels/village2/village2-part2_REF.gc +++ b/test/decompiler/reference/levels/village2/village2-part2_REF.gc @@ -3,20 +3,17 @@ ;; failed to figure out what this is: (defpart 1208 - :init-specs - ((sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-a -0.10666667)) ) ;; failed to figure out what this is: (defpart 1209 - :init-specs - ((sp-flt spt-fade-a -0.16)) + :init-specs ((sp-flt spt-fade-a -0.16)) ) ;; failed to figure out what this is: (defpart 1210 - :init-specs - ((sp-flt spt-fade-a -2.6666667)) + :init-specs ((sp-flt spt-fade-a -2.6666667)) ) ;; failed to figure out what this is: @@ -24,8 +21,7 @@ :id 277 :flags (always-draw) :bounds (static-bspherem 0 22 0 35) - :parts - ((sp-item 1211) + :parts ((sp-item 1211) (sp-item 1211 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1211 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 1212 :fade-after (meters 100) :falloff-to (meters 100)) @@ -86,8 +82,7 @@ ;; failed to figure out what this is: (defpart 1211 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-flt spt-x (meters -7)) (sp-rnd-flt spt-y (meters 41.5) (meters 1.5) 1.0) @@ -115,8 +110,7 @@ ;; failed to figure out what this is: (defpart 1214 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-flt spt-x (meters -12)) (sp-rnd-flt spt-y (meters 42.5) (meters 1.5) 1.0) @@ -144,8 +138,7 @@ ;; failed to figure out what this is: (defpart 1217 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.5 0.8 1.0) (sp-rnd-flt spt-x (meters -2) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 24) (meters 1.5) 1.0) @@ -173,8 +166,7 @@ ;; failed to figure out what this is: (defpart 1220 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.5 0.8 1.0) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters 27.5) (meters 1.5) 1.0) @@ -200,8 +192,7 @@ ;; failed to figure out what this is: (defpart 1223 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters -1) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 28.5) (meters 1.5) 1.0) @@ -227,8 +218,7 @@ ;; failed to figure out what this is: (defpart 1224 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 26) (meters 1.5) 1.0) @@ -256,8 +246,7 @@ ;; failed to figure out what this is: (defpart 1212 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -7)) (sp-rnd-flt spt-y (meters 41.5) (meters 1.5) 1.0) @@ -285,8 +274,7 @@ ;; failed to figure out what this is: (defpart 1215 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -12)) (sp-rnd-flt spt-y (meters 42.5) (meters 1.5) 1.0) @@ -314,8 +302,7 @@ ;; failed to figure out what this is: (defpart 1218 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 23.5) (meters 1.5) 1.0) @@ -343,8 +330,7 @@ ;; failed to figure out what this is: (defpart 1221 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters -4) (meters 10) 1.0) (sp-rnd-flt spt-y (meters 27.5) (meters 1.5) 1.0) @@ -371,8 +357,7 @@ ;; failed to figure out what this is: (defpart 1225 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 26) (meters 1.5) 1.0) @@ -400,8 +385,7 @@ ;; failed to figure out what this is: (defpart 1213 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.2 1.0) (sp-flt spt-x (meters -7)) (sp-rnd-flt spt-y (meters 41.5) (meters 1.5) 1.0) @@ -430,8 +414,7 @@ ;; failed to figure out what this is: (defpart 1216 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.2 1.0) (sp-flt spt-x (meters -12)) (sp-rnd-flt spt-y (meters 42.5) (meters 1.5) 1.0) @@ -460,8 +443,7 @@ ;; failed to figure out what this is: (defpart 1219 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.2 1.0) (sp-rnd-flt spt-x (meters -2) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 23.5) (meters 1.5) 1.0) @@ -490,8 +472,7 @@ ;; failed to figure out what this is: (defpart 1222 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters -4) (meters 8) 1.0) (sp-rnd-flt spt-y (meters 27.5) (meters 1.5) 1.0) @@ -519,8 +500,7 @@ ;; failed to figure out what this is: (defpart 1227 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters -1) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 28.5) (meters 1.5) 1.0) @@ -548,8 +528,7 @@ ;; failed to figure out what this is: (defpart 1226 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.2 1.0) (sp-rnd-flt spt-x (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 26) (meters 1.5) 1.0) @@ -578,8 +557,7 @@ ;; failed to figure out what this is: (defpart 1228 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.05 0.05 1.0) (sp-rnd-flt spt-x (meters 2) (meters 7) 1.0) (sp-flt spt-y (meters 12.5)) @@ -608,8 +586,7 @@ ;; failed to figure out what this is: (defpart 1229 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters 3) (meters 5) 1.0) (sp-flt spt-y (meters 7)) @@ -633,8 +610,7 @@ ;; failed to figure out what this is: (defpart 1230 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.035 0.03 1.0) (sp-rnd-flt spt-x (meters 3.5) (meters 5) 1.0) (sp-flt spt-y (meters 12.5)) @@ -663,8 +639,7 @@ ;; failed to figure out what this is: (defpart 1231 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.025) (sp-rnd-flt spt-x (meters 3) (meters 2) 1.0) (sp-flt spt-y (meters 8)) @@ -688,8 +663,7 @@ ;; failed to figure out what this is: (defpart 1232 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.035 0.03 1.0) (sp-rnd-flt spt-x (meters -7.5) (meters 5) 1.0) (sp-flt spt-y (meters 12.5)) @@ -718,8 +692,7 @@ ;; failed to figure out what this is: (defpart 1233 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.025) (sp-rnd-flt spt-x (meters -6.5) (meters 3) 1.0) (sp-flt spt-y (meters 8)) @@ -743,8 +716,7 @@ ;; failed to figure out what this is: (defpart 1234 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-flt spt-x (meters -6)) (sp-rnd-flt spt-y (meters 43) (meters 0.5) 1.0) @@ -772,8 +744,7 @@ ;; failed to figure out what this is: (defpart 1235 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.03 1.0 1.0) (sp-flt spt-x (meters -6)) (sp-rnd-flt spt-y (meters 43) (meters 0.5) 1.0) @@ -801,8 +772,7 @@ ;; failed to figure out what this is: (defpart 1236 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.3) (sp-flt spt-x (meters -6)) (sp-rnd-flt spt-y (meters 43) (meters 0.5) 1.0) @@ -830,8 +800,7 @@ ;; failed to figure out what this is: (defpart 1237 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.7) (sp-flt spt-x (meters -6)) (sp-rnd-flt spt-y (meters 43) (meters 0.5) 1.0) @@ -859,8 +828,7 @@ ;; failed to figure out what this is: (defpart 1238 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.1 1.0) (sp-flt spt-x (meters -6)) (sp-rnd-flt spt-y (meters 42.5) (meters 0.5) 1.0) @@ -890,8 +858,7 @@ ;; failed to figure out what this is: (defpart 1239 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.06 1.0) (sp-flt spt-x (meters -6)) (sp-rnd-flt spt-y (meters 42.5) (meters 0.5) 1.0) @@ -920,8 +887,7 @@ ;; failed to figure out what this is: (defpart 1240 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-flt spt-x (meters 0)) (sp-rnd-flt spt-y (meters 28) (meters 1.5) 1.0) @@ -951,8 +917,7 @@ ;; failed to figure out what this is: (defpart 1241 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-rnd-flt spt-y (meters 28) (meters 1.5) 1.0) @@ -981,8 +946,7 @@ ;; failed to figure out what this is: (defpart 1242 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.3 1.0) (sp-flt spt-x (meters 0)) (sp-rnd-flt spt-y (meters 28) (meters 1.5) 1.0) @@ -1016,8 +980,7 @@ :id 278 :flags (always-draw) :bounds (static-bspherem 0 22 0 35) - :parts - ((sp-item 1243) + :parts ((sp-item 1243) (sp-item 1243 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 1243 :fade-after (meters 240) :falloff-to (meters 240)) (sp-item 1244 :fade-after (meters 80) :falloff-to (meters 80)) @@ -1031,8 +994,7 @@ ;; failed to figure out what this is: (defpart 1243 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters -8) (meters 4) 1.0) (sp-flt spt-y (meters 49.5)) @@ -1061,8 +1023,7 @@ ;; failed to figure out what this is: (defpart 1244 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -8) (meters 4) 1.0) (sp-flt spt-y (meters 49.5)) @@ -1090,8 +1051,7 @@ ;; failed to figure out what this is: (defpart 1245 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters -7) (meters 3.5) 1.0) (sp-flt spt-y (meters 49.5)) @@ -1121,8 +1081,7 @@ ;; failed to figure out what this is: (defpart 1246 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters 3) (meters 6) 1.0) (sp-flt spt-y (meters 6)) @@ -1151,8 +1110,7 @@ ;; failed to figure out what this is: (defpart 1247 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters 5) (meters 10) 1.0) (sp-flt spt-y (meters 2.5)) @@ -1179,8 +1137,7 @@ :id 279 :flags (always-draw) :bounds (static-bspherem 0 22 0 35) - :parts - ((sp-item 2324)) + :parts ((sp-item 2324)) ) ;; failed to figure out what this is: @@ -1188,8 +1145,7 @@ :id 280 :flags (always-draw) :bounds (static-bspherem 0 22 0 35) - :parts - ((sp-item 1253) + :parts ((sp-item 1253) (sp-item 1253 :fade-after (meters 160) :falloff-to (meters 160)) (sp-item 1253 :fade-after (meters 240) :falloff-to (meters 240)) (sp-item 1254 :fade-after (meters 80) :falloff-to (meters 80)) @@ -1213,8 +1169,7 @@ ;; failed to figure out what this is: (defpart 1253 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.266 0.333 1.0) (sp-rnd-flt spt-x (meters -12) (meters 1) 1.0) (sp-flt spt-y (meters 50.5)) @@ -1242,8 +1197,7 @@ ;; failed to figure out what this is: (defpart 1264 - :init-specs - ((sp-rnd-flt spt-scale-y (meters 1) (meters 1) 1.0) + :init-specs ((sp-rnd-flt spt-scale-y (meters 1) (meters 1) 1.0) (sp-rnd-flt spt-vel-x (meters 0.053333335) (meters 0.013333334) 1.0) (sp-rnd-flt spt-vel-y (meters -0.026666667) (meters -0.013333334) 1.0) (sp-rnd-flt spt-vel-z (meters 0.04) (meters 0.013333334) 1.0) @@ -1256,8 +1210,7 @@ ;; failed to figure out what this is: (defpart 1254 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -12) (meters 1) 1.0) (sp-flt spt-y (meters 50.5)) @@ -1287,8 +1240,7 @@ ;; failed to figure out what this is: (defpart 1265 - :init-specs - ((sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) + :init-specs ((sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-vel-x (meters 0.026666667) (meters 0.013333334) 1.0) (sp-rnd-flt spt-vel-y (meters 0) (meters 0.013333334) 1.0) @@ -1299,8 +1251,7 @@ ;; failed to figure out what this is: (defpart 1255 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.2 1.0) (sp-rnd-flt spt-x (meters -12) (meters 1) 1.0) (sp-flt spt-y (meters 50.5)) @@ -1329,8 +1280,7 @@ ;; failed to figure out what this is: (defpart 1266 - :init-specs - ((sp-rnd-flt spt-vel-x (meters 0.053333335) (meters 0.013333334) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters 0.053333335) (meters 0.013333334) 1.0) (sp-rnd-flt spt-vel-y (meters -0.026666667) (meters -0.013333334) 1.0) (sp-rnd-flt spt-vel-z (meters 0.04) (meters 0.006666667) 1.0) (sp-flt spt-scalevel-x (meters 0.009765625)) @@ -1344,8 +1294,7 @@ ;; failed to figure out what this is: (defpart 1256 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -3) (meters 12) 1.0) (sp-flt spt-y (meters 6)) @@ -1374,8 +1323,7 @@ ;; failed to figure out what this is: (defpart 1257 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters -3) (meters 12) 1.0) (sp-flt spt-y (meters 2.5)) @@ -1399,8 +1347,7 @@ ;; failed to figure out what this is: (defpart 1258 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.033 1.2 1.0) (sp-rnd-flt spt-x (meters -12) (meters 1) 1.0) (sp-flt spt-y (meters 50.5)) @@ -1428,8 +1375,7 @@ ;; failed to figure out what this is: (defpart 1259 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -12) (meters 1) 1.0) (sp-flt spt-y (meters 50.5)) @@ -1457,8 +1403,7 @@ ;; failed to figure out what this is: (defpart 1260 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.2 1.0) (sp-rnd-flt spt-x (meters -12) (meters 1) 1.0) (sp-flt spt-y (meters 50.5)) @@ -1487,8 +1432,7 @@ ;; failed to figure out what this is: (defpart 1261 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.33 1.2 1.0) (sp-rnd-flt spt-x (meters -2) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 23.5) (meters 6) 1.0) @@ -1516,8 +1460,7 @@ ;; failed to figure out what this is: (defpart 1262 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -2) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 25.5) (meters 4) 1.0) @@ -1545,8 +1488,7 @@ ;; failed to figure out what this is: (defpart 1263 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.5 1.0) (sp-rnd-flt spt-x (meters -2) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 22.5) (meters 7) 1.0) @@ -1578,8 +1520,7 @@ :id 281 :flags (always-draw) :bounds (static-bspherem 0 22 0 35) - :parts - ((sp-item 1267) + :parts ((sp-item 1267) (sp-item 1267 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1267 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 1268) @@ -1603,8 +1544,7 @@ ;; failed to figure out what this is: (defpart 1267 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.4 1.0 1.0) (sp-flt spt-x (meters -7.5)) (sp-rnd-flt spt-y (meters 48) (meters 0.5) 1.0) @@ -1632,8 +1572,7 @@ ;; failed to figure out what this is: (defpart 1268 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.03 1.0 1.0) (sp-flt spt-x (meters -7.5)) (sp-rnd-flt spt-y (meters 48) (meters 0.5) 1.0) @@ -1661,8 +1600,7 @@ ;; failed to figure out what this is: (defpart 1269 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.3) (sp-flt spt-x (meters -7.5)) (sp-rnd-flt spt-y (meters 48) (meters 0.5) 1.0) @@ -1690,8 +1628,7 @@ ;; failed to figure out what this is: (defpart 1270 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.7) (sp-flt spt-x (meters -7.5)) (sp-rnd-flt spt-y (meters 48) (meters 0.5) 1.0) @@ -1719,8 +1656,7 @@ ;; failed to figure out what this is: (defpart 1271 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.1 1.0) (sp-flt spt-x (meters -7)) (sp-rnd-flt spt-y (meters 47.5) (meters 0.5) 1.0) @@ -1750,8 +1686,7 @@ ;; failed to figure out what this is: (defpart 1272 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 0.06 1.0) (sp-flt spt-x (meters -7)) (sp-rnd-flt spt-y (meters 47.5) (meters 0.5) 1.0) @@ -1780,8 +1715,7 @@ ;; failed to figure out what this is: (defpart 1273 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-flt spt-x (meters -1.5)) (sp-rnd-flt spt-y (meters 33) (meters 1.5) 1.0) @@ -1811,8 +1745,7 @@ ;; failed to figure out what this is: (defpart 1274 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -1.5)) (sp-rnd-flt spt-y (meters 33) (meters 1.5) 1.0) @@ -1841,8 +1774,7 @@ ;; failed to figure out what this is: (defpart 1275 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-flt spt-x (meters -1.5)) (sp-rnd-flt spt-y (meters 33) (meters 1.5) 1.0) @@ -1873,8 +1805,7 @@ ;; failed to figure out what this is: (defpart 1276 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters 2.5) (meters 12) 1.0) (sp-flt spt-y (meters 7)) @@ -1903,8 +1834,7 @@ ;; failed to figure out what this is: (defpart 1277 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.05) (sp-rnd-flt spt-x (meters 3.5) (meters 10) 1.0) (sp-flt spt-y (meters 2.5)) @@ -1931,8 +1861,7 @@ :id 282 :flags (always-draw) :bounds (static-bspherem -15 17 -10 40) - :parts - ((sp-item 1278) + :parts ((sp-item 1278) (sp-item 1278 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1278 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 1279 :fade-after (meters 80) :falloff-to (meters 80)) @@ -1995,8 +1924,7 @@ ;; failed to figure out what this is: (defpart 1278 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters -15) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2025,8 +1953,7 @@ ;; failed to figure out what this is: (defpart 1281 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.15 0.075 1.0) (sp-rnd-flt spt-x (meters -18) (meters 4) 1.0) (sp-flt spt-y (meters 42.5)) @@ -2055,8 +1982,7 @@ ;; failed to figure out what this is: (defpart 1284 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.15 0.075 1.0) (sp-rnd-flt spt-x (meters -20) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2085,8 +2011,7 @@ ;; failed to figure out what this is: (defpart 1279 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters -15) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2114,8 +2039,7 @@ ;; failed to figure out what this is: (defpart 1282 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.375) (sp-rnd-flt spt-x (meters -18) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2143,8 +2067,7 @@ ;; failed to figure out what this is: (defpart 1285 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.375) (sp-rnd-flt spt-x (meters -20) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2172,8 +2095,7 @@ ;; failed to figure out what this is: (defpart 1280 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.375 0.3 1.0) (sp-rnd-flt spt-x (meters -15) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2203,8 +2125,7 @@ ;; failed to figure out what this is: (defpart 1283 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.225 0.15 1.0) (sp-rnd-flt spt-x (meters -18) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2234,8 +2155,7 @@ ;; failed to figure out what this is: (defpart 1286 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.225 0.15 1.0) (sp-rnd-flt spt-x (meters -20) (meters 4) 1.0) (sp-flt spt-y (meters 43.5)) @@ -2265,8 +2185,7 @@ ;; failed to figure out what this is: (defpart 1287 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.3 0.6 1.0) (sp-rnd-flt spt-x (meters 26) (meters 4) 1.0) (sp-flt spt-y (meters 4.5)) @@ -2295,8 +2214,7 @@ ;; failed to figure out what this is: (defpart 1290 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.15 0.3 1.0) (sp-rnd-flt spt-x (meters 33) (meters 4) 1.0) (sp-flt spt-y (meters -1)) @@ -2325,8 +2243,7 @@ ;; failed to figure out what this is: (defpart 1288 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters 26) (meters 4) 1.0) (sp-flt spt-y (meters 4.5)) @@ -2354,8 +2271,7 @@ ;; failed to figure out what this is: (defpart 1291 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters 33) (meters 4) 1.0) (sp-flt spt-y (meters -1)) @@ -2383,8 +2299,7 @@ ;; failed to figure out what this is: (defpart 1289 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.375 0.3 1.0) (sp-rnd-flt spt-x (meters 26) (meters 4) 1.0) (sp-flt spt-y (meters 4.5)) @@ -2414,8 +2329,7 @@ ;; failed to figure out what this is: (defpart 1292 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.375 0.3 1.0) (sp-rnd-flt spt-x (meters 33) (meters 4) 1.0) (sp-flt spt-y (meters -1)) @@ -2445,8 +2359,7 @@ ;; failed to figure out what this is: (defpart 1293 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.3 0.6 1.0) (sp-rnd-flt spt-x (meters 24) (meters 4) 1.0) (sp-flt spt-y (meters 4.5)) @@ -2475,8 +2388,7 @@ ;; failed to figure out what this is: (defpart 1294 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters 24) (meters 4) 1.0) (sp-flt spt-y (meters 4.5)) @@ -2504,8 +2416,7 @@ ;; failed to figure out what this is: (defpart 1295 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.375 0.3 1.0) (sp-rnd-flt spt-x (meters 24) (meters 4) 1.0) (sp-flt spt-y (meters 4.5)) @@ -2535,8 +2446,7 @@ ;; failed to figure out what this is: (defpart 1296 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.45 0.75 1.0) (sp-rnd-flt spt-x (meters 38) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 1.5) 1.0) @@ -2565,8 +2475,7 @@ ;; failed to figure out what this is: (defpart 1297 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.75) (sp-rnd-flt spt-x (meters 38) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 1.5) 1.0) @@ -2594,8 +2503,7 @@ ;; failed to figure out what this is: (defpart 1300 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 0.325) (sp-rnd-flt spt-x (meters 45) (meters 4) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 1.5) 1.0) @@ -2623,8 +2531,7 @@ ;; failed to figure out what this is: (defpart 1298 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.375 0.3 1.0) (sp-rnd-flt spt-x (meters 38) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 1.5) 1.0) @@ -2654,8 +2561,7 @@ ;; failed to figure out what this is: (defpart 1301 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.15 0.225 1.0) (sp-rnd-flt spt-x (meters 45) (meters 4) 1.0) (sp-rnd-flt spt-y (meters -1) (meters 1.5) 1.0) @@ -2683,8 +2589,7 @@ ;; failed to figure out what this is: (defpart 1302 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.15 0.45 1.0) (sp-flt spt-x (meters -30)) (sp-rnd-flt spt-y (meters 3.5) (meters 2) 1.0) @@ -2713,8 +2618,7 @@ ;; failed to figure out what this is: (defpart 1303 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.15 0.4 1.0) (sp-flt spt-x (meters -24)) (sp-rnd-flt spt-y (meters 3.5) (meters 2) 1.0) @@ -2743,8 +2647,7 @@ ;; failed to figure out what this is: (defpart 1304 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x18 :page #x2)) (sp-rnd-flt spt-num 0.15 0.4 1.0) (sp-flt spt-x (meters -26)) (sp-rnd-flt spt-y (meters 3.5) (meters 2) 1.0) @@ -2773,8 +2676,7 @@ ;; failed to figure out what this is: (defpart 1305 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.0375 0.0375 1.0) (sp-rnd-flt spt-x (meters -9) (meters 4) 1.0) (sp-flt spt-y (meters -2)) @@ -2803,8 +2705,7 @@ ;; failed to figure out what this is: (defpart 1307 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.075 0.015 1.0) (sp-rnd-flt spt-x (meters -45) (meters 12) 1.0) (sp-flt spt-y (meters -2)) @@ -2833,8 +2734,7 @@ ;; failed to figure out what this is: (defpart 1309 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #x2)) (sp-rnd-flt spt-num 0.075 0.015 1.0) (sp-rnd-flt spt-x (meters -49) (meters 6) 1.0) (sp-flt spt-y (meters -2)) @@ -2863,8 +2763,7 @@ ;; failed to figure out what this is: (defpart 1306 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.00625) (sp-rnd-flt spt-x (meters -9) (meters 4) 1.0) (sp-flt spt-y (meters -6)) @@ -2888,8 +2787,7 @@ ;; failed to figure out what this is: (defpart 1308 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.0375) (sp-rnd-flt spt-x (meters -44) (meters 10) 1.0) (sp-flt spt-y (meters -6)) @@ -2913,8 +2811,7 @@ ;; failed to figure out what this is: (defpart 1310 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) (sp-flt spt-num 0.00625) (sp-rnd-flt spt-x (meters -45) (meters 4) 1.0) (sp-flt spt-y (meters -6)) @@ -2940,8 +2837,7 @@ (defpartgroup group-village2-sagehut-warpgate :id 283 :bounds (static-bspherem 7 4 -4.5 12) - :parts - ((sp-item 1313 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1313 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1314 :fade-after (meters 60) :falloff-to (meters 100) :binding 1311) (sp-item 1311 :flags (bit1 start-dead launch-asap)) (sp-item 1311 :flags (bit1 start-dead launch-asap)) @@ -3121,8 +3017,7 @@ ;; failed to figure out what this is: (defpart 1315 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters -2)) (sp-flt spt-scale-x (meters 0.25)) @@ -3138,8 +3033,7 @@ ;; failed to figure out what this is: (defpart 1312 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 1.0 0.2 1.0) (sp-flt spt-x (meters 4.4444447)) (sp-flt spt-y (meters 4)) @@ -3163,8 +3057,7 @@ ;; failed to figure out what this is: (defpart 1313 - :init-specs - ((sp-rnd-flt spt-num 3.0 3.0 1.0) + :init-specs ((sp-rnd-flt spt-num 3.0 3.0 1.0) (sp-flt spt-x (meters -0.5)) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) @@ -3182,8 +3075,7 @@ ;; failed to figure out what this is: (defpart 1314 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.2 1.0 1.0) (sp-flt spt-scale-x (meters 0.25)) (sp-copy-from-other spt-scale-y -4) @@ -3197,8 +3089,7 @@ ;; failed to figure out what this is: (defpart 1311 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.4 1.0) (sp-flt spt-x (meters 4.4444447)) (sp-flt spt-y (meters 4)) @@ -3225,8 +3116,7 @@ (defpartgroup group-village2-tree-fire :id 284 :bounds (static-bspherem 0 10 0 12) - :parts - ((sp-item 1316 :fade-after (meters 120) :falloff-to (meters 120)) + :parts ((sp-item 1316 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1317 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1318 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 1319 :fade-after (meters 120) :falloff-to (meters 120)) @@ -3235,8 +3125,7 @@ ;; failed to figure out what this is: (defpart 1316 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-x (meters 2.2) (meters 0.5) 1.0) (sp-flt spt-y (meters -0.9)) @@ -3267,14 +3156,12 @@ ;; failed to figure out what this is: (defpart 1320 - :init-specs - ((sp-flt spt-fade-a -0.53333336)) + :init-specs ((sp-flt spt-fade-a -0.53333336)) ) ;; failed to figure out what this is: (defpart 1317 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.1 1.0 1.0) (sp-rnd-flt spt-x (meters -0.6) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.2) (meters 0.5) 1.0) @@ -3304,8 +3191,7 @@ ;; failed to figure out what this is: (defpart 1318 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.2 1.0) (sp-rnd-flt spt-x (meters -0.6) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.2) (meters 0.5) 1.0) @@ -3337,8 +3223,7 @@ ;; failed to figure out what this is: (defpart 1319 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.2 1.0) (sp-rnd-flt spt-x (meters -0.6) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters -0.2) (meters 0.5) 1.0) diff --git a/test/decompiler/reference/levels/village2/village2-part_REF.gc b/test/decompiler/reference/levels/village2/village2-part_REF.gc index 5ab8a160fe..1973c09dbe 100644 --- a/test/decompiler/reference/levels/village2/village2-part_REF.gc +++ b/test/decompiler/reference/levels/village2/village2-part_REF.gc @@ -22,8 +22,7 @@ (defpartgroup group-village2-moth :id 264 :bounds (static-bspherem 0 0 0 3) - :parts - ((sp-item 1129 :fade-after (meters 120) :flags (bit1) :period 18030 :length 5 :binding 1127) + :parts ((sp-item 1129 :fade-after (meters 120) :flags (bit1) :period 18030 :length 5 :binding 1127) (sp-item 1127 :flags (start-dead launch-asap) :binding 1128) (sp-item 1128 :flags (is-3d start-dead)) ) @@ -31,8 +30,7 @@ ;; failed to figure out what this is: (defpart 1129 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 0.1)) (sp-copy-from-other spt-scale-y -4) @@ -46,8 +44,7 @@ ;; failed to figure out what this is: (defpart 1127 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-flt spt-z (meters 1.5)) @@ -71,8 +68,7 @@ ;; failed to figure out what this is: (defpart 1130 - :init-specs - ((sp-rnd-flt spt-vel-x (meters -0.035555556) (meters 0.07111111) 1.0) + :init-specs ((sp-rnd-flt spt-vel-x (meters -0.035555556) (meters 0.07111111) 1.0) (sp-rnd-flt spt-vel-y (meters -0.0148148155) (meters 0.029629631) 1.0) (sp-rnd-flt spt-rotvel-z (degrees -0.4) (degrees 0.8) 1.0) (sp-int-plain-rnd spt-next-time 150 449 1) @@ -82,8 +78,7 @@ ;; failed to figure out what this is: (defpart 1128 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 2.0) (sp-flt spt-scale-x (meters 0.4)) @@ -102,8 +97,7 @@ (defpartgroup group-village2-tableflys :id 265 :bounds (static-bspherem 0 3 0 10) - :parts - ((sp-item 1133 :flags (launch-asap) :binding 1131) + :parts ((sp-item 1133 :flags (launch-asap) :binding 1131) (sp-item 1134 :flags (launch-asap) :binding 1131) (sp-item 1135 :flags (launch-asap) :binding 1131) (sp-item 1131 :flags (start-dead launch-asap) :binding 1132) @@ -117,8 +111,7 @@ ;; failed to figure out what this is: (defpart 1133 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 0)) (sp-flt spt-y (meters 2)) @@ -135,14 +128,12 @@ ;; failed to figure out what this is: (defpart 1136 - :init-specs - ((sp-int spt-timer 300) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 1136)) + :init-specs ((sp-int spt-timer 300) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 1136)) ) ;; failed to figure out what this is: (defpart 1134 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters 4)) (sp-flt spt-y (meters 2)) @@ -159,8 +150,7 @@ ;; failed to figure out what this is: (defpart 1135 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -4)) (sp-flt spt-y (meters 2)) @@ -177,8 +167,7 @@ ;; failed to figure out what this is: (defpart 1131 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-int spt-num 1065353216 1 2.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-z (meters 1) (meters 1) 1.0) @@ -198,8 +187,7 @@ ;; failed to figure out what this is: (defpart 1132 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x22 :page #x2)) (sp-func spt-birth-func 'birth-func-copy-rot-color) (sp-flt spt-num 3.0) (sp-flt spt-scale-x (meters 0.15)) @@ -218,8 +206,7 @@ (defpartgroup group-village2-flamepot :id 266 :bounds (static-bspherem 0 5 0 6) - :parts - ((sp-item 1137 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1137 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1138 :fade-after (meters 40) :falloff-to (meters 40) :period 492 :length 60) (sp-item 1139 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1140 :fade-after (meters 40) :falloff-to (meters 40) :period 369 :length 219) @@ -234,8 +221,7 @@ (defpartgroup group-village2-flamepot-half :id 267 :bounds (static-bspherem 0 5 0 6) - :parts - ((sp-item 1145 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1145 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1146 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1147 :fade-after (meters 50) :falloff-to (meters 60)) ) @@ -245,8 +231,7 @@ (defpartgroup group-village2-flamepot-alt1 :id 268 :bounds (static-bspherem 0 5 0 6) - :parts - ((sp-item 1137 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1137 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1138 :fade-after (meters 40) :falloff-to (meters 40) :period 378 :length 60) (sp-item 1139 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1140 :fade-after (meters 40) :falloff-to (meters 40) :period 435 :length 219) @@ -261,8 +246,7 @@ (defpartgroup group-village2-flamepot-alt2 :id 269 :bounds (static-bspherem 0 5 0 6) - :parts - ((sp-item 1137 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1137 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1138 :fade-after (meters 40) :falloff-to (meters 40) :period 609 :length 60) (sp-item 1139 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1140 :fade-after (meters 40) :falloff-to (meters 40) :period 288 :length 219) @@ -277,14 +261,12 @@ (defpartgroup group-village2-flamepot-off :id 270 :bounds (static-bspherem 0 5 0 6) - :parts - ((sp-item 1148 :fade-after (meters 100) :falloff-to (meters 100))) + :parts ((sp-item 1148 :fade-after (meters 100) :falloff-to (meters 100))) ) ;; failed to figure out what this is: (defpart 1144 - :init-specs - ((sp-flt spt-num 0.4) + :init-specs ((sp-flt spt-num 0.4) (sp-flt spt-x (meters 1)) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) @@ -302,14 +284,12 @@ ;; failed to figure out what this is: (defpart 1149 - :init-specs - ((sp-flt spt-fade-b -5.4613333)) + :init-specs ((sp-flt spt-fade-b -5.4613333)) ) ;; failed to figure out what this is: (defpart 1147 - :init-specs - ((sp-flt spt-num 0.15) + :init-specs ((sp-flt spt-num 0.15) (sp-flt spt-x (meters 0.4)) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) @@ -326,14 +306,12 @@ ;; failed to figure out what this is: (defpart 1150 - :init-specs - ((sp-flt spt-fade-b -3.4133334)) + :init-specs ((sp-flt spt-fade-b -3.4133334)) ) ;; failed to figure out what this is: (defpart 1137 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.5 0.4 1.0) (sp-rnd-flt spt-x (meters -0.25) (meters 0.75) 1.0) (sp-flt spt-y (meters -0.25)) @@ -361,8 +339,7 @@ ;; failed to figure out what this is: (defpart 1145 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.35 0.25 1.0) (sp-rnd-flt spt-x (meters -0.1) (meters 0.1) 1.0) (sp-flt spt-y (meters -0.25)) @@ -390,8 +367,7 @@ ;; failed to figure out what this is: (defpart 1138 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1060320051 1 1.0) (sp-rnd-flt spt-x (meters 0) (meters 0.5) 1.0) (sp-flt spt-y (meters -0.25)) @@ -419,8 +395,7 @@ ;; failed to figure out what this is: (defpart 1139 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.15 0.2 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters -0.25)) @@ -450,8 +425,7 @@ ;; failed to figure out what this is: (defpart 1146 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.06 0.06 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters -0.25)) @@ -481,8 +455,7 @@ ;; failed to figure out what this is: (defpart 1148 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.08 0.1 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-flt spt-y (meters -0.25)) @@ -512,8 +485,7 @@ ;; failed to figure out what this is: (defpart 1151 - :init-specs - ((sp-flt spt-fade-g 0.53333336) + :init-specs ((sp-flt spt-fade-g 0.53333336) (sp-flt spt-fade-b 1.0666667) (sp-int spt-next-time 120) (sp-launcher-by-id spt-next-launcher 1152) @@ -522,14 +494,12 @@ ;; failed to figure out what this is: (defpart 1152 - :init-specs - ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: (defpart 1140 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.4 0.55 1.0) (sp-rnd-flt spt-x (meters -0.6) (meters 1.2) 1.0) (sp-flt spt-y (meters -0.25)) @@ -557,8 +527,7 @@ ;; failed to figure out what this is: (defpart 1141 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1031127695 1 0.9) (sp-rnd-flt spt-x (meters -0.6) (meters 0.5) 1.0) (sp-flt spt-y (meters 0.75)) @@ -586,8 +555,7 @@ ;; failed to figure out what this is: (defpart 1142 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.6 0.9 1.0) (sp-rnd-flt spt-x (meters -0.6) (meters 1.2) 1.0) (sp-flt spt-y (meters -0.25)) @@ -615,8 +583,7 @@ ;; failed to figure out what this is: (defpart 1143 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1060320051 1 1.5) (sp-rnd-flt spt-x (meters -0.25) (meters 0.75) 1.0) (sp-flt spt-y (meters 0.75)) @@ -646,8 +613,7 @@ (defpartgroup group-village2-fireboulder-off :id 634 :bounds (static-bspherem 0 4 0 10.5) - :parts - ((sp-item 1169 :fade-after (meters 80) :falloff-to (meters 100)) + :parts ((sp-item 1169 :fade-after (meters 80) :falloff-to (meters 100)) (sp-item 1170 :fade-after (meters 80) :falloff-to (meters 100)) ) ) @@ -657,8 +623,7 @@ :id 271 :duration 18000 :bounds (static-bspherem 0 4 0 10.5) - :parts - ((sp-item 1153 :fade-after (meters 200) :falloff-to (meters 240)) + :parts ((sp-item 1153 :fade-after (meters 200) :falloff-to (meters 240)) (sp-item 1154 :fade-after (meters 100) :falloff-to (meters 120) :period 300 :length 60) (sp-item 1155 :fade-after (meters 80) :falloff-to (meters 100)) (sp-item 1156 :fade-after (meters 50) :falloff-to (meters 50)) @@ -681,8 +646,7 @@ ;; failed to figure out what this is: (defpart 1156 - :init-specs - ((sp-flt spt-num 0.15) + :init-specs ((sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters 1.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 6) (meters 1) 1.0) (sp-rnd-flt spt-z (meters 0.5) (meters 2.5) 1.0) @@ -702,14 +666,12 @@ ;; failed to figure out what this is: (defpart 1171 - :init-specs - ((sp-flt spt-fade-b 13.653334)) + :init-specs ((sp-flt spt-fade-b 13.653334)) ) ;; failed to figure out what this is: (defpart 1160 - :init-specs - ((sp-flt spt-num 0.15) + :init-specs ((sp-flt spt-num 0.15) (sp-rnd-flt spt-x (meters -3.5) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters 5.5) (meters 1) 1.0) (sp-rnd-flt spt-z (meters -1) (meters 1) 1.0) @@ -729,8 +691,7 @@ ;; failed to figure out what this is: (defpart 1164 - :init-specs - ((sp-flt spt-num 0.15) + :init-specs ((sp-flt spt-num 0.15) (sp-flt spt-x (meters 2.7)) (sp-rnd-flt spt-y (meters 4) (meters 1) 1.0) (sp-rnd-flt spt-z (meters -3) (meters 2) 1.0) @@ -750,8 +711,7 @@ ;; failed to figure out what this is: (defpart 1153 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.7 1.2 1.0) (sp-rnd-flt spt-x (meters 1.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 5) (meters 1) 1.0) @@ -778,8 +738,7 @@ ;; failed to figure out what this is: (defpart 1154 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1058642330 1 1.7) (sp-rnd-flt spt-x (meters 1.5) (meters 0.7) 1.0) (sp-rnd-flt spt-y (meters 6) (meters 0.6) 1.0) @@ -806,8 +765,7 @@ ;; failed to figure out what this is: (defpart 1155 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.05 0.2 1.0) (sp-rnd-flt spt-x (meters 1.5) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 6) (meters 1) 1.0) @@ -837,8 +795,7 @@ ;; failed to figure out what this is: (defpart 1172 - :init-specs - ((sp-flt spt-fade-g 0.53333336) + :init-specs ((sp-flt spt-fade-g 0.53333336) (sp-flt spt-fade-b 1.0666667) (sp-int spt-next-time 120) (sp-launcher-by-id spt-next-launcher 1173) @@ -847,14 +804,12 @@ ;; failed to figure out what this is: (defpart 1173 - :init-specs - ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: (defpart 1157 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.65 1.2 1.0) (sp-rnd-flt spt-x (meters -3.5) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters 4.5) (meters 1) 1.0) @@ -882,8 +837,7 @@ ;; failed to figure out what this is: (defpart 1158 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1056964608 1 1.2) (sp-rnd-flt spt-x (meters -3.5) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters 4.5) (meters 1) 1.0) @@ -911,8 +865,7 @@ ;; failed to figure out what this is: (defpart 1159 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.08 0.25 1.0) (sp-rnd-flt spt-x (meters -3.5) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters 5.5) (meters 1) 1.0) @@ -943,8 +896,7 @@ ;; failed to figure out what this is: (defpart 1161 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.7 1.5 1.0) (sp-flt spt-x (meters 2.7)) (sp-rnd-flt spt-y (meters 3) (meters 1) 1.0) @@ -972,8 +924,7 @@ ;; failed to figure out what this is: (defpart 1162 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1058642330 1 1.4) (sp-flt spt-x (meters 2.7)) (sp-rnd-flt spt-y (meters 3) (meters 1) 1.0) @@ -1001,8 +952,7 @@ ;; failed to figure out what this is: (defpart 1163 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.08 0.25 1.0) (sp-flt spt-x (meters 2.7)) (sp-rnd-flt spt-y (meters 4) (meters 1) 1.0) @@ -1033,8 +983,7 @@ ;; failed to figure out what this is: (defpart 1165 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.65 1.5 1.0) (sp-rnd-flt spt-x (meters -3) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 1) 1.0) @@ -1062,8 +1011,7 @@ ;; failed to figure out what this is: (defpart 1166 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-int spt-num 1059481190 1 1.5) (sp-rnd-flt spt-x (meters -3) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 1) 1.0) @@ -1091,8 +1039,7 @@ ;; failed to figure out what this is: (defpart 1167 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.08 0.25 1.0) (sp-rnd-flt spt-x (meters -3) (meters 1) 1.0) (sp-rnd-flt spt-y (meters 5) (meters 1) 1.0) @@ -1123,8 +1070,7 @@ ;; failed to figure out what this is: (defpart 1168 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.1 0.4 1.0) (sp-rnd-flt spt-x (meters 1.5) (meters 1) 1.0) (sp-flt spt-y (meters -0.5)) @@ -1153,8 +1099,7 @@ ;; failed to figure out what this is: (defpart 1169 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.15 0.15 1.0) (sp-flt spt-y (meters 4)) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.2) 1.0) @@ -1184,8 +1129,7 @@ ;; failed to figure out what this is: (defpart 1174 - :init-specs - ((sp-flt spt-vel-y (meters 0.013333334)) + :init-specs ((sp-flt spt-vel-y (meters 0.013333334)) (sp-flt spt-fade-a 0.0) (sp-flt spt-accel-y -0.00040000002) (sp-int spt-next-time 300) @@ -1195,14 +1139,12 @@ ;; failed to figure out what this is: (defpart 1175 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.10666667)) ) ;; failed to figure out what this is: (defpart 1170 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.15 0.3 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 2.5) (meters 1.2) 1.0) @@ -1231,14 +1173,12 @@ ;; failed to figure out what this is: (defpart 1176 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 600) (sp-launcher-by-id spt-next-launcher 1177)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 600) (sp-launcher-by-id spt-next-launcher 1177)) ) ;; failed to figure out what this is: (defpart 1177 - :init-specs - ((sp-flt spt-vel-x (meters 0)) + :init-specs ((sp-flt spt-vel-x (meters 0)) (sp-flt spt-vel-y (meters 0.011666667)) (sp-flt spt-vel-z (meters 0)) (sp-flt spt-scalevel-x (meters 0.0016666667)) @@ -1256,8 +1196,7 @@ (defpartgroup group-village2-window-flames-45 :id 272 :bounds (static-bspherem 8 -8 0 36) - :parts - ((sp-item 1178 :fade-after (meters 300)) + :parts ((sp-item 1178 :fade-after (meters 300)) (sp-item 1179 :fade-after (meters 300)) (sp-item 1179 :fade-after (meters 180)) (sp-item 1180 :fade-after (meters 200) :period 2160 :length 5) @@ -1272,8 +1211,7 @@ ;; failed to figure out what this is: (defpart 1178 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.015 0.035 1.0) (sp-rnd-flt spt-x (meters 4) (meters 12) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 8) 1.0) @@ -1300,8 +1238,7 @@ ;; failed to figure out what this is: (defpart 1183 - :init-specs - ((sp-flt spt-fade-a 0.0) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int-plain-rnd spt-next-time 300 299 1) (sp-launcher-by-id spt-next-launcher 1184) ) @@ -1309,14 +1246,12 @@ ;; failed to figure out what this is: (defpart 1184 - :init-specs - ((sp-flt spt-fade-a -0.08)) + :init-specs ((sp-flt spt-fade-a -0.08)) ) ;; failed to figure out what this is: (defpart 1179 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.4 1.0) (sp-rnd-flt spt-x (meters 10) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 6) 1.0) @@ -1343,14 +1278,12 @@ ;; failed to figure out what this is: (defpart 1185 - :init-specs - ((sp-flt spt-fade-a -0.85333335)) + :init-specs ((sp-flt spt-fade-a -0.85333335)) ) ;; failed to figure out what this is: (defpart 1180 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.8 0.4 1.0) (sp-rnd-flt spt-x (meters 10) (meters 4) 1.0) (sp-flt spt-y (meters 6)) @@ -1375,8 +1308,7 @@ ;; failed to figure out what this is: (defpart 1181 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.015 0.03 1.0) (sp-rnd-flt spt-x (meters -6) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 8) (meters 8) 1.0) @@ -1403,8 +1335,7 @@ ;; failed to figure out what this is: (defpart 1182 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters 2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 6) 1.0) @@ -1433,8 +1364,7 @@ (defpartgroup group-village2-window-flames-41 :id 273 :bounds (static-bspherem 8 -8 0 36) - :parts - ((sp-item 1186 :fade-after (meters 300)) + :parts ((sp-item 1186 :fade-after (meters 300)) (sp-item 1187 :fade-after (meters 300)) (sp-item 1187 :fade-after (meters 180)) (sp-item 1188 :fade-after (meters 200) :period 2160 :length 5) @@ -1449,8 +1379,7 @@ ;; failed to figure out what this is: (defpart 1186 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.015 0.03 1.0) (sp-rnd-flt spt-x (meters 6) (meters 12) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 8) 1.0) @@ -1477,8 +1406,7 @@ ;; failed to figure out what this is: (defpart 1187 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.4 1.0) (sp-rnd-flt spt-x (meters 10) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 6) 1.0) @@ -1505,8 +1433,7 @@ ;; failed to figure out what this is: (defpart 1188 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.8 0.4 1.0) (sp-rnd-flt spt-x (meters 10) (meters 4) 1.0) (sp-flt spt-y (meters 6)) @@ -1531,8 +1458,7 @@ ;; failed to figure out what this is: (defpart 1189 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.015 0.03 1.0) (sp-rnd-flt spt-x (meters -2) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 8) (meters 8) 1.0) @@ -1559,8 +1485,7 @@ ;; failed to figure out what this is: (defpart 1190 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.3 0.3 1.0) (sp-rnd-flt spt-x (meters 6) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 4) (meters 6) 1.0) @@ -1589,8 +1514,7 @@ (defpartgroup group-village2-big-boulder :id 274 :bounds (static-bspherem 8 -8 0 36) - :parts - ((sp-item 1191 :fade-after (meters 300)) + :parts ((sp-item 1191 :fade-after (meters 300)) (sp-item 1192 :fade-after (meters 300)) (sp-item 1192 :fade-after (meters 180)) ) @@ -1598,8 +1522,7 @@ ;; failed to figure out what this is: (defpart 1191 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.015 0.03 1.0) (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0) (sp-rnd-flt spt-y (meters 8) (meters 4) 1.0) @@ -1626,8 +1549,7 @@ ;; failed to figure out what this is: (defpart 1192 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.4 0.4 1.0) (sp-flt spt-x (meters 2)) (sp-flt spt-y (meters 4)) @@ -1658,8 +1580,7 @@ (defpartgroup group-village2-sages-controlpanel :id 275 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1193 :fade-after (meters 30) :period 736 :length 10) + :parts ((sp-item 1193 :fade-after (meters 30) :period 736 :length 10) (sp-item 1193 :fade-after (meters 30) :period 1696 :length 10) (sp-item 1193 :fade-after (meters 30) :period 5079 :length 10) (sp-item 1194 :fade-after (meters 30) :period 5079 :length 10) @@ -1670,8 +1591,7 @@ ;; failed to figure out what this is: (defpart 1195 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.4 1.0) (sp-flt spt-x (meters 0.9)) (sp-flt spt-y (meters 0.25)) @@ -1700,8 +1620,7 @@ ;; failed to figure out what this is: (defpart 1196 - :init-specs - ((sp-flt spt-fade-r -0.053333335) + :init-specs ((sp-flt spt-fade-r -0.053333335) (sp-flt spt-fade-g -0.053333335) (sp-flt spt-fade-b -0.053333335) (sp-flt spt-fade-a -0.10666667) @@ -1710,12 +1629,9 @@ ;; failed to figure out what this is: (defpart 1193 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 16.0 1.0) - (sp-sound - (new 'static 'sound-spec :mask #x1 :num 0.1 :group #x1 :sound-name (static-sound-name "spark") :volume #x400) - ) + (sp-sound (static-sound-spec "spark" :num 0.1 :volume 100.0)) (sp-flt spt-x (meters 0.9)) (sp-flt spt-y (meters 0.05)) (sp-flt spt-z (meters -0.9)) @@ -1742,12 +1658,9 @@ ;; failed to figure out what this is: (defpart 1194 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 4.0 16.0 1.0) - (sp-sound - (new 'static 'sound-spec :mask #x1 :num 0.1 :group #x1 :sound-name (static-sound-name "spark") :volume #x400) - ) + (sp-sound (static-sound-spec "spark" :num 0.1 :volume 100.0)) (sp-flt spt-x (meters -1.2)) (sp-flt spt-y (meters -0.5)) (sp-flt spt-z (meters 1.2)) @@ -1776,8 +1689,7 @@ (defpartgroup group-village2-sages-machine :id 276 :bounds (static-bspherem 0 0 0 8) - :parts - ((sp-item 1199 :fade-after (meters 40) :period 768 :length 10 :binding 1197) + :parts ((sp-item 1199 :fade-after (meters 40) :period 768 :length 10 :binding 1197) (sp-item 1199 :fade-after (meters 40) :period 1096 :length 10 :binding 1198) (sp-item 1199 :fade-after (meters 40) :period 2137 :length 10 :binding 1197) (sp-item 1197 :fade-after (meters 40) :flags (start-dead)) @@ -1796,8 +1708,7 @@ ;; failed to figure out what this is: (defpart 1201 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.5 1.0 1.0) (sp-flt spt-x (meters -0.75)) (sp-flt spt-y (meters -0.8)) @@ -1822,8 +1733,7 @@ ;; failed to figure out what this is: (defpart 1202 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-x (meters -0.75)) (sp-flt spt-y (meters -0.8)) @@ -1843,8 +1753,7 @@ ;; failed to figure out what this is: (defpart 1200 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) (sp-rnd-flt spt-num 1.0 0.5 1.0) (sp-flt spt-x (meters -0.7)) (sp-flt spt-y (meters -0.7)) @@ -1867,8 +1776,7 @@ ;; failed to figure out what this is: (defpart 1205 - :init-specs - ((sp-flt spt-r 64.0) + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) (sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g -1.0666667) @@ -1878,8 +1786,7 @@ ;; failed to figure out what this is: (defpart 1203 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.4 1.0) (sp-flt spt-x (meters -1.25)) (sp-flt spt-y (meters 0)) @@ -1908,8 +1815,7 @@ ;; failed to figure out what this is: (defpart 1206 - :init-specs - ((sp-flt spt-fade-r -0.053333335) + :init-specs ((sp-flt spt-fade-r -0.053333335) (sp-flt spt-fade-g -0.053333335) (sp-flt spt-fade-b -0.053333335) (sp-flt spt-fade-a -0.10666667) @@ -1919,8 +1825,7 @@ ;; failed to figure out what this is: (defpart 1204 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 0.2 0.8 1.0) (sp-flt spt-x (meters -0.7)) (sp-flt spt-y (meters -0.7)) @@ -1951,8 +1856,7 @@ ;; failed to figure out what this is: (defpart 1199 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-scale-x (meters 1)) (sp-copy-from-other spt-scale-y -4) @@ -1971,12 +1875,9 @@ ;; failed to figure out what this is: (defpart 1197 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 2.0 8.0 1.0) - (sp-sound - (new 'static 'sound-spec :mask #x1 :num 0.1 :group #x1 :sound-name (static-sound-name "spark") :volume #x400) - ) + (sp-sound (static-sound-spec "spark" :num 0.1 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) @@ -2000,12 +1901,9 @@ ;; failed to figure out what this is: (defpart 1198 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 2.0 6.0 1.0) - (sp-sound - (new 'static 'sound-spec :mask #x1 :num 0.1 :group #x1 :sound-name (static-sound-name "spark") :volume #x400) - ) + (sp-sound (static-sound-spec "spark" :num 0.1 :volume 100.0)) (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) (sp-copy-from-other spt-scale-y -4) (sp-rnd-flt spt-r 128.0 128.0 1.0) @@ -2030,8 +1928,7 @@ ;; failed to figure out what this is: (defpart 1207 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.0 3.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.075) (meters 0.075) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -2053,13 +1950,9 @@ (when (< (-> arg2 y) (-> arg1 user-float)) (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) - (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-2 (the-as number (logior #x3f800000 v1-1))) - ) - (if (< (+ -1.0 (the-as float v1-2)) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) - ) - ) + (if (< (rand-float-gen) 0.25) + (sound-play "water-drop") + ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var *sp-particle-system-2d* @@ -2080,8 +1973,7 @@ :duration 900 :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) - :parts - ((sp-item 2792 :fade-after (meters 100) :falloff-to (meters 100) :binding 2791) + :parts ((sp-item 2792 :fade-after (meters 100) :falloff-to (meters 100) :binding 2791) (sp-item 2791 :flags (bit1 start-dead launch-asap)) (sp-item 2791 :flags (bit1 start-dead launch-asap)) (sp-item 2791 :flags (bit1 start-dead launch-asap)) @@ -2129,8 +2021,7 @@ ;; failed to figure out what this is: (defpart 2795 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2)) (sp-rnd-flt spt-num 0.2 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 12.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -2150,8 +2041,7 @@ ;; failed to figure out what this is: (defpart 2794 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2)) (sp-rnd-flt spt-num 0.2 2.0 1.0) (sp-rnd-flt spt-scale-x (meters 12.5) (meters 3.5) 1.0) (sp-int spt-rot-x 4) @@ -2171,8 +2061,7 @@ ;; failed to figure out what this is: (defpart 2793 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -0.001) (meters 0.002) 1.0) (sp-rnd-flt spt-y (meters -0.001) (meters 0.002) 1.0) @@ -2194,8 +2083,7 @@ ;; failed to figure out what this is: (defpart 2792 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -2211,8 +2099,7 @@ ;; failed to figure out what this is: (defpart 2791 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) diff --git a/test/decompiler/reference/levels/village2/warrior_REF.gc b/test/decompiler/reference/levels/village2/warrior_REF.gc index 0a2d45c2b0..35e41bbba4 100644 --- a/test/decompiler/reference/levels/village2/warrior_REF.gc +++ b/test/decompiler/reference/levels/village2/warrior_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/warrior-ag.gc") + ;; definition of type warrior (deftype warrior (process-taskable) () @@ -19,14 +21,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *warrior-sg* warrior - 0 - 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 4 - ) +(defskelgroup *warrior-sg* warrior warrior-lod0-jg warrior-idle-ja + ((warrior-lod0-mg (meters 20)) (warrior-lod1-mg (meters 40)) (warrior-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow warrior-shadow-mg + ) ;; definition for method 52 of type warrior ;; INFO: Return type mismatch int vs none. @@ -55,14 +54,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -83,8 +82,7 @@ :name "warrior-introduction" :index 6 :parts 29 - :command-list - '((125 joint "cameraB") + :command-list '((125 joint "cameraB") (260 joint "camera") (574 joint "cameraB") (918 joint "camera") @@ -137,8 +135,7 @@ :name "warrior-resolution" :index 8 :parts 6 - :command-list - '((508 blackout 10) (511 blackout 0)) + :command-list '((508 blackout 10) (511 blackout 0)) ) ) (else @@ -164,8 +161,7 @@ ;; failed to figure out what this is: (defstate play-anim (warrior) :virtual #t - :exit - (behavior () + :exit (behavior () (send-event (-> (entity-by-type allpontoons) extra process) 'end-mode) ((-> (method-of-type process-taskable play-anim) exit)) (none) @@ -175,10 +171,7 @@ ;; definition for method 43 of type warrior (defmethod TODO-RENAME-43 warrior ((obj warrior)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 2) 61440.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.66 f0-2) (play-ambient (-> obj ambient) "WAR-LO1A" #f (-> obj root-override trans)) diff --git a/test/decompiler/reference/levels/village3/assistant-village3_REF.gc b/test/decompiler/reference/levels/village3/assistant-village3_REF.gc index f0c60cd2dc..b3d05604c7 100644 --- a/test/decompiler/reference/levels/village3/assistant-village3_REF.gc +++ b/test/decompiler/reference/levels/village3/assistant-village3_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/assistant-village3-ag.gc") + ;; definition of type assistant-villagec (deftype assistant-villagec (process-taskable) () @@ -19,14 +21,11 @@ ) ;; failed to figure out what this is: -(defskelgroup *assistant-village3-sg* assistant-village3 - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *assistant-village3-sg* assistant-village3 assistant-village3-lod0-jg assistant-village3-idle-ja + ((assistant-village3-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow assistant-village3-shadow-mg + ) ;; definition for method 52 of type assistant-villagec ;; INFO: Return type mismatch int vs none. @@ -55,14 +54,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -110,10 +109,7 @@ ;; definition for method 43 of type assistant-villagec (defmethod TODO-RENAME-43 assistant-villagec ((obj assistant-villagec)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) (play-ambient (-> obj ambient) "ASSTLP31" #f (-> obj root-override trans)) @@ -156,80 +152,40 @@ ;; failed to figure out what this is: (defstate idle (assistant-villagec) :virtual #t - :code - (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 15) + :code (behavior () + (if (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) ) - (while #t + (loop (TODO-RENAME-43 self) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) - (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1)) - ) - (set! (-> a0-8 param 1) 1.0) - (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!) - ) + (ja-no-eval :group! assistant-village3-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) - (set! (-> a0-9 param 1) 1.0) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) (let ((gp-0 (-> *display* base-frame-counter))) - (while (let* ((s5-0 (-> *display* base-frame-counter)) - (f30-0 300.0) - (f28-0 0.16) - (f26-0 0.17000002) - (v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-32 (the-as number (logior #x3f800000 v1-31))) - ) - (< (- s5-0 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-32)))))))) gp-0) + (while (let ((s5-0 (-> *display* base-frame-counter)) + (f30-0 300.0) + (f28-0 0.16) + (f26-0 0.17000002) + ) + (< (- s5-0 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (rand-float-gen))))))) gp-0) ) (suspend) ) ) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> gp-1 param 0) (ja-aframe 0.0 0)) - (set! (-> gp-1 param 1) 1.0) - (set! (-> gp-1 frame-num) (ja-aframe 16.0 0)) - (joint-control-channel-group! - gp-1 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 0.0 0)) :frame-num (ja-aframe 16.0 0)) (until (ja-done? 0) (suspend) - (let ((gp-2 (-> self skel root-channel 0))) - (set! (-> gp-2 param 0) (ja-aframe 0.0 0)) - (set! (-> gp-2 param 1) 1.0) - (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 0.0 0))) ) (let ((gp-3 (-> *display* base-frame-counter))) - (while (let* ((s5-1 (-> *display* base-frame-counter)) - (f30-1 300.0) - (f28-1 0.16) - (f26-1 0.17000002) - (v1-56 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-57 (the-as number (logior #x3f800000 v1-56))) - ) - (< (- s5-1 (the-as time-frame (the int (* f30-1 (+ f28-1 (* f26-1 (+ -1.0 (the-as float v1-57)))))))) gp-3) + (while (let ((s5-1 (-> *display* base-frame-counter)) + (f30-1 300.0) + (f28-1 0.16) + (f26-1 0.17000002) + ) + (< (- s5-1 (the-as time-frame (the int (* f30-1 (+ f28-1 (* f26-1 (rand-float-gen))))))) gp-3) ) (suspend) ) diff --git a/test/decompiler/reference/levels/village3/minecart_REF.gc b/test/decompiler/reference/levels/village3/minecart_REF.gc index 1e5fc1c1f7..17e0ad74a5 100644 --- a/test/decompiler/reference/levels/village3/minecart_REF.gc +++ b/test/decompiler/reference/levels/village3/minecart_REF.gc @@ -1,14 +1,16 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/minecartsteel-ag.gc") + ;; failed to figure out what this is: -(defskelgroup *minecartsteel-sg* minecartsteel - 0 - 4 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *minecartsteel-sg* minecartsteel minecartsteel-lod0-jg minecartsteel-idle-ja + ((minecartsteel-lod0-mg (meters 20)) + (minecartsteel-lod1-mg (meters 40)) + (minecartsteel-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 4) + ) ;; definition of type minecartsteel (deftype minecartsteel (process-drawable) @@ -40,14 +42,13 @@ ;; failed to figure out what this is: (defstate idle (minecartsteel) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) (when (= (-> arg0 type) target) (let ((a2-1 (new 'stack 'collide-overlap-result))) (if (not (on-platform (-> self root-override) (-> *target* control) a2-1)) - (send-event arg0 'no-look-around 450) + (send-event arg0 'no-look-around (seconds 1.5)) ) ) ) @@ -56,31 +57,14 @@ ) ) ) - :trans - (the-as (function none :behavior minecartsteel) rider-trans) - :code - (behavior () + :trans (the-as (function none :behavior minecartsteel) rider-trans) + :code (behavior () (ja-channel-set! 1) - (let ((v1-2 (-> self skel root-channel 0))) - (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self anim))) - ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 num-func) num-func-identity) - (set! (-> gp-0 frame-num) - (* (get-current-phase (-> self sync)) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - ) - ) + (ja :group! (-> self anim)) + (loop + (ja :num-func num-func-identity + :frame-num (* (get-current-phase (-> self sync)) (the float (+ (-> (ja-group) data 0 length) -1))) + ) (let ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)))) (update-trans! (-> self sound) a1-1) ) @@ -89,8 +73,7 @@ ) (none) ) - :post - (the-as (function none :behavior minecartsteel) rider-post) + :post (the-as (function none :behavior minecartsteel) rider-post) ) ;; definition for function minecartsteel-initialize-by-other @@ -122,19 +105,8 @@ (set! (-> self draw origin-joint-index) (the-as uint 3)) (logior! (-> self skel status) (janim-status inited)) (load-params! (-> self sync) self (the-as uint 9000) arg1 0.15 0.15) - (set! (-> self sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "v3-cartride") - :volume #x400 - :fo-max 30 - ) - (-> self root-override trans) - ) + (set! (-> self sound) + (new 'process 'ambient-sound (static-sound-spec "v3-cartride" :fo-max 30) (-> self root-override trans)) ) (set! (-> self index) (res-lump-value arg0 'index int)) (let ((v1-33 (-> self index))) @@ -176,14 +148,12 @@ ;; INFO: Return type mismatch object vs none. (defmethod init-from-entity! minecartsteel ((obj minecartsteel) (arg0 entity-actor)) (dotimes (s4-0 4) - (let ((s3-0 (get-process *default-dead-pool* minecartsteel #x4000))) - (when s3-0 - (let ((t9-1 (method-of-type minecartsteel activate))) - (t9-1 (the-as minecartsteel s3-0) obj 'minecartsteel (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 minecartsteel-initialize-by-other arg0 (* 0.2 (the float (+ s4-0 1)))) - (-> s3-0 ppointer) - ) + (process-spawn + minecartsteel + :init minecartsteel-initialize-by-other + arg0 + (* 0.2 (the float (+ s4-0 1))) + :to obj ) ) (minecartsteel-initialize-by-other arg0 0.0) diff --git a/test/decompiler/reference/levels/village3/miners_REF.gc b/test/decompiler/reference/levels/village3/miners_REF.gc index fad1d3b8b3..fddac569ae 100644 --- a/test/decompiler/reference/levels/village3/miners_REF.gc +++ b/test/decompiler/reference/levels/village3/miners_REF.gc @@ -1,24 +1,19 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/minershort-ag.gc") +(import "goal_src/import/cavegem-ag.gc") +(import "goal_src/import/minertall-ag.gc") + ;; definition for function miners-anim-loop (defbehavior miners-anim-loop minershort () - (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) - (ja-channel-push! 1 60) - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) - ) + (when (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (get-art-elem self)) ) - (while #t + (loop (suspend) - (let ((a0-8 (-> self skel root-channel 0))) - (set! (-> a0-8 param 0) 2.0) - (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) - ) + (ja :num! (loop! 2.0)) (if (= (-> self next-state name) 'idle) (TODO-RENAME-43 self) ) @@ -45,17 +40,14 @@ ) ;; failed to figure out what this is: -(defskelgroup *minertall-sg* minertall - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *minertall-sg* minertall minertall-lod0-jg minertall-idle-ja + ((minertall-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow minertall-shadow-mg + ) ;; definition for method 52 of type minertall -;; INFO: Return type mismatch int vs none. +;; INFO: Return type mismatch shadow-flags vs none. (defmethod dummy-52 minertall ((obj minertall)) (let ((v1-1 (-> obj draw shadow-ctrl))) (when v1-1 @@ -69,7 +61,7 @@ ) ) 0 - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) ) ) (none) @@ -84,14 +76,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -123,14 +115,12 @@ ;; failed to figure out what this is: (defstate idle (minertall) :virtual #t - :trans - (behavior () + :trans (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) (none) ) - :code - (the-as (function none :behavior minertall) miners-anim-loop) + :code (the-as (function none :behavior minertall) miners-anim-loop) ) ;; definition for method 11 of type minertall @@ -162,21 +152,17 @@ ) ;; failed to figure out what this is: -(defskelgroup *minershort-sg* minershort - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 2.5) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *minershort-sg* minershort minershort-lod0-jg minershort-idle-ja + ((minershort-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + :shadow minershort-shadow-mg + ) ;; failed to figure out what this is: (defpartgroup group-minershort-candle :id 566 :bounds (static-bspherem 0 0 0 15) - :parts - ((sp-item 2364 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 2364 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 2365 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 2366 :fade-after (meters 60) :falloff-to (meters 60)) ) @@ -184,8 +170,7 @@ ;; failed to figure out what this is: (defpart 2366 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 2.0 1.0) (sp-flt spt-y (meters 0)) (sp-rnd-flt spt-scale-x (meters 0.075) (meters 0.075) 1.0) @@ -214,8 +199,7 @@ ;; failed to figure out what this is: (defpart 2364 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 3.0) (sp-rnd-flt spt-y (meters -0.08) (meters 0.02) 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) @@ -237,8 +221,7 @@ ;; failed to figure out what this is: (defpart 2365 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -0.02)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.75) 1.0) @@ -261,7 +244,7 @@ ) ;; definition for method 52 of type minershort -;; INFO: Return type mismatch int vs none. +;; INFO: Return type mismatch shadow-flags vs none. (defmethod dummy-52 minershort ((obj minershort)) (let ((v1-1 (-> obj draw shadow-ctrl))) (when v1-1 @@ -275,7 +258,7 @@ ) ) 0 - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) ) ) (none) @@ -290,14 +273,14 @@ (logtest? (-> obj draw status) (draw-status was-drawn)) ) (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) ) (else (let ((v1-14 (-> obj draw shadow-ctrl))) - (logior! (-> v1-14 settings flags) 32) + (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 ) @@ -314,212 +297,193 @@ ;; definition for method 32 of type minershort (defmethod play-anim! minershort ((obj minershort) (arg0 symbol)) - (with-pp - (set! (-> obj talk-message) (game-text-id press-to-talk)) - (case (current-status (-> obj tasks)) - (((task-status need-hint) (task-status need-introduction)) - (if (not arg0) - (set! (-> obj will-talk) #t) - ) - (case (current-task (-> obj tasks)) - (((game-task village3-miner-money1)) - (when arg0 - (let* ((s5-1 (-> obj tasks)) - (s4-0 (method-of-object s5-1 save-reminder)) - (a1-3 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (s4-0 s5-1 (the int (the-as float (send-event-function *target* a1-3))) 1) - ) - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - (close-specific-task! (game-task village3-miner-money1) (task-status need-introduction)) - (close-specific-task! (game-task village3-miner-money2) (task-status need-introduction)) - (close-specific-task! (game-task village3-miner-money3) (task-status need-introduction)) - (close-specific-task! (game-task village3-miner-money4) (task-status need-introduction)) + (set! (-> obj talk-message) (game-text-id press-to-talk)) + (case (current-status (-> obj tasks)) + (((task-status need-hint) (task-status need-introduction)) + (if (not arg0) + (set! (-> obj will-talk) #t) + ) + (case (current-task (-> obj tasks)) + (((game-task village3-miner-money1)) + (when arg0 + (let* ((s5-1 (-> obj tasks)) + (s4-0 (method-of-object s5-1 save-reminder)) + ) + (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (new 'static 'spool-anim - :name "minershort-introduction-orbs" - :index 4 - :parts 16 - :command-list - '((171 joint "cameraB") - (206 joint "camera") - (423 joint "cameraB") - (591 joint "camera") - (692 joint "cameraB") - (918 joint "camera") - (1122 joint "cameraB") - (1122 shadow self #f) - (1241 joint "camera") - (1241 shadow self #t) - ) + (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (close-specific-task! (game-task village3-miner-money1) (task-status need-introduction)) + (close-specific-task! (game-task village3-miner-money2) (task-status need-introduction)) + (close-specific-task! (game-task village3-miner-money3) (task-status need-introduction)) + (close-specific-task! (game-task village3-miner-money4) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "minershort-introduction-orbs" + :index 4 + :parts 16 + :command-list '((171 joint "cameraB") + (206 joint "camera") + (423 joint "cameraB") + (591 joint "camera") + (692 joint "cameraB") + (918 joint "camera") + (1122 joint "cameraB") + (1122 shadow self #f) + (1241 joint "camera") + (1241 shadow self #t) ) ) - (((game-task cave-gnawers)) - (when arg0 - (let* ((s5-2 (-> obj tasks)) - (s4-1 (method-of-object s5-2 save-reminder)) - (a1-10 (new 'stack-no-clear 'event-message-block)) + ) + (((game-task cave-gnawers)) + (when arg0 + (let* ((s5-2 (-> obj tasks)) + (s4-1 (method-of-object s5-2 save-reminder)) + ) + (s4-1 s5-2 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) + ) + (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "minershort-introduction-gnawers" + :index 9 + :parts 8 + :command-list '((0 want-levels village3 maincave) + (149 joint "cameraB") + (158 display-level maincave movie) + (158 want-force-vis maincave #t) + (435 display-level maincave #f) + (435 joint "camera") + (680 joint "cameraB") + (719 joint "camera") + ) + ) + ) + (else + (when arg0 + (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "minershort-introduction-switch" + :index 11 + :parts 7 + :command-list '((2 shadow "minertall-1" #f) (835 shadow "minertall-1" #t)) + ) + ) + ) + ) + (((task-status need-reminder)) + (set! (-> obj skippable) #t) + (let ((s4-2 (+ (get-reminder (-> obj tasks) 0) 1))) + (if (< (the-as uint 3) (the-as uint s4-2)) + (set! s4-2 0) + ) + (countdown (s3-0 4) + (let ((v1-59 s4-2)) + (cond + ((zero? v1-59) + (if (not (or (= (get-task-status (game-task village3-miner-money1)) (task-status need-reminder)) + (= (get-task-status (game-task village3-miner-money2)) (task-status need-reminder)) + (= (get-task-status (game-task village3-miner-money3)) (task-status need-reminder)) + (= (get-task-status (game-task village3-miner-money4)) (task-status need-reminder)) + ) + ) + (set! s4-2 1) + ) + ) + ((= v1-59 1) + (if (!= (get-task-status (game-task cave-gnawers)) (task-status need-reminder)) + (set! s4-2 2) + ) + ) + ((= v1-59 2) + (if (not (or (= (get-task-status (game-task village3-miner-money1)) (task-status need-reminder)) + (= (get-task-status (game-task village3-miner-money2)) (task-status need-reminder)) + (= (get-task-status (game-task village3-miner-money3)) (task-status need-reminder)) + (= (get-task-status (game-task village3-miner-money4)) (task-status need-reminder)) + ) + ) + (set! s4-2 3) + ) + ) + (else + (if (!= (get-task-status (game-task snow-eggtop)) (task-status need-reminder)) + (set! s4-2 0) ) - (set! (-> a1-10 from) pp) - (set! (-> a1-10 num-params) 2) - (set! (-> a1-10 message) 'query) - (set! (-> a1-10 param 0) (the-as uint 'pickup)) - (set! (-> a1-10 param 1) (the-as uint 6)) - (s4-1 s5-2 (the int (the-as float (send-event-function *target* a1-10))) 1) + ) + ) + ) + ) + (if arg0 + (save-reminder (-> obj tasks) s4-2 0) + ) + (cond + ((zero? s4-2) + (new 'static 'spool-anim :name "minershort-reminder-1-orbs" :index 5 :parts 3 :command-list '()) + ) + ((= s4-2 1) + (if arg0 + (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) ) - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - (close-status! (-> obj tasks) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name "minershort-introduction-gnawers" - :index 9 - :parts 8 - :command-list - '((0 want-levels village3 maincave) - (149 joint "cameraB") - (158 display-level maincave movie) - (158 want-force-vis maincave #t) - (435 display-level maincave #f) - (435 joint "camera") - (680 joint "cameraB") - (719 joint "camera") + (new 'static 'spool-anim :name "minershort-reminder-1-gnawers" :index 10 :parts 3 :command-list '()) + ) + ((= s4-2 2) + (if arg0 + (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) ) - ) + (new 'static 'spool-anim :name "minershort-reminder-2-orbs" :index 6 :parts 2 :command-list '()) ) (else - (when arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - (close-status! (-> obj tasks) (task-status need-introduction)) - ) + (if arg0 + (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + ) (new 'static 'spool-anim - :name "minershort-introduction-switch" - :index 11 - :parts 7 - :command-list - '((2 shadow "minertall-1" #f) (835 shadow "minertall-1" #t)) + :name "minershort-reminder-1-switch" + :index 12 + :parts 5 + :command-list '((2 shadow "minertall-1" #f) (500 shadow "minertall-1" #t)) ) ) ) ) - (((task-status need-reminder)) - (set! (-> obj skippable) #t) - (let ((s4-2 (+ (get-reminder (-> obj tasks) 0) 1))) - (if (< (the-as uint 3) (the-as uint s4-2)) - (set! s4-2 0) - ) - (countdown (s3-0 4) - (let ((v1-59 s4-2)) - (cond - ((zero? v1-59) - (if (not (or (= (get-task-status (game-task village3-miner-money1)) (task-status need-reminder)) - (= (get-task-status (game-task village3-miner-money2)) (task-status need-reminder)) - (= (get-task-status (game-task village3-miner-money3)) (task-status need-reminder)) - (= (get-task-status (game-task village3-miner-money4)) (task-status need-reminder)) - ) - ) - (set! s4-2 1) - ) - ) - ((= v1-59 1) - (if (!= (get-task-status (game-task cave-gnawers)) (task-status need-reminder)) - (set! s4-2 2) - ) - ) - ((= v1-59 2) - (if (not (or (= (get-task-status (game-task village3-miner-money1)) (task-status need-reminder)) - (= (get-task-status (game-task village3-miner-money2)) (task-status need-reminder)) - (= (get-task-status (game-task village3-miner-money3)) (task-status need-reminder)) - (= (get-task-status (game-task village3-miner-money4)) (task-status need-reminder)) - ) - ) - (set! s4-2 3) - ) - ) - (else - (if (!= (get-task-status (game-task snow-eggtop)) (task-status need-reminder)) - (set! s4-2 0) - ) - ) - ) - ) + ) + (((task-status need-reward-speech)) + (let ((s4-3 (get-reminder (-> obj tasks) 2))) + (cond + (arg0 + (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (set! (-> obj cell-for-task) (current-task (-> obj tasks))) + (close-current! (-> obj tasks)) + (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) + (save-reminder (-> obj tasks) (+ s4-3 1) 2) ) - (if arg0 - (save-reminder (-> obj tasks) s4-2 0) - ) - (cond - ((zero? s4-2) - (new 'static 'spool-anim :name "minershort-reminder-1-orbs" :index 5 :parts 3 :command-list '()) - ) - ((= s4-2 1) - (if arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - ) - (new 'static 'spool-anim :name "minershort-reminder-1-gnawers" :index 10 :parts 3 :command-list '()) - ) - ((= s4-2 2) - (if arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - ) - (new 'static 'spool-anim :name "minershort-reminder-2-orbs" :index 6 :parts 2 :command-list '()) - ) - (else - (if arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - ) - (new 'static 'spool-anim - :name "minershort-reminder-1-switch" - :index 12 - :parts 5 - :command-list - '((2 shadow "minertall-1" #f) (500 shadow "minertall-1" #t)) - ) - ) + (else + (set! (-> obj will-talk) #t) + (set! (-> obj talk-message) (game-text-id press-to-trade-money)) ) ) - ) - (((task-status need-reward-speech)) - (let ((s4-3 (get-reminder (-> obj tasks) 2))) - (cond - (arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) - (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) - (save-reminder (-> obj tasks) (+ s4-3 1) 2) - ) - (else - (set! (-> obj will-talk) #t) - (set! (-> obj talk-message) (game-text-id press-to-trade-money)) + (if (< (the-as uint s4-3) (the-as uint 3)) + (new 'static 'spool-anim :name "minershort-resolution-1-orbs" :index 7 :parts 2 :command-list '()) + (new 'static 'spool-anim + :name "minershort-resolution-2-orbs" + :index 8 + :parts 6 + :command-list '((154 joint "cameraB") (461 joint "camera")) ) ) - (if (< (the-as uint s4-3) (the-as uint 3)) - (new 'static 'spool-anim :name "minershort-resolution-1-orbs" :index 7 :parts 2 :command-list '()) - (new 'static 'spool-anim - :name "minershort-resolution-2-orbs" - :index 8 - :parts 6 - :command-list - '((154 joint "cameraB") (461 joint "camera")) - ) - ) - ) ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) ) - (-> obj draw art-group data 3) - ) + ) + (-> obj draw art-group data 3) ) ) ) @@ -527,8 +491,7 @@ ;; failed to figure out what this is: (defstate play-anim (minershort) :virtual #t - :exit - (behavior () + :exit (behavior () (send-event (-> self other-miner ppointer 3) 'end-mode) ((-> (method-of-type process-taskable play-anim) exit)) (none) @@ -543,10 +506,7 @@ ;; definition for method 43 of type minershort (defmethod TODO-RENAME-43 minershort ((obj minershort)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.9655172 f0-2) (play-ambient (-> obj ambient) "MIN-LO01" #f (-> obj root-override trans)) @@ -643,8 +603,7 @@ ;; failed to figure out what this is: (defstate idle (minershort) :virtual #t - :code - miners-anim-loop + :code miners-anim-loop ) ;; definition for method 11 of type minershort @@ -681,59 +640,25 @@ ) ;; failed to figure out what this is: -(defskelgroup *cavegem-sg* cavegem - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 9) - :longest-edge (meters 0) - ) +(defskelgroup *cavegem-sg* cavegem cavegem-lod0-jg cavegem-idle-ja + ((cavegem-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 9) + ) ;; failed to figure out what this is: (defstate idle (cavegem) :virtual #t - :code - (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! - a0-0 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) ) (none) ) - :post - (the-as (function none :behavior cavegem) ja-post) + :post (the-as (function none :behavior cavegem) ja-post) ) ;; definition for method 11 of type cavegem diff --git a/test/decompiler/reference/levels/village3/sage-village3_REF.gc b/test/decompiler/reference/levels/village3/sage-village3_REF.gc index 2d2ad412ec..7218ca3a65 100644 --- a/test/decompiler/reference/levels/village3/sage-village3_REF.gc +++ b/test/decompiler/reference/levels/village3/sage-village3_REF.gc @@ -1,6 +1,10 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/evilsis-village3-ag.gc") +(import "goal_src/import/sage-village3-ag.gc") +(import "goal_src/import/evilbro-village3-ag.gc") + ;; definition of type sage-villagec (deftype sage-villagec (process-taskable) ((evilbro handle :offset-assert 384) @@ -25,201 +29,165 @@ ) ;; failed to figure out what this is: -(defskelgroup *sage-village3-sg* sage-village3 - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *sage-village3-sg* sage-village3 sage-village3-lod0-jg sage-village3-idle-ja + ((sage-village3-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow sage-village3-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *evilbro-village3-sg* evilbro-village3 - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *evilbro-village3-sg* evilbro-village3 evilbro-village3-lod0-jg evilbro-village3-idle-ja + ((evilbro-village3-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow evilbro-village3-shadow-mg + ) ;; failed to figure out what this is: -(defskelgroup *evilsis-village3-sg* evilsis-village3 - 0 - 3 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - :shadow 2 - ) +(defskelgroup *evilsis-village3-sg* evilsis-village3 evilsis-village3-lod0-jg evilsis-village3-idle-ja + ((evilsis-village3-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow evilsis-village3-shadow-mg + ) ;; definition for method 32 of type sage-villagec (defmethod play-anim! sage-villagec ((obj sage-villagec) (arg0 symbol)) - (with-pp - (set! (-> obj talk-message) (game-text-id press-to-talk-to-sage)) - (case (current-status (-> obj tasks)) - (((task-status unknown) (task-status need-hint) (task-status need-introduction)) - (if (not arg0) - (set! (-> obj will-talk) #t) - ) - (case (current-task (-> obj tasks)) - (((game-task village3-button)) - (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (send-event (-> obj assistant extra process) 'clone (process->handle obj)) - (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj evilbro) - (ppointer->handle - (when s5-1 - (let ((t9-5 (method-of-type manipy activate))) - (t9-5 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *evilbro-village3-sg* #f) - (-> s5-1 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj evilbro)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj evilbro)) 'blend-shape #t) - (send-event (handle->process (-> obj evilbro)) 'center-joint 3) - (let ((s5-2 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj evilsis) - (ppointer->handle - (when s5-2 - (let ((t9-11 (method-of-type manipy activate))) - (t9-11 (the-as manipy s5-2) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s5-2 manipy-init (-> obj root-override trans) (-> obj entity) *evilsis-village3-sg* #f) - (-> s5-2 ppointer) - ) - ) - ) - ) - (send-event (handle->process (-> obj evilsis)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj evilsis)) 'blend-shape #t) - (send-event (handle->process (-> obj evilsis)) 'center-joint 3) - (set! (-> obj draw bounds w) 40960.0) - ) - (new 'static 'spool-anim - :name "sage-village3-introduction" - :index 8 - :parts 58 - :command-list - '((206 joint "cameraB") - (268 joint "camera") - (321 joint "cameraB") - (415 joint "camera") - (502 joint "cameraB") - (655 joint "camera") - (864 joint "cameraB") - (958 joint "camera") - (1178 joint "cameraB") - (1295 joint "camera") - (1377 joint "cameraB") - (1683 joint "camera") - (2066 joint "cameraB") - (2209 joint "camera") - (2389 joint "cameraB") - (2707 joint "camera") - (2769 joint "cameraB") - (2901 joint "camera") - (3021 joint "cameraB") - (3158 joint "camera") - (3301 joint "cameraB") - (3533 joint "camera") - (3632 joint "cameraB") - (3692 joint "camera") - (3780 joint "cameraB") - (3818 joint "camera") - (4188 joint "cameraB") - (4324 joint "camera") - (4462 joint "cameraB") - (4542 joint "camera") - ) - ) - ) - (((game-task cave-dark-crystals)) - (when arg0 - (let* ((s5-3 (-> obj tasks)) - (s4-0 (method-of-object s5-3 save-reminder)) - (a1-18 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-18 from) pp) - (set! (-> a1-18 num-params) 2) - (set! (-> a1-18 message) 'query) - (set! (-> a1-18 param 0) (the-as uint 'pickup)) - (set! (-> a1-18 param 1) (the-as uint 6)) - (s4-0 s5-3 (the int (the-as float (send-event-function *target* a1-18))) 1) - ) - (close-status! (-> obj tasks) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name "sage-village3-introduction-dark-eco" - :index 4 - :parts 9 - :command-list - '((111 joint "cameraB") (189 joint "camera") (455 joint "cameraB") (638 joint "camera") (753 joint "cameraB")) - ) - ) - (else - (if arg0 - (close-specific-task! (game-task snow-ram) (task-status need-introduction)) - ) - (new 'static 'spool-anim - :name "sage-village3-introduction-rams" - :index 6 - :parts 6 - :command-list - '((155 joint "cameraB") (370 joint "camera")) - ) - ) + (set! (-> obj talk-message) (game-text-id press-to-talk-to-sage)) + (case (current-status (-> obj tasks)) + (((task-status unknown) (task-status need-hint) (task-status need-introduction)) + (if (not arg0) + (set! (-> obj will-talk) #t) ) - ) - (((task-status need-reminder-a) (task-status need-reminder)) - (set! (-> obj skippable) #t) - (let ((s4-1 (+ (get-reminder (-> obj tasks) 0) 1))) - (if (< (the-as uint 1) (the-as uint s4-1)) - (set! s4-1 0) - ) - (countdown (s3-0 2) - (cond - ((zero? s4-1) - (if (!= (get-task-status (game-task cave-dark-crystals)) (task-status need-reminder)) - (set! s4-1 1) + (case (current-task (-> obj tasks)) + (((game-task village3-button)) + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (send-event (-> obj assistant extra process) 'clone (process->handle obj)) + (set! (-> obj evilbro) + (ppointer->handle + (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilbro-village3-sg* #f :to obj) ) - ) - (else - (if (not (or (= (get-task-status (game-task snow-ram)) (task-status need-reminder)) - (= (get-task-status (game-task snow-ram)) (task-status need-reminder-a)) - ) - ) - (set! s4-1 0) - ) - ) - ) - ) + ) + (send-event (handle->process (-> obj evilbro)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj evilbro)) 'blend-shape #t) + (send-event (handle->process (-> obj evilbro)) 'center-joint 3) + (set! (-> obj evilsis) + (ppointer->handle + (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilsis-village3-sg* #f :to obj) + ) + ) + (send-event (handle->process (-> obj evilsis)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> obj evilsis)) 'blend-shape #t) + (send-event (handle->process (-> obj evilsis)) 'center-joint 3) + (set! (-> obj draw bounds w) 40960.0) + ) + (new 'static 'spool-anim + :name "sage-village3-introduction" + :index 8 + :parts 58 + :command-list '((206 joint "cameraB") + (268 joint "camera") + (321 joint "cameraB") + (415 joint "camera") + (502 joint "cameraB") + (655 joint "camera") + (864 joint "cameraB") + (958 joint "camera") + (1178 joint "cameraB") + (1295 joint "camera") + (1377 joint "cameraB") + (1683 joint "camera") + (2066 joint "cameraB") + (2209 joint "camera") + (2389 joint "cameraB") + (2707 joint "camera") + (2769 joint "cameraB") + (2901 joint "camera") + (3021 joint "cameraB") + (3158 joint "camera") + (3301 joint "cameraB") + (3533 joint "camera") + (3632 joint "cameraB") + (3692 joint "camera") + (3780 joint "cameraB") + (3818 joint "camera") + (4188 joint "cameraB") + (4324 joint "camera") + (4462 joint "cameraB") + (4542 joint "camera") + ) + ) + ) + (((game-task cave-dark-crystals)) + (when arg0 + (let* ((s5-3 (-> obj tasks)) + (s4-0 (method-of-object s5-3 save-reminder)) + ) + (s4-0 s5-3 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) + ) + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "sage-village3-introduction-dark-eco" + :index 4 + :parts 9 + :command-list '((111 joint "cameraB") (189 joint "camera") (455 joint "cameraB") (638 joint "camera") (753 joint "cameraB")) + ) + ) + (else (if arg0 - (save-reminder (-> obj tasks) s4-1 0) - ) - (if (zero? s4-1) - (new 'static 'spool-anim :name "sage-village3-reminder-1-dark-eco" :index 5 :parts 2 :command-list '()) - (new 'static 'spool-anim :name "sage-village3-reminder-1-rams" :index 7 :parts 3 :command-list '()) + (close-specific-task! (game-task snow-ram) (task-status need-introduction)) ) + (new 'static 'spool-anim + :name "sage-village3-introduction-rams" + :index 6 + :parts 6 + :command-list '((155 joint "cameraB") (370 joint "camera")) + ) ) ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) + ) + (((task-status need-reminder-a) (task-status need-reminder)) + (set! (-> obj skippable) #t) + (let ((s4-1 (+ (get-reminder (-> obj tasks) 0) 1))) + (if (< (the-as uint 1) (the-as uint s4-1)) + (set! s4-1 0) + ) + (countdown (s3-0 2) + (cond + ((zero? s4-1) + (if (!= (get-task-status (game-task cave-dark-crystals)) (task-status need-reminder)) + (set! s4-1 1) + ) ) - (get-art-elem obj) - ) + (else + (if (not (or (= (get-task-status (game-task snow-ram)) (task-status need-reminder)) + (= (get-task-status (game-task snow-ram)) (task-status need-reminder-a)) + ) + ) + (set! s4-1 0) + ) + ) + ) + ) + (if arg0 + (save-reminder (-> obj tasks) s4-1 0) + ) + (if (zero? s4-1) + (new 'static 'spool-anim :name "sage-village3-reminder-1-dark-eco" :index 5 :parts 2 :command-list '()) + (new 'static 'spool-anim :name "sage-village3-reminder-1-rams" :index 7 :parts 3 :command-list '()) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) + ) + ) + (get-art-elem obj) ) ) ) @@ -238,10 +206,7 @@ ;; definition for method 43 of type sage-villagec (defmethod TODO-RENAME-43 sage-villagec ((obj sage-villagec)) (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) - ) + (let ((f0-2 (rand-float-gen))) (cond ((< 0.875 f0-2) (play-ambient (-> obj ambient) "SAGELP31" #f (-> obj root-override trans)) @@ -281,8 +246,7 @@ ;; failed to figure out what this is: (defstate idle (sage-villagec) :virtual #t - :trans - (behavior () + :trans (behavior () (case (get-task-status (game-task village3-button)) (((task-status need-introduction)) (send-event self 'play-anim) @@ -296,8 +260,7 @@ ;; failed to figure out what this is: (defstate play-anim (sage-villagec) :virtual #t - :exit - (behavior () + :exit (behavior () (set! (-> self draw bounds w) 10240.0) (send-event (-> self assistant extra process) 'end-mode) (let ((a0-2 (handle->process (-> self evilbro)))) @@ -340,17 +303,17 @@ (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn)) ) - (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) - (set! (-> v1-1 settings flags) (logand -5 (-> v1-1 settings flags))) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) + (logclear! (-> v1-1 settings flags) (shadow-flags shdf02)) (set! (-> v1-1 settings bot-plane w) 20480.0) (let ((a0-8 v1-1)) - (set! (-> a0-8 settings flags) (logand -33 (-> a0-8 settings flags))) + (logclear! (-> a0-8 settings flags) (shadow-flags disable-draw)) ) 0 (update-direction-from-time-of-day v1-1) ) (else - (logior! (-> v1-1 settings flags) 32) + (logior! (-> v1-1 settings flags) (shadow-flags disable-draw)) 0 ) ) diff --git a/test/decompiler/reference/levels/village3/village3-obs_REF.gc b/test/decompiler/reference/levels/village3/village3-obs_REF.gc new file mode 100644 index 0000000000..c77c89b0a4 --- /dev/null +++ b/test/decompiler/reference/levels/village3/village3-obs_REF.gc @@ -0,0 +1,557 @@ +;;-*-Lisp-*- +(in-package goal) + +(import "goal_src/import/medres-ogre-ag.gc") +(import "goal_src/import/medres-finalboss-ag.gc") +(import "goal_src/import/pistons-ag.gc") +(import "goal_src/import/gondola-ag.gc") +(import "goal_src/import/medres-ogre2-ag.gc") +(import "goal_src/import/medres-ogre3-ag.gc") +(import "goal_src/import/gondolacables-ag.gc") + +;; failed to figure out what this is: +(defskelgroup *med-res-ogre-sg* medres-ogre medres-ogre-lod0-jg medres-ogre-idle-ja + ((medres-ogre-lod0-mg (meters 999999))) + :bounds (static-spherem -200 0 -450 350) + :longest-edge (meters 0.01) + ) + +;; failed to figure out what this is: +(defskelgroup *med-res-ogre2-sg* medres-ogre2 medres-ogre2-lod0-jg medres-ogre2-idle-ja + ((medres-ogre2-lod0-mg (meters 999999))) + :bounds (static-spherem -200 0 -950 320) + :longest-edge (meters 0.01) + ) + +;; failed to figure out what this is: +(defskelgroup *med-res-ogre3-sg* medres-ogre3 medres-ogre3-lod0-jg medres-ogre3-idle-ja + ((medres-ogre3-lod0-mg (meters 999999))) + :bounds (static-spherem -100 0 -1370 300) + :longest-edge (meters 0.01) + ) + +;; failed to figure out what this is: +(defskelgroup *med-res-finalboss-sg* medres-finalboss medres-finalboss-lod0-jg medres-finalboss-idle-ja + ((medres-finalboss-lod0-mg (meters 999999))) + :bounds (static-spherem 80 120 -150 470) + :longest-edge (meters 0.01) + ) + +;; definition of type villagec-lava +(deftype villagec-lava (water-anim) + () + :heap-base #x70 + :method-count-assert 30 + :size-assert #xdc + :flag-assert #x1e007000dc + ) + +;; definition for method 3 of type villagec-lava +(defmethod inspect villagec-lava ((obj villagec-lava)) + (let ((t9-0 (method-of-type water-anim inspect))) + (t9-0 obj) + ) + obj + ) + +;; definition for symbol ripple-for-villagec-lava, type ripple-wave-set +(define ripple-for-villagec-lava (new 'static 'ripple-wave-set + :count 2 + :converted #f + :wave (new 'static 'inline-array ripple-wave 4 + (new 'static 'ripple-wave :scale 40.0 :xdiv 2 :speed 1.5) + (new 'static 'ripple-wave :scale 40.0 :xdiv -2 :zdiv 2 :speed 0.9) + (new 'static 'ripple-wave) + (new 'static 'ripple-wave) + ) + ) + ) + +;; definition for method 22 of type villagec-lava +;; INFO: Return type mismatch symbol vs none. +(defmethod TODO-RENAME-22 villagec-lava ((obj villagec-lava)) + (let ((t9-0 (method-of-type water-anim TODO-RENAME-22))) + (t9-0 obj) + ) + (let ((v1-2 (new 'process 'ripple-control))) + (set! (-> obj draw ripple) v1-2) + (set! (-> v1-2 global-scale) 3072.0) + (set! (-> v1-2 waveform) ripple-for-villagec-lava) + ) + (logclear! (-> obj flags) (water-flags wt23)) + (set! (-> obj flags) (logior (water-flags wt25) (-> obj flags))) + (set! (-> obj attack-event) 'lava) + (none) + ) + +;; definition of type gondola +(deftype gondola (process-drawable) + ((root-override collide-shape-moving :offset 112) + (anim spool-anim :offset-assert 176) + (old-target-pos transformq :inline :offset-assert 192) + ) + :heap-base #x80 + :method-count-assert 23 + :size-assert #xf0 + :flag-assert #x17008000f0 + (:methods + (idle (symbol) _type_ :state 20) + (ride-up () _type_ :state 21) + (ride-down () _type_ :state 22) + ) + ) + +;; definition for method 3 of type gondola +(defmethod inspect gondola ((obj gondola)) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~T~Tanim: ~A~%" (-> obj anim)) + (format #t "~T~Told-target-pos: #~%" (-> obj old-target-pos)) + obj + ) + +;; failed to figure out what this is: +(defskelgroup *gondola-sg* gondola gondola-lod0-jg gondola-idle-down-ja + ((gondola-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -5.5 0 6.5) + :shadow gondola-shadow-mg + ) + +;; failed to figure out what this is: +(defstate idle (gondola) + :virtual #t + :code (behavior ((arg0 symbol)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (ja-channel-set! 1) + (cond + (arg0 + (set! (-> self anim) (new 'static 'spool-anim + :name "gondola-ride-down" + :index 6 + :parts 3 + :command-list '((0 want-levels village3 snow) + (0 shadow target #f) + (0 shadow sidekick #f) + (1 display-level village3 display) + (175 display-level snow #f) + (300 setting-reset music village3) + (618 save) + (619 blackout 20) + (619 shadow target #t) + ) + ) + ) + (ja :group! (-> self draw art-group data 4)) + ) + (else + (set! (-> self anim) (new 'static 'spool-anim + :name "gondola-ride-up" + :index 5 + :parts 3 + :command-list '((0 want-levels village3 snow) + (0 shadow target #f) + (400 setting-reset music snow) + (400 display-level snow display) + (678 save) + (679 blackout 20) + (679 shadow target #t) + ) + ) + ) + (ja :group! (-> self draw art-group data 3)) + ) + ) + (transform-post) + (loop + (when (and *target* (and (< (vector-vector-distance + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3)) + (target-pos 0) + ) + 81920.0 + ) + (not (movie?)) + (not (level-hint-displayed?)) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (file-status *art-control* (-> self anim name) 0) + ) + ) + (let ((s3-0 (get-reminder (get-task-control (game-task village3-button)) 2)) + (s4-1 (and *cheat-mode* (cpad-hold? 0 l3))) + (s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3))) + ) + (cond + ((not (or s4-1 (task-closed? (game-task village3-button) (task-status need-hint)))) + ) + ((and (< (the int (-> *game-info* fuel)) (+ s3-0 2)) (< (the int (-> *game-info* fuel)) 71) (not s4-1)) + (level-hint-spawn + (game-text-id village3-gondola-malfunctioning) + "asstvb75" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + ) + (else + (level-hint-spawn + (game-text-id village3-gondola-reactivated) + "asstvb76" + (the-as entity #f) + *entity-pool* + (game-task none) + ) + (let ((s4-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-3 from) self) + (set! (-> s4-3 num-params) 0) + (set! (-> s4-3 message) 'update) + (let ((s3-1 send-event-function) + (v1-36 (entity-actor-lookup (-> self entity) 'alt-actor 0)) + ) + (s3-1 + (if v1-36 + (-> v1-36 extra process) + ) + s4-3 + ) + ) + ) + (let ((s4-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-4 from) self) + (set! (-> s4-4 num-params) 0) + (set! (-> s4-4 message) 'update) + (let ((s3-2 send-event-function) + (v1-40 (entity-actor-lookup (-> self entity) 'alt-actor 1)) + ) + (s3-2 + (if v1-40 + (-> v1-40 extra process) + ) + s4-4 + ) + ) + ) + (when (and (< (vector-vector-xz-distance s5-1 (-> *target* control trans)) 18432.0) + (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + ) + ) + (and (< (+ -40960.0 (-> s5-1 y)) (-> *target* control trans y)) + (begin + (hide-hud) + (level-hint-surpress!) + (kill-current-level-hint '() '(sidekick voicebox) 'exit) + (hud-hidden?) + ) + (can-grab-display? self) + ) + ) + ) + (let ((s5-2 + (new 'stack 'font-context *font-default-matrix* 32 160 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (let ((v1-59 s5-2)) + (set! (-> v1-59 width) (the float 440)) + ) + (let ((v1-60 s5-2)) + (set! (-> v1-60 height) (the float 80)) + ) + (set! (-> s5-2 flags) (font-flags shadow kerning large)) + (print-game-text (lookup-text! *common-text* (game-text-id press-to-use) #f) s5-2 #f 128 22) + ) + (when (and (cpad-pressed? 0 circle) (process-grab? *target*)) + (if arg0 + (go-virtual ride-down) + (go-virtual ride-up) + ) + ) + ) + ) + ) + ) + ) + (spool-push *art-control* (-> self anim name) 0 self -99.0) + (suspend) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate ride-up (gondola) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status bit-3) #t) + (when (send-event *target* 'clone-anim self) + (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) + (send-event *target* 'blend-shape #t) + (set-setting! 'sound-flava #f 30.0 (music-flava to-snow)) + (logclear! (-> self mask) (process-mask enemy)) + (process-spawn othercam self 4 #f #t :to self) + (ja-play-spooled-anim + (-> self anim) + (the-as art-joint-anim (-> self draw art-group data 3)) + (the-as art-joint-anim (-> self draw art-group data 4)) + (the-as (function process-drawable symbol) false-func) + ) + (remove-setting! 'sound-flava) + (send-event *target* 'blend-shape #f) + (when *target* + (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) + (send-event *target* 'trans 'restore (-> self old-target-pos)) + (send-event *target* 'end-mode) + (update-transforms! (-> self root-override)) + (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) + (logior! (-> *target* control status) (cshape-moving-flags onsurf onground tsurf)) + (suspend) + (send-event *camera* 'teleport-to-other-start-string) + ) + (load-state-want-vis 'sno) + (set-continue! *game-info* "snow-start") + ) + (process-entity-status! self (entity-perm-status bit-3) #f) + (go-virtual idle #t) + (none) + ) + :post (behavior () + (ja-post) + (update-direction-from-time-of-day (-> self draw shadow-ctrl)) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate ride-down (gondola) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status bit-3) #t) + (when (send-event *target* 'clone-anim self) + (send-event *target* 'trans 'save (-> self old-target-pos)) + (send-event (ppointer->process (-> *target* sidekick)) 'matrix 'play-anim) + (send-event *target* 'blend-shape #t) + (set-setting! 'sound-flava #f 30.0 (music-flava to-snow)) + (logclear! (-> self mask) (process-mask enemy)) + (process-spawn othercam self 4 #f #t :to self) + (ja-play-spooled-anim + (-> self anim) + (the-as art-joint-anim (-> self draw art-group data 4)) + (the-as art-joint-anim (-> self draw art-group data 3)) + (the-as (function process-drawable symbol) false-func) + ) + (remove-setting! 'sound-flava) + (send-event *target* 'blend-shape #f) + (when *target* + (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) + (send-event *target* 'trans 'restore (-> self old-target-pos)) + (send-event *target* 'end-mode) + (update-transforms! (-> self root-override)) + (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) + (logior! (-> *target* control status) (cshape-moving-flags onsurf onground tsurf)) + (suspend) + (send-event *camera* 'teleport-to-other-start-string) + ) + (load-state-want-vis 'vi3) + (set-continue! *game-info* "village3-farside") + ) + (process-entity-status! self (entity-perm-status bit-3) #f) + (go-virtual idle #f) + (none) + ) + :post (-> (method-of-type gondola ride-up) post) + ) + +;; definition for method 11 of type gondola +;; INFO: Return type mismatch object vs none. +(defmethod init-from-entity! gondola ((obj gondola) (arg0 entity-actor)) + (stack-size-set! (-> obj main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) default-collision-reaction) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing) + ) + (alloc-riders s4-0 1) + (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object)) + (set! (-> s3-0 collide-with) (collide-kind target)) + (set! (-> s3-0 prim-core action) (collide-action solid ca-1)) + (set! (-> s3-0 prim-core offense) (collide-offense indestructible)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 -24576.0 0.0 26624.0) + (set-root-prim! s4-0 s3-0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (backup-collide-with-as s4-0) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (quaternion-identity! (-> obj root-override quat)) + (initialize-skeleton obj *gondola-sg* '()) + (set! (-> obj draw origin-joint-index) (the-as uint 3)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj draw shadow-joint-index) (the-as uint 3)) + (set! (-> obj draw shadow-ctrl) (copy *target-shadow-control* 'process)) + (let ((a0-16 (-> obj draw shadow-ctrl))) + (when a0-16 + (let ((v1-32 a0-16)) + (set! (-> v1-32 settings bot-plane w) (- -122880.0)) + ) + 0 + (let ((v1-34 a0-16)) + (set! (-> v1-34 settings top-plane w) (- 4096.0)) + ) + 0 + (update-direction-from-time-of-day a0-16) + ) + ) + (cond + ((< (-> (target-pos 0) y) (+ 204800.0 (-> obj root-override trans y))) + (go (method-of-object obj idle) #f) + ) + (else + (set! (-> obj anim) (new 'static 'spool-anim :name "gondola-ride-down" :index 6 :parts 3 :command-list '())) + (go (method-of-object obj idle) #t) + ) + ) + (none) + ) + +;; definition of type pistons +(deftype pistons (process-drawable) + () + :heap-base #x40 + :method-count-assert 22 + :size-assert #xb0 + :flag-assert #x16004000b0 + (:methods + (idle () _type_ :state 20) + (active (handle symbol) _type_ :state 21) + ) + ) + +;; definition for method 3 of type pistons +(defmethod inspect pistons ((obj pistons)) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + obj + ) + +;; failed to figure out what this is: +(defskelgroup *pistons-sg* pistons pistons-lod0-jg pistons-idle-ja + ((pistons-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6 0 8) + ) + +;; failed to figure out what this is: +(defstate idle (pistons) + :virtual #t + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('update) + (go-virtual active (process->handle arg0) #f) + ) + ) + ) + :code (behavior () + (ja-post) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate active (pistons) + :virtual #t + ) + +;; definition for method 11 of type pistons +;; INFO: Return type mismatch object vs none. +(defmethod init-from-entity! pistons ((obj pistons) (arg0 entity-actor)) + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton obj *pistons-sg* '()) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "gdl-gen-loop" :fo-max 100) (-> obj root trans)) + ) + (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (go (method-of-object obj active) (the-as handle #f) #t) + (go (method-of-object obj idle)) + ) + (none) + ) + +;; definition of type gondolacables +(deftype gondolacables (process-drawable) + () + :heap-base #x40 + :method-count-assert 21 + :size-assert #xb0 + :flag-assert #x15004000b0 + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type gondolacables +(defmethod inspect gondolacables ((obj gondolacables)) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + obj + ) + +;; failed to figure out what this is: +(defskelgroup *gondolacables-sg* gondolacables gondolacables-lod0-jg gondolacables-idle-ja + ((gondolacables-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 120) + ) + +;; failed to figure out what this is: +(defstate idle (gondolacables) + :virtual #t + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((v1-0 arg2)) + (the-as object (when (= v1-0 'update) + (process-entity-status! self (entity-perm-status complete) #t) + (let ((v0-0 1)) + (set! (-> self draw mgeo effect 0 effect-bits) (the-as uint v0-0)) + v0-0 + ) + ) + ) + ) + ) + :code (behavior () + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (none) + ) + :post (the-as (function none :behavior gondolacables) ja-post) + ) + +;; definition for method 11 of type gondolacables +;; INFO: Return type mismatch object vs none. +(defmethod init-from-entity! gondolacables ((obj gondolacables) (arg0 entity-actor)) + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton obj *gondolacables-sg* '()) + (set! (-> obj draw mgeo effect 0 effect-bits) + (the-as + uint + (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + 1 + 0 + ) + ) + ) + (go (method-of-object obj idle)) + (none) + ) diff --git a/test/decompiler/reference/levels/village3/village3-part_REF.gc b/test/decompiler/reference/levels/village3/village3-part_REF.gc index 54a397ae66..2d9b6a4188 100644 --- a/test/decompiler/reference/levels/village3/village3-part_REF.gc +++ b/test/decompiler/reference/levels/village3/village3-part_REF.gc @@ -22,16 +22,14 @@ (defpartgroup group-village3-candle :id 476 :bounds (static-bspherem 0 10 0 12) - :parts - ((sp-item 1797 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1797 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1798 :fade-after (meters 60) :falloff-to (meters 60)) ) ) ;; failed to figure out what this is: (defpart 1797 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-y (meters -0.08) (meters 0.02) 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) @@ -53,8 +51,7 @@ ;; failed to figure out what this is: (defpart 1798 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -0.04)) (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) @@ -80,8 +77,7 @@ (defpartgroup group-village3-sulphur-05 :id 477 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1799 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1799 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -90,8 +86,7 @@ (defpartgroup group-village3-sulphur-06 :id 478 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1801 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1801 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -100,8 +95,7 @@ (defpartgroup group-village3-sulphur-07 :id 479 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1802 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1802 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -110,8 +104,7 @@ (defpartgroup group-village3-sulphur-08 :id 480 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1803 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1803 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -120,8 +113,7 @@ (defpartgroup group-village3-sulphur-09 :id 481 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1804 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1804 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -130,8 +122,7 @@ (defpartgroup group-village3-sulphur-10 :id 482 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1805 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1805 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -140,8 +131,7 @@ (defpartgroup group-village3-sulphur-11 :id 483 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1806 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1806 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -150,8 +140,7 @@ (defpartgroup group-village3-sulphur-12 :id 484 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1807 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1807 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -160,8 +149,7 @@ (defpartgroup group-village3-sulphur-13 :id 485 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1808 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1808 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -170,8 +158,7 @@ (defpartgroup group-village3-sulphur-14 :id 486 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1809 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1809 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) @@ -180,16 +167,14 @@ (defpartgroup group-village3-sulphur-15 :id 487 :bounds (static-bspherem 0 0 0 12) - :parts - ((sp-item 1810 :fade-after (meters 180) :falloff-to (meters 180)) + :parts ((sp-item 1810 :fade-after (meters 180) :falloff-to (meters 180)) (sp-item 1800 :fade-after (meters 180) :falloff-to (meters 180)) ) ) ;; failed to figure out what this is: (defpart 1810 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -215,8 +200,7 @@ ;; failed to figure out what this is: (defpart 1808 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -242,8 +226,7 @@ ;; failed to figure out what this is: (defpart 1809 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -269,8 +252,7 @@ ;; failed to figure out what this is: (defpart 1807 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -296,8 +278,7 @@ ;; failed to figure out what this is: (defpart 1812 - :init-specs - ((sp-flt spt-vel-y (meters 0.00033333333)) + :init-specs ((sp-flt spt-vel-y (meters 0.00033333333)) (sp-flt spt-fade-a -0.023703704) (sp-flt spt-accel-y -0.027306668) (sp-int spt-next-time 750) @@ -307,8 +288,7 @@ ;; failed to figure out what this is: (defpart 1806 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -334,8 +314,7 @@ ;; failed to figure out what this is: (defpart 1814 - :init-specs - ((sp-flt spt-vel-y (meters 0.00033333333)) + :init-specs ((sp-flt spt-vel-y (meters 0.00033333333)) (sp-flt spt-fade-a -0.023703704) (sp-flt spt-accel-y -0.027306668) (sp-int spt-next-time 225) @@ -345,8 +324,7 @@ ;; failed to figure out what this is: (defpart 1805 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -372,8 +350,7 @@ ;; failed to figure out what this is: (defpart 1804 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -399,8 +376,7 @@ ;; failed to figure out what this is: (defpart 1815 - :init-specs - ((sp-flt spt-vel-y (meters 0.00033333333)) + :init-specs ((sp-flt spt-vel-y (meters 0.00033333333)) (sp-flt spt-fade-a -0.023703704) (sp-flt spt-accel-y -0.027306668) (sp-int spt-next-time 150) @@ -410,8 +386,7 @@ ;; failed to figure out what this is: (defpart 1803 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -437,8 +412,7 @@ ;; failed to figure out what this is: (defpart 1816 - :init-specs - ((sp-flt spt-vel-y (meters 0.00033333333)) + :init-specs ((sp-flt spt-vel-y (meters 0.00033333333)) (sp-flt spt-fade-a -0.023703704) (sp-flt spt-accel-y -0.027306668) (sp-int spt-next-time 150) @@ -448,8 +422,7 @@ ;; failed to figure out what this is: (defpart 1802 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -475,8 +448,7 @@ ;; failed to figure out what this is: (defpart 1817 - :init-specs - ((sp-flt spt-vel-y (meters 0.00033333333)) + :init-specs ((sp-flt spt-vel-y (meters 0.00033333333)) (sp-flt spt-fade-a -0.023703704) (sp-flt spt-accel-y -0.027306668) (sp-int spt-next-time 750) @@ -486,14 +458,12 @@ ;; failed to figure out what this is: (defpart 1813 - :init-specs - ((sp-flt spt-fade-a -0.047407407) (sp-flt spt-accel-y 1.3653333)) + :init-specs ((sp-flt spt-fade-a -0.047407407) (sp-flt spt-accel-y 1.3653333)) ) ;; failed to figure out what this is: (defpart 1801 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -519,8 +489,7 @@ ;; failed to figure out what this is: (defpart 1799 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-rnd-flt spt-num 0.1 0.15 1.0) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-flt spt-y (meters 0.5)) @@ -546,14 +515,12 @@ ;; failed to figure out what this is: (defpart 1811 - :init-specs - ((sp-flt spt-vel-y (meters 0.00033333333)) (sp-flt spt-fade-a -0.017777778) (sp-flt spt-accel-y -0.027306668)) + :init-specs ((sp-flt spt-vel-y (meters 0.00033333333)) (sp-flt spt-fade-a -0.017777778) (sp-flt spt-accel-y -0.027306668)) ) ;; failed to figure out what this is: (defpart 1800 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2)) (sp-flt spt-num 0.1) (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) @@ -580,8 +547,7 @@ (defpartgroup group-village3-minor-fire :id 488 :bounds (static-bspherem 0 2.5 0 2.5) - :parts - ((sp-item 2358 :fade-after (meters 50) :falloff-to (meters 80)) + :parts ((sp-item 2358 :fade-after (meters 50) :falloff-to (meters 80)) (sp-item 2359 :fade-after (meters 40) :falloff-to (meters 40) :binding 2357) (sp-item 2357 :flags (bit1 start-dead launch-asap)) (sp-item 2357 :flags (bit1 start-dead launch-asap)) @@ -654,17 +620,9 @@ ;; failed to figure out what this is: (defpart 2359 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-flt spt-num 1.0) - (sp-sound (new 'static 'sound-spec - :mask #x1 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "fire-pop") - :volume #x400 - ) - ) + (sp-sound (static-sound-spec "fire-pop" :volume 100.0)) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-y (meters 0.5) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -686,8 +644,7 @@ ;; failed to figure out what this is: (defpart 2357 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) @@ -715,14 +672,12 @@ ;; failed to figure out what this is: (defpart 2362 - :init-specs - ((sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g 1.0666667) (sp-flt spt-fade-b 1.0666667)) + :init-specs ((sp-flt spt-fade-r -1.0666667) (sp-flt spt-fade-g 1.0666667) (sp-flt spt-fade-b 1.0666667)) ) ;; failed to figure out what this is: (defpart 2358 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 3.0 7.0 1.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1.1) 1.0) (sp-flt spt-y (meters -0.75)) @@ -747,8 +702,7 @@ ;; failed to figure out what this is: (defpart 2360 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.5) (sp-rnd-flt spt-x (meters -0.5) (meters 1.1) 1.0) (sp-flt spt-y (meters -0.75)) @@ -777,8 +731,7 @@ ;; failed to figure out what this is: (defpart 2361 - :init-specs - ((sp-flt spt-num 0.4) + :init-specs ((sp-flt spt-num 0.4) (sp-flt spt-x (meters 0.2)) (sp-flt spt-y (meters -0.75)) (sp-int spt-rot-x 8) @@ -798,16 +751,14 @@ ;; failed to figure out what this is: (defpart 2363 - :init-specs - ((sp-flt spt-fade-b -1.3653333)) + :init-specs ((sp-flt spt-fade-b -1.3653333)) ) ;; failed to figure out what this is: (defpartgroup group-spewing-volcano-36 :id 489 :bounds (static-bspherem 0 3 0 14) - :parts - ((sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1200 :offset 300) + :parts ((sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1200 :offset 300) (sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1320 :offset 360) (sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1440 :offset 420) (sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1560 :offset 480) @@ -860,8 +811,7 @@ (defpartgroup group-spewing-volcano-37 :id 490 :bounds (static-bspherem 0 3 0 14) - :parts - ((sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1200 :offset 1500) + :parts ((sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1200 :offset 1500) (sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1320 :offset 1560) (sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1440 :offset 1620) (sp-item 1823 :falloff-to (meters 300) :period 2400 :length 1560 :offset 1680) @@ -912,8 +862,7 @@ ;; failed to figure out what this is: (defpart 1836 - :init-specs - ((sp-flt spt-num 0.2) + :init-specs ((sp-flt spt-num 0.2) (sp-int spt-rot-x 5) (sp-flt spt-r 8192.0) (sp-flt spt-g 6144.0) @@ -932,8 +881,7 @@ ;; failed to figure out what this is: (defpart 1837 - :init-specs - ((sp-flt spt-fade-r 40.96) + :init-specs ((sp-flt spt-fade-r 40.96) (sp-flt spt-fade-g 34.133335) (sp-flt spt-fade-b 30.72) (sp-flt spt-accel-x 0.0) @@ -947,14 +895,12 @@ ;; failed to figure out what this is: (defpart 1838 - :init-specs - ((sp-flt spt-fade-g 27.306667) (sp-int spt-timer 300)) + :init-specs ((sp-flt spt-fade-g 27.306667) (sp-int spt-timer 300)) ) ;; failed to figure out what this is: (defpart 1833 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.6) (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -980,8 +926,7 @@ ;; failed to figure out what this is: (defpart 1839 - :init-specs - ((sp-rnd-flt spt-a 16.0 8.0 1.0) + :init-specs ((sp-rnd-flt spt-a 16.0 8.0 1.0) (sp-flt spt-scalevel-x (meters 0.013333334)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-r 0.42666668) @@ -999,14 +944,12 @@ ;; failed to figure out what this is: (defpart 1840 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) ) ;; failed to figure out what this is: (defpart 1834 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 2.0) (sp-rnd-flt spt-x (meters 3.5) (meters 0.75) 1.0) (sp-flt spt-y (meters -7)) @@ -1033,8 +976,7 @@ ;; failed to figure out what this is: (defpart 1835 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.8) (sp-rnd-flt spt-x (meters 3.5) (meters 0.75) 1.0) (sp-flt spt-y (meters -6.5)) @@ -1064,8 +1006,7 @@ ;; failed to figure out what this is: (defpart 1829 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters 7) (meters 3) 1.0) (sp-flt spt-y (meters -7)) @@ -1092,8 +1033,7 @@ ;; failed to figure out what this is: (defpart 1828 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.09) (sp-rnd-flt spt-x (meters 7) (meters 3) 1.0) (sp-flt spt-y (meters -6.5)) @@ -1123,8 +1063,7 @@ ;; failed to figure out what this is: (defpart 1827 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-x (meters 5) (meters 2) 1.0) (sp-flt spt-y (meters -7)) @@ -1150,8 +1089,7 @@ ;; failed to figure out what this is: (defpart 1826 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters 5) (meters 2) 1.0) (sp-flt spt-y (meters -6.5)) @@ -1180,8 +1118,7 @@ ;; failed to figure out what this is: (defpart 1824 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.09) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -1211,8 +1148,7 @@ ;; failed to figure out what this is: (defpart 1823 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.3) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -1240,8 +1176,7 @@ ;; failed to figure out what this is: (defpart 1825 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) (sp-flt spt-num 0.7) (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0) @@ -1273,8 +1208,7 @@ ;; failed to figure out what this is: (defpart 1832 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-int spt-rot-x 4) @@ -1303,8 +1237,7 @@ ;; failed to figure out what this is: (defpart 1831 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) (sp-flt spt-num 0.4) (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1332,14 +1265,12 @@ ;; failed to figure out what this is: (defpart 1841 - :init-specs - ((sp-flt spt-fade-r -0.08888889) (sp-flt spt-fade-g 0.0)) + :init-specs ((sp-flt spt-fade-r -0.08888889) (sp-flt spt-fade-g 0.0)) ) ;; failed to figure out what this is: (defpart 1830 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xb :page #x2)) (sp-flt spt-num 6.0) (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) @@ -1371,8 +1302,7 @@ (defpartgroup group-village3-steam-puff-31 :id 491 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1842 :fade-after (meters 100) :falloff-to (meters 100) :period 900 :length 126) + :parts ((sp-item 1842 :fade-after (meters 100) :falloff-to (meters 100) :period 900 :length 126) (sp-item 1843 :fade-after (meters 100) :falloff-to (meters 100) :period 1260 :length 167) (sp-item 1844 :fade-after (meters 100) :falloff-to (meters 100) :period 690 :length 150) (sp-item 1845 :fade-after (meters 100) :falloff-to (meters 100) :period 1920 :length 80) @@ -1384,8 +1314,7 @@ (defpartgroup group-village3-steam-puff-22 :id 492 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1842 :fade-after (meters 100) :falloff-to (meters 100) :period 1230 :length 156) + :parts ((sp-item 1842 :fade-after (meters 100) :falloff-to (meters 100) :period 1230 :length 156) (sp-item 1843 :fade-after (meters 100) :falloff-to (meters 100) :period 2310 :length 107) (sp-item 1844 :fade-after (meters 100) :falloff-to (meters 100) :period 960 :length 120) (sp-item 1845 :fade-after (meters 100) :falloff-to (meters 100) :period 1350 :length 170) @@ -1397,8 +1326,7 @@ (defpartgroup group-village3-steam-puff-23 :id 493 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1842 :fade-after (meters 100) :falloff-to (meters 100) :period 1200 :length 126) + :parts ((sp-item 1842 :fade-after (meters 100) :falloff-to (meters 100) :period 1200 :length 126) (sp-item 1843 :fade-after (meters 100) :falloff-to (meters 100) :period 1560 :length 107) (sp-item 1844 :fade-after (meters 100) :falloff-to (meters 100) :period 1830 :length 120) (sp-item 1845 :fade-after (meters 100) :falloff-to (meters 100) :period 690 :length 110) @@ -1408,12 +1336,9 @@ ;; failed to figure out what this is: (defpart 1842 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-scale-x (meters 0.4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1438,12 +1363,9 @@ ;; failed to figure out what this is: (defpart 1843 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-scale-x (meters 0.4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1468,12 +1390,9 @@ ;; failed to figure out what this is: (defpart 1844 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-scale-x (meters 0.4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1498,12 +1417,9 @@ ;; failed to figure out what this is: (defpart 1845 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-scale-x (meters 0.4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1528,12 +1444,9 @@ ;; failed to figure out what this is: (defpart 1846 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-scale-x (meters 0.4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1560,8 +1473,7 @@ (defpartgroup group-village3-bottom-puff-25 :id 494 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 900 :length 126) + :parts ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 900 :length 126) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1260 :length 167) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 669 :length 150) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1920 :length 80) @@ -1573,8 +1485,7 @@ (defpartgroup group-village3-bottom-puff-27 :id 495 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1200 :length 126) + :parts ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1200 :length 126) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1080 :length 167) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1569 :length 150) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 990 :length 80) @@ -1586,8 +1497,7 @@ (defpartgroup group-village3-bottom-puff-28 :id 496 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1500 :length 126) + :parts ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1500 :length 126) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1470 :length 167) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1029 :length 150) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 720 :length 80) @@ -1599,8 +1509,7 @@ (defpartgroup group-village3-bottom-puff-29 :id 497 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1500 :length 126) + :parts ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1500 :length 126) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 2010 :length 167) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 999 :length 150) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 720 :length 80) @@ -1612,8 +1521,7 @@ (defpartgroup group-village3-bottom-puff-30 :id 498 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1500 :length 126) + :parts ((sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1500 :length 126) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 960 :length 167) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1869 :length 150) (sp-item 1847 :fade-after (meters 100) :falloff-to (meters 100) :period 1050 :length 80) @@ -1623,12 +1531,9 @@ ;; failed to figure out what this is: (defpart 1847 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.5) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-y (meters 0.7)) (sp-flt spt-scale-x (meters 0.4)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) @@ -1656,8 +1561,7 @@ (defpartgroup group-village3-lava-lava-20x20 :id 499 :bounds (static-bspherem 0 0 0 14) - :parts - ((sp-item 1850 :fade-after (meters 40) :falloff-to (meters 40)) + :parts ((sp-item 1850 :fade-after (meters 40) :falloff-to (meters 40)) (sp-item 1851 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1852 :fade-after (meters 80) :falloff-to (meters 80) :binding 1848) (sp-item 1848 :flags (start-dead)) @@ -1677,8 +1581,7 @@ ;; failed to figure out what this is: (defpart 1851 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 0.2) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) @@ -1705,8 +1608,7 @@ ;; failed to figure out what this is: (defpart 1853 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.5) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0)) @@ -1727,8 +1629,7 @@ ;; failed to figure out what this is: (defpart 1852 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 0.02 0.02 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0)) @@ -1751,8 +1652,7 @@ ;; failed to figure out what this is: (defpart 1850 - :init-specs - ((sp-flt spt-num 1.0) + :init-specs ((sp-flt spt-num 1.0) (sp-rnd-flt spt-x (meters -10) (meters 20) 1.0) (sp-flt spt-y (meters 0.5)) (sp-rnd-flt spt-z (meters -10) (meters 20) 1.0) @@ -1774,20 +1674,17 @@ ;; failed to figure out what this is: (defpart 1856 - :init-specs - ((sp-flt spt-fade-b 16.384)) + :init-specs ((sp-flt spt-fade-b 16.384)) ) ;; failed to figure out what this is: (defpart 1855 - :init-specs - ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 1857)) + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 75) (sp-launcher-by-id spt-next-launcher 1857)) ) ;; failed to figure out what this is: (defpart 1857 - :init-specs - ((sp-flt spt-fade-r -0.85333335) + :init-specs ((sp-flt spt-fade-r -0.85333335) (sp-flt spt-fade-g -0.42666668) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 1858) @@ -1796,14 +1693,12 @@ ;; failed to figure out what this is: (defpart 1858 - :init-specs - ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a -0.10666667)) + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a -0.10666667)) ) ;; failed to figure out what this is: (defpart 1848 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.7) (sp-rnd-flt spt-scale-x (meters 0.75) (meters 0.25) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1821,8 +1716,7 @@ ;; failed to figure out what this is: (defpart 1849 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 1.0 6.0 1.0) (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -1844,8 +1738,7 @@ (defpartgroup group-village3-sagehut-warpgate :id 500 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1861 :fade-after (meters 60) :falloff-to (meters 60)) + :parts ((sp-item 1861 :fade-after (meters 60) :falloff-to (meters 60)) (sp-item 1862 :fade-after (meters 60) :falloff-to (meters 100) :binding 1859) (sp-item 1859 :flags (bit1 start-dead launch-asap)) (sp-item 1859 :flags (bit1 start-dead launch-asap)) @@ -2025,8 +1918,7 @@ ;; failed to figure out what this is: (defpart 1863 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-flt spt-num 0.25) (sp-flt spt-x (meters -2)) (sp-flt spt-scale-x (meters 0.25)) @@ -2042,8 +1934,7 @@ ;; failed to figure out what this is: (defpart 1860 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) (sp-rnd-flt spt-num 1.0 0.2 1.0) (sp-flt spt-x (meters 3.1111112)) (sp-flt spt-y (meters 4)) @@ -2067,8 +1958,7 @@ ;; failed to figure out what this is: (defpart 1861 - :init-specs - ((sp-rnd-flt spt-num 5.0 5.0 1.0) + :init-specs ((sp-rnd-flt spt-num 5.0 5.0 1.0) (sp-flt spt-x (meters -0.5)) (sp-int spt-rot-x 5) (sp-flt spt-r 4096.0) @@ -2086,8 +1976,7 @@ ;; failed to figure out what this is: (defpart 1862 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) (sp-rnd-flt spt-num 0.4 1.0 1.0) (sp-flt spt-scale-x (meters 0.25)) (sp-copy-from-other spt-scale-y -4) @@ -2101,8 +1990,7 @@ ;; failed to figure out what this is: (defpart 1859 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.4 1.0) (sp-flt spt-x (meters 3.1111112)) (sp-flt spt-y (meters 4)) @@ -2129,14 +2017,12 @@ (defpartgroup group-village3-sagehut-boiling :id 501 :bounds (static-bspherem 0 0 0 6) - :parts - ((sp-item 1864 :fade-after (meters 60) :flags (is-3d)) (sp-item 1865 :fade-after (meters 60) :flags (is-3d))) + :parts ((sp-item 1864 :fade-after (meters 60) :flags (is-3d)) (sp-item 1865 :fade-after (meters 60) :flags (is-3d))) ) ;; failed to figure out what this is: (defpart 1864 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 1.0 0.5 1.0) (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0) (sp-flt spt-y (meters -2)) @@ -2164,14 +2050,12 @@ ;; failed to figure out what this is: (defpart 1866 - :init-specs - ((sp-flt spt-fade-a -0.2)) + :init-specs ((sp-flt spt-fade-a -0.2)) ) ;; failed to figure out what this is: (defpart 1865 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) (sp-flt spt-num 1.0) (sp-flt spt-y (meters -0.5)) (sp-flt spt-z (meters -0.26)) @@ -2193,8 +2077,7 @@ (defpartgroup group-village3-sagehut-steam :id 502 :bounds (static-bspherem 0 0 0 4) - :parts - ((sp-item 1867 :fade-after (meters 60) :falloff-to (meters 60) :period 1200 :length 126) + :parts ((sp-item 1867 :fade-after (meters 60) :falloff-to (meters 60) :period 1200 :length 126) (sp-item 1867 :fade-after (meters 60) :falloff-to (meters 60) :period 1560 :length 107) (sp-item 1867 :fade-after (meters 60) :falloff-to (meters 60) :period 1830 :length 120) (sp-item 1867 :fade-after (meters 60) :falloff-to (meters 60) :period 690 :length 110) @@ -2204,12 +2087,9 @@ ;; failed to figure out what this is: (defpart 1867 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-flt spt-num 1.0) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-scale-x (meters 0.3)) (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -2236,8 +2116,7 @@ (defpartgroup group-village3-sagehut-understeam :id 503 :bounds (static-bspherem 0 -3 0 8) - :parts - ((sp-item 1868 :fade-after (meters 200) :falloff-to (meters 200) :period 1200 :length 126) + :parts ((sp-item 1868 :fade-after (meters 200) :falloff-to (meters 200) :period 1200 :length 126) (sp-item 1868 :fade-after (meters 200) :falloff-to (meters 200) :period 1560 :length 107) (sp-item 1868 :fade-after (meters 200) :falloff-to (meters 200) :period 1830 :length 120) (sp-item 1868 :fade-after (meters 200) :falloff-to (meters 200) :period 690 :length 110) @@ -2247,12 +2126,9 @@ ;; failed to figure out what this is: (defpart 1868 - :init-specs - ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2)) (sp-rnd-flt spt-num 4.0 4.0 1.0) - (sp-sound - (new 'static 'sound-spec :num 0.02 :group #x1 :sound-name (static-sound-name "steam-short") :volume #x400) - ) + (sp-sound (static-sound-spec "steam-short" :num 0.02)) (sp-flt spt-x (meters 1.5)) (sp-flt spt-y (meters 0.6)) (sp-flt spt-scale-x (meters 1)) diff --git a/test/decompiler/reference/levels/village_common/oracle_REF.gc b/test/decompiler/reference/levels/village_common/oracle_REF.gc index 65571a4816..4626b08f25 100644 --- a/test/decompiler/reference/levels/village_common/oracle_REF.gc +++ b/test/decompiler/reference/levels/village_common/oracle_REF.gc @@ -1,6 +1,8 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/oracle-ag.gc") + ;; definition of type oracle (deftype oracle (process-taskable) ((first-task uint8 :offset-assert 380) @@ -27,13 +29,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *oracle-sg* oracle - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :longest-edge (meters 0) - ) +(defskelgroup *oracle-sg* oracle oracle-lod0-jg oracle-idle-ja + ((oracle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) ;; definition for method 32 of type oracle (defmethod play-anim! oracle ((obj oracle) (arg0 symbol)) @@ -53,8 +52,7 @@ :name "oracle-intro-2" :index 11 :parts 4 - :command-list - '((0 kill "pontoonten-20") + :command-list '((0 kill "pontoonten-20") (0 kill "pontoonten-19") (0 kill "pontoonten-18") (0 kill "pontoonten-15") @@ -237,14 +235,12 @@ ;; failed to figure out what this is: (defstate idle (oracle) :virtual #t - :exit - (behavior () + :exit (behavior () (stop! (-> self sound)) ((-> (method-of-type process-taskable idle) exit)) (none) ) - :trans - (behavior () + :trans (behavior () (update! (-> self sound)) ((-> (method-of-type process-taskable idle) trans)) (none) @@ -254,19 +250,8 @@ ;; definition for method 11 of type oracle (defmethod init-from-entity! oracle ((obj oracle) (arg0 entity-actor)) (dummy-40 obj arg0 *oracle-sg* 3 4 (new 'static 'vector :y -4096.0 :w 4096.0) -1) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (new 'static 'sound-spec - :mask #x80 - :num 1.0 - :group #x1 - :sound-name (static-sound-name "oracle-sleep") - :volume #x400 - :fo-max 50 - ) - (-> obj root-override trans) - ) + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "oracle-sleep" :fo-max 50) (-> obj root-override trans)) ) (set! (-> obj first-task) (the-as uint (-> arg0 extra perm task))) (set! (-> obj second-task) (res-lump-value arg0 'alt-task uint)) @@ -298,19 +283,9 @@ (ja-post) (when (not (task-closed? (the-as game-task (-> obj first-task)) (task-status need-resolution))) (vector<-cspace! s4-0 (-> obj node-list data 5)) - (let ((s3-0 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj right-eye-cell) - (ppointer->handle - (when s3-0 - (let ((t9-8 (method-of-type manipy activate))) - (t9-8 (the-as manipy s3-0) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s3-0 manipy-init s4-0 (-> obj entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2)) - (-> s3-0 ppointer) - ) - ) - ) - ) + (set! (-> obj right-eye-cell) + (ppointer->handle (manipy-spawn s4-0 (-> obj entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to obj)) + ) (send-event (handle->process (-> obj right-eye-cell)) 'eval @@ -324,19 +299,9 @@ ) (when (not (task-closed? (the-as game-task (-> obj second-task)) (task-status need-resolution))) (vector<-cspace! s4-0 (-> obj node-list data 6)) - (let ((s3-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj left-eye-cell) - (ppointer->handle - (when s3-1 - (let ((t9-15 (method-of-type manipy activate))) - (t9-15 (the-as manipy s3-1) obj 'manipy (the-as pointer #x70004000)) - ) - (run-now-in-process s3-1 manipy-init s4-0 (-> obj entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2)) - (-> s3-1 ppointer) - ) - ) - ) - ) + (set! (-> obj left-eye-cell) + (ppointer->handle (manipy-spawn s4-0 (-> obj entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to obj)) + ) (send-event (handle->process (-> obj left-eye-cell)) 'eval diff --git a/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc b/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc index fd7718b022..d4b856b8ad 100644 --- a/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc +++ b/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc @@ -1,6 +1,9 @@ ;;-*-Lisp-*- (in-package goal) +(import "goal_src/import/warp-gate-switch-ag.gc") +(import "goal_src/import/village-cam-ag.gc") + ;; definition of type warpgate (deftype warpgate (process-hidden) () @@ -43,14 +46,10 @@ ;; failed to figure out what this is: (defstate target-warp-in (target) - :event - target-generic-event-handler - :enter - (-> target-warp-out enter) - :exit - (-> target-warp-out exit) - :trans - (behavior () + :event target-generic-event-handler + :enter (-> target-warp-out enter) + :exit (-> target-warp-out exit) + :trans (behavior () (set! (-> self control transv x) (- (-> self control unknown-vector103 x) (-> self control unknown-vector102 x)) ) @@ -58,13 +57,12 @@ (- (-> self control unknown-vector103 z) (-> self control unknown-vector102 z)) ) (vector-xz-normalize! (-> self control transv) 49152.0) - (if (logtest? (-> self control status) 1) + (if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-hit-ground #f) ) (none) ) - :code - (behavior ((arg0 vector) (arg1 vector)) + :code (behavior ((arg0 vector) (arg1 vector)) (clear-collide-with-as (-> self control)) (ja-channel-set! 0) (vector-reset! (-> self control transv)) @@ -100,70 +98,47 @@ (set! (-> self post-hook) target-no-stick-post) (ja-channel-set! 1) (send-event self 'do-effect 'death-warp-in -1.0) - (sound-play-by-name (static-sound-name "warpgate-tele") (new-sound-id) 1024 0 0 1 #t) - (let ((gp-3 (-> self skel root-channel 0))) - (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> gp-3 param 0) (ja-aframe 50.0 0)) - (set! (-> gp-3 param 1) 1.0) - (set! (-> gp-3 frame-num) (ja-aframe 40.0 0)) - (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) - ) + (sound-play "warpgate-tele") + (ja-no-eval :group! (-> self draw art-group data 41) + :num! (seek! (ja-aframe 50.0 0)) + :frame-num (ja-aframe 40.0 0) + ) (until (ja-done? 0) (suspend) - (let ((gp-4 (-> self skel root-channel 0))) - (set! (-> gp-4 param 0) (ja-aframe 50.0 0)) - (set! (-> gp-4 param 1) 1.0) - (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek! (ja-aframe 50.0 0))) ) (restore-collide-with-as (-> self control)) - (let ((gp-5 (-> self skel root-channel 0))) - (set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 41))) - (set! (-> gp-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 41)) data 0 length) -1)) - ) - (set! (-> gp-5 param 1) 1.0) - (set! (-> gp-5 frame-num) (ja-aframe 50.0 0)) - (joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!) - ) + (ja-no-eval :group! (-> self draw art-group data 41) :num! (seek!) :frame-num (ja-aframe 50.0 0)) (until (ja-done? 0) (suspend) - (let ((a0-26 (-> self skel root-channel 0))) - (set! (-> a0-26 param 0) (the float (+ (-> a0-26 frame-group data 0 length) -1))) - (set! (-> a0-26 param 1) 1.0) - (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-seek!) - ) + (ja :num! (seek!)) ) - (target-falling-anim -1 99) + (target-falling-anim -1 (seconds 0.33)) (none) ) - :post - target-no-move-post + :post target-no-move-post ) ;; failed to figure out what this is: (defstate idle (warp-gate) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hide) (go-virtual hidden) ) ) ) - :code - (behavior () - (clear-pending-settings-from-process *setting-control* self 'allow-progress) + :code (behavior () + (remove-setting! 'allow-progress) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while #t + (loop (when (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (and (>= (-> self level-slot) 0) (not (movie?)) (not (level-hint-displayed?)) - (zero? - (logand (-> *target* control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) - ) + (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) + ) (let* ((v1-16 (-> self root)) (a1-2 (-> *target* control trans)) (f0-1 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) a1-2 (-> v1-16 trans)))) @@ -276,16 +251,14 @@ ;; failed to figure out what this is: (defstate active (warp-gate) :virtual #t - :enter - (behavior () - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) - (copy-settings-from-target! *setting-control*) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + :enter (behavior () + (set-setting! 'allow-progress #f 0.0 0) + (apply-settings *setting-control*) + (sound-play "start-options") (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) - :trans - (behavior () + :trans (behavior () (when (or (and (cpad-pressed? 0 triangle) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) (process-release? *target*) @@ -294,7 +267,7 @@ ) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (go-virtual idle) ) (when *target* @@ -315,8 +288,7 @@ ) (none) ) - :code - (behavior () + :code (behavior () (local-vars (sv-112 int) (sv-128 int) (sv-144 int)) (let ((gp-0 (get-next-slot-up self (+ (-> self level-slot) -1)))) 0 @@ -325,19 +297,19 @@ (s4-0 #f) (s3-0 gp-0) ) - (while #t + (loop (when (zero? s2-0) (cond ((cpad-pressed? 0 right) (set! s5-0 #t) (set! s4-0 #f) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! s3-0 (get-next-slot-up self s3-0)) ) ((cpad-pressed? 0 left) (set! s5-0 #t) (set! s4-0 #t) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! s3-0 (get-next-slot-down self s3-0)) ) ) @@ -458,8 +430,7 @@ ;; failed to figure out what this is: (defstate hidden (warp-gate) :virtual #t - :code - (the-as (function none :behavior warp-gate) anim-loop) + :code (the-as (function none :behavior warp-gate) anim-loop) ) ;; definition for function warp-gate-init-by-other @@ -537,13 +508,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *warp-gate-switch-sg* warp-gate-switch - 0 - 2 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 1.5) - :longest-edge (meters 0) - ) +(defskelgroup *warp-gate-switch-sg* warp-gate-switch warp-gate-switch-lod0-jg warp-gate-switch-down-ja + ((warp-gate-switch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.5) + ) ;; definition for method 27 of type warp-gate-switch (defmethod TODO-RENAME-27 warp-gate-switch ((obj warp-gate-switch)) @@ -712,8 +680,7 @@ ;; failed to figure out what this is: (defstate basebutton-up-idle (warp-gate-switch) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) (when (pressable? self) @@ -729,8 +696,7 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (let ((t9-0 (-> (method-of-type basebutton basebutton-up-idle) enter))) (if t9-0 @@ -739,8 +705,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) self) (set! (-> a1-0 num-params) 0) @@ -835,8 +800,7 @@ ;; failed to figure out what this is: (defstate basebutton-down-idle (warp-gate-switch) :virtual #t - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hide) (send-event (handle->process (-> self warp)) arg2) @@ -846,21 +810,9 @@ ) ) ) - :enter - (behavior () + :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((gp-0 (get-process *default-dead-pool* warp-gate #x4000))) - (set! (-> self warp) - (ppointer->handle (when gp-0 - (let ((t9-1 (method-of-type warp-gate activate))) - (t9-1 (the-as warp-gate gp-0) self 'warp-gate (the-as pointer #x70004000)) - ) - (run-now-in-process gp-0 warp-gate-init-by-other (-> self notify-actor extra trans)) - (-> gp-0 ppointer) - ) - ) - ) - ) + (set! (-> self warp) (ppointer->handle (process-spawn warp-gate (-> self notify-actor extra trans) :to self))) (process-entity-status! self (entity-perm-status complete) #t) (let ((t9-4 (-> (method-of-type basebutton basebutton-down-idle) enter))) (if t9-4 @@ -869,8 +821,7 @@ ) (none) ) - :exit - (behavior () + :exit (behavior () (let ((a0-1 (handle->process (-> self warp)))) (if a0-1 (deactivate a0-1) @@ -883,8 +834,7 @@ ) (none) ) - :trans - (behavior () + :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 60)) (case (-> self entity extra perm task) (((game-task training-door)) @@ -914,10 +864,9 @@ ;; failed to figure out what this is: (defstate basebutton-going-down (warp-gate-switch) :virtual #t - :code - (behavior () - (sound-play-by-name (static-sound-name "warpgate-butt") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "warpgate-act") (new-sound-id) 1024 0 0 1 #t) + :code (behavior () + (sound-play "warpgate-butt") + (sound-play "warpgate-act") (let ((gp-2 (entity-actor-count (-> self entity) 'trigger-actor))) (dotimes (s5-2 gp-2) (let ((s4-0 (entity-actor-lookup (-> self entity) 'trigger-actor s5-2)) @@ -959,13 +908,10 @@ ) ;; failed to figure out what this is: -(defskelgroup *village-cam-sg* village-cam - 0 - -1 - ((1 (meters 999999))) - :bounds (static-spherem 0 0 0 80) - :longest-edge (meters 0) - ) +(defskelgroup *village-cam-sg* village-cam village-cam-lod0-jg -1 + ((village-cam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) ;; definition of type village-cam (deftype village-cam (process) @@ -1007,10 +953,9 @@ ;; failed to figure out what this is: (defstate idle (village-cam) :virtual #t - :code - (behavior () + :code (behavior () (local-vars (v1-18 symbol)) - (while #t + (loop (let ((v1-5 (and (and *target* (>= (-> self range) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) @@ -1070,8 +1015,8 @@ ) ) (while (and *target* - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) ) (suspend) ) @@ -1079,29 +1024,30 @@ (process-grab? *target*) (process-entity-status! self (entity-perm-status bit-3) #t) (kill-current-level-hint '(ambient) '() 'exit) - (until (not (or (-> *setting-control* current talking) (or (-> *setting-control* current spooling) - (-> *setting-control* current hint) - (-> *setting-control* current ambient) - (not *target*) - (logtest? (-> *target* state-flags) #x8008) - ) + (until (not (or (-> *setting-control* current talking) + (or (-> *setting-control* current spooling) + (-> *setting-control* current hint) + (-> *setting-control* current ambient) + (not *target*) + (logtest? (-> *target* state-flags) (state-flags being-attacked dying)) + ) ) ) - (set-setting! *setting-control* self 'allow-progress #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) (let* ((a0-25 *setting-control*) - (t9-14 (method-of-object a0-25 set-setting!)) + (t9-14 (method-of-object a0-25 set-setting)) (a2-5 'movie) (a3-1 (process->ppointer self)) ) - (t9-14 a0-25 self a2-5 (the-as symbol a3-1) 0.0 0) + (t9-14 a0-25 self a2-5 a3-1 0.0 0) ) - (copy-settings-from-target! *setting-control*) + (apply-settings *setting-control*) (while (or (-> *setting-control* current talking) (-> *setting-control* current spooling) (-> *setting-control* current hint) (!= (-> *level* loading-level) (-> *level* level-default)) (not *target*) - (logtest? (-> *target* state-flags) #x8008) + (logtest? (-> *target* state-flags) (state-flags being-attacked dying)) *progress-process* ) (suspend) @@ -1113,8 +1059,8 @@ (suspend) (kill-current-level-hint '() '() 'die) (process-release? *target*) - (clear-pending-settings-from-process *setting-control* self 'movie) - (copy-settings-from-target! *setting-control*) + (remove-setting! 'movie) + (apply-settings *setting-control*) (suspend) (suspend) ) @@ -1133,33 +1079,25 @@ *entity-pool* (game-task none) ) - (let ((s5-0 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-0 - (let ((t9-23 (method-of-type pov-camera activate))) - (t9-23 (the-as pov-camera s5-0) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> self entity extra trans) - *village-cam-sg* - "firecanyon-cam" - 0 - #f - '((0 want-force-vis village1 #t) - (0 alive "money-2669") - (0 alive "money-2670") - (0 alive "money-2671") - (0 alive "money-2672") - (0 alive "money-2673") - (0 alive "money-2674") - (0 alive "money-2675") - (0 alive "money-2677") - (0 alive "money-2678") - ) - ) - (-> s5-0 ppointer) + (process-spawn + pov-camera + (-> self entity extra trans) + *village-cam-sg* + "firecanyon-cam" + 0 + #f + '((0 want-force-vis village1 #t) + (0 alive "money-2669") + (0 alive "money-2670") + (0 alive "money-2671") + (0 alive "money-2672") + (0 alive "money-2673") + (0 alive "money-2674") + (0 alive "money-2675") + (0 alive "money-2677") + (0 alive "money-2678") ) + :to self ) ) ((= v1-84 1) @@ -1170,33 +1108,25 @@ *entity-pool* (game-task none) ) - (let ((s5-1 (get-process *default-dead-pool* pov-camera #x4000))) - (when s5-1 - (let ((t9-27 (method-of-type pov-camera activate))) - (t9-27 (the-as pov-camera s5-1) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - pov-camera-init-by-other - (-> self entity extra trans) - *village-cam-sg* - "firecanyon-alt-cam" - 0 - #f - '((0 want-force-vis village1 #t) - (0 alive "money-2669") - (0 alive "money-2670") - (0 alive "money-2671") - (0 alive "money-2672") - (0 alive "money-2673") - (0 alive "money-2674") - (0 alive "money-2675") - (0 alive "money-2677") - (0 alive "money-2678") - ) - ) - (-> s5-1 ppointer) + (process-spawn + pov-camera + (-> self entity extra trans) + *village-cam-sg* + "firecanyon-alt-cam" + 0 + #f + '((0 want-force-vis village1 #t) + (0 alive "money-2669") + (0 alive "money-2670") + (0 alive "money-2671") + (0 alive "money-2672") + (0 alive "money-2673") + (0 alive "money-2674") + (0 alive "money-2675") + (0 alive "money-2677") + (0 alive "money-2678") ) + :to self ) ) ) @@ -1215,24 +1145,7 @@ *entity-pool* (game-task none) ) - (let ((gp-1 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-1 - (let ((t9-33 (method-of-type pov-camera activate))) - (t9-33 (the-as pov-camera gp-1) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (-> self entity extra trans) - *village-cam-sg* - "vi2-button-cam" - 0 - #f - '() - ) - (-> gp-1 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *village-cam-sg* "vi2-button-cam" 0 #f '() :to self) ) ) ((= v1-79 3) @@ -1244,24 +1157,7 @@ *entity-pool* (game-task none) ) - (let ((gp-2 (get-process *default-dead-pool* pov-camera #x4000))) - (when gp-2 - (let ((t9-38 (method-of-type pov-camera activate))) - (t9-38 (the-as pov-camera gp-2) self 'pov-camera (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - pov-camera-init-by-other - (-> self entity extra trans) - *village-cam-sg* - "vi3-button-cam" - 0 - #f - '() - ) - (-> gp-2 ppointer) - ) - ) + (process-spawn pov-camera (-> self entity extra trans) *village-cam-sg* "vi3-button-cam" 0 #f '() :to self) ) ) ) @@ -1283,7 +1179,7 @@ (when (zero? (-> self index)) (let ((a0-70 (-> self entity extra perm))) (when (= (-> a0-70 user-uint8 0) 1) - (clear-pending-settings-from-process *setting-control* self 'allow-progress) + (remove-setting! 'allow-progress) (let ((gp-3 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-3) (seconds 300)) (suspend) diff --git a/test/decompiler/test_AtomicOpBuilder.cpp b/test/decompiler/test_AtomicOpBuilder.cpp index d31ebc2787..e4c7c0501b 100644 --- a/test/decompiler/test_AtomicOpBuilder.cpp +++ b/test/decompiler/test_AtomicOpBuilder.cpp @@ -1,11 +1,13 @@ #include -#include "gtest/gtest.h" + +#include "decompiler/Disasm/InstructionParser.h" +#include "decompiler/Function/Warnings.h" #include "decompiler/IR2/AtomicOp.h" #include "decompiler/analysis/atomic_op_builder.h" -#include "decompiler/Disasm/InstructionParser.h" +#include "gtest/gtest.h" + #include "third-party/fmt/core.h" #include "third-party/fmt/format.h" -#include "decompiler/Function/Warnings.h" using namespace decompiler; @@ -24,6 +26,7 @@ std::string assembly_from_list(std::vector assemblyLines) { return str; } +// jak 1 specific void test_case(std::string assembly_lines, std::vector output_lines, std::vector> write_regs, @@ -45,7 +48,7 @@ void test_case(std::string assembly_lines, // treat the entire program as a single basic block, and convert! DecompWarnings warnings; convert_block_to_atomic_ops(0, prg.instructions.begin(), prg.instructions.end(), prg.labels, - &container, warnings); + &container, warnings, GameVersion::Jak1); // count operations EXPECT_EQ(container.ops.size(), output_lines.size()); @@ -130,7 +133,7 @@ TEST(DecompilerAtomicOpBuilder, RegUseDuplication) { FunctionAtomicOps container; DecompWarnings warnings; convert_block_to_atomic_ops(0, prg.instructions.begin(), prg.instructions.end(), prg.labels, - &container, warnings); + &container, warnings, GameVersion::Jak1); ASSERT_EQ(1, container.ops.size()); auto& op = container.ops.at(0); for (const auto& reg_group : {op->read_regs(), op->write_regs(), op->clobber_regs()}) { diff --git a/test/decompiler/test_DataParser.cpp b/test/decompiler/test_DataParser.cpp index 9870bc0e6d..8528f6f3e1 100644 --- a/test/decompiler/test_DataParser.cpp +++ b/test/decompiler/test_DataParser.cpp @@ -1,12 +1,14 @@ -#include "gtest/gtest.h" -#include "decompiler/util/DataParser.h" -#include "decompiler/Disasm/DecompilerLabel.h" -#include "decompiler/util/data_decompile.h" -#include "decompiler/util/DecompilerTypeSystem.h" -#include "third-party/fmt/core.h" #include "common/goos/PrettyPrinter.h" +#include "decompiler/Disasm/DecompilerLabel.h" +#include "decompiler/util/DataParser.h" +#include "decompiler/util/DecompilerTypeSystem.h" +#include "decompiler/util/data_decompile.h" +#include "gtest/gtest.h" + +#include "third-party/fmt/core.h" + using namespace decompiler; class DataDecompTest : public ::testing::Test { @@ -210,12 +212,7 @@ TEST_F(DataDecompTest, VifDisasmArray) { auto decomp = decompile_at_label_guess_type(parsed.label("L148"), parsed.labels, {parsed.words}, dts->ts, nullptr); check_forms_equal(decomp.print(), - "(new 'static 'boxed-array :type\n" - " vif-disasm-element\n" - " :length\n" - " 3\n" - " :allocated-length\n" - " 3\n" + "(new 'static 'boxed-array :type vif-disasm-element\n" " (new 'static 'vif-disasm-element :mask #x7f :string1 \"nop\")\n" " (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 stcycl) :print " "#x2 :string1 \"stcycl\")\n" @@ -405,4 +402,4 @@ TEST_F(DataDecompTest, ReverseArtExt) { input.offset = 108; result = dts->ts.reverse_field_multi_lookup(input); EXPECT_EQ(result.results.at(0).tokens.at(2).print(), "type"); -} \ No newline at end of file +} diff --git a/test/decompiler/test_DisasmVifDecompile.cpp b/test/decompiler/test_DisasmVifDecompile.cpp index 44d4ba2333..d375f82854 100644 --- a/test/decompiler/test_DisasmVifDecompile.cpp +++ b/test/decompiler/test_DisasmVifDecompile.cpp @@ -1,6 +1,7 @@ +#include "FormRegressionTest.h" + #include "gtest/gtest.h" -#include "FormRegressionTest.h" using namespace decompiler; @@ -680,17 +681,17 @@ TEST_F(FormRegressionTest, ExprDisasmVif) { " )\n" " (- gp-0 (* arg1 4))\n" " )"; - test_with_expr(func, type, expected, false, "", - {{"L139", " #x~X:"}, - {"L138", " (~s :irq ~D)~%"}, - {"L137", " (~s :irq ~D :~s #x~X)~%"}, - {"L136", " (~s :irq ~D :wl ~D :cl ~D)~%"}, - {"L135", " (~s :irq ~D :~s "}, - {"L134", "#x~X #x~X #x~X #x~X)~%"}, - {"L133", " (~s :irq ~D :instructions #x~D :addr #x~X)~%"}, - {"L132", " (~s :irq ~D :qwc #x~D)~%"}, - {"L145", " #x~X: #x~8x #x~8x #x~8x #x~8x~%"}, - {"L131", " (~s :irq ~D :num ~D :addr #x~X "}, - {"L130", ":msk ~D :flg ~D :usn ~D [skip ~d])~%"}, - {"L129", " (*unknown* vif-tag #x~X)~%"}}); + test_with_expr_jak1(func, type, expected, false, "", + {{"L139", " #x~X:"}, + {"L138", " (~s :irq ~D)~%"}, + {"L137", " (~s :irq ~D :~s #x~X)~%"}, + {"L136", " (~s :irq ~D :wl ~D :cl ~D)~%"}, + {"L135", " (~s :irq ~D :~s "}, + {"L134", "#x~X #x~X #x~X #x~X)~%"}, + {"L133", " (~s :irq ~D :instructions #x~D :addr #x~X)~%"}, + {"L132", " (~s :irq ~D :qwc #x~D)~%"}, + {"L145", " #x~X: #x~8x #x~8x #x~8x #x~8x~%"}, + {"L131", " (~s :irq ~D :num ~D :addr #x~X "}, + {"L130", ":msk ~D :flg ~D :usn ~D [skip ~d])~%"}, + {"L129", " (*unknown* vif-tag #x~X)~%"}}); } \ No newline at end of file diff --git a/test/decompiler/test_FormBeforeExpressions.cpp b/test/decompiler/test_FormBeforeExpressions.cpp index 5f909a5502..0ad4b69fcb 100644 --- a/test/decompiler/test_FormBeforeExpressions.cpp +++ b/test/decompiler/test_FormBeforeExpressions.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "FormRegressionTest.h" +#include "gtest/gtest.h" + using namespace decompiler; TEST_F(FormRegressionTest, StringTest) { @@ -27,7 +28,7 @@ TEST_F(FormRegressionTest, SimplestTest) { " daddu sp, sp, r0"; std::string type = "(function object object)"; std::string expected = "(begin (set! v0-0 a0-0) (ret-value v0-0))"; - test_no_expr(func, type, expected); + test_no_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, Op3) { @@ -39,7 +40,7 @@ TEST_F(FormRegressionTest, Op3) { " daddu sp, sp, r0"; std::string type = "(function int int int)"; std::string expected = "(begin (set! v0-0 (*.si a0-0 a1-0)) (ret-value v0-0))"; - test_no_expr(func, type, expected); + test_no_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, Division) { @@ -52,7 +53,7 @@ TEST_F(FormRegressionTest, Division) { " daddu sp, sp, r0"; std::string type = "(function int int int)"; std::string expected = "(begin (set! v0-0 (/.si a0-0 a1-0)) (ret-value v0-0))"; - test_no_expr(func, type, expected); + test_no_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, Ash) { @@ -72,7 +73,7 @@ TEST_F(FormRegressionTest, Ash) { " sll r0, r0, 0"; std::string type = "(function int int int)"; std::string expected = "(begin (set! v1-0 a0-0) (set! v0-0 (ash.si v1-0 a1-0)) (ret-value v0-0))"; - test_no_expr(func, type, expected); + test_no_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, Abs) { @@ -88,7 +89,7 @@ TEST_F(FormRegressionTest, Abs) { " daddu sp, sp, r0"; std::string type = "(function int int)"; std::string expected = "(begin (set! v0-0 a0-0) (set! v0-0 (abs v0-0)) (ret-value v0-0))"; - test_no_expr(func, type, expected); + test_no_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, Min) { @@ -108,7 +109,7 @@ TEST_F(FormRegressionTest, Min) { " (set! v0-1 (min.si v0-0 v1-0))\n" " (ret-value v0-1)\n" " )"; - test_no_expr(func, type, expected); + test_no_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, Max) { @@ -129,7 +130,7 @@ TEST_F(FormRegressionTest, Max) { " (set! v0-1 (max.si v0-0 v1-0))\n" " (ret-value v0-1)\n" " )"; - test_no_expr(func, type, expected); + test_no_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, FormatString) { @@ -168,7 +169,7 @@ TEST_F(FormRegressionTest, FormatString) { " (set! v0-1 a0-0)\n" " (ret-value v0-1)\n" " )"; - test_no_expr(func, type, expected, false, "", {{"L343", "~f"}}); + test_no_expr_jak1(func, type, expected, false, "", {{"L343", "~f"}}); } TEST_F(FormRegressionTest, WhileLoop) { @@ -211,7 +212,7 @@ TEST_F(FormRegressionTest, WhileLoop) { " (set! v0-0 #f)\n" " (ret-value v0-0)\n" " )"; - test_no_expr(func, type, expected); + test_no_expr_jak1(func, type, expected); } // Note - this test looks weird because or's aren't fully processed at this point. @@ -277,7 +278,7 @@ TEST_F(FormRegressionTest, Or) { " (set! v0-0 #f)\n" " (ret-value v0-0)\n" " )"; - test_no_expr(func, type, expected); + test_no_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, DynamicMethodAccess) { @@ -354,7 +355,7 @@ TEST_F(FormRegressionTest, DynamicMethodAccess) { " )\n" " (ret-value v0-0)\n" " )"; - test_no_expr(func, type, expected); + test_no_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, SimpleLoopMergeCheck) { @@ -396,7 +397,7 @@ TEST_F(FormRegressionTest, SimpleLoopMergeCheck) { " (set! v0-0 (car a0-0))\n" " (ret-value v0-0)\n" " )"; - test_no_expr(func, type, expected, true); + test_no_expr_jak1(func, type, expected, true); } TEST_F(FormRegressionTest, And) { @@ -466,7 +467,7 @@ TEST_F(FormRegressionTest, And) { " )\n" " )" "(ret-value v0-0))\n"; - test_no_expr(func, type, expected, true); + test_no_expr_jak1(func, type, expected, true); } TEST_F(FormRegressionTest, FunctionCall) { @@ -547,7 +548,7 @@ TEST_F(FormRegressionTest, FunctionCall) { " (set! v0-1 a1-0)\n" // not empty, so return the result " )" // the (set! v0 #f) from the if is added later. " (ret-value v0-1))\n"; - test_no_expr(func, type, expected, true); + test_no_expr_jak1(func, type, expected, true); } TEST_F(FormRegressionTest, NestedAndOr) { @@ -714,7 +715,7 @@ TEST_F(FormRegressionTest, NestedAndOr) { " (set! v0-1 a0-0)\n" " (ret-value v0-1)\n" " )"; - test_no_expr(func, type, expected, true); + test_no_expr_jak1(func, type, expected, true); } TEST_F(FormRegressionTest, NewMethod) { @@ -769,7 +770,7 @@ TEST_F(FormRegressionTest, NewMethod) { " (set! (-> v0-0 allocated-length) a2-0)\n" " )" " (ret-value v0-0))\n"; - test_no_expr(func, type, expected, false, "inline-array-class"); + test_no_expr_jak1(func, type, expected, false, "inline-array-class"); } TEST_F(FormRegressionTest, Recursive) { @@ -814,7 +815,7 @@ TEST_F(FormRegressionTest, Recursive) { " )\n" " )" " (ret-value v0-0))\n"; - test_no_expr(func, type, expected, false); + test_no_expr_jak1(func, type, expected, false); } TEST_F(FormRegressionTest, TypeOf) { @@ -850,5 +851,5 @@ TEST_F(FormRegressionTest, TypeOf) { " (set! v0-0 (call! a0-0))\n" " (ret-value v0-0)\n" " )"; - test_no_expr(func, type, expected, false); + test_no_expr_jak1(func, type, expected, false); } diff --git a/test/decompiler/test_FormExpressionBuild.cpp b/test/decompiler/test_FormExpressionBuild.cpp index 85c45a9792..13b404dd5f 100644 --- a/test/decompiler/test_FormExpressionBuild.cpp +++ b/test/decompiler/test_FormExpressionBuild.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "FormRegressionTest.h" +#include "gtest/gtest.h" + using namespace decompiler; TEST_F(FormRegressionTest, ExprIdentity) { @@ -11,7 +12,7 @@ TEST_F(FormRegressionTest, ExprIdentity) { " daddu sp, sp, r0"; std::string type = "(function object object)"; std::string expected = "arg0"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprFloatingPoint) { @@ -30,7 +31,7 @@ TEST_F(FormRegressionTest, ExprFloatingPoint) { " daddiu sp, sp, 16"; std::string type = "(function float float)"; std::string expected = "(/ 0.0 arg0)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprAdditionSigned) { @@ -41,7 +42,7 @@ TEST_F(FormRegressionTest, ExprAdditionSigned) { " daddu sp, sp, r0"; std::string type = "(function int int int)"; std::string expected = "(+ arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprAdditionUnSigned) { @@ -52,7 +53,7 @@ TEST_F(FormRegressionTest, ExprAdditionUnSigned) { " daddu sp, sp, r0"; std::string type = "(function uint uint uint)"; std::string expected = "(+ arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprAdditionMixed1) { @@ -63,7 +64,7 @@ TEST_F(FormRegressionTest, ExprAdditionMixed1) { " daddu sp, sp, r0"; std::string type = "(function int uint int)"; std::string expected = "(+ arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprAdditionMixed2) { @@ -74,7 +75,7 @@ TEST_F(FormRegressionTest, ExprAdditionMixed2) { " daddu sp, sp, r0"; std::string type = "(function uint int uint)"; std::string expected = "(+ arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprAdditionSignedWrongReturn) { @@ -85,7 +86,7 @@ TEST_F(FormRegressionTest, ExprAdditionSignedWrongReturn) { " daddu sp, sp, r0"; std::string type = "(function int int uint)"; std::string expected = "(the-as uint (+ arg0 arg1))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprAdditionUnSignedWrongReturn) { @@ -96,7 +97,7 @@ TEST_F(FormRegressionTest, ExprAdditionUnSignedWrongReturn) { " daddu sp, sp, r0"; std::string type = "(function uint uint int)"; std::string expected = "(the-as int (+ arg0 arg1))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprAdditionMixed1WrongReturn) { @@ -107,7 +108,7 @@ TEST_F(FormRegressionTest, ExprAdditionMixed1WrongReturn) { " daddu sp, sp, r0"; std::string type = "(function int uint uint)"; std::string expected = "(the-as uint (+ arg0 arg1))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprAdditionMixed2WrongReturn) { @@ -118,7 +119,7 @@ TEST_F(FormRegressionTest, ExprAdditionMixed2WrongReturn) { " daddu sp, sp, r0"; std::string type = "(function uint int int)"; std::string expected = "(the-as int (+ arg0 arg1))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprSubtraction) { @@ -129,7 +130,7 @@ TEST_F(FormRegressionTest, ExprSubtraction) { " daddu sp, sp, r0"; std::string type = "(function int int int)"; std::string expected = "(- arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMultiplication) { @@ -140,7 +141,7 @@ TEST_F(FormRegressionTest, ExprMultiplication) { " daddu sp, sp, r0"; std::string type = "(function int int int)"; std::string expected = "(* arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMultiplicationWrong1) { @@ -151,7 +152,7 @@ TEST_F(FormRegressionTest, ExprMultiplicationWrong1) { " daddu sp, sp, r0"; std::string type = "(function int uint int)"; std::string expected = "(* arg0 (the-as int arg1))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMultiplicationWrong2) { @@ -162,7 +163,7 @@ TEST_F(FormRegressionTest, ExprMultiplicationWrong2) { " daddu sp, sp, r0"; std::string type = "(function uint int int)"; std::string expected = "(* (the-as int arg0) arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMultiplicationWrong3) { @@ -173,7 +174,7 @@ TEST_F(FormRegressionTest, ExprMultiplicationWrong3) { " daddu sp, sp, r0"; std::string type = "(function uint uint uint)"; std::string expected = "(the-as uint (* (the-as int arg0) (the-as int arg1)))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprDivision1) { @@ -185,7 +186,7 @@ TEST_F(FormRegressionTest, ExprDivision1) { " daddu sp, sp, r0"; std::string type = "(function int int int)"; std::string expected = "(/ arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprDivision2) { @@ -197,7 +198,7 @@ TEST_F(FormRegressionTest, ExprDivision2) { " daddu sp, sp, r0"; std::string type = "(function uint int int)"; std::string expected = "(/ (the-as int arg0) arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprDivision3) { @@ -209,7 +210,7 @@ TEST_F(FormRegressionTest, ExprDivision3) { " daddu sp, sp, r0"; std::string type = "(function int uint int)"; std::string expected = "(/ arg0 (the-as int arg1))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprDivision4) { @@ -221,7 +222,7 @@ TEST_F(FormRegressionTest, ExprDivision4) { " daddu sp, sp, r0"; std::string type = "(function uint uint uint)"; std::string expected = "(the-as uint (/ (the-as int arg0) (the-as int arg1)))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprAsh) { @@ -239,7 +240,7 @@ TEST_F(FormRegressionTest, ExprAsh) { " daddu sp, sp, r0"; std::string type = "(function int int int)"; std::string expected = "(ash arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMod) { @@ -251,7 +252,7 @@ TEST_F(FormRegressionTest, ExprMod) { " daddu sp, sp, r0"; std::string type = "(function int int int)"; std::string expected = "(mod arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprAbs) { @@ -267,7 +268,7 @@ TEST_F(FormRegressionTest, ExprAbs) { " daddu sp, sp, r0"; std::string type = "(function int int)"; std::string expected = "(abs arg0)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMin) { @@ -281,7 +282,7 @@ TEST_F(FormRegressionTest, ExprMin) { " daddu sp, sp, r0"; std::string type = "(function int int int)"; std::string expected = "(min arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMax) { @@ -295,7 +296,7 @@ TEST_F(FormRegressionTest, ExprMax) { " daddu sp, sp, r0"; std::string type = "(function int int int)"; std::string expected = "(max arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprLogior) { @@ -306,7 +307,7 @@ TEST_F(FormRegressionTest, ExprLogior) { " daddu sp, sp, r0"; std::string type = "(function int int int)"; std::string expected = "(logior arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprLogxor) { @@ -317,7 +318,7 @@ TEST_F(FormRegressionTest, ExprLogxor) { " daddu sp, sp, r0"; std::string type = "(function int int int)"; std::string expected = "(logxor arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprLognor) { @@ -328,7 +329,7 @@ TEST_F(FormRegressionTest, ExprLognor) { " daddu sp, sp, r0"; std::string type = "(function int int int)"; std::string expected = "(lognor arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprLogand) { @@ -339,7 +340,7 @@ TEST_F(FormRegressionTest, ExprLogand) { " daddu sp, sp, r0"; std::string type = "(function int int int)"; std::string expected = "(logand arg0 arg1)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprLognot) { @@ -350,7 +351,7 @@ TEST_F(FormRegressionTest, ExprLognot) { " daddu sp, sp, r0"; std::string type = "(function int int)"; std::string expected = "(lognot arg0)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprFalse) { @@ -361,7 +362,7 @@ TEST_F(FormRegressionTest, ExprFalse) { " daddu sp, sp, r0"; std::string type = "(function symbol)"; std::string expected = "#f"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprTrue) { @@ -372,7 +373,7 @@ TEST_F(FormRegressionTest, ExprTrue) { " daddu sp, sp, r0"; std::string type = "(function symbol)"; std::string expected = "#t"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprPrintBfloat) { @@ -402,7 +403,7 @@ TEST_F(FormRegressionTest, ExprPrintBfloat) { std::string type = "(function bfloat bfloat)"; std::string expected = "(begin (format #t \"~f\" (-> arg0 data)) arg0)"; - test_with_expr(func, type, expected, false, "", {{"L343", "~f"}}); + test_with_expr_jak1(func, type, expected, false, "", {{"L343", "~f"}}); } TEST_F(FormRegressionTest, ExprSizeOfType) { @@ -424,7 +425,7 @@ TEST_F(FormRegressionTest, ExprSizeOfType) { std::string type = "(function type uint)"; std::string expected = "(logand 3 (+ (* (-> arg0 allocated-length) 4) 43))"; - test_with_expr(func, type, expected, false, ""); + test_with_expr_jak1(func, type, expected, false, ""); } TEST_F(FormRegressionTest, ExprBasicTypeP) { @@ -467,7 +468,7 @@ TEST_F(FormRegressionTest, ExprBasicTypeP) { " )\n" " #f\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, FinalBasicTypeP) { @@ -510,7 +511,7 @@ TEST_F(FormRegressionTest, FinalBasicTypeP) { " )\n" " #f\n" " )"; - test_final_function(func, type, expected); + test_final_function_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprTypeTypep) { @@ -564,7 +565,7 @@ TEST_F(FormRegressionTest, ExprTypeTypep) { " )\n" " #f\n" " )"; - test_with_expr(func, type, expected, false, ""); + test_with_expr_jak1(func, type, expected, false, ""); } TEST_F(FormRegressionTest, ExprFindParentMethod) { @@ -628,7 +629,7 @@ TEST_F(FormRegressionTest, ExprFindParentMethod) { " )\n" " v0-0\n" " )"; - test_with_expr(func, type, expected, false, ""); + test_with_expr_jak1(func, type, expected, false, ""); } TEST_F(FormRegressionTest, ExprRef) { @@ -659,7 +660,7 @@ TEST_F(FormRegressionTest, ExprRef) { std::string expected = "(begin (dotimes (v1-0 arg1) (nop!) (nop!) (set! arg0 (cdr arg0))) (car arg0))"; - test_with_expr(func, type, expected, true, ""); + test_with_expr_jak1(func, type, expected, true, ""); } TEST_F(FormRegressionTest, ExprPairMethod4) { @@ -727,7 +728,7 @@ TEST_F(FormRegressionTest, ExprPairMethod4) { " )\n" " v0-0\n" " )"; - test_with_expr(func, type, expected, true, ""); + test_with_expr_jak1(func, type, expected, true, ""); } TEST_F(FormRegressionTest, ExprPairMethod5) { @@ -740,7 +741,7 @@ TEST_F(FormRegressionTest, ExprPairMethod5) { std::string type = "(function pair uint)"; std::string expected = "(-> pair size)"; - test_with_expr(func, type, expected, false, ""); + test_with_expr_jak1(func, type, expected, false, ""); } TEST_F(FormRegressionTest, ExprLast) { @@ -773,7 +774,7 @@ TEST_F(FormRegressionTest, ExprLast) { " (while (not (null? (cdr v0-0))) (nop!) (nop!) (set! v0-0 (cdr v0-0)))\n" " v0-0\n" " )"; - test_with_expr(func, type, expected, true, ""); + test_with_expr_jak1(func, type, expected, true, ""); } TEST_F(FormRegressionTest, ExprMember) { @@ -825,7 +826,7 @@ TEST_F(FormRegressionTest, ExprMember) { " )\n" " (if (not (null? v1-0)) v1-0)\n" " )"; - test_with_expr(func, type, expected, true, ""); + test_with_expr_jak1(func, type, expected, true, ""); } TEST_F(FormRegressionTest, ExprNmember) { @@ -887,7 +888,7 @@ TEST_F(FormRegressionTest, ExprNmember) { " )\n" " (if (not (null? arg1)) arg1)\n" " )"; - test_with_expr(func, type, expected, true, ""); + test_with_expr_jak1(func, type, expected, true, ""); } TEST_F(FormRegressionTest, ExprAssoc) { @@ -938,7 +939,7 @@ TEST_F(FormRegressionTest, ExprAssoc) { " )\n" " (if (not (null? v1-0)) (car v1-0))\n" " )"; - test_with_expr(func, type, expected, true, ""); + test_with_expr_jak1(func, type, expected, true, ""); } TEST_F(FormRegressionTest, ExprAssoce) { @@ -1006,7 +1007,7 @@ TEST_F(FormRegressionTest, ExprAssoce) { " )\n" " (if (not (null? v1-0)) (car v1-0))\n" " )"; - test_with_expr(func, type, expected, true, ""); + test_with_expr_jak1(func, type, expected, true, ""); } TEST_F(FormRegressionTest, ExprNassoc) { @@ -1097,7 +1098,7 @@ TEST_F(FormRegressionTest, ExprNassoc) { " )\n" " (if (not (null? arg1)) (car arg1))\n" " )"; - test_with_expr(func, type, expected, true, ""); + test_with_expr_jak1(func, type, expected, true, ""); } TEST_F(FormRegressionTest, ExprNassoce) { @@ -1202,7 +1203,7 @@ TEST_F(FormRegressionTest, ExprNassoce) { " )\n" " (if (not (null? arg1)) (car arg1))\n" " )"; - test_with_expr(func, type, expected, true, ""); + test_with_expr_jak1(func, type, expected, true, ""); } TEST_F(FormRegressionTest, ExprAppend) { @@ -1261,7 +1262,7 @@ TEST_F(FormRegressionTest, ExprAppend) { " arg0\n" " )\n" " )"; - test_with_expr(func, type, expected, true, ""); + test_with_expr_jak1(func, type, expected, true, ""); } TEST_F(FormRegressionTest, ExprDelete) { @@ -1338,7 +1339,7 @@ TEST_F(FormRegressionTest, ExprDelete) { " )\n" " )\n" " )"; - test_with_expr(func, type, expected, true, ""); + test_with_expr_jak1(func, type, expected, true, ""); } TEST_F(FormRegressionTest, ExprDeleteCar) { @@ -1417,7 +1418,7 @@ TEST_F(FormRegressionTest, ExprDeleteCar) { " )\n" " )\n" " )"; - test_with_expr(func, type, expected, true, ""); + test_with_expr_jak1(func, type, expected, true, ""); } TEST_F(FormRegressionTest, ExprInsertCons) { @@ -1450,7 +1451,7 @@ TEST_F(FormRegressionTest, ExprInsertCons) { // NOTE - this appears to _not_ be a nested call. std::string expected = "(let ((a3-0 (delete-car! (car arg0) arg1))) (cons arg0 a3-0))"; - test_with_expr(func, type, expected, true, ""); + test_with_expr_jak1(func, type, expected, true, ""); } TEST_F(FormRegressionTest, ExprSort) { @@ -1586,7 +1587,7 @@ TEST_F(FormRegressionTest, ExprSort) { " )\n" " arg0\n" " )"; - test_with_expr(func, type, expected, true, ""); + test_with_expr_jak1(func, type, expected, true, ""); } TEST_F(FormRegressionTest, ExprInlineArrayMethod0) { @@ -1638,7 +1639,7 @@ TEST_F(FormRegressionTest, ExprInlineArrayMethod0) { " )\n" " v0-0\n" " )"; - test_with_expr(func, type, expected, true, "inline-array-class"); + test_with_expr_jak1(func, type, expected, true, "inline-array-class"); } TEST_F(FormRegressionTest, ExprInlineArrayMethod4) { @@ -1650,7 +1651,7 @@ TEST_F(FormRegressionTest, ExprInlineArrayMethod4) { std::string type = "(function inline-array-class int)"; std::string expected = "(-> arg0 length)"; - test_with_expr(func, type, expected, true, "inline-array-class"); + test_with_expr_jak1(func, type, expected, true, "inline-array-class"); } TEST_F(FormRegressionTest, ExprInlineArrayMethod5) { @@ -1675,7 +1676,7 @@ TEST_F(FormRegressionTest, ExprInlineArrayMethod5) { " (* (-> arg0 allocated-length) (the-as int (-> arg0 type heap-base)))\n" " )\n" " )"; - test_with_expr(func, type, expected, true, "inline-array-class"); + test_with_expr_jak1(func, type, expected, true, "inline-array-class"); } TEST_F(FormRegressionTest, ExprArrayMethod0) { @@ -1757,7 +1758,7 @@ TEST_F(FormRegressionTest, ExprArrayMethod0) { " (set! (-> v0-1 content-type) arg2)\n" " v0-1\n" " )"; - test_with_expr(func, type, expected, true, "array"); + test_with_expr_jak1(func, type, expected, true, "array"); } TEST_F(FormRegressionTest, ExprArrayMethod4) { @@ -1770,7 +1771,7 @@ TEST_F(FormRegressionTest, ExprArrayMethod4) { std::string type = "(function array int)"; std::string expected = "(-> arg0 length)"; - test_with_expr(func, type, expected, true, "array"); + test_with_expr_jak1(func, type, expected, true, "array"); } TEST_F(FormRegressionTest, ExprArrayMethod5) { @@ -1825,7 +1826,7 @@ TEST_F(FormRegressionTest, ExprArrayMethod5) { " )\n" " )\n" " )"; - test_with_expr(func, type, expected, true, "array"); + test_with_expr_jak1(func, type, expected, true, "array"); } TEST_F(FormRegressionTest, ExprMemCopy) { @@ -1865,7 +1866,7 @@ TEST_F(FormRegressionTest, ExprMemCopy) { " )\n" " v0-0\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMemSet32) { @@ -1904,7 +1905,7 @@ TEST_F(FormRegressionTest, ExprMemSet32) { " )\n" " v0-0\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMemOr) { @@ -1947,7 +1948,7 @@ TEST_F(FormRegressionTest, ExprMemOr) { " )\n" " v0-0\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprFact) { @@ -1981,7 +1982,7 @@ TEST_F(FormRegressionTest, ExprFact) { std::string type = "(function int int)"; std::string expected = "(if (= arg0 1) 1 (* arg0 (fact (+ arg0 -1))))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprPrint) { @@ -2009,7 +2010,7 @@ TEST_F(FormRegressionTest, ExprPrint) { std::string type = "(function object object)"; std::string expected = "((method-of-type (rtype-of arg0) print) arg0)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprPrintl) { @@ -2057,7 +2058,7 @@ TEST_F(FormRegressionTest, ExprPrintl) { " (format #t \"~%\")\n" " arg0\n" " )"; - test_with_expr(func, type, expected, false, "", {{"L324", "~%"}}); + test_with_expr_jak1(func, type, expected, false, "", {{"L324", "~%"}}); } TEST_F(FormRegressionTest, ExprInspect) { @@ -2085,7 +2086,7 @@ TEST_F(FormRegressionTest, ExprInspect) { std::string type = "(function object object)"; std::string expected = "((method-of-type (rtype-of arg0) inspect) arg0)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprPrintTreeBitmask) { @@ -2156,7 +2157,7 @@ TEST_F(FormRegressionTest, ExprPrintTreeBitmask) { " )\n" " #f\n" " )"; - test_with_expr(func, type, expected, false, "", {{"L323", " "}, {"L322", "| "}}); + test_with_expr_jak1(func, type, expected, false, "", {{"L323", " "}, {"L322", "| "}}); } TEST_F(FormRegressionTest, ExprPrintName) { @@ -2277,9 +2278,9 @@ TEST_F(FormRegressionTest, ExprPrintName) { "(the-as int arg0))))))\n" " )\n" " )"; - test_with_expr(func, type, expected, false, "", {}, - "[\t\t[24, \"a1\", \"symbol\"],\n" - "\t\t[39, \"a0\", \"symbol\"]]"); + test_with_expr_jak1(func, type, expected, false, "", {}, + "[\t\t[24, \"a1\", \"symbol\"],\n" + "\t\t[39, \"a0\", \"symbol\"]]"); } TEST_F(FormRegressionTest, ExprProfileBarMethod9) { @@ -2295,7 +2296,7 @@ TEST_F(FormRegressionTest, ExprProfileBarMethod9) { std::string type = "(function profile-bar int uint)"; std::string expected = "(-> arg0 data (+ (-> arg0 profile-frame-count) -2) time-stamp)"; - test_with_expr(func, type, expected, false, ""); + test_with_expr_jak1(func, type, expected, false, ""); } TEST_F(FormRegressionTest, ExprStopwatchElapsedSeconds) { @@ -2325,7 +2326,7 @@ TEST_F(FormRegressionTest, ExprStopwatchElapsedSeconds) { std::string type = "(function int float)"; std::string expected = "(let ((v1-0 (abs arg0))) (* 0.0 (the float v1-0)))"; - test_with_expr(func, type, expected, false, ""); + test_with_expr_jak1(func, type, expected, false, ""); } TEST_F(FormRegressionTest, ExprCopyStringString) { @@ -2373,7 +2374,7 @@ TEST_F(FormRegressionTest, ExprCopyStringString) { " )\n" " arg0\n" " )"; - test_with_expr(func, type, expected, false, ""); + test_with_expr_jak1(func, type, expected, false, ""); } TEST_F(FormRegressionTest, StringLt) { @@ -2478,7 +2479,7 @@ TEST_F(FormRegressionTest, StringLt) { " )\n" " #f\n" " )"; - test_with_expr(func, type, expected, false, ""); + test_with_expr_jak1(func, type, expected, false, ""); } TEST_F(FormRegressionTest, ExprAssert) { @@ -2509,7 +2510,7 @@ TEST_F(FormRegressionTest, ExprAssert) { std::string type = "(function symbol string int)"; std::string expected = "(begin (if (not arg0) (format #t \"A ~A\" arg1)) 0)"; - test_with_expr(func, type, expected, false, "", {{"L17", "A ~A"}}); + test_with_expr_jak1(func, type, expected, false, "", {{"L17", "A ~A"}}); } TEST_F(FormRegressionTest, ExprTerminal2) { @@ -2546,7 +2547,7 @@ TEST_F(FormRegressionTest, ExprTerminal2) { " ((f0-4 (sqrtf (/ (- (* 0.0 arg0) arg1) arg2))))\n" " (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4))))\n" " )"; - test_with_expr(func, type, expected, false, "", {{"L17", "A ~A"}}); + test_with_expr_jak1(func, type, expected, false, "", {{"L17", "A ~A"}}); } TEST_F(FormRegressionTest, MoveFalse) { @@ -2567,7 +2568,7 @@ TEST_F(FormRegressionTest, MoveFalse) { std::string type = "(function int symbol)"; std::string expected = "(logtest? (+ arg0 12) 1)"; - test_with_expr(func, type, expected, false, "", {{"L17", "A ~A"}}); + test_with_expr_jak1(func, type, expected, false, "", {{"L17", "A ~A"}}); } // Good for testing that in-place ops (+!) check the _variable_ is the same. @@ -2619,7 +2620,7 @@ TEST_F(FormRegressionTest, QMemCpy) { " )\n" " v0-0\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, StripStripTrailingWhitespace) { @@ -2727,7 +2728,7 @@ TEST_F(FormRegressionTest, StripStripTrailingWhitespace) { " )\n" " #f\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } // Let bug (github #328) @@ -2781,7 +2782,7 @@ TEST_F(FormRegressionTest, TimeToGround) { " )\n" " (the-as float v0-0)\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } // Infinite loop bug (github #196) @@ -2809,12 +2810,12 @@ TEST_F(FormRegressionTest, LoopingCode) { std::string type = "(function symbol)"; std::string expected = "(begin\n" - " (while #t\n" + " (loop\n" " (suspend)\n" " )\n" " (the-as symbol #f)\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, AbsAsSideEffect) { @@ -2868,7 +2869,7 @@ TEST_F(FormRegressionTest, AbsAsSideEffect) { " )\n" " )\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } // for github https://github.com/water111/jak-project/issues/332 @@ -2904,7 +2905,7 @@ TEST_F(FormRegressionTest, AshPropagation) { " (logior! (-> arg0 bytes (/ arg1 8)) (ash 1 (logand arg1 7)))\n" " 0\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } // for github https://github.com/water111/jak-project/issues/332 @@ -2938,5 +2939,5 @@ TEST_F(FormRegressionTest, AshPropagation2) { "(let ((v1-2 (-> arg0 bytes (/ arg1 8))))\n" " (logtest? v1-2 (ash 1 (logand arg1 7)))\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } \ No newline at end of file diff --git a/test/decompiler/test_FormExpressionBuild2.cpp b/test/decompiler/test_FormExpressionBuild2.cpp index 885771a602..3eb73d2bd5 100644 --- a/test/decompiler/test_FormExpressionBuild2.cpp +++ b/test/decompiler/test_FormExpressionBuild2.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "FormRegressionTest.h" +#include "gtest/gtest.h" + using namespace decompiler; // tests stack variables @@ -49,10 +50,10 @@ TEST_F(FormRegressionTest, MatrixPMult) { " )\n" " arg0\n" " )"; - test_with_stack_structures(func, type, expected, - "[\n" - " [16, \"matrix\"]\n" - " ]"); + test_with_stack_structures_jak1(func, type, expected, + "[\n" + " [16, \"matrix\"]\n" + " ]"); } // TODO- this should also work without the cast, but be uglier. @@ -95,11 +96,11 @@ TEST_F(FormRegressionTest, VectorXQuaternionWithCast) { " )\n" " arg0\n" " )"; - test_with_stack_structures(func, type, expected, - "[\n" - " [16, \"matrix\"]\n" - " ]", - "[[10, \"v1\", \"(pointer uint128)\"]]"); + test_with_stack_structures_jak1(func, type, expected, + "[\n" + " [16, \"matrix\"]\n" + " ]", + "[[10, \"v1\", \"(pointer uint128)\"]]"); } TEST_F(FormRegressionTest, EliminateFloatDeadSet) { @@ -226,7 +227,7 @@ TEST_F(FormRegressionTest, EliminateFloatDeadSet) { " )\n" " )\n" " )"; - test_with_stack_structures(func, type, expected, "[]"); + test_with_stack_structures_jak1(func, type, expected, "[]"); } TEST_F(FormRegressionTest, IterateProcessTree) { @@ -318,7 +319,7 @@ TEST_F(FormRegressionTest, IterateProcessTree) { " )\n" " s4-0\n" " )"; - test_with_stack_structures(func, type, expected, "[]"); + test_with_stack_structures_jak1(func, type, expected, "[]"); } TEST_F(FormRegressionTest, InspectVifStatBitfield) { @@ -450,18 +451,18 @@ TEST_F(FormRegressionTest, InspectVifStatBitfield) { " (format #t \"~T ~D~%\" (-> arg0 fqc))\n" " arg0\n" " )"; - test_with_expr(func, type, expected, false, "", - {{"L37", "[~8x] ~A~%"}, - {"L36", "~T ~D~%"}, - {"L35", "~T ~D~%"}, - {"L34", "~T ~D~%"}, - {"L33", "~T ~D~%"}, - {"L32", "~T ~D~%"}, - {"L31", "~T ~D~%"}, - {"L30", "~T ~D~%"}, - {"L29", "~T ~D~%"}, - {"L28", "~T ~D~%"}, - {"L27", "~T ~D~%"}}); + test_with_expr_jak1(func, type, expected, false, "", + {{"L37", "[~8x] ~A~%"}, + {"L36", "~T ~D~%"}, + {"L35", "~T ~D~%"}, + {"L34", "~T ~D~%"}, + {"L33", "~T ~D~%"}, + {"L32", "~T ~D~%"}, + {"L31", "~T ~D~%"}, + {"L30", "~T ~D~%"}, + {"L29", "~T ~D~%"}, + {"L28", "~T ~D~%"}, + {"L27", "~T ~D~%"}}); } TEST_F(FormRegressionTest, InspectHandleBitfield) { @@ -511,8 +512,9 @@ TEST_F(FormRegressionTest, InspectHandleBitfield) { " (format #t \"~Tpid: ~D~%\" (-> arg0 pid))\n" " arg0\n" " )"; - test_with_expr(func, type, expected, false, "", - {{"L79", "[~8x] ~A~%"}, {"L32", "~Tprocess: #x~X~%"}, {"L31", "~Tpid: ~D~%"}}); + test_with_expr_jak1( + func, type, expected, false, "", + {{"L79", "[~8x] ~A~%"}, {"L32", "~Tprocess: #x~X~%"}, {"L31", "~Tpid: ~D~%"}}); } TEST_F(FormRegressionTest, InspectDmaTagBitfield) { @@ -597,16 +599,16 @@ TEST_F(FormRegressionTest, InspectDmaTagBitfield) { " (format #t \"~Ta: ~D~%\" (-> arg0 spr))\n" " arg0\n" " )"; - test_with_expr(func, type, expected, false, "", - { - {"L65", "[~8x] ~A~%"}, - {"L37", "~Ta: ~D~%"}, - {"L36", "~Ta: ~D~%"}, - {"L35", "~Ta: ~D~%"}, - {"L34", "~Ta: ~D~%"}, - {"L33", "~Ta: ~D~%"}, - {"L32", "~Ta: ~D~%"}, - }); + test_with_expr_jak1(func, type, expected, false, "", + { + {"L65", "[~8x] ~A~%"}, + {"L37", "~Ta: ~D~%"}, + {"L36", "~Ta: ~D~%"}, + {"L35", "~Ta: ~D~%"}, + {"L34", "~Ta: ~D~%"}, + {"L33", "~Ta: ~D~%"}, + {"L32", "~Ta: ~D~%"}, + }); } // Tests nonzero-check on bitfield @@ -660,7 +662,7 @@ TEST_F(FormRegressionTest, DmaSyncCrash) { " )\n" " 0\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, DmaSend) { @@ -741,7 +743,7 @@ TEST_F(FormRegressionTest, DmaSend) { " (.sync.l)\n" " 0\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, DmaInitialize) { @@ -775,9 +777,9 @@ TEST_F(FormRegressionTest, DmaInitialize) { " (set! (-> (the-as vif-bank #x10003c00) err me0) 1)\n" " 0\n" " )"; - test_with_expr(func, type, expected, false, "", {}, - "[[1, \"v1\", \"vif-bank\"], [8, \"v1\", \"vif-bank\"], [6, \"a0\", " - "\"vif-bank\"], [13, \"a0\", \"vif-bank\"]]"); + test_with_expr_jak1(func, type, expected, false, "", {}, + "[[1, \"v1\", \"vif-bank\"], [8, \"v1\", \"vif-bank\"], [6, \"a0\", " + "\"vif-bank\"], [13, \"a0\", \"vif-bank\"]]"); } // Dynamic bitfield stuff. @@ -858,7 +860,7 @@ TEST_F(FormRegressionTest, SetDisplayEnv) { " (set! (-> arg0 bgcolor) (new 'static 'gs-bgcolor))\n" " arg0\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, DmaBufferAddVuFunction) { @@ -973,7 +975,7 @@ TEST_F(FormRegressionTest, DmaBufferAddVuFunction) { " )\n" " #f\n" " )"; - test_with_expr(func, type, expected, false, "", {}, "[[[9, 33], \"t2\", \"dma-packet\"]]"); + test_with_expr_jak1(func, type, expected, false, "", {}, "[[[9, 33], \"t2\", \"dma-packet\"]]"); } TEST_F(FormRegressionTest, DmaBucketInsertTag) { @@ -996,11 +998,11 @@ TEST_F(FormRegressionTest, DmaBucketInsertTag) { " )\n" " arg2\n" " )"; - test_with_expr(func, type, expected, false, "", {}, - "[\n" - " [[2, 6], \"v1\", \"dma-bucket\"],\n" - " [3, \"a0\", \"dma-bucket\"]\n" - " ]"); + test_with_expr_jak1(func, type, expected, false, "", {}, + "[\n" + " [[2, 6], \"v1\", \"dma-bucket\"],\n" + " [3, \"a0\", \"dma-bucket\"]\n" + " ]"); } TEST_F(FormRegressionTest, StupidFloatMove) { @@ -1108,7 +1110,7 @@ TEST_F(FormRegressionTest, StupidFloatMove) { " )\n" " 0.0\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } // gpr->fpr not being propagated @@ -1127,7 +1129,7 @@ TEST_F(FormRegressionTest, Method11FontContext) { " (set! (-> arg0 origin z) (the float arg1))\n" " arg0\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } // 128-bit bitfields, also type for pextuw @@ -1165,7 +1167,7 @@ TEST_F(FormRegressionTest, Method4ResTag) { " (* (-> arg0 elt-count) (-> arg0 elt-type size))\n" " )\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, MakeSqrtTable) { @@ -1239,7 +1241,7 @@ TEST_F(FormRegressionTest, MakeSqrtTable) { " 0\n" " (none)\n" " )"; - test_with_expr( + test_with_expr_jak1( func, type, expected, false, "", {{"L190", "static int sqrt_table[256] =~%{~%"}, {"L189", "~D,~%"}, {"L188", "};~%"}}); } @@ -1287,7 +1289,7 @@ TEST_F(FormRegressionTest, Method2Vec4s) { " )\n" " arg0\n" " )"; - test_with_expr(func, type, expected, false, "", {{"L344", "#"}}); + test_with_expr_jak1(func, type, expected, false, "", {{"L344", "#"}}); } TEST_F(FormRegressionTest, SoundNameEqual) { @@ -1309,7 +1311,7 @@ TEST_F(FormRegressionTest, SoundNameEqual) { std::string type = "(function sound-name sound-name symbol)"; std::string expected = "(and (= (the-as uint arg0) (the-as uint arg1)) (= (-> arg0 hi) (-> arg1 hi)))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, DebugMenuFuncDecode) { @@ -1375,7 +1377,7 @@ TEST_F(FormRegressionTest, DebugMenuFuncDecode) { " )\n" " )\n" " )"; - test_with_expr(func, type, expected, false, "", {}, "[[13, \"a0\", \"symbol\"]]"); + test_with_expr_jak1(func, type, expected, false, "", {}, "[[13, \"a0\", \"symbol\"]]"); } TEST_F(FormRegressionTest, MatrixNewInlineProp) { @@ -1430,7 +1432,7 @@ TEST_F(FormRegressionTest, MatrixNewInlineProp) { " )\n" " arg0\n" " )"; - test_with_stack_structures(func, type, expected, R"([[16, "matrix"]])"); + test_with_stack_structures_jak1(func, type, expected, R"([[16, "matrix"]])"); } TEST_F(FormRegressionTest, VectorNewInlineProp) { @@ -1490,7 +1492,7 @@ TEST_F(FormRegressionTest, VectorNewInlineProp) { " )\n" " arg0\n" " )"; - test_with_stack_structures(func, type, expected, R"([[16, "vector"]])"); + test_with_stack_structures_jak1(func, type, expected, R"([[16, "vector"]])"); } TEST_F(FormRegressionTest, Method23Trsqv) { @@ -1516,7 +1518,7 @@ TEST_F(FormRegressionTest, Method23Trsqv) { std::string type = "(function trsqv vector float)"; std::string expected = "(vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg1 (-> arg0 trans)))"; - test_with_stack_structures(func, type, expected, R"([[16, "vector"]])"); + test_with_stack_structures_jak1(func, type, expected, R"([[16, "vector"]])"); } TEST_F(FormRegressionTest, VectorLineDistance) { @@ -1611,6 +1613,6 @@ TEST_F(FormRegressionTest, VectorLineDistance) { " )\n" " (vector-length (vector-! (new-stack-vector0) gp-1 v1-3))\n" " )"; - test_with_stack_structures(func, type, expected, - R"([[16, "vector"], [32, "vector"], [48, "vector"], [64, "vector"]])"); + test_with_stack_structures_jak1( + func, type, expected, R"([[16, "vector"], [32, "vector"], [48, "vector"], [64, "vector"]])"); } diff --git a/test/decompiler/test_FormExpressionBuild3.cpp b/test/decompiler/test_FormExpressionBuild3.cpp index a7ff033c6b..2b51cc38a7 100644 --- a/test/decompiler/test_FormExpressionBuild3.cpp +++ b/test/decompiler/test_FormExpressionBuild3.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "FormRegressionTest.h" +#include "gtest/gtest.h" + using namespace decompiler; // vector-rad<-vector-deg/2! @@ -52,7 +53,7 @@ TEST_F(FormRegressionTest, VectorDegToVectorRad) { " (none)\n" " )\n" " )"; - test_final_function(func, type, expected); + test_final_function_jak1(func, type, expected); } // weird short circuit thing @@ -140,7 +141,7 @@ TEST_F(FormRegressionTest, WeirdShortCircuit) { " )\n" " s5-0\n" " )"; - test_with_stack_structures(func, type, expected, "[[16, \"event-message-block\"]]"); + test_with_stack_structures_jak1(func, type, expected, "[[16, \"event-message-block\"]]"); } TEST_F(FormRegressionTest, WeirdShortCircuit2) { @@ -161,5 +162,5 @@ TEST_F(FormRegressionTest, WeirdShortCircuit2) { " daddu sp, sp, r0"; std::string type = "(function actor-link-info object)"; std::string expected = "(the-as object (and (-> arg0 prev) (-> arg0 prev extra process)))"; - test_with_stack_structures(func, type, expected, "[[16, \"event-message-block\"]]"); + test_with_stack_structures_jak1(func, type, expected, "[[16, \"event-message-block\"]]"); } \ No newline at end of file diff --git a/test/decompiler/test_FormExpressionBuildLong.cpp b/test/decompiler/test_FormExpressionBuildLong.cpp index a5f2afb118..f0f0bf907e 100644 --- a/test/decompiler/test_FormExpressionBuildLong.cpp +++ b/test/decompiler/test_FormExpressionBuildLong.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "FormRegressionTest.h" +#include "gtest/gtest.h" + using namespace decompiler; TEST_F(FormRegressionTest, ExprArrayMethod2) { @@ -664,32 +665,32 @@ TEST_F(FormRegressionTest, ExprArrayMethod2) { " (format #t \")\")\n" " arg0\n" " )"; - test_with_expr(func, type, expected, true, "array", - {{"L343", "~f"}, - {"L342", "#("}, - {"L341", "~D"}, - {"L340", " ~D"}, - {"L339", "#x~X"}, - {"L338", " #x~X"}, - {"L337", " ~f"}, - {"L336", "~A"}, - {"L335", " ~A"}, - {"L334", ")"}}, - "[" - "\t\t[23, \"gp\", \"(array int32)\"],\n" - "\t\t[43, \"gp\", \"(array uint32)\"],\n" - "\t\t[63, \"gp\", \"(array int64)\"],\n" - "\t\t[83, \"gp\", \"(array uint64)\"],\n" - "\t\t[102, \"gp\", \"(array int8)\"],\n" - "\t\t[121, \"gp\", \"(array uint8)\"],\n" - "\t\t[141, \"gp\", \"(array int16)\"],\n" - "\t\t[161, \"gp\", \"(array uint16)\"],\n" - "\t\t[186, \"gp\", \"(array uint128)\"],\n" - "\t\t[204, \"gp\", \"(array int32)\"],\n" - "\t\t[223, \"gp\", \"(array float)\"],\n" - "\t\t[232, \"gp\", \"(array float)\"],\n" - "\t\t[249, \"gp\", \"(array basic)\"],\n" - "\t\t[258, \"gp\", \"(array basic)\"]]"); + test_with_expr_jak1(func, type, expected, true, "array", + {{"L343", "~f"}, + {"L342", "#("}, + {"L341", "~D"}, + {"L340", " ~D"}, + {"L339", "#x~X"}, + {"L338", " #x~X"}, + {"L337", " ~f"}, + {"L336", "~A"}, + {"L335", " ~A"}, + {"L334", ")"}}, + "[" + "\t\t[23, \"gp\", \"(array int32)\"],\n" + "\t\t[43, \"gp\", \"(array uint32)\"],\n" + "\t\t[63, \"gp\", \"(array int64)\"],\n" + "\t\t[83, \"gp\", \"(array uint64)\"],\n" + "\t\t[102, \"gp\", \"(array int8)\"],\n" + "\t\t[121, \"gp\", \"(array uint8)\"],\n" + "\t\t[141, \"gp\", \"(array int16)\"],\n" + "\t\t[161, \"gp\", \"(array uint16)\"],\n" + "\t\t[186, \"gp\", \"(array uint128)\"],\n" + "\t\t[204, \"gp\", \"(array int32)\"],\n" + "\t\t[223, \"gp\", \"(array float)\"],\n" + "\t\t[232, \"gp\", \"(array float)\"],\n" + "\t\t[249, \"gp\", \"(array basic)\"],\n" + "\t\t[258, \"gp\", \"(array basic)\"]]"); } TEST_F(FormRegressionTest, ExprArrayMethod3) { @@ -1225,28 +1226,28 @@ TEST_F(FormRegressionTest, ExprArrayMethod3) { " )\n" " arg0\n" " )"; - test_with_expr(func, type, expected, true, "array", - {{"L333", "[~8x] ~A~%"}, - {"L332", "~Tallocated-length: ~D~%"}, - {"L331", "~Tlength: ~D~%"}, - {"L330", " ~Tcontent-type: ~A~%"}, - {"L329", "~Tdata[~D]: @ #x~X~%"}, - {"L328", "~T [~D] ~D~%"}, - {"L327", "~T [~D] #x~X~%"}, - {"L326", "~T [~D] ~f~%"}, - {"L325", "~T [~D] ~A~%"}}, - "[\t\t[44, \"gp\", \"(array int32)\"],\n" - "\t\t[62, \"gp\", \"(array uint32)\"],\n" - "\t\t[80, \"gp\", \"(array int64)\"],\n" - "\t\t[98, \"gp\", \"(array uint64)\"],\n" - "\t\t[115, \"gp\", \"(array int8)\"],\n" - "\t\t[132, \"gp\", \"(array int8)\"],\n" - "\t\t[150, \"gp\", \"(array int16)\"],\n" - "\t\t[168, \"gp\", \"(array uint16)\"],\n" - "\t\t[191, \"gp\", \"(array uint128)\"],\n" - "\t\t[207, \"gp\", \"(array int32)\"],\n" - "\t\t[226, \"gp\", \"(array float)\"],\n" - "\t\t[243, \"gp\", \"(array basic)\"]]"); + test_with_expr_jak1(func, type, expected, true, "array", + {{"L333", "[~8x] ~A~%"}, + {"L332", "~Tallocated-length: ~D~%"}, + {"L331", "~Tlength: ~D~%"}, + {"L330", " ~Tcontent-type: ~A~%"}, + {"L329", "~Tdata[~D]: @ #x~X~%"}, + {"L328", "~T [~D] ~D~%"}, + {"L327", "~T [~D] #x~X~%"}, + {"L326", "~T [~D] ~f~%"}, + {"L325", "~T [~D] ~A~%"}}, + "[\t\t[44, \"gp\", \"(array int32)\"],\n" + "\t\t[62, \"gp\", \"(array uint32)\"],\n" + "\t\t[80, \"gp\", \"(array int64)\"],\n" + "\t\t[98, \"gp\", \"(array uint64)\"],\n" + "\t\t[115, \"gp\", \"(array int8)\"],\n" + "\t\t[132, \"gp\", \"(array int8)\"],\n" + "\t\t[150, \"gp\", \"(array int16)\"],\n" + "\t\t[168, \"gp\", \"(array uint16)\"],\n" + "\t\t[191, \"gp\", \"(array uint128)\"],\n" + "\t\t[207, \"gp\", \"(array int32)\"],\n" + "\t\t[226, \"gp\", \"(array float)\"],\n" + "\t\t[243, \"gp\", \"(array basic)\"]]"); } TEST_F(FormRegressionTest, ExprValid) { @@ -2012,7 +2013,7 @@ TEST_F(FormRegressionTest, ExprValid) { " )\n" " )\n" "\n"; - test_with_expr( + test_with_expr_jak1( func, type, expected, false, "", {{"L321", "ERROR: object #x~X ~S is not a valid object (misaligned)~%"}, {"L320", "ERROR: object #x~X ~S is not a valid object (bad address)~%"}, @@ -2396,7 +2397,7 @@ TEST_F(FormRegressionTest, ExprStringToInt) { " )\n" " )\n" " )"; - test_final_function(func, type, expected); + test_final_function_jak1(func, type, expected); } TEST_F(FormRegressionTest, Method19ResTag) { @@ -2887,11 +2888,11 @@ TEST_F(FormRegressionTest, Method19ResTag) { " (logior (logand 0 t0-6) (shl v1-14 32))\n" " )\n" " )"; - test_with_expr(func, type, expected, false, "", {}, - "[\n" - " [46, \"t2\", \"(pointer uint64)\"],\n" - " [100, \"t3\", \"(pointer uint64)\"],\n" - " [184, \"t5\", \"(pointer uint64)\"],\n" - " [64, \"t6\", \"(pointer uint64)\"]\n" - " ]"); + test_with_expr_jak1(func, type, expected, false, "", {}, + "[\n" + " [46, \"t2\", \"(pointer uint64)\"],\n" + " [100, \"t3\", \"(pointer uint64)\"],\n" + " [184, \"t5\", \"(pointer uint64)\"],\n" + " [64, \"t6\", \"(pointer uint64)\"]\n" + " ]"); } \ No newline at end of file diff --git a/test/decompiler/test_InstructionDecode.cpp b/test/decompiler/test_InstructionDecode.cpp index 849b011196..9489c4aa24 100644 --- a/test/decompiler/test_InstructionDecode.cpp +++ b/test/decompiler/test_InstructionDecode.cpp @@ -1,7 +1,7 @@ -#include "gtest/gtest.h" #include "decompiler/Disasm/InstructionDecode.h" #include "decompiler/Disasm/OpcodeInfo.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "gtest/gtest.h" using namespace decompiler; diff --git a/test/decompiler/test_InstructionParser.cpp b/test/decompiler/test_InstructionParser.cpp index 632e7b46fb..8834e90645 100644 --- a/test/decompiler/test_InstructionParser.cpp +++ b/test/decompiler/test_InstructionParser.cpp @@ -1,6 +1,6 @@ -#include "gtest/gtest.h" -#include "decompiler/Disasm/InstructionParser.h" #include "decompiler/Disasm/DecompilerLabel.h" +#include "decompiler/Disasm/InstructionParser.h" +#include "gtest/gtest.h" using namespace decompiler; diff --git a/test/decompiler/test_VuDisasm.cpp b/test/decompiler/test_VuDisasm.cpp index 7dcbf8d892..160bcb86db 100644 --- a/test/decompiler/test_VuDisasm.cpp +++ b/test/decompiler/test_VuDisasm.cpp @@ -1,9 +1,11 @@ +#include "common/util/FileUtil.h" + +#include "decompiler/VuDisasm/VuDisassembler.h" +#include "decompiler/util/DataParser.h" +#include "gtest/gtest.h" + #include "third-party/fmt/core.h" -#include "gtest/gtest.h" -#include "decompiler/util/DataParser.h" -#include "decompiler/VuDisasm/VuDisassembler.h" -#include "common/util/FileUtil.h" using namespace decompiler; diff --git a/test/decompiler/test_gkernel_decomp.cpp b/test/decompiler/test_gkernel_decomp.cpp index ddb1ba9d55..fb80d840dd 100644 --- a/test/decompiler/test_gkernel_decomp.cpp +++ b/test/decompiler/test_gkernel_decomp.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "FormRegressionTest.h" +#include "gtest/gtest.h" + using namespace decompiler; TEST_F(FormRegressionTest, ExprMethod7Object) { @@ -11,7 +12,7 @@ TEST_F(FormRegressionTest, ExprMethod7Object) { " daddu sp, sp, r0\n"; std::string type = "(function object int object)"; std::string expected = "arg0"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprLoadPackage) { @@ -62,14 +63,15 @@ TEST_F(FormRegressionTest, ExprLoadPackage) { std::string expected = "(when\n" " (not (nmember arg0 *kernel-packages*))\n" - " (dgo-load arg0 arg1 15 #x200000)\n" + " (dgo-load arg0 arg1 (link-flag output-load-msg output-load-true-msg execute-login " + "print-login) #x200000)\n" " (let\n" " ((v0-1 (cons arg0 *kernel-packages*)))\n" " (set! *kernel-packages* v0-1)\n" " v0-1\n" " )\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprUnloadPackage) { @@ -108,7 +110,7 @@ TEST_F(FormRegressionTest, ExprUnloadPackage) { " )\n" " *kernel-packages*\n" " )"; - test_with_expr(func, type, expected, true); + test_with_expr_jak1(func, type, expected, true); } TEST_F(FormRegressionTest, ExprMethod1Thread) { @@ -139,7 +141,7 @@ TEST_F(FormRegressionTest, ExprMethod1Thread) { " (set! (-> arg0 process top-thread) (-> arg0 previous))\n" " (none)\n" " )"; - test_with_expr(func, type, expected, false); + test_with_expr_jak1(func, type, expected, false); } TEST_F(FormRegressionTest, ExprMethod2Thread) { @@ -185,7 +187,8 @@ TEST_F(FormRegressionTest, ExprMethod2Thread) { " )\n" " arg0\n" " )"; - test_with_expr(func, type, expected, false, "", {{"L343", "#<~A ~S of ~S pc: #x~X @ #x~X>"}}); + test_with_expr_jak1(func, type, expected, false, "", + {{"L343", "#<~A ~S of ~S pc: #x~X @ #x~X>"}}); } TEST_F(FormRegressionTest, ExprMethod9Thread) { @@ -286,7 +289,7 @@ TEST_F(FormRegressionTest, ExprMethod9Thread) { " 0\n" " (none)\n" " )"; - test_with_expr(func, type, expected, false, "", {{"L342", "1 ~A ~%"}, {"L341", "2 ~A ~%"}}); + test_with_expr_jak1(func, type, expected, false, "", {{"L342", "1 ~A ~%"}, {"L341", "2 ~A ~%"}}); } TEST_F(FormRegressionTest, ExprMethod0Thread) { @@ -361,9 +364,9 @@ TEST_F(FormRegressionTest, ExprMethod0Thread) { " (set! (-> obj stack-size) arg4)\n" " (the-as cpu-thread obj)\n" " )"; - test_with_expr(func, type, expected, false, "cpu-thread", {}, - "[[[13, 28], \"v0\", \"cpu-thread\"]]", - "{\"vars\":{\"v0-0\":[\"obj\", \"cpu-thread\"]}}"); + test_with_expr_jak1(func, type, expected, false, "cpu-thread", {}, + "[[[13, 28], \"v0\", \"cpu-thread\"]]", + "{\"vars\":{\"v0-0\":[\"obj\", \"cpu-thread\"]}}"); } TEST_F(FormRegressionTest, ExprMethod5CpuThread) { @@ -378,7 +381,7 @@ TEST_F(FormRegressionTest, ExprMethod5CpuThread) { " daddu sp, sp, r0"; std::string type = "(function cpu-thread int)"; std::string expected = "(the-as int (+ (-> arg0 type size) (-> arg0 stack-size)))"; - test_with_expr(func, type, expected, false); + test_with_expr_jak1(func, type, expected, false); } TEST_F(FormRegressionTest, RemoveExit) { @@ -404,7 +407,7 @@ TEST_F(FormRegressionTest, RemoveExit) { " v0-0\n" " )\n" " )"; - test_with_expr(func, type, expected, false); + test_with_expr_jak1(func, type, expected, false); } TEST_F(FormRegressionTest, RemoveMethod0ProcessTree) { @@ -449,7 +452,7 @@ TEST_F(FormRegressionTest, RemoveMethod0ProcessTree) { " (set! (-> v0-0 ppointer) (the-as (pointer process) (&-> v0-0 self)))\n" " v0-0\n" " )"; - test_with_expr(func, type, expected, false, "process-tree"); + test_with_expr_jak1(func, type, expected, false, "process-tree"); } TEST_F(FormRegressionTest, RemoveMethod3ProcessTree) { @@ -545,13 +548,13 @@ TEST_F(FormRegressionTest, RemoveMethod3ProcessTree) { " (format #t \"~Tchild: ~A~%\" (ppointer->process (-> arg0 child)))\n" " arg0\n" " )"; - test_with_expr(func, type, expected, false, "process-tree", - {{"L340", "[~8x] ~A~%"}, - {"L339", "~Tname: ~S~%"}, - {"L338", "~Tmask: #x~X~%"}, - {"L337", "~Tparent: ~A~%"}, - {"L336", "~Tbrother: ~A~%"}, - {"L335", "~Tchild: ~A~%"}}); + test_with_expr_jak1(func, type, expected, false, "process-tree", + {{"L340", "[~8x] ~A~%"}, + {"L339", "~Tname: ~S~%"}, + {"L338", "~Tmask: #x~X~%"}, + {"L337", "~Tparent: ~A~%"}, + {"L336", "~Tbrother: ~A~%"}, + {"L335", "~Tchild: ~A~%"}}); } TEST_F(FormRegressionTest, ExprMethod0Process) { @@ -664,9 +667,9 @@ TEST_F(FormRegressionTest, ExprMethod0Process) { " )\n" " (the-as process v0-0)\n" " )"; - test_with_expr(func, type, expected, false, "process", {}, - "[\t\t[12, \"a0\", \"int\"],\n" - "\t\t[[13, 43], \"v0\", \"process\"]]"); + test_with_expr_jak1(func, type, expected, false, "process", {}, + "[\t\t[12, \"a0\", \"int\"],\n" + "\t\t[[13, 43], \"v0\", \"process\"]]"); } TEST_F(FormRegressionTest, ExprInspectProcessHeap) { @@ -729,10 +732,10 @@ TEST_F(FormRegressionTest, ExprInspectProcessHeap) { " )\n" " #f\n" " )"; - test_with_expr(func, type, expected, false, "", {}, - "[\t\t[[4,11], \"s5\", \"basic\"],\n" - "\t\t[[17,20], \"s5\", \"pointer\"]]", - "{\"vars\":{\"s5-0\":[\"obj\", \"pointer\"]}}"); + test_with_expr_jak1(func, type, expected, false, "", {}, + "[\t\t[[4,11], \"s5\", \"basic\"],\n" + "\t\t[[17,20], \"s5\", \"pointer\"]]", + "{\"vars\":{\"s5-0\":[\"obj\", \"pointer\"]}}"); } // note: skipped method 3 process @@ -748,7 +751,7 @@ TEST_F(FormRegressionTest, ExprMethod5Process) { " daddu sp, sp, r0"; std::string type = "(function process int)"; std::string expected = "(the-as int (+ (-> process size) (-> arg0 allocated-length)))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMethod2Process) { @@ -829,8 +832,9 @@ TEST_F(FormRegressionTest, ExprMethod2Process) { " )\n" " arg0\n" " )"; - test_with_expr(func, type, expected, false, "", - {{"L317", "#<~A ~S ~A :state ~S "}, {"L316", ":stack ~D/~D :heap ~D/~D @ #x~X>"}}); + test_with_expr_jak1( + func, type, expected, false, "", + {{"L317", "#<~A ~S ~A :state ~S "}, {"L316", ":stack ~D/~D :heap ~D/~D @ #x~X>"}}); } TEST_F(FormRegressionTest, ExprMethod0DeadPool) { @@ -943,7 +947,7 @@ TEST_F(FormRegressionTest, ExprMethod0DeadPool) { " )\n" " s3-0\n" " )"; - test_with_expr(func, type, expected, false, "dead-pool"); + test_with_expr_jak1(func, type, expected, false, "dead-pool"); } TEST_F(FormRegressionTest, ExprMethod14DeadPool) { @@ -1083,7 +1087,7 @@ TEST_F(FormRegressionTest, ExprMethod14DeadPool) { " )"; // note - there's likely an actual bug here. - test_with_expr( + test_with_expr_jak1( func, type, expected, false, "dead-pool", {{"L315", "WARNING: ~A ~A had to be allocated from the debug pool, because ~A was empty.~%"}, {"L314", "WARNING: ~A ~A could not be allocated, because ~A was empty.~%"}}, @@ -1109,7 +1113,7 @@ TEST_F(FormRegressionTest, ExprMethod15DeadPool) { " daddiu sp, sp, 16"; std::string type = "(function dead-pool process none)"; std::string expected = "(begin (change-parent arg1 arg0) (none))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMethod0DeadPoolHeap) { @@ -1254,10 +1258,10 @@ TEST_F(FormRegressionTest, ExprMethod0DeadPoolHeap) { " (set! (-> obj heap top-base) (-> obj heap top))\n" " obj\n" " )"; - test_with_expr(func, type, expected, false, "dead-pool-heap", {}, - "[\t\t[60, \"v0\", \"int\"],\n" - "\t\t[61, \"a0\", \"pointer\"], [61, \"v0\", \"dead-pool-heap\"]]", - "{\"vars\":{\"v0-0\":[\"obj\", \"dead-pool-heap\"]}}"); + test_with_expr_jak1(func, type, expected, false, "dead-pool-heap", {}, + "[\t\t[60, \"v0\", \"int\"],\n" + "\t\t[61, \"a0\", \"pointer\"], [61, \"v0\", \"dead-pool-heap\"]]", + "{\"vars\":{\"v0-0\":[\"obj\", \"dead-pool-heap\"]}}"); } TEST_F(FormRegressionTest, ExprMethod22DeadPoolHeap) { @@ -1294,7 +1298,7 @@ TEST_F(FormRegressionTest, ExprMethod22DeadPoolHeap) { " (-> arg0 heap base)\n" " )\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMethod21DeadPoolHeap) { @@ -1380,10 +1384,10 @@ TEST_F(FormRegressionTest, ExprMethod21DeadPoolHeap) { " (&- (-> arg0 heap top) (the-as uint (-> arg0 heap base)))\n" " )\n" " )"; - test_with_expr(func, type, expected, false, "", {}, - "[\t\t[5, \"v1\", \"pointer\"],\n" - "\t\t[13, \"a0\", \"pointer\"],\n" - "\t\t[25, \"v1\", \"pointer\"]]"); + test_with_expr_jak1(func, type, expected, false, "", {}, + "[\t\t[5, \"v1\", \"pointer\"],\n" + "\t\t[13, \"a0\", \"pointer\"],\n" + "\t\t[25, \"v1\", \"pointer\"]]"); } TEST_F(FormRegressionTest, ExprMethod3DeadPoolHeap) { @@ -1559,10 +1563,10 @@ TEST_F(FormRegressionTest, ExprMethod3DeadPoolHeap) { " )\n" " arg0\n" " )"; - test_with_expr(func, type, expected, false, "", - {{"L300", "~Tprocess-list[0] @ #x~X ~D/~D bytes used~%"}, - {"L299", "~T [~3D] # ~A~%"}, - {"L298", "~T gap: ~D bytes @ #x~X~%"}}); + test_with_expr_jak1(func, type, expected, false, "", + {{"L300", "~Tprocess-list[0] @ #x~X ~D/~D bytes used~%"}, + {"L299", "~T [~3D] # ~A~%"}, + {"L298", "~T gap: ~D bytes @ #x~X~%"}}); } TEST_F(FormRegressionTest, ExprMethod5DeadPoolHeap) { @@ -1577,8 +1581,8 @@ TEST_F(FormRegressionTest, ExprMethod5DeadPoolHeap) { std::string type = "(function dead-pool-heap int)"; std::string expected = "(+ (the-as int (- -4 (the-as int arg0))) (the-as int (-> arg0 heap top)))"; - test_with_expr(func, type, expected, false, "", {}, - "[[3, \"v1\", \"int\"], [3, \"a0\", \"int\"]]"); + test_with_expr_jak1(func, type, expected, false, "", {}, + "[[3, \"v1\", \"int\"], [3, \"a0\", \"int\"]]"); } TEST_F(FormRegressionTest, ExprMethod19DeadPoolHeap) { @@ -1630,7 +1634,7 @@ TEST_F(FormRegressionTest, ExprMethod19DeadPoolHeap) { " (- (memory-total arg0) (gap-size arg0 (-> arg0 alive-list prev)))\n" " 0\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMethod20DeadPoolHeap) { @@ -1643,7 +1647,7 @@ TEST_F(FormRegressionTest, ExprMethod20DeadPoolHeap) { " daddu sp, sp, r0"; std::string type = "(function dead-pool-heap int)"; std::string expected = "(&- (-> arg0 heap top) (the-as uint (-> arg0 heap base)))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMethod25DeadPoolHeap) { @@ -1686,7 +1690,7 @@ TEST_F(FormRegressionTest, ExprMethod25DeadPoolHeap) { " (&- v1-0 (the-as uint (-> arg0 heap base)))\n" " )\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMethod26DeadPoolHeap) { @@ -1697,7 +1701,7 @@ TEST_F(FormRegressionTest, ExprMethod26DeadPoolHeap) { " daddu sp, sp, r0"; std::string type = "(function dead-pool-heap uint)"; std::string expected = "(-> arg0 compact-time)"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMethod24DeadPoolHeap) { @@ -1754,7 +1758,7 @@ TEST_F(FormRegressionTest, ExprMethod24DeadPoolHeap) { " (while (and gp-0 (< (gap-size arg0 gp-0) arg1)) (set! gp-0 (-> gp-0 next)))\n" " gp-0\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMethod14DeadPoolHeap) { @@ -2030,7 +2034,7 @@ TEST_F(FormRegressionTest, ExprMethod14DeadPoolHeap) { " )\n" " s3-0\n" " )"; - test_with_expr( + test_with_expr_jak1( func, type, expected, false, "", {{"L315", "WARNING: ~A ~A had to be allocated from the debug pool, because ~A was empty.~%"}, {"L314", "WARNING: ~A ~A could not be allocated, because ~A was empty.~%"}}); @@ -2197,8 +2201,8 @@ TEST_F(FormRegressionTest, ExprMethod15DeadPoolHeap) { " 0\n" " (none)\n" " )"; - test_with_expr(func, type, expected, false, "", - {{"L297", "ERROR: process ~A does not belong to dead-pool-heap ~A.~%"}}); + test_with_expr_jak1(func, type, expected, false, "", + {{"L297", "ERROR: process ~A does not belong to dead-pool-heap ~A.~%"}}); } TEST_F(FormRegressionTest, ExprMethod17DeadPoolHeap) { @@ -2323,7 +2327,7 @@ TEST_F(FormRegressionTest, ExprMethod17DeadPoolHeap) { " )\n" " arg0\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprMethod16DeadPoolHeap) { @@ -2572,7 +2576,7 @@ TEST_F(FormRegressionTest, ExprMethod16DeadPoolHeap) { " 0\n" " (none)\n" " )"; - test_with_expr(func, type, expected, false, "", {{"L296", "~3LLow Actor Memory~%~0L"}}); + test_with_expr_jak1(func, type, expected, false, "", {{"L296", "~3LLow Actor Memory~%~0L"}}); } // nested method calls @@ -2769,5 +2773,5 @@ TEST_F(FormRegressionTest, ExprMethod18DeadPoolHeap) { " 0\n" " (none)\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } diff --git a/test/decompiler/test_math_decomp.cpp b/test/decompiler/test_math_decomp.cpp index fb562efa12..452079df75 100644 --- a/test/decompiler/test_math_decomp.cpp +++ b/test/decompiler/test_math_decomp.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "FormRegressionTest.h" +#include "gtest/gtest.h" + using namespace decompiler; TEST_F(FormRegressionTest, ExprTruncate) { @@ -14,7 +15,7 @@ TEST_F(FormRegressionTest, ExprTruncate) { " daddu sp, sp, r0"; std::string type = "(function float float)"; std::string expected = "(the float (the int arg0))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprIntegralP) { @@ -36,7 +37,7 @@ TEST_F(FormRegressionTest, ExprIntegralP) { " daddu sp, sp, r0"; std::string type = "(function float float)"; std::string expected = "(the-as float (= (the float (the int arg0)) arg0))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprFractionalPart) { @@ -54,7 +55,7 @@ TEST_F(FormRegressionTest, ExprFractionalPart) { " daddu sp, sp, r0"; std::string type = "(function float float)"; std::string expected = "(- arg0 (the float (the int arg0)))"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } TEST_F(FormRegressionTest, ExprSeek) { @@ -102,5 +103,5 @@ TEST_F(FormRegressionTest, ExprSeek) { " (else (- arg0 arg2))\n" " )\n" " )"; - test_with_expr(func, type, expected); + test_with_expr_jak1(func, type, expected); } \ No newline at end of file diff --git a/test/goalc/framework/test_runner.cpp b/test/goalc/framework/test_runner.cpp index 21a3110345..c05270d5dd 100644 --- a/test/goalc/framework/test_runner.cpp +++ b/test/goalc/framework/test_runner.cpp @@ -1,19 +1,20 @@ #include "test_runner.h" -#include "third-party/fmt/core.h" +#include #include -#include "gtest/gtest.h" #include "inja.hpp" -#include "third-party/json.hpp" - -#include "game/runtime.h" -#include "goalc/listener/Listener.h" -#include "goalc/compiler/Compiler.h" #include "common/util/FileUtil.h" -#include + +#include "game/runtime.h" +#include "goalc/compiler/Compiler.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" + +#include "third-party/fmt/core.h" +#include "third-party/json.hpp" namespace GoalTest { @@ -99,20 +100,20 @@ void CompilerTestRunner::run_always_pass(const std::string& test_category, } void runtime_no_kernel() { - constexpr int argc = 5; - const char* argv[argc] = {"", "-fakeiso", "-debug", "-nokernel", "-nodisplay"}; + constexpr int argc = 6; + const char* argv[argc] = {"", "-fakeiso", "-debug", "-nokernel", "-nodisplay", "-nosound"}; exec_runtime(argc, const_cast(argv)); } void runtime_with_kernel() { - constexpr int argc = 4; - const char* argv[argc] = {"", "-fakeiso", "-debug", "-nodisplay"}; + constexpr int argc = 5; + const char* argv[argc] = {"", "-fakeiso", "-debug", "-nodisplay", "-nosound"}; exec_runtime(argc, const_cast(argv)); } void runtime_with_kernel_no_debug_segment() { - constexpr int argc = 4; - const char* argv[argc] = {"", "-fakeiso", "-debug-mem", "-nodisplay"}; + constexpr int argc = 5; + const char* argv[argc] = {"", "-fakeiso", "-debug-mem", "-nodisplay", "-nosound"}; exec_runtime(argc, const_cast(argv)); } diff --git a/test/goalc/framework/test_runner.h b/test/goalc/framework/test_runner.h index ad682359f0..d7cd58f889 100644 --- a/test/goalc/framework/test_runner.h +++ b/test/goalc/framework/test_runner.h @@ -1,10 +1,11 @@ #pragma once +#include #include #include -#include #include "inja.hpp" + #include "goalc/compiler/Compiler.h" namespace GoalTest { diff --git a/test/goalc/source_templates/arithmetic/divide-2.static.gc b/test/goalc/source_templates/arithmetic/divide-2.static.gc index bb66062495..2e26692748 100644 --- a/test/goalc/source_templates/arithmetic/divide-2.static.gc +++ b/test/goalc/source_templates/arithmetic/divide-2.static.gc @@ -1,3 +1,4 @@ (let ((x 30)) - (+ (/ x 10) 4) + ;; setting upper 32 bits should be ignored + (+ (/ (logior #x111111100000000 x) (logior #x1231234400000000 10)) 4) ) \ No newline at end of file diff --git a/test/goalc/source_templates/arithmetic/divide-signs.static.gc b/test/goalc/source_templates/arithmetic/divide-signs.static.gc new file mode 100644 index 0000000000..dc0295e1f6 --- /dev/null +++ b/test/goalc/source_templates/arithmetic/divide-signs.static.gc @@ -0,0 +1,7 @@ + +(_format #t "~X ~X ~X ~X~%" + (/ -10 2) ;; should be -5 + (/ (the uint -10) 2) ;; should use 64-bit shift logical: #x7ffffffffffffffb + (/ -10 3) ;; should be -3 + (/ (the uint -10) 3) ;; should use integer unsigned divide: #x55555552 + ) \ No newline at end of file diff --git a/test/goalc/source_templates/arithmetic/mod-unsigned.static.gc b/test/goalc/source_templates/arithmetic/mod-unsigned.static.gc new file mode 100644 index 0000000000..1e0ec1bc38 --- /dev/null +++ b/test/goalc/source_templates/arithmetic/mod-unsigned.static.gc @@ -0,0 +1,3 @@ +(_format #t "~X ~X~%" + (mod -1 10) ;; -1 + (mod (the uint #xffffffff) 10)) \ No newline at end of file diff --git a/test/goalc/source_templates/with_game/test-build-all-code.gc b/test/goalc/source_templates/with_game/test-build-all-code.gc new file mode 100644 index 0000000000..2990dc5a2d --- /dev/null +++ b/test/goalc/source_templates/with_game/test-build-all-code.gc @@ -0,0 +1 @@ +(make-group "all-code") \ No newline at end of file diff --git a/test/goalc/source_templates/with_game/test-build-game.gc b/test/goalc/source_templates/with_game/test-build-game.gc index 2900ed218e..5dbcfb3ba0 100644 --- a/test/goalc/source_templates/with_game/test-build-game.gc +++ b/test/goalc/source_templates/with_game/test-build-game.gc @@ -1,2 +1,2 @@ -(build-game) +(make-cgo "ENGINE") 1 diff --git a/test/goalc/source_templates/with_game/test-load-game.gc b/test/goalc/source_templates/with_game/test-load-game.gc index e6d8101c4d..399a8dbfb3 100644 --- a/test/goalc/source_templates/with_game/test-load-game.gc +++ b/test/goalc/source_templates/with_game/test-load-game.gc @@ -1,3 +1,3 @@ (set! *use-old-listener-print* #t) -(dgo-load "kernel" global #xf #x200000) ; todo, remove once kernel loads itself. -(dgo-load "game" global #xf #x200000) +(dgo-load "kernel" global (link-flag output-load-msg output-load-true-msg execute-login print-login) #x200000) ; todo, remove once kernel loads itself. +(dgo-load "engine" global (link-flag output-load-msg output-load-true-msg execute-login print-login) #x200000) diff --git a/test/goalc/test_arithmetic.cpp b/test/goalc/test_arithmetic.cpp index d40bb7e844..e7740c77a7 100644 --- a/test/goalc/test_arithmetic.cpp +++ b/test/goalc/test_arithmetic.cpp @@ -1,24 +1,22 @@ // https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#value-parameterized-tests -#include #include - -#include "gtest/gtest.h" -#include "game/runtime.h" -#include "goalc/listener/Listener.h" -#include "goalc/compiler/Compiler.h" - -#include "inja.hpp" -#include "third-party/json.hpp" - -#include "test/goalc/framework/test_runner.h" - -#include -#include #include -#include #include #include +#include +#include +#include + +#include "inja.hpp" + +#include "game/runtime.h" +#include "goalc/compiler/Compiler.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" +#include "test/goalc/framework/test_runner.h" + +#include "third-party/json.hpp" // -------- // This is a very over-engineered integer test, but it serves as a decent example of how to use the @@ -289,3 +287,12 @@ TEST_F(ArithmeticTests, LogicalOperators) { TEST_F(ArithmeticTests, Comparison) { runner->run_static_test(env, testCategory, "signed-int-compare.static.gc", {"12\n"}); } + +TEST_F(ArithmeticTests, DivideSigns) { + runner->run_static_test(env, testCategory, "divide-signs.static.gc", + {"fffffffffffffffb 7ffffffffffffffb fffffffffffffffd 55555552\n0\n"}); +} + +TEST_F(ArithmeticTests, ModUnsigned) { + runner->run_static_test(env, testCategory, "mod-unsigned.static.gc", {"ffffffffffffffff 5\n0\n"}); +} \ No newline at end of file diff --git a/test/goalc/test_collections.cpp b/test/goalc/test_collections.cpp index fcbf5b8c68..4163039707 100644 --- a/test/goalc/test_collections.cpp +++ b/test/goalc/test_collections.cpp @@ -1,22 +1,21 @@ -#include #include - -#include "gtest/gtest.h" -#include "game/runtime.h" -#include "goalc/listener/Listener.h" -#include "goalc/compiler/Compiler.h" - -#include "inja.hpp" -#include "third-party/json.hpp" -#include "test/goalc/framework/test_runner.h" - -#include -#include #include -#include +#include #include #include -#include +#include +#include +#include + +#include "inja.hpp" + +#include "game/runtime.h" +#include "goalc/compiler/Compiler.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" +#include "test/goalc/framework/test_runner.h" + +#include "third-party/json.hpp" struct CollectionParam { // TODO - Not Needed Yet diff --git a/test/goalc/test_compiler.cpp b/test/goalc/test_compiler.cpp index 81bc1b7720..3ac88d8eed 100644 --- a/test/goalc/test_compiler.cpp +++ b/test/goalc/test_compiler.cpp @@ -1,10 +1,10 @@ -#include #include +#include -#include "gtest/gtest.h" #include "game/runtime.h" -#include "goalc/listener/Listener.h" #include "goalc/compiler/Compiler.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" TEST(CompilerAndRuntime, ConstructCompiler) { Compiler compiler; diff --git a/test/goalc/test_control_statements.cpp b/test/goalc/test_control_statements.cpp index fc89fdb757..f267f7e55b 100644 --- a/test/goalc/test_control_statements.cpp +++ b/test/goalc/test_control_statements.cpp @@ -1,22 +1,21 @@ -#include #include - -#include "gtest/gtest.h" -#include "game/runtime.h" -#include "goalc/listener/Listener.h" -#include "goalc/compiler/Compiler.h" - -#include "inja.hpp" -#include "third-party/json.hpp" -#include "test/goalc/framework/test_runner.h" - -#include -#include #include -#include +#include #include #include -#include +#include +#include +#include + +#include "inja.hpp" + +#include "game/runtime.h" +#include "goalc/compiler/Compiler.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" +#include "test/goalc/framework/test_runner.h" + +#include "third-party/json.hpp" struct ControlStatementParam { // TODO - Not Needed Yet diff --git a/test/goalc/test_debugger.cpp b/test/goalc/test_debugger.cpp index 7185e7655c..0feadb25db 100644 --- a/test/goalc/test_debugger.cpp +++ b/test/goalc/test_debugger.cpp @@ -1,9 +1,10 @@ -#include "gtest/gtest.h" -#include "goalc/compiler/Compiler.h" -#include "test/goalc/framework/test_runner.h" #include "common/log/log.h" #include "common/util/Timer.h" +#include "goalc/compiler/Compiler.h" +#include "gtest/gtest.h" +#include "test/goalc/framework/test_runner.h" + #ifdef __linux namespace { diff --git a/test/goalc/test_game_no_debug.cpp b/test/goalc/test_game_no_debug.cpp index 245b6d0c92..d717905797 100644 --- a/test/goalc/test_game_no_debug.cpp +++ b/test/goalc/test_game_no_debug.cpp @@ -1,7 +1,7 @@ // Test the game running without loading debug segments. -#include "gtest/gtest.h" #include "goalc/compiler/Compiler.h" +#include "gtest/gtest.h" #include "test/goalc/framework/test_runner.h" TEST(GameNoDebugSegment, Init) { diff --git a/test/goalc/test_goal_kernel.cpp b/test/goalc/test_goal_kernel.cpp index 917b2146b9..2e72432b73 100644 --- a/test/goalc/test_goal_kernel.cpp +++ b/test/goalc/test_goal_kernel.cpp @@ -1,8 +1,9 @@ -#include #include +#include + #include "goalc/compiler/Compiler.h" -#include "test/goalc/framework/test_runner.h" #include "gtest/gtest.h" +#include "test/goalc/framework/test_runner.h" class KernelTest : public testing::Test { public: diff --git a/test/goalc/test_variables.cpp b/test/goalc/test_variables.cpp index e01423f34a..d04cd4beed 100644 --- a/test/goalc/test_variables.cpp +++ b/test/goalc/test_variables.cpp @@ -1,22 +1,21 @@ -#include #include - -#include "gtest/gtest.h" -#include "game/runtime.h" -#include "goalc/listener/Listener.h" -#include "goalc/compiler/Compiler.h" - -#include "inja.hpp" -#include "third-party/json.hpp" -#include "test/goalc/framework/test_runner.h" - -#include -#include #include -#include +#include #include #include -#include +#include +#include +#include + +#include "inja.hpp" + +#include "game/runtime.h" +#include "goalc/compiler/Compiler.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" +#include "test/goalc/framework/test_runner.h" + +#include "third-party/json.hpp" struct VariableParam { // TODO - Not Needed Yet @@ -104,9 +103,9 @@ TEST_F(VariableTests, StackStructureAlignment) { TEST_F(VariableTests, GetSymbol) { shared_compiler->runner.run_static_test(env, testCategory, "get-symbol-1.static.gc", - {"1342756\n"}); // 0x147d24 in hex + {"1375524\n"}); // 0x14fd24 in hex shared_compiler->runner.run_static_test(env, testCategory, "get-symbol-2.static.gc", - {"1342764\n"}); // 0x147d2c in hex + {"1375532\n"}); // 0x14fd2c in hex } TEST_F(VariableTests, Constants) { diff --git a/test/goalc/test_with_game.cpp b/test/goalc/test_with_game.cpp index 0e8bb764ce..04e0608cae 100644 --- a/test/goalc/test_with_game.cpp +++ b/test/goalc/test_with_game.cpp @@ -1,26 +1,26 @@ -#include #include - -#include "gtest/gtest.h" -#include "game/runtime.h" -#include "goalc/listener/Listener.h" -#include "goalc/compiler/Compiler.h" -#include "game/mips2c/mips2c_table.h" - -#include "inja.hpp" -#include "third-party/json.hpp" -#include "common/util/FileUtil.h" -#include "test/goalc/framework/test_runner.h" -#include "third-party/fmt/core.h" - -#include -#include #include -#include +#include #include #include -#include #include +#include +#include +#include + +#include "inja.hpp" + +#include "common/util/FileUtil.h" + +#include "game/mips2c/mips2c_table.h" +#include "game/runtime.h" +#include "goalc/compiler/Compiler.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" +#include "test/goalc/framework/test_runner.h" + +#include "third-party/fmt/core.h" +#include "third-party/json.hpp" class WithGameTests : public ::testing::Test { public: @@ -30,7 +30,7 @@ class WithGameTests : public ::testing::Test { shared_compiler->compiler.run_test_no_load( "test/goalc/source_templates/with_game/test-build-game.gc"); shared_compiler->compiler.run_front_end_on_string( - "(asm-data-file game-text \"test/test_data/test_game_text.txt\")"); + "(asm-text-file text :files (\"test/test_data/test_game_text.gp\"))"); } catch (std::exception& e) { fprintf(stderr, "caught exception %s\n", e.what()); EXPECT_TRUE(false); @@ -84,7 +84,9 @@ class WithMinimalGameTests : public ::testing::Test { shared_compiler->runtime_thread = std::thread((GoalTest::runtime_with_kernel)); shared_compiler->runner.c = &shared_compiler->compiler; - shared_compiler->compiler.run_test_from_string("(dgo-load \"kernel\" global #xf #x200000)"); + shared_compiler->compiler.run_test_from_string( + "(dgo-load \"kernel\" global (link-flag output-load-msg output-load-true-msg execute-login " + "print-login) #x200000)"); const auto minimal_files = {"goal_src/engine/math/vector-h.gc"}; for (auto& file : minimal_files) { @@ -372,11 +374,13 @@ TEST_F(WithGameTests, GameCount) { "(asm-data-file game-count \"test/test_data/test_game_counts.txt\")"); shared_compiler->compiler.run_test_from_string( "(build-dgos \"test/test_data/test_game_count_dgos.txt\")"); - shared_compiler->compiler.run_test_from_string("(dgo-load \"game\" global #xf #x200000)"); + shared_compiler->compiler.run_test_from_string( + "(dgo-load \"engine\" global (link-flag output-load-msg output-load-true-msg execute-login " + "print-login) #x200000)"); shared_compiler->runner.run_static_test(env, testCategory, "test-game-count.gc", get_test_pass_string("game-count", 4)); // don't leave behind a weird version of the game-count file. - std::filesystem::remove(file_util::get_file_path({"out", "iso", "GAME.CGO"})); + std::filesystem::remove(file_util::get_file_path({"out", "iso", "ENGINE.CGO"})); std::filesystem::remove(file_util::get_file_path({"out", "obj", "game-cnt.go"})); } @@ -944,7 +948,7 @@ TEST(TypeConsistency, MANUAL_TEST_TypeConsistencyWithBuildFirst) { Compiler compiler; compiler.enable_throw_on_redefines(); add_expected_type_mismatches(compiler); - compiler.run_test_no_load("test/goalc/source_templates/with_game/test-build-game.gc"); + compiler.run_test_no_load("test/goalc/source_templates/with_game/test-build-all-code.gc"); compiler.run_test_no_load("decompiler/config/all-types.gc"); } @@ -953,7 +957,7 @@ TEST(TypeConsistency, TypeConsistency) { compiler.enable_throw_on_redefines(); add_expected_type_mismatches(compiler); compiler.run_test_no_load("decompiler/config/all-types.gc"); - compiler.run_test_no_load("test/goalc/source_templates/with_game/test-build-game.gc"); + compiler.run_test_no_load("test/goalc/source_templates/with_game/test-build-all-code.gc"); } struct VectorFloatRegister { diff --git a/test/offline/config.jsonc b/test/offline/config.jsonc index 2d32db673c..224a8abc4e 100644 --- a/test/offline/config.jsonc +++ b/test/offline/config.jsonc @@ -12,6 +12,7 @@ "DGO/MIS.DGO", "DGO/JUB.DGO", "DGO/SUN.DGO", + "DGO/SUB.DGO", "DGO/DEM.DGO", "DGO/FIN.DGO", "DGO/JUN.DGO", @@ -228,11 +229,28 @@ "tie-near-end-buffer", "(method 19 process-drawable)", - + "curve-evaluate!", "generic-reset-buffers", - "generic-merc-execute-all" + "generic-merc-execute-all", + + /// COLLIDE-EDGE-GRAB + "(method 9 edge-grab-info)", // asm + + /// COLLIDE-SHAPE-RIDER + // type mess + "(method 22 collide-shape-prim-mesh)", + + /// COLLIDE-REACTION-TARGET + "poly-find-nearest-edge", + + /// GLIST + // i dont even want to know + "glst-find-node-by-name", + "glst-length-of-longest-name", + + "race-time-save" ], "skip_compile_states": { @@ -244,9 +262,9 @@ ], "ogreboss-missile-seek": [ "code" // inserts a bad cfg-1 goto + ], + "(active pistons)": [ + "code" // dead code not analyzed properly after a loop ] - // "active": [ // in village3-obs - // "code" // dead-code not analyzed properly after a suspend - // ] } } diff --git a/test/offline/offline_test_main.cpp b/test/offline/offline_test_main.cpp index b51c9995ed..7f4743af95 100644 --- a/test/offline/offline_test_main.cpp +++ b/test/offline/offline_test_main.cpp @@ -1,17 +1,19 @@ +#include #include #include #include -#include + +#include "common/common_types.h" +#include "common/log/log.h" +#include "common/util/FileUtil.h" +#include "common/util/Timer.h" +#include "common/util/diff.h" +#include "common/util/json_util.h" + +#include "decompiler/ObjectFile/ObjectFileDB.h" +#include "goalc/compiler/Compiler.h" #include "third-party/fmt/format.h" -#include "common/log/log.h" -#include "common/common_types.h" -#include "common/util/FileUtil.h" -#include "common/util/json_util.h" -#include "decompiler/ObjectFile/ObjectFileDB.h" -#include "common/util/diff.h" -#include "goalc/compiler/Compiler.h" -#include "common/util/Timer.h" namespace fs = std::filesystem; @@ -65,8 +67,9 @@ struct OfflineTestConfig { * Read and parse the json config file, config.json, located in test/offline */ OfflineTestConfig parse_config() { - auto json_file_path = file_util::get_file_path({"test", "offline", "config.jsonc"}); - auto json = parse_commented_json(file_util::read_text_file(json_file_path), json_file_path); + auto json_file_path = file_util::get_jak_project_dir() / "test" / "offline" / "config.jsonc"; + auto json = parse_commented_json(file_util::read_text_file(json_file_path.string()), + json_file_path.string()); OfflineTestConfig result; result.dgos = json["dgos"].get>(); result.skip_compile_files = json["skip_compile_files"].get>(); @@ -85,6 +88,11 @@ struct DecompilerFile { std::string reference; }; +struct DecompilerArtFile { + std::string name_in_dgo; + std::string unique_name; +}; + std::string replaceFirstOccurrence(std::string& s, const std::string& toReplace, const std::string& replaceWith) { @@ -98,8 +106,8 @@ std::vector find_files(const std::vector& dgos) { std::vector result; std::unordered_map files_with_ref; - for (auto& p : fs::recursive_directory_iterator( - file_util::get_file_path({"test", "decompiler", "reference"}))) { + for (auto& p : fs::recursive_directory_iterator(file_util::get_jak_project_dir() / "test" / + "decompiler" / "reference")) { if (p.is_regular_file()) { std::string file_name = fs::path(p.path()).replace_extension().filename().string(); if (file_name.find("_REF") == std::string::npos) { @@ -114,7 +122,8 @@ std::vector find_files(const std::vector& dgos) { // use the all_objs.json file to place them in the correct build order auto j = parse_commented_json( - file_util::read_text_file(file_util::get_file_path({"goal_src", "build", "all_objs.json"})), + file_util::read_text_file( + (file_util::get_jak_project_dir() / "goal_src" / "build" / "all_objs.json").string()), "all_objs.json"); std::unordered_set matched_files; @@ -168,25 +177,85 @@ std::vector find_files(const std::vector& dgos) { return result; } +std::vector find_art_files(const std::vector& dgos) { + std::vector result; + + // use the all_objs.json file to place them in the correct build order + auto j = parse_commented_json( + file_util::read_text_file( + (file_util::get_jak_project_dir() / "goal_src" / "build" / "all_objs.json").string()), + "all_objs.json"); + + for (auto& x : j) { + auto unique_name = x[0].get(); + auto version = x[2].get(); + + std::vector dgoList = x[3].get>(); + if (version == 4) { + bool skip_this = false; + + // Check to see if we've included atleast one of the DGO/CGOs in our hardcoded list + // If not BLOW UP + bool dgoValidated = false; + for (int i = 0; i < (int)dgoList.size(); i++) { + std::string& dgo = dgoList.at(i); + if (dgo == "NO-XGO") { + skip_this = true; + break; + } + // can either be in the DGO or CGO folder, and can either end with .CGO or .DGO + if (std::find(dgos.begin(), dgos.end(), fmt::format("DGO/{}.DGO", dgo)) != dgos.end() || + std::find(dgos.begin(), dgos.end(), fmt::format("DGO/{}.CGO", dgo)) != dgos.end() || + std::find(dgos.begin(), dgos.end(), fmt::format("CGO/{}.DGO", dgo)) != dgos.end() || + std::find(dgos.begin(), dgos.end(), fmt::format("CGO/{}.CGO", dgo)) != dgos.end()) { + dgoValidated = true; + } + } + if (skip_this) { + continue; + } + if (!dgoValidated) { + fmt::print( + "File [{}] is in the following DGOs [{}], and not one of these is in our list! Add " + "it!\n", + unique_name, fmt::join(dgoList, ", ")); + exit(1); + } + + DecompilerArtFile file; + file.unique_name = unique_name; + file.name_in_dgo = x[1]; + result.push_back(file); + } + } + + return result; +} + struct Decompiler { std::unique_ptr db; std::unique_ptr config; }; Decompiler setup_decompiler(const std::vector& files, + const std::vector& art_files, const OfflineTestArgs& args, const OfflineTestConfig& offline_config) { Decompiler dc; - 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_jak_project_dir() / "decompiler" / "config" / "jak1_ntsc_black_label.jsonc") + .string(), + {})); // modify the config std::unordered_set object_files; for (auto& file : files) { object_files.insert(file.name_in_dgo); // todo, make this work with unique_name } + for (auto& file : art_files) { + object_files.insert(file.unique_name); + } dc.config->allowed_objects = object_files; // don't try to do this because we can't write the file @@ -195,7 +264,7 @@ Decompiler setup_decompiler(const std::vector& files, std::vector dgo_paths; if (args.iso_data_path.empty()) { for (auto& x : offline_config.dgos) { - dgo_paths.push_back(file_util::get_file_path({"iso_data/jak1", x})); + dgo_paths.push_back((file_util::get_jak_project_dir() / "iso_data" / "jak1" / x).string()); } } else { for (auto& x : offline_config.dgos) { @@ -214,13 +283,18 @@ Decompiler setup_decompiler(const std::vector& files, } } - if (db_files.size() != files.size()) { + if (db_files.size() != files.size() + art_files.size()) { fmt::print("DB file error.\n"); for (auto& f : files) { if (!db_files.count(f.unique_name)) { fmt::print("didn't find {}\n", f.unique_name); } } + for (auto& f : art_files) { + if (!db_files.count(f.unique_name)) { + fmt::print("didn't find {}\n", f.unique_name); + } + } exit(1); } @@ -234,6 +308,8 @@ void disassemble(Decompiler& dc) { } void decompile(Decompiler& dc, const OfflineTestConfig& config) { + dc.db->extract_art_info(); + dc.db->ir2_top_level_pass(*dc.config); dc.db->analyze_functions_ir2({}, *dc.config, config.skip_compile_functions, config.skip_compile_states); } @@ -343,6 +419,9 @@ bool compile(Decompiler& dc, int main(int argc, char* argv[]) { fmt::print("Offline Decompiler Test 2\n"); lg::initialize(); + if (!file_util::setup_project_path(std::nullopt)) { + return 1; + } fmt::print("Reading config...\n"); auto args = parse_args(argc, argv); @@ -353,9 +432,10 @@ int main(int argc, char* argv[]) { if (args.max_files < (int)files.size()) { files.erase(files.begin() + args.max_files, files.end()); } + auto art_files = find_art_files(config.dgos); fmt::print("Setting up decompiler and loading files...\n"); - auto decompiler = setup_decompiler(files, args, config); + auto decompiler = setup_decompiler(files, art_files, args, config); fmt::print("Disassembling files...\n"); disassemble(decompiler); diff --git a/test/offline/readme.md b/test/offline/readme.md new file mode 100644 index 0000000000..52668ea0c4 --- /dev/null +++ b/test/offline/readme.md @@ -0,0 +1,26 @@ +# Offline Reference Test +The offline reference test runs the decompiler on all files that have a corresponding `_REF.gc`, then compiles them. +The test passes if all files compile and all decompiler outputs match the `_REF.gc`. + +The purpose of the offline reference test is: +- To make sure the output of the decompiler can be compiled +- To let us easily see "what source should change, if I changed this type?". This allows us to safely update types without worrying that we forgot to update some other file. + +This test doesn't run as part of CI, so it relies on us running it manually. As a result, from time to time, it can be broken on master. + +## Running the test +Just run `offline-test` in the build directory. It takes about a minute and will display diffs of any files that don't match and compiler errors on the first failing file. + +## What to do if the diff test fails +First, manually read the diff and make sure that it's a good change. + +If so, re-run the `offline-test` program with the `--dump-mode` flag. It will save copies of any differing output in a `failures` folder (make sure this is empty before running). To apply these to the `_REF.gc` files automatically, there's a python script that you can run like this: +``` +cd jak-project/build +python3 ../scripts/update_decomp_reference.py ./failures ../test/decompiler/referenc +``` + +Next, make sure the actual `.gc` files in `goal_src/` are updated, if they need to be. For large changes, this part can be pretty annoying. There is a `update-goal-src.py` script that is helpful for huge changes. + +## What to do if the compile test fails +Ideally we'd make all code compile successfully without any manual changes. But sometimes there's just one function that doesn't work in a big file, and you'd like to get the rest of it. There's a `config.jsonc` file in the `test/offline` folder that lets you identify functions by name to skip compiling in the ref tests. diff --git a/test/test_CodeTester.cpp b/test/test_CodeTester.cpp index 276771fb8e..a70c1e77eb 100644 --- a/test/test_CodeTester.cpp +++ b/test/test_CodeTester.cpp @@ -7,9 +7,9 @@ * can generate prologues/epilogues, and execute them without crashing. */ -#include "gtest/gtest.h" #include "goalc/emitter/CodeTester.h" #include "goalc/emitter/IGen.h" +#include "gtest/gtest.h" using namespace emitter; diff --git a/test/test_common_util.cpp b/test/test_common_util.cpp index a01f187f9d..f5077e6465 100644 --- a/test/test_common_util.cpp +++ b/test/test_common_util.cpp @@ -1,20 +1,24 @@ -#include -#include #include +#include #include +#include -#include "common/util/FileUtil.h" -#include "common/util/Trie.h" +#include "common/util/Assert.h" #include "common/util/BitUtils.h" -#include "gtest/gtest.h" -#include "test/all_jak1_symbols.h" +#include "common/util/CopyOnWrite.h" +#include "common/util/FileUtil.h" +#include "common/util/Range.h" +#include "common/util/SmallVector.h" +#include "common/util/Trie.h" +#include "common/util/crc32.h" #include "common/util/json_util.h" #include "common/util/os.h" -#include "common/util/Range.h" -#include "third-party/fmt/core.h" #include "common/util/print_float.h" -#include "common/util/CopyOnWrite.h" -#include "common/util/SmallVector.h" + +#include "gtest/gtest.h" +#include "test/all_jak1_symbols.h" + +#include "third-party/fmt/core.h" TEST(CommonUtil, CpuInfo) { setup_cpu_info(); @@ -392,9 +396,32 @@ TEST(SmallVector, Construction) { EXPECT_FALSE(one.empty()); } +#ifndef NO_ASSERT TEST(Assert, Death) { EXPECT_DEATH(private_assert_failed("foo", "bar", 12, "aaa"), ""); } +#endif + +uint32_t crc_reference(const u8* data, size_t size) { + u32 crc = 0xffffffff; + while (size--) { + crc ^= *data++; + for (int k = 0; k < 8; k++) + crc = crc & 1 ? (crc >> 1) ^ 0x82f63b78 : crc >> 1; + } + return ~crc; +} + +TEST(CRC32, Reference) { + for (u32 so = 0; so < 7; so++) { + std::vector test_data; + for (u32 i = 0; i < 1024 + so; i++) { + test_data.push_back(i & 0xff); + } + EXPECT_EQ(crc_reference(test_data.data(), test_data.size()), + crc32(test_data.data(), test_data.size())); + } +} } // namespace test -} // namespace cu \ No newline at end of file +} // namespace cu diff --git a/test/test_data/test_game_count_dgos.txt b/test/test_data/test_game_count_dgos.txt index 644cf0563f..e69cd84779 100644 --- a/test/test_data/test_game_count_dgos.txt +++ b/test/test_data/test_game_count_dgos.txt @@ -1,4 +1,4 @@ -("GAME.CGO" +("ENGINE.CGO" ("types-h.o" "types-h") ("vu1-macros.o" "vu1-macros") ("game-cnt.go" "game-cnt") diff --git a/test/test_data/test_game_text.gp b/test/test_data/test_game_text.gp new file mode 100644 index 0000000000..b3bef689af --- /dev/null +++ b/test/test_data/test_game_text.gp @@ -0,0 +1,2 @@ +(text + (jak1-v1 "test/test_data/test_game_text.txt")) \ No newline at end of file diff --git a/test/test_data/test_game_text.txt b/test/test_data/test_game_text.txt index 2d22520fa1..6d8e660ad4 100644 --- a/test/test_data/test_game_text.txt +++ b/test/test_data/test_game_text.txt @@ -1,5 +1,5 @@ -(language-count 3) (group-name "test") +(language-id 0 1 2) (#x123 "language 0" "language 1" diff --git a/test/test_emitter.cpp b/test/test_emitter.cpp index ac335512df..5662e949f8 100644 --- a/test/test_emitter.cpp +++ b/test/test_emitter.cpp @@ -1,6 +1,6 @@ -#include "gtest/gtest.h" #include "goalc/emitter/CodeTester.h" #include "goalc/emitter/IGen.h" +#include "gtest/gtest.h" using namespace emitter; diff --git a/test/test_emitter_avx.cpp b/test/test_emitter_avx.cpp index 794cc6963d..f905eab983 100644 --- a/test/test_emitter_avx.cpp +++ b/test/test_emitter_avx.cpp @@ -1,6 +1,6 @@ -#include "gtest/gtest.h" #include "goalc/emitter/CodeTester.h" #include "goalc/emitter/IGen.h" +#include "gtest/gtest.h" using namespace emitter; diff --git a/test/test_goos.cpp b/test/test_goos.cpp index 15d53c349f..e488f97fb7 100644 --- a/test/test_goos.cpp +++ b/test/test_goos.cpp @@ -3,9 +3,10 @@ * Tests for the GOOS macro language. */ -#include "gtest/gtest.h" #include "common/goos/Interpreter.h" +#include "gtest/gtest.h" + using namespace goos; namespace { @@ -404,17 +405,6 @@ TEST(GoosBuiltins, Null) { } } -TEST(GoosBuiltins, CurrentMethodType) { - Interpreter i; - i.goal_to_goos.enclosing_method_type = "test-type"; - EXPECT_EQ(e(i, "(current-method-type)"), "test-type"); - - i.disable_printfs(); - for (auto x : {"(current-method-type 1)"}) { - EXPECT_ANY_THROW(e(i, x)); - } -} - TEST(GoosBuiltins, Type) { Interpreter i; EXPECT_EQ(e(i, "(type? 'empty-list '())"), "#t"); @@ -1326,4 +1316,17 @@ TEST(GoosBuiltins, StringUtils) { EXPECT_EQ(e(i, "(string-length \"test\")"), "4"); EXPECT_EQ(e(i, "(string-append \"hello\" \" \" \"world\")"), "\"hello world\""); EXPECT_EQ(e(i, "(symbol->string 'test)"), "\"test\""); +} + +TEST(GoosBuiltins, HashTable) { + Interpreter i; + e(i, "(define ht (make-string-hash-table))"); + EXPECT_EQ(e(i, "(car (hash-table-try-ref ht \"foo\"))"), "#f"); + + e(i, "(hash-table-set! ht \"foo\" 123)"); + EXPECT_EQ(e(i, "(car (hash-table-try-ref ht \"bar\"))"), "#f"); + EXPECT_EQ(e(i, "(car (hash-table-try-ref ht \"foo\"))"), "#t"); + EXPECT_EQ(e(i, "(cdr (hash-table-try-ref ht \"foo\"))"), "123"); + e(i, "(hash-table-set! ht \"foo\" 456)"); + EXPECT_EQ(e(i, "(cdr (hash-table-try-ref ht \"foo\"))"), "456"); } \ No newline at end of file diff --git a/test/test_kernel.cpp b/test/test_kernel_jak1.cpp similarity index 93% rename from test/test_kernel.cpp rename to test/test_kernel_jak1.cpp index 2d5342b810..b26f4f152c 100644 --- a/test/test_kernel.cpp +++ b/test/test_kernel_jak1.cpp @@ -1,15 +1,23 @@ #include #include #include -#include "gtest/gtest.h" -#include "common/symbols.h" + #include "common/goal_constants.h" -#include "game/kernel/fileio.h" -#include "game/kernel/kboot.h" -#include "game/kernel/kprint.h" -#include "game/kernel/kdsnetm.h" -#include "game/kernel/kscheme.h" +#include "common/listener_common.h" +#include "common/symbols.h" + #include "all_jak1_symbols.h" +#include "game/kernel/common/fileio.h" +#include "game/kernel/common/kboot.h" +#include "game/kernel/common/kprint.h" +#include "game/kernel/common/kscheme.h" +#include "game/kernel/common/memory_layout.h" +#include "game/kernel/jak1/fileio.h" +#include "game/kernel/jak1/kscheme.h" +#include "gtest/gtest.h" + +using namespace jak1_symbols; +using namespace jak1; TEST(Kernel, strend) { char test[] = "test"; @@ -177,7 +185,7 @@ TEST(Kernel, ftoa) { TEST(Kernel, itoa_base_10) { char buffer[128]; - kprint_init_globals(); + kprint_init_globals_common(); // simple print 1 kitoa(buffer, 1, 10, -1, ' ', 0); @@ -224,7 +232,7 @@ TEST(Kernel, itoa_base_10) { TEST(Kernel, itoa_base_2) { char buffer[128]; - kprint_init_globals(); + kprint_init_globals_common(); kitoa(buffer, 1, 2, -1, ' ', 0); EXPECT_EQ("1", std::string(buffer)); @@ -259,7 +267,7 @@ TEST(Kernel, itoa_base_2) { TEST(Kernel, itoa_base_16) { char buffer[128]; - kprint_init_globals(); + kprint_init_globals_common(); kitoa(buffer, 1, 16, -1, ' ', 0); EXPECT_EQ("1", std::string(buffer)); @@ -291,8 +299,8 @@ void setup_hack_heaps(void* mem, int size) { int heap_size = (size - HEAP_START) / 2; MasterDebug = 1; EXPECT_TRUE(heap_size > 8 * 1024 * 1024); - kmalloc_init_globals(); - kprint_init_globals(); + kmalloc_init_globals_common(); + kprint_init_globals_common(); kinitheap(kglobalheap, Ptr(HEAP_START), heap_size); kinitheap(kdebugheap, Ptr(HEAP_START + heap_size), heap_size); @@ -300,8 +308,9 @@ void setup_hack_heaps(void* mem, int size) { init_crc(); // create a fake symbol table - auto symbol_table = kmalloc(kglobalheap, 0x20000, KMALLOC_MEMSET, "symbol-table").cast(); - s7 = symbol_table + (GOAL_MAX_SYMBOLS / 2) * 8 + BASIC_OFFSET; + auto symbol_table = + kmalloc(kglobalheap, jak1::SYM_TABLE_MEM_SIZE, KMALLOC_MEMSET, "symbol-table").cast(); + s7 = symbol_table + (jak1::GOAL_MAX_SYMBOLS / 2) * 8 + BASIC_OFFSET; SymbolTable2 = symbol_table + BASIC_OFFSET; LastSymbol = symbol_table + 0xff00; NumSymbols = 0; diff --git a/test/test_listener_deci2.cpp b/test/test_listener_deci2.cpp index 6037806977..4bf5b929d0 100644 --- a/test/test_listener_deci2.cpp +++ b/test/test_listener_deci2.cpp @@ -1,6 +1,6 @@ -#include "gtest/gtest.h" -#include "goalc/listener/Listener.h" #include "game/system/Deci2Server.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" using namespace listener; @@ -15,12 +15,12 @@ TEST(Listener, ListenerCreation) { } TEST(Listener, DeciCreation) { - Deci2Server s(always_false); + Deci2Server s(always_false, DECI2_PORT); } TEST(Listener, DeciInit) { - Deci2Server s(always_false); - EXPECT_TRUE(s.init()); + Deci2Server s(always_false, DECI2_PORT); + EXPECT_TRUE(s.init_server()); } /*! @@ -38,61 +38,61 @@ TEST(Listener, ListenToNothing) { } TEST(Listener, DeciCheckNoListener) { - Deci2Server s(always_false); - EXPECT_TRUE(s.init()); - EXPECT_FALSE(s.check_for_listener()); - EXPECT_FALSE(s.check_for_listener()); - EXPECT_FALSE(s.check_for_listener()); + Deci2Server s(always_false, DECI2_PORT); + EXPECT_TRUE(s.init_server()); + EXPECT_FALSE(s.is_client_connected()); + EXPECT_FALSE(s.is_client_connected()); + EXPECT_FALSE(s.is_client_connected()); } TEST(Listener, CheckConnectionStaysAlive) { - Deci2Server s(always_false); - EXPECT_TRUE(s.init()); - EXPECT_FALSE(s.check_for_listener()); + Deci2Server s(always_false, DECI2_PORT); + EXPECT_TRUE(s.init_server()); + EXPECT_FALSE(s.is_client_connected()); Listener l; - EXPECT_FALSE(s.check_for_listener()); + EXPECT_FALSE(s.is_client_connected()); bool connected = l.connect_to_target(); EXPECT_TRUE(connected); // TODO - some sort of backoff and retry would be better - while (connected && !s.check_for_listener()) { + while (connected && !s.is_client_connected()) { } - EXPECT_TRUE(s.check_for_listener()); + EXPECT_TRUE(s.is_client_connected()); std::this_thread::sleep_for(std::chrono::milliseconds(500)); - EXPECT_TRUE(s.check_for_listener()); + EXPECT_TRUE(s.is_client_connected()); EXPECT_TRUE(l.is_connected()); } TEST(Listener, DeciThenListener) { for (int i = 0; i < 3; i++) { - Deci2Server s(always_false); - EXPECT_TRUE(s.init()); - EXPECT_FALSE(s.check_for_listener()); - EXPECT_FALSE(s.check_for_listener()); - EXPECT_FALSE(s.check_for_listener()); + Deci2Server s(always_false, DECI2_PORT); + EXPECT_TRUE(s.init_server()); + EXPECT_FALSE(s.is_client_connected()); + EXPECT_FALSE(s.is_client_connected()); + EXPECT_FALSE(s.is_client_connected()); Listener l; - EXPECT_FALSE(s.check_for_listener()); - EXPECT_FALSE(s.check_for_listener()); + EXPECT_FALSE(s.is_client_connected()); + EXPECT_FALSE(s.is_client_connected()); bool connected = l.connect_to_target(); EXPECT_TRUE(connected); // TODO - some sort of backoff and retry would be better - while (connected && !s.check_for_listener()) { + while (connected && !s.is_client_connected()) { } - EXPECT_TRUE(s.check_for_listener()); + EXPECT_TRUE(s.is_client_connected()); } } TEST(Listener, DeciThenListener2) { for (int i = 0; i < 3; i++) { - Deci2Server s(always_false); - EXPECT_TRUE(s.init()); - EXPECT_FALSE(s.check_for_listener()); - EXPECT_FALSE(s.check_for_listener()); - EXPECT_FALSE(s.check_for_listener()); + Deci2Server s(always_false, DECI2_PORT); + EXPECT_TRUE(s.init_server()); + EXPECT_FALSE(s.is_client_connected()); + EXPECT_FALSE(s.is_client_connected()); + EXPECT_FALSE(s.is_client_connected()); Listener l; - EXPECT_FALSE(s.check_for_listener()); - EXPECT_FALSE(s.check_for_listener()); + EXPECT_FALSE(s.is_client_connected()); + EXPECT_FALSE(s.is_client_connected()); EXPECT_TRUE(l.connect_to_target()); } } @@ -101,13 +101,13 @@ TEST(Listener, ListenerThenDeci) { for (int i = 0; i < 3; i++) { Listener l; EXPECT_FALSE(l.connect_to_target()); - Deci2Server s(always_false); - EXPECT_TRUE(s.init()); - EXPECT_FALSE(s.check_for_listener()); + Deci2Server s(always_false, DECI2_PORT); + EXPECT_TRUE(s.init_server()); + EXPECT_FALSE(s.is_client_connected()); bool connected = l.connect_to_target(); EXPECT_TRUE(connected); // TODO - some sort of backoff and retry would be better - while (connected && !s.check_for_listener()) { + while (connected && !s.is_client_connected()) { } } } diff --git a/test/test_main.cpp b/test/test_main.cpp index b912fd6235..ed083c6be0 100644 --- a/test/test_main.cpp +++ b/test/test_main.cpp @@ -1,11 +1,11 @@ #include -#include "gtest/gtest.h" - -#include "common/util/FileUtil.h" #include "common/log/log.h" +#include "common/util/FileUtil.h" #include "common/util/os.h" +#include "gtest/gtest.h" + // Running subsets of tests, see: // - // https://github.com/google/googletest/blob/620659ed92829a88ee34134c782bf5b5aa5a0a0c/googletest/docs/advanced.md#running-a-subset-of-the-tests @@ -20,6 +20,7 @@ int main(int argc, char** argv) { // hopefully get a debug print on github actions setup_cpu_info(); + file_util::setup_project_path(std::nullopt); lg::initialize(); ::testing::InitGoogleTest(&argc, argv); diff --git a/test/test_math.cpp b/test/test_math.cpp index 7c735c8104..7394f6e762 100644 --- a/test/test_math.cpp +++ b/test/test_math.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "common/math/geometry.h" +#include "gtest/gtest.h" + TEST(Math, RaySphereOrigin) { math::Vector sphere(0, 0, 0); math::Vector line_origin(0, 0, 0); diff --git a/test/test_pretty_print.cpp b/test/test_pretty_print.cpp index 72020f1ffb..6885091db6 100644 --- a/test/test_pretty_print.cpp +++ b/test/test_pretty_print.cpp @@ -1,8 +1,10 @@ -#include "gtest/gtest.h" -#include "common/goos/Reader.h" -#include "common/util/FileUtil.h" #include "common/goos/PrettyPrinter.h" #include "common/goos/PrettyPrinter2.h" +#include "common/goos/Reader.h" +#include "common/util/FileUtil.h" + +#include "gtest/gtest.h" + #include "third-party/fmt/core.h" using namespace goos; diff --git a/test/test_reader.cpp b/test/test_reader.cpp index 124a22acfc..aeba24a666 100644 --- a/test/test_reader.cpp +++ b/test/test_reader.cpp @@ -4,10 +4,11 @@ * For some reason this runs at ~5 fps in CLion IDE. */ -#include "gtest/gtest.h" #include "common/goos/Reader.h" #include "common/util/FileUtil.h" +#include "gtest/gtest.h" + using namespace goos; TEST(GoosReader, Construction) { @@ -206,9 +207,9 @@ TEST(GoosReader, Symbol) { namespace { bool first_list_matches(Object o, std::vector stuff) { - auto lst = o.as_pair()->cdr.as_pair()->car; + auto& lst = o.as_pair()->cdr.as_pair()->car; for (const auto& x : stuff) { - const auto check = x.as_pair()->cdr.as_pair()->car; + const auto& check = x.as_pair()->cdr.as_pair()->car; if (lst.as_pair()->car != check) { return false; } @@ -233,11 +234,11 @@ bool first_array_matches(Object o, std::vector stuff) { } bool first_pair_matches(Object o, Object car, Object cdr) { - auto lst = o.as_pair()->cdr.as_pair()->car; + auto& lst = o.as_pair()->cdr.as_pair()->car; return (lst.as_pair()->car == car) && (lst.as_pair()->cdr == cdr); } -bool print_matches(Object o, std::string expected) { +bool print_matches(Object o, const std::string& expected) { return o.as_pair()->cdr.as_pair()->car.print() == expected; } diff --git a/test/test_type_system.cpp b/test/test_type_system.cpp index 8f63ccbfef..6c7080a1cd 100644 --- a/test/test_type_system.cpp +++ b/test/test_type_system.cpp @@ -1,8 +1,9 @@ -#include "gtest/gtest.h" -#include "common/type_system/TypeSystem.h" -#include "common/goos/Reader.h" -#include "common/type_system/deftype.h" #include "common/goos/ParseHelpers.h" +#include "common/goos/Reader.h" +#include "common/type_system/TypeSystem.h" +#include "common/type_system/deftype.h" + +#include "gtest/gtest.h" TEST(TypeSystem, Construction) { // test that we can add all builtin types without any type errors diff --git a/test/test_zstd.cpp b/test/test_zstd.cpp index 1519da99ae..4d66c6a187 100644 --- a/test/test_zstd.cpp +++ b/test/test_zstd.cpp @@ -3,11 +3,12 @@ #include #include "common/common_types.h" +#include "common/util/compress.h" #include "gtest/gtest.h" #include "test/all_jak1_symbols.h" + #include "third-party/zstd/lib/zstd.h" -#include "common/util/compress.h" TEST(ZSTD, Basic) { std::string all; diff --git a/test/test_zydis.cpp b/test/test_zydis.cpp index 2311397615..363c7175ba 100644 --- a/test/test_zydis.cpp +++ b/test/test_zydis.cpp @@ -1,5 +1,7 @@ -#include "gtest/gtest.h" #include "common/common_types.h" + +#include "gtest/gtest.h" + #include "third-party/zydis/include/Zydis/Zydis.h" TEST(Zydis, Basic) { diff --git a/third-party/CLI11.hpp b/third-party/CLI11.hpp new file mode 100644 index 0000000000..f29a5c4e1e --- /dev/null +++ b/third-party/CLI11.hpp @@ -0,0 +1,9190 @@ +// CLI11: Version 2.2.0 +// Originally designed by Henry Schreiner +// https://github.com/CLIUtils/CLI11 +// +// This is a standalone header file generated by MakeSingleHeader.py in CLI11/scripts +// from: v2.2.0 +// +// CLI11 2.2.0 Copyright (c) 2017-2022 University of Cincinnati, developed by Henry +// Schreiner under NSF AWARD 1414736. All rights reserved. +// +// Redistribution and use in source and binary forms of CLI11, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// 2. 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. +// 3. Neither the name of the copyright holder 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. + +#pragma once + +// Standard combined includes: +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define CLI11_VERSION_MAJOR 2 +#define CLI11_VERSION_MINOR 2 +#define CLI11_VERSION_PATCH 0 +#define CLI11_VERSION "2.2.0" + + + + +// The following version macro is very similar to the one in pybind11 +#if !(defined(_MSC_VER) && __cplusplus == 199711L) && !defined(__INTEL_COMPILER) +#if __cplusplus >= 201402L +#define CLI11_CPP14 +#if __cplusplus >= 201703L +#define CLI11_CPP17 +#if __cplusplus > 201703L +#define CLI11_CPP20 +#endif +#endif +#endif +#elif defined(_MSC_VER) && __cplusplus == 199711L +// MSVC sets _MSVC_LANG rather than __cplusplus (supposedly until the standard is fully implemented) +// Unless you use the /Zc:__cplusplus flag on Visual Studio 2017 15.7 Preview 3 or newer +#if _MSVC_LANG >= 201402L +#define CLI11_CPP14 +#if _MSVC_LANG > 201402L && _MSC_VER >= 1910 +#define CLI11_CPP17 +#if _MSVC_LANG > 201703L && _MSC_VER >= 1910 +#define CLI11_CPP20 +#endif +#endif +#endif +#endif + +#if defined(CLI11_CPP14) +#define CLI11_DEPRECATED(reason) [[deprecated(reason)]] +#elif defined(_MSC_VER) +#define CLI11_DEPRECATED(reason) __declspec(deprecated(reason)) +#else +#define CLI11_DEPRECATED(reason) __attribute__((deprecated(reason))) +#endif + +/** detection of rtti */ +#ifndef CLI11_USE_STATIC_RTTI +#if(defined(_HAS_STATIC_RTTI) && _HAS_STATIC_RTTI) +#define CLI11_USE_STATIC_RTTI 1 +#elif defined(__cpp_rtti) +#if(defined(_CPPRTTI) && _CPPRTTI == 0) +#define CLI11_USE_STATIC_RTTI 1 +#else +#define CLI11_USE_STATIC_RTTI 0 +#endif +#elif(defined(__GCC_RTTI) && __GXX_RTTI) +#define CLI11_USE_STATIC_RTTI 0 +#else +#define CLI11_USE_STATIC_RTTI 1 +#endif +#endif + + + +// C standard library +// Only needed for existence checking +#if defined CLI11_CPP17 && defined __has_include && !defined CLI11_HAS_FILESYSTEM +#if __has_include() +// Filesystem cannot be used if targeting macOS < 10.15 +#if defined __MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 +#define CLI11_HAS_FILESYSTEM 0 +#elif defined(__wasi__) +// As of wasi-sdk-14, filesystem is not implemented +#define CLI11_HAS_FILESYSTEM 0 +#else +#include +#if defined __cpp_lib_filesystem && __cpp_lib_filesystem >= 201703 +#if defined _GLIBCXX_RELEASE && _GLIBCXX_RELEASE >= 9 +#define CLI11_HAS_FILESYSTEM 1 +#elif defined(__GLIBCXX__) +// if we are using gcc and Version <9 default to no filesystem +#define CLI11_HAS_FILESYSTEM 0 +#else +#define CLI11_HAS_FILESYSTEM 1 +#endif +#else +#define CLI11_HAS_FILESYSTEM 0 +#endif +#endif +#endif +#endif + +#if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0 +#include // NOLINT(build/include) +#else +#include +#include +#endif + + + +namespace CLI { + + +/// Include the items in this namespace to get free conversion of enums to/from streams. +/// (This is available inside CLI as well, so CLI11 will use this without a using statement). +namespace enums { + +/// output streaming for enumerations +template ::value>::type> +std::ostream &operator<<(std::ostream &in, const T &item) { + // make sure this is out of the detail namespace otherwise it won't be found when needed + return in << static_cast::type>(item); +} + +} // namespace enums + +/// Export to CLI namespace +using enums::operator<<; + +namespace detail { +/// a constant defining an expected max vector size defined to be a big number that could be multiplied by 4 and not +/// produce overflow for some expected uses +constexpr int expected_max_vector_size{1 << 29}; +// Based on http://stackoverflow.com/questions/236129/split-a-string-in-c +/// Split a string by a delim +inline std::vector split(const std::string &s, char delim) { + std::vector elems; + // Check to see if empty string, give consistent result + if(s.empty()) { + elems.emplace_back(); + } else { + std::stringstream ss; + ss.str(s); + std::string item; + while(std::getline(ss, item, delim)) { + elems.push_back(item); + } + } + return elems; +} + +/// Simple function to join a string +template std::string join(const T &v, std::string delim = ",") { + std::ostringstream s; + auto beg = std::begin(v); + auto end = std::end(v); + if(beg != end) + s << *beg++; + while(beg != end) { + s << delim << *beg++; + } + return s.str(); +} + +/// Simple function to join a string from processed elements +template ::value>::type> +std::string join(const T &v, Callable func, std::string delim = ",") { + std::ostringstream s; + auto beg = std::begin(v); + auto end = std::end(v); + auto loc = s.tellp(); + while(beg != end) { + auto nloc = s.tellp(); + if(nloc > loc) { + s << delim; + loc = nloc; + } + s << func(*beg++); + } + return s.str(); +} + +/// Join a string in reverse order +template std::string rjoin(const T &v, std::string delim = ",") { + std::ostringstream s; + for(std::size_t start = 0; start < v.size(); start++) { + if(start > 0) + s << delim; + s << v[v.size() - start - 1]; + } + return s.str(); +} + +// Based roughly on http://stackoverflow.com/questions/25829143/c-trim-whitespace-from-a-string + +/// Trim whitespace from left of string +inline std::string <rim(std::string &str) { + auto it = std::find_if(str.begin(), str.end(), [](char ch) { return !std::isspace(ch, std::locale()); }); + str.erase(str.begin(), it); + return str; +} + +/// Trim anything from left of string +inline std::string <rim(std::string &str, const std::string &filter) { + auto it = std::find_if(str.begin(), str.end(), [&filter](char ch) { return filter.find(ch) == std::string::npos; }); + str.erase(str.begin(), it); + return str; +} + +/// Trim whitespace from right of string +inline std::string &rtrim(std::string &str) { + auto it = std::find_if(str.rbegin(), str.rend(), [](char ch) { return !std::isspace(ch, std::locale()); }); + str.erase(it.base(), str.end()); + return str; +} + +/// Trim anything from right of string +inline std::string &rtrim(std::string &str, const std::string &filter) { + auto it = + std::find_if(str.rbegin(), str.rend(), [&filter](char ch) { return filter.find(ch) == std::string::npos; }); + str.erase(it.base(), str.end()); + return str; +} + +/// Trim whitespace from string +inline std::string &trim(std::string &str) { return ltrim(rtrim(str)); } + +/// Trim anything from string +inline std::string &trim(std::string &str, const std::string filter) { return ltrim(rtrim(str, filter), filter); } + +/// Make a copy of the string and then trim it +inline std::string trim_copy(const std::string &str) { + std::string s = str; + return trim(s); +} + +/// remove quotes at the front and back of a string either '"' or '\'' +inline std::string &remove_quotes(std::string &str) { + if(str.length() > 1 && (str.front() == '"' || str.front() == '\'')) { + if(str.front() == str.back()) { + str.pop_back(); + str.erase(str.begin(), str.begin() + 1); + } + } + return str; +} + +/// Add a leader to the beginning of all new lines (nothing is added +/// at the start of the first line). `"; "` would be for ini files +/// +/// Can't use Regex, or this would be a subs. +inline std::string fix_newlines(const std::string &leader, std::string input) { + std::string::size_type n = 0; + while(n != std::string::npos && n < input.size()) { + n = input.find('\n', n); + if(n != std::string::npos) { + input = input.substr(0, n + 1) + leader + input.substr(n + 1); + n += leader.size(); + } + } + return input; +} + +/// Make a copy of the string and then trim it, any filter string can be used (any char in string is filtered) +inline std::string trim_copy(const std::string &str, const std::string &filter) { + std::string s = str; + return trim(s, filter); +} +/// Print a two part "help" string +inline std::ostream &format_help(std::ostream &out, std::string name, const std::string &description, std::size_t wid) { + name = " " + name; + out << std::setw(static_cast(wid)) << std::left << name; + if(!description.empty()) { + if(name.length() >= wid) + out << "\n" << std::setw(static_cast(wid)) << ""; + for(const char c : description) { + out.put(c); + if(c == '\n') { + out << std::setw(static_cast(wid)) << ""; + } + } + } + out << "\n"; + return out; +} + +/// Print subcommand aliases +inline std::ostream &format_aliases(std::ostream &out, const std::vector &aliases, std::size_t wid) { + if(!aliases.empty()) { + out << std::setw(static_cast(wid)) << " aliases: "; + bool front = true; + for(const auto &alias : aliases) { + if(!front) { + out << ", "; + } else { + front = false; + } + out << detail::fix_newlines(" ", alias); + } + out << "\n"; + } + return out; +} + +/// Verify the first character of an option +/// - is a trigger character, ! has special meaning and new lines would just be annoying to deal with +template bool valid_first_char(T c) { return ((c != '-') && (c != '!') && (c != ' ') && c != '\n'); } + +/// Verify following characters of an option +template bool valid_later_char(T c) { + // = and : are value separators, { has special meaning for option defaults, + // and \n would just be annoying to deal with in many places allowing space here has too much potential for + // inadvertent entry errors and bugs + return ((c != '=') && (c != ':') && (c != '{') && (c != ' ') && c != '\n'); +} + +/// Verify an option/subcommand name +inline bool valid_name_string(const std::string &str) { + if(str.empty() || !valid_first_char(str[0])) { + return false; + } + auto e = str.end(); + for(auto c = str.begin() + 1; c != e; ++c) + if(!valid_later_char(*c)) + return false; + return true; +} + +/// Verify an app name +inline bool valid_alias_name_string(const std::string &str) { + static const std::string badChars(std::string("\n") + '\0'); + return (str.find_first_of(badChars) == std::string::npos); +} + +/// check if a string is a container segment separator (empty or "%%") +inline bool is_separator(const std::string &str) { + static const std::string sep("%%"); + return (str.empty() || str == sep); +} + +/// Verify that str consists of letters only +inline bool isalpha(const std::string &str) { + return std::all_of(str.begin(), str.end(), [](char c) { return std::isalpha(c, std::locale()); }); +} + +/// Return a lower case version of a string +inline std::string to_lower(std::string str) { + std::transform(std::begin(str), std::end(str), std::begin(str), [](const std::string::value_type &x) { + return std::tolower(x, std::locale()); + }); + return str; +} + +/// remove underscores from a string +inline std::string remove_underscore(std::string str) { + str.erase(std::remove(std::begin(str), std::end(str), '_'), std::end(str)); + return str; +} + +/// Find and replace a substring with another substring +inline std::string find_and_replace(std::string str, std::string from, std::string to) { + + std::size_t start_pos = 0; + + while((start_pos = str.find(from, start_pos)) != std::string::npos) { + str.replace(start_pos, from.length(), to); + start_pos += to.length(); + } + + return str; +} + +/// check if the flag definitions has possible false flags +inline bool has_default_flag_values(const std::string &flags) { + return (flags.find_first_of("{!") != std::string::npos); +} + +inline void remove_default_flag_values(std::string &flags) { + auto loc = flags.find_first_of('{', 2); + while(loc != std::string::npos) { + auto finish = flags.find_first_of("},", loc + 1); + if((finish != std::string::npos) && (flags[finish] == '}')) { + flags.erase(flags.begin() + static_cast(loc), + flags.begin() + static_cast(finish) + 1); + } + loc = flags.find_first_of('{', loc + 1); + } + flags.erase(std::remove(flags.begin(), flags.end(), '!'), flags.end()); +} + +/// Check if a string is a member of a list of strings and optionally ignore case or ignore underscores +inline std::ptrdiff_t find_member(std::string name, + const std::vector names, + bool ignore_case = false, + bool ignore_underscore = false) { + auto it = std::end(names); + if(ignore_case) { + if(ignore_underscore) { + name = detail::to_lower(detail::remove_underscore(name)); + it = std::find_if(std::begin(names), std::end(names), [&name](std::string local_name) { + return detail::to_lower(detail::remove_underscore(local_name)) == name; + }); + } else { + name = detail::to_lower(name); + it = std::find_if(std::begin(names), std::end(names), [&name](std::string local_name) { + return detail::to_lower(local_name) == name; + }); + } + + } else if(ignore_underscore) { + name = detail::remove_underscore(name); + it = std::find_if(std::begin(names), std::end(names), [&name](std::string local_name) { + return detail::remove_underscore(local_name) == name; + }); + } else { + it = std::find(std::begin(names), std::end(names), name); + } + + return (it != std::end(names)) ? (it - std::begin(names)) : (-1); +} + +/// Find a trigger string and call a modify callable function that takes the current string and starting position of the +/// trigger and returns the position in the string to search for the next trigger string +template inline std::string find_and_modify(std::string str, std::string trigger, Callable modify) { + std::size_t start_pos = 0; + while((start_pos = str.find(trigger, start_pos)) != std::string::npos) { + start_pos = modify(str, start_pos); + } + return str; +} + +/// Split a string '"one two" "three"' into 'one two', 'three' +/// Quote characters can be ` ' or " +inline std::vector split_up(std::string str, char delimiter = '\0') { + + const std::string delims("\'\"`"); + auto find_ws = [delimiter](char ch) { + return (delimiter == '\0') ? (std::isspace(ch, std::locale()) != 0) : (ch == delimiter); + }; + trim(str); + + std::vector output; + bool embeddedQuote = false; + char keyChar = ' '; + while(!str.empty()) { + if(delims.find_first_of(str[0]) != std::string::npos) { + keyChar = str[0]; + auto end = str.find_first_of(keyChar, 1); + while((end != std::string::npos) && (str[end - 1] == '\\')) { // deal with escaped quotes + end = str.find_first_of(keyChar, end + 1); + embeddedQuote = true; + } + if(end != std::string::npos) { + output.push_back(str.substr(1, end - 1)); + if(end + 2 < str.size()) { + str = str.substr(end + 2); + } else { + str.clear(); + } + + } else { + output.push_back(str.substr(1)); + str = ""; + } + } else { + auto it = std::find_if(std::begin(str), std::end(str), find_ws); + if(it != std::end(str)) { + std::string value = std::string(str.begin(), it); + output.push_back(value); + str = std::string(it + 1, str.end()); + } else { + output.push_back(str); + str = ""; + } + } + // transform any embedded quotes into the regular character + if(embeddedQuote) { + output.back() = find_and_replace(output.back(), std::string("\\") + keyChar, std::string(1, keyChar)); + embeddedQuote = false; + } + trim(str); + } + return output; +} + +/// This function detects an equal or colon followed by an escaped quote after an argument +/// then modifies the string to replace the equality with a space. This is needed +/// to allow the split up function to work properly and is intended to be used with the find_and_modify function +/// the return value is the offset+1 which is required by the find_and_modify function. +inline std::size_t escape_detect(std::string &str, std::size_t offset) { + auto next = str[offset + 1]; + if((next == '\"') || (next == '\'') || (next == '`')) { + auto astart = str.find_last_of("-/ \"\'`", offset - 1); + if(astart != std::string::npos) { + if(str[astart] == ((str[offset] == '=') ? '-' : '/')) + str[offset] = ' '; // interpret this as a space so the split_up works properly + } + } + return offset + 1; +} + +/// Add quotes if the string contains spaces +inline std::string &add_quotes_if_needed(std::string &str) { + if((str.front() != '"' && str.front() != '\'') || str.front() != str.back()) { + char quote = str.find('"') < str.find('\'') ? '\'' : '"'; + if(str.find(' ') != std::string::npos) { + str.insert(0, 1, quote); + str.append(1, quote); + } + } + return str; +} + +} // namespace detail + + + + +// Use one of these on all error classes. +// These are temporary and are undef'd at the end of this file. +#define CLI11_ERROR_DEF(parent, name) \ + protected: \ + name(std::string ename, std::string msg, int exit_code) : parent(std::move(ename), std::move(msg), exit_code) {} \ + name(std::string ename, std::string msg, ExitCodes exit_code) \ + : parent(std::move(ename), std::move(msg), exit_code) {} \ + \ + public: \ + name(std::string msg, ExitCodes exit_code) : parent(#name, std::move(msg), exit_code) {} \ + name(std::string msg, int exit_code) : parent(#name, std::move(msg), exit_code) {} + +// This is added after the one above if a class is used directly and builds its own message +#define CLI11_ERROR_SIMPLE(name) \ + explicit name(std::string msg) : name(#name, msg, ExitCodes::name) {} + +/// These codes are part of every error in CLI. They can be obtained from e using e.exit_code or as a quick shortcut, +/// int values from e.get_error_code(). +enum class ExitCodes { + Success = 0, + IncorrectConstruction = 100, + BadNameString, + OptionAlreadyAdded, + FileError, + ConversionError, + ValidationError, + RequiredError, + RequiresError, + ExcludesError, + ExtrasError, + ConfigError, + InvalidError, + HorribleError, + OptionNotFound, + ArgumentMismatch, + BaseClass = 127 +}; + +// Error definitions + +/// @defgroup error_group Errors +/// @brief Errors thrown by CLI11 +/// +/// These are the errors that can be thrown. Some of them, like CLI::Success, are not really errors. +/// @{ + +/// All errors derive from this one +class Error : public std::runtime_error { + int actual_exit_code; + std::string error_name{"Error"}; + + public: + int get_exit_code() const { return actual_exit_code; } + + std::string get_name() const { return error_name; } + + Error(std::string name, std::string msg, int exit_code = static_cast(ExitCodes::BaseClass)) + : runtime_error(msg), actual_exit_code(exit_code), error_name(std::move(name)) {} + + Error(std::string name, std::string msg, ExitCodes exit_code) : Error(name, msg, static_cast(exit_code)) {} +}; + +// Note: Using Error::Error constructors does not work on GCC 4.7 + +/// Construction errors (not in parsing) +class ConstructionError : public Error { + CLI11_ERROR_DEF(Error, ConstructionError) +}; + +/// Thrown when an option is set to conflicting values (non-vector and multi args, for example) +class IncorrectConstruction : public ConstructionError { + CLI11_ERROR_DEF(ConstructionError, IncorrectConstruction) + CLI11_ERROR_SIMPLE(IncorrectConstruction) + static IncorrectConstruction PositionalFlag(std::string name) { + return IncorrectConstruction(name + ": Flags cannot be positional"); + } + static IncorrectConstruction Set0Opt(std::string name) { + return IncorrectConstruction(name + ": Cannot set 0 expected, use a flag instead"); + } + static IncorrectConstruction SetFlag(std::string name) { + return IncorrectConstruction(name + ": Cannot set an expected number for flags"); + } + static IncorrectConstruction ChangeNotVector(std::string name) { + return IncorrectConstruction(name + ": You can only change the expected arguments for vectors"); + } + static IncorrectConstruction AfterMultiOpt(std::string name) { + return IncorrectConstruction( + name + ": You can't change expected arguments after you've changed the multi option policy!"); + } + static IncorrectConstruction MissingOption(std::string name) { + return IncorrectConstruction("Option " + name + " is not defined"); + } + static IncorrectConstruction MultiOptionPolicy(std::string name) { + return IncorrectConstruction(name + ": multi_option_policy only works for flags and exact value options"); + } +}; + +/// Thrown on construction of a bad name +class BadNameString : public ConstructionError { + CLI11_ERROR_DEF(ConstructionError, BadNameString) + CLI11_ERROR_SIMPLE(BadNameString) + static BadNameString OneCharName(std::string name) { return BadNameString("Invalid one char name: " + name); } + static BadNameString BadLongName(std::string name) { return BadNameString("Bad long name: " + name); } + static BadNameString DashesOnly(std::string name) { + return BadNameString("Must have a name, not just dashes: " + name); + } + static BadNameString MultiPositionalNames(std::string name) { + return BadNameString("Only one positional name allowed, remove: " + name); + } +}; + +/// Thrown when an option already exists +class OptionAlreadyAdded : public ConstructionError { + CLI11_ERROR_DEF(ConstructionError, OptionAlreadyAdded) + explicit OptionAlreadyAdded(std::string name) + : OptionAlreadyAdded(name + " is already added", ExitCodes::OptionAlreadyAdded) {} + static OptionAlreadyAdded Requires(std::string name, std::string other) { + return OptionAlreadyAdded(name + " requires " + other, ExitCodes::OptionAlreadyAdded); + } + static OptionAlreadyAdded Excludes(std::string name, std::string other) { + return OptionAlreadyAdded(name + " excludes " + other, ExitCodes::OptionAlreadyAdded); + } +}; + +// Parsing errors + +/// Anything that can error in Parse +class ParseError : public Error { + CLI11_ERROR_DEF(Error, ParseError) +}; + +// Not really "errors" + +/// This is a successful completion on parsing, supposed to exit +class Success : public ParseError { + CLI11_ERROR_DEF(ParseError, Success) + Success() : Success("Successfully completed, should be caught and quit", ExitCodes::Success) {} +}; + +/// -h or --help on command line +class CallForHelp : public Success { + CLI11_ERROR_DEF(Success, CallForHelp) + CallForHelp() : CallForHelp("This should be caught in your main function, see examples", ExitCodes::Success) {} +}; + +/// Usually something like --help-all on command line +class CallForAllHelp : public Success { + CLI11_ERROR_DEF(Success, CallForAllHelp) + CallForAllHelp() + : CallForAllHelp("This should be caught in your main function, see examples", ExitCodes::Success) {} +}; + +/// -v or --version on command line +class CallForVersion : public Success { + CLI11_ERROR_DEF(Success, CallForVersion) + CallForVersion() + : CallForVersion("This should be caught in your main function, see examples", ExitCodes::Success) {} +}; + +/// Does not output a diagnostic in CLI11_PARSE, but allows main() to return with a specific error code. +class RuntimeError : public ParseError { + CLI11_ERROR_DEF(ParseError, RuntimeError) + explicit RuntimeError(int exit_code = 1) : RuntimeError("Runtime error", exit_code) {} +}; + +/// Thrown when parsing an INI file and it is missing +class FileError : public ParseError { + CLI11_ERROR_DEF(ParseError, FileError) + CLI11_ERROR_SIMPLE(FileError) + static FileError Missing(std::string name) { return FileError(name + " was not readable (missing?)"); } +}; + +/// Thrown when conversion call back fails, such as when an int fails to coerce to a string +class ConversionError : public ParseError { + CLI11_ERROR_DEF(ParseError, ConversionError) + CLI11_ERROR_SIMPLE(ConversionError) + ConversionError(std::string member, std::string name) + : ConversionError("The value " + member + " is not an allowed value for " + name) {} + ConversionError(std::string name, std::vector results) + : ConversionError("Could not convert: " + name + " = " + detail::join(results)) {} + static ConversionError TooManyInputsFlag(std::string name) { + return ConversionError(name + ": too many inputs for a flag"); + } + static ConversionError TrueFalse(std::string name) { + return ConversionError(name + ": Should be true/false or a number"); + } +}; + +/// Thrown when validation of results fails +class ValidationError : public ParseError { + CLI11_ERROR_DEF(ParseError, ValidationError) + CLI11_ERROR_SIMPLE(ValidationError) + explicit ValidationError(std::string name, std::string msg) : ValidationError(name + ": " + msg) {} +}; + +/// Thrown when a required option is missing +class RequiredError : public ParseError { + CLI11_ERROR_DEF(ParseError, RequiredError) + explicit RequiredError(std::string name) : RequiredError(name + " is required", ExitCodes::RequiredError) {} + static RequiredError Subcommand(std::size_t min_subcom) { + if(min_subcom == 1) { + return RequiredError("A subcommand"); + } + return RequiredError("Requires at least " + std::to_string(min_subcom) + " subcommands", + ExitCodes::RequiredError); + } + static RequiredError + Option(std::size_t min_option, std::size_t max_option, std::size_t used, const std::string &option_list) { + if((min_option == 1) && (max_option == 1) && (used == 0)) + return RequiredError("Exactly 1 option from [" + option_list + "]"); + if((min_option == 1) && (max_option == 1) && (used > 1)) { + return RequiredError("Exactly 1 option from [" + option_list + "] is required and " + std::to_string(used) + + " were given", + ExitCodes::RequiredError); + } + if((min_option == 1) && (used == 0)) + return RequiredError("At least 1 option from [" + option_list + "]"); + if(used < min_option) { + return RequiredError("Requires at least " + std::to_string(min_option) + " options used and only " + + std::to_string(used) + "were given from [" + option_list + "]", + ExitCodes::RequiredError); + } + if(max_option == 1) + return RequiredError("Requires at most 1 options be given from [" + option_list + "]", + ExitCodes::RequiredError); + + return RequiredError("Requires at most " + std::to_string(max_option) + " options be used and " + + std::to_string(used) + "were given from [" + option_list + "]", + ExitCodes::RequiredError); + } +}; + +/// Thrown when the wrong number of arguments has been received +class ArgumentMismatch : public ParseError { + CLI11_ERROR_DEF(ParseError, ArgumentMismatch) + CLI11_ERROR_SIMPLE(ArgumentMismatch) + ArgumentMismatch(std::string name, int expected, std::size_t received) + : ArgumentMismatch(expected > 0 ? ("Expected exactly " + std::to_string(expected) + " arguments to " + name + + ", got " + std::to_string(received)) + : ("Expected at least " + std::to_string(-expected) + " arguments to " + name + + ", got " + std::to_string(received)), + ExitCodes::ArgumentMismatch) {} + + static ArgumentMismatch AtLeast(std::string name, int num, std::size_t received) { + return ArgumentMismatch(name + ": At least " + std::to_string(num) + " required but received " + + std::to_string(received)); + } + static ArgumentMismatch AtMost(std::string name, int num, std::size_t received) { + return ArgumentMismatch(name + ": At Most " + std::to_string(num) + " required but received " + + std::to_string(received)); + } + static ArgumentMismatch TypedAtLeast(std::string name, int num, std::string type) { + return ArgumentMismatch(name + ": " + std::to_string(num) + " required " + type + " missing"); + } + static ArgumentMismatch FlagOverride(std::string name) { + return ArgumentMismatch(name + " was given a disallowed flag override"); + } + static ArgumentMismatch PartialType(std::string name, int num, std::string type) { + return ArgumentMismatch(name + ": " + type + " only partially specified: " + std::to_string(num) + + " required for each element"); + } +}; + +/// Thrown when a requires option is missing +class RequiresError : public ParseError { + CLI11_ERROR_DEF(ParseError, RequiresError) + RequiresError(std::string curname, std::string subname) + : RequiresError(curname + " requires " + subname, ExitCodes::RequiresError) {} +}; + +/// Thrown when an excludes option is present +class ExcludesError : public ParseError { + CLI11_ERROR_DEF(ParseError, ExcludesError) + ExcludesError(std::string curname, std::string subname) + : ExcludesError(curname + " excludes " + subname, ExitCodes::ExcludesError) {} +}; + +/// Thrown when too many positionals or options are found +class ExtrasError : public ParseError { + CLI11_ERROR_DEF(ParseError, ExtrasError) + explicit ExtrasError(std::vector args) + : ExtrasError((args.size() > 1 ? "The following arguments were not expected: " + : "The following argument was not expected: ") + + detail::rjoin(args, " "), + ExitCodes::ExtrasError) {} + ExtrasError(const std::string &name, std::vector args) + : ExtrasError(name, + (args.size() > 1 ? "The following arguments were not expected: " + : "The following argument was not expected: ") + + detail::rjoin(args, " "), + ExitCodes::ExtrasError) {} +}; + +/// Thrown when extra values are found in an INI file +class ConfigError : public ParseError { + CLI11_ERROR_DEF(ParseError, ConfigError) + CLI11_ERROR_SIMPLE(ConfigError) + static ConfigError Extras(std::string item) { return ConfigError("INI was not able to parse " + item); } + static ConfigError NotConfigurable(std::string item) { + return ConfigError(item + ": This option is not allowed in a configuration file"); + } +}; + +/// Thrown when validation fails before parsing +class InvalidError : public ParseError { + CLI11_ERROR_DEF(ParseError, InvalidError) + explicit InvalidError(std::string name) + : InvalidError(name + ": Too many positional arguments with unlimited expected args", ExitCodes::InvalidError) { + } +}; + +/// This is just a safety check to verify selection and parsing match - you should not ever see it +/// Strings are directly added to this error, but again, it should never be seen. +class HorribleError : public ParseError { + CLI11_ERROR_DEF(ParseError, HorribleError) + CLI11_ERROR_SIMPLE(HorribleError) +}; + +// After parsing + +/// Thrown when counting a non-existent option +class OptionNotFound : public Error { + CLI11_ERROR_DEF(Error, OptionNotFound) + explicit OptionNotFound(std::string name) : OptionNotFound(name + " not found", ExitCodes::OptionNotFound) {} +}; + +#undef CLI11_ERROR_DEF +#undef CLI11_ERROR_SIMPLE + +/// @} + + + + +// Type tools + +// Utilities for type enabling +namespace detail { +// Based generally on https://rmf.io/cxx11/almost-static-if +/// Simple empty scoped class +enum class enabler {}; + +/// An instance to use in EnableIf +constexpr enabler dummy = {}; +} // namespace detail + +/// A copy of enable_if_t from C++14, compatible with C++11. +/// +/// We could check to see if C++14 is being used, but it does not hurt to redefine this +/// (even Google does this: https://github.com/google/skia/blob/main/include/private/SkTLogic.h) +/// It is not in the std namespace anyway, so no harm done. +template using enable_if_t = typename std::enable_if::type; + +/// A copy of std::void_t from C++17 (helper for C++11 and C++14) +template struct make_void { using type = void; }; + +/// A copy of std::void_t from C++17 - same reasoning as enable_if_t, it does not hurt to redefine +template using void_t = typename make_void::type; + +/// A copy of std::conditional_t from C++14 - same reasoning as enable_if_t, it does not hurt to redefine +template using conditional_t = typename std::conditional::type; + +/// Check to see if something is bool (fail check by default) +template struct is_bool : std::false_type {}; + +/// Check to see if something is bool (true if actually a bool) +template <> struct is_bool : std::true_type {}; + +/// Check to see if something is a shared pointer +template struct is_shared_ptr : std::false_type {}; + +/// Check to see if something is a shared pointer (True if really a shared pointer) +template struct is_shared_ptr> : std::true_type {}; + +/// Check to see if something is a shared pointer (True if really a shared pointer) +template struct is_shared_ptr> : std::true_type {}; + +/// Check to see if something is copyable pointer +template struct is_copyable_ptr { + static bool const value = is_shared_ptr::value || std::is_pointer::value; +}; + +/// This can be specialized to override the type deduction for IsMember. +template struct IsMemberType { using type = T; }; + +/// The main custom type needed here is const char * should be a string. +template <> struct IsMemberType { using type = std::string; }; + +namespace detail { + +// These are utilities for IsMember and other transforming objects + +/// Handy helper to access the element_type generically. This is not part of is_copyable_ptr because it requires that +/// pointer_traits be valid. + +/// not a pointer +template struct element_type { using type = T; }; + +template struct element_type::value>::type> { + using type = typename std::pointer_traits::element_type; +}; + +/// Combination of the element type and value type - remove pointer (including smart pointers) and get the value_type of +/// the container +template struct element_value_type { using type = typename element_type::type::value_type; }; + +/// Adaptor for set-like structure: This just wraps a normal container in a few utilities that do almost nothing. +template struct pair_adaptor : std::false_type { + using value_type = typename T::value_type; + using first_type = typename std::remove_const::type; + using second_type = typename std::remove_const::type; + + /// Get the first value (really just the underlying value) + template static auto first(Q &&pair_value) -> decltype(std::forward(pair_value)) { + return std::forward(pair_value); + } + /// Get the second value (really just the underlying value) + template static auto second(Q &&pair_value) -> decltype(std::forward(pair_value)) { + return std::forward(pair_value); + } +}; + +/// Adaptor for map-like structure (true version, must have key_type and mapped_type). +/// This wraps a mapped container in a few utilities access it in a general way. +template +struct pair_adaptor< + T, + conditional_t, void>> + : std::true_type { + using value_type = typename T::value_type; + using first_type = typename std::remove_const::type; + using second_type = typename std::remove_const::type; + + /// Get the first value (really just the underlying value) + template static auto first(Q &&pair_value) -> decltype(std::get<0>(std::forward(pair_value))) { + return std::get<0>(std::forward(pair_value)); + } + /// Get the second value (really just the underlying value) + template static auto second(Q &&pair_value) -> decltype(std::get<1>(std::forward(pair_value))) { + return std::get<1>(std::forward(pair_value)); + } +}; + +// Warning is suppressed due to "bug" in gcc<5.0 and gcc 7.0 with c++17 enabled that generates a Wnarrowing warning +// in the unevaluated context even if the function that was using this wasn't used. The standard says narrowing in +// brace initialization shouldn't be allowed but for backwards compatibility gcc allows it in some contexts. It is a +// little fuzzy what happens in template constructs and I think that was something GCC took a little while to work out. +// But regardless some versions of gcc generate a warning when they shouldn't from the following code so that should be +// suppressed +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wnarrowing" +#endif +// check for constructibility from a specific type and copy assignable used in the parse detection +template class is_direct_constructible { + template + static auto test(int, std::true_type) -> decltype( +// NVCC warns about narrowing conversions here +#ifdef __CUDACC__ +#pragma diag_suppress 2361 +#endif + TT { std::declval() } +#ifdef __CUDACC__ +#pragma diag_default 2361 +#endif + , + std::is_move_assignable()); + + template static auto test(int, std::false_type) -> std::false_type; + + template static auto test(...) -> std::false_type; + + public: + static constexpr bool value = decltype(test(0, typename std::is_constructible::type()))::value; +}; +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + +// Check for output streamability +// Based on https://stackoverflow.com/questions/22758291/how-can-i-detect-if-a-type-can-be-streamed-to-an-stdostream + +template class is_ostreamable { + template + static auto test(int) -> decltype(std::declval() << std::declval(), std::true_type()); + + template static auto test(...) -> std::false_type; + + public: + static constexpr bool value = decltype(test(0))::value; +}; + +/// Check for input streamability +template class is_istreamable { + template + static auto test(int) -> decltype(std::declval() >> std::declval(), std::true_type()); + + template static auto test(...) -> std::false_type; + + public: + static constexpr bool value = decltype(test(0))::value; +}; + +/// Check for complex +template class is_complex { + template + static auto test(int) -> decltype(std::declval().real(), std::declval().imag(), std::true_type()); + + template static auto test(...) -> std::false_type; + + public: + static constexpr bool value = decltype(test(0))::value; +}; + +/// Templated operation to get a value from a stream +template ::value, detail::enabler> = detail::dummy> +bool from_stream(const std::string &istring, T &obj) { + std::istringstream is; + is.str(istring); + is >> obj; + return !is.fail() && !is.rdbuf()->in_avail(); +} + +template ::value, detail::enabler> = detail::dummy> +bool from_stream(const std::string & /*istring*/, T & /*obj*/) { + return false; +} + +// check to see if an object is a mutable container (fail by default) +template struct is_mutable_container : std::false_type {}; + +/// type trait to test if a type is a mutable container meaning it has a value_type, it has an iterator, a clear, and +/// end methods and an insert function. And for our purposes we exclude std::string and types that can be constructed +/// from a std::string +template +struct is_mutable_container< + T, + conditional_t().end()), + decltype(std::declval().clear()), + decltype(std::declval().insert(std::declval().end())>(), + std::declval()))>, + void>> + : public conditional_t::value, std::false_type, std::true_type> {}; + +// check to see if an object is a mutable container (fail by default) +template struct is_readable_container : std::false_type {}; + +/// type trait to test if a type is a container meaning it has a value_type, it has an iterator, a clear, and an end +/// methods and an insert function. And for our purposes we exclude std::string and types that can be constructed from +/// a std::string +template +struct is_readable_container< + T, + conditional_t().end()), decltype(std::declval().begin())>, void>> + : public std::true_type {}; + +// check to see if an object is a wrapper (fail by default) +template struct is_wrapper : std::false_type {}; + +// check if an object is a wrapper (it has a value_type defined) +template +struct is_wrapper, void>> : public std::true_type {}; + +// Check for tuple like types, as in classes with a tuple_size type trait +template class is_tuple_like { + template + // static auto test(int) + // -> decltype(std::conditional<(std::tuple_size::value > 0), std::true_type, std::false_type>::type()); + static auto test(int) -> decltype(std::tuple_size::type>::value, std::true_type{}); + template static auto test(...) -> std::false_type; + + public: + static constexpr bool value = decltype(test(0))::value; +}; + +/// Convert an object to a string (directly forward if this can become a string) +template ::value, detail::enabler> = detail::dummy> +auto to_string(T &&value) -> decltype(std::forward(value)) { + return std::forward(value); +} + +/// Construct a string from the object +template ::value && !std::is_convertible::value, + detail::enabler> = detail::dummy> +std::string to_string(const T &value) { + return std::string(value); +} + +/// Convert an object to a string (streaming must be supported for that type) +template ::value && !std::is_constructible::value && + is_ostreamable::value, + detail::enabler> = detail::dummy> +std::string to_string(T &&value) { + std::stringstream stream; + stream << value; + return stream.str(); +} + +/// If conversion is not supported, return an empty string (streaming is not supported for that type) +template ::value && !is_ostreamable::value && + !is_readable_container::type>::value, + detail::enabler> = detail::dummy> +std::string to_string(T &&) { + return std::string{}; +} + +/// convert a readable container to a string +template ::value && !is_ostreamable::value && + is_readable_container::value, + detail::enabler> = detail::dummy> +std::string to_string(T &&variable) { + auto cval = variable.begin(); + auto end = variable.end(); + if(cval == end) { + return std::string("{}"); + } + std::vector defaults; + while(cval != end) { + defaults.emplace_back(CLI::detail::to_string(*cval)); + ++cval; + } + return std::string("[" + detail::join(defaults) + "]"); +} + +/// special template overload +template ::value, detail::enabler> = detail::dummy> +auto checked_to_string(T &&value) -> decltype(to_string(std::forward(value))) { + return to_string(std::forward(value)); +} + +/// special template overload +template ::value, detail::enabler> = detail::dummy> +std::string checked_to_string(T &&) { + return std::string{}; +} +/// get a string as a convertible value for arithmetic types +template ::value, detail::enabler> = detail::dummy> +std::string value_string(const T &value) { + return std::to_string(value); +} +/// get a string as a convertible value for enumerations +template ::value, detail::enabler> = detail::dummy> +std::string value_string(const T &value) { + return std::to_string(static_cast::type>(value)); +} +/// for other types just use the regular to_string function +template ::value && !std::is_arithmetic::value, detail::enabler> = detail::dummy> +auto value_string(const T &value) -> decltype(to_string(value)) { + return to_string(value); +} + +/// template to get the underlying value type if it exists or use a default +template struct wrapped_type { using type = def; }; + +/// Type size for regular object types that do not look like a tuple +template struct wrapped_type::value>::type> { + using type = typename T::value_type; +}; + +/// This will only trigger for actual void type +template struct type_count_base { static const int value{0}; }; + +/// Type size for regular object types that do not look like a tuple +template +struct type_count_base::value && !is_mutable_container::value && + !std::is_void::value>::type> { + static constexpr int value{1}; +}; + +/// the base tuple size +template +struct type_count_base::value && !is_mutable_container::value>::type> { + static constexpr int value{std::tuple_size::value}; +}; + +/// Type count base for containers is the type_count_base of the individual element +template struct type_count_base::value>::type> { + static constexpr int value{type_count_base::value}; +}; + +/// Set of overloads to get the type size of an object + +/// forward declare the subtype_count structure +template struct subtype_count; + +/// forward declare the subtype_count_min structure +template struct subtype_count_min; + +/// This will only trigger for actual void type +template struct type_count { static const int value{0}; }; + +/// Type size for regular object types that do not look like a tuple +template +struct type_count::value && !is_tuple_like::value && !is_complex::value && + !std::is_void::value>::type> { + static constexpr int value{1}; +}; + +/// Type size for complex since it sometimes looks like a wrapper +template struct type_count::value>::type> { + static constexpr int value{2}; +}; + +/// Type size of types that are wrappers,except complex and tuples(which can also be wrappers sometimes) +template struct type_count::value>::type> { + static constexpr int value{subtype_count::value}; +}; + +/// Type size of types that are wrappers,except containers complex and tuples(which can also be wrappers sometimes) +template +struct type_count::value && !is_complex::value && !is_tuple_like::value && + !is_mutable_container::value>::type> { + static constexpr int value{type_count::value}; +}; + +/// 0 if the index > tuple size +template +constexpr typename std::enable_if::value, int>::type tuple_type_size() { + return 0; +} + +/// Recursively generate the tuple type name +template + constexpr typename std::enable_if < I::value, int>::type tuple_type_size() { + return subtype_count::type>::value + tuple_type_size(); +} + +/// Get the type size of the sum of type sizes for all the individual tuple types +template struct type_count::value>::type> { + static constexpr int value{tuple_type_size()}; +}; + +/// definition of subtype count +template struct subtype_count { + static constexpr int value{is_mutable_container::value ? expected_max_vector_size : type_count::value}; +}; + +/// This will only trigger for actual void type +template struct type_count_min { static const int value{0}; }; + +/// Type size for regular object types that do not look like a tuple +template +struct type_count_min< + T, + typename std::enable_if::value && !is_tuple_like::value && !is_wrapper::value && + !is_complex::value && !std::is_void::value>::type> { + static constexpr int value{type_count::value}; +}; + +/// Type size for complex since it sometimes looks like a wrapper +template struct type_count_min::value>::type> { + static constexpr int value{1}; +}; + +/// Type size min of types that are wrappers,except complex and tuples(which can also be wrappers sometimes) +template +struct type_count_min< + T, + typename std::enable_if::value && !is_complex::value && !is_tuple_like::value>::type> { + static constexpr int value{subtype_count_min::value}; +}; + +/// 0 if the index > tuple size +template +constexpr typename std::enable_if::value, int>::type tuple_type_size_min() { + return 0; +} + +/// Recursively generate the tuple type name +template + constexpr typename std::enable_if < I::value, int>::type tuple_type_size_min() { + return subtype_count_min::type>::value + tuple_type_size_min(); +} + +/// Get the type size of the sum of type sizes for all the individual tuple types +template struct type_count_min::value>::type> { + static constexpr int value{tuple_type_size_min()}; +}; + +/// definition of subtype count +template struct subtype_count_min { + static constexpr int value{is_mutable_container::value + ? ((type_count::value < expected_max_vector_size) ? type_count::value : 0) + : type_count_min::value}; +}; + +/// This will only trigger for actual void type +template struct expected_count { static const int value{0}; }; + +/// For most types the number of expected items is 1 +template +struct expected_count::value && !is_wrapper::value && + !std::is_void::value>::type> { + static constexpr int value{1}; +}; +/// number of expected items in a vector +template struct expected_count::value>::type> { + static constexpr int value{expected_max_vector_size}; +}; + +/// number of expected items in a vector +template +struct expected_count::value && is_wrapper::value>::type> { + static constexpr int value{expected_count::value}; +}; + +// Enumeration of the different supported categorizations of objects +enum class object_category : int { + char_value = 1, + integral_value = 2, + unsigned_integral = 4, + enumeration = 6, + boolean_value = 8, + floating_point = 10, + number_constructible = 12, + double_constructible = 14, + integer_constructible = 16, + // string like types + string_assignable = 23, + string_constructible = 24, + other = 45, + // special wrapper or container types + wrapper_value = 50, + complex_number = 60, + tuple_value = 70, + container_value = 80, + +}; + +/// Set of overloads to classify an object according to type + +/// some type that is not otherwise recognized +template struct classify_object { + static constexpr object_category value{object_category::other}; +}; + +/// Signed integers +template +struct classify_object< + T, + typename std::enable_if::value && !std::is_same::value && std::is_signed::value && + !is_bool::value && !std::is_enum::value>::type> { + static constexpr object_category value{object_category::integral_value}; +}; + +/// Unsigned integers +template +struct classify_object::value && std::is_unsigned::value && + !std::is_same::value && !is_bool::value>::type> { + static constexpr object_category value{object_category::unsigned_integral}; +}; + +/// single character values +template +struct classify_object::value && !std::is_enum::value>::type> { + static constexpr object_category value{object_category::char_value}; +}; + +/// Boolean values +template struct classify_object::value>::type> { + static constexpr object_category value{object_category::boolean_value}; +}; + +/// Floats +template struct classify_object::value>::type> { + static constexpr object_category value{object_category::floating_point}; +}; + +/// String and similar direct assignment +template +struct classify_object::value && !std::is_integral::value && + std::is_assignable::value>::type> { + static constexpr object_category value{object_category::string_assignable}; +}; + +/// String and similar constructible and copy assignment +template +struct classify_object< + T, + typename std::enable_if::value && !std::is_integral::value && + !std::is_assignable::value && (type_count::value == 1) && + std::is_constructible::value>::type> { + static constexpr object_category value{object_category::string_constructible}; +}; + +/// Enumerations +template struct classify_object::value>::type> { + static constexpr object_category value{object_category::enumeration}; +}; + +template struct classify_object::value>::type> { + static constexpr object_category value{object_category::complex_number}; +}; + +/// Handy helper to contain a bunch of checks that rule out many common types (integers, string like, floating point, +/// vectors, and enumerations +template struct uncommon_type { + using type = typename std::conditional::value && !std::is_integral::value && + !std::is_assignable::value && + !std::is_constructible::value && !is_complex::value && + !is_mutable_container::value && !std::is_enum::value, + std::true_type, + std::false_type>::type; + static constexpr bool value = type::value; +}; + +/// wrapper type +template +struct classify_object::value && is_wrapper::value && + !is_tuple_like::value && uncommon_type::value)>::type> { + static constexpr object_category value{object_category::wrapper_value}; +}; + +/// Assignable from double or int +template +struct classify_object::value && type_count::value == 1 && + !is_wrapper::value && is_direct_constructible::value && + is_direct_constructible::value>::type> { + static constexpr object_category value{object_category::number_constructible}; +}; + +/// Assignable from int +template +struct classify_object::value && type_count::value == 1 && + !is_wrapper::value && !is_direct_constructible::value && + is_direct_constructible::value>::type> { + static constexpr object_category value{object_category::integer_constructible}; +}; + +/// Assignable from double +template +struct classify_object::value && type_count::value == 1 && + !is_wrapper::value && is_direct_constructible::value && + !is_direct_constructible::value>::type> { + static constexpr object_category value{object_category::double_constructible}; +}; + +/// Tuple type +template +struct classify_object< + T, + typename std::enable_if::value && + ((type_count::value >= 2 && !is_wrapper::value) || + (uncommon_type::value && !is_direct_constructible::value && + !is_direct_constructible::value))>::type> { + static constexpr object_category value{object_category::tuple_value}; + // the condition on this class requires it be like a tuple, but on some compilers (like Xcode) tuples can be + // constructed from just the first element so tuples of can be constructed from a string, which + // could lead to issues so there are two variants of the condition, the first isolates things with a type size >=2 + // mainly to get tuples on Xcode with the exception of wrappers, the second is the main one and just separating out + // those cases that are caught by other object classifications +}; + +/// container type +template struct classify_object::value>::type> { + static constexpr object_category value{object_category::container_value}; +}; + +// Type name print + +/// Was going to be based on +/// http://stackoverflow.com/questions/1055452/c-get-name-of-type-in-template +/// But this is cleaner and works better in this case + +template ::value == object_category::char_value, detail::enabler> = detail::dummy> +constexpr const char *type_name() { + return "CHAR"; +} + +template ::value == object_category::integral_value || + classify_object::value == object_category::integer_constructible, + detail::enabler> = detail::dummy> +constexpr const char *type_name() { + return "INT"; +} + +template ::value == object_category::unsigned_integral, detail::enabler> = detail::dummy> +constexpr const char *type_name() { + return "UINT"; +} + +template ::value == object_category::floating_point || + classify_object::value == object_category::number_constructible || + classify_object::value == object_category::double_constructible, + detail::enabler> = detail::dummy> +constexpr const char *type_name() { + return "FLOAT"; +} + +/// Print name for enumeration types +template ::value == object_category::enumeration, detail::enabler> = detail::dummy> +constexpr const char *type_name() { + return "ENUM"; +} + +/// Print name for enumeration types +template ::value == object_category::boolean_value, detail::enabler> = detail::dummy> +constexpr const char *type_name() { + return "BOOLEAN"; +} + +/// Print name for enumeration types +template ::value == object_category::complex_number, detail::enabler> = detail::dummy> +constexpr const char *type_name() { + return "COMPLEX"; +} + +/// Print for all other types +template ::value >= object_category::string_assignable && + classify_object::value <= object_category::other, + detail::enabler> = detail::dummy> +constexpr const char *type_name() { + return "TEXT"; +} +/// typename for tuple value +template ::value == object_category::tuple_value && type_count_base::value >= 2, + detail::enabler> = detail::dummy> +std::string type_name(); // forward declaration + +/// Generate type name for a wrapper or container value +template ::value == object_category::container_value || + classify_object::value == object_category::wrapper_value, + detail::enabler> = detail::dummy> +std::string type_name(); // forward declaration + +/// Print name for single element tuple types +template ::value == object_category::tuple_value && type_count_base::value == 1, + detail::enabler> = detail::dummy> +inline std::string type_name() { + return type_name::type>::type>(); +} + +/// Empty string if the index > tuple size +template +inline typename std::enable_if::value, std::string>::type tuple_name() { + return std::string{}; +} + +/// Recursively generate the tuple type name +template +inline typename std::enable_if<(I < type_count_base::value), std::string>::type tuple_name() { + std::string str = std::string(type_name::type>::type>()) + + ',' + tuple_name(); + if(str.back() == ',') + str.pop_back(); + return str; +} + +/// Print type name for tuples with 2 or more elements +template ::value == object_category::tuple_value && type_count_base::value >= 2, + detail::enabler>> +inline std::string type_name() { + auto tname = std::string(1, '[') + tuple_name(); + tname.push_back(']'); + return tname; +} + +/// get the type name for a type that has a value_type member +template ::value == object_category::container_value || + classify_object::value == object_category::wrapper_value, + detail::enabler>> +inline std::string type_name() { + return type_name(); +} + +// Lexical cast + +/// Convert to an unsigned integral +template ::value, detail::enabler> = detail::dummy> +bool integral_conversion(const std::string &input, T &output) noexcept { + if(input.empty()) { + return false; + } + char *val = nullptr; + std::uint64_t output_ll = std::strtoull(input.c_str(), &val, 0); + output = static_cast(output_ll); + if(val == (input.c_str() + input.size()) && static_cast(output) == output_ll) { + return true; + } + val = nullptr; + std::int64_t output_sll = std::strtoll(input.c_str(), &val, 0); + if(val == (input.c_str() + input.size())) { + output = (output_sll < 0) ? static_cast(0) : static_cast(output_sll); + return (static_cast(output) == output_sll); + } + return false; +} + +/// Convert to a signed integral +template ::value, detail::enabler> = detail::dummy> +bool integral_conversion(const std::string &input, T &output) noexcept { + if(input.empty()) { + return false; + } + char *val = nullptr; + std::int64_t output_ll = std::strtoll(input.c_str(), &val, 0); + output = static_cast(output_ll); + if(val == (input.c_str() + input.size()) && static_cast(output) == output_ll) { + return true; + } + if(input == "true") { + // this is to deal with a few oddities with flags and wrapper int types + output = static_cast(1); + return true; + } + return false; +} + +/// Convert a flag into an integer value typically binary flags +inline std::int64_t to_flag_value(std::string val) { + static const std::string trueString("true"); + static const std::string falseString("false"); + if(val == trueString) { + return 1; + } + if(val == falseString) { + return -1; + } + val = detail::to_lower(val); + std::int64_t ret; + if(val.size() == 1) { + if(val[0] >= '1' && val[0] <= '9') { + return (static_cast(val[0]) - '0'); + } + switch(val[0]) { + case '0': + case 'f': + case 'n': + case '-': + ret = -1; + break; + case 't': + case 'y': + case '+': + ret = 1; + break; + default: + throw std::invalid_argument("unrecognized character"); + } + return ret; + } + if(val == trueString || val == "on" || val == "yes" || val == "enable") { + ret = 1; + } else if(val == falseString || val == "off" || val == "no" || val == "disable") { + ret = -1; + } else { + ret = std::stoll(val); + } + return ret; +} + +/// Integer conversion +template ::value == object_category::integral_value || + classify_object::value == object_category::unsigned_integral, + detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + return integral_conversion(input, output); +} + +/// char values +template ::value == object_category::char_value, detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + if(input.size() == 1) { + output = static_cast(input[0]); + return true; + } + return integral_conversion(input, output); +} + +/// Boolean values +template ::value == object_category::boolean_value, detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + try { + auto out = to_flag_value(input); + output = (out > 0); + return true; + } catch(const std::invalid_argument &) { + return false; + } catch(const std::out_of_range &) { + // if the number is out of the range of a 64 bit value then it is still a number and for this purpose is still + // valid all we care about the sign + output = (input[0] != '-'); + return true; + } +} + +/// Floats +template ::value == object_category::floating_point, detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + if(input.empty()) { + return false; + } + char *val = nullptr; + auto output_ld = std::strtold(input.c_str(), &val); + output = static_cast(output_ld); + return val == (input.c_str() + input.size()); +} + +/// complex +template ::value == object_category::complex_number, detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + using XC = typename wrapped_type::type; + XC x{0.0}, y{0.0}; + auto str1 = input; + bool worked = false; + auto nloc = str1.find_last_of("+-"); + if(nloc != std::string::npos && nloc > 0) { + worked = detail::lexical_cast(str1.substr(0, nloc), x); + str1 = str1.substr(nloc); + if(str1.back() == 'i' || str1.back() == 'j') + str1.pop_back(); + worked = worked && detail::lexical_cast(str1, y); + } else { + if(str1.back() == 'i' || str1.back() == 'j') { + str1.pop_back(); + worked = detail::lexical_cast(str1, y); + x = XC{0}; + } else { + worked = detail::lexical_cast(str1, x); + y = XC{0}; + } + } + if(worked) { + output = T{x, y}; + return worked; + } + return from_stream(input, output); +} + +/// String and similar direct assignment +template ::value == object_category::string_assignable, detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + output = input; + return true; +} + +/// String and similar constructible and copy assignment +template < + typename T, + enable_if_t::value == object_category::string_constructible, detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + output = T(input); + return true; +} + +/// Enumerations +template ::value == object_category::enumeration, detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + typename std::underlying_type::type val; + if(!integral_conversion(input, val)) { + return false; + } + output = static_cast(val); + return true; +} + +/// wrapper types +template ::value == object_category::wrapper_value && + std::is_assignable::value, + detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + typename T::value_type val; + if(lexical_cast(input, val)) { + output = val; + return true; + } + return from_stream(input, output); +} + +template ::value == object_category::wrapper_value && + !std::is_assignable::value && std::is_assignable::value, + detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + typename T::value_type val; + if(lexical_cast(input, val)) { + output = T{val}; + return true; + } + return from_stream(input, output); +} + +/// Assignable from double or int +template < + typename T, + enable_if_t::value == object_category::number_constructible, detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + int val; + if(integral_conversion(input, val)) { + output = T(val); + return true; + } else { + double dval; + if(lexical_cast(input, dval)) { + output = T{dval}; + return true; + } + } + return from_stream(input, output); +} + +/// Assignable from int +template < + typename T, + enable_if_t::value == object_category::integer_constructible, detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + int val; + if(integral_conversion(input, val)) { + output = T(val); + return true; + } + return from_stream(input, output); +} + +/// Assignable from double +template < + typename T, + enable_if_t::value == object_category::double_constructible, detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + double val; + if(lexical_cast(input, val)) { + output = T{val}; + return true; + } + return from_stream(input, output); +} + +/// Non-string convertible from an int +template ::value == object_category::other && std::is_assignable::value, + detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + int val; + if(integral_conversion(input, val)) { +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4800) +#endif + // with Atomic this could produce a warning due to the conversion but if atomic gets here it is an old style + // so will most likely still work + output = val; +#ifdef _MSC_VER +#pragma warning(pop) +#endif + return true; + } + // LCOV_EXCL_START + // This version of cast is only used for odd cases in an older compilers the fail over + // from_stream is tested elsewhere an not relevant for coverage here + return from_stream(input, output); + // LCOV_EXCL_STOP +} + +/// Non-string parsable by a stream +template ::value == object_category::other && !std::is_assignable::value, + detail::enabler> = detail::dummy> +bool lexical_cast(const std::string &input, T &output) { + static_assert(is_istreamable::value, + "option object type must have a lexical cast overload or streaming input operator(>>) defined, if it " + "is convertible from another type use the add_option(...) with XC being the known type"); + return from_stream(input, output); +} + +/// Assign a value through lexical cast operations +/// Strings can be empty so we need to do a little different +template ::value && + (classify_object::value == object_category::string_assignable || + classify_object::value == object_category::string_constructible), + detail::enabler> = detail::dummy> +bool lexical_assign(const std::string &input, AssignTo &output) { + return lexical_cast(input, output); +} + +/// Assign a value through lexical cast operations +template ::value && std::is_assignable::value && + classify_object::value != object_category::string_assignable && + classify_object::value != object_category::string_constructible, + detail::enabler> = detail::dummy> +bool lexical_assign(const std::string &input, AssignTo &output) { + if(input.empty()) { + output = AssignTo{}; + return true; + } + + return lexical_cast(input, output); +} + +/// Assign a value through lexical cast operations +template ::value && !std::is_assignable::value && + classify_object::value == object_category::wrapper_value, + detail::enabler> = detail::dummy> +bool lexical_assign(const std::string &input, AssignTo &output) { + if(input.empty()) { + typename AssignTo::value_type emptyVal{}; + output = emptyVal; + return true; + } + return lexical_cast(input, output); +} + +/// Assign a value through lexical cast operations for int compatible values +/// mainly for atomic operations on some compilers +template ::value && !std::is_assignable::value && + classify_object::value != object_category::wrapper_value && + std::is_assignable::value, + detail::enabler> = detail::dummy> +bool lexical_assign(const std::string &input, AssignTo &output) { + if(input.empty()) { + output = 0; + return true; + } + int val; + if(lexical_cast(input, val)) { + output = val; + return true; + } + return false; +} + +/// Assign a value converted from a string in lexical cast to the output value directly +template ::value && std::is_assignable::value, + detail::enabler> = detail::dummy> +bool lexical_assign(const std::string &input, AssignTo &output) { + ConvertTo val{}; + bool parse_result = (!input.empty()) ? lexical_cast(input, val) : true; + if(parse_result) { + output = val; + } + return parse_result; +} + +/// Assign a value from a lexical cast through constructing a value and move assigning it +template < + typename AssignTo, + typename ConvertTo, + enable_if_t::value && !std::is_assignable::value && + std::is_move_assignable::value, + detail::enabler> = detail::dummy> +bool lexical_assign(const std::string &input, AssignTo &output) { + ConvertTo val{}; + bool parse_result = input.empty() ? true : lexical_cast(input, val); + if(parse_result) { + output = AssignTo(val); // use () form of constructor to allow some implicit conversions + } + return parse_result; +} + +/// primary lexical conversion operation, 1 string to 1 type of some kind +template ::value <= object_category::other && + classify_object::value <= object_category::wrapper_value, + detail::enabler> = detail::dummy> +bool lexical_conversion(const std::vector &strings, AssignTo &output) { + return lexical_assign(strings[0], output); +} + +/// Lexical conversion if there is only one element but the conversion type is for two, then call a two element +/// constructor +template ::value <= 2) && expected_count::value == 1 && + is_tuple_like::value && type_count_base::value == 2, + detail::enabler> = detail::dummy> +bool lexical_conversion(const std::vector &strings, AssignTo &output) { + // the remove const is to handle pair types coming from a container + typename std::remove_const::type>::type v1; + typename std::tuple_element<1, ConvertTo>::type v2; + bool retval = lexical_assign(strings[0], v1); + if(strings.size() > 1) { + retval = retval && lexical_assign(strings[1], v2); + } + if(retval) { + output = AssignTo{v1, v2}; + } + return retval; +} + +/// Lexical conversion of a container types of single elements +template ::value && is_mutable_container::value && + type_count::value == 1, + detail::enabler> = detail::dummy> +bool lexical_conversion(const std::vector &strings, AssignTo &output) { + output.erase(output.begin(), output.end()); + if(strings.size() == 1 && strings[0] == "{}") { + return true; + } + bool skip_remaining = false; + if(strings.size() == 2 && strings[0] == "{}" && is_separator(strings[1])) { + skip_remaining = true; + } + for(const auto &elem : strings) { + typename AssignTo::value_type out; + bool retval = lexical_assign(elem, out); + if(!retval) { + return false; + } + output.insert(output.end(), std::move(out)); + if(skip_remaining) { + break; + } + } + return (!output.empty()); +} + +/// Lexical conversion for complex types +template ::value, detail::enabler> = detail::dummy> +bool lexical_conversion(const std::vector &strings, AssignTo &output) { + + if(strings.size() >= 2 && !strings[1].empty()) { + using XC2 = typename wrapped_type::type; + XC2 x{0.0}, y{0.0}; + auto str1 = strings[1]; + if(str1.back() == 'i' || str1.back() == 'j') { + str1.pop_back(); + } + auto worked = detail::lexical_cast(strings[0], x) && detail::lexical_cast(str1, y); + if(worked) { + output = ConvertTo{x, y}; + } + return worked; + } else { + return lexical_assign(strings[0], output); + } +} + +/// Conversion to a vector type using a particular single type as the conversion type +template ::value && (expected_count::value == 1) && + (type_count::value == 1), + detail::enabler> = detail::dummy> +bool lexical_conversion(const std::vector &strings, AssignTo &output) { + bool retval = true; + output.clear(); + output.reserve(strings.size()); + for(const auto &elem : strings) { + + output.emplace_back(); + retval = retval && lexical_assign(elem, output.back()); + } + return (!output.empty()) && retval; +} + +// forward declaration + +/// Lexical conversion of a container types with conversion type of two elements +template ::value && is_mutable_container::value && + type_count_base::value == 2, + detail::enabler> = detail::dummy> +bool lexical_conversion(std::vector strings, AssignTo &output); + +/// Lexical conversion of a vector types with type_size >2 forward declaration +template ::value && is_mutable_container::value && + type_count_base::value != 2 && + ((type_count::value > 2) || + (type_count::value > type_count_base::value)), + detail::enabler> = detail::dummy> +bool lexical_conversion(const std::vector &strings, AssignTo &output); + +/// Conversion for tuples +template ::value && is_tuple_like::value && + (type_count_base::value != type_count::value || + type_count::value > 2), + detail::enabler> = detail::dummy> +bool lexical_conversion(const std::vector &strings, AssignTo &output); // forward declaration + +/// Conversion for operations where the assigned type is some class but the conversion is a mutable container or large +/// tuple +template ::value && !is_mutable_container::value && + classify_object::value != object_category::wrapper_value && + (is_mutable_container::value || type_count::value > 2), + detail::enabler> = detail::dummy> +bool lexical_conversion(const std::vector &strings, AssignTo &output) { + + if(strings.size() > 1 || (!strings.empty() && !(strings.front().empty()))) { + ConvertTo val; + auto retval = lexical_conversion(strings, val); + output = AssignTo{val}; + return retval; + } + output = AssignTo{}; + return true; +} + +/// function template for converting tuples if the static Index is greater than the tuple size +template +inline typename std::enable_if<(I >= type_count_base::value), bool>::type +tuple_conversion(const std::vector &, AssignTo &) { + return true; +} + +/// Conversion of a tuple element where the type size ==1 and not a mutable container +template +inline typename std::enable_if::value && type_count::value == 1, bool>::type +tuple_type_conversion(std::vector &strings, AssignTo &output) { + auto retval = lexical_assign(strings[0], output); + strings.erase(strings.begin()); + return retval; +} + +/// Conversion of a tuple element where the type size !=1 but the size is fixed and not a mutable container +template +inline typename std::enable_if::value && (type_count::value > 1) && + type_count::value == type_count_min::value, + bool>::type +tuple_type_conversion(std::vector &strings, AssignTo &output) { + auto retval = lexical_conversion(strings, output); + strings.erase(strings.begin(), strings.begin() + type_count::value); + return retval; +} + +/// Conversion of a tuple element where the type is a mutable container or a type with different min and max type sizes +template +inline typename std::enable_if::value || + type_count::value != type_count_min::value, + bool>::type +tuple_type_conversion(std::vector &strings, AssignTo &output) { + + std::size_t index{subtype_count_min::value}; + const std::size_t mx_count{subtype_count::value}; + const std::size_t mx{(std::max)(mx_count, strings.size())}; + + while(index < mx) { + if(is_separator(strings[index])) { + break; + } + ++index; + } + bool retval = lexical_conversion( + std::vector(strings.begin(), strings.begin() + static_cast(index)), output); + strings.erase(strings.begin(), strings.begin() + static_cast(index) + 1); + return retval; +} + +/// Tuple conversion operation +template +inline typename std::enable_if<(I < type_count_base::value), bool>::type +tuple_conversion(std::vector strings, AssignTo &output) { + bool retval = true; + using ConvertToElement = typename std:: + conditional::value, typename std::tuple_element::type, ConvertTo>::type; + if(!strings.empty()) { + retval = retval && tuple_type_conversion::type, ConvertToElement>( + strings, std::get(output)); + } + retval = retval && tuple_conversion(std::move(strings), output); + return retval; +} + +/// Lexical conversion of a container types with tuple elements of size 2 +template ::value && is_mutable_container::value && + type_count_base::value == 2, + detail::enabler>> +bool lexical_conversion(std::vector strings, AssignTo &output) { + output.clear(); + while(!strings.empty()) { + + typename std::remove_const::type>::type v1; + typename std::tuple_element<1, typename ConvertTo::value_type>::type v2; + bool retval = tuple_type_conversion(strings, v1); + if(!strings.empty()) { + retval = retval && tuple_type_conversion(strings, v2); + } + if(retval) { + output.insert(output.end(), typename AssignTo::value_type{v1, v2}); + } else { + return false; + } + } + return (!output.empty()); +} + +/// lexical conversion of tuples with type count>2 or tuples of types of some element with a type size>=2 +template ::value && is_tuple_like::value && + (type_count_base::value != type_count::value || + type_count::value > 2), + detail::enabler>> +bool lexical_conversion(const std::vector &strings, AssignTo &output) { + static_assert( + !is_tuple_like::value || type_count_base::value == type_count_base::value, + "if the conversion type is defined as a tuple it must be the same size as the type you are converting to"); + return tuple_conversion(strings, output); +} + +/// Lexical conversion of a vector types for everything but tuples of two elements and types of size 1 +template ::value && is_mutable_container::value && + type_count_base::value != 2 && + ((type_count::value > 2) || + (type_count::value > type_count_base::value)), + detail::enabler>> +bool lexical_conversion(const std::vector &strings, AssignTo &output) { + bool retval = true; + output.clear(); + std::vector temp; + std::size_t ii{0}; + std::size_t icount{0}; + std::size_t xcm{type_count::value}; + auto ii_max = strings.size(); + while(ii < ii_max) { + temp.push_back(strings[ii]); + ++ii; + ++icount; + if(icount == xcm || is_separator(temp.back()) || ii == ii_max) { + if(static_cast(xcm) > type_count_min::value && is_separator(temp.back())) { + temp.pop_back(); + } + typename AssignTo::value_type temp_out; + retval = retval && + lexical_conversion(temp, temp_out); + temp.clear(); + if(!retval) { + return false; + } + output.insert(output.end(), std::move(temp_out)); + icount = 0; + } + } + return retval; +} + +/// conversion for wrapper types +template ::value == object_category::wrapper_value && + std::is_assignable::value, + detail::enabler> = detail::dummy> +bool lexical_conversion(const std::vector &strings, AssignTo &output) { + if(strings.empty() || strings.front().empty()) { + output = ConvertTo{}; + return true; + } + typename ConvertTo::value_type val; + if(lexical_conversion(strings, val)) { + output = ConvertTo{val}; + return true; + } + return false; +} + +/// conversion for wrapper types +template ::value == object_category::wrapper_value && + !std::is_assignable::value, + detail::enabler> = detail::dummy> +bool lexical_conversion(const std::vector &strings, AssignTo &output) { + using ConvertType = typename ConvertTo::value_type; + if(strings.empty() || strings.front().empty()) { + output = ConvertType{}; + return true; + } + ConvertType val; + if(lexical_conversion(strings, val)) { + output = val; + return true; + } + return false; +} + +/// Sum a vector of strings +inline std::string sum_string_vector(const std::vector &values) { + double val{0.0}; + bool fail{false}; + std::string output; + for(const auto &arg : values) { + double tv{0.0}; + auto comp = detail::lexical_cast(arg, tv); + if(!comp) { + try { + tv = static_cast(detail::to_flag_value(arg)); + } catch(const std::exception &) { + fail = true; + break; + } + } + val += tv; + } + if(fail) { + for(const auto &arg : values) { + output.append(arg); + } + } else { + if(val <= static_cast(std::numeric_limits::min()) || + val >= static_cast(std::numeric_limits::max()) || + val == static_cast(val)) { + output = detail::value_string(static_cast(val)); + } else { + output = detail::value_string(val); + } + } + return output; +} + +} // namespace detail + + + +namespace detail { + +// Returns false if not a short option. Otherwise, sets opt name and rest and returns true +inline bool split_short(const std::string ¤t, std::string &name, std::string &rest) { + if(current.size() > 1 && current[0] == '-' && valid_first_char(current[1])) { + name = current.substr(1, 1); + rest = current.substr(2); + return true; + } + return false; +} + +// Returns false if not a long option. Otherwise, sets opt name and other side of = and returns true +inline bool split_long(const std::string ¤t, std::string &name, std::string &value) { + if(current.size() > 2 && current.substr(0, 2) == "--" && valid_first_char(current[2])) { + auto loc = current.find_first_of('='); + if(loc != std::string::npos) { + name = current.substr(2, loc - 2); + value = current.substr(loc + 1); + } else { + name = current.substr(2); + value = ""; + } + return true; + } + return false; +} + +// Returns false if not a windows style option. Otherwise, sets opt name and value and returns true +inline bool split_windows_style(const std::string ¤t, std::string &name, std::string &value) { + if(current.size() > 1 && current[0] == '/' && valid_first_char(current[1])) { + auto loc = current.find_first_of(':'); + if(loc != std::string::npos) { + name = current.substr(1, loc - 1); + value = current.substr(loc + 1); + } else { + name = current.substr(1); + value = ""; + } + return true; + } + return false; +} + +// Splits a string into multiple long and short names +inline std::vector split_names(std::string current) { + std::vector output; + std::size_t val; + while((val = current.find(",")) != std::string::npos) { + output.push_back(trim_copy(current.substr(0, val))); + current = current.substr(val + 1); + } + output.push_back(trim_copy(current)); + return output; +} + +/// extract default flag values either {def} or starting with a ! +inline std::vector> get_default_flag_values(const std::string &str) { + std::vector flags = split_names(str); + flags.erase(std::remove_if(flags.begin(), + flags.end(), + [](const std::string &name) { + return ((name.empty()) || (!(((name.find_first_of('{') != std::string::npos) && + (name.back() == '}')) || + (name[0] == '!')))); + }), + flags.end()); + std::vector> output; + output.reserve(flags.size()); + for(auto &flag : flags) { + auto def_start = flag.find_first_of('{'); + std::string defval = "false"; + if((def_start != std::string::npos) && (flag.back() == '}')) { + defval = flag.substr(def_start + 1); + defval.pop_back(); + flag.erase(def_start, std::string::npos); + } + flag.erase(0, flag.find_first_not_of("-!")); + output.emplace_back(flag, defval); + } + return output; +} + +/// Get a vector of short names, one of long names, and a single name +inline std::tuple, std::vector, std::string> +get_names(const std::vector &input) { + + std::vector short_names; + std::vector long_names; + std::string pos_name; + + for(std::string name : input) { + if(name.length() == 0) { + continue; + } + if(name.length() > 1 && name[0] == '-' && name[1] != '-') { + if(name.length() == 2 && valid_first_char(name[1])) + short_names.emplace_back(1, name[1]); + else + throw BadNameString::OneCharName(name); + } else if(name.length() > 2 && name.substr(0, 2) == "--") { + name = name.substr(2); + if(valid_name_string(name)) + long_names.push_back(name); + else + throw BadNameString::BadLongName(name); + } else if(name == "-" || name == "--") { + throw BadNameString::DashesOnly(name); + } else { + if(pos_name.length() > 0) + throw BadNameString::MultiPositionalNames(name); + pos_name = name; + } + } + + return std::tuple, std::vector, std::string>( + short_names, long_names, pos_name); +} + +} // namespace detail + + + +class App; + +/// Holds values to load into Options +struct ConfigItem { + /// This is the list of parents + std::vector parents{}; + + /// This is the name + std::string name{}; + + /// Listing of inputs + std::vector inputs{}; + + /// The list of parents and name joined by "." + std::string fullname() const { + std::vector tmp = parents; + tmp.emplace_back(name); + return detail::join(tmp, "."); + } +}; + +/// This class provides a converter for configuration files. +class Config { + protected: + std::vector items{}; + + public: + /// Convert an app into a configuration + virtual std::string to_config(const App *, bool, bool, std::string) const = 0; + + /// Convert a configuration into an app + virtual std::vector from_config(std::istream &) const = 0; + + /// Get a flag value + virtual std::string to_flag(const ConfigItem &item) const { + if(item.inputs.size() == 1) { + return item.inputs.at(0); + } + if(item.inputs.empty()) { + return "{}"; + } + throw ConversionError::TooManyInputsFlag(item.fullname()); + } + + /// Parse a config file, throw an error (ParseError:ConfigParseError or FileError) on failure + std::vector from_file(const std::string &name) { + std::ifstream input{name}; + if(!input.good()) + throw FileError::Missing(name); + + return from_config(input); + } + + /// Virtual destructor + virtual ~Config() = default; +}; + +/// This converter works with INI/TOML files; to write INI files use ConfigINI +class ConfigBase : public Config { + protected: + /// the character used for comments + char commentChar = '#'; + /// the character used to start an array '\0' is a default to not use + char arrayStart = '['; + /// the character used to end an array '\0' is a default to not use + char arrayEnd = ']'; + /// the character used to separate elements in an array + char arraySeparator = ','; + /// the character used separate the name from the value + char valueDelimiter = '='; + /// the character to use around strings + char stringQuote = '"'; + /// the character to use around single characters + char characterQuote = '\''; + /// the maximum number of layers to allow + uint8_t maximumLayers{255}; + /// the separator used to separator parent layers + char parentSeparatorChar{'.'}; + /// Specify the configuration index to use for arrayed sections + int16_t configIndex{-1}; + /// Specify the configuration section that should be used + std::string configSection{}; + + public: + std::string + to_config(const App * /*app*/, bool default_also, bool write_description, std::string prefix) const override; + + std::vector from_config(std::istream &input) const override; + /// Specify the configuration for comment characters + ConfigBase *comment(char cchar) { + commentChar = cchar; + return this; + } + /// Specify the start and end characters for an array + ConfigBase *arrayBounds(char aStart, char aEnd) { + arrayStart = aStart; + arrayEnd = aEnd; + return this; + } + /// Specify the delimiter character for an array + ConfigBase *arrayDelimiter(char aSep) { + arraySeparator = aSep; + return this; + } + /// Specify the delimiter between a name and value + ConfigBase *valueSeparator(char vSep) { + valueDelimiter = vSep; + return this; + } + /// Specify the quote characters used around strings and characters + ConfigBase *quoteCharacter(char qString, char qChar) { + stringQuote = qString; + characterQuote = qChar; + return this; + } + /// Specify the maximum number of parents + ConfigBase *maxLayers(uint8_t layers) { + maximumLayers = layers; + return this; + } + /// Specify the separator to use for parent layers + ConfigBase *parentSeparator(char sep) { + parentSeparatorChar = sep; + return this; + } + /// get a reference to the configuration section + std::string §ionRef() { return configSection; } + /// get the section + const std::string §ion() const { return configSection; } + /// specify a particular section of the configuration file to use + ConfigBase *section(const std::string §ionName) { + configSection = sectionName; + return this; + } + + /// get a reference to the configuration index + int16_t &indexRef() { return configIndex; } + /// get the section index + int16_t index() const { return configIndex; } + /// specify a particular index in the section to use (-1) for all sections to use + ConfigBase *index(int16_t sectionIndex) { + configIndex = sectionIndex; + return this; + } +}; + +/// the default Config is the TOML file format +using ConfigTOML = ConfigBase; + +/// ConfigINI generates a "standard" INI compliant output +class ConfigINI : public ConfigTOML { + + public: + ConfigINI() { + commentChar = ';'; + arrayStart = '\0'; + arrayEnd = '\0'; + arraySeparator = ' '; + valueDelimiter = '='; + } +}; + + + +class Option; + +/// @defgroup validator_group Validators + +/// @brief Some validators that are provided +/// +/// These are simple `std::string(const std::string&)` validators that are useful. They return +/// a string if the validation fails. A custom struct is provided, as well, with the same user +/// semantics, but with the ability to provide a new type name. +/// @{ + +/// +class Validator { + protected: + /// This is the description function, if empty the description_ will be used + std::function desc_function_{[]() { return std::string{}; }}; + + /// This is the base function that is to be called. + /// Returns a string error message if validation fails. + std::function func_{[](std::string &) { return std::string{}; }}; + /// The name for search purposes of the Validator + std::string name_{}; + /// A Validator will only apply to an indexed value (-1 is all elements) + int application_index_ = -1; + /// Enable for Validator to allow it to be disabled if need be + bool active_{true}; + /// specify that a validator should not modify the input + bool non_modifying_{false}; + + public: + Validator() = default; + /// Construct a Validator with just the description string + explicit Validator(std::string validator_desc) : desc_function_([validator_desc]() { return validator_desc; }) {} + /// Construct Validator from basic information + Validator(std::function op, std::string validator_desc, std::string validator_name = "") + : desc_function_([validator_desc]() { return validator_desc; }), func_(std::move(op)), + name_(std::move(validator_name)) {} + /// Set the Validator operation function + Validator &operation(std::function op) { + func_ = std::move(op); + return *this; + } + /// This is the required operator for a Validator - provided to help + /// users (CLI11 uses the member `func` directly) + std::string operator()(std::string &str) const { + std::string retstring; + if(active_) { + if(non_modifying_) { + std::string value = str; + retstring = func_(value); + } else { + retstring = func_(str); + } + } + return retstring; + } + + /// This is the required operator for a Validator - provided to help + /// users (CLI11 uses the member `func` directly) + std::string operator()(const std::string &str) const { + std::string value = str; + return (active_) ? func_(value) : std::string{}; + } + + /// Specify the type string + Validator &description(std::string validator_desc) { + desc_function_ = [validator_desc]() { return validator_desc; }; + return *this; + } + /// Specify the type string + Validator description(std::string validator_desc) const { + Validator newval(*this); + newval.desc_function_ = [validator_desc]() { return validator_desc; }; + return newval; + } + /// Generate type description information for the Validator + std::string get_description() const { + if(active_) { + return desc_function_(); + } + return std::string{}; + } + /// Specify the type string + Validator &name(std::string validator_name) { + name_ = std::move(validator_name); + return *this; + } + /// Specify the type string + Validator name(std::string validator_name) const { + Validator newval(*this); + newval.name_ = std::move(validator_name); + return newval; + } + /// Get the name of the Validator + const std::string &get_name() const { return name_; } + /// Specify whether the Validator is active or not + Validator &active(bool active_val = true) { + active_ = active_val; + return *this; + } + /// Specify whether the Validator is active or not + Validator active(bool active_val = true) const { + Validator newval(*this); + newval.active_ = active_val; + return newval; + } + + /// Specify whether the Validator can be modifying or not + Validator &non_modifying(bool no_modify = true) { + non_modifying_ = no_modify; + return *this; + } + /// Specify the application index of a validator + Validator &application_index(int app_index) { + application_index_ = app_index; + return *this; + } + /// Specify the application index of a validator + Validator application_index(int app_index) const { + Validator newval(*this); + newval.application_index_ = app_index; + return newval; + } + /// Get the current value of the application index + int get_application_index() const { return application_index_; } + /// Get a boolean if the validator is active + bool get_active() const { return active_; } + + /// Get a boolean if the validator is allowed to modify the input returns true if it can modify the input + bool get_modifying() const { return !non_modifying_; } + + /// Combining validators is a new validator. Type comes from left validator if function, otherwise only set if the + /// same. + Validator operator&(const Validator &other) const { + Validator newval; + + newval._merge_description(*this, other, " AND "); + + // Give references (will make a copy in lambda function) + const std::function &f1 = func_; + const std::function &f2 = other.func_; + + newval.func_ = [f1, f2](std::string &input) { + std::string s1 = f1(input); + std::string s2 = f2(input); + if(!s1.empty() && !s2.empty()) + return std::string("(") + s1 + ") AND (" + s2 + ")"; + else + return s1 + s2; + }; + + newval.active_ = (active_ & other.active_); + newval.application_index_ = application_index_; + return newval; + } + + /// Combining validators is a new validator. Type comes from left validator if function, otherwise only set if the + /// same. + Validator operator|(const Validator &other) const { + Validator newval; + + newval._merge_description(*this, other, " OR "); + + // Give references (will make a copy in lambda function) + const std::function &f1 = func_; + const std::function &f2 = other.func_; + + newval.func_ = [f1, f2](std::string &input) { + std::string s1 = f1(input); + std::string s2 = f2(input); + if(s1.empty() || s2.empty()) + return std::string(); + + return std::string("(") + s1 + ") OR (" + s2 + ")"; + }; + newval.active_ = (active_ & other.active_); + newval.application_index_ = application_index_; + return newval; + } + + /// Create a validator that fails when a given validator succeeds + Validator operator!() const { + Validator newval; + const std::function &dfunc1 = desc_function_; + newval.desc_function_ = [dfunc1]() { + auto str = dfunc1(); + return (!str.empty()) ? std::string("NOT ") + str : std::string{}; + }; + // Give references (will make a copy in lambda function) + const std::function &f1 = func_; + + newval.func_ = [f1, dfunc1](std::string &test) -> std::string { + std::string s1 = f1(test); + if(s1.empty()) { + return std::string("check ") + dfunc1() + " succeeded improperly"; + } + return std::string{}; + }; + newval.active_ = active_; + newval.application_index_ = application_index_; + return newval; + } + + private: + void _merge_description(const Validator &val1, const Validator &val2, const std::string &merger) { + + const std::function &dfunc1 = val1.desc_function_; + const std::function &dfunc2 = val2.desc_function_; + + desc_function_ = [=]() { + std::string f1 = dfunc1(); + std::string f2 = dfunc2(); + if((f1.empty()) || (f2.empty())) { + return f1 + f2; + } + return std::string(1, '(') + f1 + ')' + merger + '(' + f2 + ')'; + }; + } +}; // namespace CLI + +/// Class wrapping some of the accessors of Validator +class CustomValidator : public Validator { + public: +}; +// The implementation of the built in validators is using the Validator class; +// the user is only expected to use the const (static) versions (since there's no setup). +// Therefore, this is in detail. +namespace detail { + +/// CLI enumeration of different file types +enum class path_type { nonexistent, file, directory }; + +#if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0 +/// get the type of the path from a file name +inline path_type check_path(const char *file) noexcept { + std::error_code ec; + auto stat = std::filesystem::status(file, ec); + if(ec) { + return path_type::nonexistent; + } + switch(stat.type()) { + case std::filesystem::file_type::none: + case std::filesystem::file_type::not_found: + return path_type::nonexistent; + case std::filesystem::file_type::directory: + return path_type::directory; + case std::filesystem::file_type::symlink: + case std::filesystem::file_type::block: + case std::filesystem::file_type::character: + case std::filesystem::file_type::fifo: + case std::filesystem::file_type::socket: + case std::filesystem::file_type::regular: + case std::filesystem::file_type::unknown: + default: + return path_type::file; + } +} +#else +/// get the type of the path from a file name +inline path_type check_path(const char *file) noexcept { +#if defined(_MSC_VER) + struct __stat64 buffer; + if(_stat64(file, &buffer) == 0) { + return ((buffer.st_mode & S_IFDIR) != 0) ? path_type::directory : path_type::file; + } +#else + struct stat buffer; + if(stat(file, &buffer) == 0) { + return ((buffer.st_mode & S_IFDIR) != 0) ? path_type::directory : path_type::file; + } +#endif + return path_type::nonexistent; +} +#endif +/// Check for an existing file (returns error message if check fails) +class ExistingFileValidator : public Validator { + public: + ExistingFileValidator() : Validator("FILE") { + func_ = [](std::string &filename) { + auto path_result = check_path(filename.c_str()); + if(path_result == path_type::nonexistent) { + return "File does not exist: " + filename; + } + if(path_result == path_type::directory) { + return "File is actually a directory: " + filename; + } + return std::string(); + }; + } +}; + +/// Check for an existing directory (returns error message if check fails) +class ExistingDirectoryValidator : public Validator { + public: + ExistingDirectoryValidator() : Validator("DIR") { + func_ = [](std::string &filename) { + auto path_result = check_path(filename.c_str()); + if(path_result == path_type::nonexistent) { + return "Directory does not exist: " + filename; + } + if(path_result == path_type::file) { + return "Directory is actually a file: " + filename; + } + return std::string(); + }; + } +}; + +/// Check for an existing path +class ExistingPathValidator : public Validator { + public: + ExistingPathValidator() : Validator("PATH(existing)") { + func_ = [](std::string &filename) { + auto path_result = check_path(filename.c_str()); + if(path_result == path_type::nonexistent) { + return "Path does not exist: " + filename; + } + return std::string(); + }; + } +}; + +/// Check for an non-existing path +class NonexistentPathValidator : public Validator { + public: + NonexistentPathValidator() : Validator("PATH(non-existing)") { + func_ = [](std::string &filename) { + auto path_result = check_path(filename.c_str()); + if(path_result != path_type::nonexistent) { + return "Path already exists: " + filename; + } + return std::string(); + }; + } +}; + +/// Validate the given string is a legal ipv4 address +class IPV4Validator : public Validator { + public: + IPV4Validator() : Validator("IPV4") { + func_ = [](std::string &ip_addr) { + auto result = CLI::detail::split(ip_addr, '.'); + if(result.size() != 4) { + return std::string("Invalid IPV4 address must have four parts (") + ip_addr + ')'; + } + int num; + for(const auto &var : result) { + bool retval = detail::lexical_cast(var, num); + if(!retval) { + return std::string("Failed parsing number (") + var + ')'; + } + if(num < 0 || num > 255) { + return std::string("Each IP number must be between 0 and 255 ") + var; + } + } + return std::string(); + }; + } +}; + +} // namespace detail + +// Static is not needed here, because global const implies static. + +/// Check for existing file (returns error message if check fails) +const detail::ExistingFileValidator ExistingFile; + +/// Check for an existing directory (returns error message if check fails) +const detail::ExistingDirectoryValidator ExistingDirectory; + +/// Check for an existing path +const detail::ExistingPathValidator ExistingPath; + +/// Check for an non-existing path +const detail::NonexistentPathValidator NonexistentPath; + +/// Check for an IP4 address +const detail::IPV4Validator ValidIPV4; + +/// Validate the input as a particular type +template class TypeValidator : public Validator { + public: + explicit TypeValidator(const std::string &validator_name) : Validator(validator_name) { + func_ = [](std::string &input_string) { + auto val = DesiredType(); + if(!detail::lexical_cast(input_string, val)) { + return std::string("Failed parsing ") + input_string + " as a " + detail::type_name(); + } + return std::string(); + }; + } + TypeValidator() : TypeValidator(detail::type_name()) {} +}; + +/// Check for a number +const TypeValidator Number("NUMBER"); + +/// Modify a path if the file is a particular default location, can be used as Check or transform +/// with the error return optionally disabled +class FileOnDefaultPath : public Validator { + public: + explicit FileOnDefaultPath(std::string default_path, bool enableErrorReturn = true) : Validator("FILE") { + func_ = [default_path, enableErrorReturn](std::string &filename) { + auto path_result = detail::check_path(filename.c_str()); + if(path_result == detail::path_type::nonexistent) { + std::string test_file_path = default_path; + if(default_path.back() != '/' && default_path.back() != '\\') { + // Add folder separator + test_file_path += '/'; + } + test_file_path.append(filename); + path_result = detail::check_path(test_file_path.c_str()); + if(path_result == detail::path_type::file) { + filename = test_file_path; + } else { + if(enableErrorReturn) { + return "File does not exist: " + filename; + } + } + } + return std::string{}; + }; + } +}; + +/// Produce a range (factory). Min and max are inclusive. +class Range : public Validator { + public: + /// This produces a range with min and max inclusive. + /// + /// Note that the constructor is templated, but the struct is not, so C++17 is not + /// needed to provide nice syntax for Range(a,b). + template + Range(T min_val, T max_val, const std::string &validator_name = std::string{}) : Validator(validator_name) { + if(validator_name.empty()) { + std::stringstream out; + out << detail::type_name() << " in [" << min_val << " - " << max_val << "]"; + description(out.str()); + } + + func_ = [min_val, max_val](std::string &input) { + T val; + bool converted = detail::lexical_cast(input, val); + if((!converted) || (val < min_val || val > max_val)) { + std::stringstream out; + out << "Value " << input << " not in range ["; + out << min_val << " - " << max_val << "]"; + return out.str(); + } + return std::string{}; + }; + } + + /// Range of one value is 0 to value + template + explicit Range(T max_val, const std::string &validator_name = std::string{}) + : Range(static_cast(0), max_val, validator_name) {} +}; + +/// Check for a non negative number +const Range NonNegativeNumber((std::numeric_limits::max)(), "NONNEGATIVE"); + +/// Check for a positive valued number (val>0.0), min() her is the smallest positive number +const Range PositiveNumber((std::numeric_limits::min)(), (std::numeric_limits::max)(), "POSITIVE"); + +/// Produce a bounded range (factory). Min and max are inclusive. +class Bound : public Validator { + public: + /// This bounds a value with min and max inclusive. + /// + /// Note that the constructor is templated, but the struct is not, so C++17 is not + /// needed to provide nice syntax for Range(a,b). + template Bound(T min_val, T max_val) { + std::stringstream out; + out << detail::type_name() << " bounded to [" << min_val << " - " << max_val << "]"; + description(out.str()); + + func_ = [min_val, max_val](std::string &input) { + T val; + bool converted = detail::lexical_cast(input, val); + if(!converted) { + return std::string("Value ") + input + " could not be converted"; + } + if(val < min_val) + input = detail::to_string(min_val); + else if(val > max_val) + input = detail::to_string(max_val); + + return std::string{}; + }; + } + + /// Range of one value is 0 to value + template explicit Bound(T max_val) : Bound(static_cast(0), max_val) {} +}; + +namespace detail { +template ::type>::value, detail::enabler> = detail::dummy> +auto smart_deref(T value) -> decltype(*value) { + return *value; +} + +template < + typename T, + enable_if_t::type>::value, detail::enabler> = detail::dummy> +typename std::remove_reference::type &smart_deref(T &value) { + return value; +} +/// Generate a string representation of a set +template std::string generate_set(const T &set) { + using element_t = typename detail::element_type::type; + using iteration_type_t = typename detail::pair_adaptor::value_type; // the type of the object pair + std::string out(1, '{'); + out.append(detail::join( + detail::smart_deref(set), + [](const iteration_type_t &v) { return detail::pair_adaptor::first(v); }, + ",")); + out.push_back('}'); + return out; +} + +/// Generate a string representation of a map +template std::string generate_map(const T &map, bool key_only = false) { + using element_t = typename detail::element_type::type; + using iteration_type_t = typename detail::pair_adaptor::value_type; // the type of the object pair + std::string out(1, '{'); + out.append(detail::join( + detail::smart_deref(map), + [key_only](const iteration_type_t &v) { + std::string res{detail::to_string(detail::pair_adaptor::first(v))}; + + if(!key_only) { + res.append("->"); + res += detail::to_string(detail::pair_adaptor::second(v)); + } + return res; + }, + ",")); + out.push_back('}'); + return out; +} + +template struct has_find { + template + static auto test(int) -> decltype(std::declval().find(std::declval()), std::true_type()); + template static auto test(...) -> decltype(std::false_type()); + + static const auto value = decltype(test(0))::value; + using type = std::integral_constant; +}; + +/// A search function +template ::value, detail::enabler> = detail::dummy> +auto search(const T &set, const V &val) -> std::pair { + using element_t = typename detail::element_type::type; + auto &setref = detail::smart_deref(set); + auto it = std::find_if(std::begin(setref), std::end(setref), [&val](decltype(*std::begin(setref)) v) { + return (detail::pair_adaptor::first(v) == val); + }); + return {(it != std::end(setref)), it}; +} + +/// A search function that uses the built in find function +template ::value, detail::enabler> = detail::dummy> +auto search(const T &set, const V &val) -> std::pair { + auto &setref = detail::smart_deref(set); + auto it = setref.find(val); + return {(it != std::end(setref)), it}; +} + +/// A search function with a filter function +template +auto search(const T &set, const V &val, const std::function &filter_function) + -> std::pair { + using element_t = typename detail::element_type::type; + // do the potentially faster first search + auto res = search(set, val); + if((res.first) || (!(filter_function))) { + return res; + } + // if we haven't found it do the longer linear search with all the element translations + auto &setref = detail::smart_deref(set); + auto it = std::find_if(std::begin(setref), std::end(setref), [&](decltype(*std::begin(setref)) v) { + V a{detail::pair_adaptor::first(v)}; + a = filter_function(a); + return (a == val); + }); + return {(it != std::end(setref)), it}; +} + +// the following suggestion was made by Nikita Ofitserov(@himikof) +// done in templates to prevent compiler warnings on negation of unsigned numbers + +/// Do a check for overflow on signed numbers +template +inline typename std::enable_if::value, T>::type overflowCheck(const T &a, const T &b) { + if((a > 0) == (b > 0)) { + return ((std::numeric_limits::max)() / (std::abs)(a) < (std::abs)(b)); + } else { + return ((std::numeric_limits::min)() / (std::abs)(a) > -(std::abs)(b)); + } +} +/// Do a check for overflow on unsigned numbers +template +inline typename std::enable_if::value, T>::type overflowCheck(const T &a, const T &b) { + return ((std::numeric_limits::max)() / a < b); +} + +/// Performs a *= b; if it doesn't cause integer overflow. Returns false otherwise. +template typename std::enable_if::value, bool>::type checked_multiply(T &a, T b) { + if(a == 0 || b == 0 || a == 1 || b == 1) { + a *= b; + return true; + } + if(a == (std::numeric_limits::min)() || b == (std::numeric_limits::min)()) { + return false; + } + if(overflowCheck(a, b)) { + return false; + } + a *= b; + return true; +} + +/// Performs a *= b; if it doesn't equal infinity. Returns false otherwise. +template +typename std::enable_if::value, bool>::type checked_multiply(T &a, T b) { + T c = a * b; + if(std::isinf(c) && !std::isinf(a) && !std::isinf(b)) { + return false; + } + a = c; + return true; +} + +} // namespace detail +/// Verify items are in a set +class IsMember : public Validator { + public: + using filter_fn_t = std::function; + + /// This allows in-place construction using an initializer list + template + IsMember(std::initializer_list values, Args &&...args) + : IsMember(std::vector(values), std::forward(args)...) {} + + /// This checks to see if an item is in a set (empty function) + template explicit IsMember(T &&set) : IsMember(std::forward(set), nullptr) {} + + /// This checks to see if an item is in a set: pointer or copy version. You can pass in a function that will filter + /// both sides of the comparison before computing the comparison. + template explicit IsMember(T set, F filter_function) { + + // Get the type of the contained item - requires a container have ::value_type + // if the type does not have first_type and second_type, these are both value_type + using element_t = typename detail::element_type::type; // Removes (smart) pointers if needed + using item_t = typename detail::pair_adaptor::first_type; // Is value_type if not a map + + using local_item_t = typename IsMemberType::type; // This will convert bad types to good ones + // (const char * to std::string) + + // Make a local copy of the filter function, using a std::function if not one already + std::function filter_fn = filter_function; + + // This is the type name for help, it will take the current version of the set contents + desc_function_ = [set]() { return detail::generate_set(detail::smart_deref(set)); }; + + // This is the function that validates + // It stores a copy of the set pointer-like, so shared_ptr will stay alive + func_ = [set, filter_fn](std::string &input) { + local_item_t b; + if(!detail::lexical_cast(input, b)) { + throw ValidationError(input); // name is added later + } + if(filter_fn) { + b = filter_fn(b); + } + auto res = detail::search(set, b, filter_fn); + if(res.first) { + // Make sure the version in the input string is identical to the one in the set + if(filter_fn) { + input = detail::value_string(detail::pair_adaptor::first(*(res.second))); + } + + // Return empty error string (success) + return std::string{}; + } + + // If you reach this point, the result was not found + return input + " not in " + detail::generate_set(detail::smart_deref(set)); + }; + } + + /// You can pass in as many filter functions as you like, they nest (string only currently) + template + IsMember(T &&set, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&...other) + : IsMember( + std::forward(set), + [filter_fn_1, filter_fn_2](std::string a) { return filter_fn_2(filter_fn_1(a)); }, + other...) {} +}; + +/// definition of the default transformation object +template using TransformPairs = std::vector>; + +/// Translate named items to other or a value set +class Transformer : public Validator { + public: + using filter_fn_t = std::function; + + /// This allows in-place construction + template + Transformer(std::initializer_list> values, Args &&...args) + : Transformer(TransformPairs(values), std::forward(args)...) {} + + /// direct map of std::string to std::string + template explicit Transformer(T &&mapping) : Transformer(std::forward(mapping), nullptr) {} + + /// This checks to see if an item is in a set: pointer or copy version. You can pass in a function that will filter + /// both sides of the comparison before computing the comparison. + template explicit Transformer(T mapping, F filter_function) { + + static_assert(detail::pair_adaptor::type>::value, + "mapping must produce value pairs"); + // Get the type of the contained item - requires a container have ::value_type + // if the type does not have first_type and second_type, these are both value_type + using element_t = typename detail::element_type::type; // Removes (smart) pointers if needed + using item_t = typename detail::pair_adaptor::first_type; // Is value_type if not a map + using local_item_t = typename IsMemberType::type; // Will convert bad types to good ones + // (const char * to std::string) + + // Make a local copy of the filter function, using a std::function if not one already + std::function filter_fn = filter_function; + + // This is the type name for help, it will take the current version of the set contents + desc_function_ = [mapping]() { return detail::generate_map(detail::smart_deref(mapping)); }; + + func_ = [mapping, filter_fn](std::string &input) { + local_item_t b; + if(!detail::lexical_cast(input, b)) { + return std::string(); + // there is no possible way we can match anything in the mapping if we can't convert so just return + } + if(filter_fn) { + b = filter_fn(b); + } + auto res = detail::search(mapping, b, filter_fn); + if(res.first) { + input = detail::value_string(detail::pair_adaptor::second(*res.second)); + } + return std::string{}; + }; + } + + /// You can pass in as many filter functions as you like, they nest + template + Transformer(T &&mapping, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&...other) + : Transformer( + std::forward(mapping), + [filter_fn_1, filter_fn_2](std::string a) { return filter_fn_2(filter_fn_1(a)); }, + other...) {} +}; + +/// translate named items to other or a value set +class CheckedTransformer : public Validator { + public: + using filter_fn_t = std::function; + + /// This allows in-place construction + template + CheckedTransformer(std::initializer_list> values, Args &&...args) + : CheckedTransformer(TransformPairs(values), std::forward(args)...) {} + + /// direct map of std::string to std::string + template explicit CheckedTransformer(T mapping) : CheckedTransformer(std::move(mapping), nullptr) {} + + /// This checks to see if an item is in a set: pointer or copy version. You can pass in a function that will filter + /// both sides of the comparison before computing the comparison. + template explicit CheckedTransformer(T mapping, F filter_function) { + + static_assert(detail::pair_adaptor::type>::value, + "mapping must produce value pairs"); + // Get the type of the contained item - requires a container have ::value_type + // if the type does not have first_type and second_type, these are both value_type + using element_t = typename detail::element_type::type; // Removes (smart) pointers if needed + using item_t = typename detail::pair_adaptor::first_type; // Is value_type if not a map + using local_item_t = typename IsMemberType::type; // Will convert bad types to good ones + // (const char * to std::string) + using iteration_type_t = typename detail::pair_adaptor::value_type; // the type of the object pair + + // Make a local copy of the filter function, using a std::function if not one already + std::function filter_fn = filter_function; + + auto tfunc = [mapping]() { + std::string out("value in "); + out += detail::generate_map(detail::smart_deref(mapping)) + " OR {"; + out += detail::join( + detail::smart_deref(mapping), + [](const iteration_type_t &v) { return detail::to_string(detail::pair_adaptor::second(v)); }, + ","); + out.push_back('}'); + return out; + }; + + desc_function_ = tfunc; + + func_ = [mapping, tfunc, filter_fn](std::string &input) { + local_item_t b; + bool converted = detail::lexical_cast(input, b); + if(converted) { + if(filter_fn) { + b = filter_fn(b); + } + auto res = detail::search(mapping, b, filter_fn); + if(res.first) { + input = detail::value_string(detail::pair_adaptor::second(*res.second)); + return std::string{}; + } + } + for(const auto &v : detail::smart_deref(mapping)) { + auto output_string = detail::value_string(detail::pair_adaptor::second(v)); + if(output_string == input) { + return std::string(); + } + } + + return "Check " + input + " " + tfunc() + " FAILED"; + }; + } + + /// You can pass in as many filter functions as you like, they nest + template + CheckedTransformer(T &&mapping, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&...other) + : CheckedTransformer( + std::forward(mapping), + [filter_fn_1, filter_fn_2](std::string a) { return filter_fn_2(filter_fn_1(a)); }, + other...) {} +}; + +/// Helper function to allow ignore_case to be passed to IsMember or Transform +inline std::string ignore_case(std::string item) { return detail::to_lower(item); } + +/// Helper function to allow ignore_underscore to be passed to IsMember or Transform +inline std::string ignore_underscore(std::string item) { return detail::remove_underscore(item); } + +/// Helper function to allow checks to ignore spaces to be passed to IsMember or Transform +inline std::string ignore_space(std::string item) { + item.erase(std::remove(std::begin(item), std::end(item), ' '), std::end(item)); + item.erase(std::remove(std::begin(item), std::end(item), '\t'), std::end(item)); + return item; +} + +/// Multiply a number by a factor using given mapping. +/// Can be used to write transforms for SIZE or DURATION inputs. +/// +/// Example: +/// With mapping = `{"b"->1, "kb"->1024, "mb"->1024*1024}` +/// one can recognize inputs like "100", "12kb", "100 MB", +/// that will be automatically transformed to 100, 14448, 104857600. +/// +/// Output number type matches the type in the provided mapping. +/// Therefore, if it is required to interpret real inputs like "0.42 s", +/// the mapping should be of a type or . +class AsNumberWithUnit : public Validator { + public: + /// Adjust AsNumberWithUnit behavior. + /// CASE_SENSITIVE/CASE_INSENSITIVE controls how units are matched. + /// UNIT_OPTIONAL/UNIT_REQUIRED throws ValidationError + /// if UNIT_REQUIRED is set and unit literal is not found. + enum Options { + CASE_SENSITIVE = 0, + CASE_INSENSITIVE = 1, + UNIT_OPTIONAL = 0, + UNIT_REQUIRED = 2, + DEFAULT = CASE_INSENSITIVE | UNIT_OPTIONAL + }; + + template + explicit AsNumberWithUnit(std::map mapping, + Options opts = DEFAULT, + const std::string &unit_name = "UNIT") { + description(generate_description(unit_name, opts)); + validate_mapping(mapping, opts); + + // transform function + func_ = [mapping, opts](std::string &input) -> std::string { + Number num; + + detail::rtrim(input); + if(input.empty()) { + throw ValidationError("Input is empty"); + } + + // Find split position between number and prefix + auto unit_begin = input.end(); + while(unit_begin > input.begin() && std::isalpha(*(unit_begin - 1), std::locale())) { + --unit_begin; + } + + std::string unit{unit_begin, input.end()}; + input.resize(static_cast(std::distance(input.begin(), unit_begin))); + detail::trim(input); + + if(opts & UNIT_REQUIRED && unit.empty()) { + throw ValidationError("Missing mandatory unit"); + } + if(opts & CASE_INSENSITIVE) { + unit = detail::to_lower(unit); + } + if(unit.empty()) { + if(!detail::lexical_cast(input, num)) { + throw ValidationError(std::string("Value ") + input + " could not be converted to " + + detail::type_name()); + } + // No need to modify input if no unit passed + return {}; + } + + // find corresponding factor + auto it = mapping.find(unit); + if(it == mapping.end()) { + throw ValidationError(unit + + " unit not recognized. " + "Allowed values: " + + detail::generate_map(mapping, true)); + } + + if(!input.empty()) { + bool converted = detail::lexical_cast(input, num); + if(!converted) { + throw ValidationError(std::string("Value ") + input + " could not be converted to " + + detail::type_name()); + } + // perform safe multiplication + bool ok = detail::checked_multiply(num, it->second); + if(!ok) { + throw ValidationError(detail::to_string(num) + " multiplied by " + unit + + " factor would cause number overflow. Use smaller value."); + } + } else { + num = static_cast(it->second); + } + + input = detail::to_string(num); + + return {}; + }; + } + + private: + /// Check that mapping contains valid units. + /// Update mapping for CASE_INSENSITIVE mode. + template static void validate_mapping(std::map &mapping, Options opts) { + for(auto &kv : mapping) { + if(kv.first.empty()) { + throw ValidationError("Unit must not be empty."); + } + if(!detail::isalpha(kv.first)) { + throw ValidationError("Unit must contain only letters."); + } + } + + // make all units lowercase if CASE_INSENSITIVE + if(opts & CASE_INSENSITIVE) { + std::map lower_mapping; + for(auto &kv : mapping) { + auto s = detail::to_lower(kv.first); + if(lower_mapping.count(s)) { + throw ValidationError(std::string("Several matching lowercase unit representations are found: ") + + s); + } + lower_mapping[detail::to_lower(kv.first)] = kv.second; + } + mapping = std::move(lower_mapping); + } + } + + /// Generate description like this: NUMBER [UNIT] + template static std::string generate_description(const std::string &name, Options opts) { + std::stringstream out; + out << detail::type_name() << ' '; + if(opts & UNIT_REQUIRED) { + out << name; + } else { + out << '[' << name << ']'; + } + return out.str(); + } +}; + +/// Converts a human-readable size string (with unit literal) to uin64_t size. +/// Example: +/// "100" => 100 +/// "1 b" => 100 +/// "10Kb" => 10240 // you can configure this to be interpreted as kilobyte (*1000) or kibibyte (*1024) +/// "10 KB" => 10240 +/// "10 kb" => 10240 +/// "10 kib" => 10240 // *i, *ib are always interpreted as *bibyte (*1024) +/// "10kb" => 10240 +/// "2 MB" => 2097152 +/// "2 EiB" => 2^61 // Units up to exibyte are supported +class AsSizeValue : public AsNumberWithUnit { + public: + using result_t = std::uint64_t; + + /// If kb_is_1000 is true, + /// interpret 'kb', 'k' as 1000 and 'kib', 'ki' as 1024 + /// (same applies to higher order units as well). + /// Otherwise, interpret all literals as factors of 1024. + /// The first option is formally correct, but + /// the second interpretation is more wide-spread + /// (see https://en.wikipedia.org/wiki/Binary_prefix). + explicit AsSizeValue(bool kb_is_1000) : AsNumberWithUnit(get_mapping(kb_is_1000)) { + if(kb_is_1000) { + description("SIZE [b, kb(=1000b), kib(=1024b), ...]"); + } else { + description("SIZE [b, kb(=1024b), ...]"); + } + } + + private: + /// Get mapping + static std::map init_mapping(bool kb_is_1000) { + std::map m; + result_t k_factor = kb_is_1000 ? 1000 : 1024; + result_t ki_factor = 1024; + result_t k = 1; + result_t ki = 1; + m["b"] = 1; + for(std::string p : {"k", "m", "g", "t", "p", "e"}) { + k *= k_factor; + ki *= ki_factor; + m[p] = k; + m[p + "b"] = k; + m[p + "i"] = ki; + m[p + "ib"] = ki; + } + return m; + } + + /// Cache calculated mapping + static std::map get_mapping(bool kb_is_1000) { + if(kb_is_1000) { + static auto m = init_mapping(true); + return m; + } else { + static auto m = init_mapping(false); + return m; + } + } +}; + +namespace detail { +/// Split a string into a program name and command line arguments +/// the string is assumed to contain a file name followed by other arguments +/// the return value contains is a pair with the first argument containing the program name and the second +/// everything else. +inline std::pair split_program_name(std::string commandline) { + // try to determine the programName + std::pair vals; + trim(commandline); + auto esp = commandline.find_first_of(' ', 1); + while(detail::check_path(commandline.substr(0, esp).c_str()) != path_type::file) { + esp = commandline.find_first_of(' ', esp + 1); + if(esp == std::string::npos) { + // if we have reached the end and haven't found a valid file just assume the first argument is the + // program name + if(commandline[0] == '"' || commandline[0] == '\'' || commandline[0] == '`') { + bool embeddedQuote = false; + auto keyChar = commandline[0]; + auto end = commandline.find_first_of(keyChar, 1); + while((end != std::string::npos) && (commandline[end - 1] == '\\')) { // deal with escaped quotes + end = commandline.find_first_of(keyChar, end + 1); + embeddedQuote = true; + } + if(end != std::string::npos) { + vals.first = commandline.substr(1, end - 1); + esp = end + 1; + if(embeddedQuote) { + vals.first = find_and_replace(vals.first, std::string("\\") + keyChar, std::string(1, keyChar)); + } + } else { + esp = commandline.find_first_of(' ', 1); + } + } else { + esp = commandline.find_first_of(' ', 1); + } + + break; + } + } + if(vals.first.empty()) { + vals.first = commandline.substr(0, esp); + rtrim(vals.first); + } + + // strip the program name + vals.second = (esp != std::string::npos) ? commandline.substr(esp + 1) : std::string{}; + ltrim(vals.second); + return vals; +} + +} // namespace detail +/// @} + + + + +class Option; +class App; + +/// This enum signifies the type of help requested +/// +/// This is passed in by App; all user classes must accept this as +/// the second argument. + +enum class AppFormatMode { + Normal, ///< The normal, detailed help + All, ///< A fully expanded help + Sub, ///< Used when printed as part of expanded subcommand +}; + +/// This is the minimum requirements to run a formatter. +/// +/// A user can subclass this is if they do not care at all +/// about the structure in CLI::Formatter. +class FormatterBase { + protected: + /// @name Options + ///@{ + + /// The width of the first column + std::size_t column_width_{30}; + + /// @brief The required help printout labels (user changeable) + /// Values are Needs, Excludes, etc. + std::map labels_{}; + + ///@} + /// @name Basic + ///@{ + + public: + FormatterBase() = default; + FormatterBase(const FormatterBase &) = default; + FormatterBase(FormatterBase &&) = default; + + /// Adding a destructor in this form to work around bug in GCC 4.7 + virtual ~FormatterBase() noexcept {} // NOLINT(modernize-use-equals-default) + + /// This is the key method that puts together help + virtual std::string make_help(const App *, std::string, AppFormatMode) const = 0; + + ///@} + /// @name Setters + ///@{ + + /// Set the "REQUIRED" label + void label(std::string key, std::string val) { labels_[key] = val; } + + /// Set the column width + void column_width(std::size_t val) { column_width_ = val; } + + ///@} + /// @name Getters + ///@{ + + /// Get the current value of a name (REQUIRED, etc.) + std::string get_label(std::string key) const { + if(labels_.find(key) == labels_.end()) + return key; + else + return labels_.at(key); + } + + /// Get the current column width + std::size_t get_column_width() const { return column_width_; } + + ///@} +}; + +/// This is a specialty override for lambda functions +class FormatterLambda final : public FormatterBase { + using funct_t = std::function; + + /// The lambda to hold and run + funct_t lambda_; + + public: + /// Create a FormatterLambda with a lambda function + explicit FormatterLambda(funct_t funct) : lambda_(std::move(funct)) {} + + /// Adding a destructor (mostly to make GCC 4.7 happy) + ~FormatterLambda() noexcept override {} // NOLINT(modernize-use-equals-default) + + /// This will simply call the lambda function + std::string make_help(const App *app, std::string name, AppFormatMode mode) const override { + return lambda_(app, name, mode); + } +}; + +/// This is the default Formatter for CLI11. It pretty prints help output, and is broken into quite a few +/// overridable methods, to be highly customizable with minimal effort. +class Formatter : public FormatterBase { + public: + Formatter() = default; + Formatter(const Formatter &) = default; + Formatter(Formatter &&) = default; + + /// @name Overridables + ///@{ + + /// This prints out a group of options with title + /// + virtual std::string make_group(std::string group, bool is_positional, std::vector opts) const; + + /// This prints out just the positionals "group" + virtual std::string make_positionals(const App *app) const; + + /// This prints out all the groups of options + std::string make_groups(const App *app, AppFormatMode mode) const; + + /// This prints out all the subcommands + virtual std::string make_subcommands(const App *app, AppFormatMode mode) const; + + /// This prints out a subcommand + virtual std::string make_subcommand(const App *sub) const; + + /// This prints out a subcommand in help-all + virtual std::string make_expanded(const App *sub) const; + + /// This prints out all the groups of options + virtual std::string make_footer(const App *app) const; + + /// This displays the description line + virtual std::string make_description(const App *app) const; + + /// This displays the usage line + virtual std::string make_usage(const App *app, std::string name) const; + + /// This puts everything together + std::string make_help(const App * /*app*/, std::string, AppFormatMode) const override; + + ///@} + /// @name Options + ///@{ + + /// This prints out an option help line, either positional or optional form + virtual std::string make_option(const Option *opt, bool is_positional) const { + std::stringstream out; + detail::format_help( + out, make_option_name(opt, is_positional) + make_option_opts(opt), make_option_desc(opt), column_width_); + return out.str(); + } + + /// @brief This is the name part of an option, Default: left column + virtual std::string make_option_name(const Option *, bool) const; + + /// @brief This is the options part of the name, Default: combined into left column + virtual std::string make_option_opts(const Option *) const; + + /// @brief This is the description. Default: Right column, on new line if left column too large + virtual std::string make_option_desc(const Option *) const; + + /// @brief This is used to print the name on the USAGE line + virtual std::string make_option_usage(const Option *opt) const; + + ///@} +}; + + + + +using results_t = std::vector; +/// callback function definition +using callback_t = std::function; + +class Option; +class App; + +using Option_p = std::unique_ptr